From: Andrea Bianco Date: Sun, 16 Feb 2020 17:20:15 +0000 (+0100) Subject: Built motion from commit (unavailable).|2.4.7 X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=934ed750ce0c227cbe4bd327d46fc997fb3fe601;p=motion2.git Built motion from commit (unavailable).|2.4.7 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 496956e..8cb01b3 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.4.7", "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-02-16T15:28:58.500Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); +define({ "name": "xCALLY Motion API", "version": "2.4.7", "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-02-16T17:03:28.637Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 59c6b94..4540ab1 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1 +1 @@ -{ "name": "xCALLY Motion API", "version": "2.4.7", "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-02-16T15:28:58.500Z", "url": "http://apidocjs.com", "version": "0.17.7" } } +{ "name": "xCALLY Motion API", "version": "2.4.7", "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-02-16T17:03:28.637Z", "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 5a68178..98afba4 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 _0x1b1c=['motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1b1c,0x76));var _0xc1b1=function(_0x2bd1f5,_0x8db4ec){_0x2bd1f5=_0x2bd1f5-0x0;var _0x43a4b3=_0x1b1c[_0x2bd1f5];return _0x43a4b3;};'use strict';var Sequelize=require(_0xc1b1('0x0'));module[_0xc1b1('0x1')]={'name':{'type':Sequelize[_0xc1b1('0x2')],'get':function(_0x5f0e8f){return this[_0xc1b1('0x3')](_0xc1b1('0x4'));}},'action':{'type':Sequelize[_0xc1b1('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xc1b1('0x6'),_0xc1b1('0x7'),_0xc1b1('0x8'),_0xc1b1('0x9'),_0xc1b1('0xa'),_0xc1b1('0xb'),'bot',_0xc1b1('0xc')]],'msg':_0xc1b1('0xd')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xc1b1('0xe')},'data2':{'type':Sequelize[_0xc1b1('0x5')](0x1000),'comment':_0xc1b1('0xf')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xc1b1('0x10')},'data4':{'type':Sequelize[_0xc1b1('0x5')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0xc1b1('0x11')]}}; \ No newline at end of file +var _0xa379=['getDataValue','action','STRING','contactManager','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports'];(function(_0x2a5a84,_0x457143){var _0x616270=function(_0x247308){while(--_0x247308){_0x2a5a84['push'](_0x2a5a84['shift']());}};_0x616270(++_0x457143);}(_0xa379,0xec));var _0x9a37=function(_0x1db36b,_0x34b2c6){_0x1db36b=_0x1db36b-0x0;var _0x4b637c=_0xa379[_0x1db36b];return _0x4b637c;};'use strict';var Sequelize=require(_0x9a37('0x0'));module[_0x9a37('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x144068){return this[_0x9a37('0x2')](_0x9a37('0x3'));}},'action':{'type':Sequelize[_0x9a37('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x9a37('0x5'),_0x9a37('0x6'),_0x9a37('0x7'),'jscripty',_0x9a37('0x8'),_0x9a37('0x9'),_0x9a37('0xa'),_0x9a37('0xb')]],'msg':_0x9a37('0xc')}},'comment':_0x9a37('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x9a37('0xd')},'data2':{'type':Sequelize[_0x9a37('0x4')](0x1000),'comment':_0x9a37('0xe')},'data3':{'type':Sequelize[_0x9a37('0x4')](0x1000),'comment':_0x9a37('0xf')},'data4':{'type':Sequelize[_0x9a37('0x4')](0x1000)},'data5':{'type':Sequelize[_0x9a37('0x4')](0x1000)},'data6':{'type':Sequelize[_0x9a37('0x4')]},'data7':{'type':Sequelize[_0x9a37('0x10')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index cc7bae7..df3b80a 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 _0x8b26=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','save','then','name','send','update','body','find','catch','destroy','Action','html-pdf','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x95e9db,_0x212bd0){var _0x5aef2e=function(_0x14945d){while(--_0x14945d){_0x95e9db['push'](_0x95e9db['shift']());}};_0x5aef2e(++_0x212bd0);}(_0x8b26,0x1f3));var _0x68b2=function(_0x36afd7,_0x1181dc){_0x36afd7=_0x36afd7-0x0;var _0x2e0da0=_0x8b26[_0x36afd7];return _0x2e0da0;};'use strict';var pdf=require(_0x68b2('0x0'));var emlformat=require(_0x68b2('0x1'));var rimraf=require(_0x68b2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x68b2('0x3'));var rp=require(_0x68b2('0x4'));var moment=require(_0x68b2('0x5'));var BPromise=require(_0x68b2('0x6'));var Mustache=require(_0x68b2('0x7'));var util=require(_0x68b2('0x8'));var path=require(_0x68b2('0x9'));var sox=require(_0x68b2('0xa'));var csv=require(_0x68b2('0xb'));var ejs=require(_0x68b2('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x68b2('0xd'));var crypto=require(_0x68b2('0xe'));var jsforce=require(_0x68b2('0xf'));var deskjs=require(_0x68b2('0x10'));var toCsv=require('to-csv');var querystring=require(_0x68b2('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x68b2('0x12'));var qs=require(_0x68b2('0x13'));var hardwareService=require(_0x68b2('0x14'));var logger=require('../../config/logger')(_0x68b2('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x68b2('0x16'))['db'];function respondWithStatusCode(_0x1a12d3,_0x2688a8){_0x2688a8=_0x2688a8||0xcc;return function(_0x472495){if(_0x472495){return _0x1a12d3[_0x68b2('0x17')](_0x2688a8);}return _0x1a12d3[_0x68b2('0x18')](_0x2688a8)[_0x68b2('0x19')]();};}function respondWithResult(_0x3b216f,_0x43536e){_0x43536e=_0x43536e||0xc8;return function(_0x2a35a1){if(_0x2a35a1){return _0x3b216f[_0x68b2('0x18')](_0x43536e)['json'](_0x2a35a1);}};}function respondWithFilteredResult(_0x36cb47,_0x34881a){return function(_0x9c1acb){if(_0x9c1acb){var _0x1f1e43=_0x9c1acb['count'],_0xffd6d0=_0x34881a[_0x68b2('0x1a')],_0x528823=_0x34881a[_0x68b2('0x1a')]+_0x34881a[_0x68b2('0x1b')],_0x1b9955;if(_0x528823>=_0x1f1e43){_0x528823=_0x1f1e43;_0x1b9955=0xc8;}else{_0x1b9955=0xce;}_0x36cb47['status'](_0x1b9955);return _0x36cb47['set'](_0x68b2('0x1c'),_0xffd6d0+'-'+_0x528823+'/'+_0x1f1e43)[_0x68b2('0x1d')](_0x9c1acb);}return null;};}function patchUpdates(_0x42e318){return function(_0x5836a5){try{jsonpatch[_0x68b2('0x1e')](_0x5836a5,_0x42e318,!![]);}catch(_0x3b8a4a){return BPromise[_0x68b2('0x1f')](_0x3b8a4a);}return _0x5836a5[_0x68b2('0x20')]();};}function saveUpdates(_0x313704,_0x240c89){return function(_0x8ddd65){if(_0x8ddd65){return _0x8ddd65['update'](_0x313704)[_0x68b2('0x21')](function(_0x128c6b){return _0x128c6b;});}return null;};}function removeEntity(_0x1b159a,_0x46b5c4){return function(_0x3df744){if(_0x3df744){return _0x3df744['destroy']()[_0x68b2('0x21')](function(){_0x1b159a[_0x68b2('0x18')](0xcc)[_0x68b2('0x19')]();});}};}function handleEntityNotFound(_0x3be271,_0x5bda53){return function(_0xb835ba){if(!_0xb835ba){_0x3be271['sendStatus'](0x194);}return _0xb835ba;};}function handleError(_0x1ed70d,_0x25eed7){_0x25eed7=_0x25eed7||0x1f4;return function(_0x41d80d){logger['error'](_0x41d80d['stack']);if(_0x41d80d[_0x68b2('0x22')]){delete _0x41d80d['name'];}_0x1ed70d[_0x68b2('0x18')](_0x25eed7)[_0x68b2('0x23')](_0x41d80d);};}exports[_0x68b2('0x24')]=function(_0x2bb475,_0x5ea8e9){if(_0x2bb475[_0x68b2('0x25')]['id']){delete _0x2bb475[_0x68b2('0x25')]['id'];}return db['Action'][_0x68b2('0x26')]({'where':{'id':_0x2bb475['params']['id']}})[_0x68b2('0x21')](handleEntityNotFound(_0x5ea8e9,null))['then'](saveUpdates(_0x2bb475[_0x68b2('0x25')],null))[_0x68b2('0x21')](respondWithResult(_0x5ea8e9,null))[_0x68b2('0x27')](handleError(_0x5ea8e9,null));};exports[_0x68b2('0x28')]=function(_0x5e2e29,_0x4d3d8f){return db[_0x68b2('0x29')][_0x68b2('0x26')]({'where':{'id':_0x5e2e29['params']['id']}})[_0x68b2('0x21')](handleEntityNotFound(_0x4d3d8f,null))['then'](removeEntity(_0x4d3d8f,null))[_0x68b2('0x27')](handleError(_0x4d3d8f,null));}; \ No newline at end of file +var _0xebc4=['set','Content-Range','apply','then','error','stack','name','send','update','body','Action','find','params','destroy','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','json','offset'];(function(_0x3dd4ea,_0x1feeea){var _0x20c631=function(_0x43535c){while(--_0x43535c){_0x3dd4ea['push'](_0x3dd4ea['shift']());}};_0x20c631(++_0x1feeea);}(_0xebc4,0xf9));var _0x4ebc=function(_0x4b3618,_0x3f02d8){_0x4b3618=_0x4b3618-0x0;var _0x410aa5=_0xebc4[_0x4b3618];return _0x410aa5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4ebc('0x0'));var rimraf=require(_0x4ebc('0x1'));var zipdir=require(_0x4ebc('0x2'));var jsonpatch=require(_0x4ebc('0x3'));var rp=require('request-promise');var moment=require(_0x4ebc('0x4'));var BPromise=require(_0x4ebc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4ebc('0x6'));var sox=require('sox');var csv=require(_0x4ebc('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4ebc('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4ebc('0x9'));var toCsv=require(_0x4ebc('0x7'));var querystring=require(_0x4ebc('0xa'));var Papa=require(_0x4ebc('0xb'));var Redis=require(_0x4ebc('0xc'));var authService=require(_0x4ebc('0xd'));var qs=require(_0x4ebc('0xe'));var hardwareService=require(_0x4ebc('0xf'));var logger=require(_0x4ebc('0x10'))(_0x4ebc('0x11'));var utils=require('../../config/utils');var config=require(_0x4ebc('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x129780,_0xb38e43){_0xb38e43=_0xb38e43||0xcc;return function(_0xe62b73){if(_0xe62b73){return _0x129780[_0x4ebc('0x13')](_0xb38e43);}return _0x129780['status'](_0xb38e43)[_0x4ebc('0x14')]();};}function respondWithResult(_0x5411b3,_0x1e21de){_0x1e21de=_0x1e21de||0xc8;return function(_0x8fd777){if(_0x8fd777){return _0x5411b3[_0x4ebc('0x15')](_0x1e21de)[_0x4ebc('0x16')](_0x8fd777);}};}function respondWithFilteredResult(_0x1f9453,_0x1f1750){return function(_0x5df59d){if(_0x5df59d){var _0x4a353=_0x5df59d['count'],_0x148dab=_0x1f1750[_0x4ebc('0x17')],_0x1a0b5c=_0x1f1750[_0x4ebc('0x17')]+_0x1f1750['limit'],_0x14591b;if(_0x1a0b5c>=_0x4a353){_0x1a0b5c=_0x4a353;_0x14591b=0xc8;}else{_0x14591b=0xce;}_0x1f9453['status'](_0x14591b);return _0x1f9453[_0x4ebc('0x18')](_0x4ebc('0x19'),_0x148dab+'-'+_0x1a0b5c+'/'+_0x4a353)['json'](_0x5df59d);}return null;};}function patchUpdates(_0x432cb9){return function(_0x28571e){try{jsonpatch[_0x4ebc('0x1a')](_0x28571e,_0x432cb9,!![]);}catch(_0x977c81){return BPromise['reject'](_0x977c81);}return _0x28571e['save']();};}function saveUpdates(_0x249dcf,_0x3e6195){return function(_0x137ec9){if(_0x137ec9){return _0x137ec9['update'](_0x249dcf)[_0x4ebc('0x1b')](function(_0x4e7def){return _0x4e7def;});}return null;};}function removeEntity(_0x6c377b,_0x2e480c){return function(_0x58131d){if(_0x58131d){return _0x58131d['destroy']()[_0x4ebc('0x1b')](function(){_0x6c377b['status'](0xcc)[_0x4ebc('0x14')]();});}};}function handleEntityNotFound(_0xb651eb,_0x269303){return function(_0x1be445){if(!_0x1be445){_0xb651eb[_0x4ebc('0x13')](0x194);}return _0x1be445;};}function handleError(_0x6facb5,_0x57b644){_0x57b644=_0x57b644||0x1f4;return function(_0xe09bfb){logger[_0x4ebc('0x1c')](_0xe09bfb[_0x4ebc('0x1d')]);if(_0xe09bfb['name']){delete _0xe09bfb[_0x4ebc('0x1e')];}_0x6facb5[_0x4ebc('0x15')](_0x57b644)[_0x4ebc('0x1f')](_0xe09bfb);};}exports[_0x4ebc('0x20')]=function(_0x43054d,_0x29816a){if(_0x43054d[_0x4ebc('0x21')]['id']){delete _0x43054d[_0x4ebc('0x21')]['id'];}return db[_0x4ebc('0x22')][_0x4ebc('0x23')]({'where':{'id':_0x43054d[_0x4ebc('0x24')]['id']}})['then'](handleEntityNotFound(_0x29816a,null))[_0x4ebc('0x1b')](saveUpdates(_0x43054d[_0x4ebc('0x21')],null))['then'](respondWithResult(_0x29816a,null))['catch'](handleError(_0x29816a,null));};exports[_0x4ebc('0x25')]=function(_0x27ddc9,_0x2e4c0c){return db[_0x4ebc('0x22')][_0x4ebc('0x23')]({'where':{'id':_0x27ddc9[_0x4ebc('0x24')]['id']}})[_0x4ebc('0x1b')](handleEntityNotFound(_0x2e4c0c,null))[_0x4ebc('0x1b')](removeEntity(_0x2e4c0c,null))[_0x4ebc('0x26')](handleError(_0x2e4c0c,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index d08ed7e..9494033 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 _0xb588=['tools_actions','lodash','util','api','bluebird','rimraf','../../config/environment','exports','define','Action'];(function(_0x32bce8,_0x54f965){var _0x38badc=function(_0x1ed1ee){while(--_0x1ed1ee){_0x32bce8['push'](_0x32bce8['shift']());}};_0x38badc(++_0x54f965);}(_0xb588,0x173));var _0x8b58=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xb588[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x8b58('0x0'));var util=require(_0x8b58('0x1'));var logger=require('../../config/logger')(_0x8b58('0x2'));var moment=require('moment');var BPromise=require(_0x8b58('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8b58('0x4'));var config=require(_0x8b58('0x5'));var attributes=require('./action.attributes');module[_0x8b58('0x6')]=function(_0xe0cda0,_0x590336){return _0xe0cda0[_0x8b58('0x7')](_0x8b58('0x8'),attributes,{'tableName':_0x8b58('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d35=['./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x330acf,_0x4f3459){var _0x2ccb1a=function(_0x5531c7){while(--_0x5531c7){_0x330acf['push'](_0x330acf['shift']());}};_0x2ccb1a(++_0x4f3459);}(_0x7d35,0x1d9));var _0x57d3=function(_0x6edc85,_0x2c7710){_0x6edc85=_0x6edc85-0x0;var _0x4631a9=_0x7d35[_0x6edc85];return _0x4631a9;};'use strict';var _=require(_0x57d3('0x0'));var util=require(_0x57d3('0x1'));var logger=require(_0x57d3('0x2'))('api');var moment=require(_0x57d3('0x3'));var BPromise=require(_0x57d3('0x4'));var rp=require(_0x57d3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57d3('0x6'));var config=require(_0x57d3('0x7'));var attributes=require(_0x57d3('0x8'));module[_0x57d3('0x9')]=function(_0x147434,_0x27fc42){return _0x147434[_0x57d3('0xa')](_0x57d3('0xb'),attributes,{'tableName':_0x57d3('0xc'),'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 7890995..2fa36e1 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 _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(_0x5e1e90,_0x484009){var _0x260e8f=function(_0x5d2113){while(--_0x5d2113){_0x5e1e90['push'](_0x5e1e90['shift']());}};_0x260e8f(++_0x484009);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 _0x70e0=['code','Action,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x530f3c,_0x41d2b5){var _0x352121=function(_0x56b96b){while(--_0x56b96b){_0x530f3c['push'](_0x530f3c['shift']());}};_0x352121(++_0x41d2b5);}(_0x70e0,0x17b));var _0x070e=function(_0x4a8ec2,_0x210378){_0x4a8ec2=_0x4a8ec2-0x0;var _0x34097b=_0x70e0[_0x4a8ec2];return _0x34097b;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('Action,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('Action,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 163e51e..4cb4390 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 _0x769d=['connect-timeout','express','Router','put','/:id','isAuthenticated','update','exports','multer','util','path'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x769d,0xef));var _0xd769=function(_0x58df0e,_0x4d9d0d){_0x58df0e=_0x58df0e-0x0;var _0x5590d6=_0x769d[_0x58df0e];return _0x5590d6;};'use strict';var multer=require(_0xd769('0x0'));var util=require(_0xd769('0x1'));var path=require(_0xd769('0x2'));var timeout=require(_0xd769('0x3'));var express=require(_0xd769('0x4'));var router=express[_0xd769('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./action.controller');router[_0xd769('0x6')](_0xd769('0x7'),auth[_0xd769('0x8')](),controller[_0xd769('0x9')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd769('0xa')]=router; \ No newline at end of file +var _0x4e5d=['./action.controller','put','isAuthenticated','update','delete','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1075b8,_0xd606e2){var _0x5d047f=function(_0x5e6652){while(--_0x5e6652){_0x1075b8['push'](_0x1075b8['shift']());}};_0x5d047f(++_0xd606e2);}(_0x4e5d,0x10d));var _0xd4e5=function(_0x1591f7,_0x5aedd6){_0x1591f7=_0x1591f7-0x0;var _0x4e1517=_0x4e5d[_0x1591f7];return _0x4e1517;};'use strict';var multer=require(_0xd4e5('0x0'));var util=require(_0xd4e5('0x1'));var path=require('path');var timeout=require(_0xd4e5('0x2'));var express=require('express');var router=express[_0xd4e5('0x3')]();var auth=require(_0xd4e5('0x4'));var interaction=require(_0xd4e5('0x5'));var config=require(_0xd4e5('0x6'));var controller=require(_0xd4e5('0x7'));router[_0xd4e5('0x8')]('/:id',auth[_0xd4e5('0x9')](),controller[_0xd4e5('0xa')]);router[_0xd4e5('0xb')]('/:id',auth[_0xd4e5('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index c8716b1..ba40986 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 _0x1d2b=['STRING','TEXT','sequelize','exports'];(function(_0x3bf66a,_0x1a3fb6){var _0x218509=function(_0x269a82){while(--_0x269a82){_0x3bf66a['push'](_0x3bf66a['shift']());}};_0x218509(++_0x1a3fb6);}(_0x1d2b,0xbe));var _0xb1d2=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x1d2b[_0x21aec3];return _0x288bbc;};'use strict';var Sequelize=require(_0xb1d2('0x0'));module[_0xb1d2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb1d2('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb1d2('0x2')]},'conditions':{'type':Sequelize[_0xb1d2('0x3')]},'joins':{'type':Sequelize[_0xb1d2('0x3')]}}; \ No newline at end of file +var _0x95da=['TEXT','sequelize','STRING'];(function(_0x540133,_0x41783f){var _0x26b6e9=function(_0x10ebe3){while(--_0x10ebe3){_0x540133['push'](_0x540133['shift']());}};_0x26b6e9(++_0x41783f);}(_0x95da,0x1db));var _0xa95d=function(_0x530886,_0x123742){_0x530886=_0x530886-0x0;var _0x3e5315=_0x95da[_0x530886];return _0x3e5315;};'use strict';var Sequelize=require(_0xa95d('0x0'));module['exports']={'name':{'type':Sequelize[_0xa95d('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa95d('0x1')]},'parent':{'type':Sequelize[_0xa95d('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xa95d('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 6429488..7df3725 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 _0xfd22=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','end','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','map','key','field','options','include','findAll','catch','params','includeAll','find','create','Reports','userProfileId','autoAssociation','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%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)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','condition','value','getFields','ValidationErrorItem','AnalyticMetric','from','MetricId','metric','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','type','parentKey','foreignTable','foreignKey','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','order','%s.%s\x20=\x20%s.%s','No\x20available\x20data','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../files/reports','savename','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','operator','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x433e7c,_0xf9c606){var _0x2d5248=function(_0x2c8e94){while(--_0x2c8e94){_0x433e7c['push'](_0x433e7c['shift']());}};_0x2d5248(++_0xf9c606);}(_0xfd22,0x1c5));var _0x2fd2=function(_0xeeb21,_0x5b033e){_0xeeb21=_0xeeb21-0x0;var _0x59e807=_0xfd22[_0xeeb21];return _0x59e807;};'use strict';var pdf=require(_0x2fd2('0x0'));var emlformat=require(_0x2fd2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2fd2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2fd2('0x3'));var moment=require(_0x2fd2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2fd2('0x5'));var util=require(_0x2fd2('0x6'));var path=require(_0x2fd2('0x7'));var sox=require(_0x2fd2('0x8'));var csv=require(_0x2fd2('0x9'));var ejs=require(_0x2fd2('0xa'));var fs=require('fs');var _=require(_0x2fd2('0xb'));var squel=require(_0x2fd2('0xc'));var crypto=require('crypto');var jsforce=require(_0x2fd2('0xd'));var deskjs=require(_0x2fd2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2fd2('0xf'));var Papa=require(_0x2fd2('0x10'));var Redis=require(_0x2fd2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2fd2('0x12'));var hardwareService=require(_0x2fd2('0x13'));var logger=require(_0x2fd2('0x14'))('api');var utils=require(_0x2fd2('0x15'));var config=require(_0x2fd2('0x16'));var db=require(_0x2fd2('0x17'))['db'];function respondWithStatusCode(_0x19f353,_0x514b0f){_0x514b0f=_0x514b0f||0xcc;return function(_0x12bc90){if(_0x12bc90){return _0x19f353[_0x2fd2('0x18')](_0x514b0f);}return _0x19f353['status'](_0x514b0f)['end']();};}function respondWithResult(_0x594c38,_0x209b92){_0x209b92=_0x209b92||0xc8;return function(_0xc3e062){if(_0xc3e062){return _0x594c38[_0x2fd2('0x19')](_0x209b92)[_0x2fd2('0x1a')](_0xc3e062);}};}function respondWithFilteredResult(_0x5d4fbb,_0x308681){return function(_0x624b32){if(_0x624b32){var _0x4fec8d=_0x624b32[_0x2fd2('0x1b')],_0x5e44ef=_0x308681['offset'],_0x248c84=_0x308681[_0x2fd2('0x1c')]+_0x308681[_0x2fd2('0x1d')],_0x3db3da;if(_0x248c84>=_0x4fec8d){_0x248c84=_0x4fec8d;_0x3db3da=0xc8;}else{_0x3db3da=0xce;}_0x5d4fbb[_0x2fd2('0x19')](_0x3db3da);return _0x5d4fbb['set'](_0x2fd2('0x1e'),_0x5e44ef+'-'+_0x248c84+'/'+_0x4fec8d)['json'](_0x624b32);}return null;};}function patchUpdates(_0x4641b3){return function(_0x12ff30){try{jsonpatch[_0x2fd2('0x1f')](_0x12ff30,_0x4641b3,!![]);}catch(_0x579a0f){return BPromise[_0x2fd2('0x20')](_0x579a0f);}return _0x12ff30[_0x2fd2('0x21')]();};}function saveUpdates(_0x3687eb,_0x15cb8f){return function(_0x61ada0){if(_0x61ada0){return _0x61ada0[_0x2fd2('0x22')](_0x3687eb)[_0x2fd2('0x23')](function(_0x48e0dc){return _0x48e0dc;});}return null;};}function removeEntity(_0x29481c,_0x54817e){return function(_0x244444){if(_0x244444){return _0x244444[_0x2fd2('0x24')]()['then'](function(){var _0x880d13=_0x244444[_0x2fd2('0x25')]({'plain':!![]});var _0x4441ac=_0x2fd2('0x26');return db[_0x2fd2('0x27')][_0x2fd2('0x24')]({'where':{'type':_0x4441ac,'resourceId':_0x880d13['id']}})[_0x2fd2('0x23')](function(){return _0x244444;});})[_0x2fd2('0x23')](function(){_0x29481c[_0x2fd2('0x19')](0xcc)[_0x2fd2('0x28')]();});}};}function handleEntityNotFound(_0x2f6f72,_0x308cd4){return function(_0xf8ce0c){if(!_0xf8ce0c){_0x2f6f72[_0x2fd2('0x18')](0x194);}return _0xf8ce0c;};}function handleError(_0x3ef4d0,_0x577d9d){_0x577d9d=_0x577d9d||0x1f4;return function(_0x1d69ee){logger[_0x2fd2('0x29')](_0x1d69ee[_0x2fd2('0x2a')]);if(_0x1d69ee['name']){delete _0x1d69ee[_0x2fd2('0x2b')];}_0x3ef4d0[_0x2fd2('0x19')](_0x577d9d)[_0x2fd2('0x2c')](_0x1d69ee);};}exports[_0x2fd2('0x2d')]=function(_0x1cfdad,_0x44b641){var _0x100540={},_0x5e1e97={},_0x4d4004={'count':0x0,'rows':[]};var _0x2f01fa=db[_0x2fd2('0x2e')][_0x2fd2('0x2f')];_0x5e1e97[_0x2fd2('0x30')]=_[_0x2fd2('0x31')](_0x2f01fa);_0x5e1e97['query']=_[_0x2fd2('0x31')](_0x1cfdad[_0x2fd2('0x32')]);_0x5e1e97[_0x2fd2('0x33')]=_[_0x2fd2('0x34')](_0x5e1e97[_0x2fd2('0x30')],_0x5e1e97[_0x2fd2('0x32')]);_0x100540[_0x2fd2('0x35')]=_[_0x2fd2('0x34')](_0x5e1e97[_0x2fd2('0x30')],qs[_0x2fd2('0x36')](_0x1cfdad[_0x2fd2('0x32')]['fields']));_0x100540[_0x2fd2('0x35')]=_0x100540[_0x2fd2('0x35')][_0x2fd2('0x37')]?_0x100540[_0x2fd2('0x35')]:_0x5e1e97[_0x2fd2('0x30')];if(!_0x1cfdad[_0x2fd2('0x32')][_0x2fd2('0x38')]('nolimit')){_0x100540[_0x2fd2('0x1d')]=qs[_0x2fd2('0x1d')](_0x1cfdad[_0x2fd2('0x32')][_0x2fd2('0x1d')]);_0x100540['offset']=qs['offset'](_0x1cfdad[_0x2fd2('0x32')][_0x2fd2('0x1c')]);}_0x100540['order']=qs[_0x2fd2('0x39')](_0x1cfdad[_0x2fd2('0x32')][_0x2fd2('0x39')]);_0x100540[_0x2fd2('0x3a')]=qs['filters'](_['pick'](_0x1cfdad[_0x2fd2('0x32')],_0x5e1e97[_0x2fd2('0x33')]));if(_0x1cfdad[_0x2fd2('0x32')][_0x2fd2('0x3b')]){_0x100540['where']=_[_0x2fd2('0x3c')](_0x100540[_0x2fd2('0x3a')],{'$or':_[_0x2fd2('0x3d')](_0x2f01fa,function(_0x20fbbb){if(_0x20fbbb['type'][_0x2fd2('0x3e')]!=='VIRTUAL'){var _0x3ec6cd={};_0x3ec6cd[_0x20fbbb[_0x2fd2('0x3f')]]={'$like':'%'+_0x1cfdad['query'][_0x2fd2('0x3b')]+'%'};return _0x3ec6cd;}})});}_0x100540=_['merge']({},_0x100540,_0x1cfdad[_0x2fd2('0x40')]);var _0x3a4200={'where':_0x100540[_0x2fd2('0x3a')]};return db[_0x2fd2('0x2e')]['count'](_0x3a4200)[_0x2fd2('0x23')](function(_0x1b8c9e){_0x4d4004['count']=_0x1b8c9e;if(_0x1cfdad['query']['includeAll']){_0x100540[_0x2fd2('0x41')]=[{'all':!![]}];}return db[_0x2fd2('0x2e')][_0x2fd2('0x42')](_0x100540);})[_0x2fd2('0x23')](function(_0x5820ea){_0x4d4004['rows']=_0x5820ea;return _0x4d4004;})[_0x2fd2('0x23')](respondWithFilteredResult(_0x44b641,_0x100540))[_0x2fd2('0x43')](handleError(_0x44b641,null));};exports['show']=function(_0x43c24c,_0x166aa0){var _0x2b5bec={'raw':![],'where':{'id':_0x43c24c[_0x2fd2('0x44')]['id']}},_0x3a87d7={};_0x3a87d7[_0x2fd2('0x30')]=_['keys'](db[_0x2fd2('0x2e')][_0x2fd2('0x2f')]);_0x3a87d7[_0x2fd2('0x32')]=_[_0x2fd2('0x31')](_0x43c24c[_0x2fd2('0x32')]);_0x3a87d7['filters']=_['intersection'](_0x3a87d7['model'],_0x3a87d7[_0x2fd2('0x32')]);_0x2b5bec['attributes']=_[_0x2fd2('0x34')](_0x3a87d7[_0x2fd2('0x30')],qs[_0x2fd2('0x36')](_0x43c24c[_0x2fd2('0x32')]['fields']));_0x2b5bec['attributes']=_0x2b5bec[_0x2fd2('0x35')][_0x2fd2('0x37')]?_0x2b5bec[_0x2fd2('0x35')]:_0x3a87d7['model'];if(_0x43c24c[_0x2fd2('0x32')][_0x2fd2('0x45')]){_0x2b5bec[_0x2fd2('0x41')]=[{'all':!![]}];}_0x2b5bec=_[_0x2fd2('0x3c')]({},_0x2b5bec,_0x43c24c[_0x2fd2('0x40')]);return db[_0x2fd2('0x2e')][_0x2fd2('0x46')](_0x2b5bec)[_0x2fd2('0x23')](handleEntityNotFound(_0x166aa0,null))['then'](respondWithResult(_0x166aa0,null))['catch'](handleError(_0x166aa0,null));};exports['create']=function(_0x188478,_0x1aa607){return db['AnalyticCustomReport'][_0x2fd2('0x47')](_0x188478['body'],{})[_0x2fd2('0x23')](function(_0x203fb9){var _0x332cfa=_0x188478['user'][_0x2fd2('0x25')]({'plain':!![]});if(!_0x332cfa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x332cfa['role']==='user'){var _0x56b6c5=_0x203fb9[_0x2fd2('0x25')]({'plain':!![]});var _0x15e301=_0x2fd2('0x48');return db['UserProfileSection'][_0x2fd2('0x46')]({'where':{'name':_0x15e301,'userProfileId':_0x332cfa[_0x2fd2('0x49')]},'raw':!![]})[_0x2fd2('0x23')](function(_0x3b677e){if(_0x3b677e&&_0x3b677e[_0x2fd2('0x4a')]===0x0){return db['UserProfileResource'][_0x2fd2('0x47')]({'name':_0x56b6c5['name'],'resourceId':_0x56b6c5['id'],'type':'CustomReports','sectionId':_0x3b677e['id']},{})[_0x2fd2('0x23')](function(){return _0x203fb9;});}else{return _0x203fb9;}})['catch'](function(_0x5aaa99){logger[_0x2fd2('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5aaa99);throw _0x5aaa99;});}return _0x203fb9;})[_0x2fd2('0x23')](respondWithResult(_0x1aa607,0xc9))['catch'](handleError(_0x1aa607,null));};exports[_0x2fd2('0x22')]=function(_0x16b4d5,_0x11b838){if(_0x16b4d5[_0x2fd2('0x4b')]['id']){delete _0x16b4d5[_0x2fd2('0x4b')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x16b4d5['params']['id']}})[_0x2fd2('0x23')](handleEntityNotFound(_0x11b838,null))[_0x2fd2('0x23')](saveUpdates(_0x16b4d5[_0x2fd2('0x4b')],null))[_0x2fd2('0x23')](respondWithResult(_0x11b838,null))[_0x2fd2('0x43')](handleError(_0x11b838,null));};exports[_0x2fd2('0x24')]=function(_0x29191d,_0x1d221d){return db[_0x2fd2('0x2e')][_0x2fd2('0x46')]({'where':{'id':_0x29191d['params']['id']}})[_0x2fd2('0x23')](handleEntityNotFound(_0x1d221d,null))['then'](removeEntity(_0x1d221d,null))['catch'](handleError(_0x1d221d,null));};exports[_0x2fd2('0x4c')]=function(_0x327f22,_0x4a5b8a){var _0x253702=0xa;var _0x49b4c1=[_0x2fd2('0x4d'),_0x2fd2('0x4e'),_0x2fd2('0x4f'),_0x2fd2('0x50')];var _0xc2a57b={'SUM':_0x2fd2('0x51'),'COUNT':_0x2fd2('0x52'),'COUNT DISTINCT':_0x2fd2('0x53'),'MAX':_0x2fd2('0x54'),'MIN':'MIN(%s)','AVG':_0x2fd2('0x55'),'GROUP_CONCAT':_0x2fd2('0x56'),'GROUP_CONCAT ASC':_0x2fd2('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5bb6a2={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x2fd2('0x58'),'HOUR':_0x2fd2('0x59'),'ROUND':_0x2fd2('0x5a'),'UNIX_TIMESTAMP':_0x2fd2('0x5b')};var _0x4f3535=function(_0x54ee5f){return!_[_0x2fd2('0x5c')]([_0x2fd2('0x5d'),_0x2fd2('0x5e'),_0x2fd2('0x5f'),'IS\x20NOT\x20EMPTY'],_0x54ee5f);};var _0x495e75=function(_0x1f0f54){if(!_0x1f0f54||!_0x1f0f54[_0x2fd2('0x60')][_0x2fd2('0x37')]){return'';}for(var _0x180305='(',_0x33849b=0x0;_0x33849b<_0x1f0f54[_0x2fd2('0x60')][_0x2fd2('0x37')];_0x33849b+=0x1){_0x33849b>0x0&&(_0x180305+='\x20'+_0x1f0f54['operator']+'\x20');_0x180305+=_0x1f0f54[_0x2fd2('0x60')][_0x33849b]['group']?_0x495e75(_0x1f0f54[_0x2fd2('0x60')][_0x33849b]['group']):_0x1f0f54[_0x2fd2('0x60')][_0x33849b][_0x2fd2('0x3f')]+'\x20'+_0x1f0f54[_0x2fd2('0x60')][_0x33849b]['condition']+(_0x4f3535(_0x1f0f54['rules'][_0x33849b][_0x2fd2('0x61')])?'\x20'+_0x1f0f54[_0x2fd2('0x60')][_0x33849b][_0x2fd2('0x62')]:'');}return _0x180305+')';};var _0x10c8e6={'where':{'id':_0x327f22['params']['id']}},_0xcef7ba,_0x5bde3f,_0x47a843,_0x2a04aa,_0x3a6d26;_0x10c8e6=_[_0x2fd2('0x3c')]({},_0x10c8e6,_0x327f22[_0x2fd2('0x40')]);return db[_0x2fd2('0x2e')][_0x2fd2('0x46')](_0x10c8e6)[_0x2fd2('0x23')](function(_0x4c3561){if(_0x4c3561){_0xcef7ba=_0x4c3561;return _0x4c3561[_0x2fd2('0x63')]();}return null;})[_0x2fd2('0x23')](function(_0x5e034b){if(_0x5e034b){if(!_0x5e034b[_0x2fd2('0x37')]){throw new db['Sequelize'][(_0x2fd2('0x64'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5bde3f=_0x5e034b;return db[_0x2fd2('0x65')][_0x2fd2('0x42')]({'raw':!![]});}return null;})[_0x2fd2('0x23')](function(_0x4be987){if(_0x4be987){_0x47a843=_['keyBy'](_0x4be987,'id');var _0x1add3e;var _0x4f4882=squel['select']();_0x4f4882[_0x2fd2('0x66')](_0xcef7ba['table']);for(var _0x58e5a0=0x0;_0x58e5a0<_0x5bde3f[_0x2fd2('0x37')];_0x58e5a0+=0x1){_0x1add3e=_0x5bde3f[_0x58e5a0][_0x2fd2('0x67')]?_0x47a843[_0x5bde3f[_0x58e5a0][_0x2fd2('0x67')]][_0x2fd2('0x68')]:_0x5bde3f[_0x58e5a0][_0x2fd2('0x3f')];_0x1add3e=_0x5bde3f[_0x58e5a0]['function']?_['replace'](_0xc2a57b[_0x5bde3f[_0x58e5a0][_0x2fd2('0x69')]],'%s',_0x1add3e):_0x1add3e;_0x1add3e=_0x5bde3f[_0x58e5a0]['format']?_[_0x2fd2('0x6a')](_0x5bb6a2[_0x5bde3f[_0x58e5a0][_0x2fd2('0x6b')]],'%s',_0x1add3e):_0x1add3e;if(_0x5bde3f[_0x58e5a0][_0x2fd2('0x6c')]){_0x4f4882[_0x2fd2('0x6d')](_0x1add3e);}_0x5bde3f[_0x58e5a0][_0x2fd2('0x6e')]&&_0x4f4882['order'](_0x1add3e,_0x5bde3f[_0x58e5a0][_0x2fd2('0x6e')]===_0x2fd2('0x6f')?![]:!![]);_0x4f4882[_0x2fd2('0x3f')](_0x1add3e,_0x5bde3f[_0x58e5a0][_0x2fd2('0x70')]||_0x1add3e);}if(_0xcef7ba[_0x2fd2('0x71')]){_0xcef7ba[_0x2fd2('0x71')]=JSON[_0x2fd2('0x72')](_0xcef7ba[_0x2fd2('0x71')]);for(var _0x218573=0x0;_0x218573<_0xcef7ba[_0x2fd2('0x71')][_0x2fd2('0x37')];_0x218573+=0x1){if(_0xcef7ba['joins'][_0x218573][_0x2fd2('0x73')]&&_['includes'](_0x49b4c1,_0xcef7ba[_0x2fd2('0x71')][_0x218573][_0x2fd2('0x73')])&&_0xcef7ba[_0x2fd2('0x71')][_0x218573][_0x2fd2('0x74')]&&_0xcef7ba['joins'][_0x218573][_0x2fd2('0x75')]&&_0xcef7ba[_0x2fd2('0x71')][_0x218573][_0x2fd2('0x76')]){_0x4f4882[_0xcef7ba[_0x2fd2('0x71')][_0x218573][_0x2fd2('0x73')]](_0xcef7ba['joins'][_0x218573][_0x2fd2('0x75')],null,util['format']('%s.%s\x20=\x20%s.%s',_0xcef7ba[_0x2fd2('0x77')],_0xcef7ba['joins'][_0x218573][_0x2fd2('0x74')],_0xcef7ba[_0x2fd2('0x71')][_0x218573][_0x2fd2('0x75')],_0xcef7ba['joins'][_0x218573][_0x2fd2('0x76')]));}}}if(_0xcef7ba['conditions']){_0xcef7ba[_0x2fd2('0x78')]=JSON['parse'](_0xcef7ba[_0x2fd2('0x78')]);_0x4f4882[_0x2fd2('0x3a')](_0x495e75(_0xcef7ba[_0x2fd2('0x78')][_0x2fd2('0x6d')]));}_0x3a6d26=_0x4f4882[_0x2fd2('0x79')]();_0x4f4882[_0x2fd2('0x1d')](_0x253702);_0x4f4882[_0x2fd2('0x1c')](0x0);logger[_0x2fd2('0x7a')](_0x2fd2('0x7b'),_0x4f4882[_0x2fd2('0x7c')]());return db[_0x2fd2('0x7d')]['query'](_0x4f4882[_0x2fd2('0x7c')](),{'type':db[_0x2fd2('0x7d')][_0x2fd2('0x7e')][_0x2fd2('0x7f')]});}})[_0x2fd2('0x23')](respondWithResult(_0x4a5b8a,null))[_0x2fd2('0x43')](handleError(_0x4a5b8a,null));};function runReport(_0x33d54c,_0x2f9f01,_0x5474c8){var _0x1dda3b=_0x2f9f01[_0x2fd2('0x2b')];var _0x592fad=0xa;var _0x273acc=[_0x2fd2('0x4d'),_0x2fd2('0x4e'),_0x2fd2('0x4f'),'cross_join'];var _0x4388a0={'SUM':_0x2fd2('0x51'),'COUNT':_0x2fd2('0x52'),'COUNT DISTINCT':_0x2fd2('0x53'),'MAX':_0x2fd2('0x54'),'MIN':'MIN(%s)','AVG':_0x2fd2('0x55'),'GROUP_CONCAT':_0x2fd2('0x56'),'GROUP_CONCAT ASC':_0x2fd2('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x21ff41={'SEC_TO_TIME':_0x2fd2('0x80'),'DATE':_0x2fd2('0x58'),'HOUR':'HOUR(%s)','ROUND':_0x2fd2('0x5a'),'UNIX_TIMESTAMP':_0x2fd2('0x5b')};var _0x385982=function(_0x50f835){return!_[_0x2fd2('0x5c')](['IS\x20NULL',_0x2fd2('0x5e'),'IS\x20EMPTY',_0x2fd2('0x81')],_0x50f835);};var _0x868cd4=function(_0x13100b){if(!_0x13100b||!_0x13100b[_0x2fd2('0x60')][_0x2fd2('0x37')]){return'';}for(var _0x299f7a='(',_0x577177=0x0;_0x577177<_0x13100b[_0x2fd2('0x60')][_0x2fd2('0x37')];_0x577177+=0x1){_0x577177>0x0&&(_0x299f7a+='\x20'+_0x13100b['operator']+'\x20');_0x299f7a+=_0x13100b[_0x2fd2('0x60')][_0x577177][_0x2fd2('0x6d')]?_0x868cd4(_0x13100b[_0x2fd2('0x60')][_0x577177][_0x2fd2('0x6d')]):_0x13100b[_0x2fd2('0x60')][_0x577177][_0x2fd2('0x3f')]+'\x20'+_0x13100b[_0x2fd2('0x60')][_0x577177][_0x2fd2('0x61')]+(_0x385982(_0x13100b[_0x2fd2('0x60')][_0x577177][_0x2fd2('0x61')])?'\x20'+_0x13100b['rules'][_0x577177][_0x2fd2('0x62')]:'');}return _0x299f7a+')';};var _0x243d16={'where':{'id':_0x33d54c['id']}},_0x3344b7,_0x43c67b,_0x691cfa,_0x2f5fb4,_0x1051ed;_0x243d16=_['merge']({},_0x243d16,_0x5474c8);return db[_0x2fd2('0x2e')][_0x2fd2('0x46')](_0x243d16)[_0x2fd2('0x23')](function(_0x48f9){if(_0x48f9){_0x3344b7=_0x48f9;return _0x48f9[_0x2fd2('0x63')]();}return null;})[_0x2fd2('0x23')](function(_0x26842a){if(_0x26842a){if(!_0x26842a[_0x2fd2('0x37')]){throw new db[(_0x2fd2('0x82'))][(_0x2fd2('0x64'))](_0x2fd2('0x83'),0x193);}_0x43c67b=_0x26842a;return db[_0x2fd2('0x65')][_0x2fd2('0x42')]({'raw':!![]});}return null;})[_0x2fd2('0x23')](function(_0x2bab18){if(_0x2bab18){_0x691cfa=_[_0x2fd2('0x84')](_0x2bab18,'id');var _0x1e9d57;var _0x319ce1=squel[_0x2fd2('0x85')]();_0x319ce1['from'](_0x3344b7['table']);for(var _0x2bbd34=0x0;_0x2bbd34<_0x43c67b['length'];_0x2bbd34+=0x1){_0x1e9d57=_0x43c67b[_0x2bbd34][_0x2fd2('0x67')]?_0x691cfa[_0x43c67b[_0x2bbd34]['MetricId']][_0x2fd2('0x68')]:_0x43c67b[_0x2bbd34][_0x2fd2('0x3f')];_0x1e9d57=_0x43c67b[_0x2bbd34]['function']?_['replace'](_0x4388a0[_0x43c67b[_0x2bbd34][_0x2fd2('0x69')]],'%s',_0x1e9d57):_0x1e9d57;_0x1e9d57=_0x43c67b[_0x2bbd34][_0x2fd2('0x6b')]?_[_0x2fd2('0x6a')](_0x21ff41[_0x43c67b[_0x2bbd34][_0x2fd2('0x6b')]],'%s',_0x1e9d57):_0x1e9d57;if(_0x43c67b[_0x2bbd34]['groupBy']){_0x319ce1[_0x2fd2('0x6d')](_0x1e9d57);}_0x43c67b[_0x2bbd34][_0x2fd2('0x6e')]&&_0x319ce1[_0x2fd2('0x86')](_0x1e9d57,_0x43c67b[_0x2bbd34][_0x2fd2('0x6e')]===_0x2fd2('0x6f')?![]:!![]);_0x319ce1['field'](_0x1e9d57,_0x43c67b[_0x2bbd34][_0x2fd2('0x70')]||_0x1e9d57);}if(_0x3344b7[_0x2fd2('0x71')]){_0x3344b7[_0x2fd2('0x71')]=JSON['parse'](_0x3344b7[_0x2fd2('0x71')]);for(var _0x4d715f=0x0;_0x4d715f<_0x3344b7['joins'][_0x2fd2('0x37')];_0x4d715f+=0x1){if(_0x3344b7[_0x2fd2('0x71')][_0x4d715f]['type']&&_[_0x2fd2('0x5c')](_0x273acc,_0x3344b7[_0x2fd2('0x71')][_0x4d715f][_0x2fd2('0x73')])&&_0x3344b7[_0x2fd2('0x71')][_0x4d715f][_0x2fd2('0x74')]&&_0x3344b7[_0x2fd2('0x71')][_0x4d715f][_0x2fd2('0x75')]&&_0x3344b7['joins'][_0x4d715f]['foreignKey']){_0x319ce1[_0x3344b7[_0x2fd2('0x71')][_0x4d715f][_0x2fd2('0x73')]](_0x3344b7[_0x2fd2('0x71')][_0x4d715f][_0x2fd2('0x75')],null,util[_0x2fd2('0x6b')](_0x2fd2('0x87'),_0x3344b7[_0x2fd2('0x77')],_0x3344b7[_0x2fd2('0x71')][_0x4d715f][_0x2fd2('0x74')],_0x3344b7[_0x2fd2('0x71')][_0x4d715f][_0x2fd2('0x75')],_0x3344b7[_0x2fd2('0x71')][_0x4d715f][_0x2fd2('0x76')]));}}}if(_0x3344b7[_0x2fd2('0x78')]){_0x3344b7[_0x2fd2('0x78')]=JSON[_0x2fd2('0x72')](_0x3344b7[_0x2fd2('0x78')]);_0x319ce1[_0x2fd2('0x3a')](_0x868cd4(_0x3344b7[_0x2fd2('0x78')][_0x2fd2('0x6d')]));}_0x1051ed=_0x319ce1[_0x2fd2('0x79')]();_0x319ce1[_0x2fd2('0x1d')](_0x592fad);_0x319ce1[_0x2fd2('0x1c')](0x0);logger['debug'](_0x2fd2('0x7b'),_0x319ce1['toString']());return db[_0x2fd2('0x7d')][_0x2fd2('0x32')](_0x319ce1[_0x2fd2('0x7c')](),{'type':db[_0x2fd2('0x7d')][_0x2fd2('0x7e')]['SELECT']});}})[_0x2fd2('0x23')](function(_0x7849de){if(!_0x7849de[_0x2fd2('0x37')]){throw new db[(_0x2fd2('0x82'))][(_0x2fd2('0x64'))](_0x2fd2('0x88'),0xcc);}if(_0x2f9f01['output']===_0x2fd2('0x89')){return null;}var _0x3954b9=_[_0x2fd2('0x3c')](_0x2f9f01,{'name':_0x2f9f01[_0x2fd2('0x8a')]||_0x2f9f01[_0x2fd2('0x2b')]||_0x3344b7[_0x2fd2('0x2b')],'basename':_0x1dda3b,'savename':util[_0x2fd2('0x6b')](_0x2fd2('0x8b'),_0x2f9f01[_0x2fd2('0x2b')]||_0x3344b7[_0x2fd2('0x2b')],require(_0x2fd2('0x8c'))[_0x2fd2('0x8d')](0x4),_0x2f9f01[_0x2fd2('0x8e')]||_0x2fd2('0x8f')),'reportId':_0x3344b7['id'],'reportType':_0x2fd2('0x90')});return db[_0x2fd2('0x91')]['create'](_0x3954b9,{'raw':!![]});})['then'](function(_0x29d1f1){if(_0x3344b7['table']===_0x2fd2('0x92')){_0x1051ed['where'](_0x3344b7[_0x2fd2('0x77')]+_0x2fd2('0x93'),_0x2f9f01[_0x2fd2('0x94')],_0x2f9f01[_0x2fd2('0x95')]);}else{_0x1051ed[_0x2fd2('0x3a')](_0x3344b7[_0x2fd2('0x77')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2f9f01[_0x2fd2('0x94')],_0x2f9f01[_0x2fd2('0x95')]);}if(_0x29d1f1){logger[_0x2fd2('0x96')]('Run\x20Query:',_0x1051ed[_0x2fd2('0x7c')]());require(_0x2fd2('0x97'))[_0x2fd2('0x98')](path[_0x2fd2('0x4d')](__dirname,'../../components/export/',_0x29d1f1[_0x2fd2('0x8e')]),[_0x29d1f1['id'],_0x1051ed['toString'](),path[_0x2fd2('0x4d')](__dirname,_0x2fd2('0x99'),_0x29d1f1[_0x2fd2('0x9a')]),_0x1dda3b]);return _0x29d1f1;}else{var _0x413f24=squel['select']();_0x413f24[_0x2fd2('0x66')]('('+_0x1051ed[_0x2fd2('0x7c')]()+')','countTable');_0x413f24[_0x2fd2('0x3f')](_0x2fd2('0x9b'),_0x2fd2('0x1b'));_0x1051ed[_0x2fd2('0x1d')](_0x2f9f01[_0x2fd2('0x1d')]||_0x592fad);_0x1051ed[_0x2fd2('0x1c')](_0x2f9f01[_0x2fd2('0x1c')]||0x0);return db[_0x2fd2('0x7d')][_0x2fd2('0x32')](_0x413f24[_0x2fd2('0x7c')](),{'type':db[_0x2fd2('0x7d')][_0x2fd2('0x7e')]['SELECT']})['then'](function(_0x38dac3){if(!_0x38dac3[_0x2fd2('0x37')]){_0x2f5fb4=0x0;}else{_0x2f5fb4=_0x38dac3[0x0][_0x2fd2('0x1b')]||0x0;}return db['sequelize'][_0x2fd2('0x32')](_0x1051ed[_0x2fd2('0x7c')](),{'type':db[_0x2fd2('0x7d')]['QueryTypes'][_0x2fd2('0x7f')]});})[_0x2fd2('0x23')](function(_0x559566){return{'rows':_0x559566||[],'count':_0x2f5fb4};});}});}exports['run']=function(_0x292506,_0x52d68a){return runReport(_0x292506[_0x2fd2('0x44')],_0x292506[_0x2fd2('0x32')],_0x292506[_0x2fd2('0x40')])[_0x2fd2('0x23')](respondWithResult(_0x52d68a,null))[_0x2fd2('0x43')](handleError(_0x52d68a,null));};exports['runReport']=runReport;exports['query']=function(_0x16706c,_0x370b14){var _0x3253d3=0xa;var _0x170a23=[_0x2fd2('0x4d'),_0x2fd2('0x4e'),_0x2fd2('0x4f'),'cross_join'];var _0x59d382={'SUM':_0x2fd2('0x51'),'COUNT':_0x2fd2('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x2fd2('0x54'),'MIN':'MIN(%s)','AVG':_0x2fd2('0x55'),'GROUP_CONCAT':_0x2fd2('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2fd2('0x9c')};var _0x139153={'SEC_TO_TIME':_0x2fd2('0x80'),'DATE':_0x2fd2('0x58'),'HOUR':'HOUR(%s)','ROUND':_0x2fd2('0x5a'),'UNIX_TIMESTAMP':_0x2fd2('0x5b')};var _0x520d99=function(_0x5f0344){return!_[_0x2fd2('0x5c')]([_0x2fd2('0x5d'),_0x2fd2('0x5e'),_0x2fd2('0x5f'),_0x2fd2('0x81')],_0x5f0344);};var _0x4b604a=function(_0x23b69d){if(!_0x23b69d||!_0x23b69d['rules'][_0x2fd2('0x37')]){return'';}for(var _0x3c126b='(',_0x48b40f=0x0;_0x48b40f<_0x23b69d[_0x2fd2('0x60')]['length'];_0x48b40f+=0x1){_0x48b40f>0x0&&(_0x3c126b+='\x20'+_0x23b69d[_0x2fd2('0x9d')]+'\x20');_0x3c126b+=_0x23b69d[_0x2fd2('0x60')][_0x48b40f][_0x2fd2('0x6d')]?_0x4b604a(_0x23b69d[_0x2fd2('0x60')][_0x48b40f]['group']):_0x23b69d[_0x2fd2('0x60')][_0x48b40f]['field']+'\x20'+_0x23b69d[_0x2fd2('0x60')][_0x48b40f][_0x2fd2('0x61')]+(_0x520d99(_0x23b69d[_0x2fd2('0x60')][_0x48b40f][_0x2fd2('0x61')])?'\x20'+_0x23b69d[_0x2fd2('0x60')][_0x48b40f][_0x2fd2('0x62')]:'');}return _0x3c126b+')';};var _0x35b946={'where':{'id':_0x16706c[_0x2fd2('0x44')]['id']}},_0x1ff95a,_0x40255f,_0x588f56,_0x458c1e,_0x3d1124;_0x35b946=_[_0x2fd2('0x3c')]({},_0x35b946,_0x16706c['options']);return db[_0x2fd2('0x2e')][_0x2fd2('0x46')](_0x35b946)[_0x2fd2('0x23')](function(_0x1fa2a1){if(_0x1fa2a1){_0x1ff95a=_0x1fa2a1;return _0x1fa2a1[_0x2fd2('0x63')]();}return null;})[_0x2fd2('0x23')](function(_0x12ac8f){if(_0x12ac8f){if(!_0x12ac8f[_0x2fd2('0x37')]){throw new db[(_0x2fd2('0x82'))]['ValidationErrorItem'](_0x2fd2('0x83'),0x193);}_0x40255f=_0x12ac8f;return db['AnalyticMetric'][_0x2fd2('0x42')]({'raw':!![]});}return null;})[_0x2fd2('0x23')](function(_0x394f0e){if(_0x394f0e){_0x588f56=_['keyBy'](_0x394f0e,'id');var _0xdaa61;var _0x5494da=squel['select']();_0x5494da['from'](_0x1ff95a['table']);for(var _0x5a0e33=0x0;_0x5a0e33<_0x40255f[_0x2fd2('0x37')];_0x5a0e33+=0x1){_0xdaa61=_0x40255f[_0x5a0e33]['MetricId']?_0x588f56[_0x40255f[_0x5a0e33][_0x2fd2('0x67')]][_0x2fd2('0x68')]:_0x40255f[_0x5a0e33][_0x2fd2('0x3f')];_0xdaa61=_0x40255f[_0x5a0e33][_0x2fd2('0x69')]?_['replace'](_0x59d382[_0x40255f[_0x5a0e33][_0x2fd2('0x69')]],'%s',_0xdaa61):_0xdaa61;_0xdaa61=_0x40255f[_0x5a0e33][_0x2fd2('0x6b')]?_[_0x2fd2('0x6a')](_0x139153[_0x40255f[_0x5a0e33]['format']],'%s',_0xdaa61):_0xdaa61;if(_0x40255f[_0x5a0e33][_0x2fd2('0x6c')]){_0x5494da[_0x2fd2('0x6d')](_0xdaa61);}_0x40255f[_0x5a0e33]['orderBy']&&_0x5494da[_0x2fd2('0x86')](_0xdaa61,_0x40255f[_0x5a0e33][_0x2fd2('0x6e')]===_0x2fd2('0x6f')?![]:!![]);_0x5494da['field'](_0xdaa61,_0x40255f[_0x5a0e33][_0x2fd2('0x70')]||_0xdaa61);}if(_0x1ff95a[_0x2fd2('0x71')]){_0x1ff95a[_0x2fd2('0x71')]=JSON[_0x2fd2('0x72')](_0x1ff95a[_0x2fd2('0x71')]);for(var _0x5bd967=0x0;_0x5bd967<_0x1ff95a[_0x2fd2('0x71')][_0x2fd2('0x37')];_0x5bd967+=0x1){if(_0x1ff95a[_0x2fd2('0x71')][_0x5bd967][_0x2fd2('0x73')]&&_[_0x2fd2('0x5c')](_0x170a23,_0x1ff95a['joins'][_0x5bd967]['type'])&&_0x1ff95a[_0x2fd2('0x71')][_0x5bd967][_0x2fd2('0x74')]&&_0x1ff95a[_0x2fd2('0x71')][_0x5bd967]['foreignTable']&&_0x1ff95a[_0x2fd2('0x71')][_0x5bd967]['foreignKey']){_0x5494da[_0x1ff95a[_0x2fd2('0x71')][_0x5bd967][_0x2fd2('0x73')]](_0x1ff95a['joins'][_0x5bd967][_0x2fd2('0x75')],null,util[_0x2fd2('0x6b')]('%s.%s\x20=\x20%s.%s',_0x1ff95a['table'],_0x1ff95a[_0x2fd2('0x71')][_0x5bd967][_0x2fd2('0x74')],_0x1ff95a[_0x2fd2('0x71')][_0x5bd967][_0x2fd2('0x75')],_0x1ff95a[_0x2fd2('0x71')][_0x5bd967][_0x2fd2('0x76')]));}}}if(_0x1ff95a['conditions']){_0x1ff95a[_0x2fd2('0x78')]=JSON['parse'](_0x1ff95a[_0x2fd2('0x78')]);_0x5494da[_0x2fd2('0x3a')](_0x4b604a(_0x1ff95a[_0x2fd2('0x78')]['group']));}_0x3d1124=_0x5494da['clone']();_0x5494da[_0x2fd2('0x1d')](_0x3253d3);_0x5494da[_0x2fd2('0x1c')](0x0);logger[_0x2fd2('0x7a')](_0x2fd2('0x7b'),_0x5494da['toString']());return db[_0x2fd2('0x7d')]['query'](_0x5494da[_0x2fd2('0x7c')](),{'type':db[_0x2fd2('0x7d')]['QueryTypes'][_0x2fd2('0x7f')]});}})[_0x2fd2('0x23')](function(){return{'sql':_0x3d1124[_0x2fd2('0x7c')]()};})[_0x2fd2('0x23')](respondWithResult(_0x370b14,null))[_0x2fd2('0x43')](handleError(_0x370b14,null));}; \ No newline at end of file +var _0x7461=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','HOUR(%s)','ROUND(%s)','Sequelize','AnalyticMetric','Limited\x20Query:','No\x20available\x20data','output','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','savename','COUNT(*)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','destroy','end','sendStatus','error','name','send','index','AnalyticCustomReport','model','keys','query','intersection','attributes','fields','length','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','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)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x3c5bdd,_0x170182){var _0x557aae=function(_0x3622f7){while(--_0x3622f7){_0x3c5bdd['push'](_0x3c5bdd['shift']());}};_0x557aae(++_0x170182);}(_0x7461,0xe2));var _0x1746=function(_0x2b757b,_0x3537fd){_0x2b757b=_0x2b757b-0x0;var _0x4974ee=_0x7461[_0x2b757b];return _0x4974ee;};'use strict';var pdf=require(_0x1746('0x0'));var emlformat=require(_0x1746('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1746('0x2'));var jsonpatch=require(_0x1746('0x3'));var rp=require(_0x1746('0x4'));var moment=require('moment');var BPromise=require(_0x1746('0x5'));var Mustache=require(_0x1746('0x6'));var util=require(_0x1746('0x7'));var path=require(_0x1746('0x8'));var sox=require(_0x1746('0x9'));var csv=require(_0x1746('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1746('0xb'));var squel=require('squel');var crypto=require(_0x1746('0xc'));var jsforce=require(_0x1746('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1746('0xa'));var querystring=require('querystring');var Papa=require(_0x1746('0xe'));var Redis=require(_0x1746('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1746('0x10'));var hardwareService=require(_0x1746('0x11'));var logger=require('../../config/logger')(_0x1746('0x12'));var utils=require(_0x1746('0x13'));var config=require(_0x1746('0x14'));var db=require(_0x1746('0x15'))['db'];function respondWithStatusCode(_0x57d627,_0xce3dc8){_0xce3dc8=_0xce3dc8||0xcc;return function(_0xc755aa){if(_0xc755aa){return _0x57d627['sendStatus'](_0xce3dc8);}return _0x57d627[_0x1746('0x16')](_0xce3dc8)['end']();};}function respondWithResult(_0x6fc770,_0x5a1e13){_0x5a1e13=_0x5a1e13||0xc8;return function(_0x19eca0){if(_0x19eca0){return _0x6fc770[_0x1746('0x16')](_0x5a1e13)[_0x1746('0x17')](_0x19eca0);}};}function respondWithFilteredResult(_0x483c30,_0x4182d9){return function(_0x3bff27){if(_0x3bff27){var _0x3807be=_0x3bff27[_0x1746('0x18')],_0x4e2534=_0x4182d9[_0x1746('0x19')],_0x4cd630=_0x4182d9[_0x1746('0x19')]+_0x4182d9[_0x1746('0x1a')],_0x50b8b3;if(_0x4cd630>=_0x3807be){_0x4cd630=_0x3807be;_0x50b8b3=0xc8;}else{_0x50b8b3=0xce;}_0x483c30['status'](_0x50b8b3);return _0x483c30[_0x1746('0x1b')](_0x1746('0x1c'),_0x4e2534+'-'+_0x4cd630+'/'+_0x3807be)[_0x1746('0x17')](_0x3bff27);}return null;};}function patchUpdates(_0x288b1a){return function(_0x393ffc){try{jsonpatch[_0x1746('0x1d')](_0x393ffc,_0x288b1a,!![]);}catch(_0x58e85e){return BPromise[_0x1746('0x1e')](_0x58e85e);}return _0x393ffc[_0x1746('0x1f')]();};}function saveUpdates(_0x5a387f,_0x58d02a){return function(_0x58cc52){if(_0x58cc52){return _0x58cc52['update'](_0x5a387f)[_0x1746('0x20')](function(_0x20a8c9){return _0x20a8c9;});}return null;};}function removeEntity(_0x1d6508,_0x38c2a4){return function(_0x3c25d8){if(_0x3c25d8){return _0x3c25d8['destroy']()[_0x1746('0x20')](function(){var _0x1a4ab6=_0x3c25d8[_0x1746('0x21')]({'plain':!![]});var _0x5e7a02='CustomReports';return db['UserProfileResource'][_0x1746('0x22')]({'where':{'type':_0x5e7a02,'resourceId':_0x1a4ab6['id']}})[_0x1746('0x20')](function(){return _0x3c25d8;});})[_0x1746('0x20')](function(){_0x1d6508['status'](0xcc)[_0x1746('0x23')]();});}};}function handleEntityNotFound(_0x13e9e0,_0x257af2){return function(_0x2640d9){if(!_0x2640d9){_0x13e9e0[_0x1746('0x24')](0x194);}return _0x2640d9;};}function handleError(_0x3214d8,_0x279f1a){_0x279f1a=_0x279f1a||0x1f4;return function(_0x2c7adf){logger[_0x1746('0x25')](_0x2c7adf['stack']);if(_0x2c7adf[_0x1746('0x26')]){delete _0x2c7adf['name'];}_0x3214d8[_0x1746('0x16')](_0x279f1a)[_0x1746('0x27')](_0x2c7adf);};}exports[_0x1746('0x28')]=function(_0x2d8955,_0x3664dc){var _0x14ef40={},_0x2ff3ba={},_0x2e6774={'count':0x0,'rows':[]};var _0x34aae1=db[_0x1746('0x29')]['rawAttributes'];_0x2ff3ba[_0x1746('0x2a')]=_[_0x1746('0x2b')](_0x34aae1);_0x2ff3ba['query']=_[_0x1746('0x2b')](_0x2d8955[_0x1746('0x2c')]);_0x2ff3ba['filters']=_[_0x1746('0x2d')](_0x2ff3ba[_0x1746('0x2a')],_0x2ff3ba[_0x1746('0x2c')]);_0x14ef40[_0x1746('0x2e')]=_[_0x1746('0x2d')](_0x2ff3ba[_0x1746('0x2a')],qs[_0x1746('0x2f')](_0x2d8955['query'][_0x1746('0x2f')]));_0x14ef40[_0x1746('0x2e')]=_0x14ef40['attributes'][_0x1746('0x30')]?_0x14ef40[_0x1746('0x2e')]:_0x2ff3ba[_0x1746('0x2a')];if(!_0x2d8955['query']['hasOwnProperty']('nolimit')){_0x14ef40[_0x1746('0x1a')]=qs[_0x1746('0x1a')](_0x2d8955[_0x1746('0x2c')]['limit']);_0x14ef40['offset']=qs[_0x1746('0x19')](_0x2d8955[_0x1746('0x2c')][_0x1746('0x19')]);}_0x14ef40['order']=qs[_0x1746('0x31')](_0x2d8955['query']['sort']);_0x14ef40[_0x1746('0x32')]=qs[_0x1746('0x33')](_['pick'](_0x2d8955[_0x1746('0x2c')],_0x2ff3ba[_0x1746('0x33')]));if(_0x2d8955['query'][_0x1746('0x34')]){_0x14ef40[_0x1746('0x32')]=_[_0x1746('0x35')](_0x14ef40[_0x1746('0x32')],{'$or':_[_0x1746('0x36')](_0x34aae1,function(_0x2fd84e){if(_0x2fd84e[_0x1746('0x37')][_0x1746('0x38')]!==_0x1746('0x39')){var _0x4f42b9={};_0x4f42b9[_0x2fd84e[_0x1746('0x3a')]]={'$like':'%'+_0x2d8955[_0x1746('0x2c')][_0x1746('0x34')]+'%'};return _0x4f42b9;}})});}_0x14ef40=_[_0x1746('0x35')]({},_0x14ef40,_0x2d8955[_0x1746('0x3b')]);var _0x1d772e={'where':_0x14ef40[_0x1746('0x32')]};return db[_0x1746('0x29')][_0x1746('0x18')](_0x1d772e)['then'](function(_0x58faa5){_0x2e6774[_0x1746('0x18')]=_0x58faa5;if(_0x2d8955[_0x1746('0x2c')][_0x1746('0x3c')]){_0x14ef40[_0x1746('0x3d')]=[{'all':!![]}];}return db[_0x1746('0x29')]['findAll'](_0x14ef40);})[_0x1746('0x20')](function(_0xe55092){_0x2e6774[_0x1746('0x3e')]=_0xe55092;return _0x2e6774;})[_0x1746('0x20')](respondWithFilteredResult(_0x3664dc,_0x14ef40))['catch'](handleError(_0x3664dc,null));};exports[_0x1746('0x3f')]=function(_0x5302b1,_0x566352){var _0x39e9d9={'raw':![],'where':{'id':_0x5302b1[_0x1746('0x40')]['id']}},_0x4b8b8b={};_0x4b8b8b['model']=_[_0x1746('0x2b')](db['AnalyticCustomReport'][_0x1746('0x41')]);_0x4b8b8b['query']=_['keys'](_0x5302b1['query']);_0x4b8b8b[_0x1746('0x33')]=_['intersection'](_0x4b8b8b['model'],_0x4b8b8b[_0x1746('0x2c')]);_0x39e9d9['attributes']=_[_0x1746('0x2d')](_0x4b8b8b[_0x1746('0x2a')],qs[_0x1746('0x2f')](_0x5302b1[_0x1746('0x2c')][_0x1746('0x2f')]));_0x39e9d9[_0x1746('0x2e')]=_0x39e9d9[_0x1746('0x2e')]['length']?_0x39e9d9[_0x1746('0x2e')]:_0x4b8b8b[_0x1746('0x2a')];if(_0x5302b1[_0x1746('0x2c')]['includeAll']){_0x39e9d9['include']=[{'all':!![]}];}_0x39e9d9=_[_0x1746('0x35')]({},_0x39e9d9,_0x5302b1[_0x1746('0x3b')]);return db['AnalyticCustomReport'][_0x1746('0x42')](_0x39e9d9)['then'](handleEntityNotFound(_0x566352,null))['then'](respondWithResult(_0x566352,null))[_0x1746('0x43')](handleError(_0x566352,null));};exports['create']=function(_0x4ca3ff,_0x47d2f5){return db[_0x1746('0x29')][_0x1746('0x44')](_0x4ca3ff[_0x1746('0x45')],{})[_0x1746('0x20')](function(_0x5895ed){var _0x5bff52=_0x4ca3ff[_0x1746('0x46')]['get']({'plain':!![]});if(!_0x5bff52)throw new Error(_0x1746('0x47'));if(_0x5bff52['role']===_0x1746('0x46')){var _0x52587b=_0x5895ed[_0x1746('0x21')]({'plain':!![]});var _0x5739d7=_0x1746('0x48');return db[_0x1746('0x49')][_0x1746('0x42')]({'where':{'name':_0x5739d7,'userProfileId':_0x5bff52['userProfileId']},'raw':!![]})[_0x1746('0x20')](function(_0x176582){if(_0x176582&&_0x176582['autoAssociation']===0x0){return db[_0x1746('0x4a')][_0x1746('0x44')]({'name':_0x52587b[_0x1746('0x26')],'resourceId':_0x52587b['id'],'type':'CustomReports','sectionId':_0x176582['id']},{})['then'](function(){return _0x5895ed;});}else{return _0x5895ed;}})[_0x1746('0x43')](function(_0x2250ed){logger[_0x1746('0x25')](_0x1746('0x4b'),_0x2250ed);throw _0x2250ed;});}return _0x5895ed;})[_0x1746('0x20')](respondWithResult(_0x47d2f5,0xc9))['catch'](handleError(_0x47d2f5,null));};exports[_0x1746('0x4c')]=function(_0x4e0e9f,_0x32d37a){if(_0x4e0e9f[_0x1746('0x45')]['id']){delete _0x4e0e9f[_0x1746('0x45')]['id'];}return db[_0x1746('0x29')][_0x1746('0x42')]({'where':{'id':_0x4e0e9f['params']['id']}})[_0x1746('0x20')](handleEntityNotFound(_0x32d37a,null))[_0x1746('0x20')](saveUpdates(_0x4e0e9f[_0x1746('0x45')],null))[_0x1746('0x20')](respondWithResult(_0x32d37a,null))[_0x1746('0x43')](handleError(_0x32d37a,null));};exports['destroy']=function(_0x576524,_0x137e7a){return db[_0x1746('0x29')]['find']({'where':{'id':_0x576524[_0x1746('0x40')]['id']}})[_0x1746('0x20')](handleEntityNotFound(_0x137e7a,null))['then'](removeEntity(_0x137e7a,null))['catch'](handleError(_0x137e7a,null));};exports[_0x1746('0x4d')]=function(_0x6e950f,_0x2939f4){var _0x181e7b=0xa;var _0x1551ff=[_0x1746('0x4e'),_0x1746('0x4f'),_0x1746('0x50'),_0x1746('0x51')];var _0x4f0851={'SUM':_0x1746('0x52'),'COUNT':_0x1746('0x53'),'COUNT DISTINCT':_0x1746('0x54'),'MAX':_0x1746('0x55'),'MIN':_0x1746('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1746('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x1746('0x58')};var _0x5b3e9c={'SEC_TO_TIME':_0x1746('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1746('0x5a')};var _0x1677b6=function(_0xa0328){return!_[_0x1746('0x5b')]([_0x1746('0x5c'),_0x1746('0x5d'),_0x1746('0x5e'),'IS\x20NOT\x20EMPTY'],_0xa0328);};var _0xfcd3f5=function(_0x355225){if(!_0x355225||!_0x355225[_0x1746('0x5f')][_0x1746('0x30')]){return'';}for(var _0x16fe2e='(',_0x49adfd=0x0;_0x49adfd<_0x355225['rules'][_0x1746('0x30')];_0x49adfd+=0x1){_0x49adfd>0x0&&(_0x16fe2e+='\x20'+_0x355225[_0x1746('0x60')]+'\x20');_0x16fe2e+=_0x355225['rules'][_0x49adfd]['group']?_0xfcd3f5(_0x355225['rules'][_0x49adfd][_0x1746('0x61')]):_0x355225['rules'][_0x49adfd][_0x1746('0x3a')]+'\x20'+_0x355225[_0x1746('0x5f')][_0x49adfd][_0x1746('0x62')]+(_0x1677b6(_0x355225[_0x1746('0x5f')][_0x49adfd]['condition'])?'\x20'+_0x355225[_0x1746('0x5f')][_0x49adfd][_0x1746('0x63')]:'');}return _0x16fe2e+')';};var _0x278ba4={'where':{'id':_0x6e950f['params']['id']}},_0x5f3788,_0x390591,_0x2cfba5,_0x26cac9,_0x204ec2;_0x278ba4=_['merge']({},_0x278ba4,_0x6e950f[_0x1746('0x3b')]);return db[_0x1746('0x29')]['find'](_0x278ba4)[_0x1746('0x20')](function(_0x409595){if(_0x409595){_0x5f3788=_0x409595;return _0x409595[_0x1746('0x64')]();}return null;})[_0x1746('0x20')](function(_0x24b149){if(_0x24b149){if(!_0x24b149[_0x1746('0x30')]){throw new db['Sequelize'][(_0x1746('0x65'))](_0x1746('0x66'),0x193);}_0x390591=_0x24b149;return db['AnalyticMetric'][_0x1746('0x67')]({'raw':!![]});}return null;})[_0x1746('0x20')](function(_0x334a79){if(_0x334a79){_0x2cfba5=_[_0x1746('0x68')](_0x334a79,'id');var _0x3dde94;var _0x4030f7=squel[_0x1746('0x69')]();_0x4030f7[_0x1746('0x6a')](_0x5f3788[_0x1746('0x6b')]);for(var _0x37842c=0x0;_0x37842c<_0x390591[_0x1746('0x30')];_0x37842c+=0x1){_0x3dde94=_0x390591[_0x37842c][_0x1746('0x6c')]?_0x2cfba5[_0x390591[_0x37842c][_0x1746('0x6c')]][_0x1746('0x6d')]:_0x390591[_0x37842c]['field'];_0x3dde94=_0x390591[_0x37842c][_0x1746('0x6e')]?_[_0x1746('0x6f')](_0x4f0851[_0x390591[_0x37842c][_0x1746('0x6e')]],'%s',_0x3dde94):_0x3dde94;_0x3dde94=_0x390591[_0x37842c][_0x1746('0x70')]?_[_0x1746('0x6f')](_0x5b3e9c[_0x390591[_0x37842c][_0x1746('0x70')]],'%s',_0x3dde94):_0x3dde94;if(_0x390591[_0x37842c][_0x1746('0x71')]){_0x4030f7[_0x1746('0x61')](_0x3dde94);}_0x390591[_0x37842c][_0x1746('0x72')]&&_0x4030f7[_0x1746('0x73')](_0x3dde94,_0x390591[_0x37842c][_0x1746('0x72')]===_0x1746('0x74')?![]:!![]);_0x4030f7[_0x1746('0x3a')](_0x3dde94,_0x390591[_0x37842c][_0x1746('0x75')]||_0x3dde94);}if(_0x5f3788[_0x1746('0x76')]){_0x5f3788['joins']=JSON[_0x1746('0x77')](_0x5f3788['joins']);for(var _0x27ec9f=0x0;_0x27ec9f<_0x5f3788['joins'][_0x1746('0x30')];_0x27ec9f+=0x1){if(_0x5f3788[_0x1746('0x76')][_0x27ec9f][_0x1746('0x37')]&&_[_0x1746('0x5b')](_0x1551ff,_0x5f3788['joins'][_0x27ec9f][_0x1746('0x37')])&&_0x5f3788[_0x1746('0x76')][_0x27ec9f][_0x1746('0x78')]&&_0x5f3788[_0x1746('0x76')][_0x27ec9f][_0x1746('0x79')]&&_0x5f3788['joins'][_0x27ec9f][_0x1746('0x7a')]){_0x4030f7[_0x5f3788['joins'][_0x27ec9f][_0x1746('0x37')]](_0x5f3788[_0x1746('0x76')][_0x27ec9f]['foreignTable'],null,util['format'](_0x1746('0x7b'),_0x5f3788[_0x1746('0x6b')],_0x5f3788[_0x1746('0x76')][_0x27ec9f][_0x1746('0x78')],_0x5f3788[_0x1746('0x76')][_0x27ec9f]['foreignTable'],_0x5f3788[_0x1746('0x76')][_0x27ec9f][_0x1746('0x7a')]));}}}if(_0x5f3788[_0x1746('0x7c')]){_0x5f3788[_0x1746('0x7c')]=JSON['parse'](_0x5f3788[_0x1746('0x7c')]);_0x4030f7[_0x1746('0x32')](_0xfcd3f5(_0x5f3788['conditions']['group']));}_0x204ec2=_0x4030f7[_0x1746('0x7d')]();_0x4030f7[_0x1746('0x1a')](_0x181e7b);_0x4030f7[_0x1746('0x19')](0x0);logger[_0x1746('0x7e')]('Limited\x20Query:',_0x4030f7[_0x1746('0x7f')]());return db['sequelize'][_0x1746('0x2c')](_0x4030f7['toString'](),{'type':db[_0x1746('0x80')][_0x1746('0x81')][_0x1746('0x82')]});}})['then'](respondWithResult(_0x2939f4,null))[_0x1746('0x43')](handleError(_0x2939f4,null));};function runReport(_0x5f445f,_0x4b6813,_0x234373){var _0x3f65c8=_0x4b6813[_0x1746('0x26')];var _0xa1c4d3=0xa;var _0x1d6865=[_0x1746('0x4e'),_0x1746('0x4f'),_0x1746('0x50'),_0x1746('0x51')];var _0x5bfffb={'SUM':_0x1746('0x52'),'COUNT':_0x1746('0x53'),'COUNT DISTINCT':_0x1746('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x1746('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2d1967={'SEC_TO_TIME':_0x1746('0x59'),'DATE':'DATE(%s)','HOUR':_0x1746('0x83'),'ROUND':_0x1746('0x84'),'UNIX_TIMESTAMP':_0x1746('0x5a')};var _0x254727=function(_0xb56ed){return!_[_0x1746('0x5b')](['IS\x20NULL',_0x1746('0x5d'),_0x1746('0x5e'),'IS\x20NOT\x20EMPTY'],_0xb56ed);};var _0x2d9226=function(_0x1b09e4){if(!_0x1b09e4||!_0x1b09e4[_0x1746('0x5f')][_0x1746('0x30')]){return'';}for(var _0x353a0b='(',_0x3c43cc=0x0;_0x3c43cc<_0x1b09e4[_0x1746('0x5f')][_0x1746('0x30')];_0x3c43cc+=0x1){_0x3c43cc>0x0&&(_0x353a0b+='\x20'+_0x1b09e4[_0x1746('0x60')]+'\x20');_0x353a0b+=_0x1b09e4[_0x1746('0x5f')][_0x3c43cc]['group']?_0x2d9226(_0x1b09e4['rules'][_0x3c43cc][_0x1746('0x61')]):_0x1b09e4[_0x1746('0x5f')][_0x3c43cc][_0x1746('0x3a')]+'\x20'+_0x1b09e4[_0x1746('0x5f')][_0x3c43cc]['condition']+(_0x254727(_0x1b09e4[_0x1746('0x5f')][_0x3c43cc][_0x1746('0x62')])?'\x20'+_0x1b09e4[_0x1746('0x5f')][_0x3c43cc]['value']:'');}return _0x353a0b+')';};var _0x1a761c={'where':{'id':_0x5f445f['id']}},_0x55df3a,_0x449920,_0x2a7253,_0x10ee43,_0x164e4d;_0x1a761c=_['merge']({},_0x1a761c,_0x234373);return db[_0x1746('0x29')]['find'](_0x1a761c)[_0x1746('0x20')](function(_0xc53620){if(_0xc53620){_0x55df3a=_0xc53620;return _0xc53620[_0x1746('0x64')]();}return null;})[_0x1746('0x20')](function(_0x570013){if(_0x570013){if(!_0x570013[_0x1746('0x30')]){throw new db[(_0x1746('0x85'))]['ValidationErrorItem'](_0x1746('0x66'),0x193);}_0x449920=_0x570013;return db[_0x1746('0x86')][_0x1746('0x67')]({'raw':!![]});}return null;})[_0x1746('0x20')](function(_0x2d508f){if(_0x2d508f){_0x2a7253=_['keyBy'](_0x2d508f,'id');var _0x5b3b88;var _0x3cddf2=squel[_0x1746('0x69')]();_0x3cddf2['from'](_0x55df3a[_0x1746('0x6b')]);for(var _0x41b077=0x0;_0x41b077<_0x449920['length'];_0x41b077+=0x1){_0x5b3b88=_0x449920[_0x41b077][_0x1746('0x6c')]?_0x2a7253[_0x449920[_0x41b077][_0x1746('0x6c')]]['metric']:_0x449920[_0x41b077]['field'];_0x5b3b88=_0x449920[_0x41b077][_0x1746('0x6e')]?_[_0x1746('0x6f')](_0x5bfffb[_0x449920[_0x41b077][_0x1746('0x6e')]],'%s',_0x5b3b88):_0x5b3b88;_0x5b3b88=_0x449920[_0x41b077][_0x1746('0x70')]?_['replace'](_0x2d1967[_0x449920[_0x41b077]['format']],'%s',_0x5b3b88):_0x5b3b88;if(_0x449920[_0x41b077][_0x1746('0x71')]){_0x3cddf2[_0x1746('0x61')](_0x5b3b88);}_0x449920[_0x41b077][_0x1746('0x72')]&&_0x3cddf2['order'](_0x5b3b88,_0x449920[_0x41b077][_0x1746('0x72')]==='DESC'?![]:!![]);_0x3cddf2[_0x1746('0x3a')](_0x5b3b88,_0x449920[_0x41b077]['alias']||_0x5b3b88);}if(_0x55df3a[_0x1746('0x76')]){_0x55df3a[_0x1746('0x76')]=JSON[_0x1746('0x77')](_0x55df3a[_0x1746('0x76')]);for(var _0x1e014d=0x0;_0x1e014d<_0x55df3a[_0x1746('0x76')][_0x1746('0x30')];_0x1e014d+=0x1){if(_0x55df3a[_0x1746('0x76')][_0x1e014d][_0x1746('0x37')]&&_[_0x1746('0x5b')](_0x1d6865,_0x55df3a[_0x1746('0x76')][_0x1e014d][_0x1746('0x37')])&&_0x55df3a['joins'][_0x1e014d][_0x1746('0x78')]&&_0x55df3a[_0x1746('0x76')][_0x1e014d][_0x1746('0x79')]&&_0x55df3a[_0x1746('0x76')][_0x1e014d][_0x1746('0x7a')]){_0x3cddf2[_0x55df3a[_0x1746('0x76')][_0x1e014d][_0x1746('0x37')]](_0x55df3a[_0x1746('0x76')][_0x1e014d]['foreignTable'],null,util['format'](_0x1746('0x7b'),_0x55df3a[_0x1746('0x6b')],_0x55df3a[_0x1746('0x76')][_0x1e014d]['parentKey'],_0x55df3a[_0x1746('0x76')][_0x1e014d]['foreignTable'],_0x55df3a['joins'][_0x1e014d]['foreignKey']));}}}if(_0x55df3a[_0x1746('0x7c')]){_0x55df3a[_0x1746('0x7c')]=JSON[_0x1746('0x77')](_0x55df3a[_0x1746('0x7c')]);_0x3cddf2[_0x1746('0x32')](_0x2d9226(_0x55df3a[_0x1746('0x7c')]['group']));}_0x164e4d=_0x3cddf2[_0x1746('0x7d')]();_0x3cddf2[_0x1746('0x1a')](_0xa1c4d3);_0x3cddf2[_0x1746('0x19')](0x0);logger[_0x1746('0x7e')](_0x1746('0x87'),_0x3cddf2[_0x1746('0x7f')]());return db[_0x1746('0x80')][_0x1746('0x2c')](_0x3cddf2[_0x1746('0x7f')](),{'type':db[_0x1746('0x80')][_0x1746('0x81')][_0x1746('0x82')]});}})[_0x1746('0x20')](function(_0x5b6c74){if(!_0x5b6c74[_0x1746('0x30')]){throw new db[(_0x1746('0x85'))][(_0x1746('0x65'))](_0x1746('0x88'),0xcc);}if(_0x4b6813[_0x1746('0x89')]===_0x1746('0x8a')){return null;}var _0xb52ee=_[_0x1746('0x35')](_0x4b6813,{'name':_0x4b6813[_0x1746('0x8b')]||_0x4b6813[_0x1746('0x26')]||_0x55df3a[_0x1746('0x26')],'basename':_0x3f65c8,'savename':util[_0x1746('0x70')]('%s-%s.%s',_0x4b6813[_0x1746('0x26')]||_0x55df3a[_0x1746('0x26')],require(_0x1746('0x8c'))[_0x1746('0x8d')](0x4),_0x4b6813[_0x1746('0x89')]||_0x1746('0x8e')),'reportId':_0x55df3a['id'],'reportType':_0x1746('0x8f')});return db[_0x1746('0x90')][_0x1746('0x44')](_0xb52ee,{'raw':!![]});})[_0x1746('0x20')](function(_0x4de0a7){if(_0x55df3a[_0x1746('0x6b')]===_0x1746('0x91')){_0x164e4d['where'](_0x55df3a['table']+_0x1746('0x92'),_0x4b6813[_0x1746('0x93')],_0x4b6813[_0x1746('0x94')]);}else{_0x164e4d[_0x1746('0x32')](_0x55df3a['table']+_0x1746('0x95'),_0x4b6813['startDate'],_0x4b6813[_0x1746('0x94')]);}if(_0x4de0a7){logger[_0x1746('0x96')](_0x1746('0x97'),_0x164e4d[_0x1746('0x7f')]());require(_0x1746('0x98'))['fork'](path[_0x1746('0x4e')](__dirname,_0x1746('0x99'),_0x4de0a7[_0x1746('0x89')]),[_0x4de0a7['id'],_0x164e4d[_0x1746('0x7f')](),path['join'](__dirname,'../../files/reports',_0x4de0a7[_0x1746('0x9a')]),_0x3f65c8]);return _0x4de0a7;}else{var _0x56bcf8=squel['select']();_0x56bcf8[_0x1746('0x6a')]('('+_0x164e4d[_0x1746('0x7f')]()+')','countTable');_0x56bcf8[_0x1746('0x3a')](_0x1746('0x9b'),_0x1746('0x18'));_0x164e4d[_0x1746('0x1a')](_0x4b6813[_0x1746('0x1a')]||_0xa1c4d3);_0x164e4d['offset'](_0x4b6813[_0x1746('0x19')]||0x0);return db[_0x1746('0x80')]['query'](_0x56bcf8[_0x1746('0x7f')](),{'type':db[_0x1746('0x80')][_0x1746('0x81')]['SELECT']})[_0x1746('0x20')](function(_0x162454){if(!_0x162454[_0x1746('0x30')]){_0x10ee43=0x0;}else{_0x10ee43=_0x162454[0x0][_0x1746('0x18')]||0x0;}return db[_0x1746('0x80')][_0x1746('0x2c')](_0x164e4d['toString'](),{'type':db[_0x1746('0x80')][_0x1746('0x81')]['SELECT']});})[_0x1746('0x20')](function(_0x3cbd1a){return{'rows':_0x3cbd1a||[],'count':_0x10ee43};});}});}exports['run']=function(_0x103b31,_0x5af1cd){return runReport(_0x103b31[_0x1746('0x40')],_0x103b31[_0x1746('0x2c')],_0x103b31[_0x1746('0x3b')])[_0x1746('0x20')](respondWithResult(_0x5af1cd,null))[_0x1746('0x43')](handleError(_0x5af1cd,null));};exports['runReport']=runReport;exports['query']=function(_0xc1edd1,_0x349d8a){var _0x242bbd=0xa;var _0x474662=[_0x1746('0x4e'),_0x1746('0x4f'),_0x1746('0x50'),_0x1746('0x51')];var _0xc0a88c={'SUM':'SUM(%s)','COUNT':_0x1746('0x53'),'COUNT DISTINCT':_0x1746('0x54'),'MAX':'MAX(%s)','MIN':_0x1746('0x56'),'AVG':_0x1746('0x9c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1746('0x9d'),'GROUP_CONCAT DESC':_0x1746('0x58')};var _0x1df1e6={'SEC_TO_TIME':_0x1746('0x59'),'DATE':_0x1746('0x9e'),'HOUR':_0x1746('0x83'),'ROUND':_0x1746('0x84'),'UNIX_TIMESTAMP':_0x1746('0x5a')};var _0x379201=function(_0x47d581){return!_['includes']([_0x1746('0x5c'),'IS\x20NOT\x20NULL',_0x1746('0x5e'),'IS\x20NOT\x20EMPTY'],_0x47d581);};var _0x5ae761=function(_0x2c4f5f){if(!_0x2c4f5f||!_0x2c4f5f['rules'][_0x1746('0x30')]){return'';}for(var _0x45cd6f='(',_0x43bad5=0x0;_0x43bad5<_0x2c4f5f['rules'][_0x1746('0x30')];_0x43bad5+=0x1){_0x43bad5>0x0&&(_0x45cd6f+='\x20'+_0x2c4f5f['operator']+'\x20');_0x45cd6f+=_0x2c4f5f[_0x1746('0x5f')][_0x43bad5][_0x1746('0x61')]?_0x5ae761(_0x2c4f5f[_0x1746('0x5f')][_0x43bad5][_0x1746('0x61')]):_0x2c4f5f['rules'][_0x43bad5][_0x1746('0x3a')]+'\x20'+_0x2c4f5f['rules'][_0x43bad5][_0x1746('0x62')]+(_0x379201(_0x2c4f5f['rules'][_0x43bad5]['condition'])?'\x20'+_0x2c4f5f[_0x1746('0x5f')][_0x43bad5][_0x1746('0x63')]:'');}return _0x45cd6f+')';};var _0x52b049={'where':{'id':_0xc1edd1[_0x1746('0x40')]['id']}},_0x4e2d87,_0x1c270f,_0x414ad5,_0x24f56e,_0x553408;_0x52b049=_['merge']({},_0x52b049,_0xc1edd1[_0x1746('0x3b')]);return db[_0x1746('0x29')][_0x1746('0x42')](_0x52b049)[_0x1746('0x20')](function(_0x13a866){if(_0x13a866){_0x4e2d87=_0x13a866;return _0x13a866[_0x1746('0x64')]();}return null;})[_0x1746('0x20')](function(_0x1ff63e){if(_0x1ff63e){if(!_0x1ff63e['length']){throw new db[(_0x1746('0x85'))][(_0x1746('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1c270f=_0x1ff63e;return db[_0x1746('0x86')][_0x1746('0x67')]({'raw':!![]});}return null;})[_0x1746('0x20')](function(_0x2d8dc7){if(_0x2d8dc7){_0x414ad5=_[_0x1746('0x68')](_0x2d8dc7,'id');var _0x3ecaa9;var _0x2c48c0=squel[_0x1746('0x69')]();_0x2c48c0['from'](_0x4e2d87[_0x1746('0x6b')]);for(var _0x50b34b=0x0;_0x50b34b<_0x1c270f['length'];_0x50b34b+=0x1){_0x3ecaa9=_0x1c270f[_0x50b34b][_0x1746('0x6c')]?_0x414ad5[_0x1c270f[_0x50b34b]['MetricId']]['metric']:_0x1c270f[_0x50b34b][_0x1746('0x3a')];_0x3ecaa9=_0x1c270f[_0x50b34b][_0x1746('0x6e')]?_[_0x1746('0x6f')](_0xc0a88c[_0x1c270f[_0x50b34b][_0x1746('0x6e')]],'%s',_0x3ecaa9):_0x3ecaa9;_0x3ecaa9=_0x1c270f[_0x50b34b][_0x1746('0x70')]?_[_0x1746('0x6f')](_0x1df1e6[_0x1c270f[_0x50b34b]['format']],'%s',_0x3ecaa9):_0x3ecaa9;if(_0x1c270f[_0x50b34b]['groupBy']){_0x2c48c0[_0x1746('0x61')](_0x3ecaa9);}_0x1c270f[_0x50b34b][_0x1746('0x72')]&&_0x2c48c0[_0x1746('0x73')](_0x3ecaa9,_0x1c270f[_0x50b34b][_0x1746('0x72')]===_0x1746('0x74')?![]:!![]);_0x2c48c0[_0x1746('0x3a')](_0x3ecaa9,_0x1c270f[_0x50b34b][_0x1746('0x75')]||_0x3ecaa9);}if(_0x4e2d87[_0x1746('0x76')]){_0x4e2d87[_0x1746('0x76')]=JSON['parse'](_0x4e2d87['joins']);for(var _0x412195=0x0;_0x412195<_0x4e2d87[_0x1746('0x76')][_0x1746('0x30')];_0x412195+=0x1){if(_0x4e2d87['joins'][_0x412195]['type']&&_['includes'](_0x474662,_0x4e2d87[_0x1746('0x76')][_0x412195]['type'])&&_0x4e2d87['joins'][_0x412195][_0x1746('0x78')]&&_0x4e2d87[_0x1746('0x76')][_0x412195]['foreignTable']&&_0x4e2d87['joins'][_0x412195][_0x1746('0x7a')]){_0x2c48c0[_0x4e2d87[_0x1746('0x76')][_0x412195][_0x1746('0x37')]](_0x4e2d87[_0x1746('0x76')][_0x412195][_0x1746('0x79')],null,util[_0x1746('0x70')](_0x1746('0x7b'),_0x4e2d87[_0x1746('0x6b')],_0x4e2d87['joins'][_0x412195][_0x1746('0x78')],_0x4e2d87[_0x1746('0x76')][_0x412195][_0x1746('0x79')],_0x4e2d87[_0x1746('0x76')][_0x412195][_0x1746('0x7a')]));}}}if(_0x4e2d87['conditions']){_0x4e2d87[_0x1746('0x7c')]=JSON[_0x1746('0x77')](_0x4e2d87['conditions']);_0x2c48c0[_0x1746('0x32')](_0x5ae761(_0x4e2d87[_0x1746('0x7c')][_0x1746('0x61')]));}_0x553408=_0x2c48c0['clone']();_0x2c48c0[_0x1746('0x1a')](_0x242bbd);_0x2c48c0[_0x1746('0x19')](0x0);logger[_0x1746('0x7e')](_0x1746('0x87'),_0x2c48c0[_0x1746('0x7f')]());return db[_0x1746('0x80')][_0x1746('0x2c')](_0x2c48c0[_0x1746('0x7f')](),{'type':db['sequelize'][_0x1746('0x81')]['SELECT']});}})['then'](function(){return{'sql':_0x553408[_0x1746('0x7f')]()};})[_0x1746('0x20')](respondWithResult(_0x349d8a,null))['catch'](handleError(_0x349d8a,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index b887754..a889e74 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 _0xbadd=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x3f6107,_0x514051){var _0x4f6b8f=function(_0x36f6b4){while(--_0x36f6b4){_0x3f6107['push'](_0x3f6107['shift']());}};_0x4f6b8f(++_0x514051);}(_0xbadd,0xef));var _0xdbad=function(_0x2ceba7,_0x451ce4){_0x2ceba7=_0x2ceba7-0x0;var _0x5348eb=_0xbadd[_0x2ceba7];return _0x5348eb;};'use strict';var _=require(_0xdbad('0x0'));var util=require('util');var logger=require(_0xdbad('0x1'))('api');var moment=require(_0xdbad('0x2'));var BPromise=require(_0xdbad('0x3'));var rp=require(_0xdbad('0x4'));var fs=require('fs');var path=require(_0xdbad('0x5'));var rimraf=require('rimraf');var config=require(_0xdbad('0x6'));var attributes=require(_0xdbad('0x7'));module[_0xdbad('0x8')]=function(_0x333097,_0x25cc0c){return _0x333097[_0xdbad('0x9')](_0xdbad('0xa'),attributes,{'tableName':_0xdbad('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c77=['../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4b44d6,_0x59a1ef){var _0x24e58d=function(_0x34d2ae){while(--_0x34d2ae){_0x4b44d6['push'](_0x4b44d6['shift']());}};_0x24e58d(++_0x59a1ef);}(_0x0c77,0x18d));var _0x70c7=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x0c77[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0x70c7('0x0'));var util=require(_0x70c7('0x1'));var logger=require(_0x70c7('0x2'))(_0x70c7('0x3'));var moment=require(_0x70c7('0x4'));var BPromise=require(_0x70c7('0x5'));var rp=require(_0x70c7('0x6'));var fs=require('fs');var path=require(_0x70c7('0x7'));var rimraf=require(_0x70c7('0x8'));var config=require(_0x70c7('0x9'));var attributes=require(_0x70c7('0xa'));module[_0x70c7('0xb')]=function(_0x39bbeb,_0x13fc9c){return _0x39bbeb[_0x70c7('0xc')]('AnalyticCustomReport',attributes,{'tableName':_0x70c7('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index a728986..9a08638 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 _0xa4b4=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent'];(function(_0x485507,_0x9ab47f){var _0x1f79e7=function(_0x2670c9){while(--_0x2670c9){_0x485507['push'](_0x485507['shift']());}};_0x1f79e7(++_0x9ab47f);}(_0xa4b4,0x1ad));var _0x4a4b=function(_0x4df85c,_0x248dfb){_0x4df85c=_0x4df85c-0x0;var _0x4e2a61=_0xa4b4[_0x4df85c];return _0x4e2a61;};'use strict';var _=require('lodash');var util=require(_0x4a4b('0x0'));var moment=require('moment');var BPromise=require(_0x4a4b('0x1'));var rs=require(_0x4a4b('0x2'));var fs=require('fs');var Redis=require(_0x4a4b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a4b('0x4'));var logger=require('../../config/logger')(_0x4a4b('0x5'));var config=require(_0x4a4b('0x6'));var jayson=require(_0x4a4b('0x7'));var client=jayson['client'][_0x4a4b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f03ca,_0xa134ee,_0xeab11b){return new BPromise(function(_0x5611ef,_0x173c7a){return client[_0x4a4b('0x9')](_0x3f03ca,_0xeab11b)['then'](function(_0x25ef50){logger['info'](_0x4a4b('0xa'),_0xa134ee,_0x4a4b('0xb'));logger[_0x4a4b('0xc')](_0x4a4b('0xd'),_0xa134ee,_0x4a4b('0xb'),JSON[_0x4a4b('0xe')](_0x25ef50));if(_0x25ef50[_0x4a4b('0xf')]){if(_0x25ef50[_0x4a4b('0xf')][_0x4a4b('0x10')]===0x1f4){logger[_0x4a4b('0xf')](_0x4a4b('0xa'),_0xa134ee,_0x25ef50[_0x4a4b('0xf')][_0x4a4b('0x11')]);return _0x173c7a(_0x25ef50[_0x4a4b('0xf')][_0x4a4b('0x11')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xa134ee,_0x25ef50[_0x4a4b('0xf')]['message']);return _0x5611ef(_0x25ef50['error'][_0x4a4b('0x11')]);}else{logger[_0x4a4b('0x12')](_0x4a4b('0xa'),_0xa134ee,_0x4a4b('0xb'));_0x5611ef(_0x25ef50[_0x4a4b('0x13')][_0x4a4b('0x11')]);}})[_0x4a4b('0x14')](function(_0x51a732){logger['error'](_0x4a4b('0xa'),_0xa134ee,_0x51a732);_0x173c7a(_0x51a732);});});} \ No newline at end of file +var _0xf34f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x170ca4,_0x447004){var _0x55fc0c=function(_0x465bc9){while(--_0x465bc9){_0x170ca4['push'](_0x170ca4['shift']());}};_0x55fc0c(++_0x447004);}(_0xf34f,0x16b));var _0xff34=function(_0x362d06,_0x146a4f){_0x362d06=_0x362d06-0x0;var _0x20f136=_0xf34f[_0x362d06];return _0x20f136;};'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')]('AnalyticCustomReport,\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/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 74628ac..f994781 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 _0x9276=['path','Router','../../components/auth/service','get','isAuthenticated','index','show','preview','run','/:id/query','query','post','create','put','/:id','update','destroy','exports','multer','util'];(function(_0x5280f4,_0x3c36d0){var _0xba93e7=function(_0x14d63a){while(--_0x14d63a){_0x5280f4['push'](_0x5280f4['shift']());}};_0xba93e7(++_0x3c36d0);}(_0x9276,0x9e));var _0x6927=function(_0x38b692,_0x566e45){_0x38b692=_0x38b692-0x0;var _0x2adba6=_0x9276[_0x38b692];return _0x2adba6;};'use strict';var multer=require(_0x6927('0x0'));var util=require(_0x6927('0x1'));var path=require(_0x6927('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6927('0x3')]();var auth=require(_0x6927('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0x6927('0x5')]('/',auth[_0x6927('0x6')](),controller[_0x6927('0x7')]);router[_0x6927('0x5')]('/:id',auth[_0x6927('0x6')](),controller[_0x6927('0x8')]);router[_0x6927('0x5')]('/:id/preview',auth[_0x6927('0x6')](),controller[_0x6927('0x9')]);router[_0x6927('0x5')]('/:id/run',auth['isAuthenticated'](),controller[_0x6927('0xa')]);router[_0x6927('0x5')](_0x6927('0xb'),auth[_0x6927('0x6')](),controller[_0x6927('0xc')]);router[_0x6927('0xd')]('/',auth[_0x6927('0x6')](),controller[_0x6927('0xe')]);router[_0x6927('0xf')](_0x6927('0x10'),auth['isAuthenticated'](),controller[_0x6927('0x11')]);router['delete'](_0x6927('0x10'),auth[_0x6927('0x6')](),controller[_0x6927('0x12')]);module[_0x6927('0x13')]=router; \ No newline at end of file +var _0x03a5=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/run','run','/:id/query','query','post','create','put','/:id','update','delete'];(function(_0x506caf,_0x36b437){var _0x3d74e7=function(_0x885ea7){while(--_0x885ea7){_0x506caf['push'](_0x506caf['shift']());}};_0x3d74e7(++_0x36b437);}(_0x03a5,0x192));var _0x503a=function(_0x3f0c06,_0x3d0ecf){_0x3f0c06=_0x3f0c06-0x0;var _0x507d9f=_0x03a5[_0x3f0c06];return _0x507d9f;};'use strict';var multer=require(_0x503a('0x0'));var util=require(_0x503a('0x1'));var path=require(_0x503a('0x2'));var timeout=require(_0x503a('0x3'));var express=require(_0x503a('0x4'));var router=express[_0x503a('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x503a('0x6'));var config=require(_0x503a('0x7'));var controller=require(_0x503a('0x8'));router[_0x503a('0x9')]('/',auth[_0x503a('0xa')](),controller[_0x503a('0xb')]);router[_0x503a('0x9')]('/:id',auth[_0x503a('0xa')](),controller[_0x503a('0xc')]);router[_0x503a('0x9')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router[_0x503a('0x9')](_0x503a('0xd'),auth[_0x503a('0xa')](),controller[_0x503a('0xe')]);router['get'](_0x503a('0xf'),auth[_0x503a('0xa')](),controller[_0x503a('0x10')]);router[_0x503a('0x11')]('/',auth[_0x503a('0xa')](),controller[_0x503a('0x12')]);router[_0x503a('0x13')](_0x503a('0x14'),auth[_0x503a('0xa')](),controller[_0x503a('0x15')]);router[_0x503a('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x503a('0x17')]);module[_0x503a('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 3199e10..3458706 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 _0xe4df=['STRING','TEXT','sequelize','exports'];(function(_0x20cb20,_0x256051){var _0x2fcf4b=function(_0x26200b){while(--_0x26200b){_0x20cb20['push'](_0x20cb20['shift']());}};_0x2fcf4b(++_0x256051);}(_0xe4df,0x1ee));var _0xfe4d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xe4df[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xfe4d('0x0'));module[_0xfe4d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xfe4d('0x2')]},'parent':{'type':Sequelize[_0xfe4d('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xfe4d('0x3')]},'joins':{'type':Sequelize[_0xfe4d('0x3')]}}; \ No newline at end of file +var _0xdc21=['STRING','TEXT','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc21,0x92));var _0x1dc2=function(_0x719132,_0x3eaf8f){_0x719132=_0x719132-0x0;var _0x3539fd=_0xdc21[_0x719132];return _0x3539fd;};'use strict';var Sequelize=require(_0x1dc2('0x0'));module[_0x1dc2('0x1')]={'name':{'type':Sequelize[_0x1dc2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1dc2('0x2')]},'parent':{'type':Sequelize[_0x1dc2('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x1dc2('0x3')]},'joins':{'type':Sequelize[_0x1dc2('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index f66fd8b..3c3c98a 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 _0x7a54=['field','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','length','find','create','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','order','orderBy','DESC','alias','joins','parse','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','condition','getFields','No\x20available\x20data','web','fullPath','%s-%s.%s','output','csv','AnalyticExtractedReport','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','run','runReport','AVG(%s)','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','save','update','destroy','then','get','DefaultReports','UserProfileResource','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','offset','where','pick','filter','merge','map','type','key'];(function(_0x5b2b18,_0x4ce6c3){var _0x31fc9a=function(_0x316a44){while(--_0x316a44){_0x5b2b18['push'](_0x5b2b18['shift']());}};_0x31fc9a(++_0x4ce6c3);}(_0x7a54,0x106));var _0x47a5=function(_0x20b734,_0x5e7e15){_0x20b734=_0x20b734-0x0;var _0x9519d7=_0x7a54[_0x20b734];return _0x9519d7;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];function respondWithStatusCode(_0x250fad,_0xd612dd){_0xd612dd=_0xd612dd||0xcc;return function(_0xd308b8){if(_0xd308b8){return _0x250fad[_0x47a5('0x14')](_0xd612dd);}return _0x250fad['status'](_0xd612dd)[_0x47a5('0x15')]();};}function respondWithResult(_0x221b54,_0x1cf309){_0x1cf309=_0x1cf309||0xc8;return function(_0x711793){if(_0x711793){return _0x221b54[_0x47a5('0x16')](_0x1cf309)[_0x47a5('0x17')](_0x711793);}};}function respondWithFilteredResult(_0x3c6c46,_0x190faa){return function(_0x4e99a8){if(_0x4e99a8){var _0x362359=_0x4e99a8[_0x47a5('0x18')],_0x11faf5=_0x190faa['offset'],_0x3b001e=_0x190faa['offset']+_0x190faa[_0x47a5('0x19')],_0x2a2cbb;if(_0x3b001e>=_0x362359){_0x3b001e=_0x362359;_0x2a2cbb=0xc8;}else{_0x2a2cbb=0xce;}_0x3c6c46['status'](_0x2a2cbb);return _0x3c6c46['set'](_0x47a5('0x1a'),_0x11faf5+'-'+_0x3b001e+'/'+_0x362359)[_0x47a5('0x17')](_0x4e99a8);}return null;};}function patchUpdates(_0x2ce454){return function(_0x1ef371){try{jsonpatch[_0x47a5('0x1b')](_0x1ef371,_0x2ce454,!![]);}catch(_0x12b98e){return BPromise[_0x47a5('0x1c')](_0x12b98e);}return _0x1ef371[_0x47a5('0x1d')]();};}function saveUpdates(_0x3aed38,_0x4a9fcb){return function(_0x1570bc){if(_0x1570bc){return _0x1570bc[_0x47a5('0x1e')](_0x3aed38)['then'](function(_0x2b0360){return _0x2b0360;});}return null;};}function removeEntity(_0x1f03f7,_0x36874d){return function(_0x4c5910){if(_0x4c5910){return _0x4c5910[_0x47a5('0x1f')]()[_0x47a5('0x20')](function(){var _0x23db32=_0x4c5910[_0x47a5('0x21')]({'plain':!![]});var _0x5ef1b1=_0x47a5('0x22');return db[_0x47a5('0x23')]['destroy']({'where':{'type':_0x5ef1b1,'resourceId':_0x23db32['id']}})[_0x47a5('0x20')](function(){return _0x4c5910;});})[_0x47a5('0x20')](function(){_0x1f03f7[_0x47a5('0x16')](0xcc)[_0x47a5('0x15')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x14')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x24')](_0x5b6c4e[_0x47a5('0x25')]);if(_0x5b6c4e[_0x47a5('0x26')]){delete _0x5b6c4e[_0x47a5('0x26')];}_0x5686db[_0x47a5('0x16')](_0x1ea9c8)[_0x47a5('0x27')](_0x5b6c4e);};}exports[_0x47a5('0x28')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=db['AnalyticDefaultReport'][_0x47a5('0x29')];_0x1127f8['model']=_[_0x47a5('0x2a')](_0x3ad507);_0x1127f8[_0x47a5('0x2b')]=_[_0x47a5('0x2a')](_0x136b14['query']);_0x1127f8[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x1127f8[_0x47a5('0x2e')],_0x1127f8[_0x47a5('0x2b')]);_0x361bfa['attributes']=_['intersection'](_0x1127f8[_0x47a5('0x2e')],qs[_0x47a5('0x2f')](_0x136b14['query']['fields']));_0x361bfa[_0x47a5('0x30')]=_0x361bfa[_0x47a5('0x30')]['length']?_0x361bfa[_0x47a5('0x30')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2b')][_0x47a5('0x31')]('nolimit')){_0x361bfa['limit']=qs[_0x47a5('0x19')](_0x136b14['query'][_0x47a5('0x19')]);_0x361bfa[_0x47a5('0x32')]=qs[_0x47a5('0x32')](_0x136b14['query'][_0x47a5('0x32')]);}_0x361bfa['order']=qs['sort'](_0x136b14[_0x47a5('0x2b')]['sort']);_0x361bfa[_0x47a5('0x33')]=qs['filters'](_[_0x47a5('0x34')](_0x136b14[_0x47a5('0x2b')],_0x1127f8[_0x47a5('0x2c')]));if(_0x136b14[_0x47a5('0x2b')][_0x47a5('0x35')]){_0x361bfa[_0x47a5('0x33')]=_[_0x47a5('0x36')](_0x361bfa[_0x47a5('0x33')],{'$or':_[_0x47a5('0x37')](_0x3ad507,function(_0x4caed5){if(_0x4caed5[_0x47a5('0x38')][_0x47a5('0x39')]!=='VIRTUAL'){var _0x2c50d6={};_0x2c50d6[_0x4caed5[_0x47a5('0x3a')]]={'$like':'%'+_0x136b14[_0x47a5('0x2b')]['filter']+'%'};return _0x2c50d6;}})});}_0x361bfa=_[_0x47a5('0x36')]({},_0x361bfa,_0x136b14[_0x47a5('0x3b')]);var _0x596097={'where':_0x361bfa[_0x47a5('0x33')]};return db[_0x47a5('0x3c')]['count'](_0x596097)['then'](function(_0x5ebd8c){_0x11a4fa[_0x47a5('0x18')]=_0x5ebd8c;if(_0x136b14['query'][_0x47a5('0x3d')]){_0x361bfa[_0x47a5('0x3e')]=[{'all':!![]}];}return db[_0x47a5('0x3c')][_0x47a5('0x3f')](_0x361bfa);})[_0x47a5('0x20')](function(_0xcb5243){_0x11a4fa[_0x47a5('0x40')]=_0xcb5243;return _0x11a4fa;})[_0x47a5('0x20')](respondWithFilteredResult(_0x16631f,_0x361bfa))[_0x47a5('0x41')](handleError(_0x16631f,null));};exports[_0x47a5('0x42')]=function(_0x280500,_0x1658e8){var _0x23d6d8={'raw':!![],'where':{'id':_0x280500[_0x47a5('0x43')]['id']}},_0x56dbbd={};_0x56dbbd[_0x47a5('0x2e')]=_[_0x47a5('0x2a')](db[_0x47a5('0x3c')]['rawAttributes']);_0x56dbbd[_0x47a5('0x2b')]=_['keys'](_0x280500['query']);_0x56dbbd['filters']=_['intersection'](_0x56dbbd[_0x47a5('0x2e')],_0x56dbbd['query']);_0x23d6d8[_0x47a5('0x30')]=_[_0x47a5('0x2d')](_0x56dbbd[_0x47a5('0x2e')],qs['fields'](_0x280500[_0x47a5('0x2b')][_0x47a5('0x2f')]));_0x23d6d8['attributes']=_0x23d6d8['attributes'][_0x47a5('0x44')]?_0x23d6d8['attributes']:_0x56dbbd[_0x47a5('0x2e')];if(_0x280500[_0x47a5('0x2b')][_0x47a5('0x3d')]){_0x23d6d8[_0x47a5('0x3e')]=[{'all':!![]}];}_0x23d6d8=_[_0x47a5('0x36')]({},_0x23d6d8,_0x280500[_0x47a5('0x3b')]);return db[_0x47a5('0x3c')][_0x47a5('0x45')](_0x23d6d8)[_0x47a5('0x20')](handleEntityNotFound(_0x1658e8,null))[_0x47a5('0x20')](respondWithResult(_0x1658e8,null))[_0x47a5('0x41')](handleError(_0x1658e8,null));};exports[_0x47a5('0x46')]=function(_0xe28d76,_0x3574d4){return db[_0x47a5('0x3c')][_0x47a5('0x46')](_0xe28d76['body'],{})[_0x47a5('0x20')](function(_0x23bb04){var _0x49eab1=_0xe28d76['user'][_0x47a5('0x21')]({'plain':!![]});if(!_0x49eab1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49eab1[_0x47a5('0x47')]===_0x47a5('0x48')){var _0x54c35f=_0x23bb04['get']({'plain':!![]});var _0x3d85cc='Reports';return db[_0x47a5('0x49')][_0x47a5('0x45')]({'where':{'name':_0x3d85cc,'userProfileId':_0x49eab1[_0x47a5('0x4a')]},'raw':!![]})[_0x47a5('0x20')](function(_0x44fe8a){if(_0x44fe8a&&_0x44fe8a[_0x47a5('0x4b')]===0x0){return db[_0x47a5('0x23')]['create']({'name':_0x54c35f['name'],'resourceId':_0x54c35f['id'],'type':_0x47a5('0x22'),'sectionId':_0x44fe8a['id']},{})[_0x47a5('0x20')](function(){return _0x23bb04;});}else{return _0x23bb04;}})[_0x47a5('0x41')](function(_0x9ea93e){logger[_0x47a5('0x24')](_0x47a5('0x4c'),_0x9ea93e);throw _0x9ea93e;});}return _0x23bb04;})[_0x47a5('0x20')](respondWithResult(_0x3574d4,0xc9))['catch'](handleError(_0x3574d4,null));};exports[_0x47a5('0x1e')]=function(_0x1c9a62,_0x5f6a){if(_0x1c9a62['body']['id']){delete _0x1c9a62[_0x47a5('0x4d')]['id'];}return db['AnalyticDefaultReport'][_0x47a5('0x45')]({'where':{'id':_0x1c9a62[_0x47a5('0x43')]['id']}})[_0x47a5('0x20')](handleEntityNotFound(_0x5f6a,null))[_0x47a5('0x20')](saveUpdates(_0x1c9a62['body'],null))[_0x47a5('0x20')](respondWithResult(_0x5f6a,null))[_0x47a5('0x41')](handleError(_0x5f6a,null));};exports[_0x47a5('0x1f')]=function(_0x3a2de4,_0x1b2335){return db[_0x47a5('0x3c')][_0x47a5('0x45')]({'where':{'id':_0x3a2de4['params']['id']}})[_0x47a5('0x20')](handleEntityNotFound(_0x1b2335,null))[_0x47a5('0x20')](removeEntity(_0x1b2335,null))[_0x47a5('0x41')](handleError(_0x1b2335,null));};exports[_0x47a5('0x4e')]=function(_0x3329aa,_0x1ab0bf){var _0x572233=0xa;var _0x1ad6a9=[_0x47a5('0x4f'),_0x47a5('0x50'),'right_join',_0x47a5('0x51')];var _0x3c78b7={'SUM':_0x47a5('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x47a5('0x53'),'MIN':_0x47a5('0x54'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x55'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x16bb8a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x47a5('0x56'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b958b=function(_0x72fe){return!_['includes'](['IS\x20NULL',_0x47a5('0x58'),_0x47a5('0x59'),_0x47a5('0x5a')],_0x72fe);};var _0x2931e4=function(_0x5996c4){if(!_0x5996c4||!_0x5996c4[_0x47a5('0x5b')][_0x47a5('0x44')]){return'';}for(var _0x1af800='(',_0x5a33b8=0x0;_0x5a33b8<_0x5996c4[_0x47a5('0x5b')]['length'];_0x5a33b8+=0x1){_0x5a33b8>0x0&&(_0x1af800+='\x20'+_0x5996c4[_0x47a5('0x5c')]+'\x20');_0x1af800+=_0x5996c4[_0x47a5('0x5b')][_0x5a33b8][_0x47a5('0x5d')]?_0x2931e4(_0x5996c4[_0x47a5('0x5b')][_0x5a33b8][_0x47a5('0x5d')]):_0x5996c4['rules'][_0x5a33b8][_0x47a5('0x3a')]+'\x20'+_0x5996c4['rules'][_0x5a33b8]['condition']+(_0x1b958b(_0x5996c4['rules'][_0x5a33b8]['condition'])?'\x20'+_0x5996c4[_0x47a5('0x5b')][_0x5a33b8][_0x47a5('0x5e')]:'');}return _0x1af800+')';};var _0x1e2bb4={'where':{'id':_0x3329aa[_0x47a5('0x43')]['id']}},_0x52e3ee,_0x4d3db1,_0x139229,_0x23020b,_0x45d4b6;_0x1e2bb4=_[_0x47a5('0x36')]({},_0x1e2bb4,_0x3329aa['options']);return db[_0x47a5('0x3c')]['find'](_0x1e2bb4)[_0x47a5('0x20')](function(_0x274d31){if(_0x274d31){_0x52e3ee=_0x274d31;return _0x274d31['getFields']();}return null;})[_0x47a5('0x20')](function(_0x345104){if(_0x345104){if(!_0x345104[_0x47a5('0x44')]){throw new db[(_0x47a5('0x5f'))][(_0x47a5('0x60'))](_0x47a5('0x61'),0x193);}_0x4d3db1=_0x345104;return db[_0x47a5('0x62')][_0x47a5('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x2dcc3b){if(_0x2dcc3b){_0x139229=_[_0x47a5('0x63')](_0x2dcc3b,'id');var _0x3c75c6;var _0x26e7fc=squel[_0x47a5('0x64')]();_0x26e7fc['from'](_0x52e3ee[_0x47a5('0x65')]);for(var _0xdfcecc=0x0;_0xdfcecc<_0x4d3db1[_0x47a5('0x44')];_0xdfcecc+=0x1){_0x3c75c6=_0x4d3db1[_0xdfcecc][_0x47a5('0x66')]?_0x139229[_0x4d3db1[_0xdfcecc][_0x47a5('0x66')]][_0x47a5('0x67')]:_0x4d3db1[_0xdfcecc][_0x47a5('0x3a')];_0x3c75c6=_0x4d3db1[_0xdfcecc][_0x47a5('0x68')]?_[_0x47a5('0x69')](_0x3c78b7[_0x4d3db1[_0xdfcecc][_0x47a5('0x68')]],'%s',_0x3c75c6):_0x3c75c6;_0x3c75c6=_0x4d3db1[_0xdfcecc][_0x47a5('0x6a')]?_[_0x47a5('0x69')](_0x16bb8a[_0x4d3db1[_0xdfcecc][_0x47a5('0x6a')]],'%s',_0x3c75c6):_0x3c75c6;if(_0x4d3db1[_0xdfcecc][_0x47a5('0x6b')]){_0x26e7fc[_0x47a5('0x5d')](_0x3c75c6);}_0x4d3db1[_0xdfcecc]['orderBy']&&_0x26e7fc[_0x47a5('0x6c')](_0x3c75c6,_0x4d3db1[_0xdfcecc][_0x47a5('0x6d')]===_0x47a5('0x6e')?![]:!![]);_0x26e7fc['field'](_0x3c75c6,_0x4d3db1[_0xdfcecc][_0x47a5('0x6f')]||_0x3c75c6);}if(_0x52e3ee[_0x47a5('0x70')]){_0x52e3ee[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x52e3ee['joins']);for(var _0x3ac402=0x0;_0x3ac402<_0x52e3ee['joins'][_0x47a5('0x44')];_0x3ac402+=0x1){if(_0x52e3ee['joins'][_0x3ac402][_0x47a5('0x38')]&&_['includes'](_0x1ad6a9,_0x52e3ee[_0x47a5('0x70')][_0x3ac402][_0x47a5('0x38')])&&_0x52e3ee[_0x47a5('0x70')][_0x3ac402]['parentKey']&&_0x52e3ee['joins'][_0x3ac402]['foreignTable']&&_0x52e3ee[_0x47a5('0x70')][_0x3ac402][_0x47a5('0x72')]){_0x26e7fc[_0x52e3ee[_0x47a5('0x70')][_0x3ac402][_0x47a5('0x38')]](_0x52e3ee['joins'][_0x3ac402][_0x47a5('0x73')],null,util[_0x47a5('0x6a')](_0x47a5('0x74'),_0x52e3ee[_0x47a5('0x65')],_0x52e3ee[_0x47a5('0x70')][_0x3ac402][_0x47a5('0x75')],_0x52e3ee[_0x47a5('0x70')][_0x3ac402][_0x47a5('0x73')],_0x52e3ee[_0x47a5('0x70')][_0x3ac402][_0x47a5('0x72')]));}}}if(_0x52e3ee[_0x47a5('0x76')]){_0x52e3ee[_0x47a5('0x76')]=JSON['parse'](_0x52e3ee[_0x47a5('0x76')]);_0x26e7fc['where'](_0x2931e4(_0x52e3ee[_0x47a5('0x76')][_0x47a5('0x5d')]));}_0x45d4b6=_0x26e7fc[_0x47a5('0x77')]();_0x26e7fc[_0x47a5('0x19')](_0x572233);_0x26e7fc[_0x47a5('0x32')](0x0);logger[_0x47a5('0x78')](_0x47a5('0x79'),_0x26e7fc[_0x47a5('0x7a')]());return db[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x26e7fc[_0x47a5('0x7a')](),{'type':db[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x20')](respondWithResult(_0x1ab0bf,null))['catch'](handleError(_0x1ab0bf,null));};function runReport(_0x48eb77,_0x5ccc89,_0x4d09a4){var _0x490e28=_0x5ccc89[_0x47a5('0x26')];var _0x5d6916=0xa;var _0x732e00=[_0x47a5('0x4f'),_0x47a5('0x50'),_0x47a5('0x7e'),_0x47a5('0x51')];var _0x930d25={'SUM':_0x47a5('0x52'),'COUNT':_0x47a5('0x7f'),'COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x53'),'MIN':_0x47a5('0x54'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x47a5('0x81'),'GROUP_CONCAT ASC':_0x47a5('0x55'),'GROUP_CONCAT DESC':_0x47a5('0x82')};var _0x4f35ff={'SEC_TO_TIME':_0x47a5('0x83'),'DATE':_0x47a5('0x84'),'HOUR':_0x47a5('0x56'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x47a5('0x85')};var _0x5205ba=function(_0x49d93d){return!_[_0x47a5('0x86')]([_0x47a5('0x87'),_0x47a5('0x58'),_0x47a5('0x59'),_0x47a5('0x5a')],_0x49d93d);};var _0xea50f3=function(_0x479a82){if(!_0x479a82||!_0x479a82['rules'][_0x47a5('0x44')]){return'';}for(var _0x4f2361='(',_0x24dbee=0x0;_0x24dbee<_0x479a82[_0x47a5('0x5b')][_0x47a5('0x44')];_0x24dbee+=0x1){_0x24dbee>0x0&&(_0x4f2361+='\x20'+_0x479a82[_0x47a5('0x5c')]+'\x20');_0x4f2361+=_0x479a82['rules'][_0x24dbee][_0x47a5('0x5d')]?_0xea50f3(_0x479a82['rules'][_0x24dbee]['group']):_0x479a82[_0x47a5('0x5b')][_0x24dbee][_0x47a5('0x3a')]+'\x20'+_0x479a82['rules'][_0x24dbee][_0x47a5('0x88')]+(_0x5205ba(_0x479a82[_0x47a5('0x5b')][_0x24dbee][_0x47a5('0x88')])?'\x20'+_0x479a82['rules'][_0x24dbee][_0x47a5('0x5e')]:'');}return _0x4f2361+')';};var _0x578e27={'where':{'id':_0x48eb77['id']}},_0x2307da,_0x219beb,_0x63e2e5,_0x4a5ca1,_0x2e0af1;_0x578e27=_[_0x47a5('0x36')]({},_0x578e27,_0x4d09a4);return db[_0x47a5('0x3c')]['find'](_0x578e27)[_0x47a5('0x20')](function(_0x4f2fbb){if(_0x4f2fbb){_0x2307da=_0x4f2fbb;return _0x4f2fbb[_0x47a5('0x89')]();}return null;})['then'](function(_0x135d2e){if(_0x135d2e){if(!_0x135d2e[_0x47a5('0x44')]){throw new db[(_0x47a5('0x5f'))][(_0x47a5('0x60'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x219beb=_0x135d2e;return db[_0x47a5('0x62')][_0x47a5('0x3f')]({'raw':!![]});}return null;})[_0x47a5('0x20')](function(_0x1bbfba){if(_0x1bbfba){_0x63e2e5=_[_0x47a5('0x63')](_0x1bbfba,'id');var _0x57ac25;var _0x56c35e=squel[_0x47a5('0x64')]();_0x56c35e['from'](_0x2307da[_0x47a5('0x65')]);for(var _0xa8809a=0x0;_0xa8809a<_0x219beb[_0x47a5('0x44')];_0xa8809a+=0x1){_0x57ac25=_0x219beb[_0xa8809a]['MetricId']?_0x63e2e5[_0x219beb[_0xa8809a][_0x47a5('0x66')]][_0x47a5('0x67')]:_0x219beb[_0xa8809a]['field'];_0x57ac25=_0x219beb[_0xa8809a][_0x47a5('0x68')]?_[_0x47a5('0x69')](_0x930d25[_0x219beb[_0xa8809a][_0x47a5('0x68')]],'%s',_0x57ac25):_0x57ac25;_0x57ac25=_0x219beb[_0xa8809a][_0x47a5('0x6a')]?_['replace'](_0x4f35ff[_0x219beb[_0xa8809a]['format']],'%s',_0x57ac25):_0x57ac25;if(_0x219beb[_0xa8809a][_0x47a5('0x6b')]){_0x56c35e[_0x47a5('0x5d')](_0x57ac25);}_0x219beb[_0xa8809a]['orderBy']&&_0x56c35e[_0x47a5('0x6c')](_0x57ac25,_0x219beb[_0xa8809a][_0x47a5('0x6d')]==='DESC'?![]:!![]);_0x56c35e[_0x47a5('0x3a')](_0x57ac25,_0x219beb[_0xa8809a][_0x47a5('0x6f')]||_0x57ac25);}if(_0x2307da[_0x47a5('0x70')]){_0x2307da['joins']=JSON[_0x47a5('0x71')](_0x2307da['joins']);for(var _0x663778=0x0;_0x663778<_0x2307da['joins'][_0x47a5('0x44')];_0x663778+=0x1){if(_0x2307da[_0x47a5('0x70')][_0x663778]['type']&&_[_0x47a5('0x86')](_0x732e00,_0x2307da['joins'][_0x663778][_0x47a5('0x38')])&&_0x2307da[_0x47a5('0x70')][_0x663778][_0x47a5('0x75')]&&_0x2307da[_0x47a5('0x70')][_0x663778]['foreignTable']&&_0x2307da[_0x47a5('0x70')][_0x663778]['foreignKey']){_0x56c35e[_0x2307da['joins'][_0x663778][_0x47a5('0x38')]](_0x2307da[_0x47a5('0x70')][_0x663778][_0x47a5('0x73')],null,util[_0x47a5('0x6a')](_0x47a5('0x74'),_0x2307da['table'],_0x2307da[_0x47a5('0x70')][_0x663778][_0x47a5('0x75')],_0x2307da[_0x47a5('0x70')][_0x663778][_0x47a5('0x73')],_0x2307da['joins'][_0x663778][_0x47a5('0x72')]));}}}if(_0x2307da['conditions']){_0x2307da[_0x47a5('0x76')]=JSON[_0x47a5('0x71')](_0x2307da[_0x47a5('0x76')]);_0x56c35e[_0x47a5('0x33')](_0xea50f3(_0x2307da[_0x47a5('0x76')][_0x47a5('0x5d')]));}_0x2e0af1=_0x56c35e[_0x47a5('0x77')]();_0x56c35e[_0x47a5('0x19')](_0x5d6916);_0x56c35e[_0x47a5('0x32')](0x0);logger['debug'](_0x47a5('0x79'),_0x56c35e[_0x47a5('0x7a')]());return db['sequelize'][_0x47a5('0x2b')](_0x56c35e[_0x47a5('0x7a')](),{'type':db[_0x47a5('0x7b')]['QueryTypes']['SELECT']});}})[_0x47a5('0x20')](function(_0x3d7371){if(!_0x3d7371['length']){throw new db['Sequelize'][(_0x47a5('0x60'))](_0x47a5('0x8a'),0xcc);}if(_0x5ccc89['output']===_0x47a5('0x8b')){return null;}var _0x269ff6=_['merge'](_0x5ccc89,{'name':_0x5ccc89[_0x47a5('0x8c')]||_0x5ccc89[_0x47a5('0x26')]||_0x2307da[_0x47a5('0x26')],'basename':_0x490e28,'savename':util[_0x47a5('0x6a')](_0x47a5('0x8d'),_0x5ccc89[_0x47a5('0x26')]||_0x2307da['name'],require('randomstring')['generate'](0x4),_0x5ccc89[_0x47a5('0x8e')]||_0x47a5('0x8f')),'reportId':_0x2307da['id'],'reportType':'default'});return db[_0x47a5('0x90')][_0x47a5('0x46')](_0x269ff6,{'raw':!![]});})[_0x47a5('0x20')](function(_0x1752ce){if(_0x2307da[_0x47a5('0x65')]==='cdr'){_0x2e0af1[_0x47a5('0x33')](_0x2307da['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5ccc89['startDate'],_0x5ccc89[_0x47a5('0x91')]);}else{_0x2e0af1['where'](_0x2307da[_0x47a5('0x65')]+_0x47a5('0x92'),_0x5ccc89[_0x47a5('0x93')],_0x5ccc89['endDate']);}if(_0x1752ce){logger[_0x47a5('0x94')](_0x47a5('0x95'),_0x2e0af1[_0x47a5('0x7a')]());require(_0x47a5('0x96'))[_0x47a5('0x97')](path['join'](__dirname,_0x47a5('0x98'),_0x1752ce[_0x47a5('0x8e')]),[_0x1752ce['id'],_0x2e0af1['toString'](),path[_0x47a5('0x4f')](__dirname,_0x47a5('0x99'),_0x1752ce[_0x47a5('0x9a')]),_0x490e28]);return _0x1752ce;}else{var _0x1f937a=squel[_0x47a5('0x64')]();_0x1f937a[_0x47a5('0x9b')]('('+_0x2e0af1['toString']()+')',_0x47a5('0x9c'));_0x1f937a[_0x47a5('0x3a')]('COUNT(*)',_0x47a5('0x18'));_0x2e0af1[_0x47a5('0x19')](_0x5ccc89[_0x47a5('0x19')]||_0x5d6916);_0x2e0af1[_0x47a5('0x32')](_0x5ccc89['offset']||0x0);return db['sequelize']['query'](_0x1f937a['toString'](),{'type':db[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x20')](function(_0x31f896){if(!_0x31f896[_0x47a5('0x44')]){_0x4a5ca1=0x0;}else{_0x4a5ca1=_0x31f896[0x0][_0x47a5('0x18')]||0x0;}return db[_0x47a5('0x7b')]['query'](_0x2e0af1[_0x47a5('0x7a')](),{'type':db[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});})['then'](function(_0x5ef411){return{'rows':_0x5ef411||[],'count':_0x4a5ca1};});}});}exports[_0x47a5('0x9d')]=function(_0x54ae9a,_0x4cb8e4){return runReport(_0x54ae9a[_0x47a5('0x43')],_0x54ae9a[_0x47a5('0x2b')],_0x54ae9a['options'])[_0x47a5('0x20')](respondWithResult(_0x4cb8e4,null))[_0x47a5('0x41')](handleError(_0x4cb8e4,null));};exports[_0x47a5('0x9e')]=runReport;exports['query']=function(_0x740bdf,_0xee23c7){var _0x48a491=0xa;var _0x1172fd=[_0x47a5('0x4f'),_0x47a5('0x50'),_0x47a5('0x7e'),_0x47a5('0x51')];var _0x475114={'SUM':'SUM(%s)','COUNT':_0x47a5('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x47a5('0x53'),'MIN':_0x47a5('0x54'),'AVG':_0x47a5('0x9f'),'GROUP_CONCAT':_0x47a5('0x81'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x47a5('0x82')};var _0x281674={'SEC_TO_TIME':_0x47a5('0x83'),'DATE':_0x47a5('0x84'),'HOUR':_0x47a5('0x56'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x85')};var _0x359fd8=function(_0x1b3e82){return!_[_0x47a5('0x86')]([_0x47a5('0x87'),_0x47a5('0x58'),'IS\x20EMPTY',_0x47a5('0x5a')],_0x1b3e82);};var _0x3ec683=function(_0x591bde){if(!_0x591bde||!_0x591bde[_0x47a5('0x5b')][_0x47a5('0x44')]){return'';}for(var _0x390123='(',_0x2ccf21=0x0;_0x2ccf21<_0x591bde[_0x47a5('0x5b')]['length'];_0x2ccf21+=0x1){_0x2ccf21>0x0&&(_0x390123+='\x20'+_0x591bde[_0x47a5('0x5c')]+'\x20');_0x390123+=_0x591bde[_0x47a5('0x5b')][_0x2ccf21][_0x47a5('0x5d')]?_0x3ec683(_0x591bde[_0x47a5('0x5b')][_0x2ccf21][_0x47a5('0x5d')]):_0x591bde[_0x47a5('0x5b')][_0x2ccf21][_0x47a5('0x3a')]+'\x20'+_0x591bde['rules'][_0x2ccf21]['condition']+(_0x359fd8(_0x591bde[_0x47a5('0x5b')][_0x2ccf21]['condition'])?'\x20'+_0x591bde[_0x47a5('0x5b')][_0x2ccf21]['value']:'');}return _0x390123+')';};var _0x12572f={'where':{'id':_0x740bdf[_0x47a5('0x43')]['id']}},_0x8b4354,_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557;_0x12572f=_[_0x47a5('0x36')]({},_0x12572f,_0x740bdf['options']);return db['AnalyticDefaultReport'][_0x47a5('0x45')](_0x12572f)[_0x47a5('0x20')](function(_0x987752){if(_0x987752){_0x8b4354=_0x987752;return _0x987752[_0x47a5('0x89')]();}return null;})[_0x47a5('0x20')](function(_0x402bba){if(_0x402bba){if(!_0x402bba[_0x47a5('0x44')]){throw new db[(_0x47a5('0x5f'))]['ValidationErrorItem'](_0x47a5('0x61'),0x193);}_0x134c1a=_0x402bba;return db['AnalyticMetric'][_0x47a5('0x3f')]({'raw':!![]});}return null;})[_0x47a5('0x20')](function(_0x5b0b0b){if(_0x5b0b0b){_0x2bc7ae=_['keyBy'](_0x5b0b0b,'id');var _0x229280;var _0x41d2da=squel['select']();_0x41d2da[_0x47a5('0x9b')](_0x8b4354[_0x47a5('0x65')]);for(var _0x29e3ee=0x0;_0x29e3ee<_0x134c1a[_0x47a5('0x44')];_0x29e3ee+=0x1){_0x229280=_0x134c1a[_0x29e3ee]['MetricId']?_0x2bc7ae[_0x134c1a[_0x29e3ee][_0x47a5('0x66')]]['metric']:_0x134c1a[_0x29e3ee]['field'];_0x229280=_0x134c1a[_0x29e3ee]['function']?_[_0x47a5('0x69')](_0x475114[_0x134c1a[_0x29e3ee]['function']],'%s',_0x229280):_0x229280;_0x229280=_0x134c1a[_0x29e3ee][_0x47a5('0x6a')]?_[_0x47a5('0x69')](_0x281674[_0x134c1a[_0x29e3ee][_0x47a5('0x6a')]],'%s',_0x229280):_0x229280;if(_0x134c1a[_0x29e3ee][_0x47a5('0x6b')]){_0x41d2da[_0x47a5('0x5d')](_0x229280);}_0x134c1a[_0x29e3ee][_0x47a5('0x6d')]&&_0x41d2da[_0x47a5('0x6c')](_0x229280,_0x134c1a[_0x29e3ee][_0x47a5('0x6d')]===_0x47a5('0x6e')?![]:!![]);_0x41d2da[_0x47a5('0x3a')](_0x229280,_0x134c1a[_0x29e3ee][_0x47a5('0x6f')]||_0x229280);}if(_0x8b4354[_0x47a5('0x70')]){_0x8b4354[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x8b4354[_0x47a5('0x70')]);for(var _0x5e17cb=0x0;_0x5e17cb<_0x8b4354[_0x47a5('0x70')][_0x47a5('0x44')];_0x5e17cb+=0x1){if(_0x8b4354[_0x47a5('0x70')][_0x5e17cb][_0x47a5('0x38')]&&_['includes'](_0x1172fd,_0x8b4354[_0x47a5('0x70')][_0x5e17cb]['type'])&&_0x8b4354[_0x47a5('0x70')][_0x5e17cb]['parentKey']&&_0x8b4354[_0x47a5('0x70')][_0x5e17cb][_0x47a5('0x73')]&&_0x8b4354[_0x47a5('0x70')][_0x5e17cb]['foreignKey']){_0x41d2da[_0x8b4354[_0x47a5('0x70')][_0x5e17cb][_0x47a5('0x38')]](_0x8b4354[_0x47a5('0x70')][_0x5e17cb]['foreignTable'],null,util['format'](_0x47a5('0x74'),_0x8b4354[_0x47a5('0x65')],_0x8b4354[_0x47a5('0x70')][_0x5e17cb][_0x47a5('0x75')],_0x8b4354[_0x47a5('0x70')][_0x5e17cb]['foreignTable'],_0x8b4354[_0x47a5('0x70')][_0x5e17cb]['foreignKey']));}}}if(_0x8b4354[_0x47a5('0x76')]){_0x8b4354[_0x47a5('0x76')]=JSON[_0x47a5('0x71')](_0x8b4354[_0x47a5('0x76')]);_0x41d2da['where'](_0x3ec683(_0x8b4354['conditions'][_0x47a5('0x5d')]));}_0x220557=_0x41d2da[_0x47a5('0x77')]();_0x41d2da[_0x47a5('0x19')](_0x48a491);_0x41d2da[_0x47a5('0x32')](0x0);logger[_0x47a5('0x78')](_0x47a5('0x79'),_0x41d2da[_0x47a5('0x7a')]());return db[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x41d2da['toString'](),{'type':db['sequelize'][_0x47a5('0x7c')]['SELECT']});}})[_0x47a5('0x20')](function(){return{'sql':_0x220557[_0x47a5('0x7a')]()};})[_0x47a5('0x20')](respondWithResult(_0xee23c7,null))['catch'](handleError(_0xee23c7,null));}; \ No newline at end of file +var _0xb10b=['get','DefaultReports','UserProfileResource','error','stack','name','send','index','AnalyticDefaultReport','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','field','options','count','includeAll','findAll','rows','show','params','keys','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','format','replace','orderBy','DESC','alias','joins','parse','type','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','group','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','condition','from','function','debug','No\x20available\x20data','output','fullPath','randomstring','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','ValidationErrorItem','groupBy','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xb10b,0x12a));var _0xbb10=function(_0x1269c6,_0x1c8942){_0x1269c6=_0x1269c6-0x0;var _0x4868c7=_0xb10b[_0x1269c6];return _0x4868c7;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xcc;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x18')](_0x44fb19);}return _0x5be7e0[_0xbb10('0x19')](_0x44fb19)[_0xbb10('0x1a')]();};}function respondWithResult(_0x147230,_0x58a612){_0x58a612=_0x58a612||0xc8;return function(_0x26e021){if(_0x26e021){return _0x147230[_0xbb10('0x19')](_0x58a612)[_0xbb10('0x1b')](_0x26e021);}};}function respondWithFilteredResult(_0x17fd46,_0x3df17b){return function(_0x2f2ebf){if(_0x2f2ebf){var _0x24a57b=_0x2f2ebf['count'],_0x36b5e8=_0x3df17b[_0xbb10('0x1c')],_0x3e26f4=_0x3df17b[_0xbb10('0x1c')]+_0x3df17b[_0xbb10('0x1d')],_0x2b184e;if(_0x3e26f4>=_0x24a57b){_0x3e26f4=_0x24a57b;_0x2b184e=0xc8;}else{_0x2b184e=0xce;}_0x17fd46[_0xbb10('0x19')](_0x2b184e);return _0x17fd46[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x36b5e8+'-'+_0x3e26f4+'/'+_0x24a57b)[_0xbb10('0x1b')](_0x2f2ebf);}return null;};}function patchUpdates(_0x30efc6){return function(_0xbf2906){try{jsonpatch[_0xbb10('0x20')](_0xbf2906,_0x30efc6,!![]);}catch(_0x48b6e9){return BPromise[_0xbb10('0x21')](_0x48b6e9);}return _0xbf2906[_0xbb10('0x22')]();};}function saveUpdates(_0x388fab,_0x109908){return function(_0xdf237d){if(_0xdf237d){return _0xdf237d[_0xbb10('0x23')](_0x388fab)['then'](function(_0x12f888){return _0x12f888;});}return null;};}function removeEntity(_0x12ef77,_0x50aea1){return function(_0x4c4b0d){if(_0x4c4b0d){return _0x4c4b0d[_0xbb10('0x24')]()[_0xbb10('0x25')](function(){var _0x2e911d=_0x4c4b0d[_0xbb10('0x26')]({'plain':!![]});var _0x445761=_0xbb10('0x27');return db[_0xbb10('0x28')][_0xbb10('0x24')]({'where':{'type':_0x445761,'resourceId':_0x2e911d['id']}})[_0xbb10('0x25')](function(){return _0x4c4b0d;});})[_0xbb10('0x25')](function(){_0x12ef77[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x29')](_0x4e25ff[_0xbb10('0x2a')]);if(_0x4e25ff[_0xbb10('0x2b')]){delete _0x4e25ff[_0xbb10('0x2b')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x2c')](_0x4e25ff);};}exports[_0xbb10('0x2d')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=db[_0xbb10('0x2e')]['rawAttributes'];_0xfc3595[_0xbb10('0x2f')]=_['keys'](_0x1d30aa);_0xfc3595[_0xbb10('0x30')]=_['keys'](_0x4aabb9[_0xbb10('0x30')]);_0xfc3595[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0xfc3595['model'],_0xfc3595['query']);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595['model'],qs[_0xbb10('0x34')](_0x4aabb9[_0xbb10('0x30')][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595['model'];if(!_0x4aabb9[_0xbb10('0x30')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x4aabb9[_0xbb10('0x30')][_0xbb10('0x1d')]);_0x21ac54[_0xbb10('0x1c')]=qs[_0xbb10('0x1c')](_0x4aabb9['query'][_0xbb10('0x1c')]);}_0x21ac54[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x4aabb9[_0xbb10('0x30')]['sort']);_0x21ac54[_0xbb10('0x3a')]=qs['filters'](_['pick'](_0x4aabb9[_0xbb10('0x30')],_0xfc3595[_0xbb10('0x31')]));if(_0x4aabb9[_0xbb10('0x30')][_0xbb10('0x3b')]){_0x21ac54[_0xbb10('0x3a')]=_[_0xbb10('0x3c')](_0x21ac54['where'],{'$or':_[_0xbb10('0x3d')](_0x1d30aa,function(_0x25d72f){if(_0x25d72f['type']['key']!=='VIRTUAL'){var _0x31bee3={};_0x31bee3[_0x25d72f[_0xbb10('0x3e')]]={'$like':'%'+_0x4aabb9[_0xbb10('0x30')]['filter']+'%'};return _0x31bee3;}})});}_0x21ac54=_[_0xbb10('0x3c')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x4345f3={'where':_0x21ac54['where']};return db[_0xbb10('0x2e')][_0xbb10('0x40')](_0x4345f3)[_0xbb10('0x25')](function(_0x446f49){_0x2e0249['count']=_0x446f49;if(_0x4aabb9[_0xbb10('0x30')][_0xbb10('0x41')]){_0x21ac54['include']=[{'all':!![]}];}return db[_0xbb10('0x2e')][_0xbb10('0x42')](_0x21ac54);})[_0xbb10('0x25')](function(_0x3a9934){_0x2e0249[_0xbb10('0x43')]=_0x3a9934;return _0x2e0249;})[_0xbb10('0x25')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x44')]=function(_0x1c7fae,_0x3e7b4c){var _0x3d3c41={'raw':!![],'where':{'id':_0x1c7fae[_0xbb10('0x45')]['id']}},_0x4943d9={};_0x4943d9[_0xbb10('0x2f')]=_[_0xbb10('0x46')](db[_0xbb10('0x2e')]['rawAttributes']);_0x4943d9[_0xbb10('0x30')]=_[_0xbb10('0x46')](_0x1c7fae['query']);_0x4943d9['filters']=_[_0xbb10('0x32')](_0x4943d9['model'],_0x4943d9[_0xbb10('0x30')]);_0x3d3c41[_0xbb10('0x33')]=_['intersection'](_0x4943d9[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x1c7fae[_0xbb10('0x30')]['fields']));_0x3d3c41[_0xbb10('0x33')]=_0x3d3c41[_0xbb10('0x33')][_0xbb10('0x35')]?_0x3d3c41[_0xbb10('0x33')]:_0x4943d9[_0xbb10('0x2f')];if(_0x1c7fae[_0xbb10('0x30')][_0xbb10('0x41')]){_0x3d3c41[_0xbb10('0x47')]=[{'all':!![]}];}_0x3d3c41=_[_0xbb10('0x3c')]({},_0x3d3c41,_0x1c7fae[_0xbb10('0x3f')]);return db[_0xbb10('0x2e')][_0xbb10('0x48')](_0x3d3c41)['then'](handleEntityNotFound(_0x3e7b4c,null))[_0xbb10('0x25')](respondWithResult(_0x3e7b4c,null))[_0xbb10('0x49')](handleError(_0x3e7b4c,null));};exports['create']=function(_0x14e1cb,_0x2f5027){return db[_0xbb10('0x2e')][_0xbb10('0x4a')](_0x14e1cb[_0xbb10('0x4b')],{})[_0xbb10('0x25')](function(_0x3e06b0){var _0x5be85e=_0x14e1cb['user'][_0xbb10('0x26')]({'plain':!![]});if(!_0x5be85e)throw new Error(_0xbb10('0x4c'));if(_0x5be85e[_0xbb10('0x4d')]==='user'){var _0x5f0c12=_0x3e06b0[_0xbb10('0x26')]({'plain':!![]});var _0x34cf4e=_0xbb10('0x4e');return db[_0xbb10('0x4f')][_0xbb10('0x48')]({'where':{'name':_0x34cf4e,'userProfileId':_0x5be85e[_0xbb10('0x50')]},'raw':!![]})[_0xbb10('0x25')](function(_0x460788){if(_0x460788&&_0x460788[_0xbb10('0x51')]===0x0){return db[_0xbb10('0x28')]['create']({'name':_0x5f0c12['name'],'resourceId':_0x5f0c12['id'],'type':_0xbb10('0x27'),'sectionId':_0x460788['id']},{})[_0xbb10('0x25')](function(){return _0x3e06b0;});}else{return _0x3e06b0;}})[_0xbb10('0x49')](function(_0xb014b0){logger[_0xbb10('0x29')](_0xbb10('0x52'),_0xb014b0);throw _0xb014b0;});}return _0x3e06b0;})[_0xbb10('0x25')](respondWithResult(_0x2f5027,0xc9))[_0xbb10('0x49')](handleError(_0x2f5027,null));};exports[_0xbb10('0x23')]=function(_0x1214f7,_0x19ca3e){if(_0x1214f7[_0xbb10('0x4b')]['id']){delete _0x1214f7[_0xbb10('0x4b')]['id'];}return db[_0xbb10('0x2e')][_0xbb10('0x48')]({'where':{'id':_0x1214f7['params']['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x19ca3e,null))['then'](saveUpdates(_0x1214f7[_0xbb10('0x4b')],null))[_0xbb10('0x25')](respondWithResult(_0x19ca3e,null))[_0xbb10('0x49')](handleError(_0x19ca3e,null));};exports[_0xbb10('0x24')]=function(_0x26e66e,_0x32d8e9){return db[_0xbb10('0x2e')][_0xbb10('0x48')]({'where':{'id':_0x26e66e[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x32d8e9,null))[_0xbb10('0x25')](removeEntity(_0x32d8e9,null))[_0xbb10('0x49')](handleError(_0x32d8e9,null));};exports[_0xbb10('0x53')]=function(_0x3d7e17,_0x4475e1){var _0x5de0cc=0xa;var _0x4571b6=[_0xbb10('0x54'),_0xbb10('0x55'),_0xbb10('0x56'),_0xbb10('0x57')];var _0x379d8c={'SUM':'SUM(%s)','COUNT':_0xbb10('0x58'),'COUNT DISTINCT':_0xbb10('0x59'),'MAX':_0xbb10('0x5a'),'MIN':_0xbb10('0x5b'),'AVG':_0xbb10('0x5c'),'GROUP_CONCAT':_0xbb10('0x5d'),'GROUP_CONCAT ASC':_0xbb10('0x5e'),'GROUP_CONCAT DESC':_0xbb10('0x5f')};var _0x205e01={'SEC_TO_TIME':_0xbb10('0x60'),'DATE':_0xbb10('0x61'),'HOUR':_0xbb10('0x62'),'ROUND':_0xbb10('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4ea1a6=function(_0x16272d){return!_[_0xbb10('0x64')]([_0xbb10('0x65'),_0xbb10('0x66'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x16272d);};var _0x79411e=function(_0xaf2cc3){if(!_0xaf2cc3||!_0xaf2cc3[_0xbb10('0x67')][_0xbb10('0x35')]){return'';}for(var _0x412f13='(',_0x3e9753=0x0;_0x3e9753<_0xaf2cc3[_0xbb10('0x67')]['length'];_0x3e9753+=0x1){_0x3e9753>0x0&&(_0x412f13+='\x20'+_0xaf2cc3[_0xbb10('0x68')]+'\x20');_0x412f13+=_0xaf2cc3[_0xbb10('0x67')][_0x3e9753]['group']?_0x79411e(_0xaf2cc3['rules'][_0x3e9753]['group']):_0xaf2cc3[_0xbb10('0x67')][_0x3e9753][_0xbb10('0x3e')]+'\x20'+_0xaf2cc3[_0xbb10('0x67')][_0x3e9753]['condition']+(_0x4ea1a6(_0xaf2cc3['rules'][_0x3e9753]['condition'])?'\x20'+_0xaf2cc3[_0xbb10('0x67')][_0x3e9753][_0xbb10('0x69')]:'');}return _0x412f13+')';};var _0x45167a={'where':{'id':_0x3d7e17[_0xbb10('0x45')]['id']}},_0x4e9fbd,_0xa1bbd9,_0x13131c,_0x5a6538,_0x4a560c;_0x45167a=_[_0xbb10('0x3c')]({},_0x45167a,_0x3d7e17[_0xbb10('0x3f')]);return db[_0xbb10('0x2e')]['find'](_0x45167a)[_0xbb10('0x25')](function(_0xec48ac){if(_0xec48ac){_0x4e9fbd=_0xec48ac;return _0xec48ac[_0xbb10('0x6a')]();}return null;})['then'](function(_0x402a01){if(_0x402a01){if(!_0x402a01[_0xbb10('0x35')]){throw new db[(_0xbb10('0x6b'))]['ValidationErrorItem'](_0xbb10('0x6c'),0x193);}_0xa1bbd9=_0x402a01;return db[_0xbb10('0x6d')][_0xbb10('0x42')]({'raw':!![]});}return null;})[_0xbb10('0x25')](function(_0x5e4a6e){if(_0x5e4a6e){_0x13131c=_[_0xbb10('0x6e')](_0x5e4a6e,'id');var _0x258e55;var _0x108e5b=squel[_0xbb10('0x6f')]();_0x108e5b['from'](_0x4e9fbd[_0xbb10('0x70')]);for(var _0x277fe7=0x0;_0x277fe7<_0xa1bbd9[_0xbb10('0x35')];_0x277fe7+=0x1){_0x258e55=_0xa1bbd9[_0x277fe7][_0xbb10('0x71')]?_0x13131c[_0xa1bbd9[_0x277fe7][_0xbb10('0x71')]][_0xbb10('0x72')]:_0xa1bbd9[_0x277fe7][_0xbb10('0x3e')];_0x258e55=_0xa1bbd9[_0x277fe7]['function']?_['replace'](_0x379d8c[_0xa1bbd9[_0x277fe7]['function']],'%s',_0x258e55):_0x258e55;_0x258e55=_0xa1bbd9[_0x277fe7][_0xbb10('0x73')]?_[_0xbb10('0x74')](_0x205e01[_0xa1bbd9[_0x277fe7][_0xbb10('0x73')]],'%s',_0x258e55):_0x258e55;if(_0xa1bbd9[_0x277fe7]['groupBy']){_0x108e5b['group'](_0x258e55);}_0xa1bbd9[_0x277fe7][_0xbb10('0x75')]&&_0x108e5b[_0xbb10('0x38')](_0x258e55,_0xa1bbd9[_0x277fe7][_0xbb10('0x75')]===_0xbb10('0x76')?![]:!![]);_0x108e5b[_0xbb10('0x3e')](_0x258e55,_0xa1bbd9[_0x277fe7][_0xbb10('0x77')]||_0x258e55);}if(_0x4e9fbd['joins']){_0x4e9fbd[_0xbb10('0x78')]=JSON[_0xbb10('0x79')](_0x4e9fbd[_0xbb10('0x78')]);for(var _0x14f16b=0x0;_0x14f16b<_0x4e9fbd[_0xbb10('0x78')]['length'];_0x14f16b+=0x1){if(_0x4e9fbd['joins'][_0x14f16b]['type']&&_[_0xbb10('0x64')](_0x4571b6,_0x4e9fbd[_0xbb10('0x78')][_0x14f16b][_0xbb10('0x7a')])&&_0x4e9fbd[_0xbb10('0x78')][_0x14f16b][_0xbb10('0x7b')]&&_0x4e9fbd[_0xbb10('0x78')][_0x14f16b]['foreignTable']&&_0x4e9fbd[_0xbb10('0x78')][_0x14f16b]['foreignKey']){_0x108e5b[_0x4e9fbd['joins'][_0x14f16b]['type']](_0x4e9fbd[_0xbb10('0x78')][_0x14f16b][_0xbb10('0x7c')],null,util[_0xbb10('0x73')](_0xbb10('0x7d'),_0x4e9fbd['table'],_0x4e9fbd[_0xbb10('0x78')][_0x14f16b]['parentKey'],_0x4e9fbd['joins'][_0x14f16b][_0xbb10('0x7c')],_0x4e9fbd[_0xbb10('0x78')][_0x14f16b][_0xbb10('0x7e')]));}}}if(_0x4e9fbd[_0xbb10('0x7f')]){_0x4e9fbd[_0xbb10('0x7f')]=JSON['parse'](_0x4e9fbd[_0xbb10('0x7f')]);_0x108e5b[_0xbb10('0x3a')](_0x79411e(_0x4e9fbd[_0xbb10('0x7f')][_0xbb10('0x80')]));}_0x4a560c=_0x108e5b[_0xbb10('0x81')]();_0x108e5b[_0xbb10('0x1d')](_0x5de0cc);_0x108e5b[_0xbb10('0x1c')](0x0);logger['debug'](_0xbb10('0x82'),_0x108e5b[_0xbb10('0x83')]());return db[_0xbb10('0x84')][_0xbb10('0x30')](_0x108e5b[_0xbb10('0x83')](),{'type':db[_0xbb10('0x84')][_0xbb10('0x85')][_0xbb10('0x86')]});}})['then'](respondWithResult(_0x4475e1,null))[_0xbb10('0x49')](handleError(_0x4475e1,null));};function runReport(_0x218690,_0x145baf,_0x56416a){var _0x4ee101=_0x145baf['name'];var _0x23286d=0xa;var _0x5a3c44=['join',_0xbb10('0x55'),_0xbb10('0x56'),_0xbb10('0x57')];var _0x12ed63={'SUM':_0xbb10('0x87'),'COUNT':_0xbb10('0x58'),'COUNT DISTINCT':_0xbb10('0x59'),'MAX':_0xbb10('0x5a'),'MIN':_0xbb10('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xbb10('0x5d'),'GROUP_CONCAT ASC':_0xbb10('0x5e'),'GROUP_CONCAT DESC':_0xbb10('0x5f')};var _0x35b811={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xbb10('0x62'),'ROUND':_0xbb10('0x63'),'UNIX_TIMESTAMP':_0xbb10('0x88')};var _0x32bb25=function(_0x5ee705){return!_[_0xbb10('0x64')]([_0xbb10('0x65'),_0xbb10('0x66'),_0xbb10('0x89'),_0xbb10('0x8a')],_0x5ee705);};var _0x517185=function(_0x5f0691){if(!_0x5f0691||!_0x5f0691[_0xbb10('0x67')][_0xbb10('0x35')]){return'';}for(var _0x22c030='(',_0x5239da=0x0;_0x5239da<_0x5f0691[_0xbb10('0x67')][_0xbb10('0x35')];_0x5239da+=0x1){_0x5239da>0x0&&(_0x22c030+='\x20'+_0x5f0691['operator']+'\x20');_0x22c030+=_0x5f0691['rules'][_0x5239da][_0xbb10('0x80')]?_0x517185(_0x5f0691[_0xbb10('0x67')][_0x5239da][_0xbb10('0x80')]):_0x5f0691['rules'][_0x5239da][_0xbb10('0x3e')]+'\x20'+_0x5f0691[_0xbb10('0x67')][_0x5239da][_0xbb10('0x8b')]+(_0x32bb25(_0x5f0691[_0xbb10('0x67')][_0x5239da][_0xbb10('0x8b')])?'\x20'+_0x5f0691[_0xbb10('0x67')][_0x5239da][_0xbb10('0x69')]:'');}return _0x22c030+')';};var _0x226363={'where':{'id':_0x218690['id']}},_0x3e6246,_0x479d51,_0x3367d4,_0x28cc46,_0x412fbf;_0x226363=_[_0xbb10('0x3c')]({},_0x226363,_0x56416a);return db[_0xbb10('0x2e')][_0xbb10('0x48')](_0x226363)[_0xbb10('0x25')](function(_0x305d52){if(_0x305d52){_0x3e6246=_0x305d52;return _0x305d52[_0xbb10('0x6a')]();}return null;})[_0xbb10('0x25')](function(_0x15e043){if(_0x15e043){if(!_0x15e043[_0xbb10('0x35')]){throw new db['Sequelize']['ValidationErrorItem'](_0xbb10('0x6c'),0x193);}_0x479d51=_0x15e043;return db[_0xbb10('0x6d')][_0xbb10('0x42')]({'raw':!![]});}return null;})[_0xbb10('0x25')](function(_0x238c7a){if(_0x238c7a){_0x3367d4=_['keyBy'](_0x238c7a,'id');var _0x2749a7;var _0x332fbe=squel[_0xbb10('0x6f')]();_0x332fbe[_0xbb10('0x8c')](_0x3e6246[_0xbb10('0x70')]);for(var _0x379d49=0x0;_0x379d49<_0x479d51['length'];_0x379d49+=0x1){_0x2749a7=_0x479d51[_0x379d49][_0xbb10('0x71')]?_0x3367d4[_0x479d51[_0x379d49][_0xbb10('0x71')]]['metric']:_0x479d51[_0x379d49][_0xbb10('0x3e')];_0x2749a7=_0x479d51[_0x379d49]['function']?_[_0xbb10('0x74')](_0x12ed63[_0x479d51[_0x379d49][_0xbb10('0x8d')]],'%s',_0x2749a7):_0x2749a7;_0x2749a7=_0x479d51[_0x379d49][_0xbb10('0x73')]?_[_0xbb10('0x74')](_0x35b811[_0x479d51[_0x379d49][_0xbb10('0x73')]],'%s',_0x2749a7):_0x2749a7;if(_0x479d51[_0x379d49]['groupBy']){_0x332fbe[_0xbb10('0x80')](_0x2749a7);}_0x479d51[_0x379d49]['orderBy']&&_0x332fbe[_0xbb10('0x38')](_0x2749a7,_0x479d51[_0x379d49][_0xbb10('0x75')]==='DESC'?![]:!![]);_0x332fbe['field'](_0x2749a7,_0x479d51[_0x379d49][_0xbb10('0x77')]||_0x2749a7);}if(_0x3e6246[_0xbb10('0x78')]){_0x3e6246[_0xbb10('0x78')]=JSON[_0xbb10('0x79')](_0x3e6246[_0xbb10('0x78')]);for(var _0x1cb22f=0x0;_0x1cb22f<_0x3e6246[_0xbb10('0x78')][_0xbb10('0x35')];_0x1cb22f+=0x1){if(_0x3e6246[_0xbb10('0x78')][_0x1cb22f][_0xbb10('0x7a')]&&_[_0xbb10('0x64')](_0x5a3c44,_0x3e6246['joins'][_0x1cb22f][_0xbb10('0x7a')])&&_0x3e6246[_0xbb10('0x78')][_0x1cb22f][_0xbb10('0x7b')]&&_0x3e6246[_0xbb10('0x78')][_0x1cb22f][_0xbb10('0x7c')]&&_0x3e6246[_0xbb10('0x78')][_0x1cb22f][_0xbb10('0x7e')]){_0x332fbe[_0x3e6246[_0xbb10('0x78')][_0x1cb22f][_0xbb10('0x7a')]](_0x3e6246[_0xbb10('0x78')][_0x1cb22f][_0xbb10('0x7c')],null,util[_0xbb10('0x73')]('%s.%s\x20=\x20%s.%s',_0x3e6246[_0xbb10('0x70')],_0x3e6246['joins'][_0x1cb22f][_0xbb10('0x7b')],_0x3e6246[_0xbb10('0x78')][_0x1cb22f][_0xbb10('0x7c')],_0x3e6246[_0xbb10('0x78')][_0x1cb22f][_0xbb10('0x7e')]));}}}if(_0x3e6246['conditions']){_0x3e6246[_0xbb10('0x7f')]=JSON[_0xbb10('0x79')](_0x3e6246[_0xbb10('0x7f')]);_0x332fbe[_0xbb10('0x3a')](_0x517185(_0x3e6246[_0xbb10('0x7f')][_0xbb10('0x80')]));}_0x412fbf=_0x332fbe['clone']();_0x332fbe['limit'](_0x23286d);_0x332fbe[_0xbb10('0x1c')](0x0);logger[_0xbb10('0x8e')](_0xbb10('0x82'),_0x332fbe['toString']());return db[_0xbb10('0x84')][_0xbb10('0x30')](_0x332fbe['toString'](),{'type':db[_0xbb10('0x84')][_0xbb10('0x85')]['SELECT']});}})[_0xbb10('0x25')](function(_0x4d7bca){if(!_0x4d7bca[_0xbb10('0x35')]){throw new db[(_0xbb10('0x6b'))]['ValidationErrorItem'](_0xbb10('0x8f'),0xcc);}if(_0x145baf[_0xbb10('0x90')]==='web'){return null;}var _0x5dae56=_[_0xbb10('0x3c')](_0x145baf,{'name':_0x145baf[_0xbb10('0x91')]||_0x145baf[_0xbb10('0x2b')]||_0x3e6246[_0xbb10('0x2b')],'basename':_0x4ee101,'savename':util[_0xbb10('0x73')]('%s-%s.%s',_0x145baf[_0xbb10('0x2b')]||_0x3e6246[_0xbb10('0x2b')],require(_0xbb10('0x92'))['generate'](0x4),_0x145baf[_0xbb10('0x90')]||_0xbb10('0x93')),'reportId':_0x3e6246['id'],'reportType':_0xbb10('0x94')});return db[_0xbb10('0x95')][_0xbb10('0x4a')](_0x5dae56,{'raw':!![]});})[_0xbb10('0x25')](function(_0x1f55d3){if(_0x3e6246[_0xbb10('0x70')]===_0xbb10('0x96')){_0x412fbf['where'](_0x3e6246['table']+_0xbb10('0x97'),_0x145baf[_0xbb10('0x98')],_0x145baf[_0xbb10('0x99')]);}else{_0x412fbf[_0xbb10('0x3a')](_0x3e6246[_0xbb10('0x70')]+_0xbb10('0x9a'),_0x145baf[_0xbb10('0x98')],_0x145baf[_0xbb10('0x99')]);}if(_0x1f55d3){logger[_0xbb10('0x9b')](_0xbb10('0x9c'),_0x412fbf[_0xbb10('0x83')]());require(_0xbb10('0x9d'))[_0xbb10('0x9e')](path['join'](__dirname,_0xbb10('0x9f'),_0x1f55d3[_0xbb10('0x90')]),[_0x1f55d3['id'],_0x412fbf[_0xbb10('0x83')](),path[_0xbb10('0x54')](__dirname,_0xbb10('0xa0'),_0x1f55d3[_0xbb10('0xa1')]),_0x4ee101]);return _0x1f55d3;}else{var _0x4258fc=squel[_0xbb10('0x6f')]();_0x4258fc[_0xbb10('0x8c')]('('+_0x412fbf[_0xbb10('0x83')]()+')',_0xbb10('0xa2'));_0x4258fc['field'](_0xbb10('0xa3'),'count');_0x412fbf[_0xbb10('0x1d')](_0x145baf[_0xbb10('0x1d')]||_0x23286d);_0x412fbf[_0xbb10('0x1c')](_0x145baf[_0xbb10('0x1c')]||0x0);return db[_0xbb10('0x84')][_0xbb10('0x30')](_0x4258fc['toString'](),{'type':db[_0xbb10('0x84')]['QueryTypes'][_0xbb10('0x86')]})[_0xbb10('0x25')](function(_0xda122){if(!_0xda122[_0xbb10('0x35')]){_0x28cc46=0x0;}else{_0x28cc46=_0xda122[0x0][_0xbb10('0x40')]||0x0;}return db[_0xbb10('0x84')][_0xbb10('0x30')](_0x412fbf[_0xbb10('0x83')](),{'type':db[_0xbb10('0x84')][_0xbb10('0x85')][_0xbb10('0x86')]});})[_0xbb10('0x25')](function(_0x589565){return{'rows':_0x589565||[],'count':_0x28cc46};});}});}exports[_0xbb10('0xa4')]=function(_0x516520,_0xe70161){return runReport(_0x516520[_0xbb10('0x45')],_0x516520[_0xbb10('0x30')],_0x516520[_0xbb10('0x3f')])[_0xbb10('0x25')](respondWithResult(_0xe70161,null))[_0xbb10('0x49')](handleError(_0xe70161,null));};exports[_0xbb10('0xa5')]=runReport;exports['query']=function(_0x350657,_0x5ca9a0){var _0x51063a=0xa;var _0x1513e0=[_0xbb10('0x54'),_0xbb10('0x55'),_0xbb10('0x56'),_0xbb10('0x57')];var _0x16b8c1={'SUM':'SUM(%s)','COUNT':_0xbb10('0x58'),'COUNT DISTINCT':_0xbb10('0x59'),'MAX':_0xbb10('0x5a'),'MIN':_0xbb10('0x5b'),'AVG':_0xbb10('0x5c'),'GROUP_CONCAT':_0xbb10('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xbb10('0x5f')};var _0x4093a4={'SEC_TO_TIME':_0xbb10('0x60'),'DATE':_0xbb10('0x61'),'HOUR':_0xbb10('0x62'),'ROUND':_0xbb10('0x63'),'UNIX_TIMESTAMP':_0xbb10('0x88')};var _0x5e405b=function(_0x33a43e){return!_['includes']([_0xbb10('0x65'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xbb10('0x8a')],_0x33a43e);};var _0x225064=function(_0x24edcb){if(!_0x24edcb||!_0x24edcb[_0xbb10('0x67')][_0xbb10('0x35')]){return'';}for(var _0x4b3fc7='(',_0xa42b80=0x0;_0xa42b80<_0x24edcb['rules']['length'];_0xa42b80+=0x1){_0xa42b80>0x0&&(_0x4b3fc7+='\x20'+_0x24edcb['operator']+'\x20');_0x4b3fc7+=_0x24edcb[_0xbb10('0x67')][_0xa42b80][_0xbb10('0x80')]?_0x225064(_0x24edcb[_0xbb10('0x67')][_0xa42b80][_0xbb10('0x80')]):_0x24edcb[_0xbb10('0x67')][_0xa42b80]['field']+'\x20'+_0x24edcb[_0xbb10('0x67')][_0xa42b80][_0xbb10('0x8b')]+(_0x5e405b(_0x24edcb[_0xbb10('0x67')][_0xa42b80][_0xbb10('0x8b')])?'\x20'+_0x24edcb[_0xbb10('0x67')][_0xa42b80][_0xbb10('0x69')]:'');}return _0x4b3fc7+')';};var _0x2ef6ee={'where':{'id':_0x350657[_0xbb10('0x45')]['id']}},_0x485c1a,_0x4c95c2,_0x584a62,_0x386eac,_0x1581ef;_0x2ef6ee=_[_0xbb10('0x3c')]({},_0x2ef6ee,_0x350657[_0xbb10('0x3f')]);return db[_0xbb10('0x2e')][_0xbb10('0x48')](_0x2ef6ee)[_0xbb10('0x25')](function(_0x340d70){if(_0x340d70){_0x485c1a=_0x340d70;return _0x340d70[_0xbb10('0x6a')]();}return null;})['then'](function(_0x58295f){if(_0x58295f){if(!_0x58295f['length']){throw new db[(_0xbb10('0x6b'))][(_0xbb10('0xa6'))](_0xbb10('0x6c'),0x193);}_0x4c95c2=_0x58295f;return db['AnalyticMetric'][_0xbb10('0x42')]({'raw':!![]});}return null;})[_0xbb10('0x25')](function(_0x2c638d){if(_0x2c638d){_0x584a62=_[_0xbb10('0x6e')](_0x2c638d,'id');var _0x2a6589;var _0x11279d=squel['select']();_0x11279d['from'](_0x485c1a[_0xbb10('0x70')]);for(var _0x48889b=0x0;_0x48889b<_0x4c95c2[_0xbb10('0x35')];_0x48889b+=0x1){_0x2a6589=_0x4c95c2[_0x48889b][_0xbb10('0x71')]?_0x584a62[_0x4c95c2[_0x48889b][_0xbb10('0x71')]][_0xbb10('0x72')]:_0x4c95c2[_0x48889b][_0xbb10('0x3e')];_0x2a6589=_0x4c95c2[_0x48889b][_0xbb10('0x8d')]?_[_0xbb10('0x74')](_0x16b8c1[_0x4c95c2[_0x48889b][_0xbb10('0x8d')]],'%s',_0x2a6589):_0x2a6589;_0x2a6589=_0x4c95c2[_0x48889b][_0xbb10('0x73')]?_[_0xbb10('0x74')](_0x4093a4[_0x4c95c2[_0x48889b]['format']],'%s',_0x2a6589):_0x2a6589;if(_0x4c95c2[_0x48889b][_0xbb10('0xa7')]){_0x11279d['group'](_0x2a6589);}_0x4c95c2[_0x48889b][_0xbb10('0x75')]&&_0x11279d['order'](_0x2a6589,_0x4c95c2[_0x48889b][_0xbb10('0x75')]===_0xbb10('0x76')?![]:!![]);_0x11279d[_0xbb10('0x3e')](_0x2a6589,_0x4c95c2[_0x48889b][_0xbb10('0x77')]||_0x2a6589);}if(_0x485c1a['joins']){_0x485c1a[_0xbb10('0x78')]=JSON['parse'](_0x485c1a[_0xbb10('0x78')]);for(var _0x1b6b9f=0x0;_0x1b6b9f<_0x485c1a[_0xbb10('0x78')]['length'];_0x1b6b9f+=0x1){if(_0x485c1a[_0xbb10('0x78')][_0x1b6b9f][_0xbb10('0x7a')]&&_[_0xbb10('0x64')](_0x1513e0,_0x485c1a[_0xbb10('0x78')][_0x1b6b9f][_0xbb10('0x7a')])&&_0x485c1a[_0xbb10('0x78')][_0x1b6b9f]['parentKey']&&_0x485c1a['joins'][_0x1b6b9f]['foreignTable']&&_0x485c1a[_0xbb10('0x78')][_0x1b6b9f]['foreignKey']){_0x11279d[_0x485c1a[_0xbb10('0x78')][_0x1b6b9f]['type']](_0x485c1a[_0xbb10('0x78')][_0x1b6b9f][_0xbb10('0x7c')],null,util[_0xbb10('0x73')]('%s.%s\x20=\x20%s.%s',_0x485c1a['table'],_0x485c1a[_0xbb10('0x78')][_0x1b6b9f][_0xbb10('0x7b')],_0x485c1a[_0xbb10('0x78')][_0x1b6b9f]['foreignTable'],_0x485c1a[_0xbb10('0x78')][_0x1b6b9f][_0xbb10('0x7e')]));}}}if(_0x485c1a[_0xbb10('0x7f')]){_0x485c1a['conditions']=JSON['parse'](_0x485c1a['conditions']);_0x11279d[_0xbb10('0x3a')](_0x225064(_0x485c1a['conditions'][_0xbb10('0x80')]));}_0x1581ef=_0x11279d[_0xbb10('0x81')]();_0x11279d[_0xbb10('0x1d')](_0x51063a);_0x11279d[_0xbb10('0x1c')](0x0);logger[_0xbb10('0x8e')](_0xbb10('0x82'),_0x11279d[_0xbb10('0x83')]());return db[_0xbb10('0x84')][_0xbb10('0x30')](_0x11279d[_0xbb10('0x83')](),{'type':db[_0xbb10('0x84')]['QueryTypes'][_0xbb10('0x86')]});}})[_0xbb10('0x25')](function(){return{'sql':_0x1581ef['toString']()};})[_0xbb10('0x25')](respondWithResult(_0x5ca9a0,null))['catch'](handleError(_0x5ca9a0,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 34602de..1c110ef 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 _0x8ae8=['request-promise','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport','lodash','../../config/logger','api','moment','bluebird'];(function(_0xb68695,_0x1881a4){var _0x15a817=function(_0x4d04d6){while(--_0x4d04d6){_0xb68695['push'](_0xb68695['shift']());}};_0x15a817(++_0x1881a4);}(_0x8ae8,0x163));var _0x88ae=function(_0x527733,_0x16051c){_0x527733=_0x527733-0x0;var _0x5400ba=_0x8ae8[_0x527733];return _0x5400ba;};'use strict';var _=require(_0x88ae('0x0'));var util=require('util');var logger=require(_0x88ae('0x1'))(_0x88ae('0x2'));var moment=require(_0x88ae('0x3'));var BPromise=require(_0x88ae('0x4'));var rp=require(_0x88ae('0x5'));var fs=require('fs');var path=require(_0x88ae('0x6'));var rimraf=require(_0x88ae('0x7'));var config=require(_0x88ae('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0x88ae('0x9')]=function(_0x2874cd,_0x4037fc){return _0x2874cd[_0x88ae('0xa')](_0x88ae('0xb'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb570=['path','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','api','bluebird'];(function(_0x5cbd54,_0x15f315){var _0x579f70=function(_0x164558){while(--_0x164558){_0x5cbd54['push'](_0x5cbd54['shift']());}};_0x579f70(++_0x15f315);}(_0xb570,0x133));var _0x0b57=function(_0x24f4ad,_0x17bc90){_0x24f4ad=_0x24f4ad-0x0;var _0x233571=_0xb570[_0x24f4ad];return _0x233571;};'use strict';var _=require(_0x0b57('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0b57('0x1'));var moment=require('moment');var BPromise=require(_0x0b57('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b57('0x3'));var rimraf=require('rimraf');var config=require(_0x0b57('0x4'));var attributes=require(_0x0b57('0x5'));module[_0x0b57('0x6')]=function(_0x5ada44,_0x4faa5d){return _0x5ada44[_0x0b57('0x7')](_0x0b57('0x8'),attributes,{'tableName':_0x0b57('0x9'),'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 d2a3c7b..92dc33a 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 _0xdfe9=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0xdfe9,0xc3));var _0x9dfe=function(_0x564e38,_0x450135){_0x564e38=_0x564e38-0x0;var _0x4c3384=_0xdfe9[_0x564e38];return _0x4c3384;};'use strict';var _=require(_0x9dfe('0x0'));var util=require('util');var moment=require(_0x9dfe('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9dfe('0x2'));var db=require(_0x9dfe('0x3'))['db'];var utils=require(_0x9dfe('0x4'));var logger=require(_0x9dfe('0x5'))(_0x9dfe('0x6'));var config=require(_0x9dfe('0x7'));var jayson=require(_0x9dfe('0x8'));var client=jayson[_0x9dfe('0x9')][_0x9dfe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3471f0,_0x13b6f8,_0x5e0faf){return new BPromise(function(_0x377c1e,_0xa21ae3){return client[_0x9dfe('0xb')](_0x3471f0,_0x5e0faf)[_0x9dfe('0xc')](function(_0xcd9ecb){logger[_0x9dfe('0xd')](_0x9dfe('0xe'),_0x13b6f8,_0x9dfe('0xf'));logger['debug'](_0x9dfe('0x10'),_0x13b6f8,_0x9dfe('0xf'),JSON[_0x9dfe('0x11')](_0xcd9ecb));if(_0xcd9ecb[_0x9dfe('0x12')]){if(_0xcd9ecb['error']['code']===0x1f4){logger[_0x9dfe('0x12')](_0x9dfe('0xe'),_0x13b6f8,_0xcd9ecb['error']['message']);return _0xa21ae3(_0xcd9ecb['error'][_0x9dfe('0x13')]);}logger[_0x9dfe('0x12')](_0x9dfe('0xe'),_0x13b6f8,_0xcd9ecb[_0x9dfe('0x12')][_0x9dfe('0x13')]);return _0x377c1e(_0xcd9ecb[_0x9dfe('0x12')][_0x9dfe('0x13')]);}else{logger[_0x9dfe('0xd')](_0x9dfe('0xe'),_0x13b6f8,'request\x20sent');_0x377c1e(_0xcd9ecb['result'][_0x9dfe('0x13')]);}})['catch'](function(_0x1a7cbe){logger[_0x9dfe('0x12')](_0x9dfe('0xe'),_0x13b6f8,_0x1a7cbe);_0xa21ae3(_0x1a7cbe);});});} \ No newline at end of file +var _0xe1e3=['message','info','result','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x4fa851,_0x8a5a96){var _0x443e6a=function(_0x376992){while(--_0x376992){_0x4fa851['push'](_0x4fa851['shift']());}};_0x443e6a(++_0x8a5a96);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x4c596e,_0x4e580e){_0x4c596e=_0x4c596e-0x0;var _0x1e128a=_0xe1e3[_0x4c596e];return _0x1e128a;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var moment=require('moment');var BPromise=require(_0x3e1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e1e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e1e('0x4'))(_0x3e1e('0x5'));var config=require(_0x3e1e('0x6'));var jayson=require(_0x3e1e('0x7'));var client=jayson[_0x3e1e('0x8')][_0x3e1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55cfba,_0x1574e5,_0x13926d){return new BPromise(function(_0x2f0e12,_0xa67e35){return client[_0x3e1e('0xa')](_0x55cfba,_0x13926d)[_0x3e1e('0xb')](function(_0x5e7d1f){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1574e5,_0x3e1e('0xc'));logger['debug'](_0x3e1e('0xd'),_0x1574e5,_0x3e1e('0xc'),JSON[_0x3e1e('0xe')](_0x5e7d1f));if(_0x5e7d1f['error']){if(_0x5e7d1f[_0x3e1e('0xf')]['code']===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1574e5,_0x5e7d1f['error']['message']);return _0xa67e35(_0x5e7d1f[_0x3e1e('0xf')]['message']);}logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x5e7d1f[_0x3e1e('0xf')][_0x3e1e('0x11')]);return _0x2f0e12(_0x5e7d1f['error']['message']);}else{logger[_0x3e1e('0x12')](_0x3e1e('0x10'),_0x1574e5,'request\x20sent');_0x2f0e12(_0x5e7d1f[_0x3e1e('0x13')][_0x3e1e('0x11')]);}})['catch'](function(_0x11c07f){logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x11c07f);_0xa67e35(_0x11c07f);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 789047b..9e2ceb3 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 _0x0a73=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','preview','/:id/run','run','/:id/query','post','create','put','update','delete','destroy','exports'];(function(_0x3e78e4,_0x1b4d1d){var _0x31cd37=function(_0x331cab){while(--_0x331cab){_0x3e78e4['push'](_0x3e78e4['shift']());}};_0x31cd37(++_0x1b4d1d);}(_0x0a73,0x1c8));var _0x30a7=function(_0x21b359,_0x4dc80e){_0x21b359=_0x21b359-0x0;var _0x57b8e7=_0x0a73[_0x21b359];return _0x57b8e7;};'use strict';var multer=require(_0x30a7('0x0'));var util=require(_0x30a7('0x1'));var path=require('path');var timeout=require(_0x30a7('0x2'));var express=require(_0x30a7('0x3'));var router=express[_0x30a7('0x4')]();var auth=require(_0x30a7('0x5'));var interaction=require(_0x30a7('0x6'));var config=require(_0x30a7('0x7'));var controller=require(_0x30a7('0x8'));router['get']('/',auth[_0x30a7('0x9')](),controller[_0x30a7('0xa')]);router[_0x30a7('0xb')](_0x30a7('0xc'),auth[_0x30a7('0x9')](),controller['show']);router[_0x30a7('0xb')]('/:id/preview',auth['isAuthenticated'](),controller[_0x30a7('0xd')]);router[_0x30a7('0xb')](_0x30a7('0xe'),auth[_0x30a7('0x9')](),controller[_0x30a7('0xf')]);router['get'](_0x30a7('0x10'),auth[_0x30a7('0x9')](),controller['query']);router[_0x30a7('0x11')]('/',auth[_0x30a7('0x9')](),controller[_0x30a7('0x12')]);router[_0x30a7('0x13')]('/:id',auth[_0x30a7('0x9')](),controller[_0x30a7('0x14')]);router[_0x30a7('0x15')](_0x30a7('0xc'),auth[_0x30a7('0x9')](),controller[_0x30a7('0x16')]);module[_0x30a7('0x17')]=router; \ No newline at end of file +var _0xf037=['../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','query','post','create','put','update','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xf037,0x1c7));var _0x7f03=function(_0x45ae0d,_0x1ea3b9){_0x45ae0d=_0x45ae0d-0x0;var _0x371826=_0xf037[_0x45ae0d];return _0x371826;};'use strict';var multer=require('multer');var util=require(_0x7f03('0x0'));var path=require(_0x7f03('0x1'));var timeout=require(_0x7f03('0x2'));var express=require(_0x7f03('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7f03('0x4'));var config=require(_0x7f03('0x5'));var controller=require(_0x7f03('0x6'));router[_0x7f03('0x7')]('/',auth[_0x7f03('0x8')](),controller[_0x7f03('0x9')]);router[_0x7f03('0x7')](_0x7f03('0xa'),auth[_0x7f03('0x8')](),controller[_0x7f03('0xb')]);router['get'](_0x7f03('0xc'),auth['isAuthenticated'](),controller[_0x7f03('0xd')]);router['get'](_0x7f03('0xe'),auth[_0x7f03('0x8')](),controller[_0x7f03('0xf')]);router[_0x7f03('0x7')]('/:id/query',auth[_0x7f03('0x8')](),controller[_0x7f03('0x10')]);router[_0x7f03('0x11')]('/',auth[_0x7f03('0x8')](),controller[_0x7f03('0x12')]);router[_0x7f03('0x13')](_0x7f03('0xa'),auth[_0x7f03('0x8')](),controller[_0x7f03('0x14')]);router['delete'](_0x7f03('0xa'),auth['isAuthenticated'](),controller[_0x7f03('0x15')]);module[_0x7f03('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 04a5017..4509f4e 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 _0xd8f6=['STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','sequelize','moment','exports'];(function(_0x577a25,_0x509340){var _0x169de2=function(_0x5da9c1){while(--_0x5da9c1){_0x577a25['push'](_0x577a25['shift']());}};_0x169de2(++_0x509340);}(_0xd8f6,0x11d));var _0x6d8f=function(_0xe8d324,_0x5d3ad7){_0xe8d324=_0xe8d324-0x0;var _0x4239d5=_0xd8f6[_0xe8d324];return _0x4239d5;};'use strict';var Sequelize=require(_0x6d8f('0x0'));var moment=require(_0x6d8f('0x1'));module[_0x6d8f('0x2')]={'name':{'type':Sequelize[_0x6d8f('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x6d8f('0x4')](_0x6d8f('0x5'),_0x6d8f('0x6'),_0x6d8f('0x7')),'allowNull':![],'defaultValue':_0x6d8f('0x5')},'savename':{'type':Sequelize[_0x6d8f('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x6d8f('0x8')]},'endDate':{'type':Sequelize[_0x6d8f('0x8')]},'status':{'type':Sequelize[_0x6d8f('0x3')],'defaultValue':_0x6d8f('0x9')},'type':{'type':Sequelize['ENUM'](_0x6d8f('0xa'),_0x6d8f('0xb')),'allowNull':![],'defaultValue':_0x6d8f('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x6d8f('0x3')]}}; \ No newline at end of file +var _0xaecb=['manual','scheduled','INTEGER','UNSIGNED','exports','STRING','ENUM','csv','pdf','DATE','Loading'];(function(_0x5e3701,_0x596265){var _0x345dcf=function(_0x5eb12a){while(--_0x5eb12a){_0x5e3701['push'](_0x5e3701['shift']());}};_0x345dcf(++_0x596265);}(_0xaecb,0x14e));var _0xbaec=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xaecb[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xbaec('0x0')]={'name':{'type':Sequelize[_0xbaec('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xbaec('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0xbaec('0x2')](_0xbaec('0x3'),_0xbaec('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0xbaec('0x3')},'savename':{'type':Sequelize[_0xbaec('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0xbaec('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xbaec('0x1')],'defaultValue':_0xbaec('0x6')},'type':{'type':Sequelize[_0xbaec('0x2')](_0xbaec('0x7'),_0xbaec('0x8')),'allowNull':![],'defaultValue':_0xbaec('0x7')},'reportId':{'type':Sequelize[_0xbaec('0x9')](0xb)[_0xbaec('0xa')]},'reportType':{'type':Sequelize[_0xbaec('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 5c66b65..2fc571a 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 _0x7aa9=['../../config/logger','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','then','ExtractedReports','UserProfileResource','error','stack','name','send','index','AnalyticExtractedReport','rawAttributes','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','count','includeAll','rows','catch','show','params','keys','length','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','output','existsSync','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','format','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0xfac76e,_0x2fc8b9){var _0x1f8179=function(_0x42c52d){while(--_0x42c52d){_0xfac76e['push'](_0xfac76e['shift']());}};_0x1f8179(++_0x2fc8b9);}(_0x7aa9,0x105));var _0x97aa=function(_0x1ad07b,_0x551d55){_0x1ad07b=_0x1ad07b-0x0;var _0x2c447f=_0x7aa9[_0x1ad07b];return _0x2c447f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x97aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x97aa('0x1'));var jsonpatch=require(_0x97aa('0x2'));var rp=require(_0x97aa('0x3'));var moment=require(_0x97aa('0x4'));var BPromise=require(_0x97aa('0x5'));var Mustache=require(_0x97aa('0x6'));var util=require(_0x97aa('0x7'));var path=require(_0x97aa('0x8'));var sox=require(_0x97aa('0x9'));var csv=require(_0x97aa('0xa'));var ejs=require(_0x97aa('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x97aa('0xc'));var jsforce=require(_0x97aa('0xd'));var deskjs=require(_0x97aa('0xe'));var toCsv=require('to-csv');var querystring=require(_0x97aa('0xf'));var Papa=require(_0x97aa('0x10'));var Redis=require(_0x97aa('0x11'));var authService=require(_0x97aa('0x12'));var qs=require(_0x97aa('0x13'));var hardwareService=require(_0x97aa('0x14'));var logger=require(_0x97aa('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x97aa('0x16'))['db'];function respondWithStatusCode(_0x4a91e4,_0x55849b){_0x55849b=_0x55849b||0xcc;return function(_0x200dbf){if(_0x200dbf){return _0x4a91e4[_0x97aa('0x17')](_0x55849b);}return _0x4a91e4[_0x97aa('0x18')](_0x55849b)[_0x97aa('0x19')]();};}function respondWithResult(_0x279c54,_0x2148b5){_0x2148b5=_0x2148b5||0xc8;return function(_0x50ca89){if(_0x50ca89){return _0x279c54[_0x97aa('0x18')](_0x2148b5)[_0x97aa('0x1a')](_0x50ca89);}};}function respondWithFilteredResult(_0x17df03,_0x5cc400){return function(_0x3db1f8){if(_0x3db1f8){var _0x37412f=_0x3db1f8['count'],_0x3b2eaa=_0x5cc400[_0x97aa('0x1b')],_0x1ea833=_0x5cc400[_0x97aa('0x1b')]+_0x5cc400[_0x97aa('0x1c')],_0x4774f0;if(_0x1ea833>=_0x37412f){_0x1ea833=_0x37412f;_0x4774f0=0xc8;}else{_0x4774f0=0xce;}_0x17df03['status'](_0x4774f0);return _0x17df03[_0x97aa('0x1d')](_0x97aa('0x1e'),_0x3b2eaa+'-'+_0x1ea833+'/'+_0x37412f)[_0x97aa('0x1a')](_0x3db1f8);}return null;};}function patchUpdates(_0x4d70f6){return function(_0x24905c){try{jsonpatch[_0x97aa('0x1f')](_0x24905c,_0x4d70f6,!![]);}catch(_0x1ece3e){return BPromise['reject'](_0x1ece3e);}return _0x24905c[_0x97aa('0x20')]();};}function saveUpdates(_0x22a9ff,_0x3820cb){return function(_0x2ac7cd){if(_0x2ac7cd){return _0x2ac7cd[_0x97aa('0x21')](_0x22a9ff)['then'](function(_0x44609c){return _0x44609c;});}return null;};}function removeEntity(_0xa3f670,_0x228030){return function(_0x4416c1){if(_0x4416c1){return _0x4416c1[_0x97aa('0x22')]()[_0x97aa('0x23')](function(){var _0x2275c9=_0x4416c1['get']({'plain':!![]});var _0x50e1cb=_0x97aa('0x24');return db[_0x97aa('0x25')][_0x97aa('0x22')]({'where':{'type':_0x50e1cb,'resourceId':_0x2275c9['id']}})[_0x97aa('0x23')](function(){return _0x4416c1;});})[_0x97aa('0x23')](function(){_0xa3f670[_0x97aa('0x18')](0xcc)[_0x97aa('0x19')]();});}};}function handleEntityNotFound(_0x2955e5,_0x19d0de){return function(_0x397a36){if(!_0x397a36){_0x2955e5[_0x97aa('0x17')](0x194);}return _0x397a36;};}function handleError(_0x40f384,_0x4720c0){_0x4720c0=_0x4720c0||0x1f4;return function(_0x4751fb){logger[_0x97aa('0x26')](_0x4751fb[_0x97aa('0x27')]);if(_0x4751fb['name']){delete _0x4751fb[_0x97aa('0x28')];}_0x40f384[_0x97aa('0x18')](_0x4720c0)[_0x97aa('0x29')](_0x4751fb);};}exports[_0x97aa('0x2a')]=function(_0x3f7af4,_0x4129f2){var _0x54b723={},_0x3b5014={},_0x5555ef={'count':0x0,'rows':[]};var _0x5c797f=db[_0x97aa('0x2b')][_0x97aa('0x2c')];_0x3b5014[_0x97aa('0x2d')]=_['keys'](_0x5c797f);_0x3b5014[_0x97aa('0x2e')]=_['keys'](_0x3f7af4[_0x97aa('0x2e')]);_0x3b5014[_0x97aa('0x2f')]=_[_0x97aa('0x30')](_0x3b5014[_0x97aa('0x2d')],_0x3b5014[_0x97aa('0x2e')]);_0x54b723[_0x97aa('0x31')]=_[_0x97aa('0x30')](_0x3b5014[_0x97aa('0x2d')],qs[_0x97aa('0x32')](_0x3f7af4['query'][_0x97aa('0x32')]));_0x54b723[_0x97aa('0x31')]=_0x54b723[_0x97aa('0x31')]['length']?_0x54b723[_0x97aa('0x31')]:_0x3b5014[_0x97aa('0x2d')];if(!_0x3f7af4[_0x97aa('0x2e')][_0x97aa('0x33')](_0x97aa('0x34'))){_0x54b723[_0x97aa('0x1c')]=qs['limit'](_0x3f7af4['query'][_0x97aa('0x1c')]);_0x54b723[_0x97aa('0x1b')]=qs['offset'](_0x3f7af4['query'][_0x97aa('0x1b')]);}_0x54b723['order']=qs[_0x97aa('0x35')](_0x3f7af4[_0x97aa('0x2e')]['sort']);_0x54b723[_0x97aa('0x36')]=qs['filters'](_[_0x97aa('0x37')](_0x3f7af4[_0x97aa('0x2e')],_0x3b5014[_0x97aa('0x2f')]));if(_0x3f7af4['query'][_0x97aa('0x38')]){_0x54b723[_0x97aa('0x36')]=_[_0x97aa('0x39')](_0x54b723[_0x97aa('0x36')],{'$or':_[_0x97aa('0x3a')](_0x5c797f,function(_0x3a6d45){if(_0x3a6d45[_0x97aa('0x3b')][_0x97aa('0x3c')]!==_0x97aa('0x3d')){var _0x282ea3={};_0x282ea3[_0x3a6d45['field']]={'$like':'%'+_0x3f7af4[_0x97aa('0x2e')][_0x97aa('0x38')]+'%'};return _0x282ea3;}})});}_0x54b723=_[_0x97aa('0x39')]({},_0x54b723,_0x3f7af4['options']);var _0x47113d={'where':_0x54b723[_0x97aa('0x36')]};return db['AnalyticExtractedReport']['count'](_0x47113d)[_0x97aa('0x23')](function(_0x50a89f){_0x5555ef[_0x97aa('0x3e')]=_0x50a89f;if(_0x3f7af4[_0x97aa('0x2e')][_0x97aa('0x3f')]){_0x54b723['include']=[{'all':!![]}];}return db[_0x97aa('0x2b')]['findAll'](_0x54b723);})[_0x97aa('0x23')](function(_0x2eecba){_0x5555ef[_0x97aa('0x40')]=_0x2eecba;return _0x5555ef;})[_0x97aa('0x23')](respondWithFilteredResult(_0x4129f2,_0x54b723))[_0x97aa('0x41')](handleError(_0x4129f2,null));};exports[_0x97aa('0x42')]=function(_0x15af93,_0x4b25bf){var _0x39a392={'raw':!![],'where':{'id':_0x15af93[_0x97aa('0x43')]['id']}},_0x3d752c={};_0x3d752c[_0x97aa('0x2d')]=_[_0x97aa('0x44')](db[_0x97aa('0x2b')][_0x97aa('0x2c')]);_0x3d752c[_0x97aa('0x2e')]=_[_0x97aa('0x44')](_0x15af93[_0x97aa('0x2e')]);_0x3d752c[_0x97aa('0x2f')]=_[_0x97aa('0x30')](_0x3d752c[_0x97aa('0x2d')],_0x3d752c['query']);_0x39a392[_0x97aa('0x31')]=_[_0x97aa('0x30')](_0x3d752c['model'],qs[_0x97aa('0x32')](_0x15af93[_0x97aa('0x2e')]['fields']));_0x39a392[_0x97aa('0x31')]=_0x39a392['attributes'][_0x97aa('0x45')]?_0x39a392[_0x97aa('0x31')]:_0x3d752c['model'];if(_0x15af93[_0x97aa('0x2e')][_0x97aa('0x3f')]){_0x39a392['include']=[{'all':!![]}];}_0x39a392=_['merge']({},_0x39a392,_0x15af93[_0x97aa('0x46')]);return db['AnalyticExtractedReport'][_0x97aa('0x47')](_0x39a392)[_0x97aa('0x23')](handleEntityNotFound(_0x4b25bf,null))[_0x97aa('0x23')](respondWithResult(_0x4b25bf,null))['catch'](handleError(_0x4b25bf,null));};exports[_0x97aa('0x48')]=function(_0x3cd2fa,_0x413f8e){return db[_0x97aa('0x2b')][_0x97aa('0x48')](_0x3cd2fa[_0x97aa('0x49')],{})['then'](function(_0xe02cd2){var _0x523462=_0x3cd2fa['user'][_0x97aa('0x4a')]({'plain':!![]});if(!_0x523462)throw new Error(_0x97aa('0x4b'));if(_0x523462[_0x97aa('0x4c')]==='user'){var _0xee89db=_0xe02cd2[_0x97aa('0x4a')]({'plain':!![]});var _0x37e766=_0x97aa('0x24');return db[_0x97aa('0x4d')]['find']({'where':{'name':_0x37e766,'userProfileId':_0x523462[_0x97aa('0x4e')]},'raw':!![]})['then'](function(_0x5f00c9){if(_0x5f00c9&&_0x5f00c9[_0x97aa('0x4f')]===0x0){return db[_0x97aa('0x25')][_0x97aa('0x48')]({'name':_0xee89db['name'],'resourceId':_0xee89db['id'],'type':_0x5f00c9['name'],'sectionId':_0x5f00c9['id']},{})[_0x97aa('0x23')](function(){return _0xe02cd2;});}else{return _0xe02cd2;}})[_0x97aa('0x41')](function(_0x480c81){logger[_0x97aa('0x26')](_0x97aa('0x50'),_0x480c81);throw _0x480c81;});}return _0xe02cd2;})['then'](respondWithResult(_0x413f8e,0xc9))[_0x97aa('0x41')](handleError(_0x413f8e,null));};exports[_0x97aa('0x21')]=function(_0x3360c7,_0x415a5d){if(_0x3360c7[_0x97aa('0x49')]['id']){delete _0x3360c7[_0x97aa('0x49')]['id'];}return db['AnalyticExtractedReport'][_0x97aa('0x47')]({'where':{'id':_0x3360c7[_0x97aa('0x43')]['id']}})[_0x97aa('0x23')](handleEntityNotFound(_0x415a5d,null))[_0x97aa('0x23')](saveUpdates(_0x3360c7[_0x97aa('0x49')],null))[_0x97aa('0x23')](respondWithResult(_0x415a5d,null))[_0x97aa('0x41')](handleError(_0x415a5d,null));};exports[_0x97aa('0x22')]=function(_0x5adc88,_0x5922ed){return db[_0x97aa('0x2b')]['find']({'where':{'id':_0x5adc88[_0x97aa('0x43')]['id']}})[_0x97aa('0x23')](handleEntityNotFound(_0x5922ed,null))[_0x97aa('0x23')](removeEntity(_0x5922ed,null))[_0x97aa('0x41')](handleError(_0x5922ed,null));};exports[_0x97aa('0x51')]=function(_0x3ad4bf,_0x2f8e6c,_0x354bef){return db[_0x97aa('0x2b')][_0x97aa('0x47')]({'where':{'id':_0x3ad4bf[_0x97aa('0x43')]['id']},'attributes':[_0x97aa('0x28'),'basename','savename',_0x97aa('0x52')],'raw':!![]})[_0x97aa('0x23')](handleEntityNotFound(_0x2f8e6c,null))[_0x97aa('0x23')](function(_0x4494fe){if(_0x4494fe){if(!fs[_0x97aa('0x53')](path['join'](config[_0x97aa('0x54')],_0x97aa('0x55'),_0x4494fe[_0x97aa('0x56')]))){throw new db['Sequelize'][(_0x97aa('0x57'))](_0x97aa('0x58'));}if(_0x3ad4bf[_0x97aa('0x2e')][_0x97aa('0x59')]){return _0x2f8e6c[_0x97aa('0x17')](0xc8);}return _0x2f8e6c[_0x97aa('0x51')](path[_0x97aa('0x5a')](config[_0x97aa('0x54')],'server/files/reports',_0x4494fe[_0x97aa('0x56')]),util[_0x97aa('0x5b')](_0x97aa('0x5c'),_0x4494fe['basename']||_0x4494fe[_0x97aa('0x28')],_0x4494fe['output'][_0x97aa('0x5d')]()));}})[_0x97aa('0x41')](handleError(_0x2f8e6c,null));}; \ No newline at end of file +var _0x729e=['%s.%s','output','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','name','send','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','field','options','AnalyticExtractedReport','include','findAll','rows','catch','show','params','rawAttributes','includeAll','merge','find','create','body','user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','savename','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','download'];(function(_0x17555c,_0x4fa359){var _0x27ccb8=function(_0x34cfb7){while(--_0x34cfb7){_0x17555c['push'](_0x17555c['shift']());}};_0x27ccb8(++_0x4fa359);}(_0x729e,0xbb));var _0xe729=function(_0x4981dd,_0x211f77){_0x4981dd=_0x4981dd-0x0;var _0x5284a9=_0x729e[_0x4981dd];return _0x5284a9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe729('0x0'));var rimraf=require(_0xe729('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe729('0x2'));var rp=require(_0xe729('0x3'));var moment=require(_0xe729('0x4'));var BPromise=require(_0xe729('0x5'));var Mustache=require(_0xe729('0x6'));var util=require(_0xe729('0x7'));var path=require('path');var sox=require(_0xe729('0x8'));var csv=require('to-csv');var ejs=require(_0xe729('0x9'));var fs=require('fs');var _=require(_0xe729('0xa'));var squel=require(_0xe729('0xb'));var crypto=require('crypto');var jsforce=require(_0xe729('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe729('0xd'));var Redis=require(_0xe729('0xe'));var authService=require(_0xe729('0xf'));var qs=require(_0xe729('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe729('0x11'))(_0xe729('0x12'));var utils=require(_0xe729('0x13'));var config=require(_0xe729('0x14'));var db=require(_0xe729('0x15'))['db'];function respondWithStatusCode(_0x165a62,_0x19f840){_0x19f840=_0x19f840||0xcc;return function(_0x27e5fb){if(_0x27e5fb){return _0x165a62[_0xe729('0x16')](_0x19f840);}return _0x165a62[_0xe729('0x17')](_0x19f840)[_0xe729('0x18')]();};}function respondWithResult(_0x2c6501,_0x4f4743){_0x4f4743=_0x4f4743||0xc8;return function(_0x1bfa7b){if(_0x1bfa7b){return _0x2c6501['status'](_0x4f4743)[_0xe729('0x19')](_0x1bfa7b);}};}function respondWithFilteredResult(_0x16d116,_0x382a68){return function(_0x5b507f){if(_0x5b507f){var _0x47221f=_0x5b507f[_0xe729('0x1a')],_0x108fa7=_0x382a68['offset'],_0x22a498=_0x382a68[_0xe729('0x1b')]+_0x382a68[_0xe729('0x1c')],_0x32fc78;if(_0x22a498>=_0x47221f){_0x22a498=_0x47221f;_0x32fc78=0xc8;}else{_0x32fc78=0xce;}_0x16d116['status'](_0x32fc78);return _0x16d116[_0xe729('0x1d')](_0xe729('0x1e'),_0x108fa7+'-'+_0x22a498+'/'+_0x47221f)[_0xe729('0x19')](_0x5b507f);}return null;};}function patchUpdates(_0x3fbcfe){return function(_0x24aa12){try{jsonpatch[_0xe729('0x1f')](_0x24aa12,_0x3fbcfe,!![]);}catch(_0xb208a5){return BPromise[_0xe729('0x20')](_0xb208a5);}return _0x24aa12[_0xe729('0x21')]();};}function saveUpdates(_0x4b97be,_0x54b5cd){return function(_0x3ac1a9){if(_0x3ac1a9){return _0x3ac1a9['update'](_0x4b97be)[_0xe729('0x22')](function(_0x32bdb8){return _0x32bdb8;});}return null;};}function removeEntity(_0x50ad75,_0x3714d5){return function(_0x4f4540){if(_0x4f4540){return _0x4f4540[_0xe729('0x23')]()[_0xe729('0x22')](function(){var _0xc56869=_0x4f4540[_0xe729('0x24')]({'plain':!![]});var _0x3a28f1=_0xe729('0x25');return db[_0xe729('0x26')]['destroy']({'where':{'type':_0x3a28f1,'resourceId':_0xc56869['id']}})[_0xe729('0x22')](function(){return _0x4f4540;});})[_0xe729('0x22')](function(){_0x50ad75[_0xe729('0x17')](0xcc)[_0xe729('0x18')]();});}};}function handleEntityNotFound(_0x553863,_0x394fb2){return function(_0x4bc3d6){if(!_0x4bc3d6){_0x553863[_0xe729('0x16')](0x194);}return _0x4bc3d6;};}function handleError(_0x4ab280,_0x5c68cb){_0x5c68cb=_0x5c68cb||0x1f4;return function(_0x505e5d){logger['error'](_0x505e5d['stack']);if(_0x505e5d[_0xe729('0x27')]){delete _0x505e5d[_0xe729('0x27')];}_0x4ab280[_0xe729('0x17')](_0x5c68cb)[_0xe729('0x28')](_0x505e5d);};}exports[_0xe729('0x29')]=function(_0x437466,_0x1f97d9){var _0x33af2e={},_0x4ea3f4={},_0x150217={'count':0x0,'rows':[]};var _0x464b94=db['AnalyticExtractedReport']['rawAttributes'];_0x4ea3f4[_0xe729('0x2a')]=_[_0xe729('0x2b')](_0x464b94);_0x4ea3f4['query']=_[_0xe729('0x2b')](_0x437466[_0xe729('0x2c')]);_0x4ea3f4[_0xe729('0x2d')]=_[_0xe729('0x2e')](_0x4ea3f4[_0xe729('0x2a')],_0x4ea3f4[_0xe729('0x2c')]);_0x33af2e[_0xe729('0x2f')]=_[_0xe729('0x2e')](_0x4ea3f4[_0xe729('0x2a')],qs[_0xe729('0x30')](_0x437466['query'][_0xe729('0x30')]));_0x33af2e[_0xe729('0x2f')]=_0x33af2e['attributes'][_0xe729('0x31')]?_0x33af2e['attributes']:_0x4ea3f4['model'];if(!_0x437466['query'][_0xe729('0x32')](_0xe729('0x33'))){_0x33af2e[_0xe729('0x1c')]=qs[_0xe729('0x1c')](_0x437466[_0xe729('0x2c')]['limit']);_0x33af2e[_0xe729('0x1b')]=qs[_0xe729('0x1b')](_0x437466[_0xe729('0x2c')]['offset']);}_0x33af2e[_0xe729('0x34')]=qs['sort'](_0x437466[_0xe729('0x2c')][_0xe729('0x35')]);_0x33af2e[_0xe729('0x36')]=qs['filters'](_[_0xe729('0x37')](_0x437466[_0xe729('0x2c')],_0x4ea3f4[_0xe729('0x2d')]));if(_0x437466[_0xe729('0x2c')][_0xe729('0x38')]){_0x33af2e['where']=_['merge'](_0x33af2e[_0xe729('0x36')],{'$or':_[_0xe729('0x39')](_0x464b94,function(_0x5ac02f){if(_0x5ac02f[_0xe729('0x3a')][_0xe729('0x3b')]!=='VIRTUAL'){var _0x243ce2={};_0x243ce2[_0x5ac02f[_0xe729('0x3c')]]={'$like':'%'+_0x437466[_0xe729('0x2c')][_0xe729('0x38')]+'%'};return _0x243ce2;}})});}_0x33af2e=_['merge']({},_0x33af2e,_0x437466[_0xe729('0x3d')]);var _0x1cca07={'where':_0x33af2e[_0xe729('0x36')]};return db[_0xe729('0x3e')][_0xe729('0x1a')](_0x1cca07)['then'](function(_0x508c89){_0x150217[_0xe729('0x1a')]=_0x508c89;if(_0x437466[_0xe729('0x2c')]['includeAll']){_0x33af2e[_0xe729('0x3f')]=[{'all':!![]}];}return db[_0xe729('0x3e')][_0xe729('0x40')](_0x33af2e);})['then'](function(_0x368083){_0x150217[_0xe729('0x41')]=_0x368083;return _0x150217;})[_0xe729('0x22')](respondWithFilteredResult(_0x1f97d9,_0x33af2e))[_0xe729('0x42')](handleError(_0x1f97d9,null));};exports[_0xe729('0x43')]=function(_0x3863f4,_0x3c2e35){var _0x295c2b={'raw':!![],'where':{'id':_0x3863f4[_0xe729('0x44')]['id']}},_0x568eb5={};_0x568eb5['model']=_[_0xe729('0x2b')](db[_0xe729('0x3e')][_0xe729('0x45')]);_0x568eb5[_0xe729('0x2c')]=_['keys'](_0x3863f4[_0xe729('0x2c')]);_0x568eb5['filters']=_['intersection'](_0x568eb5['model'],_0x568eb5[_0xe729('0x2c')]);_0x295c2b[_0xe729('0x2f')]=_[_0xe729('0x2e')](_0x568eb5['model'],qs[_0xe729('0x30')](_0x3863f4[_0xe729('0x2c')][_0xe729('0x30')]));_0x295c2b[_0xe729('0x2f')]=_0x295c2b[_0xe729('0x2f')][_0xe729('0x31')]?_0x295c2b[_0xe729('0x2f')]:_0x568eb5[_0xe729('0x2a')];if(_0x3863f4[_0xe729('0x2c')][_0xe729('0x46')]){_0x295c2b['include']=[{'all':!![]}];}_0x295c2b=_[_0xe729('0x47')]({},_0x295c2b,_0x3863f4[_0xe729('0x3d')]);return db['AnalyticExtractedReport'][_0xe729('0x48')](_0x295c2b)['then'](handleEntityNotFound(_0x3c2e35,null))[_0xe729('0x22')](respondWithResult(_0x3c2e35,null))[_0xe729('0x42')](handleError(_0x3c2e35,null));};exports[_0xe729('0x49')]=function(_0x248986,_0x36e3e7){return db[_0xe729('0x3e')][_0xe729('0x49')](_0x248986[_0xe729('0x4a')],{})['then'](function(_0x57c9fe){var _0x1fea9e=_0x248986[_0xe729('0x4b')][_0xe729('0x24')]({'plain':!![]});if(!_0x1fea9e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1fea9e[_0xe729('0x4c')]==='user'){var _0x56989c=_0x57c9fe[_0xe729('0x24')]({'plain':!![]});var _0x4fad51=_0xe729('0x25');return db[_0xe729('0x4d')]['find']({'where':{'name':_0x4fad51,'userProfileId':_0x1fea9e['userProfileId']},'raw':!![]})[_0xe729('0x22')](function(_0x3aa3d4){if(_0x3aa3d4&&_0x3aa3d4[_0xe729('0x4e')]===0x0){return db[_0xe729('0x26')]['create']({'name':_0x56989c[_0xe729('0x27')],'resourceId':_0x56989c['id'],'type':_0x3aa3d4[_0xe729('0x27')],'sectionId':_0x3aa3d4['id']},{})[_0xe729('0x22')](function(){return _0x57c9fe;});}else{return _0x57c9fe;}})[_0xe729('0x42')](function(_0x21a267){logger[_0xe729('0x4f')](_0xe729('0x50'),_0x21a267);throw _0x21a267;});}return _0x57c9fe;})['then'](respondWithResult(_0x36e3e7,0xc9))['catch'](handleError(_0x36e3e7,null));};exports['update']=function(_0x540959,_0x422d2e){if(_0x540959[_0xe729('0x4a')]['id']){delete _0x540959[_0xe729('0x4a')]['id'];}return db[_0xe729('0x3e')][_0xe729('0x48')]({'where':{'id':_0x540959['params']['id']}})[_0xe729('0x22')](handleEntityNotFound(_0x422d2e,null))[_0xe729('0x22')](saveUpdates(_0x540959[_0xe729('0x4a')],null))['then'](respondWithResult(_0x422d2e,null))[_0xe729('0x42')](handleError(_0x422d2e,null));};exports[_0xe729('0x23')]=function(_0x3b2c46,_0x4ad100){return db[_0xe729('0x3e')][_0xe729('0x48')]({'where':{'id':_0x3b2c46['params']['id']}})[_0xe729('0x22')](handleEntityNotFound(_0x4ad100,null))[_0xe729('0x22')](removeEntity(_0x4ad100,null))[_0xe729('0x42')](handleError(_0x4ad100,null));};exports['download']=function(_0x539cf4,_0xec83a,_0x1d101d){return db[_0xe729('0x3e')][_0xe729('0x48')]({'where':{'id':_0x539cf4[_0xe729('0x44')]['id']},'attributes':['name','basename',_0xe729('0x51'),'output'],'raw':!![]})[_0xe729('0x22')](handleEntityNotFound(_0xec83a,null))['then'](function(_0x539c20){if(_0x539c20){if(!fs[_0xe729('0x52')](path[_0xe729('0x53')](config[_0xe729('0x54')],_0xe729('0x55'),_0x539c20['savename']))){throw new db[(_0xe729('0x56'))]['ValidationError'](_0xe729('0x57'));}if(_0x539cf4[_0xe729('0x2c')]['exists']){return _0xec83a[_0xe729('0x16')](0xc8);}return _0xec83a[_0xe729('0x58')](path[_0xe729('0x53')](config[_0xe729('0x54')],_0xe729('0x55'),_0x539c20[_0xe729('0x51')]),util['format'](_0xe729('0x59'),_0x539c20['basename']||_0x539c20[_0xe729('0x27')],_0x539c20[_0xe729('0x5a')][_0xe729('0x5b')]()));}})[_0xe729('0x42')](handleError(_0xec83a,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index a8a7f24..c45154d 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 _0x8d95=['analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x34f8be,_0x26c9ed){var _0x31f2e6=function(_0x577548){while(--_0x577548){_0x34f8be['push'](_0x34f8be['shift']());}};_0x31f2e6(++_0x26c9ed);}(_0x8d95,0x105));var _0x58d9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8d95[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x58d9('0x0'));var util=require(_0x58d9('0x1'));var logger=require(_0x58d9('0x2'))('api');var moment=require(_0x58d9('0x3'));var BPromise=require(_0x58d9('0x4'));var rp=require(_0x58d9('0x5'));var fs=require('fs');var path=require(_0x58d9('0x6'));var rimraf=require(_0x58d9('0x7'));var config=require(_0x58d9('0x8'));var attributes=require(_0x58d9('0x9'));module[_0x58d9('0xa')]=function(_0x174feb,_0x36b25b){return _0x174feb[_0x58d9('0xb')]('AnalyticExtractedReport',attributes,{'tableName':_0x58d9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4bf2=['bluebird','path','rimraf','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util','../../config/logger','api','moment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4bf2,0x10f));var _0x24bf=function(_0x4cb086,_0x283c29){_0x4cb086=_0x4cb086-0x0;var _0x5980f9=_0x4bf2[_0x4cb086];return _0x5980f9;};'use strict';var _=require(_0x24bf('0x0'));var util=require(_0x24bf('0x1'));var logger=require(_0x24bf('0x2'))(_0x24bf('0x3'));var moment=require(_0x24bf('0x4'));var BPromise=require(_0x24bf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x24bf('0x6'));var rimraf=require(_0x24bf('0x7'));var config=require('../../config/environment');var attributes=require(_0x24bf('0x8'));module[_0x24bf('0x9')]=function(_0xbc38f0,_0x540e75){return _0xbc38f0[_0x24bf('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x24bf('0xb'),'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 1276b29..4eeb3f2 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 _0xf1e2=['result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x52f06,_0x5b8c2a){var _0x2f28da=function(_0x4e13ca){while(--_0x4e13ca){_0x52f06['push'](_0x52f06['shift']());}};_0x2f28da(++_0x5b8c2a);}(_0xf1e2,0x172));var _0x2f1e=function(_0x36d45b,_0x417426){_0x36d45b=_0x36d45b-0x0;var _0x3dc01c=_0xf1e2[_0x36d45b];return _0x3dc01c;};'use strict';var _=require('lodash');var util=require(_0x2f1e('0x0'));var moment=require(_0x2f1e('0x1'));var BPromise=require(_0x2f1e('0x2'));var rs=require(_0x2f1e('0x3'));var fs=require('fs');var Redis=require(_0x2f1e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f1e('0x5'));var logger=require(_0x2f1e('0x6'))(_0x2f1e('0x7'));var config=require(_0x2f1e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2f1e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd2e20e,_0x1dedd1,_0x26635b){return new BPromise(function(_0x50e9c0,_0x103e57){return client[_0x2f1e('0xa')](_0xd2e20e,_0x26635b)[_0x2f1e('0xb')](function(_0xf6f6eb){logger['info'](_0x2f1e('0xc'),_0x1dedd1,_0x2f1e('0xd'));logger[_0x2f1e('0xe')](_0x2f1e('0xf'),_0x1dedd1,_0x2f1e('0xd'),JSON[_0x2f1e('0x10')](_0xf6f6eb));if(_0xf6f6eb['error']){if(_0xf6f6eb[_0x2f1e('0x11')][_0x2f1e('0x12')]===0x1f4){logger[_0x2f1e('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1dedd1,_0xf6f6eb[_0x2f1e('0x11')][_0x2f1e('0x13')]);return _0x103e57(_0xf6f6eb[_0x2f1e('0x11')][_0x2f1e('0x13')]);}logger['error'](_0x2f1e('0xc'),_0x1dedd1,_0xf6f6eb['error'][_0x2f1e('0x13')]);return _0x50e9c0(_0xf6f6eb['error'][_0x2f1e('0x13')]);}else{logger[_0x2f1e('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1dedd1,'request\x20sent');_0x50e9c0(_0xf6f6eb[_0x2f1e('0x15')][_0x2f1e('0x13')]);}})[_0x2f1e('0x16')](function(_0x3d77f8){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1dedd1,_0x3d77f8);_0x103e57(_0x3d77f8);});});} \ No newline at end of file +var _0xc7f4=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','util','bluebird'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc7f4,0x15e));var _0x4c7f=function(_0x34bb59,_0xd9b4df){_0x34bb59=_0x34bb59-0x0;var _0x29c11c=_0xc7f4[_0x34bb59];return _0x29c11c;};'use strict';var _=require('lodash');var util=require(_0x4c7f('0x0'));var moment=require('moment');var BPromise=require(_0x4c7f('0x1'));var rs=require(_0x4c7f('0x2'));var fs=require('fs');var Redis=require(_0x4c7f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c7f('0x4'));var logger=require(_0x4c7f('0x5'))(_0x4c7f('0x6'));var config=require(_0x4c7f('0x7'));var jayson=require(_0x4c7f('0x8'));var client=jayson[_0x4c7f('0x9')][_0x4c7f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x296ab7,_0x2f1863,_0x2a8c0c){return new BPromise(function(_0x2eb175,_0x3289da){return client[_0x4c7f('0xb')](_0x296ab7,_0x2a8c0c)['then'](function(_0xddc251){logger[_0x4c7f('0xc')](_0x4c7f('0xd'),_0x2f1863,'request\x20sent');logger[_0x4c7f('0xe')](_0x4c7f('0xf'),_0x2f1863,'request\x20sent',JSON[_0x4c7f('0x10')](_0xddc251));if(_0xddc251['error']){if(_0xddc251[_0x4c7f('0x11')][_0x4c7f('0x12')]===0x1f4){logger[_0x4c7f('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2f1863,_0xddc251[_0x4c7f('0x11')][_0x4c7f('0x13')]);return _0x3289da(_0xddc251[_0x4c7f('0x11')][_0x4c7f('0x13')]);}logger[_0x4c7f('0x11')](_0x4c7f('0xd'),_0x2f1863,_0xddc251[_0x4c7f('0x11')]['message']);return _0x2eb175(_0xddc251[_0x4c7f('0x11')][_0x4c7f('0x13')]);}else{logger[_0x4c7f('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2f1863,_0x4c7f('0x14'));_0x2eb175(_0xddc251[_0x4c7f('0x15')]['message']);}})['catch'](function(_0x585a4a){logger[_0x4c7f('0x11')](_0x4c7f('0xd'),_0x2f1863,_0x585a4a);_0x3289da(_0x585a4a);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 472955e..2fafa33 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 _0x2128=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','/:id','show','get','/:id/download','download','post','create','put','update','delete','destroy','exports','connect-timeout','express','../../components/auth/service'];(function(_0x5e05cd,_0x282468){var _0xe9adbb=function(_0x226595){while(--_0x226595){_0x5e05cd['push'](_0x5e05cd['shift']());}};_0xe9adbb(++_0x282468);}(_0x2128,0x1c9));var _0x8212=function(_0x5b15cd,_0x187865){_0x5b15cd=_0x5b15cd-0x0;var _0x357324=_0x2128[_0x5b15cd];return _0x357324;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8212('0x0'));var express=require(_0x8212('0x1'));var router=express['Router']();var auth=require(_0x8212('0x2'));var interaction=require(_0x8212('0x3'));var config=require(_0x8212('0x4'));var controller=require(_0x8212('0x5'));router['get']('/',auth[_0x8212('0x6')](),controller[_0x8212('0x7')]);router['get'](_0x8212('0x8'),auth[_0x8212('0x6')](),controller[_0x8212('0x9')]);router[_0x8212('0xa')](_0x8212('0xb'),auth[_0x8212('0x6')](),controller[_0x8212('0xc')]);router[_0x8212('0xd')]('/',auth[_0x8212('0x6')](),controller[_0x8212('0xe')]);router[_0x8212('0xf')](_0x8212('0x8'),auth['isAuthenticated'](),controller[_0x8212('0x10')]);router[_0x8212('0x11')](_0x8212('0x8'),auth[_0x8212('0x6')](),controller[_0x8212('0x12')]);module[_0x8212('0x13')]=router; \ No newline at end of file +var _0x4e86=['show','/:id/download','post','create','put','update','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0x4e86,0xf1));var _0x64e8=function(_0x2578b1,_0x2dbb90){_0x2578b1=_0x2578b1-0x0;var _0x1c42b4=_0x4e86[_0x2578b1];return _0x1c42b4;};'use strict';var multer=require(_0x64e8('0x0'));var util=require('util');var path=require(_0x64e8('0x1'));var timeout=require('connect-timeout');var express=require(_0x64e8('0x2'));var router=express[_0x64e8('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x64e8('0x4'));var config=require(_0x64e8('0x5'));var controller=require(_0x64e8('0x6'));router[_0x64e8('0x7')]('/',auth['isAuthenticated'](),controller[_0x64e8('0x8')]);router[_0x64e8('0x7')](_0x64e8('0x9'),auth[_0x64e8('0xa')](),controller[_0x64e8('0xb')]);router[_0x64e8('0x7')](_0x64e8('0xc'),auth[_0x64e8('0xa')](),controller['download']);router[_0x64e8('0xd')]('/',auth['isAuthenticated'](),controller[_0x64e8('0xe')]);router[_0x64e8('0xf')](_0x64e8('0x9'),auth[_0x64e8('0xa')](),controller[_0x64e8('0x10')]);router['delete'](_0x64e8('0x9'),auth[_0x64e8('0xa')](),controller['destroy']);module[_0x64e8('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 6e522e7..01a3c29 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 _0x326f=['STRING','BOOLEAN','sequelize'];(function(_0xaba9df,_0x5b322f){var _0x26e668=function(_0xef74de){while(--_0xef74de){_0xaba9df['push'](_0xaba9df['shift']());}};_0x26e668(++_0x5b322f);}(_0x326f,0xd1));var _0xf326=function(_0x18b969,_0x3bebc4){_0x18b969=_0x18b969-0x0;var _0xcd7928=_0x326f[_0x18b969];return _0xcd7928;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xf326('0x1')]},'function':{'type':Sequelize[_0xf326('0x1')]},'format':{'type':Sequelize[_0xf326('0x1')]},'groupBy':{'type':Sequelize[_0xf326('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xf326('0x1')]},'custom':{'type':Sequelize[_0xf326('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x7217=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x30e82f,_0x5012e5){var _0x487ed8=function(_0x39c1e9){while(--_0x39c1e9){_0x30e82f['push'](_0x30e82f['shift']());}};_0x487ed8(++_0x5012e5);}(_0x7217,0x19e));var _0x7721=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x7217[_0x32d457];return _0x338386;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'field':{'type':Sequelize[_0x7721('0x1')]},'alias':{'type':Sequelize[_0x7721('0x2')]},'function':{'type':Sequelize[_0x7721('0x2')]},'format':{'type':Sequelize[_0x7721('0x2')]},'groupBy':{'type':Sequelize[_0x7721('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'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 396011b..cfac2d7 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 _0x4a79=['to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','limit','set','Content-Range','reject','save','update','then','destroy','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','AnalyticFieldReport','includeAll','rows','catch','find','create','body','bulkCreate','params','bulkDestroy','ids','AnalyticCustomReport','findOne','findAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0x4a79,0x121));var _0x94a7=function(_0x86bf72,_0x3bb497){_0x86bf72=_0x86bf72-0x0;var _0x4e8131=_0x4a79[_0x86bf72];return _0x4e8131;};'use strict';var pdf=require(_0x94a7('0x0'));var emlformat=require(_0x94a7('0x1'));var rimraf=require(_0x94a7('0x2'));var zipdir=require(_0x94a7('0x3'));var jsonpatch=require(_0x94a7('0x4'));var rp=require(_0x94a7('0x5'));var moment=require(_0x94a7('0x6'));var BPromise=require(_0x94a7('0x7'));var Mustache=require(_0x94a7('0x8'));var util=require(_0x94a7('0x9'));var path=require('path');var sox=require(_0x94a7('0xa'));var csv=require(_0x94a7('0xb'));var ejs=require(_0x94a7('0xc'));var fs=require('fs');var _=require(_0x94a7('0xd'));var squel=require(_0x94a7('0xe'));var crypto=require(_0x94a7('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x94a7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x94a7('0x11'));var Papa=require(_0x94a7('0x12'));var Redis=require('ioredis');var authService=require(_0x94a7('0x13'));var qs=require(_0x94a7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x94a7('0x15'));var utils=require(_0x94a7('0x16'));var config=require(_0x94a7('0x17'));var db=require(_0x94a7('0x18'))['db'];function respondWithStatusCode(_0x143a75,_0xc1c011){_0xc1c011=_0xc1c011||0xcc;return function(_0x31bba5){if(_0x31bba5){return _0x143a75[_0x94a7('0x19')](_0xc1c011);}return _0x143a75[_0x94a7('0x1a')](_0xc1c011)['end']();};}function respondWithResult(_0x491621,_0x57a60f){_0x57a60f=_0x57a60f||0xc8;return function(_0x461864){if(_0x461864){return _0x491621[_0x94a7('0x1a')](_0x57a60f)['json'](_0x461864);}};}function respondWithFilteredResult(_0x2295a7,_0x22f8d6){return function(_0x50555d){if(_0x50555d){var _0x1c9514=_0x50555d[_0x94a7('0x1b')],_0x2cc2ce=_0x22f8d6['offset'],_0x451a4d=_0x22f8d6['offset']+_0x22f8d6[_0x94a7('0x1c')],_0x2cb7b7;if(_0x451a4d>=_0x1c9514){_0x451a4d=_0x1c9514;_0x2cb7b7=0xc8;}else{_0x2cb7b7=0xce;}_0x2295a7[_0x94a7('0x1a')](_0x2cb7b7);return _0x2295a7[_0x94a7('0x1d')](_0x94a7('0x1e'),_0x2cc2ce+'-'+_0x451a4d+'/'+_0x1c9514)['json'](_0x50555d);}return null;};}function patchUpdates(_0x5cc0f5){return function(_0xd3255e){try{jsonpatch['apply'](_0xd3255e,_0x5cc0f5,!![]);}catch(_0x311dff){return BPromise[_0x94a7('0x1f')](_0x311dff);}return _0xd3255e[_0x94a7('0x20')]();};}function saveUpdates(_0x2161ed,_0x3798e7){return function(_0x459237){if(_0x459237){return _0x459237[_0x94a7('0x21')](_0x2161ed)[_0x94a7('0x22')](function(_0x21d1da){return _0x21d1da;});}return null;};}function removeEntity(_0x43404f,_0x541033){return function(_0x3d1686){if(_0x3d1686){return _0x3d1686[_0x94a7('0x23')]()[_0x94a7('0x22')](function(){_0x43404f[_0x94a7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a5d1f,_0x5bd721){return function(_0x29f0f1){if(!_0x29f0f1){_0x4a5d1f[_0x94a7('0x19')](0x194);}return _0x29f0f1;};}function handleError(_0x268589,_0x79df2a){_0x79df2a=_0x79df2a||0x1f4;return function(_0x104228){logger['error'](_0x104228['stack']);if(_0x104228[_0x94a7('0x24')]){delete _0x104228['name'];}_0x268589[_0x94a7('0x1a')](_0x79df2a)[_0x94a7('0x25')](_0x104228);};}exports[_0x94a7('0x26')]=function(_0x5a6e1e,_0x535be1){var _0x3c9bb2={},_0x35063c={},_0x32de11={'count':0x0,'rows':[]};var _0x54b3d8=db['AnalyticFieldReport'][_0x94a7('0x27')];_0x35063c[_0x94a7('0x28')]=_[_0x94a7('0x29')](_0x54b3d8);_0x35063c['query']=_[_0x94a7('0x29')](_0x5a6e1e[_0x94a7('0x2a')]);_0x35063c['filters']=_[_0x94a7('0x2b')](_0x35063c[_0x94a7('0x28')],_0x35063c[_0x94a7('0x2a')]);_0x3c9bb2[_0x94a7('0x2c')]=_[_0x94a7('0x2b')](_0x35063c[_0x94a7('0x28')],qs[_0x94a7('0x2d')](_0x5a6e1e['query'][_0x94a7('0x2d')]));_0x3c9bb2[_0x94a7('0x2c')]=_0x3c9bb2[_0x94a7('0x2c')]['length']?_0x3c9bb2[_0x94a7('0x2c')]:_0x35063c[_0x94a7('0x28')];if(!_0x5a6e1e[_0x94a7('0x2a')][_0x94a7('0x2e')](_0x94a7('0x2f'))){_0x3c9bb2[_0x94a7('0x1c')]=qs[_0x94a7('0x1c')](_0x5a6e1e['query'][_0x94a7('0x1c')]);_0x3c9bb2[_0x94a7('0x30')]=qs['offset'](_0x5a6e1e['query'][_0x94a7('0x30')]);}_0x3c9bb2[_0x94a7('0x31')]=qs[_0x94a7('0x32')](_0x5a6e1e[_0x94a7('0x2a')][_0x94a7('0x32')]);_0x3c9bb2[_0x94a7('0x33')]=qs[_0x94a7('0x34')](_[_0x94a7('0x35')](_0x5a6e1e[_0x94a7('0x2a')],_0x35063c[_0x94a7('0x34')]));if(_0x5a6e1e[_0x94a7('0x2a')][_0x94a7('0x36')]){_0x3c9bb2[_0x94a7('0x33')]=_[_0x94a7('0x37')](_0x3c9bb2['where'],{'$or':_[_0x94a7('0x38')](_0x54b3d8,function(_0x3cca34){if(_0x3cca34[_0x94a7('0x39')][_0x94a7('0x3a')]!==_0x94a7('0x3b')){var _0xa7e612={};_0xa7e612[_0x3cca34['field']]={'$like':'%'+_0x5a6e1e[_0x94a7('0x2a')][_0x94a7('0x36')]+'%'};return _0xa7e612;}})});}_0x3c9bb2=_[_0x94a7('0x37')]({},_0x3c9bb2,_0x5a6e1e[_0x94a7('0x3c')]);var _0x4e574b={'where':_0x3c9bb2[_0x94a7('0x33')]};return db[_0x94a7('0x3d')][_0x94a7('0x1b')](_0x4e574b)[_0x94a7('0x22')](function(_0x33f2d2){_0x32de11['count']=_0x33f2d2;if(_0x5a6e1e[_0x94a7('0x2a')][_0x94a7('0x3e')]){_0x3c9bb2['include']=[{'all':!![]}];}return db[_0x94a7('0x3d')]['findAll'](_0x3c9bb2);})['then'](function(_0x4fc21b){_0x32de11[_0x94a7('0x3f')]=_0x4fc21b;return _0x32de11;})[_0x94a7('0x22')](respondWithFilteredResult(_0x535be1,_0x3c9bb2))[_0x94a7('0x40')](handleError(_0x535be1,null));};exports['show']=function(_0x5023a6,_0x570254){var _0x2bb8f8={'raw':![],'where':{'id':_0x5023a6['params']['id']}},_0x567ff1={};_0x567ff1[_0x94a7('0x28')]=_[_0x94a7('0x29')](db[_0x94a7('0x3d')]['rawAttributes']);_0x567ff1[_0x94a7('0x2a')]=_['keys'](_0x5023a6[_0x94a7('0x2a')]);_0x567ff1[_0x94a7('0x34')]=_[_0x94a7('0x2b')](_0x567ff1[_0x94a7('0x28')],_0x567ff1[_0x94a7('0x2a')]);_0x2bb8f8[_0x94a7('0x2c')]=_[_0x94a7('0x2b')](_0x567ff1[_0x94a7('0x28')],qs[_0x94a7('0x2d')](_0x5023a6['query'][_0x94a7('0x2d')]));_0x2bb8f8[_0x94a7('0x2c')]=_0x2bb8f8[_0x94a7('0x2c')]['length']?_0x2bb8f8[_0x94a7('0x2c')]:_0x567ff1['model'];if(_0x5023a6['query'][_0x94a7('0x3e')]){_0x2bb8f8['include']=[{'all':!![]}];}_0x2bb8f8=_[_0x94a7('0x37')]({},_0x2bb8f8,_0x5023a6['options']);return db[_0x94a7('0x3d')][_0x94a7('0x41')](_0x2bb8f8)[_0x94a7('0x22')](handleEntityNotFound(_0x570254,null))[_0x94a7('0x22')](respondWithResult(_0x570254,null))[_0x94a7('0x40')](handleError(_0x570254,null));};exports[_0x94a7('0x42')]=function(_0x4109ec,_0x5772c0){return db[_0x94a7('0x3d')][_0x94a7('0x42')](_0x4109ec[_0x94a7('0x43')],{})[_0x94a7('0x22')](respondWithResult(_0x5772c0,0xc9))[_0x94a7('0x40')](handleError(_0x5772c0,null));};exports[_0x94a7('0x44')]=function(_0x495bb7,_0x17aa1c){return db[_0x94a7('0x3d')][_0x94a7('0x44')](_0x495bb7[_0x94a7('0x43')],{'raw':![],'individualHooks':!![]})[_0x94a7('0x22')](respondWithResult(_0x17aa1c,0xc9))[_0x94a7('0x40')](handleError(_0x17aa1c,null));};exports[_0x94a7('0x21')]=function(_0x23295d,_0x4d1880){if(_0x23295d[_0x94a7('0x43')]['id']){delete _0x23295d[_0x94a7('0x43')]['id'];}return db[_0x94a7('0x3d')][_0x94a7('0x41')]({'where':{'id':_0x23295d[_0x94a7('0x45')]['id']}})['then'](handleEntityNotFound(_0x4d1880,null))['then'](saveUpdates(_0x23295d[_0x94a7('0x43')],null))['then'](respondWithResult(_0x4d1880,null))[_0x94a7('0x40')](handleError(_0x4d1880,null));};exports[_0x94a7('0x23')]=function(_0x2ee80e,_0x58f53e){return db[_0x94a7('0x3d')][_0x94a7('0x41')]({'where':{'id':_0x2ee80e[_0x94a7('0x45')]['id']}})['then'](handleEntityNotFound(_0x58f53e,null))['then'](removeEntity(_0x58f53e,null))[_0x94a7('0x40')](handleError(_0x58f53e,null));};exports[_0x94a7('0x46')]=function(_0x52b80a,_0x18ff06){return db['AnalyticFieldReport'][_0x94a7('0x23')]({'where':{'id':_0x52b80a[_0x94a7('0x2a')][_0x94a7('0x47')]||[]},'raw':![],'individualHooks':!![]})[_0x94a7('0x22')](respondWithResult(_0x18ff06,0xcc))[_0x94a7('0x40')](handleError(_0x18ff06,null));};exports['addFields']=function(_0x6eedb0,_0x2983f8,_0xc10ba1){return db[_0x94a7('0x48')][_0x94a7('0x49')]({'where':{'id':_0x6eedb0[_0x94a7('0x45')]['id']}})[_0x94a7('0x22')](handleEntityNotFound(_0x2983f8,null))[_0x94a7('0x22')](function(_0x304d36){if(_0x304d36){return db['sequelize']['transaction'](function(_0xa1729){return db[_0x94a7('0x3d')][_0x94a7('0x23')]({'where':{'CustomReportId':_0x6eedb0['params']['id']},'transaction':_0xa1729})['then'](function(_0x25d637){var _0x40265e=_[_0x94a7('0x38')](_0x6eedb0[_0x94a7('0x43')],function(_0x4e94fc){delete _0x4e94fc['id'];_0x4e94fc['CustomReportId']=_0x6eedb0[_0x94a7('0x45')]['id'];return _0x4e94fc;});return db[_0x94a7('0x3d')][_0x94a7('0x44')](_0x40265e,{'transaction':_0xa1729});});})[_0x94a7('0x22')](function(){return db[_0x94a7('0x3d')][_0x94a7('0x4a')]({'where':{'CustomReportId':_0x6eedb0[_0x94a7('0x45')]['id']}});});}})[_0x94a7('0x22')](respondWithResult(_0x2983f8,null))['catch'](handleError(_0x2983f8,null));}; \ No newline at end of file +var _0x641b=['model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','bulkCreate','destroy','bulkDestroy','ids','AnalyticCustomReport','findOne','transaction','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','Content-Range','apply','reject','save','update','then','error','name','send','index','AnalyticFieldReport','rawAttributes','keys','query','filters','intersection','fields','attributes'];(function(_0x87971a,_0x458a52){var _0xc754c3=function(_0xf2cdb8){while(--_0xf2cdb8){_0x87971a['push'](_0x87971a['shift']());}};_0xc754c3(++_0x458a52);}(_0x641b,0x110));var _0xb641=function(_0x915299,_0x2f97a3){_0x915299=_0x915299-0x0;var _0x22d190=_0x641b[_0x915299];return _0x22d190;};'use strict';var pdf=require(_0xb641('0x0'));var emlformat=require(_0xb641('0x1'));var rimraf=require(_0xb641('0x2'));var zipdir=require(_0xb641('0x3'));var jsonpatch=require(_0xb641('0x4'));var rp=require(_0xb641('0x5'));var moment=require(_0xb641('0x6'));var BPromise=require(_0xb641('0x7'));var Mustache=require(_0xb641('0x8'));var util=require('util');var path=require(_0xb641('0x9'));var sox=require(_0xb641('0xa'));var csv=require(_0xb641('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb641('0xc'));var crypto=require(_0xb641('0xd'));var jsforce=require(_0xb641('0xe'));var deskjs=require(_0xb641('0xf'));var toCsv=require(_0xb641('0xb'));var querystring=require(_0xb641('0x10'));var Papa=require(_0xb641('0x11'));var Redis=require(_0xb641('0x12'));var authService=require(_0xb641('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb641('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xb641('0x15'));var config=require(_0xb641('0x16'));var db=require(_0xb641('0x17'))['db'];function respondWithStatusCode(_0x588681,_0x369952){_0x369952=_0x369952||0xcc;return function(_0x181ee7){if(_0x181ee7){return _0x588681[_0xb641('0x18')](_0x369952);}return _0x588681['status'](_0x369952)[_0xb641('0x19')]();};}function respondWithResult(_0x58f3b7,_0x2c3fbc){_0x2c3fbc=_0x2c3fbc||0xc8;return function(_0x45d738){if(_0x45d738){return _0x58f3b7[_0xb641('0x1a')](_0x2c3fbc)[_0xb641('0x1b')](_0x45d738);}};}function respondWithFilteredResult(_0x10b367,_0x1dd32c){return function(_0x4c0088){if(_0x4c0088){var _0x4a3eac=_0x4c0088['count'],_0x50300c=_0x1dd32c['offset'],_0x1e4355=_0x1dd32c[_0xb641('0x1c')]+_0x1dd32c[_0xb641('0x1d')],_0x3e8bfa;if(_0x1e4355>=_0x4a3eac){_0x1e4355=_0x4a3eac;_0x3e8bfa=0xc8;}else{_0x3e8bfa=0xce;}_0x10b367[_0xb641('0x1a')](_0x3e8bfa);return _0x10b367['set'](_0xb641('0x1e'),_0x50300c+'-'+_0x1e4355+'/'+_0x4a3eac)[_0xb641('0x1b')](_0x4c0088);}return null;};}function patchUpdates(_0x1681ae){return function(_0x10d754){try{jsonpatch[_0xb641('0x1f')](_0x10d754,_0x1681ae,!![]);}catch(_0x42afc9){return BPromise[_0xb641('0x20')](_0x42afc9);}return _0x10d754[_0xb641('0x21')]();};}function saveUpdates(_0x125043,_0x5a5ff3){return function(_0xcc9783){if(_0xcc9783){return _0xcc9783[_0xb641('0x22')](_0x125043)['then'](function(_0x509406){return _0x509406;});}return null;};}function removeEntity(_0x2c8e24,_0x4665d0){return function(_0x20956f){if(_0x20956f){return _0x20956f['destroy']()[_0xb641('0x23')](function(){_0x2c8e24['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d1323,_0x27f1b1){return function(_0x246eca){if(!_0x246eca){_0x3d1323[_0xb641('0x18')](0x194);}return _0x246eca;};}function handleError(_0x1b7a15,_0x3c86bd){_0x3c86bd=_0x3c86bd||0x1f4;return function(_0x9d576f){logger[_0xb641('0x24')](_0x9d576f['stack']);if(_0x9d576f[_0xb641('0x25')]){delete _0x9d576f[_0xb641('0x25')];}_0x1b7a15[_0xb641('0x1a')](_0x3c86bd)[_0xb641('0x26')](_0x9d576f);};}exports[_0xb641('0x27')]=function(_0x1c4e53,_0x1b4d54){var _0x58bd46={},_0x3c6efb={},_0x2c7cb6={'count':0x0,'rows':[]};var _0x51818d=db[_0xb641('0x28')][_0xb641('0x29')];_0x3c6efb['model']=_[_0xb641('0x2a')](_0x51818d);_0x3c6efb[_0xb641('0x2b')]=_[_0xb641('0x2a')](_0x1c4e53[_0xb641('0x2b')]);_0x3c6efb[_0xb641('0x2c')]=_[_0xb641('0x2d')](_0x3c6efb['model'],_0x3c6efb[_0xb641('0x2b')]);_0x58bd46['attributes']=_[_0xb641('0x2d')](_0x3c6efb['model'],qs[_0xb641('0x2e')](_0x1c4e53[_0xb641('0x2b')][_0xb641('0x2e')]));_0x58bd46[_0xb641('0x2f')]=_0x58bd46[_0xb641('0x2f')]['length']?_0x58bd46[_0xb641('0x2f')]:_0x3c6efb[_0xb641('0x30')];if(!_0x1c4e53['query'][_0xb641('0x31')](_0xb641('0x32'))){_0x58bd46[_0xb641('0x1d')]=qs['limit'](_0x1c4e53[_0xb641('0x2b')][_0xb641('0x1d')]);_0x58bd46[_0xb641('0x1c')]=qs['offset'](_0x1c4e53[_0xb641('0x2b')][_0xb641('0x1c')]);}_0x58bd46[_0xb641('0x33')]=qs[_0xb641('0x34')](_0x1c4e53['query'][_0xb641('0x34')]);_0x58bd46[_0xb641('0x35')]=qs[_0xb641('0x2c')](_[_0xb641('0x36')](_0x1c4e53[_0xb641('0x2b')],_0x3c6efb[_0xb641('0x2c')]));if(_0x1c4e53[_0xb641('0x2b')][_0xb641('0x37')]){_0x58bd46[_0xb641('0x35')]=_[_0xb641('0x38')](_0x58bd46[_0xb641('0x35')],{'$or':_['map'](_0x51818d,function(_0x430510){if(_0x430510[_0xb641('0x39')][_0xb641('0x3a')]!==_0xb641('0x3b')){var _0x21a5bf={};_0x21a5bf[_0x430510[_0xb641('0x3c')]]={'$like':'%'+_0x1c4e53[_0xb641('0x2b')][_0xb641('0x37')]+'%'};return _0x21a5bf;}})});}_0x58bd46=_[_0xb641('0x38')]({},_0x58bd46,_0x1c4e53[_0xb641('0x3d')]);var _0x100cc9={'where':_0x58bd46[_0xb641('0x35')]};return db['AnalyticFieldReport']['count'](_0x100cc9)['then'](function(_0xb576c1){_0x2c7cb6['count']=_0xb576c1;if(_0x1c4e53[_0xb641('0x2b')][_0xb641('0x3e')]){_0x58bd46[_0xb641('0x3f')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xb641('0x40')](_0x58bd46);})[_0xb641('0x23')](function(_0x4e7a22){_0x2c7cb6[_0xb641('0x41')]=_0x4e7a22;return _0x2c7cb6;})[_0xb641('0x23')](respondWithFilteredResult(_0x1b4d54,_0x58bd46))[_0xb641('0x42')](handleError(_0x1b4d54,null));};exports[_0xb641('0x43')]=function(_0x80901e,_0x35f588){var _0x268e3e={'raw':![],'where':{'id':_0x80901e[_0xb641('0x44')]['id']}},_0x5eee3d={};_0x5eee3d[_0xb641('0x30')]=_['keys'](db[_0xb641('0x28')]['rawAttributes']);_0x5eee3d[_0xb641('0x2b')]=_['keys'](_0x80901e['query']);_0x5eee3d[_0xb641('0x2c')]=_[_0xb641('0x2d')](_0x5eee3d[_0xb641('0x30')],_0x5eee3d[_0xb641('0x2b')]);_0x268e3e[_0xb641('0x2f')]=_[_0xb641('0x2d')](_0x5eee3d[_0xb641('0x30')],qs[_0xb641('0x2e')](_0x80901e['query']['fields']));_0x268e3e[_0xb641('0x2f')]=_0x268e3e[_0xb641('0x2f')]['length']?_0x268e3e[_0xb641('0x2f')]:_0x5eee3d[_0xb641('0x30')];if(_0x80901e[_0xb641('0x2b')]['includeAll']){_0x268e3e[_0xb641('0x3f')]=[{'all':!![]}];}_0x268e3e=_[_0xb641('0x38')]({},_0x268e3e,_0x80901e[_0xb641('0x3d')]);return db[_0xb641('0x28')][_0xb641('0x45')](_0x268e3e)[_0xb641('0x23')](handleEntityNotFound(_0x35f588,null))[_0xb641('0x23')](respondWithResult(_0x35f588,null))['catch'](handleError(_0x35f588,null));};exports[_0xb641('0x46')]=function(_0x3f2fc9,_0x238c3f){return db[_0xb641('0x28')][_0xb641('0x46')](_0x3f2fc9[_0xb641('0x47')],{})['then'](respondWithResult(_0x238c3f,0xc9))[_0xb641('0x42')](handleError(_0x238c3f,null));};exports['bulkCreate']=function(_0x250b42,_0x423d4f){return db[_0xb641('0x28')][_0xb641('0x48')](_0x250b42[_0xb641('0x47')],{'raw':![],'individualHooks':!![]})[_0xb641('0x23')](respondWithResult(_0x423d4f,0xc9))[_0xb641('0x42')](handleError(_0x423d4f,null));};exports['update']=function(_0x24714c,_0x4d6ef9){if(_0x24714c[_0xb641('0x47')]['id']){delete _0x24714c[_0xb641('0x47')]['id'];}return db[_0xb641('0x28')]['find']({'where':{'id':_0x24714c[_0xb641('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d6ef9,null))['then'](saveUpdates(_0x24714c['body'],null))['then'](respondWithResult(_0x4d6ef9,null))[_0xb641('0x42')](handleError(_0x4d6ef9,null));};exports[_0xb641('0x49')]=function(_0x43ae5f,_0x12e2c7){return db[_0xb641('0x28')][_0xb641('0x45')]({'where':{'id':_0x43ae5f[_0xb641('0x44')]['id']}})[_0xb641('0x23')](handleEntityNotFound(_0x12e2c7,null))[_0xb641('0x23')](removeEntity(_0x12e2c7,null))['catch'](handleError(_0x12e2c7,null));};exports[_0xb641('0x4a')]=function(_0x56229b,_0x5ead55){return db[_0xb641('0x28')][_0xb641('0x49')]({'where':{'id':_0x56229b[_0xb641('0x2b')][_0xb641('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0xb641('0x23')](respondWithResult(_0x5ead55,0xcc))['catch'](handleError(_0x5ead55,null));};exports['addFields']=function(_0x1e3647,_0x3ceabf,_0x4bd094){return db[_0xb641('0x4c')][_0xb641('0x4d')]({'where':{'id':_0x1e3647[_0xb641('0x44')]['id']}})[_0xb641('0x23')](handleEntityNotFound(_0x3ceabf,null))[_0xb641('0x23')](function(_0x2cb3c2){if(_0x2cb3c2){return db['sequelize'][_0xb641('0x4e')](function(_0x3611cb){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x1e3647[_0xb641('0x44')]['id']},'transaction':_0x3611cb})[_0xb641('0x23')](function(_0x548761){var _0x46190a=_['map'](_0x1e3647[_0xb641('0x47')],function(_0x5d5f11){delete _0x5d5f11['id'];_0x5d5f11[_0xb641('0x4f')]=_0x1e3647['params']['id'];return _0x5d5f11;});return db[_0xb641('0x28')][_0xb641('0x48')](_0x46190a,{'transaction':_0x3611cb});});})[_0xb641('0x23')](function(){return db[_0xb641('0x28')][_0xb641('0x40')]({'where':{'CustomReportId':_0x1e3647[_0xb641('0x44')]['id']}});});}})['then'](respondWithResult(_0x3ceabf,null))[_0xb641('0x42')](handleError(_0x3ceabf,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 45c6167..cbd9b60 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 _0x79e9=['./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x464278,_0x48034d){var _0x143628=function(_0x36064d){while(--_0x36064d){_0x464278['push'](_0x464278['shift']());}};_0x143628(++_0x48034d);}(_0x79e9,0x125));var _0x979e=function(_0x319ca2,_0x45774a){_0x319ca2=_0x319ca2-0x0;var _0x243a33=_0x79e9[_0x319ca2];return _0x243a33;};'use strict';var _=require(_0x979e('0x0'));var util=require(_0x979e('0x1'));var logger=require(_0x979e('0x2'))('api');var moment=require(_0x979e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x979e('0x4'));var rimraf=require(_0x979e('0x5'));var config=require(_0x979e('0x6'));var attributes=require(_0x979e('0x7'));module[_0x979e('0x8')]=function(_0x270310,_0x5258a1){return _0x270310[_0x979e('0x9')](_0x979e('0xa'),attributes,{'tableName':_0x979e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x268b=['rimraf','./analyticFieldReport.attributes','define','analytics_report_fields','util','../../config/logger','moment','request-promise','path'];(function(_0x46a29a,_0x1befcc){var _0x561c08=function(_0x25c0aa){while(--_0x25c0aa){_0x46a29a['push'](_0x46a29a['shift']());}};_0x561c08(++_0x1befcc);}(_0x268b,0x12d));var _0xb268=function(_0x81dcac,_0x8ff7db){_0x81dcac=_0x81dcac-0x0;var _0xc7803b=_0x268b[_0x81dcac];return _0xc7803b;};'use strict';var _=require('lodash');var util=require(_0xb268('0x0'));var logger=require(_0xb268('0x1'))('api');var moment=require(_0xb268('0x2'));var BPromise=require('bluebird');var rp=require(_0xb268('0x3'));var fs=require('fs');var path=require(_0xb268('0x4'));var rimraf=require(_0xb268('0x5'));var config=require('../../config/environment');var attributes=require(_0xb268('0x6'));module['exports']=function(_0x22e154,_0x17e333){return _0x22e154[_0xb268('0x7')]('AnalyticFieldReport',attributes,{'tableName':_0xb268('0x8'),'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 fd1ae5a..6d0abfc 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 _0x4b0b=['rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0x4b0b,0x6b));var _0xb4b0=function(_0xdc7c84,_0x55c953){_0xdc7c84=_0xdc7c84-0x0;var _0x3ab1f9=_0x4b0b[_0xdc7c84];return _0x3ab1f9;};'use strict';var _=require('lodash');var util=require(_0xb4b0('0x0'));var moment=require(_0xb4b0('0x1'));var BPromise=require(_0xb4b0('0x2'));var rs=require(_0xb4b0('0x3'));var fs=require('fs');var Redis=require(_0xb4b0('0x4'));var db=require(_0xb4b0('0x5'))['db'];var utils=require(_0xb4b0('0x6'));var logger=require(_0xb4b0('0x7'))(_0xb4b0('0x8'));var config=require(_0xb4b0('0x9'));var jayson=require(_0xb4b0('0xa'));var client=jayson[_0xb4b0('0xb')][_0xb4b0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ff50e,_0x1be6fe,_0x518587){return new BPromise(function(_0xecedd5,_0x451497){return client[_0xb4b0('0xd')](_0x4ff50e,_0x518587)['then'](function(_0x301b9e){logger[_0xb4b0('0xe')](_0xb4b0('0xf'),_0x1be6fe,_0xb4b0('0x10'));logger['debug'](_0xb4b0('0x11'),_0x1be6fe,_0xb4b0('0x10'),JSON[_0xb4b0('0x12')](_0x301b9e));if(_0x301b9e['error']){if(_0x301b9e[_0xb4b0('0x13')]['code']===0x1f4){logger[_0xb4b0('0x13')](_0xb4b0('0xf'),_0x1be6fe,_0x301b9e[_0xb4b0('0x13')][_0xb4b0('0x14')]);return _0x451497(_0x301b9e[_0xb4b0('0x13')][_0xb4b0('0x14')]);}logger[_0xb4b0('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1be6fe,_0x301b9e[_0xb4b0('0x13')][_0xb4b0('0x14')]);return _0xecedd5(_0x301b9e[_0xb4b0('0x13')]['message']);}else{logger[_0xb4b0('0xe')](_0xb4b0('0xf'),_0x1be6fe,_0xb4b0('0x10'));_0xecedd5(_0x301b9e[_0xb4b0('0x15')][_0xb4b0('0x14')]);}})[_0xb4b0('0x16')](function(_0x54a6e3){logger[_0xb4b0('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1be6fe,_0x54a6e3);_0x451497(_0x54a6e3);});});} \ No newline at end of file +var _0x1020=['AnalyticFieldReport,\x20%s,\x20%s','message','request\x20sent','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1020,0x108));var _0x0102=function(_0x1ebeea,_0x2f54f4){_0x1ebeea=_0x1ebeea-0x0;var _0x576465=_0x1020[_0x1ebeea];return _0x576465;};'use strict';var _=require('lodash');var util=require(_0x0102('0x0'));var moment=require(_0x0102('0x1'));var BPromise=require(_0x0102('0x2'));var rs=require(_0x0102('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0102('0x4'))['db'];var utils=require(_0x0102('0x5'));var logger=require(_0x0102('0x6'))('rpc');var config=require(_0x0102('0x7'));var jayson=require(_0x0102('0x8'));var client=jayson[_0x0102('0x9')][_0x0102('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51af07,_0x3d4b32,_0x2c238a){return new BPromise(function(_0xeda240,_0x3916ff){return client['request'](_0x51af07,_0x2c238a)[_0x0102('0xb')](function(_0x2a6857){logger[_0x0102('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3d4b32,'request\x20sent');logger['debug'](_0x0102('0xd'),_0x3d4b32,'request\x20sent',JSON['stringify'](_0x2a6857));if(_0x2a6857[_0x0102('0xe')]){if(_0x2a6857['error'][_0x0102('0xf')]===0x1f4){logger['error'](_0x0102('0x10'),_0x3d4b32,_0x2a6857[_0x0102('0xe')][_0x0102('0x11')]);return _0x3916ff(_0x2a6857[_0x0102('0xe')][_0x0102('0x11')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x3d4b32,_0x2a6857['error'][_0x0102('0x11')]);return _0xeda240(_0x2a6857[_0x0102('0xe')][_0x0102('0x11')]);}else{logger[_0x0102('0xc')](_0x0102('0x10'),_0x3d4b32,_0x0102('0x12'));_0xeda240(_0x2a6857[_0x0102('0x13')][_0x0102('0x11')]);}})['catch'](function(_0x3a3db6){logger['error'](_0x0102('0x10'),_0x3d4b32,_0x3a3db6);_0x3916ff(_0x3a3db6);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index fc32526..9d972f7 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 _0x55ca=['/:id/create_many','addFields','put','update','delete','bulkDestroy','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','show','post','create','bulkCreate'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x55ca,0x126));var _0xa55c=function(_0x3ceb73,_0x4829e5){_0x3ceb73=_0x3ceb73-0x0;var _0xf8ff4f=_0x55ca[_0x3ceb73];return _0xf8ff4f;};'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('0xb')]('/',auth['isAuthenticated'](),controller[_0xa55c('0xc')]);router[_0xa55c('0xb')]('/create_many',auth['isAuthenticated'](),controller[_0xa55c('0xd')]);router[_0xa55c('0xb')](_0xa55c('0xe'),auth[_0xa55c('0x7')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x10')](_0xa55c('0x9'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')]('/destroy_many',auth['isAuthenticated'](),controller[_0xa55c('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x14')]);module[_0xa55c('0x15')]=router; \ No newline at end of file +var _0x5fc3=['get','isAuthenticated','/:id','show','post','create','/create_many','/:id/create_many','addFields','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticFieldReport.controller'];(function(_0x3f4328,_0x389f8f){var _0x2df80a=function(_0x59b887){while(--_0x59b887){_0x3f4328['push'](_0x3f4328['shift']());}};_0x2df80a(++_0x389f8f);}(_0x5fc3,0xa8));var _0x35fc=function(_0x593d89,_0x45145f){_0x593d89=_0x593d89-0x0;var _0x4aa403=_0x5fc3[_0x593d89];return _0x4aa403;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var auth=require(_0x35fc('0x5'));var interaction=require(_0x35fc('0x6'));var config=require('../../config/environment');var controller=require(_0x35fc('0x7'));router[_0x35fc('0x8')]('/',auth[_0x35fc('0x9')](),controller['index']);router['get'](_0x35fc('0xa'),auth['isAuthenticated'](),controller[_0x35fc('0xb')]);router[_0x35fc('0xc')]('/',auth[_0x35fc('0x9')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xc')](_0x35fc('0xe'),auth[_0x35fc('0x9')](),controller['bulkCreate']);router[_0x35fc('0xc')](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x10')]);router[_0x35fc('0x11')]('/:id',auth[_0x35fc('0x9')](),controller[_0x35fc('0x12')]);router['delete']('/destroy_many',auth[_0x35fc('0x9')](),controller['bulkDestroy']);router[_0x35fc('0x13')](_0x35fc('0xa'),auth[_0x35fc('0x9')](),controller[_0x35fc('0x14')]);module[_0x35fc('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 836965b..b6ad836 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 _0x2bfe=['STRING','sequelize','exports','name'];(function(_0x2ae8ce,_0x2a5a1f){var _0x4bf686=function(_0x41cabf){while(--_0x41cabf){_0x2ae8ce['push'](_0x2ae8ce['shift']());}};_0x4bf686(++_0x2a5a1f);}(_0x2bfe,0x125));var _0xe2bf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x2bfe[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0xe2bf('0x0'));module[_0xe2bf('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe2bf('0x2')},'table':{'type':Sequelize[_0xe2bf('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xe2bf('0x3')]}}; \ No newline at end of file +var _0xb58b=['TEXT','exports','STRING','name'];(function(_0x5deec0,_0x4404cd){var _0x16c3be=function(_0x19dc11){while(--_0x19dc11){_0x5deec0['push'](_0x5deec0['shift']());}};_0x16c3be(++_0x4404cd);}(_0xb58b,0x1f1));var _0xbb58=function(_0x31bde9,_0x438966){_0x31bde9=_0x31bde9-0x0;var _0x76558c=_0xb58b[_0x31bde9];return _0x76558c;};'use strict';var Sequelize=require('sequelize');module[_0xbb58('0x0')]={'name':{'type':Sequelize[_0xbb58('0x1')],'allowNull':![],'unique':_0xbb58('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xbb58('0x3')]},'description':{'type':Sequelize[_0xbb58('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index a1de957..6e302b6 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 _0xfb4a=['order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','include','AnalyticMetric','rows','catch','params','includeAll','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','UserProfileResource','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','jsforce','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','Metrics','destroy','end','sendStatus','error','stack','name','index','keys','query','filters','attributes','intersection','model','fields','length','nolimit'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xfb4a,0xb7));var _0xafb4=function(_0x2b0bc2,_0x4331f5){_0x2b0bc2=_0x2b0bc2-0x0;var _0x56e5b9=_0xfb4a[_0x2b0bc2];return _0x56e5b9;};'use strict';var pdf=require(_0xafb4('0x0'));var emlformat=require(_0xafb4('0x1'));var rimraf=require(_0xafb4('0x2'));var zipdir=require(_0xafb4('0x3'));var jsonpatch=require(_0xafb4('0x4'));var rp=require(_0xafb4('0x5'));var moment=require(_0xafb4('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xafb4('0x7'));var util=require(_0xafb4('0x8'));var path=require(_0xafb4('0x9'));var sox=require(_0xafb4('0xa'));var csv=require(_0xafb4('0xb'));var ejs=require(_0xafb4('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xafb4('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xafb4('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xafb4('0xf'));var hardwareService=require(_0xafb4('0x10'));var logger=require(_0xafb4('0x11'))(_0xafb4('0x12'));var utils=require(_0xafb4('0x13'));var config=require(_0xafb4('0x14'));var db=require(_0xafb4('0x15'))['db'];function respondWithStatusCode(_0x15ce39,_0x3ef447){_0x3ef447=_0x3ef447||0xcc;return function(_0x2e8575){if(_0x2e8575){return _0x15ce39['sendStatus'](_0x3ef447);}return _0x15ce39[_0xafb4('0x16')](_0x3ef447)['end']();};}function respondWithResult(_0x5be648,_0x4321fa){_0x4321fa=_0x4321fa||0xc8;return function(_0xe9f716){if(_0xe9f716){return _0x5be648['status'](_0x4321fa)[_0xafb4('0x17')](_0xe9f716);}};}function respondWithFilteredResult(_0x361eee,_0x2916e4){return function(_0x4c826d){if(_0x4c826d){var _0x4f0a91=_0x4c826d[_0xafb4('0x18')],_0x139b14=_0x2916e4['offset'],_0x29db04=_0x2916e4[_0xafb4('0x19')]+_0x2916e4[_0xafb4('0x1a')],_0x477e34;if(_0x29db04>=_0x4f0a91){_0x29db04=_0x4f0a91;_0x477e34=0xc8;}else{_0x477e34=0xce;}_0x361eee[_0xafb4('0x16')](_0x477e34);return _0x361eee[_0xafb4('0x1b')](_0xafb4('0x1c'),_0x139b14+'-'+_0x29db04+'/'+_0x4f0a91)[_0xafb4('0x17')](_0x4c826d);}return null;};}function patchUpdates(_0x5acef4){return function(_0x2e9c7d){try{jsonpatch[_0xafb4('0x1d')](_0x2e9c7d,_0x5acef4,!![]);}catch(_0x28c458){return BPromise[_0xafb4('0x1e')](_0x28c458);}return _0x2e9c7d[_0xafb4('0x1f')]();};}function saveUpdates(_0x35c3b6,_0x17aa59){return function(_0x2be1d3){if(_0x2be1d3){return _0x2be1d3[_0xafb4('0x20')](_0x35c3b6)[_0xafb4('0x21')](function(_0x4f4db5){return _0x4f4db5;});}return null;};}function removeEntity(_0x32c0d3,_0x21c822){return function(_0x541f83){if(_0x541f83){return _0x541f83['destroy']()[_0xafb4('0x21')](function(){var _0x4c467f=_0x541f83['get']({'plain':!![]});var _0x2e3658=_0xafb4('0x22');return db['UserProfileResource'][_0xafb4('0x23')]({'where':{'type':_0x2e3658,'resourceId':_0x4c467f['id']}})['then'](function(){return _0x541f83;});})[_0xafb4('0x21')](function(){_0x32c0d3['status'](0xcc)[_0xafb4('0x24')]();});}};}function handleEntityNotFound(_0x53291a,_0x1c2344){return function(_0x215250){if(!_0x215250){_0x53291a[_0xafb4('0x25')](0x194);}return _0x215250;};}function handleError(_0x49d625,_0x3fe567){_0x3fe567=_0x3fe567||0x1f4;return function(_0x2721f6){logger[_0xafb4('0x26')](_0x2721f6[_0xafb4('0x27')]);if(_0x2721f6[_0xafb4('0x28')]){delete _0x2721f6[_0xafb4('0x28')];}_0x49d625['status'](_0x3fe567)['send'](_0x2721f6);};}exports[_0xafb4('0x29')]=function(_0x557775,_0x358c0c){var _0x356904={},_0x54df93={},_0x310acb={'count':0x0,'rows':[]};var _0x10a650=db['AnalyticMetric']['rawAttributes'];_0x54df93['model']=_[_0xafb4('0x2a')](_0x10a650);_0x54df93[_0xafb4('0x2b')]=_['keys'](_0x557775[_0xafb4('0x2b')]);_0x54df93[_0xafb4('0x2c')]=_['intersection'](_0x54df93['model'],_0x54df93[_0xafb4('0x2b')]);_0x356904[_0xafb4('0x2d')]=_[_0xafb4('0x2e')](_0x54df93[_0xafb4('0x2f')],qs[_0xafb4('0x30')](_0x557775[_0xafb4('0x2b')][_0xafb4('0x30')]));_0x356904['attributes']=_0x356904[_0xafb4('0x2d')][_0xafb4('0x31')]?_0x356904['attributes']:_0x54df93[_0xafb4('0x2f')];if(!_0x557775['query']['hasOwnProperty'](_0xafb4('0x32'))){_0x356904['limit']=qs['limit'](_0x557775['query'][_0xafb4('0x1a')]);_0x356904[_0xafb4('0x19')]=qs[_0xafb4('0x19')](_0x557775[_0xafb4('0x2b')][_0xafb4('0x19')]);}_0x356904[_0xafb4('0x33')]=qs[_0xafb4('0x34')](_0x557775[_0xafb4('0x2b')][_0xafb4('0x34')]);_0x356904[_0xafb4('0x35')]=qs[_0xafb4('0x2c')](_[_0xafb4('0x36')](_0x557775[_0xafb4('0x2b')],_0x54df93[_0xafb4('0x2c')]));if(_0x557775[_0xafb4('0x2b')][_0xafb4('0x37')]){_0x356904[_0xafb4('0x35')]=_[_0xafb4('0x38')](_0x356904[_0xafb4('0x35')],{'$or':_[_0xafb4('0x39')](_0x10a650,function(_0x227392){if(_0x227392[_0xafb4('0x3a')][_0xafb4('0x3b')]!==_0xafb4('0x3c')){var _0x3f1a7b={};_0x3f1a7b[_0x227392[_0xafb4('0x3d')]]={'$like':'%'+_0x557775[_0xafb4('0x2b')][_0xafb4('0x37')]+'%'};return _0x3f1a7b;}})});}_0x356904=_[_0xafb4('0x38')]({},_0x356904,_0x557775['options']);var _0x472e81={'where':_0x356904['where']};return db['AnalyticMetric']['count'](_0x472e81)[_0xafb4('0x21')](function(_0x2797ab){_0x310acb[_0xafb4('0x18')]=_0x2797ab;if(_0x557775[_0xafb4('0x2b')]['includeAll']){_0x356904[_0xafb4('0x3e')]=[{'all':!![]}];}return db[_0xafb4('0x3f')]['findAll'](_0x356904);})['then'](function(_0x49c7ba){_0x310acb[_0xafb4('0x40')]=_0x49c7ba;return _0x310acb;})[_0xafb4('0x21')](respondWithFilteredResult(_0x358c0c,_0x356904))[_0xafb4('0x41')](handleError(_0x358c0c,null));};exports['show']=function(_0x1769fc,_0x5e9e62){var _0x177444={'raw':!![],'where':{'id':_0x1769fc[_0xafb4('0x42')]['id']}},_0x2935b7={};_0x2935b7['model']=_[_0xafb4('0x2a')](db[_0xafb4('0x3f')]['rawAttributes']);_0x2935b7[_0xafb4('0x2b')]=_[_0xafb4('0x2a')](_0x1769fc[_0xafb4('0x2b')]);_0x2935b7[_0xafb4('0x2c')]=_[_0xafb4('0x2e')](_0x2935b7[_0xafb4('0x2f')],_0x2935b7[_0xafb4('0x2b')]);_0x177444['attributes']=_[_0xafb4('0x2e')](_0x2935b7[_0xafb4('0x2f')],qs[_0xafb4('0x30')](_0x1769fc[_0xafb4('0x2b')][_0xafb4('0x30')]));_0x177444['attributes']=_0x177444[_0xafb4('0x2d')][_0xafb4('0x31')]?_0x177444['attributes']:_0x2935b7[_0xafb4('0x2f')];if(_0x1769fc['query'][_0xafb4('0x43')]){_0x177444[_0xafb4('0x3e')]=[{'all':!![]}];}_0x177444=_[_0xafb4('0x38')]({},_0x177444,_0x1769fc[_0xafb4('0x44')]);return db[_0xafb4('0x3f')]['find'](_0x177444)[_0xafb4('0x21')](handleEntityNotFound(_0x5e9e62,null))['then'](respondWithResult(_0x5e9e62,null))[_0xafb4('0x41')](handleError(_0x5e9e62,null));};exports[_0xafb4('0x45')]=function(_0x3199ee,_0xb5bd33){return db[_0xafb4('0x3f')][_0xafb4('0x45')](_0x3199ee[_0xafb4('0x46')],{})[_0xafb4('0x21')](function(_0x49fe33){var _0xc98881=_0x3199ee[_0xafb4('0x47')][_0xafb4('0x48')]({'plain':!![]});if(!_0xc98881)throw new Error(_0xafb4('0x49'));if(_0xc98881['role']===_0xafb4('0x47')){var _0x125320=_0x49fe33[_0xafb4('0x48')]({'plain':!![]});var _0x221887='Metrics';return db[_0xafb4('0x4a')][_0xafb4('0x4b')]({'where':{'name':_0x221887,'userProfileId':_0xc98881[_0xafb4('0x4c')]},'raw':!![]})[_0xafb4('0x21')](function(_0x8c0fe1){if(_0x8c0fe1&&_0x8c0fe1['autoAssociation']===0x0){return db[_0xafb4('0x4d')][_0xafb4('0x45')]({'name':_0x125320[_0xafb4('0x28')],'resourceId':_0x125320['id'],'type':_0x8c0fe1[_0xafb4('0x28')],'sectionId':_0x8c0fe1['id']},{})[_0xafb4('0x21')](function(){return _0x49fe33;});}else{return _0x49fe33;}})[_0xafb4('0x41')](function(_0x2dee72){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2dee72);throw _0x2dee72;});}return _0x49fe33;})[_0xafb4('0x21')](respondWithResult(_0xb5bd33,0xc9))[_0xafb4('0x41')](handleError(_0xb5bd33,null));};exports[_0xafb4('0x20')]=function(_0x11c00f,_0x61981a){if(_0x11c00f['body']['id']){delete _0x11c00f[_0xafb4('0x46')]['id'];}return db['AnalyticMetric'][_0xafb4('0x4b')]({'where':{'id':_0x11c00f['params']['id']}})[_0xafb4('0x21')](handleEntityNotFound(_0x61981a,null))[_0xafb4('0x21')](saveUpdates(_0x11c00f[_0xafb4('0x46')],null))[_0xafb4('0x21')](respondWithResult(_0x61981a,null))['catch'](handleError(_0x61981a,null));};exports[_0xafb4('0x23')]=function(_0x11cf30,_0x2446a0){return db[_0xafb4('0x3f')][_0xafb4('0x4b')]({'where':{'id':_0x11cf30['params']['id']}})[_0xafb4('0x21')](handleEntityNotFound(_0x2446a0,null))[_0xafb4('0x21')](removeEntity(_0x2446a0,null))[_0xafb4('0x41')](handleError(_0x2446a0,null));}; \ No newline at end of file +var _0x2545=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','update','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','save','destroy','then','get','Metrics','error','stack','name','AnalyticMetric','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','catch','show','params','find','create','body','user'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x2545,0x9a));var _0x5254=function(_0x485ef7,_0x35212a){_0x485ef7=_0x485ef7-0x0;var _0x3a0ec4=_0x2545[_0x485ef7];return _0x3a0ec4;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5254('0x0'));var rp=require(_0x5254('0x1'));var moment=require(_0x5254('0x2'));var BPromise=require(_0x5254('0x3'));var Mustache=require(_0x5254('0x4'));var util=require(_0x5254('0x5'));var path=require(_0x5254('0x6'));var sox=require(_0x5254('0x7'));var csv=require(_0x5254('0x8'));var ejs=require(_0x5254('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5254('0xa'));var crypto=require(_0x5254('0xb'));var jsforce=require(_0x5254('0xc'));var deskjs=require(_0x5254('0xd'));var toCsv=require(_0x5254('0x8'));var querystring=require(_0x5254('0xe'));var Papa=require('papaparse');var Redis=require(_0x5254('0xf'));var authService=require(_0x5254('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5254('0x11'))('api');var utils=require(_0x5254('0x12'));var config=require(_0x5254('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bc882,_0x361c62){_0x361c62=_0x361c62||0xcc;return function(_0x16e6f9){if(_0x16e6f9){return _0x2bc882[_0x5254('0x14')](_0x361c62);}return _0x2bc882[_0x5254('0x15')](_0x361c62)[_0x5254('0x16')]();};}function respondWithResult(_0x14f5b4,_0x221805){_0x221805=_0x221805||0xc8;return function(_0x3cd5ca){if(_0x3cd5ca){return _0x14f5b4['status'](_0x221805)['json'](_0x3cd5ca);}};}function respondWithFilteredResult(_0x36d888,_0x54724e){return function(_0x26669f){if(_0x26669f){var _0xd162ef=_0x26669f[_0x5254('0x17')],_0x71b551=_0x54724e['offset'],_0x44d48a=_0x54724e[_0x5254('0x18')]+_0x54724e[_0x5254('0x19')],_0x127b11;if(_0x44d48a>=_0xd162ef){_0x44d48a=_0xd162ef;_0x127b11=0xc8;}else{_0x127b11=0xce;}_0x36d888['status'](_0x127b11);return _0x36d888[_0x5254('0x1a')](_0x5254('0x1b'),_0x71b551+'-'+_0x44d48a+'/'+_0xd162ef)['json'](_0x26669f);}return null;};}function patchUpdates(_0x482c8e){return function(_0x33b534){try{jsonpatch[_0x5254('0x1c')](_0x33b534,_0x482c8e,!![]);}catch(_0x38efd2){return BPromise['reject'](_0x38efd2);}return _0x33b534[_0x5254('0x1d')]();};}function saveUpdates(_0x1b3f9e,_0x43ee02){return function(_0x3538c1){if(_0x3538c1){return _0x3538c1['update'](_0x1b3f9e)['then'](function(_0x1653b3){return _0x1653b3;});}return null;};}function removeEntity(_0x30bb89,_0x527221){return function(_0x456ac0){if(_0x456ac0){return _0x456ac0[_0x5254('0x1e')]()[_0x5254('0x1f')](function(){var _0x2c9da3=_0x456ac0[_0x5254('0x20')]({'plain':!![]});var _0x47ad31=_0x5254('0x21');return db['UserProfileResource'][_0x5254('0x1e')]({'where':{'type':_0x47ad31,'resourceId':_0x2c9da3['id']}})[_0x5254('0x1f')](function(){return _0x456ac0;});})[_0x5254('0x1f')](function(){_0x30bb89[_0x5254('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43b900,_0x4c34c5){return function(_0x3cb33b){if(!_0x3cb33b){_0x43b900[_0x5254('0x14')](0x194);}return _0x3cb33b;};}function handleError(_0x3b8634,_0x45f943){_0x45f943=_0x45f943||0x1f4;return function(_0x3cb632){logger[_0x5254('0x22')](_0x3cb632[_0x5254('0x23')]);if(_0x3cb632[_0x5254('0x24')]){delete _0x3cb632[_0x5254('0x24')];}_0x3b8634['status'](_0x45f943)['send'](_0x3cb632);};}exports['index']=function(_0x3c0441,_0x30d640){var _0x290f19={},_0x44cd66={},_0x56f306={'count':0x0,'rows':[]};var _0x703604=db[_0x5254('0x25')][_0x5254('0x26')];_0x44cd66[_0x5254('0x27')]=_[_0x5254('0x28')](_0x703604);_0x44cd66[_0x5254('0x29')]=_[_0x5254('0x28')](_0x3c0441['query']);_0x44cd66[_0x5254('0x2a')]=_['intersection'](_0x44cd66[_0x5254('0x27')],_0x44cd66[_0x5254('0x29')]);_0x290f19['attributes']=_[_0x5254('0x2b')](_0x44cd66['model'],qs[_0x5254('0x2c')](_0x3c0441[_0x5254('0x29')]['fields']));_0x290f19[_0x5254('0x2d')]=_0x290f19[_0x5254('0x2d')][_0x5254('0x2e')]?_0x290f19[_0x5254('0x2d')]:_0x44cd66[_0x5254('0x27')];if(!_0x3c0441[_0x5254('0x29')][_0x5254('0x2f')](_0x5254('0x30'))){_0x290f19[_0x5254('0x19')]=qs[_0x5254('0x19')](_0x3c0441[_0x5254('0x29')]['limit']);_0x290f19[_0x5254('0x18')]=qs[_0x5254('0x18')](_0x3c0441['query']['offset']);}_0x290f19['order']=qs[_0x5254('0x31')](_0x3c0441[_0x5254('0x29')][_0x5254('0x31')]);_0x290f19[_0x5254('0x32')]=qs[_0x5254('0x2a')](_['pick'](_0x3c0441[_0x5254('0x29')],_0x44cd66[_0x5254('0x2a')]));if(_0x3c0441[_0x5254('0x29')][_0x5254('0x33')]){_0x290f19[_0x5254('0x32')]=_[_0x5254('0x34')](_0x290f19[_0x5254('0x32')],{'$or':_[_0x5254('0x35')](_0x703604,function(_0x372cd4){if(_0x372cd4['type'][_0x5254('0x36')]!==_0x5254('0x37')){var _0x28944e={};_0x28944e[_0x372cd4[_0x5254('0x38')]]={'$like':'%'+_0x3c0441[_0x5254('0x29')]['filter']+'%'};return _0x28944e;}})});}_0x290f19=_['merge']({},_0x290f19,_0x3c0441[_0x5254('0x39')]);var _0x48dc69={'where':_0x290f19['where']};return db[_0x5254('0x25')]['count'](_0x48dc69)[_0x5254('0x1f')](function(_0x9be683){_0x56f306[_0x5254('0x17')]=_0x9be683;if(_0x3c0441[_0x5254('0x29')][_0x5254('0x3a')]){_0x290f19[_0x5254('0x3b')]=[{'all':!![]}];}return db[_0x5254('0x25')][_0x5254('0x3c')](_0x290f19);})['then'](function(_0xc212b5){_0x56f306['rows']=_0xc212b5;return _0x56f306;})[_0x5254('0x1f')](respondWithFilteredResult(_0x30d640,_0x290f19))[_0x5254('0x3d')](handleError(_0x30d640,null));};exports[_0x5254('0x3e')]=function(_0x510ee9,_0x4b0417){var _0x1e3aee={'raw':!![],'where':{'id':_0x510ee9[_0x5254('0x3f')]['id']}},_0x1472e2={};_0x1472e2[_0x5254('0x27')]=_[_0x5254('0x28')](db[_0x5254('0x25')]['rawAttributes']);_0x1472e2[_0x5254('0x29')]=_['keys'](_0x510ee9[_0x5254('0x29')]);_0x1472e2[_0x5254('0x2a')]=_[_0x5254('0x2b')](_0x1472e2[_0x5254('0x27')],_0x1472e2['query']);_0x1e3aee[_0x5254('0x2d')]=_['intersection'](_0x1472e2[_0x5254('0x27')],qs[_0x5254('0x2c')](_0x510ee9[_0x5254('0x29')]['fields']));_0x1e3aee[_0x5254('0x2d')]=_0x1e3aee[_0x5254('0x2d')][_0x5254('0x2e')]?_0x1e3aee[_0x5254('0x2d')]:_0x1472e2[_0x5254('0x27')];if(_0x510ee9[_0x5254('0x29')][_0x5254('0x3a')]){_0x1e3aee['include']=[{'all':!![]}];}_0x1e3aee=_['merge']({},_0x1e3aee,_0x510ee9[_0x5254('0x39')]);return db[_0x5254('0x25')][_0x5254('0x40')](_0x1e3aee)[_0x5254('0x1f')](handleEntityNotFound(_0x4b0417,null))[_0x5254('0x1f')](respondWithResult(_0x4b0417,null))[_0x5254('0x3d')](handleError(_0x4b0417,null));};exports[_0x5254('0x41')]=function(_0x105744,_0x510399){return db[_0x5254('0x25')][_0x5254('0x41')](_0x105744[_0x5254('0x42')],{})[_0x5254('0x1f')](function(_0x328942){var _0x2e4d38=_0x105744[_0x5254('0x43')][_0x5254('0x20')]({'plain':!![]});if(!_0x2e4d38)throw new Error(_0x5254('0x44'));if(_0x2e4d38[_0x5254('0x45')]===_0x5254('0x43')){var _0x2b1f52=_0x328942[_0x5254('0x20')]({'plain':!![]});var _0x19b441=_0x5254('0x21');return db[_0x5254('0x46')][_0x5254('0x40')]({'where':{'name':_0x19b441,'userProfileId':_0x2e4d38['userProfileId']},'raw':!![]})[_0x5254('0x1f')](function(_0x385262){if(_0x385262&&_0x385262[_0x5254('0x47')]===0x0){return db[_0x5254('0x48')]['create']({'name':_0x2b1f52[_0x5254('0x24')],'resourceId':_0x2b1f52['id'],'type':_0x385262[_0x5254('0x24')],'sectionId':_0x385262['id']},{})[_0x5254('0x1f')](function(){return _0x328942;});}else{return _0x328942;}})[_0x5254('0x3d')](function(_0x412c39){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x412c39);throw _0x412c39;});}return _0x328942;})[_0x5254('0x1f')](respondWithResult(_0x510399,0xc9))[_0x5254('0x3d')](handleError(_0x510399,null));};exports[_0x5254('0x49')]=function(_0x3f2cfc,_0x3556d2){if(_0x3f2cfc['body']['id']){delete _0x3f2cfc[_0x5254('0x42')]['id'];}return db[_0x5254('0x25')]['find']({'where':{'id':_0x3f2cfc[_0x5254('0x3f')]['id']}})[_0x5254('0x1f')](handleEntityNotFound(_0x3556d2,null))[_0x5254('0x1f')](saveUpdates(_0x3f2cfc[_0x5254('0x42')],null))[_0x5254('0x1f')](respondWithResult(_0x3556d2,null))[_0x5254('0x3d')](handleError(_0x3556d2,null));};exports[_0x5254('0x1e')]=function(_0x4bde23,_0x2dd0e4){return db['AnalyticMetric']['find']({'where':{'id':_0x4bde23['params']['id']}})['then'](handleEntityNotFound(_0x2dd0e4,null))[_0x5254('0x1f')](removeEntity(_0x2dd0e4,null))[_0x5254('0x3d')](handleError(_0x2dd0e4,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 33ccf25..f24d53b 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 _0xff98=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash'];(function(_0x3098fc,_0x15c07d){var _0x541a38=function(_0x292f70){while(--_0x292f70){_0x3098fc['push'](_0x3098fc['shift']());}};_0x541a38(++_0x15c07d);}(_0xff98,0xfb));var _0x8ff9=function(_0x41804f,_0x3d1cac){_0x41804f=_0x41804f-0x0;var _0x29686=_0xff98[_0x41804f];return _0x29686;};'use strict';var _=require(_0x8ff9('0x0'));var util=require(_0x8ff9('0x1'));var logger=require(_0x8ff9('0x2'))(_0x8ff9('0x3'));var moment=require(_0x8ff9('0x4'));var BPromise=require(_0x8ff9('0x5'));var rp=require(_0x8ff9('0x6'));var fs=require('fs');var path=require(_0x8ff9('0x7'));var rimraf=require(_0x8ff9('0x8'));var config=require(_0x8ff9('0x9'));var attributes=require(_0x8ff9('0xa'));module[_0x8ff9('0xb')]=function(_0x1f9507,_0x589e28){return _0x1f9507[_0x8ff9('0xc')](_0x8ff9('0xd'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0862=['bluebird','request-promise','path','exports','define','analytics_metrics','lodash','api','moment'];(function(_0x2dbcc8,_0x5e6b9a){var _0x4e0a07=function(_0x79cfc8){while(--_0x79cfc8){_0x2dbcc8['push'](_0x2dbcc8['shift']());}};_0x4e0a07(++_0x5e6b9a);}(_0x0862,0x165));var _0x2086=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x0862[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x2086('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2086('0x1'));var moment=require(_0x2086('0x2'));var BPromise=require(_0x2086('0x3'));var rp=require(_0x2086('0x4'));var fs=require('fs');var path=require(_0x2086('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x2086('0x6')]=function(_0x2f0d74,_0xf58eb4){return _0x2f0d74[_0x2086('0x7')]('AnalyticMetric',attributes,{'tableName':_0x2086('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 669d1c4..429e0af 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 _0x4ac3=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3050ca,_0x3e36b0){var _0x1eed1d=function(_0x195e8f){while(--_0x195e8f){_0x3050ca['push'](_0x3050ca['shift']());}};_0x1eed1d(++_0x3e36b0);}(_0x4ac3,0x1f4));var _0x34ac=function(_0xfcf2a9,_0x21dea2){_0xfcf2a9=_0xfcf2a9-0x0;var _0x28d144=_0x4ac3[_0xfcf2a9];return _0x28d144;};'use strict';var _=require(_0x34ac('0x0'));var util=require(_0x34ac('0x1'));var moment=require(_0x34ac('0x2'));var BPromise=require(_0x34ac('0x3'));var rs=require(_0x34ac('0x4'));var fs=require('fs');var Redis=require(_0x34ac('0x5'));var db=require(_0x34ac('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x34ac('0x7'))(_0x34ac('0x8'));var config=require(_0x34ac('0x9'));var jayson=require(_0x34ac('0xa'));var client=jayson[_0x34ac('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c300f,_0x3684eb,_0x439f10){return new BPromise(function(_0x107fd0,_0x166f5a){return client[_0x34ac('0xc')](_0x4c300f,_0x439f10)[_0x34ac('0xd')](function(_0x269f1a){logger[_0x34ac('0xe')](_0x34ac('0xf'),_0x3684eb,'request\x20sent');logger[_0x34ac('0x10')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x3684eb,_0x34ac('0x11'),JSON[_0x34ac('0x12')](_0x269f1a));if(_0x269f1a[_0x34ac('0x13')]){if(_0x269f1a[_0x34ac('0x13')][_0x34ac('0x14')]===0x1f4){logger[_0x34ac('0x13')](_0x34ac('0xf'),_0x3684eb,_0x269f1a[_0x34ac('0x13')][_0x34ac('0x15')]);return _0x166f5a(_0x269f1a['error'][_0x34ac('0x15')]);}logger[_0x34ac('0x13')](_0x34ac('0xf'),_0x3684eb,_0x269f1a[_0x34ac('0x13')][_0x34ac('0x15')]);return _0x107fd0(_0x269f1a[_0x34ac('0x13')][_0x34ac('0x15')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x3684eb,_0x34ac('0x11'));_0x107fd0(_0x269f1a[_0x34ac('0x16')][_0x34ac('0x15')]);}})[_0x34ac('0x17')](function(_0x22a1e5){logger[_0x34ac('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x3684eb,_0x22a1e5);_0x166f5a(_0x22a1e5);});});} \ No newline at end of file +var _0x87d1=['request','then','info','debug','request\x20sent','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','result','lodash','util','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise'];(function(_0x377d80,_0x192116){var _0x578f9a=function(_0x254229){while(--_0x254229){_0x377d80['push'](_0x377d80['shift']());}};_0x578f9a(++_0x192116);}(_0x87d1,0x1d5));var _0x187d=function(_0x304fff,_0x129851){_0x304fff=_0x304fff-0x0;var _0x278ab4=_0x87d1[_0x304fff];return _0x278ab4;};'use strict';var _=require(_0x187d('0x0'));var util=require(_0x187d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x187d('0x2'));var fs=require('fs');var Redis=require(_0x187d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x187d('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x187d('0x5'));var jayson=require(_0x187d('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x100aff,_0x3e32c9,_0x56120a){return new BPromise(function(_0x10bbae,_0x59c2ed){return client[_0x187d('0x7')](_0x100aff,_0x56120a)[_0x187d('0x8')](function(_0x242d81){logger[_0x187d('0x9')]('AnalyticMetric,\x20%s,\x20%s',_0x3e32c9,'request\x20sent');logger[_0x187d('0xa')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x3e32c9,_0x187d('0xb'),JSON[_0x187d('0xc')](_0x242d81));if(_0x242d81['error']){if(_0x242d81['error']['code']===0x1f4){logger[_0x187d('0xd')](_0x187d('0xe'),_0x3e32c9,_0x242d81['error'][_0x187d('0xf')]);return _0x59c2ed(_0x242d81['error'][_0x187d('0xf')]);}logger[_0x187d('0xd')](_0x187d('0xe'),_0x3e32c9,_0x242d81['error'][_0x187d('0xf')]);return _0x10bbae(_0x242d81[_0x187d('0xd')][_0x187d('0xf')]);}else{logger['info'](_0x187d('0xe'),_0x3e32c9,_0x187d('0xb'));_0x10bbae(_0x242d81[_0x187d('0x10')][_0x187d('0xf')]);}})['catch'](function(_0x3c23a2){logger['error'](_0x187d('0xe'),_0x3e32c9,_0x3c23a2);_0x59c2ed(_0x3c23a2);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index fbf8bc1..49962f9 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 _0xadb5=['destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete'];(function(_0x134dc9,_0x14fa4f){var _0x1b4b52=function(_0x50e179){while(--_0x50e179){_0x134dc9['push'](_0x134dc9['shift']());}};_0x1b4b52(++_0x14fa4f);}(_0xadb5,0xad));var _0x5adb=function(_0x20fc7c,_0x41be51){_0x20fc7c=_0x20fc7c-0x0;var _0x3b86d4=_0xadb5[_0x20fc7c];return _0x3b86d4;};'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('0xc')]('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xa'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xf')]);router[_0x5adb('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5adb('0x11')]);module[_0x5adb('0x12')]=router; \ No newline at end of file +var _0x57ca=['isAuthenticated','index','/:id','show','post','create','delete','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x4b0388,_0x3749fb){var _0x5c3406=function(_0x446f91){while(--_0x446f91){_0x4b0388['push'](_0x4b0388['shift']());}};_0x5c3406(++_0x3749fb);}(_0x57ca,0x108));var _0xa57c=function(_0x2b08e4,_0x25d3c8){_0x2b08e4=_0x2b08e4-0x0;var _0x5f0526=_0x57ca[_0x2b08e4];return _0x5f0526;};'use strict';var multer=require('multer');var util=require(_0xa57c('0x0'));var path=require(_0xa57c('0x1'));var timeout=require('connect-timeout');var express=require(_0xa57c('0x2'));var router=express[_0xa57c('0x3')]();var auth=require(_0xa57c('0x4'));var interaction=require(_0xa57c('0x5'));var config=require(_0xa57c('0x6'));var controller=require('./analyticMetric.controller');router[_0xa57c('0x7')]('/',auth[_0xa57c('0x8')](),controller[_0xa57c('0x9')]);router[_0xa57c('0x7')](_0xa57c('0xa'),auth[_0xa57c('0x8')](),controller[_0xa57c('0xb')]);router[_0xa57c('0xc')]('/',auth['isAuthenticated'](),controller[_0xa57c('0xd')]);router['put'](_0xa57c('0xa'),auth[_0xa57c('0x8')](),controller['update']);router[_0xa57c('0xe')]('/:id',auth[_0xa57c('0x8')](),controller[_0xa57c('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index d7cdad9..8548dee 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 _0xa1b4=['exports','TEXT','sequelize'];(function(_0x5a2660,_0x52e389){var _0x542d3b=function(_0x15a105){while(--_0x15a105){_0x5a2660['push'](_0x5a2660['shift']());}};_0x542d3b(++_0x52e389);}(_0xa1b4,0xa4));var _0x4a1b=function(_0x51ed62,_0x574379){_0x51ed62=_0x51ed62-0x0;var _0x34aee3=_0xa1b4[_0x51ed62];return _0x34aee3;};'use strict';var Sequelize=require(_0x4a1b('0x0'));module[_0x4a1b('0x1')]={'tree':{'type':Sequelize[_0x4a1b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x0952=['sequelize','exports'];(function(_0x2545d2,_0x123a9f){var _0x157087=function(_0x2492fb){while(--_0x2492fb){_0x2545d2['push'](_0x2545d2['shift']());}};_0x157087(++_0x123a9f);}(_0x0952,0x106));var _0x2095=function(_0x444767,_0x14a9ff){_0x444767=_0x444767-0x0;var _0x495688=_0x0952[_0x444767];return _0x495688;};'use strict';var Sequelize=require(_0x2095('0x0'));module[_0x2095('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index be1d43b..f14e045 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 _0x3710=['sendStatus','status','json','count','offset','limit','set','reject','save','update','destroy','then','end','stack','send','index','AnalyticTreeReport','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','VIRTUAL','field','include','findAll','rows','show','params','includeAll','options','find','catch','create','body','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment'];(function(_0x673722,_0x275d7e){var _0x21249c=function(_0x25b4e7){while(--_0x25b4e7){_0x673722['push'](_0x673722['shift']());}};_0x21249c(++_0x275d7e);}(_0x3710,0x17e));var _0x0371=function(_0x3fb1eb,_0xc06a6a){_0x3fb1eb=_0x3fb1eb-0x0;var _0x3ca591=_0x3710[_0x3fb1eb];return _0x3ca591;};'use strict';var pdf=require(_0x0371('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0371('0x1'));var jsonpatch=require(_0x0371('0x2'));var rp=require('request-promise');var moment=require(_0x0371('0x3'));var BPromise=require(_0x0371('0x4'));var Mustache=require(_0x0371('0x5'));var util=require(_0x0371('0x6'));var path=require(_0x0371('0x7'));var sox=require('sox');var csv=require(_0x0371('0x8'));var ejs=require(_0x0371('0x9'));var fs=require('fs');var _=require(_0x0371('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0371('0xb'));var toCsv=require(_0x0371('0x8'));var querystring=require(_0x0371('0xc'));var Papa=require(_0x0371('0xd'));var Redis=require(_0x0371('0xe'));var authService=require(_0x0371('0xf'));var qs=require(_0x0371('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0371('0x11'))('api');var utils=require(_0x0371('0x12'));var config=require(_0x0371('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56050f,_0x43c9d5){_0x43c9d5=_0x43c9d5||0xcc;return function(_0x439cf8){if(_0x439cf8){return _0x56050f[_0x0371('0x14')](_0x43c9d5);}return _0x56050f[_0x0371('0x15')](_0x43c9d5)['end']();};}function respondWithResult(_0x4cdcb2,_0x2376ae){_0x2376ae=_0x2376ae||0xc8;return function(_0x11db23){if(_0x11db23){return _0x4cdcb2[_0x0371('0x15')](_0x2376ae)[_0x0371('0x16')](_0x11db23);}};}function respondWithFilteredResult(_0x33fcb6,_0x27814b){return function(_0x527b8f){if(_0x527b8f){var _0x27a009=_0x527b8f[_0x0371('0x17')],_0x157fc1=_0x27814b[_0x0371('0x18')],_0x2646b6=_0x27814b['offset']+_0x27814b[_0x0371('0x19')],_0x13bd47;if(_0x2646b6>=_0x27a009){_0x2646b6=_0x27a009;_0x13bd47=0xc8;}else{_0x13bd47=0xce;}_0x33fcb6['status'](_0x13bd47);return _0x33fcb6[_0x0371('0x1a')]('Content-Range',_0x157fc1+'-'+_0x2646b6+'/'+_0x27a009)[_0x0371('0x16')](_0x527b8f);}return null;};}function patchUpdates(_0x4e3d35){return function(_0xfc2045){try{jsonpatch['apply'](_0xfc2045,_0x4e3d35,!![]);}catch(_0x4a9883){return BPromise[_0x0371('0x1b')](_0x4a9883);}return _0xfc2045[_0x0371('0x1c')]();};}function saveUpdates(_0x51cf8b,_0xc70dbc){return function(_0x213939){if(_0x213939){return _0x213939[_0x0371('0x1d')](_0x51cf8b)['then'](function(_0x245204){return _0x245204;});}return null;};}function removeEntity(_0x3f8a35,_0x1126d6){return function(_0x497cf2){if(_0x497cf2){return _0x497cf2[_0x0371('0x1e')]()[_0x0371('0x1f')](function(){_0x3f8a35[_0x0371('0x15')](0xcc)[_0x0371('0x20')]();});}};}function handleEntityNotFound(_0x531c88,_0x472d27){return function(_0x41b2a8){if(!_0x41b2a8){_0x531c88[_0x0371('0x14')](0x194);}return _0x41b2a8;};}function handleError(_0x4ef59f,_0x2084e3){_0x2084e3=_0x2084e3||0x1f4;return function(_0x123232){logger['error'](_0x123232[_0x0371('0x21')]);if(_0x123232['name']){delete _0x123232['name'];}_0x4ef59f[_0x0371('0x15')](_0x2084e3)[_0x0371('0x22')](_0x123232);};}exports[_0x0371('0x23')]=function(_0x335c3b,_0x448801){var _0x103f1d={},_0x55a805={},_0x1bdc8c={'count':0x0,'rows':[]};var _0x310e35=db[_0x0371('0x24')][_0x0371('0x25')];_0x55a805['model']=_[_0x0371('0x26')](_0x310e35);_0x55a805['query']=_[_0x0371('0x26')](_0x335c3b[_0x0371('0x27')]);_0x55a805[_0x0371('0x28')]=_[_0x0371('0x29')](_0x55a805[_0x0371('0x2a')],_0x55a805[_0x0371('0x27')]);_0x103f1d['attributes']=_[_0x0371('0x29')](_0x55a805[_0x0371('0x2a')],qs[_0x0371('0x2b')](_0x335c3b[_0x0371('0x27')][_0x0371('0x2b')]));_0x103f1d['attributes']=_0x103f1d[_0x0371('0x2c')][_0x0371('0x2d')]?_0x103f1d[_0x0371('0x2c')]:_0x55a805[_0x0371('0x2a')];if(!_0x335c3b[_0x0371('0x27')][_0x0371('0x2e')](_0x0371('0x2f'))){_0x103f1d[_0x0371('0x19')]=qs[_0x0371('0x19')](_0x335c3b[_0x0371('0x27')][_0x0371('0x19')]);_0x103f1d[_0x0371('0x18')]=qs[_0x0371('0x18')](_0x335c3b[_0x0371('0x27')][_0x0371('0x18')]);}_0x103f1d[_0x0371('0x30')]=qs[_0x0371('0x31')](_0x335c3b[_0x0371('0x27')][_0x0371('0x31')]);_0x103f1d['where']=qs[_0x0371('0x28')](_['pick'](_0x335c3b[_0x0371('0x27')],_0x55a805[_0x0371('0x28')]));if(_0x335c3b[_0x0371('0x27')][_0x0371('0x32')]){_0x103f1d[_0x0371('0x33')]=_[_0x0371('0x34')](_0x103f1d[_0x0371('0x33')],{'$or':_[_0x0371('0x35')](_0x310e35,function(_0x589fce){if(_0x589fce['type']['key']!==_0x0371('0x36')){var _0x43342b={};_0x43342b[_0x589fce[_0x0371('0x37')]]={'$like':'%'+_0x335c3b[_0x0371('0x27')][_0x0371('0x32')]+'%'};return _0x43342b;}})});}_0x103f1d=_['merge']({},_0x103f1d,_0x335c3b['options']);var _0x1c2bbc={'where':_0x103f1d[_0x0371('0x33')]};return db[_0x0371('0x24')][_0x0371('0x17')](_0x1c2bbc)[_0x0371('0x1f')](function(_0x2c421f){_0x1bdc8c[_0x0371('0x17')]=_0x2c421f;if(_0x335c3b[_0x0371('0x27')]['includeAll']){_0x103f1d[_0x0371('0x38')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x0371('0x39')](_0x103f1d);})[_0x0371('0x1f')](function(_0x41284f){_0x1bdc8c[_0x0371('0x3a')]=_0x41284f;return _0x1bdc8c;})[_0x0371('0x1f')](respondWithFilteredResult(_0x448801,_0x103f1d))['catch'](handleError(_0x448801,null));};exports[_0x0371('0x3b')]=function(_0x4a1690,_0x54254d){var _0x59a96a={'raw':!![],'where':{'id':_0x4a1690[_0x0371('0x3c')]['id']}},_0x4ef030={};_0x4ef030[_0x0371('0x2a')]=_['keys'](db['AnalyticTreeReport'][_0x0371('0x25')]);_0x4ef030['query']=_['keys'](_0x4a1690[_0x0371('0x27')]);_0x4ef030[_0x0371('0x28')]=_[_0x0371('0x29')](_0x4ef030[_0x0371('0x2a')],_0x4ef030[_0x0371('0x27')]);_0x59a96a[_0x0371('0x2c')]=_['intersection'](_0x4ef030[_0x0371('0x2a')],qs['fields'](_0x4a1690[_0x0371('0x27')][_0x0371('0x2b')]));_0x59a96a[_0x0371('0x2c')]=_0x59a96a[_0x0371('0x2c')][_0x0371('0x2d')]?_0x59a96a[_0x0371('0x2c')]:_0x4ef030['model'];if(_0x4a1690[_0x0371('0x27')][_0x0371('0x3d')]){_0x59a96a[_0x0371('0x38')]=[{'all':!![]}];}_0x59a96a=_['merge']({},_0x59a96a,_0x4a1690[_0x0371('0x3e')]);return db[_0x0371('0x24')][_0x0371('0x3f')](_0x59a96a)[_0x0371('0x1f')](handleEntityNotFound(_0x54254d,null))[_0x0371('0x1f')](respondWithResult(_0x54254d,null))[_0x0371('0x40')](handleError(_0x54254d,null));};exports[_0x0371('0x41')]=function(_0x99dea8,_0x3bd9f1){return db[_0x0371('0x24')]['create'](_0x99dea8['body'],{})[_0x0371('0x1f')](respondWithResult(_0x3bd9f1,0xc9))[_0x0371('0x40')](handleError(_0x3bd9f1,null));};exports[_0x0371('0x1d')]=function(_0x23140b,_0x1864dc){if(_0x23140b['body']['id']){delete _0x23140b['body']['id'];}return db[_0x0371('0x24')][_0x0371('0x3f')]({'where':{'id':_0x23140b['params']['id']}})[_0x0371('0x1f')](handleEntityNotFound(_0x1864dc,null))[_0x0371('0x1f')](saveUpdates(_0x23140b[_0x0371('0x42')],null))['then'](respondWithResult(_0x1864dc,null))[_0x0371('0x40')](handleError(_0x1864dc,null));};exports[_0x0371('0x1e')]=function(_0x17dbea,_0x18be05){return db[_0x0371('0x24')]['find']({'where':{'id':_0x17dbea[_0x0371('0x3c')]['id']}})[_0x0371('0x1f')](handleEntityNotFound(_0x18be05,null))[_0x0371('0x1f')](removeEntity(_0x18be05,null))[_0x0371('0x40')](handleError(_0x18be05,null));}; \ No newline at end of file +var _0x19d1=['type','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','fields','create','body','find','eml-format','fast-json-patch','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','AnalyticTreeReport','rawAttributes','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map'];(function(_0x1bf886,_0x4fe99a){var _0x3a1e1f=function(_0x488080){while(--_0x488080){_0x1bf886['push'](_0x1bf886['shift']());}};_0x3a1e1f(++_0x4fe99a);}(_0x19d1,0xd6));var _0x119d=function(_0x17413d,_0x6f33c3){_0x17413d=_0x17413d-0x0;var _0x1b315b=_0x19d1[_0x17413d];return _0x1b315b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x119d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x119d('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x119d('0x2'));var Mustache=require(_0x119d('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x119d('0x4'));var ejs=require(_0x119d('0x5'));var fs=require('fs');var _=require(_0x119d('0x6'));var squel=require(_0x119d('0x7'));var crypto=require(_0x119d('0x8'));var jsforce=require(_0x119d('0x9'));var deskjs=require(_0x119d('0xa'));var toCsv=require('to-csv');var querystring=require(_0x119d('0xb'));var Papa=require(_0x119d('0xc'));var Redis=require(_0x119d('0xd'));var authService=require(_0x119d('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x119d('0xf'))(_0x119d('0x10'));var utils=require(_0x119d('0x11'));var config=require(_0x119d('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34b305,_0x207f8f){_0x207f8f=_0x207f8f||0xcc;return function(_0x44e281){if(_0x44e281){return _0x34b305['sendStatus'](_0x207f8f);}return _0x34b305['status'](_0x207f8f)[_0x119d('0x13')]();};}function respondWithResult(_0x42cdef,_0x2a792d){_0x2a792d=_0x2a792d||0xc8;return function(_0x1b8683){if(_0x1b8683){return _0x42cdef[_0x119d('0x14')](_0x2a792d)[_0x119d('0x15')](_0x1b8683);}};}function respondWithFilteredResult(_0x58c2b8,_0x2374d7){return function(_0x5022c2){if(_0x5022c2){var _0x55257d=_0x5022c2[_0x119d('0x16')],_0x3e1b07=_0x2374d7[_0x119d('0x17')],_0x317573=_0x2374d7[_0x119d('0x17')]+_0x2374d7[_0x119d('0x18')],_0x122dc0;if(_0x317573>=_0x55257d){_0x317573=_0x55257d;_0x122dc0=0xc8;}else{_0x122dc0=0xce;}_0x58c2b8['status'](_0x122dc0);return _0x58c2b8[_0x119d('0x19')]('Content-Range',_0x3e1b07+'-'+_0x317573+'/'+_0x55257d)[_0x119d('0x15')](_0x5022c2);}return null;};}function patchUpdates(_0x5896c1){return function(_0x12e491){try{jsonpatch[_0x119d('0x1a')](_0x12e491,_0x5896c1,!![]);}catch(_0x41e5e6){return BPromise[_0x119d('0x1b')](_0x41e5e6);}return _0x12e491[_0x119d('0x1c')]();};}function saveUpdates(_0x509635,_0x56b2c3){return function(_0x30346d){if(_0x30346d){return _0x30346d[_0x119d('0x1d')](_0x509635)[_0x119d('0x1e')](function(_0x5020bf){return _0x5020bf;});}return null;};}function removeEntity(_0x27db0a,_0x25db82){return function(_0xfd56f6){if(_0xfd56f6){return _0xfd56f6[_0x119d('0x1f')]()['then'](function(){_0x27db0a[_0x119d('0x14')](0xcc)[_0x119d('0x13')]();});}};}function handleEntityNotFound(_0x53919f,_0x3d8df0){return function(_0x5e07aa){if(!_0x5e07aa){_0x53919f[_0x119d('0x20')](0x194);}return _0x5e07aa;};}function handleError(_0x33dde9,_0x37569f){_0x37569f=_0x37569f||0x1f4;return function(_0x4ddacb){logger[_0x119d('0x21')](_0x4ddacb['stack']);if(_0x4ddacb[_0x119d('0x22')]){delete _0x4ddacb[_0x119d('0x22')];}_0x33dde9[_0x119d('0x14')](_0x37569f)[_0x119d('0x23')](_0x4ddacb);};}exports[_0x119d('0x24')]=function(_0x2f7edc,_0x2c3e94){var _0x58e30e={},_0x11bcb2={},_0xd48c9a={'count':0x0,'rows':[]};var _0x5bc9e2=db[_0x119d('0x25')][_0x119d('0x26')];_0x11bcb2[_0x119d('0x27')]=_['keys'](_0x5bc9e2);_0x11bcb2['query']=_[_0x119d('0x28')](_0x2f7edc[_0x119d('0x29')]);_0x11bcb2[_0x119d('0x2a')]=_['intersection'](_0x11bcb2[_0x119d('0x27')],_0x11bcb2[_0x119d('0x29')]);_0x58e30e[_0x119d('0x2b')]=_[_0x119d('0x2c')](_0x11bcb2[_0x119d('0x27')],qs['fields'](_0x2f7edc[_0x119d('0x29')]['fields']));_0x58e30e[_0x119d('0x2b')]=_0x58e30e['attributes'][_0x119d('0x2d')]?_0x58e30e[_0x119d('0x2b')]:_0x11bcb2[_0x119d('0x27')];if(!_0x2f7edc[_0x119d('0x29')][_0x119d('0x2e')](_0x119d('0x2f'))){_0x58e30e[_0x119d('0x18')]=qs[_0x119d('0x18')](_0x2f7edc[_0x119d('0x29')]['limit']);_0x58e30e[_0x119d('0x17')]=qs[_0x119d('0x17')](_0x2f7edc[_0x119d('0x29')][_0x119d('0x17')]);}_0x58e30e[_0x119d('0x30')]=qs['sort'](_0x2f7edc[_0x119d('0x29')][_0x119d('0x31')]);_0x58e30e[_0x119d('0x32')]=qs[_0x119d('0x2a')](_[_0x119d('0x33')](_0x2f7edc[_0x119d('0x29')],_0x11bcb2[_0x119d('0x2a')]));if(_0x2f7edc[_0x119d('0x29')][_0x119d('0x34')]){_0x58e30e['where']=_['merge'](_0x58e30e[_0x119d('0x32')],{'$or':_[_0x119d('0x35')](_0x5bc9e2,function(_0x59ebc8){if(_0x59ebc8[_0x119d('0x36')]['key']!==_0x119d('0x37')){var _0x271eea={};_0x271eea[_0x59ebc8['field']]={'$like':'%'+_0x2f7edc[_0x119d('0x29')][_0x119d('0x34')]+'%'};return _0x271eea;}})});}_0x58e30e=_[_0x119d('0x38')]({},_0x58e30e,_0x2f7edc[_0x119d('0x39')]);var _0xb782d0={'where':_0x58e30e[_0x119d('0x32')]};return db[_0x119d('0x25')][_0x119d('0x16')](_0xb782d0)['then'](function(_0xe42031){_0xd48c9a[_0x119d('0x16')]=_0xe42031;if(_0x2f7edc[_0x119d('0x29')][_0x119d('0x3a')]){_0x58e30e[_0x119d('0x3b')]=[{'all':!![]}];}return db[_0x119d('0x25')][_0x119d('0x3c')](_0x58e30e);})[_0x119d('0x1e')](function(_0x1bb887){_0xd48c9a['rows']=_0x1bb887;return _0xd48c9a;})[_0x119d('0x1e')](respondWithFilteredResult(_0x2c3e94,_0x58e30e))[_0x119d('0x3d')](handleError(_0x2c3e94,null));};exports['show']=function(_0x17bffb,_0x41bdd3){var _0x22cc4d={'raw':!![],'where':{'id':_0x17bffb[_0x119d('0x3e')]['id']}},_0x5e09e3={};_0x5e09e3[_0x119d('0x27')]=_[_0x119d('0x28')](db['AnalyticTreeReport']['rawAttributes']);_0x5e09e3[_0x119d('0x29')]=_[_0x119d('0x28')](_0x17bffb['query']);_0x5e09e3['filters']=_[_0x119d('0x2c')](_0x5e09e3[_0x119d('0x27')],_0x5e09e3[_0x119d('0x29')]);_0x22cc4d[_0x119d('0x2b')]=_['intersection'](_0x5e09e3['model'],qs[_0x119d('0x3f')](_0x17bffb[_0x119d('0x29')][_0x119d('0x3f')]));_0x22cc4d[_0x119d('0x2b')]=_0x22cc4d['attributes']['length']?_0x22cc4d['attributes']:_0x5e09e3[_0x119d('0x27')];if(_0x17bffb[_0x119d('0x29')]['includeAll']){_0x22cc4d[_0x119d('0x3b')]=[{'all':!![]}];}_0x22cc4d=_[_0x119d('0x38')]({},_0x22cc4d,_0x17bffb[_0x119d('0x39')]);return db[_0x119d('0x25')]['find'](_0x22cc4d)[_0x119d('0x1e')](handleEntityNotFound(_0x41bdd3,null))[_0x119d('0x1e')](respondWithResult(_0x41bdd3,null))[_0x119d('0x3d')](handleError(_0x41bdd3,null));};exports[_0x119d('0x40')]=function(_0x192285,_0x3eeb68){return db['AnalyticTreeReport']['create'](_0x192285[_0x119d('0x41')],{})[_0x119d('0x1e')](respondWithResult(_0x3eeb68,0xc9))[_0x119d('0x3d')](handleError(_0x3eeb68,null));};exports['update']=function(_0x3f411a,_0x417632){if(_0x3f411a[_0x119d('0x41')]['id']){delete _0x3f411a[_0x119d('0x41')]['id'];}return db[_0x119d('0x25')][_0x119d('0x42')]({'where':{'id':_0x3f411a[_0x119d('0x3e')]['id']}})[_0x119d('0x1e')](handleEntityNotFound(_0x417632,null))['then'](saveUpdates(_0x3f411a['body'],null))[_0x119d('0x1e')](respondWithResult(_0x417632,null))[_0x119d('0x3d')](handleError(_0x417632,null));};exports[_0x119d('0x1f')]=function(_0x4603c1,_0x36c11a){return db[_0x119d('0x25')][_0x119d('0x42')]({'where':{'id':_0x4603c1['params']['id']}})[_0x119d('0x1e')](handleEntityNotFound(_0x36c11a,null))[_0x119d('0x1e')](removeEntity(_0x36c11a,null))[_0x119d('0x3d')](handleError(_0x36c11a,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 748aed5..fdaee0f 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 _0xfe39=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','request-promise','path'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xfe39,0x1b3));var _0x9fe3=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xfe39[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0x9fe3('0x0'));var util=require(_0x9fe3('0x1'));var logger=require('../../config/logger')(_0x9fe3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9fe3('0x3'));var fs=require('fs');var path=require(_0x9fe3('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9fe3('0x5'));module[_0x9fe3('0x6')]=function(_0x353631,_0x10c336){return _0x353631[_0x9fe3('0x7')](_0x9fe3('0x8'),attributes,{'tableName':_0x9fe3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe829=['define','AnalyticTreeReport','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1a823c,_0x5cba6a){var _0x31b19a=function(_0x3fb39b){while(--_0x3fb39b){_0x1a823c['push'](_0x1a823c['shift']());}};_0x31b19a(++_0x5cba6a);}(_0xe829,0xde));var _0x9e82=function(_0x2e32a5,_0xc5e0e4){_0x2e32a5=_0x2e32a5-0x0;var _0xeaf48a=_0xe829[_0x2e32a5];return _0xeaf48a;};'use strict';var _=require('lodash');var util=require(_0x9e82('0x0'));var logger=require(_0x9e82('0x1'))(_0x9e82('0x2'));var moment=require(_0x9e82('0x3'));var BPromise=require(_0x9e82('0x4'));var rp=require(_0x9e82('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9e82('0x6'));var config=require(_0x9e82('0x7'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x4b8d53,_0x46f5db){return _0x4b8d53[_0x9e82('0x8')](_0x9e82('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index f0b16ca..52d2495 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 _0xe87c=['request','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b1ee6,_0x4837e8){var _0x47fc2f=function(_0x26df88){while(--_0x26df88){_0x3b1ee6['push'](_0x3b1ee6['shift']());}};_0x47fc2f(++_0x4837e8);}(_0xe87c,0x1c1));var _0xce87=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xe87c[_0x44bcb0];return _0xfaf881;};'use strict';var _=require(_0xce87('0x0'));var util=require(_0xce87('0x1'));var moment=require('moment');var BPromise=require(_0xce87('0x2'));var rs=require(_0xce87('0x3'));var fs=require('fs');var Redis=require(_0xce87('0x4'));var db=require(_0xce87('0x5'))['db'];var utils=require(_0xce87('0x6'));var logger=require('../../config/logger')(_0xce87('0x7'));var config=require(_0xce87('0x8'));var jayson=require(_0xce87('0x9'));var client=jayson['client'][_0xce87('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x127615,_0x3184ce,_0x36d6f1){return new BPromise(function(_0x51968d,_0x23adc2){return client[_0xce87('0xb')](_0x127615,_0x36d6f1)['then'](function(_0x2b8b3d){logger[_0xce87('0xc')](_0xce87('0xd'),_0x3184ce,_0xce87('0xe'));logger[_0xce87('0xf')](_0xce87('0x10'),_0x3184ce,_0xce87('0xe'),JSON[_0xce87('0x11')](_0x2b8b3d));if(_0x2b8b3d['error']){if(_0x2b8b3d['error'][_0xce87('0x12')]===0x1f4){logger[_0xce87('0x13')](_0xce87('0xd'),_0x3184ce,_0x2b8b3d[_0xce87('0x13')][_0xce87('0x14')]);return _0x23adc2(_0x2b8b3d[_0xce87('0x13')][_0xce87('0x14')]);}logger[_0xce87('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x3184ce,_0x2b8b3d['error'][_0xce87('0x14')]);return _0x51968d(_0x2b8b3d[_0xce87('0x13')][_0xce87('0x14')]);}else{logger['info']('AnalyticTreeReport,\x20%s,\x20%s',_0x3184ce,_0xce87('0xe'));_0x51968d(_0x2b8b3d[_0xce87('0x15')]['message']);}})[_0xce87('0x16')](function(_0x532f8a){logger[_0xce87('0x13')](_0xce87('0xd'),_0x3184ce,_0x532f8a);_0x23adc2(_0x532f8a);});});} \ No newline at end of file +var _0x25e9=['ioredis','../../mysqldb','../../config/logger','rpc','http','AnalyticTreeReport,\x20%s,\x20%s','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','lodash','util','moment','randomstring'];(function(_0x3dc73c,_0x31ce2e){var _0x52a9f7=function(_0x2a631d){while(--_0x2a631d){_0x3dc73c['push'](_0x3dc73c['shift']());}};_0x52a9f7(++_0x31ce2e);}(_0x25e9,0x164));var _0x925e=function(_0x1fd3e2,_0x1a6772){_0x1fd3e2=_0x1fd3e2-0x0;var _0x5a9210=_0x25e9[_0x1fd3e2];return _0x5a9210;};'use strict';var _=require(_0x925e('0x0'));var util=require(_0x925e('0x1'));var moment=require(_0x925e('0x2'));var BPromise=require('bluebird');var rs=require(_0x925e('0x3'));var fs=require('fs');var Redis=require(_0x925e('0x4'));var db=require(_0x925e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x925e('0x6'))(_0x925e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x925e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4426db,_0x56590c,_0x3319c7){return new BPromise(function(_0x347935,_0x60bd02){return client['request'](_0x4426db,_0x3319c7)['then'](function(_0xad3e9d){logger['info'](_0x925e('0x9'),_0x56590c,'request\x20sent');logger[_0x925e('0xa')](_0x925e('0xb'),_0x56590c,_0x925e('0xc'),JSON['stringify'](_0xad3e9d));if(_0xad3e9d['error']){if(_0xad3e9d[_0x925e('0xd')][_0x925e('0xe')]===0x1f4){logger[_0x925e('0xd')](_0x925e('0x9'),_0x56590c,_0xad3e9d[_0x925e('0xd')][_0x925e('0xf')]);return _0x60bd02(_0xad3e9d[_0x925e('0xd')]['message']);}logger[_0x925e('0xd')](_0x925e('0x9'),_0x56590c,_0xad3e9d[_0x925e('0xd')][_0x925e('0xf')]);return _0x347935(_0xad3e9d['error'][_0x925e('0xf')]);}else{logger[_0x925e('0x10')](_0x925e('0x9'),_0x56590c,_0x925e('0xc'));_0x347935(_0xad3e9d[_0x925e('0x11')][_0x925e('0xf')]);}})['catch'](function(_0x546396){logger[_0x925e('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x56590c,_0x546396);_0x60bd02(_0x546396);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 066c9be..abbee54 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 _0xdffb=['post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0x44a0e9,_0x959f63){var _0x3b8e8c=function(_0x11b3e1){while(--_0x11b3e1){_0x44a0e9['push'](_0x44a0e9['shift']());}};_0x3b8e8c(++_0x959f63);}(_0xdffb,0x6e));var _0xbdff=function(_0x59705f,_0x38420f){_0x59705f=_0x59705f-0x0;var _0x2f4008=_0xdffb[_0x59705f];return _0x2f4008;};'use strict';var multer=require(_0xbdff('0x0'));var util=require(_0xbdff('0x1'));var path=require(_0xbdff('0x2'));var timeout=require('connect-timeout');var express=require(_0xbdff('0x3'));var router=express[_0xbdff('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbdff('0x5'));var config=require(_0xbdff('0x6'));var controller=require('./analyticTreeReport.controller');router[_0xbdff('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbdff('0x7')](_0xbdff('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xbdff('0x9')]('/',auth[_0xbdff('0xa')](),controller[_0xbdff('0xb')]);router[_0xbdff('0xc')](_0xbdff('0x8'),auth[_0xbdff('0xa')](),controller[_0xbdff('0xd')]);router[_0xbdff('0xe')]('/:id',auth[_0xbdff('0xa')](),controller[_0xbdff('0xf')]);module[_0xbdff('0x10')]=router; \ No newline at end of file +var _0xfe30=['./analyticTreeReport.controller','get','/:id','isAuthenticated','post','create','put','delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x26a63c,_0x47a001){var _0x1049a0=function(_0x4e88a6){while(--_0x4e88a6){_0x26a63c['push'](_0x26a63c['shift']());}};_0x1049a0(++_0x47a001);}(_0xfe30,0x1a9));var _0x0fe3=function(_0x4c2def,_0x3926d6){_0x4c2def=_0x4c2def-0x0;var _0x51a964=_0xfe30[_0x4c2def];return _0x51a964;};'use strict';var multer=require(_0x0fe3('0x0'));var util=require('util');var path=require(_0x0fe3('0x1'));var timeout=require(_0x0fe3('0x2'));var express=require(_0x0fe3('0x3'));var router=express[_0x0fe3('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0fe3('0x5'));var config=require(_0x0fe3('0x6'));var controller=require(_0x0fe3('0x7'));router[_0x0fe3('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0fe3('0x8')](_0x0fe3('0x9'),auth[_0x0fe3('0xa')](),controller['show']);router[_0x0fe3('0xb')]('/',auth[_0x0fe3('0xa')](),controller[_0x0fe3('0xc')]);router[_0x0fe3('0xd')]('/:id',auth[_0x0fe3('0xa')](),controller['update']);router[_0x0fe3('0xe')](_0x0fe3('0x9'),auth[_0x0fe3('0xa')](),controller[_0x0fe3('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index de5f92d..3c27df4 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 _0x323d=['STRING','exports'];(function(_0x6a3e5b,_0x2caec2){var _0x54a2be=function(_0x4b5efb){while(--_0x4b5efb){_0x6a3e5b['push'](_0x6a3e5b['shift']());}};_0x54a2be(++_0x2caec2);}(_0x323d,0x79));var _0xd323=function(_0x4b9e80,_0x2b3179){_0x4b9e80=_0x4b9e80-0x0;var _0xc73b33=_0x323d[_0x4b9e80];return _0xc73b33;};'use strict';var Sequelize=require('sequelize');module[_0xd323('0x0')]={'name':{'type':Sequelize[_0xd323('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd323('0x1')]}}; \ No newline at end of file +var _0x980c=['STRING','sequelize','exports'];(function(_0x4a07c6,_0x5883a3){var _0x3a30ed=function(_0x17c16f){while(--_0x17c16f){_0x4a07c6['push'](_0x4a07c6['shift']());}};_0x3a30ed(++_0x5883a3);}(_0x980c,0x14b));var _0xc980=function(_0x29717f,_0x535194){_0x29717f=_0x29717f-0x0;var _0x38d3dc=_0x980c[_0x29717f];return _0x38d3dc;};'use strict';var Sequelize=require(_0xc980('0x0'));module[_0xc980('0x1')]={'name':{'type':Sequelize[_0xc980('0x2')]},'basename':{'type':Sequelize[_0xc980('0x2')]},'type':{'type':Sequelize[_0xc980('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 5dba0ae..6fb20f5 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 _0x2734=['update','body','file','originalname','basename','filename','mimetype','download','findOne','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','then','destroy','error','name','index','rawAttributes','model','keys','query','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','Attachment','includeAll','include','rows','catch','show','params','filters','intersection','length','find'];(function(_0x2e44cf,_0x16f684){var _0x361268=function(_0x2a59db){while(--_0x2a59db){_0x2e44cf['push'](_0x2e44cf['shift']());}};_0x361268(++_0x16f684);}(_0x2734,0xf4));var _0x4273=function(_0x3bc680,_0x2f68da){_0x3bc680=_0x3bc680-0x0;var _0x5465d8=_0x2734[_0x3bc680];return _0x5465d8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4273('0x0'));var rimraf=require(_0x4273('0x1'));var zipdir=require(_0x4273('0x2'));var jsonpatch=require(_0x4273('0x3'));var rp=require('request-promise');var moment=require(_0x4273('0x4'));var BPromise=require(_0x4273('0x5'));var Mustache=require(_0x4273('0x6'));var util=require(_0x4273('0x7'));var path=require(_0x4273('0x8'));var sox=require(_0x4273('0x9'));var csv=require(_0x4273('0xa'));var ejs=require(_0x4273('0xb'));var fs=require('fs');var _=require(_0x4273('0xc'));var squel=require(_0x4273('0xd'));var crypto=require(_0x4273('0xe'));var jsforce=require(_0x4273('0xf'));var deskjs=require(_0x4273('0x10'));var toCsv=require(_0x4273('0xa'));var querystring=require(_0x4273('0x11'));var Papa=require(_0x4273('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4273('0x13'));var hardwareService=require(_0x4273('0x14'));var logger=require('../../config/logger')(_0x4273('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4273('0x16'))['db'];function respondWithStatusCode(_0x5afd37,_0x2a0d38){_0x2a0d38=_0x2a0d38||0xcc;return function(_0x5bb2d5){if(_0x5bb2d5){return _0x5afd37[_0x4273('0x17')](_0x2a0d38);}return _0x5afd37[_0x4273('0x18')](_0x2a0d38)[_0x4273('0x19')]();};}function respondWithResult(_0x1aa7f4,_0x17811a){_0x17811a=_0x17811a||0xc8;return function(_0x12775e){if(_0x12775e){return _0x1aa7f4['status'](_0x17811a)[_0x4273('0x1a')](_0x12775e);}};}function respondWithFilteredResult(_0x10654c,_0x1e5bdc){return function(_0x1974b5){if(_0x1974b5){var _0x3c13f2=_0x1974b5[_0x4273('0x1b')],_0x522cee=_0x1e5bdc[_0x4273('0x1c')],_0x5198bb=_0x1e5bdc['offset']+_0x1e5bdc[_0x4273('0x1d')],_0x3f9be3;if(_0x5198bb>=_0x3c13f2){_0x5198bb=_0x3c13f2;_0x3f9be3=0xc8;}else{_0x3f9be3=0xce;}_0x10654c['status'](_0x3f9be3);return _0x10654c[_0x4273('0x1e')]('Content-Range',_0x522cee+'-'+_0x5198bb+'/'+_0x3c13f2)[_0x4273('0x1a')](_0x1974b5);}return null;};}function patchUpdates(_0x20ee85){return function(_0x2afb90){try{jsonpatch[_0x4273('0x1f')](_0x2afb90,_0x20ee85,!![]);}catch(_0x4e3fea){return BPromise[_0x4273('0x20')](_0x4e3fea);}return _0x2afb90['save']();};}function saveUpdates(_0x2cf027,_0x57c290){return function(_0x213940){if(_0x213940){return _0x213940['update'](_0x2cf027)[_0x4273('0x21')](function(_0x37f35d){return _0x37f35d;});}return null;};}function removeEntity(_0x3bf974,_0x404a03){return function(_0x3ef6d9){if(_0x3ef6d9){return _0x3ef6d9[_0x4273('0x22')]()[_0x4273('0x21')](function(){_0x3bf974[_0x4273('0x18')](0xcc)[_0x4273('0x19')]();});}};}function handleEntityNotFound(_0x83ea6d,_0x14ea65){return function(_0x3a4658){if(!_0x3a4658){_0x83ea6d['sendStatus'](0x194);}return _0x3a4658;};}function handleError(_0x357831,_0x325e7a){_0x325e7a=_0x325e7a||0x1f4;return function(_0x3f9a38){logger[_0x4273('0x23')](_0x3f9a38['stack']);if(_0x3f9a38['name']){delete _0x3f9a38[_0x4273('0x24')];}_0x357831[_0x4273('0x18')](_0x325e7a)['send'](_0x3f9a38);};}exports[_0x4273('0x25')]=function(_0x473961,_0x44c2cb){var _0x4d6a2f={},_0x71cae4={},_0x1820f2={'count':0x0,'rows':[]};var _0x4988a9=db['Attachment'][_0x4273('0x26')];_0x71cae4[_0x4273('0x27')]=_[_0x4273('0x28')](_0x4988a9);_0x71cae4[_0x4273('0x29')]=_[_0x4273('0x28')](_0x473961[_0x4273('0x29')]);_0x71cae4['filters']=_['intersection'](_0x71cae4[_0x4273('0x27')],_0x71cae4[_0x4273('0x29')]);_0x4d6a2f[_0x4273('0x2a')]=_['intersection'](_0x71cae4[_0x4273('0x27')],qs[_0x4273('0x2b')](_0x473961[_0x4273('0x29')][_0x4273('0x2b')]));_0x4d6a2f[_0x4273('0x2a')]=_0x4d6a2f[_0x4273('0x2a')]['length']?_0x4d6a2f[_0x4273('0x2a')]:_0x71cae4[_0x4273('0x27')];if(!_0x473961[_0x4273('0x29')][_0x4273('0x2c')]('nolimit')){_0x4d6a2f[_0x4273('0x1d')]=qs[_0x4273('0x1d')](_0x473961[_0x4273('0x29')]['limit']);_0x4d6a2f['offset']=qs[_0x4273('0x1c')](_0x473961[_0x4273('0x29')]['offset']);}_0x4d6a2f[_0x4273('0x2d')]=qs['sort'](_0x473961[_0x4273('0x29')][_0x4273('0x2e')]);_0x4d6a2f[_0x4273('0x2f')]=qs['filters'](_[_0x4273('0x30')](_0x473961[_0x4273('0x29')],_0x71cae4['filters']));if(_0x473961['query']['filter']){_0x4d6a2f[_0x4273('0x2f')]=_[_0x4273('0x31')](_0x4d6a2f[_0x4273('0x2f')],{'$or':_[_0x4273('0x32')](_0x4988a9,function(_0x34aedb){if(_0x34aedb[_0x4273('0x33')][_0x4273('0x34')]!==_0x4273('0x35')){var _0x8b1398={};_0x8b1398[_0x34aedb[_0x4273('0x36')]]={'$like':'%'+_0x473961[_0x4273('0x29')][_0x4273('0x37')]+'%'};return _0x8b1398;}})});}_0x4d6a2f=_['merge']({},_0x4d6a2f,_0x473961[_0x4273('0x38')]);var _0x58c519={'where':_0x4d6a2f['where']};return db[_0x4273('0x39')][_0x4273('0x1b')](_0x58c519)[_0x4273('0x21')](function(_0xa5c8ae){_0x1820f2[_0x4273('0x1b')]=_0xa5c8ae;if(_0x473961[_0x4273('0x29')][_0x4273('0x3a')]){_0x4d6a2f[_0x4273('0x3b')]=[{'all':!![]}];}return db[_0x4273('0x39')]['findAll'](_0x4d6a2f);})[_0x4273('0x21')](function(_0x1d032a){_0x1820f2[_0x4273('0x3c')]=_0x1d032a;return _0x1820f2;})[_0x4273('0x21')](respondWithFilteredResult(_0x44c2cb,_0x4d6a2f))[_0x4273('0x3d')](handleError(_0x44c2cb,null));};exports[_0x4273('0x3e')]=function(_0x3fb798,_0x32aa8c){var _0x1904cc={'raw':!![],'where':{'id':_0x3fb798[_0x4273('0x3f')]['id']}},_0x3dc312={};_0x3dc312[_0x4273('0x27')]=_['keys'](db['Attachment']['rawAttributes']);_0x3dc312[_0x4273('0x29')]=_[_0x4273('0x28')](_0x3fb798[_0x4273('0x29')]);_0x3dc312[_0x4273('0x40')]=_['intersection'](_0x3dc312[_0x4273('0x27')],_0x3dc312['query']);_0x1904cc[_0x4273('0x2a')]=_[_0x4273('0x41')](_0x3dc312[_0x4273('0x27')],qs[_0x4273('0x2b')](_0x3fb798['query']['fields']));_0x1904cc[_0x4273('0x2a')]=_0x1904cc[_0x4273('0x2a')][_0x4273('0x42')]?_0x1904cc['attributes']:_0x3dc312['model'];if(_0x3fb798[_0x4273('0x29')]['includeAll']){_0x1904cc[_0x4273('0x3b')]=[{'all':!![]}];}_0x1904cc=_[_0x4273('0x31')]({},_0x1904cc,_0x3fb798[_0x4273('0x38')]);return db[_0x4273('0x39')][_0x4273('0x43')](_0x1904cc)['then'](handleEntityNotFound(_0x32aa8c,null))[_0x4273('0x21')](respondWithResult(_0x32aa8c,null))[_0x4273('0x3d')](handleError(_0x32aa8c,null));};exports[_0x4273('0x44')]=function(_0x367eb8,_0x2c7c22){if(_0x367eb8[_0x4273('0x45')]['id']){delete _0x367eb8[_0x4273('0x45')]['id'];}return db[_0x4273('0x39')][_0x4273('0x43')]({'where':{'id':_0x367eb8[_0x4273('0x3f')]['id']}})[_0x4273('0x21')](handleEntityNotFound(_0x2c7c22,null))[_0x4273('0x21')](saveUpdates(_0x367eb8[_0x4273('0x45')],null))[_0x4273('0x21')](respondWithResult(_0x2c7c22,null))[_0x4273('0x3d')](handleError(_0x2c7c22,null));};exports[_0x4273('0x22')]=function(_0x2ceee0,_0x1160bc){return db[_0x4273('0x39')][_0x4273('0x43')]({'where':{'id':_0x2ceee0['params']['id']}})[_0x4273('0x21')](handleEntityNotFound(_0x1160bc,null))[_0x4273('0x21')](removeEntity(_0x1160bc,null))[_0x4273('0x3d')](handleError(_0x1160bc,null));};exports['create']=function(_0x48388c,_0x31ba77,_0x9a4cce){_0x48388c[_0x4273('0x45')][_0x4273('0x24')]=_0x48388c[_0x4273('0x46')][_0x4273('0x47')];_0x48388c[_0x4273('0x45')][_0x4273('0x48')]=_0x48388c[_0x4273('0x46')][_0x4273('0x49')];_0x48388c[_0x4273('0x45')][_0x4273('0x33')]=_0x48388c['file'][_0x4273('0x4a')];return db[_0x4273('0x39')]['create'](_0x48388c['body'])[_0x4273('0x21')](respondWithResult(_0x31ba77,0xc9))[_0x4273('0x3d')](handleError(_0x31ba77,null));};exports[_0x4273('0x4b')]=function(_0x5a39f1,_0x4615f3,_0x485b59){return db['Attachment'][_0x4273('0x4c')]({'where':{'id':_0x5a39f1[_0x4273('0x3f')]['id']},'raw':!![]})[_0x4273('0x21')](handleEntityNotFound(_0x4615f3,null))[_0x4273('0x21')](function(_0x4bb711){if(_0x4bb711){return _0x4615f3[_0x4273('0x4b')](path['join'](config['root'],_0x4273('0x4d'),_0x4bb711['basename']));}})[_0x4273('0x3d')](handleError(_0x4615f3,null));}; \ No newline at end of file +var _0xc6cb=['html-pdf','eml-format','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','save','update','then','destroy','stack','name','Attachment','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','field','options','include','findAll','catch','show','params','fields','includeAll','find','body','create','file','originalname','basename','filename','mimetype','download','join','root'];(function(_0x3768f4,_0x1580e8){var _0x15f264=function(_0x46da7a){while(--_0x46da7a){_0x3768f4['push'](_0x3768f4['shift']());}};_0x15f264(++_0x1580e8);}(_0xc6cb,0xdb));var _0xbc6c=function(_0x5ddedd,_0x5625a9){_0x5ddedd=_0x5ddedd-0x0;var _0x3ba61f=_0xc6cb[_0x5ddedd];return _0x3ba61f;};'use strict';var pdf=require(_0xbc6c('0x0'));var emlformat=require(_0xbc6c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbc6c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbc6c('0x3'));var Mustache=require(_0xbc6c('0x4'));var util=require(_0xbc6c('0x5'));var path=require(_0xbc6c('0x6'));var sox=require('sox');var csv=require(_0xbc6c('0x7'));var ejs=require(_0xbc6c('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xbc6c('0x9'));var jsforce=require(_0xbc6c('0xa'));var deskjs=require(_0xbc6c('0xb'));var toCsv=require(_0xbc6c('0x7'));var querystring=require(_0xbc6c('0xc'));var Papa=require(_0xbc6c('0xd'));var Redis=require(_0xbc6c('0xe'));var authService=require(_0xbc6c('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc6c('0x10'))(_0xbc6c('0x11'));var utils=require(_0xbc6c('0x12'));var config=require(_0xbc6c('0x13'));var db=require(_0xbc6c('0x14'))['db'];function respondWithStatusCode(_0x586595,_0x3426e9){_0x3426e9=_0x3426e9||0xcc;return function(_0x175ca4){if(_0x175ca4){return _0x586595[_0xbc6c('0x15')](_0x3426e9);}return _0x586595[_0xbc6c('0x16')](_0x3426e9)[_0xbc6c('0x17')]();};}function respondWithResult(_0x6391c3,_0x48b200){_0x48b200=_0x48b200||0xc8;return function(_0x28dc9f){if(_0x28dc9f){return _0x6391c3[_0xbc6c('0x16')](_0x48b200)[_0xbc6c('0x18')](_0x28dc9f);}};}function respondWithFilteredResult(_0xd4b74f,_0x651e4a){return function(_0x4bfe45){if(_0x4bfe45){var _0x291d71=_0x4bfe45[_0xbc6c('0x19')],_0x55b54e=_0x651e4a[_0xbc6c('0x1a')],_0x5588f0=_0x651e4a[_0xbc6c('0x1a')]+_0x651e4a[_0xbc6c('0x1b')],_0x5ccc60;if(_0x5588f0>=_0x291d71){_0x5588f0=_0x291d71;_0x5ccc60=0xc8;}else{_0x5ccc60=0xce;}_0xd4b74f[_0xbc6c('0x16')](_0x5ccc60);return _0xd4b74f[_0xbc6c('0x1c')]('Content-Range',_0x55b54e+'-'+_0x5588f0+'/'+_0x291d71)[_0xbc6c('0x18')](_0x4bfe45);}return null;};}function patchUpdates(_0x1749fc){return function(_0x4aeb0f){try{jsonpatch['apply'](_0x4aeb0f,_0x1749fc,!![]);}catch(_0x40f4c0){return BPromise['reject'](_0x40f4c0);}return _0x4aeb0f[_0xbc6c('0x1d')]();};}function saveUpdates(_0x5c32fa,_0x2df019){return function(_0x497127){if(_0x497127){return _0x497127[_0xbc6c('0x1e')](_0x5c32fa)[_0xbc6c('0x1f')](function(_0x53540f){return _0x53540f;});}return null;};}function removeEntity(_0x591780,_0x354492){return function(_0x3cf285){if(_0x3cf285){return _0x3cf285[_0xbc6c('0x20')]()[_0xbc6c('0x1f')](function(){_0x591780[_0xbc6c('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ea4d6,_0x1e7a6e){return function(_0x1abbbc){if(!_0x1abbbc){_0x3ea4d6[_0xbc6c('0x15')](0x194);}return _0x1abbbc;};}function handleError(_0x63537a,_0x2d1fb7){_0x2d1fb7=_0x2d1fb7||0x1f4;return function(_0x4c28b0){logger['error'](_0x4c28b0[_0xbc6c('0x21')]);if(_0x4c28b0[_0xbc6c('0x22')]){delete _0x4c28b0[_0xbc6c('0x22')];}_0x63537a[_0xbc6c('0x16')](_0x2d1fb7)['send'](_0x4c28b0);};}exports['index']=function(_0x23f4c0,_0x3bf9f1){var _0x965cf2={},_0x3910a1={},_0x4132a8={'count':0x0,'rows':[]};var _0x26c2f5=db[_0xbc6c('0x23')][_0xbc6c('0x24')];_0x3910a1[_0xbc6c('0x25')]=_[_0xbc6c('0x26')](_0x26c2f5);_0x3910a1[_0xbc6c('0x27')]=_[_0xbc6c('0x26')](_0x23f4c0[_0xbc6c('0x27')]);_0x3910a1[_0xbc6c('0x28')]=_[_0xbc6c('0x29')](_0x3910a1['model'],_0x3910a1[_0xbc6c('0x27')]);_0x965cf2['attributes']=_[_0xbc6c('0x29')](_0x3910a1[_0xbc6c('0x25')],qs['fields'](_0x23f4c0[_0xbc6c('0x27')]['fields']));_0x965cf2[_0xbc6c('0x2a')]=_0x965cf2[_0xbc6c('0x2a')][_0xbc6c('0x2b')]?_0x965cf2[_0xbc6c('0x2a')]:_0x3910a1[_0xbc6c('0x25')];if(!_0x23f4c0[_0xbc6c('0x27')][_0xbc6c('0x2c')](_0xbc6c('0x2d'))){_0x965cf2[_0xbc6c('0x1b')]=qs[_0xbc6c('0x1b')](_0x23f4c0[_0xbc6c('0x27')]['limit']);_0x965cf2[_0xbc6c('0x1a')]=qs[_0xbc6c('0x1a')](_0x23f4c0[_0xbc6c('0x27')][_0xbc6c('0x1a')]);}_0x965cf2['order']=qs[_0xbc6c('0x2e')](_0x23f4c0['query'][_0xbc6c('0x2e')]);_0x965cf2[_0xbc6c('0x2f')]=qs[_0xbc6c('0x28')](_[_0xbc6c('0x30')](_0x23f4c0['query'],_0x3910a1['filters']));if(_0x23f4c0[_0xbc6c('0x27')][_0xbc6c('0x31')]){_0x965cf2[_0xbc6c('0x2f')]=_[_0xbc6c('0x32')](_0x965cf2[_0xbc6c('0x2f')],{'$or':_[_0xbc6c('0x33')](_0x26c2f5,function(_0x346d6d){if(_0x346d6d[_0xbc6c('0x34')]['key']!=='VIRTUAL'){var _0x3ad86d={};_0x3ad86d[_0x346d6d[_0xbc6c('0x35')]]={'$like':'%'+_0x23f4c0[_0xbc6c('0x27')][_0xbc6c('0x31')]+'%'};return _0x3ad86d;}})});}_0x965cf2=_[_0xbc6c('0x32')]({},_0x965cf2,_0x23f4c0[_0xbc6c('0x36')]);var _0x5518cd={'where':_0x965cf2[_0xbc6c('0x2f')]};return db[_0xbc6c('0x23')][_0xbc6c('0x19')](_0x5518cd)['then'](function(_0xf4ac71){_0x4132a8[_0xbc6c('0x19')]=_0xf4ac71;if(_0x23f4c0['query']['includeAll']){_0x965cf2[_0xbc6c('0x37')]=[{'all':!![]}];}return db['Attachment'][_0xbc6c('0x38')](_0x965cf2);})[_0xbc6c('0x1f')](function(_0x377e69){_0x4132a8['rows']=_0x377e69;return _0x4132a8;})[_0xbc6c('0x1f')](respondWithFilteredResult(_0x3bf9f1,_0x965cf2))[_0xbc6c('0x39')](handleError(_0x3bf9f1,null));};exports[_0xbc6c('0x3a')]=function(_0x495e84,_0x25c859){var _0x4d9c44={'raw':!![],'where':{'id':_0x495e84[_0xbc6c('0x3b')]['id']}},_0x359bdf={};_0x359bdf[_0xbc6c('0x25')]=_[_0xbc6c('0x26')](db[_0xbc6c('0x23')][_0xbc6c('0x24')]);_0x359bdf[_0xbc6c('0x27')]=_[_0xbc6c('0x26')](_0x495e84['query']);_0x359bdf[_0xbc6c('0x28')]=_['intersection'](_0x359bdf[_0xbc6c('0x25')],_0x359bdf[_0xbc6c('0x27')]);_0x4d9c44['attributes']=_[_0xbc6c('0x29')](_0x359bdf[_0xbc6c('0x25')],qs[_0xbc6c('0x3c')](_0x495e84[_0xbc6c('0x27')][_0xbc6c('0x3c')]));_0x4d9c44['attributes']=_0x4d9c44[_0xbc6c('0x2a')][_0xbc6c('0x2b')]?_0x4d9c44[_0xbc6c('0x2a')]:_0x359bdf[_0xbc6c('0x25')];if(_0x495e84[_0xbc6c('0x27')][_0xbc6c('0x3d')]){_0x4d9c44[_0xbc6c('0x37')]=[{'all':!![]}];}_0x4d9c44=_[_0xbc6c('0x32')]({},_0x4d9c44,_0x495e84[_0xbc6c('0x36')]);return db[_0xbc6c('0x23')][_0xbc6c('0x3e')](_0x4d9c44)[_0xbc6c('0x1f')](handleEntityNotFound(_0x25c859,null))[_0xbc6c('0x1f')](respondWithResult(_0x25c859,null))[_0xbc6c('0x39')](handleError(_0x25c859,null));};exports[_0xbc6c('0x1e')]=function(_0x3f3d63,_0x43f35e){if(_0x3f3d63[_0xbc6c('0x3f')]['id']){delete _0x3f3d63[_0xbc6c('0x3f')]['id'];}return db['Attachment']['find']({'where':{'id':_0x3f3d63['params']['id']}})[_0xbc6c('0x1f')](handleEntityNotFound(_0x43f35e,null))[_0xbc6c('0x1f')](saveUpdates(_0x3f3d63[_0xbc6c('0x3f')],null))[_0xbc6c('0x1f')](respondWithResult(_0x43f35e,null))['catch'](handleError(_0x43f35e,null));};exports[_0xbc6c('0x20')]=function(_0x248d2c,_0x68e917){return db[_0xbc6c('0x23')][_0xbc6c('0x3e')]({'where':{'id':_0x248d2c[_0xbc6c('0x3b')]['id']}})[_0xbc6c('0x1f')](handleEntityNotFound(_0x68e917,null))[_0xbc6c('0x1f')](removeEntity(_0x68e917,null))['catch'](handleError(_0x68e917,null));};exports[_0xbc6c('0x40')]=function(_0x474d9a,_0x11706a,_0x8583f6){_0x474d9a[_0xbc6c('0x3f')][_0xbc6c('0x22')]=_0x474d9a[_0xbc6c('0x41')][_0xbc6c('0x42')];_0x474d9a[_0xbc6c('0x3f')][_0xbc6c('0x43')]=_0x474d9a[_0xbc6c('0x41')][_0xbc6c('0x44')];_0x474d9a[_0xbc6c('0x3f')][_0xbc6c('0x34')]=_0x474d9a[_0xbc6c('0x41')][_0xbc6c('0x45')];return db['Attachment'][_0xbc6c('0x40')](_0x474d9a[_0xbc6c('0x3f')])[_0xbc6c('0x1f')](respondWithResult(_0x11706a,0xc9))['catch'](handleError(_0x11706a,null));};exports[_0xbc6c('0x46')]=function(_0x13446d,_0x2590f5,_0x571a47){return db['Attachment']['findOne']({'where':{'id':_0x13446d[_0xbc6c('0x3b')]['id']},'raw':!![]})[_0xbc6c('0x1f')](handleEntityNotFound(_0x2590f5,null))[_0xbc6c('0x1f')](function(_0x3c5660){if(_0x3c5660){return _0x2590f5['download'](path[_0xbc6c('0x47')](config[_0xbc6c('0x48')],'server/files/attachments/',_0x3c5660[_0xbc6c('0x43')]));}})[_0xbc6c('0x39')](handleError(_0x2590f5,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 235e55d..8674dc3 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 _0xa478=['bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment'];(function(_0x53ed08,_0x444ba4){var _0x9e3d30=function(_0xf73410){while(--_0xf73410){_0x53ed08['push'](_0x53ed08['shift']());}};_0x9e3d30(++_0x444ba4);}(_0xa478,0x136));var _0x8a47=function(_0x215393,_0x4c406d){_0x215393=_0x215393-0x0;var _0x595198=_0xa478[_0x215393];return _0x595198;};'use strict';var _=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var logger=require(_0x8a47('0x2'))(_0x8a47('0x3'));var moment=require(_0x8a47('0x4'));var BPromise=require(_0x8a47('0x5'));var rp=require(_0x8a47('0x6'));var fs=require('fs');var path=require(_0x8a47('0x7'));var rimraf=require(_0x8a47('0x8'));var config=require(_0x8a47('0x9'));var attributes=require(_0x8a47('0xa'));module[_0x8a47('0xb')]=function(_0x50226a,_0x413787){return _0x50226a[_0x8a47('0xc')](_0x8a47('0xd'),attributes,{'tableName':_0x8a47('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd844=['Attachment','lodash','util','api','moment','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x29352f,_0x458a13){var _0x217e89=function(_0x54ec85){while(--_0x54ec85){_0x29352f['push'](_0x29352f['shift']());}};_0x217e89(++_0x458a13);}(_0xd844,0x6d));var _0x4d84=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd844[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x4d84('0x0'));var util=require(_0x4d84('0x1'));var logger=require('../../config/logger')(_0x4d84('0x2'));var moment=require(_0x4d84('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d84('0x4'));var rimraf=require(_0x4d84('0x5'));var config=require(_0x4d84('0x6'));var attributes=require(_0x4d84('0x7'));module['exports']=function(_0x14fbd4,_0x5e926e){return _0x14fbd4['define'](_0x4d84('0x8'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 02afa5d..077be25 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 _0x0ca5=['then','info','Attachment,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request'];(function(_0x4f3561,_0x19dc7f){var _0x1d3544=function(_0x23f0cd){while(--_0x23f0cd){_0x4f3561['push'](_0x4f3561['shift']());}};_0x1d3544(++_0x19dc7f);}(_0x0ca5,0x17d));var _0x50ca=function(_0x168384,_0x3f6bbb){_0x168384=_0x168384-0x0;var _0x468fb4=_0x0ca5[_0x168384];return _0x468fb4;};'use strict';var _=require(_0x50ca('0x0'));var util=require('util');var moment=require(_0x50ca('0x1'));var BPromise=require('bluebird');var rs=require(_0x50ca('0x2'));var fs=require('fs');var Redis=require(_0x50ca('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x50ca('0x4'));var logger=require(_0x50ca('0x5'))(_0x50ca('0x6'));var config=require('../../config/environment');var jayson=require(_0x50ca('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x220b43,_0x788590,_0x5a8860){return new BPromise(function(_0x7147a4,_0x26bdef){return client[_0x50ca('0x8')](_0x220b43,_0x5a8860)[_0x50ca('0x9')](function(_0x136c84){logger[_0x50ca('0xa')](_0x50ca('0xb'),_0x788590,'request\x20sent');logger[_0x50ca('0xc')]('Attachment,\x20%s,\x20%s,\x20%s',_0x788590,'request\x20sent',JSON[_0x50ca('0xd')](_0x136c84));if(_0x136c84[_0x50ca('0xe')]){if(_0x136c84[_0x50ca('0xe')][_0x50ca('0xf')]===0x1f4){logger[_0x50ca('0xe')](_0x50ca('0xb'),_0x788590,_0x136c84['error']['message']);return _0x26bdef(_0x136c84[_0x50ca('0xe')][_0x50ca('0x10')]);}logger[_0x50ca('0xe')]('Attachment,\x20%s,\x20%s',_0x788590,_0x136c84[_0x50ca('0xe')]['message']);return _0x7147a4(_0x136c84[_0x50ca('0xe')]['message']);}else{logger['info'](_0x50ca('0xb'),_0x788590,_0x50ca('0x11'));_0x7147a4(_0x136c84[_0x50ca('0x12')][_0x50ca('0x10')]);}})[_0x50ca('0x13')](function(_0x1753aa){logger[_0x50ca('0xe')](_0x50ca('0xb'),_0x788590,_0x1753aa);_0x26bdef(_0x1753aa);});});}exports[_0x50ca('0x14')]=function(_0x4174ab){var _0x31cecc=this;return new Promise(function(_0x196e4d,_0x57b78f){return db[_0x50ca('0x15')][_0x50ca('0x16')](_0x4174ab[_0x50ca('0x17')],{'raw':_0x4174ab['options']?_0x4174ab[_0x50ca('0x18')][_0x50ca('0x19')]===undefined?!![]:![]:!![]})[_0x50ca('0x9')](function(_0x20f5c3){logger[_0x50ca('0xa')](_0x50ca('0x14'),_0x4174ab);logger[_0x50ca('0xc')](_0x50ca('0x14'),_0x4174ab,JSON[_0x50ca('0xd')](_0x20f5c3));_0x196e4d(_0x20f5c3);})[_0x50ca('0x13')](function(_0x2cf4ef){logger[_0x50ca('0xe')](_0x50ca('0x14'),_0x2cf4ef['message'],_0x4174ab);_0x57b78f(_0x31cecc[_0x50ca('0xe')](0x1f4,_0x2cf4ef[_0x50ca('0x10')]));});});}; \ No newline at end of file +var _0xd1af=['rpc','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','Attachment','body','options','raw','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x25a7e6,_0x18de96){var _0x592645=function(_0x19d2a0){while(--_0x19d2a0){_0x25a7e6['push'](_0x25a7e6['shift']());}};_0x592645(++_0x18de96);}(_0xd1af,0x19b));var _0xfd1a=function(_0x346eac,_0x3515d8){_0x346eac=_0x346eac-0x0;var _0x34b293=_0xd1af[_0x346eac];return _0x34b293;};'use strict';var _=require(_0xfd1a('0x0'));var util=require(_0xfd1a('0x1'));var moment=require(_0xfd1a('0x2'));var BPromise=require(_0xfd1a('0x3'));var rs=require(_0xfd1a('0x4'));var fs=require('fs');var Redis=require(_0xfd1a('0x5'));var db=require(_0xfd1a('0x6'))['db'];var utils=require(_0xfd1a('0x7'));var logger=require(_0xfd1a('0x8'))(_0xfd1a('0x9'));var config=require('../../config/environment');var jayson=require(_0xfd1a('0xa'));var client=jayson[_0xfd1a('0xb')][_0xfd1a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ecf59,_0x935b1a,_0x2723b1){return new BPromise(function(_0xb3f968,_0x16e71f){return client[_0xfd1a('0xd')](_0x4ecf59,_0x2723b1)[_0xfd1a('0xe')](function(_0x20e8de){logger[_0xfd1a('0xf')](_0xfd1a('0x10'),_0x935b1a,_0xfd1a('0x11'));logger[_0xfd1a('0x12')]('Attachment,\x20%s,\x20%s,\x20%s',_0x935b1a,_0xfd1a('0x11'),JSON[_0xfd1a('0x13')](_0x20e8de));if(_0x20e8de[_0xfd1a('0x14')]){if(_0x20e8de[_0xfd1a('0x14')][_0xfd1a('0x15')]===0x1f4){logger[_0xfd1a('0x14')](_0xfd1a('0x10'),_0x935b1a,_0x20e8de[_0xfd1a('0x14')][_0xfd1a('0x16')]);return _0x16e71f(_0x20e8de[_0xfd1a('0x14')][_0xfd1a('0x16')]);}logger[_0xfd1a('0x14')]('Attachment,\x20%s,\x20%s',_0x935b1a,_0x20e8de[_0xfd1a('0x14')][_0xfd1a('0x16')]);return _0xb3f968(_0x20e8de['error'][_0xfd1a('0x16')]);}else{logger[_0xfd1a('0xf')](_0xfd1a('0x10'),_0x935b1a,_0xfd1a('0x11'));_0xb3f968(_0x20e8de[_0xfd1a('0x17')][_0xfd1a('0x16')]);}})[_0xfd1a('0x18')](function(_0x4cbad5){logger['error'](_0xfd1a('0x10'),_0x935b1a,_0x4cbad5);_0x16e71f(_0x4cbad5);});});}exports['CreateAttachment']=function(_0x164d44){var _0x2e5de1=this;return new Promise(function(_0x40be93,_0x173002){return db[_0xfd1a('0x19')]['create'](_0x164d44[_0xfd1a('0x1a')],{'raw':_0x164d44[_0xfd1a('0x1b')]?_0x164d44[_0xfd1a('0x1b')][_0xfd1a('0x1c')]===undefined?!![]:![]:!![]})[_0xfd1a('0xe')](function(_0x323026){logger['info'](_0xfd1a('0x1d'),_0x164d44);logger[_0xfd1a('0x12')](_0xfd1a('0x1d'),_0x164d44,JSON[_0xfd1a('0x13')](_0x323026));_0x40be93(_0x323026);})[_0xfd1a('0x18')](function(_0x578111){logger['error'](_0xfd1a('0x1d'),_0x578111[_0xfd1a('0x16')],_0x164d44);_0x173002(_0x2e5de1[_0xfd1a('0x14')](0x1f4,_0x578111[_0xfd1a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 1581eed..d456755 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 _0x40f3=['file','create','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/attachments/','format','now','originalname','single'];(function(_0x1beab4,_0x287d3d){var _0x3a9977=function(_0x55806d){while(--_0x55806d){_0x1beab4['push'](_0x1beab4['shift']());}};_0x3a9977(++_0x287d3d);}(_0x40f3,0x146));var _0x340f=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x40f3[_0x2112d4];return _0x434972;};'use strict';var multer=require(_0x340f('0x0'));var util=require('util');var path=require(_0x340f('0x1'));var timeout=require('connect-timeout');var express=require(_0x340f('0x2'));var router=express[_0x340f('0x3')]();var auth=require(_0x340f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x340f('0x5'));var controller=require(_0x340f('0x6'));router[_0x340f('0x7')]('/',auth[_0x340f('0x8')](),controller[_0x340f('0x9')]);router[_0x340f('0x7')](_0x340f('0xa'),auth[_0x340f('0x8')](),controller[_0x340f('0xb')]);router['get'](_0x340f('0xc'),auth[_0x340f('0x8')](),controller[_0x340f('0xd')]);var upload=multer({'storage':multer[_0x340f('0xe')]({'destination':function(_0x3c42a3,_0x1301bb,_0x197acb){_0x197acb(null,path[_0x340f('0xf')](config[_0x340f('0x10')],_0x340f('0x11')));},'filename':function(_0x4a7393,_0x32e242,_0x193b8b){_0x193b8b(null,util[_0x340f('0x12')]('%s-%s',Date[_0x340f('0x13')](),_0x32e242[_0x340f('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload[_0x340f('0x15')](_0x340f('0x16')),controller[_0x340f('0x17')]);router[_0x340f('0x18')](_0x340f('0xa'),auth[_0x340f('0x8')](),controller[_0x340f('0x19')]);router[_0x340f('0x1a')](_0x340f('0xa'),auth[_0x340f('0x8')](),controller[_0x340f('0x1b')]);module[_0x340f('0x1c')]=router; \ No newline at end of file +var _0x4033=['get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./attachment.controller'];(function(_0x42ea2c,_0x351d92){var _0xb65878=function(_0x3d7877){while(--_0x3d7877){_0x42ea2c['push'](_0x42ea2c['shift']());}};_0xb65878(++_0x351d92);}(_0x4033,0xff));var _0x3403=function(_0x5300b6,_0x4a5846){_0x5300b6=_0x5300b6-0x0;var _0x58980e=_0x4033[_0x5300b6];return _0x58980e;};'use strict';var multer=require(_0x3403('0x0'));var util=require(_0x3403('0x1'));var path=require(_0x3403('0x2'));var timeout=require(_0x3403('0x3'));var express=require(_0x3403('0x4'));var router=express[_0x3403('0x5')]();var auth=require(_0x3403('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3403('0x7'));var controller=require(_0x3403('0x8'));router[_0x3403('0x9')]('/',auth[_0x3403('0xa')](),controller[_0x3403('0xb')]);router[_0x3403('0x9')](_0x3403('0xc'),auth[_0x3403('0xa')](),controller[_0x3403('0xd')]);router[_0x3403('0x9')](_0x3403('0xe'),auth[_0x3403('0xa')](),controller[_0x3403('0xf')]);var upload=multer({'storage':multer[_0x3403('0x10')]({'destination':function(_0x800abc,_0x47401c,_0x593b9a){_0x593b9a(null,path[_0x3403('0x11')](config[_0x3403('0x12')],_0x3403('0x13')));},'filename':function(_0x19b413,_0xd3932e,_0x3640f3){_0x3640f3(null,util[_0x3403('0x14')](_0x3403('0x15'),Date['now'](),_0xd3932e[_0x3403('0x16')][_0x3403('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3403('0x18')]('/',upload[_0x3403('0x19')](_0x3403('0x1a')),controller[_0x3403('0x1b')]);router[_0x3403('0x1c')]('/:id',auth[_0x3403('0xa')](),controller[_0x3403('0x1d')]);router[_0x3403('0x1e')](_0x3403('0xc'),auth[_0x3403('0xa')](),controller[_0x3403('0x1f')]);module[_0x3403('0x20')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 8ad9dc2..94ebfcd 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 _0x5e29=['getLicense','catch','passport','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','google','/login','email','authenticate','use','clientID','clientSecret','callbackURL','Setting','blockDuration','find','map','emails','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes'];(function(_0x270a43,_0x29fe00){var _0x4980ee=function(_0x46ca4f){while(--_0x46ca4f){_0x270a43['push'](_0x270a43['shift']());}};_0x4980ee(++_0x29fe00);}(_0x5e29,0xe2));var _0x95e2=function(_0x17d69e,_0x27717d){_0x17d69e=_0x17d69e-0x0;var _0x4b153f=_0x5e29[_0x17d69e];return _0x4b153f;};'use strict';var _=require('lodash');var passport=require(_0x95e2('0x0'));var GoogleStrategy=require(_0x95e2('0x1'))[_0x95e2('0x2')];var moment=require('moment');var db=require(_0x95e2('0x3'))['db'];var config=require(_0x95e2('0x4'));var signToken=require(_0x95e2('0x5'))[_0x95e2('0x6')];var utils=require(_0x95e2('0x7'));exports[_0x95e2('0x8')]=passport['authenticate'](_0x95e2('0x9'),{'failureRedirect':_0x95e2('0xa'),'scope':['profile',_0x95e2('0xb')],'session':![]});exports['callback']=passport[_0x95e2('0xc')](_0x95e2('0x9'),{'failureRedirect':_0x95e2('0xa'),'session':![]});passport[_0x95e2('0xd')](new GoogleStrategy({'clientID':config['google']?config[_0x95e2('0x9')][_0x95e2('0xe')]:'id','clientSecret':config[_0x95e2('0x9')]?config['google'][_0x95e2('0xf')]:'secret','callbackURL':config['google']?config[_0x95e2('0x9')][_0x95e2('0x10')]:''},function(_0x25e7e8,_0x28d362,_0x1c4841,_0xd17932){var _0x1fbed0,_0x223855;return db[_0x95e2('0x11')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x95e2('0x12')],'raw':!![]})['then'](function(_0x5034b3){_0x1fbed0=_0x5034b3;return db['User'][_0x95e2('0x13')]({'where':{'email':_[_0x95e2('0x14')](_0x1c4841[_0x95e2('0x15')],'value'),'role':{'$or':['admin',_0x95e2('0x16'),_0x95e2('0x17')]}}});})[_0x95e2('0x18')](function(_0x2cf151){_0x223855=_0x2cf151;if(_0x223855){if(_0x223855['disabled']){return _0xd17932(_0x95e2('0x19'));}else if(_0x1fbed0[_0x95e2('0x12')]>0x0){if(_0x223855[_0x95e2('0x1a')]){if(moment(_0x223855[_0x95e2('0x1b')])[_0x95e2('0x1c')](_0x1fbed0[_0x95e2('0x12')],_0x95e2('0x1d'))>moment()){return _0xd17932(_0x95e2('0x19'));}else{return utils['clearBlockUser'](_0x223855,0x0,![],null)[_0x95e2('0x18')](function(){return utils[_0x95e2('0x1e')](_0x223855);})[_0x95e2('0x18')](function(){return _0xd17932(null,_0x223855);});}}else{return utils[_0x95e2('0x1e')](_0x223855)[_0x95e2('0x18')](function(){return _0xd17932(null,_0x223855);});}}else{return utils['getLicense'](_0x223855)['then'](function(){return _0xd17932(null,_0x223855);});}}return _0xd17932(_0x95e2('0x19'));})[_0x95e2('0x1f')](function(_0x13659c){_0xd17932(_0x13659c);});})); \ No newline at end of file +var _0xeca7=['User','find','map','value','user','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','login','authenticate','google','/login','profile','email','callback','clientID','clientSecret','secret','callbackURL','Setting','blockDuration','then'];(function(_0x5303b9,_0x5c548){var _0x455125=function(_0x24ad74){while(--_0x24ad74){_0x5303b9['push'](_0x5303b9['shift']());}};_0x455125(++_0x5c548);}(_0xeca7,0x160));var _0x7eca=function(_0x566622,_0x399507){_0x566622=_0x566622-0x0;var _0x1851dd=_0xeca7[_0x566622];return _0x1851dd;};'use strict';var _=require(_0x7eca('0x0'));var passport=require(_0x7eca('0x1'));var GoogleStrategy=require(_0x7eca('0x2'))['Strategy'];var moment=require(_0x7eca('0x3'));var db=require(_0x7eca('0x4'))['db'];var config=require(_0x7eca('0x5'));var signToken=require(_0x7eca('0x6'))[_0x7eca('0x7')];var utils=require('../../config/utils');exports[_0x7eca('0x8')]=passport[_0x7eca('0x9')](_0x7eca('0xa'),{'failureRedirect':_0x7eca('0xb'),'scope':[_0x7eca('0xc'),_0x7eca('0xd')],'session':![]});exports[_0x7eca('0xe')]=passport[_0x7eca('0x9')](_0x7eca('0xa'),{'failureRedirect':_0x7eca('0xb'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x7eca('0xa')]?config[_0x7eca('0xa')][_0x7eca('0xf')]:'id','clientSecret':config[_0x7eca('0xa')]?config[_0x7eca('0xa')][_0x7eca('0x10')]:_0x7eca('0x11'),'callbackURL':config['google']?config[_0x7eca('0xa')][_0x7eca('0x12')]:''},function(_0x7d9b9d,_0x5cb893,_0x3bee86,_0x7721a4){var _0x5ab175,_0x25fb37;return db[_0x7eca('0x13')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x7eca('0x14')],'raw':!![]})[_0x7eca('0x15')](function(_0xb65a4d){_0x5ab175=_0xb65a4d;return db[_0x7eca('0x16')][_0x7eca('0x17')]({'where':{'email':_[_0x7eca('0x18')](_0x3bee86['emails'],_0x7eca('0x19')),'role':{'$or':['admin',_0x7eca('0x1a'),'agent']}}});})[_0x7eca('0x15')](function(_0xf30744){_0x25fb37=_0xf30744;if(_0x25fb37){if(_0x25fb37[_0x7eca('0x1b')]){return _0x7721a4(_0x7eca('0x1c'));}else if(_0x5ab175[_0x7eca('0x14')]>0x0){if(_0x25fb37[_0x7eca('0x1d')]){if(moment(_0x25fb37['blockedAt'])[_0x7eca('0x1e')](_0x5ab175['blockDuration'],'minutes')>moment()){return _0x7721a4('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x7eca('0x1f')](_0x25fb37,0x0,![],null)[_0x7eca('0x15')](function(){return utils['getLicense'](_0x25fb37);})[_0x7eca('0x15')](function(){return _0x7721a4(null,_0x25fb37);});}}else{return utils[_0x7eca('0x20')](_0x25fb37)[_0x7eca('0x15')](function(){return _0x7721a4(null,_0x25fb37);});}}else{return utils[_0x7eca('0x20')](_0x25fb37)[_0x7eca('0x15')](function(){return _0x7721a4(null,_0x25fb37);});}}return _0x7721a4(_0x7eca('0x1c'));})[_0x7eca('0x21')](function(_0x352a69){_0x7721a4(_0x352a69);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index e949f65..b982af8 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 _0x4f88=['setTokenCookie','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login'];(function(_0x2d6faa,_0x442cd3){var _0x4f0bc0=function(_0x561e27){while(--_0x561e27){_0x2d6faa['push'](_0x2d6faa['shift']());}};_0x4f0bc0(++_0x442cd3);}(_0x4f88,0xf3));var _0x84f8=function(_0x5e1e25,_0xdc1421){_0x5e1e25=_0x5e1e25-0x0;var _0x548e5f=_0x4f88[_0x5e1e25];return _0x548e5f;};'use strict';var express=require(_0x84f8('0x0'));var passport=require(_0x84f8('0x1'));var router=express['Router']();var controller=require(_0x84f8('0x2'));var userController=require(_0x84f8('0x3'));var authService=require(_0x84f8('0x4'));router['get']('/',controller['login']);router[_0x84f8('0x5')](_0x84f8('0x6'),controller[_0x84f8('0x7')],authService[_0x84f8('0x8')],userController[_0x84f8('0x9')],authService[_0x84f8('0xa')]);module['exports']=router; \ No newline at end of file +var _0xfa7c=['get','login','/callback','isMiddleware','setTokenCookie','exports','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service'];(function(_0x8b0ec4,_0xd05d5b){var _0x2f31d6=function(_0x4dd8bb){while(--_0x4dd8bb){_0x8b0ec4['push'](_0x8b0ec4['shift']());}};_0x2f31d6(++_0xd05d5b);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x4dd9ba,_0x409e8c){_0x4dd9ba=_0x4dd9ba-0x0;var _0x560726=_0xfa7c[_0x4dd9ba];return _0x560726;};'use strict';var express=require(_0xcfa7('0x0'));var passport=require('passport');var router=express[_0xcfa7('0x1')]();var controller=require(_0xcfa7('0x2'));var userController=require(_0xcfa7('0x3'));var authService=require(_0xcfa7('0x4'));router[_0xcfa7('0x5')]('/',controller[_0xcfa7('0x6')]);router[_0xcfa7('0x5')](_0xcfa7('0x7'),controller['callback'],authService[_0xcfa7('0x8')],userController[_0xcfa7('0x6')],authService[_0xcfa7('0x9')]);module[_0xcfa7('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 106ba32..7809e23 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 _0x6660=['signToken','../../config/utils','http','findOne','allowedLoginAttempts','blockDuration','then','salt','role','disabled','blocked','blockedAt','loginAttempts','user','agent','name','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','pass','format','\x22%s\x22\x20<%s>','request','SendMail','error','stringify','status','send','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','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','http://','/reset/','Reset\x20Email\x20sent!','reset','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','password','resetPasswordExpires','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service'];(function(_0x31d134,_0x2ced4d){var _0x4c613f=function(_0x2b5c6){while(--_0x2b5c6){_0x31d134['push'](_0x31d134['shift']());}};_0x4c613f(++_0x2ced4d);}(_0x6660,0x1e3));var _0x0666=function(_0x411722,_0x15976d){_0x411722=_0x411722-0x0;var _0x2d7e13=_0x6660[_0x411722];return _0x2d7e13;};'use strict';var util=require('util');var passport=require(_0x0666('0x0'));var LocalStrategy=require(_0x0666('0x1'))[_0x0666('0x2')];var jayson=require(_0x0666('0x3'));var _=require(_0x0666('0x4'));var rs=require(_0x0666('0x5'));var moment=require(_0x0666('0x6'));var db=require(_0x0666('0x7'))['db'];var signToken=require(_0x0666('0x8'))[_0x0666('0x9')];var utils=require(_0x0666('0xa'));var client=jayson['client'][_0x0666('0xb')]({'port':0x232b});function localAuthenticate(_0x3a8644,_0x18896e,_0x388eea,_0x2228f7){var _0x72939f,_0x3825df;return db['Setting'][_0x0666('0xc')]({'where':{'id':0x1},'attributes':[_0x0666('0xd'),_0x0666('0xe')],'raw':!![]})[_0x0666('0xf')](function(_0x1c1d6e){_0x72939f=_0x1c1d6e;return _0x3a8644[_0x0666('0xc')]({'attributes':['id','name','password',_0x0666('0x10'),_0x0666('0x11'),_0x0666('0x12'),_0x0666('0x13'),_0x0666('0x14'),_0x0666('0x15')],'where':{'name':_0x18896e,'role':{'$or':['admin',_0x0666('0x16'),_0x0666('0x17')]}}});})[_0x0666('0xf')](function(_0x33db4f){if(!_0x33db4f||_0x33db4f&&_0x33db4f[_0x0666('0x18')]!==_0x18896e){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x3825df=_0x33db4f;return _0x3825df;}})[_0x0666('0xf')](function(){_0x3825df[_0x0666('0x19')](_0x388eea,function(_0x1c957f,_0x46a2c9){var _0x59de24=_0x3825df[_0x0666('0x15')]+0x1;if(_0x1c957f){return _0x2228f7(_0x1c957f);}else if(!_0x46a2c9){if(_0x3825df[_0x0666('0x12')]){return _0x2228f7(null,![],{'message':_0x0666('0x1a')});}else if(_0x72939f[_0x0666('0xd')]>0x0){if(_0x3825df[_0x0666('0x13')]){if(_0x72939f[_0x0666('0xe')]>0x0){if(moment(_0x3825df[_0x0666('0x14')])[_0x0666('0x1b')](_0x72939f[_0x0666('0xe')],_0x0666('0x1c'))>moment()){return _0x2228f7(null,![],{'message':_0x0666('0x1a')});}else{return utils['clearBlockUser'](_0x3825df,_0x59de24,![],null)[_0x0666('0xf')](function(){return _0x2228f7(null,![],{'message':_0x0666('0x1a')});});}}else{return _0x2228f7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x59de24>=_0x72939f['allowedLoginAttempts']){return utils['clearBlockUser'](_0x3825df,0x0,!![],moment())[_0x0666('0xf')](function(){return _0x2228f7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x0666('0x1d')](_0x3825df,_0x59de24,![],null)[_0x0666('0xf')](function(){return _0x2228f7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x2228f7(null,![],{'message':_0x0666('0x1a')});}}else{if(_0x3825df['disabled']){return _0x2228f7(null,![],{'message':_0x0666('0x1a')});}else if(_0x72939f['allowedLoginAttempts']>0x0){if(_0x3825df['blocked']){if(_0x72939f[_0x0666('0xe')]>0x0){if(moment(_0x3825df[_0x0666('0x14')])[_0x0666('0x1b')](_0x72939f[_0x0666('0xe')],_0x0666('0x1c'))>moment()){return _0x2228f7(null,![],{'message':_0x0666('0x1a')});}else{return utils[_0x0666('0x1d')](_0x3825df,0x0,![],null)[_0x0666('0xf')](function(){return utils[_0x0666('0x1e')](_0x3825df);})[_0x0666('0xf')](function(){return _0x2228f7(null,_0x3825df);});}}else{return _0x2228f7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x0666('0x1d')](_0x3825df,0x0,![],null)['then'](function(){return utils[_0x0666('0x1e')](_0x3825df);})['then'](function(){return _0x2228f7(null,_0x3825df);})['catch'](function(_0x2f866a){return _0x2228f7(null,![],_0x2f866a);});}}else{if(_0x3825df[_0x0666('0x13')]){return _0x2228f7(null,![],{'message':_0x0666('0x1a')});}else{return utils['getLicense'](_0x3825df)['then'](function(){return _0x2228f7(null,_0x3825df);});}}}});})[_0x0666('0x1f')](function(_0x160b9c){return _0x2228f7(null,![],_0x160b9c);});}function sendServiceMail(_0x43948b){return db[_0x0666('0x20')][_0x0666('0x21')]({'where':{'service':!![]},'attributes':['id',_0x0666('0x18'),_0x0666('0x22')],'include':[{'model':db[_0x0666('0x23')],'as':_0x0666('0x24')}]})['then'](function(_0xc52a7c){if(!_0xc52a7c){throw new Error(_0x0666('0x25'));}var _0x5bd5c0={'tls':{'rejectUnauthorized':![]}};if(_0xc52a7c[_0x0666('0x24')][_0x0666('0x26')]){_0x5bd5c0[_0x0666('0x26')]=_0xc52a7c[_0x0666('0x24')][_0x0666('0x26')];}else{_0x5bd5c0[_0x0666('0x27')]=_0xc52a7c['Smtp']['host'];_0x5bd5c0['port']=_0xc52a7c['Smtp'][_0x0666('0x28')];_0x5bd5c0[_0x0666('0x29')]=_0xc52a7c[_0x0666('0x24')]['secure'];}if(_0xc52a7c[_0x0666('0x24')]['authentication']){_0x5bd5c0[_0x0666('0x2a')]={'user':_0xc52a7c[_0x0666('0x24')][_0x0666('0x16')],'pass':_0xc52a7c[_0x0666('0x24')][_0x0666('0x2b')]};}var _0x1909aa={'account':_0x5bd5c0,'message':_['merge']({'from':util[_0x0666('0x2c')](_0x0666('0x2d'),_0xc52a7c['name'],_0xc52a7c[_0x0666('0x22')]||_0xc52a7c[_0x0666('0x24')][_0x0666('0x16')])},_0x43948b)};return client[_0x0666('0x2e')](_0x0666('0x2f'),_0x1909aa);})[_0x0666('0xf')](function(_0x28d234){if(_0x28d234[_0x0666('0x30')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x28d234['error']['message']||JSON[_0x0666('0x31')](_0x28d234[_0x0666('0x30')])));}return!![];});}function handleError(_0x215d94,_0x3018f1,_0x2075a0){return _0x215d94[_0x0666('0x32')](_0x3018f1||0x1f4)[_0x0666('0x33')]({'message':_0x2075a0?_0x2075a0['message']||_0x2075a0:''});}function checkPasswordPattern(_0x4a3c75,_0x429680,_0x2ceb2b){if(_0x2ceb2b){var _0x5dc489=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5dc489[_0x0666('0x34')](_0x429680)){return _0x4a3c75;}else{throw new Error(_0x0666('0x35'));}}else{return _0x4a3c75;}}exports[_0x0666('0x36')]=function(_0x4e6803,_0x343dc7,_0x1f6ba1){passport['authenticate'](_0x0666('0x37'),function(_0x141f9c,_0x38d7ee,_0x390229){var _0x31cbef=_0x141f9c||_0x390229;if(_0x31cbef){return handleError(_0x343dc7,0x191,_0x31cbef);}if(!_0x38d7ee){return handleError(_0x343dc7,0x194,{'message':_0x0666('0x38')});}else{var _0x48758c=signToken(_0x38d7ee['id'],_0x38d7ee[_0x0666('0x11')]);_0x343dc7[_0x0666('0x39')]({'id':_0x38d7ee['id'],'token':_0x48758c,'statusCall':'','isAlreadyLogged':_0x38d7ee[_0x0666('0x3a')]});}})(_0x4e6803,_0x343dc7,_0x1f6ba1);};exports['forgot']=function(_0x29cd8f,_0x271902,_0x1cc27c){if(!_0x29cd8f['body']['email']){return handleError(_0x271902,0x1f4,{'message':_0x0666('0x3b')});}var _0x131cd0=rs[_0x0666('0x3c')]();_0x29cd8f[_0x0666('0x3d')][_0x0666('0x22')]=_0x29cd8f[_0x0666('0x3d')]['email'][_0x0666('0x3e')]()[_0x0666('0x3f')]();var _0x191cd4;return db['Setting'][_0x0666('0xc')]({'where':{'id':0x1},'attributes':[_0x0666('0xd'),'blockDuration'],'raw':!![]})[_0x0666('0xf')](function(_0x42fa81){_0x191cd4=_0x42fa81;return db['User'][_0x0666('0x21')]({'where':{'email':_0x29cd8f[_0x0666('0x3d')][_0x0666('0x22')]}});})[_0x0666('0xf')](function(_0x2a1475){if(!_0x2a1475){throw new Error(_0x0666('0x40'));}if(_0x2a1475['disabled']){throw new Error(_0x0666('0x41'));}if(_0x2a1475[_0x0666('0x13')]){if(moment(_0x2a1475[_0x0666('0x14')])['add'](_0x191cd4[_0x0666('0xe')],_0x0666('0x1c'))>moment()){throw new Error(_0x0666('0x42'));}else{_0x2a1475[_0x0666('0x13')]=![];_0x2a1475[_0x0666('0x14')]=null;}}_0x2a1475[_0x0666('0x43')]=_0x131cd0;_0x2a1475['resetPasswordExpires']=Date[_0x0666('0x44')]()+0x36ee80;return _0x2a1475[_0x0666('0x45')]();})[_0x0666('0xf')](function(){return sendServiceMail({'to':_0x29cd8f[_0x0666('0x3d')][_0x0666('0x22')],'subject':_0x0666('0x46'),'text':_0x0666('0x47')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x0666('0x48')+_0x29cd8f['headers'][_0x0666('0x27')]+_0x0666('0x49')+_0x131cd0+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x0666('0xf')](function(){_0x271902[_0x0666('0x32')](0xc8)[_0x0666('0x33')]({'message':_0x0666('0x4a')});})['catch'](function(_0x35a799){return handleError(_0x271902,0x1f4,_0x35a799);});};exports[_0x0666('0x4b')]=function(_0x170d2d,_0x3c62dd,_0x2146fe){var _0x63b444;return db['User'][_0x0666('0x21')]({'where':{'resetPasswordToken':_0x170d2d['params']['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x3bce3c){_0x63b444=_0x3bce3c;if(!_0x63b444){throw new Error(_0x0666('0x4c'));}return db['Setting'][_0x0666('0xc')]({'attributes':['id',_0x0666('0x4d')]});})[_0x0666('0xf')](function(_0x3d840e){return checkPasswordPattern(_0x3d840e,_0x170d2d[_0x0666('0x3d')][_0x0666('0x4e')],_0x3d840e[_0x0666('0x4d')]);})[_0x0666('0xf')](function(){_0x63b444[_0x0666('0x4e')]=_0x170d2d[_0x0666('0x3d')][_0x0666('0x4e')];_0x63b444[_0x0666('0x43')]=null;_0x63b444[_0x0666('0x4f')]=null;return _0x63b444[_0x0666('0x45')]();})[_0x0666('0xf')](function(){_0x3c62dd[_0x0666('0x32')](0xc8)[_0x0666('0x33')]({'message':_0x0666('0x50')});})['catch'](function(_0x1aa801){return handleError(_0x3c62dd,0x1f4,_0x1aa801);});};passport[_0x0666('0x51')](new LocalStrategy({'usernameField':_0x0666('0x18'),'passwordField':_0x0666('0x4e')},function(_0x3fafe7,_0x280eab,_0x4428f5){return localAuthenticate(db['User'],_0x3fafe7,_0x280eab,_0x4428f5);})); \ No newline at end of file +var _0xb59e=['Something\x20went\x20wrong,\x20please\x20try\x20again.','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','http://','headers','Reset\x20Email\x20sent!','reset','params','token','securePassword','resetPasswordToken','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','signToken','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','password','salt','role','disabled','blocked','loginAttempts','admin','name','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blockedAt','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','service','host','port','secure','authentication','user','merge','format','\x22%s\x22\x20<%s>','request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','error','status','send','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb59e,0xc2));var _0xeb59=function(_0x2d537c,_0x191eab){_0x2d537c=_0x2d537c-0x0;var _0x56a23f=_0xb59e[_0x2d537c];return _0x56a23f;};'use strict';var util=require(_0xeb59('0x0'));var passport=require(_0xeb59('0x1'));var LocalStrategy=require('passport-local')[_0xeb59('0x2')];var jayson=require(_0xeb59('0x3'));var _=require(_0xeb59('0x4'));var rs=require(_0xeb59('0x5'));var moment=require(_0xeb59('0x6'));var db=require('../../mysqldb')['db'];var signToken=require(_0xeb59('0x7'))[_0xeb59('0x8')];var utils=require(_0xeb59('0x9'));var client=jayson[_0xeb59('0xa')][_0xeb59('0xb')]({'port':0x232b});function localAuthenticate(_0x2b8349,_0x269e45,_0x509c73,_0x3ea0ee){var _0x14f5aa,_0x83b3bd;return db[_0xeb59('0xc')][_0xeb59('0xd')]({'where':{'id':0x1},'attributes':[_0xeb59('0xe'),'blockDuration'],'raw':!![]})[_0xeb59('0xf')](function(_0x1d3642){_0x14f5aa=_0x1d3642;return _0x2b8349[_0xeb59('0xd')]({'attributes':['id','name',_0xeb59('0x10'),_0xeb59('0x11'),_0xeb59('0x12'),_0xeb59('0x13'),_0xeb59('0x14'),'blockedAt',_0xeb59('0x15')],'where':{'name':_0x269e45,'role':{'$or':[_0xeb59('0x16'),'user','agent']}}});})[_0xeb59('0xf')](function(_0x59bc7a){if(!_0x59bc7a||_0x59bc7a&&_0x59bc7a[_0xeb59('0x17')]!==_0x269e45){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x83b3bd=_0x59bc7a;return _0x83b3bd;}})[_0xeb59('0xf')](function(){_0x83b3bd[_0xeb59('0x18')](_0x509c73,function(_0xa81b50,_0x354055){var _0x1e2ac6=_0x83b3bd['loginAttempts']+0x1;if(_0xa81b50){return _0x3ea0ee(_0xa81b50);}else if(!_0x354055){if(_0x83b3bd[_0xeb59('0x13')]){return _0x3ea0ee(null,![],{'message':_0xeb59('0x19')});}else if(_0x14f5aa['allowedLoginAttempts']>0x0){if(_0x83b3bd[_0xeb59('0x14')]){if(_0x14f5aa[_0xeb59('0x1a')]>0x0){if(moment(_0x83b3bd[_0xeb59('0x1b')])['add'](_0x14f5aa[_0xeb59('0x1a')],_0xeb59('0x1c'))>moment()){return _0x3ea0ee(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xeb59('0x1d')](_0x83b3bd,_0x1e2ac6,![],null)[_0xeb59('0xf')](function(){return _0x3ea0ee(null,![],{'message':_0xeb59('0x19')});});}}else{return _0x3ea0ee(null,![],{'message':_0xeb59('0x19')});}}else{if(_0x1e2ac6>=_0x14f5aa[_0xeb59('0xe')]){return utils[_0xeb59('0x1d')](_0x83b3bd,0x0,!![],moment())[_0xeb59('0xf')](function(){return _0x3ea0ee(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xeb59('0x1d')](_0x83b3bd,_0x1e2ac6,![],null)[_0xeb59('0xf')](function(){return _0x3ea0ee(null,![],{'message':_0xeb59('0x19')});});}}}else{return _0x3ea0ee(null,![],{'message':_0xeb59('0x19')});}}else{if(_0x83b3bd['disabled']){return _0x3ea0ee(null,![],{'message':_0xeb59('0x19')});}else if(_0x14f5aa[_0xeb59('0xe')]>0x0){if(_0x83b3bd['blocked']){if(_0x14f5aa[_0xeb59('0x1a')]>0x0){if(moment(_0x83b3bd[_0xeb59('0x1b')])[_0xeb59('0x1e')](_0x14f5aa[_0xeb59('0x1a')],_0xeb59('0x1c'))>moment()){return _0x3ea0ee(null,![],{'message':_0xeb59('0x19')});}else{return utils[_0xeb59('0x1d')](_0x83b3bd,0x0,![],null)[_0xeb59('0xf')](function(){return utils['getLicense'](_0x83b3bd);})[_0xeb59('0xf')](function(){return _0x3ea0ee(null,_0x83b3bd);});}}else{return _0x3ea0ee(null,![],{'message':_0xeb59('0x19')});}}else{return utils['clearBlockUser'](_0x83b3bd,0x0,![],null)['then'](function(){return utils[_0xeb59('0x1f')](_0x83b3bd);})[_0xeb59('0xf')](function(){return _0x3ea0ee(null,_0x83b3bd);})[_0xeb59('0x20')](function(_0x2a7b3d){return _0x3ea0ee(null,![],_0x2a7b3d);});}}else{if(_0x83b3bd[_0xeb59('0x14')]){return _0x3ea0ee(null,![],{'message':_0xeb59('0x19')});}else{return utils[_0xeb59('0x1f')](_0x83b3bd)[_0xeb59('0xf')](function(){return _0x3ea0ee(null,_0x83b3bd);});}}}});})[_0xeb59('0x20')](function(_0x1f8688){return _0x3ea0ee(null,![],_0x1f8688);});}function sendServiceMail(_0x126321){return db[_0xeb59('0x21')][_0xeb59('0x22')]({'where':{'service':!![]},'attributes':['id','name',_0xeb59('0x23')],'include':[{'model':db[_0xeb59('0x24')],'as':_0xeb59('0x25')}]})[_0xeb59('0xf')](function(_0x3814be){if(!_0x3814be){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x25e289={'tls':{'rejectUnauthorized':![]}};if(_0x3814be[_0xeb59('0x25')][_0xeb59('0x26')]){_0x25e289[_0xeb59('0x26')]=_0x3814be['Smtp'][_0xeb59('0x26')];}else{_0x25e289[_0xeb59('0x27')]=_0x3814be[_0xeb59('0x25')]['host'];_0x25e289[_0xeb59('0x28')]=_0x3814be[_0xeb59('0x25')]['port'];_0x25e289[_0xeb59('0x29')]=_0x3814be[_0xeb59('0x25')][_0xeb59('0x29')];}if(_0x3814be['Smtp'][_0xeb59('0x2a')]){_0x25e289['auth']={'user':_0x3814be['Smtp'][_0xeb59('0x2b')],'pass':_0x3814be[_0xeb59('0x25')]['pass']};}var _0x26ed42={'account':_0x25e289,'message':_[_0xeb59('0x2c')]({'from':util[_0xeb59('0x2d')](_0xeb59('0x2e'),_0x3814be[_0xeb59('0x17')],_0x3814be[_0xeb59('0x23')]||_0x3814be[_0xeb59('0x25')][_0xeb59('0x2b')])},_0x126321)};return client[_0xeb59('0x2f')]('SendMail',_0x26ed42);})[_0xeb59('0xf')](function(_0x207b7d){if(_0x207b7d['error']){throw new Error(util[_0xeb59('0x2d')](_0xeb59('0x30'),_0x207b7d['error'][_0xeb59('0x31')]||JSON[_0xeb59('0x32')](_0x207b7d[_0xeb59('0x33')])));}return!![];});}function handleError(_0x58c177,_0x3446c6,_0x502b11){return _0x58c177[_0xeb59('0x34')](_0x3446c6||0x1f4)[_0xeb59('0x35')]({'message':_0x502b11?_0x502b11['message']||_0x502b11:''});}function checkPasswordPattern(_0x288b93,_0x3e7890,_0x2d0e7e){if(_0x2d0e7e){var _0x535cfa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x535cfa[_0xeb59('0x36')](_0x3e7890)){return _0x288b93;}else{throw new Error(_0xeb59('0x37'));}}else{return _0x288b93;}}exports[_0xeb59('0x38')]=function(_0x2f7cac,_0x2c8784,_0x57e7a4){passport[_0xeb59('0x18')](_0xeb59('0x39'),function(_0x3e73d6,_0x31c4ad,_0x3838dd){var _0x1f437c=_0x3e73d6||_0x3838dd;if(_0x1f437c){return handleError(_0x2c8784,0x191,_0x1f437c);}if(!_0x31c4ad){return handleError(_0x2c8784,0x194,{'message':_0xeb59('0x3a')});}else{var _0x2d3976=signToken(_0x31c4ad['id'],_0x31c4ad[_0xeb59('0x12')]);_0x2c8784['json']({'id':_0x31c4ad['id'],'token':_0x2d3976,'statusCall':'','isAlreadyLogged':_0x31c4ad[_0xeb59('0x3b')]});}})(_0x2f7cac,_0x2c8784,_0x57e7a4);};exports[_0xeb59('0x3c')]=function(_0x1687e8,_0x132c1a,_0x11d864){if(!_0x1687e8[_0xeb59('0x3d')]['email']){return handleError(_0x132c1a,0x1f4,{'message':_0xeb59('0x3e')});}var _0xa92c5e=rs[_0xeb59('0x3f')]();_0x1687e8[_0xeb59('0x3d')]['email']=_0x1687e8[_0xeb59('0x3d')]['email']['trim']()[_0xeb59('0x40')]();var _0x19b2ee;return db['Setting'][_0xeb59('0xd')]({'where':{'id':0x1},'attributes':[_0xeb59('0xe'),_0xeb59('0x1a')],'raw':!![]})['then'](function(_0x504313){_0x19b2ee=_0x504313;return db[_0xeb59('0x41')][_0xeb59('0x22')]({'where':{'email':_0x1687e8[_0xeb59('0x3d')]['email']}});})['then'](function(_0x4ce1ff){if(!_0x4ce1ff){throw new Error(_0xeb59('0x42'));}if(_0x4ce1ff['disabled']){throw new Error(_0xeb59('0x43'));}if(_0x4ce1ff[_0xeb59('0x14')]){if(moment(_0x4ce1ff['blockedAt'])['add'](_0x19b2ee[_0xeb59('0x1a')],_0xeb59('0x1c'))>moment()){throw new Error(_0xeb59('0x44'));}else{_0x4ce1ff[_0xeb59('0x14')]=![];_0x4ce1ff[_0xeb59('0x1b')]=null;}}_0x4ce1ff['resetPasswordToken']=_0xa92c5e;_0x4ce1ff[_0xeb59('0x45')]=Date[_0xeb59('0x46')]()+0x36ee80;return _0x4ce1ff[_0xeb59('0x47')]();})[_0xeb59('0xf')](function(){return sendServiceMail({'to':_0x1687e8['body'][_0xeb59('0x23')],'subject':_0xeb59('0x48'),'text':_0xeb59('0x49')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xeb59('0x4a')+_0x1687e8[_0xeb59('0x4b')][_0xeb59('0x27')]+'/reset/'+_0xa92c5e+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xeb59('0xf')](function(){_0x132c1a[_0xeb59('0x34')](0xc8)[_0xeb59('0x35')]({'message':_0xeb59('0x4c')});})[_0xeb59('0x20')](function(_0x54e3bd){return handleError(_0x132c1a,0x1f4,_0x54e3bd);});};exports[_0xeb59('0x4d')]=function(_0x2d89b6,_0x18cc59,_0x24888b){var _0x5ddaad;return db[_0xeb59('0x41')][_0xeb59('0x22')]({'where':{'resetPasswordToken':_0x2d89b6[_0xeb59('0x4e')][_0xeb59('0x4f')],'resetPasswordExpires':{'$gt':Date[_0xeb59('0x46')]()}}})[_0xeb59('0xf')](function(_0x564e58){_0x5ddaad=_0x564e58;if(!_0x5ddaad){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xeb59('0xc')][_0xeb59('0xd')]({'attributes':['id',_0xeb59('0x50')]});})[_0xeb59('0xf')](function(_0x315799){return checkPasswordPattern(_0x315799,_0x2d89b6[_0xeb59('0x3d')][_0xeb59('0x10')],_0x315799[_0xeb59('0x50')]);})[_0xeb59('0xf')](function(){_0x5ddaad['password']=_0x2d89b6[_0xeb59('0x3d')]['password'];_0x5ddaad[_0xeb59('0x51')]=null;_0x5ddaad[_0xeb59('0x45')]=null;return _0x5ddaad[_0xeb59('0x47')]();})[_0xeb59('0xf')](function(){_0x18cc59[_0xeb59('0x34')](0xc8)[_0xeb59('0x35')]({'message':_0xeb59('0x52')});})[_0xeb59('0x20')](function(_0x4b1f9e){return handleError(_0x18cc59,0x1f4,_0x4b1f9e);});};passport[_0xeb59('0x53')](new LocalStrategy({'usernameField':_0xeb59('0x17'),'passwordField':_0xeb59('0x10')},function(_0x21a501,_0x5a7541,_0x2b5c1e){return localAuthenticate(db[_0xeb59('0x41')],_0x21a501,_0x5a7541,_0x2b5c1e);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 49e9cfe..42393b9 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 _0xa1a8=['post','/forgot','/reset/:token','exports','express','./authLocal.controller'];(function(_0x2ac3f4,_0x3c85f3){var _0x304cd3=function(_0x57a85f){while(--_0x57a85f){_0x2ac3f4['push'](_0x2ac3f4['shift']());}};_0x304cd3(++_0x3c85f3);}(_0xa1a8,0xa0));var _0x8a1a=function(_0x1ec1cc,_0x349649){_0x1ec1cc=_0x1ec1cc-0x0;var _0x1e02a1=_0xa1a8[_0x1ec1cc];return _0x1e02a1;};'use strict';var express=require(_0x8a1a('0x0'));var router=express['Router']();var controller=require(_0x8a1a('0x1'));router[_0x8a1a('0x2')]('/',controller['login']);router[_0x8a1a('0x2')](_0x8a1a('0x3'),controller['forgot']);router[_0x8a1a('0x2')](_0x8a1a('0x4'),controller['reset']);module[_0x8a1a('0x5')]=router; \ No newline at end of file +var _0xac58=['./authLocal.controller','post','login','/forgot','/reset/:token','exports','express'];(function(_0x43330e,_0x3ddaae){var _0x9fedf4=function(_0x3b0708){while(--_0x3b0708){_0x43330e['push'](_0x43330e['shift']());}};_0x9fedf4(++_0x3ddaae);}(_0xac58,0x110));var _0x8ac5=function(_0x4fe13c,_0x8240a5){_0x4fe13c=_0x4fe13c-0x0;var _0x188157=_0xac58[_0x4fe13c];return _0x188157;};'use strict';var express=require(_0x8ac5('0x0'));var router=express['Router']();var controller=require(_0x8ac5('0x1'));router[_0x8ac5('0x2')]('/',controller[_0x8ac5('0x3')]);router['post'](_0x8ac5('0x4'),controller['forgot']);router[_0x8ac5('0x2')](_0x8ac5('0x5'),controller['reset']);module[_0x8ac5('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 30e0c6d..751e2fb 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 _0x4e58=['INTEGER','exports','STRING'];(function(_0x54359f,_0x47074e){var _0x1f9359=function(_0x16e667){while(--_0x16e667){_0x54359f['push'](_0x54359f['shift']());}};_0x1f9359(++_0x47074e);}(_0x4e58,0x160));var _0x84e5=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x4e58[_0x9c2427];return _0x51984f;};'use strict';var Sequelize=require('sequelize');module[_0x84e5('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x84e5('0x1')]},'description':{'type':Sequelize[_0x84e5('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x84e5('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0x489b=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x251755,_0x32dc0f){var _0x530bba=function(_0x292f4f){while(--_0x292f4f){_0x251755['push'](_0x251755['shift']());}};_0x530bba(++_0x32dc0f);}(_0x489b,0xdc));var _0xb489=function(_0x5c48b2,_0x4dea68){_0x5c48b2=_0x5c48b2-0x0;var _0x230b1c=_0x489b[_0x5c48b2];return _0x230b1c;};'use strict';var Sequelize=require(_0xb489('0x0'));module[_0xb489('0x1')]={'name':{'type':Sequelize[_0xb489('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb489('0x2')]},'description':{'type':Sequelize[_0xb489('0x2')]},'status':{'type':Sequelize[_0xb489('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb489('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index b9315c2..f8e8e22 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 _0xad5f=['reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','type','key','VIRTUAL','merge','count','include','Automation','findAll','rows','catch','params','includeAll','options','find','create','body','addConditions','Condition','omit','ids','getConditions','findOne','map','hasOwnProperty','addActions','Action','getActions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','offset','limit','Content-Range','json','apply'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xad5f,0x127));var _0xfad5=function(_0x390c42,_0x10e1ae){_0x390c42=_0x390c42-0x0;var _0x43894c=_0xad5f[_0x390c42];return _0x43894c;};'use strict';var pdf=require(_0xfad5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfad5('0x1'));var zipdir=require(_0xfad5('0x2'));var jsonpatch=require(_0xfad5('0x3'));var rp=require(_0xfad5('0x4'));var moment=require(_0xfad5('0x5'));var BPromise=require(_0xfad5('0x6'));var Mustache=require('mustache');var util=require(_0xfad5('0x7'));var path=require(_0xfad5('0x8'));var sox=require(_0xfad5('0x9'));var csv=require('to-csv');var ejs=require(_0xfad5('0xa'));var fs=require('fs');var _=require(_0xfad5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfad5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfad5('0xd'));var querystring=require(_0xfad5('0xe'));var Papa=require(_0xfad5('0xf'));var Redis=require(_0xfad5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfad5('0x11'));var hardwareService=require(_0xfad5('0x12'));var logger=require('../../config/logger')(_0xfad5('0x13'));var utils=require(_0xfad5('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x413e55,_0x332a44){_0x332a44=_0x332a44||0xcc;return function(_0x20a8a1){if(_0x20a8a1){return _0x413e55[_0xfad5('0x15')](_0x332a44);}return _0x413e55[_0xfad5('0x16')](_0x332a44)[_0xfad5('0x17')]();};}function respondWithResult(_0x3010a4,_0x51abea){_0x51abea=_0x51abea||0xc8;return function(_0x17c53f){if(_0x17c53f){return _0x3010a4['status'](_0x51abea)['json'](_0x17c53f);}};}function respondWithFilteredResult(_0x2e79c2,_0x2525cc){return function(_0x2b081a){if(_0x2b081a){var _0x27661f=_0x2b081a['count'],_0x1f2f13=_0x2525cc[_0xfad5('0x18')],_0xafa0d1=_0x2525cc['offset']+_0x2525cc[_0xfad5('0x19')],_0x2ae5e9;if(_0xafa0d1>=_0x27661f){_0xafa0d1=_0x27661f;_0x2ae5e9=0xc8;}else{_0x2ae5e9=0xce;}_0x2e79c2[_0xfad5('0x16')](_0x2ae5e9);return _0x2e79c2['set'](_0xfad5('0x1a'),_0x1f2f13+'-'+_0xafa0d1+'/'+_0x27661f)[_0xfad5('0x1b')](_0x2b081a);}return null;};}function patchUpdates(_0x97a50c){return function(_0x114ad2){try{jsonpatch[_0xfad5('0x1c')](_0x114ad2,_0x97a50c,!![]);}catch(_0xf54dee){return BPromise[_0xfad5('0x1d')](_0xf54dee);}return _0x114ad2[_0xfad5('0x1e')]();};}function saveUpdates(_0x383873,_0x1ac9aa){return function(_0x268e34){if(_0x268e34){return _0x268e34[_0xfad5('0x1f')](_0x383873)['then'](function(_0x399f05){return _0x399f05;});}return null;};}function removeEntity(_0x48f1e9,_0x128c6f){return function(_0x4bb85b){if(_0x4bb85b){return _0x4bb85b[_0xfad5('0x20')]()[_0xfad5('0x21')](function(){_0x48f1e9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x13863a,_0x1206cc){return function(_0x4ee785){if(!_0x4ee785){_0x13863a['sendStatus'](0x194);}return _0x4ee785;};}function handleError(_0x3c6678,_0x4a6a60){_0x4a6a60=_0x4a6a60||0x1f4;return function(_0x505f78){logger[_0xfad5('0x22')](_0x505f78[_0xfad5('0x23')]);if(_0x505f78[_0xfad5('0x24')]){delete _0x505f78[_0xfad5('0x24')];}_0x3c6678[_0xfad5('0x16')](_0x4a6a60)[_0xfad5('0x25')](_0x505f78);};}exports[_0xfad5('0x26')]=function(_0x39c9cf,_0x2b7e23){var _0x599197={},_0x4fef1f={},_0x3bc023={'count':0x0,'rows':[]};var _0x554912=db['Automation'][_0xfad5('0x27')];_0x4fef1f['model']=_['keys'](_0x554912);_0x4fef1f[_0xfad5('0x28')]=_[_0xfad5('0x29')](_0x39c9cf[_0xfad5('0x28')]);_0x4fef1f['filters']=_[_0xfad5('0x2a')](_0x4fef1f[_0xfad5('0x2b')],_0x4fef1f[_0xfad5('0x28')]);_0x599197[_0xfad5('0x2c')]=_[_0xfad5('0x2a')](_0x4fef1f['model'],qs[_0xfad5('0x2d')](_0x39c9cf[_0xfad5('0x28')][_0xfad5('0x2d')]));_0x599197[_0xfad5('0x2c')]=_0x599197[_0xfad5('0x2c')][_0xfad5('0x2e')]?_0x599197['attributes']:_0x4fef1f['model'];if(!_0x39c9cf[_0xfad5('0x28')]['hasOwnProperty'](_0xfad5('0x2f'))){_0x599197[_0xfad5('0x19')]=qs[_0xfad5('0x19')](_0x39c9cf['query']['limit']);_0x599197[_0xfad5('0x18')]=qs['offset'](_0x39c9cf[_0xfad5('0x28')]['offset']);}_0x599197[_0xfad5('0x30')]=qs[_0xfad5('0x31')](_0x39c9cf[_0xfad5('0x28')][_0xfad5('0x31')]);_0x599197[_0xfad5('0x32')]=qs[_0xfad5('0x33')](_[_0xfad5('0x34')](_0x39c9cf['query'],_0x4fef1f[_0xfad5('0x33')]));if(_0x39c9cf['query'][_0xfad5('0x35')]){_0x599197[_0xfad5('0x32')]=_['merge'](_0x599197['where'],{'$or':_['map'](_0x554912,function(_0x9b78c3){if(_0x9b78c3[_0xfad5('0x36')][_0xfad5('0x37')]!==_0xfad5('0x38')){var _0x17fd2f={};_0x17fd2f[_0x9b78c3['field']]={'$like':'%'+_0x39c9cf[_0xfad5('0x28')]['filter']+'%'};return _0x17fd2f;}})});}_0x599197=_[_0xfad5('0x39')]({},_0x599197,_0x39c9cf['options']);var _0x39105b={'where':_0x599197['where']};return db['Automation'][_0xfad5('0x3a')](_0x39105b)[_0xfad5('0x21')](function(_0x5b2db0){_0x3bc023[_0xfad5('0x3a')]=_0x5b2db0;if(_0x39c9cf[_0xfad5('0x28')]['includeAll']){_0x599197[_0xfad5('0x3b')]=[{'all':!![]}];}return db[_0xfad5('0x3c')][_0xfad5('0x3d')](_0x599197);})[_0xfad5('0x21')](function(_0x3193f8){_0x3bc023[_0xfad5('0x3e')]=_0x3193f8;return _0x3bc023;})[_0xfad5('0x21')](respondWithFilteredResult(_0x2b7e23,_0x599197))[_0xfad5('0x3f')](handleError(_0x2b7e23,null));};exports['show']=function(_0xf94d6c,_0x23284f){var _0x273c40={'raw':![],'where':{'id':_0xf94d6c[_0xfad5('0x40')]['id']}},_0xf7f9ef={};_0xf7f9ef['model']=_['keys'](db[_0xfad5('0x3c')][_0xfad5('0x27')]);_0xf7f9ef[_0xfad5('0x28')]=_[_0xfad5('0x29')](_0xf94d6c['query']);_0xf7f9ef['filters']=_['intersection'](_0xf7f9ef['model'],_0xf7f9ef[_0xfad5('0x28')]);_0x273c40['attributes']=_[_0xfad5('0x2a')](_0xf7f9ef[_0xfad5('0x2b')],qs[_0xfad5('0x2d')](_0xf94d6c[_0xfad5('0x28')][_0xfad5('0x2d')]));_0x273c40[_0xfad5('0x2c')]=_0x273c40[_0xfad5('0x2c')]['length']?_0x273c40[_0xfad5('0x2c')]:_0xf7f9ef[_0xfad5('0x2b')];if(_0xf94d6c[_0xfad5('0x28')][_0xfad5('0x41')]){_0x273c40[_0xfad5('0x3b')]=[{'all':!![]}];}_0x273c40=_[_0xfad5('0x39')]({},_0x273c40,_0xf94d6c[_0xfad5('0x42')]);return db[_0xfad5('0x3c')][_0xfad5('0x43')](_0x273c40)[_0xfad5('0x21')](handleEntityNotFound(_0x23284f,null))[_0xfad5('0x21')](respondWithResult(_0x23284f,null))[_0xfad5('0x3f')](handleError(_0x23284f,null));};exports['create']=function(_0x580d10,_0x1bb6ae){return db[_0xfad5('0x3c')][_0xfad5('0x44')](_0x580d10[_0xfad5('0x45')],{})['then'](respondWithResult(_0x1bb6ae,0xc9))['catch'](handleError(_0x1bb6ae,null));};exports[_0xfad5('0x1f')]=function(_0x5f0ee5,_0x49710b){if(_0x5f0ee5['body']['id']){delete _0x5f0ee5[_0xfad5('0x45')]['id'];}return db[_0xfad5('0x3c')][_0xfad5('0x43')]({'where':{'id':_0x5f0ee5['params']['id']}})[_0xfad5('0x21')](handleEntityNotFound(_0x49710b,null))[_0xfad5('0x21')](saveUpdates(_0x5f0ee5[_0xfad5('0x45')],null))[_0xfad5('0x21')](respondWithResult(_0x49710b,null))[_0xfad5('0x3f')](handleError(_0x49710b,null));};exports[_0xfad5('0x20')]=function(_0x13ce94,_0x4c4834){return db[_0xfad5('0x3c')][_0xfad5('0x43')]({'where':{'id':_0x13ce94['params']['id']}})[_0xfad5('0x21')](handleEntityNotFound(_0x4c4834,null))[_0xfad5('0x21')](removeEntity(_0x4c4834,null))[_0xfad5('0x3f')](handleError(_0x4c4834,null));};exports[_0xfad5('0x46')]=function(_0x58435e,_0x2822b3,_0xfdb5b3){return db[_0xfad5('0x47')]['find']({'where':{'id':_0x58435e['params']['id']}})[_0xfad5('0x21')](handleEntityNotFound(_0x2822b3,null))[_0xfad5('0x21')](function(_0xa289b){if(_0xa289b){return _0xa289b[_0xfad5('0x46')](_0x58435e['body']['ids'],_[_0xfad5('0x48')](_0x58435e[_0xfad5('0x45')],[_0xfad5('0x49'),'id'])||{});}})[_0xfad5('0x21')](respondWithResult(_0x2822b3,null))[_0xfad5('0x3f')](handleError(_0x2822b3,null));};exports[_0xfad5('0x4a')]=function(_0x2206ee,_0xbd28a3,_0x1d7b59){var _0x1ccfb6={};var _0x391244={};var _0x570b16;var _0x28af4d;return db['Automation'][_0xfad5('0x4b')]({'where':{'id':_0x2206ee[_0xfad5('0x40')]['id']}})[_0xfad5('0x21')](handleEntityNotFound(_0xbd28a3,null))[_0xfad5('0x21')](function(_0x4e877e){if(_0x4e877e){_0x570b16=_0x4e877e;_0x391244[_0xfad5('0x2b')]=_[_0xfad5('0x29')](db[_0xfad5('0x47')]['rawAttributes']);_0x391244['query']=_[_0xfad5('0x29')](_0x2206ee[_0xfad5('0x28')]);_0x391244[_0xfad5('0x33')]=_[_0xfad5('0x2a')](_0x391244[_0xfad5('0x2b')],_0x391244[_0xfad5('0x28')]);_0x1ccfb6['attributes']=_[_0xfad5('0x2a')](_0x391244[_0xfad5('0x2b')],qs[_0xfad5('0x2d')](_0x2206ee[_0xfad5('0x28')][_0xfad5('0x2d')]));_0x1ccfb6['attributes']=_0x1ccfb6[_0xfad5('0x2c')][_0xfad5('0x2e')]?_0x1ccfb6[_0xfad5('0x2c')]:_0x391244[_0xfad5('0x2b')];_0x1ccfb6[_0xfad5('0x30')]=qs[_0xfad5('0x31')](_0x2206ee[_0xfad5('0x28')][_0xfad5('0x31')]);_0x1ccfb6[_0xfad5('0x32')]=qs[_0xfad5('0x33')](_[_0xfad5('0x34')](_0x2206ee[_0xfad5('0x28')],_0x391244[_0xfad5('0x33')]));if(_0x2206ee['query'][_0xfad5('0x35')]){_0x1ccfb6['where']=_[_0xfad5('0x39')](_0x1ccfb6[_0xfad5('0x32')],{'$or':_[_0xfad5('0x4c')](_0x1ccfb6[_0xfad5('0x2c')],function(_0x5cc577){var _0x57cb50={};_0x57cb50[_0x5cc577]={'$like':'%'+_0x2206ee[_0xfad5('0x28')][_0xfad5('0x35')]+'%'};return _0x57cb50;})});}_0x1ccfb6=_[_0xfad5('0x39')]({},_0x1ccfb6,_0x2206ee[_0xfad5('0x42')]);return _0x570b16['getConditions'](_0x1ccfb6);}})[_0xfad5('0x21')](function(_0x5df198){if(_0x5df198){_0x28af4d=_0x5df198[_0xfad5('0x2e')];if(!_0x2206ee[_0xfad5('0x28')][_0xfad5('0x4d')](_0xfad5('0x2f'))){_0x1ccfb6[_0xfad5('0x19')]=qs[_0xfad5('0x19')](_0x2206ee[_0xfad5('0x28')]['limit']);_0x1ccfb6['offset']=qs[_0xfad5('0x18')](_0x2206ee[_0xfad5('0x28')]['offset']);}return _0x570b16[_0xfad5('0x4a')](_0x1ccfb6);}})[_0xfad5('0x21')](function(_0x392b9c){if(_0x392b9c){return _0x392b9c?{'count':_0x28af4d,'rows':_0x392b9c}:null;}})['then'](respondWithResult(_0xbd28a3,null))[_0xfad5('0x3f')](handleError(_0xbd28a3,null));};exports[_0xfad5('0x4e')]=function(_0x1520fb,_0x3efaa8,_0x25b977){return db[_0xfad5('0x4f')][_0xfad5('0x43')]({'where':{'id':_0x1520fb[_0xfad5('0x40')]['id']}})[_0xfad5('0x21')](handleEntityNotFound(_0x3efaa8,null))[_0xfad5('0x21')](function(_0x32326a){if(_0x32326a){return _0x32326a[_0xfad5('0x4e')](_0x1520fb[_0xfad5('0x45')][_0xfad5('0x49')],_[_0xfad5('0x48')](_0x1520fb['body'],['ids','id'])||{});}})[_0xfad5('0x21')](respondWithResult(_0x3efaa8,null))[_0xfad5('0x3f')](handleError(_0x3efaa8,null));};exports[_0xfad5('0x50')]=function(_0x5b27e7,_0x3bec41,_0x2fcecd){var _0x379232={};var _0x47d27c={};var _0x4026a8;var _0x5cafca;return db['Automation'][_0xfad5('0x4b')]({'where':{'id':_0x5b27e7['params']['id']}})[_0xfad5('0x21')](handleEntityNotFound(_0x3bec41,null))[_0xfad5('0x21')](function(_0xea8a9b){if(_0xea8a9b){_0x4026a8=_0xea8a9b;_0x47d27c[_0xfad5('0x2b')]=_[_0xfad5('0x29')](db[_0xfad5('0x4f')][_0xfad5('0x27')]);_0x47d27c[_0xfad5('0x28')]=_[_0xfad5('0x29')](_0x5b27e7[_0xfad5('0x28')]);_0x47d27c[_0xfad5('0x33')]=_['intersection'](_0x47d27c[_0xfad5('0x2b')],_0x47d27c[_0xfad5('0x28')]);_0x379232[_0xfad5('0x2c')]=_['intersection'](_0x47d27c['model'],qs['fields'](_0x5b27e7[_0xfad5('0x28')]['fields']));_0x379232['attributes']=_0x379232[_0xfad5('0x2c')][_0xfad5('0x2e')]?_0x379232[_0xfad5('0x2c')]:_0x47d27c[_0xfad5('0x2b')];_0x379232[_0xfad5('0x30')]=qs[_0xfad5('0x31')](_0x5b27e7['query']['sort']);_0x379232['where']=qs[_0xfad5('0x33')](_[_0xfad5('0x34')](_0x5b27e7[_0xfad5('0x28')],_0x47d27c[_0xfad5('0x33')]));if(_0x5b27e7['query'][_0xfad5('0x35')]){_0x379232[_0xfad5('0x32')]=_[_0xfad5('0x39')](_0x379232[_0xfad5('0x32')],{'$or':_[_0xfad5('0x4c')](_0x379232[_0xfad5('0x2c')],function(_0x498700){var _0x2f0bb5={};_0x2f0bb5[_0x498700]={'$like':'%'+_0x5b27e7['query']['filter']+'%'};return _0x2f0bb5;})});}_0x379232=_[_0xfad5('0x39')]({},_0x379232,_0x5b27e7['options']);return _0x4026a8['getActions'](_0x379232);}})[_0xfad5('0x21')](function(_0x44a5ce){if(_0x44a5ce){_0x5cafca=_0x44a5ce[_0xfad5('0x2e')];if(!_0x5b27e7[_0xfad5('0x28')]['hasOwnProperty']('nolimit')){_0x379232[_0xfad5('0x19')]=qs[_0xfad5('0x19')](_0x5b27e7[_0xfad5('0x28')][_0xfad5('0x19')]);_0x379232['offset']=qs['offset'](_0x5b27e7[_0xfad5('0x28')][_0xfad5('0x18')]);}return _0x4026a8[_0xfad5('0x50')](_0x379232);}})['then'](function(_0x491ed2){if(_0x491ed2){return _0x491ed2?{'count':_0x5cafca,'rows':_0x491ed2}:null;}})['then'](respondWithResult(_0x3bec41,null))[_0xfad5('0x3f')](handleError(_0x3bec41,null));}; \ No newline at end of file +var _0xdbe0=['Action','getActions','html-pdf','eml-format','rimraf','fast-json-patch','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','Automation','rawAttributes','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','pick','where','field','filter','merge','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','destroy','ids','omit','getConditions','findOne','Condition','order','sort','map','addActions'];(function(_0x384a0e,_0x5ee266){var _0x1c7559=function(_0x53e1b4){while(--_0x53e1b4){_0x384a0e['push'](_0x384a0e['shift']());}};_0x1c7559(++_0x5ee266);}(_0xdbe0,0x9e));var _0x0dbe=function(_0x948fb,_0x4ce6d){_0x948fb=_0x948fb-0x0;var _0x40ed5b=_0xdbe0[_0x948fb];return _0x40ed5b;};'use strict';var pdf=require(_0x0dbe('0x0'));var emlformat=require(_0x0dbe('0x1'));var rimraf=require(_0x0dbe('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0dbe('0x3'));var rp=require('request-promise');var moment=require(_0x0dbe('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0dbe('0x5'));var path=require(_0x0dbe('0x6'));var sox=require('sox');var csv=require(_0x0dbe('0x7'));var ejs=require(_0x0dbe('0x8'));var fs=require('fs');var _=require(_0x0dbe('0x9'));var squel=require(_0x0dbe('0xa'));var crypto=require(_0x0dbe('0xb'));var jsforce=require(_0x0dbe('0xc'));var deskjs=require(_0x0dbe('0xd'));var toCsv=require(_0x0dbe('0x7'));var querystring=require(_0x0dbe('0xe'));var Papa=require(_0x0dbe('0xf'));var Redis=require('ioredis');var authService=require(_0x0dbe('0x10'));var qs=require(_0x0dbe('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0dbe('0x12'))(_0x0dbe('0x13'));var utils=require(_0x0dbe('0x14'));var config=require(_0x0dbe('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf20e75,_0x5dd5b4){_0x5dd5b4=_0x5dd5b4||0xcc;return function(_0x4f7a57){if(_0x4f7a57){return _0xf20e75['sendStatus'](_0x5dd5b4);}return _0xf20e75[_0x0dbe('0x16')](_0x5dd5b4)[_0x0dbe('0x17')]();};}function respondWithResult(_0x3281c7,_0x149026){_0x149026=_0x149026||0xc8;return function(_0x488295){if(_0x488295){return _0x3281c7[_0x0dbe('0x16')](_0x149026)[_0x0dbe('0x18')](_0x488295);}};}function respondWithFilteredResult(_0x1439d4,_0xb9a14d){return function(_0x121764){if(_0x121764){var _0x48f10b=_0x121764['count'],_0x723f4f=_0xb9a14d[_0x0dbe('0x19')],_0x39e0fa=_0xb9a14d[_0x0dbe('0x19')]+_0xb9a14d[_0x0dbe('0x1a')],_0x5563a5;if(_0x39e0fa>=_0x48f10b){_0x39e0fa=_0x48f10b;_0x5563a5=0xc8;}else{_0x5563a5=0xce;}_0x1439d4[_0x0dbe('0x16')](_0x5563a5);return _0x1439d4[_0x0dbe('0x1b')](_0x0dbe('0x1c'),_0x723f4f+'-'+_0x39e0fa+'/'+_0x48f10b)[_0x0dbe('0x18')](_0x121764);}return null;};}function patchUpdates(_0x379300){return function(_0x5bd1ff){try{jsonpatch[_0x0dbe('0x1d')](_0x5bd1ff,_0x379300,!![]);}catch(_0x1f2285){return BPromise[_0x0dbe('0x1e')](_0x1f2285);}return _0x5bd1ff[_0x0dbe('0x1f')]();};}function saveUpdates(_0x16c49d,_0x10e02a){return function(_0xaca822){if(_0xaca822){return _0xaca822[_0x0dbe('0x20')](_0x16c49d)[_0x0dbe('0x21')](function(_0x2734b2){return _0x2734b2;});}return null;};}function removeEntity(_0x2b8ba2,_0x69b946){return function(_0x5f1262){if(_0x5f1262){return _0x5f1262['destroy']()[_0x0dbe('0x21')](function(){_0x2b8ba2[_0x0dbe('0x16')](0xcc)[_0x0dbe('0x17')]();});}};}function handleEntityNotFound(_0x244b6c,_0x2613be){return function(_0x41b108){if(!_0x41b108){_0x244b6c[_0x0dbe('0x22')](0x194);}return _0x41b108;};}function handleError(_0x5d9b9f,_0x2acbd1){_0x2acbd1=_0x2acbd1||0x1f4;return function(_0x10e2c1){logger[_0x0dbe('0x23')](_0x10e2c1[_0x0dbe('0x24')]);if(_0x10e2c1['name']){delete _0x10e2c1[_0x0dbe('0x25')];}_0x5d9b9f[_0x0dbe('0x16')](_0x2acbd1)['send'](_0x10e2c1);};}exports['index']=function(_0x16c8f9,_0x52c78){var _0x1d70fb={},_0x5b826f={},_0x12e0af={'count':0x0,'rows':[]};var _0x1cf251=db[_0x0dbe('0x26')][_0x0dbe('0x27')];_0x5b826f['model']=_['keys'](_0x1cf251);_0x5b826f[_0x0dbe('0x28')]=_[_0x0dbe('0x29')](_0x16c8f9['query']);_0x5b826f[_0x0dbe('0x2a')]=_[_0x0dbe('0x2b')](_0x5b826f['model'],_0x5b826f[_0x0dbe('0x28')]);_0x1d70fb[_0x0dbe('0x2c')]=_['intersection'](_0x5b826f['model'],qs[_0x0dbe('0x2d')](_0x16c8f9['query']['fields']));_0x1d70fb[_0x0dbe('0x2c')]=_0x1d70fb['attributes'][_0x0dbe('0x2e')]?_0x1d70fb[_0x0dbe('0x2c')]:_0x5b826f[_0x0dbe('0x2f')];if(!_0x16c8f9['query'][_0x0dbe('0x30')](_0x0dbe('0x31'))){_0x1d70fb[_0x0dbe('0x1a')]=qs[_0x0dbe('0x1a')](_0x16c8f9[_0x0dbe('0x28')][_0x0dbe('0x1a')]);_0x1d70fb[_0x0dbe('0x19')]=qs[_0x0dbe('0x19')](_0x16c8f9[_0x0dbe('0x28')]['offset']);}_0x1d70fb['order']=qs['sort'](_0x16c8f9['query']['sort']);_0x1d70fb['where']=qs['filters'](_[_0x0dbe('0x32')](_0x16c8f9[_0x0dbe('0x28')],_0x5b826f[_0x0dbe('0x2a')]));if(_0x16c8f9[_0x0dbe('0x28')]['filter']){_0x1d70fb[_0x0dbe('0x33')]=_['merge'](_0x1d70fb['where'],{'$or':_['map'](_0x1cf251,function(_0x26eebb){if(_0x26eebb['type']['key']!=='VIRTUAL'){var _0x5dda4d={};_0x5dda4d[_0x26eebb[_0x0dbe('0x34')]]={'$like':'%'+_0x16c8f9[_0x0dbe('0x28')][_0x0dbe('0x35')]+'%'};return _0x5dda4d;}})});}_0x1d70fb=_[_0x0dbe('0x36')]({},_0x1d70fb,_0x16c8f9[_0x0dbe('0x37')]);var _0x421d1d={'where':_0x1d70fb[_0x0dbe('0x33')]};return db['Automation']['count'](_0x421d1d)[_0x0dbe('0x21')](function(_0x1c4d9c){_0x12e0af['count']=_0x1c4d9c;if(_0x16c8f9['query']['includeAll']){_0x1d70fb['include']=[{'all':!![]}];}return db[_0x0dbe('0x26')][_0x0dbe('0x38')](_0x1d70fb);})['then'](function(_0x58cb35){_0x12e0af[_0x0dbe('0x39')]=_0x58cb35;return _0x12e0af;})[_0x0dbe('0x21')](respondWithFilteredResult(_0x52c78,_0x1d70fb))[_0x0dbe('0x3a')](handleError(_0x52c78,null));};exports[_0x0dbe('0x3b')]=function(_0x15c4b7,_0x471f3f){var _0x5b3c96={'raw':![],'where':{'id':_0x15c4b7[_0x0dbe('0x3c')]['id']}},_0x3677e6={};_0x3677e6[_0x0dbe('0x2f')]=_[_0x0dbe('0x29')](db[_0x0dbe('0x26')]['rawAttributes']);_0x3677e6[_0x0dbe('0x28')]=_[_0x0dbe('0x29')](_0x15c4b7['query']);_0x3677e6[_0x0dbe('0x2a')]=_[_0x0dbe('0x2b')](_0x3677e6[_0x0dbe('0x2f')],_0x3677e6[_0x0dbe('0x28')]);_0x5b3c96[_0x0dbe('0x2c')]=_[_0x0dbe('0x2b')](_0x3677e6[_0x0dbe('0x2f')],qs[_0x0dbe('0x2d')](_0x15c4b7[_0x0dbe('0x28')][_0x0dbe('0x2d')]));_0x5b3c96[_0x0dbe('0x2c')]=_0x5b3c96[_0x0dbe('0x2c')]['length']?_0x5b3c96[_0x0dbe('0x2c')]:_0x3677e6[_0x0dbe('0x2f')];if(_0x15c4b7[_0x0dbe('0x28')][_0x0dbe('0x3d')]){_0x5b3c96[_0x0dbe('0x3e')]=[{'all':!![]}];}_0x5b3c96=_[_0x0dbe('0x36')]({},_0x5b3c96,_0x15c4b7[_0x0dbe('0x37')]);return db[_0x0dbe('0x26')][_0x0dbe('0x3f')](_0x5b3c96)[_0x0dbe('0x21')](handleEntityNotFound(_0x471f3f,null))[_0x0dbe('0x21')](respondWithResult(_0x471f3f,null))[_0x0dbe('0x3a')](handleError(_0x471f3f,null));};exports[_0x0dbe('0x40')]=function(_0x1e22ad,_0x3978a1){return db[_0x0dbe('0x26')][_0x0dbe('0x40')](_0x1e22ad[_0x0dbe('0x41')],{})[_0x0dbe('0x21')](respondWithResult(_0x3978a1,0xc9))[_0x0dbe('0x3a')](handleError(_0x3978a1,null));};exports[_0x0dbe('0x20')]=function(_0x568dfa,_0x24c83f){if(_0x568dfa[_0x0dbe('0x41')]['id']){delete _0x568dfa[_0x0dbe('0x41')]['id'];}return db[_0x0dbe('0x26')][_0x0dbe('0x3f')]({'where':{'id':_0x568dfa[_0x0dbe('0x3c')]['id']}})[_0x0dbe('0x21')](handleEntityNotFound(_0x24c83f,null))[_0x0dbe('0x21')](saveUpdates(_0x568dfa[_0x0dbe('0x41')],null))[_0x0dbe('0x21')](respondWithResult(_0x24c83f,null))[_0x0dbe('0x3a')](handleError(_0x24c83f,null));};exports[_0x0dbe('0x42')]=function(_0x334f40,_0x9e5584){return db[_0x0dbe('0x26')]['find']({'where':{'id':_0x334f40[_0x0dbe('0x3c')]['id']}})[_0x0dbe('0x21')](handleEntityNotFound(_0x9e5584,null))['then'](removeEntity(_0x9e5584,null))['catch'](handleError(_0x9e5584,null));};exports['addConditions']=function(_0x27d57e,_0x22b04c,_0x23b044){return db['Condition'][_0x0dbe('0x3f')]({'where':{'id':_0x27d57e[_0x0dbe('0x3c')]['id']}})[_0x0dbe('0x21')](handleEntityNotFound(_0x22b04c,null))[_0x0dbe('0x21')](function(_0x2ab47a){if(_0x2ab47a){return _0x2ab47a['addConditions'](_0x27d57e['body'][_0x0dbe('0x43')],_[_0x0dbe('0x44')](_0x27d57e['body'],[_0x0dbe('0x43'),'id'])||{});}})[_0x0dbe('0x21')](respondWithResult(_0x22b04c,null))[_0x0dbe('0x3a')](handleError(_0x22b04c,null));};exports[_0x0dbe('0x45')]=function(_0x38c516,_0x2346d6,_0x4159a9){var _0x3e22c2={};var _0xe2ac1f={};var _0x256a82;var _0x40956a;return db[_0x0dbe('0x26')][_0x0dbe('0x46')]({'where':{'id':_0x38c516['params']['id']}})[_0x0dbe('0x21')](handleEntityNotFound(_0x2346d6,null))[_0x0dbe('0x21')](function(_0x162ef0){if(_0x162ef0){_0x256a82=_0x162ef0;_0xe2ac1f[_0x0dbe('0x2f')]=_['keys'](db[_0x0dbe('0x47')][_0x0dbe('0x27')]);_0xe2ac1f[_0x0dbe('0x28')]=_[_0x0dbe('0x29')](_0x38c516[_0x0dbe('0x28')]);_0xe2ac1f[_0x0dbe('0x2a')]=_[_0x0dbe('0x2b')](_0xe2ac1f[_0x0dbe('0x2f')],_0xe2ac1f[_0x0dbe('0x28')]);_0x3e22c2[_0x0dbe('0x2c')]=_['intersection'](_0xe2ac1f[_0x0dbe('0x2f')],qs['fields'](_0x38c516[_0x0dbe('0x28')][_0x0dbe('0x2d')]));_0x3e22c2['attributes']=_0x3e22c2[_0x0dbe('0x2c')][_0x0dbe('0x2e')]?_0x3e22c2[_0x0dbe('0x2c')]:_0xe2ac1f[_0x0dbe('0x2f')];_0x3e22c2[_0x0dbe('0x48')]=qs[_0x0dbe('0x49')](_0x38c516[_0x0dbe('0x28')][_0x0dbe('0x49')]);_0x3e22c2[_0x0dbe('0x33')]=qs['filters'](_['pick'](_0x38c516[_0x0dbe('0x28')],_0xe2ac1f['filters']));if(_0x38c516['query'][_0x0dbe('0x35')]){_0x3e22c2[_0x0dbe('0x33')]=_[_0x0dbe('0x36')](_0x3e22c2[_0x0dbe('0x33')],{'$or':_[_0x0dbe('0x4a')](_0x3e22c2[_0x0dbe('0x2c')],function(_0x53c67e){var _0x1ef509={};_0x1ef509[_0x53c67e]={'$like':'%'+_0x38c516['query']['filter']+'%'};return _0x1ef509;})});}_0x3e22c2=_[_0x0dbe('0x36')]({},_0x3e22c2,_0x38c516[_0x0dbe('0x37')]);return _0x256a82[_0x0dbe('0x45')](_0x3e22c2);}})['then'](function(_0x5ca1f2){if(_0x5ca1f2){_0x40956a=_0x5ca1f2[_0x0dbe('0x2e')];if(!_0x38c516[_0x0dbe('0x28')]['hasOwnProperty'](_0x0dbe('0x31'))){_0x3e22c2[_0x0dbe('0x1a')]=qs['limit'](_0x38c516[_0x0dbe('0x28')]['limit']);_0x3e22c2[_0x0dbe('0x19')]=qs[_0x0dbe('0x19')](_0x38c516[_0x0dbe('0x28')][_0x0dbe('0x19')]);}return _0x256a82[_0x0dbe('0x45')](_0x3e22c2);}})[_0x0dbe('0x21')](function(_0x16e727){if(_0x16e727){return _0x16e727?{'count':_0x40956a,'rows':_0x16e727}:null;}})[_0x0dbe('0x21')](respondWithResult(_0x2346d6,null))[_0x0dbe('0x3a')](handleError(_0x2346d6,null));};exports[_0x0dbe('0x4b')]=function(_0x376f38,_0x24467e,_0xdbd5ae){return db[_0x0dbe('0x4c')][_0x0dbe('0x3f')]({'where':{'id':_0x376f38[_0x0dbe('0x3c')]['id']}})[_0x0dbe('0x21')](handleEntityNotFound(_0x24467e,null))[_0x0dbe('0x21')](function(_0xe1e315){if(_0xe1e315){return _0xe1e315[_0x0dbe('0x4b')](_0x376f38[_0x0dbe('0x41')][_0x0dbe('0x43')],_[_0x0dbe('0x44')](_0x376f38[_0x0dbe('0x41')],[_0x0dbe('0x43'),'id'])||{});}})[_0x0dbe('0x21')](respondWithResult(_0x24467e,null))[_0x0dbe('0x3a')](handleError(_0x24467e,null));};exports[_0x0dbe('0x4d')]=function(_0x519c36,_0x3b3734,_0xa52e9){var _0x1d639f={};var _0x435133={};var _0x16c834;var _0x13ffca;return db['Automation']['findOne']({'where':{'id':_0x519c36[_0x0dbe('0x3c')]['id']}})[_0x0dbe('0x21')](handleEntityNotFound(_0x3b3734,null))[_0x0dbe('0x21')](function(_0x5a3850){if(_0x5a3850){_0x16c834=_0x5a3850;_0x435133[_0x0dbe('0x2f')]=_[_0x0dbe('0x29')](db['Action']['rawAttributes']);_0x435133[_0x0dbe('0x28')]=_[_0x0dbe('0x29')](_0x519c36[_0x0dbe('0x28')]);_0x435133[_0x0dbe('0x2a')]=_[_0x0dbe('0x2b')](_0x435133['model'],_0x435133[_0x0dbe('0x28')]);_0x1d639f[_0x0dbe('0x2c')]=_[_0x0dbe('0x2b')](_0x435133['model'],qs[_0x0dbe('0x2d')](_0x519c36['query'][_0x0dbe('0x2d')]));_0x1d639f['attributes']=_0x1d639f[_0x0dbe('0x2c')][_0x0dbe('0x2e')]?_0x1d639f[_0x0dbe('0x2c')]:_0x435133['model'];_0x1d639f[_0x0dbe('0x48')]=qs[_0x0dbe('0x49')](_0x519c36['query']['sort']);_0x1d639f[_0x0dbe('0x33')]=qs[_0x0dbe('0x2a')](_[_0x0dbe('0x32')](_0x519c36[_0x0dbe('0x28')],_0x435133[_0x0dbe('0x2a')]));if(_0x519c36[_0x0dbe('0x28')][_0x0dbe('0x35')]){_0x1d639f[_0x0dbe('0x33')]=_[_0x0dbe('0x36')](_0x1d639f[_0x0dbe('0x33')],{'$or':_[_0x0dbe('0x4a')](_0x1d639f[_0x0dbe('0x2c')],function(_0x58ddbe){var _0x32582c={};_0x32582c[_0x58ddbe]={'$like':'%'+_0x519c36['query'][_0x0dbe('0x35')]+'%'};return _0x32582c;})});}_0x1d639f=_[_0x0dbe('0x36')]({},_0x1d639f,_0x519c36[_0x0dbe('0x37')]);return _0x16c834[_0x0dbe('0x4d')](_0x1d639f);}})['then'](function(_0x63a4b4){if(_0x63a4b4){_0x13ffca=_0x63a4b4['length'];if(!_0x519c36[_0x0dbe('0x28')][_0x0dbe('0x30')](_0x0dbe('0x31'))){_0x1d639f['limit']=qs['limit'](_0x519c36[_0x0dbe('0x28')][_0x0dbe('0x1a')]);_0x1d639f[_0x0dbe('0x19')]=qs['offset'](_0x519c36[_0x0dbe('0x28')][_0x0dbe('0x19')]);}return _0x16c834['getActions'](_0x1d639f);}})['then'](function(_0x1ee12a){if(_0x1ee12a){return _0x1ee12a?{'count':_0x13ffca,'rows':_0x1ee12a}:null;}})[_0x0dbe('0x21')](respondWithResult(_0x3b3734,null))[_0x0dbe('0x3a')](handleError(_0x3b3734,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index b4ef271..cb5adca 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 _0xbcdc=['bluebird','request-promise','path','../../config/environment','define','Automation','tools_automations','lodash','util','api','moment'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xbcdc,0xb7));var _0xcbcd=function(_0x62a08e,_0x777d65){_0x62a08e=_0x62a08e-0x0;var _0x518970=_0xbcdc[_0x62a08e];return _0x518970;};'use strict';var _=require(_0xcbcd('0x0'));var util=require(_0xcbcd('0x1'));var logger=require('../../config/logger')(_0xcbcd('0x2'));var moment=require(_0xcbcd('0x3'));var BPromise=require(_0xcbcd('0x4'));var rp=require(_0xcbcd('0x5'));var fs=require('fs');var path=require(_0xcbcd('0x6'));var rimraf=require('rimraf');var config=require(_0xcbcd('0x7'));var attributes=require('./automation.attributes');module['exports']=function(_0x59d517,_0x32ee2f){return _0x59d517[_0xcbcd('0x8')](_0xcbcd('0x9'),attributes,{'tableName':_0xcbcd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec76=['request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','api','bluebird'];(function(_0x233d31,_0x4c74f2){var _0x51a6c4=function(_0x397223){while(--_0x397223){_0x233d31['push'](_0x233d31['shift']());}};_0x51a6c4(++_0x4c74f2);}(_0xec76,0x1a9));var _0x6ec7=function(_0x35ed79,_0x4ce7df){_0x35ed79=_0x35ed79-0x0;var _0x507605=_0xec76[_0x35ed79];return _0x507605;};'use strict';var _=require(_0x6ec7('0x0'));var util=require(_0x6ec7('0x1'));var logger=require('../../config/logger')(_0x6ec7('0x2'));var moment=require('moment');var BPromise=require(_0x6ec7('0x3'));var rp=require(_0x6ec7('0x4'));var fs=require('fs');var path=require(_0x6ec7('0x5'));var rimraf=require(_0x6ec7('0x6'));var config=require(_0x6ec7('0x7'));var attributes=require(_0x6ec7('0x8'));module[_0x6ec7('0x9')]=function(_0x29c1c4,_0x425f40){return _0x29c1c4[_0x6ec7('0xa')](_0x6ec7('0xb'),attributes,{'tableName':_0x6ec7('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 d84b112..4346f58 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 _0x5b28=['http','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','util','moment','ioredis','rpc','../../config/environment','jayson/promise','client'];(function(_0x55ecc4,_0x1f6fc4){var _0x2b3f81=function(_0x1e1460){while(--_0x1e1460){_0x55ecc4['push'](_0x55ecc4['shift']());}};_0x2b3f81(++_0x1f6fc4);}(_0x5b28,0xac));var _0x85b2=function(_0x4ea4ad,_0xaf0369){_0x4ea4ad=_0x4ea4ad-0x0;var _0x1e90b2=_0x5b28[_0x4ea4ad];return _0x1e90b2;};'use strict';var _=require(_0x85b2('0x0'));var util=require(_0x85b2('0x1'));var moment=require(_0x85b2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85b2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x85b2('0x4'));var config=require(_0x85b2('0x5'));var jayson=require(_0x85b2('0x6'));var client=jayson[_0x85b2('0x7')][_0x85b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f5137,_0x59f2a0,_0xd167e8){return new BPromise(function(_0xa08db5,_0x55733d){return client['request'](_0x4f5137,_0xd167e8)[_0x85b2('0x9')](function(_0x4c2038){logger[_0x85b2('0xa')](_0x85b2('0xb'),_0x59f2a0,'request\x20sent');logger[_0x85b2('0xc')](_0x85b2('0xd'),_0x59f2a0,_0x85b2('0xe'),JSON[_0x85b2('0xf')](_0x4c2038));if(_0x4c2038[_0x85b2('0x10')]){if(_0x4c2038[_0x85b2('0x10')]['code']===0x1f4){logger['error'](_0x85b2('0xb'),_0x59f2a0,_0x4c2038[_0x85b2('0x10')][_0x85b2('0x11')]);return _0x55733d(_0x4c2038[_0x85b2('0x10')][_0x85b2('0x11')]);}logger[_0x85b2('0x10')]('Automation,\x20%s,\x20%s',_0x59f2a0,_0x4c2038['error'][_0x85b2('0x11')]);return _0xa08db5(_0x4c2038[_0x85b2('0x10')][_0x85b2('0x11')]);}else{logger[_0x85b2('0xa')](_0x85b2('0xb'),_0x59f2a0,_0x85b2('0xe'));_0xa08db5(_0x4c2038['result'][_0x85b2('0x11')]);}})['catch'](function(_0x4ec6eb){logger['error'](_0x85b2('0xb'),_0x59f2a0,_0x4ec6eb);_0x55733d(_0x4ec6eb);});});} \ No newline at end of file +var _0x2619=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x17f14f,_0x3eda7a){var _0x800a7b=function(_0x55687f){while(--_0x55687f){_0x17f14f['push'](_0x17f14f['shift']());}};_0x800a7b(++_0x3eda7a);}(_0x2619,0x119));var _0x9261=function(_0x28da93,_0x1f50da){_0x28da93=_0x28da93-0x0;var _0x2b1293=_0x2619[_0x28da93];return _0x2b1293;};'use strict';var _=require(_0x9261('0x0'));var util=require(_0x9261('0x1'));var moment=require(_0x9261('0x2'));var BPromise=require('bluebird');var rs=require(_0x9261('0x3'));var fs=require('fs');var Redis=require(_0x9261('0x4'));var db=require(_0x9261('0x5'))['db'];var utils=require(_0x9261('0x6'));var logger=require(_0x9261('0x7'))(_0x9261('0x8'));var config=require(_0x9261('0x9'));var jayson=require(_0x9261('0xa'));var client=jayson[_0x9261('0xb')][_0x9261('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33f388,_0x2bc28f,_0x5efba3){return new BPromise(function(_0x4d6e29,_0x152b12){return client[_0x9261('0xd')](_0x33f388,_0x5efba3)[_0x9261('0xe')](function(_0x4d5c9f){logger[_0x9261('0xf')](_0x9261('0x10'),_0x2bc28f,_0x9261('0x11'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x2bc28f,_0x9261('0x11'),JSON[_0x9261('0x12')](_0x4d5c9f));if(_0x4d5c9f[_0x9261('0x13')]){if(_0x4d5c9f[_0x9261('0x13')][_0x9261('0x14')]===0x1f4){logger['error'](_0x9261('0x10'),_0x2bc28f,_0x4d5c9f['error'][_0x9261('0x15')]);return _0x152b12(_0x4d5c9f[_0x9261('0x13')][_0x9261('0x15')]);}logger[_0x9261('0x13')](_0x9261('0x10'),_0x2bc28f,_0x4d5c9f[_0x9261('0x13')][_0x9261('0x15')]);return _0x4d6e29(_0x4d5c9f[_0x9261('0x13')]['message']);}else{logger[_0x9261('0xf')]('Automation,\x20%s,\x20%s',_0x2bc28f,_0x9261('0x11'));_0x4d6e29(_0x4d5c9f[_0x9261('0x16')][_0x9261('0x15')]);}})[_0x9261('0x17')](function(_0x451ea4){logger[_0x9261('0x13')](_0x9261('0x10'),_0x2bc28f,_0x451ea4);_0x152b12(_0x451ea4);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 6c44c5f..876eca5 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 _0xa0d5=['util','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','show','getConditions','/:id/actions','getActions','create','post','addConditions','addActions','put','/:id','delete','exports'];(function(_0xfcc0e,_0x1da886){var _0x32bb2e=function(_0x4c627c){while(--_0x4c627c){_0xfcc0e['push'](_0xfcc0e['shift']());}};_0x32bb2e(++_0x1da886);}(_0xa0d5,0xab));var _0x5a0d=function(_0x5ec21d,_0x5d0772){_0x5ec21d=_0x5ec21d-0x0;var _0x43bde8=_0xa0d5[_0x5ec21d];return _0x43bde8;};'use strict';var multer=require('multer');var util=require(_0x5a0d('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x5a0d('0x1'));var interaction=require(_0x5a0d('0x2'));var config=require(_0x5a0d('0x3'));var controller=require(_0x5a0d('0x4'));router[_0x5a0d('0x5')]('/',auth[_0x5a0d('0x6')](),controller['index']);router[_0x5a0d('0x5')]('/:id',auth[_0x5a0d('0x6')](),controller[_0x5a0d('0x7')]);router[_0x5a0d('0x5')]('/:id/conditions',auth[_0x5a0d('0x6')](),controller[_0x5a0d('0x8')]);router[_0x5a0d('0x5')](_0x5a0d('0x9'),auth[_0x5a0d('0x6')](),controller[_0x5a0d('0xa')]);router['post']('/',auth[_0x5a0d('0x6')](),controller[_0x5a0d('0xb')]);router[_0x5a0d('0xc')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x5a0d('0xd')]);router[_0x5a0d('0xc')](_0x5a0d('0x9'),auth[_0x5a0d('0x6')](),controller[_0x5a0d('0xe')]);router[_0x5a0d('0xf')](_0x5a0d('0x10'),auth[_0x5a0d('0x6')](),controller['update']);router[_0x5a0d('0x11')](_0x5a0d('0x10'),auth[_0x5a0d('0x6')](),controller['destroy']);module[_0x5a0d('0x12')]=router; \ No newline at end of file +var _0x5464=['isAuthenticated','index','get','show','getConditions','getActions','post','create','/:id/conditions','addConditions','/:id/actions','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','./automation.controller'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0x5464,0xb2));var _0x4546=function(_0x43a43d,_0xccdf62){_0x43a43d=_0x43a43d-0x0;var _0x55549b=_0x5464[_0x43a43d];return _0x55549b;};'use strict';var multer=require(_0x4546('0x0'));var util=require('util');var path=require(_0x4546('0x1'));var timeout=require(_0x4546('0x2'));var express=require('express');var router=express[_0x4546('0x3')]();var auth=require(_0x4546('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4546('0x5'));router['get']('/',auth[_0x4546('0x6')](),controller[_0x4546('0x7')]);router[_0x4546('0x8')]('/:id',auth[_0x4546('0x6')](),controller[_0x4546('0x9')]);router[_0x4546('0x8')]('/:id/conditions',auth[_0x4546('0x6')](),controller[_0x4546('0xa')]);router[_0x4546('0x8')]('/:id/actions',auth[_0x4546('0x6')](),controller[_0x4546('0xb')]);router[_0x4546('0xc')]('/',auth[_0x4546('0x6')](),controller[_0x4546('0xd')]);router[_0x4546('0xc')](_0x4546('0xe'),auth[_0x4546('0x6')](),controller[_0x4546('0xf')]);router['post'](_0x4546('0x10'),auth['isAuthenticated'](),controller['addActions']);router[_0x4546('0x11')](_0x4546('0x12'),auth[_0x4546('0x6')](),controller[_0x4546('0x13')]);router[_0x4546('0x14')]('/:id',auth[_0x4546('0x6')](),controller[_0x4546('0x15')]);module[_0x4546('0x16')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 07510e3..0100535 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 _0xab2e=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\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)','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x798f65,_0x33a755){var _0x3a383f=function(_0x5ba345){while(--_0x5ba345){_0x798f65['push'](_0x798f65['shift']());}};_0x3a383f(++_0x33a755);}(_0xab2e,0xc2));var _0xeab2=function(_0x4f11cb,_0x14e174){_0x4f11cb=_0x4f11cb-0x0;var _0x491488=_0xab2e[_0x4f11cb];return _0x491488;};'use strict';var Sequelize=require(_0xeab2('0x0'));module[_0xeab2('0x1')]={'name':{'type':Sequelize[_0xeab2('0x2')],'unique':_0xeab2('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xeab2('0x4')),'allowNull':![],'defaultValue':_0xeab2('0x4')},'description':{'type':Sequelize[_0xeab2('0x2')]},'active':{'type':Sequelize[_0xeab2('0x5')],'defaultValue':0x0,'comment':_0xeab2('0x6')},'limitCalls':{'type':Sequelize[_0xeab2('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xeab2('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xeab2('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xeab2('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeab2('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xeab2('0x7')](0x3)[_0xeab2('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeab2('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xeab2('0x7')](0x3)[_0xeab2('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeab2('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xeab2('0x7')](0x5)[_0xeab2('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeab2('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xeab2('0x7')](0x3)[_0xeab2('0xa')],'defaultValue':0x3,'comment':_0xeab2('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xeab2('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeab2('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xeab2('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xeab2('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xeab2('0x2')],'defaultValue':_0xeab2('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xeab2('0x12')](_0xeab2('0x13'),_0xeab2('0x14'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xeab2('0x5')],'defaultValue':0x0,'comment':_0xeab2('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0xeab2('0x7')](0x9)[_0xeab2('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xeab2('0x16')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xeab2('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xeab2('0x7')](0x9)[_0xeab2('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xeab2('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xeab2('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xeab2('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xeab2('0x7')](0x9)[_0xeab2('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xeab2('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xeab2('0x7')](0x9)[_0xeab2('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xeab2('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xeab2('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xeab2('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xeab2('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xeab2('0x12')](_0xeab2('0x1c'),'ASC'),'defaultValue':_0xeab2('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xeab2('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xeab2('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xeab2('0x1d')}}; \ No newline at end of file +var _0x9bfd=['#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)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length'];(function(_0x2b7040,_0x9a4625){var _0x1466ce=function(_0x186cf4){while(--_0x186cf4){_0x2b7040['push'](_0x2b7040['shift']());}};_0x1466ce(++_0x9a4625);}(_0x9bfd,0x1a8));var _0xd9bf=function(_0x5e042a,_0x5ae5f2){_0x5e042a=_0x5e042a-0x0;var _0x3a8d33=_0x9bfd[_0x5e042a];return _0x3a8d33;};'use strict';var Sequelize=require(_0xd9bf('0x0'));module[_0xd9bf('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd9bf('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd9bf('0x3')](_0xd9bf('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xd9bf('0x5')]},'active':{'type':Sequelize[_0xd9bf('0x6')],'defaultValue':0x0,'comment':_0xd9bf('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xd9bf('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd9bf('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd9bf('0x5')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xd9bf('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9bf('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd9bf('0xb')](0x3)[_0xd9bf('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9bf('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd9bf('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9bf('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0xd9bf('0xb')](0x3)[_0xd9bf('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9bf('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd9bf('0xb')](0x5)[_0xd9bf('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd9bf('0xb')](0x3)[_0xd9bf('0x8')],'defaultValue':0x3,'comment':_0xd9bf('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd9bf('0xb')](0x5)[_0xd9bf('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9bf('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd9bf('0xb')](0x3)[_0xd9bf('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd9bf('0x5')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xd9bf('0x3')](_0xd9bf('0x11'),_0xd9bf('0x12'),'onlyIfOpen'),'defaultValue':_0xd9bf('0x11')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd9bf('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xd9bf('0xb')](0x9)[_0xd9bf('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd9bf('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd9bf('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd9bf('0xb')](0x9)[_0xd9bf('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd9bf('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xd9bf('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xd9bf('0xb')](0x9)[_0xd9bf('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd9bf('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd9bf('0xb')](0x9)[_0xd9bf('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd9bf('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd9bf('0xb')](0x9)[_0xd9bf('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd9bf('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd9bf('0xb')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd9bf('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd9bf('0xb')](0x9)[_0xd9bf('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd9bf('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd9bf('0x3')](_0xd9bf('0x1c'),_0xd9bf('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xd9bf('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd9bf('0xb')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd9bf('0x1e')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xd9bf('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd9bf('0x1f')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 1e7e16c..82ea92c 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 _0x08a0=['phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','select','onlyIfOpen','COALESCE(phone,\x27\x27)','insert','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','IvrCampaigns','UserProfileResource','then','name','send','index','Campaign','rawAttributes','keys','filters','intersection','query','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','type','field','merge','options','count','includeAll','findAll','catch','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','findOne','params','pick','CampaignId','CmHopper','rows','getHopperHistories','CmHopperHistory','map','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','NOW()','CmListId','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?'];(function(_0x3bdc0b,_0x2bd5a6){var _0x1be986=function(_0x56f48b){while(--_0x56f48b){_0x3bdc0b['push'](_0x3bdc0b['shift']());}};_0x1be986(++_0x2bd5a6);}(_0x08a0,0x115));var _0x008a=function(_0x43444b,_0x8cf95b){_0x43444b=_0x43444b-0x0;var _0x392fe5=_0x08a0[_0x43444b];return _0x392fe5;};'use strict';var pdf=require(_0x008a('0x0'));var emlformat=require(_0x008a('0x1'));var rimraf=require(_0x008a('0x2'));var zipdir=require(_0x008a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x008a('0x4'));var moment=require(_0x008a('0x5'));var BPromise=require(_0x008a('0x6'));var Mustache=require(_0x008a('0x7'));var util=require(_0x008a('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x008a('0x9'));var squel=require(_0x008a('0xa'));var crypto=require(_0x008a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x008a('0xc'));var toCsv=require(_0x008a('0xd'));var querystring=require(_0x008a('0xe'));var Papa=require(_0x008a('0xf'));var Redis=require(_0x008a('0x10'));var authService=require(_0x008a('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x008a('0x12'));var logger=require(_0x008a('0x13'))(_0x008a('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x008a('0x15'))['db'];function respondWithStatusCode(_0x24ca28,_0x322f2f){_0x322f2f=_0x322f2f||0xcc;return function(_0x5c4fe5){if(_0x5c4fe5){return _0x24ca28[_0x008a('0x16')](_0x322f2f);}return _0x24ca28[_0x008a('0x17')](_0x322f2f)['end']();};}function respondWithResult(_0x15e7e7,_0x1e03e9){_0x1e03e9=_0x1e03e9||0xc8;return function(_0xa2a3ac){if(_0xa2a3ac){return _0x15e7e7[_0x008a('0x17')](_0x1e03e9)[_0x008a('0x18')](_0xa2a3ac);}};}function respondWithFilteredResult(_0xd940d9,_0x5c6071){return function(_0x197d07){if(_0x197d07){var _0x1809b0=_0x197d07['count'],_0x3ba47b=_0x5c6071[_0x008a('0x19')],_0x281bcf=_0x5c6071[_0x008a('0x19')]+_0x5c6071[_0x008a('0x1a')],_0x1ccbb1;if(_0x281bcf>=_0x1809b0){_0x281bcf=_0x1809b0;_0x1ccbb1=0xc8;}else{_0x1ccbb1=0xce;}_0xd940d9['status'](_0x1ccbb1);return _0xd940d9[_0x008a('0x1b')](_0x008a('0x1c'),_0x3ba47b+'-'+_0x281bcf+'/'+_0x1809b0)[_0x008a('0x18')](_0x197d07);}return null;};}function patchUpdates(_0x51cadc){return function(_0x19be29){try{jsonpatch[_0x008a('0x1d')](_0x19be29,_0x51cadc,!![]);}catch(_0x50a2c3){return BPromise[_0x008a('0x1e')](_0x50a2c3);}return _0x19be29[_0x008a('0x1f')]();};}function saveUpdates(_0x3ca910,_0x5b6ad7){return function(_0x7a21b0){if(_0x7a21b0){return _0x7a21b0[_0x008a('0x20')](_0x3ca910)['then'](function(_0x27bdd3){return _0x27bdd3;});}return null;};}function removeEntity(_0x35be57,_0x3770e2){return function(_0x12aa28){if(_0x12aa28){return _0x12aa28[_0x008a('0x21')]()['then'](function(){var _0x1bd24d=_0x12aa28[_0x008a('0x22')]({'plain':!![]});var _0xf088b7=_0x008a('0x23');return db[_0x008a('0x24')][_0x008a('0x21')]({'where':{'type':_0xf088b7,'resourceId':_0x1bd24d['id']}})['then'](function(){return _0x12aa28;});})[_0x008a('0x25')](function(){_0x35be57['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cb015,_0x311f3d){return function(_0x4ee698){if(!_0x4ee698){_0x2cb015[_0x008a('0x16')](0x194);}return _0x4ee698;};}function handleError(_0x3a512f,_0x55522e){_0x55522e=_0x55522e||0x1f4;return function(_0xd142bb){logger['error'](_0xd142bb['stack']);if(_0xd142bb['name']){delete _0xd142bb[_0x008a('0x26')];}_0x3a512f[_0x008a('0x17')](_0x55522e)[_0x008a('0x27')](_0xd142bb);};}exports[_0x008a('0x28')]=function(_0x38469e,_0x214e48){var _0x5b032b={},_0x219b39={},_0x2194d6={'count':0x0,'rows':[]};var _0x8465b9=db[_0x008a('0x29')][_0x008a('0x2a')];_0x219b39['model']=_[_0x008a('0x2b')](_0x8465b9);_0x219b39['query']=_[_0x008a('0x2b')](_0x38469e['query']);_0x219b39[_0x008a('0x2c')]=_[_0x008a('0x2d')](_0x219b39['model'],_0x219b39[_0x008a('0x2e')]);_0x5b032b['attributes']=_['intersection'](_0x219b39[_0x008a('0x2f')],qs[_0x008a('0x30')](_0x38469e[_0x008a('0x2e')][_0x008a('0x30')]));_0x5b032b['attributes']=_0x5b032b[_0x008a('0x31')][_0x008a('0x32')]?_0x5b032b[_0x008a('0x31')]:_0x219b39[_0x008a('0x2f')];if(!_0x38469e['query'][_0x008a('0x33')](_0x008a('0x34'))){_0x5b032b[_0x008a('0x1a')]=qs['limit'](_0x38469e['query'][_0x008a('0x1a')]);_0x5b032b[_0x008a('0x19')]=qs['offset'](_0x38469e[_0x008a('0x2e')][_0x008a('0x19')]);}_0x5b032b[_0x008a('0x35')]=qs[_0x008a('0x36')](_0x38469e[_0x008a('0x2e')][_0x008a('0x36')]);_0x5b032b[_0x008a('0x37')]=qs[_0x008a('0x2c')](_['pick'](_0x38469e[_0x008a('0x2e')],_0x219b39['filters']));if(_0x38469e[_0x008a('0x2e')][_0x008a('0x38')]){_0x5b032b[_0x008a('0x37')]=_['merge'](_0x5b032b[_0x008a('0x37')],{'$or':_['map'](_0x8465b9,function(_0x35d426){if(_0x35d426[_0x008a('0x39')]['key']!=='VIRTUAL'){var _0x48091d={};_0x48091d[_0x35d426[_0x008a('0x3a')]]={'$like':'%'+_0x38469e[_0x008a('0x2e')][_0x008a('0x38')]+'%'};return _0x48091d;}})});}_0x5b032b=_[_0x008a('0x3b')]({},_0x5b032b,_0x38469e[_0x008a('0x3c')]);var _0x339603={'where':_0x5b032b[_0x008a('0x37')]};return db[_0x008a('0x29')][_0x008a('0x3d')](_0x339603)[_0x008a('0x25')](function(_0x33141d){_0x2194d6['count']=_0x33141d;if(_0x38469e['query'][_0x008a('0x3e')]){_0x5b032b['include']=[{'all':!![]}];}return db[_0x008a('0x29')][_0x008a('0x3f')](_0x5b032b);})[_0x008a('0x25')](function(_0x13e8d0){_0x2194d6['rows']=_0x13e8d0;return _0x2194d6;})['then'](respondWithFilteredResult(_0x214e48,_0x5b032b))[_0x008a('0x40')](handleError(_0x214e48,null));};exports['show']=function(_0x6bb324,_0x48f3db){var _0x2a25b4={'raw':![],'where':{'id':_0x6bb324['params']['id']}},_0xba4f60={};_0xba4f60['model']=_['keys'](db[_0x008a('0x29')]['rawAttributes']);_0xba4f60[_0x008a('0x2e')]=_[_0x008a('0x2b')](_0x6bb324[_0x008a('0x2e')]);_0xba4f60[_0x008a('0x2c')]=_['intersection'](_0xba4f60[_0x008a('0x2f')],_0xba4f60[_0x008a('0x2e')]);_0x2a25b4['attributes']=_[_0x008a('0x2d')](_0xba4f60['model'],qs['fields'](_0x6bb324[_0x008a('0x2e')][_0x008a('0x30')]));_0x2a25b4[_0x008a('0x31')]=_0x2a25b4[_0x008a('0x31')]['length']?_0x2a25b4[_0x008a('0x31')]:_0xba4f60['model'];if(_0x6bb324[_0x008a('0x2e')]['includeAll']){_0x2a25b4[_0x008a('0x41')]=[{'all':!![]}];}_0x2a25b4=_[_0x008a('0x3b')]({},_0x2a25b4,_0x6bb324['options']);return db[_0x008a('0x29')][_0x008a('0x42')](_0x2a25b4)['then'](handleEntityNotFound(_0x48f3db,null))['then'](respondWithResult(_0x48f3db,null))[_0x008a('0x40')](handleError(_0x48f3db,null));};exports[_0x008a('0x43')]=function(_0x20f456,_0x10e668){return db[_0x008a('0x29')][_0x008a('0x43')](_0x20f456[_0x008a('0x44')],{})[_0x008a('0x25')](function(_0x4472fb){var _0x8b0b36=_0x20f456['user'][_0x008a('0x22')]({'plain':!![]});if(!_0x8b0b36)throw new Error(_0x008a('0x45'));if(_0x8b0b36[_0x008a('0x46')]===_0x008a('0x47')){var _0x576cd6=_0x4472fb[_0x008a('0x22')]({'plain':!![]});var _0x41a982=_0x008a('0x23');return db[_0x008a('0x48')][_0x008a('0x42')]({'where':{'name':_0x41a982,'userProfileId':_0x8b0b36[_0x008a('0x49')]},'raw':!![]})[_0x008a('0x25')](function(_0x2f04ca){if(_0x2f04ca&&_0x2f04ca[_0x008a('0x4a')]===0x0){return db[_0x008a('0x24')]['create']({'name':_0x576cd6['name'],'resourceId':_0x576cd6['id'],'type':_0x2f04ca['name'],'sectionId':_0x2f04ca['id']},{})[_0x008a('0x25')](function(){return _0x4472fb;});}else{return _0x4472fb;}})[_0x008a('0x40')](function(_0x250f7d){logger[_0x008a('0x4b')](_0x008a('0x4c'),_0x250f7d);throw _0x250f7d;});}return _0x4472fb;})[_0x008a('0x25')](respondWithResult(_0x10e668,0xc9))[_0x008a('0x40')](handleError(_0x10e668,null));};exports['clone']=function(_0x55864f,_0xa00f10){var _0x5dc139={'raw':![],'where':{'id':_0x55864f['params']['id']}},_0x3bf548={};_0x3bf548['model']=_['keys'](db['Campaign']['rawAttributes']);_0x5dc139['attributes']=_[_0x008a('0x2d')](_0x3bf548[_0x008a('0x2f')],qs[_0x008a('0x30')](_0x55864f[_0x008a('0x2e')][_0x008a('0x30')]));_0x5dc139[_0x008a('0x31')]=_0x5dc139[_0x008a('0x31')][_0x008a('0x32')]?_0x5dc139[_0x008a('0x31')]:_0x3bf548[_0x008a('0x2f')];if(_0x55864f[_0x008a('0x2e')][_0x008a('0x3e')]){_0x5dc139[_0x008a('0x41')]=[{'all':!![]}];}_0x5dc139=_['merge']({},_0x5dc139,_0x55864f[_0x008a('0x3c')]);return db[_0x008a('0x29')]['find'](_0x5dc139)[_0x008a('0x25')](handleEntityNotFound(_0xa00f10,null))[_0x008a('0x25')](function(_0x310e2e){if(_0x310e2e){var _0x241f21=_0x310e2e[_0x008a('0x22')]({'plain':!![]});_0x241f21=qs['omit'](_0x241f21,['id',_0x008a('0x4d'),_0x008a('0x4e')]);_0x55864f[_0x008a('0x44')]=_[_0x008a('0x4f')](_0x55864f[_0x008a('0x44')],['id',_0x008a('0x4d'),'updatedAt']);return db[_0x008a('0x29')][_0x008a('0x43')](_['merge'](_0x241f21,_0x55864f[_0x008a('0x44')]),{'include':_0x55864f[_0x008a('0x2e')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x6ae382){var _0x36bfa4=_0x55864f[_0x008a('0x47')]['get']({'plain':!![]});if(!_0x36bfa4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x36bfa4[_0x008a('0x46')]===_0x008a('0x47')){var _0x62f9c3=_0x6ae382[_0x008a('0x22')]({'plain':!![]});var _0x536590=_0x008a('0x23');return db[_0x008a('0x48')][_0x008a('0x42')]({'where':{'name':_0x536590,'userProfileId':_0x36bfa4[_0x008a('0x49')]},'raw':!![]})[_0x008a('0x25')](function(_0x545c90){if(_0x545c90&&_0x545c90[_0x008a('0x4a')]===0x0){return db[_0x008a('0x24')]['create']({'name':_0x62f9c3[_0x008a('0x26')],'resourceId':_0x62f9c3['id'],'type':_0x545c90['name'],'sectionId':_0x545c90['id']},{})[_0x008a('0x25')](function(){return _0x6ae382;});}else{return _0x6ae382;}})[_0x008a('0x40')](function(_0x5d84dc){logger[_0x008a('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d84dc);throw _0x5d84dc;});}return _0x6ae382;});}})['then'](respondWithResult(_0xa00f10,0xc9))[_0x008a('0x40')](handleError(_0xa00f10,null));};exports[_0x008a('0x20')]=function(_0x5be9eb,_0x105667){if(_0x5be9eb['body']['id']){delete _0x5be9eb['body']['id'];}return db[_0x008a('0x29')][_0x008a('0x42')]({'where':{'id':_0x5be9eb['params']['id']}})[_0x008a('0x25')](handleEntityNotFound(_0x105667,null))['then'](saveUpdates(_0x5be9eb['body'],null))['then'](respondWithResult(_0x105667,null))['catch'](handleError(_0x105667,null));};exports[_0x008a('0x21')]=function(_0x5a6a4b,_0x2d5d36){return db[_0x008a('0x29')]['find']({'where':{'id':_0x5a6a4b['params']['id']}})[_0x008a('0x25')](handleEntityNotFound(_0x2d5d36,null))[_0x008a('0x25')](removeEntity(_0x2d5d36,null))['catch'](handleError(_0x2d5d36,null));};exports['getHoppers']=function(_0x52a21d,_0x35ebaf,_0x2bc893){var _0x177cd2={'raw':!![],'where':{}};var _0x3f1484={};var _0x45a3dc={'count':0x0,'rows':[]};return db['Campaign'][_0x008a('0x50')]({'where':{'id':_0x52a21d[_0x008a('0x51')]['id']}})[_0x008a('0x25')](handleEntityNotFound(_0x35ebaf,null))[_0x008a('0x25')](function(_0x4f8c12){if(_0x4f8c12){_0x3f1484[_0x008a('0x2f')]=_[_0x008a('0x2b')](db['CmHopper']['rawAttributes']);_0x3f1484[_0x008a('0x2e')]=_[_0x008a('0x2b')](_0x52a21d[_0x008a('0x2e')]);_0x3f1484[_0x008a('0x2c')]=_[_0x008a('0x2d')](_0x3f1484[_0x008a('0x2f')],_0x3f1484[_0x008a('0x2e')]);_0x177cd2[_0x008a('0x31')]=_[_0x008a('0x2d')](_0x3f1484['model'],qs[_0x008a('0x30')](_0x52a21d[_0x008a('0x2e')]['fields']));_0x177cd2['attributes']=_0x177cd2[_0x008a('0x31')][_0x008a('0x32')]?_0x177cd2[_0x008a('0x31')]:_0x3f1484[_0x008a('0x2f')];if(!_0x52a21d[_0x008a('0x2e')][_0x008a('0x33')](_0x008a('0x34'))){_0x177cd2['limit']=qs['limit'](_0x52a21d['query'][_0x008a('0x1a')]);_0x177cd2[_0x008a('0x19')]=qs['offset'](_0x52a21d[_0x008a('0x2e')][_0x008a('0x19')]);}_0x177cd2['order']=qs[_0x008a('0x36')](_0x52a21d['query'][_0x008a('0x36')]);_0x177cd2[_0x008a('0x37')]=qs[_0x008a('0x2c')](_[_0x008a('0x52')](_0x52a21d[_0x008a('0x2e')],_0x3f1484['filters']));_0x177cd2[_0x008a('0x37')][_0x008a('0x53')]=_0x4f8c12['id'];if(_0x52a21d[_0x008a('0x2e')][_0x008a('0x38')]){_0x177cd2[_0x008a('0x37')]=_['merge'](_0x177cd2['where'],{'$or':_['map'](_0x177cd2[_0x008a('0x31')],function(_0x526fec){var _0x4df978={};_0x4df978[_0x526fec]={'$like':'%'+_0x52a21d[_0x008a('0x2e')][_0x008a('0x38')]+'%'};return _0x4df978;})});}_0x177cd2=_[_0x008a('0x3b')]({},_0x177cd2,_0x52a21d[_0x008a('0x3c')]);return db[_0x008a('0x54')][_0x008a('0x3d')]({'where':_0x177cd2[_0x008a('0x37')]})[_0x008a('0x25')](function(_0x227c1f){_0x45a3dc['count']=_0x227c1f;if(_0x52a21d[_0x008a('0x2e')][_0x008a('0x3e')]){_0x177cd2[_0x008a('0x41')]=[{'all':!![]}];}return db[_0x008a('0x54')][_0x008a('0x3f')](_0x177cd2);})[_0x008a('0x25')](function(_0x2a80ba){_0x45a3dc[_0x008a('0x55')]=_0x2a80ba;return _0x45a3dc;});}})[_0x008a('0x25')](respondWithFilteredResult(_0x35ebaf,_0x177cd2))[_0x008a('0x40')](handleError(_0x35ebaf,null));};exports[_0x008a('0x56')]=function(_0x56d508,_0x379049,_0x3398e1){var _0x4d1fe7={'raw':!![],'where':{}};var _0x31cb4d={};var _0x23bfc4={'count':0x0,'rows':[]};return db[_0x008a('0x29')][_0x008a('0x50')]({'where':{'id':_0x56d508['params']['id']}})[_0x008a('0x25')](handleEntityNotFound(_0x379049,null))[_0x008a('0x25')](function(_0x1bf3e5){if(_0x1bf3e5){_0x31cb4d[_0x008a('0x2f')]=_[_0x008a('0x2b')](db[_0x008a('0x57')][_0x008a('0x2a')]);_0x31cb4d[_0x008a('0x2e')]=_['keys'](_0x56d508[_0x008a('0x2e')]);_0x31cb4d[_0x008a('0x2c')]=_[_0x008a('0x2d')](_0x31cb4d[_0x008a('0x2f')],_0x31cb4d[_0x008a('0x2e')]);_0x4d1fe7[_0x008a('0x31')]=_[_0x008a('0x2d')](_0x31cb4d[_0x008a('0x2f')],qs[_0x008a('0x30')](_0x56d508[_0x008a('0x2e')][_0x008a('0x30')]));_0x4d1fe7[_0x008a('0x31')]=_0x4d1fe7['attributes'][_0x008a('0x32')]?_0x4d1fe7['attributes']:_0x31cb4d[_0x008a('0x2f')];if(!_0x56d508[_0x008a('0x2e')][_0x008a('0x33')]('nolimit')){_0x4d1fe7[_0x008a('0x1a')]=qs[_0x008a('0x1a')](_0x56d508[_0x008a('0x2e')][_0x008a('0x1a')]);_0x4d1fe7[_0x008a('0x19')]=qs[_0x008a('0x19')](_0x56d508['query'][_0x008a('0x19')]);}_0x4d1fe7[_0x008a('0x35')]=qs[_0x008a('0x36')](_0x56d508[_0x008a('0x2e')][_0x008a('0x36')]);_0x4d1fe7['where']=qs['filters'](_[_0x008a('0x52')](_0x56d508['query'],_0x31cb4d[_0x008a('0x2c')]));_0x4d1fe7[_0x008a('0x37')][_0x008a('0x53')]=_0x1bf3e5['id'];if(_0x56d508[_0x008a('0x2e')][_0x008a('0x38')]){_0x4d1fe7[_0x008a('0x37')]=_[_0x008a('0x3b')](_0x4d1fe7[_0x008a('0x37')],{'$or':_[_0x008a('0x58')](_0x4d1fe7[_0x008a('0x31')],function(_0x3234cb){var _0x329f90={};_0x329f90[_0x3234cb]={'$like':'%'+_0x56d508['query'][_0x008a('0x38')]+'%'};return _0x329f90;})});}_0x4d1fe7=_[_0x008a('0x3b')]({},_0x4d1fe7,_0x56d508['options']);return db['CmHopperHistory'][_0x008a('0x3d')]({'where':_0x4d1fe7[_0x008a('0x37')]})['then'](function(_0x45d4fd){_0x23bfc4['count']=_0x45d4fd;if(_0x56d508['query'][_0x008a('0x3e')]){_0x4d1fe7[_0x008a('0x41')]=[{'all':!![]}];}return db[_0x008a('0x57')]['findAll'](_0x4d1fe7);})[_0x008a('0x25')](function(_0x393f2c){_0x23bfc4[_0x008a('0x55')]=_0x393f2c;return _0x23bfc4;});}})[_0x008a('0x25')](respondWithFilteredResult(_0x379049,_0x4d1fe7))[_0x008a('0x40')](handleError(_0x379049,null));};exports[_0x008a('0x59')]=function(_0x3a0659,_0x59ef54,_0x49c981){var _0x5afd1f={'raw':!![],'where':{}};var _0x3b51a5={};var _0x4bbef6={'count':0x0,'rows':[]};return db['Campaign'][_0x008a('0x50')]({'where':{'id':_0x3a0659[_0x008a('0x51')]['id']}})[_0x008a('0x25')](handleEntityNotFound(_0x59ef54,null))['then'](function(_0x19dbe2){if(_0x19dbe2){_0x3b51a5[_0x008a('0x2f')]=_[_0x008a('0x2b')](db[_0x008a('0x5a')][_0x008a('0x2a')]);_0x3b51a5['query']=_[_0x008a('0x2b')](_0x3a0659['query']);_0x3b51a5['filters']=_['intersection'](_0x3b51a5['model'],_0x3b51a5[_0x008a('0x2e')]);_0x5afd1f['attributes']=_[_0x008a('0x2d')](_0x3b51a5[_0x008a('0x2f')],qs[_0x008a('0x30')](_0x3a0659[_0x008a('0x2e')][_0x008a('0x30')]));_0x5afd1f[_0x008a('0x31')]=_0x5afd1f['attributes'][_0x008a('0x32')]?_0x5afd1f[_0x008a('0x31')]:_0x3b51a5[_0x008a('0x2f')];if(!_0x3a0659['query'][_0x008a('0x33')](_0x008a('0x34'))){_0x5afd1f[_0x008a('0x1a')]=qs[_0x008a('0x1a')](_0x3a0659[_0x008a('0x2e')][_0x008a('0x1a')]);_0x5afd1f[_0x008a('0x19')]=qs['offset'](_0x3a0659[_0x008a('0x2e')][_0x008a('0x19')]);}_0x5afd1f[_0x008a('0x35')]=qs['sort'](_0x3a0659[_0x008a('0x2e')][_0x008a('0x36')]);_0x5afd1f[_0x008a('0x37')]=qs[_0x008a('0x2c')](_['pick'](_0x3a0659[_0x008a('0x2e')],_0x3b51a5[_0x008a('0x2c')]));_0x5afd1f[_0x008a('0x37')][_0x008a('0x53')]=_0x19dbe2['id'];if(_0x3a0659[_0x008a('0x2e')][_0x008a('0x38')]){_0x5afd1f[_0x008a('0x37')]=_[_0x008a('0x3b')](_0x5afd1f[_0x008a('0x37')],{'$or':_[_0x008a('0x58')](_0x5afd1f[_0x008a('0x31')],function(_0x14aa6f){var _0x440331={};_0x440331[_0x14aa6f]={'$like':'%'+_0x3a0659['query']['filter']+'%'};return _0x440331;})});}_0x5afd1f=_[_0x008a('0x3b')]({},_0x5afd1f,_0x3a0659['options']);return db[_0x008a('0x5a')][_0x008a('0x3d')]({'where':_0x5afd1f['where']})[_0x008a('0x25')](function(_0x2dcb7b){_0x4bbef6[_0x008a('0x3d')]=_0x2dcb7b;if(_0x3a0659[_0x008a('0x2e')][_0x008a('0x3e')]){_0x5afd1f[_0x008a('0x41')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x008a('0x3f')](_0x5afd1f);})[_0x008a('0x25')](function(_0x4563ff){_0x4bbef6[_0x008a('0x55')]=_0x4563ff;return _0x4bbef6;});}})[_0x008a('0x25')](respondWithFilteredResult(_0x59ef54,_0x5afd1f))[_0x008a('0x40')](handleError(_0x59ef54,null));};exports['getHopperBlacks']=function(_0x17b235,_0x379d8c,_0x422b7d){var _0x15426f={'raw':!![],'where':{}};var _0x2e070c={};var _0x10349a={'count':0x0,'rows':[]};return db[_0x008a('0x29')][_0x008a('0x50')]({'where':{'id':_0x17b235[_0x008a('0x51')]['id']}})[_0x008a('0x25')](handleEntityNotFound(_0x379d8c,null))['then'](function(_0xa24dc6){if(_0xa24dc6){_0x2e070c[_0x008a('0x2f')]=_[_0x008a('0x2b')](db[_0x008a('0x5b')][_0x008a('0x2a')]);_0x2e070c['query']=_['keys'](_0x17b235[_0x008a('0x2e')]);_0x2e070c['filters']=_[_0x008a('0x2d')](_0x2e070c[_0x008a('0x2f')],_0x2e070c[_0x008a('0x2e')]);_0x15426f[_0x008a('0x31')]=_['intersection'](_0x2e070c[_0x008a('0x2f')],qs[_0x008a('0x30')](_0x17b235[_0x008a('0x2e')][_0x008a('0x30')]));_0x15426f[_0x008a('0x31')]=_0x15426f[_0x008a('0x31')][_0x008a('0x32')]?_0x15426f[_0x008a('0x31')]:_0x2e070c['model'];if(!_0x17b235[_0x008a('0x2e')][_0x008a('0x33')](_0x008a('0x34'))){_0x15426f[_0x008a('0x1a')]=qs['limit'](_0x17b235[_0x008a('0x2e')][_0x008a('0x1a')]);_0x15426f[_0x008a('0x19')]=qs[_0x008a('0x19')](_0x17b235[_0x008a('0x2e')]['offset']);}_0x15426f[_0x008a('0x35')]=qs['sort'](_0x17b235['query'][_0x008a('0x36')]);_0x15426f['where']=qs[_0x008a('0x2c')](_[_0x008a('0x52')](_0x17b235[_0x008a('0x2e')],_0x2e070c[_0x008a('0x2c')]));_0x15426f['where'][_0x008a('0x53')]=_0xa24dc6['id'];if(_0x17b235['query'][_0x008a('0x38')]){_0x15426f[_0x008a('0x37')]=_['merge'](_0x15426f[_0x008a('0x37')],{'$or':_[_0x008a('0x58')](_0x15426f['attributes'],function(_0x14a350){var _0x4574c7={};_0x4574c7[_0x14a350]={'$like':'%'+_0x17b235[_0x008a('0x2e')][_0x008a('0x38')]+'%'};return _0x4574c7;})});}_0x15426f=_[_0x008a('0x3b')]({},_0x15426f,_0x17b235['options']);return db[_0x008a('0x5b')]['count']({'where':_0x15426f[_0x008a('0x37')]})[_0x008a('0x25')](function(_0x52860d){_0x10349a[_0x008a('0x3d')]=_0x52860d;if(_0x17b235[_0x008a('0x2e')]['includeAll']){_0x15426f[_0x008a('0x41')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x008a('0x3f')](_0x15426f);})['then'](function(_0x13d8c2){_0x10349a[_0x008a('0x55')]=_0x13d8c2;return _0x10349a;});}})['then'](respondWithFilteredResult(_0x379d8c,_0x15426f))[_0x008a('0x40')](handleError(_0x379d8c,null));};exports[_0x008a('0x5c')]=function(_0x1b59ec,_0x57b153,_0x5f1ee8){var _0x215d42={};var _0x5a5a8e={};var _0x267263;var _0xdaeb77;return db[_0x008a('0x29')][_0x008a('0x50')]({'where':{'id':_0x1b59ec[_0x008a('0x51')]['id']}})[_0x008a('0x25')](handleEntityNotFound(_0x57b153,null))['then'](function(_0x30e57e){if(_0x30e57e){_0x267263=_0x30e57e;_0x5a5a8e['model']=_[_0x008a('0x2b')](db[_0x008a('0x5d')][_0x008a('0x2a')]);_0x5a5a8e[_0x008a('0x2e')]=_[_0x008a('0x2b')](_0x1b59ec['query']);_0x5a5a8e[_0x008a('0x2c')]=_[_0x008a('0x2d')](_0x5a5a8e[_0x008a('0x2f')],_0x5a5a8e['query']);_0x215d42[_0x008a('0x31')]=_[_0x008a('0x2d')](_0x5a5a8e[_0x008a('0x2f')],qs['fields'](_0x1b59ec[_0x008a('0x2e')][_0x008a('0x30')]));_0x215d42[_0x008a('0x31')]=_0x215d42[_0x008a('0x31')]['length']?_0x215d42[_0x008a('0x31')]:_0x5a5a8e[_0x008a('0x2f')];_0x215d42[_0x008a('0x35')]=qs['sort'](_0x1b59ec['query'][_0x008a('0x36')]);_0x215d42[_0x008a('0x37')]=qs[_0x008a('0x2c')](_['pick'](_0x1b59ec[_0x008a('0x2e')],_0x5a5a8e[_0x008a('0x2c')]));if(_0x1b59ec[_0x008a('0x2e')]['filter']){_0x215d42[_0x008a('0x37')]=_[_0x008a('0x3b')](_0x215d42['where'],{'$or':_[_0x008a('0x58')](_0x215d42[_0x008a('0x31')],function(_0x2ab3c2){var _0x38a508={};_0x38a508[_0x2ab3c2]={'$like':'%'+_0x1b59ec[_0x008a('0x2e')][_0x008a('0x38')]+'%'};return _0x38a508;})});}_0x215d42=_[_0x008a('0x3b')]({},_0x215d42,_0x1b59ec[_0x008a('0x3c')]);return _0x267263['getLists'](_0x215d42);}})[_0x008a('0x25')](function(_0x358eb9){if(_0x358eb9){_0xdaeb77=_0x358eb9[_0x008a('0x32')];if(!_0x1b59ec[_0x008a('0x2e')][_0x008a('0x33')]('nolimit')){_0x215d42['limit']=qs['limit'](_0x1b59ec['query'][_0x008a('0x1a')]);_0x215d42[_0x008a('0x19')]=qs[_0x008a('0x19')](_0x1b59ec[_0x008a('0x2e')]['offset']);}return _0x267263['getLists'](_0x215d42);}})[_0x008a('0x25')](function(_0xa30d38){if(_0xa30d38){return _0xa30d38?{'count':_0xdaeb77,'rows':_0xa30d38}:null;}})[_0x008a('0x25')](respondWithResult(_0x57b153,null))[_0x008a('0x40')](handleError(_0x57b153,null));};exports[_0x008a('0x5e')]=function(_0x2456e8,_0x3750f6,_0xca2cb5){var _0x4bb887,_0x4fa888;return db[_0x008a('0x29')][_0x008a('0x42')]({'where':{'id':_0x2456e8['params']['id']}})[_0x008a('0x25')](handleEntityNotFound(_0x3750f6,null))[_0x008a('0x25')](function(_0x3a9420){if(_0x3a9420){_0x4fa888=_0x3a9420;return _0x3a9420[_0x008a('0x5e')](_0x2456e8[_0x008a('0x44')][_0x008a('0x5f')],_[_0x008a('0x4f')](_0x2456e8[_0x008a('0x44')],[_0x008a('0x5f'),'id'])||{});}return null;})[_0x008a('0x60')](function(_0x899976){var _0x443647;_0x4bb887=_0x899976||[];var _0x1199d8=[];if(_0x899976){for(var _0x1d969e=0x0;_0x1d969e<_0x899976[_0x008a('0x32')];_0x1d969e+=0x1){var _0x49267c=_0x899976[_0x1d969e][_0x008a('0x22')]({'plain':!![]});_0x4fa888['dialCheckDuplicateType']=_0x2456e8[_0x008a('0x44')][_0x008a('0x61')]?_0x2456e8[_0x008a('0x44')][_0x008a('0x61')]:_0x4fa888[_0x008a('0x61')];switch(_0x4fa888['dialCheckDuplicateType']){case _0x008a('0x62'):_0x443647=squel['insert']()[_0x008a('0x63')](_0x008a('0x64'))[_0x008a('0x65')]([_0x008a('0x66'),_0x008a('0x67'),_0x008a('0x68'),'ListId',_0x008a('0x53'),_0x008a('0x4d'),'updatedAt'],squel['select']()[_0x008a('0x3a')](_0x008a('0x66'),'phone')[_0x008a('0x3a')](_0x008a('0x69'),'scheduledAt')[_0x008a('0x3a')]('id',_0x008a('0x68'))[_0x008a('0x3a')](_0x49267c[_0x008a('0x6a')][_0x008a('0x6b')](),_0x008a('0x6c'))[_0x008a('0x3a')](_0x2456e8['params']['id'][_0x008a('0x6b')](),_0x008a('0x53'))[_0x008a('0x3a')]('NOW()',_0x008a('0x4d'))[_0x008a('0x3a')](_0x008a('0x69'),'updatedAt')[_0x008a('0x6d')](_0x008a('0x6e'))[_0x008a('0x37')](_0x008a('0x6f'))[_0x008a('0x37')](_0x008a('0x70'),_0x49267c[_0x008a('0x6a')][_0x008a('0x6b')]())['where'](_0x008a('0x71'))[_0x008a('0x37')](_0x008a('0x72'),squel['select']()['field'](_0x008a('0x73'))[_0x008a('0x6d')](_0x008a('0x74'))[_0x008a('0x37')](_0x008a('0x75'),_0x2456e8[_0x008a('0x51')]['id'][_0x008a('0x6b')]()))[_0x008a('0x37')](_0x008a('0x72'),squel[_0x008a('0x76')]()[_0x008a('0x3a')]('COALESCE(phone,\x27\x27)')[_0x008a('0x6d')](_0x008a('0x64'))[_0x008a('0x37')](_0x008a('0x75'),_0x2456e8[_0x008a('0x51')]['id'][_0x008a('0x6b')]())))[_0x008a('0x6b')]();break;case _0x008a('0x77'):_0x443647=squel['insert']()[_0x008a('0x63')](_0x008a('0x64'))[_0x008a('0x65')]([_0x008a('0x66'),_0x008a('0x67'),_0x008a('0x68'),_0x008a('0x6c'),_0x008a('0x53'),_0x008a('0x4d'),'updatedAt'],squel['select']()[_0x008a('0x3a')]('phone',_0x008a('0x66'))[_0x008a('0x3a')]('NOW()','scheduledAt')[_0x008a('0x3a')]('id',_0x008a('0x68'))['field'](_0x49267c['CmListId']['toString'](),_0x008a('0x6c'))[_0x008a('0x3a')](_0x2456e8[_0x008a('0x51')]['id'][_0x008a('0x6b')](),_0x008a('0x53'))[_0x008a('0x3a')]('NOW()',_0x008a('0x4d'))[_0x008a('0x3a')]('NOW()',_0x008a('0x4e'))[_0x008a('0x6d')](_0x008a('0x6e'))[_0x008a('0x37')](_0x008a('0x6f'))['where']('ListId\x20=\x20?',_0x49267c['CmListId'][_0x008a('0x6b')]())[_0x008a('0x37')](_0x008a('0x71'))[_0x008a('0x37')](_0x008a('0x72'),squel[_0x008a('0x76')]()[_0x008a('0x3a')](_0x008a('0x78'))[_0x008a('0x6d')](_0x008a('0x64'))[_0x008a('0x37')](_0x008a('0x75'),_0x2456e8['params']['id']['toString']())))[_0x008a('0x6b')]();break;default:_0x443647=squel[_0x008a('0x79')]()['into'](_0x008a('0x64'))['fromQuery'](['phone',_0x008a('0x67'),_0x008a('0x68'),_0x008a('0x6c'),_0x008a('0x53'),_0x008a('0x4d'),'updatedAt'],squel[_0x008a('0x76')]()[_0x008a('0x3a')](_0x008a('0x66'),_0x008a('0x66'))['field'](_0x008a('0x69'),_0x008a('0x67'))[_0x008a('0x3a')]('id',_0x008a('0x68'))[_0x008a('0x3a')](_0x49267c[_0x008a('0x6a')][_0x008a('0x6b')](),_0x008a('0x6c'))[_0x008a('0x3a')](_0x2456e8['params']['id'][_0x008a('0x6b')](),_0x008a('0x53'))[_0x008a('0x3a')]('NOW()',_0x008a('0x4d'))[_0x008a('0x3a')]('NOW()',_0x008a('0x4e'))['from'](_0x008a('0x6e'))['where'](_0x008a('0x6f'))['where'](_0x008a('0x70'),_0x49267c['CmListId'][_0x008a('0x6b')]())[_0x008a('0x37')](_0x008a('0x71')))[_0x008a('0x6b')]();}_0x1199d8[_0x008a('0x7a')](db[_0x008a('0x7b')][_0x008a('0x2e')](_0x443647));}return BPromise[_0x008a('0x7c')](_0x1199d8);}})[_0x008a('0x25')](function(){return _0x4bb887;})[_0x008a('0x25')](respondWithResult(_0x3750f6,null))[_0x008a('0x40')](handleError(_0x3750f6,null));};exports[_0x008a('0x7d')]=function(_0x2ef145,_0x2df7af,_0x42ad20){return db[_0x008a('0x29')]['find']({'where':{'id':_0x2ef145['params']['id']}})['then'](handleEntityNotFound(_0x2df7af,null))[_0x008a('0x25')](function(_0x50358c){if(_0x50358c){return _0x50358c[_0x008a('0x7d')](_0x2ef145['query'][_0x008a('0x5f')]);}})[_0x008a('0x25')](function(_0x249922){if(_0x249922){return db[_0x008a('0x54')][_0x008a('0x21')]({'where':{'ListId':_0x2ef145[_0x008a('0x2e')]['ids'],'CampaignId':_0x2ef145[_0x008a('0x51')]['id']}})[_0x008a('0x25')](function(){return _0x249922;});}})[_0x008a('0x25')](respondWithStatusCode(_0x2df7af,null))[_0x008a('0x40')](handleError(_0x2df7af,null));};exports[_0x008a('0x7e')]=function(_0x1e101e,_0x10daa4,_0x57960d){var _0x225972={'raw':!![],'where':{}};var _0x1c58e9={};var _0x5eb276={'count':0x0,'rows':[]};return db[_0x008a('0x29')]['findOne']({'where':{'id':_0x1e101e[_0x008a('0x51')]['id']}})[_0x008a('0x25')](handleEntityNotFound(_0x10daa4,null))['then'](function(_0x430709){if(_0x430709){_0x1c58e9[_0x008a('0x2f')]=_[_0x008a('0x2b')](db['CmList'][_0x008a('0x2a')]);_0x1c58e9[_0x008a('0x2e')]=_[_0x008a('0x2b')](_0x1e101e[_0x008a('0x2e')]);_0x1c58e9[_0x008a('0x2c')]=_['intersection'](_0x1c58e9[_0x008a('0x2f')],_0x1c58e9[_0x008a('0x2e')]);_0x225972[_0x008a('0x31')]=_['intersection'](_0x1c58e9[_0x008a('0x2f')],qs[_0x008a('0x30')](_0x1e101e['query'][_0x008a('0x30')]));_0x225972[_0x008a('0x31')]=_0x225972['attributes']['length']?_0x225972[_0x008a('0x31')]:_0x1c58e9[_0x008a('0x2f')];if(!_0x1e101e[_0x008a('0x2e')][_0x008a('0x33')](_0x008a('0x34'))){_0x225972[_0x008a('0x1a')]=qs[_0x008a('0x1a')](_0x1e101e[_0x008a('0x2e')][_0x008a('0x1a')]);_0x225972[_0x008a('0x19')]=qs[_0x008a('0x19')](_0x1e101e[_0x008a('0x2e')][_0x008a('0x19')]);}_0x225972[_0x008a('0x35')]=qs[_0x008a('0x36')](_0x1e101e['query'][_0x008a('0x36')]);_0x225972[_0x008a('0x37')]=qs[_0x008a('0x2c')](_['pick'](_0x1e101e['query'],_0x1c58e9[_0x008a('0x2c')]));_0x225972[_0x008a('0x37')][_0x008a('0x53')]=_0x430709['id'];if(_0x1e101e[_0x008a('0x2e')][_0x008a('0x38')]){_0x225972[_0x008a('0x37')]=_[_0x008a('0x3b')](_0x225972[_0x008a('0x37')],{'$or':_[_0x008a('0x58')](_0x225972[_0x008a('0x31')],function(_0x4ca969){var _0x709f29={};_0x709f29[_0x4ca969]={'$like':'%'+_0x1e101e[_0x008a('0x2e')][_0x008a('0x38')]+'%'};return _0x709f29;})});}_0x225972=_[_0x008a('0x3b')]({},_0x225972,_0x1e101e[_0x008a('0x3c')]);return db[_0x008a('0x5d')][_0x008a('0x3d')]({'where':_0x225972[_0x008a('0x37')]})[_0x008a('0x25')](function(_0x1d50d7){_0x5eb276[_0x008a('0x3d')]=_0x1d50d7;if(_0x1e101e[_0x008a('0x2e')][_0x008a('0x3e')]){_0x225972['include']=[{'all':!![]}];}return db['CmList'][_0x008a('0x3f')](_0x225972);})[_0x008a('0x25')](function(_0x1a2236){_0x5eb276[_0x008a('0x55')]=_0x1a2236;return _0x5eb276;});}})[_0x008a('0x25')](respondWithFilteredResult(_0x10daa4,_0x225972))[_0x008a('0x40')](handleError(_0x10daa4,null));};exports['addBlackLists']=function(_0x50d723,_0x2239fb,_0x33f3ae){var _0x24e542,_0x188742;return db[_0x008a('0x29')][_0x008a('0x42')]({'where':{'id':_0x50d723[_0x008a('0x51')]['id']}})[_0x008a('0x25')](handleEntityNotFound(_0x2239fb,null))[_0x008a('0x25')](function(_0x256c55){if(_0x256c55){_0x188742=_0x256c55;return _0x256c55[_0x008a('0x7f')](_0x50d723[_0x008a('0x44')]['ids'],_['omit'](_0x50d723[_0x008a('0x44')],[_0x008a('0x5f'),'id'])||{});}return null;})[_0x008a('0x60')](function(_0x53b102){var _0x3684a7;_0x24e542=_0x53b102||[];var _0x2c1f07=[];if(_0x53b102){for(var _0x34ae7b=0x0;_0x34ae7b<_0x53b102[_0x008a('0x32')];_0x34ae7b+=0x1){var _0x99a336=_0x53b102[_0x34ae7b][_0x008a('0x22')]({'plain':!![]});_0x3684a7=squel['insert']()[_0x008a('0x63')](_0x008a('0x80'))[_0x008a('0x65')]([_0x008a('0x66'),_0x008a('0x68'),'ListId',_0x008a('0x53'),_0x008a('0x4d'),_0x008a('0x4e')],squel[_0x008a('0x76')]()['field'](_0x008a('0x66'),_0x008a('0x66'))['field']('id','ContactId')[_0x008a('0x3a')](_0x99a336[_0x008a('0x6a')]['toString'](),_0x008a('0x6c'))[_0x008a('0x3a')](_0x50d723[_0x008a('0x51')]['id'][_0x008a('0x6b')](),_0x008a('0x53'))[_0x008a('0x3a')](_0x008a('0x69'),_0x008a('0x4d'))[_0x008a('0x3a')](_0x008a('0x69'),_0x008a('0x4e'))[_0x008a('0x6d')](_0x008a('0x6e'))['where']('deletedAt\x20IS\x20NULL')[_0x008a('0x37')]('ListId\x20=\x20?',_0x99a336[_0x008a('0x6a')][_0x008a('0x6b')]())[_0x008a('0x37')]('phone\x20IS\x20NOT\x20NULL'))[_0x008a('0x6b')]();_0x2c1f07['push'](db[_0x008a('0x7b')][_0x008a('0x2e')](_0x3684a7));}return BPromise['all'](_0x2c1f07);}})[_0x008a('0x25')](function(){return _0x24e542;})['then'](respondWithResult(_0x2239fb,null))[_0x008a('0x40')](handleError(_0x2239fb,null));};exports[_0x008a('0x81')]=function(_0x24199f,_0x5b7d3d,_0x477368){return db[_0x008a('0x29')][_0x008a('0x42')]({'where':{'id':_0x24199f[_0x008a('0x51')]['id']}})[_0x008a('0x25')](handleEntityNotFound(_0x5b7d3d,null))[_0x008a('0x25')](function(_0x374af6){if(_0x374af6){return _0x374af6[_0x008a('0x81')](_0x24199f['query'][_0x008a('0x5f')]);}})[_0x008a('0x25')](function(_0x46df89){if(_0x46df89){return db[_0x008a('0x5b')][_0x008a('0x21')]({'where':{'ListId':_0x24199f['query'][_0x008a('0x5f')],'CampaignId':_0x24199f[_0x008a('0x51')]['id']}})[_0x008a('0x25')](function(){return _0x46df89;});}})[_0x008a('0x25')](respondWithStatusCode(_0x5b7d3d,null))[_0x008a('0x40')](handleError(_0x5b7d3d,null));}; \ No newline at end of file +var _0xa61d=['count','offset','limit','set','json','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','Campaign','rawAttributes','keys','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','filter','merge','map','type','key','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','autoAssociation','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','hasOwnProperty','pick','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','toString','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','from','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','push','sequelize','removeLists','getBlackLists','addBlackLists','all','removeBlackLists','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xa61d,0xea));var _0xda61=function(_0x500923,_0x3689d9){_0x500923=_0x500923-0x0;var _0x4c4e33=_0xa61d[_0x500923];return _0x4c4e33;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xda61('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda61('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda61('0x2'));var moment=require('moment');var BPromise=require(_0xda61('0x3'));var Mustache=require(_0xda61('0x4'));var util=require(_0xda61('0x5'));var path=require(_0xda61('0x6'));var sox=require(_0xda61('0x7'));var csv=require(_0xda61('0x8'));var ejs=require(_0xda61('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xda61('0xa'));var crypto=require(_0xda61('0xb'));var jsforce=require(_0xda61('0xc'));var deskjs=require(_0xda61('0xd'));var toCsv=require(_0xda61('0x8'));var querystring=require(_0xda61('0xe'));var Papa=require(_0xda61('0xf'));var Redis=require('ioredis');var authService=require(_0xda61('0x10'));var qs=require(_0xda61('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xda61('0x12'));var utils=require(_0xda61('0x13'));var config=require('../../config/environment');var db=require(_0xda61('0x14'))['db'];function respondWithStatusCode(_0x343676,_0x2bd587){_0x2bd587=_0x2bd587||0xcc;return function(_0x658267){if(_0x658267){return _0x343676[_0xda61('0x15')](_0x2bd587);}return _0x343676[_0xda61('0x16')](_0x2bd587)[_0xda61('0x17')]();};}function respondWithResult(_0x508f97,_0x42177f){_0x42177f=_0x42177f||0xc8;return function(_0x2c09b3){if(_0x2c09b3){return _0x508f97['status'](_0x42177f)['json'](_0x2c09b3);}};}function respondWithFilteredResult(_0x73120,_0x15e388){return function(_0x25145c){if(_0x25145c){var _0x541267=_0x25145c[_0xda61('0x18')],_0x3e85f1=_0x15e388[_0xda61('0x19')],_0x3a11f5=_0x15e388[_0xda61('0x19')]+_0x15e388[_0xda61('0x1a')],_0x2a20fe;if(_0x3a11f5>=_0x541267){_0x3a11f5=_0x541267;_0x2a20fe=0xc8;}else{_0x2a20fe=0xce;}_0x73120[_0xda61('0x16')](_0x2a20fe);return _0x73120[_0xda61('0x1b')]('Content-Range',_0x3e85f1+'-'+_0x3a11f5+'/'+_0x541267)[_0xda61('0x1c')](_0x25145c);}return null;};}function patchUpdates(_0x53db32){return function(_0x3e8afe){try{jsonpatch[_0xda61('0x1d')](_0x3e8afe,_0x53db32,!![]);}catch(_0xf21938){return BPromise[_0xda61('0x1e')](_0xf21938);}return _0x3e8afe[_0xda61('0x1f')]();};}function saveUpdates(_0x1024a6,_0x2a36d1){return function(_0x55b7ec){if(_0x55b7ec){return _0x55b7ec[_0xda61('0x20')](_0x1024a6)[_0xda61('0x21')](function(_0x12b5a6){return _0x12b5a6;});}return null;};}function removeEntity(_0x562391,_0x1cbc6a){return function(_0x1abd34){if(_0x1abd34){return _0x1abd34[_0xda61('0x22')]()[_0xda61('0x21')](function(){var _0x5a8b68=_0x1abd34[_0xda61('0x23')]({'plain':!![]});var _0x3b52f6=_0xda61('0x24');return db[_0xda61('0x25')][_0xda61('0x22')]({'where':{'type':_0x3b52f6,'resourceId':_0x5a8b68['id']}})[_0xda61('0x21')](function(){return _0x1abd34;});})[_0xda61('0x21')](function(){_0x562391[_0xda61('0x16')](0xcc)[_0xda61('0x17')]();});}};}function handleEntityNotFound(_0x218a6f,_0x14bce9){return function(_0x43773b){if(!_0x43773b){_0x218a6f['sendStatus'](0x194);}return _0x43773b;};}function handleError(_0x3fc728,_0x59e5c4){_0x59e5c4=_0x59e5c4||0x1f4;return function(_0x59a4b8){logger[_0xda61('0x26')](_0x59a4b8[_0xda61('0x27')]);if(_0x59a4b8[_0xda61('0x28')]){delete _0x59a4b8[_0xda61('0x28')];}_0x3fc728[_0xda61('0x16')](_0x59e5c4)[_0xda61('0x29')](_0x59a4b8);};}exports['index']=function(_0x455a9d,_0x39aadb){var _0x4cb162={},_0x1ec0e4={},_0x3de5d9={'count':0x0,'rows':[]};var _0x5a6a3b=db[_0xda61('0x2a')][_0xda61('0x2b')];_0x1ec0e4['model']=_[_0xda61('0x2c')](_0x5a6a3b);_0x1ec0e4[_0xda61('0x2d')]=_['keys'](_0x455a9d[_0xda61('0x2d')]);_0x1ec0e4[_0xda61('0x2e')]=_[_0xda61('0x2f')](_0x1ec0e4[_0xda61('0x30')],_0x1ec0e4[_0xda61('0x2d')]);_0x4cb162['attributes']=_[_0xda61('0x2f')](_0x1ec0e4[_0xda61('0x30')],qs[_0xda61('0x31')](_0x455a9d['query']['fields']));_0x4cb162[_0xda61('0x32')]=_0x4cb162[_0xda61('0x32')]['length']?_0x4cb162['attributes']:_0x1ec0e4[_0xda61('0x30')];if(!_0x455a9d[_0xda61('0x2d')]['hasOwnProperty'](_0xda61('0x33'))){_0x4cb162[_0xda61('0x1a')]=qs['limit'](_0x455a9d[_0xda61('0x2d')][_0xda61('0x1a')]);_0x4cb162[_0xda61('0x19')]=qs[_0xda61('0x19')](_0x455a9d[_0xda61('0x2d')][_0xda61('0x19')]);}_0x4cb162[_0xda61('0x34')]=qs[_0xda61('0x35')](_0x455a9d[_0xda61('0x2d')][_0xda61('0x35')]);_0x4cb162[_0xda61('0x36')]=qs[_0xda61('0x2e')](_['pick'](_0x455a9d[_0xda61('0x2d')],_0x1ec0e4[_0xda61('0x2e')]));if(_0x455a9d[_0xda61('0x2d')][_0xda61('0x37')]){_0x4cb162[_0xda61('0x36')]=_[_0xda61('0x38')](_0x4cb162[_0xda61('0x36')],{'$or':_[_0xda61('0x39')](_0x5a6a3b,function(_0x1052bb){if(_0x1052bb[_0xda61('0x3a')][_0xda61('0x3b')]!=='VIRTUAL'){var _0x1f0962={};_0x1f0962[_0x1052bb['field']]={'$like':'%'+_0x455a9d[_0xda61('0x2d')][_0xda61('0x37')]+'%'};return _0x1f0962;}})});}_0x4cb162=_[_0xda61('0x38')]({},_0x4cb162,_0x455a9d[_0xda61('0x3c')]);var _0x1ec1b6={'where':_0x4cb162[_0xda61('0x36')]};return db['Campaign']['count'](_0x1ec1b6)['then'](function(_0x4d424d){_0x3de5d9[_0xda61('0x18')]=_0x4d424d;if(_0x455a9d[_0xda61('0x2d')][_0xda61('0x3d')]){_0x4cb162[_0xda61('0x3e')]=[{'all':!![]}];}return db[_0xda61('0x2a')][_0xda61('0x3f')](_0x4cb162);})[_0xda61('0x21')](function(_0x497246){_0x3de5d9[_0xda61('0x40')]=_0x497246;return _0x3de5d9;})[_0xda61('0x21')](respondWithFilteredResult(_0x39aadb,_0x4cb162))[_0xda61('0x41')](handleError(_0x39aadb,null));};exports['show']=function(_0x5949f4,_0x5123ef){var _0x19121c={'raw':![],'where':{'id':_0x5949f4[_0xda61('0x42')]['id']}},_0x5491ed={};_0x5491ed[_0xda61('0x30')]=_['keys'](db['Campaign'][_0xda61('0x2b')]);_0x5491ed['query']=_[_0xda61('0x2c')](_0x5949f4['query']);_0x5491ed['filters']=_[_0xda61('0x2f')](_0x5491ed[_0xda61('0x30')],_0x5491ed['query']);_0x19121c['attributes']=_[_0xda61('0x2f')](_0x5491ed[_0xda61('0x30')],qs[_0xda61('0x31')](_0x5949f4[_0xda61('0x2d')]['fields']));_0x19121c[_0xda61('0x32')]=_0x19121c[_0xda61('0x32')][_0xda61('0x43')]?_0x19121c[_0xda61('0x32')]:_0x5491ed[_0xda61('0x30')];if(_0x5949f4[_0xda61('0x2d')][_0xda61('0x3d')]){_0x19121c[_0xda61('0x3e')]=[{'all':!![]}];}_0x19121c=_[_0xda61('0x38')]({},_0x19121c,_0x5949f4[_0xda61('0x3c')]);return db['Campaign'][_0xda61('0x44')](_0x19121c)[_0xda61('0x21')](handleEntityNotFound(_0x5123ef,null))[_0xda61('0x21')](respondWithResult(_0x5123ef,null))[_0xda61('0x41')](handleError(_0x5123ef,null));};exports[_0xda61('0x45')]=function(_0x4d580f,_0x37a341){return db['Campaign']['create'](_0x4d580f[_0xda61('0x46')],{})['then'](function(_0x3d3713){var _0x45f218=_0x4d580f[_0xda61('0x47')]['get']({'plain':!![]});if(!_0x45f218)throw new Error(_0xda61('0x48'));if(_0x45f218['role']==='user'){var _0x59806e=_0x3d3713[_0xda61('0x23')]({'plain':!![]});var _0x57d439='IvrCampaigns';return db[_0xda61('0x49')][_0xda61('0x44')]({'where':{'name':_0x57d439,'userProfileId':_0x45f218[_0xda61('0x4a')]},'raw':!![]})[_0xda61('0x21')](function(_0x1c7fe7){if(_0x1c7fe7&&_0x1c7fe7['autoAssociation']===0x0){return db['UserProfileResource'][_0xda61('0x45')]({'name':_0x59806e[_0xda61('0x28')],'resourceId':_0x59806e['id'],'type':_0x1c7fe7['name'],'sectionId':_0x1c7fe7['id']},{})[_0xda61('0x21')](function(){return _0x3d3713;});}else{return _0x3d3713;}})['catch'](function(_0x44ed87){logger[_0xda61('0x26')](_0xda61('0x4b'),_0x44ed87);throw _0x44ed87;});}return _0x3d3713;})[_0xda61('0x21')](respondWithResult(_0x37a341,0xc9))[_0xda61('0x41')](handleError(_0x37a341,null));};exports[_0xda61('0x4c')]=function(_0x147ed1,_0x1e61ff){var _0xb00349={'raw':![],'where':{'id':_0x147ed1[_0xda61('0x42')]['id']}},_0x126c60={};_0x126c60[_0xda61('0x30')]=_['keys'](db[_0xda61('0x2a')][_0xda61('0x2b')]);_0xb00349['attributes']=_[_0xda61('0x2f')](_0x126c60['model'],qs[_0xda61('0x31')](_0x147ed1['query'][_0xda61('0x31')]));_0xb00349[_0xda61('0x32')]=_0xb00349[_0xda61('0x32')][_0xda61('0x43')]?_0xb00349['attributes']:_0x126c60[_0xda61('0x30')];if(_0x147ed1[_0xda61('0x2d')][_0xda61('0x3d')]){_0xb00349['include']=[{'all':!![]}];}_0xb00349=_[_0xda61('0x38')]({},_0xb00349,_0x147ed1[_0xda61('0x3c')]);return db[_0xda61('0x2a')]['find'](_0xb00349)[_0xda61('0x21')](handleEntityNotFound(_0x1e61ff,null))[_0xda61('0x21')](function(_0x5aade6){if(_0x5aade6){var _0xb4e407=_0x5aade6[_0xda61('0x23')]({'plain':!![]});_0xb4e407=qs[_0xda61('0x4d')](_0xb4e407,['id',_0xda61('0x4e'),_0xda61('0x4f')]);_0x147ed1['body']=_[_0xda61('0x4d')](_0x147ed1[_0xda61('0x46')],['id',_0xda61('0x4e'),_0xda61('0x4f')]);return db[_0xda61('0x2a')][_0xda61('0x45')](_['merge'](_0xb4e407,_0x147ed1['body']),{'include':_0x147ed1[_0xda61('0x2d')]['includeAll']?[{'all':!![]}]:undefined})[_0xda61('0x21')](function(_0x3437a7){var _0xa4c3a4=_0x147ed1[_0xda61('0x47')]['get']({'plain':!![]});if(!_0xa4c3a4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa4c3a4[_0xda61('0x50')]===_0xda61('0x47')){var _0x4b1e72=_0x3437a7[_0xda61('0x23')]({'plain':!![]});var _0x16d051='IvrCampaigns';return db['UserProfileSection'][_0xda61('0x44')]({'where':{'name':_0x16d051,'userProfileId':_0xa4c3a4[_0xda61('0x4a')]},'raw':!![]})[_0xda61('0x21')](function(_0x3709e9){if(_0x3709e9&&_0x3709e9[_0xda61('0x51')]===0x0){return db['UserProfileResource'][_0xda61('0x45')]({'name':_0x4b1e72[_0xda61('0x28')],'resourceId':_0x4b1e72['id'],'type':_0x3709e9[_0xda61('0x28')],'sectionId':_0x3709e9['id']},{})[_0xda61('0x21')](function(){return _0x3437a7;});}else{return _0x3437a7;}})[_0xda61('0x41')](function(_0x13ec3f){logger[_0xda61('0x26')](_0xda61('0x4b'),_0x13ec3f);throw _0x13ec3f;});}return _0x3437a7;});}})['then'](respondWithResult(_0x1e61ff,0xc9))[_0xda61('0x41')](handleError(_0x1e61ff,null));};exports[_0xda61('0x20')]=function(_0x31f931,_0x29475f){if(_0x31f931['body']['id']){delete _0x31f931['body']['id'];}return db[_0xda61('0x2a')][_0xda61('0x44')]({'where':{'id':_0x31f931[_0xda61('0x42')]['id']}})[_0xda61('0x21')](handleEntityNotFound(_0x29475f,null))[_0xda61('0x21')](saveUpdates(_0x31f931[_0xda61('0x46')],null))[_0xda61('0x21')](respondWithResult(_0x29475f,null))[_0xda61('0x41')](handleError(_0x29475f,null));};exports[_0xda61('0x22')]=function(_0x558125,_0x23fdb8){return db['Campaign']['find']({'where':{'id':_0x558125[_0xda61('0x42')]['id']}})[_0xda61('0x21')](handleEntityNotFound(_0x23fdb8,null))[_0xda61('0x21')](removeEntity(_0x23fdb8,null))[_0xda61('0x41')](handleError(_0x23fdb8,null));};exports['getHoppers']=function(_0x565514,_0x5bd97f,_0x5e2f5b){var _0x2b726e={'raw':!![],'where':{}};var _0x4dfe12={};var _0x2398dc={'count':0x0,'rows':[]};return db['Campaign'][_0xda61('0x52')]({'where':{'id':_0x565514[_0xda61('0x42')]['id']}})[_0xda61('0x21')](handleEntityNotFound(_0x5bd97f,null))[_0xda61('0x21')](function(_0xa9fe3){if(_0xa9fe3){_0x4dfe12[_0xda61('0x30')]=_[_0xda61('0x2c')](db[_0xda61('0x53')][_0xda61('0x2b')]);_0x4dfe12['query']=_[_0xda61('0x2c')](_0x565514[_0xda61('0x2d')]);_0x4dfe12[_0xda61('0x2e')]=_[_0xda61('0x2f')](_0x4dfe12[_0xda61('0x30')],_0x4dfe12[_0xda61('0x2d')]);_0x2b726e[_0xda61('0x32')]=_[_0xda61('0x2f')](_0x4dfe12[_0xda61('0x30')],qs['fields'](_0x565514[_0xda61('0x2d')][_0xda61('0x31')]));_0x2b726e[_0xda61('0x32')]=_0x2b726e['attributes'][_0xda61('0x43')]?_0x2b726e['attributes']:_0x4dfe12[_0xda61('0x30')];if(!_0x565514['query']['hasOwnProperty']('nolimit')){_0x2b726e[_0xda61('0x1a')]=qs[_0xda61('0x1a')](_0x565514[_0xda61('0x2d')][_0xda61('0x1a')]);_0x2b726e[_0xda61('0x19')]=qs['offset'](_0x565514['query'][_0xda61('0x19')]);}_0x2b726e[_0xda61('0x34')]=qs[_0xda61('0x35')](_0x565514[_0xda61('0x2d')][_0xda61('0x35')]);_0x2b726e[_0xda61('0x36')]=qs['filters'](_['pick'](_0x565514[_0xda61('0x2d')],_0x4dfe12[_0xda61('0x2e')]));_0x2b726e[_0xda61('0x36')][_0xda61('0x54')]=_0xa9fe3['id'];if(_0x565514[_0xda61('0x2d')]['filter']){_0x2b726e[_0xda61('0x36')]=_['merge'](_0x2b726e['where'],{'$or':_['map'](_0x2b726e[_0xda61('0x32')],function(_0x5412a3){var _0x51fb16={};_0x51fb16[_0x5412a3]={'$like':'%'+_0x565514[_0xda61('0x2d')]['filter']+'%'};return _0x51fb16;})});}_0x2b726e=_[_0xda61('0x38')]({},_0x2b726e,_0x565514[_0xda61('0x3c')]);return db[_0xda61('0x53')][_0xda61('0x18')]({'where':_0x2b726e[_0xda61('0x36')]})[_0xda61('0x21')](function(_0x5a7660){_0x2398dc['count']=_0x5a7660;if(_0x565514['query'][_0xda61('0x3d')]){_0x2b726e['include']=[{'all':!![]}];}return db['CmHopper'][_0xda61('0x3f')](_0x2b726e);})[_0xda61('0x21')](function(_0xaed884){_0x2398dc['rows']=_0xaed884;return _0x2398dc;});}})[_0xda61('0x21')](respondWithFilteredResult(_0x5bd97f,_0x2b726e))[_0xda61('0x41')](handleError(_0x5bd97f,null));};exports[_0xda61('0x55')]=function(_0x3f1604,_0x5daee0,_0x316e1b){var _0x3e109e={'raw':!![],'where':{}};var _0x33d924={};var _0xde782d={'count':0x0,'rows':[]};return db[_0xda61('0x2a')]['findOne']({'where':{'id':_0x3f1604[_0xda61('0x42')]['id']}})[_0xda61('0x21')](handleEntityNotFound(_0x5daee0,null))[_0xda61('0x21')](function(_0x3660f7){if(_0x3660f7){_0x33d924['model']=_['keys'](db[_0xda61('0x56')]['rawAttributes']);_0x33d924['query']=_[_0xda61('0x2c')](_0x3f1604[_0xda61('0x2d')]);_0x33d924[_0xda61('0x2e')]=_[_0xda61('0x2f')](_0x33d924[_0xda61('0x30')],_0x33d924[_0xda61('0x2d')]);_0x3e109e[_0xda61('0x32')]=_[_0xda61('0x2f')](_0x33d924['model'],qs[_0xda61('0x31')](_0x3f1604[_0xda61('0x2d')][_0xda61('0x31')]));_0x3e109e[_0xda61('0x32')]=_0x3e109e[_0xda61('0x32')][_0xda61('0x43')]?_0x3e109e[_0xda61('0x32')]:_0x33d924[_0xda61('0x30')];if(!_0x3f1604[_0xda61('0x2d')][_0xda61('0x57')]('nolimit')){_0x3e109e[_0xda61('0x1a')]=qs[_0xda61('0x1a')](_0x3f1604['query'][_0xda61('0x1a')]);_0x3e109e[_0xda61('0x19')]=qs['offset'](_0x3f1604[_0xda61('0x2d')][_0xda61('0x19')]);}_0x3e109e['order']=qs[_0xda61('0x35')](_0x3f1604[_0xda61('0x2d')][_0xda61('0x35')]);_0x3e109e['where']=qs[_0xda61('0x2e')](_[_0xda61('0x58')](_0x3f1604[_0xda61('0x2d')],_0x33d924[_0xda61('0x2e')]));_0x3e109e[_0xda61('0x36')][_0xda61('0x54')]=_0x3660f7['id'];if(_0x3f1604[_0xda61('0x2d')]['filter']){_0x3e109e[_0xda61('0x36')]=_[_0xda61('0x38')](_0x3e109e[_0xda61('0x36')],{'$or':_[_0xda61('0x39')](_0x3e109e[_0xda61('0x32')],function(_0x49513f){var _0x2d0e86={};_0x2d0e86[_0x49513f]={'$like':'%'+_0x3f1604[_0xda61('0x2d')]['filter']+'%'};return _0x2d0e86;})});}_0x3e109e=_[_0xda61('0x38')]({},_0x3e109e,_0x3f1604['options']);return db['CmHopperHistory'][_0xda61('0x18')]({'where':_0x3e109e[_0xda61('0x36')]})[_0xda61('0x21')](function(_0x3088b9){_0xde782d[_0xda61('0x18')]=_0x3088b9;if(_0x3f1604['query']['includeAll']){_0x3e109e[_0xda61('0x3e')]=[{'all':!![]}];}return db[_0xda61('0x56')][_0xda61('0x3f')](_0x3e109e);})[_0xda61('0x21')](function(_0x5a84ed){_0xde782d[_0xda61('0x40')]=_0x5a84ed;return _0xde782d;});}})[_0xda61('0x21')](respondWithFilteredResult(_0x5daee0,_0x3e109e))['catch'](handleError(_0x5daee0,null));};exports[_0xda61('0x59')]=function(_0x28ef69,_0x3bfccc,_0x547d14){var _0xcb56a={'raw':!![],'where':{}};var _0x30d10a={};var _0x364663={'count':0x0,'rows':[]};return db[_0xda61('0x2a')][_0xda61('0x52')]({'where':{'id':_0x28ef69[_0xda61('0x42')]['id']}})['then'](handleEntityNotFound(_0x3bfccc,null))[_0xda61('0x21')](function(_0x5770b5){if(_0x5770b5){_0x30d10a[_0xda61('0x30')]=_[_0xda61('0x2c')](db[_0xda61('0x5a')]['rawAttributes']);_0x30d10a['query']=_[_0xda61('0x2c')](_0x28ef69['query']);_0x30d10a[_0xda61('0x2e')]=_[_0xda61('0x2f')](_0x30d10a[_0xda61('0x30')],_0x30d10a[_0xda61('0x2d')]);_0xcb56a[_0xda61('0x32')]=_['intersection'](_0x30d10a[_0xda61('0x30')],qs[_0xda61('0x31')](_0x28ef69[_0xda61('0x2d')]['fields']));_0xcb56a[_0xda61('0x32')]=_0xcb56a[_0xda61('0x32')][_0xda61('0x43')]?_0xcb56a[_0xda61('0x32')]:_0x30d10a[_0xda61('0x30')];if(!_0x28ef69[_0xda61('0x2d')]['hasOwnProperty']('nolimit')){_0xcb56a[_0xda61('0x1a')]=qs['limit'](_0x28ef69[_0xda61('0x2d')][_0xda61('0x1a')]);_0xcb56a['offset']=qs[_0xda61('0x19')](_0x28ef69[_0xda61('0x2d')]['offset']);}_0xcb56a['order']=qs['sort'](_0x28ef69[_0xda61('0x2d')][_0xda61('0x35')]);_0xcb56a[_0xda61('0x36')]=qs['filters'](_[_0xda61('0x58')](_0x28ef69['query'],_0x30d10a[_0xda61('0x2e')]));_0xcb56a[_0xda61('0x36')][_0xda61('0x54')]=_0x5770b5['id'];if(_0x28ef69[_0xda61('0x2d')][_0xda61('0x37')]){_0xcb56a[_0xda61('0x36')]=_[_0xda61('0x38')](_0xcb56a[_0xda61('0x36')],{'$or':_[_0xda61('0x39')](_0xcb56a[_0xda61('0x32')],function(_0x1ddeb5){var _0x8287b4={};_0x8287b4[_0x1ddeb5]={'$like':'%'+_0x28ef69['query'][_0xda61('0x37')]+'%'};return _0x8287b4;})});}_0xcb56a=_['merge']({},_0xcb56a,_0x28ef69[_0xda61('0x3c')]);return db[_0xda61('0x5a')][_0xda61('0x18')]({'where':_0xcb56a[_0xda61('0x36')]})[_0xda61('0x21')](function(_0x49f2cb){_0x364663['count']=_0x49f2cb;if(_0x28ef69[_0xda61('0x2d')]['includeAll']){_0xcb56a[_0xda61('0x3e')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xda61('0x3f')](_0xcb56a);})['then'](function(_0x336033){_0x364663[_0xda61('0x40')]=_0x336033;return _0x364663;});}})['then'](respondWithFilteredResult(_0x3bfccc,_0xcb56a))[_0xda61('0x41')](handleError(_0x3bfccc,null));};exports[_0xda61('0x5b')]=function(_0x13b79c,_0x2eae70,_0x270097){var _0x1ccda7={'raw':!![],'where':{}};var _0x4ee9af={};var _0x1d3e24={'count':0x0,'rows':[]};return db[_0xda61('0x2a')][_0xda61('0x52')]({'where':{'id':_0x13b79c[_0xda61('0x42')]['id']}})[_0xda61('0x21')](handleEntityNotFound(_0x2eae70,null))['then'](function(_0xe06cd4){if(_0xe06cd4){_0x4ee9af[_0xda61('0x30')]=_[_0xda61('0x2c')](db[_0xda61('0x5c')][_0xda61('0x2b')]);_0x4ee9af[_0xda61('0x2d')]=_[_0xda61('0x2c')](_0x13b79c[_0xda61('0x2d')]);_0x4ee9af[_0xda61('0x2e')]=_[_0xda61('0x2f')](_0x4ee9af['model'],_0x4ee9af[_0xda61('0x2d')]);_0x1ccda7[_0xda61('0x32')]=_[_0xda61('0x2f')](_0x4ee9af['model'],qs[_0xda61('0x31')](_0x13b79c['query']['fields']));_0x1ccda7[_0xda61('0x32')]=_0x1ccda7[_0xda61('0x32')]['length']?_0x1ccda7[_0xda61('0x32')]:_0x4ee9af['model'];if(!_0x13b79c[_0xda61('0x2d')][_0xda61('0x57')](_0xda61('0x33'))){_0x1ccda7['limit']=qs[_0xda61('0x1a')](_0x13b79c[_0xda61('0x2d')][_0xda61('0x1a')]);_0x1ccda7[_0xda61('0x19')]=qs[_0xda61('0x19')](_0x13b79c['query'][_0xda61('0x19')]);}_0x1ccda7[_0xda61('0x34')]=qs[_0xda61('0x35')](_0x13b79c[_0xda61('0x2d')][_0xda61('0x35')]);_0x1ccda7[_0xda61('0x36')]=qs[_0xda61('0x2e')](_[_0xda61('0x58')](_0x13b79c[_0xda61('0x2d')],_0x4ee9af['filters']));_0x1ccda7[_0xda61('0x36')][_0xda61('0x54')]=_0xe06cd4['id'];if(_0x13b79c['query'][_0xda61('0x37')]){_0x1ccda7[_0xda61('0x36')]=_[_0xda61('0x38')](_0x1ccda7['where'],{'$or':_[_0xda61('0x39')](_0x1ccda7[_0xda61('0x32')],function(_0x4b304a){var _0x3859e2={};_0x3859e2[_0x4b304a]={'$like':'%'+_0x13b79c[_0xda61('0x2d')][_0xda61('0x37')]+'%'};return _0x3859e2;})});}_0x1ccda7=_['merge']({},_0x1ccda7,_0x13b79c[_0xda61('0x3c')]);return db[_0xda61('0x5c')]['count']({'where':_0x1ccda7[_0xda61('0x36')]})[_0xda61('0x21')](function(_0x2e691b){_0x1d3e24[_0xda61('0x18')]=_0x2e691b;if(_0x13b79c[_0xda61('0x2d')][_0xda61('0x3d')]){_0x1ccda7[_0xda61('0x3e')]=[{'all':!![]}];}return db[_0xda61('0x5c')][_0xda61('0x3f')](_0x1ccda7);})[_0xda61('0x21')](function(_0x1cc48f){_0x1d3e24[_0xda61('0x40')]=_0x1cc48f;return _0x1d3e24;});}})[_0xda61('0x21')](respondWithFilteredResult(_0x2eae70,_0x1ccda7))[_0xda61('0x41')](handleError(_0x2eae70,null));};exports['getLists']=function(_0x321107,_0x459d30,_0x3bc18f){var _0x58743a={};var _0xa5d12a={};var _0x1dd964;var _0x5c5c61;return db[_0xda61('0x2a')][_0xda61('0x52')]({'where':{'id':_0x321107[_0xda61('0x42')]['id']}})[_0xda61('0x21')](handleEntityNotFound(_0x459d30,null))['then'](function(_0x18379b){if(_0x18379b){_0x1dd964=_0x18379b;_0xa5d12a[_0xda61('0x30')]=_['keys'](db[_0xda61('0x5d')][_0xda61('0x2b')]);_0xa5d12a[_0xda61('0x2d')]=_[_0xda61('0x2c')](_0x321107[_0xda61('0x2d')]);_0xa5d12a[_0xda61('0x2e')]=_[_0xda61('0x2f')](_0xa5d12a['model'],_0xa5d12a[_0xda61('0x2d')]);_0x58743a[_0xda61('0x32')]=_[_0xda61('0x2f')](_0xa5d12a[_0xda61('0x30')],qs[_0xda61('0x31')](_0x321107[_0xda61('0x2d')][_0xda61('0x31')]));_0x58743a[_0xda61('0x32')]=_0x58743a['attributes']['length']?_0x58743a[_0xda61('0x32')]:_0xa5d12a['model'];_0x58743a[_0xda61('0x34')]=qs[_0xda61('0x35')](_0x321107[_0xda61('0x2d')][_0xda61('0x35')]);_0x58743a[_0xda61('0x36')]=qs['filters'](_[_0xda61('0x58')](_0x321107[_0xda61('0x2d')],_0xa5d12a[_0xda61('0x2e')]));if(_0x321107[_0xda61('0x2d')][_0xda61('0x37')]){_0x58743a[_0xda61('0x36')]=_[_0xda61('0x38')](_0x58743a[_0xda61('0x36')],{'$or':_[_0xda61('0x39')](_0x58743a['attributes'],function(_0x39ca21){var _0xefd394={};_0xefd394[_0x39ca21]={'$like':'%'+_0x321107[_0xda61('0x2d')][_0xda61('0x37')]+'%'};return _0xefd394;})});}_0x58743a=_[_0xda61('0x38')]({},_0x58743a,_0x321107[_0xda61('0x3c')]);return _0x1dd964['getLists'](_0x58743a);}})[_0xda61('0x21')](function(_0x14144f){if(_0x14144f){_0x5c5c61=_0x14144f[_0xda61('0x43')];if(!_0x321107['query'][_0xda61('0x57')](_0xda61('0x33'))){_0x58743a['limit']=qs['limit'](_0x321107[_0xda61('0x2d')][_0xda61('0x1a')]);_0x58743a[_0xda61('0x19')]=qs[_0xda61('0x19')](_0x321107[_0xda61('0x2d')][_0xda61('0x19')]);}return _0x1dd964[_0xda61('0x5e')](_0x58743a);}})[_0xda61('0x21')](function(_0x1d8b7b){if(_0x1d8b7b){return _0x1d8b7b?{'count':_0x5c5c61,'rows':_0x1d8b7b}:null;}})[_0xda61('0x21')](respondWithResult(_0x459d30,null))['catch'](handleError(_0x459d30,null));};exports[_0xda61('0x5f')]=function(_0x581958,_0xfa1485,_0xe8100e){var _0x1bea8b,_0x999dff;return db[_0xda61('0x2a')][_0xda61('0x44')]({'where':{'id':_0x581958[_0xda61('0x42')]['id']}})['then'](handleEntityNotFound(_0xfa1485,null))[_0xda61('0x21')](function(_0x320897){if(_0x320897){_0x999dff=_0x320897;return _0x320897[_0xda61('0x5f')](_0x581958[_0xda61('0x46')][_0xda61('0x60')],_['omit'](_0x581958[_0xda61('0x46')],[_0xda61('0x60'),'id'])||{});}return null;})['spread'](function(_0x5016ff){var _0xf9cce3;_0x1bea8b=_0x5016ff||[];var _0x4f64c5=[];if(_0x5016ff){for(var _0x4346f4=0x0;_0x4346f4<_0x5016ff[_0xda61('0x43')];_0x4346f4+=0x1){var _0x1dc437=_0x5016ff[_0x4346f4]['get']({'plain':!![]});_0x999dff[_0xda61('0x61')]=_0x581958['body'][_0xda61('0x61')]?_0x581958[_0xda61('0x46')]['dialCheckDuplicateType']:_0x999dff['dialCheckDuplicateType'];switch(_0x999dff['dialCheckDuplicateType']){case _0xda61('0x62'):_0xf9cce3=squel[_0xda61('0x63')]()[_0xda61('0x64')](_0xda61('0x65'))[_0xda61('0x66')]([_0xda61('0x67'),'scheduledAt',_0xda61('0x68'),_0xda61('0x69'),'CampaignId','createdAt',_0xda61('0x4f')],squel[_0xda61('0x6a')]()[_0xda61('0x6b')](_0xda61('0x67'),_0xda61('0x67'))['field'](_0xda61('0x6c'),_0xda61('0x6d'))[_0xda61('0x6b')]('id','ContactId')[_0xda61('0x6b')](_0x1dc437['CmListId'][_0xda61('0x6e')](),_0xda61('0x69'))[_0xda61('0x6b')](_0x581958[_0xda61('0x42')]['id']['toString'](),'CampaignId')[_0xda61('0x6b')](_0xda61('0x6c'),_0xda61('0x4e'))[_0xda61('0x6b')](_0xda61('0x6c'),_0xda61('0x4f'))['from']('cm_contacts')[_0xda61('0x36')]('deletedAt\x20IS\x20NULL')[_0xda61('0x36')](_0xda61('0x6f'),_0x1dc437[_0xda61('0x70')][_0xda61('0x6e')]())['where'](_0xda61('0x71'))[_0xda61('0x36')]('phone\x20NOT\x20IN\x20(?)',squel[_0xda61('0x6a')]()[_0xda61('0x6b')]('COALESCE(calleridnum,\x27\x27)')['from'](_0xda61('0x72'))[_0xda61('0x36')](_0xda61('0x73'),_0x581958[_0xda61('0x42')]['id'][_0xda61('0x6e')]()))[_0xda61('0x36')](_0xda61('0x74'),squel['select']()[_0xda61('0x6b')]('COALESCE(phone,\x27\x27)')[_0xda61('0x75')](_0xda61('0x65'))['where'](_0xda61('0x73'),_0x581958['params']['id'][_0xda61('0x6e')]())))['toString']();break;case _0xda61('0x76'):_0xf9cce3=squel['insert']()[_0xda61('0x64')](_0xda61('0x65'))['fromQuery']([_0xda61('0x67'),_0xda61('0x6d'),_0xda61('0x68'),'ListId','CampaignId','createdAt',_0xda61('0x4f')],squel[_0xda61('0x6a')]()['field'](_0xda61('0x67'),_0xda61('0x67'))[_0xda61('0x6b')](_0xda61('0x6c'),'scheduledAt')[_0xda61('0x6b')]('id',_0xda61('0x68'))[_0xda61('0x6b')](_0x1dc437[_0xda61('0x70')][_0xda61('0x6e')](),_0xda61('0x69'))['field'](_0x581958[_0xda61('0x42')]['id'][_0xda61('0x6e')](),_0xda61('0x54'))[_0xda61('0x6b')]('NOW()',_0xda61('0x4e'))[_0xda61('0x6b')](_0xda61('0x6c'),'updatedAt')['from'](_0xda61('0x77'))[_0xda61('0x36')](_0xda61('0x78'))[_0xda61('0x36')](_0xda61('0x6f'),_0x1dc437[_0xda61('0x70')][_0xda61('0x6e')]())[_0xda61('0x36')](_0xda61('0x71'))[_0xda61('0x36')](_0xda61('0x74'),squel[_0xda61('0x6a')]()[_0xda61('0x6b')](_0xda61('0x79'))[_0xda61('0x75')](_0xda61('0x65'))['where']('CampaignId\x20=\x20?',_0x581958['params']['id'][_0xda61('0x6e')]())))['toString']();break;default:_0xf9cce3=squel[_0xda61('0x63')]()[_0xda61('0x64')](_0xda61('0x65'))['fromQuery'](['phone',_0xda61('0x6d'),_0xda61('0x68'),'ListId','CampaignId',_0xda61('0x4e'),_0xda61('0x4f')],squel['select']()[_0xda61('0x6b')](_0xda61('0x67'),'phone')['field'](_0xda61('0x6c'),_0xda61('0x6d'))[_0xda61('0x6b')]('id','ContactId')[_0xda61('0x6b')](_0x1dc437[_0xda61('0x70')][_0xda61('0x6e')](),_0xda61('0x69'))[_0xda61('0x6b')](_0x581958[_0xda61('0x42')]['id'][_0xda61('0x6e')](),_0xda61('0x54'))[_0xda61('0x6b')](_0xda61('0x6c'),'createdAt')[_0xda61('0x6b')](_0xda61('0x6c'),_0xda61('0x4f'))[_0xda61('0x75')]('cm_contacts')[_0xda61('0x36')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x1dc437['CmListId'][_0xda61('0x6e')]())[_0xda61('0x36')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x4f64c5[_0xda61('0x7a')](db[_0xda61('0x7b')][_0xda61('0x2d')](_0xf9cce3));}return BPromise['all'](_0x4f64c5);}})[_0xda61('0x21')](function(){return _0x1bea8b;})[_0xda61('0x21')](respondWithResult(_0xfa1485,null))[_0xda61('0x41')](handleError(_0xfa1485,null));};exports[_0xda61('0x7c')]=function(_0x348f23,_0x2dbf9d,_0x738c17){return db[_0xda61('0x2a')][_0xda61('0x44')]({'where':{'id':_0x348f23['params']['id']}})['then'](handleEntityNotFound(_0x2dbf9d,null))['then'](function(_0x2981e6){if(_0x2981e6){return _0x2981e6[_0xda61('0x7c')](_0x348f23['query']['ids']);}})['then'](function(_0x465a97){if(_0x465a97){return db[_0xda61('0x53')][_0xda61('0x22')]({'where':{'ListId':_0x348f23[_0xda61('0x2d')][_0xda61('0x60')],'CampaignId':_0x348f23['params']['id']}})[_0xda61('0x21')](function(){return _0x465a97;});}})[_0xda61('0x21')](respondWithStatusCode(_0x2dbf9d,null))['catch'](handleError(_0x2dbf9d,null));};exports[_0xda61('0x7d')]=function(_0x4e42cd,_0x1055c4,_0x325291){var _0x4e7f86={'raw':!![],'where':{}};var _0x1d01ab={};var _0x5865b7={'count':0x0,'rows':[]};return db[_0xda61('0x2a')][_0xda61('0x52')]({'where':{'id':_0x4e42cd[_0xda61('0x42')]['id']}})[_0xda61('0x21')](handleEntityNotFound(_0x1055c4,null))[_0xda61('0x21')](function(_0x201d4f){if(_0x201d4f){_0x1d01ab[_0xda61('0x30')]=_[_0xda61('0x2c')](db[_0xda61('0x5d')]['rawAttributes']);_0x1d01ab[_0xda61('0x2d')]=_[_0xda61('0x2c')](_0x4e42cd[_0xda61('0x2d')]);_0x1d01ab[_0xda61('0x2e')]=_[_0xda61('0x2f')](_0x1d01ab[_0xda61('0x30')],_0x1d01ab[_0xda61('0x2d')]);_0x4e7f86[_0xda61('0x32')]=_[_0xda61('0x2f')](_0x1d01ab['model'],qs['fields'](_0x4e42cd[_0xda61('0x2d')][_0xda61('0x31')]));_0x4e7f86[_0xda61('0x32')]=_0x4e7f86[_0xda61('0x32')]['length']?_0x4e7f86[_0xda61('0x32')]:_0x1d01ab[_0xda61('0x30')];if(!_0x4e42cd[_0xda61('0x2d')][_0xda61('0x57')](_0xda61('0x33'))){_0x4e7f86[_0xda61('0x1a')]=qs[_0xda61('0x1a')](_0x4e42cd[_0xda61('0x2d')]['limit']);_0x4e7f86[_0xda61('0x19')]=qs[_0xda61('0x19')](_0x4e42cd[_0xda61('0x2d')][_0xda61('0x19')]);}_0x4e7f86['order']=qs[_0xda61('0x35')](_0x4e42cd[_0xda61('0x2d')]['sort']);_0x4e7f86[_0xda61('0x36')]=qs[_0xda61('0x2e')](_[_0xda61('0x58')](_0x4e42cd[_0xda61('0x2d')],_0x1d01ab[_0xda61('0x2e')]));_0x4e7f86['where']['CampaignId']=_0x201d4f['id'];if(_0x4e42cd[_0xda61('0x2d')][_0xda61('0x37')]){_0x4e7f86[_0xda61('0x36')]=_[_0xda61('0x38')](_0x4e7f86[_0xda61('0x36')],{'$or':_[_0xda61('0x39')](_0x4e7f86[_0xda61('0x32')],function(_0x4b9d07){var _0x43f6a1={};_0x43f6a1[_0x4b9d07]={'$like':'%'+_0x4e42cd['query'][_0xda61('0x37')]+'%'};return _0x43f6a1;})});}_0x4e7f86=_['merge']({},_0x4e7f86,_0x4e42cd[_0xda61('0x3c')]);return db[_0xda61('0x5d')]['count']({'where':_0x4e7f86[_0xda61('0x36')]})['then'](function(_0xb38f38){_0x5865b7[_0xda61('0x18')]=_0xb38f38;if(_0x4e42cd['query'][_0xda61('0x3d')]){_0x4e7f86[_0xda61('0x3e')]=[{'all':!![]}];}return db[_0xda61('0x5d')][_0xda61('0x3f')](_0x4e7f86);})['then'](function(_0x38e9ce){_0x5865b7['rows']=_0x38e9ce;return _0x5865b7;});}})[_0xda61('0x21')](respondWithFilteredResult(_0x1055c4,_0x4e7f86))[_0xda61('0x41')](handleError(_0x1055c4,null));};exports[_0xda61('0x7e')]=function(_0x5eccce,_0x2815b6,_0x4b9edb){var _0x564495,_0x35bd69;return db[_0xda61('0x2a')][_0xda61('0x44')]({'where':{'id':_0x5eccce[_0xda61('0x42')]['id']}})['then'](handleEntityNotFound(_0x2815b6,null))[_0xda61('0x21')](function(_0x349501){if(_0x349501){_0x35bd69=_0x349501;return _0x349501['addBlackLists'](_0x5eccce[_0xda61('0x46')][_0xda61('0x60')],_[_0xda61('0x4d')](_0x5eccce['body'],['ids','id'])||{});}return null;})['spread'](function(_0x17127f){var _0xa4c80a;_0x564495=_0x17127f||[];var _0x41a627=[];if(_0x17127f){for(var _0x221a82=0x0;_0x221a82<_0x17127f[_0xda61('0x43')];_0x221a82+=0x1){var _0x4c1044=_0x17127f[_0x221a82][_0xda61('0x23')]({'plain':!![]});_0xa4c80a=squel['insert']()[_0xda61('0x64')]('cm_hopper_black')['fromQuery']([_0xda61('0x67'),_0xda61('0x68'),_0xda61('0x69'),'CampaignId','createdAt',_0xda61('0x4f')],squel[_0xda61('0x6a')]()[_0xda61('0x6b')](_0xda61('0x67'),_0xda61('0x67'))[_0xda61('0x6b')]('id',_0xda61('0x68'))[_0xda61('0x6b')](_0x4c1044[_0xda61('0x70')][_0xda61('0x6e')](),_0xda61('0x69'))[_0xda61('0x6b')](_0x5eccce['params']['id'][_0xda61('0x6e')](),_0xda61('0x54'))[_0xda61('0x6b')](_0xda61('0x6c'),_0xda61('0x4e'))[_0xda61('0x6b')](_0xda61('0x6c'),_0xda61('0x4f'))['from'](_0xda61('0x77'))[_0xda61('0x36')](_0xda61('0x78'))[_0xda61('0x36')](_0xda61('0x6f'),_0x4c1044[_0xda61('0x70')][_0xda61('0x6e')]())['where'](_0xda61('0x71')))[_0xda61('0x6e')]();_0x41a627[_0xda61('0x7a')](db[_0xda61('0x7b')][_0xda61('0x2d')](_0xa4c80a));}return BPromise[_0xda61('0x7f')](_0x41a627);}})[_0xda61('0x21')](function(){return _0x564495;})[_0xda61('0x21')](respondWithResult(_0x2815b6,null))['catch'](handleError(_0x2815b6,null));};exports[_0xda61('0x80')]=function(_0x3d3bc3,_0x66648d,_0x23eb05){return db[_0xda61('0x2a')][_0xda61('0x44')]({'where':{'id':_0x3d3bc3[_0xda61('0x42')]['id']}})[_0xda61('0x21')](handleEntityNotFound(_0x66648d,null))['then'](function(_0x11b615){if(_0x11b615){return _0x11b615[_0xda61('0x80')](_0x3d3bc3[_0xda61('0x2d')][_0xda61('0x60')]);}})[_0xda61('0x21')](function(_0x2e196b){if(_0x2e196b){return db['CmHopperBlack'][_0xda61('0x22')]({'where':{'ListId':_0x3d3bc3[_0xda61('0x2d')][_0xda61('0x60')],'CampaignId':_0x3d3bc3[_0xda61('0x42')]['id']}})[_0xda61('0x21')](function(){return _0x2e196b;});}})[_0xda61('0x21')](respondWithStatusCode(_0x66648d,null))[_0xda61('0x41')](handleError(_0x66648d,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 608d39c..8331b99 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 _0x1ad5=['exports','define','Campaign','campaigns','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x22093a,_0xa7acf1){var _0x2f4989=function(_0x5bf12b){while(--_0x5bf12b){_0x22093a['push'](_0x22093a['shift']());}};_0x2f4989(++_0xa7acf1);}(_0x1ad5,0x10c));var _0x51ad=function(_0x316904,_0x1e8b77){_0x316904=_0x316904-0x0;var _0xfa9a21=_0x1ad5[_0x316904];return _0xfa9a21;};'use strict';var _=require(_0x51ad('0x0'));var util=require(_0x51ad('0x1'));var logger=require(_0x51ad('0x2'))(_0x51ad('0x3'));var moment=require(_0x51ad('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x51ad('0x5'));var config=require(_0x51ad('0x6'));var attributes=require('./campaign.attributes');module[_0x51ad('0x7')]=function(_0x3ac56b,_0x4523e9){return _0x3ac56b[_0x51ad('0x8')](_0x51ad('0x9'),attributes,{'tableName':_0x51ad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4279=['../../config/environment','exports','Campaign','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x16bb0e,_0x343132){var _0x102b8b=function(_0x17a62b){while(--_0x17a62b){_0x16bb0e['push'](_0x16bb0e['shift']());}};_0x102b8b(++_0x343132);}(_0x4279,0x71));var _0x9427=function(_0x3a6ea7,_0x2cd9f2){_0x3a6ea7=_0x3a6ea7-0x0;var _0x8911a6=_0x4279[_0x3a6ea7];return _0x8911a6;};'use strict';var _=require(_0x9427('0x0'));var util=require('util');var logger=require(_0x9427('0x1'))(_0x9427('0x2'));var moment=require(_0x9427('0x3'));var BPromise=require(_0x9427('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9427('0x5'));var rimraf=require(_0x9427('0x6'));var config=require(_0x9427('0x7'));var attributes=require('./campaign.attributes');module[_0x9427('0x8')]=function(_0x24a0fb,_0x25df89){return _0x24a0fb['define'](_0x9427('0x9'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 7179071..2bbebd6 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(_0x24626c,_0xb61d82){var _0xa98503=function(_0x54676e){while(--_0x54676e){_0x24626c['push'](_0x24626c['shift']());}};_0xa98503(++_0xb61d82);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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(_0x638e99,_0x50184a){var _0x1ed5f9=function(_0x309781){while(--_0x309781){_0x638e99['push'](_0x638e99['shift']());}};_0x1ed5f9(++_0x50184a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 7080640..55beeaa 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 _0x4c99=['clone','addLists','post','addBlackLists','put','/:id','update','delete','destroy','removeLists','removeBlackLists','exports','multer','path','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','index','show','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','/:id/clone'];(function(_0x12aa57,_0x50db96){var _0x3122cf=function(_0x3fc588){while(--_0x3fc588){_0x12aa57['push'](_0x12aa57['shift']());}};_0x3122cf(++_0x50db96);}(_0x4c99,0x1ec));var _0x94c9=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x4c99[_0x68c979];return _0x4f0001;};'use strict';var multer=require(_0x94c9('0x0'));var util=require('util');var path=require(_0x94c9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x94c9('0x2'));var interaction=require(_0x94c9('0x3'));var config=require('../../config/environment');var controller=require(_0x94c9('0x4'));router[_0x94c9('0x5')]('/',auth['isAuthenticated'](),controller[_0x94c9('0x6')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x94c9('0x7')]);router[_0x94c9('0x5')](_0x94c9('0x8'),auth[_0x94c9('0x9')](),controller[_0x94c9('0xa')]);router[_0x94c9('0x5')](_0x94c9('0xb'),auth[_0x94c9('0x9')](),controller[_0x94c9('0xc')]);router[_0x94c9('0x5')]('/:id/hopper_finals',auth[_0x94c9('0x9')](),controller[_0x94c9('0xd')]);router[_0x94c9('0x5')]('/:id/hopper_black',auth[_0x94c9('0x9')](),controller[_0x94c9('0xe')]);router[_0x94c9('0x5')](_0x94c9('0xf'),auth[_0x94c9('0x9')](),controller[_0x94c9('0x10')]);router[_0x94c9('0x5')](_0x94c9('0x11'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth[_0x94c9('0x9')](),controller[_0x94c9('0x12')]);router['post'](_0x94c9('0x13'),auth[_0x94c9('0x9')](),controller[_0x94c9('0x14')]);router['post']('/:id/lists',auth[_0x94c9('0x9')](),controller[_0x94c9('0x15')]);router[_0x94c9('0x16')](_0x94c9('0x11'),auth['isAuthenticated'](),controller[_0x94c9('0x17')]);router[_0x94c9('0x18')](_0x94c9('0x19'),auth[_0x94c9('0x9')](),controller[_0x94c9('0x1a')]);router[_0x94c9('0x1b')](_0x94c9('0x19'),auth['isAuthenticated'](),controller[_0x94c9('0x1c')]);router[_0x94c9('0x1b')]('/:id/lists',auth[_0x94c9('0x9')](),controller[_0x94c9('0x1d')]);router[_0x94c9('0x1b')](_0x94c9('0x11'),auth[_0x94c9('0x9')](),controller[_0x94c9('0x1e')]);module[_0x94c9('0x1f')]=router; \ No newline at end of file +var _0x5480=['removeBlackLists','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','update','destroy','delete','removeLists'];(function(_0x20b1ca,_0xcaa99b){var _0x13a457=function(_0x49b381){while(--_0x49b381){_0x20b1ca['push'](_0x20b1ca['shift']());}};_0x13a457(++_0xcaa99b);}(_0x5480,0x18a));var _0x0548=function(_0x1ee9a1,_0x5f1434){_0x1ee9a1=_0x1ee9a1-0x0;var _0x21270f=_0x5480[_0x1ee9a1];return _0x21270f;};'use strict';var multer=require(_0x0548('0x0'));var util=require(_0x0548('0x1'));var path=require(_0x0548('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0548('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0548('0x4'));var config=require(_0x0548('0x5'));var controller=require('./campaign.controller');router[_0x0548('0x6')]('/',auth[_0x0548('0x7')](),controller[_0x0548('0x8')]);router[_0x0548('0x6')](_0x0548('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x0548('0x6')]('/:id/hoppers',auth[_0x0548('0x7')](),controller[_0x0548('0xa')]);router[_0x0548('0x6')]('/:id/hopper_histories',auth[_0x0548('0x7')](),controller[_0x0548('0xb')]);router[_0x0548('0x6')](_0x0548('0xc'),auth[_0x0548('0x7')](),controller[_0x0548('0xd')]);router['get'](_0x0548('0xe'),auth[_0x0548('0x7')](),controller[_0x0548('0xf')]);router[_0x0548('0x6')](_0x0548('0x10'),auth['isAuthenticated'](),controller['getLists']);router[_0x0548('0x6')](_0x0548('0x11'),auth[_0x0548('0x7')](),controller[_0x0548('0x12')]);router[_0x0548('0x13')]('/',auth[_0x0548('0x7')](),controller[_0x0548('0x14')]);router[_0x0548('0x13')](_0x0548('0x15'),auth['isAuthenticated'](),controller['clone']);router[_0x0548('0x13')]('/:id/lists',auth[_0x0548('0x7')](),controller['addLists']);router['post']('/:id/blacklists',auth[_0x0548('0x7')](),controller['addBlackLists']);router['put'](_0x0548('0x9'),auth[_0x0548('0x7')](),controller[_0x0548('0x16')]);router['delete'](_0x0548('0x9'),auth[_0x0548('0x7')](),controller[_0x0548('0x17')]);router[_0x0548('0x18')](_0x0548('0x10'),auth['isAuthenticated'](),controller[_0x0548('0x19')]);router[_0x0548('0x18')](_0x0548('0x11'),auth[_0x0548('0x7')](),controller[_0x0548('0x1a')]);module[_0x0548('0x1b')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index bbcde16..f28f060 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 _0xdd93=['VIRTUAL','getDataValue','sequelize','STRING','TEXT'];(function(_0x31b60f,_0x59e5a5){var _0x8ff0a8=function(_0x49af1f){while(--_0x49af1f){_0x31b60f['push'](_0x31b60f['shift']());}};_0x8ff0a8(++_0x59e5a5);}(_0xdd93,0x142));var _0x3dd9=function(_0x505412,_0x239194){_0x505412=_0x505412-0x0;var _0x3029b9=_0xdd93[_0x505412];return _0x3029b9;};'use strict';var Sequelize=require(_0x3dd9('0x0'));module['exports']={'key':{'type':Sequelize[_0x3dd9('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x3dd9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3dd9('0x1')]},'name':{'type':Sequelize[_0x3dd9('0x3')],'get':function(){return this[_0x3dd9('0x4')]('key');}}}; \ No newline at end of file +var _0x0eb6=['STRING','key','sequelize'];(function(_0x313041,_0x5100d4){var _0x356573=function(_0x46dd5b){while(--_0x46dd5b){_0x313041['push'](_0x313041['shift']());}};_0x356573(++_0x5100d4);}(_0x0eb6,0x155));var _0x60eb=function(_0x560448,_0x2c1082){_0x560448=_0x560448-0x0;var _0x550276=_0x0eb6[_0x560448];return _0x550276;};'use strict';var Sequelize=require(_0x60eb('0x0'));module['exports']={'key':{'type':Sequelize[_0x60eb('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x60eb('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x60eb('0x2'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 16cf3ae..9a5c171 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 _0xc36d=['model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','field','options','count','includeAll','include','CannedAnswer','rows','show','params','rawAttributes','length','catch','update','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','set','Content-Range','reject','then','get','CannedAnswers','UserProfileResource','destroy','stack','name','send','index'];(function(_0x349c43,_0x1f6832){var _0x1305ee=function(_0x583e16){while(--_0x583e16){_0x349c43['push'](_0x349c43['shift']());}};_0x1305ee(++_0x1f6832);}(_0xc36d,0x7d));var _0xdc36=function(_0x8a30cf,_0x40f19b){_0x8a30cf=_0x8a30cf-0x0;var _0x20f439=_0xc36d[_0x8a30cf];return _0x20f439;};'use strict';var pdf=require(_0xdc36('0x0'));var emlformat=require(_0xdc36('0x1'));var rimraf=require(_0xdc36('0x2'));var zipdir=require(_0xdc36('0x3'));var jsonpatch=require(_0xdc36('0x4'));var rp=require(_0xdc36('0x5'));var moment=require('moment');var BPromise=require(_0xdc36('0x6'));var Mustache=require(_0xdc36('0x7'));var util=require('util');var path=require(_0xdc36('0x8'));var sox=require(_0xdc36('0x9'));var csv=require(_0xdc36('0xa'));var ejs=require(_0xdc36('0xb'));var fs=require('fs');var _=require(_0xdc36('0xc'));var squel=require('squel');var crypto=require(_0xdc36('0xd'));var jsforce=require(_0xdc36('0xe'));var deskjs=require(_0xdc36('0xf'));var toCsv=require(_0xdc36('0xa'));var querystring=require('querystring');var Papa=require(_0xdc36('0x10'));var Redis=require(_0xdc36('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdc36('0x12'));var hardwareService=require(_0xdc36('0x13'));var logger=require(_0xdc36('0x14'))('api');var utils=require(_0xdc36('0x15'));var config=require(_0xdc36('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d7d26,_0x3107bc){_0x3107bc=_0x3107bc||0xcc;return function(_0x276692){if(_0x276692){return _0x4d7d26[_0xdc36('0x17')](_0x3107bc);}return _0x4d7d26[_0xdc36('0x18')](_0x3107bc)['end']();};}function respondWithResult(_0x2b3f64,_0x3d36bc){_0x3d36bc=_0x3d36bc||0xc8;return function(_0x243d54){if(_0x243d54){return _0x2b3f64[_0xdc36('0x18')](_0x3d36bc)[_0xdc36('0x19')](_0x243d54);}};}function respondWithFilteredResult(_0x25b900,_0x37ce9c){return function(_0x809cf0){if(_0x809cf0){var _0x57ebde=_0x809cf0['count'],_0x155cce=_0x37ce9c[_0xdc36('0x1a')],_0x526ac8=_0x37ce9c[_0xdc36('0x1a')]+_0x37ce9c['limit'],_0x4baf2e;if(_0x526ac8>=_0x57ebde){_0x526ac8=_0x57ebde;_0x4baf2e=0xc8;}else{_0x4baf2e=0xce;}_0x25b900[_0xdc36('0x18')](_0x4baf2e);return _0x25b900[_0xdc36('0x1b')](_0xdc36('0x1c'),_0x155cce+'-'+_0x526ac8+'/'+_0x57ebde)[_0xdc36('0x19')](_0x809cf0);}return null;};}function patchUpdates(_0x183c91){return function(_0x46783d){try{jsonpatch['apply'](_0x46783d,_0x183c91,!![]);}catch(_0x3d4c4c){return BPromise[_0xdc36('0x1d')](_0x3d4c4c);}return _0x46783d['save']();};}function saveUpdates(_0x414953,_0x197924){return function(_0x3f25f0){if(_0x3f25f0){return _0x3f25f0['update'](_0x414953)[_0xdc36('0x1e')](function(_0x235a39){return _0x235a39;});}return null;};}function removeEntity(_0x5b9891,_0x388b1a){return function(_0x480277){if(_0x480277){return _0x480277['destroy']()[_0xdc36('0x1e')](function(){var _0x2b39a2=_0x480277[_0xdc36('0x1f')]({'plain':!![]});var _0xda916b=_0xdc36('0x20');return db[_0xdc36('0x21')][_0xdc36('0x22')]({'where':{'type':_0xda916b,'resourceId':_0x2b39a2['id']}})[_0xdc36('0x1e')](function(){return _0x480277;});})['then'](function(){_0x5b9891[_0xdc36('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2338d7,_0x38bd73){return function(_0x15e686){if(!_0x15e686){_0x2338d7['sendStatus'](0x194);}return _0x15e686;};}function handleError(_0xbc4322,_0x6e3906){_0x6e3906=_0x6e3906||0x1f4;return function(_0x337091){logger['error'](_0x337091[_0xdc36('0x23')]);if(_0x337091[_0xdc36('0x24')]){delete _0x337091[_0xdc36('0x24')];}_0xbc4322['status'](_0x6e3906)[_0xdc36('0x25')](_0x337091);};}exports[_0xdc36('0x26')]=function(_0x4b15b4,_0x3fe57f){var _0x12fed2={},_0x4ea2ad={},_0x21151b={'count':0x0,'rows':[]};var _0x5bba0b=db['CannedAnswer']['rawAttributes'];_0x4ea2ad[_0xdc36('0x27')]=_[_0xdc36('0x28')](_0x5bba0b);_0x4ea2ad['query']=_[_0xdc36('0x28')](_0x4b15b4[_0xdc36('0x29')]);_0x4ea2ad[_0xdc36('0x2a')]=_['intersection'](_0x4ea2ad[_0xdc36('0x27')],_0x4ea2ad[_0xdc36('0x29')]);_0x12fed2[_0xdc36('0x2b')]=_[_0xdc36('0x2c')](_0x4ea2ad[_0xdc36('0x27')],qs[_0xdc36('0x2d')](_0x4b15b4[_0xdc36('0x29')]['fields']));_0x12fed2[_0xdc36('0x2b')]=_0x12fed2[_0xdc36('0x2b')]['length']?_0x12fed2['attributes']:_0x4ea2ad[_0xdc36('0x27')];if(!_0x4b15b4[_0xdc36('0x29')][_0xdc36('0x2e')]('nolimit')){_0x12fed2['limit']=qs[_0xdc36('0x2f')](_0x4b15b4[_0xdc36('0x29')][_0xdc36('0x2f')]);_0x12fed2[_0xdc36('0x1a')]=qs[_0xdc36('0x1a')](_0x4b15b4[_0xdc36('0x29')][_0xdc36('0x1a')]);}_0x12fed2[_0xdc36('0x30')]=qs[_0xdc36('0x31')](_0x4b15b4[_0xdc36('0x29')][_0xdc36('0x31')]);_0x12fed2['where']=qs[_0xdc36('0x2a')](_[_0xdc36('0x32')](_0x4b15b4[_0xdc36('0x29')],_0x4ea2ad[_0xdc36('0x2a')]));if(_0x4b15b4['query'][_0xdc36('0x33')]){_0x12fed2[_0xdc36('0x34')]=_[_0xdc36('0x35')](_0x12fed2[_0xdc36('0x34')],{'$or':_['map'](_0x5bba0b,function(_0x3c8bd5){if(_0x3c8bd5['type']['key']!==_0xdc36('0x36')){var _0x169c1e={};_0x169c1e[_0x3c8bd5[_0xdc36('0x37')]]={'$like':'%'+_0x4b15b4['query'][_0xdc36('0x33')]+'%'};return _0x169c1e;}})});}_0x12fed2=_['merge']({},_0x12fed2,_0x4b15b4[_0xdc36('0x38')]);var _0x34f6be={'where':_0x12fed2[_0xdc36('0x34')]};return db['CannedAnswer'][_0xdc36('0x39')](_0x34f6be)[_0xdc36('0x1e')](function(_0xd98d42){_0x21151b[_0xdc36('0x39')]=_0xd98d42;if(_0x4b15b4['query'][_0xdc36('0x3a')]){_0x12fed2[_0xdc36('0x3b')]=[{'all':!![]}];}return db[_0xdc36('0x3c')]['findAll'](_0x12fed2);})['then'](function(_0x2cefcf){_0x21151b[_0xdc36('0x3d')]=_0x2cefcf;return _0x21151b;})['then'](respondWithFilteredResult(_0x3fe57f,_0x12fed2))['catch'](handleError(_0x3fe57f,null));};exports[_0xdc36('0x3e')]=function(_0x8f4c80,_0x6cc2ff){var _0x1c0a6c={'raw':!![],'where':{'id':_0x8f4c80[_0xdc36('0x3f')]['id']}},_0x26fb8c={};_0x26fb8c[_0xdc36('0x27')]=_[_0xdc36('0x28')](db[_0xdc36('0x3c')][_0xdc36('0x40')]);_0x26fb8c[_0xdc36('0x29')]=_[_0xdc36('0x28')](_0x8f4c80[_0xdc36('0x29')]);_0x26fb8c[_0xdc36('0x2a')]=_[_0xdc36('0x2c')](_0x26fb8c[_0xdc36('0x27')],_0x26fb8c[_0xdc36('0x29')]);_0x1c0a6c[_0xdc36('0x2b')]=_[_0xdc36('0x2c')](_0x26fb8c[_0xdc36('0x27')],qs[_0xdc36('0x2d')](_0x8f4c80[_0xdc36('0x29')][_0xdc36('0x2d')]));_0x1c0a6c[_0xdc36('0x2b')]=_0x1c0a6c[_0xdc36('0x2b')][_0xdc36('0x41')]?_0x1c0a6c['attributes']:_0x26fb8c[_0xdc36('0x27')];if(_0x8f4c80[_0xdc36('0x29')]['includeAll']){_0x1c0a6c['include']=[{'all':!![]}];}_0x1c0a6c=_[_0xdc36('0x35')]({},_0x1c0a6c,_0x8f4c80['options']);return db[_0xdc36('0x3c')]['find'](_0x1c0a6c)[_0xdc36('0x1e')](handleEntityNotFound(_0x6cc2ff,null))[_0xdc36('0x1e')](respondWithResult(_0x6cc2ff,null))[_0xdc36('0x42')](handleError(_0x6cc2ff,null));};exports[_0xdc36('0x43')]=function(_0x34af88,_0x244617){if(_0x34af88[_0xdc36('0x44')]['id']){delete _0x34af88[_0xdc36('0x44')]['id'];}return db[_0xdc36('0x3c')][_0xdc36('0x45')]({'where':{'id':_0x34af88[_0xdc36('0x3f')]['id']}})[_0xdc36('0x1e')](handleEntityNotFound(_0x244617,null))[_0xdc36('0x1e')](saveUpdates(_0x34af88[_0xdc36('0x44')],null))[_0xdc36('0x1e')](respondWithResult(_0x244617,null))[_0xdc36('0x42')](handleError(_0x244617,null));};exports[_0xdc36('0x22')]=function(_0x3399cc,_0x562c86){return db['CannedAnswer'][_0xdc36('0x45')]({'where':{'id':_0x3399cc[_0xdc36('0x3f')]['id']}})[_0xdc36('0x1e')](handleEntityNotFound(_0x562c86,null))[_0xdc36('0x1e')](removeEntity(_0x562c86,null))[_0xdc36('0x42')](handleError(_0x562c86,null));};exports[_0xdc36('0x46')]=function(_0x5ade8b,_0x1ff104){var _0x267bf5={'key':_0x5ade8b[_0xdc36('0x44')]['key']};if(_0x5ade8b[_0xdc36('0x44')][_0xdc36('0x47')]){_0x267bf5[_0xdc36('0x47')]=_0x5ade8b[_0xdc36('0x44')][_0xdc36('0x47')];}else if(_0x5ade8b[_0xdc36('0x44')]['SmsAccountId']){_0x267bf5[_0xdc36('0x48')]=_0x5ade8b[_0xdc36('0x44')][_0xdc36('0x48')];}else if(_0x5ade8b[_0xdc36('0x44')][_0xdc36('0x49')]){_0x267bf5[_0xdc36('0x49')]=_0x5ade8b[_0xdc36('0x44')][_0xdc36('0x49')];}else if(_0x5ade8b['body'][_0xdc36('0x4a')]){_0x267bf5[_0xdc36('0x4a')]=_0x5ade8b[_0xdc36('0x44')][_0xdc36('0x4a')];}return db[_0xdc36('0x3c')][_0xdc36('0x45')]({'where':_0x267bf5})[_0xdc36('0x1e')](function(_0xb26cf4){if(_0xb26cf4){throw new db['Sequelize']['ValidationError'](_0xdc36('0x4b'));}return db[_0xdc36('0x3c')]['create'](_0x5ade8b[_0xdc36('0x44')]);})[_0xdc36('0x1e')](function(_0x502033){var _0x4b84b7=_0x5ade8b[_0xdc36('0x4c')]['get']({'plain':!![]});if(!_0x4b84b7)throw new Error(_0xdc36('0x4d'));if(_0x4b84b7['role']===_0xdc36('0x4c')){var _0x55c0c0=_0x502033['get']({'plain':!![]});return db[_0xdc36('0x4e')]['find']({'where':{'name':_0xdc36('0x20'),'userProfileId':_0x4b84b7[_0xdc36('0x4f')]},'raw':!![]})[_0xdc36('0x1e')](function(_0x373e41){if(_0x373e41&&_0x373e41[_0xdc36('0x50')]===0x0){return db['UserProfileResource'][_0xdc36('0x46')]({'name':_0x55c0c0[_0xdc36('0x24')],'resourceId':_0x55c0c0['id'],'type':_0x373e41[_0xdc36('0x24')],'sectionId':_0x373e41['id']},{})['then'](function(){return _0x502033;});}else{return _0x502033;}})['catch'](function(_0xb18ebf){logger['error'](_0xdc36('0x51'),_0xb18ebf);throw _0xb18ebf;});}return _0x502033;})[_0xdc36('0x1e')](respondWithResult(_0x1ff104,0xc9))[_0xdc36('0x42')](handleError(_0x1ff104,null));}; \ No newline at end of file +var _0xd110=['CannedAnswer','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','params','body','find','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index'];(function(_0x582e18,_0x4fd856){var _0x445d03=function(_0x112957){while(--_0x112957){_0x582e18['push'](_0x582e18['shift']());}};_0x445d03(++_0x4fd856);}(_0xd110,0x1e8));var _0x0d11=function(_0x132f45,_0xd70881){_0x132f45=_0x132f45-0x0;var _0x5f3ac2=_0xd110[_0x132f45];return _0x5f3ac2;};'use strict';var pdf=require(_0x0d11('0x0'));var emlformat=require(_0x0d11('0x1'));var rimraf=require(_0x0d11('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0d11('0x3'));var rp=require(_0x0d11('0x4'));var moment=require(_0x0d11('0x5'));var BPromise=require(_0x0d11('0x6'));var Mustache=require(_0x0d11('0x7'));var util=require(_0x0d11('0x8'));var path=require(_0x0d11('0x9'));var sox=require(_0x0d11('0xa'));var csv=require('to-csv');var ejs=require(_0x0d11('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0d11('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0d11('0xd'));var toCsv=require(_0x0d11('0xe'));var querystring=require(_0x0d11('0xf'));var Papa=require('papaparse');var Redis=require(_0x0d11('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0d11('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d11('0x12'))(_0x0d11('0x13'));var utils=require(_0x0d11('0x14'));var config=require(_0x0d11('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36505b,_0x2d40fc){_0x2d40fc=_0x2d40fc||0xcc;return function(_0x488bce){if(_0x488bce){return _0x36505b[_0x0d11('0x16')](_0x2d40fc);}return _0x36505b[_0x0d11('0x17')](_0x2d40fc)[_0x0d11('0x18')]();};}function respondWithResult(_0x53e0c1,_0x45414a){_0x45414a=_0x45414a||0xc8;return function(_0x157483){if(_0x157483){return _0x53e0c1['status'](_0x45414a)[_0x0d11('0x19')](_0x157483);}};}function respondWithFilteredResult(_0x3c88e6,_0x266f0f){return function(_0x3005f2){if(_0x3005f2){var _0x2bc04b=_0x3005f2['count'],_0x5b85a7=_0x266f0f[_0x0d11('0x1a')],_0x5a0de9=_0x266f0f[_0x0d11('0x1a')]+_0x266f0f['limit'],_0x280d81;if(_0x5a0de9>=_0x2bc04b){_0x5a0de9=_0x2bc04b;_0x280d81=0xc8;}else{_0x280d81=0xce;}_0x3c88e6[_0x0d11('0x17')](_0x280d81);return _0x3c88e6['set'](_0x0d11('0x1b'),_0x5b85a7+'-'+_0x5a0de9+'/'+_0x2bc04b)[_0x0d11('0x19')](_0x3005f2);}return null;};}function patchUpdates(_0x5e3bd3){return function(_0x5a85ca){try{jsonpatch[_0x0d11('0x1c')](_0x5a85ca,_0x5e3bd3,!![]);}catch(_0x16e9ee){return BPromise[_0x0d11('0x1d')](_0x16e9ee);}return _0x5a85ca[_0x0d11('0x1e')]();};}function saveUpdates(_0x43d750,_0x3b4be3){return function(_0x575ea3){if(_0x575ea3){return _0x575ea3[_0x0d11('0x1f')](_0x43d750)[_0x0d11('0x20')](function(_0x4245cc){return _0x4245cc;});}return null;};}function removeEntity(_0x32d33f,_0x8c10ba){return function(_0x551e16){if(_0x551e16){return _0x551e16[_0x0d11('0x21')]()['then'](function(){var _0x1d94e0=_0x551e16[_0x0d11('0x22')]({'plain':!![]});var _0x1610df='CannedAnswers';return db[_0x0d11('0x23')][_0x0d11('0x21')]({'where':{'type':_0x1610df,'resourceId':_0x1d94e0['id']}})['then'](function(){return _0x551e16;});})[_0x0d11('0x20')](function(){_0x32d33f['status'](0xcc)[_0x0d11('0x18')]();});}};}function handleEntityNotFound(_0x510bf5,_0x52cb79){return function(_0x1dba11){if(!_0x1dba11){_0x510bf5[_0x0d11('0x16')](0x194);}return _0x1dba11;};}function handleError(_0x2ab05a,_0x2138a0){_0x2138a0=_0x2138a0||0x1f4;return function(_0x7be5a3){logger['error'](_0x7be5a3[_0x0d11('0x24')]);if(_0x7be5a3['name']){delete _0x7be5a3[_0x0d11('0x25')];}_0x2ab05a['status'](_0x2138a0)[_0x0d11('0x26')](_0x7be5a3);};}exports[_0x0d11('0x27')]=function(_0x744425,_0x103c75){var _0x206dd2={},_0x17a668={},_0x144e93={'count':0x0,'rows':[]};var _0x38f51d=db[_0x0d11('0x28')][_0x0d11('0x29')];_0x17a668[_0x0d11('0x2a')]=_[_0x0d11('0x2b')](_0x38f51d);_0x17a668['query']=_[_0x0d11('0x2b')](_0x744425[_0x0d11('0x2c')]);_0x17a668['filters']=_[_0x0d11('0x2d')](_0x17a668[_0x0d11('0x2a')],_0x17a668[_0x0d11('0x2c')]);_0x206dd2[_0x0d11('0x2e')]=_[_0x0d11('0x2d')](_0x17a668[_0x0d11('0x2a')],qs[_0x0d11('0x2f')](_0x744425[_0x0d11('0x2c')][_0x0d11('0x2f')]));_0x206dd2[_0x0d11('0x2e')]=_0x206dd2[_0x0d11('0x2e')]['length']?_0x206dd2[_0x0d11('0x2e')]:_0x17a668[_0x0d11('0x2a')];if(!_0x744425[_0x0d11('0x2c')][_0x0d11('0x30')](_0x0d11('0x31'))){_0x206dd2[_0x0d11('0x32')]=qs[_0x0d11('0x32')](_0x744425[_0x0d11('0x2c')][_0x0d11('0x32')]);_0x206dd2[_0x0d11('0x1a')]=qs[_0x0d11('0x1a')](_0x744425['query']['offset']);}_0x206dd2[_0x0d11('0x33')]=qs[_0x0d11('0x34')](_0x744425[_0x0d11('0x2c')][_0x0d11('0x34')]);_0x206dd2['where']=qs[_0x0d11('0x35')](_[_0x0d11('0x36')](_0x744425['query'],_0x17a668[_0x0d11('0x35')]));if(_0x744425[_0x0d11('0x2c')][_0x0d11('0x37')]){_0x206dd2[_0x0d11('0x38')]=_[_0x0d11('0x39')](_0x206dd2[_0x0d11('0x38')],{'$or':_[_0x0d11('0x3a')](_0x38f51d,function(_0x2896d4){if(_0x2896d4[_0x0d11('0x3b')][_0x0d11('0x3c')]!==_0x0d11('0x3d')){var _0x11fb0a={};_0x11fb0a[_0x2896d4[_0x0d11('0x3e')]]={'$like':'%'+_0x744425[_0x0d11('0x2c')][_0x0d11('0x37')]+'%'};return _0x11fb0a;}})});}_0x206dd2=_['merge']({},_0x206dd2,_0x744425[_0x0d11('0x3f')]);var _0x581bfc={'where':_0x206dd2[_0x0d11('0x38')]};return db[_0x0d11('0x28')][_0x0d11('0x40')](_0x581bfc)[_0x0d11('0x20')](function(_0x52ab92){_0x144e93[_0x0d11('0x40')]=_0x52ab92;if(_0x744425[_0x0d11('0x2c')][_0x0d11('0x41')]){_0x206dd2[_0x0d11('0x42')]=[{'all':!![]}];}return db['CannedAnswer'][_0x0d11('0x43')](_0x206dd2);})['then'](function(_0x2e2f91){_0x144e93[_0x0d11('0x44')]=_0x2e2f91;return _0x144e93;})[_0x0d11('0x20')](respondWithFilteredResult(_0x103c75,_0x206dd2))[_0x0d11('0x45')](handleError(_0x103c75,null));};exports['show']=function(_0x1cb4bc,_0x241924){var _0x422da4={'raw':!![],'where':{'id':_0x1cb4bc[_0x0d11('0x46')]['id']}},_0x51aea7={};_0x51aea7[_0x0d11('0x2a')]=_[_0x0d11('0x2b')](db[_0x0d11('0x28')][_0x0d11('0x29')]);_0x51aea7[_0x0d11('0x2c')]=_['keys'](_0x1cb4bc[_0x0d11('0x2c')]);_0x51aea7[_0x0d11('0x35')]=_[_0x0d11('0x2d')](_0x51aea7[_0x0d11('0x2a')],_0x51aea7[_0x0d11('0x2c')]);_0x422da4[_0x0d11('0x2e')]=_[_0x0d11('0x2d')](_0x51aea7[_0x0d11('0x2a')],qs[_0x0d11('0x2f')](_0x1cb4bc[_0x0d11('0x2c')][_0x0d11('0x2f')]));_0x422da4['attributes']=_0x422da4[_0x0d11('0x2e')]['length']?_0x422da4['attributes']:_0x51aea7[_0x0d11('0x2a')];if(_0x1cb4bc['query']['includeAll']){_0x422da4[_0x0d11('0x42')]=[{'all':!![]}];}_0x422da4=_[_0x0d11('0x39')]({},_0x422da4,_0x1cb4bc[_0x0d11('0x3f')]);return db[_0x0d11('0x28')]['find'](_0x422da4)[_0x0d11('0x20')](handleEntityNotFound(_0x241924,null))['then'](respondWithResult(_0x241924,null))['catch'](handleError(_0x241924,null));};exports[_0x0d11('0x1f')]=function(_0x4b3e91,_0x26a8c5){if(_0x4b3e91[_0x0d11('0x47')]['id']){delete _0x4b3e91[_0x0d11('0x47')]['id'];}return db['CannedAnswer'][_0x0d11('0x48')]({'where':{'id':_0x4b3e91[_0x0d11('0x46')]['id']}})['then'](handleEntityNotFound(_0x26a8c5,null))['then'](saveUpdates(_0x4b3e91['body'],null))['then'](respondWithResult(_0x26a8c5,null))[_0x0d11('0x45')](handleError(_0x26a8c5,null));};exports[_0x0d11('0x21')]=function(_0xb388cc,_0x4dd063){return db['CannedAnswer'][_0x0d11('0x48')]({'where':{'id':_0xb388cc[_0x0d11('0x46')]['id']}})[_0x0d11('0x20')](handleEntityNotFound(_0x4dd063,null))[_0x0d11('0x20')](removeEntity(_0x4dd063,null))[_0x0d11('0x45')](handleError(_0x4dd063,null));};exports['create']=function(_0x10d7cc,_0x8309f4){var _0x23d179={'key':_0x10d7cc[_0x0d11('0x47')][_0x0d11('0x3c')]};if(_0x10d7cc[_0x0d11('0x47')][_0x0d11('0x49')]){_0x23d179[_0x0d11('0x49')]=_0x10d7cc[_0x0d11('0x47')][_0x0d11('0x49')];}else if(_0x10d7cc[_0x0d11('0x47')][_0x0d11('0x4a')]){_0x23d179[_0x0d11('0x4a')]=_0x10d7cc[_0x0d11('0x47')][_0x0d11('0x4a')];}else if(_0x10d7cc[_0x0d11('0x47')][_0x0d11('0x4b')]){_0x23d179[_0x0d11('0x4b')]=_0x10d7cc[_0x0d11('0x47')][_0x0d11('0x4b')];}else if(_0x10d7cc['body'][_0x0d11('0x4c')]){_0x23d179['ChatWebsiteId']=_0x10d7cc[_0x0d11('0x47')]['ChatWebsiteId'];}return db['CannedAnswer'][_0x0d11('0x48')]({'where':_0x23d179})[_0x0d11('0x20')](function(_0x111dce){if(_0x111dce){throw new db[(_0x0d11('0x4d'))][(_0x0d11('0x4e'))](_0x0d11('0x4f'));}return db[_0x0d11('0x28')][_0x0d11('0x50')](_0x10d7cc['body']);})['then'](function(_0x5628d9){var _0x16c2a8=_0x10d7cc[_0x0d11('0x51')][_0x0d11('0x22')]({'plain':!![]});if(!_0x16c2a8)throw new Error(_0x0d11('0x52'));if(_0x16c2a8[_0x0d11('0x53')]===_0x0d11('0x51')){var _0x33cd8a=_0x5628d9['get']({'plain':!![]});return db[_0x0d11('0x54')][_0x0d11('0x48')]({'where':{'name':_0x0d11('0x55'),'userProfileId':_0x16c2a8['userProfileId']},'raw':!![]})['then'](function(_0x1323c0){if(_0x1323c0&&_0x1323c0['autoAssociation']===0x0){return db[_0x0d11('0x23')][_0x0d11('0x50')]({'name':_0x33cd8a[_0x0d11('0x25')],'resourceId':_0x33cd8a['id'],'type':_0x1323c0[_0x0d11('0x25')],'sectionId':_0x1323c0['id']},{})[_0x0d11('0x20')](function(){return _0x5628d9;});}else{return _0x5628d9;}})[_0x0d11('0x45')](function(_0xec39e3){logger[_0x0d11('0x56')](_0x0d11('0x57'),_0xec39e3);throw _0xec39e3;});}return _0x5628d9;})[_0x0d11('0x20')](respondWithResult(_0x8309f4,0xc9))[_0x0d11('0x45')](handleError(_0x8309f4,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index fa7b69d..80434aa 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 _0x9193=['exports','CannedAnswer','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x296187,_0x66707b){var _0x4565d2=function(_0xb3f7cb){while(--_0xb3f7cb){_0x296187['push'](_0x296187['shift']());}};_0x4565d2(++_0x66707b);}(_0x9193,0x1dc));var _0x3919=function(_0xd9f102,_0x5a0d28){_0xd9f102=_0xd9f102-0x0;var _0x2652e4=_0x9193[_0xd9f102];return _0x2652e4;};'use strict';var _=require(_0x3919('0x0'));var util=require('util');var logger=require(_0x3919('0x1'))(_0x3919('0x2'));var moment=require(_0x3919('0x3'));var BPromise=require(_0x3919('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3919('0x5'));var rimraf=require(_0x3919('0x6'));var config=require(_0x3919('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x3919('0x8')]=function(_0x524b32,_0x1173c1){return _0x524b32['define'](_0x3919('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3919('0xa')});}; \ No newline at end of file +var _0x6282=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6282,0x76));var _0x2628=function(_0x391ec5,_0x4a32a1){_0x391ec5=_0x391ec5-0x0;var _0x423c4f=_0x6282[_0x391ec5];return _0x423c4f;};'use strict';var _=require(_0x2628('0x0'));var util=require(_0x2628('0x1'));var logger=require(_0x2628('0x2'))(_0x2628('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2628('0x4'));var fs=require('fs');var path=require(_0x2628('0x5'));var rimraf=require('rimraf');var config=require(_0x2628('0x6'));var attributes=require(_0x2628('0x7'));module[_0x2628('0x8')]=function(_0x47102a,_0x128d3a){return _0x47102a['define'](_0x2628('0x9'),attributes,{'tableName':_0x2628('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2628('0xb'),'collate':_0x2628('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index f65859e..1da5f76 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 _0x5e5e=['CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x13594e,_0x6f0ed0){var _0x1a4f42=function(_0x30b064){while(--_0x30b064){_0x13594e['push'](_0x13594e['shift']());}};_0x1a4f42(++_0x6f0ed0);}(_0x5e5e,0xf0));var _0xe5e5=function(_0x2ec545,_0x4d250c){_0x2ec545=_0x2ec545-0x0;var _0x524307=_0x5e5e[_0x2ec545];return _0x524307;};'use strict';var _=require('lodash');var util=require(_0xe5e5('0x0'));var moment=require(_0xe5e5('0x1'));var BPromise=require(_0xe5e5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5e5('0x3'));var db=require(_0xe5e5('0x4'))['db'];var utils=require(_0xe5e5('0x5'));var logger=require(_0xe5e5('0x6'))(_0xe5e5('0x7'));var config=require(_0xe5e5('0x8'));var jayson=require(_0xe5e5('0x9'));var client=jayson[_0xe5e5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xeedea4,_0x1dff87,_0x4d8c20){return new BPromise(function(_0xef129f,_0x556755){return client[_0xe5e5('0xb')](_0xeedea4,_0x4d8c20)['then'](function(_0x4b51a8){logger[_0xe5e5('0xc')](_0xe5e5('0xd'),_0x1dff87,_0xe5e5('0xe'));logger[_0xe5e5('0xf')](_0xe5e5('0x10'),_0x1dff87,_0xe5e5('0xe'),JSON[_0xe5e5('0x11')](_0x4b51a8));if(_0x4b51a8[_0xe5e5('0x12')]){if(_0x4b51a8['error'][_0xe5e5('0x13')]===0x1f4){logger[_0xe5e5('0x12')](_0xe5e5('0xd'),_0x1dff87,_0x4b51a8['error'][_0xe5e5('0x14')]);return _0x556755(_0x4b51a8[_0xe5e5('0x12')][_0xe5e5('0x14')]);}logger[_0xe5e5('0x12')](_0xe5e5('0xd'),_0x1dff87,_0x4b51a8['error'][_0xe5e5('0x14')]);return _0xef129f(_0x4b51a8[_0xe5e5('0x12')][_0xe5e5('0x14')]);}else{logger['info']('CannedAnswer,\x20%s,\x20%s',_0x1dff87,_0xe5e5('0xe'));_0xef129f(_0x4b51a8[_0xe5e5('0x15')][_0xe5e5('0x14')]);}})[_0xe5e5('0x16')](function(_0x45ffb3){logger['error'](_0xe5e5('0xd'),_0x1dff87,_0x45ffb3);_0x556755(_0x45ffb3);});});} \ No newline at end of file +var _0x19ec=['error','code','message','CannedAnswer,\x20%s,\x20%s','lodash','util','moment','randomstring','../../config/logger','rpc','jayson/promise','http','then','info','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x266b15,_0x2c4241){var _0x34e820=function(_0x17c293){while(--_0x17c293){_0x266b15['push'](_0x266b15['shift']());}};_0x34e820(++_0x2c4241);}(_0x19ec,0x112));var _0xc19e=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x19ec[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0xc19e('0x0'));var util=require(_0xc19e('0x1'));var moment=require(_0xc19e('0x2'));var BPromise=require('bluebird');var rs=require(_0xc19e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc19e('0x4'))(_0xc19e('0x5'));var config=require('../../config/environment');var jayson=require(_0xc19e('0x6'));var client=jayson['client'][_0xc19e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x242714,_0x4087a6,_0x59e272){return new BPromise(function(_0x34cdbf,_0x5ddb0c){return client['request'](_0x242714,_0x59e272)[_0xc19e('0x8')](function(_0x273806){logger[_0xc19e('0x9')]('CannedAnswer,\x20%s,\x20%s',_0x4087a6,'request\x20sent');logger[_0xc19e('0xa')](_0xc19e('0xb'),_0x4087a6,_0xc19e('0xc'),JSON[_0xc19e('0xd')](_0x273806));if(_0x273806[_0xc19e('0xe')]){if(_0x273806[_0xc19e('0xe')][_0xc19e('0xf')]===0x1f4){logger[_0xc19e('0xe')]('CannedAnswer,\x20%s,\x20%s',_0x4087a6,_0x273806[_0xc19e('0xe')][_0xc19e('0x10')]);return _0x5ddb0c(_0x273806['error']['message']);}logger[_0xc19e('0xe')](_0xc19e('0x11'),_0x4087a6,_0x273806['error'][_0xc19e('0x10')]);return _0x34cdbf(_0x273806[_0xc19e('0xe')][_0xc19e('0x10')]);}else{logger['info'](_0xc19e('0x11'),_0x4087a6,_0xc19e('0xc'));_0x34cdbf(_0x273806['result'][_0xc19e('0x10')]);}})['catch'](function(_0x2b127a){logger[_0xc19e('0xe')](_0xc19e('0x11'),_0x4087a6,_0x2b127a);_0x5ddb0c(_0x2b127a);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index f70db42..923d109 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 _0xfd9e=['./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x54fa24,_0x1b1ee7){var _0x1ef5cf=function(_0x15a096){while(--_0x15a096){_0x54fa24['push'](_0x54fa24['shift']());}};_0x1ef5cf(++_0x1b1ee7);}(_0xfd9e,0x15d));var _0xefd9=function(_0x37e607,_0x3652cf){_0x37e607=_0x37e607-0x0;var _0x29ab96=_0xfd9e[_0x37e607];return _0x29ab96;};'use strict';var multer=require(_0xefd9('0x0'));var util=require(_0xefd9('0x1'));var path=require('path');var timeout=require(_0xefd9('0x2'));var express=require(_0xefd9('0x3'));var router=express[_0xefd9('0x4')]();var auth=require(_0xefd9('0x5'));var interaction=require(_0xefd9('0x6'));var config=require(_0xefd9('0x7'));var controller=require(_0xefd9('0x8'));router[_0xefd9('0x9')]('/',auth[_0xefd9('0xa')](),controller[_0xefd9('0xb')]);router['get'](_0xefd9('0xc'),auth[_0xefd9('0xa')](),controller[_0xefd9('0xd')]);router[_0xefd9('0xe')]('/',auth[_0xefd9('0xa')](),controller[_0xefd9('0xf')]);router[_0xefd9('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xefd9('0x11')]);router[_0xefd9('0x12')](_0xefd9('0xc'),auth['isAuthenticated'](),controller[_0xefd9('0x13')]);module[_0xefd9('0x14')]=router; \ No newline at end of file +var _0x8bea=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x8bea,0xfc));var _0xa8be=function(_0x1debaa,_0x39c5a5){_0x1debaa=_0x1debaa-0x0;var _0x2fbd5e=_0x8bea[_0x1debaa];return _0x2fbd5e;};'use strict';var multer=require(_0xa8be('0x0'));var util=require(_0xa8be('0x1'));var path=require(_0xa8be('0x2'));var timeout=require(_0xa8be('0x3'));var express=require(_0xa8be('0x4'));var router=express[_0xa8be('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xa8be('0x6'));var config=require(_0xa8be('0x7'));var controller=require(_0xa8be('0x8'));router[_0xa8be('0x9')]('/',auth[_0xa8be('0xa')](),controller[_0xa8be('0xb')]);router[_0xa8be('0x9')](_0xa8be('0xc'),auth[_0xa8be('0xa')](),controller['show']);router[_0xa8be('0xd')]('/',auth[_0xa8be('0xa')](),controller['create']);router[_0xa8be('0xe')](_0xa8be('0xc'),auth['isAuthenticated'](),controller[_0xa8be('0xf')]);router[_0xa8be('0x10')](_0xa8be('0xc'),auth[_0xa8be('0xa')](),controller[_0xa8be('0x11')]);module[_0xa8be('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 7cd07e6..20f1899 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 _0x10d3=['INTEGER','sequelize','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x15b0bd,_0x5cfd1f){var _0x2418b9=function(_0x2a3a2b){while(--_0x2a3a2b){_0x15b0bd['push'](_0x15b0bd['shift']());}};_0x2418b9(++_0x5cfd1f);}(_0x10d3,0x164));var _0x310d=function(_0x50d5b1,_0x2e4eae){_0x50d5b1=_0x50d5b1-0x0;var _0x3fded0=_0x10d3[_0x50d5b1];return _0x3fded0;};'use strict';var Sequelize=require(_0x310d('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x310d('0x1')],'allowNull':![],'defaultValue':_0x310d('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x310d('0x3')]},'dst':{'type':Sequelize[_0x310d('0x3')]},'dcontext':{'type':Sequelize[_0x310d('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x310d('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x310d('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x310d('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x310d('0x3')]},'amaflags':{'type':Sequelize[_0x310d('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x310d('0x3')]},'userfield':{'type':Sequelize[_0x310d('0x3')]},'uniqueid':{'type':Sequelize[_0x310d('0x3')]},'linkedid':{'type':Sequelize[_0x310d('0x3')]},'sequence':{'type':Sequelize[_0x310d('0x3')]},'peeraccount':{'type':Sequelize[_0x310d('0x3')]},'type':{'type':Sequelize[_0x310d('0x3')]},'tag':{'type':Sequelize[_0x310d('0x3')]}}; \ No newline at end of file +var _0x8d8f=['STRING','INTEGER','sequelize','DATE','1970-01-01\x2000:00:01'];(function(_0x56968c,_0x1e4877){var _0x3e3524=function(_0x3374c2){while(--_0x3374c2){_0x56968c['push'](_0x56968c['shift']());}};_0x3e3524(++_0x1e4877);}(_0x8d8f,0xcf));var _0xf8d8=function(_0x17e1a7,_0x2ffbba){_0x17e1a7=_0x17e1a7-0x0;var _0x119a8e=_0x8d8f[_0x17e1a7];return _0x119a8e;};'use strict';var Sequelize=require(_0xf8d8('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xf8d8('0x1')],'allowNull':![],'defaultValue':_0xf8d8('0x2')},'clid':{'type':Sequelize[_0xf8d8('0x3')]},'src':{'type':Sequelize[_0xf8d8('0x3')]},'dst':{'type':Sequelize[_0xf8d8('0x3')]},'dcontext':{'type':Sequelize[_0xf8d8('0x3')]},'channel':{'type':Sequelize[_0xf8d8('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xf8d8('0x3')]},'duration':{'type':Sequelize[_0xf8d8('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf8d8('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf8d8('0x3')]},'amaflags':{'type':Sequelize[_0xf8d8('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xf8d8('0x3')]},'uniqueid':{'type':Sequelize[_0xf8d8('0x3')]},'linkedid':{'type':Sequelize[_0xf8d8('0x3')]},'sequence':{'type':Sequelize[_0xf8d8('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf8d8('0x3')]},'tag':{'type':Sequelize[_0xf8d8('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 43454ec..6cd07b3 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 _0x0abf=['length','hasOwnProperty','order','sort','where','pick','filter','map','key','VIRTUAL','merge','Cdr','includeAll','findAll','rows','catch','params','options','find','create','body','describe','html-pdf','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields'];(function(_0x4d8f96,_0x17c4a0){var _0x48c983=function(_0xfc95c1){while(--_0xfc95c1){_0x4d8f96['push'](_0x4d8f96['shift']());}};_0x48c983(++_0x17c4a0);}(_0x0abf,0xe8));var _0xf0ab=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x0abf[_0x5ddb1c];return _0x354adc;};'use strict';var pdf=require(_0xf0ab('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf0ab('0x1'));var zipdir=require(_0xf0ab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf0ab('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf0ab('0x4'));var util=require(_0xf0ab('0x5'));var path=require(_0xf0ab('0x6'));var sox=require(_0xf0ab('0x7'));var csv=require(_0xf0ab('0x8'));var ejs=require(_0xf0ab('0x9'));var fs=require('fs');var _=require(_0xf0ab('0xa'));var squel=require('squel');var crypto=require(_0xf0ab('0xb'));var jsforce=require(_0xf0ab('0xc'));var deskjs=require(_0xf0ab('0xd'));var toCsv=require(_0xf0ab('0x8'));var querystring=require('querystring');var Papa=require(_0xf0ab('0xe'));var Redis=require(_0xf0ab('0xf'));var authService=require(_0xf0ab('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0ab('0x11'))('api');var utils=require(_0xf0ab('0x12'));var config=require(_0xf0ab('0x13'));var db=require(_0xf0ab('0x14'))['db'];function respondWithStatusCode(_0x410df5,_0x2dc4f8){_0x2dc4f8=_0x2dc4f8||0xcc;return function(_0x38ca67){if(_0x38ca67){return _0x410df5[_0xf0ab('0x15')](_0x2dc4f8);}return _0x410df5['status'](_0x2dc4f8)[_0xf0ab('0x16')]();};}function respondWithResult(_0x2cc002,_0x1913fe){_0x1913fe=_0x1913fe||0xc8;return function(_0x35c75f){if(_0x35c75f){return _0x2cc002[_0xf0ab('0x17')](_0x1913fe)[_0xf0ab('0x18')](_0x35c75f);}};}function respondWithFilteredResult(_0x3d7129,_0x1fb4e5){return function(_0x180d0b){if(_0x180d0b){var _0x3c5bfd=_0x180d0b[_0xf0ab('0x19')],_0x20f453=_0x1fb4e5[_0xf0ab('0x1a')],_0x221bac=_0x1fb4e5['offset']+_0x1fb4e5[_0xf0ab('0x1b')],_0x200cf5;if(_0x221bac>=_0x3c5bfd){_0x221bac=_0x3c5bfd;_0x200cf5=0xc8;}else{_0x200cf5=0xce;}_0x3d7129[_0xf0ab('0x17')](_0x200cf5);return _0x3d7129[_0xf0ab('0x1c')](_0xf0ab('0x1d'),_0x20f453+'-'+_0x221bac+'/'+_0x3c5bfd)[_0xf0ab('0x18')](_0x180d0b);}return null;};}function patchUpdates(_0xb9a33){return function(_0x3a0edf){try{jsonpatch[_0xf0ab('0x1e')](_0x3a0edf,_0xb9a33,!![]);}catch(_0x1713d6){return BPromise[_0xf0ab('0x1f')](_0x1713d6);}return _0x3a0edf[_0xf0ab('0x20')]();};}function saveUpdates(_0xdfcfb2,_0xf43bc4){return function(_0x22a205){if(_0x22a205){return _0x22a205[_0xf0ab('0x21')](_0xdfcfb2)[_0xf0ab('0x22')](function(_0x537673){return _0x537673;});}return null;};}function removeEntity(_0x153492,_0x6fa888){return function(_0x1e1483){if(_0x1e1483){return _0x1e1483[_0xf0ab('0x23')]()[_0xf0ab('0x22')](function(){_0x153492[_0xf0ab('0x17')](0xcc)[_0xf0ab('0x16')]();});}};}function handleEntityNotFound(_0x20140b,_0x36ad01){return function(_0x18bb37){if(!_0x18bb37){_0x20140b[_0xf0ab('0x15')](0x194);}return _0x18bb37;};}function handleError(_0x5645b2,_0x585841){_0x585841=_0x585841||0x1f4;return function(_0x4eee21){logger[_0xf0ab('0x24')](_0x4eee21['stack']);if(_0x4eee21[_0xf0ab('0x25')]){delete _0x4eee21[_0xf0ab('0x25')];}_0x5645b2['status'](_0x585841)[_0xf0ab('0x26')](_0x4eee21);};}exports[_0xf0ab('0x27')]=function(_0x10bf5f,_0x38fb71){var _0x7d4ff9={},_0x502921={},_0x2d0da7={'count':0x0,'rows':[]};var _0x574ce7=db['Cdr'][_0xf0ab('0x28')];_0x502921[_0xf0ab('0x29')]=_[_0xf0ab('0x2a')](_0x574ce7);_0x502921[_0xf0ab('0x2b')]=_[_0xf0ab('0x2a')](_0x10bf5f[_0xf0ab('0x2b')]);_0x502921[_0xf0ab('0x2c')]=_[_0xf0ab('0x2d')](_0x502921[_0xf0ab('0x29')],_0x502921[_0xf0ab('0x2b')]);_0x7d4ff9[_0xf0ab('0x2e')]=_[_0xf0ab('0x2d')](_0x502921['model'],qs[_0xf0ab('0x2f')](_0x10bf5f[_0xf0ab('0x2b')]['fields']));_0x7d4ff9['attributes']=_0x7d4ff9[_0xf0ab('0x2e')][_0xf0ab('0x30')]?_0x7d4ff9[_0xf0ab('0x2e')]:_0x502921['model'];if(!_0x10bf5f['query'][_0xf0ab('0x31')]('nolimit')){_0x7d4ff9[_0xf0ab('0x1b')]=qs['limit'](_0x10bf5f[_0xf0ab('0x2b')][_0xf0ab('0x1b')]);_0x7d4ff9['offset']=qs['offset'](_0x10bf5f[_0xf0ab('0x2b')][_0xf0ab('0x1a')]);}_0x7d4ff9[_0xf0ab('0x32')]=qs[_0xf0ab('0x33')](_0x10bf5f[_0xf0ab('0x2b')][_0xf0ab('0x33')]);_0x7d4ff9[_0xf0ab('0x34')]=qs[_0xf0ab('0x2c')](_[_0xf0ab('0x35')](_0x10bf5f[_0xf0ab('0x2b')],_0x502921[_0xf0ab('0x2c')]));if(_0x10bf5f[_0xf0ab('0x2b')][_0xf0ab('0x36')]){_0x7d4ff9[_0xf0ab('0x34')]=_['merge'](_0x7d4ff9[_0xf0ab('0x34')],{'$or':_[_0xf0ab('0x37')](_0x574ce7,function(_0xc575ed){if(_0xc575ed['type'][_0xf0ab('0x38')]!==_0xf0ab('0x39')){var _0x5d99e7={};_0x5d99e7[_0xc575ed['field']]={'$like':'%'+_0x10bf5f[_0xf0ab('0x2b')]['filter']+'%'};return _0x5d99e7;}})});}_0x7d4ff9=_[_0xf0ab('0x3a')]({},_0x7d4ff9,_0x10bf5f['options']);var _0x4763f7={'where':_0x7d4ff9[_0xf0ab('0x34')]};return db[_0xf0ab('0x3b')][_0xf0ab('0x19')](_0x4763f7)[_0xf0ab('0x22')](function(_0x1dfb2e){_0x2d0da7['count']=_0x1dfb2e;if(_0x10bf5f[_0xf0ab('0x2b')][_0xf0ab('0x3c')]){_0x7d4ff9['include']=[{'all':!![]}];}return db[_0xf0ab('0x3b')][_0xf0ab('0x3d')](_0x7d4ff9);})[_0xf0ab('0x22')](function(_0x44988b){_0x2d0da7[_0xf0ab('0x3e')]=_0x44988b;return _0x2d0da7;})[_0xf0ab('0x22')](respondWithFilteredResult(_0x38fb71,_0x7d4ff9))[_0xf0ab('0x3f')](handleError(_0x38fb71,null));};exports['show']=function(_0x406a1d,_0x4f6e93){var _0x7c4629={'raw':!![],'where':{'id':_0x406a1d[_0xf0ab('0x40')]['id']}},_0x4bd6d1={};_0x4bd6d1[_0xf0ab('0x29')]=_[_0xf0ab('0x2a')](db[_0xf0ab('0x3b')][_0xf0ab('0x28')]);_0x4bd6d1['query']=_[_0xf0ab('0x2a')](_0x406a1d[_0xf0ab('0x2b')]);_0x4bd6d1[_0xf0ab('0x2c')]=_[_0xf0ab('0x2d')](_0x4bd6d1[_0xf0ab('0x29')],_0x4bd6d1[_0xf0ab('0x2b')]);_0x7c4629[_0xf0ab('0x2e')]=_[_0xf0ab('0x2d')](_0x4bd6d1[_0xf0ab('0x29')],qs[_0xf0ab('0x2f')](_0x406a1d[_0xf0ab('0x2b')][_0xf0ab('0x2f')]));_0x7c4629[_0xf0ab('0x2e')]=_0x7c4629['attributes']['length']?_0x7c4629[_0xf0ab('0x2e')]:_0x4bd6d1['model'];if(_0x406a1d[_0xf0ab('0x2b')][_0xf0ab('0x3c')]){_0x7c4629['include']=[{'all':!![]}];}_0x7c4629=_[_0xf0ab('0x3a')]({},_0x7c4629,_0x406a1d[_0xf0ab('0x41')]);return db['Cdr'][_0xf0ab('0x42')](_0x7c4629)[_0xf0ab('0x22')](handleEntityNotFound(_0x4f6e93,null))[_0xf0ab('0x22')](respondWithResult(_0x4f6e93,null))[_0xf0ab('0x3f')](handleError(_0x4f6e93,null));};exports[_0xf0ab('0x43')]=function(_0x376651,_0x198cc3){return db[_0xf0ab('0x3b')][_0xf0ab('0x43')](_0x376651[_0xf0ab('0x44')],{})[_0xf0ab('0x22')](respondWithResult(_0x198cc3,0xc9))[_0xf0ab('0x3f')](handleError(_0x198cc3,null));};exports[_0xf0ab('0x21')]=function(_0x99ce7,_0x58fea3){if(_0x99ce7['body']['id']){delete _0x99ce7[_0xf0ab('0x44')]['id'];}return db['Cdr']['find']({'where':{'id':_0x99ce7['params']['id']}})[_0xf0ab('0x22')](handleEntityNotFound(_0x58fea3,null))[_0xf0ab('0x22')](saveUpdates(_0x99ce7[_0xf0ab('0x44')],null))[_0xf0ab('0x22')](respondWithResult(_0x58fea3,null))[_0xf0ab('0x3f')](handleError(_0x58fea3,null));};exports[_0xf0ab('0x23')]=function(_0x472c1b,_0x1a0f21){return db[_0xf0ab('0x3b')][_0xf0ab('0x42')]({'where':{'id':_0x472c1b[_0xf0ab('0x40')]['id']}})[_0xf0ab('0x22')](handleEntityNotFound(_0x1a0f21,null))['then'](removeEntity(_0x1a0f21,null))[_0xf0ab('0x3f')](handleError(_0x1a0f21,null));};exports[_0xf0ab('0x45')]=function(_0x43abde,_0x46b998){return db[_0xf0ab('0x3b')][_0xf0ab('0x45')]()[_0xf0ab('0x22')](respondWithResult(_0x46b998,null))[_0xf0ab('0x3f')](handleError(_0x46b998,null));}; \ No newline at end of file +var _0xed3c=['ejs','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','error','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','field','options','Cdr','then','includeAll','findAll','catch','show','params','include','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv'];(function(_0x11cadf,_0x324f1c){var _0x4e04d4=function(_0x4a9fc2){while(--_0x4a9fc2){_0x11cadf['push'](_0x11cadf['shift']());}};_0x4e04d4(++_0x324f1c);}(_0xed3c,0x1a6));var _0xced3=function(_0x1509f7,_0x2fc1d2){_0x1509f7=_0x1509f7-0x0;var _0x3211a0=_0xed3c[_0x1509f7];return _0x3211a0;};'use strict';var pdf=require(_0xced3('0x0'));var emlformat=require(_0xced3('0x1'));var rimraf=require(_0xced3('0x2'));var zipdir=require(_0xced3('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xced3('0x4'));var moment=require(_0xced3('0x5'));var BPromise=require(_0xced3('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xced3('0x7'));var sox=require(_0xced3('0x8'));var csv=require(_0xced3('0x9'));var ejs=require(_0xced3('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xced3('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xced3('0xc'));var Redis=require(_0xced3('0xd'));var authService=require(_0xced3('0xe'));var qs=require(_0xced3('0xf'));var hardwareService=require(_0xced3('0x10'));var logger=require('../../config/logger')(_0xced3('0x11'));var utils=require(_0xced3('0x12'));var config=require(_0xced3('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14f61c,_0x19b8c2){_0x19b8c2=_0x19b8c2||0xcc;return function(_0x42d879){if(_0x42d879){return _0x14f61c[_0xced3('0x14')](_0x19b8c2);}return _0x14f61c[_0xced3('0x15')](_0x19b8c2)[_0xced3('0x16')]();};}function respondWithResult(_0x1869d5,_0x5aadb6){_0x5aadb6=_0x5aadb6||0xc8;return function(_0x65bb58){if(_0x65bb58){return _0x1869d5['status'](_0x5aadb6)[_0xced3('0x17')](_0x65bb58);}};}function respondWithFilteredResult(_0x435616,_0x20d099){return function(_0x39e4aa){if(_0x39e4aa){var _0x4dd4c3=_0x39e4aa[_0xced3('0x18')],_0x146a21=_0x20d099[_0xced3('0x19')],_0x322c2d=_0x20d099[_0xced3('0x19')]+_0x20d099[_0xced3('0x1a')],_0x4acae6;if(_0x322c2d>=_0x4dd4c3){_0x322c2d=_0x4dd4c3;_0x4acae6=0xc8;}else{_0x4acae6=0xce;}_0x435616['status'](_0x4acae6);return _0x435616[_0xced3('0x1b')]('Content-Range',_0x146a21+'-'+_0x322c2d+'/'+_0x4dd4c3)[_0xced3('0x17')](_0x39e4aa);}return null;};}function patchUpdates(_0x4480a6){return function(_0x32c402){try{jsonpatch[_0xced3('0x1c')](_0x32c402,_0x4480a6,!![]);}catch(_0x44143f){return BPromise[_0xced3('0x1d')](_0x44143f);}return _0x32c402[_0xced3('0x1e')]();};}function saveUpdates(_0x16d30d,_0x3f688c){return function(_0x17c011){if(_0x17c011){return _0x17c011[_0xced3('0x1f')](_0x16d30d)['then'](function(_0x5b8b1f){return _0x5b8b1f;});}return null;};}function removeEntity(_0x5e8c44,_0x1e8450){return function(_0x342b9e){if(_0x342b9e){return _0x342b9e[_0xced3('0x20')]()['then'](function(){_0x5e8c44[_0xced3('0x15')](0xcc)[_0xced3('0x16')]();});}};}function handleEntityNotFound(_0x526854,_0x559fa2){return function(_0x3adf14){if(!_0x3adf14){_0x526854[_0xced3('0x14')](0x194);}return _0x3adf14;};}function handleError(_0x219fa8,_0x15c6c5){_0x15c6c5=_0x15c6c5||0x1f4;return function(_0x50f7c1){logger[_0xced3('0x21')](_0x50f7c1[_0xced3('0x22')]);if(_0x50f7c1['name']){delete _0x50f7c1[_0xced3('0x23')];}_0x219fa8['status'](_0x15c6c5)[_0xced3('0x24')](_0x50f7c1);};}exports[_0xced3('0x25')]=function(_0x3b728d,_0x23a570){var _0x2ec2c4={},_0x502cf1={},_0x5454c0={'count':0x0,'rows':[]};var _0x36b1fe=db['Cdr'][_0xced3('0x26')];_0x502cf1[_0xced3('0x27')]=_['keys'](_0x36b1fe);_0x502cf1[_0xced3('0x28')]=_[_0xced3('0x29')](_0x3b728d[_0xced3('0x28')]);_0x502cf1[_0xced3('0x2a')]=_[_0xced3('0x2b')](_0x502cf1[_0xced3('0x27')],_0x502cf1[_0xced3('0x28')]);_0x2ec2c4[_0xced3('0x2c')]=_[_0xced3('0x2b')](_0x502cf1['model'],qs[_0xced3('0x2d')](_0x3b728d[_0xced3('0x28')][_0xced3('0x2d')]));_0x2ec2c4[_0xced3('0x2c')]=_0x2ec2c4[_0xced3('0x2c')][_0xced3('0x2e')]?_0x2ec2c4[_0xced3('0x2c')]:_0x502cf1[_0xced3('0x27')];if(!_0x3b728d[_0xced3('0x28')][_0xced3('0x2f')](_0xced3('0x30'))){_0x2ec2c4[_0xced3('0x1a')]=qs[_0xced3('0x1a')](_0x3b728d[_0xced3('0x28')][_0xced3('0x1a')]);_0x2ec2c4[_0xced3('0x19')]=qs[_0xced3('0x19')](_0x3b728d[_0xced3('0x28')][_0xced3('0x19')]);}_0x2ec2c4[_0xced3('0x31')]=qs[_0xced3('0x32')](_0x3b728d['query'][_0xced3('0x32')]);_0x2ec2c4['where']=qs[_0xced3('0x2a')](_[_0xced3('0x33')](_0x3b728d[_0xced3('0x28')],_0x502cf1[_0xced3('0x2a')]));if(_0x3b728d[_0xced3('0x28')][_0xced3('0x34')]){_0x2ec2c4[_0xced3('0x35')]=_[_0xced3('0x36')](_0x2ec2c4[_0xced3('0x35')],{'$or':_[_0xced3('0x37')](_0x36b1fe,function(_0x5c290d){if(_0x5c290d[_0xced3('0x38')][_0xced3('0x39')]!=='VIRTUAL'){var _0x468c21={};_0x468c21[_0x5c290d[_0xced3('0x3a')]]={'$like':'%'+_0x3b728d[_0xced3('0x28')]['filter']+'%'};return _0x468c21;}})});}_0x2ec2c4=_['merge']({},_0x2ec2c4,_0x3b728d[_0xced3('0x3b')]);var _0x529d5e={'where':_0x2ec2c4[_0xced3('0x35')]};return db[_0xced3('0x3c')]['count'](_0x529d5e)[_0xced3('0x3d')](function(_0x15ca03){_0x5454c0[_0xced3('0x18')]=_0x15ca03;if(_0x3b728d['query'][_0xced3('0x3e')]){_0x2ec2c4['include']=[{'all':!![]}];}return db['Cdr'][_0xced3('0x3f')](_0x2ec2c4);})[_0xced3('0x3d')](function(_0x217bff){_0x5454c0['rows']=_0x217bff;return _0x5454c0;})[_0xced3('0x3d')](respondWithFilteredResult(_0x23a570,_0x2ec2c4))[_0xced3('0x40')](handleError(_0x23a570,null));};exports[_0xced3('0x41')]=function(_0x28626b,_0x28506e){var _0x2a8e0e={'raw':!![],'where':{'id':_0x28626b[_0xced3('0x42')]['id']}},_0x30e890={};_0x30e890[_0xced3('0x27')]=_[_0xced3('0x29')](db[_0xced3('0x3c')][_0xced3('0x26')]);_0x30e890[_0xced3('0x28')]=_[_0xced3('0x29')](_0x28626b[_0xced3('0x28')]);_0x30e890['filters']=_[_0xced3('0x2b')](_0x30e890[_0xced3('0x27')],_0x30e890[_0xced3('0x28')]);_0x2a8e0e[_0xced3('0x2c')]=_[_0xced3('0x2b')](_0x30e890[_0xced3('0x27')],qs[_0xced3('0x2d')](_0x28626b[_0xced3('0x28')][_0xced3('0x2d')]));_0x2a8e0e['attributes']=_0x2a8e0e[_0xced3('0x2c')]['length']?_0x2a8e0e[_0xced3('0x2c')]:_0x30e890[_0xced3('0x27')];if(_0x28626b[_0xced3('0x28')]['includeAll']){_0x2a8e0e[_0xced3('0x43')]=[{'all':!![]}];}_0x2a8e0e=_[_0xced3('0x36')]({},_0x2a8e0e,_0x28626b[_0xced3('0x3b')]);return db[_0xced3('0x3c')]['find'](_0x2a8e0e)[_0xced3('0x3d')](handleEntityNotFound(_0x28506e,null))[_0xced3('0x3d')](respondWithResult(_0x28506e,null))[_0xced3('0x40')](handleError(_0x28506e,null));};exports[_0xced3('0x44')]=function(_0x198aad,_0x563684){return db[_0xced3('0x3c')][_0xced3('0x44')](_0x198aad[_0xced3('0x45')],{})[_0xced3('0x3d')](respondWithResult(_0x563684,0xc9))[_0xced3('0x40')](handleError(_0x563684,null));};exports[_0xced3('0x1f')]=function(_0x3fa9fd,_0x532db9){if(_0x3fa9fd[_0xced3('0x45')]['id']){delete _0x3fa9fd[_0xced3('0x45')]['id'];}return db['Cdr']['find']({'where':{'id':_0x3fa9fd[_0xced3('0x42')]['id']}})['then'](handleEntityNotFound(_0x532db9,null))[_0xced3('0x3d')](saveUpdates(_0x3fa9fd[_0xced3('0x45')],null))[_0xced3('0x3d')](respondWithResult(_0x532db9,null))[_0xced3('0x40')](handleError(_0x532db9,null));};exports[_0xced3('0x20')]=function(_0x1b3396,_0x3700ed){return db[_0xced3('0x3c')][_0xced3('0x46')]({'where':{'id':_0x1b3396['params']['id']}})[_0xced3('0x3d')](handleEntityNotFound(_0x3700ed,null))[_0xced3('0x3d')](removeEntity(_0x3700ed,null))[_0xced3('0x40')](handleError(_0x3700ed,null));};exports[_0xced3('0x47')]=function(_0x24ee62,_0xe43a54){return db['Cdr'][_0xced3('0x47')]()[_0xced3('0x3d')](respondWithResult(_0xe43a54,null))[_0xced3('0x40')](handleError(_0xe43a54,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 393b044..6f98aaa 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 _0x7c09=['accountcode','calldate','disposition','dst','src','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','define','Cdr','cdr'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c09,0x102));var _0x97c0=function(_0x1dd330,_0x4d1788){_0x1dd330=_0x1dd330-0x0;var _0x4e20e8=_0x7c09[_0x1dd330];return _0x4e20e8;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var logger=require(_0x97c0('0x1'))('api');var moment=require(_0x97c0('0x2'));var BPromise=require(_0x97c0('0x3'));var rp=require(_0x97c0('0x4'));var fs=require('fs');var path=require(_0x97c0('0x5'));var rimraf=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var attributes=require(_0x97c0('0x8'));module['exports']=function(_0x4b2f81,_0x590368){return _0x4b2f81[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'paranoid':![],'indexes':[{'name':_0x97c0('0xc'),'fields':[_0x97c0('0xc')]},{'name':'calldate','fields':[_0x97c0('0xd')]},{'name':'disposition','fields':[_0x97c0('0xe')]},{'name':_0x97c0('0xf'),'fields':['dst']},{'name':'src','fields':[_0x97c0('0x10')]},{'name':_0x97c0('0x11'),'fields':[_0x97c0('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x3f8a=['define','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3ddbc4,_0xe5be24){var _0x4f51ff=function(_0xc9119b){while(--_0xc9119b){_0x3ddbc4['push'](_0x3ddbc4['shift']());}};_0x4f51ff(++_0xe5be24);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x549c56,_0xc02b6a){_0x549c56=_0x549c56-0x0;var _0x385a97=_0x3f8a[_0x549c56];return _0x385a97;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));module[_0xa3f8('0xa')]=function(_0x471464,_0x1f160a){return _0x471464[_0xa3f8('0xb')](_0xa3f8('0xc'),attributes,{'tableName':_0xa3f8('0xd'),'paranoid':![],'indexes':[{'name':_0xa3f8('0xe'),'fields':[_0xa3f8('0xe')]},{'name':_0xa3f8('0xf'),'fields':[_0xa3f8('0xf')]},{'name':_0xa3f8('0x10'),'fields':['disposition']},{'name':_0xa3f8('0x11'),'fields':[_0xa3f8('0x11')]},{'name':_0xa3f8('0x12'),'fields':[_0xa3f8('0x12')]},{'name':'uniqueid','fields':[_0xa3f8('0x13')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index f788368..09f351e 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 _0xd7c1=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result'];(function(_0x2e8d96,_0x5669f5){var _0x24cd84=function(_0x5ebe4b){while(--_0x5ebe4b){_0x2e8d96['push'](_0x2e8d96['shift']());}};_0x24cd84(++_0x5669f5);}(_0xd7c1,0x157));var _0x1d7c=function(_0x94d732,_0x288107){_0x94d732=_0x94d732-0x0;var _0x4cf3f9=_0xd7c1[_0x94d732];return _0x4cf3f9;};'use strict';var _=require(_0x1d7c('0x0'));var util=require(_0x1d7c('0x1'));var moment=require(_0x1d7c('0x2'));var BPromise=require(_0x1d7c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d7c('0x4'));var db=require(_0x1d7c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1d7c('0x6'));var jayson=require(_0x1d7c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1432bd,_0x26eaa3,_0x19555a){return new BPromise(function(_0x209be8,_0x5c0543){return client[_0x1d7c('0x8')](_0x1432bd,_0x19555a)[_0x1d7c('0x9')](function(_0x4d9541){logger[_0x1d7c('0xa')](_0x1d7c('0xb'),_0x26eaa3,'request\x20sent');logger[_0x1d7c('0xc')](_0x1d7c('0xd'),_0x26eaa3,_0x1d7c('0xe'),JSON['stringify'](_0x4d9541));if(_0x4d9541[_0x1d7c('0xf')]){if(_0x4d9541[_0x1d7c('0xf')]['code']===0x1f4){logger['error'](_0x1d7c('0xb'),_0x26eaa3,_0x4d9541['error'][_0x1d7c('0x10')]);return _0x5c0543(_0x4d9541[_0x1d7c('0xf')][_0x1d7c('0x10')]);}logger[_0x1d7c('0xf')](_0x1d7c('0xb'),_0x26eaa3,_0x4d9541[_0x1d7c('0xf')]['message']);return _0x209be8(_0x4d9541[_0x1d7c('0xf')][_0x1d7c('0x10')]);}else{logger[_0x1d7c('0xa')](_0x1d7c('0xb'),_0x26eaa3,_0x1d7c('0xe'));_0x209be8(_0x4d9541[_0x1d7c('0x11')][_0x1d7c('0x10')]);}})[_0x1d7c('0x12')](function(_0x1cfa3e){logger['error'](_0x1d7c('0xb'),_0x26eaa3,_0x1cfa3e);_0x5c0543(_0x1cfa3e);});});} \ No newline at end of file +var _0x57c0=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x50fda9,_0x5ee44b){var _0x36b92b=function(_0x121877){while(--_0x121877){_0x50fda9['push'](_0x50fda9['shift']());}};_0x36b92b(++_0x5ee44b);}(_0x57c0,0xaf));var _0x057c=function(_0x3513e2,_0x26f645){_0x3513e2=_0x3513e2-0x0;var _0x186e8f=_0x57c0[_0x3513e2];return _0x186e8f;};'use strict';var _=require(_0x057c('0x0'));var util=require(_0x057c('0x1'));var moment=require(_0x057c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x057c('0x3'));var db=require(_0x057c('0x4'))['db'];var utils=require(_0x057c('0x5'));var logger=require(_0x057c('0x6'))('rpc');var config=require(_0x057c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x057c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e44b6,_0x29b929,_0x159bbe){return new BPromise(function(_0x19e8e3,_0x5adf60){return client[_0x057c('0x9')](_0x4e44b6,_0x159bbe)[_0x057c('0xa')](function(_0x27e9bb){logger[_0x057c('0xb')](_0x057c('0xc'),_0x29b929,_0x057c('0xd'));logger[_0x057c('0xe')](_0x057c('0xf'),_0x29b929,_0x057c('0xd'),JSON[_0x057c('0x10')](_0x27e9bb));if(_0x27e9bb[_0x057c('0x11')]){if(_0x27e9bb[_0x057c('0x11')][_0x057c('0x12')]===0x1f4){logger[_0x057c('0x11')](_0x057c('0xc'),_0x29b929,_0x27e9bb['error'][_0x057c('0x13')]);return _0x5adf60(_0x27e9bb[_0x057c('0x11')][_0x057c('0x13')]);}logger['error'](_0x057c('0xc'),_0x29b929,_0x27e9bb[_0x057c('0x11')][_0x057c('0x13')]);return _0x19e8e3(_0x27e9bb[_0x057c('0x11')]['message']);}else{logger[_0x057c('0xb')](_0x057c('0xc'),_0x29b929,_0x057c('0xd'));_0x19e8e3(_0x27e9bb[_0x057c('0x14')]['message']);}})[_0x057c('0x15')](function(_0x2e3c6c){logger[_0x057c('0x11')](_0x057c('0xc'),_0x29b929,_0x2e3c6c);_0x5adf60(_0x2e3c6c);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 2c69761..d25893f 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 _0x4114=['path','connect-timeout','express','Router','../../components/interaction/service','./cdr.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x4dfd11,_0x21798c){var _0x3571a8=function(_0x1cdb23){while(--_0x1cdb23){_0x4dfd11['push'](_0x4dfd11['shift']());}};_0x3571a8(++_0x21798c);}(_0x4114,0xbb));var _0x4411=function(_0x18ea30,_0x492a14){_0x18ea30=_0x18ea30-0x0;var _0x566d74=_0x4114[_0x18ea30];return _0x566d74;};'use strict';var multer=require(_0x4411('0x0'));var util=require(_0x4411('0x1'));var path=require(_0x4411('0x2'));var timeout=require(_0x4411('0x3'));var express=require(_0x4411('0x4'));var router=express[_0x4411('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x4411('0x6'));var config=require('../../config/environment');var controller=require(_0x4411('0x7'));router[_0x4411('0x8')]('/',auth[_0x4411('0x9')](),controller[_0x4411('0xa')]);router[_0x4411('0x8')](_0x4411('0xb'),auth[_0x4411('0x9')](),controller[_0x4411('0xc')]);router['get'](_0x4411('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x4411('0xe')]('/',auth['isAuthenticated'](),controller[_0x4411('0xf')]);router[_0x4411('0x10')](_0x4411('0xd'),auth[_0x4411('0x9')](),controller[_0x4411('0x11')]);router[_0x4411('0x12')]('/:id',auth[_0x4411('0x9')](),controller[_0x4411('0x13')]);module[_0x4411('0x14')]=router; \ No newline at end of file +var _0x54d3=['put','destroy','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x61f651,_0x9e623a){var _0x57f9f6=function(_0x911115){while(--_0x911115){_0x61f651['push'](_0x61f651['shift']());}};_0x57f9f6(++_0x9e623a);}(_0x54d3,0x172));var _0x354d=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x54d3[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x354d('0x0'));var timeout=require(_0x354d('0x1'));var express=require('express');var router=express[_0x354d('0x2')]();var auth=require(_0x354d('0x3'));var interaction=require(_0x354d('0x4'));var config=require(_0x354d('0x5'));var controller=require(_0x354d('0x6'));router[_0x354d('0x7')]('/',auth[_0x354d('0x8')](),controller[_0x354d('0x9')]);router['get'](_0x354d('0xa'),auth['isAuthenticated'](),controller[_0x354d('0xb')]);router[_0x354d('0x7')](_0x354d('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x354d('0xd')]('/',auth[_0x354d('0x8')](),controller['create']);router[_0x354d('0xe')](_0x354d('0xc'),auth[_0x354d('0x8')](),controller['update']);router['delete'](_0x354d('0xc'),auth[_0x354d('0x8')](),controller[_0x354d('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index bcbd9af..a7eccc8 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 _0xd98c=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0xd98c,0x159));var _0xcd98=function(_0xebc64a,_0x440ee2){_0xebc64a=_0xebc64a-0x0;var _0x5131e1=_0xd98c[_0xebc64a];return _0x5131e1;};'use strict';var Sequelize=require(_0xcd98('0x0'));module[_0xcd98('0x1')]={'priority':{'type':Sequelize[_0xcd98('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xcd98('0x3')],'allowNull':![],'defaultValue':_0xcd98('0x4')},'appdata':{'type':Sequelize[_0xcd98('0x5')]()},'description':{'type':Sequelize[_0xcd98('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xcd98('0x6')}}; \ No newline at end of file +var _0xddbb=['noop','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x1aa363,_0x269429){var _0x2d8b1b=function(_0x19b2eb){while(--_0x19b2eb){_0x1aa363['push'](_0x1aa363['shift']());}};_0x2d8b1b(++_0x269429);}(_0xddbb,0x160));var _0xbddb=function(_0x3866b6,_0x4df2de){_0x3866b6=_0x3866b6-0x0;var _0x5103c8=_0xddbb[_0x3866b6];return _0x5103c8;};'use strict';var Sequelize=require(_0xbddb('0x0'));module['exports']={'priority':{'type':Sequelize[_0xbddb('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xbddb('0x2')],'allowNull':![],'defaultValue':_0xbddb('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbddb('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 690edd9..2c8be09 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 _0x5949=['mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','destroy','then','stack','name','send','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','options','ChatApplication','find','catch','body','params','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x37091d,_0x2fa386){var _0x460173=function(_0x4836db){while(--_0x4836db){_0x37091d['push'](_0x37091d['shift']());}};_0x460173(++_0x2fa386);}(_0x5949,0x10d));var _0x9594=function(_0x55969b,_0x1ebe62){_0x55969b=_0x55969b-0x0;var _0x3d7fc1=_0x5949[_0x55969b];return _0x3d7fc1;};'use strict';var pdf=require(_0x9594('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9594('0x1'));var jsonpatch=require(_0x9594('0x2'));var rp=require(_0x9594('0x3'));var moment=require(_0x9594('0x4'));var BPromise=require(_0x9594('0x5'));var Mustache=require(_0x9594('0x6'));var util=require('util');var path=require(_0x9594('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9594('0x8'));var fs=require('fs');var _=require(_0x9594('0x9'));var squel=require(_0x9594('0xa'));var crypto=require(_0x9594('0xb'));var jsforce=require(_0x9594('0xc'));var deskjs=require(_0x9594('0xd'));var toCsv=require(_0x9594('0xe'));var querystring=require(_0x9594('0xf'));var Papa=require(_0x9594('0x10'));var Redis=require('ioredis');var authService=require(_0x9594('0x11'));var qs=require(_0x9594('0x12'));var hardwareService=require(_0x9594('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x9594('0x14'));var config=require(_0x9594('0x15'));var db=require(_0x9594('0x16'))['db'];function respondWithStatusCode(_0x1a600b,_0xeba102){_0xeba102=_0xeba102||0xcc;return function(_0x583718){if(_0x583718){return _0x1a600b[_0x9594('0x17')](_0xeba102);}return _0x1a600b[_0x9594('0x18')](_0xeba102)[_0x9594('0x19')]();};}function respondWithResult(_0x37b96b,_0x29ff73){_0x29ff73=_0x29ff73||0xc8;return function(_0x3707fe){if(_0x3707fe){return _0x37b96b[_0x9594('0x18')](_0x29ff73)[_0x9594('0x1a')](_0x3707fe);}};}function respondWithFilteredResult(_0x4916d8,_0x143b05){return function(_0x58bd27){if(_0x58bd27){var _0x59cb15=_0x58bd27[_0x9594('0x1b')],_0x2b6cd9=_0x143b05[_0x9594('0x1c')],_0x22e385=_0x143b05[_0x9594('0x1c')]+_0x143b05[_0x9594('0x1d')],_0x3db0e4;if(_0x22e385>=_0x59cb15){_0x22e385=_0x59cb15;_0x3db0e4=0xc8;}else{_0x3db0e4=0xce;}_0x4916d8[_0x9594('0x18')](_0x3db0e4);return _0x4916d8['set'](_0x9594('0x1e'),_0x2b6cd9+'-'+_0x22e385+'/'+_0x59cb15)[_0x9594('0x1a')](_0x58bd27);}return null;};}function patchUpdates(_0x2cf4a9){return function(_0x4556bd){try{jsonpatch['apply'](_0x4556bd,_0x2cf4a9,!![]);}catch(_0x4aac73){return BPromise[_0x9594('0x1f')](_0x4aac73);}return _0x4556bd[_0x9594('0x20')]();};}function saveUpdates(_0x3933fa,_0x3c53e1){return function(_0x112579){if(_0x112579){return _0x112579[_0x9594('0x21')](_0x3933fa)['then'](function(_0x1704af){return _0x1704af;});}return null;};}function removeEntity(_0x3cf7a5,_0xe0fcca){return function(_0x5d63ad){if(_0x5d63ad){return _0x5d63ad[_0x9594('0x22')]()[_0x9594('0x23')](function(){_0x3cf7a5[_0x9594('0x18')](0xcc)[_0x9594('0x19')]();});}};}function handleEntityNotFound(_0x267562,_0x43f234){return function(_0x142c3e){if(!_0x142c3e){_0x267562[_0x9594('0x17')](0x194);}return _0x142c3e;};}function handleError(_0x8ef9e1,_0x3c52b9){_0x3c52b9=_0x3c52b9||0x1f4;return function(_0x3c82eb){logger['error'](_0x3c82eb[_0x9594('0x24')]);if(_0x3c82eb[_0x9594('0x25')]){delete _0x3c82eb['name'];}_0x8ef9e1[_0x9594('0x18')](_0x3c52b9)[_0x9594('0x26')](_0x3c82eb);};}exports['show']=function(_0x492f67,_0x3b355c){var _0x76626c={'raw':!![],'where':{'id':_0x492f67['params']['id']}},_0x351eed={};_0x351eed[_0x9594('0x27')]=_[_0x9594('0x28')](db['ChatApplication']['rawAttributes']);_0x351eed[_0x9594('0x29')]=_[_0x9594('0x28')](_0x492f67[_0x9594('0x29')]);_0x351eed[_0x9594('0x2a')]=_[_0x9594('0x2b')](_0x351eed[_0x9594('0x27')],_0x351eed[_0x9594('0x29')]);_0x76626c[_0x9594('0x2c')]=_[_0x9594('0x2b')](_0x351eed['model'],qs[_0x9594('0x2d')](_0x492f67['query']['fields']));_0x76626c[_0x9594('0x2c')]=_0x76626c[_0x9594('0x2c')][_0x9594('0x2e')]?_0x76626c[_0x9594('0x2c')]:_0x351eed['model'];if(_0x492f67[_0x9594('0x29')][_0x9594('0x2f')]){_0x76626c[_0x9594('0x30')]=[{'all':!![]}];}_0x76626c=_['merge']({},_0x76626c,_0x492f67[_0x9594('0x31')]);return db[_0x9594('0x32')][_0x9594('0x33')](_0x76626c)['then'](handleEntityNotFound(_0x3b355c,null))[_0x9594('0x23')](respondWithResult(_0x3b355c,null))[_0x9594('0x34')](handleError(_0x3b355c,null));};exports[_0x9594('0x21')]=function(_0x379c56,_0x30ca76){if(_0x379c56[_0x9594('0x35')]['id']){delete _0x379c56[_0x9594('0x35')]['id'];}return db[_0x9594('0x32')][_0x9594('0x33')]({'where':{'id':_0x379c56[_0x9594('0x36')]['id']}})[_0x9594('0x23')](handleEntityNotFound(_0x30ca76,null))['then'](saveUpdates(_0x379c56['body'],null))[_0x9594('0x23')](respondWithResult(_0x30ca76,null))['catch'](handleError(_0x30ca76,null));};exports[_0x9594('0x22')]=function(_0x4005dc,_0x2620e9){return db['ChatApplication'][_0x9594('0x33')]({'where':{'id':_0x4005dc['params']['id']}})[_0x9594('0x23')](handleEntityNotFound(_0x2620e9,null))['then'](removeEntity(_0x2620e9,null))[_0x9594('0x34')](handleError(_0x2620e9,null));}; \ No newline at end of file +var _0xf09d=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','error','stack','name','send','show','model','keys','rawAttributes','filters','intersection','query','attributes','length','include','merge','options','ChatApplication','find','then','catch','body','params','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x5deda9,_0xb06c05){var _0x453001=function(_0x35d17e){while(--_0x35d17e){_0x5deda9['push'](_0x5deda9['shift']());}};_0x453001(++_0xb06c05);}(_0xf09d,0x117));var _0xdf09=function(_0x31e2cd,_0x4c05ba){_0x31e2cd=_0x31e2cd-0x0;var _0x48af4e=_0xf09d[_0x31e2cd];return _0x48af4e;};'use strict';var pdf=require(_0xdf09('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdf09('0x1'));var jsonpatch=require(_0xdf09('0x2'));var rp=require(_0xdf09('0x3'));var moment=require(_0xdf09('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdf09('0x5'));var util=require('util');var path=require(_0xdf09('0x6'));var sox=require(_0xdf09('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xdf09('0x8'));var squel=require(_0xdf09('0x9'));var crypto=require(_0xdf09('0xa'));var jsforce=require(_0xdf09('0xb'));var deskjs=require(_0xdf09('0xc'));var toCsv=require(_0xdf09('0xd'));var querystring=require(_0xdf09('0xe'));var Papa=require(_0xdf09('0xf'));var Redis=require(_0xdf09('0x10'));var authService=require(_0xdf09('0x11'));var qs=require(_0xdf09('0x12'));var hardwareService=require(_0xdf09('0x13'));var logger=require(_0xdf09('0x14'))('api');var utils=require(_0xdf09('0x15'));var config=require(_0xdf09('0x16'));var db=require(_0xdf09('0x17'))['db'];function respondWithStatusCode(_0xb88400,_0x4c2c46){_0x4c2c46=_0x4c2c46||0xcc;return function(_0x1342dc){if(_0x1342dc){return _0xb88400[_0xdf09('0x18')](_0x4c2c46);}return _0xb88400['status'](_0x4c2c46)[_0xdf09('0x19')]();};}function respondWithResult(_0x32312b,_0x39fab8){_0x39fab8=_0x39fab8||0xc8;return function(_0x8c2051){if(_0x8c2051){return _0x32312b[_0xdf09('0x1a')](_0x39fab8)[_0xdf09('0x1b')](_0x8c2051);}};}function respondWithFilteredResult(_0x38a79c,_0x1e1d02){return function(_0x5f2150){if(_0x5f2150){var _0x2b777c=_0x5f2150[_0xdf09('0x1c')],_0x4a49a9=_0x1e1d02[_0xdf09('0x1d')],_0xb3512e=_0x1e1d02[_0xdf09('0x1d')]+_0x1e1d02[_0xdf09('0x1e')],_0x1f8a50;if(_0xb3512e>=_0x2b777c){_0xb3512e=_0x2b777c;_0x1f8a50=0xc8;}else{_0x1f8a50=0xce;}_0x38a79c[_0xdf09('0x1a')](_0x1f8a50);return _0x38a79c[_0xdf09('0x1f')](_0xdf09('0x20'),_0x4a49a9+'-'+_0xb3512e+'/'+_0x2b777c)['json'](_0x5f2150);}return null;};}function patchUpdates(_0x5ed791){return function(_0x4d7498){try{jsonpatch[_0xdf09('0x21')](_0x4d7498,_0x5ed791,!![]);}catch(_0x3a0918){return BPromise['reject'](_0x3a0918);}return _0x4d7498[_0xdf09('0x22')]();};}function saveUpdates(_0x59d7d5,_0x35b9f2){return function(_0x1c5a9d){if(_0x1c5a9d){return _0x1c5a9d[_0xdf09('0x23')](_0x59d7d5)['then'](function(_0x53d095){return _0x53d095;});}return null;};}function removeEntity(_0x391a5b,_0x341282){return function(_0x57270b){if(_0x57270b){return _0x57270b[_0xdf09('0x24')]()['then'](function(){_0x391a5b[_0xdf09('0x1a')](0xcc)[_0xdf09('0x19')]();});}};}function handleEntityNotFound(_0x35e3f2,_0x151de8){return function(_0x2d4e64){if(!_0x2d4e64){_0x35e3f2[_0xdf09('0x18')](0x194);}return _0x2d4e64;};}function handleError(_0x4a67fc,_0x5ddfc7){_0x5ddfc7=_0x5ddfc7||0x1f4;return function(_0x396e10){logger[_0xdf09('0x25')](_0x396e10[_0xdf09('0x26')]);if(_0x396e10[_0xdf09('0x27')]){delete _0x396e10['name'];}_0x4a67fc[_0xdf09('0x1a')](_0x5ddfc7)[_0xdf09('0x28')](_0x396e10);};}exports[_0xdf09('0x29')]=function(_0x11c035,_0x411698){var _0x2e554b={'raw':!![],'where':{'id':_0x11c035['params']['id']}},_0x42273f={};_0x42273f[_0xdf09('0x2a')]=_[_0xdf09('0x2b')](db['ChatApplication'][_0xdf09('0x2c')]);_0x42273f['query']=_[_0xdf09('0x2b')](_0x11c035['query']);_0x42273f[_0xdf09('0x2d')]=_[_0xdf09('0x2e')](_0x42273f[_0xdf09('0x2a')],_0x42273f[_0xdf09('0x2f')]);_0x2e554b[_0xdf09('0x30')]=_[_0xdf09('0x2e')](_0x42273f[_0xdf09('0x2a')],qs['fields'](_0x11c035[_0xdf09('0x2f')]['fields']));_0x2e554b[_0xdf09('0x30')]=_0x2e554b[_0xdf09('0x30')][_0xdf09('0x31')]?_0x2e554b[_0xdf09('0x30')]:_0x42273f['model'];if(_0x11c035[_0xdf09('0x2f')]['includeAll']){_0x2e554b[_0xdf09('0x32')]=[{'all':!![]}];}_0x2e554b=_[_0xdf09('0x33')]({},_0x2e554b,_0x11c035[_0xdf09('0x34')]);return db[_0xdf09('0x35')][_0xdf09('0x36')](_0x2e554b)[_0xdf09('0x37')](handleEntityNotFound(_0x411698,null))['then'](respondWithResult(_0x411698,null))[_0xdf09('0x38')](handleError(_0x411698,null));};exports[_0xdf09('0x23')]=function(_0x3bd916,_0x49139a){if(_0x3bd916['body']['id']){delete _0x3bd916[_0xdf09('0x39')]['id'];}return db['ChatApplication'][_0xdf09('0x36')]({'where':{'id':_0x3bd916[_0xdf09('0x3a')]['id']}})[_0xdf09('0x37')](handleEntityNotFound(_0x49139a,null))['then'](saveUpdates(_0x3bd916['body'],null))[_0xdf09('0x37')](respondWithResult(_0x49139a,null))['catch'](handleError(_0x49139a,null));};exports[_0xdf09('0x24')]=function(_0x5eddcd,_0x20ac1b){return db['ChatApplication']['find']({'where':{'id':_0x5eddcd[_0xdf09('0x3a')]['id']}})['then'](handleEntityNotFound(_0x20ac1b,null))[_0xdf09('0x37')](removeEntity(_0x20ac1b,null))[_0xdf09('0x38')](handleError(_0x20ac1b,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index f45bc4b..5d9851e 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_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 diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index c4cea06..d49da63 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 _0x7c39=['jayson/promise','client','http','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c39,0x86));var _0x97c3=function(_0x1087a7,_0xc20738){_0x1087a7=_0x1087a7-0x0;var _0x588955=_0x7c39[_0x1087a7];return _0x588955;};'use strict';var _=require(_0x97c3('0x0'));var util=require(_0x97c3('0x1'));var moment=require(_0x97c3('0x2'));var BPromise=require('bluebird');var rs=require(_0x97c3('0x3'));var fs=require('fs');var Redis=require(_0x97c3('0x4'));var db=require(_0x97c3('0x5'))['db'];var utils=require(_0x97c3('0x6'));var logger=require(_0x97c3('0x7'))(_0x97c3('0x8'));var config=require(_0x97c3('0x9'));var jayson=require(_0x97c3('0xa'));var client=jayson[_0x97c3('0xb')][_0x97c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20ce1f,_0x15db62,_0x24fc6a){return new BPromise(function(_0x3effb3,_0x5c129c){return client['request'](_0x20ce1f,_0x24fc6a)[_0x97c3('0xd')](function(_0x379fbc){logger[_0x97c3('0xe')](_0x97c3('0xf'),_0x15db62,_0x97c3('0x10'));logger[_0x97c3('0x11')](_0x97c3('0x12'),_0x15db62,_0x97c3('0x10'),JSON[_0x97c3('0x13')](_0x379fbc));if(_0x379fbc[_0x97c3('0x14')]){if(_0x379fbc[_0x97c3('0x14')][_0x97c3('0x15')]===0x1f4){logger[_0x97c3('0x14')]('ChatApplication,\x20%s,\x20%s',_0x15db62,_0x379fbc[_0x97c3('0x14')][_0x97c3('0x16')]);return _0x5c129c(_0x379fbc[_0x97c3('0x14')][_0x97c3('0x16')]);}logger[_0x97c3('0x14')](_0x97c3('0xf'),_0x15db62,_0x379fbc[_0x97c3('0x14')][_0x97c3('0x16')]);return _0x3effb3(_0x379fbc['error'][_0x97c3('0x16')]);}else{logger[_0x97c3('0xe')]('ChatApplication,\x20%s,\x20%s',_0x15db62,_0x97c3('0x10'));_0x3effb3(_0x379fbc['result'][_0x97c3('0x16')]);}})[_0x97c3('0x17')](function(_0xb8fe69){logger[_0x97c3('0x14')]('ChatApplication,\x20%s,\x20%s',_0x15db62,_0xb8fe69);_0x5c129c(_0xb8fe69);});});} \ No newline at end of file +var _0x5b09=['http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x2d9da8,_0x5d5072){var _0x57a29c=function(_0x2f562d){while(--_0x2f562d){_0x2d9da8['push'](_0x2d9da8['shift']());}};_0x57a29c(++_0x5d5072);}(_0x5b09,0x120));var _0x95b0=function(_0x882b83,_0x35ba15){_0x882b83=_0x882b83-0x0;var _0x2ca999=_0x5b09[_0x882b83];return _0x2ca999;};'use strict';var _=require(_0x95b0('0x0'));var util=require(_0x95b0('0x1'));var moment=require(_0x95b0('0x2'));var BPromise=require(_0x95b0('0x3'));var rs=require(_0x95b0('0x4'));var fs=require('fs');var Redis=require(_0x95b0('0x5'));var db=require(_0x95b0('0x6'))['db'];var utils=require(_0x95b0('0x7'));var logger=require(_0x95b0('0x8'))(_0x95b0('0x9'));var config=require(_0x95b0('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x95b0('0xb')][_0x95b0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ac9a9,_0x1fd7d5,_0x4f75a4){return new BPromise(function(_0x296f91,_0x36d5d2){return client[_0x95b0('0xd')](_0x2ac9a9,_0x4f75a4)[_0x95b0('0xe')](function(_0xe58d25){logger[_0x95b0('0xf')](_0x95b0('0x10'),_0x1fd7d5,_0x95b0('0x11'));logger[_0x95b0('0x12')](_0x95b0('0x13'),_0x1fd7d5,_0x95b0('0x11'),JSON[_0x95b0('0x14')](_0xe58d25));if(_0xe58d25['error']){if(_0xe58d25[_0x95b0('0x15')]['code']===0x1f4){logger[_0x95b0('0x15')](_0x95b0('0x10'),_0x1fd7d5,_0xe58d25[_0x95b0('0x15')]['message']);return _0x36d5d2(_0xe58d25[_0x95b0('0x15')][_0x95b0('0x16')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x1fd7d5,_0xe58d25[_0x95b0('0x15')][_0x95b0('0x16')]);return _0x296f91(_0xe58d25[_0x95b0('0x15')]['message']);}else{logger[_0x95b0('0xf')]('ChatApplication,\x20%s,\x20%s',_0x1fd7d5,_0x95b0('0x11'));_0x296f91(_0xe58d25[_0x95b0('0x17')][_0x95b0('0x16')]);}})[_0x95b0('0x18')](function(_0x3dfb41){logger[_0x95b0('0x15')](_0x95b0('0x10'),_0x1fd7d5,_0x3dfb41);_0x36d5d2(_0x3dfb41);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index cb1b182..54a5297 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 _0xc22f=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x2b55b5,_0x78505e){var _0x103d28=function(_0x5095a2){while(--_0x5095a2){_0x2b55b5['push'](_0x2b55b5['shift']());}};_0x103d28(++_0x78505e);}(_0xc22f,0x19b));var _0xfc22=function(_0xa5f8d0,_0x513eb0){_0xa5f8d0=_0xa5f8d0-0x0;var _0x8bc0ac=_0xc22f[_0xa5f8d0];return _0x8bc0ac;};'use strict';var multer=require(_0xfc22('0x0'));var util=require(_0xfc22('0x1'));var path=require(_0xfc22('0x2'));var timeout=require(_0xfc22('0x3'));var express=require(_0xfc22('0x4'));var router=express[_0xfc22('0x5')]();var auth=require(_0xfc22('0x6'));var interaction=require(_0xfc22('0x7'));var config=require(_0xfc22('0x8'));var controller=require(_0xfc22('0x9'));router[_0xfc22('0xa')]('/:id',auth[_0xfc22('0xb')](),controller['show']);router[_0xfc22('0xc')](_0xfc22('0xd'),auth[_0xfc22('0xb')](),controller[_0xfc22('0xe')]);router[_0xfc22('0xf')](_0xfc22('0xd'),auth['isAuthenticated'](),controller[_0xfc22('0x10')]);module[_0xfc22('0x11')]=router; \ No newline at end of file +var _0xa07a=['show','put','isAuthenticated','delete','util','path','connect-timeout','express','Router','../../components/auth/service','get','/:id'];(function(_0x25e11f,_0x4b05b1){var _0x3dbc3c=function(_0x240edf){while(--_0x240edf){_0x25e11f['push'](_0x25e11f['shift']());}};_0x3dbc3c(++_0x4b05b1);}(_0xa07a,0x118));var _0xaa07=function(_0x56e676,_0x3401ed){_0x56e676=_0x56e676-0x0;var _0x335ec8=_0xa07a[_0x56e676];return _0x335ec8;};'use strict';var multer=require('multer');var util=require(_0xaa07('0x0'));var path=require(_0xaa07('0x1'));var timeout=require(_0xaa07('0x2'));var express=require(_0xaa07('0x3'));var router=express[_0xaa07('0x4')]();var auth=require(_0xaa07('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0xaa07('0x6')](_0xaa07('0x7'),auth['isAuthenticated'](),controller[_0xaa07('0x8')]);router[_0xaa07('0x9')](_0xaa07('0x7'),auth[_0xaa07('0xa')](),controller['update']);router[_0xaa07('0xb')](_0xaa07('0x7'),auth[_0xaa07('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index c6cd7ed..e65f944 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 _0x13aa=['STRING','sequelize','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x13aa,0x193));var _0xa13a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x13aa[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xa13a('0x0'));module[_0xa13a('0x1')]={'name':{'type':Sequelize[_0xa13a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa13a('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xa663=['STRING','BOOLEAN'];(function(_0x41cdde,_0x4bd78c){var _0x2dec1e=function(_0xc4e978){while(--_0xc4e978){_0x41cdde['push'](_0x41cdde['shift']());}};_0x2dec1e(++_0x4bd78c);}(_0xa663,0x124));var _0x3a66=function(_0x299ecf,_0x5e642b){_0x299ecf=_0x299ecf-0x0;var _0x4813c9=_0xa663[_0x299ecf];return _0x4813c9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3a66('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x3a66('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index fe8d840..6a6d0a6 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 _0x8826=['create','body','update','describe','getUnread','ChatInternalMessage','addMembers','ids','omit','findOne','User','order','filter','getMembers','removeMembers','addMessage','ChatGroupId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','nolimit','getMessages','eml-format','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatGroup.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','ChatGroup','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','map','type','key','VIRTUAL','field','merge','options','includeAll','rows','catch','show','params','find'];(function(_0x4f9b3a,_0x4b31a2){var _0x10cb16=function(_0x4b156f){while(--_0x4b156f){_0x4f9b3a['push'](_0x4f9b3a['shift']());}};_0x10cb16(++_0x4b31a2);}(_0x8826,0x1c2));var _0x6882=function(_0x153550,_0x35269e){_0x153550=_0x153550-0x0;var _0x238f35=_0x8826[_0x153550];return _0x238f35;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6882('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6882('0x1'));var jsonpatch=require(_0x6882('0x2'));var rp=require('request-promise');var moment=require(_0x6882('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6882('0x4'));var sox=require(_0x6882('0x5'));var csv=require(_0x6882('0x6'));var ejs=require(_0x6882('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6882('0x8'));var crypto=require(_0x6882('0x9'));var jsforce=require(_0x6882('0xa'));var deskjs=require(_0x6882('0xb'));var toCsv=require(_0x6882('0x6'));var querystring=require(_0x6882('0xc'));var Papa=require(_0x6882('0xd'));var Redis=require(_0x6882('0xe'));var authService=require(_0x6882('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6882('0x10'))(_0x6882('0x11'));var utils=require('../../config/utils');var config=require(_0x6882('0x12'));var db=require(_0x6882('0x13'))['db'];config[_0x6882('0x14')]=_['defaults'](config['redis'],{'host':_0x6882('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6882('0x16'))[_0x6882('0x17')](socket);var jayson=require(_0x6882('0x18'));var client=jayson[_0x6882('0x19')][_0x6882('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x27f8ce,_0x494a2b,_0x1d7f14){if(_0x1d7f14){var _0x1d74b4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d74b4[_0x6882('0x1b')](_0x494a2b)){return _0x27f8ce;}else{throw new Error(_0x6882('0x1c'));}}else{return _0x27f8ce;}}function respondWithRpcPromise(_0x11d2bb,_0xf5492b,_0x490af3,_0x460111){return new BPromise(function(_0xaa8733,_0x20d8e1){var _0x14f29e=_0x460111||client;return _0x14f29e[_0x6882('0x1d')](_0x11d2bb,_0x490af3)['then'](function(_0xd76023){logger[_0x6882('0x1e')]('ChatGroup,\x20%s,\x20%s',_0xf5492b,_0x6882('0x1f'));logger[_0x6882('0x20')](_0x6882('0x21'),_0xf5492b,_0x6882('0x1f'),JSON[_0x6882('0x22')](_0xd76023));if(_0xd76023['error']){if(_0xd76023[_0x6882('0x23')][_0x6882('0x24')]===0x1f4){logger[_0x6882('0x23')]('ChatGroup,\x20%s,\x20%s',_0xf5492b,_0xd76023[_0x6882('0x23')][_0x6882('0x25')]);return _0x20d8e1(_0xd76023[_0x6882('0x23')][_0x6882('0x25')]);}logger[_0x6882('0x23')](_0x6882('0x26'),_0xf5492b,_0xd76023[_0x6882('0x23')][_0x6882('0x25')]);return _0xaa8733(_0xd76023['error']['message']);}else{logger[_0x6882('0x1e')](_0x6882('0x26'),_0xf5492b,_0x6882('0x1f'));_0xaa8733(_0xd76023[_0x6882('0x27')][_0x6882('0x25')]);}})['catch'](function(_0x32cc67){logger[_0x6882('0x23')]('ChatGroup,\x20%s,\x20%s',_0xf5492b,_0x32cc67);_0x20d8e1(_0x32cc67);});});}function respondWithStatusCode(_0xfda584,_0x369f89){_0x369f89=_0x369f89||0xcc;return function(_0x298569){if(_0x298569){return _0xfda584[_0x6882('0x28')](_0x369f89);}return _0xfda584[_0x6882('0x29')](_0x369f89)[_0x6882('0x2a')]();};}function respondWithResult(_0x4d9363,_0x462bcf){_0x462bcf=_0x462bcf||0xc8;return function(_0x566d02){if(_0x566d02){return _0x4d9363['status'](_0x462bcf)[_0x6882('0x2b')](_0x566d02);}};}function respondWithFilteredResult(_0x543923,_0x2d4165){return function(_0x39125d){if(_0x39125d){var _0x419c26=_0x39125d[_0x6882('0x2c')],_0x1cb3e3=_0x2d4165['offset'],_0x5eac95=_0x2d4165[_0x6882('0x2d')]+_0x2d4165[_0x6882('0x2e')],_0x2b4181;if(_0x5eac95>=_0x419c26){_0x5eac95=_0x419c26;_0x2b4181=0xc8;}else{_0x2b4181=0xce;}_0x543923[_0x6882('0x29')](_0x2b4181);return _0x543923[_0x6882('0x2f')](_0x6882('0x30'),_0x1cb3e3+'-'+_0x5eac95+'/'+_0x419c26)[_0x6882('0x2b')](_0x39125d);}return null;};}function patchUpdates(_0x200383){return function(_0x84b12){try{jsonpatch[_0x6882('0x31')](_0x84b12,_0x200383,!![]);}catch(_0x3c72b3){return BPromise[_0x6882('0x32')](_0x3c72b3);}return _0x84b12[_0x6882('0x33')]();};}function saveUpdates(_0x15290f,_0x32eafd){return function(_0x3f3ac8){if(_0x3f3ac8){return _0x3f3ac8['update'](_0x15290f)['then'](function(_0xc385de){return _0xc385de;});}return null;};}function removeEntity(_0x534e3b,_0x3a11e0){return function(_0x3850eb){if(_0x3850eb){return _0x3850eb[_0x6882('0x34')]()[_0x6882('0x35')](function(){_0x534e3b['status'](0xcc)[_0x6882('0x2a')]();});}};}function handleEntityNotFound(_0x488ecd,_0x5cc7b4){return function(_0xaca3b4){if(!_0xaca3b4){_0x488ecd[_0x6882('0x28')](0x194);}return _0xaca3b4;};}function handleError(_0x30612c,_0x24af8d){_0x24af8d=_0x24af8d||0x1f4;return function(_0x89632b){logger[_0x6882('0x23')](_0x89632b[_0x6882('0x36')]);if(_0x89632b[_0x6882('0x37')]){delete _0x89632b[_0x6882('0x37')];}_0x30612c[_0x6882('0x29')](_0x24af8d)[_0x6882('0x38')](_0x89632b);};}exports[_0x6882('0x39')]=function(_0x24a4ea,_0x4c1b2c){var _0x47744c={},_0x54c55a={},_0x17889c={'count':0x0,'rows':[]};var _0x48c51a=db[_0x6882('0x3a')][_0x6882('0x3b')];_0x54c55a['model']=_['keys'](_0x48c51a);_0x54c55a[_0x6882('0x3c')]=_[_0x6882('0x3d')](_0x24a4ea['query']);_0x54c55a[_0x6882('0x3e')]=_[_0x6882('0x3f')](_0x54c55a[_0x6882('0x40')],_0x54c55a['query']);_0x47744c[_0x6882('0x41')]=_[_0x6882('0x3f')](_0x54c55a['model'],qs[_0x6882('0x42')](_0x24a4ea[_0x6882('0x3c')]['fields']));_0x47744c[_0x6882('0x41')]=_0x47744c[_0x6882('0x41')][_0x6882('0x43')]?_0x47744c['attributes']:_0x54c55a['model'];if(!_0x24a4ea[_0x6882('0x3c')][_0x6882('0x44')]('nolimit')){_0x47744c[_0x6882('0x2e')]=qs[_0x6882('0x2e')](_0x24a4ea[_0x6882('0x3c')]['limit']);_0x47744c[_0x6882('0x2d')]=qs[_0x6882('0x2d')](_0x24a4ea[_0x6882('0x3c')]['offset']);}_0x47744c['order']=qs[_0x6882('0x45')](_0x24a4ea[_0x6882('0x3c')][_0x6882('0x45')]);_0x47744c[_0x6882('0x46')]=qs[_0x6882('0x3e')](_[_0x6882('0x47')](_0x24a4ea[_0x6882('0x3c')],_0x54c55a[_0x6882('0x3e')]));if(_0x24a4ea[_0x6882('0x3c')]['filter']){_0x47744c['where']=_['merge'](_0x47744c['where'],{'$or':_[_0x6882('0x48')](_0x48c51a,function(_0x22dbc6){if(_0x22dbc6[_0x6882('0x49')][_0x6882('0x4a')]!==_0x6882('0x4b')){var _0x3358e5={};_0x3358e5[_0x22dbc6[_0x6882('0x4c')]]={'$like':'%'+_0x24a4ea[_0x6882('0x3c')]['filter']+'%'};return _0x3358e5;}})});}_0x47744c=_[_0x6882('0x4d')]({},_0x47744c,_0x24a4ea[_0x6882('0x4e')]);var _0x99e916={'where':_0x47744c['where']};return db[_0x6882('0x3a')][_0x6882('0x2c')](_0x99e916)[_0x6882('0x35')](function(_0x2dbb31){_0x17889c[_0x6882('0x2c')]=_0x2dbb31;if(_0x24a4ea['query'][_0x6882('0x4f')]){_0x47744c['include']=[{'all':!![]}];}return db[_0x6882('0x3a')]['findAll'](_0x47744c);})[_0x6882('0x35')](function(_0x34f2a4){_0x17889c[_0x6882('0x50')]=_0x34f2a4;return _0x17889c;})[_0x6882('0x35')](respondWithFilteredResult(_0x4c1b2c,_0x47744c))[_0x6882('0x51')](handleError(_0x4c1b2c,null));};exports[_0x6882('0x52')]=function(_0x42b93d,_0x82e4fb){var _0x5505ef={'raw':!![],'where':{'id':_0x42b93d[_0x6882('0x53')]['id']}},_0x28e7b3={};_0x28e7b3[_0x6882('0x40')]=_['keys'](db[_0x6882('0x3a')][_0x6882('0x3b')]);_0x28e7b3['query']=_[_0x6882('0x3d')](_0x42b93d['query']);_0x28e7b3[_0x6882('0x3e')]=_[_0x6882('0x3f')](_0x28e7b3['model'],_0x28e7b3[_0x6882('0x3c')]);_0x5505ef[_0x6882('0x41')]=_[_0x6882('0x3f')](_0x28e7b3['model'],qs[_0x6882('0x42')](_0x42b93d[_0x6882('0x3c')][_0x6882('0x42')]));_0x5505ef[_0x6882('0x41')]=_0x5505ef[_0x6882('0x41')][_0x6882('0x43')]?_0x5505ef[_0x6882('0x41')]:_0x28e7b3[_0x6882('0x40')];if(_0x42b93d[_0x6882('0x3c')]['includeAll']){_0x5505ef['include']=[{'all':!![]}];}_0x5505ef=_[_0x6882('0x4d')]({},_0x5505ef,_0x42b93d[_0x6882('0x4e')]);return db[_0x6882('0x3a')][_0x6882('0x54')](_0x5505ef)[_0x6882('0x35')](handleEntityNotFound(_0x82e4fb,null))[_0x6882('0x35')](respondWithResult(_0x82e4fb,null))[_0x6882('0x51')](handleError(_0x82e4fb,null));};exports[_0x6882('0x55')]=function(_0x4f6262,_0x3d271b){return db[_0x6882('0x3a')]['create'](_0x4f6262[_0x6882('0x56')],{})[_0x6882('0x35')](respondWithResult(_0x3d271b,0xc9))['catch'](handleError(_0x3d271b,null));};exports[_0x6882('0x57')]=function(_0x5dea91,_0x5e815f){if(_0x5dea91[_0x6882('0x56')]['id']){delete _0x5dea91[_0x6882('0x56')]['id'];}return db['ChatGroup'][_0x6882('0x54')]({'where':{'id':_0x5dea91[_0x6882('0x53')]['id']}})[_0x6882('0x35')](handleEntityNotFound(_0x5e815f,null))['then'](saveUpdates(_0x5dea91[_0x6882('0x56')],null))[_0x6882('0x35')](respondWithResult(_0x5e815f,null))[_0x6882('0x51')](handleError(_0x5e815f,null));};exports['destroy']=function(_0x175278,_0x5b7bf4){return db[_0x6882('0x3a')][_0x6882('0x54')]({'where':{'id':_0x175278[_0x6882('0x53')]['id']}})[_0x6882('0x35')](handleEntityNotFound(_0x5b7bf4,null))['then'](removeEntity(_0x5b7bf4,null))[_0x6882('0x51')](handleError(_0x5b7bf4,null));};exports[_0x6882('0x58')]=function(_0x56475e,_0x5a90b6){return db[_0x6882('0x3a')]['describe']()['then'](respondWithResult(_0x5a90b6,null))['catch'](handleError(_0x5a90b6,null));};exports[_0x6882('0x59')]=function(_0x5a1a9a,_0x4596b2,_0x1d8e4){return db[_0x6882('0x5a')][_0x6882('0x2c')]({'where':{'ChatGroupId':_0x5a1a9a[_0x6882('0x53')]['id'],'ToId':_0x5a1a9a['user']['id'],'read':![]}})['then'](function(_0x52417){return{'id':_['toInteger'](_0x5a1a9a['params']['id']),'count':_0x52417};})[_0x6882('0x35')](respondWithResult(_0x4596b2,null))[_0x6882('0x51')](handleError(_0x4596b2,null));};exports['addMembers']=function(_0x536ffb,_0x344f9b,_0x31f9ed){return db['ChatGroup']['find']({'where':{'id':_0x536ffb[_0x6882('0x53')]['id']}})['then'](handleEntityNotFound(_0x344f9b,null))[_0x6882('0x35')](function(_0x283b1f){if(_0x283b1f){return _0x283b1f[_0x6882('0x5b')](_0x536ffb['body'][_0x6882('0x5c')],_[_0x6882('0x5d')](_0x536ffb[_0x6882('0x56')],[_0x6882('0x5c'),'id'])||{});}})[_0x6882('0x35')](respondWithResult(_0x344f9b,null))[_0x6882('0x51')](handleError(_0x344f9b,null));};exports['getMembers']=function(_0x47cb4a,_0x148a3d,_0x388248){var _0x3db440={};var _0xcbb096={};var _0x199f41;var _0x5efda8;return db[_0x6882('0x3a')][_0x6882('0x5e')]({'where':{'id':_0x47cb4a[_0x6882('0x53')]['id']}})['then'](handleEntityNotFound(_0x148a3d,null))[_0x6882('0x35')](function(_0x1877e4){if(_0x1877e4){_0x199f41=_0x1877e4;_0xcbb096['model']=_['keys'](db[_0x6882('0x5f')]['rawAttributes']);_0xcbb096[_0x6882('0x3c')]=_[_0x6882('0x3d')](_0x47cb4a[_0x6882('0x3c')]);_0xcbb096[_0x6882('0x3e')]=_[_0x6882('0x3f')](_0xcbb096[_0x6882('0x40')],_0xcbb096[_0x6882('0x3c')]);_0x3db440['attributes']=_[_0x6882('0x3f')](_0xcbb096[_0x6882('0x40')],qs[_0x6882('0x42')](_0x47cb4a[_0x6882('0x3c')][_0x6882('0x42')]));_0x3db440[_0x6882('0x41')]=_0x3db440['attributes'][_0x6882('0x43')]?_0x3db440['attributes']:_0xcbb096[_0x6882('0x40')];_0x3db440[_0x6882('0x60')]=qs['sort'](_0x47cb4a[_0x6882('0x3c')][_0x6882('0x45')]);_0x3db440[_0x6882('0x46')]=qs[_0x6882('0x3e')](_['pick'](_0x47cb4a[_0x6882('0x3c')],_0xcbb096[_0x6882('0x3e')]));if(_0x47cb4a[_0x6882('0x3c')][_0x6882('0x61')]){_0x3db440[_0x6882('0x46')]=_[_0x6882('0x4d')](_0x3db440['where'],{'$or':_[_0x6882('0x48')](_0x3db440[_0x6882('0x41')],function(_0x55a5c9){var _0x29b3cc={};_0x29b3cc[_0x55a5c9]={'$like':'%'+_0x47cb4a[_0x6882('0x3c')]['filter']+'%'};return _0x29b3cc;})});}_0x3db440=_[_0x6882('0x4d')]({},_0x3db440,_0x47cb4a[_0x6882('0x4e')]);return _0x199f41[_0x6882('0x62')](_0x3db440);}})[_0x6882('0x35')](function(_0x32646d){if(_0x32646d){_0x5efda8=_0x32646d['length'];if(!_0x47cb4a['query'][_0x6882('0x44')]('nolimit')){_0x3db440[_0x6882('0x2e')]=qs[_0x6882('0x2e')](_0x47cb4a[_0x6882('0x3c')][_0x6882('0x2e')]);_0x3db440[_0x6882('0x2d')]=qs[_0x6882('0x2d')](_0x47cb4a['query'][_0x6882('0x2d')]);}return _0x199f41['getMembers'](_0x3db440);}})[_0x6882('0x35')](function(_0x51316b){if(_0x51316b){return _0x51316b?{'count':_0x5efda8,'rows':_0x51316b}:null;}})['then'](respondWithResult(_0x148a3d,null))[_0x6882('0x51')](handleError(_0x148a3d,null));};exports[_0x6882('0x63')]=function(_0x4cd707,_0x1335d9,_0x3541a3){return db[_0x6882('0x3a')][_0x6882('0x54')]({'where':{'id':_0x4cd707[_0x6882('0x53')]['id']}})[_0x6882('0x35')](handleEntityNotFound(_0x1335d9,null))[_0x6882('0x35')](function(_0x3bb357){if(_0x3bb357){return _0x3bb357[_0x6882('0x63')](_0x4cd707[_0x6882('0x3c')]['ids']);}})[_0x6882('0x35')](respondWithStatusCode(_0x1335d9,null))[_0x6882('0x51')](handleError(_0x1335d9,null));};exports[_0x6882('0x64')]=function(_0x1282de,_0x26b0ca,_0x316b11){if(_0x1282de[_0x6882('0x56')]['id']){delete _0x1282de[_0x6882('0x56')]['id'];}return db['ChatGroup'][_0x6882('0x54')]({'where':{'id':_0x1282de[_0x6882('0x53')]['id']}})[_0x6882('0x35')](handleEntityNotFound(_0x26b0ca,null))[_0x6882('0x35')](function(_0x2e9160){if(_0x2e9160){_0x1282de[_0x6882('0x56')][_0x6882('0x65')]=_0x2e9160['id'];return db[_0x6882('0x5a')]['create'](_0x1282de[_0x6882('0x56')]);}})['then'](respondWithResult(_0x26b0ca,null))['catch'](handleError(_0x26b0ca,null));};exports['getMessages']=function(_0x15fada,_0x40927f,_0x9ac856){var _0x2d5564={};var _0x554731={};var _0x1bf5b2;var _0x3c1b80;return db[_0x6882('0x3a')][_0x6882('0x5e')]({'where':{'id':_0x15fada[_0x6882('0x53')]['id']}})[_0x6882('0x35')](handleEntityNotFound(_0x40927f,null))['then'](function(_0x1975f3){if(_0x1975f3){_0x1bf5b2=_0x1975f3;_0x554731[_0x6882('0x40')]=_[_0x6882('0x3d')](db['ChatInternalMessage']['rawAttributes']);_0x554731[_0x6882('0x3c')]=_['keys'](_0x15fada[_0x6882('0x3c')]);_0x554731[_0x6882('0x3e')]=_['intersection'](_0x554731['model'],_0x554731[_0x6882('0x3c')]);_0x2d5564[_0x6882('0x41')]=_['intersection'](_0x554731[_0x6882('0x40')],qs[_0x6882('0x42')](_0x15fada[_0x6882('0x3c')][_0x6882('0x42')]));_0x2d5564[_0x6882('0x41')]=_0x2d5564[_0x6882('0x41')][_0x6882('0x43')]?_0x2d5564[_0x6882('0x41')]:_0x554731[_0x6882('0x40')];_0x2d5564[_0x6882('0x60')]=qs[_0x6882('0x45')](_0x15fada[_0x6882('0x3c')][_0x6882('0x45')]);_0x2d5564[_0x6882('0x46')]=qs[_0x6882('0x3e')](_[_0x6882('0x47')](_0x15fada[_0x6882('0x3c')],_0x554731[_0x6882('0x3e')]));if(_0x15fada['query'][_0x6882('0x61')]){_0x2d5564['where']=_[_0x6882('0x4d')](_0x2d5564[_0x6882('0x46')],{'$or':_[_0x6882('0x48')](_0x2d5564[_0x6882('0x41')],function(_0x391aad){var _0x3aa43a={};_0x3aa43a[_0x391aad]={'$like':'%'+_0x15fada[_0x6882('0x3c')][_0x6882('0x61')]+'%'};return _0x3aa43a;})});}if(_0x15fada[_0x6882('0x3c')][_0x6882('0x66')]){var _0xee3e69=_0x15fada['query'][_0x6882('0x66')]['split'](',');var _0x249ed9={};_0x249ed9[_0xee3e69[0x0]]={'$gte':moment(_0xee3e69[0x1])[_0x6882('0x67')](_0x6882('0x68'))};_0x2d5564[_0x6882('0x46')]=_[_0x6882('0x4d')](_0x2d5564[_0x6882('0x46')],_0x249ed9);}_0x2d5564=_['merge']({},_0x2d5564,_0x15fada['options']);return _0x1bf5b2['getMessages'](_0x2d5564);}})[_0x6882('0x35')](function(_0x55ce43){if(_0x55ce43){_0x3c1b80=_0x55ce43[_0x6882('0x43')];if(!_0x15fada[_0x6882('0x3c')][_0x6882('0x44')](_0x6882('0x69'))){_0x2d5564[_0x6882('0x2e')]=qs[_0x6882('0x2e')](_0x15fada[_0x6882('0x3c')][_0x6882('0x2e')]);_0x2d5564[_0x6882('0x2d')]=qs[_0x6882('0x2d')](_0x15fada[_0x6882('0x3c')][_0x6882('0x2d')]);}return _0x1bf5b2[_0x6882('0x6a')](_0x2d5564);}})[_0x6882('0x35')](function(_0x5abe6f){if(_0x5abe6f){return _0x5abe6f?{'count':_0x3c1b80,'rows':_0x5abe6f}:null;}})['then'](respondWithResult(_0x40927f,null))[_0x6882('0x51')](handleError(_0x40927f,null));}; \ No newline at end of file +var _0x76cb=['include','options','find','catch','create','update','body','describe','getUnread','user','toInteger','addMembers','ids','omit','findOne','User','getMembers','removeMembers','ChatGroupId','ChatInternalMessage','$gte','split','format','getMessages','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','http','test','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','json','count','offset','limit','set','apply','reject','then','destroy','end','stack','index','ChatGroup','rawAttributes','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','key','VIRTUAL','merge','includeAll','findAll','show','params','keys','length'];(function(_0x47aebe,_0x81a31d){var _0x8606ea=function(_0x4433d5){while(--_0x4433d5){_0x47aebe['push'](_0x47aebe['shift']());}};_0x8606ea(++_0x81a31d);}(_0x76cb,0x80));var _0xb76c=function(_0xb6e2ea,_0x3b26e9){_0xb6e2ea=_0xb6e2ea-0x0;var _0x2a57bb=_0x76cb[_0xb6e2ea];return _0x2a57bb;};'use strict';var pdf=require(_0xb76c('0x0'));var emlformat=require(_0xb76c('0x1'));var rimraf=require(_0xb76c('0x2'));var zipdir=require(_0xb76c('0x3'));var jsonpatch=require(_0xb76c('0x4'));var rp=require(_0xb76c('0x5'));var moment=require(_0xb76c('0x6'));var BPromise=require(_0xb76c('0x7'));var Mustache=require(_0xb76c('0x8'));var util=require(_0xb76c('0x9'));var path=require(_0xb76c('0xa'));var sox=require(_0xb76c('0xb'));var csv=require(_0xb76c('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb76c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb76c('0xc'));var querystring=require(_0xb76c('0xe'));var Papa=require(_0xb76c('0xf'));var Redis=require(_0xb76c('0x10'));var authService=require(_0xb76c('0x11'));var qs=require(_0xb76c('0x12'));var hardwareService=require(_0xb76c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xb76c('0x14'));var config=require(_0xb76c('0x15'));var db=require(_0xb76c('0x16'))['db'];config[_0xb76c('0x17')]=_[_0xb76c('0x18')](config[_0xb76c('0x17')],{'host':_0xb76c('0x19'),'port':0x18eb});var socket=require(_0xb76c('0x1a'))(new Redis(config[_0xb76c('0x17')]));require(_0xb76c('0x1b'))[_0xb76c('0x1c')](socket);var jayson=require(_0xb76c('0x1d'));var client=jayson[_0xb76c('0x1e')][_0xb76c('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x2ac10c,_0x2b8c91,_0x3182ce){if(_0x3182ce){var _0x5b1ef7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5b1ef7[_0xb76c('0x20')](_0x2b8c91)){return _0x2ac10c;}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 _0x2ac10c;}}function respondWithRpcPromise(_0xddb615,_0x4a97a0,_0x5595a2,_0x3397f9){return new BPromise(function(_0x23aba4,_0x57c455){var _0x2270f6=_0x3397f9||client;return _0x2270f6[_0xb76c('0x21')](_0xddb615,_0x5595a2)['then'](function(_0x38ebbb){logger[_0xb76c('0x22')](_0xb76c('0x23'),_0x4a97a0,_0xb76c('0x24'));logger['debug'](_0xb76c('0x25'),_0x4a97a0,'request\x20sent',JSON[_0xb76c('0x26')](_0x38ebbb));if(_0x38ebbb[_0xb76c('0x27')]){if(_0x38ebbb[_0xb76c('0x27')]['code']===0x1f4){logger['error'](_0xb76c('0x23'),_0x4a97a0,_0x38ebbb[_0xb76c('0x27')][_0xb76c('0x28')]);return _0x57c455(_0x38ebbb[_0xb76c('0x27')][_0xb76c('0x28')]);}logger[_0xb76c('0x27')]('ChatGroup,\x20%s,\x20%s',_0x4a97a0,_0x38ebbb[_0xb76c('0x27')]['message']);return _0x23aba4(_0x38ebbb[_0xb76c('0x27')][_0xb76c('0x28')]);}else{logger[_0xb76c('0x22')](_0xb76c('0x23'),_0x4a97a0,'request\x20sent');_0x23aba4(_0x38ebbb[_0xb76c('0x29')][_0xb76c('0x28')]);}})['catch'](function(_0x5f025d){logger['error'](_0xb76c('0x23'),_0x4a97a0,_0x5f025d);_0x57c455(_0x5f025d);});});}function respondWithStatusCode(_0x24e08b,_0x525af6){_0x525af6=_0x525af6||0xcc;return function(_0x32ca63){if(_0x32ca63){return _0x24e08b['sendStatus'](_0x525af6);}return _0x24e08b[_0xb76c('0x2a')](_0x525af6)['end']();};}function respondWithResult(_0x370ad7,_0x8e595d){_0x8e595d=_0x8e595d||0xc8;return function(_0x2ec6c8){if(_0x2ec6c8){return _0x370ad7['status'](_0x8e595d)[_0xb76c('0x2b')](_0x2ec6c8);}};}function respondWithFilteredResult(_0x395a3d,_0x145fe1){return function(_0x4c97d8){if(_0x4c97d8){var _0x50b644=_0x4c97d8[_0xb76c('0x2c')],_0x4a89a4=_0x145fe1[_0xb76c('0x2d')],_0x10f3db=_0x145fe1[_0xb76c('0x2d')]+_0x145fe1[_0xb76c('0x2e')],_0x44279d;if(_0x10f3db>=_0x50b644){_0x10f3db=_0x50b644;_0x44279d=0xc8;}else{_0x44279d=0xce;}_0x395a3d[_0xb76c('0x2a')](_0x44279d);return _0x395a3d[_0xb76c('0x2f')]('Content-Range',_0x4a89a4+'-'+_0x10f3db+'/'+_0x50b644)[_0xb76c('0x2b')](_0x4c97d8);}return null;};}function patchUpdates(_0x4464e2){return function(_0x508b21){try{jsonpatch[_0xb76c('0x30')](_0x508b21,_0x4464e2,!![]);}catch(_0x179274){return BPromise[_0xb76c('0x31')](_0x179274);}return _0x508b21['save']();};}function saveUpdates(_0x24b8d1,_0x45eefd){return function(_0x1c4a77){if(_0x1c4a77){return _0x1c4a77['update'](_0x24b8d1)[_0xb76c('0x32')](function(_0x514b7c){return _0x514b7c;});}return null;};}function removeEntity(_0x2844e2,_0x5121ae){return function(_0x2723f9){if(_0x2723f9){return _0x2723f9[_0xb76c('0x33')]()[_0xb76c('0x32')](function(){_0x2844e2[_0xb76c('0x2a')](0xcc)[_0xb76c('0x34')]();});}};}function handleEntityNotFound(_0x38d377,_0x44615c){return function(_0x294b5c){if(!_0x294b5c){_0x38d377['sendStatus'](0x194);}return _0x294b5c;};}function handleError(_0x37556d,_0x529d4c){_0x529d4c=_0x529d4c||0x1f4;return function(_0xcec43a){logger['error'](_0xcec43a[_0xb76c('0x35')]);if(_0xcec43a['name']){delete _0xcec43a['name'];}_0x37556d[_0xb76c('0x2a')](_0x529d4c)['send'](_0xcec43a);};}exports[_0xb76c('0x36')]=function(_0x5960dc,_0x3fd97c){var _0x12b759={},_0x1c5a31={},_0x90d757={'count':0x0,'rows':[]};var _0x4ce918=db[_0xb76c('0x37')][_0xb76c('0x38')];_0x1c5a31[_0xb76c('0x39')]=_['keys'](_0x4ce918);_0x1c5a31[_0xb76c('0x3a')]=_['keys'](_0x5960dc[_0xb76c('0x3a')]);_0x1c5a31[_0xb76c('0x3b')]=_[_0xb76c('0x3c')](_0x1c5a31[_0xb76c('0x39')],_0x1c5a31[_0xb76c('0x3a')]);_0x12b759['attributes']=_[_0xb76c('0x3c')](_0x1c5a31[_0xb76c('0x39')],qs[_0xb76c('0x3d')](_0x5960dc[_0xb76c('0x3a')][_0xb76c('0x3d')]));_0x12b759[_0xb76c('0x3e')]=_0x12b759[_0xb76c('0x3e')]['length']?_0x12b759[_0xb76c('0x3e')]:_0x1c5a31[_0xb76c('0x39')];if(!_0x5960dc['query'][_0xb76c('0x3f')](_0xb76c('0x40'))){_0x12b759['limit']=qs[_0xb76c('0x2e')](_0x5960dc['query'][_0xb76c('0x2e')]);_0x12b759[_0xb76c('0x2d')]=qs[_0xb76c('0x2d')](_0x5960dc[_0xb76c('0x3a')][_0xb76c('0x2d')]);}_0x12b759[_0xb76c('0x41')]=qs[_0xb76c('0x42')](_0x5960dc[_0xb76c('0x3a')][_0xb76c('0x42')]);_0x12b759[_0xb76c('0x43')]=qs[_0xb76c('0x3b')](_[_0xb76c('0x44')](_0x5960dc[_0xb76c('0x3a')],_0x1c5a31[_0xb76c('0x3b')]));if(_0x5960dc[_0xb76c('0x3a')][_0xb76c('0x45')]){_0x12b759[_0xb76c('0x43')]=_['merge'](_0x12b759[_0xb76c('0x43')],{'$or':_['map'](_0x4ce918,function(_0x36f80d){if(_0x36f80d[_0xb76c('0x46')][_0xb76c('0x47')]!==_0xb76c('0x48')){var _0xe47809={};_0xe47809[_0x36f80d['field']]={'$like':'%'+_0x5960dc[_0xb76c('0x3a')]['filter']+'%'};return _0xe47809;}})});}_0x12b759=_[_0xb76c('0x49')]({},_0x12b759,_0x5960dc['options']);var _0x302789={'where':_0x12b759[_0xb76c('0x43')]};return db[_0xb76c('0x37')][_0xb76c('0x2c')](_0x302789)[_0xb76c('0x32')](function(_0xa1c116){_0x90d757[_0xb76c('0x2c')]=_0xa1c116;if(_0x5960dc['query'][_0xb76c('0x4a')]){_0x12b759['include']=[{'all':!![]}];}return db[_0xb76c('0x37')][_0xb76c('0x4b')](_0x12b759);})[_0xb76c('0x32')](function(_0xecf8e6){_0x90d757['rows']=_0xecf8e6;return _0x90d757;})[_0xb76c('0x32')](respondWithFilteredResult(_0x3fd97c,_0x12b759))['catch'](handleError(_0x3fd97c,null));};exports[_0xb76c('0x4c')]=function(_0x139096,_0x3b0d87){var _0x3d3070={'raw':!![],'where':{'id':_0x139096[_0xb76c('0x4d')]['id']}},_0x34267c={};_0x34267c['model']=_[_0xb76c('0x4e')](db[_0xb76c('0x37')][_0xb76c('0x38')]);_0x34267c[_0xb76c('0x3a')]=_[_0xb76c('0x4e')](_0x139096[_0xb76c('0x3a')]);_0x34267c[_0xb76c('0x3b')]=_[_0xb76c('0x3c')](_0x34267c['model'],_0x34267c[_0xb76c('0x3a')]);_0x3d3070[_0xb76c('0x3e')]=_[_0xb76c('0x3c')](_0x34267c[_0xb76c('0x39')],qs[_0xb76c('0x3d')](_0x139096[_0xb76c('0x3a')]['fields']));_0x3d3070[_0xb76c('0x3e')]=_0x3d3070['attributes'][_0xb76c('0x4f')]?_0x3d3070[_0xb76c('0x3e')]:_0x34267c[_0xb76c('0x39')];if(_0x139096[_0xb76c('0x3a')][_0xb76c('0x4a')]){_0x3d3070[_0xb76c('0x50')]=[{'all':!![]}];}_0x3d3070=_[_0xb76c('0x49')]({},_0x3d3070,_0x139096[_0xb76c('0x51')]);return db[_0xb76c('0x37')][_0xb76c('0x52')](_0x3d3070)[_0xb76c('0x32')](handleEntityNotFound(_0x3b0d87,null))[_0xb76c('0x32')](respondWithResult(_0x3b0d87,null))[_0xb76c('0x53')](handleError(_0x3b0d87,null));};exports[_0xb76c('0x54')]=function(_0x4f1feb,_0x39cc11){return db[_0xb76c('0x37')]['create'](_0x4f1feb['body'],{})[_0xb76c('0x32')](respondWithResult(_0x39cc11,0xc9))[_0xb76c('0x53')](handleError(_0x39cc11,null));};exports[_0xb76c('0x55')]=function(_0x3da8e3,_0x59db1b){if(_0x3da8e3[_0xb76c('0x56')]['id']){delete _0x3da8e3[_0xb76c('0x56')]['id'];}return db[_0xb76c('0x37')]['find']({'where':{'id':_0x3da8e3['params']['id']}})[_0xb76c('0x32')](handleEntityNotFound(_0x59db1b,null))['then'](saveUpdates(_0x3da8e3[_0xb76c('0x56')],null))[_0xb76c('0x32')](respondWithResult(_0x59db1b,null))['catch'](handleError(_0x59db1b,null));};exports[_0xb76c('0x33')]=function(_0x413ce2,_0x3cac8d){return db[_0xb76c('0x37')][_0xb76c('0x52')]({'where':{'id':_0x413ce2[_0xb76c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3cac8d,null))[_0xb76c('0x32')](removeEntity(_0x3cac8d,null))[_0xb76c('0x53')](handleError(_0x3cac8d,null));};exports[_0xb76c('0x57')]=function(_0x1285d9,_0x5d4bb8){return db[_0xb76c('0x37')]['describe']()[_0xb76c('0x32')](respondWithResult(_0x5d4bb8,null))[_0xb76c('0x53')](handleError(_0x5d4bb8,null));};exports[_0xb76c('0x58')]=function(_0x588827,_0x37155c,_0xadb5fd){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x588827[_0xb76c('0x4d')]['id'],'ToId':_0x588827[_0xb76c('0x59')]['id'],'read':![]}})[_0xb76c('0x32')](function(_0x18ee28){return{'id':_[_0xb76c('0x5a')](_0x588827[_0xb76c('0x4d')]['id']),'count':_0x18ee28};})[_0xb76c('0x32')](respondWithResult(_0x37155c,null))[_0xb76c('0x53')](handleError(_0x37155c,null));};exports[_0xb76c('0x5b')]=function(_0x185cf6,_0x1a5f26,_0x216374){return db['ChatGroup'][_0xb76c('0x52')]({'where':{'id':_0x185cf6['params']['id']}})[_0xb76c('0x32')](handleEntityNotFound(_0x1a5f26,null))[_0xb76c('0x32')](function(_0x275697){if(_0x275697){return _0x275697['addMembers'](_0x185cf6[_0xb76c('0x56')][_0xb76c('0x5c')],_[_0xb76c('0x5d')](_0x185cf6[_0xb76c('0x56')],[_0xb76c('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x1a5f26,null))['catch'](handleError(_0x1a5f26,null));};exports['getMembers']=function(_0x3b52ca,_0x3d2a90,_0x689ade){var _0x552386={};var _0x155f18={};var _0x22016d;var _0x4a38c0;return db[_0xb76c('0x37')][_0xb76c('0x5e')]({'where':{'id':_0x3b52ca[_0xb76c('0x4d')]['id']}})[_0xb76c('0x32')](handleEntityNotFound(_0x3d2a90,null))['then'](function(_0xcee10a){if(_0xcee10a){_0x22016d=_0xcee10a;_0x155f18[_0xb76c('0x39')]=_['keys'](db[_0xb76c('0x5f')][_0xb76c('0x38')]);_0x155f18[_0xb76c('0x3a')]=_[_0xb76c('0x4e')](_0x3b52ca[_0xb76c('0x3a')]);_0x155f18[_0xb76c('0x3b')]=_[_0xb76c('0x3c')](_0x155f18['model'],_0x155f18[_0xb76c('0x3a')]);_0x552386[_0xb76c('0x3e')]=_[_0xb76c('0x3c')](_0x155f18[_0xb76c('0x39')],qs[_0xb76c('0x3d')](_0x3b52ca[_0xb76c('0x3a')][_0xb76c('0x3d')]));_0x552386[_0xb76c('0x3e')]=_0x552386[_0xb76c('0x3e')][_0xb76c('0x4f')]?_0x552386['attributes']:_0x155f18['model'];_0x552386[_0xb76c('0x41')]=qs['sort'](_0x3b52ca[_0xb76c('0x3a')][_0xb76c('0x42')]);_0x552386['where']=qs[_0xb76c('0x3b')](_['pick'](_0x3b52ca[_0xb76c('0x3a')],_0x155f18['filters']));if(_0x3b52ca[_0xb76c('0x3a')][_0xb76c('0x45')]){_0x552386['where']=_[_0xb76c('0x49')](_0x552386[_0xb76c('0x43')],{'$or':_['map'](_0x552386[_0xb76c('0x3e')],function(_0x23c7ec){var _0x36e75d={};_0x36e75d[_0x23c7ec]={'$like':'%'+_0x3b52ca[_0xb76c('0x3a')]['filter']+'%'};return _0x36e75d;})});}_0x552386=_[_0xb76c('0x49')]({},_0x552386,_0x3b52ca[_0xb76c('0x51')]);return _0x22016d[_0xb76c('0x60')](_0x552386);}})[_0xb76c('0x32')](function(_0x16361d){if(_0x16361d){_0x4a38c0=_0x16361d[_0xb76c('0x4f')];if(!_0x3b52ca[_0xb76c('0x3a')]['hasOwnProperty'](_0xb76c('0x40'))){_0x552386[_0xb76c('0x2e')]=qs['limit'](_0x3b52ca[_0xb76c('0x3a')][_0xb76c('0x2e')]);_0x552386[_0xb76c('0x2d')]=qs['offset'](_0x3b52ca[_0xb76c('0x3a')][_0xb76c('0x2d')]);}return _0x22016d[_0xb76c('0x60')](_0x552386);}})[_0xb76c('0x32')](function(_0x16103a){if(_0x16103a){return _0x16103a?{'count':_0x4a38c0,'rows':_0x16103a}:null;}})[_0xb76c('0x32')](respondWithResult(_0x3d2a90,null))[_0xb76c('0x53')](handleError(_0x3d2a90,null));};exports[_0xb76c('0x61')]=function(_0x199c04,_0x2437cb,_0x1c6b63){return db[_0xb76c('0x37')]['find']({'where':{'id':_0x199c04[_0xb76c('0x4d')]['id']}})[_0xb76c('0x32')](handleEntityNotFound(_0x2437cb,null))[_0xb76c('0x32')](function(_0x4a3672){if(_0x4a3672){return _0x4a3672[_0xb76c('0x61')](_0x199c04[_0xb76c('0x3a')][_0xb76c('0x5c')]);}})[_0xb76c('0x32')](respondWithStatusCode(_0x2437cb,null))[_0xb76c('0x53')](handleError(_0x2437cb,null));};exports['addMessage']=function(_0x2617fd,_0x3d3f66,_0x136a66){if(_0x2617fd[_0xb76c('0x56')]['id']){delete _0x2617fd[_0xb76c('0x56')]['id'];}return db[_0xb76c('0x37')]['find']({'where':{'id':_0x2617fd[_0xb76c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3d3f66,null))['then'](function(_0x5ee460){if(_0x5ee460){_0x2617fd[_0xb76c('0x56')][_0xb76c('0x62')]=_0x5ee460['id'];return db[_0xb76c('0x63')][_0xb76c('0x54')](_0x2617fd[_0xb76c('0x56')]);}})[_0xb76c('0x32')](respondWithResult(_0x3d3f66,null))[_0xb76c('0x53')](handleError(_0x3d3f66,null));};exports['getMessages']=function(_0x3d8e55,_0x542203,_0x5e38ab){var _0x34b874={};var _0x5472df={};var _0x30312a;var _0x5bb7ab;return db[_0xb76c('0x37')][_0xb76c('0x5e')]({'where':{'id':_0x3d8e55[_0xb76c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x542203,null))['then'](function(_0x558c03){if(_0x558c03){_0x30312a=_0x558c03;_0x5472df[_0xb76c('0x39')]=_[_0xb76c('0x4e')](db[_0xb76c('0x63')][_0xb76c('0x38')]);_0x5472df[_0xb76c('0x3a')]=_[_0xb76c('0x4e')](_0x3d8e55[_0xb76c('0x3a')]);_0x5472df[_0xb76c('0x3b')]=_[_0xb76c('0x3c')](_0x5472df[_0xb76c('0x39')],_0x5472df[_0xb76c('0x3a')]);_0x34b874[_0xb76c('0x3e')]=_[_0xb76c('0x3c')](_0x5472df[_0xb76c('0x39')],qs[_0xb76c('0x3d')](_0x3d8e55[_0xb76c('0x3a')][_0xb76c('0x3d')]));_0x34b874['attributes']=_0x34b874[_0xb76c('0x3e')][_0xb76c('0x4f')]?_0x34b874[_0xb76c('0x3e')]:_0x5472df[_0xb76c('0x39')];_0x34b874[_0xb76c('0x41')]=qs[_0xb76c('0x42')](_0x3d8e55[_0xb76c('0x3a')][_0xb76c('0x42')]);_0x34b874[_0xb76c('0x43')]=qs[_0xb76c('0x3b')](_[_0xb76c('0x44')](_0x3d8e55[_0xb76c('0x3a')],_0x5472df[_0xb76c('0x3b')]));if(_0x3d8e55['query'][_0xb76c('0x45')]){_0x34b874[_0xb76c('0x43')]=_['merge'](_0x34b874['where'],{'$or':_['map'](_0x34b874[_0xb76c('0x3e')],function(_0x549afc){var _0x8f369b={};_0x8f369b[_0x549afc]={'$like':'%'+_0x3d8e55[_0xb76c('0x3a')][_0xb76c('0x45')]+'%'};return _0x8f369b;})});}if(_0x3d8e55[_0xb76c('0x3a')][_0xb76c('0x64')]){var _0x31ecb5=_0x3d8e55[_0xb76c('0x3a')]['$gte'][_0xb76c('0x65')](',');var _0x1b4dcb={};_0x1b4dcb[_0x31ecb5[0x0]]={'$gte':moment(_0x31ecb5[0x1])[_0xb76c('0x66')]('YYYY-MM-DD\x20HH:mm:ss')};_0x34b874[_0xb76c('0x43')]=_[_0xb76c('0x49')](_0x34b874[_0xb76c('0x43')],_0x1b4dcb);}_0x34b874=_[_0xb76c('0x49')]({},_0x34b874,_0x3d8e55[_0xb76c('0x51')]);return _0x30312a[_0xb76c('0x67')](_0x34b874);}})[_0xb76c('0x32')](function(_0x4e3ec2){if(_0x4e3ec2){_0x5bb7ab=_0x4e3ec2[_0xb76c('0x4f')];if(!_0x3d8e55[_0xb76c('0x3a')][_0xb76c('0x3f')](_0xb76c('0x40'))){_0x34b874[_0xb76c('0x2e')]=qs[_0xb76c('0x2e')](_0x3d8e55[_0xb76c('0x3a')]['limit']);_0x34b874[_0xb76c('0x2d')]=qs[_0xb76c('0x2d')](_0x3d8e55[_0xb76c('0x3a')]['offset']);}return _0x30312a[_0xb76c('0x67')](_0x34b874);}})[_0xb76c('0x32')](function(_0x290ee4){if(_0x290ee4){return _0x290ee4?{'count':_0x5bb7ab,'rows':_0x290ee4}:null;}})[_0xb76c('0x32')](respondWithResult(_0x542203,null))['catch'](handleError(_0x542203,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 905e61b..5247e3f 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 _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x2b5b44,_0x17189c){var _0x32cb66=function(_0x4ce183){while(--_0x4ce183){_0x2b5b44['push'](_0x2b5b44['shift']());}};_0x32cb66(++_0x17189c);}(_0xadb5,0xad));var _0x5adb=function(_0xc6af1,_0x2fb7ad){_0xc6af1=_0xc6af1-0x0;var _0x7873b3=_0xadb5[_0xc6af1];return _0x7873b3;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x5adb('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){ChatGroupEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);ChatGroupEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];ChatGroup[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x2f4c1c,_0x5a3dd4){var _0x25e0f2=function(_0x46ea31){while(--_0x46ea31){_0x2f4c1c['push'](_0x2f4c1c['shift']());}};_0x25e0f2(++_0x5a3dd4);}(_0xadb5,0xad));var _0x5adb=function(_0x1543e3,_0x45fd1f){_0x1543e3=_0x1543e3-0x0;var _0x8a4293=_0xadb5[_0x1543e3];return _0x8a4293;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x5adb('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){ChatGroupEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);ChatGroupEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];ChatGroup[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 330ce6c..71c3bf0 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 _0x851c=['bluebird','request-promise','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x2fa8d1,_0x54d0e5){var _0xf07724=function(_0x4a6927){while(--_0x4a6927){_0x2fa8d1['push'](_0x2fa8d1['shift']());}};_0xf07724(++_0x54d0e5);}(_0x851c,0x19d));var _0xc851=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x851c[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xc851('0x0'));var util=require(_0xc851('0x1'));var logger=require(_0xc851('0x2'))(_0xc851('0x3'));var moment=require(_0xc851('0x4'));var BPromise=require(_0xc851('0x5'));var rp=require(_0xc851('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc851('0x7'));var config=require(_0xc851('0x8'));var attributes=require('./chatGroup.attributes');module[_0xc851('0x9')]=function(_0x272e34,_0x535cf1){return _0x272e34[_0xc851('0xa')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x046b=['ChatGroup','chat_groups','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define'];(function(_0x434849,_0x27a13a){var _0x265681=function(_0x45b575){while(--_0x45b575){_0x434849['push'](_0x434849['shift']());}};_0x265681(++_0x27a13a);}(_0x046b,0x147));var _0xb046=function(_0x31d129,_0xeb8c64){_0x31d129=_0x31d129-0x0;var _0x2e8f0e=_0x046b[_0x31d129];return _0x2e8f0e;};'use strict';var _=require('lodash');var util=require(_0xb046('0x0'));var logger=require(_0xb046('0x1'))(_0xb046('0x2'));var moment=require(_0xb046('0x3'));var BPromise=require(_0xb046('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb046('0x5'));var rimraf=require(_0xb046('0x6'));var config=require(_0xb046('0x7'));var attributes=require(_0xb046('0x8'));module[_0xb046('0x9')]=function(_0x5511db,_0x5c06b5){return _0x5511db[_0xb046('0xa')](_0xb046('0xb'),attributes,{'tableName':_0xb046('0xc'),'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 0ee51bc..d173e13 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 _0x6de6=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x2bbb3d,_0x400061){var _0x5739f0=function(_0x5bbc70){while(--_0x5bbc70){_0x2bbb3d['push'](_0x2bbb3d['shift']());}};_0x5739f0(++_0x400061);}(_0x6de6,0x1e5));var _0x66de=function(_0x20ebb9,_0x3535bb){_0x20ebb9=_0x20ebb9-0x0;var _0x1ec31d=_0x6de6[_0x20ebb9];return _0x1ec31d;};'use strict';var _=require(_0x66de('0x0'));var util=require(_0x66de('0x1'));var moment=require(_0x66de('0x2'));var BPromise=require('bluebird');var rs=require(_0x66de('0x3'));var fs=require('fs');var Redis=require(_0x66de('0x4'));var db=require(_0x66de('0x5'))['db'];var utils=require(_0x66de('0x6'));var logger=require('../../config/logger')(_0x66de('0x7'));var config=require(_0x66de('0x8'));var jayson=require(_0x66de('0x9'));var client=jayson[_0x66de('0xa')][_0x66de('0xb')]({'port':0x232a});config[_0x66de('0xc')]=_[_0x66de('0xd')](config[_0x66de('0xc')],{'host':_0x66de('0xe'),'port':0x18eb});var socket=require(_0x66de('0xf'))(new Redis(config[_0x66de('0xc')]));require(_0x66de('0x10'))[_0x66de('0x11')](socket);function respondWithRpcPromise(_0x540b18,_0x1ca435,_0x77f922){return new BPromise(function(_0x2a22a8,_0x18d0f3){return client[_0x66de('0x12')](_0x540b18,_0x77f922)['then'](function(_0x1ebc19){logger[_0x66de('0x13')](_0x66de('0x14'),_0x1ca435,_0x66de('0x15'));logger[_0x66de('0x16')](_0x66de('0x17'),_0x1ca435,_0x66de('0x15'),JSON[_0x66de('0x18')](_0x1ebc19));if(_0x1ebc19[_0x66de('0x19')]){if(_0x1ebc19[_0x66de('0x19')][_0x66de('0x1a')]===0x1f4){logger[_0x66de('0x19')](_0x66de('0x14'),_0x1ca435,_0x1ebc19['error'][_0x66de('0x1b')]);return _0x18d0f3(_0x1ebc19[_0x66de('0x19')][_0x66de('0x1b')]);}logger[_0x66de('0x19')](_0x66de('0x14'),_0x1ca435,_0x1ebc19['error'][_0x66de('0x1b')]);return _0x2a22a8(_0x1ebc19[_0x66de('0x19')][_0x66de('0x1b')]);}else{logger[_0x66de('0x13')](_0x66de('0x14'),_0x1ca435,_0x66de('0x15'));_0x2a22a8(_0x1ebc19[_0x66de('0x1c')][_0x66de('0x1b')]);}})['catch'](function(_0x3ab804){logger['error'](_0x66de('0x14'),_0x1ca435,_0x3ab804);_0x18d0f3(_0x3ab804);});});} \ No newline at end of file +var _0xbb63=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils'];(function(_0xc89450,_0x2acbe6){var _0x5cd7f5=function(_0xbaa4fe){while(--_0xbaa4fe){_0xc89450['push'](_0xc89450['shift']());}};_0x5cd7f5(++_0x2acbe6);}(_0xbb63,0xdc));var _0x3bb6=function(_0xcb164b,_0x1754b5){_0xcb164b=_0xcb164b-0x0;var _0x4d8663=_0xbb63[_0xcb164b];return _0x4d8663;};'use strict';var _=require(_0x3bb6('0x0'));var util=require(_0x3bb6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3bb6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3bb6('0x3'))['db'];var utils=require(_0x3bb6('0x4'));var logger=require(_0x3bb6('0x5'))('rpc');var config=require(_0x3bb6('0x6'));var jayson=require(_0x3bb6('0x7'));var client=jayson[_0x3bb6('0x8')][_0x3bb6('0x9')]({'port':0x232a});config[_0x3bb6('0xa')]=_[_0x3bb6('0xb')](config['redis'],{'host':_0x3bb6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3bb6('0xa')]));require(_0x3bb6('0xd'))['register'](socket);function respondWithRpcPromise(_0x228c4d,_0xea0533,_0x9130ee){return new BPromise(function(_0x1ed994,_0x2d0b6d){return client[_0x3bb6('0xe')](_0x228c4d,_0x9130ee)[_0x3bb6('0xf')](function(_0x34d34d){logger[_0x3bb6('0x10')](_0x3bb6('0x11'),_0xea0533,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0xea0533,_0x3bb6('0x12'),JSON[_0x3bb6('0x13')](_0x34d34d));if(_0x34d34d[_0x3bb6('0x14')]){if(_0x34d34d[_0x3bb6('0x14')][_0x3bb6('0x15')]===0x1f4){logger[_0x3bb6('0x14')]('ChatGroup,\x20%s,\x20%s',_0xea0533,_0x34d34d['error'][_0x3bb6('0x16')]);return _0x2d0b6d(_0x34d34d[_0x3bb6('0x14')][_0x3bb6('0x16')]);}logger[_0x3bb6('0x14')](_0x3bb6('0x11'),_0xea0533,_0x34d34d[_0x3bb6('0x14')]['message']);return _0x1ed994(_0x34d34d['error'][_0x3bb6('0x16')]);}else{logger['info'](_0x3bb6('0x11'),_0xea0533,_0x3bb6('0x12'));_0x1ed994(_0x34d34d[_0x3bb6('0x17')][_0x3bb6('0x16')]);}})[_0x3bb6('0x18')](function(_0x537418){logger[_0x3bb6('0x14')](_0x3bb6('0x11'),_0xea0533,_0x537418);_0x2d0b6d(_0x537418);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index a8960a5..e249e63 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 _0xf6a5=['emit','removeListener','register','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0x1c1b16,_0x151c52){var _0x46f804=function(_0x2a4b9c){while(--_0x2a4b9c){_0x1c1b16['push'](_0x1c1b16['shift']());}};_0x46f804(++_0x151c52);}(_0xf6a5,0x1e4));var _0x5f6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf6a5[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require(_0x5f6a('0x0'));var events=[_0x5f6a('0x1'),_0x5f6a('0x2'),_0x5f6a('0x3')];function createListener(_0x2b6f38,_0x17885c){return function(_0x2c7be1){_0x17885c[_0x5f6a('0x4')](_0x2b6f38,_0x2c7be1);};}function removeListener(_0x4908e7,_0x1a667a){return function(){ChatGroupEvents[_0x5f6a('0x5')](_0x4908e7,_0x1a667a);};}exports[_0x5f6a('0x6')]=function(_0x4fd1d0){for(var _0x5e255e=0x0,_0x1fd6a9=events['length'];_0x5e255e<_0x1fd6a9;_0x5e255e++){var _0x598794=events[_0x5e255e];var _0x1e1e16=createListener(_0x5f6a('0x7')+_0x598794,_0x4fd1d0);ChatGroupEvents['on'](_0x598794,_0x1e1e16);}}; \ No newline at end of file +var _0xe273=['removeListener','save','remove'];(function(_0x64ada5,_0x2d4c76){var _0xc420a6=function(_0x8460d7){while(--_0x8460d7){_0x64ada5['push'](_0x64ada5['shift']());}};_0xc420a6(++_0x2d4c76);}(_0xe273,0x1ae));var _0x3e27=function(_0x40b3f2,_0x2c4f5f){_0x40b3f2=_0x40b3f2-0x0;var _0x4ce90c=_0xe273[_0x40b3f2];return _0x4ce90c;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x3e27('0x0'),_0x3e27('0x1'),'update'];function createListener(_0x162fc0,_0x15616c){return function(_0x2dce0a){_0x15616c['emit'](_0x162fc0,_0x2dce0a);};}function removeListener(_0xe87fef,_0x2837af){return function(){ChatGroupEvents[_0x3e27('0x2')](_0xe87fef,_0x2837af);};}exports['register']=function(_0x45c5bb){for(var _0x19426e=0x0,_0x54c0cb=events['length'];_0x19426e<_0x54c0cb;_0x19426e++){var _0x81e2d=events[_0x19426e];var _0x22b4b6=createListener('chatGroup:'+_0x81e2d,_0x45c5bb);ChatGroupEvents['on'](_0x81e2d,_0x22b4b6);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index ea6afc9..4674858 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 _0x7341=['/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','/:id','/:id/unread','getUnread'];(function(_0x246712,_0x52aed7){var _0x583871=function(_0xe42f27){while(--_0xe42f27){_0x246712['push'](_0x246712['shift']());}};_0x583871(++_0x52aed7);}(_0x7341,0x1b1));var _0x1734=function(_0x415dee,_0x3fbcde){_0x415dee=_0x415dee-0x0;var _0x23ac1e=_0x7341[_0x415dee];return _0x23ac1e;};'use strict';var multer=require(_0x1734('0x0'));var util=require(_0x1734('0x1'));var path=require(_0x1734('0x2'));var timeout=require(_0x1734('0x3'));var express=require(_0x1734('0x4'));var router=express[_0x1734('0x5')]();var auth=require(_0x1734('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1734('0x7'));var controller=require(_0x1734('0x8'));router[_0x1734('0x9')]('/',auth[_0x1734('0xa')](),controller['index']);router['get'](_0x1734('0xb'),auth[_0x1734('0xa')](),controller['describe']);router['get'](_0x1734('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x1734('0xd'),auth[_0x1734('0xa')](),controller[_0x1734('0xe')]);router['get'](_0x1734('0xf'),auth[_0x1734('0xa')](),controller[_0x1734('0x10')]);router['get'](_0x1734('0x11'),auth[_0x1734('0xa')](),controller[_0x1734('0x12')]);router[_0x1734('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1734('0x13')](_0x1734('0xf'),auth[_0x1734('0xa')](),controller[_0x1734('0x14')]);router['post'](_0x1734('0x11'),auth[_0x1734('0xa')](),controller[_0x1734('0x15')]);router[_0x1734('0x16')](_0x1734('0xc'),auth[_0x1734('0xa')](),controller[_0x1734('0x17')]);router[_0x1734('0x18')](_0x1734('0xc'),auth[_0x1734('0xa')](),controller[_0x1734('0x19')]);router['delete'](_0x1734('0xf'),auth['isAuthenticated'](),controller[_0x1734('0x1a')]);module[_0x1734('0x1b')]=router; \ No newline at end of file +var _0xebb8=['delete','destroy','removeMembers','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','create','/:id/messages','addMessage','put','update'];(function(_0x4bfa7c,_0x250db1){var _0x100ac4=function(_0x19bfac){while(--_0x19bfac){_0x4bfa7c['push'](_0x4bfa7c['shift']());}};_0x100ac4(++_0x250db1);}(_0xebb8,0x163));var _0x8ebb=function(_0x4e3ed4,_0x50f569){_0x4e3ed4=_0x4e3ed4-0x0;var _0x36e615=_0xebb8[_0x4e3ed4];return _0x36e615;};'use strict';var multer=require(_0x8ebb('0x0'));var util=require('util');var path=require(_0x8ebb('0x1'));var timeout=require(_0x8ebb('0x2'));var express=require(_0x8ebb('0x3'));var router=express['Router']();var auth=require(_0x8ebb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8ebb('0x5'));var controller=require(_0x8ebb('0x6'));router[_0x8ebb('0x7')]('/',auth[_0x8ebb('0x8')](),controller['index']);router[_0x8ebb('0x7')](_0x8ebb('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x8ebb('0xa'),auth[_0x8ebb('0x8')](),controller[_0x8ebb('0xb')]);router[_0x8ebb('0x7')](_0x8ebb('0xc'),auth['isAuthenticated'](),controller[_0x8ebb('0xd')]);router[_0x8ebb('0x7')](_0x8ebb('0xe'),auth[_0x8ebb('0x8')](),controller[_0x8ebb('0xf')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x8ebb('0x10')]);router[_0x8ebb('0x11')]('/',auth['isAuthenticated'](),controller[_0x8ebb('0x12')]);router[_0x8ebb('0x11')]('/:id/members',auth[_0x8ebb('0x8')](),controller['addMembers']);router[_0x8ebb('0x11')](_0x8ebb('0x13'),auth[_0x8ebb('0x8')](),controller[_0x8ebb('0x14')]);router[_0x8ebb('0x15')](_0x8ebb('0xa'),auth['isAuthenticated'](),controller[_0x8ebb('0x16')]);router[_0x8ebb('0x17')](_0x8ebb('0xa'),auth[_0x8ebb('0x8')](),controller[_0x8ebb('0x18')]);router['delete']('/:id/members',auth['isAuthenticated'](),controller[_0x8ebb('0x19')]);module[_0x8ebb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 63e38a2..9d57f69 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 _0x0dcc=['out','sequelize','BOOLEAN','INTEGER','ENUM','star','thumb','STRING','TEXT','long','DATE'];(function(_0x447ef1,_0x374cd2){var _0x3d72ec=function(_0x3e10b){while(--_0x3e10b){_0x447ef1['push'](_0x447ef1['shift']());}};_0x3d72ec(++_0x374cd2);}(_0x0dcc,0xdd));var _0xc0dc=function(_0xbf9cef,_0x14824b){_0xbf9cef=_0xbf9cef-0x0;var _0x4a998a=_0x0dcc[_0xbf9cef];return _0x4a998a;};'use strict';var Sequelize=require(_0xc0dc('0x0'));module['exports']={'closed':{'type':Sequelize[_0xc0dc('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc0dc('0x2')]},'ratingType':{'type':Sequelize[_0xc0dc('0x3')](_0xc0dc('0x4'),_0xc0dc('0x5')),'defaultValue':_0xc0dc('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xc0dc('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc0dc('0x6')]},'note':{'type':Sequelize[_0xc0dc('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xc0dc('0x6')]},'osName':{'type':Sequelize[_0xc0dc('0x6')]},'osVersion':{'type':Sequelize[_0xc0dc('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xc0dc('0x6')]},'deviceType':{'type':Sequelize[_0xc0dc('0x6')]},'referer':{'type':Sequelize['STRING']},'customerIp':{'type':Sequelize[_0xc0dc('0x6')]},'formData':{'type':Sequelize[_0xc0dc('0x7')](_0xc0dc('0x8'))},'read1stAt':{'type':Sequelize[_0xc0dc('0x9')]},'lastMsgAt':{'type':Sequelize[_0xc0dc('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xc0dc('0x3')]('in',_0xc0dc('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xc0dc('0x6')]},'customerPort':{'type':Sequelize[_0xc0dc('0x6')]}}; \ No newline at end of file +var _0x3783=['TEXT','STRING','DATE','long','out','sequelize','BOOLEAN','ENUM','star'];(function(_0x5ee73b,_0x282c4c){var _0x22948a=function(_0x4bb79b){while(--_0x4bb79b){_0x5ee73b['push'](_0x5ee73b['shift']());}};_0x22948a(++_0x282c4c);}(_0x3783,0x95));var _0x3378=function(_0x5b900b,_0xc7ba32){_0x5b900b=_0x5b900b-0x0;var _0x2d5858=_0x3783[_0x5b900b];return _0x2d5858;};'use strict';var Sequelize=require(_0x3378('0x0'));module['exports']={'closed':{'type':Sequelize[_0x3378('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x3378('0x2')](_0x3378('0x3'),'thumb'),'defaultValue':_0x3378('0x3')},'ratingMessage':{'type':Sequelize[_0x3378('0x4')]},'pathTranscript':{'type':Sequelize[_0x3378('0x4')]},'mailTranscript':{'type':Sequelize[_0x3378('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3378('0x6')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3378('0x5')]},'browserName':{'type':Sequelize[_0x3378('0x5')]},'browserVersion':{'type':Sequelize[_0x3378('0x5')]},'osName':{'type':Sequelize[_0x3378('0x5')]},'osVersion':{'type':Sequelize[_0x3378('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x3378('0x5')]},'deviceType':{'type':Sequelize[_0x3378('0x5')]},'referer':{'type':Sequelize['STRING']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x3378('0x4')](_0x3378('0x7'))},'read1stAt':{'type':Sequelize[_0x3378('0x6')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3378('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3378('0x5')]},'customerPort':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 509206a..d647ee5 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 _0x0362=['customerIp','customerPort','createReadStream','pipe','lastName','out','renderFile','views','downloadInteraction.html','transcript-','.pdf','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','test','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','count','offset','set','Content-Range','json','apply','save','destroy','end','stack','name','send','Users','map','TagIds','Tags','split','forEach','push','index','ChatInteraction','rawAttributes','query','keys','intersection','model','attributes','fields','length','limit','where','filters','select','field','color','from','tools_tags','COUNT(*)','me.ChatInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','advancedFilter','parse','createdAt','value','dateStart','startOf','day','utc','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','unreadMessages','tableAlias','\x20IN\x20?','LIKE','c.firstName','c.lastName','c.email','\x20LIKE\x20?','\x20=\x20?','ContactId','\x20>\x20?','\x20<\x20?','filter','isNil','isEmpty','ChatWebsiteId','concat','$lte','null','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','toString','join','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','i.id','COUNT(me.id)','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','expr','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','rows','show','params','include','merge','create','body','update','describe','customUpdate','find','abandon','ValidationError','Interaction\x20already\x20assigned','disposition','AbandonInteraction','file','originalname','basename','type','mimetype','Attachment','closed','findOne','attachId','download','root','server/files/attachments/','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','ChatWebsite','CmContact','UserId','%s%d','agentAlias','Visitor','agentIdentifier','website_alias','System','agent_alias','fullname','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','\x22%s\x22\x20<%s>','email','user','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','nolimit','sort','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','hasOwnProperty','includeAgent','findAll','addTags','Tag','emit','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','direction','Contact','firstName','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','%s\x20#%d','Chat','YYYY-MM-DD','mkdirSync','N.A.','closedAt','browserName'];(function(_0xad2b0,_0x327d09){var _0x24df11=function(_0x475987){while(--_0x475987){_0xad2b0['push'](_0xad2b0['shift']());}};_0x24df11(++_0x327d09);}(_0x0362,0x132));var _0x2036=function(_0x375c14,_0x2bb990){_0x375c14=_0x375c14-0x0;var _0x4a74a6=_0x0362[_0x375c14];return _0x4a74a6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2036('0x0'));var rimraf=require(_0x2036('0x1'));var zipdir=require(_0x2036('0x2'));var jsonpatch=require(_0x2036('0x3'));var rp=require(_0x2036('0x4'));var moment=require(_0x2036('0x5'));var BPromise=require(_0x2036('0x6'));var Mustache=require(_0x2036('0x7'));var util=require(_0x2036('0x8'));var path=require(_0x2036('0x9'));var sox=require(_0x2036('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2036('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2036('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2036('0xd'));var Papa=require(_0x2036('0xe'));var Redis=require(_0x2036('0xf'));var authService=require(_0x2036('0x10'));var qs=require(_0x2036('0x11'));var hardwareService=require(_0x2036('0x12'));var logger=require(_0x2036('0x13'))('api');var utils=require(_0x2036('0x14'));var config=require(_0x2036('0x15'));var db=require(_0x2036('0x16'))['db'];config[_0x2036('0x17')]=_[_0x2036('0x18')](config[_0x2036('0x17')],{'host':_0x2036('0x19'),'port':0x18eb});var socket=require(_0x2036('0x1a'))(new Redis(config[_0x2036('0x17')]));require(_0x2036('0x1b'))[_0x2036('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2036('0x1d')][_0x2036('0x1e')]({'port':0x232b});var client9004=jayson['client'][_0x2036('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x56fbfb,_0x3b35f6,_0x1288dc){if(_0x1288dc){var _0x36227d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x36227d[_0x2036('0x1f')](_0x3b35f6)){return _0x56fbfb;}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 _0x56fbfb;}}function respondWithRpcPromise(_0x2f9f6e,_0x9dd1ff,_0x5ce007,_0x5196ea){return new BPromise(function(_0x15aec8,_0x4cff5e){var _0x5732e9=_0x5196ea||client;return _0x5732e9[_0x2036('0x20')](_0x2f9f6e,_0x5ce007)[_0x2036('0x21')](function(_0x485f2b){logger[_0x2036('0x22')](_0x2036('0x23'),_0x9dd1ff,'request\x20sent');logger[_0x2036('0x24')](_0x2036('0x25'),_0x9dd1ff,'request\x20sent',JSON[_0x2036('0x26')](_0x485f2b));if(_0x485f2b[_0x2036('0x27')]){if(_0x485f2b['error'][_0x2036('0x28')]===0x1f4){logger['error'](_0x2036('0x23'),_0x9dd1ff,_0x485f2b[_0x2036('0x27')][_0x2036('0x29')]);return _0x4cff5e(_0x485f2b[_0x2036('0x27')][_0x2036('0x29')]);}logger[_0x2036('0x27')](_0x2036('0x23'),_0x9dd1ff,_0x485f2b[_0x2036('0x27')][_0x2036('0x29')]);return _0x15aec8(_0x485f2b[_0x2036('0x27')]['message']);}else{logger[_0x2036('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x9dd1ff,'request\x20sent');_0x15aec8(_0x485f2b[_0x2036('0x2a')][_0x2036('0x29')]);}})[_0x2036('0x2b')](function(_0x5d1faa){logger[_0x2036('0x27')](_0x2036('0x23'),_0x9dd1ff,_0x5d1faa);_0x4cff5e(_0x5d1faa);});});}function respondWithStatusCode(_0x30e12a,_0x5a6177){_0x5a6177=_0x5a6177||0xcc;return function(_0x5d3aa7){if(_0x5d3aa7){return _0x30e12a[_0x2036('0x2c')](_0x5a6177);}return _0x30e12a['status'](_0x5a6177)['end']();};}function respondWithResult(_0x1d3a3b,_0x1ed920){_0x1ed920=_0x1ed920||0xc8;return function(_0x54de85){if(_0x54de85){return _0x1d3a3b[_0x2036('0x2d')](_0x1ed920)['json'](_0x54de85);}};}function respondWithFilteredResult(_0x2d3ea9,_0x2f32af){return function(_0x11d319){if(_0x11d319){var _0x1aa75c=_0x11d319[_0x2036('0x2e')],_0x4cdeb4=_0x2f32af[_0x2036('0x2f')],_0x543749=_0x2f32af[_0x2036('0x2f')]+_0x2f32af['limit'],_0x55f9dd;if(_0x543749>=_0x1aa75c){_0x543749=_0x1aa75c;_0x55f9dd=0xc8;}else{_0x55f9dd=0xce;}_0x2d3ea9[_0x2036('0x2d')](_0x55f9dd);return _0x2d3ea9[_0x2036('0x30')](_0x2036('0x31'),_0x4cdeb4+'-'+_0x543749+'/'+_0x1aa75c)[_0x2036('0x32')](_0x11d319);}return null;};}function patchUpdates(_0x5e4c8d){return function(_0x1ee642){try{jsonpatch[_0x2036('0x33')](_0x1ee642,_0x5e4c8d,!![]);}catch(_0x457954){return BPromise['reject'](_0x457954);}return _0x1ee642[_0x2036('0x34')]();};}function saveUpdates(_0xc6220b,_0x414fd8){return function(_0x3837a5){if(_0x3837a5){return _0x3837a5['update'](_0xc6220b)[_0x2036('0x21')](function(_0x48d717){return _0x48d717;});}return null;};}function removeEntity(_0xd8f3c3,_0x4cdd2b){return function(_0x1d4038){if(_0x1d4038){return _0x1d4038[_0x2036('0x35')]()[_0x2036('0x21')](function(){_0xd8f3c3[_0x2036('0x2d')](0xcc)[_0x2036('0x36')]();});}};}function handleEntityNotFound(_0x1f22b6,_0x33489b){return function(_0x18e417){if(!_0x18e417){_0x1f22b6[_0x2036('0x2c')](0x194);}return _0x18e417;};}function handleError(_0x5656a7,_0x397ed9){_0x397ed9=_0x397ed9||0x1f4;return function(_0xca5083){logger[_0x2036('0x27')](_0xca5083[_0x2036('0x37')]);if(_0xca5083[_0x2036('0x38')]){delete _0xca5083[_0x2036('0x38')];}_0x5656a7[_0x2036('0x2d')](_0x397ed9)[_0x2036('0x39')](_0xca5083);};}function getInteractionUsers(_0x20f4d2,_0x31037b){return new BPromise(function(_0x5defe4,_0x2134b4){try{if(_0x31037b[_0x20f4d2['id']]){_0x20f4d2[_0x2036('0x3a')]=_[_0x2036('0x3b')](_0x31037b[_0x20f4d2['id']],function(_0x50b959){return{'id':_0x50b959['id']};});}}catch(_0xe1cadf){_0x2134b4(_0xe1cadf);}_0x5defe4(_0x20f4d2);});}function getInteractionTags(_0x39522c,_0x189062){return new BPromise(function(_0x53975d,_0x247fb4){try{if(_0x39522c[_0x2036('0x3c')]){_0x39522c[_0x2036('0x3d')]=[];_0x39522c[_0x2036('0x3c')][_0x2036('0x3e')](',')[_0x2036('0x3f')](function(_0x30c754){_0x39522c['Tags'][_0x2036('0x40')](_0x189062[_0x30c754]);});}delete _0x39522c[_0x2036('0x3c')];}catch(_0x2934cf){_0x247fb4(_0x2934cf);}_0x53975d(_0x39522c);});}function updateChatInteraction(_0x87c425,_0x462d7,_0x2de499){return new BPromise(function(_0x198b78,_0x55c770){return getInteractionUsers(_0x87c425,_0x2de499)[_0x2036('0x21')](function(_0x4419be){return getInteractionTags(_0x4419be,_0x462d7);})['then'](function(_0x3016c2){_0x198b78(_0x3016c2);})[_0x2036('0x2b')](function(_0x3f99e0){_0x55c770(_0x3f99e0);});});}exports[_0x2036('0x41')]=function(_0x8f773b,_0x1dcd0e){var _0x24d420={},_0x14b138={},_0x1177dd={'count':0x0,'rows':[]};var _0x2e2e08=db[_0x2036('0x42')][_0x2036('0x43')];_0x14b138['model']=_['keys'](_0x2e2e08);_0x14b138[_0x2036('0x44')]=_[_0x2036('0x45')](_0x8f773b[_0x2036('0x44')]);_0x14b138['filters']=_[_0x2036('0x46')](_0x14b138[_0x2036('0x47')],_0x14b138['query']);_0x24d420[_0x2036('0x48')]=_[_0x2036('0x46')](_0x14b138[_0x2036('0x47')],qs[_0x2036('0x49')](_0x8f773b[_0x2036('0x44')][_0x2036('0x49')]));_0x24d420[_0x2036('0x48')]=_0x24d420[_0x2036('0x48')][_0x2036('0x4a')]?_0x24d420[_0x2036('0x48')]:_0x14b138[_0x2036('0x47')];if(!_0x8f773b[_0x2036('0x44')]['hasOwnProperty']('nolimit')){_0x24d420[_0x2036('0x4b')]=qs[_0x2036('0x4b')](_0x8f773b[_0x2036('0x44')]['limit']);_0x24d420[_0x2036('0x2f')]=qs[_0x2036('0x2f')](_0x8f773b[_0x2036('0x44')]['offset']);}_0x24d420['order']=qs['sort'](_0x8f773b[_0x2036('0x44')]['sort']);_0x24d420[_0x2036('0x4c')]=qs[_0x2036('0x4d')](_['pick'](_0x8f773b['query'],_0x14b138[_0x2036('0x4d')]));var _0x18d377=[];var _0x4b03fc=squel[_0x2036('0x4e')]()[_0x2036('0x4f')]('id')[_0x2036('0x4f')]('name')[_0x2036('0x4f')](_0x2036('0x50'))[_0x2036('0x51')](_0x2036('0x52'));var _0x514faf=squel[_0x2036('0x4e')]()[_0x2036('0x4f')](_0x2036('0x53'))[_0x2036('0x51')]('chat_messages','me')[_0x2036('0x4c')](_0x2036('0x54'))[_0x2036('0x4c')](_0x2036('0x55'))['where'](_0x2036('0x56'));var _0x41cca6=squel['select']()[_0x2036('0x4f')](_0x2036('0x57'))[_0x2036('0x4f')](_0x2036('0x58'))[_0x2036('0x51')](_0x2036('0x59'),'ui')[_0x2036('0x5a')]('users','u','u.id\x20=\x20ui.UserId');var _0x40dbb2=squel[_0x2036('0x4e')]()[_0x2036('0x51')](_0x2036('0x5b'),'i')[_0x2036('0x5a')](_0x2036('0x5c'),'c',_0x2036('0x5d'))[_0x2036('0x5a')](_0x2036('0x5e'),'o','o.id\x20=\x20i.UserId')[_0x2036('0x5a')](_0x2036('0x5f'),'a',_0x2036('0x60'))['left_join'](_0x2036('0x61'),'me',_0x2036('0x62'));var _0x1afdc8=squel['expr']();if(_0x8f773b['query'][_0x2036('0x63')]){var _0x46e7b2=JSON[_0x2036('0x64')](_0x8f773b[_0x2036('0x44')]['advancedFilter']);_[_0x2036('0x45')](_0x46e7b2)[_0x2036('0x3f')](function(_0x254627){var _0x3f4109=_0x46e7b2[_0x254627];if(_0x254627===_0x2036('0x65')){var _0x3bd456=moment(_0x3f4109[_0x2036('0x66')][_0x2036('0x67')])[_0x2036('0x68')](_0x2036('0x69'))[_0x2036('0x6a')]()[_0x2036('0x6b')]();var _0xfb52bd=moment(_0xfb52bd)['utc']()['endOf'](_0x2036('0x69'))[_0x2036('0x6b')]();_0x1afdc8[_0x2036('0x6c')](_0x2036('0x6d'),_0x3bd456,_0xfb52bd);}else{if(_[_0x2036('0x6e')](_0x3f4109[_0x2036('0x6f')])){_0x3f4109[_0x2036('0x6f')][_0x2036('0x3f')](function(_0x43c3f3){switch(_0x3f4109[_0x2036('0x6f')][_0x2036('0x66')]){case'IS':if(_0x254627!==_0x2036('0x70')&&_0x254627!==_0x2036('0x71')){if(_[_0x2036('0x6e')](_0x3f4109[_0x2036('0x66')])&&_0x3f4109['value'][_0x2036('0x4a')]>0x1){_0x1afdc8['and'](_0x3f4109[_0x2036('0x72')]+'.'+_0x254627+_0x2036('0x73'),_0x3f4109[_0x2036('0x66')]);}else{_0x1afdc8[_0x2036('0x6c')](_0x3f4109[_0x2036('0x72')]+'.'+_0x254627+'\x20=\x20?',_0x3f4109['value'][0x0]);}}break;case'=':_0x1afdc8['and'](_0x3f4109['tableAlias']+'.'+_0x254627+'\x20=\x20?',_0x3f4109['value']);break;case _0x2036('0x74'):if(_0x254627==='ContactId'){_0x1afdc8[_0x2036('0x6c')](_0x2036('0x75')+'\x20LIKE\x20?','%'+_0x3f4109['value']+'%');_0x1afdc8['or'](_0x2036('0x76')+'\x20LIKE\x20?','%'+_0x3f4109[_0x2036('0x66')]+'%');_0x1afdc8['or'](_0x2036('0x77')+_0x2036('0x78'),'%'+_0x3f4109['value']+'%');}else{_0x1afdc8[_0x2036('0x6c')](_0x3f4109[_0x2036('0x72')]+'.'+_0x254627+_0x2036('0x78'),'%'+_0x3f4109[_0x2036('0x66')]+'%');}break;case'>':_0x1afdc8[_0x2036('0x6c')](_0x3f4109[_0x2036('0x72')]+'.'+_0x254627+'\x20>\x20?',_0x3f4109['value']);break;case'<':_0x1afdc8[_0x2036('0x6c')](_0x3f4109[_0x2036('0x72')]+'.'+_0x254627+'\x20<\x20?',_0x3f4109['value']);break;}});}else{switch(_0x3f4109['condition']['value']){case'IS':if(_0x254627!=='TagId'&&_0x254627!==_0x2036('0x71')){if(_['isArray'](_0x3f4109[_0x2036('0x66')])&&_0x3f4109[_0x2036('0x66')][_0x2036('0x4a')]>0x1){_0x1afdc8['and'](_0x3f4109[_0x2036('0x72')]+'.'+_0x254627+'\x20IN\x20?',_0x3f4109[_0x2036('0x66')]);}else{_0x1afdc8[_0x2036('0x6c')](_0x3f4109[_0x2036('0x72')]+'.'+_0x254627+_0x2036('0x79'),_0x3f4109[_0x2036('0x66')][0x0]);}}break;case'=':_0x1afdc8[_0x2036('0x6c')](_0x3f4109[_0x2036('0x72')]+'.'+_0x254627+_0x2036('0x79'),_0x3f4109[_0x2036('0x66')]);break;case'LIKE':if(_0x254627===_0x2036('0x7a')){_0x1afdc8['and'](_0x2036('0x75')+_0x2036('0x78'),'%'+_0x3f4109['value']+'%');_0x1afdc8['or'](_0x2036('0x76')+_0x2036('0x78'),'%'+_0x3f4109[_0x2036('0x66')]+'%');_0x1afdc8['or'](_0x2036('0x77')+_0x2036('0x78'),'%'+_0x3f4109['value']+'%');}else{_0x1afdc8[_0x2036('0x6c')](_0x3f4109[_0x2036('0x72')]+'.'+_0x254627+'\x20LIKE\x20?','%'+_0x3f4109[_0x2036('0x66')]+'%');}break;case'>':_0x1afdc8[_0x2036('0x6c')](_0x3f4109['tableAlias']+'.'+_0x254627+_0x2036('0x7b'),_0x3f4109[_0x2036('0x66')]);break;case'<':_0x1afdc8['and'](_0x3f4109[_0x2036('0x72')]+'.'+_0x254627+_0x2036('0x7c'),_0x3f4109[_0x2036('0x66')]);break;}}}});}else{var _0x46f144=_(Object[_0x2036('0x45')](_0x8f773b['query']))[_0x2036('0x3b')](function(_0x407370){return _0x2e2e08['hasOwnProperty'](_0x407370)?_0x407370:undefined;})[_0x2036('0x7d')](function(_0x467534){return!_[_0x2036('0x7e')](_0x467534);})['value']();if(!_[_0x2036('0x7f')](_0x46f144)){_0x46f144[_0x2036('0x3f')](function(_0x1e8663){if(_0x1e8663===_0x2036('0x80')){_0x40dbb2[_0x2036('0x4c')]('i.ChatWebsiteId\x20IN\x20?',[][_0x2036('0x81')](_0x8f773b[_0x2036('0x44')][_0x1e8663]));}else if(_0x1e8663===_0x2036('0x65')){var _0x2d4002=JSON['parse'](_0x8f773b[_0x2036('0x44')][_0x1e8663])['$gte'];var _0x175dbe=JSON['parse'](_0x8f773b[_0x2036('0x44')][_0x1e8663])[_0x2036('0x82')];_0x40dbb2['where'](_0x2036('0x6d'),_0x2d4002,_0x175dbe);}else{if(_0x8f773b[_0x2036('0x44')][_0x1e8663]===_0x2036('0x83')){_0x40dbb2[_0x2036('0x4c')]('i.'+_0x1e8663+_0x2036('0x84'));}else{_0x40dbb2[_0x2036('0x4c')]('i.'+_0x1e8663+_0x2036('0x79'),_0x8f773b[_0x2036('0x44')][_0x1e8663]);}}});}if(_0x8f773b[_0x2036('0x44')][_0x2036('0x7d')]){var _0x3510c5=_0x8f773b[_0x2036('0x44')]['filter']['replace']('\x5c','\x5c\x5c')[_0x2036('0x85')]('\x27\x27',_0x2036('0x86'));if(qs[_0x2036('0x87')](_0x3510c5)){_0x1afdc8['or'](_0x2036('0x88'),_0x3510c5+'%');}else{var _0x2decf6=[];_0x3510c5[_0x2036('0x3e')]('\x20')[_0x2036('0x3f')](function(_0x33a0cf){_0x2decf6[_0x2036('0x40')]('+'+_0x33a0cf[_0x2036('0x89')]());});var _0xdc1801=_0x2decf6[_0x2036('0x8a')]('\x20');_0x1afdc8['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0xdc1801)['or'](_0x2036('0x8b'),_0x3510c5+'%');}}}_0x40dbb2[_0x2036('0x4c')](_0x1afdc8);if(_0x24d420[_0x2036('0x8c')]){_0x24d420['order'][_0x2036('0x3f')](function(_0x289a43){_0x40dbb2[_0x2036('0x8c')]('i.'+_0x289a43[0x0],_0x289a43[0x1]===_0x2036('0x8d')?![]:!![]);});}_0x40dbb2[_0x2036('0x8e')](_0x2036('0x8f'));var _0x2d7e4e={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0xe5b8ed=_0x40dbb2['clone']()[_0x2036('0x4f')](_0x2036('0x53'))['field'](_0x2036('0x90'),_0x2036('0x71'));if(!_0x8f773b[_0x2036('0x44')][_0x2036('0x63')]){if(_0x8f773b['query']['read']){if(_0x8f773b[_0x2036('0x44')]['read']==0x1){_0xe5b8ed[_0x2036('0x91')]('`unreadMessages`\x20=\x200');_0x40dbb2['having'](_0x2036('0x92'));}else{_0xe5b8ed[_0x2036('0x91')](_0x2036('0x93'));_0x40dbb2[_0x2036('0x91')](_0x2036('0x93'));}}if(_0x8f773b[_0x2036('0x44')][_0x2036('0x94')]){var _0xa28090=_[_0x2036('0x6e')](_0x8f773b[_0x2036('0x44')]['tag'])?_0x8f773b[_0x2036('0x44')][_0x2036('0x94')]:new Array(_0x8f773b['query'][_0x2036('0x94')]);var _0x4d0e63=squel[_0x2036('0x95')]();_0xa28090[_0x2036('0x3f')](function(_0x418485){_0x4d0e63['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x418485+',%');});_0x40dbb2[_0x2036('0x91')](_0x4d0e63);_0xe5b8ed[_0x2036('0x5a')](_0x2036('0x96'),'it',_0x2036('0x97'));_0xe5b8ed[_0x2036('0x5a')](_0x2036('0x52'),'t',_0x2036('0x98'));_0xe5b8ed[_0x2036('0x4c')](_0x2036('0x99'),_0xa28090);}}else{var _0x46e7b2=JSON[_0x2036('0x64')](_0x8f773b[_0x2036('0x44')][_0x2036('0x63')]);_[_0x2036('0x45')](_0x46e7b2)[_0x2036('0x3f')](function(_0x5054c1){var _0x5edc31=_0x46e7b2[_0x5054c1];if(_0x5054c1===_0x2036('0x70')){var _0xd9ad41=_0x5edc31[_0x2036('0x66')];var _0x20b06d=squel['expr']();_0xd9ad41[_0x2036('0x3f')](function(_0x1a9734){_0x20b06d['or'](_0x2036('0x9a'),'%,'+_0x1a9734+',%');});_0x40dbb2[_0x2036('0x91')](_0x20b06d);_0xe5b8ed['left_join'](_0x2036('0x9b'),'it',_0x2036('0x9c'));_0xe5b8ed[_0x2036('0x5a')](_0x2036('0x52'),'t','t.id\x20=\x20it.TagId');_0xe5b8ed[_0x2036('0x4c')](_0x2036('0x99'),_0xd9ad41);}else if(_0x5054c1===_0x2036('0x71')){if(_0x5edc31['value'][_0x2036('0x4a')]===0x1){if(_0x5edc31[_0x2036('0x66')][0x0]===0x1){_0xe5b8ed[_0x2036('0x91')]('`unreadMessages`\x20=\x200');_0x40dbb2[_0x2036('0x91')]('`unreadMessages`\x20=\x200');}else{_0xe5b8ed[_0x2036('0x91')](_0x2036('0x93'));_0x40dbb2[_0x2036('0x91')](_0x2036('0x93'));}}}});}db[_0x2036('0x9d')][_0x2036('0x44')](_0xe5b8ed[_0x2036('0x89')](),_0x2d7e4e)['then'](function(_0xabc3f9){_0x1177dd[_0x2036('0x2e')]=_0xabc3f9['length'];if(_0x1177dd[_0x2036('0x2e')]===0x0)return[];return db[_0x2036('0x9d')][_0x2036('0x44')](_0x4b03fc[_0x2036('0x89')](),_0x2d7e4e)[_0x2036('0x21')](function(_0x3595ad){_0x18d377=_['keyBy'](_0x3595ad,'id');_0x2d7e4e=_['merge'](_0x2d7e4e,{'model':db[_0x2036('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x40dbb2[_0x2036('0x4f')]('COUNT(me.id)',_0x2036('0x71'));_0x40dbb2[_0x2036('0x4f')]('a.key',_0x2036('0x9e'));_0x40dbb2['field'](_0x2036('0x9f'),_0x2036('0xa0'));_0x40dbb2['field'](_0x2036('0xa1'));_0x40dbb2[_0x2036('0x4f')](_0x2036('0x75'),_0x2036('0xa2'));_0x40dbb2['field'](_0x2036('0x76'),_0x2036('0xa3'));_0x40dbb2['field'](_0x2036('0x77'),_0x2036('0xa4'));_0x40dbb2[_0x2036('0x4f')](_0x2036('0xa5'),'Contact.phone');_0x40dbb2['field'](_0x2036('0xa6'),'Contact.mobile');_0x40dbb2[_0x2036('0x4f')](_0x2036('0xa7'),_0x2036('0xa8'));_0x40dbb2[_0x2036('0x4f')](_0x2036('0xa9'),_0x2036('0x3c'));_0x40dbb2['left_join']('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id');_0x40dbb2[_0x2036('0x5a')](_0x2036('0x52'),'t','t.id\x20=\x20it.TagId');_0x40dbb2[_0x2036('0x4b')](_0x24d420[_0x2036('0x4b')]);_0x40dbb2[_0x2036('0x2f')](_0x24d420[_0x2036('0x2f')]);return db[_0x2036('0x9d')]['query'](_0x40dbb2['toString'](),_0x2d7e4e);})[_0x2036('0x21')](function(_0x5c5887){_0x41cca6['where'](_0x2036('0xaa'),_[_0x2036('0x3b')](_0x5c5887,'id'));return db['sequelize'][_0x2036('0x44')](_0x41cca6['toString'](),_0x2d7e4e)['then'](function(_0x229a87){var _0x46fe30=_[_0x2036('0xab')](_0x229a87,_0x2036('0xac'));var _0x2d65ed=[];_0x5c5887[_0x2036('0x3f')](function(_0xa6717f){_0x2d65ed['push'](updateChatInteraction(_0xa6717f,_0x18d377,_0x46fe30));});return BPromise['all'](_0x2d65ed);});});})[_0x2036('0x21')](function(_0x4364c5){_0x1177dd[_0x2036('0xad')]=_0x4364c5;return _0x1177dd;})[_0x2036('0x21')](respondWithFilteredResult(_0x1dcd0e,_0x24d420))[_0x2036('0x2b')](handleError(_0x1dcd0e,null));};exports[_0x2036('0xae')]=function(_0x191ff4,_0x3bd54f){var _0x287172={'raw':![],'where':{'id':_0x191ff4[_0x2036('0xaf')]['id']}},_0x17a937={};_0x17a937[_0x2036('0x47')]=_[_0x2036('0x45')](db[_0x2036('0x42')][_0x2036('0x43')]);_0x17a937[_0x2036('0x44')]=_[_0x2036('0x45')](_0x191ff4['query']);_0x17a937[_0x2036('0x4d')]=_[_0x2036('0x46')](_0x17a937[_0x2036('0x47')],_0x17a937[_0x2036('0x44')]);_0x287172[_0x2036('0x48')]=_['intersection'](_0x17a937[_0x2036('0x47')],qs['fields'](_0x191ff4[_0x2036('0x44')][_0x2036('0x49')]));_0x287172[_0x2036('0x48')]=_0x287172['attributes'][_0x2036('0x4a')]?_0x287172[_0x2036('0x48')]:_0x17a937['model'];if(_0x191ff4[_0x2036('0x44')]['includeAll']){_0x287172[_0x2036('0xb0')]=[{'all':!![]}];}_0x287172=_[_0x2036('0xb1')]({},_0x287172,_0x191ff4['options']);return db[_0x2036('0x42')]['find'](_0x287172)[_0x2036('0x21')](handleEntityNotFound(_0x3bd54f,null))['then'](respondWithResult(_0x3bd54f,null))['catch'](handleError(_0x3bd54f,null));};exports[_0x2036('0xb2')]=function(_0x4605f1,_0x4c9a5d){return db[_0x2036('0x42')][_0x2036('0xb2')](_0x4605f1[_0x2036('0xb3')],{})[_0x2036('0x21')](respondWithResult(_0x4c9a5d,0xc9))['catch'](handleError(_0x4c9a5d,null));};exports[_0x2036('0xb4')]=function(_0x3835de,_0x42bd04){if(_0x3835de[_0x2036('0xb3')]['id']){delete _0x3835de[_0x2036('0xb3')]['id'];}return db[_0x2036('0x42')]['find']({'where':{'id':_0x3835de[_0x2036('0xaf')]['id']}})[_0x2036('0x21')](handleEntityNotFound(_0x42bd04,null))[_0x2036('0x21')](saveUpdates(_0x3835de[_0x2036('0xb3')],null))['then'](respondWithResult(_0x42bd04,null))[_0x2036('0x2b')](handleError(_0x42bd04,null));};exports[_0x2036('0x35')]=function(_0x490d9e,_0x43e276){return db[_0x2036('0x42')]['find']({'where':{'id':_0x490d9e['params']['id']}})[_0x2036('0x21')](handleEntityNotFound(_0x43e276,null))[_0x2036('0x21')](removeEntity(_0x43e276,null))[_0x2036('0x2b')](handleError(_0x43e276,null));};exports[_0x2036('0xb5')]=function(_0x3a4c82,_0x5c2f5b){return db[_0x2036('0x42')][_0x2036('0xb5')]()[_0x2036('0x21')](respondWithResult(_0x5c2f5b,null))[_0x2036('0x2b')](handleError(_0x5c2f5b,null));};exports[_0x2036('0xb6')]=function(_0x500e1a,_0xf9f795){if(_0x500e1a['body']['id']){delete _0x500e1a['body']['id'];}return db[_0x2036('0x42')][_0x2036('0xb7')]({'where':{'id':_0x500e1a['params']['id']}})['then'](handleEntityNotFound(_0xf9f795,null))[_0x2036('0x21')](saveUpdates(_0x500e1a['body'],null))[_0x2036('0x21')](respondWithResult(_0xf9f795,null))['catch'](handleError(_0xf9f795,null));};exports[_0x2036('0xb8')]=function(_0xc6a474,_0x31134f,_0x49df1a){if(_0xc6a474['body']['id']){delete _0xc6a474[_0x2036('0xb3')]['id'];}return db[_0x2036('0x42')][_0x2036('0xb7')]({'where':{'id':_0xc6a474[_0x2036('0xaf')]['id']}})[_0x2036('0x21')](function(_0x2e1309){if(!_0x2e1309){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x2036('0xb8'),0x194,'entity\x20not\x20found');_0x31134f[_0x2036('0x2c')](0x194);}else{if(_0x2e1309['UserId']){throw new db['Sequelize'][(_0x2036('0xb9'))](_0x2036('0xba'));}}return _0x2e1309;})[_0x2036('0x21')](function(_0x2d3b62){if(_0x2d3b62){return _0x2d3b62['update']({'closed':_0xc6a474[_0x2036('0xb3')]['closed'],'disposition':_0xc6a474[_0x2036('0xb3')][_0x2036('0xbb')]})['then'](function(_0x49fd92){return _0x49fd92;});}})[_0x2036('0x21')](function(_0x1ee50d){return respondWithRpcPromise(_0x2036('0xbc'),_0x2036('0xb8'),_0xc6a474[_0x2036('0xb3')],client9004);})[_0x2036('0x21')](respondWithResult(_0x31134f,null))[_0x2036('0x2b')](handleError(_0x31134f,null));};exports['attachmentUpload']=function(_0x487f06,_0x447c8f,_0x24dffd){_0x487f06[_0x2036('0xb3')][_0x2036('0x38')]=_0x487f06[_0x2036('0xbd')][_0x2036('0xbe')];_0x487f06[_0x2036('0xb3')][_0x2036('0xbf')]=_0x487f06['file']['filename'];_0x487f06[_0x2036('0xb3')][_0x2036('0xc0')]=_0x487f06[_0x2036('0xbd')][_0x2036('0xc1')];return db[_0x2036('0xc2')]['create'](_0x487f06['body'])[_0x2036('0x21')](respondWithResult(_0x447c8f,0xc9))[_0x2036('0x2b')](handleError(_0x447c8f,null));};exports['attachmentDownload']=function(_0x547000,_0xeead9a,_0x45eb9d){return db[_0x2036('0x42')]['findOne']({'where':{'id':_0x547000['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0xeead9a,null))['then'](function(_0x2c5b67){if(_0x2c5b67){if(_0x2c5b67[_0x2036('0xc3')]){return _0xeead9a[_0x2036('0x2d')](0x193)[_0x2036('0x32')]({'status':0x193,'message':'Unauthorized'});}return db[_0x2036('0xc2')][_0x2036('0xc4')]({'where':{'id':_0x547000[_0x2036('0x44')][_0x2036('0xc5')]},'raw':!![]})[_0x2036('0x21')](handleEntityNotFound(_0xeead9a,null));}})[_0x2036('0x21')](function(_0x4e1872){if(_0x4e1872){return _0xeead9a[_0x2036('0xc6')](path['join'](config[_0x2036('0xc7')],_0x2036('0xc8'),_0x4e1872['basename']));}})[_0x2036('0x2b')](handleError(_0xeead9a,null));};exports['close']=function(_0x11695e,_0x3f9ab9){var _0x4a4478=null;var _0x3aeb9c=null;var _0x5dbf21=null;var _0xf2fcec=null;if(_0x11695e['body']['id']){delete _0x11695e[_0x2036('0xb3')]['id'];}if(_0x11695e[_0x2036('0xb3')]['mailTranscript']){_0xf2fcec=path[_0x2036('0x8a')](config['root'],_0x2036('0xc9'),util['format'](_0x2036('0xca'),Date[_0x2036('0xcb')]()));_0x11695e[_0x2036('0xb3')][_0x2036('0xcc')]=_0xf2fcec;}return db[_0x2036('0x42')][_0x2036('0xb7')]({'where':{'id':_0x11695e[_0x2036('0xaf')]['id']},'include':[{'model':db[_0x2036('0xcd')],'as':_0x2036('0xce'),'include':[{'model':db[_0x2036('0xcf')],'as':_0x2036('0xcf')}]}]})[_0x2036('0x21')](handleEntityNotFound(_0x3f9ab9,null))[_0x2036('0x21')](saveUpdates(_0x11695e[_0x2036('0xb3')],null))['then'](function(_0x168623){if(_0x168623){_0x4a4478=_0x168623;return db[_0x2036('0xd0')]['find']({'where':{'id':_0x4a4478[_0x2036('0x80')]}});}})[_0x2036('0x21')](function(_0x1da127){if(_0x1da127){_0x5dbf21=_0x1da127;return db[_0x2036('0xd1')][_0x2036('0xb7')]({'where':{'id':_0x4a4478[_0x2036('0x7a')]}});}})[_0x2036('0x21')](function(_0x450167){if(_0x450167){_0x3aeb9c=_0x450167;if(_0xf2fcec){var _0x1d25d3=null;for(var _0x1ac250=0x1;_0x1ac250<_0x4a4478['Messages']['length'];++_0x1ac250){_0x1d25d3=_0x4a4478['Messages'][_0x1ac250];var _0x14a1ec=_0x1d25d3[_0x2036('0xd2')]?util[_0x2036('0x6b')](_0x2036('0xd3'),_0x5dbf21[_0x2036('0xd4')],_0x1d25d3['UserId']):'System';var _0xa56910=_0x11695e[_0x2036('0xb3')]['customer']||util[_0x2036('0x6b')](_0x2036('0xd3'),_0x2036('0xd5'),_0x1d25d3['ContactId']);switch(_0x5dbf21[_0x2036('0xd6')]){case _0x2036('0xd7'):_0x14a1ec=_0x1d25d3[_0x2036('0xd2')]?util[_0x2036('0x6b')](_0x2036('0xd3'),_0x5dbf21['agentAlias'],_0x1d25d3['UserId']):_0x2036('0xd8');break;case _0x2036('0xd9'):_0x14a1ec=_0x1d25d3[_0x2036('0xd2')]?_0x1d25d3[_0x2036('0xcf')]['alias']||_0x1d25d3[_0x2036('0xcf')][_0x2036('0xda')]:'System';break;case _0x2036('0xdb'):_0x14a1ec=_0x1d25d3[_0x2036('0xd2')]?_0x1d25d3[_0x2036('0xcf')][_0x2036('0xda')]:_0x2036('0xd8');break;default:_0x14a1ec=_0x1d25d3[_0x2036('0xd2')]?util['format'](_0x2036('0xd3'),_0x5dbf21[_0x2036('0xd4')],_0x1d25d3['UserId']):_0x2036('0xd8');}var _0x23eca6=util[_0x2036('0x6b')]('[%s]\x20%s:\x20%s\x0a',moment(_0x1d25d3[_0x2036('0x65')])[_0x2036('0x6b')](_0x2036('0xdc')),_0x1d25d3['direction']==='in'?_0xa56910:_0x14a1ec,_0x1d25d3[_0x2036('0xb3')]);if(!_0x1d25d3[_0x2036('0xdd')]){fs[_0x2036('0xde')](_0xf2fcec,_0x23eca6);}}return db[_0x2036('0xdf')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x2036('0xe0')],'as':'Smtp','raw':!![]}]});}}})[_0x2036('0x21')](function(_0x27ff2c){if(_0x27ff2c&&_0x27ff2c[_0x2036('0xe1')]&&_0x11695e[_0x2036('0xb3')]){var _0xbc69e5={'tls':{'rejectUnauthorized':![]}};if(_0x27ff2c[_0x2036('0xe1')]['service']){_0xbc69e5[_0x2036('0xe2')]=_0x27ff2c[_0x2036('0xe1')]['service'];}else{_0xbc69e5['host']=_0x27ff2c[_0x2036('0xe1')][_0x2036('0xe3')];_0xbc69e5[_0x2036('0xe4')]=_0x27ff2c[_0x2036('0xe1')]['port'];_0xbc69e5[_0x2036('0xe5')]=_0x27ff2c['Smtp'][_0x2036('0xe5')];}if(_0x27ff2c[_0x2036('0xe1')][_0x2036('0xe6')]){_0xbc69e5['auth']={'user':_0x27ff2c[_0x2036('0xe1')]['user'],'pass':_0x27ff2c[_0x2036('0xe1')][_0x2036('0xe7')]};}return respondWithRpcPromise(_0x2036('0xe8'),'sendMail',{'account':_0xbc69e5,'message':{'from':util[_0x2036('0x6b')](_0x2036('0xe9'),_0x27ff2c[_0x2036('0x38')],_0x27ff2c[_0x2036('0xea')]||_0x27ff2c[_0x2036('0xe1')][_0x2036('0xeb')]),'to':_0x11695e[_0x2036('0xb3')][_0x2036('0xec')],'subject':'Mail\x20Transcript','text':util[_0x2036('0x6b')](_0x2036('0xed'),_0x11695e[_0x2036('0xb3')][_0x2036('0xec')]),'attachments':[{'path':_0xf2fcec}]}})[_0x2036('0x21')](function(){return _0x4a4478;})['catch'](function(_0x160ce9){console[_0x2036('0x27')](_0x160ce9);});}else{return _0x4a4478;}})[_0x2036('0x21')](respondWithStatusCode(_0x3f9ab9,0xc8))[_0x2036('0x2b')](handleError(_0x3f9ab9,null));};exports[_0x2036('0xee')]=function(_0x138fa9,_0x1a39f4,_0x5f32c6){return db[_0x2036('0xcd')]['find']({'where':{'id':_0x138fa9[_0x2036('0xaf')]['id']}})[_0x2036('0x21')](handleEntityNotFound(_0x1a39f4,null))['then'](function(_0x2b5b29){if(_0x2b5b29){return _0x2b5b29[_0x2036('0xee')](_0x138fa9[_0x2036('0xb3')][_0x2036('0xef')],_[_0x2036('0xf0')](_0x138fa9[_0x2036('0xb3')],[_0x2036('0xef'),'id'])||{});}})[_0x2036('0x21')](respondWithResult(_0x1a39f4,null))[_0x2036('0x2b')](handleError(_0x1a39f4,null));};exports[_0x2036('0xf1')]=function(_0x27e014,_0xc55ce0,_0x3003d0){var _0x1852fe={'raw':![],'where':{}};var _0x278283={};var _0x125603={'count':0x0,'rows':[]};return db[_0x2036('0x42')][_0x2036('0xc4')]({'where':{'id':_0x27e014[_0x2036('0xaf')]['id']}})[_0x2036('0x21')](handleEntityNotFound(_0xc55ce0,null))['then'](function(_0x3644b1){if(_0x3644b1){_0x278283[_0x2036('0x47')]=_[_0x2036('0x45')](db['ChatMessage'][_0x2036('0x43')]);_0x278283[_0x2036('0x44')]=_['keys'](_0x27e014[_0x2036('0x44')]);_0x278283[_0x2036('0x4d')]=_[_0x2036('0x46')](_0x278283[_0x2036('0x47')],_0x278283[_0x2036('0x44')]);_0x1852fe[_0x2036('0x48')]=_['intersection'](_0x278283[_0x2036('0x47')],qs[_0x2036('0x49')](_0x27e014['query'][_0x2036('0x49')]));_0x1852fe[_0x2036('0x48')]=_0x1852fe[_0x2036('0x48')][_0x2036('0x4a')]?_0x1852fe[_0x2036('0x48')]:_0x278283['model'];if(!_0x27e014['query']['hasOwnProperty'](_0x2036('0xf2'))){_0x1852fe[_0x2036('0x4b')]=qs[_0x2036('0x4b')](_0x27e014[_0x2036('0x44')][_0x2036('0x4b')]);_0x1852fe[_0x2036('0x2f')]=qs[_0x2036('0x2f')](_0x27e014[_0x2036('0x44')][_0x2036('0x2f')]);}_0x1852fe['order']=qs['sort'](_0x27e014[_0x2036('0x44')][_0x2036('0xf3')]);_0x1852fe['where']=qs[_0x2036('0x4d')](_[_0x2036('0xf4')](_0x27e014[_0x2036('0x44')],_0x278283[_0x2036('0x4d')]));_0x1852fe['where'][_0x2036('0xac')]=_0x3644b1['id'];if(_0x27e014[_0x2036('0x44')]['filter']){_0x1852fe[_0x2036('0x4c')]=_['merge'](_0x1852fe[_0x2036('0x4c')],{'$or':_['map'](_0x1852fe[_0x2036('0x48')],function(_0x30f64d){var _0x164434={};_0x164434[_0x30f64d]={'$like':'%'+_0x27e014[_0x2036('0x44')]['filter']+'%'};return _0x164434;})});}if(_0x27e014['query']['$gte']){var _0x2b42b8=_0x27e014[_0x2036('0x44')][_0x2036('0xf5')]['split'](',');var _0x1966e6={};_0x1966e6[_0x2b42b8[0x0]]={'$gte':moment(_0x2b42b8[0x1])[_0x2036('0x6b')](_0x2036('0xf6'))};_0x1852fe[_0x2036('0x4c')]=_[_0x2036('0xb1')](_0x1852fe['where'],_0x1966e6);}_0x1852fe=_[_0x2036('0xb1')]({},_0x1852fe,_0x27e014[_0x2036('0xf7')]);return db[_0x2036('0xcd')][_0x2036('0x2e')]({'where':_0x1852fe['where']})[_0x2036('0x21')](function(_0x211a71){_0x125603[_0x2036('0x2e')]=_0x211a71;if(_0x27e014['query']['includeAll']){_0x1852fe['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x1852fe);})[_0x2036('0x21')](function(_0x4ed438){_0x125603[_0x2036('0xad')]=_0x4ed438;return _0x125603;});}})[_0x2036('0x21')](respondWithFilteredResult(_0xc55ce0,_0x1852fe))[_0x2036('0x2b')](handleError(_0xc55ce0,null));};exports[_0x2036('0xf8')]=function(_0x47be94,_0x25bb86,_0x32d5eb){var _0x495341={'where':{}},_0x3615f8={},_0x2dec2f={'count':0x0,'rows':[]};return db[_0x2036('0x42')][_0x2036('0xc4')]({'where':{'id':_0x47be94[_0x2036('0xaf')]['id']}})[_0x2036('0x21')](handleEntityNotFound(_0x25bb86,null))['then'](function(_0x57d1ef){if(_0x57d1ef){_0x3615f8[_0x2036('0x47')]=_[_0x2036('0x45')](db[_0x2036('0xcd')][_0x2036('0x43')]);_0x3615f8[_0x2036('0x44')]=_['keys'](_0x47be94[_0x2036('0x44')]);_0x3615f8[_0x2036('0x4d')]=_[_0x2036('0x46')](_0x3615f8['model'],_0x3615f8[_0x2036('0x44')]);_0x495341['attributes']=_['intersection'](_0x3615f8['model'],qs[_0x2036('0x49')](_0x47be94['query']['fields']));_0x495341[_0x2036('0x48')]=_0x495341['attributes'][_0x2036('0x4a')]?_0x495341[_0x2036('0x48')]:_0x3615f8[_0x2036('0x47')];if(!_0x47be94[_0x2036('0x44')][_0x2036('0xf9')](_0x2036('0xf2'))){_0x495341[_0x2036('0x4b')]=qs['limit'](_0x47be94[_0x2036('0x44')][_0x2036('0x4b')]);_0x495341[_0x2036('0x2f')]=qs[_0x2036('0x2f')](_0x47be94[_0x2036('0x44')][_0x2036('0x2f')]);}_0x495341[_0x2036('0x8c')]=qs[_0x2036('0xf3')](_0x47be94[_0x2036('0x44')]['sort']);_0x495341[_0x2036('0x4c')]=qs[_0x2036('0x4d')](_['pick'](_0x47be94[_0x2036('0x44')],_0x3615f8['filters']));_0x495341[_0x2036('0x4c')]['ChatInteractionId']=_0x57d1ef['id'];if(_0x47be94[_0x2036('0x44')]['filter']){_0x495341[_0x2036('0x4c')]=_[_0x2036('0xb1')](_0x495341['where'],{'$or':_[_0x2036('0x3b')](_0x495341[_0x2036('0x48')],function(_0x2e2ae1){var _0x22eb33={};_0x22eb33[_0x2e2ae1]={'$like':'%'+_0x47be94[_0x2036('0x44')][_0x2036('0x7d')]+'%'};return _0x22eb33;})});}_0x495341[_0x2036('0x4c')][_0x2036('0xdd')]=![];if(_0x47be94[_0x2036('0x44')]['id']){_0x495341['where']['id']={'$gt':_0x47be94[_0x2036('0x44')]['id']};}_0x495341=_[_0x2036('0xb1')]({},_0x495341,_0x47be94['options']);return db[_0x2036('0xcd')]['count']({'where':_0x495341[_0x2036('0x4c')]})[_0x2036('0x21')](function(_0xaf7936){_0x2dec2f[_0x2036('0x2e')]=_0xaf7936;_0x495341['include']=[];if(_0x47be94[_0x2036('0x44')][_0x2036('0xfa')]){_0x495341[_0x2036('0xb0')][_0x2036('0x40')]({'model':db[_0x2036('0xcf')],'as':_0x2036('0xcf'),'attributes':['id',_0x2036('0xda'),'alias']});}if(_0x47be94[_0x2036('0x44')]['includeAll']){_0x495341[_0x2036('0xb0')]=[{'all':!![]}];}return db[_0x2036('0xcd')][_0x2036('0xfb')](_0x495341);})[_0x2036('0x21')](function(_0x1a5eef){_0x2dec2f['rows']=_0x1a5eef;return _0x2dec2f;});}})['then'](respondWithFilteredResult(_0x25bb86,_0x495341))[_0x2036('0x2b')](handleError(_0x25bb86,null));};exports[_0x2036('0xfc')]=function(_0x134619,_0x36e979,_0x3792f4){return db[_0x2036('0x42')][_0x2036('0xb7')]({'where':{'id':_0x134619[_0x2036('0xaf')]['id']}})['then'](handleEntityNotFound(_0x36e979,null))[_0x2036('0x21')](function(_0x1e249a){if(_0x1e249a){return _0x1e249a['setTags'](_0x134619['body'][_0x2036('0xef')],_[_0x2036('0xf0')](_0x134619['body'],['ids','id'])||{})['spread'](function(){return db[_0x2036('0xfd')][_0x2036('0xfb')]({'attributes':['id',_0x2036('0x38'),'color'],'where':{'id':_0x134619['body']['ids']}});})['then'](function(_0x3b03a8){socket[_0x2036('0xfe')](_0x2036('0xff'),{'id':Number(_0x134619[_0x2036('0xaf')]['id']),'tags':_0x3b03a8||[]});return{'id':Number(_0x134619[_0x2036('0xaf')]['id']),'tags':_0x3b03a8||[]};});}})['then'](respondWithResult(_0x36e979,null))['catch'](handleError(_0x36e979,null));};exports[_0x2036('0x100')]=function(_0x47dd20,_0x14f7d3,_0x3ab013){return db[_0x2036('0x42')][_0x2036('0xb7')]({'where':{'id':_0x47dd20[_0x2036('0xaf')]['id']}})[_0x2036('0x21')](handleEntityNotFound(_0x14f7d3,null))[_0x2036('0x21')](function(_0x542577){if(_0x542577){return _0x542577[_0x2036('0x100')](_0x47dd20['query'][_0x2036('0xef')]);}})[_0x2036('0x21')](respondWithStatusCode(_0x14f7d3,null))[_0x2036('0x2b')](handleError(_0x14f7d3,null));};exports[_0x2036('0xc6')]=function(_0x1efe52,_0x70bbec){var _0x3e3438=moment()['unix']()[_0x2036('0x89')]();var _0x41fbc1=path[_0x2036('0x8a')](config[_0x2036('0xc7')],_0x2036('0x101'),_0x2036('0x102'),_0x2036('0x103'));var _0x53c534=path[_0x2036('0x8a')](config[_0x2036('0xc7')],_0x2036('0x101'),_0x2036('0x102'),_0x2036('0x104'));var _0x4a6332=path['join'](_0x41fbc1,_0x3e3438);var _0x35ffe2=util[_0x2036('0x6b')](_0x2036('0x105'),_0x1efe52[_0x2036('0xaf')]['id'],_0x3e3438);var _0x46fdab=path[_0x2036('0x8a')](_0x41fbc1,_0x35ffe2);var _0x4d1882=![];return db[_0x2036('0x42')][_0x2036('0xb7')]({'where':{'id':_0x1efe52[_0x2036('0xaf')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x2036('0xce'),'attributes':['id',_0x2036('0xb3'),_0x2036('0x65'),_0x2036('0x106'),_0x2036('0xdd')],'include':[{'model':db[_0x2036('0xcf')],'as':'User','attributes':['id',_0x2036('0xda')],'raw':!![]},{'model':db[_0x2036('0xd1')],'as':_0x2036('0x107'),'attributes':['id',_0x2036('0x108'),'lastName'],'raw':!![]},{'model':db[_0x2036('0xc2')],'as':'Attachment','raw':!![]}]},{'model':db['ChatWebsite'],'as':_0x2036('0x109'),'attributes':['id',_0x2036('0x38')]},{'model':db[_0x2036('0xcf')],'as':_0x2036('0x10a'),'attributes':['id',_0x2036('0xda')]}]})[_0x2036('0x21')](handleEntityNotFound(_0x70bbec,null))['then'](function(_0x515128){if(_0x515128){var _0x1f011a=_0x515128[_0x2036('0x10b')]({'plain':!![]});_0x4d1882=!![];var _0x54b107={'format':'A4','border':_0x2036('0x10c'),'header':{'height':_0x2036('0x10d'),'contents':{'first':_0x2036('0x10e')}},'footer':{'height':'30px','contents':{'default':util[_0x2036('0x6b')]('\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[_0x2036('0x6b')](_0x2036('0x10f'),_0x2036('0x110'),_0x1f011a['id']),moment()[_0x2036('0x6b')](_0x2036('0x111'))[_0x2036('0x89')]())}}};fs[_0x2036('0x112')](_0x4a6332);var _0x376ad7={'channel':'Chat','account':_0x1f011a[_0x2036('0x109')][_0x2036('0x38')],'agent':_0x1f011a['Owner']?_0x1f011a[_0x2036('0x10a')][_0x2036('0xda')]:_0x2036('0x113'),'createdAt':moment(_0x1f011a[_0x2036('0x65')])[_0x2036('0x6b')](_0x2036('0xf6'))['toString'](),'closedAt':_0x1f011a[_0x2036('0xc3')]?moment(_0x1f011a[_0x2036('0x114')])[_0x2036('0x6b')](_0x2036('0xf6'))[_0x2036('0x89')]():'','disposition':_0x1f011a[_0x2036('0xbb')],'chatInfo':{'browser':_0x1f011a[_0x2036('0x115')],'os':_0x1f011a['osName'],'referer':_0x1f011a['referer'],'customerIp':_0x1f011a[_0x2036('0x116')],'customerPort':_0x1f011a[_0x2036('0x117')]?_0x1f011a[_0x2036('0x117')]:_0x2036('0x113')},'messages':_(_0x1f011a[_0x2036('0xce')])['tail']()['filter']({'secret':![]})[_0x2036('0x3b')](function(_0x128ad5){if(_0x128ad5['Attachment']){var _0x276699=path[_0x2036('0x8a')](_0x53c534,_0x128ad5[_0x2036('0xc2')][_0x2036('0xbf')]);if(fs['existsSync'](_0x276699)){fs[_0x2036('0x118')](_0x276699)[_0x2036('0x119')](fs['createWriteStream'](path[_0x2036('0x8a')](_0x4a6332,_0x128ad5[_0x2036('0xc2')][_0x2036('0xbf')])));}}return{'date':moment(_0x128ad5[_0x2036('0x65')])['format'](_0x2036('0xf6'))[_0x2036('0x89')](),'sender':_0x128ad5[_0x2036('0x106')]==='out'?_0x128ad5[_0x2036('0xcf')]?_0x128ad5[_0x2036('0xcf')][_0x2036('0xda')]:_0x2036('0xd8'):_0x128ad5[_0x2036('0x107')][_0x2036('0x108')]+(_0x128ad5[_0x2036('0x107')][_0x2036('0x11a')]?'\x20'+_0x128ad5[_0x2036('0x107')][_0x2036('0x11a')]:''),'body':_0x128ad5[_0x2036('0xc2')]?_0x128ad5[_0x2036('0xc2')][_0x2036('0xbf')]:_0x128ad5[_0x2036('0xb3')],'direction':_0x128ad5[_0x2036('0x106')]===_0x2036('0x11b')?'A':'C','secret':_0x128ad5[_0x2036('0xdd')],'attachment':_0x128ad5['Attachment']};})['value']()};return ejs[_0x2036('0x11c')](path[_0x2036('0x8a')](config[_0x2036('0xc7')],'server',_0x2036('0x11d'),_0x2036('0x11e')),{'interaction':_0x376ad7})['then'](function(_0x228b3e){return new BPromise(function(_0x529f0c,_0x8b748f){pdf['create'](_0x228b3e,_0x54b107)['toFile'](path['join'](_0x4a6332,_0x2036('0x11f')+_0x1f011a['id']+'-'+_0x3e3438+_0x2036('0x120')),function(_0x2c8740,_0x57b54e){if(_0x2c8740)return _0x8b748f(_0x2c8740);_0x529f0c(_0x57b54e);});});});}})['then'](function(){if(_0x4d1882){return new BPromise(function(_0x303218,_0x43f120){zipdir(_0x4a6332,{'saveTo':_0x46fdab},function(_0x248cfb,_0x5c919c){if(_0x248cfb)return _0x43f120(_0x248cfb);return _0x303218(_0x5c919c);});})['then'](function(){return new BPromise(function(_0xdea632,_0x1c01b8){rimraf(_0x4a6332,function(_0xc5ef45){if(_0xc5ef45)_0x1c01b8(_0xc5ef45);return _0xdea632();});});})[_0x2036('0x21')](function(){return _0x70bbec[_0x2036('0xc6')](_0x46fdab,_0x35ffe2,function(_0x52c6ff){if(_0x52c6ff){console[_0x2036('0x121')](_0x2036('0x122'),_0x52c6ff);}else{fs[_0x2036('0x123')](_0x46fdab);}});});}else{return _0x70bbec['sendStatus'](0xc8);}})[_0x2036('0x2b')](handleError(_0x70bbec,null));}; \ No newline at end of file +var _0xd824=['\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','ContactId','map','filter','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','\x20IS\x20NULL','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','split','push','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','group','i.id','QueryTypes','clone','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','sequelize','keyBy','merge','ChatInteraction','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.phone','c.mobile','c.fax','Contact.fax','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','options','find','create','body','describe','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','Sequelize','ValidationError','disposition','file','originalname','basename','filename','type','mimetype','Attachment','attachmentDownload','findOne','closed','Unauthorized','attachId','download','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','ChatWebsite','ChatWebsiteId','CmContact','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','addMessage','ids','omit','$gte','findAll','getMyMessages','setTags','Tag','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Account','Owner','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','Chat','YYYY-MM-DD','mkdirSync','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','out','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','name','send','TagIds','forEach','Tags','catch','index','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','tools_tags','COUNT(*)','chat_messages','where','me.ChatInteractionId\x20=\x20i.id','me.read\x20=\x20false','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','parse','advancedFilter','createdAt','value','dateStart','startOf','day','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','unreadMessages','\x20IN\x20?','tableAlias','\x20=\x20?','LIKE','c.firstName','c.lastName'];(function(_0x295849,_0x42b3eb){var _0x27d8d4=function(_0x375ae0){while(--_0x375ae0){_0x295849['push'](_0x295849['shift']());}};_0x27d8d4(++_0x42b3eb);}(_0xd824,0xb1));var _0x4d82=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd824[_0x4a9fb1];return _0x348672;};'use strict';var pdf=require(_0x4d82('0x0'));var emlformat=require(_0x4d82('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4d82('0x2'));var jsonpatch=require(_0x4d82('0x3'));var rp=require(_0x4d82('0x4'));var moment=require('moment');var BPromise=require(_0x4d82('0x5'));var Mustache=require(_0x4d82('0x6'));var util=require(_0x4d82('0x7'));var path=require(_0x4d82('0x8'));var sox=require(_0x4d82('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4d82('0xa'));var squel=require(_0x4d82('0xb'));var crypto=require(_0x4d82('0xc'));var jsforce=require(_0x4d82('0xd'));var deskjs=require(_0x4d82('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d82('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4d82('0x10'));var hardwareService=require(_0x4d82('0x11'));var logger=require(_0x4d82('0x12'))('api');var utils=require(_0x4d82('0x13'));var config=require('../../config/environment');var db=require(_0x4d82('0x14'))['db'];config[_0x4d82('0x15')]=_[_0x4d82('0x16')](config['redis'],{'host':_0x4d82('0x17'),'port':0x18eb});var socket=require(_0x4d82('0x18'))(new Redis(config[_0x4d82('0x15')]));require(_0x4d82('0x19'))[_0x4d82('0x1a')](socket);var jayson=require(_0x4d82('0x1b'));var client=jayson['client'][_0x4d82('0x1c')]({'port':0x232b});var client9004=jayson[_0x4d82('0x1d')][_0x4d82('0x1c')]({'port':0x232c});function checkPasswordPattern(_0xe38f03,_0x221da4,_0x325a7f){if(_0x325a7f){var _0x388339=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x388339['test'](_0x221da4)){return _0xe38f03;}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 _0xe38f03;}}function respondWithRpcPromise(_0x119a69,_0x42631e,_0x5f0590,_0x53bb11){return new BPromise(function(_0x40e8fa,_0x30a0b2){var _0x53168c=_0x53bb11||client;return _0x53168c[_0x4d82('0x1e')](_0x119a69,_0x5f0590)['then'](function(_0x3b02a1){logger[_0x4d82('0x1f')](_0x4d82('0x20'),_0x42631e,_0x4d82('0x21'));logger[_0x4d82('0x22')](_0x4d82('0x23'),_0x42631e,_0x4d82('0x21'),JSON[_0x4d82('0x24')](_0x3b02a1));if(_0x3b02a1[_0x4d82('0x25')]){if(_0x3b02a1[_0x4d82('0x25')][_0x4d82('0x26')]===0x1f4){logger['error'](_0x4d82('0x20'),_0x42631e,_0x3b02a1[_0x4d82('0x25')][_0x4d82('0x27')]);return _0x30a0b2(_0x3b02a1[_0x4d82('0x25')][_0x4d82('0x27')]);}logger['error'](_0x4d82('0x20'),_0x42631e,_0x3b02a1[_0x4d82('0x25')][_0x4d82('0x27')]);return _0x40e8fa(_0x3b02a1[_0x4d82('0x25')][_0x4d82('0x27')]);}else{logger[_0x4d82('0x1f')](_0x4d82('0x20'),_0x42631e,_0x4d82('0x21'));_0x40e8fa(_0x3b02a1[_0x4d82('0x28')][_0x4d82('0x27')]);}})['catch'](function(_0x169948){logger[_0x4d82('0x25')](_0x4d82('0x20'),_0x42631e,_0x169948);_0x30a0b2(_0x169948);});});}function respondWithStatusCode(_0x354cc0,_0x1bac87){_0x1bac87=_0x1bac87||0xcc;return function(_0x4ea282){if(_0x4ea282){return _0x354cc0['sendStatus'](_0x1bac87);}return _0x354cc0[_0x4d82('0x29')](_0x1bac87)[_0x4d82('0x2a')]();};}function respondWithResult(_0x1d5aee,_0x251195){_0x251195=_0x251195||0xc8;return function(_0x48e979){if(_0x48e979){return _0x1d5aee[_0x4d82('0x29')](_0x251195)['json'](_0x48e979);}};}function respondWithFilteredResult(_0x34f7ae,_0x214e62){return function(_0xe3aba9){if(_0xe3aba9){var _0x14318a=_0xe3aba9[_0x4d82('0x2b')],_0x24aed9=_0x214e62[_0x4d82('0x2c')],_0x2a6cd1=_0x214e62[_0x4d82('0x2c')]+_0x214e62[_0x4d82('0x2d')],_0x288e3b;if(_0x2a6cd1>=_0x14318a){_0x2a6cd1=_0x14318a;_0x288e3b=0xc8;}else{_0x288e3b=0xce;}_0x34f7ae[_0x4d82('0x29')](_0x288e3b);return _0x34f7ae[_0x4d82('0x2e')](_0x4d82('0x2f'),_0x24aed9+'-'+_0x2a6cd1+'/'+_0x14318a)[_0x4d82('0x30')](_0xe3aba9);}return null;};}function patchUpdates(_0xb3551b){return function(_0xe77b33){try{jsonpatch[_0x4d82('0x31')](_0xe77b33,_0xb3551b,!![]);}catch(_0x3ca93a){return BPromise['reject'](_0x3ca93a);}return _0xe77b33[_0x4d82('0x32')]();};}function saveUpdates(_0x3a790c,_0xc3cd68){return function(_0xa56d12){if(_0xa56d12){return _0xa56d12[_0x4d82('0x33')](_0x3a790c)[_0x4d82('0x34')](function(_0x251b91){return _0x251b91;});}return null;};}function removeEntity(_0x47e952,_0x4496c9){return function(_0x314c78){if(_0x314c78){return _0x314c78[_0x4d82('0x35')]()[_0x4d82('0x34')](function(){_0x47e952[_0x4d82('0x29')](0xcc)[_0x4d82('0x2a')]();});}};}function handleEntityNotFound(_0x1db3a2,_0x567b73){return function(_0x3e3ff6){if(!_0x3e3ff6){_0x1db3a2[_0x4d82('0x36')](0x194);}return _0x3e3ff6;};}function handleError(_0x2a61fd,_0x1f176c){_0x1f176c=_0x1f176c||0x1f4;return function(_0x39f8db){logger['error'](_0x39f8db['stack']);if(_0x39f8db[_0x4d82('0x37')]){delete _0x39f8db[_0x4d82('0x37')];}_0x2a61fd[_0x4d82('0x29')](_0x1f176c)[_0x4d82('0x38')](_0x39f8db);};}function getInteractionUsers(_0x169189,_0xf12b1){return new BPromise(function(_0x5dcf7e,_0x57952f){try{if(_0xf12b1[_0x169189['id']]){_0x169189['Users']=_['map'](_0xf12b1[_0x169189['id']],function(_0x373912){return{'id':_0x373912['id']};});}}catch(_0x2c24ed){_0x57952f(_0x2c24ed);}_0x5dcf7e(_0x169189);});}function getInteractionTags(_0x362110,_0x1bd4dc){return new BPromise(function(_0xc168c5,_0x12ef6f){try{if(_0x362110[_0x4d82('0x39')]){_0x362110['Tags']=[];_0x362110[_0x4d82('0x39')]['split'](',')[_0x4d82('0x3a')](function(_0x5a0076){_0x362110[_0x4d82('0x3b')]['push'](_0x1bd4dc[_0x5a0076]);});}delete _0x362110['TagIds'];}catch(_0x3fdf5f){_0x12ef6f(_0x3fdf5f);}_0xc168c5(_0x362110);});}function updateChatInteraction(_0x4e84c0,_0x5a3982,_0x176262){return new BPromise(function(_0x323caf,_0x2d2d3f){return getInteractionUsers(_0x4e84c0,_0x176262)['then'](function(_0x19950c){return getInteractionTags(_0x19950c,_0x5a3982);})[_0x4d82('0x34')](function(_0x101d4b){_0x323caf(_0x101d4b);})[_0x4d82('0x3c')](function(_0x382405){_0x2d2d3f(_0x382405);});});}exports[_0x4d82('0x3d')]=function(_0x1dc9e4,_0x447ade){var _0xdf45f6={},_0x14b595={},_0x1b7f75={'count':0x0,'rows':[]};var _0x2a0897=db['ChatInteraction'][_0x4d82('0x3e')];_0x14b595[_0x4d82('0x3f')]=_[_0x4d82('0x40')](_0x2a0897);_0x14b595['query']=_[_0x4d82('0x40')](_0x1dc9e4['query']);_0x14b595[_0x4d82('0x41')]=_[_0x4d82('0x42')](_0x14b595[_0x4d82('0x3f')],_0x14b595[_0x4d82('0x43')]);_0xdf45f6[_0x4d82('0x44')]=_[_0x4d82('0x42')](_0x14b595['model'],qs['fields'](_0x1dc9e4['query'][_0x4d82('0x45')]));_0xdf45f6[_0x4d82('0x44')]=_0xdf45f6[_0x4d82('0x44')][_0x4d82('0x46')]?_0xdf45f6[_0x4d82('0x44')]:_0x14b595[_0x4d82('0x3f')];if(!_0x1dc9e4['query'][_0x4d82('0x47')](_0x4d82('0x48'))){_0xdf45f6[_0x4d82('0x2d')]=qs[_0x4d82('0x2d')](_0x1dc9e4[_0x4d82('0x43')][_0x4d82('0x2d')]);_0xdf45f6[_0x4d82('0x2c')]=qs['offset'](_0x1dc9e4[_0x4d82('0x43')]['offset']);}_0xdf45f6['order']=qs[_0x4d82('0x49')](_0x1dc9e4[_0x4d82('0x43')][_0x4d82('0x49')]);_0xdf45f6['where']=qs[_0x4d82('0x41')](_[_0x4d82('0x4a')](_0x1dc9e4[_0x4d82('0x43')],_0x14b595[_0x4d82('0x41')]));var _0x3539b5=[];var _0x57191d=squel[_0x4d82('0x4b')]()['field']('id')[_0x4d82('0x4c')]('name')['field'](_0x4d82('0x4d'))[_0x4d82('0x4e')](_0x4d82('0x4f'));var _0x451d01=squel[_0x4d82('0x4b')]()[_0x4d82('0x4c')](_0x4d82('0x50'))[_0x4d82('0x4e')](_0x4d82('0x51'),'me')[_0x4d82('0x52')](_0x4d82('0x53'))[_0x4d82('0x52')]('me.direction\x20=\x20\x27in\x27')['where'](_0x4d82('0x54'));var _0x1f9536=squel[_0x4d82('0x4b')]()[_0x4d82('0x4c')](_0x4d82('0x55'))[_0x4d82('0x4c')](_0x4d82('0x56'))[_0x4d82('0x4e')](_0x4d82('0x57'),'ui')[_0x4d82('0x58')](_0x4d82('0x59'),'u','u.id\x20=\x20ui.UserId');var _0x1ac93a=squel['select']()[_0x4d82('0x4e')](_0x4d82('0x5a'),'i')['left_join'](_0x4d82('0x5b'),'c',_0x4d82('0x5c'))[_0x4d82('0x58')](_0x4d82('0x59'),'o','o.id\x20=\x20i.UserId')['left_join']('chat_websites','a',_0x4d82('0x5d'))[_0x4d82('0x58')](_0x4d82('0x51'),'me',_0x4d82('0x5e'));var _0x1f9ae7=squel['expr']();if(_0x1dc9e4['query']['advancedFilter']){var _0x29c996=JSON[_0x4d82('0x5f')](_0x1dc9e4[_0x4d82('0x43')][_0x4d82('0x60')]);_[_0x4d82('0x40')](_0x29c996)[_0x4d82('0x3a')](function(_0x1c439c){var _0x2f3a1d=_0x29c996[_0x1c439c];if(_0x1c439c===_0x4d82('0x61')){var _0x157d46=moment(_0x2f3a1d[_0x4d82('0x62')][_0x4d82('0x63')])[_0x4d82('0x64')](_0x4d82('0x65'))[_0x4d82('0x66')]()[_0x4d82('0x67')]();var _0x4ac0a8=moment(_0x4ac0a8)['utc']()[_0x4d82('0x68')](_0x4d82('0x65'))[_0x4d82('0x67')]();_0x1f9ae7[_0x4d82('0x69')](_0x4d82('0x6a'),_0x157d46,_0x4ac0a8);}else{if(_[_0x4d82('0x6b')](_0x2f3a1d[_0x4d82('0x6c')])){_0x2f3a1d[_0x4d82('0x6c')][_0x4d82('0x3a')](function(_0x3e046a){switch(_0x2f3a1d[_0x4d82('0x6c')][_0x4d82('0x62')]){case'IS':if(_0x1c439c!==_0x4d82('0x6d')&&_0x1c439c!==_0x4d82('0x6e')){if(_[_0x4d82('0x6b')](_0x2f3a1d[_0x4d82('0x62')])&&_0x2f3a1d[_0x4d82('0x62')]['length']>0x1){_0x1f9ae7[_0x4d82('0x69')](_0x2f3a1d['tableAlias']+'.'+_0x1c439c+_0x4d82('0x6f'),_0x2f3a1d[_0x4d82('0x62')]);}else{_0x1f9ae7[_0x4d82('0x69')](_0x2f3a1d[_0x4d82('0x70')]+'.'+_0x1c439c+_0x4d82('0x71'),_0x2f3a1d[_0x4d82('0x62')][0x0]);}}break;case'=':_0x1f9ae7[_0x4d82('0x69')](_0x2f3a1d[_0x4d82('0x70')]+'.'+_0x1c439c+_0x4d82('0x71'),_0x2f3a1d['value']);break;case _0x4d82('0x72'):if(_0x1c439c==='ContactId'){_0x1f9ae7['and'](_0x4d82('0x73')+'\x20LIKE\x20?','%'+_0x2f3a1d[_0x4d82('0x62')]+'%');_0x1f9ae7['or'](_0x4d82('0x74')+_0x4d82('0x75'),'%'+_0x2f3a1d[_0x4d82('0x62')]+'%');_0x1f9ae7['or'](_0x4d82('0x76')+_0x4d82('0x75'),'%'+_0x2f3a1d[_0x4d82('0x62')]+'%');}else{_0x1f9ae7['and'](_0x2f3a1d[_0x4d82('0x70')]+'.'+_0x1c439c+'\x20LIKE\x20?','%'+_0x2f3a1d[_0x4d82('0x62')]+'%');}break;case'>':_0x1f9ae7[_0x4d82('0x69')](_0x2f3a1d[_0x4d82('0x70')]+'.'+_0x1c439c+_0x4d82('0x77'),_0x2f3a1d[_0x4d82('0x62')]);break;case'<':_0x1f9ae7[_0x4d82('0x69')](_0x2f3a1d['tableAlias']+'.'+_0x1c439c+_0x4d82('0x78'),_0x2f3a1d[_0x4d82('0x62')]);break;}});}else{switch(_0x2f3a1d[_0x4d82('0x6c')][_0x4d82('0x62')]){case'IS':if(_0x1c439c!==_0x4d82('0x6d')&&_0x1c439c!==_0x4d82('0x6e')){if(_['isArray'](_0x2f3a1d[_0x4d82('0x62')])&&_0x2f3a1d[_0x4d82('0x62')][_0x4d82('0x46')]>0x1){_0x1f9ae7['and'](_0x2f3a1d['tableAlias']+'.'+_0x1c439c+_0x4d82('0x6f'),_0x2f3a1d[_0x4d82('0x62')]);}else{_0x1f9ae7[_0x4d82('0x69')](_0x2f3a1d['tableAlias']+'.'+_0x1c439c+_0x4d82('0x71'),_0x2f3a1d['value'][0x0]);}}break;case'=':_0x1f9ae7[_0x4d82('0x69')](_0x2f3a1d[_0x4d82('0x70')]+'.'+_0x1c439c+'\x20=\x20?',_0x2f3a1d[_0x4d82('0x62')]);break;case _0x4d82('0x72'):if(_0x1c439c===_0x4d82('0x79')){_0x1f9ae7[_0x4d82('0x69')](_0x4d82('0x73')+_0x4d82('0x75'),'%'+_0x2f3a1d['value']+'%');_0x1f9ae7['or'](_0x4d82('0x74')+_0x4d82('0x75'),'%'+_0x2f3a1d[_0x4d82('0x62')]+'%');_0x1f9ae7['or'](_0x4d82('0x76')+_0x4d82('0x75'),'%'+_0x2f3a1d['value']+'%');}else{_0x1f9ae7[_0x4d82('0x69')](_0x2f3a1d['tableAlias']+'.'+_0x1c439c+_0x4d82('0x75'),'%'+_0x2f3a1d[_0x4d82('0x62')]+'%');}break;case'>':_0x1f9ae7[_0x4d82('0x69')](_0x2f3a1d[_0x4d82('0x70')]+'.'+_0x1c439c+_0x4d82('0x77'),_0x2f3a1d[_0x4d82('0x62')]);break;case'<':_0x1f9ae7[_0x4d82('0x69')](_0x2f3a1d['tableAlias']+'.'+_0x1c439c+_0x4d82('0x78'),_0x2f3a1d[_0x4d82('0x62')]);break;}}}});}else{var _0x4a840a=_(Object[_0x4d82('0x40')](_0x1dc9e4[_0x4d82('0x43')]))[_0x4d82('0x7a')](function(_0xb47fc0){return _0x2a0897['hasOwnProperty'](_0xb47fc0)?_0xb47fc0:undefined;})[_0x4d82('0x7b')](function(_0x537778){return!_['isNil'](_0x537778);})[_0x4d82('0x62')]();if(!_[_0x4d82('0x7c')](_0x4a840a)){_0x4a840a[_0x4d82('0x3a')](function(_0x5f49fe){if(_0x5f49fe==='ChatWebsiteId'){_0x1ac93a[_0x4d82('0x52')](_0x4d82('0x7d'),[][_0x4d82('0x7e')](_0x1dc9e4['query'][_0x5f49fe]));}else if(_0x5f49fe===_0x4d82('0x61')){var _0x5c2b3=JSON[_0x4d82('0x5f')](_0x1dc9e4[_0x4d82('0x43')][_0x5f49fe])['$gte'];var _0x410521=JSON[_0x4d82('0x5f')](_0x1dc9e4[_0x4d82('0x43')][_0x5f49fe])['$lte'];_0x1ac93a[_0x4d82('0x52')](_0x4d82('0x6a'),_0x5c2b3,_0x410521);}else{if(_0x1dc9e4[_0x4d82('0x43')][_0x5f49fe]==='null'){_0x1ac93a['where']('i.'+_0x5f49fe+_0x4d82('0x7f'));}else{_0x1ac93a[_0x4d82('0x52')]('i.'+_0x5f49fe+_0x4d82('0x71'),_0x1dc9e4[_0x4d82('0x43')][_0x5f49fe]);}}});}if(_0x1dc9e4[_0x4d82('0x43')][_0x4d82('0x7b')]){var _0x5480fc=_0x1dc9e4[_0x4d82('0x43')][_0x4d82('0x7b')][_0x4d82('0x80')]('\x5c','\x5c\x5c')[_0x4d82('0x80')]('\x27\x27',_0x4d82('0x81'));if(qs['isNumeric'](_0x5480fc)){_0x1f9ae7['or'](_0x4d82('0x82'),_0x5480fc+'%');}else{var _0x585b9c=[];_0x5480fc[_0x4d82('0x83')]('\x20')[_0x4d82('0x3a')](function(_0x52f20c){_0x585b9c[_0x4d82('0x84')]('+'+_0x52f20c[_0x4d82('0x85')]());});var _0x450cab=_0x585b9c[_0x4d82('0x86')]('\x20');_0x1f9ae7['or'](_0x4d82('0x87'),_0x450cab)['or'](_0x4d82('0x88'),_0x5480fc+'%');}}}_0x1ac93a['where'](_0x1f9ae7);if(_0xdf45f6[_0x4d82('0x89')]){_0xdf45f6['order'][_0x4d82('0x3a')](function(_0x5ef7aa){_0x1ac93a[_0x4d82('0x89')]('i.'+_0x5ef7aa[0x0],_0x5ef7aa[0x1]==='DESC'?![]:!![]);});}_0x1ac93a[_0x4d82('0x8a')](_0x4d82('0x8b'));var _0x1e840c={'type':db['Sequelize'][_0x4d82('0x8c')]['SELECT'],'raw':!![]};var _0x79a74f=_0x1ac93a[_0x4d82('0x8d')]()[_0x4d82('0x4c')](_0x4d82('0x50'))[_0x4d82('0x4c')](_0x4d82('0x8e'),'unreadMessages');if(!_0x1dc9e4[_0x4d82('0x43')][_0x4d82('0x60')]){if(_0x1dc9e4[_0x4d82('0x43')][_0x4d82('0x8f')]){if(_0x1dc9e4[_0x4d82('0x43')][_0x4d82('0x8f')]==0x1){_0x79a74f[_0x4d82('0x90')](_0x4d82('0x91'));_0x1ac93a[_0x4d82('0x90')](_0x4d82('0x91'));}else{_0x79a74f[_0x4d82('0x90')](_0x4d82('0x92'));_0x1ac93a['having']('`unreadMessages`\x20>\x200');}}if(_0x1dc9e4[_0x4d82('0x43')][_0x4d82('0x93')]){var _0x46f77c=_[_0x4d82('0x6b')](_0x1dc9e4['query'][_0x4d82('0x93')])?_0x1dc9e4[_0x4d82('0x43')][_0x4d82('0x93')]:new Array(_0x1dc9e4['query'][_0x4d82('0x93')]);var _0x46bb4e=squel['expr']();_0x46f77c['forEach'](function(_0x47a1b1){_0x46bb4e['or'](_0x4d82('0x94'),'%,'+_0x47a1b1+',%');});_0x1ac93a['having'](_0x46bb4e);_0x79a74f[_0x4d82('0x58')](_0x4d82('0x95'),'it',_0x4d82('0x96'));_0x79a74f[_0x4d82('0x58')](_0x4d82('0x4f'),'t',_0x4d82('0x97'));_0x79a74f['where'](_0x4d82('0x98'),_0x46f77c);}}else{var _0x29c996=JSON[_0x4d82('0x5f')](_0x1dc9e4['query'][_0x4d82('0x60')]);_[_0x4d82('0x40')](_0x29c996)[_0x4d82('0x3a')](function(_0x55fa0f){var _0x2ad91d=_0x29c996[_0x55fa0f];if(_0x55fa0f===_0x4d82('0x6d')){var _0x181ac5=_0x2ad91d[_0x4d82('0x62')];var _0x5eb8f6=squel['expr']();_0x181ac5[_0x4d82('0x3a')](function(_0x504966){_0x5eb8f6['or'](_0x4d82('0x94'),'%,'+_0x504966+',%');});_0x1ac93a[_0x4d82('0x90')](_0x5eb8f6);_0x79a74f['left_join'](_0x4d82('0x99'),'it','it.MailInteractionId\x20=\x20i.id');_0x79a74f[_0x4d82('0x58')](_0x4d82('0x4f'),'t',_0x4d82('0x97'));_0x79a74f[_0x4d82('0x52')](_0x4d82('0x98'),_0x181ac5);}else if(_0x55fa0f==='unreadMessages'){if(_0x2ad91d[_0x4d82('0x62')]['length']===0x1){if(_0x2ad91d[_0x4d82('0x62')][0x0]===0x1){_0x79a74f[_0x4d82('0x90')](_0x4d82('0x91'));_0x1ac93a['having'](_0x4d82('0x91'));}else{_0x79a74f[_0x4d82('0x90')](_0x4d82('0x92'));_0x1ac93a[_0x4d82('0x90')](_0x4d82('0x92'));}}}});}db[_0x4d82('0x9a')][_0x4d82('0x43')](_0x79a74f[_0x4d82('0x85')](),_0x1e840c)[_0x4d82('0x34')](function(_0x21cf88){_0x1b7f75[_0x4d82('0x2b')]=_0x21cf88[_0x4d82('0x46')];if(_0x1b7f75['count']===0x0)return[];return db[_0x4d82('0x9a')][_0x4d82('0x43')](_0x57191d[_0x4d82('0x85')](),_0x1e840c)['then'](function(_0x2f8fe4){_0x3539b5=_[_0x4d82('0x9b')](_0x2f8fe4,'id');_0x1e840c=_[_0x4d82('0x9c')](_0x1e840c,{'model':db[_0x4d82('0x9d')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1ac93a['field']('COUNT(me.id)',_0x4d82('0x6e'));_0x1ac93a[_0x4d82('0x4c')]('a.key','Account.key');_0x1ac93a['field'](_0x4d82('0x9e'),_0x4d82('0x9f'));_0x1ac93a['field'](_0x4d82('0xa0'));_0x1ac93a['field'](_0x4d82('0x73'),_0x4d82('0xa1'));_0x1ac93a[_0x4d82('0x4c')](_0x4d82('0x74'),'Contact.lastName');_0x1ac93a['field'](_0x4d82('0x76'),'Contact.email');_0x1ac93a['field']('c.phone',_0x4d82('0xa2'));_0x1ac93a[_0x4d82('0x4c')](_0x4d82('0xa3'),'Contact.mobile');_0x1ac93a[_0x4d82('0x4c')](_0x4d82('0xa4'),_0x4d82('0xa5'));_0x1ac93a['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');_0x1ac93a[_0x4d82('0x58')](_0x4d82('0x95'),'it',_0x4d82('0x96'));_0x1ac93a[_0x4d82('0x58')](_0x4d82('0x4f'),'t',_0x4d82('0x97'));_0x1ac93a[_0x4d82('0x2d')](_0xdf45f6[_0x4d82('0x2d')]);_0x1ac93a[_0x4d82('0x2c')](_0xdf45f6[_0x4d82('0x2c')]);return db[_0x4d82('0x9a')][_0x4d82('0x43')](_0x1ac93a[_0x4d82('0x85')](),_0x1e840c);})[_0x4d82('0x34')](function(_0x14cbc8){_0x1f9536[_0x4d82('0x52')](_0x4d82('0xa6'),_[_0x4d82('0x7a')](_0x14cbc8,'id'));return db[_0x4d82('0x9a')]['query'](_0x1f9536[_0x4d82('0x85')](),_0x1e840c)[_0x4d82('0x34')](function(_0x23099f){var _0x585aa2=_[_0x4d82('0xa7')](_0x23099f,_0x4d82('0xa8'));var _0x4cc5b3=[];_0x14cbc8[_0x4d82('0x3a')](function(_0x3547db){_0x4cc5b3[_0x4d82('0x84')](updateChatInteraction(_0x3547db,_0x3539b5,_0x585aa2));});return BPromise[_0x4d82('0xa9')](_0x4cc5b3);});});})[_0x4d82('0x34')](function(_0x3ae5fd){_0x1b7f75[_0x4d82('0xaa')]=_0x3ae5fd;return _0x1b7f75;})[_0x4d82('0x34')](respondWithFilteredResult(_0x447ade,_0xdf45f6))[_0x4d82('0x3c')](handleError(_0x447ade,null));};exports[_0x4d82('0xab')]=function(_0x2b493f,_0x1d099e){var _0x4f1bbc={'raw':![],'where':{'id':_0x2b493f[_0x4d82('0xac')]['id']}},_0x496ae1={};_0x496ae1[_0x4d82('0x3f')]=_['keys'](db['ChatInteraction'][_0x4d82('0x3e')]);_0x496ae1[_0x4d82('0x43')]=_[_0x4d82('0x40')](_0x2b493f[_0x4d82('0x43')]);_0x496ae1[_0x4d82('0x41')]=_[_0x4d82('0x42')](_0x496ae1['model'],_0x496ae1[_0x4d82('0x43')]);_0x4f1bbc[_0x4d82('0x44')]=_[_0x4d82('0x42')](_0x496ae1[_0x4d82('0x3f')],qs['fields'](_0x2b493f[_0x4d82('0x43')][_0x4d82('0x45')]));_0x4f1bbc[_0x4d82('0x44')]=_0x4f1bbc[_0x4d82('0x44')][_0x4d82('0x46')]?_0x4f1bbc[_0x4d82('0x44')]:_0x496ae1[_0x4d82('0x3f')];if(_0x2b493f[_0x4d82('0x43')][_0x4d82('0xad')]){_0x4f1bbc[_0x4d82('0xae')]=[{'all':!![]}];}_0x4f1bbc=_[_0x4d82('0x9c')]({},_0x4f1bbc,_0x2b493f[_0x4d82('0xaf')]);return db[_0x4d82('0x9d')][_0x4d82('0xb0')](_0x4f1bbc)[_0x4d82('0x34')](handleEntityNotFound(_0x1d099e,null))[_0x4d82('0x34')](respondWithResult(_0x1d099e,null))[_0x4d82('0x3c')](handleError(_0x1d099e,null));};exports[_0x4d82('0xb1')]=function(_0xdc051d,_0x4c6570){return db[_0x4d82('0x9d')]['create'](_0xdc051d[_0x4d82('0xb2')],{})[_0x4d82('0x34')](respondWithResult(_0x4c6570,0xc9))[_0x4d82('0x3c')](handleError(_0x4c6570,null));};exports[_0x4d82('0x33')]=function(_0x1692b0,_0x3e8359){if(_0x1692b0[_0x4d82('0xb2')]['id']){delete _0x1692b0['body']['id'];}return db[_0x4d82('0x9d')][_0x4d82('0xb0')]({'where':{'id':_0x1692b0['params']['id']}})[_0x4d82('0x34')](handleEntityNotFound(_0x3e8359,null))['then'](saveUpdates(_0x1692b0[_0x4d82('0xb2')],null))['then'](respondWithResult(_0x3e8359,null))[_0x4d82('0x3c')](handleError(_0x3e8359,null));};exports[_0x4d82('0x35')]=function(_0x3f65c7,_0x3dbe2c){return db[_0x4d82('0x9d')][_0x4d82('0xb0')]({'where':{'id':_0x3f65c7[_0x4d82('0xac')]['id']}})[_0x4d82('0x34')](handleEntityNotFound(_0x3dbe2c,null))[_0x4d82('0x34')](removeEntity(_0x3dbe2c,null))[_0x4d82('0x3c')](handleError(_0x3dbe2c,null));};exports[_0x4d82('0xb3')]=function(_0x58c0a4,_0x5c8701){return db['ChatInteraction']['describe']()['then'](respondWithResult(_0x5c8701,null))[_0x4d82('0x3c')](handleError(_0x5c8701,null));};exports[_0x4d82('0xb4')]=function(_0x1b00cf,_0x5080bd){if(_0x1b00cf['body']['id']){delete _0x1b00cf[_0x4d82('0xb2')]['id'];}return db[_0x4d82('0x9d')][_0x4d82('0xb0')]({'where':{'id':_0x1b00cf[_0x4d82('0xac')]['id']}})['then'](handleEntityNotFound(_0x5080bd,null))[_0x4d82('0x34')](saveUpdates(_0x1b00cf[_0x4d82('0xb2')],null))[_0x4d82('0x34')](respondWithResult(_0x5080bd,null))['catch'](handleError(_0x5080bd,null));};exports['abandon']=function(_0x2028e1,_0x4fd92b,_0x421589){if(_0x2028e1['body']['id']){delete _0x2028e1[_0x4d82('0xb2')]['id'];}return db['ChatInteraction'][_0x4d82('0xb0')]({'where':{'id':_0x2028e1[_0x4d82('0xac')]['id']}})[_0x4d82('0x34')](function(_0x35bf91){if(!_0x35bf91){logger[_0x4d82('0x25')](_0x4d82('0xb5'),_0x4d82('0xb6'),0x194,_0x4d82('0xb7'));_0x4fd92b['sendStatus'](0x194);}else{if(_0x35bf91[_0x4d82('0xb8')]){throw new db[(_0x4d82('0xb9'))][(_0x4d82('0xba'))]('Interaction\x20already\x20assigned');}}return _0x35bf91;})[_0x4d82('0x34')](function(_0x30551d){if(_0x30551d){return _0x30551d[_0x4d82('0x33')]({'closed':_0x2028e1[_0x4d82('0xb2')]['closed'],'disposition':_0x2028e1['body'][_0x4d82('0xbb')]})[_0x4d82('0x34')](function(_0x360aea){return _0x360aea;});}})[_0x4d82('0x34')](function(_0x4a884f){return respondWithRpcPromise('AbandonInteraction',_0x4d82('0xb6'),_0x2028e1['body'],client9004);})[_0x4d82('0x34')](respondWithResult(_0x4fd92b,null))[_0x4d82('0x3c')](handleError(_0x4fd92b,null));};exports['attachmentUpload']=function(_0x3a5c5d,_0x380046,_0x460618){_0x3a5c5d[_0x4d82('0xb2')]['name']=_0x3a5c5d[_0x4d82('0xbc')][_0x4d82('0xbd')];_0x3a5c5d['body'][_0x4d82('0xbe')]=_0x3a5c5d[_0x4d82('0xbc')][_0x4d82('0xbf')];_0x3a5c5d[_0x4d82('0xb2')][_0x4d82('0xc0')]=_0x3a5c5d['file'][_0x4d82('0xc1')];return db[_0x4d82('0xc2')][_0x4d82('0xb1')](_0x3a5c5d[_0x4d82('0xb2')])['then'](respondWithResult(_0x380046,0xc9))[_0x4d82('0x3c')](handleError(_0x380046,null));};exports[_0x4d82('0xc3')]=function(_0x1be3c5,_0x1126d8,_0x24a6dd){return db[_0x4d82('0x9d')][_0x4d82('0xc4')]({'where':{'id':_0x1be3c5[_0x4d82('0xac')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1126d8,null))[_0x4d82('0x34')](function(_0x4f47e1){if(_0x4f47e1){if(_0x4f47e1[_0x4d82('0xc5')]){return _0x1126d8['status'](0x193)['json']({'status':0x193,'message':_0x4d82('0xc6')});}return db[_0x4d82('0xc2')]['findOne']({'where':{'id':_0x1be3c5[_0x4d82('0x43')][_0x4d82('0xc7')]},'raw':!![]})['then'](handleEntityNotFound(_0x1126d8,null));}})[_0x4d82('0x34')](function(_0x1d3eeb){if(_0x1d3eeb){return _0x1126d8[_0x4d82('0xc8')](path[_0x4d82('0x86')](config[_0x4d82('0xc9')],_0x4d82('0xca'),_0x1d3eeb[_0x4d82('0xbe')]));}})[_0x4d82('0x3c')](handleError(_0x1126d8,null));};exports[_0x4d82('0xcb')]=function(_0x8cd882,_0x2de3a8){var _0x5b4a6b=null;var _0x2a74e5=null;var _0x2c98e4=null;var _0x2a329e=null;if(_0x8cd882['body']['id']){delete _0x8cd882[_0x4d82('0xb2')]['id'];}if(_0x8cd882[_0x4d82('0xb2')][_0x4d82('0xcc')]){_0x2a329e=path[_0x4d82('0x86')](config[_0x4d82('0xc9')],_0x4d82('0xcd'),util['format'](_0x4d82('0xce'),Date[_0x4d82('0xcf')]()));_0x8cd882[_0x4d82('0xb2')][_0x4d82('0xd0')]=_0x2a329e;}return db['ChatInteraction']['find']({'where':{'id':_0x8cd882['params']['id']},'include':[{'model':db[_0x4d82('0xd1')],'as':_0x4d82('0xd2'),'include':[{'model':db[_0x4d82('0xd3')],'as':'User'}]}]})['then'](handleEntityNotFound(_0x2de3a8,null))[_0x4d82('0x34')](saveUpdates(_0x8cd882[_0x4d82('0xb2')],null))[_0x4d82('0x34')](function(_0x4d24b5){if(_0x4d24b5){_0x5b4a6b=_0x4d24b5;return db[_0x4d82('0xd4')][_0x4d82('0xb0')]({'where':{'id':_0x5b4a6b[_0x4d82('0xd5')]}});}})[_0x4d82('0x34')](function(_0x55dab2){if(_0x55dab2){_0x2c98e4=_0x55dab2;return db[_0x4d82('0xd6')][_0x4d82('0xb0')]({'where':{'id':_0x5b4a6b[_0x4d82('0x79')]}});}})[_0x4d82('0x34')](function(_0x451b03){if(_0x451b03){_0x2a74e5=_0x451b03;if(_0x2a329e){var _0x33d802=null;for(var _0x318f3b=0x1;_0x318f3b<_0x5b4a6b['Messages'][_0x4d82('0x46')];++_0x318f3b){_0x33d802=_0x5b4a6b[_0x4d82('0xd2')][_0x318f3b];var _0x482445=_0x33d802[_0x4d82('0xb8')]?util[_0x4d82('0x67')](_0x4d82('0xd7'),_0x2c98e4[_0x4d82('0xd8')],_0x33d802[_0x4d82('0xb8')]):_0x4d82('0xd9');var _0x3c6701=_0x8cd882['body'][_0x4d82('0xda')]||util[_0x4d82('0x67')]('%s%d',_0x4d82('0xdb'),_0x33d802['ContactId']);switch(_0x2c98e4[_0x4d82('0xdc')]){case _0x4d82('0xdd'):_0x482445=_0x33d802[_0x4d82('0xb8')]?util[_0x4d82('0x67')](_0x4d82('0xd7'),_0x2c98e4[_0x4d82('0xd8')],_0x33d802['UserId']):_0x4d82('0xd9');break;case _0x4d82('0xde'):_0x482445=_0x33d802[_0x4d82('0xb8')]?_0x33d802[_0x4d82('0xd3')]['alias']||_0x33d802['User'][_0x4d82('0xdf')]:_0x4d82('0xd9');break;case'agent_fullname':_0x482445=_0x33d802['UserId']?_0x33d802[_0x4d82('0xd3')][_0x4d82('0xdf')]:_0x4d82('0xd9');break;default:_0x482445=_0x33d802[_0x4d82('0xb8')]?util['format'](_0x4d82('0xd7'),_0x2c98e4['agentAlias'],_0x33d802[_0x4d82('0xb8')]):_0x4d82('0xd9');}var _0x447566=util[_0x4d82('0x67')](_0x4d82('0xe0'),moment(_0x33d802['createdAt'])[_0x4d82('0x67')](_0x4d82('0xe1')),_0x33d802[_0x4d82('0xe2')]==='in'?_0x3c6701:_0x482445,_0x33d802[_0x4d82('0xb2')]);if(!_0x33d802[_0x4d82('0xe3')]){fs[_0x4d82('0xe4')](_0x2a329e,_0x447566);}}return db[_0x4d82('0xe5')][_0x4d82('0xc4')]({'where':{'service':!![]},'include':[{'model':db[_0x4d82('0xe6')],'as':_0x4d82('0xe7'),'raw':!![]}]});}}})[_0x4d82('0x34')](function(_0x303afc){if(_0x303afc&&_0x303afc[_0x4d82('0xe7')]&&_0x8cd882[_0x4d82('0xb2')]){var _0x5dd3b4={'tls':{'rejectUnauthorized':![]}};if(_0x303afc[_0x4d82('0xe7')][_0x4d82('0xe8')]){_0x5dd3b4[_0x4d82('0xe8')]=_0x303afc[_0x4d82('0xe7')][_0x4d82('0xe8')];}else{_0x5dd3b4[_0x4d82('0xe9')]=_0x303afc[_0x4d82('0xe7')][_0x4d82('0xe9')];_0x5dd3b4[_0x4d82('0xea')]=_0x303afc[_0x4d82('0xe7')][_0x4d82('0xea')];_0x5dd3b4['secure']=_0x303afc[_0x4d82('0xe7')][_0x4d82('0xeb')];}if(_0x303afc[_0x4d82('0xe7')][_0x4d82('0xec')]){_0x5dd3b4[_0x4d82('0xed')]={'user':_0x303afc[_0x4d82('0xe7')]['user'],'pass':_0x303afc['Smtp'][_0x4d82('0xee')]};}return respondWithRpcPromise(_0x4d82('0xef'),_0x4d82('0xf0'),{'account':_0x5dd3b4,'message':{'from':util[_0x4d82('0x67')](_0x4d82('0xf1'),_0x303afc[_0x4d82('0x37')],_0x303afc[_0x4d82('0xf2')]||_0x303afc[_0x4d82('0xe7')]['user']),'to':_0x8cd882[_0x4d82('0xb2')]['mailTranscript'],'subject':_0x4d82('0xf3'),'text':util[_0x4d82('0x67')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x8cd882[_0x4d82('0xb2')]['mailTranscript']),'attachments':[{'path':_0x2a329e}]}})[_0x4d82('0x34')](function(){return _0x5b4a6b;})[_0x4d82('0x3c')](function(_0x2243c6){console['error'](_0x2243c6);});}else{return _0x5b4a6b;}})[_0x4d82('0x34')](respondWithStatusCode(_0x2de3a8,0xc8))['catch'](handleError(_0x2de3a8,null));};exports[_0x4d82('0xf4')]=function(_0x14e9ba,_0x5c4c2c,_0x47f908){return db[_0x4d82('0xd1')][_0x4d82('0xb0')]({'where':{'id':_0x14e9ba[_0x4d82('0xac')]['id']}})[_0x4d82('0x34')](handleEntityNotFound(_0x5c4c2c,null))[_0x4d82('0x34')](function(_0x505ee1){if(_0x505ee1){return _0x505ee1[_0x4d82('0xf4')](_0x14e9ba[_0x4d82('0xb2')][_0x4d82('0xf5')],_[_0x4d82('0xf6')](_0x14e9ba['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x5c4c2c,null))[_0x4d82('0x3c')](handleError(_0x5c4c2c,null));};exports['getMessages']=function(_0x51682e,_0x2e2faa,_0x3c74bd){var _0x3179ae={'raw':![],'where':{}};var _0x42dea8={};var _0x5448d4={'count':0x0,'rows':[]};return db[_0x4d82('0x9d')][_0x4d82('0xc4')]({'where':{'id':_0x51682e[_0x4d82('0xac')]['id']}})['then'](handleEntityNotFound(_0x2e2faa,null))[_0x4d82('0x34')](function(_0x5a1dfa){if(_0x5a1dfa){_0x42dea8[_0x4d82('0x3f')]=_[_0x4d82('0x40')](db[_0x4d82('0xd1')][_0x4d82('0x3e')]);_0x42dea8[_0x4d82('0x43')]=_[_0x4d82('0x40')](_0x51682e[_0x4d82('0x43')]);_0x42dea8[_0x4d82('0x41')]=_[_0x4d82('0x42')](_0x42dea8[_0x4d82('0x3f')],_0x42dea8[_0x4d82('0x43')]);_0x3179ae['attributes']=_[_0x4d82('0x42')](_0x42dea8[_0x4d82('0x3f')],qs['fields'](_0x51682e[_0x4d82('0x43')][_0x4d82('0x45')]));_0x3179ae[_0x4d82('0x44')]=_0x3179ae['attributes'][_0x4d82('0x46')]?_0x3179ae[_0x4d82('0x44')]:_0x42dea8['model'];if(!_0x51682e['query'][_0x4d82('0x47')](_0x4d82('0x48'))){_0x3179ae[_0x4d82('0x2d')]=qs['limit'](_0x51682e['query'][_0x4d82('0x2d')]);_0x3179ae['offset']=qs['offset'](_0x51682e[_0x4d82('0x43')]['offset']);}_0x3179ae[_0x4d82('0x89')]=qs[_0x4d82('0x49')](_0x51682e[_0x4d82('0x43')]['sort']);_0x3179ae[_0x4d82('0x52')]=qs[_0x4d82('0x41')](_[_0x4d82('0x4a')](_0x51682e[_0x4d82('0x43')],_0x42dea8[_0x4d82('0x41')]));_0x3179ae['where'][_0x4d82('0xa8')]=_0x5a1dfa['id'];if(_0x51682e[_0x4d82('0x43')][_0x4d82('0x7b')]){_0x3179ae[_0x4d82('0x52')]=_[_0x4d82('0x9c')](_0x3179ae[_0x4d82('0x52')],{'$or':_['map'](_0x3179ae['attributes'],function(_0x4cd9e1){var _0x1fea10={};_0x1fea10[_0x4cd9e1]={'$like':'%'+_0x51682e[_0x4d82('0x43')][_0x4d82('0x7b')]+'%'};return _0x1fea10;})});}if(_0x51682e['query'][_0x4d82('0xf7')]){var _0x142b2c=_0x51682e['query']['$gte'][_0x4d82('0x83')](',');var _0x55d5e5={};_0x55d5e5[_0x142b2c[0x0]]={'$gte':moment(_0x142b2c[0x1])[_0x4d82('0x67')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3179ae['where']=_[_0x4d82('0x9c')](_0x3179ae[_0x4d82('0x52')],_0x55d5e5);}_0x3179ae=_[_0x4d82('0x9c')]({},_0x3179ae,_0x51682e['options']);return db[_0x4d82('0xd1')][_0x4d82('0x2b')]({'where':_0x3179ae[_0x4d82('0x52')]})[_0x4d82('0x34')](function(_0x49d951){_0x5448d4[_0x4d82('0x2b')]=_0x49d951;if(_0x51682e['query'][_0x4d82('0xad')]){_0x3179ae[_0x4d82('0xae')]=[{'all':!![]}];}return db[_0x4d82('0xd1')][_0x4d82('0xf8')](_0x3179ae);})[_0x4d82('0x34')](function(_0x4621){_0x5448d4[_0x4d82('0xaa')]=_0x4621;return _0x5448d4;});}})[_0x4d82('0x34')](respondWithFilteredResult(_0x2e2faa,_0x3179ae))[_0x4d82('0x3c')](handleError(_0x2e2faa,null));};exports[_0x4d82('0xf9')]=function(_0xfd541c,_0x454a62,_0x1daab3){var _0x275720={'where':{}},_0x3e0955={},_0x40cd4d={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x4d82('0xc4')]({'where':{'id':_0xfd541c[_0x4d82('0xac')]['id']}})[_0x4d82('0x34')](handleEntityNotFound(_0x454a62,null))[_0x4d82('0x34')](function(_0x18af76){if(_0x18af76){_0x3e0955[_0x4d82('0x3f')]=_[_0x4d82('0x40')](db[_0x4d82('0xd1')][_0x4d82('0x3e')]);_0x3e0955[_0x4d82('0x43')]=_['keys'](_0xfd541c['query']);_0x3e0955[_0x4d82('0x41')]=_[_0x4d82('0x42')](_0x3e0955[_0x4d82('0x3f')],_0x3e0955[_0x4d82('0x43')]);_0x275720[_0x4d82('0x44')]=_[_0x4d82('0x42')](_0x3e0955[_0x4d82('0x3f')],qs[_0x4d82('0x45')](_0xfd541c[_0x4d82('0x43')][_0x4d82('0x45')]));_0x275720['attributes']=_0x275720['attributes'][_0x4d82('0x46')]?_0x275720[_0x4d82('0x44')]:_0x3e0955[_0x4d82('0x3f')];if(!_0xfd541c['query']['hasOwnProperty']('nolimit')){_0x275720['limit']=qs['limit'](_0xfd541c[_0x4d82('0x43')][_0x4d82('0x2d')]);_0x275720['offset']=qs[_0x4d82('0x2c')](_0xfd541c[_0x4d82('0x43')][_0x4d82('0x2c')]);}_0x275720[_0x4d82('0x89')]=qs['sort'](_0xfd541c[_0x4d82('0x43')][_0x4d82('0x49')]);_0x275720[_0x4d82('0x52')]=qs[_0x4d82('0x41')](_[_0x4d82('0x4a')](_0xfd541c[_0x4d82('0x43')],_0x3e0955['filters']));_0x275720[_0x4d82('0x52')]['ChatInteractionId']=_0x18af76['id'];if(_0xfd541c[_0x4d82('0x43')][_0x4d82('0x7b')]){_0x275720[_0x4d82('0x52')]=_[_0x4d82('0x9c')](_0x275720[_0x4d82('0x52')],{'$or':_[_0x4d82('0x7a')](_0x275720[_0x4d82('0x44')],function(_0x383767){var _0x30326f={};_0x30326f[_0x383767]={'$like':'%'+_0xfd541c[_0x4d82('0x43')]['filter']+'%'};return _0x30326f;})});}_0x275720[_0x4d82('0x52')][_0x4d82('0xe3')]=![];if(_0xfd541c[_0x4d82('0x43')]['id']){_0x275720[_0x4d82('0x52')]['id']={'$gt':_0xfd541c[_0x4d82('0x43')]['id']};}_0x275720=_[_0x4d82('0x9c')]({},_0x275720,_0xfd541c['options']);return db[_0x4d82('0xd1')]['count']({'where':_0x275720['where']})[_0x4d82('0x34')](function(_0x5b3deb){_0x40cd4d[_0x4d82('0x2b')]=_0x5b3deb;_0x275720[_0x4d82('0xae')]=[];if(_0xfd541c[_0x4d82('0x43')]['includeAgent']){_0x275720['include'][_0x4d82('0x84')]({'model':db[_0x4d82('0xd3')],'as':_0x4d82('0xd3'),'attributes':['id','fullname','alias']});}if(_0xfd541c['query'][_0x4d82('0xad')]){_0x275720[_0x4d82('0xae')]=[{'all':!![]}];}return db[_0x4d82('0xd1')]['findAll'](_0x275720);})['then'](function(_0x159daa){_0x40cd4d['rows']=_0x159daa;return _0x40cd4d;});}})[_0x4d82('0x34')](respondWithFilteredResult(_0x454a62,_0x275720))[_0x4d82('0x3c')](handleError(_0x454a62,null));};exports['addTags']=function(_0x49e5bf,_0x73e1a8,_0x33ef43){return db[_0x4d82('0x9d')]['find']({'where':{'id':_0x49e5bf[_0x4d82('0xac')]['id']}})[_0x4d82('0x34')](handleEntityNotFound(_0x73e1a8,null))[_0x4d82('0x34')](function(_0x2d3ccc){if(_0x2d3ccc){return _0x2d3ccc[_0x4d82('0xfa')](_0x49e5bf[_0x4d82('0xb2')][_0x4d82('0xf5')],_['omit'](_0x49e5bf[_0x4d82('0xb2')],[_0x4d82('0xf5'),'id'])||{})['spread'](function(){return db[_0x4d82('0xfb')]['findAll']({'attributes':['id',_0x4d82('0x37'),'color'],'where':{'id':_0x49e5bf[_0x4d82('0xb2')][_0x4d82('0xf5')]}});})[_0x4d82('0x34')](function(_0x4ad433){socket[_0x4d82('0xfc')](_0x4d82('0xfd'),{'id':Number(_0x49e5bf['params']['id']),'tags':_0x4ad433||[]});return{'id':Number(_0x49e5bf['params']['id']),'tags':_0x4ad433||[]};});}})[_0x4d82('0x34')](respondWithResult(_0x73e1a8,null))[_0x4d82('0x3c')](handleError(_0x73e1a8,null));};exports['removeTags']=function(_0x528766,_0x162ab6,_0x3e0494){return db[_0x4d82('0x9d')][_0x4d82('0xb0')]({'where':{'id':_0x528766[_0x4d82('0xac')]['id']}})[_0x4d82('0x34')](handleEntityNotFound(_0x162ab6,null))['then'](function(_0x1a51ca){if(_0x1a51ca){return _0x1a51ca[_0x4d82('0xfe')](_0x528766[_0x4d82('0x43')]['ids']);}})[_0x4d82('0x34')](respondWithStatusCode(_0x162ab6,null))[_0x4d82('0x3c')](handleError(_0x162ab6,null));};exports['download']=function(_0x2409c9,_0x57637a){var _0x555dce=moment()[_0x4d82('0xff')]()[_0x4d82('0x85')]();var _0x19983f=path['join'](config[_0x4d82('0xc9')],_0x4d82('0x100'),_0x4d82('0x101'),_0x4d82('0x102'));var _0x572ce9=path['join'](config[_0x4d82('0xc9')],_0x4d82('0x100'),_0x4d82('0x101'),_0x4d82('0x103'));var _0x1682d0=path[_0x4d82('0x86')](_0x19983f,_0x555dce);var _0x254709=util[_0x4d82('0x67')](_0x4d82('0x104'),_0x2409c9['params']['id'],_0x555dce);var _0x382192=path[_0x4d82('0x86')](_0x19983f,_0x254709);var _0xf6c890=![];return db[_0x4d82('0x9d')]['find']({'where':{'id':_0x2409c9[_0x4d82('0xac')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x4d82('0xd2'),'attributes':['id',_0x4d82('0xb2'),'createdAt','direction','secret'],'include':[{'model':db['User'],'as':_0x4d82('0xd3'),'attributes':['id','fullname'],'raw':!![]},{'model':db['CmContact'],'as':_0x4d82('0x105'),'attributes':['id',_0x4d82('0x106'),_0x4d82('0x107')],'raw':!![]},{'model':db[_0x4d82('0xc2')],'as':_0x4d82('0xc2'),'raw':!![]}]},{'model':db[_0x4d82('0xd4')],'as':_0x4d82('0x108'),'attributes':['id',_0x4d82('0x37')]},{'model':db[_0x4d82('0xd3')],'as':_0x4d82('0x109'),'attributes':['id','fullname']}]})[_0x4d82('0x34')](handleEntityNotFound(_0x57637a,null))['then'](function(_0x50eefa){if(_0x50eefa){var _0x24d0fb=_0x50eefa['get']({'plain':!![]});_0xf6c890=!![];var _0x38df69={'format':'A4','border':'10px','header':{'height':_0x4d82('0x10a'),'contents':{'first':_0x4d82('0x10b')}},'footer':{'height':_0x4d82('0x10c'),'contents':{'default':util['format'](_0x4d82('0x10d'),util[_0x4d82('0x67')](_0x4d82('0x10e'),_0x4d82('0x10f'),_0x24d0fb['id']),moment()[_0x4d82('0x67')](_0x4d82('0x110'))[_0x4d82('0x85')]())}}};fs[_0x4d82('0x111')](_0x1682d0);var _0x8c2eff={'channel':'Chat','account':_0x24d0fb[_0x4d82('0x108')][_0x4d82('0x37')],'agent':_0x24d0fb[_0x4d82('0x109')]?_0x24d0fb['Owner'][_0x4d82('0xdf')]:'N.A.','createdAt':moment(_0x24d0fb['createdAt'])[_0x4d82('0x67')](_0x4d82('0x112'))[_0x4d82('0x85')](),'closedAt':_0x24d0fb['closed']?moment(_0x24d0fb[_0x4d82('0x113')])[_0x4d82('0x67')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x24d0fb[_0x4d82('0xbb')],'chatInfo':{'browser':_0x24d0fb[_0x4d82('0x114')],'os':_0x24d0fb[_0x4d82('0x115')],'referer':_0x24d0fb[_0x4d82('0x116')],'customerIp':_0x24d0fb[_0x4d82('0x117')],'customerPort':_0x24d0fb[_0x4d82('0x118')]?_0x24d0fb[_0x4d82('0x118')]:'N.A.'},'messages':_(_0x24d0fb['Messages'])[_0x4d82('0x119')]()[_0x4d82('0x7b')]({'secret':![]})[_0x4d82('0x7a')](function(_0x5c872c){if(_0x5c872c[_0x4d82('0xc2')]){var _0x1a26d4=path[_0x4d82('0x86')](_0x572ce9,_0x5c872c[_0x4d82('0xc2')][_0x4d82('0xbe')]);if(fs['existsSync'](_0x1a26d4)){fs[_0x4d82('0x11a')](_0x1a26d4)[_0x4d82('0x11b')](fs[_0x4d82('0x11c')](path[_0x4d82('0x86')](_0x1682d0,_0x5c872c['Attachment'][_0x4d82('0xbe')])));}}return{'date':moment(_0x5c872c[_0x4d82('0x61')])[_0x4d82('0x67')](_0x4d82('0x112'))[_0x4d82('0x85')](),'sender':_0x5c872c[_0x4d82('0xe2')]===_0x4d82('0x11d')?_0x5c872c[_0x4d82('0xd3')]?_0x5c872c[_0x4d82('0xd3')][_0x4d82('0xdf')]:'System':_0x5c872c[_0x4d82('0x105')][_0x4d82('0x106')]+(_0x5c872c[_0x4d82('0x105')]['lastName']?'\x20'+_0x5c872c[_0x4d82('0x105')]['lastName']:''),'body':_0x5c872c[_0x4d82('0xc2')]?_0x5c872c[_0x4d82('0xc2')]['basename']:_0x5c872c[_0x4d82('0xb2')],'direction':_0x5c872c[_0x4d82('0xe2')]===_0x4d82('0x11d')?'A':'C','secret':_0x5c872c['secret'],'attachment':_0x5c872c[_0x4d82('0xc2')]};})['value']()};return ejs[_0x4d82('0x11e')](path[_0x4d82('0x86')](config[_0x4d82('0xc9')],_0x4d82('0x100'),'views',_0x4d82('0x11f')),{'interaction':_0x8c2eff})[_0x4d82('0x34')](function(_0xa2f29f){return new BPromise(function(_0x409ef2,_0x31a6d9){pdf[_0x4d82('0xb1')](_0xa2f29f,_0x38df69)[_0x4d82('0x120')](path[_0x4d82('0x86')](_0x1682d0,_0x4d82('0x121')+_0x24d0fb['id']+'-'+_0x555dce+_0x4d82('0x122')),function(_0x5966de,_0x19c45e){if(_0x5966de)return _0x31a6d9(_0x5966de);_0x409ef2(_0x19c45e);});});});}})['then'](function(){if(_0xf6c890){return new BPromise(function(_0x2d1251,_0x2d014a){zipdir(_0x1682d0,{'saveTo':_0x382192},function(_0x13b07e,_0x3ae8bc){if(_0x13b07e)return _0x2d014a(_0x13b07e);return _0x2d1251(_0x3ae8bc);});})[_0x4d82('0x34')](function(){return new BPromise(function(_0x4955b4,_0x599ea1){rimraf(_0x1682d0,function(_0x302905){if(_0x302905)_0x599ea1(_0x302905);return _0x4955b4();});});})[_0x4d82('0x34')](function(){return _0x57637a[_0x4d82('0xc8')](_0x382192,_0x254709,function(_0x3e3db4){if(_0x3e3db4){console[_0x4d82('0x123')](_0x4d82('0x124'),_0x3e3db4);}else{fs[_0x4d82('0x125')](_0x382192);}});});}else{return _0x57637a[_0x4d82('0x36')](0xc8);}})[_0x4d82('0x3c')](handleError(_0x57637a,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index e6657c2..cb97edb 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 _0xf398=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','then','Users','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook'];(function(_0x38f263,_0xb9b1ad){var _0x5cb9bc=function(_0x5929e3){while(--_0x5929e3){_0x38f263['push'](_0x38f263['shift']());}};_0x5cb9bc(++_0xb9b1ad);}(_0xf398,0x181));var _0x8f39=function(_0x216825,_0x199d5f){_0x216825=_0x216825-0x0;var _0x20c0d0=_0xf398[_0x216825];return _0x20c0d0;};'use strict';var EventEmitter=require(_0x8f39('0x0'));var ChatInteraction=require(_0x8f39('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x8f39('0x1'))['db'][_0x8f39('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8f39('0x3')](0x0);var events={'afterCreate':_0x8f39('0x4'),'afterUpdate':'update','afterDestroy':_0x8f39('0x5')};function emitEvent(_0x6337a){return function(_0x79e024,_0x424fb2,_0x1ffbf2){_0x79e024['getUsers']({'attributes':['id'],'raw':!![]})[_0x8f39('0x6')](function(_0x4e7acb){_0x79e024['setDataValue'](_0x8f39('0x7'),_0x4e7acb['map'](function(_0x48b0da){return{'id':_0x48b0da['id']};}));return ChatMessage[_0x8f39('0x8')]({'where':{'ChatInteractionId':_0x79e024['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8f39('0x6')](function(_0x22fbbd){_0x79e024[_0x8f39('0x9')](_0x8f39('0xa'),_0x22fbbd[_0x8f39('0xb')]);ChatInteractionEvents[_0x8f39('0xc')](_0x6337a+':'+_0x79e024['id'],_0x79e024);ChatInteractionEvents[_0x8f39('0xc')](_0x6337a,_0x79e024);_0x1ffbf2(null);})['catch'](_0x1ffbf2(null));};}for(var e in events){if(events[_0x8f39('0xd')](e)){var event=events[e];ChatInteraction[_0x8f39('0xe')](e,emitEvent(event));}}module[_0x8f39('0xf')]=ChatInteractionEvents; \ No newline at end of file +var _0x522c=['ChatMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','ChatInteraction'];(function(_0x3f70c9,_0x67b41c){var _0x23298a=function(_0x3b50ed){while(--_0x3b50ed){_0x3f70c9['push'](_0x3f70c9['shift']());}};_0x23298a(++_0x67b41c);}(_0x522c,0x7b));var _0xc522=function(_0x5131aa,_0x2ab728){_0x5131aa=_0x5131aa-0x0;var _0x39b70b=_0x522c[_0x5131aa];return _0x39b70b;};'use strict';var EventEmitter=require(_0xc522('0x0'));var ChatInteraction=require(_0xc522('0x1'))['db'][_0xc522('0x2')];var ChatMessage=require(_0xc522('0x1'))['db'][_0xc522('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc522('0x4')](0x0);var events={'afterCreate':_0xc522('0x5'),'afterUpdate':'update','afterDestroy':_0xc522('0x6')};function emitEvent(_0x429a97){return function(_0x2cfc95,_0xdc15a5,_0x1d1984){_0x2cfc95[_0xc522('0x7')]({'attributes':['id'],'raw':!![]})[_0xc522('0x8')](function(_0x3c2193){_0x2cfc95[_0xc522('0x9')](_0xc522('0xa'),_0x3c2193[_0xc522('0xb')](function(_0x486842){return{'id':_0x486842['id']};}));return ChatMessage[_0xc522('0xc')]({'where':{'ChatInteractionId':_0x2cfc95['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc522('0x8')](function(_0x3abcd7){_0x2cfc95[_0xc522('0x9')](_0xc522('0xd'),_0x3abcd7[_0xc522('0xe')]);ChatInteractionEvents['emit'](_0x429a97+':'+_0x2cfc95['id'],_0x2cfc95);ChatInteractionEvents[_0xc522('0xf')](_0x429a97,_0x2cfc95);_0x1d1984(null);})[_0xc522('0x10')](_0x1d1984(null));};}for(var e in events){if(events[_0xc522('0x11')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index cd6d4f7..8b278ca 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 _0x5931=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','closedAt'];(function(_0x229ed3,_0xb350b9){var _0x373389=function(_0x1c70d8){while(--_0x1c70d8){_0x229ed3['push'](_0x229ed3['shift']());}};_0x373389(++_0xb350b9);}(_0x5931,0x80));var _0x1593=function(_0x15a8fa,_0x4652b2){_0x15a8fa=_0x15a8fa-0x0;var _0x1355c2=_0x5931[_0x15a8fa];return _0x1355c2;};'use strict';var _=require(_0x1593('0x0'));var util=require(_0x1593('0x1'));var logger=require(_0x1593('0x2'))(_0x1593('0x3'));var moment=require(_0x1593('0x4'));var BPromise=require(_0x1593('0x5'));var rp=require(_0x1593('0x6'));var fs=require('fs');var path=require(_0x1593('0x7'));var rimraf=require('rimraf');var config=require(_0x1593('0x8'));var attributes=require(_0x1593('0x9'));module[_0x1593('0xa')]=function(_0x37d87c,_0xa7406b){return _0x37d87c['define'](_0x1593('0xb'),attributes,{'tableName':_0x1593('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x493bc3,_0x3f2faa,_0x20d87a){if(_0x493bc3[_0x1593('0xd')](_0x1593('0xe'))){_0x493bc3[_0x1593('0xf')]=moment()[_0x1593('0x10')](_0x1593('0x11'));}_0x20d87a(null,_0x493bc3);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd66d=['bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd66d,0x1bf));var _0xdd66=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xd66d[_0x1573ea];return _0x51c0e2;};'use strict';var _=require('lodash');var util=require(_0xdd66('0x0'));var logger=require(_0xdd66('0x1'))('api');var moment=require(_0xdd66('0x2'));var BPromise=require(_0xdd66('0x3'));var rp=require(_0xdd66('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdd66('0x5'));var config=require(_0xdd66('0x6'));var attributes=require(_0xdd66('0x7'));module[_0xdd66('0x8')]=function(_0x13360a,_0x54ad8f){return _0x13360a[_0xdd66('0x9')](_0xdd66('0xa'),attributes,{'tableName':_0xdd66('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x345b7d,_0x599fa9,_0xe754bb){if(_0x345b7d[_0xdd66('0xc')](_0xdd66('0xd'))){_0x345b7d[_0xdd66('0xe')]=moment()[_0xdd66('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0xe754bb(null,_0x345b7d);}},'charset':_0xdd66('0x10'),'collate':_0xdd66('0x11')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 384d892..fef0319 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 _0x056d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateChatInteraction','update','body','options','raw','where','then','debug','AddTagsToChatInteraction','ChatInteraction','find','addTags','omit','spread','AddTags','lodash','util'];(function(_0xc0fb15,_0x17c953){var _0x2f0e8e=function(_0x160953){while(--_0x160953){_0xc0fb15['push'](_0xc0fb15['shift']());}};_0x2f0e8e(++_0x17c953);}(_0x056d,0x7c));var _0xd056=function(_0x11c0cb,_0x4476aa){_0x11c0cb=_0x11c0cb-0x0;var _0x3dbf20=_0x056d[_0x11c0cb];return _0x3dbf20;};'use strict';var _=require(_0xd056('0x0'));var util=require(_0xd056('0x1'));var moment=require(_0xd056('0x2'));var BPromise=require(_0xd056('0x3'));var rs=require(_0xd056('0x4'));var fs=require('fs');var Redis=require(_0xd056('0x5'));var db=require(_0xd056('0x6'))['db'];var utils=require(_0xd056('0x7'));var logger=require(_0xd056('0x8'))('rpc');var config=require(_0xd056('0x9'));var jayson=require(_0xd056('0xa'));var client=jayson[_0xd056('0xb')][_0xd056('0xc')]({'port':0x232a});config[_0xd056('0xd')]=_[_0xd056('0xe')](config[_0xd056('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xd056('0xf'))(new Redis(config[_0xd056('0xd')]));require(_0xd056('0x10'))[_0xd056('0x11')](socket);function respondWithRpcPromise(_0x419731,_0x3ce27b,_0x3e26dd){return new BPromise(function(_0x550037,_0x49d25a){return client[_0xd056('0x12')](_0x419731,_0x3e26dd)['then'](function(_0x1593f1){logger[_0xd056('0x13')](_0xd056('0x14'),_0x3ce27b,_0xd056('0x15'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3ce27b,_0xd056('0x15'),JSON[_0xd056('0x16')](_0x1593f1));if(_0x1593f1[_0xd056('0x17')]){if(_0x1593f1[_0xd056('0x17')]['code']===0x1f4){logger[_0xd056('0x17')](_0xd056('0x14'),_0x3ce27b,_0x1593f1['error'][_0xd056('0x18')]);return _0x49d25a(_0x1593f1['error'][_0xd056('0x18')]);}logger[_0xd056('0x17')](_0xd056('0x14'),_0x3ce27b,_0x1593f1[_0xd056('0x17')]['message']);return _0x550037(_0x1593f1[_0xd056('0x17')][_0xd056('0x18')]);}else{logger[_0xd056('0x13')](_0xd056('0x14'),_0x3ce27b,_0xd056('0x15'));_0x550037(_0x1593f1[_0xd056('0x19')][_0xd056('0x18')]);}})[_0xd056('0x1a')](function(_0x42bba4){logger[_0xd056('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x3ce27b,_0x42bba4);_0x49d25a(_0x42bba4);});});}exports[_0xd056('0x1b')]=function(_0x466bad){var _0x186990=this;return new Promise(function(_0x34607d,_0x308318){return db['ChatInteraction'][_0xd056('0x1c')](_0x466bad[_0xd056('0x1d')],{'raw':_0x466bad['options']?_0x466bad[_0xd056('0x1e')][_0xd056('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x466bad[_0xd056('0x1e')]?_0x466bad[_0xd056('0x1e')][_0xd056('0x20')]||null:null,'attributes':_0x466bad[_0xd056('0x1e')]?_0x466bad['options']['attributes']||null:null,'limit':_0x466bad[_0xd056('0x1e')]?_0x466bad[_0xd056('0x1e')]['limit']||null:null})[_0xd056('0x21')](function(_0x1abd17){logger[_0xd056('0x13')](_0xd056('0x1b'),_0x466bad);logger[_0xd056('0x22')](_0xd056('0x1b'),_0x466bad,JSON[_0xd056('0x16')](_0x1abd17));_0x34607d(_0x1abd17);})[_0xd056('0x1a')](function(_0x29c06a){logger['error'](_0xd056('0x1b'),_0x29c06a[_0xd056('0x18')],_0x466bad);_0x308318(_0x186990['error'](0x1f4,_0x29c06a[_0xd056('0x18')]));});});};exports[_0xd056('0x23')]=function(_0x22ec15){return new Promise(function(_0x5716d8,_0x44de3e){return db[_0xd056('0x24')][_0xd056('0x25')]({'where':_0x22ec15[_0xd056('0x1e')]?_0x22ec15['options']['where']||null:null})[_0xd056('0x21')](function(_0x405b59){if(_0x405b59){return _0x405b59[_0xd056('0x26')](_0x22ec15[_0xd056('0x1d')]['ids'],_[_0xd056('0x27')](_0x22ec15['body'],['ids','id'])||{});}})[_0xd056('0x28')](function(_0x3eef38){logger[_0xd056('0x13')](_0xd056('0x29'),_0x22ec15);logger[_0xd056('0x22')](_0xd056('0x29'),_0x22ec15,JSON[_0xd056('0x16')](_0x3eef38));_0x5716d8(_0x3eef38);})['catch'](function(_0x24e9c0){logger[_0xd056('0x17')]('AddTags',_0x24e9c0[_0xd056('0x18')],_0x22ec15);_0x44de3e(_this[_0xd056('0x17')](0x1f4,_0x24e9c0[_0xd056('0x18')]));});});}; \ No newline at end of file +var _0xaf3f=['UpdateChatInteraction','options','raw','attributes','limit','AddTagsToChatInteraction','find','body','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xaf3f,0x11c));var _0xfaf3=function(_0x5e9726,_0x3ec9e6){_0x5e9726=_0x5e9726-0x0;var _0x46787a=_0xaf3f[_0x5e9726];return _0x46787a;};'use strict';var _=require(_0xfaf3('0x0'));var util=require(_0xfaf3('0x1'));var moment=require(_0xfaf3('0x2'));var BPromise=require(_0xfaf3('0x3'));var rs=require(_0xfaf3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfaf3('0x5'));var logger=require(_0xfaf3('0x6'))(_0xfaf3('0x7'));var config=require(_0xfaf3('0x8'));var jayson=require(_0xfaf3('0x9'));var client=jayson['client'][_0xfaf3('0xa')]({'port':0x232a});config[_0xfaf3('0xb')]=_['defaults'](config[_0xfaf3('0xb')],{'host':_0xfaf3('0xc'),'port':0x18eb});var socket=require(_0xfaf3('0xd'))(new Redis(config[_0xfaf3('0xb')]));require('./chatInteraction.socket')[_0xfaf3('0xe')](socket);function respondWithRpcPromise(_0x2baff9,_0x493357,_0x244d25){return new BPromise(function(_0x52bf44,_0x3e9af7){return client[_0xfaf3('0xf')](_0x2baff9,_0x244d25)[_0xfaf3('0x10')](function(_0x437fea){logger[_0xfaf3('0x11')](_0xfaf3('0x12'),_0x493357,_0xfaf3('0x13'));logger[_0xfaf3('0x14')](_0xfaf3('0x15'),_0x493357,_0xfaf3('0x13'),JSON[_0xfaf3('0x16')](_0x437fea));if(_0x437fea['error']){if(_0x437fea[_0xfaf3('0x17')][_0xfaf3('0x18')]===0x1f4){logger[_0xfaf3('0x17')](_0xfaf3('0x12'),_0x493357,_0x437fea['error'][_0xfaf3('0x19')]);return _0x3e9af7(_0x437fea['error']['message']);}logger[_0xfaf3('0x17')](_0xfaf3('0x12'),_0x493357,_0x437fea[_0xfaf3('0x17')][_0xfaf3('0x19')]);return _0x52bf44(_0x437fea[_0xfaf3('0x17')]['message']);}else{logger[_0xfaf3('0x11')](_0xfaf3('0x12'),_0x493357,'request\x20sent');_0x52bf44(_0x437fea[_0xfaf3('0x1a')][_0xfaf3('0x19')]);}})[_0xfaf3('0x1b')](function(_0xab041){logger[_0xfaf3('0x17')](_0xfaf3('0x12'),_0x493357,_0xab041);_0x3e9af7(_0xab041);});});}exports[_0xfaf3('0x1c')]=function(_0x4b7e9d){var _0x4be7d0=this;return new Promise(function(_0x5dc571,_0x4f8450){return db['ChatInteraction']['update'](_0x4b7e9d['body'],{'raw':_0x4b7e9d[_0xfaf3('0x1d')]?_0x4b7e9d[_0xfaf3('0x1d')][_0xfaf3('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b7e9d[_0xfaf3('0x1d')]?_0x4b7e9d[_0xfaf3('0x1d')]['where']||null:null,'attributes':_0x4b7e9d['options']?_0x4b7e9d[_0xfaf3('0x1d')][_0xfaf3('0x1f')]||null:null,'limit':_0x4b7e9d[_0xfaf3('0x1d')]?_0x4b7e9d[_0xfaf3('0x1d')][_0xfaf3('0x20')]||null:null})[_0xfaf3('0x10')](function(_0x36b799){logger[_0xfaf3('0x11')](_0xfaf3('0x1c'),_0x4b7e9d);logger[_0xfaf3('0x14')](_0xfaf3('0x1c'),_0x4b7e9d,JSON['stringify'](_0x36b799));_0x5dc571(_0x36b799);})[_0xfaf3('0x1b')](function(_0x34bd29){logger[_0xfaf3('0x17')](_0xfaf3('0x1c'),_0x34bd29[_0xfaf3('0x19')],_0x4b7e9d);_0x4f8450(_0x4be7d0[_0xfaf3('0x17')](0x1f4,_0x34bd29[_0xfaf3('0x19')]));});});};exports[_0xfaf3('0x21')]=function(_0x581cc5){return new Promise(function(_0x44293a,_0x2520c8){return db['ChatInteraction'][_0xfaf3('0x22')]({'where':_0x581cc5[_0xfaf3('0x1d')]?_0x581cc5[_0xfaf3('0x1d')]['where']||null:null})[_0xfaf3('0x10')](function(_0x2b9592){if(_0x2b9592){return _0x2b9592['addTags'](_0x581cc5[_0xfaf3('0x23')][_0xfaf3('0x24')],_['omit'](_0x581cc5[_0xfaf3('0x23')],['ids','id'])||{});}})[_0xfaf3('0x25')](function(_0x270085){logger['info']('AddTags',_0x581cc5);logger[_0xfaf3('0x14')](_0xfaf3('0x26'),_0x581cc5,JSON[_0xfaf3('0x16')](_0x270085));_0x44293a(_0x270085);})[_0xfaf3('0x1b')](function(_0x2b5e2){logger[_0xfaf3('0x17')](_0xfaf3('0x26'),_0x2b5e2[_0xfaf3('0x19')],_0x581cc5);_0x2520c8(_this[_0xfaf3('0x17')](0x1f4,_0x2b5e2['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 1183963..447e0b8 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 _0xd1d0=['length','chatInteraction:','./chatInteraction.events','remove','update','register'];(function(_0x22630d,_0x5c9037){var _0x46fa47=function(_0x10001a){while(--_0x10001a){_0x22630d['push'](_0x22630d['shift']());}};_0x46fa47(++_0x5c9037);}(_0xd1d0,0xe0));var _0x0d1d=function(_0x29a57e,_0x588106){_0x29a57e=_0x29a57e-0x0;var _0x3709c9=_0xd1d0[_0x29a57e];return _0x3709c9;};'use strict';var ChatInteractionEvents=require(_0x0d1d('0x0'));var events=['save',_0x0d1d('0x1'),_0x0d1d('0x2')];function createListener(_0x5193f1,_0xdb5701){return function(_0x492093){_0xdb5701['emit'](_0x5193f1,_0x492093);};}function removeListener(_0x45e126,_0x1c64fd){return function(){ChatInteractionEvents['removeListener'](_0x45e126,_0x1c64fd);};}exports[_0x0d1d('0x3')]=function(_0x2756e1){for(var _0x258e96=0x0,_0x2b7605=events[_0x0d1d('0x4')];_0x258e96<_0x2b7605;_0x258e96++){var _0x526c79=events[_0x258e96];var _0x20cf36=createListener(_0x0d1d('0x5')+_0x526c79,_0x2756e1);ChatInteractionEvents['on'](_0x526c79,_0x20cf36);}}; \ No newline at end of file +var _0x9318=['update','emit','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x4179e2,_0xf2dbb){var _0x24cb50=function(_0x3b7899){while(--_0x3b7899){_0x4179e2['push'](_0x4179e2['shift']());}};_0x24cb50(++_0xf2dbb);}(_0x9318,0xe5));var _0x8931=function(_0x50f63f,_0x3be855){_0x50f63f=_0x50f63f-0x0;var _0xa38248=_0x9318[_0x50f63f];return _0xa38248;};'use strict';var ChatInteractionEvents=require(_0x8931('0x0'));var events=[_0x8931('0x1'),_0x8931('0x2'),_0x8931('0x3')];function createListener(_0x401e8b,_0x4bd01d){return function(_0x26e4aa){_0x4bd01d[_0x8931('0x4')](_0x401e8b,_0x26e4aa);};}function removeListener(_0x30b661,_0x2590fd){return function(){ChatInteractionEvents['removeListener'](_0x30b661,_0x2590fd);};}exports[_0x8931('0x5')]=function(_0x4d504b){for(var _0x38be7d=0x0,_0x40cbac=events[_0x8931('0x6')];_0x38be7d<_0x40cbac;_0x38be7d++){var _0x1e2404=events[_0x38be7d];var _0x4606ba=createListener(_0x8931('0x7')+_0x1e2404,_0x4d504b);ChatInteractionEvents['on'](_0x1e2404,_0x4606ba);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index b3913af..58eda72 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 _0xf063=['/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','join','root','format','%s-%s','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','tracked','chatinteraction:update','put','/:id/custom_update','customUpdate','abandon','close','delete','destroy','removeTags','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe'];(function(_0x2a2166,_0x3a077f){var _0x3bcf50=function(_0x3f0300){while(--_0x3f0300){_0x2a2166['push'](_0x2a2166['shift']());}};_0x3bcf50(++_0x3a077f);}(_0xf063,0x1a3));var _0x3f06=function(_0x453ebf,_0x1b9eae){_0x453ebf=_0x453ebf-0x0;var _0x47f8da=_0xf063[_0x453ebf];return _0x47f8da;};'use strict';var multer=require(_0x3f06('0x0'));var util=require(_0x3f06('0x1'));var path=require(_0x3f06('0x2'));var timeout=require('connect-timeout');var express=require(_0x3f06('0x3'));var router=express[_0x3f06('0x4')]();var auth=require(_0x3f06('0x5'));var interaction=require(_0x3f06('0x6'));var config=require(_0x3f06('0x7'));var controller=require('./chatInteraction.controller');router[_0x3f06('0x8')]('/',auth['isAuthenticated'](),controller[_0x3f06('0x9')]);router[_0x3f06('0x8')](_0x3f06('0xa'),auth[_0x3f06('0xb')](),controller[_0x3f06('0xc')]);router['get'](_0x3f06('0xd'),auth[_0x3f06('0xe')](),controller[_0x3f06('0xf')]);router[_0x3f06('0x8')](_0x3f06('0x10'),auth[_0x3f06('0xe')](),controller[_0x3f06('0x11')]);router[_0x3f06('0x8')](_0x3f06('0x12'),auth[_0x3f06('0xb')](),controller[_0x3f06('0x13')]);router[_0x3f06('0x8')](_0x3f06('0x14'),auth[_0x3f06('0xe')](),controller[_0x3f06('0x15')]);router[_0x3f06('0x8')](_0x3f06('0x16'),auth[_0x3f06('0xb')](),controller['download']);router[_0x3f06('0x17')]('/',auth['isAuthenticated'](),controller[_0x3f06('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3d8095,_0x6208ce,_0xcfe82e){_0xcfe82e(null,path[_0x3f06('0x19')](config[_0x3f06('0x1a')],'server/files/attachments/'));},'filename':function(_0x45ac70,_0x5d2b92,_0x8a5fee){_0x8a5fee(null,util[_0x3f06('0x1b')](_0x3f06('0x1c'),Date['now'](),_0x5d2b92['originalname'][_0x3f06('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3f06('0x17')](_0x3f06('0x1e'),upload[_0x3f06('0x1f')]('file'),controller[_0x3f06('0x20')]);router[_0x3f06('0x17')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x3f06('0x21')]);router[_0x3f06('0x17')](_0x3f06('0x22'),auth[_0x3f06('0xb')](),interaction['tracked'](_0x3f06('0x23'),_0x3f06('0x24')),controller[_0x3f06('0x25')]);router['put'](_0x3f06('0xd'),auth[_0x3f06('0xb')](),interaction[_0x3f06('0x26')](_0x3f06('0x23'),_0x3f06('0x27')),controller['update']);router[_0x3f06('0x28')](_0x3f06('0x29'),controller[_0x3f06('0x2a')]);router['put']('/:id/abandon',auth[_0x3f06('0xe')](),controller[_0x3f06('0x2b')]);router[_0x3f06('0x28')]('/:id/close',controller[_0x3f06('0x2c')]);router[_0x3f06('0x2d')]('/:id',auth[_0x3f06('0xb')](),interaction[_0x3f06('0x26')](_0x3f06('0x23'),'chatinteraction:destroy'),controller[_0x3f06('0x2e')]);router[_0x3f06('0x2d')]('/:id/tags',auth['isAuthenticated'](),controller[_0x3f06('0x2f')]);module['exports']=router; \ No newline at end of file +var _0xa49c=['getMessages','/:id/my_messages','download','post','create','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','single','file','attachmentUpload','/:id/tags','tracked','chat','addTags','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','chatinteraction:destroy','destroy','delete','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages'];(function(_0x3725c6,_0x26a807){var _0x484d86=function(_0x41f61a){while(--_0x41f61a){_0x3725c6['push'](_0x3725c6['shift']());}};_0x484d86(++_0x26a807);}(_0xa49c,0x167));var _0xca49=function(_0x484cb9,_0x103489){_0x484cb9=_0x484cb9-0x0;var _0x59517e=_0xa49c[_0x484cb9];return _0x59517e;};'use strict';var multer=require(_0xca49('0x0'));var util=require('util');var path=require(_0xca49('0x1'));var timeout=require(_0xca49('0x2'));var express=require(_0xca49('0x3'));var router=express[_0xca49('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xca49('0x5'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0xca49('0x6')]('/',auth[_0xca49('0x7')](),controller[_0xca49('0x8')]);router[_0xca49('0x6')](_0xca49('0x9'),auth[_0xca49('0x7')](),controller[_0xca49('0xa')]);router[_0xca49('0x6')](_0xca49('0xb'),auth[_0xca49('0xc')](),controller[_0xca49('0xd')]);router['get'](_0xca49('0xe'),auth[_0xca49('0xc')](),controller[_0xca49('0xf')]);router[_0xca49('0x6')](_0xca49('0x10'),auth[_0xca49('0x7')](),controller[_0xca49('0x11')]);router[_0xca49('0x6')](_0xca49('0x12'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0xca49('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0xca49('0x13')]);router[_0xca49('0x14')]('/',auth[_0xca49('0x7')](),controller[_0xca49('0x15')]);var upload=multer({'storage':multer[_0xca49('0x16')]({'destination':function(_0x326601,_0x189b1a,_0x4e1226){_0x4e1226(null,path[_0xca49('0x17')](config[_0xca49('0x18')],_0xca49('0x19')));},'filename':function(_0xcdba17,_0x45e108,_0x93bc35){_0x93bc35(null,util[_0xca49('0x1a')](_0xca49('0x1b'),Date[_0xca49('0x1c')](),_0x45e108['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xca49('0x14')]('/:id/attachment_upload',upload[_0xca49('0x1d')](_0xca49('0x1e')),controller[_0xca49('0x1f')]);router[_0xca49('0x14')](_0xca49('0x10'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router['post'](_0xca49('0x20'),auth['isAuthenticated'](),interaction[_0xca49('0x21')](_0xca49('0x22'),'chatinteraction:addtags'),controller[_0xca49('0x23')]);router['put']('/:id',auth[_0xca49('0x7')](),interaction[_0xca49('0x21')](_0xca49('0x22'),_0xca49('0x24')),controller[_0xca49('0x25')]);router[_0xca49('0x26')](_0xca49('0x27'),controller[_0xca49('0x28')]);router[_0xca49('0x26')](_0xca49('0x29'),auth[_0xca49('0xc')](),controller['abandon']);router[_0xca49('0x26')]('/:id/close',controller['close']);router['delete'](_0xca49('0xb'),auth[_0xca49('0x7')](),interaction['tracked'](_0xca49('0x22'),_0xca49('0x2a')),controller[_0xca49('0x2b')]);router[_0xca49('0x2c')]('/:id/tags',auth[_0xca49('0x7')](),controller[_0xca49('0x2d')]);module[_0xca49('0x2e')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 06d9ddf..f0f2102 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 _0x0b0e=['TEXT','BOOLEAN','INTEGER','sequelize'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0b0e,0x187));var _0xe0b0=function(_0x597e38,_0x551ac2){_0x597e38=_0x597e38-0x0;var _0x5305d2=_0x0b0e[_0x597e38];return _0x5305d2;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe0b0('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe0b0('0x3')]}}; \ No newline at end of file +var _0x5f66=['exports','medium','BOOLEAN','INTEGER'];(function(_0x391778,_0x418ca9){var _0x1ff93e=function(_0x445c6c){while(--_0x445c6c){_0x391778['push'](_0x391778['shift']());}};_0x1ff93e(++_0x418ca9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x65f6('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index e8149dd..44eee66 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 _0x105b=['end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','send','ChatInternalMessage','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','userpic','online','lastLoginAt','allowmessenger','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','ToId','read','-createdAt','all','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status'];(function(_0x5ec98d,_0xd1d927){var _0x42885f=function(_0x5a7a2b){while(--_0x5a7a2b){_0x5ec98d['push'](_0x5ec98d['shift']());}};_0x42885f(++_0xd1d927);}(_0x105b,0x1a7));var _0xb105=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x105b[_0x618414];return _0x21c19a;};'use strict';var pdf=require(_0xb105('0x0'));var emlformat=require(_0xb105('0x1'));var rimraf=require(_0xb105('0x2'));var zipdir=require(_0xb105('0x3'));var jsonpatch=require(_0xb105('0x4'));var rp=require(_0xb105('0x5'));var moment=require(_0xb105('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xb105('0x7'));var util=require(_0xb105('0x8'));var path=require(_0xb105('0x9'));var sox=require('sox');var csv=require(_0xb105('0xa'));var ejs=require(_0xb105('0xb'));var fs=require('fs');var _=require(_0xb105('0xc'));var squel=require(_0xb105('0xd'));var crypto=require(_0xb105('0xe'));var jsforce=require(_0xb105('0xf'));var deskjs=require(_0xb105('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb105('0x11'));var Papa=require(_0xb105('0x12'));var Redis=require('ioredis');var authService=require(_0xb105('0x13'));var qs=require(_0xb105('0x14'));var hardwareService=require(_0xb105('0x15'));var logger=require(_0xb105('0x16'))(_0xb105('0x17'));var utils=require('../../config/utils');var config=require(_0xb105('0x18'));var db=require(_0xb105('0x19'))['db'];config['redis']=_[_0xb105('0x1a')](config[_0xb105('0x1b')],{'host':_0xb105('0x1c'),'port':0x18eb});var socket=require(_0xb105('0x1d'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xb105('0x1e')](socket);function respondWithStatusCode(_0xe9e74b,_0x5539d9){_0x5539d9=_0x5539d9||0xcc;return function(_0x57ef20){if(_0x57ef20){return _0xe9e74b[_0xb105('0x1f')](_0x5539d9);}return _0xe9e74b[_0xb105('0x20')](_0x5539d9)[_0xb105('0x21')]();};}function respondWithResult(_0x1000d8,_0x37a7b8){_0x37a7b8=_0x37a7b8||0xc8;return function(_0x4c17df){if(_0x4c17df){return _0x1000d8['status'](_0x37a7b8)[_0xb105('0x22')](_0x4c17df);}};}function respondWithFilteredResult(_0x57fdda,_0x519ba6){return function(_0x47316a){if(_0x47316a){var _0x2f7d98=_0x47316a[_0xb105('0x23')],_0x9b1007=_0x519ba6[_0xb105('0x24')],_0x29a342=_0x519ba6[_0xb105('0x24')]+_0x519ba6[_0xb105('0x25')],_0x4f6551;if(_0x29a342>=_0x2f7d98){_0x29a342=_0x2f7d98;_0x4f6551=0xc8;}else{_0x4f6551=0xce;}_0x57fdda[_0xb105('0x20')](_0x4f6551);return _0x57fdda['set'](_0xb105('0x26'),_0x9b1007+'-'+_0x29a342+'/'+_0x2f7d98)[_0xb105('0x22')](_0x47316a);}return null;};}function patchUpdates(_0x7bff86){return function(_0x148e52){try{jsonpatch[_0xb105('0x27')](_0x148e52,_0x7bff86,!![]);}catch(_0x1d9c14){return BPromise['reject'](_0x1d9c14);}return _0x148e52[_0xb105('0x28')]();};}function saveUpdates(_0x28a413,_0x12e28d){return function(_0x4da00b){if(_0x4da00b){return _0x4da00b[_0xb105('0x29')](_0x28a413)[_0xb105('0x2a')](function(_0x33700a){return _0x33700a;});}return null;};}function removeEntity(_0x1a085a,_0x51c25f){return function(_0x2f64a0){if(_0x2f64a0){return _0x2f64a0[_0xb105('0x2b')]()[_0xb105('0x2a')](function(){_0x1a085a[_0xb105('0x20')](0xcc)[_0xb105('0x21')]();});}};}function handleEntityNotFound(_0x415deb,_0x470e1b){return function(_0x5364fa){if(!_0x5364fa){_0x415deb[_0xb105('0x1f')](0x194);}return _0x5364fa;};}function handleError(_0x5e47a7,_0x53ab1a){_0x53ab1a=_0x53ab1a||0x1f4;return function(_0x27c051){logger[_0xb105('0x2c')](_0x27c051[_0xb105('0x2d')]);if(_0x27c051[_0xb105('0x2e')]){delete _0x27c051['name'];}_0x5e47a7[_0xb105('0x20')](_0x53ab1a)[_0xb105('0x2f')](_0x27c051);};}exports['index']=function(_0xcfd15,_0x187d21){var _0x1c766e={},_0x59f0ef={},_0x119b8e={'count':0x0,'rows':[]};var _0xebce21=db[_0xb105('0x30')][_0xb105('0x31')];_0x59f0ef['model']=_[_0xb105('0x32')](_0xebce21);_0x59f0ef[_0xb105('0x33')]=_['keys'](_0xcfd15[_0xb105('0x33')]);_0x59f0ef['filters']=_[_0xb105('0x34')](_0x59f0ef[_0xb105('0x35')],_0x59f0ef[_0xb105('0x33')]);_0x1c766e[_0xb105('0x36')]=_[_0xb105('0x34')](_0x59f0ef[_0xb105('0x35')],qs[_0xb105('0x37')](_0xcfd15[_0xb105('0x33')][_0xb105('0x37')]));_0x1c766e[_0xb105('0x36')]=_0x1c766e[_0xb105('0x36')][_0xb105('0x38')]?_0x1c766e[_0xb105('0x36')]:_0x59f0ef[_0xb105('0x35')];if(!_0xcfd15[_0xb105('0x33')][_0xb105('0x39')](_0xb105('0x3a'))){_0x1c766e[_0xb105('0x25')]=qs[_0xb105('0x25')](_0xcfd15[_0xb105('0x33')][_0xb105('0x25')]);_0x1c766e['offset']=qs['offset'](_0xcfd15['query'][_0xb105('0x24')]);}_0x1c766e[_0xb105('0x3b')]=qs[_0xb105('0x3c')](_0xcfd15['query']['sort']);_0x1c766e[_0xb105('0x3d')]=qs['filters'](_[_0xb105('0x3e')](_0xcfd15[_0xb105('0x33')],_0x59f0ef[_0xb105('0x3f')]));if(_0xcfd15['query'][_0xb105('0x40')]){_0x1c766e[_0xb105('0x3d')]=_[_0xb105('0x41')](_0x1c766e[_0xb105('0x3d')],{'$or':_[_0xb105('0x42')](_0xebce21,function(_0x4ea564){if(_0x4ea564[_0xb105('0x43')][_0xb105('0x44')]!==_0xb105('0x45')){var _0x2da18d={};_0x2da18d[_0x4ea564[_0xb105('0x46')]]={'$like':'%'+_0xcfd15[_0xb105('0x33')]['filter']+'%'};return _0x2da18d;}})});}_0x1c766e=_[_0xb105('0x41')]({},_0x1c766e,_0xcfd15[_0xb105('0x47')]);var _0x172c12={'where':_0x1c766e['where']};return db[_0xb105('0x30')]['count'](_0x172c12)[_0xb105('0x2a')](function(_0x1f5136){_0x119b8e['count']=_0x1f5136;if(_0xcfd15[_0xb105('0x33')][_0xb105('0x48')]){_0x1c766e[_0xb105('0x49')]=[{'all':!![]}];}return db[_0xb105('0x30')][_0xb105('0x4a')](_0x1c766e);})[_0xb105('0x2a')](function(_0x5a77f6){_0x119b8e[_0xb105('0x4b')]=_0x5a77f6;return _0x119b8e;})['then'](respondWithFilteredResult(_0x187d21,_0x1c766e))[_0xb105('0x4c')](handleError(_0x187d21,null));};exports[_0xb105('0x4d')]=function(_0xcc3b1,_0x20bca8){var _0x16f6c8={'raw':!![],'where':{'id':_0xcc3b1[_0xb105('0x4e')]['id']}},_0x5871bd={};_0x5871bd[_0xb105('0x35')]=_['keys'](db[_0xb105('0x30')][_0xb105('0x31')]);_0x5871bd['query']=_[_0xb105('0x32')](_0xcc3b1[_0xb105('0x33')]);_0x5871bd[_0xb105('0x3f')]=_['intersection'](_0x5871bd[_0xb105('0x35')],_0x5871bd[_0xb105('0x33')]);_0x16f6c8[_0xb105('0x36')]=_['intersection'](_0x5871bd[_0xb105('0x35')],qs[_0xb105('0x37')](_0xcc3b1[_0xb105('0x33')][_0xb105('0x37')]));_0x16f6c8[_0xb105('0x36')]=_0x16f6c8[_0xb105('0x36')][_0xb105('0x38')]?_0x16f6c8[_0xb105('0x36')]:_0x5871bd[_0xb105('0x35')];if(_0xcc3b1['query'][_0xb105('0x48')]){_0x16f6c8['include']=[{'all':!![]}];}_0x16f6c8=_[_0xb105('0x41')]({},_0x16f6c8,_0xcc3b1[_0xb105('0x47')]);return db[_0xb105('0x30')][_0xb105('0x4f')](_0x16f6c8)['then'](handleEntityNotFound(_0x20bca8,null))[_0xb105('0x2a')](respondWithResult(_0x20bca8,null))['catch'](handleError(_0x20bca8,null));};exports['create']=function(_0x5a3af9,_0x5f0e58){return db['ChatInternalMessage'][_0xb105('0x50')](_0x5a3af9[_0xb105('0x51')],{})[_0xb105('0x2a')](respondWithResult(_0x5f0e58,0xc9))['catch'](handleError(_0x5f0e58,null));};exports[_0xb105('0x29')]=function(_0x420cd2,_0x153aed){if(_0x420cd2[_0xb105('0x51')]['id']){delete _0x420cd2[_0xb105('0x51')]['id'];}return db[_0xb105('0x30')][_0xb105('0x4f')]({'where':{'id':_0x420cd2[_0xb105('0x4e')]['id']}})[_0xb105('0x2a')](handleEntityNotFound(_0x153aed,null))[_0xb105('0x2a')](saveUpdates(_0x420cd2['body'],null))[_0xb105('0x2a')](respondWithResult(_0x153aed,null))[_0xb105('0x4c')](handleError(_0x153aed,null));};exports[_0xb105('0x2b')]=function(_0x2b5ddf,_0x2d9afc){return db[_0xb105('0x30')][_0xb105('0x4f')]({'where':{'id':_0x2b5ddf[_0xb105('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2d9afc,null))[_0xb105('0x2a')](removeEntity(_0x2d9afc,null))[_0xb105('0x4c')](handleError(_0x2d9afc,null));};exports[_0xb105('0x52')]=function(_0x36afee,_0x43c4e9){return db[_0xb105('0x30')][_0xb105('0x52')]()[_0xb105('0x2a')](respondWithResult(_0x43c4e9,null))['catch'](handleError(_0x43c4e9,null));};function wrapUser(_0x2816ad){return function(_0xb189b5){var _0x508b82=_0x2816ad[_0xb105('0x53')]({'plain':!![]});_0x508b82[_0xb105('0x54')]=[];if(_0xb189b5){_0x508b82[_0xb105('0x55')]=_0xb189b5[_0xb105('0x56')];_0x508b82[_0xb105('0x57')]=_0xb189b5;}else{_0x508b82['lastMessageAt']=moment(0x0)['format'](_0xb105('0x58'));_0x508b82['lastMessage']={};}return _0x508b82;};}exports[_0xb105('0x59')]=function(_0x4eba0a,_0x13b952,_0x1093e1){var _0x32ffed=[];return db[_0xb105('0x5a')]['findAll']({'where':{'role':[_0xb105('0x5b'),_0xb105('0x5c'),_0xb105('0x5d')]},'attributes':['id',_0xb105('0x5e'),'name','role',_0xb105('0x5f'),'internal',_0xb105('0x60'),_0xb105('0x61'),_0xb105('0x62'),'showWebBar'],'order':qs[_0xb105('0x3c')]('-online'),'include':[{'model':db[_0xb105('0x63')],'as':_0xb105('0x64'),'attributes':['id',_0xb105('0x2e'),_0xb105('0x43')],'through':{'attributes':[]}}]})[_0xb105('0x2a')](function(_0x113802){if(_0x113802){var _0x400f0=_0x4eba0a[_0xb105('0x5d')]['get']({'plain':!![]});if(!_0x400f0)throw new Error(_0xb105('0x65'));if(_0x400f0[_0xb105('0x66')]===_0xb105('0x5d')){return db[_0xb105('0x67')][_0xb105('0x4f')]({'where':{'name':'Agents','userProfileId':_0x400f0[_0xb105('0x68')]},'raw':!![]})[_0xb105('0x2a')](function(_0x1e8d58){if(_0x1e8d58){if(_0x1e8d58[_0xb105('0x69')]===0x0){return db[_0xb105('0x6a')][_0xb105('0x4a')]({'where':{'sectionId':_0x1e8d58['id']},'raw':!![]})[_0xb105('0x2a')](function(_0x4f28b4){var _0x15994c=[];if(_[_0xb105('0x6b')](_0x4f28b4)){_0x15994c=_['filter'](_0x113802,function(_0x50f833){if(_0x50f833[_0xb105('0x66')]!==_0xb105('0x5b')){return _0x50f833;}});return _0x15994c;}else{for(var _0x1713fd=0x0;_0x1713fd<_0x113802[_0xb105('0x38')];_0x1713fd++){var _0x87347d=_0x113802[_0x1713fd];if(_0x87347d['role']===_0xb105('0x5b')){var _0x20392b=_[_0xb105('0x4f')](_0x4f28b4,function(_0x16b3f9){return _0x16b3f9[_0xb105('0x6c')]===_0x87347d['id'];});if(_0x20392b)_0x15994c['push'](_0x87347d);}else{_0x15994c[_0xb105('0x6d')](_0x87347d);}}return _0x15994c;}});}else{return _0x113802;}}else{var _0x3f17ec=_[_0xb105('0x40')](_0x113802,function(_0x4e028f){if(_0x4e028f['role']!==_0xb105('0x5b')){return _0x4e028f;}});return _0x3f17ec;}});}else{return _0x113802;}}})[_0xb105('0x2a')](function(_0x10963e){var _0x3a0c84=[];if(_0x10963e){_0x32ffed=_0x10963e;for(var _0x430836=0x0;_0x430836<_0x10963e[_0xb105('0x38')];_0x430836+=0x1){_0x32ffed[_0x430836][_0xb105('0x54')]=[];_0x3a0c84[_0xb105('0x6d')](db[_0xb105('0x30')]['find']({'where':{'FromId':[_0x4eba0a[_0xb105('0x5d')]['id'],_0x10963e[_0x430836]['id']],'ToId':[_0x4eba0a[_0xb105('0x5d')]['id'],_0x10963e[_0x430836]['id']],'ChatGroupId':null},'attributes':['id',_0xb105('0x56'),'FromId',_0xb105('0x6e'),_0xb105('0x6f'),_0xb105('0x51')],'order':qs['sort'](_0xb105('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xb105('0x2a')](wrapUser(_0x10963e[_0x430836])));}return BPromise[_0xb105('0x71')](_0x3a0c84);}return[];})['then'](function(_0x5520e3){return{'rows':_0x5520e3,'count':_0x5520e3[_0xb105('0x38')]};})['then'](respondWithResult(_0x13b952,null))[_0xb105('0x4c')](handleError(_0x13b952,null));}; \ No newline at end of file +var _0x7d8a=['find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','name','role','userpic','lastLoginAt','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','push','FromId','read','-createdAt','all','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','defaults','redis','localhost','./chatInternalMessage.socket','sendStatus','status','end','json','offset','limit','Content-Range','reject','save','update','then','destroy','send','ChatInternalMessage','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','count','include','findAll','rows','catch','show','params','rawAttributes','fields','includeAll'];(function(_0x1224f7,_0x584e82){var _0x13f2ec=function(_0x5d3b0b){while(--_0x5d3b0b){_0x1224f7['push'](_0x1224f7['shift']());}};_0x13f2ec(++_0x584e82);}(_0x7d8a,0x1ca));var _0xa7d8=function(_0x14fad0,_0x278d75){_0x14fad0=_0x14fad0-0x0;var _0x5c665f=_0x7d8a[_0x14fad0];return _0x5c665f;};'use strict';var pdf=require(_0xa7d8('0x0'));var emlformat=require(_0xa7d8('0x1'));var rimraf=require(_0xa7d8('0x2'));var zipdir=require(_0xa7d8('0x3'));var jsonpatch=require(_0xa7d8('0x4'));var rp=require(_0xa7d8('0x5'));var moment=require(_0xa7d8('0x6'));var BPromise=require(_0xa7d8('0x7'));var Mustache=require(_0xa7d8('0x8'));var util=require(_0xa7d8('0x9'));var path=require(_0xa7d8('0xa'));var sox=require(_0xa7d8('0xb'));var csv=require(_0xa7d8('0xc'));var ejs=require(_0xa7d8('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa7d8('0xe'));var crypto=require(_0xa7d8('0xf'));var jsforce=require(_0xa7d8('0x10'));var deskjs=require(_0xa7d8('0x11'));var toCsv=require(_0xa7d8('0xc'));var querystring=require('querystring');var Papa=require(_0xa7d8('0x12'));var Redis=require('ioredis');var authService=require(_0xa7d8('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa7d8('0x14'));var logger=require('../../config/logger')(_0xa7d8('0x15'));var utils=require(_0xa7d8('0x16'));var config=require('../../config/environment');var db=require(_0xa7d8('0x17'))['db'];config['redis']=_[_0xa7d8('0x18')](config[_0xa7d8('0x19')],{'host':_0xa7d8('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa7d8('0x19')]));require(_0xa7d8('0x1b'))['register'](socket);function respondWithStatusCode(_0x5bfb1a,_0x5080d6){_0x5080d6=_0x5080d6||0xcc;return function(_0x379f6c){if(_0x379f6c){return _0x5bfb1a[_0xa7d8('0x1c')](_0x5080d6);}return _0x5bfb1a[_0xa7d8('0x1d')](_0x5080d6)[_0xa7d8('0x1e')]();};}function respondWithResult(_0x3452d0,_0x2ae530){_0x2ae530=_0x2ae530||0xc8;return function(_0x2bbaf4){if(_0x2bbaf4){return _0x3452d0[_0xa7d8('0x1d')](_0x2ae530)[_0xa7d8('0x1f')](_0x2bbaf4);}};}function respondWithFilteredResult(_0xfc0284,_0x10e584){return function(_0x5624d3){if(_0x5624d3){var _0x30d38e=_0x5624d3['count'],_0x50d6a6=_0x10e584[_0xa7d8('0x20')],_0x34eac8=_0x10e584[_0xa7d8('0x20')]+_0x10e584[_0xa7d8('0x21')],_0x3af212;if(_0x34eac8>=_0x30d38e){_0x34eac8=_0x30d38e;_0x3af212=0xc8;}else{_0x3af212=0xce;}_0xfc0284[_0xa7d8('0x1d')](_0x3af212);return _0xfc0284['set'](_0xa7d8('0x22'),_0x50d6a6+'-'+_0x34eac8+'/'+_0x30d38e)['json'](_0x5624d3);}return null;};}function patchUpdates(_0x33f117){return function(_0xa6614a){try{jsonpatch['apply'](_0xa6614a,_0x33f117,!![]);}catch(_0x381fca){return BPromise[_0xa7d8('0x23')](_0x381fca);}return _0xa6614a[_0xa7d8('0x24')]();};}function saveUpdates(_0x426a20,_0x46d9a9){return function(_0x488f7e){if(_0x488f7e){return _0x488f7e[_0xa7d8('0x25')](_0x426a20)[_0xa7d8('0x26')](function(_0x5e8acb){return _0x5e8acb;});}return null;};}function removeEntity(_0x2c33f8,_0x31afb8){return function(_0x4a3fd6){if(_0x4a3fd6){return _0x4a3fd6[_0xa7d8('0x27')]()[_0xa7d8('0x26')](function(){_0x2c33f8[_0xa7d8('0x1d')](0xcc)[_0xa7d8('0x1e')]();});}};}function handleEntityNotFound(_0x1f49f6,_0x3f7bd7){return function(_0x2d3f0d){if(!_0x2d3f0d){_0x1f49f6['sendStatus'](0x194);}return _0x2d3f0d;};}function handleError(_0x2aed5b,_0x4a325b){_0x4a325b=_0x4a325b||0x1f4;return function(_0x1dcb71){logger['error'](_0x1dcb71['stack']);if(_0x1dcb71['name']){delete _0x1dcb71['name'];}_0x2aed5b[_0xa7d8('0x1d')](_0x4a325b)[_0xa7d8('0x28')](_0x1dcb71);};}exports['index']=function(_0x3fb24f,_0x23ca78){var _0x31b73d={},_0x54676b={},_0x4ea479={'count':0x0,'rows':[]};var _0xceee5a=db[_0xa7d8('0x29')]['rawAttributes'];_0x54676b[_0xa7d8('0x2a')]=_[_0xa7d8('0x2b')](_0xceee5a);_0x54676b['query']=_['keys'](_0x3fb24f[_0xa7d8('0x2c')]);_0x54676b[_0xa7d8('0x2d')]=_[_0xa7d8('0x2e')](_0x54676b['model'],_0x54676b['query']);_0x31b73d['attributes']=_[_0xa7d8('0x2e')](_0x54676b[_0xa7d8('0x2a')],qs['fields'](_0x3fb24f[_0xa7d8('0x2c')]['fields']));_0x31b73d[_0xa7d8('0x2f')]=_0x31b73d['attributes'][_0xa7d8('0x30')]?_0x31b73d[_0xa7d8('0x2f')]:_0x54676b[_0xa7d8('0x2a')];if(!_0x3fb24f['query'][_0xa7d8('0x31')](_0xa7d8('0x32'))){_0x31b73d[_0xa7d8('0x21')]=qs[_0xa7d8('0x21')](_0x3fb24f[_0xa7d8('0x2c')][_0xa7d8('0x21')]);_0x31b73d[_0xa7d8('0x20')]=qs[_0xa7d8('0x20')](_0x3fb24f[_0xa7d8('0x2c')][_0xa7d8('0x20')]);}_0x31b73d[_0xa7d8('0x33')]=qs['sort'](_0x3fb24f[_0xa7d8('0x2c')][_0xa7d8('0x34')]);_0x31b73d[_0xa7d8('0x35')]=qs[_0xa7d8('0x2d')](_[_0xa7d8('0x36')](_0x3fb24f['query'],_0x54676b[_0xa7d8('0x2d')]));if(_0x3fb24f[_0xa7d8('0x2c')][_0xa7d8('0x37')]){_0x31b73d[_0xa7d8('0x35')]=_[_0xa7d8('0x38')](_0x31b73d[_0xa7d8('0x35')],{'$or':_[_0xa7d8('0x39')](_0xceee5a,function(_0x2e1357){if(_0x2e1357[_0xa7d8('0x3a')][_0xa7d8('0x3b')]!==_0xa7d8('0x3c')){var _0x4420df={};_0x4420df[_0x2e1357['field']]={'$like':'%'+_0x3fb24f['query'][_0xa7d8('0x37')]+'%'};return _0x4420df;}})});}_0x31b73d=_['merge']({},_0x31b73d,_0x3fb24f[_0xa7d8('0x3d')]);var _0x59a79a={'where':_0x31b73d[_0xa7d8('0x35')]};return db[_0xa7d8('0x29')][_0xa7d8('0x3e')](_0x59a79a)[_0xa7d8('0x26')](function(_0x177164){_0x4ea479['count']=_0x177164;if(_0x3fb24f[_0xa7d8('0x2c')]['includeAll']){_0x31b73d[_0xa7d8('0x3f')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xa7d8('0x40')](_0x31b73d);})[_0xa7d8('0x26')](function(_0x130d2f){_0x4ea479[_0xa7d8('0x41')]=_0x130d2f;return _0x4ea479;})[_0xa7d8('0x26')](respondWithFilteredResult(_0x23ca78,_0x31b73d))[_0xa7d8('0x42')](handleError(_0x23ca78,null));};exports[_0xa7d8('0x43')]=function(_0x1b5e33,_0x2ef2be){var _0x127f73={'raw':!![],'where':{'id':_0x1b5e33[_0xa7d8('0x44')]['id']}},_0x325766={};_0x325766[_0xa7d8('0x2a')]=_['keys'](db['ChatInternalMessage'][_0xa7d8('0x45')]);_0x325766[_0xa7d8('0x2c')]=_[_0xa7d8('0x2b')](_0x1b5e33[_0xa7d8('0x2c')]);_0x325766[_0xa7d8('0x2d')]=_['intersection'](_0x325766[_0xa7d8('0x2a')],_0x325766[_0xa7d8('0x2c')]);_0x127f73[_0xa7d8('0x2f')]=_[_0xa7d8('0x2e')](_0x325766['model'],qs['fields'](_0x1b5e33['query'][_0xa7d8('0x46')]));_0x127f73['attributes']=_0x127f73[_0xa7d8('0x2f')][_0xa7d8('0x30')]?_0x127f73[_0xa7d8('0x2f')]:_0x325766['model'];if(_0x1b5e33['query'][_0xa7d8('0x47')]){_0x127f73[_0xa7d8('0x3f')]=[{'all':!![]}];}_0x127f73=_[_0xa7d8('0x38')]({},_0x127f73,_0x1b5e33[_0xa7d8('0x3d')]);return db[_0xa7d8('0x29')][_0xa7d8('0x48')](_0x127f73)[_0xa7d8('0x26')](handleEntityNotFound(_0x2ef2be,null))[_0xa7d8('0x26')](respondWithResult(_0x2ef2be,null))[_0xa7d8('0x42')](handleError(_0x2ef2be,null));};exports[_0xa7d8('0x49')]=function(_0x141f47,_0x430297){return db['ChatInternalMessage'][_0xa7d8('0x49')](_0x141f47['body'],{})[_0xa7d8('0x26')](respondWithResult(_0x430297,0xc9))['catch'](handleError(_0x430297,null));};exports[_0xa7d8('0x25')]=function(_0x3a304f,_0x284dbc){if(_0x3a304f[_0xa7d8('0x4a')]['id']){delete _0x3a304f[_0xa7d8('0x4a')]['id'];}return db[_0xa7d8('0x29')]['find']({'where':{'id':_0x3a304f[_0xa7d8('0x44')]['id']}})[_0xa7d8('0x26')](handleEntityNotFound(_0x284dbc,null))['then'](saveUpdates(_0x3a304f['body'],null))['then'](respondWithResult(_0x284dbc,null))['catch'](handleError(_0x284dbc,null));};exports[_0xa7d8('0x27')]=function(_0x5b347c,_0x3ece59){return db[_0xa7d8('0x29')][_0xa7d8('0x48')]({'where':{'id':_0x5b347c['params']['id']}})['then'](handleEntityNotFound(_0x3ece59,null))['then'](removeEntity(_0x3ece59,null))[_0xa7d8('0x42')](handleError(_0x3ece59,null));};exports[_0xa7d8('0x4b')]=function(_0xa94cf9,_0x4a856){return db[_0xa7d8('0x29')][_0xa7d8('0x4b')]()['then'](respondWithResult(_0x4a856,null))[_0xa7d8('0x42')](handleError(_0x4a856,null));};function wrapUser(_0x425431){return function(_0x346bd9){var _0x206acc=_0x425431[_0xa7d8('0x4c')]({'plain':!![]});_0x206acc[_0xa7d8('0x4d')]=[];if(_0x346bd9){_0x206acc[_0xa7d8('0x4e')]=_0x346bd9[_0xa7d8('0x4f')];_0x206acc[_0xa7d8('0x50')]=_0x346bd9;}else{_0x206acc['lastMessageAt']=moment(0x0)['format'](_0xa7d8('0x51'));_0x206acc[_0xa7d8('0x50')]={};}return _0x206acc;};}exports[_0xa7d8('0x52')]=function(_0x940046,_0x1feca2,_0x4f34d7){var _0xe78337=[];return db[_0xa7d8('0x53')][_0xa7d8('0x40')]({'where':{'role':[_0xa7d8('0x54'),_0xa7d8('0x55'),_0xa7d8('0x56')]},'attributes':['id',_0xa7d8('0x57'),_0xa7d8('0x58'),_0xa7d8('0x59'),_0xa7d8('0x5a'),'internal','online',_0xa7d8('0x5b'),'allowmessenger','showWebBar'],'order':qs[_0xa7d8('0x34')](_0xa7d8('0x5c')),'include':[{'model':db[_0xa7d8('0x5d')],'as':_0xa7d8('0x5e'),'attributes':['id',_0xa7d8('0x58'),_0xa7d8('0x3a')],'through':{'attributes':[]}}]})['then'](function(_0x5712af){if(_0x5712af){var _0x249d1=_0x940046[_0xa7d8('0x56')][_0xa7d8('0x4c')]({'plain':!![]});if(!_0x249d1)throw new Error(_0xa7d8('0x5f'));if(_0x249d1[_0xa7d8('0x59')]===_0xa7d8('0x56')){return db[_0xa7d8('0x60')][_0xa7d8('0x48')]({'where':{'name':_0xa7d8('0x61'),'userProfileId':_0x249d1[_0xa7d8('0x62')]},'raw':!![]})['then'](function(_0x2c5e6b){if(_0x2c5e6b){if(_0x2c5e6b[_0xa7d8('0x63')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x2c5e6b['id']},'raw':!![]})[_0xa7d8('0x26')](function(_0x3325ec){var _0x3cdad3=[];if(_[_0xa7d8('0x64')](_0x3325ec)){_0x3cdad3=_['filter'](_0x5712af,function(_0x2a1147){if(_0x2a1147[_0xa7d8('0x59')]!==_0xa7d8('0x54')){return _0x2a1147;}});return _0x3cdad3;}else{for(var _0x5aaf00=0x0;_0x5aaf00<_0x5712af['length'];_0x5aaf00++){var _0x48df75=_0x5712af[_0x5aaf00];if(_0x48df75[_0xa7d8('0x59')]===_0xa7d8('0x54')){var _0x59312d=_[_0xa7d8('0x48')](_0x3325ec,function(_0x3bfaef){return _0x3bfaef['resourceId']===_0x48df75['id'];});if(_0x59312d)_0x3cdad3[_0xa7d8('0x65')](_0x48df75);}else{_0x3cdad3['push'](_0x48df75);}}return _0x3cdad3;}});}else{return _0x5712af;}}else{var _0x44a0f8=_[_0xa7d8('0x37')](_0x5712af,function(_0x3d410b){if(_0x3d410b[_0xa7d8('0x59')]!==_0xa7d8('0x54')){return _0x3d410b;}});return _0x44a0f8;}});}else{return _0x5712af;}}})[_0xa7d8('0x26')](function(_0x5c3550){var _0xe4e482=[];if(_0x5c3550){_0xe78337=_0x5c3550;for(var _0x31e704=0x0;_0x31e704<_0x5c3550[_0xa7d8('0x30')];_0x31e704+=0x1){_0xe78337[_0x31e704][_0xa7d8('0x4d')]=[];_0xe4e482[_0xa7d8('0x65')](db['ChatInternalMessage'][_0xa7d8('0x48')]({'where':{'FromId':[_0x940046[_0xa7d8('0x56')]['id'],_0x5c3550[_0x31e704]['id']],'ToId':[_0x940046[_0xa7d8('0x56')]['id'],_0x5c3550[_0x31e704]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xa7d8('0x66'),'ToId',_0xa7d8('0x67'),_0xa7d8('0x4a')],'order':qs[_0xa7d8('0x34')](_0xa7d8('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa7d8('0x26')](wrapUser(_0x5c3550[_0x31e704])));}return BPromise[_0xa7d8('0x69')](_0xe4e482);}return[];})[_0xa7d8('0x26')](function(_0x121df8){return{'rows':_0x121df8,'count':_0x121df8['length']};})[_0xa7d8('0x26')](respondWithResult(_0x1feca2,null))['catch'](handleError(_0x1feca2,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index c372d9c..f40b812 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 _0x0e85=['setMaxListeners','save','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x383811,_0xa28af9){var _0x11566c=function(_0x3ac473){while(--_0x3ac473){_0x383811['push'](_0x383811['shift']());}};_0x11566c(++_0xa28af9);}(_0x0e85,0x7c));var _0x50e8=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x0e85[_0x576170];return _0x397c70;};'use strict';var EventEmitter=require(_0x50e8('0x0'));var ChatInternalMessage=require(_0x50e8('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x50e8('0x2')](0x0);var events={'afterCreate':_0x50e8('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4ce6cd){return function(_0x236cf3,_0x4e90e7,_0x3048e3){ChatInternalMessageEvents[_0x50e8('0x4')](_0x4ce6cd+':'+_0x236cf3['id'],_0x236cf3);ChatInternalMessageEvents[_0x50e8('0x4')](_0x4ce6cd,_0x236cf3);_0x3048e3(null);};}for(var e in events){if(events[_0x50e8('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x50e8('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x5697=['ChatInternalMessage','setMaxListeners','save','hook','exports','events'];(function(_0x343704,_0x7c0fef){var _0x15d4f2=function(_0x2637b0){while(--_0x2637b0){_0x343704['push'](_0x343704['shift']());}};_0x15d4f2(++_0x7c0fef);}(_0x5697,0x1b5));var _0x7569=function(_0x204047,_0x2df7af){_0x204047=_0x204047-0x0;var _0x5956d2=_0x5697[_0x204047];return _0x5956d2;};'use strict';var EventEmitter=require(_0x7569('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x7569('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x7569('0x2')](0x0);var events={'afterCreate':_0x7569('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4eff57){return function(_0x499e06,_0x48340f,_0x32db80){ChatInternalMessageEvents['emit'](_0x4eff57+':'+_0x499e06['id'],_0x499e06);ChatInternalMessageEvents['emit'](_0x4eff57,_0x499e06);_0x32db80(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x7569('0x4')](e,emitEvent(event));}}module[_0x7569('0x5')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index f35db05..d285985 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 _0x0713=['../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x558e45,_0x4f5e4f){var _0x3e9075=function(_0x289725){while(--_0x289725){_0x558e45['push'](_0x558e45['shift']());}};_0x3e9075(++_0x4f5e4f);}(_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':!![],'charset':_0x3071('0xc'),'collate':_0x3071('0xd')});}; \ No newline at end of file +var _0xcb91=['path','rimraf','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','../../config/logger','api','moment','bluebird'];(function(_0x3bb24f,_0x35b701){var _0x466850=function(_0x53eebe){while(--_0x53eebe){_0x3bb24f['push'](_0x3bb24f['shift']());}};_0x466850(++_0x35b701);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x210603,_0x4adbac){_0x210603=_0x210603-0x0;var _0x1bcb7d=_0xcb91[_0x210603];return _0x1bcb7d;};'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 ed6d9ae..f777ee6 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 _0xebf6=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0xebf6,0xa4));var _0x6ebf=function(_0x544f1c,_0x2eec37){_0x544f1c=_0x544f1c-0x0;var _0x4781e1=_0xebf6[_0x544f1c];return _0x4781e1;};'use strict';var _=require(_0x6ebf('0x0'));var util=require(_0x6ebf('0x1'));var moment=require('moment');var BPromise=require(_0x6ebf('0x2'));var rs=require(_0x6ebf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ebf('0x4'))['db'];var utils=require(_0x6ebf('0x5'));var logger=require(_0x6ebf('0x6'))(_0x6ebf('0x7'));var config=require(_0x6ebf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6ebf('0x9')][_0x6ebf('0xa')]({'port':0x232a});config[_0x6ebf('0xb')]=_[_0x6ebf('0xc')](config[_0x6ebf('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6ebf('0xd'))(new Redis(config[_0x6ebf('0xb')]));require(_0x6ebf('0xe'))[_0x6ebf('0xf')](socket);function respondWithRpcPromise(_0x4a0304,_0x4ecfe9,_0x5b5ac4){return new BPromise(function(_0x5e4d48,_0x5365a0){return client[_0x6ebf('0x10')](_0x4a0304,_0x5b5ac4)[_0x6ebf('0x11')](function(_0x3e0474){logger[_0x6ebf('0x12')](_0x6ebf('0x13'),_0x4ecfe9,_0x6ebf('0x14'));logger[_0x6ebf('0x15')](_0x6ebf('0x16'),_0x4ecfe9,_0x6ebf('0x14'),JSON[_0x6ebf('0x17')](_0x3e0474));if(_0x3e0474[_0x6ebf('0x18')]){if(_0x3e0474[_0x6ebf('0x18')]['code']===0x1f4){logger[_0x6ebf('0x18')](_0x6ebf('0x13'),_0x4ecfe9,_0x3e0474[_0x6ebf('0x18')][_0x6ebf('0x19')]);return _0x5365a0(_0x3e0474['error'][_0x6ebf('0x19')]);}logger[_0x6ebf('0x18')](_0x6ebf('0x13'),_0x4ecfe9,_0x3e0474['error'][_0x6ebf('0x19')]);return _0x5e4d48(_0x3e0474['error'][_0x6ebf('0x19')]);}else{logger[_0x6ebf('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x4ecfe9,_0x6ebf('0x14'));_0x5e4d48(_0x3e0474[_0x6ebf('0x1a')][_0x6ebf('0x19')]);}})[_0x6ebf('0x1b')](function(_0xb88c87){logger[_0x6ebf('0x18')](_0x6ebf('0x13'),_0x4ecfe9,_0xb88c87);_0x5365a0(_0xb88c87);});});} \ No newline at end of file +var _0x7aed=['defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x429d68,_0x1aa5a2){var _0x172ef0=function(_0x3b7d7d){while(--_0x3b7d7d){_0x429d68['push'](_0x429d68['shift']());}};_0x172ef0(++_0x1aa5a2);}(_0x7aed,0x6c));var _0xd7ae=function(_0x234a63,_0x4732e3){_0x234a63=_0x234a63-0x0;var _0x232e98=_0x7aed[_0x234a63];return _0x232e98;};'use strict';var _=require(_0xd7ae('0x0'));var util=require(_0xd7ae('0x1'));var moment=require(_0xd7ae('0x2'));var BPromise=require(_0xd7ae('0x3'));var rs=require(_0xd7ae('0x4'));var fs=require('fs');var Redis=require(_0xd7ae('0x5'));var db=require(_0xd7ae('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd7ae('0x7'))('rpc');var config=require(_0xd7ae('0x8'));var jayson=require(_0xd7ae('0x9'));var client=jayson[_0xd7ae('0xa')][_0xd7ae('0xb')]({'port':0x232a});config['redis']=_[_0xd7ae('0xc')](config[_0xd7ae('0xd')],{'host':_0xd7ae('0xe'),'port':0x18eb});var socket=require(_0xd7ae('0xf'))(new Redis(config[_0xd7ae('0xd')]));require(_0xd7ae('0x10'))[_0xd7ae('0x11')](socket);function respondWithRpcPromise(_0x22bf51,_0x20d8fb,_0x5656e2){return new BPromise(function(_0x1b8590,_0x57b60a){return client[_0xd7ae('0x12')](_0x22bf51,_0x5656e2)[_0xd7ae('0x13')](function(_0x2ade8f){logger[_0xd7ae('0x14')](_0xd7ae('0x15'),_0x20d8fb,_0xd7ae('0x16'));logger[_0xd7ae('0x17')](_0xd7ae('0x18'),_0x20d8fb,_0xd7ae('0x16'),JSON['stringify'](_0x2ade8f));if(_0x2ade8f[_0xd7ae('0x19')]){if(_0x2ade8f[_0xd7ae('0x19')][_0xd7ae('0x1a')]===0x1f4){logger[_0xd7ae('0x19')](_0xd7ae('0x15'),_0x20d8fb,_0x2ade8f[_0xd7ae('0x19')][_0xd7ae('0x1b')]);return _0x57b60a(_0x2ade8f[_0xd7ae('0x19')][_0xd7ae('0x1b')]);}logger[_0xd7ae('0x19')](_0xd7ae('0x15'),_0x20d8fb,_0x2ade8f[_0xd7ae('0x19')][_0xd7ae('0x1b')]);return _0x1b8590(_0x2ade8f[_0xd7ae('0x19')]['message']);}else{logger['info'](_0xd7ae('0x15'),_0x20d8fb,'request\x20sent');_0x1b8590(_0x2ade8f[_0xd7ae('0x1c')][_0xd7ae('0x1b')]);}})[_0xd7ae('0x1d')](function(_0x240833){logger['error'](_0xd7ae('0x15'),_0x20d8fb,_0x240833);_0x57b60a(_0x240833);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 21f42f4..38801ea 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 _0x097c=['save','remove','emit','register','./chatInternalMessage.events'];(function(_0x5194e4,_0x413187){var _0x4ea01d=function(_0x313b67){while(--_0x313b67){_0x5194e4['push'](_0x5194e4['shift']());}};_0x4ea01d(++_0x413187);}(_0x097c,0x1d5));var _0xc097=function(_0x6c6456,_0xc517fd){_0x6c6456=_0x6c6456-0x0;var _0x13bb34=_0x097c[_0x6c6456];return _0x13bb34;};'use strict';var ChatInternalMessageEvents=require(_0xc097('0x0'));var events=[_0xc097('0x1'),_0xc097('0x2'),'update'];function createListener(_0x1eb862,_0x5b478f){return function(_0x23e66a){_0x5b478f[_0xc097('0x3')](_0x1eb862,_0x23e66a);};}function removeListener(_0x5aa3c1,_0x265284){return function(){ChatInternalMessageEvents['removeListener'](_0x5aa3c1,_0x265284);};}exports[_0xc097('0x4')]=function(_0x3c9603){for(var _0x31bc9a=0x0,_0x32493e=events['length'];_0x31bc9a<_0x32493e;_0x31bc9a++){var _0x3f67a4=events[_0x31bc9a];var _0x4d95d9=createListener('chatInternalMessage:'+_0x3f67a4,_0x3c9603);ChatInternalMessageEvents['on'](_0x3f67a4,_0x4d95d9);}}; \ No newline at end of file +var _0x843b=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x3c1fcf,_0x5b1ae7){var _0x554889=function(_0x11bf06){while(--_0x11bf06){_0x3c1fcf['push'](_0x3c1fcf['shift']());}};_0x554889(++_0x5b1ae7);}(_0x843b,0xc5));var _0xb843=function(_0x33ccf7,_0x5d4c0c){_0x33ccf7=_0x33ccf7-0x0;var _0x125461=_0x843b[_0x33ccf7];return _0x125461;};'use strict';var ChatInternalMessageEvents=require(_0xb843('0x0'));var events=[_0xb843('0x1'),_0xb843('0x2'),'update'];function createListener(_0x3889be,_0x370d4b){return function(_0x45210b){_0x370d4b[_0xb843('0x3')](_0x3889be,_0x45210b);};}function removeListener(_0x2954c4,_0x397cd2){return function(){ChatInternalMessageEvents[_0xb843('0x4')](_0x2954c4,_0x397cd2);};}exports[_0xb843('0x5')]=function(_0x2ad5f3){for(var _0x3987db=0x0,_0x6e3fa3=events[_0xb843('0x6')];_0x3987db<_0x6e3fa3;_0x3987db++){var _0x29aa59=events[_0x3987db];var _0x15cbdd=createListener(_0xb843('0x7')+_0x29aa59,_0x2ad5f3);ChatInternalMessageEvents['on'](_0x29aa59,_0x15cbdd);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index dbd47e7..4ea1c7d 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 _0xe706=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x47ee89,_0x5b7eb1){var _0x50111e=function(_0x4287d3){while(--_0x4287d3){_0x47ee89['push'](_0x47ee89['shift']());}};_0x50111e(++_0x5b7eb1);}(_0xe706,0xa3));var _0x6e70=function(_0x1a7697,_0x469f4e){_0x1a7697=_0x1a7697-0x0;var _0x4d2dc8=_0xe706[_0x1a7697];return _0x4d2dc8;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require(_0x6e70('0x7'));var controller=require(_0x6e70('0x8'));router[_0x6e70('0x9')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x9')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x9')](_0x6e70('0xe'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xf')]);router[_0x6e70('0x9')](_0x6e70('0x10'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x11')]);router[_0x6e70('0x12')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0x13')]);router['put']('/:id',controller[_0x6e70('0x14')]);router[_0x6e70('0x15')](_0x6e70('0x10'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x16')]);module[_0x6e70('0x17')]=router; \ No newline at end of file +var _0xd8b0=['put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','index','get','/describe','describe','isAuthenticated','getUsers','/:id','show','post'];(function(_0x357187,_0x574e82){var _0x3c78aa=function(_0x111e2b){while(--_0x111e2b){_0x357187['push'](_0x357187['shift']());}};_0x3c78aa(++_0x574e82);}(_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')]('/users',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')]('/',auth[_0x0d8b('0xb')](),controller['create']);router[_0x0d8b('0x10')]('/:id',controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);module[_0x0d8b('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 c0bda1b..3c4f544 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 _0x6e20=['sequelize','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6e20,0x173));var _0x06e2=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x6e20[_0x4e9628];return _0x27bc8c;};'use strict';var Sequelize=require(_0x06e2('0x0'));module['exports']={'body':{'type':Sequelize[_0x06e2('0x1')](_0x06e2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x06e2('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x06e2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x06e2('0x4')]('in',_0x06e2('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x06e2('0x6')]}}; \ No newline at end of file +var _0xe7ea=['exports','TEXT','medium','out','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe7ea,0x13a));var _0xae7e=function(_0x4a65be,_0x25e73b){_0x4a65be=_0x4a65be-0x0;var _0x4bfdc8=_0xe7ea[_0x4a65be];return _0x4bfdc8;};'use strict';var Sequelize=require(_0xae7e('0x0'));module[_0xae7e('0x1')]={'body':{'type':Sequelize[_0xae7e('0x2')](_0xae7e('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xae7e('0x4')),'defaultValue':_0xae7e('0x4'),'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 83a29f3..f435d98 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 _0xea28=['keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','field','merge','options','ChatMessage','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','describe','chat','read','format','UserId','CmContact','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','acceptMessage','manual','SIP/%s','channel','event','accept','EventManager','acceptmessage','parse','formData','../../config/logger','agent','null','interface','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','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','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','count','limit','apply','reject','save','destroy','end','name','send','index','rawAttributes','model'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xea28,0x13a));var _0x8ea2=function(_0xe23b93,_0x417b8d){_0xe23b93=_0xe23b93-0x0;var _0x428e33=_0xea28[_0xe23b93];return _0x428e33;};'use strict';var pdf=require(_0x8ea2('0x0'));var emlformat=require(_0x8ea2('0x1'));var rimraf=require(_0x8ea2('0x2'));var zipdir=require(_0x8ea2('0x3'));var jsonpatch=require(_0x8ea2('0x4'));var rp=require(_0x8ea2('0x5'));var moment=require(_0x8ea2('0x6'));var BPromise=require(_0x8ea2('0x7'));var Mustache=require('mustache');var util=require(_0x8ea2('0x8'));var path=require(_0x8ea2('0x9'));var sox=require(_0x8ea2('0xa'));var csv=require('to-csv');var ejs=require(_0x8ea2('0xb'));var fs=require('fs');var _=require(_0x8ea2('0xc'));var squel=require(_0x8ea2('0xd'));var crypto=require(_0x8ea2('0xe'));var jsforce=require(_0x8ea2('0xf'));var deskjs=require(_0x8ea2('0x10'));var toCsv=require(_0x8ea2('0x11'));var querystring=require(_0x8ea2('0x12'));var Papa=require(_0x8ea2('0x13'));var Redis=require(_0x8ea2('0x14'));var authService=require(_0x8ea2('0x15'));var qs=require(_0x8ea2('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8ea2('0x17'));var utils=require(_0x8ea2('0x18'));var config=require(_0x8ea2('0x19'));var db=require('../../mysqldb')['db'];config[_0x8ea2('0x1a')]=_[_0x8ea2('0x1b')](config[_0x8ea2('0x1a')],{'host':_0x8ea2('0x1c'),'port':0x18eb});var socket=require(_0x8ea2('0x1d'))(new Redis(config['redis']));require(_0x8ea2('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x8ea2('0x1f')][_0x8ea2('0x20')]({'port':0x232c});var client9002=jayson[_0x8ea2('0x1f')][_0x8ea2('0x20')]({'port':0x232a});function checkPasswordPattern(_0x393faf,_0xbb9bd1,_0x3cff96){if(_0x3cff96){var _0x11f5e8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11f5e8[_0x8ea2('0x21')](_0xbb9bd1)){return _0x393faf;}else{throw new Error(_0x8ea2('0x22'));}}else{return _0x393faf;}}function respondWithRpcPromise(_0x2dfa7c,_0x1c1715,_0x3bc774,_0xaa8abf){return new BPromise(function(_0x1b64cf,_0x174ef2){var _0x467045=_0xaa8abf||client;return _0x467045[_0x8ea2('0x23')](_0x2dfa7c,_0x3bc774)[_0x8ea2('0x24')](function(_0x233a40){logger[_0x8ea2('0x25')](_0x8ea2('0x26'),_0x1c1715,'request\x20sent');logger['debug'](_0x8ea2('0x27'),_0x1c1715,_0x8ea2('0x28'),JSON[_0x8ea2('0x29')](_0x233a40));if(_0x233a40['error']){if(_0x233a40[_0x8ea2('0x2a')][_0x8ea2('0x2b')]===0x1f4){logger['error'](_0x8ea2('0x26'),_0x1c1715,_0x233a40[_0x8ea2('0x2a')][_0x8ea2('0x2c')]);return _0x174ef2(_0x233a40[_0x8ea2('0x2a')][_0x8ea2('0x2c')]);}logger[_0x8ea2('0x2a')](_0x8ea2('0x26'),_0x1c1715,_0x233a40[_0x8ea2('0x2a')][_0x8ea2('0x2c')]);return _0x1b64cf(_0x233a40['error'][_0x8ea2('0x2c')]);}else{logger['info'](_0x8ea2('0x26'),_0x1c1715,_0x8ea2('0x28'));_0x1b64cf(_0x233a40[_0x8ea2('0x2d')]['message']);}})['catch'](function(_0x2e4da3){logger['error'](_0x8ea2('0x26'),_0x1c1715,_0x2e4da3);_0x174ef2(_0x2e4da3);});});}function respondWithStatusCode(_0x4e786d,_0x3be291){_0x3be291=_0x3be291||0xcc;return function(_0x12fa37){if(_0x12fa37){return _0x4e786d[_0x8ea2('0x2e')](_0x3be291);}return _0x4e786d[_0x8ea2('0x2f')](_0x3be291)['end']();};}function respondWithResult(_0x5ce1d4,_0xacaa6c){_0xacaa6c=_0xacaa6c||0xc8;return function(_0x4da5b3){if(_0x4da5b3){return _0x5ce1d4[_0x8ea2('0x2f')](_0xacaa6c)[_0x8ea2('0x30')](_0x4da5b3);}};}function respondWithFilteredResult(_0x24f187,_0x41f482){return function(_0x307c74){if(_0x307c74){var _0x3eb7ac=_0x307c74[_0x8ea2('0x31')],_0x32e225=_0x41f482['offset'],_0x316707=_0x41f482['offset']+_0x41f482[_0x8ea2('0x32')],_0x19e868;if(_0x316707>=_0x3eb7ac){_0x316707=_0x3eb7ac;_0x19e868=0xc8;}else{_0x19e868=0xce;}_0x24f187[_0x8ea2('0x2f')](_0x19e868);return _0x24f187['set']('Content-Range',_0x32e225+'-'+_0x316707+'/'+_0x3eb7ac)[_0x8ea2('0x30')](_0x307c74);}return null;};}function patchUpdates(_0x4e273e){return function(_0x64475b){try{jsonpatch[_0x8ea2('0x33')](_0x64475b,_0x4e273e,!![]);}catch(_0x53fd06){return BPromise[_0x8ea2('0x34')](_0x53fd06);}return _0x64475b[_0x8ea2('0x35')]();};}function saveUpdates(_0x33abc8,_0x4cfdc6){return function(_0x4ef8ea){if(_0x4ef8ea){return _0x4ef8ea['update'](_0x33abc8)[_0x8ea2('0x24')](function(_0x233e12){return _0x233e12;});}return null;};}function removeEntity(_0x3fc785,_0x5ef924){return function(_0x456487){if(_0x456487){return _0x456487[_0x8ea2('0x36')]()[_0x8ea2('0x24')](function(){_0x3fc785[_0x8ea2('0x2f')](0xcc)[_0x8ea2('0x37')]();});}};}function handleEntityNotFound(_0x3a081b,_0x35e17a){return function(_0x1fc76a){if(!_0x1fc76a){_0x3a081b['sendStatus'](0x194);}return _0x1fc76a;};}function handleError(_0x955ef3,_0x29e3f5){_0x29e3f5=_0x29e3f5||0x1f4;return function(_0x28798c){logger[_0x8ea2('0x2a')](_0x28798c['stack']);if(_0x28798c[_0x8ea2('0x38')]){delete _0x28798c['name'];}_0x955ef3[_0x8ea2('0x2f')](_0x29e3f5)[_0x8ea2('0x39')](_0x28798c);};}exports[_0x8ea2('0x3a')]=function(_0x1496ae,_0x4f3e7e){var _0x2bed24={},_0x531979={},_0x5adb84={'count':0x0,'rows':[]};var _0x35f21b=db['ChatMessage'][_0x8ea2('0x3b')];_0x531979[_0x8ea2('0x3c')]=_[_0x8ea2('0x3d')](_0x35f21b);_0x531979[_0x8ea2('0x3e')]=_[_0x8ea2('0x3d')](_0x1496ae['query']);_0x531979[_0x8ea2('0x3f')]=_['intersection'](_0x531979[_0x8ea2('0x3c')],_0x531979[_0x8ea2('0x3e')]);_0x2bed24[_0x8ea2('0x40')]=_[_0x8ea2('0x41')](_0x531979['model'],qs[_0x8ea2('0x42')](_0x1496ae['query'][_0x8ea2('0x42')]));_0x2bed24['attributes']=_0x2bed24[_0x8ea2('0x40')][_0x8ea2('0x43')]?_0x2bed24[_0x8ea2('0x40')]:_0x531979[_0x8ea2('0x3c')];if(!_0x1496ae[_0x8ea2('0x3e')][_0x8ea2('0x44')](_0x8ea2('0x45'))){_0x2bed24['limit']=qs['limit'](_0x1496ae[_0x8ea2('0x3e')]['limit']);_0x2bed24['offset']=qs['offset'](_0x1496ae[_0x8ea2('0x3e')]['offset']);}_0x2bed24[_0x8ea2('0x46')]=qs[_0x8ea2('0x47')](_0x1496ae[_0x8ea2('0x3e')][_0x8ea2('0x47')]);_0x2bed24[_0x8ea2('0x48')]=qs[_0x8ea2('0x3f')](_[_0x8ea2('0x49')](_0x1496ae[_0x8ea2('0x3e')],_0x531979['filters']));if(_0x1496ae[_0x8ea2('0x3e')][_0x8ea2('0x4a')]){_0x2bed24[_0x8ea2('0x48')]=_['merge'](_0x2bed24[_0x8ea2('0x48')],{'$or':_[_0x8ea2('0x4b')](_0x35f21b,function(_0x8005f9){if(_0x8005f9[_0x8ea2('0x4c')][_0x8ea2('0x4d')]!=='VIRTUAL'){var _0x3e6541={};_0x3e6541[_0x8005f9[_0x8ea2('0x4e')]]={'$like':'%'+_0x1496ae[_0x8ea2('0x3e')]['filter']+'%'};return _0x3e6541;}})});}_0x2bed24=_[_0x8ea2('0x4f')]({},_0x2bed24,_0x1496ae[_0x8ea2('0x50')]);var _0x402fc1={'where':_0x2bed24[_0x8ea2('0x48')]};return db[_0x8ea2('0x51')][_0x8ea2('0x31')](_0x402fc1)[_0x8ea2('0x24')](function(_0x26e2d5){_0x5adb84[_0x8ea2('0x31')]=_0x26e2d5;if(_0x1496ae[_0x8ea2('0x3e')][_0x8ea2('0x52')]){_0x2bed24[_0x8ea2('0x53')]=[{'all':!![]}];}return db[_0x8ea2('0x51')][_0x8ea2('0x54')](_0x2bed24);})['then'](function(_0x2016a1){_0x5adb84[_0x8ea2('0x55')]=_0x2016a1;return _0x5adb84;})[_0x8ea2('0x24')](respondWithFilteredResult(_0x4f3e7e,_0x2bed24))[_0x8ea2('0x56')](handleError(_0x4f3e7e,null));};exports[_0x8ea2('0x57')]=function(_0x1daa25,_0x11b3ef){var _0x215fa5={'raw':!![],'where':{'id':_0x1daa25[_0x8ea2('0x58')]['id']}},_0x52df67={};_0x52df67[_0x8ea2('0x3c')]=_[_0x8ea2('0x3d')](db['ChatMessage']['rawAttributes']);_0x52df67[_0x8ea2('0x3e')]=_[_0x8ea2('0x3d')](_0x1daa25[_0x8ea2('0x3e')]);_0x52df67['filters']=_[_0x8ea2('0x41')](_0x52df67[_0x8ea2('0x3c')],_0x52df67[_0x8ea2('0x3e')]);_0x215fa5[_0x8ea2('0x40')]=_[_0x8ea2('0x41')](_0x52df67['model'],qs['fields'](_0x1daa25[_0x8ea2('0x3e')][_0x8ea2('0x42')]));_0x215fa5[_0x8ea2('0x40')]=_0x215fa5['attributes'][_0x8ea2('0x43')]?_0x215fa5[_0x8ea2('0x40')]:_0x52df67[_0x8ea2('0x3c')];if(_0x1daa25['query']['includeAll']){_0x215fa5['include']=[{'all':!![]}];}_0x215fa5=_['merge']({},_0x215fa5,_0x1daa25['options']);return db[_0x8ea2('0x51')][_0x8ea2('0x59')](_0x215fa5)['then'](handleEntityNotFound(_0x11b3ef,null))['then'](respondWithResult(_0x11b3ef,null))[_0x8ea2('0x56')](handleError(_0x11b3ef,null));};exports[_0x8ea2('0x5a')]=function(_0x43c794,_0x5eea45){return db[_0x8ea2('0x51')][_0x8ea2('0x5a')](_0x43c794['body'],{})[_0x8ea2('0x24')](respondWithResult(_0x5eea45,0xc9))[_0x8ea2('0x56')](handleError(_0x5eea45,null));};exports[_0x8ea2('0x5b')]=function(_0xee93b1,_0x4728b4){if(_0xee93b1['body']['id']){delete _0xee93b1['body']['id'];}return db['ChatMessage'][_0x8ea2('0x59')]({'where':{'id':_0xee93b1[_0x8ea2('0x58')]['id']}})[_0x8ea2('0x24')](handleEntityNotFound(_0x4728b4,null))[_0x8ea2('0x24')](saveUpdates(_0xee93b1[_0x8ea2('0x5c')],null))[_0x8ea2('0x24')](respondWithResult(_0x4728b4,null))[_0x8ea2('0x56')](handleError(_0x4728b4,null));};exports['destroy']=function(_0x480ed2,_0x58f9b9){return db[_0x8ea2('0x51')][_0x8ea2('0x59')]({'where':{'id':_0x480ed2[_0x8ea2('0x58')]['id']}})[_0x8ea2('0x24')](handleEntityNotFound(_0x58f9b9,null))['then'](removeEntity(_0x58f9b9,null))[_0x8ea2('0x56')](handleError(_0x58f9b9,null));};exports[_0x8ea2('0x5d')]=function(_0x4ec833,_0x21485a){return db[_0x8ea2('0x51')][_0x8ea2('0x5d')]()[_0x8ea2('0x24')](respondWithResult(_0x21485a,null))[_0x8ea2('0x56')](handleError(_0x21485a,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['accept']=function(_0x53a62c,_0x1e2066,_0x2fd365){var _0x2d8221={'channel':_0x8ea2('0x5e')};if(_0x53a62c['body']['id']){delete _0x53a62c[_0x8ea2('0x5c')]['id'];}_0x53a62c[_0x8ea2('0x5c')][_0x8ea2('0x5f')]=!![];_0x53a62c[_0x8ea2('0x5c')]['readAt']=moment()[_0x8ea2('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x53a62c[_0x8ea2('0x5c')]['UserId']=_0x53a62c[_0x8ea2('0x5c')][_0x8ea2('0x61')]||_0x53a62c['user']['id'];return db['ChatMessage'][_0x8ea2('0x59')]({'where':{'id':_0x53a62c['params']['id'],'UserId':null},'include':[{'model':db[_0x8ea2('0x62')],'as':_0x8ea2('0x63')}]})[_0x8ea2('0x24')](handleEntityNotFound(_0x1e2066,null))[_0x8ea2('0x24')](saveUpdates(_0x53a62c['body'],null))[_0x8ea2('0x24')](function(_0x2eae97){if(_0x2eae97){_0x2d8221[_0x8ea2('0x2c')]=_0x2eae97[_0x8ea2('0x64')]({'plain':!![]});return db[_0x8ea2('0x65')][_0x8ea2('0x59')]({'where':{'id':_0x2eae97[_0x8ea2('0x66')]}});}return null;})[_0x8ea2('0x24')](handleEntityNotFound(_0x1e2066,null))[_0x8ea2('0x24')](function(_0x461aa4){if(_0x461aa4){return _0x461aa4[_0x8ea2('0x5b')]({'UserId':_0x53a62c[_0x8ea2('0x5c')]['UserId'],'read1stAt':_[_0x8ea2('0x67')](_0x461aa4[_0x8ea2('0x68')])?moment()[_0x8ea2('0x60')](_0x8ea2('0x69')):undefined});}return null;})[_0x8ea2('0x24')](function(_0x219f78){if(_0x219f78){_0x2d8221[_0x8ea2('0x6a')]=_0x219f78[_0x8ea2('0x64')]({'plain':!![]});interaction_log[_0x8ea2('0x25')](_0x8ea2('0x6b'),_0x53a62c[_0x8ea2('0x6c')]['id'],_0x53a62c[_0x8ea2('0x6c')]['name'],_0x53a62c[_0x8ea2('0x6c')][_0x8ea2('0x6d')],_0x2d8221[_0x8ea2('0x6a')]['id'],_0x53a62c[_0x8ea2('0x5c')]?JSON[_0x8ea2('0x29')](_0x53a62c['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x8ea2('0x6e'),_0x2d8221);}return null;})[_0x8ea2('0x24')](function(_0x380066){if(_0x380066){if(_0x53a62c[_0x8ea2('0x5c')][_0x8ea2('0x6f')]){_0x2d8221[_0x8ea2('0x2c')]['interface']=util[_0x8ea2('0x60')](_0x8ea2('0x70'),_0x53a62c['user']['name']);_0x2d8221[_0x8ea2('0x2c')][_0x8ea2('0x71')]=_0x2d8221[_0x8ea2('0x71')];_0x2d8221[_0x8ea2('0x2c')][_0x8ea2('0x72')]=_0x8ea2('0x73');return respondWithRpcPromise(_0x8ea2('0x74'),'EventManager',{'event':_0x8ea2('0x75'),'message':_[_0x8ea2('0x4f')](_0x2d8221[_0x8ea2('0x2c')],JSON[_0x8ea2('0x76')](_0x2d8221['interaction'][_0x8ea2('0x77')]))},client9002)[_0x8ea2('0x24')](function(){return _0x2d8221;});}return _0x2d8221;}return null;})[_0x8ea2('0x24')](respondWithResult(_0x1e2066,null))['catch'](handleError(_0x1e2066,null));};var interaction_log=require(_0x8ea2('0x78'))('chat-interactions');exports['reject']=function(_0x188809,_0x452c82,_0x54db43){var _0x5a6543={'agent':{},'channel':'chat'};if(_0x188809[_0x8ea2('0x5c')]['id']){delete _0x188809['body']['id'];}_0x188809['body'][_0x8ea2('0x61')]=_0x188809[_0x8ea2('0x5c')][_0x8ea2('0x61')]||_0x188809[_0x8ea2('0x6c')]['id'];_0x5a6543[_0x8ea2('0x79')]['id']=_0x188809[_0x8ea2('0x5c')][_0x8ea2('0x61')];return db[_0x8ea2('0x51')][_0x8ea2('0x59')]({'where':{'id':_0x188809[_0x8ea2('0x58')]['id'],'UserId':null}})[_0x8ea2('0x24')](handleEntityNotFound(_0x452c82,null))[_0x8ea2('0x24')](function(_0x1961a9){if(_0x1961a9){_0x5a6543[_0x8ea2('0x2c')]=_0x1961a9['get']({'plain':!![]});return db[_0x8ea2('0x65')][_0x8ea2('0x59')]({'where':{'id':_0x1961a9[_0x8ea2('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x452c82,null))[_0x8ea2('0x24')](function(_0x486ae8){if(_0x486ae8){_0x5a6543[_0x8ea2('0x6a')]=_0x486ae8['get']({'plain':!![]});interaction_log[_0x8ea2('0x25')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x188809[_0x8ea2('0x6c')]['id'],_0x188809[_0x8ea2('0x6c')]['name'],_0x188809[_0x8ea2('0x6c')]['role'],_0x5a6543[_0x8ea2('0x6a')]['id'],_0x188809[_0x8ea2('0x5c')]?JSON[_0x8ea2('0x29')](_0x188809[_0x8ea2('0x5c')]):_0x8ea2('0x7a'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x5a6543);}return null;})[_0x8ea2('0x24')](function(_0x4b7e5e){if(_0x4b7e5e){_0x4b7e5e[_0x8ea2('0x2c')][_0x8ea2('0x7b')]=util[_0x8ea2('0x60')](_0x8ea2('0x70'),_0x188809[_0x8ea2('0x6c')][_0x8ea2('0x38')]);_0x4b7e5e['message']['channel']=_0x5a6543['channel'];_0x4b7e5e[_0x8ea2('0x2c')]['event']=_0x8ea2('0x34');respondWithRpcPromise(_0x8ea2('0x74'),_0x8ea2('0x74'),{'event':_0x8ea2('0x7c'),'message':_0x4b7e5e[_0x8ea2('0x2c')]},client9002);return _0x5a6543;}return null;})[_0x8ea2('0x24')](respondWithResult(_0x452c82,null))['catch'](handleError(_0x452c82,null));}; \ No newline at end of file +var _0xd7d1=['stringify','error','message','catch','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','ChatMessage','params','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','UserId','CmContact','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','manual','interface','SIP/%s','channel','EventManager','parse','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','./chatMessage.socket','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x56b17e,_0x41a420){var _0x346bcc=function(_0x6cbc67){while(--_0x6cbc67){_0x56b17e['push'](_0x56b17e['shift']());}};_0x346bcc(++_0x41a420);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x542e74,_0x222f2d){_0x542e74=_0x542e74-0x0;var _0x5a891a=_0xd7d1[_0x542e74];return _0x5a891a;};'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 hardwareService=require('../../config/license/hardware');var logger=require(_0x1d7d('0x17'))('api');var utils=require(_0x1d7d('0x18'));var config=require(_0x1d7d('0x19'));var db=require(_0x1d7d('0x1a'))['db'];config[_0x1d7d('0x1b')]=_['defaults'](config[_0x1d7d('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1d7d('0x1b')]));require(_0x1d7d('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x1d7d('0x1d')][_0x1d7d('0x1e')]({'port':0x232c});var client9002=jayson[_0x1d7d('0x1d')][_0x1d7d('0x1e')]({'port':0x232a});function checkPasswordPattern(_0xeb05b3,_0x53423f,_0x28adf3){if(_0x28adf3){var _0x1de6cc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1de6cc['test'](_0x53423f)){return _0xeb05b3;}else{throw new Error(_0x1d7d('0x1f'));}}else{return _0xeb05b3;}}function respondWithRpcPromise(_0x162c3a,_0x3c3417,_0x47826a,_0x40db4d){return new BPromise(function(_0x4db4f2,_0x664e3f){var _0x191024=_0x40db4d||client;return _0x191024['request'](_0x162c3a,_0x47826a)['then'](function(_0x2406dd){logger[_0x1d7d('0x20')](_0x1d7d('0x21'),_0x3c3417,_0x1d7d('0x22'));logger[_0x1d7d('0x23')](_0x1d7d('0x24'),_0x3c3417,'request\x20sent',JSON[_0x1d7d('0x25')](_0x2406dd));if(_0x2406dd[_0x1d7d('0x26')]){if(_0x2406dd[_0x1d7d('0x26')]['code']===0x1f4){logger[_0x1d7d('0x26')](_0x1d7d('0x21'),_0x3c3417,_0x2406dd['error']['message']);return _0x664e3f(_0x2406dd[_0x1d7d('0x26')][_0x1d7d('0x27')]);}logger[_0x1d7d('0x26')]('ChatMessage,\x20%s,\x20%s',_0x3c3417,_0x2406dd[_0x1d7d('0x26')][_0x1d7d('0x27')]);return _0x4db4f2(_0x2406dd[_0x1d7d('0x26')][_0x1d7d('0x27')]);}else{logger['info'](_0x1d7d('0x21'),_0x3c3417,_0x1d7d('0x22'));_0x4db4f2(_0x2406dd['result']['message']);}})[_0x1d7d('0x28')](function(_0x52c618){logger[_0x1d7d('0x26')](_0x1d7d('0x21'),_0x3c3417,_0x52c618);_0x664e3f(_0x52c618);});});}function respondWithStatusCode(_0x3bc6e8,_0x22c40d){_0x22c40d=_0x22c40d||0xcc;return function(_0x465938){if(_0x465938){return _0x3bc6e8['sendStatus'](_0x22c40d);}return _0x3bc6e8[_0x1d7d('0x29')](_0x22c40d)[_0x1d7d('0x2a')]();};}function respondWithResult(_0x352d5a,_0x58672c){_0x58672c=_0x58672c||0xc8;return function(_0x78adbe){if(_0x78adbe){return _0x352d5a[_0x1d7d('0x29')](_0x58672c)[_0x1d7d('0x2b')](_0x78adbe);}};}function respondWithFilteredResult(_0x482367,_0x5aeb1f){return function(_0x53e25c){if(_0x53e25c){var _0x189a6a=_0x53e25c[_0x1d7d('0x2c')],_0x329f56=_0x5aeb1f[_0x1d7d('0x2d')],_0x559f19=_0x5aeb1f[_0x1d7d('0x2d')]+_0x5aeb1f[_0x1d7d('0x2e')],_0x1ebcbc;if(_0x559f19>=_0x189a6a){_0x559f19=_0x189a6a;_0x1ebcbc=0xc8;}else{_0x1ebcbc=0xce;}_0x482367[_0x1d7d('0x29')](_0x1ebcbc);return _0x482367[_0x1d7d('0x2f')](_0x1d7d('0x30'),_0x329f56+'-'+_0x559f19+'/'+_0x189a6a)[_0x1d7d('0x2b')](_0x53e25c);}return null;};}function patchUpdates(_0x456b56){return function(_0x5b2209){try{jsonpatch['apply'](_0x5b2209,_0x456b56,!![]);}catch(_0x2e4402){return BPromise[_0x1d7d('0x31')](_0x2e4402);}return _0x5b2209[_0x1d7d('0x32')]();};}function saveUpdates(_0x40318f,_0x1d5dc5){return function(_0x16d652){if(_0x16d652){return _0x16d652[_0x1d7d('0x33')](_0x40318f)[_0x1d7d('0x34')](function(_0x2fa3f4){return _0x2fa3f4;});}return null;};}function removeEntity(_0x47b6b2,_0x2ac533){return function(_0xf9d3e4){if(_0xf9d3e4){return _0xf9d3e4[_0x1d7d('0x35')]()[_0x1d7d('0x34')](function(){_0x47b6b2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x472fd9,_0x198a06){return function(_0x520b56){if(!_0x520b56){_0x472fd9[_0x1d7d('0x36')](0x194);}return _0x520b56;};}function handleError(_0x3fea2e,_0x568092){_0x568092=_0x568092||0x1f4;return function(_0x4cd758){logger[_0x1d7d('0x26')](_0x4cd758[_0x1d7d('0x37')]);if(_0x4cd758[_0x1d7d('0x38')]){delete _0x4cd758[_0x1d7d('0x38')];}_0x3fea2e[_0x1d7d('0x29')](_0x568092)[_0x1d7d('0x39')](_0x4cd758);};}exports[_0x1d7d('0x3a')]=function(_0x37d003,_0x405125){var _0x318b9a={},_0x4fcdcc={},_0x5ed8a6={'count':0x0,'rows':[]};var _0x57db7a=db['ChatMessage'][_0x1d7d('0x3b')];_0x4fcdcc['model']=_[_0x1d7d('0x3c')](_0x57db7a);_0x4fcdcc[_0x1d7d('0x3d')]=_[_0x1d7d('0x3c')](_0x37d003['query']);_0x4fcdcc[_0x1d7d('0x3e')]=_[_0x1d7d('0x3f')](_0x4fcdcc[_0x1d7d('0x40')],_0x4fcdcc['query']);_0x318b9a[_0x1d7d('0x41')]=_[_0x1d7d('0x3f')](_0x4fcdcc[_0x1d7d('0x40')],qs[_0x1d7d('0x42')](_0x37d003['query'][_0x1d7d('0x42')]));_0x318b9a[_0x1d7d('0x41')]=_0x318b9a[_0x1d7d('0x41')][_0x1d7d('0x43')]?_0x318b9a['attributes']:_0x4fcdcc[_0x1d7d('0x40')];if(!_0x37d003['query'][_0x1d7d('0x44')](_0x1d7d('0x45'))){_0x318b9a[_0x1d7d('0x2e')]=qs[_0x1d7d('0x2e')](_0x37d003[_0x1d7d('0x3d')]['limit']);_0x318b9a['offset']=qs[_0x1d7d('0x2d')](_0x37d003[_0x1d7d('0x3d')][_0x1d7d('0x2d')]);}_0x318b9a['order']=qs['sort'](_0x37d003[_0x1d7d('0x3d')]['sort']);_0x318b9a[_0x1d7d('0x46')]=qs[_0x1d7d('0x3e')](_[_0x1d7d('0x47')](_0x37d003[_0x1d7d('0x3d')],_0x4fcdcc[_0x1d7d('0x3e')]));if(_0x37d003[_0x1d7d('0x3d')][_0x1d7d('0x48')]){_0x318b9a['where']=_[_0x1d7d('0x49')](_0x318b9a[_0x1d7d('0x46')],{'$or':_['map'](_0x57db7a,function(_0x17c68b){if(_0x17c68b[_0x1d7d('0x4a')][_0x1d7d('0x4b')]!==_0x1d7d('0x4c')){var _0x11bbe3={};_0x11bbe3[_0x17c68b[_0x1d7d('0x4d')]]={'$like':'%'+_0x37d003[_0x1d7d('0x3d')][_0x1d7d('0x48')]+'%'};return _0x11bbe3;}})});}_0x318b9a=_[_0x1d7d('0x49')]({},_0x318b9a,_0x37d003[_0x1d7d('0x4e')]);var _0x2b291d={'where':_0x318b9a[_0x1d7d('0x46')]};return db['ChatMessage'][_0x1d7d('0x2c')](_0x2b291d)['then'](function(_0xbfe60){_0x5ed8a6['count']=_0xbfe60;if(_0x37d003[_0x1d7d('0x3d')][_0x1d7d('0x4f')]){_0x318b9a[_0x1d7d('0x50')]=[{'all':!![]}];}return db[_0x1d7d('0x51')]['findAll'](_0x318b9a);})[_0x1d7d('0x34')](function(_0x5535d4){_0x5ed8a6['rows']=_0x5535d4;return _0x5ed8a6;})[_0x1d7d('0x34')](respondWithFilteredResult(_0x405125,_0x318b9a))['catch'](handleError(_0x405125,null));};exports['show']=function(_0x3727be,_0xf9b677){var _0x506564={'raw':!![],'where':{'id':_0x3727be[_0x1d7d('0x52')]['id']}},_0x101abf={};_0x101abf['model']=_[_0x1d7d('0x3c')](db[_0x1d7d('0x51')][_0x1d7d('0x3b')]);_0x101abf[_0x1d7d('0x3d')]=_['keys'](_0x3727be['query']);_0x101abf[_0x1d7d('0x3e')]=_[_0x1d7d('0x3f')](_0x101abf[_0x1d7d('0x40')],_0x101abf[_0x1d7d('0x3d')]);_0x506564[_0x1d7d('0x41')]=_['intersection'](_0x101abf[_0x1d7d('0x40')],qs[_0x1d7d('0x42')](_0x3727be[_0x1d7d('0x3d')][_0x1d7d('0x42')]));_0x506564[_0x1d7d('0x41')]=_0x506564[_0x1d7d('0x41')][_0x1d7d('0x43')]?_0x506564[_0x1d7d('0x41')]:_0x101abf[_0x1d7d('0x40')];if(_0x3727be['query'][_0x1d7d('0x4f')]){_0x506564[_0x1d7d('0x50')]=[{'all':!![]}];}_0x506564=_[_0x1d7d('0x49')]({},_0x506564,_0x3727be['options']);return db['ChatMessage'][_0x1d7d('0x53')](_0x506564)[_0x1d7d('0x34')](handleEntityNotFound(_0xf9b677,null))[_0x1d7d('0x34')](respondWithResult(_0xf9b677,null))['catch'](handleError(_0xf9b677,null));};exports[_0x1d7d('0x54')]=function(_0xfbb4d4,_0x5eff64){return db[_0x1d7d('0x51')][_0x1d7d('0x54')](_0xfbb4d4[_0x1d7d('0x55')],{})[_0x1d7d('0x34')](respondWithResult(_0x5eff64,0xc9))['catch'](handleError(_0x5eff64,null));};exports[_0x1d7d('0x33')]=function(_0x202af4,_0x4ba6ec){if(_0x202af4['body']['id']){delete _0x202af4[_0x1d7d('0x55')]['id'];}return db[_0x1d7d('0x51')]['find']({'where':{'id':_0x202af4['params']['id']}})[_0x1d7d('0x34')](handleEntityNotFound(_0x4ba6ec,null))[_0x1d7d('0x34')](saveUpdates(_0x202af4[_0x1d7d('0x55')],null))[_0x1d7d('0x34')](respondWithResult(_0x4ba6ec,null))['catch'](handleError(_0x4ba6ec,null));};exports[_0x1d7d('0x35')]=function(_0x4b7a81,_0x3954e0){return db[_0x1d7d('0x51')][_0x1d7d('0x53')]({'where':{'id':_0x4b7a81[_0x1d7d('0x52')]['id']}})['then'](handleEntityNotFound(_0x3954e0,null))[_0x1d7d('0x34')](removeEntity(_0x3954e0,null))[_0x1d7d('0x28')](handleError(_0x3954e0,null));};exports[_0x1d7d('0x56')]=function(_0x226509,_0x28ec14){return db[_0x1d7d('0x51')][_0x1d7d('0x56')]()[_0x1d7d('0x34')](respondWithResult(_0x28ec14,null))[_0x1d7d('0x28')](handleError(_0x28ec14,null));};var interaction_log=require(_0x1d7d('0x17'))(_0x1d7d('0x57'));exports[_0x1d7d('0x58')]=function(_0x301a67,_0x31810f,_0x3fb914){var _0x520d3c={'channel':_0x1d7d('0x59')};if(_0x301a67['body']['id']){delete _0x301a67[_0x1d7d('0x55')]['id'];}_0x301a67[_0x1d7d('0x55')][_0x1d7d('0x5a')]=!![];_0x301a67[_0x1d7d('0x55')][_0x1d7d('0x5b')]=moment()[_0x1d7d('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x301a67[_0x1d7d('0x55')][_0x1d7d('0x5d')]=_0x301a67['body'][_0x1d7d('0x5d')]||_0x301a67['user']['id'];return db[_0x1d7d('0x51')][_0x1d7d('0x53')]({'where':{'id':_0x301a67[_0x1d7d('0x52')]['id'],'UserId':null},'include':[{'model':db[_0x1d7d('0x5e')],'as':_0x1d7d('0x5f')}]})[_0x1d7d('0x34')](handleEntityNotFound(_0x31810f,null))['then'](saveUpdates(_0x301a67[_0x1d7d('0x55')],null))[_0x1d7d('0x34')](function(_0x4d69cc){if(_0x4d69cc){_0x520d3c[_0x1d7d('0x27')]=_0x4d69cc[_0x1d7d('0x60')]({'plain':!![]});return db[_0x1d7d('0x61')]['find']({'where':{'id':_0x4d69cc[_0x1d7d('0x62')]}});}return null;})[_0x1d7d('0x34')](handleEntityNotFound(_0x31810f,null))[_0x1d7d('0x34')](function(_0x1938fe){if(_0x1938fe){return _0x1938fe['update']({'UserId':_0x301a67[_0x1d7d('0x55')][_0x1d7d('0x5d')],'read1stAt':_[_0x1d7d('0x63')](_0x1938fe[_0x1d7d('0x64')])?moment()[_0x1d7d('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x1d7d('0x34')](function(_0x10dea3){if(_0x10dea3){_0x520d3c['interaction']=_0x10dea3[_0x1d7d('0x60')]({'plain':!![]});interaction_log[_0x1d7d('0x20')](_0x1d7d('0x65'),_0x301a67[_0x1d7d('0x66')]['id'],_0x301a67['user'][_0x1d7d('0x38')],_0x301a67['user'][_0x1d7d('0x67')],_0x520d3c[_0x1d7d('0x68')]['id'],_0x301a67[_0x1d7d('0x55')]?JSON['stringify'](_0x301a67[_0x1d7d('0x55')]):_0x1d7d('0x69'));return respondWithRpcPromise(_0x1d7d('0x6a'),'acceptMessage',_0x520d3c);}return null;})[_0x1d7d('0x34')](function(_0x47c1d5){if(_0x47c1d5){if(_0x301a67[_0x1d7d('0x55')][_0x1d7d('0x6b')]){_0x520d3c[_0x1d7d('0x27')][_0x1d7d('0x6c')]=util[_0x1d7d('0x5c')](_0x1d7d('0x6d'),_0x301a67[_0x1d7d('0x66')][_0x1d7d('0x38')]);_0x520d3c[_0x1d7d('0x27')][_0x1d7d('0x6e')]=_0x520d3c[_0x1d7d('0x6e')];_0x520d3c['message']['event']=_0x1d7d('0x58');return respondWithRpcPromise(_0x1d7d('0x6f'),_0x1d7d('0x6f'),{'event':'acceptmessage','message':_[_0x1d7d('0x49')](_0x520d3c['message'],JSON[_0x1d7d('0x70')](_0x520d3c[_0x1d7d('0x68')]['formData']))},client9002)[_0x1d7d('0x34')](function(){return _0x520d3c;});}return _0x520d3c;}return null;})[_0x1d7d('0x34')](respondWithResult(_0x31810f,null))['catch'](handleError(_0x31810f,null));};var interaction_log=require(_0x1d7d('0x17'))(_0x1d7d('0x57'));exports[_0x1d7d('0x31')]=function(_0x50a21e,_0x47dc25,_0x2f774f){var _0x87e6aa={'agent':{},'channel':'chat'};if(_0x50a21e[_0x1d7d('0x55')]['id']){delete _0x50a21e[_0x1d7d('0x55')]['id'];}_0x50a21e[_0x1d7d('0x55')][_0x1d7d('0x5d')]=_0x50a21e['body'][_0x1d7d('0x5d')]||_0x50a21e[_0x1d7d('0x66')]['id'];_0x87e6aa[_0x1d7d('0x71')]['id']=_0x50a21e[_0x1d7d('0x55')][_0x1d7d('0x5d')];return db[_0x1d7d('0x51')][_0x1d7d('0x53')]({'where':{'id':_0x50a21e[_0x1d7d('0x52')]['id'],'UserId':null}})[_0x1d7d('0x34')](handleEntityNotFound(_0x47dc25,null))[_0x1d7d('0x34')](function(_0xe904e5){if(_0xe904e5){_0x87e6aa[_0x1d7d('0x27')]=_0xe904e5[_0x1d7d('0x60')]({'plain':!![]});return db['ChatInteraction'][_0x1d7d('0x53')]({'where':{'id':_0xe904e5[_0x1d7d('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x47dc25,null))[_0x1d7d('0x34')](function(_0x2e4373){if(_0x2e4373){_0x87e6aa['interaction']=_0x2e4373['get']({'plain':!![]});interaction_log['info'](_0x1d7d('0x72'),_0x50a21e[_0x1d7d('0x66')]['id'],_0x50a21e[_0x1d7d('0x66')][_0x1d7d('0x38')],_0x50a21e['user'][_0x1d7d('0x67')],_0x87e6aa[_0x1d7d('0x68')]['id'],_0x50a21e[_0x1d7d('0x55')]?JSON[_0x1d7d('0x25')](_0x50a21e['body']):_0x1d7d('0x69'));return respondWithRpcPromise(_0x1d7d('0x73'),_0x1d7d('0x74'),_0x87e6aa);}return null;})[_0x1d7d('0x34')](function(_0x27a98b){if(_0x27a98b){_0x27a98b[_0x1d7d('0x27')]['interface']=util[_0x1d7d('0x5c')](_0x1d7d('0x6d'),_0x50a21e['user'][_0x1d7d('0x38')]);_0x27a98b[_0x1d7d('0x27')][_0x1d7d('0x6e')]=_0x87e6aa['channel'];_0x27a98b[_0x1d7d('0x27')]['event']=_0x1d7d('0x31');respondWithRpcPromise(_0x1d7d('0x6f'),'EventManager',{'event':_0x1d7d('0x75'),'message':_0x27a98b[_0x1d7d('0x27')]},client9002);return _0x87e6aa;}return null;})[_0x1d7d('0x34')](respondWithResult(_0x47dc25,null))[_0x1d7d('0x28')](handleError(_0x47dc25,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index f5142cf..7eba2d8 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 _0x7478=['exports','events','ChatMessage','save','update','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7478,0x169));var _0x8747=function(_0x4e3f08,_0x2b300d){_0x4e3f08=_0x4e3f08-0x0;var _0x20596b=_0x7478[_0x4e3f08];return _0x20596b;};'use strict';var EventEmitter=require(_0x8747('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x8747('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8747('0x2'),'afterUpdate':_0x8747('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5d7035){return function(_0x307d8f,_0x296956,_0x53b578){ChatMessageEvents[_0x8747('0x4')](_0x5d7035+':'+_0x307d8f['id'],_0x307d8f);ChatMessageEvents[_0x8747('0x4')](_0x5d7035,_0x307d8f);_0x53b578(null);};}for(var e in events){if(events[_0x8747('0x5')](e)){var event=events[e];ChatMessage[_0x8747('0x6')](e,emitEvent(event));}}module[_0x8747('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0x4085=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0xfd084b,_0x26977e){var _0x375d60=function(_0xfec175){while(--_0xfec175){_0xfd084b['push'](_0xfd084b['shift']());}};_0x375d60(++_0x26977e);}(_0x4085,0x1bf));var _0x5408=function(_0x19db98,_0x140afd){_0x19db98=_0x19db98-0x0;var _0x326afd=_0x4085[_0x19db98];return _0x326afd;};'use strict';var EventEmitter=require(_0x5408('0x0'));var ChatMessage=require(_0x5408('0x1'))['db'][_0x5408('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5408('0x3')](0x0);var events={'afterCreate':_0x5408('0x4'),'afterUpdate':'update','afterDestroy':_0x5408('0x5')};function emitEvent(_0x182c55){return function(_0x118c00,_0x3ae99e,_0x18f506){ChatMessageEvents[_0x5408('0x6')](_0x182c55+':'+_0x118c00['id'],_0x118c00);ChatMessageEvents[_0x5408('0x6')](_0x182c55,_0x118c00);_0x18f506(null);};}for(var e in events){if(events[_0x5408('0x7')](e)){var event=events[e];ChatMessage[_0x5408('0x8')](e,emitEvent(event));}}module[_0x5408('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 23136b9..1ca5471 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 _0xe1c7=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x25f164,_0x739759){var _0x234f20=function(_0x1af65e){while(--_0x1af65e){_0x25f164['push'](_0x25f164['shift']());}};_0x234f20(++_0x739759);}(_0xe1c7,0x133));var _0x7e1c=function(_0x1cd674,_0x8d3638){_0x1cd674=_0x1cd674-0x0;var _0x27928f=_0xe1c7[_0x1cd674];return _0x27928f;};'use strict';var _=require(_0x7e1c('0x0'));var util=require(_0x7e1c('0x1'));var logger=require(_0x7e1c('0x2'))(_0x7e1c('0x3'));var moment=require(_0x7e1c('0x4'));var BPromise=require(_0x7e1c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7e1c('0x6'));var rimraf=require(_0x7e1c('0x7'));var config=require(_0x7e1c('0x8'));var attributes=require('./chatMessage.attributes');module[_0x7e1c('0x9')]=function(_0x3eef5f,_0x14a851){return _0x3eef5f[_0x7e1c('0xa')](_0x7e1c('0xb'),attributes,{'tableName':_0x7e1c('0xc'),'paranoid':![],'indexes':[{'name':_0x7e1c('0xd'),'fields':[_0x7e1c('0xe')],'type':_0x7e1c('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xbe4a4e,_0x434abd,_0x3e24df){var _0x4ec49b=_0x3eef5f[_0x7e1c('0x10')];var _0x4ce4f3=_0xbe4a4e['get']({'plain':!![]});if(_0x4ce4f3[_0x7e1c('0x11')][_0x7e1c('0x12')]()==='in'||_0x4ce4f3[_0x7e1c('0x11')][_0x7e1c('0x12')]()===_0x7e1c('0x13')&&!_0x4ce4f3[_0x7e1c('0x14')]&&!_[_0x7e1c('0x15')](_0x4ce4f3[_0x7e1c('0x16')])){_0x4ec49b[_0x7e1c('0x17')]['findOne']({'where':{'id':_0x4ce4f3[_0x7e1c('0x18')]}})[_0x7e1c('0x19')](function(_0x4b5fb5){if(_0x4b5fb5){_0x4b5fb5[_0x7e1c('0x1a')]({'lastMsgAt':_0x4ce4f3[_0x7e1c('0x1b')],'lastMsgDirection':_0x4ce4f3['direction'][_0x7e1c('0x12')]()});}})[_0x7e1c('0x1c')](function(_0x52637a){console[_0x7e1c('0x1d')](_0x52637a);});}_0x3e24df();}},'charset':'utf8mb4','collate':_0x7e1c('0x1e')});}; \ No newline at end of file +var _0x79a9=['../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x79a9,0xa7));var _0x979a=function(_0x11106f,_0x3f6685){_0x11106f=_0x11106f-0x0;var _0x5f3896=_0x79a9[_0x11106f];return _0x5f3896;};'use strict';var _=require('lodash');var util=require(_0x979a('0x0'));var logger=require(_0x979a('0x1'))(_0x979a('0x2'));var moment=require(_0x979a('0x3'));var BPromise=require('bluebird');var rp=require(_0x979a('0x4'));var fs=require('fs');var path=require(_0x979a('0x5'));var rimraf=require(_0x979a('0x6'));var config=require(_0x979a('0x7'));var attributes=require(_0x979a('0x8'));module[_0x979a('0x9')]=function(_0x478312,_0x4cbfd3){return _0x478312[_0x979a('0xa')](_0x979a('0xb'),attributes,{'tableName':_0x979a('0xc'),'paranoid':![],'indexes':[{'name':_0x979a('0xd'),'fields':['body'],'type':_0x979a('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c306d,_0x37c8a4,_0x54170c){var _0x136ac0=_0x478312[_0x979a('0xf')];var _0x35138b=_0x1c306d[_0x979a('0x10')]({'plain':!![]});if(_0x35138b[_0x979a('0x11')]['toLowerCase']()==='in'||_0x35138b['direction']['toLowerCase']()===_0x979a('0x12')&&!_0x35138b[_0x979a('0x13')]&&!_[_0x979a('0x14')](_0x35138b[_0x979a('0x15')])){_0x136ac0[_0x979a('0x16')]['findOne']({'where':{'id':_0x35138b[_0x979a('0x17')]}})[_0x979a('0x18')](function(_0x42c698){if(_0x42c698){_0x42c698[_0x979a('0x19')]({'lastMsgAt':_0x35138b[_0x979a('0x1a')],'lastMsgDirection':_0x35138b['direction']['toLowerCase']()});}})['catch'](function(_0xf0b041){console['error'](_0xf0b041);});}_0x54170c();}},'charset':_0x979a('0x1b'),'collate':_0x979a('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 985c4c6..f381067 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 _0xe608=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateChatMessage','ChatMessage','create','options','raw','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1c2e00,_0x38eb90){var _0x15c27e=function(_0x4d201b){while(--_0x4d201b){_0x1c2e00['push'](_0x1c2e00['shift']());}};_0x15c27e(++_0x38eb90);}(_0xe608,0x76));var _0x8e60=function(_0x42fc8e,_0x26620d){_0x42fc8e=_0x42fc8e-0x0;var _0x4ad7b5=_0xe608[_0x42fc8e];return _0x4ad7b5;};'use strict';var _=require(_0x8e60('0x0'));var util=require(_0x8e60('0x1'));var moment=require('moment');var BPromise=require(_0x8e60('0x2'));var rs=require(_0x8e60('0x3'));var fs=require('fs');var Redis=require(_0x8e60('0x4'));var db=require(_0x8e60('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e60('0x6'))(_0x8e60('0x7'));var config=require(_0x8e60('0x8'));var jayson=require(_0x8e60('0x9'));var client=jayson[_0x8e60('0xa')]['http']({'port':0x232a});config[_0x8e60('0xb')]=_['defaults'](config[_0x8e60('0xb')],{'host':_0x8e60('0xc'),'port':0x18eb});var socket=require(_0x8e60('0xd'))(new Redis(config[_0x8e60('0xb')]));require(_0x8e60('0xe'))['register'](socket);function respondWithRpcPromise(_0x5a52e7,_0x32cf1c,_0x846402){return new BPromise(function(_0x332c0a,_0x188cab){return client[_0x8e60('0xf')](_0x5a52e7,_0x846402)[_0x8e60('0x10')](function(_0x55c102){logger[_0x8e60('0x11')](_0x8e60('0x12'),_0x32cf1c,_0x8e60('0x13'));logger['debug'](_0x8e60('0x14'),_0x32cf1c,_0x8e60('0x13'),JSON['stringify'](_0x55c102));if(_0x55c102[_0x8e60('0x15')]){if(_0x55c102[_0x8e60('0x15')][_0x8e60('0x16')]===0x1f4){logger[_0x8e60('0x15')](_0x8e60('0x12'),_0x32cf1c,_0x55c102[_0x8e60('0x15')]['message']);return _0x188cab(_0x55c102['error'][_0x8e60('0x17')]);}logger[_0x8e60('0x15')]('ChatMessage,\x20%s,\x20%s',_0x32cf1c,_0x55c102['error'][_0x8e60('0x17')]);return _0x332c0a(_0x55c102[_0x8e60('0x15')][_0x8e60('0x17')]);}else{logger['info'](_0x8e60('0x12'),_0x32cf1c,_0x8e60('0x13'));_0x332c0a(_0x55c102[_0x8e60('0x18')][_0x8e60('0x17')]);}})['catch'](function(_0x51527b){logger['error'](_0x8e60('0x12'),_0x32cf1c,_0x51527b);_0x188cab(_0x51527b);});});}exports[_0x8e60('0x19')]=function(_0x5dd8cb){var _0x181eb1=this;return new Promise(function(_0x5f3d83,_0x4d5cd7){return db[_0x8e60('0x1a')][_0x8e60('0x1b')](_0x5dd8cb['body'],{'raw':_0x5dd8cb[_0x8e60('0x1c')]?_0x5dd8cb[_0x8e60('0x1c')][_0x8e60('0x1d')]===undefined?!![]:![]:!![]})[_0x8e60('0x10')](function(_0x355c54){logger[_0x8e60('0x11')](_0x8e60('0x19'),_0x5dd8cb);logger[_0x8e60('0x1e')]('CreateChatMessage',_0x5dd8cb,JSON['stringify'](_0x355c54));_0x5f3d83(_0x355c54);})['catch'](function(_0x46f968){logger[_0x8e60('0x15')](_0x8e60('0x19'),_0x46f968[_0x8e60('0x17')],_0x5dd8cb);_0x4d5cd7(_0x181eb1[_0x8e60('0x15')](0x1f4,_0x46f968[_0x8e60('0x17')]));});});}; \ No newline at end of file +var _0xb9e4=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','register','request','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x5c4c40,_0xc05330){var _0x17e997=function(_0x165d9d){while(--_0x165d9d){_0x5c4c40['push'](_0x5c4c40['shift']());}};_0x17e997(++_0xc05330);}(_0xb9e4,0x170));var _0x4b9e=function(_0x2c4061,_0x40ea27){_0x2c4061=_0x2c4061-0x0;var _0x36987b=_0xb9e4[_0x2c4061];return _0x36987b;};'use strict';var _=require('lodash');var util=require(_0x4b9e('0x0'));var moment=require('moment');var BPromise=require(_0x4b9e('0x1'));var rs=require(_0x4b9e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b9e('0x3'))['db'];var utils=require(_0x4b9e('0x4'));var logger=require('../../config/logger')(_0x4b9e('0x5'));var config=require(_0x4b9e('0x6'));var jayson=require(_0x4b9e('0x7'));var client=jayson[_0x4b9e('0x8')][_0x4b9e('0x9')]({'port':0x232a});config[_0x4b9e('0xa')]=_[_0x4b9e('0xb')](config[_0x4b9e('0xa')],{'host':_0x4b9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4b9e('0xa')]));require(_0x4b9e('0xd'))[_0x4b9e('0xe')](socket);function respondWithRpcPromise(_0x227634,_0x29276e,_0x1b7910){return new BPromise(function(_0x57eb08,_0x31cc3f){return client[_0x4b9e('0xf')](_0x227634,_0x1b7910)['then'](function(_0x4bac6b){logger['info'](_0x4b9e('0x10'),_0x29276e,_0x4b9e('0x11'));logger[_0x4b9e('0x12')](_0x4b9e('0x13'),_0x29276e,_0x4b9e('0x11'),JSON[_0x4b9e('0x14')](_0x4bac6b));if(_0x4bac6b[_0x4b9e('0x15')]){if(_0x4bac6b[_0x4b9e('0x15')][_0x4b9e('0x16')]===0x1f4){logger[_0x4b9e('0x15')](_0x4b9e('0x10'),_0x29276e,_0x4bac6b['error'][_0x4b9e('0x17')]);return _0x31cc3f(_0x4bac6b[_0x4b9e('0x15')]['message']);}logger[_0x4b9e('0x15')]('ChatMessage,\x20%s,\x20%s',_0x29276e,_0x4bac6b[_0x4b9e('0x15')]['message']);return _0x57eb08(_0x4bac6b[_0x4b9e('0x15')]['message']);}else{logger[_0x4b9e('0x18')](_0x4b9e('0x10'),_0x29276e,_0x4b9e('0x11'));_0x57eb08(_0x4bac6b[_0x4b9e('0x19')][_0x4b9e('0x17')]);}})[_0x4b9e('0x1a')](function(_0x162180){logger[_0x4b9e('0x15')](_0x4b9e('0x10'),_0x29276e,_0x162180);_0x31cc3f(_0x162180);});});}exports[_0x4b9e('0x1b')]=function(_0xd2ba5b){var _0x54ca4f=this;return new Promise(function(_0x2cdd45,_0x45d23a){return db[_0x4b9e('0x1c')][_0x4b9e('0x1d')](_0xd2ba5b[_0x4b9e('0x1e')],{'raw':_0xd2ba5b[_0x4b9e('0x1f')]?_0xd2ba5b[_0x4b9e('0x1f')][_0x4b9e('0x20')]===undefined?!![]:![]:!![]})[_0x4b9e('0x21')](function(_0x269527){logger[_0x4b9e('0x18')](_0x4b9e('0x1b'),_0xd2ba5b);logger[_0x4b9e('0x12')]('CreateChatMessage',_0xd2ba5b,JSON[_0x4b9e('0x14')](_0x269527));_0x2cdd45(_0x269527);})[_0x4b9e('0x1a')](function(_0x3ea95c){logger[_0x4b9e('0x15')](_0x4b9e('0x1b'),_0x3ea95c[_0x4b9e('0x17')],_0xd2ba5b);_0x45d23a(_0x54ca4f[_0x4b9e('0x15')](0x1f4,_0x3ea95c[_0x4b9e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 4708376..de3a747 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 _0xd117=['save','remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0x34ccdf,_0x34c309){var _0x5333b7=function(_0x46f80a){while(--_0x46f80a){_0x34ccdf['push'](_0x34ccdf['shift']());}};_0x5333b7(++_0x34c309);}(_0xd117,0x182));var _0x7d11=function(_0x409682,_0x370090){_0x409682=_0x409682-0x0;var _0x1ee901=_0xd117[_0x409682];return _0x1ee901;};'use strict';var ChatMessageEvents=require(_0x7d11('0x0'));var events=[_0x7d11('0x1'),_0x7d11('0x2'),_0x7d11('0x3')];function createListener(_0x454387,_0x26e0f0){return function(_0x306ae4){_0x26e0f0[_0x7d11('0x4')](_0x454387,_0x306ae4);};}function removeListener(_0x3c07be,_0x31fcb0){return function(){ChatMessageEvents[_0x7d11('0x5')](_0x3c07be,_0x31fcb0);};}exports[_0x7d11('0x6')]=function(_0x27d7e8){for(var _0x40c3c4=0x0,_0x345602=events[_0x7d11('0x7')];_0x40c3c4<_0x345602;_0x40c3c4++){var _0x47b5e6=events[_0x40c3c4];var _0x3803b5=createListener(_0x7d11('0x8')+_0x47b5e6,_0x27d7e8);ChatMessageEvents['on'](_0x47b5e6,_0x3803b5);}}; \ No newline at end of file +var _0x4819=['length','chatMessage:','save','remove','update','emit','removeListener'];(function(_0x2b5456,_0x5c71f6){var _0x14a0e6=function(_0x881890){while(--_0x881890){_0x2b5456['push'](_0x2b5456['shift']());}};_0x14a0e6(++_0x5c71f6);}(_0x4819,0xcd));var _0x9481=function(_0x229066,_0x443063){_0x229066=_0x229066-0x0;var _0xd7c89=_0x4819[_0x229066];return _0xd7c89;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x9481('0x0'),_0x9481('0x1'),_0x9481('0x2')];function createListener(_0x12a70c,_0x273a32){return function(_0xfb4034){_0x273a32[_0x9481('0x3')](_0x12a70c,_0xfb4034);};}function removeListener(_0x14dc10,_0xc39edf){return function(){ChatMessageEvents[_0x9481('0x4')](_0x14dc10,_0xc39edf);};}exports['register']=function(_0x4d9e3a){for(var _0x5def07=0x0,_0x54cc78=events[_0x9481('0x5')];_0x5def07<_0x54cc78;_0x5def07++){var _0x6c6a08=events[_0x5def07];var _0x27c033=createListener(_0x9481('0x6')+_0x6c6a08,_0x4d9e3a);ChatMessageEvents['on'](_0x6c6a08,_0x27c033);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 571a0f3..7b0fcfb 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 _0x4696=['reject','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','accept','/:id/reject'];(function(_0x16f8da,_0x251b0d){var _0x35f922=function(_0x14693e){while(--_0x14693e){_0x16f8da['push'](_0x16f8da['shift']());}};_0x35f922(++_0x251b0d);}(_0x4696,0x1d6));var _0x6469=function(_0x339e9b,_0x4252fe){_0x339e9b=_0x339e9b-0x0;var _0x4f63ab=_0x4696[_0x339e9b];return _0x4f63ab;};'use strict';var multer=require(_0x6469('0x0'));var util=require(_0x6469('0x1'));var path=require(_0x6469('0x2'));var timeout=require(_0x6469('0x3'));var express=require(_0x6469('0x4'));var router=express['Router']();var auth=require(_0x6469('0x5'));var interaction=require(_0x6469('0x6'));var config=require(_0x6469('0x7'));var controller=require(_0x6469('0x8'));router['get']('/',auth[_0x6469('0x9')](),controller[_0x6469('0xa')]);router[_0x6469('0xb')]('/describe',auth[_0x6469('0x9')](),controller[_0x6469('0xc')]);router[_0x6469('0xb')](_0x6469('0xd'),auth['isAuthenticated'](),controller[_0x6469('0xe')]);router[_0x6469('0xf')]('/',auth[_0x6469('0x9')](),interaction[_0x6469('0x10')](_0x6469('0x11'),_0x6469('0x12')),controller[_0x6469('0x13')]);router[_0x6469('0x14')]('/:id',controller[_0x6469('0x15')]);router[_0x6469('0x14')]('/:id/accept',auth[_0x6469('0x9')](),controller[_0x6469('0x16')]);router[_0x6469('0x14')](_0x6469('0x17'),auth[_0x6469('0x9')](),controller[_0x6469('0x18')]);router['delete'](_0x6469('0xd'),auth[_0x6469('0x9')](),controller[_0x6469('0x19')]);module['exports']=router; \ No newline at end of file +var _0x4656=['put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','chat'];(function(_0x333c74,_0x6e9089){var _0x59b09a=function(_0x2374ab){while(--_0x2374ab){_0x333c74['push'](_0x333c74['shift']());}};_0x59b09a(++_0x6e9089);}(_0x4656,0x126));var _0x6465=function(_0x9df3d8,_0x4074e3){_0x9df3d8=_0x9df3d8-0x0;var _0x366da1=_0x4656[_0x9df3d8];return _0x366da1;};'use strict';var multer=require('multer');var util=require(_0x6465('0x0'));var path=require(_0x6465('0x1'));var timeout=require(_0x6465('0x2'));var express=require(_0x6465('0x3'));var router=express['Router']();var auth=require(_0x6465('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6465('0x5'));var controller=require('./chatMessage.controller');router[_0x6465('0x6')]('/',auth[_0x6465('0x7')](),controller[_0x6465('0x8')]);router[_0x6465('0x6')](_0x6465('0x9'),auth[_0x6465('0x7')](),controller[_0x6465('0xa')]);router['get'](_0x6465('0xb'),auth[_0x6465('0x7')](),controller[_0x6465('0xc')]);router['post']('/',auth[_0x6465('0x7')](),interaction['tracked'](_0x6465('0xd'),'chatmessage:create'),controller['create']);router[_0x6465('0xe')](_0x6465('0xb'),controller[_0x6465('0xf')]);router[_0x6465('0xe')](_0x6465('0x10'),auth[_0x6465('0x7')](),controller['accept']);router[_0x6465('0xe')](_0x6465('0x11'),auth['isAuthenticated'](),controller[_0x6465('0x12')]);router[_0x6465('0x13')](_0x6465('0xb'),auth[_0x6465('0x7')](),controller[_0x6465('0x14')]);module[_0x6465('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 9b33ed5..f63c74b 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 _0xed48=['medium','sequelize','TEXT'];(function(_0x385138,_0x31c474){var _0x428869=function(_0x4868ef){while(--_0x4868ef){_0x385138['push'](_0x385138['shift']());}};_0x428869(++_0x31c474);}(_0xed48,0x103));var _0x8ed4=function(_0x22f75e,_0x4a9e06){_0x22f75e=_0x22f75e-0x0;var _0x1f6ab3=_0xed48[_0x22f75e];return _0x1f6ab3;};'use strict';var Sequelize=require(_0x8ed4('0x0'));module['exports']={'body':{'type':Sequelize[_0x8ed4('0x1')](_0x8ed4('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x0e3f=['exports'];(function(_0x14737c,_0x3f255e){var _0x5bd703=function(_0x468383){while(--_0x468383){_0x14737c['push'](_0x14737c['shift']());}};_0x5bd703(++_0x3f255e);}(_0x0e3f,0x109));var _0xf0e3=function(_0x41d3f2,_0x42a0fd){_0x41d3f2=_0x41d3f2-0x0;var _0x45d20b=_0x0e3f[_0x41d3f2];return _0x45d20b;};'use strict';var Sequelize=require('sequelize');module[_0xf0e3('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 63732bb..a585a69 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 _0x6ec2=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','apply','update','then','destroy','error','stack','name','send','ChatOfflineMessage','rawAttributes','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','where','filter','map','type','key','VIRTUAL','field','includeAll','include','rows','catch','show','params','keys','length','merge','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x2bebd6,_0x5ac3b2){var _0x512760=function(_0x3edff3){while(--_0x3edff3){_0x2bebd6['push'](_0x2bebd6['shift']());}};_0x512760(++_0x5ac3b2);}(_0x6ec2,0x78));var _0x26ec=function(_0x4c5340,_0x1cd847){_0x4c5340=_0x4c5340-0x0;var _0x5c646a=_0x6ec2[_0x4c5340];return _0x5c646a;};'use strict';var pdf=require(_0x26ec('0x0'));var emlformat=require(_0x26ec('0x1'));var rimraf=require(_0x26ec('0x2'));var zipdir=require(_0x26ec('0x3'));var jsonpatch=require(_0x26ec('0x4'));var rp=require(_0x26ec('0x5'));var moment=require('moment');var BPromise=require(_0x26ec('0x6'));var Mustache=require(_0x26ec('0x7'));var util=require(_0x26ec('0x8'));var path=require(_0x26ec('0x9'));var sox=require(_0x26ec('0xa'));var csv=require('to-csv');var ejs=require(_0x26ec('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x26ec('0xc'));var jsforce=require(_0x26ec('0xd'));var deskjs=require(_0x26ec('0xe'));var toCsv=require('to-csv');var querystring=require(_0x26ec('0xf'));var Papa=require('papaparse');var Redis=require(_0x26ec('0x10'));var authService=require(_0x26ec('0x11'));var qs=require(_0x26ec('0x12'));var hardwareService=require(_0x26ec('0x13'));var logger=require(_0x26ec('0x14'))(_0x26ec('0x15'));var utils=require(_0x26ec('0x16'));var config=require(_0x26ec('0x17'));var db=require(_0x26ec('0x18'))['db'];function respondWithStatusCode(_0x162230,_0x47b3f9){_0x47b3f9=_0x47b3f9||0xcc;return function(_0x5212e4){if(_0x5212e4){return _0x162230[_0x26ec('0x19')](_0x47b3f9);}return _0x162230[_0x26ec('0x1a')](_0x47b3f9)[_0x26ec('0x1b')]();};}function respondWithResult(_0x25ba7c,_0x4142fe){_0x4142fe=_0x4142fe||0xc8;return function(_0xff29e5){if(_0xff29e5){return _0x25ba7c[_0x26ec('0x1a')](_0x4142fe)['json'](_0xff29e5);}};}function respondWithFilteredResult(_0xfe9aa9,_0x21a743){return function(_0x302bde){if(_0x302bde){var _0x7f9bb2=_0x302bde[_0x26ec('0x1c')],_0x4f9950=_0x21a743[_0x26ec('0x1d')],_0x4d366c=_0x21a743[_0x26ec('0x1d')]+_0x21a743['limit'],_0x438985;if(_0x4d366c>=_0x7f9bb2){_0x4d366c=_0x7f9bb2;_0x438985=0xc8;}else{_0x438985=0xce;}_0xfe9aa9[_0x26ec('0x1a')](_0x438985);return _0xfe9aa9[_0x26ec('0x1e')]('Content-Range',_0x4f9950+'-'+_0x4d366c+'/'+_0x7f9bb2)['json'](_0x302bde);}return null;};}function patchUpdates(_0x5a9b63){return function(_0x21c3ff){try{jsonpatch[_0x26ec('0x1f')](_0x21c3ff,_0x5a9b63,!![]);}catch(_0x60511e){return BPromise['reject'](_0x60511e);}return _0x21c3ff['save']();};}function saveUpdates(_0x289978,_0x125fca){return function(_0x33a28b){if(_0x33a28b){return _0x33a28b[_0x26ec('0x20')](_0x289978)[_0x26ec('0x21')](function(_0xe199f2){return _0xe199f2;});}return null;};}function removeEntity(_0x4f6d68,_0x14080d){return function(_0x29c34a){if(_0x29c34a){return _0x29c34a[_0x26ec('0x22')]()[_0x26ec('0x21')](function(){_0x4f6d68[_0x26ec('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5202e6,_0x2204ba){return function(_0x16154d){if(!_0x16154d){_0x5202e6[_0x26ec('0x19')](0x194);}return _0x16154d;};}function handleError(_0x50e4e8,_0x480e5d){_0x480e5d=_0x480e5d||0x1f4;return function(_0x19cadf){logger[_0x26ec('0x23')](_0x19cadf[_0x26ec('0x24')]);if(_0x19cadf[_0x26ec('0x25')]){delete _0x19cadf[_0x26ec('0x25')];}_0x50e4e8[_0x26ec('0x1a')](_0x480e5d)[_0x26ec('0x26')](_0x19cadf);};}exports['index']=function(_0x50fedc,_0x4f25f1){var _0x45509f={},_0xddd5fc={},_0x352bef={'count':0x0,'rows':[]};var _0x3fd842=db[_0x26ec('0x27')][_0x26ec('0x28')];_0xddd5fc[_0x26ec('0x29')]=_['keys'](_0x3fd842);_0xddd5fc[_0x26ec('0x2a')]=_['keys'](_0x50fedc[_0x26ec('0x2a')]);_0xddd5fc[_0x26ec('0x2b')]=_['intersection'](_0xddd5fc[_0x26ec('0x29')],_0xddd5fc[_0x26ec('0x2a')]);_0x45509f[_0x26ec('0x2c')]=_[_0x26ec('0x2d')](_0xddd5fc[_0x26ec('0x29')],qs[_0x26ec('0x2e')](_0x50fedc['query'][_0x26ec('0x2e')]));_0x45509f['attributes']=_0x45509f[_0x26ec('0x2c')]['length']?_0x45509f[_0x26ec('0x2c')]:_0xddd5fc[_0x26ec('0x29')];if(!_0x50fedc['query'][_0x26ec('0x2f')](_0x26ec('0x30'))){_0x45509f[_0x26ec('0x31')]=qs[_0x26ec('0x31')](_0x50fedc[_0x26ec('0x2a')][_0x26ec('0x31')]);_0x45509f['offset']=qs['offset'](_0x50fedc['query']['offset']);}_0x45509f['order']=qs[_0x26ec('0x32')](_0x50fedc[_0x26ec('0x2a')][_0x26ec('0x32')]);_0x45509f[_0x26ec('0x33')]=qs[_0x26ec('0x2b')](_['pick'](_0x50fedc[_0x26ec('0x2a')],_0xddd5fc[_0x26ec('0x2b')]));if(_0x50fedc[_0x26ec('0x2a')][_0x26ec('0x34')]){_0x45509f[_0x26ec('0x33')]=_['merge'](_0x45509f[_0x26ec('0x33')],{'$or':_[_0x26ec('0x35')](_0x3fd842,function(_0x15391c){if(_0x15391c[_0x26ec('0x36')][_0x26ec('0x37')]!==_0x26ec('0x38')){var _0x39c514={};_0x39c514[_0x15391c[_0x26ec('0x39')]]={'$like':'%'+_0x50fedc[_0x26ec('0x2a')][_0x26ec('0x34')]+'%'};return _0x39c514;}})});}_0x45509f=_['merge']({},_0x45509f,_0x50fedc['options']);var _0x4a5cd2={'where':_0x45509f[_0x26ec('0x33')]};return db['ChatOfflineMessage'][_0x26ec('0x1c')](_0x4a5cd2)['then'](function(_0x151293){_0x352bef[_0x26ec('0x1c')]=_0x151293;if(_0x50fedc[_0x26ec('0x2a')][_0x26ec('0x3a')]){_0x45509f[_0x26ec('0x3b')]=[{'all':!![]}];}return db[_0x26ec('0x27')]['findAll'](_0x45509f);})[_0x26ec('0x21')](function(_0x3441f4){_0x352bef[_0x26ec('0x3c')]=_0x3441f4;return _0x352bef;})[_0x26ec('0x21')](respondWithFilteredResult(_0x4f25f1,_0x45509f))[_0x26ec('0x3d')](handleError(_0x4f25f1,null));};exports[_0x26ec('0x3e')]=function(_0x440ed3,_0x319a45){var _0x60c74c={'raw':!![],'where':{'id':_0x440ed3[_0x26ec('0x3f')]['id']}},_0x2ca4b4={};_0x2ca4b4[_0x26ec('0x29')]=_[_0x26ec('0x40')](db[_0x26ec('0x27')][_0x26ec('0x28')]);_0x2ca4b4['query']=_[_0x26ec('0x40')](_0x440ed3[_0x26ec('0x2a')]);_0x2ca4b4[_0x26ec('0x2b')]=_[_0x26ec('0x2d')](_0x2ca4b4[_0x26ec('0x29')],_0x2ca4b4[_0x26ec('0x2a')]);_0x60c74c['attributes']=_['intersection'](_0x2ca4b4[_0x26ec('0x29')],qs['fields'](_0x440ed3[_0x26ec('0x2a')][_0x26ec('0x2e')]));_0x60c74c[_0x26ec('0x2c')]=_0x60c74c[_0x26ec('0x2c')][_0x26ec('0x41')]?_0x60c74c[_0x26ec('0x2c')]:_0x2ca4b4[_0x26ec('0x29')];if(_0x440ed3[_0x26ec('0x2a')]['includeAll']){_0x60c74c[_0x26ec('0x3b')]=[{'all':!![]}];}_0x60c74c=_[_0x26ec('0x42')]({},_0x60c74c,_0x440ed3[_0x26ec('0x43')]);return db['ChatOfflineMessage'][_0x26ec('0x44')](_0x60c74c)[_0x26ec('0x21')](handleEntityNotFound(_0x319a45,null))[_0x26ec('0x21')](respondWithResult(_0x319a45,null))[_0x26ec('0x3d')](handleError(_0x319a45,null));};exports[_0x26ec('0x45')]=function(_0x1d698b,_0x42724f){return db[_0x26ec('0x27')][_0x26ec('0x45')](_0x1d698b[_0x26ec('0x46')],{})[_0x26ec('0x21')](respondWithResult(_0x42724f,0xc9))[_0x26ec('0x3d')](handleError(_0x42724f,null));};exports[_0x26ec('0x20')]=function(_0x155c8b,_0x581a0e){if(_0x155c8b['body']['id']){delete _0x155c8b[_0x26ec('0x46')]['id'];}return db['ChatOfflineMessage']['find']({'where':{'id':_0x155c8b[_0x26ec('0x3f')]['id']}})[_0x26ec('0x21')](handleEntityNotFound(_0x581a0e,null))[_0x26ec('0x21')](saveUpdates(_0x155c8b['body'],null))['then'](respondWithResult(_0x581a0e,null))['catch'](handleError(_0x581a0e,null));};exports['destroy']=function(_0x3faf2b,_0x583a22){return db[_0x26ec('0x27')][_0x26ec('0x44')]({'where':{'id':_0x3faf2b['params']['id']}})['then'](handleEntityNotFound(_0x583a22,null))[_0x26ec('0x21')](removeEntity(_0x583a22,null))[_0x26ec('0x3d')](handleError(_0x583a22,null));};exports['describe']=function(_0x45673f,_0x12f463){return db['ChatOfflineMessage']['describe']()[_0x26ec('0x21')](respondWithResult(_0x12f463,null))[_0x26ec('0x3d')](handleError(_0x12f463,null));}; \ No newline at end of file +var _0xe829=['show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','json','apply','save','update','destroy','error','stack','name','ChatOfflineMessage','rawAttributes','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','count','then','includeAll','include','rows','catch'];(function(_0x1b4c04,_0x8d961d){var _0x374f5d=function(_0x11dc31){while(--_0x11dc31){_0x1b4c04['push'](_0x1b4c04['shift']());}};_0x374f5d(++_0x8d961d);}(_0xe829,0xde));var _0x9e82=function(_0x1933fe,_0x4dd1d2){_0x1933fe=_0x1933fe-0x0;var _0x3ccf9c=_0xe829[_0x1933fe];return _0x3ccf9c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9e82('0x0'));var rimraf=require(_0x9e82('0x1'));var zipdir=require(_0x9e82('0x2'));var jsonpatch=require(_0x9e82('0x3'));var rp=require(_0x9e82('0x4'));var moment=require(_0x9e82('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9e82('0x6'));var util=require(_0x9e82('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9e82('0x8'));var fs=require('fs');var _=require(_0x9e82('0x9'));var squel=require(_0x9e82('0xa'));var crypto=require('crypto');var jsforce=require(_0x9e82('0xb'));var deskjs=require(_0x9e82('0xc'));var toCsv=require(_0x9e82('0xd'));var querystring=require(_0x9e82('0xe'));var Papa=require('papaparse');var Redis=require(_0x9e82('0xf'));var authService=require(_0x9e82('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x9e82('0x11'));var logger=require(_0x9e82('0x12'))('api');var utils=require(_0x9e82('0x13'));var config=require(_0x9e82('0x14'));var db=require(_0x9e82('0x15'))['db'];function respondWithStatusCode(_0x20a851,_0x239d5c){_0x239d5c=_0x239d5c||0xcc;return function(_0x5a835d){if(_0x5a835d){return _0x20a851[_0x9e82('0x16')](_0x239d5c);}return _0x20a851[_0x9e82('0x17')](_0x239d5c)[_0x9e82('0x18')]();};}function respondWithResult(_0x6a793a,_0x583c49){_0x583c49=_0x583c49||0xc8;return function(_0x570223){if(_0x570223){return _0x6a793a['status'](_0x583c49)['json'](_0x570223);}};}function respondWithFilteredResult(_0x5909a6,_0xa4bd12){return function(_0x567ff9){if(_0x567ff9){var _0x2f39a3=_0x567ff9['count'],_0x42b785=_0xa4bd12[_0x9e82('0x19')],_0x1bdf3f=_0xa4bd12[_0x9e82('0x19')]+_0xa4bd12['limit'],_0x37cea0;if(_0x1bdf3f>=_0x2f39a3){_0x1bdf3f=_0x2f39a3;_0x37cea0=0xc8;}else{_0x37cea0=0xce;}_0x5909a6['status'](_0x37cea0);return _0x5909a6[_0x9e82('0x1a')](_0x9e82('0x1b'),_0x42b785+'-'+_0x1bdf3f+'/'+_0x2f39a3)[_0x9e82('0x1c')](_0x567ff9);}return null;};}function patchUpdates(_0xf0764b){return function(_0xfbeb43){try{jsonpatch[_0x9e82('0x1d')](_0xfbeb43,_0xf0764b,!![]);}catch(_0xaeaa71){return BPromise['reject'](_0xaeaa71);}return _0xfbeb43[_0x9e82('0x1e')]();};}function saveUpdates(_0x135b3c,_0x3463e6){return function(_0x5b4352){if(_0x5b4352){return _0x5b4352[_0x9e82('0x1f')](_0x135b3c)['then'](function(_0x2e8cec){return _0x2e8cec;});}return null;};}function removeEntity(_0x2fd0fa,_0x463357){return function(_0xede436){if(_0xede436){return _0xede436[_0x9e82('0x20')]()['then'](function(){_0x2fd0fa[_0x9e82('0x17')](0xcc)[_0x9e82('0x18')]();});}};}function handleEntityNotFound(_0x221969,_0x370d2d){return function(_0x50d8d2){if(!_0x50d8d2){_0x221969['sendStatus'](0x194);}return _0x50d8d2;};}function handleError(_0x2f7d3f,_0x16e006){_0x16e006=_0x16e006||0x1f4;return function(_0x2c3895){logger[_0x9e82('0x21')](_0x2c3895[_0x9e82('0x22')]);if(_0x2c3895[_0x9e82('0x23')]){delete _0x2c3895['name'];}_0x2f7d3f[_0x9e82('0x17')](_0x16e006)['send'](_0x2c3895);};}exports['index']=function(_0x2cb910,_0x4a8329){var _0x5a5a4e={},_0x371df8={},_0x1ac8ee={'count':0x0,'rows':[]};var _0x2ceb2a=db[_0x9e82('0x24')][_0x9e82('0x25')];_0x371df8['model']=_['keys'](_0x2ceb2a);_0x371df8[_0x9e82('0x26')]=_[_0x9e82('0x27')](_0x2cb910[_0x9e82('0x26')]);_0x371df8['filters']=_['intersection'](_0x371df8[_0x9e82('0x28')],_0x371df8[_0x9e82('0x26')]);_0x5a5a4e[_0x9e82('0x29')]=_[_0x9e82('0x2a')](_0x371df8[_0x9e82('0x28')],qs[_0x9e82('0x2b')](_0x2cb910['query']['fields']));_0x5a5a4e['attributes']=_0x5a5a4e['attributes'][_0x9e82('0x2c')]?_0x5a5a4e[_0x9e82('0x29')]:_0x371df8[_0x9e82('0x28')];if(!_0x2cb910['query'][_0x9e82('0x2d')](_0x9e82('0x2e'))){_0x5a5a4e['limit']=qs[_0x9e82('0x2f')](_0x2cb910[_0x9e82('0x26')][_0x9e82('0x2f')]);_0x5a5a4e[_0x9e82('0x19')]=qs[_0x9e82('0x19')](_0x2cb910[_0x9e82('0x26')][_0x9e82('0x19')]);}_0x5a5a4e[_0x9e82('0x30')]=qs[_0x9e82('0x31')](_0x2cb910[_0x9e82('0x26')][_0x9e82('0x31')]);_0x5a5a4e[_0x9e82('0x32')]=qs[_0x9e82('0x33')](_[_0x9e82('0x34')](_0x2cb910[_0x9e82('0x26')],_0x371df8[_0x9e82('0x33')]));if(_0x2cb910[_0x9e82('0x26')][_0x9e82('0x35')]){_0x5a5a4e[_0x9e82('0x32')]=_[_0x9e82('0x36')](_0x5a5a4e[_0x9e82('0x32')],{'$or':_[_0x9e82('0x37')](_0x2ceb2a,function(_0x51847f){if(_0x51847f[_0x9e82('0x38')][_0x9e82('0x39')]!==_0x9e82('0x3a')){var _0x2f406f={};_0x2f406f[_0x51847f['field']]={'$like':'%'+_0x2cb910['query']['filter']+'%'};return _0x2f406f;}})});}_0x5a5a4e=_['merge']({},_0x5a5a4e,_0x2cb910[_0x9e82('0x3b')]);var _0x4163ed={'where':_0x5a5a4e[_0x9e82('0x32')]};return db[_0x9e82('0x24')][_0x9e82('0x3c')](_0x4163ed)[_0x9e82('0x3d')](function(_0x51e91){_0x1ac8ee[_0x9e82('0x3c')]=_0x51e91;if(_0x2cb910[_0x9e82('0x26')][_0x9e82('0x3e')]){_0x5a5a4e[_0x9e82('0x3f')]=[{'all':!![]}];}return db[_0x9e82('0x24')]['findAll'](_0x5a5a4e);})[_0x9e82('0x3d')](function(_0x422ce2){_0x1ac8ee[_0x9e82('0x40')]=_0x422ce2;return _0x1ac8ee;})['then'](respondWithFilteredResult(_0x4a8329,_0x5a5a4e))[_0x9e82('0x41')](handleError(_0x4a8329,null));};exports[_0x9e82('0x42')]=function(_0x24565a,_0x4953e8){var _0x12fbdb={'raw':!![],'where':{'id':_0x24565a[_0x9e82('0x43')]['id']}},_0x2dfaec={};_0x2dfaec[_0x9e82('0x28')]=_[_0x9e82('0x27')](db[_0x9e82('0x24')][_0x9e82('0x25')]);_0x2dfaec[_0x9e82('0x26')]=_[_0x9e82('0x27')](_0x24565a[_0x9e82('0x26')]);_0x2dfaec[_0x9e82('0x33')]=_['intersection'](_0x2dfaec[_0x9e82('0x28')],_0x2dfaec[_0x9e82('0x26')]);_0x12fbdb[_0x9e82('0x29')]=_['intersection'](_0x2dfaec['model'],qs['fields'](_0x24565a[_0x9e82('0x26')][_0x9e82('0x2b')]));_0x12fbdb[_0x9e82('0x29')]=_0x12fbdb['attributes'][_0x9e82('0x2c')]?_0x12fbdb[_0x9e82('0x29')]:_0x2dfaec[_0x9e82('0x28')];if(_0x24565a[_0x9e82('0x26')][_0x9e82('0x3e')]){_0x12fbdb[_0x9e82('0x3f')]=[{'all':!![]}];}_0x12fbdb=_['merge']({},_0x12fbdb,_0x24565a[_0x9e82('0x3b')]);return db['ChatOfflineMessage']['find'](_0x12fbdb)[_0x9e82('0x3d')](handleEntityNotFound(_0x4953e8,null))[_0x9e82('0x3d')](respondWithResult(_0x4953e8,null))[_0x9e82('0x41')](handleError(_0x4953e8,null));};exports[_0x9e82('0x44')]=function(_0x249383,_0x527e53){return db[_0x9e82('0x24')][_0x9e82('0x44')](_0x249383['body'],{})[_0x9e82('0x3d')](respondWithResult(_0x527e53,0xc9))['catch'](handleError(_0x527e53,null));};exports[_0x9e82('0x1f')]=function(_0x2ccaa3,_0x800eff){if(_0x2ccaa3[_0x9e82('0x45')]['id']){delete _0x2ccaa3[_0x9e82('0x45')]['id'];}return db[_0x9e82('0x24')][_0x9e82('0x46')]({'where':{'id':_0x2ccaa3[_0x9e82('0x43')]['id']}})[_0x9e82('0x3d')](handleEntityNotFound(_0x800eff,null))['then'](saveUpdates(_0x2ccaa3[_0x9e82('0x45')],null))[_0x9e82('0x3d')](respondWithResult(_0x800eff,null))[_0x9e82('0x41')](handleError(_0x800eff,null));};exports[_0x9e82('0x20')]=function(_0x18cb4a,_0x43817b){return db[_0x9e82('0x24')][_0x9e82('0x46')]({'where':{'id':_0x18cb4a[_0x9e82('0x43')]['id']}})[_0x9e82('0x3d')](handleEntityNotFound(_0x43817b,null))[_0x9e82('0x3d')](removeEntity(_0x43817b,null))[_0x9e82('0x41')](handleError(_0x43817b,null));};exports[_0x9e82('0x47')]=function(_0x4599e5,_0x594069){return db[_0x9e82('0x24')][_0x9e82('0x47')]()[_0x9e82('0x3d')](respondWithResult(_0x594069,null))[_0x9e82('0x41')](handleError(_0x594069,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 655c0b2..63c5c53 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 _0x50a6=['util','moment','request-promise','path','rimraf','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash'];(function(_0x13a275,_0x3959a5){var _0x45919a=function(_0x56cb70){while(--_0x56cb70){_0x13a275['push'](_0x13a275['shift']());}};_0x45919a(++_0x3959a5);}(_0x50a6,0xa4));var _0x650a=function(_0x97a80f,_0x3d70d7){_0x97a80f=_0x97a80f-0x0;var _0x534071=_0x50a6[_0x97a80f];return _0x534071;};'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'));module['exports']=function(_0x4eabde,_0x2d486d){return _0x4eabde[_0x650a('0x7')](_0x650a('0x8'),attributes,{'tableName':_0x650a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x650a('0xa')});}; \ No newline at end of file +var _0xca66=['path','../../config/environment','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','lodash','api','moment','bluebird'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xca66,0x8b));var _0x6ca6=function(_0x46b8c9,_0x2b5c8b){_0x46b8c9=_0x46b8c9-0x0;var _0xebc04a=_0xca66[_0x46b8c9];return _0xebc04a;};'use strict';var _=require(_0x6ca6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6ca6('0x1'));var moment=require(_0x6ca6('0x2'));var BPromise=require(_0x6ca6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ca6('0x4'));var rimraf=require('rimraf');var config=require(_0x6ca6('0x5'));var attributes=require('./chatOfflineMessage.attributes');module[_0x6ca6('0x6')]=function(_0x27d8c6,_0x34836f){return _0x27d8c6[_0x6ca6('0x7')](_0x6ca6('0x8'),attributes,{'tableName':_0x6ca6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6ca6('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 7f31de9..b67fd8a 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 _0x2999=['info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x3b8cf8,_0x5a9f33){var _0x551431=function(_0x5be01b){while(--_0x5be01b){_0x3b8cf8['push'](_0x3b8cf8['shift']());}};_0x551431(++_0x5a9f33);}(_0x2999,0x70));var _0x9299=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2999[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9299('0x0'));var util=require(_0x9299('0x1'));var moment=require(_0x9299('0x2'));var BPromise=require(_0x9299('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9299('0x4'));var db=require(_0x9299('0x5'))['db'];var utils=require(_0x9299('0x6'));var logger=require('../../config/logger')(_0x9299('0x7'));var config=require(_0x9299('0x8'));var jayson=require(_0x9299('0x9'));var client=jayson[_0x9299('0xa')][_0x9299('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58208a,_0x57962d,_0x22d3d4){return new BPromise(function(_0x43a652,_0x5dbdef){return client[_0x9299('0xc')](_0x58208a,_0x22d3d4)[_0x9299('0xd')](function(_0x326c3a){logger['info'](_0x9299('0xe'),_0x57962d,_0x9299('0xf'));logger[_0x9299('0x10')](_0x9299('0x11'),_0x57962d,_0x9299('0xf'),JSON['stringify'](_0x326c3a));if(_0x326c3a[_0x9299('0x12')]){if(_0x326c3a[_0x9299('0x12')]['code']===0x1f4){logger['error'](_0x9299('0xe'),_0x57962d,_0x326c3a[_0x9299('0x12')]['message']);return _0x5dbdef(_0x326c3a['error']['message']);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x57962d,_0x326c3a[_0x9299('0x12')][_0x9299('0x13')]);return _0x43a652(_0x326c3a[_0x9299('0x12')][_0x9299('0x13')]);}else{logger[_0x9299('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x57962d,_0x9299('0xf'));_0x43a652(_0x326c3a[_0x9299('0x15')][_0x9299('0x13')]);}})['catch'](function(_0x1eeb2e){logger[_0x9299('0x12')](_0x9299('0xe'),_0x57962d,_0x1eeb2e);_0x5dbdef(_0x1eeb2e);});});} \ No newline at end of file +var _0x9481=['../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x5a5bd9,_0x554cbd){var _0x52aac0=function(_0x3e8031){while(--_0x3e8031){_0x5a5bd9['push'](_0x5a5bd9['shift']());}};_0x52aac0(++_0x554cbd);}(_0x9481,0x13a));var _0x1948=function(_0x7d0737,_0xa0ea09){_0x7d0737=_0x7d0737-0x0;var _0x30d500=_0x9481[_0x7d0737];return _0x30d500;};'use strict';var _=require(_0x1948('0x0'));var util=require(_0x1948('0x1'));var moment=require(_0x1948('0x2'));var BPromise=require(_0x1948('0x3'));var rs=require(_0x1948('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1948('0x5'));var logger=require(_0x1948('0x6'))(_0x1948('0x7'));var config=require(_0x1948('0x8'));var jayson=require(_0x1948('0x9'));var client=jayson[_0x1948('0xa')][_0x1948('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d6821,_0x22db3c,_0x32e868){return new BPromise(function(_0x17c1b8,_0x340108){return client[_0x1948('0xc')](_0x4d6821,_0x32e868)[_0x1948('0xd')](function(_0x4254f1){logger[_0x1948('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x22db3c,'request\x20sent');logger[_0x1948('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x22db3c,_0x1948('0x10'),JSON[_0x1948('0x11')](_0x4254f1));if(_0x4254f1[_0x1948('0x12')]){if(_0x4254f1[_0x1948('0x12')][_0x1948('0x13')]===0x1f4){logger[_0x1948('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x22db3c,_0x4254f1[_0x1948('0x12')][_0x1948('0x14')]);return _0x340108(_0x4254f1[_0x1948('0x12')]['message']);}logger[_0x1948('0x12')](_0x1948('0x15'),_0x22db3c,_0x4254f1[_0x1948('0x12')][_0x1948('0x14')]);return _0x17c1b8(_0x4254f1[_0x1948('0x12')][_0x1948('0x14')]);}else{logger[_0x1948('0xe')](_0x1948('0x15'),_0x22db3c,_0x1948('0x10'));_0x17c1b8(_0x4254f1['result'][_0x1948('0x14')]);}})[_0x1948('0x16')](function(_0x2c6a47){logger[_0x1948('0x12')](_0x1948('0x15'),_0x22db3c,_0x2c6a47);_0x340108(_0x2c6a47);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 1aa0d65..6c7f3e1 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 _0x5d69=['../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x4a5211,_0x58bad5){var _0x598945=function(_0x213847){while(--_0x213847){_0x4a5211['push'](_0x4a5211['shift']());}};_0x598945(++_0x58bad5);}(_0x5d69,0xea));var _0x95d6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5d69[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x95d6('0x0'));var util=require(_0x95d6('0x1'));var path=require(_0x95d6('0x2'));var timeout=require(_0x95d6('0x3'));var express=require(_0x95d6('0x4'));var router=express[_0x95d6('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x95d6('0x6'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0x95d6('0x7')](),controller[_0x95d6('0x8')]);router[_0x95d6('0x9')](_0x95d6('0xa'),auth[_0x95d6('0x7')](),controller[_0x95d6('0xb')]);router['get'](_0x95d6('0xc'),auth[_0x95d6('0x7')](),controller[_0x95d6('0xd')]);router[_0x95d6('0xe')]('/',auth[_0x95d6('0x7')](),controller[_0x95d6('0xf')]);router[_0x95d6('0x10')](_0x95d6('0xc'),auth[_0x95d6('0x7')](),controller[_0x95d6('0x11')]);router[_0x95d6('0x12')](_0x95d6('0xc'),auth[_0x95d6('0x7')](),controller[_0x95d6('0x13')]);module['exports']=router; \ No newline at end of file +var _0x6ee9=['describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','../../components/interaction/service','get','isAuthenticated','index','/describe'];(function(_0xe6a9c,_0x33efab){var _0x17df4b=function(_0x49c378){while(--_0x49c378){_0xe6a9c['push'](_0xe6a9c['shift']());}};_0x17df4b(++_0x33efab);}(_0x6ee9,0x196));var _0x96ee=function(_0x2ddebf,_0x5a1b45){_0x2ddebf=_0x2ddebf-0x0;var _0x18714f=_0x6ee9[_0x2ddebf];return _0x18714f;};'use strict';var multer=require(_0x96ee('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x96ee('0x1'));var express=require(_0x96ee('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x96ee('0x3'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x96ee('0x4')]('/',auth[_0x96ee('0x5')](),controller[_0x96ee('0x6')]);router[_0x96ee('0x4')](_0x96ee('0x7'),auth[_0x96ee('0x5')](),controller[_0x96ee('0x8')]);router[_0x96ee('0x4')]('/:id',auth['isAuthenticated'](),controller[_0x96ee('0x9')]);router[_0x96ee('0xa')]('/',auth[_0x96ee('0x5')](),controller[_0x96ee('0xb')]);router[_0x96ee('0xc')](_0x96ee('0xd'),auth['isAuthenticated'](),controller[_0x96ee('0xe')]);router[_0x96ee('0xf')](_0x96ee('0xd'),auth[_0x96ee('0x5')](),controller[_0x96ee('0x10')]);module[_0x96ee('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index dbbd0c1..1c1ab46 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 _0x0a07=['mouseOver','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x3a7319,_0x2804b1){var _0x195df8=function(_0x3cff1a){while(--_0x3cff1a){_0x3a7319['push'](_0x3a7319['shift']());}};_0x195df8(++_0x2804b1);}(_0x0a07,0xbc));var _0x70a0=function(_0x4ae606,_0x1826c6){_0x4ae606=_0x4ae606-0x0;var _0x426340=_0x0a07[_0x4ae606];return _0x426340;};'use strict';var Sequelize=require(_0x70a0('0x0'));module[_0x70a0('0x1')]={'name':{'type':Sequelize[_0x70a0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x70a0('0x3')](_0x70a0('0x4'),'timeout'),'defaultValue':_0x70a0('0x4')},'selector':{'type':Sequelize[_0x70a0('0x2')]},'timeout':{'type':Sequelize[_0x70a0('0x5')]}}; \ No newline at end of file +var _0x7fbc=['exports','STRING','ENUM','mouseOver','timeout'];(function(_0xebe967,_0x38664b){var _0x2eeb84=function(_0x28e08c){while(--_0x28e08c){_0xebe967['push'](_0xebe967['shift']());}};_0x2eeb84(++_0x38664b);}(_0x7fbc,0xbe));var _0xc7fb=function(_0x5f0c04,_0xcb18dd){_0x5f0c04=_0x5f0c04-0x0;var _0x5c27a7=_0x7fbc[_0x5f0c04];return _0x5c27a7;};'use strict';var Sequelize=require('sequelize');module[_0xc7fb('0x0')]={'name':{'type':Sequelize[_0xc7fb('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc7fb('0x2')](_0xc7fb('0x3'),_0xc7fb('0x4')),'defaultValue':_0xc7fb('0x3')},'selector':{'type':Sequelize[_0xc7fb('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 8a89b15..48c8e6f 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 _0xf435=['model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','find','create','body','catch','then','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','error','name','show','params'];(function(_0x4925be,_0x3413f8){var _0x577b58=function(_0x23618f){while(--_0x23618f){_0x4925be['push'](_0x4925be['shift']());}};_0x577b58(++_0x3413f8);}(_0xf435,0x174));var _0x5f43=function(_0x456b4b,_0x2fb4d3){_0x456b4b=_0x456b4b-0x0;var _0x3560c7=_0xf435[_0x456b4b];return _0x3560c7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5f43('0x0'));var rimraf=require(_0x5f43('0x1'));var zipdir=require(_0x5f43('0x2'));var jsonpatch=require(_0x5f43('0x3'));var rp=require(_0x5f43('0x4'));var moment=require('moment');var BPromise=require(_0x5f43('0x5'));var Mustache=require(_0x5f43('0x6'));var util=require(_0x5f43('0x7'));var path=require(_0x5f43('0x8'));var sox=require('sox');var csv=require(_0x5f43('0x9'));var ejs=require(_0x5f43('0xa'));var fs=require('fs');var _=require(_0x5f43('0xb'));var squel=require('squel');var crypto=require(_0x5f43('0xc'));var jsforce=require(_0x5f43('0xd'));var deskjs=require(_0x5f43('0xe'));var toCsv=require(_0x5f43('0x9'));var querystring=require(_0x5f43('0xf'));var Papa=require(_0x5f43('0x10'));var Redis=require(_0x5f43('0x11'));var authService=require(_0x5f43('0x12'));var qs=require(_0x5f43('0x13'));var hardwareService=require(_0x5f43('0x14'));var logger=require(_0x5f43('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x5f43('0x16'));var db=require(_0x5f43('0x17'))['db'];function respondWithStatusCode(_0x46a927,_0x9119da){_0x9119da=_0x9119da||0xcc;return function(_0x397ed3){if(_0x397ed3){return _0x46a927[_0x5f43('0x18')](_0x9119da);}return _0x46a927[_0x5f43('0x19')](_0x9119da)[_0x5f43('0x1a')]();};}function respondWithResult(_0x5f4218,_0x2a71d6){_0x2a71d6=_0x2a71d6||0xc8;return function(_0x4f2908){if(_0x4f2908){return _0x5f4218[_0x5f43('0x19')](_0x2a71d6)['json'](_0x4f2908);}};}function respondWithFilteredResult(_0x36ea83,_0x172654){return function(_0x45c005){if(_0x45c005){var _0x275060=_0x45c005[_0x5f43('0x1b')],_0x50cb6a=_0x172654['offset'],_0x34de1f=_0x172654[_0x5f43('0x1c')]+_0x172654[_0x5f43('0x1d')],_0x248ba6;if(_0x34de1f>=_0x275060){_0x34de1f=_0x275060;_0x248ba6=0xc8;}else{_0x248ba6=0xce;}_0x36ea83[_0x5f43('0x19')](_0x248ba6);return _0x36ea83[_0x5f43('0x1e')](_0x5f43('0x1f'),_0x50cb6a+'-'+_0x34de1f+'/'+_0x275060)[_0x5f43('0x20')](_0x45c005);}return null;};}function patchUpdates(_0x51285f){return function(_0x74fd9d){try{jsonpatch[_0x5f43('0x21')](_0x74fd9d,_0x51285f,!![]);}catch(_0x53e640){return BPromise[_0x5f43('0x22')](_0x53e640);}return _0x74fd9d[_0x5f43('0x23')]();};}function saveUpdates(_0xc50eb0,_0x1f00a4){return function(_0x750a7d){if(_0x750a7d){return _0x750a7d[_0x5f43('0x24')](_0xc50eb0)['then'](function(_0x2b3eea){return _0x2b3eea;});}return null;};}function removeEntity(_0x53d062,_0x3173ef){return function(_0x4a2d3d){if(_0x4a2d3d){return _0x4a2d3d['destroy']()['then'](function(){_0x53d062[_0x5f43('0x19')](0xcc)[_0x5f43('0x1a')]();});}};}function handleEntityNotFound(_0x8ee422,_0x1a8fbe){return function(_0x364e61){if(!_0x364e61){_0x8ee422[_0x5f43('0x18')](0x194);}return _0x364e61;};}function handleError(_0x20cab2,_0x3381f8){_0x3381f8=_0x3381f8||0x1f4;return function(_0x179ba3){logger[_0x5f43('0x25')](_0x179ba3['stack']);if(_0x179ba3['name']){delete _0x179ba3[_0x5f43('0x26')];}_0x20cab2[_0x5f43('0x19')](_0x3381f8)['send'](_0x179ba3);};}exports[_0x5f43('0x27')]=function(_0x1f79fd,_0x384340){var _0x42e40a={'raw':!![],'where':{'id':_0x1f79fd[_0x5f43('0x28')]['id']}},_0x25cd68={};_0x25cd68[_0x5f43('0x29')]=_[_0x5f43('0x2a')](db[_0x5f43('0x2b')][_0x5f43('0x2c')]);_0x25cd68[_0x5f43('0x2d')]=_['keys'](_0x1f79fd[_0x5f43('0x2d')]);_0x25cd68[_0x5f43('0x2e')]=_[_0x5f43('0x2f')](_0x25cd68[_0x5f43('0x29')],_0x25cd68[_0x5f43('0x2d')]);_0x42e40a[_0x5f43('0x30')]=_[_0x5f43('0x2f')](_0x25cd68[_0x5f43('0x29')],qs[_0x5f43('0x31')](_0x1f79fd[_0x5f43('0x2d')]['fields']));_0x42e40a[_0x5f43('0x30')]=_0x42e40a['attributes'][_0x5f43('0x32')]?_0x42e40a[_0x5f43('0x30')]:_0x25cd68[_0x5f43('0x29')];if(_0x1f79fd[_0x5f43('0x2d')]['includeAll']){_0x42e40a[_0x5f43('0x33')]=[{'all':!![]}];}_0x42e40a=_[_0x5f43('0x34')]({},_0x42e40a,_0x1f79fd['options']);return db[_0x5f43('0x2b')][_0x5f43('0x35')](_0x42e40a)['then'](handleEntityNotFound(_0x384340,null))['then'](respondWithResult(_0x384340,null))['catch'](handleError(_0x384340,null));};exports[_0x5f43('0x36')]=function(_0x3f394d,_0x5f07c5){return db[_0x5f43('0x2b')][_0x5f43('0x36')](_0x3f394d[_0x5f43('0x37')],{})['then'](respondWithResult(_0x5f07c5,0xc9))[_0x5f43('0x38')](handleError(_0x5f07c5,null));};exports['update']=function(_0x51ec55,_0xf53b93){if(_0x51ec55['body']['id']){delete _0x51ec55[_0x5f43('0x37')]['id'];}return db['ChatProactiveAction'][_0x5f43('0x35')]({'where':{'id':_0x51ec55[_0x5f43('0x28')]['id']}})[_0x5f43('0x39')](handleEntityNotFound(_0xf53b93,null))[_0x5f43('0x39')](saveUpdates(_0x51ec55[_0x5f43('0x37')],null))[_0x5f43('0x39')](respondWithResult(_0xf53b93,null))[_0x5f43('0x38')](handleError(_0xf53b93,null));};exports[_0x5f43('0x3a')]=function(_0x1e6990,_0x24d986){return db['ChatProactiveAction'][_0x5f43('0x35')]({'where':{'id':_0x1e6990[_0x5f43('0x28')]['id']}})[_0x5f43('0x39')](handleEntityNotFound(_0x24d986,null))[_0x5f43('0x39')](removeEntity(_0x24d986,null))[_0x5f43('0x38')](handleError(_0x24d986,null));}; \ No newline at end of file +var _0x0f80=['lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','query','filters','intersection','fields','attributes','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x1b91c7,_0x539acd){var _0xbbe014=function(_0x57ff15){while(--_0x57ff15){_0x1b91c7['push'](_0x1b91c7['shift']());}};_0xbbe014(++_0x539acd);}(_0x0f80,0x108));var _0x00f8=function(_0x2f7c48,_0x33fedf){_0x2f7c48=_0x2f7c48-0x0;var _0x4e6d46=_0x0f80[_0x2f7c48];return _0x4e6d46;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x00f8('0x0'));var rimraf=require(_0x00f8('0x1'));var zipdir=require(_0x00f8('0x2'));var jsonpatch=require(_0x00f8('0x3'));var rp=require(_0x00f8('0x4'));var moment=require('moment');var BPromise=require(_0x00f8('0x5'));var Mustache=require(_0x00f8('0x6'));var util=require(_0x00f8('0x7'));var path=require('path');var sox=require(_0x00f8('0x8'));var csv=require(_0x00f8('0x9'));var ejs=require(_0x00f8('0xa'));var fs=require('fs');var _=require(_0x00f8('0xb'));var squel=require(_0x00f8('0xc'));var crypto=require(_0x00f8('0xd'));var jsforce=require(_0x00f8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x00f8('0x9'));var querystring=require(_0x00f8('0xf'));var Papa=require(_0x00f8('0x10'));var Redis=require('ioredis');var authService=require(_0x00f8('0x11'));var qs=require(_0x00f8('0x12'));var hardwareService=require(_0x00f8('0x13'));var logger=require(_0x00f8('0x14'))(_0x00f8('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x00f8('0x16'))['db'];function respondWithStatusCode(_0x5094fd,_0x48b3d4){_0x48b3d4=_0x48b3d4||0xcc;return function(_0x2fd828){if(_0x2fd828){return _0x5094fd['sendStatus'](_0x48b3d4);}return _0x5094fd[_0x00f8('0x17')](_0x48b3d4)[_0x00f8('0x18')]();};}function respondWithResult(_0x4e10cf,_0x45c022){_0x45c022=_0x45c022||0xc8;return function(_0x47c3da){if(_0x47c3da){return _0x4e10cf['status'](_0x45c022)[_0x00f8('0x19')](_0x47c3da);}};}function respondWithFilteredResult(_0x31cdee,_0x20dd86){return function(_0x3e2bea){if(_0x3e2bea){var _0x49eeef=_0x3e2bea[_0x00f8('0x1a')],_0x23ba53=_0x20dd86['offset'],_0x44ebf0=_0x20dd86[_0x00f8('0x1b')]+_0x20dd86[_0x00f8('0x1c')],_0x1dd277;if(_0x44ebf0>=_0x49eeef){_0x44ebf0=_0x49eeef;_0x1dd277=0xc8;}else{_0x1dd277=0xce;}_0x31cdee[_0x00f8('0x17')](_0x1dd277);return _0x31cdee[_0x00f8('0x1d')](_0x00f8('0x1e'),_0x23ba53+'-'+_0x44ebf0+'/'+_0x49eeef)[_0x00f8('0x19')](_0x3e2bea);}return null;};}function patchUpdates(_0x15467d){return function(_0x502f24){try{jsonpatch['apply'](_0x502f24,_0x15467d,!![]);}catch(_0x7bcc6d){return BPromise['reject'](_0x7bcc6d);}return _0x502f24[_0x00f8('0x1f')]();};}function saveUpdates(_0x1bd508,_0x4d3c9d){return function(_0x485d6b){if(_0x485d6b){return _0x485d6b[_0x00f8('0x20')](_0x1bd508)[_0x00f8('0x21')](function(_0x1e53da){return _0x1e53da;});}return null;};}function removeEntity(_0x13c5d7,_0x38ae9d){return function(_0x3e92b6){if(_0x3e92b6){return _0x3e92b6[_0x00f8('0x22')]()[_0x00f8('0x21')](function(){_0x13c5d7[_0x00f8('0x17')](0xcc)[_0x00f8('0x18')]();});}};}function handleEntityNotFound(_0x77fefb,_0x234f12){return function(_0x5a2d1a){if(!_0x5a2d1a){_0x77fefb['sendStatus'](0x194);}return _0x5a2d1a;};}function handleError(_0x50684c,_0x265f3b){_0x265f3b=_0x265f3b||0x1f4;return function(_0x551d20){logger[_0x00f8('0x23')](_0x551d20[_0x00f8('0x24')]);if(_0x551d20['name']){delete _0x551d20[_0x00f8('0x25')];}_0x50684c[_0x00f8('0x17')](_0x265f3b)[_0x00f8('0x26')](_0x551d20);};}exports[_0x00f8('0x27')]=function(_0x27753c,_0xaecdf6){var _0x430b4d={'raw':!![],'where':{'id':_0x27753c[_0x00f8('0x28')]['id']}},_0x91ad77={};_0x91ad77[_0x00f8('0x29')]=_[_0x00f8('0x2a')](db[_0x00f8('0x2b')]['rawAttributes']);_0x91ad77[_0x00f8('0x2c')]=_[_0x00f8('0x2a')](_0x27753c[_0x00f8('0x2c')]);_0x91ad77[_0x00f8('0x2d')]=_['intersection'](_0x91ad77[_0x00f8('0x29')],_0x91ad77[_0x00f8('0x2c')]);_0x430b4d['attributes']=_[_0x00f8('0x2e')](_0x91ad77[_0x00f8('0x29')],qs[_0x00f8('0x2f')](_0x27753c[_0x00f8('0x2c')][_0x00f8('0x2f')]));_0x430b4d['attributes']=_0x430b4d[_0x00f8('0x30')][_0x00f8('0x31')]?_0x430b4d['attributes']:_0x91ad77['model'];if(_0x27753c['query']['includeAll']){_0x430b4d['include']=[{'all':!![]}];}_0x430b4d=_[_0x00f8('0x32')]({},_0x430b4d,_0x27753c[_0x00f8('0x33')]);return db[_0x00f8('0x2b')][_0x00f8('0x34')](_0x430b4d)[_0x00f8('0x21')](handleEntityNotFound(_0xaecdf6,null))['then'](respondWithResult(_0xaecdf6,null))[_0x00f8('0x35')](handleError(_0xaecdf6,null));};exports['create']=function(_0x5436c1,_0x3c7136){return db[_0x00f8('0x2b')]['create'](_0x5436c1[_0x00f8('0x36')],{})[_0x00f8('0x21')](respondWithResult(_0x3c7136,0xc9))[_0x00f8('0x35')](handleError(_0x3c7136,null));};exports['update']=function(_0x23446c,_0x158caa){if(_0x23446c[_0x00f8('0x36')]['id']){delete _0x23446c[_0x00f8('0x36')]['id'];}return db['ChatProactiveAction'][_0x00f8('0x34')]({'where':{'id':_0x23446c[_0x00f8('0x28')]['id']}})['then'](handleEntityNotFound(_0x158caa,null))['then'](saveUpdates(_0x23446c[_0x00f8('0x36')],null))[_0x00f8('0x21')](respondWithResult(_0x158caa,null))[_0x00f8('0x35')](handleError(_0x158caa,null));};exports[_0x00f8('0x22')]=function(_0x39dfd9,_0x17e5d3){return db[_0x00f8('0x2b')][_0x00f8('0x34')]({'where':{'id':_0x39dfd9[_0x00f8('0x28')]['id']}})[_0x00f8('0x21')](handleEntityNotFound(_0x17e5d3,null))[_0x00f8('0x21')](removeEntity(_0x17e5d3,null))[_0x00f8('0x35')](handleError(_0x17e5d3,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index c587d66..2ae5048 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 _0x37aa=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','lodash'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x37aa,0x6d));var _0xa37a=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0x37aa[_0x3e2fcf];return _0x497db7;};'use strict';var _=require(_0xa37a('0x0'));var util=require('util');var logger=require(_0xa37a('0x1'))(_0xa37a('0x2'));var moment=require(_0xa37a('0x3'));var BPromise=require(_0xa37a('0x4'));var rp=require(_0xa37a('0x5'));var fs=require('fs');var path=require(_0xa37a('0x6'));var rimraf=require(_0xa37a('0x7'));var config=require(_0xa37a('0x8'));var attributes=require(_0xa37a('0x9'));module[_0xa37a('0xa')]=function(_0x5b7650,_0x26e2c1){return _0x5b7650['define']('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b82=['rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','bluebird','request-promise'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x7b82,0x9c));var _0x27b8=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x7b82[_0x119d5a];return _0x15bff4;};'use strict';var _=require(_0x27b8('0x0'));var util=require(_0x27b8('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x27b8('0x2'));var rp=require(_0x27b8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x27b8('0x4'));var config=require(_0x27b8('0x5'));var attributes=require(_0x27b8('0x6'));module['exports']=function(_0x458c80,_0x5f342){return _0x458c80[_0x27b8('0x7')](_0x27b8('0x8'),attributes,{'tableName':_0x27b8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 34ce86d..102e565 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 _0xb74a=['request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x18f396,_0x174d17){var _0x3ba532=function(_0x2bc92f){while(--_0x2bc92f){_0x18f396['push'](_0x18f396['shift']());}};_0x3ba532(++_0x174d17);}(_0xb74a,0x129));var _0xab74=function(_0x4eb534,_0xe5bcb2){_0x4eb534=_0x4eb534-0x0;var _0x2d8dc9=_0xb74a[_0x4eb534];return _0x2d8dc9;};'use strict';var _=require(_0xab74('0x0'));var util=require(_0xab74('0x1'));var moment=require('moment');var BPromise=require(_0xab74('0x2'));var rs=require(_0xab74('0x3'));var fs=require('fs');var Redis=require(_0xab74('0x4'));var db=require(_0xab74('0x5'))['db'];var utils=require(_0xab74('0x6'));var logger=require(_0xab74('0x7'))('rpc');var config=require(_0xab74('0x8'));var jayson=require(_0xab74('0x9'));var client=jayson['client'][_0xab74('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59942e,_0x30dc85,_0x4c944a){return new BPromise(function(_0xdcfab0,_0x422a11){return client[_0xab74('0xb')](_0x59942e,_0x4c944a)[_0xab74('0xc')](function(_0x555179){logger['info'](_0xab74('0xd'),_0x30dc85,_0xab74('0xe'));logger[_0xab74('0xf')](_0xab74('0x10'),_0x30dc85,_0xab74('0xe'),JSON[_0xab74('0x11')](_0x555179));if(_0x555179[_0xab74('0x12')]){if(_0x555179['error'][_0xab74('0x13')]===0x1f4){logger[_0xab74('0x12')](_0xab74('0xd'),_0x30dc85,_0x555179[_0xab74('0x12')][_0xab74('0x14')]);return _0x422a11(_0x555179['error'][_0xab74('0x14')]);}logger[_0xab74('0x12')](_0xab74('0xd'),_0x30dc85,_0x555179[_0xab74('0x12')][_0xab74('0x14')]);return _0xdcfab0(_0x555179[_0xab74('0x12')][_0xab74('0x14')]);}else{logger['info'](_0xab74('0xd'),_0x30dc85,_0xab74('0xe'));_0xdcfab0(_0x555179['result'][_0xab74('0x14')]);}})[_0xab74('0x15')](function(_0x356382){logger[_0xab74('0x12')](_0xab74('0xd'),_0x30dc85,_0x356382);_0x422a11(_0x356382);});});} \ No newline at end of file +var _0x37cc=['../../config/logger','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','ioredis','../../config/utils'];(function(_0x26bff8,_0x299a35){var _0x539ba5=function(_0xf6f9e){while(--_0xf6f9e){_0x26bff8['push'](_0x26bff8['shift']());}};_0x539ba5(++_0x299a35);}(_0x37cc,0x188));var _0xc37c=function(_0xa016f6,_0x3a8863){_0xa016f6=_0xa016f6-0x0;var _0x313949=_0x37cc[_0xa016f6];return _0x313949;};'use strict';var _=require(_0xc37c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc37c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc37c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc37c('0x3'));var logger=require(_0xc37c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc37c('0x5'));var client=jayson[_0xc37c('0x6')][_0xc37c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2342fe,_0xc1bd61,_0x39e4bd){return new BPromise(function(_0x2baf68,_0x421991){return client['request'](_0x2342fe,_0x39e4bd)[_0xc37c('0x8')](function(_0x4ffe65){logger[_0xc37c('0x9')](_0xc37c('0xa'),_0xc1bd61,_0xc37c('0xb'));logger['debug'](_0xc37c('0xc'),_0xc1bd61,_0xc37c('0xb'),JSON['stringify'](_0x4ffe65));if(_0x4ffe65[_0xc37c('0xd')]){if(_0x4ffe65['error'][_0xc37c('0xe')]===0x1f4){logger[_0xc37c('0xd')](_0xc37c('0xa'),_0xc1bd61,_0x4ffe65[_0xc37c('0xd')][_0xc37c('0xf')]);return _0x421991(_0x4ffe65[_0xc37c('0xd')]['message']);}logger[_0xc37c('0xd')](_0xc37c('0xa'),_0xc1bd61,_0x4ffe65[_0xc37c('0xd')][_0xc37c('0xf')]);return _0x2baf68(_0x4ffe65[_0xc37c('0xd')]['message']);}else{logger[_0xc37c('0x9')](_0xc37c('0xa'),_0xc1bd61,_0xc37c('0xb'));_0x2baf68(_0x4ffe65[_0xc37c('0x10')][_0xc37c('0xf')]);}})[_0xc37c('0x11')](function(_0x3128e1){logger[_0xc37c('0xd')](_0xc37c('0xa'),_0xc1bd61,_0x3128e1);_0x421991(_0x3128e1);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 30a4b8d..34808ba 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 _0xe5f6=['post','create','put','/:id','isAuthenticated','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','show'];(function(_0x43e1c0,_0x4aeef6){var _0x4e2b78=function(_0x30c5dd){while(--_0x30c5dd){_0x43e1c0['push'](_0x43e1c0['shift']());}};_0x4e2b78(++_0x4aeef6);}(_0xe5f6,0xc2));var _0x6e5f=function(_0xf169ab,_0x2f80d3){_0xf169ab=_0xf169ab-0x0;var _0x1e76a8=_0xe5f6[_0xf169ab];return _0x1e76a8;};'use strict';var multer=require(_0x6e5f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6e5f('0x1'));var express=require(_0x6e5f('0x2'));var router=express[_0x6e5f('0x3')]();var auth=require(_0x6e5f('0x4'));var interaction=require(_0x6e5f('0x5'));var config=require(_0x6e5f('0x6'));var controller=require(_0x6e5f('0x7'));router[_0x6e5f('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6e5f('0x9')]);router[_0x6e5f('0xa')]('/',auth['isAuthenticated'](),controller[_0x6e5f('0xb')]);router[_0x6e5f('0xc')](_0x6e5f('0xd'),auth[_0x6e5f('0xe')](),controller['update']);router['delete'](_0x6e5f('0xd'),auth[_0x6e5f('0xe')](),controller[_0x6e5f('0xf')]);module[_0x6e5f('0x10')]=router; \ No newline at end of file +var _0xe703=['destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','create','put','update','delete'];(function(_0x1de164,_0x1ccf5f){var _0x5613b4=function(_0x22dca9){while(--_0x22dca9){_0x1de164['push'](_0x1de164['shift']());}};_0x5613b4(++_0x1ccf5f);}(_0xe703,0x192));var _0x3e70=function(_0x2d5934,_0x1acc4f){_0x2d5934=_0x2d5934-0x0;var _0x5807c8=_0xe703[_0x2d5934];return _0x5807c8;};'use strict';var multer=require('multer');var util=require(_0x3e70('0x0'));var path=require(_0x3e70('0x1'));var timeout=require(_0x3e70('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x3e70('0x3'));var interaction=require(_0x3e70('0x4'));var config=require(_0x3e70('0x5'));var controller=require(_0x3e70('0x6'));router[_0x3e70('0x7')](_0x3e70('0x8'),auth[_0x3e70('0x9')](),controller['show']);router['post']('/',auth[_0x3e70('0x9')](),controller[_0x3e70('0xa')]);router[_0x3e70('0xb')](_0x3e70('0x8'),auth[_0x3e70('0x9')](),controller[_0x3e70('0xc')]);router[_0x3e70('0xd')](_0x3e70('0x8'),auth[_0x3e70('0x9')](),controller[_0x3e70('0xe')]);module[_0x3e70('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index e52398a..7e1d008 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 _0xefa2=['name','ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x2e9a29,_0x20a6cd){var _0x2b5ebf=function(_0x455c44){while(--_0x455c44){_0x2e9a29['push'](_0x2e9a29['shift']());}};_0x2b5ebf(++_0x20a6cd);}(_0xefa2,0x1c5));var _0x2efa=function(_0x18b4c8,_0x7a8440){_0x18b4c8=_0x18b4c8-0x0;var _0x180510=_0xefa2[_0x18b4c8];return _0x180510;};'use strict';var Sequelize=require('sequelize');module[_0x2efa('0x0')]={'name':{'type':Sequelize[_0x2efa('0x1')],'unique':_0x2efa('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2efa('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2efa('0x3')](_0x2efa('0x4'),_0x2efa('0x5'),_0x2efa('0x6'))}}; \ No newline at end of file +var _0x604a=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x604a,0x1af));var _0xa604=function(_0x293e0d,_0x492309){_0x293e0d=_0x293e0d-0x0;var _0x2e0fbc=_0x604a[_0x293e0d];return _0x2e0fbc;};'use strict';var Sequelize=require(_0xa604('0x0'));module[_0xa604('0x1')]={'name':{'type':Sequelize[_0xa604('0x2')],'unique':_0xa604('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa604('0x2')]},'timeout':{'type':Sequelize[_0xa604('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa604('0x5')](_0xa604('0x6'),_0xa604('0x7'),_0xa604('0x8'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 27232fe..50811ab 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 _0x673c=['format','%s/%s','SIP','chatPause','getTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','emit','removeTeams','ids','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','SELECT','every','TeamId','all','value','userChatQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','json','count','offset','set','apply','reject','save','update','destroy','ChatQueues','UserProfileResource','end','stack','name','send','ChatQueue','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','type','key','VIRTUAL','filter','options','findAll','rows','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','get','UserChatQueue','hasOwnProperty','ChatQueueId','map','User','findAndCountAll','UserId','agent','updatedAt','createdAt'];(function(_0x1732c6,_0x701b02){var _0x148f2a=function(_0x5842c5){while(--_0x5842c5){_0x1732c6['push'](_0x1732c6['shift']());}};_0x148f2a(++_0x701b02);}(_0x673c,0xbe));var _0xc673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x673c[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xc673('0x0'));var emlformat=require(_0xc673('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc673('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc673('0x3'));var moment=require(_0xc673('0x4'));var BPromise=require(_0xc673('0x5'));var Mustache=require(_0xc673('0x6'));var util=require('util');var path=require(_0xc673('0x7'));var sox=require(_0xc673('0x8'));var csv=require(_0xc673('0x9'));var ejs=require(_0xc673('0xa'));var fs=require('fs');var _=require(_0xc673('0xb'));var squel=require('squel');var crypto=require(_0xc673('0xc'));var jsforce=require(_0xc673('0xd'));var deskjs=require(_0xc673('0xe'));var toCsv=require(_0xc673('0x9'));var querystring=require(_0xc673('0xf'));var Papa=require(_0xc673('0x10'));var Redis=require(_0xc673('0x11'));var authService=require(_0xc673('0x12'));var qs=require(_0xc673('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc673('0x14'));var utils=require('../../config/utils');var config=require(_0xc673('0x15'));var db=require(_0xc673('0x16'))['db'];config['redis']=_[_0xc673('0x17')](config[_0xc673('0x18')],{'host':_0xc673('0x19'),'port':0x18eb});var socket=require(_0xc673('0x1a'))(new Redis(config[_0xc673('0x18')]));require('./chatQueue.socket')[_0xc673('0x1b')](socket);var jayson=require(_0xc673('0x1c'));var client=jayson[_0xc673('0x1d')][_0xc673('0x1e')]({'port':0x232a});function checkPasswordPattern(_0xd365f0,_0x15a090,_0x1bd728){if(_0x1bd728){var _0x109461=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x109461[_0xc673('0x1f')](_0x15a090)){return _0xd365f0;}else{throw new Error(_0xc673('0x20'));}}else{return _0xd365f0;}}function respondWithRpcPromise(_0x4548ff,_0x1130fa,_0x3205fa,_0x211081){return new BPromise(function(_0x342944,_0x4af1e6){var _0x6ac249=_0x211081||client;return _0x6ac249[_0xc673('0x21')](_0x4548ff,_0x3205fa)[_0xc673('0x22')](function(_0x7a47ef){logger[_0xc673('0x23')](_0xc673('0x24'),_0x1130fa,_0xc673('0x25'));logger[_0xc673('0x26')](_0xc673('0x27'),_0x1130fa,_0xc673('0x25'),JSON[_0xc673('0x28')](_0x7a47ef));if(_0x7a47ef['error']){if(_0x7a47ef['error'][_0xc673('0x29')]===0x1f4){logger[_0xc673('0x2a')](_0xc673('0x24'),_0x1130fa,_0x7a47ef['error'][_0xc673('0x2b')]);return _0x4af1e6(_0x7a47ef[_0xc673('0x2a')][_0xc673('0x2b')]);}logger['error'](_0xc673('0x24'),_0x1130fa,_0x7a47ef[_0xc673('0x2a')][_0xc673('0x2b')]);return _0x342944(_0x7a47ef[_0xc673('0x2a')]['message']);}else{logger[_0xc673('0x23')](_0xc673('0x24'),_0x1130fa,_0xc673('0x25'));_0x342944(_0x7a47ef[_0xc673('0x2c')]['message']);}})[_0xc673('0x2d')](function(_0x234915){logger[_0xc673('0x2a')](_0xc673('0x24'),_0x1130fa,_0x234915);_0x4af1e6(_0x234915);});});}function respondWithStatusCode(_0x173e0b,_0x3c8370){_0x3c8370=_0x3c8370||0xcc;return function(_0x9787ec){if(_0x9787ec){return _0x173e0b[_0xc673('0x2e')](_0x3c8370);}return _0x173e0b['status'](_0x3c8370)['end']();};}function respondWithResult(_0x13ea20,_0xbfcf78){_0xbfcf78=_0xbfcf78||0xc8;return function(_0x140984){if(_0x140984){return _0x13ea20[_0xc673('0x2f')](_0xbfcf78)[_0xc673('0x30')](_0x140984);}};}function respondWithFilteredResult(_0x3151a4,_0x225eba){return function(_0x1e31a2){if(_0x1e31a2){var _0xf6afc5=_0x1e31a2[_0xc673('0x31')],_0x286e2a=_0x225eba[_0xc673('0x32')],_0x4a528d=_0x225eba[_0xc673('0x32')]+_0x225eba['limit'],_0x2f6d2a;if(_0x4a528d>=_0xf6afc5){_0x4a528d=_0xf6afc5;_0x2f6d2a=0xc8;}else{_0x2f6d2a=0xce;}_0x3151a4[_0xc673('0x2f')](_0x2f6d2a);return _0x3151a4[_0xc673('0x33')]('Content-Range',_0x286e2a+'-'+_0x4a528d+'/'+_0xf6afc5)[_0xc673('0x30')](_0x1e31a2);}return null;};}function patchUpdates(_0x422949){return function(_0x42f343){try{jsonpatch[_0xc673('0x34')](_0x42f343,_0x422949,!![]);}catch(_0x4a48b6){return BPromise[_0xc673('0x35')](_0x4a48b6);}return _0x42f343[_0xc673('0x36')]();};}function saveUpdates(_0x549e35,_0x2c8600){return function(_0x259a65){if(_0x259a65){return _0x259a65[_0xc673('0x37')](_0x549e35)[_0xc673('0x22')](function(_0x30bef4){return _0x30bef4;});}return null;};}function removeEntity(_0x317fd4,_0x47c545){return function(_0x5e8780){if(_0x5e8780){return _0x5e8780[_0xc673('0x38')]()['then'](function(){var _0x5cba9d=_0x5e8780['get']({'plain':!![]});var _0x519d9b=_0xc673('0x39');return db[_0xc673('0x3a')][_0xc673('0x38')]({'where':{'type':_0x519d9b,'resourceId':_0x5cba9d['id']}})[_0xc673('0x22')](function(){return _0x5e8780;});})[_0xc673('0x22')](function(){_0x317fd4[_0xc673('0x2f')](0xcc)[_0xc673('0x3b')]();});}};}function handleEntityNotFound(_0x4e3e8b,_0x62d2b2){return function(_0x28943e){if(!_0x28943e){_0x4e3e8b[_0xc673('0x2e')](0x194);}return _0x28943e;};}function handleError(_0x5116dd,_0x140895){_0x140895=_0x140895||0x1f4;return function(_0x37460b){logger['error'](_0x37460b[_0xc673('0x3c')]);if(_0x37460b[_0xc673('0x3d')]){delete _0x37460b[_0xc673('0x3d')];}_0x5116dd[_0xc673('0x2f')](_0x140895)[_0xc673('0x3e')](_0x37460b);};}exports['index']=function(_0x557f15,_0x56ef3e){var _0x37ea60={},_0x5b4482={},_0x49583b={'count':0x0,'rows':[]};var _0x4eda38=db[_0xc673('0x3f')][_0xc673('0x40')];_0x5b4482[_0xc673('0x41')]=_[_0xc673('0x42')](_0x4eda38);_0x5b4482['query']=_['keys'](_0x557f15['query']);_0x5b4482[_0xc673('0x43')]=_[_0xc673('0x44')](_0x5b4482[_0xc673('0x41')],_0x5b4482[_0xc673('0x45')]);_0x37ea60[_0xc673('0x46')]=_[_0xc673('0x44')](_0x5b4482[_0xc673('0x41')],qs[_0xc673('0x47')](_0x557f15[_0xc673('0x45')]['fields']));_0x37ea60['attributes']=_0x37ea60[_0xc673('0x46')][_0xc673('0x48')]?_0x37ea60[_0xc673('0x46')]:_0x5b4482[_0xc673('0x41')];if(!_0x557f15[_0xc673('0x45')]['hasOwnProperty'](_0xc673('0x49'))){_0x37ea60[_0xc673('0x4a')]=qs[_0xc673('0x4a')](_0x557f15[_0xc673('0x45')][_0xc673('0x4a')]);_0x37ea60[_0xc673('0x32')]=qs['offset'](_0x557f15['query'][_0xc673('0x32')]);}_0x37ea60[_0xc673('0x4b')]=qs[_0xc673('0x4c')](_0x557f15[_0xc673('0x45')][_0xc673('0x4c')]);_0x37ea60[_0xc673('0x4d')]=qs[_0xc673('0x43')](_[_0xc673('0x4e')](_0x557f15[_0xc673('0x45')],_0x5b4482[_0xc673('0x43')]));if(_0x557f15[_0xc673('0x45')]['filter']){_0x37ea60['where']=_[_0xc673('0x4f')](_0x37ea60['where'],{'$or':_['map'](_0x4eda38,function(_0x4263e9){if(_0x4263e9[_0xc673('0x50')][_0xc673('0x51')]!==_0xc673('0x52')){var _0x1f2792={};_0x1f2792[_0x4263e9['field']]={'$like':'%'+_0x557f15['query'][_0xc673('0x53')]+'%'};return _0x1f2792;}})});}_0x37ea60=_['merge']({},_0x37ea60,_0x557f15[_0xc673('0x54')]);var _0x5c22dd={'where':_0x37ea60[_0xc673('0x4d')]};return db[_0xc673('0x3f')][_0xc673('0x31')](_0x5c22dd)[_0xc673('0x22')](function(_0x255116){_0x49583b[_0xc673('0x31')]=_0x255116;if(_0x557f15[_0xc673('0x45')]['includeAll']){_0x37ea60['include']=[{'all':!![]}];}return db['ChatQueue'][_0xc673('0x55')](_0x37ea60);})[_0xc673('0x22')](function(_0x14d1a4){_0x49583b[_0xc673('0x56')]=_0x14d1a4;return _0x49583b;})[_0xc673('0x22')](respondWithFilteredResult(_0x56ef3e,_0x37ea60))[_0xc673('0x2d')](handleError(_0x56ef3e,null));};exports[_0xc673('0x57')]=function(_0x3019c3,_0x588b2a){var _0x3b4f49={'raw':!![],'where':{'id':_0x3019c3['params']['id']}},_0x50f285={};_0x50f285[_0xc673('0x41')]=_[_0xc673('0x42')](db['ChatQueue'][_0xc673('0x40')]);_0x50f285['query']=_[_0xc673('0x42')](_0x3019c3[_0xc673('0x45')]);_0x50f285[_0xc673('0x43')]=_[_0xc673('0x44')](_0x50f285[_0xc673('0x41')],_0x50f285[_0xc673('0x45')]);_0x3b4f49[_0xc673('0x46')]=_['intersection'](_0x50f285[_0xc673('0x41')],qs[_0xc673('0x47')](_0x3019c3[_0xc673('0x45')][_0xc673('0x47')]));_0x3b4f49[_0xc673('0x46')]=_0x3b4f49[_0xc673('0x46')][_0xc673('0x48')]?_0x3b4f49[_0xc673('0x46')]:_0x50f285[_0xc673('0x41')];if(_0x3019c3[_0xc673('0x45')][_0xc673('0x58')]){_0x3b4f49['include']=[{'all':!![]}];}_0x3b4f49=_[_0xc673('0x4f')]({},_0x3b4f49,_0x3019c3[_0xc673('0x54')]);return db[_0xc673('0x3f')][_0xc673('0x59')](_0x3b4f49)[_0xc673('0x22')](handleEntityNotFound(_0x588b2a,null))[_0xc673('0x22')](respondWithResult(_0x588b2a,null))[_0xc673('0x2d')](handleError(_0x588b2a,null));};exports['create']=function(_0x2fc269,_0x5b1da2){return db['ChatQueue'][_0xc673('0x5a')](_0x2fc269[_0xc673('0x5b')],{})['then'](function(_0x134a7d){var _0x28f0e5=_0x2fc269[_0xc673('0x5c')]['get']({'plain':!![]});if(!_0x28f0e5)throw new Error(_0xc673('0x5d'));if(_0x28f0e5['role']===_0xc673('0x5c')){var _0x157091=_0x134a7d['get']({'plain':!![]});var _0x29b07d=_0xc673('0x39');return db[_0xc673('0x5e')]['find']({'where':{'name':_0x29b07d,'userProfileId':_0x28f0e5['userProfileId']},'raw':!![]})[_0xc673('0x22')](function(_0x871fd0){if(_0x871fd0&&_0x871fd0[_0xc673('0x5f')]===0x0){return db[_0xc673('0x3a')][_0xc673('0x5a')]({'name':_0x157091['name'],'resourceId':_0x157091['id'],'type':_0x871fd0[_0xc673('0x3d')],'sectionId':_0x871fd0['id']},{})[_0xc673('0x22')](function(){return _0x134a7d;});}else{return _0x134a7d;}})[_0xc673('0x2d')](function(_0x5ef0e5){logger[_0xc673('0x2a')](_0xc673('0x60'),_0x5ef0e5);throw _0x5ef0e5;});}return _0x134a7d;})[_0xc673('0x22')](respondWithResult(_0x5b1da2,0xc9))['catch'](handleError(_0x5b1da2,null));};exports['update']=function(_0x5463d6,_0xb45797){if(_0x5463d6['body']['id']){delete _0x5463d6[_0xc673('0x5b')]['id'];}return db['ChatQueue'][_0xc673('0x59')]({'where':{'id':_0x5463d6[_0xc673('0x61')]['id']}})[_0xc673('0x22')](handleEntityNotFound(_0xb45797,null))[_0xc673('0x22')](saveUpdates(_0x5463d6['body'],null))[_0xc673('0x22')](respondWithResult(_0xb45797,null))[_0xc673('0x2d')](handleError(_0xb45797,null));};exports[_0xc673('0x38')]=function(_0x385811,_0x51f152){return db[_0xc673('0x3f')]['find']({'where':{'id':_0x385811[_0xc673('0x61')]['id']}})['then'](handleEntityNotFound(_0x51f152,null))[_0xc673('0x22')](removeEntity(_0x51f152,null))[_0xc673('0x2d')](handleError(_0x51f152,null));};exports['describe']=function(_0x361417,_0x4f988d){return db[_0xc673('0x3f')][_0xc673('0x62')]()[_0xc673('0x22')](respondWithResult(_0x4f988d,null))[_0xc673('0x2d')](handleError(_0x4f988d,null));};exports[_0xc673('0x63')]=function(_0x4bf5ac,_0x42af8e,_0x2a6824){var _0x454c99={'raw':!![],'where':{}},_0x4e2862={},_0x5f4c8a;return db[_0xc673('0x3f')][_0xc673('0x64')]({'where':{'id':_0x4bf5ac[_0xc673('0x61')]['id']}})['then'](handleEntityNotFound(_0x42af8e,null))['then'](function(_0x3c717e){if(_0x3c717e){_0x5f4c8a=_0x3c717e[_0xc673('0x65')]({'plain':!![]});_0x4e2862['model']=_['keys'](db[_0xc673('0x66')][_0xc673('0x40')]);_0x4e2862[_0xc673('0x45')]=_['keys'](_0x4bf5ac[_0xc673('0x45')]);_0x4e2862['filters']=_[_0xc673('0x44')](_0x4e2862[_0xc673('0x41')],_0x4e2862[_0xc673('0x45')]);_0x454c99['attributes']=_['intersection'](_0x4e2862[_0xc673('0x41')],qs[_0xc673('0x47')](_0x4bf5ac['query'][_0xc673('0x47')]));_0x454c99[_0xc673('0x46')]=_0x454c99[_0xc673('0x46')][_0xc673('0x48')]?_0x454c99['attributes']:_0x4e2862[_0xc673('0x41')];if(!_0x4bf5ac[_0xc673('0x45')][_0xc673('0x67')](_0xc673('0x49'))){_0x454c99[_0xc673('0x4a')]=qs[_0xc673('0x4a')](_0x4bf5ac[_0xc673('0x45')][_0xc673('0x4a')]);_0x454c99[_0xc673('0x32')]=qs[_0xc673('0x32')](_0x4bf5ac['query'][_0xc673('0x32')]);}_0x454c99[_0xc673('0x4b')]=qs[_0xc673('0x4c')](_0x4bf5ac[_0xc673('0x45')][_0xc673('0x4c')]);_0x454c99[_0xc673('0x4d')]=qs[_0xc673('0x43')](_[_0xc673('0x4e')](_0x4bf5ac[_0xc673('0x45')],_0x4e2862[_0xc673('0x43')]));_0x454c99['where'][_0xc673('0x68')]=_0x3c717e['id'];if(_0x4bf5ac[_0xc673('0x45')][_0xc673('0x53')]){_0x454c99[_0xc673('0x4d')]=_[_0xc673('0x4f')](_0x454c99[_0xc673('0x4d')],{'$or':_[_0xc673('0x69')](_0x454c99[_0xc673('0x46')],function(_0x1e4d83){var _0x331d70={};_0x331d70[_0x1e4d83]={'$like':'%'+_0x4bf5ac[_0xc673('0x45')]['filter']+'%'};return _0x331d70;})});}_0x454c99=_[_0xc673('0x4f')]({},_0x454c99,_0x4bf5ac[_0xc673('0x54')]);return db['UserChatQueue'][_0xc673('0x55')](_0x454c99);}})[_0xc673('0x22')](function(_0x35c50e){if(_0x35c50e){return db[_0xc673('0x6a')][_0xc673('0x6b')]({'where':{'id':_[_0xc673('0x69')](_0x35c50e,_0xc673('0x6c')),'role':_0xc673('0x6d')},'attributes':['id','name','chatPause',_0xc673('0x6e'),_0xc673('0x6f')]});}})[_0xc673('0x22')](function(_0x267021){if(_0x267021){return{'count':_0x267021['count'],'rows':_[_0xc673('0x69')](_0x267021[_0xc673('0x56')],function(_0x4de328){return{'membername':_0x4de328[_0xc673('0x3d')],'UserId':_0x4de328['id'],'queue_name':_0x5f4c8a['name'],'ChatQueueId':_0x5f4c8a['id'],'interface':util[_0xc673('0x70')](_0xc673('0x71'),_0xc673('0x72'),_0x4de328[_0xc673('0x3d')]),'penalty':0x0,'paused':_0x4de328[_0xc673('0x73')],'createdAt':_0x4de328['createdAt'],'updatedAt':_0x4de328[_0xc673('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc673('0x22')](respondWithFilteredResult(_0x42af8e,_0x454c99))[_0xc673('0x2d')](handleError(_0x42af8e,null));};exports[_0xc673('0x74')]=function(_0x17b24f,_0x53ec29,_0x53b728){var _0x1d23c8={};var _0x474d24={};var _0x2bb347;var _0xa15474;return db['ChatQueue']['findOne']({'where':{'id':_0x17b24f[_0xc673('0x61')]['id']}})[_0xc673('0x22')](handleEntityNotFound(_0x53ec29,null))['then'](function(_0x178e99){if(_0x178e99){_0x2bb347=_0x178e99;_0x474d24[_0xc673('0x41')]=_['keys'](db[_0xc673('0x75')][_0xc673('0x40')]);_0x474d24[_0xc673('0x45')]=_[_0xc673('0x42')](_0x17b24f[_0xc673('0x45')]);_0x474d24[_0xc673('0x43')]=_['intersection'](_0x474d24[_0xc673('0x41')],_0x474d24[_0xc673('0x45')]);_0x1d23c8[_0xc673('0x46')]=_[_0xc673('0x44')](_0x474d24[_0xc673('0x41')],qs[_0xc673('0x47')](_0x17b24f[_0xc673('0x45')]['fields']));_0x1d23c8[_0xc673('0x46')]=_0x1d23c8['attributes'][_0xc673('0x48')]?_0x1d23c8['attributes']:_0x474d24[_0xc673('0x41')];_0x1d23c8[_0xc673('0x4b')]=qs['sort'](_0x17b24f['query']['sort']);_0x1d23c8[_0xc673('0x4d')]=qs[_0xc673('0x43')](_[_0xc673('0x4e')](_0x17b24f[_0xc673('0x45')],_0x474d24[_0xc673('0x43')]));if(_0x17b24f[_0xc673('0x45')][_0xc673('0x53')]){_0x1d23c8[_0xc673('0x4d')]=_[_0xc673('0x4f')](_0x1d23c8['where'],{'$or':_['map'](_0x1d23c8[_0xc673('0x46')],function(_0x2dbba4){var _0x1777d9={};_0x1777d9[_0x2dbba4]={'$like':'%'+_0x17b24f[_0xc673('0x45')][_0xc673('0x53')]+'%'};return _0x1777d9;})});}_0x1d23c8=_[_0xc673('0x4f')]({},_0x1d23c8,_0x17b24f[_0xc673('0x54')]);return _0x2bb347['getTeams'](_0x1d23c8);}})['then'](function(_0x4fd0f3){if(_0x4fd0f3){_0xa15474=_0x4fd0f3[_0xc673('0x48')];if(!_0x17b24f[_0xc673('0x45')][_0xc673('0x67')](_0xc673('0x49'))){_0x1d23c8[_0xc673('0x4a')]=qs[_0xc673('0x4a')](_0x17b24f[_0xc673('0x45')][_0xc673('0x4a')]);_0x1d23c8[_0xc673('0x32')]=qs[_0xc673('0x32')](_0x17b24f[_0xc673('0x45')]['offset']);}return _0x2bb347[_0xc673('0x74')](_0x1d23c8);}})['then'](function(_0x78febc){if(_0x78febc){return _0x78febc?{'count':_0xa15474,'rows':_0x78febc}:null;}})[_0xc673('0x22')](respondWithResult(_0x53ec29,null))[_0xc673('0x2d')](handleError(_0x53ec29,null));};exports['addTeams']=function(_0x341a98,_0x2ab7d0,_0x40f2bc){var _0x4b0b9a=_0x341a98[_0xc673('0x5b')]['teams'];return db[_0xc673('0x75')][_0xc673('0x55')]({'where':{'id':_[_0xc673('0x69')](_0x4b0b9a,'id')},'attributes':['id'],'include':[{'model':db[_0xc673('0x6a')],'as':_0xc673('0x76'),'attributes':['id',_0xc673('0x3d'),_0xc673('0x77'),_0xc673('0x78'),_0xc673('0x79')],'raw':!![]}]})[_0xc673('0x22')](function(_0x1866dd){if(_0x1866dd){var _0x4f6df0=_[_0xc673('0x7a')](_0x1866dd,function(_0x5353ef){var _0x5ef0ed=_0x5353ef[_0xc673('0x65')]({'plain':!![]});return _0x5ef0ed[_0xc673('0x76')];});return db[_0xc673('0x3f')][_0xc673('0x59')]({'where':{'id':_0x341a98[_0xc673('0x61')]['id']}})[_0xc673('0x22')](function(_0x405b5a){return db[_0xc673('0x7b')][_0xc673('0x7c')](function(_0x5a6401){return _0x405b5a[_0xc673('0x7d')](_[_0xc673('0x69')](_0x4b0b9a,'id'),{'transaction':_0x5a6401})[_0xc673('0x22')](function(){return BPromise[_0xc673('0x7e')](_0x4f6df0,function(_0x390165){return db['UserChatQueue'][_0xc673('0x7f')]({'where':{'UserId':_0x390165['id'],'ChatQueueId':_0x341a98[_0xc673('0x61')]['id']},'transaction':_0x5a6401});});})[_0xc673('0x22')](function(){_0x4f6df0['forEach'](function(_0x22d42f){socket[_0xc673('0x80')]('userChatQueue:save',{'UserId':_0x22d42f['id'],'ChatQueueId':_0x405b5a['id']});});});});});}})[_0xc673('0x22')](respondWithStatusCode(_0x2ab7d0,null))[_0xc673('0x2d')](handleError(_0x2ab7d0,null));};exports[_0xc673('0x81')]=function(_0x150dcf,_0x55a497,_0x5cec57){return db[_0xc673('0x75')]['findAll']({'where':{'id':_0x150dcf[_0xc673('0x45')][_0xc673('0x82')]},'attributes':['id'],'include':[{'model':db[_0xc673('0x6a')],'as':_0xc673('0x76'),'attributes':['id'],'raw':!![]}]})[_0xc673('0x22')](handleEntityNotFound(_0x55a497,null))[_0xc673('0x22')](function(_0x5b7eea){var _0x30fce4=_[_0xc673('0x69')](_0x5b7eea,'id');var _0x32f71b=[];var _0x5adc06=[];var _0x47f8ec=squel['select']();_0x47f8ec[_0xc673('0x83')](_0xc673('0x84'))[_0xc673('0x85')](_0xc673('0x86'),'tq')['join'](_0xc673('0x87'),'ut',_0xc673('0x88'))[_0xc673('0x4d')]('ChatQueueId\x20=\x20?',_0x150dcf['params']['id']);for(var _0x1088a5=0x0;_0x1088a5<_0x5b7eea[_0xc673('0x48')];_0x1088a5+=0x1){let _0x360677=_0x5b7eea[_0x1088a5];for(var _0x1e54ec=0x0;_0x1e54ec<_0x360677[_0xc673('0x76')][_0xc673('0x48')];_0x1e54ec+=0x1){let _0x42c57c=_0x360677[_0xc673('0x76')][_0x1e54ec];var _0x4ec46c=_0x47f8ec[_0xc673('0x89')]();_0x4ec46c[_0xc673('0x4d')]('ut.UserId\x20=\x20?',_0x42c57c['id']);_0x5adc06[_0xc673('0x8a')](db[_0xc673('0x7b')][_0xc673('0x45')](_0x4ec46c[_0xc673('0x8b')](),{'type':db[_0xc673('0x7b')]['QueryTypes'][_0xc673('0x8c')]})[_0xc673('0x22')](function(_0x2c3650){if(_0x2c3650[_0xc673('0x48')]===0x1){return _0x42c57c['id'];}else{var _0x1b269e=_[_0xc673('0x8d')](_[_0xc673('0x69')](_0x2c3650,_0xc673('0x8e')),function(_0x30df38){return _['includes'](_0x30fce4,_0x30df38);});if(_0x1b269e){return _0x42c57c['id'];}}}));}}return BPromise[_0xc673('0x8f')](_0x5adc06)[_0xc673('0x22')](function(_0x219de6){_0x32f71b=_(_0x32f71b)['union'](_0x219de6)['compact']()[_0xc673('0x90')]();return db[_0xc673('0x3f')][_0xc673('0x59')]({'where':{'id':_0x150dcf[_0xc673('0x61')]['id']}})[_0xc673('0x22')](function(_0x3b6e7a){return db[_0xc673('0x7b')][_0xc673('0x7c')](function(_0x3a5156){return _0x3b6e7a[_0xc673('0x81')](_0x150dcf[_0xc673('0x45')][_0xc673('0x82')],{'transaction':_0x3a5156})[_0xc673('0x22')](function(){if(!_['isEmpty'](_0x32f71b)){return _0x3b6e7a['removeAgents'](_0x32f71b,{'transaction':_0x3a5156});}})[_0xc673('0x22')](function(){_0x32f71b['forEach'](function(_0x392845){socket[_0xc673('0x80')](_0xc673('0x91'),{'UserId':_0x392845,'ChatQueueId':_0x3b6e7a['id']});});});});});});})[_0xc673('0x22')](respondWithStatusCode(_0x55a497,null))[_0xc673('0x2d')](handleError(_0x55a497,null));};exports[_0xc673('0x92')]=function(_0x5a6481,_0x375b34,_0xa1463f){return db[_0xc673('0x3f')][_0xc673('0x59')]({'where':{'id':_0x5a6481[_0xc673('0x61')]['id']}})[_0xc673('0x22')](handleEntityNotFound(_0x375b34,null))['then'](function(_0x5e6622){if(_0x5e6622){return _0x5e6622['addAgents'](_0x5a6481[_0xc673('0x5b')]['ids'],_[_0xc673('0x93')](_0x5a6481[_0xc673('0x5b')],['ids','id'])||{})['spread'](function(_0x1d6292){for(var _0x735de=0x0;_0x735de<_0x5a6481[_0xc673('0x5b')][_0xc673('0x82')][_0xc673('0x48')];_0x735de+=0x1){socket[_0xc673('0x80')]('userChatQueue:save',{'UserId':_0x5a6481[_0xc673('0x5b')][_0xc673('0x82')][_0x735de],'ChatQueueId':_0x5a6481[_0xc673('0x61')]['id']});}return _0x1d6292;});}})['then'](respondWithResult(_0x375b34,null))[_0xc673('0x2d')](handleError(_0x375b34,null));};exports[_0xc673('0x94')]=function(_0x11cb42,_0x4eaa33,_0x86591f){return db[_0xc673('0x3f')][_0xc673('0x59')]({'where':{'id':_0x11cb42[_0xc673('0x61')]['id']}})[_0xc673('0x22')](handleEntityNotFound(_0x4eaa33,null))[_0xc673('0x22')](function(_0x26aeff){if(_0x26aeff){return _0x26aeff[_0xc673('0x94')](_0x11cb42['query'][_0xc673('0x82')])[_0xc673('0x22')](function(){if(_[_0xc673('0x95')](_0x11cb42['query'][_0xc673('0x82')])){for(var _0x38541a=0x0;_0x38541a<_0x11cb42[_0xc673('0x45')][_0xc673('0x82')][_0xc673('0x48')];_0x38541a+=0x1){socket[_0xc673('0x80')](_0xc673('0x91'),{'UserId':Number(_0x11cb42[_0xc673('0x45')][_0xc673('0x82')][_0x38541a]),'ChatQueueId':Number(_0x11cb42[_0xc673('0x61')]['id'])});}}else{socket[_0xc673('0x80')](_0xc673('0x91'),{'UserId':Number(_0x11cb42[_0xc673('0x45')][_0xc673('0x82')]),'ChatQueueId':Number(_0x11cb42['params']['id'])});}});}})[_0xc673('0x22')](respondWithStatusCode(_0x4eaa33,null))[_0xc673('0x2d')](handleError(_0x4eaa33,null));};exports[_0xc673('0x96')]=function(_0x3ea34a,_0x54b6d7,_0x5274c3){var _0x2e835a={};var _0x54caf5={};var _0x1cbf2f;var _0x2ec76c;return db['ChatQueue']['findOne']({'where':{'id':_0x3ea34a['params']['id']}})[_0xc673('0x22')](handleEntityNotFound(_0x54b6d7,null))[_0xc673('0x22')](function(_0x5da74e){if(_0x5da74e){_0x1cbf2f=_0x5da74e;_0x54caf5[_0xc673('0x41')]=_[_0xc673('0x42')](db[_0xc673('0x6a')][_0xc673('0x40')]);_0x54caf5[_0xc673('0x45')]=_['keys'](_0x3ea34a['query']);_0x54caf5[_0xc673('0x43')]=_[_0xc673('0x44')](_0x54caf5['model'],_0x54caf5[_0xc673('0x45')]);_0x2e835a[_0xc673('0x46')]=_[_0xc673('0x44')](_0x54caf5[_0xc673('0x41')],qs[_0xc673('0x47')](_0x3ea34a[_0xc673('0x45')][_0xc673('0x47')]));_0x2e835a['attributes']=_0x2e835a[_0xc673('0x46')]['length']?_0x2e835a[_0xc673('0x46')]:_0x54caf5[_0xc673('0x41')];_0x2e835a['order']=qs['sort'](_0x3ea34a[_0xc673('0x45')][_0xc673('0x4c')]);_0x2e835a[_0xc673('0x4d')]=qs[_0xc673('0x43')](_[_0xc673('0x4e')](_0x3ea34a[_0xc673('0x45')],_0x54caf5[_0xc673('0x43')]));if(_0x3ea34a[_0xc673('0x45')][_0xc673('0x53')]){_0x2e835a[_0xc673('0x4d')]=_[_0xc673('0x4f')](_0x2e835a['where'],{'$or':_['map'](_0x2e835a['attributes'],function(_0x44e8e3){var _0x449315={};_0x449315[_0x44e8e3]={'$like':'%'+_0x3ea34a['query'][_0xc673('0x53')]+'%'};return _0x449315;})});}_0x2e835a=_[_0xc673('0x4f')]({},_0x2e835a,_0x3ea34a[_0xc673('0x54')]);return _0x1cbf2f[_0xc673('0x96')](_0x2e835a);}})[_0xc673('0x22')](function(_0xf37610){if(_0xf37610){_0x2ec76c=_0xf37610[_0xc673('0x48')];if(!_0x3ea34a[_0xc673('0x45')][_0xc673('0x67')](_0xc673('0x49'))){_0x2e835a[_0xc673('0x4a')]=qs['limit'](_0x3ea34a[_0xc673('0x45')][_0xc673('0x4a')]);_0x2e835a[_0xc673('0x32')]=qs[_0xc673('0x32')](_0x3ea34a[_0xc673('0x45')]['offset']);}return _0x1cbf2f[_0xc673('0x96')](_0x2e835a);}})[_0xc673('0x22')](function(_0x18916b){if(_0x18916b){return _0x18916b?{'count':_0x2ec76c,'rows':_0x18916b}:null;}})[_0xc673('0x22')](respondWithResult(_0x54b6d7,null))[_0xc673('0x2d')](handleError(_0x54b6d7,null));}; \ No newline at end of file +var _0x237d=['isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','lodash','squel','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','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','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','rawAttributes','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','key','field','filter','options','ChatQueue','includeAll','include','findAll','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','ChatQueueId','map','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','format','%s/%s','SIP','createdAt','findOne','Team','getTeams','addTeams','teams','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','ids','select','tq.TeamId','from','team_has_chat_queues','user_has_teams','clone','push','toString','sequelize','SELECT','every','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread'];(function(_0x3d6c3b,_0x54f5e4){var _0x2675f=function(_0x4a4ff8){while(--_0x4a4ff8){_0x3d6c3b['push'](_0x3d6c3b['shift']());}};_0x2675f(++_0x54f5e4);}(_0x237d,0x1cd));var _0xd237=function(_0x38a1ad,_0x34600d){_0x38a1ad=_0x38a1ad-0x0;var _0x3c7b11=_0x237d[_0x38a1ad];return _0x3c7b11;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd237('0x0'));var rimraf=require(_0xd237('0x1'));var zipdir=require(_0xd237('0x2'));var jsonpatch=require(_0xd237('0x3'));var rp=require(_0xd237('0x4'));var moment=require(_0xd237('0x5'));var BPromise=require(_0xd237('0x6'));var Mustache=require(_0xd237('0x7'));var util=require(_0xd237('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xd237('0x9'));var squel=require(_0xd237('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd237('0xb'));var toCsv=require(_0xd237('0xc'));var querystring=require(_0xd237('0xd'));var Papa=require(_0xd237('0xe'));var Redis=require(_0xd237('0xf'));var authService=require(_0xd237('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd237('0x11'));var logger=require(_0xd237('0x12'))(_0xd237('0x13'));var utils=require('../../config/utils');var config=require(_0xd237('0x14'));var db=require('../../mysqldb')['db'];config[_0xd237('0x15')]=_[_0xd237('0x16')](config[_0xd237('0x15')],{'host':_0xd237('0x17'),'port':0x18eb});var socket=require(_0xd237('0x18'))(new Redis(config[_0xd237('0x15')]));require('./chatQueue.socket')[_0xd237('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd237('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x1fa804,_0x4c1fed,_0x13eede){if(_0x13eede){var _0x10f9a8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x10f9a8[_0xd237('0x1b')](_0x4c1fed)){return _0x1fa804;}else{throw new Error(_0xd237('0x1c'));}}else{return _0x1fa804;}}function respondWithRpcPromise(_0x35c57f,_0x127fe5,_0x4354b6,_0x32fd66){return new BPromise(function(_0x3e2ef0,_0x48d9c1){var _0x51b16=_0x32fd66||client;return _0x51b16[_0xd237('0x1d')](_0x35c57f,_0x4354b6)['then'](function(_0x3d8027){logger['info'](_0xd237('0x1e'),_0x127fe5,_0xd237('0x1f'));logger[_0xd237('0x20')](_0xd237('0x21'),_0x127fe5,_0xd237('0x1f'),JSON[_0xd237('0x22')](_0x3d8027));if(_0x3d8027['error']){if(_0x3d8027[_0xd237('0x23')][_0xd237('0x24')]===0x1f4){logger['error'](_0xd237('0x1e'),_0x127fe5,_0x3d8027[_0xd237('0x23')][_0xd237('0x25')]);return _0x48d9c1(_0x3d8027[_0xd237('0x23')]['message']);}logger[_0xd237('0x23')](_0xd237('0x1e'),_0x127fe5,_0x3d8027['error'][_0xd237('0x25')]);return _0x3e2ef0(_0x3d8027['error'][_0xd237('0x25')]);}else{logger[_0xd237('0x26')](_0xd237('0x1e'),_0x127fe5,_0xd237('0x1f'));_0x3e2ef0(_0x3d8027[_0xd237('0x27')][_0xd237('0x25')]);}})[_0xd237('0x28')](function(_0x50d6c2){logger['error']('ChatQueue,\x20%s,\x20%s',_0x127fe5,_0x50d6c2);_0x48d9c1(_0x50d6c2);});});}function respondWithStatusCode(_0x547a0f,_0x390e02){_0x390e02=_0x390e02||0xcc;return function(_0x28404b){if(_0x28404b){return _0x547a0f['sendStatus'](_0x390e02);}return _0x547a0f[_0xd237('0x29')](_0x390e02)[_0xd237('0x2a')]();};}function respondWithResult(_0x476bb9,_0xc44b80){_0xc44b80=_0xc44b80||0xc8;return function(_0x489c4f){if(_0x489c4f){return _0x476bb9[_0xd237('0x29')](_0xc44b80)[_0xd237('0x2b')](_0x489c4f);}};}function respondWithFilteredResult(_0x4a8878,_0x2e4421){return function(_0x535fb3){if(_0x535fb3){var _0x43a043=_0x535fb3[_0xd237('0x2c')],_0x421cb2=_0x2e4421['offset'],_0x342efe=_0x2e4421[_0xd237('0x2d')]+_0x2e4421[_0xd237('0x2e')],_0x1a8055;if(_0x342efe>=_0x43a043){_0x342efe=_0x43a043;_0x1a8055=0xc8;}else{_0x1a8055=0xce;}_0x4a8878[_0xd237('0x29')](_0x1a8055);return _0x4a8878[_0xd237('0x2f')](_0xd237('0x30'),_0x421cb2+'-'+_0x342efe+'/'+_0x43a043)[_0xd237('0x2b')](_0x535fb3);}return null;};}function patchUpdates(_0x115884){return function(_0x199edb){try{jsonpatch['apply'](_0x199edb,_0x115884,!![]);}catch(_0x436f8a){return BPromise[_0xd237('0x31')](_0x436f8a);}return _0x199edb['save']();};}function saveUpdates(_0x35a28d,_0x2cc33e){return function(_0x25e865){if(_0x25e865){return _0x25e865[_0xd237('0x32')](_0x35a28d)[_0xd237('0x33')](function(_0x28dbc9){return _0x28dbc9;});}return null;};}function removeEntity(_0x17f0dd,_0x2ae845){return function(_0x243666){if(_0x243666){return _0x243666[_0xd237('0x34')]()[_0xd237('0x33')](function(){var _0x486884=_0x243666[_0xd237('0x35')]({'plain':!![]});var _0x29a30c='ChatQueues';return db[_0xd237('0x36')][_0xd237('0x34')]({'where':{'type':_0x29a30c,'resourceId':_0x486884['id']}})['then'](function(){return _0x243666;});})[_0xd237('0x33')](function(){_0x17f0dd[_0xd237('0x29')](0xcc)[_0xd237('0x2a')]();});}};}function handleEntityNotFound(_0x4f3ad4,_0x51bfe5){return function(_0x2b50b1){if(!_0x2b50b1){_0x4f3ad4[_0xd237('0x37')](0x194);}return _0x2b50b1;};}function handleError(_0x369a08,_0x1ee2be){_0x1ee2be=_0x1ee2be||0x1f4;return function(_0x2346a8){logger[_0xd237('0x23')](_0x2346a8[_0xd237('0x38')]);if(_0x2346a8[_0xd237('0x39')]){delete _0x2346a8['name'];}_0x369a08['status'](_0x1ee2be)[_0xd237('0x3a')](_0x2346a8);};}exports[_0xd237('0x3b')]=function(_0x4e21c9,_0x43fd96){var _0x369ea1={},_0x579202={},_0x45025e={'count':0x0,'rows':[]};var _0x77ac2f=db['ChatQueue'][_0xd237('0x3c')];_0x579202['model']=_[_0xd237('0x3d')](_0x77ac2f);_0x579202[_0xd237('0x3e')]=_[_0xd237('0x3d')](_0x4e21c9['query']);_0x579202['filters']=_[_0xd237('0x3f')](_0x579202[_0xd237('0x40')],_0x579202[_0xd237('0x3e')]);_0x369ea1['attributes']=_[_0xd237('0x3f')](_0x579202[_0xd237('0x40')],qs[_0xd237('0x41')](_0x4e21c9['query'][_0xd237('0x41')]));_0x369ea1['attributes']=_0x369ea1[_0xd237('0x42')][_0xd237('0x43')]?_0x369ea1[_0xd237('0x42')]:_0x579202[_0xd237('0x40')];if(!_0x4e21c9[_0xd237('0x3e')][_0xd237('0x44')](_0xd237('0x45'))){_0x369ea1[_0xd237('0x2e')]=qs['limit'](_0x4e21c9[_0xd237('0x3e')][_0xd237('0x2e')]);_0x369ea1[_0xd237('0x2d')]=qs[_0xd237('0x2d')](_0x4e21c9['query'][_0xd237('0x2d')]);}_0x369ea1[_0xd237('0x46')]=qs[_0xd237('0x47')](_0x4e21c9[_0xd237('0x3e')]['sort']);_0x369ea1[_0xd237('0x48')]=qs[_0xd237('0x49')](_[_0xd237('0x4a')](_0x4e21c9[_0xd237('0x3e')],_0x579202[_0xd237('0x49')]));if(_0x4e21c9[_0xd237('0x3e')]['filter']){_0x369ea1[_0xd237('0x48')]=_[_0xd237('0x4b')](_0x369ea1[_0xd237('0x48')],{'$or':_['map'](_0x77ac2f,function(_0x29dc88){if(_0x29dc88['type'][_0xd237('0x4c')]!=='VIRTUAL'){var _0x55fb03={};_0x55fb03[_0x29dc88[_0xd237('0x4d')]]={'$like':'%'+_0x4e21c9[_0xd237('0x3e')][_0xd237('0x4e')]+'%'};return _0x55fb03;}})});}_0x369ea1=_[_0xd237('0x4b')]({},_0x369ea1,_0x4e21c9[_0xd237('0x4f')]);var _0x5d2006={'where':_0x369ea1[_0xd237('0x48')]};return db[_0xd237('0x50')][_0xd237('0x2c')](_0x5d2006)['then'](function(_0x172fcd){_0x45025e['count']=_0x172fcd;if(_0x4e21c9[_0xd237('0x3e')][_0xd237('0x51')]){_0x369ea1[_0xd237('0x52')]=[{'all':!![]}];}return db[_0xd237('0x50')][_0xd237('0x53')](_0x369ea1);})[_0xd237('0x33')](function(_0x423b68){_0x45025e[_0xd237('0x54')]=_0x423b68;return _0x45025e;})[_0xd237('0x33')](respondWithFilteredResult(_0x43fd96,_0x369ea1))[_0xd237('0x28')](handleError(_0x43fd96,null));};exports[_0xd237('0x55')]=function(_0x43e2d3,_0xa530d6){var _0x2eb20b={'raw':!![],'where':{'id':_0x43e2d3[_0xd237('0x56')]['id']}},_0x111a1c={};_0x111a1c['model']=_[_0xd237('0x3d')](db['ChatQueue']['rawAttributes']);_0x111a1c['query']=_[_0xd237('0x3d')](_0x43e2d3[_0xd237('0x3e')]);_0x111a1c[_0xd237('0x49')]=_[_0xd237('0x3f')](_0x111a1c[_0xd237('0x40')],_0x111a1c[_0xd237('0x3e')]);_0x2eb20b[_0xd237('0x42')]=_[_0xd237('0x3f')](_0x111a1c[_0xd237('0x40')],qs[_0xd237('0x41')](_0x43e2d3[_0xd237('0x3e')][_0xd237('0x41')]));_0x2eb20b[_0xd237('0x42')]=_0x2eb20b[_0xd237('0x42')][_0xd237('0x43')]?_0x2eb20b[_0xd237('0x42')]:_0x111a1c[_0xd237('0x40')];if(_0x43e2d3[_0xd237('0x3e')][_0xd237('0x51')]){_0x2eb20b[_0xd237('0x52')]=[{'all':!![]}];}_0x2eb20b=_[_0xd237('0x4b')]({},_0x2eb20b,_0x43e2d3[_0xd237('0x4f')]);return db[_0xd237('0x50')]['find'](_0x2eb20b)[_0xd237('0x33')](handleEntityNotFound(_0xa530d6,null))['then'](respondWithResult(_0xa530d6,null))[_0xd237('0x28')](handleError(_0xa530d6,null));};exports[_0xd237('0x57')]=function(_0x2f7f69,_0x9b8dab){return db[_0xd237('0x50')]['create'](_0x2f7f69[_0xd237('0x58')],{})[_0xd237('0x33')](function(_0x4de085){var _0x226c50=_0x2f7f69[_0xd237('0x59')][_0xd237('0x35')]({'plain':!![]});if(!_0x226c50)throw new Error(_0xd237('0x5a'));if(_0x226c50[_0xd237('0x5b')]===_0xd237('0x59')){var _0x5d8e72=_0x4de085[_0xd237('0x35')]({'plain':!![]});var _0x5e0d22=_0xd237('0x5c');return db['UserProfileSection']['find']({'where':{'name':_0x5e0d22,'userProfileId':_0x226c50[_0xd237('0x5d')]},'raw':!![]})[_0xd237('0x33')](function(_0x3e430c){if(_0x3e430c&&_0x3e430c[_0xd237('0x5e')]===0x0){return db[_0xd237('0x36')]['create']({'name':_0x5d8e72[_0xd237('0x39')],'resourceId':_0x5d8e72['id'],'type':_0x3e430c[_0xd237('0x39')],'sectionId':_0x3e430c['id']},{})[_0xd237('0x33')](function(){return _0x4de085;});}else{return _0x4de085;}})['catch'](function(_0x4a1cae){logger[_0xd237('0x23')](_0xd237('0x5f'),_0x4a1cae);throw _0x4a1cae;});}return _0x4de085;})['then'](respondWithResult(_0x9b8dab,0xc9))[_0xd237('0x28')](handleError(_0x9b8dab,null));};exports[_0xd237('0x32')]=function(_0x32dc6a,_0x3d36d3){if(_0x32dc6a['body']['id']){delete _0x32dc6a[_0xd237('0x58')]['id'];}return db[_0xd237('0x50')][_0xd237('0x60')]({'where':{'id':_0x32dc6a[_0xd237('0x56')]['id']}})[_0xd237('0x33')](handleEntityNotFound(_0x3d36d3,null))[_0xd237('0x33')](saveUpdates(_0x32dc6a[_0xd237('0x58')],null))[_0xd237('0x33')](respondWithResult(_0x3d36d3,null))[_0xd237('0x28')](handleError(_0x3d36d3,null));};exports[_0xd237('0x34')]=function(_0x29cc03,_0x15c54f){return db[_0xd237('0x50')][_0xd237('0x60')]({'where':{'id':_0x29cc03[_0xd237('0x56')]['id']}})[_0xd237('0x33')](handleEntityNotFound(_0x15c54f,null))[_0xd237('0x33')](removeEntity(_0x15c54f,null))[_0xd237('0x28')](handleError(_0x15c54f,null));};exports[_0xd237('0x61')]=function(_0xa209b,_0x1f4b1d){return db[_0xd237('0x50')][_0xd237('0x61')]()[_0xd237('0x33')](respondWithResult(_0x1f4b1d,null))[_0xd237('0x28')](handleError(_0x1f4b1d,null));};exports['getMembers']=function(_0x6c6287,_0x2d8d70,_0x191d7b){var _0x4c59a6={'raw':!![],'where':{}},_0x17ad91={},_0x3fb67c;return db['ChatQueue']['findOne']({'where':{'id':_0x6c6287[_0xd237('0x56')]['id']}})[_0xd237('0x33')](handleEntityNotFound(_0x2d8d70,null))[_0xd237('0x33')](function(_0x4a9f81){if(_0x4a9f81){_0x3fb67c=_0x4a9f81[_0xd237('0x35')]({'plain':!![]});_0x17ad91['model']=_[_0xd237('0x3d')](db['UserChatQueue'][_0xd237('0x3c')]);_0x17ad91[_0xd237('0x3e')]=_[_0xd237('0x3d')](_0x6c6287['query']);_0x17ad91[_0xd237('0x49')]=_[_0xd237('0x3f')](_0x17ad91[_0xd237('0x40')],_0x17ad91['query']);_0x4c59a6[_0xd237('0x42')]=_[_0xd237('0x3f')](_0x17ad91['model'],qs[_0xd237('0x41')](_0x6c6287[_0xd237('0x3e')][_0xd237('0x41')]));_0x4c59a6[_0xd237('0x42')]=_0x4c59a6[_0xd237('0x42')][_0xd237('0x43')]?_0x4c59a6[_0xd237('0x42')]:_0x17ad91['model'];if(!_0x6c6287[_0xd237('0x3e')]['hasOwnProperty'](_0xd237('0x45'))){_0x4c59a6[_0xd237('0x2e')]=qs[_0xd237('0x2e')](_0x6c6287['query'][_0xd237('0x2e')]);_0x4c59a6[_0xd237('0x2d')]=qs[_0xd237('0x2d')](_0x6c6287[_0xd237('0x3e')][_0xd237('0x2d')]);}_0x4c59a6[_0xd237('0x46')]=qs[_0xd237('0x47')](_0x6c6287[_0xd237('0x3e')][_0xd237('0x47')]);_0x4c59a6['where']=qs[_0xd237('0x49')](_[_0xd237('0x4a')](_0x6c6287[_0xd237('0x3e')],_0x17ad91[_0xd237('0x49')]));_0x4c59a6[_0xd237('0x48')][_0xd237('0x62')]=_0x4a9f81['id'];if(_0x6c6287['query'][_0xd237('0x4e')]){_0x4c59a6[_0xd237('0x48')]=_[_0xd237('0x4b')](_0x4c59a6[_0xd237('0x48')],{'$or':_[_0xd237('0x63')](_0x4c59a6['attributes'],function(_0x3ce2d1){var _0x3f622b={};_0x3f622b[_0x3ce2d1]={'$like':'%'+_0x6c6287['query'][_0xd237('0x4e')]+'%'};return _0x3f622b;})});}_0x4c59a6=_[_0xd237('0x4b')]({},_0x4c59a6,_0x6c6287[_0xd237('0x4f')]);return db[_0xd237('0x64')][_0xd237('0x53')](_0x4c59a6);}})[_0xd237('0x33')](function(_0x52c467){if(_0x52c467){return db[_0xd237('0x65')][_0xd237('0x66')]({'where':{'id':_[_0xd237('0x63')](_0x52c467,_0xd237('0x67')),'role':_0xd237('0x68')},'attributes':['id',_0xd237('0x39'),_0xd237('0x69'),_0xd237('0x6a'),'createdAt']});}})[_0xd237('0x33')](function(_0x3d1f1a){if(_0x3d1f1a){return{'count':_0x3d1f1a[_0xd237('0x2c')],'rows':_[_0xd237('0x63')](_0x3d1f1a[_0xd237('0x54')],function(_0x2b68d2){return{'membername':_0x2b68d2[_0xd237('0x39')],'UserId':_0x2b68d2['id'],'queue_name':_0x3fb67c[_0xd237('0x39')],'ChatQueueId':_0x3fb67c['id'],'interface':util[_0xd237('0x6b')](_0xd237('0x6c'),_0xd237('0x6d'),_0x2b68d2[_0xd237('0x39')]),'penalty':0x0,'paused':_0x2b68d2[_0xd237('0x69')],'createdAt':_0x2b68d2[_0xd237('0x6e')],'updatedAt':_0x2b68d2[_0xd237('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2d8d70,_0x4c59a6))['catch'](handleError(_0x2d8d70,null));};exports['getTeams']=function(_0x54ab5e,_0x41c917,_0x435ea5){var _0x23d3f4={};var _0x2c52dc={};var _0x1f15f1;var _0x3a3141;return db[_0xd237('0x50')][_0xd237('0x6f')]({'where':{'id':_0x54ab5e[_0xd237('0x56')]['id']}})['then'](handleEntityNotFound(_0x41c917,null))['then'](function(_0x2b45db){if(_0x2b45db){_0x1f15f1=_0x2b45db;_0x2c52dc[_0xd237('0x40')]=_[_0xd237('0x3d')](db[_0xd237('0x70')][_0xd237('0x3c')]);_0x2c52dc[_0xd237('0x3e')]=_[_0xd237('0x3d')](_0x54ab5e[_0xd237('0x3e')]);_0x2c52dc[_0xd237('0x49')]=_[_0xd237('0x3f')](_0x2c52dc[_0xd237('0x40')],_0x2c52dc[_0xd237('0x3e')]);_0x23d3f4['attributes']=_[_0xd237('0x3f')](_0x2c52dc['model'],qs[_0xd237('0x41')](_0x54ab5e[_0xd237('0x3e')][_0xd237('0x41')]));_0x23d3f4[_0xd237('0x42')]=_0x23d3f4[_0xd237('0x42')][_0xd237('0x43')]?_0x23d3f4[_0xd237('0x42')]:_0x2c52dc['model'];_0x23d3f4['order']=qs['sort'](_0x54ab5e['query'][_0xd237('0x47')]);_0x23d3f4['where']=qs[_0xd237('0x49')](_[_0xd237('0x4a')](_0x54ab5e[_0xd237('0x3e')],_0x2c52dc['filters']));if(_0x54ab5e['query'][_0xd237('0x4e')]){_0x23d3f4[_0xd237('0x48')]=_[_0xd237('0x4b')](_0x23d3f4[_0xd237('0x48')],{'$or':_[_0xd237('0x63')](_0x23d3f4[_0xd237('0x42')],function(_0x20754b){var _0x1fb232={};_0x1fb232[_0x20754b]={'$like':'%'+_0x54ab5e[_0xd237('0x3e')]['filter']+'%'};return _0x1fb232;})});}_0x23d3f4=_[_0xd237('0x4b')]({},_0x23d3f4,_0x54ab5e['options']);return _0x1f15f1['getTeams'](_0x23d3f4);}})[_0xd237('0x33')](function(_0x12ee14){if(_0x12ee14){_0x3a3141=_0x12ee14[_0xd237('0x43')];if(!_0x54ab5e[_0xd237('0x3e')][_0xd237('0x44')]('nolimit')){_0x23d3f4['limit']=qs[_0xd237('0x2e')](_0x54ab5e['query']['limit']);_0x23d3f4[_0xd237('0x2d')]=qs[_0xd237('0x2d')](_0x54ab5e[_0xd237('0x3e')][_0xd237('0x2d')]);}return _0x1f15f1[_0xd237('0x71')](_0x23d3f4);}})[_0xd237('0x33')](function(_0x2f4882){if(_0x2f4882){return _0x2f4882?{'count':_0x3a3141,'rows':_0x2f4882}:null;}})[_0xd237('0x33')](respondWithResult(_0x41c917,null))[_0xd237('0x28')](handleError(_0x41c917,null));};exports[_0xd237('0x72')]=function(_0xb62b5c,_0x4a646a,_0xc58f71){var _0x1a8212=_0xb62b5c['body'][_0xd237('0x73')];return db[_0xd237('0x70')][_0xd237('0x53')]({'where':{'id':_[_0xd237('0x63')](_0x1a8212,'id')},'attributes':['id'],'include':[{'model':db[_0xd237('0x65')],'as':_0xd237('0x74'),'attributes':['id','name',_0xd237('0x75'),_0xd237('0x76'),_0xd237('0x77')],'raw':!![]}]})[_0xd237('0x33')](function(_0x34c065){if(_0x34c065){var _0x309065=_[_0xd237('0x78')](_0x34c065,function(_0x20ff6f){var _0x3ba59d=_0x20ff6f['get']({'plain':!![]});return _0x3ba59d[_0xd237('0x74')];});return db['ChatQueue'][_0xd237('0x60')]({'where':{'id':_0xb62b5c[_0xd237('0x56')]['id']}})[_0xd237('0x33')](function(_0x1ce65a){return db['sequelize'][_0xd237('0x79')](function(_0x40842b){return _0x1ce65a['addTeams'](_[_0xd237('0x63')](_0x1a8212,'id'),{'transaction':_0x40842b})[_0xd237('0x33')](function(){return BPromise[_0xd237('0x7a')](_0x309065,function(_0x3bce89){return db[_0xd237('0x64')][_0xd237('0x7b')]({'where':{'UserId':_0x3bce89['id'],'ChatQueueId':_0xb62b5c[_0xd237('0x56')]['id']},'transaction':_0x40842b});});})[_0xd237('0x33')](function(){_0x309065[_0xd237('0x7c')](function(_0x23cad9){socket[_0xd237('0x7d')](_0xd237('0x7e'),{'UserId':_0x23cad9['id'],'ChatQueueId':_0x1ce65a['id']});});});});});}})[_0xd237('0x33')](respondWithStatusCode(_0x4a646a,null))[_0xd237('0x28')](handleError(_0x4a646a,null));};exports['removeTeams']=function(_0x11d1a7,_0x33b1c1,_0x253093){return db[_0xd237('0x70')][_0xd237('0x53')]({'where':{'id':_0x11d1a7[_0xd237('0x3e')][_0xd237('0x7f')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xd237('0x33')](handleEntityNotFound(_0x33b1c1,null))[_0xd237('0x33')](function(_0x3e86e8){var _0x557745=_[_0xd237('0x63')](_0x3e86e8,'id');var _0x4b57b8=[];var _0xc2d80e=[];var _0x3e25c1=squel[_0xd237('0x80')]();_0x3e25c1[_0xd237('0x4d')](_0xd237('0x81'))[_0xd237('0x82')](_0xd237('0x83'),'tq')['join'](_0xd237('0x84'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd237('0x48')]('ChatQueueId\x20=\x20?',_0x11d1a7['params']['id']);for(var _0x5d591e=0x0;_0x5d591e<_0x3e86e8[_0xd237('0x43')];_0x5d591e+=0x1){let _0x11e0a2=_0x3e86e8[_0x5d591e];for(var _0x553d23=0x0;_0x553d23<_0x11e0a2[_0xd237('0x74')][_0xd237('0x43')];_0x553d23+=0x1){let _0x246c1f=_0x11e0a2[_0xd237('0x74')][_0x553d23];var _0x1e0251=_0x3e25c1[_0xd237('0x85')]();_0x1e0251[_0xd237('0x48')]('ut.UserId\x20=\x20?',_0x246c1f['id']);_0xc2d80e[_0xd237('0x86')](db['sequelize']['query'](_0x1e0251[_0xd237('0x87')](),{'type':db[_0xd237('0x88')]['QueryTypes'][_0xd237('0x89')]})[_0xd237('0x33')](function(_0x125c64){if(_0x125c64[_0xd237('0x43')]===0x1){return _0x246c1f['id'];}else{var _0x436402=_[_0xd237('0x8a')](_[_0xd237('0x63')](_0x125c64,'TeamId'),function(_0x5473b9){return _[_0xd237('0x8b')](_0x557745,_0x5473b9);});if(_0x436402){return _0x246c1f['id'];}}}));}}return BPromise[_0xd237('0x8c')](_0xc2d80e)[_0xd237('0x33')](function(_0x2436de){_0x4b57b8=_(_0x4b57b8)[_0xd237('0x8d')](_0x2436de)[_0xd237('0x8e')]()[_0xd237('0x8f')]();return db['ChatQueue'][_0xd237('0x60')]({'where':{'id':_0x11d1a7[_0xd237('0x56')]['id']}})[_0xd237('0x33')](function(_0x22dd8e){return db[_0xd237('0x88')]['transaction'](function(_0x1b9ab2){return _0x22dd8e[_0xd237('0x90')](_0x11d1a7['query']['ids'],{'transaction':_0x1b9ab2})[_0xd237('0x33')](function(){if(!_[_0xd237('0x91')](_0x4b57b8)){return _0x22dd8e[_0xd237('0x92')](_0x4b57b8,{'transaction':_0x1b9ab2});}})[_0xd237('0x33')](function(){_0x4b57b8[_0xd237('0x7c')](function(_0xde7ecf){socket[_0xd237('0x7d')](_0xd237('0x93'),{'UserId':_0xde7ecf,'ChatQueueId':_0x22dd8e['id']});});});});});});})['then'](respondWithStatusCode(_0x33b1c1,null))[_0xd237('0x28')](handleError(_0x33b1c1,null));};exports[_0xd237('0x94')]=function(_0x3cc02b,_0x4ce7e7,_0x5b24a6){return db[_0xd237('0x50')][_0xd237('0x60')]({'where':{'id':_0x3cc02b[_0xd237('0x56')]['id']}})[_0xd237('0x33')](handleEntityNotFound(_0x4ce7e7,null))[_0xd237('0x33')](function(_0x30f2d5){if(_0x30f2d5){return _0x30f2d5[_0xd237('0x94')](_0x3cc02b[_0xd237('0x58')]['ids'],_[_0xd237('0x95')](_0x3cc02b[_0xd237('0x58')],['ids','id'])||{})[_0xd237('0x96')](function(_0x385571){for(var _0x122856=0x0;_0x122856<_0x3cc02b['body']['ids'][_0xd237('0x43')];_0x122856+=0x1){socket[_0xd237('0x7d')](_0xd237('0x7e'),{'UserId':_0x3cc02b[_0xd237('0x58')][_0xd237('0x7f')][_0x122856],'ChatQueueId':_0x3cc02b[_0xd237('0x56')]['id']});}return _0x385571;});}})[_0xd237('0x33')](respondWithResult(_0x4ce7e7,null))[_0xd237('0x28')](handleError(_0x4ce7e7,null));};exports[_0xd237('0x92')]=function(_0xf1bf74,_0x457019,_0x3011ab){return db['ChatQueue'][_0xd237('0x60')]({'where':{'id':_0xf1bf74[_0xd237('0x56')]['id']}})['then'](handleEntityNotFound(_0x457019,null))[_0xd237('0x33')](function(_0x206d8d){if(_0x206d8d){return _0x206d8d[_0xd237('0x92')](_0xf1bf74[_0xd237('0x3e')]['ids'])[_0xd237('0x33')](function(){if(_[_0xd237('0x97')](_0xf1bf74[_0xd237('0x3e')][_0xd237('0x7f')])){for(var _0x1f5848=0x0;_0x1f5848<_0xf1bf74[_0xd237('0x3e')][_0xd237('0x7f')]['length'];_0x1f5848+=0x1){socket[_0xd237('0x7d')]('userChatQueue:remove',{'UserId':Number(_0xf1bf74[_0xd237('0x3e')][_0xd237('0x7f')][_0x1f5848]),'ChatQueueId':Number(_0xf1bf74[_0xd237('0x56')]['id'])});}}else{socket[_0xd237('0x7d')](_0xd237('0x93'),{'UserId':Number(_0xf1bf74[_0xd237('0x3e')][_0xd237('0x7f')]),'ChatQueueId':Number(_0xf1bf74['params']['id'])});}});}})['then'](respondWithStatusCode(_0x457019,null))[_0xd237('0x28')](handleError(_0x457019,null));};exports[_0xd237('0x98')]=function(_0x213d09,_0x2abbda,_0x34f1fc){var _0x4dacef={};var _0x27ed1c={};var _0x3150ae;var _0x2837e6;return db[_0xd237('0x50')]['findOne']({'where':{'id':_0x213d09['params']['id']}})[_0xd237('0x33')](handleEntityNotFound(_0x2abbda,null))['then'](function(_0x1f7f80){if(_0x1f7f80){_0x3150ae=_0x1f7f80;_0x27ed1c[_0xd237('0x40')]=_[_0xd237('0x3d')](db[_0xd237('0x65')][_0xd237('0x3c')]);_0x27ed1c[_0xd237('0x3e')]=_[_0xd237('0x3d')](_0x213d09['query']);_0x27ed1c[_0xd237('0x49')]=_[_0xd237('0x3f')](_0x27ed1c[_0xd237('0x40')],_0x27ed1c[_0xd237('0x3e')]);_0x4dacef['attributes']=_['intersection'](_0x27ed1c['model'],qs[_0xd237('0x41')](_0x213d09['query'][_0xd237('0x41')]));_0x4dacef[_0xd237('0x42')]=_0x4dacef[_0xd237('0x42')][_0xd237('0x43')]?_0x4dacef[_0xd237('0x42')]:_0x27ed1c[_0xd237('0x40')];_0x4dacef[_0xd237('0x46')]=qs[_0xd237('0x47')](_0x213d09[_0xd237('0x3e')][_0xd237('0x47')]);_0x4dacef[_0xd237('0x48')]=qs['filters'](_[_0xd237('0x4a')](_0x213d09[_0xd237('0x3e')],_0x27ed1c[_0xd237('0x49')]));if(_0x213d09[_0xd237('0x3e')]['filter']){_0x4dacef[_0xd237('0x48')]=_[_0xd237('0x4b')](_0x4dacef[_0xd237('0x48')],{'$or':_[_0xd237('0x63')](_0x4dacef[_0xd237('0x42')],function(_0x3a3f64){var _0x129f66={};_0x129f66[_0x3a3f64]={'$like':'%'+_0x213d09['query'][_0xd237('0x4e')]+'%'};return _0x129f66;})});}_0x4dacef=_[_0xd237('0x4b')]({},_0x4dacef,_0x213d09[_0xd237('0x4f')]);return _0x3150ae['getAgents'](_0x4dacef);}})[_0xd237('0x33')](function(_0x5d111d){if(_0x5d111d){_0x2837e6=_0x5d111d[_0xd237('0x43')];if(!_0x213d09[_0xd237('0x3e')][_0xd237('0x44')](_0xd237('0x45'))){_0x4dacef[_0xd237('0x2e')]=qs[_0xd237('0x2e')](_0x213d09['query'][_0xd237('0x2e')]);_0x4dacef[_0xd237('0x2d')]=qs[_0xd237('0x2d')](_0x213d09[_0xd237('0x3e')][_0xd237('0x2d')]);}return _0x3150ae[_0xd237('0x98')](_0x4dacef);}})[_0xd237('0x33')](function(_0x336977){if(_0x336977){return _0x336977?{'count':_0x2837e6,'rows':_0x336977}:null;}})[_0xd237('0x33')](respondWithResult(_0x2abbda,null))['catch'](handleError(_0x2abbda,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 7188092..9329fd8 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 _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0xe81dc3,_0x8b56f0){var _0x2f40d6=function(_0xb5ec98){while(--_0xb5ec98){_0xe81dc3['push'](_0xe81dc3['shift']());}};_0x2f40d6(++_0x8b56f0);}(_0xb10b,0x12a));var _0xbb10=function(_0x3c4024,_0x1fb7c9){_0x3c4024=_0x3c4024-0x0;var _0x20f126=_0xb10b[_0x3c4024];return _0x20f126;};'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 +var _0x0b0e=['ChatQueue','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x262fa0,_0x30e7dc){var _0x1aa4b9=function(_0x1e7849){while(--_0x1e7849){_0x262fa0['push'](_0x262fa0['shift']());}};_0x1aa4b9(++_0x30e7dc);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1d3892,_0x47d5fe){_0x1d3892=_0x1d3892-0x0;var _0x574ff2=_0x0b0e[_0x1d3892];return _0x574ff2;};'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 diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 3eeccca..e94109e 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 _0xa14e=['./chatQueue.attributes','exports','define','chat_queues','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x5137c9,_0x3d193f){var _0x548778=function(_0x286cab){while(--_0x286cab){_0x5137c9['push'](_0x5137c9['shift']());}};_0x548778(++_0x3d193f);}(_0xa14e,0x12d));var _0xea14=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xa14e[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xea14('0x0'));var util=require(_0xea14('0x1'));var logger=require(_0xea14('0x2'))(_0xea14('0x3'));var moment=require(_0xea14('0x4'));var BPromise=require('bluebird');var rp=require(_0xea14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xea14('0x6'));var config=require('../../config/environment');var attributes=require(_0xea14('0x7'));module[_0xea14('0x8')]=function(_0x43a2b1,_0x4a6c56){return _0x43a2b1[_0xea14('0x9')]('ChatQueue',attributes,{'tableName':_0xea14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb1e=['lodash','util','api','bluebird','request-promise','../../config/environment','exports','define','chat_queues'];(function(_0x2ac825,_0x4dbe5b){var _0x5ca389=function(_0x3e06dc){while(--_0x3e06dc){_0x2ac825['push'](_0x2ac825['shift']());}};_0x5ca389(++_0x4dbe5b);}(_0xfb1e,0x183));var _0xefb1=function(_0x47b84b,_0x338a33){_0x47b84b=_0x47b84b-0x0;var _0x5a90b2=_0xfb1e[_0x47b84b];return _0x5a90b2;};'use strict';var _=require(_0xefb1('0x0'));var util=require(_0xefb1('0x1'));var logger=require('../../config/logger')(_0xefb1('0x2'));var moment=require('moment');var BPromise=require(_0xefb1('0x3'));var rp=require(_0xefb1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xefb1('0x5'));var attributes=require('./chatQueue.attributes');module[_0xefb1('0x6')]=function(_0x57be8f,_0xb02415){return _0x57be8f[_0xefb1('0x7')]('ChatQueue',attributes,{'tableName':_0xefb1('0x8'),'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 467f124..0544e15 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 _0x09df=['error','code','message','result','catch','ChatQueue','findAll','options','where','attributes','include','model','then','GetChatQueue','ShowChatQueue','map','lodash','util','bluebird','../../mysqldb','rpc','../../config/environment','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x41dfac,_0x278319){var _0x12900b=function(_0x3324cd){while(--_0x3324cd){_0x41dfac['push'](_0x41dfac['shift']());}};_0x12900b(++_0x278319);}(_0x09df,0x164));var _0xf09d=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x09df[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xf09d('0x0'));var util=require(_0xf09d('0x1'));var moment=require('moment');var BPromise=require(_0xf09d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf09d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf09d('0x4'));var config=require(_0xf09d('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xf09d('0x6')]=_['defaults'](config[_0xf09d('0x6')],{'host':_0xf09d('0x7'),'port':0x18eb});var socket=require(_0xf09d('0x8'))(new Redis(config[_0xf09d('0x6')]));require(_0xf09d('0x9'))[_0xf09d('0xa')](socket);function respondWithRpcPromise(_0x302039,_0x5c1b57,_0x404322){return new BPromise(function(_0x227a55,_0x56a961){return client[_0xf09d('0xb')](_0x302039,_0x404322)['then'](function(_0x2f9736){logger[_0xf09d('0xc')](_0xf09d('0xd'),_0x5c1b57,_0xf09d('0xe'));logger[_0xf09d('0xf')](_0xf09d('0x10'),_0x5c1b57,_0xf09d('0xe'),JSON[_0xf09d('0x11')](_0x2f9736));if(_0x2f9736[_0xf09d('0x12')]){if(_0x2f9736['error'][_0xf09d('0x13')]===0x1f4){logger[_0xf09d('0x12')](_0xf09d('0xd'),_0x5c1b57,_0x2f9736['error']['message']);return _0x56a961(_0x2f9736[_0xf09d('0x12')][_0xf09d('0x14')]);}logger[_0xf09d('0x12')]('ChatQueue,\x20%s,\x20%s',_0x5c1b57,_0x2f9736[_0xf09d('0x12')]['message']);return _0x227a55(_0x2f9736[_0xf09d('0x12')][_0xf09d('0x14')]);}else{logger[_0xf09d('0xc')](_0xf09d('0xd'),_0x5c1b57,'request\x20sent');_0x227a55(_0x2f9736[_0xf09d('0x15')][_0xf09d('0x14')]);}})[_0xf09d('0x16')](function(_0x190688){logger[_0xf09d('0x12')](_0xf09d('0xd'),_0x5c1b57,_0x190688);_0x56a961(_0x190688);});});}exports['GetChatQueue']=function(_0x2f341d){var _0x5478ba=this;return new Promise(function(_0x380b14,_0x342e14){return db[_0xf09d('0x17')][_0xf09d('0x18')]({'raw':_0x2f341d[_0xf09d('0x19')]?_0x2f341d[_0xf09d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2f341d[_0xf09d('0x19')]?_0x2f341d[_0xf09d('0x19')][_0xf09d('0x1a')]||null:null,'attributes':_0x2f341d[_0xf09d('0x19')]?_0x2f341d[_0xf09d('0x19')][_0xf09d('0x1b')]||null:null,'limit':_0x2f341d[_0xf09d('0x19')]?_0x2f341d[_0xf09d('0x19')]['limit']||null:null,'include':_0x2f341d[_0xf09d('0x19')]?_0x2f341d['options'][_0xf09d('0x1c')]?_['map'](_0x2f341d[_0xf09d('0x19')][_0xf09d('0x1c')],function(_0x369700){return{'model':db[_0x369700[_0xf09d('0x1d')]],'as':_0x369700['as'],'attributes':_0x369700[_0xf09d('0x1b')],'include':_0x369700[_0xf09d('0x1c')]?_['map'](_0x369700[_0xf09d('0x1c')],function(_0x35957d){return{'model':db[_0x35957d[_0xf09d('0x1d')]],'as':_0x35957d['as'],'attributes':_0x35957d['attributes'],'include':_0x35957d['include']?_['map'](_0x35957d[_0xf09d('0x1c')],function(_0x2d1da5){return{'model':db[_0x2d1da5[_0xf09d('0x1d')]],'as':_0x2d1da5['as'],'attributes':_0x2d1da5[_0xf09d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf09d('0x1e')](function(_0x34efaa){logger[_0xf09d('0xc')]('GetChatQueue',_0x2f341d);logger[_0xf09d('0xf')]('GetChatQueue',_0x2f341d,JSON['stringify'](_0x34efaa));_0x380b14(_0x34efaa);})[_0xf09d('0x16')](function(_0x252cef){logger['error'](_0xf09d('0x1f'),_0x252cef[_0xf09d('0x14')],_0x2f341d);_0x342e14(_0x5478ba[_0xf09d('0x12')](0x1f4,_0x252cef['message']));});});};exports[_0xf09d('0x20')]=function(_0x7697a){var _0x5d20dc=this;return new Promise(function(_0x10e151,_0x457f66){return db['ChatQueue']['find']({'raw':_0x7697a[_0xf09d('0x19')]?_0x7697a['options']['raw']===undefined?!![]:![]:!![],'where':_0x7697a[_0xf09d('0x19')]?_0x7697a[_0xf09d('0x19')]['where']||null:null,'attributes':_0x7697a[_0xf09d('0x19')]?_0x7697a['options']['attributes']||null:null,'include':_0x7697a['options']?_0x7697a[_0xf09d('0x19')][_0xf09d('0x1c')]?_['map'](_0x7697a[_0xf09d('0x19')][_0xf09d('0x1c')],function(_0x345b4b){return{'model':db[_0x345b4b['model']],'as':_0x345b4b['as'],'attributes':_0x345b4b['attributes'],'include':_0x345b4b[_0xf09d('0x1c')]?_[_0xf09d('0x21')](_0x345b4b[_0xf09d('0x1c')],function(_0xbd6b32){return{'model':db[_0xbd6b32[_0xf09d('0x1d')]],'as':_0xbd6b32['as'],'attributes':_0xbd6b32['attributes'],'include':_0xbd6b32['include']?_[_0xf09d('0x21')](_0xbd6b32[_0xf09d('0x1c')],function(_0x3d1881){return{'model':db[_0x3d1881[_0xf09d('0x1d')]],'as':_0x3d1881['as'],'attributes':_0x3d1881[_0xf09d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf09d('0x1e')](function(_0x3bda01){logger[_0xf09d('0xc')](_0xf09d('0x20'),_0x7697a);logger[_0xf09d('0xf')](_0xf09d('0x20'),_0x7697a,JSON[_0xf09d('0x11')](_0x3bda01));_0x10e151(_0x3bda01);})['catch'](function(_0x125d03){logger['error'](_0xf09d('0x20'),_0x125d03['message'],_0x7697a);_0x457f66(_0x5d20dc[_0xf09d('0x12')](0x1f4,_0x125d03[_0xf09d('0x14')]));});});}; \ No newline at end of file +var _0xd943=['include','map','model','GetChatQueue','ShowChatQueue','find','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','localhost','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ChatQueue','options','raw','where','attributes','limit'];(function(_0x5e5c9c,_0x5e832e){var _0x34504b=function(_0x5afc33){while(--_0x5afc33){_0x5e5c9c['push'](_0x5e5c9c['shift']());}};_0x34504b(++_0x5e832e);}(_0xd943,0x15d));var _0x3d94=function(_0x290d93,_0x237319){_0x290d93=_0x290d93-0x0;var _0x285d80=_0xd943[_0x290d93];return _0x285d80;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x3d94('0xa')],{'host':_0x3d94('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3d94('0xc'))[_0x3d94('0xd')](socket);function respondWithRpcPromise(_0x1cc58c,_0x5908a7,_0x182066){return new BPromise(function(_0x4ac968,_0x39e2fa){return client[_0x3d94('0xe')](_0x1cc58c,_0x182066)['then'](function(_0x1897de){logger[_0x3d94('0xf')](_0x3d94('0x10'),_0x5908a7,_0x3d94('0x11'));logger[_0x3d94('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5908a7,_0x3d94('0x11'),JSON[_0x3d94('0x13')](_0x1897de));if(_0x1897de[_0x3d94('0x14')]){if(_0x1897de['error'][_0x3d94('0x15')]===0x1f4){logger[_0x3d94('0x14')](_0x3d94('0x10'),_0x5908a7,_0x1897de['error'][_0x3d94('0x16')]);return _0x39e2fa(_0x1897de[_0x3d94('0x14')][_0x3d94('0x16')]);}logger[_0x3d94('0x14')](_0x3d94('0x10'),_0x5908a7,_0x1897de[_0x3d94('0x14')][_0x3d94('0x16')]);return _0x4ac968(_0x1897de[_0x3d94('0x14')]['message']);}else{logger[_0x3d94('0xf')](_0x3d94('0x10'),_0x5908a7,_0x3d94('0x11'));_0x4ac968(_0x1897de[_0x3d94('0x17')][_0x3d94('0x16')]);}})[_0x3d94('0x18')](function(_0xef8b3){logger['error'](_0x3d94('0x10'),_0x5908a7,_0xef8b3);_0x39e2fa(_0xef8b3);});});}exports['GetChatQueue']=function(_0x28bead){var _0x193934=this;return new Promise(function(_0x16a6d0,_0x1e9ec2){return db[_0x3d94('0x19')]['findAll']({'raw':_0x28bead['options']?_0x28bead[_0x3d94('0x1a')][_0x3d94('0x1b')]===undefined?!![]:![]:!![],'where':_0x28bead[_0x3d94('0x1a')]?_0x28bead['options'][_0x3d94('0x1c')]||null:null,'attributes':_0x28bead[_0x3d94('0x1a')]?_0x28bead[_0x3d94('0x1a')][_0x3d94('0x1d')]||null:null,'limit':_0x28bead[_0x3d94('0x1a')]?_0x28bead[_0x3d94('0x1a')][_0x3d94('0x1e')]||null:null,'include':_0x28bead[_0x3d94('0x1a')]?_0x28bead[_0x3d94('0x1a')][_0x3d94('0x1f')]?_[_0x3d94('0x20')](_0x28bead[_0x3d94('0x1a')][_0x3d94('0x1f')],function(_0x3496c3){return{'model':db[_0x3496c3[_0x3d94('0x21')]],'as':_0x3496c3['as'],'attributes':_0x3496c3['attributes'],'include':_0x3496c3[_0x3d94('0x1f')]?_['map'](_0x3496c3[_0x3d94('0x1f')],function(_0x1d0a7a){return{'model':db[_0x1d0a7a[_0x3d94('0x21')]],'as':_0x1d0a7a['as'],'attributes':_0x1d0a7a[_0x3d94('0x1d')],'include':_0x1d0a7a[_0x3d94('0x1f')]?_[_0x3d94('0x20')](_0x1d0a7a[_0x3d94('0x1f')],function(_0x47d6ab){return{'model':db[_0x47d6ab['model']],'as':_0x47d6ab['as'],'attributes':_0x47d6ab[_0x3d94('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4dd410){logger[_0x3d94('0xf')]('GetChatQueue',_0x28bead);logger[_0x3d94('0x12')](_0x3d94('0x22'),_0x28bead,JSON[_0x3d94('0x13')](_0x4dd410));_0x16a6d0(_0x4dd410);})['catch'](function(_0x2a07b4){logger['error'](_0x3d94('0x22'),_0x2a07b4['message'],_0x28bead);_0x1e9ec2(_0x193934[_0x3d94('0x14')](0x1f4,_0x2a07b4[_0x3d94('0x16')]));});});};exports[_0x3d94('0x23')]=function(_0x246f88){var _0x50560c=this;return new Promise(function(_0x18f854,_0x51f634){return db[_0x3d94('0x19')][_0x3d94('0x24')]({'raw':_0x246f88['options']?_0x246f88['options'][_0x3d94('0x1b')]===undefined?!![]:![]:!![],'where':_0x246f88[_0x3d94('0x1a')]?_0x246f88[_0x3d94('0x1a')]['where']||null:null,'attributes':_0x246f88[_0x3d94('0x1a')]?_0x246f88[_0x3d94('0x1a')]['attributes']||null:null,'include':_0x246f88[_0x3d94('0x1a')]?_0x246f88[_0x3d94('0x1a')][_0x3d94('0x1f')]?_[_0x3d94('0x20')](_0x246f88[_0x3d94('0x1a')]['include'],function(_0xa43fc){return{'model':db[_0xa43fc[_0x3d94('0x21')]],'as':_0xa43fc['as'],'attributes':_0xa43fc[_0x3d94('0x1d')],'include':_0xa43fc[_0x3d94('0x1f')]?_[_0x3d94('0x20')](_0xa43fc[_0x3d94('0x1f')],function(_0x546658){return{'model':db[_0x546658['model']],'as':_0x546658['as'],'attributes':_0x546658[_0x3d94('0x1d')],'include':_0x546658[_0x3d94('0x1f')]?_[_0x3d94('0x20')](_0x546658[_0x3d94('0x1f')],function(_0x3bfc16){return{'model':db[_0x3bfc16[_0x3d94('0x21')]],'as':_0x3bfc16['as'],'attributes':_0x3bfc16[_0x3d94('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3d94('0x25')](function(_0x2e7b97){logger[_0x3d94('0xf')]('ShowChatQueue',_0x246f88);logger[_0x3d94('0x12')](_0x3d94('0x23'),_0x246f88,JSON[_0x3d94('0x13')](_0x2e7b97));_0x18f854(_0x2e7b97);})[_0x3d94('0x18')](function(_0x525d90){logger[_0x3d94('0x14')](_0x3d94('0x23'),_0x525d90[_0x3d94('0x16')],_0x246f88);_0x51f634(_0x50560c[_0x3d94('0x14')](0x1f4,_0x525d90[_0x3d94('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index cc67b12..e9f379d 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(_0x49fd71,_0xaeb043){var _0x13672c=function(_0x3e351c){while(--_0x3e351c){_0x49fd71['push'](_0x49fd71['shift']());}};_0x13672c(++_0xaeb043);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0x0b0e[_0x3b5049];return _0x12454e;};'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 _0x0b0e=['chatQueue:','./chatQueue.events','remove','emit','removeListener','register'];(function(_0x1d43d4,_0x10b12f){var _0x4d0783=function(_0x52bc34){while(--_0x52bc34){_0x1d43d4['push'](_0x1d43d4['shift']());}};_0x4d0783(++_0x10b12f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x10b434,_0x521745){_0x10b434=_0x10b434-0x0;var _0x31050b=_0x0b0e[_0x10b434];return _0x31050b;};'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 diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 45e6fe1..3c6a8c1 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 _0x5f22=['addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','../../components/auth/service','index','/describe','isAuthenticated','describe','get','/:id','show','/:id/teams','getTeams','/:id/users','getAgents','post'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x5f22,0xe9));var _0x25f2=function(_0x51c726,_0x332b95){_0x51c726=_0x51c726-0x0;var _0x23fe86=_0x5f22[_0x51c726];return _0x23fe86;};'use strict';var multer=require(_0x25f2('0x0'));var util=require(_0x25f2('0x1'));var path=require(_0x25f2('0x2'));var timeout=require('connect-timeout');var express=require(_0x25f2('0x3'));var router=express['Router']();var auth=require(_0x25f2('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x25f2('0x5')]);router['get'](_0x25f2('0x6'),auth[_0x25f2('0x7')](),controller[_0x25f2('0x8')]);router[_0x25f2('0x9')](_0x25f2('0xa'),auth[_0x25f2('0x7')](),controller[_0x25f2('0xb')]);router['get']('/:id/members',auth[_0x25f2('0x7')](),controller['getMembers']);router['get'](_0x25f2('0xc'),auth[_0x25f2('0x7')](),controller[_0x25f2('0xd')]);router[_0x25f2('0x9')](_0x25f2('0xe'),auth[_0x25f2('0x7')](),controller[_0x25f2('0xf')]);router[_0x25f2('0x10')]('/',auth[_0x25f2('0x7')](),controller['create']);router[_0x25f2('0x10')](_0x25f2('0xc'),auth[_0x25f2('0x7')](),controller[_0x25f2('0x11')]);router[_0x25f2('0x10')](_0x25f2('0xe'),auth['isAuthenticated'](),controller[_0x25f2('0x12')]);router['put'](_0x25f2('0xa'),auth[_0x25f2('0x7')](),controller[_0x25f2('0x13')]);router[_0x25f2('0x14')](_0x25f2('0xa'),auth[_0x25f2('0x7')](),controller[_0x25f2('0x15')]);router[_0x25f2('0x14')]('/:id/teams',auth[_0x25f2('0x7')](),controller[_0x25f2('0x16')]);router[_0x25f2('0x14')](_0x25f2('0xe'),auth[_0x25f2('0x7')](),controller[_0x25f2('0x17')]);module[_0x25f2('0x18')]=router; \ No newline at end of file +var _0x8320=['connect-timeout','Router','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeAgents','exports','multer','util','path'];(function(_0x416a14,_0x1d374b){var _0x4dea99=function(_0x4cc2f7){while(--_0x4cc2f7){_0x416a14['push'](_0x416a14['shift']());}};_0x4dea99(++_0x1d374b);}(_0x8320,0x169));var _0x0832=function(_0xe4ee1e,_0xea8b9b){_0xe4ee1e=_0xe4ee1e-0x0;var _0x22f903=_0x8320[_0xe4ee1e];return _0x22f903;};'use strict';var multer=require(_0x0832('0x0'));var util=require(_0x0832('0x1'));var path=require(_0x0832('0x2'));var timeout=require(_0x0832('0x3'));var express=require('express');var router=express[_0x0832('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0832('0x5'));var controller=require(_0x0832('0x6'));router[_0x0832('0x7')]('/',auth[_0x0832('0x8')](),controller[_0x0832('0x9')]);router[_0x0832('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x0832('0xa')]);router['get'](_0x0832('0xb'),auth['isAuthenticated'](),controller[_0x0832('0xc')]);router[_0x0832('0x7')]('/:id/members',auth[_0x0832('0x8')](),controller['getMembers']);router[_0x0832('0x7')](_0x0832('0xd'),auth[_0x0832('0x8')](),controller[_0x0832('0xe')]);router[_0x0832('0x7')](_0x0832('0xf'),auth[_0x0832('0x8')](),controller[_0x0832('0x10')]);router[_0x0832('0x11')]('/',auth[_0x0832('0x8')](),controller[_0x0832('0x12')]);router[_0x0832('0x11')](_0x0832('0xd'),auth[_0x0832('0x8')](),controller[_0x0832('0x13')]);router[_0x0832('0x11')](_0x0832('0xf'),auth['isAuthenticated'](),controller[_0x0832('0x14')]);router[_0x0832('0x15')](_0x0832('0xb'),auth[_0x0832('0x8')](),controller['update']);router[_0x0832('0x16')](_0x0832('0xb'),auth[_0x0832('0x8')](),controller[_0x0832('0x17')]);router[_0x0832('0x16')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0x0832('0x16')](_0x0832('0xf'),auth[_0x0832('0x8')](),controller[_0x0832('0x18')]);module[_0x0832('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 f2e5852..a3b3938 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 _0xe18c=['STRING','DATE','exports'];(function(_0x2d982d,_0x54923d){var _0x10caa5=function(_0x5cf1d8){while(--_0x5cf1d8){_0x2d982d['push'](_0x2d982d['shift']());}};_0x10caa5(++_0x54923d);}(_0xe18c,0x149));var _0xce18=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe18c[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xce18('0x0')]={'uniqueid':{'type':Sequelize[_0xce18('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xce18('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xce18('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xce18('0x1')]}}; \ No newline at end of file +var _0x9389=['STRING','DATE','sequelize'];(function(_0x3a671c,_0x38f7f6){var _0x1efc1e=function(_0x1a5d8c){while(--_0x1a5d8c){_0x3a671c['push'](_0x3a671c['shift']());}};_0x1efc1e(++_0x38f7f6);}(_0x9389,0x13d));var _0x9938=function(_0xa61ec4,_0x54900f){_0xa61ec4=_0xa61ec4-0x0;var _0x5a0c74=_0x9389[_0xa61ec4];return _0x5a0c74;};'use strict';var moment=require('moment');var Sequelize=require(_0x9938('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x9938('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x9938('0x1')]},'joinAt':{'type':Sequelize[_0x9938('0x2')]},'leaveAt':{'type':Sequelize[_0x9938('0x2')]},'acceptAt':{'type':Sequelize[_0x9938('0x2')]},'exitAt':{'type':Sequelize[_0x9938('0x2')]},'reason':{'type':Sequelize[_0x9938('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 8896402..0ba2baf 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 _0x1159=['count','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','filters','pick','filter','where','merge','map','type','key','VIRTUAL','options','ChatQueueReport'];(function(_0x4eec2f,_0x55a635){var _0x4d8b0d=function(_0x259769){while(--_0x259769){_0x4eec2f['push'](_0x4eec2f['shift']());}};_0x4d8b0d(++_0x55a635);}(_0x1159,0xf3));var _0x9115=function(_0x3dfeef,_0x4505cb){_0x3dfeef=_0x3dfeef-0x0;var _0x5ab6f5=_0x1159[_0x3dfeef];return _0x5ab6f5;};'use strict';var pdf=require(_0x9115('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9115('0x1'));var jsonpatch=require(_0x9115('0x2'));var rp=require(_0x9115('0x3'));var moment=require(_0x9115('0x4'));var BPromise=require(_0x9115('0x5'));var Mustache=require(_0x9115('0x6'));var util=require(_0x9115('0x7'));var path=require(_0x9115('0x8'));var sox=require('sox');var csv=require(_0x9115('0x9'));var ejs=require(_0x9115('0xa'));var fs=require('fs');var _=require(_0x9115('0xb'));var squel=require(_0x9115('0xc'));var crypto=require(_0x9115('0xd'));var jsforce=require(_0x9115('0xe'));var deskjs=require(_0x9115('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9115('0x10'));var Papa=require(_0x9115('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9115('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9115('0x13'))(_0x9115('0x14'));var utils=require(_0x9115('0x15'));var config=require(_0x9115('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17d8e8,_0x248de5){_0x248de5=_0x248de5||0xcc;return function(_0x31255a){if(_0x31255a){return _0x17d8e8[_0x9115('0x17')](_0x248de5);}return _0x17d8e8[_0x9115('0x18')](_0x248de5)[_0x9115('0x19')]();};}function respondWithResult(_0x1b201a,_0x29de02){_0x29de02=_0x29de02||0xc8;return function(_0x46df2d){if(_0x46df2d){return _0x1b201a['status'](_0x29de02)[_0x9115('0x1a')](_0x46df2d);}};}function respondWithFilteredResult(_0x4a938d,_0x1bfd8c){return function(_0x537972){if(_0x537972){var _0x238b83=_0x537972['count'],_0x2f9cbf=_0x1bfd8c['offset'],_0x3fe082=_0x1bfd8c['offset']+_0x1bfd8c[_0x9115('0x1b')],_0x5768db;if(_0x3fe082>=_0x238b83){_0x3fe082=_0x238b83;_0x5768db=0xc8;}else{_0x5768db=0xce;}_0x4a938d[_0x9115('0x18')](_0x5768db);return _0x4a938d[_0x9115('0x1c')](_0x9115('0x1d'),_0x2f9cbf+'-'+_0x3fe082+'/'+_0x238b83)['json'](_0x537972);}return null;};}function patchUpdates(_0x31ebb3){return function(_0xd38892){try{jsonpatch[_0x9115('0x1e')](_0xd38892,_0x31ebb3,!![]);}catch(_0x182c70){return BPromise[_0x9115('0x1f')](_0x182c70);}return _0xd38892[_0x9115('0x20')]();};}function saveUpdates(_0x1a7040,_0x2af6d6){return function(_0x41b4fe){if(_0x41b4fe){return _0x41b4fe[_0x9115('0x21')](_0x1a7040)[_0x9115('0x22')](function(_0x5ab822){return _0x5ab822;});}return null;};}function removeEntity(_0x19ff30,_0x21bfa7){return function(_0x3605aa){if(_0x3605aa){return _0x3605aa[_0x9115('0x23')]()[_0x9115('0x22')](function(){_0x19ff30[_0x9115('0x18')](0xcc)[_0x9115('0x19')]();});}};}function handleEntityNotFound(_0x10c142,_0x2dbd7a){return function(_0x2d93c9){if(!_0x2d93c9){_0x10c142[_0x9115('0x17')](0x194);}return _0x2d93c9;};}function handleError(_0x284411,_0x3c4c08){_0x3c4c08=_0x3c4c08||0x1f4;return function(_0xc64bc6){logger[_0x9115('0x24')](_0xc64bc6[_0x9115('0x25')]);if(_0xc64bc6[_0x9115('0x26')]){delete _0xc64bc6[_0x9115('0x26')];}_0x284411[_0x9115('0x18')](_0x3c4c08)[_0x9115('0x27')](_0xc64bc6);};}exports[_0x9115('0x28')]=function(_0x4a23f4,_0x2a37f5){var _0x576248={},_0x2eae39={},_0x1940a1={'count':0x0,'rows':[]};var _0x27644c=db['ChatQueueReport'][_0x9115('0x29')];_0x2eae39[_0x9115('0x2a')]=_[_0x9115('0x2b')](_0x27644c);_0x2eae39['query']=_[_0x9115('0x2b')](_0x4a23f4[_0x9115('0x2c')]);_0x2eae39['filters']=_[_0x9115('0x2d')](_0x2eae39['model'],_0x2eae39[_0x9115('0x2c')]);_0x576248[_0x9115('0x2e')]=_[_0x9115('0x2d')](_0x2eae39[_0x9115('0x2a')],qs[_0x9115('0x2f')](_0x4a23f4[_0x9115('0x2c')][_0x9115('0x2f')]));_0x576248[_0x9115('0x2e')]=_0x576248[_0x9115('0x2e')][_0x9115('0x30')]?_0x576248['attributes']:_0x2eae39[_0x9115('0x2a')];if(!_0x4a23f4[_0x9115('0x2c')][_0x9115('0x31')](_0x9115('0x32'))){_0x576248[_0x9115('0x1b')]=qs[_0x9115('0x1b')](_0x4a23f4['query'][_0x9115('0x1b')]);_0x576248['offset']=qs[_0x9115('0x33')](_0x4a23f4[_0x9115('0x2c')][_0x9115('0x33')]);}_0x576248[_0x9115('0x34')]=qs[_0x9115('0x35')](_0x4a23f4[_0x9115('0x2c')]['sort']);_0x576248['where']=qs[_0x9115('0x36')](_[_0x9115('0x37')](_0x4a23f4[_0x9115('0x2c')],_0x2eae39[_0x9115('0x36')]));if(_0x4a23f4[_0x9115('0x2c')][_0x9115('0x38')]){_0x576248[_0x9115('0x39')]=_[_0x9115('0x3a')](_0x576248[_0x9115('0x39')],{'$or':_[_0x9115('0x3b')](_0x27644c,function(_0x1eef60){if(_0x1eef60[_0x9115('0x3c')][_0x9115('0x3d')]!==_0x9115('0x3e')){var _0x3fcf5b={};_0x3fcf5b[_0x1eef60['field']]={'$like':'%'+_0x4a23f4[_0x9115('0x2c')][_0x9115('0x38')]+'%'};return _0x3fcf5b;}})});}_0x576248=_[_0x9115('0x3a')]({},_0x576248,_0x4a23f4[_0x9115('0x3f')]);var _0x525303={'where':_0x576248['where']};return db[_0x9115('0x40')]['count'](_0x525303)['then'](function(_0x12a5d9){_0x1940a1[_0x9115('0x41')]=_0x12a5d9;if(_0x4a23f4[_0x9115('0x2c')][_0x9115('0x42')]){_0x576248['include']=[{'all':!![]}];}return db[_0x9115('0x40')][_0x9115('0x43')](_0x576248);})['then'](function(_0x24e85f){_0x1940a1[_0x9115('0x44')]=_0x24e85f;return _0x1940a1;})[_0x9115('0x22')](respondWithFilteredResult(_0x2a37f5,_0x576248))[_0x9115('0x45')](handleError(_0x2a37f5,null));};exports[_0x9115('0x46')]=function(_0x5185ef,_0x52ae35){var _0x4f314b={'raw':!![],'where':{'id':_0x5185ef[_0x9115('0x47')]['id']}},_0x31c7d3={};_0x31c7d3[_0x9115('0x2a')]=_[_0x9115('0x2b')](db[_0x9115('0x40')]['rawAttributes']);_0x31c7d3['query']=_[_0x9115('0x2b')](_0x5185ef[_0x9115('0x2c')]);_0x31c7d3[_0x9115('0x36')]=_[_0x9115('0x2d')](_0x31c7d3[_0x9115('0x2a')],_0x31c7d3['query']);_0x4f314b['attributes']=_[_0x9115('0x2d')](_0x31c7d3[_0x9115('0x2a')],qs['fields'](_0x5185ef[_0x9115('0x2c')][_0x9115('0x2f')]));_0x4f314b[_0x9115('0x2e')]=_0x4f314b[_0x9115('0x2e')][_0x9115('0x30')]?_0x4f314b[_0x9115('0x2e')]:_0x31c7d3['model'];if(_0x5185ef[_0x9115('0x2c')][_0x9115('0x42')]){_0x4f314b[_0x9115('0x48')]=[{'all':!![]}];}_0x4f314b=_[_0x9115('0x3a')]({},_0x4f314b,_0x5185ef['options']);return db[_0x9115('0x40')][_0x9115('0x49')](_0x4f314b)[_0x9115('0x22')](handleEntityNotFound(_0x52ae35,null))[_0x9115('0x22')](respondWithResult(_0x52ae35,null))['catch'](handleError(_0x52ae35,null));};exports['create']=function(_0x4ae59a,_0x4282ec){return db[_0x9115('0x40')][_0x9115('0x4a')](_0x4ae59a[_0x9115('0x4b')],{})['then'](respondWithResult(_0x4282ec,0xc9))[_0x9115('0x45')](handleError(_0x4282ec,null));};exports[_0x9115('0x21')]=function(_0x470fd1,_0x4e091d){if(_0x470fd1[_0x9115('0x4b')]['id']){delete _0x470fd1['body']['id'];}return db[_0x9115('0x40')][_0x9115('0x49')]({'where':{'id':_0x470fd1[_0x9115('0x47')]['id']}})[_0x9115('0x22')](handleEntityNotFound(_0x4e091d,null))[_0x9115('0x22')](saveUpdates(_0x470fd1[_0x9115('0x4b')],null))[_0x9115('0x22')](respondWithResult(_0x4e091d,null))[_0x9115('0x45')](handleError(_0x4e091d,null));};exports['destroy']=function(_0x3d816d,_0x25c5d6){return db[_0x9115('0x40')][_0x9115('0x49')]({'where':{'id':_0x3d816d[_0x9115('0x47')]['id']}})['then'](handleEntityNotFound(_0x25c5d6,null))[_0x9115('0x22')](removeEntity(_0x25c5d6,null))[_0x9115('0x45')](handleError(_0x25c5d6,null));};exports[_0x9115('0x4c')]=function(_0x5bb484,_0x18acdd){return db[_0x9115('0x40')][_0x9115('0x4c')]()[_0x9115('0x22')](respondWithResult(_0x18acdd,null))[_0x9115('0x45')](handleError(_0x18acdd,null));}; \ No newline at end of file +var _0x2070=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','ChatQueueReport','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','key','VIRTUAL','options','then','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x2070,0x1a2));var _0x0207=function(_0x27b299,_0x566e94){_0x27b299=_0x27b299-0x0;var _0xfb292b=_0x2070[_0x27b299];return _0xfb292b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x0207('0x0'));var zipdir=require(_0x0207('0x1'));var jsonpatch=require(_0x0207('0x2'));var rp=require('request-promise');var moment=require(_0x0207('0x3'));var BPromise=require(_0x0207('0x4'));var Mustache=require('mustache');var util=require(_0x0207('0x5'));var path=require(_0x0207('0x6'));var sox=require('sox');var csv=require(_0x0207('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0207('0x8'));var crypto=require(_0x0207('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x0207('0xa'));var toCsv=require(_0x0207('0x7'));var querystring=require('querystring');var Papa=require(_0x0207('0xb'));var Redis=require(_0x0207('0xc'));var authService=require(_0x0207('0xd'));var qs=require(_0x0207('0xe'));var hardwareService=require(_0x0207('0xf'));var logger=require(_0x0207('0x10'))(_0x0207('0x11'));var utils=require(_0x0207('0x12'));var config=require(_0x0207('0x13'));var db=require(_0x0207('0x14'))['db'];function respondWithStatusCode(_0x2706ee,_0x415223){_0x415223=_0x415223||0xcc;return function(_0x22be26){if(_0x22be26){return _0x2706ee[_0x0207('0x15')](_0x415223);}return _0x2706ee['status'](_0x415223)[_0x0207('0x16')]();};}function respondWithResult(_0x5b2a38,_0xec6d19){_0xec6d19=_0xec6d19||0xc8;return function(_0x3bd0c4){if(_0x3bd0c4){return _0x5b2a38[_0x0207('0x17')](_0xec6d19)[_0x0207('0x18')](_0x3bd0c4);}};}function respondWithFilteredResult(_0x463abe,_0x5cd372){return function(_0x3cb346){if(_0x3cb346){var _0x1cbefd=_0x3cb346[_0x0207('0x19')],_0x5e8d17=_0x5cd372[_0x0207('0x1a')],_0x2bb662=_0x5cd372['offset']+_0x5cd372[_0x0207('0x1b')],_0x31880b;if(_0x2bb662>=_0x1cbefd){_0x2bb662=_0x1cbefd;_0x31880b=0xc8;}else{_0x31880b=0xce;}_0x463abe[_0x0207('0x17')](_0x31880b);return _0x463abe[_0x0207('0x1c')](_0x0207('0x1d'),_0x5e8d17+'-'+_0x2bb662+'/'+_0x1cbefd)[_0x0207('0x18')](_0x3cb346);}return null;};}function patchUpdates(_0x179b79){return function(_0x91afae){try{jsonpatch[_0x0207('0x1e')](_0x91afae,_0x179b79,!![]);}catch(_0x4255bb){return BPromise[_0x0207('0x1f')](_0x4255bb);}return _0x91afae[_0x0207('0x20')]();};}function saveUpdates(_0x275be8,_0x25dc1c){return function(_0xfc201){if(_0xfc201){return _0xfc201[_0x0207('0x21')](_0x275be8)['then'](function(_0x2c8567){return _0x2c8567;});}return null;};}function removeEntity(_0x4a2ed9,_0x1438df){return function(_0x1421e7){if(_0x1421e7){return _0x1421e7[_0x0207('0x22')]()['then'](function(){_0x4a2ed9[_0x0207('0x17')](0xcc)[_0x0207('0x16')]();});}};}function handleEntityNotFound(_0x5cd2bc,_0x16bf24){return function(_0x11bb0f){if(!_0x11bb0f){_0x5cd2bc[_0x0207('0x15')](0x194);}return _0x11bb0f;};}function handleError(_0x412d3a,_0x13b17b){_0x13b17b=_0x13b17b||0x1f4;return function(_0x520a88){logger[_0x0207('0x23')](_0x520a88[_0x0207('0x24')]);if(_0x520a88['name']){delete _0x520a88[_0x0207('0x25')];}_0x412d3a['status'](_0x13b17b)[_0x0207('0x26')](_0x520a88);};}exports[_0x0207('0x27')]=function(_0x2e496f,_0x5d7fac){var _0x1c767d={},_0x26e59b={},_0x1f6286={'count':0x0,'rows':[]};var _0x35085c=db[_0x0207('0x28')]['rawAttributes'];_0x26e59b[_0x0207('0x29')]=_['keys'](_0x35085c);_0x26e59b[_0x0207('0x2a')]=_[_0x0207('0x2b')](_0x2e496f[_0x0207('0x2a')]);_0x26e59b['filters']=_[_0x0207('0x2c')](_0x26e59b['model'],_0x26e59b['query']);_0x1c767d[_0x0207('0x2d')]=_[_0x0207('0x2c')](_0x26e59b[_0x0207('0x29')],qs[_0x0207('0x2e')](_0x2e496f[_0x0207('0x2a')]['fields']));_0x1c767d[_0x0207('0x2d')]=_0x1c767d[_0x0207('0x2d')][_0x0207('0x2f')]?_0x1c767d[_0x0207('0x2d')]:_0x26e59b['model'];if(!_0x2e496f[_0x0207('0x2a')][_0x0207('0x30')](_0x0207('0x31'))){_0x1c767d[_0x0207('0x1b')]=qs[_0x0207('0x1b')](_0x2e496f[_0x0207('0x2a')]['limit']);_0x1c767d['offset']=qs[_0x0207('0x1a')](_0x2e496f['query'][_0x0207('0x1a')]);}_0x1c767d[_0x0207('0x32')]=qs[_0x0207('0x33')](_0x2e496f[_0x0207('0x2a')]['sort']);_0x1c767d[_0x0207('0x34')]=qs['filters'](_['pick'](_0x2e496f[_0x0207('0x2a')],_0x26e59b[_0x0207('0x35')]));if(_0x2e496f[_0x0207('0x2a')][_0x0207('0x36')]){_0x1c767d[_0x0207('0x34')]=_[_0x0207('0x37')](_0x1c767d[_0x0207('0x34')],{'$or':_['map'](_0x35085c,function(_0x24d1b2){if(_0x24d1b2[_0x0207('0x38')][_0x0207('0x39')]!==_0x0207('0x3a')){var _0x54ed63={};_0x54ed63[_0x24d1b2['field']]={'$like':'%'+_0x2e496f['query'][_0x0207('0x36')]+'%'};return _0x54ed63;}})});}_0x1c767d=_[_0x0207('0x37')]({},_0x1c767d,_0x2e496f[_0x0207('0x3b')]);var _0x272019={'where':_0x1c767d['where']};return db[_0x0207('0x28')][_0x0207('0x19')](_0x272019)[_0x0207('0x3c')](function(_0x36cca3){_0x1f6286['count']=_0x36cca3;if(_0x2e496f['query'][_0x0207('0x3d')]){_0x1c767d['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x0207('0x3e')](_0x1c767d);})[_0x0207('0x3c')](function(_0x360052){_0x1f6286['rows']=_0x360052;return _0x1f6286;})[_0x0207('0x3c')](respondWithFilteredResult(_0x5d7fac,_0x1c767d))[_0x0207('0x3f')](handleError(_0x5d7fac,null));};exports[_0x0207('0x40')]=function(_0x9527d7,_0x5473c4){var _0xba21ba={'raw':!![],'where':{'id':_0x9527d7[_0x0207('0x41')]['id']}},_0x2a89fa={};_0x2a89fa[_0x0207('0x29')]=_[_0x0207('0x2b')](db['ChatQueueReport'][_0x0207('0x42')]);_0x2a89fa[_0x0207('0x2a')]=_[_0x0207('0x2b')](_0x9527d7[_0x0207('0x2a')]);_0x2a89fa[_0x0207('0x35')]=_['intersection'](_0x2a89fa[_0x0207('0x29')],_0x2a89fa[_0x0207('0x2a')]);_0xba21ba['attributes']=_[_0x0207('0x2c')](_0x2a89fa[_0x0207('0x29')],qs[_0x0207('0x2e')](_0x9527d7[_0x0207('0x2a')][_0x0207('0x2e')]));_0xba21ba[_0x0207('0x2d')]=_0xba21ba[_0x0207('0x2d')][_0x0207('0x2f')]?_0xba21ba[_0x0207('0x2d')]:_0x2a89fa[_0x0207('0x29')];if(_0x9527d7[_0x0207('0x2a')][_0x0207('0x3d')]){_0xba21ba[_0x0207('0x43')]=[{'all':!![]}];}_0xba21ba=_['merge']({},_0xba21ba,_0x9527d7[_0x0207('0x3b')]);return db[_0x0207('0x28')][_0x0207('0x44')](_0xba21ba)[_0x0207('0x3c')](handleEntityNotFound(_0x5473c4,null))['then'](respondWithResult(_0x5473c4,null))['catch'](handleError(_0x5473c4,null));};exports[_0x0207('0x45')]=function(_0x4a4eed,_0xd13881){return db[_0x0207('0x28')]['create'](_0x4a4eed[_0x0207('0x46')],{})[_0x0207('0x3c')](respondWithResult(_0xd13881,0xc9))[_0x0207('0x3f')](handleError(_0xd13881,null));};exports['update']=function(_0x1c7b3b,_0x3b093a){if(_0x1c7b3b[_0x0207('0x46')]['id']){delete _0x1c7b3b['body']['id'];}return db[_0x0207('0x28')][_0x0207('0x44')]({'where':{'id':_0x1c7b3b[_0x0207('0x41')]['id']}})[_0x0207('0x3c')](handleEntityNotFound(_0x3b093a,null))['then'](saveUpdates(_0x1c7b3b[_0x0207('0x46')],null))[_0x0207('0x3c')](respondWithResult(_0x3b093a,null))['catch'](handleError(_0x3b093a,null));};exports['destroy']=function(_0x4ad321,_0x567782){return db['ChatQueueReport']['find']({'where':{'id':_0x4ad321[_0x0207('0x41')]['id']}})[_0x0207('0x3c')](handleEntityNotFound(_0x567782,null))[_0x0207('0x3c')](removeEntity(_0x567782,null))[_0x0207('0x3f')](handleError(_0x567782,null));};exports[_0x0207('0x47')]=function(_0x265d69,_0x4c1b48){return db['ChatQueueReport'][_0x0207('0x47')]()[_0x0207('0x3c')](respondWithResult(_0x4c1b48,null))['catch'](handleError(_0x4c1b48,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 013cc35..07ac8e6 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 _0x64a5=['../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','uniqueid','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x471a86,_0x526ce8){var _0x21a45e=function(_0x58235c){while(--_0x58235c){_0x471a86['push'](_0x471a86['shift']());}};_0x21a45e(++_0x526ce8);}(_0x64a5,0x192));var _0x564a=function(_0x55387b,_0x85625b){_0x55387b=_0x55387b-0x0;var _0x2a376d=_0x64a5[_0x55387b];return _0x2a376d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x564a('0x0'))('api');var moment=require(_0x564a('0x1'));var BPromise=require('bluebird');var rp=require(_0x564a('0x2'));var fs=require('fs');var path=require(_0x564a('0x3'));var rimraf=require(_0x564a('0x4'));var config=require(_0x564a('0x5'));var attributes=require(_0x564a('0x6'));module[_0x564a('0x7')]=function(_0x5b6cc7,_0x35ead6){return _0x5b6cc7[_0x564a('0x8')](_0x564a('0x9'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x564a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdff5=['path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x431a56,_0x1b5aee){var _0x157776=function(_0x103e61){while(--_0x103e61){_0x431a56['push'](_0x431a56['shift']());}};_0x157776(++_0x1b5aee);}(_0xdff5,0xae));var _0x5dff=function(_0x451c67,_0x202c81){_0x451c67=_0x451c67-0x0;var _0x85839b=_0xdff5[_0x451c67];return _0x85839b;};'use strict';var _=require('lodash');var util=require(_0x5dff('0x0'));var logger=require(_0x5dff('0x1'))(_0x5dff('0x2'));var moment=require(_0x5dff('0x3'));var BPromise=require(_0x5dff('0x4'));var rp=require(_0x5dff('0x5'));var fs=require('fs');var path=require(_0x5dff('0x6'));var rimraf=require(_0x5dff('0x7'));var config=require(_0x5dff('0x8'));var attributes=require(_0x5dff('0x9'));module[_0x5dff('0xa')]=function(_0x2ccbcd,_0x742949){return _0x2ccbcd[_0x5dff('0xb')](_0x5dff('0xc'),attributes,{'tableName':_0x5dff('0xd'),'paranoid':![],'indexes':[{'name':_0x5dff('0xe'),'fields':[_0x5dff('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index d564ab2..f292423 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 _0x65cb=['raw','where','attributes','UpdateChatQueueReport','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message','catch','CreateChatQueueReport','create','options','debug','ChatQueueReport','update','body'];(function(_0xb7ed1a,_0x153395){var _0x5c087d=function(_0x5ee971){while(--_0x5ee971){_0xb7ed1a['push'](_0xb7ed1a['shift']());}};_0x5c087d(++_0x153395);}(_0x65cb,0x1b8));var _0xb65c=function(_0x2aa858,_0x45592b){_0x2aa858=_0x2aa858-0x0;var _0x1bef7f=_0x65cb[_0x2aa858];return _0x1bef7f;};'use strict';var _=require(_0xb65c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb65c('0x1'));var rs=require(_0xb65c('0x2'));var fs=require('fs');var Redis=require(_0xb65c('0x3'));var db=require(_0xb65c('0x4'))['db'];var utils=require(_0xb65c('0x5'));var logger=require(_0xb65c('0x6'))('rpc');var config=require(_0xb65c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb65c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xbfb251,_0x50894e,_0x33ffa9){return new BPromise(function(_0x57bdc3,_0x35d77c){return client['request'](_0xbfb251,_0x33ffa9)[_0xb65c('0x9')](function(_0xfdabfa){logger[_0xb65c('0xa')](_0xb65c('0xb'),_0x50894e,_0xb65c('0xc'));logger['debug'](_0xb65c('0xd'),_0x50894e,'request\x20sent',JSON['stringify'](_0xfdabfa));if(_0xfdabfa[_0xb65c('0xe')]){if(_0xfdabfa[_0xb65c('0xe')]['code']===0x1f4){logger[_0xb65c('0xe')](_0xb65c('0xb'),_0x50894e,_0xfdabfa[_0xb65c('0xe')][_0xb65c('0xf')]);return _0x35d77c(_0xfdabfa[_0xb65c('0xe')]['message']);}logger['error'](_0xb65c('0xb'),_0x50894e,_0xfdabfa['error']['message']);return _0x57bdc3(_0xfdabfa[_0xb65c('0xe')]['message']);}else{logger[_0xb65c('0xa')](_0xb65c('0xb'),_0x50894e,'request\x20sent');_0x57bdc3(_0xfdabfa['result']['message']);}})[_0xb65c('0x10')](function(_0x1a9f22){logger[_0xb65c('0xe')](_0xb65c('0xb'),_0x50894e,_0x1a9f22);_0x35d77c(_0x1a9f22);});});}exports[_0xb65c('0x11')]=function(_0x2181e2){var _0x3aa235=this;return new Promise(function(_0x14d3cd,_0x5535fa){return db['ChatQueueReport'][_0xb65c('0x12')](_0x2181e2['body'],{'raw':_0x2181e2[_0xb65c('0x13')]?_0x2181e2[_0xb65c('0x13')]['raw']===undefined?!![]:![]:!![]})[_0xb65c('0x9')](function(_0x192411){logger['info'](_0xb65c('0x11'),_0x2181e2);logger[_0xb65c('0x14')]('CreateChatQueueReport',_0x2181e2,JSON['stringify'](_0x192411));_0x14d3cd(_0x192411);})[_0xb65c('0x10')](function(_0x263642){logger[_0xb65c('0xe')](_0xb65c('0x11'),_0x263642[_0xb65c('0xf')],_0x2181e2);_0x5535fa(_0x3aa235[_0xb65c('0xe')](0x1f4,_0x263642[_0xb65c('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0x200ab7){var _0x252b30=this;return new Promise(function(_0x2e2da1,_0x1ab074){return db[_0xb65c('0x15')][_0xb65c('0x16')](_0x200ab7[_0xb65c('0x17')],{'raw':_0x200ab7[_0xb65c('0x13')]?_0x200ab7[_0xb65c('0x13')][_0xb65c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x200ab7[_0xb65c('0x13')]?_0x200ab7[_0xb65c('0x13')][_0xb65c('0x19')]||null:null,'attributes':_0x200ab7['options']?_0x200ab7['options'][_0xb65c('0x1a')]||null:null,'limit':_0x200ab7[_0xb65c('0x13')]?_0x200ab7[_0xb65c('0x13')]['limit']||null:null})[_0xb65c('0x9')](function(_0x3004f8){logger[_0xb65c('0xa')]('UpdateChatQueueReport',_0x200ab7);logger['debug'](_0xb65c('0x1b'),_0x200ab7,JSON[_0xb65c('0x1c')](_0x3004f8));_0x2e2da1(_0x3004f8);})['catch'](function(_0x4de2b6){logger[_0xb65c('0xe')](_0xb65c('0x1b'),_0x4de2b6[_0xb65c('0xf')],_0x200ab7);_0x1ab074(_0x252b30[_0xb65c('0xe')](0x1f4,_0x4de2b6['message']));});});}; \ No newline at end of file +var _0xfae5=['attributes','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateChatQueueReport','create','body','options','raw','catch','UpdateChatQueueReport','ChatQueueReport','update'];(function(_0x4d584f,_0x385fcd){var _0x383793=function(_0x309159){while(--_0x309159){_0x4d584f['push'](_0x4d584f['shift']());}};_0x383793(++_0x385fcd);}(_0xfae5,0x1d0));var _0x5fae=function(_0x27d70f,_0xa6bcf5){_0x27d70f=_0x27d70f-0x0;var _0x4ae793=_0xfae5[_0x27d70f];return _0x4ae793;};'use strict';var _=require(_0x5fae('0x0'));var util=require(_0x5fae('0x1'));var moment=require('moment');var BPromise=require(_0x5fae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fae('0x3'));var db=require(_0x5fae('0x4'))['db'];var utils=require(_0x5fae('0x5'));var logger=require(_0x5fae('0x6'))(_0x5fae('0x7'));var config=require('../../config/environment');var jayson=require(_0x5fae('0x8'));var client=jayson[_0x5fae('0x9')][_0x5fae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a784e,_0x32db48,_0x12997f){return new BPromise(function(_0x5a044f,_0x3eae57){return client[_0x5fae('0xb')](_0x3a784e,_0x12997f)[_0x5fae('0xc')](function(_0x5a7e11){logger[_0x5fae('0xd')](_0x5fae('0xe'),_0x32db48,_0x5fae('0xf'));logger[_0x5fae('0x10')](_0x5fae('0x11'),_0x32db48,_0x5fae('0xf'),JSON[_0x5fae('0x12')](_0x5a7e11));if(_0x5a7e11[_0x5fae('0x13')]){if(_0x5a7e11['error'][_0x5fae('0x14')]===0x1f4){logger[_0x5fae('0x13')](_0x5fae('0xe'),_0x32db48,_0x5a7e11[_0x5fae('0x13')][_0x5fae('0x15')]);return _0x3eae57(_0x5a7e11[_0x5fae('0x13')]['message']);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x32db48,_0x5a7e11[_0x5fae('0x13')][_0x5fae('0x15')]);return _0x5a044f(_0x5a7e11[_0x5fae('0x13')][_0x5fae('0x15')]);}else{logger[_0x5fae('0xd')](_0x5fae('0xe'),_0x32db48,_0x5fae('0xf'));_0x5a044f(_0x5a7e11['result'][_0x5fae('0x15')]);}})['catch'](function(_0x16526e){logger[_0x5fae('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x32db48,_0x16526e);_0x3eae57(_0x16526e);});});}exports[_0x5fae('0x16')]=function(_0x326920){var _0x3bc14=this;return new Promise(function(_0x2a3140,_0x34a436){return db['ChatQueueReport'][_0x5fae('0x17')](_0x326920[_0x5fae('0x18')],{'raw':_0x326920[_0x5fae('0x19')]?_0x326920[_0x5fae('0x19')][_0x5fae('0x1a')]===undefined?!![]:![]:!![]})[_0x5fae('0xc')](function(_0x4e9cdf){logger[_0x5fae('0xd')](_0x5fae('0x16'),_0x326920);logger[_0x5fae('0x10')](_0x5fae('0x16'),_0x326920,JSON['stringify'](_0x4e9cdf));_0x2a3140(_0x4e9cdf);})[_0x5fae('0x1b')](function(_0x84cba8){logger[_0x5fae('0x13')](_0x5fae('0x16'),_0x84cba8['message'],_0x326920);_0x34a436(_0x3bc14[_0x5fae('0x13')](0x1f4,_0x84cba8[_0x5fae('0x15')]));});});};exports[_0x5fae('0x1c')]=function(_0x19f1aa){var _0x5c1a13=this;return new Promise(function(_0x291b58,_0x5719e2){return db[_0x5fae('0x1d')][_0x5fae('0x1e')](_0x19f1aa[_0x5fae('0x18')],{'raw':_0x19f1aa[_0x5fae('0x19')]?_0x19f1aa[_0x5fae('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19f1aa[_0x5fae('0x19')]?_0x19f1aa[_0x5fae('0x19')]['where']||null:null,'attributes':_0x19f1aa[_0x5fae('0x19')]?_0x19f1aa[_0x5fae('0x19')][_0x5fae('0x1f')]||null:null,'limit':_0x19f1aa[_0x5fae('0x19')]?_0x19f1aa['options'][_0x5fae('0x20')]||null:null})['then'](function(_0x9266c2){logger[_0x5fae('0xd')](_0x5fae('0x1c'),_0x19f1aa);logger[_0x5fae('0x10')](_0x5fae('0x1c'),_0x19f1aa,JSON[_0x5fae('0x12')](_0x9266c2));_0x291b58(_0x9266c2);})[_0x5fae('0x1b')](function(_0x476513){logger[_0x5fae('0x13')](_0x5fae('0x1c'),_0x476513[_0x5fae('0x15')],_0x19f1aa);_0x5719e2(_0x5c1a13[_0x5fae('0x13')](0x1f4,_0x476513['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 2ea565c..04ecd0d 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 _0x310e=['show','post','put','/:id','update','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x54808c,_0x36e290){var _0xe9459=function(_0x55df21){while(--_0x55df21){_0x54808c['push'](_0x54808c['shift']());}};_0xe9459(++_0x36e290);}(_0x310e,0x137));var _0xe310=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x310e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe310('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe310('0x1'));var express=require(_0xe310('0x2'));var router=express[_0xe310('0x3')]();var auth=require(_0xe310('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe310('0x5'));var controller=require(_0xe310('0x6'));router[_0xe310('0x7')]('/',auth[_0xe310('0x8')](),controller[_0xe310('0x9')]);router[_0xe310('0x7')](_0xe310('0xa'),auth[_0xe310('0x8')](),controller[_0xe310('0xb')]);router[_0xe310('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xe310('0xc')]);router[_0xe310('0xd')]('/',auth[_0xe310('0x8')](),controller['create']);router[_0xe310('0xe')](_0xe310('0xf'),auth['isAuthenticated'](),controller[_0xe310('0x10')]);router[_0xe310('0x11')](_0xe310('0xf'),auth[_0xe310('0x8')](),controller['destroy']);module[_0xe310('0x12')]=router; \ No newline at end of file +var _0x329f=['/:id','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x329f,0x11f));var _0xf329=function(_0x5f3813,_0x5b2eb6){_0x5f3813=_0x5f3813-0x0;var _0x35d363=_0x329f[_0x5f3813];return _0x35d363;};'use strict';var multer=require(_0xf329('0x0'));var util=require(_0xf329('0x1'));var path=require('path');var timeout=require(_0xf329('0x2'));var express=require(_0xf329('0x3'));var router=express[_0xf329('0x4')]();var auth=require(_0xf329('0x5'));var interaction=require(_0xf329('0x6'));var config=require(_0xf329('0x7'));var controller=require(_0xf329('0x8'));router[_0xf329('0x9')]('/',auth[_0xf329('0xa')](),controller[_0xf329('0xb')]);router['get']('/describe',auth[_0xf329('0xa')](),controller[_0xf329('0xc')]);router[_0xf329('0x9')](_0xf329('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xf329('0xe')]('/',auth['isAuthenticated'](),controller[_0xf329('0xf')]);router[_0xf329('0x10')](_0xf329('0xd'),auth[_0xf329('0xa')](),controller['update']);router[_0xf329('0x11')](_0xf329('0xd'),auth[_0xf329('0xa')](),controller[_0xf329('0x12')]);module[_0xf329('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 11000eb..381c652 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 _0x3903=['moment','exports','STRING','ENUM','account','agent','queue','NOW'];(function(_0x2ca2d0,_0x3ea8e4){var _0x521c23=function(_0x5b0731){while(--_0x5b0731){_0x2ca2d0['push'](_0x2ca2d0['shift']());}};_0x521c23(++_0x3ea8e4);}(_0x3903,0xf0));var _0x3390=function(_0x2d5620,_0x48c420){_0x2d5620=_0x2d5620-0x0;var _0x46181c=_0x3903[_0x2d5620];return _0x46181c;};'use strict';var moment=require(_0x3390('0x0'));var Sequelize=require('sequelize');module[_0x3390('0x1')]={'uniqueid':{'type':Sequelize[_0x3390('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3390('0x3')](_0x3390('0x4'),_0x3390('0x5'),_0x3390('0x6')),'allowNull':![],'defaultValue':_0x3390('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x3390('0x7')]}}; \ No newline at end of file +var _0x4f6e=['NOW','moment','sequelize','exports','account','queue','DATE'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x4f6e,0x9b));var _0xe4f6=function(_0x207431,_0xeed4e4){_0x207431=_0x207431-0x0;var _0x20175b=_0x4f6e[_0x207431];return _0x20175b;};'use strict';var moment=require(_0xe4f6('0x0'));var Sequelize=require(_0xe4f6('0x1'));module[_0xe4f6('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe4f6('0x3'),'agent',_0xe4f6('0x4')),'allowNull':![],'defaultValue':_0xe4f6('0x4')},'transferredAt':{'type':Sequelize[_0xe4f6('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe4f6('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index e23bf8b..b3d7051 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 _0x61b9=['map','key','VIRTUAL','filter','options','includeAll','include','findAll','then','rows','show','find','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','update','destroy','stack','name','send','index','ChatTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x61b9,0xe2));var _0x961b=function(_0x32f6b9,_0x2d4aa9){_0x32f6b9=_0x32f6b9-0x0;var _0x267d52=_0x61b9[_0x32f6b9];return _0x267d52;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x961b('0x0'));var rimraf=require(_0x961b('0x1'));var zipdir=require(_0x961b('0x2'));var jsonpatch=require(_0x961b('0x3'));var rp=require(_0x961b('0x4'));var moment=require(_0x961b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x961b('0x6'));var util=require(_0x961b('0x7'));var path=require(_0x961b('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x961b('0x9'));var fs=require('fs');var _=require(_0x961b('0xa'));var squel=require(_0x961b('0xb'));var crypto=require(_0x961b('0xc'));var jsforce=require(_0x961b('0xd'));var deskjs=require(_0x961b('0xe'));var toCsv=require(_0x961b('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x961b('0x10'));var authService=require(_0x961b('0x11'));var qs=require(_0x961b('0x12'));var hardwareService=require(_0x961b('0x13'));var logger=require(_0x961b('0x14'))(_0x961b('0x15'));var utils=require(_0x961b('0x16'));var config=require('../../config/environment');var db=require(_0x961b('0x17'))['db'];function respondWithStatusCode(_0x3690bb,_0x1a8a30){_0x1a8a30=_0x1a8a30||0xcc;return function(_0x468f1f){if(_0x468f1f){return _0x3690bb[_0x961b('0x18')](_0x1a8a30);}return _0x3690bb[_0x961b('0x19')](_0x1a8a30)[_0x961b('0x1a')]();};}function respondWithResult(_0x2eb008,_0x31735f){_0x31735f=_0x31735f||0xc8;return function(_0x25b8b9){if(_0x25b8b9){return _0x2eb008['status'](_0x31735f)[_0x961b('0x1b')](_0x25b8b9);}};}function respondWithFilteredResult(_0x4ba621,_0x1b927c){return function(_0x3f3b67){if(_0x3f3b67){var _0x71dcf=_0x3f3b67[_0x961b('0x1c')],_0x286db5=_0x1b927c[_0x961b('0x1d')],_0xdfa15d=_0x1b927c['offset']+_0x1b927c[_0x961b('0x1e')],_0x4af03f;if(_0xdfa15d>=_0x71dcf){_0xdfa15d=_0x71dcf;_0x4af03f=0xc8;}else{_0x4af03f=0xce;}_0x4ba621[_0x961b('0x19')](_0x4af03f);return _0x4ba621[_0x961b('0x1f')]('Content-Range',_0x286db5+'-'+_0xdfa15d+'/'+_0x71dcf)['json'](_0x3f3b67);}return null;};}function patchUpdates(_0x30ed9f){return function(_0x217fc0){try{jsonpatch['apply'](_0x217fc0,_0x30ed9f,!![]);}catch(_0x2e660f){return BPromise[_0x961b('0x20')](_0x2e660f);}return _0x217fc0['save']();};}function saveUpdates(_0x4cfe33,_0x4bdf95){return function(_0x175d19){if(_0x175d19){return _0x175d19[_0x961b('0x21')](_0x4cfe33)['then'](function(_0x1623de){return _0x1623de;});}return null;};}function removeEntity(_0x307bc6,_0x37b875){return function(_0x3013fc){if(_0x3013fc){return _0x3013fc[_0x961b('0x22')]()['then'](function(){_0x307bc6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x145743,_0x1cf186){return function(_0x5b2c60){if(!_0x5b2c60){_0x145743[_0x961b('0x18')](0x194);}return _0x5b2c60;};}function handleError(_0x5a6f8f,_0x144678){_0x144678=_0x144678||0x1f4;return function(_0x188bd3){logger['error'](_0x188bd3[_0x961b('0x23')]);if(_0x188bd3[_0x961b('0x24')]){delete _0x188bd3[_0x961b('0x24')];}_0x5a6f8f[_0x961b('0x19')](_0x144678)[_0x961b('0x25')](_0x188bd3);};}exports[_0x961b('0x26')]=function(_0x23e16a,_0x535e86){var _0x43d37e={},_0x5f46ac={},_0x1e489b={'count':0x0,'rows':[]};var _0x4a0421=db[_0x961b('0x27')][_0x961b('0x28')];_0x5f46ac[_0x961b('0x29')]=_[_0x961b('0x2a')](_0x4a0421);_0x5f46ac[_0x961b('0x2b')]=_[_0x961b('0x2a')](_0x23e16a[_0x961b('0x2b')]);_0x5f46ac[_0x961b('0x2c')]=_[_0x961b('0x2d')](_0x5f46ac['model'],_0x5f46ac['query']);_0x43d37e[_0x961b('0x2e')]=_['intersection'](_0x5f46ac[_0x961b('0x29')],qs[_0x961b('0x2f')](_0x23e16a[_0x961b('0x2b')][_0x961b('0x2f')]));_0x43d37e['attributes']=_0x43d37e['attributes'][_0x961b('0x30')]?_0x43d37e[_0x961b('0x2e')]:_0x5f46ac['model'];if(!_0x23e16a['query'][_0x961b('0x31')]('nolimit')){_0x43d37e['limit']=qs[_0x961b('0x1e')](_0x23e16a[_0x961b('0x2b')]['limit']);_0x43d37e['offset']=qs[_0x961b('0x1d')](_0x23e16a[_0x961b('0x2b')][_0x961b('0x1d')]);}_0x43d37e[_0x961b('0x32')]=qs[_0x961b('0x33')](_0x23e16a[_0x961b('0x2b')][_0x961b('0x33')]);_0x43d37e[_0x961b('0x34')]=qs[_0x961b('0x2c')](_['pick'](_0x23e16a[_0x961b('0x2b')],_0x5f46ac['filters']));if(_0x23e16a['query']['filter']){_0x43d37e[_0x961b('0x34')]=_[_0x961b('0x35')](_0x43d37e[_0x961b('0x34')],{'$or':_[_0x961b('0x36')](_0x4a0421,function(_0x5dd75f){if(_0x5dd75f['type'][_0x961b('0x37')]!==_0x961b('0x38')){var _0x410e86={};_0x410e86[_0x5dd75f['field']]={'$like':'%'+_0x23e16a[_0x961b('0x2b')][_0x961b('0x39')]+'%'};return _0x410e86;}})});}_0x43d37e=_[_0x961b('0x35')]({},_0x43d37e,_0x23e16a[_0x961b('0x3a')]);var _0x1f9030={'where':_0x43d37e['where']};return db[_0x961b('0x27')][_0x961b('0x1c')](_0x1f9030)['then'](function(_0x20a246){_0x1e489b[_0x961b('0x1c')]=_0x20a246;if(_0x23e16a[_0x961b('0x2b')][_0x961b('0x3b')]){_0x43d37e[_0x961b('0x3c')]=[{'all':!![]}];}return db[_0x961b('0x27')][_0x961b('0x3d')](_0x43d37e);})[_0x961b('0x3e')](function(_0x1cb539){_0x1e489b[_0x961b('0x3f')]=_0x1cb539;return _0x1e489b;})[_0x961b('0x3e')](respondWithFilteredResult(_0x535e86,_0x43d37e))['catch'](handleError(_0x535e86,null));};exports[_0x961b('0x40')]=function(_0x450901,_0x571748){var _0x46dcd2={'raw':!![],'where':{'id':_0x450901['params']['id']}},_0x25d909={};_0x25d909[_0x961b('0x29')]=_[_0x961b('0x2a')](db[_0x961b('0x27')][_0x961b('0x28')]);_0x25d909[_0x961b('0x2b')]=_[_0x961b('0x2a')](_0x450901[_0x961b('0x2b')]);_0x25d909[_0x961b('0x2c')]=_['intersection'](_0x25d909['model'],_0x25d909[_0x961b('0x2b')]);_0x46dcd2['attributes']=_['intersection'](_0x25d909[_0x961b('0x29')],qs[_0x961b('0x2f')](_0x450901[_0x961b('0x2b')][_0x961b('0x2f')]));_0x46dcd2[_0x961b('0x2e')]=_0x46dcd2[_0x961b('0x2e')][_0x961b('0x30')]?_0x46dcd2['attributes']:_0x25d909['model'];if(_0x450901[_0x961b('0x2b')]['includeAll']){_0x46dcd2['include']=[{'all':!![]}];}_0x46dcd2=_['merge']({},_0x46dcd2,_0x450901[_0x961b('0x3a')]);return db[_0x961b('0x27')][_0x961b('0x41')](_0x46dcd2)[_0x961b('0x3e')](handleEntityNotFound(_0x571748,null))[_0x961b('0x3e')](respondWithResult(_0x571748,null))[_0x961b('0x42')](handleError(_0x571748,null));};exports['create']=function(_0x261f0a,_0x38bfad){return db[_0x961b('0x27')]['create'](_0x261f0a['body'],{})['then'](respondWithResult(_0x38bfad,0xc9))[_0x961b('0x42')](handleError(_0x38bfad,null));};exports[_0x961b('0x21')]=function(_0x5e7504,_0x4f716a){if(_0x5e7504[_0x961b('0x43')]['id']){delete _0x5e7504[_0x961b('0x43')]['id'];}return db['ChatTransferReport'][_0x961b('0x41')]({'where':{'id':_0x5e7504[_0x961b('0x44')]['id']}})[_0x961b('0x3e')](handleEntityNotFound(_0x4f716a,null))[_0x961b('0x3e')](saveUpdates(_0x5e7504[_0x961b('0x43')],null))['then'](respondWithResult(_0x4f716a,null))[_0x961b('0x42')](handleError(_0x4f716a,null));};exports[_0x961b('0x22')]=function(_0x48a3e4,_0x391353){return db['ChatTransferReport'][_0x961b('0x41')]({'where':{'id':_0x48a3e4['params']['id']}})[_0x961b('0x3e')](handleEntityNotFound(_0x391353,null))[_0x961b('0x3e')](removeEntity(_0x391353,null))['catch'](handleError(_0x391353,null));};exports[_0x961b('0x45')]=function(_0x100dcc,_0x27271e){return db[_0x961b('0x27')]['describe']()['then'](respondWithResult(_0x27271e,null))[_0x961b('0x42')](handleError(_0x27271e,null));}; \ No newline at end of file +var _0x9b96=['Content-Range','save','update','then','error','name','send','index','ChatTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','key','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','create','body','params','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x39b1c0,_0xc2b0b6){var _0x4a4a56=function(_0x20cd34){while(--_0x20cd34){_0x39b1c0['push'](_0x39b1c0['shift']());}};_0x4a4a56(++_0xc2b0b6);}(_0x9b96,0xbb));var _0x69b9=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9b96[_0x13e741];return _0x3f8bb3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x69b9('0x0'));var rimraf=require(_0x69b9('0x1'));var zipdir=require(_0x69b9('0x2'));var jsonpatch=require(_0x69b9('0x3'));var rp=require(_0x69b9('0x4'));var moment=require(_0x69b9('0x5'));var BPromise=require(_0x69b9('0x6'));var Mustache=require(_0x69b9('0x7'));var util=require(_0x69b9('0x8'));var path=require('path');var sox=require(_0x69b9('0x9'));var csv=require(_0x69b9('0xa'));var ejs=require(_0x69b9('0xb'));var fs=require('fs');var _=require(_0x69b9('0xc'));var squel=require(_0x69b9('0xd'));var crypto=require('crypto');var jsforce=require(_0x69b9('0xe'));var deskjs=require(_0x69b9('0xf'));var toCsv=require(_0x69b9('0xa'));var querystring=require(_0x69b9('0x10'));var Papa=require('papaparse');var Redis=require(_0x69b9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x69b9('0x12'));var hardwareService=require(_0x69b9('0x13'));var logger=require('../../config/logger')(_0x69b9('0x14'));var utils=require(_0x69b9('0x15'));var config=require(_0x69b9('0x16'));var db=require(_0x69b9('0x17'))['db'];function respondWithStatusCode(_0x1446f8,_0x581b1d){_0x581b1d=_0x581b1d||0xcc;return function(_0x1e7e78){if(_0x1e7e78){return _0x1446f8[_0x69b9('0x18')](_0x581b1d);}return _0x1446f8[_0x69b9('0x19')](_0x581b1d)[_0x69b9('0x1a')]();};}function respondWithResult(_0x436695,_0x5ebbd5){_0x5ebbd5=_0x5ebbd5||0xc8;return function(_0x1b25c5){if(_0x1b25c5){return _0x436695[_0x69b9('0x19')](_0x5ebbd5)[_0x69b9('0x1b')](_0x1b25c5);}};}function respondWithFilteredResult(_0x320008,_0x26ab0c){return function(_0x54e5f9){if(_0x54e5f9){var _0x513899=_0x54e5f9[_0x69b9('0x1c')],_0x10be88=_0x26ab0c[_0x69b9('0x1d')],_0x34c928=_0x26ab0c['offset']+_0x26ab0c[_0x69b9('0x1e')],_0x28403c;if(_0x34c928>=_0x513899){_0x34c928=_0x513899;_0x28403c=0xc8;}else{_0x28403c=0xce;}_0x320008[_0x69b9('0x19')](_0x28403c);return _0x320008[_0x69b9('0x1f')](_0x69b9('0x20'),_0x10be88+'-'+_0x34c928+'/'+_0x513899)[_0x69b9('0x1b')](_0x54e5f9);}return null;};}function patchUpdates(_0xa9270b){return function(_0x24a918){try{jsonpatch['apply'](_0x24a918,_0xa9270b,!![]);}catch(_0x4088c6){return BPromise['reject'](_0x4088c6);}return _0x24a918[_0x69b9('0x21')]();};}function saveUpdates(_0x49a081,_0x4259fa){return function(_0x508e75){if(_0x508e75){return _0x508e75[_0x69b9('0x22')](_0x49a081)[_0x69b9('0x23')](function(_0x23ad1a){return _0x23ad1a;});}return null;};}function removeEntity(_0x1d3213,_0x2e7160){return function(_0x41d454){if(_0x41d454){return _0x41d454['destroy']()['then'](function(){_0x1d3213[_0x69b9('0x19')](0xcc)[_0x69b9('0x1a')]();});}};}function handleEntityNotFound(_0x543393,_0x33428e){return function(_0x511434){if(!_0x511434){_0x543393[_0x69b9('0x18')](0x194);}return _0x511434;};}function handleError(_0x1daabd,_0x3b72c9){_0x3b72c9=_0x3b72c9||0x1f4;return function(_0x4a31b7){logger[_0x69b9('0x24')](_0x4a31b7['stack']);if(_0x4a31b7['name']){delete _0x4a31b7[_0x69b9('0x25')];}_0x1daabd[_0x69b9('0x19')](_0x3b72c9)[_0x69b9('0x26')](_0x4a31b7);};}exports[_0x69b9('0x27')]=function(_0x287750,_0x4d3bf3){var _0x2fd184={},_0x2f9816={},_0x948709={'count':0x0,'rows':[]};var _0x12ad30=db[_0x69b9('0x28')][_0x69b9('0x29')];_0x2f9816[_0x69b9('0x2a')]=_[_0x69b9('0x2b')](_0x12ad30);_0x2f9816[_0x69b9('0x2c')]=_[_0x69b9('0x2b')](_0x287750['query']);_0x2f9816[_0x69b9('0x2d')]=_[_0x69b9('0x2e')](_0x2f9816['model'],_0x2f9816['query']);_0x2fd184[_0x69b9('0x2f')]=_[_0x69b9('0x2e')](_0x2f9816[_0x69b9('0x2a')],qs[_0x69b9('0x30')](_0x287750[_0x69b9('0x2c')][_0x69b9('0x30')]));_0x2fd184[_0x69b9('0x2f')]=_0x2fd184['attributes'][_0x69b9('0x31')]?_0x2fd184[_0x69b9('0x2f')]:_0x2f9816[_0x69b9('0x2a')];if(!_0x287750[_0x69b9('0x2c')][_0x69b9('0x32')](_0x69b9('0x33'))){_0x2fd184[_0x69b9('0x1e')]=qs['limit'](_0x287750['query'][_0x69b9('0x1e')]);_0x2fd184[_0x69b9('0x1d')]=qs[_0x69b9('0x1d')](_0x287750[_0x69b9('0x2c')][_0x69b9('0x1d')]);}_0x2fd184['order']=qs[_0x69b9('0x34')](_0x287750[_0x69b9('0x2c')][_0x69b9('0x34')]);_0x2fd184[_0x69b9('0x35')]=qs[_0x69b9('0x2d')](_[_0x69b9('0x36')](_0x287750[_0x69b9('0x2c')],_0x2f9816[_0x69b9('0x2d')]));if(_0x287750[_0x69b9('0x2c')][_0x69b9('0x37')]){_0x2fd184[_0x69b9('0x35')]=_[_0x69b9('0x38')](_0x2fd184[_0x69b9('0x35')],{'$or':_['map'](_0x12ad30,function(_0x16cb49){if(_0x16cb49[_0x69b9('0x39')][_0x69b9('0x3a')]!==_0x69b9('0x3b')){var _0x1bbe2d={};_0x1bbe2d[_0x16cb49['field']]={'$like':'%'+_0x287750[_0x69b9('0x2c')][_0x69b9('0x37')]+'%'};return _0x1bbe2d;}})});}_0x2fd184=_[_0x69b9('0x38')]({},_0x2fd184,_0x287750['options']);var _0x19a7d8={'where':_0x2fd184['where']};return db['ChatTransferReport']['count'](_0x19a7d8)[_0x69b9('0x23')](function(_0x24eae2){_0x948709['count']=_0x24eae2;if(_0x287750['query'][_0x69b9('0x3c')]){_0x2fd184[_0x69b9('0x3d')]=[{'all':!![]}];}return db[_0x69b9('0x28')][_0x69b9('0x3e')](_0x2fd184);})[_0x69b9('0x23')](function(_0x11074d){_0x948709[_0x69b9('0x3f')]=_0x11074d;return _0x948709;})['then'](respondWithFilteredResult(_0x4d3bf3,_0x2fd184))[_0x69b9('0x40')](handleError(_0x4d3bf3,null));};exports[_0x69b9('0x41')]=function(_0x5f5da1,_0x27d5c7){var _0x21185b={'raw':!![],'where':{'id':_0x5f5da1['params']['id']}},_0x4109e2={};_0x4109e2['model']=_[_0x69b9('0x2b')](db[_0x69b9('0x28')][_0x69b9('0x29')]);_0x4109e2['query']=_[_0x69b9('0x2b')](_0x5f5da1[_0x69b9('0x2c')]);_0x4109e2[_0x69b9('0x2d')]=_['intersection'](_0x4109e2['model'],_0x4109e2['query']);_0x21185b[_0x69b9('0x2f')]=_[_0x69b9('0x2e')](_0x4109e2[_0x69b9('0x2a')],qs[_0x69b9('0x30')](_0x5f5da1[_0x69b9('0x2c')][_0x69b9('0x30')]));_0x21185b[_0x69b9('0x2f')]=_0x21185b[_0x69b9('0x2f')][_0x69b9('0x31')]?_0x21185b[_0x69b9('0x2f')]:_0x4109e2[_0x69b9('0x2a')];if(_0x5f5da1[_0x69b9('0x2c')]['includeAll']){_0x21185b[_0x69b9('0x3d')]=[{'all':!![]}];}_0x21185b=_[_0x69b9('0x38')]({},_0x21185b,_0x5f5da1[_0x69b9('0x42')]);return db[_0x69b9('0x28')]['find'](_0x21185b)[_0x69b9('0x23')](handleEntityNotFound(_0x27d5c7,null))[_0x69b9('0x23')](respondWithResult(_0x27d5c7,null))[_0x69b9('0x40')](handleError(_0x27d5c7,null));};exports[_0x69b9('0x43')]=function(_0x4d0825,_0x525c45){return db[_0x69b9('0x28')][_0x69b9('0x43')](_0x4d0825['body'],{})['then'](respondWithResult(_0x525c45,0xc9))[_0x69b9('0x40')](handleError(_0x525c45,null));};exports[_0x69b9('0x22')]=function(_0x327605,_0x31809b){if(_0x327605[_0x69b9('0x44')]['id']){delete _0x327605[_0x69b9('0x44')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x327605[_0x69b9('0x45')]['id']}})[_0x69b9('0x23')](handleEntityNotFound(_0x31809b,null))['then'](saveUpdates(_0x327605[_0x69b9('0x44')],null))['then'](respondWithResult(_0x31809b,null))[_0x69b9('0x40')](handleError(_0x31809b,null));};exports[_0x69b9('0x46')]=function(_0x3a317b,_0x54d13b){return db[_0x69b9('0x28')][_0x69b9('0x47')]({'where':{'id':_0x3a317b[_0x69b9('0x45')]['id']}})[_0x69b9('0x23')](handleEntityNotFound(_0x54d13b,null))['then'](removeEntity(_0x54d13b,null))[_0x69b9('0x40')](handleError(_0x54d13b,null));};exports['describe']=function(_0x3b065f,_0xe0352a){return db[_0x69b9('0x28')][_0x69b9('0x48')]()[_0x69b9('0x23')](respondWithResult(_0xe0352a,null))[_0x69b9('0x40')](handleError(_0xe0352a,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 00e0096..3e11a05 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 _0x6abd=['api','moment','bluebird','request-promise','path','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','util','../../config/logger'];(function(_0x29acb1,_0x13c989){var _0x34ee8b=function(_0x24a661){while(--_0x24a661){_0x29acb1['push'](_0x29acb1['shift']());}};_0x34ee8b(++_0x13c989);}(_0x6abd,0x106));var _0xd6ab=function(_0x26ab0c,_0x1d1d76){_0x26ab0c=_0x26ab0c-0x0;var _0x39292c=_0x6abd[_0x26ab0c];return _0x39292c;};'use strict';var _=require('lodash');var util=require(_0xd6ab('0x0'));var logger=require(_0xd6ab('0x1'))(_0xd6ab('0x2'));var moment=require(_0xd6ab('0x3'));var BPromise=require(_0xd6ab('0x4'));var rp=require(_0xd6ab('0x5'));var fs=require('fs');var path=require(_0xd6ab('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd6ab('0x7'));module[_0xd6ab('0x8')]=function(_0x479d30,_0x3565f1){return _0x479d30[_0xd6ab('0x9')](_0xd6ab('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd6ab('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9ec8=['report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x4432df,_0xff40c){var _0x486752=function(_0x4de1ea){while(--_0x4de1ea){_0x4432df['push'](_0x4432df['shift']());}};_0x486752(++_0xff40c);}(_0x9ec8,0xb8));var _0x89ec=function(_0x2f3497,_0x548136){_0x2f3497=_0x2f3497-0x0;var _0x35165a=_0x9ec8[_0x2f3497];return _0x35165a;};'use strict';var _=require(_0x89ec('0x0'));var util=require(_0x89ec('0x1'));var logger=require('../../config/logger')(_0x89ec('0x2'));var moment=require(_0x89ec('0x3'));var BPromise=require(_0x89ec('0x4'));var rp=require(_0x89ec('0x5'));var fs=require('fs');var path=require(_0x89ec('0x6'));var rimraf=require(_0x89ec('0x7'));var config=require(_0x89ec('0x8'));var attributes=require('./chatTransferReport.attributes');module[_0x89ec('0x9')]=function(_0x29b99b,_0x1a5b03){return _0x29b99b[_0x89ec('0xa')]('ChatTransferReport',attributes,{'tableName':_0x89ec('0xb'),'paranoid':![],'indexes':[{'name':_0x89ec('0xc'),'fields':[_0x89ec('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 46916af..c28957a 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 _0x91ef=['then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','ChatTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x4b01a9,_0x50949a){var _0x3b8ce6=function(_0x81f5ed){while(--_0x81f5ed){_0x4b01a9['push'](_0x4b01a9['shift']());}};_0x3b8ce6(++_0x50949a);}(_0x91ef,0x136));var _0xf91e=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x91ef[_0x28aea5];return _0x6a55f9;};'use strict';var _=require(_0xf91e('0x0'));var util=require(_0xf91e('0x1'));var moment=require(_0xf91e('0x2'));var BPromise=require(_0xf91e('0x3'));var rs=require(_0xf91e('0x4'));var fs=require('fs');var Redis=require(_0xf91e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf91e('0x6'));var logger=require(_0xf91e('0x7'))('rpc');var config=require(_0xf91e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf91e('0x9')][_0xf91e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x583bb2,_0x3508fb,_0x46a48c){return new BPromise(function(_0x57cf05,_0x2785cd){return client[_0xf91e('0xb')](_0x583bb2,_0x46a48c)[_0xf91e('0xc')](function(_0x42f8ce){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x3508fb,_0xf91e('0xd'));logger[_0xf91e('0xe')](_0xf91e('0xf'),_0x3508fb,'request\x20sent',JSON['stringify'](_0x42f8ce));if(_0x42f8ce[_0xf91e('0x10')]){if(_0x42f8ce['error'][_0xf91e('0x11')]===0x1f4){logger[_0xf91e('0x10')](_0xf91e('0x12'),_0x3508fb,_0x42f8ce[_0xf91e('0x10')][_0xf91e('0x13')]);return _0x2785cd(_0x42f8ce[_0xf91e('0x10')][_0xf91e('0x13')]);}logger[_0xf91e('0x10')](_0xf91e('0x12'),_0x3508fb,_0x42f8ce[_0xf91e('0x10')][_0xf91e('0x13')]);return _0x57cf05(_0x42f8ce[_0xf91e('0x10')]['message']);}else{logger[_0xf91e('0x14')](_0xf91e('0x12'),_0x3508fb,_0xf91e('0xd'));_0x57cf05(_0x42f8ce[_0xf91e('0x15')][_0xf91e('0x13')]);}})[_0xf91e('0x16')](function(_0x194a6e){logger['error'](_0xf91e('0x12'),_0x3508fb,_0x194a6e);_0x2785cd(_0x194a6e);});});} \ No newline at end of file +var _0x7321=['request\x20sent','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x1b00be,_0xd55184){var _0x421b90=function(_0x3e63e0){while(--_0x3e63e0){_0x1b00be['push'](_0x1b00be['shift']());}};_0x421b90(++_0xd55184);}(_0x7321,0x1e1));var _0x1732=function(_0x19f8c3,_0x3c0929){_0x19f8c3=_0x19f8c3-0x0;var _0x7fbf45=_0x7321[_0x19f8c3];return _0x7fbf45;};'use strict';var _=require('lodash');var util=require(_0x1732('0x0'));var moment=require('moment');var BPromise=require(_0x1732('0x1'));var rs=require(_0x1732('0x2'));var fs=require('fs');var Redis=require(_0x1732('0x3'));var db=require(_0x1732('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1732('0x5'))(_0x1732('0x6'));var config=require(_0x1732('0x7'));var jayson=require(_0x1732('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x12f06b,_0x148c95,_0x32d8a7){return new BPromise(function(_0x127cea,_0x5597d3){return client[_0x1732('0x9')](_0x12f06b,_0x32d8a7)['then'](function(_0x29561e){logger[_0x1732('0xa')](_0x1732('0xb'),_0x148c95,'request\x20sent');logger['debug'](_0x1732('0xc'),_0x148c95,_0x1732('0xd'),JSON['stringify'](_0x29561e));if(_0x29561e[_0x1732('0xe')]){if(_0x29561e[_0x1732('0xe')][_0x1732('0xf')]===0x1f4){logger[_0x1732('0xe')](_0x1732('0xb'),_0x148c95,_0x29561e[_0x1732('0xe')]['message']);return _0x5597d3(_0x29561e[_0x1732('0xe')][_0x1732('0x10')]);}logger[_0x1732('0xe')](_0x1732('0xb'),_0x148c95,_0x29561e['error'][_0x1732('0x10')]);return _0x127cea(_0x29561e[_0x1732('0xe')][_0x1732('0x10')]);}else{logger['info'](_0x1732('0xb'),_0x148c95,_0x1732('0xd'));_0x127cea(_0x29561e[_0x1732('0x11')][_0x1732('0x10')]);}})[_0x1732('0x12')](function(_0x4c478d){logger['error'](_0x1732('0xb'),_0x148c95,_0x4c478d);_0x5597d3(_0x4c478d);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index fb10ed0..3d3e309 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 _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(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'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 +var _0x0b0e=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','delete','exports'];(function(_0x7119b9,_0x3021a0){var _0x5942a8=function(_0x32390e){while(--_0x32390e){_0x7119b9['push'](_0x7119b9['shift']());}};_0x5942a8(++_0x3021a0);}(_0x0b0e,0x187));var _0xe0b0=function(_0x309d93,_0x157662){_0x309d93=_0x309d93-0x0;var _0x2dd61d=_0x0b0e[_0x309d93];return _0x2dd61d;};'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['post']('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller['update']);router[_0xe0b0('0xf')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller['destroy']);module[_0xe0b0('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 9e3e056..12234c4 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 _0x6ac3=['alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','randomstring','exports','STRING','address','email','Agent','#9f946a','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','BOOLEAN','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Feedback','star','thumb','TEXT','stringify','input','name','text','getDataValue','parse','onlineForm','textarea','Comments','offlineForm','setDataValue','generate','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right'];(function(_0x179b53,_0x31f6fe){var _0x38a146=function(_0x33f0c2){while(--_0x33f0c2){_0x179b53['push'](_0x179b53['shift']());}};_0x38a146(++_0x31f6fe);}(_0x6ac3,0x119));var _0x36ac=function(_0x154991,_0x46fee2){_0x154991=_0x154991-0x0;var _0x43ea5f=_0x6ac3[_0x154991];return _0x43ea5f;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x36ac('0x0'));module[_0x36ac('0x1')]={'name':{'type':Sequelize[_0x36ac('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x36ac('0x2')],'allowNull':![],'unique':_0x36ac('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':_0x36ac('0x4')},'mapKeyOffline':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':_0x36ac('0x4')},'key':{'type':Sequelize[_0x36ac('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':_0x36ac('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x36ac('0x2')],'allowNull':![],'defaultValue':_0x36ac('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x36ac('0x2')],'allowNull':![],'defaultValue':_0x36ac('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x36ac('0x2')],'allowNull':![],'defaultValue':_0x36ac('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x36ac('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x36ac('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x36ac('0x9')](_0x36ac('0xa'),_0x36ac('0xb')),'defaultValue':_0x36ac('0xa')},'header_online':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':_0x36ac('0xc')},'start_chat_button':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':_0x36ac('0xd')},'offline_chat_button':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':_0x36ac('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x36ac('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x36ac('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x36ac('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x36ac('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x36ac('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':_0x36ac('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x36ac('0x13')},'placeholderMessage':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':_0x36ac('0x14')},'closingMessage':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':_0x36ac('0xe')},'skipMessageButton':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x36ac('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x36ac('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x36ac('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x36ac('0x15')},'ratingType':{'type':Sequelize[_0x36ac('0x9')](_0x36ac('0x16'),_0x36ac('0x17')),'defaultValue':_0x36ac('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x36ac('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x36ac('0x18')],'defaultValue':function(){return JSON[_0x36ac('0x19')]({'items':[{'type':_0x36ac('0x1a'),'variable':null,'config':{'placeholder':_0x36ac('0x1b'),'type':_0x36ac('0x1c'),'required':!![]},'props':{'title':_0x36ac('0x1b'),'helpText':''}},{'type':_0x36ac('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x36ac('0x4'),'type':_0x36ac('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x36ac('0x1d')]('onlineForm')?JSON[_0x36ac('0x1e')](this[_0x36ac('0x1d')](_0x36ac('0x1f'))):{};},'set':function(_0x1a086a){return this['setDataValue']('onlineForm',JSON[_0x36ac('0x19')](_0x1a086a));}},'offlineForm':{'type':Sequelize[_0x36ac('0x18')],'defaultValue':function(){return JSON[_0x36ac('0x19')]({'items':[{'type':'input','props':{'title':_0x36ac('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x36ac('0x4'),'type':_0x36ac('0x4')},'variable':null},{'type':_0x36ac('0x20'),'config':{'placeholder':_0x36ac('0x21')},'props':{'title':_0x36ac('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x36ac('0x22'))?JSON[_0x36ac('0x1e')](this[_0x36ac('0x1d')]('offlineForm')):{};},'set':function(_0x531043){return this[_0x36ac('0x23')](_0x36ac('0x22'),JSON[_0x36ac('0x19')](_0x531043));}},'token':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':function(){return rs[_0x36ac('0x24')]();}},'autoclose':{'type':Sequelize[_0x36ac('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x36ac('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x36ac('0xf')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x36ac('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x36ac('0x2')]},'waitingTitle':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x36ac('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':_0x36ac('0x25')},'skipUnmanaged':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':_0x36ac('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x36ac('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x36ac('0x2')]},'notificationTemplate':{'type':Sequelize[_0x36ac('0x18')],'defaultValue':function(){return _0x36ac('0x26');}},'notificationSound':{'type':Sequelize[_0x36ac('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x36ac('0xf')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x36ac('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x36ac('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':_0x36ac('0x28')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x36ac('0x2')],'defaultValue':_0x36ac('0x29')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x36ac('0x18')]},'showCustomerAvatar':{'type':Sequelize[_0x36ac('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x36ac('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x36ac('0x2')],'allowNull':![],'defaultValue':_0x36ac('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x36ac('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x36ac('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x36ac('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x36ac('0x2b')},'systemAvatar':{'type':Sequelize[_0x36ac('0x18')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x36ac('0x8')],'comment':_0x36ac('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x36ac('0xf')],'defaultValue':![],'comment':_0x36ac('0x2d'),'set':function(_0x5cd85c){if(!_0x5cd85c)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x36ac('0x23')]('mandatoryDisposition',_0x5cd85c);}}}; \ No newline at end of file +var _0xd7a1=['offlineForm','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','email','Agent','#9f946a','#ffffff','BOOLEAN','squared','rounded','We\x20are\x20here!','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments'];(function(_0x566168,_0x4c39af){var _0x4e1f7a=function(_0x5ec3ee){while(--_0x5ec3ee){_0x566168['push'](_0x566168['shift']());}};_0x4e1f7a(++_0x4c39af);}(_0xd7a1,0x91));var _0x1d7a=function(_0x2dd324,_0x2d0881){_0x2dd324=_0x2dd324-0x0;var _0x33bc5c=_0xd7a1[_0x2dd324];return _0x33bc5c;};'use strict';var Sequelize=require(_0x1d7a('0x0'));var rs=require(_0x1d7a('0x1'));module[_0x1d7a('0x2')]={'name':{'type':Sequelize[_0x1d7a('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x1d7a('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':_0x1d7a('0x4')},'mapKeyOffline':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':_0x1d7a('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':_0x1d7a('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x1d7a('0x3')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x1d7a('0x3')],'allowNull':![],'defaultValue':_0x1d7a('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x1d7a('0x3')],'allowNull':![],'defaultValue':_0x1d7a('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1d7a('0x3')]},'animation':{'type':Sequelize[_0x1d7a('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0x1d7a('0x9')),'defaultValue':_0x1d7a('0xa')},'header_online':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':_0x1d7a('0xb')},'start_chat_button':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':_0x1d7a('0xc')},'download_transcript':{'type':Sequelize[_0x1d7a('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x1d7a('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':_0x1d7a('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x1d7a('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1d7a('0xf')]},'closingQuestion':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':_0x1d7a('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':_0x1d7a('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x1d7a('0x12')},'placeholderMessage':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':_0x1d7a('0x13')},'closingMessage':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':_0x1d7a('0x14')},'closingMessageButton':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':_0x1d7a('0x15')},'skipMessageButton':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':_0x1d7a('0x16')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1d7a('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1d7a('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x1d7a('0x17')},'ratingType':{'type':Sequelize['ENUM'](_0x1d7a('0x18'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x1d7a('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x1d7a('0xf')],'defaultValue':function(){return JSON[_0x1d7a('0x19')]({'items':[{'type':_0x1d7a('0x1a'),'variable':null,'config':{'placeholder':_0x1d7a('0x1b'),'type':'text','required':!![]},'props':{'title':_0x1d7a('0x1b'),'helpText':''}},{'type':_0x1d7a('0x1a'),'props':{'title':_0x1d7a('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x1d7a('0x4'),'type':_0x1d7a('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x1d7a('0x1c')](_0x1d7a('0x1d'))?JSON[_0x1d7a('0x1e')](this['getDataValue']('onlineForm')):{};},'set':function(_0x2c87cf){return this[_0x1d7a('0x1f')](_0x1d7a('0x1d'),JSON['stringify'](_0x2c87cf));}},'offlineForm':{'type':Sequelize[_0x1d7a('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x1d7a('0x1a'),'props':{'title':_0x1d7a('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x1d7a('0x4'),'type':_0x1d7a('0x4')},'variable':null},{'type':_0x1d7a('0x20'),'config':{'placeholder':_0x1d7a('0x21')},'props':{'title':_0x1d7a('0x21'),'helpText':_0x1d7a('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x1d7a('0x1c')](_0x1d7a('0x23'))?JSON[_0x1d7a('0x1e')](this[_0x1d7a('0x1c')](_0x1d7a('0x23'))):{};},'set':function(_0xd10aa7){return this[_0x1d7a('0x1f')](_0x1d7a('0x23'),JSON[_0x1d7a('0x19')](_0xd10aa7));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x1d7a('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1d7a('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1d7a('0x3')]},'forwardOffline':{'type':Sequelize[_0x1d7a('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1d7a('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':_0x1d7a('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x1d7a('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':_0x1d7a('0x25')},'skipUnmanaged':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':_0x1d7a('0x15')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x1d7a('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x1d7a('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1d7a('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':_0x1d7a('0x26')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':_0x1d7a('0x27')},'verticalAlignment':{'type':Sequelize[_0x1d7a('0xd')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x1d7a('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x1d7a('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1d7a('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1d7a('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1d7a('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1d7a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1d7a('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x1d7a('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1d7a('0xd')],'comment':_0x1d7a('0x29')},'mandatoryDisposition':{'type':Sequelize[_0x1d7a('0x8')],'defaultValue':![],'comment':_0x1d7a('0x2a'),'set':function(_0x27e994){if(!_0x27e994)this[_0x1d7a('0x1f')](_0x1d7a('0x2b'),null);this[_0x1d7a('0x1f')](_0x1d7a('0x2c'),_0x27e994);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 4f3a94d..38fab03 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 _0xb694=['VIRTUAL','field','filter','options','includeAll','include','rows','show','params','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','describe','ChatWebsiteId','getDispositions','findOne','Disposition','rawAttributes','filters','length','removeDispositions','ids','addAnswer','CannedAnswer','map','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','sitepic','../../config/license/util','getLicense','custom','existsSync','server/files/images/logos/','download','getAvatar','isNil','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','chat','CmContact','ValidationError','createdAt','updatedAt','difference','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','Applications','List','account','applications','list','orderBy','asc','defaults','contact','cf-connecting-ip','x-forwarded-for','split','lastName','x-real-port','browser','version','format','unknown','%s\x20%s','device','vendor','type','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','port','secure','authentication','auth','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','Owner','internal','Tags','color','tag','findAll','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','some','readFileSync','server/files/chat/iframe.js','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','addApplications','sequelize','transaction','ChatApplication','bulkCreate','findAndCountAll','priority','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','addAgents','emit','userChatWebsite:save','removeAgents','isArray','getAgents','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','test','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','end','status','count','offset','limit','set','json','save','update','destroy','then','get','stack','name','send','index','mandatoryDispositionPause','ChatWebsite','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','key'];(function(_0x35337a,_0xb7a286){var _0xb5de4a=function(_0x288c68){while(--_0x288c68){_0x35337a['push'](_0x35337a['shift']());}};_0xb5de4a(++_0xb7a286);}(_0xb694,0x1ef));var _0x4b69=function(_0x4ba0bf,_0x739f6b){_0x4ba0bf=_0x4ba0bf-0x0;var _0xe5ee34=_0xb694[_0x4ba0bf];return _0xe5ee34;};'use strict';var pdf=require(_0x4b69('0x0'));var emlformat=require(_0x4b69('0x1'));var rimraf=require(_0x4b69('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4b69('0x3'));var moment=require(_0x4b69('0x4'));var BPromise=require(_0x4b69('0x5'));var Mustache=require('mustache');var util=require(_0x4b69('0x6'));var path=require(_0x4b69('0x7'));var sox=require(_0x4b69('0x8'));var csv=require('to-csv');var ejs=require(_0x4b69('0x9'));var fs=require('fs');var _=require(_0x4b69('0xa'));var squel=require(_0x4b69('0xb'));var crypto=require(_0x4b69('0xc'));var jsforce=require(_0x4b69('0xd'));var deskjs=require(_0x4b69('0xe'));var toCsv=require(_0x4b69('0xf'));var querystring=require(_0x4b69('0x10'));var Papa=require('papaparse');var Redis=require(_0x4b69('0x11'));var authService=require(_0x4b69('0x12'));var qs=require(_0x4b69('0x13'));var hardwareService=require(_0x4b69('0x14'));var logger=require(_0x4b69('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x4b69('0x16'));var db=require(_0x4b69('0x17'))['db'];config['redis']=_['defaults'](config[_0x4b69('0x18')],{'host':_0x4b69('0x19'),'port':0x18eb});var socket=require(_0x4b69('0x1a'))(new Redis(config[_0x4b69('0x18')]));require(_0x4b69('0x1b'))['register'](socket);var jayson=require(_0x4b69('0x1c'));var client=jayson[_0x4b69('0x1d')][_0x4b69('0x1e')]({'port':0x232c});var client9002=jayson[_0x4b69('0x1d')]['http']({'port':0x232a});var client9003=jayson[_0x4b69('0x1d')][_0x4b69('0x1e')]({'port':0x232b});function checkPasswordPattern(_0x2a330f,_0x123e7c,_0x190205){if(_0x190205){var _0x4540a2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4540a2[_0x4b69('0x1f')](_0x123e7c)){return _0x2a330f;}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 _0x2a330f;}}function respondWithRpcPromise(_0x303049,_0x741864,_0x348181,_0x4202a8){return new BPromise(function(_0x387a3e,_0x1deabb){var _0x6d0b6a=_0x4202a8||client;return _0x6d0b6a['request'](_0x303049,_0x348181)['then'](function(_0x59fd42){logger['info'](_0x4b69('0x20'),_0x741864,_0x4b69('0x21'));logger[_0x4b69('0x22')](_0x4b69('0x23'),_0x741864,_0x4b69('0x21'),JSON[_0x4b69('0x24')](_0x59fd42));if(_0x59fd42[_0x4b69('0x25')]){if(_0x59fd42[_0x4b69('0x25')][_0x4b69('0x26')]===0x1f4){logger[_0x4b69('0x25')](_0x4b69('0x20'),_0x741864,_0x59fd42[_0x4b69('0x25')]['message']);return _0x1deabb(_0x59fd42['error']['message']);}logger[_0x4b69('0x25')](_0x4b69('0x20'),_0x741864,_0x59fd42['error'][_0x4b69('0x27')]);return _0x387a3e(_0x59fd42[_0x4b69('0x25')][_0x4b69('0x27')]);}else{logger[_0x4b69('0x28')]('ChatWebsite,\x20%s,\x20%s',_0x741864,_0x4b69('0x21'));_0x387a3e(_0x59fd42[_0x4b69('0x29')]['message']);}})['catch'](function(_0x67027e){logger[_0x4b69('0x25')](_0x4b69('0x20'),_0x741864,_0x67027e);_0x1deabb(_0x67027e);});});}function respondWithStatusCode(_0x320ac0,_0x51223b){_0x51223b=_0x51223b||0xcc;return function(_0x2a2da6){if(_0x2a2da6){return _0x320ac0[_0x4b69('0x2a')](_0x51223b);}return _0x320ac0['status'](_0x51223b)[_0x4b69('0x2b')]();};}function respondWithResult(_0x2f2409,_0x4c71ab){_0x4c71ab=_0x4c71ab||0xc8;return function(_0x4893bf){if(_0x4893bf){return _0x2f2409[_0x4b69('0x2c')](_0x4c71ab)['json'](_0x4893bf);}};}function respondWithFilteredResult(_0x2a05e4,_0x29bcd3){return function(_0x41ea47){if(_0x41ea47){var _0x116821=_0x41ea47[_0x4b69('0x2d')],_0x4ab195=_0x29bcd3[_0x4b69('0x2e')],_0x48985d=_0x29bcd3[_0x4b69('0x2e')]+_0x29bcd3[_0x4b69('0x2f')],_0x4cfe32;if(_0x48985d>=_0x116821){_0x48985d=_0x116821;_0x4cfe32=0xc8;}else{_0x4cfe32=0xce;}_0x2a05e4['status'](_0x4cfe32);return _0x2a05e4[_0x4b69('0x30')]('Content-Range',_0x4ab195+'-'+_0x48985d+'/'+_0x116821)[_0x4b69('0x31')](_0x41ea47);}return null;};}function patchUpdates(_0x2df15e){return function(_0x298c97){try{jsonpatch['apply'](_0x298c97,_0x2df15e,!![]);}catch(_0x52ebec){return BPromise['reject'](_0x52ebec);}return _0x298c97[_0x4b69('0x32')]();};}function saveUpdates(_0x5ce364,_0x51db43){return function(_0x12e923){if(_0x12e923){return _0x12e923[_0x4b69('0x33')](_0x5ce364)['then'](function(_0x550ece){return _0x550ece;});}return null;};}function removeEntity(_0x478514,_0x4d0bb6){return function(_0x4d5d5a){if(_0x4d5d5a){return _0x4d5d5a[_0x4b69('0x34')]()[_0x4b69('0x35')](function(){var _0x5af2d5=_0x4d5d5a[_0x4b69('0x36')]({'plain':!![]});var _0x1d7423='ChatWebsites';return db['UserProfileResource'][_0x4b69('0x34')]({'where':{'type':_0x1d7423,'resourceId':_0x5af2d5['id']}})[_0x4b69('0x35')](function(){return _0x4d5d5a;});})[_0x4b69('0x35')](function(){_0x478514[_0x4b69('0x2c')](0xcc)[_0x4b69('0x2b')]();});}};}function handleEntityNotFound(_0x33e151,_0x1c3bd4){return function(_0x499aca){if(!_0x499aca){_0x33e151[_0x4b69('0x2a')](0x194);}return _0x499aca;};}function handleError(_0x569876,_0x7c1931){_0x7c1931=_0x7c1931||0x1f4;return function(_0x1cf7c9){logger[_0x4b69('0x25')](_0x1cf7c9[_0x4b69('0x37')]);if(_0x1cf7c9[_0x4b69('0x38')]){delete _0x1cf7c9[_0x4b69('0x38')];}_0x569876[_0x4b69('0x2c')](_0x7c1931)[_0x4b69('0x39')](_0x1cf7c9);};}exports[_0x4b69('0x3a')]=function(_0x30148d,_0x15db55){var _0x16e60b={'include':[{'model':db['Pause'],'as':_0x4b69('0x3b')}]},_0x51a016={},_0x54b8a5={'count':0x0,'rows':[]};var _0x44a82a=db[_0x4b69('0x3c')]['rawAttributes'];_0x51a016[_0x4b69('0x3d')]=_['keys'](_0x44a82a);_0x51a016[_0x4b69('0x3e')]=_[_0x4b69('0x3f')](_0x30148d[_0x4b69('0x3e')]);_0x51a016['filters']=_[_0x4b69('0x40')](_0x51a016[_0x4b69('0x3d')],_0x51a016[_0x4b69('0x3e')]);_0x16e60b[_0x4b69('0x41')]=_[_0x4b69('0x40')](_0x51a016[_0x4b69('0x3d')],qs[_0x4b69('0x42')](_0x30148d[_0x4b69('0x3e')][_0x4b69('0x42')]));_0x16e60b[_0x4b69('0x41')]=_0x16e60b[_0x4b69('0x41')]['length']?_0x16e60b[_0x4b69('0x41')]:_0x51a016['model'];if(!_0x30148d['query'][_0x4b69('0x43')](_0x4b69('0x44'))){_0x16e60b['limit']=qs[_0x4b69('0x2f')](_0x30148d[_0x4b69('0x3e')][_0x4b69('0x2f')]);_0x16e60b[_0x4b69('0x2e')]=qs[_0x4b69('0x2e')](_0x30148d[_0x4b69('0x3e')][_0x4b69('0x2e')]);}_0x16e60b[_0x4b69('0x45')]=qs[_0x4b69('0x46')](_0x30148d[_0x4b69('0x3e')][_0x4b69('0x46')]);_0x16e60b['where']=qs['filters'](_[_0x4b69('0x47')](_0x30148d[_0x4b69('0x3e')],_0x51a016['filters']));if(_0x30148d[_0x4b69('0x3e')]['filter']){_0x16e60b[_0x4b69('0x48')]=_[_0x4b69('0x49')](_0x16e60b[_0x4b69('0x48')],{'$or':_['map'](_0x44a82a,function(_0x439b2c){if(_0x439b2c['type'][_0x4b69('0x4a')]!==_0x4b69('0x4b')){var _0x4ddb6c={};_0x4ddb6c[_0x439b2c[_0x4b69('0x4c')]]={'$like':'%'+_0x30148d['query'][_0x4b69('0x4d')]+'%'};return _0x4ddb6c;}})});}_0x16e60b=_['merge']({},_0x16e60b,_0x30148d[_0x4b69('0x4e')]);var _0x314a11={'where':_0x16e60b[_0x4b69('0x48')]};return db['ChatWebsite'][_0x4b69('0x2d')](_0x314a11)['then'](function(_0x265a46){_0x54b8a5['count']=_0x265a46;if(_0x30148d['query'][_0x4b69('0x4f')]){_0x16e60b[_0x4b69('0x50')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x16e60b);})[_0x4b69('0x35')](function(_0x36327e){_0x54b8a5[_0x4b69('0x51')]=_0x36327e;return _0x54b8a5;})[_0x4b69('0x35')](respondWithFilteredResult(_0x15db55,_0x16e60b))['catch'](handleError(_0x15db55,null));};exports[_0x4b69('0x52')]=function(_0x489405,_0x3f44b1){var _0x1131f0={'raw':![],'where':{'id':_0x489405[_0x4b69('0x53')]['id']},'include':[{'model':db[_0x4b69('0x54')],'as':_0x4b69('0x3b')}]},_0x2cbf9b={};_0x2cbf9b[_0x4b69('0x3d')]=_[_0x4b69('0x3f')](db['ChatWebsite']['rawAttributes']);_0x2cbf9b[_0x4b69('0x3e')]=_['keys'](_0x489405[_0x4b69('0x3e')]);_0x2cbf9b['filters']=_[_0x4b69('0x40')](_0x2cbf9b['model'],_0x2cbf9b[_0x4b69('0x3e')]);_0x1131f0[_0x4b69('0x41')]=_['intersection'](_0x2cbf9b[_0x4b69('0x3d')],qs[_0x4b69('0x42')](_0x489405[_0x4b69('0x3e')][_0x4b69('0x42')]));_0x1131f0[_0x4b69('0x41')]=_0x1131f0[_0x4b69('0x41')]['length']?_0x1131f0[_0x4b69('0x41')]:_0x2cbf9b[_0x4b69('0x3d')];if(_0x489405[_0x4b69('0x3e')][_0x4b69('0x4f')]){_0x1131f0['include']=[{'all':!![]}];}_0x1131f0=_[_0x4b69('0x49')]({},_0x1131f0,_0x489405[_0x4b69('0x4e')]);return db[_0x4b69('0x3c')][_0x4b69('0x55')](_0x1131f0)[_0x4b69('0x35')](handleEntityNotFound(_0x3f44b1,null))['then'](respondWithResult(_0x3f44b1,null))['catch'](handleError(_0x3f44b1,null));};exports[_0x4b69('0x56')]=function(_0x2d1edb,_0x161557){return db[_0x4b69('0x3c')][_0x4b69('0x56')](_0x2d1edb[_0x4b69('0x57')],{})['then'](function(_0x110ead){var _0x3d013b=_0x2d1edb[_0x4b69('0x58')][_0x4b69('0x36')]({'plain':!![]});if(!_0x3d013b)throw new Error(_0x4b69('0x59'));if(_0x3d013b['role']===_0x4b69('0x58')){var _0xf8f6a9=_0x110ead[_0x4b69('0x36')]({'plain':!![]});var _0x1cd67c=_0x4b69('0x5a');return db[_0x4b69('0x5b')][_0x4b69('0x55')]({'where':{'name':_0x1cd67c,'userProfileId':_0x3d013b['userProfileId']},'raw':!![]})[_0x4b69('0x35')](function(_0x509233){if(_0x509233&&_0x509233[_0x4b69('0x5c')]===0x0){return db[_0x4b69('0x5d')][_0x4b69('0x56')]({'name':_0xf8f6a9['name'],'resourceId':_0xf8f6a9['id'],'type':_0x509233['name'],'sectionId':_0x509233['id']},{})[_0x4b69('0x35')](function(){return _0x110ead;});}else{return _0x110ead;}})['catch'](function(_0x164482){logger['error'](_0x4b69('0x5e'),_0x164482);throw _0x164482;});}return _0x110ead;})[_0x4b69('0x35')](respondWithResult(_0x161557,0xc9))['catch'](handleError(_0x161557,null));};exports[_0x4b69('0x33')]=function(_0xe05273,_0x31aab4){if(_0xe05273[_0x4b69('0x57')]['id']){delete _0xe05273['body']['id'];}return db[_0x4b69('0x3c')]['find']({'where':{'id':_0xe05273[_0x4b69('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x4b69('0x3b')}]})[_0x4b69('0x35')](handleEntityNotFound(_0x31aab4,null))[_0x4b69('0x35')](saveUpdates(_0xe05273['body'],null))[_0x4b69('0x35')](respondWithResult(_0x31aab4,null))['catch'](handleError(_0x31aab4,null));};exports[_0x4b69('0x34')]=function(_0x926d58,_0x328a4c){return db[_0x4b69('0x3c')][_0x4b69('0x55')]({'where':{'id':_0x926d58[_0x4b69('0x53')]['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x328a4c,null))[_0x4b69('0x35')](removeEntity(_0x328a4c,null))[_0x4b69('0x5f')](handleError(_0x328a4c,null));};exports[_0x4b69('0x60')]=function(_0x1f1af2,_0x2e8e3f){return db[_0x4b69('0x3c')][_0x4b69('0x60')]()[_0x4b69('0x35')](respondWithResult(_0x2e8e3f,null))[_0x4b69('0x5f')](handleError(_0x2e8e3f,null));};exports['addDisposition']=function(_0x249450,_0x569bc4,_0xa67d19){if(_0x249450[_0x4b69('0x57')]['id']){delete _0x249450[_0x4b69('0x57')]['id'];}return db['ChatWebsite'][_0x4b69('0x55')]({'where':{'id':_0x249450[_0x4b69('0x53')]['id']}})['then'](handleEntityNotFound(_0x569bc4,null))[_0x4b69('0x35')](function(_0xa624ba){if(_0xa624ba){_0x249450[_0x4b69('0x57')][_0x4b69('0x61')]=_0xa624ba['id'];return db['Disposition'][_0x4b69('0x56')](_0x249450[_0x4b69('0x57')]);}})[_0x4b69('0x35')](respondWithResult(_0x569bc4,null))[_0x4b69('0x5f')](handleError(_0x569bc4,null));};exports[_0x4b69('0x62')]=function(_0x1b5238,_0x451513,_0x37f028){var _0x33a838={'raw':![],'where':{}};var _0x10d033={};var _0x290fb9={'count':0x0,'rows':[]};return db[_0x4b69('0x3c')][_0x4b69('0x63')]({'where':{'id':_0x1b5238[_0x4b69('0x53')]['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x451513,null))[_0x4b69('0x35')](function(_0x18b515){if(_0x18b515){_0x10d033['model']=_['keys'](db[_0x4b69('0x64')][_0x4b69('0x65')]);_0x10d033[_0x4b69('0x3e')]=_[_0x4b69('0x3f')](_0x1b5238['query']);_0x10d033[_0x4b69('0x66')]=_[_0x4b69('0x40')](_0x10d033['model'],_0x10d033[_0x4b69('0x3e')]);_0x33a838[_0x4b69('0x41')]=_[_0x4b69('0x40')](_0x10d033[_0x4b69('0x3d')],qs[_0x4b69('0x42')](_0x1b5238['query'][_0x4b69('0x42')]));_0x33a838[_0x4b69('0x41')]=_0x33a838[_0x4b69('0x41')][_0x4b69('0x67')]?_0x33a838[_0x4b69('0x41')]:_0x10d033[_0x4b69('0x3d')];if(!_0x1b5238['query'][_0x4b69('0x43')](_0x4b69('0x44'))){_0x33a838[_0x4b69('0x2f')]=qs[_0x4b69('0x2f')](_0x1b5238['query']['limit']);_0x33a838['offset']=qs[_0x4b69('0x2e')](_0x1b5238[_0x4b69('0x3e')][_0x4b69('0x2e')]);}_0x33a838['order']=qs[_0x4b69('0x46')](_0x1b5238[_0x4b69('0x3e')]['sort']);_0x33a838[_0x4b69('0x48')]=qs[_0x4b69('0x66')](_['pick'](_0x1b5238[_0x4b69('0x3e')],_0x10d033[_0x4b69('0x66')]));_0x33a838[_0x4b69('0x48')][_0x4b69('0x61')]=_0x18b515['id'];if(_0x1b5238['query']['filter']){_0x33a838['where']=_[_0x4b69('0x49')](_0x33a838['where'],{'$or':_['map'](_0x33a838['attributes'],function(_0x174ff9){var _0x39372a={};_0x39372a[_0x174ff9]={'$like':'%'+_0x1b5238[_0x4b69('0x3e')]['filter']+'%'};return _0x39372a;})});}_0x33a838=_['merge']({},_0x33a838,_0x1b5238['options']);return db[_0x4b69('0x64')]['count']({'where':_0x33a838['where']})[_0x4b69('0x35')](function(_0x2d3a2e){_0x290fb9[_0x4b69('0x2d')]=_0x2d3a2e;if(_0x1b5238[_0x4b69('0x3e')][_0x4b69('0x4f')]){_0x33a838['include']=[{'all':!![]}];}return db[_0x4b69('0x64')]['findAll'](_0x33a838);})[_0x4b69('0x35')](function(_0x38e0a7){_0x290fb9[_0x4b69('0x51')]=_0x38e0a7;return _0x290fb9;});}})[_0x4b69('0x35')](respondWithFilteredResult(_0x451513,_0x33a838))[_0x4b69('0x5f')](handleError(_0x451513,null));};exports[_0x4b69('0x68')]=function(_0x234336,_0x37b4f3,_0x34cbac){return db[_0x4b69('0x3c')]['find']({'where':{'id':_0x234336[_0x4b69('0x53')]['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x37b4f3,null))['then'](function(_0x357a3f){if(_0x357a3f){return _0x357a3f[_0x4b69('0x68')](_0x234336[_0x4b69('0x3e')][_0x4b69('0x69')]);}})[_0x4b69('0x35')](respondWithStatusCode(_0x37b4f3,null))['catch'](handleError(_0x37b4f3,null));};exports[_0x4b69('0x6a')]=function(_0x2b8c93,_0x4687f8,_0x2f1bcb){if(_0x2b8c93['body']['id']){delete _0x2b8c93[_0x4b69('0x57')]['id'];}return db[_0x4b69('0x3c')][_0x4b69('0x55')]({'where':{'id':_0x2b8c93['params']['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x4687f8,null))['then'](function(_0xa152e8){if(_0xa152e8){_0x2b8c93[_0x4b69('0x57')]['ChatWebsiteId']=_0xa152e8['id'];return db[_0x4b69('0x6b')]['create'](_0x2b8c93[_0x4b69('0x57')]);}})[_0x4b69('0x35')](respondWithResult(_0x4687f8,null))[_0x4b69('0x5f')](handleError(_0x4687f8,null));};exports['getAnswers']=function(_0x44add0,_0x202d3d,_0x272735){var _0xc58392={'raw':![],'where':{}};var _0x21cf86={};var _0x53b7de={'count':0x0,'rows':[]};return db[_0x4b69('0x3c')][_0x4b69('0x63')]({'where':{'id':_0x44add0[_0x4b69('0x53')]['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x202d3d,null))[_0x4b69('0x35')](function(_0x7b683){if(_0x7b683){_0x21cf86[_0x4b69('0x3d')]=_[_0x4b69('0x3f')](db['CannedAnswer'][_0x4b69('0x65')]);_0x21cf86[_0x4b69('0x3e')]=_[_0x4b69('0x3f')](_0x44add0[_0x4b69('0x3e')]);_0x21cf86[_0x4b69('0x66')]=_[_0x4b69('0x40')](_0x21cf86[_0x4b69('0x3d')],_0x21cf86[_0x4b69('0x3e')]);_0xc58392[_0x4b69('0x41')]=_['intersection'](_0x21cf86[_0x4b69('0x3d')],qs['fields'](_0x44add0[_0x4b69('0x3e')][_0x4b69('0x42')]));_0xc58392[_0x4b69('0x41')]=_0xc58392[_0x4b69('0x41')]['length']?_0xc58392['attributes']:_0x21cf86[_0x4b69('0x3d')];if(!_0x44add0[_0x4b69('0x3e')][_0x4b69('0x43')](_0x4b69('0x44'))){_0xc58392[_0x4b69('0x2f')]=qs[_0x4b69('0x2f')](_0x44add0[_0x4b69('0x3e')][_0x4b69('0x2f')]);_0xc58392[_0x4b69('0x2e')]=qs['offset'](_0x44add0[_0x4b69('0x3e')][_0x4b69('0x2e')]);}_0xc58392[_0x4b69('0x45')]=qs[_0x4b69('0x46')](_0x44add0[_0x4b69('0x3e')][_0x4b69('0x46')]);_0xc58392[_0x4b69('0x48')]=qs[_0x4b69('0x66')](_[_0x4b69('0x47')](_0x44add0['query'],_0x21cf86[_0x4b69('0x66')]));_0xc58392['where'][_0x4b69('0x61')]=_0x7b683['id'];if(_0x44add0[_0x4b69('0x3e')][_0x4b69('0x4d')]){_0xc58392[_0x4b69('0x48')]=_[_0x4b69('0x49')](_0xc58392[_0x4b69('0x48')],{'$or':_[_0x4b69('0x6c')](_0xc58392[_0x4b69('0x41')],function(_0x3b49cb){var _0x189a3a={};_0x189a3a[_0x3b49cb]={'$like':'%'+_0x44add0['query'][_0x4b69('0x4d')]+'%'};return _0x189a3a;})});}_0xc58392=_[_0x4b69('0x49')]({},_0xc58392,_0x44add0[_0x4b69('0x4e')]);return db[_0x4b69('0x6b')]['count']({'where':_0xc58392['where']})[_0x4b69('0x35')](function(_0x478159){_0x53b7de[_0x4b69('0x2d')]=_0x478159;if(_0x44add0['query'][_0x4b69('0x4f')]){_0xc58392[_0x4b69('0x50')]=[{'all':!![]}];}return db[_0x4b69('0x6b')]['findAll'](_0xc58392);})['then'](function(_0x2e5bd9){_0x53b7de['rows']=_0x2e5bd9;return _0x53b7de;});}})[_0x4b69('0x35')](respondWithFilteredResult(_0x202d3d,_0xc58392))[_0x4b69('0x5f')](handleError(_0x202d3d,null));};exports['removeAnswers']=function(_0x299244,_0x3a48d8,_0x2179c5){return db[_0x4b69('0x3c')]['find']({'where':{'id':_0x299244[_0x4b69('0x53')]['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x3a48d8,null))[_0x4b69('0x35')](function(_0x24219){if(_0x24219){return _0x24219['removeAnswers'](_0x299244[_0x4b69('0x3e')]['ids']);}})['then'](respondWithStatusCode(_0x3a48d8,null))[_0x4b69('0x5f')](handleError(_0x3a48d8,null));};exports[_0x4b69('0x6d')]=function(_0x1f5451,_0x3675ae,_0x1f97c1){_0x1f5451[_0x4b69('0x57')]['sitepic']=_0x1f5451[_0x4b69('0x6e')][_0x4b69('0x6f')];return db[_0x4b69('0x3c')]['find']({'where':{'id':_0x1f5451['params']['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x3675ae,null))[_0x4b69('0x35')](saveUpdates(_0x1f5451[_0x4b69('0x57')],null))[_0x4b69('0x35')](respondWithResult(_0x3675ae,null))[_0x4b69('0x5f')](handleError(_0x3675ae,null));};exports[_0x4b69('0x70')]=function(_0x1f43c5,_0x47b024,_0x2e7b52){_0x1f43c5[_0x4b69('0x57')][_0x4b69('0x71')]=_0x1f43c5[_0x4b69('0x6e')][_0x4b69('0x6f')];return db[_0x4b69('0x3c')][_0x4b69('0x55')]({'where':{'id':_0x1f43c5[_0x4b69('0x53')]['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x47b024,null))[_0x4b69('0x35')](saveUpdates(_0x1f43c5[_0x4b69('0x57')],null))[_0x4b69('0x35')](respondWithResult(_0x47b024,null))[_0x4b69('0x5f')](handleError(_0x47b024,null));};exports[_0x4b69('0x72')]=function(_0x3cacb4,_0x56e404,_0x34fd4c){_0x3cacb4[_0x4b69('0x57')][_0x4b69('0x73')]=_0x3cacb4[_0x4b69('0x6e')][_0x4b69('0x6f')];return db[_0x4b69('0x3c')][_0x4b69('0x55')]({'where':{'id':_0x3cacb4['params']['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x56e404,null))[_0x4b69('0x35')](saveUpdates(_0x3cacb4[_0x4b69('0x57')],null))['then'](respondWithResult(_0x56e404,null))[_0x4b69('0x5f')](handleError(_0x56e404,null));};exports[_0x4b69('0x74')]=function(_0x397360,_0x33dc4b,_0x3811e6){_0x397360[_0x4b69('0x57')][_0x4b69('0x75')]=_0x397360[_0x4b69('0x6e')][_0x4b69('0x6f')];return db[_0x4b69('0x3c')][_0x4b69('0x55')]({'where':{'id':_0x397360['params']['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x33dc4b,null))[_0x4b69('0x35')](saveUpdates(_0x397360[_0x4b69('0x57')],null))[_0x4b69('0x35')](respondWithResult(_0x33dc4b,null))[_0x4b69('0x5f')](handleError(_0x33dc4b,null));};exports[_0x4b69('0x76')]=function(_0x1e591a,_0x88f5a5,_0x16962b){var _0x5c58cf=path[_0x4b69('0x77')](config[_0x4b69('0x78')],_0x4b69('0x79'));var _0x41f391={'where':{'id':_0x1e591a[_0x4b69('0x53')]['id']},'attributes':['id',_0x4b69('0x7a')],'raw':!![]};var _0x21992f=![];return require(_0x4b69('0x7b'))[_0x4b69('0x7c')]()[_0x4b69('0x35')](function(_0x3152f4){if(_0x3152f4){_0x21992f=_0x3152f4[_0x4b69('0x7d')];}})[_0x4b69('0x35')](function(){return db[_0x4b69('0x3c')][_0x4b69('0x55')](_0x41f391);})[_0x4b69('0x35')](handleEntityNotFound(_0x88f5a5,null))['then'](function(_0x26858d){if(_0x26858d){if(!_['isNil'](_0x26858d[_0x4b69('0x7a')])){if(fs[_0x4b69('0x7e')](path[_0x4b69('0x77')](config[_0x4b69('0x78')],_0x4b69('0x7f'),_0x26858d[_0x4b69('0x7a')]))&&_0x21992f){_0x5c58cf=path[_0x4b69('0x77')](config[_0x4b69('0x78')],_0x4b69('0x7f'),_0x26858d['sitepic']);}}return _0x88f5a5[_0x4b69('0x80')](_0x5c58cf);}})['catch'](handleError(_0x88f5a5,null));};exports[_0x4b69('0x81')]=function(_0x2aeff0,_0x36fdd5,_0x4dc207){var _0x314883=path['join'](config[_0x4b69('0x78')],'server/files/images/avatars/default_avatar.png');var _0x4d6f1e={'where':{'id':_0x2aeff0['params']['id']},'attributes':['id',_0x4b69('0x71')],'raw':!![]};return db[_0x4b69('0x3c')][_0x4b69('0x55')](_0x4d6f1e)[_0x4b69('0x35')](handleEntityNotFound(_0x36fdd5,null))[_0x4b69('0x35')](function(_0x1a782c){if(_0x1a782c){if(!_[_0x4b69('0x82')](_0x1a782c[_0x4b69('0x71')])){if(fs[_0x4b69('0x7e')](path['join'](config['root'],'server/files/images/avatars/',_0x1a782c[_0x4b69('0x71')]))){_0x314883=path[_0x4b69('0x77')](config['root'],'server/files/images/avatars/',_0x1a782c[_0x4b69('0x71')]);}}return _0x36fdd5['download'](_0x314883);}})[_0x4b69('0x5f')](handleError(_0x36fdd5,null));};exports[_0x4b69('0x83')]=function(_0x2dbb94,_0x5a3576,_0x489380){var _0x5b93ed=path[_0x4b69('0x77')](config[_0x4b69('0x78')],_0x4b69('0x84'));var _0x7e7ac6={'where':{'id':_0x2dbb94[_0x4b69('0x53')]['id']},'attributes':['id',_0x4b69('0x73'),_0x4b69('0x85')],'raw':!![]};return db['ChatWebsite'][_0x4b69('0x55')](_0x7e7ac6)[_0x4b69('0x35')](handleEntityNotFound(_0x5a3576,null))[_0x4b69('0x35')](function(_0x49b200){if(_0x49b200){if(!_[_0x4b69('0x82')](_0x49b200[_0x4b69('0x73')])){if(fs['existsSync'](path[_0x4b69('0x77')](config['root'],_0x4b69('0x86'),_0x49b200[_0x4b69('0x73')]))&&_0x49b200[_0x4b69('0x85')]){_0x5b93ed=path['join'](config[_0x4b69('0x78')],_0x4b69('0x86'),_0x49b200[_0x4b69('0x73')]);}}return _0x5a3576[_0x4b69('0x80')](_0x5b93ed);}})[_0x4b69('0x5f')](handleError(_0x5a3576,null));};exports['getSystemAvatar']=function(_0x5297df,_0xda5001,_0xbdbc0f){var _0x5db6a4=path[_0x4b69('0x77')](config[_0x4b69('0x78')],_0x4b69('0x87'));var _0x347538={'where':{'id':_0x5297df['params']['id']},'attributes':['id',_0x4b69('0x75')],'raw':!![]};return db[_0x4b69('0x3c')][_0x4b69('0x55')](_0x347538)[_0x4b69('0x35')](handleEntityNotFound(_0xda5001,null))[_0x4b69('0x35')](function(_0x446587){if(_0x446587){if(!_['isNil'](_0x446587[_0x4b69('0x75')])){if(fs[_0x4b69('0x7e')](path[_0x4b69('0x77')](config['root'],'server/files/images/avatars/',_0x446587[_0x4b69('0x75')]))){_0x5db6a4=path[_0x4b69('0x77')](config[_0x4b69('0x78')],_0x4b69('0x86'),_0x446587[_0x4b69('0x75')]);}}return _0xda5001['download'](_0x5db6a4);}})['catch'](handleError(_0xda5001,null));};exports[_0x4b69('0x88')]=function(_0x37b9a7,_0x2d5042,_0x41d6d4){var _0x1fce46=require(_0x4b69('0x89'));var _0x429167=new _0x1fce46();var _0xbee215=_0x429167['setUA'](_0x37b9a7[_0x4b69('0x8a')][_0x4b69('0x8b')])['getResult']();var _0x555fab={'body':_0x37b9a7['body'],'channel':_0x4b69('0x8c')};var _0x2ec8fd=[];var _0x127401=[];var _0xf86e89={};var _0x128da9=![];return db[_0x4b69('0x8d')]['describe']()[_0x4b69('0x35')](function(_0x48ea00){if(!_0x48ea00){throw new db['Sequelize'][(_0x4b69('0x8e'))]('no\x20available\x20attributes');}_0x2ec8fd=_['difference'](_[_0x4b69('0x3f')](_0x48ea00),[_0x4b69('0x8f'),_0x4b69('0x90')]);_0x127401=_[_0x4b69('0x91')](_[_0x4b69('0x3f')](_0x48ea00),[_0x4b69('0x8f'),_0x4b69('0x90'),_0x4b69('0x92'),_0x4b69('0x93')]);if(_0x37b9a7[_0x4b69('0x57')]['id']){delete _0x37b9a7['body']['id'];}if(_[_0x4b69('0x82')](_0x37b9a7[_0x4b69('0x57')][_0x4b69('0x94')])){throw new db[(_0x4b69('0x95'))][(_0x4b69('0x8e'))](_0x4b69('0x96'));}if(_['isNil'](_0x37b9a7[_0x4b69('0x57')]['body'])||_0x37b9a7['body'][_0x4b69('0x57')]===''){throw new db[(_0x4b69('0x95'))][(_0x4b69('0x8e'))](_0x4b69('0x97'));}if(_[_0x4b69('0x82')](_0x37b9a7[_0x4b69('0x57')][_0x4b69('0x98')])){throw new db[(_0x4b69('0x95'))]['ValidationError'](_0x4b69('0x99')+_0x127401);}if(!_[_0x4b69('0x9a')](_0x127401,_0x37b9a7['body'][_0x4b69('0x98')])){throw new db[(_0x4b69('0x95'))][(_0x4b69('0x8e'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x127401);}_0xf86e89[_0x37b9a7[_0x4b69('0x57')]['mapKey']]=_0x37b9a7[_0x4b69('0x57')][_0x4b69('0x94')];})[_0x4b69('0x35')](function(){return db[_0x4b69('0x3c')][_0x4b69('0x55')]({'where':{'id':_0x37b9a7[_0x4b69('0x53')]['id']},'include':[{'model':db[_0x4b69('0x9b')],'as':'List','include':[{'model':db[_0x4b69('0x8d')],'as':_0x4b69('0x9c'),'where':_0xf86e89,'limit':0x1,'order':[['updatedAt',_0x4b69('0x9d')]]}]},{'model':db['ChatApplication'],'as':_0x4b69('0x9e')}]});})[_0x4b69('0x35')](handleEntityNotFound(_0x2d5042,null))[_0x4b69('0x35')](function(_0x482f99){if(_0x482f99&&_0x482f99[_0x4b69('0x9f')]){_0x555fab[_0x4b69('0xa0')]=_0x482f99;_0x555fab[_0x4b69('0xa1')]=_0x482f99['Applications'];_0x555fab[_0x4b69('0xa2')]=_0x482f99['List'];_0x555fab[_0x4b69('0xa1')]=_[_0x4b69('0xa3')](_0x555fab['applications'],['priority'],[_0x4b69('0xa4')]);if(_0x555fab[_0x4b69('0xa0')][_0x4b69('0x9e')]){delete _0x555fab[_0x4b69('0xa0')][_0x4b69('0x9e')];}if(_0x555fab[_0x4b69('0xa0')][_0x4b69('0x9f')]&&_0x555fab[_0x4b69('0xa0')][_0x4b69('0x9f')][_0x4b69('0x9c')][_0x4b69('0x67')]){return _0x555fab[_0x4b69('0xa0')][_0x4b69('0x9f')][_0x4b69('0x9c')][0x0];}var _0x4d5380=_[_0x4b69('0xa5')](_0x37b9a7['body'],{'firstName':_0x37b9a7['body'][_0x4b69('0x94')],'ListId':_0x482f99['ListId']});_0x4d5380[_0x37b9a7['body'][_0x4b69('0x98')]]=_0x37b9a7['body']['from'];return db['CmContact'][_0x4b69('0x56')](_0x4d5380,{'fields':_0x2ec8fd,'raw':!![]});}})['then'](handleEntityNotFound(_0x2d5042,null))['then'](function(_0x1a5955){_0x555fab[_0x4b69('0xa6')]=_0x1a5955;var _0x2cd1d7=_0x37b9a7[_0x4b69('0x57')]['customerIp'];if(_0x37b9a7[_0x4b69('0x8a')][_0x4b69('0xa7')]){_0x2cd1d7=_0x37b9a7['headers'][_0x4b69('0xa7')];}else if(_0x37b9a7[_0x4b69('0x8a')][_0x4b69('0xa8')]){_0x2cd1d7=_['first'](_0x37b9a7[_0x4b69('0x8a')][_0x4b69('0xa8')][_0x4b69('0xa9')](','));}if(_0x1a5955){var _0x51f73b={'ContactId':_0x1a5955['id'],'ChatWebsiteId':_0x37b9a7[_0x4b69('0x53')]['id'],'from':(_0x1a5955['firstName']||'')+'\x20'+(_0x1a5955[_0x4b69('0xaa')]||''),'customerIp':_0x2cd1d7,'customerPort':_0x37b9a7[_0x4b69('0x8a')][_0x4b69('0xab')]?_0x37b9a7[_0x4b69('0x8a')]['x-real-port']:null,'referer':_0x37b9a7[_0x4b69('0x57')]['referer'],'browserName':_0xbee215[_0x4b69('0xac')][_0x4b69('0x38')]&&_0xbee215['browser'][_0x4b69('0xad')]?util[_0x4b69('0xae')]('%s\x20%s',_0xbee215[_0x4b69('0xac')][_0x4b69('0x38')],_0xbee215[_0x4b69('0xac')][_0x4b69('0xad')]):_0x4b69('0xaf'),'browserVersion':_0xbee215[_0x4b69('0xac')][_0x4b69('0xad')]||_0x4b69('0xaf'),'osName':util['format'](_0x4b69('0xb0'),_0xbee215['os'][_0x4b69('0x38')],_0xbee215['os'][_0x4b69('0xad')]),'osVersion':_0xbee215['os'][_0x4b69('0xad')],'deviceModel':_0xbee215['device'][_0x4b69('0x3d')]&&_0xbee215[_0x4b69('0xb1')][_0x4b69('0xb2')]?util[_0x4b69('0xae')]('%s\x20%s\x20%s',_0xbee215[_0x4b69('0xb1')][_0x4b69('0x3d')],_0xbee215['device'][_0x4b69('0xb2')],_0xbee215[_0x4b69('0xb1')][_0x4b69('0xb3')]):null,'deviceVendor':_0xbee215[_0x4b69('0xb1')][_0x4b69('0xb2')],'deviceType':_0xbee215['device'][_0x4b69('0xb3')],'formData':JSON['stringify'](_0x37b9a7[_0x4b69('0x57')])};var _0x1a75af={'ChatWebsiteId':_0x37b9a7[_0x4b69('0x53')]['id'],'closed':![]};if(_0x37b9a7[_0x4b69('0x57')][_0x4b69('0xb4')]){_0x1a75af[_0x4b69('0xb4')]=_0x37b9a7['body'][_0x4b69('0xb4')];return db[_0x4b69('0xb5')]['find']({'where':_0x1a75af})[_0x4b69('0x35')](function(_0x5d7fa5){if(_0x5d7fa5){return[_0x5d7fa5,![]];}_0x51f73b[_0x4b69('0xb4')]=_0x37b9a7[_0x4b69('0x57')][_0x4b69('0xb4')];_0x51f73b['externalUrl']=_0x37b9a7[_0x4b69('0x57')][_0x4b69('0xb6')];return db['ChatInteraction']['create'](_0x51f73b)['then'](function(_0x23c25c){return[_0x23c25c,!![]];});});}_0x1a75af[_0x4b69('0xb7')]=_0x1a5955['id'];if(_0x37b9a7[_0x4b69('0x57')][_0x4b69('0xb8')]&&_0x37b9a7['body'][_0x4b69('0xb8')]['id']){_0x1a75af['id']=_0x37b9a7['body']['interaction']['id'];return db[_0x4b69('0xb5')][_0x4b69('0x55')]({'where':_0x1a75af})['then'](function(_0x528473){if(_0x528473){return[_0x528473,![]];}return db[_0x4b69('0xb5')]['create'](_0x51f73b)[_0x4b69('0x35')](function(_0x2710f1){return[_0x2710f1,!![]];});});}return db[_0x4b69('0xb5')]['create'](_0x51f73b)[_0x4b69('0x35')](function(_0x3bb799){return[_0x3bb799,!![]];});}})[_0x4b69('0xb9')](function(_0x13c0f1,_0x3c2d79){if(_0x13c0f1){_0x128da9=_0x3c2d79;if(!_0x3c2d79){var _0x15c81f={'from':(_0x555fab[_0x4b69('0xa6')]['firstName']||'')+'\x20'+(_0x555fab[_0x4b69('0xa6')]['lastName']||'')};if(_0x37b9a7['body'][_0x4b69('0xb4')]&&_0x37b9a7[_0x4b69('0x57')][_0x4b69('0xba')]&&_0x37b9a7['body'][_0x4b69('0xb4')]!=_0x37b9a7[_0x4b69('0x57')][_0x4b69('0xba')]){_0x15c81f['threadId']=_0x37b9a7[_0x4b69('0x57')][_0x4b69('0xba')];}return _0x13c0f1[_0x4b69('0x33')](_0x15c81f);}else{return _0x13c0f1;}}})[_0x4b69('0x35')](function(_0x4ad2bf){_0x555fab['interaction']=_0x4ad2bf[_0x4b69('0x36')]({'plain':!![]});_0x555fab[_0x4b69('0xb8')][_0x4b69('0xbb')]=_0x128da9;if(_0x555fab[_0x4b69('0xb8')][_0x4b69('0xbb')]){if(_0x555fab[_0x4b69('0xa0')][_0x4b69('0xbc')]){_0x555fab[_0x4b69('0xa1')][_0x4b69('0xbd')]({'id':0x0,'priority':_0x555fab[_0x4b69('0xa1')][_0x4b69('0x67')]+0x1,'app':_0x4b69('0xbe'),'appdata':_0x4b69('0xbf'),'interval':_0x4b69('0xc0')});}}return db['ChatMessage'][_0x4b69('0x56')]({'body':_0x37b9a7[_0x4b69('0x57')][_0x4b69('0x57')],'ChatWebsiteId':_0x37b9a7[_0x4b69('0x53')]['id'],'ChatInteractionId':_0x4ad2bf['id'],'direction':'in','ContactId':_0x555fab[_0x4b69('0xa6')]['id'],'AttachmentId':_0x37b9a7[_0x4b69('0x57')][_0x4b69('0xc1')]});})[_0x4b69('0x35')](function(_0x181961){_0x555fab[_0x4b69('0x27')]=_0x181961;if(_0x555fab[_0x4b69('0xb8')]['UserId']){return db[_0x4b69('0xc2')][_0x4b69('0x55')]({'attributes':['id',_0x4b69('0x38')],'where':{'id':_0x555fab[_0x4b69('0xb8')]['UserId']}})[_0x4b69('0x35')](function(_0x66d981){if(_0x66d981){_0x555fab[_0x4b69('0xa1')][_0x4b69('0xc3')]({'id':0x0,'priority':0x0,'app':_0x4b69('0xc4'),'appdata':_0x66d981[_0x4b69('0x38')]+','+(_0x555fab[_0x4b69('0xa0')][_0x4b69('0xc5')]||0xa),'interval':_0x4b69('0xc0')});_0x555fab[_0x4b69('0xc6')]=!![];}return respondWithRpcPromise('Start',_0x4b69('0xc7'),_0x555fab);});}return respondWithRpcPromise(_0x4b69('0xc8'),_0x4b69('0xc7'),_0x555fab);})[_0x4b69('0x35')](function(_0x3e0388){respondWithRpcPromise(_0x4b69('0xc9'),'EventManager',{'event':_0x4b69('0x88'),'message':_0x3e0388},client9002);return _0x3e0388;})[_0x4b69('0x35')](respondWithResult(_0x2d5042,null))[_0x4b69('0x5f')](handleError(_0x2d5042,null));};exports[_0x4b69('0xca')]=function(_0x27421b,_0x223d50,_0x27b03c){var _0x444488,_0x3fceda,_0x263896;var _0x4e4d16=[];var _0x48d0bb=[];var _0x406851={};return db[_0x4b69('0x8d')]['describe']()[_0x4b69('0x35')](function(_0x169d1c){if(!_0x169d1c){throw new db['Sequelize'][(_0x4b69('0x8e'))](_0x4b69('0xcb'));}_0x48d0bb=_['difference'](_[_0x4b69('0x3f')](_0x169d1c),[_0x4b69('0x8f'),_0x4b69('0x90')]);_0x4e4d16=_['difference'](_[_0x4b69('0x3f')](_0x169d1c),[_0x4b69('0x8f'),_0x4b69('0x90'),'CompanyId',_0x4b69('0x93')]);if(_0x27421b[_0x4b69('0x57')]['id']){delete _0x27421b[_0x4b69('0x57')]['id'];}if(_['isNil'](_0x27421b['body'][_0x4b69('0x94')])){throw _0x223d50[_0x4b69('0x2c')](0x1f4)[_0x4b69('0x39')](new db[(_0x4b69('0x95'))][(_0x4b69('0x8e'))]('from\x20is\x20mandatory'));}if(_[_0x4b69('0x82')](_0x27421b[_0x4b69('0x57')][_0x4b69('0x57')])||_0x27421b[_0x4b69('0x57')][_0x4b69('0x57')]===''){throw _0x223d50['status'](0x1f4)[_0x4b69('0x39')](new db[(_0x4b69('0x95'))][(_0x4b69('0x8e'))](_0x4b69('0x97')));}if(_[_0x4b69('0x82')](_0x27421b[_0x4b69('0x57')][_0x4b69('0xcc')])){throw _0x223d50[_0x4b69('0x2c')](0x1f4)[_0x4b69('0x39')](new db[(_0x4b69('0x95'))][(_0x4b69('0x8e'))](_0x4b69('0xcd')+_0x4e4d16));}if(!_[_0x4b69('0x9a')](_0x4e4d16,_0x27421b[_0x4b69('0x57')][_0x4b69('0xcc')])){throw _0x223d50['status'](0x1f4)[_0x4b69('0x39')](new db['Sequelize'][(_0x4b69('0x8e'))](_0x4b69('0xce')+_0x4e4d16));}_0x406851[_0x27421b[_0x4b69('0x57')][_0x4b69('0xcc')]]=_0x27421b['body'][_0x4b69('0x94')];})['then'](function(){return db['ChatWebsite'][_0x4b69('0x55')]({'where':{'id':_0x27421b[_0x4b69('0x53')]['id']},'include':[{'model':db[_0x4b69('0x9b')],'as':_0x4b69('0x9f')}]});})[_0x4b69('0x35')](handleEntityNotFound(_0x223d50,null))[_0x4b69('0x35')](function(_0x317c59){if(_0x317c59&&_0x317c59[_0x4b69('0x9f')]){_0x3fceda=_0x317c59;var _0x574357=_[_0x4b69('0xa5')](_0x27421b[_0x4b69('0x57')],{'firstName':_0x27421b[_0x4b69('0x57')]['from'],'phone':_0x27421b[_0x4b69('0x57')][_0x4b69('0x94')],'ListId':_0x317c59[_0x4b69('0x93')]});_0x574357[_0x27421b[_0x4b69('0x57')][_0x4b69('0xcc')]]=_0x27421b[_0x4b69('0x57')]['from'];return db['CmContact'][_0x4b69('0xcf')]({'where':_0x406851,'defaults':_0x574357});}})[_0x4b69('0xb9')](function(_0x389cc1){if(_0x389cc1){_0x263896=_0x389cc1;var _0x34973d=fs['readFileSync'](path[_0x4b69('0x77')](config[_0x4b69('0x78')],_0x4b69('0xd0')),'utf8');var _0x30a4de=ejs['render'](_0x34973d,{'body':_[_0x4b69('0xd1')](_0x27421b[_0x4b69('0x57')][_0x4b69('0x57')]),'bodyTitle':_0x3fceda[_0x4b69('0xd2')]});return db[_0x4b69('0xd3')][_0x4b69('0x56')]({'body':_0x30a4de,'ContactId':_0x389cc1['id'],'ChatWebsiteId':_0x3fceda['id']});}})['then'](function(_0x434ba1){if(_0x434ba1){_0x444488=_0x434ba1;return db[_0x4b69('0xd4')][_0x4b69('0x63')]({'where':{'service':!![]},'include':[{'model':db[_0x4b69('0xd5')],'as':'Smtp','raw':!![]}]});}})[_0x4b69('0x35')](function(_0x30411b){if(_0x30411b&&_0x30411b[_0x4b69('0xd6')]&&_0x3fceda[_0x4b69('0xd7')]){var _0x2ce74f={'tls':{'rejectUnauthorized':![]}};if(_0x30411b['Smtp']['service']){_0x2ce74f[_0x4b69('0xd8')]=_0x30411b[_0x4b69('0xd6')][_0x4b69('0xd8')];}else{_0x2ce74f['host']=_0x30411b['Smtp']['host'];_0x2ce74f[_0x4b69('0xd9')]=_0x30411b['Smtp']['port'];_0x2ce74f[_0x4b69('0xda')]=_0x30411b['Smtp'][_0x4b69('0xda')];}if(_0x30411b[_0x4b69('0xd6')][_0x4b69('0xdb')]){_0x2ce74f[_0x4b69('0xdc')]={'user':_0x30411b['Smtp'][_0x4b69('0x58')],'pass':_0x30411b[_0x4b69('0xd6')]['pass']};}return respondWithRpcPromise('SendMail',_0x4b69('0xdd'),{'account':_0x2ce74f,'message':{'from':util['format'](_0x4b69('0xde'),_0x30411b['name'],_0x30411b[_0x4b69('0xdf')]||_0x30411b[_0x4b69('0xd6')][_0x4b69('0x58')]),'to':_0x3fceda[_0x4b69('0xd7')],'subject':_0x3fceda[_0x4b69('0xe0')],'text':_0x444488[_0x4b69('0x57')]}},client9003)[_0x4b69('0x35')](function(){return _0x444488;})['catch'](function(_0x1886fa){console[_0x4b69('0x25')](_0x1886fa);});}})[_0x4b69('0x35')](function(){if(_0x444488){return _0x444488;}})[_0x4b69('0x35')](respondWithResult(_0x223d50,null))[_0x4b69('0x5f')](handleError(_0x223d50,null));};exports['addInteraction']=function(_0x4724f4,_0x2bc1af,_0x3d2c22){return db[_0x4b69('0xb5')][_0x4b69('0x55')]({'where':{'id':_0x4724f4['params']['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x2bc1af,null))['then'](function(_0x2c946d){if(_0x2c946d){return _0x2c946d[_0x4b69('0xe1')](_0x4724f4['body'][_0x4b69('0x69')],_[_0x4b69('0xe2')](_0x4724f4[_0x4b69('0x57')],['ids','id'])||{});}})[_0x4b69('0x35')](respondWithResult(_0x2bc1af,null))['catch'](handleError(_0x2bc1af,null));};exports[_0x4b69('0xe3')]=function(_0x28571e,_0x3a1867,_0x1d5958){var _0x42a160={'raw':![],'where':{}};var _0x36f52c={};var _0x43097c={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4b69('0x63')]({'where':{'id':_0x28571e[_0x4b69('0x53')]['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x3a1867,null))['then'](function(_0x3989ae){if(_0x3989ae){_0x36f52c['model']=_[_0x4b69('0x3f')](db['ChatInteraction'][_0x4b69('0x65')]);_0x36f52c[_0x4b69('0x3e')]=_[_0x4b69('0x3f')](_0x28571e[_0x4b69('0x3e')]);_0x36f52c[_0x4b69('0x66')]=_['intersection'](_0x36f52c[_0x4b69('0x3d')],_0x36f52c['query']);_0x42a160[_0x4b69('0x41')]=_[_0x4b69('0x40')](_0x36f52c['model'],qs[_0x4b69('0x42')](_0x28571e[_0x4b69('0x3e')]['fields']));_0x42a160['attributes']=_0x42a160[_0x4b69('0x41')][_0x4b69('0x67')]?_0x42a160[_0x4b69('0x41')]:_0x36f52c['model'];if(!_0x28571e['query']['hasOwnProperty'](_0x4b69('0x44'))){_0x42a160[_0x4b69('0x2f')]=qs['limit'](_0x28571e[_0x4b69('0x3e')][_0x4b69('0x2f')]);_0x42a160['offset']=qs['offset'](_0x28571e[_0x4b69('0x3e')][_0x4b69('0x2e')]);}_0x42a160[_0x4b69('0x45')]=qs['sort'](_0x28571e['query'][_0x4b69('0x46')]);_0x42a160[_0x4b69('0x48')]=qs['filters'](_[_0x4b69('0x47')](_0x28571e[_0x4b69('0x3e')],_0x36f52c[_0x4b69('0x66')]));_0x42a160[_0x4b69('0x48')][_0x4b69('0x61')]=_0x3989ae['id'];if(_0x28571e[_0x4b69('0x3e')][_0x4b69('0x4d')]){_0x42a160[_0x4b69('0x48')]=_[_0x4b69('0x49')](_0x42a160[_0x4b69('0x48')],{'$or':_['map'](_0x42a160[_0x4b69('0x41')],function(_0x1426e3){var _0xd3952={};_0xd3952[_0x1426e3]={'$like':'%'+_0x28571e[_0x4b69('0x3e')][_0x4b69('0x4d')]+'%'};return _0xd3952;})});}_0x42a160=_[_0x4b69('0x49')]({},_0x42a160,_0x28571e[_0x4b69('0x4e')]);return db[_0x4b69('0xb5')][_0x4b69('0x2d')]({'where':_0x42a160[_0x4b69('0x48')]})[_0x4b69('0x35')](function(_0x28ee2c){_0x43097c['count']=_0x28ee2c;if(_0x28571e[_0x4b69('0x3e')][_0x4b69('0x4f')]){_0x42a160[_0x4b69('0x50')]=[{'model':db[_0x4b69('0x8d')],'as':_0x4b69('0xe4'),'required':![]},{'model':db[_0x4b69('0xc2')],'as':_0x4b69('0xe5'),'attributes':['name','fullname',_0x4b69('0xe6')],'required':![]},{'model':db['Tag'],'as':_0x4b69('0xe7'),'attributes':['id',_0x4b69('0x38'),_0x4b69('0xe8')],'where':_0x28571e[_0x4b69('0x3e')]['tag']?{'id':_0x28571e[_0x4b69('0x3e')][_0x4b69('0xe9')]}:undefined,'required':_0x28571e['query'][_0x4b69('0xe9')]?!![]:![]}];}return db[_0x4b69('0xb5')][_0x4b69('0xea')](_0x42a160);})['then'](function(_0x1bbe59){_0x43097c[_0x4b69('0x51')]=_0x1bbe59;return _0x43097c;});}})[_0x4b69('0x35')](respondWithFilteredResult(_0x3a1867,_0x42a160))[_0x4b69('0x5f')](handleError(_0x3a1867,null));};function iftimePromise(_0x2e1497,_0x4a1626){return respondWithRpcPromise(_0x4b69('0xeb'),_0x4b69('0xec'),{'command':_0x4a1626[_0x4b69('0xed')]?util[_0x4b69('0xae')](_0x4b69('0xee'),_0x2e1497['interval'],_0x4a1626[_0x4b69('0xed')]):util['format'](_0x4b69('0xef'),_0x2e1497['interval'])},client9002)[_0x4b69('0x35')](function(_0x1b9794){var _0x576f43=_0x1b9794&&_0x1b9794['indexOf']('true')>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4a1626['id'],_0x2e1497['id'],_0x2e1497[_0x4b69('0xf0')],_0x576f43?_0x4b69('0xf1'):_0x4b69('0xf2'),_0x4a1626[_0x4b69('0xed')]?_0x4a1626['timezone']:_0x4b69('0xf3'));return _0x576f43;})['catch'](function(_0x9ae3d6){logger[_0x4b69('0x25')](_0x4b69('0xf4'),_0x4a1626['id'],_0x2e1497['id'],_0x2e1497[_0x4b69('0xf0')],util['inspect'](_0x9ae3d6,{'showHidden':![],'depth':null}),_0x4a1626[_0x4b69('0xed')]?_0x4a1626[_0x4b69('0xed')]:_0x4b69('0xf3'));return![];});}exports[_0x4b69('0xec')]=function(_0x44b48f,_0x12f6c2,_0x2e1c8e){var _0x2f36ca=0x0;var _0x52b1a7=0x0;var _0xbee594=![];var _0x25c0ca;var _0x32072c;return db[_0x4b69('0x3c')][_0x4b69('0x55')]({'where':{'id':_0x44b48f[_0x4b69('0x53')]['id']},'include':[{'model':db[_0x4b69('0xf5')],'as':_0x4b69('0xf5'),'include':[{'model':db[_0x4b69('0xf5')],'as':_0x4b69('0xf6'),'attributes':['id',_0x4b69('0xf0')],'raw':!![]}]}]})[_0x4b69('0x35')](handleEntityNotFound(_0x12f6c2,null))[_0x4b69('0x35')](function(_0x3ee9ad){if(_0x3ee9ad){_0x25c0ca=_0x3ee9ad;return _0x3ee9ad[_0x4b69('0xf7')]({'raw':!![]});}})[_0x4b69('0x35')](function(_0x11ea6f){if(_0x25c0ca){if(_0x11ea6f){_0x32072c=_0x11ea6f;}}return require(_0x4b69('0x7b'))[_0x4b69('0x7c')]();})[_0x4b69('0x35')](function(_0x5a5cb2){if(_0x5a5cb2){_0x52b1a7=_0x5a5cb2['virtual'];_0xbee594=_0x5a5cb2[_0x4b69('0x7d')];}})[_0x4b69('0x35')](function(){return db[_0x4b69('0xb5')]['count']({'where':{'closed':![]}});})[_0x4b69('0x35')](function(_0x2c578e){_0x2f36ca=_0x2c578e;if(_0x52b1a7&&_0x2c578e>_0x52b1a7){return db[_0x4b69('0xf8')][_0x4b69('0x63')]({'where':{'id':0x1}})[_0x4b69('0x35')](function(_0x2ccd12){if(_0x2ccd12){_0x2ccd12[_0x4b69('0xf9')](_0x4b69('0xfa'));}});}})['then'](function(){if(_0x25c0ca[_0x4b69('0xf5')]&&_0x25c0ca[_0x4b69('0xf5')][_0x4b69('0xf6')]){var _0x397906=[];for(var _0x24db8c=0x0;_0x24db8c<_0x25c0ca[_0x4b69('0xf5')][_0x4b69('0xf6')][_0x4b69('0x67')];_0x24db8c++){var _0x33ad6d=_0x25c0ca[_0x4b69('0xf5')][_0x4b69('0xf6')][_0x24db8c][_0x4b69('0x36')]({'plain':!![]});_0x397906[_0x4b69('0xbd')](iftimePromise(_0x33ad6d,_0x25c0ca));}return BPromise['all'](_0x397906)[_0x4b69('0x35')](function(_0x542a4f){return _[_0x4b69('0xfb')](_0x542a4f);});}else{return!![];}})[_0x4b69('0x35')](function(_0x4afbbb){var _0x49b483=fs[_0x4b69('0xfc')](path['join'](config['root'],_0x4b69('0xfd')),'utf8');var _0x5c1c3c={'remote':_0x25c0ca[_0x4b69('0xfe')],'query':querystring[_0x4b69('0x24')](_['merge'](_0x25c0ca['get']({'plain':!![]}),{'customerIp':_0x44b48f[_0x4b69('0x8a')][_0x4b69('0xa8')]||_0x44b48f['headers'][_0x4b69('0xff')]||_0x44b48f[_0x4b69('0x100')][_0x4b69('0x101')]||_0x44b48f['ip'],'referer':_0x44b48f['headers']['referer'],'openedInteractions':_0x2f36ca,'maxInteractions':_0x52b1a7,'virtual':_0xbee594['virtual'],'online':_0x4afbbb,'custom':_0xbee594}))[_0x4b69('0x102')](/'/g,'\x5c\x27')};_0x12f6c2[_0x4b69('0x39')](ejs[_0x4b69('0x103')](Mustache[_0x4b69('0x103')](_0x49b483,_0x5c1c3c),{'proactiveActions':_0x32072c,'alignment':_0x25c0ca[_0x4b69('0x104')],'verticalAlignment':_0x25c0ca[_0x4b69('0x105')]}));})['catch'](handleError(_0x12f6c2,null));};exports[_0x4b69('0x106')]=function(_0x449579,_0x1b6590,_0x2cf52b){return db['ChatWebsite'][_0x4b69('0x63')]({'where':{'id':_0x449579[_0x4b69('0x53')]['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x1b6590,null))[_0x4b69('0x35')](function(_0x559ac2){if(_0x559ac2){return db[_0x4b69('0x107')][_0x4b69('0x108')](function(_0x10dc0c){return db[_0x4b69('0x109')]['destroy']({'where':{'ChatWebsiteId':_0x449579[_0x4b69('0x53')]['id']},'transaction':_0x10dc0c})['then'](function(_0x34db36){var _0x1df87f=_[_0x4b69('0x6c')](_0x449579[_0x4b69('0x57')],function(_0xdac08){_0xdac08['ChatWebsiteId']=_0x449579[_0x4b69('0x53')]['id'];return _0xdac08;});return db[_0x4b69('0x109')][_0x4b69('0x10a')](_0x1df87f,{'transaction':_0x10dc0c});});})[_0x4b69('0x35')](function(){return db['ChatApplication'][_0x4b69('0x10b')]({'where':{'ChatWebsiteId':_0x449579[_0x4b69('0x53')]['id']},'order':_0x4b69('0x10c')});});}})['then'](respondWithResult(_0x1b6590,null))['catch'](handleError(_0x1b6590,null));};exports['getApplications']=function(_0x46fa52,_0x56af3f,_0x56ec56){var _0x1cfbb6={};var _0x25b7f7={};var _0x411db2;var _0x190e91;return db[_0x4b69('0x3c')][_0x4b69('0x63')]({'where':{'id':_0x46fa52[_0x4b69('0x53')]['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x56af3f,null))['then'](function(_0x2c34ae){if(_0x2c34ae){_0x411db2=_0x2c34ae;_0x25b7f7[_0x4b69('0x3d')]=_[_0x4b69('0x3f')](db[_0x4b69('0x109')]['rawAttributes']);_0x25b7f7[_0x4b69('0x3e')]=_[_0x4b69('0x3f')](_0x46fa52[_0x4b69('0x3e')]);_0x25b7f7[_0x4b69('0x66')]=_['intersection'](_0x25b7f7[_0x4b69('0x3d')],_0x25b7f7[_0x4b69('0x3e')]);_0x1cfbb6[_0x4b69('0x41')]=_[_0x4b69('0x40')](_0x25b7f7[_0x4b69('0x3d')],qs[_0x4b69('0x42')](_0x46fa52[_0x4b69('0x3e')][_0x4b69('0x42')]));_0x1cfbb6[_0x4b69('0x41')]=_0x1cfbb6[_0x4b69('0x41')][_0x4b69('0x67')]?_0x1cfbb6[_0x4b69('0x41')]:_0x25b7f7[_0x4b69('0x3d')];_0x1cfbb6[_0x4b69('0x45')]=qs[_0x4b69('0x46')](_0x46fa52[_0x4b69('0x3e')]['sort']);_0x1cfbb6['where']=qs[_0x4b69('0x66')](_[_0x4b69('0x47')](_0x46fa52[_0x4b69('0x3e')],_0x25b7f7[_0x4b69('0x66')]));if(_0x46fa52[_0x4b69('0x3e')]['filter']){_0x1cfbb6['where']=_[_0x4b69('0x49')](_0x1cfbb6[_0x4b69('0x48')],{'$or':_[_0x4b69('0x6c')](_0x1cfbb6[_0x4b69('0x41')],function(_0x25da3d){var _0x331398={};_0x331398[_0x25da3d]={'$like':'%'+_0x46fa52[_0x4b69('0x3e')]['filter']+'%'};return _0x331398;})});}_0x1cfbb6=_[_0x4b69('0x49')]({},_0x1cfbb6,_0x46fa52[_0x4b69('0x4e')]);return _0x411db2['getApplications'](_0x1cfbb6);}})[_0x4b69('0x35')](function(_0x282aaa){if(_0x282aaa){_0x190e91=_0x282aaa[_0x4b69('0x67')];if(!_0x46fa52[_0x4b69('0x3e')]['hasOwnProperty']('nolimit')){_0x1cfbb6[_0x4b69('0x2f')]=qs[_0x4b69('0x2f')](_0x46fa52[_0x4b69('0x3e')][_0x4b69('0x2f')]);_0x1cfbb6[_0x4b69('0x2e')]=qs[_0x4b69('0x2e')](_0x46fa52[_0x4b69('0x3e')][_0x4b69('0x2e')]);}return _0x411db2[_0x4b69('0x10d')](_0x1cfbb6);}})[_0x4b69('0x35')](function(_0x427111){if(_0x427111){return _0x427111?{'count':_0x190e91,'rows':_0x427111}:null;}})[_0x4b69('0x35')](respondWithResult(_0x56af3f,null))[_0x4b69('0x5f')](handleError(_0x56af3f,null));};exports['addProactiveActions']=function(_0x36f04c,_0x338c02,_0x2f266c){return db['chatProactiveAction'][_0x4b69('0x55')]({'where':{'id':_0x36f04c[_0x4b69('0x53')]['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x338c02,null))[_0x4b69('0x35')](function(_0x35e774){if(_0x35e774){return _0x35e774[_0x4b69('0x10e')](_0x36f04c['body']['ids'],_[_0x4b69('0xe2')](_0x36f04c[_0x4b69('0x57')],[_0x4b69('0x69'),'id'])||{});}})['then'](respondWithResult(_0x338c02,null))[_0x4b69('0x5f')](handleError(_0x338c02,null));};exports['getProactiveActions']=function(_0x279063,_0x2ad35b,_0x355d69){var _0x26c87c={};var _0x1cf748={};var _0x261ae5;var _0x9e838;return db['ChatWebsite'][_0x4b69('0x63')]({'where':{'id':_0x279063[_0x4b69('0x53')]['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x2ad35b,null))['then'](function(_0x1d8f2b){if(_0x1d8f2b){_0x261ae5=_0x1d8f2b;_0x1cf748['model']=_['keys'](db[_0x4b69('0x10f')][_0x4b69('0x65')]);_0x1cf748[_0x4b69('0x3e')]=_[_0x4b69('0x3f')](_0x279063['query']);_0x1cf748[_0x4b69('0x66')]=_[_0x4b69('0x40')](_0x1cf748[_0x4b69('0x3d')],_0x1cf748['query']);_0x26c87c['attributes']=_[_0x4b69('0x40')](_0x1cf748[_0x4b69('0x3d')],qs[_0x4b69('0x42')](_0x279063[_0x4b69('0x3e')][_0x4b69('0x42')]));_0x26c87c[_0x4b69('0x41')]=_0x26c87c['attributes']['length']?_0x26c87c[_0x4b69('0x41')]:_0x1cf748[_0x4b69('0x3d')];_0x26c87c['order']=qs[_0x4b69('0x46')](_0x279063[_0x4b69('0x3e')]['sort']);_0x26c87c[_0x4b69('0x48')]=qs['filters'](_['pick'](_0x279063[_0x4b69('0x3e')],_0x1cf748[_0x4b69('0x66')]));if(_0x279063[_0x4b69('0x3e')]['filter']){_0x26c87c[_0x4b69('0x48')]=_[_0x4b69('0x49')](_0x26c87c['where'],{'$or':_[_0x4b69('0x6c')](_0x26c87c[_0x4b69('0x41')],function(_0x4f7dab){var _0x62b303={};_0x62b303[_0x4f7dab]={'$like':'%'+_0x279063[_0x4b69('0x3e')][_0x4b69('0x4d')]+'%'};return _0x62b303;})});}_0x26c87c=_['merge']({},_0x26c87c,_0x279063[_0x4b69('0x4e')]);return _0x261ae5[_0x4b69('0xf7')](_0x26c87c);}})[_0x4b69('0x35')](function(_0x2d5275){if(_0x2d5275){_0x9e838=_0x2d5275['length'];if(!_0x279063[_0x4b69('0x3e')][_0x4b69('0x43')](_0x4b69('0x44'))){_0x26c87c[_0x4b69('0x2f')]=qs[_0x4b69('0x2f')](_0x279063[_0x4b69('0x3e')]['limit']);_0x26c87c['offset']=qs[_0x4b69('0x2e')](_0x279063['query'][_0x4b69('0x2e')]);}return _0x261ae5['getProactiveActions'](_0x26c87c);}})[_0x4b69('0x35')](function(_0x523c46){if(_0x523c46){return _0x523c46?{'count':_0x9e838,'rows':_0x523c46}:null;}})['then'](respondWithResult(_0x2ad35b,null))[_0x4b69('0x5f')](handleError(_0x2ad35b,null));};exports[_0x4b69('0x110')]=function(_0x2995bd,_0x342bdb,_0x1bcf0a){var _0x410034=_0x2995bd[_0x4b69('0x3e')][_0x4b69('0x111')]===_0x4b69('0x112')?_0x4b69('0x113'):_0x4b69('0x114');return db[_0x4b69('0x3c')]['find']({'attributes':['id',_0x410034],'where':{'id':_0x2995bd[_0x4b69('0x53')]['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x342bdb,null))[_0x4b69('0x35')](function(_0x58f5f0){if(_0x58f5f0){var _0x469986=_0x58f5f0[_0x410034];var _0x1f6236=_0x469986&&_0x469986[_0x4b69('0x115')]?_0x469986['items']:[];_0x342bdb[_0x4b69('0x39')]({'fromKey':_[_0x4b69('0x82')](_0x469986[_0x4b69('0x116')])?undefined:_0x469986['fromKey'],'count':_0x1f6236[_0x4b69('0x67')],'rows':_0x1f6236});}})[_0x4b69('0x5f')](handleError(_0x342bdb,null));};exports['getOfflineMessages']=function(_0x45269c,_0x42789e,_0x47c4dc){var _0x554ee6={'raw':!![],'where':{}};var _0x159f0a={};var _0x352a3e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4b69('0x63')]({'where':{'id':_0x45269c['params']['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x42789e,null))[_0x4b69('0x35')](function(_0x3c6107){if(_0x3c6107){_0x159f0a['model']=_[_0x4b69('0x3f')](db[_0x4b69('0xd3')][_0x4b69('0x65')]);_0x159f0a[_0x4b69('0x3e')]=_['keys'](_0x45269c['query']);_0x159f0a[_0x4b69('0x66')]=_['intersection'](_0x159f0a[_0x4b69('0x3d')],_0x159f0a[_0x4b69('0x3e')]);_0x554ee6[_0x4b69('0x41')]=_['intersection'](_0x159f0a[_0x4b69('0x3d')],qs['fields'](_0x45269c[_0x4b69('0x3e')]['fields']));_0x554ee6[_0x4b69('0x41')]=_0x554ee6[_0x4b69('0x41')][_0x4b69('0x67')]?_0x554ee6[_0x4b69('0x41')]:_0x159f0a[_0x4b69('0x3d')];if(!_0x45269c[_0x4b69('0x3e')][_0x4b69('0x43')](_0x4b69('0x44'))){_0x554ee6[_0x4b69('0x2f')]=qs[_0x4b69('0x2f')](_0x45269c[_0x4b69('0x3e')][_0x4b69('0x2f')]);_0x554ee6[_0x4b69('0x2e')]=qs[_0x4b69('0x2e')](_0x45269c[_0x4b69('0x3e')][_0x4b69('0x2e')]);}_0x554ee6['order']=qs['sort'](_0x45269c[_0x4b69('0x3e')][_0x4b69('0x46')]);_0x554ee6['where']=qs['filters'](_['pick'](_0x45269c['query'],_0x159f0a['filters']));_0x554ee6['where'][_0x4b69('0x61')]=_0x3c6107['id'];if(_0x45269c[_0x4b69('0x3e')][_0x4b69('0x4d')]){_0x554ee6[_0x4b69('0x48')]=_[_0x4b69('0x49')](_0x554ee6[_0x4b69('0x48')],{'$or':_[_0x4b69('0x6c')](_0x554ee6[_0x4b69('0x41')],function(_0x494b8d){var _0x5681d7={};_0x5681d7[_0x494b8d]={'$like':'%'+_0x45269c[_0x4b69('0x3e')]['filter']+'%'};return _0x5681d7;})});}_0x554ee6=_[_0x4b69('0x49')]({},_0x554ee6,_0x45269c['options']);return db['ChatOfflineMessage'][_0x4b69('0x2d')]({'where':_0x554ee6['where']})[_0x4b69('0x35')](function(_0x425928){_0x352a3e[_0x4b69('0x2d')]=_0x425928;if(_0x45269c[_0x4b69('0x3e')][_0x4b69('0x4f')]){_0x554ee6['include']=[{'all':!![]}];}return db[_0x4b69('0xd3')][_0x4b69('0xea')](_0x554ee6);})[_0x4b69('0x35')](function(_0x349013){_0x352a3e[_0x4b69('0x51')]=_0x349013;return _0x352a3e;});}})[_0x4b69('0x35')](respondWithFilteredResult(_0x42789e,_0x554ee6))[_0x4b69('0x5f')](handleError(_0x42789e,null));};exports['addAgents']=function(_0x53bd10,_0x29a3ad,_0x4c5484){return db['ChatWebsite'][_0x4b69('0x55')]({'where':{'id':_0x53bd10[_0x4b69('0x53')]['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x29a3ad,null))[_0x4b69('0x35')](function(_0x4157c1){if(_0x4157c1){return _0x4157c1[_0x4b69('0x117')](_0x53bd10['body'][_0x4b69('0x69')],_['omit'](_0x53bd10[_0x4b69('0x57')],[_0x4b69('0x69'),'id'])||{})['spread'](function(_0xec60da){for(var _0x3a1133=0x0;_0x3a1133<_0x53bd10[_0x4b69('0x57')]['ids']['length'];_0x3a1133+=0x1){socket[_0x4b69('0x118')](_0x4b69('0x119'),{'UserId':_0x53bd10[_0x4b69('0x57')][_0x4b69('0x69')][_0x3a1133],'ChatWebsiteId':_0x53bd10['params']['id']});}return _0xec60da;});}})[_0x4b69('0x35')](respondWithResult(_0x29a3ad,null))[_0x4b69('0x5f')](handleError(_0x29a3ad,null));};exports[_0x4b69('0x11a')]=function(_0x24312f,_0x2fca9f,_0x173aaa){return db['ChatWebsite'][_0x4b69('0x55')]({'where':{'id':_0x24312f['params']['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x2fca9f,null))[_0x4b69('0x35')](function(_0x29deb9){if(_0x29deb9){return _0x29deb9['removeAgents'](_0x24312f[_0x4b69('0x3e')][_0x4b69('0x69')])[_0x4b69('0x35')](function(){if(_[_0x4b69('0x11b')](_0x24312f['query'][_0x4b69('0x69')])){for(var _0x4edd27=0x0;_0x4edd27<_0x24312f[_0x4b69('0x3e')][_0x4b69('0x69')][_0x4b69('0x67')];_0x4edd27+=0x1){socket[_0x4b69('0x118')]('userChatWebsite:remove',{'UserId':Number(_0x24312f[_0x4b69('0x3e')][_0x4b69('0x69')][_0x4edd27]),'ChatWebsiteId':Number(_0x24312f['params']['id'])});}}else{socket[_0x4b69('0x118')]('userChatWebsite:remove',{'UserId':Number(_0x24312f[_0x4b69('0x3e')]['ids']),'ChatWebsiteId':Number(_0x24312f[_0x4b69('0x53')]['id'])});}});}})[_0x4b69('0x35')](respondWithStatusCode(_0x2fca9f,null))[_0x4b69('0x5f')](handleError(_0x2fca9f,null));};exports[_0x4b69('0x11c')]=function(_0x2fcffb,_0x256891,_0x4ee66a){var _0xb51893={};var _0x48334e={};var _0x4e9a36;var _0x1c9b62;return db[_0x4b69('0x3c')][_0x4b69('0x63')]({'where':{'id':_0x2fcffb[_0x4b69('0x53')]['id']}})[_0x4b69('0x35')](handleEntityNotFound(_0x256891,null))[_0x4b69('0x35')](function(_0x432088){if(_0x432088){_0x4e9a36=_0x432088;_0x48334e[_0x4b69('0x3d')]=_[_0x4b69('0x3f')](db['User']['rawAttributes']);_0x48334e[_0x4b69('0x3e')]=_[_0x4b69('0x3f')](_0x2fcffb['query']);_0x48334e[_0x4b69('0x66')]=_['intersection'](_0x48334e['model'],_0x48334e[_0x4b69('0x3e')]);_0xb51893[_0x4b69('0x41')]=_['intersection'](_0x48334e['model'],qs[_0x4b69('0x42')](_0x2fcffb[_0x4b69('0x3e')][_0x4b69('0x42')]));_0xb51893[_0x4b69('0x41')]=_0xb51893[_0x4b69('0x41')][_0x4b69('0x67')]?_0xb51893['attributes']:_0x48334e[_0x4b69('0x3d')];_0xb51893['order']=qs[_0x4b69('0x46')](_0x2fcffb[_0x4b69('0x3e')][_0x4b69('0x46')]);_0xb51893[_0x4b69('0x48')]=qs[_0x4b69('0x66')](_['pick'](_0x2fcffb[_0x4b69('0x3e')],_0x48334e[_0x4b69('0x66')]));if(_0x2fcffb['query'][_0x4b69('0x4d')]){_0xb51893[_0x4b69('0x48')]=_[_0x4b69('0x49')](_0xb51893[_0x4b69('0x48')],{'$or':_[_0x4b69('0x6c')](_0xb51893[_0x4b69('0x41')],function(_0x60c6cc){var _0x44ae35={};_0x44ae35[_0x60c6cc]={'$like':'%'+_0x2fcffb[_0x4b69('0x3e')][_0x4b69('0x4d')]+'%'};return _0x44ae35;})});}_0xb51893=_[_0x4b69('0x49')]({},_0xb51893,_0x2fcffb[_0x4b69('0x4e')]);return _0x4e9a36[_0x4b69('0x11c')](_0xb51893);}})['then'](function(_0x58511e){if(_0x58511e){_0x1c9b62=_0x58511e[_0x4b69('0x67')];if(!_0x2fcffb[_0x4b69('0x3e')]['hasOwnProperty'](_0x4b69('0x44'))){_0xb51893[_0x4b69('0x2f')]=qs[_0x4b69('0x2f')](_0x2fcffb[_0x4b69('0x3e')]['limit']);_0xb51893['offset']=qs['offset'](_0x2fcffb[_0x4b69('0x3e')][_0x4b69('0x2e')]);}return _0x4e9a36['getAgents'](_0xb51893);}})[_0x4b69('0x35')](function(_0x2e9218){if(_0x2e9218){return _0x2e9218?{'count':_0x1c9b62,'rows':_0x2e9218}:null;}})['then'](respondWithResult(_0x256891,null))[_0x4b69('0x5f')](handleError(_0x256891,null));}; \ No newline at end of file +var _0xa25d=['getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','getSystemAvatar','user-agent','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','orderBy','priority','defaults','contact','headers','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','unknown','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','close','unmanaged','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','notify','offline','CompanyId','send','mapKeyOffline','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','getInteractions','Contact','fullname','internal','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','Interval','getProactiveActions','getLicense','License','chatLicenseExceeded','Intervals','readFileSync','server/files/chat/iframe.js','remote','x-real-ip','connection','remoteAddress','virtual','replace','alignment','verticalAlignment','addApplications','sequelize','bulkCreate','getApplications','addProactiveActions','omit','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','addAgents','userChatWebsite:save','emit','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','register','jayson/promise','client','http','test','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','destroy','then','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','ChatWebsite','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','order','sort','filter','where','map','type','key','field','merge','options','includeAll','findAll','rows','show','rawAttributes','length','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','params','describe','addDisposition','Disposition','getDispositions','nolimit','pick','ChatWebsiteId','removeDispositions','ids','addAnswer','findOne','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.png','../../config/license/util','custom','isNil','existsSync','join','server/files/images/logos/','download'];(function(_0x295aae,_0x542b68){var _0x132e70=function(_0x53a80e){while(--_0x53a80e){_0x295aae['push'](_0x295aae['shift']());}};_0x132e70(++_0x542b68);}(_0xa25d,0x1b3));var _0xda25=function(_0x32062c,_0x43ee1f){_0x32062c=_0x32062c-0x0;var _0xa8ccf1=_0xa25d[_0x32062c];return _0xa8ccf1;};'use strict';var pdf=require(_0xda25('0x0'));var emlformat=require(_0xda25('0x1'));var rimraf=require(_0xda25('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xda25('0x3'));var rp=require(_0xda25('0x4'));var moment=require('moment');var BPromise=require(_0xda25('0x5'));var Mustache=require(_0xda25('0x6'));var util=require(_0xda25('0x7'));var path=require(_0xda25('0x8'));var sox=require(_0xda25('0x9'));var csv=require('to-csv');var ejs=require(_0xda25('0xa'));var fs=require('fs');var _=require(_0xda25('0xb'));var squel=require(_0xda25('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xda25('0xd'));var toCsv=require(_0xda25('0xe'));var querystring=require(_0xda25('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xda25('0x10'));var qs=require(_0xda25('0x11'));var hardwareService=require(_0xda25('0x12'));var logger=require(_0xda25('0x13'))('api');var utils=require(_0xda25('0x14'));var config=require('../../config/environment');var db=require(_0xda25('0x15'))['db'];config[_0xda25('0x16')]=_['defaults'](config[_0xda25('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0xda25('0x17')](socket);var jayson=require(_0xda25('0x18'));var client=jayson[_0xda25('0x19')][_0xda25('0x1a')]({'port':0x232c});var client9002=jayson[_0xda25('0x19')][_0xda25('0x1a')]({'port':0x232a});var client9003=jayson['client'][_0xda25('0x1a')]({'port':0x232b});function checkPasswordPattern(_0x394af9,_0x592471,_0x185feb){if(_0x185feb){var _0x38edab=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x38edab[_0xda25('0x1b')](_0x592471)){return _0x394af9;}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 _0x394af9;}}function respondWithRpcPromise(_0x5773a6,_0xac4d6b,_0x5146e9,_0x449458){return new BPromise(function(_0x5ccba4,_0x5c6cd){var _0x4ffe55=_0x449458||client;return _0x4ffe55[_0xda25('0x1c')](_0x5773a6,_0x5146e9)['then'](function(_0xf47890){logger['info'](_0xda25('0x1d'),_0xac4d6b,_0xda25('0x1e'));logger[_0xda25('0x1f')](_0xda25('0x20'),_0xac4d6b,_0xda25('0x1e'),JSON['stringify'](_0xf47890));if(_0xf47890[_0xda25('0x21')]){if(_0xf47890[_0xda25('0x21')][_0xda25('0x22')]===0x1f4){logger[_0xda25('0x21')]('ChatWebsite,\x20%s,\x20%s',_0xac4d6b,_0xf47890[_0xda25('0x21')][_0xda25('0x23')]);return _0x5c6cd(_0xf47890['error'][_0xda25('0x23')]);}logger['error'](_0xda25('0x1d'),_0xac4d6b,_0xf47890[_0xda25('0x21')][_0xda25('0x23')]);return _0x5ccba4(_0xf47890[_0xda25('0x21')][_0xda25('0x23')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0xac4d6b,_0xda25('0x1e'));_0x5ccba4(_0xf47890[_0xda25('0x24')][_0xda25('0x23')]);}})[_0xda25('0x25')](function(_0x1499ab){logger[_0xda25('0x21')](_0xda25('0x1d'),_0xac4d6b,_0x1499ab);_0x5c6cd(_0x1499ab);});});}function respondWithStatusCode(_0x54aabd,_0x1c999a){_0x1c999a=_0x1c999a||0xcc;return function(_0x38fe02){if(_0x38fe02){return _0x54aabd[_0xda25('0x26')](_0x1c999a);}return _0x54aabd[_0xda25('0x27')](_0x1c999a)[_0xda25('0x28')]();};}function respondWithResult(_0x425b07,_0x10a79f){_0x10a79f=_0x10a79f||0xc8;return function(_0x289e7f){if(_0x289e7f){return _0x425b07[_0xda25('0x27')](_0x10a79f)[_0xda25('0x29')](_0x289e7f);}};}function respondWithFilteredResult(_0x533cd7,_0x5863bf){return function(_0x22c6de){if(_0x22c6de){var _0x471eb1=_0x22c6de[_0xda25('0x2a')],_0x53d4dc=_0x5863bf[_0xda25('0x2b')],_0x23177c=_0x5863bf[_0xda25('0x2b')]+_0x5863bf[_0xda25('0x2c')],_0x1b72d5;if(_0x23177c>=_0x471eb1){_0x23177c=_0x471eb1;_0x1b72d5=0xc8;}else{_0x1b72d5=0xce;}_0x533cd7[_0xda25('0x27')](_0x1b72d5);return _0x533cd7['set'](_0xda25('0x2d'),_0x53d4dc+'-'+_0x23177c+'/'+_0x471eb1)[_0xda25('0x29')](_0x22c6de);}return null;};}function patchUpdates(_0x5a123a){return function(_0x5d0ee2){try{jsonpatch[_0xda25('0x2e')](_0x5d0ee2,_0x5a123a,!![]);}catch(_0x47f104){return BPromise['reject'](_0x47f104);}return _0x5d0ee2[_0xda25('0x2f')]();};}function saveUpdates(_0x101e6b,_0x456bb1){return function(_0x2470e1){if(_0x2470e1){return _0x2470e1['update'](_0x101e6b)['then'](function(_0x245b89){return _0x245b89;});}return null;};}function removeEntity(_0x1103f6,_0x2bf987){return function(_0x47a78e){if(_0x47a78e){return _0x47a78e[_0xda25('0x30')]()[_0xda25('0x31')](function(){var _0xd7121c=_0x47a78e[_0xda25('0x32')]({'plain':!![]});var _0x167a00=_0xda25('0x33');return db[_0xda25('0x34')][_0xda25('0x30')]({'where':{'type':_0x167a00,'resourceId':_0xd7121c['id']}})[_0xda25('0x31')](function(){return _0x47a78e;});})[_0xda25('0x31')](function(){_0x1103f6[_0xda25('0x27')](0xcc)[_0xda25('0x28')]();});}};}function handleEntityNotFound(_0x400686,_0x18bd42){return function(_0x5644f8){if(!_0x5644f8){_0x400686[_0xda25('0x26')](0x194);}return _0x5644f8;};}function handleError(_0x29fa71,_0xe6c9b2){_0xe6c9b2=_0xe6c9b2||0x1f4;return function(_0x1c8248){logger['error'](_0x1c8248[_0xda25('0x35')]);if(_0x1c8248[_0xda25('0x36')]){delete _0x1c8248[_0xda25('0x36')];}_0x29fa71[_0xda25('0x27')](_0xe6c9b2)['send'](_0x1c8248);};}exports[_0xda25('0x37')]=function(_0x5551fb,_0x46b323){var _0x4851c0={'include':[{'model':db[_0xda25('0x38')],'as':_0xda25('0x39')}]},_0x3a330b={},_0x234731={'count':0x0,'rows':[]};var _0x10c45e=db[_0xda25('0x3a')]['rawAttributes'];_0x3a330b[_0xda25('0x3b')]=_[_0xda25('0x3c')](_0x10c45e);_0x3a330b['query']=_[_0xda25('0x3c')](_0x5551fb['query']);_0x3a330b[_0xda25('0x3d')]=_[_0xda25('0x3e')](_0x3a330b['model'],_0x3a330b[_0xda25('0x3f')]);_0x4851c0['attributes']=_[_0xda25('0x3e')](_0x3a330b[_0xda25('0x3b')],qs[_0xda25('0x40')](_0x5551fb[_0xda25('0x3f')][_0xda25('0x40')]));_0x4851c0[_0xda25('0x41')]=_0x4851c0[_0xda25('0x41')]['length']?_0x4851c0[_0xda25('0x41')]:_0x3a330b[_0xda25('0x3b')];if(!_0x5551fb['query'][_0xda25('0x42')]('nolimit')){_0x4851c0['limit']=qs[_0xda25('0x2c')](_0x5551fb['query'][_0xda25('0x2c')]);_0x4851c0[_0xda25('0x2b')]=qs[_0xda25('0x2b')](_0x5551fb[_0xda25('0x3f')][_0xda25('0x2b')]);}_0x4851c0[_0xda25('0x43')]=qs[_0xda25('0x44')](_0x5551fb[_0xda25('0x3f')]['sort']);_0x4851c0['where']=qs[_0xda25('0x3d')](_['pick'](_0x5551fb[_0xda25('0x3f')],_0x3a330b[_0xda25('0x3d')]));if(_0x5551fb[_0xda25('0x3f')][_0xda25('0x45')]){_0x4851c0[_0xda25('0x46')]=_['merge'](_0x4851c0[_0xda25('0x46')],{'$or':_[_0xda25('0x47')](_0x10c45e,function(_0x4d90d2){if(_0x4d90d2[_0xda25('0x48')][_0xda25('0x49')]!=='VIRTUAL'){var _0x115b48={};_0x115b48[_0x4d90d2[_0xda25('0x4a')]]={'$like':'%'+_0x5551fb[_0xda25('0x3f')]['filter']+'%'};return _0x115b48;}})});}_0x4851c0=_[_0xda25('0x4b')]({},_0x4851c0,_0x5551fb[_0xda25('0x4c')]);var _0x1571c1={'where':_0x4851c0[_0xda25('0x46')]};return db['ChatWebsite'][_0xda25('0x2a')](_0x1571c1)['then'](function(_0x5320a9){_0x234731[_0xda25('0x2a')]=_0x5320a9;if(_0x5551fb[_0xda25('0x3f')][_0xda25('0x4d')]){_0x4851c0['include']=[{'all':!![]}];}return db[_0xda25('0x3a')][_0xda25('0x4e')](_0x4851c0);})[_0xda25('0x31')](function(_0x345c66){_0x234731[_0xda25('0x4f')]=_0x345c66;return _0x234731;})[_0xda25('0x31')](respondWithFilteredResult(_0x46b323,_0x4851c0))[_0xda25('0x25')](handleError(_0x46b323,null));};exports[_0xda25('0x50')]=function(_0x48b350,_0x6cdba6){var _0xa8a144={'raw':![],'where':{'id':_0x48b350['params']['id']},'include':[{'model':db[_0xda25('0x38')],'as':_0xda25('0x39')}]},_0x15ddf2={};_0x15ddf2[_0xda25('0x3b')]=_[_0xda25('0x3c')](db[_0xda25('0x3a')][_0xda25('0x51')]);_0x15ddf2[_0xda25('0x3f')]=_[_0xda25('0x3c')](_0x48b350['query']);_0x15ddf2['filters']=_['intersection'](_0x15ddf2['model'],_0x15ddf2[_0xda25('0x3f')]);_0xa8a144[_0xda25('0x41')]=_[_0xda25('0x3e')](_0x15ddf2[_0xda25('0x3b')],qs[_0xda25('0x40')](_0x48b350['query']['fields']));_0xa8a144[_0xda25('0x41')]=_0xa8a144[_0xda25('0x41')][_0xda25('0x52')]?_0xa8a144[_0xda25('0x41')]:_0x15ddf2[_0xda25('0x3b')];if(_0x48b350[_0xda25('0x3f')][_0xda25('0x4d')]){_0xa8a144[_0xda25('0x53')]=[{'all':!![]}];}_0xa8a144=_['merge']({},_0xa8a144,_0x48b350[_0xda25('0x4c')]);return db[_0xda25('0x3a')]['find'](_0xa8a144)[_0xda25('0x31')](handleEntityNotFound(_0x6cdba6,null))[_0xda25('0x31')](respondWithResult(_0x6cdba6,null))[_0xda25('0x25')](handleError(_0x6cdba6,null));};exports[_0xda25('0x54')]=function(_0x50ca48,_0x2258a8){return db[_0xda25('0x3a')][_0xda25('0x54')](_0x50ca48['body'],{})[_0xda25('0x31')](function(_0x4ecdc0){var _0x287830=_0x50ca48['user'][_0xda25('0x32')]({'plain':!![]});if(!_0x287830)throw new Error(_0xda25('0x55'));if(_0x287830[_0xda25('0x56')]===_0xda25('0x57')){var _0x323814=_0x4ecdc0[_0xda25('0x32')]({'plain':!![]});var _0xdb5d17='ChatWebsites';return db[_0xda25('0x58')]['find']({'where':{'name':_0xdb5d17,'userProfileId':_0x287830['userProfileId']},'raw':!![]})[_0xda25('0x31')](function(_0x7c6146){if(_0x7c6146&&_0x7c6146['autoAssociation']===0x0){return db[_0xda25('0x34')]['create']({'name':_0x323814[_0xda25('0x36')],'resourceId':_0x323814['id'],'type':_0x7c6146[_0xda25('0x36')],'sectionId':_0x7c6146['id']},{})[_0xda25('0x31')](function(){return _0x4ecdc0;});}else{return _0x4ecdc0;}})[_0xda25('0x25')](function(_0x372737){logger['error'](_0xda25('0x59'),_0x372737);throw _0x372737;});}return _0x4ecdc0;})['then'](respondWithResult(_0x2258a8,0xc9))[_0xda25('0x25')](handleError(_0x2258a8,null));};exports[_0xda25('0x5a')]=function(_0x20b4b5,_0x30918a){if(_0x20b4b5['body']['id']){delete _0x20b4b5[_0xda25('0x5b')]['id'];}return db[_0xda25('0x3a')][_0xda25('0x5c')]({'where':{'id':_0x20b4b5[_0xda25('0x5d')]['id']},'include':[{'model':db[_0xda25('0x38')],'as':_0xda25('0x39')}]})[_0xda25('0x31')](handleEntityNotFound(_0x30918a,null))['then'](saveUpdates(_0x20b4b5['body'],null))[_0xda25('0x31')](respondWithResult(_0x30918a,null))[_0xda25('0x25')](handleError(_0x30918a,null));};exports[_0xda25('0x30')]=function(_0x165690,_0x4f8e7c){return db[_0xda25('0x3a')][_0xda25('0x5c')]({'where':{'id':_0x165690[_0xda25('0x5d')]['id']}})[_0xda25('0x31')](handleEntityNotFound(_0x4f8e7c,null))[_0xda25('0x31')](removeEntity(_0x4f8e7c,null))[_0xda25('0x25')](handleError(_0x4f8e7c,null));};exports[_0xda25('0x5e')]=function(_0x4d9c61,_0xad4e30){return db[_0xda25('0x3a')][_0xda25('0x5e')]()[_0xda25('0x31')](respondWithResult(_0xad4e30,null))[_0xda25('0x25')](handleError(_0xad4e30,null));};exports[_0xda25('0x5f')]=function(_0x494b62,_0x171c09,_0x49e2ec){if(_0x494b62[_0xda25('0x5b')]['id']){delete _0x494b62['body']['id'];}return db[_0xda25('0x3a')][_0xda25('0x5c')]({'where':{'id':_0x494b62['params']['id']}})[_0xda25('0x31')](handleEntityNotFound(_0x171c09,null))[_0xda25('0x31')](function(_0x2abb84){if(_0x2abb84){_0x494b62[_0xda25('0x5b')]['ChatWebsiteId']=_0x2abb84['id'];return db[_0xda25('0x60')]['create'](_0x494b62[_0xda25('0x5b')]);}})[_0xda25('0x31')](respondWithResult(_0x171c09,null))['catch'](handleError(_0x171c09,null));};exports[_0xda25('0x61')]=function(_0x1a6355,_0x5af12f,_0x354f0e){var _0x3edce4={'raw':![],'where':{}};var _0x51b472={};var _0x17b1b3={'count':0x0,'rows':[]};return db[_0xda25('0x3a')]['findOne']({'where':{'id':_0x1a6355[_0xda25('0x5d')]['id']}})[_0xda25('0x31')](handleEntityNotFound(_0x5af12f,null))[_0xda25('0x31')](function(_0x5b1973){if(_0x5b1973){_0x51b472['model']=_[_0xda25('0x3c')](db['Disposition'][_0xda25('0x51')]);_0x51b472[_0xda25('0x3f')]=_[_0xda25('0x3c')](_0x1a6355[_0xda25('0x3f')]);_0x51b472['filters']=_[_0xda25('0x3e')](_0x51b472[_0xda25('0x3b')],_0x51b472[_0xda25('0x3f')]);_0x3edce4['attributes']=_[_0xda25('0x3e')](_0x51b472[_0xda25('0x3b')],qs['fields'](_0x1a6355[_0xda25('0x3f')][_0xda25('0x40')]));_0x3edce4[_0xda25('0x41')]=_0x3edce4[_0xda25('0x41')]['length']?_0x3edce4[_0xda25('0x41')]:_0x51b472[_0xda25('0x3b')];if(!_0x1a6355['query']['hasOwnProperty'](_0xda25('0x62'))){_0x3edce4[_0xda25('0x2c')]=qs['limit'](_0x1a6355[_0xda25('0x3f')][_0xda25('0x2c')]);_0x3edce4[_0xda25('0x2b')]=qs[_0xda25('0x2b')](_0x1a6355[_0xda25('0x3f')]['offset']);}_0x3edce4[_0xda25('0x43')]=qs[_0xda25('0x44')](_0x1a6355[_0xda25('0x3f')][_0xda25('0x44')]);_0x3edce4[_0xda25('0x46')]=qs['filters'](_[_0xda25('0x63')](_0x1a6355[_0xda25('0x3f')],_0x51b472[_0xda25('0x3d')]));_0x3edce4[_0xda25('0x46')][_0xda25('0x64')]=_0x5b1973['id'];if(_0x1a6355[_0xda25('0x3f')]['filter']){_0x3edce4[_0xda25('0x46')]=_[_0xda25('0x4b')](_0x3edce4[_0xda25('0x46')],{'$or':_[_0xda25('0x47')](_0x3edce4[_0xda25('0x41')],function(_0x448456){var _0x4b7f22={};_0x4b7f22[_0x448456]={'$like':'%'+_0x1a6355[_0xda25('0x3f')][_0xda25('0x45')]+'%'};return _0x4b7f22;})});}_0x3edce4=_[_0xda25('0x4b')]({},_0x3edce4,_0x1a6355[_0xda25('0x4c')]);return db[_0xda25('0x60')]['count']({'where':_0x3edce4['where']})[_0xda25('0x31')](function(_0x5e691a){_0x17b1b3[_0xda25('0x2a')]=_0x5e691a;if(_0x1a6355[_0xda25('0x3f')]['includeAll']){_0x3edce4[_0xda25('0x53')]=[{'all':!![]}];}return db[_0xda25('0x60')][_0xda25('0x4e')](_0x3edce4);})[_0xda25('0x31')](function(_0x90ad9a){_0x17b1b3[_0xda25('0x4f')]=_0x90ad9a;return _0x17b1b3;});}})['then'](respondWithFilteredResult(_0x5af12f,_0x3edce4))[_0xda25('0x25')](handleError(_0x5af12f,null));};exports[_0xda25('0x65')]=function(_0x1b22ae,_0x5781a8,_0x3f2682){return db[_0xda25('0x3a')]['find']({'where':{'id':_0x1b22ae[_0xda25('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5781a8,null))['then'](function(_0x5a8ab3){if(_0x5a8ab3){return _0x5a8ab3[_0xda25('0x65')](_0x1b22ae['query'][_0xda25('0x66')]);}})[_0xda25('0x31')](respondWithStatusCode(_0x5781a8,null))[_0xda25('0x25')](handleError(_0x5781a8,null));};exports[_0xda25('0x67')]=function(_0x510553,_0x4fc887,_0x14527a){if(_0x510553[_0xda25('0x5b')]['id']){delete _0x510553[_0xda25('0x5b')]['id'];}return db[_0xda25('0x3a')][_0xda25('0x5c')]({'where':{'id':_0x510553[_0xda25('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4fc887,null))['then'](function(_0x31335f){if(_0x31335f){_0x510553[_0xda25('0x5b')]['ChatWebsiteId']=_0x31335f['id'];return db['CannedAnswer'][_0xda25('0x54')](_0x510553[_0xda25('0x5b')]);}})[_0xda25('0x31')](respondWithResult(_0x4fc887,null))['catch'](handleError(_0x4fc887,null));};exports['getAnswers']=function(_0x3467aa,_0x25e018,_0x20ad6c){var _0x534c48={'raw':![],'where':{}};var _0x473dd2={};var _0x3924d4={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xda25('0x68')]({'where':{'id':_0x3467aa[_0xda25('0x5d')]['id']}})[_0xda25('0x31')](handleEntityNotFound(_0x25e018,null))[_0xda25('0x31')](function(_0x49776b){if(_0x49776b){_0x473dd2[_0xda25('0x3b')]=_[_0xda25('0x3c')](db[_0xda25('0x69')]['rawAttributes']);_0x473dd2[_0xda25('0x3f')]=_[_0xda25('0x3c')](_0x3467aa['query']);_0x473dd2[_0xda25('0x3d')]=_['intersection'](_0x473dd2['model'],_0x473dd2[_0xda25('0x3f')]);_0x534c48['attributes']=_[_0xda25('0x3e')](_0x473dd2[_0xda25('0x3b')],qs['fields'](_0x3467aa['query'][_0xda25('0x40')]));_0x534c48['attributes']=_0x534c48[_0xda25('0x41')][_0xda25('0x52')]?_0x534c48[_0xda25('0x41')]:_0x473dd2['model'];if(!_0x3467aa[_0xda25('0x3f')]['hasOwnProperty'](_0xda25('0x62'))){_0x534c48[_0xda25('0x2c')]=qs[_0xda25('0x2c')](_0x3467aa[_0xda25('0x3f')][_0xda25('0x2c')]);_0x534c48[_0xda25('0x2b')]=qs[_0xda25('0x2b')](_0x3467aa[_0xda25('0x3f')][_0xda25('0x2b')]);}_0x534c48['order']=qs['sort'](_0x3467aa[_0xda25('0x3f')][_0xda25('0x44')]);_0x534c48[_0xda25('0x46')]=qs[_0xda25('0x3d')](_['pick'](_0x3467aa[_0xda25('0x3f')],_0x473dd2[_0xda25('0x3d')]));_0x534c48[_0xda25('0x46')][_0xda25('0x64')]=_0x49776b['id'];if(_0x3467aa[_0xda25('0x3f')]['filter']){_0x534c48[_0xda25('0x46')]=_[_0xda25('0x4b')](_0x534c48[_0xda25('0x46')],{'$or':_['map'](_0x534c48[_0xda25('0x41')],function(_0x53d6eb){var _0x241535={};_0x241535[_0x53d6eb]={'$like':'%'+_0x3467aa['query'][_0xda25('0x45')]+'%'};return _0x241535;})});}_0x534c48=_[_0xda25('0x4b')]({},_0x534c48,_0x3467aa[_0xda25('0x4c')]);return db[_0xda25('0x69')][_0xda25('0x2a')]({'where':_0x534c48[_0xda25('0x46')]})[_0xda25('0x31')](function(_0x537dc0){_0x3924d4[_0xda25('0x2a')]=_0x537dc0;if(_0x3467aa[_0xda25('0x3f')][_0xda25('0x4d')]){_0x534c48['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xda25('0x4e')](_0x534c48);})[_0xda25('0x31')](function(_0x5bd894){_0x3924d4[_0xda25('0x4f')]=_0x5bd894;return _0x3924d4;});}})['then'](respondWithFilteredResult(_0x25e018,_0x534c48))['catch'](handleError(_0x25e018,null));};exports[_0xda25('0x6a')]=function(_0x28ff3a,_0x33737e,_0x52e935){return db[_0xda25('0x3a')]['find']({'where':{'id':_0x28ff3a[_0xda25('0x5d')]['id']}})[_0xda25('0x31')](handleEntityNotFound(_0x33737e,null))[_0xda25('0x31')](function(_0x1b231e){if(_0x1b231e){return _0x1b231e[_0xda25('0x6a')](_0x28ff3a[_0xda25('0x3f')][_0xda25('0x66')]);}})[_0xda25('0x31')](respondWithStatusCode(_0x33737e,null))['catch'](handleError(_0x33737e,null));};exports[_0xda25('0x6b')]=function(_0x1b8940,_0x473f5f,_0x44398f){_0x1b8940['body'][_0xda25('0x6c')]=_0x1b8940[_0xda25('0x6d')][_0xda25('0x6e')];return db['ChatWebsite']['find']({'where':{'id':_0x1b8940[_0xda25('0x5d')]['id']}})[_0xda25('0x31')](handleEntityNotFound(_0x473f5f,null))[_0xda25('0x31')](saveUpdates(_0x1b8940[_0xda25('0x5b')],null))['then'](respondWithResult(_0x473f5f,null))[_0xda25('0x25')](handleError(_0x473f5f,null));};exports[_0xda25('0x6f')]=function(_0x3c2e41,_0x60eecc,_0xeeda73){_0x3c2e41['body'][_0xda25('0x70')]=_0x3c2e41[_0xda25('0x6d')][_0xda25('0x6e')];return db[_0xda25('0x3a')][_0xda25('0x5c')]({'where':{'id':_0x3c2e41[_0xda25('0x5d')]['id']}})[_0xda25('0x31')](handleEntityNotFound(_0x60eecc,null))['then'](saveUpdates(_0x3c2e41['body'],null))[_0xda25('0x31')](respondWithResult(_0x60eecc,null))['catch'](handleError(_0x60eecc,null));};exports['addCustomerAvatar']=function(_0x31ec3a,_0x5233d,_0x7342f5){_0x31ec3a[_0xda25('0x5b')]['customerAvatar']=_0x31ec3a[_0xda25('0x6d')]['filename'];return db[_0xda25('0x3a')][_0xda25('0x5c')]({'where':{'id':_0x31ec3a[_0xda25('0x5d')]['id']}})[_0xda25('0x31')](handleEntityNotFound(_0x5233d,null))[_0xda25('0x31')](saveUpdates(_0x31ec3a[_0xda25('0x5b')],null))[_0xda25('0x31')](respondWithResult(_0x5233d,null))[_0xda25('0x25')](handleError(_0x5233d,null));};exports[_0xda25('0x71')]=function(_0x572e79,_0x2ff3e9,_0x1af924){_0x572e79[_0xda25('0x5b')][_0xda25('0x72')]=_0x572e79['file'][_0xda25('0x6e')];return db[_0xda25('0x3a')][_0xda25('0x5c')]({'where':{'id':_0x572e79[_0xda25('0x5d')]['id']}})[_0xda25('0x31')](handleEntityNotFound(_0x2ff3e9,null))[_0xda25('0x31')](saveUpdates(_0x572e79[_0xda25('0x5b')],null))['then'](respondWithResult(_0x2ff3e9,null))[_0xda25('0x25')](handleError(_0x2ff3e9,null));};exports[_0xda25('0x73')]=function(_0x342395,_0x36ff60,_0x31f5a1){var _0x33e9ec=path['join'](config[_0xda25('0x74')],_0xda25('0x75'));var _0x5db9c2={'where':{'id':_0x342395[_0xda25('0x5d')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x20e339=![];return require(_0xda25('0x76'))['getLicense']()[_0xda25('0x31')](function(_0x19913c){if(_0x19913c){_0x20e339=_0x19913c[_0xda25('0x77')];}})[_0xda25('0x31')](function(){return db[_0xda25('0x3a')][_0xda25('0x5c')](_0x5db9c2);})[_0xda25('0x31')](handleEntityNotFound(_0x36ff60,null))[_0xda25('0x31')](function(_0x35b0b4){if(_0x35b0b4){if(!_[_0xda25('0x78')](_0x35b0b4[_0xda25('0x6c')])){if(fs[_0xda25('0x79')](path[_0xda25('0x7a')](config['root'],_0xda25('0x7b'),_0x35b0b4[_0xda25('0x6c')]))&&_0x20e339){_0x33e9ec=path['join'](config[_0xda25('0x74')],_0xda25('0x7b'),_0x35b0b4[_0xda25('0x6c')]);}}return _0x36ff60[_0xda25('0x7c')](_0x33e9ec);}})[_0xda25('0x25')](handleError(_0x36ff60,null));};exports[_0xda25('0x7d')]=function(_0x322854,_0x3425cf,_0x32d6c7){var _0x5beddb=path['join'](config[_0xda25('0x74')],_0xda25('0x7e'));var _0x1a2ca7={'where':{'id':_0x322854['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xda25('0x3a')]['find'](_0x1a2ca7)[_0xda25('0x31')](handleEntityNotFound(_0x3425cf,null))[_0xda25('0x31')](function(_0x2802ba){if(_0x2802ba){if(!_[_0xda25('0x78')](_0x2802ba[_0xda25('0x70')])){if(fs[_0xda25('0x79')](path[_0xda25('0x7a')](config['root'],_0xda25('0x7f'),_0x2802ba[_0xda25('0x70')]))){_0x5beddb=path[_0xda25('0x7a')](config[_0xda25('0x74')],'server/files/images/avatars/',_0x2802ba[_0xda25('0x70')]);}}return _0x3425cf['download'](_0x5beddb);}})[_0xda25('0x25')](handleError(_0x3425cf,null));};exports[_0xda25('0x80')]=function(_0x2aa690,_0x1da879,_0x44c443){var _0x33d7cb=path[_0xda25('0x7a')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x319ee4={'where':{'id':_0x2aa690[_0xda25('0x5d')]['id']},'attributes':['id',_0xda25('0x81'),_0xda25('0x82')],'raw':!![]};return db['ChatWebsite'][_0xda25('0x5c')](_0x319ee4)[_0xda25('0x31')](handleEntityNotFound(_0x1da879,null))[_0xda25('0x31')](function(_0x3aa531){if(_0x3aa531){if(!_[_0xda25('0x78')](_0x3aa531[_0xda25('0x81')])){if(fs[_0xda25('0x79')](path[_0xda25('0x7a')](config['root'],_0xda25('0x7f'),_0x3aa531[_0xda25('0x81')]))&&_0x3aa531[_0xda25('0x82')]){_0x33d7cb=path[_0xda25('0x7a')](config['root'],_0xda25('0x7f'),_0x3aa531['customerAvatar']);}}return _0x1da879[_0xda25('0x7c')](_0x33d7cb);}})['catch'](handleError(_0x1da879,null));};exports[_0xda25('0x83')]=function(_0xcda9e9,_0x264f06,_0x3647a2){var _0x400105=path[_0xda25('0x7a')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x425f31={'where':{'id':_0xcda9e9[_0xda25('0x5d')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xda25('0x3a')][_0xda25('0x5c')](_0x425f31)[_0xda25('0x31')](handleEntityNotFound(_0x264f06,null))[_0xda25('0x31')](function(_0x184b77){if(_0x184b77){if(!_[_0xda25('0x78')](_0x184b77[_0xda25('0x72')])){if(fs[_0xda25('0x79')](path[_0xda25('0x7a')](config[_0xda25('0x74')],'server/files/images/avatars/',_0x184b77['systemAvatar']))){_0x400105=path[_0xda25('0x7a')](config[_0xda25('0x74')],_0xda25('0x7f'),_0x184b77[_0xda25('0x72')]);}}return _0x264f06[_0xda25('0x7c')](_0x400105);}})[_0xda25('0x25')](handleError(_0x264f06,null));};exports['notify']=function(_0xd6762a,_0x38b519,_0x5bd633){var _0x44e435=require('user-agent-parser');var _0x3144ca=new _0x44e435();var _0x4ac15f=_0x3144ca['setUA'](_0xd6762a['headers'][_0xda25('0x84')])['getResult']();var _0x8da82={'body':_0xd6762a[_0xda25('0x5b')],'channel':_0xda25('0x85')};var _0x4a874f=[];var _0x3c898a=[];var _0x4eb294={};var _0x39568b=![];return db[_0xda25('0x86')]['describe']()[_0xda25('0x31')](function(_0x38fb84){if(!_0x38fb84){throw new db[(_0xda25('0x87'))]['ValidationError'](_0xda25('0x88'));}_0x4a874f=_[_0xda25('0x89')](_[_0xda25('0x3c')](_0x38fb84),['createdAt',_0xda25('0x8a')]);_0x3c898a=_[_0xda25('0x89')](_['keys'](_0x38fb84),[_0xda25('0x8b'),_0xda25('0x8a'),'CompanyId',_0xda25('0x8c')]);if(_0xd6762a['body']['id']){delete _0xd6762a[_0xda25('0x5b')]['id'];}if(_[_0xda25('0x78')](_0xd6762a['body']['from'])){throw new db['Sequelize'][(_0xda25('0x8d'))](_0xda25('0x8e'));}if(_[_0xda25('0x78')](_0xd6762a[_0xda25('0x5b')][_0xda25('0x5b')])||_0xd6762a[_0xda25('0x5b')][_0xda25('0x5b')]===''){throw new db[(_0xda25('0x87'))][(_0xda25('0x8d'))](_0xda25('0x8f'));}if(_[_0xda25('0x78')](_0xd6762a[_0xda25('0x5b')][_0xda25('0x90')])){throw new db[(_0xda25('0x87'))][(_0xda25('0x8d'))](_0xda25('0x91')+_0x3c898a);}if(!_[_0xda25('0x92')](_0x3c898a,_0xd6762a[_0xda25('0x5b')]['mapKey'])){throw new db[(_0xda25('0x87'))][(_0xda25('0x8d'))](_0xda25('0x93')+_0x3c898a);}_0x4eb294[_0xd6762a['body'][_0xda25('0x90')]]=_0xd6762a[_0xda25('0x5b')][_0xda25('0x94')];})[_0xda25('0x31')](function(){return db['ChatWebsite']['find']({'where':{'id':_0xd6762a[_0xda25('0x5d')]['id']},'include':[{'model':db[_0xda25('0x95')],'as':_0xda25('0x96'),'include':[{'model':db[_0xda25('0x86')],'as':_0xda25('0x97'),'where':_0x4eb294,'limit':0x1,'order':[[_0xda25('0x8a'),_0xda25('0x98')]]}]},{'model':db[_0xda25('0x99')],'as':_0xda25('0x9a')}]});})[_0xda25('0x31')](handleEntityNotFound(_0x38b519,null))[_0xda25('0x31')](function(_0x5b25c4){if(_0x5b25c4&&_0x5b25c4[_0xda25('0x96')]){_0x8da82[_0xda25('0x9b')]=_0x5b25c4;_0x8da82[_0xda25('0x9c')]=_0x5b25c4[_0xda25('0x9a')];_0x8da82['list']=_0x5b25c4[_0xda25('0x96')];_0x8da82[_0xda25('0x9c')]=_[_0xda25('0x9d')](_0x8da82[_0xda25('0x9c')],[_0xda25('0x9e')],['asc']);if(_0x8da82[_0xda25('0x9b')][_0xda25('0x9a')]){delete _0x8da82[_0xda25('0x9b')][_0xda25('0x9a')];}if(_0x8da82[_0xda25('0x9b')][_0xda25('0x96')]&&_0x8da82['account'][_0xda25('0x96')][_0xda25('0x97')][_0xda25('0x52')]){return _0x8da82['account'][_0xda25('0x96')][_0xda25('0x97')][0x0];}var _0x16c3f5=_[_0xda25('0x9f')](_0xd6762a[_0xda25('0x5b')],{'firstName':_0xd6762a[_0xda25('0x5b')][_0xda25('0x94')],'ListId':_0x5b25c4['ListId']});_0x16c3f5[_0xd6762a[_0xda25('0x5b')][_0xda25('0x90')]]=_0xd6762a[_0xda25('0x5b')][_0xda25('0x94')];return db[_0xda25('0x86')][_0xda25('0x54')](_0x16c3f5,{'fields':_0x4a874f,'raw':!![]});}})['then'](handleEntityNotFound(_0x38b519,null))[_0xda25('0x31')](function(_0x36e98e){_0x8da82[_0xda25('0xa0')]=_0x36e98e;var _0x3dea4e=_0xd6762a[_0xda25('0x5b')]['customerIp'];if(_0xd6762a[_0xda25('0xa1')][_0xda25('0xa2')]){_0x3dea4e=_0xd6762a[_0xda25('0xa1')][_0xda25('0xa2')];}else if(_0xd6762a[_0xda25('0xa1')][_0xda25('0xa3')]){_0x3dea4e=_['first'](_0xd6762a[_0xda25('0xa1')][_0xda25('0xa3')][_0xda25('0xa4')](','));}if(_0x36e98e){var _0x5b77b9={'ContactId':_0x36e98e['id'],'ChatWebsiteId':_0xd6762a[_0xda25('0x5d')]['id'],'from':(_0x36e98e[_0xda25('0xa5')]||'')+'\x20'+(_0x36e98e[_0xda25('0xa6')]||''),'customerIp':_0x3dea4e,'customerPort':_0xd6762a[_0xda25('0xa1')][_0xda25('0xa7')]?_0xd6762a['headers'][_0xda25('0xa7')]:null,'referer':_0xd6762a[_0xda25('0x5b')][_0xda25('0xa8')],'browserName':_0x4ac15f[_0xda25('0xa9')]['name']&&_0x4ac15f[_0xda25('0xa9')][_0xda25('0xaa')]?util['format']('%s\x20%s',_0x4ac15f[_0xda25('0xa9')]['name'],_0x4ac15f[_0xda25('0xa9')][_0xda25('0xaa')]):_0xda25('0xab'),'browserVersion':_0x4ac15f[_0xda25('0xa9')][_0xda25('0xaa')]||'unknown','osName':util[_0xda25('0xac')](_0xda25('0xad'),_0x4ac15f['os'][_0xda25('0x36')],_0x4ac15f['os'][_0xda25('0xaa')]),'osVersion':_0x4ac15f['os'][_0xda25('0xaa')],'deviceModel':_0x4ac15f[_0xda25('0xae')][_0xda25('0x3b')]&&_0x4ac15f[_0xda25('0xae')][_0xda25('0xaf')]?util[_0xda25('0xac')](_0xda25('0xb0'),_0x4ac15f['device'][_0xda25('0x3b')],_0x4ac15f['device'][_0xda25('0xaf')],_0x4ac15f[_0xda25('0xae')]['type']):null,'deviceVendor':_0x4ac15f['device'][_0xda25('0xaf')],'deviceType':_0x4ac15f[_0xda25('0xae')][_0xda25('0x48')],'formData':JSON[_0xda25('0xb1')](_0xd6762a['body'])};var _0x4dc97f={'ChatWebsiteId':_0xd6762a[_0xda25('0x5d')]['id'],'closed':![]};if(_0xd6762a[_0xda25('0x5b')][_0xda25('0xb2')]){_0x4dc97f[_0xda25('0xb2')]=_0xd6762a[_0xda25('0x5b')][_0xda25('0xb2')];return db[_0xda25('0xb3')]['find']({'where':_0x4dc97f})[_0xda25('0x31')](function(_0xb86a86){if(_0xb86a86){return[_0xb86a86,![]];}_0x5b77b9[_0xda25('0xb2')]=_0xd6762a[_0xda25('0x5b')][_0xda25('0xb2')];_0x5b77b9[_0xda25('0xb4')]=_0xd6762a[_0xda25('0x5b')]['externalUrl'];return db[_0xda25('0xb3')][_0xda25('0x54')](_0x5b77b9)['then'](function(_0x350a52){return[_0x350a52,!![]];});});}_0x4dc97f[_0xda25('0xb5')]=_0x36e98e['id'];if(_0xd6762a[_0xda25('0x5b')]['interaction']&&_0xd6762a[_0xda25('0x5b')][_0xda25('0xb6')]['id']){_0x4dc97f['id']=_0xd6762a[_0xda25('0x5b')][_0xda25('0xb6')]['id'];return db['ChatInteraction'][_0xda25('0x5c')]({'where':_0x4dc97f})['then'](function(_0x38c69b){if(_0x38c69b){return[_0x38c69b,![]];}return db[_0xda25('0xb3')][_0xda25('0x54')](_0x5b77b9)[_0xda25('0x31')](function(_0x1f6ce9){return[_0x1f6ce9,!![]];});});}return db[_0xda25('0xb3')]['create'](_0x5b77b9)[_0xda25('0x31')](function(_0x4bcf54){return[_0x4bcf54,!![]];});}})[_0xda25('0xb7')](function(_0x473efc,_0x3ab3a7){if(_0x473efc){_0x39568b=_0x3ab3a7;if(!_0x3ab3a7){var _0x43a660={'from':(_0x8da82[_0xda25('0xa0')][_0xda25('0xa5')]||'')+'\x20'+(_0x8da82[_0xda25('0xa0')][_0xda25('0xa6')]||'')};if(_0xd6762a[_0xda25('0x5b')][_0xda25('0xb2')]&&_0xd6762a[_0xda25('0x5b')]['messageId']&&_0xd6762a[_0xda25('0x5b')]['threadId']!=_0xd6762a[_0xda25('0x5b')][_0xda25('0xb8')]){_0x43a660[_0xda25('0xb2')]=_0xd6762a[_0xda25('0x5b')][_0xda25('0xb8')];}return _0x473efc[_0xda25('0x5a')](_0x43a660);}else{return _0x473efc;}}})[_0xda25('0x31')](function(_0x3936be){_0x8da82[_0xda25('0xb6')]=_0x3936be[_0xda25('0x32')]({'plain':!![]});_0x8da82['interaction']['created']=_0x39568b;if(_0x8da82['interaction'][_0xda25('0xb9')]){if(_0x8da82[_0xda25('0x9b')]['autoclose']){_0x8da82[_0xda25('0x9c')][_0xda25('0xba')]({'id':0x0,'priority':_0x8da82[_0xda25('0x9c')][_0xda25('0x52')]+0x1,'app':_0xda25('0xbb'),'appdata':_0xda25('0xbc'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0xda25('0x54')]({'body':_0xd6762a[_0xda25('0x5b')][_0xda25('0x5b')],'ChatWebsiteId':_0xd6762a[_0xda25('0x5d')]['id'],'ChatInteractionId':_0x3936be['id'],'direction':'in','ContactId':_0x8da82[_0xda25('0xa0')]['id'],'AttachmentId':_0xd6762a[_0xda25('0x5b')][_0xda25('0xbd')]});})[_0xda25('0x31')](function(_0x18cf97){_0x8da82[_0xda25('0x23')]=_0x18cf97;if(_0x8da82[_0xda25('0xb6')]['UserId']){return db[_0xda25('0xbe')][_0xda25('0x5c')]({'attributes':['id',_0xda25('0x36')],'where':{'id':_0x8da82[_0xda25('0xb6')][_0xda25('0xbf')]}})['then'](function(_0x3ebd50){if(_0x3ebd50){_0x8da82[_0xda25('0x9c')][_0xda25('0xc0')]({'id':0x0,'priority':0x0,'app':_0xda25('0xc1'),'appdata':_0x3ebd50[_0xda25('0x36')]+','+(_0x8da82[_0xda25('0x9b')][_0xda25('0xc2')]||0xa),'interval':_0xda25('0xc3')});_0x8da82[_0xda25('0xc4')]=!![];}return respondWithRpcPromise(_0xda25('0xc5'),_0xda25('0xc6'),_0x8da82);});}return respondWithRpcPromise(_0xda25('0xc5'),'startRouting',_0x8da82);})['then'](function(_0x34a8c1){respondWithRpcPromise(_0xda25('0xc7'),_0xda25('0xc7'),{'event':_0xda25('0xc8'),'message':_0x34a8c1},client9002);return _0x34a8c1;})[_0xda25('0x31')](respondWithResult(_0x38b519,null))[_0xda25('0x25')](handleError(_0x38b519,null));};exports[_0xda25('0xc9')]=function(_0x2aed1c,_0x2c6953,_0x4cffe5){var _0x3d1de2,_0x3c5cac,_0xf6bc14;var _0x2e701d=[];var _0x40808d=[];var _0x4f5ade={};return db['CmContact']['describe']()[_0xda25('0x31')](function(_0x4fc4e1){if(!_0x4fc4e1){throw new db[(_0xda25('0x87'))][(_0xda25('0x8d'))](_0xda25('0x88'));}_0x40808d=_[_0xda25('0x89')](_[_0xda25('0x3c')](_0x4fc4e1),[_0xda25('0x8b'),_0xda25('0x8a')]);_0x2e701d=_[_0xda25('0x89')](_[_0xda25('0x3c')](_0x4fc4e1),['createdAt',_0xda25('0x8a'),_0xda25('0xca'),_0xda25('0x8c')]);if(_0x2aed1c['body']['id']){delete _0x2aed1c[_0xda25('0x5b')]['id'];}if(_['isNil'](_0x2aed1c[_0xda25('0x5b')][_0xda25('0x94')])){throw _0x2c6953['status'](0x1f4)['send'](new db[(_0xda25('0x87'))]['ValidationError'](_0xda25('0x8e')));}if(_[_0xda25('0x78')](_0x2aed1c['body'][_0xda25('0x5b')])||_0x2aed1c[_0xda25('0x5b')][_0xda25('0x5b')]===''){throw _0x2c6953['status'](0x1f4)[_0xda25('0xcb')](new db[(_0xda25('0x87'))][(_0xda25('0x8d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xda25('0x78')](_0x2aed1c[_0xda25('0x5b')][_0xda25('0xcc')])){throw _0x2c6953['status'](0x1f4)['send'](new db[(_0xda25('0x87'))][(_0xda25('0x8d'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2e701d));}if(!_[_0xda25('0x92')](_0x2e701d,_0x2aed1c[_0xda25('0x5b')][_0xda25('0xcc')])){throw _0x2c6953[_0xda25('0x27')](0x1f4)[_0xda25('0xcb')](new db[(_0xda25('0x87'))][(_0xda25('0x8d'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2e701d));}_0x4f5ade[_0x2aed1c[_0xda25('0x5b')][_0xda25('0xcc')]]=_0x2aed1c[_0xda25('0x5b')]['from'];})[_0xda25('0x31')](function(){return db[_0xda25('0x3a')][_0xda25('0x5c')]({'where':{'id':_0x2aed1c[_0xda25('0x5d')]['id']},'include':[{'model':db[_0xda25('0x95')],'as':'List'}]});})[_0xda25('0x31')](handleEntityNotFound(_0x2c6953,null))[_0xda25('0x31')](function(_0x1af20a){if(_0x1af20a&&_0x1af20a[_0xda25('0x96')]){_0x3c5cac=_0x1af20a;var _0xd950a9=_[_0xda25('0x9f')](_0x2aed1c[_0xda25('0x5b')],{'firstName':_0x2aed1c[_0xda25('0x5b')][_0xda25('0x94')],'phone':_0x2aed1c[_0xda25('0x5b')][_0xda25('0x94')],'ListId':_0x1af20a['ListId']});_0xd950a9[_0x2aed1c['body']['mapKeyOffline']]=_0x2aed1c[_0xda25('0x5b')][_0xda25('0x94')];return db[_0xda25('0x86')]['findOrCreate']({'where':_0x4f5ade,'defaults':_0xd950a9});}})[_0xda25('0xb7')](function(_0x1b88b5){if(_0x1b88b5){_0xf6bc14=_0x1b88b5;var _0xca1f3e=fs['readFileSync'](path[_0xda25('0x7a')](config['root'],_0xda25('0xcd')),_0xda25('0xce'));var _0x586094=ejs[_0xda25('0xcf')](_0xca1f3e,{'body':_[_0xda25('0xd0')](_0x2aed1c[_0xda25('0x5b')][_0xda25('0x5b')]),'bodyTitle':_0x3c5cac[_0xda25('0xd1')]});return db[_0xda25('0xd2')]['create']({'body':_0x586094,'ContactId':_0x1b88b5['id'],'ChatWebsiteId':_0x3c5cac['id']});}})[_0xda25('0x31')](function(_0x1f8ea5){if(_0x1f8ea5){_0x3d1de2=_0x1f8ea5;return db[_0xda25('0xd3')][_0xda25('0x68')]({'where':{'service':!![]},'include':[{'model':db[_0xda25('0xd4')],'as':'Smtp','raw':!![]}]});}})[_0xda25('0x31')](function(_0x4bfd25){if(_0x4bfd25&&_0x4bfd25[_0xda25('0xd5')]&&_0x3c5cac[_0xda25('0xd6')]){var _0x426250={'tls':{'rejectUnauthorized':![]}};if(_0x4bfd25[_0xda25('0xd5')][_0xda25('0xd7')]){_0x426250[_0xda25('0xd7')]=_0x4bfd25[_0xda25('0xd5')][_0xda25('0xd7')];}else{_0x426250['host']=_0x4bfd25['Smtp']['host'];_0x426250[_0xda25('0xd8')]=_0x4bfd25[_0xda25('0xd5')]['port'];_0x426250['secure']=_0x4bfd25['Smtp'][_0xda25('0xd9')];}if(_0x4bfd25[_0xda25('0xd5')][_0xda25('0xda')]){_0x426250[_0xda25('0xdb')]={'user':_0x4bfd25[_0xda25('0xd5')][_0xda25('0x57')],'pass':_0x4bfd25[_0xda25('0xd5')][_0xda25('0xdc')]};}return respondWithRpcPromise(_0xda25('0xdd'),_0xda25('0xde'),{'account':_0x426250,'message':{'from':util[_0xda25('0xac')](_0xda25('0xdf'),_0x4bfd25[_0xda25('0x36')],_0x4bfd25[_0xda25('0xe0')]||_0x4bfd25[_0xda25('0xd5')][_0xda25('0x57')]),'to':_0x3c5cac['forwardOfflineAddress'],'subject':_0x3c5cac[_0xda25('0xe1')],'text':_0x3d1de2['body']}},client9003)['then'](function(){return _0x3d1de2;})[_0xda25('0x25')](function(_0x194307){console[_0xda25('0x21')](_0x194307);});}})[_0xda25('0x31')](function(){if(_0x3d1de2){return _0x3d1de2;}})[_0xda25('0x31')](respondWithResult(_0x2c6953,null))[_0xda25('0x25')](handleError(_0x2c6953,null));};exports['addInteraction']=function(_0x47d68a,_0x44a037,_0x437bf7){return db['ChatInteraction']['find']({'where':{'id':_0x47d68a[_0xda25('0x5d')]['id']}})[_0xda25('0x31')](handleEntityNotFound(_0x44a037,null))['then'](function(_0x1dfd57){if(_0x1dfd57){return _0x1dfd57[_0xda25('0xe2')](_0x47d68a[_0xda25('0x5b')][_0xda25('0x66')],_['omit'](_0x47d68a[_0xda25('0x5b')],[_0xda25('0x66'),'id'])||{});}})['then'](respondWithResult(_0x44a037,null))['catch'](handleError(_0x44a037,null));};exports[_0xda25('0xe3')]=function(_0x557b83,_0x198ba2,_0x23a1e8){var _0x349857={'raw':![],'where':{}};var _0x57e8f6={};var _0x5a9a71={'count':0x0,'rows':[]};return db[_0xda25('0x3a')][_0xda25('0x68')]({'where':{'id':_0x557b83[_0xda25('0x5d')]['id']}})['then'](handleEntityNotFound(_0x198ba2,null))['then'](function(_0x56bfae){if(_0x56bfae){_0x57e8f6['model']=_[_0xda25('0x3c')](db['ChatInteraction']['rawAttributes']);_0x57e8f6['query']=_[_0xda25('0x3c')](_0x557b83[_0xda25('0x3f')]);_0x57e8f6[_0xda25('0x3d')]=_[_0xda25('0x3e')](_0x57e8f6['model'],_0x57e8f6[_0xda25('0x3f')]);_0x349857[_0xda25('0x41')]=_[_0xda25('0x3e')](_0x57e8f6['model'],qs[_0xda25('0x40')](_0x557b83[_0xda25('0x3f')][_0xda25('0x40')]));_0x349857[_0xda25('0x41')]=_0x349857['attributes']['length']?_0x349857['attributes']:_0x57e8f6[_0xda25('0x3b')];if(!_0x557b83['query'][_0xda25('0x42')](_0xda25('0x62'))){_0x349857[_0xda25('0x2c')]=qs['limit'](_0x557b83[_0xda25('0x3f')][_0xda25('0x2c')]);_0x349857[_0xda25('0x2b')]=qs['offset'](_0x557b83[_0xda25('0x3f')][_0xda25('0x2b')]);}_0x349857[_0xda25('0x43')]=qs[_0xda25('0x44')](_0x557b83['query'][_0xda25('0x44')]);_0x349857[_0xda25('0x46')]=qs[_0xda25('0x3d')](_[_0xda25('0x63')](_0x557b83['query'],_0x57e8f6[_0xda25('0x3d')]));_0x349857['where']['ChatWebsiteId']=_0x56bfae['id'];if(_0x557b83[_0xda25('0x3f')][_0xda25('0x45')]){_0x349857[_0xda25('0x46')]=_[_0xda25('0x4b')](_0x349857['where'],{'$or':_[_0xda25('0x47')](_0x349857[_0xda25('0x41')],function(_0x5a4292){var _0x2e11c8={};_0x2e11c8[_0x5a4292]={'$like':'%'+_0x557b83[_0xda25('0x3f')]['filter']+'%'};return _0x2e11c8;})});}_0x349857=_['merge']({},_0x349857,_0x557b83[_0xda25('0x4c')]);return db[_0xda25('0xb3')]['count']({'where':_0x349857[_0xda25('0x46')]})[_0xda25('0x31')](function(_0x153c69){_0x5a9a71[_0xda25('0x2a')]=_0x153c69;if(_0x557b83[_0xda25('0x3f')][_0xda25('0x4d')]){_0x349857[_0xda25('0x53')]=[{'model':db[_0xda25('0x86')],'as':_0xda25('0xe4'),'required':![]},{'model':db[_0xda25('0xbe')],'as':'Owner','attributes':[_0xda25('0x36'),_0xda25('0xe5'),_0xda25('0xe6')],'required':![]},{'model':db[_0xda25('0xe7')],'as':_0xda25('0xe8'),'attributes':['id',_0xda25('0x36'),'color'],'where':_0x557b83['query'][_0xda25('0xe9')]?{'id':_0x557b83['query'][_0xda25('0xe9')]}:undefined,'required':_0x557b83[_0xda25('0x3f')][_0xda25('0xe9')]?!![]:![]}];}return db[_0xda25('0xb3')]['findAll'](_0x349857);})[_0xda25('0x31')](function(_0x465d85){_0x5a9a71[_0xda25('0x4f')]=_0x465d85;return _0x5a9a71;});}})[_0xda25('0x31')](respondWithFilteredResult(_0x198ba2,_0x349857))[_0xda25('0x25')](handleError(_0x198ba2,null));};function iftimePromise(_0x143388,_0x12b192){return respondWithRpcPromise(_0xda25('0xea'),_0xda25('0xeb'),{'command':_0x12b192[_0xda25('0xec')]?util[_0xda25('0xac')](_0xda25('0xed'),_0x143388[_0xda25('0xee')],_0x12b192[_0xda25('0xec')]):util[_0xda25('0xac')]('iftime\x20%s',_0x143388[_0xda25('0xee')])},client9002)[_0xda25('0x31')](function(_0x3e72d8){var _0x4dec08=_0x3e72d8&&_0x3e72d8[_0xda25('0xef')](_0xda25('0xf0'))>=0x0?!![]:![];logger[_0xda25('0xf1')](_0xda25('0xf2'),_0x12b192['id'],_0x143388['id'],_0x143388[_0xda25('0xee')],_0x4dec08?_0xda25('0xf3'):_0xda25('0xf4'),_0x12b192[_0xda25('0xec')]?_0x12b192[_0xda25('0xec')]:'No\x20timezone');return _0x4dec08;})[_0xda25('0x25')](function(_0x498d04){logger[_0xda25('0x21')](_0xda25('0xf2'),_0x12b192['id'],_0x143388['id'],_0x143388[_0xda25('0xee')],util[_0xda25('0xf5')](_0x498d04,{'showHidden':![],'depth':null}),_0x12b192[_0xda25('0xec')]?_0x12b192[_0xda25('0xec')]:'No\x20timezone');return![];});}exports[_0xda25('0xeb')]=function(_0x612910,_0x3836ec,_0x54e559){var _0x5a16eb=0x0;var _0x228ee7=0x0;var _0x4f13b7=![];var _0x3bf362;var _0x14fdac;return db[_0xda25('0x3a')][_0xda25('0x5c')]({'where':{'id':_0x612910[_0xda25('0x5d')]['id']},'include':[{'model':db[_0xda25('0xf6')],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0xda25('0x31')](handleEntityNotFound(_0x3836ec,null))[_0xda25('0x31')](function(_0xb40bc9){if(_0xb40bc9){_0x3bf362=_0xb40bc9;return _0xb40bc9[_0xda25('0xf7')]({'raw':!![]});}})[_0xda25('0x31')](function(_0x16f0bd){if(_0x3bf362){if(_0x16f0bd){_0x14fdac=_0x16f0bd;}}return require('../../config/license/util')[_0xda25('0xf8')]();})[_0xda25('0x31')](function(_0x3dce16){if(_0x3dce16){_0x228ee7=_0x3dce16['virtual'];_0x4f13b7=_0x3dce16[_0xda25('0x77')];}})[_0xda25('0x31')](function(){return db['ChatInteraction'][_0xda25('0x2a')]({'where':{'closed':![]}});})[_0xda25('0x31')](function(_0x29e2e5){_0x5a16eb=_0x29e2e5;if(_0x228ee7&&_0x29e2e5>_0x228ee7){return db[_0xda25('0xf9')]['findOne']({'where':{'id':0x1}})['then'](function(_0x48dc99){if(_0x48dc99){_0x48dc99['increment'](_0xda25('0xfa'));}});}})[_0xda25('0x31')](function(){if(_0x3bf362[_0xda25('0xf6')]&&_0x3bf362['Interval'][_0xda25('0xfb')]){var _0x5d4104=[];for(var _0x13be7f=0x0;_0x13be7f<_0x3bf362[_0xda25('0xf6')][_0xda25('0xfb')][_0xda25('0x52')];_0x13be7f++){var _0x575e8b=_0x3bf362[_0xda25('0xf6')]['Intervals'][_0x13be7f][_0xda25('0x32')]({'plain':!![]});_0x5d4104['push'](iftimePromise(_0x575e8b,_0x3bf362));}return BPromise['all'](_0x5d4104)['then'](function(_0x233caf){return _['some'](_0x233caf);});}else{return!![];}})['then'](function(_0x198e1a){var _0x4cd7ed=fs[_0xda25('0xfc')](path[_0xda25('0x7a')](config['root'],_0xda25('0xfd')),_0xda25('0xce'));var _0x109a46={'remote':_0x3bf362[_0xda25('0xfe')],'query':querystring['stringify'](_[_0xda25('0x4b')](_0x3bf362[_0xda25('0x32')]({'plain':!![]}),{'customerIp':_0x612910[_0xda25('0xa1')][_0xda25('0xa3')]||_0x612910['headers'][_0xda25('0xff')]||_0x612910[_0xda25('0x100')][_0xda25('0x101')]||_0x612910['ip'],'referer':_0x612910[_0xda25('0xa1')]['referer'],'openedInteractions':_0x5a16eb,'maxInteractions':_0x228ee7,'virtual':_0x4f13b7[_0xda25('0x102')],'online':_0x198e1a,'custom':_0x4f13b7}))[_0xda25('0x103')](/'/g,'\x5c\x27')};_0x3836ec[_0xda25('0xcb')](ejs[_0xda25('0xcf')](Mustache['render'](_0x4cd7ed,_0x109a46),{'proactiveActions':_0x14fdac,'alignment':_0x3bf362[_0xda25('0x104')],'verticalAlignment':_0x3bf362[_0xda25('0x105')]}));})[_0xda25('0x25')](handleError(_0x3836ec,null));};exports[_0xda25('0x106')]=function(_0x3231c9,_0x24d13b,_0x44c013){return db['ChatWebsite']['findOne']({'where':{'id':_0x3231c9[_0xda25('0x5d')]['id']}})['then'](handleEntityNotFound(_0x24d13b,null))[_0xda25('0x31')](function(_0x334f12){if(_0x334f12){return db[_0xda25('0x107')]['transaction'](function(_0x29dca1){return db[_0xda25('0x99')][_0xda25('0x30')]({'where':{'ChatWebsiteId':_0x3231c9[_0xda25('0x5d')]['id']},'transaction':_0x29dca1})[_0xda25('0x31')](function(_0xb018b8){var _0x25c073=_[_0xda25('0x47')](_0x3231c9[_0xda25('0x5b')],function(_0x1b78d3){_0x1b78d3[_0xda25('0x64')]=_0x3231c9['params']['id'];return _0x1b78d3;});return db[_0xda25('0x99')][_0xda25('0x108')](_0x25c073,{'transaction':_0x29dca1});});})[_0xda25('0x31')](function(){return db[_0xda25('0x99')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x3231c9[_0xda25('0x5d')]['id']},'order':_0xda25('0x9e')});});}})['then'](respondWithResult(_0x24d13b,null))[_0xda25('0x25')](handleError(_0x24d13b,null));};exports[_0xda25('0x109')]=function(_0x551649,_0x1b608f,_0x35fb5e){var _0x5205f4={};var _0x1a8ae4={};var _0x3a9421;var _0x19eaa7;return db[_0xda25('0x3a')][_0xda25('0x68')]({'where':{'id':_0x551649['params']['id']}})[_0xda25('0x31')](handleEntityNotFound(_0x1b608f,null))[_0xda25('0x31')](function(_0x1cc370){if(_0x1cc370){_0x3a9421=_0x1cc370;_0x1a8ae4[_0xda25('0x3b')]=_[_0xda25('0x3c')](db[_0xda25('0x99')]['rawAttributes']);_0x1a8ae4[_0xda25('0x3f')]=_[_0xda25('0x3c')](_0x551649['query']);_0x1a8ae4['filters']=_[_0xda25('0x3e')](_0x1a8ae4['model'],_0x1a8ae4['query']);_0x5205f4['attributes']=_['intersection'](_0x1a8ae4[_0xda25('0x3b')],qs[_0xda25('0x40')](_0x551649[_0xda25('0x3f')]['fields']));_0x5205f4['attributes']=_0x5205f4[_0xda25('0x41')]['length']?_0x5205f4[_0xda25('0x41')]:_0x1a8ae4[_0xda25('0x3b')];_0x5205f4[_0xda25('0x43')]=qs[_0xda25('0x44')](_0x551649[_0xda25('0x3f')][_0xda25('0x44')]);_0x5205f4[_0xda25('0x46')]=qs[_0xda25('0x3d')](_[_0xda25('0x63')](_0x551649['query'],_0x1a8ae4[_0xda25('0x3d')]));if(_0x551649['query']['filter']){_0x5205f4['where']=_[_0xda25('0x4b')](_0x5205f4[_0xda25('0x46')],{'$or':_[_0xda25('0x47')](_0x5205f4['attributes'],function(_0xcabce1){var _0x36b5bb={};_0x36b5bb[_0xcabce1]={'$like':'%'+_0x551649['query']['filter']+'%'};return _0x36b5bb;})});}_0x5205f4=_[_0xda25('0x4b')]({},_0x5205f4,_0x551649['options']);return _0x3a9421[_0xda25('0x109')](_0x5205f4);}})[_0xda25('0x31')](function(_0x2c3e16){if(_0x2c3e16){_0x19eaa7=_0x2c3e16['length'];if(!_0x551649[_0xda25('0x3f')][_0xda25('0x42')](_0xda25('0x62'))){_0x5205f4[_0xda25('0x2c')]=qs[_0xda25('0x2c')](_0x551649[_0xda25('0x3f')][_0xda25('0x2c')]);_0x5205f4[_0xda25('0x2b')]=qs[_0xda25('0x2b')](_0x551649['query'][_0xda25('0x2b')]);}return _0x3a9421[_0xda25('0x109')](_0x5205f4);}})[_0xda25('0x31')](function(_0x1535d6){if(_0x1535d6){return _0x1535d6?{'count':_0x19eaa7,'rows':_0x1535d6}:null;}})['then'](respondWithResult(_0x1b608f,null))['catch'](handleError(_0x1b608f,null));};exports[_0xda25('0x10a')]=function(_0x3a423c,_0x5b0d8d,_0x54e505){return db['chatProactiveAction']['find']({'where':{'id':_0x3a423c['params']['id']}})['then'](handleEntityNotFound(_0x5b0d8d,null))[_0xda25('0x31')](function(_0x1d6997){if(_0x1d6997){return _0x1d6997['addProactiveActions'](_0x3a423c['body'][_0xda25('0x66')],_[_0xda25('0x10b')](_0x3a423c[_0xda25('0x5b')],[_0xda25('0x66'),'id'])||{});}})[_0xda25('0x31')](respondWithResult(_0x5b0d8d,null))[_0xda25('0x25')](handleError(_0x5b0d8d,null));};exports[_0xda25('0xf7')]=function(_0x5d6ec0,_0x33dd91,_0xe5153e){var _0x17f1f3={};var _0x31137f={};var _0x874342;var _0x4c8445;return db[_0xda25('0x3a')][_0xda25('0x68')]({'where':{'id':_0x5d6ec0[_0xda25('0x5d')]['id']}})[_0xda25('0x31')](handleEntityNotFound(_0x33dd91,null))[_0xda25('0x31')](function(_0x4a3ccb){if(_0x4a3ccb){_0x874342=_0x4a3ccb;_0x31137f[_0xda25('0x3b')]=_[_0xda25('0x3c')](db[_0xda25('0x10c')][_0xda25('0x51')]);_0x31137f['query']=_[_0xda25('0x3c')](_0x5d6ec0[_0xda25('0x3f')]);_0x31137f[_0xda25('0x3d')]=_[_0xda25('0x3e')](_0x31137f[_0xda25('0x3b')],_0x31137f[_0xda25('0x3f')]);_0x17f1f3[_0xda25('0x41')]=_[_0xda25('0x3e')](_0x31137f[_0xda25('0x3b')],qs[_0xda25('0x40')](_0x5d6ec0[_0xda25('0x3f')][_0xda25('0x40')]));_0x17f1f3[_0xda25('0x41')]=_0x17f1f3[_0xda25('0x41')]['length']?_0x17f1f3[_0xda25('0x41')]:_0x31137f[_0xda25('0x3b')];_0x17f1f3[_0xda25('0x43')]=qs[_0xda25('0x44')](_0x5d6ec0[_0xda25('0x3f')][_0xda25('0x44')]);_0x17f1f3[_0xda25('0x46')]=qs[_0xda25('0x3d')](_[_0xda25('0x63')](_0x5d6ec0['query'],_0x31137f[_0xda25('0x3d')]));if(_0x5d6ec0[_0xda25('0x3f')][_0xda25('0x45')]){_0x17f1f3[_0xda25('0x46')]=_[_0xda25('0x4b')](_0x17f1f3['where'],{'$or':_['map'](_0x17f1f3[_0xda25('0x41')],function(_0x42b79c){var _0x48000a={};_0x48000a[_0x42b79c]={'$like':'%'+_0x5d6ec0[_0xda25('0x3f')][_0xda25('0x45')]+'%'};return _0x48000a;})});}_0x17f1f3=_[_0xda25('0x4b')]({},_0x17f1f3,_0x5d6ec0[_0xda25('0x4c')]);return _0x874342[_0xda25('0xf7')](_0x17f1f3);}})['then'](function(_0xf874e9){if(_0xf874e9){_0x4c8445=_0xf874e9[_0xda25('0x52')];if(!_0x5d6ec0[_0xda25('0x3f')][_0xda25('0x42')](_0xda25('0x62'))){_0x17f1f3[_0xda25('0x2c')]=qs[_0xda25('0x2c')](_0x5d6ec0[_0xda25('0x3f')][_0xda25('0x2c')]);_0x17f1f3[_0xda25('0x2b')]=qs[_0xda25('0x2b')](_0x5d6ec0[_0xda25('0x3f')]['offset']);}return _0x874342[_0xda25('0xf7')](_0x17f1f3);}})[_0xda25('0x31')](function(_0x5d4645){if(_0x5d4645){return _0x5d4645?{'count':_0x4c8445,'rows':_0x5d4645}:null;}})[_0xda25('0x31')](respondWithResult(_0x33dd91,null))[_0xda25('0x25')](handleError(_0x33dd91,null));};exports[_0xda25('0x10d')]=function(_0x4b2152,_0x4c27f9,_0x2b9b25){var _0x640a5d=_0x4b2152[_0xda25('0x3f')][_0xda25('0x10e')]===_0xda25('0x10f')?_0xda25('0x110'):'onlineForm';return db['ChatWebsite'][_0xda25('0x5c')]({'attributes':['id',_0x640a5d],'where':{'id':_0x4b2152['params']['id']}})[_0xda25('0x31')](handleEntityNotFound(_0x4c27f9,null))[_0xda25('0x31')](function(_0xd7951){if(_0xd7951){var _0x87398a=_0xd7951[_0x640a5d];var _0x519221=_0x87398a&&_0x87398a[_0xda25('0x111')]?_0x87398a[_0xda25('0x111')]:[];_0x4c27f9['send']({'fromKey':_[_0xda25('0x78')](_0x87398a['fromKey'])?undefined:_0x87398a[_0xda25('0x112')],'count':_0x519221[_0xda25('0x52')],'rows':_0x519221});}})[_0xda25('0x25')](handleError(_0x4c27f9,null));};exports['getOfflineMessages']=function(_0xc012f6,_0x5e163c,_0x5e5fe6){var _0xaa5698={'raw':!![],'where':{}};var _0x4a5300={};var _0x90235e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xda25('0x68')]({'where':{'id':_0xc012f6['params']['id']}})[_0xda25('0x31')](handleEntityNotFound(_0x5e163c,null))['then'](function(_0x534a2a){if(_0x534a2a){_0x4a5300[_0xda25('0x3b')]=_[_0xda25('0x3c')](db['ChatOfflineMessage'][_0xda25('0x51')]);_0x4a5300[_0xda25('0x3f')]=_[_0xda25('0x3c')](_0xc012f6[_0xda25('0x3f')]);_0x4a5300[_0xda25('0x3d')]=_[_0xda25('0x3e')](_0x4a5300[_0xda25('0x3b')],_0x4a5300['query']);_0xaa5698[_0xda25('0x41')]=_['intersection'](_0x4a5300['model'],qs[_0xda25('0x40')](_0xc012f6[_0xda25('0x3f')][_0xda25('0x40')]));_0xaa5698['attributes']=_0xaa5698['attributes'][_0xda25('0x52')]?_0xaa5698[_0xda25('0x41')]:_0x4a5300[_0xda25('0x3b')];if(!_0xc012f6['query']['hasOwnProperty']('nolimit')){_0xaa5698['limit']=qs[_0xda25('0x2c')](_0xc012f6[_0xda25('0x3f')][_0xda25('0x2c')]);_0xaa5698[_0xda25('0x2b')]=qs[_0xda25('0x2b')](_0xc012f6[_0xda25('0x3f')][_0xda25('0x2b')]);}_0xaa5698['order']=qs[_0xda25('0x44')](_0xc012f6[_0xda25('0x3f')][_0xda25('0x44')]);_0xaa5698[_0xda25('0x46')]=qs[_0xda25('0x3d')](_[_0xda25('0x63')](_0xc012f6[_0xda25('0x3f')],_0x4a5300[_0xda25('0x3d')]));_0xaa5698[_0xda25('0x46')][_0xda25('0x64')]=_0x534a2a['id'];if(_0xc012f6['query'][_0xda25('0x45')]){_0xaa5698['where']=_[_0xda25('0x4b')](_0xaa5698['where'],{'$or':_['map'](_0xaa5698[_0xda25('0x41')],function(_0x5abfe3){var _0x3ffc7c={};_0x3ffc7c[_0x5abfe3]={'$like':'%'+_0xc012f6[_0xda25('0x3f')][_0xda25('0x45')]+'%'};return _0x3ffc7c;})});}_0xaa5698=_[_0xda25('0x4b')]({},_0xaa5698,_0xc012f6[_0xda25('0x4c')]);return db[_0xda25('0xd2')][_0xda25('0x2a')]({'where':_0xaa5698[_0xda25('0x46')]})['then'](function(_0x3adecc){_0x90235e[_0xda25('0x2a')]=_0x3adecc;if(_0xc012f6[_0xda25('0x3f')][_0xda25('0x4d')]){_0xaa5698[_0xda25('0x53')]=[{'all':!![]}];}return db[_0xda25('0xd2')]['findAll'](_0xaa5698);})['then'](function(_0x13fc7a){_0x90235e[_0xda25('0x4f')]=_0x13fc7a;return _0x90235e;});}})[_0xda25('0x31')](respondWithFilteredResult(_0x5e163c,_0xaa5698))[_0xda25('0x25')](handleError(_0x5e163c,null));};exports[_0xda25('0x113')]=function(_0xf5d02b,_0x15d36f,_0x21336d){return db[_0xda25('0x3a')][_0xda25('0x5c')]({'where':{'id':_0xf5d02b['params']['id']}})['then'](handleEntityNotFound(_0x15d36f,null))[_0xda25('0x31')](function(_0x5ea341){if(_0x5ea341){return _0x5ea341[_0xda25('0x113')](_0xf5d02b['body'][_0xda25('0x66')],_['omit'](_0xf5d02b[_0xda25('0x5b')],[_0xda25('0x66'),'id'])||{})[_0xda25('0xb7')](function(_0x31d110){for(var _0x3b3c53=0x0;_0x3b3c53<_0xf5d02b[_0xda25('0x5b')][_0xda25('0x66')][_0xda25('0x52')];_0x3b3c53+=0x1){socket['emit'](_0xda25('0x114'),{'UserId':_0xf5d02b['body'][_0xda25('0x66')][_0x3b3c53],'ChatWebsiteId':_0xf5d02b[_0xda25('0x5d')]['id']});}return _0x31d110;});}})['then'](respondWithResult(_0x15d36f,null))[_0xda25('0x25')](handleError(_0x15d36f,null));};exports['removeAgents']=function(_0x443348,_0x338040,_0x15e926){return db[_0xda25('0x3a')][_0xda25('0x5c')]({'where':{'id':_0x443348[_0xda25('0x5d')]['id']}})['then'](handleEntityNotFound(_0x338040,null))[_0xda25('0x31')](function(_0x147d3f){if(_0x147d3f){return _0x147d3f['removeAgents'](_0x443348[_0xda25('0x3f')]['ids'])[_0xda25('0x31')](function(){if(_['isArray'](_0x443348[_0xda25('0x3f')][_0xda25('0x66')])){for(var _0x33c5e8=0x0;_0x33c5e8<_0x443348[_0xda25('0x3f')][_0xda25('0x66')][_0xda25('0x52')];_0x33c5e8+=0x1){socket[_0xda25('0x115')](_0xda25('0x116'),{'UserId':Number(_0x443348[_0xda25('0x3f')][_0xda25('0x66')][_0x33c5e8]),'ChatWebsiteId':Number(_0x443348['params']['id'])});}}else{socket[_0xda25('0x115')](_0xda25('0x116'),{'UserId':Number(_0x443348[_0xda25('0x3f')][_0xda25('0x66')]),'ChatWebsiteId':Number(_0x443348[_0xda25('0x5d')]['id'])});}});}})[_0xda25('0x31')](respondWithStatusCode(_0x338040,null))[_0xda25('0x25')](handleError(_0x338040,null));};exports[_0xda25('0x117')]=function(_0xb08780,_0x37dd81,_0x2adbef){var _0x222d27={};var _0x57d7cb={};var _0x50bb58;var _0x3ab5f8;return db[_0xda25('0x3a')][_0xda25('0x68')]({'where':{'id':_0xb08780['params']['id']}})[_0xda25('0x31')](handleEntityNotFound(_0x37dd81,null))['then'](function(_0x3e455d){if(_0x3e455d){_0x50bb58=_0x3e455d;_0x57d7cb[_0xda25('0x3b')]=_[_0xda25('0x3c')](db['User']['rawAttributes']);_0x57d7cb[_0xda25('0x3f')]=_[_0xda25('0x3c')](_0xb08780[_0xda25('0x3f')]);_0x57d7cb[_0xda25('0x3d')]=_['intersection'](_0x57d7cb['model'],_0x57d7cb[_0xda25('0x3f')]);_0x222d27[_0xda25('0x41')]=_['intersection'](_0x57d7cb[_0xda25('0x3b')],qs[_0xda25('0x40')](_0xb08780['query'][_0xda25('0x40')]));_0x222d27[_0xda25('0x41')]=_0x222d27['attributes'][_0xda25('0x52')]?_0x222d27[_0xda25('0x41')]:_0x57d7cb['model'];_0x222d27['order']=qs[_0xda25('0x44')](_0xb08780[_0xda25('0x3f')][_0xda25('0x44')]);_0x222d27[_0xda25('0x46')]=qs['filters'](_[_0xda25('0x63')](_0xb08780['query'],_0x57d7cb[_0xda25('0x3d')]));if(_0xb08780['query'][_0xda25('0x45')]){_0x222d27['where']=_['merge'](_0x222d27['where'],{'$or':_[_0xda25('0x47')](_0x222d27[_0xda25('0x41')],function(_0x550622){var _0x23e1fb={};_0x23e1fb[_0x550622]={'$like':'%'+_0xb08780['query']['filter']+'%'};return _0x23e1fb;})});}_0x222d27=_['merge']({},_0x222d27,_0xb08780[_0xda25('0x4c')]);return _0x50bb58[_0xda25('0x117')](_0x222d27);}})[_0xda25('0x31')](function(_0x504724){if(_0x504724){_0x3ab5f8=_0x504724[_0xda25('0x52')];if(!_0xb08780[_0xda25('0x3f')]['hasOwnProperty'](_0xda25('0x62'))){_0x222d27['limit']=qs[_0xda25('0x2c')](_0xb08780[_0xda25('0x3f')]['limit']);_0x222d27[_0xda25('0x2b')]=qs['offset'](_0xb08780[_0xda25('0x3f')][_0xda25('0x2b')]);}return _0x50bb58['getAgents'](_0x222d27);}})[_0xda25('0x31')](function(_0x1e8952){if(_0x1e8952){return _0x1e8952?{'count':_0x3ab5f8,'rows':_0x1e8952}:null;}})[_0xda25('0x31')](respondWithResult(_0x37dd81,null))[_0xda25('0x25')](handleError(_0x37dd81,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 7d36ce2..313a08b 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 _0x3e74=['hasOwnProperty','exports','events','ChatWebsite','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x151983,_0x337ef5){_0x151983=_0x151983-0x0;var _0x2cb1cc=_0x3e74[_0x151983];return _0x2cb1cc;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x43e7('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){ChatWebsiteEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);ChatWebsiteEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0x5004=['../../mysqldb','ChatWebsite','save','update','emit','hook'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0x5004,0x84));var _0x4500=function(_0x219a78,_0xfd00ec){_0x219a78=_0x219a78-0x0;var _0x4530f9=_0x5004[_0x219a78];return _0x4530f9;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x4500('0x0'))['db'][_0x4500('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4500('0x2'),'afterUpdate':_0x4500('0x3'),'afterDestroy':'remove'};function emitEvent(_0x430272){return function(_0x22c2e6,_0x35953d,_0x46ade2){ChatWebsiteEvents[_0x4500('0x4')](_0x430272+':'+_0x22c2e6['id'],_0x22c2e6);ChatWebsiteEvents['emit'](_0x430272,_0x22c2e6);_0x46ade2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x4500('0x5')](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 d140a8c..c41a050 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 _0x44a3=['moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','lodash','util','../../config/logger','api'];(function(_0x22ca53,_0x30e1a9){var _0x80aacf=function(_0x55f0b9){while(--_0x55f0b9){_0x22ca53['push'](_0x22ca53['shift']());}};_0x80aacf(++_0x30e1a9);}(_0x44a3,0x1a9));var _0x344a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x44a3[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0x344a('0x0'));var util=require(_0x344a('0x1'));var logger=require(_0x344a('0x2'))(_0x344a('0x3'));var moment=require(_0x344a('0x4'));var BPromise=require(_0x344a('0x5'));var rp=require(_0x344a('0x6'));var fs=require('fs');var path=require(_0x344a('0x7'));var rimraf=require('rimraf');var config=require(_0x344a('0x8'));var attributes=require(_0x344a('0x9'));module[_0x344a('0xa')]=function(_0x28b51e,_0x39984a){return _0x28b51e['define']('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b02=['define','ChatWebsite','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x35bbdf,_0x47f1fc){var _0x51f74b=function(_0x326f3a){while(--_0x326f3a){_0x35bbdf['push'](_0x35bbdf['shift']());}};_0x51f74b(++_0x47f1fc);}(_0x5b02,0xe9));var _0x25b0=function(_0x500830,_0x29a28d){_0x500830=_0x500830-0x0;var _0x5ba597=_0x5b02[_0x500830];return _0x5ba597;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 106f86a..21a107b 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 _0x7096=['ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatWebsite.socket','register','then','info'];(function(_0x2079dc,_0x46bd20){var _0x2a7e8a=function(_0x286fd9){while(--_0x286fd9){_0x2079dc['push'](_0x2079dc['shift']());}};_0x2a7e8a(++_0x46bd20);}(_0x7096,0x10c));var _0x6709=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x7096[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var moment=require('moment');var BPromise=require(_0x6709('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6709('0x2'));var db=require(_0x6709('0x3'))['db'];var utils=require(_0x6709('0x4'));var logger=require(_0x6709('0x5'))(_0x6709('0x6'));var config=require(_0x6709('0x7'));var jayson=require(_0x6709('0x8'));var client=jayson[_0x6709('0x9')][_0x6709('0xa')]({'port':0x232a});config[_0x6709('0xb')]=_[_0x6709('0xc')](config[_0x6709('0xb')],{'host':_0x6709('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6709('0xe'))[_0x6709('0xf')](socket);function respondWithRpcPromise(_0xbcb47,_0x1aa476,_0x12eea2){return new BPromise(function(_0x426ea1,_0x5de1fa){return client['request'](_0xbcb47,_0x12eea2)[_0x6709('0x10')](function(_0x262261){logger[_0x6709('0x11')](_0x6709('0x12'),_0x1aa476,_0x6709('0x13'));logger[_0x6709('0x14')](_0x6709('0x15'),_0x1aa476,_0x6709('0x13'),JSON['stringify'](_0x262261));if(_0x262261[_0x6709('0x16')]){if(_0x262261[_0x6709('0x16')][_0x6709('0x17')]===0x1f4){logger[_0x6709('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1aa476,_0x262261[_0x6709('0x16')]['message']);return _0x5de1fa(_0x262261[_0x6709('0x16')]['message']);}logger[_0x6709('0x16')](_0x6709('0x12'),_0x1aa476,_0x262261[_0x6709('0x16')][_0x6709('0x18')]);return _0x426ea1(_0x262261['error']['message']);}else{logger['info'](_0x6709('0x12'),_0x1aa476,_0x6709('0x13'));_0x426ea1(_0x262261['result'][_0x6709('0x18')]);}})[_0x6709('0x19')](function(_0xf1a70d){logger['error'](_0x6709('0x12'),_0x1aa476,_0xf1a70d);_0x5de1fa(_0xf1a70d);});});} \ No newline at end of file +var _0xadb5=['code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xadb5,0xad));var _0x5adb=function(_0x4bba7a,_0x4c940d){_0x4bba7a=_0x4bba7a-0x0;var _0x3831fd=_0xadb5[_0x4bba7a];return _0x3831fd;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index e56150f..b63eb2a 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 _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x5d9ceb,_0x1a49f5){var _0x33ce82=function(_0x583915){while(--_0x583915){_0x5d9ceb['push'](_0x5d9ceb['shift']());}};_0x33ce82(++_0x1a49f5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x150aef,_0xb74cf6){_0x150aef=_0x150aef-0x0;var _0x254a5e=_0x5f2f[_0x150aef];return _0x254a5e;};'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 +var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x57b4cc,_0x2ae50e){var _0x45ba9d=function(_0x4ab1b1){while(--_0x4ab1b1){_0x57b4cc['push'](_0x57b4cc['shift']());}};_0x45ba9d(++_0x2ae50e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x9f036c,_0x2e4ba2){_0x9f036c=_0x9f036c-0x0;var _0x5df5a7=_0x5f2f[_0x9f036c];return _0x5df5a7;};'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 e8db9e1..9f07b40 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 _0xcbf4=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','join','server/files/images/logos/','format','now','originalname','/:id/logo','file','diskStorage','server/files/images/avatars/','%s-%s','single','root','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','/:id/offline','addProactiveActions','addAgents','put','destroy','delete','removeDispositions','removeAgents','exports','multer'];(function(_0x5b691e,_0xf58b0e){var _0x35ca00=function(_0x12e72c){while(--_0x12e72c){_0x5b691e['push'](_0x5b691e['shift']());}};_0x35ca00(++_0xf58b0e);}(_0xcbf4,0x7b));var _0x4cbf=function(_0x35a9fd,_0x14aa4c){_0x35a9fd=_0x35a9fd-0x0;var _0x21f132=_0xcbf4[_0x35a9fd];return _0x21f132;};'use strict';var multer=require(_0x4cbf('0x0'));var util=require(_0x4cbf('0x1'));var path=require(_0x4cbf('0x2'));var timeout=require(_0x4cbf('0x3'));var express=require('express');var router=express[_0x4cbf('0x4')]();var auth=require(_0x4cbf('0x5'));var interaction=require(_0x4cbf('0x6'));var config=require(_0x4cbf('0x7'));var controller=require(_0x4cbf('0x8'));router[_0x4cbf('0x9')]('/',auth[_0x4cbf('0xa')](),controller[_0x4cbf('0xb')]);router[_0x4cbf('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x4cbf('0xc'),auth[_0x4cbf('0xa')](),controller[_0x4cbf('0xd')]);router[_0x4cbf('0x9')](_0x4cbf('0xe'),auth['isAuthenticated'](),controller[_0x4cbf('0xf')]);router[_0x4cbf('0x9')](_0x4cbf('0x10'),auth['isAuthenticated'](),controller[_0x4cbf('0x11')]);router[_0x4cbf('0x9')]('/:id/logo',controller[_0x4cbf('0x12')]);router[_0x4cbf('0x9')](_0x4cbf('0x13'),controller[_0x4cbf('0x14')]);router[_0x4cbf('0x9')](_0x4cbf('0x15'),controller['getCustomerAvatar']);router[_0x4cbf('0x9')]('/:id/system_avatar',controller[_0x4cbf('0x16')]);router[_0x4cbf('0x9')]('/:id/interactions',auth[_0x4cbf('0xa')](),controller[_0x4cbf('0x17')]);router['get'](_0x4cbf('0x18'),controller[_0x4cbf('0x19')]);router['get'](_0x4cbf('0x1a'),auth[_0x4cbf('0xa')](),controller[_0x4cbf('0x1b')]);router[_0x4cbf('0x9')]('/:id/proactive_actions',auth[_0x4cbf('0xa')](),controller['getProactiveActions']);router[_0x4cbf('0x9')](_0x4cbf('0x1c'),controller['getFields']);router[_0x4cbf('0x9')](_0x4cbf('0x1d'),auth['isAuthenticated'](),controller[_0x4cbf('0x1e')]);router['get'](_0x4cbf('0x1f'),auth[_0x4cbf('0xa')](),controller[_0x4cbf('0x20')]);router[_0x4cbf('0x21')]('/',auth[_0x4cbf('0xa')](),controller[_0x4cbf('0x22')]);router[_0x4cbf('0x21')](_0x4cbf('0xe'),auth[_0x4cbf('0xa')](),controller[_0x4cbf('0x23')]);router[_0x4cbf('0x21')](_0x4cbf('0x10'),auth[_0x4cbf('0xa')](),controller[_0x4cbf('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x11103f,_0x16dc81,_0x355344){_0x355344(null,path[_0x4cbf('0x25')](config['root'],_0x4cbf('0x26')));},'filename':function(_0x4035c8,_0x5d4346,_0x285741){_0x285741(null,util[_0x4cbf('0x27')]('%s-%s',Date[_0x4cbf('0x28')](),_0x5d4346[_0x4cbf('0x29')]));}})});router[_0x4cbf('0x21')](_0x4cbf('0x2a'),upload['single'](_0x4cbf('0x2b')),controller['addLogo']);var upload=multer({'storage':multer[_0x4cbf('0x2c')]({'destination':function(_0x470175,_0x10640f,_0x329763){_0x329763(null,path['join'](config['root'],_0x4cbf('0x2d')));},'filename':function(_0x2a11d9,_0x2443e8,_0x1da738){_0x1da738(null,util[_0x4cbf('0x27')](_0x4cbf('0x2e'),Date[_0x4cbf('0x28')](),_0x2443e8[_0x4cbf('0x29')]));}})});router['post'](_0x4cbf('0x13'),upload[_0x4cbf('0x2f')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0x4cbf('0x2c')]({'destination':function(_0x3a6309,_0x390bec,_0x192866){_0x192866(null,path['join'](config[_0x4cbf('0x30')],_0x4cbf('0x2d')));},'filename':function(_0x59cad6,_0x34df40,_0x39953a){_0x39953a(null,util[_0x4cbf('0x27')](_0x4cbf('0x2e'),Date[_0x4cbf('0x28')](),_0x34df40[_0x4cbf('0x29')]));}})});router[_0x4cbf('0x21')](_0x4cbf('0x15'),upload[_0x4cbf('0x2f')](_0x4cbf('0x2b')),controller[_0x4cbf('0x31')]);var upload=multer({'storage':multer[_0x4cbf('0x2c')]({'destination':function(_0x33db0f,_0x745872,_0x239310){_0x239310(null,path[_0x4cbf('0x25')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x33de2a,_0x31e47e,_0x1141f2){_0x1141f2(null,util[_0x4cbf('0x27')](_0x4cbf('0x2e'),Date[_0x4cbf('0x28')](),_0x31e47e[_0x4cbf('0x29')]));}})});router[_0x4cbf('0x21')]('/:id/system_avatar',upload[_0x4cbf('0x2f')](_0x4cbf('0x2b')),controller[_0x4cbf('0x32')]);router['post'](_0x4cbf('0x33'),controller[_0x4cbf('0x34')]);router[_0x4cbf('0x21')](_0x4cbf('0x35'),controller['offline']);router[_0x4cbf('0x21')]('/:id/interactions',auth[_0x4cbf('0xa')](),controller['addInteraction']);router[_0x4cbf('0x21')](_0x4cbf('0x1a'),auth['isAuthenticated'](),controller['addApplications']);router[_0x4cbf('0x21')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x4cbf('0x36')]);router[_0x4cbf('0x21')](_0x4cbf('0x1f'),auth[_0x4cbf('0xa')](),controller[_0x4cbf('0x37')]);router[_0x4cbf('0x38')](_0x4cbf('0xc'),auth[_0x4cbf('0xa')](),controller['update']);router['delete']('/:id',auth[_0x4cbf('0xa')](),controller[_0x4cbf('0x39')]);router[_0x4cbf('0x3a')](_0x4cbf('0xe'),auth[_0x4cbf('0xa')](),controller[_0x4cbf('0x3b')]);router[_0x4cbf('0x3a')](_0x4cbf('0x10'),auth[_0x4cbf('0xa')](),controller['removeAnswers']);router[_0x4cbf('0x3a')](_0x4cbf('0x1f'),auth[_0x4cbf('0xa')](),controller[_0x4cbf('0x3c')]);module[_0x4cbf('0x3d')]=router; \ No newline at end of file +var _0x063f=['get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','getAgents','create','post','addAnswer','diskStorage','format','%s-%s','originalname','single','file','addLogo','join','root','server/files/images/avatars/','now','addAvatar','addCustomerAvatar','addSystemAvatar','notify','/:id/applications','addApplications','addProactiveActions','/:id/users','addAgents','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x063f,0x76));var _0xf063=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x063f[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0xf063('0x0'));var util=require(_0xf063('0x1'));var path=require(_0xf063('0x2'));var timeout=require(_0xf063('0x3'));var express=require('express');var router=express[_0xf063('0x4')]();var auth=require(_0xf063('0x5'));var interaction=require(_0xf063('0x6'));var config=require('../../config/environment');var controller=require(_0xf063('0x7'));router[_0xf063('0x8')]('/',auth[_0xf063('0x9')](),controller[_0xf063('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xf063('0xb')]);router['get'](_0xf063('0xc'),auth[_0xf063('0x9')](),controller[_0xf063('0xd')]);router[_0xf063('0x8')](_0xf063('0xe'),auth['isAuthenticated'](),controller[_0xf063('0xf')]);router[_0xf063('0x8')](_0xf063('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xf063('0x8')](_0xf063('0x11'),controller[_0xf063('0x12')]);router['get'](_0xf063('0x13'),controller['getAvatar']);router['get'](_0xf063('0x14'),controller[_0xf063('0x15')]);router['get'](_0xf063('0x16'),controller[_0xf063('0x17')]);router[_0xf063('0x8')](_0xf063('0x18'),auth[_0xf063('0x9')](),controller['getInteractions']);router[_0xf063('0x8')](_0xf063('0x19'),controller[_0xf063('0x1a')]);router[_0xf063('0x8')]('/:id/applications',auth[_0xf063('0x9')](),controller['getApplications']);router[_0xf063('0x8')](_0xf063('0x1b'),auth[_0xf063('0x9')](),controller[_0xf063('0x1c')]);router['get'](_0xf063('0x1d'),controller['getFields']);router[_0xf063('0x8')](_0xf063('0x1e'),auth['isAuthenticated'](),controller[_0xf063('0x1f')]);router['get']('/:id/users',auth[_0xf063('0x9')](),controller[_0xf063('0x20')]);router['post']('/',auth[_0xf063('0x9')](),controller[_0xf063('0x21')]);router['post']('/:id/dispositions',auth[_0xf063('0x9')](),controller['addDisposition']);router[_0xf063('0x22')](_0xf063('0x10'),auth[_0xf063('0x9')](),controller[_0xf063('0x23')]);var upload=multer({'storage':multer[_0xf063('0x24')]({'destination':function(_0x3b57f9,_0x2931de,_0x2813a1){_0x2813a1(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x4d5899,_0xb07f30,_0x3c3732){_0x3c3732(null,util[_0xf063('0x25')](_0xf063('0x26'),Date['now'](),_0xb07f30[_0xf063('0x27')]));}})});router[_0xf063('0x22')]('/:id/logo',upload[_0xf063('0x28')](_0xf063('0x29')),controller[_0xf063('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x46eeea,_0x261f26,_0x1f5f6c){_0x1f5f6c(null,path[_0xf063('0x2b')](config[_0xf063('0x2c')],_0xf063('0x2d')));},'filename':function(_0x5e8852,_0x37956b,_0xd7dbc8){_0xd7dbc8(null,util['format'](_0xf063('0x26'),Date[_0xf063('0x2e')](),_0x37956b[_0xf063('0x27')]));}})});router[_0xf063('0x22')](_0xf063('0x13'),upload[_0xf063('0x28')](_0xf063('0x29')),controller[_0xf063('0x2f')]);var upload=multer({'storage':multer[_0xf063('0x24')]({'destination':function(_0x49c843,_0x3f4baa,_0x1ac759){_0x1ac759(null,path['join'](config[_0xf063('0x2c')],_0xf063('0x2d')));},'filename':function(_0x5d810f,_0x4a3950,_0x2c1fe7){_0x2c1fe7(null,util[_0xf063('0x25')](_0xf063('0x26'),Date['now'](),_0x4a3950[_0xf063('0x27')]));}})});router[_0xf063('0x22')](_0xf063('0x14'),upload[_0xf063('0x28')](_0xf063('0x29')),controller[_0xf063('0x30')]);var upload=multer({'storage':multer[_0xf063('0x24')]({'destination':function(_0x529204,_0x17873e,_0x20c129){_0x20c129(null,path['join'](config['root'],_0xf063('0x2d')));},'filename':function(_0x1bda11,_0x44163b,_0x14a9e9){_0x14a9e9(null,util[_0xf063('0x25')](_0xf063('0x26'),Date[_0xf063('0x2e')](),_0x44163b[_0xf063('0x27')]));}})});router[_0xf063('0x22')](_0xf063('0x16'),upload[_0xf063('0x28')]('file'),controller[_0xf063('0x31')]);router['post']('/:id/notify',controller[_0xf063('0x32')]);router[_0xf063('0x22')]('/:id/offline',controller['offline']);router[_0xf063('0x22')]('/:id/interactions',auth[_0xf063('0x9')](),controller['addInteraction']);router[_0xf063('0x22')](_0xf063('0x33'),auth[_0xf063('0x9')](),controller[_0xf063('0x34')]);router[_0xf063('0x22')](_0xf063('0x1b'),auth['isAuthenticated'](),controller[_0xf063('0x35')]);router[_0xf063('0x22')](_0xf063('0x36'),auth[_0xf063('0x9')](),controller[_0xf063('0x37')]);router[_0xf063('0x38')]('/:id',auth[_0xf063('0x9')](),controller['update']);router[_0xf063('0x39')](_0xf063('0xc'),auth[_0xf063('0x9')](),controller[_0xf063('0x3a')]);router[_0xf063('0x39')]('/:id/dispositions',auth[_0xf063('0x9')](),controller[_0xf063('0x3b')]);router[_0xf063('0x39')](_0xf063('0x10'),auth[_0xf063('0x9')](),controller[_0xf063('0x3c')]);router['delete'](_0xf063('0x36'),auth[_0xf063('0x9')](),controller[_0xf063('0x3d')]);module[_0xf063('0x3e')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 0d3c1d6..edadf74 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 _0x0676=['STRING','sequelize','name'];(function(_0x4f9673,_0x4313bd){var _0x337e5e=function(_0x5677cf){while(--_0x5677cf){_0x4f9673['push'](_0x4f9673['shift']());}};_0x337e5e(++_0x4313bd);}(_0x0676,0x175));var _0x6067=function(_0x2532fb,_0x206a2e){_0x2532fb=_0x2532fb-0x0;var _0x30075b=_0x0676[_0x2532fb];return _0x30075b;};'use strict';var Sequelize=require(_0x6067('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x6067('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x6067('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x6067('0x2')]},'phone':{'type':Sequelize[_0x6067('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6067('0x2')]},'street':{'type':Sequelize[_0x6067('0x2')]},'postalCode':{'type':Sequelize[_0x6067('0x2')]},'city':{'type':Sequelize[_0x6067('0x2')]},'country':{'type':Sequelize[_0x6067('0x2')]},'email':{'type':Sequelize[_0x6067('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x6067('0x2')]},'sPostalCode':{'type':Sequelize[_0x6067('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x6067('0x2')]},'description':{'type':Sequelize[_0x6067('0x2')]}}; \ No newline at end of file +var _0x4104=['exports','STRING','name'];(function(_0x8eb4eb,_0xa70079){var _0x1ff8e3=function(_0x1e118e){while(--_0x1e118e){_0x8eb4eb['push'](_0x8eb4eb['shift']());}};_0x1ff8e3(++_0xa70079);}(_0x4104,0x19e));var _0x4410=function(_0x2d9e27,_0x5965b2){_0x2d9e27=_0x2d9e27-0x0;var _0xd35381=_0x4104[_0x2d9e27];return _0xd35381;};'use strict';var Sequelize=require('sequelize');module[_0x4410('0x0')]={'name':{'type':Sequelize[_0x4410('0x1')],'unique':_0x4410('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x4410('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x4410('0x1')]},'fax':{'type':Sequelize[_0x4410('0x1')]},'type':{'type':Sequelize[_0x4410('0x1')]},'street':{'type':Sequelize[_0x4410('0x1')]},'postalCode':{'type':Sequelize[_0x4410('0x1')]},'city':{'type':Sequelize[_0x4410('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4410('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x4410('0x1')]},'sCity':{'type':Sequelize[_0x4410('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4410('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index fbb009b..31e5703 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 _0x7a39=['keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','find','create','body','get','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','findOne','length','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','json','apply','reject','save','update','then','destroy','Companies','UserProfileResource','end','error','name','index','CmCompany','rawAttributes','model'];(function(_0x308e7b,_0x250803){var _0x52e610=function(_0x4ee575){while(--_0x4ee575){_0x308e7b['push'](_0x308e7b['shift']());}};_0x52e610(++_0x250803);}(_0x7a39,0x1e8));var _0x97a3=function(_0x40fd3e,_0x13f999){_0x40fd3e=_0x40fd3e-0x0;var _0x509b02=_0x7a39[_0x40fd3e];return _0x509b02;};'use strict';var pdf=require(_0x97a3('0x0'));var emlformat=require(_0x97a3('0x1'));var rimraf=require(_0x97a3('0x2'));var zipdir=require(_0x97a3('0x3'));var jsonpatch=require(_0x97a3('0x4'));var rp=require(_0x97a3('0x5'));var moment=require('moment');var BPromise=require(_0x97a3('0x6'));var Mustache=require(_0x97a3('0x7'));var util=require(_0x97a3('0x8'));var path=require('path');var sox=require(_0x97a3('0x9'));var csv=require(_0x97a3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x97a3('0xb'));var squel=require(_0x97a3('0xc'));var crypto=require(_0x97a3('0xd'));var jsforce=require(_0x97a3('0xe'));var deskjs=require(_0x97a3('0xf'));var toCsv=require(_0x97a3('0xa'));var querystring=require('querystring');var Papa=require(_0x97a3('0x10'));var Redis=require(_0x97a3('0x11'));var authService=require(_0x97a3('0x12'));var qs=require(_0x97a3('0x13'));var hardwareService=require(_0x97a3('0x14'));var logger=require(_0x97a3('0x15'))(_0x97a3('0x16'));var utils=require(_0x97a3('0x17'));var config=require(_0x97a3('0x18'));var db=require(_0x97a3('0x19'))['db'];function respondWithStatusCode(_0x2e7ca2,_0x11461d){_0x11461d=_0x11461d||0xcc;return function(_0x407912){if(_0x407912){return _0x2e7ca2[_0x97a3('0x1a')](_0x11461d);}return _0x2e7ca2[_0x97a3('0x1b')](_0x11461d)['end']();};}function respondWithResult(_0x1a005c,_0x28e72e){_0x28e72e=_0x28e72e||0xc8;return function(_0x338a4c){if(_0x338a4c){return _0x1a005c[_0x97a3('0x1b')](_0x28e72e)['json'](_0x338a4c);}};}function respondWithFilteredResult(_0x6c2caa,_0x5d514b){return function(_0x4d6a9d){if(_0x4d6a9d){var _0x6faae0=_0x4d6a9d[_0x97a3('0x1c')],_0x29eade=_0x5d514b[_0x97a3('0x1d')],_0x3a5a8a=_0x5d514b[_0x97a3('0x1d')]+_0x5d514b['limit'],_0x4cbb56;if(_0x3a5a8a>=_0x6faae0){_0x3a5a8a=_0x6faae0;_0x4cbb56=0xc8;}else{_0x4cbb56=0xce;}_0x6c2caa[_0x97a3('0x1b')](_0x4cbb56);return _0x6c2caa['set']('Content-Range',_0x29eade+'-'+_0x3a5a8a+'/'+_0x6faae0)[_0x97a3('0x1e')](_0x4d6a9d);}return null;};}function patchUpdates(_0x1e8e6e){return function(_0x5d9d4e){try{jsonpatch[_0x97a3('0x1f')](_0x5d9d4e,_0x1e8e6e,!![]);}catch(_0x5c450b){return BPromise[_0x97a3('0x20')](_0x5c450b);}return _0x5d9d4e[_0x97a3('0x21')]();};}function saveUpdates(_0x196e90,_0x1d8eb0){return function(_0x2312a3){if(_0x2312a3){return _0x2312a3[_0x97a3('0x22')](_0x196e90)[_0x97a3('0x23')](function(_0x52f387){return _0x52f387;});}return null;};}function removeEntity(_0x592682,_0x5e02f2){return function(_0x2ecfb6){if(_0x2ecfb6){return _0x2ecfb6[_0x97a3('0x24')]()[_0x97a3('0x23')](function(){var _0x1b664d=_0x2ecfb6['get']({'plain':!![]});var _0x5dc0ea=_0x97a3('0x25');return db[_0x97a3('0x26')][_0x97a3('0x24')]({'where':{'type':_0x5dc0ea,'resourceId':_0x1b664d['id']}})[_0x97a3('0x23')](function(){return _0x2ecfb6;});})['then'](function(){_0x592682[_0x97a3('0x1b')](0xcc)[_0x97a3('0x27')]();});}};}function handleEntityNotFound(_0xb2fbee,_0x50c1a9){return function(_0xf88633){if(!_0xf88633){_0xb2fbee[_0x97a3('0x1a')](0x194);}return _0xf88633;};}function handleError(_0x212e96,_0x20fb82){_0x20fb82=_0x20fb82||0x1f4;return function(_0x5d4c7f){logger[_0x97a3('0x28')](_0x5d4c7f['stack']);if(_0x5d4c7f[_0x97a3('0x29')]){delete _0x5d4c7f['name'];}_0x212e96[_0x97a3('0x1b')](_0x20fb82)['send'](_0x5d4c7f);};}exports[_0x97a3('0x2a')]=function(_0x5b8096,_0x1e1ad9){var _0x2eda5a={},_0xe5c8d4={},_0xd0ad2a={'count':0x0,'rows':[]};var _0xa51386=db[_0x97a3('0x2b')][_0x97a3('0x2c')];_0xe5c8d4[_0x97a3('0x2d')]=_[_0x97a3('0x2e')](_0xa51386);_0xe5c8d4['query']=_[_0x97a3('0x2e')](_0x5b8096[_0x97a3('0x2f')]);_0xe5c8d4[_0x97a3('0x30')]=_[_0x97a3('0x31')](_0xe5c8d4[_0x97a3('0x2d')],_0xe5c8d4[_0x97a3('0x2f')]);_0x2eda5a['attributes']=_[_0x97a3('0x31')](_0xe5c8d4[_0x97a3('0x2d')],qs[_0x97a3('0x32')](_0x5b8096[_0x97a3('0x2f')]['fields']));_0x2eda5a[_0x97a3('0x33')]=_0x2eda5a[_0x97a3('0x33')]['length']?_0x2eda5a[_0x97a3('0x33')]:_0xe5c8d4[_0x97a3('0x2d')];if(!_0x5b8096[_0x97a3('0x2f')][_0x97a3('0x34')](_0x97a3('0x35'))){_0x2eda5a[_0x97a3('0x36')]=qs[_0x97a3('0x36')](_0x5b8096['query'][_0x97a3('0x36')]);_0x2eda5a[_0x97a3('0x1d')]=qs[_0x97a3('0x1d')](_0x5b8096[_0x97a3('0x2f')][_0x97a3('0x1d')]);}_0x2eda5a[_0x97a3('0x37')]=qs[_0x97a3('0x38')](_0x5b8096[_0x97a3('0x2f')][_0x97a3('0x38')]);_0x2eda5a[_0x97a3('0x39')]=qs['filters'](_[_0x97a3('0x3a')](_0x5b8096[_0x97a3('0x2f')],_0xe5c8d4['filters']));if(_0x5b8096[_0x97a3('0x2f')][_0x97a3('0x3b')]){_0x2eda5a[_0x97a3('0x39')]=_[_0x97a3('0x3c')](_0x2eda5a[_0x97a3('0x39')],{'$or':_[_0x97a3('0x3d')](_0xa51386,function(_0x4ae76b){if(_0x4ae76b[_0x97a3('0x3e')][_0x97a3('0x3f')]!==_0x97a3('0x40')){var _0x5272d3={};_0x5272d3[_0x4ae76b[_0x97a3('0x41')]]={'$like':'%'+_0x5b8096[_0x97a3('0x2f')][_0x97a3('0x3b')]+'%'};return _0x5272d3;}})});}_0x2eda5a=_[_0x97a3('0x3c')]({},_0x2eda5a,_0x5b8096[_0x97a3('0x42')]);var _0x4352fc={'where':_0x2eda5a[_0x97a3('0x39')]};return db[_0x97a3('0x2b')][_0x97a3('0x1c')](_0x4352fc)[_0x97a3('0x23')](function(_0x215b90){_0xd0ad2a[_0x97a3('0x1c')]=_0x215b90;if(_0x5b8096['query'][_0x97a3('0x43')]){_0x2eda5a[_0x97a3('0x44')]=[{'all':!![]}];}return db[_0x97a3('0x2b')]['findAll'](_0x2eda5a);})['then'](function(_0x13a020){_0xd0ad2a[_0x97a3('0x45')]=_0x13a020;return _0xd0ad2a;})[_0x97a3('0x23')](respondWithFilteredResult(_0x1e1ad9,_0x2eda5a))[_0x97a3('0x46')](handleError(_0x1e1ad9,null));};exports[_0x97a3('0x47')]=function(_0x442df8,_0x58cb5e){var _0x510401={'raw':![],'where':{'id':_0x442df8['params']['id']}},_0x591623={};_0x591623[_0x97a3('0x2d')]=_[_0x97a3('0x2e')](db[_0x97a3('0x2b')][_0x97a3('0x2c')]);_0x591623[_0x97a3('0x2f')]=_[_0x97a3('0x2e')](_0x442df8[_0x97a3('0x2f')]);_0x591623['filters']=_[_0x97a3('0x31')](_0x591623[_0x97a3('0x2d')],_0x591623['query']);_0x510401[_0x97a3('0x33')]=_[_0x97a3('0x31')](_0x591623[_0x97a3('0x2d')],qs[_0x97a3('0x32')](_0x442df8['query'][_0x97a3('0x32')]));_0x510401['attributes']=_0x510401[_0x97a3('0x33')]['length']?_0x510401['attributes']:_0x591623[_0x97a3('0x2d')];if(_0x442df8['query']['includeAll']){_0x510401[_0x97a3('0x44')]=[{'all':!![]}];}_0x510401=_[_0x97a3('0x3c')]({},_0x510401,_0x442df8[_0x97a3('0x42')]);return db[_0x97a3('0x2b')][_0x97a3('0x48')](_0x510401)[_0x97a3('0x23')](handleEntityNotFound(_0x58cb5e,null))['then'](respondWithResult(_0x58cb5e,null))['catch'](handleError(_0x58cb5e,null));};exports['create']=function(_0x16e620,_0x9aa598){return db[_0x97a3('0x2b')][_0x97a3('0x49')](_0x16e620[_0x97a3('0x4a')],{})['then'](function(_0x1aae8e){var _0xa9750c=_0x16e620['user'][_0x97a3('0x4b')]({'plain':!![]});if(!_0xa9750c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa9750c['role']===_0x97a3('0x4c')){var _0x503f2a=_0x1aae8e['get']({'plain':!![]});var _0x1a1614='Companies';return db[_0x97a3('0x4d')]['find']({'where':{'name':_0x1a1614,'userProfileId':_0xa9750c[_0x97a3('0x4e')]},'raw':!![]})[_0x97a3('0x23')](function(_0x32a84b){if(_0x32a84b&&_0x32a84b[_0x97a3('0x4f')]===0x0){return db[_0x97a3('0x26')][_0x97a3('0x49')]({'name':_0x503f2a[_0x97a3('0x29')],'resourceId':_0x503f2a['id'],'type':_0x32a84b[_0x97a3('0x29')],'sectionId':_0x32a84b['id']},{})[_0x97a3('0x23')](function(){return _0x1aae8e;});}else{return _0x1aae8e;}})[_0x97a3('0x46')](function(_0x149aa8){logger['error'](_0x97a3('0x50'),_0x149aa8);throw _0x149aa8;});}return _0x1aae8e;})['then'](respondWithResult(_0x9aa598,0xc9))[_0x97a3('0x46')](handleError(_0x9aa598,null));};exports[_0x97a3('0x22')]=function(_0x32e71e,_0x4fd0c6){if(_0x32e71e[_0x97a3('0x4a')]['id']){delete _0x32e71e[_0x97a3('0x4a')]['id'];}return db[_0x97a3('0x2b')][_0x97a3('0x48')]({'where':{'id':_0x32e71e[_0x97a3('0x51')]['id']}})[_0x97a3('0x23')](handleEntityNotFound(_0x4fd0c6,null))[_0x97a3('0x23')](saveUpdates(_0x32e71e[_0x97a3('0x4a')],null))['then'](respondWithResult(_0x4fd0c6,null))[_0x97a3('0x46')](handleError(_0x4fd0c6,null));};exports[_0x97a3('0x24')]=function(_0x560ddb,_0x2f3ca2){return db[_0x97a3('0x2b')][_0x97a3('0x48')]({'where':{'id':_0x560ddb[_0x97a3('0x51')]['id']}})['then'](handleEntityNotFound(_0x2f3ca2,null))[_0x97a3('0x23')](removeEntity(_0x2f3ca2,null))[_0x97a3('0x46')](handleError(_0x2f3ca2,null));};exports[_0x97a3('0x52')]=function(_0x2c4b6d,_0x574033,_0x2d4385){return db[_0x97a3('0x53')][_0x97a3('0x48')]({'where':{'id':_0x2c4b6d['params']['id']}})[_0x97a3('0x23')](handleEntityNotFound(_0x574033,null))[_0x97a3('0x23')](function(_0x21adc3){if(_0x21adc3){return _0x21adc3[_0x97a3('0x52')](_0x2c4b6d[_0x97a3('0x4a')][_0x97a3('0x54')],_[_0x97a3('0x55')](_0x2c4b6d[_0x97a3('0x4a')],[_0x97a3('0x54'),'id'])||{});}})['then'](respondWithResult(_0x574033,null))[_0x97a3('0x46')](handleError(_0x574033,null));};exports[_0x97a3('0x56')]=function(_0x344571,_0x1cf487,_0x2c1a25){var _0x44f3d0={};var _0x9876e7={};var _0x1b88e1;var _0x526f3b;return db['CmCompany'][_0x97a3('0x57')]({'where':{'id':_0x344571[_0x97a3('0x51')]['id']}})[_0x97a3('0x23')](handleEntityNotFound(_0x1cf487,null))['then'](function(_0x364e09){if(_0x364e09){_0x1b88e1=_0x364e09;_0x9876e7[_0x97a3('0x2d')]=_[_0x97a3('0x2e')](db[_0x97a3('0x53')]['rawAttributes']);_0x9876e7[_0x97a3('0x2f')]=_['keys'](_0x344571[_0x97a3('0x2f')]);_0x9876e7[_0x97a3('0x30')]=_[_0x97a3('0x31')](_0x9876e7['model'],_0x9876e7[_0x97a3('0x2f')]);_0x44f3d0[_0x97a3('0x33')]=_[_0x97a3('0x31')](_0x9876e7['model'],qs[_0x97a3('0x32')](_0x344571[_0x97a3('0x2f')][_0x97a3('0x32')]));_0x44f3d0[_0x97a3('0x33')]=_0x44f3d0['attributes'][_0x97a3('0x58')]?_0x44f3d0[_0x97a3('0x33')]:_0x9876e7['model'];_0x44f3d0[_0x97a3('0x37')]=qs[_0x97a3('0x38')](_0x344571[_0x97a3('0x2f')][_0x97a3('0x38')]);_0x44f3d0[_0x97a3('0x39')]=qs[_0x97a3('0x30')](_[_0x97a3('0x3a')](_0x344571[_0x97a3('0x2f')],_0x9876e7[_0x97a3('0x30')]));if(_0x344571[_0x97a3('0x2f')]['filter']){_0x44f3d0[_0x97a3('0x39')]=_[_0x97a3('0x3c')](_0x44f3d0[_0x97a3('0x39')],{'$or':_[_0x97a3('0x3d')](_0x44f3d0[_0x97a3('0x33')],function(_0x1082ad){var _0x2d00b8={};_0x2d00b8[_0x1082ad]={'$like':'%'+_0x344571[_0x97a3('0x2f')][_0x97a3('0x3b')]+'%'};return _0x2d00b8;})});}_0x44f3d0=_[_0x97a3('0x3c')]({},_0x44f3d0,_0x344571[_0x97a3('0x42')]);return _0x1b88e1[_0x97a3('0x56')](_0x44f3d0);}})['then'](function(_0x14b127){if(_0x14b127){_0x526f3b=_0x14b127['length'];if(!_0x344571[_0x97a3('0x2f')]['hasOwnProperty']('nolimit')){_0x44f3d0['limit']=qs['limit'](_0x344571['query'][_0x97a3('0x36')]);_0x44f3d0[_0x97a3('0x1d')]=qs[_0x97a3('0x1d')](_0x344571[_0x97a3('0x2f')][_0x97a3('0x1d')]);}return _0x1b88e1[_0x97a3('0x56')](_0x44f3d0);}})['then'](function(_0x4e5424){if(_0x4e5424){return _0x4e5424?{'count':_0x526f3b,'rows':_0x4e5424}:null;}})[_0x97a3('0x23')](respondWithResult(_0x1cf487,null))['catch'](handleError(_0x1cf487,null));}; \ No newline at end of file +var _0x2f8d=['params','fields','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','omit','getContacts','sort','nolimit','html-pdf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','Content-Range','apply','save','update','then','destroy','error','name','send','index','CmCompany','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','limit','order','where','filters','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows'];(function(_0x3e04c4,_0x48101b){var _0x543e0f=function(_0x240c8b){while(--_0x240c8b){_0x3e04c4['push'](_0x3e04c4['shift']());}};_0x543e0f(++_0x48101b);}(_0x2f8d,0x66));var _0xd2f8=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2f8d[_0x3b380d];return _0x54502b;};'use strict';var pdf=require(_0xd2f8('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd2f8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd2f8('0x2'));var moment=require(_0xd2f8('0x3'));var BPromise=require(_0xd2f8('0x4'));var Mustache=require('mustache');var util=require(_0xd2f8('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xd2f8('0x6'));var ejs=require(_0xd2f8('0x7'));var fs=require('fs');var _=require(_0xd2f8('0x8'));var squel=require(_0xd2f8('0x9'));var crypto=require(_0xd2f8('0xa'));var jsforce=require(_0xd2f8('0xb'));var deskjs=require(_0xd2f8('0xc'));var toCsv=require(_0xd2f8('0x6'));var querystring=require('querystring');var Papa=require(_0xd2f8('0xd'));var Redis=require(_0xd2f8('0xe'));var authService=require(_0xd2f8('0xf'));var qs=require(_0xd2f8('0x10'));var hardwareService=require(_0xd2f8('0x11'));var logger=require(_0xd2f8('0x12'))(_0xd2f8('0x13'));var utils=require(_0xd2f8('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18597f,_0x75670){_0x75670=_0x75670||0xcc;return function(_0x45c849){if(_0x45c849){return _0x18597f[_0xd2f8('0x15')](_0x75670);}return _0x18597f[_0xd2f8('0x16')](_0x75670)[_0xd2f8('0x17')]();};}function respondWithResult(_0x1f84f4,_0x590f2a){_0x590f2a=_0x590f2a||0xc8;return function(_0x41cf7a){if(_0x41cf7a){return _0x1f84f4['status'](_0x590f2a)[_0xd2f8('0x18')](_0x41cf7a);}};}function respondWithFilteredResult(_0x5ce93d,_0x3f30bd){return function(_0x1d451a){if(_0x1d451a){var _0x1303d9=_0x1d451a[_0xd2f8('0x19')],_0x471128=_0x3f30bd[_0xd2f8('0x1a')],_0x2cb7f2=_0x3f30bd[_0xd2f8('0x1a')]+_0x3f30bd['limit'],_0x382040;if(_0x2cb7f2>=_0x1303d9){_0x2cb7f2=_0x1303d9;_0x382040=0xc8;}else{_0x382040=0xce;}_0x5ce93d[_0xd2f8('0x16')](_0x382040);return _0x5ce93d['set'](_0xd2f8('0x1b'),_0x471128+'-'+_0x2cb7f2+'/'+_0x1303d9)[_0xd2f8('0x18')](_0x1d451a);}return null;};}function patchUpdates(_0x38f098){return function(_0x17b3cb){try{jsonpatch[_0xd2f8('0x1c')](_0x17b3cb,_0x38f098,!![]);}catch(_0x232f8c){return BPromise['reject'](_0x232f8c);}return _0x17b3cb[_0xd2f8('0x1d')]();};}function saveUpdates(_0x23588d,_0xc53636){return function(_0x5d0aea){if(_0x5d0aea){return _0x5d0aea[_0xd2f8('0x1e')](_0x23588d)[_0xd2f8('0x1f')](function(_0x3ee9e2){return _0x3ee9e2;});}return null;};}function removeEntity(_0x1c07cd,_0x3b975b){return function(_0x99c94e){if(_0x99c94e){return _0x99c94e['destroy']()[_0xd2f8('0x1f')](function(){var _0x34bda3=_0x99c94e['get']({'plain':!![]});var _0x5913ed='Companies';return db['UserProfileResource'][_0xd2f8('0x20')]({'where':{'type':_0x5913ed,'resourceId':_0x34bda3['id']}})[_0xd2f8('0x1f')](function(){return _0x99c94e;});})[_0xd2f8('0x1f')](function(){_0x1c07cd[_0xd2f8('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5edf27,_0x41efae){return function(_0x1ac79f){if(!_0x1ac79f){_0x5edf27['sendStatus'](0x194);}return _0x1ac79f;};}function handleError(_0xf4477,_0x48cc61){_0x48cc61=_0x48cc61||0x1f4;return function(_0x6334d1){logger[_0xd2f8('0x21')](_0x6334d1['stack']);if(_0x6334d1['name']){delete _0x6334d1[_0xd2f8('0x22')];}_0xf4477[_0xd2f8('0x16')](_0x48cc61)[_0xd2f8('0x23')](_0x6334d1);};}exports[_0xd2f8('0x24')]=function(_0x2534c0,_0x257cca){var _0x5bf088={},_0xba21b={},_0x5c3912={'count':0x0,'rows':[]};var _0x3d5b65=db[_0xd2f8('0x25')][_0xd2f8('0x26')];_0xba21b[_0xd2f8('0x27')]=_[_0xd2f8('0x28')](_0x3d5b65);_0xba21b['query']=_[_0xd2f8('0x28')](_0x2534c0[_0xd2f8('0x29')]);_0xba21b['filters']=_[_0xd2f8('0x2a')](_0xba21b[_0xd2f8('0x27')],_0xba21b[_0xd2f8('0x29')]);_0x5bf088[_0xd2f8('0x2b')]=_[_0xd2f8('0x2a')](_0xba21b[_0xd2f8('0x27')],qs['fields'](_0x2534c0['query']['fields']));_0x5bf088[_0xd2f8('0x2b')]=_0x5bf088[_0xd2f8('0x2b')][_0xd2f8('0x2c')]?_0x5bf088[_0xd2f8('0x2b')]:_0xba21b[_0xd2f8('0x27')];if(!_0x2534c0[_0xd2f8('0x29')][_0xd2f8('0x2d')]('nolimit')){_0x5bf088['limit']=qs[_0xd2f8('0x2e')](_0x2534c0[_0xd2f8('0x29')][_0xd2f8('0x2e')]);_0x5bf088[_0xd2f8('0x1a')]=qs[_0xd2f8('0x1a')](_0x2534c0[_0xd2f8('0x29')][_0xd2f8('0x1a')]);}_0x5bf088[_0xd2f8('0x2f')]=qs['sort'](_0x2534c0[_0xd2f8('0x29')]['sort']);_0x5bf088[_0xd2f8('0x30')]=qs[_0xd2f8('0x31')](_[_0xd2f8('0x32')](_0x2534c0[_0xd2f8('0x29')],_0xba21b['filters']));if(_0x2534c0[_0xd2f8('0x29')][_0xd2f8('0x33')]){_0x5bf088['where']=_[_0xd2f8('0x34')](_0x5bf088[_0xd2f8('0x30')],{'$or':_['map'](_0x3d5b65,function(_0x35ef29){if(_0x35ef29[_0xd2f8('0x35')][_0xd2f8('0x36')]!==_0xd2f8('0x37')){var _0x3c0168={};_0x3c0168[_0x35ef29[_0xd2f8('0x38')]]={'$like':'%'+_0x2534c0[_0xd2f8('0x29')][_0xd2f8('0x33')]+'%'};return _0x3c0168;}})});}_0x5bf088=_[_0xd2f8('0x34')]({},_0x5bf088,_0x2534c0[_0xd2f8('0x39')]);var _0x469d13={'where':_0x5bf088['where']};return db[_0xd2f8('0x25')][_0xd2f8('0x19')](_0x469d13)[_0xd2f8('0x1f')](function(_0x52f9f9){_0x5c3912[_0xd2f8('0x19')]=_0x52f9f9;if(_0x2534c0['query'][_0xd2f8('0x3a')]){_0x5bf088[_0xd2f8('0x3b')]=[{'all':!![]}];}return db[_0xd2f8('0x25')][_0xd2f8('0x3c')](_0x5bf088);})['then'](function(_0x381ef6){_0x5c3912[_0xd2f8('0x3d')]=_0x381ef6;return _0x5c3912;})[_0xd2f8('0x1f')](respondWithFilteredResult(_0x257cca,_0x5bf088))['catch'](handleError(_0x257cca,null));};exports['show']=function(_0x3ff8fa,_0x2f6112){var _0x4f2971={'raw':![],'where':{'id':_0x3ff8fa[_0xd2f8('0x3e')]['id']}},_0x3dd0be={};_0x3dd0be['model']=_[_0xd2f8('0x28')](db[_0xd2f8('0x25')]['rawAttributes']);_0x3dd0be['query']=_[_0xd2f8('0x28')](_0x3ff8fa[_0xd2f8('0x29')]);_0x3dd0be[_0xd2f8('0x31')]=_[_0xd2f8('0x2a')](_0x3dd0be[_0xd2f8('0x27')],_0x3dd0be[_0xd2f8('0x29')]);_0x4f2971[_0xd2f8('0x2b')]=_['intersection'](_0x3dd0be['model'],qs[_0xd2f8('0x3f')](_0x3ff8fa[_0xd2f8('0x29')][_0xd2f8('0x3f')]));_0x4f2971[_0xd2f8('0x2b')]=_0x4f2971[_0xd2f8('0x2b')][_0xd2f8('0x2c')]?_0x4f2971['attributes']:_0x3dd0be[_0xd2f8('0x27')];if(_0x3ff8fa[_0xd2f8('0x29')][_0xd2f8('0x3a')]){_0x4f2971[_0xd2f8('0x3b')]=[{'all':!![]}];}_0x4f2971=_['merge']({},_0x4f2971,_0x3ff8fa[_0xd2f8('0x39')]);return db['CmCompany'][_0xd2f8('0x40')](_0x4f2971)[_0xd2f8('0x1f')](handleEntityNotFound(_0x2f6112,null))[_0xd2f8('0x1f')](respondWithResult(_0x2f6112,null))[_0xd2f8('0x41')](handleError(_0x2f6112,null));};exports[_0xd2f8('0x42')]=function(_0x456f43,_0x5a7be1){return db[_0xd2f8('0x25')][_0xd2f8('0x42')](_0x456f43['body'],{})[_0xd2f8('0x1f')](function(_0x37faeb){var _0x575bbb=_0x456f43[_0xd2f8('0x43')][_0xd2f8('0x44')]({'plain':!![]});if(!_0x575bbb)throw new Error(_0xd2f8('0x45'));if(_0x575bbb['role']===_0xd2f8('0x43')){var _0x15b732=_0x37faeb[_0xd2f8('0x44')]({'plain':!![]});var _0x293c93=_0xd2f8('0x46');return db['UserProfileSection'][_0xd2f8('0x40')]({'where':{'name':_0x293c93,'userProfileId':_0x575bbb[_0xd2f8('0x47')]},'raw':!![]})[_0xd2f8('0x1f')](function(_0x4899ce){if(_0x4899ce&&_0x4899ce[_0xd2f8('0x48')]===0x0){return db['UserProfileResource']['create']({'name':_0x15b732[_0xd2f8('0x22')],'resourceId':_0x15b732['id'],'type':_0x4899ce[_0xd2f8('0x22')],'sectionId':_0x4899ce['id']},{})[_0xd2f8('0x1f')](function(){return _0x37faeb;});}else{return _0x37faeb;}})[_0xd2f8('0x41')](function(_0x447f55){logger[_0xd2f8('0x21')](_0xd2f8('0x49'),_0x447f55);throw _0x447f55;});}return _0x37faeb;})['then'](respondWithResult(_0x5a7be1,0xc9))[_0xd2f8('0x41')](handleError(_0x5a7be1,null));};exports[_0xd2f8('0x1e')]=function(_0x3c531a,_0x4478e8){if(_0x3c531a[_0xd2f8('0x4a')]['id']){delete _0x3c531a['body']['id'];}return db[_0xd2f8('0x25')][_0xd2f8('0x40')]({'where':{'id':_0x3c531a[_0xd2f8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4478e8,null))[_0xd2f8('0x1f')](saveUpdates(_0x3c531a[_0xd2f8('0x4a')],null))['then'](respondWithResult(_0x4478e8,null))['catch'](handleError(_0x4478e8,null));};exports[_0xd2f8('0x20')]=function(_0x58a36c,_0x5eec7a){return db['CmCompany'][_0xd2f8('0x40')]({'where':{'id':_0x58a36c[_0xd2f8('0x3e')]['id']}})[_0xd2f8('0x1f')](handleEntityNotFound(_0x5eec7a,null))[_0xd2f8('0x1f')](removeEntity(_0x5eec7a,null))[_0xd2f8('0x41')](handleError(_0x5eec7a,null));};exports[_0xd2f8('0x4b')]=function(_0x536503,_0x28a14d,_0x18e189){return db[_0xd2f8('0x4c')][_0xd2f8('0x40')]({'where':{'id':_0x536503['params']['id']}})[_0xd2f8('0x1f')](handleEntityNotFound(_0x28a14d,null))[_0xd2f8('0x1f')](function(_0x40ff98){if(_0x40ff98){return _0x40ff98[_0xd2f8('0x4b')](_0x536503['body'][_0xd2f8('0x4d')],_[_0xd2f8('0x4e')](_0x536503[_0xd2f8('0x4a')],[_0xd2f8('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x28a14d,null))[_0xd2f8('0x41')](handleError(_0x28a14d,null));};exports[_0xd2f8('0x4f')]=function(_0x4e8e86,_0x49e8a6,_0x1d6a1b){var _0xbb0120={};var _0x59d1b8={};var _0x475d27;var _0x1df26b;return db[_0xd2f8('0x25')]['findOne']({'where':{'id':_0x4e8e86[_0xd2f8('0x3e')]['id']}})[_0xd2f8('0x1f')](handleEntityNotFound(_0x49e8a6,null))[_0xd2f8('0x1f')](function(_0xee7302){if(_0xee7302){_0x475d27=_0xee7302;_0x59d1b8['model']=_['keys'](db[_0xd2f8('0x4c')][_0xd2f8('0x26')]);_0x59d1b8['query']=_[_0xd2f8('0x28')](_0x4e8e86[_0xd2f8('0x29')]);_0x59d1b8[_0xd2f8('0x31')]=_[_0xd2f8('0x2a')](_0x59d1b8['model'],_0x59d1b8['query']);_0xbb0120[_0xd2f8('0x2b')]=_[_0xd2f8('0x2a')](_0x59d1b8[_0xd2f8('0x27')],qs['fields'](_0x4e8e86[_0xd2f8('0x29')]['fields']));_0xbb0120[_0xd2f8('0x2b')]=_0xbb0120[_0xd2f8('0x2b')]['length']?_0xbb0120[_0xd2f8('0x2b')]:_0x59d1b8[_0xd2f8('0x27')];_0xbb0120[_0xd2f8('0x2f')]=qs[_0xd2f8('0x50')](_0x4e8e86['query'][_0xd2f8('0x50')]);_0xbb0120[_0xd2f8('0x30')]=qs['filters'](_[_0xd2f8('0x32')](_0x4e8e86['query'],_0x59d1b8[_0xd2f8('0x31')]));if(_0x4e8e86[_0xd2f8('0x29')][_0xd2f8('0x33')]){_0xbb0120[_0xd2f8('0x30')]=_[_0xd2f8('0x34')](_0xbb0120[_0xd2f8('0x30')],{'$or':_['map'](_0xbb0120[_0xd2f8('0x2b')],function(_0x1a0f41){var _0x5e8d1a={};_0x5e8d1a[_0x1a0f41]={'$like':'%'+_0x4e8e86[_0xd2f8('0x29')][_0xd2f8('0x33')]+'%'};return _0x5e8d1a;})});}_0xbb0120=_[_0xd2f8('0x34')]({},_0xbb0120,_0x4e8e86['options']);return _0x475d27['getContacts'](_0xbb0120);}})[_0xd2f8('0x1f')](function(_0x1bd1c2){if(_0x1bd1c2){_0x1df26b=_0x1bd1c2[_0xd2f8('0x2c')];if(!_0x4e8e86['query']['hasOwnProperty'](_0xd2f8('0x51'))){_0xbb0120[_0xd2f8('0x2e')]=qs[_0xd2f8('0x2e')](_0x4e8e86[_0xd2f8('0x29')][_0xd2f8('0x2e')]);_0xbb0120['offset']=qs[_0xd2f8('0x1a')](_0x4e8e86[_0xd2f8('0x29')][_0xd2f8('0x1a')]);}return _0x475d27['getContacts'](_0xbb0120);}})[_0xd2f8('0x1f')](function(_0x5eb86a){if(_0x5eb86a){return _0x5eb86a?{'count':_0x1df26b,'rows':_0x5eb86a}:null;}})[_0xd2f8('0x1f')](respondWithResult(_0x49e8a6,null))[_0xd2f8('0x41')](handleError(_0x49e8a6,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 5f46ee0..a508c6e 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 _0x818f=['rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1d04fc,_0x57ff67){var _0x41b7e8=function(_0x2b412f){while(--_0x2b412f){_0x1d04fc['push'](_0x1d04fc['shift']());}};_0x41b7e8(++_0x57ff67);}(_0x818f,0x1da));var _0xf818=function(_0x1c0f5e,_0x1289e4){_0x1c0f5e=_0x1c0f5e-0x0;var _0xe11421=_0x818f[_0x1c0f5e];return _0xe11421;};'use strict';var _=require(_0xf818('0x0'));var util=require(_0xf818('0x1'));var logger=require(_0xf818('0x2'))(_0xf818('0x3'));var moment=require(_0xf818('0x4'));var BPromise=require(_0xf818('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf818('0x6'));var rimraf=require(_0xf818('0x7'));var config=require(_0xf818('0x8'));var attributes=require(_0xf818('0x9'));module[_0xf818('0xa')]=function(_0x41310f,_0x27119b){return _0x41310f[_0xf818('0xb')](_0xf818('0xc'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec39=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash'];(function(_0x764e27,_0x35d818){var _0x4c6901=function(_0x457cfe){while(--_0x457cfe){_0x764e27['push'](_0x764e27['shift']());}};_0x4c6901(++_0x35d818);}(_0xec39,0x19f));var _0x9ec3=function(_0x2b1fd1,_0x546139){_0x2b1fd1=_0x2b1fd1-0x0;var _0x1759d8=_0xec39[_0x2b1fd1];return _0x1759d8;};'use strict';var _=require(_0x9ec3('0x0'));var util=require(_0x9ec3('0x1'));var logger=require(_0x9ec3('0x2'))(_0x9ec3('0x3'));var moment=require(_0x9ec3('0x4'));var BPromise=require(_0x9ec3('0x5'));var rp=require(_0x9ec3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ec3('0x7'));var config=require(_0x9ec3('0x8'));var attributes=require(_0x9ec3('0x9'));module['exports']=function(_0x49ddff,_0x55adba){return _0x49ddff[_0x9ec3('0xa')](_0x9ec3('0xb'),attributes,{'tableName':_0x9ec3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 07d2adf..32dcca2 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 _0xa259=['debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','CmCompany,\x20%s,\x20%s','error','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x4d36e8,_0x113101){var _0x50289d=function(_0x609603){while(--_0x609603){_0x4d36e8['push'](_0x4d36e8['shift']());}};_0x50289d(++_0x113101);}(_0xa259,0x195));var _0x9a25=function(_0x188d31,_0x576e87){_0x188d31=_0x188d31-0x0;var _0x30ed33=_0xa259[_0x188d31];return _0x30ed33;};'use strict';var _=require(_0x9a25('0x0'));var util=require('util');var moment=require(_0x9a25('0x1'));var BPromise=require(_0x9a25('0x2'));var rs=require(_0x9a25('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a25('0x4'))['db'];var utils=require(_0x9a25('0x5'));var logger=require('../../config/logger')(_0x9a25('0x6'));var config=require(_0x9a25('0x7'));var jayson=require(_0x9a25('0x8'));var client=jayson[_0x9a25('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5803b8,_0x511fb2,_0x2d5795){return new BPromise(function(_0x26cfab,_0x58d747){return client[_0x9a25('0xa')](_0x5803b8,_0x2d5795)[_0x9a25('0xb')](function(_0x303098){logger[_0x9a25('0xc')]('CmCompany,\x20%s,\x20%s',_0x511fb2,'request\x20sent');logger[_0x9a25('0xd')](_0x9a25('0xe'),_0x511fb2,_0x9a25('0xf'),JSON[_0x9a25('0x10')](_0x303098));if(_0x303098['error']){if(_0x303098['error'][_0x9a25('0x11')]===0x1f4){logger['error'](_0x9a25('0x12'),_0x511fb2,_0x303098[_0x9a25('0x13')][_0x9a25('0x14')]);return _0x58d747(_0x303098[_0x9a25('0x13')][_0x9a25('0x14')]);}logger[_0x9a25('0x13')](_0x9a25('0x12'),_0x511fb2,_0x303098[_0x9a25('0x13')]['message']);return _0x26cfab(_0x303098[_0x9a25('0x13')][_0x9a25('0x14')]);}else{logger[_0x9a25('0xc')]('CmCompany,\x20%s,\x20%s',_0x511fb2,_0x9a25('0xf'));_0x26cfab(_0x303098['result']['message']);}})[_0x9a25('0x15')](function(_0x2de5fa){logger[_0x9a25('0x13')](_0x9a25('0x12'),_0x511fb2,_0x2de5fa);_0x58d747(_0x2de5fa);});});} \ No newline at end of file +var _0x727b=['CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','info'];(function(_0x2a4d11,_0x13abab){var _0x1bb6e2=function(_0xe51ba9){while(--_0xe51ba9){_0x2a4d11['push'](_0x2a4d11['shift']());}};_0x1bb6e2(++_0x13abab);}(_0x727b,0x1d5));var _0xb727=function(_0x2d1a6d,_0xedb0){_0x2d1a6d=_0x2d1a6d-0x0;var _0x5bd1fc=_0x727b[_0x2d1a6d];return _0x5bd1fc;};'use strict';var _=require('lodash');var util=require(_0xb727('0x0'));var moment=require(_0xb727('0x1'));var BPromise=require(_0xb727('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb727('0x3'));var db=require(_0xb727('0x4'))['db'];var utils=require(_0xb727('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb727('0x6'));var client=jayson[_0xb727('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c328a,_0x25ae0f,_0x47bac9){return new BPromise(function(_0x14e843,_0x3f91ac){return client[_0xb727('0x8')](_0x4c328a,_0x47bac9)[_0xb727('0x9')](function(_0x336e1a){logger[_0xb727('0xa')](_0xb727('0xb'),_0x25ae0f,_0xb727('0xc'));logger[_0xb727('0xd')](_0xb727('0xe'),_0x25ae0f,_0xb727('0xc'),JSON[_0xb727('0xf')](_0x336e1a));if(_0x336e1a[_0xb727('0x10')]){if(_0x336e1a[_0xb727('0x10')][_0xb727('0x11')]===0x1f4){logger[_0xb727('0x10')](_0xb727('0xb'),_0x25ae0f,_0x336e1a[_0xb727('0x10')][_0xb727('0x12')]);return _0x3f91ac(_0x336e1a['error']['message']);}logger[_0xb727('0x10')](_0xb727('0xb'),_0x25ae0f,_0x336e1a[_0xb727('0x10')][_0xb727('0x12')]);return _0x14e843(_0x336e1a[_0xb727('0x10')][_0xb727('0x12')]);}else{logger['info'](_0xb727('0xb'),_0x25ae0f,_0xb727('0xc'));_0x14e843(_0x336e1a[_0xb727('0x13')][_0xb727('0x12')]);}})['catch'](function(_0x31a03e){logger['error'](_0xb727('0xb'),_0x25ae0f,_0x31a03e);_0x3f91ac(_0x31a03e);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 180dc71..e4d8591 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 _0xed0b=['getContacts','post','create','/:id/contacts','addContacts','update','delete','destroy','exports','multer','path','connect-timeout','express','../../config/environment','get','/:id','isAuthenticated','show'];(function(_0x14c5fb,_0x1859ef){var _0x552e15=function(_0x17b838){while(--_0x17b838){_0x14c5fb['push'](_0x14c5fb['shift']());}};_0x552e15(++_0x1859ef);}(_0xed0b,0x15f));var _0xbed0=function(_0x142020,_0x1f7233){_0x142020=_0x142020-0x0;var _0x40da8f=_0xed0b[_0x142020];return _0x40da8f;};'use strict';var multer=require(_0xbed0('0x0'));var util=require('util');var path=require(_0xbed0('0x1'));var timeout=require(_0xbed0('0x2'));var express=require(_0xbed0('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbed0('0x4'));var controller=require('./cmCompany.controller');router[_0xbed0('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbed0('0x5')](_0xbed0('0x6'),auth[_0xbed0('0x7')](),controller[_0xbed0('0x8')]);router[_0xbed0('0x5')]('/:id/contacts',auth[_0xbed0('0x7')](),controller[_0xbed0('0x9')]);router[_0xbed0('0xa')]('/',auth[_0xbed0('0x7')](),controller[_0xbed0('0xb')]);router['post'](_0xbed0('0xc'),auth[_0xbed0('0x7')](),controller[_0xbed0('0xd')]);router['put'](_0xbed0('0x6'),auth['isAuthenticated'](),controller[_0xbed0('0xe')]);router[_0xbed0('0xf')](_0xbed0('0x6'),auth[_0xbed0('0x7')](),controller[_0xbed0('0x10')]);module[_0xbed0('0x11')]=router; \ No newline at end of file +var _0x7b27=['show','/:id/contacts','getContacts','post','create','addContacts','put','/:id','update','delete','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index'];(function(_0x2d64fc,_0x42b2a7){var _0x2c8556=function(_0x4b29da){while(--_0x4b29da){_0x2d64fc['push'](_0x2d64fc['shift']());}};_0x2c8556(++_0x42b2a7);}(_0x7b27,0xbe));var _0x77b2=function(_0x5e2815,_0x20aacc){_0x5e2815=_0x5e2815-0x0;var _0x5d6fa8=_0x7b27[_0x5e2815];return _0x5d6fa8;};'use strict';var multer=require(_0x77b2('0x0'));var util=require(_0x77b2('0x1'));var path=require('path');var timeout=require(_0x77b2('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x77b2('0x3'));var interaction=require(_0x77b2('0x4'));var config=require(_0x77b2('0x5'));var controller=require(_0x77b2('0x6'));router[_0x77b2('0x7')]('/',auth[_0x77b2('0x8')](),controller[_0x77b2('0x9')]);router[_0x77b2('0x7')]('/:id',auth[_0x77b2('0x8')](),controller[_0x77b2('0xa')]);router[_0x77b2('0x7')](_0x77b2('0xb'),auth[_0x77b2('0x8')](),controller[_0x77b2('0xc')]);router[_0x77b2('0xd')]('/',auth[_0x77b2('0x8')](),controller[_0x77b2('0xe')]);router[_0x77b2('0xd')]('/:id/contacts',auth[_0x77b2('0x8')](),controller[_0x77b2('0xf')]);router[_0x77b2('0x10')](_0x77b2('0x11'),auth[_0x77b2('0x8')](),controller[_0x77b2('0x12')]);router[_0x77b2('0x13')]('/:id',auth[_0x77b2('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 48bf326..85330d1 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 _0xfa8f=['NOW','lodash','sequelize','exports','STRING','TEXT','DATE'];(function(_0x1cb2c1,_0xf50489){var _0x10fd04=function(_0x1565dc){while(--_0x1565dc){_0x1cb2c1['push'](_0x1cb2c1['shift']());}};_0x10fd04(++_0xf50489);}(_0xfa8f,0x166));var _0xffa8=function(_0x458bd1,_0x23c367){_0x458bd1=_0x458bd1-0x0;var _0x41c078=_0xfa8f[_0x458bd1];return _0x41c078;};'use strict';var _=require(_0xffa8('0x0'));var Sequelize=require(_0xffa8('0x1'));module[_0xffa8('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xffa8('0x3')]},'postalCode':{'type':Sequelize[_0xffa8('0x3')]},'city':{'type':Sequelize[_0xffa8('0x3')]},'country':{'type':Sequelize[_0xffa8('0x3')]},'dateOfBirth':{'type':Sequelize[_0xffa8('0x3')]},'description':{'type':Sequelize[_0xffa8('0x4')]},'phone':{'type':Sequelize[_0xffa8('0x3')]},'mobile':{'type':Sequelize[_0xffa8('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xffa8('0x3')]},'url':{'type':Sequelize[_0xffa8('0x3')]},'facebook':{'type':Sequelize[_0xffa8('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xffa8('0x3')]},'skype':{'type':Sequelize[_0xffa8('0x3')]},'teams':{'type':Sequelize[_0xffa8('0x3')]},'viber':{'type':Sequelize[_0xffa8('0x3')]},'line':{'type':Sequelize[_0xffa8('0x3')]},'wechat':{'type':Sequelize[_0xffa8('0x3')]},'telegram':{'type':Sequelize[_0xffa8('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xffa8('0x5')],'defaultValue':Sequelize[_0xffa8('0x6')]}}; \ No newline at end of file +var _0x8dae=['lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x8dae,0x10e));var _0xe8da=function(_0x2de114,_0xc8e415){_0x2de114=_0x2de114-0x0;var _0x467c98=_0x8dae[_0x2de114];return _0x467c98;};'use strict';var _=require(_0xe8da('0x0'));var Sequelize=require(_0xe8da('0x1'));module[_0xe8da('0x2')]={'firstName':{'type':Sequelize[_0xe8da('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xe8da('0x3')]},'street':{'type':Sequelize[_0xe8da('0x3')]},'postalCode':{'type':Sequelize[_0xe8da('0x3')]},'city':{'type':Sequelize[_0xe8da('0x3')]},'country':{'type':Sequelize[_0xe8da('0x3')]},'dateOfBirth':{'type':Sequelize[_0xe8da('0x3')]},'description':{'type':Sequelize[_0xe8da('0x4')]},'phone':{'type':Sequelize[_0xe8da('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xe8da('0x3')]},'email':{'type':Sequelize[_0xe8da('0x3')]},'url':{'type':Sequelize[_0xe8da('0x3')]},'facebook':{'type':Sequelize[_0xe8da('0x3')]},'fb_data':{'type':Sequelize[_0xe8da('0x3')]},'twitter':{'type':Sequelize[_0xe8da('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xe8da('0x3')]},'viber':{'type':Sequelize[_0xe8da('0x3')]},'line':{'type':Sequelize[_0xe8da('0x3')]},'wechat':{'type':Sequelize[_0xe8da('0x3')]},'telegram':{'type':Sequelize[_0xe8da('0x3')]},'UserId':{'type':Sequelize[_0xe8da('0x5')]},'priority':{'type':Sequelize[_0xe8da('0x5')](0x2)[_0xe8da('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe8da('0x7')],'defaultValue':Sequelize[_0xe8da('0x8')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 6c87edf..a57fb6c 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 _0x8d37=['error','stack','name','send','index','CmContact','describe','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','offset','sort','where','select','field','color','from','cm_contacts','expr','advancedFilter','parse','forEach','condition','isArray','value','\x20IN\x20?','and','tableAlias','LIKE','\x20LIKE\x20?','\x20>\x20?','\x20<\x20?','map','filter','isNil','isEmpty','ListId','c.ListId\x20IN\x20?','concat','\x20=\x20?','replace','\x27\x27\x27\x27','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','order','DESC','group','c.id','Sequelize','QueryTypes','SELECT','clone','COUNT(*)','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','having','left_join','cm_contact_has_tags','tools_tags','t.id\x20IN\x20?','sequelize','toString','keyBy','count','merge','c.*','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','Tags','split','push','rows','catch','find','params','columnName','displayName','CmCustomField','findAll','cf_','alias','custom','type','values','body','get','mergeWith','tags','CmHopperBlack','info','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','create','join','each','duplicates','$or','findOrCreate','spread','show','Tag','$and','omit','format','cf_%d','pickBy','startsWith','toParam','text','CmHopper','phone','getTags','pick','options','nolimit','setTags','ids','getHoppers','ContactId','includeAll','include','findOne','getHopperFinals','CmHopperFinal','getJscriptySessions','rawAttributes','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','pid','upload','createReadStream','meta','import','User','agent','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','limit','set','json','apply','reject','save','update','then','destroy'];(function(_0x2948cb,_0x31b670){var _0x5ce4c8=function(_0x28aa2f){while(--_0x28aa2f){_0x2948cb['push'](_0x2948cb['shift']());}};_0x5ce4c8(++_0x31b670);}(_0x8d37,0xbc));var _0x78d3=function(_0x596012,_0x2d62d5){_0x596012=_0x596012-0x0;var _0x3edf65=_0x8d37[_0x596012];return _0x3edf65;};'use strict';var pdf=require(_0x78d3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x78d3('0x1'));var zipdir=require(_0x78d3('0x2'));var jsonpatch=require(_0x78d3('0x3'));var rp=require(_0x78d3('0x4'));var moment=require(_0x78d3('0x5'));var BPromise=require(_0x78d3('0x6'));var Mustache=require(_0x78d3('0x7'));var util=require('util');var path=require(_0x78d3('0x8'));var sox=require(_0x78d3('0x9'));var csv=require('to-csv');var ejs=require(_0x78d3('0xa'));var fs=require('fs');var _=require(_0x78d3('0xb'));var squel=require('squel');var crypto=require(_0x78d3('0xc'));var jsforce=require(_0x78d3('0xd'));var deskjs=require(_0x78d3('0xe'));var toCsv=require(_0x78d3('0xf'));var querystring=require(_0x78d3('0x10'));var Papa=require(_0x78d3('0x11'));var Redis=require('ioredis');var authService=require(_0x78d3('0x12'));var qs=require(_0x78d3('0x13'));var hardwareService=require(_0x78d3('0x14'));var logger=require(_0x78d3('0x15'))(_0x78d3('0x16'));var utils=require('../../config/utils');var config=require(_0x78d3('0x17'));var db=require(_0x78d3('0x18'))['db'];config[_0x78d3('0x19')]=_[_0x78d3('0x1a')](config[_0x78d3('0x19')],{'host':_0x78d3('0x1b'),'port':0x18eb});var socket=require(_0x78d3('0x1c'))(new Redis(config['redis']));require(_0x78d3('0x1d'))[_0x78d3('0x1e')](socket);function respondWithStatusCode(_0x151d4a,_0x5b7528){_0x5b7528=_0x5b7528||0xcc;return function(_0x442d41){if(_0x442d41){return _0x151d4a['sendStatus'](_0x5b7528);}return _0x151d4a[_0x78d3('0x1f')](_0x5b7528)['end']();};}function respondWithResult(_0x28152a,_0x5aa7c9){_0x5aa7c9=_0x5aa7c9||0xc8;return function(_0xf0d7fa){if(_0xf0d7fa){return _0x28152a[_0x78d3('0x1f')](_0x5aa7c9)['json'](_0xf0d7fa);}};}function respondWithFilteredResult(_0x55608f,_0x427a87){return function(_0x9fedb1){if(_0x9fedb1){var _0x46473d=_0x9fedb1['count'],_0x481766=_0x427a87['offset'],_0x55e489=_0x427a87['offset']+_0x427a87[_0x78d3('0x20')],_0x4110c6;if(_0x55e489>=_0x46473d){_0x55e489=_0x46473d;_0x4110c6=0xc8;}else{_0x4110c6=0xce;}_0x55608f[_0x78d3('0x1f')](_0x4110c6);return _0x55608f[_0x78d3('0x21')]('Content-Range',_0x481766+'-'+_0x55e489+'/'+_0x46473d)[_0x78d3('0x22')](_0x9fedb1);}return null;};}function patchUpdates(_0x131b3d){return function(_0x4d3227){try{jsonpatch[_0x78d3('0x23')](_0x4d3227,_0x131b3d,!![]);}catch(_0x1055ec){return BPromise[_0x78d3('0x24')](_0x1055ec);}return _0x4d3227[_0x78d3('0x25')]();};}function saveUpdates(_0x43b64a,_0x821ed8){return function(_0x2ac0a1){if(_0x2ac0a1){return _0x2ac0a1[_0x78d3('0x26')](_0x43b64a)[_0x78d3('0x27')](function(_0x4184d7){return _0x4184d7;});}return null;};}function removeEntity(_0x55c490,_0x33175c){return function(_0x484ae6){if(_0x484ae6){return _0x484ae6[_0x78d3('0x28')]()[_0x78d3('0x27')](function(){_0x55c490['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51b236,_0x213c35){return function(_0x577d87){if(!_0x577d87){_0x51b236['sendStatus'](0x194);}return _0x577d87;};}function handleError(_0x1aa479,_0x361803){_0x361803=_0x361803||0x1f4;return function(_0x111489){logger[_0x78d3('0x29')](_0x111489[_0x78d3('0x2a')]);if(_0x111489['name']){delete _0x111489[_0x78d3('0x2b')];}_0x1aa479[_0x78d3('0x1f')](_0x361803)[_0x78d3('0x2c')](_0x111489);};}exports[_0x78d3('0x2d')]=function(_0x18dcd4,_0x4300ea){var _0x291fa8={},_0x3aa051={},_0x17e3b8={'count':0x0,'rows':[]};return db[_0x78d3('0x2e')][_0x78d3('0x2f')]()[_0x78d3('0x27')](function(_0x29f3cc){_0x3aa051[_0x78d3('0x30')]=_['keys'](_0x29f3cc);_0x3aa051[_0x78d3('0x31')]=_[_0x78d3('0x32')](_0x18dcd4[_0x78d3('0x31')]);_0x3aa051[_0x78d3('0x33')]=_[_0x78d3('0x34')](_0x3aa051[_0x78d3('0x30')],_0x3aa051[_0x78d3('0x31')]);_0x291fa8['attributes']=_[_0x78d3('0x34')](_0x3aa051[_0x78d3('0x30')],qs[_0x78d3('0x35')](_0x18dcd4['query'][_0x78d3('0x35')]));_0x291fa8['attributes']=_0x291fa8[_0x78d3('0x36')][_0x78d3('0x37')]?_0x291fa8[_0x78d3('0x36')]:_0x3aa051[_0x78d3('0x30')];if(!_0x18dcd4['query'][_0x78d3('0x38')]('nolimit')){_0x291fa8[_0x78d3('0x20')]=qs['limit'](_0x18dcd4['query'][_0x78d3('0x20')]);_0x291fa8[_0x78d3('0x39')]=qs[_0x78d3('0x39')](_0x18dcd4['query'][_0x78d3('0x39')]);}_0x291fa8['order']=qs[_0x78d3('0x3a')](_0x18dcd4['query'][_0x78d3('0x3a')]);_0x291fa8[_0x78d3('0x3b')]=qs[_0x78d3('0x33')](_['pick'](_0x18dcd4[_0x78d3('0x31')],_0x3aa051[_0x78d3('0x33')]));var _0x2b0ce1=[];var _0x2fd535=squel[_0x78d3('0x3c')]()[_0x78d3('0x3d')]('id')[_0x78d3('0x3d')](_0x78d3('0x2b'))[_0x78d3('0x3d')](_0x78d3('0x3e'))['from']('tools_tags');var _0x1ae136=squel[_0x78d3('0x3c')]()[_0x78d3('0x3f')](_0x78d3('0x40'),'c')[_0x78d3('0x3b')]('c.deletedAt\x20IS\x20NULL');var _0x1e2015=squel[_0x78d3('0x41')]();if(_0x18dcd4[_0x78d3('0x31')][_0x78d3('0x42')]){var _0x22afab=JSON[_0x78d3('0x43')](_0x18dcd4['query']['advancedFilter']);_[_0x78d3('0x32')](_0x22afab)[_0x78d3('0x44')](function(_0x14579d){var _0x3d1c5b=_0x22afab[_0x14579d];switch(_0x3d1c5b[_0x78d3('0x45')]){case'IS':if(_[_0x78d3('0x46')](_0x3d1c5b[_0x78d3('0x47')])&&_0x3d1c5b['value'][_0x78d3('0x37')]>0x1){_0x1e2015['and'](_0x3d1c5b['tableAlias']+'.'+_0x14579d+_0x78d3('0x48'),_0x3d1c5b[_0x78d3('0x47')]);}else{_0x1e2015[_0x78d3('0x49')](_0x3d1c5b[_0x78d3('0x4a')]+'.'+_0x14579d+'\x20=\x20?',_0x3d1c5b[_0x78d3('0x47')][0x0]);}break;case'=':_0x1e2015[_0x78d3('0x49')](_0x3d1c5b['tableAlias']+'.'+_0x14579d+'\x20=\x20?',_0x3d1c5b['value']);break;case _0x78d3('0x4b'):_0x1e2015['and'](_0x3d1c5b[_0x78d3('0x4a')]+'.'+_0x14579d+_0x78d3('0x4c'),'%'+_0x3d1c5b[_0x78d3('0x47')]+'%');break;case'>':_0x1e2015[_0x78d3('0x49')](_0x3d1c5b[_0x78d3('0x4a')]+'.'+_0x14579d+_0x78d3('0x4d'),_0x3d1c5b[_0x78d3('0x47')]);break;case'<':_0x1e2015[_0x78d3('0x49')](_0x3d1c5b[_0x78d3('0x4a')]+'.'+_0x14579d+_0x78d3('0x4e'),_0x3d1c5b['value']);break;}});}else{var _0x3bc56e=_(Object[_0x78d3('0x32')](_0x18dcd4[_0x78d3('0x31')]))[_0x78d3('0x4f')](function(_0x1dbff5){return _0x29f3cc[_0x78d3('0x38')](_0x1dbff5)?_0x1dbff5:undefined;})[_0x78d3('0x50')](function(_0x5ec604){return!_[_0x78d3('0x51')](_0x5ec604);})[_0x78d3('0x47')]();if(!_[_0x78d3('0x52')](_0x3bc56e)){_0x3bc56e[_0x78d3('0x44')](function(_0x489313){if(_0x489313===_0x78d3('0x53')){_0x1ae136['where'](_0x78d3('0x54'),[][_0x78d3('0x55')](_0x18dcd4[_0x78d3('0x31')][_0x489313]));}else{_0x1ae136['where']('c.'+_0x489313+_0x78d3('0x56'),_0x18dcd4['query'][_0x489313]);}});}if(_0x18dcd4[_0x78d3('0x31')][_0x78d3('0x50')]){var _0x2c560d=_0x18dcd4[_0x78d3('0x31')]['filter'][_0x78d3('0x57')]('\x5c','\x5c\x5c')[_0x78d3('0x57')]('\x27\x27',_0x78d3('0x58'));if(qs[_0x78d3('0x59')](_0x2c560d)){_0x1e2015['or'](_0x78d3('0x5a'),_0x2c560d+'%');_0x1e2015['or']('c.phone\x20LIKE\x20?',_0x2c560d+'%');_0x1e2015['or'](_0x78d3('0x5b'),_0x2c560d+'%');_0x1e2015['or'](_0x78d3('0x5c'),_0x2c560d+'%');}else if(qs[_0x78d3('0x5d')](_0x2c560d)){_0x1e2015['or'](_0x78d3('0x5e'),_0x2c560d+'%');}else{_0x1e2015['or'](_0x78d3('0x5e'),_0x2c560d+'%');_0x1e2015['or'](_0x78d3('0x5f'),_0x2c560d+'%');_0x1e2015['or'](_0x78d3('0x60'),_0x2c560d+'%');}}}_0x1ae136[_0x78d3('0x3b')](_0x1e2015);if(_0x291fa8[_0x78d3('0x61')]){_0x291fa8[_0x78d3('0x61')][_0x78d3('0x44')](function(_0x25d300){_0x1ae136['order']('c.'+_0x25d300[0x0],_0x25d300[0x1]===_0x78d3('0x62')?![]:!![]);});}_0x1ae136[_0x78d3('0x63')](_0x78d3('0x64'));var _0x4155e5={'type':db[_0x78d3('0x65')][_0x78d3('0x66')][_0x78d3('0x67')],'raw':!![]};var _0x57ae77=_0x1ae136[_0x78d3('0x68')]()[_0x78d3('0x3d')](_0x78d3('0x69'));if(!_0x18dcd4[_0x78d3('0x31')][_0x78d3('0x42')]){if(_0x18dcd4[_0x78d3('0x31')]['tag']){var _0x178b34=_[_0x78d3('0x46')](_0x18dcd4['query']['tag'])?_0x18dcd4[_0x78d3('0x31')]['tag']:new Array(_0x18dcd4[_0x78d3('0x31')][_0x78d3('0x6a')]);var _0x15d068=squel['expr']();_0x178b34[_0x78d3('0x44')](function(_0x21dccc){_0x15d068['or'](_0x78d3('0x6b'),'%,'+_0x21dccc+',%');});_0x1ae136[_0x78d3('0x6c')](_0x15d068);_0x57ae77[_0x78d3('0x6d')](_0x78d3('0x6e'),'ct','ct.CmContactId\x20=\x20c.id');_0x57ae77[_0x78d3('0x6d')](_0x78d3('0x6f'),'t','t.id\x20=\x20ct.TagId');_0x57ae77['where'](_0x78d3('0x70'),_0x178b34);}}db[_0x78d3('0x71')][_0x78d3('0x31')](_0x2fd535[_0x78d3('0x72')](),_0x4155e5)['then'](function(_0x454680){_0x2b0ce1=_[_0x78d3('0x73')](_0x454680,'id');return db[_0x78d3('0x71')][_0x78d3('0x31')](_0x57ae77[_0x78d3('0x72')](),_0x4155e5);})['then'](function(_0x38109a){_0x17e3b8[_0x78d3('0x74')]=_0x38109a[_0x78d3('0x37')];_0x4155e5=_[_0x78d3('0x75')](_0x4155e5,{'model':db[_0x78d3('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1ae136[_0x78d3('0x3d')](_0x78d3('0x76'));_0x1ae136[_0x78d3('0x3d')](_0x78d3('0x77'),_0x78d3('0x78'));_0x1ae136['left_join'](_0x78d3('0x6e'),'ct',_0x78d3('0x79'));_0x1ae136[_0x78d3('0x6d')](_0x78d3('0x6f'),'t',_0x78d3('0x7a'));if(_0x291fa8[_0x78d3('0x20')]){_0x1ae136[_0x78d3('0x20')](_0x291fa8['limit']);}if(_0x291fa8['offset']){_0x1ae136[_0x78d3('0x39')](_0x291fa8[_0x78d3('0x39')]);}db[_0x78d3('0x71')][_0x78d3('0x31')](_0x1ae136[_0x78d3('0x72')](),_0x4155e5)[_0x78d3('0x27')](function(_0x456793){_0x456793[_0x78d3('0x44')](function(_0x32a9c1){if(_0x32a9c1[_0x78d3('0x78')]){_0x32a9c1[_0x78d3('0x7b')]=[];_0x32a9c1[_0x78d3('0x78')][_0x78d3('0x7c')](',')[_0x78d3('0x44')](function(_0x56a251){_0x32a9c1[_0x78d3('0x7b')][_0x78d3('0x7d')](_0x2b0ce1[_0x56a251]);});}delete _0x32a9c1[_0x78d3('0x78')];});_0x17e3b8[_0x78d3('0x7e')]=_0x456793;return _0x17e3b8;})[_0x78d3('0x27')](respondWithFilteredResult(_0x4300ea,_0x291fa8))[_0x78d3('0x7f')](handleError(_0x4300ea,null));});});};exports[_0x78d3('0x28')]=function(_0x42b201,_0xe08cd5){return db[_0x78d3('0x2e')][_0x78d3('0x80')]({'where':{'id':_0x42b201[_0x78d3('0x81')]['id']}})[_0x78d3('0x27')](handleEntityNotFound(_0xe08cd5,null))[_0x78d3('0x27')](removeEntity(_0xe08cd5,null))['catch'](handleError(_0xe08cd5,null));};exports[_0x78d3('0x2f')]=function(_0x23a179,_0xb7a828){return db[_0x78d3('0x2e')][_0x78d3('0x2f')]()[_0x78d3('0x27')](function(_0x3c957a){for(var _0x5c0b86=0x0;_0x5c0b86\x20?','\x20<\x20?','map','hasOwnProperty','filter','isNil','isEmpty','concat','replace','\x27\x27\x27\x27','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','SELECT','clone','COUNT(*)','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','having','left_join','cm_contact_has_tags','t.id\x20=\x20ct.TagId','t.id\x20IN\x20?','then','keyBy','sequelize','toString','merge','c.*','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ct.CmContactId\x20=\x20c.id','Tags','split','push','catch','destroy','find','params','startsWith','columnName','displayName','CmCustomField','findAll','alias','type','values','body','get','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create'];(function(_0x5b8da7,_0x31be6b){var _0x2a1518=function(_0x426715){while(--_0x426715){_0x5b8da7['push'](_0x5b8da7['shift']());}};_0x2a1518(++_0x31be6b);}(_0xb85f,0x122));var _0xfb85=function(_0x439426,_0x26abe1){_0x439426=_0x439426-0x0;var _0x5950ae=_0xb85f[_0x439426];return _0x5950ae;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfb85('0x0'));var rimraf=require(_0xfb85('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb85('0x2'));var rp=require(_0xfb85('0x3'));var moment=require(_0xfb85('0x4'));var BPromise=require(_0xfb85('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfb85('0x6'));var sox=require(_0xfb85('0x7'));var csv=require(_0xfb85('0x8'));var ejs=require(_0xfb85('0x9'));var fs=require('fs');var _=require(_0xfb85('0xa'));var squel=require(_0xfb85('0xb'));var crypto=require('crypto');var jsforce=require(_0xfb85('0xc'));var deskjs=require(_0xfb85('0xd'));var toCsv=require(_0xfb85('0x8'));var querystring=require(_0xfb85('0xe'));var Papa=require('papaparse');var Redis=require(_0xfb85('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfb85('0x10'));var hardwareService=require(_0xfb85('0x11'));var logger=require(_0xfb85('0x12'))(_0xfb85('0x13'));var utils=require(_0xfb85('0x14'));var config=require('../../config/environment');var db=require(_0xfb85('0x15'))['db'];config[_0xfb85('0x16')]=_[_0xfb85('0x17')](config[_0xfb85('0x16')],{'host':_0xfb85('0x18'),'port':0x18eb});var socket=require(_0xfb85('0x19'))(new Redis(config[_0xfb85('0x16')]));require(_0xfb85('0x1a'))[_0xfb85('0x1b')](socket);function respondWithStatusCode(_0x3476ef,_0x28c396){_0x28c396=_0x28c396||0xcc;return function(_0x55e4e2){if(_0x55e4e2){return _0x3476ef[_0xfb85('0x1c')](_0x28c396);}return _0x3476ef[_0xfb85('0x1d')](_0x28c396)['end']();};}function respondWithResult(_0x355162,_0x42aff6){_0x42aff6=_0x42aff6||0xc8;return function(_0x1afeb6){if(_0x1afeb6){return _0x355162[_0xfb85('0x1d')](_0x42aff6)['json'](_0x1afeb6);}};}function respondWithFilteredResult(_0x1e7f60,_0x315bd9){return function(_0x4bc5a7){if(_0x4bc5a7){var _0x4e8fc3=_0x4bc5a7[_0xfb85('0x1e')],_0x46ae53=_0x315bd9[_0xfb85('0x1f')],_0x50a7d7=_0x315bd9[_0xfb85('0x1f')]+_0x315bd9[_0xfb85('0x20')],_0x1c3a2c;if(_0x50a7d7>=_0x4e8fc3){_0x50a7d7=_0x4e8fc3;_0x1c3a2c=0xc8;}else{_0x1c3a2c=0xce;}_0x1e7f60[_0xfb85('0x1d')](_0x1c3a2c);return _0x1e7f60[_0xfb85('0x21')](_0xfb85('0x22'),_0x46ae53+'-'+_0x50a7d7+'/'+_0x4e8fc3)[_0xfb85('0x23')](_0x4bc5a7);}return null;};}function patchUpdates(_0x29063f){return function(_0x232123){try{jsonpatch[_0xfb85('0x24')](_0x232123,_0x29063f,!![]);}catch(_0x2081de){return BPromise[_0xfb85('0x25')](_0x2081de);}return _0x232123[_0xfb85('0x26')]();};}function saveUpdates(_0x261171,_0x521161){return function(_0x188fbd){if(_0x188fbd){return _0x188fbd[_0xfb85('0x27')](_0x261171)['then'](function(_0x54f0a1){return _0x54f0a1;});}return null;};}function removeEntity(_0x32bca1,_0x1e8d53){return function(_0x1e0971){if(_0x1e0971){return _0x1e0971['destroy']()['then'](function(){_0x32bca1[_0xfb85('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x494cfb,_0x214cc6){return function(_0x1d6733){if(!_0x1d6733){_0x494cfb[_0xfb85('0x1c')](0x194);}return _0x1d6733;};}function handleError(_0x5374ef,_0x5b1df6){_0x5b1df6=_0x5b1df6||0x1f4;return function(_0x5d976e){logger['error'](_0x5d976e['stack']);if(_0x5d976e[_0xfb85('0x28')]){delete _0x5d976e['name'];}_0x5374ef['status'](_0x5b1df6)[_0xfb85('0x29')](_0x5d976e);};}exports[_0xfb85('0x2a')]=function(_0x5e38e2,_0x2205b4){var _0x1427a9={},_0x36832e={},_0x50bb52={'count':0x0,'rows':[]};return db[_0xfb85('0x2b')][_0xfb85('0x2c')]()['then'](function(_0x56fa4e){_0x36832e[_0xfb85('0x2d')]=_[_0xfb85('0x2e')](_0x56fa4e);_0x36832e['query']=_[_0xfb85('0x2e')](_0x5e38e2[_0xfb85('0x2f')]);_0x36832e[_0xfb85('0x30')]=_[_0xfb85('0x31')](_0x36832e[_0xfb85('0x2d')],_0x36832e[_0xfb85('0x2f')]);_0x1427a9[_0xfb85('0x32')]=_[_0xfb85('0x31')](_0x36832e[_0xfb85('0x2d')],qs[_0xfb85('0x33')](_0x5e38e2['query'][_0xfb85('0x33')]));_0x1427a9[_0xfb85('0x32')]=_0x1427a9[_0xfb85('0x32')][_0xfb85('0x34')]?_0x1427a9['attributes']:_0x36832e[_0xfb85('0x2d')];if(!_0x5e38e2['query']['hasOwnProperty']('nolimit')){_0x1427a9[_0xfb85('0x20')]=qs[_0xfb85('0x20')](_0x5e38e2[_0xfb85('0x2f')][_0xfb85('0x20')]);_0x1427a9[_0xfb85('0x1f')]=qs['offset'](_0x5e38e2[_0xfb85('0x2f')][_0xfb85('0x1f')]);}_0x1427a9[_0xfb85('0x35')]=qs[_0xfb85('0x36')](_0x5e38e2[_0xfb85('0x2f')][_0xfb85('0x36')]);_0x1427a9[_0xfb85('0x37')]=qs[_0xfb85('0x30')](_['pick'](_0x5e38e2[_0xfb85('0x2f')],_0x36832e[_0xfb85('0x30')]));var _0x4d5451=[];var _0x2b1dbe=squel[_0xfb85('0x38')]()[_0xfb85('0x39')]('id')[_0xfb85('0x39')]('name')[_0xfb85('0x39')](_0xfb85('0x3a'))[_0xfb85('0x3b')](_0xfb85('0x3c'));var _0x2b1afc=squel[_0xfb85('0x38')]()[_0xfb85('0x3b')](_0xfb85('0x3d'),'c')[_0xfb85('0x37')](_0xfb85('0x3e'));var _0x452f84=squel[_0xfb85('0x3f')]();if(_0x5e38e2[_0xfb85('0x2f')][_0xfb85('0x40')]){var _0x3e21b7=JSON[_0xfb85('0x41')](_0x5e38e2[_0xfb85('0x2f')][_0xfb85('0x40')]);_[_0xfb85('0x2e')](_0x3e21b7)[_0xfb85('0x42')](function(_0x41efb7){var _0x281e2a=_0x3e21b7[_0x41efb7];switch(_0x281e2a[_0xfb85('0x43')]){case'IS':if(_[_0xfb85('0x44')](_0x281e2a[_0xfb85('0x45')])&&_0x281e2a[_0xfb85('0x45')][_0xfb85('0x34')]>0x1){_0x452f84[_0xfb85('0x46')](_0x281e2a[_0xfb85('0x47')]+'.'+_0x41efb7+_0xfb85('0x48'),_0x281e2a[_0xfb85('0x45')]);}else{_0x452f84['and'](_0x281e2a[_0xfb85('0x47')]+'.'+_0x41efb7+_0xfb85('0x49'),_0x281e2a['value'][0x0]);}break;case'=':_0x452f84[_0xfb85('0x46')](_0x281e2a[_0xfb85('0x47')]+'.'+_0x41efb7+_0xfb85('0x49'),_0x281e2a[_0xfb85('0x45')]);break;case _0xfb85('0x4a'):_0x452f84['and'](_0x281e2a[_0xfb85('0x47')]+'.'+_0x41efb7+'\x20LIKE\x20?','%'+_0x281e2a[_0xfb85('0x45')]+'%');break;case'>':_0x452f84[_0xfb85('0x46')](_0x281e2a[_0xfb85('0x47')]+'.'+_0x41efb7+_0xfb85('0x4b'),_0x281e2a[_0xfb85('0x45')]);break;case'<':_0x452f84['and'](_0x281e2a[_0xfb85('0x47')]+'.'+_0x41efb7+_0xfb85('0x4c'),_0x281e2a[_0xfb85('0x45')]);break;}});}else{var _0x5b6662=_(Object[_0xfb85('0x2e')](_0x5e38e2[_0xfb85('0x2f')]))[_0xfb85('0x4d')](function(_0x3634f4){return _0x56fa4e[_0xfb85('0x4e')](_0x3634f4)?_0x3634f4:undefined;})[_0xfb85('0x4f')](function(_0x35a89b){return!_[_0xfb85('0x50')](_0x35a89b);})[_0xfb85('0x45')]();if(!_[_0xfb85('0x51')](_0x5b6662)){_0x5b6662[_0xfb85('0x42')](function(_0x518d95){if(_0x518d95==='ListId'){_0x2b1afc[_0xfb85('0x37')]('c.ListId\x20IN\x20?',[][_0xfb85('0x52')](_0x5e38e2[_0xfb85('0x2f')][_0x518d95]));}else{_0x2b1afc[_0xfb85('0x37')]('c.'+_0x518d95+'\x20=\x20?',_0x5e38e2[_0xfb85('0x2f')][_0x518d95]);}});}if(_0x5e38e2[_0xfb85('0x2f')]['filter']){var _0x13f12a=_0x5e38e2[_0xfb85('0x2f')][_0xfb85('0x4f')][_0xfb85('0x53')]('\x5c','\x5c\x5c')[_0xfb85('0x53')]('\x27\x27',_0xfb85('0x54'));if(qs[_0xfb85('0x55')](_0x13f12a)){_0x452f84['or']('c.id\x20LIKE\x20?',_0x13f12a+'%');_0x452f84['or'](_0xfb85('0x56'),_0x13f12a+'%');_0x452f84['or'](_0xfb85('0x57'),_0x13f12a+'%');_0x452f84['or'](_0xfb85('0x58'),_0x13f12a+'%');}else if(qs[_0xfb85('0x59')](_0x13f12a)){_0x452f84['or'](_0xfb85('0x5a'),_0x13f12a+'%');}else{_0x452f84['or'](_0xfb85('0x5a'),_0x13f12a+'%');_0x452f84['or']('c.firstName\x20LIKE\x20?',_0x13f12a+'%');_0x452f84['or'](_0xfb85('0x5b'),_0x13f12a+'%');}}}_0x2b1afc[_0xfb85('0x37')](_0x452f84);if(_0x1427a9[_0xfb85('0x35')]){_0x1427a9[_0xfb85('0x35')][_0xfb85('0x42')](function(_0xc1255c){_0x2b1afc[_0xfb85('0x35')]('c.'+_0xc1255c[0x0],_0xc1255c[0x1]==='DESC'?![]:!![]);});}_0x2b1afc['group'](_0xfb85('0x5c'));var _0x3e181d={'type':db[_0xfb85('0x5d')][_0xfb85('0x5e')][_0xfb85('0x5f')],'raw':!![]};var _0x4cd6d9=_0x2b1afc[_0xfb85('0x60')]()['field'](_0xfb85('0x61'));if(!_0x5e38e2[_0xfb85('0x2f')][_0xfb85('0x40')]){if(_0x5e38e2['query'][_0xfb85('0x62')]){var _0x2aae1e=_[_0xfb85('0x44')](_0x5e38e2[_0xfb85('0x2f')][_0xfb85('0x62')])?_0x5e38e2['query']['tag']:new Array(_0x5e38e2[_0xfb85('0x2f')][_0xfb85('0x62')]);var _0x1d4d91=squel['expr']();_0x2aae1e[_0xfb85('0x42')](function(_0x4c58ef){_0x1d4d91['or'](_0xfb85('0x63'),'%,'+_0x4c58ef+',%');});_0x2b1afc[_0xfb85('0x64')](_0x1d4d91);_0x4cd6d9[_0xfb85('0x65')](_0xfb85('0x66'),'ct','ct.CmContactId\x20=\x20c.id');_0x4cd6d9[_0xfb85('0x65')](_0xfb85('0x3c'),'t',_0xfb85('0x67'));_0x4cd6d9['where'](_0xfb85('0x68'),_0x2aae1e);}}db['sequelize'][_0xfb85('0x2f')](_0x2b1dbe['toString'](),_0x3e181d)[_0xfb85('0x69')](function(_0x423541){_0x4d5451=_[_0xfb85('0x6a')](_0x423541,'id');return db[_0xfb85('0x6b')][_0xfb85('0x2f')](_0x4cd6d9[_0xfb85('0x6c')](),_0x3e181d);})['then'](function(_0x4e27ff){_0x50bb52[_0xfb85('0x1e')]=_0x4e27ff[_0xfb85('0x34')];_0x3e181d=_[_0xfb85('0x6d')](_0x3e181d,{'model':db[_0xfb85('0x2b')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x2b1afc[_0xfb85('0x39')](_0xfb85('0x6e'));_0x2b1afc['field'](_0xfb85('0x6f'),_0xfb85('0x70'));_0x2b1afc[_0xfb85('0x65')]('cm_contact_has_tags','ct',_0xfb85('0x71'));_0x2b1afc[_0xfb85('0x65')](_0xfb85('0x3c'),'t',_0xfb85('0x67'));if(_0x1427a9[_0xfb85('0x20')]){_0x2b1afc[_0xfb85('0x20')](_0x1427a9[_0xfb85('0x20')]);}if(_0x1427a9[_0xfb85('0x1f')]){_0x2b1afc[_0xfb85('0x1f')](_0x1427a9['offset']);}db[_0xfb85('0x6b')][_0xfb85('0x2f')](_0x2b1afc[_0xfb85('0x6c')](),_0x3e181d)[_0xfb85('0x69')](function(_0x5c36e0){_0x5c36e0[_0xfb85('0x42')](function(_0x48bb68){if(_0x48bb68[_0xfb85('0x70')]){_0x48bb68[_0xfb85('0x72')]=[];_0x48bb68['TagIds'][_0xfb85('0x73')](',')[_0xfb85('0x42')](function(_0x38a535){_0x48bb68[_0xfb85('0x72')][_0xfb85('0x74')](_0x4d5451[_0x38a535]);});}delete _0x48bb68[_0xfb85('0x70')];});_0x50bb52['rows']=_0x5c36e0;return _0x50bb52;})[_0xfb85('0x69')](respondWithFilteredResult(_0x2205b4,_0x1427a9))[_0xfb85('0x75')](handleError(_0x2205b4,null));});});};exports[_0xfb85('0x76')]=function(_0xe2c087,_0x244957){return db['CmContact'][_0xfb85('0x77')]({'where':{'id':_0xe2c087[_0xfb85('0x78')]['id']}})['then'](handleEntityNotFound(_0x244957,null))[_0xfb85('0x69')](removeEntity(_0x244957,null))[_0xfb85('0x75')](handleError(_0x244957,null));};exports[_0xfb85('0x2c')]=function(_0x202e13,_0x49bc9d){return db[_0xfb85('0x2b')][_0xfb85('0x2c')]()[_0xfb85('0x69')](function(_0x4c8bcc){for(var _0x314f9c=0x0;_0x314f9c{}\s\\|]/g,'-');_0x225e33(null,util[_0xd7df('0x23')]('%s-%s%s',path[_0xd7df('0x24')](_0x5aecbb['originalname'],path[_0xd7df('0x25')](_0x5aecbb[_0xd7df('0x21')])),Date[_0xd7df('0x26')](),path[_0xd7df('0x25')](_0x5aecbb[_0xd7df('0x21')])));}})});router[_0xd7df('0x18')](_0xd7df('0x27'),upload['single']('file'),controller[_0xd7df('0x28')]);var upload=multer({'storage':multer[_0xd7df('0x1e')]({'destination':function(_0x26047f,_0x459f11,_0x13f190){_0x13f190(null,path[_0xd7df('0x1f')](config[_0xd7df('0x20')],_0xd7df('0x29')));},'filename':function(_0x163904,_0x5c4d17,_0xe53f53){_0x5c4d17[_0xd7df('0x21')]=_0x5c4d17[_0xd7df('0x21')][_0xd7df('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xe53f53(null,util[_0xd7df('0x23')](_0xd7df('0x2a'),path[_0xd7df('0x24')](_0x5c4d17[_0xd7df('0x21')],path['extname'](_0x5c4d17['originalname'])),Date['now'](),path['extname'](_0x5c4d17['originalname'])));}})});router[_0xd7df('0x18')]('/upload',upload[_0xd7df('0x2b')](_0xd7df('0x2c')),controller['upload']);router[_0xd7df('0x18')](_0xd7df('0x2d'),auth['isAuthenticated'](),controller[_0xd7df('0x2e')]);router[_0xd7df('0x2f')](_0xd7df('0xf'),auth[_0xd7df('0xb')](),controller[_0xd7df('0x30')]);router[_0xd7df('0x31')]('/:id',auth[_0xd7df('0xb')](),controller[_0xd7df('0x32')]);module[_0xd7df('0x33')]=router; \ No newline at end of file +var _0xa630=['%s-%s%s','now','extname','/csv','single','file','server/files/tmp','basename','upload','/upload/:id','import','update','delete','destroy','multer','util','express','../../components/auth/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getJscriptySessions','post','/merge','merge','bulkCreate','setTags','diskStorage','join','originalname','replace','format'];(function(_0x47cd19,_0x32c8b6){var _0x13f174=function(_0x496625){while(--_0x496625){_0x47cd19['push'](_0x47cd19['shift']());}};_0x13f174(++_0x32c8b6);}(_0xa630,0xbe));var _0x0a63=function(_0x1d6874,_0x4d2593){_0x1d6874=_0x1d6874-0x0;var _0x1aed79=_0xa630[_0x1d6874];return _0x1aed79;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var auth=require(_0x0a63('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0a63('0x4'));var controller=require(_0x0a63('0x5'));router[_0x0a63('0x6')]('/',auth[_0x0a63('0x7')](),controller[_0x0a63('0x8')]);router['get'](_0x0a63('0x9'),auth[_0x0a63('0x7')](),controller[_0x0a63('0xa')]);router[_0x0a63('0x6')](_0x0a63('0xb'),auth[_0x0a63('0x7')](),controller['show']);router[_0x0a63('0x6')](_0x0a63('0xc'),auth[_0x0a63('0x7')](),controller[_0x0a63('0xd')]);router[_0x0a63('0x6')](_0x0a63('0xe'),auth[_0x0a63('0x7')](),controller[_0x0a63('0xf')]);router[_0x0a63('0x6')](_0x0a63('0x10'),auth['isAuthenticated'](),controller[_0x0a63('0x11')]);router[_0x0a63('0x6')](_0x0a63('0x12'),auth[_0x0a63('0x7')](),controller['getHopperFinals']);router[_0x0a63('0x6')]('/:id/jscripty_sessions',auth[_0x0a63('0x7')](),controller[_0x0a63('0x13')]);router[_0x0a63('0x14')](_0x0a63('0x15'),auth[_0x0a63('0x7')](),controller[_0x0a63('0x16')]);router[_0x0a63('0x14')]('/',auth[_0x0a63('0x7')](),controller['create']);router[_0x0a63('0x14')]('/create_many',auth[_0x0a63('0x7')](),controller[_0x0a63('0x17')]);router[_0x0a63('0x14')](_0x0a63('0xc'),auth[_0x0a63('0x7')](),controller[_0x0a63('0x18')]);var upload=multer({'storage':multer[_0x0a63('0x19')]({'destination':function(_0x374c52,_0x2fd06c,_0x3cc74d){_0x3cc74d(null,path[_0x0a63('0x1a')](config['root'],'server/files/tmp'));},'filename':function(_0x7b2ccd,_0x586190,_0x2fc87c){_0x586190['originalname']=_0x586190[_0x0a63('0x1b')][_0x0a63('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2fc87c(null,util[_0x0a63('0x1d')](_0x0a63('0x1e'),path['basename'](_0x586190[_0x0a63('0x1b')],path['extname'](_0x586190[_0x0a63('0x1b')])),Date[_0x0a63('0x1f')](),path[_0x0a63('0x20')](_0x586190[_0x0a63('0x1b')])));}})});router[_0x0a63('0x14')](_0x0a63('0x21'),upload[_0x0a63('0x22')](_0x0a63('0x23')),controller['uploadCsv']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x55fb70,_0x4c8637,_0xeacfc9){_0xeacfc9(null,path['join'](config['root'],_0x0a63('0x24')));},'filename':function(_0x1d5448,_0x362d6a,_0x2e2526){_0x362d6a['originalname']=_0x362d6a[_0x0a63('0x1b')][_0x0a63('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2e2526(null,util[_0x0a63('0x1d')]('%s-%s%s',path[_0x0a63('0x25')](_0x362d6a[_0x0a63('0x1b')],path[_0x0a63('0x20')](_0x362d6a[_0x0a63('0x1b')])),Date[_0x0a63('0x1f')](),path[_0x0a63('0x20')](_0x362d6a[_0x0a63('0x1b')])));}})});router[_0x0a63('0x14')]('/upload',upload[_0x0a63('0x22')]('file'),controller[_0x0a63('0x26')]);router[_0x0a63('0x14')](_0x0a63('0x27'),auth[_0x0a63('0x7')](),controller[_0x0a63('0x28')]);router['put'](_0x0a63('0xb'),auth[_0x0a63('0x7')](),controller[_0x0a63('0x29')]);router[_0x0a63('0x2a')]('/:id',auth[_0x0a63('0x7')](),controller[_0x0a63('0x2b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 4130238..2c53e04 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 _0x9abd=['type','select','values','isArray','setDataValue','stringify','BOOLEAN','sequelize','exports','VIRTUAL','getDataValue','alias','STRING','name'];(function(_0x55ced3,_0x4e59e9){var _0x4705bd=function(_0x239073){while(--_0x239073){_0x55ced3['push'](_0x55ced3['shift']());}};_0x4705bd(++_0x4e59e9);}(_0x9abd,0xa1));var _0xd9ab=function(_0x4cde81,_0x465ae5){_0x4cde81=_0x4cde81-0x0;var _0x123ee4=_0x9abd[_0x4cde81];return _0x123ee4;};'use strict';var Sequelize=require(_0xd9ab('0x0'));var _=require('lodash');module[_0xd9ab('0x1')]={'name':{'type':Sequelize[_0xd9ab('0x2')],'get':function(_0x415c1e){return this[_0xd9ab('0x3')](_0xd9ab('0x4'));}},'alias':{'type':Sequelize[_0xd9ab('0x5')],'allowNull':![],'set':function(_0x1fdf52){this['setDataValue'](_0xd9ab('0x4'),_0x1fdf52?_0x1fdf52:this[_0xd9ab('0x3')](_0xd9ab('0x6')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this['getDataValue'](_0xd9ab('0x7'))===_0xd9ab('0x8')){return JSON['parse'](this[_0xd9ab('0x3')](_0xd9ab('0x9')));}else{return this[_0xd9ab('0x3')](_0xd9ab('0x9'));}},'set':function(_0x3c7d0e){if(Array[_0xd9ab('0xa')](_0x3c7d0e)){this[_0xd9ab('0xb')](_0xd9ab('0x9'),JSON[_0xd9ab('0xc')](_0x3c7d0e));}else{this['setDataValue'](_0xd9ab('0x9'),_0x3c7d0e);}}},'required':{'type':Sequelize[_0xd9ab('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x63b8=['BOOLEAN','sequelize','lodash','alias','STRING','setDataValue','getDataValue','name','long','type','values','isArray','stringify'];(function(_0x3d0553,_0x3068ee){var _0x1c1ae4=function(_0x42afd3){while(--_0x42afd3){_0x3d0553['push'](_0x3d0553['shift']());}};_0x1c1ae4(++_0x3068ee);}(_0x63b8,0x69));var _0x863b=function(_0x348fd7,_0x3cde81){_0x348fd7=_0x348fd7-0x0;var _0x4ffb7f=_0x63b8[_0x348fd7];return _0x4ffb7f;};'use strict';var Sequelize=require(_0x863b('0x0'));var _=require(_0x863b('0x1'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xbbf8d7){return this['getDataValue'](_0x863b('0x2'));}},'alias':{'type':Sequelize[_0x863b('0x3')],'allowNull':![],'set':function(_0x2fc6ad){this[_0x863b('0x4')](_0x863b('0x2'),_0x2fc6ad?_0x2fc6ad:this[_0x863b('0x5')](_0x863b('0x6')));}},'type':{'type':Sequelize[_0x863b('0x3')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x863b('0x7')),'get':function(){if(this[_0x863b('0x5')](_0x863b('0x8'))==='select'){return JSON['parse'](this[_0x863b('0x5')](_0x863b('0x9')));}else{return this[_0x863b('0x5')](_0x863b('0x9'));}},'set':function(_0x53c089){if(Array[_0x863b('0xa')](_0x53c089)){this[_0x863b('0x4')]('values',JSON[_0x863b('0xb')](_0x53c089));}else{this['setDataValue']('values',_0x53c089);}}},'required':{'type':Sequelize[_0x863b('0xc')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index f857cac..4484fbc 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 _0x85a5=['where','filter','merge','map','key','VIRTUAL','field','options','include','findAll','rows','catch','show','includeAll','body','find','params','create','sequelize','transaction','Sequelize','text','type','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','CmCustomField','rawAttributes','model','differenceBy','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort'];(function(_0x3a636f,_0x51b4db){var _0x168c90=function(_0x7447e){while(--_0x7447e){_0x3a636f['push'](_0x3a636f['shift']());}};_0x168c90(++_0x51b4db);}(_0x85a5,0x121));var _0x585a=function(_0x4eb3ec,_0x51b871){_0x4eb3ec=_0x4eb3ec-0x0;var _0x1a3de8=_0x85a5[_0x4eb3ec];return _0x1a3de8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x585a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x585a('0x1'));var moment=require(_0x585a('0x2'));var BPromise=require(_0x585a('0x3'));var Mustache=require(_0x585a('0x4'));var util=require(_0x585a('0x5'));var path=require(_0x585a('0x6'));var sox=require(_0x585a('0x7'));var csv=require(_0x585a('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x585a('0x9'));var squel=require(_0x585a('0xa'));var crypto=require(_0x585a('0xb'));var jsforce=require(_0x585a('0xc'));var deskjs=require(_0x585a('0xd'));var toCsv=require(_0x585a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x585a('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x585a('0xf'));var logger=require('../../config/logger')(_0x585a('0x10'));var utils=require(_0x585a('0x11'));var config=require(_0x585a('0x12'));var db=require(_0x585a('0x13'))['db'];function respondWithStatusCode(_0x27683a,_0x4df4aa){_0x4df4aa=_0x4df4aa||0xcc;return function(_0x5a17aa){if(_0x5a17aa){return _0x27683a[_0x585a('0x14')](_0x4df4aa);}return _0x27683a[_0x585a('0x15')](_0x4df4aa)['end']();};}function respondWithResult(_0x25d492,_0x3856ca){_0x3856ca=_0x3856ca||0xc8;return function(_0x37905f){if(_0x37905f){return _0x25d492[_0x585a('0x15')](_0x3856ca)[_0x585a('0x16')](_0x37905f);}};}function respondWithFilteredResult(_0x4e7c03,_0x4008d0){return function(_0x282054){if(_0x282054){var _0x486048=_0x282054[_0x585a('0x17')],_0x561c87=_0x4008d0[_0x585a('0x18')],_0x2fbb27=_0x4008d0[_0x585a('0x18')]+_0x4008d0[_0x585a('0x19')],_0x521d73;if(_0x2fbb27>=_0x486048){_0x2fbb27=_0x486048;_0x521d73=0xc8;}else{_0x521d73=0xce;}_0x4e7c03[_0x585a('0x15')](_0x521d73);return _0x4e7c03[_0x585a('0x1a')](_0x585a('0x1b'),_0x561c87+'-'+_0x2fbb27+'/'+_0x486048)[_0x585a('0x16')](_0x282054);}return null;};}function patchUpdates(_0x5e1c99){return function(_0x3c1386){try{jsonpatch['apply'](_0x3c1386,_0x5e1c99,!![]);}catch(_0x24a23f){return BPromise[_0x585a('0x1c')](_0x24a23f);}return _0x3c1386['save']();};}function saveUpdates(_0x42bbd1,_0xc1cc59){return function(_0x3fc016){if(_0x3fc016){return _0x3fc016[_0x585a('0x1d')](_0x42bbd1)[_0x585a('0x1e')](function(_0x312784){return _0x312784;});}return null;};}function removeEntity(_0x314b9a,_0x392766){return function(_0x17cfdb){if(_0x17cfdb){return _0x17cfdb[_0x585a('0x1f')]()['then'](function(){_0x314b9a[_0x585a('0x15')](0xcc)[_0x585a('0x20')]();});}};}function handleEntityNotFound(_0xe64541,_0xadb9e2){return function(_0x1fc13d){if(!_0x1fc13d){_0xe64541[_0x585a('0x14')](0x194);}return _0x1fc13d;};}function handleError(_0x18412c,_0xc3a384){_0xc3a384=_0xc3a384||0x1f4;return function(_0x217662){logger[_0x585a('0x21')](_0x217662[_0x585a('0x22')]);if(_0x217662[_0x585a('0x23')]){delete _0x217662[_0x585a('0x23')];}_0x18412c[_0x585a('0x15')](_0xc3a384)[_0x585a('0x24')](_0x217662);};}exports[_0x585a('0x25')]=function(_0x1bc645,_0x1dde32){var _0x3445fd={},_0x4a991e={},_0x18f783={'count':0x0,'rows':[]};var _0x5c4e7a=db[_0x585a('0x26')][_0x585a('0x27')];_0x4a991e[_0x585a('0x28')]=_[_0x585a('0x29')](_[_0x585a('0x2a')](_0x5c4e7a),[_0x585a('0x23')]);_0x4a991e[_0x585a('0x2b')]=_[_0x585a('0x2a')](_0x1bc645['query']);_0x4a991e[_0x585a('0x2c')]=_[_0x585a('0x2d')](_0x4a991e[_0x585a('0x28')],_0x4a991e[_0x585a('0x2b')]);_0x3445fd[_0x585a('0x2e')]=_['intersection'](_0x4a991e[_0x585a('0x28')],qs['fields'](_0x1bc645[_0x585a('0x2b')][_0x585a('0x2f')]));_0x3445fd['attributes']=_0x3445fd[_0x585a('0x2e')][_0x585a('0x30')]?_0x3445fd[_0x585a('0x2e')]:_0x4a991e['model'];if(!_0x1bc645[_0x585a('0x2b')][_0x585a('0x31')]('nolimit')){_0x3445fd['limit']=qs['limit'](_0x1bc645[_0x585a('0x2b')][_0x585a('0x19')]);_0x3445fd[_0x585a('0x18')]=qs[_0x585a('0x18')](_0x1bc645[_0x585a('0x2b')]['offset']);}_0x3445fd['order']=qs[_0x585a('0x32')](_0x1bc645[_0x585a('0x2b')][_0x585a('0x32')]);_0x3445fd[_0x585a('0x33')]=qs['filters'](_['pick'](_0x1bc645[_0x585a('0x2b')],_0x4a991e[_0x585a('0x2c')]));if(_0x1bc645['query'][_0x585a('0x34')]){_0x3445fd[_0x585a('0x33')]=_[_0x585a('0x35')](_0x3445fd[_0x585a('0x33')],{'$or':_[_0x585a('0x36')](_0x5c4e7a,function(_0x4226de){if(_0x4226de['type'][_0x585a('0x37')]!==_0x585a('0x38')){var _0x4afba9={};_0x4afba9[_0x4226de[_0x585a('0x39')]]={'$like':'%'+_0x1bc645[_0x585a('0x2b')][_0x585a('0x34')]+'%'};return _0x4afba9;}})});}_0x3445fd=_[_0x585a('0x35')]({},_0x3445fd,_0x1bc645[_0x585a('0x3a')]);var _0x112b14={'where':_0x3445fd[_0x585a('0x33')]};return db[_0x585a('0x26')][_0x585a('0x17')](_0x112b14)[_0x585a('0x1e')](function(_0x47d94c){_0x18f783[_0x585a('0x17')]=_0x47d94c;if(_0x1bc645[_0x585a('0x2b')]['includeAll']){_0x3445fd[_0x585a('0x3b')]=[{'all':!![]}];}return db[_0x585a('0x26')][_0x585a('0x3c')](_0x3445fd);})[_0x585a('0x1e')](function(_0x43f0cb){_0x18f783[_0x585a('0x3d')]=_0x43f0cb;return _0x18f783;})[_0x585a('0x1e')](respondWithFilteredResult(_0x1dde32,_0x3445fd))[_0x585a('0x3e')](handleError(_0x1dde32,null));};exports[_0x585a('0x3f')]=function(_0xaa5d28,_0x37adeb){var _0x539349={'raw':!![],'where':{'id':_0xaa5d28['params']['id']}},_0xd0a0f3={};_0xd0a0f3['model']=_[_0x585a('0x2a')](db[_0x585a('0x26')][_0x585a('0x27')]);_0xd0a0f3[_0x585a('0x2b')]=_[_0x585a('0x2a')](_0xaa5d28[_0x585a('0x2b')]);_0xd0a0f3['filters']=_[_0x585a('0x2d')](_0xd0a0f3['model'],_0xd0a0f3[_0x585a('0x2b')]);_0x539349[_0x585a('0x2e')]=_[_0x585a('0x2d')](_0xd0a0f3[_0x585a('0x28')],qs[_0x585a('0x2f')](_0xaa5d28['query'][_0x585a('0x2f')]));_0x539349[_0x585a('0x2e')]=_0x539349[_0x585a('0x2e')][_0x585a('0x30')]?_0x539349[_0x585a('0x2e')]:_0xd0a0f3[_0x585a('0x28')];if(_0xaa5d28[_0x585a('0x2b')][_0x585a('0x40')]){_0x539349[_0x585a('0x3b')]=[{'all':!![]}];}_0x539349=_[_0x585a('0x35')]({},_0x539349,_0xaa5d28[_0x585a('0x3a')]);return db[_0x585a('0x26')]['find'](_0x539349)[_0x585a('0x1e')](handleEntityNotFound(_0x37adeb,null))[_0x585a('0x1e')](respondWithResult(_0x37adeb,null))['catch'](handleError(_0x37adeb,null));};exports[_0x585a('0x1d')]=function(_0x7b6ea6,_0x421b9e){if(_0x7b6ea6[_0x585a('0x41')]['id']){delete _0x7b6ea6[_0x585a('0x41')]['id'];}return db[_0x585a('0x26')][_0x585a('0x42')]({'where':{'id':_0x7b6ea6[_0x585a('0x43')]['id']}})[_0x585a('0x1e')](handleEntityNotFound(_0x421b9e,null))[_0x585a('0x1e')](saveUpdates(_0x7b6ea6['body'],null))[_0x585a('0x1e')](respondWithResult(_0x421b9e,null))[_0x585a('0x3e')](handleError(_0x421b9e,null));};exports['destroy']=function(_0x373b72,_0x2c4a55){return db[_0x585a('0x26')][_0x585a('0x42')]({'where':{'id':_0x373b72[_0x585a('0x43')]['id']}})['then'](handleEntityNotFound(_0x2c4a55,null))[_0x585a('0x1e')](removeEntity(_0x2c4a55,null))[_0x585a('0x3e')](handleError(_0x2c4a55,null));};exports[_0x585a('0x44')]=function(_0x591c2b,_0x5ec40d){var _0x1a2f4c;return db[_0x585a('0x45')][_0x585a('0x46')](function(_0x5bf88f){return db[_0x585a('0x26')][_0x585a('0x44')](_0x591c2b[_0x585a('0x41')],{'transaction':_0x5bf88f})[_0x585a('0x1e')](function(_0x2d973b){_0x1a2f4c=_0x2d973b;var _0x7771ca={'type':db[_0x585a('0x47')]['TEXT'],'transaction':_0x5bf88f};switch(_0x591c2b[_0x585a('0x41')]['type']){case _0x585a('0x48'):_0x7771ca[_0x585a('0x49')]=db[_0x585a('0x47')][_0x585a('0x4a')];break;case _0x585a('0x4b'):_0x7771ca['type']=db[_0x585a('0x47')][_0x585a('0x4c')];break;case _0x585a('0x4d'):_0x7771ca['type']=db[_0x585a('0x47')][_0x585a('0x4e')];_0x7771ca[_0x585a('0x4f')]=![];break;default:}return db[_0x585a('0x45')][_0x585a('0x50')][_0x585a('0x51')](_0x585a('0x52'),util[_0x585a('0x53')](_0x585a('0x54'),_0x1a2f4c['id']),_0x7771ca);})[_0x585a('0x1e')](function(){return _0x1a2f4c;});})[_0x585a('0x1e')](respondWithResult(_0x5ec40d,0xc9))[_0x585a('0x3e')](handleError(_0x5ec40d,null));}; \ No newline at end of file +var _0x2604=['INTEGER','switch','BOOLEAN','queryInterface','cm_contacts','cf_%d','html-pdf','eml-format','fast-json-patch','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','send','index','rawAttributes','differenceBy','keys','query','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','map','type','VIRTUAL','filter','options','CmCustomField','include','findAll','catch','show','params','fields','includeAll','find','body','create','sequelize','TEXT','text','Sequelize','number'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0x2604,0x196));var _0x4260=function(_0x3ef022,_0x59847c){_0x3ef022=_0x3ef022-0x0;var _0x30f9e3=_0x2604[_0x3ef022];return _0x30f9e3;};'use strict';var pdf=require(_0x4260('0x0'));var emlformat=require(_0x4260('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4260('0x2'));var rp=require('request-promise');var moment=require(_0x4260('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4260('0x4'));var util=require(_0x4260('0x5'));var path=require('path');var sox=require(_0x4260('0x6'));var csv=require(_0x4260('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4260('0x8'));var squel=require(_0x4260('0x9'));var crypto=require(_0x4260('0xa'));var jsforce=require(_0x4260('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4260('0x7'));var querystring=require(_0x4260('0xc'));var Papa=require('papaparse');var Redis=require(_0x4260('0xd'));var authService=require(_0x4260('0xe'));var qs=require(_0x4260('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4260('0x10'))(_0x4260('0x11'));var utils=require(_0x4260('0x12'));var config=require(_0x4260('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b6233,_0x1cb9a5){_0x1cb9a5=_0x1cb9a5||0xcc;return function(_0x2f7786){if(_0x2f7786){return _0x4b6233['sendStatus'](_0x1cb9a5);}return _0x4b6233[_0x4260('0x14')](_0x1cb9a5)[_0x4260('0x15')]();};}function respondWithResult(_0x346eb2,_0x439859){_0x439859=_0x439859||0xc8;return function(_0x5ce471){if(_0x5ce471){return _0x346eb2[_0x4260('0x14')](_0x439859)[_0x4260('0x16')](_0x5ce471);}};}function respondWithFilteredResult(_0x4d2628,_0x23ba1){return function(_0x54ec9f){if(_0x54ec9f){var _0x320f8a=_0x54ec9f[_0x4260('0x17')],_0x35592e=_0x23ba1[_0x4260('0x18')],_0x388106=_0x23ba1[_0x4260('0x18')]+_0x23ba1[_0x4260('0x19')],_0x4e467e;if(_0x388106>=_0x320f8a){_0x388106=_0x320f8a;_0x4e467e=0xc8;}else{_0x4e467e=0xce;}_0x4d2628['status'](_0x4e467e);return _0x4d2628[_0x4260('0x1a')](_0x4260('0x1b'),_0x35592e+'-'+_0x388106+'/'+_0x320f8a)['json'](_0x54ec9f);}return null;};}function patchUpdates(_0x36dd0a){return function(_0x2321b9){try{jsonpatch['apply'](_0x2321b9,_0x36dd0a,!![]);}catch(_0x43986f){return BPromise[_0x4260('0x1c')](_0x43986f);}return _0x2321b9[_0x4260('0x1d')]();};}function saveUpdates(_0x47ffe1,_0x4d6f3b){return function(_0x2d9b43){if(_0x2d9b43){return _0x2d9b43[_0x4260('0x1e')](_0x47ffe1)[_0x4260('0x1f')](function(_0xa3c7e8){return _0xa3c7e8;});}return null;};}function removeEntity(_0x541a45,_0x20d5e3){return function(_0x2c77c6){if(_0x2c77c6){return _0x2c77c6[_0x4260('0x20')]()[_0x4260('0x1f')](function(){_0x541a45['status'](0xcc)[_0x4260('0x15')]();});}};}function handleEntityNotFound(_0x10c0bd,_0x3e6203){return function(_0x20b5f4){if(!_0x20b5f4){_0x10c0bd[_0x4260('0x21')](0x194);}return _0x20b5f4;};}function handleError(_0x2703cb,_0x16f06b){_0x16f06b=_0x16f06b||0x1f4;return function(_0x1935da){logger[_0x4260('0x22')](_0x1935da['stack']);if(_0x1935da[_0x4260('0x23')]){delete _0x1935da['name'];}_0x2703cb['status'](_0x16f06b)[_0x4260('0x24')](_0x1935da);};}exports[_0x4260('0x25')]=function(_0x16990e,_0x1e4805){var _0x21ca8f={},_0x51a657={},_0x320159={'count':0x0,'rows':[]};var _0x226977=db['CmCustomField'][_0x4260('0x26')];_0x51a657['model']=_[_0x4260('0x27')](_[_0x4260('0x28')](_0x226977),[_0x4260('0x23')]);_0x51a657[_0x4260('0x29')]=_[_0x4260('0x28')](_0x16990e['query']);_0x51a657['filters']=_['intersection'](_0x51a657[_0x4260('0x2a')],_0x51a657['query']);_0x21ca8f[_0x4260('0x2b')]=_[_0x4260('0x2c')](_0x51a657[_0x4260('0x2a')],qs['fields'](_0x16990e['query']['fields']));_0x21ca8f['attributes']=_0x21ca8f[_0x4260('0x2b')][_0x4260('0x2d')]?_0x21ca8f[_0x4260('0x2b')]:_0x51a657['model'];if(!_0x16990e[_0x4260('0x29')][_0x4260('0x2e')](_0x4260('0x2f'))){_0x21ca8f['limit']=qs[_0x4260('0x19')](_0x16990e[_0x4260('0x29')][_0x4260('0x19')]);_0x21ca8f[_0x4260('0x18')]=qs[_0x4260('0x18')](_0x16990e['query'][_0x4260('0x18')]);}_0x21ca8f[_0x4260('0x30')]=qs[_0x4260('0x31')](_0x16990e[_0x4260('0x29')][_0x4260('0x31')]);_0x21ca8f['where']=qs[_0x4260('0x32')](_['pick'](_0x16990e[_0x4260('0x29')],_0x51a657[_0x4260('0x32')]));if(_0x16990e[_0x4260('0x29')]['filter']){_0x21ca8f[_0x4260('0x33')]=_[_0x4260('0x34')](_0x21ca8f[_0x4260('0x33')],{'$or':_[_0x4260('0x35')](_0x226977,function(_0x352285){if(_0x352285[_0x4260('0x36')]['key']!==_0x4260('0x37')){var _0x38546b={};_0x38546b[_0x352285['field']]={'$like':'%'+_0x16990e[_0x4260('0x29')][_0x4260('0x38')]+'%'};return _0x38546b;}})});}_0x21ca8f=_[_0x4260('0x34')]({},_0x21ca8f,_0x16990e[_0x4260('0x39')]);var _0xd58ee1={'where':_0x21ca8f[_0x4260('0x33')]};return db[_0x4260('0x3a')][_0x4260('0x17')](_0xd58ee1)[_0x4260('0x1f')](function(_0x2a9fee){_0x320159[_0x4260('0x17')]=_0x2a9fee;if(_0x16990e[_0x4260('0x29')]['includeAll']){_0x21ca8f[_0x4260('0x3b')]=[{'all':!![]}];}return db[_0x4260('0x3a')][_0x4260('0x3c')](_0x21ca8f);})[_0x4260('0x1f')](function(_0x2e328e){_0x320159['rows']=_0x2e328e;return _0x320159;})[_0x4260('0x1f')](respondWithFilteredResult(_0x1e4805,_0x21ca8f))[_0x4260('0x3d')](handleError(_0x1e4805,null));};exports[_0x4260('0x3e')]=function(_0x57b971,_0x174703){var _0x17ad37={'raw':!![],'where':{'id':_0x57b971[_0x4260('0x3f')]['id']}},_0xa8997={};_0xa8997[_0x4260('0x2a')]=_[_0x4260('0x28')](db['CmCustomField'][_0x4260('0x26')]);_0xa8997[_0x4260('0x29')]=_[_0x4260('0x28')](_0x57b971[_0x4260('0x29')]);_0xa8997['filters']=_['intersection'](_0xa8997[_0x4260('0x2a')],_0xa8997[_0x4260('0x29')]);_0x17ad37[_0x4260('0x2b')]=_[_0x4260('0x2c')](_0xa8997[_0x4260('0x2a')],qs[_0x4260('0x40')](_0x57b971[_0x4260('0x29')][_0x4260('0x40')]));_0x17ad37['attributes']=_0x17ad37[_0x4260('0x2b')][_0x4260('0x2d')]?_0x17ad37[_0x4260('0x2b')]:_0xa8997[_0x4260('0x2a')];if(_0x57b971[_0x4260('0x29')][_0x4260('0x41')]){_0x17ad37['include']=[{'all':!![]}];}_0x17ad37=_[_0x4260('0x34')]({},_0x17ad37,_0x57b971[_0x4260('0x39')]);return db['CmCustomField'][_0x4260('0x42')](_0x17ad37)[_0x4260('0x1f')](handleEntityNotFound(_0x174703,null))[_0x4260('0x1f')](respondWithResult(_0x174703,null))[_0x4260('0x3d')](handleError(_0x174703,null));};exports['update']=function(_0x37dff1,_0x4bffd8){if(_0x37dff1[_0x4260('0x43')]['id']){delete _0x37dff1[_0x4260('0x43')]['id'];}return db[_0x4260('0x3a')][_0x4260('0x42')]({'where':{'id':_0x37dff1[_0x4260('0x3f')]['id']}})[_0x4260('0x1f')](handleEntityNotFound(_0x4bffd8,null))['then'](saveUpdates(_0x37dff1[_0x4260('0x43')],null))[_0x4260('0x1f')](respondWithResult(_0x4bffd8,null))[_0x4260('0x3d')](handleError(_0x4bffd8,null));};exports[_0x4260('0x20')]=function(_0x252c20,_0x5c5723){return db['CmCustomField'][_0x4260('0x42')]({'where':{'id':_0x252c20[_0x4260('0x3f')]['id']}})[_0x4260('0x1f')](handleEntityNotFound(_0x5c5723,null))[_0x4260('0x1f')](removeEntity(_0x5c5723,null))[_0x4260('0x3d')](handleError(_0x5c5723,null));};exports[_0x4260('0x44')]=function(_0x5358f6,_0x254937){var _0x4fc6d1;return db[_0x4260('0x45')]['transaction'](function(_0x130374){return db[_0x4260('0x3a')][_0x4260('0x44')](_0x5358f6['body'],{'transaction':_0x130374})['then'](function(_0x579aa4){_0x4fc6d1=_0x579aa4;var _0x86b179={'type':db['Sequelize'][_0x4260('0x46')],'transaction':_0x130374};switch(_0x5358f6[_0x4260('0x43')][_0x4260('0x36')]){case _0x4260('0x47'):_0x86b179[_0x4260('0x36')]=db[_0x4260('0x48')][_0x4260('0x46')];break;case _0x4260('0x49'):_0x86b179[_0x4260('0x36')]=db['Sequelize'][_0x4260('0x4a')];break;case _0x4260('0x4b'):_0x86b179[_0x4260('0x36')]=db[_0x4260('0x48')][_0x4260('0x4c')];_0x86b179['defaultValue']=![];break;default:}return db[_0x4260('0x45')][_0x4260('0x4d')]['addColumn'](_0x4260('0x4e'),util['format'](_0x4260('0x4f'),_0x4fc6d1['id']),_0x86b179);})[_0x4260('0x1f')](function(){return _0x4fc6d1;});})[_0x4260('0x1f')](respondWithResult(_0x254937,0xc9))[_0x4260('0x3d')](handleError(_0x254937,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index b9719eb..ce787e1 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 _0x7529=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','CmCustomField','cm_custom_fields','lodash','util'];(function(_0x2dc558,_0x71474a){var _0x23fed1=function(_0x4ba1a9){while(--_0x4ba1a9){_0x2dc558['push'](_0x2dc558['shift']());}};_0x23fed1(++_0x71474a);}(_0x7529,0x1c6));var _0x9752=function(_0x1657c3,_0x396661){_0x1657c3=_0x1657c3-0x0;var _0x4090db=_0x7529[_0x1657c3];return _0x4090db;};'use strict';var _=require(_0x9752('0x0'));var util=require(_0x9752('0x1'));var logger=require(_0x9752('0x2'))(_0x9752('0x3'));var moment=require(_0x9752('0x4'));var BPromise=require(_0x9752('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9752('0x6'));var rimraf=require(_0x9752('0x7'));var config=require(_0x9752('0x8'));var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x155beb,_0x337f63){return _0x155beb[_0x9752('0x9')](_0x9752('0xa'),attributes,{'tableName':_0x9752('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x056d=['cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./cmCustomField.attributes','exports'];(function(_0x25efdf,_0x521462){var _0x22c495=function(_0x184469){while(--_0x184469){_0x25efdf['push'](_0x25efdf['shift']());}};_0x22c495(++_0x521462);}(_0x056d,0xa6));var _0xd056=function(_0x595bae,_0x52f914){_0x595bae=_0x595bae-0x0;var _0x21b4f3=_0x056d[_0x595bae];return _0x21b4f3;};'use strict';var _=require(_0xd056('0x0'));var util=require(_0xd056('0x1'));var logger=require(_0xd056('0x2'))(_0xd056('0x3'));var moment=require(_0xd056('0x4'));var BPromise=require(_0xd056('0x5'));var rp=require(_0xd056('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd056('0x7'));var attributes=require(_0xd056('0x8'));module[_0xd056('0x9')]=function(_0x34fdd4,_0x16097c){return _0x34fdd4['define']('CmCustomField',attributes,{'tableName':_0xd056('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 d126fa3..7c8d7ef 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 _0x5636=['code','CmCustomField,\x20%s,\x20%s','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5636,0x102));var _0x6563=function(_0xad90fe,_0x23f725){_0xad90fe=_0xad90fe-0x0;var _0x33bbb4=_0x5636[_0xad90fe];return _0x33bbb4;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193942,_0x9884a9,_0x2d57d5){return new BPromise(function(_0x2d0d5b,_0x98fcd4){return client[_0x6563('0xa')](_0x193942,_0x2d57d5)[_0x6563('0xb')](function(_0x3ccb4e){logger['info']('CmCustomField,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));logger[_0x6563('0xd')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x9884a9,'request\x20sent',JSON['stringify'](_0x3ccb4e));if(_0x3ccb4e[_0x6563('0xe')]){if(_0x3ccb4e[_0x6563('0xe')][_0x6563('0xf')]===0x1f4){logger[_0x6563('0xe')](_0x6563('0x10'),_0x9884a9,_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);return _0x98fcd4(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}logger['error'](_0x6563('0x10'),_0x9884a9,_0x3ccb4e['error'][_0x6563('0x11')]);return _0x2d0d5b(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}else{logger[_0x6563('0x12')]('CmCustomField,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));_0x2d0d5b(_0x3ccb4e[_0x6563('0x13')][_0x6563('0x11')]);}})[_0x6563('0x14')](function(_0x4e7282){logger[_0x6563('0xe')]('CmCustomField,\x20%s,\x20%s',_0x9884a9,_0x4e7282);_0x98fcd4(_0x4e7282);});});} \ No newline at end of file +var _0x3140=['jayson/promise','client','http','request','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x171ee1,_0x943d0f){var _0x2dd1cc=function(_0x1aa98f){while(--_0x1aa98f){_0x171ee1['push'](_0x171ee1['shift']());}};_0x2dd1cc(++_0x943d0f);}(_0x3140,0xaf));var _0x0314=function(_0x31bcb2,_0x23cc0e){_0x31bcb2=_0x31bcb2-0x0;var _0x3f150c=_0x3140[_0x31bcb2];return _0x3f150c;};'use strict';var _=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var moment=require(_0x0314('0x2'));var BPromise=require(_0x0314('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0314('0x4'))['db'];var utils=require(_0x0314('0x5'));var logger=require(_0x0314('0x6'))(_0x0314('0x7'));var config=require(_0x0314('0x8'));var jayson=require(_0x0314('0x9'));var client=jayson[_0x0314('0xa')][_0x0314('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11ee94,_0x44762d,_0x176944){return new BPromise(function(_0x495b27,_0x26031f){return client[_0x0314('0xc')](_0x11ee94,_0x176944)['then'](function(_0x5e9bca){logger[_0x0314('0xd')]('CmCustomField,\x20%s,\x20%s',_0x44762d,_0x0314('0xe'));logger[_0x0314('0xf')](_0x0314('0x10'),_0x44762d,_0x0314('0xe'),JSON[_0x0314('0x11')](_0x5e9bca));if(_0x5e9bca[_0x0314('0x12')]){if(_0x5e9bca['error'][_0x0314('0x13')]===0x1f4){logger[_0x0314('0x12')](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x26031f(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}logger['error'](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x495b27(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}else{logger[_0x0314('0xd')](_0x0314('0x14'),_0x44762d,_0x0314('0xe'));_0x495b27(_0x5e9bca['result'][_0x0314('0x15')]);}})[_0x0314('0x16')](function(_0x1f23c6){logger['error'](_0x0314('0x14'),_0x44762d,_0x1f23c6);_0x26031f(_0x1f23c6);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index b3489c0..eefe12e 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 _0xfb9c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','post','create','update','destroy','util','express'];(function(_0x16cdb4,_0x50d63c){var _0x5472f1=function(_0xf5a951){while(--_0xf5a951){_0x16cdb4['push'](_0x16cdb4['shift']());}};_0x5472f1(++_0x50d63c);}(_0xfb9c,0xb2));var _0xcfb9=function(_0x46c1f5,_0x505b91){_0x46c1f5=_0x46c1f5-0x0;var _0x1a044d=_0xfb9c[_0x46c1f5];return _0x1a044d;};'use strict';var multer=require('multer');var util=require(_0xcfb9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcfb9('0x1'));var router=express[_0xcfb9('0x2')]();var auth=require(_0xcfb9('0x3'));var interaction=require(_0xcfb9('0x4'));var config=require(_0xcfb9('0x5'));var controller=require(_0xcfb9('0x6'));router[_0xcfb9('0x7')]('/',auth[_0xcfb9('0x8')](),controller['index']);router['get'](_0xcfb9('0x9'),auth[_0xcfb9('0x8')](),controller[_0xcfb9('0xa')]);router[_0xcfb9('0xb')]('/',auth[_0xcfb9('0x8')](),controller[_0xcfb9('0xc')]);router['put'](_0xcfb9('0x9'),auth[_0xcfb9('0x8')](),controller[_0xcfb9('0xd')]);router['delete'](_0xcfb9('0x9'),auth['isAuthenticated'](),controller[_0xcfb9('0xe')]);module['exports']=router; \ No newline at end of file +var _0x6688=['path','Router','../../config/environment','./cmCustomField.controller','get','index','/:id','isAuthenticated','show','post','create','update','destroy','exports','multer','util'];(function(_0x556b0d,_0x3d48a8){var _0x5da07c=function(_0x4acfc7){while(--_0x4acfc7){_0x556b0d['push'](_0x556b0d['shift']());}};_0x5da07c(++_0x3d48a8);}(_0x6688,0x19e));var _0x8668=function(_0x4fc65c,_0xd79636){_0x4fc65c=_0x4fc65c-0x0;var _0x5bd220=_0x6688[_0x4fc65c];return _0x5bd220;};'use strict';var multer=require(_0x8668('0x0'));var util=require(_0x8668('0x1'));var path=require(_0x8668('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8668('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8668('0x4'));var controller=require(_0x8668('0x5'));router[_0x8668('0x6')]('/',auth['isAuthenticated'](),controller[_0x8668('0x7')]);router['get'](_0x8668('0x8'),auth[_0x8668('0x9')](),controller[_0x8668('0xa')]);router[_0x8668('0xb')]('/',auth[_0x8668('0x9')](),controller[_0x8668('0xc')]);router['put'](_0x8668('0x8'),auth[_0x8668('0x9')](),controller[_0x8668('0xd')]);router['delete'](_0x8668('0x8'),auth[_0x8668('0x9')](),controller[_0x8668('0xe')]);module[_0x8668('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index ae88139..acd76ca 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 _0x8f9e=['moment','sequelize','STRING','BOOLEAN','INTEGER','DATE','UNSIGNED','contactListQueue'];(function(_0x102435,_0x170450){var _0x3f9126=function(_0x7d9257){while(--_0x7d9257){_0x102435['push'](_0x102435['shift']());}};_0x3f9126(++_0x170450);}(_0x8f9e,0x160));var _0xe8f9=function(_0x20d5c3,_0x17ae58){_0x20d5c3=_0x20d5c3-0x0;var _0xbebc02=_0x8f9e[_0x20d5c3];return _0xbebc02;};'use strict';var moment=require(_0xe8f9('0x0'));var Sequelize=require(_0xe8f9('0x1'));module['exports']={'phone':{'type':Sequelize[_0xe8f9('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xe8f9('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xe8f9('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe8f9('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xe8f9('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe8f9('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe8f9('0x5')]},'priority':{'type':Sequelize[_0xe8f9('0x4')](0x2)[_0xe8f9('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xe8f9('0x4')],'unique':_0xe8f9('0x7')},'ListId':{'type':Sequelize[_0xe8f9('0x4')],'unique':_0xe8f9('0x7')},'UserId':{'type':Sequelize[_0xe8f9('0x4')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xe8f9('0x7')},'CampaignId':{'type':Sequelize[_0xe8f9('0x4')]}}; \ No newline at end of file +var _0x1d32=['sequelize','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d32,0x1e3));var _0x21d3=function(_0xfa55ba,_0x4dce07){_0xfa55ba=_0xfa55ba-0x0;var _0x5deb42=_0x1d32[_0xfa55ba];return _0x5deb42;};'use strict';var moment=require(_0x21d3('0x0'));var Sequelize=require(_0x21d3('0x1'));module[_0x21d3('0x2')]={'phone':{'type':Sequelize[_0x21d3('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x21d3('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x21d3('0x5')],'defaultValue':moment()[_0x21d3('0x6')](_0x21d3('0x7'))},'countbusyretry':{'type':Sequelize[_0x21d3('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x21d3('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x21d3('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x21d3('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x21d3('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x21d3('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x21d3('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x21d3('0xa')},'ListId':{'type':Sequelize[_0x21d3('0x8')],'unique':_0x21d3('0xa')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x21d3('0xa')},'CampaignId':{'type':Sequelize[_0x21d3('0x8')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 960b715..6b1b77b 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 _0xa9e0=['CmHopper,\x20%s,\x20%s,\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','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','CmHopper','rawAttributes','model','keys','query','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','destroy','VoiceQueueId','CampaignId','Campaign','name','dataValues','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','CmContact','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','transaction','map','direction','prev','isEmpty','hopperIds','priority','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','scheduledAt','findOne','LOCK','Contact','Company','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','preview','isNumber'];(function(_0x3c5d40,_0x24e3a1){var _0x4b0236=function(_0x4d2970){while(--_0x4d2970){_0x3c5d40['push'](_0x3c5d40['shift']());}};_0x4b0236(++_0x24e3a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_[_0x0a9e('0x2a')](_0x479bc4['filters'],[_0x0a9e('0x2b'),_0x0a9e('0x2c'),_0x0a9e('0x2d'),_0x0a9e('0x2e'),_0x0a9e('0x2f'),_0x0a9e('0x30'),_0x0a9e('0x31'),_0x0a9e('0x32'),_0x0a9e('0x33'),'$between',_0x0a9e('0x34'),'$in',_0x0a9e('0x35'),_0x0a9e('0x36'),_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39'),'$like',_0x0a9e('0x3a'),_0x0a9e('0x3b'),_0x0a9e('0x3c'),_0x0a9e('0x3d')]);_0x384319[_0x0a9e('0x3e')]=_[_0x0a9e('0x3f')](_0x479bc4[_0x0a9e('0x26')],qs[_0x0a9e('0x40')](_0x33161b['query'][_0x0a9e('0x40')]));_0x384319['attributes']=_0x384319[_0x0a9e('0x3e')][_0x0a9e('0x41')]?_0x384319[_0x0a9e('0x3e')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b['query'][_0x0a9e('0x42')](_0x0a9e('0x43'))){_0x384319[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x33161b['query']['limit']);_0x384319[_0x0a9e('0x18')]=qs['offset'](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x44')]=qs[_0x0a9e('0x45')](_0x33161b['query'][_0x0a9e('0x45')]);_0x384319[_0x0a9e('0x46')]=qs[_0x0a9e('0x29')](_['pick'](_0x33161b[_0x0a9e('0x28')],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b[_0x0a9e('0x28')]['filter']){_0x384319['where']=_[_0x0a9e('0x47')](_0x384319[_0x0a9e('0x46')],{'$or':_['map'](_0x5bfb33,function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x48')][_0x0a9e('0x49')]!==_0x0a9e('0x4a')){var _0x4b38d9={};_0x4b38d9[_0x2b814e['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x4b')]+'%'};return _0x4b38d9;}})});}_0x384319=_['merge']({},_0x384319,_0x33161b[_0x0a9e('0x4c')]);var _0x1dec2e={'where':_0x384319[_0x0a9e('0x46')]};return db['CmHopper'][_0x0a9e('0x17')](_0x1dec2e)[_0x0a9e('0x1f')](function(_0x274e8e){_0x45a1e7[_0x0a9e('0x17')]=_0x274e8e;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x4d')]){_0x384319[_0x0a9e('0x4e')]=[{'all':!![]}];}return db[_0x0a9e('0x24')][_0x0a9e('0x4f')](_0x384319);})[_0x0a9e('0x1f')](function(_0x2c3711){_0x45a1e7[_0x0a9e('0x50')]=_0x2c3711;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x51')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x52')]=function(_0x4d04c8,_0x52628e){var _0x473fdc={'raw':!![],'where':{'id':_0x4d04c8[_0x0a9e('0x53')]['id']}},_0xb3795a={};_0xb3795a[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0xb3795a[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x4d04c8[_0x0a9e('0x28')]);_0xb3795a[_0x0a9e('0x29')]=_[_0x0a9e('0x3f')](_0xb3795a['model'],_0xb3795a[_0x0a9e('0x28')]);_0x473fdc[_0x0a9e('0x3e')]=_[_0x0a9e('0x3f')](_0xb3795a[_0x0a9e('0x26')],qs[_0x0a9e('0x40')](_0x4d04c8[_0x0a9e('0x28')][_0x0a9e('0x40')]));_0x473fdc[_0x0a9e('0x3e')]=_0x473fdc['attributes'][_0x0a9e('0x41')]?_0x473fdc['attributes']:_0xb3795a[_0x0a9e('0x26')];if(_0x4d04c8[_0x0a9e('0x28')][_0x0a9e('0x4d')]){_0x473fdc['include']=[{'all':!![]}];}_0x473fdc=_[_0x0a9e('0x47')]({},_0x473fdc,_0x4d04c8[_0x0a9e('0x4c')]);return db[_0x0a9e('0x24')][_0x0a9e('0x54')](_0x473fdc)[_0x0a9e('0x1f')](handleEntityNotFound(_0x52628e,null))[_0x0a9e('0x1f')](respondWithResult(_0x52628e,null))[_0x0a9e('0x51')](handleError(_0x52628e,null));};exports['create']=function(_0x13f44d,_0x1bde3c){return db[_0x0a9e('0x24')][_0x0a9e('0x55')](_0x13f44d[_0x0a9e('0x56')],{})[_0x0a9e('0x1f')](respondWithResult(_0x1bde3c,0xc9))[_0x0a9e('0x51')](handleError(_0x1bde3c,null));};exports[_0x0a9e('0x57')]=function(_0x34febd,_0x58a5c2){if(_0x34febd[_0x0a9e('0x56')]['id']){delete _0x34febd[_0x0a9e('0x56')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x34febd['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x58a5c2,null))[_0x0a9e('0x1f')](saveUpdates(_0x34febd[_0x0a9e('0x56')],null))[_0x0a9e('0x1f')](respondWithResult(_0x58a5c2,null))[_0x0a9e('0x51')](handleError(_0x58a5c2,null));};exports[_0x0a9e('0x58')]=function(_0x2e5165,_0x375c18){return db['CmHopper']['describe']()['then'](respondWithResult(_0x375c18,null))[_0x0a9e('0x51')](handleError(_0x375c18,null));};exports[_0x0a9e('0x59')]=function(_0x14d602,_0x5bb3ed){var _0x2b69d9;return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x14d602['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5bb3ed,null))['then'](function(_0x443e72){if(_0x443e72){return _0x443e72['destroy']()[_0x0a9e('0x1f')](function(_0x3c20b2){return _0x3c20b2;});}})[_0x0a9e('0x1f')](function(_0x53613a){_0x2b69d9=_0x53613a;if(_0x53613a){if(_0x53613a[_0x0a9e('0x5a')]||_0x53613a[_0x0a9e('0x5b')]){return db[_0x53613a['VoiceQueueId']?'VoiceQueue':_0x0a9e('0x5c')][_0x0a9e('0x54')]({'where':{'id':_0x53613a['VoiceQueueId']?_0x53613a[_0x0a9e('0x5a')]:_0x53613a['CampaignId']},'attributes':['id',_0x0a9e('0x5d')],'raw':!![]});}}})['then'](function(_0xe22ccc){var _0x4a6deb={};if(_0xe22ccc){_['merge'](_0x4a6deb,_['omit'](_0x2b69d9[_0x0a9e('0x5e')],['createdAt',_0x0a9e('0x5f'),'id']));_0x4a6deb[_0x0a9e('0x60')]=0x15;_0x4a6deb[_0x0a9e('0x61')]=_0x0a9e('0x62');_0x4a6deb[_0x0a9e('0x63')]=_0xe22ccc[_0x0a9e('0x5d')];_0x4a6deb[_0x0a9e('0x64')]=_0x14d602[_0x0a9e('0x65')]['name'];_0x4a6deb[_0x0a9e('0x66')]=_0x14d602[_0x0a9e('0x65')]['id'];_0x4a6deb[_0x0a9e('0x62')]=!![];_0x4a6deb[_0x0a9e('0x67')]=moment()[_0x0a9e('0x68')](_0x0a9e('0x69'));_0x4a6deb['calleridnum']=_0x2b69d9[_0x0a9e('0x6a')];_0x4a6deb[_0x0a9e('0x6b')]=_0x2b69d9['VoiceQueueId']?_0x0a9e('0x6c'):'ivr';return db[_0x0a9e('0x6d')]['find']({'where':{'id':_0x4a6deb['ContactId']},'attributes':['firstName',_0x0a9e('0x6e')]})['then'](function(_0x2244d6){if(!_[_0x0a9e('0x6f')](_0x5bb3ed)&&!_[_0x0a9e('0x6f')](_0x2244d6[_0x0a9e('0x70')])){_0x4a6deb[_0x0a9e('0x71')]=_0x2244d6[_0x0a9e('0x70')];if(!_['isNil'](_0x2244d6[_0x0a9e('0x6e')])){_0x4a6deb['calleridname']+='\x20'+_0x2244d6[_0x0a9e('0x6e')];}}})[_0x0a9e('0x72')](function(){return db[_0x0a9e('0x73')]['create'](_0x4a6deb);});}})[_0x0a9e('0x1f')](function(){return _0x5bb3ed[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();})[_0x0a9e('0x51')](handleError(_0x5bb3ed,null));};exports['getPreview']=function(_0x1d0dc8,_0xe05a5a,_0x54327c){var _0x797b45=[];return db[_0x0a9e('0x6d')][_0x0a9e('0x58')]()[_0x0a9e('0x1f')](function(_0x401837){_0x797b45=_['keys'](_0x401837);return _0x1d0dc8[_0x0a9e('0x65')][_0x0a9e('0x74')]({'where':{'type':_0x0a9e('0x75'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x0a9e('0x76')],'raw':!![]});})['then'](function(_0x5211e3){if(_0x5211e3&&_0x5211e3[_0x0a9e('0x41')]){return db[_0x0a9e('0x77')][_0x0a9e('0x78')](function(_0x19c995){var _0x186f39={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0a9e('0x68')](_0x0a9e('0x69'))},'VoiceQueueId':{'$in':_[_0x0a9e('0x79')](_0x5211e3,'id')},'$or':[{'UserId':null},{'UserId':_0x1d0dc8[_0x0a9e('0x65')]['id']}]};var _0x1cc4f3=[];if(_0x1d0dc8[_0x0a9e('0x56')][_0x0a9e('0x7a')]&&_0x1d0dc8[_0x0a9e('0x56')][_0x0a9e('0x7a')]===_0x0a9e('0x7b')){if(!_[_0x0a9e('0x7c')](_0x1d0dc8[_0x0a9e('0x56')][_0x0a9e('0x7d')])){_0x186f39['id']={'$in':_0x1d0dc8['body'][_0x0a9e('0x7d')]};}_0x1cc4f3=[[_0x0a9e('0x7e'),_0x0a9e('0x7f')],['scheduledAt',_0x5211e3[0x0][_0x0a9e('0x76')]===_0x0a9e('0x7f')?'DESC':_0x0a9e('0x7f')],db[_0x0a9e('0x77')][_0x0a9e('0x80')](_0x0a9e('0x81')),['id',_0x0a9e('0x82')]];}else{if(!_['isEmpty'](_0x1d0dc8['body']['hopperIds'])){_0x186f39['id']={'$notIn':_0x1d0dc8[_0x0a9e('0x56')][_0x0a9e('0x7d')]};}_0x1cc4f3=[[_0x0a9e('0x7e'),_0x0a9e('0x82')],[_0x0a9e('0x83'),_0x5211e3[0x0][_0x0a9e('0x76')]],db[_0x0a9e('0x77')][_0x0a9e('0x80')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x0a9e('0x7f')]];}return db[_0x0a9e('0x24')][_0x0a9e('0x84')]({'attributes':['id','scheduledat'],'where':_0x186f39,'order':_0x1cc4f3,'transaction':_0x19c995,'lock':_0x19c995[_0x0a9e('0x85')]['UPDATE'],'include':[{'model':db[_0x0a9e('0x6d')],'as':_0x0a9e('0x86'),'attributes':_0x797b45,'include':[{'model':db['CmCompany'],'as':_0x0a9e('0x87'),'attributes':['id',_0x0a9e('0x5d')]}]},{'model':db[_0x0a9e('0x88')],'as':_0x0a9e('0x89'),'attributes':['id','name']},{'model':db[_0x0a9e('0x8a')],'as':_0x0a9e('0x8b'),'attributes':['id',_0x0a9e('0x5d'),_0x0a9e('0x8c')]}]})['then'](function(_0x109ccb){if(_0x109ccb){return _0x109ccb[_0x0a9e('0x57')]({'UserId':_0x1d0dc8[_0x0a9e('0x65')]['id']},{'transaction':_0x19c995});}});});}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xe05a5a,null))['then'](respondWithResult(_0xe05a5a,null))[_0x0a9e('0x51')](handleError(_0xe05a5a,null));};exports[_0x0a9e('0x8d')]=function(_0x30a4c7,_0xf410e5,_0x332367){return _0x30a4c7[_0x0a9e('0x65')][_0x0a9e('0x74')]({'where':{'type':_0x0a9e('0x75'),'dialActive':!![],'dialMethod':_0x0a9e('0x8e')},'attributes':['id'],'raw':!![]})[_0x0a9e('0x1f')](function(_0xc4c230){if(_0xc4c230&&_0xc4c230[_0x0a9e('0x41')]){return db[_0x0a9e('0x24')][_0x0a9e('0x17')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x0a9e('0x69'))},'VoiceQueueId':{'$in':_[_0x0a9e('0x79')](_0xc4c230,'id')},'$or':[{'UserId':null},{'UserId':_0x30a4c7[_0x0a9e('0x65')]['id']}]}});}return 0x0;})['then'](function(_0x3736e0){if(!_[_0x0a9e('0x6f')](_0x3736e0)&&_[_0x0a9e('0x8f')](_0x3736e0)){return _0xf410e5[_0x0a9e('0x14')](0xc8)['json']({'contacts':_0x3736e0});}else{logger['error'](_0x0a9e('0x90'),_0x0a9e('0x8d'),0x194,'entity\x20not\x20found');_0xf410e5[_0x0a9e('0x13')](0x194);}})['catch'](handleError(_0xf410e5,null));}; \ No newline at end of file +var _0xa9e0=['CmHopper,\x20%s,\x20%s,\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','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','CmHopper','rawAttributes','model','keys','query','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','destroy','VoiceQueueId','CampaignId','Campaign','name','dataValues','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','CmContact','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','transaction','map','direction','prev','isEmpty','hopperIds','priority','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','scheduledAt','findOne','LOCK','Contact','Company','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','preview','isNumber'];(function(_0x54a56b,_0x263e8e){var _0xc520d6=function(_0x439f0d){while(--_0x439f0d){_0x54a56b['push'](_0x54a56b['shift']());}};_0xc520d6(++_0x263e8e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_[_0x0a9e('0x2a')](_0x479bc4['filters'],[_0x0a9e('0x2b'),_0x0a9e('0x2c'),_0x0a9e('0x2d'),_0x0a9e('0x2e'),_0x0a9e('0x2f'),_0x0a9e('0x30'),_0x0a9e('0x31'),_0x0a9e('0x32'),_0x0a9e('0x33'),'$between',_0x0a9e('0x34'),'$in',_0x0a9e('0x35'),_0x0a9e('0x36'),_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39'),'$like',_0x0a9e('0x3a'),_0x0a9e('0x3b'),_0x0a9e('0x3c'),_0x0a9e('0x3d')]);_0x384319[_0x0a9e('0x3e')]=_[_0x0a9e('0x3f')](_0x479bc4[_0x0a9e('0x26')],qs[_0x0a9e('0x40')](_0x33161b['query'][_0x0a9e('0x40')]));_0x384319['attributes']=_0x384319[_0x0a9e('0x3e')][_0x0a9e('0x41')]?_0x384319[_0x0a9e('0x3e')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b['query'][_0x0a9e('0x42')](_0x0a9e('0x43'))){_0x384319[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x33161b['query']['limit']);_0x384319[_0x0a9e('0x18')]=qs['offset'](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x44')]=qs[_0x0a9e('0x45')](_0x33161b['query'][_0x0a9e('0x45')]);_0x384319[_0x0a9e('0x46')]=qs[_0x0a9e('0x29')](_['pick'](_0x33161b[_0x0a9e('0x28')],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b[_0x0a9e('0x28')]['filter']){_0x384319['where']=_[_0x0a9e('0x47')](_0x384319[_0x0a9e('0x46')],{'$or':_['map'](_0x5bfb33,function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x48')][_0x0a9e('0x49')]!==_0x0a9e('0x4a')){var _0x4b38d9={};_0x4b38d9[_0x2b814e['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x4b')]+'%'};return _0x4b38d9;}})});}_0x384319=_['merge']({},_0x384319,_0x33161b[_0x0a9e('0x4c')]);var _0x1dec2e={'where':_0x384319[_0x0a9e('0x46')]};return db['CmHopper'][_0x0a9e('0x17')](_0x1dec2e)[_0x0a9e('0x1f')](function(_0x274e8e){_0x45a1e7[_0x0a9e('0x17')]=_0x274e8e;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x4d')]){_0x384319[_0x0a9e('0x4e')]=[{'all':!![]}];}return db[_0x0a9e('0x24')][_0x0a9e('0x4f')](_0x384319);})[_0x0a9e('0x1f')](function(_0x2c3711){_0x45a1e7[_0x0a9e('0x50')]=_0x2c3711;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x51')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x52')]=function(_0x4d04c8,_0x52628e){var _0x473fdc={'raw':!![],'where':{'id':_0x4d04c8[_0x0a9e('0x53')]['id']}},_0xb3795a={};_0xb3795a[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0xb3795a[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x4d04c8[_0x0a9e('0x28')]);_0xb3795a[_0x0a9e('0x29')]=_[_0x0a9e('0x3f')](_0xb3795a['model'],_0xb3795a[_0x0a9e('0x28')]);_0x473fdc[_0x0a9e('0x3e')]=_[_0x0a9e('0x3f')](_0xb3795a[_0x0a9e('0x26')],qs[_0x0a9e('0x40')](_0x4d04c8[_0x0a9e('0x28')][_0x0a9e('0x40')]));_0x473fdc[_0x0a9e('0x3e')]=_0x473fdc['attributes'][_0x0a9e('0x41')]?_0x473fdc['attributes']:_0xb3795a[_0x0a9e('0x26')];if(_0x4d04c8[_0x0a9e('0x28')][_0x0a9e('0x4d')]){_0x473fdc['include']=[{'all':!![]}];}_0x473fdc=_[_0x0a9e('0x47')]({},_0x473fdc,_0x4d04c8[_0x0a9e('0x4c')]);return db[_0x0a9e('0x24')][_0x0a9e('0x54')](_0x473fdc)[_0x0a9e('0x1f')](handleEntityNotFound(_0x52628e,null))[_0x0a9e('0x1f')](respondWithResult(_0x52628e,null))[_0x0a9e('0x51')](handleError(_0x52628e,null));};exports['create']=function(_0x13f44d,_0x1bde3c){return db[_0x0a9e('0x24')][_0x0a9e('0x55')](_0x13f44d[_0x0a9e('0x56')],{})[_0x0a9e('0x1f')](respondWithResult(_0x1bde3c,0xc9))[_0x0a9e('0x51')](handleError(_0x1bde3c,null));};exports[_0x0a9e('0x57')]=function(_0x34febd,_0x58a5c2){if(_0x34febd[_0x0a9e('0x56')]['id']){delete _0x34febd[_0x0a9e('0x56')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x34febd['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x58a5c2,null))[_0x0a9e('0x1f')](saveUpdates(_0x34febd[_0x0a9e('0x56')],null))[_0x0a9e('0x1f')](respondWithResult(_0x58a5c2,null))[_0x0a9e('0x51')](handleError(_0x58a5c2,null));};exports[_0x0a9e('0x58')]=function(_0x2e5165,_0x375c18){return db['CmHopper']['describe']()['then'](respondWithResult(_0x375c18,null))[_0x0a9e('0x51')](handleError(_0x375c18,null));};exports[_0x0a9e('0x59')]=function(_0x14d602,_0x5bb3ed){var _0x2b69d9;return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x14d602['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5bb3ed,null))['then'](function(_0x443e72){if(_0x443e72){return _0x443e72['destroy']()[_0x0a9e('0x1f')](function(_0x3c20b2){return _0x3c20b2;});}})[_0x0a9e('0x1f')](function(_0x53613a){_0x2b69d9=_0x53613a;if(_0x53613a){if(_0x53613a[_0x0a9e('0x5a')]||_0x53613a[_0x0a9e('0x5b')]){return db[_0x53613a['VoiceQueueId']?'VoiceQueue':_0x0a9e('0x5c')][_0x0a9e('0x54')]({'where':{'id':_0x53613a['VoiceQueueId']?_0x53613a[_0x0a9e('0x5a')]:_0x53613a['CampaignId']},'attributes':['id',_0x0a9e('0x5d')],'raw':!![]});}}})['then'](function(_0xe22ccc){var _0x4a6deb={};if(_0xe22ccc){_['merge'](_0x4a6deb,_['omit'](_0x2b69d9[_0x0a9e('0x5e')],['createdAt',_0x0a9e('0x5f'),'id']));_0x4a6deb[_0x0a9e('0x60')]=0x15;_0x4a6deb[_0x0a9e('0x61')]=_0x0a9e('0x62');_0x4a6deb[_0x0a9e('0x63')]=_0xe22ccc[_0x0a9e('0x5d')];_0x4a6deb[_0x0a9e('0x64')]=_0x14d602[_0x0a9e('0x65')]['name'];_0x4a6deb[_0x0a9e('0x66')]=_0x14d602[_0x0a9e('0x65')]['id'];_0x4a6deb[_0x0a9e('0x62')]=!![];_0x4a6deb[_0x0a9e('0x67')]=moment()[_0x0a9e('0x68')](_0x0a9e('0x69'));_0x4a6deb['calleridnum']=_0x2b69d9[_0x0a9e('0x6a')];_0x4a6deb[_0x0a9e('0x6b')]=_0x2b69d9['VoiceQueueId']?_0x0a9e('0x6c'):'ivr';return db[_0x0a9e('0x6d')]['find']({'where':{'id':_0x4a6deb['ContactId']},'attributes':['firstName',_0x0a9e('0x6e')]})['then'](function(_0x2244d6){if(!_[_0x0a9e('0x6f')](_0x5bb3ed)&&!_[_0x0a9e('0x6f')](_0x2244d6[_0x0a9e('0x70')])){_0x4a6deb[_0x0a9e('0x71')]=_0x2244d6[_0x0a9e('0x70')];if(!_['isNil'](_0x2244d6[_0x0a9e('0x6e')])){_0x4a6deb['calleridname']+='\x20'+_0x2244d6[_0x0a9e('0x6e')];}}})[_0x0a9e('0x72')](function(){return db[_0x0a9e('0x73')]['create'](_0x4a6deb);});}})[_0x0a9e('0x1f')](function(){return _0x5bb3ed[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();})[_0x0a9e('0x51')](handleError(_0x5bb3ed,null));};exports['getPreview']=function(_0x1d0dc8,_0xe05a5a,_0x54327c){var _0x797b45=[];return db[_0x0a9e('0x6d')][_0x0a9e('0x58')]()[_0x0a9e('0x1f')](function(_0x401837){_0x797b45=_['keys'](_0x401837);return _0x1d0dc8[_0x0a9e('0x65')][_0x0a9e('0x74')]({'where':{'type':_0x0a9e('0x75'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x0a9e('0x76')],'raw':!![]});})['then'](function(_0x5211e3){if(_0x5211e3&&_0x5211e3[_0x0a9e('0x41')]){return db[_0x0a9e('0x77')][_0x0a9e('0x78')](function(_0x19c995){var _0x186f39={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0a9e('0x68')](_0x0a9e('0x69'))},'VoiceQueueId':{'$in':_[_0x0a9e('0x79')](_0x5211e3,'id')},'$or':[{'UserId':null},{'UserId':_0x1d0dc8[_0x0a9e('0x65')]['id']}]};var _0x1cc4f3=[];if(_0x1d0dc8[_0x0a9e('0x56')][_0x0a9e('0x7a')]&&_0x1d0dc8[_0x0a9e('0x56')][_0x0a9e('0x7a')]===_0x0a9e('0x7b')){if(!_[_0x0a9e('0x7c')](_0x1d0dc8[_0x0a9e('0x56')][_0x0a9e('0x7d')])){_0x186f39['id']={'$in':_0x1d0dc8['body'][_0x0a9e('0x7d')]};}_0x1cc4f3=[[_0x0a9e('0x7e'),_0x0a9e('0x7f')],['scheduledAt',_0x5211e3[0x0][_0x0a9e('0x76')]===_0x0a9e('0x7f')?'DESC':_0x0a9e('0x7f')],db[_0x0a9e('0x77')][_0x0a9e('0x80')](_0x0a9e('0x81')),['id',_0x0a9e('0x82')]];}else{if(!_['isEmpty'](_0x1d0dc8['body']['hopperIds'])){_0x186f39['id']={'$notIn':_0x1d0dc8[_0x0a9e('0x56')][_0x0a9e('0x7d')]};}_0x1cc4f3=[[_0x0a9e('0x7e'),_0x0a9e('0x82')],[_0x0a9e('0x83'),_0x5211e3[0x0][_0x0a9e('0x76')]],db[_0x0a9e('0x77')][_0x0a9e('0x80')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x0a9e('0x7f')]];}return db[_0x0a9e('0x24')][_0x0a9e('0x84')]({'attributes':['id','scheduledat'],'where':_0x186f39,'order':_0x1cc4f3,'transaction':_0x19c995,'lock':_0x19c995[_0x0a9e('0x85')]['UPDATE'],'include':[{'model':db[_0x0a9e('0x6d')],'as':_0x0a9e('0x86'),'attributes':_0x797b45,'include':[{'model':db['CmCompany'],'as':_0x0a9e('0x87'),'attributes':['id',_0x0a9e('0x5d')]}]},{'model':db[_0x0a9e('0x88')],'as':_0x0a9e('0x89'),'attributes':['id','name']},{'model':db[_0x0a9e('0x8a')],'as':_0x0a9e('0x8b'),'attributes':['id',_0x0a9e('0x5d'),_0x0a9e('0x8c')]}]})['then'](function(_0x109ccb){if(_0x109ccb){return _0x109ccb[_0x0a9e('0x57')]({'UserId':_0x1d0dc8[_0x0a9e('0x65')]['id']},{'transaction':_0x19c995});}});});}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xe05a5a,null))['then'](respondWithResult(_0xe05a5a,null))[_0x0a9e('0x51')](handleError(_0xe05a5a,null));};exports[_0x0a9e('0x8d')]=function(_0x30a4c7,_0xf410e5,_0x332367){return _0x30a4c7[_0x0a9e('0x65')][_0x0a9e('0x74')]({'where':{'type':_0x0a9e('0x75'),'dialActive':!![],'dialMethod':_0x0a9e('0x8e')},'attributes':['id'],'raw':!![]})[_0x0a9e('0x1f')](function(_0xc4c230){if(_0xc4c230&&_0xc4c230[_0x0a9e('0x41')]){return db[_0x0a9e('0x24')][_0x0a9e('0x17')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x0a9e('0x69'))},'VoiceQueueId':{'$in':_[_0x0a9e('0x79')](_0xc4c230,'id')},'$or':[{'UserId':null},{'UserId':_0x30a4c7[_0x0a9e('0x65')]['id']}]}});}return 0x0;})['then'](function(_0x3736e0){if(!_[_0x0a9e('0x6f')](_0x3736e0)&&_[_0x0a9e('0x8f')](_0x3736e0)){return _0xf410e5[_0x0a9e('0x14')](0xc8)['json']({'contacts':_0x3736e0});}else{logger['error'](_0x0a9e('0x90'),_0x0a9e('0x8d'),0x194,'entity\x20not\x20found');_0xf410e5[_0x0a9e('0x13')](0x194);}})['catch'](handleError(_0xf410e5,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index f8ae030..1c89840 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 _0x25f4=['phone','priority','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./cmHopper.attributes','exports','define','scheduledat'];(function(_0x3e478c,_0x152670){var _0x29ef89=function(_0x3d0d77){while(--_0x3d0d77){_0x3e478c['push'](_0x3e478c['shift']());}};_0x29ef89(++_0x152670);}(_0x25f4,0x1b4));var _0x425f=function(_0x188517,_0x689079){_0x188517=_0x188517-0x0;var _0x1431f8=_0x25f4[_0x188517];return _0x1431f8;};'use strict';var _=require(_0x425f('0x0'));var util=require(_0x425f('0x1'));var logger=require(_0x425f('0x2'))(_0x425f('0x3'));var moment=require(_0x425f('0x4'));var BPromise=require(_0x425f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x425f('0x6'));var rimraf=require('rimraf');var config=require(_0x425f('0x7'));var attributes=require(_0x425f('0x8'));module[_0x425f('0x9')]=function(_0x309bf3,_0x43b286){return _0x309bf3[_0x425f('0xa')]('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x425f('0xb')]},{'name':'phone','fields':[_0x425f('0xc')]},{'name':_0x425f('0xd'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd308=['cm_hopper','scheduledat','phone','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmHopper.attributes','exports','define','CmHopper'];(function(_0x49808d,_0x1f83ac){var _0x2a3576=function(_0x3fc8a6){while(--_0x3fc8a6){_0x49808d['push'](_0x49808d['shift']());}};_0x2a3576(++_0x1f83ac);}(_0xd308,0x199));var _0x8d30=function(_0x2954ec,_0x2702a7){_0x2954ec=_0x2954ec-0x0;var _0xf2c13c=_0xd308[_0x2954ec];return _0xf2c13c;};'use strict';var _=require('lodash');var util=require(_0x8d30('0x0'));var logger=require(_0x8d30('0x1'))('api');var moment=require(_0x8d30('0x2'));var BPromise=require(_0x8d30('0x3'));var rp=require(_0x8d30('0x4'));var fs=require('fs');var path=require(_0x8d30('0x5'));var rimraf=require(_0x8d30('0x6'));var config=require('../../config/environment');var attributes=require(_0x8d30('0x7'));module[_0x8d30('0x8')]=function(_0x55651a,_0x381a86){return _0x55651a[_0x8d30('0x9')](_0x8d30('0xa'),attributes,{'tableName':_0x8d30('0xb'),'paranoid':![],'indexes':[{'name':_0x8d30('0xc'),'fields':[_0x8d30('0xc')]},{'name':_0x8d30('0xd'),'fields':[_0x8d30('0xd')]},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 18a6462..61e93b0 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 _0x1c3d=['CmHopper','options','raw','attributes','include','map','model','info','GetCmHopper','ShowCmHopper','find','where','create','CreateCmHopper','update','body','limit','UpdateCmHopper','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','findAll','order','LOCK','UPDATE','Contact','keys','length','push','all','destroy','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','transaction','GetContactRecallMe','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x53091e,_0x13528f){var _0x27d5b6=function(_0x229deb){while(--_0x229deb){_0x53091e['push'](_0x53091e['shift']());}};_0x27d5b6(++_0x13528f);}(_0x1c3d,0x70));var _0xd1c3=function(_0x2bee11,_0x21dcce){_0x2bee11=_0x2bee11-0x0;var _0x56670f=_0x1c3d[_0x2bee11];return _0x56670f;};'use strict';var _=require(_0xd1c3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd1c3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1c3('0x2'));var db=require(_0xd1c3('0x3'))['db'];var utils=require(_0xd1c3('0x4'));var logger=require(_0xd1c3('0x5'))('rpc');var config=require(_0xd1c3('0x6'));var jayson=require(_0xd1c3('0x7'));var client=jayson[_0xd1c3('0x8')][_0xd1c3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7c27ba,_0x229d89,_0x578cc3){return new BPromise(function(_0x42d30a,_0x29165c){return client[_0xd1c3('0xa')](_0x7c27ba,_0x578cc3)[_0xd1c3('0xb')](function(_0x3098bc){logger['info'](_0xd1c3('0xc'),_0x229d89,_0xd1c3('0xd'));logger[_0xd1c3('0xe')](_0xd1c3('0xf'),_0x229d89,_0xd1c3('0xd'),JSON[_0xd1c3('0x10')](_0x3098bc));if(_0x3098bc[_0xd1c3('0x11')]){if(_0x3098bc[_0xd1c3('0x11')][_0xd1c3('0x12')]===0x1f4){logger[_0xd1c3('0x11')](_0xd1c3('0xc'),_0x229d89,_0x3098bc[_0xd1c3('0x11')][_0xd1c3('0x13')]);return _0x29165c(_0x3098bc[_0xd1c3('0x11')]['message']);}logger['error'](_0xd1c3('0xc'),_0x229d89,_0x3098bc[_0xd1c3('0x11')][_0xd1c3('0x13')]);return _0x42d30a(_0x3098bc[_0xd1c3('0x11')][_0xd1c3('0x13')]);}else{logger['info'](_0xd1c3('0xc'),_0x229d89,'request\x20sent');_0x42d30a(_0x3098bc[_0xd1c3('0x14')][_0xd1c3('0x13')]);}})[_0xd1c3('0x15')](function(_0x268586){logger[_0xd1c3('0x11')](_0xd1c3('0xc'),_0x229d89,_0x268586);_0x29165c(_0x268586);});});}exports['GetCmHopper']=function(_0x427099){var _0x3b1f53=this;return new Promise(function(_0x481900,_0x71c77){return db[_0xd1c3('0x16')]['findAll']({'raw':_0x427099[_0xd1c3('0x17')]?_0x427099['options'][_0xd1c3('0x18')]===undefined?!![]:![]:!![],'where':_0x427099[_0xd1c3('0x17')]?_0x427099[_0xd1c3('0x17')]['where']||null:null,'attributes':_0x427099['options']?_0x427099[_0xd1c3('0x17')][_0xd1c3('0x19')]||null:null,'limit':_0x427099[_0xd1c3('0x17')]?_0x427099[_0xd1c3('0x17')]['limit']||null:null,'include':_0x427099[_0xd1c3('0x17')]?_0x427099[_0xd1c3('0x17')][_0xd1c3('0x1a')]?_[_0xd1c3('0x1b')](_0x427099[_0xd1c3('0x17')][_0xd1c3('0x1a')],function(_0x30ba43){return{'model':db[_0x30ba43[_0xd1c3('0x1c')]],'as':_0x30ba43['as'],'attributes':_0x30ba43[_0xd1c3('0x19')],'include':_0x30ba43[_0xd1c3('0x1a')]?_['map'](_0x30ba43['include'],function(_0x2dded4){return{'model':db[_0x2dded4[_0xd1c3('0x1c')]],'as':_0x2dded4['as'],'attributes':_0x2dded4[_0xd1c3('0x19')],'include':_0x2dded4['include']?_[_0xd1c3('0x1b')](_0x2dded4[_0xd1c3('0x1a')],function(_0x29bf61){return{'model':db[_0x29bf61['model']],'as':_0x29bf61['as'],'attributes':_0x29bf61[_0xd1c3('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd1c3('0xb')](function(_0x15ed97){logger[_0xd1c3('0x1d')](_0xd1c3('0x1e'),_0x427099);logger[_0xd1c3('0xe')](_0xd1c3('0x1e'),_0x427099,JSON[_0xd1c3('0x10')](_0x15ed97));_0x481900(_0x15ed97);})[_0xd1c3('0x15')](function(_0x1f2c82){logger[_0xd1c3('0x11')]('GetCmHopper',_0x1f2c82[_0xd1c3('0x13')],_0x427099);_0x71c77(_0x3b1f53[_0xd1c3('0x11')](0x1f4,_0x1f2c82[_0xd1c3('0x13')]));});});};exports[_0xd1c3('0x1f')]=function(_0x4879f5){var _0x428feb=this;return new Promise(function(_0x4eac4d,_0x352125){return db[_0xd1c3('0x16')][_0xd1c3('0x20')]({'raw':_0x4879f5['options']?_0x4879f5['options'][_0xd1c3('0x18')]===undefined?!![]:![]:!![],'where':_0x4879f5[_0xd1c3('0x17')]?_0x4879f5[_0xd1c3('0x17')][_0xd1c3('0x21')]||null:null,'attributes':_0x4879f5[_0xd1c3('0x17')]?_0x4879f5['options'][_0xd1c3('0x19')]||null:null,'include':_0x4879f5['options']?_0x4879f5['options'][_0xd1c3('0x1a')]?_[_0xd1c3('0x1b')](_0x4879f5[_0xd1c3('0x17')][_0xd1c3('0x1a')],function(_0x5ee91f){return{'model':db[_0x5ee91f[_0xd1c3('0x1c')]],'as':_0x5ee91f['as'],'attributes':_0x5ee91f[_0xd1c3('0x19')],'include':_0x5ee91f[_0xd1c3('0x1a')]?_['map'](_0x5ee91f['include'],function(_0x323210){return{'model':db[_0x323210['model']],'as':_0x323210['as'],'attributes':_0x323210['attributes'],'include':_0x323210['include']?_[_0xd1c3('0x1b')](_0x323210[_0xd1c3('0x1a')],function(_0x2f59ec){return{'model':db[_0x2f59ec[_0xd1c3('0x1c')]],'as':_0x2f59ec['as'],'attributes':_0x2f59ec['attributes']};}):[]};}):[]};}):[]:[]})[_0xd1c3('0xb')](function(_0x3ca3bc){logger[_0xd1c3('0x1d')](_0xd1c3('0x1f'),_0x4879f5);logger[_0xd1c3('0xe')](_0xd1c3('0x1f'),_0x4879f5,JSON[_0xd1c3('0x10')](_0x3ca3bc));_0x4eac4d(_0x3ca3bc);})[_0xd1c3('0x15')](function(_0x5b592a){logger[_0xd1c3('0x11')](_0xd1c3('0x1f'),_0x5b592a['message'],_0x4879f5);_0x352125(_0x428feb['error'](0x1f4,_0x5b592a['message']));});});};exports['CreateCmHopper']=function(_0x3075cc){var _0x5d19f9=this;return new Promise(function(_0x16a361,_0x2e2cb9){return db['CmHopper'][_0xd1c3('0x22')](_0x3075cc['body'],{'raw':_0x3075cc[_0xd1c3('0x17')]?_0x3075cc[_0xd1c3('0x17')][_0xd1c3('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x39fa87){logger[_0xd1c3('0x1d')](_0xd1c3('0x23'),_0x3075cc);logger[_0xd1c3('0xe')](_0xd1c3('0x23'),_0x3075cc,JSON['stringify'](_0x39fa87));_0x16a361(_0x39fa87);})[_0xd1c3('0x15')](function(_0x525a37){logger['error']('CreateCmHopper',_0x525a37[_0xd1c3('0x13')],_0x3075cc);_0x2e2cb9(_0x5d19f9[_0xd1c3('0x11')](0x1f4,_0x525a37[_0xd1c3('0x13')]));});});};exports['UpdateCmHopper']=function(_0x5aa769){var _0x423267=this;return new Promise(function(_0x4eb86e,_0x1b7c2e){return db[_0xd1c3('0x16')][_0xd1c3('0x24')](_0x5aa769[_0xd1c3('0x25')],{'raw':_0x5aa769['options']?_0x5aa769['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5aa769['options']?_0x5aa769[_0xd1c3('0x17')]['where']||null:null,'attributes':_0x5aa769['options']?_0x5aa769[_0xd1c3('0x17')]['attributes']||null:null,'limit':_0x5aa769[_0xd1c3('0x17')]?_0x5aa769[_0xd1c3('0x17')][_0xd1c3('0x26')]||null:null})[_0xd1c3('0xb')](function(_0x170190){logger['info'](_0xd1c3('0x27'),_0x5aa769);logger[_0xd1c3('0xe')](_0xd1c3('0x27'),_0x5aa769,JSON[_0xd1c3('0x10')](_0x170190));_0x4eb86e(_0x170190);})[_0xd1c3('0x15')](function(_0x3dfeda){logger[_0xd1c3('0x11')](_0xd1c3('0x27'),_0x3dfeda[_0xd1c3('0x13')],_0x5aa769);_0x1b7c2e(_0x423267[_0xd1c3('0x11')](0x1f4,_0x3dfeda['message']));});});};exports[_0xd1c3('0x28')]=function(_0x553c26){var _0xc91810=this;return new Promise(function(_0x4f9ea2,_0x3a1cf2){return db[_0xd1c3('0x16')]['destroy']({'where':_0x553c26[_0xd1c3('0x17')]?_0x553c26['options'][_0xd1c3('0x21')]||null:null})['then'](function(_0x4d733d){logger[_0xd1c3('0x1d')]('DestroyCmHopper',_0x553c26);logger[_0xd1c3('0xe')]('DestroyCmHopper',_0x553c26,JSON[_0xd1c3('0x10')](_0x4d733d));_0x4f9ea2(_0x4d733d);})[_0xd1c3('0x15')](function(_0x912202){logger[_0xd1c3('0x11')]('DestroyCmHopper',_0x912202[_0xd1c3('0x13')],_0x553c26);_0x3a1cf2(_0xc91810[_0xd1c3('0x11')](0x1f4,_0x912202[_0xd1c3('0x13')]));});});};exports[_0xd1c3('0x29')]=function(_0x2aed5a){var _0x4a4d9f=this;return new Promise(function(_0x1b20d2,_0x31c024){return db[_0xd1c3('0x2a')][_0xd1c3('0x2b')]()[_0xd1c3('0xb')](function(_0x2e7e0c){return db[_0xd1c3('0x2c')]['transaction'](function(_0x537fcd){return db['CmHopper'][_0xd1c3('0x2d')]({'where':_0x2aed5a[_0xd1c3('0x17')]?_0x2aed5a[_0xd1c3('0x17')]['where']||null:null,'attributes':_0x2aed5a['options']?_0x2aed5a[_0xd1c3('0x17')]['attributes']||null:null,'limit':_0x2aed5a['options']?_0x2aed5a[_0xd1c3('0x17')][_0xd1c3('0x26')]||null:null,'order':_0x2aed5a['options']?_0x2aed5a['options'][_0xd1c3('0x2e')]||null:null,'transaction':_0x537fcd,'lock':_0x537fcd[_0xd1c3('0x2f')][_0xd1c3('0x30')],'include':[{'model':db[_0xd1c3('0x2a')],'as':_0xd1c3('0x31'),'attributes':_[_0xd1c3('0x32')](_0x2e7e0c)}]})[_0xd1c3('0xb')](function(_0x45d2cd){var _0x3ee50d=[];for(var _0x1ae05d=0x0;_0x1ae05d<_0x45d2cd[_0xd1c3('0x33')];_0x1ae05d+=0x1){_0x3ee50d[_0xd1c3('0x34')](_0x45d2cd[_0x1ae05d][_0xd1c3('0x24')](_0x2aed5a['body'],{'transaction':_0x537fcd}));}return BPromise[_0xd1c3('0x35')](_0x3ee50d);});})[_0xd1c3('0xb')](function(_0x515f74){logger['info']('GetContactDialer',_0x2aed5a);logger[_0xd1c3('0xe')](_0xd1c3('0x29'),_0x2aed5a,JSON[_0xd1c3('0x10')](_0x515f74));_0x1b20d2(_0x515f74);})[_0xd1c3('0x15')](function(_0x6974bf){logger['error'](_0xd1c3('0x29'),_0x6974bf[_0xd1c3('0x13')],_0x2aed5a);_0x31c024(_0x4a4d9f[_0xd1c3('0x11')](0x1f4,_0x6974bf[_0xd1c3('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x520655){var _0x20471f=this;return new Promise(function(_0x4fa43a,_0x4e3928){return db['sequelize']['transaction'](function(_0x498152){return db['CmHopperFinal']['create'](_0x520655[_0xd1c3('0x25')],{'raw':_0x520655['options']?_0x520655['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x498152})[_0xd1c3('0xb')](function(){return db[_0xd1c3('0x16')][_0xd1c3('0x36')]({'where':_0x520655[_0xd1c3('0x17')]?_0x520655[_0xd1c3('0x17')][_0xd1c3('0x21')]||null:null,'transaction':_0x498152});});})['then'](function(_0x164142){logger[_0xd1c3('0x1d')](_0xd1c3('0x37'),_0x520655);logger[_0xd1c3('0xe')](_0xd1c3('0x37'),_0x520655,JSON[_0xd1c3('0x10')](_0x164142));_0x4fa43a(_0x164142);})[_0xd1c3('0x15')](function(_0x6280be){logger[_0xd1c3('0x11')](_0xd1c3('0x37'),_0x6280be[_0xd1c3('0x13')],_0x520655);_0x4e3928(_0x20471f[_0xd1c3('0x11')](0x1f4,_0x6280be[_0xd1c3('0x13')]));});});};exports[_0xd1c3('0x38')]=function(_0xadb149){var _0x2594dc=this;return new Promise(function(_0x5a4f9f,_0x2d8fb9){return db['CmHopper'][_0xd1c3('0x2d')]({'raw':_0xadb149[_0xd1c3('0x17')]?_0xadb149['options']['raw']===undefined?!![]:![]:!![],'where':_0xadb149[_0xd1c3('0x17')]?_0xadb149[_0xd1c3('0x17')][_0xd1c3('0x21')]||null:null,'attributes':[[db['sequelize']['fn'](_0xd1c3('0x39'),db[_0xd1c3('0x2c')]['fn']('IF',db[_0xd1c3('0x2c')][_0xd1c3('0x3a')](_0xd1c3('0x3b')+util[_0xd1c3('0x3c')](_0xd1c3('0x3d'),moment()[_0xd1c3('0x3c')](_0xd1c3('0x3e')))+_0xd1c3('0x3f')))),_0xd1c3('0x40')]]})[_0xd1c3('0xb')](function(_0x4d4dff){logger['info'](_0xd1c3('0x38'),_0xadb149);logger[_0xd1c3('0xe')](_0xd1c3('0x38'),_0xadb149,JSON[_0xd1c3('0x10')](_0x4d4dff));_0x5a4f9f(_0x4d4dff);})[_0xd1c3('0x15')](function(_0x362a10){logger[_0xd1c3('0x11')](_0xd1c3('0x38'),_0x362a10[_0xd1c3('0x13')],_0xadb149);_0x2d8fb9(_0x2594dc[_0xd1c3('0x11')](0x1f4,_0x362a10[_0xd1c3('0x13')]));});});};exports['GetContactRecallMe']=function(_0xe37768){var _0x26bbcc=this;return new Promise(function(_0x42dd1b,_0x447b78){return db[_0xd1c3('0x2a')][_0xd1c3('0x2b')]()[_0xd1c3('0xb')](function(_0x5c289a){return db['sequelize'][_0xd1c3('0x41')](function(_0x2ca8fd){return db[_0xd1c3('0x16')]['findAll']({'where':_0xe37768[_0xd1c3('0x17')]?_0xe37768['options'][_0xd1c3('0x21')]||null:null,'attributes':_0xe37768[_0xd1c3('0x17')]?_0xe37768['options']['attributes']||null:null,'limit':0x1,'order':_0xe37768[_0xd1c3('0x17')]?_0xe37768[_0xd1c3('0x17')][_0xd1c3('0x2e')]||null:null,'group':db[_0xd1c3('0x16')]['UserId'],'transaction':_0x2ca8fd,'lock':_0x2ca8fd[_0xd1c3('0x2f')][_0xd1c3('0x30')],'include':_0xe37768[_0xd1c3('0x17')]?_0xe37768['options'][_0xd1c3('0x1a')]?_[_0xd1c3('0x1b')](_0xe37768[_0xd1c3('0x17')][_0xd1c3('0x1a')],function(_0x528b6f){return{'model':db[_0x528b6f[_0xd1c3('0x1c')]],'as':_0x528b6f['as'],'attributes':_0x528b6f[_0xd1c3('0x19')],'include':_0x528b6f['include']?_['map'](_0x528b6f[_0xd1c3('0x1a')],function(_0x31921c){return{'model':db[_0x31921c[_0xd1c3('0x1c')]],'as':_0x31921c['as'],'attributes':_0x31921c[_0xd1c3('0x19')],'include':_0x31921c[_0xd1c3('0x1a')]?_[_0xd1c3('0x1b')](_0x31921c['include'],function(_0x3f0b1d){return{'model':db[_0x3f0b1d[_0xd1c3('0x1c')]],'as':_0x3f0b1d['as'],'attributes':_0x3f0b1d[_0xd1c3('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd1c3('0xb')](function(_0x422f44){var _0x42764c=[];for(var _0x15c355=0x0;_0x15c355<_0x422f44[_0xd1c3('0x33')];_0x15c355+=0x1){_0x42764c[_0xd1c3('0x34')](_0x422f44[_0x15c355][_0xd1c3('0x24')](_0xe37768[_0xd1c3('0x25')],{'transaction':_0x2ca8fd}));}return BPromise[_0xd1c3('0x35')](_0x42764c);});})[_0xd1c3('0xb')](function(_0x261d96){logger['info'](_0xd1c3('0x42'),_0xe37768);logger['debug'](_0xd1c3('0x42'),_0xe37768,JSON[_0xd1c3('0x10')](_0x261d96));_0x42dd1b(_0x261d96);})['catch'](function(_0x28e12a){logger['error'](_0xd1c3('0x42'),_0x28e12a[_0xd1c3('0x13')],_0xe37768);_0x447b78(_0x26bbcc[_0xd1c3('0x11')](0x1f4,_0x28e12a['message']));});});});}; \ No newline at end of file +var _0x58e5=['CmHopperFinal','CountReScheduled','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','describe','GetContactRecallMe','lodash','moment','bluebird','randomstring','ioredis','../../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','catch','GetCmHopper','CmHopper','options','attributes','limit','include','model','map','stringify','ShowCmHopper','raw','CreateCmHopper','create','body','UpdateCmHopper','where','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','findAll','order','LOCK','Contact','push','update','all','MoveContactManagedDialer','transaction'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x58e5,0x177));var _0x558e=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x58e5[_0x4ae829];return _0x256b31;};'use strict';var _=require(_0x558e('0x0'));var util=require('util');var moment=require(_0x558e('0x1'));var BPromise=require(_0x558e('0x2'));var rs=require(_0x558e('0x3'));var fs=require('fs');var Redis=require(_0x558e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x558e('0x5'));var logger=require(_0x558e('0x6'))(_0x558e('0x7'));var config=require(_0x558e('0x8'));var jayson=require(_0x558e('0x9'));var client=jayson[_0x558e('0xa')][_0x558e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x418f6f,_0x5d9781,_0x5920be){return new BPromise(function(_0x4316a6,_0x6cba01){return client[_0x558e('0xc')](_0x418f6f,_0x5920be)[_0x558e('0xd')](function(_0x10e79d){logger[_0x558e('0xe')](_0x558e('0xf'),_0x5d9781,_0x558e('0x10'));logger[_0x558e('0x11')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x5d9781,_0x558e('0x10'),JSON['stringify'](_0x10e79d));if(_0x10e79d[_0x558e('0x12')]){if(_0x10e79d['error'][_0x558e('0x13')]===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x5d9781,_0x10e79d[_0x558e('0x12')][_0x558e('0x14')]);return _0x6cba01(_0x10e79d[_0x558e('0x12')]['message']);}logger[_0x558e('0x12')](_0x558e('0xf'),_0x5d9781,_0x10e79d['error'][_0x558e('0x14')]);return _0x4316a6(_0x10e79d[_0x558e('0x12')]['message']);}else{logger[_0x558e('0xe')](_0x558e('0xf'),_0x5d9781,_0x558e('0x10'));_0x4316a6(_0x10e79d['result'][_0x558e('0x14')]);}})[_0x558e('0x15')](function(_0x198527){logger[_0x558e('0x12')]('CmHopper,\x20%s,\x20%s',_0x5d9781,_0x198527);_0x6cba01(_0x198527);});});}exports[_0x558e('0x16')]=function(_0x49e146){var _0x5dad0b=this;return new Promise(function(_0x2da9a7,_0x406348){return db[_0x558e('0x17')]['findAll']({'raw':_0x49e146[_0x558e('0x18')]?_0x49e146['options']['raw']===undefined?!![]:![]:!![],'where':_0x49e146[_0x558e('0x18')]?_0x49e146['options']['where']||null:null,'attributes':_0x49e146[_0x558e('0x18')]?_0x49e146[_0x558e('0x18')][_0x558e('0x19')]||null:null,'limit':_0x49e146[_0x558e('0x18')]?_0x49e146[_0x558e('0x18')][_0x558e('0x1a')]||null:null,'include':_0x49e146[_0x558e('0x18')]?_0x49e146[_0x558e('0x18')]['include']?_['map'](_0x49e146['options'][_0x558e('0x1b')],function(_0x4ff6a6){return{'model':db[_0x4ff6a6[_0x558e('0x1c')]],'as':_0x4ff6a6['as'],'attributes':_0x4ff6a6['attributes'],'include':_0x4ff6a6[_0x558e('0x1b')]?_[_0x558e('0x1d')](_0x4ff6a6[_0x558e('0x1b')],function(_0x19dbcd){return{'model':db[_0x19dbcd[_0x558e('0x1c')]],'as':_0x19dbcd['as'],'attributes':_0x19dbcd[_0x558e('0x19')],'include':_0x19dbcd[_0x558e('0x1b')]?_[_0x558e('0x1d')](_0x19dbcd[_0x558e('0x1b')],function(_0x475693){return{'model':db[_0x475693[_0x558e('0x1c')]],'as':_0x475693['as'],'attributes':_0x475693[_0x558e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x558e('0xd')](function(_0x4a48fd){logger[_0x558e('0xe')](_0x558e('0x16'),_0x49e146);logger[_0x558e('0x11')](_0x558e('0x16'),_0x49e146,JSON[_0x558e('0x1e')](_0x4a48fd));_0x2da9a7(_0x4a48fd);})[_0x558e('0x15')](function(_0x34247f){logger[_0x558e('0x12')]('GetCmHopper',_0x34247f[_0x558e('0x14')],_0x49e146);_0x406348(_0x5dad0b['error'](0x1f4,_0x34247f[_0x558e('0x14')]));});});};exports[_0x558e('0x1f')]=function(_0xc6b202){var _0x502af6=this;return new Promise(function(_0x34ffe6,_0x2db51b){return db[_0x558e('0x17')]['find']({'raw':_0xc6b202[_0x558e('0x18')]?_0xc6b202[_0x558e('0x18')][_0x558e('0x20')]===undefined?!![]:![]:!![],'where':_0xc6b202[_0x558e('0x18')]?_0xc6b202['options']['where']||null:null,'attributes':_0xc6b202[_0x558e('0x18')]?_0xc6b202[_0x558e('0x18')][_0x558e('0x19')]||null:null,'include':_0xc6b202[_0x558e('0x18')]?_0xc6b202[_0x558e('0x18')]['include']?_[_0x558e('0x1d')](_0xc6b202[_0x558e('0x18')][_0x558e('0x1b')],function(_0xff1bc9){return{'model':db[_0xff1bc9[_0x558e('0x1c')]],'as':_0xff1bc9['as'],'attributes':_0xff1bc9[_0x558e('0x19')],'include':_0xff1bc9[_0x558e('0x1b')]?_[_0x558e('0x1d')](_0xff1bc9[_0x558e('0x1b')],function(_0x95013c){return{'model':db[_0x95013c[_0x558e('0x1c')]],'as':_0x95013c['as'],'attributes':_0x95013c[_0x558e('0x19')],'include':_0x95013c['include']?_[_0x558e('0x1d')](_0x95013c[_0x558e('0x1b')],function(_0x2b2743){return{'model':db[_0x2b2743[_0x558e('0x1c')]],'as':_0x2b2743['as'],'attributes':_0x2b2743[_0x558e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x558e('0xd')](function(_0x577d50){logger[_0x558e('0xe')](_0x558e('0x1f'),_0xc6b202);logger[_0x558e('0x11')](_0x558e('0x1f'),_0xc6b202,JSON['stringify'](_0x577d50));_0x34ffe6(_0x577d50);})[_0x558e('0x15')](function(_0x4b5377){logger[_0x558e('0x12')](_0x558e('0x1f'),_0x4b5377[_0x558e('0x14')],_0xc6b202);_0x2db51b(_0x502af6['error'](0x1f4,_0x4b5377['message']));});});};exports[_0x558e('0x21')]=function(_0x12073c){var _0x36128f=this;return new Promise(function(_0x245ba2,_0x18a64e){return db['CmHopper'][_0x558e('0x22')](_0x12073c[_0x558e('0x23')],{'raw':_0x12073c[_0x558e('0x18')]?_0x12073c[_0x558e('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x558e('0xd')](function(_0x2c716d){logger['info'](_0x558e('0x21'),_0x12073c);logger[_0x558e('0x11')](_0x558e('0x21'),_0x12073c,JSON[_0x558e('0x1e')](_0x2c716d));_0x245ba2(_0x2c716d);})[_0x558e('0x15')](function(_0x102396){logger['error'](_0x558e('0x21'),_0x102396[_0x558e('0x14')],_0x12073c);_0x18a64e(_0x36128f['error'](0x1f4,_0x102396[_0x558e('0x14')]));});});};exports[_0x558e('0x24')]=function(_0x3cc96a){var _0x3a049a=this;return new Promise(function(_0x4916ff,_0x301315){return db[_0x558e('0x17')]['update'](_0x3cc96a[_0x558e('0x23')],{'raw':_0x3cc96a[_0x558e('0x18')]?_0x3cc96a[_0x558e('0x18')][_0x558e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cc96a[_0x558e('0x18')]?_0x3cc96a[_0x558e('0x18')][_0x558e('0x25')]||null:null,'attributes':_0x3cc96a[_0x558e('0x18')]?_0x3cc96a[_0x558e('0x18')][_0x558e('0x19')]||null:null,'limit':_0x3cc96a['options']?_0x3cc96a['options'][_0x558e('0x1a')]||null:null})[_0x558e('0xd')](function(_0x225cb0){logger[_0x558e('0xe')](_0x558e('0x24'),_0x3cc96a);logger[_0x558e('0x11')](_0x558e('0x24'),_0x3cc96a,JSON[_0x558e('0x1e')](_0x225cb0));_0x4916ff(_0x225cb0);})[_0x558e('0x15')](function(_0x115a1b){logger['error'](_0x558e('0x24'),_0x115a1b[_0x558e('0x14')],_0x3cc96a);_0x301315(_0x3a049a[_0x558e('0x12')](0x1f4,_0x115a1b[_0x558e('0x14')]));});});};exports[_0x558e('0x26')]=function(_0x3a53d7){var _0x34d55f=this;return new Promise(function(_0x92504,_0x5eafde){return db[_0x558e('0x17')][_0x558e('0x27')]({'where':_0x3a53d7['options']?_0x3a53d7[_0x558e('0x18')][_0x558e('0x25')]||null:null})[_0x558e('0xd')](function(_0x2e6f48){logger[_0x558e('0xe')](_0x558e('0x26'),_0x3a53d7);logger[_0x558e('0x11')](_0x558e('0x26'),_0x3a53d7,JSON[_0x558e('0x1e')](_0x2e6f48));_0x92504(_0x2e6f48);})[_0x558e('0x15')](function(_0x55aa70){logger[_0x558e('0x12')](_0x558e('0x26'),_0x55aa70[_0x558e('0x14')],_0x3a53d7);_0x5eafde(_0x34d55f[_0x558e('0x12')](0x1f4,_0x55aa70[_0x558e('0x14')]));});});};exports[_0x558e('0x28')]=function(_0x520fae){var _0x142dd3=this;return new Promise(function(_0x5036f1,_0x3db1bd){return db[_0x558e('0x29')]['describe']()[_0x558e('0xd')](function(_0xcc9314){return db[_0x558e('0x2a')]['transaction'](function(_0x4a3c82){return db['CmHopper'][_0x558e('0x2b')]({'where':_0x520fae[_0x558e('0x18')]?_0x520fae['options'][_0x558e('0x25')]||null:null,'attributes':_0x520fae[_0x558e('0x18')]?_0x520fae[_0x558e('0x18')]['attributes']||null:null,'limit':_0x520fae[_0x558e('0x18')]?_0x520fae[_0x558e('0x18')][_0x558e('0x1a')]||null:null,'order':_0x520fae[_0x558e('0x18')]?_0x520fae[_0x558e('0x18')][_0x558e('0x2c')]||null:null,'transaction':_0x4a3c82,'lock':_0x4a3c82[_0x558e('0x2d')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x558e('0x2e'),'attributes':_['keys'](_0xcc9314)}]})[_0x558e('0xd')](function(_0x3d2ed4){var _0x28ef7e=[];for(var _0x1f34a0=0x0;_0x1f34a0<_0x3d2ed4['length'];_0x1f34a0+=0x1){_0x28ef7e[_0x558e('0x2f')](_0x3d2ed4[_0x1f34a0][_0x558e('0x30')](_0x520fae[_0x558e('0x23')],{'transaction':_0x4a3c82}));}return BPromise[_0x558e('0x31')](_0x28ef7e);});})[_0x558e('0xd')](function(_0x287822){logger[_0x558e('0xe')](_0x558e('0x28'),_0x520fae);logger[_0x558e('0x11')](_0x558e('0x28'),_0x520fae,JSON['stringify'](_0x287822));_0x5036f1(_0x287822);})[_0x558e('0x15')](function(_0x2ed129){logger[_0x558e('0x12')](_0x558e('0x28'),_0x2ed129[_0x558e('0x14')],_0x520fae);_0x3db1bd(_0x142dd3['error'](0x1f4,_0x2ed129['message']));});});});};exports[_0x558e('0x32')]=function(_0x4b44a1){var _0x125b16=this;return new Promise(function(_0x170b1f,_0x747502){return db[_0x558e('0x2a')][_0x558e('0x33')](function(_0x20a2cc){return db[_0x558e('0x34')][_0x558e('0x22')](_0x4b44a1['body'],{'raw':_0x4b44a1[_0x558e('0x18')]?_0x4b44a1['options'][_0x558e('0x20')]===undefined?!![]:![]:!![],'transaction':_0x20a2cc})[_0x558e('0xd')](function(){return db[_0x558e('0x17')][_0x558e('0x27')]({'where':_0x4b44a1['options']?_0x4b44a1['options']['where']||null:null,'transaction':_0x20a2cc});});})[_0x558e('0xd')](function(_0x27f7d9){logger[_0x558e('0xe')](_0x558e('0x32'),_0x4b44a1);logger[_0x558e('0x11')](_0x558e('0x32'),_0x4b44a1,JSON['stringify'](_0x27f7d9));_0x170b1f(_0x27f7d9);})[_0x558e('0x15')](function(_0x590954){logger[_0x558e('0x12')]('MoveContactManagedDialer',_0x590954[_0x558e('0x14')],_0x4b44a1);_0x747502(_0x125b16[_0x558e('0x12')](0x1f4,_0x590954[_0x558e('0x14')]));});});};exports[_0x558e('0x35')]=function(_0x2ff886){var _0xc396c0=this;return new Promise(function(_0x295889,_0x173cf2){return db['CmHopper'][_0x558e('0x2b')]({'raw':_0x2ff886[_0x558e('0x18')]?_0x2ff886['options'][_0x558e('0x20')]===undefined?!![]:![]:!![],'where':_0x2ff886[_0x558e('0x18')]?_0x2ff886[_0x558e('0x18')][_0x558e('0x25')]||null:null,'attributes':[[db[_0x558e('0x2a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x558e('0x2a')]['literal'](_0x558e('0x36')+util['format']('\x22%s\x22',moment()[_0x558e('0x37')](_0x558e('0x38')))+_0x558e('0x39')))),_0x558e('0x3a')]]})[_0x558e('0xd')](function(_0x39d1e8){logger['info']('CountReScheduled',_0x2ff886);logger[_0x558e('0x11')](_0x558e('0x35'),_0x2ff886,JSON[_0x558e('0x1e')](_0x39d1e8));_0x295889(_0x39d1e8);})[_0x558e('0x15')](function(_0x3dbfdc){logger[_0x558e('0x12')](_0x558e('0x35'),_0x3dbfdc[_0x558e('0x14')],_0x2ff886);_0x173cf2(_0xc396c0['error'](0x1f4,_0x3dbfdc[_0x558e('0x14')]));});});};exports['GetContactRecallMe']=function(_0x1073cc){var _0x3d0ab9=this;return new Promise(function(_0x24403f,_0xece178){return db[_0x558e('0x29')][_0x558e('0x3b')]()[_0x558e('0xd')](function(_0x12e962){return db['sequelize'][_0x558e('0x33')](function(_0x2aa90e){return db['CmHopper']['findAll']({'where':_0x1073cc[_0x558e('0x18')]?_0x1073cc[_0x558e('0x18')][_0x558e('0x25')]||null:null,'attributes':_0x1073cc[_0x558e('0x18')]?_0x1073cc[_0x558e('0x18')][_0x558e('0x19')]||null:null,'limit':0x1,'order':_0x1073cc[_0x558e('0x18')]?_0x1073cc[_0x558e('0x18')][_0x558e('0x2c')]||null:null,'group':db[_0x558e('0x17')]['UserId'],'transaction':_0x2aa90e,'lock':_0x2aa90e['LOCK']['UPDATE'],'include':_0x1073cc[_0x558e('0x18')]?_0x1073cc[_0x558e('0x18')][_0x558e('0x1b')]?_[_0x558e('0x1d')](_0x1073cc[_0x558e('0x18')][_0x558e('0x1b')],function(_0x490e2b){return{'model':db[_0x490e2b[_0x558e('0x1c')]],'as':_0x490e2b['as'],'attributes':_0x490e2b['attributes'],'include':_0x490e2b['include']?_['map'](_0x490e2b['include'],function(_0x42ab69){return{'model':db[_0x42ab69[_0x558e('0x1c')]],'as':_0x42ab69['as'],'attributes':_0x42ab69[_0x558e('0x19')],'include':_0x42ab69[_0x558e('0x1b')]?_[_0x558e('0x1d')](_0x42ab69['include'],function(_0x33a590){return{'model':db[_0x33a590[_0x558e('0x1c')]],'as':_0x33a590['as'],'attributes':_0x33a590[_0x558e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x558e('0xd')](function(_0x70d219){var _0x38f77d=[];for(var _0x597fc4=0x0;_0x597fc4<_0x70d219['length'];_0x597fc4+=0x1){_0x38f77d[_0x558e('0x2f')](_0x70d219[_0x597fc4][_0x558e('0x30')](_0x1073cc['body'],{'transaction':_0x2aa90e}));}return BPromise[_0x558e('0x31')](_0x38f77d);});})[_0x558e('0xd')](function(_0x2aea6c){logger[_0x558e('0xe')](_0x558e('0x3c'),_0x1073cc);logger['debug'](_0x558e('0x3c'),_0x1073cc,JSON[_0x558e('0x1e')](_0x2aea6c));_0x24403f(_0x2aea6c);})['catch'](function(_0x472440){logger['error'](_0x558e('0x3c'),_0x472440['message'],_0x1073cc);_0xece178(_0x3d0ab9[_0x558e('0x12')](0x1f4,_0x472440[_0x558e('0x14')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 576a547..bed0c8a 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 _0xb65d=['../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','getOpenContacts','/:id','show','post','/preview','getPreview','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xb65d,0x149));var _0xdb65=function(_0x125667,_0x285d9b){_0x125667=_0x125667-0x0;var _0x358682=_0xb65d[_0x125667];return _0x358682;};'use strict';var multer=require(_0xdb65('0x0'));var util=require(_0xdb65('0x1'));var path=require(_0xdb65('0x2'));var timeout=require(_0xdb65('0x3'));var express=require(_0xdb65('0x4'));var router=express[_0xdb65('0x5')]();var auth=require(_0xdb65('0x6'));var interaction=require(_0xdb65('0x7'));var config=require(_0xdb65('0x8'));var controller=require(_0xdb65('0x9'));router[_0xdb65('0xa')]('/',auth[_0xdb65('0xb')](),controller['index']);router[_0xdb65('0xa')]('/describe',auth[_0xdb65('0xb')](),controller[_0xdb65('0xc')]);router[_0xdb65('0xa')](_0xdb65('0xd'),auth['isAuthenticated'](),controller[_0xdb65('0xe')]);router[_0xdb65('0xa')](_0xdb65('0xf'),auth['isAuthenticated'](),controller[_0xdb65('0x10')]);router['post']('/',auth[_0xdb65('0xb')](),controller['create']);router[_0xdb65('0x11')](_0xdb65('0x12'),auth[_0xdb65('0xb')](),controller[_0xdb65('0x13')]);router[_0xdb65('0x14')](_0xdb65('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xdb65('0x15')](_0xdb65('0xf'),auth[_0xdb65('0xb')](),controller[_0xdb65('0x16')]);module[_0xdb65('0x17')]=router; \ No newline at end of file +var _0xbf50=['post','/preview','getPreview','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','getOpenContacts'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xbf50,0x119));var _0x0bf5=function(_0x587fb5,_0x59cb3b){_0x587fb5=_0x587fb5-0x0;var _0x551105=_0xbf50[_0x587fb5];return _0x551105;};'use strict';var multer=require(_0x0bf5('0x0'));var util=require(_0x0bf5('0x1'));var path=require(_0x0bf5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bf5('0x3'));var router=express[_0x0bf5('0x4')]();var auth=require(_0x0bf5('0x5'));var interaction=require(_0x0bf5('0x6'));var config=require('../../config/environment');var controller=require('./cmHopper.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0bf5('0x7')]);router[_0x0bf5('0x8')](_0x0bf5('0x9'),auth[_0x0bf5('0xa')](),controller[_0x0bf5('0xb')]);router[_0x0bf5('0x8')]('/opencontacts',auth[_0x0bf5('0xa')](),controller[_0x0bf5('0xc')]);router[_0x0bf5('0x8')]('/:id',auth[_0x0bf5('0xa')](),controller['show']);router[_0x0bf5('0xd')]('/',auth[_0x0bf5('0xa')](),controller['create']);router['post'](_0x0bf5('0xe'),auth[_0x0bf5('0xa')](),controller[_0x0bf5('0xf')]);router[_0x0bf5('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x0bf5('0x11')]);router[_0x0bf5('0x12')]('/:id',auth[_0x0bf5('0xa')](),controller[_0x0bf5('0x13')]);module[_0x0bf5('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 72f92d9..e26042a 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 _0x7ebf=['moment','exports','contactListQueue','INTEGER'];(function(_0x5edaca,_0x1674ee){var _0xefb121=function(_0x1e6c33){while(--_0x1e6c33){_0x5edaca['push'](_0x5edaca['shift']());}};_0xefb121(++_0x1674ee);}(_0x7ebf,0x80));var _0xf7eb=function(_0x3b3c72,_0x9bb5a9){_0x3b3c72=_0x3b3c72-0x0;var _0x4fe5df=_0x7ebf[_0x3b3c72];return _0x4fe5df;};'use strict';var moment=require(_0xf7eb('0x0'));var Sequelize=require('sequelize');module[_0xf7eb('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xf7eb('0x2')},'ListId':{'type':Sequelize[_0xf7eb('0x3')],'unique':_0xf7eb('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xf7eb('0x2')}}; \ No newline at end of file +var _0x8358=['contactListQueue','sequelize','exports','INTEGER'];(function(_0x198f92,_0x25b5c5){var _0x20a259=function(_0x2d1962){while(--_0x2d1962){_0x198f92['push'](_0x198f92['shift']());}};_0x20a259(++_0x25b5c5);}(_0x8358,0x139));var _0x8835=function(_0x17cf8c,_0x56900c){_0x17cf8c=_0x17cf8c-0x0;var _0xb96d53=_0x8358[_0x17cf8c];return _0xb96d53;};'use strict';var moment=require('moment');var Sequelize=require(_0x8835('0x0'));module[_0x8835('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x8835('0x2')],'unique':_0x8835('0x3')},'ListId':{'type':Sequelize[_0x8835('0x2')],'unique':_0x8835('0x3')},'VoiceQueueId':{'type':Sequelize[_0x8835('0x2')],'unique':_0x8835('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 2530163..298bdfd 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 _0xb7c8=['request-promise','moment','bluebird','path','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','limit','set','Content-Range','apply','save','update','destroy','error','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','offset','sort','pick','filter','where','merge','map','key','VIRTUAL','field','options','CmHopperBlack','then','includeAll','include','findAll','rows','catch','show','body','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x46cf08,_0x380602){var _0x359464=function(_0x5755e7){while(--_0x5755e7){_0x46cf08['push'](_0x46cf08['shift']());}};_0x359464(++_0x380602);}(_0xb7c8,0x14f));var _0x8b7c=function(_0x4bcefb,_0x4d4e2e){_0x4bcefb=_0x4bcefb-0x0;var _0x58b5b=_0xb7c8[_0x4bcefb];return _0x58b5b;};'use strict';var pdf=require(_0x8b7c('0x0'));var emlformat=require(_0x8b7c('0x1'));var rimraf=require(_0x8b7c('0x2'));var zipdir=require(_0x8b7c('0x3'));var jsonpatch=require(_0x8b7c('0x4'));var rp=require(_0x8b7c('0x5'));var moment=require(_0x8b7c('0x6'));var BPromise=require(_0x8b7c('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8b7c('0x8'));var sox=require('sox');var csv=require(_0x8b7c('0x9'));var ejs=require(_0x8b7c('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8b7c('0xb'));var crypto=require(_0x8b7c('0xc'));var jsforce=require(_0x8b7c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8b7c('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b7c('0xf'));var qs=require(_0x8b7c('0x10'));var hardwareService=require(_0x8b7c('0x11'));var logger=require('../../config/logger')(_0x8b7c('0x12'));var utils=require(_0x8b7c('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18dc70,_0x2152fc){_0x2152fc=_0x2152fc||0xcc;return function(_0x48a7a8){if(_0x48a7a8){return _0x18dc70[_0x8b7c('0x14')](_0x2152fc);}return _0x18dc70[_0x8b7c('0x15')](_0x2152fc)[_0x8b7c('0x16')]();};}function respondWithResult(_0x1c0a6b,_0x54ce07){_0x54ce07=_0x54ce07||0xc8;return function(_0x1faba7){if(_0x1faba7){return _0x1c0a6b[_0x8b7c('0x15')](_0x54ce07)[_0x8b7c('0x17')](_0x1faba7);}};}function respondWithFilteredResult(_0x6d860d,_0x452eba){return function(_0x352d9d){if(_0x352d9d){var _0xdf4630=_0x352d9d['count'],_0x175759=_0x452eba['offset'],_0x16c464=_0x452eba['offset']+_0x452eba[_0x8b7c('0x18')],_0x1944ee;if(_0x16c464>=_0xdf4630){_0x16c464=_0xdf4630;_0x1944ee=0xc8;}else{_0x1944ee=0xce;}_0x6d860d['status'](_0x1944ee);return _0x6d860d[_0x8b7c('0x19')](_0x8b7c('0x1a'),_0x175759+'-'+_0x16c464+'/'+_0xdf4630)[_0x8b7c('0x17')](_0x352d9d);}return null;};}function patchUpdates(_0x44f285){return function(_0x39a1e5){try{jsonpatch[_0x8b7c('0x1b')](_0x39a1e5,_0x44f285,!![]);}catch(_0x5bc75f){return BPromise['reject'](_0x5bc75f);}return _0x39a1e5[_0x8b7c('0x1c')]();};}function saveUpdates(_0x1041eb,_0x410a1b){return function(_0x30f24d){if(_0x30f24d){return _0x30f24d[_0x8b7c('0x1d')](_0x1041eb)['then'](function(_0x6fb7b6){return _0x6fb7b6;});}return null;};}function removeEntity(_0x48dcdd,_0x51d075){return function(_0x37db32){if(_0x37db32){return _0x37db32[_0x8b7c('0x1e')]()['then'](function(){_0x48dcdd[_0x8b7c('0x15')](0xcc)[_0x8b7c('0x16')]();});}};}function handleEntityNotFound(_0xcf9a6e,_0x5c5dad){return function(_0x37cf58){if(!_0x37cf58){_0xcf9a6e[_0x8b7c('0x14')](0x194);}return _0x37cf58;};}function handleError(_0x4f3128,_0xac442c){_0xac442c=_0xac442c||0x1f4;return function(_0x51de09){logger[_0x8b7c('0x1f')](_0x51de09['stack']);if(_0x51de09[_0x8b7c('0x20')]){delete _0x51de09[_0x8b7c('0x20')];}_0x4f3128[_0x8b7c('0x15')](_0xac442c)[_0x8b7c('0x21')](_0x51de09);};}exports[_0x8b7c('0x22')]=function(_0x362c18,_0x377afc){var _0x13ed55={},_0x3b0799={},_0x1dc773={'count':0x0,'rows':[]};var _0x2e51e5=db['CmHopperBlack'][_0x8b7c('0x23')];_0x3b0799['model']=_[_0x8b7c('0x24')](_0x2e51e5);_0x3b0799['query']=_['keys'](_0x362c18[_0x8b7c('0x25')]);_0x3b0799[_0x8b7c('0x26')]=_[_0x8b7c('0x27')](_0x3b0799[_0x8b7c('0x28')],_0x3b0799[_0x8b7c('0x25')]);_0x13ed55[_0x8b7c('0x29')]=_[_0x8b7c('0x27')](_0x3b0799[_0x8b7c('0x28')],qs[_0x8b7c('0x2a')](_0x362c18['query']['fields']));_0x13ed55[_0x8b7c('0x29')]=_0x13ed55['attributes'][_0x8b7c('0x2b')]?_0x13ed55[_0x8b7c('0x29')]:_0x3b0799['model'];if(!_0x362c18['query'][_0x8b7c('0x2c')]('nolimit')){_0x13ed55[_0x8b7c('0x18')]=qs[_0x8b7c('0x18')](_0x362c18[_0x8b7c('0x25')][_0x8b7c('0x18')]);_0x13ed55[_0x8b7c('0x2d')]=qs[_0x8b7c('0x2d')](_0x362c18[_0x8b7c('0x25')][_0x8b7c('0x2d')]);}_0x13ed55['order']=qs[_0x8b7c('0x2e')](_0x362c18[_0x8b7c('0x25')][_0x8b7c('0x2e')]);_0x13ed55['where']=qs['filters'](_[_0x8b7c('0x2f')](_0x362c18[_0x8b7c('0x25')],_0x3b0799[_0x8b7c('0x26')]));if(_0x362c18[_0x8b7c('0x25')][_0x8b7c('0x30')]){_0x13ed55[_0x8b7c('0x31')]=_[_0x8b7c('0x32')](_0x13ed55['where'],{'$or':_[_0x8b7c('0x33')](_0x2e51e5,function(_0x42ec4d){if(_0x42ec4d['type'][_0x8b7c('0x34')]!==_0x8b7c('0x35')){var _0x14aa52={};_0x14aa52[_0x42ec4d[_0x8b7c('0x36')]]={'$like':'%'+_0x362c18['query']['filter']+'%'};return _0x14aa52;}})});}_0x13ed55=_[_0x8b7c('0x32')]({},_0x13ed55,_0x362c18[_0x8b7c('0x37')]);var _0x4f6272={'where':_0x13ed55[_0x8b7c('0x31')]};return db[_0x8b7c('0x38')]['count'](_0x4f6272)[_0x8b7c('0x39')](function(_0x57b66b){_0x1dc773['count']=_0x57b66b;if(_0x362c18[_0x8b7c('0x25')][_0x8b7c('0x3a')]){_0x13ed55[_0x8b7c('0x3b')]=[{'all':!![]}];}return db[_0x8b7c('0x38')][_0x8b7c('0x3c')](_0x13ed55);})['then'](function(_0x595fcc){_0x1dc773[_0x8b7c('0x3d')]=_0x595fcc;return _0x1dc773;})[_0x8b7c('0x39')](respondWithFilteredResult(_0x377afc,_0x13ed55))[_0x8b7c('0x3e')](handleError(_0x377afc,null));};exports[_0x8b7c('0x3f')]=function(_0x373ba8,_0x1ac68d){var _0x38e277={'raw':!![],'where':{'id':_0x373ba8['params']['id']}},_0x21da40={};_0x21da40['model']=_[_0x8b7c('0x24')](db[_0x8b7c('0x38')]['rawAttributes']);_0x21da40[_0x8b7c('0x25')]=_[_0x8b7c('0x24')](_0x373ba8[_0x8b7c('0x25')]);_0x21da40[_0x8b7c('0x26')]=_['intersection'](_0x21da40[_0x8b7c('0x28')],_0x21da40['query']);_0x38e277[_0x8b7c('0x29')]=_[_0x8b7c('0x27')](_0x21da40['model'],qs[_0x8b7c('0x2a')](_0x373ba8['query'][_0x8b7c('0x2a')]));_0x38e277['attributes']=_0x38e277[_0x8b7c('0x29')][_0x8b7c('0x2b')]?_0x38e277[_0x8b7c('0x29')]:_0x21da40[_0x8b7c('0x28')];if(_0x373ba8['query'][_0x8b7c('0x3a')]){_0x38e277[_0x8b7c('0x3b')]=[{'all':!![]}];}_0x38e277=_[_0x8b7c('0x32')]({},_0x38e277,_0x373ba8[_0x8b7c('0x37')]);return db['CmHopperBlack']['find'](_0x38e277)[_0x8b7c('0x39')](handleEntityNotFound(_0x1ac68d,null))[_0x8b7c('0x39')](respondWithResult(_0x1ac68d,null))[_0x8b7c('0x3e')](handleError(_0x1ac68d,null));};exports['update']=function(_0x311b9e,_0x10c060){if(_0x311b9e[_0x8b7c('0x40')]['id']){delete _0x311b9e['body']['id'];}return db['CmHopperBlack'][_0x8b7c('0x41')]({'where':{'id':_0x311b9e[_0x8b7c('0x42')]['id']}})['then'](handleEntityNotFound(_0x10c060,null))[_0x8b7c('0x39')](saveUpdates(_0x311b9e[_0x8b7c('0x40')],null))['then'](respondWithResult(_0x10c060,null))[_0x8b7c('0x3e')](handleError(_0x10c060,null));};exports['destroy']=function(_0x1e284b,_0x2b5d98){return db[_0x8b7c('0x38')][_0x8b7c('0x41')]({'where':{'id':_0x1e284b[_0x8b7c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2b5d98,null))[_0x8b7c('0x39')](removeEntity(_0x2b5d98,null))[_0x8b7c('0x3e')](handleError(_0x2b5d98,null));};exports[_0x8b7c('0x43')]=function(_0x382c35,_0x259e34){return db[_0x8b7c('0x38')][_0x8b7c('0x43')]()[_0x8b7c('0x39')](respondWithResult(_0x259e34,null))[_0x8b7c('0x3e')](handleError(_0x259e34,null));}; \ No newline at end of file +var _0xdbb6=['offset','limit','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','CmHopperBlack','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','find','update','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end','json'];(function(_0xcf7d1e,_0x1b00ad){var _0x42b2cb=function(_0x4c5c9b){while(--_0x4c5c9b){_0xcf7d1e['push'](_0xcf7d1e['shift']());}};_0x42b2cb(++_0x1b00ad);}(_0xdbb6,0x196));var _0x6dbb=function(_0x19d192,_0x232488){_0x19d192=_0x19d192-0x0;var _0x4077d7=_0xdbb6[_0x19d192];return _0x4077d7;};'use strict';var pdf=require(_0x6dbb('0x0'));var emlformat=require(_0x6dbb('0x1'));var rimraf=require(_0x6dbb('0x2'));var zipdir=require(_0x6dbb('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6dbb('0x4'));var moment=require(_0x6dbb('0x5'));var BPromise=require(_0x6dbb('0x6'));var Mustache=require(_0x6dbb('0x7'));var util=require(_0x6dbb('0x8'));var path=require('path');var sox=require(_0x6dbb('0x9'));var csv=require('to-csv');var ejs=require(_0x6dbb('0xa'));var fs=require('fs');var _=require(_0x6dbb('0xb'));var squel=require(_0x6dbb('0xc'));var crypto=require(_0x6dbb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6dbb('0xe'));var toCsv=require(_0x6dbb('0xf'));var querystring=require('querystring');var Papa=require(_0x6dbb('0x10'));var Redis=require('ioredis');var authService=require(_0x6dbb('0x11'));var qs=require(_0x6dbb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6dbb('0x13'));var utils=require(_0x6dbb('0x14'));var config=require('../../config/environment');var db=require(_0x6dbb('0x15'))['db'];function respondWithStatusCode(_0x5cae7e,_0x526a8d){_0x526a8d=_0x526a8d||0xcc;return function(_0x1b7549){if(_0x1b7549){return _0x5cae7e[_0x6dbb('0x16')](_0x526a8d);}return _0x5cae7e[_0x6dbb('0x17')](_0x526a8d)[_0x6dbb('0x18')]();};}function respondWithResult(_0x1de04c,_0x4f533a){_0x4f533a=_0x4f533a||0xc8;return function(_0x3612b0){if(_0x3612b0){return _0x1de04c[_0x6dbb('0x17')](_0x4f533a)[_0x6dbb('0x19')](_0x3612b0);}};}function respondWithFilteredResult(_0x36cd08,_0x20f40c){return function(_0x1092b1){if(_0x1092b1){var _0x2a7352=_0x1092b1['count'],_0x26d3d3=_0x20f40c[_0x6dbb('0x1a')],_0x19840f=_0x20f40c['offset']+_0x20f40c[_0x6dbb('0x1b')],_0x2f8bd2;if(_0x19840f>=_0x2a7352){_0x19840f=_0x2a7352;_0x2f8bd2=0xc8;}else{_0x2f8bd2=0xce;}_0x36cd08['status'](_0x2f8bd2);return _0x36cd08['set'](_0x6dbb('0x1c'),_0x26d3d3+'-'+_0x19840f+'/'+_0x2a7352)[_0x6dbb('0x19')](_0x1092b1);}return null;};}function patchUpdates(_0x2191ff){return function(_0x1fa960){try{jsonpatch[_0x6dbb('0x1d')](_0x1fa960,_0x2191ff,!![]);}catch(_0x4e0ec4){return BPromise[_0x6dbb('0x1e')](_0x4e0ec4);}return _0x1fa960['save']();};}function saveUpdates(_0x43d823,_0x581aa2){return function(_0x421dfc){if(_0x421dfc){return _0x421dfc['update'](_0x43d823)[_0x6dbb('0x1f')](function(_0xfe739d){return _0xfe739d;});}return null;};}function removeEntity(_0x284c47,_0x4af867){return function(_0x16ddba){if(_0x16ddba){return _0x16ddba[_0x6dbb('0x20')]()[_0x6dbb('0x1f')](function(){_0x284c47[_0x6dbb('0x17')](0xcc)[_0x6dbb('0x18')]();});}};}function handleEntityNotFound(_0x1afe12,_0x1bede0){return function(_0x1d4f00){if(!_0x1d4f00){_0x1afe12['sendStatus'](0x194);}return _0x1d4f00;};}function handleError(_0x34c798,_0x50a193){_0x50a193=_0x50a193||0x1f4;return function(_0xb1705b){logger[_0x6dbb('0x21')](_0xb1705b[_0x6dbb('0x22')]);if(_0xb1705b['name']){delete _0xb1705b[_0x6dbb('0x23')];}_0x34c798[_0x6dbb('0x17')](_0x50a193)[_0x6dbb('0x24')](_0xb1705b);};}exports[_0x6dbb('0x25')]=function(_0x2e6d27,_0x225444){var _0x172230={},_0x5098ae={},_0x1f79a9={'count':0x0,'rows':[]};var _0x4e4be4=db[_0x6dbb('0x26')][_0x6dbb('0x27')];_0x5098ae[_0x6dbb('0x28')]=_[_0x6dbb('0x29')](_0x4e4be4);_0x5098ae[_0x6dbb('0x2a')]=_[_0x6dbb('0x29')](_0x2e6d27[_0x6dbb('0x2a')]);_0x5098ae[_0x6dbb('0x2b')]=_['intersection'](_0x5098ae[_0x6dbb('0x28')],_0x5098ae[_0x6dbb('0x2a')]);_0x172230[_0x6dbb('0x2c')]=_[_0x6dbb('0x2d')](_0x5098ae[_0x6dbb('0x28')],qs[_0x6dbb('0x2e')](_0x2e6d27['query']['fields']));_0x172230[_0x6dbb('0x2c')]=_0x172230[_0x6dbb('0x2c')][_0x6dbb('0x2f')]?_0x172230['attributes']:_0x5098ae['model'];if(!_0x2e6d27[_0x6dbb('0x2a')][_0x6dbb('0x30')](_0x6dbb('0x31'))){_0x172230['limit']=qs[_0x6dbb('0x1b')](_0x2e6d27[_0x6dbb('0x2a')][_0x6dbb('0x1b')]);_0x172230[_0x6dbb('0x1a')]=qs[_0x6dbb('0x1a')](_0x2e6d27[_0x6dbb('0x2a')][_0x6dbb('0x1a')]);}_0x172230[_0x6dbb('0x32')]=qs[_0x6dbb('0x33')](_0x2e6d27[_0x6dbb('0x2a')]['sort']);_0x172230[_0x6dbb('0x34')]=qs['filters'](_[_0x6dbb('0x35')](_0x2e6d27[_0x6dbb('0x2a')],_0x5098ae[_0x6dbb('0x2b')]));if(_0x2e6d27['query']['filter']){_0x172230['where']=_[_0x6dbb('0x36')](_0x172230[_0x6dbb('0x34')],{'$or':_['map'](_0x4e4be4,function(_0x988061){if(_0x988061[_0x6dbb('0x37')][_0x6dbb('0x38')]!==_0x6dbb('0x39')){var _0x5424c0={};_0x5424c0[_0x988061[_0x6dbb('0x3a')]]={'$like':'%'+_0x2e6d27['query']['filter']+'%'};return _0x5424c0;}})});}_0x172230=_['merge']({},_0x172230,_0x2e6d27[_0x6dbb('0x3b')]);var _0x1194ca={'where':_0x172230[_0x6dbb('0x34')]};return db[_0x6dbb('0x26')][_0x6dbb('0x3c')](_0x1194ca)[_0x6dbb('0x1f')](function(_0x87f6ee){_0x1f79a9[_0x6dbb('0x3c')]=_0x87f6ee;if(_0x2e6d27['query'][_0x6dbb('0x3d')]){_0x172230[_0x6dbb('0x3e')]=[{'all':!![]}];}return db[_0x6dbb('0x26')][_0x6dbb('0x3f')](_0x172230);})['then'](function(_0x113a85){_0x1f79a9[_0x6dbb('0x40')]=_0x113a85;return _0x1f79a9;})[_0x6dbb('0x1f')](respondWithFilteredResult(_0x225444,_0x172230))[_0x6dbb('0x41')](handleError(_0x225444,null));};exports[_0x6dbb('0x42')]=function(_0x2ffeaa,_0x452ab6){var _0x4ae2c7={'raw':!![],'where':{'id':_0x2ffeaa[_0x6dbb('0x43')]['id']}},_0x40d89d={};_0x40d89d['model']=_[_0x6dbb('0x29')](db[_0x6dbb('0x26')][_0x6dbb('0x27')]);_0x40d89d[_0x6dbb('0x2a')]=_[_0x6dbb('0x29')](_0x2ffeaa[_0x6dbb('0x2a')]);_0x40d89d[_0x6dbb('0x2b')]=_[_0x6dbb('0x2d')](_0x40d89d[_0x6dbb('0x28')],_0x40d89d[_0x6dbb('0x2a')]);_0x4ae2c7[_0x6dbb('0x2c')]=_[_0x6dbb('0x2d')](_0x40d89d[_0x6dbb('0x28')],qs['fields'](_0x2ffeaa[_0x6dbb('0x2a')][_0x6dbb('0x2e')]));_0x4ae2c7[_0x6dbb('0x2c')]=_0x4ae2c7[_0x6dbb('0x2c')][_0x6dbb('0x2f')]?_0x4ae2c7[_0x6dbb('0x2c')]:_0x40d89d[_0x6dbb('0x28')];if(_0x2ffeaa[_0x6dbb('0x2a')][_0x6dbb('0x3d')]){_0x4ae2c7[_0x6dbb('0x3e')]=[{'all':!![]}];}_0x4ae2c7=_[_0x6dbb('0x36')]({},_0x4ae2c7,_0x2ffeaa[_0x6dbb('0x3b')]);return db[_0x6dbb('0x26')][_0x6dbb('0x44')](_0x4ae2c7)[_0x6dbb('0x1f')](handleEntityNotFound(_0x452ab6,null))[_0x6dbb('0x1f')](respondWithResult(_0x452ab6,null))[_0x6dbb('0x41')](handleError(_0x452ab6,null));};exports[_0x6dbb('0x45')]=function(_0x1de246,_0xa565e4){if(_0x1de246['body']['id']){delete _0x1de246[_0x6dbb('0x46')]['id'];}return db[_0x6dbb('0x26')]['find']({'where':{'id':_0x1de246['params']['id']}})[_0x6dbb('0x1f')](handleEntityNotFound(_0xa565e4,null))[_0x6dbb('0x1f')](saveUpdates(_0x1de246[_0x6dbb('0x46')],null))['then'](respondWithResult(_0xa565e4,null))[_0x6dbb('0x41')](handleError(_0xa565e4,null));};exports['destroy']=function(_0xdfdaec,_0x3b5525){return db[_0x6dbb('0x26')][_0x6dbb('0x44')]({'where':{'id':_0xdfdaec[_0x6dbb('0x43')]['id']}})[_0x6dbb('0x1f')](handleEntityNotFound(_0x3b5525,null))[_0x6dbb('0x1f')](removeEntity(_0x3b5525,null))[_0x6dbb('0x41')](handleError(_0x3b5525,null));};exports[_0x6dbb('0x47')]=function(_0x55b315,_0x3c7e6c){return db[_0x6dbb('0x26')][_0x6dbb('0x47')]()[_0x6dbb('0x1f')](respondWithResult(_0x3c7e6c,null))[_0x6dbb('0x41')](handleError(_0x3c7e6c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 6fced07..1f47ae4 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 _0xe312=['lodash','../../config/logger','api','moment','path','rimraf','./cmHopperBlack.attributes','define','cm_hopper_black'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xe312,0x156));var _0x2e31=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe312[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2e31('0x0'));var util=require('util');var logger=require(_0x2e31('0x1'))(_0x2e31('0x2'));var moment=require(_0x2e31('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e31('0x4'));var rimraf=require(_0x2e31('0x5'));var config=require('../../config/environment');var attributes=require(_0x2e31('0x6'));module['exports']=function(_0x17e681,_0x152aba){return _0x17e681[_0x2e31('0x7')]('CmHopperBlack',attributes,{'tableName':_0x2e31('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0da=['exports','define','CmHopperBlack','cm_hopper_black','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes'];(function(_0x3b15f0,_0x556945){var _0x41a265=function(_0x240370){while(--_0x240370){_0x3b15f0['push'](_0x3b15f0['shift']());}};_0x41a265(++_0x556945);}(_0xb0da,0x82));var _0xab0d=function(_0x41d426,_0x3761cb){_0x41d426=_0x41d426-0x0;var _0x2f9b8c=_0xb0da[_0x41d426];return _0x2f9b8c;};'use strict';var _=require(_0xab0d('0x0'));var util=require('util');var logger=require(_0xab0d('0x1'))(_0xab0d('0x2'));var moment=require(_0xab0d('0x3'));var BPromise=require(_0xab0d('0x4'));var rp=require(_0xab0d('0x5'));var fs=require('fs');var path=require(_0xab0d('0x6'));var rimraf=require(_0xab0d('0x7'));var config=require(_0xab0d('0x8'));var attributes=require(_0xab0d('0x9'));module[_0xab0d('0xa')]=function(_0x46a3b2,_0x106db2){return _0x46a3b2[_0xab0d('0xb')](_0xab0d('0xc'),attributes,{'tableName':_0xab0d('0xd'),'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 56956df..57aab62 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 _0x753b=['GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','map','model','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CmHopperBlack,\x20%s,\x20%s','info','result','catch'];(function(_0x4a2d93,_0x508b7a){var _0x151f08=function(_0x40d3e3){while(--_0x40d3e3){_0x4a2d93['push'](_0x4a2d93['shift']());}};_0x151f08(++_0x508b7a);}(_0x753b,0xf9));var _0xb753=function(_0x3ff235,_0x428b4d){_0x3ff235=_0x3ff235-0x0;var _0x409302=_0x753b[_0x3ff235];return _0x409302;};'use strict';var _=require('lodash');var util=require(_0xb753('0x0'));var moment=require('moment');var BPromise=require(_0xb753('0x1'));var rs=require(_0xb753('0x2'));var fs=require('fs');var Redis=require(_0xb753('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb753('0x4'));var logger=require(_0xb753('0x5'))(_0xb753('0x6'));var config=require(_0xb753('0x7'));var jayson=require(_0xb753('0x8'));var client=jayson[_0xb753('0x9')][_0xb753('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe1c4c1,_0x3767af,_0x26e63d){return new BPromise(function(_0x2d5deb,_0x585b1b){return client[_0xb753('0xb')](_0xe1c4c1,_0x26e63d)[_0xb753('0xc')](function(_0x238b60){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x3767af,'request\x20sent');logger[_0xb753('0xd')](_0xb753('0xe'),_0x3767af,_0xb753('0xf'),JSON[_0xb753('0x10')](_0x238b60));if(_0x238b60['error']){if(_0x238b60[_0xb753('0x11')][_0xb753('0x12')]===0x1f4){logger[_0xb753('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x3767af,_0x238b60[_0xb753('0x11')][_0xb753('0x13')]);return _0x585b1b(_0x238b60[_0xb753('0x11')]['message']);}logger['error'](_0xb753('0x14'),_0x3767af,_0x238b60[_0xb753('0x11')][_0xb753('0x13')]);return _0x2d5deb(_0x238b60['error']['message']);}else{logger[_0xb753('0x15')](_0xb753('0x14'),_0x3767af,_0xb753('0xf'));_0x2d5deb(_0x238b60[_0xb753('0x16')][_0xb753('0x13')]);}})[_0xb753('0x17')](function(_0x1660c7){logger[_0xb753('0x11')](_0xb753('0x14'),_0x3767af,_0x1660c7);_0x585b1b(_0x1660c7);});});}exports[_0xb753('0x18')]=function(_0x323b3f){var _0x3be3d9=this;return new Promise(function(_0x24502c,_0x39a6c3){return db[_0xb753('0x19')]['findAll']({'raw':_0x323b3f[_0xb753('0x1a')]?_0x323b3f[_0xb753('0x1a')][_0xb753('0x1b')]===undefined?!![]:![]:!![],'where':_0x323b3f[_0xb753('0x1a')]?_0x323b3f[_0xb753('0x1a')][_0xb753('0x1c')]||null:null,'attributes':_0x323b3f[_0xb753('0x1a')]?_0x323b3f[_0xb753('0x1a')][_0xb753('0x1d')]||null:null,'limit':_0x323b3f[_0xb753('0x1a')]?_0x323b3f[_0xb753('0x1a')][_0xb753('0x1e')]||null:null,'include':_0x323b3f[_0xb753('0x1a')]?_0x323b3f[_0xb753('0x1a')][_0xb753('0x1f')]?_[_0xb753('0x20')](_0x323b3f[_0xb753('0x1a')]['include'],function(_0x3b4c3e){return{'model':db[_0x3b4c3e[_0xb753('0x21')]],'as':_0x3b4c3e['as'],'attributes':_0x3b4c3e[_0xb753('0x1d')],'include':_0x3b4c3e[_0xb753('0x1f')]?_[_0xb753('0x20')](_0x3b4c3e['include'],function(_0x53b3f5){return{'model':db[_0x53b3f5['model']],'as':_0x53b3f5['as'],'attributes':_0x53b3f5[_0xb753('0x1d')],'include':_0x53b3f5[_0xb753('0x1f')]?_[_0xb753('0x20')](_0x53b3f5[_0xb753('0x1f')],function(_0x3fade1){return{'model':db[_0x3fade1['model']],'as':_0x3fade1['as'],'attributes':_0x3fade1['attributes']};}):[]};}):[]};}):[]:[]})[_0xb753('0xc')](function(_0x244591){logger['info']('GetCmHopperBlack',_0x323b3f);logger[_0xb753('0xd')](_0xb753('0x18'),_0x323b3f,JSON[_0xb753('0x10')](_0x244591));_0x24502c(_0x244591);})['catch'](function(_0x2e8534){logger[_0xb753('0x11')](_0xb753('0x18'),_0x2e8534['message'],_0x323b3f);_0x39a6c3(_0x3be3d9['error'](0x1f4,_0x2e8534[_0xb753('0x13')]));});});};exports[_0xb753('0x22')]=function(_0x3b2a59){var _0x4a8edf=this;return new Promise(function(_0x49f858,_0x3b4ec6){return db[_0xb753('0x19')][_0xb753('0x23')](_0x3b2a59[_0xb753('0x24')],{'raw':_0x3b2a59[_0xb753('0x1a')]?_0x3b2a59[_0xb753('0x1a')][_0xb753('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b2a59['options']?_0x3b2a59['options'][_0xb753('0x1c')]||null:null,'attributes':_0x3b2a59[_0xb753('0x1a')]?_0x3b2a59[_0xb753('0x1a')][_0xb753('0x1d')]||null:null,'limit':_0x3b2a59[_0xb753('0x1a')]?_0x3b2a59[_0xb753('0x1a')]['limit']||null:null})[_0xb753('0xc')](function(_0x3a2089){logger['info'](_0xb753('0x22'),_0x3b2a59);logger['debug'](_0xb753('0x22'),_0x3b2a59,JSON[_0xb753('0x10')](_0x3a2089));_0x49f858(_0x3a2089);})[_0xb753('0x17')](function(_0x1daa9e){logger[_0xb753('0x11')](_0xb753('0x22'),_0x1daa9e[_0xb753('0x13')],_0x3b2a59);_0x3b4ec6(_0x4a8edf[_0xb753('0x11')](0x1f4,_0x1daa9e[_0xb753('0x13')]));});});};exports[_0xb753('0x25')]=function(_0x3a604f){var _0x49406d=this;return new Promise(function(_0x2d6817,_0xbbb5a6){return db[_0xb753('0x19')][_0xb753('0x26')]({'where':_0x3a604f['options']?_0x3a604f[_0xb753('0x1a')][_0xb753('0x1c')]||null:null})[_0xb753('0xc')](function(_0x5413b0){logger[_0xb753('0x15')](_0xb753('0x25'),_0x3a604f);logger[_0xb753('0xd')](_0xb753('0x25'),_0x3a604f,JSON[_0xb753('0x10')](_0x5413b0));_0x2d6817(_0x5413b0);})[_0xb753('0x17')](function(_0x1f7d0d){logger[_0xb753('0x11')](_0xb753('0x25'),_0x1f7d0d['message'],_0x3a604f);_0xbbb5a6(_0x49406d['error'](0x1f4,_0x1f7d0d['message']));});});}; \ No newline at end of file +var _0xd436=['options','raw','where','attributes','limit','include','map','model','stringify','UpdateCmHopperBlack','CmHopperBlack','body','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetCmHopperBlack'];(function(_0x81e59e,_0x5f082d){var _0x221350=function(_0x8c4b67){while(--_0x8c4b67){_0x81e59e['push'](_0x81e59e['shift']());}};_0x221350(++_0x5f082d);}(_0xd436,0xe6));var _0x6d43=function(_0x23840e,_0x2fb0cb){_0x23840e=_0x23840e-0x0;var _0x277300=_0xd436[_0x23840e];return _0x277300;};'use strict';var _=require('lodash');var util=require(_0x6d43('0x0'));var moment=require(_0x6d43('0x1'));var BPromise=require(_0x6d43('0x2'));var rs=require(_0x6d43('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d43('0x4'))['db'];var utils=require(_0x6d43('0x5'));var logger=require(_0x6d43('0x6'))(_0x6d43('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6d43('0x8')][_0x6d43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x77b717,_0x5374a0,_0x302fbb){return new BPromise(function(_0x482046,_0x32ccc7){return client['request'](_0x77b717,_0x302fbb)[_0x6d43('0xa')](function(_0xfbda54){logger[_0x6d43('0xb')](_0x6d43('0xc'),_0x5374a0,'request\x20sent');logger[_0x6d43('0xd')](_0x6d43('0xe'),_0x5374a0,_0x6d43('0xf'),JSON['stringify'](_0xfbda54));if(_0xfbda54[_0x6d43('0x10')]){if(_0xfbda54[_0x6d43('0x10')][_0x6d43('0x11')]===0x1f4){logger[_0x6d43('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x5374a0,_0xfbda54[_0x6d43('0x10')][_0x6d43('0x12')]);return _0x32ccc7(_0xfbda54[_0x6d43('0x10')]['message']);}logger[_0x6d43('0x10')](_0x6d43('0xc'),_0x5374a0,_0xfbda54[_0x6d43('0x10')][_0x6d43('0x12')]);return _0x482046(_0xfbda54[_0x6d43('0x10')][_0x6d43('0x12')]);}else{logger[_0x6d43('0xb')](_0x6d43('0xc'),_0x5374a0,_0x6d43('0xf'));_0x482046(_0xfbda54[_0x6d43('0x13')][_0x6d43('0x12')]);}})[_0x6d43('0x14')](function(_0x48ae73){logger[_0x6d43('0x10')](_0x6d43('0xc'),_0x5374a0,_0x48ae73);_0x32ccc7(_0x48ae73);});});}exports[_0x6d43('0x15')]=function(_0x44425c){var _0x4ee1c5=this;return new Promise(function(_0x273701,_0x3ddd20){return db['CmHopperBlack']['findAll']({'raw':_0x44425c[_0x6d43('0x16')]?_0x44425c[_0x6d43('0x16')][_0x6d43('0x17')]===undefined?!![]:![]:!![],'where':_0x44425c[_0x6d43('0x16')]?_0x44425c['options'][_0x6d43('0x18')]||null:null,'attributes':_0x44425c[_0x6d43('0x16')]?_0x44425c['options'][_0x6d43('0x19')]||null:null,'limit':_0x44425c[_0x6d43('0x16')]?_0x44425c[_0x6d43('0x16')][_0x6d43('0x1a')]||null:null,'include':_0x44425c[_0x6d43('0x16')]?_0x44425c[_0x6d43('0x16')][_0x6d43('0x1b')]?_[_0x6d43('0x1c')](_0x44425c['options']['include'],function(_0x2d726c){return{'model':db[_0x2d726c[_0x6d43('0x1d')]],'as':_0x2d726c['as'],'attributes':_0x2d726c[_0x6d43('0x19')],'include':_0x2d726c[_0x6d43('0x1b')]?_[_0x6d43('0x1c')](_0x2d726c[_0x6d43('0x1b')],function(_0x51381f){return{'model':db[_0x51381f['model']],'as':_0x51381f['as'],'attributes':_0x51381f[_0x6d43('0x19')],'include':_0x51381f[_0x6d43('0x1b')]?_[_0x6d43('0x1c')](_0x51381f['include'],function(_0x10041d){return{'model':db[_0x10041d[_0x6d43('0x1d')]],'as':_0x10041d['as'],'attributes':_0x10041d[_0x6d43('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6d43('0xa')](function(_0x575a34){logger[_0x6d43('0xb')](_0x6d43('0x15'),_0x44425c);logger['debug'](_0x6d43('0x15'),_0x44425c,JSON[_0x6d43('0x1e')](_0x575a34));_0x273701(_0x575a34);})[_0x6d43('0x14')](function(_0x26d2c4){logger[_0x6d43('0x10')](_0x6d43('0x15'),_0x26d2c4[_0x6d43('0x12')],_0x44425c);_0x3ddd20(_0x4ee1c5[_0x6d43('0x10')](0x1f4,_0x26d2c4['message']));});});};exports[_0x6d43('0x1f')]=function(_0x111445){var _0x3e032b=this;return new Promise(function(_0x2888ba,_0x222379){return db[_0x6d43('0x20')]['update'](_0x111445[_0x6d43('0x21')],{'raw':_0x111445['options']?_0x111445[_0x6d43('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x111445[_0x6d43('0x16')]?_0x111445['options']['where']||null:null,'attributes':_0x111445[_0x6d43('0x16')]?_0x111445[_0x6d43('0x16')][_0x6d43('0x19')]||null:null,'limit':_0x111445[_0x6d43('0x16')]?_0x111445[_0x6d43('0x16')][_0x6d43('0x1a')]||null:null})[_0x6d43('0xa')](function(_0x772bee){logger[_0x6d43('0xb')](_0x6d43('0x1f'),_0x111445);logger[_0x6d43('0xd')]('UpdateCmHopperBlack',_0x111445,JSON[_0x6d43('0x1e')](_0x772bee));_0x2888ba(_0x772bee);})[_0x6d43('0x14')](function(_0x393b9c){logger[_0x6d43('0x10')](_0x6d43('0x1f'),_0x393b9c['message'],_0x111445);_0x222379(_0x3e032b['error'](0x1f4,_0x393b9c['message']));});});};exports[_0x6d43('0x22')]=function(_0x4b0dff){var _0x5b4325=this;return new Promise(function(_0x4fb9e3,_0xffce06){return db[_0x6d43('0x20')][_0x6d43('0x23')]({'where':_0x4b0dff[_0x6d43('0x16')]?_0x4b0dff['options'][_0x6d43('0x18')]||null:null})[_0x6d43('0xa')](function(_0x171f7c){logger[_0x6d43('0xb')](_0x6d43('0x22'),_0x4b0dff);logger['debug'](_0x6d43('0x22'),_0x4b0dff,JSON[_0x6d43('0x1e')](_0x171f7c));_0x4fb9e3(_0x171f7c);})[_0x6d43('0x14')](function(_0x2799f2){logger[_0x6d43('0x10')]('DestroyCmHopperBlack',_0x2799f2[_0x6d43('0x12')],_0x4b0dff);_0xffce06(_0x5b4325[_0x6d43('0x10')](0x1f4,_0x2799f2[_0x6d43('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 9301ef1..1cde25b 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 _0x6f0d=['update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','describe','show','put','/:id'];(function(_0x16268e,_0x44d687){var _0x27bbfe=function(_0x2e7015){while(--_0x2e7015){_0x16268e['push'](_0x16268e['shift']());}};_0x27bbfe(++_0x44d687);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x1481d0,_0x2dcebe){_0x1481d0=_0x1481d0-0x0;var _0x1af8ff=_0x6f0d[_0x1481d0];return _0x1af8ff;};'use strict';var multer=require('multer');var util=require(_0xd6f0('0x0'));var path=require(_0xd6f0('0x1'));var timeout=require(_0xd6f0('0x2'));var express=require(_0xd6f0('0x3'));var router=express['Router']();var auth=require(_0xd6f0('0x4'));var interaction=require(_0xd6f0('0x5'));var config=require(_0xd6f0('0x6'));var controller=require(_0xd6f0('0x7'));router[_0xd6f0('0x8')]('/',auth['isAuthenticated'](),controller[_0xd6f0('0x9')]);router['get'](_0xd6f0('0xa'),auth[_0xd6f0('0xb')](),controller[_0xd6f0('0xc')]);router[_0xd6f0('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd6f0('0xd')]);router[_0xd6f0('0xe')](_0xd6f0('0xf'),auth[_0xd6f0('0xb')](),controller[_0xd6f0('0x10')]);router['delete'](_0xd6f0('0xf'),auth[_0xd6f0('0xb')](),controller[_0xd6f0('0x11')]);module[_0xd6f0('0x12')]=router; \ No newline at end of file +var _0x33c5=['destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete'];(function(_0x3c5675,_0x143a2c){var _0x90ad73=function(_0x1a9e7e){while(--_0x1a9e7e){_0x3c5675['push'](_0x3c5675['shift']());}};_0x90ad73(++_0x143a2c);}(_0x33c5,0xe6));var _0x533c=function(_0x156489,_0x2bbaf2){_0x156489=_0x156489-0x0;var _0x4d2814=_0x33c5[_0x156489];return _0x4d2814;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var auth=require(_0x533c('0x4'));var interaction=require(_0x533c('0x5'));var config=require(_0x533c('0x6'));var controller=require('./cmHopperBlack.controller');router[_0x533c('0x7')]('/',auth[_0x533c('0x8')](),controller[_0x533c('0x9')]);router[_0x533c('0x7')](_0x533c('0xa'),auth[_0x533c('0x8')](),controller[_0x533c('0xb')]);router[_0x533c('0x7')](_0x533c('0xc'),auth[_0x533c('0x8')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0xc'),auth[_0x533c('0x8')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')]('/:id',auth[_0x533c('0x8')](),controller[_0x533c('0x11')]);module[_0x533c('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index abe1a9e..ec2a7f2 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 _0x048c=['sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','followuptime','diff','seconds','setDataValue','dispositionat','BOOLEAN'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x048c,0xc4));var _0xc048=function(_0xbe4296,_0x49e915){_0xbe4296=_0xbe4296-0x0;var _0x4f94e7=_0x048c[_0xbe4296];return _0x4f94e7;};'use strict';var Sequelize=require(_0xc048('0x0'));var moment=require(_0xc048('0x1'));module[_0xc048('0x2')]={'state':{'type':Sequelize[_0xc048('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xc048('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xc048('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc048('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc048('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc048('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xc048('0x4')]},'calleridnum':{'type':Sequelize[_0xc048('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xc048('0x5')]},'responsetime':{'type':Sequelize[_0xc048('0x5')]},'answertime':{'type':Sequelize[_0xc048('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc048('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc048('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc048('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xc048('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xc048('0x4')]},'reason':{'type':Sequelize[_0xc048('0x4')]},'disposition':{'type':Sequelize[_0xc048('0x4')]},'dispositionat':{'type':Sequelize[_0xc048('0x5')],'set':function(_0x443a35){var _0x345e5e=this[_0xc048('0x6')](_0xc048('0x7'));if(_0x345e5e&&_0x443a35){this['setDataValue'](_0xc048('0x8'),moment(_0x443a35)[_0xc048('0x9')](moment(_0x345e5e),_0xc048('0xa')));}return this[_0xc048('0xb')](_0xc048('0xc'),_0x443a35);}},'amd':{'type':Sequelize[_0xc048('0xd')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xc048('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xc048('0xd')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc048('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc048('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xc048('0x5')]},'recallme':{'type':Sequelize[_0xc048('0xd')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xc048('0x5')]}}; \ No newline at end of file +var _0x99bc=['STRING','DATE','endtime','followuptime','diff','seconds','setDataValue','dispositionat','BOOLEAN','moment','INTEGER'];(function(_0xee41c4,_0x47ec43){var _0x1e5d7a=function(_0x139aa5){while(--_0x139aa5){_0xee41c4['push'](_0xee41c4['shift']());}};_0x1e5d7a(++_0x47ec43);}(_0x99bc,0x13d));var _0xc99b=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x99bc[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc99b('0x0'));module['exports']={'state':{'type':Sequelize[_0xc99b('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xc99b('0x2')]},'scheduledat':{'type':Sequelize[_0xc99b('0x3')]},'countbusyretry':{'type':Sequelize[_0xc99b('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc99b('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc99b('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc99b('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xc99b('0x2')]},'originatecalleridname':{'type':Sequelize[_0xc99b('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc99b('0x2')]},'starttime':{'type':Sequelize[_0xc99b('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xc99b('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc99b('0x3')]},'ringtime':{'type':Sequelize[_0xc99b('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc99b('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc99b('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc99b('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc99b('0x2')]},'campaign':{'type':Sequelize[_0xc99b('0x2')]},'campaigntype':{'type':Sequelize[_0xc99b('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xc99b('0x2')]},'disposition':{'type':Sequelize[_0xc99b('0x2')]},'dispositionat':{'type':Sequelize[_0xc99b('0x3')],'set':function(_0x4f19bb){var _0x4dfe31=this['getDataValue'](_0xc99b('0x4'));if(_0x4dfe31&&_0x4f19bb){this['setDataValue'](_0xc99b('0x5'),moment(_0x4f19bb)[_0xc99b('0x6')](moment(_0x4dfe31),_0xc99b('0x7')));}return this[_0xc99b('0x8')](_0xc99b('0x9'),_0x4f19bb);}},'amd':{'type':Sequelize[_0xc99b('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xc99b('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xc99b('0x3')]},'callback':{'type':Sequelize[_0xc99b('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc99b('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc99b('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xc99b('0x3')]},'recallme':{'type':Sequelize[_0xc99b('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 897e9fa..874a77e 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 _0x5080=['end','json','offset','limit','set','apply','save','update','then','destroy','error','name','send','CmHopperFinal','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','count','includeAll','include','findAll','rows','params','options','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','COUNT','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','catch','noSuchContacts','`state`\x20=\x205,\x201,\x20null','abandonedContacts','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','updatedAt','select','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','VoiceQueueId','createdAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','eml-format','zip-dir','request-promise','moment','bluebird','util','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x294c26,_0x22d0f0){var _0x32a48b=function(_0x458b37){while(--_0x458b37){_0x294c26['push'](_0x294c26['shift']());}};_0x32a48b(++_0x22d0f0);}(_0x5080,0x66));var _0x0508=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5080[_0x167cc1];return _0x10bc4b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0508('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0508('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0508('0x2'));var moment=require(_0x0508('0x3'));var BPromise=require(_0x0508('0x4'));var Mustache=require('mustache');var util=require(_0x0508('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0508('0x6'));var crypto=require(_0x0508('0x7'));var jsforce=require(_0x0508('0x8'));var deskjs=require(_0x0508('0x9'));var toCsv=require(_0x0508('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0508('0xb'));var authService=require(_0x0508('0xc'));var qs=require(_0x0508('0xd'));var hardwareService=require(_0x0508('0xe'));var logger=require(_0x0508('0xf'))(_0x0508('0x10'));var utils=require(_0x0508('0x11'));var config=require(_0x0508('0x12'));var db=require(_0x0508('0x13'))['db'];function respondWithStatusCode(_0x2e9858,_0x48f298){_0x48f298=_0x48f298||0xcc;return function(_0x215cc2){if(_0x215cc2){return _0x2e9858[_0x0508('0x14')](_0x48f298);}return _0x2e9858[_0x0508('0x15')](_0x48f298)[_0x0508('0x16')]();};}function respondWithResult(_0x19d040,_0x12d635){_0x12d635=_0x12d635||0xc8;return function(_0x32ac6b){if(_0x32ac6b){return _0x19d040[_0x0508('0x15')](_0x12d635)[_0x0508('0x17')](_0x32ac6b);}};}function respondWithFilteredResult(_0xed2bd0,_0x3d6e54){return function(_0x3478b9){if(_0x3478b9){var _0x79e57=_0x3478b9['count'],_0x6aa76b=_0x3d6e54[_0x0508('0x18')],_0x5da952=_0x3d6e54['offset']+_0x3d6e54[_0x0508('0x19')],_0x420893;if(_0x5da952>=_0x79e57){_0x5da952=_0x79e57;_0x420893=0xc8;}else{_0x420893=0xce;}_0xed2bd0[_0x0508('0x15')](_0x420893);return _0xed2bd0[_0x0508('0x1a')]('Content-Range',_0x6aa76b+'-'+_0x5da952+'/'+_0x79e57)[_0x0508('0x17')](_0x3478b9);}return null;};}function patchUpdates(_0x4447bd){return function(_0x1e7cfa){try{jsonpatch[_0x0508('0x1b')](_0x1e7cfa,_0x4447bd,!![]);}catch(_0x8f5564){return BPromise['reject'](_0x8f5564);}return _0x1e7cfa[_0x0508('0x1c')]();};}function saveUpdates(_0x35e106,_0x3b73da){return function(_0x42586e){if(_0x42586e){return _0x42586e[_0x0508('0x1d')](_0x35e106)[_0x0508('0x1e')](function(_0x5510af){return _0x5510af;});}return null;};}function removeEntity(_0x4aec32,_0x46b188){return function(_0x24e97b){if(_0x24e97b){return _0x24e97b[_0x0508('0x1f')]()['then'](function(){_0x4aec32[_0x0508('0x15')](0xcc)[_0x0508('0x16')]();});}};}function handleEntityNotFound(_0x1fa3b2,_0x474d28){return function(_0x11b979){if(!_0x11b979){_0x1fa3b2[_0x0508('0x14')](0x194);}return _0x11b979;};}function handleError(_0x5738a8,_0x403b1d){_0x403b1d=_0x403b1d||0x1f4;return function(_0x4a3b9b){logger[_0x0508('0x20')](_0x4a3b9b['stack']);if(_0x4a3b9b['name']){delete _0x4a3b9b[_0x0508('0x21')];}_0x5738a8[_0x0508('0x15')](_0x403b1d)[_0x0508('0x22')](_0x4a3b9b);};}exports['index']=function(_0x33c095,_0x53a14b){var _0xb11401={},_0x2461e5={},_0x1e8400={'count':0x0,'rows':[]};var _0xac773c=db[_0x0508('0x23')][_0x0508('0x24')];_0x2461e5[_0x0508('0x25')]=_[_0x0508('0x26')](_0xac773c);_0x2461e5['query']=_[_0x0508('0x26')](_0x33c095[_0x0508('0x27')]);_0x2461e5[_0x0508('0x28')]=_['intersection'](_0x2461e5['model'],_0x2461e5[_0x0508('0x27')]);_0xb11401[_0x0508('0x29')]=_[_0x0508('0x2a')](_0x2461e5[_0x0508('0x25')],qs[_0x0508('0x2b')](_0x33c095[_0x0508('0x27')][_0x0508('0x2b')]));_0xb11401[_0x0508('0x29')]=_0xb11401[_0x0508('0x29')][_0x0508('0x2c')]?_0xb11401['attributes']:_0x2461e5[_0x0508('0x25')];if(!_0x33c095[_0x0508('0x27')]['hasOwnProperty'](_0x0508('0x2d'))){_0xb11401['limit']=qs['limit'](_0x33c095[_0x0508('0x27')][_0x0508('0x19')]);_0xb11401['offset']=qs[_0x0508('0x18')](_0x33c095[_0x0508('0x27')][_0x0508('0x18')]);}_0xb11401[_0x0508('0x2e')]=qs[_0x0508('0x2f')](_0x33c095[_0x0508('0x27')][_0x0508('0x2f')]);_0xb11401[_0x0508('0x30')]=qs[_0x0508('0x28')](_[_0x0508('0x31')](_0x33c095['query'],_0x2461e5['filters']));if(_0x33c095[_0x0508('0x27')][_0x0508('0x32')]){_0xb11401[_0x0508('0x30')]=_[_0x0508('0x33')](_0xb11401[_0x0508('0x30')],{'$or':_[_0x0508('0x34')](_0xac773c,function(_0x2da998){if(_0x2da998[_0x0508('0x35')][_0x0508('0x36')]!==_0x0508('0x37')){var _0x831424={};_0x831424[_0x2da998[_0x0508('0x38')]]={'$like':'%'+_0x33c095['query']['filter']+'%'};return _0x831424;}})});}_0xb11401=_[_0x0508('0x33')]({},_0xb11401,_0x33c095['options']);var _0x310071={'where':_0xb11401[_0x0508('0x30')]};return db[_0x0508('0x23')][_0x0508('0x39')](_0x310071)[_0x0508('0x1e')](function(_0x569743){_0x1e8400[_0x0508('0x39')]=_0x569743;if(_0x33c095[_0x0508('0x27')][_0x0508('0x3a')]){_0xb11401[_0x0508('0x3b')]=[{'all':!![]}];}return db[_0x0508('0x23')][_0x0508('0x3c')](_0xb11401);})[_0x0508('0x1e')](function(_0x3b9af3){_0x1e8400[_0x0508('0x3d')]=_0x3b9af3;return _0x1e8400;})['then'](respondWithFilteredResult(_0x53a14b,_0xb11401))['catch'](handleError(_0x53a14b,null));};exports['show']=function(_0x8fe745,_0x4b1abc){var _0x3cce13={'raw':!![],'where':{'id':_0x8fe745[_0x0508('0x3e')]['id']}},_0x4b91de={};_0x4b91de[_0x0508('0x25')]=_['keys'](db[_0x0508('0x23')][_0x0508('0x24')]);_0x4b91de['query']=_[_0x0508('0x26')](_0x8fe745[_0x0508('0x27')]);_0x4b91de[_0x0508('0x28')]=_[_0x0508('0x2a')](_0x4b91de[_0x0508('0x25')],_0x4b91de[_0x0508('0x27')]);_0x3cce13[_0x0508('0x29')]=_[_0x0508('0x2a')](_0x4b91de['model'],qs['fields'](_0x8fe745[_0x0508('0x27')][_0x0508('0x2b')]));_0x3cce13[_0x0508('0x29')]=_0x3cce13[_0x0508('0x29')][_0x0508('0x2c')]?_0x3cce13['attributes']:_0x4b91de[_0x0508('0x25')];if(_0x8fe745[_0x0508('0x27')][_0x0508('0x3a')]){_0x3cce13['include']=[{'all':!![]}];}_0x3cce13=_[_0x0508('0x33')]({},_0x3cce13,_0x8fe745[_0x0508('0x3f')]);return db[_0x0508('0x23')][_0x0508('0x40')](_0x3cce13)[_0x0508('0x1e')](handleEntityNotFound(_0x4b1abc,null))[_0x0508('0x1e')](respondWithResult(_0x4b1abc,null))['catch'](handleError(_0x4b1abc,null));};exports['describe']=function(_0x3128e9,_0x390c59){return db[_0x0508('0x23')][_0x0508('0x41')]()['then'](respondWithResult(_0x390c59,null))['catch'](handleError(_0x390c59,null));};exports[_0x0508('0x1d')]=function(_0x1773e3,_0x2912c3){if(_0x1773e3['body'][_0x0508('0x42')]){delete _0x1773e3[_0x0508('0x43')]['uniqueid'];}return db[_0x0508('0x23')][_0x0508('0x40')]({'where':{'uniqueid':_0x1773e3[_0x0508('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2912c3,null))['then'](saveUpdates(_0x1773e3['body'],null))[_0x0508('0x1e')](respondWithResult(_0x2912c3,null))['catch'](handleError(_0x2912c3,null));};exports[_0x0508('0x44')]=function(_0x58faf0,_0x14206e,_0x591c39){return db[_0x0508('0x23')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x58faf0[_0x0508('0x3e')]['id']},'attributes':[[db[_0x0508('0x45')]['fn']('COUNT',db[_0x0508('0x45')]['fn']('IF',db[_0x0508('0x45')][_0x0508('0x46')](_0x0508('0x47')))),'noSuchContacts'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x0508('0x45')][_0x0508('0x46')](_0x0508('0x48')))),_0x0508('0x49')],[db[_0x0508('0x45')]['fn'](_0x0508('0x4a'),db['sequelize']['fn']('IF',db[_0x0508('0x45')][_0x0508('0x46')]('`state`\x20=\x205,\x201,\x20null'))),_0x0508('0x4b')],[db[_0x0508('0x45')]['fn'](_0x0508('0x4a'),db[_0x0508('0x45')]['fn']('IF',db[_0x0508('0x45')]['literal'](_0x0508('0x4c')))),_0x0508('0x4d')],[db[_0x0508('0x45')]['fn']('COUNT',db[_0x0508('0x45')]['fn']('IF',db[_0x0508('0x45')]['literal'](_0x0508('0x4e')))),_0x0508('0x4f')],[db[_0x0508('0x45')]['fn'](_0x0508('0x4a'),db['sequelize']['fn']('IF',db[_0x0508('0x45')][_0x0508('0x46')](_0x0508('0x50')))),'abandonedContacts'],[db[_0x0508('0x45')]['fn'](_0x0508('0x4a'),db[_0x0508('0x45')]['fn']('IF',db[_0x0508('0x45')][_0x0508('0x46')](_0x0508('0x51')))),'reCallContacts'],[db[_0x0508('0x45')]['fn'](_0x0508('0x4a'),db[_0x0508('0x45')]['fn']('IF',db['sequelize']['literal'](_0x0508('0x52')))),_0x0508('0x53')]]})[_0x0508('0x1e')](handleEntityNotFound(_0x14206e,null))[_0x0508('0x1e')](respondWithResult(_0x14206e,null))[_0x0508('0x54')](handleError(_0x14206e,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x590c87,_0x1b3583,_0xe5a050){return db[_0x0508('0x23')][_0x0508('0x3c')]({'raw':![],'where':{'CampaignId':_0x590c87[_0x0508('0x3e')]['id']},'attributes':[[db[_0x0508('0x45')]['fn'](_0x0508('0x4a'),db['sequelize']['fn']('IF',db['sequelize'][_0x0508('0x46')]('`state`\x20=\x200,\x201,\x20null'))),_0x0508('0x55')],[db['sequelize']['fn'](_0x0508('0x4a'),db[_0x0508('0x45')]['fn']('IF',db['sequelize'][_0x0508('0x46')](_0x0508('0x48')))),_0x0508('0x49')],[db[_0x0508('0x45')]['fn'](_0x0508('0x4a'),db[_0x0508('0x45')]['fn']('IF',db['sequelize'][_0x0508('0x46')](_0x0508('0x56')))),_0x0508('0x4b')],[db[_0x0508('0x45')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x0508('0x45')][_0x0508('0x46')](_0x0508('0x4c')))),_0x0508('0x4d')],[db[_0x0508('0x45')]['fn'](_0x0508('0x4a'),db[_0x0508('0x45')]['fn']('IF',db[_0x0508('0x45')][_0x0508('0x46')](_0x0508('0x4e')))),_0x0508('0x4f')],[db[_0x0508('0x45')]['fn'](_0x0508('0x4a'),db[_0x0508('0x45')]['fn']('IF',db['sequelize'][_0x0508('0x46')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x0508('0x57')],[db[_0x0508('0x45')]['fn']('COUNT',db[_0x0508('0x45')]['fn']('IF',db[_0x0508('0x45')][_0x0508('0x46')](_0x0508('0x51')))),_0x0508('0x58')],[db[_0x0508('0x45')]['fn']('COUNT',db[_0x0508('0x45')]['fn']('IF',db[_0x0508('0x45')][_0x0508('0x46')](_0x0508('0x52')))),_0x0508('0x53')]]})[_0x0508('0x1e')](handleEntityNotFound(_0x1b3583,null))[_0x0508('0x1e')](respondWithResult(_0x1b3583,null))[_0x0508('0x54')](handleError(_0x1b3583,null));};exports[_0x0508('0x59')]=function(_0x12616c,_0xd59974,_0x2dbfff){return db[_0x0508('0x5a')][_0x0508('0x40')]({'where':{'id':_0x12616c[_0x0508('0x3e')]['id']}})[_0x0508('0x1e')](handleEntityNotFound(_0xd59974,null))[_0x0508('0x1e')](function(_0x535081){var _0x3ef2ea;if(_0x535081){_0x3ef2ea=squel[_0x0508('0x5b')]()[_0x0508('0x5c')](_0x0508('0x5d'))[_0x0508('0x5e')]([_0x0508('0x5f'),_0x0508('0x60'),_0x0508('0x61'),_0x0508('0x62'),'VoiceQueueId','createdAt',_0x0508('0x63')],squel[_0x0508('0x64')]()['field']('ANY_VALUE(calleridnum)','phone')[_0x0508('0x38')](_0x0508('0x65'),_0x0508('0x60'))[_0x0508('0x38')](_0x0508('0x66'),_0x0508('0x61'))[_0x0508('0x38')](_0x0508('0x67'),_0x0508('0x62'))['field']('ANY_VALUE(VoiceQueueId)',_0x0508('0x68'))[_0x0508('0x38')](_0x0508('0x65'),_0x0508('0x69'))[_0x0508('0x38')](_0x0508('0x65'),_0x0508('0x63'))[_0x0508('0x6a')](_0x0508('0x6b'))[_0x0508('0x30')](_0x0508('0x6c'),_0x12616c['params']['id']['toString']())[_0x0508('0x30')](_0x0508('0x6d'),_0x12616c['body'][_0x0508('0x6e')][_0x0508('0x6f')]())[_0x0508('0x30')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x0508('0x30')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x0508('0x64')]()['field']('phone')[_0x0508('0x6a')]('cm_hopper')[_0x0508('0x30')](_0x0508('0x6c'),_0x12616c[_0x0508('0x3e')]['id'][_0x0508('0x6f')]()))[_0x0508('0x30')](_0x0508('0x70'),squel['select']()[_0x0508('0x38')](_0x0508('0x71'))[_0x0508('0x6a')](_0x0508('0x6b'))[_0x0508('0x30')](_0x0508('0x6c'),_0x12616c[_0x0508('0x3e')]['id']['toString']())[_0x0508('0x30')](_0x0508('0x72')))[_0x0508('0x73')](_0x0508('0x61')))[_0x0508('0x6f')]();return db[_0x0508('0x45')][_0x0508('0x27')](_0x3ef2ea);}return[];})['then'](respondWithResult(_0xd59974,null))['catch'](handleError(_0xd59974,null));};exports[_0x0508('0x74')]=function(_0x2fa6e1,_0xcfd3b2,_0x13869a){return db[_0x0508('0x75')][_0x0508('0x40')]({'where':{'id':_0x2fa6e1[_0x0508('0x3e')]['id']}})[_0x0508('0x1e')](handleEntityNotFound(_0xcfd3b2,null))[_0x0508('0x1e')](function(_0x26b800){var _0x4bb326;if(_0x26b800){_0x4bb326=squel[_0x0508('0x5b')]()[_0x0508('0x5c')](_0x0508('0x5d'))[_0x0508('0x5e')]([_0x0508('0x5f'),_0x0508('0x60'),_0x0508('0x61'),_0x0508('0x62'),'CampaignId',_0x0508('0x69'),_0x0508('0x63')],squel[_0x0508('0x64')]()[_0x0508('0x38')]('ANY_VALUE(calleridnum)',_0x0508('0x5f'))['field'](_0x0508('0x65'),'scheduledAt')[_0x0508('0x38')](_0x0508('0x66'),_0x0508('0x61'))[_0x0508('0x38')]('ANY_VALUE(ListId)',_0x0508('0x62'))[_0x0508('0x38')](_0x0508('0x76'),_0x0508('0x77'))[_0x0508('0x38')](_0x0508('0x65'),_0x0508('0x69'))[_0x0508('0x38')]('NOW()',_0x0508('0x63'))[_0x0508('0x6a')](_0x0508('0x6b'))[_0x0508('0x30')](_0x0508('0x78'),_0x2fa6e1['params']['id'][_0x0508('0x6f')]())['where'](_0x0508('0x6d'),_0x2fa6e1[_0x0508('0x43')][_0x0508('0x6e')][_0x0508('0x6f')]())[_0x0508('0x30')](_0x0508('0x79'))[_0x0508('0x30')](_0x0508('0x70'),squel[_0x0508('0x64')]()[_0x0508('0x38')]('phone')[_0x0508('0x6a')]('cm_hopper')['where'](_0x0508('0x78'),_0x2fa6e1[_0x0508('0x3e')]['id'][_0x0508('0x6f')]()))[_0x0508('0x30')](_0x0508('0x70'),squel[_0x0508('0x64')]()[_0x0508('0x38')](_0x0508('0x71'))[_0x0508('0x6a')](_0x0508('0x6b'))[_0x0508('0x30')](_0x0508('0x78'),_0x2fa6e1[_0x0508('0x3e')]['id'][_0x0508('0x6f')]())[_0x0508('0x30')](_0x0508('0x72')))[_0x0508('0x73')]('ContactId'))[_0x0508('0x6f')]();return db['sequelize'][_0x0508('0x27')](_0x4bb326);}return[];})[_0x0508('0x1e')](respondWithResult(_0xcfd3b2,null))['catch'](handleError(_0xcfd3b2,null));};exports['checkContactHopper']=function(_0x3eed8a,_0x1a3e27,_0x478f82){return db[_0x0508('0x7a')][_0x0508('0x7b')]({'where':{'VoiceQueueId':_0x3eed8a[_0x0508('0x43')][_0x0508('0x68')],'CampaignId':_0x3eed8a[_0x0508('0x43')][_0x0508('0x77')],'ContactId':_0x3eed8a[_0x0508('0x43')][_0x0508('0x61')]}})[_0x0508('0x1e')](handleEntityNotFound(_0x1a3e27,null))['then'](function(_0x3fabe7){if(_0x3fabe7){return _0x3fabe7;}return null;})[_0x0508('0x1e')](respondWithResult(_0x1a3e27,null))[_0x0508('0x54')](handleError(_0x1a3e27,null));}; \ No newline at end of file +var _0x9220=['VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','group','Campaign','into','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x204','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','findAll','rows','catch','show','params','intersection','include','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`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=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','abandonedContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from'];(function(_0x1f422c,_0x1453cd){var _0x28f767=function(_0x23e964){while(--_0x23e964){_0x1f422c['push'](_0x1f422c['shift']());}};_0x28f767(++_0x1453cd);}(_0x9220,0x96));var _0x0922=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9220[_0x53ccf2];return _0x5a2964;};'use strict';var pdf=require(_0x0922('0x0'));var emlformat=require(_0x0922('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0922('0x2'));var jsonpatch=require(_0x0922('0x3'));var rp=require(_0x0922('0x4'));var moment=require('moment');var BPromise=require(_0x0922('0x5'));var Mustache=require(_0x0922('0x6'));var util=require(_0x0922('0x7'));var path=require('path');var sox=require(_0x0922('0x8'));var csv=require(_0x0922('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0922('0xa'));var squel=require(_0x0922('0xb'));var crypto=require(_0x0922('0xc'));var jsforce=require(_0x0922('0xd'));var deskjs=require(_0x0922('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0922('0xf'));var Papa=require('papaparse');var Redis=require(_0x0922('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0922('0x11'));var hardwareService=require(_0x0922('0x12'));var logger=require(_0x0922('0x13'))(_0x0922('0x14'));var utils=require(_0x0922('0x15'));var config=require(_0x0922('0x16'));var db=require(_0x0922('0x17'))['db'];function respondWithStatusCode(_0x17a911,_0x5291a9){_0x5291a9=_0x5291a9||0xcc;return function(_0x3138a2){if(_0x3138a2){return _0x17a911[_0x0922('0x18')](_0x5291a9);}return _0x17a911[_0x0922('0x19')](_0x5291a9)[_0x0922('0x1a')]();};}function respondWithResult(_0x1f970c,_0x3305b1){_0x3305b1=_0x3305b1||0xc8;return function(_0x4b314c){if(_0x4b314c){return _0x1f970c[_0x0922('0x19')](_0x3305b1)['json'](_0x4b314c);}};}function respondWithFilteredResult(_0x1853cc,_0x4fc58c){return function(_0x3ecea5){if(_0x3ecea5){var _0x36afc7=_0x3ecea5[_0x0922('0x1b')],_0xb8df62=_0x4fc58c['offset'],_0x4ac437=_0x4fc58c[_0x0922('0x1c')]+_0x4fc58c[_0x0922('0x1d')],_0x31305b;if(_0x4ac437>=_0x36afc7){_0x4ac437=_0x36afc7;_0x31305b=0xc8;}else{_0x31305b=0xce;}_0x1853cc[_0x0922('0x19')](_0x31305b);return _0x1853cc[_0x0922('0x1e')](_0x0922('0x1f'),_0xb8df62+'-'+_0x4ac437+'/'+_0x36afc7)['json'](_0x3ecea5);}return null;};}function patchUpdates(_0x51ff15){return function(_0x5dfee2){try{jsonpatch[_0x0922('0x20')](_0x5dfee2,_0x51ff15,!![]);}catch(_0x833ee8){return BPromise[_0x0922('0x21')](_0x833ee8);}return _0x5dfee2['save']();};}function saveUpdates(_0x3ef446,_0x31d578){return function(_0x4076d9){if(_0x4076d9){return _0x4076d9[_0x0922('0x22')](_0x3ef446)[_0x0922('0x23')](function(_0x329da1){return _0x329da1;});}return null;};}function removeEntity(_0x26adc6,_0x5128be){return function(_0x4f21c5){if(_0x4f21c5){return _0x4f21c5[_0x0922('0x24')]()[_0x0922('0x23')](function(){_0x26adc6[_0x0922('0x19')](0xcc)[_0x0922('0x1a')]();});}};}function handleEntityNotFound(_0x1c5a8c,_0x1c5e16){return function(_0x59b8fa){if(!_0x59b8fa){_0x1c5a8c[_0x0922('0x18')](0x194);}return _0x59b8fa;};}function handleError(_0x54a772,_0x32fca8){_0x32fca8=_0x32fca8||0x1f4;return function(_0x26b988){logger[_0x0922('0x25')](_0x26b988[_0x0922('0x26')]);if(_0x26b988[_0x0922('0x27')]){delete _0x26b988[_0x0922('0x27')];}_0x54a772[_0x0922('0x19')](_0x32fca8)[_0x0922('0x28')](_0x26b988);};}exports[_0x0922('0x29')]=function(_0x14a3cc,_0x4fa298){var _0x366697={},_0xc8510a={},_0x19de33={'count':0x0,'rows':[]};var _0x5bdd50=db[_0x0922('0x2a')][_0x0922('0x2b')];_0xc8510a[_0x0922('0x2c')]=_[_0x0922('0x2d')](_0x5bdd50);_0xc8510a[_0x0922('0x2e')]=_[_0x0922('0x2d')](_0x14a3cc[_0x0922('0x2e')]);_0xc8510a[_0x0922('0x2f')]=_['intersection'](_0xc8510a[_0x0922('0x2c')],_0xc8510a[_0x0922('0x2e')]);_0x366697[_0x0922('0x30')]=_['intersection'](_0xc8510a[_0x0922('0x2c')],qs['fields'](_0x14a3cc[_0x0922('0x2e')][_0x0922('0x31')]));_0x366697[_0x0922('0x30')]=_0x366697[_0x0922('0x30')][_0x0922('0x32')]?_0x366697[_0x0922('0x30')]:_0xc8510a[_0x0922('0x2c')];if(!_0x14a3cc[_0x0922('0x2e')][_0x0922('0x33')](_0x0922('0x34'))){_0x366697[_0x0922('0x1d')]=qs[_0x0922('0x1d')](_0x14a3cc[_0x0922('0x2e')]['limit']);_0x366697[_0x0922('0x1c')]=qs[_0x0922('0x1c')](_0x14a3cc[_0x0922('0x2e')][_0x0922('0x1c')]);}_0x366697['order']=qs[_0x0922('0x35')](_0x14a3cc['query'][_0x0922('0x35')]);_0x366697[_0x0922('0x36')]=qs[_0x0922('0x2f')](_[_0x0922('0x37')](_0x14a3cc[_0x0922('0x2e')],_0xc8510a['filters']));if(_0x14a3cc[_0x0922('0x2e')][_0x0922('0x38')]){_0x366697[_0x0922('0x36')]=_['merge'](_0x366697['where'],{'$or':_[_0x0922('0x39')](_0x5bdd50,function(_0x4bb075){if(_0x4bb075[_0x0922('0x3a')][_0x0922('0x3b')]!==_0x0922('0x3c')){var _0x360f3a={};_0x360f3a[_0x4bb075[_0x0922('0x3d')]]={'$like':'%'+_0x14a3cc[_0x0922('0x2e')][_0x0922('0x38')]+'%'};return _0x360f3a;}})});}_0x366697=_[_0x0922('0x3e')]({},_0x366697,_0x14a3cc[_0x0922('0x3f')]);var _0x3486ae={'where':_0x366697['where']};return db['CmHopperFinal']['count'](_0x3486ae)[_0x0922('0x23')](function(_0x49e0ba){_0x19de33[_0x0922('0x1b')]=_0x49e0ba;if(_0x14a3cc[_0x0922('0x2e')][_0x0922('0x40')]){_0x366697['include']=[{'all':!![]}];}return db[_0x0922('0x2a')][_0x0922('0x41')](_0x366697);})['then'](function(_0x5d0de6){_0x19de33[_0x0922('0x42')]=_0x5d0de6;return _0x19de33;})[_0x0922('0x23')](respondWithFilteredResult(_0x4fa298,_0x366697))[_0x0922('0x43')](handleError(_0x4fa298,null));};exports[_0x0922('0x44')]=function(_0x1fe2be,_0x20381a){var _0x471554={'raw':!![],'where':{'id':_0x1fe2be[_0x0922('0x45')]['id']}},_0x4070cc={};_0x4070cc[_0x0922('0x2c')]=_[_0x0922('0x2d')](db['CmHopperFinal'][_0x0922('0x2b')]);_0x4070cc['query']=_['keys'](_0x1fe2be[_0x0922('0x2e')]);_0x4070cc[_0x0922('0x2f')]=_[_0x0922('0x46')](_0x4070cc[_0x0922('0x2c')],_0x4070cc[_0x0922('0x2e')]);_0x471554[_0x0922('0x30')]=_[_0x0922('0x46')](_0x4070cc[_0x0922('0x2c')],qs[_0x0922('0x31')](_0x1fe2be[_0x0922('0x2e')][_0x0922('0x31')]));_0x471554[_0x0922('0x30')]=_0x471554[_0x0922('0x30')]['length']?_0x471554['attributes']:_0x4070cc[_0x0922('0x2c')];if(_0x1fe2be[_0x0922('0x2e')][_0x0922('0x40')]){_0x471554[_0x0922('0x47')]=[{'all':!![]}];}_0x471554=_[_0x0922('0x3e')]({},_0x471554,_0x1fe2be[_0x0922('0x3f')]);return db[_0x0922('0x2a')][_0x0922('0x48')](_0x471554)[_0x0922('0x23')](handleEntityNotFound(_0x20381a,null))[_0x0922('0x23')](respondWithResult(_0x20381a,null))[_0x0922('0x43')](handleError(_0x20381a,null));};exports['describe']=function(_0x492ff5,_0x454da0){return db[_0x0922('0x2a')][_0x0922('0x49')]()[_0x0922('0x23')](respondWithResult(_0x454da0,null))[_0x0922('0x43')](handleError(_0x454da0,null));};exports['update']=function(_0x57aded,_0x988889){if(_0x57aded[_0x0922('0x4a')][_0x0922('0x4b')]){delete _0x57aded['body'][_0x0922('0x4b')];}return db[_0x0922('0x2a')][_0x0922('0x48')]({'where':{'uniqueid':_0x57aded[_0x0922('0x45')]['id']}})[_0x0922('0x23')](handleEntityNotFound(_0x988889,null))[_0x0922('0x23')](saveUpdates(_0x57aded['body'],null))['then'](respondWithResult(_0x988889,null))[_0x0922('0x43')](handleError(_0x988889,null));};exports[_0x0922('0x4c')]=function(_0x2a85bb,_0x3ae815,_0x341e60){return db[_0x0922('0x2a')][_0x0922('0x41')]({'raw':![],'where':{'VoiceQueueId':_0x2a85bb[_0x0922('0x45')]['id']},'attributes':[[db[_0x0922('0x4d')]['fn'](_0x0922('0x4e'),db[_0x0922('0x4d')]['fn']('IF',db['sequelize'][_0x0922('0x4f')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x0922('0x4d')]['fn'](_0x0922('0x4e'),db['sequelize']['fn']('IF',db[_0x0922('0x4d')][_0x0922('0x4f')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x0922('0x4d')]['fn'](_0x0922('0x4e'),db[_0x0922('0x4d')]['fn']('IF',db[_0x0922('0x4d')][_0x0922('0x4f')](_0x0922('0x50')))),_0x0922('0x51')],[db[_0x0922('0x4d')]['fn'](_0x0922('0x4e'),db['sequelize']['fn']('IF',db[_0x0922('0x4d')][_0x0922('0x4f')](_0x0922('0x52')))),_0x0922('0x53')],[db[_0x0922('0x4d')]['fn'](_0x0922('0x4e'),db[_0x0922('0x4d')]['fn']('IF',db['sequelize'][_0x0922('0x4f')](_0x0922('0x54')))),_0x0922('0x55')],[db[_0x0922('0x4d')]['fn'](_0x0922('0x4e'),db['sequelize']['fn']('IF',db[_0x0922('0x4d')][_0x0922('0x4f')](_0x0922('0x56')))),'abandonedContacts'],[db[_0x0922('0x4d')]['fn'](_0x0922('0x4e'),db[_0x0922('0x4d')]['fn']('IF',db[_0x0922('0x4d')][_0x0922('0x4f')](_0x0922('0x57')))),_0x0922('0x58')],[db[_0x0922('0x4d')]['fn'](_0x0922('0x4e'),db[_0x0922('0x4d')]['fn']('IF',db['sequelize'][_0x0922('0x4f')](_0x0922('0x59')))),_0x0922('0x5a')]]})[_0x0922('0x23')](handleEntityNotFound(_0x3ae815,null))[_0x0922('0x23')](respondWithResult(_0x3ae815,null))[_0x0922('0x43')](handleError(_0x3ae815,null));};exports[_0x0922('0x5b')]=function(_0x1239b9,_0x3dc1fb,_0x1b0106){return db[_0x0922('0x2a')][_0x0922('0x41')]({'raw':![],'where':{'CampaignId':_0x1239b9[_0x0922('0x45')]['id']},'attributes':[[db[_0x0922('0x4d')]['fn'](_0x0922('0x4e'),db['sequelize']['fn']('IF',db[_0x0922('0x4d')]['literal'](_0x0922('0x5c')))),_0x0922('0x5d')],[db[_0x0922('0x4d')]['fn'](_0x0922('0x4e'),db[_0x0922('0x4d')]['fn']('IF',db[_0x0922('0x4d')]['literal'](_0x0922('0x5e')))),_0x0922('0x5f')],[db['sequelize']['fn'](_0x0922('0x4e'),db[_0x0922('0x4d')]['fn']('IF',db[_0x0922('0x4d')]['literal'](_0x0922('0x50')))),_0x0922('0x51')],[db[_0x0922('0x4d')]['fn'](_0x0922('0x4e'),db[_0x0922('0x4d')]['fn']('IF',db['sequelize'][_0x0922('0x4f')](_0x0922('0x52')))),'congestionContacts'],[db[_0x0922('0x4d')]['fn'](_0x0922('0x4e'),db[_0x0922('0x4d')]['fn']('IF',db['sequelize'][_0x0922('0x4f')](_0x0922('0x54')))),_0x0922('0x55')],[db[_0x0922('0x4d')]['fn'](_0x0922('0x4e'),db[_0x0922('0x4d')]['fn']('IF',db[_0x0922('0x4d')][_0x0922('0x4f')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x0922('0x60')],[db[_0x0922('0x4d')]['fn'](_0x0922('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0x0922('0x4f')](_0x0922('0x57')))),_0x0922('0x58')],[db[_0x0922('0x4d')]['fn'](_0x0922('0x4e'),db[_0x0922('0x4d')]['fn']('IF',db[_0x0922('0x4d')][_0x0922('0x4f')](_0x0922('0x59')))),_0x0922('0x5a')]]})[_0x0922('0x23')](handleEntityNotFound(_0x3dc1fb,null))['then'](respondWithResult(_0x3dc1fb,null))[_0x0922('0x43')](handleError(_0x3dc1fb,null));};exports[_0x0922('0x61')]=function(_0xc12781,_0x3d348f,_0x462c84){return db[_0x0922('0x62')][_0x0922('0x48')]({'where':{'id':_0xc12781[_0x0922('0x45')]['id']}})[_0x0922('0x23')](handleEntityNotFound(_0x3d348f,null))[_0x0922('0x23')](function(_0x64836a){var _0x415e93;if(_0x64836a){_0x415e93=squel[_0x0922('0x63')]()['into'](_0x0922('0x64'))[_0x0922('0x65')]([_0x0922('0x66'),_0x0922('0x67'),_0x0922('0x68'),'ListId','VoiceQueueId',_0x0922('0x69'),_0x0922('0x6a')],squel[_0x0922('0x6b')]()['field'](_0x0922('0x6c'),'phone')['field'](_0x0922('0x6d'),'scheduledAt')['field'](_0x0922('0x6e'),_0x0922('0x68'))[_0x0922('0x3d')](_0x0922('0x6f'),_0x0922('0x70'))[_0x0922('0x3d')](_0x0922('0x71'),_0x0922('0x72'))[_0x0922('0x3d')](_0x0922('0x6d'),_0x0922('0x69'))[_0x0922('0x3d')](_0x0922('0x6d'),_0x0922('0x6a'))[_0x0922('0x73')]('cm_hopper_final')[_0x0922('0x36')](_0x0922('0x74'),_0xc12781[_0x0922('0x45')]['id']['toString']())[_0x0922('0x36')](_0x0922('0x75'),_0xc12781['body'][_0x0922('0x76')][_0x0922('0x77')]())[_0x0922('0x36')](_0x0922('0x78'))[_0x0922('0x36')](_0x0922('0x79'),squel['select']()['field'](_0x0922('0x66'))[_0x0922('0x73')](_0x0922('0x64'))[_0x0922('0x36')](_0x0922('0x74'),_0xc12781[_0x0922('0x45')]['id'][_0x0922('0x77')]()))[_0x0922('0x36')](_0x0922('0x79'),squel[_0x0922('0x6b')]()[_0x0922('0x3d')](_0x0922('0x7a'))[_0x0922('0x73')](_0x0922('0x7b'))[_0x0922('0x36')]('VoiceQueueId\x20=\x20?',_0xc12781[_0x0922('0x45')]['id'][_0x0922('0x77')]())['where']('state\x20=\x204'))[_0x0922('0x7c')](_0x0922('0x68')))[_0x0922('0x77')]();return db[_0x0922('0x4d')][_0x0922('0x2e')](_0x415e93);}return[];})[_0x0922('0x23')](respondWithResult(_0x3d348f,null))[_0x0922('0x43')](handleError(_0x3d348f,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x436b71,_0x5d61b8,_0x43a0d9){return db[_0x0922('0x7d')]['find']({'where':{'id':_0x436b71[_0x0922('0x45')]['id']}})[_0x0922('0x23')](handleEntityNotFound(_0x5d61b8,null))[_0x0922('0x23')](function(_0x54ad9f){var _0x1258b0;if(_0x54ad9f){_0x1258b0=squel[_0x0922('0x63')]()[_0x0922('0x7e')]('cm_hopper')[_0x0922('0x65')]([_0x0922('0x66'),_0x0922('0x67'),'ContactId',_0x0922('0x70'),'CampaignId',_0x0922('0x69'),_0x0922('0x6a')],squel[_0x0922('0x6b')]()[_0x0922('0x3d')]('ANY_VALUE(calleridnum)',_0x0922('0x66'))['field'](_0x0922('0x6d'),_0x0922('0x67'))[_0x0922('0x3d')](_0x0922('0x6e'),_0x0922('0x68'))['field'](_0x0922('0x6f'),_0x0922('0x70'))[_0x0922('0x3d')](_0x0922('0x7f'),'CampaignId')[_0x0922('0x3d')](_0x0922('0x6d'),_0x0922('0x69'))[_0x0922('0x3d')](_0x0922('0x6d'),_0x0922('0x6a'))[_0x0922('0x73')]('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x436b71[_0x0922('0x45')]['id'][_0x0922('0x77')]())[_0x0922('0x36')](_0x0922('0x75'),_0x436b71[_0x0922('0x4a')]['state'][_0x0922('0x77')]())['where'](_0x0922('0x78'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x0922('0x6b')]()[_0x0922('0x3d')]('phone')[_0x0922('0x73')]('cm_hopper')[_0x0922('0x36')](_0x0922('0x80'),_0x436b71[_0x0922('0x45')]['id'][_0x0922('0x77')]()))[_0x0922('0x36')](_0x0922('0x79'),squel[_0x0922('0x6b')]()[_0x0922('0x3d')](_0x0922('0x7a'))[_0x0922('0x73')](_0x0922('0x7b'))['where']('CampaignId\x20=\x20?',_0x436b71[_0x0922('0x45')]['id']['toString']())['where'](_0x0922('0x81')))[_0x0922('0x7c')]('ContactId'))[_0x0922('0x77')]();return db[_0x0922('0x4d')]['query'](_0x1258b0);}return[];})[_0x0922('0x23')](respondWithResult(_0x5d61b8,null))[_0x0922('0x43')](handleError(_0x5d61b8,null));};exports[_0x0922('0x82')]=function(_0x9f755b,_0x16769d,_0x47992e){return db[_0x0922('0x83')][_0x0922('0x84')]({'where':{'VoiceQueueId':_0x9f755b['body']['VoiceQueueId'],'CampaignId':_0x9f755b['body']['CampaignId'],'ContactId':_0x9f755b[_0x0922('0x4a')][_0x0922('0x68')]}})['then'](handleEntityNotFound(_0x16769d,null))[_0x0922('0x23')](function(_0x569317){if(_0x569317){return _0x569317;}return null;})[_0x0922('0x23')](respondWithResult(_0x16769d,null))[_0x0922('0x43')](handleError(_0x16769d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 76b92d1..2919f1b 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 _0x5ece=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','cm_hopper_final','calleridnum','uniqueid'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5ece,0x9c));var _0xe5ec=function(_0x272882,_0x511a69){_0x272882=_0x272882-0x0;var _0x6d190f=_0x5ece[_0x272882];return _0x6d190f;};'use strict';var _=require('lodash');var util=require(_0xe5ec('0x0'));var logger=require(_0xe5ec('0x1'))(_0xe5ec('0x2'));var moment=require(_0xe5ec('0x3'));var BPromise=require(_0xe5ec('0x4'));var rp=require(_0xe5ec('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe5ec('0x6'));var config=require(_0xe5ec('0x7'));var attributes=require(_0xe5ec('0x8'));module[_0xe5ec('0x9')]=function(_0x56cb7e,_0xe03dfa){return _0x56cb7e['define']('CmHopperFinal',attributes,{'tableName':_0xe5ec('0xa'),'paranoid':![],'indexes':[{'name':_0xe5ec('0xb'),'fields':['calleridnum']},{'name':_0xe5ec('0xc'),'fields':[_0xe5ec('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd0aa=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','uniqueid'];(function(_0x148819,_0x659d02){var _0x46cd45=function(_0x4ed64d){while(--_0x4ed64d){_0x148819['push'](_0x148819['shift']());}};_0x46cd45(++_0x659d02);}(_0xd0aa,0x1a4));var _0xad0a=function(_0x35ea1c,_0x4ddffa){_0x35ea1c=_0x35ea1c-0x0;var _0x44e040=_0xd0aa[_0x35ea1c];return _0x44e040;};'use strict';var _=require(_0xad0a('0x0'));var util=require(_0xad0a('0x1'));var logger=require('../../config/logger')(_0xad0a('0x2'));var moment=require(_0xad0a('0x3'));var BPromise=require('bluebird');var rp=require(_0xad0a('0x4'));var fs=require('fs');var path=require(_0xad0a('0x5'));var rimraf=require(_0xad0a('0x6'));var config=require(_0xad0a('0x7'));var attributes=require(_0xad0a('0x8'));module[_0xad0a('0x9')]=function(_0x55cd1a,_0x1ddab1){return _0x55cd1a[_0xad0a('0xa')](_0xad0a('0xb'),attributes,{'tableName':_0xad0a('0xc'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':_0xad0a('0xd'),'fields':[_0xad0a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index f144826..5d0b5c3 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 _0xa110=['create','body','options','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperFinal,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','CreateCmHopperFinal','CmHopperFinal'];(function(_0x550736,_0x1b674e){var _0x74f684=function(_0x3867ba){while(--_0x3867ba){_0x550736['push'](_0x550736['shift']());}};_0x74f684(++_0x1b674e);}(_0xa110,0x111));var _0x0a11=function(_0x277032,_0x48269d){_0x277032=_0x277032-0x0;var _0x56e081=_0xa110[_0x277032];return _0x56e081;};'use strict';var _=require(_0x0a11('0x0'));var util=require(_0x0a11('0x1'));var moment=require('moment');var BPromise=require(_0x0a11('0x2'));var rs=require(_0x0a11('0x3'));var fs=require('fs');var Redis=require(_0x0a11('0x4'));var db=require(_0x0a11('0x5'))['db'];var utils=require(_0x0a11('0x6'));var logger=require(_0x0a11('0x7'))(_0x0a11('0x8'));var config=require(_0x0a11('0x9'));var jayson=require(_0x0a11('0xa'));var client=jayson[_0x0a11('0xb')][_0x0a11('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2576ad,_0x1faaeb,_0x5ac9f1){return new BPromise(function(_0x5c7ad9,_0x1716f5){return client['request'](_0x2576ad,_0x5ac9f1)[_0x0a11('0xd')](function(_0x42b6e3){logger[_0x0a11('0xe')](_0x0a11('0xf'),_0x1faaeb,'request\x20sent');logger[_0x0a11('0x10')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x1faaeb,_0x0a11('0x11'),JSON[_0x0a11('0x12')](_0x42b6e3));if(_0x42b6e3['error']){if(_0x42b6e3[_0x0a11('0x13')]['code']===0x1f4){logger[_0x0a11('0x13')](_0x0a11('0xf'),_0x1faaeb,_0x42b6e3[_0x0a11('0x13')][_0x0a11('0x14')]);return _0x1716f5(_0x42b6e3[_0x0a11('0x13')][_0x0a11('0x14')]);}logger[_0x0a11('0x13')]('CmHopperFinal,\x20%s,\x20%s',_0x1faaeb,_0x42b6e3[_0x0a11('0x13')][_0x0a11('0x14')]);return _0x5c7ad9(_0x42b6e3[_0x0a11('0x13')][_0x0a11('0x14')]);}else{logger[_0x0a11('0xe')]('CmHopperFinal,\x20%s,\x20%s',_0x1faaeb,_0x0a11('0x11'));_0x5c7ad9(_0x42b6e3['result'][_0x0a11('0x14')]);}})[_0x0a11('0x15')](function(_0x5bbfa9){logger[_0x0a11('0x13')](_0x0a11('0xf'),_0x1faaeb,_0x5bbfa9);_0x1716f5(_0x5bbfa9);});});}exports[_0x0a11('0x16')]=function(_0x415441){var _0x522bbe=this;return new Promise(function(_0x9c043b,_0x10bbad){return db[_0x0a11('0x17')][_0x0a11('0x18')](_0x415441[_0x0a11('0x19')],{'raw':_0x415441[_0x0a11('0x1a')]?_0x415441[_0x0a11('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x0a11('0xd')](function(_0x24efed){logger['info']('CreateCmHopperFinal',_0x415441);logger['debug'](_0x0a11('0x16'),_0x415441,JSON[_0x0a11('0x12')](_0x24efed));_0x9c043b(_0x24efed);})[_0x0a11('0x15')](function(_0x1ded1c){logger[_0x0a11('0x13')](_0x0a11('0x16'),_0x1ded1c['message'],_0x415441);_0x10bbad(_0x522bbe['error'](0x1f4,_0x1ded1c['message']));});});}; \ No newline at end of file +var _0x9ef1=['CmHopperFinal','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateCmHopperFinal'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x9ef1,0x1b4));var _0x19ef=function(_0x2687b4,_0x1c1ae3){_0x2687b4=_0x2687b4-0x0;var _0x120a7c=_0x9ef1[_0x2687b4];return _0x120a7c;};'use strict';var _=require(_0x19ef('0x0'));var util=require(_0x19ef('0x1'));var moment=require(_0x19ef('0x2'));var BPromise=require(_0x19ef('0x3'));var rs=require(_0x19ef('0x4'));var fs=require('fs');var Redis=require(_0x19ef('0x5'));var db=require(_0x19ef('0x6'))['db'];var utils=require(_0x19ef('0x7'));var logger=require(_0x19ef('0x8'))(_0x19ef('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x19ef('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5859d4,_0x573716,_0x17f94e){return new BPromise(function(_0x3f4e6a,_0x2ee27b){return client[_0x19ef('0xb')](_0x5859d4,_0x17f94e)[_0x19ef('0xc')](function(_0xae548e){logger[_0x19ef('0xd')](_0x19ef('0xe'),_0x573716,_0x19ef('0xf'));logger[_0x19ef('0x10')](_0x19ef('0x11'),_0x573716,_0x19ef('0xf'),JSON[_0x19ef('0x12')](_0xae548e));if(_0xae548e[_0x19ef('0x13')]){if(_0xae548e[_0x19ef('0x13')]['code']===0x1f4){logger[_0x19ef('0x13')](_0x19ef('0xe'),_0x573716,_0xae548e[_0x19ef('0x13')]['message']);return _0x2ee27b(_0xae548e[_0x19ef('0x13')][_0x19ef('0x14')]);}logger[_0x19ef('0x13')]('CmHopperFinal,\x20%s,\x20%s',_0x573716,_0xae548e[_0x19ef('0x13')]['message']);return _0x3f4e6a(_0xae548e['error'][_0x19ef('0x14')]);}else{logger['info'](_0x19ef('0xe'),_0x573716,_0x19ef('0xf'));_0x3f4e6a(_0xae548e['result'][_0x19ef('0x14')]);}})[_0x19ef('0x15')](function(_0x473f4c){logger[_0x19ef('0x13')](_0x19ef('0xe'),_0x573716,_0x473f4c);_0x2ee27b(_0x473f4c);});});}exports[_0x19ef('0x16')]=function(_0x29ea78){var _0x5956eb=this;return new Promise(function(_0x184691,_0xafb13a){return db[_0x19ef('0x17')][_0x19ef('0x18')](_0x29ea78[_0x19ef('0x19')],{'raw':_0x29ea78[_0x19ef('0x1a')]?_0x29ea78[_0x19ef('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x19ef('0xc')](function(_0x51317d){logger[_0x19ef('0xd')](_0x19ef('0x16'),_0x29ea78);logger[_0x19ef('0x10')](_0x19ef('0x16'),_0x29ea78,JSON[_0x19ef('0x12')](_0x51317d));_0x184691(_0x51317d);})['catch'](function(_0x4e6d5a){logger[_0x19ef('0x13')](_0x19ef('0x16'),_0x4e6d5a['message'],_0x29ea78);_0xafb13a(_0x5956eb[_0x19ef('0x13')](0x1f4,_0x4e6d5a[_0x19ef('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 108140b..db2d108 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 _0x926b=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','/:id','multer'];(function(_0x224990,_0x59e356){var _0x1fbdb1=function(_0x2413c6){while(--_0x2413c6){_0x224990['push'](_0x224990['shift']());}};_0x1fbdb1(++_0x59e356);}(_0x926b,0x137));var _0xb926=function(_0x2e0534,_0x16f92f){_0x2e0534=_0x2e0534-0x0;var _0x4c3a96=_0x926b[_0x2e0534];return _0x4c3a96;};'use strict';var multer=require(_0xb926('0x0'));var util=require(_0xb926('0x1'));var path=require(_0xb926('0x2'));var timeout=require(_0xb926('0x3'));var express=require(_0xb926('0x4'));var router=express['Router']();var auth=require(_0xb926('0x5'));var interaction=require(_0xb926('0x6'));var config=require(_0xb926('0x7'));var controller=require('./cmHopperFinal.controller');router[_0xb926('0x8')]('/',auth['isAuthenticated'](),controller[_0xb926('0x9')]);router[_0xb926('0x8')](_0xb926('0xa'),auth[_0xb926('0xb')](),controller[_0xb926('0xc')]);router['get']('/:id',auth[_0xb926('0xb')](),controller[_0xb926('0xd')]);router[_0xb926('0x8')](_0xb926('0xe'),auth['isAuthenticated'](),controller[_0xb926('0xf')]);router['get']('/campaign/countAttributes/:id',auth[_0xb926('0xb')](),controller[_0xb926('0x10')]);router[_0xb926('0x11')](_0xb926('0x12'),auth[_0xb926('0xb')](),controller[_0xb926('0x13')]);router['post']('/voice/campaign/moveContacts/:id',auth[_0xb926('0xb')](),controller[_0xb926('0x14')]);router['post']('/checkContactHopper',auth[_0xb926('0xb')](),controller[_0xb926('0x15')]);router[_0xb926('0x16')](_0xb926('0x17'),auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x505f=['/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','/describe','describe','/:id','show','get','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal'];(function(_0x26407a,_0x3ce2ef){var _0x35e292=function(_0x11ba7d){while(--_0x11ba7d){_0x26407a['push'](_0x26407a['shift']());}};_0x35e292(++_0x3ce2ef);}(_0x505f,0x91));var _0xf505=function(_0x51679d,_0x40eabd){_0x51679d=_0x51679d-0x0;var _0x5effda=_0x505f[_0x51679d];return _0x5effda;};'use strict';var multer=require(_0xf505('0x0'));var util=require(_0xf505('0x1'));var path=require(_0xf505('0x2'));var timeout=require(_0xf505('0x3'));var express=require('express');var router=express[_0xf505('0x4')]();var auth=require(_0xf505('0x5'));var interaction=require(_0xf505('0x6'));var config=require(_0xf505('0x7'));var controller=require(_0xf505('0x8'));router['get']('/',auth[_0xf505('0x9')](),controller[_0xf505('0xa')]);router['get'](_0xf505('0xb'),auth[_0xf505('0x9')](),controller[_0xf505('0xc')]);router['get'](_0xf505('0xd'),auth[_0xf505('0x9')](),controller[_0xf505('0xe')]);router[_0xf505('0xf')](_0xf505('0x10'),auth[_0xf505('0x9')](),controller[_0xf505('0x11')]);router['get'](_0xf505('0x12'),auth[_0xf505('0x9')](),controller[_0xf505('0x13')]);router[_0xf505('0x14')](_0xf505('0x15'),auth['isAuthenticated'](),controller[_0xf505('0x16')]);router[_0xf505('0x14')](_0xf505('0x17'),auth[_0xf505('0x9')](),controller[_0xf505('0x18')]);router[_0xf505('0x14')]('/checkContactHopper',auth[_0xf505('0x9')](),controller[_0xf505('0x19')]);router['put'](_0xf505('0xd'),auth[_0xf505('0x9')](),controller[_0xf505('0x1a')]);module[_0xf505('0x1b')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 8dfbb2a..e4cdb51 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 _0xbba0=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x13cd94,_0x4864fe){var _0x1a2b26=function(_0x5477cd){while(--_0x5477cd){_0x13cd94['push'](_0x13cd94['shift']());}};_0x1a2b26(++_0x4864fe);}(_0xbba0,0xae));var _0x0bba=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xbba0[_0x344a3f];return _0x264712;};'use strict';var Sequelize=require(_0x0bba('0x0'));module[_0x0bba('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x0bba('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x0bba('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0bba('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0bba('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0bba('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x0bba('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x0bba('0x2')]},'calleridname':{'type':Sequelize[_0x0bba('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x0bba('0x4')]},'endtime':{'type':Sequelize[_0x0bba('0x4')]},'ringtime':{'type':Sequelize[_0x0bba('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0bba('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0bba('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0bba('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0bba('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x0bba('0x2')]},'membername':{'type':Sequelize[_0x0bba('0x2')]},'reason':{'type':Sequelize[_0x0bba('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x0bba('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0bba('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0bba('0x4')]},'recallme':{'type':Sequelize[_0x0bba('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x0bba('0x4')]},'edited':{'type':Sequelize[_0x0bba('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x5512=['sequelize','exports','INTEGER','DATE','STRING','BOOLEAN'];(function(_0x5ae6f8,_0x11648d){var _0x452539=function(_0x1819b2){while(--_0x1819b2){_0x5ae6f8['push'](_0x5ae6f8['shift']());}};_0x452539(++_0x11648d);}(_0x5512,0xea));var _0x2551=function(_0x532bf7,_0x329494){_0x532bf7=_0x532bf7-0x0;var _0x38367f=_0x5512[_0x532bf7];return _0x38367f;};'use strict';var Sequelize=require(_0x2551('0x0'));module[_0x2551('0x1')]={'state':{'type':Sequelize[_0x2551('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x2551('0x3')]},'countbusyretry':{'type':Sequelize[_0x2551('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2551('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2551('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2551('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x2551('0x4')]},'calleridnum':{'type':Sequelize[_0x2551('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x2551('0x3')]},'responsetime':{'type':Sequelize[_0x2551('0x3')]},'answertime':{'type':Sequelize[_0x2551('0x3')]},'droptime':{'type':Sequelize[_0x2551('0x3')]},'endtime':{'type':Sequelize[_0x2551('0x3')]},'ringtime':{'type':Sequelize[_0x2551('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2551('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2551('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2551('0x4')]},'campaign':{'type':Sequelize[_0x2551('0x4')]},'campaigntype':{'type':Sequelize[_0x2551('0x4')]},'membername':{'type':Sequelize[_0x2551('0x4')]},'reason':{'type':Sequelize[_0x2551('0x4')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x2551('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2551('0x3')]},'recallme':{'type':Sequelize[_0x2551('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x2551('0x3')]},'edited':{'type':Sequelize[_0x2551('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 2a17edf..8c403b4 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.controller.js +++ b/server/api/cmHopperHistory/cmHopperHistory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','describe','update','uniqueid','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','CmHopperHistory','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x61d131,_0x3307ac){var _0x428a2c=function(_0xfa3be){while(--_0xfa3be){_0x61d131['push'](_0x61d131['shift']());}};_0x428a2c(++_0x3307ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['CmHopperHistory'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){return db['CmHopperHistory'][_0x0a9e('0x41')]()['then'](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x8d6dd1,_0x562fb4){if(_0x8d6dd1[_0x0a9e('0x40')][_0x0a9e('0x43')]){delete _0x8d6dd1[_0x0a9e('0x40')][_0x0a9e('0x43')];}return db[_0x0a9e('0x24')][_0x0a9e('0x3e')]({'where':{'uniqueid':_0x8d6dd1[_0x0a9e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x562fb4,null))[_0x0a9e('0x1f')](saveUpdates(_0x8d6dd1[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x562fb4,null))[_0x0a9e('0x3b')](handleError(_0x562fb4,null));}; \ No newline at end of file +var _0x9957=['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','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','then','stack','name','send','index','CmHopperHistory','rawAttributes','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','create','body','update','uniqueid','params','html-pdf'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 hardwareService=require(_0x7995('0x15'));var logger=require(_0x7995('0x16'))('api');var utils=require(_0x7995('0x17'));var config=require(_0x7995('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb0c872,_0x2cb37a){_0x2cb37a=_0x2cb37a||0xcc;return function(_0x19a27e){if(_0x19a27e){return _0xb0c872[_0x7995('0x19')](_0x2cb37a);}return _0xb0c872[_0x7995('0x1a')](_0x2cb37a)[_0x7995('0x1b')]();};}function respondWithResult(_0x2bbe7a,_0x4cc004){_0x4cc004=_0x4cc004||0xc8;return function(_0x58f5ad){if(_0x58f5ad){return _0x2bbe7a[_0x7995('0x1a')](_0x4cc004)[_0x7995('0x1c')](_0x58f5ad);}};}function respondWithFilteredResult(_0x24b5bb,_0x321ae8){return function(_0x3f1d3e){if(_0x3f1d3e){var _0x1a5310=_0x3f1d3e[_0x7995('0x1d')],_0x2202ce=_0x321ae8['offset'],_0x41cbf0=_0x321ae8[_0x7995('0x1e')]+_0x321ae8[_0x7995('0x1f')],_0x5377e5;if(_0x41cbf0>=_0x1a5310){_0x41cbf0=_0x1a5310;_0x5377e5=0xc8;}else{_0x5377e5=0xce;}_0x24b5bb[_0x7995('0x1a')](_0x5377e5);return _0x24b5bb[_0x7995('0x20')](_0x7995('0x21'),_0x2202ce+'-'+_0x41cbf0+'/'+_0x1a5310)[_0x7995('0x1c')](_0x3f1d3e);}return null;};}function patchUpdates(_0x4faa60){return function(_0x54c9ae){try{jsonpatch[_0x7995('0x22')](_0x54c9ae,_0x4faa60,!![]);}catch(_0x5e6f90){return BPromise['reject'](_0x5e6f90);}return _0x54c9ae[_0x7995('0x23')]();};}function saveUpdates(_0x3d463e,_0x4cbe10){return function(_0x3a9b54){if(_0x3a9b54){return _0x3a9b54['update'](_0x3d463e)['then'](function(_0x3e4c54){return _0x3e4c54;});}return null;};}function removeEntity(_0x327b1f,_0x350fd9){return function(_0x1a8568){if(_0x1a8568){return _0x1a8568[_0x7995('0x24')]()[_0x7995('0x25')](function(){_0x327b1f['status'](0xcc)[_0x7995('0x1b')]();});}};}function handleEntityNotFound(_0x46ee4b,_0x204507){return function(_0x285437){if(!_0x285437){_0x46ee4b[_0x7995('0x19')](0x194);}return _0x285437;};}function handleError(_0x13bc35,_0x475351){_0x475351=_0x475351||0x1f4;return function(_0x472195){logger['error'](_0x472195[_0x7995('0x26')]);if(_0x472195[_0x7995('0x27')]){delete _0x472195[_0x7995('0x27')];}_0x13bc35[_0x7995('0x1a')](_0x475351)[_0x7995('0x28')](_0x472195);};}exports[_0x7995('0x29')]=function(_0x56691a,_0x47625f){var _0x5911c3={},_0x229742={},_0x49bc7e={'count':0x0,'rows':[]};var _0xf16cc2=db[_0x7995('0x2a')][_0x7995('0x2b')];_0x229742['model']=_[_0x7995('0x2c')](_0xf16cc2);_0x229742['query']=_[_0x7995('0x2c')](_0x56691a[_0x7995('0x2d')]);_0x229742[_0x7995('0x2e')]=_['intersection'](_0x229742['model'],_0x229742['query']);_0x5911c3[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x229742[_0x7995('0x31')],qs[_0x7995('0x32')](_0x56691a[_0x7995('0x2d')][_0x7995('0x32')]));_0x5911c3['attributes']=_0x5911c3['attributes'][_0x7995('0x33')]?_0x5911c3['attributes']:_0x229742[_0x7995('0x31')];if(!_0x56691a[_0x7995('0x2d')][_0x7995('0x34')](_0x7995('0x35'))){_0x5911c3[_0x7995('0x1f')]=qs['limit'](_0x56691a[_0x7995('0x2d')][_0x7995('0x1f')]);_0x5911c3['offset']=qs['offset'](_0x56691a['query'][_0x7995('0x1e')]);}_0x5911c3[_0x7995('0x36')]=qs['sort'](_0x56691a[_0x7995('0x2d')]['sort']);_0x5911c3[_0x7995('0x37')]=qs[_0x7995('0x2e')](_[_0x7995('0x38')](_0x56691a['query'],_0x229742['filters']));if(_0x56691a[_0x7995('0x2d')]['filter']){_0x5911c3['where']=_[_0x7995('0x39')](_0x5911c3[_0x7995('0x37')],{'$or':_['map'](_0xf16cc2,function(_0x1baa15){if(_0x1baa15[_0x7995('0x3a')][_0x7995('0x3b')]!==_0x7995('0x3c')){var _0x1e3dbf={};_0x1e3dbf[_0x1baa15['field']]={'$like':'%'+_0x56691a[_0x7995('0x2d')][_0x7995('0x3d')]+'%'};return _0x1e3dbf;}})});}_0x5911c3=_[_0x7995('0x39')]({},_0x5911c3,_0x56691a[_0x7995('0x3e')]);var _0x4b1541={'where':_0x5911c3[_0x7995('0x37')]};return db[_0x7995('0x2a')][_0x7995('0x1d')](_0x4b1541)[_0x7995('0x25')](function(_0x1f5bee){_0x49bc7e[_0x7995('0x1d')]=_0x1f5bee;if(_0x56691a['query'][_0x7995('0x3f')]){_0x5911c3[_0x7995('0x40')]=[{'all':!![]}];}return db[_0x7995('0x2a')][_0x7995('0x41')](_0x5911c3);})[_0x7995('0x25')](function(_0x298fc2){_0x49bc7e[_0x7995('0x42')]=_0x298fc2;return _0x49bc7e;})[_0x7995('0x25')](respondWithFilteredResult(_0x47625f,_0x5911c3))[_0x7995('0x43')](handleError(_0x47625f,null));};exports[_0x7995('0x44')]=function(_0x6fe77b,_0x270d52){var _0x7b4e67={'raw':!![],'where':{'id':_0x6fe77b['params']['id']}},_0x53cda2={};_0x53cda2[_0x7995('0x31')]=_[_0x7995('0x2c')](db['CmHopperHistory']['rawAttributes']);_0x53cda2[_0x7995('0x2d')]=_['keys'](_0x6fe77b['query']);_0x53cda2[_0x7995('0x2e')]=_[_0x7995('0x30')](_0x53cda2[_0x7995('0x31')],_0x53cda2['query']);_0x7b4e67[_0x7995('0x2f')]=_['intersection'](_0x53cda2[_0x7995('0x31')],qs['fields'](_0x6fe77b['query'][_0x7995('0x32')]));_0x7b4e67[_0x7995('0x2f')]=_0x7b4e67[_0x7995('0x2f')][_0x7995('0x33')]?_0x7b4e67['attributes']:_0x53cda2[_0x7995('0x31')];if(_0x6fe77b[_0x7995('0x2d')][_0x7995('0x3f')]){_0x7b4e67[_0x7995('0x40')]=[{'all':!![]}];}_0x7b4e67=_['merge']({},_0x7b4e67,_0x6fe77b['options']);return db[_0x7995('0x2a')]['find'](_0x7b4e67)[_0x7995('0x25')](handleEntityNotFound(_0x270d52,null))['then'](respondWithResult(_0x270d52,null))[_0x7995('0x43')](handleError(_0x270d52,null));};exports['create']=function(_0x1e795e,_0x1b0373){return db['CmHopperHistory'][_0x7995('0x45')](_0x1e795e[_0x7995('0x46')],{})[_0x7995('0x25')](respondWithResult(_0x1b0373,0xc9))[_0x7995('0x43')](handleError(_0x1b0373,null));};exports['describe']=function(_0x2458cb,_0x3e787d){return db[_0x7995('0x2a')]['describe']()[_0x7995('0x25')](respondWithResult(_0x3e787d,null))[_0x7995('0x43')](handleError(_0x3e787d,null));};exports[_0x7995('0x47')]=function(_0x3d8ae3,_0x255313){if(_0x3d8ae3['body'][_0x7995('0x48')]){delete _0x3d8ae3[_0x7995('0x46')]['uniqueid'];}return db[_0x7995('0x2a')]['find']({'where':{'uniqueid':_0x3d8ae3[_0x7995('0x49')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x255313,null))[_0x7995('0x25')](saveUpdates(_0x3d8ae3[_0x7995('0x46')],null))[_0x7995('0x25')](respondWithResult(_0x255313,null))[_0x7995('0x43')](handleError(_0x255313,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 6a7a175..621f48d 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 _0x562a=['uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopperHistory.attributes','exports','cm_hopper_history','endtime'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x562a,0x16d));var _0xa562=function(_0x115098,_0x95adb0){_0x115098=_0x115098-0x0;var _0x121b63=_0x562a[_0x115098];return _0x121b63;};'use strict';var _=require('lodash');var util=require(_0xa562('0x0'));var logger=require(_0xa562('0x1'))(_0xa562('0x2'));var moment=require(_0xa562('0x3'));var BPromise=require(_0xa562('0x4'));var rp=require(_0xa562('0x5'));var fs=require('fs');var path=require(_0xa562('0x6'));var rimraf=require('rimraf');var config=require(_0xa562('0x7'));var attributes=require(_0xa562('0x8'));module[_0xa562('0x9')]=function(_0x3a841e,_0x2dd747){return _0x3a841e['define']('CmHopperHistory',attributes,{'tableName':_0xa562('0xa'),'paranoid':![],'indexes':[{'name':_0xa562('0xb'),'fields':['endtime']},{'name':_0xa562('0xc'),'fields':[_0xa562('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0cb5=['endtime','uniqueid','lodash','util','moment','bluebird','path','rimraf','../../config/environment','exports','define','cm_hopper_history'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x0cb5,0x7a));var _0x50cb=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x0cb5[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x50cb('0x0'));var util=require(_0x50cb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x50cb('0x2'));var BPromise=require(_0x50cb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x50cb('0x4'));var rimraf=require(_0x50cb('0x5'));var config=require(_0x50cb('0x6'));var attributes=require('./cmHopperHistory.attributes');module[_0x50cb('0x7')]=function(_0x54b2e4,_0x11494e){return _0x54b2e4[_0x50cb('0x8')]('CmHopperHistory',attributes,{'tableName':_0x50cb('0x9'),'paranoid':![],'indexes':[{'name':_0x50cb('0xa'),'fields':['endtime']},{'name':'uniqueid','fields':[_0x50cb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index c36adda..83c60f8 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 _0xa74f=['GetVoiceQueueHopperHistory','findAll','raw','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateCmHopperHistory','CmHopperHistory','body','options','where','sequelize','col','predictiveIntervalTotalCalls','literal','COUNT','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','AvgHandleTime'];(function(_0x13e05c,_0x56cc37){var _0x5711f6=function(_0x4276ee){while(--_0x4276ee){_0x13e05c['push'](_0x13e05c['shift']());}};_0x5711f6(++_0x56cc37);}(_0xa74f,0x9a));var _0xfa74=function(_0x5c72ee,_0x5a8bf8){_0x5c72ee=_0x5c72ee-0x0;var _0x231876=_0xa74f[_0x5c72ee];return _0x231876;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa74('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x1'));var db=require(_0xfa74('0x2'))['db'];var utils=require(_0xfa74('0x3'));var logger=require(_0xfa74('0x4'))('rpc');var config=require(_0xfa74('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa74('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x9ddbd2,_0x3ac32e,_0x2d9fa9){return new BPromise(function(_0x287921,_0x344e04){return client['request'](_0x9ddbd2,_0x2d9fa9)[_0xfa74('0x7')](function(_0x37d4d8){logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,'request\x20sent');logger[_0xfa74('0xa')](_0xfa74('0xb'),_0x3ac32e,'request\x20sent',JSON[_0xfa74('0xc')](_0x37d4d8));if(_0x37d4d8[_0xfa74('0xd')]){if(_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xe')]===0x1f4){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x344e04(_0x37d4d8[_0xfa74('0xd')]['message']);}logger[_0xfa74('0xd')](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x287921(_0x37d4d8[_0xfa74('0xd')]['message']);}else{logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,_0xfa74('0x10'));_0x287921(_0x37d4d8[_0xfa74('0x11')][_0xfa74('0xf')]);}})[_0xfa74('0x12')](function(_0x3b9e32){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x3b9e32);_0x344e04(_0x3b9e32);});});}exports[_0xfa74('0x13')]=function(_0x51dda1){var _0x4928b6=this;return new Promise(function(_0x31d3c1,_0x25a36b){return db[_0xfa74('0x14')]['create'](_0x51dda1[_0xfa74('0x15')],{'raw':_0x51dda1[_0xfa74('0x16')]?_0x51dda1[_0xfa74('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xfa74('0x7')](function(_0x302eb4){logger[_0xfa74('0x8')]('CreateCmHopperHistory',_0x51dda1);logger['debug'](_0xfa74('0x13'),_0x51dda1,JSON[_0xfa74('0xc')](_0x302eb4));_0x31d3c1(_0x302eb4);})[_0xfa74('0x12')](function(_0xeaaa19){logger[_0xfa74('0xd')]('CreateCmHopperHistory',_0xeaaa19['message'],_0x51dda1);_0x25a36b(_0x4928b6[_0xfa74('0xd')](0x1f4,_0xeaaa19['message']));});});};exports['AvgHandleTime']=function(_0x529810){var _0x42c439=this;return new Promise(function(_0x286d6a,_0x42d9bf){return db['CmHopperHistory']['findAll']({'raw':_0x529810[_0xfa74('0x16')]?_0x529810[_0xfa74('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x529810[_0xfa74('0x16')]?_0x529810['options'][_0xfa74('0x17')]||null:null,'attributes':[[db[_0xfa74('0x18')]['fn']('COUNT',db[_0xfa74('0x18')][_0xfa74('0x19')]('id')),_0xfa74('0x1a')],[db[_0xfa74('0x18')]['fn']('COUNT',db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db['sequelize']['fn']('IF',db['sequelize'][_0xfa74('0x1b')]('`state`\x20=\x2010,\x201,\x20null'))),_0xfa74('0x1d')],[db['sequelize']['fn'](_0xfa74('0x1c'),db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')]('`state`\x20=\x2011,\x201,\x20null'))),_0xfa74('0x1e')],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1f'),db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')](_0xfa74('0x20')))),'predictiveIntervalAvgHoldtime'],[db[_0xfa74('0x18')]['fn']('AVG',db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')](_0xfa74('0x21')))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x390ed4){logger[_0xfa74('0x8')](_0xfa74('0x22'),_0x529810);logger[_0xfa74('0xa')]('AvgHandleTime',_0x529810,JSON[_0xfa74('0xc')](_0x390ed4));_0x286d6a(_0x390ed4);})[_0xfa74('0x12')](function(_0x501a70){logger['error']('AvgHandleTime',_0x501a70['message'],_0x529810);_0x42d9bf(_0x42c439['error'](0x1f4,_0x501a70[_0xfa74('0xf')]));});});};exports[_0xfa74('0x23')]=function(_0x3dcda3){var _0x235607=this;return new Promise(function(_0x2ab5a9,_0x304f6e){return db[_0xfa74('0x14')][_0xfa74('0x24')]({'raw':_0x3dcda3[_0xfa74('0x16')]?_0x3dcda3['options'][_0xfa74('0x25')]===undefined?!![]:![]:!![],'where':_0x3dcda3[_0xfa74('0x16')]?_0x3dcda3[_0xfa74('0x16')][_0xfa74('0x17')]||null:null,'attributes':[[_0xfa74('0x26'),_0xfa74('0x27')],[db['sequelize']['fn'](_0xfa74('0x1c'),db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')]('`state`\x20=\x200,\x201,\x20null'))),_0xfa74('0x28')],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db[_0xfa74('0x18')]['fn']('IF',db['sequelize'][_0xfa74('0x1b')](_0xfa74('0x29')))),_0xfa74('0x2a')],[db['sequelize']['fn']('COUNT',db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')](_0xfa74('0x2b')))),'outboundAnswerCallsDay'],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0xfa74('0x2c')],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')](_0xfa74('0x2d')))),'outboundCongestionCallsDay'],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xfa74('0x2e')],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')](_0xfa74('0x2f')))),_0xfa74('0x30')],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db['sequelize']['fn']('IF',db[_0xfa74('0x18')]['literal'](_0xfa74('0x31')))),_0xfa74('0x32')],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db['sequelize']['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')]('`state`\x20=\x2013,\x201,\x20null'))),_0xfa74('0x33')],[db[_0xfa74('0x18')]['fn']('COUNT',db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')](_0xfa74('0x34')))),_0xfa74('0x35')],[db['sequelize']['fn']('COUNT',db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')]['literal'](_0xfa74('0x36')))),_0xfa74('0x37')],[db[_0xfa74('0x18')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')](_0xfa74('0x38')))),_0xfa74('0x39')],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')]['literal'](_0xfa74('0x3a')))),_0xfa74('0x37')],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db['sequelize']['fn']('IF',db['sequelize'][_0xfa74('0x1b')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xfa74('0x3b')]],'group':[_0xfa74('0x26')]})[_0xfa74('0x7')](function(_0x33e31e){logger[_0xfa74('0x8')](_0xfa74('0x23'),_0x3dcda3);logger[_0xfa74('0xa')]('GetVoiceQueueHopperHistory',_0x3dcda3,JSON[_0xfa74('0xc')](_0x33e31e));_0x2ab5a9(_0x33e31e);})['catch'](function(_0x21d7c5){logger['error']('GetVoiceQueueHopperHistory',_0x21d7c5[_0xfa74('0xf')],_0x3dcda3);_0x304f6e(_0x235607[_0xfa74('0xd')](0x1f4,_0x21d7c5['message']));});});};exports['GetCampaignHopperHistory']=function(_0x6e588d){var _0x1ab715=this;return new Promise(function(_0x8afe72,_0x234899){return db[_0xfa74('0x14')][_0xfa74('0x24')]({'raw':_0x6e588d[_0xfa74('0x16')]?_0x6e588d[_0xfa74('0x16')][_0xfa74('0x25')]===undefined?!![]:![]:!![],'where':_0x6e588d[_0xfa74('0x16')]?_0x6e588d['options'][_0xfa74('0x17')]||null:null,'attributes':[[_0xfa74('0x26'),'name'],[db['sequelize']['fn'](_0xfa74('0x1c'),db[_0xfa74('0x18')][_0xfa74('0x19')]('id')),_0xfa74('0x3c')],[db[_0xfa74('0x18')]['fn']('COUNT',db[_0xfa74('0x18')]['fn']('IF',db['sequelize'][_0xfa74('0x1b')](_0xfa74('0x2b')))),_0xfa74('0x3d')]],'group':['campaign']})['then'](function(_0x2d300a){logger[_0xfa74('0x8')](_0xfa74('0x3e'),_0x6e588d);logger[_0xfa74('0xa')]('GetCampaignHopperHistory',_0x6e588d,JSON[_0xfa74('0xc')](_0x2d300a));_0x8afe72(_0x2d300a);})[_0xfa74('0x12')](function(_0x5a2494){logger[_0xfa74('0xd')](_0xfa74('0x3e'),_0x5a2494[_0xfa74('0xf')],_0x6e588d);_0x234899(_0x1ab715[_0xfa74('0xd')](0x1f4,_0x5a2494['message']));});});}; \ No newline at end of file +var _0x5c00=['outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateCmHopperHistory','create','body','options','raw','AvgHandleTime','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','CmHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null'];(function(_0xf84870,_0x4dc38f){var _0x4541a4=function(_0x3ff5d5){while(--_0x3ff5d5){_0xf84870['push'](_0xf84870['shift']());}};_0x4541a4(++_0x4dc38f);}(_0x5c00,0x17e));var _0x05c0=function(_0x8ed2fe,_0x19ca78){_0x8ed2fe=_0x8ed2fe-0x0;var _0x23a751=_0x5c00[_0x8ed2fe];return _0x23a751;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var moment=require(_0x05c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x05c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05c0('0x4'))['db'];var utils=require(_0x05c0('0x5'));var logger=require(_0x05c0('0x6'))(_0x05c0('0x7'));var config=require('../../config/environment');var jayson=require(_0x05c0('0x8'));var client=jayson[_0x05c0('0x9')][_0x05c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27dc10,_0x5b9f09,_0x3a3b1b){return new BPromise(function(_0x34eb5f,_0x3ad5b7){return client['request'](_0x27dc10,_0x3a3b1b)[_0x05c0('0xb')](function(_0x32cdfa){logger[_0x05c0('0xc')](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));logger[_0x05c0('0xf')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x5b9f09,'request\x20sent',JSON[_0x05c0('0x10')](_0x32cdfa));if(_0x32cdfa['error']){if(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x12')]===0x1f4){logger[_0x05c0('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x5b9f09,_0x32cdfa[_0x05c0('0x11')]['message']);return _0x3ad5b7(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);return _0x34eb5f(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}else{logger['info'](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));_0x34eb5f(_0x32cdfa[_0x05c0('0x14')][_0x05c0('0x13')]);}})[_0x05c0('0x15')](function(_0x40153e){logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x40153e);_0x3ad5b7(_0x40153e);});});}exports[_0x05c0('0x16')]=function(_0x521cbd){var _0x422401=this;return new Promise(function(_0x1230e5,_0x4613c0){return db['CmHopperHistory'][_0x05c0('0x17')](_0x521cbd[_0x05c0('0x18')],{'raw':_0x521cbd[_0x05c0('0x19')]?_0x521cbd[_0x05c0('0x19')][_0x05c0('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x407c1f){logger[_0x05c0('0xc')]('CreateCmHopperHistory',_0x521cbd);logger['debug']('CreateCmHopperHistory',_0x521cbd,JSON[_0x05c0('0x10')](_0x407c1f));_0x1230e5(_0x407c1f);})[_0x05c0('0x15')](function(_0x83f29){logger[_0x05c0('0x11')](_0x05c0('0x16'),_0x83f29[_0x05c0('0x13')],_0x521cbd);_0x4613c0(_0x422401[_0x05c0('0x11')](0x1f4,_0x83f29['message']));});});};exports[_0x05c0('0x1b')]=function(_0x1abbf3){var _0x4ba978=this;return new Promise(function(_0x530966,_0x4da6d6){return db['CmHopperHistory']['findAll']({'raw':_0x1abbf3[_0x05c0('0x19')]?_0x1abbf3[_0x05c0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1abbf3[_0x05c0('0x19')]?_0x1abbf3[_0x05c0('0x19')][_0x05c0('0x1c')]||null:null,'attributes':[[db[_0x05c0('0x1d')]['fn']('COUNT',db[_0x05c0('0x1d')][_0x05c0('0x1e')]('id')),_0x05c0('0x1f')],[db[_0x05c0('0x1d')]['fn'](_0x05c0('0x20'),db[_0x05c0('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x05c0('0x21')))),_0x05c0('0x22')],[db[_0x05c0('0x1d')]['fn'](_0x05c0('0x20'),db[_0x05c0('0x1d')]['fn']('IF',db[_0x05c0('0x1d')][_0x05c0('0x23')](_0x05c0('0x24')))),_0x05c0('0x25')],[db[_0x05c0('0x1d')]['fn'](_0x05c0('0x20'),db[_0x05c0('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x05c0('0x26')))),_0x05c0('0x27')],[db[_0x05c0('0x1d')]['fn']('AVG',db[_0x05c0('0x1d')]['fn']('IF',db[_0x05c0('0x1d')]['literal'](_0x05c0('0x28')))),'predictiveIntervalAvgHoldtime'],[db[_0x05c0('0x1d')]['fn'](_0x05c0('0x29'),db[_0x05c0('0x1d')]['fn']('IF',db[_0x05c0('0x1d')][_0x05c0('0x23')](_0x05c0('0x2a')))),_0x05c0('0x2b')]]})[_0x05c0('0xb')](function(_0x3d8d76){logger[_0x05c0('0xc')](_0x05c0('0x1b'),_0x1abbf3);logger[_0x05c0('0xf')](_0x05c0('0x1b'),_0x1abbf3,JSON[_0x05c0('0x10')](_0x3d8d76));_0x530966(_0x3d8d76);})[_0x05c0('0x15')](function(_0x3382f6){logger[_0x05c0('0x11')](_0x05c0('0x1b'),_0x3382f6[_0x05c0('0x13')],_0x1abbf3);_0x4da6d6(_0x4ba978[_0x05c0('0x11')](0x1f4,_0x3382f6[_0x05c0('0x13')]));});});};exports[_0x05c0('0x2c')]=function(_0x9ca737){var _0x285422=this;return new Promise(function(_0x3d3291,_0x2c9359){return db[_0x05c0('0x2d')][_0x05c0('0x2e')]({'raw':_0x9ca737[_0x05c0('0x19')]?_0x9ca737[_0x05c0('0x19')][_0x05c0('0x1a')]===undefined?!![]:![]:!![],'where':_0x9ca737[_0x05c0('0x19')]?_0x9ca737[_0x05c0('0x19')]['where']||null:null,'attributes':[[_0x05c0('0x2f'),_0x05c0('0x30')],[db[_0x05c0('0x1d')]['fn'](_0x05c0('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x05c0('0x23')](_0x05c0('0x31')))),_0x05c0('0x32')],[db['sequelize']['fn'](_0x05c0('0x20'),db[_0x05c0('0x1d')]['fn']('IF',db[_0x05c0('0x1d')][_0x05c0('0x23')]('`state`\x20=\x203,\x201,\x20null'))),_0x05c0('0x33')],[db[_0x05c0('0x1d')]['fn']('COUNT',db[_0x05c0('0x1d')]['fn']('IF',db[_0x05c0('0x1d')][_0x05c0('0x23')](_0x05c0('0x21')))),_0x05c0('0x34')],[db[_0x05c0('0x1d')]['fn'](_0x05c0('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x05c0('0x23')](_0x05c0('0x35')))),_0x05c0('0x36')],[db[_0x05c0('0x1d')]['fn'](_0x05c0('0x20'),db['sequelize']['fn']('IF',db[_0x05c0('0x1d')][_0x05c0('0x23')](_0x05c0('0x37')))),_0x05c0('0x38')],[db[_0x05c0('0x1d')]['fn'](_0x05c0('0x20'),db[_0x05c0('0x1d')]['fn']('IF',db['sequelize'][_0x05c0('0x23')](_0x05c0('0x39')))),_0x05c0('0x3a')],[db[_0x05c0('0x1d')]['fn'](_0x05c0('0x20'),db[_0x05c0('0x1d')]['fn']('IF',db[_0x05c0('0x1d')][_0x05c0('0x23')](_0x05c0('0x3b')))),_0x05c0('0x3c')],[db[_0x05c0('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x05c0('0x1d')][_0x05c0('0x23')](_0x05c0('0x3d')))),_0x05c0('0x3e')],[db[_0x05c0('0x1d')]['fn'](_0x05c0('0x20'),db['sequelize']['fn']('IF',db[_0x05c0('0x1d')][_0x05c0('0x23')](_0x05c0('0x3f')))),_0x05c0('0x40')],[db['sequelize']['fn'](_0x05c0('0x20'),db[_0x05c0('0x1d')]['fn']('IF',db[_0x05c0('0x1d')][_0x05c0('0x23')]('`state`\x20=\x2014,\x201,\x20null'))),_0x05c0('0x41')],[db[_0x05c0('0x1d')]['fn'](_0x05c0('0x20'),db[_0x05c0('0x1d')]['fn']('IF',db['sequelize'][_0x05c0('0x23')](_0x05c0('0x42')))),'outboundRejectCallsDay'],[db[_0x05c0('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x05c0('0x1d')]['literal'](_0x05c0('0x43')))),_0x05c0('0x44')],[db[_0x05c0('0x1d')]['fn'](_0x05c0('0x20'),db[_0x05c0('0x1d')]['fn']('IF',db[_0x05c0('0x1d')]['literal'](_0x05c0('0x45')))),'outboundRejectCallsDay'],[db[_0x05c0('0x1d')]['fn'](_0x05c0('0x20'),db[_0x05c0('0x1d')]['fn']('IF',db[_0x05c0('0x1d')][_0x05c0('0x23')](_0x05c0('0x46')))),_0x05c0('0x47')]],'group':['campaign']})['then'](function(_0x523153){logger[_0x05c0('0xc')](_0x05c0('0x2c'),_0x9ca737);logger['debug']('GetVoiceQueueHopperHistory',_0x9ca737,JSON[_0x05c0('0x10')](_0x523153));_0x3d3291(_0x523153);})[_0x05c0('0x15')](function(_0x476e16){logger[_0x05c0('0x11')](_0x05c0('0x2c'),_0x476e16[_0x05c0('0x13')],_0x9ca737);_0x2c9359(_0x285422[_0x05c0('0x11')](0x1f4,_0x476e16['message']));});});};exports[_0x05c0('0x48')]=function(_0x46105a){var _0x189a9a=this;return new Promise(function(_0x179e5a,_0x4b5e1f){return db[_0x05c0('0x2d')]['findAll']({'raw':_0x46105a[_0x05c0('0x19')]?_0x46105a[_0x05c0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x46105a[_0x05c0('0x19')]?_0x46105a['options'][_0x05c0('0x1c')]||null:null,'attributes':[[_0x05c0('0x2f'),_0x05c0('0x30')],[db[_0x05c0('0x1d')]['fn'](_0x05c0('0x20'),db[_0x05c0('0x1d')]['col']('id')),_0x05c0('0x49')],[db[_0x05c0('0x1d')]['fn'](_0x05c0('0x20'),db[_0x05c0('0x1d')]['fn']('IF',db[_0x05c0('0x1d')][_0x05c0('0x23')]('`state`\x20=\x204,\x201,\x20null'))),_0x05c0('0x4a')]],'group':[_0x05c0('0x2f')]})[_0x05c0('0xb')](function(_0x41de8c){logger[_0x05c0('0xc')](_0x05c0('0x48'),_0x46105a);logger[_0x05c0('0xf')](_0x05c0('0x48'),_0x46105a,JSON[_0x05c0('0x10')](_0x41de8c));_0x179e5a(_0x41de8c);})[_0x05c0('0x15')](function(_0x23cc3e){logger[_0x05c0('0x11')]('GetCampaignHopperHistory',_0x23cc3e['message'],_0x46105a);_0x4b5e1f(_0x189a9a['error'](0x1f4,_0x23cc3e[_0x05c0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 9d56f88..cc63c41 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 _0x4d31=['/describe','get','show','post','update','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index'];(function(_0x2b7b08,_0xbd2fca){var _0x1d8dac=function(_0x402cd7){while(--_0x402cd7){_0x2b7b08['push'](_0x2b7b08['shift']());}};_0x1d8dac(++_0xbd2fca);}(_0x4d31,0x15a));var _0x14d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4d31[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x14d3('0x0'));var util=require(_0x14d3('0x1'));var path=require(_0x14d3('0x2'));var timeout=require('connect-timeout');var express=require(_0x14d3('0x3'));var router=express[_0x14d3('0x4')]();var auth=require(_0x14d3('0x5'));var interaction=require(_0x14d3('0x6'));var config=require(_0x14d3('0x7'));var controller=require(_0x14d3('0x8'));router['get']('/',auth[_0x14d3('0x9')](),controller[_0x14d3('0xa')]);router['get'](_0x14d3('0xb'),auth[_0x14d3('0x9')](),controller['describe']);router[_0x14d3('0xc')]('/:id',auth[_0x14d3('0x9')](),controller[_0x14d3('0xd')]);router[_0x14d3('0xe')]('/',auth[_0x14d3('0x9')](),controller['create']);router['put']('/:id',auth[_0x14d3('0x9')](),controller[_0x14d3('0xf')]);module[_0x14d3('0x10')]=router; \ No newline at end of file +var _0xa59b=['put','update','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create'];(function(_0x5155e9,_0x59c691){var _0xd66ef=function(_0x1821d6){while(--_0x1821d6){_0x5155e9['push'](_0x5155e9['shift']());}};_0xd66ef(++_0x59c691);}(_0xa59b,0x158));var _0xba59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa59b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xba59('0x0'));var util=require(_0xba59('0x1'));var path=require('path');var timeout=require(_0xba59('0x2'));var express=require(_0xba59('0x3'));var router=express[_0xba59('0x4')]();var auth=require(_0xba59('0x5'));var interaction=require(_0xba59('0x6'));var config=require(_0xba59('0x7'));var controller=require('./cmHopperHistory.controller');router[_0xba59('0x8')]('/',auth[_0xba59('0x9')](),controller[_0xba59('0xa')]);router[_0xba59('0x8')](_0xba59('0xb'),auth[_0xba59('0x9')](),controller[_0xba59('0xc')]);router['get'](_0xba59('0xd'),auth[_0xba59('0x9')](),controller['show']);router[_0xba59('0xe')]('/',auth[_0xba59('0x9')](),controller[_0xba59('0xf')]);router[_0xba59('0x10')](_0xba59('0xd'),auth[_0xba59('0x9')](),controller[_0xba59('0x11')]);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 740287d..3206626 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 _0xb478=['name','exports','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xb478,0x10f));var _0x8b47=function(_0x493cea,_0x144c6a){_0x493cea=_0x493cea-0x0;var _0x1c32ba=_0xb478[_0x493cea];return _0x1c32ba;};'use strict';var Sequelize=require('sequelize');module[_0x8b47('0x0')]={'name':{'type':Sequelize[_0x8b47('0x1')],'unique':_0x8b47('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x540c=['STRING','exports'];(function(_0x21a792,_0x26f172){var _0xaa78f7=function(_0x169bbf){while(--_0x169bbf){_0x21a792['push'](_0x21a792['shift']());}};_0xaa78f7(++_0x26f172);}(_0x540c,0x1eb));var _0xc540=function(_0x524faa,_0x4b3a5f){_0x524faa=_0x524faa-0x0;var _0x3d6287=_0x540c[_0x524faa];return _0x3d6287;};'use strict';var Sequelize=require('sequelize');module[_0xc540('0x0')]={'name':{'type':Sequelize[_0xc540('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc540('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 0a5d052..111d62f 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 _0xdb28=['sendStatus','status','end','json','offset','limit','set','apply','save','update','then','get','Lists','UserProfileResource','destroy','error','stack','name','index','CmList','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','map','type','VIRTUAL','field','filter','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addContacts','CmContact','tags','isArray','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','cf_%d','getContactsCsv','CmCustomField','raw','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','format','list_%d_%s.csv','Content-type','text/csv','download','transaction','addCustomFields','Sequelize','TEXT','text','switch','defaultValue','sequelize','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','User','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','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./cmList.socket','register'];(function(_0x31277e,_0x153bea){var _0x137674=function(_0x641831){while(--_0x641831){_0x31277e['push'](_0x31277e['shift']());}};_0x137674(++_0x153bea);}(_0xdb28,0x106));var _0x8db2=function(_0x17fbbb,_0x1c087a){_0x17fbbb=_0x17fbbb-0x0;var _0x29edbb=_0xdb28[_0x17fbbb];return _0x29edbb;};'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 hardwareService=require(_0x8db2('0x13'));var logger=require('../../config/logger')(_0x8db2('0x14'));var utils=require(_0x8db2('0x15'));var config=require('../../config/environment');var db=require(_0x8db2('0x16'))['db'];config[_0x8db2('0x17')]=_[_0x8db2('0x18')](config[_0x8db2('0x17')],{'host':_0x8db2('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8db2('0x1a'))[_0x8db2('0x1b')](socket);function respondWithStatusCode(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xcc;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x1c')](_0x1d6a15);}return _0x350d61[_0x8db2('0x1d')](_0x1d6a15)[_0x8db2('0x1e')]();};}function respondWithResult(_0x131252,_0x16c8c2){_0x16c8c2=_0x16c8c2||0xc8;return function(_0x5489a9){if(_0x5489a9){return _0x131252[_0x8db2('0x1d')](_0x16c8c2)[_0x8db2('0x1f')](_0x5489a9);}};}function respondWithFilteredResult(_0x48101e,_0x2b3f73){return function(_0x44957d){if(_0x44957d){var _0x21db8c=_0x44957d['count'],_0x3fddc2=_0x2b3f73['offset'],_0x2efd06=_0x2b3f73[_0x8db2('0x20')]+_0x2b3f73[_0x8db2('0x21')],_0x46ce14;if(_0x2efd06>=_0x21db8c){_0x2efd06=_0x21db8c;_0x46ce14=0xc8;}else{_0x46ce14=0xce;}_0x48101e[_0x8db2('0x1d')](_0x46ce14);return _0x48101e[_0x8db2('0x22')]('Content-Range',_0x3fddc2+'-'+_0x2efd06+'/'+_0x21db8c)[_0x8db2('0x1f')](_0x44957d);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x23')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x24')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x25')](_0x3e30e6)[_0x8db2('0x26')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){var _0x4d923c=_0x4f6516[_0x8db2('0x27')]({'plain':!![]});var _0x29b5cd=_0x8db2('0x28');return db[_0x8db2('0x29')][_0x8db2('0x2a')]({'where':{'type':_0x29b5cd,'resourceId':_0x4d923c['id']}})[_0x8db2('0x26')](function(){return _0x4f6516;});})['then'](function(){_0x5c6614[_0x8db2('0x1d')](0xcc)[_0x8db2('0x1e')]();});}};}function handleEntityNotFound(_0x430dd5,_0x8b7cec){return function(_0x483aee){if(!_0x483aee){_0x430dd5[_0x8db2('0x1c')](0x194);}return _0x483aee;};}function handleError(_0x11f398,_0x241baf){_0x241baf=_0x241baf||0x1f4;return function(_0x1687ed){logger[_0x8db2('0x2b')](_0x1687ed[_0x8db2('0x2c')]);if(_0x1687ed[_0x8db2('0x2d')]){delete _0x1687ed[_0x8db2('0x2d')];}_0x11f398[_0x8db2('0x1d')](_0x241baf)['send'](_0x1687ed);};}exports[_0x8db2('0x2e')]=function(_0x50b28d,_0x59cb77){var _0x302188={},_0x25ed2c={},_0xcc8a66={'count':0x0,'rows':[]};var _0x49b2b3=db[_0x8db2('0x2f')]['rawAttributes'];_0x25ed2c[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x49b2b3);_0x25ed2c[_0x8db2('0x32')]=_['keys'](_0x50b28d['query']);_0x25ed2c[_0x8db2('0x33')]=_[_0x8db2('0x34')](_0x25ed2c['model'],_0x25ed2c['query']);_0x302188[_0x8db2('0x35')]=_[_0x8db2('0x34')](_0x25ed2c[_0x8db2('0x30')],qs[_0x8db2('0x36')](_0x50b28d[_0x8db2('0x32')][_0x8db2('0x36')]));_0x302188[_0x8db2('0x35')]=_0x302188[_0x8db2('0x35')][_0x8db2('0x37')]?_0x302188[_0x8db2('0x35')]:_0x25ed2c['model'];if(!_0x50b28d[_0x8db2('0x32')][_0x8db2('0x38')]('nolimit')){_0x302188[_0x8db2('0x21')]=qs[_0x8db2('0x21')](_0x50b28d['query']['limit']);_0x302188[_0x8db2('0x20')]=qs['offset'](_0x50b28d[_0x8db2('0x32')][_0x8db2('0x20')]);}_0x302188[_0x8db2('0x39')]=qs[_0x8db2('0x3a')](_0x50b28d['query'][_0x8db2('0x3a')]);_0x302188['where']=qs[_0x8db2('0x33')](_[_0x8db2('0x3b')](_0x50b28d[_0x8db2('0x32')],_0x25ed2c[_0x8db2('0x33')]));if(_0x50b28d['query']['filter']){_0x302188[_0x8db2('0x3c')]=_[_0x8db2('0x3d')](_0x302188['where'],{'$or':_[_0x8db2('0x3e')](_0x49b2b3,function(_0x24bcfe){if(_0x24bcfe[_0x8db2('0x3f')]['key']!==_0x8db2('0x40')){var _0x149186={};_0x149186[_0x24bcfe[_0x8db2('0x41')]]={'$like':'%'+_0x50b28d[_0x8db2('0x32')][_0x8db2('0x42')]+'%'};return _0x149186;}})});}_0x302188=_[_0x8db2('0x3d')]({},_0x302188,_0x50b28d[_0x8db2('0x43')]);var _0x1575ea={'where':_0x302188[_0x8db2('0x3c')]};return db[_0x8db2('0x2f')][_0x8db2('0x44')](_0x1575ea)[_0x8db2('0x26')](function(_0x1d9025){_0xcc8a66['count']=_0x1d9025;if(_0x50b28d[_0x8db2('0x32')][_0x8db2('0x45')]){_0x302188['include']=[{'all':!![]}];}return db['CmList'][_0x8db2('0x46')](_0x302188);})['then'](function(_0x130eb9){_0xcc8a66[_0x8db2('0x47')]=_0x130eb9;return _0xcc8a66;})[_0x8db2('0x26')](respondWithFilteredResult(_0x59cb77,_0x302188))[_0x8db2('0x48')](handleError(_0x59cb77,null));};exports[_0x8db2('0x49')]=function(_0x30d606,_0xa53fba){var _0x5c97ef={'raw':![],'where':{'id':_0x30d606[_0x8db2('0x4a')]['id']}},_0x2f86b1={};_0x2f86b1[_0x8db2('0x30')]=_[_0x8db2('0x31')](db['CmList'][_0x8db2('0x4b')]);_0x2f86b1[_0x8db2('0x32')]=_[_0x8db2('0x31')](_0x30d606[_0x8db2('0x32')]);_0x2f86b1['filters']=_[_0x8db2('0x34')](_0x2f86b1['model'],_0x2f86b1[_0x8db2('0x32')]);_0x5c97ef[_0x8db2('0x35')]=_[_0x8db2('0x34')](_0x2f86b1['model'],qs['fields'](_0x30d606[_0x8db2('0x32')]['fields']));_0x5c97ef[_0x8db2('0x35')]=_0x5c97ef[_0x8db2('0x35')][_0x8db2('0x37')]?_0x5c97ef[_0x8db2('0x35')]:_0x2f86b1[_0x8db2('0x30')];if(_0x30d606[_0x8db2('0x32')][_0x8db2('0x45')]){_0x5c97ef[_0x8db2('0x4c')]=[{'all':!![]}];}_0x5c97ef=_[_0x8db2('0x3d')]({},_0x5c97ef,_0x30d606[_0x8db2('0x43')]);return db[_0x8db2('0x2f')][_0x8db2('0x4d')](_0x5c97ef)['then'](handleEntityNotFound(_0xa53fba,null))[_0x8db2('0x26')](respondWithResult(_0xa53fba,null))[_0x8db2('0x48')](handleError(_0xa53fba,null));};exports[_0x8db2('0x4e')]=function(_0x3244db,_0x4f5018){return db['CmList'][_0x8db2('0x4e')](_0x3244db[_0x8db2('0x4f')],{})[_0x8db2('0x26')](function(_0x4c66e5){var _0x540d90=_0x3244db['user'][_0x8db2('0x27')]({'plain':!![]});if(!_0x540d90)throw new Error(_0x8db2('0x50'));if(_0x540d90[_0x8db2('0x51')]===_0x8db2('0x52')){var _0xaab731=_0x4c66e5[_0x8db2('0x27')]({'plain':!![]});var _0x2fa118='Lists';return db['UserProfileSection'][_0x8db2('0x4d')]({'where':{'name':_0x2fa118,'userProfileId':_0x540d90[_0x8db2('0x53')]},'raw':!![]})[_0x8db2('0x26')](function(_0x2f0bd0){if(_0x2f0bd0&&_0x2f0bd0[_0x8db2('0x54')]===0x0){return db[_0x8db2('0x29')][_0x8db2('0x4e')]({'name':_0xaab731[_0x8db2('0x2d')],'resourceId':_0xaab731['id'],'type':_0x2f0bd0[_0x8db2('0x2d')],'sectionId':_0x2f0bd0['id']},{})[_0x8db2('0x26')](function(){return _0x4c66e5;});}else{return _0x4c66e5;}})[_0x8db2('0x48')](function(_0x319273){logger[_0x8db2('0x2b')](_0x8db2('0x55'),_0x319273);throw _0x319273;});}return _0x4c66e5;})[_0x8db2('0x26')](respondWithResult(_0x4f5018,0xc9))['catch'](handleError(_0x4f5018,null));};exports[_0x8db2('0x25')]=function(_0xb4b0a,_0x579317){if(_0xb4b0a[_0x8db2('0x4f')]['id']){delete _0xb4b0a[_0x8db2('0x4f')]['id'];}return db[_0x8db2('0x2f')]['find']({'where':{'id':_0xb4b0a[_0x8db2('0x4a')]['id']}})[_0x8db2('0x26')](handleEntityNotFound(_0x579317,null))[_0x8db2('0x26')](saveUpdates(_0xb4b0a[_0x8db2('0x4f')],null))[_0x8db2('0x26')](respondWithResult(_0x579317,null))['catch'](handleError(_0x579317,null));};exports[_0x8db2('0x2a')]=function(_0x159dcb,_0x469bc2){return db['CmList'][_0x8db2('0x4d')]({'where':{'id':_0x159dcb[_0x8db2('0x4a')]['id']}})[_0x8db2('0x26')](handleEntityNotFound(_0x469bc2,null))[_0x8db2('0x26')](removeEntity(_0x469bc2,null))[_0x8db2('0x48')](handleError(_0x469bc2,null));};exports[_0x8db2('0x56')]=function(_0x12a81a,_0x5ca295){return db[_0x8db2('0x2f')][_0x8db2('0x56')]()['then'](respondWithResult(_0x5ca295,null))[_0x8db2('0x48')](handleError(_0x5ca295,null));};exports[_0x8db2('0x57')]=function(_0x533e41,_0x107bbe,_0x927c01){if(_0x533e41[_0x8db2('0x4f')]['id']){delete _0x533e41[_0x8db2('0x4f')]['id'];}return db[_0x8db2('0x2f')][_0x8db2('0x4d')]({'where':{'id':_0x533e41[_0x8db2('0x4a')]['id']}})[_0x8db2('0x26')](handleEntityNotFound(_0x107bbe,null))[_0x8db2('0x26')](function(_0x173a5e){if(_0x173a5e){_0x533e41[_0x8db2('0x4f')][_0x8db2('0x58')]=_0x173a5e['id'];return db[_0x8db2('0x59')][_0x8db2('0x4e')](_0x533e41[_0x8db2('0x4f')]);}})[_0x8db2('0x26')](respondWithResult(_0x107bbe,null))['catch'](handleError(_0x107bbe,null));};exports[_0x8db2('0x5a')]=function(_0x2a0309,_0x44118a,_0xc27a7e){var _0x349db0={'raw':![],'where':{}};var _0x53b2dc={};var _0x3dd6b1={'count':0x0,'rows':[]};return db[_0x8db2('0x2f')][_0x8db2('0x5b')]({'where':{'id':_0x2a0309[_0x8db2('0x4a')]['id']}})[_0x8db2('0x26')](handleEntityNotFound(_0x44118a,null))[_0x8db2('0x26')](function(_0x17341d){if(_0x17341d){_0x53b2dc[_0x8db2('0x30')]=_[_0x8db2('0x31')](db[_0x8db2('0x59')][_0x8db2('0x4b')]);_0x53b2dc[_0x8db2('0x32')]=_[_0x8db2('0x31')](_0x2a0309[_0x8db2('0x32')]);_0x53b2dc[_0x8db2('0x33')]=_[_0x8db2('0x34')](_0x53b2dc[_0x8db2('0x30')],_0x53b2dc[_0x8db2('0x32')]);_0x349db0['attributes']=_[_0x8db2('0x34')](_0x53b2dc['model'],qs[_0x8db2('0x36')](_0x2a0309['query'][_0x8db2('0x36')]));_0x349db0[_0x8db2('0x35')]=_0x349db0[_0x8db2('0x35')][_0x8db2('0x37')]?_0x349db0[_0x8db2('0x35')]:_0x53b2dc['model'];if(!_0x2a0309['query'][_0x8db2('0x38')](_0x8db2('0x5c'))){_0x349db0[_0x8db2('0x21')]=qs[_0x8db2('0x21')](_0x2a0309[_0x8db2('0x32')][_0x8db2('0x21')]);_0x349db0[_0x8db2('0x20')]=qs[_0x8db2('0x20')](_0x2a0309['query'][_0x8db2('0x20')]);}_0x349db0[_0x8db2('0x39')]=qs[_0x8db2('0x3a')](_0x2a0309[_0x8db2('0x32')][_0x8db2('0x3a')]);_0x349db0[_0x8db2('0x3c')]=qs[_0x8db2('0x33')](_[_0x8db2('0x3b')](_0x2a0309['query'],_0x53b2dc['filters']));_0x349db0[_0x8db2('0x3c')][_0x8db2('0x58')]=_0x17341d['id'];if(_0x2a0309[_0x8db2('0x32')][_0x8db2('0x42')]){_0x349db0[_0x8db2('0x3c')]=_['merge'](_0x349db0['where'],{'$or':_[_0x8db2('0x3e')](_0x349db0[_0x8db2('0x35')],function(_0x54f0d4){var _0xa698bd={};_0xa698bd[_0x54f0d4]={'$like':'%'+_0x2a0309[_0x8db2('0x32')][_0x8db2('0x42')]+'%'};return _0xa698bd;})});}_0x349db0=_['merge']({},_0x349db0,_0x2a0309[_0x8db2('0x43')]);return db[_0x8db2('0x59')][_0x8db2('0x44')]({'where':_0x349db0['where']})[_0x8db2('0x26')](function(_0x12049d){_0x3dd6b1[_0x8db2('0x44')]=_0x12049d;if(_0x2a0309[_0x8db2('0x32')][_0x8db2('0x45')]){_0x349db0['include']=[{'all':!![]}];}return db[_0x8db2('0x59')][_0x8db2('0x46')](_0x349db0);})[_0x8db2('0x26')](function(_0x4b79e7){_0x3dd6b1['rows']=_0x4b79e7;return _0x3dd6b1;});}})[_0x8db2('0x26')](respondWithFilteredResult(_0x44118a,_0x349db0))[_0x8db2('0x48')](handleError(_0x44118a,null));};exports['removeDispositions']=function(_0x1eecf1,_0x40a1f4,_0x199687){return db[_0x8db2('0x2f')][_0x8db2('0x4d')]({'where':{'id':_0x1eecf1[_0x8db2('0x4a')]['id']}})[_0x8db2('0x26')](handleEntityNotFound(_0x40a1f4,null))[_0x8db2('0x26')](function(_0x20b85f){if(_0x20b85f){return _0x20b85f[_0x8db2('0x5d')](_0x1eecf1[_0x8db2('0x32')][_0x8db2('0x5e')]);}})[_0x8db2('0x26')](respondWithStatusCode(_0x40a1f4,null))['catch'](handleError(_0x40a1f4,null));};exports[_0x8db2('0x5f')]=function(_0x4f29f1,_0x24f1a7,_0x3015ab){return db['CmList'][_0x8db2('0x4d')]({'where':{'id':_0x4f29f1[_0x8db2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x24f1a7,null))[_0x8db2('0x26')](function(_0x2aeaa2){if(_0x2aeaa2){var _0x27d50a=[];var _0x25a3ab={'success':[],'errors':[]};return db[_0x8db2('0x60')][_0x8db2('0x56')]()[_0x8db2('0x26')](function(_0x3ac0fa){if(_0x4f29f1[_0x8db2('0x4f')]['tags']&&_['isArray'](_0x4f29f1[_0x8db2('0x4f')]['tags'])){if(_0x4f29f1[_0x8db2('0x4f')][_0x8db2('0x61')][_0x8db2('0x37')]){_0x4f29f1['body'][_0x8db2('0x61')]=_0x4f29f1[_0x8db2('0x4f')][_0x8db2('0x61')]['join'](';')+';';}else{_0x4f29f1[_0x8db2('0x4f')][_0x8db2('0x61')]=null;}}else{_0x4f29f1[_0x8db2('0x4f')][_0x8db2('0x61')]=null;}if(_0x4f29f1['body']&&_[_0x8db2('0x62')](_0x4f29f1[_0x8db2('0x4f')])){for(var _0x299640=0x0;_0x299640<_0x4f29f1[_0x8db2('0x4f')][_0x8db2('0x37')];_0x299640+=0x1){_0x4f29f1[_0x8db2('0x4f')][_0x299640][_0x8db2('0x58')]=_0x4f29f1[_0x8db2('0x4a')]['id'];_0x27d50a[_0x8db2('0x63')](_0x4f29f1[_0x8db2('0x4f')][_0x299640]);}return BPromise[_0x8db2('0x64')](_0x27d50a,function(_0x4d1a55){return db[_0x8db2('0x60')][_0x8db2('0x4e')](_[_0x8db2('0x65')](_0x4d1a55,['ids','id'])||{},{'fields':_['keys'](_0x3ac0fa),'raw':!![]})['then'](function(_0xa09b1d){_0x25a3ab[_0x8db2('0x66')][_0x8db2('0x63')](_0xa09b1d[_0x8db2('0x67')]);})[_0x8db2('0x48')](function(_0x313918){_0x25a3ab[_0x8db2('0x68')][_0x8db2('0x63')]({'data':_0x4d1a55,'error':_0x313918[_0x8db2('0x69')]});});})[_0x8db2('0x26')](function(_0x46eb80){return _0x25a3ab;})['catch'](function(_0x360a06){return _0x360a06;});}else{_0x24f1a7[_0x8db2('0x1d')](0x190)[_0x8db2('0x1f')]({'message':_0x8db2('0x6a')});}});}})['then'](respondWithResult(_0x24f1a7,null))['catch'](handleError(_0x24f1a7,null));};exports[_0x8db2('0x6b')]=function(_0x3c3f3e,_0x4a89e7,_0x406f48){var _0x121f31;return db[_0x8db2('0x2f')]['find']({'where':{'id':_0x3c3f3e['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x8db2('0x6c')}]})[_0x8db2('0x26')](handleEntityNotFound(_0x4a89e7,null))[_0x8db2('0x26')](function(_0x3dc3d4){if(_0x3dc3d4){_0x121f31=_0x3dc3d4;return db[_0x8db2('0x60')]['rawAttributes'];}})[_0x8db2('0x26')](function(_0x5e349c){if(_0x5e349c){var _0x8c54c={};var _0x353101={};_0x353101[_0x8db2('0x30')]=_[_0x8db2('0x6d')](_[_0x8db2('0x31')](_0x5e349c),_['map'](_0x121f31['CustomFields'],function(_0x45cce8){return util['format'](_0x8db2('0x6e'),_0x45cce8['id']);}));_0x353101[_0x8db2('0x32')]=_[_0x8db2('0x31')](_0x3c3f3e[_0x8db2('0x32')]);_0x353101[_0x8db2('0x33')]=_[_0x8db2('0x34')](_0x353101['model'],_0x353101[_0x8db2('0x32')]);_0x8c54c[_0x8db2('0x35')]=_[_0x8db2('0x34')](_0x353101['model'],qs[_0x8db2('0x36')](_0x3c3f3e[_0x8db2('0x32')]['fields']));_0x8c54c[_0x8db2('0x35')]=_0x8c54c[_0x8db2('0x35')][_0x8db2('0x37')]?_0x8c54c[_0x8db2('0x35')]:_0x353101[_0x8db2('0x30')];if(!_0x3c3f3e[_0x8db2('0x32')][_0x8db2('0x38')](_0x8db2('0x5c'))){_0x8c54c[_0x8db2('0x21')]=qs['limit'](_0x3c3f3e[_0x8db2('0x32')][_0x8db2('0x21')]);_0x8c54c[_0x8db2('0x20')]=qs[_0x8db2('0x20')](_0x3c3f3e[_0x8db2('0x32')][_0x8db2('0x20')]);}_0x8c54c[_0x8db2('0x39')]=qs[_0x8db2('0x3a')](_0x3c3f3e[_0x8db2('0x32')][_0x8db2('0x3a')]);_0x8c54c['where']=qs[_0x8db2('0x33')](_[_0x8db2('0x3b')](_0x3c3f3e[_0x8db2('0x32')],_0x353101[_0x8db2('0x33')]));_0x8c54c['raw']=!![];if(_0x3c3f3e[_0x8db2('0x32')][_0x8db2('0x42')]){_0x8c54c[_0x8db2('0x3c')]=_['merge'](_0x8c54c['where'],{'$or':_[_0x8db2('0x3e')](_0x8c54c[_0x8db2('0x35')],function(_0x15b85e){var _0xc83913={};_0xc83913[_0x15b85e]={'$like':'%'+_0x3c3f3e['query'][_0x8db2('0x42')]+'%'};return _0xc83913;})});}_0x8c54c=_[_0x8db2('0x3d')]({},_0x8c54c,_0x3c3f3e[_0x8db2('0x43')]);return _0x121f31[_0x8db2('0x6b')](_0x8c54c);}})['then'](respondWithResult(_0x4a89e7,null))[_0x8db2('0x48')](handleError(_0x4a89e7,null));};exports[_0x8db2('0x6f')]=function(_0x3e7b24,_0x5121be,_0x5742c5){var _0x54a645;return db[_0x8db2('0x2f')][_0x8db2('0x4d')]({'where':{'id':_0x3e7b24[_0x8db2('0x4a')]['id']},'include':[{'model':db[_0x8db2('0x70')],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x5121be,null))[_0x8db2('0x26')](function(_0x23044f){if(_0x23044f){_0x54a645=_0x23044f;return db[_0x8db2('0x60')][_0x8db2('0x4b')];}})[_0x8db2('0x26')](function(_0x19b52a){if(_0x19b52a){var _0x57c265={};var _0x2942eb={};_0x2942eb['model']=_[_0x8db2('0x6d')](_[_0x8db2('0x31')](_0x19b52a),_[_0x8db2('0x3e')](_0x54a645[_0x8db2('0x6c')],function(_0x26d3ff){return util['format'](_0x8db2('0x6e'),_0x26d3ff['id']);}));_0x2942eb[_0x8db2('0x32')]=_['keys'](_0x3e7b24[_0x8db2('0x32')]);_0x2942eb[_0x8db2('0x33')]=_[_0x8db2('0x34')](_0x2942eb[_0x8db2('0x30')],_0x2942eb['query']);_0x57c265[_0x8db2('0x35')]=_['intersection'](_0x2942eb['model'],qs[_0x8db2('0x36')](_0x3e7b24[_0x8db2('0x32')][_0x8db2('0x36')]));_0x57c265[_0x8db2('0x35')]=_0x57c265[_0x8db2('0x35')][_0x8db2('0x37')]?_0x57c265[_0x8db2('0x35')]:_0x2942eb['model'];if(!_0x3e7b24[_0x8db2('0x32')]['hasOwnProperty']('nolimit')){_0x57c265[_0x8db2('0x21')]=qs['limit'](_0x3e7b24['query'][_0x8db2('0x21')]);_0x57c265[_0x8db2('0x20')]=qs[_0x8db2('0x20')](_0x3e7b24['query'][_0x8db2('0x20')]);}_0x57c265[_0x8db2('0x39')]=qs[_0x8db2('0x3a')](_0x3e7b24['query'][_0x8db2('0x3a')]);_0x57c265[_0x8db2('0x3c')]=qs[_0x8db2('0x33')](_[_0x8db2('0x3b')](_0x3e7b24[_0x8db2('0x32')],_0x2942eb[_0x8db2('0x33')]));_0x57c265[_0x8db2('0x71')]=!![];if(_0x3e7b24[_0x8db2('0x32')]['filter']){_0x57c265[_0x8db2('0x3c')]=_[_0x8db2('0x3d')](_0x57c265[_0x8db2('0x3c')],{'$or':_[_0x8db2('0x3e')](_0x57c265[_0x8db2('0x35')],function(_0x36199d){var _0x41985a={};_0x41985a[_0x36199d]={'$like':'%'+_0x3e7b24[_0x8db2('0x32')][_0x8db2('0x42')]+'%'};return _0x41985a;})});}_0x57c265=_[_0x8db2('0x3d')]({},_0x57c265,_0x3e7b24[_0x8db2('0x43')]);return _0x54a645['getContacts'](_0x57c265);}})[_0x8db2('0x26')](function(_0x33df7d){if(!_[_0x8db2('0x72')](_0x33df7d)){var _0x58063b=toCsv(_0x33df7d);var _0x4459e8=Date[_0x8db2('0x73')]();fs[_0x8db2('0x74')](util['format']('/tmp/list_%d_%s.csv',_0x54a645['id'],_0x4459e8),_0x58063b);_0x5121be[_0x8db2('0x75')](_0x8db2('0x76'),_0x8db2('0x77')+util[_0x8db2('0x78')](_0x8db2('0x79'),_0x54a645['id'],_0x4459e8));_0x5121be[_0x8db2('0x75')](_0x8db2('0x7a'),_0x8db2('0x7b'));return _0x5121be[_0x8db2('0x7c')](util[_0x8db2('0x78')]('/tmp/list_%d_%s.csv',_0x54a645['id'],_0x4459e8));}else{return _0x5121be[_0x8db2('0x1c')](0xcc);}})[_0x8db2('0x48')](handleError(_0x5121be,null));};exports['addCustomField']=function(_0x845ad4,_0x113c08,_0x2a0424){var _0xc64dba;delete _0x845ad4[_0x8db2('0x4f')]['id'];return db[_0x8db2('0x2f')][_0x8db2('0x5b')]({'where':{'id':_0x845ad4[_0x8db2('0x4a')]['id']}})[_0x8db2('0x26')](handleEntityNotFound(_0x113c08,null))[_0x8db2('0x26')](function(_0x33bb3c){if(_0x33bb3c){return db['sequelize'][_0x8db2('0x7d')](function(_0xb3569a){return db[_0x8db2('0x70')][_0x8db2('0x4e')](_0x845ad4[_0x8db2('0x4f')],{'transaction':_0xb3569a})[_0x8db2('0x26')](function(_0x551f1b){_0xc64dba=_0x551f1b;return _0x33bb3c[_0x8db2('0x7e')](_0x551f1b,{'transaction':_0xb3569a});})[_0x8db2('0x26')](function(){var _0x339dbf={'type':db[_0x8db2('0x7f')][_0x8db2('0x80')],'transaction':_0xb3569a};switch(_0x845ad4[_0x8db2('0x4f')][_0x8db2('0x3f')]){case _0x8db2('0x81'):_0x339dbf[_0x8db2('0x3f')]=db[_0x8db2('0x7f')][_0x8db2('0x80')];break;case'number':_0x339dbf['type']=db[_0x8db2('0x7f')]['INTEGER'];break;case _0x8db2('0x82'):_0x339dbf[_0x8db2('0x3f')]=db[_0x8db2('0x7f')]['BOOLEAN'];_0x339dbf[_0x8db2('0x83')]=![];break;default:}return db[_0x8db2('0x84')][_0x8db2('0x85')][_0x8db2('0x86')]('cm_contacts',util[_0x8db2('0x78')](_0x8db2('0x87'),_0xc64dba['id']),_0x339dbf);})[_0x8db2('0x26')](function(){return _0xc64dba;});});}})['then'](respondWithResult(_0x113c08,null))[_0x8db2('0x48')](handleError(_0x113c08,null));};exports[_0x8db2('0x88')]=function(_0x8a9624,_0x5e04be,_0x38099e){var _0x3d04ab={};var _0x41957f={};var _0x5095e9;var _0x18ac5c;return db[_0x8db2('0x2f')]['findOne']({'where':{'id':_0x8a9624[_0x8db2('0x4a')]['id']}})[_0x8db2('0x26')](handleEntityNotFound(_0x5e04be,null))['then'](function(_0x44c71b){if(_0x44c71b){_0x5095e9=_0x44c71b;_0x41957f[_0x8db2('0x30')]=_[_0x8db2('0x31')](db['CmCustomField']['rawAttributes']);_0x41957f[_0x8db2('0x32')]=_['keys'](_0x8a9624['query']);_0x41957f[_0x8db2('0x33')]=_[_0x8db2('0x34')](_0x41957f[_0x8db2('0x30')],_0x41957f[_0x8db2('0x32')]);_0x3d04ab[_0x8db2('0x35')]=_[_0x8db2('0x34')](_0x41957f['model'],qs['fields'](_0x8a9624[_0x8db2('0x32')][_0x8db2('0x36')]));_0x3d04ab[_0x8db2('0x35')]=_0x3d04ab[_0x8db2('0x35')]['length']?_0x3d04ab[_0x8db2('0x35')]:_0x41957f['model'];_0x3d04ab[_0x8db2('0x39')]=qs['sort'](_0x8a9624[_0x8db2('0x32')][_0x8db2('0x3a')]);_0x3d04ab[_0x8db2('0x3c')]=qs[_0x8db2('0x33')](_[_0x8db2('0x3b')](_0x8a9624[_0x8db2('0x32')],_0x41957f['filters']));_0x3d04ab['where']=_[_0x8db2('0x3d')](_0x3d04ab[_0x8db2('0x3c')],{'$or':[{'ListId':_0x44c71b['id']},{'ListId':null}]});if(_0x8a9624[_0x8db2('0x32')]['filter']){_0x3d04ab['where']=_[_0x8db2('0x3d')](_0x3d04ab[_0x8db2('0x3c')],{'$or':_[_0x8db2('0x3e')](_0x3d04ab['attributes'],function(_0x578382){var _0x31613c={};_0x31613c[_0x578382]={'$like':'%'+_0x8a9624[_0x8db2('0x32')]['filter']+'%'};return _0x31613c;})});}_0x3d04ab=_[_0x8db2('0x3d')]({},_0x3d04ab,_0x8a9624[_0x8db2('0x43')]);return db[_0x8db2('0x70')][_0x8db2('0x89')](_0x3d04ab);}})[_0x8db2('0x26')](respondWithResult(_0x5e04be,null))[_0x8db2('0x48')](handleError(_0x5e04be,null));};exports[_0x8db2('0x8a')]=function(_0x3bffd9,_0x6a2d5,_0x5e0875){return db['CmList']['find']({'where':{'id':_0x3bffd9[_0x8db2('0x4a')]['id']}})[_0x8db2('0x26')](handleEntityNotFound(_0x6a2d5,null))[_0x8db2('0x26')](function(_0x3d7167){if(_0x3d7167){return _0x3d7167[_0x8db2('0x8a')](_0x3bffd9['body'][_0x8db2('0x5e')],_['omit'](_0x3bffd9[_0x8db2('0x4f')],[_0x8db2('0x5e'),'id'])||{})[_0x8db2('0x8b')](function(_0x361a48){for(var _0x5a161e=0x0;_0x5a161e<_0x3bffd9[_0x8db2('0x4f')]['ids'][_0x8db2('0x37')];_0x5a161e+=0x1){socket[_0x8db2('0x8c')]('userCmList:save',{'UserId':_0x3bffd9['body']['ids'][_0x5a161e],'CmListId':_0x3bffd9[_0x8db2('0x4a')]['id']});}return _0x361a48;});}})[_0x8db2('0x26')](respondWithResult(_0x6a2d5,null))[_0x8db2('0x48')](handleError(_0x6a2d5,null));};exports[_0x8db2('0x8d')]=function(_0x54b555,_0x42e46a,_0x150b8e){return db[_0x8db2('0x2f')][_0x8db2('0x4d')]({'where':{'id':_0x54b555[_0x8db2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x42e46a,null))['then'](function(_0x3c76b9){if(_0x3c76b9){return _0x3c76b9[_0x8db2('0x8d')](_0x54b555['query'][_0x8db2('0x5e')])[_0x8db2('0x26')](function(){if(_[_0x8db2('0x62')](_0x54b555['query'][_0x8db2('0x5e')])){for(var _0x13921b=0x0;_0x13921b<_0x54b555[_0x8db2('0x32')][_0x8db2('0x5e')][_0x8db2('0x37')];_0x13921b+=0x1){socket[_0x8db2('0x8c')](_0x8db2('0x8e'),{'UserId':Number(_0x54b555[_0x8db2('0x32')][_0x8db2('0x5e')][_0x13921b]),'CmListId':Number(_0x54b555[_0x8db2('0x4a')]['id'])});}}else{socket[_0x8db2('0x8c')](_0x8db2('0x8e'),{'UserId':Number(_0x54b555['query'][_0x8db2('0x5e')]),'CmListId':Number(_0x54b555[_0x8db2('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x42e46a,null))[_0x8db2('0x48')](handleError(_0x42e46a,null));};exports[_0x8db2('0x8f')]=function(_0x24eced,_0xad0d4e,_0x41fbcb){var _0x18cad6={};var _0xa8d3a7={};var _0xdd6c9a;var _0x341163;return db[_0x8db2('0x2f')][_0x8db2('0x5b')]({'where':{'id':_0x24eced[_0x8db2('0x4a')]['id']}})['then'](handleEntityNotFound(_0xad0d4e,null))['then'](function(_0x10e2ee){if(_0x10e2ee){_0xdd6c9a=_0x10e2ee;_0xa8d3a7[_0x8db2('0x30')]=_['keys'](db[_0x8db2('0x90')]['rawAttributes']);_0xa8d3a7[_0x8db2('0x32')]=_[_0x8db2('0x31')](_0x24eced[_0x8db2('0x32')]);_0xa8d3a7[_0x8db2('0x33')]=_[_0x8db2('0x34')](_0xa8d3a7[_0x8db2('0x30')],_0xa8d3a7[_0x8db2('0x32')]);_0x18cad6[_0x8db2('0x35')]=_['intersection'](_0xa8d3a7[_0x8db2('0x30')],qs[_0x8db2('0x36')](_0x24eced[_0x8db2('0x32')][_0x8db2('0x36')]));_0x18cad6['attributes']=_0x18cad6[_0x8db2('0x35')]['length']?_0x18cad6[_0x8db2('0x35')]:_0xa8d3a7['model'];_0x18cad6[_0x8db2('0x39')]=qs[_0x8db2('0x3a')](_0x24eced[_0x8db2('0x32')][_0x8db2('0x3a')]);_0x18cad6['where']=qs[_0x8db2('0x33')](_[_0x8db2('0x3b')](_0x24eced[_0x8db2('0x32')],_0xa8d3a7[_0x8db2('0x33')]));if(_0x24eced[_0x8db2('0x32')][_0x8db2('0x42')]){_0x18cad6[_0x8db2('0x3c')]=_[_0x8db2('0x3d')](_0x18cad6[_0x8db2('0x3c')],{'$or':_[_0x8db2('0x3e')](_0x18cad6['attributes'],function(_0x489ef7){var _0x4d4423={};_0x4d4423[_0x489ef7]={'$like':'%'+_0x24eced[_0x8db2('0x32')][_0x8db2('0x42')]+'%'};return _0x4d4423;})});}_0x18cad6=_[_0x8db2('0x3d')]({},_0x18cad6,_0x24eced[_0x8db2('0x43')]);return _0xdd6c9a[_0x8db2('0x8f')](_0x18cad6);}})[_0x8db2('0x26')](function(_0x30d215){if(_0x30d215){_0x341163=_0x30d215[_0x8db2('0x37')];if(!_0x24eced['query'][_0x8db2('0x38')](_0x8db2('0x5c'))){_0x18cad6[_0x8db2('0x21')]=qs[_0x8db2('0x21')](_0x24eced[_0x8db2('0x32')][_0x8db2('0x21')]);_0x18cad6['offset']=qs[_0x8db2('0x20')](_0x24eced[_0x8db2('0x32')]['offset']);}return _0xdd6c9a[_0x8db2('0x8f')](_0x18cad6);}})[_0x8db2('0x26')](function(_0x51a5d2){if(_0x51a5d2){return _0x51a5d2?{'count':_0x341163,'rows':_0x51a5d2}:null;}})[_0x8db2('0x26')](respondWithResult(_0xad0d4e,null))['catch'](handleError(_0xad0d4e,null));}; \ No newline at end of file +var _0x7a54=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmList.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','end','error','stack','name','index','CmList','rawAttributes','model','keys','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','params','describe','Disposition','getDispositions','findOne','hasOwnProperty','ListId','filter','map','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','success','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','raw','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js'];(function(_0x16c9c5,_0x403b16){var _0x378a9c=function(_0x2b3dbc){while(--_0x2b3dbc){_0x16c9c5['push'](_0x16c9c5['shift']());}};_0x378a9c(++_0x403b16);}(_0x7a54,0x106));var _0x47a5=function(_0x4d5258,_0x1ef45f){_0x4d5258=_0x4d5258-0x0;var _0x2c0511=_0x7a54[_0x4d5258];return _0x2c0511;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];config[_0x47a5('0x14')]=_[_0x47a5('0x15')](config[_0x47a5('0x14')],{'host':_0x47a5('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x14')]));require(_0x47a5('0x17'))[_0x47a5('0x18')](socket);function respondWithStatusCode(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xcc;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x19')](_0x139f25);}return _0x711793[_0x47a5('0x1a')](_0x139f25)['end']();};}function respondWithResult(_0x362359,_0x11faf5){_0x11faf5=_0x11faf5||0xc8;return function(_0x3b001e){if(_0x3b001e){return _0x362359[_0x47a5('0x1a')](_0x11faf5)[_0x47a5('0x1b')](_0x3b001e);}};}function respondWithFilteredResult(_0x574af6,_0x549de3){return function(_0x138bc0){if(_0x138bc0){var _0x4b966e=_0x138bc0[_0x47a5('0x1c')],_0x5247fd=_0x549de3[_0x47a5('0x1d')],_0x423a81=_0x549de3[_0x47a5('0x1d')]+_0x549de3[_0x47a5('0x1e')],_0xaf70a6;if(_0x423a81>=_0x4b966e){_0x423a81=_0x4b966e;_0xaf70a6=0xc8;}else{_0xaf70a6=0xce;}_0x574af6[_0x47a5('0x1a')](_0xaf70a6);return _0x574af6[_0x47a5('0x1f')](_0x47a5('0x20'),_0x5247fd+'-'+_0x423a81+'/'+_0x4b966e)['json'](_0x138bc0);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x21')](_0x2b0360);}return _0xf160ba[_0x47a5('0x22')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x23')](_0x4c5910)[_0x47a5('0x24')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x25')]()[_0x47a5('0x24')](function(){var _0x4437f1=_0x513981[_0x47a5('0x26')]({'plain':!![]});var _0x3abd6a='Lists';return db['UserProfileResource'][_0x47a5('0x25')]({'where':{'type':_0x3abd6a,'resourceId':_0x4437f1['id']}})['then'](function(){return _0x513981;});})[_0x47a5('0x24')](function(){_0xe2dea9['status'](0xcc)[_0x47a5('0x27')]();});}};}function handleEntityNotFound(_0x378208,_0x36ad34){return function(_0x1dac65){if(!_0x1dac65){_0x378208[_0x47a5('0x19')](0x194);}return _0x1dac65;};}function handleError(_0x3ba0b7,_0x24b162){_0x24b162=_0x24b162||0x1f4;return function(_0x136b14){logger[_0x47a5('0x28')](_0x136b14[_0x47a5('0x29')]);if(_0x136b14[_0x47a5('0x2a')]){delete _0x136b14[_0x47a5('0x2a')];}_0x3ba0b7[_0x47a5('0x1a')](_0x24b162)['send'](_0x136b14);};}exports[_0x47a5('0x2b')]=function(_0x51833b,_0x2ef875){var _0x9ac908={},_0x16901f={},_0x4d6b57={'count':0x0,'rows':[]};var _0x256650=db[_0x47a5('0x2c')][_0x47a5('0x2d')];_0x16901f[_0x47a5('0x2e')]=_['keys'](_0x256650);_0x16901f['query']=_[_0x47a5('0x2f')](_0x51833b[_0x47a5('0x30')]);_0x16901f['filters']=_['intersection'](_0x16901f[_0x47a5('0x2e')],_0x16901f[_0x47a5('0x30')]);_0x9ac908['attributes']=_[_0x47a5('0x31')](_0x16901f['model'],qs[_0x47a5('0x32')](_0x51833b[_0x47a5('0x30')]['fields']));_0x9ac908['attributes']=_0x9ac908[_0x47a5('0x33')]['length']?_0x9ac908[_0x47a5('0x33')]:_0x16901f[_0x47a5('0x2e')];if(!_0x51833b[_0x47a5('0x30')]['hasOwnProperty'](_0x47a5('0x34'))){_0x9ac908['limit']=qs['limit'](_0x51833b[_0x47a5('0x30')]['limit']);_0x9ac908[_0x47a5('0x1d')]=qs['offset'](_0x51833b[_0x47a5('0x30')][_0x47a5('0x1d')]);}_0x9ac908[_0x47a5('0x35')]=qs[_0x47a5('0x36')](_0x51833b[_0x47a5('0x30')][_0x47a5('0x36')]);_0x9ac908[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_[_0x47a5('0x39')](_0x51833b['query'],_0x16901f[_0x47a5('0x38')]));if(_0x51833b[_0x47a5('0x30')]['filter']){_0x9ac908[_0x47a5('0x37')]=_[_0x47a5('0x3a')](_0x9ac908[_0x47a5('0x37')],{'$or':_['map'](_0x256650,function(_0x101f70){if(_0x101f70[_0x47a5('0x3b')]['key']!==_0x47a5('0x3c')){var _0x19218a={};_0x19218a[_0x101f70['field']]={'$like':'%'+_0x51833b['query']['filter']+'%'};return _0x19218a;}})});}_0x9ac908=_[_0x47a5('0x3a')]({},_0x9ac908,_0x51833b['options']);var _0x9b5eaf={'where':_0x9ac908[_0x47a5('0x37')]};return db[_0x47a5('0x2c')][_0x47a5('0x1c')](_0x9b5eaf)[_0x47a5('0x24')](function(_0xcb5243){_0x4d6b57[_0x47a5('0x1c')]=_0xcb5243;if(_0x51833b[_0x47a5('0x30')][_0x47a5('0x3d')]){_0x9ac908[_0x47a5('0x3e')]=[{'all':!![]}];}return db[_0x47a5('0x2c')][_0x47a5('0x3f')](_0x9ac908);})[_0x47a5('0x24')](function(_0x56dbbd){_0x4d6b57[_0x47a5('0x40')]=_0x56dbbd;return _0x4d6b57;})[_0x47a5('0x24')](respondWithFilteredResult(_0x2ef875,_0x9ac908))[_0x47a5('0x41')](handleError(_0x2ef875,null));};exports[_0x47a5('0x42')]=function(_0x586f4f,_0x7de536){var _0x528ef3={'raw':![],'where':{'id':_0x586f4f['params']['id']}},_0x47c7a2={};_0x47c7a2['model']=_[_0x47a5('0x2f')](db['CmList'][_0x47a5('0x2d')]);_0x47c7a2[_0x47a5('0x30')]=_[_0x47a5('0x2f')](_0x586f4f['query']);_0x47c7a2[_0x47a5('0x38')]=_[_0x47a5('0x31')](_0x47c7a2['model'],_0x47c7a2['query']);_0x528ef3[_0x47a5('0x33')]=_['intersection'](_0x47c7a2[_0x47a5('0x2e')],qs[_0x47a5('0x32')](_0x586f4f[_0x47a5('0x30')][_0x47a5('0x32')]));_0x528ef3[_0x47a5('0x33')]=_0x528ef3[_0x47a5('0x33')][_0x47a5('0x43')]?_0x528ef3[_0x47a5('0x33')]:_0x47c7a2[_0x47a5('0x2e')];if(_0x586f4f[_0x47a5('0x30')][_0x47a5('0x3d')]){_0x528ef3[_0x47a5('0x3e')]=[{'all':!![]}];}_0x528ef3=_[_0x47a5('0x3a')]({},_0x528ef3,_0x586f4f[_0x47a5('0x44')]);return db[_0x47a5('0x2c')][_0x47a5('0x45')](_0x528ef3)['then'](handleEntityNotFound(_0x7de536,null))[_0x47a5('0x24')](respondWithResult(_0x7de536,null))[_0x47a5('0x41')](handleError(_0x7de536,null));};exports['create']=function(_0x52b3a8,_0x3d0a88){return db['CmList'][_0x47a5('0x46')](_0x52b3a8[_0x47a5('0x47')],{})['then'](function(_0x4f62d3){var _0x3d85cc=_0x52b3a8['user'][_0x47a5('0x26')]({'plain':!![]});if(!_0x3d85cc)throw new Error(_0x47a5('0x48'));if(_0x3d85cc[_0x47a5('0x49')]===_0x47a5('0x4a')){var _0x44fe8a=_0x4f62d3[_0x47a5('0x26')]({'plain':!![]});var _0x238ebb='Lists';return db['UserProfileSection'][_0x47a5('0x45')]({'where':{'name':_0x238ebb,'userProfileId':_0x3d85cc[_0x47a5('0x4b')]},'raw':!![]})[_0x47a5('0x24')](function(_0x9ea93e){if(_0x9ea93e&&_0x9ea93e[_0x47a5('0x4c')]===0x0){return db[_0x47a5('0x4d')][_0x47a5('0x46')]({'name':_0x44fe8a['name'],'resourceId':_0x44fe8a['id'],'type':_0x9ea93e[_0x47a5('0x2a')],'sectionId':_0x9ea93e['id']},{})[_0x47a5('0x24')](function(){return _0x4f62d3;});}else{return _0x4f62d3;}})[_0x47a5('0x41')](function(_0x5c3c75){logger[_0x47a5('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c3c75);throw _0x5c3c75;});}return _0x4f62d3;})[_0x47a5('0x24')](respondWithResult(_0x3d0a88,0xc9))[_0x47a5('0x41')](handleError(_0x3d0a88,null));};exports[_0x47a5('0x23')]=function(_0xf03bd5,_0x588551){if(_0xf03bd5[_0x47a5('0x47')]['id']){delete _0xf03bd5[_0x47a5('0x47')]['id'];}return db[_0x47a5('0x2c')][_0x47a5('0x45')]({'where':{'id':_0xf03bd5[_0x47a5('0x4e')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x588551,null))[_0x47a5('0x24')](saveUpdates(_0xf03bd5['body'],null))[_0x47a5('0x24')](respondWithResult(_0x588551,null))[_0x47a5('0x41')](handleError(_0x588551,null));};exports[_0x47a5('0x25')]=function(_0x8da9fb,_0x3329aa){return db[_0x47a5('0x2c')]['find']({'where':{'id':_0x8da9fb[_0x47a5('0x4e')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x3329aa,null))[_0x47a5('0x24')](removeEntity(_0x3329aa,null))['catch'](handleError(_0x3329aa,null));};exports[_0x47a5('0x4f')]=function(_0x3c78b7,_0x183b3c){return db['CmList']['describe']()[_0x47a5('0x24')](respondWithResult(_0x183b3c,null))[_0x47a5('0x41')](handleError(_0x183b3c,null));};exports['addDisposition']=function(_0x4cf792,_0x6d6b2b,_0x4d6a82){if(_0x4cf792[_0x47a5('0x47')]['id']){delete _0x4cf792['body']['id'];}return db['CmList'][_0x47a5('0x45')]({'where':{'id':_0x4cf792[_0x47a5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x6d6b2b,null))[_0x47a5('0x24')](function(_0x72fe){if(_0x72fe){_0x4cf792['body']['ListId']=_0x72fe['id'];return db[_0x47a5('0x50')][_0x47a5('0x46')](_0x4cf792[_0x47a5('0x47')]);}})[_0x47a5('0x24')](respondWithResult(_0x6d6b2b,null))['catch'](handleError(_0x6d6b2b,null));};exports[_0x47a5('0x51')]=function(_0x2b4255,_0x1af800,_0x5a33b8){var _0x30ea7a={'raw':![],'where':{}};var _0x4db625={};var _0x485e3c={'count':0x0,'rows':[]};return db[_0x47a5('0x2c')][_0x47a5('0x52')]({'where':{'id':_0x2b4255[_0x47a5('0x4e')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x1af800,null))['then'](function(_0x144af9){if(_0x144af9){_0x4db625['model']=_['keys'](db['Disposition']['rawAttributes']);_0x4db625[_0x47a5('0x30')]=_[_0x47a5('0x2f')](_0x2b4255[_0x47a5('0x30')]);_0x4db625['filters']=_['intersection'](_0x4db625[_0x47a5('0x2e')],_0x4db625[_0x47a5('0x30')]);_0x30ea7a[_0x47a5('0x33')]=_[_0x47a5('0x31')](_0x4db625[_0x47a5('0x2e')],qs['fields'](_0x2b4255[_0x47a5('0x30')]['fields']));_0x30ea7a[_0x47a5('0x33')]=_0x30ea7a[_0x47a5('0x33')]['length']?_0x30ea7a[_0x47a5('0x33')]:_0x4db625[_0x47a5('0x2e')];if(!_0x2b4255[_0x47a5('0x30')][_0x47a5('0x53')](_0x47a5('0x34'))){_0x30ea7a[_0x47a5('0x1e')]=qs[_0x47a5('0x1e')](_0x2b4255[_0x47a5('0x30')]['limit']);_0x30ea7a[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x2b4255[_0x47a5('0x30')][_0x47a5('0x1d')]);}_0x30ea7a[_0x47a5('0x35')]=qs['sort'](_0x2b4255[_0x47a5('0x30')][_0x47a5('0x36')]);_0x30ea7a[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_[_0x47a5('0x39')](_0x2b4255[_0x47a5('0x30')],_0x4db625[_0x47a5('0x38')]));_0x30ea7a[_0x47a5('0x37')][_0x47a5('0x54')]=_0x144af9['id'];if(_0x2b4255[_0x47a5('0x30')][_0x47a5('0x55')]){_0x30ea7a[_0x47a5('0x37')]=_[_0x47a5('0x3a')](_0x30ea7a[_0x47a5('0x37')],{'$or':_[_0x47a5('0x56')](_0x30ea7a['attributes'],function(_0x42dd7d){var _0x284fb8={};_0x284fb8[_0x42dd7d]={'$like':'%'+_0x2b4255[_0x47a5('0x30')]['filter']+'%'};return _0x284fb8;})});}_0x30ea7a=_[_0x47a5('0x3a')]({},_0x30ea7a,_0x2b4255[_0x47a5('0x44')]);return db[_0x47a5('0x50')][_0x47a5('0x1c')]({'where':_0x30ea7a['where']})[_0x47a5('0x24')](function(_0x522ccf){_0x485e3c[_0x47a5('0x1c')]=_0x522ccf;if(_0x2b4255['query'][_0x47a5('0x3d')]){_0x30ea7a['include']=[{'all':!![]}];}return db[_0x47a5('0x50')][_0x47a5('0x3f')](_0x30ea7a);})[_0x47a5('0x24')](function(_0x58473b){_0x485e3c['rows']=_0x58473b;return _0x485e3c;});}})['then'](respondWithFilteredResult(_0x1af800,_0x30ea7a))[_0x47a5('0x41')](handleError(_0x1af800,null));};exports[_0x47a5('0x57')]=function(_0xe3c0a7,_0x117510,_0x525055){return db[_0x47a5('0x2c')][_0x47a5('0x45')]({'where':{'id':_0xe3c0a7[_0x47a5('0x4e')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x117510,null))[_0x47a5('0x24')](function(_0xb9f589){if(_0xb9f589){return _0xb9f589[_0x47a5('0x57')](_0xe3c0a7[_0x47a5('0x30')][_0x47a5('0x58')]);}})[_0x47a5('0x24')](respondWithStatusCode(_0x117510,null))[_0x47a5('0x41')](handleError(_0x117510,null));};exports[_0x47a5('0x59')]=function(_0x49d3dc,_0x1e3212,_0x4833be){return db[_0x47a5('0x2c')][_0x47a5('0x45')]({'where':{'id':_0x49d3dc[_0x47a5('0x4e')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x1e3212,null))[_0x47a5('0x24')](function(_0xa9c853){if(_0xa9c853){var _0x12025a=[];var _0x448981={'success':[],'errors':[]};return db[_0x47a5('0x5a')][_0x47a5('0x4f')]()[_0x47a5('0x24')](function(_0x1f07ac){if(_0x49d3dc[_0x47a5('0x47')][_0x47a5('0x5b')]&&_[_0x47a5('0x5c')](_0x49d3dc['body']['tags'])){if(_0x49d3dc['body']['tags'][_0x47a5('0x43')]){_0x49d3dc[_0x47a5('0x47')]['tags']=_0x49d3dc[_0x47a5('0x47')][_0x47a5('0x5b')][_0x47a5('0x5d')](';')+';';}else{_0x49d3dc[_0x47a5('0x47')][_0x47a5('0x5b')]=null;}}else{_0x49d3dc[_0x47a5('0x47')][_0x47a5('0x5b')]=null;}if(_0x49d3dc[_0x47a5('0x47')]&&_[_0x47a5('0x5c')](_0x49d3dc[_0x47a5('0x47')])){for(var _0x24a6c1=0x0;_0x24a6c1<_0x49d3dc['body'][_0x47a5('0x43')];_0x24a6c1+=0x1){_0x49d3dc[_0x47a5('0x47')][_0x24a6c1][_0x47a5('0x54')]=_0x49d3dc['params']['id'];_0x12025a[_0x47a5('0x5e')](_0x49d3dc[_0x47a5('0x47')][_0x24a6c1]);}return BPromise[_0x47a5('0x5f')](_0x12025a,function(_0x5d41d8){return db[_0x47a5('0x5a')]['create'](_['omit'](_0x5d41d8,[_0x47a5('0x58'),'id'])||{},{'fields':_[_0x47a5('0x2f')](_0x1f07ac),'raw':!![]})[_0x47a5('0x24')](function(_0x27333e){_0x448981[_0x47a5('0x60')][_0x47a5('0x5e')](_0x27333e['dataValues']);})['catch'](function(_0x3e0dbd){_0x448981['errors'][_0x47a5('0x5e')]({'data':_0x5d41d8,'error':_0x3e0dbd[_0x47a5('0x61')]});});})[_0x47a5('0x24')](function(_0xb16bdd){return _0x448981;})['catch'](function(_0x3c66e3){return _0x3c66e3;});}else{_0x1e3212['status'](0x190)['json']({'message':_0x47a5('0x62')});}});}})[_0x47a5('0x24')](respondWithResult(_0x1e3212,null))['catch'](handleError(_0x1e3212,null));};exports[_0x47a5('0x63')]=function(_0x21828e,_0x24a98b,_0x4c25ec){var _0x280372;return db['CmList'][_0x47a5('0x45')]({'where':{'id':_0x21828e[_0x47a5('0x4e')]['id']},'include':[{'model':db[_0x47a5('0x64')],'as':'CustomFields'}]})[_0x47a5('0x24')](handleEntityNotFound(_0x24a98b,null))[_0x47a5('0x24')](function(_0x2ae38b){if(_0x2ae38b){_0x280372=_0x2ae38b;return db['CmContact'][_0x47a5('0x2d')];}})['then'](function(_0x3c012b){if(_0x3c012b){var _0x491bb4={};var _0x135d2e={};_0x135d2e[_0x47a5('0x2e')]=_[_0x47a5('0x65')](_[_0x47a5('0x2f')](_0x3c012b),_['map'](_0x280372[_0x47a5('0x66')],function(_0x2ae130){return util[_0x47a5('0x67')](_0x47a5('0x68'),_0x2ae130['id']);}));_0x135d2e[_0x47a5('0x30')]=_['keys'](_0x21828e['query']);_0x135d2e[_0x47a5('0x38')]=_['intersection'](_0x135d2e[_0x47a5('0x2e')],_0x135d2e[_0x47a5('0x30')]);_0x491bb4[_0x47a5('0x33')]=_['intersection'](_0x135d2e[_0x47a5('0x2e')],qs[_0x47a5('0x32')](_0x21828e['query'][_0x47a5('0x32')]));_0x491bb4[_0x47a5('0x33')]=_0x491bb4[_0x47a5('0x33')][_0x47a5('0x43')]?_0x491bb4['attributes']:_0x135d2e['model'];if(!_0x21828e[_0x47a5('0x30')][_0x47a5('0x53')]('nolimit')){_0x491bb4[_0x47a5('0x1e')]=qs[_0x47a5('0x1e')](_0x21828e['query'][_0x47a5('0x1e')]);_0x491bb4[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x21828e['query'][_0x47a5('0x1d')]);}_0x491bb4['order']=qs[_0x47a5('0x36')](_0x21828e['query'][_0x47a5('0x36')]);_0x491bb4[_0x47a5('0x37')]=qs['filters'](_[_0x47a5('0x39')](_0x21828e['query'],_0x135d2e[_0x47a5('0x38')]));_0x491bb4[_0x47a5('0x69')]=!![];if(_0x21828e[_0x47a5('0x30')][_0x47a5('0x55')]){_0x491bb4['where']=_[_0x47a5('0x3a')](_0x491bb4['where'],{'$or':_['map'](_0x491bb4[_0x47a5('0x33')],function(_0x46bdb1){var _0x352238={};_0x352238[_0x46bdb1]={'$like':'%'+_0x21828e[_0x47a5('0x30')][_0x47a5('0x55')]+'%'};return _0x352238;})});}_0x491bb4=_['merge']({},_0x491bb4,_0x21828e[_0x47a5('0x44')]);return _0x280372[_0x47a5('0x63')](_0x491bb4);}})[_0x47a5('0x24')](respondWithResult(_0x24a98b,null))[_0x47a5('0x41')](handleError(_0x24a98b,null));};exports['getContactsCsv']=function(_0x240db9,_0x4af162,_0x12891d){var _0x13b958;return db[_0x47a5('0x2c')][_0x47a5('0x45')]({'where':{'id':_0x240db9[_0x47a5('0x4e')]['id']},'include':[{'model':db[_0x47a5('0x64')],'as':_0x47a5('0x66')}]})[_0x47a5('0x24')](handleEntityNotFound(_0x4af162,null))[_0x47a5('0x24')](function(_0x583746){if(_0x583746){_0x13b958=_0x583746;return db[_0x47a5('0x5a')][_0x47a5('0x2d')];}})['then'](function(_0x2fd46f){if(_0x2fd46f){var _0x32035e={};var _0x6d6a5={};_0x6d6a5['model']=_['concat'](_[_0x47a5('0x2f')](_0x2fd46f),_[_0x47a5('0x56')](_0x13b958['CustomFields'],function(_0x537552){return util[_0x47a5('0x67')](_0x47a5('0x68'),_0x537552['id']);}));_0x6d6a5['query']=_[_0x47a5('0x2f')](_0x240db9[_0x47a5('0x30')]);_0x6d6a5['filters']=_[_0x47a5('0x31')](_0x6d6a5[_0x47a5('0x2e')],_0x6d6a5[_0x47a5('0x30')]);_0x32035e[_0x47a5('0x33')]=_[_0x47a5('0x31')](_0x6d6a5[_0x47a5('0x2e')],qs['fields'](_0x240db9['query']['fields']));_0x32035e[_0x47a5('0x33')]=_0x32035e[_0x47a5('0x33')]['length']?_0x32035e[_0x47a5('0x33')]:_0x6d6a5[_0x47a5('0x2e')];if(!_0x240db9[_0x47a5('0x30')][_0x47a5('0x53')](_0x47a5('0x34'))){_0x32035e['limit']=qs[_0x47a5('0x1e')](_0x240db9['query']['limit']);_0x32035e['offset']=qs[_0x47a5('0x1d')](_0x240db9['query'][_0x47a5('0x1d')]);}_0x32035e[_0x47a5('0x35')]=qs[_0x47a5('0x36')](_0x240db9['query'][_0x47a5('0x36')]);_0x32035e[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_[_0x47a5('0x39')](_0x240db9[_0x47a5('0x30')],_0x6d6a5['filters']));_0x32035e[_0x47a5('0x69')]=!![];if(_0x240db9[_0x47a5('0x30')]['filter']){_0x32035e[_0x47a5('0x37')]=_[_0x47a5('0x3a')](_0x32035e[_0x47a5('0x37')],{'$or':_[_0x47a5('0x56')](_0x32035e[_0x47a5('0x33')],function(_0x186aad){var _0x5112d7={};_0x5112d7[_0x186aad]={'$like':'%'+_0x240db9[_0x47a5('0x30')][_0x47a5('0x55')]+'%'};return _0x5112d7;})});}_0x32035e=_['merge']({},_0x32035e,_0x240db9[_0x47a5('0x44')]);return _0x13b958[_0x47a5('0x63')](_0x32035e);}})[_0x47a5('0x24')](function(_0x12a1de){if(!_['isEmpty'](_0x12a1de)){var _0x4a68b0=toCsv(_0x12a1de);var _0x485e10=Date['now']();fs[_0x47a5('0x6a')](util[_0x47a5('0x67')](_0x47a5('0x6b'),_0x13b958['id'],_0x485e10),_0x4a68b0);_0x4af162[_0x47a5('0x6c')](_0x47a5('0x6d'),_0x47a5('0x6e')+util[_0x47a5('0x67')](_0x47a5('0x6f'),_0x13b958['id'],_0x485e10));_0x4af162['setHeader'](_0x47a5('0x70'),_0x47a5('0x71'));return _0x4af162[_0x47a5('0x72')](util[_0x47a5('0x67')]('/tmp/list_%d_%s.csv',_0x13b958['id'],_0x485e10));}else{return _0x4af162['sendStatus'](0xcc);}})[_0x47a5('0x41')](handleError(_0x4af162,null));};exports['addCustomField']=function(_0x4cb8e4,_0x1b6a5c,_0x3f0a15){var _0x491cef;delete _0x4cb8e4[_0x47a5('0x47')]['id'];return db[_0x47a5('0x2c')][_0x47a5('0x52')]({'where':{'id':_0x4cb8e4['params']['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x1b6a5c,null))[_0x47a5('0x24')](function(_0x48a491){if(_0x48a491){return db[_0x47a5('0x73')][_0x47a5('0x74')](function(_0x10ee87){return db[_0x47a5('0x64')][_0x47a5('0x46')](_0x4cb8e4[_0x47a5('0x47')],{'transaction':_0x10ee87})['then'](function(_0x3fee67){_0x491cef=_0x3fee67;return _0x48a491['addCustomFields'](_0x3fee67,{'transaction':_0x10ee87});})[_0x47a5('0x24')](function(){var _0x3ab7ac={'type':db[_0x47a5('0x75')][_0x47a5('0x76')],'transaction':_0x10ee87};switch(_0x4cb8e4['body'][_0x47a5('0x3b')]){case _0x47a5('0x77'):_0x3ab7ac[_0x47a5('0x3b')]=db[_0x47a5('0x75')][_0x47a5('0x76')];break;case _0x47a5('0x78'):_0x3ab7ac[_0x47a5('0x3b')]=db[_0x47a5('0x75')][_0x47a5('0x79')];break;case _0x47a5('0x7a'):_0x3ab7ac[_0x47a5('0x3b')]=db[_0x47a5('0x75')]['BOOLEAN'];_0x3ab7ac[_0x47a5('0x7b')]=![];break;default:}return db[_0x47a5('0x73')]['queryInterface'][_0x47a5('0x7c')](_0x47a5('0x7d'),util[_0x47a5('0x67')](_0x47a5('0x7e'),_0x491cef['id']),_0x3ab7ac);})[_0x47a5('0x24')](function(){return _0x491cef;});});}})['then'](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x41')](handleError(_0x1b6a5c,null));};exports[_0x47a5('0x7f')]=function(_0x285e7b,_0x266a2f,_0x343214){var _0x363077={};var _0x29c205={};var _0x5e4387;var _0x596562;return db[_0x47a5('0x2c')]['findOne']({'where':{'id':_0x285e7b[_0x47a5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x266a2f,null))[_0x47a5('0x24')](function(_0x8b4354){if(_0x8b4354){_0x5e4387=_0x8b4354;_0x29c205[_0x47a5('0x2e')]=_[_0x47a5('0x2f')](db['CmCustomField'][_0x47a5('0x2d')]);_0x29c205[_0x47a5('0x30')]=_[_0x47a5('0x2f')](_0x285e7b['query']);_0x29c205['filters']=_[_0x47a5('0x31')](_0x29c205[_0x47a5('0x2e')],_0x29c205[_0x47a5('0x30')]);_0x363077[_0x47a5('0x33')]=_[_0x47a5('0x31')](_0x29c205[_0x47a5('0x2e')],qs[_0x47a5('0x32')](_0x285e7b[_0x47a5('0x30')]['fields']));_0x363077[_0x47a5('0x33')]=_0x363077['attributes'][_0x47a5('0x43')]?_0x363077[_0x47a5('0x33')]:_0x29c205['model'];_0x363077['order']=qs[_0x47a5('0x36')](_0x285e7b[_0x47a5('0x30')]['sort']);_0x363077[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_[_0x47a5('0x39')](_0x285e7b[_0x47a5('0x30')],_0x29c205['filters']));_0x363077[_0x47a5('0x37')]=_['merge'](_0x363077['where'],{'$or':[{'ListId':_0x8b4354['id']},{'ListId':null}]});if(_0x285e7b['query'][_0x47a5('0x55')]){_0x363077['where']=_[_0x47a5('0x3a')](_0x363077[_0x47a5('0x37')],{'$or':_[_0x47a5('0x56')](_0x363077[_0x47a5('0x33')],function(_0x267d40){var _0x1dae08={};_0x1dae08[_0x267d40]={'$like':'%'+_0x285e7b[_0x47a5('0x30')][_0x47a5('0x55')]+'%'};return _0x1dae08;})});}_0x363077=_[_0x47a5('0x3a')]({},_0x363077,_0x285e7b[_0x47a5('0x44')]);return db[_0x47a5('0x64')][_0x47a5('0x80')](_0x363077);}})[_0x47a5('0x24')](respondWithResult(_0x266a2f,null))[_0x47a5('0x41')](handleError(_0x266a2f,null));};exports[_0x47a5('0x81')]=function(_0x5e17cb,_0xdd95c8,_0x40aee5){return db[_0x47a5('0x2c')][_0x47a5('0x45')]({'where':{'id':_0x5e17cb['params']['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0xdd95c8,null))['then'](function(_0x4476b5){if(_0x4476b5){return _0x4476b5['addAgents'](_0x5e17cb[_0x47a5('0x47')][_0x47a5('0x58')],_[_0x47a5('0x82')](_0x5e17cb['body'],[_0x47a5('0x58'),'id'])||{})[_0x47a5('0x83')](function(_0x14771b){for(var _0x4ac804=0x0;_0x4ac804<_0x5e17cb['body'][_0x47a5('0x58')][_0x47a5('0x43')];_0x4ac804+=0x1){socket[_0x47a5('0x84')](_0x47a5('0x85'),{'UserId':_0x5e17cb[_0x47a5('0x47')]['ids'][_0x4ac804],'CmListId':_0x5e17cb[_0x47a5('0x4e')]['id']});}return _0x14771b;});}})['then'](respondWithResult(_0xdd95c8,null))[_0x47a5('0x41')](handleError(_0xdd95c8,null));};exports[_0x47a5('0x86')]=function(_0x46647f,_0x2d6ae7,_0x5b18a2){return db['CmList'][_0x47a5('0x45')]({'where':{'id':_0x46647f[_0x47a5('0x4e')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x2d6ae7,null))[_0x47a5('0x24')](function(_0x259088){if(_0x259088){return _0x259088[_0x47a5('0x86')](_0x46647f[_0x47a5('0x30')][_0x47a5('0x58')])[_0x47a5('0x24')](function(){if(_['isArray'](_0x46647f['query'][_0x47a5('0x58')])){for(var _0x5b6ee0=0x0;_0x5b6ee0<_0x46647f[_0x47a5('0x30')][_0x47a5('0x58')][_0x47a5('0x43')];_0x5b6ee0+=0x1){socket['emit'](_0x47a5('0x87'),{'UserId':Number(_0x46647f[_0x47a5('0x30')]['ids'][_0x5b6ee0]),'CmListId':Number(_0x46647f[_0x47a5('0x4e')]['id'])});}}else{socket['emit'](_0x47a5('0x87'),{'UserId':Number(_0x46647f[_0x47a5('0x30')][_0x47a5('0x58')]),'CmListId':Number(_0x46647f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2d6ae7,null))['catch'](handleError(_0x2d6ae7,null));};exports['getAgents']=function(_0x5075a6,_0x1ba5b6,_0x4f1315){var _0x1f26e9={};var _0x2287b0={};var _0x530e98;var _0x49da2a;return db['CmList'][_0x47a5('0x52')]({'where':{'id':_0x5075a6['params']['id']}})['then'](handleEntityNotFound(_0x1ba5b6,null))['then'](function(_0x45947c){if(_0x45947c){_0x530e98=_0x45947c;_0x2287b0[_0x47a5('0x2e')]=_[_0x47a5('0x2f')](db[_0x47a5('0x88')]['rawAttributes']);_0x2287b0[_0x47a5('0x30')]=_['keys'](_0x5075a6[_0x47a5('0x30')]);_0x2287b0['filters']=_[_0x47a5('0x31')](_0x2287b0[_0x47a5('0x2e')],_0x2287b0[_0x47a5('0x30')]);_0x1f26e9['attributes']=_[_0x47a5('0x31')](_0x2287b0[_0x47a5('0x2e')],qs[_0x47a5('0x32')](_0x5075a6[_0x47a5('0x30')]['fields']));_0x1f26e9[_0x47a5('0x33')]=_0x1f26e9[_0x47a5('0x33')][_0x47a5('0x43')]?_0x1f26e9[_0x47a5('0x33')]:_0x2287b0[_0x47a5('0x2e')];_0x1f26e9[_0x47a5('0x35')]=qs['sort'](_0x5075a6[_0x47a5('0x30')][_0x47a5('0x36')]);_0x1f26e9[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_[_0x47a5('0x39')](_0x5075a6[_0x47a5('0x30')],_0x2287b0[_0x47a5('0x38')]));if(_0x5075a6[_0x47a5('0x30')][_0x47a5('0x55')]){_0x1f26e9[_0x47a5('0x37')]=_[_0x47a5('0x3a')](_0x1f26e9[_0x47a5('0x37')],{'$or':_[_0x47a5('0x56')](_0x1f26e9[_0x47a5('0x33')],function(_0x29b926){var _0x3b4b08={};_0x3b4b08[_0x29b926]={'$like':'%'+_0x5075a6[_0x47a5('0x30')]['filter']+'%'};return _0x3b4b08;})});}_0x1f26e9=_[_0x47a5('0x3a')]({},_0x1f26e9,_0x5075a6['options']);return _0x530e98['getAgents'](_0x1f26e9);}})[_0x47a5('0x24')](function(_0x154365){if(_0x154365){_0x49da2a=_0x154365[_0x47a5('0x43')];if(!_0x5075a6['query'][_0x47a5('0x53')](_0x47a5('0x34'))){_0x1f26e9[_0x47a5('0x1e')]=qs[_0x47a5('0x1e')](_0x5075a6[_0x47a5('0x30')][_0x47a5('0x1e')]);_0x1f26e9[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x5075a6[_0x47a5('0x30')][_0x47a5('0x1d')]);}return _0x530e98[_0x47a5('0x89')](_0x1f26e9);}})[_0x47a5('0x24')](function(_0x203bc9){if(_0x203bc9){return _0x203bc9?{'count':_0x49da2a,'rows':_0x203bc9}:null;}})['then'](respondWithResult(_0x1ba5b6,null))['catch'](handleError(_0x1ba5b6,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 0548e6e..9dafb13 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 _0xa7c0=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save','update','remove'];(function(_0x5ea4c1,_0x145cb5){var _0x2279bc=function(_0x44ac9c){while(--_0x44ac9c){_0x5ea4c1['push'](_0x5ea4c1['shift']());}};_0x2279bc(++_0x145cb5);}(_0xa7c0,0x1f3));var _0x0a7c=function(_0x4ec68f,_0x3b4871){_0x4ec68f=_0x4ec68f-0x0;var _0x37329c=_0xa7c0[_0x4ec68f];return _0x37329c;};'use strict';var EventEmitter=require(_0x0a7c('0x0'));var CmList=require(_0x0a7c('0x1'))['db'][_0x0a7c('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x0a7c('0x3')](0x0);var events={'afterCreate':_0x0a7c('0x4'),'afterUpdate':_0x0a7c('0x5'),'afterDestroy':_0x0a7c('0x6')};function emitEvent(_0x56ebe1){return function(_0x3f09d9,_0x16d723,_0x2e5af3){CmListEvents[_0x0a7c('0x7')](_0x56ebe1+':'+_0x3f09d9['id'],_0x3f09d9);CmListEvents[_0x0a7c('0x7')](_0x56ebe1,_0x3f09d9);_0x2e5af3(null);};}for(var e in events){if(events[_0x0a7c('0x8')](e)){var event=events[e];CmList[_0x0a7c('0x9')](e,emitEvent(event));}}module[_0x0a7c('0xa')]=CmListEvents; \ No newline at end of file +var _0xb368=['exports','events','../../mysqldb','CmList','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0xfe16c,_0x446da4){var _0x2c370d=function(_0x2f2d35){while(--_0x2f2d35){_0xfe16c['push'](_0xfe16c['shift']());}};_0x2c370d(++_0x446da4);}(_0xb368,0x173));var _0x8b36=function(_0x17f839,_0x214bb9){_0x17f839=_0x17f839-0x0;var _0x45d5d8=_0xb368[_0x17f839];return _0x45d5d8;};'use strict';var EventEmitter=require(_0x8b36('0x0'));var CmList=require(_0x8b36('0x1'))['db'][_0x8b36('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x8b36('0x3')](0x0);var events={'afterCreate':_0x8b36('0x4'),'afterUpdate':'update','afterDestroy':_0x8b36('0x5')};function emitEvent(_0x1807a9){return function(_0xde8f6f,_0x5c7395,_0xfe02f8){CmListEvents[_0x8b36('0x6')](_0x1807a9+':'+_0xde8f6f['id'],_0xde8f6f);CmListEvents[_0x8b36('0x6')](_0x1807a9,_0xde8f6f);_0xfe02f8(null);};}for(var e in events){if(events[_0x8b36('0x7')](e)){var event=events[e];CmList[_0x8b36('0x8')](e,emitEvent(event));}}module[_0x8b36('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 a70b56f..5b6dab1 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 _0xf36e=['util','api','bluebird','request-promise','path','../../config/environment','./cmList.attributes','define','CmList','lodash'];(function(_0x481f0b,_0x2539d0){var _0x3d9ba0=function(_0x4b1126){while(--_0x4b1126){_0x481f0b['push'](_0x481f0b['shift']());}};_0x3d9ba0(++_0x2539d0);}(_0xf36e,0x149));var _0xef36=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf36e[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xef36('0x0'));var util=require(_0xef36('0x1'));var logger=require('../../config/logger')(_0xef36('0x2'));var moment=require('moment');var BPromise=require(_0xef36('0x3'));var rp=require(_0xef36('0x4'));var fs=require('fs');var path=require(_0xef36('0x5'));var rimraf=require('rimraf');var config=require(_0xef36('0x6'));var attributes=require(_0xef36('0x7'));module['exports']=function(_0x53abb8,_0x49497a){return _0x53abb8[_0xef36('0x8')](_0xef36('0x9'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8650=['api','moment','bluebird','request-promise','path','../../config/environment','./cmList.attributes','exports','CmList','cm_lists','lodash','util','../../config/logger'];(function(_0x2a608d,_0x298459){var _0x1bee3e=function(_0x989a39){while(--_0x989a39){_0x2a608d['push'](_0x2a608d['shift']());}};_0x1bee3e(++_0x298459);}(_0x8650,0xb3));var _0x0865=function(_0x19eb43,_0x423114){_0x19eb43=_0x19eb43-0x0;var _0x432126=_0x8650[_0x19eb43];return _0x432126;};'use strict';var _=require(_0x0865('0x0'));var util=require(_0x0865('0x1'));var logger=require(_0x0865('0x2'))(_0x0865('0x3'));var moment=require(_0x0865('0x4'));var BPromise=require(_0x0865('0x5'));var rp=require(_0x0865('0x6'));var fs=require('fs');var path=require(_0x0865('0x7'));var rimraf=require('rimraf');var config=require(_0x0865('0x8'));var attributes=require(_0x0865('0x9'));module[_0x0865('0xa')]=function(_0x3d7d96,_0x5ee715){return _0x3d7d96['define'](_0x0865('0xb'),attributes,{'tableName':_0x0865('0xc'),'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 45498de..b45cc87 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 _0xafef=['debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xafef,0xa3));var _0xfafe=function(_0x425748,_0x2545df){_0x425748=_0x425748-0x0;var _0x336ab4=_0xafef[_0x425748];return _0x336ab4;};'use strict';var _=require(_0xfafe('0x0'));var util=require(_0xfafe('0x1'));var moment=require('moment');var BPromise=require(_0xfafe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfafe('0x3'));var db=require(_0xfafe('0x4'))['db'];var utils=require(_0xfafe('0x5'));var logger=require(_0xfafe('0x6'))(_0xfafe('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xfafe('0x8')]=_[_0xfafe('0x9')](config[_0xfafe('0x8')],{'host':_0xfafe('0xa'),'port':0x18eb});var socket=require(_0xfafe('0xb'))(new Redis(config[_0xfafe('0x8')]));require(_0xfafe('0xc'))[_0xfafe('0xd')](socket);function respondWithRpcPromise(_0x136a14,_0x804db1,_0x515c02){return new BPromise(function(_0x1110f5,_0x3030e4){return client[_0xfafe('0xe')](_0x136a14,_0x515c02)[_0xfafe('0xf')](function(_0x33d68e){logger[_0xfafe('0x10')](_0xfafe('0x11'),_0x804db1,_0xfafe('0x12'));logger[_0xfafe('0x13')](_0xfafe('0x14'),_0x804db1,_0xfafe('0x12'),JSON[_0xfafe('0x15')](_0x33d68e));if(_0x33d68e['error']){if(_0x33d68e[_0xfafe('0x16')][_0xfafe('0x17')]===0x1f4){logger[_0xfafe('0x16')]('CmList,\x20%s,\x20%s',_0x804db1,_0x33d68e[_0xfafe('0x16')][_0xfafe('0x18')]);return _0x3030e4(_0x33d68e[_0xfafe('0x16')][_0xfafe('0x18')]);}logger['error']('CmList,\x20%s,\x20%s',_0x804db1,_0x33d68e[_0xfafe('0x16')][_0xfafe('0x18')]);return _0x1110f5(_0x33d68e[_0xfafe('0x16')][_0xfafe('0x18')]);}else{logger[_0xfafe('0x10')](_0xfafe('0x11'),_0x804db1,'request\x20sent');_0x1110f5(_0x33d68e[_0xfafe('0x19')][_0xfafe('0x18')]);}})['catch'](function(_0x1118bd){logger[_0xfafe('0x16')](_0xfafe('0x11'),_0x804db1,_0x1118bd);_0x3030e4(_0x1118bd);});});} \ No newline at end of file +var _0xc749=['http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x9a44b0,_0x31059d){var _0x58af6e=function(_0x2baa4f){while(--_0x2baa4f){_0x9a44b0['push'](_0x9a44b0['shift']());}};_0x58af6e(++_0x31059d);}(_0xc749,0x135));var _0x9c74=function(_0x42cfc9,_0x195635){_0x42cfc9=_0x42cfc9-0x0;var _0x5acece=_0xc749[_0x42cfc9];return _0x5acece;};'use strict';var _=require(_0x9c74('0x0'));var util=require('util');var moment=require(_0x9c74('0x1'));var BPromise=require(_0x9c74('0x2'));var rs=require(_0x9c74('0x3'));var fs=require('fs');var Redis=require(_0x9c74('0x4'));var db=require(_0x9c74('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9c74('0x6'));var config=require(_0x9c74('0x7'));var jayson=require(_0x9c74('0x8'));var client=jayson[_0x9c74('0x9')][_0x9c74('0xa')]({'port':0x232a});config[_0x9c74('0xb')]=_[_0x9c74('0xc')](config['redis'],{'host':_0x9c74('0xd'),'port':0x18eb});var socket=require(_0x9c74('0xe'))(new Redis(config[_0x9c74('0xb')]));require(_0x9c74('0xf'))[_0x9c74('0x10')](socket);function respondWithRpcPromise(_0x1ba32c,_0x1cd166,_0x2e7d93){return new BPromise(function(_0x1b01c5,_0x170348){return client[_0x9c74('0x11')](_0x1ba32c,_0x2e7d93)[_0x9c74('0x12')](function(_0x16f68f){logger[_0x9c74('0x13')](_0x9c74('0x14'),_0x1cd166,_0x9c74('0x15'));logger[_0x9c74('0x16')](_0x9c74('0x17'),_0x1cd166,'request\x20sent',JSON[_0x9c74('0x18')](_0x16f68f));if(_0x16f68f['error']){if(_0x16f68f[_0x9c74('0x19')][_0x9c74('0x1a')]===0x1f4){logger['error'](_0x9c74('0x14'),_0x1cd166,_0x16f68f[_0x9c74('0x19')][_0x9c74('0x1b')]);return _0x170348(_0x16f68f['error'][_0x9c74('0x1b')]);}logger[_0x9c74('0x19')]('CmList,\x20%s,\x20%s',_0x1cd166,_0x16f68f[_0x9c74('0x19')][_0x9c74('0x1b')]);return _0x1b01c5(_0x16f68f[_0x9c74('0x19')][_0x9c74('0x1b')]);}else{logger[_0x9c74('0x13')]('CmList,\x20%s,\x20%s',_0x1cd166,_0x9c74('0x15'));_0x1b01c5(_0x16f68f['result']['message']);}})[_0x9c74('0x1c')](function(_0x3f5678){logger[_0x9c74('0x19')](_0x9c74('0x14'),_0x1cd166,_0x3f5678);_0x170348(_0x3f5678);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 41e4f5f..9cb3e3b 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 _0xc4aa=['remove','update','removeListener','register','length','./cmList.events','save'];(function(_0x1da1df,_0x53ff5e){var _0x4da350=function(_0x5a0e1b){while(--_0x5a0e1b){_0x1da1df['push'](_0x1da1df['shift']());}};_0x4da350(++_0x53ff5e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xc4aa[_0x53ccf2];return _0x5a2964;};'use strict';var CmListEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){CmListEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('cmList:'+_0x10525b,_0x215f39);CmListEvents['on'](_0x10525b,_0x5c6179);}}; \ No newline at end of file +var _0xe0ae=['update','emit','removeListener','length','cmList:','remove'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe0ae,0xa1));var _0xee0a=function(_0x532d78,_0x25b6a8){_0x532d78=_0x532d78-0x0;var _0x5990c4=_0xe0ae[_0x532d78];return _0x5990c4;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0xee0a('0x0'),_0xee0a('0x1')];function createListener(_0x49a5e2,_0x42f3f6){return function(_0x4fa2cf){_0x42f3f6[_0xee0a('0x2')](_0x49a5e2,_0x4fa2cf);};}function removeListener(_0x45bbca,_0x4cd518){return function(){CmListEvents[_0xee0a('0x3')](_0x45bbca,_0x4cd518);};}exports['register']=function(_0x5bef07){for(var _0x39a302=0x0,_0x1c5071=events[_0xee0a('0x4')];_0x39a302<_0x1c5071;_0x39a302++){var _0x344355=events[_0x39a302];var _0x5e6d2e=createListener(_0xee0a('0x5')+_0x344355,_0x5bef07);CmListEvents['on'](_0x344355,_0x5e6d2e);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index ade7055..af56907 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 _0x2527=['destroy','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getAgents','post','create','addDisposition','/:id/contacts','addContacts','addCustomField','/:id/users','put','update','delete'];(function(_0xb984a7,_0x564ef9){var _0x247044=function(_0x4142c7){while(--_0x4142c7){_0xb984a7['push'](_0xb984a7['shift']());}};_0x247044(++_0x564ef9);}(_0x2527,0x12c));var _0x7252=function(_0xae73b,_0x5e53f5){_0xae73b=_0xae73b-0x0;var _0x529d06=_0x2527[_0xae73b];return _0x529d06;};'use strict';var multer=require(_0x7252('0x0'));var util=require(_0x7252('0x1'));var path=require(_0x7252('0x2'));var timeout=require(_0x7252('0x3'));var express=require(_0x7252('0x4'));var router=express['Router']();var auth=require(_0x7252('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7252('0x6'));var controller=require('./cmList.controller');router[_0x7252('0x7')]('/',auth[_0x7252('0x8')](),controller[_0x7252('0x9')]);router[_0x7252('0x7')](_0x7252('0xa'),auth[_0x7252('0x8')](),controller[_0x7252('0xb')]);router[_0x7252('0x7')]('/:id',auth[_0x7252('0x8')](),controller[_0x7252('0xc')]);router['get'](_0x7252('0xd'),auth[_0x7252('0x8')](),controller[_0x7252('0xe')]);router[_0x7252('0x7')]('/:id/contacts',auth[_0x7252('0x8')](),controller[_0x7252('0xf')]);router[_0x7252('0x7')](_0x7252('0x10'),auth[_0x7252('0x8')](),controller[_0x7252('0x11')]);router['get'](_0x7252('0x12'),auth[_0x7252('0x8')](),controller['getCustomFields']);router['get']('/:id/users',auth[_0x7252('0x8')](),controller[_0x7252('0x13')]);router[_0x7252('0x14')]('/',auth[_0x7252('0x8')](),controller[_0x7252('0x15')]);router[_0x7252('0x14')](_0x7252('0xd'),auth[_0x7252('0x8')](),controller[_0x7252('0x16')]);router[_0x7252('0x14')](_0x7252('0x17'),auth[_0x7252('0x8')](),controller[_0x7252('0x18')]);router['post']('/:id/fields',auth[_0x7252('0x8')](),controller[_0x7252('0x19')]);router[_0x7252('0x14')](_0x7252('0x1a'),auth['isAuthenticated'](),controller['addAgents']);router[_0x7252('0x1b')]('/:id',auth[_0x7252('0x8')](),controller[_0x7252('0x1c')]);router[_0x7252('0x1d')]('/:id',auth[_0x7252('0x8')](),controller[_0x7252('0x1e')]);router[_0x7252('0x1d')](_0x7252('0xd'),auth[_0x7252('0x8')](),controller[_0x7252('0x1f')]);router[_0x7252('0x1d')](_0x7252('0x1a'),auth[_0x7252('0x8')](),controller[_0x7252('0x20')]);module['exports']=router; \ No newline at end of file +var _0xe4d7=['getCustomFields','post','create','addDisposition','addContacts','/:id/users','/:id','update','delete','destroy','removeAgents','exports','connect-timeout','express','Router','./cmList.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields'];(function(_0x4b6cc8,_0x355e5b){var _0x5c4743=function(_0x68d0f6){while(--_0x68d0f6){_0x4b6cc8['push'](_0x4b6cc8['shift']());}};_0x5c4743(++_0x355e5b);}(_0xe4d7,0xec));var _0x7e4d=function(_0x327885,_0x4bf39b){_0x327885=_0x327885-0x0;var _0x536910=_0xe4d7[_0x327885];return _0x536910;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7e4d('0x0'));var express=require(_0x7e4d('0x1'));var router=express[_0x7e4d('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7e4d('0x3'));router[_0x7e4d('0x4')]('/',auth[_0x7e4d('0x5')](),controller['index']);router[_0x7e4d('0x4')](_0x7e4d('0x6'),auth[_0x7e4d('0x5')](),controller[_0x7e4d('0x7')]);router[_0x7e4d('0x4')]('/:id',auth[_0x7e4d('0x5')](),controller[_0x7e4d('0x8')]);router[_0x7e4d('0x4')](_0x7e4d('0x9'),auth[_0x7e4d('0x5')](),controller[_0x7e4d('0xa')]);router['get'](_0x7e4d('0xb'),auth[_0x7e4d('0x5')](),controller[_0x7e4d('0xc')]);router['get'](_0x7e4d('0xd'),auth[_0x7e4d('0x5')](),controller[_0x7e4d('0xe')]);router[_0x7e4d('0x4')](_0x7e4d('0xf'),auth[_0x7e4d('0x5')](),controller[_0x7e4d('0x10')]);router[_0x7e4d('0x4')]('/:id/users',auth[_0x7e4d('0x5')](),controller['getAgents']);router[_0x7e4d('0x11')]('/',auth['isAuthenticated'](),controller[_0x7e4d('0x12')]);router[_0x7e4d('0x11')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x7e4d('0x13')]);router[_0x7e4d('0x11')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x7e4d('0x14')]);router['post'](_0x7e4d('0xf'),auth[_0x7e4d('0x5')](),controller['addCustomField']);router[_0x7e4d('0x11')](_0x7e4d('0x15'),auth[_0x7e4d('0x5')](),controller['addAgents']);router['put'](_0x7e4d('0x16'),auth[_0x7e4d('0x5')](),controller[_0x7e4d('0x17')]);router[_0x7e4d('0x18')]('/:id',auth[_0x7e4d('0x5')](),controller[_0x7e4d('0x19')]);router[_0x7e4d('0x18')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0x7e4d('0x15'),auth['isAuthenticated'](),controller[_0x7e4d('0x1a')]);module[_0x7e4d('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 b0aa0de..559d0f9 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(_0x272098,_0x52815c){var _0x4de3c5=function(_0x571667){while(--_0x571667){_0x272098['push'](_0x272098['shift']());}};_0x4de3c5(++_0x52815c);}(_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')]={'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 _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x5c36de,_0xddd897){var _0x40d987=function(_0x2a42bd){while(--_0x2a42bd){_0x5c36de['push'](_0x5c36de['shift']());}};_0x40d987(++_0xddd897);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('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 95ab811..4dba4d9 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 _0x7e46=['util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','reject','then','destroy','end','stack','body','Condition','find','catch','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x177803,_0x383358){var _0x55b3f8=function(_0x13bc67){while(--_0x13bc67){_0x177803['push'](_0x177803['shift']());}};_0x55b3f8(++_0x383358);}(_0x7e46,0x1a6));var _0x67e4=function(_0xfdde65,_0x1e41fb){_0xfdde65=_0xfdde65-0x0;var _0x5d4722=_0x7e46[_0xfdde65];return _0x5d4722;};'use strict';var pdf=require(_0x67e4('0x0'));var emlformat=require(_0x67e4('0x1'));var rimraf=require(_0x67e4('0x2'));var zipdir=require(_0x67e4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x67e4('0x4'));var moment=require(_0x67e4('0x5'));var BPromise=require(_0x67e4('0x6'));var Mustache=require('mustache');var util=require(_0x67e4('0x7'));var path=require(_0x67e4('0x8'));var sox=require(_0x67e4('0x9'));var csv=require(_0x67e4('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x67e4('0xb'));var squel=require(_0x67e4('0xc'));var crypto=require(_0x67e4('0xd'));var jsforce=require(_0x67e4('0xe'));var deskjs=require(_0x67e4('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x67e4('0x10'));var Redis=require('ioredis');var authService=require(_0x67e4('0x11'));var qs=require(_0x67e4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x67e4('0x13'))(_0x67e4('0x14'));var utils=require(_0x67e4('0x15'));var config=require('../../config/environment');var db=require(_0x67e4('0x16'))['db'];function respondWithStatusCode(_0xbd7ee2,_0x45a53c){_0x45a53c=_0x45a53c||0xcc;return function(_0x4abde9){if(_0x4abde9){return _0xbd7ee2[_0x67e4('0x17')](_0x45a53c);}return _0xbd7ee2[_0x67e4('0x18')](_0x45a53c)['end']();};}function respondWithResult(_0x2813c2,_0x4f4724){_0x4f4724=_0x4f4724||0xc8;return function(_0x4a9ab1){if(_0x4a9ab1){return _0x2813c2[_0x67e4('0x18')](_0x4f4724)[_0x67e4('0x19')](_0x4a9ab1);}};}function respondWithFilteredResult(_0x309311,_0x224b2c){return function(_0x58be85){if(_0x58be85){var _0x407866=_0x58be85[_0x67e4('0x1a')],_0x2de5fe=_0x224b2c[_0x67e4('0x1b')],_0x89f5ee=_0x224b2c[_0x67e4('0x1b')]+_0x224b2c[_0x67e4('0x1c')],_0x2a6b3c;if(_0x89f5ee>=_0x407866){_0x89f5ee=_0x407866;_0x2a6b3c=0xc8;}else{_0x2a6b3c=0xce;}_0x309311[_0x67e4('0x18')](_0x2a6b3c);return _0x309311['set'](_0x67e4('0x1d'),_0x2de5fe+'-'+_0x89f5ee+'/'+_0x407866)[_0x67e4('0x19')](_0x58be85);}return null;};}function patchUpdates(_0x126ed6){return function(_0x50c51a){try{jsonpatch['apply'](_0x50c51a,_0x126ed6,!![]);}catch(_0x278b36){return BPromise[_0x67e4('0x1e')](_0x278b36);}return _0x50c51a['save']();};}function saveUpdates(_0x402f6c,_0x5c61c4){return function(_0x11b81c){if(_0x11b81c){return _0x11b81c['update'](_0x402f6c)[_0x67e4('0x1f')](function(_0x47c0cd){return _0x47c0cd;});}return null;};}function removeEntity(_0x418cf4,_0x7be397){return function(_0x1db464){if(_0x1db464){return _0x1db464[_0x67e4('0x20')]()[_0x67e4('0x1f')](function(){_0x418cf4[_0x67e4('0x18')](0xcc)[_0x67e4('0x21')]();});}};}function handleEntityNotFound(_0x360e50,_0x59ff62){return function(_0x4d55d2){if(!_0x4d55d2){_0x360e50[_0x67e4('0x17')](0x194);}return _0x4d55d2;};}function handleError(_0x304353,_0x349a88){_0x349a88=_0x349a88||0x1f4;return function(_0x25362e){logger['error'](_0x25362e[_0x67e4('0x22')]);if(_0x25362e['name']){delete _0x25362e['name'];}_0x304353[_0x67e4('0x18')](_0x349a88)['send'](_0x25362e);};}exports['update']=function(_0x3fa404,_0x8fb68d){if(_0x3fa404[_0x67e4('0x23')]['id']){delete _0x3fa404[_0x67e4('0x23')]['id'];}return db[_0x67e4('0x24')][_0x67e4('0x25')]({'where':{'id':_0x3fa404['params']['id']}})[_0x67e4('0x1f')](handleEntityNotFound(_0x8fb68d,null))[_0x67e4('0x1f')](saveUpdates(_0x3fa404[_0x67e4('0x23')],null))['then'](respondWithResult(_0x8fb68d,null))[_0x67e4('0x26')](handleError(_0x8fb68d,null));};exports[_0x67e4('0x20')]=function(_0x5606c5,_0x23aabf){return db['Condition'][_0x67e4('0x25')]({'where':{'id':_0x5606c5['params']['id']}})[_0x67e4('0x1f')](handleEntityNotFound(_0x23aabf,null))[_0x67e4('0x1f')](removeEntity(_0x23aabf,null))[_0x67e4('0x26')](handleError(_0x23aabf,null));}; \ No newline at end of file +var _0x9567=['apply','reject','save','update','then','destroy','error','stack','name','send','body','find','params','catch','Condition','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range'];(function(_0x540620,_0x3a00ad){var _0x4c0303=function(_0x47f7ae){while(--_0x47f7ae){_0x540620['push'](_0x540620['shift']());}};_0x4c0303(++_0x3a00ad);}(_0x9567,0x67));var _0x7956=function(_0x27c6aa,_0x373f57){_0x27c6aa=_0x27c6aa-0x0;var _0x18a781=_0x9567[_0x27c6aa];return _0x18a781;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7956('0x0'));var rimraf=require(_0x7956('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7956('0x2'));var moment=require(_0x7956('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7956('0x4'));var util=require(_0x7956('0x5'));var path=require(_0x7956('0x6'));var sox=require(_0x7956('0x7'));var csv=require(_0x7956('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7956('0x9'));var squel=require(_0x7956('0xa'));var crypto=require(_0x7956('0xb'));var jsforce=require(_0x7956('0xc'));var deskjs=require(_0x7956('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7956('0xe'));var Redis=require(_0x7956('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7956('0x10'));var hardwareService=require(_0x7956('0x11'));var logger=require(_0x7956('0x12'))(_0x7956('0x13'));var utils=require(_0x7956('0x14'));var config=require(_0x7956('0x15'));var db=require(_0x7956('0x16'))['db'];function respondWithStatusCode(_0x33eca2,_0x534d09){_0x534d09=_0x534d09||0xcc;return function(_0x36e1fc){if(_0x36e1fc){return _0x33eca2[_0x7956('0x17')](_0x534d09);}return _0x33eca2[_0x7956('0x18')](_0x534d09)[_0x7956('0x19')]();};}function respondWithResult(_0x78159e,_0x474357){_0x474357=_0x474357||0xc8;return function(_0x2dbc85){if(_0x2dbc85){return _0x78159e[_0x7956('0x18')](_0x474357)['json'](_0x2dbc85);}};}function respondWithFilteredResult(_0x2aeb7e,_0x3bbb9d){return function(_0x4ba6b4){if(_0x4ba6b4){var _0x17f5e2=_0x4ba6b4['count'],_0x3adcab=_0x3bbb9d[_0x7956('0x1a')],_0x4ab00c=_0x3bbb9d[_0x7956('0x1a')]+_0x3bbb9d[_0x7956('0x1b')],_0x2f1e1c;if(_0x4ab00c>=_0x17f5e2){_0x4ab00c=_0x17f5e2;_0x2f1e1c=0xc8;}else{_0x2f1e1c=0xce;}_0x2aeb7e[_0x7956('0x18')](_0x2f1e1c);return _0x2aeb7e['set'](_0x7956('0x1c'),_0x3adcab+'-'+_0x4ab00c+'/'+_0x17f5e2)['json'](_0x4ba6b4);}return null;};}function patchUpdates(_0x3d5202){return function(_0x32c4cf){try{jsonpatch[_0x7956('0x1d')](_0x32c4cf,_0x3d5202,!![]);}catch(_0x58dea2){return BPromise[_0x7956('0x1e')](_0x58dea2);}return _0x32c4cf[_0x7956('0x1f')]();};}function saveUpdates(_0x3b4f0e,_0x1aa467){return function(_0x3f1cab){if(_0x3f1cab){return _0x3f1cab[_0x7956('0x20')](_0x3b4f0e)[_0x7956('0x21')](function(_0x551b11){return _0x551b11;});}return null;};}function removeEntity(_0x56147e,_0xe56fd){return function(_0x517415){if(_0x517415){return _0x517415[_0x7956('0x22')]()['then'](function(){_0x56147e[_0x7956('0x18')](0xcc)[_0x7956('0x19')]();});}};}function handleEntityNotFound(_0x23cc22,_0x542ec5){return function(_0x525538){if(!_0x525538){_0x23cc22[_0x7956('0x17')](0x194);}return _0x525538;};}function handleError(_0x1ff1c7,_0x599c64){_0x599c64=_0x599c64||0x1f4;return function(_0x565f57){logger[_0x7956('0x23')](_0x565f57[_0x7956('0x24')]);if(_0x565f57['name']){delete _0x565f57[_0x7956('0x25')];}_0x1ff1c7['status'](_0x599c64)[_0x7956('0x26')](_0x565f57);};}exports[_0x7956('0x20')]=function(_0x219fca,_0x50a088){if(_0x219fca[_0x7956('0x27')]['id']){delete _0x219fca[_0x7956('0x27')]['id'];}return db['Condition'][_0x7956('0x28')]({'where':{'id':_0x219fca[_0x7956('0x29')]['id']}})[_0x7956('0x21')](handleEntityNotFound(_0x50a088,null))[_0x7956('0x21')](saveUpdates(_0x219fca[_0x7956('0x27')],null))['then'](respondWithResult(_0x50a088,null))[_0x7956('0x2a')](handleError(_0x50a088,null));};exports[_0x7956('0x22')]=function(_0x59f205,_0x12bf60){return db[_0x7956('0x2b')][_0x7956('0x28')]({'where':{'id':_0x59f205[_0x7956('0x29')]['id']}})[_0x7956('0x21')](handleEntityNotFound(_0x12bf60,null))['then'](removeEntity(_0x12bf60,null))[_0x7956('0x2a')](handleError(_0x12bf60,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 4d1fabc..36eaab8 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 _0x7c75=['api','moment','bluebird','request-promise','path','rimraf','./condition.attributes','exports','define','tools_conditions','lodash','../../config/logger'];(function(_0xff1e57,_0x1a8e83){var _0x226f6d=function(_0x56254d){while(--_0x56254d){_0xff1e57['push'](_0xff1e57['shift']());}};_0x226f6d(++_0x1a8e83);}(_0x7c75,0x6a));var _0x57c7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7c75[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x57c7('0x0'));var util=require('util');var logger=require(_0x57c7('0x1'))(_0x57c7('0x2'));var moment=require(_0x57c7('0x3'));var BPromise=require(_0x57c7('0x4'));var rp=require(_0x57c7('0x5'));var fs=require('fs');var path=require(_0x57c7('0x6'));var rimraf=require(_0x57c7('0x7'));var config=require('../../config/environment');var attributes=require(_0x57c7('0x8'));module[_0x57c7('0x9')]=function(_0xf5af13,_0x5704ea){return _0xf5af13[_0x57c7('0xa')]('Condition',attributes,{'tableName':_0x57c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfde5=['bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','tools_conditions','util','../../config/logger','api','moment'];(function(_0x3d7bd5,_0x2b54d4){var _0x1c3dc6=function(_0x28a327){while(--_0x28a327){_0x3d7bd5['push'](_0x3d7bd5['shift']());}};_0x1c3dc6(++_0x2b54d4);}(_0xfde5,0x175));var _0x5fde=function(_0x140be4,_0x2555bf){_0x140be4=_0x140be4-0x0;var _0xc00624=_0xfde5[_0x140be4];return _0xc00624;};'use strict';var _=require('lodash');var util=require(_0x5fde('0x0'));var logger=require(_0x5fde('0x1'))(_0x5fde('0x2'));var moment=require(_0x5fde('0x3'));var BPromise=require(_0x5fde('0x4'));var rp=require(_0x5fde('0x5'));var fs=require('fs');var path=require(_0x5fde('0x6'));var rimraf=require(_0x5fde('0x7'));var config=require(_0x5fde('0x8'));var attributes=require(_0x5fde('0x9'));module[_0x5fde('0xa')]=function(_0x5f3977,_0x57af8c){return _0x5f3977[_0x5fde('0xb')]('Condition',attributes,{'tableName':_0x5fde('0xc'),'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 e4ee83f..97be6ff 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 _0xe73d=['catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Condition,\x20%s,\x20%s','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result'];(function(_0x45081a,_0x3ae384){var _0x55bfe2=function(_0xdb8714){while(--_0xdb8714){_0x45081a['push'](_0x45081a['shift']());}};_0x55bfe2(++_0x3ae384);}(_0xe73d,0xc9));var _0xde73=function(_0x22fa65,_0x159132){_0x22fa65=_0x22fa65-0x0;var _0x1ae4b7=_0xe73d[_0x22fa65];return _0x1ae4b7;};'use strict';var _=require('lodash');var util=require(_0xde73('0x0'));var moment=require(_0xde73('0x1'));var BPromise=require(_0xde73('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde73('0x3'));var db=require(_0xde73('0x4'))['db'];var utils=require(_0xde73('0x5'));var logger=require(_0xde73('0x6'))(_0xde73('0x7'));var config=require(_0xde73('0x8'));var jayson=require(_0xde73('0x9'));var client=jayson['client'][_0xde73('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2866aa,_0x4ece50,_0x17a945){return new BPromise(function(_0x2d2050,_0x1a9ed7){return client[_0xde73('0xb')](_0x2866aa,_0x17a945)['then'](function(_0x987677){logger[_0xde73('0xc')](_0xde73('0xd'),_0x4ece50,'request\x20sent');logger['debug'](_0xde73('0xe'),_0x4ece50,_0xde73('0xf'),JSON['stringify'](_0x987677));if(_0x987677[_0xde73('0x10')]){if(_0x987677[_0xde73('0x10')]['code']===0x1f4){logger[_0xde73('0x10')]('Condition,\x20%s,\x20%s',_0x4ece50,_0x987677[_0xde73('0x10')]['message']);return _0x1a9ed7(_0x987677[_0xde73('0x10')][_0xde73('0x11')]);}logger[_0xde73('0x10')]('Condition,\x20%s,\x20%s',_0x4ece50,_0x987677[_0xde73('0x10')]['message']);return _0x2d2050(_0x987677[_0xde73('0x10')]['message']);}else{logger[_0xde73('0xc')](_0xde73('0xd'),_0x4ece50,'request\x20sent');_0x2d2050(_0x987677[_0xde73('0x12')][_0xde73('0x11')]);}})[_0xde73('0x13')](function(_0x4fcb7b){logger[_0xde73('0x10')](_0xde73('0xd'),_0x4ece50,_0x4fcb7b);_0x1a9ed7(_0x4fcb7b);});});} \ No newline at end of file +var _0x06b0=['request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','Condition,\x20%s,\x20%s'];(function(_0x1c447c,_0x3e1725){var _0x217dfb=function(_0x581284){while(--_0x581284){_0x1c447c['push'](_0x1c447c['shift']());}};_0x217dfb(++_0x3e1725);}(_0x06b0,0xc5));var _0x006b=function(_0xf1656e,_0x1093e9){_0xf1656e=_0xf1656e-0x0;var _0x1dfbfa=_0x06b0[_0xf1656e];return _0x1dfbfa;};'use strict';var _=require(_0x006b('0x0'));var util=require(_0x006b('0x1'));var moment=require(_0x006b('0x2'));var BPromise=require(_0x006b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x006b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x006b('0x5'));var logger=require('../../config/logger')(_0x006b('0x6'));var config=require(_0x006b('0x7'));var jayson=require(_0x006b('0x8'));var client=jayson[_0x006b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34b32a,_0x38d3aa,_0x5337cf){return new BPromise(function(_0x84cbe,_0x4b10f8){return client['request'](_0x34b32a,_0x5337cf)['then'](function(_0x3c9318){logger[_0x006b('0xa')](_0x006b('0xb'),_0x38d3aa,_0x006b('0xc'));logger[_0x006b('0xd')](_0x006b('0xe'),_0x38d3aa,'request\x20sent',JSON['stringify'](_0x3c9318));if(_0x3c9318[_0x006b('0xf')]){if(_0x3c9318[_0x006b('0xf')][_0x006b('0x10')]===0x1f4){logger['error'](_0x006b('0xb'),_0x38d3aa,_0x3c9318[_0x006b('0xf')][_0x006b('0x11')]);return _0x4b10f8(_0x3c9318[_0x006b('0xf')][_0x006b('0x11')]);}logger[_0x006b('0xf')](_0x006b('0xb'),_0x38d3aa,_0x3c9318[_0x006b('0xf')][_0x006b('0x11')]);return _0x84cbe(_0x3c9318[_0x006b('0xf')][_0x006b('0x11')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x38d3aa,_0x006b('0xc'));_0x84cbe(_0x3c9318[_0x006b('0x12')][_0x006b('0x11')]);}})['catch'](function(_0x5daeb1){logger['error'](_0x006b('0xb'),_0x38d3aa,_0x5daeb1);_0x4b10f8(_0x5daeb1);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 2b735f7..cae539f 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 _0x62ce=['../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x54a939,_0x45357c){var _0x4500d5=function(_0x3d2bc6){while(--_0x3d2bc6){_0x54a939['push'](_0x54a939['shift']());}};_0x4500d5(++_0x45357c);}(_0x62ce,0x135));var _0xe62c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x62ce[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xe62c('0x0'));var util=require('util');var path=require(_0xe62c('0x1'));var timeout=require(_0xe62c('0x2'));var express=require(_0xe62c('0x3'));var router=express[_0xe62c('0x4')]();var auth=require(_0xe62c('0x5'));var interaction=require(_0xe62c('0x6'));var config=require(_0xe62c('0x7'));var controller=require('./condition.controller');router[_0xe62c('0x8')](_0xe62c('0x9'),auth[_0xe62c('0xa')](),controller[_0xe62c('0xb')]);router[_0xe62c('0xc')](_0xe62c('0x9'),auth[_0xe62c('0xa')](),controller[_0xe62c('0xd')]);module[_0xe62c('0xe')]=router; \ No newline at end of file +var _0x305c=['../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3d4afb,_0x4a897e){var _0x20751b=function(_0x20a22d){while(--_0x20a22d){_0x3d4afb['push'](_0x3d4afb['shift']());}};_0x20751b(++_0x4a897e);}(_0x305c,0x1b8));var _0xc305=function(_0x195a3b,_0x6e9cf1){_0x195a3b=_0x195a3b-0x0;var _0x3b915f=_0x305c[_0x195a3b];return _0x3b915f;};'use strict';var multer=require(_0xc305('0x0'));var util=require(_0xc305('0x1'));var path=require(_0xc305('0x2'));var timeout=require(_0xc305('0x3'));var express=require(_0xc305('0x4'));var router=express[_0xc305('0x5')]();var auth=require(_0xc305('0x6'));var interaction=require(_0xc305('0x7'));var config=require(_0xc305('0x8'));var controller=require(_0xc305('0x9'));router[_0xc305('0xa')](_0xc305('0xb'),auth[_0xc305('0xc')](),controller[_0xc305('0xd')]);router[_0xc305('0xe')]('/:id',auth[_0xc305('0xc')](),controller[_0xc305('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 26c51eb..eb25cab 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 _0x0f17=['exports','STRING','name','sequelize'];(function(_0x431372,_0x101a8b){var _0x219b59=function(_0x5bf1ae){while(--_0x5bf1ae){_0x431372['push'](_0x431372['shift']());}};_0x219b59(++_0x101a8b);}(_0x0f17,0x8b));var _0x70f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f17[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x70f1('0x0'));module[_0x70f1('0x1')]={'name':{'type':Sequelize[_0x70f1('0x2')],'allowNull':![],'unique':_0x70f1('0x3')},'description':{'type':Sequelize[_0x70f1('0x2')]}}; \ No newline at end of file +var _0x4cff=['sequelize','exports','name'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0x4cff,0x14a));var _0xf4cf=function(_0x16bd42,_0x3a9920){_0x16bd42=_0x16bd42-0x0;var _0x5cc1db=_0x4cff[_0x16bd42];return _0x5cc1db;};'use strict';var Sequelize=require(_0xf4cf('0x0'));module[_0xf4cf('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf4cf('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 60e7f37..8e3ec4c 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 _0x94c1=['findOne','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','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','get','CustomDashboards','error','stack','name','send','index','rawAttributes','model','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','includeAll','include','Dashboard','rows','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','DashboardId','DashboardItem','getItems'];(function(_0x108902,_0x7b318c){var _0x28271e=function(_0x4540bf){while(--_0x4540bf){_0x108902['push'](_0x108902['shift']());}};_0x28271e(++_0x7b318c);}(_0x94c1,0x78));var _0x194c=function(_0x1c443b,_0xd71afd){_0x1c443b=_0x1c443b-0x0;var _0x335c4d=_0x94c1[_0x1c443b];return _0x335c4d;};'use strict';var pdf=require(_0x194c('0x0'));var emlformat=require(_0x194c('0x1'));var rimraf=require(_0x194c('0x2'));var zipdir=require(_0x194c('0x3'));var jsonpatch=require(_0x194c('0x4'));var rp=require(_0x194c('0x5'));var moment=require(_0x194c('0x6'));var BPromise=require(_0x194c('0x7'));var Mustache=require(_0x194c('0x8'));var util=require(_0x194c('0x9'));var path=require('path');var sox=require(_0x194c('0xa'));var csv=require(_0x194c('0xb'));var ejs=require(_0x194c('0xc'));var fs=require('fs');var _=require(_0x194c('0xd'));var squel=require(_0x194c('0xe'));var crypto=require(_0x194c('0xf'));var jsforce=require(_0x194c('0x10'));var deskjs=require(_0x194c('0x11'));var toCsv=require(_0x194c('0xb'));var querystring=require('querystring');var Papa=require(_0x194c('0x12'));var Redis=require('ioredis');var authService=require(_0x194c('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x194c('0x14'));var logger=require(_0x194c('0x15'))(_0x194c('0x16'));var utils=require(_0x194c('0x17'));var config=require(_0x194c('0x18'));var db=require('../../mysqldb')['db'];config[_0x194c('0x19')]=_['defaults'](config[_0x194c('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x194c('0x1a'))(new Redis(config[_0x194c('0x19')]));require(_0x194c('0x1b'))[_0x194c('0x1c')](socket);function respondWithStatusCode(_0x13468e,_0x25b66a){_0x25b66a=_0x25b66a||0xcc;return function(_0x55adde){if(_0x55adde){return _0x13468e[_0x194c('0x1d')](_0x25b66a);}return _0x13468e[_0x194c('0x1e')](_0x25b66a)[_0x194c('0x1f')]();};}function respondWithResult(_0x2604ca,_0x2962de){_0x2962de=_0x2962de||0xc8;return function(_0x15409b){if(_0x15409b){return _0x2604ca[_0x194c('0x1e')](_0x2962de)['json'](_0x15409b);}};}function respondWithFilteredResult(_0x1b5345,_0x1536aa){return function(_0x263859){if(_0x263859){var _0x457062=_0x263859[_0x194c('0x20')],_0x2aac5a=_0x1536aa['offset'],_0x2f20bf=_0x1536aa[_0x194c('0x21')]+_0x1536aa[_0x194c('0x22')],_0x1d8674;if(_0x2f20bf>=_0x457062){_0x2f20bf=_0x457062;_0x1d8674=0xc8;}else{_0x1d8674=0xce;}_0x1b5345[_0x194c('0x1e')](_0x1d8674);return _0x1b5345[_0x194c('0x23')]('Content-Range',_0x2aac5a+'-'+_0x2f20bf+'/'+_0x457062)[_0x194c('0x24')](_0x263859);}return null;};}function patchUpdates(_0x2678ad){return function(_0x25702f){try{jsonpatch[_0x194c('0x25')](_0x25702f,_0x2678ad,!![]);}catch(_0x46e631){return BPromise[_0x194c('0x26')](_0x46e631);}return _0x25702f[_0x194c('0x27')]();};}function saveUpdates(_0x521419,_0x35024e){return function(_0x41f6bd){if(_0x41f6bd){return _0x41f6bd[_0x194c('0x28')](_0x521419)[_0x194c('0x29')](function(_0x5a656a){return _0x5a656a;});}return null;};}function removeEntity(_0x10adae,_0x54e39d){return function(_0x3e06b4){if(_0x3e06b4){return _0x3e06b4[_0x194c('0x2a')]()[_0x194c('0x29')](function(){var _0x5a538e=_0x3e06b4[_0x194c('0x2b')]({'plain':!![]});var _0x3f1abf=_0x194c('0x2c');return db['UserProfileResource'][_0x194c('0x2a')]({'where':{'type':_0x3f1abf,'resourceId':_0x5a538e['id']}})[_0x194c('0x29')](function(){return _0x3e06b4;});})[_0x194c('0x29')](function(){_0x10adae[_0x194c('0x1e')](0xcc)[_0x194c('0x1f')]();});}};}function handleEntityNotFound(_0x1f9e29,_0x2d11f9){return function(_0x219415){if(!_0x219415){_0x1f9e29[_0x194c('0x1d')](0x194);}return _0x219415;};}function handleError(_0x54513e,_0x403fec){_0x403fec=_0x403fec||0x1f4;return function(_0x275000){logger[_0x194c('0x2d')](_0x275000[_0x194c('0x2e')]);if(_0x275000[_0x194c('0x2f')]){delete _0x275000['name'];}_0x54513e[_0x194c('0x1e')](_0x403fec)[_0x194c('0x30')](_0x275000);};}exports[_0x194c('0x31')]=function(_0x3f2f92,_0x176dba){var _0xb65a8d={},_0x93cd6={},_0x19deed={'count':0x0,'rows':[]};var _0x54c578=db['Dashboard'][_0x194c('0x32')];_0x93cd6[_0x194c('0x33')]=_['keys'](_0x54c578);_0x93cd6['query']=_['keys'](_0x3f2f92['query']);_0x93cd6[_0x194c('0x34')]=_[_0x194c('0x35')](_0x93cd6[_0x194c('0x33')],_0x93cd6['query']);_0xb65a8d[_0x194c('0x36')]=_[_0x194c('0x35')](_0x93cd6[_0x194c('0x33')],qs[_0x194c('0x37')](_0x3f2f92[_0x194c('0x38')]['fields']));_0xb65a8d[_0x194c('0x36')]=_0xb65a8d[_0x194c('0x36')]['length']?_0xb65a8d[_0x194c('0x36')]:_0x93cd6['model'];if(!_0x3f2f92[_0x194c('0x38')][_0x194c('0x39')](_0x194c('0x3a'))){_0xb65a8d[_0x194c('0x22')]=qs[_0x194c('0x22')](_0x3f2f92[_0x194c('0x38')]['limit']);_0xb65a8d[_0x194c('0x21')]=qs[_0x194c('0x21')](_0x3f2f92[_0x194c('0x38')][_0x194c('0x21')]);}_0xb65a8d[_0x194c('0x3b')]=qs[_0x194c('0x3c')](_0x3f2f92['query'][_0x194c('0x3c')]);_0xb65a8d[_0x194c('0x3d')]=qs[_0x194c('0x34')](_[_0x194c('0x3e')](_0x3f2f92[_0x194c('0x38')],_0x93cd6[_0x194c('0x34')]));if(_0x3f2f92[_0x194c('0x38')]['filter']){_0xb65a8d[_0x194c('0x3d')]=_[_0x194c('0x3f')](_0xb65a8d[_0x194c('0x3d')],{'$or':_[_0x194c('0x40')](_0x54c578,function(_0x5a3eb9){if(_0x5a3eb9[_0x194c('0x41')][_0x194c('0x42')]!==_0x194c('0x43')){var _0xc041f3={};_0xc041f3[_0x5a3eb9['field']]={'$like':'%'+_0x3f2f92[_0x194c('0x38')][_0x194c('0x44')]+'%'};return _0xc041f3;}})});}_0xb65a8d=_['merge']({},_0xb65a8d,_0x3f2f92[_0x194c('0x45')]);var _0x2d9d0f={'where':_0xb65a8d['where']};return db['Dashboard']['count'](_0x2d9d0f)[_0x194c('0x29')](function(_0x3dab03){_0x19deed[_0x194c('0x20')]=_0x3dab03;if(_0x3f2f92['query'][_0x194c('0x46')]){_0xb65a8d[_0x194c('0x47')]=[{'all':!![]}];}return db[_0x194c('0x48')]['findAll'](_0xb65a8d);})[_0x194c('0x29')](function(_0x47868e){_0x19deed[_0x194c('0x49')]=_0x47868e;return _0x19deed;})[_0x194c('0x29')](respondWithFilteredResult(_0x176dba,_0xb65a8d))[_0x194c('0x4a')](handleError(_0x176dba,null));};exports[_0x194c('0x4b')]=function(_0xbf136c,_0x2169f2){var _0x4c1521={'raw':![],'where':{'id':_0xbf136c[_0x194c('0x4c')]['id']}},_0x458806={};_0x458806[_0x194c('0x33')]=_['keys'](db[_0x194c('0x48')][_0x194c('0x32')]);_0x458806[_0x194c('0x38')]=_[_0x194c('0x4d')](_0xbf136c[_0x194c('0x38')]);_0x458806[_0x194c('0x34')]=_['intersection'](_0x458806['model'],_0x458806['query']);_0x4c1521[_0x194c('0x36')]=_['intersection'](_0x458806[_0x194c('0x33')],qs[_0x194c('0x37')](_0xbf136c[_0x194c('0x38')][_0x194c('0x37')]));_0x4c1521[_0x194c('0x36')]=_0x4c1521[_0x194c('0x36')][_0x194c('0x4e')]?_0x4c1521[_0x194c('0x36')]:_0x458806[_0x194c('0x33')];if(_0xbf136c[_0x194c('0x38')][_0x194c('0x46')]){_0x4c1521['include']=[{'all':!![]}];}_0x4c1521=_['merge']({},_0x4c1521,_0xbf136c[_0x194c('0x45')]);return db[_0x194c('0x48')][_0x194c('0x4f')](_0x4c1521)[_0x194c('0x29')](handleEntityNotFound(_0x2169f2,null))['then'](respondWithResult(_0x2169f2,null))[_0x194c('0x4a')](handleError(_0x2169f2,null));};exports[_0x194c('0x50')]=function(_0x1ef40c,_0x5803ef){return db[_0x194c('0x48')][_0x194c('0x50')](_0x1ef40c[_0x194c('0x51')],{})[_0x194c('0x29')](function(_0xe12a47){var _0x2b5f50=_0x1ef40c[_0x194c('0x52')][_0x194c('0x2b')]({'plain':!![]});if(!_0x2b5f50)throw new Error(_0x194c('0x53'));if(_0x2b5f50['role']===_0x194c('0x52')){var _0x31e739=_0xe12a47[_0x194c('0x2b')]({'plain':!![]});var _0x382047=_0x194c('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0x382047,'userProfileId':_0x2b5f50[_0x194c('0x54')]},'raw':!![]})['then'](function(_0x3605ec){if(_0x3605ec&&_0x3605ec[_0x194c('0x55')]===0x0){return db['UserProfileResource'][_0x194c('0x50')]({'name':_0x31e739[_0x194c('0x2f')],'resourceId':_0x31e739['id'],'type':_0x3605ec[_0x194c('0x2f')],'sectionId':_0x3605ec['id']},{})['then'](function(){return _0xe12a47;});}else{return _0xe12a47;}})['catch'](function(_0xc20f74){logger[_0x194c('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc20f74);throw _0xc20f74;});}return _0xe12a47;})['then'](respondWithResult(_0x5803ef,0xc9))[_0x194c('0x4a')](handleError(_0x5803ef,null));};exports[_0x194c('0x56')]=function(_0x492333,_0x205d87){var _0x3a383d={'raw':![],'where':{'id':_0x492333[_0x194c('0x4c')]['id']}},_0x3e3f1f={};_0x3e3f1f[_0x194c('0x33')]=_[_0x194c('0x4d')](db['Dashboard'][_0x194c('0x32')]);_0x3a383d[_0x194c('0x36')]=_[_0x194c('0x35')](_0x3e3f1f[_0x194c('0x33')],qs['fields'](_0x492333[_0x194c('0x38')][_0x194c('0x37')]));_0x3a383d[_0x194c('0x36')]=_0x3a383d[_0x194c('0x36')]['length']?_0x3a383d[_0x194c('0x36')]:_0x3e3f1f['model'];if(_0x492333['query'][_0x194c('0x46')]){_0x3a383d[_0x194c('0x47')]=[{'all':!![]}];}_0x3a383d=_[_0x194c('0x3f')]({},_0x3a383d,_0x492333[_0x194c('0x45')]);return db[_0x194c('0x48')]['find'](_0x3a383d)['then'](handleEntityNotFound(_0x205d87,null))[_0x194c('0x29')](function(_0x4f36a5){if(_0x4f36a5){var _0x341b80=_0x4f36a5[_0x194c('0x2b')]({'plain':!![]});_0x341b80=qs[_0x194c('0x57')](_0x341b80,['id',_0x194c('0x58'),_0x194c('0x59')]);_0x492333[_0x194c('0x51')]=_[_0x194c('0x57')](_0x492333[_0x194c('0x51')],['id',_0x194c('0x58'),_0x194c('0x59')]);return db[_0x194c('0x48')][_0x194c('0x50')](_['merge'](_0x341b80,_0x492333['body']),{'include':_0x492333['query'][_0x194c('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x34673a){var _0xaf2e4c=_0x492333[_0x194c('0x52')][_0x194c('0x2b')]({'plain':!![]});if(!_0xaf2e4c)throw new Error(_0x194c('0x53'));if(_0xaf2e4c[_0x194c('0x5a')]===_0x194c('0x52')){var _0x3df78d=_0x34673a[_0x194c('0x2b')]({'plain':!![]});var _0xbab84='CustomDashboards';return db[_0x194c('0x5b')][_0x194c('0x4f')]({'where':{'name':_0xbab84,'userProfileId':_0xaf2e4c[_0x194c('0x54')]},'raw':!![]})[_0x194c('0x29')](function(_0x314c2d){if(_0x314c2d&&_0x314c2d[_0x194c('0x55')]===0x0){return db[_0x194c('0x5c')][_0x194c('0x50')]({'name':_0x3df78d[_0x194c('0x2f')],'resourceId':_0x3df78d['id'],'type':_0x314c2d[_0x194c('0x2f')],'sectionId':_0x314c2d['id']},{})['then'](function(){return _0x34673a;});}else{return _0x34673a;}})[_0x194c('0x4a')](function(_0xa8e290){logger[_0x194c('0x2d')](_0x194c('0x5d'),_0xa8e290);throw _0xa8e290;});}return _0x34673a;});}})['then'](respondWithResult(_0x205d87,0xc9))[_0x194c('0x4a')](handleError(_0x205d87,null));};exports[_0x194c('0x28')]=function(_0x540304,_0x318efd){if(_0x540304[_0x194c('0x51')]['id']){delete _0x540304[_0x194c('0x51')]['id'];}return db[_0x194c('0x48')][_0x194c('0x4f')]({'where':{'id':_0x540304['params']['id']}})[_0x194c('0x29')](handleEntityNotFound(_0x318efd,null))[_0x194c('0x29')](saveUpdates(_0x540304['body'],null))[_0x194c('0x29')](respondWithResult(_0x318efd,null))[_0x194c('0x4a')](handleError(_0x318efd,null));};exports['destroy']=function(_0x1dd05c,_0x4776ab){return db['Dashboard']['find']({'where':{'id':_0x1dd05c[_0x194c('0x4c')]['id']}})[_0x194c('0x29')](handleEntityNotFound(_0x4776ab,null))[_0x194c('0x29')](removeEntity(_0x4776ab,null))['catch'](handleError(_0x4776ab,null));};function widgetAttributes(_0x5bf194){try{switch(_0x5bf194[_0x194c('0x41')]){case'iframe':return[{'name':'attrUrl','value':_0x5bf194['attrUrl']||(_0x5bf194[_0x194c('0x5e')]&&_0x5bf194[_0x194c('0x5e')][0x0]?_0x5bf194[_0x194c('0x5e')][0x0][_0x194c('0x5f')]:undefined)||_0x194c('0x60')}];case _0x194c('0x61'):return[{'name':'attrPath','value':_0x5bf194[_0x194c('0x62')]||(_0x5bf194[_0x194c('0x5e')]&&_0x5bf194['attrs'][0x0]?_0x5bf194[_0x194c('0x5e')][0x0][_0x194c('0x5f')]:undefined)||''}];case'clock':return[{'name':_0x194c('0x63'),'value':_0x5bf194[_0x194c('0x63')]||(_0x5bf194[_0x194c('0x5e')]&&_0x5bf194[_0x194c('0x5e')][0x0]?_0x5bf194[_0x194c('0x5e')][0x0][_0x194c('0x5f')]:undefined)||_0x194c('0x64')},{'name':'attrTimezone','value':_0x5bf194[_0x194c('0x65')]||(_0x5bf194[_0x194c('0x5e')]&&_0x5bf194['attrs'][0x1]?_0x5bf194[_0x194c('0x5e')][0x1][_0x194c('0x5f')]:undefined)||_0x194c('0x66')},{'name':_0x194c('0x67'),'value':_0x5bf194[_0x194c('0x67')]||(_0x5bf194['attrs']&&_0x5bf194['attrs'][0x2]?_0x5bf194[_0x194c('0x5e')][0x2][_0x194c('0x5f')]:undefined)||0xc}];case _0x194c('0x68'):return[{'name':'attrMetric','value':_0x5bf194['attrMetric']||(_0x5bf194['attrs']&&_0x5bf194['attrs'][0x0]?_0x5bf194[_0x194c('0x5e')][0x0][_0x194c('0x5f')]:undefined)||_0x194c('0x69')},{'name':'attrVoiceQueues','value':_0x5bf194[_0x194c('0x6a')]||(_0x5bf194['attrs']&&_0x5bf194[_0x194c('0x5e')][0x1]?_0x5bf194[_0x194c('0x5e')][0x1][_0x194c('0x5f')]:undefined)||[]},{'name':'attrFontSize','value':_0x5bf194[_0x194c('0x67')]||(_0x5bf194['attrs']&&_0x5bf194[_0x194c('0x5e')][0x2]?_0x5bf194[_0x194c('0x5e')][0x2][_0x194c('0x5f')]:undefined)||0x14}];case _0x194c('0x6b'):case'pie-chart':return[{'name':_0x194c('0x6c'),'value':_0x5bf194[_0x194c('0x6c')]||(_0x5bf194['attrs']&&_0x5bf194[_0x194c('0x5e')][0x0]?_0x5bf194[_0x194c('0x5e')][0x0][_0x194c('0x5f')]:undefined)||_0x194c('0x69')},{'name':_0x194c('0x6d'),'value':_0x5bf194[_0x194c('0x6d')]||(_0x5bf194[_0x194c('0x5e')]&&_0x5bf194[_0x194c('0x5e')][0x1]?_0x5bf194[_0x194c('0x5e')][0x1][_0x194c('0x5f')]:undefined)||null},{'name':_0x194c('0x6e'),'value':_0x5bf194['attrSerie3']||(_0x5bf194[_0x194c('0x5e')]&&_0x5bf194[_0x194c('0x5e')][0x2]?_0x5bf194[_0x194c('0x5e')][0x2][_0x194c('0x5f')]:undefined)||null},{'name':_0x194c('0x6a'),'value':_0x5bf194['attrVoiceQueues']||(_0x5bf194[_0x194c('0x5e')]&&_0x5bf194[_0x194c('0x5e')][0x3]?_0x5bf194[_0x194c('0x5e')][0x3][_0x194c('0x5f')]:undefined)||[]}];case _0x194c('0x6f'):return[{'name':_0x194c('0x70'),'type':_0x5bf194[_0x194c('0x71')]||(_0x5bf194[_0x194c('0x5e')]&&_0x5bf194['attrs'][0x0]?_0x5bf194[_0x194c('0x5e')][0x0][_0x194c('0x41')]:undefined)||null,'value':_0x5bf194[_0x194c('0x70')]||(_0x5bf194[_0x194c('0x5e')]&&_0x5bf194['attrs'][0x0]?_0x5bf194['attrs'][0x0][_0x194c('0x5f')]:undefined)||null},{'name':_0x194c('0x72'),'value':_0x5bf194[_0x194c('0x72')]||(_0x5bf194[_0x194c('0x5e')]&&_0x5bf194[_0x194c('0x5e')][0x1]?_0x5bf194[_0x194c('0x5e')][0x1][_0x194c('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x4bcf7d){logger[_0x194c('0x2d')]('widgetAttributes:\x20%s',JSON['stringify'](_0x4bcf7d));return[];}}exports['addItem']=function(_0x1db7c2,_0x5b63cf,_0x42b059){if(_0x1db7c2['body']['id']){delete _0x1db7c2[_0x194c('0x51')]['id'];}return db[_0x194c('0x48')]['find']({'where':{'id':_0x1db7c2[_0x194c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5b63cf,null))[_0x194c('0x29')](function(_0x20394f){if(_0x20394f){_0x1db7c2[_0x194c('0x51')][_0x194c('0x73')]=_0x20394f['id'];_0x1db7c2[_0x194c('0x51')][_0x194c('0x5e')]=widgetAttributes(_0x1db7c2[_0x194c('0x51')]);return db[_0x194c('0x74')][_0x194c('0x50')](_0x1db7c2[_0x194c('0x51')]);}})[_0x194c('0x29')](respondWithResult(_0x5b63cf,null))[_0x194c('0x4a')](handleError(_0x5b63cf,null));};exports[_0x194c('0x75')]=function(_0x1209e6,_0x3e66d1,_0x3d44b6){var _0x424858={};var _0x44704a={};var _0x2dbcaa;var _0xe798c1;return db[_0x194c('0x48')][_0x194c('0x76')]({'where':{'id':_0x1209e6[_0x194c('0x4c')]['id']}})[_0x194c('0x29')](handleEntityNotFound(_0x3e66d1,null))[_0x194c('0x29')](function(_0x31b165){if(_0x31b165){_0x2dbcaa=_0x31b165;_0x44704a[_0x194c('0x33')]=_['keys'](db[_0x194c('0x74')][_0x194c('0x32')]);_0x44704a[_0x194c('0x38')]=_['keys'](_0x1209e6['query']);_0x44704a[_0x194c('0x34')]=_[_0x194c('0x35')](_0x44704a[_0x194c('0x33')],_0x44704a[_0x194c('0x38')]);_0x424858[_0x194c('0x36')]=_[_0x194c('0x35')](_0x44704a[_0x194c('0x33')],qs[_0x194c('0x37')](_0x1209e6[_0x194c('0x38')][_0x194c('0x37')]));_0x424858[_0x194c('0x36')]=_0x424858[_0x194c('0x36')]['length']?_0x424858[_0x194c('0x36')]:_0x44704a['model'];_0x424858['order']=qs['sort'](_0x1209e6['query'][_0x194c('0x3c')]);_0x424858[_0x194c('0x3d')]=qs['filters'](_[_0x194c('0x3e')](_0x1209e6['query'],_0x44704a[_0x194c('0x34')]));if(_0x1209e6['query'][_0x194c('0x44')]){_0x424858[_0x194c('0x3d')]=_[_0x194c('0x3f')](_0x424858[_0x194c('0x3d')],{'$or':_[_0x194c('0x40')](_0x424858['attributes'],function(_0x49c20d){var _0x111c8e={};_0x111c8e[_0x49c20d]={'$like':'%'+_0x1209e6['query'][_0x194c('0x44')]+'%'};return _0x111c8e;})});}_0x424858=_[_0x194c('0x3f')]({},_0x424858,_0x1209e6[_0x194c('0x45')]);return _0x2dbcaa[_0x194c('0x75')](_0x424858);}})[_0x194c('0x29')](function(_0x1e786e){if(_0x1e786e){_0xe798c1=_0x1e786e['length'];if(!_0x1209e6[_0x194c('0x38')][_0x194c('0x39')](_0x194c('0x3a'))){_0x424858[_0x194c('0x22')]=qs[_0x194c('0x22')](_0x1209e6[_0x194c('0x38')][_0x194c('0x22')]);_0x424858[_0x194c('0x21')]=qs['offset'](_0x1209e6[_0x194c('0x38')]['offset']);}return _0x2dbcaa[_0x194c('0x75')](_0x424858);}})[_0x194c('0x29')](function(_0x483eee){if(_0x483eee){return _0x483eee?{'count':_0xe798c1,'rows':_0x483eee}:null;}})[_0x194c('0x29')](respondWithResult(_0x3e66d1,null))[_0x194c('0x4a')](handleError(_0x3e66d1,null));}; \ No newline at end of file +var _0xfa39=['where','pick','filter','merge','map','type','options','findAll','rows','catch','params','includeAll','include','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardItem','getItems','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','end','sendStatus','error','name','send','index','Dashboard','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xfa39,0x197));var _0x9fa3=function(_0x25f797,_0x449916){_0x25f797=_0x25f797-0x0;var _0x157fdd=_0xfa39[_0x25f797];return _0x157fdd;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9fa3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9fa3('0x1'));var rp=require(_0x9fa3('0x2'));var moment=require(_0x9fa3('0x3'));var BPromise=require(_0x9fa3('0x4'));var Mustache=require(_0x9fa3('0x5'));var util=require(_0x9fa3('0x6'));var path=require(_0x9fa3('0x7'));var sox=require(_0x9fa3('0x8'));var csv=require(_0x9fa3('0x9'));var ejs=require(_0x9fa3('0xa'));var fs=require('fs');var _=require(_0x9fa3('0xb'));var squel=require(_0x9fa3('0xc'));var crypto=require(_0x9fa3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9fa3('0xe'));var toCsv=require(_0x9fa3('0x9'));var querystring=require('querystring');var Papa=require(_0x9fa3('0xf'));var Redis=require(_0x9fa3('0x10'));var authService=require(_0x9fa3('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x9fa3('0x12'));var logger=require(_0x9fa3('0x13'))(_0x9fa3('0x14'));var utils=require(_0x9fa3('0x15'));var config=require(_0x9fa3('0x16'));var db=require(_0x9fa3('0x17'))['db'];config[_0x9fa3('0x18')]=_[_0x9fa3('0x19')](config[_0x9fa3('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x9fa3('0x1a'))(new Redis(config[_0x9fa3('0x18')]));require(_0x9fa3('0x1b'))[_0x9fa3('0x1c')](socket);function respondWithStatusCode(_0x4159cf,_0x3b2e11){_0x3b2e11=_0x3b2e11||0xcc;return function(_0x51cdfd){if(_0x51cdfd){return _0x4159cf['sendStatus'](_0x3b2e11);}return _0x4159cf[_0x9fa3('0x1d')](_0x3b2e11)['end']();};}function respondWithResult(_0x47f54a,_0x105bf8){_0x105bf8=_0x105bf8||0xc8;return function(_0x193f47){if(_0x193f47){return _0x47f54a[_0x9fa3('0x1d')](_0x105bf8)['json'](_0x193f47);}};}function respondWithFilteredResult(_0x336f01,_0x295ff1){return function(_0x1e8223){if(_0x1e8223){var _0x46ca22=_0x1e8223[_0x9fa3('0x1e')],_0x23aa6f=_0x295ff1[_0x9fa3('0x1f')],_0x69420f=_0x295ff1[_0x9fa3('0x1f')]+_0x295ff1[_0x9fa3('0x20')],_0x500710;if(_0x69420f>=_0x46ca22){_0x69420f=_0x46ca22;_0x500710=0xc8;}else{_0x500710=0xce;}_0x336f01[_0x9fa3('0x1d')](_0x500710);return _0x336f01[_0x9fa3('0x21')](_0x9fa3('0x22'),_0x23aa6f+'-'+_0x69420f+'/'+_0x46ca22)[_0x9fa3('0x23')](_0x1e8223);}return null;};}function patchUpdates(_0x2fa6dd){return function(_0xb88c7b){try{jsonpatch[_0x9fa3('0x24')](_0xb88c7b,_0x2fa6dd,!![]);}catch(_0x39a1fb){return BPromise[_0x9fa3('0x25')](_0x39a1fb);}return _0xb88c7b[_0x9fa3('0x26')]();};}function saveUpdates(_0x4075e2,_0x53a6e2){return function(_0x4f5af5){if(_0x4f5af5){return _0x4f5af5[_0x9fa3('0x27')](_0x4075e2)[_0x9fa3('0x28')](function(_0x494430){return _0x494430;});}return null;};}function removeEntity(_0x4594b7,_0x1a4148){return function(_0x3b1b1a){if(_0x3b1b1a){return _0x3b1b1a[_0x9fa3('0x29')]()[_0x9fa3('0x28')](function(){var _0x2ff788=_0x3b1b1a[_0x9fa3('0x2a')]({'plain':!![]});var _0x573cb0=_0x9fa3('0x2b');return db[_0x9fa3('0x2c')][_0x9fa3('0x29')]({'where':{'type':_0x573cb0,'resourceId':_0x2ff788['id']}})['then'](function(){return _0x3b1b1a;});})[_0x9fa3('0x28')](function(){_0x4594b7[_0x9fa3('0x1d')](0xcc)[_0x9fa3('0x2d')]();});}};}function handleEntityNotFound(_0x9f04b,_0x333544){return function(_0x3ea86d){if(!_0x3ea86d){_0x9f04b[_0x9fa3('0x2e')](0x194);}return _0x3ea86d;};}function handleError(_0x177428,_0x13c1b4){_0x13c1b4=_0x13c1b4||0x1f4;return function(_0x15d70c){logger[_0x9fa3('0x2f')](_0x15d70c['stack']);if(_0x15d70c[_0x9fa3('0x30')]){delete _0x15d70c['name'];}_0x177428[_0x9fa3('0x1d')](_0x13c1b4)[_0x9fa3('0x31')](_0x15d70c);};}exports[_0x9fa3('0x32')]=function(_0x5f17d3,_0x21ec26){var _0x54b546={},_0x541974={},_0x2efd46={'count':0x0,'rows':[]};var _0x1a7315=db[_0x9fa3('0x33')][_0x9fa3('0x34')];_0x541974['model']=_[_0x9fa3('0x35')](_0x1a7315);_0x541974[_0x9fa3('0x36')]=_[_0x9fa3('0x35')](_0x5f17d3['query']);_0x541974[_0x9fa3('0x37')]=_[_0x9fa3('0x38')](_0x541974[_0x9fa3('0x39')],_0x541974[_0x9fa3('0x36')]);_0x54b546[_0x9fa3('0x3a')]=_[_0x9fa3('0x38')](_0x541974[_0x9fa3('0x39')],qs[_0x9fa3('0x3b')](_0x5f17d3[_0x9fa3('0x36')][_0x9fa3('0x3b')]));_0x54b546[_0x9fa3('0x3a')]=_0x54b546[_0x9fa3('0x3a')][_0x9fa3('0x3c')]?_0x54b546[_0x9fa3('0x3a')]:_0x541974[_0x9fa3('0x39')];if(!_0x5f17d3['query'][_0x9fa3('0x3d')](_0x9fa3('0x3e'))){_0x54b546[_0x9fa3('0x20')]=qs[_0x9fa3('0x20')](_0x5f17d3['query']['limit']);_0x54b546['offset']=qs[_0x9fa3('0x1f')](_0x5f17d3[_0x9fa3('0x36')][_0x9fa3('0x1f')]);}_0x54b546[_0x9fa3('0x3f')]=qs[_0x9fa3('0x40')](_0x5f17d3['query'][_0x9fa3('0x40')]);_0x54b546[_0x9fa3('0x41')]=qs[_0x9fa3('0x37')](_[_0x9fa3('0x42')](_0x5f17d3[_0x9fa3('0x36')],_0x541974[_0x9fa3('0x37')]));if(_0x5f17d3[_0x9fa3('0x36')][_0x9fa3('0x43')]){_0x54b546[_0x9fa3('0x41')]=_[_0x9fa3('0x44')](_0x54b546[_0x9fa3('0x41')],{'$or':_[_0x9fa3('0x45')](_0x1a7315,function(_0x4a7ae2){if(_0x4a7ae2[_0x9fa3('0x46')]['key']!=='VIRTUAL'){var _0x1f8ee4={};_0x1f8ee4[_0x4a7ae2['field']]={'$like':'%'+_0x5f17d3[_0x9fa3('0x36')]['filter']+'%'};return _0x1f8ee4;}})});}_0x54b546=_['merge']({},_0x54b546,_0x5f17d3[_0x9fa3('0x47')]);var _0x21585c={'where':_0x54b546[_0x9fa3('0x41')]};return db[_0x9fa3('0x33')][_0x9fa3('0x1e')](_0x21585c)[_0x9fa3('0x28')](function(_0x599e79){_0x2efd46['count']=_0x599e79;if(_0x5f17d3[_0x9fa3('0x36')]['includeAll']){_0x54b546['include']=[{'all':!![]}];}return db[_0x9fa3('0x33')][_0x9fa3('0x48')](_0x54b546);})[_0x9fa3('0x28')](function(_0x3daca4){_0x2efd46[_0x9fa3('0x49')]=_0x3daca4;return _0x2efd46;})[_0x9fa3('0x28')](respondWithFilteredResult(_0x21ec26,_0x54b546))[_0x9fa3('0x4a')](handleError(_0x21ec26,null));};exports['show']=function(_0x5002c2,_0x563049){var _0x1e36cb={'raw':![],'where':{'id':_0x5002c2[_0x9fa3('0x4b')]['id']}},_0x3d47aa={};_0x3d47aa[_0x9fa3('0x39')]=_[_0x9fa3('0x35')](db[_0x9fa3('0x33')]['rawAttributes']);_0x3d47aa['query']=_['keys'](_0x5002c2[_0x9fa3('0x36')]);_0x3d47aa[_0x9fa3('0x37')]=_[_0x9fa3('0x38')](_0x3d47aa[_0x9fa3('0x39')],_0x3d47aa[_0x9fa3('0x36')]);_0x1e36cb[_0x9fa3('0x3a')]=_[_0x9fa3('0x38')](_0x3d47aa[_0x9fa3('0x39')],qs[_0x9fa3('0x3b')](_0x5002c2[_0x9fa3('0x36')][_0x9fa3('0x3b')]));_0x1e36cb[_0x9fa3('0x3a')]=_0x1e36cb[_0x9fa3('0x3a')]['length']?_0x1e36cb['attributes']:_0x3d47aa[_0x9fa3('0x39')];if(_0x5002c2['query'][_0x9fa3('0x4c')]){_0x1e36cb[_0x9fa3('0x4d')]=[{'all':!![]}];}_0x1e36cb=_[_0x9fa3('0x44')]({},_0x1e36cb,_0x5002c2['options']);return db[_0x9fa3('0x33')]['find'](_0x1e36cb)[_0x9fa3('0x28')](handleEntityNotFound(_0x563049,null))['then'](respondWithResult(_0x563049,null))[_0x9fa3('0x4a')](handleError(_0x563049,null));};exports['create']=function(_0x226c6e,_0x2ccee6){return db[_0x9fa3('0x33')][_0x9fa3('0x4e')](_0x226c6e[_0x9fa3('0x4f')],{})[_0x9fa3('0x28')](function(_0x3b7bf6){var _0x1f4ae8=_0x226c6e[_0x9fa3('0x50')][_0x9fa3('0x2a')]({'plain':!![]});if(!_0x1f4ae8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f4ae8[_0x9fa3('0x51')]===_0x9fa3('0x50')){var _0x155b25=_0x3b7bf6['get']({'plain':!![]});var _0x585a80='CustomDashboards';return db[_0x9fa3('0x52')][_0x9fa3('0x53')]({'where':{'name':_0x585a80,'userProfileId':_0x1f4ae8[_0x9fa3('0x54')]},'raw':!![]})['then'](function(_0x4ec6da){if(_0x4ec6da&&_0x4ec6da[_0x9fa3('0x55')]===0x0){return db[_0x9fa3('0x2c')][_0x9fa3('0x4e')]({'name':_0x155b25[_0x9fa3('0x30')],'resourceId':_0x155b25['id'],'type':_0x4ec6da[_0x9fa3('0x30')],'sectionId':_0x4ec6da['id']},{})[_0x9fa3('0x28')](function(){return _0x3b7bf6;});}else{return _0x3b7bf6;}})[_0x9fa3('0x4a')](function(_0x2159fc){logger[_0x9fa3('0x2f')](_0x9fa3('0x56'),_0x2159fc);throw _0x2159fc;});}return _0x3b7bf6;})['then'](respondWithResult(_0x2ccee6,0xc9))[_0x9fa3('0x4a')](handleError(_0x2ccee6,null));};exports['clone']=function(_0x125307,_0x4113da){var _0x3550cb={'raw':![],'where':{'id':_0x125307['params']['id']}},_0x173992={};_0x173992[_0x9fa3('0x39')]=_[_0x9fa3('0x35')](db[_0x9fa3('0x33')][_0x9fa3('0x34')]);_0x3550cb[_0x9fa3('0x3a')]=_[_0x9fa3('0x38')](_0x173992[_0x9fa3('0x39')],qs[_0x9fa3('0x3b')](_0x125307[_0x9fa3('0x36')]['fields']));_0x3550cb[_0x9fa3('0x3a')]=_0x3550cb[_0x9fa3('0x3a')]['length']?_0x3550cb[_0x9fa3('0x3a')]:_0x173992[_0x9fa3('0x39')];if(_0x125307['query'][_0x9fa3('0x4c')]){_0x3550cb[_0x9fa3('0x4d')]=[{'all':!![]}];}_0x3550cb=_['merge']({},_0x3550cb,_0x125307[_0x9fa3('0x47')]);return db['Dashboard'][_0x9fa3('0x53')](_0x3550cb)['then'](handleEntityNotFound(_0x4113da,null))[_0x9fa3('0x28')](function(_0x2be86b){if(_0x2be86b){var _0x1ab51e=_0x2be86b[_0x9fa3('0x2a')]({'plain':!![]});_0x1ab51e=qs[_0x9fa3('0x57')](_0x1ab51e,['id',_0x9fa3('0x58'),_0x9fa3('0x59')]);_0x125307[_0x9fa3('0x4f')]=_['omit'](_0x125307['body'],['id',_0x9fa3('0x58'),_0x9fa3('0x59')]);return db[_0x9fa3('0x33')][_0x9fa3('0x4e')](_[_0x9fa3('0x44')](_0x1ab51e,_0x125307[_0x9fa3('0x4f')]),{'include':_0x125307[_0x9fa3('0x36')][_0x9fa3('0x4c')]?[{'all':!![]}]:undefined})[_0x9fa3('0x28')](function(_0x206428){var _0x52a992=_0x125307[_0x9fa3('0x50')][_0x9fa3('0x2a')]({'plain':!![]});if(!_0x52a992)throw new Error(_0x9fa3('0x5a'));if(_0x52a992[_0x9fa3('0x51')]===_0x9fa3('0x50')){var _0x3182a2=_0x206428[_0x9fa3('0x2a')]({'plain':!![]});var _0x4dd498=_0x9fa3('0x2b');return db[_0x9fa3('0x52')][_0x9fa3('0x53')]({'where':{'name':_0x4dd498,'userProfileId':_0x52a992[_0x9fa3('0x54')]},'raw':!![]})[_0x9fa3('0x28')](function(_0x50fcbe){if(_0x50fcbe&&_0x50fcbe[_0x9fa3('0x55')]===0x0){return db[_0x9fa3('0x2c')][_0x9fa3('0x4e')]({'name':_0x3182a2[_0x9fa3('0x30')],'resourceId':_0x3182a2['id'],'type':_0x50fcbe[_0x9fa3('0x30')],'sectionId':_0x50fcbe['id']},{})['then'](function(){return _0x206428;});}else{return _0x206428;}})[_0x9fa3('0x4a')](function(_0x1a2e1f){logger[_0x9fa3('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a2e1f);throw _0x1a2e1f;});}return _0x206428;});}})[_0x9fa3('0x28')](respondWithResult(_0x4113da,0xc9))[_0x9fa3('0x4a')](handleError(_0x4113da,null));};exports[_0x9fa3('0x27')]=function(_0x8dd75c,_0x199a76){if(_0x8dd75c[_0x9fa3('0x4f')]['id']){delete _0x8dd75c[_0x9fa3('0x4f')]['id'];}return db[_0x9fa3('0x33')][_0x9fa3('0x53')]({'where':{'id':_0x8dd75c[_0x9fa3('0x4b')]['id']}})[_0x9fa3('0x28')](handleEntityNotFound(_0x199a76,null))[_0x9fa3('0x28')](saveUpdates(_0x8dd75c['body'],null))[_0x9fa3('0x28')](respondWithResult(_0x199a76,null))['catch'](handleError(_0x199a76,null));};exports[_0x9fa3('0x29')]=function(_0x49ec6d,_0x54b593){return db[_0x9fa3('0x33')]['find']({'where':{'id':_0x49ec6d[_0x9fa3('0x4b')]['id']}})[_0x9fa3('0x28')](handleEntityNotFound(_0x54b593,null))[_0x9fa3('0x28')](removeEntity(_0x54b593,null))[_0x9fa3('0x4a')](handleError(_0x54b593,null));};function widgetAttributes(_0x3cc339){try{switch(_0x3cc339[_0x9fa3('0x46')]){case _0x9fa3('0x5b'):return[{'name':_0x9fa3('0x5c'),'value':_0x3cc339['attrUrl']||(_0x3cc339['attrs']&&_0x3cc339[_0x9fa3('0x5d')][0x0]?_0x3cc339[_0x9fa3('0x5d')][0x0][_0x9fa3('0x5e')]:undefined)||_0x9fa3('0x5f')}];case _0x9fa3('0x60'):return[{'name':_0x9fa3('0x61'),'value':_0x3cc339[_0x9fa3('0x61')]||(_0x3cc339[_0x9fa3('0x5d')]&&_0x3cc339[_0x9fa3('0x5d')][0x0]?_0x3cc339[_0x9fa3('0x5d')][0x0]['value']:undefined)||''}];case _0x9fa3('0x62'):return[{'name':_0x9fa3('0x63'),'value':_0x3cc339['attrHourFormat']||(_0x3cc339[_0x9fa3('0x5d')]&&_0x3cc339[_0x9fa3('0x5d')][0x0]?_0x3cc339[_0x9fa3('0x5d')][0x0][_0x9fa3('0x5e')]:undefined)||'HH:mm:ss'},{'name':_0x9fa3('0x64'),'value':_0x3cc339[_0x9fa3('0x64')]||(_0x3cc339['attrs']&&_0x3cc339[_0x9fa3('0x5d')][0x1]?_0x3cc339[_0x9fa3('0x5d')][0x1]['value']:undefined)||_0x9fa3('0x65')},{'name':_0x9fa3('0x66'),'value':_0x3cc339['attrFontSize']||(_0x3cc339[_0x9fa3('0x5d')]&&_0x3cc339[_0x9fa3('0x5d')][0x2]?_0x3cc339['attrs'][0x2][_0x9fa3('0x5e')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x3cc339['attrMetric']||(_0x3cc339[_0x9fa3('0x5d')]&&_0x3cc339[_0x9fa3('0x5d')][0x0]?_0x3cc339[_0x9fa3('0x5d')][0x0][_0x9fa3('0x5e')]:undefined)||_0x9fa3('0x67')},{'name':'attrVoiceQueues','value':_0x3cc339[_0x9fa3('0x68')]||(_0x3cc339[_0x9fa3('0x5d')]&&_0x3cc339['attrs'][0x1]?_0x3cc339[_0x9fa3('0x5d')][0x1][_0x9fa3('0x5e')]:undefined)||[]},{'name':'attrFontSize','value':_0x3cc339['attrFontSize']||(_0x3cc339[_0x9fa3('0x5d')]&&_0x3cc339[_0x9fa3('0x5d')][0x2]?_0x3cc339[_0x9fa3('0x5d')][0x2][_0x9fa3('0x5e')]:undefined)||0x14}];case _0x9fa3('0x69'):case _0x9fa3('0x6a'):return[{'name':'attrSerie1','value':_0x3cc339[_0x9fa3('0x6b')]||(_0x3cc339[_0x9fa3('0x5d')]&&_0x3cc339[_0x9fa3('0x5d')][0x0]?_0x3cc339[_0x9fa3('0x5d')][0x0]['value']:undefined)||_0x9fa3('0x67')},{'name':_0x9fa3('0x6c'),'value':_0x3cc339[_0x9fa3('0x6c')]||(_0x3cc339['attrs']&&_0x3cc339['attrs'][0x1]?_0x3cc339[_0x9fa3('0x5d')][0x1]['value']:undefined)||null},{'name':_0x9fa3('0x6d'),'value':_0x3cc339[_0x9fa3('0x6d')]||(_0x3cc339[_0x9fa3('0x5d')]&&_0x3cc339['attrs'][0x2]?_0x3cc339['attrs'][0x2][_0x9fa3('0x5e')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x3cc339[_0x9fa3('0x68')]||(_0x3cc339[_0x9fa3('0x5d')]&&_0x3cc339[_0x9fa3('0x5d')][0x3]?_0x3cc339['attrs'][0x3]['value']:undefined)||[]}];case _0x9fa3('0x6e'):return[{'name':_0x9fa3('0x6f'),'type':_0x3cc339[_0x9fa3('0x70')]||(_0x3cc339['attrs']&&_0x3cc339[_0x9fa3('0x5d')][0x0]?_0x3cc339[_0x9fa3('0x5d')][0x0][_0x9fa3('0x46')]:undefined)||null,'value':_0x3cc339['attrReport']||(_0x3cc339[_0x9fa3('0x5d')]&&_0x3cc339['attrs'][0x0]?_0x3cc339[_0x9fa3('0x5d')][0x0][_0x9fa3('0x5e')]:undefined)||null},{'name':'attrRefresh','value':_0x3cc339[_0x9fa3('0x71')]||(_0x3cc339[_0x9fa3('0x5d')]&&_0x3cc339[_0x9fa3('0x5d')][0x1]?_0x3cc339[_0x9fa3('0x5d')][0x1][_0x9fa3('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x56731d){logger[_0x9fa3('0x2f')](_0x9fa3('0x72'),JSON['stringify'](_0x56731d));return[];}}exports[_0x9fa3('0x73')]=function(_0x1c49a3,_0xb17861,_0x264a06){if(_0x1c49a3[_0x9fa3('0x4f')]['id']){delete _0x1c49a3[_0x9fa3('0x4f')]['id'];}return db[_0x9fa3('0x33')]['find']({'where':{'id':_0x1c49a3[_0x9fa3('0x4b')]['id']}})[_0x9fa3('0x28')](handleEntityNotFound(_0xb17861,null))[_0x9fa3('0x28')](function(_0x1c6e5c){if(_0x1c6e5c){_0x1c49a3[_0x9fa3('0x4f')]['DashboardId']=_0x1c6e5c['id'];_0x1c49a3['body'][_0x9fa3('0x5d')]=widgetAttributes(_0x1c49a3[_0x9fa3('0x4f')]);return db[_0x9fa3('0x74')][_0x9fa3('0x4e')](_0x1c49a3['body']);}})[_0x9fa3('0x28')](respondWithResult(_0xb17861,null))[_0x9fa3('0x4a')](handleError(_0xb17861,null));};exports['getItems']=function(_0xb224ba,_0x207137,_0x3444a1){var _0xfd2217={};var _0x2a37ad={};var _0x5bd7d8;var _0x126c20;return db['Dashboard']['findOne']({'where':{'id':_0xb224ba[_0x9fa3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x207137,null))['then'](function(_0x3e5e0f){if(_0x3e5e0f){_0x5bd7d8=_0x3e5e0f;_0x2a37ad[_0x9fa3('0x39')]=_['keys'](db['DashboardItem'][_0x9fa3('0x34')]);_0x2a37ad[_0x9fa3('0x36')]=_[_0x9fa3('0x35')](_0xb224ba[_0x9fa3('0x36')]);_0x2a37ad['filters']=_[_0x9fa3('0x38')](_0x2a37ad['model'],_0x2a37ad['query']);_0xfd2217[_0x9fa3('0x3a')]=_['intersection'](_0x2a37ad['model'],qs['fields'](_0xb224ba[_0x9fa3('0x36')]['fields']));_0xfd2217['attributes']=_0xfd2217[_0x9fa3('0x3a')]['length']?_0xfd2217[_0x9fa3('0x3a')]:_0x2a37ad[_0x9fa3('0x39')];_0xfd2217[_0x9fa3('0x3f')]=qs[_0x9fa3('0x40')](_0xb224ba['query'][_0x9fa3('0x40')]);_0xfd2217['where']=qs[_0x9fa3('0x37')](_[_0x9fa3('0x42')](_0xb224ba['query'],_0x2a37ad[_0x9fa3('0x37')]));if(_0xb224ba[_0x9fa3('0x36')][_0x9fa3('0x43')]){_0xfd2217[_0x9fa3('0x41')]=_[_0x9fa3('0x44')](_0xfd2217['where'],{'$or':_[_0x9fa3('0x45')](_0xfd2217['attributes'],function(_0x5340c0){var _0x40c748={};_0x40c748[_0x5340c0]={'$like':'%'+_0xb224ba[_0x9fa3('0x36')]['filter']+'%'};return _0x40c748;})});}_0xfd2217=_['merge']({},_0xfd2217,_0xb224ba[_0x9fa3('0x47')]);return _0x5bd7d8[_0x9fa3('0x75')](_0xfd2217);}})['then'](function(_0x45bda3){if(_0x45bda3){_0x126c20=_0x45bda3[_0x9fa3('0x3c')];if(!_0xb224ba[_0x9fa3('0x36')][_0x9fa3('0x3d')](_0x9fa3('0x3e'))){_0xfd2217[_0x9fa3('0x20')]=qs[_0x9fa3('0x20')](_0xb224ba[_0x9fa3('0x36')]['limit']);_0xfd2217[_0x9fa3('0x1f')]=qs[_0x9fa3('0x1f')](_0xb224ba[_0x9fa3('0x36')][_0x9fa3('0x1f')]);}return _0x5bd7d8[_0x9fa3('0x75')](_0xfd2217);}})[_0x9fa3('0x28')](function(_0x34bc35){if(_0x34bc35){return _0x34bc35?{'count':_0x126c20,'rows':_0x34bc35}:null;}})[_0x9fa3('0x28')](respondWithResult(_0x207137,null))[_0x9fa3('0x4a')](handleError(_0x207137,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 71041a2..2f1cbe1 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 _0x0ffb=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x56e500,_0x2015b8){var _0x4a43b4=function(_0x67b115){while(--_0x67b115){_0x56e500['push'](_0x56e500['shift']());}};_0x4a43b4(++_0x2015b8);}(_0x0ffb,0x155));var _0xb0ff=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0ffb[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xb0ff('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xb0ff('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb0ff('0x2'),'afterDestroy':'remove'};function emitEvent(_0x85d4f0){return function(_0x245c0f,_0x4e2e55,_0x260d77){DashboardEvents['emit'](_0x85d4f0+':'+_0x245c0f['id'],_0x245c0f);DashboardEvents[_0xb0ff('0x3')](_0x85d4f0,_0x245c0f);_0x260d77(null);};}for(var e in events){if(events[_0xb0ff('0x4')](e)){var event=events[e];Dashboard[_0xb0ff('0x5')](e,emitEvent(event));}}module[_0xb0ff('0x6')]=DashboardEvents; \ No newline at end of file +var _0x95d6=['hook','exports','setMaxListeners','save','remove','emit'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x95d6,0x182));var _0x695d=function(_0x112f55,_0x1ea99b){_0x112f55=_0x112f55-0x0;var _0x1f9bee=_0x95d6[_0x112f55];return _0x1f9bee;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x695d('0x0')](0x0);var events={'afterCreate':_0x695d('0x1'),'afterUpdate':'update','afterDestroy':_0x695d('0x2')};function emitEvent(_0x27415e){return function(_0x554fec,_0x4613fc,_0x2ea0d1){DashboardEvents['emit'](_0x27415e+':'+_0x554fec['id'],_0x554fec);DashboardEvents[_0x695d('0x3')](_0x27415e,_0x554fec);_0x2ea0d1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x695d('0x4')](e,emitEvent(event));}}module[_0x695d('0x5')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index fed4ae0..5162f1c 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 _0xc704=['path','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x32f845,_0x335cb9){var _0x3c0de4=function(_0x44c308){while(--_0x44c308){_0x32f845['push'](_0x32f845['shift']());}};_0x3c0de4(++_0x335cb9);}(_0xc704,0x95));var _0x4c70=function(_0x3b1e27,_0x44bb91){_0x3b1e27=_0x3b1e27-0x0;var _0x4bb6b3=_0xc704[_0x3b1e27];return _0x4bb6b3;};'use strict';var _=require(_0x4c70('0x0'));var util=require(_0x4c70('0x1'));var logger=require(_0x4c70('0x2'))(_0x4c70('0x3'));var moment=require(_0x4c70('0x4'));var BPromise=require(_0x4c70('0x5'));var rp=require(_0x4c70('0x6'));var fs=require('fs');var path=require(_0x4c70('0x7'));var rimraf=require(_0x4c70('0x8'));var config=require(_0x4c70('0x9'));var attributes=require(_0x4c70('0xa'));module[_0x4c70('0xb')]=function(_0x537cc0,_0x2efe35){return _0x537cc0['define'](_0x4c70('0xc'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e83=['request-promise','path','../../config/environment','./dashboard.attributes','exports','define','Dashboard','util','../../config/logger','api','bluebird'];(function(_0x4acc68,_0xd48960){var _0x44c63d=function(_0x1fd2bc){while(--_0x1fd2bc){_0x4acc68['push'](_0x4acc68['shift']());}};_0x44c63d(++_0xd48960);}(_0x3e83,0xac));var _0x33e8=function(_0x1405c1,_0x532676){_0x1405c1=_0x1405c1-0x0;var _0x59aabc=_0x3e83[_0x1405c1];return _0x59aabc;};'use strict';var _=require('lodash');var util=require(_0x33e8('0x0'));var logger=require(_0x33e8('0x1'))(_0x33e8('0x2'));var moment=require('moment');var BPromise=require(_0x33e8('0x3'));var rp=require(_0x33e8('0x4'));var fs=require('fs');var path=require(_0x33e8('0x5'));var rimraf=require('rimraf');var config=require(_0x33e8('0x6'));var attributes=require(_0x33e8('0x7'));module[_0x33e8('0x8')]=function(_0xb38411,_0x5cace6){return _0xb38411[_0x33e8('0x9')](_0x33e8('0xa'),attributes,{'tableName':'dashboards','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 71b8a8b..0bdd992 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 _0x4111=['redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x1fbe59,_0x45dd45){var _0x315b32=function(_0x403fe){while(--_0x403fe){_0x1fbe59['push'](_0x1fbe59['shift']());}};_0x315b32(++_0x45dd45);}(_0x4111,0x91));var _0x1411=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4111[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1411('0x0'));var util=require(_0x1411('0x1'));var moment=require(_0x1411('0x2'));var BPromise=require(_0x1411('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1411('0x4'));var db=require(_0x1411('0x5'))['db'];var utils=require(_0x1411('0x6'));var logger=require(_0x1411('0x7'))(_0x1411('0x8'));var config=require(_0x1411('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1411('0xa')]({'port':0x232a});config[_0x1411('0xb')]=_[_0x1411('0xc')](config[_0x1411('0xb')],{'host':_0x1411('0xd'),'port':0x18eb});var socket=require(_0x1411('0xe'))(new Redis(config['redis']));require(_0x1411('0xf'))[_0x1411('0x10')](socket);function respondWithRpcPromise(_0x3cee90,_0x2ff838,_0x3ae6df){return new BPromise(function(_0x1cfa4f,_0x3ad9d1){return client[_0x1411('0x11')](_0x3cee90,_0x3ae6df)['then'](function(_0x5c51da){logger[_0x1411('0x12')](_0x1411('0x13'),_0x2ff838,_0x1411('0x14'));logger[_0x1411('0x15')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x2ff838,_0x1411('0x14'),JSON[_0x1411('0x16')](_0x5c51da));if(_0x5c51da[_0x1411('0x17')]){if(_0x5c51da[_0x1411('0x17')]['code']===0x1f4){logger['error'](_0x1411('0x13'),_0x2ff838,_0x5c51da[_0x1411('0x17')]['message']);return _0x3ad9d1(_0x5c51da[_0x1411('0x17')]['message']);}logger[_0x1411('0x17')](_0x1411('0x13'),_0x2ff838,_0x5c51da[_0x1411('0x17')]['message']);return _0x1cfa4f(_0x5c51da[_0x1411('0x17')][_0x1411('0x18')]);}else{logger['info'](_0x1411('0x13'),_0x2ff838,_0x1411('0x14'));_0x1cfa4f(_0x5c51da['result'][_0x1411('0x18')]);}})[_0x1411('0x19')](function(_0x1e32c1){logger[_0x1411('0x17')](_0x1411('0x13'),_0x2ff838,_0x1e32c1);_0x3ad9d1(_0x1e32c1);});});} \ No newline at end of file +var _0xf9c2=['http','redis','defaults','localhost','./dashboard.socket','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\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'];(function(_0x22e95d,_0x276a3e){var _0x23329c=function(_0x38e3a1){while(--_0x38e3a1){_0x22e95d['push'](_0x22e95d['shift']());}};_0x23329c(++_0x276a3e);}(_0xf9c2,0x16f));var _0x2f9c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf9c2[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x2f9c('0x0'));var util=require(_0x2f9c('0x1'));var moment=require(_0x2f9c('0x2'));var BPromise=require('bluebird');var rs=require(_0x2f9c('0x3'));var fs=require('fs');var Redis=require(_0x2f9c('0x4'));var db=require(_0x2f9c('0x5'))['db'];var utils=require(_0x2f9c('0x6'));var logger=require('../../config/logger')(_0x2f9c('0x7'));var config=require(_0x2f9c('0x8'));var jayson=require(_0x2f9c('0x9'));var client=jayson[_0x2f9c('0xa')][_0x2f9c('0xb')]({'port':0x232a});config[_0x2f9c('0xc')]=_[_0x2f9c('0xd')](config[_0x2f9c('0xc')],{'host':_0x2f9c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2f9c('0xc')]));require(_0x2f9c('0xf'))['register'](socket);function respondWithRpcPromise(_0x24c535,_0x31a4cd,_0x13a39d){return new BPromise(function(_0x2a52f9,_0xa3ce4d){return client['request'](_0x24c535,_0x13a39d)[_0x2f9c('0x10')](function(_0x398dd4){logger[_0x2f9c('0x11')](_0x2f9c('0x12'),_0x31a4cd,_0x2f9c('0x13'));logger[_0x2f9c('0x14')](_0x2f9c('0x15'),_0x31a4cd,_0x2f9c('0x13'),JSON[_0x2f9c('0x16')](_0x398dd4));if(_0x398dd4[_0x2f9c('0x17')]){if(_0x398dd4['error'][_0x2f9c('0x18')]===0x1f4){logger[_0x2f9c('0x17')](_0x2f9c('0x12'),_0x31a4cd,_0x398dd4[_0x2f9c('0x17')][_0x2f9c('0x19')]);return _0xa3ce4d(_0x398dd4['error']['message']);}logger[_0x2f9c('0x17')]('Dashboard,\x20%s,\x20%s',_0x31a4cd,_0x398dd4[_0x2f9c('0x17')]['message']);return _0x2a52f9(_0x398dd4['error']['message']);}else{logger[_0x2f9c('0x11')](_0x2f9c('0x12'),_0x31a4cd,_0x2f9c('0x13'));_0x2a52f9(_0x398dd4['result'][_0x2f9c('0x19')]);}})[_0x2f9c('0x1a')](function(_0xd677c9){logger[_0x2f9c('0x17')](_0x2f9c('0x12'),_0x31a4cd,_0xd677c9);_0xa3ce4d(_0xd677c9);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 7009fef..0c6ab9d 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 _0xdd7a=['length','./dashboard.events','save','remove','emit','removeListener'];(function(_0x5b1533,_0x27e66c){var _0x1ea41d=function(_0x56d2d7){while(--_0x56d2d7){_0x5b1533['push'](_0x5b1533['shift']());}};_0x1ea41d(++_0x27e66c);}(_0xdd7a,0x145));var _0xadd7=function(_0x4e7aef,_0x65de10){_0x4e7aef=_0x4e7aef-0x0;var _0xbd292e=_0xdd7a[_0x4e7aef];return _0xbd292e;};'use strict';var DashboardEvents=require(_0xadd7('0x0'));var events=[_0xadd7('0x1'),_0xadd7('0x2'),'update'];function createListener(_0x3a1416,_0x293249){return function(_0x22fb79){_0x293249[_0xadd7('0x3')](_0x3a1416,_0x22fb79);};}function removeListener(_0x37c8a4,_0x4ca03d){return function(){DashboardEvents[_0xadd7('0x4')](_0x37c8a4,_0x4ca03d);};}exports['register']=function(_0x3618f6){for(var _0x4e3ef1=0x0,_0x395012=events[_0xadd7('0x5')];_0x4e3ef1<_0x395012;_0x4e3ef1++){var _0x252c6a=events[_0x4e3ef1];var _0x12b775=createListener('dashboard:'+_0x252c6a,_0x3618f6);DashboardEvents['on'](_0x252c6a,_0x12b775);}}; \ No newline at end of file +var _0xd091=['dashboard:','./dashboard.events','save','remove','update','emit','register','length'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xd091,0x91));var _0x1d09=function(_0x20c6f1,_0x21fa65){_0x20c6f1=_0x20c6f1-0x0;var _0x43c3bf=_0xd091[_0x20c6f1];return _0x43c3bf;};'use strict';var DashboardEvents=require(_0x1d09('0x0'));var events=[_0x1d09('0x1'),_0x1d09('0x2'),_0x1d09('0x3')];function createListener(_0x520abe,_0xbd8f7d){return function(_0x56e6fa){_0xbd8f7d[_0x1d09('0x4')](_0x520abe,_0x56e6fa);};}function removeListener(_0x2c77fe,_0x31a043){return function(){DashboardEvents['removeListener'](_0x2c77fe,_0x31a043);};}exports[_0x1d09('0x5')]=function(_0x10f195){for(var _0x5d35a3=0x0,_0x523a14=events[_0x1d09('0x6')];_0x5d35a3<_0x523a14;_0x5d35a3++){var _0x34951d=events[_0x5d35a3];var _0x3b427a=createListener(_0x1d09('0x7')+_0x34951d,_0x10f195);DashboardEvents['on'](_0x34951d,_0x3b427a);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 7da5e81..1f4e491 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 _0xcb91=['isAuthenticated','/:id','show','create','post','/:id/clone','/:id/items','addItem','put','delete','destroy','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x3364fc,_0x559233){var _0x10df36=function(_0x28d38d){while(--_0x28d38d){_0x3364fc['push'](_0x3364fc['shift']());}};_0x10df36(++_0x559233);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x29e35f,_0x4859ef){_0x29e35f=_0x29e35f-0x0;var _0x266b74=_0xcb91[_0x29e35f];return _0x266b74;};'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('./dashboard.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x6')]('/:id/items',auth[_0x1cb9('0x7')](),controller['getItems']);router['post']('/',auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xa')]);router[_0x1cb9('0xb')](_0x1cb9('0xc'),auth[_0x1cb9('0x7')](),controller['clone']);router[_0x1cb9('0xb')](_0x1cb9('0xd'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xe')]);router[_0x1cb9('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1cb9('0x10')](_0x1cb9('0x8'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['/:id','/:id/items','post','create','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated'];(function(_0x47929e,_0x37b946){var _0x5ceee1=function(_0x35a207){while(--_0x35a207){_0x47929e['push'](_0x47929e['shift']());}};_0x5ceee1(++_0x37b946);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getItems']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xb')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller['clone']);router['post']('/:id/items',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')]('/:id',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);module[_0x0a9e('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 671552c..33f6b02 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 _0x9d2c=['lodash','exports','STRING','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#2196f3','sequelize'];(function(_0x553e9c,_0xa82125){var _0x238b48=function(_0x3657ce){while(--_0x3657ce){_0x553e9c['push'](_0x553e9c['shift']());}};_0x238b48(++_0xa82125);}(_0x9d2c,0x107));var _0xc9d2=function(_0xc089df,_0x399a25){_0xc089df=_0xc089df-0x0;var _0x4e2b07=_0x9d2c[_0xc089df];return _0x4e2b07;};'use strict';var Sequelize=require(_0xc9d2('0x0'));var squel=require('squel');var _=require(_0xc9d2('0x1'));module[_0xc9d2('0x2')]={'title':{'type':Sequelize[_0xc9d2('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc9d2('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON[_0xc9d2('0x4')](this[_0xc9d2('0x5')](_0xc9d2('0x6')));}catch(_0x37cdb6){return[];}},'set':function(_0x5b1f9b){try{this['setDataValue']('attrs',JSON[_0xc9d2('0x7')](_0x5b1f9b));}catch(_0x1f4759){this[_0xc9d2('0x8')](_0xc9d2('0x6'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xc9d2('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xc9d2('0x9')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0xc9d2('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xc9d2('0x3')],'allowNull':![],'defaultValue':_0xc9d2('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xc9d2('0x3')]}}; \ No newline at end of file +var _0x86fa=['attrs','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING','long','parse','getDataValue','setDataValue','stringify'];(function(_0x10a5c6,_0x4346bd){var _0x5a56d7=function(_0x33490a){while(--_0x33490a){_0x10a5c6['push'](_0x10a5c6['shift']());}};_0x5a56d7(++_0x4346bd);}(_0x86fa,0x82));var _0xa86f=function(_0x51f7f4,_0xbc2866){_0x51f7f4=_0x51f7f4-0x0;var _0x2ccb64=_0x86fa[_0x51f7f4];return _0x2ccb64;};'use strict';var Sequelize=require(_0xa86f('0x0'));var squel=require(_0xa86f('0x1'));var _=require(_0xa86f('0x2'));module[_0xa86f('0x3')]={'title':{'type':Sequelize[_0xa86f('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xa86f('0x5')),'get':function(){try{return JSON[_0xa86f('0x6')](this[_0xa86f('0x7')]('attrs'));}catch(_0x494e77){return[];}},'set':function(_0x36f8bc){try{this[_0xa86f('0x8')]('attrs',JSON[_0xa86f('0x9')](_0x36f8bc));}catch(_0x39a731){this['setDataValue'](_0xa86f('0xa'),JSON[_0xa86f('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xa86f('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xa86f('0xb')]},'col':{'type':Sequelize[_0xa86f('0xb')]},'background':{'type':Sequelize[_0xa86f('0x4')],'allowNull':![],'defaultValue':_0xa86f('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xa86f('0x4')],'allowNull':![],'defaultValue':_0xa86f('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xa86f('0x4')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 18bc9ff..ef53a1d 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 _0xf0db=['iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','total','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','status','end','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','name','send','show','params','keys','DashboardItem','rawAttributes','query','filters','intersection','model','fields','attributes','length','merge','options','catch','find','type'];(function(_0x543429,_0x140390){var _0x112a46=function(_0x46528b){while(--_0x46528b){_0x543429['push'](_0x543429['shift']());}};_0x112a46(++_0x140390);}(_0xf0db,0x160));var _0xbf0d=function(_0x1da8f4,_0x1ae2e2){_0x1da8f4=_0x1da8f4-0x0;var _0x284e53=_0xf0db[_0x1da8f4];return _0x284e53;};'use strict';var pdf=require(_0xbf0d('0x0'));var emlformat=require(_0xbf0d('0x1'));var rimraf=require(_0xbf0d('0x2'));var zipdir=require(_0xbf0d('0x3'));var jsonpatch=require(_0xbf0d('0x4'));var rp=require(_0xbf0d('0x5'));var moment=require('moment');var BPromise=require(_0xbf0d('0x6'));var Mustache=require(_0xbf0d('0x7'));var util=require(_0xbf0d('0x8'));var path=require(_0xbf0d('0x9'));var sox=require('sox');var csv=require(_0xbf0d('0xa'));var ejs=require(_0xbf0d('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbf0d('0xc'));var crypto=require('crypto');var jsforce=require(_0xbf0d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbf0d('0xa'));var querystring=require(_0xbf0d('0xe'));var Papa=require('papaparse');var Redis=require(_0xbf0d('0xf'));var authService=require(_0xbf0d('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xbf0d('0x11'));var logger=require(_0xbf0d('0x12'))(_0xbf0d('0x13'));var utils=require(_0xbf0d('0x14'));var config=require('../../config/environment');var db=require(_0xbf0d('0x15'))['db'];config[_0xbf0d('0x16')]=_[_0xbf0d('0x17')](config[_0xbf0d('0x16')],{'host':_0xbf0d('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbf0d('0x19'))[_0xbf0d('0x1a')](socket);function respondWithStatusCode(_0x4d3876,_0x391997){_0x391997=_0x391997||0xcc;return function(_0x4509f6){if(_0x4509f6){return _0x4d3876['sendStatus'](_0x391997);}return _0x4d3876[_0xbf0d('0x1b')](_0x391997)[_0xbf0d('0x1c')]();};}function respondWithResult(_0x26e8ba,_0x5ee273){_0x5ee273=_0x5ee273||0xc8;return function(_0x3209d9){if(_0x3209d9){return _0x26e8ba[_0xbf0d('0x1b')](_0x5ee273)['json'](_0x3209d9);}};}function respondWithFilteredResult(_0x4113c0,_0x5508b6){return function(_0x5d6f02){if(_0x5d6f02){var _0x2392db=_0x5d6f02[_0xbf0d('0x1d')],_0x4d8dc9=_0x5508b6['offset'],_0x1ca6da=_0x5508b6[_0xbf0d('0x1e')]+_0x5508b6['limit'],_0x537a04;if(_0x1ca6da>=_0x2392db){_0x1ca6da=_0x2392db;_0x537a04=0xc8;}else{_0x537a04=0xce;}_0x4113c0[_0xbf0d('0x1b')](_0x537a04);return _0x4113c0[_0xbf0d('0x1f')](_0xbf0d('0x20'),_0x4d8dc9+'-'+_0x1ca6da+'/'+_0x2392db)['json'](_0x5d6f02);}return null;};}function patchUpdates(_0x338746){return function(_0x4d6fd8){try{jsonpatch[_0xbf0d('0x21')](_0x4d6fd8,_0x338746,!![]);}catch(_0x45f1f6){return BPromise[_0xbf0d('0x22')](_0x45f1f6);}return _0x4d6fd8['save']();};}function saveUpdates(_0x293384,_0x542163){return function(_0x511273){if(_0x511273){return _0x511273[_0xbf0d('0x23')](_0x293384)[_0xbf0d('0x24')](function(_0x245081){return _0x245081;});}return null;};}function removeEntity(_0x1aeb48,_0x1daa1f){return function(_0x45b2d2){if(_0x45b2d2){return _0x45b2d2[_0xbf0d('0x25')]()[_0xbf0d('0x24')](function(){_0x1aeb48[_0xbf0d('0x1b')](0xcc)[_0xbf0d('0x1c')]();});}};}function handleEntityNotFound(_0x1ac7b7,_0x1c028d){return function(_0x1e7182){if(!_0x1e7182){_0x1ac7b7['sendStatus'](0x194);}return _0x1e7182;};}function handleError(_0x159393,_0x18fa60){_0x18fa60=_0x18fa60||0x1f4;return function(_0x2371c7){logger[_0xbf0d('0x26')](_0x2371c7['stack']);if(_0x2371c7[_0xbf0d('0x27')]){delete _0x2371c7[_0xbf0d('0x27')];}_0x159393[_0xbf0d('0x1b')](_0x18fa60)[_0xbf0d('0x28')](_0x2371c7);};}exports[_0xbf0d('0x29')]=function(_0x2bd9e2,_0x33c6c5){var _0x463af3={'raw':![],'where':{'id':_0x2bd9e2[_0xbf0d('0x2a')]['id']}},_0x3d5c85={};_0x3d5c85['model']=_[_0xbf0d('0x2b')](db[_0xbf0d('0x2c')][_0xbf0d('0x2d')]);_0x3d5c85['query']=_['keys'](_0x2bd9e2[_0xbf0d('0x2e')]);_0x3d5c85[_0xbf0d('0x2f')]=_[_0xbf0d('0x30')](_0x3d5c85[_0xbf0d('0x31')],_0x3d5c85[_0xbf0d('0x2e')]);_0x463af3['attributes']=_[_0xbf0d('0x30')](_0x3d5c85[_0xbf0d('0x31')],qs[_0xbf0d('0x32')](_0x2bd9e2[_0xbf0d('0x2e')]['fields']));_0x463af3[_0xbf0d('0x33')]=_0x463af3[_0xbf0d('0x33')][_0xbf0d('0x34')]?_0x463af3[_0xbf0d('0x33')]:_0x3d5c85['model'];if(_0x2bd9e2['query']['includeAll']){_0x463af3['include']=[{'all':!![]}];}_0x463af3=_[_0xbf0d('0x35')]({},_0x463af3,_0x2bd9e2[_0xbf0d('0x36')]);return db[_0xbf0d('0x2c')]['find'](_0x463af3)[_0xbf0d('0x24')](handleEntityNotFound(_0x33c6c5,null))['then'](respondWithResult(_0x33c6c5,null))[_0xbf0d('0x37')](handleError(_0x33c6c5,null));};exports[_0xbf0d('0x25')]=function(_0x186fae,_0x2e0a33){return db[_0xbf0d('0x2c')][_0xbf0d('0x38')]({'where':{'id':_0x186fae[_0xbf0d('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2e0a33,null))['then'](removeEntity(_0x2e0a33,null))[_0xbf0d('0x37')](handleError(_0x2e0a33,null));};function widgetAttributes(_0x2079d5){try{switch(_0x2079d5[_0xbf0d('0x39')]){case _0xbf0d('0x3a'):return[{'name':'attrUrl','value':_0x2079d5[_0xbf0d('0x3b')]||(_0x2079d5['attrs']&&_0x2079d5[_0xbf0d('0x3c')][0x0]?_0x2079d5[_0xbf0d('0x3c')][0x0][_0xbf0d('0x3d')]:undefined)||_0xbf0d('0x3e')}];case _0xbf0d('0x3f'):return[{'name':_0xbf0d('0x40'),'value':_0x2079d5[_0xbf0d('0x40')]||(_0x2079d5['attrs']&&_0x2079d5['attrs'][0x0]?_0x2079d5['attrs'][0x0][_0xbf0d('0x3d')]:undefined)||''}];case'clock':return[{'name':_0xbf0d('0x41'),'value':_0x2079d5[_0xbf0d('0x41')]||(_0x2079d5[_0xbf0d('0x3c')]&&_0x2079d5['attrs'][0x0]?_0x2079d5[_0xbf0d('0x3c')][0x0][_0xbf0d('0x3d')]:undefined)||_0xbf0d('0x42')},{'name':'attrTimezone','value':_0x2079d5[_0xbf0d('0x43')]||(_0x2079d5[_0xbf0d('0x3c')]&&_0x2079d5[_0xbf0d('0x3c')][0x1]?_0x2079d5[_0xbf0d('0x3c')][0x1][_0xbf0d('0x3d')]:undefined)||'0.00'},{'name':_0xbf0d('0x44'),'value':_0x2079d5[_0xbf0d('0x44')]||(_0x2079d5[_0xbf0d('0x3c')]&&_0x2079d5[_0xbf0d('0x3c')][0x2]?_0x2079d5[_0xbf0d('0x3c')][0x2]['value']:undefined)||0xc}];case _0xbf0d('0x45'):return[{'name':'attrMetric','value':_0x2079d5['attrMetric']||(_0x2079d5[_0xbf0d('0x3c')]&&_0x2079d5['attrs'][0x0]?_0x2079d5[_0xbf0d('0x3c')][0x0][_0xbf0d('0x3d')]:undefined)||_0xbf0d('0x46')},{'name':'attrVoiceQueues','value':_0x2079d5['attrVoiceQueues']||(_0x2079d5[_0xbf0d('0x3c')]&&_0x2079d5[_0xbf0d('0x3c')][0x1]?_0x2079d5[_0xbf0d('0x3c')][0x1][_0xbf0d('0x3d')]:undefined)||[]},{'name':_0xbf0d('0x44'),'value':_0x2079d5[_0xbf0d('0x44')]||(_0x2079d5[_0xbf0d('0x3c')]&&_0x2079d5[_0xbf0d('0x3c')][0x2]?_0x2079d5[_0xbf0d('0x3c')][0x2][_0xbf0d('0x3d')]:undefined)||0x14}];case _0xbf0d('0x47'):case'pie-chart':return[{'name':_0xbf0d('0x48'),'value':_0x2079d5[_0xbf0d('0x48')]||(_0x2079d5[_0xbf0d('0x3c')]&&_0x2079d5[_0xbf0d('0x3c')][0x0]?_0x2079d5['attrs'][0x0][_0xbf0d('0x3d')]:undefined)||_0xbf0d('0x46')},{'name':_0xbf0d('0x49'),'value':_0x2079d5[_0xbf0d('0x49')]||(_0x2079d5['attrs']&&_0x2079d5['attrs'][0x1]?_0x2079d5[_0xbf0d('0x3c')][0x1][_0xbf0d('0x3d')]:undefined)||null},{'name':_0xbf0d('0x4a'),'value':_0x2079d5[_0xbf0d('0x4a')]||(_0x2079d5[_0xbf0d('0x3c')]&&_0x2079d5[_0xbf0d('0x3c')][0x2]?_0x2079d5['attrs'][0x2][_0xbf0d('0x3d')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x2079d5[_0xbf0d('0x4b')]||(_0x2079d5[_0xbf0d('0x3c')]&&_0x2079d5['attrs'][0x3]?_0x2079d5['attrs'][0x3][_0xbf0d('0x3d')]:undefined)||[]}];case'web-report':return[{'name':_0xbf0d('0x4c'),'type':_0x2079d5[_0xbf0d('0x4d')]||(_0x2079d5[_0xbf0d('0x3c')]&&_0x2079d5[_0xbf0d('0x3c')][0x0]?_0x2079d5['attrs'][0x0]['type']:undefined)||null,'value':_0x2079d5['attrReport']||(_0x2079d5[_0xbf0d('0x3c')]&&_0x2079d5['attrs'][0x0]?_0x2079d5[_0xbf0d('0x3c')][0x0][_0xbf0d('0x3d')]:undefined)||null},{'name':_0xbf0d('0x4e'),'value':_0x2079d5[_0xbf0d('0x4e')]||(_0x2079d5[_0xbf0d('0x3c')]&&_0x2079d5['attrs'][0x1]?_0x2079d5['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x270dab){logger[_0xbf0d('0x26')](_0xbf0d('0x4f'),JSON['stringify'](_0x270dab));return[];}}exports[_0xbf0d('0x50')]=function(_0x55cba0,_0x3ca4ee){if(_0x55cba0[_0xbf0d('0x51')]){_0x55cba0[_0xbf0d('0x51')][_0xbf0d('0x3c')]=widgetAttributes(_0x55cba0[_0xbf0d('0x51')]);}return db[_0xbf0d('0x2c')][_0xbf0d('0x50')](_0x55cba0[_0xbf0d('0x51')],{})[_0xbf0d('0x24')](respondWithResult(_0x3ca4ee,0xc9))['catch'](handleError(_0x3ca4ee,null));};exports['update']=function(_0x18f21a,_0x10faa2){if(_0x18f21a[_0xbf0d('0x51')]['id']){delete _0x18f21a['body']['id'];}_0x18f21a[_0xbf0d('0x51')]['attrs']=widgetAttributes(_0x18f21a[_0xbf0d('0x51')]);return db['DashboardItem'][_0xbf0d('0x38')]({'where':{'id':_0x18f21a[_0xbf0d('0x2a')]['id']}})[_0xbf0d('0x24')](handleEntityNotFound(_0x10faa2,null))[_0xbf0d('0x24')](saveUpdates(_0x18f21a[_0xbf0d('0x51')],null))['then'](respondWithResult(_0x10faa2,null))[_0xbf0d('0x37')](handleError(_0x10faa2,null));}; \ No newline at end of file +var _0xa89d=['stack','name','send','show','params','keys','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','HH:mm:ss','attrTimezone','counter','attrMetric','attrVoiceQueues','attrFontSize','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','error','stringify','create','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./dashboardItem.socket','register','sendStatus','status','end','count','offset','Content-Range','apply','reject','save','then','destroy'];(function(_0x119629,_0x246787){var _0x49a771=function(_0x23624c){while(--_0x23624c){_0x119629['push'](_0x119629['shift']());}};_0x49a771(++_0x246787);}(_0xa89d,0xdc));var _0xda89=function(_0xde2ce6,_0x2abb43){_0xde2ce6=_0xde2ce6-0x0;var _0x275fd5=_0xa89d[_0xde2ce6];return _0x275fd5;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xda89('0x0'));var jsonpatch=require(_0xda89('0x1'));var rp=require(_0xda89('0x2'));var moment=require(_0xda89('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xda89('0x4'));var util=require(_0xda89('0x5'));var path=require(_0xda89('0x6'));var sox=require(_0xda89('0x7'));var csv=require(_0xda89('0x8'));var ejs=require(_0xda89('0x9'));var fs=require('fs');var _=require(_0xda89('0xa'));var squel=require(_0xda89('0xb'));var crypto=require(_0xda89('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xda89('0xd'));var Papa=require(_0xda89('0xe'));var Redis=require(_0xda89('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xda89('0x10'));var hardwareService=require(_0xda89('0x11'));var logger=require(_0xda89('0x12'))(_0xda89('0x13'));var utils=require(_0xda89('0x14'));var config=require(_0xda89('0x15'));var db=require(_0xda89('0x16'))['db'];config[_0xda89('0x17')]=_[_0xda89('0x18')](config[_0xda89('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xda89('0x19'))[_0xda89('0x1a')](socket);function respondWithStatusCode(_0x2598a2,_0x247223){_0x247223=_0x247223||0xcc;return function(_0x275a20){if(_0x275a20){return _0x2598a2[_0xda89('0x1b')](_0x247223);}return _0x2598a2[_0xda89('0x1c')](_0x247223)[_0xda89('0x1d')]();};}function respondWithResult(_0x1a398d,_0x2ca16d){_0x2ca16d=_0x2ca16d||0xc8;return function(_0x31da8c){if(_0x31da8c){return _0x1a398d[_0xda89('0x1c')](_0x2ca16d)['json'](_0x31da8c);}};}function respondWithFilteredResult(_0x27ff57,_0x4ea371){return function(_0x2a887d){if(_0x2a887d){var _0x5ccee9=_0x2a887d[_0xda89('0x1e')],_0x4122bf=_0x4ea371[_0xda89('0x1f')],_0x3a74f2=_0x4ea371[_0xda89('0x1f')]+_0x4ea371['limit'],_0x48f200;if(_0x3a74f2>=_0x5ccee9){_0x3a74f2=_0x5ccee9;_0x48f200=0xc8;}else{_0x48f200=0xce;}_0x27ff57['status'](_0x48f200);return _0x27ff57['set'](_0xda89('0x20'),_0x4122bf+'-'+_0x3a74f2+'/'+_0x5ccee9)['json'](_0x2a887d);}return null;};}function patchUpdates(_0x16e424){return function(_0x1b65e9){try{jsonpatch[_0xda89('0x21')](_0x1b65e9,_0x16e424,!![]);}catch(_0x2bec96){return BPromise[_0xda89('0x22')](_0x2bec96);}return _0x1b65e9[_0xda89('0x23')]();};}function saveUpdates(_0x3d88fa,_0x39d838){return function(_0x25ec25){if(_0x25ec25){return _0x25ec25['update'](_0x3d88fa)[_0xda89('0x24')](function(_0xb8ae82){return _0xb8ae82;});}return null;};}function removeEntity(_0x5ad1b3,_0x371bd4){return function(_0x4cc6d5){if(_0x4cc6d5){return _0x4cc6d5[_0xda89('0x25')]()[_0xda89('0x24')](function(){_0x5ad1b3[_0xda89('0x1c')](0xcc)[_0xda89('0x1d')]();});}};}function handleEntityNotFound(_0x30cea,_0x5a11a6){return function(_0x3af508){if(!_0x3af508){_0x30cea[_0xda89('0x1b')](0x194);}return _0x3af508;};}function handleError(_0x4e99b3,_0x51621f){_0x51621f=_0x51621f||0x1f4;return function(_0x530c1d){logger['error'](_0x530c1d[_0xda89('0x26')]);if(_0x530c1d[_0xda89('0x27')]){delete _0x530c1d[_0xda89('0x27')];}_0x4e99b3[_0xda89('0x1c')](_0x51621f)[_0xda89('0x28')](_0x530c1d);};}exports[_0xda89('0x29')]=function(_0x9edec5,_0x3585e5){var _0x25c14f={'raw':![],'where':{'id':_0x9edec5[_0xda89('0x2a')]['id']}},_0x309cbd={};_0x309cbd['model']=_[_0xda89('0x2b')](db['DashboardItem']['rawAttributes']);_0x309cbd[_0xda89('0x2c')]=_[_0xda89('0x2b')](_0x9edec5[_0xda89('0x2c')]);_0x309cbd[_0xda89('0x2d')]=_[_0xda89('0x2e')](_0x309cbd[_0xda89('0x2f')],_0x309cbd[_0xda89('0x2c')]);_0x25c14f[_0xda89('0x30')]=_['intersection'](_0x309cbd['model'],qs[_0xda89('0x31')](_0x9edec5[_0xda89('0x2c')][_0xda89('0x31')]));_0x25c14f['attributes']=_0x25c14f[_0xda89('0x30')][_0xda89('0x32')]?_0x25c14f['attributes']:_0x309cbd[_0xda89('0x2f')];if(_0x9edec5[_0xda89('0x2c')][_0xda89('0x33')]){_0x25c14f[_0xda89('0x34')]=[{'all':!![]}];}_0x25c14f=_[_0xda89('0x35')]({},_0x25c14f,_0x9edec5[_0xda89('0x36')]);return db[_0xda89('0x37')][_0xda89('0x38')](_0x25c14f)['then'](handleEntityNotFound(_0x3585e5,null))['then'](respondWithResult(_0x3585e5,null))[_0xda89('0x39')](handleError(_0x3585e5,null));};exports[_0xda89('0x25')]=function(_0x3dfa2b,_0x3059fd){return db['DashboardItem'][_0xda89('0x38')]({'where':{'id':_0x3dfa2b[_0xda89('0x2a')]['id']}})[_0xda89('0x24')](handleEntityNotFound(_0x3059fd,null))[_0xda89('0x24')](removeEntity(_0x3059fd,null))[_0xda89('0x39')](handleError(_0x3059fd,null));};function widgetAttributes(_0xd9ebd4){try{switch(_0xd9ebd4[_0xda89('0x3a')]){case _0xda89('0x3b'):return[{'name':_0xda89('0x3c'),'value':_0xd9ebd4[_0xda89('0x3c')]||(_0xd9ebd4[_0xda89('0x3d')]&&_0xd9ebd4[_0xda89('0x3d')][0x0]?_0xd9ebd4[_0xda89('0x3d')][0x0][_0xda89('0x3e')]:undefined)||_0xda89('0x3f')}];case _0xda89('0x40'):return[{'name':_0xda89('0x41'),'value':_0xd9ebd4[_0xda89('0x41')]||(_0xd9ebd4[_0xda89('0x3d')]&&_0xd9ebd4[_0xda89('0x3d')][0x0]?_0xd9ebd4['attrs'][0x0][_0xda89('0x3e')]:undefined)||''}];case _0xda89('0x42'):return[{'name':'attrHourFormat','value':_0xd9ebd4['attrHourFormat']||(_0xd9ebd4['attrs']&&_0xd9ebd4[_0xda89('0x3d')][0x0]?_0xd9ebd4[_0xda89('0x3d')][0x0][_0xda89('0x3e')]:undefined)||_0xda89('0x43')},{'name':_0xda89('0x44'),'value':_0xd9ebd4[_0xda89('0x44')]||(_0xd9ebd4[_0xda89('0x3d')]&&_0xd9ebd4[_0xda89('0x3d')][0x1]?_0xd9ebd4[_0xda89('0x3d')][0x1][_0xda89('0x3e')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0xd9ebd4['attrFontSize']||(_0xd9ebd4[_0xda89('0x3d')]&&_0xd9ebd4[_0xda89('0x3d')][0x2]?_0xd9ebd4[_0xda89('0x3d')][0x2][_0xda89('0x3e')]:undefined)||0xc}];case _0xda89('0x45'):return[{'name':_0xda89('0x46'),'value':_0xd9ebd4['attrMetric']||(_0xd9ebd4[_0xda89('0x3d')]&&_0xd9ebd4[_0xda89('0x3d')][0x0]?_0xd9ebd4[_0xda89('0x3d')][0x0][_0xda89('0x3e')]:undefined)||'total'},{'name':_0xda89('0x47'),'value':_0xd9ebd4[_0xda89('0x47')]||(_0xd9ebd4[_0xda89('0x3d')]&&_0xd9ebd4[_0xda89('0x3d')][0x1]?_0xd9ebd4[_0xda89('0x3d')][0x1][_0xda89('0x3e')]:undefined)||[]},{'name':_0xda89('0x48'),'value':_0xd9ebd4[_0xda89('0x48')]||(_0xd9ebd4['attrs']&&_0xd9ebd4[_0xda89('0x3d')][0x2]?_0xd9ebd4[_0xda89('0x3d')][0x2]['value']:undefined)||0x14}];case _0xda89('0x49'):case _0xda89('0x4a'):return[{'name':_0xda89('0x4b'),'value':_0xd9ebd4[_0xda89('0x4b')]||(_0xd9ebd4[_0xda89('0x3d')]&&_0xd9ebd4['attrs'][0x0]?_0xd9ebd4[_0xda89('0x3d')][0x0][_0xda89('0x3e')]:undefined)||'total'},{'name':'attrSerie2','value':_0xd9ebd4[_0xda89('0x4c')]||(_0xd9ebd4[_0xda89('0x3d')]&&_0xd9ebd4[_0xda89('0x3d')][0x1]?_0xd9ebd4['attrs'][0x1][_0xda89('0x3e')]:undefined)||null},{'name':_0xda89('0x4d'),'value':_0xd9ebd4[_0xda89('0x4d')]||(_0xd9ebd4[_0xda89('0x3d')]&&_0xd9ebd4[_0xda89('0x3d')][0x2]?_0xd9ebd4['attrs'][0x2][_0xda89('0x3e')]:undefined)||null},{'name':_0xda89('0x47'),'value':_0xd9ebd4[_0xda89('0x47')]||(_0xd9ebd4[_0xda89('0x3d')]&&_0xd9ebd4['attrs'][0x3]?_0xd9ebd4[_0xda89('0x3d')][0x3][_0xda89('0x3e')]:undefined)||[]}];case _0xda89('0x4e'):return[{'name':_0xda89('0x4f'),'type':_0xd9ebd4[_0xda89('0x50')]||(_0xd9ebd4[_0xda89('0x3d')]&&_0xd9ebd4[_0xda89('0x3d')][0x0]?_0xd9ebd4[_0xda89('0x3d')][0x0][_0xda89('0x3a')]:undefined)||null,'value':_0xd9ebd4[_0xda89('0x4f')]||(_0xd9ebd4[_0xda89('0x3d')]&&_0xd9ebd4[_0xda89('0x3d')][0x0]?_0xd9ebd4['attrs'][0x0][_0xda89('0x3e')]:undefined)||null},{'name':_0xda89('0x51'),'value':_0xd9ebd4[_0xda89('0x51')]||(_0xd9ebd4['attrs']&&_0xd9ebd4[_0xda89('0x3d')][0x1]?_0xd9ebd4[_0xda89('0x3d')][0x1][_0xda89('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x4ff114){logger[_0xda89('0x52')]('widgetAttributes:\x20%s',JSON[_0xda89('0x53')](_0x4ff114));return[];}}exports[_0xda89('0x54')]=function(_0x26016f,_0xf5a7d6){if(_0x26016f['body']){_0x26016f[_0xda89('0x55')][_0xda89('0x3d')]=widgetAttributes(_0x26016f[_0xda89('0x55')]);}return db['DashboardItem'][_0xda89('0x54')](_0x26016f[_0xda89('0x55')],{})[_0xda89('0x24')](respondWithResult(_0xf5a7d6,0xc9))['catch'](handleError(_0xf5a7d6,null));};exports['update']=function(_0x37145d,_0x4dd6cc){if(_0x37145d['body']['id']){delete _0x37145d['body']['id'];}_0x37145d[_0xda89('0x55')][_0xda89('0x3d')]=widgetAttributes(_0x37145d[_0xda89('0x55')]);return db[_0xda89('0x37')][_0xda89('0x38')]({'where':{'id':_0x37145d[_0xda89('0x2a')]['id']}})[_0xda89('0x24')](handleEntityNotFound(_0x4dd6cc,null))[_0xda89('0x24')](saveUpdates(_0x37145d[_0xda89('0x55')],null))['then'](respondWithResult(_0x4dd6cc,null))['catch'](handleError(_0x4dd6cc,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 4b2055a..91ad416 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 _0x354c=['hook','exports','../../mysqldb','DashboardItem','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x354c,0x173));var _0xc354=function(_0x291b34,_0x300bed){_0x291b34=_0x291b34-0x0;var _0x5bb842=_0x354c[_0x291b34];return _0x5bb842;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0xc354('0x0'))['db'][_0xc354('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xc354('0x2')](0x0);var events={'afterCreate':_0xc354('0x3'),'afterUpdate':_0xc354('0x4'),'afterDestroy':'remove'};function emitEvent(_0x75cc2){return function(_0x592e81,_0x4ae098,_0x4a37cd){DashboardItemEvents[_0xc354('0x5')](_0x75cc2+':'+_0x592e81['id'],_0x592e81);DashboardItemEvents['emit'](_0x75cc2,_0x592e81);_0x4a37cd(null);};}for(var e in events){if(events[_0xc354('0x6')](e)){var event=events[e];DashboardItem[_0xc354('0x7')](e,emitEvent(event));}}module[_0xc354('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0xf44a=['exports','events','../../mysqldb','DashboardItem','save','update','emit'];(function(_0x10fba3,_0x50276f){var _0x1d51f3=function(_0x48f725){while(--_0x48f725){_0x10fba3['push'](_0x10fba3['shift']());}};_0x1d51f3(++_0x50276f);}(_0xf44a,0xcc));var _0xaf44=function(_0x231b71,_0x53f4b7){_0x231b71=_0x231b71-0x0;var _0x68bd0f=_0xf44a[_0x231b71];return _0x68bd0f;};'use strict';var EventEmitter=require(_0xaf44('0x0'));var DashboardItem=require(_0xaf44('0x1'))['db'][_0xaf44('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaf44('0x3'),'afterUpdate':_0xaf44('0x4'),'afterDestroy':'remove'};function emitEvent(_0x47b8c9){return function(_0x581051,_0x421927,_0x4ebc8a){DashboardItemEvents[_0xaf44('0x5')](_0x47b8c9+':'+_0x581051['id'],_0x581051);DashboardItemEvents[_0xaf44('0x5')](_0x47b8c9,_0x581051);_0x4ebc8a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xaf44('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 17943aa..97cad38 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 _0xf8f6=['path','rimraf','../../config/environment','./dashboardItem.attributes','exports','dashboard_items','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xf8f6,0x1f2));var _0x6f8f=function(_0xcc0b6f,_0x125352){_0xcc0b6f=_0xcc0b6f-0x0;var _0x370eb4=_0xf8f6[_0xcc0b6f];return _0x370eb4;};'use strict';var _=require(_0x6f8f('0x0'));var util=require(_0x6f8f('0x1'));var logger=require(_0x6f8f('0x2'))(_0x6f8f('0x3'));var moment=require('moment');var BPromise=require(_0x6f8f('0x4'));var rp=require(_0x6f8f('0x5'));var fs=require('fs');var path=require(_0x6f8f('0x6'));var rimraf=require(_0x6f8f('0x7'));var config=require(_0x6f8f('0x8'));var attributes=require(_0x6f8f('0x9'));module[_0x6f8f('0xa')]=function(_0x568384,_0x2745c1){return _0x568384['define']('DashboardItem',attributes,{'tableName':_0x6f8f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a3a=['rimraf','../../config/environment','./dashboardItem.attributes','exports','lodash','util','moment','request-promise'];(function(_0xd7c36a,_0x452eea){var _0x2d01c3=function(_0x4d93b2){while(--_0x4d93b2){_0xd7c36a['push'](_0xd7c36a['shift']());}};_0x2d01c3(++_0x452eea);}(_0x8a3a,0xc4));var _0xa8a3=function(_0x316d2b,_0x553bd4){_0x316d2b=_0x316d2b-0x0;var _0x4a8d04=_0x8a3a[_0x316d2b];return _0x4a8d04;};'use strict';var _=require(_0xa8a3('0x0'));var util=require(_0xa8a3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa8a3('0x2'));var BPromise=require('bluebird');var rp=require(_0xa8a3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa8a3('0x4'));var config=require(_0xa8a3('0x5'));var attributes=require(_0xa8a3('0x6'));module[_0xa8a3('0x7')]=function(_0x45d4fa,_0x1c4746){return _0x45d4fa['define']('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index d208ef1..2d07ef0 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 _0x5d2c=['DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s'];(function(_0x20b966,_0x1cf3ad){var _0x14b006=function(_0x285af1){while(--_0x285af1){_0x20b966['push'](_0x20b966['shift']());}};_0x14b006(++_0x1cf3ad);}(_0x5d2c,0xaa));var _0xc5d2=function(_0x1445a6,_0x4054e0){_0x1445a6=_0x1445a6-0x0;var _0x5c344c=_0x5d2c[_0x1445a6];return _0x5c344c;};'use strict';var _=require(_0xc5d2('0x0'));var util=require(_0xc5d2('0x1'));var moment=require('moment');var BPromise=require(_0xc5d2('0x2'));var rs=require(_0xc5d2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5d2('0x4'))['db'];var utils=require(_0xc5d2('0x5'));var logger=require(_0xc5d2('0x6'))(_0xc5d2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc5d2('0x8')][_0xc5d2('0x9')]({'port':0x232a});config[_0xc5d2('0xa')]=_[_0xc5d2('0xb')](config[_0xc5d2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xc5d2('0xc'))(new Redis(config['redis']));require(_0xc5d2('0xd'))[_0xc5d2('0xe')](socket);function respondWithRpcPromise(_0x14a586,_0x4e30f3,_0x8acd4c){return new BPromise(function(_0x42323f,_0x4a5495){return client[_0xc5d2('0xf')](_0x14a586,_0x8acd4c)[_0xc5d2('0x10')](function(_0x46bc6e){logger[_0xc5d2('0x11')](_0xc5d2('0x12'),_0x4e30f3,'request\x20sent');logger['debug'](_0xc5d2('0x13'),_0x4e30f3,_0xc5d2('0x14'),JSON[_0xc5d2('0x15')](_0x46bc6e));if(_0x46bc6e[_0xc5d2('0x16')]){if(_0x46bc6e[_0xc5d2('0x16')][_0xc5d2('0x17')]===0x1f4){logger[_0xc5d2('0x16')]('DashboardItem,\x20%s,\x20%s',_0x4e30f3,_0x46bc6e[_0xc5d2('0x16')]['message']);return _0x4a5495(_0x46bc6e['error'][_0xc5d2('0x18')]);}logger[_0xc5d2('0x16')]('DashboardItem,\x20%s,\x20%s',_0x4e30f3,_0x46bc6e[_0xc5d2('0x16')][_0xc5d2('0x18')]);return _0x42323f(_0x46bc6e[_0xc5d2('0x16')][_0xc5d2('0x18')]);}else{logger[_0xc5d2('0x11')]('DashboardItem,\x20%s,\x20%s',_0x4e30f3,_0xc5d2('0x14'));_0x42323f(_0x46bc6e[_0xc5d2('0x19')]['message']);}})[_0xc5d2('0x1a')](function(_0x4978f5){logger[_0xc5d2('0x16')](_0xc5d2('0x12'),_0x4e30f3,_0x4978f5);_0x4a5495(_0x4978f5);});});} \ No newline at end of file +var _0xd26a=['message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x79c6de,_0x10de94){var _0x321a56=function(_0x2e313e){while(--_0x2e313e){_0x79c6de['push'](_0x79c6de['shift']());}};_0x321a56(++_0x10de94);}(_0xd26a,0x89));var _0xad26=function(_0x3dd6de,_0x4cd092){_0x3dd6de=_0x3dd6de-0x0;var _0x469d3a=_0xd26a[_0x3dd6de];return _0x469d3a;};'use strict';var _=require(_0xad26('0x0'));var util=require('util');var moment=require(_0xad26('0x1'));var BPromise=require(_0xad26('0x2'));var rs=require(_0xad26('0x3'));var fs=require('fs');var Redis=require(_0xad26('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xad26('0x5'));var logger=require(_0xad26('0x6'))(_0xad26('0x7'));var config=require(_0xad26('0x8'));var jayson=require(_0xad26('0x9'));var client=jayson[_0xad26('0xa')][_0xad26('0xb')]({'port':0x232a});config['redis']=_[_0xad26('0xc')](config[_0xad26('0xd')],{'host':_0xad26('0xe'),'port':0x18eb});var socket=require(_0xad26('0xf'))(new Redis(config[_0xad26('0xd')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x321d6b,_0x4581ff,_0xa1b1df){return new BPromise(function(_0x30e85f,_0x2fee6c){return client[_0xad26('0x10')](_0x321d6b,_0xa1b1df)[_0xad26('0x11')](function(_0x4718c2){logger[_0xad26('0x12')](_0xad26('0x13'),_0x4581ff,_0xad26('0x14'));logger[_0xad26('0x15')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x4581ff,_0xad26('0x14'),JSON[_0xad26('0x16')](_0x4718c2));if(_0x4718c2[_0xad26('0x17')]){if(_0x4718c2['error'][_0xad26('0x18')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x4581ff,_0x4718c2['error'][_0xad26('0x19')]);return _0x2fee6c(_0x4718c2['error'][_0xad26('0x19')]);}logger['error']('DashboardItem,\x20%s,\x20%s',_0x4581ff,_0x4718c2['error'][_0xad26('0x19')]);return _0x30e85f(_0x4718c2[_0xad26('0x17')]['message']);}else{logger[_0xad26('0x12')](_0xad26('0x13'),_0x4581ff,'request\x20sent');_0x30e85f(_0x4718c2['result']['message']);}})[_0xad26('0x1a')](function(_0x38740d){logger[_0xad26('0x17')](_0xad26('0x13'),_0x4581ff,_0x38740d);_0x2fee6c(_0x38740d);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 49919a6..e4b1c01 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 _0xb61c=['emit','removeListener','length','dashboardItem:','save','remove'];(function(_0x3fea34,_0x50303f){var _0x3acce8=function(_0x520078){while(--_0x520078){_0x3fea34['push'](_0x3fea34['shift']());}};_0x3acce8(++_0x50303f);}(_0xb61c,0x13c));var _0xcb61=function(_0x553294,_0x7631c1){_0x553294=_0x553294-0x0;var _0x2d11c7=_0xb61c[_0x553294];return _0x2d11c7;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xcb61('0x0'),_0xcb61('0x1'),'update'];function createListener(_0x4d098b,_0x268441){return function(_0x52e200){_0x268441[_0xcb61('0x2')](_0x4d098b,_0x52e200);};}function removeListener(_0x13b407,_0x1d2439){return function(){DashboardItemEvents[_0xcb61('0x3')](_0x13b407,_0x1d2439);};}exports['register']=function(_0x4ced0f){for(var _0x29a3b5=0x0,_0x5d7108=events[_0xcb61('0x4')];_0x29a3b5<_0x5d7108;_0x29a3b5++){var _0x4a5aef=events[_0x29a3b5];var _0x2512fd=createListener(_0xcb61('0x5')+_0x4a5aef,_0x4ced0f);DashboardItemEvents['on'](_0x4a5aef,_0x2512fd);}}; \ No newline at end of file +var _0x81ef=['update','removeListener','register','length','./dashboardItem.events','save'];(function(_0x13888d,_0x54a266){var _0x485664=function(_0x3501ca){while(--_0x3501ca){_0x13888d['push'](_0x13888d['shift']());}};_0x485664(++_0x54a266);}(_0x81ef,0x16c));var _0xf81e=function(_0x176fac,_0x277ac7){_0x176fac=_0x176fac-0x0;var _0xee5f0b=_0x81ef[_0x176fac];return _0xee5f0b;};'use strict';var DashboardItemEvents=require(_0xf81e('0x0'));var events=[_0xf81e('0x1'),'remove',_0xf81e('0x2')];function createListener(_0x16b71d,_0x2306b4){return function(_0x1d8a68){_0x2306b4['emit'](_0x16b71d,_0x1d8a68);};}function removeListener(_0x33b290,_0x51cb82){return function(){DashboardItemEvents[_0xf81e('0x3')](_0x33b290,_0x51cb82);};}exports[_0xf81e('0x4')]=function(_0x92cde0){for(var _0x107384=0x0,_0x153d64=events[_0xf81e('0x5')];_0x107384<_0x153d64;_0x107384++){var _0x1b4814=events[_0x107384];var _0x390f09=createListener('dashboardItem:'+_0x1b4814,_0x92cde0);DashboardItemEvents['on'](_0x1b4814,_0x390f09);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 8c01348..9fc6181 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 _0x5fc3=['put','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','/:id','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3a3c17,_0x5b7b7e){_0x3a3c17=_0x3a3c17-0x0;var _0xd07f21=_0x5fc3[_0x3a3c17];return _0xd07f21;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var auth=require(_0x35fc('0x5'));var interaction=require(_0x35fc('0x6'));var config=require('../../config/environment');var controller=require(_0x35fc('0x7'));router[_0x35fc('0x8')](_0x35fc('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x35fc('0xa')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xb')]);router[_0x35fc('0xc')](_0x35fc('0x9'),auth[_0x35fc('0xd')](),controller[_0x35fc('0xe')]);router[_0x35fc('0xf')](_0x35fc('0x9'),auth['isAuthenticated'](),controller[_0x35fc('0x10')]);module[_0x35fc('0x11')]=router; \ No newline at end of file +var _0x53ec=['../../components/interaction/service','./dashboardItem.controller','get','isAuthenticated','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xb598ee,_0x5ec466){var _0x35f896=function(_0x3ced59){while(--_0x3ced59){_0xb598ee['push'](_0xb598ee['shift']());}};_0x35f896(++_0x5ec466);}(_0x53ec,0x192));var _0xc53e=function(_0x27bd9b,_0x206238){_0x27bd9b=_0x27bd9b-0x0;var _0xbd6219=_0x53ec[_0x27bd9b];return _0xbd6219;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc53e('0x6'));var config=require('../../config/environment');var controller=require(_0xc53e('0x7'));router[_0xc53e('0x8')]('/:id',auth[_0xc53e('0x9')](),controller['show']);router[_0xc53e('0xa')]('/',auth[_0xc53e('0x9')](),controller['create']);router[_0xc53e('0xb')](_0xc53e('0xc'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xd')]);router[_0xc53e('0xe')](_0xc53e('0xc'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xf')]);module[_0xc53e('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 e441ba8..b08b4ce 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 _0xc1f6=['sequelize','STRING'];(function(_0x5a483e,_0x5735a2){var _0x41ac4a=function(_0x7a54f3){while(--_0x7a54f3){_0x5a483e['push'](_0x5a483e['shift']());}};_0x41ac4a(++_0x5735a2);}(_0xc1f6,0x10c));var _0x6c1f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc1f6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6c1f('0x0'));module['exports']={'name':{'type':Sequelize[_0x6c1f('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x2e8f=['sequelize','exports','STRING'];(function(_0x836bb4,_0x565f4b){var _0x4f5a56=function(_0x183a19){while(--_0x183a19){_0x836bb4['push'](_0x836bb4['shift']());}};_0x4f5a56(++_0x565f4b);}(_0x2e8f,0xae));var _0xf2e8=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x2e8f[_0x2283dc];return _0x16db90;};'use strict';var Sequelize=require(_0xf2e8('0x0'));module[_0xf2e8('0x1')]={'name':{'type':Sequelize[_0xf2e8('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index a5835a6..c4f2f9d 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 _0x8aad=['include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','zip-dir','request-promise','moment','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','get','Dispositions','UserProfileResource','destroy','error','stack','name','send','Disposition','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','options','includeAll','findAll','rows','catch','show','params'];(function(_0x2c69a1,_0x201903){var _0x24bb91=function(_0x3131ac){while(--_0x3131ac){_0x2c69a1['push'](_0x2c69a1['shift']());}};_0x24bb91(++_0x201903);}(_0x8aad,0x146));var _0xd8aa=function(_0x3015dc,_0x1b4c58){_0x3015dc=_0x3015dc-0x0;var _0x4aa8d5=_0x8aad[_0x3015dc];return _0x4aa8d5;};'use strict';var pdf=require(_0xd8aa('0x0'));var emlformat=require(_0xd8aa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd8aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd8aa('0x3'));var moment=require(_0xd8aa('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd8aa('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xd8aa('0x6'));var ejs=require(_0xd8aa('0x7'));var fs=require('fs');var _=require(_0xd8aa('0x8'));var squel=require('squel');var crypto=require(_0xd8aa('0x9'));var jsforce=require(_0xd8aa('0xa'));var deskjs=require(_0xd8aa('0xb'));var toCsv=require(_0xd8aa('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd8aa('0xc'));var authService=require(_0xd8aa('0xd'));var qs=require(_0xd8aa('0xe'));var hardwareService=require(_0xd8aa('0xf'));var logger=require(_0xd8aa('0x10'))('api');var utils=require(_0xd8aa('0x11'));var config=require(_0xd8aa('0x12'));var db=require(_0xd8aa('0x13'))['db'];function respondWithStatusCode(_0x2e5581,_0x2383fd){_0x2383fd=_0x2383fd||0xcc;return function(_0x6ec0eb){if(_0x6ec0eb){return _0x2e5581[_0xd8aa('0x14')](_0x2383fd);}return _0x2e5581[_0xd8aa('0x15')](_0x2383fd)[_0xd8aa('0x16')]();};}function respondWithResult(_0x364280,_0x5ea934){_0x5ea934=_0x5ea934||0xc8;return function(_0x5a8c79){if(_0x5a8c79){return _0x364280[_0xd8aa('0x15')](_0x5ea934)[_0xd8aa('0x17')](_0x5a8c79);}};}function respondWithFilteredResult(_0x2bbd1e,_0x47c131){return function(_0x2678ed){if(_0x2678ed){var _0x180c56=_0x2678ed[_0xd8aa('0x18')],_0x39b5bc=_0x47c131[_0xd8aa('0x19')],_0x404ed6=_0x47c131['offset']+_0x47c131[_0xd8aa('0x1a')],_0x47a0e3;if(_0x404ed6>=_0x180c56){_0x404ed6=_0x180c56;_0x47a0e3=0xc8;}else{_0x47a0e3=0xce;}_0x2bbd1e[_0xd8aa('0x15')](_0x47a0e3);return _0x2bbd1e[_0xd8aa('0x1b')](_0xd8aa('0x1c'),_0x39b5bc+'-'+_0x404ed6+'/'+_0x180c56)[_0xd8aa('0x17')](_0x2678ed);}return null;};}function patchUpdates(_0x4953be){return function(_0x43d3fa){try{jsonpatch[_0xd8aa('0x1d')](_0x43d3fa,_0x4953be,!![]);}catch(_0xb156e6){return BPromise[_0xd8aa('0x1e')](_0xb156e6);}return _0x43d3fa['save']();};}function saveUpdates(_0x411b12,_0x3df281){return function(_0x46d69b){if(_0x46d69b){return _0x46d69b[_0xd8aa('0x1f')](_0x411b12)[_0xd8aa('0x20')](function(_0x4fe5d8){return _0x4fe5d8;});}return null;};}function removeEntity(_0xe1219,_0x1366ce){return function(_0xc4f55c){if(_0xc4f55c){return _0xc4f55c['destroy']()[_0xd8aa('0x20')](function(){var _0x7a4ce7=_0xc4f55c[_0xd8aa('0x21')]({'plain':!![]});var _0x290849=_0xd8aa('0x22');return db[_0xd8aa('0x23')][_0xd8aa('0x24')]({'where':{'type':_0x290849,'resourceId':_0x7a4ce7['id']}})[_0xd8aa('0x20')](function(){return _0xc4f55c;});})[_0xd8aa('0x20')](function(){_0xe1219[_0xd8aa('0x15')](0xcc)[_0xd8aa('0x16')]();});}};}function handleEntityNotFound(_0x370d6f,_0x26cc66){return function(_0x5f1027){if(!_0x5f1027){_0x370d6f[_0xd8aa('0x14')](0x194);}return _0x5f1027;};}function handleError(_0x59eb3f,_0xd4d204){_0xd4d204=_0xd4d204||0x1f4;return function(_0x1f6ab2){logger[_0xd8aa('0x25')](_0x1f6ab2[_0xd8aa('0x26')]);if(_0x1f6ab2[_0xd8aa('0x27')]){delete _0x1f6ab2[_0xd8aa('0x27')];}_0x59eb3f[_0xd8aa('0x15')](_0xd4d204)[_0xd8aa('0x28')](_0x1f6ab2);};}exports['index']=function(_0x1f2a28,_0x34b792){var _0x214393={},_0x49a7c8={},_0x19a59d={'count':0x0,'rows':[]};var _0x51c6f4=db[_0xd8aa('0x29')][_0xd8aa('0x2a')];_0x49a7c8[_0xd8aa('0x2b')]=_[_0xd8aa('0x2c')](_0x51c6f4);_0x49a7c8[_0xd8aa('0x2d')]=_[_0xd8aa('0x2c')](_0x1f2a28[_0xd8aa('0x2d')]);_0x49a7c8[_0xd8aa('0x2e')]=_['intersection'](_0x49a7c8[_0xd8aa('0x2b')],_0x49a7c8[_0xd8aa('0x2d')]);_0x214393[_0xd8aa('0x2f')]=_[_0xd8aa('0x30')](_0x49a7c8[_0xd8aa('0x2b')],qs[_0xd8aa('0x31')](_0x1f2a28[_0xd8aa('0x2d')][_0xd8aa('0x31')]));_0x214393['attributes']=_0x214393[_0xd8aa('0x2f')][_0xd8aa('0x32')]?_0x214393[_0xd8aa('0x2f')]:_0x49a7c8['model'];if(!_0x1f2a28[_0xd8aa('0x2d')][_0xd8aa('0x33')](_0xd8aa('0x34'))){_0x214393[_0xd8aa('0x1a')]=qs[_0xd8aa('0x1a')](_0x1f2a28[_0xd8aa('0x2d')][_0xd8aa('0x1a')]);_0x214393[_0xd8aa('0x19')]=qs[_0xd8aa('0x19')](_0x1f2a28['query'][_0xd8aa('0x19')]);}_0x214393[_0xd8aa('0x35')]=qs[_0xd8aa('0x36')](_0x1f2a28[_0xd8aa('0x2d')][_0xd8aa('0x36')]);_0x214393[_0xd8aa('0x37')]=qs[_0xd8aa('0x2e')](_[_0xd8aa('0x38')](_0x1f2a28[_0xd8aa('0x2d')],_0x49a7c8['filters']));if(_0x1f2a28[_0xd8aa('0x2d')]['filter']){_0x214393[_0xd8aa('0x37')]=_[_0xd8aa('0x39')](_0x214393['where'],{'$or':_[_0xd8aa('0x3a')](_0x51c6f4,function(_0x1a4f2c){if(_0x1a4f2c[_0xd8aa('0x3b')][_0xd8aa('0x3c')]!==_0xd8aa('0x3d')){var _0x567b24={};_0x567b24[_0x1a4f2c['field']]={'$like':'%'+_0x1f2a28[_0xd8aa('0x2d')]['filter']+'%'};return _0x567b24;}})});}_0x214393=_[_0xd8aa('0x39')]({},_0x214393,_0x1f2a28[_0xd8aa('0x3e')]);var _0x8ffbe1={'where':_0x214393[_0xd8aa('0x37')]};return db[_0xd8aa('0x29')][_0xd8aa('0x18')](_0x8ffbe1)[_0xd8aa('0x20')](function(_0x3b0220){_0x19a59d[_0xd8aa('0x18')]=_0x3b0220;if(_0x1f2a28[_0xd8aa('0x2d')][_0xd8aa('0x3f')]){_0x214393['include']=[{'all':!![]}];}return db[_0xd8aa('0x29')][_0xd8aa('0x40')](_0x214393);})[_0xd8aa('0x20')](function(_0x4b1de0){_0x19a59d[_0xd8aa('0x41')]=_0x4b1de0;return _0x19a59d;})[_0xd8aa('0x20')](respondWithFilteredResult(_0x34b792,_0x214393))[_0xd8aa('0x42')](handleError(_0x34b792,null));};exports[_0xd8aa('0x43')]=function(_0x3a0284,_0x3bbb17){var _0x2b28f9={'raw':!![],'where':{'id':_0x3a0284[_0xd8aa('0x44')]['id']}},_0x4570b7={};_0x4570b7[_0xd8aa('0x2b')]=_[_0xd8aa('0x2c')](db[_0xd8aa('0x29')][_0xd8aa('0x2a')]);_0x4570b7[_0xd8aa('0x2d')]=_[_0xd8aa('0x2c')](_0x3a0284[_0xd8aa('0x2d')]);_0x4570b7[_0xd8aa('0x2e')]=_[_0xd8aa('0x30')](_0x4570b7['model'],_0x4570b7[_0xd8aa('0x2d')]);_0x2b28f9[_0xd8aa('0x2f')]=_[_0xd8aa('0x30')](_0x4570b7[_0xd8aa('0x2b')],qs[_0xd8aa('0x31')](_0x3a0284[_0xd8aa('0x2d')]['fields']));_0x2b28f9[_0xd8aa('0x2f')]=_0x2b28f9['attributes'][_0xd8aa('0x32')]?_0x2b28f9['attributes']:_0x4570b7[_0xd8aa('0x2b')];if(_0x3a0284['query']['includeAll']){_0x2b28f9[_0xd8aa('0x45')]=[{'all':!![]}];}_0x2b28f9=_[_0xd8aa('0x39')]({},_0x2b28f9,_0x3a0284[_0xd8aa('0x3e')]);return db[_0xd8aa('0x29')][_0xd8aa('0x46')](_0x2b28f9)[_0xd8aa('0x20')](handleEntityNotFound(_0x3bbb17,null))['then'](respondWithResult(_0x3bbb17,null))[_0xd8aa('0x42')](handleError(_0x3bbb17,null));};exports[_0xd8aa('0x47')]=function(_0x22325c,_0xf6728d){return db[_0xd8aa('0x29')]['create'](_0x22325c['body'],{})['then'](function(_0x1fd1dc){var _0x2a24ae=_0x22325c[_0xd8aa('0x48')][_0xd8aa('0x21')]({'plain':!![]});if(!_0x2a24ae)throw new Error(_0xd8aa('0x49'));if(_0x2a24ae[_0xd8aa('0x4a')]==='user'){var _0x221e2b=_0x1fd1dc[_0xd8aa('0x21')]({'plain':!![]});var _0x5a9055=_0xd8aa('0x22');return db[_0xd8aa('0x4b')][_0xd8aa('0x46')]({'where':{'name':_0x5a9055,'userProfileId':_0x2a24ae['userProfileId']},'raw':!![]})[_0xd8aa('0x20')](function(_0x625df9){if(_0x625df9&&_0x625df9[_0xd8aa('0x4c')]===0x0){return db[_0xd8aa('0x23')][_0xd8aa('0x47')]({'name':_0x221e2b[_0xd8aa('0x27')],'resourceId':_0x221e2b['id'],'type':_0x625df9['name'],'sectionId':_0x625df9['id']},{})['then'](function(){return _0x1fd1dc;});}else{return _0x1fd1dc;}})[_0xd8aa('0x42')](function(_0x2b5a82){logger[_0xd8aa('0x25')](_0xd8aa('0x4d'),_0x2b5a82);throw _0x2b5a82;});}return _0x1fd1dc;})[_0xd8aa('0x20')](respondWithResult(_0xf6728d,0xc9))[_0xd8aa('0x42')](handleError(_0xf6728d,null));};exports[_0xd8aa('0x1f')]=function(_0x4f9d21,_0x9db7e3){if(_0x4f9d21[_0xd8aa('0x4e')]['id']){delete _0x4f9d21['body']['id'];}return db[_0xd8aa('0x29')]['find']({'where':{'id':_0x4f9d21[_0xd8aa('0x44')]['id']}})[_0xd8aa('0x20')](handleEntityNotFound(_0x9db7e3,null))[_0xd8aa('0x20')](saveUpdates(_0x4f9d21['body'],null))['then'](respondWithResult(_0x9db7e3,null))['catch'](handleError(_0x9db7e3,null));};exports['destroy']=function(_0x406472,_0x1f22cd){return db[_0xd8aa('0x29')]['find']({'where':{'id':_0x406472['params']['id']}})['then'](handleEntityNotFound(_0x1f22cd,null))[_0xd8aa('0x20')](removeEntity(_0x1f22cd,null))[_0xd8aa('0x42')](handleError(_0x1f22cd,null));}; \ No newline at end of file +var _0xcb22=['sendStatus','error','stack','name','send','index','Disposition','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','sort','pick','filters','filter','merge','where','map','key','VIRTUAL','field','options','include','findAll','rows','show','params','find','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','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','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','apply','reject','save','update','destroy','then','get','Dispositions','UserProfileResource'];(function(_0x48be12,_0x40c85a){var _0x531e44=function(_0x479124){while(--_0x479124){_0x48be12['push'](_0x48be12['shift']());}};_0x531e44(++_0x40c85a);}(_0xcb22,0xc8));var _0x2cb2=function(_0x2d638f,_0x828e1e){_0x2d638f=_0x2d638f-0x0;var _0x5a59ed=_0xcb22[_0x2d638f];return _0x5a59ed;};'use strict';var pdf=require(_0x2cb2('0x0'));var emlformat=require(_0x2cb2('0x1'));var rimraf=require(_0x2cb2('0x2'));var zipdir=require(_0x2cb2('0x3'));var jsonpatch=require(_0x2cb2('0x4'));var rp=require(_0x2cb2('0x5'));var moment=require(_0x2cb2('0x6'));var BPromise=require(_0x2cb2('0x7'));var Mustache=require(_0x2cb2('0x8'));var util=require(_0x2cb2('0x9'));var path=require(_0x2cb2('0xa'));var sox=require('sox');var csv=require(_0x2cb2('0xb'));var ejs=require(_0x2cb2('0xc'));var fs=require('fs');var _=require(_0x2cb2('0xd'));var squel=require(_0x2cb2('0xe'));var crypto=require(_0x2cb2('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x2cb2('0x10'));var toCsv=require(_0x2cb2('0xb'));var querystring=require('querystring');var Papa=require(_0x2cb2('0x11'));var Redis=require(_0x2cb2('0x12'));var authService=require(_0x2cb2('0x13'));var qs=require(_0x2cb2('0x14'));var hardwareService=require(_0x2cb2('0x15'));var logger=require(_0x2cb2('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x2cb2('0x17'));var db=require(_0x2cb2('0x18'))['db'];function respondWithStatusCode(_0x5429d7,_0x4c8728){_0x4c8728=_0x4c8728||0xcc;return function(_0x9311fa){if(_0x9311fa){return _0x5429d7['sendStatus'](_0x4c8728);}return _0x5429d7[_0x2cb2('0x19')](_0x4c8728)['end']();};}function respondWithResult(_0xecefad,_0x22cb3d){_0x22cb3d=_0x22cb3d||0xc8;return function(_0x529c51){if(_0x529c51){return _0xecefad[_0x2cb2('0x19')](_0x22cb3d)[_0x2cb2('0x1a')](_0x529c51);}};}function respondWithFilteredResult(_0x1905e4,_0x52fee2){return function(_0xeed9cf){if(_0xeed9cf){var _0x62121=_0xeed9cf[_0x2cb2('0x1b')],_0x58d9b4=_0x52fee2[_0x2cb2('0x1c')],_0x181ef1=_0x52fee2[_0x2cb2('0x1c')]+_0x52fee2[_0x2cb2('0x1d')],_0x4aa895;if(_0x181ef1>=_0x62121){_0x181ef1=_0x62121;_0x4aa895=0xc8;}else{_0x4aa895=0xce;}_0x1905e4[_0x2cb2('0x19')](_0x4aa895);return _0x1905e4[_0x2cb2('0x1e')]('Content-Range',_0x58d9b4+'-'+_0x181ef1+'/'+_0x62121)['json'](_0xeed9cf);}return null;};}function patchUpdates(_0x5add6c){return function(_0x488ae5){try{jsonpatch[_0x2cb2('0x1f')](_0x488ae5,_0x5add6c,!![]);}catch(_0x46ba55){return BPromise[_0x2cb2('0x20')](_0x46ba55);}return _0x488ae5[_0x2cb2('0x21')]();};}function saveUpdates(_0x4d72a2,_0x1300d7){return function(_0x10bd4a){if(_0x10bd4a){return _0x10bd4a[_0x2cb2('0x22')](_0x4d72a2)['then'](function(_0x3d64c5){return _0x3d64c5;});}return null;};}function removeEntity(_0x42a222,_0x3203fb){return function(_0x2c1831){if(_0x2c1831){return _0x2c1831[_0x2cb2('0x23')]()[_0x2cb2('0x24')](function(){var _0x47c3ff=_0x2c1831[_0x2cb2('0x25')]({'plain':!![]});var _0x312bab=_0x2cb2('0x26');return db[_0x2cb2('0x27')][_0x2cb2('0x23')]({'where':{'type':_0x312bab,'resourceId':_0x47c3ff['id']}})[_0x2cb2('0x24')](function(){return _0x2c1831;});})[_0x2cb2('0x24')](function(){_0x42a222[_0x2cb2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c217c,_0xbef964){return function(_0x14c68b){if(!_0x14c68b){_0x1c217c[_0x2cb2('0x28')](0x194);}return _0x14c68b;};}function handleError(_0x121f18,_0x1c5228){_0x1c5228=_0x1c5228||0x1f4;return function(_0x18b507){logger[_0x2cb2('0x29')](_0x18b507[_0x2cb2('0x2a')]);if(_0x18b507[_0x2cb2('0x2b')]){delete _0x18b507[_0x2cb2('0x2b')];}_0x121f18['status'](_0x1c5228)[_0x2cb2('0x2c')](_0x18b507);};}exports[_0x2cb2('0x2d')]=function(_0x10aee3,_0x1e0040){var _0x1dd178={},_0x200067={},_0xb33189={'count':0x0,'rows':[]};var _0x54d708=db[_0x2cb2('0x2e')]['rawAttributes'];_0x200067['model']=_[_0x2cb2('0x2f')](_0x54d708);_0x200067['query']=_[_0x2cb2('0x2f')](_0x10aee3['query']);_0x200067['filters']=_[_0x2cb2('0x30')](_0x200067[_0x2cb2('0x31')],_0x200067[_0x2cb2('0x32')]);_0x1dd178[_0x2cb2('0x33')]=_[_0x2cb2('0x30')](_0x200067[_0x2cb2('0x31')],qs[_0x2cb2('0x34')](_0x10aee3[_0x2cb2('0x32')][_0x2cb2('0x34')]));_0x1dd178['attributes']=_0x1dd178[_0x2cb2('0x33')][_0x2cb2('0x35')]?_0x1dd178['attributes']:_0x200067[_0x2cb2('0x31')];if(!_0x10aee3[_0x2cb2('0x32')][_0x2cb2('0x36')]('nolimit')){_0x1dd178['limit']=qs[_0x2cb2('0x1d')](_0x10aee3[_0x2cb2('0x32')][_0x2cb2('0x1d')]);_0x1dd178['offset']=qs[_0x2cb2('0x1c')](_0x10aee3[_0x2cb2('0x32')]['offset']);}_0x1dd178['order']=qs[_0x2cb2('0x37')](_0x10aee3[_0x2cb2('0x32')][_0x2cb2('0x37')]);_0x1dd178['where']=qs['filters'](_[_0x2cb2('0x38')](_0x10aee3[_0x2cb2('0x32')],_0x200067[_0x2cb2('0x39')]));if(_0x10aee3[_0x2cb2('0x32')][_0x2cb2('0x3a')]){_0x1dd178['where']=_[_0x2cb2('0x3b')](_0x1dd178[_0x2cb2('0x3c')],{'$or':_[_0x2cb2('0x3d')](_0x54d708,function(_0x4af179){if(_0x4af179['type'][_0x2cb2('0x3e')]!==_0x2cb2('0x3f')){var _0x1d06d0={};_0x1d06d0[_0x4af179[_0x2cb2('0x40')]]={'$like':'%'+_0x10aee3[_0x2cb2('0x32')][_0x2cb2('0x3a')]+'%'};return _0x1d06d0;}})});}_0x1dd178=_['merge']({},_0x1dd178,_0x10aee3[_0x2cb2('0x41')]);var _0x1e88cc={'where':_0x1dd178[_0x2cb2('0x3c')]};return db[_0x2cb2('0x2e')][_0x2cb2('0x1b')](_0x1e88cc)[_0x2cb2('0x24')](function(_0x1e2dcf){_0xb33189[_0x2cb2('0x1b')]=_0x1e2dcf;if(_0x10aee3[_0x2cb2('0x32')]['includeAll']){_0x1dd178[_0x2cb2('0x42')]=[{'all':!![]}];}return db['Disposition'][_0x2cb2('0x43')](_0x1dd178);})['then'](function(_0x1f7f67){_0xb33189[_0x2cb2('0x44')]=_0x1f7f67;return _0xb33189;})[_0x2cb2('0x24')](respondWithFilteredResult(_0x1e0040,_0x1dd178))['catch'](handleError(_0x1e0040,null));};exports[_0x2cb2('0x45')]=function(_0x39a6ff,_0x113957){var _0x44e3aa={'raw':!![],'where':{'id':_0x39a6ff[_0x2cb2('0x46')]['id']}},_0x1366d8={};_0x1366d8[_0x2cb2('0x31')]=_[_0x2cb2('0x2f')](db[_0x2cb2('0x2e')]['rawAttributes']);_0x1366d8[_0x2cb2('0x32')]=_[_0x2cb2('0x2f')](_0x39a6ff['query']);_0x1366d8['filters']=_[_0x2cb2('0x30')](_0x1366d8[_0x2cb2('0x31')],_0x1366d8['query']);_0x44e3aa[_0x2cb2('0x33')]=_[_0x2cb2('0x30')](_0x1366d8['model'],qs['fields'](_0x39a6ff[_0x2cb2('0x32')][_0x2cb2('0x34')]));_0x44e3aa['attributes']=_0x44e3aa[_0x2cb2('0x33')][_0x2cb2('0x35')]?_0x44e3aa['attributes']:_0x1366d8['model'];if(_0x39a6ff['query']['includeAll']){_0x44e3aa[_0x2cb2('0x42')]=[{'all':!![]}];}_0x44e3aa=_[_0x2cb2('0x3b')]({},_0x44e3aa,_0x39a6ff['options']);return db[_0x2cb2('0x2e')][_0x2cb2('0x47')](_0x44e3aa)[_0x2cb2('0x24')](handleEntityNotFound(_0x113957,null))[_0x2cb2('0x24')](respondWithResult(_0x113957,null))[_0x2cb2('0x48')](handleError(_0x113957,null));};exports['create']=function(_0x27d883,_0x4a8b1d){return db['Disposition']['create'](_0x27d883['body'],{})[_0x2cb2('0x24')](function(_0x118a7a){var _0x71d263=_0x27d883[_0x2cb2('0x49')]['get']({'plain':!![]});if(!_0x71d263)throw new Error(_0x2cb2('0x4a'));if(_0x71d263[_0x2cb2('0x4b')]===_0x2cb2('0x49')){var _0x2f2000=_0x118a7a['get']({'plain':!![]});var _0x41ec95=_0x2cb2('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x41ec95,'userProfileId':_0x71d263[_0x2cb2('0x4c')]},'raw':!![]})[_0x2cb2('0x24')](function(_0x3ccca1){if(_0x3ccca1&&_0x3ccca1[_0x2cb2('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x2f2000[_0x2cb2('0x2b')],'resourceId':_0x2f2000['id'],'type':_0x3ccca1[_0x2cb2('0x2b')],'sectionId':_0x3ccca1['id']},{})[_0x2cb2('0x24')](function(){return _0x118a7a;});}else{return _0x118a7a;}})[_0x2cb2('0x48')](function(_0x112d98){logger[_0x2cb2('0x29')](_0x2cb2('0x4e'),_0x112d98);throw _0x112d98;});}return _0x118a7a;})[_0x2cb2('0x24')](respondWithResult(_0x4a8b1d,0xc9))[_0x2cb2('0x48')](handleError(_0x4a8b1d,null));};exports[_0x2cb2('0x22')]=function(_0x299052,_0x1fd5e7){if(_0x299052[_0x2cb2('0x4f')]['id']){delete _0x299052['body']['id'];}return db[_0x2cb2('0x2e')]['find']({'where':{'id':_0x299052[_0x2cb2('0x46')]['id']}})[_0x2cb2('0x24')](handleEntityNotFound(_0x1fd5e7,null))[_0x2cb2('0x24')](saveUpdates(_0x299052['body'],null))[_0x2cb2('0x24')](respondWithResult(_0x1fd5e7,null))[_0x2cb2('0x48')](handleError(_0x1fd5e7,null));};exports[_0x2cb2('0x23')]=function(_0x9742e4,_0x51effb){return db[_0x2cb2('0x2e')][_0x2cb2('0x47')]({'where':{'id':_0x9742e4['params']['id']}})[_0x2cb2('0x24')](handleEntityNotFound(_0x51effb,null))[_0x2cb2('0x24')](removeEntity(_0x51effb,null))['catch'](handleError(_0x51effb,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 2c650a1..3edfd0c 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 _0x62c6=['define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','name_sms','name_fax','name_openchannel','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./disposition.attributes','exports'];(function(_0x4eba65,_0x1566c6){var _0x4341c2=function(_0xbc58c8){while(--_0xbc58c8){_0x4eba65['push'](_0x4eba65['shift']());}};_0x4341c2(++_0x1566c6);}(_0x62c6,0xb4));var _0x662c=function(_0x3f16d8,_0x26e969){_0x3f16d8=_0x3f16d8-0x0;var _0xc3809a=_0x62c6[_0x3f16d8];return _0xc3809a;};'use strict';var _=require(_0x662c('0x0'));var util=require(_0x662c('0x1'));var logger=require(_0x662c('0x2'))(_0x662c('0x3'));var moment=require('moment');var BPromise=require(_0x662c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x662c('0x5'));var rimraf=require('rimraf');var config=require(_0x662c('0x6'));var attributes=require(_0x662c('0x7'));module[_0x662c('0x8')]=function(_0xb935d,_0x1f6ac5){return _0xb935d[_0x662c('0x9')](_0x662c('0xa'),attributes,{'tableName':_0x662c('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x662c('0xc'),'fields':[_0x662c('0xd'),_0x662c('0xe')]},{'unique':!![],'name':_0x662c('0xf'),'fields':[_0x662c('0xd'),_0x662c('0x10')]},{'unique':!![],'name':'name_mail','fields':[_0x662c('0xd'),_0x662c('0x11')]},{'unique':!![],'name':_0x662c('0x12'),'fields':[_0x662c('0xd'),'SmsAccountId']},{'unique':!![],'name':_0x662c('0x13'),'fields':[_0x662c('0xd'),'FaxAccountId']},{'unique':!![],'name':_0x662c('0x14'),'fields':['name','OpenchannelAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x381c=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./disposition.attributes','exports','define','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel'];(function(_0x30e6b7,_0x4dd58a){var _0x3c00c1=function(_0x3474ea){while(--_0x3474ea){_0x30e6b7['push'](_0x30e6b7['shift']());}};_0x3c00c1(++_0x4dd58a);}(_0x381c,0x19e));var _0xc381=function(_0x4e3374,_0x436671){_0x4e3374=_0x4e3374-0x0;var _0xcb6f8=_0x381c[_0x4e3374];return _0xcb6f8;};'use strict';var _=require(_0xc381('0x0'));var util=require(_0xc381('0x1'));var logger=require(_0xc381('0x2'))('api');var moment=require(_0xc381('0x3'));var BPromise=require(_0xc381('0x4'));var rp=require(_0xc381('0x5'));var fs=require('fs');var path=require(_0xc381('0x6'));var rimraf=require(_0xc381('0x7'));var config=require('../../config/environment');var attributes=require(_0xc381('0x8'));module[_0xc381('0x9')]=function(_0x4140d0,_0x32ad71){return _0x4140d0[_0xc381('0xa')]('Disposition',attributes,{'tableName':_0xc381('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xc381('0xc'),'fields':[_0xc381('0xd'),_0xc381('0xe')]},{'unique':!![],'name':_0xc381('0xf'),'fields':[_0xc381('0xd'),_0xc381('0x10')]},{'unique':!![],'name':_0xc381('0x11'),'fields':[_0xc381('0xd'),_0xc381('0x12')]},{'unique':!![],'name':_0xc381('0x13'),'fields':['name',_0xc381('0x14')]},{'unique':!![],'name':'name_fax','fields':[_0xc381('0xd'),_0xc381('0x15')]},{'unique':!![],'name':_0xc381('0x16'),'fields':[_0xc381('0xd'),'OpenchannelAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index a9e9a0a..00cfc8c 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 _0xc33c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment'];(function(_0x2f0e4d,_0x1b1d1b){var _0x457710=function(_0x2fd035){while(--_0x2fd035){_0x2f0e4d['push'](_0x2f0e4d['shift']());}};_0x457710(++_0x1b1d1b);}(_0xc33c,0x1de));var _0xcc33=function(_0x336612,_0x1864e3){_0x336612=_0x336612-0x0;var _0x44e218=_0xc33c[_0x336612];return _0x44e218;};'use strict';var _=require('lodash');var util=require(_0xcc33('0x0'));var moment=require(_0xcc33('0x1'));var BPromise=require(_0xcc33('0x2'));var rs=require(_0xcc33('0x3'));var fs=require('fs');var Redis=require(_0xcc33('0x4'));var db=require(_0xcc33('0x5'))['db'];var utils=require(_0xcc33('0x6'));var logger=require('../../config/logger')(_0xcc33('0x7'));var config=require(_0xcc33('0x8'));var jayson=require(_0xcc33('0x9'));var client=jayson[_0xcc33('0xa')][_0xcc33('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25af5b,_0x3c15be,_0x4a5afc){return new BPromise(function(_0xe6b30b,_0x50d2f2){return client[_0xcc33('0xc')](_0x25af5b,_0x4a5afc)[_0xcc33('0xd')](function(_0x26fd19){logger[_0xcc33('0xe')](_0xcc33('0xf'),_0x3c15be,_0xcc33('0x10'));logger['debug'](_0xcc33('0x11'),_0x3c15be,'request\x20sent',JSON[_0xcc33('0x12')](_0x26fd19));if(_0x26fd19['error']){if(_0x26fd19[_0xcc33('0x13')][_0xcc33('0x14')]===0x1f4){logger[_0xcc33('0x13')](_0xcc33('0xf'),_0x3c15be,_0x26fd19[_0xcc33('0x13')][_0xcc33('0x15')]);return _0x50d2f2(_0x26fd19[_0xcc33('0x13')]['message']);}logger[_0xcc33('0x13')](_0xcc33('0xf'),_0x3c15be,_0x26fd19[_0xcc33('0x13')][_0xcc33('0x15')]);return _0xe6b30b(_0x26fd19[_0xcc33('0x13')][_0xcc33('0x15')]);}else{logger[_0xcc33('0xe')]('Disposition,\x20%s,\x20%s',_0x3c15be,_0xcc33('0x10'));_0xe6b30b(_0x26fd19[_0xcc33('0x16')][_0xcc33('0x15')]);}})[_0xcc33('0x17')](function(_0x362f02){logger[_0xcc33('0x13')](_0xcc33('0xf'),_0x3c15be,_0x362f02);_0x50d2f2(_0x362f02);});});} \ No newline at end of file +var _0xdcb0=['Disposition,\x20%s,\x20%s,\x20%s','stringify','error','Disposition,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x3fc150,_0x1eaff1){var _0x2c1304=function(_0x195f4f){while(--_0x195f4f){_0x3fc150['push'](_0x3fc150['shift']());}};_0x2c1304(++_0x1eaff1);}(_0xdcb0,0x127));var _0x0dcb=function(_0x306d09,_0x4a36d0){_0x306d09=_0x306d09-0x0;var _0x170b24=_0xdcb0[_0x306d09];return _0x170b24;};'use strict';var _=require(_0x0dcb('0x0'));var util=require(_0x0dcb('0x1'));var moment=require(_0x0dcb('0x2'));var BPromise=require(_0x0dcb('0x3'));var rs=require(_0x0dcb('0x4'));var fs=require('fs');var Redis=require(_0x0dcb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0dcb('0x6'));var logger=require(_0x0dcb('0x7'))(_0x0dcb('0x8'));var config=require(_0x0dcb('0x9'));var jayson=require(_0x0dcb('0xa'));var client=jayson[_0x0dcb('0xb')][_0x0dcb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x54e87a,_0x941acd,_0x4c44a9){return new BPromise(function(_0x8e51d2,_0x3cbf96){return client[_0x0dcb('0xd')](_0x54e87a,_0x4c44a9)['then'](function(_0x2002ab){logger[_0x0dcb('0xe')]('Disposition,\x20%s,\x20%s',_0x941acd,_0x0dcb('0xf'));logger[_0x0dcb('0x10')](_0x0dcb('0x11'),_0x941acd,_0x0dcb('0xf'),JSON[_0x0dcb('0x12')](_0x2002ab));if(_0x2002ab[_0x0dcb('0x13')]){if(_0x2002ab[_0x0dcb('0x13')]['code']===0x1f4){logger[_0x0dcb('0x13')](_0x0dcb('0x14'),_0x941acd,_0x2002ab[_0x0dcb('0x13')][_0x0dcb('0x15')]);return _0x3cbf96(_0x2002ab[_0x0dcb('0x13')][_0x0dcb('0x15')]);}logger[_0x0dcb('0x13')](_0x0dcb('0x14'),_0x941acd,_0x2002ab['error'][_0x0dcb('0x15')]);return _0x8e51d2(_0x2002ab[_0x0dcb('0x13')][_0x0dcb('0x15')]);}else{logger[_0x0dcb('0xe')](_0x0dcb('0x14'),_0x941acd,_0x0dcb('0xf'));_0x8e51d2(_0x2002ab[_0x0dcb('0x16')][_0x0dcb('0x15')]);}})[_0x0dcb('0x17')](function(_0x3b1bb2){logger[_0x0dcb('0x13')](_0x0dcb('0x14'),_0x941acd,_0x3b1bb2);_0x3cbf96(_0x3b1bb2);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 2f1bc9c..71ab888 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 _0xc893=['path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','show','update','delete','destroy','exports','util'];(function(_0x678da6,_0x2e1fde){var _0x560590=function(_0x5e7280){while(--_0x5e7280){_0x678da6['push'](_0x678da6['shift']());}};_0x560590(++_0x2e1fde);}(_0xc893,0x194));var _0x3c89=function(_0x41717e,_0x2d95ed){_0x41717e=_0x41717e-0x0;var _0xcf931d=_0xc893[_0x41717e];return _0xcf931d;};'use strict';var multer=require('multer');var util=require(_0x3c89('0x0'));var path=require(_0x3c89('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3c89('0x2')]();var auth=require(_0x3c89('0x3'));var interaction=require(_0x3c89('0x4'));var config=require(_0x3c89('0x5'));var controller=require(_0x3c89('0x6'));router[_0x3c89('0x7')]('/',auth[_0x3c89('0x8')](),controller['index']);router[_0x3c89('0x7')](_0x3c89('0x9'),auth[_0x3c89('0x8')](),controller[_0x3c89('0xa')]);router['post']('/',auth[_0x3c89('0x8')](),controller['create']);router['put'](_0x3c89('0x9'),auth['isAuthenticated'](),controller[_0x3c89('0xb')]);router[_0x3c89('0xc')]('/:id',auth[_0x3c89('0x8')](),controller[_0x3c89('0xd')]);module[_0x3c89('0xe')]=router; \ No newline at end of file +var _0x0e56=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x147571,_0x3f2960){var _0x275681=function(_0x124066){while(--_0x124066){_0x147571['push'](_0x147571['shift']());}};_0x275681(++_0x3f2960);}(_0x0e56,0xf5));var _0x60e5=function(_0x41c88c,_0x381f8d){_0x41c88c=_0x41c88c-0x0;var _0x2c97ea=_0x0e56[_0x41c88c];return _0x2c97ea;};'use strict';var multer=require(_0x60e5('0x0'));var util=require(_0x60e5('0x1'));var path=require('path');var timeout=require(_0x60e5('0x2'));var express=require(_0x60e5('0x3'));var router=express['Router']();var auth=require(_0x60e5('0x4'));var interaction=require(_0x60e5('0x5'));var config=require(_0x60e5('0x6'));var controller=require(_0x60e5('0x7'));router[_0x60e5('0x8')]('/',auth[_0x60e5('0x9')](),controller[_0x60e5('0xa')]);router['get'](_0x60e5('0xb'),auth[_0x60e5('0x9')](),controller[_0x60e5('0xc')]);router[_0x60e5('0xd')]('/',auth['isAuthenticated'](),controller[_0x60e5('0xe')]);router[_0x60e5('0xf')](_0x60e5('0xb'),auth[_0x60e5('0x9')](),controller[_0x60e5('0x10')]);router[_0x60e5('0x11')](_0x60e5('0xb'),auth[_0x60e5('0x9')](),controller[_0x60e5('0x12')]);module[_0x60e5('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 8487244..138cfab 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 _0x345b=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','yes','localstationid','ENUM','4800','7200','9600','12000','14400','2400','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','TEXT','BOOLEAN'];(function(_0x15b05f,_0x721bb0){var _0x382820=function(_0x17e656){while(--_0x17e656){_0x15b05f['push'](_0x15b05f['shift']());}};_0x382820(++_0x721bb0);}(_0x345b,0x15d));var _0xb345=function(_0x14d54b,_0x1986ab){_0x14d54b=_0x14d54b-0x0;var _0x3e1f23=_0x345b[_0x14d54b];return _0x3e1f23;};'use strict';var Sequelize=require(_0xb345('0x0'));module[_0xb345('0x1')]={'name':{'type':Sequelize[_0xb345('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb345('0x2')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xb345('0x3')},'headerinfo':{'type':Sequelize[_0xb345('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xb345('0x2')],'unique':_0xb345('0x4')},'minrate':{'type':Sequelize[_0xb345('0x5')]('2400',_0xb345('0x6'),_0xb345('0x7'),_0xb345('0x8'),_0xb345('0x9'),_0xb345('0xa')),'defaultValue':_0xb345('0x6')},'maxrate':{'type':Sequelize['ENUM'](_0xb345('0xb'),_0xb345('0x6'),_0xb345('0x7'),_0xb345('0x8'),_0xb345('0x9'),'14400'),'defaultValue':_0xb345('0xa')},'modem':{'type':Sequelize[_0xb345('0x2')],'defaultValue':_0xb345('0xc')},'gateway':{'type':Sequelize[_0xb345('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xb345('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xb345('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xb345('0x5')](_0xb345('0xe'),'IAX',_0xb345('0xf'),_0xb345('0x10')),'defaultValue':_0xb345('0xe')},'key':{'type':Sequelize[_0xb345('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb345('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb345('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb345('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb345('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb345('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb345('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb345('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb345('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xb345('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xb345('0x12')],'defaultValue':![],'comment':_0xb345('0x14'),'set':function(_0x490c6e){if(!_0x490c6e)this[_0xb345('0x15')](_0xb345('0x16'),null);this['setDataValue']('mandatoryDisposition',_0x490c6e);}}}; \ No newline at end of file +var _0x5460=['12000','2400','14400','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','ENUM','yes','localstationid','4800','9600'];(function(_0x2c40ba,_0x51b89f){var _0x3a5281=function(_0x180d4a){while(--_0x180d4a){_0x2c40ba['push'](_0x2c40ba['shift']());}};_0x3a5281(++_0x51b89f);}(_0x5460,0x1de));var _0x0546=function(_0x2378d7,_0xd46258){_0x2378d7=_0x2378d7-0x0;var _0x58dc15=_0x5460[_0x2378d7];return _0x58dc15;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0546('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0546('0x0')]},'ecm':{'type':Sequelize[_0x0546('0x1')](_0x0546('0x2'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x0546('0x0')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x0546('0x0')],'unique':_0x0546('0x3')},'minrate':{'type':Sequelize[_0x0546('0x1')]('2400',_0x0546('0x4'),'7200',_0x0546('0x5'),_0x0546('0x6'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x0546('0x1')](_0x0546('0x7'),_0x0546('0x4'),'7200',_0x0546('0x5'),'12000',_0x0546('0x8')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x0546('0x0')],'defaultValue':_0x0546('0x9')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x0546('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x0546('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x0546('0x1')](_0x0546('0xb'),_0x0546('0xc'),'DADHI',_0x0546('0xd')),'defaultValue':_0x0546('0xb')},'key':{'type':Sequelize[_0x0546('0x0')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0546('0xe')],'defaultValue':function(){return _0x0546('0xf');}},'notificationSound':{'type':Sequelize[_0x0546('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0546('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0546('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0546('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0546('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0546('0xa')],'allowNull':!![],'defaultValue':null,'comment':_0x0546('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x0546('0x10')],'defaultValue':![],'comment':_0x0546('0x12'),'set':function(_0x5263bb){if(!_0x5263bb)this[_0x0546('0x13')](_0x0546('0x14'),null);this[_0x0546('0x13')](_0x0546('0x15'),_0x5263bb);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index e530930..fb6c7c8 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 _0x8952=['userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FaxAccount,\x20%s,\x20%s','message','info','result','status','json','count','offset','limit','set','apply','reject','save','UserProfileResource','end','sendStatus','stack','name','send','index','FaxAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','findAll','catch','show','params','Pause','mandatoryDispositionPause','include','create','get','role','FaxAccounts','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','sequelize','transaction','bulkCreate','FaxApplication','getApplications','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','updateAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','DESC','attachments','root','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','ListId','user','out','filename','Messages','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray'];(function(_0x125e0d,_0x1f5b21){var _0x3f0aca=function(_0x55590a){while(--_0x55590a){_0x125e0d['push'](_0x125e0d['shift']());}};_0x3f0aca(++_0x1f5b21);}(_0x8952,0x17e));var _0x2895=function(_0x3dd94d,_0x2e286d){_0x3dd94d=_0x3dd94d-0x0;var _0x588d6f=_0x8952[_0x3dd94d];return _0x588d6f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2895('0x0'));var rimraf=require(_0x2895('0x1'));var zipdir=require(_0x2895('0x2'));var jsonpatch=require(_0x2895('0x3'));var rp=require(_0x2895('0x4'));var moment=require('moment');var BPromise=require(_0x2895('0x5'));var Mustache=require(_0x2895('0x6'));var util=require(_0x2895('0x7'));var path=require('path');var sox=require(_0x2895('0x8'));var csv=require(_0x2895('0x9'));var ejs=require(_0x2895('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2895('0xb'));var jsforce=require(_0x2895('0xc'));var deskjs=require(_0x2895('0xd'));var toCsv=require(_0x2895('0x9'));var querystring=require(_0x2895('0xe'));var Papa=require('papaparse');var Redis=require(_0x2895('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2895('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2895('0x11'));var config=require(_0x2895('0x12'));var db=require(_0x2895('0x13'))['db'];config['redis']=_[_0x2895('0x14')](config[_0x2895('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x2895('0x16'))(new Redis(config[_0x2895('0x15')]));require('./faxAccount.socket')['register'](socket);var jayson=require(_0x2895('0x17'));var client=jayson[_0x2895('0x18')]['http']({'port':0x232c});var client9002=jayson[_0x2895('0x18')][_0x2895('0x19')]({'port':0x232a});function checkPasswordPattern(_0x27b50e,_0x1ae013,_0x1d3659){if(_0x1d3659){var _0x2627e6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2627e6[_0x2895('0x1a')](_0x1ae013)){return _0x27b50e;}else{throw new Error(_0x2895('0x1b'));}}else{return _0x27b50e;}}function respondWithRpcPromise(_0x3e96d7,_0x407b86,_0x10a1bf,_0x183b05){return new BPromise(function(_0xbf8b63,_0x2cb505){var _0x155124=_0x183b05||client;return _0x155124[_0x2895('0x1c')](_0x3e96d7,_0x10a1bf)[_0x2895('0x1d')](function(_0x1e8d47){logger['info']('FaxAccount,\x20%s,\x20%s',_0x407b86,'request\x20sent');logger[_0x2895('0x1e')](_0x2895('0x1f'),_0x407b86,_0x2895('0x20'),JSON['stringify'](_0x1e8d47));if(_0x1e8d47[_0x2895('0x21')]){if(_0x1e8d47[_0x2895('0x21')][_0x2895('0x22')]===0x1f4){logger[_0x2895('0x21')](_0x2895('0x23'),_0x407b86,_0x1e8d47['error'][_0x2895('0x24')]);return _0x2cb505(_0x1e8d47[_0x2895('0x21')]['message']);}logger[_0x2895('0x21')](_0x2895('0x23'),_0x407b86,_0x1e8d47[_0x2895('0x21')]['message']);return _0xbf8b63(_0x1e8d47['error'][_0x2895('0x24')]);}else{logger[_0x2895('0x25')](_0x2895('0x23'),_0x407b86,'request\x20sent');_0xbf8b63(_0x1e8d47[_0x2895('0x26')][_0x2895('0x24')]);}})['catch'](function(_0x293ad3){logger[_0x2895('0x21')](_0x2895('0x23'),_0x407b86,_0x293ad3);_0x2cb505(_0x293ad3);});});}function respondWithStatusCode(_0x5c6c21,_0x320661){_0x320661=_0x320661||0xcc;return function(_0x30f491){if(_0x30f491){return _0x5c6c21['sendStatus'](_0x320661);}return _0x5c6c21[_0x2895('0x27')](_0x320661)['end']();};}function respondWithResult(_0x5d70f5,_0x18a935){_0x18a935=_0x18a935||0xc8;return function(_0x4ee2cc){if(_0x4ee2cc){return _0x5d70f5[_0x2895('0x27')](_0x18a935)[_0x2895('0x28')](_0x4ee2cc);}};}function respondWithFilteredResult(_0x4fdd94,_0x5574bf){return function(_0x32db49){if(_0x32db49){var _0x30dc2f=_0x32db49[_0x2895('0x29')],_0x190e07=_0x5574bf[_0x2895('0x2a')],_0x14e343=_0x5574bf['offset']+_0x5574bf[_0x2895('0x2b')],_0x14d150;if(_0x14e343>=_0x30dc2f){_0x14e343=_0x30dc2f;_0x14d150=0xc8;}else{_0x14d150=0xce;}_0x4fdd94[_0x2895('0x27')](_0x14d150);return _0x4fdd94[_0x2895('0x2c')]('Content-Range',_0x190e07+'-'+_0x14e343+'/'+_0x30dc2f)[_0x2895('0x28')](_0x32db49);}return null;};}function patchUpdates(_0x458a55){return function(_0x31ab90){try{jsonpatch[_0x2895('0x2d')](_0x31ab90,_0x458a55,!![]);}catch(_0x5d59ea){return BPromise[_0x2895('0x2e')](_0x5d59ea);}return _0x31ab90[_0x2895('0x2f')]();};}function saveUpdates(_0x4765c9,_0x35091a){return function(_0x98df92){if(_0x98df92){return _0x98df92['update'](_0x4765c9)['then'](function(_0x123f4f){return _0x123f4f;});}return null;};}function removeEntity(_0xf3c8f7,_0x5bbf16){return function(_0x3abb80){if(_0x3abb80){return _0x3abb80['destroy']()[_0x2895('0x1d')](function(){var _0x3f73e1=_0x3abb80['get']({'plain':!![]});var _0x4780ed='FaxAccounts';return db[_0x2895('0x30')]['destroy']({'where':{'type':_0x4780ed,'resourceId':_0x3f73e1['id']}})['then'](function(){return _0x3abb80;});})[_0x2895('0x1d')](function(){_0xf3c8f7[_0x2895('0x27')](0xcc)[_0x2895('0x31')]();});}};}function handleEntityNotFound(_0x53fdc5,_0x1e4348){return function(_0x15772b){if(!_0x15772b){_0x53fdc5[_0x2895('0x32')](0x194);}return _0x15772b;};}function handleError(_0x3ff672,_0x3a4081){_0x3a4081=_0x3a4081||0x1f4;return function(_0x3a29ac){logger[_0x2895('0x21')](_0x3a29ac[_0x2895('0x33')]);if(_0x3a29ac[_0x2895('0x34')]){delete _0x3a29ac[_0x2895('0x34')];}_0x3ff672['status'](_0x3a4081)[_0x2895('0x35')](_0x3a29ac);};}exports[_0x2895('0x36')]=function(_0x47413d,_0x1e5788){var _0x41a66b={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x12d7d8={},_0x1c1d8e={'count':0x0,'rows':[]};var _0x2c2dd3=db[_0x2895('0x37')][_0x2895('0x38')];_0x12d7d8[_0x2895('0x39')]=_[_0x2895('0x3a')](_0x2c2dd3);_0x12d7d8[_0x2895('0x3b')]=_['keys'](_0x47413d['query']);_0x12d7d8[_0x2895('0x3c')]=_[_0x2895('0x3d')](_0x12d7d8['model'],_0x12d7d8['query']);_0x41a66b[_0x2895('0x3e')]=_[_0x2895('0x3d')](_0x12d7d8[_0x2895('0x39')],qs[_0x2895('0x3f')](_0x47413d[_0x2895('0x3b')][_0x2895('0x3f')]));_0x41a66b['attributes']=_0x41a66b[_0x2895('0x3e')][_0x2895('0x40')]?_0x41a66b[_0x2895('0x3e')]:_0x12d7d8[_0x2895('0x39')];if(!_0x47413d['query'][_0x2895('0x41')](_0x2895('0x42'))){_0x41a66b[_0x2895('0x2b')]=qs[_0x2895('0x2b')](_0x47413d['query']['limit']);_0x41a66b[_0x2895('0x2a')]=qs[_0x2895('0x2a')](_0x47413d[_0x2895('0x3b')][_0x2895('0x2a')]);}_0x41a66b[_0x2895('0x43')]=qs['sort'](_0x47413d['query'][_0x2895('0x44')]);_0x41a66b[_0x2895('0x45')]=qs[_0x2895('0x3c')](_[_0x2895('0x46')](_0x47413d[_0x2895('0x3b')],_0x12d7d8[_0x2895('0x3c')]));if(_0x47413d[_0x2895('0x3b')]['filter']){_0x41a66b[_0x2895('0x45')]=_[_0x2895('0x47')](_0x41a66b[_0x2895('0x45')],{'$or':_[_0x2895('0x48')](_0x2c2dd3,function(_0xbf6e6a){if(_0xbf6e6a[_0x2895('0x49')][_0x2895('0x4a')]!==_0x2895('0x4b')){var _0x549059={};_0x549059[_0xbf6e6a[_0x2895('0x4c')]]={'$like':'%'+_0x47413d[_0x2895('0x3b')][_0x2895('0x4d')]+'%'};return _0x549059;}})});}_0x41a66b=_['merge']({},_0x41a66b,_0x47413d[_0x2895('0x4e')]);var _0x5307a9={'where':_0x41a66b['where']};return db[_0x2895('0x37')][_0x2895('0x29')](_0x5307a9)[_0x2895('0x1d')](function(_0x34a84c){_0x1c1d8e[_0x2895('0x29')]=_0x34a84c;if(_0x47413d[_0x2895('0x3b')][_0x2895('0x4f')]){_0x41a66b['include']=[{'all':!![]}];}return db[_0x2895('0x37')][_0x2895('0x50')](_0x41a66b);})['then'](function(_0x4e1d47){_0x1c1d8e['rows']=_0x4e1d47;return _0x1c1d8e;})[_0x2895('0x1d')](respondWithFilteredResult(_0x1e5788,_0x41a66b))[_0x2895('0x51')](handleError(_0x1e5788,null));};exports[_0x2895('0x52')]=function(_0x1d2ab6,_0x35a03c){var _0x3c5261={'raw':![],'where':{'id':_0x1d2ab6[_0x2895('0x53')]['id']},'include':[{'model':db[_0x2895('0x54')],'as':_0x2895('0x55')}]},_0xaca46c={};_0xaca46c[_0x2895('0x39')]=_[_0x2895('0x3a')](db[_0x2895('0x37')][_0x2895('0x38')]);_0xaca46c[_0x2895('0x3b')]=_[_0x2895('0x3a')](_0x1d2ab6[_0x2895('0x3b')]);_0xaca46c[_0x2895('0x3c')]=_[_0x2895('0x3d')](_0xaca46c[_0x2895('0x39')],_0xaca46c[_0x2895('0x3b')]);_0x3c5261[_0x2895('0x3e')]=_[_0x2895('0x3d')](_0xaca46c[_0x2895('0x39')],qs[_0x2895('0x3f')](_0x1d2ab6[_0x2895('0x3b')][_0x2895('0x3f')]));_0x3c5261[_0x2895('0x3e')]=_0x3c5261[_0x2895('0x3e')][_0x2895('0x40')]?_0x3c5261[_0x2895('0x3e')]:_0xaca46c['model'];if(_0x1d2ab6[_0x2895('0x3b')][_0x2895('0x4f')]){_0x3c5261[_0x2895('0x56')]=[{'all':!![]}];}_0x3c5261=_[_0x2895('0x47')]({},_0x3c5261,_0x1d2ab6[_0x2895('0x4e')]);return db[_0x2895('0x37')]['find'](_0x3c5261)[_0x2895('0x1d')](handleEntityNotFound(_0x35a03c,null))['then'](respondWithResult(_0x35a03c,null))[_0x2895('0x51')](handleError(_0x35a03c,null));};exports[_0x2895('0x57')]=function(_0x319795,_0xebf4c5){return db[_0x2895('0x37')]['create'](_0x319795['body'],{})[_0x2895('0x1d')](function(_0x11d336){var _0x197503=_0x319795['user'][_0x2895('0x58')]({'plain':!![]});if(!_0x197503)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x197503[_0x2895('0x59')]==='user'){var _0x511b77=_0x11d336['get']({'plain':!![]});var _0x58cfd6=_0x2895('0x5a');return db[_0x2895('0x5b')][_0x2895('0x5c')]({'where':{'name':_0x58cfd6,'userProfileId':_0x197503[_0x2895('0x5d')]},'raw':!![]})[_0x2895('0x1d')](function(_0x422a61){if(_0x422a61&&_0x422a61[_0x2895('0x5e')]===0x0){return db['UserProfileResource'][_0x2895('0x57')]({'name':_0x511b77[_0x2895('0x34')],'resourceId':_0x511b77['id'],'type':_0x422a61['name'],'sectionId':_0x422a61['id']},{})[_0x2895('0x1d')](function(){return _0x11d336;});}else{return _0x11d336;}})['catch'](function(_0x5aa232){logger[_0x2895('0x21')](_0x2895('0x5f'),_0x5aa232);throw _0x5aa232;});}return _0x11d336;})['then'](respondWithResult(_0xebf4c5,0xc9))[_0x2895('0x51')](handleError(_0xebf4c5,null));};exports[_0x2895('0x60')]=function(_0x35d979,_0x6a0c18){if(_0x35d979['body']['id']){delete _0x35d979[_0x2895('0x61')]['id'];}return db['FaxAccount'][_0x2895('0x5c')]({'where':{'id':_0x35d979['params']['id']},'include':[{'model':db['Pause'],'as':_0x2895('0x55')}]})['then'](handleEntityNotFound(_0x6a0c18,null))[_0x2895('0x1d')](saveUpdates(_0x35d979[_0x2895('0x61')],null))[_0x2895('0x1d')](respondWithResult(_0x6a0c18,null))['catch'](handleError(_0x6a0c18,null));};exports[_0x2895('0x62')]=function(_0x115357,_0x5b6413){return db['FaxAccount'][_0x2895('0x5c')]({'where':{'id':_0x115357[_0x2895('0x53')]['id']}})['then'](handleEntityNotFound(_0x5b6413,null))[_0x2895('0x1d')](removeEntity(_0x5b6413,null))['catch'](handleError(_0x5b6413,null));};exports['describe']=function(_0x98b64d,_0x3241cb){return db[_0x2895('0x37')]['describe']()[_0x2895('0x1d')](respondWithResult(_0x3241cb,null))[_0x2895('0x51')](handleError(_0x3241cb,null));};exports[_0x2895('0x63')]=function(_0x1fe575,_0x3ad06e,_0x97a1df){if(_0x1fe575[_0x2895('0x61')]['id']){delete _0x1fe575['body']['id'];}return db[_0x2895('0x37')][_0x2895('0x5c')]({'where':{'id':_0x1fe575[_0x2895('0x53')]['id']}})[_0x2895('0x1d')](handleEntityNotFound(_0x3ad06e,null))[_0x2895('0x1d')](function(_0x66fc7e){if(_0x66fc7e){_0x1fe575[_0x2895('0x61')][_0x2895('0x64')]=_0x66fc7e['id'];return db['Disposition'][_0x2895('0x57')](_0x1fe575[_0x2895('0x61')]);}})[_0x2895('0x1d')](respondWithResult(_0x3ad06e,null))[_0x2895('0x51')](handleError(_0x3ad06e,null));};exports[_0x2895('0x65')]=function(_0x160d15,_0x24b5a5,_0xb1e70b){var _0x35ae08={'raw':![],'where':{}};var _0x2862aa={};var _0x53a270={'count':0x0,'rows':[]};return db[_0x2895('0x37')][_0x2895('0x66')]({'where':{'id':_0x160d15[_0x2895('0x53')]['id']}})[_0x2895('0x1d')](handleEntityNotFound(_0x24b5a5,null))[_0x2895('0x1d')](function(_0x44a516){if(_0x44a516){_0x2862aa[_0x2895('0x39')]=_[_0x2895('0x3a')](db[_0x2895('0x67')][_0x2895('0x38')]);_0x2862aa['query']=_[_0x2895('0x3a')](_0x160d15[_0x2895('0x3b')]);_0x2862aa[_0x2895('0x3c')]=_[_0x2895('0x3d')](_0x2862aa[_0x2895('0x39')],_0x2862aa['query']);_0x35ae08[_0x2895('0x3e')]=_[_0x2895('0x3d')](_0x2862aa['model'],qs['fields'](_0x160d15['query'][_0x2895('0x3f')]));_0x35ae08[_0x2895('0x3e')]=_0x35ae08[_0x2895('0x3e')][_0x2895('0x40')]?_0x35ae08[_0x2895('0x3e')]:_0x2862aa['model'];if(!_0x160d15['query'][_0x2895('0x41')]('nolimit')){_0x35ae08[_0x2895('0x2b')]=qs['limit'](_0x160d15[_0x2895('0x3b')][_0x2895('0x2b')]);_0x35ae08['offset']=qs[_0x2895('0x2a')](_0x160d15[_0x2895('0x3b')][_0x2895('0x2a')]);}_0x35ae08[_0x2895('0x43')]=qs['sort'](_0x160d15['query'][_0x2895('0x44')]);_0x35ae08['where']=qs['filters'](_[_0x2895('0x46')](_0x160d15[_0x2895('0x3b')],_0x2862aa[_0x2895('0x3c')]));_0x35ae08[_0x2895('0x45')]['FaxAccountId']=_0x44a516['id'];if(_0x160d15[_0x2895('0x3b')][_0x2895('0x4d')]){_0x35ae08[_0x2895('0x45')]=_[_0x2895('0x47')](_0x35ae08[_0x2895('0x45')],{'$or':_[_0x2895('0x48')](_0x35ae08[_0x2895('0x3e')],function(_0x3346c2){var _0x422b63={};_0x422b63[_0x3346c2]={'$like':'%'+_0x160d15[_0x2895('0x3b')][_0x2895('0x4d')]+'%'};return _0x422b63;})});}_0x35ae08=_[_0x2895('0x47')]({},_0x35ae08,_0x160d15['options']);return db[_0x2895('0x67')][_0x2895('0x29')]({'where':_0x35ae08[_0x2895('0x45')]})['then'](function(_0x1ee756){_0x53a270[_0x2895('0x29')]=_0x1ee756;if(_0x160d15['query'][_0x2895('0x4f')]){_0x35ae08[_0x2895('0x56')]=[{'all':!![]}];}return db[_0x2895('0x67')]['findAll'](_0x35ae08);})[_0x2895('0x1d')](function(_0x44b464){_0x53a270[_0x2895('0x68')]=_0x44b464;return _0x53a270;});}})[_0x2895('0x1d')](respondWithFilteredResult(_0x24b5a5,_0x35ae08))['catch'](handleError(_0x24b5a5,null));};exports[_0x2895('0x69')]=function(_0x210d1b,_0x465c50,_0x4aea3f){return db[_0x2895('0x37')]['find']({'where':{'id':_0x210d1b[_0x2895('0x53')]['id']}})[_0x2895('0x1d')](handleEntityNotFound(_0x465c50,null))[_0x2895('0x1d')](function(_0x253e07){if(_0x253e07){return _0x253e07['removeDispositions'](_0x210d1b[_0x2895('0x3b')][_0x2895('0x6a')]);}})[_0x2895('0x1d')](respondWithStatusCode(_0x465c50,null))['catch'](handleError(_0x465c50,null));};exports[_0x2895('0x6b')]=function(_0x58cddd,_0x2b8739,_0x14eef4){if(_0x58cddd['body']['id']){delete _0x58cddd['body']['id'];}return db[_0x2895('0x37')][_0x2895('0x5c')]({'where':{'id':_0x58cddd['params']['id']}})[_0x2895('0x1d')](handleEntityNotFound(_0x2b8739,null))[_0x2895('0x1d')](function(_0x5a6b19){if(_0x5a6b19){_0x58cddd[_0x2895('0x61')][_0x2895('0x64')]=_0x5a6b19['id'];return db[_0x2895('0x6c')][_0x2895('0x57')](_0x58cddd[_0x2895('0x61')]);}})['then'](respondWithResult(_0x2b8739,null))[_0x2895('0x51')](handleError(_0x2b8739,null));};exports[_0x2895('0x6d')]=function(_0x278d43,_0x2210f1,_0x6f546e){var _0x479270={'raw':![],'where':{}};var _0x3d414d={};var _0x289c14={'count':0x0,'rows':[]};return db[_0x2895('0x37')][_0x2895('0x66')]({'where':{'id':_0x278d43['params']['id']}})[_0x2895('0x1d')](handleEntityNotFound(_0x2210f1,null))[_0x2895('0x1d')](function(_0x198c58){if(_0x198c58){_0x3d414d[_0x2895('0x39')]=_['keys'](db[_0x2895('0x6c')][_0x2895('0x38')]);_0x3d414d[_0x2895('0x3b')]=_[_0x2895('0x3a')](_0x278d43[_0x2895('0x3b')]);_0x3d414d[_0x2895('0x3c')]=_['intersection'](_0x3d414d[_0x2895('0x39')],_0x3d414d[_0x2895('0x3b')]);_0x479270[_0x2895('0x3e')]=_['intersection'](_0x3d414d['model'],qs[_0x2895('0x3f')](_0x278d43[_0x2895('0x3b')][_0x2895('0x3f')]));_0x479270[_0x2895('0x3e')]=_0x479270[_0x2895('0x3e')]['length']?_0x479270[_0x2895('0x3e')]:_0x3d414d[_0x2895('0x39')];if(!_0x278d43[_0x2895('0x3b')]['hasOwnProperty']('nolimit')){_0x479270[_0x2895('0x2b')]=qs[_0x2895('0x2b')](_0x278d43[_0x2895('0x3b')]['limit']);_0x479270[_0x2895('0x2a')]=qs[_0x2895('0x2a')](_0x278d43[_0x2895('0x3b')][_0x2895('0x2a')]);}_0x479270['order']=qs[_0x2895('0x44')](_0x278d43[_0x2895('0x3b')][_0x2895('0x44')]);_0x479270[_0x2895('0x45')]=qs[_0x2895('0x3c')](_[_0x2895('0x46')](_0x278d43[_0x2895('0x3b')],_0x3d414d[_0x2895('0x3c')]));_0x479270[_0x2895('0x45')][_0x2895('0x64')]=_0x198c58['id'];if(_0x278d43[_0x2895('0x3b')][_0x2895('0x4d')]){_0x479270[_0x2895('0x45')]=_[_0x2895('0x47')](_0x479270['where'],{'$or':_['map'](_0x479270['attributes'],function(_0x4f47e2){var _0x440fbf={};_0x440fbf[_0x4f47e2]={'$like':'%'+_0x278d43[_0x2895('0x3b')][_0x2895('0x4d')]+'%'};return _0x440fbf;})});}_0x479270=_[_0x2895('0x47')]({},_0x479270,_0x278d43[_0x2895('0x4e')]);return db[_0x2895('0x6c')][_0x2895('0x29')]({'where':_0x479270[_0x2895('0x45')]})[_0x2895('0x1d')](function(_0x1ebe43){_0x289c14[_0x2895('0x29')]=_0x1ebe43;if(_0x278d43[_0x2895('0x3b')][_0x2895('0x4f')]){_0x479270[_0x2895('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2895('0x50')](_0x479270);})[_0x2895('0x1d')](function(_0x3122e1){_0x289c14['rows']=_0x3122e1;return _0x289c14;});}})['then'](respondWithFilteredResult(_0x2210f1,_0x479270))[_0x2895('0x51')](handleError(_0x2210f1,null));};exports[_0x2895('0x6e')]=function(_0x5c417d,_0x2348be,_0x58fca3){return db[_0x2895('0x37')][_0x2895('0x5c')]({'where':{'id':_0x5c417d[_0x2895('0x53')]['id']}})[_0x2895('0x1d')](handleEntityNotFound(_0x2348be,null))[_0x2895('0x1d')](function(_0x44d95d){if(_0x44d95d){return _0x44d95d[_0x2895('0x6e')](_0x5c417d['query'][_0x2895('0x6a')]);}})[_0x2895('0x1d')](respondWithStatusCode(_0x2348be,null))['catch'](handleError(_0x2348be,null));};exports[_0x2895('0x6f')]=function(_0x3b547e,_0x5297ec,_0x1cf787){return db[_0x2895('0x70')][_0x2895('0x5c')]({'where':{'id':_0x3b547e[_0x2895('0x53')]['id']}})[_0x2895('0x1d')](handleEntityNotFound(_0x5297ec,null))[_0x2895('0x1d')](function(_0x3cc020){if(_0x3cc020){return _0x3cc020[_0x2895('0x6f')](_0x3b547e[_0x2895('0x61')][_0x2895('0x6a')],_[_0x2895('0x71')](_0x3b547e[_0x2895('0x61')],[_0x2895('0x6a'),'id'])||{});}})[_0x2895('0x1d')](respondWithResult(_0x5297ec,null))['catch'](handleError(_0x5297ec,null));};exports[_0x2895('0x72')]=function(_0x70965c,_0x7151bc,_0x3a766d){var _0x3ea24c={'raw':![],'where':{}};var _0x335ff0={};var _0x28a430={'count':0x0,'rows':[]};return db['FaxAccount'][_0x2895('0x66')]({'where':{'id':_0x70965c['params']['id']}})[_0x2895('0x1d')](handleEntityNotFound(_0x7151bc,null))['then'](function(_0x204af3){if(_0x204af3){_0x335ff0[_0x2895('0x39')]=_[_0x2895('0x3a')](db[_0x2895('0x70')][_0x2895('0x38')]);_0x335ff0['query']=_[_0x2895('0x3a')](_0x70965c[_0x2895('0x3b')]);_0x335ff0[_0x2895('0x3c')]=_[_0x2895('0x3d')](_0x335ff0[_0x2895('0x39')],_0x335ff0[_0x2895('0x3b')]);_0x3ea24c[_0x2895('0x3e')]=_['intersection'](_0x335ff0[_0x2895('0x39')],qs[_0x2895('0x3f')](_0x70965c[_0x2895('0x3b')][_0x2895('0x3f')]));_0x3ea24c['attributes']=_0x3ea24c[_0x2895('0x3e')][_0x2895('0x40')]?_0x3ea24c[_0x2895('0x3e')]:_0x335ff0['model'];if(!_0x70965c[_0x2895('0x3b')][_0x2895('0x41')](_0x2895('0x42'))){_0x3ea24c[_0x2895('0x2b')]=qs[_0x2895('0x2b')](_0x70965c[_0x2895('0x3b')][_0x2895('0x2b')]);_0x3ea24c[_0x2895('0x2a')]=qs[_0x2895('0x2a')](_0x70965c[_0x2895('0x3b')][_0x2895('0x2a')]);}_0x3ea24c[_0x2895('0x43')]=qs[_0x2895('0x44')](_0x70965c[_0x2895('0x3b')][_0x2895('0x44')]);_0x3ea24c[_0x2895('0x45')]=qs[_0x2895('0x3c')](_[_0x2895('0x46')](_0x70965c[_0x2895('0x3b')],_0x335ff0['filters']));_0x3ea24c['where'][_0x2895('0x64')]=_0x204af3['id'];if(_0x70965c[_0x2895('0x3b')][_0x2895('0x4d')]){_0x3ea24c[_0x2895('0x45')]=_[_0x2895('0x47')](_0x3ea24c[_0x2895('0x45')],{'$or':_['map'](_0x3ea24c['attributes'],function(_0x51b96a){var _0x40d48c={};_0x40d48c[_0x51b96a]={'$like':'%'+_0x70965c['query'][_0x2895('0x4d')]+'%'};return _0x40d48c;})});}_0x3ea24c=_[_0x2895('0x47')]({},_0x3ea24c,_0x70965c[_0x2895('0x4e')]);return db['FaxInteraction'][_0x2895('0x29')]({'where':_0x3ea24c[_0x2895('0x45')]})[_0x2895('0x1d')](function(_0x5ecadc){_0x28a430[_0x2895('0x29')]=_0x5ecadc;if(_0x70965c[_0x2895('0x3b')][_0x2895('0x4f')]){_0x3ea24c[_0x2895('0x56')]=[{'model':db[_0x2895('0x73')],'as':_0x2895('0x74'),'required':![]},{'model':db[_0x2895('0x75')],'as':_0x2895('0x76'),'attributes':['name',_0x2895('0x77'),_0x2895('0x78')],'required':![]},{'model':db[_0x2895('0x79')],'as':_0x2895('0x7a'),'attributes':['id','name','color'],'where':_0x70965c[_0x2895('0x3b')][_0x2895('0x7b')]?{'id':_0x70965c[_0x2895('0x3b')][_0x2895('0x7b')]}:undefined,'required':_0x70965c[_0x2895('0x3b')][_0x2895('0x7b')]?!![]:![]}];}return db['FaxInteraction'][_0x2895('0x50')](_0x3ea24c);})[_0x2895('0x1d')](function(_0x1c40b6){_0x28a430[_0x2895('0x68')]=_0x1c40b6;return _0x28a430;});}})['then'](respondWithFilteredResult(_0x7151bc,_0x3ea24c))[_0x2895('0x51')](handleError(_0x7151bc,null));};exports['addApplications']=function(_0x5acade,_0x4fc300,_0x18b526){return db['FaxAccount']['findOne']({'where':{'id':_0x5acade['params']['id']}})['then'](handleEntityNotFound(_0x4fc300,null))['then'](function(_0x2bbb3e){if(_0x2bbb3e){return db[_0x2895('0x7c')][_0x2895('0x7d')](function(_0x12cea2){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x5acade['params']['id']},'transaction':_0x12cea2})[_0x2895('0x1d')](function(_0x193b44){var _0x2ee836=_[_0x2895('0x48')](_0x5acade[_0x2895('0x61')],function(_0x4e76ad){_0x4e76ad[_0x2895('0x64')]=_0x5acade[_0x2895('0x53')]['id'];return _0x4e76ad;});return db['FaxApplication'][_0x2895('0x7e')](_0x2ee836,{'transaction':_0x12cea2});});})[_0x2895('0x1d')](function(){return db[_0x2895('0x7f')]['findAndCountAll']({'where':{'FaxAccountId':_0x5acade[_0x2895('0x53')]['id']},'order':'priority'});});}})[_0x2895('0x1d')](respondWithResult(_0x4fc300,null))[_0x2895('0x51')](handleError(_0x4fc300,null));};exports[_0x2895('0x80')]=function(_0x1e7e56,_0x533f97,_0x32c94d){var _0x2ee2d2={};var _0x2a0036={};var _0x3fb18a;var _0x145cf9;return db['FaxAccount'][_0x2895('0x66')]({'where':{'id':_0x1e7e56[_0x2895('0x53')]['id']}})[_0x2895('0x1d')](handleEntityNotFound(_0x533f97,null))[_0x2895('0x1d')](function(_0x4489d2){if(_0x4489d2){_0x3fb18a=_0x4489d2;_0x2a0036[_0x2895('0x39')]=_['keys'](db['FaxApplication']['rawAttributes']);_0x2a0036[_0x2895('0x3b')]=_[_0x2895('0x3a')](_0x1e7e56[_0x2895('0x3b')]);_0x2a0036[_0x2895('0x3c')]=_[_0x2895('0x3d')](_0x2a0036[_0x2895('0x39')],_0x2a0036[_0x2895('0x3b')]);_0x2ee2d2[_0x2895('0x3e')]=_[_0x2895('0x3d')](_0x2a0036[_0x2895('0x39')],qs[_0x2895('0x3f')](_0x1e7e56['query'][_0x2895('0x3f')]));_0x2ee2d2['attributes']=_0x2ee2d2[_0x2895('0x3e')]['length']?_0x2ee2d2[_0x2895('0x3e')]:_0x2a0036[_0x2895('0x39')];_0x2ee2d2['order']=qs['sort'](_0x1e7e56[_0x2895('0x3b')][_0x2895('0x44')]);_0x2ee2d2[_0x2895('0x45')]=qs[_0x2895('0x3c')](_[_0x2895('0x46')](_0x1e7e56[_0x2895('0x3b')],_0x2a0036[_0x2895('0x3c')]));if(_0x1e7e56[_0x2895('0x3b')][_0x2895('0x4d')]){_0x2ee2d2[_0x2895('0x45')]=_[_0x2895('0x47')](_0x2ee2d2[_0x2895('0x45')],{'$or':_[_0x2895('0x48')](_0x2ee2d2[_0x2895('0x3e')],function(_0x5d9fd0){var _0x5f1c3e={};_0x5f1c3e[_0x5d9fd0]={'$like':'%'+_0x1e7e56[_0x2895('0x3b')]['filter']+'%'};return _0x5f1c3e;})});}_0x2ee2d2=_[_0x2895('0x47')]({},_0x2ee2d2,_0x1e7e56[_0x2895('0x4e')]);return _0x3fb18a[_0x2895('0x80')](_0x2ee2d2);}})[_0x2895('0x1d')](function(_0x38f137){if(_0x38f137){_0x145cf9=_0x38f137[_0x2895('0x40')];if(!_0x1e7e56[_0x2895('0x3b')][_0x2895('0x41')](_0x2895('0x42'))){_0x2ee2d2[_0x2895('0x2b')]=qs['limit'](_0x1e7e56[_0x2895('0x3b')][_0x2895('0x2b')]);_0x2ee2d2[_0x2895('0x2a')]=qs['offset'](_0x1e7e56[_0x2895('0x3b')][_0x2895('0x2a')]);}return _0x3fb18a[_0x2895('0x80')](_0x2ee2d2);}})[_0x2895('0x1d')](function(_0x4e46ff){if(_0x4e46ff){return _0x4e46ff?{'count':_0x145cf9,'rows':_0x4e46ff}:null;}})['then'](respondWithResult(_0x533f97,null))['catch'](handleError(_0x533f97,null));};function Extension(_0x56049,_0x32edce,_0xc730ed,_0x5073fa){this['context']=_0x2895('0x81');this['exten']=_0x56049[_0x2895('0x82')];this[_0x2895('0x83')]=_0x5073fa;this['type']=_0x2895('0x84');this[_0x2895('0x85')]=_0x2895('0x86');this['FaxAccountId']=_0x56049['id'];this[_0x2895('0x87')]=_0x32edce;this[_0x2895('0x88')]=_0xc730ed;}function createExtensionsReciveFax(_0x1723b3){var _0x1eb449=0x1;var _0x383734=[];_0x383734[_0x2895('0x89')](new Extension(_0x1723b3,_0x1eb449,'',_0x2895('0x8a')));_0x1eb449+=0x1;_0x383734['push'](new Extension(_0x1723b3,_0x1eb449,_0x2895('0x8b'),_0x2895('0x8c')));_0x1eb449+=0x1;for(var _0x55b152 in _0x1723b3){if(_0x1723b3[_0x2895('0x41')](_0x55b152)&&(_0x55b152===_0x2895('0x8d')||_0x55b152==='localstationid'||_0x55b152===_0x2895('0x8e')||_0x55b152===_0x2895('0x8f')||_0x55b152===_0x2895('0x90')||_0x55b152===_0x2895('0x91')||_0x55b152===_0x2895('0x92')||_0x55b152==='modem'||_0x55b152===_0x2895('0x93'))){_0x383734['push'](new Extension(_0x1723b3,_0x1eb449,_0x2895('0x94')+_0x55b152+')='+_0x1723b3[_0x55b152],_0x2895('0x8c')));_0x1eb449+=0x1;}}_0x383734['push'](new Extension(_0x1723b3,_0x1eb449,'6','Wait'));_0x1eb449+=0x1;_0x383734[_0x2895('0x89')](new Extension(_0x1723b3,_0x1eb449,_0x2895('0x95'),_0x2895('0x96')));_0x1eb449=0x0;return _0x383734;}exports['addAccountApplications']=function(_0x5230e3,_0x51af9c,_0x3f852e){var _0x2e67e4;return db[_0x2895('0x7c')][_0x2895('0x7d')](function(_0x2dbb16){return db[_0x2895('0x37')][_0x2895('0x57')](_0x5230e3['body'],{'transaction':_0x2dbb16})[_0x2895('0x1d')](function(_0x59de26){_0x2e67e4=_0x59de26['get']({'plain':!![]});return db['VoiceExtension'][_0x2895('0x7e')](createExtensionsReciveFax(_0x2e67e4),{'transaction':_0x2dbb16});});})[_0x2895('0x1d')](function(){return _0x2e67e4;})[_0x2895('0x1d')](respondWithResult(_0x51af9c,null))['catch'](handleError(_0x51af9c,null));};exports[_0x2895('0x97')]=function(_0x455a66,_0x3988ca,_0x1ceb55){var _0x30b1e5;return db['sequelize'][_0x2895('0x7d')](function(_0x758123){return db[_0x2895('0x37')]['update'](_0x455a66[_0x2895('0x61')],{'where':{'id':_0x455a66[_0x2895('0x61')]['id']},'transaction':_0x758123})['then'](function(_0xd3093d){return db[_0x2895('0x98')][_0x2895('0x62')]({'where':{'FaxAccountId':_0x455a66['body']['id']},'transaction':_0x758123})[_0x2895('0x1d')](function(_0x356b2b){return db[_0x2895('0x98')][_0x2895('0x7e')](createExtensionsReciveFax(_[_0x2895('0x71')](_0x455a66[_0x2895('0x61')],[_0x2895('0x99'),'key',_0x2895('0x9a'),_0x2895('0x9b'),_0x2895('0x9c'),'ListId'])),{'transaction':_0x758123});});});})[_0x2895('0x1d')](function(){return db['FaxAccount']['findById'](_0x455a66[_0x2895('0x61')]['id']);})['then'](respondWithResult(_0x3988ca,null))[_0x2895('0x51')](handleError(_0x3988ca,null));};exports[_0x2895('0x9d')]=function(_0x19304a,_0x551139,_0x4f9640){var _0x217d91={'raw':!![],'where':{}};var _0x47c608={};var _0x2378b4={'count':0x0,'rows':[]};return db[_0x2895('0x37')][_0x2895('0x66')]({'where':{'id':_0x19304a[_0x2895('0x53')]['id']}})['then'](handleEntityNotFound(_0x551139,null))[_0x2895('0x1d')](function(_0xdeee40){if(_0xdeee40){_0x47c608['model']=_[_0x2895('0x3a')](db[_0x2895('0x9e')][_0x2895('0x38')]);_0x47c608[_0x2895('0x3b')]=_[_0x2895('0x3a')](_0x19304a[_0x2895('0x3b')]);_0x47c608[_0x2895('0x3c')]=_[_0x2895('0x3d')](_0x47c608['model'],_0x47c608[_0x2895('0x3b')]);_0x217d91['attributes']=_['intersection'](_0x47c608[_0x2895('0x39')],qs['fields'](_0x19304a[_0x2895('0x3b')][_0x2895('0x3f')]));_0x217d91['attributes']=_0x217d91['attributes'][_0x2895('0x40')]?_0x217d91[_0x2895('0x3e')]:_0x47c608[_0x2895('0x39')];if(!_0x19304a['query'][_0x2895('0x41')]('nolimit')){_0x217d91[_0x2895('0x2b')]=qs[_0x2895('0x2b')](_0x19304a[_0x2895('0x3b')][_0x2895('0x2b')]);_0x217d91['offset']=qs['offset'](_0x19304a['query']['offset']);}_0x217d91[_0x2895('0x43')]=qs['sort'](_0x19304a[_0x2895('0x3b')][_0x2895('0x44')]);_0x217d91[_0x2895('0x45')]=qs[_0x2895('0x3c')](_[_0x2895('0x46')](_0x19304a[_0x2895('0x3b')],_0x47c608[_0x2895('0x3c')]));_0x217d91[_0x2895('0x45')]['FaxAccountId']=_0xdeee40['id'];if(_0x19304a['query']['filter']){_0x217d91[_0x2895('0x45')]=_['merge'](_0x217d91[_0x2895('0x45')],{'$or':_[_0x2895('0x48')](_0x217d91[_0x2895('0x3e')],function(_0x2ebc8f){var _0x58a8a7={};_0x58a8a7[_0x2ebc8f]={'$like':'%'+_0x19304a['query'][_0x2895('0x4d')]+'%'};return _0x58a8a7;})});}if(_0x19304a['query']['$gte']){var _0x53790f=_0x19304a[_0x2895('0x3b')][_0x2895('0x9f')][_0x2895('0xa0')](',');var _0x162e48={};_0x162e48[_0x53790f[0x0]]={'$gte':moment(_0x53790f[0x1])[_0x2895('0xa1')](_0x2895('0xa2'))};_0x217d91[_0x2895('0x45')]=_[_0x2895('0x47')](_0x217d91[_0x2895('0x45')],_0x162e48);}_0x217d91=_[_0x2895('0x47')]({},_0x217d91,_0x19304a[_0x2895('0x4e')]);return db['FaxMessage'][_0x2895('0x29')]({'where':_0x217d91[_0x2895('0x45')]})[_0x2895('0x1d')](function(_0x102376){_0x2378b4['count']=_0x102376;if(_0x19304a[_0x2895('0x3b')][_0x2895('0x4f')]){_0x217d91[_0x2895('0x56')]=[{'all':!![]}];}return db[_0x2895('0x9e')][_0x2895('0x50')](_0x217d91);})[_0x2895('0x1d')](function(_0x2e62cd){_0x2378b4['rows']=_0x2e62cd;return _0x2378b4;});}})['then'](respondWithFilteredResult(_0x551139,_0x217d91))[_0x2895('0x51')](handleError(_0x551139,null));};exports[_0x2895('0x35')]=function(_0x4649ba,_0x1fcc7f,_0x34df50){var _0x2bda84,_0x9b9a61={},_0x4544bc;if(_0x4649ba[_0x2895('0x61')]['to']){_0x4544bc=_0x4649ba[_0x2895('0x61')]['to'][0x0];}return db[_0x2895('0x37')][_0x2895('0x5c')]({'where':{'id':_0x4649ba[_0x2895('0x53')]['id']},'include':[{'model':db['CmList'],'as':_0x2895('0xa3'),'include':[{'model':db[_0x2895('0x73')],'as':_0x2895('0xa4'),'where':{'fax':_0x4544bc},'limit':0x1,'order':[[_0x2895('0x9b'),_0x2895('0xa5')]]}]}]})[_0x2895('0x1d')](handleEntityNotFound(_0x1fcc7f,null))[_0x2895('0x1d')](function(_0x547f93){_0x2bda84=_0x547f93;if(_0x4649ba['body'][_0x2895('0xa6')]&&_0x4649ba[_0x2895('0x61')][_0x2895('0xa6')][_0x2895('0x40')]){for(var _0x1f594b=0x0;_0x1f594b<_0x4649ba[_0x2895('0x61')][_0x2895('0xa6')][_0x2895('0x40')];_0x1f594b+=0x1){_0x4649ba['body'][_0x2895('0xa6')][_0x1f594b]={'filename':_0x4649ba[_0x2895('0x61')][_0x2895('0xa6')][_0x1f594b]['name'],'id':_0x4649ba[_0x2895('0x61')][_0x2895('0xa6')][_0x1f594b]['id'],'path':path['join'](config[_0x2895('0xa7')],'server/files/attachments',_0x4649ba[_0x2895('0x61')][_0x2895('0xa6')][_0x1f594b]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0x2895('0xa8'),{'FaxAccountId':_[_0x2895('0xa9')](_0x4649ba[_0x2895('0x53')]['id'])?undefined:_0x4649ba[_0x2895('0x53')]['id'],'path':_[_0x2895('0xa9')](_0x4649ba[_0x2895('0x61')][_0x2895('0xa6')][0x0][_0x2895('0xaa')])?undefined:_0x4649ba[_0x2895('0x61')][_0x2895('0xa6')][0x0][_0x2895('0xaa')],'fax':_[_0x2895('0xa9')](_0x4649ba[_0x2895('0x61')]['to'][0x0])?undefined:_0x4649ba[_0x2895('0x61')]['to'][0x0]},client9002);})[_0x2895('0x1d')](function(){if(_0x2bda84){if(_[_0x2895('0xa9')](_0x4649ba['body'][_0x2895('0xab')])){_0x4649ba[_0x2895('0x61')][_0x2895('0xab')]=util[_0x2895('0xa1')](_0x2895('0xac'),_0x2bda84['name'],_0x2bda84[_0x2895('0xad')]);}if(_0x2bda84[_0x2895('0xa3')]){if(_0x2bda84[_0x2895('0xa3')]['Contacts'][_0x2895('0x40')]){return _0x2bda84['List'][_0x2895('0xa4')][0x0];}else{return db[_0x2895('0x73')]['create'](_[_0x2895('0x14')](_0x4649ba[_0x2895('0x61')],{'firstName':_0x4649ba[_0x2895('0x61')]['to'][0x0],'phone':_0x4649ba[_0x2895('0x61')]['to'][0x0],'fax':_0x4649ba[_0x2895('0x61')]['to'][0x0],'ListId':_0x2bda84[_0x2895('0xae')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x2895('0x1d')](function(_0x682336){if(_0x682336){return db[_0x2895('0x70')][_0x2895('0x5c')]({'where':{'ContactId':_0x682336['id'],'closed':![],'FaxAccountId':_0x2bda84['id']}})[_0x2895('0x1d')](function(_0x232e74){if(_0x232e74){return[_0x232e74,![]];}return db['FaxInteraction'][_0x2895('0x57')]({'UserId':_0x4649ba[_0x2895('0xaf')]['id'],'ContactId':_0x682336['id'],'FaxAccountId':_0x2bda84['id'],'fax':_0x4649ba[_0x2895('0x61')]['to'][0x0],'firstMsgDirection':_0x2895('0xb0'),'Messages':[_['merge'](_0x4649ba['body'],{'read':![],'body':_0x4649ba[_0x2895('0x61')][_0x2895('0xa6')][0x0][_0x2895('0xb1')],'FaxAccountId':_0x2bda84['id'],'UserId':_0x4649ba[_0x2895('0xaf')]['id'],'ContactId':_0x682336['id'],'AttachmentId':_0x4649ba[_0x2895('0x61')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x2895('0x9e')],'as':_0x2895('0xb2')}]})[_0x2895('0x1d')](function(_0x287996){return[_0x287996,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x2895('0xb3')](function(_0x3cc295,_0x30dfd2){if(_0x30dfd2){return _0x3cc295;}return db[_0x2895('0x9e')]['create']({'direction':_0x2895('0xb0'),'read':![],'body':_0x4649ba['body']['attachments'][0x0][_0x2895('0xb1')],'FaxAccountId':_0x2bda84['id'],'FaxInteractionId':_0x3cc295['id'],'UserId':_0x4649ba[_0x2895('0xaf')]['id'],'ContactId':_0x3cc295['ContactId'],'AttachmentId':_0x4649ba[_0x2895('0x61')][_0x2895('0xa6')][0x0]['id']})[_0x2895('0x1d')](function(_0x7b079e){_0x3cc295[_0x2895('0xb4')][_0x2895('0xb2')]=[];_0x3cc295[_0x2895('0xb4')]['Messages'][_0x2895('0x89')](_0x7b079e[_0x2895('0xb4')]);return _0x3cc295;});})[_0x2895('0x1d')](function(_0x45a709){respondWithRpcPromise('SendFax',_0x2895('0xb5'),{'FaxAccountId':_[_0x2895('0xa9')](_0x4649ba[_0x2895('0x53')]['id'])?undefined:_0x4649ba[_0x2895('0x53')]['id'],'path':_[_0x2895('0xa9')](_0x4649ba[_0x2895('0x61')][_0x2895('0xa6')][0x0][_0x2895('0xaa')])?undefined:_0x4649ba[_0x2895('0x61')][_0x2895('0xa6')][0x0][_0x2895('0xaa')],'fax':_[_0x2895('0xa9')](_0x4649ba[_0x2895('0x61')]['to'][0x0])?undefined:_0x4649ba[_0x2895('0x61')]['to'][0x0],'AttachmentId':_0x4649ba['body'][_0x2895('0xa6')][0x0]['id']},client9002)[_0x2895('0x1d')](function(_0x23875c){logger[_0x2895('0x25')](_0x2895('0xb6'),_0x23875c);})[_0x2895('0x51')](function(_0x35f038){logger[_0x2895('0x25')](_0x2895('0xb6'),_0x35f038);});return _0x45a709;})['then'](respondWithResult(_0x1fcc7f,null))[_0x2895('0x51')](handleError(_0x1fcc7f,null));};exports['addAgents']=function(_0x4d413b,_0x4468dc,_0x38728d){return db[_0x2895('0x37')][_0x2895('0x5c')]({'where':{'id':_0x4d413b['params']['id']}})['then'](handleEntityNotFound(_0x4468dc,null))[_0x2895('0x1d')](function(_0x818238){if(_0x818238){return _0x818238[_0x2895('0xb7')](_0x4d413b[_0x2895('0x61')][_0x2895('0x6a')],_[_0x2895('0x71')](_0x4d413b['body'],[_0x2895('0x6a'),'id'])||{})[_0x2895('0xb3')](function(_0xd16e4){for(var _0x8356b2=0x0;_0x8356b2<_0x4d413b[_0x2895('0x61')]['ids'][_0x2895('0x40')];_0x8356b2+=0x1){socket[_0x2895('0xb8')](_0x2895('0xb9'),{'UserId':_0x4d413b[_0x2895('0x61')][_0x2895('0x6a')][_0x8356b2],'FaxAccountId':_0x4d413b[_0x2895('0x53')]['id']});}return _0xd16e4;});}})[_0x2895('0x1d')](respondWithResult(_0x4468dc,null))[_0x2895('0x51')](handleError(_0x4468dc,null));};exports[_0x2895('0xba')]=function(_0x14d294,_0x2d16fd,_0x42ae0b){return db[_0x2895('0x37')][_0x2895('0x5c')]({'where':{'id':_0x14d294[_0x2895('0x53')]['id']}})['then'](handleEntityNotFound(_0x2d16fd,null))[_0x2895('0x1d')](function(_0x17df52){if(_0x17df52){return _0x17df52[_0x2895('0xba')](_0x14d294['query'][_0x2895('0x6a')])[_0x2895('0x1d')](function(){if(_[_0x2895('0xbb')](_0x14d294[_0x2895('0x3b')]['ids'])){for(var _0x216037=0x0;_0x216037<_0x14d294[_0x2895('0x3b')][_0x2895('0x6a')]['length'];_0x216037+=0x1){socket[_0x2895('0xb8')]('userFaxAccount:remove',{'UserId':Number(_0x14d294[_0x2895('0x3b')]['ids'][_0x216037]),'FaxAccountId':Number(_0x14d294['params']['id'])});}}else{socket[_0x2895('0xb8')](_0x2895('0xbc'),{'UserId':Number(_0x14d294[_0x2895('0x3b')]['ids']),'FaxAccountId':Number(_0x14d294[_0x2895('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x2d16fd,null))[_0x2895('0x51')](handleError(_0x2d16fd,null));};exports[_0x2895('0xbd')]=function(_0x3de708,_0x203c78,_0x24b658){var _0x4b7bcc={};var _0x198e01={};var _0x4d38cc;var _0x19cd68;return db[_0x2895('0x37')]['findOne']({'where':{'id':_0x3de708[_0x2895('0x53')]['id']}})['then'](handleEntityNotFound(_0x203c78,null))[_0x2895('0x1d')](function(_0x298421){if(_0x298421){_0x4d38cc=_0x298421;_0x198e01[_0x2895('0x39')]=_[_0x2895('0x3a')](db[_0x2895('0x75')][_0x2895('0x38')]);_0x198e01['query']=_[_0x2895('0x3a')](_0x3de708[_0x2895('0x3b')]);_0x198e01['filters']=_[_0x2895('0x3d')](_0x198e01[_0x2895('0x39')],_0x198e01[_0x2895('0x3b')]);_0x4b7bcc[_0x2895('0x3e')]=_[_0x2895('0x3d')](_0x198e01['model'],qs[_0x2895('0x3f')](_0x3de708['query']['fields']));_0x4b7bcc['attributes']=_0x4b7bcc[_0x2895('0x3e')][_0x2895('0x40')]?_0x4b7bcc[_0x2895('0x3e')]:_0x198e01['model'];_0x4b7bcc[_0x2895('0x43')]=qs[_0x2895('0x44')](_0x3de708[_0x2895('0x3b')][_0x2895('0x44')]);_0x4b7bcc[_0x2895('0x45')]=qs[_0x2895('0x3c')](_[_0x2895('0x46')](_0x3de708['query'],_0x198e01['filters']));if(_0x3de708[_0x2895('0x3b')][_0x2895('0x4d')]){_0x4b7bcc['where']=_[_0x2895('0x47')](_0x4b7bcc[_0x2895('0x45')],{'$or':_['map'](_0x4b7bcc[_0x2895('0x3e')],function(_0x40ed1f){var _0x20dcfe={};_0x20dcfe[_0x40ed1f]={'$like':'%'+_0x3de708[_0x2895('0x3b')][_0x2895('0x4d')]+'%'};return _0x20dcfe;})});}_0x4b7bcc=_['merge']({},_0x4b7bcc,_0x3de708[_0x2895('0x4e')]);return _0x4d38cc[_0x2895('0xbd')](_0x4b7bcc);}})['then'](function(_0x3a06c4){if(_0x3a06c4){_0x19cd68=_0x3a06c4['length'];if(!_0x3de708[_0x2895('0x3b')][_0x2895('0x41')](_0x2895('0x42'))){_0x4b7bcc[_0x2895('0x2b')]=qs[_0x2895('0x2b')](_0x3de708[_0x2895('0x3b')][_0x2895('0x2b')]);_0x4b7bcc[_0x2895('0x2a')]=qs['offset'](_0x3de708[_0x2895('0x3b')][_0x2895('0x2a')]);}return _0x4d38cc[_0x2895('0xbd')](_0x4b7bcc);}})['then'](function(_0x3a616e){if(_0x3a616e){return _0x3a616e?{'count':_0x19cd68,'rows':_0x3a616e}:null;}})[_0x2895('0x1d')](respondWithResult(_0x203c78,null))[_0x2895('0x51')](handleError(_0x203c78,null));}; \ No newline at end of file +var _0xbb59=['TrunkId','ListId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','Contacts','DESC','attachments','join','root','basename','CheckAfterSend','isNil','path','from','fax','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFaxRpc,\x20%s','addAgents','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','User','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','http','test','request','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','count','set','Content-Range','apply','reject','update','then','destroy','get','FaxAccounts','UserProfileResource','end','stack','name','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','keys','query','model','attributes','intersection','fields','length','limit','offset','order','sort','where','filters','pick','filter','merge','map','field','includeAll','include','rows','catch','show','params','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','FaxAccountId','findAll','removeDispositions','addAnswer','CannedAnswer','hasOwnProperty','options','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','app','type','system','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','localstationid','gateway','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','VoiceExtension','updateAccountApplications','key','createdAt','updatedAt'];(function(_0x3af54d,_0x33588c){var _0x4ef3de=function(_0x5f5909){while(--_0x5f5909){_0x3af54d['push'](_0x3af54d['shift']());}};_0x4ef3de(++_0x33588c);}(_0xbb59,0xec));var _0x9bb5=function(_0x1bc3d3,_0xc5228){_0x1bc3d3=_0x1bc3d3-0x0;var _0x2fac2a=_0xbb59[_0x1bc3d3];return _0x2fac2a;};'use strict';var pdf=require(_0x9bb5('0x0'));var emlformat=require(_0x9bb5('0x1'));var rimraf=require(_0x9bb5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9bb5('0x3'));var moment=require(_0x9bb5('0x4'));var BPromise=require(_0x9bb5('0x5'));var Mustache=require(_0x9bb5('0x6'));var util=require(_0x9bb5('0x7'));var path=require('path');var sox=require(_0x9bb5('0x8'));var csv=require(_0x9bb5('0x9'));var ejs=require(_0x9bb5('0xa'));var fs=require('fs');var _=require(_0x9bb5('0xb'));var squel=require(_0x9bb5('0xc'));var crypto=require(_0x9bb5('0xd'));var jsforce=require(_0x9bb5('0xe'));var deskjs=require(_0x9bb5('0xf'));var toCsv=require(_0x9bb5('0x9'));var querystring=require(_0x9bb5('0x10'));var Papa=require(_0x9bb5('0x11'));var Redis=require(_0x9bb5('0x12'));var authService=require(_0x9bb5('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x9bb5('0x14'));var logger=require(_0x9bb5('0x15'))(_0x9bb5('0x16'));var utils=require(_0x9bb5('0x17'));var config=require(_0x9bb5('0x18'));var db=require(_0x9bb5('0x19'))['db'];config[_0x9bb5('0x1a')]=_[_0x9bb5('0x1b')](config[_0x9bb5('0x1a')],{'host':_0x9bb5('0x1c'),'port':0x18eb});var socket=require(_0x9bb5('0x1d'))(new Redis(config[_0x9bb5('0x1a')]));require(_0x9bb5('0x1e'))[_0x9bb5('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x9bb5('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x1a077d,_0x57605d,_0x122ae6){if(_0x122ae6){var _0x1ed006=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ed006[_0x9bb5('0x21')](_0x57605d)){return _0x1a077d;}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 _0x1a077d;}}function respondWithRpcPromise(_0xb471e,_0x1a3e3d,_0x3f3903,_0x1d5d9c){return new BPromise(function(_0xba8392,_0x19d1e9){var _0x162815=_0x1d5d9c||client;return _0x162815[_0x9bb5('0x22')](_0xb471e,_0x3f3903)['then'](function(_0x51c333){logger[_0x9bb5('0x23')](_0x9bb5('0x24'),_0x1a3e3d,'request\x20sent');logger['debug'](_0x9bb5('0x25'),_0x1a3e3d,_0x9bb5('0x26'),JSON[_0x9bb5('0x27')](_0x51c333));if(_0x51c333['error']){if(_0x51c333[_0x9bb5('0x28')][_0x9bb5('0x29')]===0x1f4){logger[_0x9bb5('0x28')](_0x9bb5('0x24'),_0x1a3e3d,_0x51c333['error'][_0x9bb5('0x2a')]);return _0x19d1e9(_0x51c333[_0x9bb5('0x28')]['message']);}logger[_0x9bb5('0x28')]('FaxAccount,\x20%s,\x20%s',_0x1a3e3d,_0x51c333[_0x9bb5('0x28')]['message']);return _0xba8392(_0x51c333['error'][_0x9bb5('0x2a')]);}else{logger[_0x9bb5('0x23')]('FaxAccount,\x20%s,\x20%s',_0x1a3e3d,_0x9bb5('0x26'));_0xba8392(_0x51c333[_0x9bb5('0x2b')][_0x9bb5('0x2a')]);}})['catch'](function(_0x54e0bd){logger[_0x9bb5('0x28')](_0x9bb5('0x24'),_0x1a3e3d,_0x54e0bd);_0x19d1e9(_0x54e0bd);});});}function respondWithStatusCode(_0x785b2a,_0x574e0d){_0x574e0d=_0x574e0d||0xcc;return function(_0x2958e4){if(_0x2958e4){return _0x785b2a[_0x9bb5('0x2c')](_0x574e0d);}return _0x785b2a[_0x9bb5('0x2d')](_0x574e0d)['end']();};}function respondWithResult(_0x5a26ed,_0x483265){_0x483265=_0x483265||0xc8;return function(_0x1ad67b){if(_0x1ad67b){return _0x5a26ed[_0x9bb5('0x2d')](_0x483265)[_0x9bb5('0x2e')](_0x1ad67b);}};}function respondWithFilteredResult(_0x470b92,_0xb89655){return function(_0x4b821d){if(_0x4b821d){var _0x53866e=_0x4b821d[_0x9bb5('0x2f')],_0x59ef00=_0xb89655['offset'],_0x18d6e4=_0xb89655['offset']+_0xb89655['limit'],_0xc6ba7f;if(_0x18d6e4>=_0x53866e){_0x18d6e4=_0x53866e;_0xc6ba7f=0xc8;}else{_0xc6ba7f=0xce;}_0x470b92[_0x9bb5('0x2d')](_0xc6ba7f);return _0x470b92[_0x9bb5('0x30')](_0x9bb5('0x31'),_0x59ef00+'-'+_0x18d6e4+'/'+_0x53866e)['json'](_0x4b821d);}return null;};}function patchUpdates(_0x538fbe){return function(_0x1521d6){try{jsonpatch[_0x9bb5('0x32')](_0x1521d6,_0x538fbe,!![]);}catch(_0x35e6d8){return BPromise[_0x9bb5('0x33')](_0x35e6d8);}return _0x1521d6['save']();};}function saveUpdates(_0x19feea,_0x3f629c){return function(_0x9d3912){if(_0x9d3912){return _0x9d3912[_0x9bb5('0x34')](_0x19feea)[_0x9bb5('0x35')](function(_0x421afd){return _0x421afd;});}return null;};}function removeEntity(_0x7d29fb,_0x4c19c6){return function(_0x5d7841){if(_0x5d7841){return _0x5d7841[_0x9bb5('0x36')]()[_0x9bb5('0x35')](function(){var _0x57be9b=_0x5d7841[_0x9bb5('0x37')]({'plain':!![]});var _0x4be770=_0x9bb5('0x38');return db[_0x9bb5('0x39')]['destroy']({'where':{'type':_0x4be770,'resourceId':_0x57be9b['id']}})[_0x9bb5('0x35')](function(){return _0x5d7841;});})[_0x9bb5('0x35')](function(){_0x7d29fb['status'](0xcc)[_0x9bb5('0x3a')]();});}};}function handleEntityNotFound(_0x3f937e,_0x3c09d6){return function(_0x496ceb){if(!_0x496ceb){_0x3f937e['sendStatus'](0x194);}return _0x496ceb;};}function handleError(_0x36da7e,_0x2e738c){_0x2e738c=_0x2e738c||0x1f4;return function(_0x4af663){logger[_0x9bb5('0x28')](_0x4af663[_0x9bb5('0x3b')]);if(_0x4af663[_0x9bb5('0x3c')]){delete _0x4af663[_0x9bb5('0x3c')];}_0x36da7e[_0x9bb5('0x2d')](_0x2e738c)['send'](_0x4af663);};}exports['index']=function(_0x2e1873,_0xb0bc32){var _0x3f7a77={'include':[{'model':db[_0x9bb5('0x3d')],'as':_0x9bb5('0x3e')}]},_0x49c317={},_0x342901={'count':0x0,'rows':[]};var _0x114a2e=db[_0x9bb5('0x3f')][_0x9bb5('0x40')];_0x49c317['model']=_[_0x9bb5('0x41')](_0x114a2e);_0x49c317[_0x9bb5('0x42')]=_[_0x9bb5('0x41')](_0x2e1873['query']);_0x49c317['filters']=_['intersection'](_0x49c317[_0x9bb5('0x43')],_0x49c317['query']);_0x3f7a77[_0x9bb5('0x44')]=_[_0x9bb5('0x45')](_0x49c317[_0x9bb5('0x43')],qs[_0x9bb5('0x46')](_0x2e1873['query'][_0x9bb5('0x46')]));_0x3f7a77[_0x9bb5('0x44')]=_0x3f7a77['attributes'][_0x9bb5('0x47')]?_0x3f7a77['attributes']:_0x49c317[_0x9bb5('0x43')];if(!_0x2e1873[_0x9bb5('0x42')]['hasOwnProperty']('nolimit')){_0x3f7a77[_0x9bb5('0x48')]=qs['limit'](_0x2e1873[_0x9bb5('0x42')][_0x9bb5('0x48')]);_0x3f7a77[_0x9bb5('0x49')]=qs[_0x9bb5('0x49')](_0x2e1873[_0x9bb5('0x42')]['offset']);}_0x3f7a77[_0x9bb5('0x4a')]=qs['sort'](_0x2e1873['query'][_0x9bb5('0x4b')]);_0x3f7a77[_0x9bb5('0x4c')]=qs[_0x9bb5('0x4d')](_[_0x9bb5('0x4e')](_0x2e1873['query'],_0x49c317[_0x9bb5('0x4d')]));if(_0x2e1873[_0x9bb5('0x42')][_0x9bb5('0x4f')]){_0x3f7a77[_0x9bb5('0x4c')]=_[_0x9bb5('0x50')](_0x3f7a77[_0x9bb5('0x4c')],{'$or':_[_0x9bb5('0x51')](_0x114a2e,function(_0xafe622){if(_0xafe622['type']['key']!=='VIRTUAL'){var _0x2186a9={};_0x2186a9[_0xafe622[_0x9bb5('0x52')]]={'$like':'%'+_0x2e1873[_0x9bb5('0x42')]['filter']+'%'};return _0x2186a9;}})});}_0x3f7a77=_[_0x9bb5('0x50')]({},_0x3f7a77,_0x2e1873['options']);var _0x468d3f={'where':_0x3f7a77['where']};return db[_0x9bb5('0x3f')][_0x9bb5('0x2f')](_0x468d3f)['then'](function(_0x2227b0){_0x342901[_0x9bb5('0x2f')]=_0x2227b0;if(_0x2e1873[_0x9bb5('0x42')][_0x9bb5('0x53')]){_0x3f7a77[_0x9bb5('0x54')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x3f7a77);})[_0x9bb5('0x35')](function(_0xb850af){_0x342901[_0x9bb5('0x55')]=_0xb850af;return _0x342901;})[_0x9bb5('0x35')](respondWithFilteredResult(_0xb0bc32,_0x3f7a77))[_0x9bb5('0x56')](handleError(_0xb0bc32,null));};exports[_0x9bb5('0x57')]=function(_0x2c06ea,_0x308496){var _0x20fc8d={'raw':![],'where':{'id':_0x2c06ea[_0x9bb5('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x9bb5('0x3e')}]},_0x51878d={};_0x51878d[_0x9bb5('0x43')]=_['keys'](db[_0x9bb5('0x3f')]['rawAttributes']);_0x51878d[_0x9bb5('0x42')]=_[_0x9bb5('0x41')](_0x2c06ea[_0x9bb5('0x42')]);_0x51878d['filters']=_[_0x9bb5('0x45')](_0x51878d[_0x9bb5('0x43')],_0x51878d[_0x9bb5('0x42')]);_0x20fc8d[_0x9bb5('0x44')]=_['intersection'](_0x51878d[_0x9bb5('0x43')],qs[_0x9bb5('0x46')](_0x2c06ea['query']['fields']));_0x20fc8d['attributes']=_0x20fc8d[_0x9bb5('0x44')][_0x9bb5('0x47')]?_0x20fc8d[_0x9bb5('0x44')]:_0x51878d[_0x9bb5('0x43')];if(_0x2c06ea[_0x9bb5('0x42')]['includeAll']){_0x20fc8d['include']=[{'all':!![]}];}_0x20fc8d=_['merge']({},_0x20fc8d,_0x2c06ea['options']);return db[_0x9bb5('0x3f')][_0x9bb5('0x59')](_0x20fc8d)[_0x9bb5('0x35')](handleEntityNotFound(_0x308496,null))[_0x9bb5('0x35')](respondWithResult(_0x308496,null))[_0x9bb5('0x56')](handleError(_0x308496,null));};exports[_0x9bb5('0x5a')]=function(_0x8b7245,_0x433f95){return db[_0x9bb5('0x3f')][_0x9bb5('0x5a')](_0x8b7245[_0x9bb5('0x5b')],{})[_0x9bb5('0x35')](function(_0x40b1ab){var _0x293673=_0x8b7245['user'][_0x9bb5('0x37')]({'plain':!![]});if(!_0x293673)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x293673[_0x9bb5('0x5c')]===_0x9bb5('0x5d')){var _0x13aec3=_0x40b1ab[_0x9bb5('0x37')]({'plain':!![]});var _0x4d6e1e=_0x9bb5('0x38');return db[_0x9bb5('0x5e')][_0x9bb5('0x59')]({'where':{'name':_0x4d6e1e,'userProfileId':_0x293673[_0x9bb5('0x5f')]},'raw':!![]})[_0x9bb5('0x35')](function(_0x32220f){if(_0x32220f&&_0x32220f[_0x9bb5('0x60')]===0x0){return db[_0x9bb5('0x39')][_0x9bb5('0x5a')]({'name':_0x13aec3[_0x9bb5('0x3c')],'resourceId':_0x13aec3['id'],'type':_0x32220f[_0x9bb5('0x3c')],'sectionId':_0x32220f['id']},{})[_0x9bb5('0x35')](function(){return _0x40b1ab;});}else{return _0x40b1ab;}})[_0x9bb5('0x56')](function(_0x566d96){logger['error'](_0x9bb5('0x61'),_0x566d96);throw _0x566d96;});}return _0x40b1ab;})['then'](respondWithResult(_0x433f95,0xc9))['catch'](handleError(_0x433f95,null));};exports[_0x9bb5('0x34')]=function(_0x14b7fa,_0x328451){if(_0x14b7fa[_0x9bb5('0x5b')]['id']){delete _0x14b7fa[_0x9bb5('0x5b')]['id'];}return db[_0x9bb5('0x3f')]['find']({'where':{'id':_0x14b7fa['params']['id']},'include':[{'model':db[_0x9bb5('0x3d')],'as':_0x9bb5('0x3e')}]})[_0x9bb5('0x35')](handleEntityNotFound(_0x328451,null))['then'](saveUpdates(_0x14b7fa[_0x9bb5('0x5b')],null))[_0x9bb5('0x35')](respondWithResult(_0x328451,null))[_0x9bb5('0x56')](handleError(_0x328451,null));};exports['destroy']=function(_0xc1130a,_0x5574f9){return db['FaxAccount'][_0x9bb5('0x59')]({'where':{'id':_0xc1130a['params']['id']}})[_0x9bb5('0x35')](handleEntityNotFound(_0x5574f9,null))['then'](removeEntity(_0x5574f9,null))[_0x9bb5('0x56')](handleError(_0x5574f9,null));};exports[_0x9bb5('0x62')]=function(_0x50d930,_0x16957d){return db[_0x9bb5('0x3f')]['describe']()['then'](respondWithResult(_0x16957d,null))[_0x9bb5('0x56')](handleError(_0x16957d,null));};exports[_0x9bb5('0x63')]=function(_0x16f81e,_0x3dac69,_0x233e8d){if(_0x16f81e[_0x9bb5('0x5b')]['id']){delete _0x16f81e[_0x9bb5('0x5b')]['id'];}return db[_0x9bb5('0x3f')]['find']({'where':{'id':_0x16f81e[_0x9bb5('0x58')]['id']}})[_0x9bb5('0x35')](handleEntityNotFound(_0x3dac69,null))[_0x9bb5('0x35')](function(_0xd4e078){if(_0xd4e078){_0x16f81e['body']['FaxAccountId']=_0xd4e078['id'];return db[_0x9bb5('0x64')]['create'](_0x16f81e[_0x9bb5('0x5b')]);}})[_0x9bb5('0x35')](respondWithResult(_0x3dac69,null))[_0x9bb5('0x56')](handleError(_0x3dac69,null));};exports[_0x9bb5('0x65')]=function(_0x491a94,_0x2e42ff,_0x122473){var _0x279028={'raw':![],'where':{}};var _0x2b39dc={};var _0x3006db={'count':0x0,'rows':[]};return db[_0x9bb5('0x3f')][_0x9bb5('0x66')]({'where':{'id':_0x491a94[_0x9bb5('0x58')]['id']}})['then'](handleEntityNotFound(_0x2e42ff,null))['then'](function(_0x2d9e1c){if(_0x2d9e1c){_0x2b39dc['model']=_[_0x9bb5('0x41')](db[_0x9bb5('0x64')][_0x9bb5('0x40')]);_0x2b39dc['query']=_[_0x9bb5('0x41')](_0x491a94['query']);_0x2b39dc[_0x9bb5('0x4d')]=_[_0x9bb5('0x45')](_0x2b39dc[_0x9bb5('0x43')],_0x2b39dc[_0x9bb5('0x42')]);_0x279028[_0x9bb5('0x44')]=_[_0x9bb5('0x45')](_0x2b39dc[_0x9bb5('0x43')],qs[_0x9bb5('0x46')](_0x491a94[_0x9bb5('0x42')]['fields']));_0x279028[_0x9bb5('0x44')]=_0x279028['attributes'][_0x9bb5('0x47')]?_0x279028['attributes']:_0x2b39dc[_0x9bb5('0x43')];if(!_0x491a94[_0x9bb5('0x42')]['hasOwnProperty'](_0x9bb5('0x67'))){_0x279028[_0x9bb5('0x48')]=qs[_0x9bb5('0x48')](_0x491a94[_0x9bb5('0x42')][_0x9bb5('0x48')]);_0x279028[_0x9bb5('0x49')]=qs[_0x9bb5('0x49')](_0x491a94[_0x9bb5('0x42')][_0x9bb5('0x49')]);}_0x279028[_0x9bb5('0x4a')]=qs[_0x9bb5('0x4b')](_0x491a94[_0x9bb5('0x42')]['sort']);_0x279028[_0x9bb5('0x4c')]=qs[_0x9bb5('0x4d')](_['pick'](_0x491a94['query'],_0x2b39dc[_0x9bb5('0x4d')]));_0x279028[_0x9bb5('0x4c')][_0x9bb5('0x68')]=_0x2d9e1c['id'];if(_0x491a94[_0x9bb5('0x42')][_0x9bb5('0x4f')]){_0x279028[_0x9bb5('0x4c')]=_[_0x9bb5('0x50')](_0x279028['where'],{'$or':_[_0x9bb5('0x51')](_0x279028[_0x9bb5('0x44')],function(_0x58a497){var _0x30359d={};_0x30359d[_0x58a497]={'$like':'%'+_0x491a94['query']['filter']+'%'};return _0x30359d;})});}_0x279028=_[_0x9bb5('0x50')]({},_0x279028,_0x491a94['options']);return db[_0x9bb5('0x64')][_0x9bb5('0x2f')]({'where':_0x279028[_0x9bb5('0x4c')]})[_0x9bb5('0x35')](function(_0x4e2e34){_0x3006db[_0x9bb5('0x2f')]=_0x4e2e34;if(_0x491a94['query'][_0x9bb5('0x53')]){_0x279028[_0x9bb5('0x54')]=[{'all':!![]}];}return db[_0x9bb5('0x64')][_0x9bb5('0x69')](_0x279028);})['then'](function(_0x4b7f13){_0x3006db[_0x9bb5('0x55')]=_0x4b7f13;return _0x3006db;});}})[_0x9bb5('0x35')](respondWithFilteredResult(_0x2e42ff,_0x279028))[_0x9bb5('0x56')](handleError(_0x2e42ff,null));};exports[_0x9bb5('0x6a')]=function(_0x57bba4,_0xc1e3d0,_0x26d4fd){return db[_0x9bb5('0x3f')]['find']({'where':{'id':_0x57bba4[_0x9bb5('0x58')]['id']}})[_0x9bb5('0x35')](handleEntityNotFound(_0xc1e3d0,null))[_0x9bb5('0x35')](function(_0x408f8b){if(_0x408f8b){return _0x408f8b[_0x9bb5('0x6a')](_0x57bba4[_0x9bb5('0x42')]['ids']);}})[_0x9bb5('0x35')](respondWithStatusCode(_0xc1e3d0,null))['catch'](handleError(_0xc1e3d0,null));};exports[_0x9bb5('0x6b')]=function(_0x298820,_0x26261d,_0x1bc25e){if(_0x298820['body']['id']){delete _0x298820['body']['id'];}return db[_0x9bb5('0x3f')]['find']({'where':{'id':_0x298820[_0x9bb5('0x58')]['id']}})['then'](handleEntityNotFound(_0x26261d,null))[_0x9bb5('0x35')](function(_0x2c4c80){if(_0x2c4c80){_0x298820[_0x9bb5('0x5b')]['FaxAccountId']=_0x2c4c80['id'];return db[_0x9bb5('0x6c')][_0x9bb5('0x5a')](_0x298820[_0x9bb5('0x5b')]);}})['then'](respondWithResult(_0x26261d,null))[_0x9bb5('0x56')](handleError(_0x26261d,null));};exports['getAnswers']=function(_0xf573f6,_0x1dcf5e,_0x129997){var _0x102e97={'raw':![],'where':{}};var _0xe92361={};var _0x52b340={'count':0x0,'rows':[]};return db[_0x9bb5('0x3f')][_0x9bb5('0x66')]({'where':{'id':_0xf573f6[_0x9bb5('0x58')]['id']}})['then'](handleEntityNotFound(_0x1dcf5e,null))[_0x9bb5('0x35')](function(_0x54d51d){if(_0x54d51d){_0xe92361[_0x9bb5('0x43')]=_[_0x9bb5('0x41')](db[_0x9bb5('0x6c')][_0x9bb5('0x40')]);_0xe92361['query']=_[_0x9bb5('0x41')](_0xf573f6[_0x9bb5('0x42')]);_0xe92361[_0x9bb5('0x4d')]=_[_0x9bb5('0x45')](_0xe92361[_0x9bb5('0x43')],_0xe92361[_0x9bb5('0x42')]);_0x102e97['attributes']=_['intersection'](_0xe92361[_0x9bb5('0x43')],qs['fields'](_0xf573f6[_0x9bb5('0x42')]['fields']));_0x102e97[_0x9bb5('0x44')]=_0x102e97[_0x9bb5('0x44')][_0x9bb5('0x47')]?_0x102e97[_0x9bb5('0x44')]:_0xe92361[_0x9bb5('0x43')];if(!_0xf573f6[_0x9bb5('0x42')][_0x9bb5('0x6d')](_0x9bb5('0x67'))){_0x102e97[_0x9bb5('0x48')]=qs[_0x9bb5('0x48')](_0xf573f6['query'][_0x9bb5('0x48')]);_0x102e97[_0x9bb5('0x49')]=qs[_0x9bb5('0x49')](_0xf573f6[_0x9bb5('0x42')][_0x9bb5('0x49')]);}_0x102e97[_0x9bb5('0x4a')]=qs[_0x9bb5('0x4b')](_0xf573f6[_0x9bb5('0x42')][_0x9bb5('0x4b')]);_0x102e97['where']=qs[_0x9bb5('0x4d')](_['pick'](_0xf573f6[_0x9bb5('0x42')],_0xe92361[_0x9bb5('0x4d')]));_0x102e97[_0x9bb5('0x4c')][_0x9bb5('0x68')]=_0x54d51d['id'];if(_0xf573f6[_0x9bb5('0x42')][_0x9bb5('0x4f')]){_0x102e97[_0x9bb5('0x4c')]=_[_0x9bb5('0x50')](_0x102e97[_0x9bb5('0x4c')],{'$or':_[_0x9bb5('0x51')](_0x102e97[_0x9bb5('0x44')],function(_0xaacfb0){var _0x4922c6={};_0x4922c6[_0xaacfb0]={'$like':'%'+_0xf573f6[_0x9bb5('0x42')]['filter']+'%'};return _0x4922c6;})});}_0x102e97=_[_0x9bb5('0x50')]({},_0x102e97,_0xf573f6[_0x9bb5('0x6e')]);return db[_0x9bb5('0x6c')][_0x9bb5('0x2f')]({'where':_0x102e97[_0x9bb5('0x4c')]})['then'](function(_0x5d0e54){_0x52b340[_0x9bb5('0x2f')]=_0x5d0e54;if(_0xf573f6[_0x9bb5('0x42')][_0x9bb5('0x53')]){_0x102e97[_0x9bb5('0x54')]=[{'all':!![]}];}return db[_0x9bb5('0x6c')][_0x9bb5('0x69')](_0x102e97);})[_0x9bb5('0x35')](function(_0xbbdb66){_0x52b340[_0x9bb5('0x55')]=_0xbbdb66;return _0x52b340;});}})[_0x9bb5('0x35')](respondWithFilteredResult(_0x1dcf5e,_0x102e97))[_0x9bb5('0x56')](handleError(_0x1dcf5e,null));};exports['removeAnswers']=function(_0x57572c,_0x2dfa05,_0x2d4e43){return db['FaxAccount'][_0x9bb5('0x59')]({'where':{'id':_0x57572c[_0x9bb5('0x58')]['id']}})[_0x9bb5('0x35')](handleEntityNotFound(_0x2dfa05,null))[_0x9bb5('0x35')](function(_0xdc719f){if(_0xdc719f){return _0xdc719f[_0x9bb5('0x6f')](_0x57572c[_0x9bb5('0x42')][_0x9bb5('0x70')]);}})[_0x9bb5('0x35')](respondWithStatusCode(_0x2dfa05,null))['catch'](handleError(_0x2dfa05,null));};exports[_0x9bb5('0x71')]=function(_0x2165ff,_0x9ce4f,_0x127810){return db[_0x9bb5('0x72')][_0x9bb5('0x59')]({'where':{'id':_0x2165ff[_0x9bb5('0x58')]['id']}})[_0x9bb5('0x35')](handleEntityNotFound(_0x9ce4f,null))[_0x9bb5('0x35')](function(_0x1b6002){if(_0x1b6002){return _0x1b6002[_0x9bb5('0x71')](_0x2165ff['body']['ids'],_[_0x9bb5('0x73')](_0x2165ff[_0x9bb5('0x5b')],[_0x9bb5('0x70'),'id'])||{});}})[_0x9bb5('0x35')](respondWithResult(_0x9ce4f,null))[_0x9bb5('0x56')](handleError(_0x9ce4f,null));};exports[_0x9bb5('0x74')]=function(_0xe060af,_0x178e7d,_0x3d8ebf){var _0x351189={'raw':![],'where':{}};var _0x510114={};var _0x33b194={'count':0x0,'rows':[]};return db[_0x9bb5('0x3f')][_0x9bb5('0x66')]({'where':{'id':_0xe060af['params']['id']}})[_0x9bb5('0x35')](handleEntityNotFound(_0x178e7d,null))[_0x9bb5('0x35')](function(_0x83e753){if(_0x83e753){_0x510114[_0x9bb5('0x43')]=_[_0x9bb5('0x41')](db[_0x9bb5('0x72')][_0x9bb5('0x40')]);_0x510114[_0x9bb5('0x42')]=_[_0x9bb5('0x41')](_0xe060af[_0x9bb5('0x42')]);_0x510114[_0x9bb5('0x4d')]=_[_0x9bb5('0x45')](_0x510114['model'],_0x510114['query']);_0x351189[_0x9bb5('0x44')]=_[_0x9bb5('0x45')](_0x510114[_0x9bb5('0x43')],qs['fields'](_0xe060af[_0x9bb5('0x42')][_0x9bb5('0x46')]));_0x351189['attributes']=_0x351189['attributes'][_0x9bb5('0x47')]?_0x351189[_0x9bb5('0x44')]:_0x510114['model'];if(!_0xe060af['query']['hasOwnProperty'](_0x9bb5('0x67'))){_0x351189['limit']=qs[_0x9bb5('0x48')](_0xe060af['query']['limit']);_0x351189[_0x9bb5('0x49')]=qs[_0x9bb5('0x49')](_0xe060af['query'][_0x9bb5('0x49')]);}_0x351189[_0x9bb5('0x4a')]=qs[_0x9bb5('0x4b')](_0xe060af['query'][_0x9bb5('0x4b')]);_0x351189[_0x9bb5('0x4c')]=qs[_0x9bb5('0x4d')](_[_0x9bb5('0x4e')](_0xe060af[_0x9bb5('0x42')],_0x510114['filters']));_0x351189[_0x9bb5('0x4c')]['FaxAccountId']=_0x83e753['id'];if(_0xe060af[_0x9bb5('0x42')][_0x9bb5('0x4f')]){_0x351189['where']=_[_0x9bb5('0x50')](_0x351189['where'],{'$or':_[_0x9bb5('0x51')](_0x351189['attributes'],function(_0x441433){var _0x2aa694={};_0x2aa694[_0x441433]={'$like':'%'+_0xe060af[_0x9bb5('0x42')]['filter']+'%'};return _0x2aa694;})});}_0x351189=_[_0x9bb5('0x50')]({},_0x351189,_0xe060af[_0x9bb5('0x6e')]);return db[_0x9bb5('0x72')][_0x9bb5('0x2f')]({'where':_0x351189[_0x9bb5('0x4c')]})['then'](function(_0x19a4db){_0x33b194[_0x9bb5('0x2f')]=_0x19a4db;if(_0xe060af['query'][_0x9bb5('0x53')]){_0x351189[_0x9bb5('0x54')]=[{'model':db[_0x9bb5('0x75')],'as':_0x9bb5('0x76'),'required':![]},{'model':db['User'],'as':_0x9bb5('0x77'),'attributes':['name',_0x9bb5('0x78'),_0x9bb5('0x79')],'required':![]},{'model':db[_0x9bb5('0x7a')],'as':_0x9bb5('0x7b'),'attributes':['id','name',_0x9bb5('0x7c')],'where':_0xe060af[_0x9bb5('0x42')][_0x9bb5('0x7d')]?{'id':_0xe060af[_0x9bb5('0x42')]['tag']}:undefined,'required':_0xe060af['query']['tag']?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x351189);})[_0x9bb5('0x35')](function(_0x5c88ca){_0x33b194['rows']=_0x5c88ca;return _0x33b194;});}})[_0x9bb5('0x35')](respondWithFilteredResult(_0x178e7d,_0x351189))[_0x9bb5('0x56')](handleError(_0x178e7d,null));};exports['addApplications']=function(_0x1cad10,_0xdd60a5,_0x2bb40e){return db[_0x9bb5('0x3f')][_0x9bb5('0x66')]({'where':{'id':_0x1cad10[_0x9bb5('0x58')]['id']}})[_0x9bb5('0x35')](handleEntityNotFound(_0xdd60a5,null))[_0x9bb5('0x35')](function(_0x441b75){if(_0x441b75){return db[_0x9bb5('0x7e')]['transaction'](function(_0x5998f6){return db[_0x9bb5('0x7f')][_0x9bb5('0x36')]({'where':{'FaxAccountId':_0x1cad10[_0x9bb5('0x58')]['id']},'transaction':_0x5998f6})[_0x9bb5('0x35')](function(_0x333ad9){var _0x4c5c8a=_[_0x9bb5('0x51')](_0x1cad10[_0x9bb5('0x5b')],function(_0x126219){_0x126219['FaxAccountId']=_0x1cad10['params']['id'];return _0x126219;});return db[_0x9bb5('0x7f')][_0x9bb5('0x80')](_0x4c5c8a,{'transaction':_0x5998f6});});})[_0x9bb5('0x35')](function(){return db[_0x9bb5('0x7f')][_0x9bb5('0x81')]({'where':{'FaxAccountId':_0x1cad10[_0x9bb5('0x58')]['id']},'order':_0x9bb5('0x82')});});}})[_0x9bb5('0x35')](respondWithResult(_0xdd60a5,null))[_0x9bb5('0x56')](handleError(_0xdd60a5,null));};exports['getApplications']=function(_0x101d93,_0x35f13c,_0x1381e9){var _0x5491f4={};var _0xcc9943={};var _0xbb0b2b;var _0x2023a4;return db['FaxAccount'][_0x9bb5('0x66')]({'where':{'id':_0x101d93[_0x9bb5('0x58')]['id']}})[_0x9bb5('0x35')](handleEntityNotFound(_0x35f13c,null))[_0x9bb5('0x35')](function(_0x1c28e8){if(_0x1c28e8){_0xbb0b2b=_0x1c28e8;_0xcc9943[_0x9bb5('0x43')]=_[_0x9bb5('0x41')](db[_0x9bb5('0x7f')]['rawAttributes']);_0xcc9943[_0x9bb5('0x42')]=_['keys'](_0x101d93[_0x9bb5('0x42')]);_0xcc9943[_0x9bb5('0x4d')]=_['intersection'](_0xcc9943[_0x9bb5('0x43')],_0xcc9943[_0x9bb5('0x42')]);_0x5491f4['attributes']=_[_0x9bb5('0x45')](_0xcc9943['model'],qs[_0x9bb5('0x46')](_0x101d93[_0x9bb5('0x42')][_0x9bb5('0x46')]));_0x5491f4[_0x9bb5('0x44')]=_0x5491f4[_0x9bb5('0x44')][_0x9bb5('0x47')]?_0x5491f4[_0x9bb5('0x44')]:_0xcc9943[_0x9bb5('0x43')];_0x5491f4['order']=qs['sort'](_0x101d93[_0x9bb5('0x42')][_0x9bb5('0x4b')]);_0x5491f4[_0x9bb5('0x4c')]=qs[_0x9bb5('0x4d')](_[_0x9bb5('0x4e')](_0x101d93[_0x9bb5('0x42')],_0xcc9943[_0x9bb5('0x4d')]));if(_0x101d93[_0x9bb5('0x42')][_0x9bb5('0x4f')]){_0x5491f4['where']=_[_0x9bb5('0x50')](_0x5491f4[_0x9bb5('0x4c')],{'$or':_[_0x9bb5('0x51')](_0x5491f4[_0x9bb5('0x44')],function(_0x2f1595){var _0x5dac0b={};_0x5dac0b[_0x2f1595]={'$like':'%'+_0x101d93[_0x9bb5('0x42')]['filter']+'%'};return _0x5dac0b;})});}_0x5491f4=_[_0x9bb5('0x50')]({},_0x5491f4,_0x101d93[_0x9bb5('0x6e')]);return _0xbb0b2b[_0x9bb5('0x83')](_0x5491f4);}})[_0x9bb5('0x35')](function(_0x3f2556){if(_0x3f2556){_0x2023a4=_0x3f2556[_0x9bb5('0x47')];if(!_0x101d93['query'][_0x9bb5('0x6d')](_0x9bb5('0x67'))){_0x5491f4[_0x9bb5('0x48')]=qs[_0x9bb5('0x48')](_0x101d93[_0x9bb5('0x42')][_0x9bb5('0x48')]);_0x5491f4['offset']=qs[_0x9bb5('0x49')](_0x101d93[_0x9bb5('0x42')][_0x9bb5('0x49')]);}return _0xbb0b2b['getApplications'](_0x5491f4);}})[_0x9bb5('0x35')](function(_0x153c7b){if(_0x153c7b){return _0x153c7b?{'count':_0x2023a4,'rows':_0x153c7b}:null;}})[_0x9bb5('0x35')](respondWithResult(_0x35f13c,null))[_0x9bb5('0x56')](handleError(_0x35f13c,null));};function Extension(_0x2649ce,_0x845e2b,_0x2cd2af,_0x1cb3f2){this[_0x9bb5('0x84')]=_0x9bb5('0x85');this[_0x9bb5('0x86')]=_0x2649ce['localstationid'];this[_0x9bb5('0x87')]=_0x1cb3f2;this[_0x9bb5('0x88')]=_0x9bb5('0x89');this[_0x9bb5('0x8a')]=_0x9bb5('0x8b');this[_0x9bb5('0x68')]=_0x2649ce['id'];this[_0x9bb5('0x82')]=_0x845e2b;this[_0x9bb5('0x8c')]=_0x2cd2af;}function createExtensionsReciveFax(_0x97da7b){var _0x1f0b72=0x1;var _0x29c545=[];_0x29c545[_0x9bb5('0x8d')](new Extension(_0x97da7b,_0x1f0b72,'','Answer'));_0x1f0b72+=0x1;_0x29c545[_0x9bb5('0x8d')](new Extension(_0x97da7b,_0x1f0b72,_0x9bb5('0x8e'),'Set'));_0x1f0b72+=0x1;for(var _0x1a1d54 in _0x97da7b){if(_0x97da7b[_0x9bb5('0x6d')](_0x1a1d54)&&(_0x1a1d54==='ecm'||_0x1a1d54===_0x9bb5('0x8f')||_0x1a1d54===_0x9bb5('0x90')||_0x1a1d54==='faxdetect'||_0x1a1d54===_0x9bb5('0x91')||_0x1a1d54===_0x9bb5('0x92')||_0x1a1d54===_0x9bb5('0x93')||_0x1a1d54===_0x9bb5('0x94')||_0x1a1d54===_0x9bb5('0x95'))){_0x29c545[_0x9bb5('0x8d')](new Extension(_0x97da7b,_0x1f0b72,_0x9bb5('0x96')+_0x1a1d54+')='+_0x97da7b[_0x1a1d54],_0x9bb5('0x97')));_0x1f0b72+=0x1;}}_0x29c545[_0x9bb5('0x8d')](new Extension(_0x97da7b,_0x1f0b72,'6',_0x9bb5('0x98')));_0x1f0b72+=0x1;_0x29c545[_0x9bb5('0x8d')](new Extension(_0x97da7b,_0x1f0b72,_0x9bb5('0x99'),_0x9bb5('0x9a')));_0x1f0b72=0x0;return _0x29c545;}exports[_0x9bb5('0x9b')]=function(_0x376e31,_0x519392,_0x73645e){var _0x344ca6;return db[_0x9bb5('0x7e')][_0x9bb5('0x9c')](function(_0x4e4683){return db[_0x9bb5('0x3f')][_0x9bb5('0x5a')](_0x376e31[_0x9bb5('0x5b')],{'transaction':_0x4e4683})['then'](function(_0x14a858){_0x344ca6=_0x14a858[_0x9bb5('0x37')]({'plain':!![]});return db[_0x9bb5('0x9d')][_0x9bb5('0x80')](createExtensionsReciveFax(_0x344ca6),{'transaction':_0x4e4683});});})[_0x9bb5('0x35')](function(){return _0x344ca6;})[_0x9bb5('0x35')](respondWithResult(_0x519392,null))[_0x9bb5('0x56')](handleError(_0x519392,null));};exports[_0x9bb5('0x9e')]=function(_0x527255,_0x4fdd56,_0x39a2fc){var _0x1faaa2;return db[_0x9bb5('0x7e')][_0x9bb5('0x9c')](function(_0x47c76a){return db[_0x9bb5('0x3f')][_0x9bb5('0x34')](_0x527255[_0x9bb5('0x5b')],{'where':{'id':_0x527255['body']['id']},'transaction':_0x47c76a})['then'](function(_0x39d096){return db[_0x9bb5('0x9d')][_0x9bb5('0x36')]({'where':{'FaxAccountId':_0x527255[_0x9bb5('0x5b')]['id']},'transaction':_0x47c76a})[_0x9bb5('0x35')](function(_0x59285c){return db[_0x9bb5('0x9d')][_0x9bb5('0x80')](createExtensionsReciveFax(_[_0x9bb5('0x73')](_0x527255[_0x9bb5('0x5b')],['tech',_0x9bb5('0x9f'),_0x9bb5('0xa0'),_0x9bb5('0xa1'),_0x9bb5('0xa2'),_0x9bb5('0xa3')])),{'transaction':_0x47c76a});});});})[_0x9bb5('0x35')](function(){return db['FaxAccount'][_0x9bb5('0xa4')](_0x527255[_0x9bb5('0x5b')]['id']);})[_0x9bb5('0x35')](respondWithResult(_0x4fdd56,null))[_0x9bb5('0x56')](handleError(_0x4fdd56,null));};exports[_0x9bb5('0xa5')]=function(_0x5615f3,_0x713d3a,_0x1198eb){var _0x2d128c={'raw':!![],'where':{}};var _0x5df713={};var _0xf7c613={'count':0x0,'rows':[]};return db[_0x9bb5('0x3f')]['findOne']({'where':{'id':_0x5615f3['params']['id']}})[_0x9bb5('0x35')](handleEntityNotFound(_0x713d3a,null))[_0x9bb5('0x35')](function(_0x50b387){if(_0x50b387){_0x5df713[_0x9bb5('0x43')]=_[_0x9bb5('0x41')](db[_0x9bb5('0xa6')][_0x9bb5('0x40')]);_0x5df713['query']=_[_0x9bb5('0x41')](_0x5615f3[_0x9bb5('0x42')]);_0x5df713[_0x9bb5('0x4d')]=_[_0x9bb5('0x45')](_0x5df713[_0x9bb5('0x43')],_0x5df713[_0x9bb5('0x42')]);_0x2d128c[_0x9bb5('0x44')]=_[_0x9bb5('0x45')](_0x5df713[_0x9bb5('0x43')],qs[_0x9bb5('0x46')](_0x5615f3['query'][_0x9bb5('0x46')]));_0x2d128c[_0x9bb5('0x44')]=_0x2d128c[_0x9bb5('0x44')]['length']?_0x2d128c[_0x9bb5('0x44')]:_0x5df713[_0x9bb5('0x43')];if(!_0x5615f3[_0x9bb5('0x42')][_0x9bb5('0x6d')]('nolimit')){_0x2d128c['limit']=qs[_0x9bb5('0x48')](_0x5615f3[_0x9bb5('0x42')][_0x9bb5('0x48')]);_0x2d128c[_0x9bb5('0x49')]=qs[_0x9bb5('0x49')](_0x5615f3[_0x9bb5('0x42')]['offset']);}_0x2d128c[_0x9bb5('0x4a')]=qs['sort'](_0x5615f3['query'][_0x9bb5('0x4b')]);_0x2d128c[_0x9bb5('0x4c')]=qs[_0x9bb5('0x4d')](_['pick'](_0x5615f3[_0x9bb5('0x42')],_0x5df713[_0x9bb5('0x4d')]));_0x2d128c[_0x9bb5('0x4c')][_0x9bb5('0x68')]=_0x50b387['id'];if(_0x5615f3['query']['filter']){_0x2d128c[_0x9bb5('0x4c')]=_['merge'](_0x2d128c[_0x9bb5('0x4c')],{'$or':_[_0x9bb5('0x51')](_0x2d128c['attributes'],function(_0x57f48f){var _0x574ae4={};_0x574ae4[_0x57f48f]={'$like':'%'+_0x5615f3[_0x9bb5('0x42')][_0x9bb5('0x4f')]+'%'};return _0x574ae4;})});}if(_0x5615f3[_0x9bb5('0x42')][_0x9bb5('0xa7')]){var _0x2ff37f=_0x5615f3[_0x9bb5('0x42')][_0x9bb5('0xa7')]['split'](',');var _0x4a6ac3={};_0x4a6ac3[_0x2ff37f[0x0]]={'$gte':moment(_0x2ff37f[0x1])[_0x9bb5('0xa8')](_0x9bb5('0xa9'))};_0x2d128c[_0x9bb5('0x4c')]=_[_0x9bb5('0x50')](_0x2d128c[_0x9bb5('0x4c')],_0x4a6ac3);}_0x2d128c=_['merge']({},_0x2d128c,_0x5615f3['options']);return db[_0x9bb5('0xa6')][_0x9bb5('0x2f')]({'where':_0x2d128c[_0x9bb5('0x4c')]})['then'](function(_0x3ee21b){_0xf7c613[_0x9bb5('0x2f')]=_0x3ee21b;if(_0x5615f3[_0x9bb5('0x42')][_0x9bb5('0x53')]){_0x2d128c[_0x9bb5('0x54')]=[{'all':!![]}];}return db[_0x9bb5('0xa6')][_0x9bb5('0x69')](_0x2d128c);})[_0x9bb5('0x35')](function(_0x2cebc7){_0xf7c613['rows']=_0x2cebc7;return _0xf7c613;});}})['then'](respondWithFilteredResult(_0x713d3a,_0x2d128c))[_0x9bb5('0x56')](handleError(_0x713d3a,null));};exports[_0x9bb5('0xaa')]=function(_0x435017,_0x21c04e,_0x4cde01){var _0x1c4c2b,_0x273b26={},_0x1fafb8;if(_0x435017[_0x9bb5('0x5b')]['to']){_0x1fafb8=_0x435017[_0x9bb5('0x5b')]['to'][0x0];}return db[_0x9bb5('0x3f')][_0x9bb5('0x59')]({'where':{'id':_0x435017['params']['id']},'include':[{'model':db[_0x9bb5('0xab')],'as':_0x9bb5('0xac'),'include':[{'model':db[_0x9bb5('0x75')],'as':_0x9bb5('0xad'),'where':{'fax':_0x1fafb8},'limit':0x1,'order':[[_0x9bb5('0xa1'),_0x9bb5('0xae')]]}]}]})[_0x9bb5('0x35')](handleEntityNotFound(_0x21c04e,null))[_0x9bb5('0x35')](function(_0x215dd3){_0x1c4c2b=_0x215dd3;if(_0x435017['body'][_0x9bb5('0xaf')]&&_0x435017['body'][_0x9bb5('0xaf')][_0x9bb5('0x47')]){for(var _0x582956=0x0;_0x582956<_0x435017['body'][_0x9bb5('0xaf')][_0x9bb5('0x47')];_0x582956+=0x1){_0x435017[_0x9bb5('0x5b')][_0x9bb5('0xaf')][_0x582956]={'filename':_0x435017[_0x9bb5('0x5b')][_0x9bb5('0xaf')][_0x582956][_0x9bb5('0x3c')],'id':_0x435017[_0x9bb5('0x5b')]['attachments'][_0x582956]['id'],'path':path[_0x9bb5('0xb0')](config[_0x9bb5('0xb1')],'server/files/attachments',_0x435017[_0x9bb5('0x5b')][_0x9bb5('0xaf')][_0x582956][_0x9bb5('0xb2')])};}}return respondWithRpcPromise(_0x9bb5('0xb3'),'CheckAfterSend',{'FaxAccountId':_[_0x9bb5('0xb4')](_0x435017[_0x9bb5('0x58')]['id'])?undefined:_0x435017[_0x9bb5('0x58')]['id'],'path':_[_0x9bb5('0xb4')](_0x435017[_0x9bb5('0x5b')][_0x9bb5('0xaf')][0x0][_0x9bb5('0xb5')])?undefined:_0x435017['body']['attachments'][0x0]['path'],'fax':_[_0x9bb5('0xb4')](_0x435017['body']['to'][0x0])?undefined:_0x435017[_0x9bb5('0x5b')]['to'][0x0]},client9002);})['then'](function(){if(_0x1c4c2b){if(_['isNil'](_0x435017['body']['from'])){_0x435017[_0x9bb5('0x5b')][_0x9bb5('0xb6')]=util['format']('\x22%s\x22\x20<%s>',_0x1c4c2b[_0x9bb5('0x3c')],_0x1c4c2b[_0x9bb5('0xb7')]);}if(_0x1c4c2b[_0x9bb5('0xac')]){if(_0x1c4c2b['List'][_0x9bb5('0xad')][_0x9bb5('0x47')]){return _0x1c4c2b['List'][_0x9bb5('0xad')][0x0];}else{return db['CmContact'][_0x9bb5('0x5a')](_[_0x9bb5('0x1b')](_0x435017[_0x9bb5('0x5b')],{'firstName':_0x435017['body']['to'][0x0],'phone':_0x435017[_0x9bb5('0x5b')]['to'][0x0],'fax':_0x435017[_0x9bb5('0x5b')]['to'][0x0],'ListId':_0x1c4c2b[_0x9bb5('0xa3')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x9bb5('0xb8'));}})[_0x9bb5('0x35')](function(_0x344258){if(_0x344258){return db[_0x9bb5('0x72')][_0x9bb5('0x59')]({'where':{'ContactId':_0x344258['id'],'closed':![],'FaxAccountId':_0x1c4c2b['id']}})[_0x9bb5('0x35')](function(_0x4ff83d){if(_0x4ff83d){return[_0x4ff83d,![]];}return db[_0x9bb5('0x72')][_0x9bb5('0x5a')]({'UserId':_0x435017[_0x9bb5('0x5d')]['id'],'ContactId':_0x344258['id'],'FaxAccountId':_0x1c4c2b['id'],'fax':_0x435017[_0x9bb5('0x5b')]['to'][0x0],'firstMsgDirection':_0x9bb5('0xb9'),'Messages':[_['merge'](_0x435017[_0x9bb5('0x5b')],{'read':![],'body':_0x435017[_0x9bb5('0x5b')][_0x9bb5('0xaf')][0x0][_0x9bb5('0xba')],'FaxAccountId':_0x1c4c2b['id'],'UserId':_0x435017[_0x9bb5('0x5d')]['id'],'ContactId':_0x344258['id'],'AttachmentId':_0x435017[_0x9bb5('0x5b')][_0x9bb5('0xaf')][0x0]['id']})]},{'include':[{'model':db[_0x9bb5('0xa6')],'as':_0x9bb5('0xbb')}]})[_0x9bb5('0x35')](function(_0x38874d){return[_0x38874d,!![]];});});}else{throw new Error(_0x9bb5('0xbc'));}})[_0x9bb5('0xbd')](function(_0x3c34c,_0x275bea){if(_0x275bea){return _0x3c34c;}return db[_0x9bb5('0xa6')][_0x9bb5('0x5a')]({'direction':_0x9bb5('0xb9'),'read':![],'body':_0x435017['body'][_0x9bb5('0xaf')][0x0][_0x9bb5('0xba')],'FaxAccountId':_0x1c4c2b['id'],'FaxInteractionId':_0x3c34c['id'],'UserId':_0x435017[_0x9bb5('0x5d')]['id'],'ContactId':_0x3c34c['ContactId'],'AttachmentId':_0x435017[_0x9bb5('0x5b')][_0x9bb5('0xaf')][0x0]['id']})[_0x9bb5('0x35')](function(_0x434f55){_0x3c34c[_0x9bb5('0xbe')][_0x9bb5('0xbb')]=[];_0x3c34c[_0x9bb5('0xbe')]['Messages'][_0x9bb5('0x8d')](_0x434f55[_0x9bb5('0xbe')]);return _0x3c34c;});})[_0x9bb5('0x35')](function(_0x189cf7){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x9bb5('0xb4')](_0x435017['params']['id'])?undefined:_0x435017['params']['id'],'path':_[_0x9bb5('0xb4')](_0x435017[_0x9bb5('0x5b')][_0x9bb5('0xaf')][0x0][_0x9bb5('0xb5')])?undefined:_0x435017[_0x9bb5('0x5b')][_0x9bb5('0xaf')][0x0][_0x9bb5('0xb5')],'fax':_[_0x9bb5('0xb4')](_0x435017['body']['to'][0x0])?undefined:_0x435017[_0x9bb5('0x5b')]['to'][0x0],'AttachmentId':_0x435017[_0x9bb5('0x5b')]['attachments'][0x0]['id']},client9002)['then'](function(_0x597a00){logger[_0x9bb5('0x23')](_0x9bb5('0xbf'),_0x597a00);})[_0x9bb5('0x56')](function(_0xd276dc){logger[_0x9bb5('0x23')](_0x9bb5('0xbf'),_0xd276dc);});return _0x189cf7;})[_0x9bb5('0x35')](respondWithResult(_0x21c04e,null))[_0x9bb5('0x56')](handleError(_0x21c04e,null));};exports[_0x9bb5('0xc0')]=function(_0x1cf0bd,_0x2bfce8,_0x10c1a2){return db['FaxAccount'][_0x9bb5('0x59')]({'where':{'id':_0x1cf0bd[_0x9bb5('0x58')]['id']}})[_0x9bb5('0x35')](handleEntityNotFound(_0x2bfce8,null))[_0x9bb5('0x35')](function(_0x30a5f0){if(_0x30a5f0){return _0x30a5f0[_0x9bb5('0xc0')](_0x1cf0bd[_0x9bb5('0x5b')][_0x9bb5('0x70')],_[_0x9bb5('0x73')](_0x1cf0bd['body'],['ids','id'])||{})['spread'](function(_0x4977de){for(var _0x5bcf75=0x0;_0x5bcf75<_0x1cf0bd['body'][_0x9bb5('0x70')][_0x9bb5('0x47')];_0x5bcf75+=0x1){socket['emit']('userFaxAccount:save',{'UserId':_0x1cf0bd[_0x9bb5('0x5b')]['ids'][_0x5bcf75],'FaxAccountId':_0x1cf0bd['params']['id']});}return _0x4977de;});}})['then'](respondWithResult(_0x2bfce8,null))[_0x9bb5('0x56')](handleError(_0x2bfce8,null));};exports[_0x9bb5('0xc1')]=function(_0x374379,_0x2f5516,_0x30a5f5){return db['FaxAccount'][_0x9bb5('0x59')]({'where':{'id':_0x374379[_0x9bb5('0x58')]['id']}})[_0x9bb5('0x35')](handleEntityNotFound(_0x2f5516,null))[_0x9bb5('0x35')](function(_0x2e1bb8){if(_0x2e1bb8){return _0x2e1bb8['removeAgents'](_0x374379['query']['ids'])[_0x9bb5('0x35')](function(){if(_[_0x9bb5('0xc2')](_0x374379[_0x9bb5('0x42')]['ids'])){for(var _0x251027=0x0;_0x251027<_0x374379['query']['ids'][_0x9bb5('0x47')];_0x251027+=0x1){socket[_0x9bb5('0xc3')](_0x9bb5('0xc4'),{'UserId':Number(_0x374379[_0x9bb5('0x42')][_0x9bb5('0x70')][_0x251027]),'FaxAccountId':Number(_0x374379['params']['id'])});}}else{socket[_0x9bb5('0xc3')](_0x9bb5('0xc4'),{'UserId':Number(_0x374379[_0x9bb5('0x42')][_0x9bb5('0x70')]),'FaxAccountId':Number(_0x374379[_0x9bb5('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x2f5516,null))[_0x9bb5('0x56')](handleError(_0x2f5516,null));};exports[_0x9bb5('0xc5')]=function(_0x5ee595,_0x5f1daa,_0x5cbb00){var _0x42fc9f={};var _0x5ec05a={};var _0x30c50a;var _0x59475c;return db[_0x9bb5('0x3f')][_0x9bb5('0x66')]({'where':{'id':_0x5ee595[_0x9bb5('0x58')]['id']}})[_0x9bb5('0x35')](handleEntityNotFound(_0x5f1daa,null))[_0x9bb5('0x35')](function(_0x284244){if(_0x284244){_0x30c50a=_0x284244;_0x5ec05a[_0x9bb5('0x43')]=_[_0x9bb5('0x41')](db[_0x9bb5('0xc6')][_0x9bb5('0x40')]);_0x5ec05a['query']=_['keys'](_0x5ee595[_0x9bb5('0x42')]);_0x5ec05a[_0x9bb5('0x4d')]=_[_0x9bb5('0x45')](_0x5ec05a['model'],_0x5ec05a['query']);_0x42fc9f[_0x9bb5('0x44')]=_[_0x9bb5('0x45')](_0x5ec05a[_0x9bb5('0x43')],qs[_0x9bb5('0x46')](_0x5ee595[_0x9bb5('0x42')][_0x9bb5('0x46')]));_0x42fc9f[_0x9bb5('0x44')]=_0x42fc9f[_0x9bb5('0x44')][_0x9bb5('0x47')]?_0x42fc9f['attributes']:_0x5ec05a[_0x9bb5('0x43')];_0x42fc9f[_0x9bb5('0x4a')]=qs[_0x9bb5('0x4b')](_0x5ee595[_0x9bb5('0x42')][_0x9bb5('0x4b')]);_0x42fc9f[_0x9bb5('0x4c')]=qs[_0x9bb5('0x4d')](_[_0x9bb5('0x4e')](_0x5ee595[_0x9bb5('0x42')],_0x5ec05a['filters']));if(_0x5ee595[_0x9bb5('0x42')][_0x9bb5('0x4f')]){_0x42fc9f[_0x9bb5('0x4c')]=_[_0x9bb5('0x50')](_0x42fc9f[_0x9bb5('0x4c')],{'$or':_['map'](_0x42fc9f['attributes'],function(_0x980dd2){var _0x3282b7={};_0x3282b7[_0x980dd2]={'$like':'%'+_0x5ee595[_0x9bb5('0x42')][_0x9bb5('0x4f')]+'%'};return _0x3282b7;})});}_0x42fc9f=_[_0x9bb5('0x50')]({},_0x42fc9f,_0x5ee595['options']);return _0x30c50a[_0x9bb5('0xc5')](_0x42fc9f);}})[_0x9bb5('0x35')](function(_0x27a6ff){if(_0x27a6ff){_0x59475c=_0x27a6ff['length'];if(!_0x5ee595[_0x9bb5('0x42')][_0x9bb5('0x6d')]('nolimit')){_0x42fc9f[_0x9bb5('0x48')]=qs[_0x9bb5('0x48')](_0x5ee595[_0x9bb5('0x42')]['limit']);_0x42fc9f[_0x9bb5('0x49')]=qs[_0x9bb5('0x49')](_0x5ee595[_0x9bb5('0x42')][_0x9bb5('0x49')]);}return _0x30c50a[_0x9bb5('0xc5')](_0x42fc9f);}})[_0x9bb5('0x35')](function(_0x55552c){if(_0x55552c){return _0x55552c?{'count':_0x59475c,'rows':_0x55552c}:null;}})[_0x9bb5('0x35')](respondWithResult(_0x5f1daa,null))[_0x9bb5('0x56')](handleError(_0x5f1daa,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 5065530..f515c6e 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 _0x6c3e=['exports','events','FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x23ec06,_0x561142){var _0x2831d4=function(_0x3802bc){while(--_0x3802bc){_0x23ec06['push'](_0x23ec06['shift']());}};_0x2831d4(++_0x561142);}(_0x6c3e,0x65));var _0xe6c3=function(_0x21a3d1,_0x2ab8d3){_0x21a3d1=_0x21a3d1-0x0;var _0x56bb57=_0x6c3e[_0x21a3d1];return _0x56bb57;};'use strict';var EventEmitter=require(_0xe6c3('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xe6c3('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xe6c3('0x2')](0x0);var events={'afterCreate':_0xe6c3('0x3'),'afterUpdate':_0xe6c3('0x4'),'afterDestroy':_0xe6c3('0x5')};function emitEvent(_0x36cd48){return function(_0x36b6e3,_0x587714,_0x389083){FaxAccountEvents[_0xe6c3('0x6')](_0x36cd48+':'+_0x36b6e3['id'],_0x36b6e3);FaxAccountEvents[_0xe6c3('0x6')](_0x36cd48,_0x36b6e3);_0x389083(null);};}for(var e in events){if(events[_0xe6c3('0x7')](e)){var event=events[e];FaxAccount[_0xe6c3('0x8')](e,emitEvent(event));}}module[_0xe6c3('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0xab58=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','FaxAccount'];(function(_0x217cce,_0x26e9ec){var _0x160643=function(_0x578183){while(--_0x578183){_0x217cce['push'](_0x217cce['shift']());}};_0x160643(++_0x26e9ec);}(_0xab58,0x139));var _0x8ab5=function(_0x38ff1a,_0x133717){_0x38ff1a=_0x38ff1a-0x0;var _0x1b44f5=_0xab58[_0x38ff1a];return _0x1b44f5;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x8ab5('0x0'))['db'][_0x8ab5('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x8ab5('0x2')](0x0);var events={'afterCreate':_0x8ab5('0x3'),'afterUpdate':_0x8ab5('0x4'),'afterDestroy':_0x8ab5('0x5')};function emitEvent(_0x515bfb){return function(_0x1a1e43,_0x1b6da3,_0x2490a7){FaxAccountEvents[_0x8ab5('0x6')](_0x515bfb+':'+_0x1a1e43['id'],_0x1a1e43);FaxAccountEvents[_0x8ab5('0x6')](_0x515bfb,_0x1a1e43);_0x2490a7(null);};}for(var e in events){if(events[_0x8ab5('0x7')](e)){var event=events[e];FaxAccount[_0x8ab5('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 0ac8cfc..688ce3b 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 _0x25b7=['request-promise','path','rimraf','exports','define','FaxAccount','fax_accounts','lodash','../../config/logger','api','bluebird'];(function(_0x5400b,_0x55943a){var _0x36a39b=function(_0x56963c){while(--_0x56963c){_0x5400b['push'](_0x5400b['shift']());}};_0x36a39b(++_0x55943a);}(_0x25b7,0x1b4));var _0x725b=function(_0x4e5fe6,_0x21c6c8){_0x4e5fe6=_0x4e5fe6-0x0;var _0x502828=_0x25b7[_0x4e5fe6];return _0x502828;};'use strict';var _=require(_0x725b('0x0'));var util=require('util');var logger=require(_0x725b('0x1'))(_0x725b('0x2'));var moment=require('moment');var BPromise=require(_0x725b('0x3'));var rp=require(_0x725b('0x4'));var fs=require('fs');var path=require(_0x725b('0x5'));var rimraf=require(_0x725b('0x6'));var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module[_0x725b('0x7')]=function(_0x1f22e6,_0x3c7ee6){return _0x1f22e6[_0x725b('0x8')](_0x725b('0x9'),attributes,{'tableName':_0x725b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa469=['FaxAccount','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa469,0x7a));var _0x9a46=function(_0x45563b,_0x3e09fb){_0x45563b=_0x45563b-0x0;var _0x337313=_0xa469[_0x45563b];return _0x337313;};'use strict';var _=require('lodash');var util=require(_0x9a46('0x0'));var logger=require('../../config/logger')(_0x9a46('0x1'));var moment=require(_0x9a46('0x2'));var BPromise=require(_0x9a46('0x3'));var rp=require(_0x9a46('0x4'));var fs=require('fs');var path=require(_0x9a46('0x5'));var rimraf=require(_0x9a46('0x6'));var config=require(_0x9a46('0x7'));var attributes=require(_0x9a46('0x8'));module[_0x9a46('0x9')]=function(_0x505914,_0x32b932){return _0x505914['define'](_0x9a46('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 2d09e2d..fe07d3a 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 _0xd2df=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','where','attributes','limit','map','include','model','stringify','NotifyFaxAccount','fax','CmContact','then','Sequelize','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','body','isNil','from','ValidationError','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','Contacts','DESC','FaxApplication','Applications','get','account','applications','list','orderBy','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','push','close','unmanaged','created','interaction','ContactId','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util'];(function(_0x293185,_0x15780c){var _0x2a1d0=function(_0x5dbb3f){while(--_0x5dbb3f){_0x293185['push'](_0x293185['shift']());}};_0x2a1d0(++_0x15780c);}(_0xd2df,0x10f));var _0xfd2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2df[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfd2d('0x0'));var util=require(_0xfd2d('0x1'));var moment=require(_0xfd2d('0x2'));var BPromise=require(_0xfd2d('0x3'));var rs=require(_0xfd2d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd2d('0x5'))['db'];var utils=require(_0xfd2d('0x6'));var logger=require(_0xfd2d('0x7'))(_0xfd2d('0x8'));var config=require(_0xfd2d('0x9'));var jayson=require(_0xfd2d('0xa'));var client=jayson[_0xfd2d('0xb')][_0xfd2d('0xc')]({'port':0x232c});config[_0xfd2d('0xd')]=_[_0xfd2d('0xe')](config[_0xfd2d('0xd')],{'host':_0xfd2d('0xf'),'port':0x18eb});var socket=require(_0xfd2d('0x10'))(new Redis(config[_0xfd2d('0xd')]));require(_0xfd2d('0x11'))[_0xfd2d('0x12')](socket);function respondWithRpcPromise(_0xe751fa,_0x1ca3ce,_0x19623d){return new BPromise(function(_0x251c0b,_0x2a3475){return client[_0xfd2d('0x13')](_0xe751fa,_0x19623d)['then'](function(_0x38c774){logger[_0xfd2d('0x14')](_0xfd2d('0x15'),_0x1ca3ce,_0xfd2d('0x16'));logger[_0xfd2d('0x17')](_0xfd2d('0x18'),_0x1ca3ce,_0xfd2d('0x16'),JSON['stringify'](_0x38c774));if(_0x38c774[_0xfd2d('0x19')]){if(_0x38c774[_0xfd2d('0x19')][_0xfd2d('0x1a')]===0x1f4){logger[_0xfd2d('0x19')]('FaxAccount,\x20%s,\x20%s',_0x1ca3ce,_0x38c774[_0xfd2d('0x19')][_0xfd2d('0x1b')]);return _0x2a3475(_0x38c774['error']['message']);}logger[_0xfd2d('0x19')]('FaxAccount,\x20%s,\x20%s',_0x1ca3ce,_0x38c774[_0xfd2d('0x19')]['message']);return _0x251c0b(_0x38c774['error'][_0xfd2d('0x1b')]);}else{logger[_0xfd2d('0x14')](_0xfd2d('0x15'),_0x1ca3ce,_0xfd2d('0x16'));_0x251c0b(_0x38c774[_0xfd2d('0x1c')][_0xfd2d('0x1b')]);}})[_0xfd2d('0x1d')](function(_0x1083f5){logger['error'](_0xfd2d('0x15'),_0x1ca3ce,_0x1083f5);_0x2a3475(_0x1083f5);});});}exports[_0xfd2d('0x1e')]=function(_0x272b57){var _0xb5feca=this;return new Promise(function(_0x42786c,_0x175c95){return db[_0xfd2d('0x1f')][_0xfd2d('0x20')]({'raw':_0x272b57['options']?_0x272b57[_0xfd2d('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x272b57[_0xfd2d('0x21')]?_0x272b57['options'][_0xfd2d('0x22')]||null:null,'attributes':_0x272b57[_0xfd2d('0x21')]?_0x272b57[_0xfd2d('0x21')][_0xfd2d('0x23')]||null:null,'limit':_0x272b57[_0xfd2d('0x21')]?_0x272b57[_0xfd2d('0x21')][_0xfd2d('0x24')]||null:null,'include':_0x272b57['options']?_0x272b57['options']['include']?_[_0xfd2d('0x25')](_0x272b57['options'][_0xfd2d('0x26')],function(_0x2c6b37){return{'model':db[_0x2c6b37[_0xfd2d('0x27')]],'as':_0x2c6b37['as'],'attributes':_0x2c6b37['attributes'],'include':_0x2c6b37[_0xfd2d('0x26')]?_['map'](_0x2c6b37[_0xfd2d('0x26')],function(_0x40a085){return{'model':db[_0x40a085[_0xfd2d('0x27')]],'as':_0x40a085['as'],'attributes':_0x40a085[_0xfd2d('0x23')],'include':_0x40a085['include']?_['map'](_0x40a085[_0xfd2d('0x26')],function(_0x22edd4){return{'model':db[_0x22edd4[_0xfd2d('0x27')]],'as':_0x22edd4['as'],'attributes':_0x22edd4[_0xfd2d('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1bb80e){logger[_0xfd2d('0x14')](_0xfd2d('0x1e'),_0x272b57);logger[_0xfd2d('0x17')](_0xfd2d('0x1e'),_0x272b57,JSON[_0xfd2d('0x28')](_0x1bb80e));_0x42786c(_0x1bb80e);})[_0xfd2d('0x1d')](function(_0x1e3e9c){logger[_0xfd2d('0x19')](_0xfd2d('0x1e'),_0x1e3e9c[_0xfd2d('0x1b')],_0x272b57);_0x175c95(_0xb5feca[_0xfd2d('0x19')](0x1f4,_0x1e3e9c[_0xfd2d('0x1b')]));});});};exports[_0xfd2d('0x29')]=function(_0x5bb17e,_0x14e5cf,_0x3b8eba){var _0x325c48=this;return new Promise(function(_0x463926,_0xdf0de4){var _0x260a8c={'body':_0x5bb17e['body'],'channel':_0xfd2d('0x2a')};var _0x57c554=[];var _0x38df3e=[];var _0x1f16d6={};return db[_0xfd2d('0x2b')]['describe']()[_0xfd2d('0x2c')](function(_0x15255e){if(!_0x15255e){throw new db[(_0xfd2d('0x2d'))]['ValidationError'](_0xfd2d('0x2e'));}_0x57c554=_[_0xfd2d('0x2f')](_[_0xfd2d('0x30')](_0x15255e),['createdAt',_0xfd2d('0x31')]);_0x38df3e=_['difference'](_[_0xfd2d('0x30')](_0x15255e),[_0xfd2d('0x32'),_0xfd2d('0x31'),_0xfd2d('0x33'),_0xfd2d('0x34')]);if(_0x5bb17e[_0xfd2d('0x35')]['id']){delete _0x5bb17e[_0xfd2d('0x35')]['id'];}if(_[_0xfd2d('0x36')](_0x5bb17e[_0xfd2d('0x35')][_0xfd2d('0x37')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0xfd2d('0x36')](_0x5bb17e[_0xfd2d('0x35')]['body'])||_0x5bb17e[_0xfd2d('0x35')][_0xfd2d('0x35')]===''){throw new db[(_0xfd2d('0x2d'))][(_0xfd2d('0x38'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xfd2d('0x36')](_0x5bb17e['body'][_0xfd2d('0x39')])){throw new db[(_0xfd2d('0x2d'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x38df3e);}if(!_[_0xfd2d('0x3a')](_0x38df3e,_0x5bb17e[_0xfd2d('0x35')][_0xfd2d('0x39')])){throw new db[(_0xfd2d('0x2d'))]['ValidationError'](_0xfd2d('0x3b')+_0x38df3e);}_0x1f16d6[_0x5bb17e[_0xfd2d('0x35')]['mapKey']]=_0x5bb17e[_0xfd2d('0x35')][_0xfd2d('0x37')];})[_0xfd2d('0x2c')](function(){return db[_0xfd2d('0x1f')][_0xfd2d('0x3c')]({'where':{'id':_0x5bb17e['account']['id']},'include':[{'model':db[_0xfd2d('0x3d')],'as':_0xfd2d('0x3e'),'include':[{'model':db[_0xfd2d('0x2b')],'as':_0xfd2d('0x3f'),'where':_0x1f16d6,'limit':0x1,'order':[['updatedAt',_0xfd2d('0x40')]]}]},{'model':db[_0xfd2d('0x41')],'as':_0xfd2d('0x42')}]});})[_0xfd2d('0x2c')](function(_0x1c3699){if(_0x1c3699&&_0x1c3699[_0xfd2d('0x3e')]){var _0x528f43=_0x1c3699[_0xfd2d('0x43')]({'plain':!![]});_0x260a8c[_0xfd2d('0x44')]=_0x528f43;_0x260a8c[_0xfd2d('0x45')]=_0x528f43[_0xfd2d('0x42')];_0x260a8c[_0xfd2d('0x46')]=_0x528f43[_0xfd2d('0x3e')];_0x260a8c['applications']=_[_0xfd2d('0x47')](_0x260a8c[_0xfd2d('0x45')],['priority'],['asc']);if(_0x260a8c['account'][_0xfd2d('0x42')]){delete _0x260a8c[_0xfd2d('0x44')][_0xfd2d('0x42')];}if(_0x260a8c['account'][_0xfd2d('0x3e')]&&_0x260a8c[_0xfd2d('0x44')][_0xfd2d('0x3e')][_0xfd2d('0x3f')][_0xfd2d('0x48')]){return _0x260a8c['account'][_0xfd2d('0x3e')][_0xfd2d('0x3f')][0x0];}var _0x46be97=_[_0xfd2d('0xe')](_0x5bb17e[_0xfd2d('0x35')],{'firstName':_0x5bb17e['body'][_0xfd2d('0x37')],'ListId':_0x528f43[_0xfd2d('0x34')]});_0x46be97[_0x5bb17e[_0xfd2d('0x35')][_0xfd2d('0x39')]]=_0x5bb17e[_0xfd2d('0x35')]['from'];return db[_0xfd2d('0x2b')][_0xfd2d('0x49')](_0x46be97,{'fields':_0x57c554,'raw':!![]});}})['then'](function(_0xd9474a){_0x260a8c[_0xfd2d('0x4a')]=_0xd9474a;if(_0xd9474a){var _0x11cd94={'ContactId':_0xd9474a['id'],'FaxAccountId':_0x5bb17e[_0xfd2d('0x44')]['id'],'fax':_0xd9474a[_0xfd2d('0x2a')]};return db[_0xfd2d('0x4b')][_0xfd2d('0x3c')]({'where':{'ContactId':_0xd9474a['id'],'closed':![],'FaxAccountId':_0x5bb17e[_0xfd2d('0x44')]['id']}})[_0xfd2d('0x2c')](function(_0x1f0386){if(_0x1f0386){return[_0x1f0386,![]];}return db[_0xfd2d('0x4b')]['create'](_0x11cd94)['then'](function(_0x285e8f){return[_0x285e8f,!![]];});});}else{throw new Error(_0xfd2d('0x4c'));}})[_0xfd2d('0x4d')](function(_0x64b1c3,_0x2bbedb){var _0xc08a7=_0x64b1c3[_0xfd2d('0x43')]({'plain':!![]});if(_0x2bbedb){if(_0x260a8c[_0xfd2d('0x44')]['autoclose']){_0x260a8c['applications'][_0xfd2d('0x4e')]({'id':0x0,'priority':_0x260a8c[_0xfd2d('0x45')][_0xfd2d('0x48')]+0x1,'app':_0xfd2d('0x4f'),'appdata':_0xfd2d('0x50'),'interval':'*,*,*,*'});}_0xc08a7[_0xfd2d('0x51')]=!![];}else{_0xc08a7[_0xfd2d('0x51')]=![];}_0x260a8c[_0xfd2d('0x52')]=_0xc08a7;return db['FaxMessage']['create']({'body':_0x5bb17e[_0xfd2d('0x35')][_0xfd2d('0x35')],'FaxAccountId':_0x5bb17e['account']['id'],'FaxInteractionId':_0x64b1c3['id'],'direction':'in','ContactId':_0x64b1c3[_0xfd2d('0x53')],'AttachmentId':_0x5bb17e[_0xfd2d('0x35')]['AttachmentId']});})[_0xfd2d('0x2c')](function(_0xc7adff){_0x260a8c[_0xfd2d('0x1b')]=_0xc7adff;if(_0x260a8c['interaction'][_0xfd2d('0x54')]){return db[_0xfd2d('0x55')][_0xfd2d('0x3c')]({'attributes':['id',_0xfd2d('0x56')],'where':{'id':_0x260a8c[_0xfd2d('0x52')][_0xfd2d('0x54')]}})['then'](function(_0x3d87e4){if(_0x3d87e4){_0x260a8c[_0xfd2d('0x45')]['unshift']({'id':0x0,'priority':0x0,'app':_0xfd2d('0x57'),'appdata':_0x3d87e4['name']+','+(_0x260a8c[_0xfd2d('0x44')][_0xfd2d('0x58')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xfd2d('0x59'),_0xfd2d('0x5a'),_0x260a8c);});}return respondWithRpcPromise(_0xfd2d('0x59'),'startRouting',_0x260a8c);})[_0xfd2d('0x2c')](function(_0x923ffa){_0x463926(_0x923ffa);})[_0xfd2d('0x1d')](function(_0x5f198d){_0xdf0de4(_0x325c48[_0xfd2d('0x19')](0x1f4,_0x5f198d[_0xfd2d('0x1b')]));});});}; \ No newline at end of file +var _0x515c=['interaction','UserId','User','unshift','agent','name','*,*,*,*','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','./faxAccount.socket','register','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','catch','GetFaxAccount','FaxAccount','findAll','options','where','attributes','include','map','model','body','describe','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','Sequelize','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','find','account','CmList','List','CmContact','Contacts','DESC','Applications','get','applications','orderBy','asc','length','from','create','contact','fax','FaxInteraction','spread','autoclose','push','close','unmanaged','created','AttachmentId'];(function(_0x325e1e,_0x3c4d4c){var _0x29f806=function(_0x50f7ac){while(--_0x50f7ac){_0x325e1e['push'](_0x325e1e['shift']());}};_0x29f806(++_0x3c4d4c);}(_0x515c,0x1bc));var _0xc515=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x515c[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xc515('0x0'));var util=require(_0xc515('0x1'));var moment=require(_0xc515('0x2'));var BPromise=require(_0xc515('0x3'));var rs=require(_0xc515('0x4'));var fs=require('fs');var Redis=require(_0xc515('0x5'));var db=require(_0xc515('0x6'))['db'];var utils=require(_0xc515('0x7'));var logger=require('../../config/logger')(_0xc515('0x8'));var config=require(_0xc515('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc515('0xa')][_0xc515('0xb')]({'port':0x232c});config[_0xc515('0xc')]=_['defaults'](config['redis'],{'host':_0xc515('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc515('0xc')]));require(_0xc515('0xe'))[_0xc515('0xf')](socket);function respondWithRpcPromise(_0x462393,_0x4f8f8f,_0x2d9077){return new BPromise(function(_0x16db70,_0x36f5d4){return client[_0xc515('0x10')](_0x462393,_0x2d9077)[_0xc515('0x11')](function(_0x4ac768){logger[_0xc515('0x12')]('FaxAccount,\x20%s,\x20%s',_0x4f8f8f,_0xc515('0x13'));logger[_0xc515('0x14')](_0xc515('0x15'),_0x4f8f8f,'request\x20sent',JSON[_0xc515('0x16')](_0x4ac768));if(_0x4ac768['error']){if(_0x4ac768[_0xc515('0x17')][_0xc515('0x18')]===0x1f4){logger[_0xc515('0x17')](_0xc515('0x19'),_0x4f8f8f,_0x4ac768[_0xc515('0x17')][_0xc515('0x1a')]);return _0x36f5d4(_0x4ac768[_0xc515('0x17')][_0xc515('0x1a')]);}logger['error'](_0xc515('0x19'),_0x4f8f8f,_0x4ac768[_0xc515('0x17')][_0xc515('0x1a')]);return _0x16db70(_0x4ac768[_0xc515('0x17')][_0xc515('0x1a')]);}else{logger[_0xc515('0x12')](_0xc515('0x19'),_0x4f8f8f,_0xc515('0x13'));_0x16db70(_0x4ac768['result'][_0xc515('0x1a')]);}})[_0xc515('0x1b')](function(_0x4d2788){logger[_0xc515('0x17')](_0xc515('0x19'),_0x4f8f8f,_0x4d2788);_0x36f5d4(_0x4d2788);});});}exports[_0xc515('0x1c')]=function(_0x3222db){var _0x396574=this;return new Promise(function(_0x5caaf6,_0x123f2d){return db[_0xc515('0x1d')][_0xc515('0x1e')]({'raw':_0x3222db[_0xc515('0x1f')]?_0x3222db['options']['raw']===undefined?!![]:![]:!![],'where':_0x3222db[_0xc515('0x1f')]?_0x3222db['options'][_0xc515('0x20')]||null:null,'attributes':_0x3222db[_0xc515('0x1f')]?_0x3222db['options'][_0xc515('0x21')]||null:null,'limit':_0x3222db[_0xc515('0x1f')]?_0x3222db[_0xc515('0x1f')]['limit']||null:null,'include':_0x3222db['options']?_0x3222db[_0xc515('0x1f')][_0xc515('0x22')]?_[_0xc515('0x23')](_0x3222db[_0xc515('0x1f')][_0xc515('0x22')],function(_0x27d920){return{'model':db[_0x27d920[_0xc515('0x24')]],'as':_0x27d920['as'],'attributes':_0x27d920[_0xc515('0x21')],'include':_0x27d920[_0xc515('0x22')]?_[_0xc515('0x23')](_0x27d920['include'],function(_0x5be7c3){return{'model':db[_0x5be7c3['model']],'as':_0x5be7c3['as'],'attributes':_0x5be7c3[_0xc515('0x21')],'include':_0x5be7c3[_0xc515('0x22')]?_[_0xc515('0x23')](_0x5be7c3['include'],function(_0x2a209b){return{'model':db[_0x2a209b['model']],'as':_0x2a209b['as'],'attributes':_0x2a209b['attributes']};}):[]};}):[]};}):[]:[]})[_0xc515('0x11')](function(_0x46c830){logger['info']('GetFaxAccount',_0x3222db);logger['debug'](_0xc515('0x1c'),_0x3222db,JSON[_0xc515('0x16')](_0x46c830));_0x5caaf6(_0x46c830);})[_0xc515('0x1b')](function(_0xa48ad5){logger[_0xc515('0x17')](_0xc515('0x1c'),_0xa48ad5['message'],_0x3222db);_0x123f2d(_0x396574['error'](0x1f4,_0xa48ad5[_0xc515('0x1a')]));});});};exports['NotifyFaxAccount']=function(_0x116cab,_0x5407a6,_0x48ef09){var _0x31b348=this;return new Promise(function(_0x512b15,_0x346d46){var _0x17b632={'body':_0x116cab[_0xc515('0x25')],'channel':'fax'};var _0x17d0eb=[];var _0x298540=[];var _0x470174={};return db['CmContact'][_0xc515('0x26')]()[_0xc515('0x11')](function(_0x3d45b0){if(!_0x3d45b0){throw new db['Sequelize'][(_0xc515('0x27'))](_0xc515('0x28'));}_0x17d0eb=_[_0xc515('0x29')](_[_0xc515('0x2a')](_0x3d45b0),[_0xc515('0x2b'),_0xc515('0x2c')]);_0x298540=_[_0xc515('0x29')](_[_0xc515('0x2a')](_0x3d45b0),[_0xc515('0x2b'),_0xc515('0x2c'),'CompanyId',_0xc515('0x2d')]);if(_0x116cab[_0xc515('0x25')]['id']){delete _0x116cab[_0xc515('0x25')]['id'];}if(_['isNil'](_0x116cab[_0xc515('0x25')]['from'])){throw new db[(_0xc515('0x2e'))]['ValidationError'](_0xc515('0x2f'));}if(_[_0xc515('0x30')](_0x116cab[_0xc515('0x25')]['body'])||_0x116cab[_0xc515('0x25')][_0xc515('0x25')]===''){throw new db[(_0xc515('0x2e'))][(_0xc515('0x27'))](_0xc515('0x31'));}if(_['isNil'](_0x116cab[_0xc515('0x25')][_0xc515('0x32')])){throw new db['Sequelize'][(_0xc515('0x27'))](_0xc515('0x33')+_0x298540);}if(!_[_0xc515('0x34')](_0x298540,_0x116cab[_0xc515('0x25')][_0xc515('0x32')])){throw new db[(_0xc515('0x2e'))][(_0xc515('0x27'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x298540);}_0x470174[_0x116cab['body'][_0xc515('0x32')]]=_0x116cab[_0xc515('0x25')]['from'];})[_0xc515('0x11')](function(){return db[_0xc515('0x1d')][_0xc515('0x35')]({'where':{'id':_0x116cab[_0xc515('0x36')]['id']},'include':[{'model':db[_0xc515('0x37')],'as':_0xc515('0x38'),'include':[{'model':db[_0xc515('0x39')],'as':_0xc515('0x3a'),'where':_0x470174,'limit':0x1,'order':[['updatedAt',_0xc515('0x3b')]]}]},{'model':db['FaxApplication'],'as':_0xc515('0x3c')}]});})[_0xc515('0x11')](function(_0x4eda5b){if(_0x4eda5b&&_0x4eda5b['List']){var _0x37878e=_0x4eda5b[_0xc515('0x3d')]({'plain':!![]});_0x17b632[_0xc515('0x36')]=_0x37878e;_0x17b632[_0xc515('0x3e')]=_0x37878e[_0xc515('0x3c')];_0x17b632['list']=_0x37878e[_0xc515('0x38')];_0x17b632[_0xc515('0x3e')]=_[_0xc515('0x3f')](_0x17b632[_0xc515('0x3e')],['priority'],[_0xc515('0x40')]);if(_0x17b632[_0xc515('0x36')]['Applications']){delete _0x17b632[_0xc515('0x36')][_0xc515('0x3c')];}if(_0x17b632['account']['List']&&_0x17b632[_0xc515('0x36')][_0xc515('0x38')]['Contacts'][_0xc515('0x41')]){return _0x17b632[_0xc515('0x36')][_0xc515('0x38')][_0xc515('0x3a')][0x0];}var _0x51a905=_['defaults'](_0x116cab[_0xc515('0x25')],{'firstName':_0x116cab[_0xc515('0x25')][_0xc515('0x42')],'ListId':_0x37878e[_0xc515('0x2d')]});_0x51a905[_0x116cab[_0xc515('0x25')][_0xc515('0x32')]]=_0x116cab[_0xc515('0x25')][_0xc515('0x42')];return db[_0xc515('0x39')][_0xc515('0x43')](_0x51a905,{'fields':_0x17d0eb,'raw':!![]});}})[_0xc515('0x11')](function(_0x53d627){_0x17b632[_0xc515('0x44')]=_0x53d627;if(_0x53d627){var _0x1ca901={'ContactId':_0x53d627['id'],'FaxAccountId':_0x116cab[_0xc515('0x36')]['id'],'fax':_0x53d627[_0xc515('0x45')]};return db[_0xc515('0x46')][_0xc515('0x35')]({'where':{'ContactId':_0x53d627['id'],'closed':![],'FaxAccountId':_0x116cab[_0xc515('0x36')]['id']}})[_0xc515('0x11')](function(_0x2b8605){if(_0x2b8605){return[_0x2b8605,![]];}return db['FaxInteraction'][_0xc515('0x43')](_0x1ca901)[_0xc515('0x11')](function(_0x477df){return[_0x477df,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xc515('0x47')](function(_0x50e58b,_0x577fc7){var _0x38dfdd=_0x50e58b['get']({'plain':!![]});if(_0x577fc7){if(_0x17b632['account'][_0xc515('0x48')]){_0x17b632['applications'][_0xc515('0x49')]({'id':0x0,'priority':_0x17b632[_0xc515('0x3e')][_0xc515('0x41')]+0x1,'app':_0xc515('0x4a'),'appdata':_0xc515('0x4b'),'interval':'*,*,*,*'});}_0x38dfdd[_0xc515('0x4c')]=!![];}else{_0x38dfdd[_0xc515('0x4c')]=![];}_0x17b632['interaction']=_0x38dfdd;return db['FaxMessage'][_0xc515('0x43')]({'body':_0x116cab[_0xc515('0x25')]['body'],'FaxAccountId':_0x116cab[_0xc515('0x36')]['id'],'FaxInteractionId':_0x50e58b['id'],'direction':'in','ContactId':_0x50e58b['ContactId'],'AttachmentId':_0x116cab[_0xc515('0x25')][_0xc515('0x4d')]});})[_0xc515('0x11')](function(_0x8095ef){_0x17b632[_0xc515('0x1a')]=_0x8095ef;if(_0x17b632[_0xc515('0x4e')][_0xc515('0x4f')]){return db[_0xc515('0x50')][_0xc515('0x35')]({'attributes':['id','name'],'where':{'id':_0x17b632['interaction'][_0xc515('0x4f')]}})[_0xc515('0x11')](function(_0x3785ba){if(_0x3785ba){_0x17b632[_0xc515('0x3e')][_0xc515('0x51')]({'id':0x0,'priority':0x0,'app':_0xc515('0x52'),'appdata':_0x3785ba[_0xc515('0x53')]+','+(_0x17b632['account']['waitForTheAssignedAgent']||0xa),'interval':_0xc515('0x54')});}return respondWithRpcPromise(_0xc515('0x55'),_0xc515('0x56'),_0x17b632);});}return respondWithRpcPromise(_0xc515('0x55'),_0xc515('0x56'),_0x17b632);})[_0xc515('0x11')](function(_0x2a3bff){_0x512b15(_0x2a3bff);})[_0xc515('0x1b')](function(_0x890c35){_0x346d46(_0x31b348[_0xc515('0x17')](0x1f4,_0x890c35['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 8f20eae..1d40358 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(_0x4e5f40,_0x3bf5d2){var _0x7d58be=function(_0xd91e4d){while(--_0xd91e4d){_0x4e5f40['push'](_0x4e5f40['shift']());}};_0x7d58be(++_0x3bf5d2);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8e3f[_0x57b54c];return _0x59cc19;};'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 _0x8ace=['emit','removeListener','register','length','./faxAccount.events','save','remove','update'];(function(_0xd59052,_0x390c57){var _0x47d7ee=function(_0x50e5e9){while(--_0x50e5e9){_0xd59052['push'](_0xd59052['shift']());}};_0x47d7ee(++_0x390c57);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x24d92a,_0x5dcc4d){_0x24d92a=_0x24d92a-0x0;var _0x2d5aed=_0x8ace[_0x24d92a];return _0x2d5aed;};'use strict';var FaxAccountEvents=require(_0xe8ac('0x0'));var events=[_0xe8ac('0x1'),_0xe8ac('0x2'),_0xe8ac('0x3')];function createListener(_0x3896f9,_0x142625){return function(_0x2dd17e){_0x142625[_0xe8ac('0x4')](_0x3896f9,_0x2dd17e);};}function removeListener(_0x114351,_0xf6af00){return function(){FaxAccountEvents[_0xe8ac('0x5')](_0x114351,_0xf6af00);};}exports[_0xe8ac('0x6')]=function(_0x170e14){for(var _0x2b48ec=0x0,_0x4eb087=events[_0xe8ac('0x7')];_0x2b48ec<_0x4eb087;_0x2b48ec++){var _0x1357ed=events[_0x2b48ec];var _0x4f9233=createListener('faxAccount:'+_0x1357ed,_0x170e14);FaxAccountEvents['on'](_0x1357ed,_0x4f9233);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index d87f409..135ecae 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 _0x38b2=['express','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/users','post','addDisposition','addAnswer','addInteraction','addApplications','addAccountApplications','updateAccountApplications','send','addAgents','put','delete','destroy','removeDispositions','removeAnswers','exports','path','connect-timeout'];(function(_0x626f55,_0xe5090d){var _0x59784f=function(_0x70352d){while(--_0x70352d){_0x626f55['push'](_0x626f55['shift']());}};_0x59784f(++_0xe5090d);}(_0x38b2,0x166));var _0x238b=function(_0x1c9e6f,_0xd4c3ca){_0x1c9e6f=_0x1c9e6f-0x0;var _0x18c96a=_0x38b2[_0x1c9e6f];return _0x18c96a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x238b('0x0'));var timeout=require(_0x238b('0x1'));var express=require(_0x238b('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x238b('0x3'));router[_0x238b('0x4')]('/',auth[_0x238b('0x5')](),controller[_0x238b('0x6')]);router[_0x238b('0x4')](_0x238b('0x7'),auth[_0x238b('0x5')](),controller[_0x238b('0x8')]);router['get'](_0x238b('0x9'),auth['isAuthenticated'](),controller[_0x238b('0xa')]);router[_0x238b('0x4')](_0x238b('0xb'),auth[_0x238b('0x5')](),controller[_0x238b('0xc')]);router[_0x238b('0x4')](_0x238b('0xd'),auth[_0x238b('0x5')](),controller[_0x238b('0xe')]);router[_0x238b('0x4')](_0x238b('0xf'),auth[_0x238b('0x5')](),controller[_0x238b('0x10')]);router[_0x238b('0x4')]('/:id/applications',auth['isAuthenticated'](),controller[_0x238b('0x11')]);router[_0x238b('0x4')](_0x238b('0x12'),auth[_0x238b('0x5')](),controller[_0x238b('0x13')]);router['get'](_0x238b('0x14'),auth[_0x238b('0x5')](),controller['getAgents']);router[_0x238b('0x15')]('/',auth[_0x238b('0x5')](),controller['create']);router[_0x238b('0x15')](_0x238b('0xb'),auth[_0x238b('0x5')](),controller[_0x238b('0x16')]);router[_0x238b('0x15')](_0x238b('0xd'),auth['isAuthenticated'](),controller[_0x238b('0x17')]);router['post'](_0x238b('0xf'),auth[_0x238b('0x5')](),controller[_0x238b('0x18')]);router[_0x238b('0x15')]('/:id/applications',auth[_0x238b('0x5')](),controller[_0x238b('0x19')]);router[_0x238b('0x15')]('/addaccountapplications',auth[_0x238b('0x5')](),controller[_0x238b('0x1a')]);router[_0x238b('0x15')]('/updateaccountapplications',auth[_0x238b('0x5')](),controller[_0x238b('0x1b')]);router[_0x238b('0x15')]('/:id/send',auth[_0x238b('0x5')](),controller[_0x238b('0x1c')]);router[_0x238b('0x15')](_0x238b('0x14'),auth[_0x238b('0x5')](),controller[_0x238b('0x1d')]);router[_0x238b('0x1e')](_0x238b('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x238b('0x1f')]('/:id',auth[_0x238b('0x5')](),controller[_0x238b('0x20')]);router[_0x238b('0x1f')](_0x238b('0xb'),auth[_0x238b('0x5')](),controller[_0x238b('0x21')]);router['delete'](_0x238b('0xd'),auth[_0x238b('0x5')](),controller[_0x238b('0x22')]);router['delete'](_0x238b('0x14'),auth[_0x238b('0x5')](),controller['removeAgents']);module[_0x238b('0x23')]=router; \ No newline at end of file +var _0x45b8=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/users','getAgents','create','post','addDisposition','addAnswer','/:id/applications','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x45b8,0x1c8));var _0x845b=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x45b8[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require(_0x845b('0x0'));var util=require(_0x845b('0x1'));var path=require(_0x845b('0x2'));var timeout=require(_0x845b('0x3'));var express=require(_0x845b('0x4'));var router=express[_0x845b('0x5')]();var auth=require(_0x845b('0x6'));var interaction=require(_0x845b('0x7'));var config=require(_0x845b('0x8'));var controller=require(_0x845b('0x9'));router[_0x845b('0xa')]('/',auth[_0x845b('0xb')](),controller[_0x845b('0xc')]);router[_0x845b('0xa')](_0x845b('0xd'),auth[_0x845b('0xb')](),controller[_0x845b('0xe')]);router['get'](_0x845b('0xf'),auth[_0x845b('0xb')](),controller[_0x845b('0x10')]);router[_0x845b('0xa')](_0x845b('0x11'),auth[_0x845b('0xb')](),controller['getDispositions']);router[_0x845b('0xa')](_0x845b('0x12'),auth[_0x845b('0xb')](),controller[_0x845b('0x13')]);router[_0x845b('0xa')](_0x845b('0x14'),auth[_0x845b('0xb')](),controller[_0x845b('0x15')]);router[_0x845b('0xa')]('/:id/applications',auth[_0x845b('0xb')](),controller[_0x845b('0x16')]);router[_0x845b('0xa')](_0x845b('0x17'),auth['isAuthenticated'](),controller[_0x845b('0x18')]);router['get'](_0x845b('0x19'),auth['isAuthenticated'](),controller[_0x845b('0x1a')]);router['post']('/',auth[_0x845b('0xb')](),controller[_0x845b('0x1b')]);router[_0x845b('0x1c')](_0x845b('0x11'),auth[_0x845b('0xb')](),controller[_0x845b('0x1d')]);router['post'](_0x845b('0x12'),auth[_0x845b('0xb')](),controller[_0x845b('0x1e')]);router['post']('/:id/interactions',auth[_0x845b('0xb')](),controller['addInteraction']);router[_0x845b('0x1c')](_0x845b('0x1f'),auth['isAuthenticated'](),controller[_0x845b('0x20')]);router[_0x845b('0x1c')](_0x845b('0x21'),auth[_0x845b('0xb')](),controller[_0x845b('0x22')]);router[_0x845b('0x1c')](_0x845b('0x23'),auth[_0x845b('0xb')](),controller[_0x845b('0x24')]);router[_0x845b('0x1c')](_0x845b('0x25'),auth[_0x845b('0xb')](),controller[_0x845b('0x26')]);router[_0x845b('0x1c')](_0x845b('0x19'),auth[_0x845b('0xb')](),controller[_0x845b('0x27')]);router['put'](_0x845b('0xf'),auth['isAuthenticated'](),controller[_0x845b('0x28')]);router[_0x845b('0x29')](_0x845b('0xf'),auth[_0x845b('0xb')](),controller[_0x845b('0x2a')]);router[_0x845b('0x29')](_0x845b('0x11'),auth[_0x845b('0xb')](),controller[_0x845b('0x2b')]);router[_0x845b('0x29')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x845b('0x2c')]);router[_0x845b('0x29')](_0x845b('0x19'),auth[_0x845b('0xb')](),controller[_0x845b('0x2d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index fb606f1..4ef3cbb 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 _0xb94c=['exports','STRING','noop','*,*,*,*','sequelize'];(function(_0x30ddaa,_0x44a018){var _0x5ab508=function(_0x324d09){while(--_0x324d09){_0x30ddaa['push'](_0x30ddaa['shift']());}};_0x5ab508(++_0x44a018);}(_0xb94c,0x176));var _0xcb94=function(_0x356b5b,_0x148ff3){_0x356b5b=_0x356b5b-0x0;var _0x26f888=_0xb94c[_0x356b5b];return _0x26f888;};'use strict';var Sequelize=require(_0xcb94('0x0'));module[_0xcb94('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xcb94('0x2')],'allowNull':![],'defaultValue':_0xcb94('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xcb94('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xcb94('0x4')}}; \ No newline at end of file +var _0xa1c5=['sequelize','exports','INTEGER','TEXT','STRING'];(function(_0x1a840f,_0x55ef43){var _0x3cf007=function(_0x38ee8f){while(--_0x38ee8f){_0x1a840f['push'](_0x1a840f['shift']());}};_0x3cf007(++_0x55ef43);}(_0xa1c5,0x96));var _0x5a1c=function(_0x5e77f6,_0x79a5b6){_0x5e77f6=_0x5e77f6-0x0;var _0x24c7cb=_0xa1c5[_0x5e77f6];return _0x24c7cb;};'use strict';var Sequelize=require(_0x5a1c('0x0'));module[_0x5a1c('0x1')]={'priority':{'type':Sequelize[_0x5a1c('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5a1c('0x3')]()},'description':{'type':Sequelize[_0x5a1c('0x4')]},'interval':{'type':Sequelize[_0x5a1c('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index a0db4a0..ae04171 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 _0xd8fb=['where','pick','filter','type','key','VIRTUAL','field','merge','options','include','findAll','catch','show','length','includeAll','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','FaxApplication','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort'];(function(_0x29cd14,_0x245c40){var _0x4229d1=function(_0x1ef992){while(--_0x1ef992){_0x29cd14['push'](_0x29cd14['shift']());}};_0x4229d1(++_0x245c40);}(_0xd8fb,0x99));var _0xbd8f=function(_0x10ff61,_0x2472b6){_0x10ff61=_0x10ff61-0x0;var _0x3529f8=_0xd8fb[_0x10ff61];return _0x3529f8;};'use strict';var pdf=require(_0xbd8f('0x0'));var emlformat=require(_0xbd8f('0x1'));var rimraf=require(_0xbd8f('0x2'));var zipdir=require(_0xbd8f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbd8f('0x4'));var Mustache=require(_0xbd8f('0x5'));var util=require('util');var path=require(_0xbd8f('0x6'));var sox=require(_0xbd8f('0x7'));var csv=require('to-csv');var ejs=require(_0xbd8f('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbd8f('0x9'));var crypto=require('crypto');var jsforce=require(_0xbd8f('0xa'));var deskjs=require(_0xbd8f('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbd8f('0xc'));var Redis=require(_0xbd8f('0xd'));var authService=require(_0xbd8f('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xbd8f('0xf'));var logger=require(_0xbd8f('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xbd8f('0x11'));var db=require(_0xbd8f('0x12'))['db'];function respondWithStatusCode(_0x12dcac,_0x5d5705){_0x5d5705=_0x5d5705||0xcc;return function(_0x230988){if(_0x230988){return _0x12dcac[_0xbd8f('0x13')](_0x5d5705);}return _0x12dcac[_0xbd8f('0x14')](_0x5d5705)[_0xbd8f('0x15')]();};}function respondWithResult(_0x8bc054,_0x383ea5){_0x383ea5=_0x383ea5||0xc8;return function(_0x37d4d5){if(_0x37d4d5){return _0x8bc054[_0xbd8f('0x14')](_0x383ea5)[_0xbd8f('0x16')](_0x37d4d5);}};}function respondWithFilteredResult(_0x5e59ae,_0x31573c){return function(_0x829fb2){if(_0x829fb2){var _0xa57e91=_0x829fb2[_0xbd8f('0x17')],_0x10d72e=_0x31573c['offset'],_0x4da96f=_0x31573c[_0xbd8f('0x18')]+_0x31573c[_0xbd8f('0x19')],_0x174929;if(_0x4da96f>=_0xa57e91){_0x4da96f=_0xa57e91;_0x174929=0xc8;}else{_0x174929=0xce;}_0x5e59ae['status'](_0x174929);return _0x5e59ae[_0xbd8f('0x1a')](_0xbd8f('0x1b'),_0x10d72e+'-'+_0x4da96f+'/'+_0xa57e91)['json'](_0x829fb2);}return null;};}function patchUpdates(_0x5a572b){return function(_0x33f77c){try{jsonpatch['apply'](_0x33f77c,_0x5a572b,!![]);}catch(_0x5705c5){return BPromise[_0xbd8f('0x1c')](_0x5705c5);}return _0x33f77c['save']();};}function saveUpdates(_0xd706bc,_0x7f46d4){return function(_0xb47c8e){if(_0xb47c8e){return _0xb47c8e[_0xbd8f('0x1d')](_0xd706bc)[_0xbd8f('0x1e')](function(_0x20cab7){return _0x20cab7;});}return null;};}function removeEntity(_0x24cff5,_0x90eff8){return function(_0x2fbe3b){if(_0x2fbe3b){return _0x2fbe3b[_0xbd8f('0x1f')]()[_0xbd8f('0x1e')](function(){_0x24cff5[_0xbd8f('0x14')](0xcc)[_0xbd8f('0x15')]();});}};}function handleEntityNotFound(_0x15c4a9,_0x320ede){return function(_0xd11ae){if(!_0xd11ae){_0x15c4a9[_0xbd8f('0x13')](0x194);}return _0xd11ae;};}function handleError(_0x4ba8db,_0x359ead){_0x359ead=_0x359ead||0x1f4;return function(_0x9fa3b1){logger[_0xbd8f('0x20')](_0x9fa3b1[_0xbd8f('0x21')]);if(_0x9fa3b1[_0xbd8f('0x22')]){delete _0x9fa3b1[_0xbd8f('0x22')];}_0x4ba8db[_0xbd8f('0x14')](_0x359ead)[_0xbd8f('0x23')](_0x9fa3b1);};}exports['index']=function(_0x40cb43,_0x421f3e){var _0x5a3a8c={},_0x339df7={},_0x557daa={'count':0x0,'rows':[]};var _0x41b2a6=db[_0xbd8f('0x24')][_0xbd8f('0x25')];_0x339df7[_0xbd8f('0x26')]=_[_0xbd8f('0x27')](_0x41b2a6);_0x339df7[_0xbd8f('0x28')]=_['keys'](_0x40cb43[_0xbd8f('0x28')]);_0x339df7[_0xbd8f('0x29')]=_[_0xbd8f('0x2a')](_0x339df7[_0xbd8f('0x26')],_0x339df7[_0xbd8f('0x28')]);_0x5a3a8c[_0xbd8f('0x2b')]=_[_0xbd8f('0x2a')](_0x339df7['model'],qs[_0xbd8f('0x2c')](_0x40cb43[_0xbd8f('0x28')][_0xbd8f('0x2c')]));_0x5a3a8c[_0xbd8f('0x2b')]=_0x5a3a8c['attributes']['length']?_0x5a3a8c[_0xbd8f('0x2b')]:_0x339df7[_0xbd8f('0x26')];if(!_0x40cb43[_0xbd8f('0x28')][_0xbd8f('0x2d')]('nolimit')){_0x5a3a8c[_0xbd8f('0x19')]=qs[_0xbd8f('0x19')](_0x40cb43[_0xbd8f('0x28')][_0xbd8f('0x19')]);_0x5a3a8c[_0xbd8f('0x18')]=qs['offset'](_0x40cb43[_0xbd8f('0x28')][_0xbd8f('0x18')]);}_0x5a3a8c[_0xbd8f('0x2e')]=qs[_0xbd8f('0x2f')](_0x40cb43[_0xbd8f('0x28')]['sort']);_0x5a3a8c[_0xbd8f('0x30')]=qs['filters'](_[_0xbd8f('0x31')](_0x40cb43[_0xbd8f('0x28')],_0x339df7[_0xbd8f('0x29')]));if(_0x40cb43[_0xbd8f('0x28')][_0xbd8f('0x32')]){_0x5a3a8c[_0xbd8f('0x30')]=_['merge'](_0x5a3a8c['where'],{'$or':_['map'](_0x41b2a6,function(_0x22d1de){if(_0x22d1de[_0xbd8f('0x33')][_0xbd8f('0x34')]!==_0xbd8f('0x35')){var _0xc0aaee={};_0xc0aaee[_0x22d1de[_0xbd8f('0x36')]]={'$like':'%'+_0x40cb43[_0xbd8f('0x28')][_0xbd8f('0x32')]+'%'};return _0xc0aaee;}})});}_0x5a3a8c=_[_0xbd8f('0x37')]({},_0x5a3a8c,_0x40cb43[_0xbd8f('0x38')]);var _0x3d4c9a={'where':_0x5a3a8c[_0xbd8f('0x30')]};return db[_0xbd8f('0x24')][_0xbd8f('0x17')](_0x3d4c9a)[_0xbd8f('0x1e')](function(_0x50e081){_0x557daa[_0xbd8f('0x17')]=_0x50e081;if(_0x40cb43[_0xbd8f('0x28')]['includeAll']){_0x5a3a8c[_0xbd8f('0x39')]=[{'all':!![]}];}return db[_0xbd8f('0x24')][_0xbd8f('0x3a')](_0x5a3a8c);})['then'](function(_0x21da54){_0x557daa['rows']=_0x21da54;return _0x557daa;})[_0xbd8f('0x1e')](respondWithFilteredResult(_0x421f3e,_0x5a3a8c))[_0xbd8f('0x3b')](handleError(_0x421f3e,null));};exports[_0xbd8f('0x3c')]=function(_0x4f2ebc,_0x25031d){var _0x72fe99={'raw':!![],'where':{'id':_0x4f2ebc['params']['id']}},_0xdab323={};_0xdab323[_0xbd8f('0x26')]=_[_0xbd8f('0x27')](db[_0xbd8f('0x24')][_0xbd8f('0x25')]);_0xdab323[_0xbd8f('0x28')]=_[_0xbd8f('0x27')](_0x4f2ebc[_0xbd8f('0x28')]);_0xdab323[_0xbd8f('0x29')]=_[_0xbd8f('0x2a')](_0xdab323['model'],_0xdab323['query']);_0x72fe99[_0xbd8f('0x2b')]=_[_0xbd8f('0x2a')](_0xdab323[_0xbd8f('0x26')],qs[_0xbd8f('0x2c')](_0x4f2ebc['query'][_0xbd8f('0x2c')]));_0x72fe99[_0xbd8f('0x2b')]=_0x72fe99[_0xbd8f('0x2b')][_0xbd8f('0x3d')]?_0x72fe99[_0xbd8f('0x2b')]:_0xdab323['model'];if(_0x4f2ebc['query'][_0xbd8f('0x3e')]){_0x72fe99['include']=[{'all':!![]}];}_0x72fe99=_[_0xbd8f('0x37')]({},_0x72fe99,_0x4f2ebc[_0xbd8f('0x38')]);return db[_0xbd8f('0x24')][_0xbd8f('0x3f')](_0x72fe99)[_0xbd8f('0x1e')](handleEntityNotFound(_0x25031d,null))[_0xbd8f('0x1e')](respondWithResult(_0x25031d,null))[_0xbd8f('0x3b')](handleError(_0x25031d,null));};exports[_0xbd8f('0x40')]=function(_0x55ee57,_0x36c43f){return db[_0xbd8f('0x24')][_0xbd8f('0x40')](_0x55ee57[_0xbd8f('0x41')],{})[_0xbd8f('0x1e')](respondWithResult(_0x36c43f,0xc9))[_0xbd8f('0x3b')](handleError(_0x36c43f,null));};exports[_0xbd8f('0x1d')]=function(_0x3918a5,_0x5668b6){if(_0x3918a5[_0xbd8f('0x41')]['id']){delete _0x3918a5[_0xbd8f('0x41')]['id'];}return db[_0xbd8f('0x24')][_0xbd8f('0x3f')]({'where':{'id':_0x3918a5[_0xbd8f('0x42')]['id']}})[_0xbd8f('0x1e')](handleEntityNotFound(_0x5668b6,null))[_0xbd8f('0x1e')](saveUpdates(_0x3918a5[_0xbd8f('0x41')],null))[_0xbd8f('0x1e')](respondWithResult(_0x5668b6,null))[_0xbd8f('0x3b')](handleError(_0x5668b6,null));};exports[_0xbd8f('0x1f')]=function(_0x255c59,_0x3d0ffa){return db[_0xbd8f('0x24')][_0xbd8f('0x3f')]({'where':{'id':_0x255c59[_0xbd8f('0x42')]['id']}})[_0xbd8f('0x1e')](handleEntityNotFound(_0x3d0ffa,null))[_0xbd8f('0x1e')](removeEntity(_0x3d0ffa,null))[_0xbd8f('0x3b')](handleError(_0x3d0ffa,null));}; \ No newline at end of file +var _0x7b27=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','FaxApplication','rawAttributes','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','map','options','includeAll','findAll','catch','show','params','length','find','create','body','destroy','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x7b27,0x186));var _0x77b2=function(_0x1fb29f,_0x5c4720){_0x1fb29f=_0x1fb29f-0x0;var _0x40cccc=_0x7b27[_0x1fb29f];return _0x40cccc;};'use strict';var pdf=require(_0x77b2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x77b2('0x1'));var zipdir=require(_0x77b2('0x2'));var jsonpatch=require(_0x77b2('0x3'));var rp=require(_0x77b2('0x4'));var moment=require('moment');var BPromise=require(_0x77b2('0x5'));var Mustache=require(_0x77b2('0x6'));var util=require('util');var path=require(_0x77b2('0x7'));var sox=require(_0x77b2('0x8'));var csv=require(_0x77b2('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x77b2('0xa'));var squel=require(_0x77b2('0xb'));var crypto=require(_0x77b2('0xc'));var jsforce=require(_0x77b2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x77b2('0x9'));var querystring=require(_0x77b2('0xe'));var Papa=require(_0x77b2('0xf'));var Redis=require(_0x77b2('0x10'));var authService=require(_0x77b2('0x11'));var qs=require(_0x77b2('0x12'));var hardwareService=require(_0x77b2('0x13'));var logger=require(_0x77b2('0x14'))('api');var utils=require(_0x77b2('0x15'));var config=require(_0x77b2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfbadc6,_0x4918c4){_0x4918c4=_0x4918c4||0xcc;return function(_0x82878c){if(_0x82878c){return _0xfbadc6[_0x77b2('0x17')](_0x4918c4);}return _0xfbadc6['status'](_0x4918c4)[_0x77b2('0x18')]();};}function respondWithResult(_0x512412,_0x2f1dd8){_0x2f1dd8=_0x2f1dd8||0xc8;return function(_0x14cd9f){if(_0x14cd9f){return _0x512412[_0x77b2('0x19')](_0x2f1dd8)[_0x77b2('0x1a')](_0x14cd9f);}};}function respondWithFilteredResult(_0x197265,_0x33a2a5){return function(_0x2539d3){if(_0x2539d3){var _0x284e2c=_0x2539d3[_0x77b2('0x1b')],_0xd7ed8c=_0x33a2a5[_0x77b2('0x1c')],_0x48885e=_0x33a2a5[_0x77b2('0x1c')]+_0x33a2a5[_0x77b2('0x1d')],_0x58bec3;if(_0x48885e>=_0x284e2c){_0x48885e=_0x284e2c;_0x58bec3=0xc8;}else{_0x58bec3=0xce;}_0x197265[_0x77b2('0x19')](_0x58bec3);return _0x197265[_0x77b2('0x1e')](_0x77b2('0x1f'),_0xd7ed8c+'-'+_0x48885e+'/'+_0x284e2c)['json'](_0x2539d3);}return null;};}function patchUpdates(_0x1b6efc){return function(_0x818d98){try{jsonpatch[_0x77b2('0x20')](_0x818d98,_0x1b6efc,!![]);}catch(_0x25e7fc){return BPromise[_0x77b2('0x21')](_0x25e7fc);}return _0x818d98['save']();};}function saveUpdates(_0x3a012f,_0x5d2525){return function(_0x298871){if(_0x298871){return _0x298871[_0x77b2('0x22')](_0x3a012f)[_0x77b2('0x23')](function(_0x28c778){return _0x28c778;});}return null;};}function removeEntity(_0x2d6fbc,_0x3880ad){return function(_0x36dde1){if(_0x36dde1){return _0x36dde1['destroy']()['then'](function(){_0x2d6fbc['status'](0xcc)[_0x77b2('0x18')]();});}};}function handleEntityNotFound(_0x450892,_0x11f7d1){return function(_0x327a8e){if(!_0x327a8e){_0x450892[_0x77b2('0x17')](0x194);}return _0x327a8e;};}function handleError(_0x14adef,_0x37be15){_0x37be15=_0x37be15||0x1f4;return function(_0x506eb4){logger[_0x77b2('0x24')](_0x506eb4[_0x77b2('0x25')]);if(_0x506eb4[_0x77b2('0x26')]){delete _0x506eb4[_0x77b2('0x26')];}_0x14adef[_0x77b2('0x19')](_0x37be15)[_0x77b2('0x27')](_0x506eb4);};}exports[_0x77b2('0x28')]=function(_0x250202,_0x2bf511){var _0x3fa802={},_0x5c50a1={},_0x3cc4d9={'count':0x0,'rows':[]};var _0x3af0ef=db[_0x77b2('0x29')][_0x77b2('0x2a')];_0x5c50a1[_0x77b2('0x2b')]=_['keys'](_0x3af0ef);_0x5c50a1[_0x77b2('0x2c')]=_[_0x77b2('0x2d')](_0x250202[_0x77b2('0x2c')]);_0x5c50a1[_0x77b2('0x2e')]=_[_0x77b2('0x2f')](_0x5c50a1[_0x77b2('0x2b')],_0x5c50a1[_0x77b2('0x2c')]);_0x3fa802[_0x77b2('0x30')]=_[_0x77b2('0x2f')](_0x5c50a1[_0x77b2('0x2b')],qs[_0x77b2('0x31')](_0x250202[_0x77b2('0x2c')]['fields']));_0x3fa802['attributes']=_0x3fa802['attributes']['length']?_0x3fa802[_0x77b2('0x30')]:_0x5c50a1[_0x77b2('0x2b')];if(!_0x250202['query']['hasOwnProperty']('nolimit')){_0x3fa802[_0x77b2('0x1d')]=qs[_0x77b2('0x1d')](_0x250202[_0x77b2('0x2c')][_0x77b2('0x1d')]);_0x3fa802['offset']=qs[_0x77b2('0x1c')](_0x250202['query'][_0x77b2('0x1c')]);}_0x3fa802[_0x77b2('0x32')]=qs[_0x77b2('0x33')](_0x250202[_0x77b2('0x2c')][_0x77b2('0x33')]);_0x3fa802[_0x77b2('0x34')]=qs['filters'](_[_0x77b2('0x35')](_0x250202[_0x77b2('0x2c')],_0x5c50a1[_0x77b2('0x2e')]));if(_0x250202['query'][_0x77b2('0x36')]){_0x3fa802['where']=_[_0x77b2('0x37')](_0x3fa802[_0x77b2('0x34')],{'$or':_[_0x77b2('0x38')](_0x3af0ef,function(_0x4e281c){if(_0x4e281c['type']['key']!=='VIRTUAL'){var _0x6fe687={};_0x6fe687[_0x4e281c['field']]={'$like':'%'+_0x250202[_0x77b2('0x2c')][_0x77b2('0x36')]+'%'};return _0x6fe687;}})});}_0x3fa802=_[_0x77b2('0x37')]({},_0x3fa802,_0x250202[_0x77b2('0x39')]);var _0x14621f={'where':_0x3fa802[_0x77b2('0x34')]};return db[_0x77b2('0x29')]['count'](_0x14621f)['then'](function(_0x10a3a2){_0x3cc4d9[_0x77b2('0x1b')]=_0x10a3a2;if(_0x250202[_0x77b2('0x2c')][_0x77b2('0x3a')]){_0x3fa802['include']=[{'all':!![]}];}return db[_0x77b2('0x29')][_0x77b2('0x3b')](_0x3fa802);})[_0x77b2('0x23')](function(_0x54770d){_0x3cc4d9['rows']=_0x54770d;return _0x3cc4d9;})[_0x77b2('0x23')](respondWithFilteredResult(_0x2bf511,_0x3fa802))[_0x77b2('0x3c')](handleError(_0x2bf511,null));};exports[_0x77b2('0x3d')]=function(_0x35b418,_0x57c7ea){var _0x436bec={'raw':!![],'where':{'id':_0x35b418[_0x77b2('0x3e')]['id']}},_0x116721={};_0x116721[_0x77b2('0x2b')]=_[_0x77b2('0x2d')](db['FaxApplication']['rawAttributes']);_0x116721[_0x77b2('0x2c')]=_[_0x77b2('0x2d')](_0x35b418[_0x77b2('0x2c')]);_0x116721[_0x77b2('0x2e')]=_[_0x77b2('0x2f')](_0x116721[_0x77b2('0x2b')],_0x116721[_0x77b2('0x2c')]);_0x436bec['attributes']=_['intersection'](_0x116721[_0x77b2('0x2b')],qs[_0x77b2('0x31')](_0x35b418[_0x77b2('0x2c')][_0x77b2('0x31')]));_0x436bec['attributes']=_0x436bec['attributes'][_0x77b2('0x3f')]?_0x436bec['attributes']:_0x116721[_0x77b2('0x2b')];if(_0x35b418[_0x77b2('0x2c')][_0x77b2('0x3a')]){_0x436bec['include']=[{'all':!![]}];}_0x436bec=_['merge']({},_0x436bec,_0x35b418[_0x77b2('0x39')]);return db['FaxApplication'][_0x77b2('0x40')](_0x436bec)[_0x77b2('0x23')](handleEntityNotFound(_0x57c7ea,null))[_0x77b2('0x23')](respondWithResult(_0x57c7ea,null))['catch'](handleError(_0x57c7ea,null));};exports[_0x77b2('0x41')]=function(_0x3aa617,_0x2ce5ac){return db[_0x77b2('0x29')][_0x77b2('0x41')](_0x3aa617[_0x77b2('0x42')],{})[_0x77b2('0x23')](respondWithResult(_0x2ce5ac,0xc9))[_0x77b2('0x3c')](handleError(_0x2ce5ac,null));};exports[_0x77b2('0x22')]=function(_0x6418e4,_0x17e456){if(_0x6418e4[_0x77b2('0x42')]['id']){delete _0x6418e4[_0x77b2('0x42')]['id'];}return db[_0x77b2('0x29')][_0x77b2('0x40')]({'where':{'id':_0x6418e4[_0x77b2('0x3e')]['id']}})[_0x77b2('0x23')](handleEntityNotFound(_0x17e456,null))[_0x77b2('0x23')](saveUpdates(_0x6418e4[_0x77b2('0x42')],null))[_0x77b2('0x23')](respondWithResult(_0x17e456,null))['catch'](handleError(_0x17e456,null));};exports[_0x77b2('0x43')]=function(_0x411a12,_0x4388f5){return db[_0x77b2('0x29')][_0x77b2('0x40')]({'where':{'id':_0x411a12[_0x77b2('0x3e')]['id']}})[_0x77b2('0x23')](handleEntityNotFound(_0x4388f5,null))[_0x77b2('0x23')](removeEntity(_0x4388f5,null))[_0x77b2('0x3c')](handleError(_0x4388f5,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 499f671..c6af97d 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 _0xfec0=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4_unicode_ci'];(function(_0x37e4e8,_0x3d5148){var _0x4a9ef7=function(_0x350fd0){while(--_0x350fd0){_0x37e4e8['push'](_0x37e4e8['shift']());}};_0x4a9ef7(++_0x3d5148);}(_0xfec0,0x126));var _0x0fec=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0xfec0[_0x5a79e2];return _0x266c45;};'use strict';var _=require(_0x0fec('0x0'));var util=require(_0x0fec('0x1'));var logger=require('../../config/logger')(_0x0fec('0x2'));var moment=require(_0x0fec('0x3'));var BPromise=require(_0x0fec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fec('0x5'));var rimraf=require(_0x0fec('0x6'));var config=require(_0x0fec('0x7'));var attributes=require(_0x0fec('0x8'));module[_0x0fec('0x9')]=function(_0x51d9f8,_0x4be2a5){return _0x51d9f8[_0x0fec('0xa')](_0x0fec('0xb'),attributes,{'tableName':_0x0fec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0fec('0xd')});}; \ No newline at end of file +var _0x6600=['bluebird','path','rimraf','./faxApplication.attributes','exports','define','fax_applications','utf8mb4_unicode_ci','util','moment'];(function(_0x31e025,_0x4fb40){var _0x14dc32=function(_0x1cdde9){while(--_0x1cdde9){_0x31e025['push'](_0x31e025['shift']());}};_0x14dc32(++_0x4fb40);}(_0x6600,0xb2));var _0x0660=function(_0x188abc,_0x3c7ca9){_0x188abc=_0x188abc-0x0;var _0x104818=_0x6600[_0x188abc];return _0x104818;};'use strict';var _=require('lodash');var util=require(_0x0660('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0660('0x1'));var BPromise=require(_0x0660('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0660('0x3'));var rimraf=require(_0x0660('0x4'));var config=require('../../config/environment');var attributes=require(_0x0660('0x5'));module[_0x0660('0x6')]=function(_0x3de6c1,_0xf063cd){return _0x3de6c1[_0x0660('0x7')]('FaxApplication',attributes,{'tableName':_0x0660('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0660('0x9')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 95254e3..3c9064c 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 _0x2e6e=['stringify','error','message','result','catch','UpdateFaxApplication','FaxApplication','body','options','raw','where','attributes','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s'];(function(_0x3b970b,_0x2ff4aa){var _0x202d50=function(_0x4495c5){while(--_0x4495c5){_0x3b970b['push'](_0x3b970b['shift']());}};_0x202d50(++_0x2ff4aa);}(_0x2e6e,0x185));var _0xe2e6=function(_0xd9caad,_0x5856b7){_0xd9caad=_0xd9caad-0x0;var _0x3127e6=_0x2e6e[_0xd9caad];return _0x3127e6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe2e6('0x0'));var BPromise=require(_0xe2e6('0x1'));var rs=require(_0xe2e6('0x2'));var fs=require('fs');var Redis=require(_0xe2e6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe2e6('0x4'));var logger=require(_0xe2e6('0x5'))(_0xe2e6('0x6'));var config=require(_0xe2e6('0x7'));var jayson=require(_0xe2e6('0x8'));var client=jayson[_0xe2e6('0x9')][_0xe2e6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e2227,_0x4ed237,_0x1dae68){return new BPromise(function(_0x1807e9,_0x3a9dbc){return client[_0xe2e6('0xb')](_0x1e2227,_0x1dae68)[_0xe2e6('0xc')](function(_0x5e6f21){logger[_0xe2e6('0xd')](_0xe2e6('0xe'),_0x4ed237,_0xe2e6('0xf'));logger['debug'](_0xe2e6('0x10'),_0x4ed237,'request\x20sent',JSON[_0xe2e6('0x11')](_0x5e6f21));if(_0x5e6f21['error']){if(_0x5e6f21['error']['code']===0x1f4){logger[_0xe2e6('0x12')](_0xe2e6('0xe'),_0x4ed237,_0x5e6f21[_0xe2e6('0x12')][_0xe2e6('0x13')]);return _0x3a9dbc(_0x5e6f21[_0xe2e6('0x12')][_0xe2e6('0x13')]);}logger['error'](_0xe2e6('0xe'),_0x4ed237,_0x5e6f21['error'][_0xe2e6('0x13')]);return _0x1807e9(_0x5e6f21[_0xe2e6('0x12')][_0xe2e6('0x13')]);}else{logger['info'](_0xe2e6('0xe'),_0x4ed237,_0xe2e6('0xf'));_0x1807e9(_0x5e6f21[_0xe2e6('0x14')][_0xe2e6('0x13')]);}})[_0xe2e6('0x15')](function(_0x3ad6cb){logger[_0xe2e6('0x12')](_0xe2e6('0xe'),_0x4ed237,_0x3ad6cb);_0x3a9dbc(_0x3ad6cb);});});}exports[_0xe2e6('0x16')]=function(_0x39491e){var _0xe26c47=this;return new Promise(function(_0x4ff0a0,_0x198913){return db[_0xe2e6('0x17')]['update'](_0x39491e[_0xe2e6('0x18')],{'raw':_0x39491e[_0xe2e6('0x19')]?_0x39491e[_0xe2e6('0x19')][_0xe2e6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39491e[_0xe2e6('0x19')]?_0x39491e[_0xe2e6('0x19')][_0xe2e6('0x1b')]||null:null,'attributes':_0x39491e['options']?_0x39491e['options'][_0xe2e6('0x1c')]||null:null,'limit':_0x39491e['options']?_0x39491e[_0xe2e6('0x19')]['limit']||null:null})[_0xe2e6('0xc')](function(_0x287282){logger[_0xe2e6('0xd')](_0xe2e6('0x16'),_0x39491e);logger['debug'](_0xe2e6('0x16'),_0x39491e,JSON['stringify'](_0x287282));_0x4ff0a0(_0x287282);})[_0xe2e6('0x15')](function(_0x545092){logger['error'](_0xe2e6('0x16'),_0x545092['message'],_0x39491e);_0x198913(_0xe26c47[_0xe2e6('0x12')](0x1f4,_0x545092[_0xe2e6('0x13')]));});});}; \ No newline at end of file +var _0x8f43=['FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','then','debug','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info'];(function(_0x2fbf2c,_0xb5a8f9){var _0x132005=function(_0xaa95bb){while(--_0xaa95bb){_0x2fbf2c['push'](_0x2fbf2c['shift']());}};_0x132005(++_0xb5a8f9);}(_0x8f43,0xb9));var _0x38f4=function(_0xb12beb,_0x4f95a3){_0xb12beb=_0xb12beb-0x0;var _0x2dda6e=_0x8f43[_0xb12beb];return _0x2dda6e;};'use strict';var _=require(_0x38f4('0x0'));var util=require(_0x38f4('0x1'));var moment=require(_0x38f4('0x2'));var BPromise=require('bluebird');var rs=require(_0x38f4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x38f4('0x4'))['db'];var utils=require(_0x38f4('0x5'));var logger=require(_0x38f4('0x6'))(_0x38f4('0x7'));var config=require(_0x38f4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x38f4('0x9')][_0x38f4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56dedb,_0x29a1c9,_0x6520a3){return new BPromise(function(_0x2f468d,_0x36dac5){return client[_0x38f4('0xb')](_0x56dedb,_0x6520a3)['then'](function(_0x3dd784){logger[_0x38f4('0xc')](_0x38f4('0xd'),_0x29a1c9,_0x38f4('0xe'));logger['debug'](_0x38f4('0xf'),_0x29a1c9,_0x38f4('0xe'),JSON['stringify'](_0x3dd784));if(_0x3dd784['error']){if(_0x3dd784[_0x38f4('0x10')][_0x38f4('0x11')]===0x1f4){logger['error'](_0x38f4('0xd'),_0x29a1c9,_0x3dd784[_0x38f4('0x10')]['message']);return _0x36dac5(_0x3dd784['error'][_0x38f4('0x12')]);}logger[_0x38f4('0x10')](_0x38f4('0xd'),_0x29a1c9,_0x3dd784[_0x38f4('0x10')][_0x38f4('0x12')]);return _0x2f468d(_0x3dd784[_0x38f4('0x10')][_0x38f4('0x12')]);}else{logger['info'](_0x38f4('0xd'),_0x29a1c9,_0x38f4('0xe'));_0x2f468d(_0x3dd784[_0x38f4('0x13')][_0x38f4('0x12')]);}})[_0x38f4('0x14')](function(_0x51ba1e){logger[_0x38f4('0x10')](_0x38f4('0xd'),_0x29a1c9,_0x51ba1e);_0x36dac5(_0x51ba1e);});});}exports[_0x38f4('0x15')]=function(_0x1e8a25){var _0x401003=this;return new Promise(function(_0x8b719b,_0x2988bb){return db[_0x38f4('0x16')][_0x38f4('0x17')](_0x1e8a25[_0x38f4('0x18')],{'raw':_0x1e8a25[_0x38f4('0x19')]?_0x1e8a25[_0x38f4('0x19')][_0x38f4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e8a25[_0x38f4('0x19')]?_0x1e8a25[_0x38f4('0x19')][_0x38f4('0x1b')]||null:null,'attributes':_0x1e8a25[_0x38f4('0x19')]?_0x1e8a25[_0x38f4('0x19')][_0x38f4('0x1c')]||null:null,'limit':_0x1e8a25['options']?_0x1e8a25[_0x38f4('0x19')][_0x38f4('0x1d')]||null:null})[_0x38f4('0x1e')](function(_0x1efaba){logger[_0x38f4('0xc')]('UpdateFaxApplication',_0x1e8a25);logger[_0x38f4('0x1f')](_0x38f4('0x15'),_0x1e8a25,JSON[_0x38f4('0x20')](_0x1efaba));_0x8b719b(_0x1efaba);})[_0x38f4('0x14')](function(_0x4878b6){logger['error'](_0x38f4('0x15'),_0x4878b6[_0x38f4('0x12')],_0x1e8a25);_0x2988bb(_0x401003[_0x38f4('0x10')](0x1f4,_0x4878b6[_0x38f4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 6c8dbce..cd1c924 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 _0xa630=['delete','destroy','exports','multer','util','express','../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xa630,0xbe));var _0x0a63=function(_0x5937f3,_0x48aec3){_0x5937f3=_0x5937f3-0x0;var _0xc5b76c=_0xa630[_0x5937f3];return _0xc5b76c;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var auth=require(_0x0a63('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0a63('0x4'));var controller=require(_0x0a63('0x5'));router[_0x0a63('0x6')]('/',auth[_0x0a63('0x7')](),controller[_0x0a63('0x8')]);router['get'](_0x0a63('0x9'),auth[_0x0a63('0x7')](),controller[_0x0a63('0xa')]);router[_0x0a63('0xb')]('/',auth[_0x0a63('0x7')](),controller[_0x0a63('0xc')]);router['put'](_0x0a63('0x9'),auth[_0x0a63('0x7')](),controller[_0x0a63('0xd')]);router[_0x0a63('0xe')](_0x0a63('0x9'),auth[_0x0a63('0x7')](),controller[_0x0a63('0xf')]);module[_0x0a63('0x10')]=router; \ No newline at end of file +var _0x038b=['update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','put'];(function(_0x7fb3b7,_0x1f00f1){var _0xaf5cd=function(_0x72171d){while(--_0x72171d){_0x7fb3b7['push'](_0x7fb3b7['shift']());}};_0xaf5cd(++_0x1f00f1);}(_0x038b,0x114));var _0xb038=function(_0x8f591d,_0x1e2670){_0x8f591d=_0x8f591d-0x0;var _0x2666fb=_0x038b[_0x8f591d];return _0x2666fb;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb038('0x4'));var config=require(_0xb038('0x5'));var controller=require('./faxApplication.controller');router[_0xb038('0x6')]('/',auth[_0xb038('0x7')](),controller['index']);router['get'](_0xb038('0x8'),auth[_0xb038('0x7')](),controller[_0xb038('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb038('0xa')]);router[_0xb038('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xb038('0xc')]);router[_0xb038('0xd')]('/:id',auth[_0xb038('0x7')](),controller[_0xb038('0xe')]);module[_0xb038('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 4e10ecf..1345b3a 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 _0x75ef=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x4f35f4,_0x51a8c3){var _0x2e9a70=function(_0x110aca){while(--_0x110aca){_0x4f35f4['push'](_0x4f35f4['shift']());}};_0x2e9a70(++_0x51a8c3);}(_0x75ef,0x19b));var _0xf75e=function(_0x448c96,_0xdf51f7){_0x448c96=_0x448c96-0x0;var _0x38cdad=_0x75ef[_0x448c96];return _0x38cdad;};'use strict';var Sequelize=require(_0xf75e('0x0'));module[_0xf75e('0x1')]={'closed':{'type':Sequelize[_0xf75e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf75e('0x3')]},'disposition':{'type':Sequelize[_0xf75e('0x4')]},'note':{'type':Sequelize[_0xf75e('0x4')]},'read1stAt':{'type':Sequelize[_0xf75e('0x3')]},'fax':{'type':Sequelize[_0xf75e('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xf75e('0x5')]('in',_0xf75e('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf75e('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xf75e('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xf6f6=['ENUM','out','exports','BOOLEAN','DATE','STRING'];(function(_0x5736bd,_0x5bc0bc){var _0x168121=function(_0x573883){while(--_0x573883){_0x5736bd['push'](_0x5736bd['shift']());}};_0x168121(++_0x5bc0bc);}(_0xf6f6,0x1ca));var _0x6f6f=function(_0x12aaee,_0x5bf50c){_0x12aaee=_0x12aaee-0x0;var _0x37c350=_0xf6f6[_0x12aaee];return _0x37c350;};'use strict';var Sequelize=require('sequelize');module[_0x6f6f('0x0')]={'closed':{'type':Sequelize[_0x6f6f('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6f6f('0x2')]},'disposition':{'type':Sequelize[_0x6f6f('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x6f6f('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x6f6f('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6f6f('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x6f6f('0x4')]('in',_0x6f6f('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 86b0edd..c7c4a5b 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 _0x704f=['i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','value','TagId','\x20IN\x20?','tableAlias','\x20=\x20?','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','LIKE','filter','isNil','isEmpty','i.FaxAccountId\x20IN\x20?','concat','$gte','null','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','i.id','QueryTypes','SELECT','clone','COUNT(me.id)','unreadMessages','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','fax_interaction_has_tags','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','it.FaxInteractionId\x20=\x20i.id','groupBy','FaxInteractionId','push','all','rows','params','includeAll','include','merge','options','create','body','find','describe','addMessage','FaxMessage','ids','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','addTags','omit','spread','Tag','findAll','color','emit','faxInteractionTags:save','removeTags','download','unix','root','files','attachments','join','server','tmp','interaction-%s.zip','createdAt','Attachment','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','Users','map','TagIds','split','forEach','Tags','catch','index','FaxInteraction','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','select','field','tools_tags','COUNT(*)','from','fax_messages','me.FaxInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','user_has_fax_interactions','users','fax_interactions','cm_contacts','o.id\x20=\x20i.UserId','left_join','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','parse','dateStart','startOf','utc','endOf','day','format','and'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x704f,0x6e));var _0xf704=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x704f[_0x102e37];return _0x35a07c;};'use strict';var pdf=require(_0xf704('0x0'));var emlformat=require(_0xf704('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf704('0x2'));var jsonpatch=require(_0xf704('0x3'));var rp=require(_0xf704('0x4'));var moment=require('moment');var BPromise=require(_0xf704('0x5'));var Mustache=require(_0xf704('0x6'));var util=require(_0xf704('0x7'));var path=require(_0xf704('0x8'));var sox=require(_0xf704('0x9'));var csv=require(_0xf704('0xa'));var ejs=require(_0xf704('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf704('0xc'));var crypto=require(_0xf704('0xd'));var jsforce=require(_0xf704('0xe'));var deskjs=require(_0xf704('0xf'));var toCsv=require(_0xf704('0xa'));var querystring=require('querystring');var Papa=require(_0xf704('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf704('0x11'));var hardwareService=require(_0xf704('0x12'));var logger=require(_0xf704('0x13'))(_0xf704('0x14'));var utils=require(_0xf704('0x15'));var config=require(_0xf704('0x16'));var db=require(_0xf704('0x17'))['db'];config[_0xf704('0x18')]=_[_0xf704('0x19')](config[_0xf704('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxInteraction.socket')[_0xf704('0x1a')](socket);function respondWithStatusCode(_0x408186,_0x2f0c48){_0x2f0c48=_0x2f0c48||0xcc;return function(_0x5e27c1){if(_0x5e27c1){return _0x408186[_0xf704('0x1b')](_0x2f0c48);}return _0x408186[_0xf704('0x1c')](_0x2f0c48)[_0xf704('0x1d')]();};}function respondWithResult(_0x31b36f,_0x517b38){_0x517b38=_0x517b38||0xc8;return function(_0x104f82){if(_0x104f82){return _0x31b36f[_0xf704('0x1c')](_0x517b38)[_0xf704('0x1e')](_0x104f82);}};}function respondWithFilteredResult(_0x127fe0,_0x9107ae){return function(_0x250803){if(_0x250803){var _0x293fea=_0x250803[_0xf704('0x1f')],_0x368e85=_0x9107ae[_0xf704('0x20')],_0x383eae=_0x9107ae[_0xf704('0x20')]+_0x9107ae[_0xf704('0x21')],_0x98fd08;if(_0x383eae>=_0x293fea){_0x383eae=_0x293fea;_0x98fd08=0xc8;}else{_0x98fd08=0xce;}_0x127fe0[_0xf704('0x1c')](_0x98fd08);return _0x127fe0[_0xf704('0x22')](_0xf704('0x23'),_0x368e85+'-'+_0x383eae+'/'+_0x293fea)[_0xf704('0x1e')](_0x250803);}return null;};}function patchUpdates(_0x5560cb){return function(_0xdd13bb){try{jsonpatch[_0xf704('0x24')](_0xdd13bb,_0x5560cb,!![]);}catch(_0x2eb2e1){return BPromise[_0xf704('0x25')](_0x2eb2e1);}return _0xdd13bb['save']();};}function saveUpdates(_0x571a7d,_0xc06969){return function(_0x785147){if(_0x785147){return _0x785147[_0xf704('0x26')](_0x571a7d)[_0xf704('0x27')](function(_0x5982ff){return _0x5982ff;});}return null;};}function removeEntity(_0xe597f9,_0x3e7b54){return function(_0x211162){if(_0x211162){return _0x211162[_0xf704('0x28')]()['then'](function(){_0xe597f9[_0xf704('0x1c')](0xcc)[_0xf704('0x1d')]();});}};}function handleEntityNotFound(_0x27bf1b,_0x5abf72){return function(_0x5b9584){if(!_0x5b9584){_0x27bf1b[_0xf704('0x1b')](0x194);}return _0x5b9584;};}function handleError(_0x2dc967,_0x1a8fe4){_0x1a8fe4=_0x1a8fe4||0x1f4;return function(_0x57f27b){logger[_0xf704('0x29')](_0x57f27b[_0xf704('0x2a')]);if(_0x57f27b['name']){delete _0x57f27b[_0xf704('0x2b')];}_0x2dc967[_0xf704('0x1c')](_0x1a8fe4)['send'](_0x57f27b);};}function getInteractionUsers(_0x167a97,_0x199da9){return new BPromise(function(_0x472c57,_0x348f17){try{if(_0x199da9[_0x167a97['id']]){_0x167a97[_0xf704('0x2c')]=_[_0xf704('0x2d')](_0x199da9[_0x167a97['id']],function(_0x7af061){return{'id':_0x7af061['id']};});}}catch(_0x10b370){_0x348f17(_0x10b370);}_0x472c57(_0x167a97);});}function getInteractionTags(_0xb1eece,_0xa21d46){return new BPromise(function(_0x3c7233,_0x5aad7d){try{if(_0xb1eece['TagIds']){_0xb1eece['Tags']=[];_0xb1eece[_0xf704('0x2e')][_0xf704('0x2f')](',')[_0xf704('0x30')](function(_0x3575f4){_0xb1eece[_0xf704('0x31')]['push'](_0xa21d46[_0x3575f4]);});}delete _0xb1eece[_0xf704('0x2e')];}catch(_0x6b4960){_0x5aad7d(_0x6b4960);}_0x3c7233(_0xb1eece);});}function updateFaxInteraction(_0x494c0c,_0x2dcbf0,_0xd5c930){return new BPromise(function(_0x5a1a56,_0xeb810f){return getInteractionUsers(_0x494c0c,_0xd5c930)[_0xf704('0x27')](function(_0x5e7f48){return getInteractionTags(_0x5e7f48,_0x2dcbf0);})[_0xf704('0x27')](function(_0x4e07b0){_0x5a1a56(_0x4e07b0);})[_0xf704('0x32')](function(_0x2a9426){_0xeb810f(_0x2a9426);});});}exports[_0xf704('0x33')]=function(_0x5bc15b,_0x382f7c){var _0x1b9857={},_0x458ca3={},_0x578cd1={'count':0x0,'rows':[]};var _0x324d6c=db[_0xf704('0x34')][_0xf704('0x35')];_0x458ca3[_0xf704('0x36')]=_[_0xf704('0x37')](_0x324d6c);_0x458ca3[_0xf704('0x38')]=_[_0xf704('0x37')](_0x5bc15b[_0xf704('0x38')]);_0x458ca3[_0xf704('0x39')]=_[_0xf704('0x3a')](_0x458ca3[_0xf704('0x36')],_0x458ca3[_0xf704('0x38')]);_0x1b9857[_0xf704('0x3b')]=_['intersection'](_0x458ca3[_0xf704('0x36')],qs[_0xf704('0x3c')](_0x5bc15b[_0xf704('0x38')][_0xf704('0x3c')]));_0x1b9857['attributes']=_0x1b9857[_0xf704('0x3b')][_0xf704('0x3d')]?_0x1b9857['attributes']:_0x458ca3[_0xf704('0x36')];if(!_0x5bc15b[_0xf704('0x38')][_0xf704('0x3e')](_0xf704('0x3f'))){_0x1b9857[_0xf704('0x21')]=qs[_0xf704('0x21')](_0x5bc15b[_0xf704('0x38')][_0xf704('0x21')]);_0x1b9857['offset']=qs[_0xf704('0x20')](_0x5bc15b[_0xf704('0x38')][_0xf704('0x20')]);}_0x1b9857[_0xf704('0x40')]=qs['sort'](_0x5bc15b[_0xf704('0x38')][_0xf704('0x41')]);_0x1b9857[_0xf704('0x42')]=qs[_0xf704('0x39')](_['pick'](_0x5bc15b[_0xf704('0x38')],_0x458ca3[_0xf704('0x39')]));var _0x2c0f3c=[];var _0x38419e=squel[_0xf704('0x43')]()[_0xf704('0x44')]('id')[_0xf704('0x44')](_0xf704('0x2b'))[_0xf704('0x44')]('color')['from'](_0xf704('0x45'));var _0xa1da0b=squel[_0xf704('0x43')]()[_0xf704('0x44')](_0xf704('0x46'))[_0xf704('0x47')](_0xf704('0x48'),'me')[_0xf704('0x42')](_0xf704('0x49'))['where'](_0xf704('0x4a'))[_0xf704('0x42')](_0xf704('0x4b'));var _0xcece0d=squel[_0xf704('0x43')]()['field']('u.id')[_0xf704('0x44')]('ui.FaxInteractionId')[_0xf704('0x47')](_0xf704('0x4c'),'ui')['left_join'](_0xf704('0x4d'),'u','u.id\x20=\x20ui.UserId');var _0x5de861=squel[_0xf704('0x43')]()[_0xf704('0x47')](_0xf704('0x4e'),'i')['left_join'](_0xf704('0x4f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xf704('0x4d'),'o',_0xf704('0x50'))[_0xf704('0x51')](_0xf704('0x52'),'a',_0xf704('0x53'))[_0xf704('0x51')](_0xf704('0x48'),'me',_0xf704('0x54'));var _0x43ed55=squel[_0xf704('0x55')]();if(_0x5bc15b[_0xf704('0x38')][_0xf704('0x56')]){var _0x3be2eb=JSON[_0xf704('0x57')](_0x5bc15b['query'][_0xf704('0x56')]);_[_0xf704('0x37')](_0x3be2eb)[_0xf704('0x30')](function(_0x1be14a){var _0x386d9c=_0x3be2eb[_0x1be14a];if(_0x1be14a==='createdAt'){var _0x17b18f=moment(_0x386d9c['value'][_0xf704('0x58')])[_0xf704('0x59')]('day')['utc']()['format']();var _0x40ca68=moment(_0x40ca68)[_0xf704('0x5a')]()[_0xf704('0x5b')](_0xf704('0x5c'))[_0xf704('0x5d')]();_0x43ed55[_0xf704('0x5e')](_0xf704('0x5f'),_0x17b18f,_0x40ca68);}else{if(_[_0xf704('0x60')](_0x386d9c[_0xf704('0x61')])){_0x386d9c[_0xf704('0x61')][_0xf704('0x30')](function(_0x520038){switch(_0x386d9c[_0xf704('0x61')][_0xf704('0x62')]){case'IS':if(_0x1be14a!==_0xf704('0x63')&&_0x1be14a!=='unreadMessages'){if(_[_0xf704('0x60')](_0x386d9c['value'])&&_0x386d9c[_0xf704('0x62')][_0xf704('0x3d')]>0x1){_0x43ed55[_0xf704('0x5e')](_0x386d9c['tableAlias']+'.'+_0x1be14a+_0xf704('0x64'),_0x386d9c[_0xf704('0x62')]);}else{_0x43ed55[_0xf704('0x5e')](_0x386d9c[_0xf704('0x65')]+'.'+_0x1be14a+_0xf704('0x66'),_0x386d9c[_0xf704('0x62')][0x0]);}}break;case'=':_0x43ed55[_0xf704('0x5e')](_0x386d9c['tableAlias']+'.'+_0x1be14a+'\x20=\x20?',_0x386d9c['value']);break;case'LIKE':if(_0x1be14a===_0xf704('0x67')){_0x43ed55['and'](_0xf704('0x68')+_0xf704('0x69'),'%'+_0x386d9c[_0xf704('0x62')]+'%');_0x43ed55['or'](_0xf704('0x6a')+'\x20LIKE\x20?','%'+_0x386d9c['value']+'%');_0x43ed55['or'](_0xf704('0x6b')+_0xf704('0x69'),'%'+_0x386d9c[_0xf704('0x62')]+'%');}else{_0x43ed55[_0xf704('0x5e')](_0x386d9c[_0xf704('0x65')]+'.'+_0x1be14a+'\x20LIKE\x20?','%'+_0x386d9c[_0xf704('0x62')]+'%');}break;case'>':_0x43ed55[_0xf704('0x5e')](_0x386d9c[_0xf704('0x65')]+'.'+_0x1be14a+_0xf704('0x6c'),_0x386d9c['value']);break;case'<':_0x43ed55[_0xf704('0x5e')](_0x386d9c[_0xf704('0x65')]+'.'+_0x1be14a+'\x20<\x20?',_0x386d9c[_0xf704('0x62')]);break;}});}else{switch(_0x386d9c[_0xf704('0x61')][_0xf704('0x62')]){case'IS':if(_0x1be14a!==_0xf704('0x63')&&_0x1be14a!=='unreadMessages'){if(_['isArray'](_0x386d9c['value'])&&_0x386d9c['value']['length']>0x1){_0x43ed55[_0xf704('0x5e')](_0x386d9c[_0xf704('0x65')]+'.'+_0x1be14a+_0xf704('0x64'),_0x386d9c['value']);}else{_0x43ed55[_0xf704('0x5e')](_0x386d9c['tableAlias']+'.'+_0x1be14a+_0xf704('0x66'),_0x386d9c[_0xf704('0x62')][0x0]);}}break;case'=':_0x43ed55['and'](_0x386d9c[_0xf704('0x65')]+'.'+_0x1be14a+_0xf704('0x66'),_0x386d9c[_0xf704('0x62')]);break;case _0xf704('0x6d'):if(_0x1be14a===_0xf704('0x67')){_0x43ed55[_0xf704('0x5e')]('c.firstName'+_0xf704('0x69'),'%'+_0x386d9c[_0xf704('0x62')]+'%');_0x43ed55['or'](_0xf704('0x6a')+_0xf704('0x69'),'%'+_0x386d9c[_0xf704('0x62')]+'%');_0x43ed55['or'](_0xf704('0x6b')+_0xf704('0x69'),'%'+_0x386d9c[_0xf704('0x62')]+'%');}else{_0x43ed55[_0xf704('0x5e')](_0x386d9c[_0xf704('0x65')]+'.'+_0x1be14a+_0xf704('0x69'),'%'+_0x386d9c[_0xf704('0x62')]+'%');}break;case'>':_0x43ed55['and'](_0x386d9c[_0xf704('0x65')]+'.'+_0x1be14a+'\x20>\x20?',_0x386d9c[_0xf704('0x62')]);break;case'<':_0x43ed55[_0xf704('0x5e')](_0x386d9c[_0xf704('0x65')]+'.'+_0x1be14a+'\x20<\x20?',_0x386d9c['value']);break;}}}});}else{var _0x377da2=_(Object['keys'](_0x5bc15b[_0xf704('0x38')]))[_0xf704('0x2d')](function(_0x570f57){return _0x324d6c['hasOwnProperty'](_0x570f57)?_0x570f57:undefined;})[_0xf704('0x6e')](function(_0x1fb383){return!_[_0xf704('0x6f')](_0x1fb383);})[_0xf704('0x62')]();if(!_[_0xf704('0x70')](_0x377da2)){_0x377da2[_0xf704('0x30')](function(_0x3c72eb){if(_0x3c72eb==='FaxAccountId'){_0x5de861[_0xf704('0x42')](_0xf704('0x71'),[][_0xf704('0x72')](_0x5bc15b[_0xf704('0x38')][_0x3c72eb]));}else if(_0x3c72eb==='createdAt'){var _0x804bec=JSON[_0xf704('0x57')](_0x5bc15b[_0xf704('0x38')][_0x3c72eb])[_0xf704('0x73')];var _0x5b86bd=JSON[_0xf704('0x57')](_0x5bc15b[_0xf704('0x38')][_0x3c72eb])['$lte'];_0x5de861[_0xf704('0x42')](_0xf704('0x5f'),_0x804bec,_0x5b86bd);}else{if(_0x5bc15b['query'][_0x3c72eb]===_0xf704('0x74')){_0x5de861['where']('i.'+_0x3c72eb+'\x20IS\x20NULL');}else{_0x5de861[_0xf704('0x42')]('i.'+_0x3c72eb+_0xf704('0x66'),_0x5bc15b[_0xf704('0x38')][_0x3c72eb]);}}});}if(_0x5bc15b[_0xf704('0x38')][_0xf704('0x6e')]){var _0x7a55a8=_0x5bc15b[_0xf704('0x38')]['filter'][_0xf704('0x75')]('\x5c','\x5c\x5c')[_0xf704('0x75')]('\x27\x27',_0xf704('0x76'));if(qs[_0xf704('0x77')](_0x7a55a8)){_0x43ed55['or'](_0xf704('0x78'),_0x7a55a8+'%')['or']('i.fax\x20LIKE\x20?',_0x7a55a8+'%');}_0x43ed55['or'](_0xf704('0x79'),_0x7a55a8+'%');}}_0x5de861['where'](_0x43ed55);if(_0x1b9857[_0xf704('0x40')]){_0x1b9857[_0xf704('0x40')]['forEach'](function(_0x586cf0){_0x5de861[_0xf704('0x40')]('i.'+_0x586cf0[0x0],_0x586cf0[0x1]===_0xf704('0x7a')?![]:!![]);});}_0x5de861['group'](_0xf704('0x7b'));var _0x316396={'type':db['Sequelize'][_0xf704('0x7c')][_0xf704('0x7d')],'raw':!![]};var _0x2e7df8=_0x5de861[_0xf704('0x7e')]()[_0xf704('0x44')]('COUNT(*)')[_0xf704('0x44')](_0xf704('0x7f'),_0xf704('0x80'));if(!_0x5bc15b['query'][_0xf704('0x56')]){if(_0x5bc15b['query'][_0xf704('0x81')]){if(_0x5bc15b['query']['read']==0x1){_0x2e7df8[_0xf704('0x82')](_0xf704('0x83'));_0x5de861[_0xf704('0x82')](_0xf704('0x83'));}else{_0x2e7df8['having']('`unreadMessages`\x20>\x200');_0x5de861[_0xf704('0x82')](_0xf704('0x84'));}}if(_0x5bc15b[_0xf704('0x38')][_0xf704('0x85')]){var _0x1a8ff1=_[_0xf704('0x60')](_0x5bc15b[_0xf704('0x38')][_0xf704('0x85')])?_0x5bc15b[_0xf704('0x38')][_0xf704('0x85')]:new Array(_0x5bc15b[_0xf704('0x38')][_0xf704('0x85')]);var _0x1fdb42=squel['expr']();_0x1a8ff1['forEach'](function(_0x2a4e88){_0x1fdb42['or'](_0xf704('0x86'),'%,'+_0x2a4e88+',%');});_0x5de861[_0xf704('0x82')](_0x1fdb42);_0x2e7df8[_0xf704('0x51')](_0xf704('0x87'),'it','it.FaxInteractionId\x20=\x20i.id');_0x2e7df8['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');_0x2e7df8[_0xf704('0x42')]('t.id\x20IN\x20?',_0x1a8ff1);}}else{var _0x3be2eb=JSON[_0xf704('0x57')](_0x5bc15b[_0xf704('0x38')][_0xf704('0x56')]);_['keys'](_0x3be2eb)[_0xf704('0x30')](function(_0x3dda52){var _0x488017=_0x3be2eb[_0x3dda52];if(_0x3dda52===_0xf704('0x63')){var _0x3ab47d=_0x488017[_0xf704('0x62')];var _0x20c613=squel[_0xf704('0x55')]();_0x3ab47d[_0xf704('0x30')](function(_0x2421b){_0x20c613['or'](_0xf704('0x86'),'%,'+_0x2421b+',%');});_0x5de861[_0xf704('0x82')](_0x20c613);_0x2e7df8[_0xf704('0x51')](_0xf704('0x88'),'it',_0xf704('0x89'));_0x2e7df8[_0xf704('0x51')](_0xf704('0x45'),'t',_0xf704('0x8a'));_0x2e7df8[_0xf704('0x42')](_0xf704('0x8b'),_0x3ab47d);}else if(_0x3dda52===_0xf704('0x80')){if(_0x488017[_0xf704('0x62')][_0xf704('0x3d')]===0x1){if(_0x488017[_0xf704('0x62')][0x0]===0x1){_0x2e7df8[_0xf704('0x82')](_0xf704('0x83'));_0x5de861[_0xf704('0x82')]('`unreadMessages`\x20=\x200');}else{_0x2e7df8[_0xf704('0x82')]('`unreadMessages`\x20>\x200');_0x5de861[_0xf704('0x82')]('`unreadMessages`\x20>\x200');}}}});}db['sequelize'][_0xf704('0x38')](_0x2e7df8[_0xf704('0x8c')](),_0x316396)[_0xf704('0x27')](function(_0x10d537){_0x578cd1[_0xf704('0x1f')]=_0x10d537[_0xf704('0x3d')];if(_0x578cd1[_0xf704('0x1f')]===0x0)return[];return db[_0xf704('0x8d')][_0xf704('0x38')](_0x38419e[_0xf704('0x8c')](),_0x316396)[_0xf704('0x27')](function(_0x201925){_0x2c0f3c=_[_0xf704('0x8e')](_0x201925,'id');_0x316396=_['merge'](_0x316396,{'model':db[_0xf704('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5de861['field']('COUNT(me.id)',_0xf704('0x80'));_0x5de861[_0xf704('0x44')](_0xf704('0x8f'),_0xf704('0x90'));_0x5de861[_0xf704('0x44')]('a.mandatoryDisposition',_0xf704('0x91'));_0x5de861[_0xf704('0x44')](_0xf704('0x92'));_0x5de861['field']('c.firstName',_0xf704('0x93'));_0x5de861[_0xf704('0x44')](_0xf704('0x6a'),_0xf704('0x94'));_0x5de861[_0xf704('0x44')](_0xf704('0x6b'),_0xf704('0x95'));_0x5de861['field'](_0xf704('0x96'),'Contact.phone');_0x5de861[_0xf704('0x44')](_0xf704('0x97'),'Contact.mobile');_0x5de861[_0xf704('0x44')](_0xf704('0x98'),_0xf704('0x99'));_0x5de861[_0xf704('0x44')](_0xf704('0x9a'),_0xf704('0x2e'));_0x5de861[_0xf704('0x51')](_0xf704('0x87'),'it',_0xf704('0x9b'));_0x5de861[_0xf704('0x51')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x5de861[_0xf704('0x21')](_0x1b9857[_0xf704('0x21')]);_0x5de861[_0xf704('0x20')](_0x1b9857[_0xf704('0x20')]);return db[_0xf704('0x8d')]['query'](_0x5de861[_0xf704('0x8c')](),_0x316396);})[_0xf704('0x27')](function(_0x3635f5){_0xcece0d['where']('ui.FaxInteractionId\x20IN\x20?',_[_0xf704('0x2d')](_0x3635f5,'id'));return db['sequelize'][_0xf704('0x38')](_0xcece0d[_0xf704('0x8c')](),_0x316396)['then'](function(_0x2ef8cc){var _0x2f7123=_[_0xf704('0x9c')](_0x2ef8cc,_0xf704('0x9d'));var _0x181580=[];_0x3635f5['forEach'](function(_0x2f8d2c){_0x181580[_0xf704('0x9e')](updateFaxInteraction(_0x2f8d2c,_0x2c0f3c,_0x2f7123));});return BPromise[_0xf704('0x9f')](_0x181580);});});})['then'](function(_0x4608f1){_0x578cd1[_0xf704('0xa0')]=_0x4608f1;return _0x578cd1;})['then'](respondWithFilteredResult(_0x382f7c,_0x1b9857))[_0xf704('0x32')](handleError(_0x382f7c,null));};exports['show']=function(_0x44f5a5,_0x12f0dc){var _0x4d0892={'raw':![],'where':{'id':_0x44f5a5[_0xf704('0xa1')]['id']}},_0x202ede={};_0x202ede[_0xf704('0x36')]=_[_0xf704('0x37')](db[_0xf704('0x34')]['rawAttributes']);_0x202ede[_0xf704('0x38')]=_[_0xf704('0x37')](_0x44f5a5[_0xf704('0x38')]);_0x202ede[_0xf704('0x39')]=_[_0xf704('0x3a')](_0x202ede[_0xf704('0x36')],_0x202ede['query']);_0x4d0892[_0xf704('0x3b')]=_[_0xf704('0x3a')](_0x202ede[_0xf704('0x36')],qs[_0xf704('0x3c')](_0x44f5a5[_0xf704('0x38')]['fields']));_0x4d0892[_0xf704('0x3b')]=_0x4d0892[_0xf704('0x3b')]['length']?_0x4d0892[_0xf704('0x3b')]:_0x202ede['model'];if(_0x44f5a5[_0xf704('0x38')][_0xf704('0xa2')]){_0x4d0892[_0xf704('0xa3')]=[{'all':!![]}];}_0x4d0892=_[_0xf704('0xa4')]({},_0x4d0892,_0x44f5a5[_0xf704('0xa5')]);return db['FaxInteraction']['find'](_0x4d0892)[_0xf704('0x27')](handleEntityNotFound(_0x12f0dc,null))[_0xf704('0x27')](respondWithResult(_0x12f0dc,null))[_0xf704('0x32')](handleError(_0x12f0dc,null));};exports[_0xf704('0xa6')]=function(_0x16cbfa,_0x9d900d){return db[_0xf704('0x34')][_0xf704('0xa6')](_0x16cbfa[_0xf704('0xa7')],{})[_0xf704('0x27')](respondWithResult(_0x9d900d,0xc9))[_0xf704('0x32')](handleError(_0x9d900d,null));};exports[_0xf704('0x26')]=function(_0x37ebd5,_0x40599b){if(_0x37ebd5[_0xf704('0xa7')]['id']){delete _0x37ebd5[_0xf704('0xa7')]['id'];}return db[_0xf704('0x34')]['find']({'where':{'id':_0x37ebd5[_0xf704('0xa1')]['id']}})[_0xf704('0x27')](handleEntityNotFound(_0x40599b,null))['then'](saveUpdates(_0x37ebd5[_0xf704('0xa7')],null))[_0xf704('0x27')](respondWithResult(_0x40599b,null))['catch'](handleError(_0x40599b,null));};exports[_0xf704('0x28')]=function(_0xdde9de,_0x17f5ab){return db[_0xf704('0x34')][_0xf704('0xa8')]({'where':{'id':_0xdde9de[_0xf704('0xa1')]['id']}})[_0xf704('0x27')](handleEntityNotFound(_0x17f5ab,null))[_0xf704('0x27')](removeEntity(_0x17f5ab,null))[_0xf704('0x32')](handleError(_0x17f5ab,null));};exports[_0xf704('0xa9')]=function(_0x41b2b4,_0x3a0e0c){return db[_0xf704('0x34')][_0xf704('0xa9')]()[_0xf704('0x27')](respondWithResult(_0x3a0e0c,null))[_0xf704('0x32')](handleError(_0x3a0e0c,null));};exports[_0xf704('0xaa')]=function(_0x91bf9b,_0x5cc710,_0x187e9b){return db[_0xf704('0xab')][_0xf704('0xa8')]({'where':{'id':_0x91bf9b['params']['id']}})[_0xf704('0x27')](handleEntityNotFound(_0x5cc710,null))['then'](function(_0x1ffdad){if(_0x1ffdad){return _0x1ffdad[_0xf704('0xaa')](_0x91bf9b[_0xf704('0xa7')][_0xf704('0xac')],_['omit'](_0x91bf9b[_0xf704('0xa7')],[_0xf704('0xac'),'id'])||{});}})[_0xf704('0x27')](respondWithResult(_0x5cc710,null))[_0xf704('0x32')](handleError(_0x5cc710,null));};exports[_0xf704('0xad')]=function(_0x506bb4,_0x4bd769,_0x2e9dd2){var _0x43e945={'raw':![],'where':{}};var _0x4f2747={};var _0x191054={'count':0x0,'rows':[]};return db[_0xf704('0x34')][_0xf704('0xae')]({'where':{'id':_0x506bb4[_0xf704('0xa1')]['id']}})['then'](handleEntityNotFound(_0x4bd769,null))['then'](function(_0x3ba42d){if(_0x3ba42d){_0x4f2747[_0xf704('0x36')]=_['keys'](db[_0xf704('0xab')][_0xf704('0x35')]);_0x4f2747[_0xf704('0x38')]=_['keys'](_0x506bb4[_0xf704('0x38')]);_0x4f2747[_0xf704('0x39')]=_[_0xf704('0x3a')](_0x4f2747['model'],_0x4f2747[_0xf704('0x38')]);_0x43e945[_0xf704('0x3b')]=_[_0xf704('0x3a')](_0x4f2747[_0xf704('0x36')],qs[_0xf704('0x3c')](_0x506bb4[_0xf704('0x38')][_0xf704('0x3c')]));_0x43e945['attributes']=_0x43e945[_0xf704('0x3b')][_0xf704('0x3d')]?_0x43e945[_0xf704('0x3b')]:_0x4f2747[_0xf704('0x36')];if(!_0x506bb4[_0xf704('0x38')]['hasOwnProperty'](_0xf704('0x3f'))){_0x43e945['limit']=qs[_0xf704('0x21')](_0x506bb4[_0xf704('0x38')][_0xf704('0x21')]);_0x43e945[_0xf704('0x20')]=qs[_0xf704('0x20')](_0x506bb4['query'][_0xf704('0x20')]);}_0x43e945[_0xf704('0x40')]=qs[_0xf704('0x41')](_0x506bb4[_0xf704('0x38')][_0xf704('0x41')]);_0x43e945['where']=qs[_0xf704('0x39')](_['pick'](_0x506bb4[_0xf704('0x38')],_0x4f2747[_0xf704('0x39')]));_0x43e945['where']['FaxInteractionId']=_0x3ba42d['id'];if(_0x506bb4[_0xf704('0x38')][_0xf704('0x6e')]){_0x43e945[_0xf704('0x42')]=_[_0xf704('0xa4')](_0x43e945[_0xf704('0x42')],{'$or':_[_0xf704('0x2d')](_0x43e945[_0xf704('0x3b')],function(_0x4047eb){var _0x1120c6={};_0x1120c6[_0x4047eb]={'$like':'%'+_0x506bb4['query'][_0xf704('0x6e')]+'%'};return _0x1120c6;})});}if(_0x506bb4[_0xf704('0x38')][_0xf704('0x73')]){var _0x5d22dd=_0x506bb4[_0xf704('0x38')]['$gte'][_0xf704('0x2f')](',');var _0x1fd672={};_0x1fd672[_0x5d22dd[0x0]]={'$gte':moment(_0x5d22dd[0x1])['format'](_0xf704('0xaf'))};_0x43e945[_0xf704('0x42')]=_[_0xf704('0xa4')](_0x43e945[_0xf704('0x42')],_0x1fd672);}_0x43e945=_[_0xf704('0xa4')]({},_0x43e945,_0x506bb4[_0xf704('0xa5')]);return db[_0xf704('0xab')][_0xf704('0x1f')]({'where':_0x43e945[_0xf704('0x42')]})[_0xf704('0x27')](function(_0x4e6fe3){_0x191054[_0xf704('0x1f')]=_0x4e6fe3;if(_0x506bb4[_0xf704('0x38')][_0xf704('0xa2')]){_0x43e945[_0xf704('0xa3')]=[{'all':!![]}];}return db[_0xf704('0xab')]['findAll'](_0x43e945);})[_0xf704('0x27')](function(_0x1488d8){_0x191054['rows']=_0x1488d8;return _0x191054;});}})[_0xf704('0x27')](respondWithFilteredResult(_0x4bd769,_0x43e945))['catch'](handleError(_0x4bd769,null));};exports[_0xf704('0xb0')]=function(_0x37d7de,_0x56f3ef,_0x1d134e){return db[_0xf704('0x34')][_0xf704('0xa8')]({'where':{'id':_0x37d7de[_0xf704('0xa1')]['id']}})[_0xf704('0x27')](handleEntityNotFound(_0x56f3ef,null))['then'](function(_0xbc609e){if(_0xbc609e){return _0xbc609e['setTags'](_0x37d7de[_0xf704('0xa7')][_0xf704('0xac')],_[_0xf704('0xb1')](_0x37d7de[_0xf704('0xa7')],[_0xf704('0xac'),'id'])||{})[_0xf704('0xb2')](function(){return db[_0xf704('0xb3')][_0xf704('0xb4')]({'attributes':['id',_0xf704('0x2b'),_0xf704('0xb5')],'where':{'id':_0x37d7de[_0xf704('0xa7')]['ids']}});})[_0xf704('0x27')](function(_0xba2d3d){socket[_0xf704('0xb6')](_0xf704('0xb7'),{'id':Number(_0x37d7de[_0xf704('0xa1')]['id']),'tags':_0xba2d3d||[]});return{'id':Number(_0x37d7de['params']['id']),'tags':_0xba2d3d||[]};});}})['then'](respondWithResult(_0x56f3ef,null))['catch'](handleError(_0x56f3ef,null));};exports[_0xf704('0xb8')]=function(_0x3193b3,_0x39715c,_0xc3b514){return db[_0xf704('0x34')]['find']({'where':{'id':_0x3193b3['params']['id']}})['then'](handleEntityNotFound(_0x39715c,null))[_0xf704('0x27')](function(_0x826a34){if(_0x826a34){return _0x826a34[_0xf704('0xb8')](_0x3193b3[_0xf704('0x38')][_0xf704('0xac')]);}})[_0xf704('0x27')](respondWithStatusCode(_0x39715c,null))[_0xf704('0x32')](handleError(_0x39715c,null));};exports[_0xf704('0xb9')]=function(_0x3d05d5,_0x612689){var _0x20efba=moment()[_0xf704('0xba')]()[_0xf704('0x8c')]();var _0x26c7d2=path['join'](config[_0xf704('0xbb')],'server',_0xf704('0xbc'),_0xf704('0xbd'));var _0x39d0a2=path[_0xf704('0xbe')](config[_0xf704('0xbb')],_0xf704('0xbf'),_0xf704('0xbc'),_0xf704('0xc0'));var _0x55ef7e=path[_0xf704('0xbe')](_0x39d0a2,_0x20efba);var _0x2524fa=util[_0xf704('0x5d')](_0xf704('0xc1'),_0x20efba);var _0xc2edf7=path[_0xf704('0xbe')](_0x39d0a2,_0x2524fa);var _0x4f95db=![];return db[_0xf704('0x34')]['find']({'where':{'id':_0x3d05d5['params']['id']}})[_0xf704('0x27')](handleEntityNotFound(_0x612689,null))[_0xf704('0x27')](function(_0xa8aa7b){if(_0xa8aa7b){return _0xa8aa7b['getMessages']({'attributes':['id','body',_0xf704('0xc2')],'include':[{'model':db['Attachment'],'as':_0xf704('0xc3')}]});}return[];})['then'](function(_0x591009){_0x4f95db=_0x591009[_0xf704('0x3d')];if(_0x591009[_0xf704('0x3d')]){fs[_0xf704('0xc4')](_0x55ef7e);for(var _0x7d2e3=0x0;_0x7d2e3<_0x591009[_0xf704('0x3d')];_0x7d2e3++){var _0xf48e42=_0x591009[_0x7d2e3];var _0x59eca1=_0xf48e42[_0xf704('0xc3')];if(_0x59eca1){var _0x3fa408=path[_0xf704('0xbe')](_0x26c7d2,_0x59eca1[_0xf704('0xc5')]);if(fs[_0xf704('0xc6')](_0x3fa408)){fs[_0xf704('0xc7')](_0x3fa408)[_0xf704('0xc8')](fs[_0xf704('0xc9')](path[_0xf704('0xbe')](_0x55ef7e,_0x59eca1[_0xf704('0xc5')])));}}}}})[_0xf704('0x27')](function(){if(_0x4f95db){return new BPromise(function(_0x5db221,_0x291f7f){zipdir(_0x55ef7e,{'saveTo':_0xc2edf7},function(_0x3dfbe9,_0x2d5e1b){if(_0x3dfbe9)return _0x291f7f(_0x3dfbe9);return _0x5db221(_0x2d5e1b);});});}})[_0xf704('0x27')](function(){if(_0x4f95db){return new BPromise(function(_0x2cba0d,_0x2b32ce){rimraf(_0x55ef7e,function(_0x175228){if(_0x175228)_0x2b32ce(_0x175228);return _0x2cba0d();});});}})[_0xf704('0x27')](function(){if(_0x4f95db){return _0x612689['download'](_0xc2edf7,_0x2524fa,function(_0x21483a){if(_0x21483a){console[_0xf704('0xca')](_0xf704('0xcb'),_0x21483a);}else{fs[_0xf704('0xcc')](_0xc2edf7);}});}else{return _0x612689[_0xf704('0x1b')](0xc8);}})[_0xf704('0x32')](handleError(_0x612689,null));}; \ No newline at end of file +var _0xdbdf=['Account.mandatoryDisposition','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','it.FaxInteractionId\x20=\x20i.id','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','show','includeAll','merge','options','find','body','update','params','destroy','describe','FaxMessage','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','spread','Tag','findAll','emit','faxInteractionTags:save','removeTags','download','unix','join','server','files','attachments','root','tmp','interaction-%s.zip','createdAt','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','status','json','count','offset','limit','apply','reject','save','then','error','stack','name','send','Users','map','split','forEach','Tags','push','TagIds','catch','index','FaxInteraction','rawAttributes','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','select','field','from','COUNT(*)','me.direction\x20=\x20\x27in\x27','u.id','ui.FaxInteractionId','left_join','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_messages','expr','advancedFilter','parse','value','startOf','day','utc','endOf','and','isArray','TagId','unreadMessages','length','tableAlias','\x20=\x20?','LIKE','ContactId','\x20LIKE\x20?','c.lastName','\x20>\x20?','\x20<\x20?','\x20IN\x20?','c.firstName','c.email','hasOwnProperty','filter','isNil','isEmpty','i.FaxAccountId\x20IN\x20?','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','group','i.id','Sequelize','SELECT','clone','COUNT(me.id)','read','`unreadMessages`\x20=\x200','having','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','fax_interaction_has_tags','tools_tags','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','`unreadMessages`\x20>\x200','toString','sequelize','a.key','Account.key','a.mandatoryDisposition'];(function(_0x35d5bf,_0x291d9e){var _0x503d2c=function(_0x4de991){while(--_0x4de991){_0x35d5bf['push'](_0x35d5bf['shift']());}};_0x503d2c(++_0x291d9e);}(_0xdbdf,0x1d6));var _0xfdbd=function(_0x220915,_0x49b671){_0x220915=_0x220915-0x0;var _0x3f2188=_0xdbdf[_0x220915];return _0x3f2188;};'use strict';var pdf=require(_0xfdbd('0x0'));var emlformat=require(_0xfdbd('0x1'));var rimraf=require(_0xfdbd('0x2'));var zipdir=require(_0xfdbd('0x3'));var jsonpatch=require(_0xfdbd('0x4'));var rp=require(_0xfdbd('0x5'));var moment=require(_0xfdbd('0x6'));var BPromise=require(_0xfdbd('0x7'));var Mustache=require(_0xfdbd('0x8'));var util=require(_0xfdbd('0x9'));var path=require('path');var sox=require(_0xfdbd('0xa'));var csv=require(_0xfdbd('0xb'));var ejs=require(_0xfdbd('0xc'));var fs=require('fs');var _=require(_0xfdbd('0xd'));var squel=require(_0xfdbd('0xe'));var crypto=require(_0xfdbd('0xf'));var jsforce=require(_0xfdbd('0x10'));var deskjs=require(_0xfdbd('0x11'));var toCsv=require(_0xfdbd('0xb'));var querystring=require(_0xfdbd('0x12'));var Papa=require(_0xfdbd('0x13'));var Redis=require(_0xfdbd('0x14'));var authService=require(_0xfdbd('0x15'));var qs=require(_0xfdbd('0x16'));var hardwareService=require(_0xfdbd('0x17'));var logger=require(_0xfdbd('0x18'))(_0xfdbd('0x19'));var utils=require(_0xfdbd('0x1a'));var config=require(_0xfdbd('0x1b'));var db=require(_0xfdbd('0x1c'))['db'];config[_0xfdbd('0x1d')]=_[_0xfdbd('0x1e')](config[_0xfdbd('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0xfdbd('0x1f'))(new Redis(config[_0xfdbd('0x1d')]));require(_0xfdbd('0x20'))[_0xfdbd('0x21')](socket);function respondWithStatusCode(_0x31972c,_0x55d996){_0x55d996=_0x55d996||0xcc;return function(_0x8d711c){if(_0x8d711c){return _0x31972c[_0xfdbd('0x22')](_0x55d996);}return _0x31972c['status'](_0x55d996)[_0xfdbd('0x23')]();};}function respondWithResult(_0x251da9,_0xf0629a){_0xf0629a=_0xf0629a||0xc8;return function(_0x4d9f23){if(_0x4d9f23){return _0x251da9[_0xfdbd('0x24')](_0xf0629a)[_0xfdbd('0x25')](_0x4d9f23);}};}function respondWithFilteredResult(_0x226adb,_0x1fe753){return function(_0x5f591d){if(_0x5f591d){var _0x1f1fc2=_0x5f591d[_0xfdbd('0x26')],_0x58cf8c=_0x1fe753[_0xfdbd('0x27')],_0x2e147a=_0x1fe753['offset']+_0x1fe753[_0xfdbd('0x28')],_0x2be1f9;if(_0x2e147a>=_0x1f1fc2){_0x2e147a=_0x1f1fc2;_0x2be1f9=0xc8;}else{_0x2be1f9=0xce;}_0x226adb[_0xfdbd('0x24')](_0x2be1f9);return _0x226adb['set']('Content-Range',_0x58cf8c+'-'+_0x2e147a+'/'+_0x1f1fc2)['json'](_0x5f591d);}return null;};}function patchUpdates(_0x577daf){return function(_0x25cc95){try{jsonpatch[_0xfdbd('0x29')](_0x25cc95,_0x577daf,!![]);}catch(_0x3f3658){return BPromise[_0xfdbd('0x2a')](_0x3f3658);}return _0x25cc95[_0xfdbd('0x2b')]();};}function saveUpdates(_0x14e442,_0x4eb60d){return function(_0x414a79){if(_0x414a79){return _0x414a79['update'](_0x14e442)[_0xfdbd('0x2c')](function(_0x26f95c){return _0x26f95c;});}return null;};}function removeEntity(_0xe73e64,_0x52d119){return function(_0x297d67){if(_0x297d67){return _0x297d67['destroy']()[_0xfdbd('0x2c')](function(){_0xe73e64[_0xfdbd('0x24')](0xcc)[_0xfdbd('0x23')]();});}};}function handleEntityNotFound(_0x4c62e7,_0x21a77c){return function(_0x39c6dc){if(!_0x39c6dc){_0x4c62e7[_0xfdbd('0x22')](0x194);}return _0x39c6dc;};}function handleError(_0x1fa7c9,_0x630aa3){_0x630aa3=_0x630aa3||0x1f4;return function(_0x51d4e6){logger[_0xfdbd('0x2d')](_0x51d4e6[_0xfdbd('0x2e')]);if(_0x51d4e6['name']){delete _0x51d4e6[_0xfdbd('0x2f')];}_0x1fa7c9[_0xfdbd('0x24')](_0x630aa3)[_0xfdbd('0x30')](_0x51d4e6);};}function getInteractionUsers(_0x5f22c2,_0x3acd97){return new BPromise(function(_0xeea625,_0x2a0910){try{if(_0x3acd97[_0x5f22c2['id']]){_0x5f22c2[_0xfdbd('0x31')]=_[_0xfdbd('0x32')](_0x3acd97[_0x5f22c2['id']],function(_0x5684cc){return{'id':_0x5684cc['id']};});}}catch(_0x181c36){_0x2a0910(_0x181c36);}_0xeea625(_0x5f22c2);});}function getInteractionTags(_0x1ef705,_0x276f06){return new BPromise(function(_0x1b794d,_0x9496a){try{if(_0x1ef705['TagIds']){_0x1ef705['Tags']=[];_0x1ef705['TagIds'][_0xfdbd('0x33')](',')[_0xfdbd('0x34')](function(_0x56e878){_0x1ef705[_0xfdbd('0x35')][_0xfdbd('0x36')](_0x276f06[_0x56e878]);});}delete _0x1ef705[_0xfdbd('0x37')];}catch(_0x334f2e){_0x9496a(_0x334f2e);}_0x1b794d(_0x1ef705);});}function updateFaxInteraction(_0x373a2a,_0x15c3e9,_0x584e73){return new BPromise(function(_0x41c1a0,_0x379c16){return getInteractionUsers(_0x373a2a,_0x584e73)['then'](function(_0x4b11a2){return getInteractionTags(_0x4b11a2,_0x15c3e9);})[_0xfdbd('0x2c')](function(_0x4d6fe6){_0x41c1a0(_0x4d6fe6);})[_0xfdbd('0x38')](function(_0x1d116e){_0x379c16(_0x1d116e);});});}exports[_0xfdbd('0x39')]=function(_0x4f2b5a,_0x40fd63){var _0x3b4cf6={},_0x2fe855={},_0x506b54={'count':0x0,'rows':[]};var _0x4afa95=db[_0xfdbd('0x3a')][_0xfdbd('0x3b')];_0x2fe855[_0xfdbd('0x3c')]=_[_0xfdbd('0x3d')](_0x4afa95);_0x2fe855[_0xfdbd('0x3e')]=_[_0xfdbd('0x3d')](_0x4f2b5a[_0xfdbd('0x3e')]);_0x2fe855[_0xfdbd('0x3f')]=_['intersection'](_0x2fe855[_0xfdbd('0x3c')],_0x2fe855[_0xfdbd('0x3e')]);_0x3b4cf6[_0xfdbd('0x40')]=_[_0xfdbd('0x41')](_0x2fe855[_0xfdbd('0x3c')],qs[_0xfdbd('0x42')](_0x4f2b5a['query']['fields']));_0x3b4cf6['attributes']=_0x3b4cf6[_0xfdbd('0x40')]['length']?_0x3b4cf6[_0xfdbd('0x40')]:_0x2fe855[_0xfdbd('0x3c')];if(!_0x4f2b5a[_0xfdbd('0x3e')]['hasOwnProperty'](_0xfdbd('0x43'))){_0x3b4cf6[_0xfdbd('0x28')]=qs[_0xfdbd('0x28')](_0x4f2b5a['query'][_0xfdbd('0x28')]);_0x3b4cf6[_0xfdbd('0x27')]=qs[_0xfdbd('0x27')](_0x4f2b5a['query'][_0xfdbd('0x27')]);}_0x3b4cf6[_0xfdbd('0x44')]=qs[_0xfdbd('0x45')](_0x4f2b5a[_0xfdbd('0x3e')]['sort']);_0x3b4cf6[_0xfdbd('0x46')]=qs[_0xfdbd('0x3f')](_[_0xfdbd('0x47')](_0x4f2b5a['query'],_0x2fe855[_0xfdbd('0x3f')]));var _0x1061c6=[];var _0x2afdd0=squel[_0xfdbd('0x48')]()[_0xfdbd('0x49')]('id')['field'](_0xfdbd('0x2f'))[_0xfdbd('0x49')]('color')[_0xfdbd('0x4a')]('tools_tags');var _0x4be0a9=squel['select']()['field'](_0xfdbd('0x4b'))[_0xfdbd('0x4a')]('fax_messages','me')['where']('me.FaxInteractionId\x20=\x20i.id')[_0xfdbd('0x46')](_0xfdbd('0x4c'))[_0xfdbd('0x46')]('me.read\x20=\x20false');var _0x34b79c=squel[_0xfdbd('0x48')]()[_0xfdbd('0x49')](_0xfdbd('0x4d'))['field'](_0xfdbd('0x4e'))[_0xfdbd('0x4a')]('user_has_fax_interactions','ui')[_0xfdbd('0x4f')]('users','u',_0xfdbd('0x50'));var _0x3e57ae=squel[_0xfdbd('0x48')]()['from'](_0xfdbd('0x51'),'i')[_0xfdbd('0x4f')]('cm_contacts','c',_0xfdbd('0x52'))['left_join'](_0xfdbd('0x53'),'o',_0xfdbd('0x54'))['left_join']('fax_accounts','a',_0xfdbd('0x55'))[_0xfdbd('0x4f')](_0xfdbd('0x56'),'me','me.FaxInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false');var _0x1f165e=squel[_0xfdbd('0x57')]();if(_0x4f2b5a[_0xfdbd('0x3e')][_0xfdbd('0x58')]){var _0x49b1f0=JSON[_0xfdbd('0x59')](_0x4f2b5a['query'][_0xfdbd('0x58')]);_[_0xfdbd('0x3d')](_0x49b1f0)[_0xfdbd('0x34')](function(_0x414813){var _0x4055b7=_0x49b1f0[_0x414813];if(_0x414813==='createdAt'){var _0x31a66f=moment(_0x4055b7[_0xfdbd('0x5a')]['dateStart'])[_0xfdbd('0x5b')](_0xfdbd('0x5c'))[_0xfdbd('0x5d')]()['format']();var _0x3f2356=moment(_0x3f2356)[_0xfdbd('0x5d')]()[_0xfdbd('0x5e')]('day')['format']();_0x1f165e[_0xfdbd('0x5f')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x31a66f,_0x3f2356);}else{if(_[_0xfdbd('0x60')](_0x4055b7['condition'])){_0x4055b7['condition']['forEach'](function(_0x1ea674){switch(_0x4055b7['condition']['value']){case'IS':if(_0x414813!==_0xfdbd('0x61')&&_0x414813!==_0xfdbd('0x62')){if(_[_0xfdbd('0x60')](_0x4055b7[_0xfdbd('0x5a')])&&_0x4055b7['value'][_0xfdbd('0x63')]>0x1){_0x1f165e[_0xfdbd('0x5f')](_0x4055b7['tableAlias']+'.'+_0x414813+'\x20IN\x20?',_0x4055b7[_0xfdbd('0x5a')]);}else{_0x1f165e['and'](_0x4055b7[_0xfdbd('0x64')]+'.'+_0x414813+_0xfdbd('0x65'),_0x4055b7[_0xfdbd('0x5a')][0x0]);}}break;case'=':_0x1f165e[_0xfdbd('0x5f')](_0x4055b7[_0xfdbd('0x64')]+'.'+_0x414813+_0xfdbd('0x65'),_0x4055b7[_0xfdbd('0x5a')]);break;case _0xfdbd('0x66'):if(_0x414813===_0xfdbd('0x67')){_0x1f165e[_0xfdbd('0x5f')]('c.firstName'+_0xfdbd('0x68'),'%'+_0x4055b7[_0xfdbd('0x5a')]+'%');_0x1f165e['or'](_0xfdbd('0x69')+_0xfdbd('0x68'),'%'+_0x4055b7[_0xfdbd('0x5a')]+'%');_0x1f165e['or']('c.email'+_0xfdbd('0x68'),'%'+_0x4055b7[_0xfdbd('0x5a')]+'%');}else{_0x1f165e['and'](_0x4055b7[_0xfdbd('0x64')]+'.'+_0x414813+_0xfdbd('0x68'),'%'+_0x4055b7[_0xfdbd('0x5a')]+'%');}break;case'>':_0x1f165e['and'](_0x4055b7[_0xfdbd('0x64')]+'.'+_0x414813+_0xfdbd('0x6a'),_0x4055b7['value']);break;case'<':_0x1f165e[_0xfdbd('0x5f')](_0x4055b7[_0xfdbd('0x64')]+'.'+_0x414813+_0xfdbd('0x6b'),_0x4055b7[_0xfdbd('0x5a')]);break;}});}else{switch(_0x4055b7['condition'][_0xfdbd('0x5a')]){case'IS':if(_0x414813!=='TagId'&&_0x414813!=='unreadMessages'){if(_[_0xfdbd('0x60')](_0x4055b7[_0xfdbd('0x5a')])&&_0x4055b7[_0xfdbd('0x5a')][_0xfdbd('0x63')]>0x1){_0x1f165e['and'](_0x4055b7[_0xfdbd('0x64')]+'.'+_0x414813+_0xfdbd('0x6c'),_0x4055b7['value']);}else{_0x1f165e[_0xfdbd('0x5f')](_0x4055b7[_0xfdbd('0x64')]+'.'+_0x414813+_0xfdbd('0x65'),_0x4055b7[_0xfdbd('0x5a')][0x0]);}}break;case'=':_0x1f165e['and'](_0x4055b7[_0xfdbd('0x64')]+'.'+_0x414813+_0xfdbd('0x65'),_0x4055b7['value']);break;case'LIKE':if(_0x414813===_0xfdbd('0x67')){_0x1f165e['and'](_0xfdbd('0x6d')+_0xfdbd('0x68'),'%'+_0x4055b7[_0xfdbd('0x5a')]+'%');_0x1f165e['or'](_0xfdbd('0x69')+'\x20LIKE\x20?','%'+_0x4055b7['value']+'%');_0x1f165e['or'](_0xfdbd('0x6e')+_0xfdbd('0x68'),'%'+_0x4055b7[_0xfdbd('0x5a')]+'%');}else{_0x1f165e[_0xfdbd('0x5f')](_0x4055b7[_0xfdbd('0x64')]+'.'+_0x414813+_0xfdbd('0x68'),'%'+_0x4055b7[_0xfdbd('0x5a')]+'%');}break;case'>':_0x1f165e['and'](_0x4055b7['tableAlias']+'.'+_0x414813+'\x20>\x20?',_0x4055b7[_0xfdbd('0x5a')]);break;case'<':_0x1f165e['and'](_0x4055b7[_0xfdbd('0x64')]+'.'+_0x414813+_0xfdbd('0x6b'),_0x4055b7[_0xfdbd('0x5a')]);break;}}}});}else{var _0x46bad1=_(Object[_0xfdbd('0x3d')](_0x4f2b5a[_0xfdbd('0x3e')]))[_0xfdbd('0x32')](function(_0x10535a){return _0x4afa95[_0xfdbd('0x6f')](_0x10535a)?_0x10535a:undefined;})[_0xfdbd('0x70')](function(_0x1885e9){return!_[_0xfdbd('0x71')](_0x1885e9);})['value']();if(!_[_0xfdbd('0x72')](_0x46bad1)){_0x46bad1['forEach'](function(_0xc039b7){if(_0xc039b7==='FaxAccountId'){_0x3e57ae[_0xfdbd('0x46')](_0xfdbd('0x73'),[]['concat'](_0x4f2b5a[_0xfdbd('0x3e')][_0xc039b7]));}else if(_0xc039b7==='createdAt'){var _0x34b2af=JSON['parse'](_0x4f2b5a['query'][_0xc039b7])[_0xfdbd('0x74')];var _0x55317d=JSON[_0xfdbd('0x59')](_0x4f2b5a[_0xfdbd('0x3e')][_0xc039b7])[_0xfdbd('0x75')];_0x3e57ae['where'](_0xfdbd('0x76'),_0x34b2af,_0x55317d);}else{if(_0x4f2b5a[_0xfdbd('0x3e')][_0xc039b7]===_0xfdbd('0x77')){_0x3e57ae[_0xfdbd('0x46')]('i.'+_0xc039b7+_0xfdbd('0x78'));}else{_0x3e57ae[_0xfdbd('0x46')]('i.'+_0xc039b7+_0xfdbd('0x65'),_0x4f2b5a[_0xfdbd('0x3e')][_0xc039b7]);}}});}if(_0x4f2b5a[_0xfdbd('0x3e')][_0xfdbd('0x70')]){var _0x52f9d7=_0x4f2b5a[_0xfdbd('0x3e')]['filter'][_0xfdbd('0x79')]('\x5c','\x5c\x5c')[_0xfdbd('0x79')]('\x27\x27',_0xfdbd('0x7a'));if(qs[_0xfdbd('0x7b')](_0x52f9d7)){_0x1f165e['or'](_0xfdbd('0x7c'),_0x52f9d7+'%')['or'](_0xfdbd('0x7d'),_0x52f9d7+'%');}_0x1f165e['or'](_0xfdbd('0x7e'),_0x52f9d7+'%');}}_0x3e57ae[_0xfdbd('0x46')](_0x1f165e);if(_0x3b4cf6[_0xfdbd('0x44')]){_0x3b4cf6[_0xfdbd('0x44')][_0xfdbd('0x34')](function(_0x1b0a6a){_0x3e57ae['order']('i.'+_0x1b0a6a[0x0],_0x1b0a6a[0x1]===_0xfdbd('0x7f')?![]:!![]);});}_0x3e57ae[_0xfdbd('0x80')](_0xfdbd('0x81'));var _0x45d7fc={'type':db[_0xfdbd('0x82')]['QueryTypes'][_0xfdbd('0x83')],'raw':!![]};var _0x5b7de3=_0x3e57ae[_0xfdbd('0x84')]()[_0xfdbd('0x49')]('COUNT(*)')[_0xfdbd('0x49')](_0xfdbd('0x85'),_0xfdbd('0x62'));if(!_0x4f2b5a[_0xfdbd('0x3e')]['advancedFilter']){if(_0x4f2b5a[_0xfdbd('0x3e')][_0xfdbd('0x86')]){if(_0x4f2b5a['query'][_0xfdbd('0x86')]==0x1){_0x5b7de3['having'](_0xfdbd('0x87'));_0x3e57ae['having']('`unreadMessages`\x20=\x200');}else{_0x5b7de3[_0xfdbd('0x88')]('`unreadMessages`\x20>\x200');_0x3e57ae[_0xfdbd('0x88')]('`unreadMessages`\x20>\x200');}}if(_0x4f2b5a[_0xfdbd('0x3e')][_0xfdbd('0x89')]){var _0x3a855a=_[_0xfdbd('0x60')](_0x4f2b5a['query'][_0xfdbd('0x89')])?_0x4f2b5a[_0xfdbd('0x3e')][_0xfdbd('0x89')]:new Array(_0x4f2b5a[_0xfdbd('0x3e')][_0xfdbd('0x89')]);var _0x4a2f51=squel[_0xfdbd('0x57')]();_0x3a855a['forEach'](function(_0x3f514f){_0x4a2f51['or'](_0xfdbd('0x8a'),'%,'+_0x3f514f+',%');});_0x3e57ae[_0xfdbd('0x88')](_0x4a2f51);_0x5b7de3[_0xfdbd('0x4f')](_0xfdbd('0x8b'),'it','it.FaxInteractionId\x20=\x20i.id');_0x5b7de3['left_join'](_0xfdbd('0x8c'),'t','t.id\x20=\x20it.TagId');_0x5b7de3[_0xfdbd('0x46')](_0xfdbd('0x8d'),_0x3a855a);}}else{var _0x49b1f0=JSON['parse'](_0x4f2b5a[_0xfdbd('0x3e')]['advancedFilter']);_['keys'](_0x49b1f0)[_0xfdbd('0x34')](function(_0x878f2a){var _0x41e9b3=_0x49b1f0[_0x878f2a];if(_0x878f2a===_0xfdbd('0x61')){var _0x2d8e86=_0x41e9b3[_0xfdbd('0x5a')];var _0x55fe77=squel[_0xfdbd('0x57')]();_0x2d8e86['forEach'](function(_0x5086ca){_0x55fe77['or'](_0xfdbd('0x8a'),'%,'+_0x5086ca+',%');});_0x3e57ae[_0xfdbd('0x88')](_0x55fe77);_0x5b7de3[_0xfdbd('0x4f')](_0xfdbd('0x8e'),'it',_0xfdbd('0x8f'));_0x5b7de3[_0xfdbd('0x4f')]('tools_tags','t',_0xfdbd('0x90'));_0x5b7de3[_0xfdbd('0x46')](_0xfdbd('0x8d'),_0x2d8e86);}else if(_0x878f2a===_0xfdbd('0x62')){if(_0x41e9b3['value']['length']===0x1){if(_0x41e9b3[_0xfdbd('0x5a')][0x0]===0x1){_0x5b7de3[_0xfdbd('0x88')]('`unreadMessages`\x20=\x200');_0x3e57ae['having']('`unreadMessages`\x20=\x200');}else{_0x5b7de3['having']('`unreadMessages`\x20>\x200');_0x3e57ae[_0xfdbd('0x88')](_0xfdbd('0x91'));}}}});}db['sequelize'][_0xfdbd('0x3e')](_0x5b7de3[_0xfdbd('0x92')](),_0x45d7fc)['then'](function(_0x2277bc){_0x506b54[_0xfdbd('0x26')]=_0x2277bc[_0xfdbd('0x63')];if(_0x506b54[_0xfdbd('0x26')]===0x0)return[];return db[_0xfdbd('0x93')][_0xfdbd('0x3e')](_0x2afdd0['toString'](),_0x45d7fc)[_0xfdbd('0x2c')](function(_0x268128){_0x1061c6=_['keyBy'](_0x268128,'id');_0x45d7fc=_['merge'](_0x45d7fc,{'model':db[_0xfdbd('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x3e57ae[_0xfdbd('0x49')]('COUNT(me.id)','unreadMessages');_0x3e57ae[_0xfdbd('0x49')](_0xfdbd('0x94'),_0xfdbd('0x95'));_0x3e57ae['field'](_0xfdbd('0x96'),_0xfdbd('0x97'));_0x3e57ae[_0xfdbd('0x49')]('i.*');_0x3e57ae['field']('c.firstName','Contact.firstName');_0x3e57ae[_0xfdbd('0x49')]('c.lastName',_0xfdbd('0x98'));_0x3e57ae[_0xfdbd('0x49')](_0xfdbd('0x6e'),_0xfdbd('0x99'));_0x3e57ae['field'](_0xfdbd('0x9a'),_0xfdbd('0x9b'));_0x3e57ae['field'](_0xfdbd('0x9c'),_0xfdbd('0x9d'));_0x3e57ae['field']('c.fax',_0xfdbd('0x9e'));_0x3e57ae[_0xfdbd('0x49')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xfdbd('0x37'));_0x3e57ae[_0xfdbd('0x4f')](_0xfdbd('0x8b'),'it',_0xfdbd('0x9f'));_0x3e57ae[_0xfdbd('0x4f')](_0xfdbd('0x8c'),'t',_0xfdbd('0x90'));_0x3e57ae['limit'](_0x3b4cf6[_0xfdbd('0x28')]);_0x3e57ae[_0xfdbd('0x27')](_0x3b4cf6[_0xfdbd('0x27')]);return db['sequelize']['query'](_0x3e57ae[_0xfdbd('0x92')](),_0x45d7fc);})['then'](function(_0x4d4ad7){_0x34b79c[_0xfdbd('0x46')](_0xfdbd('0xa0'),_['map'](_0x4d4ad7,'id'));return db['sequelize']['query'](_0x34b79c[_0xfdbd('0x92')](),_0x45d7fc)[_0xfdbd('0x2c')](function(_0x39d2ca){var _0x2c4e43=_['groupBy'](_0x39d2ca,_0xfdbd('0xa1'));var _0xf7e0cf=[];_0x4d4ad7[_0xfdbd('0x34')](function(_0xc77973){_0xf7e0cf[_0xfdbd('0x36')](updateFaxInteraction(_0xc77973,_0x1061c6,_0x2c4e43));});return BPromise[_0xfdbd('0xa2')](_0xf7e0cf);});});})[_0xfdbd('0x2c')](function(_0x1cbe82){_0x506b54['rows']=_0x1cbe82;return _0x506b54;})[_0xfdbd('0x2c')](respondWithFilteredResult(_0x40fd63,_0x3b4cf6))[_0xfdbd('0x38')](handleError(_0x40fd63,null));};exports[_0xfdbd('0xa3')]=function(_0x146f9e,_0x25b764){var _0x2cff09={'raw':![],'where':{'id':_0x146f9e['params']['id']}},_0x2c8000={};_0x2c8000['model']=_[_0xfdbd('0x3d')](db['FaxInteraction'][_0xfdbd('0x3b')]);_0x2c8000[_0xfdbd('0x3e')]=_['keys'](_0x146f9e['query']);_0x2c8000[_0xfdbd('0x3f')]=_[_0xfdbd('0x41')](_0x2c8000[_0xfdbd('0x3c')],_0x2c8000[_0xfdbd('0x3e')]);_0x2cff09[_0xfdbd('0x40')]=_['intersection'](_0x2c8000[_0xfdbd('0x3c')],qs[_0xfdbd('0x42')](_0x146f9e[_0xfdbd('0x3e')][_0xfdbd('0x42')]));_0x2cff09[_0xfdbd('0x40')]=_0x2cff09[_0xfdbd('0x40')][_0xfdbd('0x63')]?_0x2cff09[_0xfdbd('0x40')]:_0x2c8000['model'];if(_0x146f9e[_0xfdbd('0x3e')][_0xfdbd('0xa4')]){_0x2cff09['include']=[{'all':!![]}];}_0x2cff09=_[_0xfdbd('0xa5')]({},_0x2cff09,_0x146f9e[_0xfdbd('0xa6')]);return db[_0xfdbd('0x3a')][_0xfdbd('0xa7')](_0x2cff09)[_0xfdbd('0x2c')](handleEntityNotFound(_0x25b764,null))[_0xfdbd('0x2c')](respondWithResult(_0x25b764,null))[_0xfdbd('0x38')](handleError(_0x25b764,null));};exports['create']=function(_0x8f6836,_0x428b6b){return db[_0xfdbd('0x3a')]['create'](_0x8f6836[_0xfdbd('0xa8')],{})[_0xfdbd('0x2c')](respondWithResult(_0x428b6b,0xc9))[_0xfdbd('0x38')](handleError(_0x428b6b,null));};exports[_0xfdbd('0xa9')]=function(_0x51dbfd,_0x36ed25){if(_0x51dbfd[_0xfdbd('0xa8')]['id']){delete _0x51dbfd[_0xfdbd('0xa8')]['id'];}return db[_0xfdbd('0x3a')][_0xfdbd('0xa7')]({'where':{'id':_0x51dbfd[_0xfdbd('0xaa')]['id']}})['then'](handleEntityNotFound(_0x36ed25,null))[_0xfdbd('0x2c')](saveUpdates(_0x51dbfd[_0xfdbd('0xa8')],null))[_0xfdbd('0x2c')](respondWithResult(_0x36ed25,null))['catch'](handleError(_0x36ed25,null));};exports[_0xfdbd('0xab')]=function(_0x508c96,_0x242157){return db[_0xfdbd('0x3a')]['find']({'where':{'id':_0x508c96[_0xfdbd('0xaa')]['id']}})[_0xfdbd('0x2c')](handleEntityNotFound(_0x242157,null))[_0xfdbd('0x2c')](removeEntity(_0x242157,null))[_0xfdbd('0x38')](handleError(_0x242157,null));};exports['describe']=function(_0x3d8880,_0x129064){return db[_0xfdbd('0x3a')][_0xfdbd('0xac')]()[_0xfdbd('0x2c')](respondWithResult(_0x129064,null))[_0xfdbd('0x38')](handleError(_0x129064,null));};exports['addMessage']=function(_0x24dd8e,_0x31d206,_0x256292){return db[_0xfdbd('0xad')][_0xfdbd('0xa7')]({'where':{'id':_0x24dd8e['params']['id']}})[_0xfdbd('0x2c')](handleEntityNotFound(_0x31d206,null))[_0xfdbd('0x2c')](function(_0xed571d){if(_0xed571d){return _0xed571d[_0xfdbd('0xae')](_0x24dd8e[_0xfdbd('0xa8')][_0xfdbd('0xaf')],_[_0xfdbd('0xb0')](_0x24dd8e['body'],[_0xfdbd('0xaf'),'id'])||{});}})['then'](respondWithResult(_0x31d206,null))['catch'](handleError(_0x31d206,null));};exports[_0xfdbd('0xb1')]=function(_0x2b4369,_0x30f6d6,_0xac5c35){var _0x5ef051={'raw':![],'where':{}};var _0x219a57={};var _0x499f47={'count':0x0,'rows':[]};return db[_0xfdbd('0x3a')]['findOne']({'where':{'id':_0x2b4369[_0xfdbd('0xaa')]['id']}})[_0xfdbd('0x2c')](handleEntityNotFound(_0x30f6d6,null))[_0xfdbd('0x2c')](function(_0x1bdf72){if(_0x1bdf72){_0x219a57['model']=_['keys'](db[_0xfdbd('0xad')][_0xfdbd('0x3b')]);_0x219a57[_0xfdbd('0x3e')]=_[_0xfdbd('0x3d')](_0x2b4369[_0xfdbd('0x3e')]);_0x219a57[_0xfdbd('0x3f')]=_[_0xfdbd('0x41')](_0x219a57[_0xfdbd('0x3c')],_0x219a57[_0xfdbd('0x3e')]);_0x5ef051['attributes']=_[_0xfdbd('0x41')](_0x219a57['model'],qs[_0xfdbd('0x42')](_0x2b4369[_0xfdbd('0x3e')][_0xfdbd('0x42')]));_0x5ef051[_0xfdbd('0x40')]=_0x5ef051[_0xfdbd('0x40')][_0xfdbd('0x63')]?_0x5ef051[_0xfdbd('0x40')]:_0x219a57[_0xfdbd('0x3c')];if(!_0x2b4369[_0xfdbd('0x3e')][_0xfdbd('0x6f')](_0xfdbd('0x43'))){_0x5ef051[_0xfdbd('0x28')]=qs[_0xfdbd('0x28')](_0x2b4369[_0xfdbd('0x3e')][_0xfdbd('0x28')]);_0x5ef051['offset']=qs[_0xfdbd('0x27')](_0x2b4369[_0xfdbd('0x3e')][_0xfdbd('0x27')]);}_0x5ef051[_0xfdbd('0x44')]=qs[_0xfdbd('0x45')](_0x2b4369[_0xfdbd('0x3e')][_0xfdbd('0x45')]);_0x5ef051[_0xfdbd('0x46')]=qs['filters'](_[_0xfdbd('0x47')](_0x2b4369[_0xfdbd('0x3e')],_0x219a57['filters']));_0x5ef051[_0xfdbd('0x46')][_0xfdbd('0xa1')]=_0x1bdf72['id'];if(_0x2b4369[_0xfdbd('0x3e')][_0xfdbd('0x70')]){_0x5ef051['where']=_[_0xfdbd('0xa5')](_0x5ef051[_0xfdbd('0x46')],{'$or':_['map'](_0x5ef051[_0xfdbd('0x40')],function(_0x51093e){var _0x2d0af1={};_0x2d0af1[_0x51093e]={'$like':'%'+_0x2b4369[_0xfdbd('0x3e')][_0xfdbd('0x70')]+'%'};return _0x2d0af1;})});}if(_0x2b4369[_0xfdbd('0x3e')][_0xfdbd('0x74')]){var _0x25b2cf=_0x2b4369[_0xfdbd('0x3e')][_0xfdbd('0x74')][_0xfdbd('0x33')](',');var _0x4229fa={};_0x4229fa[_0x25b2cf[0x0]]={'$gte':moment(_0x25b2cf[0x1])['format'](_0xfdbd('0xb2'))};_0x5ef051[_0xfdbd('0x46')]=_[_0xfdbd('0xa5')](_0x5ef051[_0xfdbd('0x46')],_0x4229fa);}_0x5ef051=_[_0xfdbd('0xa5')]({},_0x5ef051,_0x2b4369[_0xfdbd('0xa6')]);return db[_0xfdbd('0xad')][_0xfdbd('0x26')]({'where':_0x5ef051[_0xfdbd('0x46')]})['then'](function(_0x5f03fa){_0x499f47[_0xfdbd('0x26')]=_0x5f03fa;if(_0x2b4369[_0xfdbd('0x3e')]['includeAll']){_0x5ef051[_0xfdbd('0xb3')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x5ef051);})[_0xfdbd('0x2c')](function(_0x54fb80){_0x499f47[_0xfdbd('0xb4')]=_0x54fb80;return _0x499f47;});}})[_0xfdbd('0x2c')](respondWithFilteredResult(_0x30f6d6,_0x5ef051))[_0xfdbd('0x38')](handleError(_0x30f6d6,null));};exports[_0xfdbd('0xb5')]=function(_0x41fb1f,_0x4c4c95,_0x134428){return db[_0xfdbd('0x3a')][_0xfdbd('0xa7')]({'where':{'id':_0x41fb1f[_0xfdbd('0xaa')]['id']}})['then'](handleEntityNotFound(_0x4c4c95,null))[_0xfdbd('0x2c')](function(_0x1f5afd){if(_0x1f5afd){return _0x1f5afd[_0xfdbd('0xb6')](_0x41fb1f[_0xfdbd('0xa8')][_0xfdbd('0xaf')],_['omit'](_0x41fb1f['body'],['ids','id'])||{})[_0xfdbd('0xb7')](function(){return db[_0xfdbd('0xb8')][_0xfdbd('0xb9')]({'attributes':['id','name','color'],'where':{'id':_0x41fb1f[_0xfdbd('0xa8')][_0xfdbd('0xaf')]}});})['then'](function(_0x1726d1){socket[_0xfdbd('0xba')](_0xfdbd('0xbb'),{'id':Number(_0x41fb1f['params']['id']),'tags':_0x1726d1||[]});return{'id':Number(_0x41fb1f[_0xfdbd('0xaa')]['id']),'tags':_0x1726d1||[]};});}})['then'](respondWithResult(_0x4c4c95,null))[_0xfdbd('0x38')](handleError(_0x4c4c95,null));};exports[_0xfdbd('0xbc')]=function(_0x2bd34f,_0x2b7f61,_0x5d63ce){return db[_0xfdbd('0x3a')][_0xfdbd('0xa7')]({'where':{'id':_0x2bd34f['params']['id']}})['then'](handleEntityNotFound(_0x2b7f61,null))[_0xfdbd('0x2c')](function(_0x1afb0d){if(_0x1afb0d){return _0x1afb0d[_0xfdbd('0xbc')](_0x2bd34f['query'][_0xfdbd('0xaf')]);}})[_0xfdbd('0x2c')](respondWithStatusCode(_0x2b7f61,null))['catch'](handleError(_0x2b7f61,null));};exports[_0xfdbd('0xbd')]=function(_0x49b972,_0x758bff){var _0x501945=moment()[_0xfdbd('0xbe')]()[_0xfdbd('0x92')]();var _0x5ebe0c=path[_0xfdbd('0xbf')](config['root'],_0xfdbd('0xc0'),_0xfdbd('0xc1'),_0xfdbd('0xc2'));var _0x1dd539=path[_0xfdbd('0xbf')](config[_0xfdbd('0xc3')],_0xfdbd('0xc0'),_0xfdbd('0xc1'),_0xfdbd('0xc4'));var _0x11049b=path[_0xfdbd('0xbf')](_0x1dd539,_0x501945);var _0x904d99=util['format'](_0xfdbd('0xc5'),_0x501945);var _0x30573d=path['join'](_0x1dd539,_0x904d99);var _0xc93eca=![];return db[_0xfdbd('0x3a')][_0xfdbd('0xa7')]({'where':{'id':_0x49b972[_0xfdbd('0xaa')]['id']}})[_0xfdbd('0x2c')](handleEntityNotFound(_0x758bff,null))[_0xfdbd('0x2c')](function(_0x5e8d20){if(_0x5e8d20){return _0x5e8d20['getMessages']({'attributes':['id','body',_0xfdbd('0xc6')],'include':[{'model':db[_0xfdbd('0xc7')],'as':_0xfdbd('0xc7')}]});}return[];})[_0xfdbd('0x2c')](function(_0xaeabe9){_0xc93eca=_0xaeabe9[_0xfdbd('0x63')];if(_0xaeabe9[_0xfdbd('0x63')]){fs['mkdirSync'](_0x11049b);for(var _0x25c79b=0x0;_0x25c79b<_0xaeabe9[_0xfdbd('0x63')];_0x25c79b++){var _0xfc1e72=_0xaeabe9[_0x25c79b];var _0x13f2b7=_0xfc1e72[_0xfdbd('0xc7')];if(_0x13f2b7){var _0x193a15=path[_0xfdbd('0xbf')](_0x5ebe0c,_0x13f2b7[_0xfdbd('0xc8')]);if(fs[_0xfdbd('0xc9')](_0x193a15)){fs[_0xfdbd('0xca')](_0x193a15)[_0xfdbd('0xcb')](fs[_0xfdbd('0xcc')](path[_0xfdbd('0xbf')](_0x11049b,_0x13f2b7[_0xfdbd('0xc8')])));}}}}})['then'](function(){if(_0xc93eca){return new BPromise(function(_0x3d33f7,_0x2a5e47){zipdir(_0x11049b,{'saveTo':_0x30573d},function(_0x2c776b,_0x2b694d){if(_0x2c776b)return _0x2a5e47(_0x2c776b);return _0x3d33f7(_0x2b694d);});});}})[_0xfdbd('0x2c')](function(){if(_0xc93eca){return new BPromise(function(_0x4ed20d,_0x5b162b){rimraf(_0x11049b,function(_0x10c7d8){if(_0x10c7d8)_0x5b162b(_0x10c7d8);return _0x4ed20d();});});}})[_0xfdbd('0x2c')](function(){if(_0xc93eca){return _0x758bff['download'](_0x30573d,_0x904d99,function(_0x726fd9){if(_0x726fd9){console[_0xfdbd('0xcd')]('err',_0x726fd9);}else{fs[_0xfdbd('0xce')](_0x30573d);}});}else{return _0x758bff['sendStatus'](0xc8);}})[_0xfdbd('0x38')](handleError(_0x758bff,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index d24fd92..3230c9e 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(_0xdbebc0,_0x16ba1e){var _0x3efae5=function(_0xf6ce71){while(--_0xf6ce71){_0xdbebc0['push'](_0xdbebc0['shift']());}};_0x3efae5(++_0x16ba1e);}(_0xadb5,0xad));var _0x5adb=function(_0x353cab,_0x49489c){_0x353cab=_0x353cab-0x0;var _0x5306db=_0xadb5[_0x353cab];return _0x5306db;};'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 _0x326f=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','unreadMessages','length','emit','hasOwnProperty','exports','events'];(function(_0x252763,_0x563d6a){var _0x3322ae=function(_0x563290){while(--_0x563290){_0x252763['push'](_0x252763['shift']());}};_0x3322ae(++_0x563d6a);}(_0x326f,0xd1));var _0xf326=function(_0x538248,_0x4c4521){_0x538248=_0x538248-0x0;var _0x49cee6=_0x326f[_0x538248];return _0x49cee6;};'use strict';var EventEmitter=require(_0xf326('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0xf326('0x1'))['db'][_0xf326('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf326('0x3')](0x0);var events={'afterCreate':_0xf326('0x4'),'afterUpdate':_0xf326('0x5'),'afterDestroy':_0xf326('0x6')};function emitEvent(_0x9445c6){return function(_0xf1c243,_0x1b5a56,_0x3ace29){_0xf1c243['getUsers']({'attributes':['id'],'raw':!![]})[_0xf326('0x7')](function(_0x3851eb){_0xf1c243[_0xf326('0x8')](_0xf326('0x9'),_0x3851eb['map'](function(_0x4c206c){return{'id':_0x4c206c['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0xf1c243['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf326('0x7')](function(_0x1fc80e){_0xf1c243[_0xf326('0x8')](_0xf326('0xa'),_0x1fc80e[_0xf326('0xb')]);FaxInteractionEvents['emit'](_0x9445c6+':'+_0xf1c243['id'],_0xf1c243);FaxInteractionEvents[_0xf326('0xc')](_0x9445c6,_0xf1c243);_0x3ace29(null);})['catch'](_0x3ace29(null));};}for(var e in events){if(events[_0xf326('0xd')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xf326('0xe')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index a253ef7..42f0f9d 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 _0x2f49=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closed'];(function(_0x218e40,_0x517fad){var _0x52cdb7=function(_0x48d695){while(--_0x48d695){_0x218e40['push'](_0x218e40['shift']());}};_0x52cdb7(++_0x517fad);}(_0x2f49,0x1b5));var _0x92f4=function(_0x529733,_0x3cdf86){_0x529733=_0x529733-0x0;var _0x596b92=_0x2f49[_0x529733];return _0x596b92;};'use strict';var _=require('lodash');var util=require(_0x92f4('0x0'));var logger=require(_0x92f4('0x1'))(_0x92f4('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(_0x92f4('0x3'));var config=require(_0x92f4('0x4'));var attributes=require(_0x92f4('0x5'));module['exports']=function(_0x3efb88,_0xa39b9b){return _0x3efb88[_0x92f4('0x6')](_0x92f4('0x7'),attributes,{'tableName':_0x92f4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1d96f0,_0x3ff069,_0x9ff1ba){if(_0x1d96f0[_0x92f4('0x9')](_0x92f4('0xa'))){_0x1d96f0[_0x92f4('0xb')]=moment()[_0x92f4('0xc')](_0x92f4('0xd'));}_0x9ff1ba(null,_0x1d96f0);}}});}; \ No newline at end of file +var _0xbf89=['changed','closed','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','FaxInteraction','fax_interactions'];(function(_0x2aa795,_0x228ccb){var _0x6041b9=function(_0x286955){while(--_0x286955){_0x2aa795['push'](_0x2aa795['shift']());}};_0x6041b9(++_0x228ccb);}(_0xbf89,0x147));var _0x9bf8=function(_0x249565,_0x2a026a){_0x249565=_0x249565-0x0;var _0x43dee8=_0xbf89[_0x249565];return _0x43dee8;};'use strict';var _=require(_0x9bf8('0x0'));var util=require(_0x9bf8('0x1'));var logger=require(_0x9bf8('0x2'))(_0x9bf8('0x3'));var moment=require(_0x9bf8('0x4'));var BPromise=require(_0x9bf8('0x5'));var rp=require(_0x9bf8('0x6'));var fs=require('fs');var path=require(_0x9bf8('0x7'));var rimraf=require(_0x9bf8('0x8'));var config=require(_0x9bf8('0x9'));var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x5ab833,_0x567954){return _0x5ab833[_0x9bf8('0xa')](_0x9bf8('0xb'),attributes,{'tableName':_0x9bf8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e42f5,_0x9803f8,_0x308d6a){if(_0x3e42f5[_0x9bf8('0xd')](_0x9bf8('0xe'))){_0x3e42f5[_0x9bf8('0xf')]=moment()[_0x9bf8('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x308d6a(null,_0x3e42f5);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 94ba483..348ae23 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 _0x7425=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FaxInteraction','update','options','where','attributes','limit','UpdateFaxInteraction','catch','AddTagsToFaxInteraction','find','body','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x10763d,_0xa038e4){var _0x327839=function(_0x1fb4ae){while(--_0x1fb4ae){_0x10763d['push'](_0x10763d['shift']());}};_0x327839(++_0xa038e4);}(_0x7425,0x17e));var _0x5742=function(_0x4bffd3,_0x108f5c){_0x4bffd3=_0x4bffd3-0x0;var _0x582e10=_0x7425[_0x4bffd3];return _0x582e10;};'use strict';var _=require(_0x5742('0x0'));var util=require('util');var moment=require(_0x5742('0x1'));var BPromise=require(_0x5742('0x2'));var rs=require(_0x5742('0x3'));var fs=require('fs');var Redis=require(_0x5742('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5742('0x5'));var logger=require(_0x5742('0x6'))(_0x5742('0x7'));var config=require('../../config/environment');var jayson=require(_0x5742('0x8'));var client=jayson[_0x5742('0x9')][_0x5742('0xa')]({'port':0x232a});config[_0x5742('0xb')]=_[_0x5742('0xc')](config[_0x5742('0xb')],{'host':_0x5742('0xd'),'port':0x18eb});var socket=require(_0x5742('0xe'))(new Redis(config[_0x5742('0xb')]));require(_0x5742('0xf'))[_0x5742('0x10')](socket);function respondWithRpcPromise(_0x117708,_0x5569f9,_0x5c300e){return new BPromise(function(_0x584e8d,_0x26e08f){return client[_0x5742('0x11')](_0x117708,_0x5c300e)[_0x5742('0x12')](function(_0x4445e9){logger[_0x5742('0x13')](_0x5742('0x14'),_0x5569f9,_0x5742('0x15'));logger[_0x5742('0x16')](_0x5742('0x17'),_0x5569f9,_0x5742('0x15'),JSON[_0x5742('0x18')](_0x4445e9));if(_0x4445e9[_0x5742('0x19')]){if(_0x4445e9['error'][_0x5742('0x1a')]===0x1f4){logger[_0x5742('0x19')](_0x5742('0x14'),_0x5569f9,_0x4445e9[_0x5742('0x19')][_0x5742('0x1b')]);return _0x26e08f(_0x4445e9[_0x5742('0x19')][_0x5742('0x1b')]);}logger[_0x5742('0x19')](_0x5742('0x14'),_0x5569f9,_0x4445e9[_0x5742('0x19')][_0x5742('0x1b')]);return _0x584e8d(_0x4445e9[_0x5742('0x19')]['message']);}else{logger[_0x5742('0x13')](_0x5742('0x14'),_0x5569f9,_0x5742('0x15'));_0x584e8d(_0x4445e9[_0x5742('0x1c')][_0x5742('0x1b')]);}})['catch'](function(_0x2f4504){logger[_0x5742('0x19')]('FaxInteraction,\x20%s,\x20%s',_0x5569f9,_0x2f4504);_0x26e08f(_0x2f4504);});});}exports['UpdateFaxInteraction']=function(_0x37f859){var _0x1cd8f8=this;return new Promise(function(_0x5206ed,_0x5bab00){return db[_0x5742('0x1d')][_0x5742('0x1e')](_0x37f859['body'],{'raw':_0x37f859[_0x5742('0x1f')]?_0x37f859[_0x5742('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37f859['options']?_0x37f859['options'][_0x5742('0x20')]||null:null,'attributes':_0x37f859['options']?_0x37f859[_0x5742('0x1f')][_0x5742('0x21')]||null:null,'limit':_0x37f859['options']?_0x37f859[_0x5742('0x1f')][_0x5742('0x22')]||null:null})[_0x5742('0x12')](function(_0x27e505){logger[_0x5742('0x13')](_0x5742('0x23'),_0x37f859);logger[_0x5742('0x16')](_0x5742('0x23'),_0x37f859,JSON[_0x5742('0x18')](_0x27e505));_0x5206ed(_0x27e505);})[_0x5742('0x24')](function(_0x451c1a){logger[_0x5742('0x19')](_0x5742('0x23'),_0x451c1a[_0x5742('0x1b')],_0x37f859);_0x5bab00(_0x1cd8f8[_0x5742('0x19')](0x1f4,_0x451c1a[_0x5742('0x1b')]));});});};exports[_0x5742('0x25')]=function(_0x2a6690){return new Promise(function(_0x146fae,_0x1cabb1){return db['FaxInteraction'][_0x5742('0x26')]({'where':_0x2a6690[_0x5742('0x1f')]?_0x2a6690[_0x5742('0x1f')][_0x5742('0x20')]||null:null})[_0x5742('0x12')](function(_0x3d9999){if(_0x3d9999){return _0x3d9999['addTags'](_0x2a6690[_0x5742('0x27')][_0x5742('0x28')],_['omit'](_0x2a6690[_0x5742('0x27')],[_0x5742('0x28'),'id'])||{});}})[_0x5742('0x29')](function(_0x1f599c){logger[_0x5742('0x13')](_0x5742('0x2a'),_0x2a6690);logger[_0x5742('0x16')](_0x5742('0x2a'),_0x2a6690,JSON[_0x5742('0x18')](_0x1f599c));_0x146fae(_0x1f599c);})['catch'](function(_0x5106d8){logger[_0x5742('0x19')]('AddTags',_0x5106d8[_0x5742('0x1b')],_0x2a6690);_0x1cabb1(_this[_0x5742('0x19')](0x1f4,_0x5106d8[_0x5742('0x1b')]));});});}; \ No newline at end of file +var _0x2505=['options','raw','attributes','UpdateFaxInteraction','find','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','result','update','body'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x2505,0x1ea));var _0x5250=function(_0x3b024e,_0x48e575){_0x3b024e=_0x3b024e-0x0;var _0x48803e=_0x2505[_0x3b024e];return _0x48803e;};'use strict';var _=require('lodash');var util=require(_0x5250('0x0'));var moment=require(_0x5250('0x1'));var BPromise=require(_0x5250('0x2'));var rs=require(_0x5250('0x3'));var fs=require('fs');var Redis=require(_0x5250('0x4'));var db=require(_0x5250('0x5'))['db'];var utils=require(_0x5250('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5250('0x7')][_0x5250('0x8')]({'port':0x232a});config[_0x5250('0x9')]=_[_0x5250('0xa')](config[_0x5250('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x5250('0xb'))(new Redis(config[_0x5250('0x9')]));require(_0x5250('0xc'))[_0x5250('0xd')](socket);function respondWithRpcPromise(_0x2b936e,_0x4550db,_0x256d11){return new BPromise(function(_0xe9031c,_0x547e9d){return client[_0x5250('0xe')](_0x2b936e,_0x256d11)[_0x5250('0xf')](function(_0x53a77b){logger[_0x5250('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x4550db,_0x5250('0x11'));logger[_0x5250('0x12')](_0x5250('0x13'),_0x4550db,'request\x20sent',JSON[_0x5250('0x14')](_0x53a77b));if(_0x53a77b[_0x5250('0x15')]){if(_0x53a77b[_0x5250('0x15')][_0x5250('0x16')]===0x1f4){logger['error'](_0x5250('0x17'),_0x4550db,_0x53a77b[_0x5250('0x15')][_0x5250('0x18')]);return _0x547e9d(_0x53a77b[_0x5250('0x15')]['message']);}logger[_0x5250('0x15')](_0x5250('0x17'),_0x4550db,_0x53a77b[_0x5250('0x15')][_0x5250('0x18')]);return _0xe9031c(_0x53a77b[_0x5250('0x15')][_0x5250('0x18')]);}else{logger['info'](_0x5250('0x17'),_0x4550db,'request\x20sent');_0xe9031c(_0x53a77b[_0x5250('0x19')][_0x5250('0x18')]);}})['catch'](function(_0x5406ff){logger[_0x5250('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x4550db,_0x5406ff);_0x547e9d(_0x5406ff);});});}exports['UpdateFaxInteraction']=function(_0x1aef53){var _0xfd22b9=this;return new Promise(function(_0x500c12,_0x4c7297){return db['FaxInteraction'][_0x5250('0x1a')](_0x1aef53[_0x5250('0x1b')],{'raw':_0x1aef53[_0x5250('0x1c')]?_0x1aef53[_0x5250('0x1c')][_0x5250('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1aef53[_0x5250('0x1c')]?_0x1aef53[_0x5250('0x1c')]['where']||null:null,'attributes':_0x1aef53[_0x5250('0x1c')]?_0x1aef53[_0x5250('0x1c')][_0x5250('0x1e')]||null:null,'limit':_0x1aef53[_0x5250('0x1c')]?_0x1aef53['options']['limit']||null:null})[_0x5250('0xf')](function(_0x35c58e){logger[_0x5250('0x10')]('UpdateFaxInteraction',_0x1aef53);logger[_0x5250('0x12')](_0x5250('0x1f'),_0x1aef53,JSON[_0x5250('0x14')](_0x35c58e));_0x500c12(_0x35c58e);})['catch'](function(_0x330230){logger['error'](_0x5250('0x1f'),_0x330230[_0x5250('0x18')],_0x1aef53);_0x4c7297(_0xfd22b9[_0x5250('0x15')](0x1f4,_0x330230[_0x5250('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x4e34f3){return new Promise(function(_0x58725b,_0x3804b0){return db['FaxInteraction'][_0x5250('0x20')]({'where':_0x4e34f3[_0x5250('0x1c')]?_0x4e34f3[_0x5250('0x1c')]['where']||null:null})[_0x5250('0xf')](function(_0x530698){if(_0x530698){return _0x530698['addTags'](_0x4e34f3['body'][_0x5250('0x21')],_[_0x5250('0x22')](_0x4e34f3[_0x5250('0x1b')],[_0x5250('0x21'),'id'])||{});}})[_0x5250('0x23')](function(_0x343180){logger[_0x5250('0x10')](_0x5250('0x24'),_0x4e34f3);logger['debug']('AddTags',_0x4e34f3,JSON['stringify'](_0x343180));_0x58725b(_0x343180);})['catch'](function(_0x360c2c){logger[_0x5250('0x15')]('AddTags',_0x360c2c['message'],_0x4e34f3);_0x3804b0(_this[_0x5250('0x15')](0x1f4,_0x360c2c[_0x5250('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 3b62427..9478540 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 _0x00e2=['./faxInteraction.events','remove','update','removeListener','length','faxInteraction:'];(function(_0x4e0a96,_0x531ed7){var _0x255076=function(_0x2b8ba8){while(--_0x2b8ba8){_0x4e0a96['push'](_0x4e0a96['shift']());}};_0x255076(++_0x531ed7);}(_0x00e2,0x192));var _0x200e=function(_0x53f0db,_0x35c67c){_0x53f0db=_0x53f0db-0x0;var _0xae0a5c=_0x00e2[_0x53f0db];return _0xae0a5c;};'use strict';var FaxInteractionEvents=require(_0x200e('0x0'));var events=['save',_0x200e('0x1'),_0x200e('0x2')];function createListener(_0x37f1b5,_0x560043){return function(_0x1f9b26){_0x560043['emit'](_0x37f1b5,_0x1f9b26);};}function removeListener(_0x1b2257,_0x35973e){return function(){FaxInteractionEvents[_0x200e('0x3')](_0x1b2257,_0x35973e);};}exports['register']=function(_0x84608c){for(var _0x2aab8e=0x0,_0x409995=events[_0x200e('0x4')];_0x2aab8e<_0x409995;_0x2aab8e++){var _0x4b0531=events[_0x2aab8e];var _0x53b53c=createListener(_0x200e('0x5')+_0x4b0531,_0x84608c);FaxInteractionEvents['on'](_0x4b0531,_0x53b53c);}}; \ No newline at end of file +var _0x86d0=['register','faxInteraction:','./faxInteraction.events','remove','update','emit','removeListener'];(function(_0x2d4480,_0x425535){var _0xbe8d59=function(_0x2ea893){while(--_0x2ea893){_0x2d4480['push'](_0x2d4480['shift']());}};_0xbe8d59(++_0x425535);}(_0x86d0,0xbf));var _0x086d=function(_0x579cce,_0x31b8d4){_0x579cce=_0x579cce-0x0;var _0x2ea60a=_0x86d0[_0x579cce];return _0x2ea60a;};'use strict';var FaxInteractionEvents=require(_0x086d('0x0'));var events=['save',_0x086d('0x1'),_0x086d('0x2')];function createListener(_0x2d094f,_0x1a31c3){return function(_0x301507){_0x1a31c3[_0x086d('0x3')](_0x2d094f,_0x301507);};}function removeListener(_0x364d46,_0x1857cd){return function(){FaxInteractionEvents[_0x086d('0x4')](_0x364d46,_0x1857cd);};}exports[_0x086d('0x5')]=function(_0x146b71){for(var _0x78d966=0x0,_0xb9eb4f=events['length'];_0x78d966<_0xb9eb4f;_0x78d966++){var _0x414af9=events[_0x78d966];var _0x1fcb86=createListener(_0x086d('0x6')+_0x414af9,_0x146b71);FaxInteractionEvents['on'](_0x414af9,_0x1fcb86);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 1cf8e63..40ba1d3 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 _0x5a1f=['index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','addTags','put','fax','faxinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x4112f5,_0x304bfe){var _0x44b7e6=function(_0x4946d6){while(--_0x4946d6){_0x4112f5['push'](_0x4112f5['shift']());}};_0x44b7e6(++_0x304bfe);}(_0x5a1f,0x19c));var _0xf5a1=function(_0x1c6871,_0x1c920a){_0x1c6871=_0x1c6871-0x0;var _0x1af668=_0x5a1f[_0x1c6871];return _0x1af668;};'use strict';var multer=require(_0xf5a1('0x0'));var util=require(_0xf5a1('0x1'));var path=require(_0xf5a1('0x2'));var timeout=require(_0xf5a1('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xf5a1('0x4'));var interaction=require(_0xf5a1('0x5'));var config=require(_0xf5a1('0x6'));var controller=require('./faxInteraction.controller');router['get']('/',auth[_0xf5a1('0x7')](),controller[_0xf5a1('0x8')]);router[_0xf5a1('0x9')](_0xf5a1('0xa'),auth[_0xf5a1('0x7')](),controller[_0xf5a1('0xb')]);router[_0xf5a1('0x9')](_0xf5a1('0xc'),auth[_0xf5a1('0x7')](),controller[_0xf5a1('0xd')]);router[_0xf5a1('0x9')](_0xf5a1('0xe'),auth[_0xf5a1('0x7')](),controller[_0xf5a1('0xf')]);router['get'](_0xf5a1('0x10'),auth[_0xf5a1('0x7')](),controller['download']);router[_0xf5a1('0x11')]('/',auth[_0xf5a1('0x7')](),controller[_0xf5a1('0x12')]);router[_0xf5a1('0x11')](_0xf5a1('0xe'),auth[_0xf5a1('0x7')](),controller[_0xf5a1('0x13')]);router[_0xf5a1('0x11')](_0xf5a1('0x14'),auth[_0xf5a1('0x7')](),interaction[_0xf5a1('0x15')]('fax','faxinteraction:addtags'),controller[_0xf5a1('0x16')]);router[_0xf5a1('0x17')](_0xf5a1('0xc'),auth[_0xf5a1('0x7')](),interaction[_0xf5a1('0x15')](_0xf5a1('0x18'),'faxinteraction:update'),controller['update']);router['delete']('/:id',auth[_0xf5a1('0x7')](),interaction['tracked'](_0xf5a1('0x18'),_0xf5a1('0x19')),controller[_0xf5a1('0x1a')]);router[_0xf5a1('0x1b')](_0xf5a1('0x14'),auth[_0xf5a1('0x7')](),controller[_0xf5a1('0x1c')]);module[_0xf5a1('0x1d')]=router; \ No newline at end of file +var _0xa049=['isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','/:id/tags','tracked','fax','addTags','put','/:id','faxinteraction:update','delete','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxInteraction.controller','get'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xa049,0x136));var _0x9a04=function(_0x52b24f,_0xca062d){_0x52b24f=_0x52b24f-0x0;var _0x46ea6b=_0xa049[_0x52b24f];return _0x46ea6b;};'use strict';var multer=require('multer');var util=require(_0x9a04('0x0'));var path=require(_0x9a04('0x1'));var timeout=require(_0x9a04('0x2'));var express=require(_0x9a04('0x3'));var router=express[_0x9a04('0x4')]();var auth=require(_0x9a04('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9a04('0x6'));var controller=require(_0x9a04('0x7'));router[_0x9a04('0x8')]('/',auth[_0x9a04('0x9')](),controller[_0x9a04('0xa')]);router[_0x9a04('0x8')](_0x9a04('0xb'),auth[_0x9a04('0x9')](),controller[_0x9a04('0xc')]);router[_0x9a04('0x8')]('/:id',auth[_0x9a04('0x9')](),controller[_0x9a04('0xd')]);router[_0x9a04('0x8')](_0x9a04('0xe'),auth[_0x9a04('0x9')](),controller[_0x9a04('0xf')]);router[_0x9a04('0x8')](_0x9a04('0x10'),auth[_0x9a04('0x9')](),controller[_0x9a04('0x11')]);router[_0x9a04('0x12')]('/',auth[_0x9a04('0x9')](),controller['create']);router[_0x9a04('0x12')](_0x9a04('0xe'),auth[_0x9a04('0x9')](),controller['addMessage']);router[_0x9a04('0x12')](_0x9a04('0x13'),auth[_0x9a04('0x9')](),interaction[_0x9a04('0x14')](_0x9a04('0x15'),'faxinteraction:addtags'),controller[_0x9a04('0x16')]);router[_0x9a04('0x17')](_0x9a04('0x18'),auth[_0x9a04('0x9')](),interaction[_0x9a04('0x14')]('fax',_0x9a04('0x19')),controller['update']);router[_0x9a04('0x1a')]('/:id',auth[_0x9a04('0x9')](),interaction['tracked'](_0x9a04('0x15'),'faxinteraction:destroy'),controller['destroy']);router[_0x9a04('0x1a')](_0x9a04('0x13'),auth[_0x9a04('0x9')](),controller[_0x9a04('0x1b')]);module[_0x9a04('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index fc1e177..3270f36 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 _0x93cf=['out','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0x93cf,0x1b2));var _0xf93c=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x93cf[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0xf93c('0x0'));module['exports']={'body':{'type':Sequelize[_0xf93c('0x1')](_0xf93c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xf93c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf93c('0x4')),'defaultValue':_0xf93c('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xf93c('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xf93c('0x5')]}}; \ No newline at end of file +var _0x0f83=['out','TEXT','DATE','medium','ENUM'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x0f83,0xcb));var _0x30f8=function(_0x4cb441,_0x4fe8f2){_0x4cb441=_0x4cb441-0x0;var _0x1cba94=_0x0f83[_0x4cb441];return _0x1cba94;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x30f8('0x0')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x30f8('0x1')]('in',_0x30f8('0x2')),'defaultValue':_0x30f8('0x2'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x30f8('0x3')],'defaultValue':null},'readAt':{'type':Sequelize[_0x30f8('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 58c855e..ca015a0 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 _0x0919=['sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','destroy','stack','name','send','FaxMessage','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','map','key','field','merge','include','findAll','rows','show','params','includeAll','options','find','update','body','describe','fax-interactions','accept','fax','read','readAt','format','UserId','Contact','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','EventManager','acceptmessage','agent','role','RejectMessage','channel','event','rejectmessage','create','findOne','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','attachments','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./faxMessage.socket','register','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','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch'];(function(_0x3f993e,_0x2d5757){var _0x39c135=function(_0x39e00b){while(--_0x39e00b){_0x3f993e['push'](_0x3f993e['shift']());}};_0x39c135(++_0x2d5757);}(_0x0919,0x1f1));var _0x9091=function(_0xb22e94,_0xc843c6){_0xb22e94=_0xb22e94-0x0;var _0xcaada6=_0x0919[_0xb22e94];return _0xcaada6;};'use strict';var pdf=require(_0x9091('0x0'));var emlformat=require(_0x9091('0x1'));var rimraf=require(_0x9091('0x2'));var zipdir=require(_0x9091('0x3'));var jsonpatch=require(_0x9091('0x4'));var rp=require(_0x9091('0x5'));var moment=require('moment');var BPromise=require(_0x9091('0x6'));var Mustache=require(_0x9091('0x7'));var util=require(_0x9091('0x8'));var path=require('path');var sox=require(_0x9091('0x9'));var csv=require(_0x9091('0xa'));var ejs=require(_0x9091('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9091('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9091('0xd'));var toCsv=require(_0x9091('0xa'));var querystring=require(_0x9091('0xe'));var Papa=require(_0x9091('0xf'));var Redis=require('ioredis');var authService=require(_0x9091('0x10'));var qs=require(_0x9091('0x11'));var hardwareService=require(_0x9091('0x12'));var logger=require(_0x9091('0x13'))(_0x9091('0x14'));var utils=require(_0x9091('0x15'));var config=require(_0x9091('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x9091('0x17')],{'host':_0x9091('0x18'),'port':0x18eb});var socket=require(_0x9091('0x19'))(new Redis(config['redis']));require(_0x9091('0x1a'))[_0x9091('0x1b')](socket);var jayson=require(_0x9091('0x1c'));var client=jayson[_0x9091('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x9091('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x5f2c8d,_0x58b113,_0x488335){if(_0x488335){var _0x66fd66=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x66fd66[_0x9091('0x1e')](_0x58b113)){return _0x5f2c8d;}else{throw new Error(_0x9091('0x1f'));}}else{return _0x5f2c8d;}}function respondWithRpcPromise(_0x2929ac,_0x46f895,_0x403b9e,_0x13011d){return new BPromise(function(_0x192c9c,_0x4dc996){var _0x41a5ec=_0x13011d||client;return _0x41a5ec[_0x9091('0x20')](_0x2929ac,_0x403b9e)[_0x9091('0x21')](function(_0x3f5578){logger[_0x9091('0x22')](_0x9091('0x23'),_0x46f895,_0x9091('0x24'));logger[_0x9091('0x25')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x46f895,_0x9091('0x24'),JSON[_0x9091('0x26')](_0x3f5578));if(_0x3f5578['error']){if(_0x3f5578['error'][_0x9091('0x27')]===0x1f4){logger[_0x9091('0x28')](_0x9091('0x23'),_0x46f895,_0x3f5578[_0x9091('0x28')][_0x9091('0x29')]);return _0x4dc996(_0x3f5578[_0x9091('0x28')]['message']);}logger[_0x9091('0x28')](_0x9091('0x23'),_0x46f895,_0x3f5578[_0x9091('0x28')][_0x9091('0x29')]);return _0x192c9c(_0x3f5578['error']['message']);}else{logger[_0x9091('0x22')](_0x9091('0x23'),_0x46f895,'request\x20sent');_0x192c9c(_0x3f5578['result']['message']);}})[_0x9091('0x2a')](function(_0x2d9de3){logger[_0x9091('0x28')](_0x9091('0x23'),_0x46f895,_0x2d9de3);_0x4dc996(_0x2d9de3);});});}function respondWithStatusCode(_0x3de9c9,_0x316c41){_0x316c41=_0x316c41||0xcc;return function(_0x1041b3){if(_0x1041b3){return _0x3de9c9[_0x9091('0x2b')](_0x316c41);}return _0x3de9c9[_0x9091('0x2c')](_0x316c41)[_0x9091('0x2d')]();};}function respondWithResult(_0x22909e,_0x1288a5){_0x1288a5=_0x1288a5||0xc8;return function(_0x365fb5){if(_0x365fb5){return _0x22909e[_0x9091('0x2c')](_0x1288a5)['json'](_0x365fb5);}};}function respondWithFilteredResult(_0x441e11,_0x4d34b5){return function(_0x513d5c){if(_0x513d5c){var _0x1191a4=_0x513d5c[_0x9091('0x2e')],_0x477b18=_0x4d34b5[_0x9091('0x2f')],_0x5bb7bf=_0x4d34b5[_0x9091('0x2f')]+_0x4d34b5[_0x9091('0x30')],_0x1a95cc;if(_0x5bb7bf>=_0x1191a4){_0x5bb7bf=_0x1191a4;_0x1a95cc=0xc8;}else{_0x1a95cc=0xce;}_0x441e11[_0x9091('0x2c')](_0x1a95cc);return _0x441e11[_0x9091('0x31')](_0x9091('0x32'),_0x477b18+'-'+_0x5bb7bf+'/'+_0x1191a4)[_0x9091('0x33')](_0x513d5c);}return null;};}function patchUpdates(_0x25e36f){return function(_0x4b07ed){try{jsonpatch[_0x9091('0x34')](_0x4b07ed,_0x25e36f,!![]);}catch(_0xde1f02){return BPromise[_0x9091('0x35')](_0xde1f02);}return _0x4b07ed[_0x9091('0x36')]();};}function saveUpdates(_0x3baa78,_0x44a9ae){return function(_0x535517){if(_0x535517){return _0x535517['update'](_0x3baa78)['then'](function(_0x3935fe){return _0x3935fe;});}return null;};}function removeEntity(_0xd55467,_0x295b0e){return function(_0x4aae1b){if(_0x4aae1b){return _0x4aae1b[_0x9091('0x37')]()[_0x9091('0x21')](function(){_0xd55467['status'](0xcc)[_0x9091('0x2d')]();});}};}function handleEntityNotFound(_0x226318,_0x3c2e24){return function(_0x22c587){if(!_0x22c587){_0x226318[_0x9091('0x2b')](0x194);}return _0x22c587;};}function handleError(_0x1a5b03,_0x3fc45d){_0x3fc45d=_0x3fc45d||0x1f4;return function(_0x4b6efb){logger[_0x9091('0x28')](_0x4b6efb[_0x9091('0x38')]);if(_0x4b6efb[_0x9091('0x39')]){delete _0x4b6efb[_0x9091('0x39')];}_0x1a5b03[_0x9091('0x2c')](_0x3fc45d)[_0x9091('0x3a')](_0x4b6efb);};}exports['index']=function(_0x43f088,_0x1fcf72){var _0x4e9859={},_0x3ba2fc={},_0x44abc6={'count':0x0,'rows':[]};var _0x598204=db[_0x9091('0x3b')][_0x9091('0x3c')];_0x3ba2fc[_0x9091('0x3d')]=_[_0x9091('0x3e')](_0x598204);_0x3ba2fc[_0x9091('0x3f')]=_[_0x9091('0x3e')](_0x43f088[_0x9091('0x3f')]);_0x3ba2fc['filters']=_[_0x9091('0x40')](_0x3ba2fc['model'],_0x3ba2fc['query']);_0x4e9859[_0x9091('0x41')]=_['intersection'](_0x3ba2fc[_0x9091('0x3d')],qs[_0x9091('0x42')](_0x43f088[_0x9091('0x3f')]['fields']));_0x4e9859['attributes']=_0x4e9859[_0x9091('0x41')][_0x9091('0x43')]?_0x4e9859['attributes']:_0x3ba2fc['model'];if(!_0x43f088['query'][_0x9091('0x44')](_0x9091('0x45'))){_0x4e9859[_0x9091('0x30')]=qs[_0x9091('0x30')](_0x43f088[_0x9091('0x3f')][_0x9091('0x30')]);_0x4e9859[_0x9091('0x2f')]=qs['offset'](_0x43f088[_0x9091('0x3f')][_0x9091('0x2f')]);}_0x4e9859['order']=qs[_0x9091('0x46')](_0x43f088['query'][_0x9091('0x46')]);_0x4e9859[_0x9091('0x47')]=qs['filters'](_[_0x9091('0x48')](_0x43f088[_0x9091('0x3f')],_0x3ba2fc[_0x9091('0x49')]));if(_0x43f088[_0x9091('0x3f')][_0x9091('0x4a')]){_0x4e9859[_0x9091('0x47')]=_['merge'](_0x4e9859[_0x9091('0x47')],{'$or':_[_0x9091('0x4b')](_0x598204,function(_0x5cfc72){if(_0x5cfc72['type'][_0x9091('0x4c')]!=='VIRTUAL'){var _0x1a5400={};_0x1a5400[_0x5cfc72[_0x9091('0x4d')]]={'$like':'%'+_0x43f088['query'][_0x9091('0x4a')]+'%'};return _0x1a5400;}})});}_0x4e9859=_[_0x9091('0x4e')]({},_0x4e9859,_0x43f088['options']);var _0x297733={'where':_0x4e9859[_0x9091('0x47')]};return db[_0x9091('0x3b')]['count'](_0x297733)[_0x9091('0x21')](function(_0x1ac3de){_0x44abc6['count']=_0x1ac3de;if(_0x43f088[_0x9091('0x3f')]['includeAll']){_0x4e9859[_0x9091('0x4f')]=[{'all':!![]}];}return db[_0x9091('0x3b')][_0x9091('0x50')](_0x4e9859);})['then'](function(_0x8acf02){_0x44abc6[_0x9091('0x51')]=_0x8acf02;return _0x44abc6;})[_0x9091('0x21')](respondWithFilteredResult(_0x1fcf72,_0x4e9859))[_0x9091('0x2a')](handleError(_0x1fcf72,null));};exports[_0x9091('0x52')]=function(_0x2eed1f,_0x2bae18){var _0x35aab7={'raw':!![],'where':{'id':_0x2eed1f[_0x9091('0x53')]['id']}},_0x549b78={};_0x549b78[_0x9091('0x3d')]=_[_0x9091('0x3e')](db[_0x9091('0x3b')][_0x9091('0x3c')]);_0x549b78[_0x9091('0x3f')]=_[_0x9091('0x3e')](_0x2eed1f[_0x9091('0x3f')]);_0x549b78[_0x9091('0x49')]=_[_0x9091('0x40')](_0x549b78[_0x9091('0x3d')],_0x549b78[_0x9091('0x3f')]);_0x35aab7[_0x9091('0x41')]=_[_0x9091('0x40')](_0x549b78[_0x9091('0x3d')],qs[_0x9091('0x42')](_0x2eed1f['query'][_0x9091('0x42')]));_0x35aab7[_0x9091('0x41')]=_0x35aab7['attributes']['length']?_0x35aab7['attributes']:_0x549b78[_0x9091('0x3d')];if(_0x2eed1f[_0x9091('0x3f')][_0x9091('0x54')]){_0x35aab7['include']=[{'all':!![]}];}_0x35aab7=_[_0x9091('0x4e')]({},_0x35aab7,_0x2eed1f[_0x9091('0x55')]);return db[_0x9091('0x3b')][_0x9091('0x56')](_0x35aab7)[_0x9091('0x21')](handleEntityNotFound(_0x2bae18,null))[_0x9091('0x21')](respondWithResult(_0x2bae18,null))[_0x9091('0x2a')](handleError(_0x2bae18,null));};exports[_0x9091('0x57')]=function(_0xc82c39,_0x453b79){if(_0xc82c39['body']['id']){delete _0xc82c39[_0x9091('0x58')]['id'];}return db['FaxMessage'][_0x9091('0x56')]({'where':{'id':_0xc82c39[_0x9091('0x53')]['id']}})['then'](handleEntityNotFound(_0x453b79,null))[_0x9091('0x21')](saveUpdates(_0xc82c39[_0x9091('0x58')],null))['then'](respondWithResult(_0x453b79,null))[_0x9091('0x2a')](handleError(_0x453b79,null));};exports['destroy']=function(_0x3292fd,_0x1d4d6f){return db['FaxMessage'][_0x9091('0x56')]({'where':{'id':_0x3292fd['params']['id']}})['then'](handleEntityNotFound(_0x1d4d6f,null))[_0x9091('0x21')](removeEntity(_0x1d4d6f,null))[_0x9091('0x2a')](handleError(_0x1d4d6f,null));};exports[_0x9091('0x59')]=function(_0x13779f,_0x55f7e8){return db['FaxMessage'][_0x9091('0x59')]()[_0x9091('0x21')](respondWithResult(_0x55f7e8,null))[_0x9091('0x2a')](handleError(_0x55f7e8,null));};var interaction_log=require(_0x9091('0x13'))(_0x9091('0x5a'));exports[_0x9091('0x5b')]=function(_0x540229,_0x1e398f,_0x12812c){var _0x3bb35a={'channel':_0x9091('0x5c')};if(_0x540229[_0x9091('0x58')]['id']){delete _0x540229[_0x9091('0x58')]['id'];}_0x540229[_0x9091('0x58')][_0x9091('0x5d')]=!![];_0x540229['body'][_0x9091('0x5e')]=moment()[_0x9091('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x540229[_0x9091('0x58')][_0x9091('0x60')]=_0x540229[_0x9091('0x58')][_0x9091('0x60')]||_0x540229['user']['id'];return db[_0x9091('0x3b')][_0x9091('0x56')]({'where':{'id':_0x540229[_0x9091('0x53')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x9091('0x61')}]})[_0x9091('0x21')](handleEntityNotFound(_0x1e398f,null))['then'](saveUpdates(_0x540229[_0x9091('0x58')],null))[_0x9091('0x21')](function(_0x5ad4e8){if(_0x5ad4e8){_0x3bb35a[_0x9091('0x29')]=_0x5ad4e8['get']({'plain':!![]});return db[_0x9091('0x62')][_0x9091('0x56')]({'where':{'id':_0x5ad4e8[_0x9091('0x63')]}});}return null;})[_0x9091('0x21')](handleEntityNotFound(_0x1e398f,null))[_0x9091('0x21')](function(_0x3ab8ad){if(_0x3ab8ad){return _0x3ab8ad['update']({'UserId':_0x540229[_0x9091('0x58')][_0x9091('0x60')],'read1stAt':_[_0x9091('0x64')](_0x3ab8ad[_0x9091('0x65')])?moment()[_0x9091('0x5f')](_0x9091('0x66')):undefined});}return null;})[_0x9091('0x21')](function(_0x4258bb){if(_0x4258bb){_0x3bb35a[_0x9091('0x67')]=_0x4258bb[_0x9091('0x68')]({'plain':!![]});interaction_log[_0x9091('0x22')](_0x9091('0x69'),_0x540229[_0x9091('0x6a')]['id'],_0x540229[_0x9091('0x6a')][_0x9091('0x39')],_0x540229[_0x9091('0x6a')]['role'],_0x3bb35a[_0x9091('0x67')]['id'],_0x540229['body']?JSON[_0x9091('0x26')](_0x540229['body']):_0x9091('0x6b'));return respondWithRpcPromise(_0x9091('0x6c'),_0x9091('0x6d'),_0x3bb35a);}return null;})[_0x9091('0x21')](function(_0x25368e){if(_0x25368e){if(_0x540229[_0x9091('0x58')][_0x9091('0x6e')]){_0x3bb35a[_0x9091('0x29')][_0x9091('0x6f')]=util[_0x9091('0x5f')](_0x9091('0x70'),_0x540229[_0x9091('0x6a')][_0x9091('0x39')]);_0x3bb35a['message']['channel']=_0x3bb35a['channel'];_0x3bb35a['message']['event']=_0x9091('0x5b');return respondWithRpcPromise(_0x9091('0x71'),'EventManager',{'event':_0x9091('0x72'),'message':_0x3bb35a[_0x9091('0x29')]},client9002)[_0x9091('0x21')](function(){return _0x3bb35a;});}return _0x3bb35a;}return null;})['then'](respondWithResult(_0x1e398f,null))['catch'](handleError(_0x1e398f,null));};var interaction_log=require('../../config/logger')(_0x9091('0x5a'));exports['reject']=function(_0x4ef72d,_0x3e92cd,_0x1bf67b){var _0x422a74={'agent':{},'channel':'fax'};if(_0x4ef72d[_0x9091('0x58')]['id']){delete _0x4ef72d[_0x9091('0x58')]['id'];}_0x4ef72d[_0x9091('0x58')][_0x9091('0x60')]=_0x4ef72d[_0x9091('0x58')][_0x9091('0x60')]||_0x4ef72d['user']['id'];_0x422a74[_0x9091('0x73')]['id']=_0x4ef72d[_0x9091('0x58')][_0x9091('0x60')];return db['FaxMessage'][_0x9091('0x56')]({'where':{'id':_0x4ef72d[_0x9091('0x53')]['id'],'UserId':null}})[_0x9091('0x21')](handleEntityNotFound(_0x3e92cd,null))[_0x9091('0x21')](function(_0x2d8ade){if(_0x2d8ade){_0x422a74[_0x9091('0x29')]=_0x2d8ade['get']({'plain':!![]});return db[_0x9091('0x62')][_0x9091('0x56')]({'where':{'id':_0x2d8ade[_0x9091('0x63')]}});}return null;})[_0x9091('0x21')](handleEntityNotFound(_0x3e92cd,null))[_0x9091('0x21')](function(_0x3c7bfe){if(_0x3c7bfe){_0x422a74[_0x9091('0x67')]=_0x3c7bfe[_0x9091('0x68')]({'plain':!![]});interaction_log[_0x9091('0x22')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4ef72d[_0x9091('0x6a')]['id'],_0x4ef72d[_0x9091('0x6a')][_0x9091('0x39')],_0x4ef72d[_0x9091('0x6a')][_0x9091('0x74')],_0x422a74[_0x9091('0x67')]['id'],_0x4ef72d['body']?JSON[_0x9091('0x26')](_0x4ef72d[_0x9091('0x58')]):_0x9091('0x6b'));return respondWithRpcPromise(_0x9091('0x75'),'rejectMessage',_0x422a74);}return null;})['then'](function(_0xc47138){if(_0xc47138){_0xc47138['message']['interface']=util[_0x9091('0x5f')](_0x9091('0x70'),_0x4ef72d['user'][_0x9091('0x39')]);_0xc47138['message']['channel']=_0x422a74[_0x9091('0x76')];_0xc47138[_0x9091('0x29')][_0x9091('0x77')]=_0x9091('0x35');respondWithRpcPromise(_0x9091('0x71'),_0x9091('0x71'),{'event':_0x9091('0x78'),'message':_0xc47138['message']},client9002);return _0x422a74;}return null;})[_0x9091('0x21')](respondWithResult(_0x3e92cd,null))[_0x9091('0x2a')](handleError(_0x3e92cd,null));};exports[_0x9091('0x79')]=function(_0xa02557,_0x48b841){var _0x5d7cbb;return db['FaxMessage'][_0x9091('0x79')](_0xa02557[_0x9091('0x58')],{})[_0x9091('0x21')](function(_0x50dac4){_0x5d7cbb=_0x50dac4;return db['CmContact'][_0x9091('0x7a')]({'where':{'id':_0x5d7cbb[_0x9091('0x7b')]}});})[_0x9091('0x21')](function(_0x236f9c){if(_[_0x9091('0x64')](_0x236f9c)){return;}else{_0x5d7cbb[_0x9091('0x5c')]=_0x236f9c['fax'];return db[_0x9091('0x7c')][_0x9091('0x7a')]({'where':{'id':_0x5d7cbb[_0x9091('0x7d')]}});}})[_0x9091('0x21')](function(_0x16b94f){return respondWithRpcPromise(_0x9091('0x7e'),'SendFax',{'FaxAccountId':_[_0x9091('0x64')](_0xa02557[_0x9091('0x58')])?undefined:_0xa02557[_0x9091('0x58')][_0x9091('0x7f')],'path':_['isNil'](_0x16b94f)?undefined:util[_0x9091('0x5f')](_0x9091('0x80'),_0x16b94f[_0x9091('0x81')]),'fax':_[_0x9091('0x64')](_0x5d7cbb[_0x9091('0x5c')])?undefined:_0x5d7cbb['fax'],'AttachmentId':_0x5d7cbb[_0x9091('0x7d')]},client9002);})[_0x9091('0x21')](respondWithResult(_0x48b841,0xc9))[_0x9091('0x2a')](handleError(_0x48b841,null));};exports['download']=function(_0x232fcf,_0x39b669){var _0x174caf=path[_0x9091('0x82')](config[_0x9091('0x83')],_0x9091('0x84'),'files',_0x9091('0x85'));return db['FaxMessage'][_0x9091('0x56')]({'where':{'id':_0x232fcf[_0x9091('0x53')]['id']},'include':[{'model':db['Attachment'],'as':_0x9091('0x7c')}]})[_0x9091('0x21')](handleEntityNotFound(_0x39b669,null))[_0x9091('0x21')](function(_0x3bcc96){if(_0x3bcc96){return _0x39b669[_0x9091('0x86')](path[_0x9091('0x82')](_0x174caf,_0x3bcc96[_0x9091('0x7c')]['basename']));}})['catch'](handleError(_0x39b669,null));}; \ No newline at end of file +var _0x6573=['files','attachments','Attachment','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','./faxMessage.socket','register','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','Content-Range','apply','save','update','destroy','sendStatus','stack','name','send','FaxMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','show','params','find','body','fax-interactions','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','FaxInteractionId','isNil','read1stAt','interaction','info','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','reject','get','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','create','findOne','AttachmentId','SendFax','FaxAccountId','basename','download','join','root','server'];(function(_0x3ff2a3,_0x4d0d7b){var _0x3b9080=function(_0x352596){while(--_0x352596){_0x3ff2a3['push'](_0x3ff2a3['shift']());}};_0x3b9080(++_0x4d0d7b);}(_0x6573,0x107));var _0x3657=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6573[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3657('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3657('0x1'));var jsonpatch=require(_0x3657('0x2'));var rp=require(_0x3657('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3657('0x4'));var util=require(_0x3657('0x5'));var path=require(_0x3657('0x6'));var sox=require(_0x3657('0x7'));var csv=require('to-csv');var ejs=require(_0x3657('0x8'));var fs=require('fs');var _=require(_0x3657('0x9'));var squel=require(_0x3657('0xa'));var crypto=require(_0x3657('0xb'));var jsforce=require(_0x3657('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3657('0xd'));var querystring=require(_0x3657('0xe'));var Papa=require(_0x3657('0xf'));var Redis=require(_0x3657('0x10'));var authService=require(_0x3657('0x11'));var qs=require(_0x3657('0x12'));var hardwareService=require(_0x3657('0x13'));var logger=require(_0x3657('0x14'))(_0x3657('0x15'));var utils=require(_0x3657('0x16'));var config=require(_0x3657('0x17'));var db=require('../../mysqldb')['db'];config[_0x3657('0x18')]=_[_0x3657('0x19')](config['redis'],{'host':_0x3657('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3657('0x1b'))[_0x3657('0x1c')](socket);var jayson=require(_0x3657('0x1d'));var client=jayson['client'][_0x3657('0x1e')]({'port':0x232c});var client9002=jayson[_0x3657('0x1f')]['http']({'port':0x232a});function checkPasswordPattern(_0x21ebf0,_0x26f7e1,_0x33e9b4){if(_0x33e9b4){var _0x27007f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x27007f[_0x3657('0x20')](_0x26f7e1)){return _0x21ebf0;}else{throw new Error(_0x3657('0x21'));}}else{return _0x21ebf0;}}function respondWithRpcPromise(_0x1781e7,_0x1ccd96,_0x12520e,_0x15162c){return new BPromise(function(_0x33ee02,_0x40be1b){var _0xdbf62b=_0x15162c||client;return _0xdbf62b[_0x3657('0x22')](_0x1781e7,_0x12520e)[_0x3657('0x23')](function(_0x70aac9){logger['info'](_0x3657('0x24'),_0x1ccd96,_0x3657('0x25'));logger['debug'](_0x3657('0x26'),_0x1ccd96,_0x3657('0x25'),JSON[_0x3657('0x27')](_0x70aac9));if(_0x70aac9['error']){if(_0x70aac9[_0x3657('0x28')][_0x3657('0x29')]===0x1f4){logger[_0x3657('0x28')](_0x3657('0x24'),_0x1ccd96,_0x70aac9['error']['message']);return _0x40be1b(_0x70aac9[_0x3657('0x28')][_0x3657('0x2a')]);}logger[_0x3657('0x28')](_0x3657('0x24'),_0x1ccd96,_0x70aac9['error']['message']);return _0x33ee02(_0x70aac9[_0x3657('0x28')][_0x3657('0x2a')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x1ccd96,_0x3657('0x25'));_0x33ee02(_0x70aac9[_0x3657('0x2b')]['message']);}})[_0x3657('0x2c')](function(_0xe84ca8){logger[_0x3657('0x28')](_0x3657('0x24'),_0x1ccd96,_0xe84ca8);_0x40be1b(_0xe84ca8);});});}function respondWithStatusCode(_0x593bbc,_0x22c6d6){_0x22c6d6=_0x22c6d6||0xcc;return function(_0x250377){if(_0x250377){return _0x593bbc['sendStatus'](_0x22c6d6);}return _0x593bbc[_0x3657('0x2d')](_0x22c6d6)[_0x3657('0x2e')]();};}function respondWithResult(_0x3fe9df,_0x5d8480){_0x5d8480=_0x5d8480||0xc8;return function(_0x5c56ba){if(_0x5c56ba){return _0x3fe9df[_0x3657('0x2d')](_0x5d8480)[_0x3657('0x2f')](_0x5c56ba);}};}function respondWithFilteredResult(_0x5df908,_0x5aca46){return function(_0x56e19a){if(_0x56e19a){var _0x431e65=_0x56e19a['count'],_0x9cdb07=_0x5aca46[_0x3657('0x30')],_0x3878db=_0x5aca46[_0x3657('0x30')]+_0x5aca46[_0x3657('0x31')],_0x5a890d;if(_0x3878db>=_0x431e65){_0x3878db=_0x431e65;_0x5a890d=0xc8;}else{_0x5a890d=0xce;}_0x5df908['status'](_0x5a890d);return _0x5df908['set'](_0x3657('0x32'),_0x9cdb07+'-'+_0x3878db+'/'+_0x431e65)[_0x3657('0x2f')](_0x56e19a);}return null;};}function patchUpdates(_0x3eef87){return function(_0x466e31){try{jsonpatch[_0x3657('0x33')](_0x466e31,_0x3eef87,!![]);}catch(_0x495bd6){return BPromise['reject'](_0x495bd6);}return _0x466e31[_0x3657('0x34')]();};}function saveUpdates(_0xb47301,_0x573906){return function(_0x19ce1a){if(_0x19ce1a){return _0x19ce1a[_0x3657('0x35')](_0xb47301)['then'](function(_0x74d37c){return _0x74d37c;});}return null;};}function removeEntity(_0x18ea82,_0x3a3ff8){return function(_0x4c730c){if(_0x4c730c){return _0x4c730c[_0x3657('0x36')]()[_0x3657('0x23')](function(){_0x18ea82[_0x3657('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x287bcb,_0x3d5936){return function(_0x290e03){if(!_0x290e03){_0x287bcb[_0x3657('0x37')](0x194);}return _0x290e03;};}function handleError(_0x1c718a,_0x60971f){_0x60971f=_0x60971f||0x1f4;return function(_0x4d74be){logger['error'](_0x4d74be[_0x3657('0x38')]);if(_0x4d74be['name']){delete _0x4d74be[_0x3657('0x39')];}_0x1c718a[_0x3657('0x2d')](_0x60971f)[_0x3657('0x3a')](_0x4d74be);};}exports['index']=function(_0x5a6ec5,_0x30c5bc){var _0x1871c={},_0x23b84e={},_0x245025={'count':0x0,'rows':[]};var _0x1df8ca=db[_0x3657('0x3b')][_0x3657('0x3c')];_0x23b84e[_0x3657('0x3d')]=_[_0x3657('0x3e')](_0x1df8ca);_0x23b84e[_0x3657('0x3f')]=_[_0x3657('0x3e')](_0x5a6ec5['query']);_0x23b84e[_0x3657('0x40')]=_[_0x3657('0x41')](_0x23b84e[_0x3657('0x3d')],_0x23b84e[_0x3657('0x3f')]);_0x1871c[_0x3657('0x42')]=_[_0x3657('0x41')](_0x23b84e[_0x3657('0x3d')],qs[_0x3657('0x43')](_0x5a6ec5['query'][_0x3657('0x43')]));_0x1871c[_0x3657('0x42')]=_0x1871c[_0x3657('0x42')][_0x3657('0x44')]?_0x1871c['attributes']:_0x23b84e[_0x3657('0x3d')];if(!_0x5a6ec5[_0x3657('0x3f')]['hasOwnProperty'](_0x3657('0x45'))){_0x1871c[_0x3657('0x31')]=qs[_0x3657('0x31')](_0x5a6ec5[_0x3657('0x3f')][_0x3657('0x31')]);_0x1871c['offset']=qs[_0x3657('0x30')](_0x5a6ec5[_0x3657('0x3f')]['offset']);}_0x1871c['order']=qs[_0x3657('0x46')](_0x5a6ec5[_0x3657('0x3f')][_0x3657('0x46')]);_0x1871c[_0x3657('0x47')]=qs[_0x3657('0x40')](_[_0x3657('0x48')](_0x5a6ec5[_0x3657('0x3f')],_0x23b84e['filters']));if(_0x5a6ec5[_0x3657('0x3f')][_0x3657('0x49')]){_0x1871c[_0x3657('0x47')]=_[_0x3657('0x4a')](_0x1871c[_0x3657('0x47')],{'$or':_[_0x3657('0x4b')](_0x1df8ca,function(_0x793241){if(_0x793241[_0x3657('0x4c')][_0x3657('0x4d')]!==_0x3657('0x4e')){var _0x21e0e5={};_0x21e0e5[_0x793241[_0x3657('0x4f')]]={'$like':'%'+_0x5a6ec5[_0x3657('0x3f')][_0x3657('0x49')]+'%'};return _0x21e0e5;}})});}_0x1871c=_[_0x3657('0x4a')]({},_0x1871c,_0x5a6ec5[_0x3657('0x50')]);var _0x4407ca={'where':_0x1871c[_0x3657('0x47')]};return db[_0x3657('0x3b')]['count'](_0x4407ca)['then'](function(_0x435849){_0x245025['count']=_0x435849;if(_0x5a6ec5[_0x3657('0x3f')][_0x3657('0x51')]){_0x1871c[_0x3657('0x52')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x1871c);})[_0x3657('0x23')](function(_0x5e094e){_0x245025['rows']=_0x5e094e;return _0x245025;})[_0x3657('0x23')](respondWithFilteredResult(_0x30c5bc,_0x1871c))['catch'](handleError(_0x30c5bc,null));};exports[_0x3657('0x53')]=function(_0x48c948,_0x5df399){var _0x509af1={'raw':!![],'where':{'id':_0x48c948[_0x3657('0x54')]['id']}},_0x1cfc9a={};_0x1cfc9a[_0x3657('0x3d')]=_[_0x3657('0x3e')](db[_0x3657('0x3b')]['rawAttributes']);_0x1cfc9a['query']=_[_0x3657('0x3e')](_0x48c948[_0x3657('0x3f')]);_0x1cfc9a[_0x3657('0x40')]=_[_0x3657('0x41')](_0x1cfc9a[_0x3657('0x3d')],_0x1cfc9a[_0x3657('0x3f')]);_0x509af1[_0x3657('0x42')]=_['intersection'](_0x1cfc9a[_0x3657('0x3d')],qs[_0x3657('0x43')](_0x48c948[_0x3657('0x3f')][_0x3657('0x43')]));_0x509af1['attributes']=_0x509af1[_0x3657('0x42')][_0x3657('0x44')]?_0x509af1[_0x3657('0x42')]:_0x1cfc9a['model'];if(_0x48c948[_0x3657('0x3f')][_0x3657('0x51')]){_0x509af1[_0x3657('0x52')]=[{'all':!![]}];}_0x509af1=_[_0x3657('0x4a')]({},_0x509af1,_0x48c948[_0x3657('0x50')]);return db[_0x3657('0x3b')][_0x3657('0x55')](_0x509af1)[_0x3657('0x23')](handleEntityNotFound(_0x5df399,null))[_0x3657('0x23')](respondWithResult(_0x5df399,null))[_0x3657('0x2c')](handleError(_0x5df399,null));};exports[_0x3657('0x35')]=function(_0xec079b,_0x25df4f){if(_0xec079b[_0x3657('0x56')]['id']){delete _0xec079b[_0x3657('0x56')]['id'];}return db[_0x3657('0x3b')]['find']({'where':{'id':_0xec079b[_0x3657('0x54')]['id']}})['then'](handleEntityNotFound(_0x25df4f,null))[_0x3657('0x23')](saveUpdates(_0xec079b['body'],null))[_0x3657('0x23')](respondWithResult(_0x25df4f,null))[_0x3657('0x2c')](handleError(_0x25df4f,null));};exports[_0x3657('0x36')]=function(_0x4f3ad7,_0x54372c){return db[_0x3657('0x3b')][_0x3657('0x55')]({'where':{'id':_0x4f3ad7[_0x3657('0x54')]['id']}})[_0x3657('0x23')](handleEntityNotFound(_0x54372c,null))['then'](removeEntity(_0x54372c,null))['catch'](handleError(_0x54372c,null));};exports['describe']=function(_0x1d9eeb,_0x1c4280){return db[_0x3657('0x3b')]['describe']()[_0x3657('0x23')](respondWithResult(_0x1c4280,null))[_0x3657('0x2c')](handleError(_0x1c4280,null));};var interaction_log=require(_0x3657('0x14'))(_0x3657('0x57'));exports['accept']=function(_0x2d3a0c,_0x40d882,_0x2a26b3){var _0x2d3ee4={'channel':_0x3657('0x58')};if(_0x2d3a0c['body']['id']){delete _0x2d3a0c['body']['id'];}_0x2d3a0c[_0x3657('0x56')][_0x3657('0x59')]=!![];_0x2d3a0c[_0x3657('0x56')][_0x3657('0x5a')]=moment()[_0x3657('0x5b')](_0x3657('0x5c'));_0x2d3a0c['body'][_0x3657('0x5d')]=_0x2d3a0c[_0x3657('0x56')]['UserId']||_0x2d3a0c['user']['id'];return db[_0x3657('0x3b')][_0x3657('0x55')]({'where':{'id':_0x2d3a0c[_0x3657('0x54')]['id'],'UserId':null},'include':[{'model':db[_0x3657('0x5e')],'as':'Contact'}]})[_0x3657('0x23')](handleEntityNotFound(_0x40d882,null))[_0x3657('0x23')](saveUpdates(_0x2d3a0c[_0x3657('0x56')],null))[_0x3657('0x23')](function(_0x799346){if(_0x799346){_0x2d3ee4[_0x3657('0x2a')]=_0x799346['get']({'plain':!![]});return db['FaxInteraction'][_0x3657('0x55')]({'where':{'id':_0x799346[_0x3657('0x5f')]}});}return null;})[_0x3657('0x23')](handleEntityNotFound(_0x40d882,null))[_0x3657('0x23')](function(_0x520397){if(_0x520397){return _0x520397[_0x3657('0x35')]({'UserId':_0x2d3a0c['body'][_0x3657('0x5d')],'read1stAt':_[_0x3657('0x60')](_0x520397[_0x3657('0x61')])?moment()[_0x3657('0x5b')](_0x3657('0x5c')):undefined});}return null;})[_0x3657('0x23')](function(_0x12022c){if(_0x12022c){_0x2d3ee4[_0x3657('0x62')]=_0x12022c['get']({'plain':!![]});interaction_log[_0x3657('0x63')](_0x3657('0x64'),_0x2d3a0c[_0x3657('0x65')]['id'],_0x2d3a0c[_0x3657('0x65')][_0x3657('0x39')],_0x2d3a0c[_0x3657('0x65')][_0x3657('0x66')],_0x2d3ee4[_0x3657('0x62')]['id'],_0x2d3a0c[_0x3657('0x56')]?JSON[_0x3657('0x27')](_0x2d3a0c[_0x3657('0x56')]):'null');return respondWithRpcPromise(_0x3657('0x67'),'acceptMessage',_0x2d3ee4);}return null;})[_0x3657('0x23')](function(_0x760ab4){if(_0x760ab4){if(_0x2d3a0c[_0x3657('0x56')]['manual']){_0x2d3ee4[_0x3657('0x2a')][_0x3657('0x68')]=util[_0x3657('0x5b')](_0x3657('0x69'),_0x2d3a0c[_0x3657('0x65')][_0x3657('0x39')]);_0x2d3ee4[_0x3657('0x2a')]['channel']=_0x2d3ee4[_0x3657('0x6a')];_0x2d3ee4[_0x3657('0x2a')][_0x3657('0x6b')]=_0x3657('0x6c');return respondWithRpcPromise(_0x3657('0x6d'),_0x3657('0x6d'),{'event':_0x3657('0x6e'),'message':_0x2d3ee4[_0x3657('0x2a')]},client9002)[_0x3657('0x23')](function(){return _0x2d3ee4;});}return _0x2d3ee4;}return null;})[_0x3657('0x23')](respondWithResult(_0x40d882,null))[_0x3657('0x2c')](handleError(_0x40d882,null));};var interaction_log=require('../../config/logger')(_0x3657('0x57'));exports[_0x3657('0x6f')]=function(_0x46b81f,_0x527abd,_0x1aeb11){var _0xc89a70={'agent':{},'channel':'fax'};if(_0x46b81f[_0x3657('0x56')]['id']){delete _0x46b81f[_0x3657('0x56')]['id'];}_0x46b81f[_0x3657('0x56')][_0x3657('0x5d')]=_0x46b81f[_0x3657('0x56')][_0x3657('0x5d')]||_0x46b81f['user']['id'];_0xc89a70['agent']['id']=_0x46b81f[_0x3657('0x56')]['UserId'];return db[_0x3657('0x3b')][_0x3657('0x55')]({'where':{'id':_0x46b81f['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x527abd,null))['then'](function(_0x2ed2a2){if(_0x2ed2a2){_0xc89a70['message']=_0x2ed2a2[_0x3657('0x70')]({'plain':!![]});return db[_0x3657('0x71')]['find']({'where':{'id':_0x2ed2a2[_0x3657('0x5f')]}});}return null;})[_0x3657('0x23')](handleEntityNotFound(_0x527abd,null))['then'](function(_0x2b31c4){if(_0x2b31c4){_0xc89a70['interaction']=_0x2b31c4[_0x3657('0x70')]({'plain':!![]});interaction_log[_0x3657('0x63')](_0x3657('0x72'),_0x46b81f[_0x3657('0x65')]['id'],_0x46b81f[_0x3657('0x65')][_0x3657('0x39')],_0x46b81f[_0x3657('0x65')][_0x3657('0x66')],_0xc89a70[_0x3657('0x62')]['id'],_0x46b81f[_0x3657('0x56')]?JSON['stringify'](_0x46b81f[_0x3657('0x56')]):'null');return respondWithRpcPromise('RejectMessage',_0x3657('0x73'),_0xc89a70);}return null;})[_0x3657('0x23')](function(_0x40756e){if(_0x40756e){_0x40756e[_0x3657('0x2a')][_0x3657('0x68')]=util[_0x3657('0x5b')](_0x3657('0x69'),_0x46b81f['user']['name']);_0x40756e[_0x3657('0x2a')][_0x3657('0x6a')]=_0xc89a70[_0x3657('0x6a')];_0x40756e[_0x3657('0x2a')][_0x3657('0x6b')]=_0x3657('0x6f');respondWithRpcPromise(_0x3657('0x6d'),_0x3657('0x6d'),{'event':_0x3657('0x74'),'message':_0x40756e[_0x3657('0x2a')]},client9002);return _0xc89a70;}return null;})[_0x3657('0x23')](respondWithResult(_0x527abd,null))[_0x3657('0x2c')](handleError(_0x527abd,null));};exports[_0x3657('0x75')]=function(_0x5f47d2,_0xff5dd8){var _0x561e60;return db['FaxMessage']['create'](_0x5f47d2[_0x3657('0x56')],{})[_0x3657('0x23')](function(_0x283509){_0x561e60=_0x283509;return db[_0x3657('0x5e')][_0x3657('0x76')]({'where':{'id':_0x561e60['ContactId']}});})[_0x3657('0x23')](function(_0x191819){if(_[_0x3657('0x60')](_0x191819)){return;}else{_0x561e60[_0x3657('0x58')]=_0x191819['fax'];return db['Attachment'][_0x3657('0x76')]({'where':{'id':_0x561e60[_0x3657('0x77')]}});}})[_0x3657('0x23')](function(_0x3a3564){return respondWithRpcPromise(_0x3657('0x78'),_0x3657('0x78'),{'FaxAccountId':_['isNil'](_0x5f47d2[_0x3657('0x56')])?undefined:_0x5f47d2[_0x3657('0x56')][_0x3657('0x79')],'path':_[_0x3657('0x60')](_0x3a3564)?undefined:util[_0x3657('0x5b')]('/var/opt/motion2/server/files/attachments/%s',_0x3a3564[_0x3657('0x7a')]),'fax':_[_0x3657('0x60')](_0x561e60[_0x3657('0x58')])?undefined:_0x561e60['fax'],'AttachmentId':_0x561e60[_0x3657('0x77')]},client9002);})['then'](respondWithResult(_0xff5dd8,0xc9))['catch'](handleError(_0xff5dd8,null));};exports[_0x3657('0x7b')]=function(_0x47a4db,_0x541a71){var _0x53f25b=path[_0x3657('0x7c')](config[_0x3657('0x7d')],_0x3657('0x7e'),_0x3657('0x7f'),_0x3657('0x80'));return db['FaxMessage'][_0x3657('0x55')]({'where':{'id':_0x47a4db[_0x3657('0x54')]['id']},'include':[{'model':db[_0x3657('0x81')],'as':_0x3657('0x81')}]})['then'](handleEntityNotFound(_0x541a71,null))[_0x3657('0x23')](function(_0x4a6a7d){if(_0x4a6a7d){return _0x541a71[_0x3657('0x7b')](path[_0x3657('0x7c')](_0x53f25b,_0x4a6a7d['Attachment'][_0x3657('0x7a')]));}})[_0x3657('0x2c')](handleError(_0x541a71,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 80f76e2..5e6d0ec 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 _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x55ca,0x126));var _0xa55c=function(_0x57b4cc,_0x2ae50e){_0x57b4cc=_0x57b4cc-0x0;var _0x45ba9d=_0x55ca[_0x57b4cc];return _0x45ba9d;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var FaxMessage=require(_0xa55c('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){FaxMessageEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);FaxMessageEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];FaxMessage[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x34e8=['emit','hasOwnProperty','exports','events','../../mysqldb','FaxMessage','setMaxListeners','update','remove'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x34e8,0x12c));var _0x834e=function(_0x28915c,_0x5e9526){_0x28915c=_0x28915c-0x0;var _0x165906=_0x34e8[_0x28915c];return _0x165906;};'use strict';var EventEmitter=require(_0x834e('0x0'));var FaxMessage=require(_0x834e('0x1'))['db'][_0x834e('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x834e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x834e('0x4'),'afterDestroy':_0x834e('0x5')};function emitEvent(_0x472111){return function(_0x31bf20,_0x289ef2,_0x19a3e0){FaxMessageEvents[_0x834e('0x6')](_0x472111+':'+_0x31bf20['id'],_0x31bf20);FaxMessageEvents['emit'](_0x472111,_0x31bf20);_0x19a3e0(null);};}for(var e in events){if(events[_0x834e('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x834e('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 0ed2740..2402b00 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 _0x3a11=['bluebird','request-promise','path','rimraf','./faxMessage.attributes','define','fax_messages','body','models','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x38e43a,_0x223af3){var _0x5bc83f=function(_0x26489b){while(--_0x26489b){_0x38e43a['push'](_0x38e43a['shift']());}};_0x5bc83f(++_0x223af3);}(_0x3a11,0x191));var _0x13a1=function(_0x334599,_0x4b1cfa){_0x334599=_0x334599-0x0;var _0x4cdff2=_0x3a11[_0x334599];return _0x4cdff2;};'use strict';var _=require(_0x13a1('0x0'));var util=require(_0x13a1('0x1'));var logger=require(_0x13a1('0x2'))('api');var moment=require(_0x13a1('0x3'));var BPromise=require(_0x13a1('0x4'));var rp=require(_0x13a1('0x5'));var fs=require('fs');var path=require(_0x13a1('0x6'));var rimraf=require(_0x13a1('0x7'));var config=require('../../config/environment');var attributes=require(_0x13a1('0x8'));module['exports']=function(_0x5d9e88,_0x2a317e){return _0x5d9e88[_0x13a1('0x9')]('FaxMessage',attributes,{'tableName':_0x13a1('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x13a1('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x9b40f2,_0x4181dc,_0x47ccc5){var _0x5b96f2=_0x5d9e88[_0x13a1('0xc')];var _0x378a7a=_0x9b40f2[_0x13a1('0xd')]({'plain':!![]});if(_0x378a7a[_0x13a1('0xe')][_0x13a1('0xf')]()==='in'||_0x378a7a[_0x13a1('0xe')]['toLowerCase']()==='out'&&!_0x378a7a[_0x13a1('0x10')]&&!_[_0x13a1('0x11')](_0x378a7a[_0x13a1('0x12')])){_0x5b96f2[_0x13a1('0x13')]['findOne']({'where':{'id':_0x378a7a[_0x13a1('0x14')]}})[_0x13a1('0x15')](function(_0x2c50a2){if(_0x2c50a2){_0x2c50a2[_0x13a1('0x16')]({'lastMsgAt':_0x378a7a[_0x13a1('0x17')],'lastMsgDirection':_0x378a7a[_0x13a1('0xe')]['toLowerCase']()});}})[_0x13a1('0x18')](function(_0x1e159d){console['error'](_0x1e159d);});}_0x47ccc5();}},'charset':_0x13a1('0x19'),'collate':_0x13a1('0x1a')});}; \ No newline at end of file +var _0x8df7=['get','direction','toLowerCase','out','isNil','UserId','FaxInteraction','FaxInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages','body','FULLTEXT','models'];(function(_0x46a140,_0x2c7594){var _0x131360=function(_0xad750c){while(--_0xad750c){_0x46a140['push'](_0x46a140['shift']());}};_0x131360(++_0x2c7594);}(_0x8df7,0x68));var _0x78df=function(_0x379a94,_0x1f605a){_0x379a94=_0x379a94-0x0;var _0x407497=_0x8df7[_0x379a94];return _0x407497;};'use strict';var _=require(_0x78df('0x0'));var util=require(_0x78df('0x1'));var logger=require('../../config/logger')(_0x78df('0x2'));var moment=require('moment');var BPromise=require(_0x78df('0x3'));var rp=require(_0x78df('0x4'));var fs=require('fs');var path=require(_0x78df('0x5'));var rimraf=require(_0x78df('0x6'));var config=require(_0x78df('0x7'));var attributes=require(_0x78df('0x8'));module[_0x78df('0x9')]=function(_0x2d7863,_0x105b3a){return _0x2d7863[_0x78df('0xa')]('FaxMessage',attributes,{'tableName':_0x78df('0xb'),'paranoid':![],'indexes':[{'name':_0x78df('0xc'),'fields':[_0x78df('0xd')],'type':_0x78df('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x28eeeb,_0x53bafd,_0x281ec6){var _0x26aa43=_0x2d7863[_0x78df('0xf')];var _0x422fe4=_0x28eeeb[_0x78df('0x10')]({'plain':!![]});if(_0x422fe4[_0x78df('0x11')]['toLowerCase']()==='in'||_0x422fe4[_0x78df('0x11')][_0x78df('0x12')]()===_0x78df('0x13')&&!_0x422fe4['secret']&&!_[_0x78df('0x14')](_0x422fe4[_0x78df('0x15')])){_0x26aa43[_0x78df('0x16')]['findOne']({'where':{'id':_0x422fe4[_0x78df('0x17')]}})[_0x78df('0x18')](function(_0x769393){if(_0x769393){_0x769393['update']({'lastMsgAt':_0x422fe4[_0x78df('0x19')],'lastMsgDirection':_0x422fe4[_0x78df('0x11')][_0x78df('0x12')]()});}})[_0x78df('0x1a')](function(_0x21fd75){console[_0x78df('0x1b')](_0x21fd75);});}_0x281ec6();}},'charset':_0x78df('0x1c'),'collate':_0x78df('0x1d')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 0e5e057..c136782 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 _0x7fb0=['register','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','create','body','options','then','CreateFaxMessage','UpdateFaxMessage','raw','where','attributes','debug','moment','randomstring','../../mysqldb','../../config/utils','rpc','client','http','redis','localhost','socket.io-emitter'];(function(_0x28af94,_0x31248a){var _0x12bc9b=function(_0x3e695f){while(--_0x3e695f){_0x28af94['push'](_0x28af94['shift']());}};_0x12bc9b(++_0x31248a);}(_0x7fb0,0xee));var _0x07fb=function(_0x3205a6,_0x177082){_0x3205a6=_0x3205a6-0x0;var _0x2e7a05=_0x7fb0[_0x3205a6];return _0x2e7a05;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x07fb('0x0'));var BPromise=require('bluebird');var rs=require(_0x07fb('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x07fb('0x2'))['db'];var utils=require(_0x07fb('0x3'));var logger=require('../../config/logger')(_0x07fb('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x07fb('0x5')][_0x07fb('0x6')]({'port':0x232a});config['redis']=_['defaults'](config[_0x07fb('0x7')],{'host':_0x07fb('0x8'),'port':0x18eb});var socket=require(_0x07fb('0x9'))(new Redis(config['redis']));require('./faxMessage.socket')[_0x07fb('0xa')](socket);function respondWithRpcPromise(_0x2ff3fc,_0x17f4ca,_0x2d950c){return new BPromise(function(_0x208fcb,_0x329d56){return client[_0x07fb('0xb')](_0x2ff3fc,_0x2d950c)['then'](function(_0x2229fa){logger[_0x07fb('0xc')](_0x07fb('0xd'),_0x17f4ca,_0x07fb('0xe'));logger['debug'](_0x07fb('0xf'),_0x17f4ca,'request\x20sent',JSON[_0x07fb('0x10')](_0x2229fa));if(_0x2229fa[_0x07fb('0x11')]){if(_0x2229fa[_0x07fb('0x11')]['code']===0x1f4){logger[_0x07fb('0x11')](_0x07fb('0xd'),_0x17f4ca,_0x2229fa[_0x07fb('0x11')][_0x07fb('0x12')]);return _0x329d56(_0x2229fa[_0x07fb('0x11')][_0x07fb('0x12')]);}logger[_0x07fb('0x11')](_0x07fb('0xd'),_0x17f4ca,_0x2229fa['error'][_0x07fb('0x12')]);return _0x208fcb(_0x2229fa['error'][_0x07fb('0x12')]);}else{logger[_0x07fb('0xc')](_0x07fb('0xd'),_0x17f4ca,'request\x20sent');_0x208fcb(_0x2229fa[_0x07fb('0x13')][_0x07fb('0x12')]);}})[_0x07fb('0x14')](function(_0x4567b7){logger[_0x07fb('0x11')](_0x07fb('0xd'),_0x17f4ca,_0x4567b7);_0x329d56(_0x4567b7);});});}exports['CreateFaxMessage']=function(_0x13732d){var _0x3cdfa4=this;return new Promise(function(_0x4053e6,_0x5cee18){return db['FaxMessage'][_0x07fb('0x15')](_0x13732d[_0x07fb('0x16')],{'raw':_0x13732d['options']?_0x13732d[_0x07fb('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x07fb('0x18')](function(_0x12c840){logger['info'](_0x07fb('0x19'),_0x13732d);logger['debug'](_0x07fb('0x19'),_0x13732d,JSON[_0x07fb('0x10')](_0x12c840));_0x4053e6(_0x12c840);})[_0x07fb('0x14')](function(_0x3d57b0){logger[_0x07fb('0x11')](_0x07fb('0x19'),_0x3d57b0['message'],_0x13732d);_0x5cee18(_0x3cdfa4[_0x07fb('0x11')](0x1f4,_0x3d57b0[_0x07fb('0x12')]));});});};exports[_0x07fb('0x1a')]=function(_0xc99bbd){var _0xa188e2=this;return new Promise(function(_0x570f59,_0x3b4245){return db['FaxMessage']['update'](_0xc99bbd['body'],{'raw':_0xc99bbd['options']?_0xc99bbd['options'][_0x07fb('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc99bbd[_0x07fb('0x17')]?_0xc99bbd['options'][_0x07fb('0x1c')]||null:null,'attributes':_0xc99bbd[_0x07fb('0x17')]?_0xc99bbd[_0x07fb('0x17')][_0x07fb('0x1d')]||null:null,'limit':_0xc99bbd[_0x07fb('0x17')]?_0xc99bbd[_0x07fb('0x17')]['limit']||null:null})['then'](function(_0x5f4aac){logger[_0x07fb('0xc')](_0x07fb('0x1a'),_0xc99bbd);logger[_0x07fb('0x1e')](_0x07fb('0x1a'),_0xc99bbd,JSON[_0x07fb('0x10')](_0x5f4aac));_0x570f59(_0x5f4aac);})[_0x07fb('0x14')](function(_0x77865b){logger[_0x07fb('0x11')]('UpdateFaxMessage',_0x77865b['message'],_0xc99bbd);_0x3b4245(_0xa188e2['error'](0x1f4,_0x77865b['message']));});});}; \ No newline at end of file +var _0x0f37=['raw','UpdateFaxMessage','update','where','util','moment','randomstring','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','body','options'];(function(_0x516044,_0x3677f7){var _0x31684b=function(_0x80be21){while(--_0x80be21){_0x516044['push'](_0x516044['shift']());}};_0x31684b(++_0x3677f7);}(_0x0f37,0x1c4));var _0x70f3=function(_0x27b2b1,_0x23466d){_0x27b2b1=_0x27b2b1-0x0;var _0x44640e=_0x0f37[_0x27b2b1];return _0x44640e;};'use strict';var _=require('lodash');var util=require(_0x70f3('0x0'));var moment=require(_0x70f3('0x1'));var BPromise=require('bluebird');var rs=require(_0x70f3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x70f3('0x3'));var logger=require('../../config/logger')(_0x70f3('0x4'));var config=require('../../config/environment');var jayson=require(_0x70f3('0x5'));var client=jayson[_0x70f3('0x6')]['http']({'port':0x232a});config[_0x70f3('0x7')]=_[_0x70f3('0x8')](config[_0x70f3('0x7')],{'host':_0x70f3('0x9'),'port':0x18eb});var socket=require(_0x70f3('0xa'))(new Redis(config[_0x70f3('0x7')]));require(_0x70f3('0xb'))['register'](socket);function respondWithRpcPromise(_0x5daace,_0x34bb0e,_0x581ac4){return new BPromise(function(_0x305ac9,_0x2d2aed){return client['request'](_0x5daace,_0x581ac4)[_0x70f3('0xc')](function(_0x45ff59){logger[_0x70f3('0xd')](_0x70f3('0xe'),_0x34bb0e,_0x70f3('0xf'));logger[_0x70f3('0x10')](_0x70f3('0x11'),_0x34bb0e,_0x70f3('0xf'),JSON[_0x70f3('0x12')](_0x45ff59));if(_0x45ff59[_0x70f3('0x13')]){if(_0x45ff59[_0x70f3('0x13')][_0x70f3('0x14')]===0x1f4){logger[_0x70f3('0x13')](_0x70f3('0xe'),_0x34bb0e,_0x45ff59[_0x70f3('0x13')][_0x70f3('0x15')]);return _0x2d2aed(_0x45ff59['error'][_0x70f3('0x15')]);}logger['error'](_0x70f3('0xe'),_0x34bb0e,_0x45ff59[_0x70f3('0x13')][_0x70f3('0x15')]);return _0x305ac9(_0x45ff59[_0x70f3('0x13')][_0x70f3('0x15')]);}else{logger[_0x70f3('0xd')](_0x70f3('0xe'),_0x34bb0e,_0x70f3('0xf'));_0x305ac9(_0x45ff59[_0x70f3('0x16')][_0x70f3('0x15')]);}})[_0x70f3('0x17')](function(_0x2fed8d){logger[_0x70f3('0x13')](_0x70f3('0xe'),_0x34bb0e,_0x2fed8d);_0x2d2aed(_0x2fed8d);});});}exports[_0x70f3('0x18')]=function(_0x4b9290){var _0x2083f8=this;return new Promise(function(_0x4671a2,_0x232060){return db[_0x70f3('0x19')]['create'](_0x4b9290[_0x70f3('0x1a')],{'raw':_0x4b9290[_0x70f3('0x1b')]?_0x4b9290['options'][_0x70f3('0x1c')]===undefined?!![]:![]:!![]})[_0x70f3('0xc')](function(_0x885527){logger[_0x70f3('0xd')]('CreateFaxMessage',_0x4b9290);logger[_0x70f3('0x10')](_0x70f3('0x18'),_0x4b9290,JSON[_0x70f3('0x12')](_0x885527));_0x4671a2(_0x885527);})[_0x70f3('0x17')](function(_0x4ad76b){logger[_0x70f3('0x13')](_0x70f3('0x18'),_0x4ad76b[_0x70f3('0x15')],_0x4b9290);_0x232060(_0x2083f8[_0x70f3('0x13')](0x1f4,_0x4ad76b[_0x70f3('0x15')]));});});};exports[_0x70f3('0x1d')]=function(_0x2d531e){var _0x59b10b=this;return new Promise(function(_0x4b5a65,_0x4fd840){return db[_0x70f3('0x19')][_0x70f3('0x1e')](_0x2d531e[_0x70f3('0x1a')],{'raw':_0x2d531e[_0x70f3('0x1b')]?_0x2d531e['options'][_0x70f3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d531e[_0x70f3('0x1b')]?_0x2d531e[_0x70f3('0x1b')][_0x70f3('0x1f')]||null:null,'attributes':_0x2d531e[_0x70f3('0x1b')]?_0x2d531e[_0x70f3('0x1b')]['attributes']||null:null,'limit':_0x2d531e['options']?_0x2d531e[_0x70f3('0x1b')]['limit']||null:null})[_0x70f3('0xc')](function(_0x212af9){logger['info']('UpdateFaxMessage',_0x2d531e);logger[_0x70f3('0x10')](_0x70f3('0x1d'),_0x2d531e,JSON[_0x70f3('0x12')](_0x212af9));_0x4b5a65(_0x212af9);})[_0x70f3('0x17')](function(_0x44a32d){logger[_0x70f3('0x13')](_0x70f3('0x1d'),_0x44a32d[_0x70f3('0x15')],_0x2d531e);_0x4fd840(_0x59b10b[_0x70f3('0x13')](0x1f4,_0x44a32d['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index d541406..8c6663c 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x59f0dc,_0x1e2497){var _0x5b5445=function(_0x57ca91){while(--_0x57ca91){_0x59f0dc['push'](_0x59f0dc['shift']());}};_0x5b5445(++_0x1e2497);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 9fdea48..9cfba3a 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 _0x3533=['post','tracked','faxmessage:create','create','put','update','accept','delete','destroy','util','path','connect-timeout','express','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','describe','/:id','/:id/download'];(function(_0x320b9e,_0x1f892f){var _0x5e4416=function(_0x160fcc){while(--_0x160fcc){_0x320b9e['push'](_0x320b9e['shift']());}};_0x5e4416(++_0x1f892f);}(_0x3533,0x198));var _0x3353=function(_0x1550d4,_0x14fc07){_0x1550d4=_0x1550d4-0x0;var _0x3bf747=_0x3533[_0x1550d4];return _0x3bf747;};'use strict';var multer=require('multer');var util=require(_0x3353('0x0'));var path=require(_0x3353('0x1'));var timeout=require(_0x3353('0x2'));var express=require(_0x3353('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3353('0x4'));var config=require('../../config/environment');var controller=require(_0x3353('0x5'));router[_0x3353('0x6')]('/',auth[_0x3353('0x7')](),controller[_0x3353('0x8')]);router['get']('/describe',auth[_0x3353('0x7')](),controller[_0x3353('0x9')]);router[_0x3353('0x6')](_0x3353('0xa'),auth[_0x3353('0x7')](),controller['show']);router[_0x3353('0x6')](_0x3353('0xb'),auth['isAuthenticated'](),controller['download']);router[_0x3353('0xc')]('/',auth['isAuthenticated'](),interaction[_0x3353('0xd')]('fax',_0x3353('0xe')),controller[_0x3353('0xf')]);router[_0x3353('0x10')](_0x3353('0xa'),auth[_0x3353('0x7')](),controller[_0x3353('0x11')]);router[_0x3353('0x10')]('/:id/accept',auth[_0x3353('0x7')](),controller[_0x3353('0x12')]);router[_0x3353('0x10')]('/:id/reject',auth[_0x3353('0x7')](),controller['reject']);router[_0x3353('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x3353('0x14')]);module['exports']=router; \ No newline at end of file +var _0xafbf=['/:id/accept','accept','/:id/reject','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','download','post','tracked','fax','create','put','update'];(function(_0x3cce7c,_0x2557b4){var _0x5edaeb=function(_0x168a6d){while(--_0x168a6d){_0x3cce7c['push'](_0x3cce7c['shift']());}};_0x5edaeb(++_0x2557b4);}(_0xafbf,0x149));var _0xfafb=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xafbf[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xfafb('0x0'));var util=require('util');var path=require(_0xfafb('0x1'));var timeout=require(_0xfafb('0x2'));var express=require(_0xfafb('0x3'));var router=express[_0xfafb('0x4')]();var auth=require(_0xfafb('0x5'));var interaction=require(_0xfafb('0x6'));var config=require('../../config/environment');var controller=require(_0xfafb('0x7'));router[_0xfafb('0x8')]('/',auth[_0xfafb('0x9')](),controller['index']);router['get'](_0xfafb('0xa'),auth['isAuthenticated'](),controller[_0xfafb('0xb')]);router[_0xfafb('0x8')](_0xfafb('0xc'),auth['isAuthenticated'](),controller[_0xfafb('0xd')]);router['get']('/:id/download',auth[_0xfafb('0x9')](),controller[_0xfafb('0xe')]);router[_0xfafb('0xf')]('/',auth[_0xfafb('0x9')](),interaction[_0xfafb('0x10')](_0xfafb('0x11'),'faxmessage:create'),controller[_0xfafb('0x12')]);router[_0xfafb('0x13')](_0xfafb('0xc'),auth[_0xfafb('0x9')](),controller[_0xfafb('0x14')]);router['put'](_0xfafb('0x15'),auth['isAuthenticated'](),controller[_0xfafb('0x16')]);router[_0xfafb('0x13')](_0xfafb('0x17'),auth[_0xfafb('0x9')](),controller['reject']);router['delete']('/:id',auth[_0xfafb('0x9')](),controller[_0xfafb('0x18')]);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 9b4f600..a4ba861 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 _0x89ba=['exports','STRING','ENUM','rrmemory','beepall','roundrobin','INTEGER','sequelize'];(function(_0x8e4003,_0x4c3e23){var _0xa6fc82=function(_0x430acb){while(--_0x430acb){_0x8e4003['push'](_0x8e4003['shift']());}};_0xa6fc82(++_0x4c3e23);}(_0x89ba,0x107));var _0xa89b=function(_0x25cf2a,_0x196f17){_0x25cf2a=_0x25cf2a-0x0;var _0x37fdf5=_0x89ba[_0x25cf2a];return _0x37fdf5;};'use strict';var Sequelize=require(_0xa89b('0x0'));module[_0xa89b('0x1')]={'name':{'type':Sequelize[_0xa89b('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa89b('0x3')](_0xa89b('0x4'),_0xa89b('0x5'),_0xa89b('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa89b('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf5a7=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf5a7,0x166));var _0x7f5a=function(_0x52563d,_0x2d0319){_0x52563d=_0x52563d-0x0;var _0x52e836=_0xf5a7[_0x52563d];return _0x52e836;};'use strict';var Sequelize=require(_0x7f5a('0x0'));module[_0x7f5a('0x1')]={'name':{'type':Sequelize[_0x7f5a('0x2')],'unique':_0x7f5a('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7f5a('0x2')]},'timeout':{'type':Sequelize[_0x7f5a('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7f5a('0x5')](_0x7f5a('0x6'),_0x7f5a('0x7'),_0x7f5a('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x7f5a('0x4')],'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 3e12e94..90368f8 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 _0xcda6=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','destroy','get','UserProfileResource','then','error','stack','name','FaxQueue','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','rows','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','UserProfileSection','userProfileId','autoAssociation','update','describe','findOne','UserFaxQueue','nolimit','FaxQueueId','map','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','teams','findAll','User','Agents','online','voicePause','interface','sequelize','transaction','each','forEach','emit','userFaxQueue:save','removeTeams','ids','select','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','all','union','value','isEmpty','userFaxQueue:remove','omit','spread','removeAgents','isArray','getAgents','html-pdf','zip-dir','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js'];(function(_0x54a2e4,_0x1ff92c){var _0x4742d0=function(_0x147a6f){while(--_0x147a6f){_0x54a2e4['push'](_0x54a2e4['shift']());}};_0x4742d0(++_0x1ff92c);}(_0xcda6,0x18a));var _0x6cda=function(_0x47320d,_0x1c7b17){_0x47320d=_0x47320d-0x0;var _0x380555=_0xcda6[_0x47320d];return _0x380555;};'use strict';var pdf=require(_0x6cda('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6cda('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6cda('0x2'));var path=require(_0x6cda('0x3'));var sox=require(_0x6cda('0x4'));var csv=require(_0x6cda('0x5'));var ejs=require(_0x6cda('0x6'));var fs=require('fs');var _=require(_0x6cda('0x7'));var squel=require(_0x6cda('0x8'));var crypto=require('crypto');var jsforce=require(_0x6cda('0x9'));var deskjs=require(_0x6cda('0xa'));var toCsv=require(_0x6cda('0x5'));var querystring=require(_0x6cda('0xb'));var Papa=require(_0x6cda('0xc'));var Redis=require('ioredis');var authService=require(_0x6cda('0xd'));var qs=require(_0x6cda('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6cda('0xf'));var utils=require('../../config/utils');var config=require(_0x6cda('0x10'));var db=require(_0x6cda('0x11'))['db'];config[_0x6cda('0x12')]=_[_0x6cda('0x13')](config['redis'],{'host':_0x6cda('0x14'),'port':0x18eb});var socket=require(_0x6cda('0x15'))(new Redis(config['redis']));require(_0x6cda('0x16'))['register'](socket);function respondWithStatusCode(_0x2fe7f5,_0x344bef){_0x344bef=_0x344bef||0xcc;return function(_0x4b9be6){if(_0x4b9be6){return _0x2fe7f5[_0x6cda('0x17')](_0x344bef);}return _0x2fe7f5[_0x6cda('0x18')](_0x344bef)[_0x6cda('0x19')]();};}function respondWithResult(_0x41f2aa,_0x53fd40){_0x53fd40=_0x53fd40||0xc8;return function(_0x2a9be4){if(_0x2a9be4){return _0x41f2aa[_0x6cda('0x18')](_0x53fd40)[_0x6cda('0x1a')](_0x2a9be4);}};}function respondWithFilteredResult(_0xf84b40,_0x1ffa5a){return function(_0x200c29){if(_0x200c29){var _0x2acb72=_0x200c29[_0x6cda('0x1b')],_0xd7a5e2=_0x1ffa5a[_0x6cda('0x1c')],_0x342fba=_0x1ffa5a[_0x6cda('0x1c')]+_0x1ffa5a[_0x6cda('0x1d')],_0x42979b;if(_0x342fba>=_0x2acb72){_0x342fba=_0x2acb72;_0x42979b=0xc8;}else{_0x42979b=0xce;}_0xf84b40['status'](_0x42979b);return _0xf84b40[_0x6cda('0x1e')](_0x6cda('0x1f'),_0xd7a5e2+'-'+_0x342fba+'/'+_0x2acb72)[_0x6cda('0x1a')](_0x200c29);}return null;};}function patchUpdates(_0x39e3ac){return function(_0x20d4ef){try{jsonpatch[_0x6cda('0x20')](_0x20d4ef,_0x39e3ac,!![]);}catch(_0x116b51){return BPromise[_0x6cda('0x21')](_0x116b51);}return _0x20d4ef['save']();};}function saveUpdates(_0xacd6e1,_0x569bd2){return function(_0x3ba9ab){if(_0x3ba9ab){return _0x3ba9ab['update'](_0xacd6e1)['then'](function(_0x38b60b){return _0x38b60b;});}return null;};}function removeEntity(_0x6c18ed,_0x510571){return function(_0x5d932b){if(_0x5d932b){return _0x5d932b[_0x6cda('0x22')]()['then'](function(){var _0x166d31=_0x5d932b[_0x6cda('0x23')]({'plain':!![]});var _0x3ad326='FaxQueues';return db[_0x6cda('0x24')][_0x6cda('0x22')]({'where':{'type':_0x3ad326,'resourceId':_0x166d31['id']}})[_0x6cda('0x25')](function(){return _0x5d932b;});})[_0x6cda('0x25')](function(){_0x6c18ed[_0x6cda('0x18')](0xcc)[_0x6cda('0x19')]();});}};}function handleEntityNotFound(_0x331322,_0x4ceb62){return function(_0xe954fe){if(!_0xe954fe){_0x331322[_0x6cda('0x17')](0x194);}return _0xe954fe;};}function handleError(_0x2ce012,_0x25b512){_0x25b512=_0x25b512||0x1f4;return function(_0x4a103d){logger[_0x6cda('0x26')](_0x4a103d[_0x6cda('0x27')]);if(_0x4a103d[_0x6cda('0x28')]){delete _0x4a103d[_0x6cda('0x28')];}_0x2ce012[_0x6cda('0x18')](_0x25b512)['send'](_0x4a103d);};}exports['index']=function(_0x50c92b,_0x55ba43){var _0x2bf441={},_0x891605={},_0x4a2fae={'count':0x0,'rows':[]};var _0x45345a=db[_0x6cda('0x29')]['rawAttributes'];_0x891605[_0x6cda('0x2a')]=_[_0x6cda('0x2b')](_0x45345a);_0x891605[_0x6cda('0x2c')]=_[_0x6cda('0x2b')](_0x50c92b[_0x6cda('0x2c')]);_0x891605[_0x6cda('0x2d')]=_[_0x6cda('0x2e')](_0x891605['model'],_0x891605['query']);_0x2bf441[_0x6cda('0x2f')]=_[_0x6cda('0x2e')](_0x891605[_0x6cda('0x2a')],qs[_0x6cda('0x30')](_0x50c92b[_0x6cda('0x2c')][_0x6cda('0x30')]));_0x2bf441['attributes']=_0x2bf441[_0x6cda('0x2f')][_0x6cda('0x31')]?_0x2bf441[_0x6cda('0x2f')]:_0x891605['model'];if(!_0x50c92b['query'][_0x6cda('0x32')]('nolimit')){_0x2bf441[_0x6cda('0x1d')]=qs[_0x6cda('0x1d')](_0x50c92b[_0x6cda('0x2c')][_0x6cda('0x1d')]);_0x2bf441[_0x6cda('0x1c')]=qs['offset'](_0x50c92b['query'][_0x6cda('0x1c')]);}_0x2bf441[_0x6cda('0x33')]=qs[_0x6cda('0x34')](_0x50c92b[_0x6cda('0x2c')][_0x6cda('0x34')]);_0x2bf441[_0x6cda('0x35')]=qs[_0x6cda('0x2d')](_[_0x6cda('0x36')](_0x50c92b[_0x6cda('0x2c')],_0x891605[_0x6cda('0x2d')]));if(_0x50c92b[_0x6cda('0x2c')][_0x6cda('0x37')]){_0x2bf441[_0x6cda('0x35')]=_[_0x6cda('0x38')](_0x2bf441[_0x6cda('0x35')],{'$or':_['map'](_0x45345a,function(_0x4cfefe){if(_0x4cfefe[_0x6cda('0x39')][_0x6cda('0x3a')]!==_0x6cda('0x3b')){var _0x29909e={};_0x29909e[_0x4cfefe[_0x6cda('0x3c')]]={'$like':'%'+_0x50c92b[_0x6cda('0x2c')][_0x6cda('0x37')]+'%'};return _0x29909e;}})});}_0x2bf441=_[_0x6cda('0x38')]({},_0x2bf441,_0x50c92b[_0x6cda('0x3d')]);var _0x12f6e6={'where':_0x2bf441[_0x6cda('0x35')]};return db['FaxQueue'][_0x6cda('0x1b')](_0x12f6e6)[_0x6cda('0x25')](function(_0xe0946c){_0x4a2fae[_0x6cda('0x1b')]=_0xe0946c;if(_0x50c92b[_0x6cda('0x2c')][_0x6cda('0x3e')]){_0x2bf441[_0x6cda('0x3f')]=[{'all':!![]}];}return db[_0x6cda('0x29')]['findAll'](_0x2bf441);})[_0x6cda('0x25')](function(_0x3b62cb){_0x4a2fae[_0x6cda('0x40')]=_0x3b62cb;return _0x4a2fae;})[_0x6cda('0x25')](respondWithFilteredResult(_0x55ba43,_0x2bf441))['catch'](handleError(_0x55ba43,null));};exports['show']=function(_0x9a277,_0x2c77df){var _0x4cf7dd={'raw':!![],'where':{'id':_0x9a277[_0x6cda('0x41')]['id']}},_0x5a57ba={};_0x5a57ba[_0x6cda('0x2a')]=_[_0x6cda('0x2b')](db[_0x6cda('0x29')][_0x6cda('0x42')]);_0x5a57ba[_0x6cda('0x2c')]=_['keys'](_0x9a277['query']);_0x5a57ba[_0x6cda('0x2d')]=_[_0x6cda('0x2e')](_0x5a57ba[_0x6cda('0x2a')],_0x5a57ba[_0x6cda('0x2c')]);_0x4cf7dd[_0x6cda('0x2f')]=_['intersection'](_0x5a57ba['model'],qs[_0x6cda('0x30')](_0x9a277[_0x6cda('0x2c')][_0x6cda('0x30')]));_0x4cf7dd[_0x6cda('0x2f')]=_0x4cf7dd[_0x6cda('0x2f')][_0x6cda('0x31')]?_0x4cf7dd['attributes']:_0x5a57ba[_0x6cda('0x2a')];if(_0x9a277[_0x6cda('0x2c')][_0x6cda('0x3e')]){_0x4cf7dd[_0x6cda('0x3f')]=[{'all':!![]}];}_0x4cf7dd=_[_0x6cda('0x38')]({},_0x4cf7dd,_0x9a277[_0x6cda('0x3d')]);return db['FaxQueue'][_0x6cda('0x43')](_0x4cf7dd)[_0x6cda('0x25')](handleEntityNotFound(_0x2c77df,null))[_0x6cda('0x25')](respondWithResult(_0x2c77df,null))[_0x6cda('0x44')](handleError(_0x2c77df,null));};exports[_0x6cda('0x45')]=function(_0x5997a6,_0x358195){return db[_0x6cda('0x29')][_0x6cda('0x45')](_0x5997a6[_0x6cda('0x46')],{})[_0x6cda('0x25')](function(_0x59ca53){var _0x4d6b93=_0x5997a6[_0x6cda('0x47')][_0x6cda('0x23')]({'plain':!![]});if(!_0x4d6b93)throw new Error(_0x6cda('0x48'));if(_0x4d6b93[_0x6cda('0x49')]===_0x6cda('0x47')){var _0x29bf27=_0x59ca53[_0x6cda('0x23')]({'plain':!![]});var _0xcb29cc=_0x6cda('0x4a');return db[_0x6cda('0x4b')][_0x6cda('0x43')]({'where':{'name':_0xcb29cc,'userProfileId':_0x4d6b93[_0x6cda('0x4c')]},'raw':!![]})[_0x6cda('0x25')](function(_0x2f5a9e){if(_0x2f5a9e&&_0x2f5a9e[_0x6cda('0x4d')]===0x0){return db[_0x6cda('0x24')][_0x6cda('0x45')]({'name':_0x29bf27[_0x6cda('0x28')],'resourceId':_0x29bf27['id'],'type':_0x2f5a9e['name'],'sectionId':_0x2f5a9e['id']},{})[_0x6cda('0x25')](function(){return _0x59ca53;});}else{return _0x59ca53;}})[_0x6cda('0x44')](function(_0x3525fd){logger[_0x6cda('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3525fd);throw _0x3525fd;});}return _0x59ca53;})[_0x6cda('0x25')](respondWithResult(_0x358195,0xc9))[_0x6cda('0x44')](handleError(_0x358195,null));};exports[_0x6cda('0x4e')]=function(_0x28aab2,_0x130512){if(_0x28aab2[_0x6cda('0x46')]['id']){delete _0x28aab2['body']['id'];}return db['FaxQueue'][_0x6cda('0x43')]({'where':{'id':_0x28aab2[_0x6cda('0x41')]['id']}})[_0x6cda('0x25')](handleEntityNotFound(_0x130512,null))[_0x6cda('0x25')](saveUpdates(_0x28aab2[_0x6cda('0x46')],null))[_0x6cda('0x25')](respondWithResult(_0x130512,null))[_0x6cda('0x44')](handleError(_0x130512,null));};exports[_0x6cda('0x22')]=function(_0x4dacdf,_0x5f34fb){return db[_0x6cda('0x29')][_0x6cda('0x43')]({'where':{'id':_0x4dacdf[_0x6cda('0x41')]['id']}})[_0x6cda('0x25')](handleEntityNotFound(_0x5f34fb,null))[_0x6cda('0x25')](removeEntity(_0x5f34fb,null))[_0x6cda('0x44')](handleError(_0x5f34fb,null));};exports[_0x6cda('0x4f')]=function(_0x1a520c,_0x4e8aa0){return db[_0x6cda('0x29')][_0x6cda('0x4f')]()['then'](respondWithResult(_0x4e8aa0,null))[_0x6cda('0x44')](handleError(_0x4e8aa0,null));};exports['getMembers']=function(_0x2b1a70,_0x369b24,_0x2e74b4){var _0x122a8b={'raw':!![],'where':{}},_0x463af4={},_0x12aba7;return db[_0x6cda('0x29')][_0x6cda('0x50')]({'where':{'id':_0x2b1a70[_0x6cda('0x41')]['id']}})[_0x6cda('0x25')](handleEntityNotFound(_0x369b24,null))[_0x6cda('0x25')](function(_0x3ed899){if(_0x3ed899){_0x12aba7=_0x3ed899[_0x6cda('0x23')]({'plain':!![]});_0x463af4['model']=_[_0x6cda('0x2b')](db[_0x6cda('0x51')][_0x6cda('0x42')]);_0x463af4['query']=_['keys'](_0x2b1a70['query']);_0x463af4[_0x6cda('0x2d')]=_[_0x6cda('0x2e')](_0x463af4[_0x6cda('0x2a')],_0x463af4[_0x6cda('0x2c')]);_0x122a8b['attributes']=_['intersection'](_0x463af4[_0x6cda('0x2a')],qs[_0x6cda('0x30')](_0x2b1a70['query']['fields']));_0x122a8b[_0x6cda('0x2f')]=_0x122a8b[_0x6cda('0x2f')]['length']?_0x122a8b[_0x6cda('0x2f')]:_0x463af4[_0x6cda('0x2a')];if(!_0x2b1a70[_0x6cda('0x2c')][_0x6cda('0x32')](_0x6cda('0x52'))){_0x122a8b[_0x6cda('0x1d')]=qs[_0x6cda('0x1d')](_0x2b1a70[_0x6cda('0x2c')]['limit']);_0x122a8b[_0x6cda('0x1c')]=qs[_0x6cda('0x1c')](_0x2b1a70['query'][_0x6cda('0x1c')]);}_0x122a8b[_0x6cda('0x33')]=qs[_0x6cda('0x34')](_0x2b1a70[_0x6cda('0x2c')][_0x6cda('0x34')]);_0x122a8b[_0x6cda('0x35')]=qs[_0x6cda('0x2d')](_['pick'](_0x2b1a70[_0x6cda('0x2c')],_0x463af4[_0x6cda('0x2d')]));_0x122a8b[_0x6cda('0x35')][_0x6cda('0x53')]=_0x3ed899['id'];if(_0x2b1a70[_0x6cda('0x2c')][_0x6cda('0x37')]){_0x122a8b[_0x6cda('0x35')]=_[_0x6cda('0x38')](_0x122a8b[_0x6cda('0x35')],{'$or':_[_0x6cda('0x54')](_0x122a8b[_0x6cda('0x2f')],function(_0x57a94d){var _0x4e0220={};_0x4e0220[_0x57a94d]={'$like':'%'+_0x2b1a70[_0x6cda('0x2c')][_0x6cda('0x37')]+'%'};return _0x4e0220;})});}_0x122a8b=_['merge']({},_0x122a8b,_0x2b1a70[_0x6cda('0x3d')]);return db[_0x6cda('0x51')]['findAll'](_0x122a8b);}})[_0x6cda('0x25')](function(_0x8df71f){if(_0x8df71f){return db['User'][_0x6cda('0x55')]({'where':{'id':_[_0x6cda('0x54')](_0x8df71f,_0x6cda('0x56')),'role':_0x6cda('0x57')},'attributes':['id',_0x6cda('0x28'),_0x6cda('0x58'),_0x6cda('0x59'),_0x6cda('0x5a')]});}})[_0x6cda('0x25')](function(_0x5d3ef8){if(_0x5d3ef8){return{'count':_0x5d3ef8[_0x6cda('0x1b')],'rows':_[_0x6cda('0x54')](_0x5d3ef8[_0x6cda('0x40')],function(_0x5497f1){return{'membername':_0x5497f1['name'],'UserId':_0x5497f1['id'],'queue_name':_0x12aba7[_0x6cda('0x28')],'FaxQueueId':_0x12aba7['id'],'interface':util[_0x6cda('0x5b')](_0x6cda('0x5c'),_0x6cda('0x5d'),_0x5497f1[_0x6cda('0x28')]),'penalty':0x0,'paused':_0x5497f1[_0x6cda('0x58')],'createdAt':_0x5497f1[_0x6cda('0x5a')],'updatedAt':_0x5497f1['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6cda('0x25')](respondWithFilteredResult(_0x369b24,_0x122a8b))[_0x6cda('0x44')](handleError(_0x369b24,null));};exports[_0x6cda('0x5e')]=function(_0x5533c3,_0x325931,_0x17bbff){var _0x503cbb={};var _0x1a447d={};var _0x2a69f3;var _0x531e3a;return db[_0x6cda('0x29')][_0x6cda('0x50')]({'where':{'id':_0x5533c3[_0x6cda('0x41')]['id']}})[_0x6cda('0x25')](handleEntityNotFound(_0x325931,null))[_0x6cda('0x25')](function(_0x5a27b6){if(_0x5a27b6){_0x2a69f3=_0x5a27b6;_0x1a447d['model']=_[_0x6cda('0x2b')](db[_0x6cda('0x5f')][_0x6cda('0x42')]);_0x1a447d['query']=_[_0x6cda('0x2b')](_0x5533c3[_0x6cda('0x2c')]);_0x1a447d[_0x6cda('0x2d')]=_[_0x6cda('0x2e')](_0x1a447d['model'],_0x1a447d[_0x6cda('0x2c')]);_0x503cbb[_0x6cda('0x2f')]=_[_0x6cda('0x2e')](_0x1a447d[_0x6cda('0x2a')],qs['fields'](_0x5533c3['query']['fields']));_0x503cbb['attributes']=_0x503cbb['attributes']['length']?_0x503cbb[_0x6cda('0x2f')]:_0x1a447d[_0x6cda('0x2a')];_0x503cbb[_0x6cda('0x33')]=qs[_0x6cda('0x34')](_0x5533c3[_0x6cda('0x2c')][_0x6cda('0x34')]);_0x503cbb[_0x6cda('0x35')]=qs[_0x6cda('0x2d')](_['pick'](_0x5533c3[_0x6cda('0x2c')],_0x1a447d[_0x6cda('0x2d')]));if(_0x5533c3[_0x6cda('0x2c')][_0x6cda('0x37')]){_0x503cbb[_0x6cda('0x35')]=_[_0x6cda('0x38')](_0x503cbb[_0x6cda('0x35')],{'$or':_['map'](_0x503cbb['attributes'],function(_0x5aee7a){var _0x5352c1={};_0x5352c1[_0x5aee7a]={'$like':'%'+_0x5533c3[_0x6cda('0x2c')][_0x6cda('0x37')]+'%'};return _0x5352c1;})});}_0x503cbb=_[_0x6cda('0x38')]({},_0x503cbb,_0x5533c3[_0x6cda('0x3d')]);return _0x2a69f3[_0x6cda('0x5e')](_0x503cbb);}})[_0x6cda('0x25')](function(_0x2a48ba){if(_0x2a48ba){_0x531e3a=_0x2a48ba['length'];if(!_0x5533c3['query'][_0x6cda('0x32')](_0x6cda('0x52'))){_0x503cbb[_0x6cda('0x1d')]=qs['limit'](_0x5533c3[_0x6cda('0x2c')][_0x6cda('0x1d')]);_0x503cbb[_0x6cda('0x1c')]=qs[_0x6cda('0x1c')](_0x5533c3[_0x6cda('0x2c')][_0x6cda('0x1c')]);}return _0x2a69f3[_0x6cda('0x5e')](_0x503cbb);}})['then'](function(_0x563028){if(_0x563028){return _0x563028?{'count':_0x531e3a,'rows':_0x563028}:null;}})['then'](respondWithResult(_0x325931,null))[_0x6cda('0x44')](handleError(_0x325931,null));};exports[_0x6cda('0x60')]=function(_0x15a79d,_0x34398d,_0x168d81){var _0x51eda6=_0x15a79d[_0x6cda('0x46')][_0x6cda('0x61')];return db[_0x6cda('0x5f')][_0x6cda('0x62')]({'where':{'id':_[_0x6cda('0x54')](_0x51eda6,'id')},'attributes':['id'],'include':[{'model':db[_0x6cda('0x63')],'as':_0x6cda('0x64'),'attributes':['id','name',_0x6cda('0x65'),_0x6cda('0x66'),_0x6cda('0x67')],'raw':!![]}]})['then'](function(_0x26684b){if(_0x26684b){var _0x2192df=_['flatMap'](_0x26684b,function(_0x5d66ea){var _0x1ce9e1=_0x5d66ea[_0x6cda('0x23')]({'plain':!![]});return _0x1ce9e1[_0x6cda('0x64')];});return db[_0x6cda('0x29')][_0x6cda('0x43')]({'where':{'id':_0x15a79d['params']['id']}})[_0x6cda('0x25')](function(_0x2393ed){return db[_0x6cda('0x68')][_0x6cda('0x69')](function(_0x1ad913){return _0x2393ed[_0x6cda('0x60')](_[_0x6cda('0x54')](_0x51eda6,'id'),{'transaction':_0x1ad913})['then'](function(){return BPromise[_0x6cda('0x6a')](_0x2192df,function(_0x41bbf5){return db[_0x6cda('0x51')]['findOrCreate']({'where':{'UserId':_0x41bbf5['id'],'FaxQueueId':_0x15a79d[_0x6cda('0x41')]['id']},'transaction':_0x1ad913});});})[_0x6cda('0x25')](function(){_0x2192df[_0x6cda('0x6b')](function(_0x1514b8){socket[_0x6cda('0x6c')](_0x6cda('0x6d'),{'UserId':_0x1514b8['id'],'FaxQueueId':_0x2393ed['id']});});});});});}})[_0x6cda('0x25')](respondWithStatusCode(_0x34398d,null))['catch'](handleError(_0x34398d,null));};exports[_0x6cda('0x6e')]=function(_0x4a4e48,_0x47352e,_0x30e424){return db[_0x6cda('0x5f')][_0x6cda('0x62')]({'where':{'id':_0x4a4e48[_0x6cda('0x2c')][_0x6cda('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x6cda('0x63')],'as':_0x6cda('0x64'),'attributes':['id'],'raw':!![]}]})[_0x6cda('0x25')](handleEntityNotFound(_0x47352e,null))[_0x6cda('0x25')](function(_0x53901c){var _0x41bd86=_['map'](_0x53901c,'id');var _0x24fa79=[];var _0x4adba0=[];var _0x57306f=squel[_0x6cda('0x70')]();_0x57306f[_0x6cda('0x3c')]('tq.TeamId')[_0x6cda('0x71')](_0x6cda('0x72'),'tq')[_0x6cda('0x73')](_0x6cda('0x74'),'ut',_0x6cda('0x75'))[_0x6cda('0x35')](_0x6cda('0x76'),_0x4a4e48[_0x6cda('0x41')]['id']);for(var _0x5dbed0=0x0;_0x5dbed0<_0x53901c[_0x6cda('0x31')];_0x5dbed0+=0x1){let _0x21e632=_0x53901c[_0x5dbed0];for(var _0x1ac1da=0x0;_0x1ac1da<_0x21e632[_0x6cda('0x64')][_0x6cda('0x31')];_0x1ac1da+=0x1){let _0x11441c=_0x21e632[_0x6cda('0x64')][_0x1ac1da];var _0x4ec965=_0x57306f[_0x6cda('0x77')]();_0x4ec965['where'](_0x6cda('0x78'),_0x11441c['id']);_0x4adba0[_0x6cda('0x79')](db[_0x6cda('0x68')][_0x6cda('0x2c')](_0x4ec965['toString'](),{'type':db['sequelize'][_0x6cda('0x7a')][_0x6cda('0x7b')]})[_0x6cda('0x25')](function(_0x51e353){if(_0x51e353[_0x6cda('0x31')]===0x1){return _0x11441c['id'];}else{var _0x49561a=_['every'](_[_0x6cda('0x54')](_0x51e353,_0x6cda('0x7c')),function(_0x4772c0){return _['includes'](_0x41bd86,_0x4772c0);});if(_0x49561a){return _0x11441c['id'];}}}));}}return BPromise[_0x6cda('0x7d')](_0x4adba0)[_0x6cda('0x25')](function(_0x579bc0){_0x24fa79=_(_0x24fa79)[_0x6cda('0x7e')](_0x579bc0)['compact']()[_0x6cda('0x7f')]();return db[_0x6cda('0x29')]['find']({'where':{'id':_0x4a4e48[_0x6cda('0x41')]['id']}})[_0x6cda('0x25')](function(_0x241373){return db['sequelize'][_0x6cda('0x69')](function(_0x2c0042){return _0x241373['removeTeams'](_0x4a4e48[_0x6cda('0x2c')][_0x6cda('0x6f')],{'transaction':_0x2c0042})['then'](function(){if(!_[_0x6cda('0x80')](_0x24fa79)){return _0x241373['removeAgents'](_0x24fa79,{'transaction':_0x2c0042});}})[_0x6cda('0x25')](function(){_0x24fa79[_0x6cda('0x6b')](function(_0x2fe236){socket['emit'](_0x6cda('0x81'),{'UserId':_0x2fe236,'FaxQueueId':_0x241373['id']});});});});});});})[_0x6cda('0x25')](respondWithStatusCode(_0x47352e,null))[_0x6cda('0x44')](handleError(_0x47352e,null));};exports['addAgents']=function(_0xe26ae7,_0x4ec70b,_0x5a03fe){return db[_0x6cda('0x29')][_0x6cda('0x43')]({'where':{'id':_0xe26ae7['params']['id']}})['then'](handleEntityNotFound(_0x4ec70b,null))[_0x6cda('0x25')](function(_0x2f22c7){if(_0x2f22c7){return _0x2f22c7['addAgents'](_0xe26ae7[_0x6cda('0x46')][_0x6cda('0x6f')],_[_0x6cda('0x82')](_0xe26ae7[_0x6cda('0x46')],['ids','id'])||{})[_0x6cda('0x83')](function(_0x5f0dbc){for(var _0x8fce0d=0x0;_0x8fce0d<_0xe26ae7[_0x6cda('0x46')][_0x6cda('0x6f')][_0x6cda('0x31')];_0x8fce0d+=0x1){socket[_0x6cda('0x6c')](_0x6cda('0x6d'),{'UserId':_0xe26ae7[_0x6cda('0x46')][_0x6cda('0x6f')][_0x8fce0d],'FaxQueueId':_0xe26ae7[_0x6cda('0x41')]['id']});}return _0x5f0dbc;});}})[_0x6cda('0x25')](respondWithResult(_0x4ec70b,null))[_0x6cda('0x44')](handleError(_0x4ec70b,null));};exports[_0x6cda('0x84')]=function(_0x57bc22,_0xd79fd5,_0x146807){return db['FaxQueue']['find']({'where':{'id':_0x57bc22[_0x6cda('0x41')]['id']}})[_0x6cda('0x25')](handleEntityNotFound(_0xd79fd5,null))[_0x6cda('0x25')](function(_0x79782){if(_0x79782){return _0x79782[_0x6cda('0x84')](_0x57bc22['query'][_0x6cda('0x6f')])['then'](function(){if(_[_0x6cda('0x85')](_0x57bc22[_0x6cda('0x2c')]['ids'])){for(var _0x33b882=0x0;_0x33b882<_0x57bc22[_0x6cda('0x2c')][_0x6cda('0x6f')]['length'];_0x33b882+=0x1){socket[_0x6cda('0x6c')](_0x6cda('0x81'),{'UserId':Number(_0x57bc22[_0x6cda('0x2c')]['ids'][_0x33b882]),'FaxQueueId':Number(_0x57bc22[_0x6cda('0x41')]['id'])});}}else{socket[_0x6cda('0x6c')](_0x6cda('0x81'),{'UserId':Number(_0x57bc22['query'][_0x6cda('0x6f')]),'FaxQueueId':Number(_0x57bc22[_0x6cda('0x41')]['id'])});}});}})[_0x6cda('0x25')](respondWithStatusCode(_0xd79fd5,null))['catch'](handleError(_0xd79fd5,null));};exports[_0x6cda('0x86')]=function(_0x954912,_0x567ac7,_0x35353f){var _0x2d5daa={};var _0x453ae4={};var _0x141b9d;var _0x4f52d5;return db[_0x6cda('0x29')][_0x6cda('0x50')]({'where':{'id':_0x954912[_0x6cda('0x41')]['id']}})[_0x6cda('0x25')](handleEntityNotFound(_0x567ac7,null))[_0x6cda('0x25')](function(_0x32bc1a){if(_0x32bc1a){_0x141b9d=_0x32bc1a;_0x453ae4[_0x6cda('0x2a')]=_[_0x6cda('0x2b')](db['User']['rawAttributes']);_0x453ae4['query']=_[_0x6cda('0x2b')](_0x954912[_0x6cda('0x2c')]);_0x453ae4[_0x6cda('0x2d')]=_['intersection'](_0x453ae4[_0x6cda('0x2a')],_0x453ae4['query']);_0x2d5daa[_0x6cda('0x2f')]=_[_0x6cda('0x2e')](_0x453ae4[_0x6cda('0x2a')],qs[_0x6cda('0x30')](_0x954912[_0x6cda('0x2c')][_0x6cda('0x30')]));_0x2d5daa['attributes']=_0x2d5daa['attributes']['length']?_0x2d5daa['attributes']:_0x453ae4[_0x6cda('0x2a')];_0x2d5daa[_0x6cda('0x33')]=qs[_0x6cda('0x34')](_0x954912[_0x6cda('0x2c')][_0x6cda('0x34')]);_0x2d5daa[_0x6cda('0x35')]=qs[_0x6cda('0x2d')](_['pick'](_0x954912[_0x6cda('0x2c')],_0x453ae4[_0x6cda('0x2d')]));if(_0x954912['query'][_0x6cda('0x37')]){_0x2d5daa[_0x6cda('0x35')]=_[_0x6cda('0x38')](_0x2d5daa[_0x6cda('0x35')],{'$or':_[_0x6cda('0x54')](_0x2d5daa[_0x6cda('0x2f')],function(_0x4c71d9){var _0x2eae4c={};_0x2eae4c[_0x4c71d9]={'$like':'%'+_0x954912[_0x6cda('0x2c')][_0x6cda('0x37')]+'%'};return _0x2eae4c;})});}_0x2d5daa=_[_0x6cda('0x38')]({},_0x2d5daa,_0x954912[_0x6cda('0x3d')]);return _0x141b9d[_0x6cda('0x86')](_0x2d5daa);}})[_0x6cda('0x25')](function(_0xf38fe2){if(_0xf38fe2){_0x4f52d5=_0xf38fe2[_0x6cda('0x31')];if(!_0x954912['query'][_0x6cda('0x32')]('nolimit')){_0x2d5daa[_0x6cda('0x1d')]=qs['limit'](_0x954912['query'][_0x6cda('0x1d')]);_0x2d5daa[_0x6cda('0x1c')]=qs[_0x6cda('0x1c')](_0x954912[_0x6cda('0x2c')][_0x6cda('0x1c')]);}return _0x141b9d['getAgents'](_0x2d5daa);}})[_0x6cda('0x25')](function(_0x5f0445){if(_0x5f0445){return _0x5f0445?{'count':_0x4f52d5,'rows':_0x5f0445}:null;}})[_0x6cda('0x25')](respondWithResult(_0x567ac7,null))[_0x6cda('0x44')](handleError(_0x567ac7,null));}; \ No newline at end of file +var _0xbd66=['transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','ids','select','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','compact','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','getAgents','html-pdf','rimraf','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','stack','name','send','index','FaxQueue','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','include','rows','catch','show','includeAll','create','UserProfileSection','find','userProfileId','autoAssociation','error','body','params','describe','getMembers','findOne','UserFaxQueue','order','FaxQueueId','findAll','findAndCountAll','agent','faxPause','updatedAt','createdAt','format','Team','getTeams','addTeams','teams','User','Agents','voicePause','interface','flatMap','sequelize'];(function(_0x5111a9,_0x353fa5){var _0x59a15a=function(_0x32bdbf){while(--_0x32bdbf){_0x5111a9['push'](_0x5111a9['shift']());}};_0x59a15a(++_0x353fa5);}(_0xbd66,0x1c0));var _0x6bd6=function(_0x332ba2,_0x2d513b){_0x332ba2=_0x332ba2-0x0;var _0x525d35=_0xbd66[_0x332ba2];return _0x525d35;};'use strict';var pdf=require(_0x6bd6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6bd6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6bd6('0x2'));var moment=require(_0x6bd6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6bd6('0x4'));var util=require(_0x6bd6('0x5'));var path=require(_0x6bd6('0x6'));var sox=require(_0x6bd6('0x7'));var csv=require('to-csv');var ejs=require(_0x6bd6('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6bd6('0x9'));var crypto=require(_0x6bd6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6bd6('0xb'));var toCsv=require(_0x6bd6('0xc'));var querystring=require(_0x6bd6('0xd'));var Papa=require(_0x6bd6('0xe'));var Redis=require(_0x6bd6('0xf'));var authService=require(_0x6bd6('0x10'));var qs=require(_0x6bd6('0x11'));var hardwareService=require(_0x6bd6('0x12'));var logger=require(_0x6bd6('0x13'))('api');var utils=require(_0x6bd6('0x14'));var config=require(_0x6bd6('0x15'));var db=require('../../mysqldb')['db'];config[_0x6bd6('0x16')]=_[_0x6bd6('0x17')](config[_0x6bd6('0x16')],{'host':_0x6bd6('0x18'),'port':0x18eb});var socket=require(_0x6bd6('0x19'))(new Redis(config['redis']));require(_0x6bd6('0x1a'))[_0x6bd6('0x1b')](socket);function respondWithStatusCode(_0x302c44,_0xe9a93b){_0xe9a93b=_0xe9a93b||0xcc;return function(_0x17953e){if(_0x17953e){return _0x302c44[_0x6bd6('0x1c')](_0xe9a93b);}return _0x302c44[_0x6bd6('0x1d')](_0xe9a93b)[_0x6bd6('0x1e')]();};}function respondWithResult(_0x4598da,_0x5d4f69){_0x5d4f69=_0x5d4f69||0xc8;return function(_0x56117a){if(_0x56117a){return _0x4598da[_0x6bd6('0x1d')](_0x5d4f69)[_0x6bd6('0x1f')](_0x56117a);}};}function respondWithFilteredResult(_0xda0e3e,_0x144674){return function(_0x214c6d){if(_0x214c6d){var _0x248cb3=_0x214c6d[_0x6bd6('0x20')],_0x33655b=_0x144674[_0x6bd6('0x21')],_0x3b76be=_0x144674['offset']+_0x144674[_0x6bd6('0x22')],_0x5d4fd8;if(_0x3b76be>=_0x248cb3){_0x3b76be=_0x248cb3;_0x5d4fd8=0xc8;}else{_0x5d4fd8=0xce;}_0xda0e3e[_0x6bd6('0x1d')](_0x5d4fd8);return _0xda0e3e['set'](_0x6bd6('0x23'),_0x33655b+'-'+_0x3b76be+'/'+_0x248cb3)[_0x6bd6('0x1f')](_0x214c6d);}return null;};}function patchUpdates(_0x163cb3){return function(_0x5eafad){try{jsonpatch[_0x6bd6('0x24')](_0x5eafad,_0x163cb3,!![]);}catch(_0x1185eb){return BPromise[_0x6bd6('0x25')](_0x1185eb);}return _0x5eafad[_0x6bd6('0x26')]();};}function saveUpdates(_0x60fcf4,_0x1bea98){return function(_0x2923ca){if(_0x2923ca){return _0x2923ca[_0x6bd6('0x27')](_0x60fcf4)[_0x6bd6('0x28')](function(_0x5b5839){return _0x5b5839;});}return null;};}function removeEntity(_0x3235b1,_0x2357bd){return function(_0x3a1518){if(_0x3a1518){return _0x3a1518[_0x6bd6('0x29')]()[_0x6bd6('0x28')](function(){var _0x1306e0=_0x3a1518[_0x6bd6('0x2a')]({'plain':!![]});var _0x27483a=_0x6bd6('0x2b');return db[_0x6bd6('0x2c')]['destroy']({'where':{'type':_0x27483a,'resourceId':_0x1306e0['id']}})['then'](function(){return _0x3a1518;});})[_0x6bd6('0x28')](function(){_0x3235b1[_0x6bd6('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17b472,_0x60d09e){return function(_0x4b1328){if(!_0x4b1328){_0x17b472['sendStatus'](0x194);}return _0x4b1328;};}function handleError(_0x598f86,_0x5780c8){_0x5780c8=_0x5780c8||0x1f4;return function(_0x189d13){logger['error'](_0x189d13[_0x6bd6('0x2d')]);if(_0x189d13[_0x6bd6('0x2e')]){delete _0x189d13[_0x6bd6('0x2e')];}_0x598f86[_0x6bd6('0x1d')](_0x5780c8)[_0x6bd6('0x2f')](_0x189d13);};}exports[_0x6bd6('0x30')]=function(_0x3b44de,_0x5a53db){var _0x8a2288={},_0x474f48={},_0x5a0503={'count':0x0,'rows':[]};var _0x385715=db[_0x6bd6('0x31')][_0x6bd6('0x32')];_0x474f48[_0x6bd6('0x33')]=_[_0x6bd6('0x34')](_0x385715);_0x474f48['query']=_[_0x6bd6('0x34')](_0x3b44de['query']);_0x474f48[_0x6bd6('0x35')]=_[_0x6bd6('0x36')](_0x474f48[_0x6bd6('0x33')],_0x474f48[_0x6bd6('0x37')]);_0x8a2288[_0x6bd6('0x38')]=_['intersection'](_0x474f48[_0x6bd6('0x33')],qs[_0x6bd6('0x39')](_0x3b44de[_0x6bd6('0x37')][_0x6bd6('0x39')]));_0x8a2288['attributes']=_0x8a2288[_0x6bd6('0x38')][_0x6bd6('0x3a')]?_0x8a2288['attributes']:_0x474f48[_0x6bd6('0x33')];if(!_0x3b44de['query'][_0x6bd6('0x3b')](_0x6bd6('0x3c'))){_0x8a2288[_0x6bd6('0x22')]=qs[_0x6bd6('0x22')](_0x3b44de['query'][_0x6bd6('0x22')]);_0x8a2288[_0x6bd6('0x21')]=qs['offset'](_0x3b44de[_0x6bd6('0x37')][_0x6bd6('0x21')]);}_0x8a2288['order']=qs[_0x6bd6('0x3d')](_0x3b44de[_0x6bd6('0x37')]['sort']);_0x8a2288['where']=qs[_0x6bd6('0x35')](_[_0x6bd6('0x3e')](_0x3b44de[_0x6bd6('0x37')],_0x474f48[_0x6bd6('0x35')]));if(_0x3b44de['query'][_0x6bd6('0x3f')]){_0x8a2288[_0x6bd6('0x40')]=_[_0x6bd6('0x41')](_0x8a2288[_0x6bd6('0x40')],{'$or':_[_0x6bd6('0x42')](_0x385715,function(_0x8a856a){if(_0x8a856a[_0x6bd6('0x43')][_0x6bd6('0x44')]!==_0x6bd6('0x45')){var _0x1dfe74={};_0x1dfe74[_0x8a856a[_0x6bd6('0x46')]]={'$like':'%'+_0x3b44de[_0x6bd6('0x37')][_0x6bd6('0x3f')]+'%'};return _0x1dfe74;}})});}_0x8a2288=_[_0x6bd6('0x41')]({},_0x8a2288,_0x3b44de[_0x6bd6('0x47')]);var _0x89f3a2={'where':_0x8a2288[_0x6bd6('0x40')]};return db[_0x6bd6('0x31')][_0x6bd6('0x20')](_0x89f3a2)[_0x6bd6('0x28')](function(_0x27c674){_0x5a0503[_0x6bd6('0x20')]=_0x27c674;if(_0x3b44de[_0x6bd6('0x37')]['includeAll']){_0x8a2288[_0x6bd6('0x48')]=[{'all':!![]}];}return db[_0x6bd6('0x31')]['findAll'](_0x8a2288);})[_0x6bd6('0x28')](function(_0x3e8589){_0x5a0503[_0x6bd6('0x49')]=_0x3e8589;return _0x5a0503;})[_0x6bd6('0x28')](respondWithFilteredResult(_0x5a53db,_0x8a2288))[_0x6bd6('0x4a')](handleError(_0x5a53db,null));};exports[_0x6bd6('0x4b')]=function(_0x789d6a,_0x15a685){var _0x4825d6={'raw':!![],'where':{'id':_0x789d6a['params']['id']}},_0x25fb2d={};_0x25fb2d[_0x6bd6('0x33')]=_[_0x6bd6('0x34')](db[_0x6bd6('0x31')][_0x6bd6('0x32')]);_0x25fb2d[_0x6bd6('0x37')]=_[_0x6bd6('0x34')](_0x789d6a[_0x6bd6('0x37')]);_0x25fb2d[_0x6bd6('0x35')]=_[_0x6bd6('0x36')](_0x25fb2d[_0x6bd6('0x33')],_0x25fb2d['query']);_0x4825d6[_0x6bd6('0x38')]=_[_0x6bd6('0x36')](_0x25fb2d[_0x6bd6('0x33')],qs[_0x6bd6('0x39')](_0x789d6a[_0x6bd6('0x37')][_0x6bd6('0x39')]));_0x4825d6[_0x6bd6('0x38')]=_0x4825d6[_0x6bd6('0x38')]['length']?_0x4825d6[_0x6bd6('0x38')]:_0x25fb2d[_0x6bd6('0x33')];if(_0x789d6a['query'][_0x6bd6('0x4c')]){_0x4825d6[_0x6bd6('0x48')]=[{'all':!![]}];}_0x4825d6=_[_0x6bd6('0x41')]({},_0x4825d6,_0x789d6a['options']);return db['FaxQueue']['find'](_0x4825d6)[_0x6bd6('0x28')](handleEntityNotFound(_0x15a685,null))[_0x6bd6('0x28')](respondWithResult(_0x15a685,null))['catch'](handleError(_0x15a685,null));};exports[_0x6bd6('0x4d')]=function(_0x18607c,_0xe265e6){return db[_0x6bd6('0x31')]['create'](_0x18607c['body'],{})['then'](function(_0x55c1d0){var _0x1ff4f1=_0x18607c['user'][_0x6bd6('0x2a')]({'plain':!![]});if(!_0x1ff4f1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ff4f1['role']==='user'){var _0x5ead3d=_0x55c1d0[_0x6bd6('0x2a')]({'plain':!![]});var _0x39abf3='FaxQueues';return db[_0x6bd6('0x4e')][_0x6bd6('0x4f')]({'where':{'name':_0x39abf3,'userProfileId':_0x1ff4f1[_0x6bd6('0x50')]},'raw':!![]})[_0x6bd6('0x28')](function(_0x3a7930){if(_0x3a7930&&_0x3a7930[_0x6bd6('0x51')]===0x0){return db[_0x6bd6('0x2c')][_0x6bd6('0x4d')]({'name':_0x5ead3d[_0x6bd6('0x2e')],'resourceId':_0x5ead3d['id'],'type':_0x3a7930['name'],'sectionId':_0x3a7930['id']},{})['then'](function(){return _0x55c1d0;});}else{return _0x55c1d0;}})['catch'](function(_0x30fff0){logger[_0x6bd6('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30fff0);throw _0x30fff0;});}return _0x55c1d0;})[_0x6bd6('0x28')](respondWithResult(_0xe265e6,0xc9))[_0x6bd6('0x4a')](handleError(_0xe265e6,null));};exports[_0x6bd6('0x27')]=function(_0x9a152a,_0x20b0f7){if(_0x9a152a[_0x6bd6('0x53')]['id']){delete _0x9a152a[_0x6bd6('0x53')]['id'];}return db[_0x6bd6('0x31')][_0x6bd6('0x4f')]({'where':{'id':_0x9a152a['params']['id']}})[_0x6bd6('0x28')](handleEntityNotFound(_0x20b0f7,null))[_0x6bd6('0x28')](saveUpdates(_0x9a152a[_0x6bd6('0x53')],null))[_0x6bd6('0x28')](respondWithResult(_0x20b0f7,null))[_0x6bd6('0x4a')](handleError(_0x20b0f7,null));};exports[_0x6bd6('0x29')]=function(_0x28d302,_0x39a148){return db[_0x6bd6('0x31')][_0x6bd6('0x4f')]({'where':{'id':_0x28d302[_0x6bd6('0x54')]['id']}})[_0x6bd6('0x28')](handleEntityNotFound(_0x39a148,null))[_0x6bd6('0x28')](removeEntity(_0x39a148,null))[_0x6bd6('0x4a')](handleError(_0x39a148,null));};exports[_0x6bd6('0x55')]=function(_0xf1c291,_0x5d2c01){return db[_0x6bd6('0x31')][_0x6bd6('0x55')]()[_0x6bd6('0x28')](respondWithResult(_0x5d2c01,null))['catch'](handleError(_0x5d2c01,null));};exports[_0x6bd6('0x56')]=function(_0x25ce94,_0x25a93e,_0x3871f1){var _0x529c40={'raw':!![],'where':{}},_0x5da478={},_0x17a8e9;return db[_0x6bd6('0x31')][_0x6bd6('0x57')]({'where':{'id':_0x25ce94['params']['id']}})['then'](handleEntityNotFound(_0x25a93e,null))[_0x6bd6('0x28')](function(_0x3680f9){if(_0x3680f9){_0x17a8e9=_0x3680f9[_0x6bd6('0x2a')]({'plain':!![]});_0x5da478['model']=_[_0x6bd6('0x34')](db[_0x6bd6('0x58')]['rawAttributes']);_0x5da478['query']=_[_0x6bd6('0x34')](_0x25ce94[_0x6bd6('0x37')]);_0x5da478[_0x6bd6('0x35')]=_[_0x6bd6('0x36')](_0x5da478['model'],_0x5da478[_0x6bd6('0x37')]);_0x529c40['attributes']=_[_0x6bd6('0x36')](_0x5da478[_0x6bd6('0x33')],qs[_0x6bd6('0x39')](_0x25ce94[_0x6bd6('0x37')][_0x6bd6('0x39')]));_0x529c40[_0x6bd6('0x38')]=_0x529c40[_0x6bd6('0x38')][_0x6bd6('0x3a')]?_0x529c40['attributes']:_0x5da478['model'];if(!_0x25ce94[_0x6bd6('0x37')]['hasOwnProperty'](_0x6bd6('0x3c'))){_0x529c40['limit']=qs[_0x6bd6('0x22')](_0x25ce94[_0x6bd6('0x37')]['limit']);_0x529c40[_0x6bd6('0x21')]=qs['offset'](_0x25ce94[_0x6bd6('0x37')][_0x6bd6('0x21')]);}_0x529c40[_0x6bd6('0x59')]=qs[_0x6bd6('0x3d')](_0x25ce94['query']['sort']);_0x529c40['where']=qs['filters'](_[_0x6bd6('0x3e')](_0x25ce94[_0x6bd6('0x37')],_0x5da478[_0x6bd6('0x35')]));_0x529c40[_0x6bd6('0x40')][_0x6bd6('0x5a')]=_0x3680f9['id'];if(_0x25ce94[_0x6bd6('0x37')]['filter']){_0x529c40[_0x6bd6('0x40')]=_[_0x6bd6('0x41')](_0x529c40[_0x6bd6('0x40')],{'$or':_['map'](_0x529c40[_0x6bd6('0x38')],function(_0x433dde){var _0x35453d={};_0x35453d[_0x433dde]={'$like':'%'+_0x25ce94['query'][_0x6bd6('0x3f')]+'%'};return _0x35453d;})});}_0x529c40=_[_0x6bd6('0x41')]({},_0x529c40,_0x25ce94['options']);return db[_0x6bd6('0x58')][_0x6bd6('0x5b')](_0x529c40);}})[_0x6bd6('0x28')](function(_0x418351){if(_0x418351){return db['User'][_0x6bd6('0x5c')]({'where':{'id':_[_0x6bd6('0x42')](_0x418351,'UserId'),'role':_0x6bd6('0x5d')},'attributes':['id','name',_0x6bd6('0x5e'),_0x6bd6('0x5f'),_0x6bd6('0x60')]});}})[_0x6bd6('0x28')](function(_0x2b0d45){if(_0x2b0d45){return{'count':_0x2b0d45[_0x6bd6('0x20')],'rows':_[_0x6bd6('0x42')](_0x2b0d45['rows'],function(_0x1deb54){return{'membername':_0x1deb54['name'],'UserId':_0x1deb54['id'],'queue_name':_0x17a8e9[_0x6bd6('0x2e')],'FaxQueueId':_0x17a8e9['id'],'interface':util[_0x6bd6('0x61')]('%s/%s','SIP',_0x1deb54[_0x6bd6('0x2e')]),'penalty':0x0,'paused':_0x1deb54[_0x6bd6('0x5e')],'createdAt':_0x1deb54[_0x6bd6('0x60')],'updatedAt':_0x1deb54[_0x6bd6('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6bd6('0x28')](respondWithFilteredResult(_0x25a93e,_0x529c40))[_0x6bd6('0x4a')](handleError(_0x25a93e,null));};exports['getTeams']=function(_0x10311b,_0x1000b4,_0x151b73){var _0x159ac0={};var _0x56b8c1={};var _0x59aadc;var _0x38afa1;return db[_0x6bd6('0x31')]['findOne']({'where':{'id':_0x10311b['params']['id']}})[_0x6bd6('0x28')](handleEntityNotFound(_0x1000b4,null))['then'](function(_0x416f32){if(_0x416f32){_0x59aadc=_0x416f32;_0x56b8c1['model']=_[_0x6bd6('0x34')](db[_0x6bd6('0x62')][_0x6bd6('0x32')]);_0x56b8c1[_0x6bd6('0x37')]=_[_0x6bd6('0x34')](_0x10311b[_0x6bd6('0x37')]);_0x56b8c1[_0x6bd6('0x35')]=_[_0x6bd6('0x36')](_0x56b8c1[_0x6bd6('0x33')],_0x56b8c1[_0x6bd6('0x37')]);_0x159ac0[_0x6bd6('0x38')]=_[_0x6bd6('0x36')](_0x56b8c1['model'],qs['fields'](_0x10311b[_0x6bd6('0x37')][_0x6bd6('0x39')]));_0x159ac0[_0x6bd6('0x38')]=_0x159ac0['attributes']['length']?_0x159ac0['attributes']:_0x56b8c1[_0x6bd6('0x33')];_0x159ac0[_0x6bd6('0x59')]=qs[_0x6bd6('0x3d')](_0x10311b[_0x6bd6('0x37')][_0x6bd6('0x3d')]);_0x159ac0['where']=qs['filters'](_[_0x6bd6('0x3e')](_0x10311b[_0x6bd6('0x37')],_0x56b8c1[_0x6bd6('0x35')]));if(_0x10311b[_0x6bd6('0x37')][_0x6bd6('0x3f')]){_0x159ac0[_0x6bd6('0x40')]=_['merge'](_0x159ac0['where'],{'$or':_[_0x6bd6('0x42')](_0x159ac0[_0x6bd6('0x38')],function(_0x334f68){var _0x2e0bfb={};_0x2e0bfb[_0x334f68]={'$like':'%'+_0x10311b['query'][_0x6bd6('0x3f')]+'%'};return _0x2e0bfb;})});}_0x159ac0=_[_0x6bd6('0x41')]({},_0x159ac0,_0x10311b[_0x6bd6('0x47')]);return _0x59aadc[_0x6bd6('0x63')](_0x159ac0);}})[_0x6bd6('0x28')](function(_0x180e00){if(_0x180e00){_0x38afa1=_0x180e00[_0x6bd6('0x3a')];if(!_0x10311b[_0x6bd6('0x37')][_0x6bd6('0x3b')]('nolimit')){_0x159ac0[_0x6bd6('0x22')]=qs['limit'](_0x10311b[_0x6bd6('0x37')]['limit']);_0x159ac0['offset']=qs[_0x6bd6('0x21')](_0x10311b[_0x6bd6('0x37')][_0x6bd6('0x21')]);}return _0x59aadc['getTeams'](_0x159ac0);}})[_0x6bd6('0x28')](function(_0x4e9a7e){if(_0x4e9a7e){return _0x4e9a7e?{'count':_0x38afa1,'rows':_0x4e9a7e}:null;}})['then'](respondWithResult(_0x1000b4,null))['catch'](handleError(_0x1000b4,null));};exports[_0x6bd6('0x64')]=function(_0x1aa903,_0x279c58,_0x4aaa2e){var _0x13aa05=_0x1aa903[_0x6bd6('0x53')][_0x6bd6('0x65')];return db[_0x6bd6('0x62')][_0x6bd6('0x5b')]({'where':{'id':_[_0x6bd6('0x42')](_0x13aa05,'id')},'attributes':['id'],'include':[{'model':db[_0x6bd6('0x66')],'as':_0x6bd6('0x67'),'attributes':['id',_0x6bd6('0x2e'),'online',_0x6bd6('0x68'),_0x6bd6('0x69')],'raw':!![]}]})['then'](function(_0x2c2fe9){if(_0x2c2fe9){var _0x3a42d0=_[_0x6bd6('0x6a')](_0x2c2fe9,function(_0x3a39df){var _0x50f935=_0x3a39df[_0x6bd6('0x2a')]({'plain':!![]});return _0x50f935[_0x6bd6('0x67')];});return db[_0x6bd6('0x31')][_0x6bd6('0x4f')]({'where':{'id':_0x1aa903['params']['id']}})[_0x6bd6('0x28')](function(_0x48c06a){return db[_0x6bd6('0x6b')][_0x6bd6('0x6c')](function(_0x581f41){return _0x48c06a[_0x6bd6('0x64')](_[_0x6bd6('0x42')](_0x13aa05,'id'),{'transaction':_0x581f41})[_0x6bd6('0x28')](function(){return BPromise[_0x6bd6('0x6d')](_0x3a42d0,function(_0x2a1615){return db['UserFaxQueue'][_0x6bd6('0x6e')]({'where':{'UserId':_0x2a1615['id'],'FaxQueueId':_0x1aa903['params']['id']},'transaction':_0x581f41});});})['then'](function(){_0x3a42d0[_0x6bd6('0x6f')](function(_0x1e45ff){socket[_0x6bd6('0x70')](_0x6bd6('0x71'),{'UserId':_0x1e45ff['id'],'FaxQueueId':_0x48c06a['id']});});});});});}})[_0x6bd6('0x28')](respondWithStatusCode(_0x279c58,null))['catch'](handleError(_0x279c58,null));};exports['removeTeams']=function(_0x49a4f2,_0x1a55a3,_0x319efb){return db['Team'][_0x6bd6('0x5b')]({'where':{'id':_0x49a4f2[_0x6bd6('0x37')][_0x6bd6('0x72')]},'attributes':['id'],'include':[{'model':db[_0x6bd6('0x66')],'as':_0x6bd6('0x67'),'attributes':['id'],'raw':!![]}]})[_0x6bd6('0x28')](handleEntityNotFound(_0x1a55a3,null))[_0x6bd6('0x28')](function(_0x7ea268){var _0x12a68e=_[_0x6bd6('0x42')](_0x7ea268,'id');var _0x5972f8=[];var _0x3e0ac3=[];var _0x335295=squel[_0x6bd6('0x73')]();_0x335295[_0x6bd6('0x46')](_0x6bd6('0x74'))[_0x6bd6('0x75')](_0x6bd6('0x76'),'tq')[_0x6bd6('0x77')](_0x6bd6('0x78'),'ut',_0x6bd6('0x79'))[_0x6bd6('0x40')]('FaxQueueId\x20=\x20?',_0x49a4f2['params']['id']);for(var _0x3067bc=0x0;_0x3067bc<_0x7ea268['length'];_0x3067bc+=0x1){let _0xdb429c=_0x7ea268[_0x3067bc];for(var _0x51e13b=0x0;_0x51e13b<_0xdb429c[_0x6bd6('0x67')][_0x6bd6('0x3a')];_0x51e13b+=0x1){let _0x4e6e53=_0xdb429c[_0x6bd6('0x67')][_0x51e13b];var _0x52f9e4=_0x335295[_0x6bd6('0x7a')]();_0x52f9e4[_0x6bd6('0x40')](_0x6bd6('0x7b'),_0x4e6e53['id']);_0x3e0ac3[_0x6bd6('0x7c')](db[_0x6bd6('0x6b')][_0x6bd6('0x37')](_0x52f9e4[_0x6bd6('0x7d')](),{'type':db[_0x6bd6('0x6b')][_0x6bd6('0x7e')]['SELECT']})[_0x6bd6('0x28')](function(_0x4037b4){if(_0x4037b4['length']===0x1){return _0x4e6e53['id'];}else{var _0xcd7056=_[_0x6bd6('0x7f')](_[_0x6bd6('0x42')](_0x4037b4,_0x6bd6('0x80')),function(_0x7e194f){return _[_0x6bd6('0x81')](_0x12a68e,_0x7e194f);});if(_0xcd7056){return _0x4e6e53['id'];}}}));}}return BPromise['all'](_0x3e0ac3)['then'](function(_0x1faadf){_0x5972f8=_(_0x5972f8)['union'](_0x1faadf)[_0x6bd6('0x82')]()['value']();return db[_0x6bd6('0x31')][_0x6bd6('0x4f')]({'where':{'id':_0x49a4f2[_0x6bd6('0x54')]['id']}})[_0x6bd6('0x28')](function(_0x496995){return db[_0x6bd6('0x6b')][_0x6bd6('0x6c')](function(_0x44a829){return _0x496995[_0x6bd6('0x83')](_0x49a4f2[_0x6bd6('0x37')]['ids'],{'transaction':_0x44a829})['then'](function(){if(!_[_0x6bd6('0x84')](_0x5972f8)){return _0x496995[_0x6bd6('0x85')](_0x5972f8,{'transaction':_0x44a829});}})[_0x6bd6('0x28')](function(){_0x5972f8[_0x6bd6('0x6f')](function(_0x1fadfe){socket['emit'](_0x6bd6('0x86'),{'UserId':_0x1fadfe,'FaxQueueId':_0x496995['id']});});});});});});})[_0x6bd6('0x28')](respondWithStatusCode(_0x1a55a3,null))['catch'](handleError(_0x1a55a3,null));};exports[_0x6bd6('0x87')]=function(_0x184e61,_0x16d44b,_0x3c8638){return db[_0x6bd6('0x31')][_0x6bd6('0x4f')]({'where':{'id':_0x184e61[_0x6bd6('0x54')]['id']}})['then'](handleEntityNotFound(_0x16d44b,null))['then'](function(_0xd5948f){if(_0xd5948f){return _0xd5948f[_0x6bd6('0x87')](_0x184e61[_0x6bd6('0x53')][_0x6bd6('0x72')],_[_0x6bd6('0x88')](_0x184e61[_0x6bd6('0x53')],[_0x6bd6('0x72'),'id'])||{})[_0x6bd6('0x89')](function(_0x5f2f46){for(var _0x143659=0x0;_0x143659<_0x184e61['body'][_0x6bd6('0x72')]['length'];_0x143659+=0x1){socket[_0x6bd6('0x70')](_0x6bd6('0x71'),{'UserId':_0x184e61[_0x6bd6('0x53')]['ids'][_0x143659],'FaxQueueId':_0x184e61[_0x6bd6('0x54')]['id']});}return _0x5f2f46;});}})[_0x6bd6('0x28')](respondWithResult(_0x16d44b,null))['catch'](handleError(_0x16d44b,null));};exports[_0x6bd6('0x85')]=function(_0x8287f2,_0x48efed,_0x4c7cf8){return db[_0x6bd6('0x31')][_0x6bd6('0x4f')]({'where':{'id':_0x8287f2[_0x6bd6('0x54')]['id']}})[_0x6bd6('0x28')](handleEntityNotFound(_0x48efed,null))['then'](function(_0x414a1f){if(_0x414a1f){return _0x414a1f[_0x6bd6('0x85')](_0x8287f2[_0x6bd6('0x37')]['ids'])[_0x6bd6('0x28')](function(){if(_['isArray'](_0x8287f2['query']['ids'])){for(var _0x1d6651=0x0;_0x1d6651<_0x8287f2[_0x6bd6('0x37')]['ids'][_0x6bd6('0x3a')];_0x1d6651+=0x1){socket['emit'](_0x6bd6('0x86'),{'UserId':Number(_0x8287f2['query'][_0x6bd6('0x72')][_0x1d6651]),'FaxQueueId':Number(_0x8287f2[_0x6bd6('0x54')]['id'])});}}else{socket[_0x6bd6('0x70')]('userFaxQueue:remove',{'UserId':Number(_0x8287f2[_0x6bd6('0x37')][_0x6bd6('0x72')]),'FaxQueueId':Number(_0x8287f2[_0x6bd6('0x54')]['id'])});}});}})[_0x6bd6('0x28')](respondWithStatusCode(_0x48efed,null))['catch'](handleError(_0x48efed,null));};exports[_0x6bd6('0x8a')]=function(_0x2c60b2,_0x3c512e,_0x12e00e){var _0x1716c5={};var _0x392489={};var _0x5ac0eb;var _0x27bc2f;return db[_0x6bd6('0x31')][_0x6bd6('0x57')]({'where':{'id':_0x2c60b2[_0x6bd6('0x54')]['id']}})[_0x6bd6('0x28')](handleEntityNotFound(_0x3c512e,null))[_0x6bd6('0x28')](function(_0x21a3ed){if(_0x21a3ed){_0x5ac0eb=_0x21a3ed;_0x392489[_0x6bd6('0x33')]=_[_0x6bd6('0x34')](db[_0x6bd6('0x66')][_0x6bd6('0x32')]);_0x392489['query']=_[_0x6bd6('0x34')](_0x2c60b2['query']);_0x392489[_0x6bd6('0x35')]=_[_0x6bd6('0x36')](_0x392489[_0x6bd6('0x33')],_0x392489[_0x6bd6('0x37')]);_0x1716c5[_0x6bd6('0x38')]=_['intersection'](_0x392489[_0x6bd6('0x33')],qs['fields'](_0x2c60b2[_0x6bd6('0x37')][_0x6bd6('0x39')]));_0x1716c5['attributes']=_0x1716c5[_0x6bd6('0x38')][_0x6bd6('0x3a')]?_0x1716c5[_0x6bd6('0x38')]:_0x392489['model'];_0x1716c5[_0x6bd6('0x59')]=qs[_0x6bd6('0x3d')](_0x2c60b2[_0x6bd6('0x37')]['sort']);_0x1716c5[_0x6bd6('0x40')]=qs[_0x6bd6('0x35')](_[_0x6bd6('0x3e')](_0x2c60b2[_0x6bd6('0x37')],_0x392489['filters']));if(_0x2c60b2['query'][_0x6bd6('0x3f')]){_0x1716c5['where']=_[_0x6bd6('0x41')](_0x1716c5[_0x6bd6('0x40')],{'$or':_['map'](_0x1716c5[_0x6bd6('0x38')],function(_0x1e4ff5){var _0x37828b={};_0x37828b[_0x1e4ff5]={'$like':'%'+_0x2c60b2['query'][_0x6bd6('0x3f')]+'%'};return _0x37828b;})});}_0x1716c5=_['merge']({},_0x1716c5,_0x2c60b2[_0x6bd6('0x47')]);return _0x5ac0eb[_0x6bd6('0x8a')](_0x1716c5);}})[_0x6bd6('0x28')](function(_0x53dfbd){if(_0x53dfbd){_0x27bc2f=_0x53dfbd[_0x6bd6('0x3a')];if(!_0x2c60b2[_0x6bd6('0x37')][_0x6bd6('0x3b')](_0x6bd6('0x3c'))){_0x1716c5[_0x6bd6('0x22')]=qs[_0x6bd6('0x22')](_0x2c60b2[_0x6bd6('0x37')][_0x6bd6('0x22')]);_0x1716c5[_0x6bd6('0x21')]=qs[_0x6bd6('0x21')](_0x2c60b2[_0x6bd6('0x37')]['offset']);}return _0x5ac0eb[_0x6bd6('0x8a')](_0x1716c5);}})[_0x6bd6('0x28')](function(_0xff0fcc){if(_0xff0fcc){return _0xff0fcc?{'count':_0x27bc2f,'rows':_0xff0fcc}:null;}})[_0x6bd6('0x28')](respondWithResult(_0x3c512e,null))[_0x6bd6('0x4a')](handleError(_0x3c512e,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index ce75c04..7aef2c9 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 _0xb591=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove'];(function(_0x245327,_0x2bbe5f){var _0x4d441c=function(_0x281a13){while(--_0x281a13){_0x245327['push'](_0x245327['shift']());}};_0x4d441c(++_0x2bbe5f);}(_0xb591,0x88));var _0x1b59=function(_0x35c596,_0x21ad05){_0x35c596=_0x35c596-0x0;var _0x2120a2=_0xb591[_0x35c596];return _0x2120a2;};'use strict';var EventEmitter=require(_0x1b59('0x0'));var FaxQueue=require(_0x1b59('0x1'))['db'][_0x1b59('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x1b59('0x3')](0x0);var events={'afterCreate':_0x1b59('0x4'),'afterUpdate':_0x1b59('0x5'),'afterDestroy':_0x1b59('0x6')};function emitEvent(_0x1ccede){return function(_0x167fa8,_0x635834,_0x4134c6){FaxQueueEvents['emit'](_0x1ccede+':'+_0x167fa8['id'],_0x167fa8);FaxQueueEvents[_0x1b59('0x7')](_0x1ccede,_0x167fa8);_0x4134c6(null);};}for(var e in events){if(events[_0x1b59('0x8')](e)){var event=events[e];FaxQueue[_0x1b59('0x9')](e,emitEvent(event));}}module[_0x1b59('0xa')]=FaxQueueEvents; \ No newline at end of file +var _0x2463=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','update'];(function(_0x30b7fd,_0xed7cbe){var _0x3fe4fd=function(_0x3e6c54){while(--_0x3e6c54){_0x30b7fd['push'](_0x30b7fd['shift']());}};_0x3fe4fd(++_0xed7cbe);}(_0x2463,0x1c7));var _0x3246=function(_0x5db4be,_0xa0ea02){_0x5db4be=_0x5db4be-0x0;var _0x543f0d=_0x2463[_0x5db4be];return _0x543f0d;};'use strict';var EventEmitter=require(_0x3246('0x0'));var FaxQueue=require(_0x3246('0x1'))['db'][_0x3246('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3246('0x3'),'afterDestroy':_0x3246('0x4')};function emitEvent(_0x303d10){return function(_0x2ffca1,_0x19a818,_0x36b4ce){FaxQueueEvents['emit'](_0x303d10+':'+_0x2ffca1['id'],_0x2ffca1);FaxQueueEvents[_0x3246('0x5')](_0x303d10,_0x2ffca1);_0x36b4ce(null);};}for(var e in events){if(events[_0x3246('0x6')](e)){var event=events[e];FaxQueue[_0x3246('0x7')](e,emitEvent(event));}}module[_0x3246('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 d952fe5..1024a0c 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 _0x27ea=['exports','define','FaxQueue','fax_queues','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueue.attributes'];(function(_0x25902d,_0x51af77){var _0x1b075a=function(_0x2c7d7d){while(--_0x2c7d7d){_0x25902d['push'](_0x25902d['shift']());}};_0x1b075a(++_0x51af77);}(_0x27ea,0x149));var _0xa27e=function(_0x9646a5,_0x5f1cd9){_0x9646a5=_0x9646a5-0x0;var _0x392129=_0x27ea[_0x9646a5];return _0x392129;};'use strict';var _=require(_0xa27e('0x0'));var util=require(_0xa27e('0x1'));var logger=require('../../config/logger')(_0xa27e('0x2'));var moment=require(_0xa27e('0x3'));var BPromise=require(_0xa27e('0x4'));var rp=require(_0xa27e('0x5'));var fs=require('fs');var path=require(_0xa27e('0x6'));var rimraf=require('rimraf');var config=require(_0xa27e('0x7'));var attributes=require(_0xa27e('0x8'));module[_0xa27e('0x9')]=function(_0x19bb11,_0x1e5ac0){return _0x19bb11[_0xa27e('0xa')](_0xa27e('0xb'),attributes,{'tableName':_0xa27e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb600=['path','../../config/environment','./faxQueue.attributes','define','fax_queues','lodash','util','../../config/logger','moment'];(function(_0x53b8e0,_0x55d46e){var _0x10630c=function(_0x3189aa){while(--_0x3189aa){_0x53b8e0['push'](_0x53b8e0['shift']());}};_0x10630c(++_0x55d46e);}(_0xb600,0xe6));var _0x0b60=function(_0x27df01,_0x1ef931){_0x27df01=_0x27df01-0x0;var _0x544a24=_0xb600[_0x27df01];return _0x544a24;};'use strict';var _=require(_0x0b60('0x0'));var util=require(_0x0b60('0x1'));var logger=require(_0x0b60('0x2'))('api');var moment=require(_0x0b60('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b60('0x4'));var rimraf=require('rimraf');var config=require(_0x0b60('0x5'));var attributes=require(_0x0b60('0x6'));module['exports']=function(_0x54316b,_0x9a3c81){return _0x54316b[_0x0b60('0x7')]('FaxQueue',attributes,{'tableName':_0x0b60('0x8'),'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 497b0f3..f29cc3d 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 _0x9b4e=['FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','GetFaxQueue','stringify','ShowFaxQueue','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./faxQueue.socket','register','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','FaxQueue,\x20%s,\x20%s','result','catch'];(function(_0x353dac,_0x33dc0f){var _0x46642f=function(_0x23ac14){while(--_0x23ac14){_0x353dac['push'](_0x353dac['shift']());}};_0x46642f(++_0x33dc0f);}(_0x9b4e,0x1e2));var _0xe9b4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9b4e[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0xe9b4('0x0'));var moment=require(_0xe9b4('0x1'));var BPromise=require('bluebird');var rs=require(_0xe9b4('0x2'));var fs=require('fs');var Redis=require(_0xe9b4('0x3'));var db=require(_0xe9b4('0x4'))['db'];var utils=require(_0xe9b4('0x5'));var logger=require(_0xe9b4('0x6'))(_0xe9b4('0x7'));var config=require(_0xe9b4('0x8'));var jayson=require(_0xe9b4('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xe9b4('0xa')]=_[_0xe9b4('0xb')](config[_0xe9b4('0xa')],{'host':_0xe9b4('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe9b4('0xa')]));require(_0xe9b4('0xd'))[_0xe9b4('0xe')](socket);function respondWithRpcPromise(_0x45806b,_0x35bf56,_0xf895f4){return new BPromise(function(_0x272ad2,_0x5b5013){return client['request'](_0x45806b,_0xf895f4)['then'](function(_0x4bed5f){logger[_0xe9b4('0xf')]('FaxQueue,\x20%s,\x20%s',_0x35bf56,_0xe9b4('0x10'));logger[_0xe9b4('0x11')](_0xe9b4('0x12'),_0x35bf56,'request\x20sent',JSON['stringify'](_0x4bed5f));if(_0x4bed5f[_0xe9b4('0x13')]){if(_0x4bed5f[_0xe9b4('0x13')][_0xe9b4('0x14')]===0x1f4){logger[_0xe9b4('0x13')]('FaxQueue,\x20%s,\x20%s',_0x35bf56,_0x4bed5f[_0xe9b4('0x13')][_0xe9b4('0x15')]);return _0x5b5013(_0x4bed5f[_0xe9b4('0x13')][_0xe9b4('0x15')]);}logger['error'](_0xe9b4('0x16'),_0x35bf56,_0x4bed5f[_0xe9b4('0x13')][_0xe9b4('0x15')]);return _0x272ad2(_0x4bed5f[_0xe9b4('0x13')]['message']);}else{logger[_0xe9b4('0xf')]('FaxQueue,\x20%s,\x20%s',_0x35bf56,_0xe9b4('0x10'));_0x272ad2(_0x4bed5f[_0xe9b4('0x17')][_0xe9b4('0x15')]);}})[_0xe9b4('0x18')](function(_0x180b8e){logger[_0xe9b4('0x13')](_0xe9b4('0x16'),_0x35bf56,_0x180b8e);_0x5b5013(_0x180b8e);});});}exports['GetFaxQueue']=function(_0x1e3d41){var _0x5a21dd=this;return new Promise(function(_0x870fe0,_0xff781a){return db[_0xe9b4('0x19')][_0xe9b4('0x1a')]({'raw':_0x1e3d41['options']?_0x1e3d41[_0xe9b4('0x1b')][_0xe9b4('0x1c')]===undefined?!![]:![]:!![],'where':_0x1e3d41[_0xe9b4('0x1b')]?_0x1e3d41[_0xe9b4('0x1b')][_0xe9b4('0x1d')]||null:null,'attributes':_0x1e3d41[_0xe9b4('0x1b')]?_0x1e3d41[_0xe9b4('0x1b')][_0xe9b4('0x1e')]||null:null,'limit':_0x1e3d41[_0xe9b4('0x1b')]?_0x1e3d41[_0xe9b4('0x1b')][_0xe9b4('0x1f')]||null:null,'include':_0x1e3d41[_0xe9b4('0x1b')]?_0x1e3d41['options'][_0xe9b4('0x20')]?_['map'](_0x1e3d41[_0xe9b4('0x1b')]['include'],function(_0x24fbc2){return{'model':db[_0x24fbc2['model']],'as':_0x24fbc2['as'],'attributes':_0x24fbc2[_0xe9b4('0x1e')],'include':_0x24fbc2[_0xe9b4('0x20')]?_[_0xe9b4('0x21')](_0x24fbc2['include'],function(_0x41a8e0){return{'model':db[_0x41a8e0[_0xe9b4('0x22')]],'as':_0x41a8e0['as'],'attributes':_0x41a8e0[_0xe9b4('0x1e')],'include':_0x41a8e0[_0xe9b4('0x20')]?_[_0xe9b4('0x21')](_0x41a8e0['include'],function(_0x30146d){return{'model':db[_0x30146d[_0xe9b4('0x22')]],'as':_0x30146d['as'],'attributes':_0x30146d['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9b4('0x23')](function(_0x2cae51){logger[_0xe9b4('0xf')](_0xe9b4('0x24'),_0x1e3d41);logger['debug'](_0xe9b4('0x24'),_0x1e3d41,JSON[_0xe9b4('0x25')](_0x2cae51));_0x870fe0(_0x2cae51);})[_0xe9b4('0x18')](function(_0x4595b3){logger[_0xe9b4('0x13')](_0xe9b4('0x24'),_0x4595b3['message'],_0x1e3d41);_0xff781a(_0x5a21dd[_0xe9b4('0x13')](0x1f4,_0x4595b3[_0xe9b4('0x15')]));});});};exports[_0xe9b4('0x26')]=function(_0x346bbc){var _0x2fe8b1=this;return new Promise(function(_0x50284e,_0x2835a2){return db[_0xe9b4('0x19')]['find']({'raw':_0x346bbc['options']?_0x346bbc[_0xe9b4('0x1b')][_0xe9b4('0x1c')]===undefined?!![]:![]:!![],'where':_0x346bbc[_0xe9b4('0x1b')]?_0x346bbc[_0xe9b4('0x1b')]['where']||null:null,'attributes':_0x346bbc[_0xe9b4('0x1b')]?_0x346bbc['options'][_0xe9b4('0x1e')]||null:null,'include':_0x346bbc['options']?_0x346bbc['options']['include']?_['map'](_0x346bbc['options'][_0xe9b4('0x20')],function(_0x378295){return{'model':db[_0x378295['model']],'as':_0x378295['as'],'attributes':_0x378295[_0xe9b4('0x1e')],'include':_0x378295['include']?_['map'](_0x378295[_0xe9b4('0x20')],function(_0x5a18b6){return{'model':db[_0x5a18b6[_0xe9b4('0x22')]],'as':_0x5a18b6['as'],'attributes':_0x5a18b6[_0xe9b4('0x1e')],'include':_0x5a18b6[_0xe9b4('0x20')]?_[_0xe9b4('0x21')](_0x5a18b6[_0xe9b4('0x20')],function(_0x20307c){return{'model':db[_0x20307c[_0xe9b4('0x22')]],'as':_0x20307c['as'],'attributes':_0x20307c[_0xe9b4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe9b4('0x23')](function(_0x49d096){logger[_0xe9b4('0xf')](_0xe9b4('0x26'),_0x346bbc);logger[_0xe9b4('0x11')]('ShowFaxQueue',_0x346bbc,JSON[_0xe9b4('0x25')](_0x49d096));_0x50284e(_0x49d096);})[_0xe9b4('0x18')](function(_0x27abfd){logger[_0xe9b4('0x13')](_0xe9b4('0x26'),_0x27abfd['message'],_0x346bbc);_0x2835a2(_0x2fe8b1[_0xe9b4('0x13')](0x1f4,_0x27abfd[_0xe9b4('0x15')]));});});}; \ No newline at end of file +var _0xe572=['find','ShowFaxQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','FaxQueue'];(function(_0x4b2a0f,_0x347788){var _0x568c42=function(_0x3a5a40){while(--_0x3a5a40){_0x4b2a0f['push'](_0x4b2a0f['shift']());}};_0x568c42(++_0x347788);}(_0xe572,0x1ee));var _0x2e57=function(_0x339df7,_0x51c239){_0x339df7=_0x339df7-0x0;var _0xebd8a6=_0xe572[_0x339df7];return _0xebd8a6;};'use strict';var _=require('lodash');var util=require(_0x2e57('0x0'));var moment=require(_0x2e57('0x1'));var BPromise=require(_0x2e57('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e57('0x3'));var db=require(_0x2e57('0x4'))['db'];var utils=require(_0x2e57('0x5'));var logger=require('../../config/logger')(_0x2e57('0x6'));var config=require(_0x2e57('0x7'));var jayson=require(_0x2e57('0x8'));var client=jayson['client'][_0x2e57('0x9')]({'port':0x232a});config['redis']=_[_0x2e57('0xa')](config[_0x2e57('0xb')],{'host':_0x2e57('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2e57('0xd'))[_0x2e57('0xe')](socket);function respondWithRpcPromise(_0x4252c6,_0x481b76,_0x22e844){return new BPromise(function(_0x262676,_0x56de5a){return client[_0x2e57('0xf')](_0x4252c6,_0x22e844)['then'](function(_0x554045){logger[_0x2e57('0x10')](_0x2e57('0x11'),_0x481b76,_0x2e57('0x12'));logger[_0x2e57('0x13')](_0x2e57('0x14'),_0x481b76,'request\x20sent',JSON[_0x2e57('0x15')](_0x554045));if(_0x554045[_0x2e57('0x16')]){if(_0x554045[_0x2e57('0x16')][_0x2e57('0x17')]===0x1f4){logger[_0x2e57('0x16')](_0x2e57('0x11'),_0x481b76,_0x554045[_0x2e57('0x16')][_0x2e57('0x18')]);return _0x56de5a(_0x554045[_0x2e57('0x16')]['message']);}logger[_0x2e57('0x16')](_0x2e57('0x11'),_0x481b76,_0x554045[_0x2e57('0x16')][_0x2e57('0x18')]);return _0x262676(_0x554045[_0x2e57('0x16')]['message']);}else{logger[_0x2e57('0x10')](_0x2e57('0x11'),_0x481b76,'request\x20sent');_0x262676(_0x554045[_0x2e57('0x19')][_0x2e57('0x18')]);}})[_0x2e57('0x1a')](function(_0x1fc598){logger[_0x2e57('0x16')](_0x2e57('0x11'),_0x481b76,_0x1fc598);_0x56de5a(_0x1fc598);});});}exports[_0x2e57('0x1b')]=function(_0x215314){var _0x1d3e47=this;return new Promise(function(_0x2b8b58,_0x4344c8){return db['FaxQueue'][_0x2e57('0x1c')]({'raw':_0x215314[_0x2e57('0x1d')]?_0x215314[_0x2e57('0x1d')][_0x2e57('0x1e')]===undefined?!![]:![]:!![],'where':_0x215314[_0x2e57('0x1d')]?_0x215314['options'][_0x2e57('0x1f')]||null:null,'attributes':_0x215314['options']?_0x215314[_0x2e57('0x1d')][_0x2e57('0x20')]||null:null,'limit':_0x215314[_0x2e57('0x1d')]?_0x215314[_0x2e57('0x1d')][_0x2e57('0x21')]||null:null,'include':_0x215314[_0x2e57('0x1d')]?_0x215314[_0x2e57('0x1d')][_0x2e57('0x22')]?_[_0x2e57('0x23')](_0x215314[_0x2e57('0x1d')][_0x2e57('0x22')],function(_0x1c8067){return{'model':db[_0x1c8067[_0x2e57('0x24')]],'as':_0x1c8067['as'],'attributes':_0x1c8067[_0x2e57('0x20')],'include':_0x1c8067[_0x2e57('0x22')]?_[_0x2e57('0x23')](_0x1c8067['include'],function(_0xce14b8){return{'model':db[_0xce14b8['model']],'as':_0xce14b8['as'],'attributes':_0xce14b8['attributes'],'include':_0xce14b8[_0x2e57('0x22')]?_['map'](_0xce14b8[_0x2e57('0x22')],function(_0x2dd3c4){return{'model':db[_0x2dd3c4[_0x2e57('0x24')]],'as':_0x2dd3c4['as'],'attributes':_0x2dd3c4[_0x2e57('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2e57('0x25')](function(_0x2bbc7f){logger['info']('GetFaxQueue',_0x215314);logger['debug'](_0x2e57('0x1b'),_0x215314,JSON[_0x2e57('0x15')](_0x2bbc7f));_0x2b8b58(_0x2bbc7f);})[_0x2e57('0x1a')](function(_0x3e56d1){logger['error'](_0x2e57('0x1b'),_0x3e56d1['message'],_0x215314);_0x4344c8(_0x1d3e47[_0x2e57('0x16')](0x1f4,_0x3e56d1['message']));});});};exports['ShowFaxQueue']=function(_0x5b04e6){var _0x475692=this;return new Promise(function(_0x48e88c,_0x99973c){return db[_0x2e57('0x26')][_0x2e57('0x27')]({'raw':_0x5b04e6[_0x2e57('0x1d')]?_0x5b04e6[_0x2e57('0x1d')][_0x2e57('0x1e')]===undefined?!![]:![]:!![],'where':_0x5b04e6[_0x2e57('0x1d')]?_0x5b04e6[_0x2e57('0x1d')][_0x2e57('0x1f')]||null:null,'attributes':_0x5b04e6[_0x2e57('0x1d')]?_0x5b04e6[_0x2e57('0x1d')][_0x2e57('0x20')]||null:null,'include':_0x5b04e6[_0x2e57('0x1d')]?_0x5b04e6[_0x2e57('0x1d')][_0x2e57('0x22')]?_[_0x2e57('0x23')](_0x5b04e6[_0x2e57('0x1d')][_0x2e57('0x22')],function(_0x2c1756){return{'model':db[_0x2c1756[_0x2e57('0x24')]],'as':_0x2c1756['as'],'attributes':_0x2c1756[_0x2e57('0x20')],'include':_0x2c1756['include']?_[_0x2e57('0x23')](_0x2c1756[_0x2e57('0x22')],function(_0x250a36){return{'model':db[_0x250a36[_0x2e57('0x24')]],'as':_0x250a36['as'],'attributes':_0x250a36[_0x2e57('0x20')],'include':_0x250a36[_0x2e57('0x22')]?_['map'](_0x250a36['include'],function(_0xd9ce10){return{'model':db[_0xd9ce10[_0x2e57('0x24')]],'as':_0xd9ce10['as'],'attributes':_0xd9ce10[_0x2e57('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2e57('0x25')](function(_0x913cd2){logger['info'](_0x2e57('0x28'),_0x5b04e6);logger[_0x2e57('0x13')](_0x2e57('0x28'),_0x5b04e6,JSON['stringify'](_0x913cd2));_0x48e88c(_0x913cd2);})['catch'](function(_0x35717a){logger[_0x2e57('0x16')](_0x2e57('0x28'),_0x35717a[_0x2e57('0x18')],_0x5b04e6);_0x99973c(_0x475692[_0x2e57('0x16')](0x1f4,_0x35717a[_0x2e57('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 677d182..63b94f3 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 _0x665b=['save','remove','emit','removeListener','length','faxQueue:','./faxQueue.events'];(function(_0x30c4b6,_0x49b3e2){var _0x41c523=function(_0x3871c5){while(--_0x3871c5){_0x30c4b6['push'](_0x30c4b6['shift']());}};_0x41c523(++_0x49b3e2);}(_0x665b,0xbc));var _0xb665=function(_0x285142,_0x4be80f){_0x285142=_0x285142-0x0;var _0x2524b0=_0x665b[_0x285142];return _0x2524b0;};'use strict';var FaxQueueEvents=require(_0xb665('0x0'));var events=[_0xb665('0x1'),_0xb665('0x2'),'update'];function createListener(_0x3e1ada,_0x4d29c0){return function(_0x290b2d){_0x4d29c0[_0xb665('0x3')](_0x3e1ada,_0x290b2d);};}function removeListener(_0x51b49e,_0x42700e){return function(){FaxQueueEvents[_0xb665('0x4')](_0x51b49e,_0x42700e);};}exports['register']=function(_0x1e62fb){for(var _0xef3c1b=0x0,_0x638040=events[_0xb665('0x5')];_0xef3c1b<_0x638040;_0xef3c1b++){var _0x395e85=events[_0xef3c1b];var _0x2da0c5=createListener(_0xb665('0x6')+_0x395e85,_0x1e62fb);FaxQueueEvents['on'](_0x395e85,_0x2da0c5);}}; \ No newline at end of file +var _0xfcba=['remove','update','emit','removeListener','register','faxQueue:','./faxQueue.events','save'];(function(_0x3b23b4,_0x29542d){var _0x5a2c5a=function(_0x35dad0){while(--_0x35dad0){_0x3b23b4['push'](_0x3b23b4['shift']());}};_0x5a2c5a(++_0x29542d);}(_0xfcba,0x136));var _0xafcb=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xfcba[_0x4b055c];return _0x4b62bb;};'use strict';var FaxQueueEvents=require(_0xafcb('0x0'));var events=[_0xafcb('0x1'),_0xafcb('0x2'),_0xafcb('0x3')];function createListener(_0x147877,_0x3a060b){return function(_0xa0d482){_0x3a060b[_0xafcb('0x4')](_0x147877,_0xa0d482);};}function removeListener(_0x2ec32a,_0x32f41c){return function(){FaxQueueEvents[_0xafcb('0x5')](_0x2ec32a,_0x32f41c);};}exports[_0xafcb('0x6')]=function(_0x21273c){for(var _0xcdc063=0x0,_0x245901=events['length'];_0xcdc063<_0x245901;_0xcdc063++){var _0x2533f8=events[_0xcdc063];var _0xedf7f6=createListener(_0xafcb('0x7')+_0x2533f8,_0x21273c);FaxQueueEvents['on'](_0x2533f8,_0xedf7f6);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 61e95f6..e0c8b5e 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 _0xbaf0=['create','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post'];(function(_0x1ccb6b,_0x4e91e6){var _0x4c316=function(_0x324f8c){while(--_0x324f8c){_0x1ccb6b['push'](_0x1ccb6b['shift']());}};_0x4c316(++_0x4e91e6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0x8')](_0x0baf('0xf'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x8')](_0x0baf('0x11'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x8')](_0x0baf('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0baf('0x14')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x15')]);router[_0x0baf('0x14')]('/:id/teams',auth[_0x0baf('0x9')](),controller['addTeams']);router[_0x0baf('0x14')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0baf('0x18')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x19')]);router[_0x0baf('0x18')](_0x0baf('0x11'),auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);router[_0x0baf('0x18')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x1b')]);module[_0x0baf('0x1c')]=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(_0x5a19fc,_0x58f9f4){var _0x34b413=function(_0x344feb){while(--_0x344feb){_0x5a19fc['push'](_0x5a19fc['shift']());}};_0x34b413(++_0x58f9f4);}(_0x0b0e,0x187));var _0xe0b0=function(_0x27a900,_0x1cc305){_0x27a900=_0x27a900-0x0;var _0xea9b1f=_0x0b0e[_0x27a900];return _0xea9b1f;};'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 8d1f072..b2c9e82 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 _0x21f9=['DATE','exports','STRING'];(function(_0x4f4b55,_0x31cbd6){var _0x36fbf9=function(_0xe8e44d){while(--_0xe8e44d){_0x4f4b55['push'](_0x4f4b55['shift']());}};_0x36fbf9(++_0x31cbd6);}(_0x21f9,0x1cc));var _0x921f=function(_0x296580,_0x289191){_0x296580=_0x296580-0x0;var _0x1d9223=_0x21f9[_0x296580];return _0x1d9223;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x921f('0x0')]={'uniqueid':{'type':Sequelize[_0x921f('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x921f('0x1')]},'joinAt':{'type':Sequelize[_0x921f('0x2')]},'leaveAt':{'type':Sequelize[_0x921f('0x2')]},'acceptAt':{'type':Sequelize[_0x921f('0x2')]},'exitAt':{'type':Sequelize[_0x921f('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4ddd=['STRING','DATE','moment','sequelize','exports'];(function(_0x1cfe2e,_0x1ebbcd){var _0x39233f=function(_0x48831a){while(--_0x48831a){_0x1cfe2e['push'](_0x1cfe2e['shift']());}};_0x39233f(++_0x1ebbcd);}(_0x4ddd,0x1ce));var _0xd4dd=function(_0x1cd674,_0x8d3638){_0x1cd674=_0x1cd674-0x0;var _0x27928f=_0x4ddd[_0x1cd674];return _0x27928f;};'use strict';var moment=require(_0xd4dd('0x0'));var Sequelize=require(_0xd4dd('0x1'));module[_0xd4dd('0x2')]={'uniqueid':{'type':Sequelize[_0xd4dd('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd4dd('0x4')]},'leaveAt':{'type':Sequelize[_0xd4dd('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd4dd('0x4')]},'reason':{'type':Sequelize[_0xd4dd('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index ab18b54..36c5e12 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 _0x4bd3=['hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','map','type','key','then','rows','catch','includeAll','include','options','find','create','body','describe','html-pdf','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','FaxQueueReport','rawAttributes','model','keys','query','intersection','fields','attributes','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4bd3,0x174));var _0x34bd=function(_0x504574,_0x4015a8){_0x504574=_0x504574-0x0;var _0x5d687f=_0x4bd3[_0x504574];return _0x5d687f;};'use strict';var pdf=require(_0x34bd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x34bd('0x1'));var zipdir=require(_0x34bd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x34bd('0x3'));var Mustache=require(_0x34bd('0x4'));var util=require(_0x34bd('0x5'));var path=require('path');var sox=require(_0x34bd('0x6'));var csv=require(_0x34bd('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x34bd('0x8'));var squel=require(_0x34bd('0x9'));var crypto=require('crypto');var jsforce=require(_0x34bd('0xa'));var deskjs=require(_0x34bd('0xb'));var toCsv=require(_0x34bd('0x7'));var querystring=require(_0x34bd('0xc'));var Papa=require(_0x34bd('0xd'));var Redis=require(_0x34bd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x34bd('0xf'));var hardwareService=require(_0x34bd('0x10'));var logger=require(_0x34bd('0x11'))(_0x34bd('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x34bd('0x13'))['db'];function respondWithStatusCode(_0x5e4ce7,_0x4ac0dc){_0x4ac0dc=_0x4ac0dc||0xcc;return function(_0x275d80){if(_0x275d80){return _0x5e4ce7[_0x34bd('0x14')](_0x4ac0dc);}return _0x5e4ce7[_0x34bd('0x15')](_0x4ac0dc)[_0x34bd('0x16')]();};}function respondWithResult(_0x2ee180,_0x14cd37){_0x14cd37=_0x14cd37||0xc8;return function(_0x4134ee){if(_0x4134ee){return _0x2ee180[_0x34bd('0x15')](_0x14cd37)[_0x34bd('0x17')](_0x4134ee);}};}function respondWithFilteredResult(_0x59ed5d,_0x3fa6a8){return function(_0x4d4955){if(_0x4d4955){var _0x4e3886=_0x4d4955[_0x34bd('0x18')],_0x6638ed=_0x3fa6a8[_0x34bd('0x19')],_0x30b3f2=_0x3fa6a8[_0x34bd('0x19')]+_0x3fa6a8[_0x34bd('0x1a')],_0x280c1a;if(_0x30b3f2>=_0x4e3886){_0x30b3f2=_0x4e3886;_0x280c1a=0xc8;}else{_0x280c1a=0xce;}_0x59ed5d[_0x34bd('0x15')](_0x280c1a);return _0x59ed5d[_0x34bd('0x1b')](_0x34bd('0x1c'),_0x6638ed+'-'+_0x30b3f2+'/'+_0x4e3886)[_0x34bd('0x17')](_0x4d4955);}return null;};}function patchUpdates(_0x48d2ba){return function(_0x10b977){try{jsonpatch[_0x34bd('0x1d')](_0x10b977,_0x48d2ba,!![]);}catch(_0x265e70){return BPromise[_0x34bd('0x1e')](_0x265e70);}return _0x10b977[_0x34bd('0x1f')]();};}function saveUpdates(_0x23a94a,_0x288638){return function(_0x3d5f76){if(_0x3d5f76){return _0x3d5f76[_0x34bd('0x20')](_0x23a94a)['then'](function(_0x15c0d1){return _0x15c0d1;});}return null;};}function removeEntity(_0xe02cc5,_0x49f625){return function(_0x14254b){if(_0x14254b){return _0x14254b[_0x34bd('0x21')]()['then'](function(){_0xe02cc5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4edf84,_0x3dafe8){return function(_0x503a60){if(!_0x503a60){_0x4edf84[_0x34bd('0x14')](0x194);}return _0x503a60;};}function handleError(_0x1c2282,_0x428140){_0x428140=_0x428140||0x1f4;return function(_0x5c3c85){logger[_0x34bd('0x22')](_0x5c3c85[_0x34bd('0x23')]);if(_0x5c3c85[_0x34bd('0x24')]){delete _0x5c3c85[_0x34bd('0x24')];}_0x1c2282['status'](_0x428140)[_0x34bd('0x25')](_0x5c3c85);};}exports[_0x34bd('0x26')]=function(_0x264c94,_0x3e4dc3){var _0x56baf7={},_0x45b4eb={},_0x3fe8b0={'count':0x0,'rows':[]};var _0x5d2e3d=db[_0x34bd('0x27')][_0x34bd('0x28')];_0x45b4eb[_0x34bd('0x29')]=_[_0x34bd('0x2a')](_0x5d2e3d);_0x45b4eb[_0x34bd('0x2b')]=_[_0x34bd('0x2a')](_0x264c94[_0x34bd('0x2b')]);_0x45b4eb['filters']=_[_0x34bd('0x2c')](_0x45b4eb[_0x34bd('0x29')],_0x45b4eb['query']);_0x56baf7['attributes']=_[_0x34bd('0x2c')](_0x45b4eb[_0x34bd('0x29')],qs[_0x34bd('0x2d')](_0x264c94['query']['fields']));_0x56baf7[_0x34bd('0x2e')]=_0x56baf7[_0x34bd('0x2e')][_0x34bd('0x2f')]?_0x56baf7[_0x34bd('0x2e')]:_0x45b4eb['model'];if(!_0x264c94[_0x34bd('0x2b')][_0x34bd('0x30')](_0x34bd('0x31'))){_0x56baf7[_0x34bd('0x1a')]=qs[_0x34bd('0x1a')](_0x264c94[_0x34bd('0x2b')]['limit']);_0x56baf7[_0x34bd('0x19')]=qs['offset'](_0x264c94[_0x34bd('0x2b')][_0x34bd('0x19')]);}_0x56baf7[_0x34bd('0x32')]=qs['sort'](_0x264c94[_0x34bd('0x2b')][_0x34bd('0x33')]);_0x56baf7['where']=qs[_0x34bd('0x34')](_[_0x34bd('0x35')](_0x264c94[_0x34bd('0x2b')],_0x45b4eb['filters']));if(_0x264c94[_0x34bd('0x2b')][_0x34bd('0x36')]){_0x56baf7['where']=_[_0x34bd('0x37')](_0x56baf7[_0x34bd('0x38')],{'$or':_[_0x34bd('0x39')](_0x5d2e3d,function(_0x243f6c){if(_0x243f6c[_0x34bd('0x3a')][_0x34bd('0x3b')]!=='VIRTUAL'){var _0x49c3ef={};_0x49c3ef[_0x243f6c['field']]={'$like':'%'+_0x264c94[_0x34bd('0x2b')][_0x34bd('0x36')]+'%'};return _0x49c3ef;}})});}_0x56baf7=_['merge']({},_0x56baf7,_0x264c94['options']);var _0x13d2f0={'where':_0x56baf7['where']};return db['FaxQueueReport'][_0x34bd('0x18')](_0x13d2f0)[_0x34bd('0x3c')](function(_0xa61859){_0x3fe8b0[_0x34bd('0x18')]=_0xa61859;if(_0x264c94[_0x34bd('0x2b')]['includeAll']){_0x56baf7['include']=[{'all':!![]}];}return db[_0x34bd('0x27')]['findAll'](_0x56baf7);})[_0x34bd('0x3c')](function(_0x2c9b7a){_0x3fe8b0[_0x34bd('0x3d')]=_0x2c9b7a;return _0x3fe8b0;})[_0x34bd('0x3c')](respondWithFilteredResult(_0x3e4dc3,_0x56baf7))[_0x34bd('0x3e')](handleError(_0x3e4dc3,null));};exports['show']=function(_0x282297,_0xc1f4c4){var _0x16858c={'raw':!![],'where':{'id':_0x282297['params']['id']}},_0x1b86e1={};_0x1b86e1[_0x34bd('0x29')]=_['keys'](db[_0x34bd('0x27')][_0x34bd('0x28')]);_0x1b86e1['query']=_[_0x34bd('0x2a')](_0x282297['query']);_0x1b86e1[_0x34bd('0x34')]=_[_0x34bd('0x2c')](_0x1b86e1[_0x34bd('0x29')],_0x1b86e1[_0x34bd('0x2b')]);_0x16858c[_0x34bd('0x2e')]=_[_0x34bd('0x2c')](_0x1b86e1[_0x34bd('0x29')],qs['fields'](_0x282297['query']['fields']));_0x16858c[_0x34bd('0x2e')]=_0x16858c[_0x34bd('0x2e')][_0x34bd('0x2f')]?_0x16858c[_0x34bd('0x2e')]:_0x1b86e1['model'];if(_0x282297[_0x34bd('0x2b')][_0x34bd('0x3f')]){_0x16858c[_0x34bd('0x40')]=[{'all':!![]}];}_0x16858c=_[_0x34bd('0x37')]({},_0x16858c,_0x282297[_0x34bd('0x41')]);return db['FaxQueueReport'][_0x34bd('0x42')](_0x16858c)['then'](handleEntityNotFound(_0xc1f4c4,null))['then'](respondWithResult(_0xc1f4c4,null))[_0x34bd('0x3e')](handleError(_0xc1f4c4,null));};exports['create']=function(_0x8474fb,_0x293457){return db[_0x34bd('0x27')][_0x34bd('0x43')](_0x8474fb[_0x34bd('0x44')],{})['then'](respondWithResult(_0x293457,0xc9))['catch'](handleError(_0x293457,null));};exports[_0x34bd('0x20')]=function(_0x51f892,_0x1f3db3){if(_0x51f892[_0x34bd('0x44')]['id']){delete _0x51f892[_0x34bd('0x44')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x51f892['params']['id']}})['then'](handleEntityNotFound(_0x1f3db3,null))[_0x34bd('0x3c')](saveUpdates(_0x51f892['body'],null))[_0x34bd('0x3c')](respondWithResult(_0x1f3db3,null))['catch'](handleError(_0x1f3db3,null));};exports[_0x34bd('0x21')]=function(_0x1d01d7,_0x1fa341){return db[_0x34bd('0x27')][_0x34bd('0x42')]({'where':{'id':_0x1d01d7['params']['id']}})[_0x34bd('0x3c')](handleEntityNotFound(_0x1fa341,null))[_0x34bd('0x3c')](removeEntity(_0x1fa341,null))[_0x34bd('0x3e')](handleError(_0x1fa341,null));};exports[_0x34bd('0x45')]=function(_0x173da0,_0x4be4fa){return db[_0x34bd('0x27')][_0x34bd('0x45')]()['then'](respondWithResult(_0x4be4fa,null))[_0x34bd('0x3e')](handleError(_0x4be4fa,null));}; \ No newline at end of file +var _0x1967=['merge','map','type','VIRTUAL','field','options','findAll','rows','catch','params','keys','find','create','body','destroy','describe','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','error','stack','name','index','FaxQueueReport','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x1967,0x173));var _0x7196=function(_0x36576d,_0x3032d8){_0x36576d=_0x36576d-0x0;var _0x2ba435=_0x1967[_0x36576d];return _0x2ba435;};'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 hardwareService=require('../../config/license/hardware');var logger=require(_0x7196('0x14'))(_0x7196('0x15'));var utils=require(_0x7196('0x16'));var config=require(_0x7196('0x17'));var db=require(_0x7196('0x18'))['db'];function respondWithStatusCode(_0x46f26c,_0x1bf0a5){_0x1bf0a5=_0x1bf0a5||0xcc;return function(_0x325641){if(_0x325641){return _0x46f26c[_0x7196('0x19')](_0x1bf0a5);}return _0x46f26c[_0x7196('0x1a')](_0x1bf0a5)[_0x7196('0x1b')]();};}function respondWithResult(_0x4e8c4c,_0x26a1ef){_0x26a1ef=_0x26a1ef||0xc8;return function(_0x3feccd){if(_0x3feccd){return _0x4e8c4c[_0x7196('0x1a')](_0x26a1ef)[_0x7196('0x1c')](_0x3feccd);}};}function respondWithFilteredResult(_0x511aa1,_0x31c778){return function(_0x539414){if(_0x539414){var _0xe32933=_0x539414[_0x7196('0x1d')],_0x2590a6=_0x31c778[_0x7196('0x1e')],_0xf7e97=_0x31c778[_0x7196('0x1e')]+_0x31c778[_0x7196('0x1f')],_0x3ed1ad;if(_0xf7e97>=_0xe32933){_0xf7e97=_0xe32933;_0x3ed1ad=0xc8;}else{_0x3ed1ad=0xce;}_0x511aa1[_0x7196('0x1a')](_0x3ed1ad);return _0x511aa1[_0x7196('0x20')](_0x7196('0x21'),_0x2590a6+'-'+_0xf7e97+'/'+_0xe32933)['json'](_0x539414);}return null;};}function patchUpdates(_0x4c4f91){return function(_0x448f13){try{jsonpatch[_0x7196('0x22')](_0x448f13,_0x4c4f91,!![]);}catch(_0x40418d){return BPromise['reject'](_0x40418d);}return _0x448f13[_0x7196('0x23')]();};}function saveUpdates(_0x539d8b,_0x5b25f0){return function(_0x296e07){if(_0x296e07){return _0x296e07[_0x7196('0x24')](_0x539d8b)[_0x7196('0x25')](function(_0x4ddf78){return _0x4ddf78;});}return null;};}function removeEntity(_0x57c390,_0x38d291){return function(_0x3cd8ff){if(_0x3cd8ff){return _0x3cd8ff['destroy']()[_0x7196('0x25')](function(){_0x57c390[_0x7196('0x1a')](0xcc)[_0x7196('0x1b')]();});}};}function handleEntityNotFound(_0x18d389,_0x38b3d6){return function(_0x549f34){if(!_0x549f34){_0x18d389[_0x7196('0x19')](0x194);}return _0x549f34;};}function handleError(_0x520d01,_0x3ce9a0){_0x3ce9a0=_0x3ce9a0||0x1f4;return function(_0x1b1f4b){logger[_0x7196('0x26')](_0x1b1f4b[_0x7196('0x27')]);if(_0x1b1f4b[_0x7196('0x28')]){delete _0x1b1f4b[_0x7196('0x28')];}_0x520d01['status'](_0x3ce9a0)['send'](_0x1b1f4b);};}exports[_0x7196('0x29')]=function(_0x2d284f,_0x184c09){var _0x4e878f={},_0x5aa538={},_0x41cfd2={'count':0x0,'rows':[]};var _0x162cfc=db[_0x7196('0x2a')]['rawAttributes'];_0x5aa538[_0x7196('0x2b')]=_['keys'](_0x162cfc);_0x5aa538[_0x7196('0x2c')]=_['keys'](_0x2d284f[_0x7196('0x2c')]);_0x5aa538[_0x7196('0x2d')]=_[_0x7196('0x2e')](_0x5aa538['model'],_0x5aa538[_0x7196('0x2c')]);_0x4e878f[_0x7196('0x2f')]=_[_0x7196('0x2e')](_0x5aa538[_0x7196('0x2b')],qs['fields'](_0x2d284f[_0x7196('0x2c')][_0x7196('0x30')]));_0x4e878f[_0x7196('0x2f')]=_0x4e878f[_0x7196('0x2f')][_0x7196('0x31')]?_0x4e878f[_0x7196('0x2f')]:_0x5aa538[_0x7196('0x2b')];if(!_0x2d284f[_0x7196('0x2c')][_0x7196('0x32')](_0x7196('0x33'))){_0x4e878f[_0x7196('0x1f')]=qs['limit'](_0x2d284f[_0x7196('0x2c')]['limit']);_0x4e878f[_0x7196('0x1e')]=qs['offset'](_0x2d284f[_0x7196('0x2c')][_0x7196('0x1e')]);}_0x4e878f['order']=qs[_0x7196('0x34')](_0x2d284f[_0x7196('0x2c')][_0x7196('0x34')]);_0x4e878f[_0x7196('0x35')]=qs[_0x7196('0x2d')](_['pick'](_0x2d284f[_0x7196('0x2c')],_0x5aa538[_0x7196('0x2d')]));if(_0x2d284f[_0x7196('0x2c')][_0x7196('0x36')]){_0x4e878f[_0x7196('0x35')]=_[_0x7196('0x37')](_0x4e878f['where'],{'$or':_[_0x7196('0x38')](_0x162cfc,function(_0xe04e44){if(_0xe04e44[_0x7196('0x39')]['key']!==_0x7196('0x3a')){var _0x75530e={};_0x75530e[_0xe04e44[_0x7196('0x3b')]]={'$like':'%'+_0x2d284f[_0x7196('0x2c')][_0x7196('0x36')]+'%'};return _0x75530e;}})});}_0x4e878f=_[_0x7196('0x37')]({},_0x4e878f,_0x2d284f[_0x7196('0x3c')]);var _0x1ab720={'where':_0x4e878f[_0x7196('0x35')]};return db[_0x7196('0x2a')]['count'](_0x1ab720)[_0x7196('0x25')](function(_0x17cefd){_0x41cfd2['count']=_0x17cefd;if(_0x2d284f[_0x7196('0x2c')]['includeAll']){_0x4e878f['include']=[{'all':!![]}];}return db[_0x7196('0x2a')][_0x7196('0x3d')](_0x4e878f);})['then'](function(_0x587f6f){_0x41cfd2[_0x7196('0x3e')]=_0x587f6f;return _0x41cfd2;})[_0x7196('0x25')](respondWithFilteredResult(_0x184c09,_0x4e878f))[_0x7196('0x3f')](handleError(_0x184c09,null));};exports['show']=function(_0x36a990,_0x2d13a5){var _0x29ba1c={'raw':!![],'where':{'id':_0x36a990[_0x7196('0x40')]['id']}},_0x29c58d={};_0x29c58d[_0x7196('0x2b')]=_[_0x7196('0x41')](db[_0x7196('0x2a')]['rawAttributes']);_0x29c58d[_0x7196('0x2c')]=_[_0x7196('0x41')](_0x36a990['query']);_0x29c58d[_0x7196('0x2d')]=_[_0x7196('0x2e')](_0x29c58d['model'],_0x29c58d[_0x7196('0x2c')]);_0x29ba1c[_0x7196('0x2f')]=_[_0x7196('0x2e')](_0x29c58d['model'],qs[_0x7196('0x30')](_0x36a990[_0x7196('0x2c')]['fields']));_0x29ba1c[_0x7196('0x2f')]=_0x29ba1c[_0x7196('0x2f')]['length']?_0x29ba1c[_0x7196('0x2f')]:_0x29c58d['model'];if(_0x36a990['query']['includeAll']){_0x29ba1c['include']=[{'all':!![]}];}_0x29ba1c=_['merge']({},_0x29ba1c,_0x36a990[_0x7196('0x3c')]);return db['FaxQueueReport'][_0x7196('0x42')](_0x29ba1c)[_0x7196('0x25')](handleEntityNotFound(_0x2d13a5,null))[_0x7196('0x25')](respondWithResult(_0x2d13a5,null))[_0x7196('0x3f')](handleError(_0x2d13a5,null));};exports['create']=function(_0x3f3171,_0x56ffdd){return db[_0x7196('0x2a')][_0x7196('0x43')](_0x3f3171[_0x7196('0x44')],{})['then'](respondWithResult(_0x56ffdd,0xc9))[_0x7196('0x3f')](handleError(_0x56ffdd,null));};exports[_0x7196('0x24')]=function(_0x1b5c68,_0x5b8f7a){if(_0x1b5c68['body']['id']){delete _0x1b5c68[_0x7196('0x44')]['id'];}return db['FaxQueueReport'][_0x7196('0x42')]({'where':{'id':_0x1b5c68['params']['id']}})['then'](handleEntityNotFound(_0x5b8f7a,null))[_0x7196('0x25')](saveUpdates(_0x1b5c68['body'],null))['then'](respondWithResult(_0x5b8f7a,null))['catch'](handleError(_0x5b8f7a,null));};exports[_0x7196('0x45')]=function(_0x5052ee,_0x48e3b5){return db[_0x7196('0x2a')][_0x7196('0x42')]({'where':{'id':_0x5052ee[_0x7196('0x40')]['id']}})[_0x7196('0x25')](handleEntityNotFound(_0x48e3b5,null))['then'](removeEntity(_0x48e3b5,null))[_0x7196('0x3f')](handleError(_0x48e3b5,null));};exports['describe']=function(_0x36844f,_0x143c58){return db['FaxQueueReport'][_0x7196('0x46')]()[_0x7196('0x25')](respondWithResult(_0x143c58,null))[_0x7196('0x3f')](handleError(_0x143c58,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index b5317c3..e6e8b50 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 _0x1bd8=['./faxQueueReport.attributes','exports','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1bd8,0x12a));var _0x81bd=function(_0x507631,_0x24b610){_0x507631=_0x507631-0x0;var _0x34783c=_0x1bd8[_0x507631];return _0x34783c;};'use strict';var _=require(_0x81bd('0x0'));var util=require(_0x81bd('0x1'));var logger=require(_0x81bd('0x2'))(_0x81bd('0x3'));var moment=require(_0x81bd('0x4'));var BPromise=require(_0x81bd('0x5'));var rp=require(_0x81bd('0x6'));var fs=require('fs');var path=require(_0x81bd('0x7'));var rimraf=require(_0x81bd('0x8'));var config=require(_0x81bd('0x9'));var attributes=require(_0x81bd('0xa'));module[_0x81bd('0xb')]=function(_0x1adbe0,_0x39e004){return _0x1adbe0['define']('FaxQueueReport',attributes,{'tableName':_0x81bd('0xc'),'paranoid':![],'indexes':[{'name':_0x81bd('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x324b=['define','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3eb630,_0x552586){var _0x1b840d=function(_0x2594a8){while(--_0x2594a8){_0x3eb630['push'](_0x3eb630['shift']());}};_0x1b840d(++_0x552586);}(_0x324b,0x1b1));var _0xb324=function(_0x11a926,_0x290308){_0x11a926=_0x11a926-0x0;var _0x2910e9=_0x324b[_0x11a926];return _0x2910e9;};'use strict';var _=require(_0xb324('0x0'));var util=require(_0xb324('0x1'));var logger=require(_0xb324('0x2'))(_0xb324('0x3'));var moment=require(_0xb324('0x4'));var BPromise=require(_0xb324('0x5'));var rp=require(_0xb324('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb324('0x7'));var config=require(_0xb324('0x8'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x52964a,_0x2e00c1){return _0x52964a[_0xb324('0x9')](_0xb324('0xa'),attributes,{'tableName':_0xb324('0xb'),'paranoid':![],'indexes':[{'name':_0xb324('0xc'),'fields':[_0xb324('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 2ed27ec..fb4853a 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 _0x2ee7=['then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','options','raw','UpdateFaxQueueReport','FaxQueueReport','update','body','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x2ee7,0x135));var _0x72ee=function(_0x2efeb4,_0x1cb245){_0x2efeb4=_0x2efeb4-0x0;var _0x49fc4b=_0x2ee7[_0x2efeb4];return _0x49fc4b;};'use strict';var _=require('lodash');var util=require(_0x72ee('0x0'));var moment=require(_0x72ee('0x1'));var BPromise=require(_0x72ee('0x2'));var rs=require(_0x72ee('0x3'));var fs=require('fs');var Redis=require(_0x72ee('0x4'));var db=require(_0x72ee('0x5'))['db'];var utils=require(_0x72ee('0x6'));var logger=require(_0x72ee('0x7'))(_0x72ee('0x8'));var config=require(_0x72ee('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x72ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a74d9,_0x482f22,_0x5258cc){return new BPromise(function(_0x3dd1f2,_0x25d698){return client['request'](_0x5a74d9,_0x5258cc)[_0x72ee('0xb')](function(_0x350b82){logger[_0x72ee('0xc')](_0x72ee('0xd'),_0x482f22,_0x72ee('0xe'));logger[_0x72ee('0xf')](_0x72ee('0x10'),_0x482f22,_0x72ee('0xe'),JSON[_0x72ee('0x11')](_0x350b82));if(_0x350b82[_0x72ee('0x12')]){if(_0x350b82['error'][_0x72ee('0x13')]===0x1f4){logger[_0x72ee('0x12')](_0x72ee('0xd'),_0x482f22,_0x350b82[_0x72ee('0x12')][_0x72ee('0x14')]);return _0x25d698(_0x350b82[_0x72ee('0x12')][_0x72ee('0x14')]);}logger['error'](_0x72ee('0xd'),_0x482f22,_0x350b82[_0x72ee('0x12')][_0x72ee('0x14')]);return _0x3dd1f2(_0x350b82['error'][_0x72ee('0x14')]);}else{logger['info'](_0x72ee('0xd'),_0x482f22,_0x72ee('0xe'));_0x3dd1f2(_0x350b82[_0x72ee('0x15')][_0x72ee('0x14')]);}})[_0x72ee('0x16')](function(_0x41e45f){logger[_0x72ee('0x12')](_0x72ee('0xd'),_0x482f22,_0x41e45f);_0x25d698(_0x41e45f);});});}exports[_0x72ee('0x17')]=function(_0x152a7e){var _0x648e84=this;return new Promise(function(_0xcb15b3,_0x367010){return db['FaxQueueReport']['create'](_0x152a7e['body'],{'raw':_0x152a7e[_0x72ee('0x18')]?_0x152a7e[_0x72ee('0x18')][_0x72ee('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x5c9a6d){logger[_0x72ee('0xc')](_0x72ee('0x17'),_0x152a7e);logger['debug'](_0x72ee('0x17'),_0x152a7e,JSON['stringify'](_0x5c9a6d));_0xcb15b3(_0x5c9a6d);})[_0x72ee('0x16')](function(_0x82a432){logger[_0x72ee('0x12')](_0x72ee('0x17'),_0x82a432['message'],_0x152a7e);_0x367010(_0x648e84['error'](0x1f4,_0x82a432[_0x72ee('0x14')]));});});};exports[_0x72ee('0x1a')]=function(_0x176213){var _0x316b3=this;return new Promise(function(_0x58ff21,_0x31259d){return db[_0x72ee('0x1b')][_0x72ee('0x1c')](_0x176213[_0x72ee('0x1d')],{'raw':_0x176213[_0x72ee('0x18')]?_0x176213[_0x72ee('0x18')][_0x72ee('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x176213[_0x72ee('0x18')]?_0x176213[_0x72ee('0x18')]['where']||null:null,'attributes':_0x176213[_0x72ee('0x18')]?_0x176213['options'][_0x72ee('0x1e')]||null:null,'limit':_0x176213['options']?_0x176213[_0x72ee('0x18')][_0x72ee('0x1f')]||null:null})[_0x72ee('0xb')](function(_0x2f6c26){logger['info'](_0x72ee('0x1a'),_0x176213);logger[_0x72ee('0xf')]('UpdateFaxQueueReport',_0x176213,JSON[_0x72ee('0x11')](_0x2f6c26));_0x58ff21(_0x2f6c26);})[_0x72ee('0x16')](function(_0x14e5fe){logger[_0x72ee('0x12')](_0x72ee('0x1a'),_0x14e5fe[_0x72ee('0x14')],_0x176213);_0x31259d(_0x316b3[_0x72ee('0x12')](0x1f4,_0x14e5fe[_0x72ee('0x14')]));});});}; \ No newline at end of file +var _0xceb9=['CreateFaxQueueReport','stringify','UpdateFaxQueueReport','update','body','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','FaxQueueReport,\x20%s,\x20%s','message','info','result','catch','FaxQueueReport','options','raw','then'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xceb9,0xfe));var _0x9ceb=function(_0x258d36,_0x5d93da){_0x258d36=_0x258d36-0x0;var _0x2fe804=_0xceb9[_0x258d36];return _0x2fe804;};'use strict';var _=require(_0x9ceb('0x0'));var util=require(_0x9ceb('0x1'));var moment=require(_0x9ceb('0x2'));var BPromise=require(_0x9ceb('0x3'));var rs=require(_0x9ceb('0x4'));var fs=require('fs');var Redis=require(_0x9ceb('0x5'));var db=require(_0x9ceb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ceb('0x7'))(_0x9ceb('0x8'));var config=require('../../config/environment');var jayson=require(_0x9ceb('0x9'));var client=jayson[_0x9ceb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3abd58,_0x51cba6,_0x1609e9){return new BPromise(function(_0x50436b,_0x3cc257){return client['request'](_0x3abd58,_0x1609e9)['then'](function(_0x3c9cee){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x51cba6,_0x9ceb('0xb'));logger[_0x9ceb('0xc')](_0x9ceb('0xd'),_0x51cba6,_0x9ceb('0xb'),JSON['stringify'](_0x3c9cee));if(_0x3c9cee[_0x9ceb('0xe')]){if(_0x3c9cee[_0x9ceb('0xe')][_0x9ceb('0xf')]===0x1f4){logger[_0x9ceb('0xe')](_0x9ceb('0x10'),_0x51cba6,_0x3c9cee[_0x9ceb('0xe')][_0x9ceb('0x11')]);return _0x3cc257(_0x3c9cee[_0x9ceb('0xe')]['message']);}logger[_0x9ceb('0xe')](_0x9ceb('0x10'),_0x51cba6,_0x3c9cee['error'][_0x9ceb('0x11')]);return _0x50436b(_0x3c9cee[_0x9ceb('0xe')][_0x9ceb('0x11')]);}else{logger[_0x9ceb('0x12')](_0x9ceb('0x10'),_0x51cba6,'request\x20sent');_0x50436b(_0x3c9cee[_0x9ceb('0x13')][_0x9ceb('0x11')]);}})[_0x9ceb('0x14')](function(_0x206dd0){logger['error'](_0x9ceb('0x10'),_0x51cba6,_0x206dd0);_0x3cc257(_0x206dd0);});});}exports['CreateFaxQueueReport']=function(_0x5066bc){var _0x131ae9=this;return new Promise(function(_0x40149a,_0x5229a1){return db[_0x9ceb('0x15')]['create'](_0x5066bc['body'],{'raw':_0x5066bc['options']?_0x5066bc[_0x9ceb('0x16')][_0x9ceb('0x17')]===undefined?!![]:![]:!![]})[_0x9ceb('0x18')](function(_0xfe46c1){logger[_0x9ceb('0x12')](_0x9ceb('0x19'),_0x5066bc);logger[_0x9ceb('0xc')](_0x9ceb('0x19'),_0x5066bc,JSON[_0x9ceb('0x1a')](_0xfe46c1));_0x40149a(_0xfe46c1);})[_0x9ceb('0x14')](function(_0x4bdd7b){logger[_0x9ceb('0xe')](_0x9ceb('0x19'),_0x4bdd7b['message'],_0x5066bc);_0x5229a1(_0x131ae9['error'](0x1f4,_0x4bdd7b[_0x9ceb('0x11')]));});});};exports[_0x9ceb('0x1b')]=function(_0x287927){var _0x321bd4=this;return new Promise(function(_0x14176a,_0x1a82c9){return db['FaxQueueReport'][_0x9ceb('0x1c')](_0x287927[_0x9ceb('0x1d')],{'raw':_0x287927[_0x9ceb('0x16')]?_0x287927[_0x9ceb('0x16')][_0x9ceb('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x287927[_0x9ceb('0x16')]?_0x287927[_0x9ceb('0x16')][_0x9ceb('0x1e')]||null:null,'attributes':_0x287927[_0x9ceb('0x16')]?_0x287927[_0x9ceb('0x16')]['attributes']||null:null,'limit':_0x287927[_0x9ceb('0x16')]?_0x287927[_0x9ceb('0x16')]['limit']||null:null})[_0x9ceb('0x18')](function(_0x1f0b27){logger[_0x9ceb('0x12')](_0x9ceb('0x1b'),_0x287927);logger['debug'](_0x9ceb('0x1b'),_0x287927,JSON[_0x9ceb('0x1a')](_0x1f0b27));_0x14176a(_0x1f0b27);})[_0x9ceb('0x14')](function(_0x4a1ac7){logger['error'](_0x9ceb('0x1b'),_0x4a1ac7['message'],_0x287927);_0x1a82c9(_0x321bd4[_0x9ceb('0xe')](0x1f4,_0x4a1ac7[_0x9ceb('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index b8512b2..09bba80 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 _0x52d0=['describe','show','post','create','put','update','delete','/:id','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','index','get','/describe'];(function(_0x47c428,_0x4c3280){var _0x339a70=function(_0x4df8ed){while(--_0x4df8ed){_0x47c428['push'](_0x47c428['shift']());}};_0x339a70(++_0x4c3280);}(_0x52d0,0x10d));var _0x052d=function(_0x13864a,_0x58f7b2){_0x13864a=_0x13864a-0x0;var _0x1fe91f=_0x52d0[_0x13864a];return _0x1fe91f;};'use strict';var multer=require('multer');var util=require(_0x052d('0x0'));var path=require(_0x052d('0x1'));var timeout=require('connect-timeout');var express=require(_0x052d('0x2'));var router=express['Router']();var auth=require(_0x052d('0x3'));var interaction=require(_0x052d('0x4'));var config=require(_0x052d('0x5'));var controller=require(_0x052d('0x6'));router['get']('/',auth[_0x052d('0x7')](),controller[_0x052d('0x8')]);router[_0x052d('0x9')](_0x052d('0xa'),auth[_0x052d('0x7')](),controller[_0x052d('0xb')]);router['get']('/:id',auth[_0x052d('0x7')](),controller[_0x052d('0xc')]);router[_0x052d('0xd')]('/',auth[_0x052d('0x7')](),controller[_0x052d('0xe')]);router[_0x052d('0xf')]('/:id',auth[_0x052d('0x7')](),controller[_0x052d('0x10')]);router[_0x052d('0x11')](_0x052d('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0x052d('0x13')]=router; \ No newline at end of file +var _0xf6c4=['./faxQueueReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','../../config/environment'];(function(_0x944c71,_0x2e9396){var _0x3fd4f9=function(_0x5de19c){while(--_0x5de19c){_0x944c71['push'](_0x944c71['shift']());}};_0x3fd4f9(++_0x2e9396);}(_0xf6c4,0xa6));var _0x4f6c=function(_0x1c4eaa,_0xeb8575){_0x1c4eaa=_0x1c4eaa-0x0;var _0x3182a3=_0xf6c4[_0x1c4eaa];return _0x3182a3;};'use strict';var multer=require(_0x4f6c('0x0'));var util=require(_0x4f6c('0x1'));var path=require(_0x4f6c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4f6c('0x3'));var controller=require(_0x4f6c('0x4'));router[_0x4f6c('0x5')]('/',auth[_0x4f6c('0x6')](),controller[_0x4f6c('0x7')]);router[_0x4f6c('0x5')](_0x4f6c('0x8'),auth[_0x4f6c('0x6')](),controller['describe']);router[_0x4f6c('0x5')]('/:id',auth[_0x4f6c('0x6')](),controller[_0x4f6c('0x9')]);router[_0x4f6c('0xa')]('/',auth[_0x4f6c('0x6')](),controller[_0x4f6c('0xb')]);router[_0x4f6c('0xc')](_0x4f6c('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x4f6c('0xe')](_0x4f6c('0xd'),auth[_0x4f6c('0x6')](),controller[_0x4f6c('0xf')]);module[_0x4f6c('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 93e0de3..d23dac5 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 _0x7983=['moment','exports','STRING','ENUM','account','agent','queue','NOW'];(function(_0x30726a,_0x5cef0c){var _0x471bd2=function(_0x3a34cf){while(--_0x3a34cf){_0x30726a['push'](_0x30726a['shift']());}};_0x471bd2(++_0x5cef0c);}(_0x7983,0xb0));var _0x3798=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7983[_0x2641f9];return _0x585741;};'use strict';var moment=require(_0x3798('0x0'));var Sequelize=require('sequelize');module[_0x3798('0x1')]={'uniqueid':{'type':Sequelize[_0x3798('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3798('0x3')](_0x3798('0x4'),_0x3798('0x5'),_0x3798('0x6')),'allowNull':![],'defaultValue':_0x3798('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x3798('0x7')]}}; \ No newline at end of file +var _0x647b=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x3e6ac0,_0x34b200){var _0xe1dee5=function(_0x8864a8){while(--_0x8864a8){_0x3e6ac0['push'](_0x3e6ac0['shift']());}};_0xe1dee5(++_0x34b200);}(_0x647b,0x1e9));var _0xb647=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x647b[_0x3b380d];return _0x54502b;};'use strict';var moment=require(_0xb647('0x0'));var Sequelize=require(_0xb647('0x1'));module[_0xb647('0x2')]={'uniqueid':{'type':Sequelize[_0xb647('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xb647('0x4'),_0xb647('0x5'),_0xb647('0x6')),'allowNull':![],'defaultValue':_0xb647('0x6')},'transferredAt':{'type':Sequelize[_0xb647('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xb647('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index c78b8a5..f200976 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 _0x9e9a=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','apply','reject','save','update','then','error','stack','name','send','index','FaxTransferReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','include','findAll','catch','params','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9e9a,0x89));var _0xa9e9=function(_0x231fb1,_0x53a98a){_0x231fb1=_0x231fb1-0x0;var _0x2221a6=_0x9e9a[_0x231fb1];return _0x2221a6;};'use strict';var pdf=require(_0xa9e9('0x0'));var emlformat=require(_0xa9e9('0x1'));var rimraf=require(_0xa9e9('0x2'));var zipdir=require(_0xa9e9('0x3'));var jsonpatch=require(_0xa9e9('0x4'));var rp=require('request-promise');var moment=require(_0xa9e9('0x5'));var BPromise=require(_0xa9e9('0x6'));var Mustache=require(_0xa9e9('0x7'));var util=require(_0xa9e9('0x8'));var path=require('path');var sox=require(_0xa9e9('0x9'));var csv=require(_0xa9e9('0xa'));var ejs=require(_0xa9e9('0xb'));var fs=require('fs');var _=require(_0xa9e9('0xc'));var squel=require(_0xa9e9('0xd'));var crypto=require(_0xa9e9('0xe'));var jsforce=require(_0xa9e9('0xf'));var deskjs=require(_0xa9e9('0x10'));var toCsv=require(_0xa9e9('0xa'));var querystring=require(_0xa9e9('0x11'));var Papa=require(_0xa9e9('0x12'));var Redis=require(_0xa9e9('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa9e9('0x14'));var hardwareService=require(_0xa9e9('0x15'));var logger=require(_0xa9e9('0x16'))(_0xa9e9('0x17'));var utils=require(_0xa9e9('0x18'));var config=require(_0xa9e9('0x19'));var db=require(_0xa9e9('0x1a'))['db'];function respondWithStatusCode(_0x4c239c,_0x5e07b5){_0x5e07b5=_0x5e07b5||0xcc;return function(_0x5984ef){if(_0x5984ef){return _0x4c239c[_0xa9e9('0x1b')](_0x5e07b5);}return _0x4c239c['status'](_0x5e07b5)[_0xa9e9('0x1c')]();};}function respondWithResult(_0x5a713f,_0x48faaf){_0x48faaf=_0x48faaf||0xc8;return function(_0x576207){if(_0x576207){return _0x5a713f[_0xa9e9('0x1d')](_0x48faaf)[_0xa9e9('0x1e')](_0x576207);}};}function respondWithFilteredResult(_0x2448ea,_0x49eda2){return function(_0x1129da){if(_0x1129da){var _0x429a8a=_0x1129da[_0xa9e9('0x1f')],_0x7d4d9c=_0x49eda2[_0xa9e9('0x20')],_0x39baa6=_0x49eda2['offset']+_0x49eda2['limit'],_0x312985;if(_0x39baa6>=_0x429a8a){_0x39baa6=_0x429a8a;_0x312985=0xc8;}else{_0x312985=0xce;}_0x2448ea[_0xa9e9('0x1d')](_0x312985);return _0x2448ea[_0xa9e9('0x21')]('Content-Range',_0x7d4d9c+'-'+_0x39baa6+'/'+_0x429a8a)[_0xa9e9('0x1e')](_0x1129da);}return null;};}function patchUpdates(_0x2df0f5){return function(_0xd12402){try{jsonpatch[_0xa9e9('0x22')](_0xd12402,_0x2df0f5,!![]);}catch(_0x3c54a5){return BPromise[_0xa9e9('0x23')](_0x3c54a5);}return _0xd12402[_0xa9e9('0x24')]();};}function saveUpdates(_0x101178,_0x12c552){return function(_0x41a904){if(_0x41a904){return _0x41a904[_0xa9e9('0x25')](_0x101178)[_0xa9e9('0x26')](function(_0x43b310){return _0x43b310;});}return null;};}function removeEntity(_0x57a847,_0x547d9d){return function(_0x2f0b91){if(_0x2f0b91){return _0x2f0b91['destroy']()[_0xa9e9('0x26')](function(){_0x57a847[_0xa9e9('0x1d')](0xcc)[_0xa9e9('0x1c')]();});}};}function handleEntityNotFound(_0x3a017b,_0x2f76a3){return function(_0x113204){if(!_0x113204){_0x3a017b['sendStatus'](0x194);}return _0x113204;};}function handleError(_0x55fd7a,_0x1d3479){_0x1d3479=_0x1d3479||0x1f4;return function(_0x3ab44c){logger[_0xa9e9('0x27')](_0x3ab44c[_0xa9e9('0x28')]);if(_0x3ab44c[_0xa9e9('0x29')]){delete _0x3ab44c[_0xa9e9('0x29')];}_0x55fd7a['status'](_0x1d3479)[_0xa9e9('0x2a')](_0x3ab44c);};}exports[_0xa9e9('0x2b')]=function(_0x56b8db,_0x30f4cc){var _0x33f826={},_0x14e1db={},_0x21f762={'count':0x0,'rows':[]};var _0x58601d=db[_0xa9e9('0x2c')][_0xa9e9('0x2d')];_0x14e1db[_0xa9e9('0x2e')]=_[_0xa9e9('0x2f')](_0x58601d);_0x14e1db[_0xa9e9('0x30')]=_['keys'](_0x56b8db[_0xa9e9('0x30')]);_0x14e1db[_0xa9e9('0x31')]=_['intersection'](_0x14e1db[_0xa9e9('0x2e')],_0x14e1db[_0xa9e9('0x30')]);_0x33f826[_0xa9e9('0x32')]=_[_0xa9e9('0x33')](_0x14e1db[_0xa9e9('0x2e')],qs[_0xa9e9('0x34')](_0x56b8db[_0xa9e9('0x30')][_0xa9e9('0x34')]));_0x33f826[_0xa9e9('0x32')]=_0x33f826[_0xa9e9('0x32')][_0xa9e9('0x35')]?_0x33f826[_0xa9e9('0x32')]:_0x14e1db[_0xa9e9('0x2e')];if(!_0x56b8db['query'][_0xa9e9('0x36')]('nolimit')){_0x33f826['limit']=qs['limit'](_0x56b8db[_0xa9e9('0x30')]['limit']);_0x33f826[_0xa9e9('0x20')]=qs[_0xa9e9('0x20')](_0x56b8db[_0xa9e9('0x30')][_0xa9e9('0x20')]);}_0x33f826[_0xa9e9('0x37')]=qs[_0xa9e9('0x38')](_0x56b8db[_0xa9e9('0x30')][_0xa9e9('0x38')]);_0x33f826[_0xa9e9('0x39')]=qs[_0xa9e9('0x31')](_[_0xa9e9('0x3a')](_0x56b8db['query'],_0x14e1db[_0xa9e9('0x31')]));if(_0x56b8db[_0xa9e9('0x30')][_0xa9e9('0x3b')]){_0x33f826['where']=_[_0xa9e9('0x3c')](_0x33f826[_0xa9e9('0x39')],{'$or':_[_0xa9e9('0x3d')](_0x58601d,function(_0x4d504e){if(_0x4d504e[_0xa9e9('0x3e')][_0xa9e9('0x3f')]!==_0xa9e9('0x40')){var _0x10310c={};_0x10310c[_0x4d504e['field']]={'$like':'%'+_0x56b8db[_0xa9e9('0x30')][_0xa9e9('0x3b')]+'%'};return _0x10310c;}})});}_0x33f826=_[_0xa9e9('0x3c')]({},_0x33f826,_0x56b8db[_0xa9e9('0x41')]);var _0x3b640c={'where':_0x33f826[_0xa9e9('0x39')]};return db[_0xa9e9('0x2c')][_0xa9e9('0x1f')](_0x3b640c)[_0xa9e9('0x26')](function(_0x116874){_0x21f762['count']=_0x116874;if(_0x56b8db[_0xa9e9('0x30')]['includeAll']){_0x33f826[_0xa9e9('0x42')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xa9e9('0x43')](_0x33f826);})[_0xa9e9('0x26')](function(_0x239703){_0x21f762['rows']=_0x239703;return _0x21f762;})[_0xa9e9('0x26')](respondWithFilteredResult(_0x30f4cc,_0x33f826))[_0xa9e9('0x44')](handleError(_0x30f4cc,null));};exports['show']=function(_0x2082ab,_0xa3ed25){var _0x4d0182={'raw':!![],'where':{'id':_0x2082ab[_0xa9e9('0x45')]['id']}},_0x3ef11c={};_0x3ef11c['model']=_[_0xa9e9('0x2f')](db['FaxTransferReport'][_0xa9e9('0x2d')]);_0x3ef11c['query']=_[_0xa9e9('0x2f')](_0x2082ab[_0xa9e9('0x30')]);_0x3ef11c[_0xa9e9('0x31')]=_[_0xa9e9('0x33')](_0x3ef11c['model'],_0x3ef11c['query']);_0x4d0182[_0xa9e9('0x32')]=_['intersection'](_0x3ef11c[_0xa9e9('0x2e')],qs[_0xa9e9('0x34')](_0x2082ab[_0xa9e9('0x30')][_0xa9e9('0x34')]));_0x4d0182['attributes']=_0x4d0182[_0xa9e9('0x32')][_0xa9e9('0x35')]?_0x4d0182[_0xa9e9('0x32')]:_0x3ef11c[_0xa9e9('0x2e')];if(_0x2082ab[_0xa9e9('0x30')][_0xa9e9('0x46')]){_0x4d0182[_0xa9e9('0x42')]=[{'all':!![]}];}_0x4d0182=_[_0xa9e9('0x3c')]({},_0x4d0182,_0x2082ab[_0xa9e9('0x41')]);return db[_0xa9e9('0x2c')][_0xa9e9('0x47')](_0x4d0182)[_0xa9e9('0x26')](handleEntityNotFound(_0xa3ed25,null))[_0xa9e9('0x26')](respondWithResult(_0xa3ed25,null))[_0xa9e9('0x44')](handleError(_0xa3ed25,null));};exports[_0xa9e9('0x48')]=function(_0x2ae21a,_0x377600){return db['FaxTransferReport'][_0xa9e9('0x48')](_0x2ae21a[_0xa9e9('0x49')],{})[_0xa9e9('0x26')](respondWithResult(_0x377600,0xc9))[_0xa9e9('0x44')](handleError(_0x377600,null));};exports[_0xa9e9('0x25')]=function(_0x24864a,_0x2f9ade){if(_0x24864a[_0xa9e9('0x49')]['id']){delete _0x24864a['body']['id'];}return db['FaxTransferReport'][_0xa9e9('0x47')]({'where':{'id':_0x24864a['params']['id']}})[_0xa9e9('0x26')](handleEntityNotFound(_0x2f9ade,null))[_0xa9e9('0x26')](saveUpdates(_0x24864a[_0xa9e9('0x49')],null))[_0xa9e9('0x26')](respondWithResult(_0x2f9ade,null))[_0xa9e9('0x44')](handleError(_0x2f9ade,null));};exports['destroy']=function(_0x5788bd,_0xd8426f){return db[_0xa9e9('0x2c')]['find']({'where':{'id':_0x5788bd[_0xa9e9('0x45')]['id']}})[_0xa9e9('0x26')](handleEntityNotFound(_0xd8426f,null))[_0xa9e9('0x26')](removeEntity(_0xd8426f,null))[_0xa9e9('0x44')](handleError(_0xd8426f,null));};exports[_0xa9e9('0x4a')]=function(_0x50833e,_0x149b71){return db[_0xa9e9('0x2c')][_0xa9e9('0x4a')]()['then'](respondWithResult(_0x149b71,null))[_0xa9e9('0x44')](handleError(_0x149b71,null));}; \ No newline at end of file +var _0x8de9=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','apply','update','then','destroy','stack','name','send','index','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','merge','map','type','key','VIRTUAL','field','options','where','FaxTransferReport','findAll','rows','catch','params','rawAttributes','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis'];(function(_0x579ea6,_0x2e27e1){var _0x337448=function(_0x2c8966){while(--_0x2c8966){_0x579ea6['push'](_0x579ea6['shift']());}};_0x337448(++_0x2e27e1);}(_0x8de9,0x1e2));var _0x98de=function(_0x5bbb93,_0x5806e0){_0x5bbb93=_0x5bbb93-0x0;var _0x2c8b9b=_0x8de9[_0x5bbb93];return _0x2c8b9b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x98de('0x0'));var rimraf=require(_0x98de('0x1'));var zipdir=require(_0x98de('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x98de('0x3'));var BPromise=require(_0x98de('0x4'));var Mustache=require('mustache');var util=require(_0x98de('0x5'));var path=require(_0x98de('0x6'));var sox=require(_0x98de('0x7'));var csv=require(_0x98de('0x8'));var ejs=require(_0x98de('0x9'));var fs=require('fs');var _=require(_0x98de('0xa'));var squel=require(_0x98de('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x98de('0xc'));var toCsv=require(_0x98de('0x8'));var querystring=require(_0x98de('0xd'));var Papa=require('papaparse');var Redis=require(_0x98de('0xe'));var authService=require(_0x98de('0xf'));var qs=require(_0x98de('0x10'));var hardwareService=require(_0x98de('0x11'));var logger=require('../../config/logger')(_0x98de('0x12'));var utils=require(_0x98de('0x13'));var config=require(_0x98de('0x14'));var db=require(_0x98de('0x15'))['db'];function respondWithStatusCode(_0x47b200,_0xc90c52){_0xc90c52=_0xc90c52||0xcc;return function(_0xf73918){if(_0xf73918){return _0x47b200['sendStatus'](_0xc90c52);}return _0x47b200[_0x98de('0x16')](_0xc90c52)[_0x98de('0x17')]();};}function respondWithResult(_0x6d3c6b,_0x2b3546){_0x2b3546=_0x2b3546||0xc8;return function(_0x19a9d3){if(_0x19a9d3){return _0x6d3c6b[_0x98de('0x16')](_0x2b3546)['json'](_0x19a9d3);}};}function respondWithFilteredResult(_0x111e16,_0x382f0f){return function(_0x57e219){if(_0x57e219){var _0x36412f=_0x57e219[_0x98de('0x18')],_0x349d9f=_0x382f0f[_0x98de('0x19')],_0x222cf6=_0x382f0f[_0x98de('0x19')]+_0x382f0f[_0x98de('0x1a')],_0x20e7c6;if(_0x222cf6>=_0x36412f){_0x222cf6=_0x36412f;_0x20e7c6=0xc8;}else{_0x20e7c6=0xce;}_0x111e16[_0x98de('0x16')](_0x20e7c6);return _0x111e16[_0x98de('0x1b')](_0x98de('0x1c'),_0x349d9f+'-'+_0x222cf6+'/'+_0x36412f)['json'](_0x57e219);}return null;};}function patchUpdates(_0x9c9c72){return function(_0x233f57){try{jsonpatch[_0x98de('0x1d')](_0x233f57,_0x9c9c72,!![]);}catch(_0x353b1a){return BPromise['reject'](_0x353b1a);}return _0x233f57['save']();};}function saveUpdates(_0x4890dd,_0xfd0e98){return function(_0x22415a){if(_0x22415a){return _0x22415a[_0x98de('0x1e')](_0x4890dd)[_0x98de('0x1f')](function(_0x17e2be){return _0x17e2be;});}return null;};}function removeEntity(_0x5b4b23,_0x3890a8){return function(_0x41c1ee){if(_0x41c1ee){return _0x41c1ee[_0x98de('0x20')]()[_0x98de('0x1f')](function(){_0x5b4b23[_0x98de('0x16')](0xcc)[_0x98de('0x17')]();});}};}function handleEntityNotFound(_0x2b4479,_0x5bfb49){return function(_0x3bfc41){if(!_0x3bfc41){_0x2b4479['sendStatus'](0x194);}return _0x3bfc41;};}function handleError(_0x2905f6,_0x4ca745){_0x4ca745=_0x4ca745||0x1f4;return function(_0x3b7c3e){logger['error'](_0x3b7c3e[_0x98de('0x21')]);if(_0x3b7c3e[_0x98de('0x22')]){delete _0x3b7c3e[_0x98de('0x22')];}_0x2905f6[_0x98de('0x16')](_0x4ca745)[_0x98de('0x23')](_0x3b7c3e);};}exports[_0x98de('0x24')]=function(_0x5ea56c,_0x36d9bd){var _0x26bbdb={},_0x412bbe={},_0x14e565={'count':0x0,'rows':[]};var _0x4f0825=db['FaxTransferReport']['rawAttributes'];_0x412bbe['model']=_[_0x98de('0x25')](_0x4f0825);_0x412bbe[_0x98de('0x26')]=_['keys'](_0x5ea56c[_0x98de('0x26')]);_0x412bbe['filters']=_[_0x98de('0x27')](_0x412bbe[_0x98de('0x28')],_0x412bbe[_0x98de('0x26')]);_0x26bbdb[_0x98de('0x29')]=_[_0x98de('0x27')](_0x412bbe[_0x98de('0x28')],qs[_0x98de('0x2a')](_0x5ea56c[_0x98de('0x26')]['fields']));_0x26bbdb[_0x98de('0x29')]=_0x26bbdb[_0x98de('0x29')][_0x98de('0x2b')]?_0x26bbdb[_0x98de('0x29')]:_0x412bbe[_0x98de('0x28')];if(!_0x5ea56c[_0x98de('0x26')][_0x98de('0x2c')](_0x98de('0x2d'))){_0x26bbdb['limit']=qs[_0x98de('0x1a')](_0x5ea56c['query'][_0x98de('0x1a')]);_0x26bbdb[_0x98de('0x19')]=qs[_0x98de('0x19')](_0x5ea56c['query']['offset']);}_0x26bbdb[_0x98de('0x2e')]=qs[_0x98de('0x2f')](_0x5ea56c['query'][_0x98de('0x2f')]);_0x26bbdb['where']=qs['filters'](_[_0x98de('0x30')](_0x5ea56c['query'],_0x412bbe[_0x98de('0x31')]));if(_0x5ea56c['query'][_0x98de('0x32')]){_0x26bbdb['where']=_[_0x98de('0x33')](_0x26bbdb['where'],{'$or':_[_0x98de('0x34')](_0x4f0825,function(_0x4c4bf3){if(_0x4c4bf3[_0x98de('0x35')][_0x98de('0x36')]!==_0x98de('0x37')){var _0x7e24c5={};_0x7e24c5[_0x4c4bf3[_0x98de('0x38')]]={'$like':'%'+_0x5ea56c[_0x98de('0x26')]['filter']+'%'};return _0x7e24c5;}})});}_0x26bbdb=_[_0x98de('0x33')]({},_0x26bbdb,_0x5ea56c[_0x98de('0x39')]);var _0x42cbc9={'where':_0x26bbdb[_0x98de('0x3a')]};return db[_0x98de('0x3b')][_0x98de('0x18')](_0x42cbc9)['then'](function(_0x4f0d4b){_0x14e565['count']=_0x4f0d4b;if(_0x5ea56c[_0x98de('0x26')]['includeAll']){_0x26bbdb['include']=[{'all':!![]}];}return db[_0x98de('0x3b')][_0x98de('0x3c')](_0x26bbdb);})['then'](function(_0x41abad){_0x14e565[_0x98de('0x3d')]=_0x41abad;return _0x14e565;})['then'](respondWithFilteredResult(_0x36d9bd,_0x26bbdb))[_0x98de('0x3e')](handleError(_0x36d9bd,null));};exports['show']=function(_0x3e7a71,_0x3b9b4b){var _0xf707a6={'raw':!![],'where':{'id':_0x3e7a71[_0x98de('0x3f')]['id']}},_0x4a9e00={};_0x4a9e00[_0x98de('0x28')]=_[_0x98de('0x25')](db[_0x98de('0x3b')][_0x98de('0x40')]);_0x4a9e00[_0x98de('0x26')]=_[_0x98de('0x25')](_0x3e7a71['query']);_0x4a9e00[_0x98de('0x31')]=_[_0x98de('0x27')](_0x4a9e00[_0x98de('0x28')],_0x4a9e00[_0x98de('0x26')]);_0xf707a6[_0x98de('0x29')]=_[_0x98de('0x27')](_0x4a9e00[_0x98de('0x28')],qs['fields'](_0x3e7a71['query']['fields']));_0xf707a6[_0x98de('0x29')]=_0xf707a6[_0x98de('0x29')]['length']?_0xf707a6[_0x98de('0x29')]:_0x4a9e00[_0x98de('0x28')];if(_0x3e7a71[_0x98de('0x26')][_0x98de('0x41')]){_0xf707a6[_0x98de('0x42')]=[{'all':!![]}];}_0xf707a6=_['merge']({},_0xf707a6,_0x3e7a71[_0x98de('0x39')]);return db[_0x98de('0x3b')][_0x98de('0x43')](_0xf707a6)[_0x98de('0x1f')](handleEntityNotFound(_0x3b9b4b,null))[_0x98de('0x1f')](respondWithResult(_0x3b9b4b,null))[_0x98de('0x3e')](handleError(_0x3b9b4b,null));};exports[_0x98de('0x44')]=function(_0x18eac1,_0x220620){return db[_0x98de('0x3b')]['create'](_0x18eac1[_0x98de('0x45')],{})['then'](respondWithResult(_0x220620,0xc9))[_0x98de('0x3e')](handleError(_0x220620,null));};exports[_0x98de('0x1e')]=function(_0x2960c7,_0x1d3a06){if(_0x2960c7[_0x98de('0x45')]['id']){delete _0x2960c7['body']['id'];}return db['FaxTransferReport'][_0x98de('0x43')]({'where':{'id':_0x2960c7['params']['id']}})[_0x98de('0x1f')](handleEntityNotFound(_0x1d3a06,null))[_0x98de('0x1f')](saveUpdates(_0x2960c7[_0x98de('0x45')],null))[_0x98de('0x1f')](respondWithResult(_0x1d3a06,null))[_0x98de('0x3e')](handleError(_0x1d3a06,null));};exports[_0x98de('0x20')]=function(_0x108830,_0x4ba769){return db[_0x98de('0x3b')][_0x98de('0x43')]({'where':{'id':_0x108830['params']['id']}})['then'](handleEntityNotFound(_0x4ba769,null))['then'](removeEntity(_0x4ba769,null))['catch'](handleError(_0x4ba769,null));};exports['describe']=function(_0x393db5,_0x5c5463){return db[_0x98de('0x3b')][_0x98de('0x46')]()['then'](respondWithResult(_0x5c5463,null))['catch'](handleError(_0x5c5463,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 1b7d819..60622ac 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 _0xe74d=['bluebird','request-promise','path','rimraf','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','api','moment'];(function(_0x16771b,_0x5003ff){var _0x4a54ef=function(_0x44c02e){while(--_0x44c02e){_0x16771b['push'](_0x16771b['shift']());}};_0x4a54ef(++_0x5003ff);}(_0xe74d,0x11b));var _0xde74=function(_0x3a9661,_0x530b12){_0x3a9661=_0x3a9661-0x0;var _0x5bb119=_0xe74d[_0x3a9661];return _0x5bb119;};'use strict';var _=require(_0xde74('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xde74('0x1'));var moment=require(_0xde74('0x2'));var BPromise=require(_0xde74('0x3'));var rp=require(_0xde74('0x4'));var fs=require('fs');var path=require(_0xde74('0x5'));var rimraf=require(_0xde74('0x6'));var config=require('../../config/environment');var attributes=require(_0xde74('0x7'));module[_0xde74('0x8')]=function(_0x1d54a7,_0x5b1cb3){return _0x1d54a7[_0xde74('0x9')](_0xde74('0xa'),attributes,{'tableName':_0xde74('0xb'),'paranoid':![],'indexes':[{'name':_0xde74('0xc'),'fields':[_0xde74('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x15a3=['exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x46efc2,_0x1c191d){var _0x38d7bf=function(_0x48f3f1){while(--_0x48f3f1){_0x46efc2['push'](_0x46efc2['shift']());}};_0x38d7bf(++_0x1c191d);}(_0x15a3,0x1e1));var _0x315a=function(_0x2b012b,_0x463e28){_0x2b012b=_0x2b012b-0x0;var _0x32c4cf=_0x15a3[_0x2b012b];return _0x32c4cf;};'use strict';var _=require(_0x315a('0x0'));var util=require(_0x315a('0x1'));var logger=require(_0x315a('0x2'))(_0x315a('0x3'));var moment=require(_0x315a('0x4'));var BPromise=require(_0x315a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x315a('0x6'));var rimraf=require(_0x315a('0x7'));var config=require(_0x315a('0x8'));var attributes=require('./faxTransferReport.attributes');module[_0x315a('0x9')]=function(_0x49e5b9,_0x3fc30e){return _0x49e5b9[_0x315a('0xa')](_0x315a('0xb'),attributes,{'tableName':_0x315a('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x315a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 0d04c01..6bb0aed 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 _0xa73f=['http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0xa73f,0x195));var _0xfa73=function(_0x5426e5,_0x3bccbe){_0x5426e5=_0x5426e5-0x0;var _0x5640a2=_0xa73f[_0x5426e5];return _0x5640a2;};'use strict';var _=require(_0xfa73('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfa73('0x1'));var rs=require(_0xfa73('0x2'));var fs=require('fs');var Redis=require(_0xfa73('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa73('0x4'));var logger=require(_0xfa73('0x5'))('rpc');var config=require(_0xfa73('0x6'));var jayson=require(_0xfa73('0x7'));var client=jayson[_0xfa73('0x8')][_0xfa73('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38c0c5,_0xc5e1a6,_0x25f599){return new BPromise(function(_0x2a277a,_0x209807){return client[_0xfa73('0xa')](_0x38c0c5,_0x25f599)[_0xfa73('0xb')](function(_0x14fc95){logger['info'](_0xfa73('0xc'),_0xc5e1a6,_0xfa73('0xd'));logger[_0xfa73('0xe')](_0xfa73('0xf'),_0xc5e1a6,_0xfa73('0xd'),JSON[_0xfa73('0x10')](_0x14fc95));if(_0x14fc95[_0xfa73('0x11')]){if(_0x14fc95[_0xfa73('0x11')][_0xfa73('0x12')]===0x1f4){logger['error'](_0xfa73('0xc'),_0xc5e1a6,_0x14fc95[_0xfa73('0x11')][_0xfa73('0x13')]);return _0x209807(_0x14fc95[_0xfa73('0x11')][_0xfa73('0x13')]);}logger[_0xfa73('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0xc5e1a6,_0x14fc95[_0xfa73('0x11')][_0xfa73('0x13')]);return _0x2a277a(_0x14fc95[_0xfa73('0x11')][_0xfa73('0x13')]);}else{logger[_0xfa73('0x14')](_0xfa73('0xc'),_0xc5e1a6,_0xfa73('0xd'));_0x2a277a(_0x14fc95[_0xfa73('0x15')]['message']);}})[_0xfa73('0x16')](function(_0x3d7a8d){logger[_0xfa73('0x11')](_0xfa73('0xc'),_0xc5e1a6,_0x3d7a8d);_0x209807(_0x3d7a8d);});});} \ No newline at end of file +var _0x93c9=['FaxTransferReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x93c9,0x8d));var _0x993c=function(_0x217aa7,_0x3b9bad){_0x217aa7=_0x217aa7-0x0;var _0x51c3f5=_0x93c9[_0x217aa7];return _0x51c3f5;};'use strict';var _=require('lodash');var util=require(_0x993c('0x0'));var moment=require(_0x993c('0x1'));var BPromise=require(_0x993c('0x2'));var rs=require(_0x993c('0x3'));var fs=require('fs');var Redis=require(_0x993c('0x4'));var db=require(_0x993c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x993c('0x6'))(_0x993c('0x7'));var config=require(_0x993c('0x8'));var jayson=require(_0x993c('0x9'));var client=jayson[_0x993c('0xa')][_0x993c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2af274,_0x1c50f9,_0x114041){return new BPromise(function(_0x23c1e0,_0x1c6d93){return client[_0x993c('0xc')](_0x2af274,_0x114041)[_0x993c('0xd')](function(_0x4017ab){logger[_0x993c('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x1c50f9,_0x993c('0xf'));logger[_0x993c('0x10')](_0x993c('0x11'),_0x1c50f9,_0x993c('0xf'),JSON[_0x993c('0x12')](_0x4017ab));if(_0x4017ab['error']){if(_0x4017ab[_0x993c('0x13')]['code']===0x1f4){logger[_0x993c('0x13')](_0x993c('0x14'),_0x1c50f9,_0x4017ab[_0x993c('0x13')][_0x993c('0x15')]);return _0x1c6d93(_0x4017ab[_0x993c('0x13')][_0x993c('0x15')]);}logger['error'](_0x993c('0x14'),_0x1c50f9,_0x4017ab['error'][_0x993c('0x15')]);return _0x23c1e0(_0x4017ab[_0x993c('0x13')]['message']);}else{logger[_0x993c('0xe')](_0x993c('0x14'),_0x1c50f9,'request\x20sent');_0x23c1e0(_0x4017ab['result'][_0x993c('0x15')]);}})[_0x993c('0x16')](function(_0x2abb03){logger[_0x993c('0x13')](_0x993c('0x14'),_0x1c50f9,_0x2abb03);_0x1c6d93(_0x2abb03);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 66fadfd..239e79d 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 _0x1b5f=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x49ac5e,_0x4bf35d){var _0x5640ce=function(_0x520bf8){while(--_0x520bf8){_0x49ac5e['push'](_0x49ac5e['shift']());}};_0x5640ce(++_0x4bf35d);}(_0x1b5f,0x162));var _0xf1b5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1b5f[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0xf1b5('0x0'));var path=require(_0xf1b5('0x1'));var timeout=require(_0xf1b5('0x2'));var express=require(_0xf1b5('0x3'));var router=express[_0xf1b5('0x4')]();var auth=require(_0xf1b5('0x5'));var interaction=require(_0xf1b5('0x6'));var config=require(_0xf1b5('0x7'));var controller=require('./faxTransferReport.controller');router['get']('/',auth[_0xf1b5('0x8')](),controller[_0xf1b5('0x9')]);router[_0xf1b5('0xa')](_0xf1b5('0xb'),auth[_0xf1b5('0x8')](),controller[_0xf1b5('0xc')]);router[_0xf1b5('0xa')](_0xf1b5('0xd'),auth['isAuthenticated'](),controller[_0xf1b5('0xe')]);router[_0xf1b5('0xf')]('/',auth[_0xf1b5('0x8')](),controller[_0xf1b5('0x10')]);router[_0xf1b5('0x11')]('/:id',auth[_0xf1b5('0x8')](),controller['update']);router[_0xf1b5('0x12')]('/:id',auth[_0xf1b5('0x8')](),controller[_0xf1b5('0x13')]);module[_0xf1b5('0x14')]=router; \ No newline at end of file +var _0x9ea1=['get','isAuthenticated','index','describe','/:id','show','post','put','delete','destroy','exports','util','express','../../components/auth/service','../../config/environment','./faxTransferReport.controller'];(function(_0x357862,_0x259d11){var _0x4db1a6=function(_0x46c601){while(--_0x46c601){_0x357862['push'](_0x357862['shift']());}};_0x4db1a6(++_0x259d11);}(_0x9ea1,0x12b));var _0x19ea=function(_0x5d0d68,_0x2b8f0a){_0x5d0d68=_0x5d0d68-0x0;var _0x2a3829=_0x9ea1[_0x5d0d68];return _0x2a3829;};'use strict';var multer=require('multer');var util=require(_0x19ea('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x19ea('0x1'));var router=express['Router']();var auth=require(_0x19ea('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x19ea('0x3'));var controller=require(_0x19ea('0x4'));router[_0x19ea('0x5')]('/',auth[_0x19ea('0x6')](),controller[_0x19ea('0x7')]);router[_0x19ea('0x5')]('/describe',auth[_0x19ea('0x6')](),controller[_0x19ea('0x8')]);router[_0x19ea('0x5')](_0x19ea('0x9'),auth[_0x19ea('0x6')](),controller[_0x19ea('0xa')]);router[_0x19ea('0xb')]('/',auth[_0x19ea('0x6')](),controller['create']);router[_0x19ea('0xc')](_0x19ea('0x9'),auth[_0x19ea('0x6')](),controller['update']);router[_0x19ea('0xd')](_0x19ea('0x9'),auth[_0x19ea('0x6')](),controller[_0x19ea('0xe')]);module[_0x19ea('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index dab669e..5415d6e 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 _0x3c6c=['create','/:id/configurations','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','get','getConfigurations','/:id/fields','getFields','post'];(function(_0x4c26b2,_0x5774f2){var _0x7a2b58=function(_0x49d4a3){while(--_0x49d4a3){_0x4c26b2['push'](_0x4c26b2['shift']());}};_0x7a2b58(++_0x5774f2);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x1a5bdd,_0x1f952d){_0x1a5bdd=_0x1a5bdd-0x0;var _0x3703fb=_0x3c6c[_0x1a5bdd];return _0x3703fb;};'use strict';var multer=require(_0xc3c6('0x0'));var util=require('util');var path=require(_0xc3c6('0x1'));var timeout=require(_0xc3c6('0x2'));var express=require(_0xc3c6('0x3'));var router=express[_0xc3c6('0x4')]();var auth=require(_0xc3c6('0x5'));var interaction=require(_0xc3c6('0x6'));var config=require(_0xc3c6('0x7'));var controller=require(_0xc3c6('0x8'));router['get']('/',auth[_0xc3c6('0x9')](),controller['index']);router[_0xc3c6('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/configurations',auth[_0xc3c6('0x9')](),controller[_0xc3c6('0xb')]);router['get'](_0xc3c6('0xc'),auth[_0xc3c6('0x9')](),controller[_0xc3c6('0xd')]);router[_0xc3c6('0xe')]('/',auth['isAuthenticated'](),controller[_0xc3c6('0xf')]);router[_0xc3c6('0xe')](_0xc3c6('0x10'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xc3c6('0x11')](_0xc3c6('0x12'),auth[_0xc3c6('0x9')](),controller[_0xc3c6('0x13')]);router[_0xc3c6('0x14')](_0xc3c6('0x12'),auth[_0xc3c6('0x9')](),controller[_0xc3c6('0x15')]);module[_0xc3c6('0x16')]=router; \ No newline at end of file +var _0xcb99=['getFields','post','put','update','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations'];(function(_0x1fccf4,_0x50146d){var _0x519fde=function(_0x5e0517){while(--_0x5e0517){_0x1fccf4['push'](_0x1fccf4['shift']());}};_0x519fde(++_0x50146d);}(_0xcb99,0x8b));var _0x9cb9=function(_0x498334,_0x27b6fe){_0x498334=_0x498334-0x0;var _0x13bb70=_0xcb99[_0x498334];return _0x13bb70;};'use strict';var multer=require(_0x9cb9('0x0'));var util=require('util');var path=require(_0x9cb9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9cb9('0x2')]();var auth=require(_0x9cb9('0x3'));var interaction=require(_0x9cb9('0x4'));var config=require('../../config/environment');var controller=require(_0x9cb9('0x5'));router[_0x9cb9('0x6')]('/',auth['isAuthenticated'](),controller[_0x9cb9('0x7')]);router['get'](_0x9cb9('0x8'),auth[_0x9cb9('0x9')](),controller[_0x9cb9('0xa')]);router[_0x9cb9('0x6')](_0x9cb9('0xb'),auth[_0x9cb9('0x9')](),controller[_0x9cb9('0xc')]);router[_0x9cb9('0x6')]('/:id/fields',auth['isAuthenticated'](),controller[_0x9cb9('0xd')]);router[_0x9cb9('0xe')]('/',auth[_0x9cb9('0x9')](),controller['create']);router[_0x9cb9('0xe')](_0x9cb9('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x9cb9('0xf')](_0x9cb9('0x8'),auth[_0x9cb9('0x9')](),controller[_0x9cb9('0x10')]);router['delete'](_0x9cb9('0x8'),auth[_0x9cb9('0x9')](),controller[_0x9cb9('0x11')]);module[_0x9cb9('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 588619a..9700447 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 _0x6727=['basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x52e040,_0x583d2f){var _0x4cd278=function(_0xa844b5){while(--_0xa844b5){_0x52e040['push'](_0x52e040['shift']());}};_0x4cd278(++_0x583d2f);}(_0x6727,0xab));var _0x7672=function(_0x3dacb8,_0x48eab5){_0x3dacb8=_0x3dacb8-0x0;var _0x16d5a0=_0x6727[_0x3dacb8];return _0x16d5a0;};'use strict';var Sequelize=require(_0x7672('0x0'));module[_0x7672('0x1')]={'name':{'type':Sequelize[_0x7672('0x2')]},'description':{'type':Sequelize[_0x7672('0x2')]},'username':{'type':Sequelize[_0x7672('0x2')]},'remoteUri':{'type':Sequelize[_0x7672('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x7672('0x3')),'defaultValue':_0x7672('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x7672('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x7672('0x2')]},'tokenSecret':{'type':Sequelize[_0x7672('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x7672('0x4'),_0x7672('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x3cdb=['ENUM','basic','sequelize','exports','STRING'];(function(_0x2f5975,_0x359c61){var _0x2d7775=function(_0x3bfb27){while(--_0x3bfb27){_0x2f5975['push'](_0x2f5975['shift']());}};_0x2d7775(++_0x359c61);}(_0x3cdb,0x16a));var _0xb3cd=function(_0x1d0499,_0x23e22f){_0x1d0499=_0x1d0499-0x0;var _0x153fb3=_0x3cdb[_0x1d0499];return _0x153fb3;};'use strict';var Sequelize=require(_0xb3cd('0x0'));module[_0xb3cd('0x1')]={'name':{'type':Sequelize[_0xb3cd('0x2')]},'description':{'type':Sequelize[_0xb3cd('0x2')]},'username':{'type':Sequelize[_0xb3cd('0x2')]},'remoteUri':{'type':Sequelize[_0xb3cd('0x2')]},'authType':{'type':Sequelize[_0xb3cd('0x3')]('basic'),'defaultValue':_0xb3cd('0x4')},'password':{'type':Sequelize[_0xb3cd('0x2')]},'consumerKey':{'type':Sequelize[_0xb3cd('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xb3cd('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb3cd('0x2')]},'type':{'type':Sequelize[_0xb3cd('0x3')]('integrationTab','newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 4a73637..a494964 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 _0x032d=['show','params','includeAll','find','create','update','body','getConfigurations','findOne','DeskConfiguration','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','base64','concat','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/integrations/configuration','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskAccount,\x20%s,\x20%s','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','save','destroy','stack','name','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','DeskAccount','include','findAll','rows'];(function(_0x51cbf2,_0x4c6358){var _0x5903af=function(_0x545e17){while(--_0x545e17){_0x51cbf2['push'](_0x51cbf2['shift']());}};_0x5903af(++_0x4c6358);}(_0x032d,0x11a));var _0xd032=function(_0x1fcfdc,_0x59ec1b){_0x1fcfdc=_0x1fcfdc-0x0;var _0x43aaf1=_0x032d[_0x1fcfdc];return _0x43aaf1;};'use strict';var pdf=require(_0xd032('0x0'));var emlformat=require(_0xd032('0x1'));var rimraf=require(_0xd032('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd032('0x3'));var rp=require('request-promise');var moment=require(_0xd032('0x4'));var BPromise=require(_0xd032('0x5'));var Mustache=require(_0xd032('0x6'));var util=require(_0xd032('0x7'));var path=require('path');var sox=require(_0xd032('0x8'));var csv=require(_0xd032('0x9'));var ejs=require(_0xd032('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd032('0xb'));var deskjs=require(_0xd032('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd032('0xd'));var Papa=require(_0xd032('0xe'));var Redis=require(_0xd032('0xf'));var authService=require(_0xd032('0x10'));var qs=require(_0xd032('0x11'));var hardwareService=require(_0xd032('0x12'));var logger=require(_0xd032('0x13'))(_0xd032('0x14'));var utils=require('../../config/utils');var config=require(_0xd032('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xd032('0x16'));var jayson=require('jayson/promise');var client=jayson[_0xd032('0x17')][_0xd032('0x18')]({'port':0x232a});function checkPasswordPattern(_0x35111e,_0x766f99,_0x3170cb){if(_0x3170cb){var _0x4b9def=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4b9def[_0xd032('0x19')](_0x766f99)){return _0x35111e;}else{throw new Error(_0xd032('0x1a'));}}else{return _0x35111e;}}function respondWithRpcPromise(_0x4c9da4,_0x3c8d5d,_0x220b5b,_0x42a1e){return new BPromise(function(_0x85605f,_0x5813c2){var _0x5703ec=_0x42a1e||client;return _0x5703ec[_0xd032('0x1b')](_0x4c9da4,_0x220b5b)[_0xd032('0x1c')](function(_0x5bf1f8){logger['info']('DeskAccount,\x20%s,\x20%s',_0x3c8d5d,_0xd032('0x1d'));logger['debug'](_0xd032('0x1e'),_0x3c8d5d,_0xd032('0x1d'),JSON[_0xd032('0x1f')](_0x5bf1f8));if(_0x5bf1f8[_0xd032('0x20')]){if(_0x5bf1f8[_0xd032('0x20')][_0xd032('0x21')]===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x3c8d5d,_0x5bf1f8[_0xd032('0x20')][_0xd032('0x22')]);return _0x5813c2(_0x5bf1f8[_0xd032('0x20')][_0xd032('0x22')]);}logger[_0xd032('0x20')](_0xd032('0x23'),_0x3c8d5d,_0x5bf1f8['error'][_0xd032('0x22')]);return _0x85605f(_0x5bf1f8[_0xd032('0x20')][_0xd032('0x22')]);}else{logger[_0xd032('0x24')](_0xd032('0x23'),_0x3c8d5d,_0xd032('0x1d'));_0x85605f(_0x5bf1f8[_0xd032('0x25')]['message']);}})[_0xd032('0x26')](function(_0x35d18e){logger[_0xd032('0x20')](_0xd032('0x23'),_0x3c8d5d,_0x35d18e);_0x5813c2(_0x35d18e);});});}function respondWithStatusCode(_0x3e9427,_0x566bd7){_0x566bd7=_0x566bd7||0xcc;return function(_0x1d760a){if(_0x1d760a){return _0x3e9427[_0xd032('0x27')](_0x566bd7);}return _0x3e9427[_0xd032('0x28')](_0x566bd7)[_0xd032('0x29')]();};}function respondWithResult(_0x4b6bfe,_0x195cd4){_0x195cd4=_0x195cd4||0xc8;return function(_0x27d57d){if(_0x27d57d){return _0x4b6bfe[_0xd032('0x28')](_0x195cd4)[_0xd032('0x2a')](_0x27d57d);}};}function respondWithFilteredResult(_0x33ac9d,_0x40ffa1){return function(_0x588f32){if(_0x588f32){var _0x56ff40=_0x588f32[_0xd032('0x2b')],_0x295459=_0x40ffa1[_0xd032('0x2c')],_0x5524c1=_0x40ffa1[_0xd032('0x2c')]+_0x40ffa1[_0xd032('0x2d')],_0x1822b2;if(_0x5524c1>=_0x56ff40){_0x5524c1=_0x56ff40;_0x1822b2=0xc8;}else{_0x1822b2=0xce;}_0x33ac9d[_0xd032('0x28')](_0x1822b2);return _0x33ac9d[_0xd032('0x2e')]('Content-Range',_0x295459+'-'+_0x5524c1+'/'+_0x56ff40)['json'](_0x588f32);}return null;};}function patchUpdates(_0x4186bc){return function(_0x25b11f){try{jsonpatch['apply'](_0x25b11f,_0x4186bc,!![]);}catch(_0x13bda6){return BPromise['reject'](_0x13bda6);}return _0x25b11f[_0xd032('0x2f')]();};}function saveUpdates(_0x4c1b26,_0x40e5c6){return function(_0x2a07d2){if(_0x2a07d2){return _0x2a07d2['update'](_0x4c1b26)[_0xd032('0x1c')](function(_0x1ac2ae){return _0x1ac2ae;});}return null;};}function removeEntity(_0x29e59a,_0x574e5f){return function(_0x81e85d){if(_0x81e85d){return _0x81e85d[_0xd032('0x30')]()['then'](function(){_0x29e59a[_0xd032('0x28')](0xcc)[_0xd032('0x29')]();});}};}function handleEntityNotFound(_0x47b09c,_0x310db4){return function(_0x7211f6){if(!_0x7211f6){_0x47b09c[_0xd032('0x27')](0x194);}return _0x7211f6;};}function handleError(_0x2b0af8,_0x2366cf){_0x2366cf=_0x2366cf||0x1f4;return function(_0x282753){logger[_0xd032('0x20')](_0x282753[_0xd032('0x31')]);if(_0x282753['name']){delete _0x282753[_0xd032('0x32')];}_0x2b0af8[_0xd032('0x28')](_0x2366cf)['send'](_0x282753);};}exports[_0xd032('0x33')]=function(_0xd2dc15,_0x10c8f6){var _0x116b8e={},_0x1b6990={},_0x160ca5={'count':0x0,'rows':[]};var _0x3a57be=db['DeskAccount'][_0xd032('0x34')];_0x1b6990[_0xd032('0x35')]=_['keys'](_0x3a57be);_0x1b6990[_0xd032('0x36')]=_[_0xd032('0x37')](_0xd2dc15['query']);_0x1b6990[_0xd032('0x38')]=_[_0xd032('0x39')](_0x1b6990[_0xd032('0x35')],_0x1b6990[_0xd032('0x36')]);_0x116b8e[_0xd032('0x3a')]=_[_0xd032('0x39')](_0x1b6990[_0xd032('0x35')],qs['fields'](_0xd2dc15['query'][_0xd032('0x3b')]));_0x116b8e[_0xd032('0x3a')]=_0x116b8e[_0xd032('0x3a')][_0xd032('0x3c')]?_0x116b8e[_0xd032('0x3a')]:_0x1b6990[_0xd032('0x35')];if(!_0xd2dc15['query'][_0xd032('0x3d')]('nolimit')){_0x116b8e[_0xd032('0x2d')]=qs[_0xd032('0x2d')](_0xd2dc15[_0xd032('0x36')][_0xd032('0x2d')]);_0x116b8e[_0xd032('0x2c')]=qs[_0xd032('0x2c')](_0xd2dc15[_0xd032('0x36')][_0xd032('0x2c')]);}_0x116b8e[_0xd032('0x3e')]=qs[_0xd032('0x3f')](_0xd2dc15[_0xd032('0x36')][_0xd032('0x3f')]);_0x116b8e[_0xd032('0x40')]=qs[_0xd032('0x38')](_[_0xd032('0x41')](_0xd2dc15[_0xd032('0x36')],_0x1b6990[_0xd032('0x38')]));if(_0xd2dc15[_0xd032('0x36')][_0xd032('0x42')]){_0x116b8e[_0xd032('0x40')]=_[_0xd032('0x43')](_0x116b8e[_0xd032('0x40')],{'$or':_[_0xd032('0x44')](_0x3a57be,function(_0x4b30d9){if(_0x4b30d9[_0xd032('0x45')][_0xd032('0x46')]!==_0xd032('0x47')){var _0x5c057c={};_0x5c057c[_0x4b30d9[_0xd032('0x48')]]={'$like':'%'+_0xd2dc15['query'][_0xd032('0x42')]+'%'};return _0x5c057c;}})});}_0x116b8e=_[_0xd032('0x43')]({},_0x116b8e,_0xd2dc15[_0xd032('0x49')]);var _0x2a2d19={'where':_0x116b8e[_0xd032('0x40')]};return db[_0xd032('0x4a')][_0xd032('0x2b')](_0x2a2d19)['then'](function(_0x1e5799){_0x160ca5[_0xd032('0x2b')]=_0x1e5799;if(_0xd2dc15[_0xd032('0x36')]['includeAll']){_0x116b8e[_0xd032('0x4b')]=[{'all':!![]}];}return db['DeskAccount'][_0xd032('0x4c')](_0x116b8e);})['then'](function(_0x4bd750){_0x160ca5[_0xd032('0x4d')]=_0x4bd750;return _0x160ca5;})[_0xd032('0x1c')](respondWithFilteredResult(_0x10c8f6,_0x116b8e))[_0xd032('0x26')](handleError(_0x10c8f6,null));};exports[_0xd032('0x4e')]=function(_0x2a7389,_0x1ff99f){var _0x746c10={'raw':![],'where':{'id':_0x2a7389[_0xd032('0x4f')]['id']}},_0x1a3586={};_0x1a3586[_0xd032('0x35')]=_[_0xd032('0x37')](db['DeskAccount'][_0xd032('0x34')]);_0x1a3586[_0xd032('0x36')]=_[_0xd032('0x37')](_0x2a7389[_0xd032('0x36')]);_0x1a3586[_0xd032('0x38')]=_[_0xd032('0x39')](_0x1a3586[_0xd032('0x35')],_0x1a3586['query']);_0x746c10[_0xd032('0x3a')]=_['intersection'](_0x1a3586[_0xd032('0x35')],qs[_0xd032('0x3b')](_0x2a7389['query'][_0xd032('0x3b')]));_0x746c10[_0xd032('0x3a')]=_0x746c10[_0xd032('0x3a')]['length']?_0x746c10[_0xd032('0x3a')]:_0x1a3586[_0xd032('0x35')];if(_0x2a7389['query'][_0xd032('0x50')]){_0x746c10[_0xd032('0x4b')]=[{'all':!![]}];}_0x746c10=_[_0xd032('0x43')]({},_0x746c10,_0x2a7389[_0xd032('0x49')]);return db[_0xd032('0x4a')][_0xd032('0x51')](_0x746c10)[_0xd032('0x1c')](handleEntityNotFound(_0x1ff99f,null))[_0xd032('0x1c')](respondWithResult(_0x1ff99f,null))['catch'](handleError(_0x1ff99f,null));};exports[_0xd032('0x52')]=function(_0x28e50c,_0x375d2d){return db[_0xd032('0x4a')][_0xd032('0x52')](_0x28e50c['body'],{})['then'](respondWithResult(_0x375d2d,0xc9))[_0xd032('0x26')](handleError(_0x375d2d,null));};exports[_0xd032('0x53')]=function(_0x2b6fdf,_0x335207){if(_0x2b6fdf['body']['id']){delete _0x2b6fdf[_0xd032('0x54')]['id'];}return db[_0xd032('0x4a')][_0xd032('0x51')]({'where':{'id':_0x2b6fdf['params']['id']}})[_0xd032('0x1c')](handleEntityNotFound(_0x335207,null))[_0xd032('0x1c')](saveUpdates(_0x2b6fdf[_0xd032('0x54')],null))[_0xd032('0x1c')](respondWithResult(_0x335207,null))[_0xd032('0x26')](handleError(_0x335207,null));};exports[_0xd032('0x30')]=function(_0x33b13a,_0x102eb9){return db[_0xd032('0x4a')][_0xd032('0x51')]({'where':{'id':_0x33b13a[_0xd032('0x4f')]['id']}})[_0xd032('0x1c')](handleEntityNotFound(_0x102eb9,null))[_0xd032('0x1c')](removeEntity(_0x102eb9,null))[_0xd032('0x26')](handleError(_0x102eb9,null));};exports[_0xd032('0x55')]=function(_0x338edb,_0x5bdfd2,_0x1f576b){var _0x348a61={};var _0x50d8ae={};var _0x5c1711;var _0x48b476;return db[_0xd032('0x4a')][_0xd032('0x56')]({'where':{'id':_0x338edb['params']['id']}})[_0xd032('0x1c')](handleEntityNotFound(_0x5bdfd2,null))[_0xd032('0x1c')](function(_0x503f58){if(_0x503f58){_0x5c1711=_0x503f58;_0x50d8ae[_0xd032('0x35')]=_['keys'](db[_0xd032('0x57')][_0xd032('0x34')]);_0x50d8ae[_0xd032('0x36')]=_['keys'](_0x338edb[_0xd032('0x36')]);_0x50d8ae[_0xd032('0x38')]=_[_0xd032('0x39')](_0x50d8ae['model'],_0x50d8ae['query']);_0x348a61[_0xd032('0x3a')]=_[_0xd032('0x39')](_0x50d8ae[_0xd032('0x35')],qs[_0xd032('0x3b')](_0x338edb[_0xd032('0x36')][_0xd032('0x3b')]));_0x348a61[_0xd032('0x3a')]=_0x348a61[_0xd032('0x3a')][_0xd032('0x3c')]?_0x348a61['attributes']:_0x50d8ae[_0xd032('0x35')];_0x348a61['order']=qs['sort'](_0x338edb['query'][_0xd032('0x3f')]);_0x348a61[_0xd032('0x40')]=qs['filters'](_['pick'](_0x338edb[_0xd032('0x36')],_0x50d8ae[_0xd032('0x38')]));if(_0x338edb[_0xd032('0x36')][_0xd032('0x42')]){_0x348a61[_0xd032('0x40')]=_['merge'](_0x348a61['where'],{'$or':_['map'](_0x348a61[_0xd032('0x3a')],function(_0x4def64){var _0x594344={};_0x594344[_0x4def64]={'$like':'%'+_0x338edb['query'][_0xd032('0x42')]+'%'};return _0x594344;})});}_0x348a61=_[_0xd032('0x43')]({},_0x348a61,_0x338edb[_0xd032('0x49')]);return _0x5c1711[_0xd032('0x55')](_0x348a61);}})[_0xd032('0x1c')](function(_0x651902){if(_0x651902){_0x48b476=_0x651902[_0xd032('0x3c')];if(!_0x338edb[_0xd032('0x36')][_0xd032('0x3d')](_0xd032('0x58'))){_0x348a61['limit']=qs[_0xd032('0x2d')](_0x338edb[_0xd032('0x36')]['limit']);_0x348a61[_0xd032('0x2c')]=qs[_0xd032('0x2c')](_0x338edb[_0xd032('0x36')]['offset']);}return _0x5c1711[_0xd032('0x55')](_0x348a61);}})[_0xd032('0x1c')](function(_0x63c89a){if(_0x63c89a){return _0x63c89a?{'count':_0x48b476,'rows':_0x63c89a}:null;}})[_0xd032('0x1c')](respondWithResult(_0x5bdfd2,null))['catch'](handleError(_0x5bdfd2,null));};exports[_0xd032('0x59')]=function(_0x4c2c7d,_0x39d219,_0x5c8381){if(_0x4c2c7d[_0xd032('0x54')]['id']){delete _0x4c2c7d[_0xd032('0x54')]['id'];}return db[_0xd032('0x4a')]['findOne']({'where':{'id':_0x4c2c7d[_0xd032('0x4f')]['id']}})[_0xd032('0x1c')](handleEntityNotFound(_0x39d219,null))['then'](function(_0xceefb4){if(_0xceefb4){_0x4c2c7d[_0xd032('0x54')][_0xd032('0x5a')]=_0xceefb4['id'];_0x4c2c7d[_0xd032('0x54')]['Subjects']=integrations[_0xd032('0x5b')](_0x4c2c7d[_0xd032('0x54')][_0xd032('0x5c')],_0x4c2c7d[_0xd032('0x54')]['type']);_0x4c2c7d[_0xd032('0x54')][_0xd032('0x5d')]=integrations[_0xd032('0x5e')](_0x4c2c7d[_0xd032('0x54')]['channel'],_0x4c2c7d[_0xd032('0x54')][_0xd032('0x45')]);return db['DeskConfiguration']['create'](_0x4c2c7d[_0xd032('0x54')],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db[_0xd032('0x5f')],'as':_0xd032('0x5d')}]});}return null;})['then'](respondWithResult(_0x39d219,null))['catch'](handleError(_0x39d219,null));};exports[_0xd032('0x60')]=function(_0x4e7480,_0xfa1c51,_0x4556f1){var _0x32c620=[{'name':_0xd032('0x61'),'label':_0xd032('0x61'),'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 _0x3e7ea8='';return db['DeskAccount'][_0xd032('0x56')]({'where':{'id':_0x4e7480[_0xd032('0x4f')]['id']},'attributes':['id',_0xd032('0x62'),_0xd032('0x63'),_0xd032('0x64'),_0xd032('0x65'),_0xd032('0x66'),_0xd032('0x67'),'token',_0xd032('0x68')]})[_0xd032('0x1c')](handleEntityNotFound(_0xfa1c51,null))[_0xd032('0x1c')](function(_0x1bc327){if(_0x1bc327){_0x3e7ea8=_0x1bc327[_0xd032('0x62')];var _0x27f848=_0x3e7ea8[_0xd032('0x69')](-0x1);if(_0x27f848==='/'){_0x3e7ea8=_0x3e7ea8[_0xd032('0x6a')](0x0,_0x3e7ea8[_0xd032('0x6b')](_0x27f848));}var _0x4adbc8={'method':_0xd032('0x6c'),'uri':util[_0xd032('0x6d')](_0xd032('0x6e'),_0x3e7ea8),'headers':{'Content-Type':'application/json','Accept':_0xd032('0x6f')},'json':!![]};if(_0x1bc327['authType']===_0xd032('0x70')){_0x4adbc8[_0xd032('0x71')][_0xd032('0x72')]=util['format'](_0xd032('0x73'),new Buffer(util['format']('%s:%s',_0x1bc327[_0xd032('0x64')],_0x1bc327[_0xd032('0x65')]))['toString'](_0xd032('0x74')));}return rp(_0x4adbc8)[_0xd032('0x1c')](function(_0x505094){return _0x32c620[_0xd032('0x75')](_[_0xd032('0x44')](_0x505094['_embedded']['entries'],function(_0x1b30bb){return{'id':_0x1b30bb[_0xd032('0x32')],'name':_0x1b30bb[_0xd032('0x32')],'type':_0x1b30bb[_0xd032('0x45')],'active':_0x1b30bb['active'],'label':_0x1b30bb['label'],'custom':!![]};}));});}})[_0xd032('0x1c')](function(_0x4f87a5){return{'count':_0x4f87a5[_0xd032('0x3c')],'rows':_0x4f87a5};})[_0xd032('0x1c')](respondWithResult(_0xfa1c51,null))[_0xd032('0x26')](function(_0x4f3da2){var _0x9beef0=_0x4e7480[_0xd032('0x36')]['test']?0x1f4:_0x4f3da2['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xd032('0x60'),_0x9beef0,JSON[_0xd032('0x1f')](_0x4f3da2));delete _0x4f3da2[_0xd032('0x32')];if(_0x9beef0===0x191){_0x9beef0=0x190;}_0xfa1c51[_0xd032('0x28')](_0x9beef0)[_0xd032('0x76')](_0x4e7480[_0xd032('0x36')][_0xd032('0x19')]?{'message':_0xd032('0x77'),'statusCode':_0x4f3da2['statusCode']}:_0x4f3da2);});}; \ No newline at end of file +var _0xeab3=['catch','end','status','json','count','offset','limit','set','apply','reject','save','update','destroy','sendStatus','stack','name','index','DeskAccount','rawAttributes','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','type','VIRTUAL','field','merge','options','includeAll','include','findAll','show','params','create','body','find','findOne','DeskConfiguration','sort','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','%s:%s','toString','map','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xeab3,0xd1));var _0x3eab=function(_0x42ca58,_0x423bf9){_0x42ca58=_0x42ca58-0x0;var _0x1a3a40=_0xeab3[_0x42ca58];return _0x1a3a40;};'use strict';var pdf=require(_0x3eab('0x0'));var emlformat=require(_0x3eab('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3eab('0x2'));var jsonpatch=require(_0x3eab('0x3'));var rp=require(_0x3eab('0x4'));var moment=require(_0x3eab('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3eab('0x6'));var util=require(_0x3eab('0x7'));var path=require('path');var sox=require(_0x3eab('0x8'));var csv=require(_0x3eab('0x9'));var ejs=require(_0x3eab('0xa'));var fs=require('fs');var _=require(_0x3eab('0xb'));var squel=require('squel');var crypto=require(_0x3eab('0xc'));var jsforce=require(_0x3eab('0xd'));var deskjs=require(_0x3eab('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3eab('0xf'));var Papa=require(_0x3eab('0x10'));var Redis=require(_0x3eab('0x11'));var authService=require(_0x3eab('0x12'));var qs=require(_0x3eab('0x13'));var hardwareService=require(_0x3eab('0x14'));var logger=require('../../config/logger')(_0x3eab('0x15'));var utils=require(_0x3eab('0x16'));var config=require(_0x3eab('0x17'));var db=require(_0x3eab('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x3eab('0x19'));var client=jayson['client'][_0x3eab('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x51a572,_0x453c30,_0x1e6119){if(_0x1e6119){var _0x2ec26a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ec26a[_0x3eab('0x1b')](_0x453c30)){return _0x51a572;}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 _0x51a572;}}function respondWithRpcPromise(_0x24e325,_0x24cf8f,_0x11565e,_0x2feb17){return new BPromise(function(_0x1fb70d,_0x65bb75){var _0x30da14=_0x2feb17||client;return _0x30da14[_0x3eab('0x1c')](_0x24e325,_0x11565e)[_0x3eab('0x1d')](function(_0x59e718){logger[_0x3eab('0x1e')](_0x3eab('0x1f'),_0x24cf8f,_0x3eab('0x20'));logger[_0x3eab('0x21')](_0x3eab('0x22'),_0x24cf8f,'request\x20sent',JSON['stringify'](_0x59e718));if(_0x59e718[_0x3eab('0x23')]){if(_0x59e718[_0x3eab('0x23')][_0x3eab('0x24')]===0x1f4){logger['error'](_0x3eab('0x1f'),_0x24cf8f,_0x59e718['error'][_0x3eab('0x25')]);return _0x65bb75(_0x59e718[_0x3eab('0x23')][_0x3eab('0x25')]);}logger[_0x3eab('0x23')](_0x3eab('0x1f'),_0x24cf8f,_0x59e718[_0x3eab('0x23')][_0x3eab('0x25')]);return _0x1fb70d(_0x59e718['error'][_0x3eab('0x25')]);}else{logger[_0x3eab('0x1e')](_0x3eab('0x1f'),_0x24cf8f,_0x3eab('0x20'));_0x1fb70d(_0x59e718[_0x3eab('0x26')][_0x3eab('0x25')]);}})[_0x3eab('0x27')](function(_0xc4cc1a){logger[_0x3eab('0x23')](_0x3eab('0x1f'),_0x24cf8f,_0xc4cc1a);_0x65bb75(_0xc4cc1a);});});}function respondWithStatusCode(_0x10f830,_0x3d24e4){_0x3d24e4=_0x3d24e4||0xcc;return function(_0x74d21c){if(_0x74d21c){return _0x10f830['sendStatus'](_0x3d24e4);}return _0x10f830['status'](_0x3d24e4)[_0x3eab('0x28')]();};}function respondWithResult(_0x2958c9,_0x4d9e40){_0x4d9e40=_0x4d9e40||0xc8;return function(_0x1bf5c0){if(_0x1bf5c0){return _0x2958c9[_0x3eab('0x29')](_0x4d9e40)[_0x3eab('0x2a')](_0x1bf5c0);}};}function respondWithFilteredResult(_0x279d1b,_0xc17b4d){return function(_0x3acc07){if(_0x3acc07){var _0x3f2476=_0x3acc07[_0x3eab('0x2b')],_0x13d6c9=_0xc17b4d[_0x3eab('0x2c')],_0x9d9a6d=_0xc17b4d['offset']+_0xc17b4d[_0x3eab('0x2d')],_0x41d717;if(_0x9d9a6d>=_0x3f2476){_0x9d9a6d=_0x3f2476;_0x41d717=0xc8;}else{_0x41d717=0xce;}_0x279d1b['status'](_0x41d717);return _0x279d1b[_0x3eab('0x2e')]('Content-Range',_0x13d6c9+'-'+_0x9d9a6d+'/'+_0x3f2476)[_0x3eab('0x2a')](_0x3acc07);}return null;};}function patchUpdates(_0x4f8ee5){return function(_0x208a53){try{jsonpatch[_0x3eab('0x2f')](_0x208a53,_0x4f8ee5,!![]);}catch(_0x311090){return BPromise[_0x3eab('0x30')](_0x311090);}return _0x208a53[_0x3eab('0x31')]();};}function saveUpdates(_0x761d55,_0x5a471f){return function(_0x511c70){if(_0x511c70){return _0x511c70[_0x3eab('0x32')](_0x761d55)['then'](function(_0x43801f){return _0x43801f;});}return null;};}function removeEntity(_0x2ee738,_0x328dff){return function(_0x38bc75){if(_0x38bc75){return _0x38bc75[_0x3eab('0x33')]()[_0x3eab('0x1d')](function(){_0x2ee738[_0x3eab('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31a590,_0x50930b){return function(_0x12d70c){if(!_0x12d70c){_0x31a590[_0x3eab('0x34')](0x194);}return _0x12d70c;};}function handleError(_0x572f2d,_0x530851){_0x530851=_0x530851||0x1f4;return function(_0x4089eb){logger[_0x3eab('0x23')](_0x4089eb[_0x3eab('0x35')]);if(_0x4089eb['name']){delete _0x4089eb[_0x3eab('0x36')];}_0x572f2d[_0x3eab('0x29')](_0x530851)['send'](_0x4089eb);};}exports[_0x3eab('0x37')]=function(_0x58f82a,_0x41269f){var _0x360b79={},_0x588ff4={},_0x5196c6={'count':0x0,'rows':[]};var _0x49d091=db[_0x3eab('0x38')][_0x3eab('0x39')];_0x588ff4['model']=_[_0x3eab('0x3a')](_0x49d091);_0x588ff4[_0x3eab('0x3b')]=_[_0x3eab('0x3a')](_0x58f82a[_0x3eab('0x3b')]);_0x588ff4['filters']=_['intersection'](_0x588ff4[_0x3eab('0x3c')],_0x588ff4[_0x3eab('0x3b')]);_0x360b79[_0x3eab('0x3d')]=_[_0x3eab('0x3e')](_0x588ff4['model'],qs[_0x3eab('0x3f')](_0x58f82a[_0x3eab('0x3b')][_0x3eab('0x3f')]));_0x360b79['attributes']=_0x360b79['attributes'][_0x3eab('0x40')]?_0x360b79['attributes']:_0x588ff4['model'];if(!_0x58f82a[_0x3eab('0x3b')][_0x3eab('0x41')](_0x3eab('0x42'))){_0x360b79[_0x3eab('0x2d')]=qs[_0x3eab('0x2d')](_0x58f82a[_0x3eab('0x3b')][_0x3eab('0x2d')]);_0x360b79[_0x3eab('0x2c')]=qs['offset'](_0x58f82a[_0x3eab('0x3b')][_0x3eab('0x2c')]);}_0x360b79[_0x3eab('0x43')]=qs['sort'](_0x58f82a[_0x3eab('0x3b')]['sort']);_0x360b79[_0x3eab('0x44')]=qs[_0x3eab('0x45')](_[_0x3eab('0x46')](_0x58f82a['query'],_0x588ff4['filters']));if(_0x58f82a['query'][_0x3eab('0x47')]){_0x360b79['where']=_['merge'](_0x360b79[_0x3eab('0x44')],{'$or':_['map'](_0x49d091,function(_0x3eb06e){if(_0x3eb06e[_0x3eab('0x48')]['key']!==_0x3eab('0x49')){var _0x243616={};_0x243616[_0x3eb06e[_0x3eab('0x4a')]]={'$like':'%'+_0x58f82a[_0x3eab('0x3b')]['filter']+'%'};return _0x243616;}})});}_0x360b79=_[_0x3eab('0x4b')]({},_0x360b79,_0x58f82a[_0x3eab('0x4c')]);var _0x577d9a={'where':_0x360b79[_0x3eab('0x44')]};return db[_0x3eab('0x38')][_0x3eab('0x2b')](_0x577d9a)[_0x3eab('0x1d')](function(_0x3a6cd6){_0x5196c6['count']=_0x3a6cd6;if(_0x58f82a['query'][_0x3eab('0x4d')]){_0x360b79[_0x3eab('0x4e')]=[{'all':!![]}];}return db[_0x3eab('0x38')][_0x3eab('0x4f')](_0x360b79);})[_0x3eab('0x1d')](function(_0x3af699){_0x5196c6['rows']=_0x3af699;return _0x5196c6;})[_0x3eab('0x1d')](respondWithFilteredResult(_0x41269f,_0x360b79))[_0x3eab('0x27')](handleError(_0x41269f,null));};exports[_0x3eab('0x50')]=function(_0x275f7a,_0x2b766b){var _0x4159b0={'raw':![],'where':{'id':_0x275f7a[_0x3eab('0x51')]['id']}},_0x59cbd5={};_0x59cbd5[_0x3eab('0x3c')]=_['keys'](db[_0x3eab('0x38')][_0x3eab('0x39')]);_0x59cbd5[_0x3eab('0x3b')]=_['keys'](_0x275f7a[_0x3eab('0x3b')]);_0x59cbd5[_0x3eab('0x45')]=_[_0x3eab('0x3e')](_0x59cbd5[_0x3eab('0x3c')],_0x59cbd5[_0x3eab('0x3b')]);_0x4159b0[_0x3eab('0x3d')]=_[_0x3eab('0x3e')](_0x59cbd5[_0x3eab('0x3c')],qs[_0x3eab('0x3f')](_0x275f7a[_0x3eab('0x3b')][_0x3eab('0x3f')]));_0x4159b0[_0x3eab('0x3d')]=_0x4159b0[_0x3eab('0x3d')][_0x3eab('0x40')]?_0x4159b0[_0x3eab('0x3d')]:_0x59cbd5[_0x3eab('0x3c')];if(_0x275f7a[_0x3eab('0x3b')][_0x3eab('0x4d')]){_0x4159b0[_0x3eab('0x4e')]=[{'all':!![]}];}_0x4159b0=_[_0x3eab('0x4b')]({},_0x4159b0,_0x275f7a[_0x3eab('0x4c')]);return db['DeskAccount']['find'](_0x4159b0)[_0x3eab('0x1d')](handleEntityNotFound(_0x2b766b,null))[_0x3eab('0x1d')](respondWithResult(_0x2b766b,null))[_0x3eab('0x27')](handleError(_0x2b766b,null));};exports[_0x3eab('0x52')]=function(_0x16cbfe,_0x1f5236){return db['DeskAccount']['create'](_0x16cbfe[_0x3eab('0x53')],{})[_0x3eab('0x1d')](respondWithResult(_0x1f5236,0xc9))['catch'](handleError(_0x1f5236,null));};exports[_0x3eab('0x32')]=function(_0x376620,_0x55d729){if(_0x376620[_0x3eab('0x53')]['id']){delete _0x376620[_0x3eab('0x53')]['id'];}return db[_0x3eab('0x38')][_0x3eab('0x54')]({'where':{'id':_0x376620[_0x3eab('0x51')]['id']}})[_0x3eab('0x1d')](handleEntityNotFound(_0x55d729,null))[_0x3eab('0x1d')](saveUpdates(_0x376620[_0x3eab('0x53')],null))[_0x3eab('0x1d')](respondWithResult(_0x55d729,null))[_0x3eab('0x27')](handleError(_0x55d729,null));};exports[_0x3eab('0x33')]=function(_0x54d88d,_0x3fc82c){return db[_0x3eab('0x38')][_0x3eab('0x54')]({'where':{'id':_0x54d88d['params']['id']}})[_0x3eab('0x1d')](handleEntityNotFound(_0x3fc82c,null))[_0x3eab('0x1d')](removeEntity(_0x3fc82c,null))[_0x3eab('0x27')](handleError(_0x3fc82c,null));};exports['getConfigurations']=function(_0x57e486,_0x12bdf7,_0x41b5e1){var _0x4b92aa={};var _0x2a54b2={};var _0x423acf;var _0x5ad861;return db[_0x3eab('0x38')][_0x3eab('0x55')]({'where':{'id':_0x57e486['params']['id']}})[_0x3eab('0x1d')](handleEntityNotFound(_0x12bdf7,null))[_0x3eab('0x1d')](function(_0x20446b){if(_0x20446b){_0x423acf=_0x20446b;_0x2a54b2[_0x3eab('0x3c')]=_[_0x3eab('0x3a')](db[_0x3eab('0x56')]['rawAttributes']);_0x2a54b2[_0x3eab('0x3b')]=_[_0x3eab('0x3a')](_0x57e486[_0x3eab('0x3b')]);_0x2a54b2[_0x3eab('0x45')]=_[_0x3eab('0x3e')](_0x2a54b2['model'],_0x2a54b2['query']);_0x4b92aa[_0x3eab('0x3d')]=_['intersection'](_0x2a54b2['model'],qs['fields'](_0x57e486['query'][_0x3eab('0x3f')]));_0x4b92aa[_0x3eab('0x3d')]=_0x4b92aa[_0x3eab('0x3d')]['length']?_0x4b92aa[_0x3eab('0x3d')]:_0x2a54b2[_0x3eab('0x3c')];_0x4b92aa['order']=qs[_0x3eab('0x57')](_0x57e486[_0x3eab('0x3b')][_0x3eab('0x57')]);_0x4b92aa[_0x3eab('0x44')]=qs[_0x3eab('0x45')](_[_0x3eab('0x46')](_0x57e486[_0x3eab('0x3b')],_0x2a54b2[_0x3eab('0x45')]));if(_0x57e486[_0x3eab('0x3b')]['filter']){_0x4b92aa[_0x3eab('0x44')]=_[_0x3eab('0x4b')](_0x4b92aa[_0x3eab('0x44')],{'$or':_['map'](_0x4b92aa[_0x3eab('0x3d')],function(_0x39d1f4){var _0x415ca0={};_0x415ca0[_0x39d1f4]={'$like':'%'+_0x57e486[_0x3eab('0x3b')][_0x3eab('0x47')]+'%'};return _0x415ca0;})});}_0x4b92aa=_[_0x3eab('0x4b')]({},_0x4b92aa,_0x57e486[_0x3eab('0x4c')]);return _0x423acf['getConfigurations'](_0x4b92aa);}})[_0x3eab('0x1d')](function(_0x3dbfd6){if(_0x3dbfd6){_0x5ad861=_0x3dbfd6[_0x3eab('0x40')];if(!_0x57e486[_0x3eab('0x3b')][_0x3eab('0x41')]('nolimit')){_0x4b92aa[_0x3eab('0x2d')]=qs[_0x3eab('0x2d')](_0x57e486[_0x3eab('0x3b')][_0x3eab('0x2d')]);_0x4b92aa[_0x3eab('0x2c')]=qs[_0x3eab('0x2c')](_0x57e486[_0x3eab('0x3b')][_0x3eab('0x2c')]);}return _0x423acf['getConfigurations'](_0x4b92aa);}})['then'](function(_0x2198a8){if(_0x2198a8){return _0x2198a8?{'count':_0x5ad861,'rows':_0x2198a8}:null;}})[_0x3eab('0x1d')](respondWithResult(_0x12bdf7,null))['catch'](handleError(_0x12bdf7,null));};exports[_0x3eab('0x58')]=function(_0x6b20b6,_0x256078,_0x3b709c){if(_0x6b20b6[_0x3eab('0x53')]['id']){delete _0x6b20b6[_0x3eab('0x53')]['id'];}return db[_0x3eab('0x38')][_0x3eab('0x55')]({'where':{'id':_0x6b20b6['params']['id']}})[_0x3eab('0x1d')](handleEntityNotFound(_0x256078,null))[_0x3eab('0x1d')](function(_0x4b331e){if(_0x4b331e){_0x6b20b6['body'][_0x3eab('0x59')]=_0x4b331e['id'];_0x6b20b6[_0x3eab('0x53')][_0x3eab('0x5a')]=integrations[_0x3eab('0x5b')](_0x6b20b6[_0x3eab('0x53')][_0x3eab('0x5c')],_0x6b20b6['body']['type']);_0x6b20b6[_0x3eab('0x53')][_0x3eab('0x5d')]=integrations[_0x3eab('0x5e')](_0x6b20b6[_0x3eab('0x53')][_0x3eab('0x5c')],_0x6b20b6[_0x3eab('0x53')][_0x3eab('0x48')]);return db[_0x3eab('0x56')][_0x3eab('0x52')](_0x6b20b6[_0x3eab('0x53')],{'include':[{'model':db[_0x3eab('0x5f')],'as':'Subjects'},{'model':db[_0x3eab('0x5f')],'as':'Descriptions'}]});}return null;})[_0x3eab('0x1d')](respondWithResult(_0x256078,null))[_0x3eab('0x27')](handleError(_0x256078,null));};exports[_0x3eab('0x60')]=function(_0x50d924,_0x2ff89a,_0x9a2f55){var _0x442775=[{'name':_0x3eab('0x61'),'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 _0x44c0a1='';return db[_0x3eab('0x38')][_0x3eab('0x55')]({'where':{'id':_0x50d924['params']['id']},'attributes':['id',_0x3eab('0x62'),_0x3eab('0x63'),_0x3eab('0x64'),_0x3eab('0x65'),_0x3eab('0x66'),_0x3eab('0x67'),_0x3eab('0x68'),_0x3eab('0x69')]})[_0x3eab('0x1d')](handleEntityNotFound(_0x2ff89a,null))[_0x3eab('0x1d')](function(_0x415fd1){if(_0x415fd1){_0x44c0a1=_0x415fd1['remoteUri'];var _0x1c6680=_0x44c0a1[_0x3eab('0x6a')](-0x1);if(_0x1c6680==='/'){_0x44c0a1=_0x44c0a1['substring'](0x0,_0x44c0a1[_0x3eab('0x6b')](_0x1c6680));}var _0x2db5fc={'method':_0x3eab('0x6c'),'uri':util[_0x3eab('0x6d')](_0x3eab('0x6e'),_0x44c0a1),'headers':{'Content-Type':_0x3eab('0x6f'),'Accept':_0x3eab('0x6f')},'json':!![]};if(_0x415fd1[_0x3eab('0x63')]===_0x3eab('0x70')){_0x2db5fc[_0x3eab('0x71')]['Authorization']=util[_0x3eab('0x6d')]('Basic\x20%s',new Buffer(util['format'](_0x3eab('0x72'),_0x415fd1['username'],_0x415fd1[_0x3eab('0x65')]))[_0x3eab('0x73')]('base64'));}return rp(_0x2db5fc)[_0x3eab('0x1d')](function(_0x3e8617){return _0x442775['concat'](_[_0x3eab('0x74')](_0x3e8617['_embedded'][_0x3eab('0x75')],function(_0x419166){return{'id':_0x419166['name'],'name':_0x419166['name'],'type':_0x419166[_0x3eab('0x48')],'active':_0x419166[_0x3eab('0x76')],'label':_0x419166[_0x3eab('0x77')],'custom':!![]};}));});}})['then'](function(_0x2c4d4b){return{'count':_0x2c4d4b['length'],'rows':_0x2c4d4b};})[_0x3eab('0x1d')](respondWithResult(_0x2ff89a,null))['catch'](function(_0x380500){var _0x57440f=_0x50d924[_0x3eab('0x3b')][_0x3eab('0x1b')]?0x1f4:_0x380500[_0x3eab('0x78')]||0x1f4;logger[_0x3eab('0x23')](_0x3eab('0x79'),_0x3eab('0x60'),_0x57440f,JSON[_0x3eab('0x7a')](_0x380500));delete _0x380500[_0x3eab('0x36')];if(_0x57440f===0x191){_0x57440f=0x190;}_0x2ff89a[_0x3eab('0x29')](_0x57440f)[_0x3eab('0x7b')](_0x50d924[_0x3eab('0x3b')][_0x3eab('0x1b')]?{'message':'Wrong\x20credentials','statusCode':_0x380500[_0x3eab('0x78')]}:_0x380500);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 02f3cd2..d3165b9 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 _0xe1f3=['api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','util'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xe1f3,0x1b8));var _0x3e1f=function(_0x37e22a,_0x36b7d7){_0x37e22a=_0x37e22a-0x0;var _0x49e790=_0xe1f3[_0x37e22a];return _0x49e790;};'use strict';var _=require(_0x3e1f('0x0'));var util=require(_0x3e1f('0x1'));var logger=require('../../config/logger')(_0x3e1f('0x2'));var moment=require('moment');var BPromise=require(_0x3e1f('0x3'));var rp=require(_0x3e1f('0x4'));var fs=require('fs');var path=require(_0x3e1f('0x5'));var rimraf=require(_0x3e1f('0x6'));var config=require(_0x3e1f('0x7'));var attributes=require(_0x3e1f('0x8'));var integrations=require(_0x3e1f('0x9'));module[_0x3e1f('0xa')]=function(_0x33a99b,_0xd9d28f){return _0x33a99b['define'](_0x3e1f('0xb'),attributes,{'tableName':_0x3e1f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x258b=['DeskAccount','int_desk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x27bab5,_0x20d581){var _0x4176b4=function(_0x4e3ebd){while(--_0x4e3ebd){_0x27bab5['push'](_0x27bab5['shift']());}};_0x4176b4(++_0x20d581);}(_0x258b,0x1a2));var _0xb258=function(_0x4783d2,_0x4420eb){_0x4783d2=_0x4783d2-0x0;var _0x2f36fc=_0x258b[_0x4783d2];return _0x2f36fc;};'use strict';var _=require(_0xb258('0x0'));var util=require(_0xb258('0x1'));var logger=require(_0xb258('0x2'))('api');var moment=require(_0xb258('0x3'));var BPromise=require(_0xb258('0x4'));var rp=require(_0xb258('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb258('0x6'));var config=require('../../config/environment');var attributes=require(_0xb258('0x7'));var integrations=require(_0xb258('0x8'));module[_0xb258('0x9')]=function(_0x5badc9,_0x4c79eb){return _0x5badc9[_0xb258('0xa')](_0xb258('0xb'),attributes,{'tableName':_0xb258('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 6c6f6b2..f162986 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 _0x113f=['http','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','DeskAccount,\x20%s,\x20%s','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','limit','include','model','map','attributes','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client'];(function(_0xed1184,_0x28e413){var _0x54fc11=function(_0x1d8683){while(--_0x1d8683){_0xed1184['push'](_0xed1184['shift']());}};_0x54fc11(++_0x28e413);}(_0x113f,0x13a));var _0xf113=function(_0x5a175a,_0x130f4b){_0x5a175a=_0x5a175a-0x0;var _0x416e55=_0x113f[_0x5a175a];return _0x416e55;};'use strict';var _=require(_0xf113('0x0'));var util=require(_0xf113('0x1'));var moment=require(_0xf113('0x2'));var BPromise=require(_0xf113('0x3'));var rs=require(_0xf113('0x4'));var fs=require('fs');var Redis=require(_0xf113('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf113('0x6'))(_0xf113('0x7'));var config=require(_0xf113('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf113('0x9')][_0xf113('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x408bb2,_0x1998e1,_0x591e36){return new BPromise(function(_0x35bf1f,_0x3bbffe){return client[_0xf113('0xb')](_0x408bb2,_0x591e36)[_0xf113('0xc')](function(_0x2251b3){logger[_0xf113('0xd')]('DeskAccount,\x20%s,\x20%s',_0x1998e1,_0xf113('0xe'));logger[_0xf113('0xf')](_0xf113('0x10'),_0x1998e1,_0xf113('0xe'),JSON[_0xf113('0x11')](_0x2251b3));if(_0x2251b3[_0xf113('0x12')]){if(_0x2251b3['error']['code']===0x1f4){logger[_0xf113('0x12')]('DeskAccount,\x20%s,\x20%s',_0x1998e1,_0x2251b3[_0xf113('0x12')][_0xf113('0x13')]);return _0x3bbffe(_0x2251b3[_0xf113('0x12')]['message']);}logger[_0xf113('0x12')](_0xf113('0x14'),_0x1998e1,_0x2251b3[_0xf113('0x12')][_0xf113('0x13')]);return _0x35bf1f(_0x2251b3[_0xf113('0x12')]['message']);}else{logger[_0xf113('0xd')](_0xf113('0x14'),_0x1998e1,_0xf113('0xe'));_0x35bf1f(_0x2251b3[_0xf113('0x15')][_0xf113('0x13')]);}})[_0xf113('0x16')](function(_0x1b824a){logger[_0xf113('0x12')](_0xf113('0x14'),_0x1998e1,_0x1b824a);_0x3bbffe(_0x1b824a);});});}exports[_0xf113('0x17')]=function(_0x25093a){var _0x3283d5=this;return new Promise(function(_0x259872,_0x17f739){return db[_0xf113('0x18')][_0xf113('0x19')]({'raw':_0x25093a['options']?_0x25093a[_0xf113('0x1a')][_0xf113('0x1b')]===undefined?!![]:![]:!![],'where':_0x25093a[_0xf113('0x1a')]?_0x25093a['options'][_0xf113('0x1c')]||null:null,'attributes':_0x25093a[_0xf113('0x1a')]?_0x25093a[_0xf113('0x1a')]['attributes']||null:null,'limit':_0x25093a['options']?_0x25093a[_0xf113('0x1a')][_0xf113('0x1d')]||null:null,'include':_0x25093a['options']?_0x25093a[_0xf113('0x1a')][_0xf113('0x1e')]?_['map'](_0x25093a[_0xf113('0x1a')][_0xf113('0x1e')],function(_0x10cadf){return{'model':db[_0x10cadf[_0xf113('0x1f')]],'as':_0x10cadf['as'],'attributes':_0x10cadf['attributes'],'include':_0x10cadf[_0xf113('0x1e')]?_[_0xf113('0x20')](_0x10cadf['include'],function(_0x374421){return{'model':db[_0x374421['model']],'as':_0x374421['as'],'attributes':_0x374421[_0xf113('0x21')],'include':_0x374421[_0xf113('0x1e')]?_['map'](_0x374421['include'],function(_0x5361f9){return{'model':db[_0x5361f9[_0xf113('0x1f')]],'as':_0x5361f9['as'],'attributes':_0x5361f9[_0xf113('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35eb19){logger['info'](_0xf113('0x17'),_0x25093a);logger[_0xf113('0xf')](_0xf113('0x17'),_0x25093a,JSON[_0xf113('0x11')](_0x35eb19));_0x259872(_0x35eb19);})[_0xf113('0x16')](function(_0x39a213){logger[_0xf113('0x12')](_0xf113('0x17'),_0x39a213[_0xf113('0x13')],_0x25093a);_0x17f739(_0x3283d5['error'](0x1f4,_0x39a213['message']));});});};exports[_0xf113('0x22')]=function(_0x69117a){var _0x37e4b7=this;return new Promise(function(_0x1bdb05,_0x190bfe){return db['DeskAccount'][_0xf113('0x23')]({'raw':_0x69117a[_0xf113('0x1a')]?_0x69117a[_0xf113('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x69117a[_0xf113('0x1a')]?_0x69117a['options'][_0xf113('0x1c')]||null:null,'attributes':_0x69117a['options']?_0x69117a[_0xf113('0x1a')]['attributes']||null:null,'include':_0x69117a[_0xf113('0x1a')]?_0x69117a[_0xf113('0x1a')][_0xf113('0x1e')]?_['map'](_0x69117a[_0xf113('0x1a')][_0xf113('0x1e')],function(_0x1db663){return{'model':db[_0x1db663[_0xf113('0x1f')]],'as':_0x1db663['as'],'attributes':_0x1db663[_0xf113('0x21')],'include':_0x1db663['include']?_['map'](_0x1db663['include'],function(_0xcc8f8a){return{'model':db[_0xcc8f8a[_0xf113('0x1f')]],'as':_0xcc8f8a['as'],'attributes':_0xcc8f8a[_0xf113('0x21')],'include':_0xcc8f8a[_0xf113('0x1e')]?_[_0xf113('0x20')](_0xcc8f8a[_0xf113('0x1e')],function(_0x20137c){return{'model':db[_0x20137c[_0xf113('0x1f')]],'as':_0x20137c['as'],'attributes':_0x20137c[_0xf113('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf113('0xc')](function(_0x38e1b6){logger['info']('ShowDeskAccount',_0x69117a);logger[_0xf113('0xf')](_0xf113('0x22'),_0x69117a,JSON[_0xf113('0x11')](_0x38e1b6));_0x1bdb05(_0x38e1b6);})['catch'](function(_0x97dfc6){logger[_0xf113('0x12')](_0xf113('0x22'),_0x97dfc6[_0xf113('0x13')],_0x69117a);_0x190bfe(_0x37e4b7[_0xf113('0x12')](0x1f4,_0x97dfc6[_0xf113('0x13')]));});});}; \ No newline at end of file +var _0xb896=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDeskAccount','findAll','options','where','attributes','limit','include','map','model','then','ShowDeskAccount','find','lodash','util','moment','randomstring','ioredis'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xb896,0x1e5));var _0x6b89=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xb896[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x6b89('0x0'));var util=require(_0x6b89('0x1'));var moment=require(_0x6b89('0x2'));var BPromise=require('bluebird');var rs=require(_0x6b89('0x3'));var fs=require('fs');var Redis=require(_0x6b89('0x4'));var db=require(_0x6b89('0x5'))['db'];var utils=require(_0x6b89('0x6'));var logger=require('../../config/logger')(_0x6b89('0x7'));var config=require(_0x6b89('0x8'));var jayson=require(_0x6b89('0x9'));var client=jayson[_0x6b89('0xa')][_0x6b89('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42dde4,_0x477c58,_0x5eb201){return new BPromise(function(_0x3063a3,_0xbc70d3){return client[_0x6b89('0xc')](_0x42dde4,_0x5eb201)['then'](function(_0x326e16){logger[_0x6b89('0xd')](_0x6b89('0xe'),_0x477c58,_0x6b89('0xf'));logger[_0x6b89('0x10')](_0x6b89('0x11'),_0x477c58,_0x6b89('0xf'),JSON[_0x6b89('0x12')](_0x326e16));if(_0x326e16[_0x6b89('0x13')]){if(_0x326e16[_0x6b89('0x13')][_0x6b89('0x14')]===0x1f4){logger[_0x6b89('0x13')]('DeskAccount,\x20%s,\x20%s',_0x477c58,_0x326e16[_0x6b89('0x13')][_0x6b89('0x15')]);return _0xbc70d3(_0x326e16[_0x6b89('0x13')][_0x6b89('0x15')]);}logger[_0x6b89('0x13')](_0x6b89('0xe'),_0x477c58,_0x326e16['error'][_0x6b89('0x15')]);return _0x3063a3(_0x326e16[_0x6b89('0x13')][_0x6b89('0x15')]);}else{logger[_0x6b89('0xd')]('DeskAccount,\x20%s,\x20%s',_0x477c58,_0x6b89('0xf'));_0x3063a3(_0x326e16['result'][_0x6b89('0x15')]);}})[_0x6b89('0x16')](function(_0x27b59e){logger[_0x6b89('0x13')](_0x6b89('0xe'),_0x477c58,_0x27b59e);_0xbc70d3(_0x27b59e);});});}exports[_0x6b89('0x17')]=function(_0xf1277e){var _0x5689e3=this;return new Promise(function(_0x38f277,_0x2d4fc2){return db['DeskAccount'][_0x6b89('0x18')]({'raw':_0xf1277e[_0x6b89('0x19')]?_0xf1277e[_0x6b89('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xf1277e['options']?_0xf1277e[_0x6b89('0x19')][_0x6b89('0x1a')]||null:null,'attributes':_0xf1277e['options']?_0xf1277e['options'][_0x6b89('0x1b')]||null:null,'limit':_0xf1277e['options']?_0xf1277e[_0x6b89('0x19')][_0x6b89('0x1c')]||null:null,'include':_0xf1277e[_0x6b89('0x19')]?_0xf1277e[_0x6b89('0x19')][_0x6b89('0x1d')]?_[_0x6b89('0x1e')](_0xf1277e[_0x6b89('0x19')][_0x6b89('0x1d')],function(_0x37ca8c){return{'model':db[_0x37ca8c[_0x6b89('0x1f')]],'as':_0x37ca8c['as'],'attributes':_0x37ca8c[_0x6b89('0x1b')],'include':_0x37ca8c[_0x6b89('0x1d')]?_[_0x6b89('0x1e')](_0x37ca8c[_0x6b89('0x1d')],function(_0x4d2b1a){return{'model':db[_0x4d2b1a['model']],'as':_0x4d2b1a['as'],'attributes':_0x4d2b1a[_0x6b89('0x1b')],'include':_0x4d2b1a[_0x6b89('0x1d')]?_[_0x6b89('0x1e')](_0x4d2b1a['include'],function(_0x2c9218){return{'model':db[_0x2c9218[_0x6b89('0x1f')]],'as':_0x2c9218['as'],'attributes':_0x2c9218['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b89('0x20')](function(_0x4d91f3){logger[_0x6b89('0xd')](_0x6b89('0x17'),_0xf1277e);logger[_0x6b89('0x10')](_0x6b89('0x17'),_0xf1277e,JSON['stringify'](_0x4d91f3));_0x38f277(_0x4d91f3);})['catch'](function(_0x30133a){logger['error']('GetDeskAccount',_0x30133a[_0x6b89('0x15')],_0xf1277e);_0x2d4fc2(_0x5689e3[_0x6b89('0x13')](0x1f4,_0x30133a[_0x6b89('0x15')]));});});};exports[_0x6b89('0x21')]=function(_0x2bf4ff){var _0x347afa=this;return new Promise(function(_0x559c2f,_0x2c8c0a){return db['DeskAccount'][_0x6b89('0x22')]({'raw':_0x2bf4ff['options']?_0x2bf4ff['options']['raw']===undefined?!![]:![]:!![],'where':_0x2bf4ff[_0x6b89('0x19')]?_0x2bf4ff['options'][_0x6b89('0x1a')]||null:null,'attributes':_0x2bf4ff[_0x6b89('0x19')]?_0x2bf4ff[_0x6b89('0x19')][_0x6b89('0x1b')]||null:null,'include':_0x2bf4ff[_0x6b89('0x19')]?_0x2bf4ff[_0x6b89('0x19')][_0x6b89('0x1d')]?_[_0x6b89('0x1e')](_0x2bf4ff[_0x6b89('0x19')]['include'],function(_0x524318){return{'model':db[_0x524318['model']],'as':_0x524318['as'],'attributes':_0x524318[_0x6b89('0x1b')],'include':_0x524318[_0x6b89('0x1d')]?_[_0x6b89('0x1e')](_0x524318[_0x6b89('0x1d')],function(_0x820e49){return{'model':db[_0x820e49['model']],'as':_0x820e49['as'],'attributes':_0x820e49[_0x6b89('0x1b')],'include':_0x820e49['include']?_['map'](_0x820e49['include'],function(_0x2c6596){return{'model':db[_0x2c6596[_0x6b89('0x1f')]],'as':_0x2c6596['as'],'attributes':_0x2c6596[_0x6b89('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6b89('0x20')](function(_0x1c07d7){logger[_0x6b89('0xd')](_0x6b89('0x21'),_0x2bf4ff);logger['debug'](_0x6b89('0x21'),_0x2bf4ff,JSON[_0x6b89('0x12')](_0x1c07d7));_0x559c2f(_0x1c07d7);})[_0x6b89('0x16')](function(_0x2760bc){logger[_0x6b89('0x13')](_0x6b89('0x21'),_0x2760bc[_0x6b89('0x15')],_0x2bf4ff);_0x2c8c0a(_0x347afa[_0x6b89('0x13')](0x1f4,_0x2760bc[_0x6b89('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index a02a36f..a76a3ad 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 _0x5f2f=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getDescriptions','getTags','post','create','setTags','put','delete','destroy','exports'];(function(_0x5a77c2,_0x13811c){var _0x24ca6e=function(_0x13523b){while(--_0x13523b){_0x5a77c2['push'](_0x5a77c2['shift']());}};_0x24ca6e(++_0x13811c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5b11a3,_0x531c2b){_0x5b11a3=_0x5b11a3-0x0;var _0x537035=_0x5f2f[_0x5b11a3];return _0x537035;};'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('./intDeskConfiguration.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['getFields']);router[_0xf5f2('0x8')](_0xf5f2('0xd'),auth[_0xf5f2('0x9')](),controller['getSubjects']);router[_0xf5f2('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x8')]('/:id/tags',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x11')]);router[_0xf5f2('0x10')]('/:id/tags',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['update']);router[_0xf5f2('0x14')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x15')]);module[_0xf5f2('0x16')]=router; \ No newline at end of file +var _0x8cda=['get','index','/:id','isAuthenticated','show','/:id/fields','/:id/descriptions','getDescriptions','getTags','post','create','put','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller'];(function(_0x18b5e8,_0x51e875){var _0x25baed=function(_0x3fcdf9){while(--_0x3fcdf9){_0x18b5e8['push'](_0x18b5e8['shift']());}};_0x25baed(++_0x51e875);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xa8cd('0x0'));var path=require(_0xa8cd('0x1'));var timeout=require(_0xa8cd('0x2'));var express=require(_0xa8cd('0x3'));var router=express[_0xa8cd('0x4')]();var auth=require(_0xa8cd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa8cd('0x6'));var controller=require(_0xa8cd('0x7'));router[_0xa8cd('0x8')]('/',auth['isAuthenticated'](),controller[_0xa8cd('0x9')]);router[_0xa8cd('0x8')](_0xa8cd('0xa'),auth[_0xa8cd('0xb')](),controller[_0xa8cd('0xc')]);router[_0xa8cd('0x8')](_0xa8cd('0xd'),auth[_0xa8cd('0xb')](),controller['getFields']);router['get']('/:id/subjects',auth[_0xa8cd('0xb')](),controller['getSubjects']);router[_0xa8cd('0x8')](_0xa8cd('0xe'),auth['isAuthenticated'](),controller[_0xa8cd('0xf')]);router[_0xa8cd('0x8')]('/:id/tags',auth['isAuthenticated'](),controller[_0xa8cd('0x10')]);router[_0xa8cd('0x11')]('/',auth[_0xa8cd('0xb')](),controller[_0xa8cd('0x12')]);router[_0xa8cd('0x11')]('/:id/tags',auth[_0xa8cd('0xb')](),controller['setTags']);router[_0xa8cd('0x13')]('/:id',auth[_0xa8cd('0xb')](),controller['update']);router[_0xa8cd('0x14')](_0xa8cd('0xa'),auth[_0xa8cd('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 8dde946..7ad2312 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 _0x982a=['exports','STRING','sequelize'];(function(_0x2676e6,_0x313e76){var _0x3d488=function(_0x1aa411){while(--_0x1aa411){_0x2676e6['push'](_0x2676e6['shift']());}};_0x3d488(++_0x313e76);}(_0x982a,0x161));var _0xa982=function(_0x18a296,_0x26edb6){_0x18a296=_0x18a296-0x0;var _0x12eb16=_0x982a[_0x18a296];return _0x12eb16;};'use strict';var Sequelize=require(_0xa982('0x0'));module[_0xa982('0x1')]={'name':{'type':Sequelize[_0xa982('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf8db=['sequelize','exports','STRING'];(function(_0x21ac27,_0x43e2ff){var _0x1e1470=function(_0x37ea9b){while(--_0x37ea9b){_0x21ac27['push'](_0x21ac27['shift']());}};_0x1e1470(++_0x43e2ff);}(_0xf8db,0x1e3));var _0xbf8d=function(_0x3d7a10,_0x21bc7b){_0x3d7a10=_0x3d7a10-0x0;var _0x5b0b11=_0xf8db[_0x3d7a10];return _0x5b0b11;};'use strict';var Sequelize=require(_0xbf8d('0x0'));module[_0xbf8d('0x1')]={'name':{'type':Sequelize[_0xbf8d('0x2')]},'description':{'type':Sequelize[_0xbf8d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 88329b9..a07d81f 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 _0x6075=['DeskConfiguration','model','keys','query','intersection','attributes','fields','length','nolimit','order','where','filters','filter','merge','map','type','VIRTUAL','field','options','includeAll','findAll','rows','show','rawAttributes','include','find','create','body','params','getFields','findOne','DeskField','sort','pick','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','ids','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','test','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','sendStatus','stack','name','send','index'];(function(_0x37c07d,_0xdbdb5f){var _0x10dadc=function(_0x2bafb7){while(--_0x2bafb7){_0x37c07d['push'](_0x37c07d['shift']());}};_0x10dadc(++_0xdbdb5f);}(_0x6075,0x142));var _0x5607=function(_0x2eae25,_0x2412d9){_0x2eae25=_0x2eae25-0x0;var _0x2988ac=_0x6075[_0x2eae25];return _0x2988ac;};'use strict';var pdf=require(_0x5607('0x0'));var emlformat=require(_0x5607('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5607('0x2'));var jsonpatch=require(_0x5607('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5607('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5607('0x5'));var sox=require('sox');var csv=require(_0x5607('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5607('0x7'));var squel=require('squel');var crypto=require(_0x5607('0x8'));var jsforce=require(_0x5607('0x9'));var deskjs=require(_0x5607('0xa'));var toCsv=require(_0x5607('0x6'));var querystring=require(_0x5607('0xb'));var Papa=require(_0x5607('0xc'));var Redis=require(_0x5607('0xd'));var authService=require(_0x5607('0xe'));var qs=require(_0x5607('0xf'));var hardwareService=require(_0x5607('0x10'));var logger=require(_0x5607('0x11'))(_0x5607('0x12'));var utils=require(_0x5607('0x13'));var config=require('../../config/environment');var db=require(_0x5607('0x14'))['db'];var jayson=require(_0x5607('0x15'));var client=jayson[_0x5607('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x8d61f1,_0x4166c7,_0x5b4f19){if(_0x5b4f19){var _0x413013=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x413013[_0x5607('0x17')](_0x4166c7)){return _0x8d61f1;}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 _0x8d61f1;}}function respondWithRpcPromise(_0x44642d,_0x514d22,_0x28cf69,_0x22750d){return new BPromise(function(_0x255936,_0x381634){var _0x5ba100=_0x22750d||client;return _0x5ba100[_0x5607('0x18')](_0x44642d,_0x28cf69)[_0x5607('0x19')](function(_0x2decbc){logger[_0x5607('0x1a')](_0x5607('0x1b'),_0x514d22,_0x5607('0x1c'));logger[_0x5607('0x1d')](_0x5607('0x1e'),_0x514d22,_0x5607('0x1c'),JSON[_0x5607('0x1f')](_0x2decbc));if(_0x2decbc[_0x5607('0x20')]){if(_0x2decbc[_0x5607('0x20')]['code']===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x514d22,_0x2decbc['error'][_0x5607('0x21')]);return _0x381634(_0x2decbc[_0x5607('0x20')][_0x5607('0x21')]);}logger[_0x5607('0x20')](_0x5607('0x1b'),_0x514d22,_0x2decbc[_0x5607('0x20')][_0x5607('0x21')]);return _0x255936(_0x2decbc[_0x5607('0x20')]['message']);}else{logger['info'](_0x5607('0x1b'),_0x514d22,_0x5607('0x1c'));_0x255936(_0x2decbc[_0x5607('0x22')]['message']);}})[_0x5607('0x23')](function(_0x82265b){logger[_0x5607('0x20')](_0x5607('0x1b'),_0x514d22,_0x82265b);_0x381634(_0x82265b);});});}function respondWithStatusCode(_0x45242c,_0x44c5ef){_0x44c5ef=_0x44c5ef||0xcc;return function(_0x5f1527){if(_0x5f1527){return _0x45242c['sendStatus'](_0x44c5ef);}return _0x45242c[_0x5607('0x24')](_0x44c5ef)[_0x5607('0x25')]();};}function respondWithResult(_0x3cb951,_0x47fe80){_0x47fe80=_0x47fe80||0xc8;return function(_0x4a0f55){if(_0x4a0f55){return _0x3cb951[_0x5607('0x24')](_0x47fe80)['json'](_0x4a0f55);}};}function respondWithFilteredResult(_0x2b53d9,_0x4233d5){return function(_0x3d9120){if(_0x3d9120){var _0xded87e=_0x3d9120[_0x5607('0x26')],_0xbb9584=_0x4233d5[_0x5607('0x27')],_0x5e77de=_0x4233d5[_0x5607('0x27')]+_0x4233d5[_0x5607('0x28')],_0x5bb86c;if(_0x5e77de>=_0xded87e){_0x5e77de=_0xded87e;_0x5bb86c=0xc8;}else{_0x5bb86c=0xce;}_0x2b53d9[_0x5607('0x24')](_0x5bb86c);return _0x2b53d9[_0x5607('0x29')](_0x5607('0x2a'),_0xbb9584+'-'+_0x5e77de+'/'+_0xded87e)[_0x5607('0x2b')](_0x3d9120);}return null;};}function patchUpdates(_0x4ebf35){return function(_0x29d16e){try{jsonpatch[_0x5607('0x2c')](_0x29d16e,_0x4ebf35,!![]);}catch(_0x3bc280){return BPromise[_0x5607('0x2d')](_0x3bc280);}return _0x29d16e[_0x5607('0x2e')]();};}function saveUpdates(_0x3f5449,_0x337216){return function(_0x170cee){if(_0x170cee){return _0x170cee[_0x5607('0x2f')](_0x3f5449)[_0x5607('0x19')](function(_0x551e50){return _0x551e50;});}return null;};}function removeEntity(_0x4184d9,_0x5f2f64){return function(_0x1449f8){if(_0x1449f8){return _0x1449f8[_0x5607('0x30')]()[_0x5607('0x19')](function(){_0x4184d9[_0x5607('0x24')](0xcc)[_0x5607('0x25')]();});}};}function handleEntityNotFound(_0x4db623,_0x1df55f){return function(_0x313c1f){if(!_0x313c1f){_0x4db623[_0x5607('0x31')](0x194);}return _0x313c1f;};}function handleError(_0x3eb6c2,_0x304279){_0x304279=_0x304279||0x1f4;return function(_0x2029a8){logger[_0x5607('0x20')](_0x2029a8[_0x5607('0x32')]);if(_0x2029a8[_0x5607('0x33')]){delete _0x2029a8['name'];}_0x3eb6c2[_0x5607('0x24')](_0x304279)[_0x5607('0x34')](_0x2029a8);};}exports[_0x5607('0x35')]=function(_0x160995,_0x593858){var _0x4eb126={},_0xfbfe28={},_0x32e02d={'count':0x0,'rows':[]};var _0x3be35b=db[_0x5607('0x36')]['rawAttributes'];_0xfbfe28[_0x5607('0x37')]=_[_0x5607('0x38')](_0x3be35b);_0xfbfe28[_0x5607('0x39')]=_['keys'](_0x160995[_0x5607('0x39')]);_0xfbfe28['filters']=_[_0x5607('0x3a')](_0xfbfe28[_0x5607('0x37')],_0xfbfe28[_0x5607('0x39')]);_0x4eb126[_0x5607('0x3b')]=_[_0x5607('0x3a')](_0xfbfe28[_0x5607('0x37')],qs[_0x5607('0x3c')](_0x160995[_0x5607('0x39')][_0x5607('0x3c')]));_0x4eb126[_0x5607('0x3b')]=_0x4eb126[_0x5607('0x3b')][_0x5607('0x3d')]?_0x4eb126[_0x5607('0x3b')]:_0xfbfe28['model'];if(!_0x160995[_0x5607('0x39')]['hasOwnProperty'](_0x5607('0x3e'))){_0x4eb126[_0x5607('0x28')]=qs[_0x5607('0x28')](_0x160995[_0x5607('0x39')][_0x5607('0x28')]);_0x4eb126[_0x5607('0x27')]=qs[_0x5607('0x27')](_0x160995[_0x5607('0x39')]['offset']);}_0x4eb126[_0x5607('0x3f')]=qs['sort'](_0x160995['query']['sort']);_0x4eb126[_0x5607('0x40')]=qs[_0x5607('0x41')](_['pick'](_0x160995[_0x5607('0x39')],_0xfbfe28[_0x5607('0x41')]));if(_0x160995[_0x5607('0x39')][_0x5607('0x42')]){_0x4eb126[_0x5607('0x40')]=_[_0x5607('0x43')](_0x4eb126[_0x5607('0x40')],{'$or':_[_0x5607('0x44')](_0x3be35b,function(_0x4d34d7){if(_0x4d34d7[_0x5607('0x45')]['key']!==_0x5607('0x46')){var _0x179311={};_0x179311[_0x4d34d7[_0x5607('0x47')]]={'$like':'%'+_0x160995[_0x5607('0x39')][_0x5607('0x42')]+'%'};return _0x179311;}})});}_0x4eb126=_[_0x5607('0x43')]({},_0x4eb126,_0x160995[_0x5607('0x48')]);var _0x2d88b4={'where':_0x4eb126[_0x5607('0x40')]};return db[_0x5607('0x36')][_0x5607('0x26')](_0x2d88b4)['then'](function(_0x131fc2){_0x32e02d[_0x5607('0x26')]=_0x131fc2;if(_0x160995[_0x5607('0x39')][_0x5607('0x49')]){_0x4eb126['include']=[{'all':!![]}];}return db[_0x5607('0x36')][_0x5607('0x4a')](_0x4eb126);})['then'](function(_0x442b4d){_0x32e02d[_0x5607('0x4b')]=_0x442b4d;return _0x32e02d;})[_0x5607('0x19')](respondWithFilteredResult(_0x593858,_0x4eb126))['catch'](handleError(_0x593858,null));};exports[_0x5607('0x4c')]=function(_0x25ae5d,_0x38f430){var _0x186e0d={'raw':![],'where':{'id':_0x25ae5d['params']['id']}},_0x3cdbe9={};_0x3cdbe9[_0x5607('0x37')]=_['keys'](db[_0x5607('0x36')][_0x5607('0x4d')]);_0x3cdbe9[_0x5607('0x39')]=_['keys'](_0x25ae5d[_0x5607('0x39')]);_0x3cdbe9[_0x5607('0x41')]=_[_0x5607('0x3a')](_0x3cdbe9[_0x5607('0x37')],_0x3cdbe9[_0x5607('0x39')]);_0x186e0d[_0x5607('0x3b')]=_[_0x5607('0x3a')](_0x3cdbe9[_0x5607('0x37')],qs[_0x5607('0x3c')](_0x25ae5d[_0x5607('0x39')][_0x5607('0x3c')]));_0x186e0d[_0x5607('0x3b')]=_0x186e0d[_0x5607('0x3b')]['length']?_0x186e0d[_0x5607('0x3b')]:_0x3cdbe9['model'];if(_0x25ae5d[_0x5607('0x39')]['includeAll']){_0x186e0d[_0x5607('0x4e')]=[{'all':!![]}];}_0x186e0d=_[_0x5607('0x43')]({},_0x186e0d,_0x25ae5d[_0x5607('0x48')]);return db[_0x5607('0x36')][_0x5607('0x4f')](_0x186e0d)[_0x5607('0x19')](handleEntityNotFound(_0x38f430,null))[_0x5607('0x19')](respondWithResult(_0x38f430,null))[_0x5607('0x23')](handleError(_0x38f430,null));};exports[_0x5607('0x50')]=function(_0x46924c,_0x254d58){return db[_0x5607('0x36')][_0x5607('0x50')](_0x46924c[_0x5607('0x51')],{})[_0x5607('0x19')](respondWithResult(_0x254d58,0xc9))[_0x5607('0x23')](handleError(_0x254d58,null));};exports['update']=function(_0x52e263,_0x3b2989){if(_0x52e263['body']['id']){delete _0x52e263[_0x5607('0x51')]['id'];}return db[_0x5607('0x36')]['find']({'where':{'id':_0x52e263[_0x5607('0x52')]['id']}})['then'](handleEntityNotFound(_0x3b2989,null))[_0x5607('0x19')](saveUpdates(_0x52e263[_0x5607('0x51')],null))[_0x5607('0x19')](respondWithResult(_0x3b2989,null))['catch'](handleError(_0x3b2989,null));};exports[_0x5607('0x30')]=function(_0x144324,_0x4fa3c9){return db[_0x5607('0x36')]['find']({'where':{'id':_0x144324['params']['id']}})['then'](handleEntityNotFound(_0x4fa3c9,null))[_0x5607('0x19')](removeEntity(_0x4fa3c9,null))[_0x5607('0x23')](handleError(_0x4fa3c9,null));};exports[_0x5607('0x53')]=function(_0x2a3eb6,_0xd85ec8,_0x4b9376){var _0x3184e5={};var _0x347233={};var _0x410dc1;var _0x5882cf;return db[_0x5607('0x36')][_0x5607('0x54')]({'where':{'id':_0x2a3eb6['params']['id']}})[_0x5607('0x19')](handleEntityNotFound(_0xd85ec8,null))[_0x5607('0x19')](function(_0x1f7624){if(_0x1f7624){_0x410dc1=_0x1f7624;_0x347233['model']=_[_0x5607('0x38')](db[_0x5607('0x55')][_0x5607('0x4d')]);_0x347233['query']=_['keys'](_0x2a3eb6[_0x5607('0x39')]);_0x347233[_0x5607('0x41')]=_[_0x5607('0x3a')](_0x347233[_0x5607('0x37')],_0x347233['query']);_0x3184e5['attributes']=_[_0x5607('0x3a')](_0x347233['model'],qs[_0x5607('0x3c')](_0x2a3eb6['query'][_0x5607('0x3c')]));_0x3184e5['attributes']=_0x3184e5[_0x5607('0x3b')][_0x5607('0x3d')]?_0x3184e5[_0x5607('0x3b')]:_0x347233['model'];_0x3184e5[_0x5607('0x3f')]=qs[_0x5607('0x56')](_0x2a3eb6[_0x5607('0x39')][_0x5607('0x56')]);_0x3184e5[_0x5607('0x40')]=qs['filters'](_[_0x5607('0x57')](_0x2a3eb6[_0x5607('0x39')],_0x347233[_0x5607('0x41')]));if(_0x2a3eb6[_0x5607('0x39')]['filter']){_0x3184e5[_0x5607('0x40')]=_[_0x5607('0x43')](_0x3184e5[_0x5607('0x40')],{'$or':_[_0x5607('0x44')](_0x3184e5[_0x5607('0x3b')],function(_0x225224){var _0x154176={};_0x154176[_0x225224]={'$like':'%'+_0x2a3eb6[_0x5607('0x39')]['filter']+'%'};return _0x154176;})});}_0x3184e5=_[_0x5607('0x43')]({},_0x3184e5,_0x2a3eb6[_0x5607('0x48')]);return _0x410dc1[_0x5607('0x53')](_0x3184e5);}})[_0x5607('0x19')](function(_0x287b98){if(_0x287b98){_0x5882cf=_0x287b98[_0x5607('0x3d')];if(!_0x2a3eb6[_0x5607('0x39')][_0x5607('0x58')](_0x5607('0x3e'))){_0x3184e5[_0x5607('0x28')]=qs[_0x5607('0x28')](_0x2a3eb6[_0x5607('0x39')]['limit']);_0x3184e5[_0x5607('0x27')]=qs['offset'](_0x2a3eb6[_0x5607('0x39')][_0x5607('0x27')]);}return _0x410dc1[_0x5607('0x53')](_0x3184e5);}})[_0x5607('0x19')](function(_0x49a10b){if(_0x49a10b){return _0x49a10b?{'count':_0x5882cf,'rows':_0x49a10b}:null;}})[_0x5607('0x19')](respondWithResult(_0xd85ec8,null))['catch'](handleError(_0xd85ec8,null));};exports[_0x5607('0x59')]=function(_0x52c121,_0x17fa4f,_0x3aa308){var _0xf6a11e={};var _0x4faede={};var _0x1603d0;var _0x4da047;return db[_0x5607('0x36')]['findOne']({'where':{'id':_0x52c121[_0x5607('0x52')]['id']}})[_0x5607('0x19')](handleEntityNotFound(_0x17fa4f,null))[_0x5607('0x19')](function(_0x54ba8e){if(_0x54ba8e){_0x1603d0=_0x54ba8e;_0x4faede['model']=_[_0x5607('0x38')](db['DeskField'][_0x5607('0x4d')]);_0x4faede['query']=_[_0x5607('0x38')](_0x52c121[_0x5607('0x39')]);_0x4faede[_0x5607('0x41')]=_[_0x5607('0x3a')](_0x4faede[_0x5607('0x37')],_0x4faede[_0x5607('0x39')]);_0xf6a11e[_0x5607('0x3b')]=_['intersection'](_0x4faede[_0x5607('0x37')],qs[_0x5607('0x3c')](_0x52c121['query'][_0x5607('0x3c')]));_0xf6a11e[_0x5607('0x3b')]=_0xf6a11e['attributes'][_0x5607('0x3d')]?_0xf6a11e[_0x5607('0x3b')]:_0x4faede[_0x5607('0x37')];_0xf6a11e['order']=qs[_0x5607('0x56')](_0x52c121['query'][_0x5607('0x56')]);_0xf6a11e[_0x5607('0x40')]=qs[_0x5607('0x41')](_['pick'](_0x52c121[_0x5607('0x39')],_0x4faede['filters']));if(_0x52c121[_0x5607('0x39')][_0x5607('0x42')]){_0xf6a11e[_0x5607('0x40')]=_[_0x5607('0x43')](_0xf6a11e[_0x5607('0x40')],{'$or':_[_0x5607('0x44')](_0xf6a11e[_0x5607('0x3b')],function(_0xc3bd56){var _0x5e9e25={};_0x5e9e25[_0xc3bd56]={'$like':'%'+_0x52c121[_0x5607('0x39')][_0x5607('0x42')]+'%'};return _0x5e9e25;})});}_0xf6a11e=_[_0x5607('0x43')]({},_0xf6a11e,_0x52c121[_0x5607('0x48')]);return _0x1603d0[_0x5607('0x59')](_0xf6a11e);}})[_0x5607('0x19')](function(_0xaa3e3c){if(_0xaa3e3c){_0x4da047=_0xaa3e3c[_0x5607('0x3d')];if(!_0x52c121[_0x5607('0x39')]['hasOwnProperty'](_0x5607('0x3e'))){_0xf6a11e['limit']=qs['limit'](_0x52c121[_0x5607('0x39')][_0x5607('0x28')]);_0xf6a11e[_0x5607('0x27')]=qs[_0x5607('0x27')](_0x52c121[_0x5607('0x39')][_0x5607('0x27')]);}return _0x1603d0[_0x5607('0x59')](_0xf6a11e);}})[_0x5607('0x19')](function(_0x2d3496){if(_0x2d3496){return _0x2d3496?{'count':_0x4da047,'rows':_0x2d3496}:null;}})[_0x5607('0x19')](respondWithResult(_0x17fa4f,null))[_0x5607('0x23')](handleError(_0x17fa4f,null));};exports['getDescriptions']=function(_0x32c220,_0x15ebad,_0x2c237e){var _0x2f9286={};var _0x3fb72a={};var _0x5d6669;var _0x29277c;return db[_0x5607('0x36')][_0x5607('0x54')]({'where':{'id':_0x32c220[_0x5607('0x52')]['id']}})['then'](handleEntityNotFound(_0x15ebad,null))[_0x5607('0x19')](function(_0x215292){if(_0x215292){_0x5d6669=_0x215292;_0x3fb72a[_0x5607('0x37')]=_[_0x5607('0x38')](db[_0x5607('0x55')][_0x5607('0x4d')]);_0x3fb72a[_0x5607('0x39')]=_['keys'](_0x32c220[_0x5607('0x39')]);_0x3fb72a[_0x5607('0x41')]=_[_0x5607('0x3a')](_0x3fb72a[_0x5607('0x37')],_0x3fb72a[_0x5607('0x39')]);_0x2f9286[_0x5607('0x3b')]=_['intersection'](_0x3fb72a[_0x5607('0x37')],qs[_0x5607('0x3c')](_0x32c220[_0x5607('0x39')][_0x5607('0x3c')]));_0x2f9286['attributes']=_0x2f9286[_0x5607('0x3b')][_0x5607('0x3d')]?_0x2f9286[_0x5607('0x3b')]:_0x3fb72a[_0x5607('0x37')];_0x2f9286[_0x5607('0x3f')]=qs[_0x5607('0x56')](_0x32c220[_0x5607('0x39')][_0x5607('0x56')]);_0x2f9286['where']=qs[_0x5607('0x41')](_[_0x5607('0x57')](_0x32c220[_0x5607('0x39')],_0x3fb72a[_0x5607('0x41')]));if(_0x32c220['query'][_0x5607('0x42')]){_0x2f9286[_0x5607('0x40')]=_[_0x5607('0x43')](_0x2f9286[_0x5607('0x40')],{'$or':_[_0x5607('0x44')](_0x2f9286[_0x5607('0x3b')],function(_0x556f2e){var _0x726fa3={};_0x726fa3[_0x556f2e]={'$like':'%'+_0x32c220[_0x5607('0x39')][_0x5607('0x42')]+'%'};return _0x726fa3;})});}_0x2f9286=_[_0x5607('0x43')]({},_0x2f9286,_0x32c220[_0x5607('0x48')]);return _0x5d6669[_0x5607('0x5a')](_0x2f9286);}})[_0x5607('0x19')](function(_0x5781e6){if(_0x5781e6){_0x29277c=_0x5781e6['length'];if(!_0x32c220['query'][_0x5607('0x58')](_0x5607('0x3e'))){_0x2f9286[_0x5607('0x28')]=qs['limit'](_0x32c220[_0x5607('0x39')]['limit']);_0x2f9286[_0x5607('0x27')]=qs[_0x5607('0x27')](_0x32c220[_0x5607('0x39')]['offset']);}return _0x5d6669[_0x5607('0x5a')](_0x2f9286);}})[_0x5607('0x19')](function(_0x46e337){if(_0x46e337){return _0x46e337?{'count':_0x29277c,'rows':_0x46e337}:null;}})[_0x5607('0x19')](respondWithResult(_0x15ebad,null))['catch'](handleError(_0x15ebad,null));};exports[_0x5607('0x5b')]=function(_0x2a0fad,_0x104608,_0x3ca03d){var _0x6130f={};var _0x59dd86={};var _0x230d82;var _0x1967e9;return db[_0x5607('0x36')][_0x5607('0x54')]({'where':{'id':_0x2a0fad[_0x5607('0x52')]['id']}})[_0x5607('0x19')](handleEntityNotFound(_0x104608,null))[_0x5607('0x19')](function(_0x50ed81){if(_0x50ed81){_0x230d82=_0x50ed81;_0x59dd86['model']=_[_0x5607('0x38')](db[_0x5607('0x5c')]['rawAttributes']);_0x59dd86[_0x5607('0x39')]=_[_0x5607('0x38')](_0x2a0fad[_0x5607('0x39')]);_0x59dd86[_0x5607('0x41')]=_[_0x5607('0x3a')](_0x59dd86[_0x5607('0x37')],_0x59dd86[_0x5607('0x39')]);_0x6130f[_0x5607('0x3b')]=_[_0x5607('0x3a')](_0x59dd86[_0x5607('0x37')],qs[_0x5607('0x3c')](_0x2a0fad[_0x5607('0x39')]['fields']));_0x6130f['attributes']=_0x6130f[_0x5607('0x3b')][_0x5607('0x3d')]?_0x6130f[_0x5607('0x3b')]:_0x59dd86[_0x5607('0x37')];_0x6130f[_0x5607('0x3f')]=qs[_0x5607('0x56')](_0x2a0fad[_0x5607('0x39')][_0x5607('0x56')]);_0x6130f[_0x5607('0x40')]=qs['filters'](_[_0x5607('0x57')](_0x2a0fad['query'],_0x59dd86['filters']));if(_0x2a0fad[_0x5607('0x39')][_0x5607('0x42')]){_0x6130f[_0x5607('0x40')]=_[_0x5607('0x43')](_0x6130f[_0x5607('0x40')],{'$or':_[_0x5607('0x44')](_0x6130f[_0x5607('0x3b')],function(_0x366b60){var _0x139c2f={};_0x139c2f[_0x366b60]={'$like':'%'+_0x2a0fad[_0x5607('0x39')][_0x5607('0x42')]+'%'};return _0x139c2f;})});}_0x6130f=_[_0x5607('0x43')]({},_0x6130f,_0x2a0fad[_0x5607('0x48')]);return _0x230d82[_0x5607('0x5b')](_0x6130f);}})['then'](function(_0x1805f2){if(_0x1805f2){_0x1967e9=_0x1805f2[_0x5607('0x3d')];if(!_0x2a0fad[_0x5607('0x39')][_0x5607('0x58')](_0x5607('0x3e'))){_0x6130f['limit']=qs[_0x5607('0x28')](_0x2a0fad[_0x5607('0x39')][_0x5607('0x28')]);_0x6130f[_0x5607('0x27')]=qs['offset'](_0x2a0fad[_0x5607('0x39')]['offset']);}return _0x230d82['getTags'](_0x6130f);}})['then'](function(_0x2d922c){if(_0x2d922c){return _0x2d922c?{'count':_0x1967e9,'rows':_0x2d922c}:null;}})[_0x5607('0x19')](respondWithResult(_0x104608,null))[_0x5607('0x23')](handleError(_0x104608,null));};exports['setTags']=function(_0x3a7224,_0x267ea3,_0x23c768){if(_0x3a7224[_0x5607('0x51')]['id']){delete _0x3a7224[_0x5607('0x51')]['id'];}return db['DeskConfiguration'][_0x5607('0x54')]({'where':{'id':_0x3a7224[_0x5607('0x52')]['id']}})[_0x5607('0x19')](handleEntityNotFound(_0x267ea3,null))['then'](function(_0x37c8e0){if(_0x37c8e0){return _0x37c8e0['setTags'](_0x3a7224['body'][_0x5607('0x5d')]||[]);}return null;})[_0x5607('0x19')](respondWithResult(_0x267ea3,null))['catch'](handleError(_0x267ea3,null));}; \ No newline at end of file +var _0xdbfc=['mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','DeskConfiguration','includeAll','findAll','rows','show','params','find','create','body','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird'];(function(_0x16eb22,_0x2ff73a){var _0x9ed0d9=function(_0x16f289){while(--_0x16f289){_0x16eb22['push'](_0x16eb22['shift']());}};_0x9ed0d9(++_0x2ff73a);}(_0xdbfc,0x11d));var _0xcdbf=function(_0x3e6375,_0x195d51){_0x3e6375=_0x3e6375-0x0;var _0x39c31d=_0xdbfc[_0x3e6375];return _0x39c31d;};'use strict';var pdf=require(_0xcdbf('0x0'));var emlformat=require(_0xcdbf('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcdbf('0x2'));var rp=require(_0xcdbf('0x3'));var moment=require(_0xcdbf('0x4'));var BPromise=require(_0xcdbf('0x5'));var Mustache=require(_0xcdbf('0x6'));var util=require(_0xcdbf('0x7'));var path=require(_0xcdbf('0x8'));var sox=require('sox');var csv=require(_0xcdbf('0x9'));var ejs=require(_0xcdbf('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcdbf('0xb'));var crypto=require(_0xcdbf('0xc'));var jsforce=require(_0xcdbf('0xd'));var deskjs=require(_0xcdbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcdbf('0xf'));var Papa=require(_0xcdbf('0x10'));var Redis=require(_0xcdbf('0x11'));var authService=require(_0xcdbf('0x12'));var qs=require(_0xcdbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcdbf('0x14'))('api');var utils=require(_0xcdbf('0x15'));var config=require('../../config/environment');var db=require(_0xcdbf('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xcdbf('0x17')][_0xcdbf('0x18')]({'port':0x232a});function checkPasswordPattern(_0x371f6c,_0x4e64dd,_0x1d6608){if(_0x1d6608){var _0x5d6f29=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d6f29[_0xcdbf('0x19')](_0x4e64dd)){return _0x371f6c;}else{throw new Error(_0xcdbf('0x1a'));}}else{return _0x371f6c;}}function respondWithRpcPromise(_0xe632be,_0x395ff8,_0x3e3881,_0x5ec307){return new BPromise(function(_0x3eba78,_0x403795){var _0x1ce3bb=_0x5ec307||client;return _0x1ce3bb[_0xcdbf('0x1b')](_0xe632be,_0x3e3881)[_0xcdbf('0x1c')](function(_0x2d78bc){logger[_0xcdbf('0x1d')](_0xcdbf('0x1e'),_0x395ff8,_0xcdbf('0x1f'));logger[_0xcdbf('0x20')](_0xcdbf('0x21'),_0x395ff8,'request\x20sent',JSON[_0xcdbf('0x22')](_0x2d78bc));if(_0x2d78bc[_0xcdbf('0x23')]){if(_0x2d78bc[_0xcdbf('0x23')][_0xcdbf('0x24')]===0x1f4){logger[_0xcdbf('0x23')](_0xcdbf('0x1e'),_0x395ff8,_0x2d78bc['error'][_0xcdbf('0x25')]);return _0x403795(_0x2d78bc[_0xcdbf('0x23')][_0xcdbf('0x25')]);}logger[_0xcdbf('0x23')](_0xcdbf('0x1e'),_0x395ff8,_0x2d78bc['error'][_0xcdbf('0x25')]);return _0x3eba78(_0x2d78bc[_0xcdbf('0x23')][_0xcdbf('0x25')]);}else{logger[_0xcdbf('0x1d')]('DeskConfiguration,\x20%s,\x20%s',_0x395ff8,_0xcdbf('0x1f'));_0x3eba78(_0x2d78bc['result']['message']);}})[_0xcdbf('0x26')](function(_0x488013){logger[_0xcdbf('0x23')](_0xcdbf('0x1e'),_0x395ff8,_0x488013);_0x403795(_0x488013);});});}function respondWithStatusCode(_0x3e1dd7,_0x21da6e){_0x21da6e=_0x21da6e||0xcc;return function(_0x2b9764){if(_0x2b9764){return _0x3e1dd7['sendStatus'](_0x21da6e);}return _0x3e1dd7[_0xcdbf('0x27')](_0x21da6e)[_0xcdbf('0x28')]();};}function respondWithResult(_0x19898b,_0x44db5a){_0x44db5a=_0x44db5a||0xc8;return function(_0x3b6da3){if(_0x3b6da3){return _0x19898b[_0xcdbf('0x27')](_0x44db5a)[_0xcdbf('0x29')](_0x3b6da3);}};}function respondWithFilteredResult(_0x596fe9,_0x3b96ba){return function(_0x37a5b1){if(_0x37a5b1){var _0xc9f8e5=_0x37a5b1[_0xcdbf('0x2a')],_0x474af8=_0x3b96ba['offset'],_0x15c884=_0x3b96ba[_0xcdbf('0x2b')]+_0x3b96ba[_0xcdbf('0x2c')],_0x48f4a;if(_0x15c884>=_0xc9f8e5){_0x15c884=_0xc9f8e5;_0x48f4a=0xc8;}else{_0x48f4a=0xce;}_0x596fe9[_0xcdbf('0x27')](_0x48f4a);return _0x596fe9[_0xcdbf('0x2d')](_0xcdbf('0x2e'),_0x474af8+'-'+_0x15c884+'/'+_0xc9f8e5)['json'](_0x37a5b1);}return null;};}function patchUpdates(_0x2863d0){return function(_0x10cac2){try{jsonpatch[_0xcdbf('0x2f')](_0x10cac2,_0x2863d0,!![]);}catch(_0x1dfce2){return BPromise[_0xcdbf('0x30')](_0x1dfce2);}return _0x10cac2[_0xcdbf('0x31')]();};}function saveUpdates(_0x4fb7c2,_0x3957a9){return function(_0x1d02da){if(_0x1d02da){return _0x1d02da[_0xcdbf('0x32')](_0x4fb7c2)[_0xcdbf('0x1c')](function(_0x2e7ad5){return _0x2e7ad5;});}return null;};}function removeEntity(_0x517324,_0x157399){return function(_0x272e27){if(_0x272e27){return _0x272e27[_0xcdbf('0x33')]()[_0xcdbf('0x1c')](function(){_0x517324[_0xcdbf('0x27')](0xcc)[_0xcdbf('0x28')]();});}};}function handleEntityNotFound(_0x2a37e2,_0x8fea82){return function(_0x4a2ec){if(!_0x4a2ec){_0x2a37e2[_0xcdbf('0x34')](0x194);}return _0x4a2ec;};}function handleError(_0x57fde0,_0x531bf8){_0x531bf8=_0x531bf8||0x1f4;return function(_0x19babb){logger[_0xcdbf('0x23')](_0x19babb[_0xcdbf('0x35')]);if(_0x19babb['name']){delete _0x19babb[_0xcdbf('0x36')];}_0x57fde0[_0xcdbf('0x27')](_0x531bf8)[_0xcdbf('0x37')](_0x19babb);};}exports[_0xcdbf('0x38')]=function(_0x23412b,_0x74ee45){var _0x40cffe={},_0x3650ac={},_0x5a0569={'count':0x0,'rows':[]};var _0x972fef=db['DeskConfiguration'][_0xcdbf('0x39')];_0x3650ac['model']=_[_0xcdbf('0x3a')](_0x972fef);_0x3650ac[_0xcdbf('0x3b')]=_[_0xcdbf('0x3a')](_0x23412b[_0xcdbf('0x3b')]);_0x3650ac[_0xcdbf('0x3c')]=_[_0xcdbf('0x3d')](_0x3650ac[_0xcdbf('0x3e')],_0x3650ac[_0xcdbf('0x3b')]);_0x40cffe[_0xcdbf('0x3f')]=_[_0xcdbf('0x3d')](_0x3650ac['model'],qs[_0xcdbf('0x40')](_0x23412b[_0xcdbf('0x3b')][_0xcdbf('0x40')]));_0x40cffe[_0xcdbf('0x3f')]=_0x40cffe['attributes'][_0xcdbf('0x41')]?_0x40cffe[_0xcdbf('0x3f')]:_0x3650ac[_0xcdbf('0x3e')];if(!_0x23412b[_0xcdbf('0x3b')][_0xcdbf('0x42')](_0xcdbf('0x43'))){_0x40cffe[_0xcdbf('0x2c')]=qs[_0xcdbf('0x2c')](_0x23412b['query'][_0xcdbf('0x2c')]);_0x40cffe[_0xcdbf('0x2b')]=qs['offset'](_0x23412b[_0xcdbf('0x3b')][_0xcdbf('0x2b')]);}_0x40cffe[_0xcdbf('0x44')]=qs[_0xcdbf('0x45')](_0x23412b[_0xcdbf('0x3b')][_0xcdbf('0x45')]);_0x40cffe[_0xcdbf('0x46')]=qs[_0xcdbf('0x3c')](_[_0xcdbf('0x47')](_0x23412b[_0xcdbf('0x3b')],_0x3650ac[_0xcdbf('0x3c')]));if(_0x23412b['query'][_0xcdbf('0x48')]){_0x40cffe[_0xcdbf('0x46')]=_[_0xcdbf('0x49')](_0x40cffe['where'],{'$or':_[_0xcdbf('0x4a')](_0x972fef,function(_0x271d61){if(_0x271d61[_0xcdbf('0x4b')][_0xcdbf('0x4c')]!==_0xcdbf('0x4d')){var _0xb3e817={};_0xb3e817[_0x271d61['field']]={'$like':'%'+_0x23412b[_0xcdbf('0x3b')][_0xcdbf('0x48')]+'%'};return _0xb3e817;}})});}_0x40cffe=_[_0xcdbf('0x49')]({},_0x40cffe,_0x23412b[_0xcdbf('0x4e')]);var _0x5d923e={'where':_0x40cffe['where']};return db[_0xcdbf('0x4f')][_0xcdbf('0x2a')](_0x5d923e)[_0xcdbf('0x1c')](function(_0x102376){_0x5a0569[_0xcdbf('0x2a')]=_0x102376;if(_0x23412b['query'][_0xcdbf('0x50')]){_0x40cffe['include']=[{'all':!![]}];}return db[_0xcdbf('0x4f')][_0xcdbf('0x51')](_0x40cffe);})[_0xcdbf('0x1c')](function(_0x5aad1b){_0x5a0569[_0xcdbf('0x52')]=_0x5aad1b;return _0x5a0569;})['then'](respondWithFilteredResult(_0x74ee45,_0x40cffe))[_0xcdbf('0x26')](handleError(_0x74ee45,null));};exports[_0xcdbf('0x53')]=function(_0x8f12fe,_0x969804){var _0x39fe57={'raw':![],'where':{'id':_0x8f12fe[_0xcdbf('0x54')]['id']}},_0x24f818={};_0x24f818[_0xcdbf('0x3e')]=_['keys'](db[_0xcdbf('0x4f')][_0xcdbf('0x39')]);_0x24f818[_0xcdbf('0x3b')]=_[_0xcdbf('0x3a')](_0x8f12fe['query']);_0x24f818[_0xcdbf('0x3c')]=_[_0xcdbf('0x3d')](_0x24f818[_0xcdbf('0x3e')],_0x24f818[_0xcdbf('0x3b')]);_0x39fe57[_0xcdbf('0x3f')]=_[_0xcdbf('0x3d')](_0x24f818['model'],qs['fields'](_0x8f12fe[_0xcdbf('0x3b')][_0xcdbf('0x40')]));_0x39fe57[_0xcdbf('0x3f')]=_0x39fe57['attributes'][_0xcdbf('0x41')]?_0x39fe57[_0xcdbf('0x3f')]:_0x24f818[_0xcdbf('0x3e')];if(_0x8f12fe[_0xcdbf('0x3b')][_0xcdbf('0x50')]){_0x39fe57['include']=[{'all':!![]}];}_0x39fe57=_[_0xcdbf('0x49')]({},_0x39fe57,_0x8f12fe[_0xcdbf('0x4e')]);return db['DeskConfiguration'][_0xcdbf('0x55')](_0x39fe57)[_0xcdbf('0x1c')](handleEntityNotFound(_0x969804,null))[_0xcdbf('0x1c')](respondWithResult(_0x969804,null))[_0xcdbf('0x26')](handleError(_0x969804,null));};exports[_0xcdbf('0x56')]=function(_0xa34267,_0x2fcca2){return db[_0xcdbf('0x4f')][_0xcdbf('0x56')](_0xa34267['body'],{})['then'](respondWithResult(_0x2fcca2,0xc9))['catch'](handleError(_0x2fcca2,null));};exports[_0xcdbf('0x32')]=function(_0x5f137e,_0x27c54f){if(_0x5f137e['body']['id']){delete _0x5f137e[_0xcdbf('0x57')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x5f137e[_0xcdbf('0x54')]['id']}})['then'](handleEntityNotFound(_0x27c54f,null))[_0xcdbf('0x1c')](saveUpdates(_0x5f137e[_0xcdbf('0x57')],null))[_0xcdbf('0x1c')](respondWithResult(_0x27c54f,null))['catch'](handleError(_0x27c54f,null));};exports['destroy']=function(_0x23e0d4,_0x325575){return db[_0xcdbf('0x4f')][_0xcdbf('0x55')]({'where':{'id':_0x23e0d4[_0xcdbf('0x54')]['id']}})['then'](handleEntityNotFound(_0x325575,null))[_0xcdbf('0x1c')](removeEntity(_0x325575,null))[_0xcdbf('0x26')](handleError(_0x325575,null));};exports[_0xcdbf('0x58')]=function(_0xe2ec5f,_0x138a7a,_0x24b7b2){var _0x32cba1={};var _0x182304={};var _0x1f6f3c;var _0xbda577;return db[_0xcdbf('0x4f')]['findOne']({'where':{'id':_0xe2ec5f[_0xcdbf('0x54')]['id']}})[_0xcdbf('0x1c')](handleEntityNotFound(_0x138a7a,null))[_0xcdbf('0x1c')](function(_0x5bd0ea){if(_0x5bd0ea){_0x1f6f3c=_0x5bd0ea;_0x182304[_0xcdbf('0x3e')]=_[_0xcdbf('0x3a')](db['DeskField'][_0xcdbf('0x39')]);_0x182304[_0xcdbf('0x3b')]=_[_0xcdbf('0x3a')](_0xe2ec5f[_0xcdbf('0x3b')]);_0x182304[_0xcdbf('0x3c')]=_[_0xcdbf('0x3d')](_0x182304[_0xcdbf('0x3e')],_0x182304[_0xcdbf('0x3b')]);_0x32cba1[_0xcdbf('0x3f')]=_[_0xcdbf('0x3d')](_0x182304[_0xcdbf('0x3e')],qs[_0xcdbf('0x40')](_0xe2ec5f[_0xcdbf('0x3b')][_0xcdbf('0x40')]));_0x32cba1[_0xcdbf('0x3f')]=_0x32cba1[_0xcdbf('0x3f')][_0xcdbf('0x41')]?_0x32cba1[_0xcdbf('0x3f')]:_0x182304[_0xcdbf('0x3e')];_0x32cba1['order']=qs[_0xcdbf('0x45')](_0xe2ec5f[_0xcdbf('0x3b')][_0xcdbf('0x45')]);_0x32cba1[_0xcdbf('0x46')]=qs[_0xcdbf('0x3c')](_[_0xcdbf('0x47')](_0xe2ec5f['query'],_0x182304[_0xcdbf('0x3c')]));if(_0xe2ec5f[_0xcdbf('0x3b')][_0xcdbf('0x48')]){_0x32cba1[_0xcdbf('0x46')]=_[_0xcdbf('0x49')](_0x32cba1[_0xcdbf('0x46')],{'$or':_[_0xcdbf('0x4a')](_0x32cba1['attributes'],function(_0x570e85){var _0x4d3e3c={};_0x4d3e3c[_0x570e85]={'$like':'%'+_0xe2ec5f[_0xcdbf('0x3b')][_0xcdbf('0x48')]+'%'};return _0x4d3e3c;})});}_0x32cba1=_['merge']({},_0x32cba1,_0xe2ec5f[_0xcdbf('0x4e')]);return _0x1f6f3c[_0xcdbf('0x58')](_0x32cba1);}})[_0xcdbf('0x1c')](function(_0x4985a9){if(_0x4985a9){_0xbda577=_0x4985a9[_0xcdbf('0x41')];if(!_0xe2ec5f[_0xcdbf('0x3b')][_0xcdbf('0x42')](_0xcdbf('0x43'))){_0x32cba1['limit']=qs[_0xcdbf('0x2c')](_0xe2ec5f[_0xcdbf('0x3b')][_0xcdbf('0x2c')]);_0x32cba1[_0xcdbf('0x2b')]=qs[_0xcdbf('0x2b')](_0xe2ec5f[_0xcdbf('0x3b')][_0xcdbf('0x2b')]);}return _0x1f6f3c[_0xcdbf('0x58')](_0x32cba1);}})['then'](function(_0x17686d){if(_0x17686d){return _0x17686d?{'count':_0xbda577,'rows':_0x17686d}:null;}})[_0xcdbf('0x1c')](respondWithResult(_0x138a7a,null))[_0xcdbf('0x26')](handleError(_0x138a7a,null));};exports['getSubjects']=function(_0x3fc180,_0x3a1a43,_0x42d56c){var _0x1b907d={};var _0x2dd1d2={};var _0x30698c;var _0xc2e5f9;return db[_0xcdbf('0x4f')][_0xcdbf('0x59')]({'where':{'id':_0x3fc180[_0xcdbf('0x54')]['id']}})[_0xcdbf('0x1c')](handleEntityNotFound(_0x3a1a43,null))[_0xcdbf('0x1c')](function(_0x27acdc){if(_0x27acdc){_0x30698c=_0x27acdc;_0x2dd1d2[_0xcdbf('0x3e')]=_[_0xcdbf('0x3a')](db[_0xcdbf('0x5a')][_0xcdbf('0x39')]);_0x2dd1d2[_0xcdbf('0x3b')]=_['keys'](_0x3fc180['query']);_0x2dd1d2[_0xcdbf('0x3c')]=_['intersection'](_0x2dd1d2['model'],_0x2dd1d2['query']);_0x1b907d[_0xcdbf('0x3f')]=_['intersection'](_0x2dd1d2['model'],qs[_0xcdbf('0x40')](_0x3fc180[_0xcdbf('0x3b')]['fields']));_0x1b907d[_0xcdbf('0x3f')]=_0x1b907d[_0xcdbf('0x3f')][_0xcdbf('0x41')]?_0x1b907d[_0xcdbf('0x3f')]:_0x2dd1d2[_0xcdbf('0x3e')];_0x1b907d[_0xcdbf('0x44')]=qs['sort'](_0x3fc180[_0xcdbf('0x3b')][_0xcdbf('0x45')]);_0x1b907d[_0xcdbf('0x46')]=qs[_0xcdbf('0x3c')](_[_0xcdbf('0x47')](_0x3fc180['query'],_0x2dd1d2[_0xcdbf('0x3c')]));if(_0x3fc180[_0xcdbf('0x3b')]['filter']){_0x1b907d[_0xcdbf('0x46')]=_[_0xcdbf('0x49')](_0x1b907d['where'],{'$or':_[_0xcdbf('0x4a')](_0x1b907d[_0xcdbf('0x3f')],function(_0x76509a){var _0x1716e2={};_0x1716e2[_0x76509a]={'$like':'%'+_0x3fc180[_0xcdbf('0x3b')][_0xcdbf('0x48')]+'%'};return _0x1716e2;})});}_0x1b907d=_[_0xcdbf('0x49')]({},_0x1b907d,_0x3fc180[_0xcdbf('0x4e')]);return _0x30698c[_0xcdbf('0x5b')](_0x1b907d);}})['then'](function(_0x48da86){if(_0x48da86){_0xc2e5f9=_0x48da86['length'];if(!_0x3fc180[_0xcdbf('0x3b')][_0xcdbf('0x42')](_0xcdbf('0x43'))){_0x1b907d['limit']=qs['limit'](_0x3fc180[_0xcdbf('0x3b')][_0xcdbf('0x2c')]);_0x1b907d['offset']=qs[_0xcdbf('0x2b')](_0x3fc180['query'][_0xcdbf('0x2b')]);}return _0x30698c[_0xcdbf('0x5b')](_0x1b907d);}})[_0xcdbf('0x1c')](function(_0x4c35aa){if(_0x4c35aa){return _0x4c35aa?{'count':_0xc2e5f9,'rows':_0x4c35aa}:null;}})[_0xcdbf('0x1c')](respondWithResult(_0x3a1a43,null))[_0xcdbf('0x26')](handleError(_0x3a1a43,null));};exports['getDescriptions']=function(_0x64f2a9,_0x2149e7,_0x5e68a3){var _0x117167={};var _0x266d28={};var _0x14f740;var _0x5aa2a3;return db[_0xcdbf('0x4f')]['findOne']({'where':{'id':_0x64f2a9['params']['id']}})[_0xcdbf('0x1c')](handleEntityNotFound(_0x2149e7,null))[_0xcdbf('0x1c')](function(_0x57e9dd){if(_0x57e9dd){_0x14f740=_0x57e9dd;_0x266d28[_0xcdbf('0x3e')]=_['keys'](db[_0xcdbf('0x5a')]['rawAttributes']);_0x266d28['query']=_['keys'](_0x64f2a9['query']);_0x266d28[_0xcdbf('0x3c')]=_['intersection'](_0x266d28[_0xcdbf('0x3e')],_0x266d28[_0xcdbf('0x3b')]);_0x117167[_0xcdbf('0x3f')]=_[_0xcdbf('0x3d')](_0x266d28[_0xcdbf('0x3e')],qs[_0xcdbf('0x40')](_0x64f2a9[_0xcdbf('0x3b')]['fields']));_0x117167['attributes']=_0x117167[_0xcdbf('0x3f')][_0xcdbf('0x41')]?_0x117167[_0xcdbf('0x3f')]:_0x266d28[_0xcdbf('0x3e')];_0x117167['order']=qs[_0xcdbf('0x45')](_0x64f2a9[_0xcdbf('0x3b')][_0xcdbf('0x45')]);_0x117167[_0xcdbf('0x46')]=qs[_0xcdbf('0x3c')](_[_0xcdbf('0x47')](_0x64f2a9[_0xcdbf('0x3b')],_0x266d28[_0xcdbf('0x3c')]));if(_0x64f2a9[_0xcdbf('0x3b')][_0xcdbf('0x48')]){_0x117167[_0xcdbf('0x46')]=_[_0xcdbf('0x49')](_0x117167['where'],{'$or':_[_0xcdbf('0x4a')](_0x117167[_0xcdbf('0x3f')],function(_0x2ba703){var _0x1bd7ce={};_0x1bd7ce[_0x2ba703]={'$like':'%'+_0x64f2a9[_0xcdbf('0x3b')][_0xcdbf('0x48')]+'%'};return _0x1bd7ce;})});}_0x117167=_[_0xcdbf('0x49')]({},_0x117167,_0x64f2a9[_0xcdbf('0x4e')]);return _0x14f740[_0xcdbf('0x5c')](_0x117167);}})[_0xcdbf('0x1c')](function(_0x49e491){if(_0x49e491){_0x5aa2a3=_0x49e491[_0xcdbf('0x41')];if(!_0x64f2a9['query'][_0xcdbf('0x42')](_0xcdbf('0x43'))){_0x117167[_0xcdbf('0x2c')]=qs[_0xcdbf('0x2c')](_0x64f2a9[_0xcdbf('0x3b')][_0xcdbf('0x2c')]);_0x117167[_0xcdbf('0x2b')]=qs[_0xcdbf('0x2b')](_0x64f2a9[_0xcdbf('0x3b')][_0xcdbf('0x2b')]);}return _0x14f740['getDescriptions'](_0x117167);}})[_0xcdbf('0x1c')](function(_0x61cd24){if(_0x61cd24){return _0x61cd24?{'count':_0x5aa2a3,'rows':_0x61cd24}:null;}})[_0xcdbf('0x1c')](respondWithResult(_0x2149e7,null))[_0xcdbf('0x26')](handleError(_0x2149e7,null));};exports[_0xcdbf('0x5d')]=function(_0x1d2c77,_0x1a6883,_0x1dc828){var _0x5dd8f3={};var _0x2cff51={};var _0x27f5d0;var _0x2bc882;return db['DeskConfiguration'][_0xcdbf('0x59')]({'where':{'id':_0x1d2c77[_0xcdbf('0x54')]['id']}})[_0xcdbf('0x1c')](handleEntityNotFound(_0x1a6883,null))[_0xcdbf('0x1c')](function(_0x2db35e){if(_0x2db35e){_0x27f5d0=_0x2db35e;_0x2cff51[_0xcdbf('0x3e')]=_[_0xcdbf('0x3a')](db[_0xcdbf('0x5e')][_0xcdbf('0x39')]);_0x2cff51[_0xcdbf('0x3b')]=_[_0xcdbf('0x3a')](_0x1d2c77[_0xcdbf('0x3b')]);_0x2cff51['filters']=_[_0xcdbf('0x3d')](_0x2cff51[_0xcdbf('0x3e')],_0x2cff51['query']);_0x5dd8f3[_0xcdbf('0x3f')]=_['intersection'](_0x2cff51[_0xcdbf('0x3e')],qs[_0xcdbf('0x40')](_0x1d2c77[_0xcdbf('0x3b')][_0xcdbf('0x40')]));_0x5dd8f3[_0xcdbf('0x3f')]=_0x5dd8f3[_0xcdbf('0x3f')][_0xcdbf('0x41')]?_0x5dd8f3[_0xcdbf('0x3f')]:_0x2cff51[_0xcdbf('0x3e')];_0x5dd8f3[_0xcdbf('0x44')]=qs['sort'](_0x1d2c77[_0xcdbf('0x3b')][_0xcdbf('0x45')]);_0x5dd8f3[_0xcdbf('0x46')]=qs[_0xcdbf('0x3c')](_[_0xcdbf('0x47')](_0x1d2c77[_0xcdbf('0x3b')],_0x2cff51[_0xcdbf('0x3c')]));if(_0x1d2c77[_0xcdbf('0x3b')][_0xcdbf('0x48')]){_0x5dd8f3[_0xcdbf('0x46')]=_[_0xcdbf('0x49')](_0x5dd8f3[_0xcdbf('0x46')],{'$or':_[_0xcdbf('0x4a')](_0x5dd8f3[_0xcdbf('0x3f')],function(_0x5cc9e4){var _0x48b21a={};_0x48b21a[_0x5cc9e4]={'$like':'%'+_0x1d2c77[_0xcdbf('0x3b')]['filter']+'%'};return _0x48b21a;})});}_0x5dd8f3=_[_0xcdbf('0x49')]({},_0x5dd8f3,_0x1d2c77['options']);return _0x27f5d0['getTags'](_0x5dd8f3);}})[_0xcdbf('0x1c')](function(_0x5bb0fb){if(_0x5bb0fb){_0x2bc882=_0x5bb0fb[_0xcdbf('0x41')];if(!_0x1d2c77[_0xcdbf('0x3b')][_0xcdbf('0x42')]('nolimit')){_0x5dd8f3[_0xcdbf('0x2c')]=qs[_0xcdbf('0x2c')](_0x1d2c77[_0xcdbf('0x3b')][_0xcdbf('0x2c')]);_0x5dd8f3[_0xcdbf('0x2b')]=qs['offset'](_0x1d2c77[_0xcdbf('0x3b')][_0xcdbf('0x2b')]);}return _0x27f5d0[_0xcdbf('0x5d')](_0x5dd8f3);}})[_0xcdbf('0x1c')](function(_0x3a3c15){if(_0x3a3c15){return _0x3a3c15?{'count':_0x2bc882,'rows':_0x3a3c15}:null;}})[_0xcdbf('0x1c')](respondWithResult(_0x1a6883,null))[_0xcdbf('0x26')](handleError(_0x1a6883,null));};exports[_0xcdbf('0x5f')]=function(_0x5d67fb,_0xb77a49,_0x270fc5){if(_0x5d67fb[_0xcdbf('0x57')]['id']){delete _0x5d67fb['body']['id'];}return db[_0xcdbf('0x4f')][_0xcdbf('0x59')]({'where':{'id':_0x5d67fb['params']['id']}})[_0xcdbf('0x1c')](handleEntityNotFound(_0xb77a49,null))[_0xcdbf('0x1c')](function(_0x599e04){if(_0x599e04){return _0x599e04[_0xcdbf('0x5f')](_0x5d67fb[_0xcdbf('0x57')][_0xcdbf('0x60')]||[]);}return null;})[_0xcdbf('0x1c')](respondWithResult(_0xb77a49,null))[_0xcdbf('0x26')](handleError(_0xb77a49,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 621f03d..0844b64 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 _0x1e22=['define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x4b8b6d,_0x16f445){var _0x4c4fdc=function(_0x3d3437){while(--_0x3d3437){_0x4b8b6d['push'](_0x4b8b6d['shift']());}};_0x4c4fdc(++_0x16f445);}(_0x1e22,0xd3));var _0x21e2=function(_0x5ca6b7,_0x1a4f32){_0x5ca6b7=_0x5ca6b7-0x0;var _0x2d7743=_0x1e22[_0x5ca6b7];return _0x2d7743;};'use strict';var _=require(_0x21e2('0x0'));var util=require('util');var logger=require(_0x21e2('0x1'))('api');var moment=require(_0x21e2('0x2'));var BPromise=require(_0x21e2('0x3'));var rp=require(_0x21e2('0x4'));var fs=require('fs');var path=require(_0x21e2('0x5'));var rimraf=require(_0x21e2('0x6'));var config=require(_0x21e2('0x7'));var attributes=require(_0x21e2('0x8'));module[_0x21e2('0x9')]=function(_0x279aea,_0x255309){return _0x279aea[_0x21e2('0xa')](_0x21e2('0xb'),attributes,{'tableName':_0x21e2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3cc7=['bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','moment'];(function(_0x32f250,_0x1fbca3){var _0x39ead3=function(_0x7e79d6){while(--_0x7e79d6){_0x32f250['push'](_0x32f250['shift']());}};_0x39ead3(++_0x1fbca3);}(_0x3cc7,0xf3));var _0x73cc=function(_0x1c8c07,_0x2579af){_0x1c8c07=_0x1c8c07-0x0;var _0x4aa88f=_0x3cc7[_0x1c8c07];return _0x4aa88f;};'use strict';var _=require(_0x73cc('0x0'));var util=require('util');var logger=require(_0x73cc('0x1'))(_0x73cc('0x2'));var moment=require(_0x73cc('0x3'));var BPromise=require(_0x73cc('0x4'));var rp=require(_0x73cc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x73cc('0x6'));var config=require(_0x73cc('0x7'));var attributes=require(_0x73cc('0x8'));module[_0x73cc('0x9')]=function(_0x2806b2,_0x4f088a){return _0x2806b2[_0x73cc('0xa')](_0x73cc('0xb'),attributes,{'tableName':_0x73cc('0xc'),'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 3315050..00ee7cb 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 _0x13c0=['request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x571c8e,_0x18546d){var _0x1fe343=function(_0x34e91c){while(--_0x34e91c){_0x571c8e['push'](_0x571c8e['shift']());}};_0x1fe343(++_0x18546d);}(_0x13c0,0x79));var _0x013c=function(_0x51ed62,_0x574379){_0x51ed62=_0x51ed62-0x0;var _0x34aee3=_0x13c0[_0x51ed62];return _0x34aee3;};'use strict';var _=require(_0x013c('0x0'));var util=require(_0x013c('0x1'));var moment=require(_0x013c('0x2'));var BPromise=require(_0x013c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x013c('0x4'));var logger=require(_0x013c('0x5'))(_0x013c('0x6'));var config=require(_0x013c('0x7'));var jayson=require(_0x013c('0x8'));var client=jayson[_0x013c('0x9')][_0x013c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3decb5,_0x50caf2,_0x4cf99d){return new BPromise(function(_0x593053,_0x27c830){return client[_0x013c('0xb')](_0x3decb5,_0x4cf99d)['then'](function(_0x28c3a0){logger[_0x013c('0xc')](_0x013c('0xd'),_0x50caf2,_0x013c('0xe'));logger[_0x013c('0xf')](_0x013c('0x10'),_0x50caf2,_0x013c('0xe'),JSON[_0x013c('0x11')](_0x28c3a0));if(_0x28c3a0[_0x013c('0x12')]){if(_0x28c3a0[_0x013c('0x12')]['code']===0x1f4){logger['error'](_0x013c('0xd'),_0x50caf2,_0x28c3a0[_0x013c('0x12')][_0x013c('0x13')]);return _0x27c830(_0x28c3a0[_0x013c('0x12')]['message']);}logger[_0x013c('0x12')](_0x013c('0xd'),_0x50caf2,_0x28c3a0[_0x013c('0x12')][_0x013c('0x13')]);return _0x593053(_0x28c3a0[_0x013c('0x12')]['message']);}else{logger[_0x013c('0xc')](_0x013c('0xd'),_0x50caf2,_0x013c('0xe'));_0x593053(_0x28c3a0[_0x013c('0x14')][_0x013c('0x13')]);}})[_0x013c('0x15')](function(_0x6b8b5){logger[_0x013c('0x12')](_0x013c('0xd'),_0x50caf2,_0x6b8b5);_0x27c830(_0x6b8b5);});});} \ No newline at end of file +var _0x49e9=['stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x352ca8,_0x5d47a5){var _0x6b5197=function(_0x27ed74){while(--_0x27ed74){_0x352ca8['push'](_0x352ca8['shift']());}};_0x6b5197(++_0x5d47a5);}(_0x49e9,0x10f));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var moment=require('moment');var BPromise=require(_0x949e('0x2'));var rs=require(_0x949e('0x3'));var fs=require('fs');var Redis=require(_0x949e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x949e('0x5'))('rpc');var config=require(_0x949e('0x6'));var jayson=require(_0x949e('0x7'));var client=jayson[_0x949e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17f649,_0x16c669,_0xfc4f8a){return new BPromise(function(_0x34ee57,_0x40d442){return client[_0x949e('0x9')](_0x17f649,_0xfc4f8a)[_0x949e('0xa')](function(_0x56e31d){logger[_0x949e('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x16c669,_0x949e('0xc'));logger[_0x949e('0xd')](_0x949e('0xe'),_0x16c669,'request\x20sent',JSON[_0x949e('0xf')](_0x56e31d));if(_0x56e31d[_0x949e('0x10')]){if(_0x56e31d[_0x949e('0x10')][_0x949e('0x11')]===0x1f4){logger[_0x949e('0x10')](_0x949e('0x12'),_0x16c669,_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);return _0x40d442(_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);}logger[_0x949e('0x10')](_0x949e('0x12'),_0x16c669,_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);return _0x34ee57(_0x56e31d[_0x949e('0x10')]['message']);}else{logger[_0x949e('0xb')](_0x949e('0x12'),_0x16c669,_0x949e('0xc'));_0x34ee57(_0x56e31d[_0x949e('0x14')]['message']);}})[_0x949e('0x15')](function(_0x441b80){logger['error'](_0x949e('0x12'),_0x16c669,_0x441b80);_0x40d442(_0x441b80);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 0caf3eb..6591fee 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 _0xb877=['connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskField.controller','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3e2c1e,_0x1e8d40){var _0x1c6666=function(_0x190b73){while(--_0x190b73){_0x3e2c1e['push'](_0x3e2c1e['shift']());}};_0x1c6666(++_0x1e8d40);}(_0xb877,0x19f));var _0x7b87=function(_0x136f74,_0x1fb2ee){_0x136f74=_0x136f74-0x0;var _0x52c000=_0xb877[_0x136f74];return _0x52c000;};'use strict';var multer=require(_0x7b87('0x0'));var util=require(_0x7b87('0x1'));var path=require(_0x7b87('0x2'));var timeout=require(_0x7b87('0x3'));var express=require(_0x7b87('0x4'));var router=express['Router']();var auth=require(_0x7b87('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7b87('0x6'));var controller=require(_0x7b87('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b87('0x8')]);router['get'](_0x7b87('0x9'),auth['isAuthenticated'](),controller[_0x7b87('0xa')]);router[_0x7b87('0xb')]('/',auth[_0x7b87('0xc')](),controller[_0x7b87('0xd')]);router[_0x7b87('0xe')](_0x7b87('0x9'),auth[_0x7b87('0xc')](),controller[_0x7b87('0xf')]);router[_0x7b87('0x10')](_0x7b87('0x9'),auth[_0x7b87('0xc')](),controller[_0x7b87('0x11')]);module[_0x7b87('0x12')]=router; \ No newline at end of file +var _0x1c81=['connect-timeout','Router','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','/:id','show','delete','destroy','multer','util'];(function(_0x9be28f,_0x231334){var _0xa9f52d=function(_0x239dad){while(--_0x239dad){_0x9be28f['push'](_0x9be28f['shift']());}};_0xa9f52d(++_0x231334);}(_0x1c81,0x8d));var _0x11c8=function(_0x4e0daa,_0x53859c){_0x4e0daa=_0x4e0daa-0x0;var _0x56efc7=_0x1c81[_0x4e0daa];return _0x56efc7;};'use strict';var multer=require(_0x11c8('0x0'));var util=require(_0x11c8('0x1'));var path=require('path');var timeout=require(_0x11c8('0x2'));var express=require('express');var router=express[_0x11c8('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x11c8('0x4'));var controller=require(_0x11c8('0x5'));router['get']('/',auth[_0x11c8('0x6')](),controller[_0x11c8('0x7')]);router[_0x11c8('0x8')](_0x11c8('0x9'),auth[_0x11c8('0x6')](),controller[_0x11c8('0xa')]);router['post']('/',auth[_0x11c8('0x6')](),controller['create']);router['put'](_0x11c8('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x11c8('0xb')](_0x11c8('0x9'),auth['isAuthenticated'](),controller[_0x11c8('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index a357bff..6ff1d1a 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 _0xb682=['variable','customVariable','STRING','BOOLEAN','ENUM','string'];(function(_0x171df1,_0x540d7e){var _0x481468=function(_0x51883c){while(--_0x51883c){_0x171df1['push'](_0x171df1['shift']());}};_0x481468(++_0x540d7e);}(_0xb682,0x1d2));var _0x2b68=function(_0x2d6d5f,_0x583ccd){_0x2d6d5f=_0x2d6d5f-0x0;var _0x7a96b7=_0xb682[_0x2d6d5f];return _0x7a96b7;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x2b68('0x0')](_0x2b68('0x1'),_0x2b68('0x2'),_0x2b68('0x3'),'keyValue'),'defaultValue':_0x2b68('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2b68('0x4')]},'keyType':{'type':Sequelize[_0x2b68('0x0')](_0x2b68('0x1'),'variable',_0x2b68('0x3'))},'keyContent':{'type':Sequelize[_0x2b68('0x4')]},'idField':{'type':Sequelize[_0x2b68('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2b68('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2b68('0x4')]}}; \ No newline at end of file +var _0xd755=['customVariable','STRING','variable','BOOLEAN','ENUM','string'];(function(_0x50539d,_0x4825c9){var _0x183a59=function(_0x415646){while(--_0x415646){_0x50539d['push'](_0x50539d['shift']());}};_0x183a59(++_0x4825c9);}(_0xd755,0x1d2));var _0x5d75=function(_0xd2c332,_0x1b5f38){_0xd2c332=_0xd2c332-0x0;var _0x4efc6f=_0xd755[_0xd2c332];return _0x4efc6f;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x5d75('0x0')](_0x5d75('0x1'),'variable',_0x5d75('0x2'),'keyValue'),'defaultValue':_0x5d75('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5d75('0x3')]},'keyType':{'type':Sequelize[_0x5d75('0x0')](_0x5d75('0x1'),_0x5d75('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x5d75('0x3')]},'idField':{'type':Sequelize[_0x5d75('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5d75('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5d75('0x3')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index ff5eb86..528ab07 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 _0x4ff0=['map','type','VIRTUAL','field','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','create','catch','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','index','DeskField','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0xe82743,_0x10ec23){var _0x3877db=function(_0x4f7d4a){while(--_0x4f7d4a){_0xe82743['push'](_0xe82743['shift']());}};_0x3877db(++_0x10ec23);}(_0x4ff0,0xa2));var _0x04ff=function(_0x336ce6,_0x15c2a9){_0x336ce6=_0x336ce6-0x0;var _0x7d0d49=_0x4ff0[_0x336ce6];return _0x7d0d49;};'use strict';var pdf=require(_0x04ff('0x0'));var emlformat=require(_0x04ff('0x1'));var rimraf=require(_0x04ff('0x2'));var zipdir=require(_0x04ff('0x3'));var jsonpatch=require(_0x04ff('0x4'));var rp=require(_0x04ff('0x5'));var moment=require(_0x04ff('0x6'));var BPromise=require(_0x04ff('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x04ff('0x8'));var sox=require(_0x04ff('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x04ff('0xa'));var squel=require(_0x04ff('0xb'));var crypto=require('crypto');var jsforce=require(_0x04ff('0xc'));var deskjs=require(_0x04ff('0xd'));var toCsv=require(_0x04ff('0xe'));var querystring=require(_0x04ff('0xf'));var Papa=require(_0x04ff('0x10'));var Redis=require(_0x04ff('0x11'));var authService=require(_0x04ff('0x12'));var qs=require(_0x04ff('0x13'));var hardwareService=require(_0x04ff('0x14'));var logger=require('../../config/logger')(_0x04ff('0x15'));var utils=require(_0x04ff('0x16'));var config=require(_0x04ff('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf6ba92,_0x34ee5b){_0x34ee5b=_0x34ee5b||0xcc;return function(_0xce748f){if(_0xce748f){return _0xf6ba92[_0x04ff('0x18')](_0x34ee5b);}return _0xf6ba92[_0x04ff('0x19')](_0x34ee5b)[_0x04ff('0x1a')]();};}function respondWithResult(_0x1c45b8,_0x48b0d3){_0x48b0d3=_0x48b0d3||0xc8;return function(_0x10c36d){if(_0x10c36d){return _0x1c45b8['status'](_0x48b0d3)[_0x04ff('0x1b')](_0x10c36d);}};}function respondWithFilteredResult(_0x19f85e,_0x2d0d35){return function(_0x3533c1){if(_0x3533c1){var _0x6c793a=_0x3533c1[_0x04ff('0x1c')],_0x1b37e6=_0x2d0d35[_0x04ff('0x1d')],_0x43ff0c=_0x2d0d35['offset']+_0x2d0d35[_0x04ff('0x1e')],_0x38e5f0;if(_0x43ff0c>=_0x6c793a){_0x43ff0c=_0x6c793a;_0x38e5f0=0xc8;}else{_0x38e5f0=0xce;}_0x19f85e[_0x04ff('0x19')](_0x38e5f0);return _0x19f85e[_0x04ff('0x1f')](_0x04ff('0x20'),_0x1b37e6+'-'+_0x43ff0c+'/'+_0x6c793a)[_0x04ff('0x1b')](_0x3533c1);}return null;};}function patchUpdates(_0xd80cfd){return function(_0x4425fd){try{jsonpatch['apply'](_0x4425fd,_0xd80cfd,!![]);}catch(_0x3e20df){return BPromise[_0x04ff('0x21')](_0x3e20df);}return _0x4425fd[_0x04ff('0x22')]();};}function saveUpdates(_0x4cfb52,_0x4478ec){return function(_0x48ee8b){if(_0x48ee8b){return _0x48ee8b[_0x04ff('0x23')](_0x4cfb52)[_0x04ff('0x24')](function(_0x18a96a){return _0x18a96a;});}return null;};}function removeEntity(_0x3eee04,_0x388380){return function(_0x79ec8c){if(_0x79ec8c){return _0x79ec8c[_0x04ff('0x25')]()[_0x04ff('0x24')](function(){_0x3eee04['status'](0xcc)[_0x04ff('0x1a')]();});}};}function handleEntityNotFound(_0x462b8f,_0x423944){return function(_0x21da00){if(!_0x21da00){_0x462b8f[_0x04ff('0x18')](0x194);}return _0x21da00;};}function handleError(_0x560b93,_0x16aa87){_0x16aa87=_0x16aa87||0x1f4;return function(_0x6a77d2){logger['error'](_0x6a77d2[_0x04ff('0x26')]);if(_0x6a77d2['name']){delete _0x6a77d2[_0x04ff('0x27')];}_0x560b93[_0x04ff('0x19')](_0x16aa87)['send'](_0x6a77d2);};}exports[_0x04ff('0x28')]=function(_0x31b847,_0x30c8b2){var _0x517891={},_0xbe81={},_0x28b86a={'count':0x0,'rows':[]};var _0x245826=db[_0x04ff('0x29')]['rawAttributes'];_0xbe81[_0x04ff('0x2a')]=_[_0x04ff('0x2b')](_0x245826);_0xbe81[_0x04ff('0x2c')]=_[_0x04ff('0x2b')](_0x31b847['query']);_0xbe81[_0x04ff('0x2d')]=_[_0x04ff('0x2e')](_0xbe81[_0x04ff('0x2a')],_0xbe81[_0x04ff('0x2c')]);_0x517891[_0x04ff('0x2f')]=_['intersection'](_0xbe81[_0x04ff('0x2a')],qs['fields'](_0x31b847[_0x04ff('0x2c')][_0x04ff('0x30')]));_0x517891[_0x04ff('0x2f')]=_0x517891['attributes']['length']?_0x517891['attributes']:_0xbe81['model'];if(!_0x31b847[_0x04ff('0x2c')][_0x04ff('0x31')](_0x04ff('0x32'))){_0x517891[_0x04ff('0x1e')]=qs['limit'](_0x31b847[_0x04ff('0x2c')][_0x04ff('0x1e')]);_0x517891['offset']=qs[_0x04ff('0x1d')](_0x31b847['query']['offset']);}_0x517891[_0x04ff('0x33')]=qs[_0x04ff('0x34')](_0x31b847['query'][_0x04ff('0x34')]);_0x517891[_0x04ff('0x35')]=qs[_0x04ff('0x2d')](_[_0x04ff('0x36')](_0x31b847[_0x04ff('0x2c')],_0xbe81[_0x04ff('0x2d')]));if(_0x31b847[_0x04ff('0x2c')][_0x04ff('0x37')]){_0x517891[_0x04ff('0x35')]=_[_0x04ff('0x38')](_0x517891[_0x04ff('0x35')],{'$or':_[_0x04ff('0x39')](_0x245826,function(_0x5b8b31){if(_0x5b8b31[_0x04ff('0x3a')]['key']!==_0x04ff('0x3b')){var _0x57558e={};_0x57558e[_0x5b8b31[_0x04ff('0x3c')]]={'$like':'%'+_0x31b847[_0x04ff('0x2c')][_0x04ff('0x37')]+'%'};return _0x57558e;}})});}_0x517891=_[_0x04ff('0x38')]({},_0x517891,_0x31b847['options']);var _0x29ea4f={'where':_0x517891[_0x04ff('0x35')]};return db[_0x04ff('0x29')][_0x04ff('0x1c')](_0x29ea4f)[_0x04ff('0x24')](function(_0x936c8c){_0x28b86a[_0x04ff('0x1c')]=_0x936c8c;if(_0x31b847[_0x04ff('0x2c')][_0x04ff('0x3d')]){_0x517891[_0x04ff('0x3e')]=[{'all':!![]}];}return db['DeskField'][_0x04ff('0x3f')](_0x517891);})[_0x04ff('0x24')](function(_0x32a04f){_0x28b86a[_0x04ff('0x40')]=_0x32a04f;return _0x28b86a;})[_0x04ff('0x24')](respondWithFilteredResult(_0x30c8b2,_0x517891))['catch'](handleError(_0x30c8b2,null));};exports[_0x04ff('0x41')]=function(_0x47961a,_0x1bf181){var _0x10f648={'raw':!![],'where':{'id':_0x47961a[_0x04ff('0x42')]['id']}},_0x3d4515={};_0x3d4515[_0x04ff('0x2a')]=_[_0x04ff('0x2b')](db[_0x04ff('0x29')][_0x04ff('0x43')]);_0x3d4515[_0x04ff('0x2c')]=_[_0x04ff('0x2b')](_0x47961a['query']);_0x3d4515['filters']=_[_0x04ff('0x2e')](_0x3d4515['model'],_0x3d4515[_0x04ff('0x2c')]);_0x10f648[_0x04ff('0x2f')]=_[_0x04ff('0x2e')](_0x3d4515['model'],qs[_0x04ff('0x30')](_0x47961a[_0x04ff('0x2c')][_0x04ff('0x30')]));_0x10f648[_0x04ff('0x2f')]=_0x10f648[_0x04ff('0x2f')][_0x04ff('0x44')]?_0x10f648['attributes']:_0x3d4515['model'];if(_0x47961a['query'][_0x04ff('0x3d')]){_0x10f648[_0x04ff('0x3e')]=[{'all':!![]}];}_0x10f648=_[_0x04ff('0x38')]({},_0x10f648,_0x47961a['options']);return db['DeskField'][_0x04ff('0x45')](_0x10f648)[_0x04ff('0x24')](handleEntityNotFound(_0x1bf181,null))[_0x04ff('0x24')](respondWithResult(_0x1bf181,null))['catch'](handleError(_0x1bf181,null));};exports[_0x04ff('0x46')]=function(_0x144010,_0x1f982e){return db[_0x04ff('0x29')]['create'](_0x144010['body'],{})[_0x04ff('0x24')](respondWithResult(_0x1f982e,0xc9))[_0x04ff('0x47')](handleError(_0x1f982e,null));};exports[_0x04ff('0x23')]=function(_0x4903a5,_0x3ac159){if(_0x4903a5[_0x04ff('0x48')]['id']){delete _0x4903a5[_0x04ff('0x48')]['id'];}return db[_0x04ff('0x29')]['find']({'where':{'id':_0x4903a5[_0x04ff('0x42')]['id']}})[_0x04ff('0x24')](handleEntityNotFound(_0x3ac159,null))['then'](saveUpdates(_0x4903a5[_0x04ff('0x48')],null))[_0x04ff('0x24')](respondWithResult(_0x3ac159,null))[_0x04ff('0x47')](handleError(_0x3ac159,null));};exports['destroy']=function(_0x38b075,_0x4ce62f){return db[_0x04ff('0x29')][_0x04ff('0x45')]({'where':{'id':_0x38b075[_0x04ff('0x42')]['id']}})[_0x04ff('0x24')](handleEntityNotFound(_0x4ce62f,null))[_0x04ff('0x24')](removeEntity(_0x4ce62f,null))[_0x04ff('0x47')](handleError(_0x4ce62f,null));}; \ No newline at end of file +var _0x80f4=['rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','status','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','DeskField','rawAttributes','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','key','VIRTUAL','field','count','includeAll','include','rows','catch','params','keys','length','find','body','eml-format'];(function(_0x53afe9,_0x2c9f40){var _0x396396=function(_0x1f574d){while(--_0x1f574d){_0x53afe9['push'](_0x53afe9['shift']());}};_0x396396(++_0x2c9f40);}(_0x80f4,0x81));var _0x480f=function(_0xe695fa,_0x387982){_0xe695fa=_0xe695fa-0x0;var _0x48660b=_0x80f4[_0xe695fa];return _0x48660b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x480f('0x0'));var rimraf=require(_0x480f('0x1'));var zipdir=require(_0x480f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x480f('0x3'));var moment=require('moment');var BPromise=require(_0x480f('0x4'));var Mustache=require('mustache');var util=require(_0x480f('0x5'));var path=require(_0x480f('0x6'));var sox=require(_0x480f('0x7'));var csv=require(_0x480f('0x8'));var ejs=require(_0x480f('0x9'));var fs=require('fs');var _=require(_0x480f('0xa'));var squel=require(_0x480f('0xb'));var crypto=require('crypto');var jsforce=require(_0x480f('0xc'));var deskjs=require(_0x480f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x480f('0xe'));var Papa=require('papaparse');var Redis=require(_0x480f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x480f('0x10'));var hardwareService=require(_0x480f('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x480f('0x12'));var config=require(_0x480f('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x521f4a,_0x42409c){_0x42409c=_0x42409c||0xcc;return function(_0xc6776f){if(_0xc6776f){return _0x521f4a['sendStatus'](_0x42409c);}return _0x521f4a[_0x480f('0x14')](_0x42409c)['end']();};}function respondWithResult(_0x31e919,_0x20b6d9){_0x20b6d9=_0x20b6d9||0xc8;return function(_0x4d4a04){if(_0x4d4a04){return _0x31e919['status'](_0x20b6d9)[_0x480f('0x15')](_0x4d4a04);}};}function respondWithFilteredResult(_0x29a3ff,_0x397351){return function(_0x55f228){if(_0x55f228){var _0x148151=_0x55f228['count'],_0x187801=_0x397351[_0x480f('0x16')],_0x170325=_0x397351[_0x480f('0x16')]+_0x397351[_0x480f('0x17')],_0x4d9905;if(_0x170325>=_0x148151){_0x170325=_0x148151;_0x4d9905=0xc8;}else{_0x4d9905=0xce;}_0x29a3ff[_0x480f('0x14')](_0x4d9905);return _0x29a3ff[_0x480f('0x18')](_0x480f('0x19'),_0x187801+'-'+_0x170325+'/'+_0x148151)[_0x480f('0x15')](_0x55f228);}return null;};}function patchUpdates(_0x3caa98){return function(_0x1323da){try{jsonpatch[_0x480f('0x1a')](_0x1323da,_0x3caa98,!![]);}catch(_0x242139){return BPromise['reject'](_0x242139);}return _0x1323da[_0x480f('0x1b')]();};}function saveUpdates(_0x44130a,_0xeff8c8){return function(_0x4f661f){if(_0x4f661f){return _0x4f661f[_0x480f('0x1c')](_0x44130a)[_0x480f('0x1d')](function(_0x57480a){return _0x57480a;});}return null;};}function removeEntity(_0x2ae647,_0x9561df){return function(_0x56360a){if(_0x56360a){return _0x56360a[_0x480f('0x1e')]()[_0x480f('0x1d')](function(){_0x2ae647[_0x480f('0x14')](0xcc)[_0x480f('0x1f')]();});}};}function handleEntityNotFound(_0x190b9f,_0x1d5475){return function(_0x124e5d){if(!_0x124e5d){_0x190b9f[_0x480f('0x20')](0x194);}return _0x124e5d;};}function handleError(_0x4a7b12,_0x227682){_0x227682=_0x227682||0x1f4;return function(_0x2394a2){logger[_0x480f('0x21')](_0x2394a2[_0x480f('0x22')]);if(_0x2394a2['name']){delete _0x2394a2[_0x480f('0x23')];}_0x4a7b12[_0x480f('0x14')](_0x227682)['send'](_0x2394a2);};}exports[_0x480f('0x24')]=function(_0x51fb5e,_0x16626c){var _0x30339d={},_0x3dfecd={},_0x226c1f={'count':0x0,'rows':[]};var _0x3acb6c=db[_0x480f('0x25')][_0x480f('0x26')];_0x3dfecd[_0x480f('0x27')]=_['keys'](_0x3acb6c);_0x3dfecd[_0x480f('0x28')]=_['keys'](_0x51fb5e[_0x480f('0x28')]);_0x3dfecd['filters']=_['intersection'](_0x3dfecd[_0x480f('0x27')],_0x3dfecd[_0x480f('0x28')]);_0x30339d[_0x480f('0x29')]=_[_0x480f('0x2a')](_0x3dfecd[_0x480f('0x27')],qs[_0x480f('0x2b')](_0x51fb5e[_0x480f('0x28')]['fields']));_0x30339d[_0x480f('0x29')]=_0x30339d[_0x480f('0x29')]['length']?_0x30339d[_0x480f('0x29')]:_0x3dfecd[_0x480f('0x27')];if(!_0x51fb5e[_0x480f('0x28')][_0x480f('0x2c')](_0x480f('0x2d'))){_0x30339d['limit']=qs[_0x480f('0x17')](_0x51fb5e[_0x480f('0x28')][_0x480f('0x17')]);_0x30339d['offset']=qs['offset'](_0x51fb5e[_0x480f('0x28')][_0x480f('0x16')]);}_0x30339d['order']=qs['sort'](_0x51fb5e[_0x480f('0x28')][_0x480f('0x2e')]);_0x30339d[_0x480f('0x2f')]=qs[_0x480f('0x30')](_['pick'](_0x51fb5e[_0x480f('0x28')],_0x3dfecd[_0x480f('0x30')]));if(_0x51fb5e[_0x480f('0x28')][_0x480f('0x31')]){_0x30339d[_0x480f('0x2f')]=_[_0x480f('0x32')](_0x30339d[_0x480f('0x2f')],{'$or':_['map'](_0x3acb6c,function(_0x35c926){if(_0x35c926[_0x480f('0x33')][_0x480f('0x34')]!==_0x480f('0x35')){var _0xccc4c4={};_0xccc4c4[_0x35c926[_0x480f('0x36')]]={'$like':'%'+_0x51fb5e[_0x480f('0x28')][_0x480f('0x31')]+'%'};return _0xccc4c4;}})});}_0x30339d=_[_0x480f('0x32')]({},_0x30339d,_0x51fb5e['options']);var _0x142b57={'where':_0x30339d[_0x480f('0x2f')]};return db[_0x480f('0x25')][_0x480f('0x37')](_0x142b57)[_0x480f('0x1d')](function(_0x597cdf){_0x226c1f[_0x480f('0x37')]=_0x597cdf;if(_0x51fb5e['query'][_0x480f('0x38')]){_0x30339d[_0x480f('0x39')]=[{'all':!![]}];}return db[_0x480f('0x25')]['findAll'](_0x30339d);})[_0x480f('0x1d')](function(_0x43c345){_0x226c1f[_0x480f('0x3a')]=_0x43c345;return _0x226c1f;})[_0x480f('0x1d')](respondWithFilteredResult(_0x16626c,_0x30339d))[_0x480f('0x3b')](handleError(_0x16626c,null));};exports['show']=function(_0x5a2426,_0x3c9719){var _0x196d0c={'raw':!![],'where':{'id':_0x5a2426[_0x480f('0x3c')]['id']}},_0xe8ebb9={};_0xe8ebb9[_0x480f('0x27')]=_[_0x480f('0x3d')](db['DeskField'][_0x480f('0x26')]);_0xe8ebb9[_0x480f('0x28')]=_['keys'](_0x5a2426[_0x480f('0x28')]);_0xe8ebb9[_0x480f('0x30')]=_[_0x480f('0x2a')](_0xe8ebb9[_0x480f('0x27')],_0xe8ebb9['query']);_0x196d0c[_0x480f('0x29')]=_[_0x480f('0x2a')](_0xe8ebb9[_0x480f('0x27')],qs['fields'](_0x5a2426[_0x480f('0x28')]['fields']));_0x196d0c[_0x480f('0x29')]=_0x196d0c[_0x480f('0x29')][_0x480f('0x3e')]?_0x196d0c[_0x480f('0x29')]:_0xe8ebb9[_0x480f('0x27')];if(_0x5a2426[_0x480f('0x28')]['includeAll']){_0x196d0c[_0x480f('0x39')]=[{'all':!![]}];}_0x196d0c=_[_0x480f('0x32')]({},_0x196d0c,_0x5a2426['options']);return db[_0x480f('0x25')][_0x480f('0x3f')](_0x196d0c)[_0x480f('0x1d')](handleEntityNotFound(_0x3c9719,null))[_0x480f('0x1d')](respondWithResult(_0x3c9719,null))[_0x480f('0x3b')](handleError(_0x3c9719,null));};exports['create']=function(_0x214d20,_0x36c1db){return db[_0x480f('0x25')]['create'](_0x214d20['body'],{})[_0x480f('0x1d')](respondWithResult(_0x36c1db,0xc9))[_0x480f('0x3b')](handleError(_0x36c1db,null));};exports['update']=function(_0x42dea6,_0xa297f1){if(_0x42dea6[_0x480f('0x40')]['id']){delete _0x42dea6[_0x480f('0x40')]['id'];}return db[_0x480f('0x25')][_0x480f('0x3f')]({'where':{'id':_0x42dea6[_0x480f('0x3c')]['id']}})[_0x480f('0x1d')](handleEntityNotFound(_0xa297f1,null))['then'](saveUpdates(_0x42dea6[_0x480f('0x40')],null))['then'](respondWithResult(_0xa297f1,null))[_0x480f('0x3b')](handleError(_0xa297f1,null));};exports['destroy']=function(_0x4e289f,_0x5c87af){return db[_0x480f('0x25')][_0x480f('0x3f')]({'where':{'id':_0x4e289f[_0x480f('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5c87af,null))[_0x480f('0x1d')](removeEntity(_0x5c87af,null))[_0x480f('0x3b')](handleError(_0x5c87af,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 98510c4..9e38fef 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 _0x1bba=['moment','bluebird','request-promise','path','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','idField','FieldId','../../config/logger','api'];(function(_0x9bc85,_0x12b60b){var _0x4ba2ec=function(_0xc9afbd){while(--_0xc9afbd){_0x9bc85['push'](_0x9bc85['shift']());}};_0x4ba2ec(++_0x12b60b);}(_0x1bba,0x1df));var _0xa1bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bba[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa1bb('0x0'))(_0xa1bb('0x1'));var moment=require(_0xa1bb('0x2'));var BPromise=require(_0xa1bb('0x3'));var rp=require(_0xa1bb('0x4'));var fs=require('fs');var path=require(_0xa1bb('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa1bb('0x6'));module[_0xa1bb('0x7')]=function(_0x14a046,_0x1ac1a6){return _0x14a046[_0xa1bb('0x8')]('DeskField',attributes,{'tableName':_0xa1bb('0x9'),'paranoid':![],'indexes':[{'name':_0xa1bb('0xa'),'fields':[_0xa1bb('0xb'),_0xa1bb('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x54b0=['request-promise','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','FieldId','lodash','../../config/logger','moment'];(function(_0x1e1318,_0x3c97ae){var _0x2e2bab=function(_0x1ad523){while(--_0x1ad523){_0x1e1318['push'](_0x1e1318['shift']());}};_0x2e2bab(++_0x3c97ae);}(_0x54b0,0x1b5));var _0x054b=function(_0x158a58,_0x28e8e7){_0x158a58=_0x158a58-0x0;var _0x4935d9=_0x54b0[_0x158a58];return _0x4935d9;};'use strict';var _=require(_0x054b('0x0'));var util=require('util');var logger=require(_0x054b('0x1'))('api');var moment=require(_0x054b('0x2'));var BPromise=require('bluebird');var rp=require(_0x054b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x054b('0x4'));var config=require(_0x054b('0x5'));var attributes=require(_0x054b('0x6'));module[_0x054b('0x7')]=function(_0x2fa229,_0x34fd0f){return _0x2fa229[_0x054b('0x8')](_0x054b('0x9'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField',_0x054b('0xa')],'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 e8637e8..51d7d3e 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 _0x97fb=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util'];(function(_0x456d2f,_0x1bd8cf){var _0x232955=function(_0x3ff84a){while(--_0x3ff84a){_0x456d2f['push'](_0x456d2f['shift']());}};_0x232955(++_0x1bd8cf);}(_0x97fb,0x67));var _0xb97f=function(_0x32f26d,_0x2c0b5d){_0x32f26d=_0x32f26d-0x0;var _0x5d9ddc=_0x97fb[_0x32f26d];return _0x5d9ddc;};'use strict';var _=require(_0xb97f('0x0'));var util=require(_0xb97f('0x1'));var moment=require(_0xb97f('0x2'));var BPromise=require('bluebird');var rs=require(_0xb97f('0x3'));var fs=require('fs');var Redis=require(_0xb97f('0x4'));var db=require(_0xb97f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb97f('0x6'))(_0xb97f('0x7'));var config=require(_0xb97f('0x8'));var jayson=require(_0xb97f('0x9'));var client=jayson['client'][_0xb97f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x325d3e,_0x52ff13,_0x309ef0){return new BPromise(function(_0x1da525,_0x1ac7b2){return client[_0xb97f('0xb')](_0x325d3e,_0x309ef0)[_0xb97f('0xc')](function(_0xeaa258){logger['info'](_0xb97f('0xd'),_0x52ff13,_0xb97f('0xe'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x52ff13,'request\x20sent',JSON['stringify'](_0xeaa258));if(_0xeaa258['error']){if(_0xeaa258[_0xb97f('0xf')][_0xb97f('0x10')]===0x1f4){logger[_0xb97f('0xf')]('DeskField,\x20%s,\x20%s',_0x52ff13,_0xeaa258[_0xb97f('0xf')][_0xb97f('0x11')]);return _0x1ac7b2(_0xeaa258['error'][_0xb97f('0x11')]);}logger['error'](_0xb97f('0xd'),_0x52ff13,_0xeaa258[_0xb97f('0xf')]['message']);return _0x1da525(_0xeaa258[_0xb97f('0xf')]['message']);}else{logger[_0xb97f('0x12')]('DeskField,\x20%s,\x20%s',_0x52ff13,'request\x20sent');_0x1da525(_0xeaa258[_0xb97f('0x13')][_0xb97f('0x11')]);}})[_0xb97f('0x14')](function(_0x2aaae2){logger[_0xb97f('0xf')](_0xb97f('0xd'),_0x52ff13,_0x2aaae2);_0x1ac7b2(_0x2aaae2);});});} \ No newline at end of file +var _0x21f9=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message'];(function(_0x5e888e,_0x3f47e){var _0x59e1f8=function(_0x114038){while(--_0x114038){_0x5e888e['push'](_0x5e888e['shift']());}};_0x59e1f8(++_0x3f47e);}(_0x21f9,0x115));var _0x921f=function(_0xd4426f,_0x41dc18){_0xd4426f=_0xd4426f-0x0;var _0x4e514f=_0x21f9[_0xd4426f];return _0x4e514f;};'use strict';var _=require(_0x921f('0x0'));var util=require(_0x921f('0x1'));var moment=require('moment');var BPromise=require(_0x921f('0x2'));var rs=require(_0x921f('0x3'));var fs=require('fs');var Redis=require(_0x921f('0x4'));var db=require(_0x921f('0x5'))['db'];var utils=require(_0x921f('0x6'));var logger=require(_0x921f('0x7'))(_0x921f('0x8'));var config=require(_0x921f('0x9'));var jayson=require(_0x921f('0xa'));var client=jayson[_0x921f('0xb')][_0x921f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x43d20f,_0x4d2783,_0x111256){return new BPromise(function(_0x5a996d,_0xe170c9){return client[_0x921f('0xd')](_0x43d20f,_0x111256)['then'](function(_0x2cab20){logger[_0x921f('0xe')](_0x921f('0xf'),_0x4d2783,_0x921f('0x10'));logger[_0x921f('0x11')]('DeskField,\x20%s,\x20%s,\x20%s',_0x4d2783,_0x921f('0x10'),JSON[_0x921f('0x12')](_0x2cab20));if(_0x2cab20['error']){if(_0x2cab20['error'][_0x921f('0x13')]===0x1f4){logger[_0x921f('0x14')](_0x921f('0xf'),_0x4d2783,_0x2cab20[_0x921f('0x14')][_0x921f('0x15')]);return _0xe170c9(_0x2cab20[_0x921f('0x14')][_0x921f('0x15')]);}logger[_0x921f('0x14')](_0x921f('0xf'),_0x4d2783,_0x2cab20['error'][_0x921f('0x15')]);return _0x5a996d(_0x2cab20[_0x921f('0x14')]['message']);}else{logger[_0x921f('0xe')]('DeskField,\x20%s,\x20%s',_0x4d2783,_0x921f('0x10'));_0x5a996d(_0x2cab20['result'][_0x921f('0x15')]);}})[_0x921f('0x16')](function(_0x1fc839){logger[_0x921f('0x14')]('DeskField,\x20%s,\x20%s',_0x4d2783,_0x1fc839);_0xe170c9(_0x1fc839);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index f62c75d..5fed892 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 _0x3767=['/:id/fields','getFields','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x4a96ca,_0x13754e){var _0x2aed48=function(_0x361330){while(--_0x361330){_0x4a96ca['push'](_0x4a96ca['shift']());}};_0x2aed48(++_0x13754e);}(_0x3767,0x1bc));var _0x7376=function(_0x6f48b7,_0x54acad){_0x6f48b7=_0x6f48b7-0x0;var _0x5bb20d=_0x3767[_0x6f48b7];return _0x5bb20d;};'use strict';var multer=require(_0x7376('0x0'));var util=require(_0x7376('0x1'));var path=require(_0x7376('0x2'));var timeout=require(_0x7376('0x3'));var express=require(_0x7376('0x4'));var router=express[_0x7376('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7376('0x6'));var config=require(_0x7376('0x7'));var controller=require(_0x7376('0x8'));router[_0x7376('0x9')]('/',auth[_0x7376('0xa')](),controller[_0x7376('0xb')]);router[_0x7376('0x9')](_0x7376('0xc'),auth[_0x7376('0xa')](),controller[_0x7376('0xd')]);router[_0x7376('0x9')](_0x7376('0xe'),auth[_0x7376('0xa')](),controller[_0x7376('0xf')]);router[_0x7376('0x9')](_0x7376('0x10'),auth['isAuthenticated'](),controller[_0x7376('0x11')]);router[_0x7376('0x12')]('/',auth[_0x7376('0xa')](),controller['create']);router[_0x7376('0x12')](_0x7376('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x7376('0x13')]('/:id',auth[_0x7376('0xa')](),controller[_0x7376('0x14')]);router[_0x7376('0x15')](_0x7376('0xc'),auth[_0x7376('0xa')](),controller[_0x7376('0x16')]);module['exports']=router; \ No newline at end of file +var _0x0367=['connect-timeout','Router','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','put','delete','destroy','exports','util'];(function(_0x2fe7b0,_0x39c02b){var _0x456c3d=function(_0x44041e){while(--_0x44041e){_0x2fe7b0['push'](_0x2fe7b0['shift']());}};_0x456c3d(++_0x39c02b);}(_0x0367,0x153));var _0x7036=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x0367[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x7036('0x0'));var path=require('path');var timeout=require(_0x7036('0x1'));var express=require('express');var router=express[_0x7036('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x7036('0x3'));var config=require(_0x7036('0x4'));var controller=require('./intDynamics365Account.controller');router[_0x7036('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7036('0x6'),auth[_0x7036('0x7')](),controller[_0x7036('0x8')]);router[_0x7036('0x5')](_0x7036('0x9'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x7036('0xa'),auth[_0x7036('0x7')](),controller[_0x7036('0xb')]);router['post']('/',auth[_0x7036('0x7')](),controller['create']);router[_0x7036('0xc')](_0x7036('0x9'),auth[_0x7036('0x7')](),controller['addConfiguration']);router[_0x7036('0xd')](_0x7036('0x6'),auth['isAuthenticated'](),controller['update']);router[_0x7036('0xe')](_0x7036('0x6'),auth[_0x7036('0x7')](),controller[_0x7036('0xf')]);module[_0x7036('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index faab4e5..310db0c 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 _0xecf0=['exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xecf0,0xda));var _0x0ecf=function(_0x44c6ac,_0x1428ee){_0x44c6ac=_0x44c6ac-0x0;var _0x1260aa=_0xecf0[_0x44c6ac];return _0x1260aa;};'use strict';var Sequelize=require('sequelize');module[_0x0ecf('0x0')]={'name':{'type':Sequelize[_0x0ecf('0x1')]},'username':{'type':Sequelize[_0x0ecf('0x1')]},'password':{'type':Sequelize[_0x0ecf('0x1')]},'remoteUri':{'type':Sequelize[_0x0ecf('0x1')]},'tenantId':{'type':Sequelize[_0x0ecf('0x1')]},'clientId':{'type':Sequelize[_0x0ecf('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x0ecf('0x1')]},'description':{'type':Sequelize[_0x0ecf('0x1')]}}; \ No newline at end of file +var _0x2c8b=['sequelize','exports','STRING'];(function(_0x58f20b,_0x5895a7){var _0x338b78=function(_0x2e50d4){while(--_0x2e50d4){_0x58f20b['push'](_0x58f20b['shift']());}};_0x338b78(++_0x5895a7);}(_0x2c8b,0xd2));var _0xb2c8=function(_0x170f36,_0x159ffc){_0x170f36=_0x170f36-0x0;var _0x4f35a7=_0x2c8b[_0x170f36];return _0x4f35a7;};'use strict';var Sequelize=require(_0xb2c8('0x0'));module[_0xb2c8('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb2c8('0x2')]},'password':{'type':Sequelize[_0xb2c8('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xb2c8('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb2c8('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index f067add..cbd9a53 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 _0x9fa5=['ticketType','incident','description','customerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','findOne','password','remoteUri','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','username','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','Dynamics365\x20error:\x20','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','rimraf','zip-dir','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','test','then','info','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Dynamics365Account,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','Dynamics365Account','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','options','includeAll','include','rows','show','params','merge','find','create','body','Dynamics365Configuration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Descriptions','getDescriptions','channel','Subjects','Dynamics365Field','getFields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9fa5,0x157));var _0x59fa=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x9fa5[_0x34bf97];return _0x292719;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x59fa('0x0'));var zipdir=require(_0x59fa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x59fa('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x59fa('0x3'));var util=require(_0x59fa('0x4'));var path=require(_0x59fa('0x5'));var sox=require('sox');var csv=require(_0x59fa('0x6'));var ejs=require(_0x59fa('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x59fa('0x8'));var crypto=require(_0x59fa('0x9'));var jsforce=require(_0x59fa('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x59fa('0x6'));var querystring=require(_0x59fa('0xb'));var Papa=require(_0x59fa('0xc'));var Redis=require(_0x59fa('0xd'));var authService=require(_0x59fa('0xe'));var qs=require(_0x59fa('0xf'));var hardwareService=require(_0x59fa('0x10'));var logger=require('../../config/logger')(_0x59fa('0x11'));var utils=require(_0x59fa('0x12'));var config=require(_0x59fa('0x13'));var db=require(_0x59fa('0x14'))['db'];var integrations=require(_0x59fa('0x15'));var jayson=require('jayson/promise');var client=jayson[_0x59fa('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x58e2b1,_0x1be5dd,_0x46fd2a){if(_0x46fd2a){var _0xf13a45=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xf13a45[_0x59fa('0x17')](_0x1be5dd)){return _0x58e2b1;}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 _0x58e2b1;}}function respondWithRpcPromise(_0x1ba0a1,_0x5e7716,_0x270eda,_0x423d4f){return new BPromise(function(_0x2e002f,_0x2f254a){var _0x5421e6=_0x423d4f||client;return _0x5421e6['request'](_0x1ba0a1,_0x270eda)[_0x59fa('0x18')](function(_0x5ce808){logger[_0x59fa('0x19')]('Dynamics365Account,\x20%s,\x20%s',_0x5e7716,'request\x20sent');logger['debug'](_0x59fa('0x1a'),_0x5e7716,_0x59fa('0x1b'),JSON[_0x59fa('0x1c')](_0x5ce808));if(_0x5ce808['error']){if(_0x5ce808[_0x59fa('0x1d')]['code']===0x1f4){logger[_0x59fa('0x1d')](_0x59fa('0x1e'),_0x5e7716,_0x5ce808[_0x59fa('0x1d')][_0x59fa('0x1f')]);return _0x2f254a(_0x5ce808[_0x59fa('0x1d')][_0x59fa('0x1f')]);}logger[_0x59fa('0x1d')](_0x59fa('0x1e'),_0x5e7716,_0x5ce808[_0x59fa('0x1d')]['message']);return _0x2e002f(_0x5ce808[_0x59fa('0x1d')][_0x59fa('0x1f')]);}else{logger[_0x59fa('0x19')]('Dynamics365Account,\x20%s,\x20%s',_0x5e7716,_0x59fa('0x1b'));_0x2e002f(_0x5ce808['result'][_0x59fa('0x1f')]);}})[_0x59fa('0x20')](function(_0x5f50ac){logger[_0x59fa('0x1d')]('Dynamics365Account,\x20%s,\x20%s',_0x5e7716,_0x5f50ac);_0x2f254a(_0x5f50ac);});});}function respondWithStatusCode(_0x2c4445,_0x5cfee6){_0x5cfee6=_0x5cfee6||0xcc;return function(_0x241589){if(_0x241589){return _0x2c4445[_0x59fa('0x21')](_0x5cfee6);}return _0x2c4445[_0x59fa('0x22')](_0x5cfee6)[_0x59fa('0x23')]();};}function respondWithResult(_0x2eb623,_0x144af4){_0x144af4=_0x144af4||0xc8;return function(_0x2dc51f){if(_0x2dc51f){return _0x2eb623[_0x59fa('0x22')](_0x144af4)[_0x59fa('0x24')](_0x2dc51f);}};}function respondWithFilteredResult(_0xd8a42,_0x181ad7){return function(_0x3e79ab){if(_0x3e79ab){var _0x73d2d0=_0x3e79ab[_0x59fa('0x25')],_0x2fb9c2=_0x181ad7[_0x59fa('0x26')],_0xc48dbc=_0x181ad7[_0x59fa('0x26')]+_0x181ad7[_0x59fa('0x27')],_0x3e219b;if(_0xc48dbc>=_0x73d2d0){_0xc48dbc=_0x73d2d0;_0x3e219b=0xc8;}else{_0x3e219b=0xce;}_0xd8a42['status'](_0x3e219b);return _0xd8a42[_0x59fa('0x28')](_0x59fa('0x29'),_0x2fb9c2+'-'+_0xc48dbc+'/'+_0x73d2d0)[_0x59fa('0x24')](_0x3e79ab);}return null;};}function patchUpdates(_0x3214af){return function(_0xb7f9c1){try{jsonpatch[_0x59fa('0x2a')](_0xb7f9c1,_0x3214af,!![]);}catch(_0x4afc66){return BPromise[_0x59fa('0x2b')](_0x4afc66);}return _0xb7f9c1[_0x59fa('0x2c')]();};}function saveUpdates(_0x42cef6,_0x59565){return function(_0x1cce69){if(_0x1cce69){return _0x1cce69[_0x59fa('0x2d')](_0x42cef6)['then'](function(_0x37b8dc){return _0x37b8dc;});}return null;};}function removeEntity(_0x5408b6,_0x3d423b){return function(_0xa733a){if(_0xa733a){return _0xa733a[_0x59fa('0x2e')]()[_0x59fa('0x18')](function(){_0x5408b6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x315aa4,_0x5a6236){return function(_0x7f2d87){if(!_0x7f2d87){_0x315aa4[_0x59fa('0x21')](0x194);}return _0x7f2d87;};}function handleError(_0xb1d59a,_0x27403d){_0x27403d=_0x27403d||0x1f4;return function(_0xd2b2c0){logger[_0x59fa('0x1d')](_0xd2b2c0[_0x59fa('0x2f')]);if(_0xd2b2c0[_0x59fa('0x30')]){delete _0xd2b2c0[_0x59fa('0x30')];}_0xb1d59a[_0x59fa('0x22')](_0x27403d)[_0x59fa('0x31')](_0xd2b2c0);};}exports['index']=function(_0x4b1fff,_0x493f4c){var _0x3c9dd8={},_0x5322cf={},_0x4b6e80={'count':0x0,'rows':[]};var _0x103d1d=db[_0x59fa('0x32')][_0x59fa('0x33')];_0x5322cf['model']=_[_0x59fa('0x34')](_0x103d1d);_0x5322cf[_0x59fa('0x35')]=_[_0x59fa('0x34')](_0x4b1fff[_0x59fa('0x35')]);_0x5322cf[_0x59fa('0x36')]=_['intersection'](_0x5322cf[_0x59fa('0x37')],_0x5322cf[_0x59fa('0x35')]);_0x3c9dd8[_0x59fa('0x38')]=_[_0x59fa('0x39')](_0x5322cf[_0x59fa('0x37')],qs[_0x59fa('0x3a')](_0x4b1fff['query'][_0x59fa('0x3a')]));_0x3c9dd8[_0x59fa('0x38')]=_0x3c9dd8[_0x59fa('0x38')][_0x59fa('0x3b')]?_0x3c9dd8['attributes']:_0x5322cf[_0x59fa('0x37')];if(!_0x4b1fff['query']['hasOwnProperty'](_0x59fa('0x3c'))){_0x3c9dd8[_0x59fa('0x27')]=qs[_0x59fa('0x27')](_0x4b1fff[_0x59fa('0x35')][_0x59fa('0x27')]);_0x3c9dd8[_0x59fa('0x26')]=qs['offset'](_0x4b1fff[_0x59fa('0x35')][_0x59fa('0x26')]);}_0x3c9dd8[_0x59fa('0x3d')]=qs[_0x59fa('0x3e')](_0x4b1fff[_0x59fa('0x35')][_0x59fa('0x3e')]);_0x3c9dd8[_0x59fa('0x3f')]=qs[_0x59fa('0x36')](_[_0x59fa('0x40')](_0x4b1fff['query'],_0x5322cf[_0x59fa('0x36')]));if(_0x4b1fff['query'][_0x59fa('0x41')]){_0x3c9dd8['where']=_['merge'](_0x3c9dd8[_0x59fa('0x3f')],{'$or':_[_0x59fa('0x42')](_0x103d1d,function(_0x2d147d){if(_0x2d147d[_0x59fa('0x43')][_0x59fa('0x44')]!==_0x59fa('0x45')){var _0x26c3e7={};_0x26c3e7[_0x2d147d['field']]={'$like':'%'+_0x4b1fff[_0x59fa('0x35')]['filter']+'%'};return _0x26c3e7;}})});}_0x3c9dd8=_['merge']({},_0x3c9dd8,_0x4b1fff[_0x59fa('0x46')]);var _0x57775b={'where':_0x3c9dd8['where']};return db[_0x59fa('0x32')]['count'](_0x57775b)[_0x59fa('0x18')](function(_0xe7c84b){_0x4b6e80[_0x59fa('0x25')]=_0xe7c84b;if(_0x4b1fff[_0x59fa('0x35')][_0x59fa('0x47')]){_0x3c9dd8[_0x59fa('0x48')]=[{'all':!![]}];}return db[_0x59fa('0x32')]['findAll'](_0x3c9dd8);})[_0x59fa('0x18')](function(_0x1f5677){_0x4b6e80[_0x59fa('0x49')]=_0x1f5677;return _0x4b6e80;})[_0x59fa('0x18')](respondWithFilteredResult(_0x493f4c,_0x3c9dd8))[_0x59fa('0x20')](handleError(_0x493f4c,null));};exports[_0x59fa('0x4a')]=function(_0x4c302b,_0x1ce7b9){var _0x12fab8={'raw':![],'where':{'id':_0x4c302b[_0x59fa('0x4b')]['id']}},_0x474aef={};_0x474aef[_0x59fa('0x37')]=_[_0x59fa('0x34')](db[_0x59fa('0x32')][_0x59fa('0x33')]);_0x474aef[_0x59fa('0x35')]=_[_0x59fa('0x34')](_0x4c302b[_0x59fa('0x35')]);_0x474aef[_0x59fa('0x36')]=_[_0x59fa('0x39')](_0x474aef[_0x59fa('0x37')],_0x474aef[_0x59fa('0x35')]);_0x12fab8['attributes']=_['intersection'](_0x474aef['model'],qs[_0x59fa('0x3a')](_0x4c302b['query'][_0x59fa('0x3a')]));_0x12fab8[_0x59fa('0x38')]=_0x12fab8[_0x59fa('0x38')][_0x59fa('0x3b')]?_0x12fab8[_0x59fa('0x38')]:_0x474aef[_0x59fa('0x37')];if(_0x4c302b[_0x59fa('0x35')][_0x59fa('0x47')]){_0x12fab8[_0x59fa('0x48')]=[{'all':!![]}];}_0x12fab8=_[_0x59fa('0x4c')]({},_0x12fab8,_0x4c302b[_0x59fa('0x46')]);return db[_0x59fa('0x32')][_0x59fa('0x4d')](_0x12fab8)['then'](handleEntityNotFound(_0x1ce7b9,null))[_0x59fa('0x18')](respondWithResult(_0x1ce7b9,null))[_0x59fa('0x20')](handleError(_0x1ce7b9,null));};exports[_0x59fa('0x4e')]=function(_0x1d1965,_0xc0c982){return db['Dynamics365Account']['create'](_0x1d1965['body'],{})['then'](respondWithResult(_0xc0c982,0xc9))['catch'](handleError(_0xc0c982,null));};exports[_0x59fa('0x2d')]=function(_0x4ba436,_0x488db5){if(_0x4ba436[_0x59fa('0x4f')]['id']){delete _0x4ba436['body']['id'];}return db[_0x59fa('0x32')][_0x59fa('0x4d')]({'where':{'id':_0x4ba436['params']['id']}})[_0x59fa('0x18')](handleEntityNotFound(_0x488db5,null))[_0x59fa('0x18')](saveUpdates(_0x4ba436['body'],null))[_0x59fa('0x18')](respondWithResult(_0x488db5,null))[_0x59fa('0x20')](handleError(_0x488db5,null));};exports[_0x59fa('0x2e')]=function(_0x202f86,_0x823d7a){return db[_0x59fa('0x32')][_0x59fa('0x4d')]({'where':{'id':_0x202f86[_0x59fa('0x4b')]['id']}})[_0x59fa('0x18')](handleEntityNotFound(_0x823d7a,null))[_0x59fa('0x18')](removeEntity(_0x823d7a,null))[_0x59fa('0x20')](handleError(_0x823d7a,null));};exports['getConfigurations']=function(_0x46c07b,_0x4ce67f,_0xbf9d57){var _0x18113e={};var _0xcc340c={};var _0x22ad77;var _0x5d81a1;return db[_0x59fa('0x32')]['findOne']({'where':{'id':_0x46c07b[_0x59fa('0x4b')]['id']}})[_0x59fa('0x18')](handleEntityNotFound(_0x4ce67f,null))['then'](function(_0x48955d){if(_0x48955d){_0x22ad77=_0x48955d;_0xcc340c['model']=_[_0x59fa('0x34')](db[_0x59fa('0x50')]['rawAttributes']);_0xcc340c[_0x59fa('0x35')]=_[_0x59fa('0x34')](_0x46c07b['query']);_0xcc340c['filters']=_[_0x59fa('0x39')](_0xcc340c[_0x59fa('0x37')],_0xcc340c[_0x59fa('0x35')]);_0x18113e[_0x59fa('0x38')]=_[_0x59fa('0x39')](_0xcc340c['model'],qs[_0x59fa('0x3a')](_0x46c07b['query'][_0x59fa('0x3a')]));_0x18113e['attributes']=_0x18113e[_0x59fa('0x38')][_0x59fa('0x3b')]?_0x18113e['attributes']:_0xcc340c[_0x59fa('0x37')];_0x18113e[_0x59fa('0x3d')]=qs[_0x59fa('0x3e')](_0x46c07b[_0x59fa('0x35')][_0x59fa('0x3e')]);_0x18113e[_0x59fa('0x3f')]=qs[_0x59fa('0x36')](_[_0x59fa('0x40')](_0x46c07b['query'],_0xcc340c['filters']));if(_0x46c07b[_0x59fa('0x35')]['filter']){_0x18113e['where']=_[_0x59fa('0x4c')](_0x18113e['where'],{'$or':_[_0x59fa('0x42')](_0x18113e['attributes'],function(_0xd2f01d){var _0x3c9423={};_0x3c9423[_0xd2f01d]={'$like':'%'+_0x46c07b[_0x59fa('0x35')]['filter']+'%'};return _0x3c9423;})});}_0x18113e=_[_0x59fa('0x4c')]({},_0x18113e,_0x46c07b[_0x59fa('0x46')]);return _0x22ad77[_0x59fa('0x51')](_0x18113e);}})[_0x59fa('0x18')](function(_0x5f1ce9){if(_0x5f1ce9){_0x5d81a1=_0x5f1ce9[_0x59fa('0x3b')];if(!_0x46c07b['query'][_0x59fa('0x52')](_0x59fa('0x3c'))){_0x18113e['limit']=qs['limit'](_0x46c07b[_0x59fa('0x35')][_0x59fa('0x27')]);_0x18113e[_0x59fa('0x26')]=qs['offset'](_0x46c07b[_0x59fa('0x35')][_0x59fa('0x26')]);}return _0x22ad77[_0x59fa('0x51')](_0x18113e);}})[_0x59fa('0x18')](function(_0x36ade5){if(_0x36ade5){return _0x36ade5?{'count':_0x5d81a1,'rows':_0x36ade5}:null;}})[_0x59fa('0x18')](respondWithResult(_0x4ce67f,null))[_0x59fa('0x20')](handleError(_0x4ce67f,null));};exports[_0x59fa('0x53')]=function(_0x1f4e50,_0x535f51,_0x3ff0ee){if(_0x1f4e50[_0x59fa('0x4f')]['id']){delete _0x1f4e50['body']['id'];}return db[_0x59fa('0x32')]['findOne']({'where':{'id':_0x1f4e50[_0x59fa('0x4b')]['id']}})[_0x59fa('0x18')](handleEntityNotFound(_0x535f51,null))[_0x59fa('0x18')](function(_0x3976fd){if(_0x3976fd){_0x1f4e50[_0x59fa('0x4f')][_0x59fa('0x54')]=_0x3976fd['id'];_0x1f4e50[_0x59fa('0x4f')]['Subjects']=integrations['getSubjects'](_0x1f4e50[_0x59fa('0x4f')]['channel'],_0x1f4e50[_0x59fa('0x4f')][_0x59fa('0x43')]);_0x1f4e50['body'][_0x59fa('0x55')]=integrations[_0x59fa('0x56')](_0x1f4e50[_0x59fa('0x4f')][_0x59fa('0x57')],_0x1f4e50['body'][_0x59fa('0x43')]);return db[_0x59fa('0x50')]['create'](_0x1f4e50[_0x59fa('0x4f')],{'include':[{'model':db['Dynamics365Field'],'as':_0x59fa('0x58')},{'model':db[_0x59fa('0x59')],'as':_0x59fa('0x55')}]});}return null;})['then'](respondWithResult(_0x535f51,null))[_0x59fa('0x20')](handleError(_0x535f51,null));};exports[_0x59fa('0x5a')]=function(_0x5e7d5a,_0x576df6,_0x3e63d5){var _0x34d88f=_0x5e7d5a[_0x59fa('0x35')][_0x59fa('0x5b')];var _0x549cd0=_0x34d88f===_0x59fa('0x5c')?'Incident':'PhoneCall';var _0x5dc2bc='';var _0x2b0b3b='';var _0x5a79cd='';var _0x10efa7='';var _0x2e9ccd='';var _0x370ce4='';var _0x18e816='';var _0x498bc0='';var _0x5474ce=['title',_0x59fa('0x5d'),_0x59fa('0x5e'),'ownerid','caseorigincode',_0x59fa('0x5f'),_0x59fa('0x60'),_0x59fa('0x61'),_0x59fa('0x62'),_0x59fa('0x63')];var _0xd0a9f4=[_0x59fa('0x64'),_0x59fa('0x65'),_0x59fa('0x66'),_0x59fa('0x67'),_0x59fa('0x68'),_0x59fa('0x69'),_0x59fa('0x6a'),_0x59fa('0x6b'),_0x59fa('0x6c'),_0x59fa('0x6d'),_0x59fa('0x6e'),'createdbyyominame',_0x59fa('0x6f'),_0x59fa('0x70'),_0x59fa('0x71'),_0x59fa('0x72'),_0x59fa('0x73'),_0x59fa('0x74'),_0x59fa('0x75'),_0x59fa('0x76'),_0x59fa('0x77'),_0x59fa('0x78'),'escalatedon',_0x59fa('0x79'),_0x59fa('0x7a'),'followupby','importsequencenumber',_0x59fa('0x7b'),_0x59fa('0x7c'),_0x59fa('0x7d'),_0x59fa('0x7e'),_0x59fa('0x7f'),_0x59fa('0x80'),_0x59fa('0x81'),_0x59fa('0x82'),_0x59fa('0x83'),_0x59fa('0x84'),_0x59fa('0x85'),'msdyn_incidenttypename',_0x59fa('0x86'),'numberofchildincidents',_0x59fa('0x87'),_0x59fa('0x88'),_0x59fa('0x89'),'owneridtype',_0x59fa('0x8a'),_0x59fa('0x8b'),_0x59fa('0x8c'),_0x59fa('0x8d'),_0x59fa('0x8e'),_0x59fa('0x8f'),'productserialnumber',_0x59fa('0x90'),'resolvebykpiidname','responseby','responsiblecontactidname',_0x59fa('0x91'),_0x59fa('0x92'),_0x59fa('0x93'),_0x59fa('0x94'),_0x59fa('0x95'),_0x59fa('0x96'),_0x59fa('0x97'),_0x59fa('0x98'),_0x59fa('0x99'),_0x59fa('0x9a'),_0x59fa('0x9b'),_0x59fa('0x9c'),_0x59fa('0x9d'),_0x59fa('0x9e')];var _0x56bb0e=_0x5474ce[_0x59fa('0x9f')](_0xd0a9f4);return db[_0x59fa('0x32')][_0x59fa('0xa0')]({'where':{'id':_0x5e7d5a[_0x59fa('0x4b')]['id']},'attributes':['id','username',_0x59fa('0xa1'),_0x59fa('0xa2'),'tenantId',_0x59fa('0xa3'),_0x59fa('0xa4')]})[_0x59fa('0x18')](handleEntityNotFound(_0x576df6,null))[_0x59fa('0x18')](function(_0x48c58e){if(_0x48c58e){_0x498bc0=_0x48c58e[_0x59fa('0xa2')];var _0x38c34d=_0x498bc0[_0x59fa('0xa5')](-0x1);if(_0x38c34d==='/'){_0x498bc0=_0x498bc0[_0x59fa('0xa6')](0x0,_0x498bc0[_0x59fa('0xa7')](_0x38c34d));}_0x18e816=util[_0x59fa('0xa8')](_0x59fa('0xa9'),_0x498bc0);var _0xab04b5={'method':_0x59fa('0xaa'),'uri':_0x59fa('0xab')+_0x48c58e[_0x59fa('0xac')]+_0x59fa('0xad'),'form':{'client_id':_0x48c58e[_0x59fa('0xa3')],'resource':_0x498bc0,'username':_0x48c58e[_0x59fa('0xae')],'password':_0x48c58e[_0x59fa('0xa1')],'grant_type':_0x59fa('0xa1'),'client_secret':_0x48c58e[_0x59fa('0xa4')]},'json':!![]};return rp(_0xab04b5);}})[_0x59fa('0x18')](function(_0x171f98){_0x370ce4=_0x171f98[_0x59fa('0xaf')];var _0xe2431b={'method':_0x59fa('0xb0'),'uri':encodeURI(_0x18e816+_0x59fa('0xb1')+_0x549cd0+'\x27'),'headers':{'Authorization':_0x59fa('0xb2')+_0x370ce4,'If-None-Match':null,'OData-Version':_0x59fa('0xb3')},'json':!![]};return rp(_0xe2431b);})[_0x59fa('0x18')](function(_0x30e0b2){var _0x53a4fc=_0x30e0b2[_0x59fa('0xb4')][0x0];var _0x3de4c4=_0x53a4fc[_0x59fa('0xb5')];var _0x28b179={'method':_0x59fa('0xb0'),'uri':_0x18e816+'EntityDefinitions('+_0x3de4c4+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x59fa('0xb2')+_0x370ce4,'If-None-Match':null,'OData-Version':_0x59fa('0xb3')},'json':!![]};return rp(_0x28b179);})['then'](function(_0x4f7242){_0x5dc2bc=_0x4f7242;_0x2b0b3b=_0x5dc2bc[_0x59fa('0xb6')];_0x2b0b3b=_[_0x59fa('0xb7')](_0x2b0b3b,function(_0x263e55){return!_0x56bb0e[_0x59fa('0xb8')](_0x263e55[_0x59fa('0xb9')]);});var _0x2de492=[];var _0x200e05=[];_0x2b0b3b[_0x59fa('0xba')](function(_0xcbdcff){if(_0xcbdcff[_0x59fa('0xbb')]){var _0x9a6c77=_0xcbdcff[_0x59fa('0xbb')]['substring'](_0xcbdcff[_0x59fa('0xbb')]['lastIndexOf']('.')+0x1);if(_0x9a6c77===_0x59fa('0xbc')){_0x2de492[_0x59fa('0xbd')](getSelectList(_0x18e816,_0x34d88f,_0x200e05,_0x5dc2bc['MetadataId'],_0xcbdcff[_0x59fa('0xb5')],_0x370ce4));}}});return Promise[_0x59fa('0xbe')](_0x2de492);})['then'](function(_0x1446c5){_0x5a79cd=_0x1446c5[0x0];var _0x564831=[];var _0xaf4d2a=[];_0x2b0b3b[_0x59fa('0xba')](function(_0x21f617){if(!_[_0x59fa('0xbf')](_0x21f617[_0x59fa('0xbb')])){var _0xb0dd3b=_0x21f617[_0x59fa('0xbb')][_0x59fa('0xa6')](_0x21f617[_0x59fa('0xbb')][_0x59fa('0xa7')]('.')+0x1);if(_0xb0dd3b==='BooleanAttributeMetadata'){_0x564831[_0x59fa('0xbd')](getBooleanList(_0x18e816,_0x34d88f,_0xaf4d2a,_0x5dc2bc[_0x59fa('0xb5')],_0x21f617['MetadataId'],_0x370ce4));}}});return Promise[_0x59fa('0xbe')](_0x564831);})[_0x59fa('0x18')](function(_0xa3b74d){_0x10efa7=_0xa3b74d[0x0];var _0x304788=[];var _0x176ff2=[];_0x2b0b3b['forEach'](function(_0x3a0b4f){if(_0x3a0b4f[_0x59fa('0xbb')]){var _0x4f81b1=_0x3a0b4f[_0x59fa('0xbb')][_0x59fa('0xa6')](_0x3a0b4f['@odata.type'][_0x59fa('0xa7')]('.')+0x1);if(_0x4f81b1===_0x59fa('0xc0')||_0x4f81b1===_0x59fa('0xc1')||_0x4f81b1===_0x59fa('0xc2')||_0x4f81b1===_0x59fa('0xc3')||_0x4f81b1===_0x59fa('0xc4')||_0x4f81b1===_0x59fa('0xc5')||_0x4f81b1==='StatusAttributeMetadata'||_0x4f81b1===_0x59fa('0xc6')||_0x4f81b1==='StateAttributeMetadata'||_0x4f81b1==='DecimalAttributeMetadata'){_0x304788[_0x59fa('0xbd')](getInputList(_0x18e816,_0x34d88f,_0x4f81b1,_0x176ff2,_0x5dc2bc[_0x59fa('0xb5')],_0x3a0b4f['MetadataId'],_0x370ce4));}}});return Promise['all'](_0x304788);})[_0x59fa('0x18')](function(_0x1c15d7){_0x2e9ccd=_0x1c15d7[0x0];var _0x5aedff=_0x5a79cd[_0x59fa('0x9f')](_0x10efa7)[_0x59fa('0x9f')](_0x2e9ccd);var _0x5394c3={'count':_0x5aedff['length'],'rows':_0x5aedff};return _0x5394c3;})[_0x59fa('0x18')](respondWithResult(_0x576df6,null))[_0x59fa('0x20')](function(_0x8698b5){console['log'](_0x59fa('0xc7')+_0x8698b5);var _0x53686f=_0x5e7d5a[_0x59fa('0x35')][_0x59fa('0x17')]?0x1f4:_0x8698b5[_0x59fa('0xc8')]||0x1f4;logger[_0x59fa('0x1d')](_0x8698b5[_0x59fa('0x2f')]);delete _0x8698b5[_0x59fa('0x30')];if(_0x53686f===0x191){_0x53686f=0x190;}_0x576df6['status'](_0x53686f)['send'](_0x5e7d5a[_0x59fa('0x35')][_0x59fa('0x17')]?{'message':_0x59fa('0xc9'),'statusCode':_0x8698b5['statusCode']}:_0x8698b5);});};function getSelectList(_0x5293ec,_0x4352c0,_0x1a54d6,_0x5f1fc4,_0x165f47,_0x16a1fe){var _0x5a33d6={'method':_0x59fa('0xb0'),'uri':_0x5293ec+_0x59fa('0xca')+_0x5f1fc4+_0x59fa('0xcb')+_0x165f47+_0x59fa('0xcc')+_0x59fa('0xcd'),'headers':{'Authorization':_0x59fa('0xb2')+_0x16a1fe,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5a33d6)['then'](function(_0x10a71d){var _0x26df77=[];var _0x4ad25d=_0x10a71d[_0x59fa('0xce')][_0x59fa('0xcf')];_0x4ad25d[_0x59fa('0xba')](function(_0x535efc){_0x26df77[_0x59fa('0xbd')]({'name':_0x535efc['Label'][_0x59fa('0xd0')][_0x59fa('0xd1')],'value':String(_0x535efc['Value'])});});var _0x2dad1d={'id':_0x4352c0+'_'+_0x10a71d[_0x59fa('0xb9')],'name':_0x10a71d[_0x59fa('0xd2')]['UserLocalizedLabel'][_0x59fa('0xd1')],'custom':![],'options':_0x26df77};_0x1a54d6['push'](_0x2dad1d);return _0x1a54d6;});}function getBooleanList(_0x4e5e6e,_0x51028c,_0x46ce5e,_0x422aa4,_0x4f5d52,_0x5da7f1){var _0x29ac08={'method':_0x59fa('0xb0'),'uri':_0x4e5e6e+_0x59fa('0xca')+_0x422aa4+_0x59fa('0xcb')+_0x4f5d52+_0x59fa('0xd3'),'headers':{'Authorization':'Bearer\x20'+_0x5da7f1,'If-None-Match':null,'OData-Version':_0x59fa('0xb3')},'json':!![]};return rp(_0x29ac08)[_0x59fa('0x18')](function(_0x14be68){var _0xe95d15=[];_0xe95d15[_0x59fa('0xbd')]({'name':_0x14be68[_0x59fa('0xce')][_0x59fa('0xd4')][_0x59fa('0xd1')][_0x59fa('0xd0')]['Label'],'value':'true'},{'name':_0x14be68[_0x59fa('0xce')][_0x59fa('0xd5')]['Label'][_0x59fa('0xd0')][_0x59fa('0xd1')],'value':_0x59fa('0xd6')});var _0x5960b9={'id':_0x51028c+'_'+_0x14be68[_0x59fa('0xb9')],'name':_0x14be68[_0x59fa('0xd2')][_0x59fa('0xd0')][_0x59fa('0xd1')],'custom':![],'options':_0xe95d15};_0x46ce5e[_0x59fa('0xbd')](_0x5960b9);return _0x46ce5e;});}function getInputList(_0x598b21,_0x201e51,_0x14ed65,_0x1ef2f4,_0x513de4,_0xad742,_0x3526f0){var _0x3b61b6={'method':'GET','uri':_0x598b21+_0x59fa('0xca')+_0x513de4+')/Attributes('+_0xad742+_0x59fa('0xd7')+_0x14ed65+_0x59fa('0xd8'),'headers':{'Authorization':_0x59fa('0xb2')+_0x3526f0,'If-None-Match':null,'OData-Version':_0x59fa('0xb3')},'json':!![]};return rp(_0x3b61b6)[_0x59fa('0x18')](function(_0x188a85){var _0x5ade51={'id':_0x201e51+'_'+_0x188a85[_0x59fa('0xb9')],'name':_0x188a85[_0x59fa('0xd2')][_0x59fa('0xd0')]?_0x188a85[_0x59fa('0xd2')][_0x59fa('0xd0')][_0x59fa('0xd1')]:_0x188a85[_0x59fa('0xb9')],'custom':![],'options':[]};_0x1ef2f4['push'](_0x5ade51);return _0x1ef2f4;});} \ No newline at end of file +var _0x0925=['show','params','rawAttributes','includeAll','merge','find','create','body','getConfigurations','findOne','Dynamics365Configuration','pick','addConfiguration','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','exchangerate','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','resolveby','resolvebykpiidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','tenantId','clientId','clientSecret','lastIndexOf','POST','https://login.microsoftonline.com/','/oauth2/token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','forEach','push','all','substring','@odata.type','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','log','Dynamics365\x20error:\x20','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','LogicalName','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../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','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','end','count','offset','limit','set','json','reject','update','destroy','sendStatus','stack','name','index','Dynamics365Account','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','map','type','key','VIRTUAL','field','filter','options','include','rows'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x0925,0x163));var _0x5092=function(_0x1c98eb,_0x2e91cd){_0x1c98eb=_0x1c98eb-0x0;var _0x4da7d6=_0x0925[_0x1c98eb];return _0x4da7d6;};'use strict';var pdf=require(_0x5092('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5092('0x1'));var rp=require(_0x5092('0x2'));var moment=require('moment');var BPromise=require(_0x5092('0x3'));var Mustache=require(_0x5092('0x4'));var util=require(_0x5092('0x5'));var path=require(_0x5092('0x6'));var sox=require(_0x5092('0x7'));var csv=require(_0x5092('0x8'));var ejs=require(_0x5092('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5092('0xa'));var jsforce=require(_0x5092('0xb'));var deskjs=require(_0x5092('0xc'));var toCsv=require(_0x5092('0x8'));var querystring=require(_0x5092('0xd'));var Papa=require(_0x5092('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5092('0xf'));var hardwareService=require(_0x5092('0x10'));var logger=require(_0x5092('0x11'))(_0x5092('0x12'));var utils=require(_0x5092('0x13'));var config=require(_0x5092('0x14'));var db=require(_0x5092('0x15'))['db'];var integrations=require(_0x5092('0x16'));var jayson=require(_0x5092('0x17'));var client=jayson[_0x5092('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x54c217,_0x4c9f77,_0x2150a7){if(_0x2150a7){var _0xf2055e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xf2055e[_0x5092('0x19')](_0x4c9f77)){return _0x54c217;}else{throw new Error(_0x5092('0x1a'));}}else{return _0x54c217;}}function respondWithRpcPromise(_0x16e35b,_0x16427e,_0x25d185,_0x54d90f){return new BPromise(function(_0x48e555,_0x48ceed){var _0x1fcc10=_0x54d90f||client;return _0x1fcc10[_0x5092('0x1b')](_0x16e35b,_0x25d185)[_0x5092('0x1c')](function(_0x42351c){logger['info'](_0x5092('0x1d'),_0x16427e,_0x5092('0x1e'));logger[_0x5092('0x1f')](_0x5092('0x20'),_0x16427e,_0x5092('0x1e'),JSON[_0x5092('0x21')](_0x42351c));if(_0x42351c[_0x5092('0x22')]){if(_0x42351c[_0x5092('0x22')]['code']===0x1f4){logger['error'](_0x5092('0x1d'),_0x16427e,_0x42351c[_0x5092('0x22')][_0x5092('0x23')]);return _0x48ceed(_0x42351c[_0x5092('0x22')]['message']);}logger[_0x5092('0x22')](_0x5092('0x1d'),_0x16427e,_0x42351c['error'][_0x5092('0x23')]);return _0x48e555(_0x42351c[_0x5092('0x22')][_0x5092('0x23')]);}else{logger['info'](_0x5092('0x1d'),_0x16427e,_0x5092('0x1e'));_0x48e555(_0x42351c['result']['message']);}})[_0x5092('0x24')](function(_0x1f2d98){logger['error'](_0x5092('0x1d'),_0x16427e,_0x1f2d98);_0x48ceed(_0x1f2d98);});});}function respondWithStatusCode(_0x5e8dd0,_0x3882d7){_0x3882d7=_0x3882d7||0xcc;return function(_0x2796c6){if(_0x2796c6){return _0x5e8dd0['sendStatus'](_0x3882d7);}return _0x5e8dd0[_0x5092('0x25')](_0x3882d7)[_0x5092('0x26')]();};}function respondWithResult(_0x319b0b,_0x304f76){_0x304f76=_0x304f76||0xc8;return function(_0x3fd6c4){if(_0x3fd6c4){return _0x319b0b['status'](_0x304f76)['json'](_0x3fd6c4);}};}function respondWithFilteredResult(_0x5ae145,_0x95d5df){return function(_0x20f809){if(_0x20f809){var _0x35c170=_0x20f809[_0x5092('0x27')],_0x590cd1=_0x95d5df[_0x5092('0x28')],_0x52cdcf=_0x95d5df['offset']+_0x95d5df[_0x5092('0x29')],_0xf7ed0;if(_0x52cdcf>=_0x35c170){_0x52cdcf=_0x35c170;_0xf7ed0=0xc8;}else{_0xf7ed0=0xce;}_0x5ae145[_0x5092('0x25')](_0xf7ed0);return _0x5ae145[_0x5092('0x2a')]('Content-Range',_0x590cd1+'-'+_0x52cdcf+'/'+_0x35c170)[_0x5092('0x2b')](_0x20f809);}return null;};}function patchUpdates(_0x464739){return function(_0xc99bc6){try{jsonpatch['apply'](_0xc99bc6,_0x464739,!![]);}catch(_0x3dfd26){return BPromise[_0x5092('0x2c')](_0x3dfd26);}return _0xc99bc6['save']();};}function saveUpdates(_0x256e0a,_0x269cce){return function(_0xe7086a){if(_0xe7086a){return _0xe7086a[_0x5092('0x2d')](_0x256e0a)['then'](function(_0x54d12a){return _0x54d12a;});}return null;};}function removeEntity(_0xc2b166,_0x468843){return function(_0xd08a98){if(_0xd08a98){return _0xd08a98[_0x5092('0x2e')]()[_0x5092('0x1c')](function(){_0xc2b166[_0x5092('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e1782,_0x361e8e){return function(_0x167cd9){if(!_0x167cd9){_0x3e1782[_0x5092('0x2f')](0x194);}return _0x167cd9;};}function handleError(_0x267c4e,_0x355af4){_0x355af4=_0x355af4||0x1f4;return function(_0x3b0756){logger['error'](_0x3b0756[_0x5092('0x30')]);if(_0x3b0756[_0x5092('0x31')]){delete _0x3b0756[_0x5092('0x31')];}_0x267c4e['status'](_0x355af4)['send'](_0x3b0756);};}exports[_0x5092('0x32')]=function(_0x4c3560,_0x2b3f32){var _0x2428cc={},_0x8b3cfe={},_0x2ce11a={'count':0x0,'rows':[]};var _0x5c9c7e=db[_0x5092('0x33')]['rawAttributes'];_0x8b3cfe[_0x5092('0x34')]=_[_0x5092('0x35')](_0x5c9c7e);_0x8b3cfe[_0x5092('0x36')]=_['keys'](_0x4c3560[_0x5092('0x36')]);_0x8b3cfe[_0x5092('0x37')]=_[_0x5092('0x38')](_0x8b3cfe['model'],_0x8b3cfe['query']);_0x2428cc[_0x5092('0x39')]=_[_0x5092('0x38')](_0x8b3cfe[_0x5092('0x34')],qs[_0x5092('0x3a')](_0x4c3560[_0x5092('0x36')][_0x5092('0x3a')]));_0x2428cc[_0x5092('0x39')]=_0x2428cc[_0x5092('0x39')][_0x5092('0x3b')]?_0x2428cc[_0x5092('0x39')]:_0x8b3cfe[_0x5092('0x34')];if(!_0x4c3560[_0x5092('0x36')]['hasOwnProperty'](_0x5092('0x3c'))){_0x2428cc[_0x5092('0x29')]=qs[_0x5092('0x29')](_0x4c3560[_0x5092('0x36')][_0x5092('0x29')]);_0x2428cc[_0x5092('0x28')]=qs[_0x5092('0x28')](_0x4c3560[_0x5092('0x36')][_0x5092('0x28')]);}_0x2428cc[_0x5092('0x3d')]=qs['sort'](_0x4c3560[_0x5092('0x36')][_0x5092('0x3e')]);_0x2428cc['where']=qs[_0x5092('0x37')](_['pick'](_0x4c3560[_0x5092('0x36')],_0x8b3cfe[_0x5092('0x37')]));if(_0x4c3560[_0x5092('0x36')]['filter']){_0x2428cc[_0x5092('0x3f')]=_['merge'](_0x2428cc[_0x5092('0x3f')],{'$or':_[_0x5092('0x40')](_0x5c9c7e,function(_0x3e5ded){if(_0x3e5ded[_0x5092('0x41')][_0x5092('0x42')]!==_0x5092('0x43')){var _0x28e293={};_0x28e293[_0x3e5ded[_0x5092('0x44')]]={'$like':'%'+_0x4c3560[_0x5092('0x36')][_0x5092('0x45')]+'%'};return _0x28e293;}})});}_0x2428cc=_['merge']({},_0x2428cc,_0x4c3560[_0x5092('0x46')]);var _0x20375e={'where':_0x2428cc['where']};return db[_0x5092('0x33')][_0x5092('0x27')](_0x20375e)['then'](function(_0x3e68e9){_0x2ce11a[_0x5092('0x27')]=_0x3e68e9;if(_0x4c3560['query']['includeAll']){_0x2428cc[_0x5092('0x47')]=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x2428cc);})['then'](function(_0x2ea931){_0x2ce11a[_0x5092('0x48')]=_0x2ea931;return _0x2ce11a;})[_0x5092('0x1c')](respondWithFilteredResult(_0x2b3f32,_0x2428cc))[_0x5092('0x24')](handleError(_0x2b3f32,null));};exports[_0x5092('0x49')]=function(_0xd8aeef,_0x2ca8cd){var _0x5fc590={'raw':![],'where':{'id':_0xd8aeef[_0x5092('0x4a')]['id']}},_0xbe3918={};_0xbe3918[_0x5092('0x34')]=_[_0x5092('0x35')](db[_0x5092('0x33')][_0x5092('0x4b')]);_0xbe3918[_0x5092('0x36')]=_[_0x5092('0x35')](_0xd8aeef[_0x5092('0x36')]);_0xbe3918[_0x5092('0x37')]=_[_0x5092('0x38')](_0xbe3918[_0x5092('0x34')],_0xbe3918[_0x5092('0x36')]);_0x5fc590[_0x5092('0x39')]=_['intersection'](_0xbe3918['model'],qs['fields'](_0xd8aeef['query'][_0x5092('0x3a')]));_0x5fc590['attributes']=_0x5fc590[_0x5092('0x39')][_0x5092('0x3b')]?_0x5fc590['attributes']:_0xbe3918[_0x5092('0x34')];if(_0xd8aeef['query'][_0x5092('0x4c')]){_0x5fc590[_0x5092('0x47')]=[{'all':!![]}];}_0x5fc590=_[_0x5092('0x4d')]({},_0x5fc590,_0xd8aeef['options']);return db[_0x5092('0x33')][_0x5092('0x4e')](_0x5fc590)['then'](handleEntityNotFound(_0x2ca8cd,null))['then'](respondWithResult(_0x2ca8cd,null))[_0x5092('0x24')](handleError(_0x2ca8cd,null));};exports[_0x5092('0x4f')]=function(_0xfe49e7,_0x178ad2){return db[_0x5092('0x33')][_0x5092('0x4f')](_0xfe49e7[_0x5092('0x50')],{})['then'](respondWithResult(_0x178ad2,0xc9))[_0x5092('0x24')](handleError(_0x178ad2,null));};exports[_0x5092('0x2d')]=function(_0x333dea,_0x4197b1){if(_0x333dea[_0x5092('0x50')]['id']){delete _0x333dea[_0x5092('0x50')]['id'];}return db['Dynamics365Account'][_0x5092('0x4e')]({'where':{'id':_0x333dea['params']['id']}})[_0x5092('0x1c')](handleEntityNotFound(_0x4197b1,null))[_0x5092('0x1c')](saveUpdates(_0x333dea['body'],null))[_0x5092('0x1c')](respondWithResult(_0x4197b1,null))[_0x5092('0x24')](handleError(_0x4197b1,null));};exports['destroy']=function(_0x1bd9b5,_0x377d1c){return db['Dynamics365Account'][_0x5092('0x4e')]({'where':{'id':_0x1bd9b5[_0x5092('0x4a')]['id']}})[_0x5092('0x1c')](handleEntityNotFound(_0x377d1c,null))[_0x5092('0x1c')](removeEntity(_0x377d1c,null))[_0x5092('0x24')](handleError(_0x377d1c,null));};exports[_0x5092('0x51')]=function(_0x5d1d62,_0x445602,_0x51290d){var _0x5e2711={};var _0x4197d9={};var _0x32fc2f;var _0xbd143f;return db[_0x5092('0x33')][_0x5092('0x52')]({'where':{'id':_0x5d1d62[_0x5092('0x4a')]['id']}})[_0x5092('0x1c')](handleEntityNotFound(_0x445602,null))[_0x5092('0x1c')](function(_0x56d687){if(_0x56d687){_0x32fc2f=_0x56d687;_0x4197d9[_0x5092('0x34')]=_[_0x5092('0x35')](db[_0x5092('0x53')][_0x5092('0x4b')]);_0x4197d9[_0x5092('0x36')]=_[_0x5092('0x35')](_0x5d1d62[_0x5092('0x36')]);_0x4197d9[_0x5092('0x37')]=_[_0x5092('0x38')](_0x4197d9[_0x5092('0x34')],_0x4197d9[_0x5092('0x36')]);_0x5e2711[_0x5092('0x39')]=_[_0x5092('0x38')](_0x4197d9['model'],qs['fields'](_0x5d1d62[_0x5092('0x36')][_0x5092('0x3a')]));_0x5e2711['attributes']=_0x5e2711[_0x5092('0x39')][_0x5092('0x3b')]?_0x5e2711[_0x5092('0x39')]:_0x4197d9[_0x5092('0x34')];_0x5e2711[_0x5092('0x3d')]=qs[_0x5092('0x3e')](_0x5d1d62['query'][_0x5092('0x3e')]);_0x5e2711[_0x5092('0x3f')]=qs[_0x5092('0x37')](_[_0x5092('0x54')](_0x5d1d62[_0x5092('0x36')],_0x4197d9[_0x5092('0x37')]));if(_0x5d1d62[_0x5092('0x36')][_0x5092('0x45')]){_0x5e2711['where']=_[_0x5092('0x4d')](_0x5e2711['where'],{'$or':_[_0x5092('0x40')](_0x5e2711[_0x5092('0x39')],function(_0x4cb5ef){var _0x3fb026={};_0x3fb026[_0x4cb5ef]={'$like':'%'+_0x5d1d62['query'][_0x5092('0x45')]+'%'};return _0x3fb026;})});}_0x5e2711=_['merge']({},_0x5e2711,_0x5d1d62['options']);return _0x32fc2f[_0x5092('0x51')](_0x5e2711);}})[_0x5092('0x1c')](function(_0x45855d){if(_0x45855d){_0xbd143f=_0x45855d[_0x5092('0x3b')];if(!_0x5d1d62['query']['hasOwnProperty']('nolimit')){_0x5e2711['limit']=qs[_0x5092('0x29')](_0x5d1d62[_0x5092('0x36')]['limit']);_0x5e2711['offset']=qs[_0x5092('0x28')](_0x5d1d62[_0x5092('0x36')]['offset']);}return _0x32fc2f[_0x5092('0x51')](_0x5e2711);}})[_0x5092('0x1c')](function(_0x1876ce){if(_0x1876ce){return _0x1876ce?{'count':_0xbd143f,'rows':_0x1876ce}:null;}})[_0x5092('0x1c')](respondWithResult(_0x445602,null))[_0x5092('0x24')](handleError(_0x445602,null));};exports[_0x5092('0x55')]=function(_0x27c17c,_0x3585f3,_0x51285b){if(_0x27c17c[_0x5092('0x50')]['id']){delete _0x27c17c[_0x5092('0x50')]['id'];}return db[_0x5092('0x33')][_0x5092('0x52')]({'where':{'id':_0x27c17c[_0x5092('0x4a')]['id']}})[_0x5092('0x1c')](handleEntityNotFound(_0x3585f3,null))[_0x5092('0x1c')](function(_0x3abbb2){if(_0x3abbb2){_0x27c17c[_0x5092('0x50')]['AccountId']=_0x3abbb2['id'];_0x27c17c[_0x5092('0x50')][_0x5092('0x56')]=integrations[_0x5092('0x57')](_0x27c17c['body'][_0x5092('0x58')],_0x27c17c['body']['type']);_0x27c17c['body'][_0x5092('0x59')]=integrations['getDescriptions'](_0x27c17c['body'][_0x5092('0x58')],_0x27c17c[_0x5092('0x50')]['type']);return db[_0x5092('0x53')][_0x5092('0x4f')](_0x27c17c[_0x5092('0x50')],{'include':[{'model':db[_0x5092('0x5a')],'as':_0x5092('0x56')},{'model':db[_0x5092('0x5a')],'as':'Descriptions'}]});}return null;})[_0x5092('0x1c')](respondWithResult(_0x3585f3,null))[_0x5092('0x24')](handleError(_0x3585f3,null));};exports[_0x5092('0x5b')]=function(_0x1a29da,_0x203be9,_0x472fe6){var _0x4baef6=_0x1a29da[_0x5092('0x36')][_0x5092('0x5c')];var _0x36b2de=_0x4baef6===_0x5092('0x5d')?_0x5092('0x5e'):_0x5092('0x5f');var _0x4fd3e7='';var _0x1801e1='';var _0x40a4b7='';var _0x2e16c5='';var _0x121ab9='';var _0xc7eb1='';var _0x25c6f2='';var _0x406c90='';var _0x5ef9cf=[_0x5092('0x60'),'description',_0x5092('0x61'),_0x5092('0x62'),_0x5092('0x63'),_0x5092('0x64'),_0x5092('0x65'),_0x5092('0x66'),'directioncode',_0x5092('0x67')];var _0x478e11=[_0x5092('0x68'),_0x5092('0x69'),_0x5092('0x6a'),'billedserviceunits',_0x5092('0x6b'),_0x5092('0x6c'),_0x5092('0x6d'),'contractidname',_0x5092('0x6e'),_0x5092('0x6f'),_0x5092('0x70'),_0x5092('0x71'),_0x5092('0x72'),_0x5092('0x73'),_0x5092('0x74'),_0x5092('0x75'),_0x5092('0x76'),_0x5092('0x77'),_0x5092('0x78'),_0x5092('0x79'),_0x5092('0x7a'),'entityimage_url',_0x5092('0x7b'),_0x5092('0x7c'),'firstresponsebykpiidname',_0x5092('0x7d'),'importsequencenumber',_0x5092('0x7e'),_0x5092('0x7f'),_0x5092('0x80'),_0x5092('0x81'),'modifiedbyexternalpartyname',_0x5092('0x82'),_0x5092('0x83'),_0x5092('0x84'),_0x5092('0x85'),_0x5092('0x86'),_0x5092('0x87'),_0x5092('0x88'),'msdyn_iotalertname',_0x5092('0x89'),_0x5092('0x8a'),_0x5092('0x8b'),'owneridname',_0x5092('0x8c'),_0x5092('0x8d'),_0x5092('0x8e'),_0x5092('0x8f'),'primarycontactidyominame',_0x5092('0x90'),_0x5092('0x91'),'productserialnumber',_0x5092('0x92'),_0x5092('0x93'),'responseby','responsiblecontactidname',_0x5092('0x94'),_0x5092('0x95'),_0x5092('0x96'),_0x5092('0x97'),_0x5092('0x98'),_0x5092('0x99'),_0x5092('0x9a'),_0x5092('0x9b'),_0x5092('0x9c'),_0x5092('0x9d'),_0x5092('0x9e'),_0x5092('0x9f'),_0x5092('0xa0'),_0x5092('0xa1')];var _0x16323e=_0x5ef9cf[_0x5092('0xa2')](_0x478e11);return db[_0x5092('0x33')][_0x5092('0x52')]({'where':{'id':_0x1a29da[_0x5092('0x4a')]['id']},'attributes':['id','username',_0x5092('0xa3'),_0x5092('0xa4'),_0x5092('0xa5'),_0x5092('0xa6'),_0x5092('0xa7')]})[_0x5092('0x1c')](handleEntityNotFound(_0x203be9,null))[_0x5092('0x1c')](function(_0x197d09){if(_0x197d09){_0x406c90=_0x197d09['remoteUri'];var _0x564183=_0x406c90['slice'](-0x1);if(_0x564183==='/'){_0x406c90=_0x406c90['substring'](0x0,_0x406c90[_0x5092('0xa8')](_0x564183));}_0x25c6f2=util['format']('%s/api/data/v9.0/',_0x406c90);var _0x49a905={'method':_0x5092('0xa9'),'uri':_0x5092('0xaa')+_0x197d09[_0x5092('0xa5')]+_0x5092('0xab'),'form':{'client_id':_0x197d09[_0x5092('0xa6')],'resource':_0x406c90,'username':_0x197d09['username'],'password':_0x197d09['password'],'grant_type':'password','client_secret':_0x197d09['clientSecret']},'json':!![]};return rp(_0x49a905);}})[_0x5092('0x1c')](function(_0x2ebb53){_0xc7eb1=_0x2ebb53['access_token'];var _0x5a0b3d={'method':'GET','uri':encodeURI(_0x25c6f2+_0x5092('0xac')+_0x36b2de+'\x27'),'headers':{'Authorization':_0x5092('0xad')+_0xc7eb1,'If-None-Match':null,'OData-Version':_0x5092('0xae')},'json':!![]};return rp(_0x5a0b3d);})[_0x5092('0x1c')](function(_0x492d58){var _0x563360=_0x492d58[_0x5092('0xaf')][0x0];var _0x4ce5e5=_0x563360[_0x5092('0xb0')];var _0x26c732={'method':_0x5092('0xb1'),'uri':_0x25c6f2+_0x5092('0xb2')+_0x4ce5e5+_0x5092('0xb3'),'headers':{'Authorization':_0x5092('0xad')+_0xc7eb1,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x26c732);})[_0x5092('0x1c')](function(_0x429e51){_0x4fd3e7=_0x429e51;_0x1801e1=_0x4fd3e7[_0x5092('0xb4')];_0x1801e1=_[_0x5092('0xb5')](_0x1801e1,function(_0x113354){return!_0x16323e['includes'](_0x113354['LogicalName']);});var _0x336ced=[];var _0x5759e4=[];_0x1801e1[_0x5092('0xb6')](function(_0x10de28){if(_0x10de28['@odata.type']){var _0x1fab68=_0x10de28['@odata.type']['substring'](_0x10de28['@odata.type']['lastIndexOf']('.')+0x1);if(_0x1fab68==='PicklistAttributeMetadata'){_0x336ced[_0x5092('0xb7')](getSelectList(_0x25c6f2,_0x4baef6,_0x5759e4,_0x4fd3e7[_0x5092('0xb0')],_0x10de28[_0x5092('0xb0')],_0xc7eb1));}}});return Promise[_0x5092('0xb8')](_0x336ced);})[_0x5092('0x1c')](function(_0x5182c9){_0x40a4b7=_0x5182c9[0x0];var _0x1ac843=[];var _0x3cb472=[];_0x1801e1[_0x5092('0xb6')](function(_0x5326c4){if(!_['isNil'](_0x5326c4['@odata.type'])){var _0x39b34a=_0x5326c4['@odata.type'][_0x5092('0xb9')](_0x5326c4[_0x5092('0xba')]['lastIndexOf']('.')+0x1);if(_0x39b34a===_0x5092('0xbb')){_0x1ac843[_0x5092('0xb7')](getBooleanList(_0x25c6f2,_0x4baef6,_0x3cb472,_0x4fd3e7['MetadataId'],_0x5326c4['MetadataId'],_0xc7eb1));}}});return Promise[_0x5092('0xb8')](_0x1ac843);})['then'](function(_0x36d643){_0x2e16c5=_0x36d643[0x0];var _0xecd1f1=[];var _0x34d004=[];_0x1801e1[_0x5092('0xb6')](function(_0x5f05fa){if(_0x5f05fa[_0x5092('0xba')]){var _0xab67ce=_0x5f05fa[_0x5092('0xba')][_0x5092('0xb9')](_0x5f05fa['@odata.type'][_0x5092('0xa8')]('.')+0x1);if(_0xab67ce===_0x5092('0xbc')||_0xab67ce===_0x5092('0xbd')||_0xab67ce==='BigIntAttributeMetadata'||_0xab67ce===_0x5092('0xbe')||_0xab67ce===_0x5092('0xbf')||_0xab67ce===_0x5092('0xc0')||_0xab67ce===_0x5092('0xc1')||_0xab67ce===_0x5092('0xc2')||_0xab67ce===_0x5092('0xc3')||_0xab67ce==='DecimalAttributeMetadata'){_0xecd1f1[_0x5092('0xb7')](getInputList(_0x25c6f2,_0x4baef6,_0xab67ce,_0x34d004,_0x4fd3e7[_0x5092('0xb0')],_0x5f05fa[_0x5092('0xb0')],_0xc7eb1));}}});return Promise[_0x5092('0xb8')](_0xecd1f1);})[_0x5092('0x1c')](function(_0x30ae4a){_0x121ab9=_0x30ae4a[0x0];var _0x14ad9e=_0x40a4b7[_0x5092('0xa2')](_0x2e16c5)['concat'](_0x121ab9);var _0x5ca362={'count':_0x14ad9e[_0x5092('0x3b')],'rows':_0x14ad9e};return _0x5ca362;})[_0x5092('0x1c')](respondWithResult(_0x203be9,null))[_0x5092('0x24')](function(_0x438fec){console[_0x5092('0xc4')](_0x5092('0xc5')+_0x438fec);var _0x1b110e=_0x1a29da[_0x5092('0x36')][_0x5092('0x19')]?0x1f4:_0x438fec[_0x5092('0xc6')]||0x1f4;logger[_0x5092('0x22')](_0x438fec[_0x5092('0x30')]);delete _0x438fec['name'];if(_0x1b110e===0x191){_0x1b110e=0x190;}_0x203be9['status'](_0x1b110e)['send'](_0x1a29da[_0x5092('0x36')][_0x5092('0x19')]?{'message':'Wrong\x20credentials','statusCode':_0x438fec[_0x5092('0xc6')]}:_0x438fec);});};function getSelectList(_0x5bc4f1,_0x225f91,_0xa49c6f,_0x2b647c,_0x48aa7a,_0x5312ff){var _0x3a3d24={'method':_0x5092('0xb1'),'uri':_0x5bc4f1+_0x5092('0xb2')+_0x2b647c+_0x5092('0xc7')+_0x48aa7a+_0x5092('0xc8')+_0x5092('0xc9'),'headers':{'Authorization':_0x5092('0xad')+_0x5312ff,'If-None-Match':null,'OData-Version':_0x5092('0xae')},'json':!![]};return rp(_0x3a3d24)[_0x5092('0x1c')](function(_0x4ccc2c){var _0x595c0d=[];var _0xd4f9b3=_0x4ccc2c[_0x5092('0xca')][_0x5092('0xcb')];_0xd4f9b3[_0x5092('0xb6')](function(_0x4d9b01){_0x595c0d[_0x5092('0xb7')]({'name':_0x4d9b01[_0x5092('0xcc')]['UserLocalizedLabel'][_0x5092('0xcc')],'value':String(_0x4d9b01[_0x5092('0xcd')])});});var _0x5ca1cb={'id':_0x225f91+'_'+_0x4ccc2c[_0x5092('0xce')],'name':_0x4ccc2c[_0x5092('0xcf')][_0x5092('0xd0')][_0x5092('0xcc')],'custom':![],'options':_0x595c0d};_0xa49c6f[_0x5092('0xb7')](_0x5ca1cb);return _0xa49c6f;});}function getBooleanList(_0x3dd236,_0x5ad545,_0x4f4a57,_0x584169,_0x81a952,_0x387729){var _0x2f59d6={'method':_0x5092('0xb1'),'uri':_0x3dd236+'EntityDefinitions('+_0x584169+')/Attributes('+_0x81a952+_0x5092('0xd1'),'headers':{'Authorization':_0x5092('0xad')+_0x387729,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2f59d6)[_0x5092('0x1c')](function(_0x3e3df6){var _0xf43c99=[];_0xf43c99[_0x5092('0xb7')]({'name':_0x3e3df6[_0x5092('0xca')]['TrueOption'][_0x5092('0xcc')][_0x5092('0xd0')]['Label'],'value':_0x5092('0xd2')},{'name':_0x3e3df6[_0x5092('0xca')]['FalseOption']['Label'][_0x5092('0xd0')][_0x5092('0xcc')],'value':_0x5092('0xd3')});var _0x246cdb={'id':_0x5ad545+'_'+_0x3e3df6[_0x5092('0xce')],'name':_0x3e3df6['DisplayName'][_0x5092('0xd0')][_0x5092('0xcc')],'custom':![],'options':_0xf43c99};_0x4f4a57['push'](_0x246cdb);return _0x4f4a57;});}function getInputList(_0x5e6576,_0x288083,_0x7f2402,_0x827b4d,_0x152377,_0x57add2,_0x575d2e){var _0x2f12fc={'method':_0x5092('0xb1'),'uri':_0x5e6576+_0x5092('0xb2')+_0x152377+')/Attributes('+_0x57add2+_0x5092('0xd4')+_0x7f2402+_0x5092('0xd5'),'headers':{'Authorization':_0x5092('0xad')+_0x575d2e,'If-None-Match':null,'OData-Version':_0x5092('0xae')},'json':!![]};return rp(_0x2f12fc)['then'](function(_0x2194f7){var _0x55a355={'id':_0x288083+'_'+_0x2194f7[_0x5092('0xce')],'name':_0x2194f7[_0x5092('0xcf')][_0x5092('0xd0')]?_0x2194f7[_0x5092('0xcf')][_0x5092('0xd0')][_0x5092('0xcc')]:_0x2194f7[_0x5092('0xce')],'custom':![],'options':[]};_0x827b4d[_0x5092('0xb7')](_0x55a355);return _0x827b4d;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 3d46bf4..31336da 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 _0xc853=['Dynamics365Account','int_dynamics365_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define'];(function(_0x5ba493,_0x5f3055){var _0x181ed6=function(_0x42f4e2){while(--_0x42f4e2){_0x5ba493['push'](_0x5ba493['shift']());}};_0x181ed6(++_0x5f3055);}(_0xc853,0x64));var _0x3c85=function(_0x45d49b,_0x44c3e7){_0x45d49b=_0x45d49b-0x0;var _0x2ac440=_0xc853[_0x45d49b];return _0x2ac440;};'use strict';var _=require(_0x3c85('0x0'));var util=require(_0x3c85('0x1'));var logger=require(_0x3c85('0x2'))('api');var moment=require(_0x3c85('0x3'));var BPromise=require(_0x3c85('0x4'));var rp=require(_0x3c85('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c85('0x6'));var config=require(_0x3c85('0x7'));var attributes=require(_0x3c85('0x8'));var integrations=require(_0x3c85('0x9'));module[_0x3c85('0xa')]=function(_0x2faabe,_0x359274){return _0x2faabe[_0x3c85('0xb')](_0x3c85('0xc'),attributes,{'tableName':_0x3c85('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86c6=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','define','Dynamics365Account'];(function(_0x51b52e,_0x3c2506){var _0x59a011=function(_0x397663){while(--_0x397663){_0x51b52e['push'](_0x51b52e['shift']());}};_0x59a011(++_0x3c2506);}(_0x86c6,0x1d4));var _0x686c=function(_0x236c05,_0x4c5fe8){_0x236c05=_0x236c05-0x0;var _0x9940df=_0x86c6[_0x236c05];return _0x9940df;};'use strict';var _=require(_0x686c('0x0'));var util=require(_0x686c('0x1'));var logger=require('../../config/logger')(_0x686c('0x2'));var moment=require(_0x686c('0x3'));var BPromise=require(_0x686c('0x4'));var rp=require(_0x686c('0x5'));var fs=require('fs');var path=require(_0x686c('0x6'));var rimraf=require(_0x686c('0x7'));var config=require(_0x686c('0x8'));var attributes=require(_0x686c('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x644d85,_0x398309){return _0x644d85[_0x686c('0xa')](_0x686c('0xb'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 311624a..bf58401 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 _0x3b74=['error','code','Dynamics365Account,\x20%s,\x20%s','message','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','catch','ShowDynamics365Account','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s'];(function(_0x224ceb,_0x427cd3){var _0x31c745=function(_0xac9ac3){while(--_0xac9ac3){_0x224ceb['push'](_0x224ceb['shift']());}};_0x31c745(++_0x427cd3);}(_0x3b74,0x80));var _0x43b7=function(_0x47d476,_0x50afb2){_0x47d476=_0x47d476-0x0;var _0x57fab0=_0x3b74[_0x47d476];return _0x57fab0;};'use strict';var _=require(_0x43b7('0x0'));var util=require(_0x43b7('0x1'));var moment=require(_0x43b7('0x2'));var BPromise=require(_0x43b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43b7('0x4'));var db=require(_0x43b7('0x5'))['db'];var utils=require(_0x43b7('0x6'));var logger=require(_0x43b7('0x7'))('rpc');var config=require(_0x43b7('0x8'));var jayson=require(_0x43b7('0x9'));var client=jayson[_0x43b7('0xa')][_0x43b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x454419,_0x2fb827,_0x536dc1){return new BPromise(function(_0x547b96,_0x1d88bc){return client[_0x43b7('0xc')](_0x454419,_0x536dc1)['then'](function(_0x11662a){logger[_0x43b7('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x2fb827,_0x43b7('0xe'));logger['debug'](_0x43b7('0xf'),_0x2fb827,_0x43b7('0xe'),JSON['stringify'](_0x11662a));if(_0x11662a['error']){if(_0x11662a[_0x43b7('0x10')][_0x43b7('0x11')]===0x1f4){logger['error'](_0x43b7('0x12'),_0x2fb827,_0x11662a['error'][_0x43b7('0x13')]);return _0x1d88bc(_0x11662a[_0x43b7('0x10')][_0x43b7('0x13')]);}logger['error'](_0x43b7('0x12'),_0x2fb827,_0x11662a[_0x43b7('0x10')][_0x43b7('0x13')]);return _0x547b96(_0x11662a[_0x43b7('0x10')][_0x43b7('0x13')]);}else{logger[_0x43b7('0xd')](_0x43b7('0x12'),_0x2fb827,_0x43b7('0xe'));_0x547b96(_0x11662a['result'][_0x43b7('0x13')]);}})['catch'](function(_0x1c7b95){logger[_0x43b7('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x2fb827,_0x1c7b95);_0x1d88bc(_0x1c7b95);});});}exports[_0x43b7('0x14')]=function(_0xaaeba5){var _0x111798=this;return new Promise(function(_0xf8906d,_0x47905a){return db[_0x43b7('0x15')][_0x43b7('0x16')]({'raw':_0xaaeba5[_0x43b7('0x17')]?_0xaaeba5[_0x43b7('0x17')][_0x43b7('0x18')]===undefined?!![]:![]:!![],'where':_0xaaeba5[_0x43b7('0x17')]?_0xaaeba5[_0x43b7('0x17')][_0x43b7('0x19')]||null:null,'attributes':_0xaaeba5[_0x43b7('0x17')]?_0xaaeba5['options'][_0x43b7('0x1a')]||null:null,'limit':_0xaaeba5['options']?_0xaaeba5[_0x43b7('0x17')][_0x43b7('0x1b')]||null:null,'include':_0xaaeba5[_0x43b7('0x17')]?_0xaaeba5[_0x43b7('0x17')][_0x43b7('0x1c')]?_[_0x43b7('0x1d')](_0xaaeba5['options'][_0x43b7('0x1c')],function(_0x348257){return{'model':db[_0x348257['model']],'as':_0x348257['as'],'attributes':_0x348257[_0x43b7('0x1a')],'include':_0x348257['include']?_[_0x43b7('0x1d')](_0x348257[_0x43b7('0x1c')],function(_0x1f6bd7){return{'model':db[_0x1f6bd7[_0x43b7('0x1e')]],'as':_0x1f6bd7['as'],'attributes':_0x1f6bd7[_0x43b7('0x1a')],'include':_0x1f6bd7[_0x43b7('0x1c')]?_['map'](_0x1f6bd7[_0x43b7('0x1c')],function(_0x3be8a9){return{'model':db[_0x3be8a9['model']],'as':_0x3be8a9['as'],'attributes':_0x3be8a9[_0x43b7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x43b7('0x1f')](function(_0x461bed){logger[_0x43b7('0xd')]('GetDynamics365Account',_0xaaeba5);logger[_0x43b7('0x20')](_0x43b7('0x14'),_0xaaeba5,JSON['stringify'](_0x461bed));_0xf8906d(_0x461bed);})[_0x43b7('0x21')](function(_0x406b39){logger['error'](_0x43b7('0x14'),_0x406b39['message'],_0xaaeba5);_0x47905a(_0x111798[_0x43b7('0x10')](0x1f4,_0x406b39[_0x43b7('0x13')]));});});};exports[_0x43b7('0x22')]=function(_0xc8625c){var _0x1eede6=this;return new Promise(function(_0x246719,_0x26fc49){return db[_0x43b7('0x15')]['find']({'raw':_0xc8625c[_0x43b7('0x17')]?_0xc8625c[_0x43b7('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xc8625c[_0x43b7('0x17')]?_0xc8625c[_0x43b7('0x17')][_0x43b7('0x19')]||null:null,'attributes':_0xc8625c[_0x43b7('0x17')]?_0xc8625c[_0x43b7('0x17')][_0x43b7('0x1a')]||null:null,'include':_0xc8625c[_0x43b7('0x17')]?_0xc8625c[_0x43b7('0x17')]['include']?_[_0x43b7('0x1d')](_0xc8625c[_0x43b7('0x17')][_0x43b7('0x1c')],function(_0x5b2d63){return{'model':db[_0x5b2d63['model']],'as':_0x5b2d63['as'],'attributes':_0x5b2d63[_0x43b7('0x1a')],'include':_0x5b2d63[_0x43b7('0x1c')]?_['map'](_0x5b2d63[_0x43b7('0x1c')],function(_0x13c096){return{'model':db[_0x13c096[_0x43b7('0x1e')]],'as':_0x13c096['as'],'attributes':_0x13c096[_0x43b7('0x1a')],'include':_0x13c096[_0x43b7('0x1c')]?_['map'](_0x13c096[_0x43b7('0x1c')],function(_0x289fcf){return{'model':db[_0x289fcf[_0x43b7('0x1e')]],'as':_0x289fcf['as'],'attributes':_0x289fcf['attributes']};}):[]};}):[]};}):[]:[]})[_0x43b7('0x1f')](function(_0xacb382){logger[_0x43b7('0xd')](_0x43b7('0x22'),_0xc8625c);logger[_0x43b7('0x20')](_0x43b7('0x22'),_0xc8625c,JSON[_0x43b7('0x23')](_0xacb382));_0x246719(_0xacb382);})[_0x43b7('0x21')](function(_0x3f7eb2){logger[_0x43b7('0x10')](_0x43b7('0x22'),_0x3f7eb2['message'],_0xc8625c);_0x26fc49(_0x1eede6['error'](0x1f4,_0x3f7eb2[_0x43b7('0x13')]));});});}; \ No newline at end of file +var _0x4745=['debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','attributes','limit','include','map','model','then','raw','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent'];(function(_0x4c184d,_0x4278ab){var _0x23d997=function(_0x22d068){while(--_0x22d068){_0x4c184d['push'](_0x4c184d['shift']());}};_0x23d997(++_0x4278ab);}(_0x4745,0x1e7));var _0x5474=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4745[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var moment=require(_0x5474('0x2'));var BPromise=require(_0x5474('0x3'));var rs=require(_0x5474('0x4'));var fs=require('fs');var Redis=require(_0x5474('0x5'));var db=require(_0x5474('0x6'))['db'];var utils=require(_0x5474('0x7'));var logger=require(_0x5474('0x8'))(_0x5474('0x9'));var config=require(_0x5474('0xa'));var jayson=require(_0x5474('0xb'));var client=jayson['client'][_0x5474('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x431f81,_0x57add7,_0x13929f){return new BPromise(function(_0x5d778b,_0x902ba8){return client[_0x5474('0xd')](_0x431f81,_0x13929f)['then'](function(_0xf876f8){logger[_0x5474('0xe')](_0x5474('0xf'),_0x57add7,_0x5474('0x10'));logger[_0x5474('0x11')](_0x5474('0x12'),_0x57add7,_0x5474('0x10'),JSON[_0x5474('0x13')](_0xf876f8));if(_0xf876f8['error']){if(_0xf876f8[_0x5474('0x14')][_0x5474('0x15')]===0x1f4){logger[_0x5474('0x14')](_0x5474('0xf'),_0x57add7,_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);return _0x902ba8(_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);}logger[_0x5474('0x14')]('Dynamics365Account,\x20%s,\x20%s',_0x57add7,_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);return _0x5d778b(_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x57add7,'request\x20sent');_0x5d778b(_0xf876f8['result'][_0x5474('0x16')]);}})[_0x5474('0x17')](function(_0x2da774){logger['error'](_0x5474('0xf'),_0x57add7,_0x2da774);_0x902ba8(_0x2da774);});});}exports[_0x5474('0x18')]=function(_0x56dbfa){var _0x22b37d=this;return new Promise(function(_0x198fc8,_0x18b0fe){return db[_0x5474('0x19')][_0x5474('0x1a')]({'raw':_0x56dbfa['options']?_0x56dbfa[_0x5474('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x56dbfa[_0x5474('0x1b')]?_0x56dbfa[_0x5474('0x1b')]['where']||null:null,'attributes':_0x56dbfa['options']?_0x56dbfa['options'][_0x5474('0x1c')]||null:null,'limit':_0x56dbfa[_0x5474('0x1b')]?_0x56dbfa[_0x5474('0x1b')][_0x5474('0x1d')]||null:null,'include':_0x56dbfa[_0x5474('0x1b')]?_0x56dbfa[_0x5474('0x1b')][_0x5474('0x1e')]?_[_0x5474('0x1f')](_0x56dbfa[_0x5474('0x1b')][_0x5474('0x1e')],function(_0x542d1f){return{'model':db[_0x542d1f['model']],'as':_0x542d1f['as'],'attributes':_0x542d1f[_0x5474('0x1c')],'include':_0x542d1f[_0x5474('0x1e')]?_[_0x5474('0x1f')](_0x542d1f['include'],function(_0x24997a){return{'model':db[_0x24997a['model']],'as':_0x24997a['as'],'attributes':_0x24997a[_0x5474('0x1c')],'include':_0x24997a[_0x5474('0x1e')]?_['map'](_0x24997a[_0x5474('0x1e')],function(_0x5d4cd7){return{'model':db[_0x5d4cd7[_0x5474('0x20')]],'as':_0x5d4cd7['as'],'attributes':_0x5d4cd7['attributes']};}):[]};}):[]};}):[]:[]})[_0x5474('0x21')](function(_0x1384e4){logger[_0x5474('0xe')]('GetDynamics365Account',_0x56dbfa);logger[_0x5474('0x11')](_0x5474('0x18'),_0x56dbfa,JSON['stringify'](_0x1384e4));_0x198fc8(_0x1384e4);})['catch'](function(_0x5d2381){logger['error'](_0x5474('0x18'),_0x5d2381[_0x5474('0x16')],_0x56dbfa);_0x18b0fe(_0x22b37d['error'](0x1f4,_0x5d2381[_0x5474('0x16')]));});});};exports['ShowDynamics365Account']=function(_0xc1e0ce){var _0x58f27a=this;return new Promise(function(_0x70774f,_0x530cdb){return db[_0x5474('0x19')]['find']({'raw':_0xc1e0ce[_0x5474('0x1b')]?_0xc1e0ce[_0x5474('0x1b')][_0x5474('0x22')]===undefined?!![]:![]:!![],'where':_0xc1e0ce[_0x5474('0x1b')]?_0xc1e0ce['options']['where']||null:null,'attributes':_0xc1e0ce[_0x5474('0x1b')]?_0xc1e0ce[_0x5474('0x1b')][_0x5474('0x1c')]||null:null,'include':_0xc1e0ce[_0x5474('0x1b')]?_0xc1e0ce['options']['include']?_[_0x5474('0x1f')](_0xc1e0ce[_0x5474('0x1b')]['include'],function(_0x3ce359){return{'model':db[_0x3ce359[_0x5474('0x20')]],'as':_0x3ce359['as'],'attributes':_0x3ce359[_0x5474('0x1c')],'include':_0x3ce359[_0x5474('0x1e')]?_['map'](_0x3ce359[_0x5474('0x1e')],function(_0x409111){return{'model':db[_0x409111[_0x5474('0x20')]],'as':_0x409111['as'],'attributes':_0x409111['attributes'],'include':_0x409111[_0x5474('0x1e')]?_[_0x5474('0x1f')](_0x409111[_0x5474('0x1e')],function(_0x2f4589){return{'model':db[_0x2f4589['model']],'as':_0x2f4589['as'],'attributes':_0x2f4589['attributes']};}):[]};}):[]};}):[]:[]})[_0x5474('0x21')](function(_0x3eccef){logger[_0x5474('0xe')](_0x5474('0x23'),_0xc1e0ce);logger['debug'](_0x5474('0x23'),_0xc1e0ce,JSON[_0x5474('0x13')](_0x3eccef));_0x70774f(_0x3eccef);})[_0x5474('0x17')](function(_0x22009e){logger['error']('ShowDynamics365Account',_0x22009e['message'],_0xc1e0ce);_0x530cdb(_0x58f27a[_0x5474('0x14')](0x1f4,_0x22009e['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 16cffff..6345cdd 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 _0x449c=['/:id','isAuthenticated','/:id/fields','getFields','getSubjects','getDescriptions','post','put','update','delete','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x260d3f,_0x5c0c51){var _0x1bbb43=function(_0x3f6393){while(--_0x3f6393){_0x260d3f['push'](_0x260d3f['shift']());}};_0x1bbb43(++_0x5c0c51);}(_0x449c,0x16f));var _0xc449=function(_0x57bf3e,_0x3857bf){_0x57bf3e=_0x57bf3e-0x0;var _0x4cdb06=_0x449c[_0x57bf3e];return _0x4cdb06;};'use strict';var multer=require('multer');var util=require(_0xc449('0x0'));var path=require('path');var timeout=require(_0xc449('0x1'));var express=require('express');var router=express[_0xc449('0x2')]();var auth=require(_0xc449('0x3'));var interaction=require(_0xc449('0x4'));var config=require(_0xc449('0x5'));var controller=require('./intDynamics365Configuration.controller');router[_0xc449('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc449('0x6')](_0xc449('0x7'),auth[_0xc449('0x8')](),controller['show']);router['get'](_0xc449('0x9'),auth[_0xc449('0x8')](),controller[_0xc449('0xa')]);router[_0xc449('0x6')]('/:id/subjects',auth[_0xc449('0x8')](),controller[_0xc449('0xb')]);router[_0xc449('0x6')]('/:id/descriptions',auth[_0xc449('0x8')](),controller[_0xc449('0xc')]);router[_0xc449('0xd')]('/',auth[_0xc449('0x8')](),controller['create']);router[_0xc449('0xe')](_0xc449('0x7'),auth['isAuthenticated'](),controller[_0xc449('0xf')]);router[_0xc449('0x10')](_0xc449('0x7'),auth[_0xc449('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd8eb=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x5535e1,_0x4e4672){var _0x38ab20=function(_0x32d1bb){while(--_0x32d1bb){_0x5535e1['push'](_0x5535e1['shift']());}};_0x38ab20(++_0x4e4672);}(_0xd8eb,0x1c7));var _0xbd8e=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0xd8eb[_0x47a349];return _0x18ab75;};'use strict';var multer=require(_0xbd8e('0x0'));var util=require('util');var path=require(_0xbd8e('0x1'));var timeout=require(_0xbd8e('0x2'));var express=require(_0xbd8e('0x3'));var router=express[_0xbd8e('0x4')]();var auth=require(_0xbd8e('0x5'));var interaction=require(_0xbd8e('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0xbd8e('0x7')]('/',auth[_0xbd8e('0x8')](),controller[_0xbd8e('0x9')]);router[_0xbd8e('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xbd8e('0xa'),auth['isAuthenticated'](),controller['getFields']);router['get'](_0xbd8e('0xb'),auth['isAuthenticated'](),controller[_0xbd8e('0xc')]);router[_0xbd8e('0x7')](_0xbd8e('0xd'),auth[_0xbd8e('0x8')](),controller[_0xbd8e('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbd8e('0xf')](_0xbd8e('0x10'),auth['isAuthenticated'](),controller[_0xbd8e('0x11')]);router[_0xbd8e('0x12')]('/:id',auth[_0xbd8e('0x8')](),controller['destroy']);module[_0xbd8e('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 805ebe4..ac3e20c 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 _0xa9e5=['exports','STRING','ENUM','incident','phonecall','sequelize'];(function(_0x23159d,_0x3f2729){var _0x2fd22b=function(_0x2234ab){while(--_0x2234ab){_0x23159d['push'](_0x23159d['shift']());}};_0x2fd22b(++_0x3f2729);}(_0xa9e5,0x1c1));var _0x5a9e=function(_0x151b78,_0x4dc4a5){_0x151b78=_0x151b78-0x0;var _0x3bc0fd=_0xa9e5[_0x151b78];return _0x3bc0fd;};'use strict';var Sequelize=require(_0x5a9e('0x0'));module[_0x5a9e('0x1')]={'name':{'type':Sequelize[_0x5a9e('0x2')]},'description':{'type':Sequelize[_0x5a9e('0x2')]},'ticketType':{'type':Sequelize[_0x5a9e('0x3')](_0x5a9e('0x4'),_0x5a9e('0x5')),'defaultValue':_0x5a9e('0x4')}}; \ No newline at end of file +var _0x2577=['exports','STRING','ENUM','phonecall'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2577,0x124));var _0x7257=function(_0x2581be,_0x59eec3){_0x2581be=_0x2581be-0x0;var _0x36c076=_0x2577[_0x2581be];return _0x36c076;};'use strict';var Sequelize=require('sequelize');module[_0x7257('0x0')]={'name':{'type':Sequelize[_0x7257('0x1')]},'description':{'type':Sequelize[_0x7257('0x1')]},'ticketType':{'type':Sequelize[_0x7257('0x2')]('incident',_0x7257('0x3')),'defaultValue':'incident'}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index b500888..708d11e 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 _0xfb26=['map','getFields','getSubjects','getDescriptions','findOne','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','name','index','Dynamics365Configuration','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','merge','type','key','VIRTUAL','field','filter','options','rows','params','rawAttributes','length','includeAll','include','create','body','update','find','destroy','Dynamics365Field','order','pick'];(function(_0x34c2d4,_0x418ed2){var _0x38796a=function(_0xf017c5){while(--_0xf017c5){_0x34c2d4['push'](_0x34c2d4['shift']());}};_0x38796a(++_0x418ed2);}(_0xfb26,0x1cc));var _0x6fb2=function(_0x2d259a,_0x31068e){_0x2d259a=_0x2d259a-0x0;var _0x16f9d5=_0xfb26[_0x2d259a];return _0x16f9d5;};'use strict';var pdf=require(_0x6fb2('0x0'));var emlformat=require(_0x6fb2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6fb2('0x2'));var jsonpatch=require(_0x6fb2('0x3'));var rp=require(_0x6fb2('0x4'));var moment=require('moment');var BPromise=require(_0x6fb2('0x5'));var Mustache=require(_0x6fb2('0x6'));var util=require('util');var path=require(_0x6fb2('0x7'));var sox=require(_0x6fb2('0x8'));var csv=require('to-csv');var ejs=require(_0x6fb2('0x9'));var fs=require('fs');var _=require(_0x6fb2('0xa'));var squel=require(_0x6fb2('0xb'));var crypto=require(_0x6fb2('0xc'));var jsforce=require(_0x6fb2('0xd'));var deskjs=require(_0x6fb2('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6fb2('0xf'));var Redis=require(_0x6fb2('0x10'));var authService=require(_0x6fb2('0x11'));var qs=require(_0x6fb2('0x12'));var hardwareService=require(_0x6fb2('0x13'));var logger=require(_0x6fb2('0x14'))(_0x6fb2('0x15'));var utils=require(_0x6fb2('0x16'));var config=require(_0x6fb2('0x17'));var db=require(_0x6fb2('0x18'))['db'];var jayson=require(_0x6fb2('0x19'));var client=jayson[_0x6fb2('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x31651e,_0xf3e2a3,_0x1f140f){if(_0x1f140f){var _0x10b127=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x10b127[_0x6fb2('0x1b')](_0xf3e2a3)){return _0x31651e;}else{throw new Error(_0x6fb2('0x1c'));}}else{return _0x31651e;}}function respondWithRpcPromise(_0x1d4cd6,_0x2ec8f3,_0x405dfd,_0x264c20){return new BPromise(function(_0x23c8e4,_0x510d1a){var _0x3f22ae=_0x264c20||client;return _0x3f22ae[_0x6fb2('0x1d')](_0x1d4cd6,_0x405dfd)[_0x6fb2('0x1e')](function(_0x3e6d9a){logger[_0x6fb2('0x1f')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2ec8f3,_0x6fb2('0x20'));logger['debug'](_0x6fb2('0x21'),_0x2ec8f3,_0x6fb2('0x20'),JSON[_0x6fb2('0x22')](_0x3e6d9a));if(_0x3e6d9a[_0x6fb2('0x23')]){if(_0x3e6d9a[_0x6fb2('0x23')]['code']===0x1f4){logger['error'](_0x6fb2('0x24'),_0x2ec8f3,_0x3e6d9a[_0x6fb2('0x23')][_0x6fb2('0x25')]);return _0x510d1a(_0x3e6d9a[_0x6fb2('0x23')][_0x6fb2('0x25')]);}logger[_0x6fb2('0x23')](_0x6fb2('0x24'),_0x2ec8f3,_0x3e6d9a[_0x6fb2('0x23')]['message']);return _0x23c8e4(_0x3e6d9a['error'][_0x6fb2('0x25')]);}else{logger['info'](_0x6fb2('0x24'),_0x2ec8f3,_0x6fb2('0x20'));_0x23c8e4(_0x3e6d9a[_0x6fb2('0x26')][_0x6fb2('0x25')]);}})[_0x6fb2('0x27')](function(_0x4f95d2){logger[_0x6fb2('0x23')](_0x6fb2('0x24'),_0x2ec8f3,_0x4f95d2);_0x510d1a(_0x4f95d2);});});}function respondWithStatusCode(_0x2170a2,_0x56dd11){_0x56dd11=_0x56dd11||0xcc;return function(_0x2a67a4){if(_0x2a67a4){return _0x2170a2[_0x6fb2('0x28')](_0x56dd11);}return _0x2170a2[_0x6fb2('0x29')](_0x56dd11)[_0x6fb2('0x2a')]();};}function respondWithResult(_0x2bbe0c,_0x59d458){_0x59d458=_0x59d458||0xc8;return function(_0x45e1f7){if(_0x45e1f7){return _0x2bbe0c[_0x6fb2('0x29')](_0x59d458)[_0x6fb2('0x2b')](_0x45e1f7);}};}function respondWithFilteredResult(_0x3d2499,_0x702b33){return function(_0x168f34){if(_0x168f34){var _0x2844f0=_0x168f34[_0x6fb2('0x2c')],_0x583bea=_0x702b33[_0x6fb2('0x2d')],_0x2ceb8e=_0x702b33[_0x6fb2('0x2d')]+_0x702b33['limit'],_0x4d9487;if(_0x2ceb8e>=_0x2844f0){_0x2ceb8e=_0x2844f0;_0x4d9487=0xc8;}else{_0x4d9487=0xce;}_0x3d2499[_0x6fb2('0x29')](_0x4d9487);return _0x3d2499[_0x6fb2('0x2e')](_0x6fb2('0x2f'),_0x583bea+'-'+_0x2ceb8e+'/'+_0x2844f0)[_0x6fb2('0x2b')](_0x168f34);}return null;};}function patchUpdates(_0x5d62ea){return function(_0x29a802){try{jsonpatch[_0x6fb2('0x30')](_0x29a802,_0x5d62ea,!![]);}catch(_0xf234a1){return BPromise[_0x6fb2('0x31')](_0xf234a1);}return _0x29a802['save']();};}function saveUpdates(_0xf49c66,_0x3ab6af){return function(_0x12591b){if(_0x12591b){return _0x12591b['update'](_0xf49c66)['then'](function(_0x54da67){return _0x54da67;});}return null;};}function removeEntity(_0xb99f1d,_0x298530){return function(_0x31aef8){if(_0x31aef8){return _0x31aef8['destroy']()['then'](function(){_0xb99f1d[_0x6fb2('0x29')](0xcc)[_0x6fb2('0x2a')]();});}};}function handleEntityNotFound(_0x497684,_0xadb0d1){return function(_0x48c0d2){if(!_0x48c0d2){_0x497684['sendStatus'](0x194);}return _0x48c0d2;};}function handleError(_0x398a01,_0x2935c7){_0x2935c7=_0x2935c7||0x1f4;return function(_0x100446){logger[_0x6fb2('0x23')](_0x100446['stack']);if(_0x100446['name']){delete _0x100446[_0x6fb2('0x32')];}_0x398a01[_0x6fb2('0x29')](_0x2935c7)['send'](_0x100446);};}exports[_0x6fb2('0x33')]=function(_0x5d7ca4,_0x1a3067){var _0x2586cb={},_0x431397={},_0x1eed05={'count':0x0,'rows':[]};var _0xe1622d=db[_0x6fb2('0x34')]['rawAttributes'];_0x431397['model']=_[_0x6fb2('0x35')](_0xe1622d);_0x431397[_0x6fb2('0x36')]=_[_0x6fb2('0x35')](_0x5d7ca4[_0x6fb2('0x36')]);_0x431397[_0x6fb2('0x37')]=_[_0x6fb2('0x38')](_0x431397[_0x6fb2('0x39')],_0x431397['query']);_0x2586cb[_0x6fb2('0x3a')]=_[_0x6fb2('0x38')](_0x431397[_0x6fb2('0x39')],qs['fields'](_0x5d7ca4[_0x6fb2('0x36')][_0x6fb2('0x3b')]));_0x2586cb['attributes']=_0x2586cb[_0x6fb2('0x3a')]['length']?_0x2586cb[_0x6fb2('0x3a')]:_0x431397[_0x6fb2('0x39')];if(!_0x5d7ca4['query'][_0x6fb2('0x3c')](_0x6fb2('0x3d'))){_0x2586cb[_0x6fb2('0x3e')]=qs[_0x6fb2('0x3e')](_0x5d7ca4['query']['limit']);_0x2586cb['offset']=qs[_0x6fb2('0x2d')](_0x5d7ca4[_0x6fb2('0x36')][_0x6fb2('0x2d')]);}_0x2586cb['order']=qs[_0x6fb2('0x3f')](_0x5d7ca4['query']['sort']);_0x2586cb[_0x6fb2('0x40')]=qs['filters'](_['pick'](_0x5d7ca4[_0x6fb2('0x36')],_0x431397['filters']));if(_0x5d7ca4['query']['filter']){_0x2586cb[_0x6fb2('0x40')]=_[_0x6fb2('0x41')](_0x2586cb['where'],{'$or':_['map'](_0xe1622d,function(_0x303640){if(_0x303640[_0x6fb2('0x42')][_0x6fb2('0x43')]!==_0x6fb2('0x44')){var _0x3123b6={};_0x3123b6[_0x303640[_0x6fb2('0x45')]]={'$like':'%'+_0x5d7ca4['query'][_0x6fb2('0x46')]+'%'};return _0x3123b6;}})});}_0x2586cb=_['merge']({},_0x2586cb,_0x5d7ca4[_0x6fb2('0x47')]);var _0x26fc81={'where':_0x2586cb[_0x6fb2('0x40')]};return db['Dynamics365Configuration'][_0x6fb2('0x2c')](_0x26fc81)[_0x6fb2('0x1e')](function(_0x48e601){_0x1eed05[_0x6fb2('0x2c')]=_0x48e601;if(_0x5d7ca4['query']['includeAll']){_0x2586cb['include']=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x2586cb);})['then'](function(_0x19c7d9){_0x1eed05[_0x6fb2('0x48')]=_0x19c7d9;return _0x1eed05;})[_0x6fb2('0x1e')](respondWithFilteredResult(_0x1a3067,_0x2586cb))[_0x6fb2('0x27')](handleError(_0x1a3067,null));};exports['show']=function(_0x2d2fd3,_0x2d88d3){var _0x33804a={'raw':![],'where':{'id':_0x2d2fd3[_0x6fb2('0x49')]['id']}},_0x1cbf2a={};_0x1cbf2a['model']=_[_0x6fb2('0x35')](db['Dynamics365Configuration'][_0x6fb2('0x4a')]);_0x1cbf2a['query']=_[_0x6fb2('0x35')](_0x2d2fd3['query']);_0x1cbf2a[_0x6fb2('0x37')]=_[_0x6fb2('0x38')](_0x1cbf2a[_0x6fb2('0x39')],_0x1cbf2a[_0x6fb2('0x36')]);_0x33804a[_0x6fb2('0x3a')]=_['intersection'](_0x1cbf2a[_0x6fb2('0x39')],qs[_0x6fb2('0x3b')](_0x2d2fd3[_0x6fb2('0x36')][_0x6fb2('0x3b')]));_0x33804a[_0x6fb2('0x3a')]=_0x33804a[_0x6fb2('0x3a')][_0x6fb2('0x4b')]?_0x33804a[_0x6fb2('0x3a')]:_0x1cbf2a[_0x6fb2('0x39')];if(_0x2d2fd3[_0x6fb2('0x36')][_0x6fb2('0x4c')]){_0x33804a[_0x6fb2('0x4d')]=[{'all':!![]}];}_0x33804a=_[_0x6fb2('0x41')]({},_0x33804a,_0x2d2fd3[_0x6fb2('0x47')]);return db[_0x6fb2('0x34')]['find'](_0x33804a)[_0x6fb2('0x1e')](handleEntityNotFound(_0x2d88d3,null))['then'](respondWithResult(_0x2d88d3,null))[_0x6fb2('0x27')](handleError(_0x2d88d3,null));};exports[_0x6fb2('0x4e')]=function(_0x1ab1ff,_0x48149e){return db[_0x6fb2('0x34')][_0x6fb2('0x4e')](_0x1ab1ff[_0x6fb2('0x4f')],{})[_0x6fb2('0x1e')](respondWithResult(_0x48149e,0xc9))[_0x6fb2('0x27')](handleError(_0x48149e,null));};exports[_0x6fb2('0x50')]=function(_0x1cafda,_0x3280fe){if(_0x1cafda[_0x6fb2('0x4f')]['id']){delete _0x1cafda[_0x6fb2('0x4f')]['id'];}return db[_0x6fb2('0x34')][_0x6fb2('0x51')]({'where':{'id':_0x1cafda[_0x6fb2('0x49')]['id']}})[_0x6fb2('0x1e')](handleEntityNotFound(_0x3280fe,null))[_0x6fb2('0x1e')](saveUpdates(_0x1cafda[_0x6fb2('0x4f')],null))[_0x6fb2('0x1e')](respondWithResult(_0x3280fe,null))[_0x6fb2('0x27')](handleError(_0x3280fe,null));};exports[_0x6fb2('0x52')]=function(_0x5179c7,_0x2cda28){return db['Dynamics365Configuration'][_0x6fb2('0x51')]({'where':{'id':_0x5179c7[_0x6fb2('0x49')]['id']}})[_0x6fb2('0x1e')](handleEntityNotFound(_0x2cda28,null))[_0x6fb2('0x1e')](removeEntity(_0x2cda28,null))[_0x6fb2('0x27')](handleError(_0x2cda28,null));};exports['getFields']=function(_0x173494,_0xd943ed,_0x57bb4c){var _0x2f1f13={};var _0x288209={};var _0xf9c2a8;var _0x41e84c;return db[_0x6fb2('0x34')]['findOne']({'where':{'id':_0x173494[_0x6fb2('0x49')]['id']}})[_0x6fb2('0x1e')](handleEntityNotFound(_0xd943ed,null))['then'](function(_0x30cb7a){if(_0x30cb7a){_0xf9c2a8=_0x30cb7a;_0x288209[_0x6fb2('0x39')]=_['keys'](db[_0x6fb2('0x53')][_0x6fb2('0x4a')]);_0x288209['query']=_[_0x6fb2('0x35')](_0x173494[_0x6fb2('0x36')]);_0x288209[_0x6fb2('0x37')]=_['intersection'](_0x288209[_0x6fb2('0x39')],_0x288209[_0x6fb2('0x36')]);_0x2f1f13['attributes']=_['intersection'](_0x288209[_0x6fb2('0x39')],qs[_0x6fb2('0x3b')](_0x173494[_0x6fb2('0x36')][_0x6fb2('0x3b')]));_0x2f1f13[_0x6fb2('0x3a')]=_0x2f1f13['attributes']['length']?_0x2f1f13['attributes']:_0x288209['model'];_0x2f1f13[_0x6fb2('0x54')]=qs[_0x6fb2('0x3f')](_0x173494['query']['sort']);_0x2f1f13[_0x6fb2('0x40')]=qs[_0x6fb2('0x37')](_[_0x6fb2('0x55')](_0x173494[_0x6fb2('0x36')],_0x288209['filters']));if(_0x173494[_0x6fb2('0x36')][_0x6fb2('0x46')]){_0x2f1f13[_0x6fb2('0x40')]=_['merge'](_0x2f1f13['where'],{'$or':_[_0x6fb2('0x56')](_0x2f1f13['attributes'],function(_0x1c6e6c){var _0x3eeb16={};_0x3eeb16[_0x1c6e6c]={'$like':'%'+_0x173494[_0x6fb2('0x36')]['filter']+'%'};return _0x3eeb16;})});}_0x2f1f13=_[_0x6fb2('0x41')]({},_0x2f1f13,_0x173494[_0x6fb2('0x47')]);return _0xf9c2a8[_0x6fb2('0x57')](_0x2f1f13);}})['then'](function(_0x140123){if(_0x140123){_0x41e84c=_0x140123[_0x6fb2('0x4b')];if(!_0x173494[_0x6fb2('0x36')][_0x6fb2('0x3c')](_0x6fb2('0x3d'))){_0x2f1f13[_0x6fb2('0x3e')]=qs[_0x6fb2('0x3e')](_0x173494[_0x6fb2('0x36')][_0x6fb2('0x3e')]);_0x2f1f13['offset']=qs['offset'](_0x173494['query'][_0x6fb2('0x2d')]);}return _0xf9c2a8[_0x6fb2('0x57')](_0x2f1f13);}})[_0x6fb2('0x1e')](function(_0x307487){if(_0x307487){return _0x307487?{'count':_0x41e84c,'rows':_0x307487}:null;}})[_0x6fb2('0x1e')](respondWithResult(_0xd943ed,null))[_0x6fb2('0x27')](handleError(_0xd943ed,null));};exports[_0x6fb2('0x58')]=function(_0x427f9c,_0x38a7bf,_0x8dcd72){var _0x1ec4fc={};var _0x399f08={};var _0x2be546;var _0x2bfaff;return db[_0x6fb2('0x34')]['findOne']({'where':{'id':_0x427f9c[_0x6fb2('0x49')]['id']}})['then'](handleEntityNotFound(_0x38a7bf,null))[_0x6fb2('0x1e')](function(_0x48192b){if(_0x48192b){_0x2be546=_0x48192b;_0x399f08[_0x6fb2('0x39')]=_[_0x6fb2('0x35')](db['Dynamics365Field']['rawAttributes']);_0x399f08[_0x6fb2('0x36')]=_[_0x6fb2('0x35')](_0x427f9c[_0x6fb2('0x36')]);_0x399f08[_0x6fb2('0x37')]=_['intersection'](_0x399f08['model'],_0x399f08['query']);_0x1ec4fc[_0x6fb2('0x3a')]=_['intersection'](_0x399f08[_0x6fb2('0x39')],qs[_0x6fb2('0x3b')](_0x427f9c[_0x6fb2('0x36')][_0x6fb2('0x3b')]));_0x1ec4fc[_0x6fb2('0x3a')]=_0x1ec4fc[_0x6fb2('0x3a')][_0x6fb2('0x4b')]?_0x1ec4fc[_0x6fb2('0x3a')]:_0x399f08[_0x6fb2('0x39')];_0x1ec4fc[_0x6fb2('0x54')]=qs[_0x6fb2('0x3f')](_0x427f9c['query']['sort']);_0x1ec4fc['where']=qs['filters'](_[_0x6fb2('0x55')](_0x427f9c['query'],_0x399f08[_0x6fb2('0x37')]));if(_0x427f9c[_0x6fb2('0x36')]['filter']){_0x1ec4fc[_0x6fb2('0x40')]=_['merge'](_0x1ec4fc[_0x6fb2('0x40')],{'$or':_['map'](_0x1ec4fc[_0x6fb2('0x3a')],function(_0x398e2e){var _0x27e0d9={};_0x27e0d9[_0x398e2e]={'$like':'%'+_0x427f9c['query'][_0x6fb2('0x46')]+'%'};return _0x27e0d9;})});}_0x1ec4fc=_['merge']({},_0x1ec4fc,_0x427f9c[_0x6fb2('0x47')]);return _0x2be546[_0x6fb2('0x58')](_0x1ec4fc);}})[_0x6fb2('0x1e')](function(_0x24b0ce){if(_0x24b0ce){_0x2bfaff=_0x24b0ce[_0x6fb2('0x4b')];if(!_0x427f9c['query']['hasOwnProperty'](_0x6fb2('0x3d'))){_0x1ec4fc['limit']=qs[_0x6fb2('0x3e')](_0x427f9c['query'][_0x6fb2('0x3e')]);_0x1ec4fc['offset']=qs[_0x6fb2('0x2d')](_0x427f9c[_0x6fb2('0x36')][_0x6fb2('0x2d')]);}return _0x2be546['getSubjects'](_0x1ec4fc);}})[_0x6fb2('0x1e')](function(_0x47588d){if(_0x47588d){return _0x47588d?{'count':_0x2bfaff,'rows':_0x47588d}:null;}})[_0x6fb2('0x1e')](respondWithResult(_0x38a7bf,null))[_0x6fb2('0x27')](handleError(_0x38a7bf,null));};exports[_0x6fb2('0x59')]=function(_0x32d19b,_0x362aef,_0x3b448b){var _0x3d4528={};var _0x27540a={};var _0x1375be;var _0x1074d0;return db['Dynamics365Configuration'][_0x6fb2('0x5a')]({'where':{'id':_0x32d19b[_0x6fb2('0x49')]['id']}})[_0x6fb2('0x1e')](handleEntityNotFound(_0x362aef,null))[_0x6fb2('0x1e')](function(_0x1d5f2e){if(_0x1d5f2e){_0x1375be=_0x1d5f2e;_0x27540a['model']=_[_0x6fb2('0x35')](db['Dynamics365Field'][_0x6fb2('0x4a')]);_0x27540a[_0x6fb2('0x36')]=_['keys'](_0x32d19b[_0x6fb2('0x36')]);_0x27540a['filters']=_[_0x6fb2('0x38')](_0x27540a[_0x6fb2('0x39')],_0x27540a[_0x6fb2('0x36')]);_0x3d4528[_0x6fb2('0x3a')]=_['intersection'](_0x27540a[_0x6fb2('0x39')],qs[_0x6fb2('0x3b')](_0x32d19b[_0x6fb2('0x36')][_0x6fb2('0x3b')]));_0x3d4528['attributes']=_0x3d4528[_0x6fb2('0x3a')][_0x6fb2('0x4b')]?_0x3d4528['attributes']:_0x27540a[_0x6fb2('0x39')];_0x3d4528[_0x6fb2('0x54')]=qs[_0x6fb2('0x3f')](_0x32d19b[_0x6fb2('0x36')][_0x6fb2('0x3f')]);_0x3d4528['where']=qs[_0x6fb2('0x37')](_[_0x6fb2('0x55')](_0x32d19b[_0x6fb2('0x36')],_0x27540a['filters']));if(_0x32d19b[_0x6fb2('0x36')][_0x6fb2('0x46')]){_0x3d4528[_0x6fb2('0x40')]=_[_0x6fb2('0x41')](_0x3d4528[_0x6fb2('0x40')],{'$or':_['map'](_0x3d4528[_0x6fb2('0x3a')],function(_0x893548){var _0x47afe8={};_0x47afe8[_0x893548]={'$like':'%'+_0x32d19b[_0x6fb2('0x36')][_0x6fb2('0x46')]+'%'};return _0x47afe8;})});}_0x3d4528=_['merge']({},_0x3d4528,_0x32d19b[_0x6fb2('0x47')]);return _0x1375be['getDescriptions'](_0x3d4528);}})['then'](function(_0x11918d){if(_0x11918d){_0x1074d0=_0x11918d[_0x6fb2('0x4b')];if(!_0x32d19b[_0x6fb2('0x36')]['hasOwnProperty']('nolimit')){_0x3d4528[_0x6fb2('0x3e')]=qs[_0x6fb2('0x3e')](_0x32d19b[_0x6fb2('0x36')][_0x6fb2('0x3e')]);_0x3d4528['offset']=qs[_0x6fb2('0x2d')](_0x32d19b['query'][_0x6fb2('0x2d')]);}return _0x1375be[_0x6fb2('0x59')](_0x3d4528);}})[_0x6fb2('0x1e')](function(_0x2ada30){if(_0x2ada30){return _0x2ada30?{'count':_0x1074d0,'rows':_0x2ada30}:null;}})[_0x6fb2('0x1e')](respondWithResult(_0x362aef,null))['catch'](handleError(_0x362aef,null));}; \ No newline at end of file +var _0xff6f=['Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','update','destroy','stack','name','send','index','Dynamics365Configuration','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','show','find','create','body','params','getFields','findOne','Dynamics365Field','rawAttributes','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info'];(function(_0x5295bf,_0x4f17c9){var _0x5ae151=function(_0x136e35){while(--_0x136e35){_0x5295bf['push'](_0x5295bf['shift']());}};_0x5ae151(++_0x4f17c9);}(_0xff6f,0x1a2));var _0xfff6=function(_0x179685,_0x12d01b){_0x179685=_0x179685-0x0;var _0x18efa1=_0xff6f[_0x179685];return _0x18efa1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfff6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfff6('0x1'));var jsonpatch=require(_0xfff6('0x2'));var rp=require(_0xfff6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfff6('0x4'));var util=require('util');var path=require(_0xfff6('0x5'));var sox=require(_0xfff6('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xfff6('0x7'));var squel=require(_0xfff6('0x8'));var crypto=require(_0xfff6('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xfff6('0xa'));var toCsv=require('to-csv');var querystring=require(_0xfff6('0xb'));var Papa=require(_0xfff6('0xc'));var Redis=require(_0xfff6('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xfff6('0xe'));var hardwareService=require(_0xfff6('0xf'));var logger=require(_0xfff6('0x10'))(_0xfff6('0x11'));var utils=require('../../config/utils');var config=require(_0xfff6('0x12'));var db=require(_0xfff6('0x13'))['db'];var jayson=require(_0xfff6('0x14'));var client=jayson[_0xfff6('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x364d7b,_0x528dc3,_0x20e949){if(_0x20e949){var _0x1a2f26=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a2f26[_0xfff6('0x16')](_0x528dc3)){return _0x364d7b;}else{throw new Error(_0xfff6('0x17'));}}else{return _0x364d7b;}}function respondWithRpcPromise(_0x58f70f,_0x4e30cf,_0x13a70e,_0x509697){return new BPromise(function(_0x174df7,_0x424e7e){var _0x4a7f87=_0x509697||client;return _0x4a7f87[_0xfff6('0x18')](_0x58f70f,_0x13a70e)[_0xfff6('0x19')](function(_0x3b4621){logger[_0xfff6('0x1a')](_0xfff6('0x1b'),_0x4e30cf,_0xfff6('0x1c'));logger[_0xfff6('0x1d')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4e30cf,_0xfff6('0x1c'),JSON[_0xfff6('0x1e')](_0x3b4621));if(_0x3b4621[_0xfff6('0x1f')]){if(_0x3b4621[_0xfff6('0x1f')][_0xfff6('0x20')]===0x1f4){logger[_0xfff6('0x1f')](_0xfff6('0x1b'),_0x4e30cf,_0x3b4621[_0xfff6('0x1f')]['message']);return _0x424e7e(_0x3b4621['error']['message']);}logger[_0xfff6('0x1f')](_0xfff6('0x1b'),_0x4e30cf,_0x3b4621[_0xfff6('0x1f')]['message']);return _0x174df7(_0x3b4621[_0xfff6('0x1f')][_0xfff6('0x21')]);}else{logger['info'](_0xfff6('0x1b'),_0x4e30cf,_0xfff6('0x1c'));_0x174df7(_0x3b4621[_0xfff6('0x22')][_0xfff6('0x21')]);}})[_0xfff6('0x23')](function(_0x93b240){logger[_0xfff6('0x1f')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4e30cf,_0x93b240);_0x424e7e(_0x93b240);});});}function respondWithStatusCode(_0x52182e,_0x37b23d){_0x37b23d=_0x37b23d||0xcc;return function(_0xfbabe2){if(_0xfbabe2){return _0x52182e[_0xfff6('0x24')](_0x37b23d);}return _0x52182e['status'](_0x37b23d)[_0xfff6('0x25')]();};}function respondWithResult(_0x4d2599,_0x30eb67){_0x30eb67=_0x30eb67||0xc8;return function(_0x513eed){if(_0x513eed){return _0x4d2599[_0xfff6('0x26')](_0x30eb67)[_0xfff6('0x27')](_0x513eed);}};}function respondWithFilteredResult(_0x2975db,_0x16673a){return function(_0x53b64f){if(_0x53b64f){var _0x471baf=_0x53b64f[_0xfff6('0x28')],_0x21375b=_0x16673a[_0xfff6('0x29')],_0x38c8f9=_0x16673a['offset']+_0x16673a[_0xfff6('0x2a')],_0x3edd56;if(_0x38c8f9>=_0x471baf){_0x38c8f9=_0x471baf;_0x3edd56=0xc8;}else{_0x3edd56=0xce;}_0x2975db['status'](_0x3edd56);return _0x2975db['set'](_0xfff6('0x2b'),_0x21375b+'-'+_0x38c8f9+'/'+_0x471baf)[_0xfff6('0x27')](_0x53b64f);}return null;};}function patchUpdates(_0x118028){return function(_0x2b38ec){try{jsonpatch[_0xfff6('0x2c')](_0x2b38ec,_0x118028,!![]);}catch(_0x22824d){return BPromise[_0xfff6('0x2d')](_0x22824d);}return _0x2b38ec['save']();};}function saveUpdates(_0x2bea23,_0x40e215){return function(_0x5603bf){if(_0x5603bf){return _0x5603bf[_0xfff6('0x2e')](_0x2bea23)[_0xfff6('0x19')](function(_0x233a84){return _0x233a84;});}return null;};}function removeEntity(_0x556a92,_0x5d2fac){return function(_0x598e91){if(_0x598e91){return _0x598e91[_0xfff6('0x2f')]()[_0xfff6('0x19')](function(){_0x556a92[_0xfff6('0x26')](0xcc)[_0xfff6('0x25')]();});}};}function handleEntityNotFound(_0x5b866f,_0x9d72af){return function(_0x2e1088){if(!_0x2e1088){_0x5b866f['sendStatus'](0x194);}return _0x2e1088;};}function handleError(_0x419b24,_0x103d9d){_0x103d9d=_0x103d9d||0x1f4;return function(_0x1f1d54){logger[_0xfff6('0x1f')](_0x1f1d54[_0xfff6('0x30')]);if(_0x1f1d54[_0xfff6('0x31')]){delete _0x1f1d54[_0xfff6('0x31')];}_0x419b24[_0xfff6('0x26')](_0x103d9d)[_0xfff6('0x32')](_0x1f1d54);};}exports[_0xfff6('0x33')]=function(_0xf0b2ce,_0x189693){var _0x4e9223={},_0x168126={},_0x159b35={'count':0x0,'rows':[]};var _0xeeed08=db[_0xfff6('0x34')]['rawAttributes'];_0x168126[_0xfff6('0x35')]=_[_0xfff6('0x36')](_0xeeed08);_0x168126['query']=_[_0xfff6('0x36')](_0xf0b2ce[_0xfff6('0x37')]);_0x168126[_0xfff6('0x38')]=_[_0xfff6('0x39')](_0x168126['model'],_0x168126['query']);_0x4e9223[_0xfff6('0x3a')]=_[_0xfff6('0x39')](_0x168126[_0xfff6('0x35')],qs[_0xfff6('0x3b')](_0xf0b2ce[_0xfff6('0x37')][_0xfff6('0x3b')]));_0x4e9223[_0xfff6('0x3a')]=_0x4e9223[_0xfff6('0x3a')][_0xfff6('0x3c')]?_0x4e9223[_0xfff6('0x3a')]:_0x168126[_0xfff6('0x35')];if(!_0xf0b2ce['query'][_0xfff6('0x3d')](_0xfff6('0x3e'))){_0x4e9223[_0xfff6('0x2a')]=qs['limit'](_0xf0b2ce[_0xfff6('0x37')][_0xfff6('0x2a')]);_0x4e9223['offset']=qs[_0xfff6('0x29')](_0xf0b2ce[_0xfff6('0x37')][_0xfff6('0x29')]);}_0x4e9223[_0xfff6('0x3f')]=qs[_0xfff6('0x40')](_0xf0b2ce[_0xfff6('0x37')][_0xfff6('0x40')]);_0x4e9223[_0xfff6('0x41')]=qs[_0xfff6('0x38')](_[_0xfff6('0x42')](_0xf0b2ce['query'],_0x168126[_0xfff6('0x38')]));if(_0xf0b2ce[_0xfff6('0x37')][_0xfff6('0x43')]){_0x4e9223[_0xfff6('0x41')]=_[_0xfff6('0x44')](_0x4e9223[_0xfff6('0x41')],{'$or':_[_0xfff6('0x45')](_0xeeed08,function(_0x1ea58d){if(_0x1ea58d[_0xfff6('0x46')][_0xfff6('0x47')]!==_0xfff6('0x48')){var _0x337516={};_0x337516[_0x1ea58d[_0xfff6('0x49')]]={'$like':'%'+_0xf0b2ce[_0xfff6('0x37')][_0xfff6('0x43')]+'%'};return _0x337516;}})});}_0x4e9223=_[_0xfff6('0x44')]({},_0x4e9223,_0xf0b2ce[_0xfff6('0x4a')]);var _0x11cd88={'where':_0x4e9223['where']};return db[_0xfff6('0x34')][_0xfff6('0x28')](_0x11cd88)[_0xfff6('0x19')](function(_0x36435c){_0x159b35[_0xfff6('0x28')]=_0x36435c;if(_0xf0b2ce[_0xfff6('0x37')][_0xfff6('0x4b')]){_0x4e9223[_0xfff6('0x4c')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x4e9223);})[_0xfff6('0x19')](function(_0x2731ad){_0x159b35[_0xfff6('0x4d')]=_0x2731ad;return _0x159b35;})['then'](respondWithFilteredResult(_0x189693,_0x4e9223))[_0xfff6('0x23')](handleError(_0x189693,null));};exports[_0xfff6('0x4e')]=function(_0x16fdff,_0x31f2f1){var _0x1d5c1d={'raw':![],'where':{'id':_0x16fdff['params']['id']}},_0x346cb9={};_0x346cb9[_0xfff6('0x35')]=_['keys'](db[_0xfff6('0x34')]['rawAttributes']);_0x346cb9[_0xfff6('0x37')]=_[_0xfff6('0x36')](_0x16fdff[_0xfff6('0x37')]);_0x346cb9[_0xfff6('0x38')]=_[_0xfff6('0x39')](_0x346cb9[_0xfff6('0x35')],_0x346cb9[_0xfff6('0x37')]);_0x1d5c1d[_0xfff6('0x3a')]=_[_0xfff6('0x39')](_0x346cb9[_0xfff6('0x35')],qs[_0xfff6('0x3b')](_0x16fdff[_0xfff6('0x37')][_0xfff6('0x3b')]));_0x1d5c1d[_0xfff6('0x3a')]=_0x1d5c1d[_0xfff6('0x3a')][_0xfff6('0x3c')]?_0x1d5c1d[_0xfff6('0x3a')]:_0x346cb9[_0xfff6('0x35')];if(_0x16fdff[_0xfff6('0x37')][_0xfff6('0x4b')]){_0x1d5c1d[_0xfff6('0x4c')]=[{'all':!![]}];}_0x1d5c1d=_[_0xfff6('0x44')]({},_0x1d5c1d,_0x16fdff[_0xfff6('0x4a')]);return db[_0xfff6('0x34')][_0xfff6('0x4f')](_0x1d5c1d)['then'](handleEntityNotFound(_0x31f2f1,null))[_0xfff6('0x19')](respondWithResult(_0x31f2f1,null))[_0xfff6('0x23')](handleError(_0x31f2f1,null));};exports['create']=function(_0x58a933,_0x4a4c17){return db[_0xfff6('0x34')][_0xfff6('0x50')](_0x58a933['body'],{})[_0xfff6('0x19')](respondWithResult(_0x4a4c17,0xc9))[_0xfff6('0x23')](handleError(_0x4a4c17,null));};exports[_0xfff6('0x2e')]=function(_0x2bb2a1,_0x5c1713){if(_0x2bb2a1['body']['id']){delete _0x2bb2a1[_0xfff6('0x51')]['id'];}return db['Dynamics365Configuration'][_0xfff6('0x4f')]({'where':{'id':_0x2bb2a1[_0xfff6('0x52')]['id']}})[_0xfff6('0x19')](handleEntityNotFound(_0x5c1713,null))[_0xfff6('0x19')](saveUpdates(_0x2bb2a1[_0xfff6('0x51')],null))[_0xfff6('0x19')](respondWithResult(_0x5c1713,null))[_0xfff6('0x23')](handleError(_0x5c1713,null));};exports[_0xfff6('0x2f')]=function(_0x18ee6d,_0xae5e5a){return db[_0xfff6('0x34')][_0xfff6('0x4f')]({'where':{'id':_0x18ee6d[_0xfff6('0x52')]['id']}})[_0xfff6('0x19')](handleEntityNotFound(_0xae5e5a,null))[_0xfff6('0x19')](removeEntity(_0xae5e5a,null))['catch'](handleError(_0xae5e5a,null));};exports[_0xfff6('0x53')]=function(_0x167537,_0x4cf16b,_0x567de8){var _0x35d97d={};var _0x147e52={};var _0x244eba;var _0x57bc86;return db[_0xfff6('0x34')][_0xfff6('0x54')]({'where':{'id':_0x167537[_0xfff6('0x52')]['id']}})[_0xfff6('0x19')](handleEntityNotFound(_0x4cf16b,null))['then'](function(_0x254002){if(_0x254002){_0x244eba=_0x254002;_0x147e52[_0xfff6('0x35')]=_[_0xfff6('0x36')](db[_0xfff6('0x55')][_0xfff6('0x56')]);_0x147e52[_0xfff6('0x37')]=_[_0xfff6('0x36')](_0x167537[_0xfff6('0x37')]);_0x147e52[_0xfff6('0x38')]=_[_0xfff6('0x39')](_0x147e52['model'],_0x147e52[_0xfff6('0x37')]);_0x35d97d['attributes']=_['intersection'](_0x147e52[_0xfff6('0x35')],qs[_0xfff6('0x3b')](_0x167537[_0xfff6('0x37')][_0xfff6('0x3b')]));_0x35d97d[_0xfff6('0x3a')]=_0x35d97d[_0xfff6('0x3a')]['length']?_0x35d97d[_0xfff6('0x3a')]:_0x147e52['model'];_0x35d97d[_0xfff6('0x3f')]=qs[_0xfff6('0x40')](_0x167537['query'][_0xfff6('0x40')]);_0x35d97d['where']=qs[_0xfff6('0x38')](_['pick'](_0x167537[_0xfff6('0x37')],_0x147e52[_0xfff6('0x38')]));if(_0x167537[_0xfff6('0x37')][_0xfff6('0x43')]){_0x35d97d[_0xfff6('0x41')]=_[_0xfff6('0x44')](_0x35d97d[_0xfff6('0x41')],{'$or':_[_0xfff6('0x45')](_0x35d97d['attributes'],function(_0x2d215b){var _0x5065cb={};_0x5065cb[_0x2d215b]={'$like':'%'+_0x167537[_0xfff6('0x37')][_0xfff6('0x43')]+'%'};return _0x5065cb;})});}_0x35d97d=_[_0xfff6('0x44')]({},_0x35d97d,_0x167537['options']);return _0x244eba[_0xfff6('0x53')](_0x35d97d);}})['then'](function(_0x3f2672){if(_0x3f2672){_0x57bc86=_0x3f2672[_0xfff6('0x3c')];if(!_0x167537[_0xfff6('0x37')]['hasOwnProperty'](_0xfff6('0x3e'))){_0x35d97d[_0xfff6('0x2a')]=qs[_0xfff6('0x2a')](_0x167537[_0xfff6('0x37')][_0xfff6('0x2a')]);_0x35d97d[_0xfff6('0x29')]=qs['offset'](_0x167537['query'][_0xfff6('0x29')]);}return _0x244eba['getFields'](_0x35d97d);}})[_0xfff6('0x19')](function(_0x129b1){if(_0x129b1){return _0x129b1?{'count':_0x57bc86,'rows':_0x129b1}:null;}})[_0xfff6('0x19')](respondWithResult(_0x4cf16b,null))[_0xfff6('0x23')](handleError(_0x4cf16b,null));};exports['getSubjects']=function(_0x35b831,_0x3ec9fe,_0x19b1a6){var _0x34e3d3={};var _0x4408c7={};var _0x503be3;var _0x300033;return db[_0xfff6('0x34')][_0xfff6('0x54')]({'where':{'id':_0x35b831[_0xfff6('0x52')]['id']}})['then'](handleEntityNotFound(_0x3ec9fe,null))[_0xfff6('0x19')](function(_0x106ed0){if(_0x106ed0){_0x503be3=_0x106ed0;_0x4408c7[_0xfff6('0x35')]=_[_0xfff6('0x36')](db[_0xfff6('0x55')][_0xfff6('0x56')]);_0x4408c7[_0xfff6('0x37')]=_[_0xfff6('0x36')](_0x35b831[_0xfff6('0x37')]);_0x4408c7[_0xfff6('0x38')]=_[_0xfff6('0x39')](_0x4408c7[_0xfff6('0x35')],_0x4408c7[_0xfff6('0x37')]);_0x34e3d3[_0xfff6('0x3a')]=_[_0xfff6('0x39')](_0x4408c7[_0xfff6('0x35')],qs['fields'](_0x35b831[_0xfff6('0x37')][_0xfff6('0x3b')]));_0x34e3d3['attributes']=_0x34e3d3[_0xfff6('0x3a')][_0xfff6('0x3c')]?_0x34e3d3[_0xfff6('0x3a')]:_0x4408c7[_0xfff6('0x35')];_0x34e3d3[_0xfff6('0x3f')]=qs[_0xfff6('0x40')](_0x35b831[_0xfff6('0x37')][_0xfff6('0x40')]);_0x34e3d3['where']=qs[_0xfff6('0x38')](_[_0xfff6('0x42')](_0x35b831[_0xfff6('0x37')],_0x4408c7[_0xfff6('0x38')]));if(_0x35b831[_0xfff6('0x37')][_0xfff6('0x43')]){_0x34e3d3['where']=_['merge'](_0x34e3d3[_0xfff6('0x41')],{'$or':_[_0xfff6('0x45')](_0x34e3d3['attributes'],function(_0x3c4cb9){var _0x125e7a={};_0x125e7a[_0x3c4cb9]={'$like':'%'+_0x35b831[_0xfff6('0x37')][_0xfff6('0x43')]+'%'};return _0x125e7a;})});}_0x34e3d3=_['merge']({},_0x34e3d3,_0x35b831[_0xfff6('0x4a')]);return _0x503be3[_0xfff6('0x57')](_0x34e3d3);}})[_0xfff6('0x19')](function(_0x23da61){if(_0x23da61){_0x300033=_0x23da61[_0xfff6('0x3c')];if(!_0x35b831[_0xfff6('0x37')][_0xfff6('0x3d')](_0xfff6('0x3e'))){_0x34e3d3['limit']=qs[_0xfff6('0x2a')](_0x35b831[_0xfff6('0x37')][_0xfff6('0x2a')]);_0x34e3d3[_0xfff6('0x29')]=qs[_0xfff6('0x29')](_0x35b831[_0xfff6('0x37')][_0xfff6('0x29')]);}return _0x503be3[_0xfff6('0x57')](_0x34e3d3);}})[_0xfff6('0x19')](function(_0x36aa60){if(_0x36aa60){return _0x36aa60?{'count':_0x300033,'rows':_0x36aa60}:null;}})['then'](respondWithResult(_0x3ec9fe,null))['catch'](handleError(_0x3ec9fe,null));};exports[_0xfff6('0x58')]=function(_0x34fa05,_0x385621,_0x1da06e){var _0xa2ca14={};var _0x3d8cca={};var _0x26716f;var _0x547bdd;return db[_0xfff6('0x34')]['findOne']({'where':{'id':_0x34fa05['params']['id']}})[_0xfff6('0x19')](handleEntityNotFound(_0x385621,null))[_0xfff6('0x19')](function(_0x503ccb){if(_0x503ccb){_0x26716f=_0x503ccb;_0x3d8cca['model']=_[_0xfff6('0x36')](db[_0xfff6('0x55')][_0xfff6('0x56')]);_0x3d8cca[_0xfff6('0x37')]=_[_0xfff6('0x36')](_0x34fa05[_0xfff6('0x37')]);_0x3d8cca[_0xfff6('0x38')]=_[_0xfff6('0x39')](_0x3d8cca[_0xfff6('0x35')],_0x3d8cca[_0xfff6('0x37')]);_0xa2ca14[_0xfff6('0x3a')]=_['intersection'](_0x3d8cca[_0xfff6('0x35')],qs[_0xfff6('0x3b')](_0x34fa05[_0xfff6('0x37')][_0xfff6('0x3b')]));_0xa2ca14[_0xfff6('0x3a')]=_0xa2ca14[_0xfff6('0x3a')][_0xfff6('0x3c')]?_0xa2ca14[_0xfff6('0x3a')]:_0x3d8cca[_0xfff6('0x35')];_0xa2ca14[_0xfff6('0x3f')]=qs[_0xfff6('0x40')](_0x34fa05[_0xfff6('0x37')]['sort']);_0xa2ca14[_0xfff6('0x41')]=qs[_0xfff6('0x38')](_[_0xfff6('0x42')](_0x34fa05[_0xfff6('0x37')],_0x3d8cca[_0xfff6('0x38')]));if(_0x34fa05[_0xfff6('0x37')][_0xfff6('0x43')]){_0xa2ca14[_0xfff6('0x41')]=_[_0xfff6('0x44')](_0xa2ca14[_0xfff6('0x41')],{'$or':_[_0xfff6('0x45')](_0xa2ca14[_0xfff6('0x3a')],function(_0x5ab873){var _0x79b64={};_0x79b64[_0x5ab873]={'$like':'%'+_0x34fa05[_0xfff6('0x37')][_0xfff6('0x43')]+'%'};return _0x79b64;})});}_0xa2ca14=_['merge']({},_0xa2ca14,_0x34fa05[_0xfff6('0x4a')]);return _0x26716f[_0xfff6('0x58')](_0xa2ca14);}})['then'](function(_0x27d1f5){if(_0x27d1f5){_0x547bdd=_0x27d1f5[_0xfff6('0x3c')];if(!_0x34fa05[_0xfff6('0x37')][_0xfff6('0x3d')](_0xfff6('0x3e'))){_0xa2ca14['limit']=qs[_0xfff6('0x2a')](_0x34fa05[_0xfff6('0x37')][_0xfff6('0x2a')]);_0xa2ca14['offset']=qs[_0xfff6('0x29')](_0x34fa05[_0xfff6('0x37')]['offset']);}return _0x26716f[_0xfff6('0x58')](_0xa2ca14);}})[_0xfff6('0x19')](function(_0x32e91b){if(_0x32e91b){return _0x32e91b?{'count':_0x547bdd,'rows':_0x32e91b}:null;}})[_0xfff6('0x19')](respondWithResult(_0x385621,null))['catch'](handleError(_0x385621,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 1592210..e6f0345 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 _0xa2e7=['api','moment','bluebird','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger'];(function(_0x57bb3a,_0x237ede){var _0x5decaa=function(_0x262a8f){while(--_0x262a8f){_0x57bb3a['push'](_0x57bb3a['shift']());}};_0x5decaa(++_0x237ede);}(_0xa2e7,0x185));var _0x7a2e=function(_0x92643c,_0x2ed329){_0x92643c=_0x92643c-0x0;var _0x274aa2=_0xa2e7[_0x92643c];return _0x274aa2;};'use strict';var _=require(_0x7a2e('0x0'));var util=require(_0x7a2e('0x1'));var logger=require(_0x7a2e('0x2'))(_0x7a2e('0x3'));var moment=require(_0x7a2e('0x4'));var BPromise=require(_0x7a2e('0x5'));var rp=require(_0x7a2e('0x6'));var fs=require('fs');var path=require(_0x7a2e('0x7'));var rimraf=require('rimraf');var config=require(_0x7a2e('0x8'));var attributes=require(_0x7a2e('0x9'));module[_0x7a2e('0xa')]=function(_0x4b942d,_0x253ae2){return _0x4b942d[_0x7a2e('0xb')](_0x7a2e('0xc'),attributes,{'tableName':_0x7a2e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c1a=['bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api'];(function(_0x1d2f15,_0x1107c6){var _0x19efd2=function(_0x5e7bf7){while(--_0x5e7bf7){_0x1d2f15['push'](_0x1d2f15['shift']());}};_0x19efd2(++_0x1107c6);}(_0x2c1a,0x96));var _0xa2c1=function(_0x18f784,_0x2a538f){_0x18f784=_0x18f784-0x0;var _0x4cd072=_0x2c1a[_0x18f784];return _0x4cd072;};'use strict';var _=require(_0xa2c1('0x0'));var util=require(_0xa2c1('0x1'));var logger=require(_0xa2c1('0x2'))(_0xa2c1('0x3'));var moment=require('moment');var BPromise=require(_0xa2c1('0x4'));var rp=require(_0xa2c1('0x5'));var fs=require('fs');var path=require(_0xa2c1('0x6'));var rimraf=require(_0xa2c1('0x7'));var config=require(_0xa2c1('0x8'));var attributes=require(_0xa2c1('0x9'));module[_0xa2c1('0xa')]=function(_0x5b5ed6,_0x861045){return _0x5b5ed6[_0xa2c1('0xb')](_0xa2c1('0xc'),attributes,{'tableName':_0xa2c1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index cc88516..0d34691 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 _0x4d0b=['http','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d0b,0x199));var _0xb4d0=function(_0x133cce,_0x55bf43){_0x133cce=_0x133cce-0x0;var _0x5f370a=_0x4d0b[_0x133cce];return _0x5f370a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb4d0('0x0'));var BPromise=require(_0xb4d0('0x1'));var rs=require(_0xb4d0('0x2'));var fs=require('fs');var Redis=require(_0xb4d0('0x3'));var db=require(_0xb4d0('0x4'))['db'];var utils=require(_0xb4d0('0x5'));var logger=require(_0xb4d0('0x6'))(_0xb4d0('0x7'));var config=require(_0xb4d0('0x8'));var jayson=require(_0xb4d0('0x9'));var client=jayson[_0xb4d0('0xa')][_0xb4d0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x530038,_0x159163,_0x3cab52){return new BPromise(function(_0x12e598,_0xe724ec){return client['request'](_0x530038,_0x3cab52)['then'](function(_0x128f0e){logger[_0xb4d0('0xc')](_0xb4d0('0xd'),_0x159163,_0xb4d0('0xe'));logger[_0xb4d0('0xf')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x159163,_0xb4d0('0xe'),JSON['stringify'](_0x128f0e));if(_0x128f0e[_0xb4d0('0x10')]){if(_0x128f0e['error'][_0xb4d0('0x11')]===0x1f4){logger['error'](_0xb4d0('0xd'),_0x159163,_0x128f0e[_0xb4d0('0x10')][_0xb4d0('0x12')]);return _0xe724ec(_0x128f0e[_0xb4d0('0x10')][_0xb4d0('0x12')]);}logger['error'](_0xb4d0('0xd'),_0x159163,_0x128f0e[_0xb4d0('0x10')][_0xb4d0('0x12')]);return _0x12e598(_0x128f0e[_0xb4d0('0x10')][_0xb4d0('0x12')]);}else{logger[_0xb4d0('0xc')](_0xb4d0('0xd'),_0x159163,_0xb4d0('0xe'));_0x12e598(_0x128f0e[_0xb4d0('0x13')][_0xb4d0('0x12')]);}})[_0xb4d0('0x14')](function(_0x42a7c1){logger['error'](_0xb4d0('0xd'),_0x159163,_0x42a7c1);_0xe724ec(_0x42a7c1);});});} \ No newline at end of file +var _0x7ca9=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x54816f,_0xb429da){var _0x45c7e7=function(_0x430c92){while(--_0x430c92){_0x54816f['push'](_0x54816f['shift']());}};_0x45c7e7(++_0xb429da);}(_0x7ca9,0x15c));var _0x97ca=function(_0x5358cd,_0x293fd6){_0x5358cd=_0x5358cd-0x0;var _0xc144e2=_0x7ca9[_0x5358cd];return _0xc144e2;};'use strict';var _=require(_0x97ca('0x0'));var util=require(_0x97ca('0x1'));var moment=require(_0x97ca('0x2'));var BPromise=require(_0x97ca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x97ca('0x4'));var db=require(_0x97ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x97ca('0x6'))('rpc');var config=require(_0x97ca('0x7'));var jayson=require(_0x97ca('0x8'));var client=jayson[_0x97ca('0x9')][_0x97ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40de09,_0x591a64,_0x1a9cc6){return new BPromise(function(_0x5df73f,_0x505e11){return client[_0x97ca('0xb')](_0x40de09,_0x1a9cc6)['then'](function(_0x30a484){logger[_0x97ca('0xc')](_0x97ca('0xd'),_0x591a64,_0x97ca('0xe'));logger[_0x97ca('0xf')](_0x97ca('0x10'),_0x591a64,_0x97ca('0xe'),JSON[_0x97ca('0x11')](_0x30a484));if(_0x30a484[_0x97ca('0x12')]){if(_0x30a484[_0x97ca('0x12')][_0x97ca('0x13')]===0x1f4){logger[_0x97ca('0x12')](_0x97ca('0xd'),_0x591a64,_0x30a484[_0x97ca('0x12')][_0x97ca('0x14')]);return _0x505e11(_0x30a484[_0x97ca('0x12')][_0x97ca('0x14')]);}logger[_0x97ca('0x12')](_0x97ca('0xd'),_0x591a64,_0x30a484['error'][_0x97ca('0x14')]);return _0x5df73f(_0x30a484[_0x97ca('0x12')]['message']);}else{logger[_0x97ca('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x591a64,_0x97ca('0xe'));_0x5df73f(_0x30a484[_0x97ca('0x15')][_0x97ca('0x14')]);}})[_0x97ca('0x16')](function(_0x39861b){logger[_0x97ca('0x12')](_0x97ca('0xd'),_0x591a64,_0x39861b);_0x505e11(_0x39861b);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index d245379..8753952 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 _0x41bb=['util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer'];(function(_0x1bee7a,_0xacfa2a){var _0x5d69d7=function(_0x3b8891){while(--_0x3b8891){_0x1bee7a['push'](_0x1bee7a['shift']());}};_0x5d69d7(++_0xacfa2a);}(_0x41bb,0xc5));var _0xb41b=function(_0x34d408,_0x32ec83){_0x34d408=_0x34d408-0x0;var _0x20366c=_0x41bb[_0x34d408];return _0x20366c;};'use strict';var multer=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var path=require('path');var timeout=require(_0xb41b('0x2'));var express=require('express');var router=express[_0xb41b('0x3')]();var auth=require(_0xb41b('0x4'));var interaction=require(_0xb41b('0x5'));var config=require(_0xb41b('0x6'));var controller=require('./intDynamics365Field.controller');router[_0xb41b('0x7')]('/',auth[_0xb41b('0x8')](),controller[_0xb41b('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb41b('0xa')]);router[_0xb41b('0xb')]('/',auth['isAuthenticated'](),controller[_0xb41b('0xc')]);router[_0xb41b('0xd')](_0xb41b('0xe'),auth[_0xb41b('0x8')](),controller[_0xb41b('0xf')]);router[_0xb41b('0x10')](_0xb41b('0xe'),auth['isAuthenticated'](),controller[_0xb41b('0x11')]);module['exports']=router; \ No newline at end of file +var _0xfc03=['get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller'];(function(_0xb6a6ef,_0x4bc4a7){var _0x193c21=function(_0x52550a){while(--_0x52550a){_0xb6a6ef['push'](_0xb6a6ef['shift']());}};_0x193c21(++_0x4bc4a7);}(_0xfc03,0x16f));var _0x3fc0=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xfc03[_0x411017];return _0x2adeea;};'use strict';var multer=require(_0x3fc0('0x0'));var util=require('util');var path=require(_0x3fc0('0x1'));var timeout=require(_0x3fc0('0x2'));var express=require('express');var router=express[_0x3fc0('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x3fc0('0x4'));var config=require(_0x3fc0('0x5'));var controller=require(_0x3fc0('0x6'));router[_0x3fc0('0x7')]('/',auth[_0x3fc0('0x8')](),controller[_0x3fc0('0x9')]);router[_0x3fc0('0x7')](_0x3fc0('0xa'),auth['isAuthenticated'](),controller[_0x3fc0('0xb')]);router['post']('/',auth[_0x3fc0('0x8')](),controller[_0x3fc0('0xc')]);router[_0x3fc0('0xd')](_0x3fc0('0xa'),auth['isAuthenticated'](),controller[_0x3fc0('0xe')]);router[_0x3fc0('0xf')](_0x3fc0('0xa'),auth[_0x3fc0('0x8')](),controller[_0x3fc0('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 9b9d86e..9bfbbc2 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 _0x92e8=['BOOLEAN','sequelize','exports','string','variable','keyValue','STRING'];(function(_0x54d713,_0x3f0308){var _0x1d309e=function(_0x32de7a){while(--_0x32de7a){_0x54d713['push'](_0x54d713['shift']());}};_0x1d309e(++_0x3f0308);}(_0x92e8,0x1b3));var _0x892e=function(_0x246f0c,_0x39f734){_0x246f0c=_0x246f0c-0x0;var _0x30fe50=_0x92e8[_0x246f0c];return _0x30fe50;};'use strict';var Sequelize=require(_0x892e('0x0'));module[_0x892e('0x1')]={'type':{'type':Sequelize['ENUM'](_0x892e('0x2'),_0x892e('0x3'),'customVariable',_0x892e('0x4')),'defaultValue':_0x892e('0x2')},'content':{'type':Sequelize[_0x892e('0x5')]},'key':{'type':Sequelize[_0x892e('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x892e('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x892e('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x892e('0x5')]},'customField':{'type':Sequelize[_0x892e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x892e('0x5')]}}; \ No newline at end of file +var _0x136c=['string','variable','customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize','exports'];(function(_0x3ad7ad,_0x291a8d){var _0x225a60=function(_0xca7354){while(--_0xca7354){_0x3ad7ad['push'](_0x3ad7ad['shift']());}};_0x225a60(++_0x291a8d);}(_0x136c,0x1d2));var _0xc136=function(_0x509024,_0x5e6c3d){_0x509024=_0x509024-0x0;var _0x5c36e8=_0x136c[_0x509024];return _0x5c36e8;};'use strict';var Sequelize=require(_0xc136('0x0'));module[_0xc136('0x1')]={'type':{'type':Sequelize['ENUM'](_0xc136('0x2'),_0xc136('0x3'),_0xc136('0x4'),_0xc136('0x5')),'defaultValue':_0xc136('0x2')},'content':{'type':Sequelize[_0xc136('0x6')]},'key':{'type':Sequelize[_0xc136('0x6')]},'keyType':{'type':Sequelize[_0xc136('0x7')](_0xc136('0x2'),'variable',_0xc136('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc136('0x6')]},'nameField':{'type':Sequelize[_0xc136('0x6')]},'customField':{'type':Sequelize[_0xc136('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 304b795..fe0875c 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 _0xe40a=['ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','then','error','name','send','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','Dynamics365Field','rows','catch','params','find','create','body','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','papaparse'];(function(_0x373ded,_0x3b329f){var _0x1eaecb=function(_0x10da64){while(--_0x10da64){_0x373ded['push'](_0x373ded['shift']());}};_0x1eaecb(++_0x3b329f);}(_0xe40a,0x134));var _0xae40=function(_0x4ed5a4,_0x55ebbb){_0x4ed5a4=_0x4ed5a4-0x0;var _0x179981=_0xe40a[_0x4ed5a4];return _0x179981;};'use strict';var pdf=require(_0xae40('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xae40('0x1'));var jsonpatch=require(_0xae40('0x2'));var rp=require(_0xae40('0x3'));var moment=require(_0xae40('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xae40('0x5'));var util=require(_0xae40('0x6'));var path=require('path');var sox=require(_0xae40('0x7'));var csv=require(_0xae40('0x8'));var ejs=require(_0xae40('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xae40('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xae40('0x8'));var querystring=require('querystring');var Papa=require(_0xae40('0xb'));var Redis=require(_0xae40('0xc'));var authService=require(_0xae40('0xd'));var qs=require(_0xae40('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xae40('0xf'));var utils=require(_0xae40('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x376cf7,_0x1c140b){_0x1c140b=_0x1c140b||0xcc;return function(_0x15fd7e){if(_0x15fd7e){return _0x376cf7[_0xae40('0x11')](_0x1c140b);}return _0x376cf7[_0xae40('0x12')](_0x1c140b)[_0xae40('0x13')]();};}function respondWithResult(_0x1df53d,_0x45a102){_0x45a102=_0x45a102||0xc8;return function(_0x131de4){if(_0x131de4){return _0x1df53d['status'](_0x45a102)[_0xae40('0x14')](_0x131de4);}};}function respondWithFilteredResult(_0x419729,_0x3c3783){return function(_0x2d88ce){if(_0x2d88ce){var _0x1d383a=_0x2d88ce[_0xae40('0x15')],_0x5a11f3=_0x3c3783[_0xae40('0x16')],_0x497c54=_0x3c3783['offset']+_0x3c3783[_0xae40('0x17')],_0xfb9d45;if(_0x497c54>=_0x1d383a){_0x497c54=_0x1d383a;_0xfb9d45=0xc8;}else{_0xfb9d45=0xce;}_0x419729[_0xae40('0x12')](_0xfb9d45);return _0x419729[_0xae40('0x18')](_0xae40('0x19'),_0x5a11f3+'-'+_0x497c54+'/'+_0x1d383a)['json'](_0x2d88ce);}return null;};}function patchUpdates(_0x53a6d9){return function(_0x1857e7){try{jsonpatch['apply'](_0x1857e7,_0x53a6d9,!![]);}catch(_0x303872){return BPromise[_0xae40('0x1a')](_0x303872);}return _0x1857e7[_0xae40('0x1b')]();};}function saveUpdates(_0x3e1d7f,_0x4c228e){return function(_0x4c124e){if(_0x4c124e){return _0x4c124e['update'](_0x3e1d7f)['then'](function(_0xde50e4){return _0xde50e4;});}return null;};}function removeEntity(_0x34b4d1,_0x1dd2e0){return function(_0x1338f9){if(_0x1338f9){return _0x1338f9[_0xae40('0x1c')]()[_0xae40('0x1d')](function(){_0x34b4d1['status'](0xcc)[_0xae40('0x13')]();});}};}function handleEntityNotFound(_0x49abf5,_0x5a011b){return function(_0x120742){if(!_0x120742){_0x49abf5['sendStatus'](0x194);}return _0x120742;};}function handleError(_0x2c6e54,_0x2fa82a){_0x2fa82a=_0x2fa82a||0x1f4;return function(_0x3f51f8){logger[_0xae40('0x1e')](_0x3f51f8['stack']);if(_0x3f51f8[_0xae40('0x1f')]){delete _0x3f51f8['name'];}_0x2c6e54[_0xae40('0x12')](_0x2fa82a)[_0xae40('0x20')](_0x3f51f8);};}exports['index']=function(_0x517db0,_0x2e9f66){var _0x20e73f={},_0x1bf13e={},_0x3059dd={'count':0x0,'rows':[]};var _0xafa3d4=db['Dynamics365Field'][_0xae40('0x21')];_0x1bf13e['model']=_[_0xae40('0x22')](_0xafa3d4);_0x1bf13e[_0xae40('0x23')]=_[_0xae40('0x22')](_0x517db0[_0xae40('0x23')]);_0x1bf13e[_0xae40('0x24')]=_[_0xae40('0x25')](_0x1bf13e[_0xae40('0x26')],_0x1bf13e['query']);_0x20e73f[_0xae40('0x27')]=_[_0xae40('0x25')](_0x1bf13e[_0xae40('0x26')],qs[_0xae40('0x28')](_0x517db0[_0xae40('0x23')][_0xae40('0x28')]));_0x20e73f[_0xae40('0x27')]=_0x20e73f[_0xae40('0x27')][_0xae40('0x29')]?_0x20e73f[_0xae40('0x27')]:_0x1bf13e[_0xae40('0x26')];if(!_0x517db0[_0xae40('0x23')][_0xae40('0x2a')](_0xae40('0x2b'))){_0x20e73f[_0xae40('0x17')]=qs[_0xae40('0x17')](_0x517db0[_0xae40('0x23')][_0xae40('0x17')]);_0x20e73f[_0xae40('0x16')]=qs['offset'](_0x517db0[_0xae40('0x23')][_0xae40('0x16')]);}_0x20e73f[_0xae40('0x2c')]=qs[_0xae40('0x2d')](_0x517db0[_0xae40('0x23')][_0xae40('0x2d')]);_0x20e73f[_0xae40('0x2e')]=qs[_0xae40('0x24')](_['pick'](_0x517db0['query'],_0x1bf13e[_0xae40('0x24')]));if(_0x517db0[_0xae40('0x23')][_0xae40('0x2f')]){_0x20e73f[_0xae40('0x2e')]=_[_0xae40('0x30')](_0x20e73f['where'],{'$or':_[_0xae40('0x31')](_0xafa3d4,function(_0x4e3b1e){if(_0x4e3b1e[_0xae40('0x32')][_0xae40('0x33')]!==_0xae40('0x34')){var _0x21a28b={};_0x21a28b[_0x4e3b1e[_0xae40('0x35')]]={'$like':'%'+_0x517db0[_0xae40('0x23')][_0xae40('0x2f')]+'%'};return _0x21a28b;}})});}_0x20e73f=_[_0xae40('0x30')]({},_0x20e73f,_0x517db0[_0xae40('0x36')]);var _0x338066={'where':_0x20e73f[_0xae40('0x2e')]};return db['Dynamics365Field'][_0xae40('0x15')](_0x338066)['then'](function(_0x4f6ab1){_0x3059dd[_0xae40('0x15')]=_0x4f6ab1;if(_0x517db0[_0xae40('0x23')][_0xae40('0x37')]){_0x20e73f[_0xae40('0x38')]=[{'all':!![]}];}return db[_0xae40('0x39')]['findAll'](_0x20e73f);})['then'](function(_0x13c396){_0x3059dd[_0xae40('0x3a')]=_0x13c396;return _0x3059dd;})[_0xae40('0x1d')](respondWithFilteredResult(_0x2e9f66,_0x20e73f))[_0xae40('0x3b')](handleError(_0x2e9f66,null));};exports['show']=function(_0x1e10ab,_0x9feff6){var _0x4f2c48={'raw':!![],'where':{'id':_0x1e10ab[_0xae40('0x3c')]['id']}},_0x47de96={};_0x47de96['model']=_[_0xae40('0x22')](db[_0xae40('0x39')][_0xae40('0x21')]);_0x47de96[_0xae40('0x23')]=_[_0xae40('0x22')](_0x1e10ab[_0xae40('0x23')]);_0x47de96[_0xae40('0x24')]=_[_0xae40('0x25')](_0x47de96[_0xae40('0x26')],_0x47de96[_0xae40('0x23')]);_0x4f2c48[_0xae40('0x27')]=_[_0xae40('0x25')](_0x47de96[_0xae40('0x26')],qs['fields'](_0x1e10ab[_0xae40('0x23')][_0xae40('0x28')]));_0x4f2c48[_0xae40('0x27')]=_0x4f2c48[_0xae40('0x27')][_0xae40('0x29')]?_0x4f2c48[_0xae40('0x27')]:_0x47de96['model'];if(_0x1e10ab['query']['includeAll']){_0x4f2c48[_0xae40('0x38')]=[{'all':!![]}];}_0x4f2c48=_[_0xae40('0x30')]({},_0x4f2c48,_0x1e10ab['options']);return db[_0xae40('0x39')][_0xae40('0x3d')](_0x4f2c48)[_0xae40('0x1d')](handleEntityNotFound(_0x9feff6,null))[_0xae40('0x1d')](respondWithResult(_0x9feff6,null))['catch'](handleError(_0x9feff6,null));};exports[_0xae40('0x3e')]=function(_0xc03fd0,_0x580fe0){return db[_0xae40('0x39')]['create'](_0xc03fd0['body'],{})['then'](respondWithResult(_0x580fe0,0xc9))[_0xae40('0x3b')](handleError(_0x580fe0,null));};exports['update']=function(_0x2ed3bc,_0x43c970){if(_0x2ed3bc[_0xae40('0x3f')]['id']){delete _0x2ed3bc[_0xae40('0x3f')]['id'];}return db[_0xae40('0x39')][_0xae40('0x3d')]({'where':{'id':_0x2ed3bc[_0xae40('0x3c')]['id']}})[_0xae40('0x1d')](handleEntityNotFound(_0x43c970,null))[_0xae40('0x1d')](saveUpdates(_0x2ed3bc[_0xae40('0x3f')],null))['then'](respondWithResult(_0x43c970,null))['catch'](handleError(_0x43c970,null));};exports[_0xae40('0x1c')]=function(_0x45589b,_0x7f149b){return db[_0xae40('0x39')]['find']({'where':{'id':_0x45589b[_0xae40('0x3c')]['id']}})['then'](handleEntityNotFound(_0x7f149b,null))[_0xae40('0x1d')](removeEntity(_0x7f149b,null))['catch'](handleError(_0x7f149b,null));}; \ No newline at end of file +var _0xe880=['keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','Dynamics365Field','count','includeAll','findAll','show','include','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','set','apply','reject','save','update','then','destroy','error','stack','index','rawAttributes'];(function(_0x54a28a,_0x1ba1fe){var _0x3da1f1=function(_0x7231b5){while(--_0x7231b5){_0x54a28a['push'](_0x54a28a['shift']());}};_0x3da1f1(++_0x1ba1fe);}(_0xe880,0x145));var _0x0e88=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xe880[_0x47fd36];return _0x21a0fc;};'use strict';var pdf=require(_0x0e88('0x0'));var emlformat=require(_0x0e88('0x1'));var rimraf=require(_0x0e88('0x2'));var zipdir=require(_0x0e88('0x3'));var jsonpatch=require(_0x0e88('0x4'));var rp=require(_0x0e88('0x5'));var moment=require(_0x0e88('0x6'));var BPromise=require(_0x0e88('0x7'));var Mustache=require('mustache');var util=require(_0x0e88('0x8'));var path=require(_0x0e88('0x9'));var sox=require('sox');var csv=require(_0x0e88('0xa'));var ejs=require(_0x0e88('0xb'));var fs=require('fs');var _=require(_0x0e88('0xc'));var squel=require(_0x0e88('0xd'));var crypto=require(_0x0e88('0xe'));var jsforce=require(_0x0e88('0xf'));var deskjs=require(_0x0e88('0x10'));var toCsv=require(_0x0e88('0xa'));var querystring=require('querystring');var Papa=require(_0x0e88('0x11'));var Redis=require(_0x0e88('0x12'));var authService=require(_0x0e88('0x13'));var qs=require(_0x0e88('0x14'));var hardwareService=require(_0x0e88('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x0e88('0x16'));var config=require(_0x0e88('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12f9d7,_0x482760){_0x482760=_0x482760||0xcc;return function(_0x3aa9cc){if(_0x3aa9cc){return _0x12f9d7[_0x0e88('0x18')](_0x482760);}return _0x12f9d7[_0x0e88('0x19')](_0x482760)[_0x0e88('0x1a')]();};}function respondWithResult(_0x15cc58,_0x30228d){_0x30228d=_0x30228d||0xc8;return function(_0x493217){if(_0x493217){return _0x15cc58[_0x0e88('0x19')](_0x30228d)[_0x0e88('0x1b')](_0x493217);}};}function respondWithFilteredResult(_0x27f388,_0x2064bc){return function(_0x374386){if(_0x374386){var _0x5b16a4=_0x374386['count'],_0x5b8ffc=_0x2064bc[_0x0e88('0x1c')],_0x1a1241=_0x2064bc[_0x0e88('0x1c')]+_0x2064bc['limit'],_0x105dda;if(_0x1a1241>=_0x5b16a4){_0x1a1241=_0x5b16a4;_0x105dda=0xc8;}else{_0x105dda=0xce;}_0x27f388[_0x0e88('0x19')](_0x105dda);return _0x27f388[_0x0e88('0x1d')]('Content-Range',_0x5b8ffc+'-'+_0x1a1241+'/'+_0x5b16a4)[_0x0e88('0x1b')](_0x374386);}return null;};}function patchUpdates(_0x418f56){return function(_0x41570b){try{jsonpatch[_0x0e88('0x1e')](_0x41570b,_0x418f56,!![]);}catch(_0x3eea70){return BPromise[_0x0e88('0x1f')](_0x3eea70);}return _0x41570b[_0x0e88('0x20')]();};}function saveUpdates(_0x4f801c,_0x1a838d){return function(_0x158fb6){if(_0x158fb6){return _0x158fb6[_0x0e88('0x21')](_0x4f801c)[_0x0e88('0x22')](function(_0xc908d4){return _0xc908d4;});}return null;};}function removeEntity(_0xb7e64a,_0x30449b){return function(_0x27f701){if(_0x27f701){return _0x27f701[_0x0e88('0x23')]()['then'](function(){_0xb7e64a['status'](0xcc)[_0x0e88('0x1a')]();});}};}function handleEntityNotFound(_0x24f48e,_0x597d6f){return function(_0x59ab60){if(!_0x59ab60){_0x24f48e[_0x0e88('0x18')](0x194);}return _0x59ab60;};}function handleError(_0x3b570e,_0x4b2b4f){_0x4b2b4f=_0x4b2b4f||0x1f4;return function(_0x4f24e7){logger[_0x0e88('0x24')](_0x4f24e7[_0x0e88('0x25')]);if(_0x4f24e7['name']){delete _0x4f24e7['name'];}_0x3b570e[_0x0e88('0x19')](_0x4b2b4f)['send'](_0x4f24e7);};}exports[_0x0e88('0x26')]=function(_0x303c76,_0x262404){var _0x4f3c86={},_0x1e2dac={},_0x3a118b={'count':0x0,'rows':[]};var _0x432629=db['Dynamics365Field'][_0x0e88('0x27')];_0x1e2dac['model']=_[_0x0e88('0x28')](_0x432629);_0x1e2dac[_0x0e88('0x29')]=_[_0x0e88('0x28')](_0x303c76[_0x0e88('0x29')]);_0x1e2dac[_0x0e88('0x2a')]=_[_0x0e88('0x2b')](_0x1e2dac[_0x0e88('0x2c')],_0x1e2dac[_0x0e88('0x29')]);_0x4f3c86[_0x0e88('0x2d')]=_[_0x0e88('0x2b')](_0x1e2dac['model'],qs[_0x0e88('0x2e')](_0x303c76[_0x0e88('0x29')][_0x0e88('0x2e')]));_0x4f3c86[_0x0e88('0x2d')]=_0x4f3c86[_0x0e88('0x2d')][_0x0e88('0x2f')]?_0x4f3c86[_0x0e88('0x2d')]:_0x1e2dac['model'];if(!_0x303c76[_0x0e88('0x29')][_0x0e88('0x30')]('nolimit')){_0x4f3c86[_0x0e88('0x31')]=qs[_0x0e88('0x31')](_0x303c76[_0x0e88('0x29')][_0x0e88('0x31')]);_0x4f3c86['offset']=qs[_0x0e88('0x1c')](_0x303c76['query'][_0x0e88('0x1c')]);}_0x4f3c86[_0x0e88('0x32')]=qs[_0x0e88('0x33')](_0x303c76['query'][_0x0e88('0x33')]);_0x4f3c86[_0x0e88('0x34')]=qs['filters'](_[_0x0e88('0x35')](_0x303c76[_0x0e88('0x29')],_0x1e2dac[_0x0e88('0x2a')]));if(_0x303c76[_0x0e88('0x29')]['filter']){_0x4f3c86['where']=_[_0x0e88('0x36')](_0x4f3c86['where'],{'$or':_[_0x0e88('0x37')](_0x432629,function(_0x518715){if(_0x518715[_0x0e88('0x38')][_0x0e88('0x39')]!==_0x0e88('0x3a')){var _0xc0958a={};_0xc0958a[_0x518715[_0x0e88('0x3b')]]={'$like':'%'+_0x303c76['query'][_0x0e88('0x3c')]+'%'};return _0xc0958a;}})});}_0x4f3c86=_[_0x0e88('0x36')]({},_0x4f3c86,_0x303c76[_0x0e88('0x3d')]);var _0x3f069d={'where':_0x4f3c86[_0x0e88('0x34')]};return db[_0x0e88('0x3e')][_0x0e88('0x3f')](_0x3f069d)[_0x0e88('0x22')](function(_0x5951b0){_0x3a118b[_0x0e88('0x3f')]=_0x5951b0;if(_0x303c76['query'][_0x0e88('0x40')]){_0x4f3c86['include']=[{'all':!![]}];}return db[_0x0e88('0x3e')][_0x0e88('0x41')](_0x4f3c86);})[_0x0e88('0x22')](function(_0x35c627){_0x3a118b['rows']=_0x35c627;return _0x3a118b;})['then'](respondWithFilteredResult(_0x262404,_0x4f3c86))['catch'](handleError(_0x262404,null));};exports[_0x0e88('0x42')]=function(_0x5960bc,_0x441976){var _0x43b950={'raw':!![],'where':{'id':_0x5960bc['params']['id']}},_0x469348={};_0x469348[_0x0e88('0x2c')]=_['keys'](db[_0x0e88('0x3e')]['rawAttributes']);_0x469348['query']=_[_0x0e88('0x28')](_0x5960bc[_0x0e88('0x29')]);_0x469348[_0x0e88('0x2a')]=_[_0x0e88('0x2b')](_0x469348[_0x0e88('0x2c')],_0x469348[_0x0e88('0x29')]);_0x43b950[_0x0e88('0x2d')]=_['intersection'](_0x469348[_0x0e88('0x2c')],qs[_0x0e88('0x2e')](_0x5960bc[_0x0e88('0x29')][_0x0e88('0x2e')]));_0x43b950['attributes']=_0x43b950[_0x0e88('0x2d')][_0x0e88('0x2f')]?_0x43b950[_0x0e88('0x2d')]:_0x469348[_0x0e88('0x2c')];if(_0x5960bc[_0x0e88('0x29')][_0x0e88('0x40')]){_0x43b950[_0x0e88('0x43')]=[{'all':!![]}];}_0x43b950=_[_0x0e88('0x36')]({},_0x43b950,_0x5960bc[_0x0e88('0x3d')]);return db[_0x0e88('0x3e')][_0x0e88('0x44')](_0x43b950)[_0x0e88('0x22')](handleEntityNotFound(_0x441976,null))[_0x0e88('0x22')](respondWithResult(_0x441976,null))[_0x0e88('0x45')](handleError(_0x441976,null));};exports['create']=function(_0x707f68,_0x194064){return db['Dynamics365Field'][_0x0e88('0x46')](_0x707f68['body'],{})[_0x0e88('0x22')](respondWithResult(_0x194064,0xc9))[_0x0e88('0x45')](handleError(_0x194064,null));};exports['update']=function(_0x36194d,_0x28e8a3){if(_0x36194d[_0x0e88('0x47')]['id']){delete _0x36194d[_0x0e88('0x47')]['id'];}return db[_0x0e88('0x3e')][_0x0e88('0x44')]({'where':{'id':_0x36194d[_0x0e88('0x48')]['id']}})[_0x0e88('0x22')](handleEntityNotFound(_0x28e8a3,null))[_0x0e88('0x22')](saveUpdates(_0x36194d[_0x0e88('0x47')],null))[_0x0e88('0x22')](respondWithResult(_0x28e8a3,null))[_0x0e88('0x45')](handleError(_0x28e8a3,null));};exports[_0x0e88('0x23')]=function(_0xac92d8,_0x2b75e2){return db[_0x0e88('0x3e')][_0x0e88('0x44')]({'where':{'id':_0xac92d8[_0x0e88('0x48')]['id']}})[_0x0e88('0x22')](handleEntityNotFound(_0x2b75e2,null))[_0x0e88('0x22')](removeEntity(_0x2b75e2,null))[_0x0e88('0x45')](handleError(_0x2b75e2,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 42bf241..370798c 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 _0x6745=['int_dynamics365_fields','idField','FieldId','lodash','../../config/logger','moment','bluebird','path','./intDynamics365Field.attributes','exports','define','Dynamics365Field'];(function(_0x405069,_0x14db45){var _0xd7c425=function(_0x18ea5e){while(--_0x18ea5e){_0x405069['push'](_0x405069['shift']());}};_0xd7c425(++_0x14db45);}(_0x6745,0x16b));var _0x5674=function(_0x22861a,_0x2433f1){_0x22861a=_0x22861a-0x0;var _0x5b8dfb=_0x6745[_0x22861a];return _0x5b8dfb;};'use strict';var _=require(_0x5674('0x0'));var util=require('util');var logger=require(_0x5674('0x1'))('api');var moment=require(_0x5674('0x2'));var BPromise=require(_0x5674('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5674('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5674('0x5'));module[_0x5674('0x6')]=function(_0x25e3e7,_0x1587d0){return _0x25e3e7[_0x5674('0x7')](_0x5674('0x8'),attributes,{'tableName':_0x5674('0x9'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x5674('0xa'),_0x5674('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5298=['int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','path','rimraf','define','Dynamics365Field'];(function(_0x5dd975,_0x97d8c4){var _0x2601d5=function(_0x5c7dfd){while(--_0x5c7dfd){_0x5dd975['push'](_0x5dd975['shift']());}};_0x2601d5(++_0x97d8c4);}(_0x5298,0xee));var _0x8529=function(_0x388965,_0x5d8431){_0x388965=_0x388965-0x0;var _0x522585=_0x5298[_0x388965];return _0x522585;};'use strict';var _=require(_0x8529('0x0'));var util=require('util');var logger=require(_0x8529('0x1'))(_0x8529('0x2'));var moment=require(_0x8529('0x3'));var BPromise=require(_0x8529('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8529('0x5'));var rimraf=require(_0x8529('0x6'));var config=require('../../config/environment');var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x2f0ea7,_0x157fcf){return _0x2f0ea7[_0x8529('0x7')](_0x8529('0x8'),attributes,{'tableName':_0x8529('0x9'),'paranoid':![],'indexes':[{'name':_0x8529('0xa'),'fields':[_0x8529('0xb'),_0x8529('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 b964e1e..9dc90cd 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 _0x4e83=['info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','request','then'];(function(_0x362a73,_0x3b62d7){var _0x499f70=function(_0x238d44){while(--_0x238d44){_0x362a73['push'](_0x362a73['shift']());}};_0x499f70(++_0x3b62d7);}(_0x4e83,0x1ae));var _0x34e8=function(_0x4452dc,_0x479149){_0x4452dc=_0x4452dc-0x0;var _0x52b892=_0x4e83[_0x4452dc];return _0x52b892;};'use strict';var _=require(_0x34e8('0x0'));var util=require('util');var moment=require(_0x34e8('0x1'));var BPromise=require(_0x34e8('0x2'));var rs=require(_0x34e8('0x3'));var fs=require('fs');var Redis=require(_0x34e8('0x4'));var db=require(_0x34e8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x34e8('0x6'));var client=jayson[_0x34e8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30a3c4,_0x4567bd,_0x28677c){return new BPromise(function(_0x5b5ddc,_0x44d3bf){return client[_0x34e8('0x8')](_0x30a3c4,_0x28677c)[_0x34e8('0x9')](function(_0x5cb792){logger[_0x34e8('0xa')](_0x34e8('0xb'),_0x4567bd,_0x34e8('0xc'));logger[_0x34e8('0xd')](_0x34e8('0xe'),_0x4567bd,_0x34e8('0xc'),JSON[_0x34e8('0xf')](_0x5cb792));if(_0x5cb792[_0x34e8('0x10')]){if(_0x5cb792[_0x34e8('0x10')]['code']===0x1f4){logger[_0x34e8('0x10')](_0x34e8('0xb'),_0x4567bd,_0x5cb792['error'][_0x34e8('0x11')]);return _0x44d3bf(_0x5cb792[_0x34e8('0x10')][_0x34e8('0x11')]);}logger[_0x34e8('0x10')](_0x34e8('0xb'),_0x4567bd,_0x5cb792[_0x34e8('0x10')][_0x34e8('0x11')]);return _0x5b5ddc(_0x5cb792[_0x34e8('0x10')][_0x34e8('0x11')]);}else{logger['info'](_0x34e8('0xb'),_0x4567bd,_0x34e8('0xc'));_0x5b5ddc(_0x5cb792[_0x34e8('0x12')][_0x34e8('0x11')]);}})[_0x34e8('0x13')](function(_0x4a4d17){logger[_0x34e8('0x10')](_0x34e8('0xb'),_0x4567bd,_0x4a4d17);_0x44d3bf(_0x4a4d17);});});} \ No newline at end of file +var _0x5e0e=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5e0e,0x89));var _0xe5e0=function(_0x5a8b2e,_0x71ba40){_0x5a8b2e=_0x5a8b2e-0x0;var _0x1ea5fc=_0x5e0e[_0x5a8b2e];return _0x1ea5fc;};'use strict';var _=require(_0xe5e0('0x0'));var util=require(_0xe5e0('0x1'));var moment=require('moment');var BPromise=require(_0xe5e0('0x2'));var rs=require(_0xe5e0('0x3'));var fs=require('fs');var Redis=require(_0xe5e0('0x4'));var db=require(_0xe5e0('0x5'))['db'];var utils=require(_0xe5e0('0x6'));var logger=require('../../config/logger')(_0xe5e0('0x7'));var config=require('../../config/environment');var jayson=require(_0xe5e0('0x8'));var client=jayson[_0xe5e0('0x9')][_0xe5e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a4c51,_0xa91224,_0x156c30){return new BPromise(function(_0x59a81f,_0x4059cf){return client[_0xe5e0('0xb')](_0x1a4c51,_0x156c30)['then'](function(_0x27e523){logger[_0xe5e0('0xc')](_0xe5e0('0xd'),_0xa91224,_0xe5e0('0xe'));logger[_0xe5e0('0xf')](_0xe5e0('0x10'),_0xa91224,_0xe5e0('0xe'),JSON[_0xe5e0('0x11')](_0x27e523));if(_0x27e523[_0xe5e0('0x12')]){if(_0x27e523[_0xe5e0('0x12')][_0xe5e0('0x13')]===0x1f4){logger[_0xe5e0('0x12')](_0xe5e0('0xd'),_0xa91224,_0x27e523['error']['message']);return _0x4059cf(_0x27e523[_0xe5e0('0x12')][_0xe5e0('0x14')]);}logger[_0xe5e0('0x12')](_0xe5e0('0xd'),_0xa91224,_0x27e523['error'][_0xe5e0('0x14')]);return _0x59a81f(_0x27e523[_0xe5e0('0x12')][_0xe5e0('0x14')]);}else{logger[_0xe5e0('0xc')](_0xe5e0('0xd'),_0xa91224,_0xe5e0('0xe'));_0x59a81f(_0x27e523[_0xe5e0('0x15')][_0xe5e0('0x14')]);}})[_0xe5e0('0x16')](function(_0x501795){logger[_0xe5e0('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0xa91224,_0x501795);_0x4059cf(_0x501795);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 65dfdc7..fcc4961 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 _0xec14=['getFields','post','create','addConfiguration','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x27c5fb,_0x1fda90){var _0x1111c6=function(_0x388d04){while(--_0x388d04){_0x27c5fb['push'](_0x27c5fb['shift']());}};_0x1111c6(++_0x1fda90);}(_0xec14,0x188));var _0x4ec1=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xec14[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x4ec1('0x0'));var util=require('util');var path=require(_0x4ec1('0x1'));var timeout=require(_0x4ec1('0x2'));var express=require(_0x4ec1('0x3'));var router=express[_0x4ec1('0x4')]();var auth=require(_0x4ec1('0x5'));var interaction=require(_0x4ec1('0x6'));var config=require(_0x4ec1('0x7'));var controller=require(_0x4ec1('0x8'));router[_0x4ec1('0x9')]('/',auth[_0x4ec1('0xa')](),controller[_0x4ec1('0xb')]);router[_0x4ec1('0x9')](_0x4ec1('0xc'),auth[_0x4ec1('0xa')](),controller[_0x4ec1('0xd')]);router['get'](_0x4ec1('0xe'),auth['isAuthenticated'](),controller[_0x4ec1('0xf')]);router[_0x4ec1('0x9')]('/:id/fields',auth[_0x4ec1('0xa')](),controller[_0x4ec1('0x10')]);router[_0x4ec1('0x11')]('/',auth['isAuthenticated'](),controller[_0x4ec1('0x12')]);router[_0x4ec1('0x11')](_0x4ec1('0xe'),auth['isAuthenticated'](),controller[_0x4ec1('0x13')]);router[_0x4ec1('0x14')](_0x4ec1('0xc'),auth[_0x4ec1('0xa')](),controller['update']);router[_0x4ec1('0x15')](_0x4ec1('0xc'),auth[_0x4ec1('0xa')](),controller[_0x4ec1('0x16')]);module[_0x4ec1('0x17')]=router; \ No newline at end of file +var _0xbc52=['get','isAuthenticated','index','/:id/configurations','/:id/fields','getFields','post','addConfiguration','delete','destroy','exports','multer','util','path','express','../../components/interaction/service','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbc52,0xd7));var _0x2bc5=function(_0x326abf,_0x267d38){_0x326abf=_0x326abf-0x0;var _0x46d786=_0xbc52[_0x326abf];return _0x46d786;};'use strict';var multer=require(_0x2bc5('0x0'));var util=require(_0x2bc5('0x1'));var path=require(_0x2bc5('0x2'));var timeout=require('connect-timeout');var express=require(_0x2bc5('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x2bc5('0x4'));var config=require(_0x2bc5('0x5'));var controller=require('./intFreshdeskAccount.controller');router[_0x2bc5('0x6')]('/',auth[_0x2bc5('0x7')](),controller[_0x2bc5('0x8')]);router[_0x2bc5('0x6')]('/:id',auth[_0x2bc5('0x7')](),controller['show']);router[_0x2bc5('0x6')](_0x2bc5('0x9'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x2bc5('0xa'),auth[_0x2bc5('0x7')](),controller[_0x2bc5('0xb')]);router[_0x2bc5('0xc')]('/',auth[_0x2bc5('0x7')](),controller['create']);router['post'](_0x2bc5('0x9'),auth['isAuthenticated'](),controller[_0x2bc5('0xd')]);router['put']('/:id',auth[_0x2bc5('0x7')](),controller['update']);router[_0x2bc5('0xe')]('/:id',auth[_0x2bc5('0x7')](),controller[_0x2bc5('0xf')]);module[_0x2bc5('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index f6e4915..a38da4e 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 _0x2da6=['username','sequelize','exports','STRING'];(function(_0x4d18b5,_0x3a8b24){var _0x2917a6=function(_0x55d349){while(--_0x55d349){_0x4d18b5['push'](_0x4d18b5['shift']());}};_0x2917a6(++_0x3a8b24);}(_0x2da6,0x1dd));var _0x62da=function(_0x5ad6fb,_0x9860c9){_0x5ad6fb=_0x5ad6fb-0x0;var _0x513885=_0x2da6[_0x5ad6fb];return _0x513885;};'use strict';var Sequelize=require(_0x62da('0x0'));module[_0x62da('0x1')]={'name':{'type':Sequelize[_0x62da('0x2')]},'description':{'type':Sequelize[_0x62da('0x2')]},'username':{'type':Sequelize[_0x62da('0x2')],'unique':_0x62da('0x3')},'apiKey':{'type':Sequelize[_0x62da('0x2')]},'remoteUri':{'type':Sequelize[_0x62da('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3445=['exports','STRING','username','sequelize'];(function(_0x2bc64d,_0x44de5d){var _0x270cc6=function(_0x2ba524){while(--_0x2ba524){_0x2bc64d['push'](_0x2bc64d['shift']());}};_0x270cc6(++_0x44de5d);}(_0x3445,0x1b7));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5344('0x0'));module[_0x5344('0x1')]={'name':{'type':Sequelize[_0x5344('0x2')]},'description':{'type':Sequelize[_0x5344('0x2')]},'username':{'type':Sequelize[_0x5344('0x2')],'unique':_0x5344('0x3')},'apiKey':{'type':Sequelize[_0x5344('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x5344('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 1b36410..ebb431a 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 _0xfefd=['sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../components/integrations/configuration','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','destroy','end','stack','name','index','FreshdeskAccount','rawAttributes','model','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','findAll','rows','show','keys','include','create','body','params','FreshdeskConfiguration','map','getConfigurations','hasOwnProperty','nolimit','findOne','AccountId','channel','getDescriptions','FreshdeskField','Subjects','Descriptions','remoteUri','slice','lastIndexOf','GET','%s/%s','format','Basic\x20%s','%s:X','toString','requester','subject','description','priority','source','group','company','remove','includes','default','custom_text','custom_dropdown','label','choices','statusCode','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','moment','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfefd,0x1dd));var _0xdfef=function(_0x5b8b97,_0x6b4dfa){_0x5b8b97=_0x5b8b97-0x0;var _0x1fdf84=_0xfefd[_0x5b8b97];return _0x1fdf84;};'use strict';var pdf=require(_0xdfef('0x0'));var emlformat=require(_0xdfef('0x1'));var rimraf=require(_0xdfef('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdfef('0x3'));var moment=require(_0xdfef('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdfef('0x5'));var path=require(_0xdfef('0x6'));var sox=require(_0xdfef('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xdfef('0x8'));var squel=require(_0xdfef('0x9'));var crypto=require(_0xdfef('0xa'));var jsforce=require(_0xdfef('0xb'));var deskjs=require(_0xdfef('0xc'));var toCsv=require(_0xdfef('0xd'));var querystring=require(_0xdfef('0xe'));var Papa=require(_0xdfef('0xf'));var Redis=require(_0xdfef('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdfef('0x11'));var hardwareService=require(_0xdfef('0x12'));var logger=require('../../config/logger')(_0xdfef('0x13'));var utils=require(_0xdfef('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0xdfef('0x15'));var jayson=require('jayson/promise');var client=jayson[_0xdfef('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x5230fe,_0x4b6671,_0x5a6c87){if(_0x5a6c87){var _0x4bf306=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4bf306[_0xdfef('0x17')](_0x4b6671)){return _0x5230fe;}else{throw new Error(_0xdfef('0x18'));}}else{return _0x5230fe;}}function respondWithRpcPromise(_0x239722,_0xa25df9,_0xf5299e,_0xd16f64){return new BPromise(function(_0x28bb73,_0x1497a9){var _0x3799b1=_0xd16f64||client;return _0x3799b1[_0xdfef('0x19')](_0x239722,_0xf5299e)[_0xdfef('0x1a')](function(_0x1fc0a2){logger[_0xdfef('0x1b')](_0xdfef('0x1c'),_0xa25df9,_0xdfef('0x1d'));logger[_0xdfef('0x1e')](_0xdfef('0x1f'),_0xa25df9,_0xdfef('0x1d'),JSON[_0xdfef('0x20')](_0x1fc0a2));if(_0x1fc0a2['error']){if(_0x1fc0a2[_0xdfef('0x21')][_0xdfef('0x22')]===0x1f4){logger[_0xdfef('0x21')](_0xdfef('0x1c'),_0xa25df9,_0x1fc0a2[_0xdfef('0x21')][_0xdfef('0x23')]);return _0x1497a9(_0x1fc0a2[_0xdfef('0x21')]['message']);}logger[_0xdfef('0x21')](_0xdfef('0x1c'),_0xa25df9,_0x1fc0a2[_0xdfef('0x21')]['message']);return _0x28bb73(_0x1fc0a2[_0xdfef('0x21')]['message']);}else{logger[_0xdfef('0x1b')]('FreshdeskAccount,\x20%s,\x20%s',_0xa25df9,_0xdfef('0x1d'));_0x28bb73(_0x1fc0a2[_0xdfef('0x24')]['message']);}})[_0xdfef('0x25')](function(_0x2adbaf){logger[_0xdfef('0x21')]('FreshdeskAccount,\x20%s,\x20%s',_0xa25df9,_0x2adbaf);_0x1497a9(_0x2adbaf);});});}function respondWithStatusCode(_0x478bf0,_0x35ad91){_0x35ad91=_0x35ad91||0xcc;return function(_0x14495b){if(_0x14495b){return _0x478bf0[_0xdfef('0x26')](_0x35ad91);}return _0x478bf0[_0xdfef('0x27')](_0x35ad91)['end']();};}function respondWithResult(_0xa1f29,_0x1bd866){_0x1bd866=_0x1bd866||0xc8;return function(_0x1928ff){if(_0x1928ff){return _0xa1f29['status'](_0x1bd866)[_0xdfef('0x28')](_0x1928ff);}};}function respondWithFilteredResult(_0x458c9e,_0x12def9){return function(_0x4e48b3){if(_0x4e48b3){var _0x500ddc=_0x4e48b3[_0xdfef('0x29')],_0x37adcc=_0x12def9[_0xdfef('0x2a')],_0x1a5a10=_0x12def9['offset']+_0x12def9[_0xdfef('0x2b')],_0x428ec9;if(_0x1a5a10>=_0x500ddc){_0x1a5a10=_0x500ddc;_0x428ec9=0xc8;}else{_0x428ec9=0xce;}_0x458c9e[_0xdfef('0x27')](_0x428ec9);return _0x458c9e[_0xdfef('0x2c')]('Content-Range',_0x37adcc+'-'+_0x1a5a10+'/'+_0x500ddc)[_0xdfef('0x28')](_0x4e48b3);}return null;};}function patchUpdates(_0x87a9b0){return function(_0x1370ae){try{jsonpatch[_0xdfef('0x2d')](_0x1370ae,_0x87a9b0,!![]);}catch(_0x4d99aa){return BPromise[_0xdfef('0x2e')](_0x4d99aa);}return _0x1370ae[_0xdfef('0x2f')]();};}function saveUpdates(_0x40cacb,_0x585049){return function(_0x4a2b73){if(_0x4a2b73){return _0x4a2b73[_0xdfef('0x30')](_0x40cacb)[_0xdfef('0x1a')](function(_0x1d949b){return _0x1d949b;});}return null;};}function removeEntity(_0x1a393c,_0x54c433){return function(_0x15989c){if(_0x15989c){return _0x15989c[_0xdfef('0x31')]()['then'](function(){_0x1a393c[_0xdfef('0x27')](0xcc)[_0xdfef('0x32')]();});}};}function handleEntityNotFound(_0xa36d35,_0x1bdb2e){return function(_0x1fe6b0){if(!_0x1fe6b0){_0xa36d35['sendStatus'](0x194);}return _0x1fe6b0;};}function handleError(_0x5d17b5,_0x1b4fca){_0x1b4fca=_0x1b4fca||0x1f4;return function(_0x5bba58){logger[_0xdfef('0x21')](_0x5bba58[_0xdfef('0x33')]);if(_0x5bba58['name']){delete _0x5bba58[_0xdfef('0x34')];}_0x5d17b5[_0xdfef('0x27')](_0x1b4fca)['send'](_0x5bba58);};}exports[_0xdfef('0x35')]=function(_0x18f204,_0x48be62){var _0x137dfd={},_0xe1509={},_0xc5c8b={'count':0x0,'rows':[]};var _0x4c71fc=db[_0xdfef('0x36')][_0xdfef('0x37')];_0xe1509[_0xdfef('0x38')]=_['keys'](_0x4c71fc);_0xe1509['query']=_['keys'](_0x18f204[_0xdfef('0x39')]);_0xe1509[_0xdfef('0x3a')]=_[_0xdfef('0x3b')](_0xe1509[_0xdfef('0x38')],_0xe1509[_0xdfef('0x39')]);_0x137dfd['attributes']=_['intersection'](_0xe1509[_0xdfef('0x38')],qs[_0xdfef('0x3c')](_0x18f204[_0xdfef('0x39')][_0xdfef('0x3c')]));_0x137dfd[_0xdfef('0x3d')]=_0x137dfd[_0xdfef('0x3d')][_0xdfef('0x3e')]?_0x137dfd[_0xdfef('0x3d')]:_0xe1509[_0xdfef('0x38')];if(!_0x18f204[_0xdfef('0x39')]['hasOwnProperty']('nolimit')){_0x137dfd['limit']=qs[_0xdfef('0x2b')](_0x18f204[_0xdfef('0x39')]['limit']);_0x137dfd[_0xdfef('0x2a')]=qs[_0xdfef('0x2a')](_0x18f204[_0xdfef('0x39')][_0xdfef('0x2a')]);}_0x137dfd[_0xdfef('0x3f')]=qs['sort'](_0x18f204[_0xdfef('0x39')][_0xdfef('0x40')]);_0x137dfd[_0xdfef('0x41')]=qs[_0xdfef('0x3a')](_[_0xdfef('0x42')](_0x18f204[_0xdfef('0x39')],_0xe1509[_0xdfef('0x3a')]));if(_0x18f204[_0xdfef('0x39')][_0xdfef('0x43')]){_0x137dfd[_0xdfef('0x41')]=_[_0xdfef('0x44')](_0x137dfd['where'],{'$or':_['map'](_0x4c71fc,function(_0x8903ed){if(_0x8903ed[_0xdfef('0x45')][_0xdfef('0x46')]!==_0xdfef('0x47')){var _0x519492={};_0x519492[_0x8903ed[_0xdfef('0x48')]]={'$like':'%'+_0x18f204['query'][_0xdfef('0x43')]+'%'};return _0x519492;}})});}_0x137dfd=_[_0xdfef('0x44')]({},_0x137dfd,_0x18f204[_0xdfef('0x49')]);var _0x1ffc45={'where':_0x137dfd[_0xdfef('0x41')]};return db[_0xdfef('0x36')][_0xdfef('0x29')](_0x1ffc45)[_0xdfef('0x1a')](function(_0xd2d14e){_0xc5c8b[_0xdfef('0x29')]=_0xd2d14e;if(_0x18f204['query'][_0xdfef('0x4a')]){_0x137dfd['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0xdfef('0x4b')](_0x137dfd);})[_0xdfef('0x1a')](function(_0x35ac41){_0xc5c8b[_0xdfef('0x4c')]=_0x35ac41;return _0xc5c8b;})[_0xdfef('0x1a')](respondWithFilteredResult(_0x48be62,_0x137dfd))[_0xdfef('0x25')](handleError(_0x48be62,null));};exports[_0xdfef('0x4d')]=function(_0x55dbcf,_0x35aa2c){var _0x2b47c3={'raw':![],'where':{'id':_0x55dbcf['params']['id']}},_0x357ad8={};_0x357ad8[_0xdfef('0x38')]=_[_0xdfef('0x4e')](db['FreshdeskAccount']['rawAttributes']);_0x357ad8[_0xdfef('0x39')]=_[_0xdfef('0x4e')](_0x55dbcf['query']);_0x357ad8[_0xdfef('0x3a')]=_[_0xdfef('0x3b')](_0x357ad8[_0xdfef('0x38')],_0x357ad8[_0xdfef('0x39')]);_0x2b47c3[_0xdfef('0x3d')]=_[_0xdfef('0x3b')](_0x357ad8[_0xdfef('0x38')],qs[_0xdfef('0x3c')](_0x55dbcf[_0xdfef('0x39')][_0xdfef('0x3c')]));_0x2b47c3[_0xdfef('0x3d')]=_0x2b47c3[_0xdfef('0x3d')][_0xdfef('0x3e')]?_0x2b47c3[_0xdfef('0x3d')]:_0x357ad8[_0xdfef('0x38')];if(_0x55dbcf[_0xdfef('0x39')][_0xdfef('0x4a')]){_0x2b47c3[_0xdfef('0x4f')]=[{'all':!![]}];}_0x2b47c3=_['merge']({},_0x2b47c3,_0x55dbcf[_0xdfef('0x49')]);return db['FreshdeskAccount']['find'](_0x2b47c3)[_0xdfef('0x1a')](handleEntityNotFound(_0x35aa2c,null))[_0xdfef('0x1a')](respondWithResult(_0x35aa2c,null))[_0xdfef('0x25')](handleError(_0x35aa2c,null));};exports['create']=function(_0x3685ec,_0x46777c){return db[_0xdfef('0x36')][_0xdfef('0x50')](_0x3685ec[_0xdfef('0x51')],{})['then'](respondWithResult(_0x46777c,0xc9))[_0xdfef('0x25')](handleError(_0x46777c,null));};exports['update']=function(_0x33b68e,_0x2c5790){if(_0x33b68e[_0xdfef('0x51')]['id']){delete _0x33b68e[_0xdfef('0x51')]['id'];}return db[_0xdfef('0x36')]['find']({'where':{'id':_0x33b68e['params']['id']}})[_0xdfef('0x1a')](handleEntityNotFound(_0x2c5790,null))['then'](saveUpdates(_0x33b68e['body'],null))['then'](respondWithResult(_0x2c5790,null))[_0xdfef('0x25')](handleError(_0x2c5790,null));};exports[_0xdfef('0x31')]=function(_0x35e027,_0x183969){return db[_0xdfef('0x36')]['find']({'where':{'id':_0x35e027[_0xdfef('0x52')]['id']}})[_0xdfef('0x1a')](handleEntityNotFound(_0x183969,null))['then'](removeEntity(_0x183969,null))[_0xdfef('0x25')](handleError(_0x183969,null));};exports['getConfigurations']=function(_0x543b75,_0x49eb48,_0x1651be){var _0x4c3b60={};var _0x23454f={};var _0x10dcd6;var _0x5764ef;return db[_0xdfef('0x36')]['findOne']({'where':{'id':_0x543b75[_0xdfef('0x52')]['id']}})['then'](handleEntityNotFound(_0x49eb48,null))[_0xdfef('0x1a')](function(_0x365736){if(_0x365736){_0x10dcd6=_0x365736;_0x23454f[_0xdfef('0x38')]=_[_0xdfef('0x4e')](db[_0xdfef('0x53')][_0xdfef('0x37')]);_0x23454f[_0xdfef('0x39')]=_['keys'](_0x543b75['query']);_0x23454f[_0xdfef('0x3a')]=_[_0xdfef('0x3b')](_0x23454f[_0xdfef('0x38')],_0x23454f[_0xdfef('0x39')]);_0x4c3b60[_0xdfef('0x3d')]=_['intersection'](_0x23454f[_0xdfef('0x38')],qs['fields'](_0x543b75[_0xdfef('0x39')][_0xdfef('0x3c')]));_0x4c3b60[_0xdfef('0x3d')]=_0x4c3b60[_0xdfef('0x3d')][_0xdfef('0x3e')]?_0x4c3b60[_0xdfef('0x3d')]:_0x23454f['model'];_0x4c3b60[_0xdfef('0x3f')]=qs['sort'](_0x543b75[_0xdfef('0x39')][_0xdfef('0x40')]);_0x4c3b60[_0xdfef('0x41')]=qs[_0xdfef('0x3a')](_[_0xdfef('0x42')](_0x543b75[_0xdfef('0x39')],_0x23454f['filters']));if(_0x543b75[_0xdfef('0x39')]['filter']){_0x4c3b60[_0xdfef('0x41')]=_['merge'](_0x4c3b60[_0xdfef('0x41')],{'$or':_[_0xdfef('0x54')](_0x4c3b60[_0xdfef('0x3d')],function(_0xd587df){var _0x8a5ae7={};_0x8a5ae7[_0xd587df]={'$like':'%'+_0x543b75[_0xdfef('0x39')][_0xdfef('0x43')]+'%'};return _0x8a5ae7;})});}_0x4c3b60=_[_0xdfef('0x44')]({},_0x4c3b60,_0x543b75[_0xdfef('0x49')]);return _0x10dcd6[_0xdfef('0x55')](_0x4c3b60);}})[_0xdfef('0x1a')](function(_0x97aa02){if(_0x97aa02){_0x5764ef=_0x97aa02['length'];if(!_0x543b75[_0xdfef('0x39')][_0xdfef('0x56')](_0xdfef('0x57'))){_0x4c3b60['limit']=qs[_0xdfef('0x2b')](_0x543b75[_0xdfef('0x39')][_0xdfef('0x2b')]);_0x4c3b60[_0xdfef('0x2a')]=qs[_0xdfef('0x2a')](_0x543b75[_0xdfef('0x39')]['offset']);}return _0x10dcd6[_0xdfef('0x55')](_0x4c3b60);}})[_0xdfef('0x1a')](function(_0x498e60){if(_0x498e60){return _0x498e60?{'count':_0x5764ef,'rows':_0x498e60}:null;}})[_0xdfef('0x1a')](respondWithResult(_0x49eb48,null))['catch'](handleError(_0x49eb48,null));};exports['addConfiguration']=function(_0x5c6d16,_0x5bdd59,_0x56ba63){if(_0x5c6d16[_0xdfef('0x51')]['id']){delete _0x5c6d16[_0xdfef('0x51')]['id'];}return db[_0xdfef('0x36')][_0xdfef('0x58')]({'where':{'id':_0x5c6d16[_0xdfef('0x52')]['id']}})[_0xdfef('0x1a')](handleEntityNotFound(_0x5bdd59,null))[_0xdfef('0x1a')](function(_0x4b3134){if(_0x4b3134){_0x5c6d16[_0xdfef('0x51')][_0xdfef('0x59')]=_0x4b3134['id'];_0x5c6d16[_0xdfef('0x51')]['Subjects']=integrations['getSubjects'](_0x5c6d16['body'][_0xdfef('0x5a')],_0x5c6d16[_0xdfef('0x51')]['type']);_0x5c6d16[_0xdfef('0x51')]['Descriptions']=integrations[_0xdfef('0x5b')](_0x5c6d16[_0xdfef('0x51')]['channel'],_0x5c6d16[_0xdfef('0x51')][_0xdfef('0x45')]);return db[_0xdfef('0x53')]['create'](_0x5c6d16['body'],{'include':[{'model':db[_0xdfef('0x5c')],'as':_0xdfef('0x5d')},{'model':db['FreshdeskField'],'as':_0xdfef('0x5e')}]});}return null;})[_0xdfef('0x1a')](respondWithResult(_0x5bdd59,null))[_0xdfef('0x25')](handleError(_0x5bdd59,null));};exports['getFields']=function(_0x3518f2,_0x398e69,_0x52a65b){var _0x262e21='';return db[_0xdfef('0x36')][_0xdfef('0x58')]({'where':{'id':_0x3518f2[_0xdfef('0x52')]['id']},'attributes':['id',_0xdfef('0x5f'),'apiKey']})['then'](handleEntityNotFound(_0x398e69,null))[_0xdfef('0x1a')](function(_0x50bfe5){if(_0x50bfe5){_0x262e21=_0x50bfe5[_0xdfef('0x5f')];var _0x562ea9=_0x262e21[_0xdfef('0x60')](-0x1);if(_0x562ea9==='/'){_0x262e21=_0x262e21['substring'](0x0,_0x262e21[_0xdfef('0x61')](_0x562ea9));}return rp({'method':_0xdfef('0x62'),'uri':util['format'](_0xdfef('0x63'),_0x262e21,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xdfef('0x64')](_0xdfef('0x65'),new Buffer(util['format'](_0xdfef('0x66'),_0x50bfe5['apiKey']))[_0xdfef('0x67')]('base64'))},'json':!![]});}})[_0xdfef('0x1a')](function(_0x500eca){if(_0x500eca){var _0x4bcfa0=[_0xdfef('0x68'),_0xdfef('0x69'),'agent',_0xdfef('0x6a'),_0xdfef('0x27'),_0xdfef('0x6b'),'group',_0xdfef('0x6c'),'ticket_type',_0xdfef('0x6d'),_0xdfef('0x6e')];_[_0xdfef('0x6f')](_0x500eca,function(_0x5b9936){return _0x4bcfa0[_0xdfef('0x70')](_0x5b9936[_0xdfef('0x34')])||!_0x5b9936[_0xdfef('0x71')]&&_0x5b9936['type']!==_0xdfef('0x72')&&_0x5b9936['type']!==_0xdfef('0x73');});return{'count':_0x500eca[_0xdfef('0x3e')],'rows':_[_0xdfef('0x54')](_0x500eca,function(_0x1de700){return{'id':_0x1de700[_0xdfef('0x34')],'name':_0x1de700[_0xdfef('0x74')],'custom':!_0x1de700[_0xdfef('0x71')],'options':_0x1de700[_0xdfef('0x75')]?_[_0xdfef('0x54')](_0x1de700[_0xdfef('0x75')],function(_0x116938){return{'name':_['capitalize'](_0x116938),'value':_0x116938};}):[]};})};}})['then'](respondWithResult(_0x398e69,null))[_0xdfef('0x25')](function(_0x14013b){var _0x127d55=_0x3518f2[_0xdfef('0x39')][_0xdfef('0x17')]?0x1f4:_0x14013b[_0xdfef('0x76')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xdfef('0x77'),_0x127d55,JSON['stringify'](_0x14013b));delete _0x14013b[_0xdfef('0x34')];if(_0x127d55===0x191){_0x127d55=0x190;}_0x398e69[_0xdfef('0x27')](_0x127d55)['send'](_0x3518f2[_0xdfef('0x39')][_0xdfef('0x17')]?{'message':_0xdfef('0x78'),'statusCode':_0x14013b[_0xdfef('0x76')]}:_0x14013b);});}; \ No newline at end of file +var _0xb5c7=['capitalize','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','FreshdeskAccount','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','key','VIRTUAL','merge','options','include','findAll','rows','params','rawAttributes','includeAll','find','create','body','getConfigurations','FreshdeskConfiguration','pick','filter','addConfiguration','findOne','AccountId','Subjects','channel','type','Descriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','%s:X','toString','base64','requester','subject','description','priority','source','remove','includes','default','custom_text','custom_dropdown','map','label','choices'];(function(_0x5f3b0a,_0x442f2f){var _0x81e1f3=function(_0x4a6a9c){while(--_0x4a6a9c){_0x5f3b0a['push'](_0x5f3b0a['shift']());}};_0x81e1f3(++_0x442f2f);}(_0xb5c7,0xfa));var _0x7b5c=function(_0x277268,_0x441129){_0x277268=_0x277268-0x0;var _0x4bec9f=_0xb5c7[_0x277268];return _0x4bec9f;};'use strict';var pdf=require(_0x7b5c('0x0'));var emlformat=require(_0x7b5c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7b5c('0x2'));var jsonpatch=require(_0x7b5c('0x3'));var rp=require(_0x7b5c('0x4'));var moment=require(_0x7b5c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7b5c('0x6'));var sox=require(_0x7b5c('0x7'));var csv=require(_0x7b5c('0x8'));var ejs=require(_0x7b5c('0x9'));var fs=require('fs');var _=require(_0x7b5c('0xa'));var squel=require('squel');var crypto=require(_0x7b5c('0xb'));var jsforce=require(_0x7b5c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7b5c('0x8'));var querystring=require(_0x7b5c('0xd'));var Papa=require(_0x7b5c('0xe'));var Redis=require(_0x7b5c('0xf'));var authService=require(_0x7b5c('0x10'));var qs=require(_0x7b5c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7b5c('0x12'));var utils=require(_0x7b5c('0x13'));var config=require('../../config/environment');var db=require(_0x7b5c('0x14'))['db'];var integrations=require(_0x7b5c('0x15'));var jayson=require(_0x7b5c('0x16'));var client=jayson[_0x7b5c('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x324d36,_0x562a2b,_0x586994){if(_0x586994){var _0x840fc7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x840fc7[_0x7b5c('0x18')](_0x562a2b)){return _0x324d36;}else{throw new Error(_0x7b5c('0x19'));}}else{return _0x324d36;}}function respondWithRpcPromise(_0x390d08,_0x421757,_0xb61971,_0x437ac3){return new BPromise(function(_0x240ea4,_0x1a9207){var _0x15b7a4=_0x437ac3||client;return _0x15b7a4[_0x7b5c('0x1a')](_0x390d08,_0xb61971)['then'](function(_0x41aea5){logger['info'](_0x7b5c('0x1b'),_0x421757,_0x7b5c('0x1c'));logger[_0x7b5c('0x1d')](_0x7b5c('0x1e'),_0x421757,_0x7b5c('0x1c'),JSON[_0x7b5c('0x1f')](_0x41aea5));if(_0x41aea5['error']){if(_0x41aea5[_0x7b5c('0x20')][_0x7b5c('0x21')]===0x1f4){logger[_0x7b5c('0x20')]('FreshdeskAccount,\x20%s,\x20%s',_0x421757,_0x41aea5['error'][_0x7b5c('0x22')]);return _0x1a9207(_0x41aea5[_0x7b5c('0x20')]['message']);}logger[_0x7b5c('0x20')](_0x7b5c('0x1b'),_0x421757,_0x41aea5['error'][_0x7b5c('0x22')]);return _0x240ea4(_0x41aea5[_0x7b5c('0x20')]['message']);}else{logger[_0x7b5c('0x23')](_0x7b5c('0x1b'),_0x421757,_0x7b5c('0x1c'));_0x240ea4(_0x41aea5[_0x7b5c('0x24')][_0x7b5c('0x22')]);}})[_0x7b5c('0x25')](function(_0x1a9416){logger[_0x7b5c('0x20')](_0x7b5c('0x1b'),_0x421757,_0x1a9416);_0x1a9207(_0x1a9416);});});}function respondWithStatusCode(_0x55931c,_0x19a040){_0x19a040=_0x19a040||0xcc;return function(_0x3dd8ff){if(_0x3dd8ff){return _0x55931c[_0x7b5c('0x26')](_0x19a040);}return _0x55931c[_0x7b5c('0x27')](_0x19a040)[_0x7b5c('0x28')]();};}function respondWithResult(_0x537145,_0x3439d8){_0x3439d8=_0x3439d8||0xc8;return function(_0x57e305){if(_0x57e305){return _0x537145[_0x7b5c('0x27')](_0x3439d8)[_0x7b5c('0x29')](_0x57e305);}};}function respondWithFilteredResult(_0x561475,_0x3b799b){return function(_0x20b429){if(_0x20b429){var _0x100a5a=_0x20b429[_0x7b5c('0x2a')],_0x2c991d=_0x3b799b['offset'],_0x59ccf2=_0x3b799b[_0x7b5c('0x2b')]+_0x3b799b['limit'],_0x24b98b;if(_0x59ccf2>=_0x100a5a){_0x59ccf2=_0x100a5a;_0x24b98b=0xc8;}else{_0x24b98b=0xce;}_0x561475[_0x7b5c('0x27')](_0x24b98b);return _0x561475['set'](_0x7b5c('0x2c'),_0x2c991d+'-'+_0x59ccf2+'/'+_0x100a5a)['json'](_0x20b429);}return null;};}function patchUpdates(_0x1c264){return function(_0x16a7fc){try{jsonpatch[_0x7b5c('0x2d')](_0x16a7fc,_0x1c264,!![]);}catch(_0x35b627){return BPromise[_0x7b5c('0x2e')](_0x35b627);}return _0x16a7fc[_0x7b5c('0x2f')]();};}function saveUpdates(_0x26ec8c,_0x13c502){return function(_0x2a83f5){if(_0x2a83f5){return _0x2a83f5[_0x7b5c('0x30')](_0x26ec8c)['then'](function(_0x45a9ad){return _0x45a9ad;});}return null;};}function removeEntity(_0x45d2e5,_0x3df497){return function(_0x484391){if(_0x484391){return _0x484391[_0x7b5c('0x31')]()[_0x7b5c('0x32')](function(){_0x45d2e5[_0x7b5c('0x27')](0xcc)[_0x7b5c('0x28')]();});}};}function handleEntityNotFound(_0x655396,_0x38b0b9){return function(_0x23a1f9){if(!_0x23a1f9){_0x655396[_0x7b5c('0x26')](0x194);}return _0x23a1f9;};}function handleError(_0x33a53f,_0x5bef01){_0x5bef01=_0x5bef01||0x1f4;return function(_0x2fea13){logger['error'](_0x2fea13[_0x7b5c('0x33')]);if(_0x2fea13[_0x7b5c('0x34')]){delete _0x2fea13[_0x7b5c('0x34')];}_0x33a53f[_0x7b5c('0x27')](_0x5bef01)[_0x7b5c('0x35')](_0x2fea13);};}exports[_0x7b5c('0x36')]=function(_0x543a92,_0x3b77ea){var _0xf45b5c={},_0x47e04c={},_0x29c135={'count':0x0,'rows':[]};var _0x45cd72=db[_0x7b5c('0x37')]['rawAttributes'];_0x47e04c['model']=_[_0x7b5c('0x38')](_0x45cd72);_0x47e04c[_0x7b5c('0x39')]=_['keys'](_0x543a92[_0x7b5c('0x39')]);_0x47e04c['filters']=_[_0x7b5c('0x3a')](_0x47e04c[_0x7b5c('0x3b')],_0x47e04c[_0x7b5c('0x39')]);_0xf45b5c[_0x7b5c('0x3c')]=_[_0x7b5c('0x3a')](_0x47e04c[_0x7b5c('0x3b')],qs[_0x7b5c('0x3d')](_0x543a92[_0x7b5c('0x39')][_0x7b5c('0x3d')]));_0xf45b5c[_0x7b5c('0x3c')]=_0xf45b5c[_0x7b5c('0x3c')][_0x7b5c('0x3e')]?_0xf45b5c[_0x7b5c('0x3c')]:_0x47e04c['model'];if(!_0x543a92[_0x7b5c('0x39')][_0x7b5c('0x3f')](_0x7b5c('0x40'))){_0xf45b5c[_0x7b5c('0x41')]=qs[_0x7b5c('0x41')](_0x543a92[_0x7b5c('0x39')]['limit']);_0xf45b5c['offset']=qs['offset'](_0x543a92['query']['offset']);}_0xf45b5c[_0x7b5c('0x42')]=qs['sort'](_0x543a92[_0x7b5c('0x39')][_0x7b5c('0x43')]);_0xf45b5c[_0x7b5c('0x44')]=qs['filters'](_['pick'](_0x543a92['query'],_0x47e04c[_0x7b5c('0x45')]));if(_0x543a92[_0x7b5c('0x39')]['filter']){_0xf45b5c[_0x7b5c('0x44')]=_['merge'](_0xf45b5c['where'],{'$or':_['map'](_0x45cd72,function(_0x272f8c){if(_0x272f8c['type'][_0x7b5c('0x46')]!==_0x7b5c('0x47')){var _0x565d80={};_0x565d80[_0x272f8c['field']]={'$like':'%'+_0x543a92['query']['filter']+'%'};return _0x565d80;}})});}_0xf45b5c=_[_0x7b5c('0x48')]({},_0xf45b5c,_0x543a92[_0x7b5c('0x49')]);var _0x40d608={'where':_0xf45b5c[_0x7b5c('0x44')]};return db[_0x7b5c('0x37')][_0x7b5c('0x2a')](_0x40d608)[_0x7b5c('0x32')](function(_0x224c52){_0x29c135[_0x7b5c('0x2a')]=_0x224c52;if(_0x543a92[_0x7b5c('0x39')]['includeAll']){_0xf45b5c[_0x7b5c('0x4a')]=[{'all':!![]}];}return db[_0x7b5c('0x37')][_0x7b5c('0x4b')](_0xf45b5c);})[_0x7b5c('0x32')](function(_0xd08cb3){_0x29c135[_0x7b5c('0x4c')]=_0xd08cb3;return _0x29c135;})[_0x7b5c('0x32')](respondWithFilteredResult(_0x3b77ea,_0xf45b5c))[_0x7b5c('0x25')](handleError(_0x3b77ea,null));};exports['show']=function(_0x522fdb,_0x317d78){var _0x151da5={'raw':![],'where':{'id':_0x522fdb[_0x7b5c('0x4d')]['id']}},_0x2567c3={};_0x2567c3['model']=_[_0x7b5c('0x38')](db[_0x7b5c('0x37')][_0x7b5c('0x4e')]);_0x2567c3[_0x7b5c('0x39')]=_[_0x7b5c('0x38')](_0x522fdb[_0x7b5c('0x39')]);_0x2567c3[_0x7b5c('0x45')]=_[_0x7b5c('0x3a')](_0x2567c3[_0x7b5c('0x3b')],_0x2567c3[_0x7b5c('0x39')]);_0x151da5[_0x7b5c('0x3c')]=_['intersection'](_0x2567c3[_0x7b5c('0x3b')],qs['fields'](_0x522fdb[_0x7b5c('0x39')]['fields']));_0x151da5['attributes']=_0x151da5[_0x7b5c('0x3c')][_0x7b5c('0x3e')]?_0x151da5[_0x7b5c('0x3c')]:_0x2567c3[_0x7b5c('0x3b')];if(_0x522fdb[_0x7b5c('0x39')][_0x7b5c('0x4f')]){_0x151da5['include']=[{'all':!![]}];}_0x151da5=_[_0x7b5c('0x48')]({},_0x151da5,_0x522fdb['options']);return db[_0x7b5c('0x37')][_0x7b5c('0x50')](_0x151da5)['then'](handleEntityNotFound(_0x317d78,null))[_0x7b5c('0x32')](respondWithResult(_0x317d78,null))[_0x7b5c('0x25')](handleError(_0x317d78,null));};exports[_0x7b5c('0x51')]=function(_0x202f33,_0x7efbf){return db[_0x7b5c('0x37')]['create'](_0x202f33[_0x7b5c('0x52')],{})[_0x7b5c('0x32')](respondWithResult(_0x7efbf,0xc9))['catch'](handleError(_0x7efbf,null));};exports[_0x7b5c('0x30')]=function(_0x32e8fe,_0x5b21fe){if(_0x32e8fe[_0x7b5c('0x52')]['id']){delete _0x32e8fe['body']['id'];}return db[_0x7b5c('0x37')][_0x7b5c('0x50')]({'where':{'id':_0x32e8fe[_0x7b5c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5b21fe,null))[_0x7b5c('0x32')](saveUpdates(_0x32e8fe[_0x7b5c('0x52')],null))[_0x7b5c('0x32')](respondWithResult(_0x5b21fe,null))[_0x7b5c('0x25')](handleError(_0x5b21fe,null));};exports['destroy']=function(_0x250985,_0x4b3e2a){return db[_0x7b5c('0x37')][_0x7b5c('0x50')]({'where':{'id':_0x250985[_0x7b5c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4b3e2a,null))[_0x7b5c('0x32')](removeEntity(_0x4b3e2a,null))[_0x7b5c('0x25')](handleError(_0x4b3e2a,null));};exports[_0x7b5c('0x53')]=function(_0x3f3d76,_0x50af19,_0x31bbdf){var _0x1f8ac1={};var _0x49a702={};var _0x59f949;var _0x21af6d;return db[_0x7b5c('0x37')]['findOne']({'where':{'id':_0x3f3d76['params']['id']}})[_0x7b5c('0x32')](handleEntityNotFound(_0x50af19,null))['then'](function(_0x2bbd4a){if(_0x2bbd4a){_0x59f949=_0x2bbd4a;_0x49a702[_0x7b5c('0x3b')]=_['keys'](db[_0x7b5c('0x54')][_0x7b5c('0x4e')]);_0x49a702[_0x7b5c('0x39')]=_[_0x7b5c('0x38')](_0x3f3d76['query']);_0x49a702[_0x7b5c('0x45')]=_['intersection'](_0x49a702[_0x7b5c('0x3b')],_0x49a702['query']);_0x1f8ac1[_0x7b5c('0x3c')]=_[_0x7b5c('0x3a')](_0x49a702[_0x7b5c('0x3b')],qs['fields'](_0x3f3d76[_0x7b5c('0x39')][_0x7b5c('0x3d')]));_0x1f8ac1[_0x7b5c('0x3c')]=_0x1f8ac1[_0x7b5c('0x3c')]['length']?_0x1f8ac1['attributes']:_0x49a702['model'];_0x1f8ac1[_0x7b5c('0x42')]=qs[_0x7b5c('0x43')](_0x3f3d76['query'][_0x7b5c('0x43')]);_0x1f8ac1['where']=qs[_0x7b5c('0x45')](_[_0x7b5c('0x55')](_0x3f3d76['query'],_0x49a702[_0x7b5c('0x45')]));if(_0x3f3d76['query'][_0x7b5c('0x56')]){_0x1f8ac1[_0x7b5c('0x44')]=_[_0x7b5c('0x48')](_0x1f8ac1[_0x7b5c('0x44')],{'$or':_['map'](_0x1f8ac1['attributes'],function(_0x192815){var _0x27b8d0={};_0x27b8d0[_0x192815]={'$like':'%'+_0x3f3d76[_0x7b5c('0x39')]['filter']+'%'};return _0x27b8d0;})});}_0x1f8ac1=_[_0x7b5c('0x48')]({},_0x1f8ac1,_0x3f3d76[_0x7b5c('0x49')]);return _0x59f949[_0x7b5c('0x53')](_0x1f8ac1);}})[_0x7b5c('0x32')](function(_0x45889c){if(_0x45889c){_0x21af6d=_0x45889c[_0x7b5c('0x3e')];if(!_0x3f3d76[_0x7b5c('0x39')]['hasOwnProperty'](_0x7b5c('0x40'))){_0x1f8ac1[_0x7b5c('0x41')]=qs[_0x7b5c('0x41')](_0x3f3d76[_0x7b5c('0x39')][_0x7b5c('0x41')]);_0x1f8ac1[_0x7b5c('0x2b')]=qs[_0x7b5c('0x2b')](_0x3f3d76[_0x7b5c('0x39')][_0x7b5c('0x2b')]);}return _0x59f949['getConfigurations'](_0x1f8ac1);}})[_0x7b5c('0x32')](function(_0x2491cc){if(_0x2491cc){return _0x2491cc?{'count':_0x21af6d,'rows':_0x2491cc}:null;}})[_0x7b5c('0x32')](respondWithResult(_0x50af19,null))[_0x7b5c('0x25')](handleError(_0x50af19,null));};exports[_0x7b5c('0x57')]=function(_0x14b33c,_0x3a00ef,_0x378625){if(_0x14b33c['body']['id']){delete _0x14b33c[_0x7b5c('0x52')]['id'];}return db[_0x7b5c('0x37')][_0x7b5c('0x58')]({'where':{'id':_0x14b33c['params']['id']}})[_0x7b5c('0x32')](handleEntityNotFound(_0x3a00ef,null))[_0x7b5c('0x32')](function(_0x5195d3){if(_0x5195d3){_0x14b33c[_0x7b5c('0x52')][_0x7b5c('0x59')]=_0x5195d3['id'];_0x14b33c['body'][_0x7b5c('0x5a')]=integrations['getSubjects'](_0x14b33c['body'][_0x7b5c('0x5b')],_0x14b33c[_0x7b5c('0x52')][_0x7b5c('0x5c')]);_0x14b33c[_0x7b5c('0x52')][_0x7b5c('0x5d')]=integrations['getDescriptions'](_0x14b33c['body']['channel'],_0x14b33c[_0x7b5c('0x52')][_0x7b5c('0x5c')]);return db[_0x7b5c('0x54')][_0x7b5c('0x51')](_0x14b33c[_0x7b5c('0x52')],{'include':[{'model':db[_0x7b5c('0x5e')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0x7b5c('0x5d')}]});}return null;})['then'](respondWithResult(_0x3a00ef,null))[_0x7b5c('0x25')](handleError(_0x3a00ef,null));};exports[_0x7b5c('0x5f')]=function(_0x54b6db,_0x553d16,_0x25cc9b){var _0x47f49e='';return db[_0x7b5c('0x37')]['findOne']({'where':{'id':_0x54b6db[_0x7b5c('0x4d')]['id']},'attributes':['id',_0x7b5c('0x60'),_0x7b5c('0x61')]})[_0x7b5c('0x32')](handleEntityNotFound(_0x553d16,null))[_0x7b5c('0x32')](function(_0x13603d){if(_0x13603d){_0x47f49e=_0x13603d[_0x7b5c('0x60')];var _0x3aa5c2=_0x47f49e[_0x7b5c('0x62')](-0x1);if(_0x3aa5c2==='/'){_0x47f49e=_0x47f49e['substring'](0x0,_0x47f49e[_0x7b5c('0x63')](_0x3aa5c2));}return rp({'method':_0x7b5c('0x64'),'uri':util[_0x7b5c('0x65')](_0x7b5c('0x66'),_0x47f49e,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x7b5c('0x65')]('Basic\x20%s',new Buffer(util[_0x7b5c('0x65')](_0x7b5c('0x67'),_0x13603d['apiKey']))[_0x7b5c('0x68')](_0x7b5c('0x69')))},'json':!![]});}})[_0x7b5c('0x32')](function(_0x3db0dd){if(_0x3db0dd){var _0x2bc9d5=[_0x7b5c('0x6a'),_0x7b5c('0x6b'),'agent',_0x7b5c('0x6c'),'status',_0x7b5c('0x6d'),'group',_0x7b5c('0x6e'),'ticket_type','group','company'];_[_0x7b5c('0x6f')](_0x3db0dd,function(_0x53df0a){return _0x2bc9d5[_0x7b5c('0x70')](_0x53df0a[_0x7b5c('0x34')])||!_0x53df0a[_0x7b5c('0x71')]&&_0x53df0a[_0x7b5c('0x5c')]!==_0x7b5c('0x72')&&_0x53df0a[_0x7b5c('0x5c')]!==_0x7b5c('0x73');});return{'count':_0x3db0dd[_0x7b5c('0x3e')],'rows':_[_0x7b5c('0x74')](_0x3db0dd,function(_0x570b32){return{'id':_0x570b32[_0x7b5c('0x34')],'name':_0x570b32[_0x7b5c('0x75')],'custom':!_0x570b32[_0x7b5c('0x71')],'options':_0x570b32[_0x7b5c('0x76')]?_[_0x7b5c('0x74')](_0x570b32[_0x7b5c('0x76')],function(_0x25f294){return{'name':_[_0x7b5c('0x77')](_0x25f294),'value':_0x25f294};}):[]};})};}})[_0x7b5c('0x32')](respondWithResult(_0x553d16,null))[_0x7b5c('0x25')](function(_0x19dbce){var _0x1715af=_0x54b6db[_0x7b5c('0x39')][_0x7b5c('0x18')]?0x1f4:_0x19dbce['statusCode']||0x1f4;logger[_0x7b5c('0x20')](_0x7b5c('0x78'),_0x7b5c('0x5f'),_0x1715af,JSON[_0x7b5c('0x1f')](_0x19dbce));delete _0x19dbce[_0x7b5c('0x34')];if(_0x1715af===0x191){_0x1715af=0x190;}_0x553d16['status'](_0x1715af)[_0x7b5c('0x35')](_0x54b6db['query'][_0x7b5c('0x18')]?{'message':_0x7b5c('0x79'),'statusCode':_0x19dbce[_0x7b5c('0x7a')]}:_0x19dbce);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 062698d..769cd80 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 _0x6b87=['lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount'];(function(_0x28718e,_0x2ff7ae){var _0x54b0d9=function(_0x59fdb2){while(--_0x59fdb2){_0x28718e['push'](_0x28718e['shift']());}};_0x54b0d9(++_0x2ff7ae);}(_0x6b87,0xe4));var _0x76b8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6b87[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x76b8('0x0'));var util=require(_0x76b8('0x1'));var logger=require(_0x76b8('0x2'))('api');var moment=require(_0x76b8('0x3'));var BPromise=require('bluebird');var rp=require(_0x76b8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76b8('0x5'));var config=require(_0x76b8('0x6'));var attributes=require(_0x76b8('0x7'));var integrations=require(_0x76b8('0x8'));module[_0x76b8('0x9')]=function(_0x22eab2,_0x5dd7a7){return _0x22eab2[_0x76b8('0xa')](_0x76b8('0xb'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e6c=['define','int_freshdesk_accounts','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x2f9b1d,_0x427a07){var _0x33b340=function(_0x5c96f7){while(--_0x5c96f7){_0x2f9b1d['push'](_0x2f9b1d['shift']());}};_0x33b340(++_0x427a07);}(_0x5e6c,0x162));var _0xc5e6=function(_0x357e10,_0x18b461){_0x357e10=_0x357e10-0x0;var _0x56826d=_0x5e6c[_0x357e10];return _0x56826d;};'use strict';var _=require(_0xc5e6('0x0'));var util=require(_0xc5e6('0x1'));var logger=require('../../config/logger')(_0xc5e6('0x2'));var moment=require('moment');var BPromise=require(_0xc5e6('0x3'));var rp=require(_0xc5e6('0x4'));var fs=require('fs');var path=require(_0xc5e6('0x5'));var rimraf=require(_0xc5e6('0x6'));var config=require(_0xc5e6('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xc5e6('0x8'));module['exports']=function(_0xd3e79d,_0x3e2ba9){return _0xd3e79d[_0xc5e6('0x9')]('FreshdeskAccount',attributes,{'tableName':_0xc5e6('0xa'),'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 320e47c..7b5cd90 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 _0xcb71=['options','where','attributes','limit','include','map','model','GetFreshdeskAccount','stringify','catch','find','debug','ShowFreshdeskAccount','lodash','util','moment','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','FreshdeskAccount','findAll'];(function(_0x203b5c,_0x2384f1){var _0x20a057=function(_0x511230){while(--_0x511230){_0x203b5c['push'](_0x203b5c['shift']());}};_0x20a057(++_0x2384f1);}(_0xcb71,0x73));var _0x1cb7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcb71[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1cb7('0x0'));var util=require(_0x1cb7('0x1'));var moment=require(_0x1cb7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1cb7('0x3'))['db'];var utils=require(_0x1cb7('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x1cb7('0x5'));var jayson=require(_0x1cb7('0x6'));var client=jayson[_0x1cb7('0x7')][_0x1cb7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x684897,_0x5917ee,_0x4ed109){return new BPromise(function(_0x55a4e8,_0x2ed5ab){return client[_0x1cb7('0x9')](_0x684897,_0x4ed109)[_0x1cb7('0xa')](function(_0x32dcc1){logger['info'](_0x1cb7('0xb'),_0x5917ee,_0x1cb7('0xc'));logger['debug'](_0x1cb7('0xd'),_0x5917ee,_0x1cb7('0xc'),JSON['stringify'](_0x32dcc1));if(_0x32dcc1[_0x1cb7('0xe')]){if(_0x32dcc1['error'][_0x1cb7('0xf')]===0x1f4){logger['error'](_0x1cb7('0xb'),_0x5917ee,_0x32dcc1[_0x1cb7('0xe')][_0x1cb7('0x10')]);return _0x2ed5ab(_0x32dcc1[_0x1cb7('0xe')][_0x1cb7('0x10')]);}logger[_0x1cb7('0xe')](_0x1cb7('0xb'),_0x5917ee,_0x32dcc1[_0x1cb7('0xe')]['message']);return _0x55a4e8(_0x32dcc1[_0x1cb7('0xe')][_0x1cb7('0x10')]);}else{logger[_0x1cb7('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x5917ee,'request\x20sent');_0x55a4e8(_0x32dcc1[_0x1cb7('0x12')][_0x1cb7('0x10')]);}})['catch'](function(_0xb05f9d){logger['error'](_0x1cb7('0xb'),_0x5917ee,_0xb05f9d);_0x2ed5ab(_0xb05f9d);});});}exports['GetFreshdeskAccount']=function(_0xac8550){var _0x2eb14c=this;return new Promise(function(_0x161d77,_0x460045){return db[_0x1cb7('0x13')][_0x1cb7('0x14')]({'raw':_0xac8550[_0x1cb7('0x15')]?_0xac8550[_0x1cb7('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0xac8550[_0x1cb7('0x15')]?_0xac8550['options'][_0x1cb7('0x16')]||null:null,'attributes':_0xac8550[_0x1cb7('0x15')]?_0xac8550['options'][_0x1cb7('0x17')]||null:null,'limit':_0xac8550[_0x1cb7('0x15')]?_0xac8550[_0x1cb7('0x15')][_0x1cb7('0x18')]||null:null,'include':_0xac8550[_0x1cb7('0x15')]?_0xac8550[_0x1cb7('0x15')][_0x1cb7('0x19')]?_[_0x1cb7('0x1a')](_0xac8550[_0x1cb7('0x15')][_0x1cb7('0x19')],function(_0x482ef7){return{'model':db[_0x482ef7[_0x1cb7('0x1b')]],'as':_0x482ef7['as'],'attributes':_0x482ef7['attributes'],'include':_0x482ef7[_0x1cb7('0x19')]?_['map'](_0x482ef7[_0x1cb7('0x19')],function(_0x3d8d9a){return{'model':db[_0x3d8d9a[_0x1cb7('0x1b')]],'as':_0x3d8d9a['as'],'attributes':_0x3d8d9a[_0x1cb7('0x17')],'include':_0x3d8d9a[_0x1cb7('0x19')]?_[_0x1cb7('0x1a')](_0x3d8d9a[_0x1cb7('0x19')],function(_0x1c34a9){return{'model':db[_0x1c34a9['model']],'as':_0x1c34a9['as'],'attributes':_0x1c34a9[_0x1cb7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x1cb7('0xa')](function(_0x2374a9){logger['info'](_0x1cb7('0x1c'),_0xac8550);logger['debug'](_0x1cb7('0x1c'),_0xac8550,JSON[_0x1cb7('0x1d')](_0x2374a9));_0x161d77(_0x2374a9);})[_0x1cb7('0x1e')](function(_0x2ec428){logger[_0x1cb7('0xe')](_0x1cb7('0x1c'),_0x2ec428[_0x1cb7('0x10')],_0xac8550);_0x460045(_0x2eb14c[_0x1cb7('0xe')](0x1f4,_0x2ec428[_0x1cb7('0x10')]));});});};exports['ShowFreshdeskAccount']=function(_0x4a1128){var _0x57d9f8=this;return new Promise(function(_0x69346c,_0x543894){return db[_0x1cb7('0x13')][_0x1cb7('0x1f')]({'raw':_0x4a1128[_0x1cb7('0x15')]?_0x4a1128['options']['raw']===undefined?!![]:![]:!![],'where':_0x4a1128[_0x1cb7('0x15')]?_0x4a1128[_0x1cb7('0x15')][_0x1cb7('0x16')]||null:null,'attributes':_0x4a1128[_0x1cb7('0x15')]?_0x4a1128[_0x1cb7('0x15')][_0x1cb7('0x17')]||null:null,'include':_0x4a1128[_0x1cb7('0x15')]?_0x4a1128['options'][_0x1cb7('0x19')]?_[_0x1cb7('0x1a')](_0x4a1128[_0x1cb7('0x15')][_0x1cb7('0x19')],function(_0x29cf6a){return{'model':db[_0x29cf6a[_0x1cb7('0x1b')]],'as':_0x29cf6a['as'],'attributes':_0x29cf6a[_0x1cb7('0x17')],'include':_0x29cf6a[_0x1cb7('0x19')]?_[_0x1cb7('0x1a')](_0x29cf6a[_0x1cb7('0x19')],function(_0x2b6d5b){return{'model':db[_0x2b6d5b['model']],'as':_0x2b6d5b['as'],'attributes':_0x2b6d5b['attributes'],'include':_0x2b6d5b[_0x1cb7('0x19')]?_['map'](_0x2b6d5b[_0x1cb7('0x19')],function(_0x19117e){return{'model':db[_0x19117e[_0x1cb7('0x1b')]],'as':_0x19117e['as'],'attributes':_0x19117e['attributes']};}):[]};}):[]};}):[]:[]})[_0x1cb7('0xa')](function(_0x4f1004){logger['info']('ShowFreshdeskAccount',_0x4a1128);logger[_0x1cb7('0x20')](_0x1cb7('0x21'),_0x4a1128,JSON[_0x1cb7('0x1d')](_0x4f1004));_0x69346c(_0x4f1004);})[_0x1cb7('0x1e')](function(_0x4bd508){logger[_0x1cb7('0xe')](_0x1cb7('0x21'),_0x4bd508['message'],_0x4a1128);_0x543894(_0x57d9f8[_0x1cb7('0xe')](0x1f4,_0x4bd508['message']));});});}; \ No newline at end of file +var _0xec30=['FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','attributes','limit','include','map','model','stringify','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info'];(function(_0x7b89ee,_0x2804f9){var _0x21da34=function(_0x4155a0){while(--_0x4155a0){_0x7b89ee['push'](_0x7b89ee['shift']());}};_0x21da34(++_0x2804f9);}(_0xec30,0x1e3));var _0x0ec3=function(_0x316904,_0x1e8b77){_0x316904=_0x316904-0x0;var _0xfa9a21=_0xec30[_0x316904];return _0xfa9a21;};'use strict';var _=require(_0x0ec3('0x0'));var util=require(_0x0ec3('0x1'));var moment=require(_0x0ec3('0x2'));var BPromise=require(_0x0ec3('0x3'));var rs=require(_0x0ec3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0ec3('0x5'));var logger=require('../../config/logger')(_0x0ec3('0x6'));var config=require(_0x0ec3('0x7'));var jayson=require(_0x0ec3('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x570118,_0x3689f4,_0x319dc5){return new BPromise(function(_0x50be63,_0xd703ad){return client[_0x0ec3('0x9')](_0x570118,_0x319dc5)[_0x0ec3('0xa')](function(_0x250734){logger[_0x0ec3('0xb')](_0x0ec3('0xc'),_0x3689f4,_0x0ec3('0xd'));logger[_0x0ec3('0xe')](_0x0ec3('0xf'),_0x3689f4,'request\x20sent',JSON['stringify'](_0x250734));if(_0x250734[_0x0ec3('0x10')]){if(_0x250734[_0x0ec3('0x10')]['code']===0x1f4){logger[_0x0ec3('0x10')](_0x0ec3('0xc'),_0x3689f4,_0x250734['error'][_0x0ec3('0x11')]);return _0xd703ad(_0x250734[_0x0ec3('0x10')][_0x0ec3('0x11')]);}logger[_0x0ec3('0x10')](_0x0ec3('0xc'),_0x3689f4,_0x250734[_0x0ec3('0x10')]['message']);return _0x50be63(_0x250734['error'][_0x0ec3('0x11')]);}else{logger[_0x0ec3('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x3689f4,_0x0ec3('0xd'));_0x50be63(_0x250734[_0x0ec3('0x12')][_0x0ec3('0x11')]);}})[_0x0ec3('0x13')](function(_0x5c7af9){logger[_0x0ec3('0x10')](_0x0ec3('0xc'),_0x3689f4,_0x5c7af9);_0xd703ad(_0x5c7af9);});});}exports[_0x0ec3('0x14')]=function(_0x34d843){var _0x4aeae5=this;return new Promise(function(_0x10fbb0,_0xe2add0){return db[_0x0ec3('0x15')][_0x0ec3('0x16')]({'raw':_0x34d843[_0x0ec3('0x17')]?_0x34d843['options'][_0x0ec3('0x18')]===undefined?!![]:![]:!![],'where':_0x34d843[_0x0ec3('0x17')]?_0x34d843[_0x0ec3('0x17')]['where']||null:null,'attributes':_0x34d843[_0x0ec3('0x17')]?_0x34d843[_0x0ec3('0x17')][_0x0ec3('0x19')]||null:null,'limit':_0x34d843[_0x0ec3('0x17')]?_0x34d843[_0x0ec3('0x17')][_0x0ec3('0x1a')]||null:null,'include':_0x34d843[_0x0ec3('0x17')]?_0x34d843[_0x0ec3('0x17')][_0x0ec3('0x1b')]?_[_0x0ec3('0x1c')](_0x34d843[_0x0ec3('0x17')][_0x0ec3('0x1b')],function(_0x2edff5){return{'model':db[_0x2edff5['model']],'as':_0x2edff5['as'],'attributes':_0x2edff5[_0x0ec3('0x19')],'include':_0x2edff5['include']?_[_0x0ec3('0x1c')](_0x2edff5[_0x0ec3('0x1b')],function(_0x195588){return{'model':db[_0x195588[_0x0ec3('0x1d')]],'as':_0x195588['as'],'attributes':_0x195588[_0x0ec3('0x19')],'include':_0x195588['include']?_[_0x0ec3('0x1c')](_0x195588[_0x0ec3('0x1b')],function(_0x398da5){return{'model':db[_0x398da5[_0x0ec3('0x1d')]],'as':_0x398da5['as'],'attributes':_0x398da5[_0x0ec3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0ec3('0xa')](function(_0x4fc488){logger[_0x0ec3('0xb')](_0x0ec3('0x14'),_0x34d843);logger[_0x0ec3('0xe')](_0x0ec3('0x14'),_0x34d843,JSON[_0x0ec3('0x1e')](_0x4fc488));_0x10fbb0(_0x4fc488);})[_0x0ec3('0x13')](function(_0x546314){logger[_0x0ec3('0x10')]('GetFreshdeskAccount',_0x546314[_0x0ec3('0x11')],_0x34d843);_0xe2add0(_0x4aeae5[_0x0ec3('0x10')](0x1f4,_0x546314['message']));});});};exports[_0x0ec3('0x1f')]=function(_0xb885eb){var _0x3f84bc=this;return new Promise(function(_0x50cb4a,_0x480e67){return db[_0x0ec3('0x15')][_0x0ec3('0x20')]({'raw':_0xb885eb[_0x0ec3('0x17')]?_0xb885eb[_0x0ec3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xb885eb[_0x0ec3('0x17')]?_0xb885eb[_0x0ec3('0x17')]['where']||null:null,'attributes':_0xb885eb['options']?_0xb885eb[_0x0ec3('0x17')]['attributes']||null:null,'include':_0xb885eb[_0x0ec3('0x17')]?_0xb885eb[_0x0ec3('0x17')][_0x0ec3('0x1b')]?_[_0x0ec3('0x1c')](_0xb885eb[_0x0ec3('0x17')][_0x0ec3('0x1b')],function(_0x312cd1){return{'model':db[_0x312cd1['model']],'as':_0x312cd1['as'],'attributes':_0x312cd1['attributes'],'include':_0x312cd1[_0x0ec3('0x1b')]?_[_0x0ec3('0x1c')](_0x312cd1[_0x0ec3('0x1b')],function(_0xd0f5fa){return{'model':db[_0xd0f5fa[_0x0ec3('0x1d')]],'as':_0xd0f5fa['as'],'attributes':_0xd0f5fa[_0x0ec3('0x19')],'include':_0xd0f5fa['include']?_[_0x0ec3('0x1c')](_0xd0f5fa[_0x0ec3('0x1b')],function(_0x10f76c){return{'model':db[_0x10f76c[_0x0ec3('0x1d')]],'as':_0x10f76c['as'],'attributes':_0x10f76c[_0x0ec3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0ec3('0xa')](function(_0x20d861){logger[_0x0ec3('0xb')](_0x0ec3('0x1f'),_0xb885eb);logger[_0x0ec3('0xe')](_0x0ec3('0x1f'),_0xb885eb,JSON[_0x0ec3('0x1e')](_0x20d861));_0x50cb4a(_0x20d861);})[_0x0ec3('0x13')](function(_0x1dc74b){logger['error'](_0x0ec3('0x1f'),_0x1dc74b[_0x0ec3('0x11')],_0xb885eb);_0x480e67(_0x3f84bc['error'](0x1f4,_0x1dc74b[_0x0ec3('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index bc36ea7..c992f46 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 _0xb526=['delete','exports','util','path','connect-timeout','Router','../../components/auth/service','./intFreshdeskConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','/:id','update'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xb526,0xaa));var _0x6b52=function(_0x4a96ca,_0x13754e){_0x4a96ca=_0x4a96ca-0x0;var _0x2aed48=_0xb526[_0x4a96ca];return _0x2aed48;};'use strict';var multer=require('multer');var util=require(_0x6b52('0x0'));var path=require(_0x6b52('0x1'));var timeout=require(_0x6b52('0x2'));var express=require('express');var router=express[_0x6b52('0x3')]();var auth=require(_0x6b52('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6b52('0x5'));router[_0x6b52('0x6')]('/',auth['isAuthenticated'](),controller[_0x6b52('0x7')]);router['get']('/:id',auth[_0x6b52('0x8')](),controller[_0x6b52('0x9')]);router[_0x6b52('0x6')](_0x6b52('0xa'),auth[_0x6b52('0x8')](),controller[_0x6b52('0xb')]);router[_0x6b52('0x6')](_0x6b52('0xc'),auth[_0x6b52('0x8')](),controller['getSubjects']);router[_0x6b52('0x6')](_0x6b52('0xd'),auth[_0x6b52('0x8')](),controller[_0x6b52('0xe')]);router[_0x6b52('0x6')](_0x6b52('0xf'),auth['isAuthenticated'](),controller[_0x6b52('0x10')]);router['post']('/',auth[_0x6b52('0x8')](),controller[_0x6b52('0x11')]);router[_0x6b52('0x12')]('/:id/tags',auth[_0x6b52('0x8')](),controller[_0x6b52('0x13')]);router['put'](_0x6b52('0x14'),auth[_0x6b52('0x8')](),controller[_0x6b52('0x15')]);router[_0x6b52('0x16')](_0x6b52('0x14'),auth['isAuthenticated'](),controller['destroy']);module[_0x6b52('0x17')]=router; \ No newline at end of file +var _0xfb20=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','setTags','put','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x334e85,_0x53303a){var _0x10e540=function(_0x31d7e0){while(--_0x31d7e0){_0x334e85['push'](_0x334e85['shift']());}};_0x10e540(++_0x53303a);}(_0xfb20,0x98));var _0x0fb2=function(_0x1529a3,_0x529f63){_0x1529a3=_0x1529a3-0x0;var _0x1a0d4b=_0xfb20[_0x1529a3];return _0x1a0d4b;};'use strict';var multer=require('multer');var util=require(_0x0fb2('0x0'));var path=require(_0x0fb2('0x1'));var timeout=require(_0x0fb2('0x2'));var express=require(_0x0fb2('0x3'));var router=express[_0x0fb2('0x4')]();var auth=require(_0x0fb2('0x5'));var interaction=require(_0x0fb2('0x6'));var config=require(_0x0fb2('0x7'));var controller=require(_0x0fb2('0x8'));router[_0x0fb2('0x9')]('/',auth['isAuthenticated'](),controller[_0x0fb2('0xa')]);router[_0x0fb2('0x9')](_0x0fb2('0xb'),auth[_0x0fb2('0xc')](),controller[_0x0fb2('0xd')]);router[_0x0fb2('0x9')](_0x0fb2('0xe'),auth[_0x0fb2('0xc')](),controller['getFields']);router[_0x0fb2('0x9')](_0x0fb2('0xf'),auth[_0x0fb2('0xc')](),controller[_0x0fb2('0x10')]);router['get']('/:id/descriptions',auth[_0x0fb2('0xc')](),controller[_0x0fb2('0x11')]);router['get'](_0x0fb2('0x12'),auth['isAuthenticated'](),controller[_0x0fb2('0x13')]);router[_0x0fb2('0x14')]('/',auth[_0x0fb2('0xc')](),controller['create']);router[_0x0fb2('0x14')](_0x0fb2('0x12'),auth[_0x0fb2('0xc')](),controller[_0x0fb2('0x15')]);router[_0x0fb2('0x16')]('/:id',auth[_0x0fb2('0xc')](),controller[_0x0fb2('0x17')]);router[_0x0fb2('0x18')](_0x0fb2('0xb'),auth[_0x0fb2('0xc')](),controller[_0x0fb2('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 2b0e21c..b81c35a 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 _0x4e25=['exports','STRING'];(function(_0x315e82,_0x2ffa8c){var _0x42b37c=function(_0x134837){while(--_0x134837){_0x315e82['push'](_0x315e82['shift']());}};_0x42b37c(++_0x2ffa8c);}(_0x4e25,0x78));var _0x54e2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4e25[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0x54e2('0x0')]={'name':{'type':Sequelize[_0x54e2('0x1')]},'description':{'type':Sequelize[_0x54e2('0x1')]}}; \ No newline at end of file +var _0x40a4=['sequelize'];(function(_0x4f69dd,_0x5c3d60){var _0x3beb46=function(_0x4ad2ac){while(--_0x4ad2ac){_0x4f69dd['push'](_0x4f69dd['shift']());}};_0x3beb46(++_0x5c3d60);}(_0x40a4,0xd7));var _0x440a=function(_0x1dad88,_0x1449a0){_0x1dad88=_0x1dad88-0x0;var _0x19a3d3=_0x40a4[_0x1dad88];return _0x19a3d3;};'use strict';var Sequelize=require(_0x440a('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index ee24d3f..3ec925d 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 _0xcb59=['field','filter','options','includeAll','include','findAll','show','params','keys','rawAttributes','fields','length','create','body','find','destroy','getFields','findOne','FreshdeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','setTags','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../mysqldb','jayson/promise','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','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','stack','name','index','FreshdeskConfiguration','query','filters','model','intersection','attributes','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcb59,0x120));var _0x9cb5=function(_0x24ec18,_0x1c54e1){_0x24ec18=_0x24ec18-0x0;var _0x31c6ff=_0xcb59[_0x24ec18];return _0x31c6ff;};'use strict';var pdf=require(_0x9cb5('0x0'));var emlformat=require(_0x9cb5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9cb5('0x2'));var jsonpatch=require(_0x9cb5('0x3'));var rp=require(_0x9cb5('0x4'));var moment=require(_0x9cb5('0x5'));var BPromise=require(_0x9cb5('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9cb5('0x7'));var sox=require(_0x9cb5('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9cb5('0x9'));var squel=require(_0x9cb5('0xa'));var crypto=require('crypto');var jsforce=require(_0x9cb5('0xb'));var deskjs=require(_0x9cb5('0xc'));var toCsv=require(_0x9cb5('0xd'));var querystring=require(_0x9cb5('0xe'));var Papa=require(_0x9cb5('0xf'));var Redis=require('ioredis');var authService=require(_0x9cb5('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9cb5('0x11'))(_0x9cb5('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x9cb5('0x13'))['db'];var jayson=require(_0x9cb5('0x14'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x3115fe,_0xf7606d,_0x1a3d28){if(_0x1a3d28){var _0x6f491b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6f491b[_0x9cb5('0x15')](_0xf7606d)){return _0x3115fe;}else{throw new Error(_0x9cb5('0x16'));}}else{return _0x3115fe;}}function respondWithRpcPromise(_0x333e43,_0x175c40,_0x29f6f2,_0x32e754){return new BPromise(function(_0x15d537,_0x461b9b){var _0x351f10=_0x32e754||client;return _0x351f10[_0x9cb5('0x17')](_0x333e43,_0x29f6f2)[_0x9cb5('0x18')](function(_0x2777b1){logger['info'](_0x9cb5('0x19'),_0x175c40,_0x9cb5('0x1a'));logger[_0x9cb5('0x1b')](_0x9cb5('0x1c'),_0x175c40,'request\x20sent',JSON['stringify'](_0x2777b1));if(_0x2777b1[_0x9cb5('0x1d')]){if(_0x2777b1[_0x9cb5('0x1d')][_0x9cb5('0x1e')]===0x1f4){logger[_0x9cb5('0x1d')](_0x9cb5('0x19'),_0x175c40,_0x2777b1[_0x9cb5('0x1d')][_0x9cb5('0x1f')]);return _0x461b9b(_0x2777b1[_0x9cb5('0x1d')][_0x9cb5('0x1f')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x175c40,_0x2777b1['error'][_0x9cb5('0x1f')]);return _0x15d537(_0x2777b1[_0x9cb5('0x1d')][_0x9cb5('0x1f')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x175c40,_0x9cb5('0x1a'));_0x15d537(_0x2777b1[_0x9cb5('0x20')]['message']);}})[_0x9cb5('0x21')](function(_0x109c7c){logger[_0x9cb5('0x1d')](_0x9cb5('0x19'),_0x175c40,_0x109c7c);_0x461b9b(_0x109c7c);});});}function respondWithStatusCode(_0x40e46c,_0x194581){_0x194581=_0x194581||0xcc;return function(_0x4e0937){if(_0x4e0937){return _0x40e46c[_0x9cb5('0x22')](_0x194581);}return _0x40e46c['status'](_0x194581)[_0x9cb5('0x23')]();};}function respondWithResult(_0x3e2963,_0x4626ac){_0x4626ac=_0x4626ac||0xc8;return function(_0x509cd9){if(_0x509cd9){return _0x3e2963[_0x9cb5('0x24')](_0x4626ac)[_0x9cb5('0x25')](_0x509cd9);}};}function respondWithFilteredResult(_0x35303c,_0x47a40f){return function(_0x4fe0be){if(_0x4fe0be){var _0x8f81e1=_0x4fe0be[_0x9cb5('0x26')],_0x14b841=_0x47a40f[_0x9cb5('0x27')],_0x3a11dd=_0x47a40f['offset']+_0x47a40f[_0x9cb5('0x28')],_0x15dbdd;if(_0x3a11dd>=_0x8f81e1){_0x3a11dd=_0x8f81e1;_0x15dbdd=0xc8;}else{_0x15dbdd=0xce;}_0x35303c[_0x9cb5('0x24')](_0x15dbdd);return _0x35303c[_0x9cb5('0x29')]('Content-Range',_0x14b841+'-'+_0x3a11dd+'/'+_0x8f81e1)[_0x9cb5('0x25')](_0x4fe0be);}return null;};}function patchUpdates(_0x1a432a){return function(_0x5af25f){try{jsonpatch[_0x9cb5('0x2a')](_0x5af25f,_0x1a432a,!![]);}catch(_0x337146){return BPromise[_0x9cb5('0x2b')](_0x337146);}return _0x5af25f[_0x9cb5('0x2c')]();};}function saveUpdates(_0x30c5d6,_0xad6e18){return function(_0x504385){if(_0x504385){return _0x504385['update'](_0x30c5d6)[_0x9cb5('0x18')](function(_0x465969){return _0x465969;});}return null;};}function removeEntity(_0xbb164,_0x4ea261){return function(_0x39ca53){if(_0x39ca53){return _0x39ca53['destroy']()['then'](function(){_0xbb164[_0x9cb5('0x24')](0xcc)[_0x9cb5('0x23')]();});}};}function handleEntityNotFound(_0x3f77a1,_0x242f9b){return function(_0x2e152b){if(!_0x2e152b){_0x3f77a1[_0x9cb5('0x22')](0x194);}return _0x2e152b;};}function handleError(_0x16c7ea,_0x23ce33){_0x23ce33=_0x23ce33||0x1f4;return function(_0x3597a0){logger[_0x9cb5('0x1d')](_0x3597a0[_0x9cb5('0x2d')]);if(_0x3597a0[_0x9cb5('0x2e')]){delete _0x3597a0[_0x9cb5('0x2e')];}_0x16c7ea['status'](_0x23ce33)['send'](_0x3597a0);};}exports[_0x9cb5('0x2f')]=function(_0x161ebc,_0x2ddc97){var _0x42e8ce={},_0x18370e={},_0x3d0ec2={'count':0x0,'rows':[]};var _0x527d9c=db[_0x9cb5('0x30')]['rawAttributes'];_0x18370e['model']=_['keys'](_0x527d9c);_0x18370e[_0x9cb5('0x31')]=_['keys'](_0x161ebc[_0x9cb5('0x31')]);_0x18370e[_0x9cb5('0x32')]=_['intersection'](_0x18370e[_0x9cb5('0x33')],_0x18370e[_0x9cb5('0x31')]);_0x42e8ce['attributes']=_[_0x9cb5('0x34')](_0x18370e['model'],qs['fields'](_0x161ebc[_0x9cb5('0x31')]['fields']));_0x42e8ce[_0x9cb5('0x35')]=_0x42e8ce['attributes']['length']?_0x42e8ce['attributes']:_0x18370e[_0x9cb5('0x33')];if(!_0x161ebc[_0x9cb5('0x31')]['hasOwnProperty'](_0x9cb5('0x36'))){_0x42e8ce[_0x9cb5('0x28')]=qs[_0x9cb5('0x28')](_0x161ebc['query'][_0x9cb5('0x28')]);_0x42e8ce[_0x9cb5('0x27')]=qs[_0x9cb5('0x27')](_0x161ebc[_0x9cb5('0x31')][_0x9cb5('0x27')]);}_0x42e8ce[_0x9cb5('0x37')]=qs[_0x9cb5('0x38')](_0x161ebc[_0x9cb5('0x31')][_0x9cb5('0x38')]);_0x42e8ce[_0x9cb5('0x39')]=qs[_0x9cb5('0x32')](_[_0x9cb5('0x3a')](_0x161ebc[_0x9cb5('0x31')],_0x18370e[_0x9cb5('0x32')]));if(_0x161ebc[_0x9cb5('0x31')]['filter']){_0x42e8ce[_0x9cb5('0x39')]=_[_0x9cb5('0x3b')](_0x42e8ce['where'],{'$or':_[_0x9cb5('0x3c')](_0x527d9c,function(_0xe4209b){if(_0xe4209b[_0x9cb5('0x3d')][_0x9cb5('0x3e')]!==_0x9cb5('0x3f')){var _0x46dbad={};_0x46dbad[_0xe4209b[_0x9cb5('0x40')]]={'$like':'%'+_0x161ebc[_0x9cb5('0x31')][_0x9cb5('0x41')]+'%'};return _0x46dbad;}})});}_0x42e8ce=_[_0x9cb5('0x3b')]({},_0x42e8ce,_0x161ebc[_0x9cb5('0x42')]);var _0x10186e={'where':_0x42e8ce[_0x9cb5('0x39')]};return db[_0x9cb5('0x30')]['count'](_0x10186e)[_0x9cb5('0x18')](function(_0x49a9b8){_0x3d0ec2[_0x9cb5('0x26')]=_0x49a9b8;if(_0x161ebc[_0x9cb5('0x31')][_0x9cb5('0x43')]){_0x42e8ce[_0x9cb5('0x44')]=[{'all':!![]}];}return db[_0x9cb5('0x30')][_0x9cb5('0x45')](_0x42e8ce);})['then'](function(_0x54584d){_0x3d0ec2['rows']=_0x54584d;return _0x3d0ec2;})[_0x9cb5('0x18')](respondWithFilteredResult(_0x2ddc97,_0x42e8ce))[_0x9cb5('0x21')](handleError(_0x2ddc97,null));};exports[_0x9cb5('0x46')]=function(_0x2a9d23,_0x54c3af){var _0x36e9f7={'raw':![],'where':{'id':_0x2a9d23[_0x9cb5('0x47')]['id']}},_0x5bba71={};_0x5bba71[_0x9cb5('0x33')]=_[_0x9cb5('0x48')](db[_0x9cb5('0x30')][_0x9cb5('0x49')]);_0x5bba71[_0x9cb5('0x31')]=_[_0x9cb5('0x48')](_0x2a9d23[_0x9cb5('0x31')]);_0x5bba71[_0x9cb5('0x32')]=_[_0x9cb5('0x34')](_0x5bba71[_0x9cb5('0x33')],_0x5bba71[_0x9cb5('0x31')]);_0x36e9f7[_0x9cb5('0x35')]=_[_0x9cb5('0x34')](_0x5bba71['model'],qs[_0x9cb5('0x4a')](_0x2a9d23['query'][_0x9cb5('0x4a')]));_0x36e9f7[_0x9cb5('0x35')]=_0x36e9f7[_0x9cb5('0x35')][_0x9cb5('0x4b')]?_0x36e9f7['attributes']:_0x5bba71[_0x9cb5('0x33')];if(_0x2a9d23[_0x9cb5('0x31')][_0x9cb5('0x43')]){_0x36e9f7['include']=[{'all':!![]}];}_0x36e9f7=_[_0x9cb5('0x3b')]({},_0x36e9f7,_0x2a9d23['options']);return db[_0x9cb5('0x30')]['find'](_0x36e9f7)[_0x9cb5('0x18')](handleEntityNotFound(_0x54c3af,null))[_0x9cb5('0x18')](respondWithResult(_0x54c3af,null))['catch'](handleError(_0x54c3af,null));};exports[_0x9cb5('0x4c')]=function(_0x3af648,_0xefb318){return db['FreshdeskConfiguration']['create'](_0x3af648[_0x9cb5('0x4d')],{})[_0x9cb5('0x18')](respondWithResult(_0xefb318,0xc9))[_0x9cb5('0x21')](handleError(_0xefb318,null));};exports['update']=function(_0xe38508,_0x5a2eb0){if(_0xe38508['body']['id']){delete _0xe38508[_0x9cb5('0x4d')]['id'];}return db[_0x9cb5('0x30')][_0x9cb5('0x4e')]({'where':{'id':_0xe38508['params']['id']}})['then'](handleEntityNotFound(_0x5a2eb0,null))['then'](saveUpdates(_0xe38508[_0x9cb5('0x4d')],null))[_0x9cb5('0x18')](respondWithResult(_0x5a2eb0,null))['catch'](handleError(_0x5a2eb0,null));};exports[_0x9cb5('0x4f')]=function(_0x4360be,_0x386c2a){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x4360be[_0x9cb5('0x47')]['id']}})['then'](handleEntityNotFound(_0x386c2a,null))[_0x9cb5('0x18')](removeEntity(_0x386c2a,null))[_0x9cb5('0x21')](handleError(_0x386c2a,null));};exports[_0x9cb5('0x50')]=function(_0x1be3a3,_0xc2658,_0x3410c6){var _0x3e4f1d={};var _0x45ea5a={};var _0x875bc6;var _0x1cb1df;return db[_0x9cb5('0x30')][_0x9cb5('0x51')]({'where':{'id':_0x1be3a3[_0x9cb5('0x47')]['id']}})[_0x9cb5('0x18')](handleEntityNotFound(_0xc2658,null))[_0x9cb5('0x18')](function(_0x14c066){if(_0x14c066){_0x875bc6=_0x14c066;_0x45ea5a[_0x9cb5('0x33')]=_['keys'](db[_0x9cb5('0x52')]['rawAttributes']);_0x45ea5a['query']=_['keys'](_0x1be3a3[_0x9cb5('0x31')]);_0x45ea5a['filters']=_[_0x9cb5('0x34')](_0x45ea5a['model'],_0x45ea5a[_0x9cb5('0x31')]);_0x3e4f1d[_0x9cb5('0x35')]=_[_0x9cb5('0x34')](_0x45ea5a['model'],qs[_0x9cb5('0x4a')](_0x1be3a3[_0x9cb5('0x31')][_0x9cb5('0x4a')]));_0x3e4f1d[_0x9cb5('0x35')]=_0x3e4f1d[_0x9cb5('0x35')][_0x9cb5('0x4b')]?_0x3e4f1d[_0x9cb5('0x35')]:_0x45ea5a['model'];_0x3e4f1d[_0x9cb5('0x37')]=qs['sort'](_0x1be3a3[_0x9cb5('0x31')][_0x9cb5('0x38')]);_0x3e4f1d['where']=qs[_0x9cb5('0x32')](_[_0x9cb5('0x3a')](_0x1be3a3[_0x9cb5('0x31')],_0x45ea5a['filters']));if(_0x1be3a3[_0x9cb5('0x31')][_0x9cb5('0x41')]){_0x3e4f1d['where']=_['merge'](_0x3e4f1d[_0x9cb5('0x39')],{'$or':_['map'](_0x3e4f1d['attributes'],function(_0x1162eb){var _0x584abb={};_0x584abb[_0x1162eb]={'$like':'%'+_0x1be3a3['query'][_0x9cb5('0x41')]+'%'};return _0x584abb;})});}_0x3e4f1d=_[_0x9cb5('0x3b')]({},_0x3e4f1d,_0x1be3a3[_0x9cb5('0x42')]);return _0x875bc6[_0x9cb5('0x50')](_0x3e4f1d);}})['then'](function(_0x46790a){if(_0x46790a){_0x1cb1df=_0x46790a[_0x9cb5('0x4b')];if(!_0x1be3a3[_0x9cb5('0x31')][_0x9cb5('0x53')](_0x9cb5('0x36'))){_0x3e4f1d['limit']=qs['limit'](_0x1be3a3['query']['limit']);_0x3e4f1d[_0x9cb5('0x27')]=qs[_0x9cb5('0x27')](_0x1be3a3[_0x9cb5('0x31')][_0x9cb5('0x27')]);}return _0x875bc6[_0x9cb5('0x50')](_0x3e4f1d);}})[_0x9cb5('0x18')](function(_0x5ec50f){if(_0x5ec50f){return _0x5ec50f?{'count':_0x1cb1df,'rows':_0x5ec50f}:null;}})['then'](respondWithResult(_0xc2658,null))[_0x9cb5('0x21')](handleError(_0xc2658,null));};exports[_0x9cb5('0x54')]=function(_0x405278,_0x1ebd25,_0x43959f){var _0x5be047={};var _0x35f2a9={};var _0x5e1fbe;var _0x4d4da6;return db[_0x9cb5('0x30')][_0x9cb5('0x51')]({'where':{'id':_0x405278[_0x9cb5('0x47')]['id']}})[_0x9cb5('0x18')](handleEntityNotFound(_0x1ebd25,null))[_0x9cb5('0x18')](function(_0x178f38){if(_0x178f38){_0x5e1fbe=_0x178f38;_0x35f2a9[_0x9cb5('0x33')]=_['keys'](db[_0x9cb5('0x52')]['rawAttributes']);_0x35f2a9[_0x9cb5('0x31')]=_['keys'](_0x405278[_0x9cb5('0x31')]);_0x35f2a9[_0x9cb5('0x32')]=_['intersection'](_0x35f2a9['model'],_0x35f2a9['query']);_0x5be047['attributes']=_[_0x9cb5('0x34')](_0x35f2a9['model'],qs['fields'](_0x405278['query'][_0x9cb5('0x4a')]));_0x5be047[_0x9cb5('0x35')]=_0x5be047['attributes']['length']?_0x5be047[_0x9cb5('0x35')]:_0x35f2a9[_0x9cb5('0x33')];_0x5be047[_0x9cb5('0x37')]=qs[_0x9cb5('0x38')](_0x405278[_0x9cb5('0x31')][_0x9cb5('0x38')]);_0x5be047[_0x9cb5('0x39')]=qs[_0x9cb5('0x32')](_[_0x9cb5('0x3a')](_0x405278[_0x9cb5('0x31')],_0x35f2a9[_0x9cb5('0x32')]));if(_0x405278[_0x9cb5('0x31')][_0x9cb5('0x41')]){_0x5be047[_0x9cb5('0x39')]=_[_0x9cb5('0x3b')](_0x5be047['where'],{'$or':_['map'](_0x5be047[_0x9cb5('0x35')],function(_0x240af7){var _0x3f4c61={};_0x3f4c61[_0x240af7]={'$like':'%'+_0x405278['query'][_0x9cb5('0x41')]+'%'};return _0x3f4c61;})});}_0x5be047=_[_0x9cb5('0x3b')]({},_0x5be047,_0x405278['options']);return _0x5e1fbe[_0x9cb5('0x54')](_0x5be047);}})['then'](function(_0x8c3d8f){if(_0x8c3d8f){_0x4d4da6=_0x8c3d8f[_0x9cb5('0x4b')];if(!_0x405278['query']['hasOwnProperty']('nolimit')){_0x5be047[_0x9cb5('0x28')]=qs[_0x9cb5('0x28')](_0x405278[_0x9cb5('0x31')][_0x9cb5('0x28')]);_0x5be047[_0x9cb5('0x27')]=qs[_0x9cb5('0x27')](_0x405278[_0x9cb5('0x31')]['offset']);}return _0x5e1fbe[_0x9cb5('0x54')](_0x5be047);}})[_0x9cb5('0x18')](function(_0x5b6e26){if(_0x5b6e26){return _0x5b6e26?{'count':_0x4d4da6,'rows':_0x5b6e26}:null;}})[_0x9cb5('0x18')](respondWithResult(_0x1ebd25,null))[_0x9cb5('0x21')](handleError(_0x1ebd25,null));};exports[_0x9cb5('0x55')]=function(_0x298800,_0x558b81,_0x392d40){var _0x199e0b={};var _0x3ce2bd={};var _0x116932;var _0x1456af;return db[_0x9cb5('0x30')]['findOne']({'where':{'id':_0x298800[_0x9cb5('0x47')]['id']}})[_0x9cb5('0x18')](handleEntityNotFound(_0x558b81,null))[_0x9cb5('0x18')](function(_0x229e4c){if(_0x229e4c){_0x116932=_0x229e4c;_0x3ce2bd[_0x9cb5('0x33')]=_[_0x9cb5('0x48')](db[_0x9cb5('0x52')][_0x9cb5('0x49')]);_0x3ce2bd['query']=_[_0x9cb5('0x48')](_0x298800[_0x9cb5('0x31')]);_0x3ce2bd[_0x9cb5('0x32')]=_[_0x9cb5('0x34')](_0x3ce2bd[_0x9cb5('0x33')],_0x3ce2bd[_0x9cb5('0x31')]);_0x199e0b[_0x9cb5('0x35')]=_[_0x9cb5('0x34')](_0x3ce2bd[_0x9cb5('0x33')],qs[_0x9cb5('0x4a')](_0x298800[_0x9cb5('0x31')][_0x9cb5('0x4a')]));_0x199e0b[_0x9cb5('0x35')]=_0x199e0b['attributes']['length']?_0x199e0b[_0x9cb5('0x35')]:_0x3ce2bd[_0x9cb5('0x33')];_0x199e0b[_0x9cb5('0x37')]=qs['sort'](_0x298800['query'][_0x9cb5('0x38')]);_0x199e0b['where']=qs[_0x9cb5('0x32')](_[_0x9cb5('0x3a')](_0x298800[_0x9cb5('0x31')],_0x3ce2bd[_0x9cb5('0x32')]));if(_0x298800['query'][_0x9cb5('0x41')]){_0x199e0b[_0x9cb5('0x39')]=_[_0x9cb5('0x3b')](_0x199e0b[_0x9cb5('0x39')],{'$or':_[_0x9cb5('0x3c')](_0x199e0b['attributes'],function(_0x121d14){var _0x55e6e8={};_0x55e6e8[_0x121d14]={'$like':'%'+_0x298800['query'][_0x9cb5('0x41')]+'%'};return _0x55e6e8;})});}_0x199e0b=_[_0x9cb5('0x3b')]({},_0x199e0b,_0x298800[_0x9cb5('0x42')]);return _0x116932[_0x9cb5('0x55')](_0x199e0b);}})['then'](function(_0x409c4c){if(_0x409c4c){_0x1456af=_0x409c4c['length'];if(!_0x298800[_0x9cb5('0x31')]['hasOwnProperty'](_0x9cb5('0x36'))){_0x199e0b[_0x9cb5('0x28')]=qs[_0x9cb5('0x28')](_0x298800[_0x9cb5('0x31')][_0x9cb5('0x28')]);_0x199e0b[_0x9cb5('0x27')]=qs[_0x9cb5('0x27')](_0x298800[_0x9cb5('0x31')][_0x9cb5('0x27')]);}return _0x116932[_0x9cb5('0x55')](_0x199e0b);}})[_0x9cb5('0x18')](function(_0x4504bf){if(_0x4504bf){return _0x4504bf?{'count':_0x1456af,'rows':_0x4504bf}:null;}})[_0x9cb5('0x18')](respondWithResult(_0x558b81,null))[_0x9cb5('0x21')](handleError(_0x558b81,null));};exports[_0x9cb5('0x56')]=function(_0x50fb81,_0x135bf4,_0xf12366){var _0x5401e1={};var _0x8d0058={};var _0x570fb0;var _0xba4443;return db['FreshdeskConfiguration'][_0x9cb5('0x51')]({'where':{'id':_0x50fb81[_0x9cb5('0x47')]['id']}})[_0x9cb5('0x18')](handleEntityNotFound(_0x135bf4,null))[_0x9cb5('0x18')](function(_0xd6d0d9){if(_0xd6d0d9){_0x570fb0=_0xd6d0d9;_0x8d0058[_0x9cb5('0x33')]=_['keys'](db['Tag'][_0x9cb5('0x49')]);_0x8d0058[_0x9cb5('0x31')]=_[_0x9cb5('0x48')](_0x50fb81[_0x9cb5('0x31')]);_0x8d0058[_0x9cb5('0x32')]=_['intersection'](_0x8d0058['model'],_0x8d0058[_0x9cb5('0x31')]);_0x5401e1[_0x9cb5('0x35')]=_['intersection'](_0x8d0058['model'],qs[_0x9cb5('0x4a')](_0x50fb81[_0x9cb5('0x31')]['fields']));_0x5401e1['attributes']=_0x5401e1[_0x9cb5('0x35')]['length']?_0x5401e1[_0x9cb5('0x35')]:_0x8d0058['model'];_0x5401e1[_0x9cb5('0x37')]=qs['sort'](_0x50fb81[_0x9cb5('0x31')][_0x9cb5('0x38')]);_0x5401e1['where']=qs[_0x9cb5('0x32')](_[_0x9cb5('0x3a')](_0x50fb81[_0x9cb5('0x31')],_0x8d0058[_0x9cb5('0x32')]));if(_0x50fb81['query'][_0x9cb5('0x41')]){_0x5401e1[_0x9cb5('0x39')]=_[_0x9cb5('0x3b')](_0x5401e1[_0x9cb5('0x39')],{'$or':_['map'](_0x5401e1[_0x9cb5('0x35')],function(_0x1bb8e9){var _0x3c5ffa={};_0x3c5ffa[_0x1bb8e9]={'$like':'%'+_0x50fb81[_0x9cb5('0x31')][_0x9cb5('0x41')]+'%'};return _0x3c5ffa;})});}_0x5401e1=_[_0x9cb5('0x3b')]({},_0x5401e1,_0x50fb81[_0x9cb5('0x42')]);return _0x570fb0[_0x9cb5('0x56')](_0x5401e1);}})['then'](function(_0x1d90d0){if(_0x1d90d0){_0xba4443=_0x1d90d0[_0x9cb5('0x4b')];if(!_0x50fb81[_0x9cb5('0x31')]['hasOwnProperty']('nolimit')){_0x5401e1[_0x9cb5('0x28')]=qs[_0x9cb5('0x28')](_0x50fb81[_0x9cb5('0x31')][_0x9cb5('0x28')]);_0x5401e1[_0x9cb5('0x27')]=qs[_0x9cb5('0x27')](_0x50fb81[_0x9cb5('0x31')][_0x9cb5('0x27')]);}return _0x570fb0['getTags'](_0x5401e1);}})[_0x9cb5('0x18')](function(_0x2d8e91){if(_0x2d8e91){return _0x2d8e91?{'count':_0xba4443,'rows':_0x2d8e91}:null;}})[_0x9cb5('0x18')](respondWithResult(_0x135bf4,null))[_0x9cb5('0x21')](handleError(_0x135bf4,null));};exports[_0x9cb5('0x57')]=function(_0x2eb6cd,_0x58bca1,_0xf85fbc){if(_0x2eb6cd[_0x9cb5('0x4d')]['id']){delete _0x2eb6cd['body']['id'];}return db['FreshdeskConfiguration'][_0x9cb5('0x51')]({'where':{'id':_0x2eb6cd[_0x9cb5('0x47')]['id']}})[_0x9cb5('0x18')](handleEntityNotFound(_0x58bca1,null))[_0x9cb5('0x18')](function(_0x5e2f69){if(_0x5e2f69){return _0x5e2f69[_0x9cb5('0x57')](_0x2eb6cd[_0x9cb5('0x4d')]['ids']||[]);}return null;})['then'](respondWithResult(_0x58bca1,null))[_0x9cb5('0x21')](handleError(_0x58bca1,null));}; \ No newline at end of file +var _0x90f2=['VIRTUAL','field','options','includeAll','include','catch','show','params','find','create','body','getFields','findOne','FreshdeskField','order','getSubjects','map','getDescriptions','getTags','setTags','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','sendStatus','status','end','count','offset','set','Content-Range','json','apply','update','then','stack','name','send','FreshdeskConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','key'];(function(_0x48e24c,_0x14d0e9){var _0x55ddd4=function(_0x567a2c){while(--_0x567a2c){_0x48e24c['push'](_0x48e24c['shift']());}};_0x55ddd4(++_0x14d0e9);}(_0x90f2,0x71));var _0x290f=function(_0x3ebbbc,_0x9da46b){_0x3ebbbc=_0x3ebbbc-0x0;var _0x1ccefc=_0x90f2[_0x3ebbbc];return _0x1ccefc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x290f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x290f('0x1'));var rp=require(_0x290f('0x2'));var moment=require(_0x290f('0x3'));var BPromise=require(_0x290f('0x4'));var Mustache=require(_0x290f('0x5'));var util=require(_0x290f('0x6'));var path=require('path');var sox=require(_0x290f('0x7'));var csv=require(_0x290f('0x8'));var ejs=require(_0x290f('0x9'));var fs=require('fs');var _=require(_0x290f('0xa'));var squel=require(_0x290f('0xb'));var crypto=require(_0x290f('0xc'));var jsforce=require(_0x290f('0xd'));var deskjs=require(_0x290f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x290f('0xf'));var Redis=require(_0x290f('0x10'));var authService=require(_0x290f('0x11'));var qs=require(_0x290f('0x12'));var hardwareService=require(_0x290f('0x13'));var logger=require('../../config/logger')(_0x290f('0x14'));var utils=require(_0x290f('0x15'));var config=require(_0x290f('0x16'));var db=require(_0x290f('0x17'))['db'];var jayson=require(_0x290f('0x18'));var client=jayson[_0x290f('0x19')][_0x290f('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x120aae,_0x4a6c4d,_0x330c50){if(_0x330c50){var _0x5281d4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5281d4[_0x290f('0x1b')](_0x4a6c4d)){return _0x120aae;}else{throw new Error(_0x290f('0x1c'));}}else{return _0x120aae;}}function respondWithRpcPromise(_0x9d8057,_0x3faa64,_0x5731ea,_0x4a8960){return new BPromise(function(_0x3e6851,_0x5a0dc9){var _0x1de4ee=_0x4a8960||client;return _0x1de4ee[_0x290f('0x1d')](_0x9d8057,_0x5731ea)['then'](function(_0x1647ec){logger[_0x290f('0x1e')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3faa64,_0x290f('0x1f'));logger[_0x290f('0x20')](_0x290f('0x21'),_0x3faa64,_0x290f('0x1f'),JSON[_0x290f('0x22')](_0x1647ec));if(_0x1647ec['error']){if(_0x1647ec[_0x290f('0x23')][_0x290f('0x24')]===0x1f4){logger[_0x290f('0x23')](_0x290f('0x25'),_0x3faa64,_0x1647ec[_0x290f('0x23')][_0x290f('0x26')]);return _0x5a0dc9(_0x1647ec[_0x290f('0x23')][_0x290f('0x26')]);}logger[_0x290f('0x23')](_0x290f('0x25'),_0x3faa64,_0x1647ec[_0x290f('0x23')][_0x290f('0x26')]);return _0x3e6851(_0x1647ec[_0x290f('0x23')]['message']);}else{logger[_0x290f('0x1e')](_0x290f('0x25'),_0x3faa64,'request\x20sent');_0x3e6851(_0x1647ec['result']['message']);}})['catch'](function(_0xe6d337){logger[_0x290f('0x23')](_0x290f('0x25'),_0x3faa64,_0xe6d337);_0x5a0dc9(_0xe6d337);});});}function respondWithStatusCode(_0x379b5e,_0x507375){_0x507375=_0x507375||0xcc;return function(_0x4fd1d0){if(_0x4fd1d0){return _0x379b5e[_0x290f('0x27')](_0x507375);}return _0x379b5e[_0x290f('0x28')](_0x507375)[_0x290f('0x29')]();};}function respondWithResult(_0x366569,_0x40a06b){_0x40a06b=_0x40a06b||0xc8;return function(_0xe360de){if(_0xe360de){return _0x366569[_0x290f('0x28')](_0x40a06b)['json'](_0xe360de);}};}function respondWithFilteredResult(_0x2ff549,_0x4aebfe){return function(_0x262ff4){if(_0x262ff4){var _0x5ad60d=_0x262ff4[_0x290f('0x2a')],_0x4961c0=_0x4aebfe[_0x290f('0x2b')],_0x6a1588=_0x4aebfe[_0x290f('0x2b')]+_0x4aebfe['limit'],_0x555e71;if(_0x6a1588>=_0x5ad60d){_0x6a1588=_0x5ad60d;_0x555e71=0xc8;}else{_0x555e71=0xce;}_0x2ff549[_0x290f('0x28')](_0x555e71);return _0x2ff549[_0x290f('0x2c')](_0x290f('0x2d'),_0x4961c0+'-'+_0x6a1588+'/'+_0x5ad60d)[_0x290f('0x2e')](_0x262ff4);}return null;};}function patchUpdates(_0xf3a9c4){return function(_0x8279a1){try{jsonpatch[_0x290f('0x2f')](_0x8279a1,_0xf3a9c4,!![]);}catch(_0x4f1125){return BPromise['reject'](_0x4f1125);}return _0x8279a1['save']();};}function saveUpdates(_0x103bdc,_0x33ed07){return function(_0x30c8d8){if(_0x30c8d8){return _0x30c8d8[_0x290f('0x30')](_0x103bdc)[_0x290f('0x31')](function(_0x1d592c){return _0x1d592c;});}return null;};}function removeEntity(_0x39a1df,_0x5268aa){return function(_0x5bdcd1){if(_0x5bdcd1){return _0x5bdcd1['destroy']()[_0x290f('0x31')](function(){_0x39a1df[_0x290f('0x28')](0xcc)[_0x290f('0x29')]();});}};}function handleEntityNotFound(_0x107baa,_0x433efd){return function(_0x138738){if(!_0x138738){_0x107baa['sendStatus'](0x194);}return _0x138738;};}function handleError(_0x58542f,_0x21df91){_0x21df91=_0x21df91||0x1f4;return function(_0x366f44){logger['error'](_0x366f44[_0x290f('0x32')]);if(_0x366f44[_0x290f('0x33')]){delete _0x366f44[_0x290f('0x33')];}_0x58542f[_0x290f('0x28')](_0x21df91)[_0x290f('0x34')](_0x366f44);};}exports['index']=function(_0x206103,_0x50b25a){var _0x7d2c06={},_0x26adfb={},_0x44b46a={'count':0x0,'rows':[]};var _0x4fdd1a=db[_0x290f('0x35')][_0x290f('0x36')];_0x26adfb[_0x290f('0x37')]=_['keys'](_0x4fdd1a);_0x26adfb['query']=_[_0x290f('0x38')](_0x206103[_0x290f('0x39')]);_0x26adfb[_0x290f('0x3a')]=_[_0x290f('0x3b')](_0x26adfb[_0x290f('0x37')],_0x26adfb[_0x290f('0x39')]);_0x7d2c06[_0x290f('0x3c')]=_[_0x290f('0x3b')](_0x26adfb[_0x290f('0x37')],qs[_0x290f('0x3d')](_0x206103['query'][_0x290f('0x3d')]));_0x7d2c06[_0x290f('0x3c')]=_0x7d2c06['attributes'][_0x290f('0x3e')]?_0x7d2c06[_0x290f('0x3c')]:_0x26adfb['model'];if(!_0x206103[_0x290f('0x39')][_0x290f('0x3f')](_0x290f('0x40'))){_0x7d2c06[_0x290f('0x41')]=qs[_0x290f('0x41')](_0x206103[_0x290f('0x39')][_0x290f('0x41')]);_0x7d2c06[_0x290f('0x2b')]=qs[_0x290f('0x2b')](_0x206103[_0x290f('0x39')][_0x290f('0x2b')]);}_0x7d2c06['order']=qs['sort'](_0x206103[_0x290f('0x39')][_0x290f('0x42')]);_0x7d2c06[_0x290f('0x43')]=qs['filters'](_[_0x290f('0x44')](_0x206103[_0x290f('0x39')],_0x26adfb[_0x290f('0x3a')]));if(_0x206103[_0x290f('0x39')][_0x290f('0x45')]){_0x7d2c06[_0x290f('0x43')]=_[_0x290f('0x46')](_0x7d2c06[_0x290f('0x43')],{'$or':_['map'](_0x4fdd1a,function(_0x4af880){if(_0x4af880[_0x290f('0x47')][_0x290f('0x48')]!==_0x290f('0x49')){var _0x5c59e2={};_0x5c59e2[_0x4af880[_0x290f('0x4a')]]={'$like':'%'+_0x206103[_0x290f('0x39')][_0x290f('0x45')]+'%'};return _0x5c59e2;}})});}_0x7d2c06=_[_0x290f('0x46')]({},_0x7d2c06,_0x206103[_0x290f('0x4b')]);var _0x3b7173={'where':_0x7d2c06[_0x290f('0x43')]};return db['FreshdeskConfiguration'][_0x290f('0x2a')](_0x3b7173)[_0x290f('0x31')](function(_0x3c6495){_0x44b46a[_0x290f('0x2a')]=_0x3c6495;if(_0x206103[_0x290f('0x39')][_0x290f('0x4c')]){_0x7d2c06[_0x290f('0x4d')]=[{'all':!![]}];}return db[_0x290f('0x35')]['findAll'](_0x7d2c06);})[_0x290f('0x31')](function(_0x55daa0){_0x44b46a['rows']=_0x55daa0;return _0x44b46a;})[_0x290f('0x31')](respondWithFilteredResult(_0x50b25a,_0x7d2c06))[_0x290f('0x4e')](handleError(_0x50b25a,null));};exports[_0x290f('0x4f')]=function(_0x491274,_0x15cad4){var _0xb2cfbb={'raw':![],'where':{'id':_0x491274[_0x290f('0x50')]['id']}},_0x547919={};_0x547919['model']=_[_0x290f('0x38')](db[_0x290f('0x35')][_0x290f('0x36')]);_0x547919['query']=_[_0x290f('0x38')](_0x491274[_0x290f('0x39')]);_0x547919[_0x290f('0x3a')]=_[_0x290f('0x3b')](_0x547919[_0x290f('0x37')],_0x547919['query']);_0xb2cfbb[_0x290f('0x3c')]=_['intersection'](_0x547919[_0x290f('0x37')],qs['fields'](_0x491274['query'][_0x290f('0x3d')]));_0xb2cfbb['attributes']=_0xb2cfbb['attributes'][_0x290f('0x3e')]?_0xb2cfbb[_0x290f('0x3c')]:_0x547919[_0x290f('0x37')];if(_0x491274[_0x290f('0x39')][_0x290f('0x4c')]){_0xb2cfbb[_0x290f('0x4d')]=[{'all':!![]}];}_0xb2cfbb=_['merge']({},_0xb2cfbb,_0x491274[_0x290f('0x4b')]);return db[_0x290f('0x35')][_0x290f('0x51')](_0xb2cfbb)['then'](handleEntityNotFound(_0x15cad4,null))['then'](respondWithResult(_0x15cad4,null))[_0x290f('0x4e')](handleError(_0x15cad4,null));};exports[_0x290f('0x52')]=function(_0x440af6,_0x103730){return db[_0x290f('0x35')]['create'](_0x440af6[_0x290f('0x53')],{})['then'](respondWithResult(_0x103730,0xc9))[_0x290f('0x4e')](handleError(_0x103730,null));};exports['update']=function(_0x3ce8f3,_0x48ece8){if(_0x3ce8f3[_0x290f('0x53')]['id']){delete _0x3ce8f3[_0x290f('0x53')]['id'];}return db['FreshdeskConfiguration'][_0x290f('0x51')]({'where':{'id':_0x3ce8f3[_0x290f('0x50')]['id']}})[_0x290f('0x31')](handleEntityNotFound(_0x48ece8,null))[_0x290f('0x31')](saveUpdates(_0x3ce8f3[_0x290f('0x53')],null))[_0x290f('0x31')](respondWithResult(_0x48ece8,null))[_0x290f('0x4e')](handleError(_0x48ece8,null));};exports['destroy']=function(_0x11d968,_0x4803bf){return db['FreshdeskConfiguration'][_0x290f('0x51')]({'where':{'id':_0x11d968[_0x290f('0x50')]['id']}})[_0x290f('0x31')](handleEntityNotFound(_0x4803bf,null))[_0x290f('0x31')](removeEntity(_0x4803bf,null))['catch'](handleError(_0x4803bf,null));};exports[_0x290f('0x54')]=function(_0x5902d4,_0x334472,_0x4e24c8){var _0x4e6eaf={};var _0x2f7086={};var _0x11f6db;var _0x1da1f9;return db[_0x290f('0x35')][_0x290f('0x55')]({'where':{'id':_0x5902d4[_0x290f('0x50')]['id']}})[_0x290f('0x31')](handleEntityNotFound(_0x334472,null))[_0x290f('0x31')](function(_0x378e1a){if(_0x378e1a){_0x11f6db=_0x378e1a;_0x2f7086[_0x290f('0x37')]=_[_0x290f('0x38')](db[_0x290f('0x56')]['rawAttributes']);_0x2f7086['query']=_[_0x290f('0x38')](_0x5902d4['query']);_0x2f7086[_0x290f('0x3a')]=_[_0x290f('0x3b')](_0x2f7086[_0x290f('0x37')],_0x2f7086[_0x290f('0x39')]);_0x4e6eaf[_0x290f('0x3c')]=_[_0x290f('0x3b')](_0x2f7086[_0x290f('0x37')],qs[_0x290f('0x3d')](_0x5902d4[_0x290f('0x39')][_0x290f('0x3d')]));_0x4e6eaf[_0x290f('0x3c')]=_0x4e6eaf['attributes'][_0x290f('0x3e')]?_0x4e6eaf[_0x290f('0x3c')]:_0x2f7086[_0x290f('0x37')];_0x4e6eaf[_0x290f('0x57')]=qs['sort'](_0x5902d4['query']['sort']);_0x4e6eaf[_0x290f('0x43')]=qs[_0x290f('0x3a')](_[_0x290f('0x44')](_0x5902d4['query'],_0x2f7086[_0x290f('0x3a')]));if(_0x5902d4[_0x290f('0x39')][_0x290f('0x45')]){_0x4e6eaf['where']=_[_0x290f('0x46')](_0x4e6eaf[_0x290f('0x43')],{'$or':_['map'](_0x4e6eaf[_0x290f('0x3c')],function(_0x184a40){var _0x332bfb={};_0x332bfb[_0x184a40]={'$like':'%'+_0x5902d4[_0x290f('0x39')][_0x290f('0x45')]+'%'};return _0x332bfb;})});}_0x4e6eaf=_[_0x290f('0x46')]({},_0x4e6eaf,_0x5902d4[_0x290f('0x4b')]);return _0x11f6db[_0x290f('0x54')](_0x4e6eaf);}})[_0x290f('0x31')](function(_0x1dc0e0){if(_0x1dc0e0){_0x1da1f9=_0x1dc0e0['length'];if(!_0x5902d4[_0x290f('0x39')][_0x290f('0x3f')](_0x290f('0x40'))){_0x4e6eaf[_0x290f('0x41')]=qs['limit'](_0x5902d4[_0x290f('0x39')][_0x290f('0x41')]);_0x4e6eaf['offset']=qs[_0x290f('0x2b')](_0x5902d4['query'][_0x290f('0x2b')]);}return _0x11f6db[_0x290f('0x54')](_0x4e6eaf);}})[_0x290f('0x31')](function(_0x15381f){if(_0x15381f){return _0x15381f?{'count':_0x1da1f9,'rows':_0x15381f}:null;}})[_0x290f('0x31')](respondWithResult(_0x334472,null))['catch'](handleError(_0x334472,null));};exports[_0x290f('0x58')]=function(_0x40aae9,_0xc84203,_0x2692ed){var _0x235abd={};var _0x9e164a={};var _0x2c20c2;var _0x4f2f37;return db[_0x290f('0x35')][_0x290f('0x55')]({'where':{'id':_0x40aae9[_0x290f('0x50')]['id']}})[_0x290f('0x31')](handleEntityNotFound(_0xc84203,null))[_0x290f('0x31')](function(_0x59719f){if(_0x59719f){_0x2c20c2=_0x59719f;_0x9e164a['model']=_[_0x290f('0x38')](db[_0x290f('0x56')][_0x290f('0x36')]);_0x9e164a[_0x290f('0x39')]=_[_0x290f('0x38')](_0x40aae9[_0x290f('0x39')]);_0x9e164a[_0x290f('0x3a')]=_[_0x290f('0x3b')](_0x9e164a['model'],_0x9e164a[_0x290f('0x39')]);_0x235abd[_0x290f('0x3c')]=_['intersection'](_0x9e164a[_0x290f('0x37')],qs[_0x290f('0x3d')](_0x40aae9[_0x290f('0x39')][_0x290f('0x3d')]));_0x235abd[_0x290f('0x3c')]=_0x235abd[_0x290f('0x3c')]['length']?_0x235abd[_0x290f('0x3c')]:_0x9e164a['model'];_0x235abd[_0x290f('0x57')]=qs[_0x290f('0x42')](_0x40aae9[_0x290f('0x39')]['sort']);_0x235abd['where']=qs[_0x290f('0x3a')](_[_0x290f('0x44')](_0x40aae9[_0x290f('0x39')],_0x9e164a[_0x290f('0x3a')]));if(_0x40aae9[_0x290f('0x39')]['filter']){_0x235abd[_0x290f('0x43')]=_[_0x290f('0x46')](_0x235abd['where'],{'$or':_[_0x290f('0x59')](_0x235abd[_0x290f('0x3c')],function(_0x4cf725){var _0x1f6ea2={};_0x1f6ea2[_0x4cf725]={'$like':'%'+_0x40aae9[_0x290f('0x39')][_0x290f('0x45')]+'%'};return _0x1f6ea2;})});}_0x235abd=_[_0x290f('0x46')]({},_0x235abd,_0x40aae9[_0x290f('0x4b')]);return _0x2c20c2[_0x290f('0x58')](_0x235abd);}})[_0x290f('0x31')](function(_0x1057b1){if(_0x1057b1){_0x4f2f37=_0x1057b1[_0x290f('0x3e')];if(!_0x40aae9[_0x290f('0x39')][_0x290f('0x3f')](_0x290f('0x40'))){_0x235abd[_0x290f('0x41')]=qs[_0x290f('0x41')](_0x40aae9[_0x290f('0x39')][_0x290f('0x41')]);_0x235abd[_0x290f('0x2b')]=qs[_0x290f('0x2b')](_0x40aae9[_0x290f('0x39')][_0x290f('0x2b')]);}return _0x2c20c2['getSubjects'](_0x235abd);}})[_0x290f('0x31')](function(_0x33a63e){if(_0x33a63e){return _0x33a63e?{'count':_0x4f2f37,'rows':_0x33a63e}:null;}})[_0x290f('0x31')](respondWithResult(_0xc84203,null))[_0x290f('0x4e')](handleError(_0xc84203,null));};exports[_0x290f('0x5a')]=function(_0x2b6ad9,_0x2628e0,_0x2f79e3){var _0x5d87e7={};var _0x2219a3={};var _0x4a9647;var _0x3dbfb1;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x2b6ad9[_0x290f('0x50')]['id']}})[_0x290f('0x31')](handleEntityNotFound(_0x2628e0,null))[_0x290f('0x31')](function(_0x394b27){if(_0x394b27){_0x4a9647=_0x394b27;_0x2219a3[_0x290f('0x37')]=_['keys'](db[_0x290f('0x56')][_0x290f('0x36')]);_0x2219a3[_0x290f('0x39')]=_[_0x290f('0x38')](_0x2b6ad9[_0x290f('0x39')]);_0x2219a3[_0x290f('0x3a')]=_[_0x290f('0x3b')](_0x2219a3[_0x290f('0x37')],_0x2219a3[_0x290f('0x39')]);_0x5d87e7[_0x290f('0x3c')]=_['intersection'](_0x2219a3[_0x290f('0x37')],qs[_0x290f('0x3d')](_0x2b6ad9['query'][_0x290f('0x3d')]));_0x5d87e7[_0x290f('0x3c')]=_0x5d87e7[_0x290f('0x3c')][_0x290f('0x3e')]?_0x5d87e7[_0x290f('0x3c')]:_0x2219a3[_0x290f('0x37')];_0x5d87e7['order']=qs[_0x290f('0x42')](_0x2b6ad9[_0x290f('0x39')][_0x290f('0x42')]);_0x5d87e7[_0x290f('0x43')]=qs[_0x290f('0x3a')](_[_0x290f('0x44')](_0x2b6ad9[_0x290f('0x39')],_0x2219a3[_0x290f('0x3a')]));if(_0x2b6ad9[_0x290f('0x39')][_0x290f('0x45')]){_0x5d87e7[_0x290f('0x43')]=_[_0x290f('0x46')](_0x5d87e7['where'],{'$or':_[_0x290f('0x59')](_0x5d87e7[_0x290f('0x3c')],function(_0x1b47e8){var _0x3be08f={};_0x3be08f[_0x1b47e8]={'$like':'%'+_0x2b6ad9[_0x290f('0x39')][_0x290f('0x45')]+'%'};return _0x3be08f;})});}_0x5d87e7=_[_0x290f('0x46')]({},_0x5d87e7,_0x2b6ad9[_0x290f('0x4b')]);return _0x4a9647[_0x290f('0x5a')](_0x5d87e7);}})['then'](function(_0x39769f){if(_0x39769f){_0x3dbfb1=_0x39769f[_0x290f('0x3e')];if(!_0x2b6ad9[_0x290f('0x39')]['hasOwnProperty']('nolimit')){_0x5d87e7[_0x290f('0x41')]=qs['limit'](_0x2b6ad9[_0x290f('0x39')][_0x290f('0x41')]);_0x5d87e7[_0x290f('0x2b')]=qs[_0x290f('0x2b')](_0x2b6ad9[_0x290f('0x39')]['offset']);}return _0x4a9647[_0x290f('0x5a')](_0x5d87e7);}})[_0x290f('0x31')](function(_0x315a5b){if(_0x315a5b){return _0x315a5b?{'count':_0x3dbfb1,'rows':_0x315a5b}:null;}})[_0x290f('0x31')](respondWithResult(_0x2628e0,null))[_0x290f('0x4e')](handleError(_0x2628e0,null));};exports[_0x290f('0x5b')]=function(_0x4edfc2,_0x3b0d45,_0x509f7b){var _0xd9f9d3={};var _0x5d09fa={};var _0x5c99f8;var _0x537de4;return db[_0x290f('0x35')][_0x290f('0x55')]({'where':{'id':_0x4edfc2['params']['id']}})['then'](handleEntityNotFound(_0x3b0d45,null))[_0x290f('0x31')](function(_0x4a06dc){if(_0x4a06dc){_0x5c99f8=_0x4a06dc;_0x5d09fa[_0x290f('0x37')]=_[_0x290f('0x38')](db['Tag'][_0x290f('0x36')]);_0x5d09fa[_0x290f('0x39')]=_['keys'](_0x4edfc2[_0x290f('0x39')]);_0x5d09fa[_0x290f('0x3a')]=_[_0x290f('0x3b')](_0x5d09fa[_0x290f('0x37')],_0x5d09fa[_0x290f('0x39')]);_0xd9f9d3[_0x290f('0x3c')]=_[_0x290f('0x3b')](_0x5d09fa[_0x290f('0x37')],qs['fields'](_0x4edfc2[_0x290f('0x39')][_0x290f('0x3d')]));_0xd9f9d3[_0x290f('0x3c')]=_0xd9f9d3['attributes']['length']?_0xd9f9d3[_0x290f('0x3c')]:_0x5d09fa[_0x290f('0x37')];_0xd9f9d3[_0x290f('0x57')]=qs[_0x290f('0x42')](_0x4edfc2[_0x290f('0x39')][_0x290f('0x42')]);_0xd9f9d3[_0x290f('0x43')]=qs[_0x290f('0x3a')](_[_0x290f('0x44')](_0x4edfc2[_0x290f('0x39')],_0x5d09fa[_0x290f('0x3a')]));if(_0x4edfc2[_0x290f('0x39')][_0x290f('0x45')]){_0xd9f9d3[_0x290f('0x43')]=_[_0x290f('0x46')](_0xd9f9d3['where'],{'$or':_['map'](_0xd9f9d3['attributes'],function(_0x25648c){var _0x3e7ae9={};_0x3e7ae9[_0x25648c]={'$like':'%'+_0x4edfc2['query'][_0x290f('0x45')]+'%'};return _0x3e7ae9;})});}_0xd9f9d3=_['merge']({},_0xd9f9d3,_0x4edfc2[_0x290f('0x4b')]);return _0x5c99f8[_0x290f('0x5b')](_0xd9f9d3);}})[_0x290f('0x31')](function(_0x34e655){if(_0x34e655){_0x537de4=_0x34e655[_0x290f('0x3e')];if(!_0x4edfc2[_0x290f('0x39')]['hasOwnProperty'](_0x290f('0x40'))){_0xd9f9d3['limit']=qs[_0x290f('0x41')](_0x4edfc2[_0x290f('0x39')][_0x290f('0x41')]);_0xd9f9d3[_0x290f('0x2b')]=qs['offset'](_0x4edfc2[_0x290f('0x39')][_0x290f('0x2b')]);}return _0x5c99f8['getTags'](_0xd9f9d3);}})[_0x290f('0x31')](function(_0x146511){if(_0x146511){return _0x146511?{'count':_0x537de4,'rows':_0x146511}:null;}})[_0x290f('0x31')](respondWithResult(_0x3b0d45,null))['catch'](handleError(_0x3b0d45,null));};exports[_0x290f('0x5c')]=function(_0x40c1bd,_0x4c9e9a,_0xb83916){if(_0x40c1bd[_0x290f('0x53')]['id']){delete _0x40c1bd[_0x290f('0x53')]['id'];}return db['FreshdeskConfiguration'][_0x290f('0x55')]({'where':{'id':_0x40c1bd['params']['id']}})[_0x290f('0x31')](handleEntityNotFound(_0x4c9e9a,null))[_0x290f('0x31')](function(_0x66fa38){if(_0x66fa38){return _0x66fa38[_0x290f('0x5c')](_0x40c1bd[_0x290f('0x53')]['ids']||[]);}return null;})[_0x290f('0x31')](respondWithResult(_0x4c9e9a,null))['catch'](handleError(_0x4c9e9a,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 120538f..2fb9734 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 _0x7fef=['exports','define','FreshdeskConfiguration','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x54a1e5,_0x17327c){var _0x16c09c=function(_0x5f54fe){while(--_0x5f54fe){_0x54a1e5['push'](_0x54a1e5['shift']());}};_0x16c09c(++_0x17327c);}(_0x7fef,0x139));var _0xf7fe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7fef[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf7fe('0x0'));var util=require('util');var logger=require(_0xf7fe('0x1'))(_0xf7fe('0x2'));var moment=require('moment');var BPromise=require(_0xf7fe('0x3'));var rp=require(_0xf7fe('0x4'));var fs=require('fs');var path=require(_0xf7fe('0x5'));var rimraf=require(_0xf7fe('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xf7fe('0x7')]=function(_0x217d66,_0xfdc1f7){return _0x217d66[_0xf7fe('0x8')](_0xf7fe('0x9'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb28=['exports','define','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xeb28,0x10a));var _0x8eb2=function(_0x100b53,_0x4028cd){_0x100b53=_0x100b53-0x0;var _0x3eb9ac=_0xeb28[_0x100b53];return _0x3eb9ac;};'use strict';var _=require(_0x8eb2('0x0'));var util=require(_0x8eb2('0x1'));var logger=require(_0x8eb2('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8eb2('0x3'));var rp=require(_0x8eb2('0x4'));var fs=require('fs');var path=require(_0x8eb2('0x5'));var rimraf=require(_0x8eb2('0x6'));var config=require(_0x8eb2('0x7'));var attributes=require(_0x8eb2('0x8'));module[_0x8eb2('0x9')]=function(_0x3be098,_0x4626f4){return _0x3be098[_0x8eb2('0xa')]('FreshdeskConfiguration',attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 38ea384..da3ba10 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 _0xdd8e=['result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','info'];(function(_0x31b26c,_0x440b93){var _0x3bcec6=function(_0x255460){while(--_0x255460){_0x31b26c['push'](_0x31b26c['shift']());}};_0x3bcec6(++_0x440b93);}(_0xdd8e,0xe7));var _0xedd8=function(_0x1e0d54,_0x46fbec){_0x1e0d54=_0x1e0d54-0x0;var _0x244204=_0xdd8e[_0x1e0d54];return _0x244204;};'use strict';var _=require(_0xedd8('0x0'));var util=require(_0xedd8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xedd8('0x2'));var fs=require('fs');var Redis=require(_0xedd8('0x3'));var db=require(_0xedd8('0x4'))['db'];var utils=require(_0xedd8('0x5'));var logger=require(_0xedd8('0x6'))(_0xedd8('0x7'));var config=require(_0xedd8('0x8'));var jayson=require(_0xedd8('0x9'));var client=jayson[_0xedd8('0xa')][_0xedd8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x402e05,_0x72ec97,_0x33ceb8){return new BPromise(function(_0x4d9d2b,_0x43c998){return client[_0xedd8('0xc')](_0x402e05,_0x33ceb8)[_0xedd8('0xd')](function(_0x576628){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x72ec97,_0xedd8('0xe'));logger[_0xedd8('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x72ec97,_0xedd8('0xe'),JSON[_0xedd8('0x10')](_0x576628));if(_0x576628[_0xedd8('0x11')]){if(_0x576628[_0xedd8('0x11')][_0xedd8('0x12')]===0x1f4){logger[_0xedd8('0x11')](_0xedd8('0x13'),_0x72ec97,_0x576628[_0xedd8('0x11')][_0xedd8('0x14')]);return _0x43c998(_0x576628[_0xedd8('0x11')]['message']);}logger[_0xedd8('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x72ec97,_0x576628[_0xedd8('0x11')]['message']);return _0x4d9d2b(_0x576628[_0xedd8('0x11')][_0xedd8('0x14')]);}else{logger[_0xedd8('0x15')](_0xedd8('0x13'),_0x72ec97,_0xedd8('0xe'));_0x4d9d2b(_0x576628[_0xedd8('0x16')]['message']);}})['catch'](function(_0x963cd5){logger[_0xedd8('0x11')](_0xedd8('0x13'),_0x72ec97,_0x963cd5);_0x43c998(_0x963cd5);});});} \ No newline at end of file +var _0x37ed=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment'];(function(_0x19eaa7,_0x31a7df){var _0x15e77d=function(_0x512040){while(--_0x512040){_0x19eaa7['push'](_0x19eaa7['shift']());}};_0x15e77d(++_0x31a7df);}(_0x37ed,0xda));var _0xd37e=function(_0x5214e3,_0x5ce08d){_0x5214e3=_0x5214e3-0x0;var _0x142074=_0x37ed[_0x5214e3];return _0x142074;};'use strict';var _=require('lodash');var util=require(_0xd37e('0x0'));var moment=require(_0xd37e('0x1'));var BPromise=require(_0xd37e('0x2'));var rs=require(_0xd37e('0x3'));var fs=require('fs');var Redis=require(_0xd37e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd37e('0x5'))(_0xd37e('0x6'));var config=require(_0xd37e('0x7'));var jayson=require(_0xd37e('0x8'));var client=jayson[_0xd37e('0x9')][_0xd37e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ecbe5,_0x29486d,_0x55da73){return new BPromise(function(_0x28db3d,_0x3c55fa){return client['request'](_0x4ecbe5,_0x55da73)[_0xd37e('0xb')](function(_0x2c89f3){logger['info'](_0xd37e('0xc'),_0x29486d,_0xd37e('0xd'));logger[_0xd37e('0xe')](_0xd37e('0xf'),_0x29486d,'request\x20sent',JSON[_0xd37e('0x10')](_0x2c89f3));if(_0x2c89f3[_0xd37e('0x11')]){if(_0x2c89f3[_0xd37e('0x11')][_0xd37e('0x12')]===0x1f4){logger[_0xd37e('0x11')](_0xd37e('0xc'),_0x29486d,_0x2c89f3[_0xd37e('0x11')][_0xd37e('0x13')]);return _0x3c55fa(_0x2c89f3['error']['message']);}logger['error'](_0xd37e('0xc'),_0x29486d,_0x2c89f3[_0xd37e('0x11')][_0xd37e('0x13')]);return _0x28db3d(_0x2c89f3[_0xd37e('0x11')]['message']);}else{logger['info'](_0xd37e('0xc'),_0x29486d,_0xd37e('0xd'));_0x28db3d(_0x2c89f3[_0xd37e('0x14')][_0xd37e('0x13')]);}})[_0xd37e('0x15')](function(_0x314781){logger['error'](_0xd37e('0xc'),_0x29486d,_0x314781);_0x3c55fa(_0x314781);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 5f2f0e6..f5acd23 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 _0x008c=['show','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x70f23a,_0xfcc0f0){var _0x39b0e6=function(_0x52f6e5){while(--_0x52f6e5){_0x70f23a['push'](_0x70f23a['shift']());}};_0x39b0e6(++_0xfcc0f0);}(_0x008c,0x188));var _0xc008=function(_0x5e53ae,_0x24af4f){_0x5e53ae=_0x5e53ae-0x0;var _0x27a8a2=_0x008c[_0x5e53ae];return _0x27a8a2;};'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['post']('/',auth[_0xc008('0xa')](),controller['create']);router['put'](_0xc008('0xc'),auth[_0xc008('0xa')](),controller['update']);router['delete']('/:id',auth[_0xc008('0xa')](),controller[_0xc008('0xe')]);module['exports']=router; \ No newline at end of file +var _0x008c=['show','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0xea6e8b,_0x3158a2){var _0x478b1a=function(_0x4e72d0){while(--_0x4e72d0){_0xea6e8b['push'](_0xea6e8b['shift']());}};_0x478b1a(++_0x3158a2);}(_0x008c,0x188));var _0xc008=function(_0x48b4a1,_0x3c2bf4){_0x48b4a1=_0x48b4a1-0x0;var _0x2df379=_0x008c[_0x48b4a1];return _0x2df379;};'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['post']('/',auth[_0xc008('0xa')](),controller['create']);router['put'](_0xc008('0xc'),auth[_0xc008('0xa')](),controller['update']);router['delete']('/:id',auth[_0xc008('0xa')](),controller[_0xc008('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index ecd2877..9e0425f 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 _0xa3e6=['variable','customVariable','keyValue','STRING','string','BOOLEAN','sequelize','ENUM'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x2cc4ce,_0x31f2a3){_0x2cc4ce=_0x2cc4ce-0x0;var _0x344ae8=_0xa3e6[_0x2cc4ce];return _0x344ae8;};'use strict';var Sequelize=require(_0x6a3e('0x0'));module['exports']={'type':{'type':Sequelize[_0x6a3e('0x1')]('string',_0x6a3e('0x2'),_0x6a3e('0x3'),_0x6a3e('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6a3e('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6a3e('0x1')](_0x6a3e('0x6'),_0x6a3e('0x2'),_0x6a3e('0x3'))},'keyContent':{'type':Sequelize[_0x6a3e('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6a3e('0x5')]},'customField':{'type':Sequelize[_0x6a3e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x289c=['variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','STRING'];(function(_0x1b2cf1,_0x920547){var _0x5b5b4f=function(_0x4e0d46){while(--_0x4e0d46){_0x1b2cf1['push'](_0x1b2cf1['shift']());}};_0x5b5b4f(++_0x920547);}(_0x289c,0x110));var _0xc289=function(_0x2c7485,_0xedd8b7){_0x2c7485=_0x2c7485-0x0;var _0x5765eb=_0x289c[_0x2c7485];return _0x5765eb;};'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 diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index bd5ea7f..969585c 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 _0xf8ff=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','FreshdeskField','include','rows','catch','params','rawAttributes','length','includeAll','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x2d60f1,_0x463595){var _0x3e4edc=function(_0x1af2ea){while(--_0x1af2ea){_0x2d60f1['push'](_0x2d60f1['shift']());}};_0x3e4edc(++_0x463595);}(_0xf8ff,0x173));var _0xff8f=function(_0x290694,_0x281935){_0x290694=_0x290694-0x0;var _0x5a0f2e=_0xf8ff[_0x290694];return _0x5a0f2e;};'use strict';var pdf=require(_0xff8f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xff8f('0x1'));var zipdir=require(_0xff8f('0x2'));var jsonpatch=require(_0xff8f('0x3'));var rp=require(_0xff8f('0x4'));var moment=require(_0xff8f('0x5'));var BPromise=require(_0xff8f('0x6'));var Mustache=require(_0xff8f('0x7'));var util=require(_0xff8f('0x8'));var path=require('path');var sox=require(_0xff8f('0x9'));var csv=require(_0xff8f('0xa'));var ejs=require(_0xff8f('0xb'));var fs=require('fs');var _=require(_0xff8f('0xc'));var squel=require(_0xff8f('0xd'));var crypto=require(_0xff8f('0xe'));var jsforce=require(_0xff8f('0xf'));var deskjs=require(_0xff8f('0x10'));var toCsv=require(_0xff8f('0xa'));var querystring=require(_0xff8f('0x11'));var Papa=require(_0xff8f('0x12'));var Redis=require(_0xff8f('0x13'));var authService=require(_0xff8f('0x14'));var qs=require(_0xff8f('0x15'));var hardwareService=require(_0xff8f('0x16'));var logger=require(_0xff8f('0x17'))(_0xff8f('0x18'));var utils=require(_0xff8f('0x19'));var config=require(_0xff8f('0x1a'));var db=require(_0xff8f('0x1b'))['db'];function respondWithStatusCode(_0x3be923,_0x863e12){_0x863e12=_0x863e12||0xcc;return function(_0x1a3a70){if(_0x1a3a70){return _0x3be923[_0xff8f('0x1c')](_0x863e12);}return _0x3be923[_0xff8f('0x1d')](_0x863e12)[_0xff8f('0x1e')]();};}function respondWithResult(_0x41b786,_0x1ade6a){_0x1ade6a=_0x1ade6a||0xc8;return function(_0x5881c8){if(_0x5881c8){return _0x41b786[_0xff8f('0x1d')](_0x1ade6a)['json'](_0x5881c8);}};}function respondWithFilteredResult(_0x5c28de,_0x5159b8){return function(_0x364e7c){if(_0x364e7c){var _0x1c1f11=_0x364e7c[_0xff8f('0x1f')],_0x29ae0e=_0x5159b8[_0xff8f('0x20')],_0xc7f9c2=_0x5159b8[_0xff8f('0x20')]+_0x5159b8[_0xff8f('0x21')],_0x45cd1e;if(_0xc7f9c2>=_0x1c1f11){_0xc7f9c2=_0x1c1f11;_0x45cd1e=0xc8;}else{_0x45cd1e=0xce;}_0x5c28de['status'](_0x45cd1e);return _0x5c28de[_0xff8f('0x22')](_0xff8f('0x23'),_0x29ae0e+'-'+_0xc7f9c2+'/'+_0x1c1f11)[_0xff8f('0x24')](_0x364e7c);}return null;};}function patchUpdates(_0x4e2c2f){return function(_0xf1db64){try{jsonpatch[_0xff8f('0x25')](_0xf1db64,_0x4e2c2f,!![]);}catch(_0x2c85b9){return BPromise[_0xff8f('0x26')](_0x2c85b9);}return _0xf1db64[_0xff8f('0x27')]();};}function saveUpdates(_0x443485,_0x152bab){return function(_0x394c6c){if(_0x394c6c){return _0x394c6c[_0xff8f('0x28')](_0x443485)[_0xff8f('0x29')](function(_0x506586){return _0x506586;});}return null;};}function removeEntity(_0x522a7c,_0x1bfada){return function(_0x235dc9){if(_0x235dc9){return _0x235dc9[_0xff8f('0x2a')]()['then'](function(){_0x522a7c[_0xff8f('0x1d')](0xcc)[_0xff8f('0x1e')]();});}};}function handleEntityNotFound(_0x3af88c,_0x1764e4){return function(_0x517742){if(!_0x517742){_0x3af88c[_0xff8f('0x1c')](0x194);}return _0x517742;};}function handleError(_0x26da8e,_0x34e9e1){_0x34e9e1=_0x34e9e1||0x1f4;return function(_0x25d7cd){logger[_0xff8f('0x2b')](_0x25d7cd[_0xff8f('0x2c')]);if(_0x25d7cd[_0xff8f('0x2d')]){delete _0x25d7cd[_0xff8f('0x2d')];}_0x26da8e[_0xff8f('0x1d')](_0x34e9e1)[_0xff8f('0x2e')](_0x25d7cd);};}exports['index']=function(_0x49765a,_0x31dbb0){var _0x55acdb={},_0x5063cd={},_0x3bbd2c={'count':0x0,'rows':[]};var _0xb75d7=db['FreshdeskField']['rawAttributes'];_0x5063cd[_0xff8f('0x2f')]=_[_0xff8f('0x30')](_0xb75d7);_0x5063cd[_0xff8f('0x31')]=_['keys'](_0x49765a[_0xff8f('0x31')]);_0x5063cd[_0xff8f('0x32')]=_[_0xff8f('0x33')](_0x5063cd[_0xff8f('0x2f')],_0x5063cd['query']);_0x55acdb[_0xff8f('0x34')]=_['intersection'](_0x5063cd[_0xff8f('0x2f')],qs[_0xff8f('0x35')](_0x49765a[_0xff8f('0x31')][_0xff8f('0x35')]));_0x55acdb['attributes']=_0x55acdb[_0xff8f('0x34')]['length']?_0x55acdb['attributes']:_0x5063cd[_0xff8f('0x2f')];if(!_0x49765a['query'][_0xff8f('0x36')](_0xff8f('0x37'))){_0x55acdb[_0xff8f('0x21')]=qs[_0xff8f('0x21')](_0x49765a[_0xff8f('0x31')][_0xff8f('0x21')]);_0x55acdb[_0xff8f('0x20')]=qs[_0xff8f('0x20')](_0x49765a[_0xff8f('0x31')][_0xff8f('0x20')]);}_0x55acdb[_0xff8f('0x38')]=qs[_0xff8f('0x39')](_0x49765a['query']['sort']);_0x55acdb[_0xff8f('0x3a')]=qs[_0xff8f('0x32')](_['pick'](_0x49765a['query'],_0x5063cd[_0xff8f('0x32')]));if(_0x49765a[_0xff8f('0x31')][_0xff8f('0x3b')]){_0x55acdb[_0xff8f('0x3a')]=_[_0xff8f('0x3c')](_0x55acdb[_0xff8f('0x3a')],{'$or':_[_0xff8f('0x3d')](_0xb75d7,function(_0x58683b){if(_0x58683b[_0xff8f('0x3e')][_0xff8f('0x3f')]!==_0xff8f('0x40')){var _0x356d5c={};_0x356d5c[_0x58683b[_0xff8f('0x41')]]={'$like':'%'+_0x49765a[_0xff8f('0x31')][_0xff8f('0x3b')]+'%'};return _0x356d5c;}})});}_0x55acdb=_[_0xff8f('0x3c')]({},_0x55acdb,_0x49765a[_0xff8f('0x42')]);var _0x3eddf2={'where':_0x55acdb[_0xff8f('0x3a')]};return db[_0xff8f('0x43')][_0xff8f('0x1f')](_0x3eddf2)[_0xff8f('0x29')](function(_0xa20dbc){_0x3bbd2c[_0xff8f('0x1f')]=_0xa20dbc;if(_0x49765a['query']['includeAll']){_0x55acdb[_0xff8f('0x44')]=[{'all':!![]}];}return db[_0xff8f('0x43')]['findAll'](_0x55acdb);})[_0xff8f('0x29')](function(_0x39f973){_0x3bbd2c[_0xff8f('0x45')]=_0x39f973;return _0x3bbd2c;})[_0xff8f('0x29')](respondWithFilteredResult(_0x31dbb0,_0x55acdb))[_0xff8f('0x46')](handleError(_0x31dbb0,null));};exports['show']=function(_0x53e34b,_0x156274){var _0x4ff4f6={'raw':!![],'where':{'id':_0x53e34b[_0xff8f('0x47')]['id']}},_0x5dba83={};_0x5dba83[_0xff8f('0x2f')]=_[_0xff8f('0x30')](db[_0xff8f('0x43')][_0xff8f('0x48')]);_0x5dba83['query']=_['keys'](_0x53e34b[_0xff8f('0x31')]);_0x5dba83[_0xff8f('0x32')]=_[_0xff8f('0x33')](_0x5dba83['model'],_0x5dba83['query']);_0x4ff4f6['attributes']=_['intersection'](_0x5dba83[_0xff8f('0x2f')],qs['fields'](_0x53e34b['query'][_0xff8f('0x35')]));_0x4ff4f6[_0xff8f('0x34')]=_0x4ff4f6['attributes'][_0xff8f('0x49')]?_0x4ff4f6[_0xff8f('0x34')]:_0x5dba83['model'];if(_0x53e34b['query'][_0xff8f('0x4a')]){_0x4ff4f6[_0xff8f('0x44')]=[{'all':!![]}];}_0x4ff4f6=_[_0xff8f('0x3c')]({},_0x4ff4f6,_0x53e34b[_0xff8f('0x42')]);return db['FreshdeskField'][_0xff8f('0x4b')](_0x4ff4f6)['then'](handleEntityNotFound(_0x156274,null))['then'](respondWithResult(_0x156274,null))['catch'](handleError(_0x156274,null));};exports[_0xff8f('0x4c')]=function(_0x1183cf,_0x826750){return db[_0xff8f('0x43')][_0xff8f('0x4c')](_0x1183cf['body'],{})[_0xff8f('0x29')](respondWithResult(_0x826750,0xc9))[_0xff8f('0x46')](handleError(_0x826750,null));};exports[_0xff8f('0x28')]=function(_0x565cb5,_0x3e9fa5){if(_0x565cb5[_0xff8f('0x4d')]['id']){delete _0x565cb5[_0xff8f('0x4d')]['id'];}return db[_0xff8f('0x43')][_0xff8f('0x4b')]({'where':{'id':_0x565cb5['params']['id']}})[_0xff8f('0x29')](handleEntityNotFound(_0x3e9fa5,null))[_0xff8f('0x29')](saveUpdates(_0x565cb5[_0xff8f('0x4d')],null))[_0xff8f('0x29')](respondWithResult(_0x3e9fa5,null))[_0xff8f('0x46')](handleError(_0x3e9fa5,null));};exports['destroy']=function(_0x48a26a,_0xa710bc){return db[_0xff8f('0x43')][_0xff8f('0x4b')]({'where':{'id':_0x48a26a['params']['id']}})[_0xff8f('0x29')](handleEntityNotFound(_0xa710bc,null))['then'](removeEntity(_0xa710bc,null))[_0xff8f('0x46')](handleError(_0xa710bc,null));}; \ No newline at end of file +var _0xba38=['bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','destroy','error','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','FreshdeskField','then','includeAll','include','rows','catch','show','params','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x15308b,_0x51a3ca){var _0x209fbb=function(_0x4d1513){while(--_0x4d1513){_0x15308b['push'](_0x15308b['shift']());}};_0x209fbb(++_0x51a3ca);}(_0xba38,0x119));var _0x8ba3=function(_0x41ee09,_0x2a252c){_0x41ee09=_0x41ee09-0x0;var _0x26d64c=_0xba38[_0x41ee09];return _0x26d64c;};'use strict';var pdf=require(_0x8ba3('0x0'));var emlformat=require(_0x8ba3('0x1'));var rimraf=require(_0x8ba3('0x2'));var zipdir=require(_0x8ba3('0x3'));var jsonpatch=require(_0x8ba3('0x4'));var rp=require(_0x8ba3('0x5'));var moment=require(_0x8ba3('0x6'));var BPromise=require(_0x8ba3('0x7'));var Mustache=require('mustache');var util=require(_0x8ba3('0x8'));var path=require('path');var sox=require(_0x8ba3('0x9'));var csv=require(_0x8ba3('0xa'));var ejs=require(_0x8ba3('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8ba3('0xc'));var crypto=require(_0x8ba3('0xd'));var jsforce=require(_0x8ba3('0xe'));var deskjs=require(_0x8ba3('0xf'));var toCsv=require(_0x8ba3('0xa'));var querystring=require('querystring');var Papa=require(_0x8ba3('0x10'));var Redis=require(_0x8ba3('0x11'));var authService=require(_0x8ba3('0x12'));var qs=require(_0x8ba3('0x13'));var hardwareService=require(_0x8ba3('0x14'));var logger=require(_0x8ba3('0x15'))(_0x8ba3('0x16'));var utils=require('../../config/utils');var config=require(_0x8ba3('0x17'));var db=require(_0x8ba3('0x18'))['db'];function respondWithStatusCode(_0x426f15,_0x2394a8){_0x2394a8=_0x2394a8||0xcc;return function(_0x50cddc){if(_0x50cddc){return _0x426f15[_0x8ba3('0x19')](_0x2394a8);}return _0x426f15[_0x8ba3('0x1a')](_0x2394a8)[_0x8ba3('0x1b')]();};}function respondWithResult(_0x39c984,_0xa9cb1e){_0xa9cb1e=_0xa9cb1e||0xc8;return function(_0x124320){if(_0x124320){return _0x39c984[_0x8ba3('0x1a')](_0xa9cb1e)['json'](_0x124320);}};}function respondWithFilteredResult(_0xc172e7,_0x33e32d){return function(_0x20407a){if(_0x20407a){var _0x53628e=_0x20407a[_0x8ba3('0x1c')],_0x14f29a=_0x33e32d[_0x8ba3('0x1d')],_0x141466=_0x33e32d[_0x8ba3('0x1d')]+_0x33e32d[_0x8ba3('0x1e')],_0x19162b;if(_0x141466>=_0x53628e){_0x141466=_0x53628e;_0x19162b=0xc8;}else{_0x19162b=0xce;}_0xc172e7[_0x8ba3('0x1a')](_0x19162b);return _0xc172e7[_0x8ba3('0x1f')](_0x8ba3('0x20'),_0x14f29a+'-'+_0x141466+'/'+_0x53628e)['json'](_0x20407a);}return null;};}function patchUpdates(_0x36ad8c){return function(_0x1043ed){try{jsonpatch[_0x8ba3('0x21')](_0x1043ed,_0x36ad8c,!![]);}catch(_0x238a4d){return BPromise[_0x8ba3('0x22')](_0x238a4d);}return _0x1043ed['save']();};}function saveUpdates(_0x9b7934,_0x3bc387){return function(_0xf7af7c){if(_0xf7af7c){return _0xf7af7c['update'](_0x9b7934)['then'](function(_0x2eceac){return _0x2eceac;});}return null;};}function removeEntity(_0xe88749,_0x565ca9){return function(_0x4e73a6){if(_0x4e73a6){return _0x4e73a6[_0x8ba3('0x23')]()['then'](function(){_0xe88749['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9e1e92,_0x38234a){return function(_0x36fbdf){if(!_0x36fbdf){_0x9e1e92['sendStatus'](0x194);}return _0x36fbdf;};}function handleError(_0x4a77ce,_0x36f428){_0x36f428=_0x36f428||0x1f4;return function(_0x5e4da4){logger[_0x8ba3('0x24')](_0x5e4da4['stack']);if(_0x5e4da4[_0x8ba3('0x25')]){delete _0x5e4da4['name'];}_0x4a77ce[_0x8ba3('0x1a')](_0x36f428)[_0x8ba3('0x26')](_0x5e4da4);};}exports[_0x8ba3('0x27')]=function(_0x278527,_0x584165){var _0x488aa9={},_0x5df5d6={},_0x546bd4={'count':0x0,'rows':[]};var _0x4a1724=db['FreshdeskField'][_0x8ba3('0x28')];_0x5df5d6[_0x8ba3('0x29')]=_[_0x8ba3('0x2a')](_0x4a1724);_0x5df5d6[_0x8ba3('0x2b')]=_[_0x8ba3('0x2a')](_0x278527['query']);_0x5df5d6[_0x8ba3('0x2c')]=_[_0x8ba3('0x2d')](_0x5df5d6[_0x8ba3('0x29')],_0x5df5d6['query']);_0x488aa9['attributes']=_[_0x8ba3('0x2d')](_0x5df5d6[_0x8ba3('0x29')],qs[_0x8ba3('0x2e')](_0x278527[_0x8ba3('0x2b')][_0x8ba3('0x2e')]));_0x488aa9[_0x8ba3('0x2f')]=_0x488aa9['attributes'][_0x8ba3('0x30')]?_0x488aa9[_0x8ba3('0x2f')]:_0x5df5d6[_0x8ba3('0x29')];if(!_0x278527[_0x8ba3('0x2b')][_0x8ba3('0x31')]('nolimit')){_0x488aa9['limit']=qs[_0x8ba3('0x1e')](_0x278527[_0x8ba3('0x2b')][_0x8ba3('0x1e')]);_0x488aa9[_0x8ba3('0x1d')]=qs[_0x8ba3('0x1d')](_0x278527[_0x8ba3('0x2b')][_0x8ba3('0x1d')]);}_0x488aa9[_0x8ba3('0x32')]=qs[_0x8ba3('0x33')](_0x278527[_0x8ba3('0x2b')][_0x8ba3('0x33')]);_0x488aa9[_0x8ba3('0x34')]=qs[_0x8ba3('0x2c')](_[_0x8ba3('0x35')](_0x278527[_0x8ba3('0x2b')],_0x5df5d6[_0x8ba3('0x2c')]));if(_0x278527['query'][_0x8ba3('0x36')]){_0x488aa9[_0x8ba3('0x34')]=_[_0x8ba3('0x37')](_0x488aa9[_0x8ba3('0x34')],{'$or':_['map'](_0x4a1724,function(_0x4852b8){if(_0x4852b8[_0x8ba3('0x38')][_0x8ba3('0x39')]!==_0x8ba3('0x3a')){var _0x5d83c5={};_0x5d83c5[_0x4852b8[_0x8ba3('0x3b')]]={'$like':'%'+_0x278527[_0x8ba3('0x2b')][_0x8ba3('0x36')]+'%'};return _0x5d83c5;}})});}_0x488aa9=_[_0x8ba3('0x37')]({},_0x488aa9,_0x278527['options']);var _0x51d7d3={'where':_0x488aa9['where']};return db[_0x8ba3('0x3c')]['count'](_0x51d7d3)[_0x8ba3('0x3d')](function(_0x228e44){_0x546bd4[_0x8ba3('0x1c')]=_0x228e44;if(_0x278527['query'][_0x8ba3('0x3e')]){_0x488aa9[_0x8ba3('0x3f')]=[{'all':!![]}];}return db[_0x8ba3('0x3c')]['findAll'](_0x488aa9);})[_0x8ba3('0x3d')](function(_0x213030){_0x546bd4[_0x8ba3('0x40')]=_0x213030;return _0x546bd4;})[_0x8ba3('0x3d')](respondWithFilteredResult(_0x584165,_0x488aa9))[_0x8ba3('0x41')](handleError(_0x584165,null));};exports[_0x8ba3('0x42')]=function(_0x1d6b34,_0x47d9e6){var _0x3f41e9={'raw':!![],'where':{'id':_0x1d6b34[_0x8ba3('0x43')]['id']}},_0x550244={};_0x550244[_0x8ba3('0x29')]=_[_0x8ba3('0x2a')](db['FreshdeskField']['rawAttributes']);_0x550244[_0x8ba3('0x2b')]=_[_0x8ba3('0x2a')](_0x1d6b34[_0x8ba3('0x2b')]);_0x550244[_0x8ba3('0x2c')]=_[_0x8ba3('0x2d')](_0x550244[_0x8ba3('0x29')],_0x550244[_0x8ba3('0x2b')]);_0x3f41e9[_0x8ba3('0x2f')]=_[_0x8ba3('0x2d')](_0x550244['model'],qs['fields'](_0x1d6b34[_0x8ba3('0x2b')]['fields']));_0x3f41e9['attributes']=_0x3f41e9[_0x8ba3('0x2f')][_0x8ba3('0x30')]?_0x3f41e9['attributes']:_0x550244['model'];if(_0x1d6b34[_0x8ba3('0x2b')]['includeAll']){_0x3f41e9[_0x8ba3('0x3f')]=[{'all':!![]}];}_0x3f41e9=_[_0x8ba3('0x37')]({},_0x3f41e9,_0x1d6b34['options']);return db['FreshdeskField'][_0x8ba3('0x44')](_0x3f41e9)['then'](handleEntityNotFound(_0x47d9e6,null))[_0x8ba3('0x3d')](respondWithResult(_0x47d9e6,null))[_0x8ba3('0x41')](handleError(_0x47d9e6,null));};exports['create']=function(_0x49092c,_0x158124){return db[_0x8ba3('0x3c')][_0x8ba3('0x45')](_0x49092c[_0x8ba3('0x46')],{})['then'](respondWithResult(_0x158124,0xc9))[_0x8ba3('0x41')](handleError(_0x158124,null));};exports[_0x8ba3('0x47')]=function(_0x3629f0,_0x2c4fd9){if(_0x3629f0[_0x8ba3('0x46')]['id']){delete _0x3629f0[_0x8ba3('0x46')]['id'];}return db[_0x8ba3('0x3c')]['find']({'where':{'id':_0x3629f0[_0x8ba3('0x43')]['id']}})['then'](handleEntityNotFound(_0x2c4fd9,null))[_0x8ba3('0x3d')](saveUpdates(_0x3629f0['body'],null))[_0x8ba3('0x3d')](respondWithResult(_0x2c4fd9,null))['catch'](handleError(_0x2c4fd9,null));};exports[_0x8ba3('0x23')]=function(_0x41452d,_0x511030){return db[_0x8ba3('0x3c')]['find']({'where':{'id':_0x41452d['params']['id']}})[_0x8ba3('0x3d')](handleEntityNotFound(_0x511030,null))[_0x8ba3('0x3d')](removeEntity(_0x511030,null))[_0x8ba3('0x41')](handleError(_0x511030,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 49645a6..108395b 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 _0xc90d=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index'];(function(_0x345fbf,_0x660d92){var _0x57986f=function(_0x22a84c){while(--_0x22a84c){_0x345fbf['push'](_0x345fbf['shift']());}};_0x57986f(++_0x660d92);}(_0xc90d,0x1bc));var _0xdc90=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xc90d[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0xdc90('0x0'));var util=require('util');var logger=require(_0xdc90('0x1'))(_0xdc90('0x2'));var moment=require(_0xdc90('0x3'));var BPromise=require(_0xdc90('0x4'));var rp=require(_0xdc90('0x5'));var fs=require('fs');var path=require(_0xdc90('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdc90('0x7'));module['exports']=function(_0x8882d9,_0x69fc3b){return _0x8882d9[_0xdc90('0x8')](_0xdc90('0x9'),attributes,{'tableName':_0xdc90('0xa'),'paranoid':![],'indexes':[{'name':_0xdc90('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8685=['./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','util','../../config/logger','moment','path'];(function(_0x54d5b2,_0x293bbf){var _0x179c95=function(_0x9e8748){while(--_0x9e8748){_0x54d5b2['push'](_0x54d5b2['shift']());}};_0x179c95(++_0x293bbf);}(_0x8685,0x10a));var _0x5868=function(_0xb5f49a,_0x42c433){_0xb5f49a=_0xb5f49a-0x0;var _0x40308b=_0x8685[_0xb5f49a];return _0x40308b;};'use strict';var _=require('lodash');var util=require(_0x5868('0x0'));var logger=require(_0x5868('0x1'))('api');var moment=require(_0x5868('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5868('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5868('0x4'));module[_0x5868('0x5')]=function(_0x255d1a,_0x44cc94){return _0x255d1a[_0x5868('0x6')](_0x5868('0x7'),attributes,{'tableName':_0x5868('0x8'),'paranoid':![],'indexes':[{'name':_0x5868('0x9'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 84c4cdb..4da227f 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 _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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x1aa534,_0x2e685d){_0x1aa534=_0x1aa534-0x0;var _0xe8efa3=_0x7a54[_0x1aa534];return _0xe8efa3;};'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 +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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x155f15,_0x165a90){_0x155f15=_0x155f15-0x0;var _0x5ca006=_0x7a54[_0x155f15];return _0x5ca006;};'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 411d70c..1b06933 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 _0xb695=['/:id/configurations','getConfigurations','/:id/fields','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','index'];(function(_0x309910,_0xacd642){var _0x3c1bd1=function(_0x1dd850){while(--_0x1dd850){_0x309910['push'](_0x309910['shift']());}};_0x3c1bd1(++_0xacd642);}(_0xb695,0x1d6));var _0x5b69=function(_0x551003,_0xf63b2c){_0x551003=_0x551003-0x0;var _0x2e2073=_0xb695[_0x551003];return _0x2e2073;};'use strict';var multer=require(_0x5b69('0x0'));var util=require(_0x5b69('0x1'));var path=require(_0x5b69('0x2'));var timeout=require(_0x5b69('0x3'));var express=require(_0x5b69('0x4'));var router=express[_0x5b69('0x5')]();var auth=require(_0x5b69('0x6'));var interaction=require(_0x5b69('0x7'));var config=require(_0x5b69('0x8'));var controller=require(_0x5b69('0x9'));router[_0x5b69('0xa')]('/',auth[_0x5b69('0xb')](),controller[_0x5b69('0xc')]);router['get']('/:id',auth[_0x5b69('0xb')](),controller['show']);router['get'](_0x5b69('0xd'),auth[_0x5b69('0xb')](),controller[_0x5b69('0xe')]);router[_0x5b69('0xa')](_0x5b69('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x5b69('0x10')]('/',auth[_0x5b69('0xb')](),controller['create']);router[_0x5b69('0x10')](_0x5b69('0xd'),auth[_0x5b69('0xb')](),controller['addConfiguration']);router[_0x5b69('0x11')](_0x5b69('0x12'),auth[_0x5b69('0xb')](),controller[_0x5b69('0x13')]);router[_0x5b69('0x14')]('/:id',auth[_0x5b69('0xb')](),controller[_0x5b69('0x15')]);module[_0x5b69('0x16')]=router; \ No newline at end of file +var _0x9d2d=['getFields','post','create','addConfiguration','put','update','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x176d02,_0x1ae00f){var _0x32a368=function(_0x48f2c6){while(--_0x48f2c6){_0x176d02['push'](_0x176d02['shift']());}};_0x32a368(++_0x1ae00f);}(_0x9d2d,0x124));var _0xd9d2=function(_0x202ab2,_0xc6725e){_0x202ab2=_0x202ab2-0x0;var _0x2a9d41=_0x9d2d[_0x202ab2];return _0x2a9d41;};'use strict';var multer=require('multer');var util=require(_0xd9d2('0x0'));var path=require(_0xd9d2('0x1'));var timeout=require(_0xd9d2('0x2'));var express=require(_0xd9d2('0x3'));var router=express[_0xd9d2('0x4')]();var auth=require(_0xd9d2('0x5'));var interaction=require(_0xd9d2('0x6'));var config=require(_0xd9d2('0x7'));var controller=require(_0xd9d2('0x8'));router[_0xd9d2('0x9')]('/',auth[_0xd9d2('0xa')](),controller[_0xd9d2('0xb')]);router[_0xd9d2('0x9')](_0xd9d2('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xd9d2('0x9')](_0xd9d2('0xd'),auth['isAuthenticated'](),controller[_0xd9d2('0xe')]);router['get'](_0xd9d2('0xf'),auth['isAuthenticated'](),controller[_0xd9d2('0x10')]);router[_0xd9d2('0x11')]('/',auth[_0xd9d2('0xa')](),controller[_0xd9d2('0x12')]);router['post'](_0xd9d2('0xd'),auth['isAuthenticated'](),controller[_0xd9d2('0x13')]);router[_0xd9d2('0x14')](_0xd9d2('0xc'),auth['isAuthenticated'](),controller[_0xd9d2('0x15')]);router['delete'](_0xd9d2('0xc'),auth[_0xd9d2('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index b1ea8ed..aaa9fe4 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 _0x8ef6=['newTab','integrationTab','sequelize','exports','STRING','username'];(function(_0x147aa5,_0x44d876){var _0x3ad6d6=function(_0x485041){while(--_0x485041){_0x147aa5['push'](_0x147aa5['shift']());}};_0x3ad6d6(++_0x44d876);}(_0x8ef6,0xf2));var _0x68ef=function(_0x274f08,_0xce453a){_0x274f08=_0x274f08-0x0;var _0x4cff26=_0x8ef6[_0x274f08];return _0x4cff26;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')]},'description':{'type':Sequelize[_0x68ef('0x2')]},'username':{'type':Sequelize[_0x68ef('0x2')],'unique':_0x68ef('0x3')},'remoteUri':{'type':Sequelize[_0x68ef('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x68ef('0x2')]},'clientSecret':{'type':Sequelize[_0x68ef('0x2')]},'securityToken':{'type':Sequelize[_0x68ef('0x2')]},'serverUrl':{'type':Sequelize[_0x68ef('0x2')]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x68ef('0x4')),'defaultValue':_0x68ef('0x5')}}; \ No newline at end of file +var _0x53ec=['ENUM','newTab','integrationTab','sequelize','exports','STRING','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53ec,0x192));var _0xc53e=function(_0x2ef8f1,_0x1280a3){_0x2ef8f1=_0x2ef8f1-0x0;var _0x17498d=_0x53ec[_0x2ef8f1];return _0x17498d;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')]},'description':{'type':Sequelize[_0xc53e('0x2')]},'username':{'type':Sequelize[_0xc53e('0x2')],'unique':_0xc53e('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc53e('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xc53e('0x2')]},'securityToken':{'type':Sequelize[_0xc53e('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc53e('0x4')]('integrationTab',_0xc53e('0x5')),'defaultValue':_0xc53e('0x6')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 61d46e3..df5a948 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 _0x120d=['code','message','result','catch','sendStatus','end','json','count','offset','limit','status','apply','save','update','name','send','SalesforceAccount','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','map','key','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','params','destroy','findOne','SalesforceConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','type','Descriptions','getDescriptions','SalesforceField','getFields','clientId','clientSecret','username','password','remoteUri','slice','substring','login','concat','securityToken','isNil','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','IsArchived','Type','Reason','Status','IsEscalated','SuppliedName','remove','custom','label','picklistValues','value','True','true','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x58506f,_0x3a1b84){var _0x9a29bf=function(_0x252210){while(--_0x252210){_0x58506f['push'](_0x58506f['shift']());}};_0x9a29bf(++_0x3a1b84);}(_0x120d,0xd8));var _0xd120=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0x120d[_0x2bf466];return _0x856885;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd120('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd120('0x1'));var moment=require(_0xd120('0x2'));var BPromise=require(_0xd120('0x3'));var Mustache=require('mustache');var util=require(_0xd120('0x4'));var path=require(_0xd120('0x5'));var sox=require(_0xd120('0x6'));var csv=require(_0xd120('0x7'));var ejs=require(_0xd120('0x8'));var fs=require('fs');var _=require(_0xd120('0x9'));var squel=require(_0xd120('0xa'));var crypto=require(_0xd120('0xb'));var jsforce=require(_0xd120('0xc'));var deskjs=require(_0xd120('0xd'));var toCsv=require(_0xd120('0x7'));var querystring=require(_0xd120('0xe'));var Papa=require(_0xd120('0xf'));var Redis=require(_0xd120('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd120('0x11'));var logger=require('../../config/logger')(_0xd120('0x12'));var utils=require(_0xd120('0x13'));var config=require(_0xd120('0x14'));var db=require(_0xd120('0x15'))['db'];var integrations=require(_0xd120('0x16'));var jayson=require(_0xd120('0x17'));var client=jayson['client'][_0xd120('0x18')]({'port':0x232a});function checkPasswordPattern(_0x568ec2,_0x1fc0a5,_0x34efcf){if(_0x34efcf){var _0x5ed626=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5ed626['test'](_0x1fc0a5)){return _0x568ec2;}else{throw new Error(_0xd120('0x19'));}}else{return _0x568ec2;}}function respondWithRpcPromise(_0x57c991,_0x5eaf77,_0x19c37b,_0x170819){return new BPromise(function(_0x544fd3,_0x660692){var _0x74a92f=_0x170819||client;return _0x74a92f['request'](_0x57c991,_0x19c37b)[_0xd120('0x1a')](function(_0x2f1c12){logger[_0xd120('0x1b')](_0xd120('0x1c'),_0x5eaf77,_0xd120('0x1d'));logger[_0xd120('0x1e')](_0xd120('0x1f'),_0x5eaf77,_0xd120('0x1d'),JSON[_0xd120('0x20')](_0x2f1c12));if(_0x2f1c12['error']){if(_0x2f1c12[_0xd120('0x21')][_0xd120('0x22')]===0x1f4){logger[_0xd120('0x21')](_0xd120('0x1c'),_0x5eaf77,_0x2f1c12[_0xd120('0x21')][_0xd120('0x23')]);return _0x660692(_0x2f1c12['error']['message']);}logger['error'](_0xd120('0x1c'),_0x5eaf77,_0x2f1c12[_0xd120('0x21')][_0xd120('0x23')]);return _0x544fd3(_0x2f1c12[_0xd120('0x21')][_0xd120('0x23')]);}else{logger[_0xd120('0x1b')]('SalesforceAccount,\x20%s,\x20%s',_0x5eaf77,'request\x20sent');_0x544fd3(_0x2f1c12[_0xd120('0x24')][_0xd120('0x23')]);}})[_0xd120('0x25')](function(_0x5ba93c){logger[_0xd120('0x21')]('SalesforceAccount,\x20%s,\x20%s',_0x5eaf77,_0x5ba93c);_0x660692(_0x5ba93c);});});}function respondWithStatusCode(_0x2158b6,_0x4f44c7){_0x4f44c7=_0x4f44c7||0xcc;return function(_0x38c830){if(_0x38c830){return _0x2158b6[_0xd120('0x26')](_0x4f44c7);}return _0x2158b6['status'](_0x4f44c7)[_0xd120('0x27')]();};}function respondWithResult(_0xbe2b8f,_0x3813e0){_0x3813e0=_0x3813e0||0xc8;return function(_0x53438c){if(_0x53438c){return _0xbe2b8f['status'](_0x3813e0)[_0xd120('0x28')](_0x53438c);}};}function respondWithFilteredResult(_0x122808,_0x525a86){return function(_0x4570db){if(_0x4570db){var _0xe5651=_0x4570db[_0xd120('0x29')],_0x1de1a2=_0x525a86[_0xd120('0x2a')],_0x1d5d25=_0x525a86[_0xd120('0x2a')]+_0x525a86[_0xd120('0x2b')],_0x5798c3;if(_0x1d5d25>=_0xe5651){_0x1d5d25=_0xe5651;_0x5798c3=0xc8;}else{_0x5798c3=0xce;}_0x122808[_0xd120('0x2c')](_0x5798c3);return _0x122808['set']('Content-Range',_0x1de1a2+'-'+_0x1d5d25+'/'+_0xe5651)['json'](_0x4570db);}return null;};}function patchUpdates(_0x3f8e3d){return function(_0x4a0a9d){try{jsonpatch[_0xd120('0x2d')](_0x4a0a9d,_0x3f8e3d,!![]);}catch(_0x217684){return BPromise['reject'](_0x217684);}return _0x4a0a9d[_0xd120('0x2e')]();};}function saveUpdates(_0x3079a9,_0x5b8e35){return function(_0xe29749){if(_0xe29749){return _0xe29749[_0xd120('0x2f')](_0x3079a9)[_0xd120('0x1a')](function(_0xb85dc3){return _0xb85dc3;});}return null;};}function removeEntity(_0x477c77,_0x26fc2c){return function(_0x128daf){if(_0x128daf){return _0x128daf['destroy']()[_0xd120('0x1a')](function(){_0x477c77[_0xd120('0x2c')](0xcc)[_0xd120('0x27')]();});}};}function handleEntityNotFound(_0x22e1c8,_0x2cd2b1){return function(_0x1d0b3f){if(!_0x1d0b3f){_0x22e1c8[_0xd120('0x26')](0x194);}return _0x1d0b3f;};}function handleError(_0x5a976e,_0x5c5e9d){_0x5c5e9d=_0x5c5e9d||0x1f4;return function(_0x24deb4){logger['error'](_0x24deb4['stack']);if(_0x24deb4[_0xd120('0x30')]){delete _0x24deb4[_0xd120('0x30')];}_0x5a976e['status'](_0x5c5e9d)[_0xd120('0x31')](_0x24deb4);};}exports['index']=function(_0x207c62,_0x390855){var _0x54850a={},_0xcaca2={},_0x1ea178={'count':0x0,'rows':[]};var _0x5f118d=db[_0xd120('0x32')]['rawAttributes'];_0xcaca2[_0xd120('0x33')]=_[_0xd120('0x34')](_0x5f118d);_0xcaca2['query']=_['keys'](_0x207c62[_0xd120('0x35')]);_0xcaca2[_0xd120('0x36')]=_['intersection'](_0xcaca2[_0xd120('0x33')],_0xcaca2[_0xd120('0x35')]);_0x54850a['attributes']=_[_0xd120('0x37')](_0xcaca2[_0xd120('0x33')],qs[_0xd120('0x38')](_0x207c62['query'][_0xd120('0x38')]));_0x54850a[_0xd120('0x39')]=_0x54850a[_0xd120('0x39')][_0xd120('0x3a')]?_0x54850a[_0xd120('0x39')]:_0xcaca2[_0xd120('0x33')];if(!_0x207c62[_0xd120('0x35')][_0xd120('0x3b')](_0xd120('0x3c'))){_0x54850a[_0xd120('0x2b')]=qs[_0xd120('0x2b')](_0x207c62[_0xd120('0x35')][_0xd120('0x2b')]);_0x54850a[_0xd120('0x2a')]=qs[_0xd120('0x2a')](_0x207c62[_0xd120('0x35')][_0xd120('0x2a')]);}_0x54850a['order']=qs['sort'](_0x207c62[_0xd120('0x35')][_0xd120('0x3d')]);_0x54850a['where']=qs[_0xd120('0x36')](_[_0xd120('0x3e')](_0x207c62[_0xd120('0x35')],_0xcaca2[_0xd120('0x36')]));if(_0x207c62[_0xd120('0x35')][_0xd120('0x3f')]){_0x54850a[_0xd120('0x40')]=_['merge'](_0x54850a[_0xd120('0x40')],{'$or':_[_0xd120('0x41')](_0x5f118d,function(_0x336aad){if(_0x336aad['type'][_0xd120('0x42')]!=='VIRTUAL'){var _0x48b38c={};_0x48b38c[_0x336aad['field']]={'$like':'%'+_0x207c62['query']['filter']+'%'};return _0x48b38c;}})});}_0x54850a=_[_0xd120('0x43')]({},_0x54850a,_0x207c62[_0xd120('0x44')]);var _0x92436c={'where':_0x54850a[_0xd120('0x40')]};return db[_0xd120('0x32')][_0xd120('0x29')](_0x92436c)[_0xd120('0x1a')](function(_0xbac174){_0x1ea178[_0xd120('0x29')]=_0xbac174;if(_0x207c62[_0xd120('0x35')][_0xd120('0x45')]){_0x54850a[_0xd120('0x46')]=[{'all':!![]}];}return db[_0xd120('0x32')][_0xd120('0x47')](_0x54850a);})['then'](function(_0x2b5bbe){_0x1ea178[_0xd120('0x48')]=_0x2b5bbe;return _0x1ea178;})[_0xd120('0x1a')](respondWithFilteredResult(_0x390855,_0x54850a))[_0xd120('0x25')](handleError(_0x390855,null));};exports[_0xd120('0x49')]=function(_0x2a0907,_0x26dadb){var _0x3fb1fc={'raw':![],'where':{'id':_0x2a0907['params']['id']}},_0x3aecf6={};_0x3aecf6[_0xd120('0x33')]=_['keys'](db[_0xd120('0x32')][_0xd120('0x4a')]);_0x3aecf6['query']=_[_0xd120('0x34')](_0x2a0907[_0xd120('0x35')]);_0x3aecf6['filters']=_[_0xd120('0x37')](_0x3aecf6[_0xd120('0x33')],_0x3aecf6[_0xd120('0x35')]);_0x3fb1fc[_0xd120('0x39')]=_[_0xd120('0x37')](_0x3aecf6['model'],qs[_0xd120('0x38')](_0x2a0907['query']['fields']));_0x3fb1fc['attributes']=_0x3fb1fc[_0xd120('0x39')][_0xd120('0x3a')]?_0x3fb1fc['attributes']:_0x3aecf6[_0xd120('0x33')];if(_0x2a0907[_0xd120('0x35')]['includeAll']){_0x3fb1fc[_0xd120('0x46')]=[{'all':!![]}];}_0x3fb1fc=_[_0xd120('0x43')]({},_0x3fb1fc,_0x2a0907[_0xd120('0x44')]);return db['SalesforceAccount'][_0xd120('0x4b')](_0x3fb1fc)[_0xd120('0x1a')](handleEntityNotFound(_0x26dadb,null))[_0xd120('0x1a')](respondWithResult(_0x26dadb,null))[_0xd120('0x25')](handleError(_0x26dadb,null));};exports[_0xd120('0x4c')]=function(_0x115590,_0xb24c9c){return db[_0xd120('0x32')]['create'](_0x115590[_0xd120('0x4d')],{})[_0xd120('0x1a')](respondWithResult(_0xb24c9c,0xc9))[_0xd120('0x25')](handleError(_0xb24c9c,null));};exports[_0xd120('0x2f')]=function(_0x377091,_0x3262b7){if(_0x377091['body']['id']){delete _0x377091[_0xd120('0x4d')]['id'];}return db[_0xd120('0x32')][_0xd120('0x4b')]({'where':{'id':_0x377091[_0xd120('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3262b7,null))[_0xd120('0x1a')](saveUpdates(_0x377091[_0xd120('0x4d')],null))[_0xd120('0x1a')](respondWithResult(_0x3262b7,null))[_0xd120('0x25')](handleError(_0x3262b7,null));};exports[_0xd120('0x4f')]=function(_0x3ddac2,_0x36998c){return db[_0xd120('0x32')]['find']({'where':{'id':_0x3ddac2[_0xd120('0x4e')]['id']}})[_0xd120('0x1a')](handleEntityNotFound(_0x36998c,null))[_0xd120('0x1a')](removeEntity(_0x36998c,null))[_0xd120('0x25')](handleError(_0x36998c,null));};exports['getConfigurations']=function(_0x2d91b6,_0x19ebdf,_0xd8518){var _0x4b3b25={};var _0x13b778={};var _0x5243cf;var _0x26ebd0;return db[_0xd120('0x32')][_0xd120('0x50')]({'where':{'id':_0x2d91b6[_0xd120('0x4e')]['id']}})[_0xd120('0x1a')](handleEntityNotFound(_0x19ebdf,null))[_0xd120('0x1a')](function(_0x31dd0b){if(_0x31dd0b){_0x5243cf=_0x31dd0b;_0x13b778[_0xd120('0x33')]=_[_0xd120('0x34')](db[_0xd120('0x51')][_0xd120('0x4a')]);_0x13b778[_0xd120('0x35')]=_[_0xd120('0x34')](_0x2d91b6[_0xd120('0x35')]);_0x13b778[_0xd120('0x36')]=_[_0xd120('0x37')](_0x13b778[_0xd120('0x33')],_0x13b778[_0xd120('0x35')]);_0x4b3b25[_0xd120('0x39')]=_[_0xd120('0x37')](_0x13b778[_0xd120('0x33')],qs[_0xd120('0x38')](_0x2d91b6[_0xd120('0x35')][_0xd120('0x38')]));_0x4b3b25[_0xd120('0x39')]=_0x4b3b25['attributes'][_0xd120('0x3a')]?_0x4b3b25[_0xd120('0x39')]:_0x13b778[_0xd120('0x33')];_0x4b3b25['order']=qs['sort'](_0x2d91b6['query'][_0xd120('0x3d')]);_0x4b3b25[_0xd120('0x40')]=qs[_0xd120('0x36')](_[_0xd120('0x3e')](_0x2d91b6[_0xd120('0x35')],_0x13b778[_0xd120('0x36')]));if(_0x2d91b6[_0xd120('0x35')][_0xd120('0x3f')]){_0x4b3b25['where']=_[_0xd120('0x43')](_0x4b3b25['where'],{'$or':_['map'](_0x4b3b25[_0xd120('0x39')],function(_0x615d68){var _0x30fa0c={};_0x30fa0c[_0x615d68]={'$like':'%'+_0x2d91b6[_0xd120('0x35')][_0xd120('0x3f')]+'%'};return _0x30fa0c;})});}_0x4b3b25=_['merge']({},_0x4b3b25,_0x2d91b6[_0xd120('0x44')]);return _0x5243cf['getConfigurations'](_0x4b3b25);}})[_0xd120('0x1a')](function(_0x53f496){if(_0x53f496){_0x26ebd0=_0x53f496[_0xd120('0x3a')];if(!_0x2d91b6[_0xd120('0x35')][_0xd120('0x3b')]('nolimit')){_0x4b3b25[_0xd120('0x2b')]=qs[_0xd120('0x2b')](_0x2d91b6['query']['limit']);_0x4b3b25[_0xd120('0x2a')]=qs['offset'](_0x2d91b6[_0xd120('0x35')][_0xd120('0x2a')]);}return _0x5243cf[_0xd120('0x52')](_0x4b3b25);}})['then'](function(_0x318500){if(_0x318500){return _0x318500?{'count':_0x26ebd0,'rows':_0x318500}:null;}})[_0xd120('0x1a')](respondWithResult(_0x19ebdf,null))[_0xd120('0x25')](handleError(_0x19ebdf,null));};exports[_0xd120('0x53')]=function(_0x5a4d2c,_0x139ee1,_0x4f635f){if(_0x5a4d2c['body']['id']){delete _0x5a4d2c[_0xd120('0x4d')]['id'];}return db[_0xd120('0x32')][_0xd120('0x50')]({'where':{'id':_0x5a4d2c[_0xd120('0x4e')]['id']}})[_0xd120('0x1a')](handleEntityNotFound(_0x139ee1,null))[_0xd120('0x1a')](function(_0x540082){if(_0x540082){_0x5a4d2c['body'][_0xd120('0x54')]=_0x540082['id'];_0x5a4d2c[_0xd120('0x4d')][_0xd120('0x55')]=integrations[_0xd120('0x56')](_0x5a4d2c['body']['channel'],_0x5a4d2c['body'][_0xd120('0x57')]);_0x5a4d2c['body'][_0xd120('0x58')]=integrations[_0xd120('0x59')](_0x5a4d2c[_0xd120('0x4d')]['channel'],_0x5a4d2c[_0xd120('0x4d')]['type']);return db[_0xd120('0x51')][_0xd120('0x4c')](_0x5a4d2c['body'],{'include':[{'model':db[_0xd120('0x5a')],'as':_0xd120('0x55')},{'model':db[_0xd120('0x5a')],'as':_0xd120('0x58')}]});}return null;})['then'](respondWithResult(_0x139ee1,null))[_0xd120('0x25')](handleError(_0x139ee1,null));};exports[_0xd120('0x5b')]=function(_0x1d7af7,_0x388973,_0x1e9030){var _0x3251cf;var _0x487a95='';var _0x2927d6='Task';return db['SalesforceAccount'][_0xd120('0x50')]({'where':{'id':_0x1d7af7[_0xd120('0x4e')]['id']},'attributes':['id','remoteUri',_0xd120('0x5c'),_0xd120('0x5d'),_0xd120('0x5e'),_0xd120('0x5f'),'securityToken']})['then'](handleEntityNotFound(_0x388973,null))['then'](function(_0x3dae2b){if(_0x3dae2b){_0x487a95=_0x3dae2b[_0xd120('0x60')];var _0x38cf75=_0x487a95[_0xd120('0x61')](-0x1);if(_0x38cf75==='/'){_0x487a95=_0x487a95[_0xd120('0x62')](0x0,_0x487a95['lastIndexOf'](_0x38cf75));}_0x3251cf=new jsforce['Connection']({'oauth2':{'loginUrl':_0x487a95,'clientId':_0x3dae2b[_0xd120('0x5c')],'clientSecret':_0x3dae2b[_0xd120('0x5d')]}});return _0x3251cf[_0xd120('0x63')](_0x3dae2b[_0xd120('0x5e')],_0x3dae2b['password'][_0xd120('0x64')](_0x3dae2b[_0xd120('0x65')]));}})[_0xd120('0x1a')](function(_0x3fa830){if(_0x3fa830){if(!_[_0xd120('0x66')](_0x1d7af7[_0xd120('0x35')]['ticketType'])){_0x2927d6=_0x1d7af7['query'][_0xd120('0x67')];}return _0x3251cf[_0xd120('0x68')](_0x2927d6)[_0xd120('0x69')]();}})['then'](function(_0x31f705){var _0x2fd544=[_0xd120('0x6a'),_0xd120('0x6b'),'CallObject','CallType',_0xd120('0x6c'),'Priority','Status',_0xd120('0x6d')];if(!_[_0xd120('0x66')](_0x1d7af7[_0xd120('0x35')][_0xd120('0x67')])&&_0x1d7af7[_0xd120('0x35')][_0xd120('0x67')]==='Case'){_0x2fd544=[_0xd120('0x6d'),'Origin',_0xd120('0x6e'),_0xd120('0x6f'),'Priority',_0xd120('0x70'),_0xd120('0x71'),'SuppliedCompany'];}if(_0x31f705){_[_0xd120('0x72')](_0x31f705[_0xd120('0x38')],function(_0x469219){return _0x469219[_0xd120('0x73')]===![]&&!_0x2fd544['includes'](_0x469219[_0xd120('0x30')]);});return{'count':_0x31f705['fields'][_0xd120('0x3a')],'rows':_[_0xd120('0x41')](_0x31f705['fields'],function(_0x2e764e){return{'id':_0x2e764e['name'],'name':_0x2e764e[_0xd120('0x74')],'custom':_0x2e764e['custom'],'options':_0x2e764e[_0xd120('0x75')]['length']>0x0?_[_0xd120('0x41')](_0x2e764e[_0xd120('0x75')],function(_0xbd96db){return{'name':_0xbd96db['label'],'value':_0xbd96db[_0xd120('0x76')]};}):_0x2e764e['type']=='boolean'?[{'name':_0xd120('0x77'),'value':_0xd120('0x78')},{'name':'False','value':_0xd120('0x79')}]:[]};})};}})[_0xd120('0x1a')](respondWithResult(_0x388973,null))[_0xd120('0x25')](function(_0x5f57e4){var _0x102c79=_0x1d7af7[_0xd120('0x35')]['test']?0x1f4:_0x5f57e4[_0xd120('0x7a')]||0x1f4;logger[_0xd120('0x21')](_0xd120('0x7b'),_0xd120('0x5b'),_0x102c79,JSON['stringify'](_0x5f57e4));delete _0x5f57e4['name'];if(_0x102c79===0x191){_0x102c79=0x190;}_0x388973[_0xd120('0x2c')](_0x102c79)['send'](_0x1d7af7['query'][_0xd120('0x7c')]?{'message':'Wrong\x20credentials','statusCode':_0x5f57e4[_0xd120('0x7a')]}:_0x5f57e4);});}; \ No newline at end of file +var _0x5a50=['SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SalesforceAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','set','apply','reject','save','update','destroy','name','send','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','offset','order','sort','pick','filter','where','type','field','merge','options','includeAll','include','SalesforceAccount','findAll','rows','show','params','rawAttributes','find','create','body','getConfigurations','SalesforceConfiguration','map','hasOwnProperty','addConfiguration','findOne','getSubjects','channel','Descriptions','SalesforceField','Subjects','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Priority','Status','Type','Origin','SuppliedName','SuppliedCompany','remove','custom','includes','picklistValues','label','value','boolean','True','true','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent'];(function(_0xb10d46,_0x3b1167){var _0x4fcc9d=function(_0xf3f54a){while(--_0xf3f54a){_0xb10d46['push'](_0xb10d46['shift']());}};_0x4fcc9d(++_0x3b1167);}(_0x5a50,0x1f3));var _0x05a5=function(_0x42ba52,_0x1a0475){_0x42ba52=_0x42ba52-0x0;var _0x4735f6=_0x5a50[_0x42ba52];return _0x4735f6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x05a5('0x0'));var rp=require(_0x05a5('0x1'));var moment=require(_0x05a5('0x2'));var BPromise=require(_0x05a5('0x3'));var Mustache=require(_0x05a5('0x4'));var util=require(_0x05a5('0x5'));var path=require(_0x05a5('0x6'));var sox=require(_0x05a5('0x7'));var csv=require(_0x05a5('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x05a5('0x9'));var squel=require(_0x05a5('0xa'));var crypto=require(_0x05a5('0xb'));var jsforce=require(_0x05a5('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x05a5('0xd'));var Redis=require(_0x05a5('0xe'));var authService=require(_0x05a5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x05a5('0x10'));var logger=require(_0x05a5('0x11'))(_0x05a5('0x12'));var utils=require('../../config/utils');var config=require(_0x05a5('0x13'));var db=require(_0x05a5('0x14'))['db'];var integrations=require(_0x05a5('0x15'));var jayson=require(_0x05a5('0x16'));var client=jayson['client'][_0x05a5('0x17')]({'port':0x232a});function checkPasswordPattern(_0x4ec76e,_0xf6a5f,_0x1bc74d){if(_0x1bc74d){var _0x4bf81a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4bf81a['test'](_0xf6a5f)){return _0x4ec76e;}else{throw new Error(_0x05a5('0x18'));}}else{return _0x4ec76e;}}function respondWithRpcPromise(_0x2e5e89,_0x1219b4,_0xca6917,_0x187c5d){return new BPromise(function(_0x446921,_0x4c5a03){var _0x4bb435=_0x187c5d||client;return _0x4bb435[_0x05a5('0x19')](_0x2e5e89,_0xca6917)[_0x05a5('0x1a')](function(_0x30f82d){logger[_0x05a5('0x1b')]('SalesforceAccount,\x20%s,\x20%s',_0x1219b4,_0x05a5('0x1c'));logger['debug'](_0x05a5('0x1d'),_0x1219b4,_0x05a5('0x1c'),JSON[_0x05a5('0x1e')](_0x30f82d));if(_0x30f82d[_0x05a5('0x1f')]){if(_0x30f82d[_0x05a5('0x1f')]['code']===0x1f4){logger[_0x05a5('0x1f')]('SalesforceAccount,\x20%s,\x20%s',_0x1219b4,_0x30f82d['error'][_0x05a5('0x20')]);return _0x4c5a03(_0x30f82d[_0x05a5('0x1f')]['message']);}logger[_0x05a5('0x1f')](_0x05a5('0x21'),_0x1219b4,_0x30f82d[_0x05a5('0x1f')][_0x05a5('0x20')]);return _0x446921(_0x30f82d[_0x05a5('0x1f')][_0x05a5('0x20')]);}else{logger[_0x05a5('0x1b')](_0x05a5('0x21'),_0x1219b4,_0x05a5('0x1c'));_0x446921(_0x30f82d[_0x05a5('0x22')]['message']);}})[_0x05a5('0x23')](function(_0x41ef2a){logger[_0x05a5('0x1f')](_0x05a5('0x21'),_0x1219b4,_0x41ef2a);_0x4c5a03(_0x41ef2a);});});}function respondWithStatusCode(_0x65e807,_0x17f200){_0x17f200=_0x17f200||0xcc;return function(_0xafdd60){if(_0xafdd60){return _0x65e807[_0x05a5('0x24')](_0x17f200);}return _0x65e807[_0x05a5('0x25')](_0x17f200)[_0x05a5('0x26')]();};}function respondWithResult(_0x5ebbbb,_0x43fadc){_0x43fadc=_0x43fadc||0xc8;return function(_0x505c8b){if(_0x505c8b){return _0x5ebbbb[_0x05a5('0x25')](_0x43fadc)[_0x05a5('0x27')](_0x505c8b);}};}function respondWithFilteredResult(_0x13ca33,_0x3c58de){return function(_0x4c4e09){if(_0x4c4e09){var _0x2408ae=_0x4c4e09[_0x05a5('0x28')],_0xe5e68c=_0x3c58de['offset'],_0xfe4fe=_0x3c58de['offset']+_0x3c58de['limit'],_0x56bbe7;if(_0xfe4fe>=_0x2408ae){_0xfe4fe=_0x2408ae;_0x56bbe7=0xc8;}else{_0x56bbe7=0xce;}_0x13ca33[_0x05a5('0x25')](_0x56bbe7);return _0x13ca33[_0x05a5('0x29')]('Content-Range',_0xe5e68c+'-'+_0xfe4fe+'/'+_0x2408ae)[_0x05a5('0x27')](_0x4c4e09);}return null;};}function patchUpdates(_0x49623d){return function(_0xd5e7b0){try{jsonpatch[_0x05a5('0x2a')](_0xd5e7b0,_0x49623d,!![]);}catch(_0x146b61){return BPromise[_0x05a5('0x2b')](_0x146b61);}return _0xd5e7b0[_0x05a5('0x2c')]();};}function saveUpdates(_0x612af0,_0x2db73c){return function(_0x154aa0){if(_0x154aa0){return _0x154aa0[_0x05a5('0x2d')](_0x612af0)[_0x05a5('0x1a')](function(_0x3b9a44){return _0x3b9a44;});}return null;};}function removeEntity(_0x49627d,_0x304968){return function(_0x5ad0df){if(_0x5ad0df){return _0x5ad0df[_0x05a5('0x2e')]()[_0x05a5('0x1a')](function(){_0x49627d[_0x05a5('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58ea21,_0x40d49f){return function(_0x42d1e1){if(!_0x42d1e1){_0x58ea21[_0x05a5('0x24')](0x194);}return _0x42d1e1;};}function handleError(_0x37b531,_0x2afd4e){_0x2afd4e=_0x2afd4e||0x1f4;return function(_0x55d855){logger['error'](_0x55d855['stack']);if(_0x55d855[_0x05a5('0x2f')]){delete _0x55d855[_0x05a5('0x2f')];}_0x37b531[_0x05a5('0x25')](_0x2afd4e)[_0x05a5('0x30')](_0x55d855);};}exports['index']=function(_0x48b96b,_0x4e8912){var _0x4e34ac={},_0x58863f={},_0x363366={'count':0x0,'rows':[]};var _0x139deb=db['SalesforceAccount']['rawAttributes'];_0x58863f[_0x05a5('0x31')]=_[_0x05a5('0x32')](_0x139deb);_0x58863f[_0x05a5('0x33')]=_['keys'](_0x48b96b[_0x05a5('0x33')]);_0x58863f[_0x05a5('0x34')]=_[_0x05a5('0x35')](_0x58863f[_0x05a5('0x31')],_0x58863f[_0x05a5('0x33')]);_0x4e34ac[_0x05a5('0x36')]=_[_0x05a5('0x35')](_0x58863f[_0x05a5('0x31')],qs[_0x05a5('0x37')](_0x48b96b[_0x05a5('0x33')][_0x05a5('0x37')]));_0x4e34ac[_0x05a5('0x36')]=_0x4e34ac[_0x05a5('0x36')][_0x05a5('0x38')]?_0x4e34ac[_0x05a5('0x36')]:_0x58863f['model'];if(!_0x48b96b['query']['hasOwnProperty'](_0x05a5('0x39'))){_0x4e34ac[_0x05a5('0x3a')]=qs[_0x05a5('0x3a')](_0x48b96b[_0x05a5('0x33')][_0x05a5('0x3a')]);_0x4e34ac[_0x05a5('0x3b')]=qs[_0x05a5('0x3b')](_0x48b96b[_0x05a5('0x33')][_0x05a5('0x3b')]);}_0x4e34ac[_0x05a5('0x3c')]=qs[_0x05a5('0x3d')](_0x48b96b[_0x05a5('0x33')][_0x05a5('0x3d')]);_0x4e34ac['where']=qs[_0x05a5('0x34')](_[_0x05a5('0x3e')](_0x48b96b[_0x05a5('0x33')],_0x58863f[_0x05a5('0x34')]));if(_0x48b96b[_0x05a5('0x33')][_0x05a5('0x3f')]){_0x4e34ac[_0x05a5('0x40')]=_['merge'](_0x4e34ac[_0x05a5('0x40')],{'$or':_['map'](_0x139deb,function(_0x49e206){if(_0x49e206[_0x05a5('0x41')]['key']!=='VIRTUAL'){var _0xc3d897={};_0xc3d897[_0x49e206[_0x05a5('0x42')]]={'$like':'%'+_0x48b96b[_0x05a5('0x33')]['filter']+'%'};return _0xc3d897;}})});}_0x4e34ac=_[_0x05a5('0x43')]({},_0x4e34ac,_0x48b96b[_0x05a5('0x44')]);var _0x3898e3={'where':_0x4e34ac[_0x05a5('0x40')]};return db['SalesforceAccount'][_0x05a5('0x28')](_0x3898e3)[_0x05a5('0x1a')](function(_0x10e673){_0x363366[_0x05a5('0x28')]=_0x10e673;if(_0x48b96b[_0x05a5('0x33')][_0x05a5('0x45')]){_0x4e34ac[_0x05a5('0x46')]=[{'all':!![]}];}return db[_0x05a5('0x47')][_0x05a5('0x48')](_0x4e34ac);})[_0x05a5('0x1a')](function(_0x302a37){_0x363366[_0x05a5('0x49')]=_0x302a37;return _0x363366;})[_0x05a5('0x1a')](respondWithFilteredResult(_0x4e8912,_0x4e34ac))['catch'](handleError(_0x4e8912,null));};exports[_0x05a5('0x4a')]=function(_0x2d483e,_0x1c0999){var _0x1ab6b7={'raw':![],'where':{'id':_0x2d483e[_0x05a5('0x4b')]['id']}},_0x335b16={};_0x335b16['model']=_['keys'](db[_0x05a5('0x47')][_0x05a5('0x4c')]);_0x335b16[_0x05a5('0x33')]=_[_0x05a5('0x32')](_0x2d483e[_0x05a5('0x33')]);_0x335b16['filters']=_[_0x05a5('0x35')](_0x335b16[_0x05a5('0x31')],_0x335b16[_0x05a5('0x33')]);_0x1ab6b7[_0x05a5('0x36')]=_['intersection'](_0x335b16['model'],qs[_0x05a5('0x37')](_0x2d483e[_0x05a5('0x33')][_0x05a5('0x37')]));_0x1ab6b7[_0x05a5('0x36')]=_0x1ab6b7[_0x05a5('0x36')][_0x05a5('0x38')]?_0x1ab6b7[_0x05a5('0x36')]:_0x335b16[_0x05a5('0x31')];if(_0x2d483e[_0x05a5('0x33')][_0x05a5('0x45')]){_0x1ab6b7[_0x05a5('0x46')]=[{'all':!![]}];}_0x1ab6b7=_['merge']({},_0x1ab6b7,_0x2d483e['options']);return db[_0x05a5('0x47')][_0x05a5('0x4d')](_0x1ab6b7)[_0x05a5('0x1a')](handleEntityNotFound(_0x1c0999,null))['then'](respondWithResult(_0x1c0999,null))[_0x05a5('0x23')](handleError(_0x1c0999,null));};exports['create']=function(_0x4d434f,_0x3f60de){return db['SalesforceAccount'][_0x05a5('0x4e')](_0x4d434f[_0x05a5('0x4f')],{})[_0x05a5('0x1a')](respondWithResult(_0x3f60de,0xc9))[_0x05a5('0x23')](handleError(_0x3f60de,null));};exports[_0x05a5('0x2d')]=function(_0x518cb5,_0x3c40c6){if(_0x518cb5[_0x05a5('0x4f')]['id']){delete _0x518cb5[_0x05a5('0x4f')]['id'];}return db[_0x05a5('0x47')][_0x05a5('0x4d')]({'where':{'id':_0x518cb5['params']['id']}})[_0x05a5('0x1a')](handleEntityNotFound(_0x3c40c6,null))[_0x05a5('0x1a')](saveUpdates(_0x518cb5[_0x05a5('0x4f')],null))['then'](respondWithResult(_0x3c40c6,null))['catch'](handleError(_0x3c40c6,null));};exports[_0x05a5('0x2e')]=function(_0x108719,_0x1c281c){return db[_0x05a5('0x47')][_0x05a5('0x4d')]({'where':{'id':_0x108719['params']['id']}})[_0x05a5('0x1a')](handleEntityNotFound(_0x1c281c,null))[_0x05a5('0x1a')](removeEntity(_0x1c281c,null))[_0x05a5('0x23')](handleError(_0x1c281c,null));};exports[_0x05a5('0x50')]=function(_0x2bc6b1,_0x367650,_0x318ad4){var _0x3868d4={};var _0x511fbe={};var _0x40abcf;var _0x377352;return db[_0x05a5('0x47')]['findOne']({'where':{'id':_0x2bc6b1[_0x05a5('0x4b')]['id']}})[_0x05a5('0x1a')](handleEntityNotFound(_0x367650,null))['then'](function(_0xae3c92){if(_0xae3c92){_0x40abcf=_0xae3c92;_0x511fbe[_0x05a5('0x31')]=_[_0x05a5('0x32')](db[_0x05a5('0x51')]['rawAttributes']);_0x511fbe[_0x05a5('0x33')]=_[_0x05a5('0x32')](_0x2bc6b1['query']);_0x511fbe[_0x05a5('0x34')]=_[_0x05a5('0x35')](_0x511fbe['model'],_0x511fbe['query']);_0x3868d4['attributes']=_[_0x05a5('0x35')](_0x511fbe[_0x05a5('0x31')],qs['fields'](_0x2bc6b1['query'][_0x05a5('0x37')]));_0x3868d4['attributes']=_0x3868d4[_0x05a5('0x36')]['length']?_0x3868d4[_0x05a5('0x36')]:_0x511fbe[_0x05a5('0x31')];_0x3868d4[_0x05a5('0x3c')]=qs[_0x05a5('0x3d')](_0x2bc6b1[_0x05a5('0x33')][_0x05a5('0x3d')]);_0x3868d4['where']=qs['filters'](_[_0x05a5('0x3e')](_0x2bc6b1[_0x05a5('0x33')],_0x511fbe[_0x05a5('0x34')]));if(_0x2bc6b1['query'][_0x05a5('0x3f')]){_0x3868d4[_0x05a5('0x40')]=_[_0x05a5('0x43')](_0x3868d4[_0x05a5('0x40')],{'$or':_[_0x05a5('0x52')](_0x3868d4[_0x05a5('0x36')],function(_0x59fca3){var _0x13ea73={};_0x13ea73[_0x59fca3]={'$like':'%'+_0x2bc6b1['query'][_0x05a5('0x3f')]+'%'};return _0x13ea73;})});}_0x3868d4=_[_0x05a5('0x43')]({},_0x3868d4,_0x2bc6b1[_0x05a5('0x44')]);return _0x40abcf[_0x05a5('0x50')](_0x3868d4);}})[_0x05a5('0x1a')](function(_0x504d1b){if(_0x504d1b){_0x377352=_0x504d1b[_0x05a5('0x38')];if(!_0x2bc6b1[_0x05a5('0x33')][_0x05a5('0x53')](_0x05a5('0x39'))){_0x3868d4['limit']=qs[_0x05a5('0x3a')](_0x2bc6b1[_0x05a5('0x33')][_0x05a5('0x3a')]);_0x3868d4[_0x05a5('0x3b')]=qs[_0x05a5('0x3b')](_0x2bc6b1[_0x05a5('0x33')]['offset']);}return _0x40abcf[_0x05a5('0x50')](_0x3868d4);}})[_0x05a5('0x1a')](function(_0x256264){if(_0x256264){return _0x256264?{'count':_0x377352,'rows':_0x256264}:null;}})[_0x05a5('0x1a')](respondWithResult(_0x367650,null))[_0x05a5('0x23')](handleError(_0x367650,null));};exports[_0x05a5('0x54')]=function(_0x47bc7,_0x312715,_0x45eeaf){if(_0x47bc7[_0x05a5('0x4f')]['id']){delete _0x47bc7[_0x05a5('0x4f')]['id'];}return db[_0x05a5('0x47')][_0x05a5('0x55')]({'where':{'id':_0x47bc7['params']['id']}})[_0x05a5('0x1a')](handleEntityNotFound(_0x312715,null))[_0x05a5('0x1a')](function(_0x235351){if(_0x235351){_0x47bc7[_0x05a5('0x4f')]['AccountId']=_0x235351['id'];_0x47bc7[_0x05a5('0x4f')]['Subjects']=integrations[_0x05a5('0x56')](_0x47bc7['body'][_0x05a5('0x57')],_0x47bc7['body'][_0x05a5('0x41')]);_0x47bc7['body'][_0x05a5('0x58')]=integrations['getDescriptions'](_0x47bc7['body'][_0x05a5('0x57')],_0x47bc7[_0x05a5('0x4f')][_0x05a5('0x41')]);return db[_0x05a5('0x51')]['create'](_0x47bc7[_0x05a5('0x4f')],{'include':[{'model':db[_0x05a5('0x59')],'as':_0x05a5('0x5a')},{'model':db['SalesforceField'],'as':_0x05a5('0x58')}]});}return null;})['then'](respondWithResult(_0x312715,null))[_0x05a5('0x23')](handleError(_0x312715,null));};exports[_0x05a5('0x5b')]=function(_0x1a5daf,_0x26ccb1,_0x3543fd){var _0x58a3e2;var _0x5bc5cd='';var _0x113ed6=_0x05a5('0x5c');return db[_0x05a5('0x47')]['findOne']({'where':{'id':_0x1a5daf[_0x05a5('0x4b')]['id']},'attributes':['id',_0x05a5('0x5d'),_0x05a5('0x5e'),_0x05a5('0x5f'),_0x05a5('0x60'),_0x05a5('0x61'),_0x05a5('0x62')]})['then'](handleEntityNotFound(_0x26ccb1,null))[_0x05a5('0x1a')](function(_0x53691f){if(_0x53691f){_0x5bc5cd=_0x53691f[_0x05a5('0x5d')];var _0x49a7f4=_0x5bc5cd[_0x05a5('0x63')](-0x1);if(_0x49a7f4==='/'){_0x5bc5cd=_0x5bc5cd[_0x05a5('0x64')](0x0,_0x5bc5cd[_0x05a5('0x65')](_0x49a7f4));}_0x58a3e2=new jsforce[(_0x05a5('0x66'))]({'oauth2':{'loginUrl':_0x5bc5cd,'clientId':_0x53691f[_0x05a5('0x5e')],'clientSecret':_0x53691f[_0x05a5('0x5f')]}});return _0x58a3e2[_0x05a5('0x67')](_0x53691f[_0x05a5('0x60')],_0x53691f['password'][_0x05a5('0x68')](_0x53691f[_0x05a5('0x62')]));}})[_0x05a5('0x1a')](function(_0x438503){if(_0x438503){if(!_[_0x05a5('0x69')](_0x1a5daf[_0x05a5('0x33')][_0x05a5('0x6a')])){_0x113ed6=_0x1a5daf['query'][_0x05a5('0x6a')];}return _0x58a3e2[_0x05a5('0x6b')](_0x113ed6)[_0x05a5('0x6c')]();}})[_0x05a5('0x1a')](function(_0x197979){var _0x3d0d9d=[_0x05a5('0x6d'),_0x05a5('0x6e'),_0x05a5('0x6f'),_0x05a5('0x70'),_0x05a5('0x71'),_0x05a5('0x72'),_0x05a5('0x73'),_0x05a5('0x74')];if(!_['isNil'](_0x1a5daf[_0x05a5('0x33')][_0x05a5('0x6a')])&&_0x1a5daf[_0x05a5('0x33')]['ticketType']==='Case'){_0x3d0d9d=[_0x05a5('0x74'),_0x05a5('0x75'),'Reason',_0x05a5('0x73'),_0x05a5('0x72'),'IsEscalated',_0x05a5('0x76'),_0x05a5('0x77')];}if(_0x197979){_[_0x05a5('0x78')](_0x197979[_0x05a5('0x37')],function(_0x59c031){return _0x59c031[_0x05a5('0x79')]===![]&&!_0x3d0d9d[_0x05a5('0x7a')](_0x59c031['name']);});return{'count':_0x197979[_0x05a5('0x37')][_0x05a5('0x38')],'rows':_[_0x05a5('0x52')](_0x197979['fields'],function(_0x50d24a){return{'id':_0x50d24a[_0x05a5('0x2f')],'name':_0x50d24a['label'],'custom':_0x50d24a['custom'],'options':_0x50d24a[_0x05a5('0x7b')][_0x05a5('0x38')]>0x0?_[_0x05a5('0x52')](_0x50d24a[_0x05a5('0x7b')],function(_0x4be8d9){return{'name':_0x4be8d9[_0x05a5('0x7c')],'value':_0x4be8d9[_0x05a5('0x7d')]};}):_0x50d24a['type']==_0x05a5('0x7e')?[{'name':_0x05a5('0x7f'),'value':_0x05a5('0x80')},{'name':'False','value':'false'}]:[]};})};}})['then'](respondWithResult(_0x26ccb1,null))[_0x05a5('0x23')](function(_0x2eaa3f){var _0xacf964=_0x1a5daf[_0x05a5('0x33')][_0x05a5('0x81')]?0x1f4:_0x2eaa3f[_0x05a5('0x82')]||0x1f4;logger['error'](_0x05a5('0x83'),_0x05a5('0x5b'),_0xacf964,JSON[_0x05a5('0x1e')](_0x2eaa3f));delete _0x2eaa3f[_0x05a5('0x2f')];if(_0xacf964===0x191){_0xacf964=0x190;}_0x26ccb1[_0x05a5('0x25')](_0xacf964)['send'](_0x1a5daf[_0x05a5('0x33')][_0x05a5('0x81')]?{'message':'Wrong\x20credentials','statusCode':_0x2eaa3f[_0x05a5('0x82')]}:_0x2eaa3f);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index a45a81e..58ccfe3 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 _0x4217=['moment','bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util','api'];(function(_0x1df497,_0x3eba98){var _0x1ebaef=function(_0x488c38){while(--_0x488c38){_0x1df497['push'](_0x1df497['shift']());}};_0x1ebaef(++_0x3eba98);}(_0x4217,0xcd));var _0x7421=function(_0x77a7d8,_0x5b6468){_0x77a7d8=_0x77a7d8-0x0;var _0x163895=_0x4217[_0x77a7d8];return _0x163895;};'use strict';var _=require(_0x7421('0x0'));var util=require(_0x7421('0x1'));var logger=require('../../config/logger')(_0x7421('0x2'));var moment=require(_0x7421('0x3'));var BPromise=require(_0x7421('0x4'));var rp=require(_0x7421('0x5'));var fs=require('fs');var path=require(_0x7421('0x6'));var rimraf=require('rimraf');var config=require(_0x7421('0x7'));var attributes=require(_0x7421('0x8'));var integrations=require(_0x7421('0x9'));module['exports']=function(_0x636064,_0xae7ca0){return _0x636064[_0x7421('0xa')](_0x7421('0xb'),attributes,{'tableName':_0x7421('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9478=['path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x59aaca,_0x3b4ad7){var _0x54bf71=function(_0x4cbc25){while(--_0x4cbc25){_0x59aaca['push'](_0x59aaca['shift']());}};_0x54bf71(++_0x3b4ad7);}(_0x9478,0x1ba));var _0x8947=function(_0x360606,_0x1a3b8e){_0x360606=_0x360606-0x0;var _0x3486a3=_0x9478[_0x360606];return _0x3486a3;};'use strict';var _=require(_0x8947('0x0'));var util=require('util');var logger=require(_0x8947('0x1'))(_0x8947('0x2'));var moment=require(_0x8947('0x3'));var BPromise=require(_0x8947('0x4'));var rp=require(_0x8947('0x5'));var fs=require('fs');var path=require(_0x8947('0x6'));var rimraf=require(_0x8947('0x7'));var config=require(_0x8947('0x8'));var attributes=require(_0x8947('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x8947('0xa')]=function(_0x325d1c,_0x297b14){return _0x325d1c[_0x8947('0xb')](_0x8947('0xc'),attributes,{'tableName':_0x8947('0xd'),'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 f22cdb8..f3ad5f1 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 _0x5db8=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','model','stringify','ShowSalesforceAccount','find','map','lodash','util','moment','randomstring','ioredis'];(function(_0x7f3d7b,_0x28a80f){var _0x393895=function(_0x1b22e8){while(--_0x1b22e8){_0x7f3d7b['push'](_0x7f3d7b['shift']());}};_0x393895(++_0x28a80f);}(_0x5db8,0xbb));var _0x85db=function(_0x1bf301,_0xda5c4c){_0x1bf301=_0x1bf301-0x0;var _0x51c947=_0x5db8[_0x1bf301];return _0x51c947;};'use strict';var _=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var moment=require(_0x85db('0x2'));var BPromise=require('bluebird');var rs=require(_0x85db('0x3'));var fs=require('fs');var Redis=require(_0x85db('0x4'));var db=require(_0x85db('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x85db('0x6'));var config=require(_0x85db('0x7'));var jayson=require(_0x85db('0x8'));var client=jayson[_0x85db('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x489b13,_0x2b9f25,_0x3a10dd){return new BPromise(function(_0xc6fd00,_0x308988){return client['request'](_0x489b13,_0x3a10dd)[_0x85db('0xa')](function(_0x54f0c1){logger[_0x85db('0xb')](_0x85db('0xc'),_0x2b9f25,_0x85db('0xd'));logger[_0x85db('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x2b9f25,'request\x20sent',JSON['stringify'](_0x54f0c1));if(_0x54f0c1[_0x85db('0xf')]){if(_0x54f0c1[_0x85db('0xf')]['code']===0x1f4){logger[_0x85db('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x2b9f25,_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);return _0x308988(_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);}logger[_0x85db('0xf')](_0x85db('0xc'),_0x2b9f25,_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);return _0xc6fd00(_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);}else{logger[_0x85db('0xb')](_0x85db('0xc'),_0x2b9f25,_0x85db('0xd'));_0xc6fd00(_0x54f0c1['result'][_0x85db('0x10')]);}})[_0x85db('0x11')](function(_0x11e7da){logger[_0x85db('0xf')](_0x85db('0xc'),_0x2b9f25,_0x11e7da);_0x308988(_0x11e7da);});});}exports[_0x85db('0x12')]=function(_0x3209b3){var _0x56d3b2=this;return new Promise(function(_0x37ac04,_0xf89937){return db[_0x85db('0x13')][_0x85db('0x14')]({'raw':_0x3209b3[_0x85db('0x15')]?_0x3209b3[_0x85db('0x15')][_0x85db('0x16')]===undefined?!![]:![]:!![],'where':_0x3209b3[_0x85db('0x15')]?_0x3209b3[_0x85db('0x15')][_0x85db('0x17')]||null:null,'attributes':_0x3209b3['options']?_0x3209b3[_0x85db('0x15')][_0x85db('0x18')]||null:null,'limit':_0x3209b3[_0x85db('0x15')]?_0x3209b3[_0x85db('0x15')][_0x85db('0x19')]||null:null,'include':_0x3209b3[_0x85db('0x15')]?_0x3209b3[_0x85db('0x15')][_0x85db('0x1a')]?_['map'](_0x3209b3[_0x85db('0x15')][_0x85db('0x1a')],function(_0x57fe5b){return{'model':db[_0x57fe5b[_0x85db('0x1b')]],'as':_0x57fe5b['as'],'attributes':_0x57fe5b[_0x85db('0x18')],'include':_0x57fe5b[_0x85db('0x1a')]?_['map'](_0x57fe5b[_0x85db('0x1a')],function(_0x46f428){return{'model':db[_0x46f428[_0x85db('0x1b')]],'as':_0x46f428['as'],'attributes':_0x46f428['attributes'],'include':_0x46f428['include']?_['map'](_0x46f428[_0x85db('0x1a')],function(_0x105bb9){return{'model':db[_0x105bb9[_0x85db('0x1b')]],'as':_0x105bb9['as'],'attributes':_0x105bb9['attributes']};}):[]};}):[]};}):[]:[]})[_0x85db('0xa')](function(_0xc2abb8){logger[_0x85db('0xb')]('GetSalesforceAccount',_0x3209b3);logger['debug'](_0x85db('0x12'),_0x3209b3,JSON[_0x85db('0x1c')](_0xc2abb8));_0x37ac04(_0xc2abb8);})[_0x85db('0x11')](function(_0x226540){logger[_0x85db('0xf')](_0x85db('0x12'),_0x226540[_0x85db('0x10')],_0x3209b3);_0xf89937(_0x56d3b2[_0x85db('0xf')](0x1f4,_0x226540[_0x85db('0x10')]));});});};exports[_0x85db('0x1d')]=function(_0x580e90){var _0x4a15b9=this;return new Promise(function(_0x13ad98,_0x5e0e75){return db[_0x85db('0x13')][_0x85db('0x1e')]({'raw':_0x580e90['options']?_0x580e90[_0x85db('0x15')][_0x85db('0x16')]===undefined?!![]:![]:!![],'where':_0x580e90[_0x85db('0x15')]?_0x580e90[_0x85db('0x15')]['where']||null:null,'attributes':_0x580e90[_0x85db('0x15')]?_0x580e90[_0x85db('0x15')][_0x85db('0x18')]||null:null,'include':_0x580e90[_0x85db('0x15')]?_0x580e90[_0x85db('0x15')]['include']?_[_0x85db('0x1f')](_0x580e90[_0x85db('0x15')][_0x85db('0x1a')],function(_0xd0d27){return{'model':db[_0xd0d27['model']],'as':_0xd0d27['as'],'attributes':_0xd0d27[_0x85db('0x18')],'include':_0xd0d27[_0x85db('0x1a')]?_[_0x85db('0x1f')](_0xd0d27['include'],function(_0x550194){return{'model':db[_0x550194[_0x85db('0x1b')]],'as':_0x550194['as'],'attributes':_0x550194[_0x85db('0x18')],'include':_0x550194['include']?_[_0x85db('0x1f')](_0x550194[_0x85db('0x1a')],function(_0x20939b){return{'model':db[_0x20939b[_0x85db('0x1b')]],'as':_0x20939b['as'],'attributes':_0x20939b[_0x85db('0x18')]};}):[]};}):[]};}):[]:[]})[_0x85db('0xa')](function(_0x1791f3){logger[_0x85db('0xb')](_0x85db('0x1d'),_0x580e90);logger[_0x85db('0xe')](_0x85db('0x1d'),_0x580e90,JSON[_0x85db('0x1c')](_0x1791f3));_0x13ad98(_0x1791f3);})['catch'](function(_0x35e938){logger[_0x85db('0xf')](_0x85db('0x1d'),_0x35e938[_0x85db('0x10')],_0x580e90);_0x5e0e75(_0x4a15b9['error'](0x1f4,_0x35e938[_0x85db('0x10')]));});});}; \ No newline at end of file +var _0x524a=['limit','include','map','model','ShowSalesforceAccount','find','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetSalesforceAccount','SalesforceAccount','options','raw','attributes'];(function(_0x166b45,_0x202d7c){var _0x48eb13=function(_0x242af7){while(--_0x242af7){_0x166b45['push'](_0x166b45['shift']());}};_0x48eb13(++_0x202d7c);}(_0x524a,0xf5));var _0xa524=function(_0x24d0fd,_0x4e6e22){_0x24d0fd=_0x24d0fd-0x0;var _0x245459=_0x524a[_0x24d0fd];return _0x245459;};'use strict';var _=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var moment=require(_0xa524('0x2'));var BPromise=require(_0xa524('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa524('0x4'));var db=require(_0xa524('0x5'))['db'];var utils=require(_0xa524('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa524('0x7'));var jayson=require(_0xa524('0x8'));var client=jayson[_0xa524('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x460738,_0x56bd0e,_0x3a2dd6){return new BPromise(function(_0x11aa98,_0x56849e){return client[_0xa524('0xa')](_0x460738,_0x3a2dd6)[_0xa524('0xb')](function(_0x228ffe){logger[_0xa524('0xc')](_0xa524('0xd'),_0x56bd0e,'request\x20sent');logger[_0xa524('0xe')](_0xa524('0xf'),_0x56bd0e,'request\x20sent',JSON['stringify'](_0x228ffe));if(_0x228ffe[_0xa524('0x10')]){if(_0x228ffe[_0xa524('0x10')][_0xa524('0x11')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x56bd0e,_0x228ffe[_0xa524('0x10')]['message']);return _0x56849e(_0x228ffe[_0xa524('0x10')]['message']);}logger[_0xa524('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x56bd0e,_0x228ffe[_0xa524('0x10')][_0xa524('0x12')]);return _0x11aa98(_0x228ffe['error'][_0xa524('0x12')]);}else{logger[_0xa524('0xc')](_0xa524('0xd'),_0x56bd0e,_0xa524('0x13'));_0x11aa98(_0x228ffe[_0xa524('0x14')][_0xa524('0x12')]);}})[_0xa524('0x15')](function(_0x4fc42f){logger[_0xa524('0x10')](_0xa524('0xd'),_0x56bd0e,_0x4fc42f);_0x56849e(_0x4fc42f);});});}exports[_0xa524('0x16')]=function(_0x3d6a0d){var _0x375277=this;return new Promise(function(_0x805b93,_0x562941){return db[_0xa524('0x17')]['findAll']({'raw':_0x3d6a0d[_0xa524('0x18')]?_0x3d6a0d[_0xa524('0x18')][_0xa524('0x19')]===undefined?!![]:![]:!![],'where':_0x3d6a0d[_0xa524('0x18')]?_0x3d6a0d['options']['where']||null:null,'attributes':_0x3d6a0d[_0xa524('0x18')]?_0x3d6a0d[_0xa524('0x18')][_0xa524('0x1a')]||null:null,'limit':_0x3d6a0d[_0xa524('0x18')]?_0x3d6a0d[_0xa524('0x18')][_0xa524('0x1b')]||null:null,'include':_0x3d6a0d['options']?_0x3d6a0d[_0xa524('0x18')][_0xa524('0x1c')]?_[_0xa524('0x1d')](_0x3d6a0d[_0xa524('0x18')][_0xa524('0x1c')],function(_0x45cdcc){return{'model':db[_0x45cdcc[_0xa524('0x1e')]],'as':_0x45cdcc['as'],'attributes':_0x45cdcc['attributes'],'include':_0x45cdcc[_0xa524('0x1c')]?_[_0xa524('0x1d')](_0x45cdcc['include'],function(_0x47efb3){return{'model':db[_0x47efb3[_0xa524('0x1e')]],'as':_0x47efb3['as'],'attributes':_0x47efb3[_0xa524('0x1a')],'include':_0x47efb3[_0xa524('0x1c')]?_[_0xa524('0x1d')](_0x47efb3[_0xa524('0x1c')],function(_0x546060){return{'model':db[_0x546060['model']],'as':_0x546060['as'],'attributes':_0x546060[_0xa524('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa524('0xb')](function(_0x1582fa){logger[_0xa524('0xc')]('GetSalesforceAccount',_0x3d6a0d);logger[_0xa524('0xe')](_0xa524('0x16'),_0x3d6a0d,JSON['stringify'](_0x1582fa));_0x805b93(_0x1582fa);})[_0xa524('0x15')](function(_0x147094){logger['error'](_0xa524('0x16'),_0x147094['message'],_0x3d6a0d);_0x562941(_0x375277[_0xa524('0x10')](0x1f4,_0x147094[_0xa524('0x12')]));});});};exports[_0xa524('0x1f')]=function(_0x238133){var _0x136e83=this;return new Promise(function(_0x1c706b,_0x4f6133){return db[_0xa524('0x17')][_0xa524('0x20')]({'raw':_0x238133['options']?_0x238133['options'][_0xa524('0x19')]===undefined?!![]:![]:!![],'where':_0x238133['options']?_0x238133['options'][_0xa524('0x21')]||null:null,'attributes':_0x238133[_0xa524('0x18')]?_0x238133[_0xa524('0x18')][_0xa524('0x1a')]||null:null,'include':_0x238133['options']?_0x238133['options'][_0xa524('0x1c')]?_['map'](_0x238133['options'][_0xa524('0x1c')],function(_0x318ea0){return{'model':db[_0x318ea0[_0xa524('0x1e')]],'as':_0x318ea0['as'],'attributes':_0x318ea0[_0xa524('0x1a')],'include':_0x318ea0[_0xa524('0x1c')]?_[_0xa524('0x1d')](_0x318ea0[_0xa524('0x1c')],function(_0x865c55){return{'model':db[_0x865c55[_0xa524('0x1e')]],'as':_0x865c55['as'],'attributes':_0x865c55[_0xa524('0x1a')],'include':_0x865c55[_0xa524('0x1c')]?_[_0xa524('0x1d')](_0x865c55['include'],function(_0x4f41d8){return{'model':db[_0x4f41d8['model']],'as':_0x4f41d8['as'],'attributes':_0x4f41d8[_0xa524('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa524('0xb')](function(_0x4c5b8b){logger[_0xa524('0xc')]('ShowSalesforceAccount',_0x238133);logger[_0xa524('0xe')](_0xa524('0x1f'),_0x238133,JSON['stringify'](_0x4c5b8b));_0x1c706b(_0x4c5b8b);})[_0xa524('0x15')](function(_0x259532){logger[_0xa524('0x10')]('ShowSalesforceAccount',_0x259532[_0xa524('0x12')],_0x238133);_0x4f6133(_0x136e83[_0xa524('0x10')](0x1f4,_0x259532['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 87b6beb..5bc7a3a 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 _0x8edd=['/:id/subjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields'];(function(_0x1559a5,_0x41924e){var _0x17a783=function(_0x152c63){while(--_0x152c63){_0x1559a5['push'](_0x1559a5['shift']());}};_0x17a783(++_0x41924e);}(_0x8edd,0x135));var _0xd8ed=function(_0x4ab989,_0x3e2ca7){_0x4ab989=_0x4ab989-0x0;var _0x233040=_0x8edd[_0x4ab989];return _0x233040;};'use strict';var multer=require(_0xd8ed('0x0'));var util=require(_0xd8ed('0x1'));var path=require(_0xd8ed('0x2'));var timeout=require(_0xd8ed('0x3'));var express=require(_0xd8ed('0x4'));var router=express[_0xd8ed('0x5')]();var auth=require(_0xd8ed('0x6'));var interaction=require(_0xd8ed('0x7'));var config=require(_0xd8ed('0x8'));var controller=require(_0xd8ed('0x9'));router[_0xd8ed('0xa')]('/',auth[_0xd8ed('0xb')](),controller['index']);router[_0xd8ed('0xa')](_0xd8ed('0xc'),auth[_0xd8ed('0xb')](),controller[_0xd8ed('0xd')]);router[_0xd8ed('0xa')](_0xd8ed('0xe'),auth[_0xd8ed('0xb')](),controller[_0xd8ed('0xf')]);router['get'](_0xd8ed('0x10'),auth[_0xd8ed('0xb')](),controller['getSubjects']);router['get'](_0xd8ed('0x11'),auth[_0xd8ed('0xb')](),controller[_0xd8ed('0x12')]);router[_0xd8ed('0x13')]('/',auth[_0xd8ed('0xb')](),controller['create']);router[_0xd8ed('0x14')](_0xd8ed('0xc'),auth[_0xd8ed('0xb')](),controller[_0xd8ed('0x15')]);router[_0xd8ed('0x16')](_0xd8ed('0xc'),auth[_0xd8ed('0xb')](),controller[_0xd8ed('0x17')]);module[_0xd8ed('0x18')]=router; \ No newline at end of file +var _0x52a6=['get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0x52a6,0xb5));var _0x652a=function(_0x444312,_0x47979c){_0x444312=_0x444312-0x0;var _0x39483e=_0x52a6[_0x444312];return _0x39483e;};'use strict';var multer=require(_0x652a('0x0'));var util=require('util');var path=require(_0x652a('0x1'));var timeout=require(_0x652a('0x2'));var express=require(_0x652a('0x3'));var router=express[_0x652a('0x4')]();var auth=require(_0x652a('0x5'));var interaction=require(_0x652a('0x6'));var config=require(_0x652a('0x7'));var controller=require('./intSalesforceConfiguration.controller');router[_0x652a('0x8')]('/',auth[_0x652a('0x9')](),controller[_0x652a('0xa')]);router[_0x652a('0x8')](_0x652a('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x652a('0xc'),auth[_0x652a('0x9')](),controller[_0x652a('0xd')]);router[_0x652a('0x8')]('/:id/subjects',auth[_0x652a('0x9')](),controller[_0x652a('0xe')]);router[_0x652a('0x8')]('/:id/descriptions',auth[_0x652a('0x9')](),controller['getDescriptions']);router['post']('/',auth[_0x652a('0x9')](),controller[_0x652a('0xf')]);router[_0x652a('0x10')](_0x652a('0xb'),auth[_0x652a('0x9')](),controller[_0x652a('0x11')]);router[_0x652a('0x12')](_0x652a('0xb'),auth[_0x652a('0x9')](),controller[_0x652a('0x13')]);module[_0x652a('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 18f198c..a205e47 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 _0xf3bb=['Case','Task','contact_lead','contact','nothing','lead','exports','STRING','ENUM'];(function(_0x23c148,_0x36f950){var _0x18cd4e=function(_0x9d62fb){while(--_0x9d62fb){_0x23c148['push'](_0x23c148['shift']());}};_0x18cd4e(++_0x36f950);}(_0xf3bb,0x153));var _0xbf3b=function(_0x2d4fc0,_0x3313ea){_0x2d4fc0=_0x2d4fc0-0x0;var _0x277a48=_0xf3bb[_0x2d4fc0];return _0x277a48;};'use strict';var Sequelize=require('sequelize');module[_0xbf3b('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbf3b('0x1')]},'ticketType':{'type':Sequelize[_0xbf3b('0x2')]('Task',_0xbf3b('0x3')),'defaultValue':_0xbf3b('0x4')},'moduleSearch':{'type':Sequelize[_0xbf3b('0x2')](_0xbf3b('0x5'),_0xbf3b('0x6'),'lead'),'defaultValue':_0xbf3b('0x5')},'moduleCreate':{'type':Sequelize[_0xbf3b('0x2')](_0xbf3b('0x7'),'contact',_0xbf3b('0x8')),'defaultValue':'lead'}}; \ No newline at end of file +var _0xf16e=['ENUM','Task','contact','contact_lead','nothing','lead','sequelize','exports','STRING'];(function(_0x383703,_0x46aa3b){var _0x275480=function(_0x532a4e){while(--_0x532a4e){_0x383703['push'](_0x383703['shift']());}};_0x275480(++_0x46aa3b);}(_0xf16e,0xd5));var _0xef16=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xf16e[_0x9fd887];return _0x1a54ab;};'use strict';var Sequelize=require(_0xef16('0x0'));module[_0xef16('0x1')]={'name':{'type':Sequelize[_0xef16('0x2')]},'description':{'type':Sequelize[_0xef16('0x2')]},'ticketType':{'type':Sequelize[_0xef16('0x3')](_0xef16('0x4'),'Case'),'defaultValue':_0xef16('0x4')},'moduleSearch':{'type':Sequelize[_0xef16('0x3')]('contact_lead',_0xef16('0x5'),'lead'),'defaultValue':_0xef16('0x6')},'moduleCreate':{'type':Sequelize[_0xef16('0x3')](_0xef16('0x7'),_0xef16('0x5'),_0xef16('0x8')),'defaultValue':_0xef16('0x8')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 937fd45..bde80cf 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 _0x2123=['filters','intersection','model','attributes','fields','length','hasOwnProperty','order','where','pick','filter','map','type','key','VIRTUAL','merge','options','includeAll','include','findAll','show','keys','find','create','body','params','getFields','findOne','sort','getSubjects','SalesforceField','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','end','name','index','SalesforceConfiguration','rawAttributes','query'];(function(_0x5d35fb,_0x1e2f25){var _0x42ba28=function(_0x2bbcd6){while(--_0x2bbcd6){_0x5d35fb['push'](_0x5d35fb['shift']());}};_0x42ba28(++_0x1e2f25);}(_0x2123,0x190));var _0x3212=function(_0x11a40c,_0x140dfb){_0x11a40c=_0x11a40c-0x0;var _0x386d61=_0x2123[_0x11a40c];return _0x386d61;};'use strict';var pdf=require(_0x3212('0x0'));var emlformat=require(_0x3212('0x1'));var rimraf=require(_0x3212('0x2'));var zipdir=require(_0x3212('0x3'));var jsonpatch=require(_0x3212('0x4'));var rp=require(_0x3212('0x5'));var moment=require(_0x3212('0x6'));var BPromise=require(_0x3212('0x7'));var Mustache=require(_0x3212('0x8'));var util=require(_0x3212('0x9'));var path=require(_0x3212('0xa'));var sox=require(_0x3212('0xb'));var csv=require('to-csv');var ejs=require(_0x3212('0xc'));var fs=require('fs');var _=require(_0x3212('0xd'));var squel=require(_0x3212('0xe'));var crypto=require('crypto');var jsforce=require(_0x3212('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3212('0x10'));var querystring=require(_0x3212('0x11'));var Papa=require(_0x3212('0x12'));var Redis=require(_0x3212('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x3212('0x14'));var logger=require(_0x3212('0x15'))(_0x3212('0x16'));var utils=require(_0x3212('0x17'));var config=require(_0x3212('0x18'));var db=require(_0x3212('0x19'))['db'];var jayson=require(_0x3212('0x1a'));var client=jayson[_0x3212('0x1b')][_0x3212('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2d5fce,_0x40745f,_0x2e4cf0){if(_0x2e4cf0){var _0x9f0bc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9f0bc[_0x3212('0x1d')](_0x40745f)){return _0x2d5fce;}else{throw new Error(_0x3212('0x1e'));}}else{return _0x2d5fce;}}function respondWithRpcPromise(_0x3d1fda,_0x17f8f9,_0x1bfe20,_0x19edfb){return new BPromise(function(_0x46c5f5,_0x42069c){var _0x1ef2f7=_0x19edfb||client;return _0x1ef2f7['request'](_0x3d1fda,_0x1bfe20)[_0x3212('0x1f')](function(_0x1719a5){logger[_0x3212('0x20')](_0x3212('0x21'),_0x17f8f9,_0x3212('0x22'));logger[_0x3212('0x23')](_0x3212('0x24'),_0x17f8f9,'request\x20sent',JSON['stringify'](_0x1719a5));if(_0x1719a5[_0x3212('0x25')]){if(_0x1719a5['error'][_0x3212('0x26')]===0x1f4){logger[_0x3212('0x25')](_0x3212('0x21'),_0x17f8f9,_0x1719a5[_0x3212('0x25')][_0x3212('0x27')]);return _0x42069c(_0x1719a5['error'][_0x3212('0x27')]);}logger[_0x3212('0x25')]('SalesforceConfiguration,\x20%s,\x20%s',_0x17f8f9,_0x1719a5[_0x3212('0x25')][_0x3212('0x27')]);return _0x46c5f5(_0x1719a5[_0x3212('0x25')]['message']);}else{logger['info'](_0x3212('0x21'),_0x17f8f9,_0x3212('0x22'));_0x46c5f5(_0x1719a5[_0x3212('0x28')][_0x3212('0x27')]);}})[_0x3212('0x29')](function(_0x436ecd){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x17f8f9,_0x436ecd);_0x42069c(_0x436ecd);});});}function respondWithStatusCode(_0x2e8518,_0x47cfdc){_0x47cfdc=_0x47cfdc||0xcc;return function(_0x24cdf3){if(_0x24cdf3){return _0x2e8518[_0x3212('0x2a')](_0x47cfdc);}return _0x2e8518[_0x3212('0x2b')](_0x47cfdc)['end']();};}function respondWithResult(_0x2d1b92,_0x32f7fd){_0x32f7fd=_0x32f7fd||0xc8;return function(_0x851b91){if(_0x851b91){return _0x2d1b92['status'](_0x32f7fd)[_0x3212('0x2c')](_0x851b91);}};}function respondWithFilteredResult(_0x35b4eb,_0x108eee){return function(_0x443a5){if(_0x443a5){var _0x21f003=_0x443a5[_0x3212('0x2d')],_0x1638c5=_0x108eee[_0x3212('0x2e')],_0x16df03=_0x108eee[_0x3212('0x2e')]+_0x108eee[_0x3212('0x2f')],_0x3813a3;if(_0x16df03>=_0x21f003){_0x16df03=_0x21f003;_0x3813a3=0xc8;}else{_0x3813a3=0xce;}_0x35b4eb['status'](_0x3813a3);return _0x35b4eb[_0x3212('0x30')](_0x3212('0x31'),_0x1638c5+'-'+_0x16df03+'/'+_0x21f003)[_0x3212('0x2c')](_0x443a5);}return null;};}function patchUpdates(_0x1cbab5){return function(_0x402a01){try{jsonpatch[_0x3212('0x32')](_0x402a01,_0x1cbab5,!![]);}catch(_0x3a7883){return BPromise['reject'](_0x3a7883);}return _0x402a01[_0x3212('0x33')]();};}function saveUpdates(_0x575a2b,_0x164b1f){return function(_0x562c9f){if(_0x562c9f){return _0x562c9f[_0x3212('0x34')](_0x575a2b)['then'](function(_0x4d17bb){return _0x4d17bb;});}return null;};}function removeEntity(_0x38f56a,_0x571ae0){return function(_0x294422){if(_0x294422){return _0x294422[_0x3212('0x35')]()[_0x3212('0x1f')](function(){_0x38f56a['status'](0xcc)[_0x3212('0x36')]();});}};}function handleEntityNotFound(_0x412740,_0x1f3b2c){return function(_0x487ce4){if(!_0x487ce4){_0x412740[_0x3212('0x2a')](0x194);}return _0x487ce4;};}function handleError(_0xa3d7b0,_0x14681c){_0x14681c=_0x14681c||0x1f4;return function(_0x2b5d04){logger[_0x3212('0x25')](_0x2b5d04['stack']);if(_0x2b5d04[_0x3212('0x37')]){delete _0x2b5d04[_0x3212('0x37')];}_0xa3d7b0[_0x3212('0x2b')](_0x14681c)['send'](_0x2b5d04);};}exports[_0x3212('0x38')]=function(_0x410961,_0x40a602){var _0x1b19c1={},_0x4e0d38={},_0x421948={'count':0x0,'rows':[]};var _0x3f157c=db[_0x3212('0x39')][_0x3212('0x3a')];_0x4e0d38['model']=_['keys'](_0x3f157c);_0x4e0d38['query']=_['keys'](_0x410961[_0x3212('0x3b')]);_0x4e0d38[_0x3212('0x3c')]=_[_0x3212('0x3d')](_0x4e0d38[_0x3212('0x3e')],_0x4e0d38['query']);_0x1b19c1[_0x3212('0x3f')]=_[_0x3212('0x3d')](_0x4e0d38[_0x3212('0x3e')],qs[_0x3212('0x40')](_0x410961['query']['fields']));_0x1b19c1[_0x3212('0x3f')]=_0x1b19c1[_0x3212('0x3f')][_0x3212('0x41')]?_0x1b19c1[_0x3212('0x3f')]:_0x4e0d38[_0x3212('0x3e')];if(!_0x410961[_0x3212('0x3b')][_0x3212('0x42')]('nolimit')){_0x1b19c1[_0x3212('0x2f')]=qs[_0x3212('0x2f')](_0x410961[_0x3212('0x3b')][_0x3212('0x2f')]);_0x1b19c1['offset']=qs[_0x3212('0x2e')](_0x410961[_0x3212('0x3b')][_0x3212('0x2e')]);}_0x1b19c1[_0x3212('0x43')]=qs['sort'](_0x410961[_0x3212('0x3b')]['sort']);_0x1b19c1[_0x3212('0x44')]=qs[_0x3212('0x3c')](_[_0x3212('0x45')](_0x410961[_0x3212('0x3b')],_0x4e0d38[_0x3212('0x3c')]));if(_0x410961[_0x3212('0x3b')][_0x3212('0x46')]){_0x1b19c1[_0x3212('0x44')]=_['merge'](_0x1b19c1[_0x3212('0x44')],{'$or':_[_0x3212('0x47')](_0x3f157c,function(_0x3e6dc1){if(_0x3e6dc1[_0x3212('0x48')][_0x3212('0x49')]!==_0x3212('0x4a')){var _0x6c5977={};_0x6c5977[_0x3e6dc1['field']]={'$like':'%'+_0x410961[_0x3212('0x3b')][_0x3212('0x46')]+'%'};return _0x6c5977;}})});}_0x1b19c1=_[_0x3212('0x4b')]({},_0x1b19c1,_0x410961[_0x3212('0x4c')]);var _0x4c77b7={'where':_0x1b19c1['where']};return db['SalesforceConfiguration']['count'](_0x4c77b7)[_0x3212('0x1f')](function(_0x5b1fc5){_0x421948[_0x3212('0x2d')]=_0x5b1fc5;if(_0x410961[_0x3212('0x3b')][_0x3212('0x4d')]){_0x1b19c1[_0x3212('0x4e')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x3212('0x4f')](_0x1b19c1);})[_0x3212('0x1f')](function(_0x75286f){_0x421948['rows']=_0x75286f;return _0x421948;})[_0x3212('0x1f')](respondWithFilteredResult(_0x40a602,_0x1b19c1))[_0x3212('0x29')](handleError(_0x40a602,null));};exports[_0x3212('0x50')]=function(_0x3421e0,_0x47d532){var _0x3ede8c={'raw':![],'where':{'id':_0x3421e0['params']['id']}},_0x13a42d={};_0x13a42d[_0x3212('0x3e')]=_[_0x3212('0x51')](db[_0x3212('0x39')]['rawAttributes']);_0x13a42d['query']=_[_0x3212('0x51')](_0x3421e0[_0x3212('0x3b')]);_0x13a42d[_0x3212('0x3c')]=_['intersection'](_0x13a42d[_0x3212('0x3e')],_0x13a42d[_0x3212('0x3b')]);_0x3ede8c['attributes']=_[_0x3212('0x3d')](_0x13a42d[_0x3212('0x3e')],qs[_0x3212('0x40')](_0x3421e0['query']['fields']));_0x3ede8c[_0x3212('0x3f')]=_0x3ede8c[_0x3212('0x3f')][_0x3212('0x41')]?_0x3ede8c[_0x3212('0x3f')]:_0x13a42d['model'];if(_0x3421e0[_0x3212('0x3b')][_0x3212('0x4d')]){_0x3ede8c[_0x3212('0x4e')]=[{'all':!![]}];}_0x3ede8c=_['merge']({},_0x3ede8c,_0x3421e0[_0x3212('0x4c')]);return db['SalesforceConfiguration'][_0x3212('0x52')](_0x3ede8c)[_0x3212('0x1f')](handleEntityNotFound(_0x47d532,null))[_0x3212('0x1f')](respondWithResult(_0x47d532,null))[_0x3212('0x29')](handleError(_0x47d532,null));};exports['create']=function(_0x2b486c,_0x346e4a){return db['SalesforceConfiguration'][_0x3212('0x53')](_0x2b486c[_0x3212('0x54')],{})[_0x3212('0x1f')](respondWithResult(_0x346e4a,0xc9))[_0x3212('0x29')](handleError(_0x346e4a,null));};exports[_0x3212('0x34')]=function(_0x1fa578,_0x3cf286){if(_0x1fa578['body']['id']){delete _0x1fa578[_0x3212('0x54')]['id'];}return db[_0x3212('0x39')][_0x3212('0x52')]({'where':{'id':_0x1fa578[_0x3212('0x55')]['id']}})['then'](handleEntityNotFound(_0x3cf286,null))['then'](saveUpdates(_0x1fa578['body'],null))['then'](respondWithResult(_0x3cf286,null))[_0x3212('0x29')](handleError(_0x3cf286,null));};exports['destroy']=function(_0x44742a,_0x1e5441){return db[_0x3212('0x39')][_0x3212('0x52')]({'where':{'id':_0x44742a[_0x3212('0x55')]['id']}})[_0x3212('0x1f')](handleEntityNotFound(_0x1e5441,null))[_0x3212('0x1f')](removeEntity(_0x1e5441,null))[_0x3212('0x29')](handleError(_0x1e5441,null));};exports[_0x3212('0x56')]=function(_0x2b0de2,_0x527177,_0x587fc2){var _0x51751b={};var _0x5a8158={};var _0x1f111a;var _0x291dc8;return db[_0x3212('0x39')][_0x3212('0x57')]({'where':{'id':_0x2b0de2[_0x3212('0x55')]['id']}})[_0x3212('0x1f')](handleEntityNotFound(_0x527177,null))['then'](function(_0x487033){if(_0x487033){_0x1f111a=_0x487033;_0x5a8158[_0x3212('0x3e')]=_[_0x3212('0x51')](db['SalesforceField']['rawAttributes']);_0x5a8158[_0x3212('0x3b')]=_[_0x3212('0x51')](_0x2b0de2['query']);_0x5a8158[_0x3212('0x3c')]=_[_0x3212('0x3d')](_0x5a8158[_0x3212('0x3e')],_0x5a8158[_0x3212('0x3b')]);_0x51751b[_0x3212('0x3f')]=_['intersection'](_0x5a8158[_0x3212('0x3e')],qs[_0x3212('0x40')](_0x2b0de2[_0x3212('0x3b')][_0x3212('0x40')]));_0x51751b['attributes']=_0x51751b[_0x3212('0x3f')][_0x3212('0x41')]?_0x51751b[_0x3212('0x3f')]:_0x5a8158['model'];_0x51751b[_0x3212('0x43')]=qs[_0x3212('0x58')](_0x2b0de2[_0x3212('0x3b')][_0x3212('0x58')]);_0x51751b['where']=qs[_0x3212('0x3c')](_[_0x3212('0x45')](_0x2b0de2[_0x3212('0x3b')],_0x5a8158[_0x3212('0x3c')]));if(_0x2b0de2['query'][_0x3212('0x46')]){_0x51751b[_0x3212('0x44')]=_[_0x3212('0x4b')](_0x51751b[_0x3212('0x44')],{'$or':_['map'](_0x51751b[_0x3212('0x3f')],function(_0x1fadef){var _0xdb3564={};_0xdb3564[_0x1fadef]={'$like':'%'+_0x2b0de2[_0x3212('0x3b')][_0x3212('0x46')]+'%'};return _0xdb3564;})});}_0x51751b=_[_0x3212('0x4b')]({},_0x51751b,_0x2b0de2[_0x3212('0x4c')]);return _0x1f111a[_0x3212('0x56')](_0x51751b);}})[_0x3212('0x1f')](function(_0x4af52d){if(_0x4af52d){_0x291dc8=_0x4af52d['length'];if(!_0x2b0de2[_0x3212('0x3b')][_0x3212('0x42')]('nolimit')){_0x51751b[_0x3212('0x2f')]=qs[_0x3212('0x2f')](_0x2b0de2[_0x3212('0x3b')][_0x3212('0x2f')]);_0x51751b['offset']=qs[_0x3212('0x2e')](_0x2b0de2[_0x3212('0x3b')][_0x3212('0x2e')]);}return _0x1f111a[_0x3212('0x56')](_0x51751b);}})[_0x3212('0x1f')](function(_0x3f92c1){if(_0x3f92c1){return _0x3f92c1?{'count':_0x291dc8,'rows':_0x3f92c1}:null;}})['then'](respondWithResult(_0x527177,null))[_0x3212('0x29')](handleError(_0x527177,null));};exports[_0x3212('0x59')]=function(_0x5177ea,_0x561a6e,_0xa2962b){var _0xfd4d70={};var _0x1dcb28={};var _0x449231;var _0x3efe79;return db['SalesforceConfiguration'][_0x3212('0x57')]({'where':{'id':_0x5177ea[_0x3212('0x55')]['id']}})['then'](handleEntityNotFound(_0x561a6e,null))[_0x3212('0x1f')](function(_0x41af6d){if(_0x41af6d){_0x449231=_0x41af6d;_0x1dcb28['model']=_[_0x3212('0x51')](db[_0x3212('0x5a')][_0x3212('0x3a')]);_0x1dcb28['query']=_[_0x3212('0x51')](_0x5177ea['query']);_0x1dcb28['filters']=_['intersection'](_0x1dcb28[_0x3212('0x3e')],_0x1dcb28['query']);_0xfd4d70[_0x3212('0x3f')]=_['intersection'](_0x1dcb28[_0x3212('0x3e')],qs[_0x3212('0x40')](_0x5177ea[_0x3212('0x3b')][_0x3212('0x40')]));_0xfd4d70[_0x3212('0x3f')]=_0xfd4d70['attributes'][_0x3212('0x41')]?_0xfd4d70[_0x3212('0x3f')]:_0x1dcb28[_0x3212('0x3e')];_0xfd4d70[_0x3212('0x43')]=qs[_0x3212('0x58')](_0x5177ea[_0x3212('0x3b')]['sort']);_0xfd4d70[_0x3212('0x44')]=qs[_0x3212('0x3c')](_[_0x3212('0x45')](_0x5177ea[_0x3212('0x3b')],_0x1dcb28[_0x3212('0x3c')]));if(_0x5177ea[_0x3212('0x3b')][_0x3212('0x46')]){_0xfd4d70[_0x3212('0x44')]=_[_0x3212('0x4b')](_0xfd4d70[_0x3212('0x44')],{'$or':_['map'](_0xfd4d70['attributes'],function(_0x10e970){var _0x301b41={};_0x301b41[_0x10e970]={'$like':'%'+_0x5177ea['query'][_0x3212('0x46')]+'%'};return _0x301b41;})});}_0xfd4d70=_['merge']({},_0xfd4d70,_0x5177ea['options']);return _0x449231['getSubjects'](_0xfd4d70);}})['then'](function(_0x4f70b2){if(_0x4f70b2){_0x3efe79=_0x4f70b2['length'];if(!_0x5177ea['query'][_0x3212('0x42')]('nolimit')){_0xfd4d70[_0x3212('0x2f')]=qs[_0x3212('0x2f')](_0x5177ea[_0x3212('0x3b')][_0x3212('0x2f')]);_0xfd4d70[_0x3212('0x2e')]=qs[_0x3212('0x2e')](_0x5177ea[_0x3212('0x3b')][_0x3212('0x2e')]);}return _0x449231[_0x3212('0x59')](_0xfd4d70);}})[_0x3212('0x1f')](function(_0x432994){if(_0x432994){return _0x432994?{'count':_0x3efe79,'rows':_0x432994}:null;}})[_0x3212('0x1f')](respondWithResult(_0x561a6e,null))[_0x3212('0x29')](handleError(_0x561a6e,null));};exports['getDescriptions']=function(_0x7110c1,_0x4c8dc8,_0x114d34){var _0x16c88b={};var _0x56b939={};var _0x5488aa;var _0x52062c;return db[_0x3212('0x39')]['findOne']({'where':{'id':_0x7110c1['params']['id']}})[_0x3212('0x1f')](handleEntityNotFound(_0x4c8dc8,null))[_0x3212('0x1f')](function(_0x1ccb95){if(_0x1ccb95){_0x5488aa=_0x1ccb95;_0x56b939[_0x3212('0x3e')]=_[_0x3212('0x51')](db[_0x3212('0x5a')]['rawAttributes']);_0x56b939['query']=_['keys'](_0x7110c1['query']);_0x56b939[_0x3212('0x3c')]=_[_0x3212('0x3d')](_0x56b939['model'],_0x56b939['query']);_0x16c88b['attributes']=_[_0x3212('0x3d')](_0x56b939['model'],qs[_0x3212('0x40')](_0x7110c1[_0x3212('0x3b')][_0x3212('0x40')]));_0x16c88b[_0x3212('0x3f')]=_0x16c88b[_0x3212('0x3f')][_0x3212('0x41')]?_0x16c88b[_0x3212('0x3f')]:_0x56b939[_0x3212('0x3e')];_0x16c88b['order']=qs[_0x3212('0x58')](_0x7110c1[_0x3212('0x3b')][_0x3212('0x58')]);_0x16c88b[_0x3212('0x44')]=qs[_0x3212('0x3c')](_['pick'](_0x7110c1[_0x3212('0x3b')],_0x56b939[_0x3212('0x3c')]));if(_0x7110c1['query'][_0x3212('0x46')]){_0x16c88b[_0x3212('0x44')]=_[_0x3212('0x4b')](_0x16c88b[_0x3212('0x44')],{'$or':_[_0x3212('0x47')](_0x16c88b[_0x3212('0x3f')],function(_0x984223){var _0x4f7357={};_0x4f7357[_0x984223]={'$like':'%'+_0x7110c1[_0x3212('0x3b')][_0x3212('0x46')]+'%'};return _0x4f7357;})});}_0x16c88b=_[_0x3212('0x4b')]({},_0x16c88b,_0x7110c1[_0x3212('0x4c')]);return _0x5488aa[_0x3212('0x5b')](_0x16c88b);}})[_0x3212('0x1f')](function(_0xa38d2f){if(_0xa38d2f){_0x52062c=_0xa38d2f[_0x3212('0x41')];if(!_0x7110c1[_0x3212('0x3b')][_0x3212('0x42')]('nolimit')){_0x16c88b[_0x3212('0x2f')]=qs[_0x3212('0x2f')](_0x7110c1['query']['limit']);_0x16c88b['offset']=qs[_0x3212('0x2e')](_0x7110c1['query'][_0x3212('0x2e')]);}return _0x5488aa['getDescriptions'](_0x16c88b);}})['then'](function(_0x1ae191){if(_0x1ae191){return _0x1ae191?{'count':_0x52062c,'rows':_0x1ae191}:null;}})['then'](respondWithResult(_0x4c8dc8,null))[_0x3212('0x29')](handleError(_0x4c8dc8,null));}; \ No newline at end of file +var _0x5c12=['offset','limit','set','Content-Range','apply','save','update','destroy','then','name','send','index','SalesforceConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','where','pick','filter','map','field','merge','options','count','includeAll','include','findAll','rows','show','params','fields','create','body','find','getFields','findOne','SalesforceField','sort','nolimit','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','client','http','info','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','sendStatus','end','status','json'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5c12,0x188));var _0x25c1=function(_0x5b3b9b,_0x1c71b0){_0x5b3b9b=_0x5b3b9b-0x0;var _0x47c1d7=_0x5c12[_0x5b3b9b];return _0x47c1d7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x25c1('0x0'));var rimraf=require(_0x25c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x25c1('0x2'));var rp=require(_0x25c1('0x3'));var moment=require(_0x25c1('0x4'));var BPromise=require(_0x25c1('0x5'));var Mustache=require(_0x25c1('0x6'));var util=require(_0x25c1('0x7'));var path=require(_0x25c1('0x8'));var sox=require('sox');var csv=require(_0x25c1('0x9'));var ejs=require(_0x25c1('0xa'));var fs=require('fs');var _=require(_0x25c1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x25c1('0xc'));var deskjs=require(_0x25c1('0xd'));var toCsv=require(_0x25c1('0x9'));var querystring=require(_0x25c1('0xe'));var Papa=require(_0x25c1('0xf'));var Redis=require('ioredis');var authService=require(_0x25c1('0x10'));var qs=require(_0x25c1('0x11'));var hardwareService=require(_0x25c1('0x12'));var logger=require(_0x25c1('0x13'))(_0x25c1('0x14'));var utils=require('../../config/utils');var config=require(_0x25c1('0x15'));var db=require(_0x25c1('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x17')][_0x25c1('0x18')]({'port':0x232a});function checkPasswordPattern(_0x323d3c,_0x329ba9,_0x5d3d11){if(_0x5d3d11){var _0x569ef9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x569ef9['test'](_0x329ba9)){return _0x323d3c;}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 _0x323d3c;}}function respondWithRpcPromise(_0x3ef429,_0x1412ed,_0x342cd4,_0x6eba15){return new BPromise(function(_0x17a032,_0x4ea926){var _0x4638f0=_0x6eba15||client;return _0x4638f0['request'](_0x3ef429,_0x342cd4)['then'](function(_0x5b852a){logger[_0x25c1('0x19')](_0x25c1('0x1a'),_0x1412ed,'request\x20sent');logger['debug'](_0x25c1('0x1b'),_0x1412ed,'request\x20sent',JSON[_0x25c1('0x1c')](_0x5b852a));if(_0x5b852a[_0x25c1('0x1d')]){if(_0x5b852a['error']['code']===0x1f4){logger['error'](_0x25c1('0x1a'),_0x1412ed,_0x5b852a[_0x25c1('0x1d')][_0x25c1('0x1e')]);return _0x4ea926(_0x5b852a[_0x25c1('0x1d')]['message']);}logger[_0x25c1('0x1d')](_0x25c1('0x1a'),_0x1412ed,_0x5b852a[_0x25c1('0x1d')][_0x25c1('0x1e')]);return _0x17a032(_0x5b852a['error']['message']);}else{logger[_0x25c1('0x19')](_0x25c1('0x1a'),_0x1412ed,_0x25c1('0x1f'));_0x17a032(_0x5b852a[_0x25c1('0x20')][_0x25c1('0x1e')]);}})[_0x25c1('0x21')](function(_0x2ba595){logger[_0x25c1('0x1d')](_0x25c1('0x1a'),_0x1412ed,_0x2ba595);_0x4ea926(_0x2ba595);});});}function respondWithStatusCode(_0x261604,_0x2f78dd){_0x2f78dd=_0x2f78dd||0xcc;return function(_0x284daa){if(_0x284daa){return _0x261604[_0x25c1('0x22')](_0x2f78dd);}return _0x261604['status'](_0x2f78dd)[_0x25c1('0x23')]();};}function respondWithResult(_0x20dbb9,_0x1b1c96){_0x1b1c96=_0x1b1c96||0xc8;return function(_0x1fb59f){if(_0x1fb59f){return _0x20dbb9[_0x25c1('0x24')](_0x1b1c96)[_0x25c1('0x25')](_0x1fb59f);}};}function respondWithFilteredResult(_0x5ad776,_0x17c924){return function(_0x428ce8){if(_0x428ce8){var _0x6cb14f=_0x428ce8['count'],_0x38c1d5=_0x17c924[_0x25c1('0x26')],_0x11c0ae=_0x17c924['offset']+_0x17c924[_0x25c1('0x27')],_0x193a68;if(_0x11c0ae>=_0x6cb14f){_0x11c0ae=_0x6cb14f;_0x193a68=0xc8;}else{_0x193a68=0xce;}_0x5ad776[_0x25c1('0x24')](_0x193a68);return _0x5ad776[_0x25c1('0x28')](_0x25c1('0x29'),_0x38c1d5+'-'+_0x11c0ae+'/'+_0x6cb14f)[_0x25c1('0x25')](_0x428ce8);}return null;};}function patchUpdates(_0x21069c){return function(_0x1fd4e3){try{jsonpatch[_0x25c1('0x2a')](_0x1fd4e3,_0x21069c,!![]);}catch(_0x402f32){return BPromise['reject'](_0x402f32);}return _0x1fd4e3[_0x25c1('0x2b')]();};}function saveUpdates(_0x47f959,_0x492715){return function(_0x3db0ee){if(_0x3db0ee){return _0x3db0ee[_0x25c1('0x2c')](_0x47f959)['then'](function(_0x173f3e){return _0x173f3e;});}return null;};}function removeEntity(_0x5a5a32,_0x3bfcff){return function(_0x4834b3){if(_0x4834b3){return _0x4834b3[_0x25c1('0x2d')]()[_0x25c1('0x2e')](function(){_0x5a5a32[_0x25c1('0x24')](0xcc)[_0x25c1('0x23')]();});}};}function handleEntityNotFound(_0x1d4afc,_0x2e81d4){return function(_0x461d23){if(!_0x461d23){_0x1d4afc[_0x25c1('0x22')](0x194);}return _0x461d23;};}function handleError(_0x578713,_0x20a273){_0x20a273=_0x20a273||0x1f4;return function(_0x55f368){logger[_0x25c1('0x1d')](_0x55f368['stack']);if(_0x55f368[_0x25c1('0x2f')]){delete _0x55f368[_0x25c1('0x2f')];}_0x578713[_0x25c1('0x24')](_0x20a273)[_0x25c1('0x30')](_0x55f368);};}exports[_0x25c1('0x31')]=function(_0x92184a,_0x35e632){var _0x2aa7b2={},_0x3fced1={},_0x2d060c={'count':0x0,'rows':[]};var _0x26ed98=db[_0x25c1('0x32')][_0x25c1('0x33')];_0x3fced1[_0x25c1('0x34')]=_[_0x25c1('0x35')](_0x26ed98);_0x3fced1[_0x25c1('0x36')]=_[_0x25c1('0x35')](_0x92184a[_0x25c1('0x36')]);_0x3fced1[_0x25c1('0x37')]=_[_0x25c1('0x38')](_0x3fced1['model'],_0x3fced1[_0x25c1('0x36')]);_0x2aa7b2[_0x25c1('0x39')]=_['intersection'](_0x3fced1[_0x25c1('0x34')],qs['fields'](_0x92184a[_0x25c1('0x36')]['fields']));_0x2aa7b2[_0x25c1('0x39')]=_0x2aa7b2[_0x25c1('0x39')][_0x25c1('0x3a')]?_0x2aa7b2[_0x25c1('0x39')]:_0x3fced1[_0x25c1('0x34')];if(!_0x92184a['query'][_0x25c1('0x3b')]('nolimit')){_0x2aa7b2[_0x25c1('0x27')]=qs[_0x25c1('0x27')](_0x92184a[_0x25c1('0x36')][_0x25c1('0x27')]);_0x2aa7b2['offset']=qs['offset'](_0x92184a['query'][_0x25c1('0x26')]);}_0x2aa7b2[_0x25c1('0x3c')]=qs['sort'](_0x92184a[_0x25c1('0x36')]['sort']);_0x2aa7b2[_0x25c1('0x3d')]=qs[_0x25c1('0x37')](_[_0x25c1('0x3e')](_0x92184a['query'],_0x3fced1['filters']));if(_0x92184a['query'][_0x25c1('0x3f')]){_0x2aa7b2[_0x25c1('0x3d')]=_['merge'](_0x2aa7b2[_0x25c1('0x3d')],{'$or':_[_0x25c1('0x40')](_0x26ed98,function(_0x46cbb9){if(_0x46cbb9['type']['key']!=='VIRTUAL'){var _0x506ab5={};_0x506ab5[_0x46cbb9[_0x25c1('0x41')]]={'$like':'%'+_0x92184a[_0x25c1('0x36')]['filter']+'%'};return _0x506ab5;}})});}_0x2aa7b2=_[_0x25c1('0x42')]({},_0x2aa7b2,_0x92184a[_0x25c1('0x43')]);var _0x1aaedd={'where':_0x2aa7b2[_0x25c1('0x3d')]};return db[_0x25c1('0x32')][_0x25c1('0x44')](_0x1aaedd)[_0x25c1('0x2e')](function(_0x552174){_0x2d060c['count']=_0x552174;if(_0x92184a[_0x25c1('0x36')][_0x25c1('0x45')]){_0x2aa7b2[_0x25c1('0x46')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x25c1('0x47')](_0x2aa7b2);})[_0x25c1('0x2e')](function(_0x2dc05b){_0x2d060c[_0x25c1('0x48')]=_0x2dc05b;return _0x2d060c;})['then'](respondWithFilteredResult(_0x35e632,_0x2aa7b2))[_0x25c1('0x21')](handleError(_0x35e632,null));};exports[_0x25c1('0x49')]=function(_0x277362,_0xfd0e50){var _0x5d2ecc={'raw':![],'where':{'id':_0x277362[_0x25c1('0x4a')]['id']}},_0x59e96b={};_0x59e96b[_0x25c1('0x34')]=_[_0x25c1('0x35')](db[_0x25c1('0x32')]['rawAttributes']);_0x59e96b[_0x25c1('0x36')]=_[_0x25c1('0x35')](_0x277362['query']);_0x59e96b[_0x25c1('0x37')]=_[_0x25c1('0x38')](_0x59e96b[_0x25c1('0x34')],_0x59e96b[_0x25c1('0x36')]);_0x5d2ecc['attributes']=_['intersection'](_0x59e96b[_0x25c1('0x34')],qs[_0x25c1('0x4b')](_0x277362[_0x25c1('0x36')]['fields']));_0x5d2ecc[_0x25c1('0x39')]=_0x5d2ecc[_0x25c1('0x39')]['length']?_0x5d2ecc[_0x25c1('0x39')]:_0x59e96b[_0x25c1('0x34')];if(_0x277362[_0x25c1('0x36')][_0x25c1('0x45')]){_0x5d2ecc[_0x25c1('0x46')]=[{'all':!![]}];}_0x5d2ecc=_[_0x25c1('0x42')]({},_0x5d2ecc,_0x277362[_0x25c1('0x43')]);return db['SalesforceConfiguration']['find'](_0x5d2ecc)['then'](handleEntityNotFound(_0xfd0e50,null))[_0x25c1('0x2e')](respondWithResult(_0xfd0e50,null))['catch'](handleError(_0xfd0e50,null));};exports[_0x25c1('0x4c')]=function(_0x2c67a8,_0x42fd6e){return db[_0x25c1('0x32')][_0x25c1('0x4c')](_0x2c67a8[_0x25c1('0x4d')],{})['then'](respondWithResult(_0x42fd6e,0xc9))[_0x25c1('0x21')](handleError(_0x42fd6e,null));};exports[_0x25c1('0x2c')]=function(_0x1942ae,_0x45e741){if(_0x1942ae[_0x25c1('0x4d')]['id']){delete _0x1942ae[_0x25c1('0x4d')]['id'];}return db['SalesforceConfiguration'][_0x25c1('0x4e')]({'where':{'id':_0x1942ae[_0x25c1('0x4a')]['id']}})[_0x25c1('0x2e')](handleEntityNotFound(_0x45e741,null))[_0x25c1('0x2e')](saveUpdates(_0x1942ae[_0x25c1('0x4d')],null))['then'](respondWithResult(_0x45e741,null))[_0x25c1('0x21')](handleError(_0x45e741,null));};exports[_0x25c1('0x2d')]=function(_0x49b192,_0x1341d2){return db[_0x25c1('0x32')][_0x25c1('0x4e')]({'where':{'id':_0x49b192[_0x25c1('0x4a')]['id']}})[_0x25c1('0x2e')](handleEntityNotFound(_0x1341d2,null))[_0x25c1('0x2e')](removeEntity(_0x1341d2,null))['catch'](handleError(_0x1341d2,null));};exports[_0x25c1('0x4f')]=function(_0x381804,_0x2760ef,_0xea5725){var _0x286800={};var _0x4052c1={};var _0x2745b6;var _0x5d54cd;return db[_0x25c1('0x32')][_0x25c1('0x50')]({'where':{'id':_0x381804[_0x25c1('0x4a')]['id']}})[_0x25c1('0x2e')](handleEntityNotFound(_0x2760ef,null))[_0x25c1('0x2e')](function(_0x11908c){if(_0x11908c){_0x2745b6=_0x11908c;_0x4052c1['model']=_[_0x25c1('0x35')](db[_0x25c1('0x51')][_0x25c1('0x33')]);_0x4052c1[_0x25c1('0x36')]=_[_0x25c1('0x35')](_0x381804[_0x25c1('0x36')]);_0x4052c1[_0x25c1('0x37')]=_['intersection'](_0x4052c1[_0x25c1('0x34')],_0x4052c1['query']);_0x286800[_0x25c1('0x39')]=_[_0x25c1('0x38')](_0x4052c1[_0x25c1('0x34')],qs[_0x25c1('0x4b')](_0x381804[_0x25c1('0x36')][_0x25c1('0x4b')]));_0x286800[_0x25c1('0x39')]=_0x286800[_0x25c1('0x39')]['length']?_0x286800[_0x25c1('0x39')]:_0x4052c1[_0x25c1('0x34')];_0x286800[_0x25c1('0x3c')]=qs[_0x25c1('0x52')](_0x381804[_0x25c1('0x36')][_0x25c1('0x52')]);_0x286800[_0x25c1('0x3d')]=qs['filters'](_[_0x25c1('0x3e')](_0x381804['query'],_0x4052c1['filters']));if(_0x381804['query'][_0x25c1('0x3f')]){_0x286800[_0x25c1('0x3d')]=_[_0x25c1('0x42')](_0x286800[_0x25c1('0x3d')],{'$or':_[_0x25c1('0x40')](_0x286800['attributes'],function(_0x11395b){var _0x58f1be={};_0x58f1be[_0x11395b]={'$like':'%'+_0x381804[_0x25c1('0x36')][_0x25c1('0x3f')]+'%'};return _0x58f1be;})});}_0x286800=_[_0x25c1('0x42')]({},_0x286800,_0x381804[_0x25c1('0x43')]);return _0x2745b6[_0x25c1('0x4f')](_0x286800);}})[_0x25c1('0x2e')](function(_0x11bdc4){if(_0x11bdc4){_0x5d54cd=_0x11bdc4['length'];if(!_0x381804[_0x25c1('0x36')][_0x25c1('0x3b')](_0x25c1('0x53'))){_0x286800[_0x25c1('0x27')]=qs[_0x25c1('0x27')](_0x381804[_0x25c1('0x36')]['limit']);_0x286800[_0x25c1('0x26')]=qs['offset'](_0x381804[_0x25c1('0x36')]['offset']);}return _0x2745b6['getFields'](_0x286800);}})[_0x25c1('0x2e')](function(_0x58fd37){if(_0x58fd37){return _0x58fd37?{'count':_0x5d54cd,'rows':_0x58fd37}:null;}})['then'](respondWithResult(_0x2760ef,null))['catch'](handleError(_0x2760ef,null));};exports['getSubjects']=function(_0x35ab88,_0x5244f9,_0x11aafa){var _0x17dd76={};var _0xf61bdd={};var _0x172e6c;var _0x4bc134;return db['SalesforceConfiguration'][_0x25c1('0x50')]({'where':{'id':_0x35ab88[_0x25c1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5244f9,null))[_0x25c1('0x2e')](function(_0x32125f){if(_0x32125f){_0x172e6c=_0x32125f;_0xf61bdd[_0x25c1('0x34')]=_['keys'](db[_0x25c1('0x51')]['rawAttributes']);_0xf61bdd[_0x25c1('0x36')]=_[_0x25c1('0x35')](_0x35ab88[_0x25c1('0x36')]);_0xf61bdd['filters']=_[_0x25c1('0x38')](_0xf61bdd[_0x25c1('0x34')],_0xf61bdd[_0x25c1('0x36')]);_0x17dd76['attributes']=_[_0x25c1('0x38')](_0xf61bdd[_0x25c1('0x34')],qs[_0x25c1('0x4b')](_0x35ab88[_0x25c1('0x36')][_0x25c1('0x4b')]));_0x17dd76[_0x25c1('0x39')]=_0x17dd76[_0x25c1('0x39')][_0x25c1('0x3a')]?_0x17dd76[_0x25c1('0x39')]:_0xf61bdd[_0x25c1('0x34')];_0x17dd76[_0x25c1('0x3c')]=qs[_0x25c1('0x52')](_0x35ab88[_0x25c1('0x36')][_0x25c1('0x52')]);_0x17dd76['where']=qs[_0x25c1('0x37')](_[_0x25c1('0x3e')](_0x35ab88[_0x25c1('0x36')],_0xf61bdd[_0x25c1('0x37')]));if(_0x35ab88[_0x25c1('0x36')][_0x25c1('0x3f')]){_0x17dd76[_0x25c1('0x3d')]=_[_0x25c1('0x42')](_0x17dd76[_0x25c1('0x3d')],{'$or':_[_0x25c1('0x40')](_0x17dd76[_0x25c1('0x39')],function(_0x5bd027){var _0x1a1a02={};_0x1a1a02[_0x5bd027]={'$like':'%'+_0x35ab88['query'][_0x25c1('0x3f')]+'%'};return _0x1a1a02;})});}_0x17dd76=_[_0x25c1('0x42')]({},_0x17dd76,_0x35ab88['options']);return _0x172e6c[_0x25c1('0x54')](_0x17dd76);}})[_0x25c1('0x2e')](function(_0x833e8f){if(_0x833e8f){_0x4bc134=_0x833e8f['length'];if(!_0x35ab88[_0x25c1('0x36')][_0x25c1('0x3b')]('nolimit')){_0x17dd76[_0x25c1('0x27')]=qs[_0x25c1('0x27')](_0x35ab88[_0x25c1('0x36')]['limit']);_0x17dd76[_0x25c1('0x26')]=qs[_0x25c1('0x26')](_0x35ab88[_0x25c1('0x36')][_0x25c1('0x26')]);}return _0x172e6c['getSubjects'](_0x17dd76);}})[_0x25c1('0x2e')](function(_0x4af326){if(_0x4af326){return _0x4af326?{'count':_0x4bc134,'rows':_0x4af326}:null;}})[_0x25c1('0x2e')](respondWithResult(_0x5244f9,null))[_0x25c1('0x21')](handleError(_0x5244f9,null));};exports['getDescriptions']=function(_0x41e5c5,_0x5f55c1,_0x3e14e6){var _0x20dc44={};var _0x397459={};var _0x43bcf4;var _0xfa5e05;return db[_0x25c1('0x32')][_0x25c1('0x50')]({'where':{'id':_0x41e5c5['params']['id']}})['then'](handleEntityNotFound(_0x5f55c1,null))[_0x25c1('0x2e')](function(_0x4334ef){if(_0x4334ef){_0x43bcf4=_0x4334ef;_0x397459['model']=_[_0x25c1('0x35')](db[_0x25c1('0x51')][_0x25c1('0x33')]);_0x397459['query']=_['keys'](_0x41e5c5[_0x25c1('0x36')]);_0x397459['filters']=_[_0x25c1('0x38')](_0x397459[_0x25c1('0x34')],_0x397459[_0x25c1('0x36')]);_0x20dc44[_0x25c1('0x39')]=_['intersection'](_0x397459['model'],qs[_0x25c1('0x4b')](_0x41e5c5['query'][_0x25c1('0x4b')]));_0x20dc44[_0x25c1('0x39')]=_0x20dc44[_0x25c1('0x39')]['length']?_0x20dc44[_0x25c1('0x39')]:_0x397459[_0x25c1('0x34')];_0x20dc44[_0x25c1('0x3c')]=qs[_0x25c1('0x52')](_0x41e5c5[_0x25c1('0x36')][_0x25c1('0x52')]);_0x20dc44[_0x25c1('0x3d')]=qs[_0x25c1('0x37')](_[_0x25c1('0x3e')](_0x41e5c5[_0x25c1('0x36')],_0x397459[_0x25c1('0x37')]));if(_0x41e5c5['query'][_0x25c1('0x3f')]){_0x20dc44['where']=_[_0x25c1('0x42')](_0x20dc44[_0x25c1('0x3d')],{'$or':_[_0x25c1('0x40')](_0x20dc44[_0x25c1('0x39')],function(_0x1c0859){var _0x2ffe14={};_0x2ffe14[_0x1c0859]={'$like':'%'+_0x41e5c5[_0x25c1('0x36')]['filter']+'%'};return _0x2ffe14;})});}_0x20dc44=_['merge']({},_0x20dc44,_0x41e5c5[_0x25c1('0x43')]);return _0x43bcf4['getDescriptions'](_0x20dc44);}})['then'](function(_0x8f9412){if(_0x8f9412){_0xfa5e05=_0x8f9412[_0x25c1('0x3a')];if(!_0x41e5c5[_0x25c1('0x36')][_0x25c1('0x3b')](_0x25c1('0x53'))){_0x20dc44[_0x25c1('0x27')]=qs['limit'](_0x41e5c5[_0x25c1('0x36')][_0x25c1('0x27')]);_0x20dc44[_0x25c1('0x26')]=qs[_0x25c1('0x26')](_0x41e5c5['query'][_0x25c1('0x26')]);}return _0x43bcf4[_0x25c1('0x55')](_0x20dc44);}})[_0x25c1('0x2e')](function(_0x62488){if(_0x62488){return _0x62488?{'count':_0xfa5e05,'rows':_0x62488}:null;}})['then'](respondWithResult(_0x5f55c1,null))[_0x25c1('0x21')](handleError(_0x5f55c1,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 4f19d61..6aefff8 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 _0x7467=['api','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','lodash','util'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x7467,0x8e));var _0x7746=function(_0x35a2de,_0x329ff0){_0x35a2de=_0x35a2de-0x0;var _0x14c8ea=_0x7467[_0x35a2de];return _0x14c8ea;};'use strict';var _=require(_0x7746('0x0'));var util=require(_0x7746('0x1'));var logger=require('../../config/logger')(_0x7746('0x2'));var moment=require(_0x7746('0x3'));var BPromise=require(_0x7746('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7746('0x5'));var rimraf=require(_0x7746('0x6'));var config=require(_0x7746('0x7'));var attributes=require(_0x7746('0x8'));module[_0x7746('0x9')]=function(_0x5e49fa,_0x4178e4){return _0x5e49fa[_0x7746('0xa')]('SalesforceConfiguration',attributes,{'tableName':_0x7746('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68ea=['path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0x68ea,0x1ce));var _0xa68e=function(_0x20734f,_0x2bcce2){_0x20734f=_0x20734f-0x0;var _0x56aa79=_0x68ea[_0x20734f];return _0x56aa79;};'use strict';var _=require(_0xa68e('0x0'));var util=require('util');var logger=require(_0xa68e('0x1'))(_0xa68e('0x2'));var moment=require(_0xa68e('0x3'));var BPromise=require(_0xa68e('0x4'));var rp=require(_0xa68e('0x5'));var fs=require('fs');var path=require(_0xa68e('0x6'));var rimraf=require(_0xa68e('0x7'));var config=require(_0xa68e('0x8'));var attributes=require(_0xa68e('0x9'));module[_0xa68e('0xa')]=function(_0x276bfa,_0x5cb5bc){return _0x276bfa['define'](_0xa68e('0xb'),attributes,{'tableName':_0xa68e('0xc'),'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 4cfebc6..cb07c57 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 _0x2b96=['request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x2b96,0x17c));var _0x62b9=function(_0x9489b8,_0x5293b3){_0x9489b8=_0x9489b8-0x0;var _0x372964=_0x2b96[_0x9489b8];return _0x372964;};'use strict';var _=require(_0x62b9('0x0'));var util=require(_0x62b9('0x1'));var moment=require(_0x62b9('0x2'));var BPromise=require('bluebird');var rs=require(_0x62b9('0x3'));var fs=require('fs');var Redis=require(_0x62b9('0x4'));var db=require(_0x62b9('0x5'))['db'];var utils=require(_0x62b9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x62b9('0x7'));var jayson=require(_0x62b9('0x8'));var client=jayson[_0x62b9('0x9')][_0x62b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33070b,_0x3d8567,_0xd29ab4){return new BPromise(function(_0x1e3b80,_0x5622f7){return client[_0x62b9('0xb')](_0x33070b,_0xd29ab4)[_0x62b9('0xc')](function(_0x54f0bb){logger[_0x62b9('0xd')](_0x62b9('0xe'),_0x3d8567,_0x62b9('0xf'));logger[_0x62b9('0x10')](_0x62b9('0x11'),_0x3d8567,_0x62b9('0xf'),JSON[_0x62b9('0x12')](_0x54f0bb));if(_0x54f0bb[_0x62b9('0x13')]){if(_0x54f0bb[_0x62b9('0x13')][_0x62b9('0x14')]===0x1f4){logger[_0x62b9('0x13')](_0x62b9('0xe'),_0x3d8567,_0x54f0bb[_0x62b9('0x13')][_0x62b9('0x15')]);return _0x5622f7(_0x54f0bb[_0x62b9('0x13')]['message']);}logger[_0x62b9('0x13')](_0x62b9('0xe'),_0x3d8567,_0x54f0bb[_0x62b9('0x13')][_0x62b9('0x15')]);return _0x1e3b80(_0x54f0bb[_0x62b9('0x13')]['message']);}else{logger[_0x62b9('0xd')](_0x62b9('0xe'),_0x3d8567,_0x62b9('0xf'));_0x1e3b80(_0x54f0bb[_0x62b9('0x16')][_0x62b9('0x15')]);}})['catch'](function(_0x44e4c1){logger[_0x62b9('0x13')](_0x62b9('0xe'),_0x3d8567,_0x44e4c1);_0x5622f7(_0x44e4c1);});});} \ No newline at end of file +var _0x2d99=['client','http','request','then','info','request\x20sent','error','message','SalesforceConfiguration,\x20%s,\x20%s','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1e288b,_0x268810){var _0x3adbb9=function(_0x4b7981){while(--_0x4b7981){_0x1e288b['push'](_0x1e288b['shift']());}};_0x3adbb9(++_0x268810);}(_0x2d99,0x186));var _0x92d9=function(_0x3c82ba,_0x3d61ba){_0x3c82ba=_0x3c82ba-0x0;var _0x54ae9d=_0x2d99[_0x3c82ba];return _0x54ae9d;};'use strict';var _=require('lodash');var util=require(_0x92d9('0x0'));var moment=require(_0x92d9('0x1'));var BPromise=require(_0x92d9('0x2'));var rs=require(_0x92d9('0x3'));var fs=require('fs');var Redis=require(_0x92d9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x92d9('0x5'));var logger=require(_0x92d9('0x6'))(_0x92d9('0x7'));var config=require(_0x92d9('0x8'));var jayson=require(_0x92d9('0x9'));var client=jayson[_0x92d9('0xa')][_0x92d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46cb0d,_0x17e174,_0x5a8bcc){return new BPromise(function(_0x4fe533,_0x16defb){return client[_0x92d9('0xc')](_0x46cb0d,_0x5a8bcc)[_0x92d9('0xd')](function(_0x590e13){logger[_0x92d9('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x17e174,_0x92d9('0xf'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x17e174,_0x92d9('0xf'),JSON['stringify'](_0x590e13));if(_0x590e13[_0x92d9('0x10')]){if(_0x590e13['error']['code']===0x1f4){logger[_0x92d9('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x17e174,_0x590e13[_0x92d9('0x10')][_0x92d9('0x11')]);return _0x16defb(_0x590e13[_0x92d9('0x10')]['message']);}logger[_0x92d9('0x10')](_0x92d9('0x12'),_0x17e174,_0x590e13[_0x92d9('0x10')]['message']);return _0x4fe533(_0x590e13[_0x92d9('0x10')]['message']);}else{logger[_0x92d9('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x17e174,_0x92d9('0xf'));_0x4fe533(_0x590e13['result'][_0x92d9('0x11')]);}})[_0x92d9('0x13')](function(_0x2ad0b0){logger[_0x92d9('0x10')](_0x92d9('0x12'),_0x17e174,_0x2ad0b0);_0x16defb(_0x2ad0b0);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 705a5cc..216eec5 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 _0x71ab=['isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get'];(function(_0x3c1d68,_0x44cce2){var _0x19c5aa=function(_0x154be0){while(--_0x154be0){_0x3c1d68['push'](_0x3c1d68['shift']());}};_0x19c5aa(++_0x44cce2);}(_0x71ab,0x64));var _0xb71a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x71ab[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var auth=require(_0xb71a('0x3'));var interaction=require(_0xb71a('0x4'));var config=require(_0xb71a('0x5'));var controller=require(_0xb71a('0x6'));router[_0xb71a('0x7')]('/',auth[_0xb71a('0x8')](),controller[_0xb71a('0x9')]);router[_0xb71a('0x7')](_0xb71a('0xa'),auth[_0xb71a('0x8')](),controller[_0xb71a('0xb')]);router[_0xb71a('0xc')]('/',auth[_0xb71a('0x8')](),controller[_0xb71a('0xd')]);router[_0xb71a('0xe')](_0xb71a('0xa'),auth[_0xb71a('0x8')](),controller['update']);router[_0xb71a('0xf')]('/:id',auth[_0xb71a('0x8')](),controller[_0xb71a('0x10')]);module[_0xb71a('0x11')]=router; \ No newline at end of file +var _0x4745=['../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x332251,_0x3c134f){var _0x592e7d=function(_0x5bc27d){while(--_0x5bc27d){_0x332251['push'](_0x332251['shift']());}};_0x592e7d(++_0x3c134f);}(_0x4745,0x1e7));var _0x5474=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x4745[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var path=require(_0x5474('0x2'));var timeout=require(_0x5474('0x3'));var express=require(_0x5474('0x4'));var router=express[_0x5474('0x5')]();var auth=require(_0x5474('0x6'));var interaction=require(_0x5474('0x7'));var config=require(_0x5474('0x8'));var controller=require(_0x5474('0x9'));router[_0x5474('0xa')]('/',auth[_0x5474('0xb')](),controller['index']);router[_0x5474('0xa')](_0x5474('0xc'),auth['isAuthenticated'](),controller[_0x5474('0xd')]);router['post']('/',auth[_0x5474('0xb')](),controller[_0x5474('0xe')]);router['put'](_0x5474('0xc'),auth[_0x5474('0xb')](),controller[_0x5474('0xf')]);router[_0x5474('0x10')](_0x5474('0xc'),auth[_0x5474('0xb')](),controller[_0x5474('0x11')]);module[_0x5474('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index e6fdeea..d854817 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 _0xd997=['exports','string','customVariable','keyValue','STRING','ENUM','variable'];(function(_0x13be06,_0xe98ea8){var _0x88ebc8=function(_0x52c90a){while(--_0x52c90a){_0x13be06['push'](_0x13be06['shift']());}};_0x88ebc8(++_0xe98ea8);}(_0xd997,0x17a));var _0x7d99=function(_0x4bb9b9,_0x107234){_0x4bb9b9=_0x4bb9b9-0x0;var _0x5bad8f=_0xd997[_0x4bb9b9];return _0x5bad8f;};'use strict';var Sequelize=require('sequelize');module[_0x7d99('0x0')]={'type':{'type':Sequelize['ENUM'](_0x7d99('0x1'),'variable',_0x7d99('0x2'),_0x7d99('0x3')),'defaultValue':_0x7d99('0x1')},'content':{'type':Sequelize[_0x7d99('0x4')]},'key':{'type':Sequelize[_0x7d99('0x4')]},'keyType':{'type':Sequelize[_0x7d99('0x5')]('string',_0x7d99('0x6'),_0x7d99('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7d99('0x4')]},'variableName':{'type':Sequelize[_0x7d99('0x4')]}}; \ No newline at end of file +var _0xfbd2=['customVariable','keyValue','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xfbd2,0x73));var _0x2fbd=function(_0xba8b24,_0x465e4b){_0xba8b24=_0xba8b24-0x0;var _0x28744a=_0xfbd2[_0xba8b24];return _0x28744a;};'use strict';var Sequelize=require(_0x2fbd('0x0'));module[_0x2fbd('0x1')]={'type':{'type':Sequelize[_0x2fbd('0x2')](_0x2fbd('0x3'),_0x2fbd('0x4'),_0x2fbd('0x5'),_0x2fbd('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2fbd('0x7')]},'key':{'type':Sequelize[_0x2fbd('0x7')]},'keyType':{'type':Sequelize[_0x2fbd('0x2')]('string',_0x2fbd('0x4'),_0x2fbd('0x5'))},'keyContent':{'type':Sequelize[_0x2fbd('0x7')]},'idField':{'type':Sequelize[_0x2fbd('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 1070c28..ba6d845 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 _0x1c1b=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','Content-Range','save','update','then','destroy','error','stack','name','send','SalesforceField','rawAttributes','keys','filters','intersection','model','fields','attributes','query','hasOwnProperty','nolimit','sort','where','pick','merge','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','params','length','find','create','body','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','sox','ejs','crypto','jsforce','desk.js','to-csv'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x1c1b,0x18b));var _0xb1c1=function(_0x2bcfaa,_0x12aa65){_0x2bcfaa=_0x2bcfaa-0x0;var _0xb5174=_0x1c1b[_0x2bcfaa];return _0xb5174;};'use strict';var pdf=require(_0xb1c1('0x0'));var emlformat=require(_0xb1c1('0x1'));var rimraf=require(_0xb1c1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb1c1('0x3'));var moment=require(_0xb1c1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb1c1('0x5'));var util=require(_0xb1c1('0x6'));var path=require('path');var sox=require(_0xb1c1('0x7'));var csv=require('to-csv');var ejs=require(_0xb1c1('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb1c1('0x9'));var jsforce=require(_0xb1c1('0xa'));var deskjs=require(_0xb1c1('0xb'));var toCsv=require(_0xb1c1('0xc'));var querystring=require(_0xb1c1('0xd'));var Papa=require(_0xb1c1('0xe'));var Redis=require(_0xb1c1('0xf'));var authService=require(_0xb1c1('0x10'));var qs=require(_0xb1c1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb1c1('0x12'))(_0xb1c1('0x13'));var utils=require(_0xb1c1('0x14'));var config=require(_0xb1c1('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4114ef,_0x2e6521){_0x2e6521=_0x2e6521||0xcc;return function(_0x59a7a3){if(_0x59a7a3){return _0x4114ef[_0xb1c1('0x16')](_0x2e6521);}return _0x4114ef[_0xb1c1('0x17')](_0x2e6521)[_0xb1c1('0x18')]();};}function respondWithResult(_0x3f4e99,_0x1b3896){_0x1b3896=_0x1b3896||0xc8;return function(_0x25dfbc){if(_0x25dfbc){return _0x3f4e99[_0xb1c1('0x17')](_0x1b3896)[_0xb1c1('0x19')](_0x25dfbc);}};}function respondWithFilteredResult(_0x2c2468,_0x4849bf){return function(_0x4fa9ef){if(_0x4fa9ef){var _0x30883e=_0x4fa9ef['count'],_0x44bf8f=_0x4849bf[_0xb1c1('0x1a')],_0x313b3b=_0x4849bf[_0xb1c1('0x1a')]+_0x4849bf[_0xb1c1('0x1b')],_0x3bf28a;if(_0x313b3b>=_0x30883e){_0x313b3b=_0x30883e;_0x3bf28a=0xc8;}else{_0x3bf28a=0xce;}_0x2c2468[_0xb1c1('0x17')](_0x3bf28a);return _0x2c2468['set'](_0xb1c1('0x1c'),_0x44bf8f+'-'+_0x313b3b+'/'+_0x30883e)[_0xb1c1('0x19')](_0x4fa9ef);}return null;};}function patchUpdates(_0x5541a0){return function(_0x91137c){try{jsonpatch['apply'](_0x91137c,_0x5541a0,!![]);}catch(_0x16af19){return BPromise['reject'](_0x16af19);}return _0x91137c[_0xb1c1('0x1d')]();};}function saveUpdates(_0x304a5a,_0x9a273a){return function(_0x285c06){if(_0x285c06){return _0x285c06[_0xb1c1('0x1e')](_0x304a5a)[_0xb1c1('0x1f')](function(_0x5c5e05){return _0x5c5e05;});}return null;};}function removeEntity(_0x4224d7,_0xda7c8a){return function(_0x1b48ce){if(_0x1b48ce){return _0x1b48ce[_0xb1c1('0x20')]()[_0xb1c1('0x1f')](function(){_0x4224d7[_0xb1c1('0x17')](0xcc)[_0xb1c1('0x18')]();});}};}function handleEntityNotFound(_0xe53a3d,_0x83d6e6){return function(_0x1abfc6){if(!_0x1abfc6){_0xe53a3d['sendStatus'](0x194);}return _0x1abfc6;};}function handleError(_0x34284b,_0x3f73a9){_0x3f73a9=_0x3f73a9||0x1f4;return function(_0x547c1c){logger[_0xb1c1('0x21')](_0x547c1c[_0xb1c1('0x22')]);if(_0x547c1c[_0xb1c1('0x23')]){delete _0x547c1c[_0xb1c1('0x23')];}_0x34284b[_0xb1c1('0x17')](_0x3f73a9)[_0xb1c1('0x24')](_0x547c1c);};}exports['index']=function(_0x4a4c9c,_0x3cbbde){var _0x2f89b7={},_0x2219ed={},_0x1765d9={'count':0x0,'rows':[]};var _0x1fe80a=db[_0xb1c1('0x25')][_0xb1c1('0x26')];_0x2219ed['model']=_[_0xb1c1('0x27')](_0x1fe80a);_0x2219ed['query']=_[_0xb1c1('0x27')](_0x4a4c9c['query']);_0x2219ed[_0xb1c1('0x28')]=_[_0xb1c1('0x29')](_0x2219ed['model'],_0x2219ed['query']);_0x2f89b7['attributes']=_[_0xb1c1('0x29')](_0x2219ed[_0xb1c1('0x2a')],qs['fields'](_0x4a4c9c['query'][_0xb1c1('0x2b')]));_0x2f89b7[_0xb1c1('0x2c')]=_0x2f89b7['attributes']['length']?_0x2f89b7['attributes']:_0x2219ed[_0xb1c1('0x2a')];if(!_0x4a4c9c[_0xb1c1('0x2d')][_0xb1c1('0x2e')](_0xb1c1('0x2f'))){_0x2f89b7[_0xb1c1('0x1b')]=qs[_0xb1c1('0x1b')](_0x4a4c9c['query'][_0xb1c1('0x1b')]);_0x2f89b7['offset']=qs[_0xb1c1('0x1a')](_0x4a4c9c[_0xb1c1('0x2d')][_0xb1c1('0x1a')]);}_0x2f89b7['order']=qs[_0xb1c1('0x30')](_0x4a4c9c[_0xb1c1('0x2d')][_0xb1c1('0x30')]);_0x2f89b7[_0xb1c1('0x31')]=qs['filters'](_[_0xb1c1('0x32')](_0x4a4c9c['query'],_0x2219ed[_0xb1c1('0x28')]));if(_0x4a4c9c[_0xb1c1('0x2d')]['filter']){_0x2f89b7[_0xb1c1('0x31')]=_[_0xb1c1('0x33')](_0x2f89b7[_0xb1c1('0x31')],{'$or':_['map'](_0x1fe80a,function(_0x3a6463){if(_0x3a6463[_0xb1c1('0x34')][_0xb1c1('0x35')]!==_0xb1c1('0x36')){var _0x21662e={};_0x21662e[_0x3a6463[_0xb1c1('0x37')]]={'$like':'%'+_0x4a4c9c['query']['filter']+'%'};return _0x21662e;}})});}_0x2f89b7=_[_0xb1c1('0x33')]({},_0x2f89b7,_0x4a4c9c[_0xb1c1('0x38')]);var _0x25245d={'where':_0x2f89b7[_0xb1c1('0x31')]};return db[_0xb1c1('0x25')][_0xb1c1('0x39')](_0x25245d)[_0xb1c1('0x1f')](function(_0x1b3ccc){_0x1765d9[_0xb1c1('0x39')]=_0x1b3ccc;if(_0x4a4c9c[_0xb1c1('0x2d')][_0xb1c1('0x3a')]){_0x2f89b7[_0xb1c1('0x3b')]=[{'all':!![]}];}return db[_0xb1c1('0x25')][_0xb1c1('0x3c')](_0x2f89b7);})[_0xb1c1('0x1f')](function(_0x193837){_0x1765d9[_0xb1c1('0x3d')]=_0x193837;return _0x1765d9;})[_0xb1c1('0x1f')](respondWithFilteredResult(_0x3cbbde,_0x2f89b7))[_0xb1c1('0x3e')](handleError(_0x3cbbde,null));};exports['show']=function(_0x53a024,_0x16c967){var _0x39ee50={'raw':!![],'where':{'id':_0x53a024[_0xb1c1('0x3f')]['id']}},_0x44c899={};_0x44c899[_0xb1c1('0x2a')]=_[_0xb1c1('0x27')](db[_0xb1c1('0x25')][_0xb1c1('0x26')]);_0x44c899['query']=_[_0xb1c1('0x27')](_0x53a024[_0xb1c1('0x2d')]);_0x44c899[_0xb1c1('0x28')]=_['intersection'](_0x44c899['model'],_0x44c899[_0xb1c1('0x2d')]);_0x39ee50[_0xb1c1('0x2c')]=_[_0xb1c1('0x29')](_0x44c899[_0xb1c1('0x2a')],qs[_0xb1c1('0x2b')](_0x53a024[_0xb1c1('0x2d')][_0xb1c1('0x2b')]));_0x39ee50[_0xb1c1('0x2c')]=_0x39ee50[_0xb1c1('0x2c')][_0xb1c1('0x40')]?_0x39ee50[_0xb1c1('0x2c')]:_0x44c899[_0xb1c1('0x2a')];if(_0x53a024['query'][_0xb1c1('0x3a')]){_0x39ee50[_0xb1c1('0x3b')]=[{'all':!![]}];}_0x39ee50=_[_0xb1c1('0x33')]({},_0x39ee50,_0x53a024[_0xb1c1('0x38')]);return db[_0xb1c1('0x25')][_0xb1c1('0x41')](_0x39ee50)[_0xb1c1('0x1f')](handleEntityNotFound(_0x16c967,null))[_0xb1c1('0x1f')](respondWithResult(_0x16c967,null))[_0xb1c1('0x3e')](handleError(_0x16c967,null));};exports[_0xb1c1('0x42')]=function(_0xb970ee,_0x3c8429){return db[_0xb1c1('0x25')][_0xb1c1('0x42')](_0xb970ee['body'],{})['then'](respondWithResult(_0x3c8429,0xc9))[_0xb1c1('0x3e')](handleError(_0x3c8429,null));};exports[_0xb1c1('0x1e')]=function(_0x22e6bd,_0x5c5cca){if(_0x22e6bd['body']['id']){delete _0x22e6bd[_0xb1c1('0x43')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x22e6bd[_0xb1c1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5c5cca,null))[_0xb1c1('0x1f')](saveUpdates(_0x22e6bd['body'],null))[_0xb1c1('0x1f')](respondWithResult(_0x5c5cca,null))[_0xb1c1('0x3e')](handleError(_0x5c5cca,null));};exports['destroy']=function(_0x438295,_0x4d9b1a){return db[_0xb1c1('0x25')][_0xb1c1('0x41')]({'where':{'id':_0x438295[_0xb1c1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4d9b1a,null))[_0xb1c1('0x1f')](removeEntity(_0x4d9b1a,null))['catch'](handleError(_0x4d9b1a,null));}; \ No newline at end of file +var _0x7f1b=['moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','apply','save','update','then','stack','name','send','SalesforceField','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','map','key','VIRTUAL','field','merge','options','include','findAll','rows','catch','show','params','includeAll','create','body','find','html-pdf','eml-format','zip-dir','fast-json-patch'];(function(_0x4d66ff,_0x57cb23){var _0x5c513f=function(_0x2adb20){while(--_0x2adb20){_0x4d66ff['push'](_0x4d66ff['shift']());}};_0x5c513f(++_0x57cb23);}(_0x7f1b,0xd4));var _0xb7f1=function(_0x26fe8e,_0x2cefe4){_0x26fe8e=_0x26fe8e-0x0;var _0x82b89e=_0x7f1b[_0x26fe8e];return _0x82b89e;};'use strict';var pdf=require(_0xb7f1('0x0'));var emlformat=require(_0xb7f1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb7f1('0x2'));var jsonpatch=require(_0xb7f1('0x3'));var rp=require('request-promise');var moment=require(_0xb7f1('0x4'));var BPromise=require(_0xb7f1('0x5'));var Mustache=require('mustache');var util=require(_0xb7f1('0x6'));var path=require(_0xb7f1('0x7'));var sox=require('sox');var csv=require(_0xb7f1('0x8'));var ejs=require(_0xb7f1('0x9'));var fs=require('fs');var _=require(_0xb7f1('0xa'));var squel=require(_0xb7f1('0xb'));var crypto=require(_0xb7f1('0xc'));var jsforce=require(_0xb7f1('0xd'));var deskjs=require(_0xb7f1('0xe'));var toCsv=require(_0xb7f1('0x8'));var querystring=require(_0xb7f1('0xf'));var Papa=require(_0xb7f1('0x10'));var Redis=require('ioredis');var authService=require(_0xb7f1('0x11'));var qs=require(_0xb7f1('0x12'));var hardwareService=require(_0xb7f1('0x13'));var logger=require(_0xb7f1('0x14'))('api');var utils=require(_0xb7f1('0x15'));var config=require(_0xb7f1('0x16'));var db=require(_0xb7f1('0x17'))['db'];function respondWithStatusCode(_0x1e7888,_0x342294){_0x342294=_0x342294||0xcc;return function(_0x51867b){if(_0x51867b){return _0x1e7888[_0xb7f1('0x18')](_0x342294);}return _0x1e7888['status'](_0x342294)[_0xb7f1('0x19')]();};}function respondWithResult(_0x48fb28,_0x514c1c){_0x514c1c=_0x514c1c||0xc8;return function(_0x18747f){if(_0x18747f){return _0x48fb28[_0xb7f1('0x1a')](_0x514c1c)[_0xb7f1('0x1b')](_0x18747f);}};}function respondWithFilteredResult(_0x4ce404,_0x4c7743){return function(_0x91315b){if(_0x91315b){var _0x44db65=_0x91315b[_0xb7f1('0x1c')],_0x3533b8=_0x4c7743[_0xb7f1('0x1d')],_0x2ba091=_0x4c7743[_0xb7f1('0x1d')]+_0x4c7743['limit'],_0xdc3bd3;if(_0x2ba091>=_0x44db65){_0x2ba091=_0x44db65;_0xdc3bd3=0xc8;}else{_0xdc3bd3=0xce;}_0x4ce404[_0xb7f1('0x1a')](_0xdc3bd3);return _0x4ce404[_0xb7f1('0x1e')]('Content-Range',_0x3533b8+'-'+_0x2ba091+'/'+_0x44db65)[_0xb7f1('0x1b')](_0x91315b);}return null;};}function patchUpdates(_0x201c66){return function(_0x580624){try{jsonpatch[_0xb7f1('0x1f')](_0x580624,_0x201c66,!![]);}catch(_0x818239){return BPromise['reject'](_0x818239);}return _0x580624[_0xb7f1('0x20')]();};}function saveUpdates(_0x5a8291,_0x40a19e){return function(_0x277948){if(_0x277948){return _0x277948[_0xb7f1('0x21')](_0x5a8291)[_0xb7f1('0x22')](function(_0xe870a7){return _0xe870a7;});}return null;};}function removeEntity(_0x195f78,_0xe20701){return function(_0x3e7a00){if(_0x3e7a00){return _0x3e7a00['destroy']()[_0xb7f1('0x22')](function(){_0x195f78['status'](0xcc)[_0xb7f1('0x19')]();});}};}function handleEntityNotFound(_0x19cb18,_0xb715f2){return function(_0x44b8cf){if(!_0x44b8cf){_0x19cb18[_0xb7f1('0x18')](0x194);}return _0x44b8cf;};}function handleError(_0x54c11c,_0x1b83e3){_0x1b83e3=_0x1b83e3||0x1f4;return function(_0x264c89){logger['error'](_0x264c89[_0xb7f1('0x23')]);if(_0x264c89['name']){delete _0x264c89[_0xb7f1('0x24')];}_0x54c11c[_0xb7f1('0x1a')](_0x1b83e3)[_0xb7f1('0x25')](_0x264c89);};}exports['index']=function(_0x4c7b28,_0x308d72){var _0x1c6ad4={},_0x529ed7={},_0x1a4c63={'count':0x0,'rows':[]};var _0x5efe72=db[_0xb7f1('0x26')][_0xb7f1('0x27')];_0x529ed7[_0xb7f1('0x28')]=_[_0xb7f1('0x29')](_0x5efe72);_0x529ed7['query']=_[_0xb7f1('0x29')](_0x4c7b28[_0xb7f1('0x2a')]);_0x529ed7['filters']=_['intersection'](_0x529ed7[_0xb7f1('0x28')],_0x529ed7[_0xb7f1('0x2a')]);_0x1c6ad4[_0xb7f1('0x2b')]=_[_0xb7f1('0x2c')](_0x529ed7[_0xb7f1('0x28')],qs['fields'](_0x4c7b28[_0xb7f1('0x2a')][_0xb7f1('0x2d')]));_0x1c6ad4[_0xb7f1('0x2b')]=_0x1c6ad4['attributes'][_0xb7f1('0x2e')]?_0x1c6ad4[_0xb7f1('0x2b')]:_0x529ed7[_0xb7f1('0x28')];if(!_0x4c7b28[_0xb7f1('0x2a')][_0xb7f1('0x2f')](_0xb7f1('0x30'))){_0x1c6ad4[_0xb7f1('0x31')]=qs[_0xb7f1('0x31')](_0x4c7b28[_0xb7f1('0x2a')][_0xb7f1('0x31')]);_0x1c6ad4['offset']=qs['offset'](_0x4c7b28[_0xb7f1('0x2a')][_0xb7f1('0x1d')]);}_0x1c6ad4[_0xb7f1('0x32')]=qs[_0xb7f1('0x33')](_0x4c7b28[_0xb7f1('0x2a')][_0xb7f1('0x33')]);_0x1c6ad4[_0xb7f1('0x34')]=qs['filters'](_[_0xb7f1('0x35')](_0x4c7b28[_0xb7f1('0x2a')],_0x529ed7[_0xb7f1('0x36')]));if(_0x4c7b28[_0xb7f1('0x2a')][_0xb7f1('0x37')]){_0x1c6ad4[_0xb7f1('0x34')]=_['merge'](_0x1c6ad4[_0xb7f1('0x34')],{'$or':_[_0xb7f1('0x38')](_0x5efe72,function(_0x2174d2){if(_0x2174d2['type'][_0xb7f1('0x39')]!==_0xb7f1('0x3a')){var _0x2e5ea4={};_0x2e5ea4[_0x2174d2[_0xb7f1('0x3b')]]={'$like':'%'+_0x4c7b28[_0xb7f1('0x2a')][_0xb7f1('0x37')]+'%'};return _0x2e5ea4;}})});}_0x1c6ad4=_[_0xb7f1('0x3c')]({},_0x1c6ad4,_0x4c7b28[_0xb7f1('0x3d')]);var _0x539494={'where':_0x1c6ad4[_0xb7f1('0x34')]};return db[_0xb7f1('0x26')][_0xb7f1('0x1c')](_0x539494)[_0xb7f1('0x22')](function(_0xb98995){_0x1a4c63['count']=_0xb98995;if(_0x4c7b28['query']['includeAll']){_0x1c6ad4[_0xb7f1('0x3e')]=[{'all':!![]}];}return db[_0xb7f1('0x26')][_0xb7f1('0x3f')](_0x1c6ad4);})[_0xb7f1('0x22')](function(_0x1b4c3d){_0x1a4c63[_0xb7f1('0x40')]=_0x1b4c3d;return _0x1a4c63;})[_0xb7f1('0x22')](respondWithFilteredResult(_0x308d72,_0x1c6ad4))[_0xb7f1('0x41')](handleError(_0x308d72,null));};exports[_0xb7f1('0x42')]=function(_0x6b6843,_0x494c25){var _0x42909f={'raw':!![],'where':{'id':_0x6b6843[_0xb7f1('0x43')]['id']}},_0x3ff11d={};_0x3ff11d['model']=_[_0xb7f1('0x29')](db[_0xb7f1('0x26')][_0xb7f1('0x27')]);_0x3ff11d[_0xb7f1('0x2a')]=_[_0xb7f1('0x29')](_0x6b6843[_0xb7f1('0x2a')]);_0x3ff11d[_0xb7f1('0x36')]=_['intersection'](_0x3ff11d[_0xb7f1('0x28')],_0x3ff11d[_0xb7f1('0x2a')]);_0x42909f[_0xb7f1('0x2b')]=_[_0xb7f1('0x2c')](_0x3ff11d[_0xb7f1('0x28')],qs[_0xb7f1('0x2d')](_0x6b6843[_0xb7f1('0x2a')][_0xb7f1('0x2d')]));_0x42909f[_0xb7f1('0x2b')]=_0x42909f[_0xb7f1('0x2b')][_0xb7f1('0x2e')]?_0x42909f[_0xb7f1('0x2b')]:_0x3ff11d[_0xb7f1('0x28')];if(_0x6b6843[_0xb7f1('0x2a')][_0xb7f1('0x44')]){_0x42909f[_0xb7f1('0x3e')]=[{'all':!![]}];}_0x42909f=_['merge']({},_0x42909f,_0x6b6843[_0xb7f1('0x3d')]);return db['SalesforceField']['find'](_0x42909f)[_0xb7f1('0x22')](handleEntityNotFound(_0x494c25,null))['then'](respondWithResult(_0x494c25,null))[_0xb7f1('0x41')](handleError(_0x494c25,null));};exports[_0xb7f1('0x45')]=function(_0x41d0cb,_0x519544){return db[_0xb7f1('0x26')][_0xb7f1('0x45')](_0x41d0cb[_0xb7f1('0x46')],{})['then'](respondWithResult(_0x519544,0xc9))[_0xb7f1('0x41')](handleError(_0x519544,null));};exports[_0xb7f1('0x21')]=function(_0x909229,_0x1273ef){if(_0x909229[_0xb7f1('0x46')]['id']){delete _0x909229['body']['id'];}return db[_0xb7f1('0x26')][_0xb7f1('0x47')]({'where':{'id':_0x909229[_0xb7f1('0x43')]['id']}})[_0xb7f1('0x22')](handleEntityNotFound(_0x1273ef,null))[_0xb7f1('0x22')](saveUpdates(_0x909229['body'],null))[_0xb7f1('0x22')](respondWithResult(_0x1273ef,null))['catch'](handleError(_0x1273ef,null));};exports['destroy']=function(_0x4e2fe3,_0x39bdb7){return db[_0xb7f1('0x26')][_0xb7f1('0x47')]({'where':{'id':_0x4e2fe3['params']['id']}})[_0xb7f1('0x22')](handleEntityNotFound(_0x39bdb7,null))[_0xb7f1('0x22')](removeEntity(_0x39bdb7,null))['catch'](handleError(_0x39bdb7,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index c956e49..86d0094 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 _0x297b=['exports','SalesforceField','idField','lodash','../../config/logger','api','moment','path','rimraf','./intSalesforceField.attributes'];(function(_0xf12a28,_0x59c42c){var _0x1ec80e=function(_0x26d432){while(--_0x26d432){_0xf12a28['push'](_0xf12a28['shift']());}};_0x1ec80e(++_0x59c42c);}(_0x297b,0x85));var _0xb297=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0x297b[_0xf79bae];return _0x5d2cb7;};'use strict';var _=require(_0xb297('0x0'));var util=require('util');var logger=require(_0xb297('0x1'))(_0xb297('0x2'));var moment=require(_0xb297('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb297('0x4'));var rimraf=require(_0xb297('0x5'));var config=require('../../config/environment');var attributes=require(_0xb297('0x6'));module[_0xb297('0x7')]=function(_0x59e06a,_0x5431e4){return _0x59e06a['define'](_0xb297('0x8'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xb297('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4706=['FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','idField'];(function(_0x4662be,_0x506d6d){var _0x4c4e07=function(_0x52166c){while(--_0x52166c){_0x4662be['push'](_0x4662be['shift']());}};_0x4c4e07(++_0x506d6d);}(_0x4706,0xf1));var _0x6470=function(_0x2e4e2c,_0x1d4a7f){_0x2e4e2c=_0x2e4e2c-0x0;var _0x4ab0e9=_0x4706[_0x2e4e2c];return _0x4ab0e9;};'use strict';var _=require('lodash');var util=require(_0x6470('0x0'));var logger=require(_0x6470('0x1'))(_0x6470('0x2'));var moment=require(_0x6470('0x3'));var BPromise=require(_0x6470('0x4'));var rp=require(_0x6470('0x5'));var fs=require('fs');var path=require(_0x6470('0x6'));var rimraf=require(_0x6470('0x7'));var config=require(_0x6470('0x8'));var attributes=require(_0x6470('0x9'));module[_0x6470('0xa')]=function(_0x4174f3,_0x329ea0){return _0x4174f3['define'](_0x6470('0xb'),attributes,{'tableName':_0x6470('0xc'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x6470('0xd'),_0x6470('0xe')],'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 17cef31..5b366f7 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 _0x70e0=['code','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x44df59,_0x3c7340){var _0x4652d8=function(_0x5859d2){while(--_0x5859d2){_0x44df59['push'](_0x44df59['shift']());}};_0x4652d8(++_0x3c7340);}(_0x70e0,0x17b));var _0x070e=function(_0x1eb60d,_0x507ad0){_0x1eb60d=_0x1eb60d-0x0;var _0x225d8e=_0x70e0[_0x1eb60d];return _0x225d8e;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('SalesforceField,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('SalesforceField,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0x9ffd=['SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SalesforceField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x5b22e5,_0x50a727){var _0x50aa89=function(_0x391c4e){while(--_0x391c4e){_0x5b22e5['push'](_0x5b22e5['shift']());}};_0x50aa89(++_0x50a727);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x452014,_0x112d7c){_0x452014=_0x452014-0x0;var _0x40ac4c=_0x9ffd[_0x452014];return _0x40ac4c;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('SalesforceField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('SalesforceField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('SalesforceField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index a084597..a8fb66c 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 _0xdbb3=['getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x47fba8,_0x3fc709){var _0x4739e2=function(_0x21b9f6){while(--_0x21b9f6){_0x47fba8['push'](_0x47fba8['shift']());}};_0x4739e2(++_0x3fc709);}(_0xdbb3,0x1c2));var _0x3dbb=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0xdbb3[_0x363ef8];return _0x148822;};'use strict';var multer=require(_0x3dbb('0x0'));var util=require(_0x3dbb('0x1'));var path=require(_0x3dbb('0x2'));var timeout=require(_0x3dbb('0x3'));var express=require(_0x3dbb('0x4'));var router=express['Router']();var auth=require(_0x3dbb('0x5'));var interaction=require(_0x3dbb('0x6'));var config=require(_0x3dbb('0x7'));var controller=require('./intServicenowAccount.controller');router[_0x3dbb('0x8')]('/',auth[_0x3dbb('0x9')](),controller[_0x3dbb('0xa')]);router['get'](_0x3dbb('0xb'),auth[_0x3dbb('0x9')](),controller['show']);router[_0x3dbb('0x8')]('/:id/configurations',auth[_0x3dbb('0x9')](),controller[_0x3dbb('0xc')]);router[_0x3dbb('0x8')](_0x3dbb('0xd'),auth['isAuthenticated'](),controller[_0x3dbb('0xe')]);router[_0x3dbb('0xf')]('/',auth[_0x3dbb('0x9')](),controller[_0x3dbb('0x10')]);router[_0x3dbb('0xf')]('/:id/configurations',auth[_0x3dbb('0x9')](),controller[_0x3dbb('0x11')]);router['put'](_0x3dbb('0xb'),auth['isAuthenticated'](),controller[_0x3dbb('0x12')]);router[_0x3dbb('0x13')](_0x3dbb('0xb'),auth[_0x3dbb('0x9')](),controller[_0x3dbb('0x14')]);module[_0x3dbb('0x15')]=router; \ No newline at end of file +var _0x62da=['multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','exports'];(function(_0x10e983,_0x2f4eda){var _0x324138=function(_0x17a377){while(--_0x17a377){_0x10e983['push'](_0x10e983['shift']());}};_0x324138(++_0x2f4eda);}(_0x62da,0xc0));var _0xa62d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x62da[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xa62d('0x0'));var util=require('util');var path=require(_0xa62d('0x1'));var timeout=require(_0xa62d('0x2'));var express=require(_0xa62d('0x3'));var router=express[_0xa62d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa62d('0x5'));var config=require(_0xa62d('0x6'));var controller=require(_0xa62d('0x7'));router[_0xa62d('0x8')]('/',auth[_0xa62d('0x9')](),controller[_0xa62d('0xa')]);router[_0xa62d('0x8')](_0xa62d('0xb'),auth[_0xa62d('0x9')](),controller[_0xa62d('0xc')]);router[_0xa62d('0x8')](_0xa62d('0xd'),auth['isAuthenticated'](),controller[_0xa62d('0xe')]);router[_0xa62d('0x8')]('/:id/fields',auth[_0xa62d('0x9')](),controller[_0xa62d('0xf')]);router[_0xa62d('0x10')]('/',auth[_0xa62d('0x9')](),controller[_0xa62d('0x11')]);router['post'](_0xa62d('0xd'),auth[_0xa62d('0x9')](),controller[_0xa62d('0x12')]);router[_0xa62d('0x13')](_0xa62d('0xb'),auth[_0xa62d('0x9')](),controller[_0xa62d('0x14')]);router[_0xa62d('0x15')](_0xa62d('0xb'),auth['isAuthenticated'](),controller[_0xa62d('0x16')]);module[_0xa62d('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index a97703c..173e37a 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 _0xd450=['remoteUri','sequelize','exports','STRING','username'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xd450,0x1e6));var _0x0d45=function(_0x361d2d,_0x277b8f){_0x361d2d=_0x361d2d-0x0;var _0x521b4e=_0xd450[_0x361d2d];return _0x521b4e;};'use strict';var Sequelize=require(_0x0d45('0x0'));module[_0x0d45('0x1')]={'name':{'type':Sequelize[_0x0d45('0x2')]},'description':{'type':Sequelize[_0x0d45('0x2')]},'username':{'type':Sequelize[_0x0d45('0x2')],'unique':_0x0d45('0x3')},'password':{'type':Sequelize[_0x0d45('0x2')]},'email':{'type':Sequelize[_0x0d45('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0d45('0x4')},'serverUrl':{'type':Sequelize[_0x0d45('0x2')]}}; \ No newline at end of file +var _0xb368=['STRING','username','remoteUri','sequelize','exports'];(function(_0x699bf,_0x1ec1ac){var _0x462539=function(_0x56f1c7){while(--_0x56f1c7){_0x699bf['push'](_0x699bf['shift']());}};_0x462539(++_0x1ec1ac);}(_0xb368,0xee));var _0x8b36=function(_0x5e3f05,_0x1aa242){_0x5e3f05=_0x5e3f05-0x0;var _0x13f63e=_0xb368[_0x5e3f05];return _0x13f63e;};'use strict';var Sequelize=require(_0x8b36('0x0'));module[_0x8b36('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8b36('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x8b36('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x8b36('0x2')]},'remoteUri':{'type':Sequelize[_0x8b36('0x2')],'unique':_0x8b36('0x4')},'serverUrl':{'type':Sequelize[_0x8b36('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 6c8479e..47b8a4d 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 _0x9d22=['category','username','email','remoteUri','serverUrl','slice','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','name','label','push','all','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','statusCode','True','true','false','sys_choice?sysparm_query=name=incident^element=','value','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','end','json','offset','limit','status','apply','reject','save','update','destroy','stack','send','index','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field','merge','options','ServicenowAccount','count','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','ServicenowConfiguration','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','made_sla','knowledge','subcategory','close_code','notify','incident_state','severity','parent','upon_reject','sys_updated_on','child_incidents','hold_reason','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','work_notes_list','priority','rfc','time_worked','opened_at','business_duration','reopened_time','caller_id','approval_set','correlation_display','work_start','assignment_group','additional_assignee_list','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','problem_id','reassignment_count','assigned_to','approval','comments_and_work_notes','due_date','reopen_count','escalation','upon_approval','correlation_id','location'];(function(_0x3f9958,_0x49d479){var _0x317320=function(_0x52ce9a){while(--_0x52ce9a){_0x3f9958['push'](_0x3f9958['shift']());}};_0x317320(++_0x49d479);}(_0x9d22,0x192));var _0x29d2=function(_0x3d7fb5,_0x16eb5c){_0x3d7fb5=_0x3d7fb5-0x0;var _0x3a9642=_0x9d22[_0x3d7fb5];return _0x3a9642;};'use strict';var pdf=require(_0x29d2('0x0'));var emlformat=require(_0x29d2('0x1'));var rimraf=require(_0x29d2('0x2'));var zipdir=require(_0x29d2('0x3'));var jsonpatch=require(_0x29d2('0x4'));var rp=require(_0x29d2('0x5'));var moment=require(_0x29d2('0x6'));var BPromise=require(_0x29d2('0x7'));var Mustache=require(_0x29d2('0x8'));var util=require(_0x29d2('0x9'));var path=require('path');var sox=require(_0x29d2('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x29d2('0xb'));var crypto=require(_0x29d2('0xc'));var jsforce=require(_0x29d2('0xd'));var deskjs=require(_0x29d2('0xe'));var toCsv=require(_0x29d2('0xf'));var querystring=require(_0x29d2('0x10'));var Papa=require(_0x29d2('0x11'));var Redis=require('ioredis');var authService=require(_0x29d2('0x12'));var qs=require(_0x29d2('0x13'));var hardwareService=require(_0x29d2('0x14'));var logger=require('../../config/logger')(_0x29d2('0x15'));var utils=require('../../config/utils');var config=require(_0x29d2('0x16'));var db=require(_0x29d2('0x17'))['db'];var integrations=require(_0x29d2('0x18'));var jayson=require('jayson/promise');var client=jayson['client'][_0x29d2('0x19')]({'port':0x232a});function checkPasswordPattern(_0x19faa3,_0x29a069,_0x41c14d){if(_0x41c14d){var _0x4b3f39=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4b3f39[_0x29d2('0x1a')](_0x29a069)){return _0x19faa3;}else{throw new Error(_0x29d2('0x1b'));}}else{return _0x19faa3;}}function respondWithRpcPromise(_0x37f66b,_0x46757b,_0x363d9f,_0x28d4ef){return new BPromise(function(_0xb7656a,_0x5316b9){var _0x497e21=_0x28d4ef||client;return _0x497e21[_0x29d2('0x1c')](_0x37f66b,_0x363d9f)[_0x29d2('0x1d')](function(_0x237521){logger[_0x29d2('0x1e')](_0x29d2('0x1f'),_0x46757b,'request\x20sent');logger[_0x29d2('0x20')](_0x29d2('0x21'),_0x46757b,_0x29d2('0x22'),JSON['stringify'](_0x237521));if(_0x237521['error']){if(_0x237521[_0x29d2('0x23')][_0x29d2('0x24')]===0x1f4){logger[_0x29d2('0x23')]('ServicenowAccount,\x20%s,\x20%s',_0x46757b,_0x237521[_0x29d2('0x23')][_0x29d2('0x25')]);return _0x5316b9(_0x237521[_0x29d2('0x23')][_0x29d2('0x25')]);}logger[_0x29d2('0x23')](_0x29d2('0x1f'),_0x46757b,_0x237521['error'][_0x29d2('0x25')]);return _0xb7656a(_0x237521[_0x29d2('0x23')][_0x29d2('0x25')]);}else{logger[_0x29d2('0x1e')](_0x29d2('0x1f'),_0x46757b,'request\x20sent');_0xb7656a(_0x237521[_0x29d2('0x26')]['message']);}})['catch'](function(_0x4e2907){logger[_0x29d2('0x23')](_0x29d2('0x1f'),_0x46757b,_0x4e2907);_0x5316b9(_0x4e2907);});});}function respondWithStatusCode(_0x4a6d04,_0x14f29e){_0x14f29e=_0x14f29e||0xcc;return function(_0x4ae15e){if(_0x4ae15e){return _0x4a6d04[_0x29d2('0x27')](_0x14f29e);}return _0x4a6d04['status'](_0x14f29e)[_0x29d2('0x28')]();};}function respondWithResult(_0x170baf,_0xf6913f){_0xf6913f=_0xf6913f||0xc8;return function(_0x305801){if(_0x305801){return _0x170baf['status'](_0xf6913f)[_0x29d2('0x29')](_0x305801);}};}function respondWithFilteredResult(_0x48a428,_0x531862){return function(_0xc8d576){if(_0xc8d576){var _0x4d4e60=_0xc8d576['count'],_0x3124b5=_0x531862['offset'],_0xdfd478=_0x531862[_0x29d2('0x2a')]+_0x531862[_0x29d2('0x2b')],_0x25d093;if(_0xdfd478>=_0x4d4e60){_0xdfd478=_0x4d4e60;_0x25d093=0xc8;}else{_0x25d093=0xce;}_0x48a428[_0x29d2('0x2c')](_0x25d093);return _0x48a428['set']('Content-Range',_0x3124b5+'-'+_0xdfd478+'/'+_0x4d4e60)[_0x29d2('0x29')](_0xc8d576);}return null;};}function patchUpdates(_0xc7e84){return function(_0x5cbce9){try{jsonpatch[_0x29d2('0x2d')](_0x5cbce9,_0xc7e84,!![]);}catch(_0x175928){return BPromise[_0x29d2('0x2e')](_0x175928);}return _0x5cbce9[_0x29d2('0x2f')]();};}function saveUpdates(_0x100ba5,_0x56fc06){return function(_0x1b27a6){if(_0x1b27a6){return _0x1b27a6[_0x29d2('0x30')](_0x100ba5)[_0x29d2('0x1d')](function(_0x40b89e){return _0x40b89e;});}return null;};}function removeEntity(_0x357901,_0x23340f){return function(_0x2f5e75){if(_0x2f5e75){return _0x2f5e75[_0x29d2('0x31')]()[_0x29d2('0x1d')](function(){_0x357901[_0x29d2('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ac97c,_0x8f6546){return function(_0x1c2cb0){if(!_0x1c2cb0){_0x1ac97c['sendStatus'](0x194);}return _0x1c2cb0;};}function handleError(_0x55e03e,_0x1f2ddc){_0x1f2ddc=_0x1f2ddc||0x1f4;return function(_0x2c203d){logger['error'](_0x2c203d[_0x29d2('0x32')]);if(_0x2c203d['name']){delete _0x2c203d['name'];}_0x55e03e['status'](_0x1f2ddc)[_0x29d2('0x33')](_0x2c203d);};}exports[_0x29d2('0x34')]=function(_0x2f95f8,_0x147417){var _0x1bc7aa={},_0xa495f4={},_0x4bbf7d={'count':0x0,'rows':[]};var _0x10b126=db['ServicenowAccount'][_0x29d2('0x35')];_0xa495f4[_0x29d2('0x36')]=_['keys'](_0x10b126);_0xa495f4[_0x29d2('0x37')]=_[_0x29d2('0x38')](_0x2f95f8[_0x29d2('0x37')]);_0xa495f4['filters']=_[_0x29d2('0x39')](_0xa495f4[_0x29d2('0x36')],_0xa495f4[_0x29d2('0x37')]);_0x1bc7aa[_0x29d2('0x3a')]=_[_0x29d2('0x39')](_0xa495f4['model'],qs[_0x29d2('0x3b')](_0x2f95f8[_0x29d2('0x37')][_0x29d2('0x3b')]));_0x1bc7aa[_0x29d2('0x3a')]=_0x1bc7aa[_0x29d2('0x3a')][_0x29d2('0x3c')]?_0x1bc7aa[_0x29d2('0x3a')]:_0xa495f4['model'];if(!_0x2f95f8['query'][_0x29d2('0x3d')]('nolimit')){_0x1bc7aa[_0x29d2('0x2b')]=qs[_0x29d2('0x2b')](_0x2f95f8[_0x29d2('0x37')][_0x29d2('0x2b')]);_0x1bc7aa['offset']=qs[_0x29d2('0x2a')](_0x2f95f8[_0x29d2('0x37')]['offset']);}_0x1bc7aa[_0x29d2('0x3e')]=qs['sort'](_0x2f95f8[_0x29d2('0x37')][_0x29d2('0x3f')]);_0x1bc7aa[_0x29d2('0x40')]=qs[_0x29d2('0x41')](_[_0x29d2('0x42')](_0x2f95f8[_0x29d2('0x37')],_0xa495f4[_0x29d2('0x41')]));if(_0x2f95f8['query'][_0x29d2('0x43')]){_0x1bc7aa['where']=_['merge'](_0x1bc7aa[_0x29d2('0x40')],{'$or':_[_0x29d2('0x44')](_0x10b126,function(_0x10f010){if(_0x10f010[_0x29d2('0x45')][_0x29d2('0x46')]!==_0x29d2('0x47')){var _0x42df95={};_0x42df95[_0x10f010[_0x29d2('0x48')]]={'$like':'%'+_0x2f95f8[_0x29d2('0x37')][_0x29d2('0x43')]+'%'};return _0x42df95;}})});}_0x1bc7aa=_[_0x29d2('0x49')]({},_0x1bc7aa,_0x2f95f8[_0x29d2('0x4a')]);var _0x52c8d5={'where':_0x1bc7aa[_0x29d2('0x40')]};return db[_0x29d2('0x4b')]['count'](_0x52c8d5)['then'](function(_0x48877c){_0x4bbf7d[_0x29d2('0x4c')]=_0x48877c;if(_0x2f95f8[_0x29d2('0x37')][_0x29d2('0x4d')]){_0x1bc7aa[_0x29d2('0x4e')]=[{'all':!![]}];}return db[_0x29d2('0x4b')]['findAll'](_0x1bc7aa);})[_0x29d2('0x1d')](function(_0x33ebd8){_0x4bbf7d[_0x29d2('0x4f')]=_0x33ebd8;return _0x4bbf7d;})[_0x29d2('0x1d')](respondWithFilteredResult(_0x147417,_0x1bc7aa))[_0x29d2('0x50')](handleError(_0x147417,null));};exports[_0x29d2('0x51')]=function(_0x81e276,_0xdae932){var _0x365bf7={'raw':![],'where':{'id':_0x81e276[_0x29d2('0x52')]['id']}},_0x4c5b2b={};_0x4c5b2b[_0x29d2('0x36')]=_[_0x29d2('0x38')](db[_0x29d2('0x4b')][_0x29d2('0x35')]);_0x4c5b2b['query']=_['keys'](_0x81e276['query']);_0x4c5b2b[_0x29d2('0x41')]=_[_0x29d2('0x39')](_0x4c5b2b[_0x29d2('0x36')],_0x4c5b2b['query']);_0x365bf7[_0x29d2('0x3a')]=_[_0x29d2('0x39')](_0x4c5b2b[_0x29d2('0x36')],qs[_0x29d2('0x3b')](_0x81e276['query'][_0x29d2('0x3b')]));_0x365bf7[_0x29d2('0x3a')]=_0x365bf7[_0x29d2('0x3a')]['length']?_0x365bf7[_0x29d2('0x3a')]:_0x4c5b2b['model'];if(_0x81e276[_0x29d2('0x37')][_0x29d2('0x4d')]){_0x365bf7[_0x29d2('0x4e')]=[{'all':!![]}];}_0x365bf7=_[_0x29d2('0x49')]({},_0x365bf7,_0x81e276[_0x29d2('0x4a')]);return db[_0x29d2('0x4b')][_0x29d2('0x53')](_0x365bf7)['then'](handleEntityNotFound(_0xdae932,null))['then'](respondWithResult(_0xdae932,null))[_0x29d2('0x50')](handleError(_0xdae932,null));};exports[_0x29d2('0x54')]=function(_0x3ce635,_0x1d21a8){return db[_0x29d2('0x4b')][_0x29d2('0x54')](_0x3ce635[_0x29d2('0x55')],{})[_0x29d2('0x1d')](respondWithResult(_0x1d21a8,0xc9))[_0x29d2('0x50')](handleError(_0x1d21a8,null));};exports['update']=function(_0x5bb6d9,_0x3fa03a){if(_0x5bb6d9[_0x29d2('0x55')]['id']){delete _0x5bb6d9[_0x29d2('0x55')]['id'];}return db[_0x29d2('0x4b')][_0x29d2('0x53')]({'where':{'id':_0x5bb6d9['params']['id']}})['then'](handleEntityNotFound(_0x3fa03a,null))[_0x29d2('0x1d')](saveUpdates(_0x5bb6d9[_0x29d2('0x55')],null))[_0x29d2('0x1d')](respondWithResult(_0x3fa03a,null))[_0x29d2('0x50')](handleError(_0x3fa03a,null));};exports[_0x29d2('0x31')]=function(_0x300376,_0xe3de9a){return db[_0x29d2('0x4b')][_0x29d2('0x53')]({'where':{'id':_0x300376['params']['id']}})['then'](handleEntityNotFound(_0xe3de9a,null))[_0x29d2('0x1d')](removeEntity(_0xe3de9a,null))[_0x29d2('0x50')](handleError(_0xe3de9a,null));};exports[_0x29d2('0x56')]=function(_0x4faba4,_0x60b03d,_0x480c62){var _0x53e845={};var _0xd56a90={};var _0x338fb7;var _0x102434;return db['ServicenowAccount']['findOne']({'where':{'id':_0x4faba4['params']['id']}})[_0x29d2('0x1d')](handleEntityNotFound(_0x60b03d,null))['then'](function(_0x54e1fe){if(_0x54e1fe){_0x338fb7=_0x54e1fe;_0xd56a90[_0x29d2('0x36')]=_[_0x29d2('0x38')](db[_0x29d2('0x57')][_0x29d2('0x35')]);_0xd56a90['query']=_[_0x29d2('0x38')](_0x4faba4['query']);_0xd56a90[_0x29d2('0x41')]=_[_0x29d2('0x39')](_0xd56a90['model'],_0xd56a90[_0x29d2('0x37')]);_0x53e845['attributes']=_[_0x29d2('0x39')](_0xd56a90[_0x29d2('0x36')],qs['fields'](_0x4faba4['query']['fields']));_0x53e845[_0x29d2('0x3a')]=_0x53e845[_0x29d2('0x3a')][_0x29d2('0x3c')]?_0x53e845[_0x29d2('0x3a')]:_0xd56a90[_0x29d2('0x36')];_0x53e845[_0x29d2('0x3e')]=qs[_0x29d2('0x3f')](_0x4faba4[_0x29d2('0x37')]['sort']);_0x53e845[_0x29d2('0x40')]=qs[_0x29d2('0x41')](_['pick'](_0x4faba4[_0x29d2('0x37')],_0xd56a90[_0x29d2('0x41')]));if(_0x4faba4[_0x29d2('0x37')][_0x29d2('0x43')]){_0x53e845[_0x29d2('0x40')]=_[_0x29d2('0x49')](_0x53e845['where'],{'$or':_['map'](_0x53e845[_0x29d2('0x3a')],function(_0x165681){var _0xcdb14b={};_0xcdb14b[_0x165681]={'$like':'%'+_0x4faba4[_0x29d2('0x37')][_0x29d2('0x43')]+'%'};return _0xcdb14b;})});}_0x53e845=_[_0x29d2('0x49')]({},_0x53e845,_0x4faba4[_0x29d2('0x4a')]);return _0x338fb7[_0x29d2('0x56')](_0x53e845);}})[_0x29d2('0x1d')](function(_0x5b0527){if(_0x5b0527){_0x102434=_0x5b0527[_0x29d2('0x3c')];if(!_0x4faba4[_0x29d2('0x37')][_0x29d2('0x3d')](_0x29d2('0x58'))){_0x53e845['limit']=qs[_0x29d2('0x2b')](_0x4faba4['query'][_0x29d2('0x2b')]);_0x53e845[_0x29d2('0x2a')]=qs[_0x29d2('0x2a')](_0x4faba4[_0x29d2('0x37')]['offset']);}return _0x338fb7['getConfigurations'](_0x53e845);}})[_0x29d2('0x1d')](function(_0x13a09a){if(_0x13a09a){return _0x13a09a?{'count':_0x102434,'rows':_0x13a09a}:null;}})[_0x29d2('0x1d')](respondWithResult(_0x60b03d,null))['catch'](handleError(_0x60b03d,null));};exports[_0x29d2('0x59')]=function(_0x4cfc43,_0x585a0f,_0xdfacfe){if(_0x4cfc43[_0x29d2('0x55')]['id']){delete _0x4cfc43[_0x29d2('0x55')]['id'];}return db[_0x29d2('0x4b')][_0x29d2('0x5a')]({'where':{'id':_0x4cfc43[_0x29d2('0x52')]['id']}})[_0x29d2('0x1d')](handleEntityNotFound(_0x585a0f,null))[_0x29d2('0x1d')](function(_0x14eb0d){if(_0x14eb0d){_0x4cfc43[_0x29d2('0x55')][_0x29d2('0x5b')]=_0x14eb0d['id'];_0x4cfc43[_0x29d2('0x55')][_0x29d2('0x5c')]=integrations[_0x29d2('0x5d')](_0x4cfc43['body'][_0x29d2('0x5e')],_0x4cfc43['body'][_0x29d2('0x45')]);_0x4cfc43[_0x29d2('0x55')][_0x29d2('0x5f')]=integrations['getDescriptions'](_0x4cfc43[_0x29d2('0x55')][_0x29d2('0x5e')],_0x4cfc43[_0x29d2('0x55')][_0x29d2('0x45')]);return db[_0x29d2('0x57')][_0x29d2('0x54')](_0x4cfc43[_0x29d2('0x55')],{'include':[{'model':db[_0x29d2('0x60')],'as':_0x29d2('0x5c')},{'model':db[_0x29d2('0x60')],'as':'Descriptions'}]});}return null;})[_0x29d2('0x1d')](respondWithResult(_0x585a0f,null))[_0x29d2('0x50')](handleError(_0x585a0f,null));};exports[_0x29d2('0x61')]=function(_0xedef74,_0x1e6c15,_0xc50297){var _0xaa18e4=[_0x29d2('0x62'),'hold_reason',_0x29d2('0x63'),_0x29d2('0x64'),_0x29d2('0x65'),_0x29d2('0x66'),_0x29d2('0x67'),_0x29d2('0x68'),'category'];var _0xd97b88=[_0x29d2('0x69'),'made_sla','caused_by','watch_list',_0x29d2('0x6a'),_0x29d2('0x6b'),_0x29d2('0x6c'),_0x29d2('0x6d'),'approval_history',_0x29d2('0x6e'),_0x29d2('0x6f'),_0x29d2('0x70'),_0x29d2('0x71'),_0x29d2('0x72'),_0x29d2('0x73'),'sys_domain',_0x29d2('0x74'),_0x29d2('0x75'),_0x29d2('0x63'),_0x29d2('0x3e'),_0x29d2('0x76'),_0x29d2('0x77'),_0x29d2('0x78'),_0x29d2('0x79'),_0x29d2('0x7a'),'active',_0x29d2('0x7b'),'business_service',_0x29d2('0x7c'),'sys_domain_path',_0x29d2('0x7d'),_0x29d2('0x7e'),'expected_start',_0x29d2('0x7f'),_0x29d2('0x80'),'group_list','work_end',_0x29d2('0x81'),'resolved_at',_0x29d2('0x82'),_0x29d2('0x83'),_0x29d2('0x64'),'work_notes','short_description',_0x29d2('0x65'),_0x29d2('0x84'),'delivery_task',_0x29d2('0x85'),_0x29d2('0x86'),'business_stc',_0x29d2('0x87'),'description','calendar_duration','notify','sys_class_name',_0x29d2('0x88'),_0x29d2('0x89'),_0x29d2('0x8a'),_0x29d2('0x8b'),_0x29d2('0x8c'),'contact_type',_0x29d2('0x8d'),_0x29d2('0x67'),'urgency',_0x29d2('0x8e'),'company',_0x29d2('0x8f'),'activity_due',_0x29d2('0x90'),_0x29d2('0x68'),'comments','sla_due',_0x29d2('0x91'),_0x29d2('0x92'),_0x29d2('0x93'),'sys_mod_count',_0x29d2('0x94'),'sys_tags',_0x29d2('0x95'),_0x29d2('0x96'),_0x29d2('0x97'),_0x29d2('0x98'),_0x29d2('0x99')];var _0x2757b4='';var _0x301e2d='';var _0x2f47b5=[];var _0xa34982='';var _0x194879='';var _0x10d609=[];var _0x2dcc13='';var _0x49dd4e='';var _0x20ef36={};var _0xbfe03b='';return db[_0x29d2('0x4b')][_0x29d2('0x5a')]({'where':{'id':_0xedef74[_0x29d2('0x52')]['id']},'attributes':['id',_0x29d2('0x9a'),'password',_0x29d2('0x9b'),_0x29d2('0x9c'),_0x29d2('0x9d')]})[_0x29d2('0x1d')](handleEntityNotFound(_0x1e6c15,null))[_0x29d2('0x1d')](function(_0x1dcb05){if(_0x1dcb05){_0xbfe03b=_0x1dcb05[_0x29d2('0x9c')];var _0x10c9f2=_0xbfe03b[_0x29d2('0x9e')](-0x1);if(_0x10c9f2==='/'){_0xbfe03b=_0xbfe03b['substring'](0x0,_0xbfe03b['lastIndexOf'](_0x10c9f2));}_0x49dd4e=util[_0x29d2('0x9f')](_0x29d2('0xa0'),_0xbfe03b);_0x2dcc13=util[_0x29d2('0x9f')](_0x29d2('0xa1'),_0xbfe03b);_0x20ef36={'user':_0x1dcb05[_0x29d2('0x9a')],'pass':_0x1dcb05[_0x29d2('0xa2')]};var _0x5dcb33={'method':_0x29d2('0xa3'),'uri':_0x49dd4e+_0x29d2('0xa4'),'auth':_0x20ef36,'json':!![]};return rp(_0x5dcb33);}})['then'](function(_0x380b52){if(_0x380b52[_0x29d2('0x26')][_0x29d2('0x3c')]>0x0){_0x2757b4=_0x380b52['result'];}console[_0x29d2('0xa5')](_0x29d2('0xa6'),_0x2757b4);_0x10d609=[];_0x301e2d=Object[_0x29d2('0xa7')]([],_0x2757b4);_[_0x29d2('0xa8')](_0x301e2d,function(_0x4353c4){return!_0xaa18e4[_0x29d2('0xa9')](_0x4353c4['name']);});_0x301e2d[_0x29d2('0xaa')](function(_0x54ee99){var _0x37ec6c=createFieldObject(_0x2dcc13,_0x20ef36,_0x54ee99[_0x29d2('0xab')],_0x54ee99[_0x29d2('0xac')],_0x54ee99[_0x29d2('0xad')],![]);_0x10d609[_0x29d2('0xae')](_0x37ec6c);});return Promise[_0x29d2('0xaf')](_0x10d609);})[_0x29d2('0x1d')](function(_0x40dc22){_0x2f47b5=_0x40dc22;_0xa34982=Object[_0x29d2('0xa7')]([],_0x2757b4);console['log']('TCL:\x20_object',_0x2757b4);_[_0x29d2('0xa8')](_0xa34982,function(_0xe84e60){return _0xd97b88[_0x29d2('0xa9')](_0xe84e60[_0x29d2('0xac')]);});console['log'](_0x29d2('0xb0'),_0xa34982);_0x10d609=[];_0xa34982[_0x29d2('0xaa')](function(_0x529603){var _0x23bb1a=createFieldObject(_0x2dcc13,_0x20ef36,_0x529603[_0x29d2('0xab')],_0x529603[_0x29d2('0xac')],_0x529603[_0x29d2('0xad')],!![]);_0x10d609[_0x29d2('0xae')](_0x23bb1a);});return Promise['all'](_0x10d609);})[_0x29d2('0x1d')](function(_0x12f407){_0x194879=_0x12f407;var _0x29d81b=_0x2f47b5[_0x29d2('0xb1')](_0x194879);return{'count':_0x29d81b[_0x29d2('0x3c')],'rows':_0x29d81b};})[_0x29d2('0x1d')](respondWithResult(_0x1e6c15,null))['catch'](function(_0x211bf0){console['log'](_0x29d2('0xb2')+_0x211bf0);var _0xab72d4=_0xedef74[_0x29d2('0x37')][_0x29d2('0x1a')]?0x1f4:_0x211bf0['statusCode']||0x1f4;logger[_0x29d2('0x23')](_0x211bf0[_0x29d2('0x32')]);delete _0x211bf0[_0x29d2('0xac')];if(_0xab72d4===0x191){_0xab72d4=0x190;}_0x1e6c15[_0x29d2('0x2c')](_0xab72d4)['send'](_0xedef74[_0x29d2('0x37')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x211bf0[_0x29d2('0xb3')]}:_0x211bf0);});};function createFieldObject(_0x4a9031,_0x56d00c,_0x3a2c01,_0x228642,_0x700ff5,_0x173d30){return new Promise(function(_0x4e8848,_0x42bb4b){var _0x17367b={'id':_0x228642,'name':_0x700ff5,'custom':_0x173d30};if(_0x3a2c01==='boolean'){_0x17367b[_0x29d2('0x4a')]=[{'name':_0x29d2('0xb4'),'value':_0x29d2('0xb5')},{'name':'False','value':_0x29d2('0xb6')}];_0x4e8848(_0x17367b);}else{var _0x21501a={'method':_0x29d2('0xa3'),'uri':_0x4a9031+_0x29d2('0xb7')+_0x228642,'auth':_0x56d00c,'json':!![]};return rp(_0x21501a)[_0x29d2('0x1d')](function(_0x37be8c){var _0x15e260=[];if(_0x37be8c[_0x29d2('0x26')]['length']>0x0){_0x37be8c[_0x29d2('0x26')][_0x29d2('0xaa')](function(_0x9015df){if(_0x9015df['inactive']===_0x29d2('0xb6')){var _0x1437b6={'name':_0x9015df[_0x29d2('0xad')],'value':_0x9015df[_0x29d2('0xb8')]};_0x15e260[_0x29d2('0xae')](_0x1437b6);}});}_0x17367b[_0x29d2('0x4a')]=_0x15e260;if(_0x17367b[_0x29d2('0x4a')][_0x29d2('0x3c')]>0x0){_0x4e8848(_0x17367b);}else{if(_0x173d30==![]){_0x4e8848();}else{_0x4e8848(_0x17367b);}}});}});} \ No newline at end of file +var _0x71ab=['channel','type','Descriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','notify','incident_state','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','resolved_by','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','caller_id','approval_set','short_description','close_code','correlation_display','work_start','assignment_group','additional_assignee_list','description','calendar_duration','close_notes','closed_by','follow_up','parent_incident','contact_type','reopened_by','urgency','problem_id','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','location','username','password','email','remoteUri','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','all','TCL:\x20_object','concat','ServiceNow\x20error:\x20','test','statusCode','stack','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','name','send','index','ServicenowAccount','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','show','params','find','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','order','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects'];(function(_0x4fe2e7,_0x8a434){var _0x1df240=function(_0xdba0e1){while(--_0xdba0e1){_0x4fe2e7['push'](_0x4fe2e7['shift']());}};_0x1df240(++_0x8a434);}(_0x71ab,0x64));var _0xb71a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x71ab[_0x13d07a];return _0x5ee0ee;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb71a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb71a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb71a('0x2'));var moment=require(_0xb71a('0x3'));var BPromise=require(_0xb71a('0x4'));var Mustache=require(_0xb71a('0x5'));var util=require(_0xb71a('0x6'));var path=require(_0xb71a('0x7'));var sox=require(_0xb71a('0x8'));var csv=require(_0xb71a('0x9'));var ejs=require(_0xb71a('0xa'));var fs=require('fs');var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x9'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb71a('0x14'))(_0xb71a('0x15'));var utils=require(_0xb71a('0x16'));var config=require('../../config/environment');var db=require(_0xb71a('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xb71a('0x18'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x3346a5,_0x2f5fd5,_0x315ca8){if(_0x315ca8){var _0xd8d3ae=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xd8d3ae['test'](_0x2f5fd5)){return _0x3346a5;}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 _0x3346a5;}}function respondWithRpcPromise(_0x5364e3,_0x12900a,_0xc189cd,_0x15252a){return new BPromise(function(_0x42fc55,_0x3cd0f0){var _0x1e9363=_0x15252a||client;return _0x1e9363[_0xb71a('0x19')](_0x5364e3,_0xc189cd)[_0xb71a('0x1a')](function(_0x7710a8){logger['info'](_0xb71a('0x1b'),_0x12900a,_0xb71a('0x1c'));logger[_0xb71a('0x1d')](_0xb71a('0x1e'),_0x12900a,_0xb71a('0x1c'),JSON[_0xb71a('0x1f')](_0x7710a8));if(_0x7710a8[_0xb71a('0x20')]){if(_0x7710a8[_0xb71a('0x20')][_0xb71a('0x21')]===0x1f4){logger[_0xb71a('0x20')](_0xb71a('0x1b'),_0x12900a,_0x7710a8['error']['message']);return _0x3cd0f0(_0x7710a8[_0xb71a('0x20')][_0xb71a('0x22')]);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x12900a,_0x7710a8[_0xb71a('0x20')]['message']);return _0x42fc55(_0x7710a8[_0xb71a('0x20')][_0xb71a('0x22')]);}else{logger[_0xb71a('0x23')](_0xb71a('0x1b'),_0x12900a,_0xb71a('0x1c'));_0x42fc55(_0x7710a8[_0xb71a('0x24')][_0xb71a('0x22')]);}})[_0xb71a('0x25')](function(_0x5f3f19){logger[_0xb71a('0x20')](_0xb71a('0x1b'),_0x12900a,_0x5f3f19);_0x3cd0f0(_0x5f3f19);});});}function respondWithStatusCode(_0x353930,_0xa0743a){_0xa0743a=_0xa0743a||0xcc;return function(_0x3401f7){if(_0x3401f7){return _0x353930[_0xb71a('0x26')](_0xa0743a);}return _0x353930[_0xb71a('0x27')](_0xa0743a)[_0xb71a('0x28')]();};}function respondWithResult(_0x31085b,_0x2a847a){_0x2a847a=_0x2a847a||0xc8;return function(_0x45b849){if(_0x45b849){return _0x31085b[_0xb71a('0x27')](_0x2a847a)[_0xb71a('0x29')](_0x45b849);}};}function respondWithFilteredResult(_0x5ae0ed,_0x2e8ea6){return function(_0x39d874){if(_0x39d874){var _0x1689ce=_0x39d874[_0xb71a('0x2a')],_0x358954=_0x2e8ea6[_0xb71a('0x2b')],_0x2fbd73=_0x2e8ea6[_0xb71a('0x2b')]+_0x2e8ea6[_0xb71a('0x2c')],_0x38178c;if(_0x2fbd73>=_0x1689ce){_0x2fbd73=_0x1689ce;_0x38178c=0xc8;}else{_0x38178c=0xce;}_0x5ae0ed[_0xb71a('0x27')](_0x38178c);return _0x5ae0ed['set']('Content-Range',_0x358954+'-'+_0x2fbd73+'/'+_0x1689ce)[_0xb71a('0x29')](_0x39d874);}return null;};}function patchUpdates(_0x5c2a45){return function(_0x70299a){try{jsonpatch[_0xb71a('0x2d')](_0x70299a,_0x5c2a45,!![]);}catch(_0x4d9e1a){return BPromise[_0xb71a('0x2e')](_0x4d9e1a);}return _0x70299a[_0xb71a('0x2f')]();};}function saveUpdates(_0x1fe058,_0x251d82){return function(_0x3d3d81){if(_0x3d3d81){return _0x3d3d81[_0xb71a('0x30')](_0x1fe058)['then'](function(_0x204f99){return _0x204f99;});}return null;};}function removeEntity(_0x3f137a,_0x256dbe){return function(_0x31e708){if(_0x31e708){return _0x31e708['destroy']()[_0xb71a('0x1a')](function(){_0x3f137a[_0xb71a('0x27')](0xcc)[_0xb71a('0x28')]();});}};}function handleEntityNotFound(_0x3db4e0,_0x1ec701){return function(_0x3d93fc){if(!_0x3d93fc){_0x3db4e0[_0xb71a('0x26')](0x194);}return _0x3d93fc;};}function handleError(_0x333280,_0x10a203){_0x10a203=_0x10a203||0x1f4;return function(_0x3f5531){logger['error'](_0x3f5531['stack']);if(_0x3f5531[_0xb71a('0x31')]){delete _0x3f5531[_0xb71a('0x31')];}_0x333280[_0xb71a('0x27')](_0x10a203)[_0xb71a('0x32')](_0x3f5531);};}exports[_0xb71a('0x33')]=function(_0x247540,_0x394b4f){var _0x564fd8={},_0x990c82={},_0x57ad22={'count':0x0,'rows':[]};var _0x3143c9=db[_0xb71a('0x34')][_0xb71a('0x35')];_0x990c82[_0xb71a('0x36')]=_['keys'](_0x3143c9);_0x990c82[_0xb71a('0x37')]=_[_0xb71a('0x38')](_0x247540[_0xb71a('0x37')]);_0x990c82[_0xb71a('0x39')]=_[_0xb71a('0x3a')](_0x990c82[_0xb71a('0x36')],_0x990c82[_0xb71a('0x37')]);_0x564fd8[_0xb71a('0x3b')]=_[_0xb71a('0x3a')](_0x990c82['model'],qs[_0xb71a('0x3c')](_0x247540['query'][_0xb71a('0x3c')]));_0x564fd8[_0xb71a('0x3b')]=_0x564fd8[_0xb71a('0x3b')][_0xb71a('0x3d')]?_0x564fd8[_0xb71a('0x3b')]:_0x990c82[_0xb71a('0x36')];if(!_0x247540['query']['hasOwnProperty']('nolimit')){_0x564fd8[_0xb71a('0x2c')]=qs['limit'](_0x247540[_0xb71a('0x37')][_0xb71a('0x2c')]);_0x564fd8[_0xb71a('0x2b')]=qs[_0xb71a('0x2b')](_0x247540[_0xb71a('0x37')][_0xb71a('0x2b')]);}_0x564fd8['order']=qs[_0xb71a('0x3e')](_0x247540[_0xb71a('0x37')][_0xb71a('0x3e')]);_0x564fd8[_0xb71a('0x3f')]=qs[_0xb71a('0x39')](_[_0xb71a('0x40')](_0x247540['query'],_0x990c82[_0xb71a('0x39')]));if(_0x247540[_0xb71a('0x37')][_0xb71a('0x41')]){_0x564fd8[_0xb71a('0x3f')]=_[_0xb71a('0x42')](_0x564fd8[_0xb71a('0x3f')],{'$or':_[_0xb71a('0x43')](_0x3143c9,function(_0x48baae){if(_0x48baae['type'][_0xb71a('0x44')]!==_0xb71a('0x45')){var _0x2f6b72={};_0x2f6b72[_0x48baae[_0xb71a('0x46')]]={'$like':'%'+_0x247540['query'][_0xb71a('0x41')]+'%'};return _0x2f6b72;}})});}_0x564fd8=_['merge']({},_0x564fd8,_0x247540[_0xb71a('0x47')]);var _0x1d8793={'where':_0x564fd8['where']};return db[_0xb71a('0x34')][_0xb71a('0x2a')](_0x1d8793)[_0xb71a('0x1a')](function(_0x2a1fde){_0x57ad22['count']=_0x2a1fde;if(_0x247540[_0xb71a('0x37')][_0xb71a('0x48')]){_0x564fd8[_0xb71a('0x49')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xb71a('0x4a')](_0x564fd8);})[_0xb71a('0x1a')](function(_0x29b0bd){_0x57ad22['rows']=_0x29b0bd;return _0x57ad22;})[_0xb71a('0x1a')](respondWithFilteredResult(_0x394b4f,_0x564fd8))[_0xb71a('0x25')](handleError(_0x394b4f,null));};exports[_0xb71a('0x4b')]=function(_0x1f29b7,_0x365bed){var _0x550a67={'raw':![],'where':{'id':_0x1f29b7[_0xb71a('0x4c')]['id']}},_0x1d876a={};_0x1d876a[_0xb71a('0x36')]=_[_0xb71a('0x38')](db['ServicenowAccount']['rawAttributes']);_0x1d876a[_0xb71a('0x37')]=_[_0xb71a('0x38')](_0x1f29b7[_0xb71a('0x37')]);_0x1d876a[_0xb71a('0x39')]=_[_0xb71a('0x3a')](_0x1d876a[_0xb71a('0x36')],_0x1d876a[_0xb71a('0x37')]);_0x550a67[_0xb71a('0x3b')]=_[_0xb71a('0x3a')](_0x1d876a[_0xb71a('0x36')],qs['fields'](_0x1f29b7[_0xb71a('0x37')][_0xb71a('0x3c')]));_0x550a67['attributes']=_0x550a67[_0xb71a('0x3b')]['length']?_0x550a67[_0xb71a('0x3b')]:_0x1d876a[_0xb71a('0x36')];if(_0x1f29b7[_0xb71a('0x37')][_0xb71a('0x48')]){_0x550a67[_0xb71a('0x49')]=[{'all':!![]}];}_0x550a67=_['merge']({},_0x550a67,_0x1f29b7[_0xb71a('0x47')]);return db['ServicenowAccount'][_0xb71a('0x4d')](_0x550a67)[_0xb71a('0x1a')](handleEntityNotFound(_0x365bed,null))['then'](respondWithResult(_0x365bed,null))['catch'](handleError(_0x365bed,null));};exports[_0xb71a('0x4e')]=function(_0x19972a,_0x4ef963){return db['ServicenowAccount']['create'](_0x19972a[_0xb71a('0x4f')],{})['then'](respondWithResult(_0x4ef963,0xc9))['catch'](handleError(_0x4ef963,null));};exports[_0xb71a('0x30')]=function(_0x536fad,_0xf029f7){if(_0x536fad[_0xb71a('0x4f')]['id']){delete _0x536fad['body']['id'];}return db[_0xb71a('0x34')][_0xb71a('0x4d')]({'where':{'id':_0x536fad[_0xb71a('0x4c')]['id']}})['then'](handleEntityNotFound(_0xf029f7,null))[_0xb71a('0x1a')](saveUpdates(_0x536fad[_0xb71a('0x4f')],null))['then'](respondWithResult(_0xf029f7,null))[_0xb71a('0x25')](handleError(_0xf029f7,null));};exports[_0xb71a('0x50')]=function(_0x31d79e,_0x531d75){return db[_0xb71a('0x34')]['find']({'where':{'id':_0x31d79e[_0xb71a('0x4c')]['id']}})[_0xb71a('0x1a')](handleEntityNotFound(_0x531d75,null))['then'](removeEntity(_0x531d75,null))[_0xb71a('0x25')](handleError(_0x531d75,null));};exports[_0xb71a('0x51')]=function(_0x1b24c2,_0x1c6312,_0x41a1fc){var _0x3b6762={};var _0x3dfd97={};var _0x535ab6;var _0x581b75;return db[_0xb71a('0x34')][_0xb71a('0x52')]({'where':{'id':_0x1b24c2[_0xb71a('0x4c')]['id']}})[_0xb71a('0x1a')](handleEntityNotFound(_0x1c6312,null))[_0xb71a('0x1a')](function(_0x4e897e){if(_0x4e897e){_0x535ab6=_0x4e897e;_0x3dfd97['model']=_[_0xb71a('0x38')](db[_0xb71a('0x53')]['rawAttributes']);_0x3dfd97[_0xb71a('0x37')]=_[_0xb71a('0x38')](_0x1b24c2['query']);_0x3dfd97[_0xb71a('0x39')]=_[_0xb71a('0x3a')](_0x3dfd97[_0xb71a('0x36')],_0x3dfd97[_0xb71a('0x37')]);_0x3b6762['attributes']=_[_0xb71a('0x3a')](_0x3dfd97[_0xb71a('0x36')],qs['fields'](_0x1b24c2[_0xb71a('0x37')][_0xb71a('0x3c')]));_0x3b6762[_0xb71a('0x3b')]=_0x3b6762[_0xb71a('0x3b')][_0xb71a('0x3d')]?_0x3b6762[_0xb71a('0x3b')]:_0x3dfd97[_0xb71a('0x36')];_0x3b6762[_0xb71a('0x54')]=qs['sort'](_0x1b24c2[_0xb71a('0x37')][_0xb71a('0x3e')]);_0x3b6762['where']=qs[_0xb71a('0x39')](_[_0xb71a('0x40')](_0x1b24c2['query'],_0x3dfd97[_0xb71a('0x39')]));if(_0x1b24c2[_0xb71a('0x37')][_0xb71a('0x41')]){_0x3b6762[_0xb71a('0x3f')]=_[_0xb71a('0x42')](_0x3b6762[_0xb71a('0x3f')],{'$or':_['map'](_0x3b6762['attributes'],function(_0x248c74){var _0x155925={};_0x155925[_0x248c74]={'$like':'%'+_0x1b24c2[_0xb71a('0x37')]['filter']+'%'};return _0x155925;})});}_0x3b6762=_[_0xb71a('0x42')]({},_0x3b6762,_0x1b24c2['options']);return _0x535ab6[_0xb71a('0x51')](_0x3b6762);}})['then'](function(_0x5c74af){if(_0x5c74af){_0x581b75=_0x5c74af[_0xb71a('0x3d')];if(!_0x1b24c2[_0xb71a('0x37')][_0xb71a('0x55')](_0xb71a('0x56'))){_0x3b6762[_0xb71a('0x2c')]=qs['limit'](_0x1b24c2[_0xb71a('0x37')]['limit']);_0x3b6762[_0xb71a('0x2b')]=qs[_0xb71a('0x2b')](_0x1b24c2[_0xb71a('0x37')]['offset']);}return _0x535ab6['getConfigurations'](_0x3b6762);}})[_0xb71a('0x1a')](function(_0x39ee35){if(_0x39ee35){return _0x39ee35?{'count':_0x581b75,'rows':_0x39ee35}:null;}})[_0xb71a('0x1a')](respondWithResult(_0x1c6312,null))[_0xb71a('0x25')](handleError(_0x1c6312,null));};exports[_0xb71a('0x57')]=function(_0x4b1e5d,_0x210fa0,_0x35d932){if(_0x4b1e5d[_0xb71a('0x4f')]['id']){delete _0x4b1e5d[_0xb71a('0x4f')]['id'];}return db[_0xb71a('0x34')]['findOne']({'where':{'id':_0x4b1e5d['params']['id']}})[_0xb71a('0x1a')](handleEntityNotFound(_0x210fa0,null))[_0xb71a('0x1a')](function(_0x38a8a1){if(_0x38a8a1){_0x4b1e5d[_0xb71a('0x4f')][_0xb71a('0x58')]=_0x38a8a1['id'];_0x4b1e5d[_0xb71a('0x4f')][_0xb71a('0x59')]=integrations['getSubjects'](_0x4b1e5d[_0xb71a('0x4f')][_0xb71a('0x5a')],_0x4b1e5d['body'][_0xb71a('0x5b')]);_0x4b1e5d[_0xb71a('0x4f')][_0xb71a('0x5c')]=integrations['getDescriptions'](_0x4b1e5d[_0xb71a('0x4f')][_0xb71a('0x5a')],_0x4b1e5d[_0xb71a('0x4f')]['type']);return db[_0xb71a('0x53')][_0xb71a('0x4e')](_0x4b1e5d[_0xb71a('0x4f')],{'include':[{'model':db[_0xb71a('0x5d')],'as':_0xb71a('0x59')},{'model':db[_0xb71a('0x5d')],'as':_0xb71a('0x5c')}]});}return null;})[_0xb71a('0x1a')](respondWithResult(_0x210fa0,null))['catch'](handleError(_0x210fa0,null));};exports[_0xb71a('0x5e')]=function(_0x507da4,_0x57896d,_0x30d36a){var _0x43e4b8=[_0xb71a('0x5f'),_0xb71a('0x60'),'knowledge',_0xb71a('0x61'),'close_code',_0xb71a('0x62'),_0xb71a('0x63'),'severity',_0xb71a('0x64')];var _0x4edc77=[_0xb71a('0x65'),'made_sla',_0xb71a('0x66'),_0xb71a('0x67'),_0xb71a('0x68'),_0xb71a('0x69'),'child_incidents',_0xb71a('0x60'),_0xb71a('0x6a'),'number',_0xb71a('0x6b'),'sys_updated_by','opened_by','user_input','sys_created_on',_0xb71a('0x6c'),_0xb71a('0x6d'),_0xb71a('0x6e'),'knowledge',_0xb71a('0x54'),_0xb71a('0x6f'),'closed_at',_0xb71a('0x70'),_0xb71a('0x71'),_0xb71a('0x72'),_0xb71a('0x73'),_0xb71a('0x74'),_0xb71a('0x75'),'priority',_0xb71a('0x76'),_0xb71a('0x77'),_0xb71a('0x78'),_0xb71a('0x79'),_0xb71a('0x7a'),_0xb71a('0x7b'),'group_list',_0xb71a('0x7c'),_0xb71a('0x7d'),'resolved_at',_0xb71a('0x7e'),_0xb71a('0x7f'),_0xb71a('0x61'),'work_notes',_0xb71a('0x80'),_0xb71a('0x81'),_0xb71a('0x82'),'delivery_task',_0xb71a('0x83'),_0xb71a('0x84'),'business_stc',_0xb71a('0x85'),_0xb71a('0x86'),_0xb71a('0x87'),_0xb71a('0x62'),'sys_class_name',_0xb71a('0x88'),_0xb71a('0x89'),_0xb71a('0x8a'),_0xb71a('0x8b'),'sys_id',_0xb71a('0x8c'),_0xb71a('0x8d'),'incident_state',_0xb71a('0x8e'),_0xb71a('0x8f'),'company',_0xb71a('0x90'),_0xb71a('0x91'),_0xb71a('0x92'),'severity',_0xb71a('0x93'),_0xb71a('0x94'),_0xb71a('0x95'),_0xb71a('0x96'),_0xb71a('0x97'),_0xb71a('0x98'),_0xb71a('0x99'),_0xb71a('0x9a'),_0xb71a('0x9b'),'upon_approval','correlation_id',_0xb71a('0x9c'),_0xb71a('0x64')];var _0x4158ff='';var _0x1ee5d1='';var _0xf6b137=[];var _0x1d87c2='';var _0x4c8f6a='';var _0x2a4d98=[];var _0x530ee4='';var _0x123323='';var _0x5010c2={};var _0x1c8bc3='';return db[_0xb71a('0x34')]['findOne']({'where':{'id':_0x507da4[_0xb71a('0x4c')]['id']},'attributes':['id',_0xb71a('0x9d'),_0xb71a('0x9e'),_0xb71a('0x9f'),_0xb71a('0xa0'),'serverUrl']})[_0xb71a('0x1a')](handleEntityNotFound(_0x57896d,null))[_0xb71a('0x1a')](function(_0x4be67e){if(_0x4be67e){_0x1c8bc3=_0x4be67e[_0xb71a('0xa0')];var _0x4b0866=_0x1c8bc3['slice'](-0x1);if(_0x4b0866==='/'){_0x1c8bc3=_0x1c8bc3[_0xb71a('0xa1')](0x0,_0x1c8bc3[_0xb71a('0xa2')](_0x4b0866));}_0x123323=util[_0xb71a('0xa3')]('%s/api/now/doc/table/schema/',_0x1c8bc3);_0x530ee4=util[_0xb71a('0xa3')](_0xb71a('0xa4'),_0x1c8bc3);_0x5010c2={'user':_0x4be67e[_0xb71a('0x9d')],'pass':_0x4be67e['password']};var _0x13b3a8={'method':_0xb71a('0xa5'),'uri':_0x123323+_0xb71a('0xa6'),'auth':_0x5010c2,'json':!![]};return rp(_0x13b3a8);}})[_0xb71a('0x1a')](function(_0x3d5f08){if(_0x3d5f08['result'][_0xb71a('0x3d')]>0x0){_0x4158ff=_0x3d5f08['result'];}console[_0xb71a('0xa7')](_0xb71a('0xa8'),_0x4158ff);_0x2a4d98=[];_0x1ee5d1=Object[_0xb71a('0xa9')]([],_0x4158ff);_['remove'](_0x1ee5d1,function(_0x589618){return!_0x43e4b8[_0xb71a('0xaa')](_0x589618[_0xb71a('0x31')]);});_0x1ee5d1[_0xb71a('0xab')](function(_0xe710ac){var _0xae63ed=createFieldObject(_0x530ee4,_0x5010c2,_0xe710ac[_0xb71a('0xac')],_0xe710ac[_0xb71a('0x31')],_0xe710ac[_0xb71a('0xad')],![]);_0x2a4d98[_0xb71a('0xae')](_0xae63ed);});return Promise[_0xb71a('0xaf')](_0x2a4d98);})[_0xb71a('0x1a')](function(_0x3a656f){_0xf6b137=_0x3a656f;_0x1d87c2=Object[_0xb71a('0xa9')]([],_0x4158ff);console[_0xb71a('0xa7')](_0xb71a('0xb0'),_0x4158ff);_['remove'](_0x1d87c2,function(_0x3e8e44){return _0x4edc77[_0xb71a('0xaa')](_0x3e8e44[_0xb71a('0x31')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x1d87c2);_0x2a4d98=[];_0x1d87c2['forEach'](function(_0x14f671){var _0x4981c6=createFieldObject(_0x530ee4,_0x5010c2,_0x14f671[_0xb71a('0xac')],_0x14f671[_0xb71a('0x31')],_0x14f671['label'],!![]);_0x2a4d98['push'](_0x4981c6);});return Promise[_0xb71a('0xaf')](_0x2a4d98);})[_0xb71a('0x1a')](function(_0x1d0050){_0x4c8f6a=_0x1d0050;var _0x3d6d60=_0xf6b137[_0xb71a('0xb1')](_0x4c8f6a);return{'count':_0x3d6d60[_0xb71a('0x3d')],'rows':_0x3d6d60};})[_0xb71a('0x1a')](respondWithResult(_0x57896d,null))[_0xb71a('0x25')](function(_0x336d27){console[_0xb71a('0xa7')](_0xb71a('0xb2')+_0x336d27);var _0x119d32=_0x507da4[_0xb71a('0x37')][_0xb71a('0xb3')]?0x1f4:_0x336d27[_0xb71a('0xb4')]||0x1f4;logger[_0xb71a('0x20')](_0x336d27[_0xb71a('0xb5')]);delete _0x336d27[_0xb71a('0x31')];if(_0x119d32===0x191){_0x119d32=0x190;}_0x57896d[_0xb71a('0x27')](_0x119d32)[_0xb71a('0x32')](_0x507da4[_0xb71a('0x37')][_0xb71a('0xb3')]?{'message':'Wrong\x20credentials','statusCode':_0x336d27[_0xb71a('0xb4')]}:_0x336d27);});};function createFieldObject(_0x466ab8,_0x31538a,_0x1bf5e2,_0x153b07,_0x15e4f2,_0x180c94){return new Promise(function(_0x112e34,_0x246eaa){var _0x9e3b4f={'id':_0x153b07,'name':_0x15e4f2,'custom':_0x180c94};if(_0x1bf5e2===_0xb71a('0xb6')){_0x9e3b4f[_0xb71a('0x47')]=[{'name':_0xb71a('0xb7'),'value':_0xb71a('0xb8')},{'name':_0xb71a('0xb9'),'value':_0xb71a('0xba')}];_0x112e34(_0x9e3b4f);}else{var _0x1135cb={'method':_0xb71a('0xa5'),'uri':_0x466ab8+_0xb71a('0xbb')+_0x153b07,'auth':_0x31538a,'json':!![]};return rp(_0x1135cb)[_0xb71a('0x1a')](function(_0x545326){var _0x12c453=[];if(_0x545326[_0xb71a('0x24')][_0xb71a('0x3d')]>0x0){_0x545326[_0xb71a('0x24')][_0xb71a('0xab')](function(_0x1f4dd8){if(_0x1f4dd8[_0xb71a('0xbc')]===_0xb71a('0xba')){var _0x538f8b={'name':_0x1f4dd8['label'],'value':_0x1f4dd8[_0xb71a('0xbd')]};_0x12c453[_0xb71a('0xae')](_0x538f8b);}});}_0x9e3b4f[_0xb71a('0x47')]=_0x12c453;if(_0x9e3b4f[_0xb71a('0x47')]['length']>0x0){_0x112e34(_0x9e3b4f);}else{if(_0x180c94==![]){_0x112e34();}else{_0x112e34(_0x9e3b4f);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index c1422d0..bc94e9b 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 _0xc3b5=['rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x449340,_0x2233e1){var _0x1a188d=function(_0x18c6df){while(--_0x18c6df){_0x449340['push'](_0x449340['shift']());}};_0x1a188d(++_0x2233e1);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x3ec052,_0x516e65){_0x3ec052=_0x3ec052-0x0;var _0x177582=_0xc3b5[_0x3ec052];return _0x177582;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5c3b('0x0'))(_0x5c3b('0x1'));var moment=require(_0x5c3b('0x2'));var BPromise=require(_0x5c3b('0x3'));var rp=require(_0x5c3b('0x4'));var fs=require('fs');var path=require(_0x5c3b('0x5'));var rimraf=require(_0x5c3b('0x6'));var config=require(_0x5c3b('0x7'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x5c3b('0x8'));module[_0x5c3b('0x9')]=function(_0x56345e,_0x568a28){return _0x56345e[_0x5c3b('0xa')](_0x5c3b('0xb'),attributes,{'tableName':_0x5c3b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04de=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger'];(function(_0x2504d5,_0x164348){var _0x417c41=function(_0x110f50){while(--_0x110f50){_0x2504d5['push'](_0x2504d5['shift']());}};_0x417c41(++_0x164348);}(_0x04de,0x107));var _0xe04d=function(_0x440588,_0x5dac3a){_0x440588=_0x440588-0x0;var _0xe61041=_0x04de[_0x440588];return _0xe61041;};'use strict';var _=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var logger=require(_0xe04d('0x2'))(_0xe04d('0x3'));var moment=require(_0xe04d('0x4'));var BPromise=require(_0xe04d('0x5'));var rp=require(_0xe04d('0x6'));var fs=require('fs');var path=require(_0xe04d('0x7'));var rimraf=require(_0xe04d('0x8'));var config=require(_0xe04d('0x9'));var attributes=require(_0xe04d('0xa'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4f7637,_0x531688){return _0x4f7637[_0xe04d('0xb')](_0xe04d('0xc'),attributes,{'tableName':_0xe04d('0xd'),'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 92483a8..1040939 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 _0x0811=['rpc','../../config/environment','client','http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','options','raw','where','attributes','limit','include','map','model','GetServicenowAccount','ShowServicenowAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x585a53,_0x2c2d9d){var _0x1322e3=function(_0x1f8952){while(--_0x1f8952){_0x585a53['push'](_0x585a53['shift']());}};_0x1322e3(++_0x2c2d9d);}(_0x0811,0x163));var _0x1081=function(_0x3ec122,_0x55150a){_0x3ec122=_0x3ec122-0x0;var _0x4ecf41=_0x0811[_0x3ec122];return _0x4ecf41;};'use strict';var _=require(_0x1081('0x0'));var util=require(_0x1081('0x1'));var moment=require('moment');var BPromise=require(_0x1081('0x2'));var rs=require(_0x1081('0x3'));var fs=require('fs');var Redis=require(_0x1081('0x4'));var db=require(_0x1081('0x5'))['db'];var utils=require(_0x1081('0x6'));var logger=require(_0x1081('0x7'))(_0x1081('0x8'));var config=require(_0x1081('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1081('0xa')][_0x1081('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x287b7d,_0x4bb7fb,_0x1401da){return new BPromise(function(_0xa5fa2f,_0x4a9d6e){return client['request'](_0x287b7d,_0x1401da)[_0x1081('0xc')](function(_0x272c71){logger[_0x1081('0xd')](_0x1081('0xe'),_0x4bb7fb,_0x1081('0xf'));logger[_0x1081('0x10')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x4bb7fb,_0x1081('0xf'),JSON[_0x1081('0x11')](_0x272c71));if(_0x272c71['error']){if(_0x272c71['error'][_0x1081('0x12')]===0x1f4){logger[_0x1081('0x13')](_0x1081('0xe'),_0x4bb7fb,_0x272c71['error'][_0x1081('0x14')]);return _0x4a9d6e(_0x272c71['error'][_0x1081('0x14')]);}logger[_0x1081('0x13')](_0x1081('0xe'),_0x4bb7fb,_0x272c71[_0x1081('0x13')]['message']);return _0xa5fa2f(_0x272c71[_0x1081('0x13')][_0x1081('0x14')]);}else{logger[_0x1081('0xd')](_0x1081('0xe'),_0x4bb7fb,_0x1081('0xf'));_0xa5fa2f(_0x272c71['result'][_0x1081('0x14')]);}})[_0x1081('0x15')](function(_0x1a78ec){logger[_0x1081('0x13')](_0x1081('0xe'),_0x4bb7fb,_0x1a78ec);_0x4a9d6e(_0x1a78ec);});});}exports['GetServicenowAccount']=function(_0x42b704){var _0x8d732a=this;return new Promise(function(_0x30e0ec,_0x4715b5){return db['ServicenowAccount']['findAll']({'raw':_0x42b704[_0x1081('0x16')]?_0x42b704[_0x1081('0x16')][_0x1081('0x17')]===undefined?!![]:![]:!![],'where':_0x42b704[_0x1081('0x16')]?_0x42b704[_0x1081('0x16')][_0x1081('0x18')]||null:null,'attributes':_0x42b704[_0x1081('0x16')]?_0x42b704[_0x1081('0x16')][_0x1081('0x19')]||null:null,'limit':_0x42b704[_0x1081('0x16')]?_0x42b704[_0x1081('0x16')][_0x1081('0x1a')]||null:null,'include':_0x42b704[_0x1081('0x16')]?_0x42b704[_0x1081('0x16')][_0x1081('0x1b')]?_[_0x1081('0x1c')](_0x42b704[_0x1081('0x16')][_0x1081('0x1b')],function(_0x54b062){return{'model':db[_0x54b062[_0x1081('0x1d')]],'as':_0x54b062['as'],'attributes':_0x54b062[_0x1081('0x19')],'include':_0x54b062[_0x1081('0x1b')]?_['map'](_0x54b062[_0x1081('0x1b')],function(_0x1c8c60){return{'model':db[_0x1c8c60['model']],'as':_0x1c8c60['as'],'attributes':_0x1c8c60[_0x1081('0x19')],'include':_0x1c8c60[_0x1081('0x1b')]?_[_0x1081('0x1c')](_0x1c8c60[_0x1081('0x1b')],function(_0x392508){return{'model':db[_0x392508[_0x1081('0x1d')]],'as':_0x392508['as'],'attributes':_0x392508['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x272941){logger[_0x1081('0xd')](_0x1081('0x1e'),_0x42b704);logger['debug'](_0x1081('0x1e'),_0x42b704,JSON[_0x1081('0x11')](_0x272941));_0x30e0ec(_0x272941);})[_0x1081('0x15')](function(_0x957872){logger[_0x1081('0x13')](_0x1081('0x1e'),_0x957872['message'],_0x42b704);_0x4715b5(_0x8d732a['error'](0x1f4,_0x957872[_0x1081('0x14')]));});});};exports[_0x1081('0x1f')]=function(_0x51ca8e){var _0x3d2417=this;return new Promise(function(_0x5994cb,_0x34d267){return db['ServicenowAccount'][_0x1081('0x20')]({'raw':_0x51ca8e[_0x1081('0x16')]?_0x51ca8e[_0x1081('0x16')][_0x1081('0x17')]===undefined?!![]:![]:!![],'where':_0x51ca8e[_0x1081('0x16')]?_0x51ca8e['options'][_0x1081('0x18')]||null:null,'attributes':_0x51ca8e[_0x1081('0x16')]?_0x51ca8e[_0x1081('0x16')]['attributes']||null:null,'include':_0x51ca8e[_0x1081('0x16')]?_0x51ca8e[_0x1081('0x16')][_0x1081('0x1b')]?_[_0x1081('0x1c')](_0x51ca8e[_0x1081('0x16')][_0x1081('0x1b')],function(_0x2e9990){return{'model':db[_0x2e9990[_0x1081('0x1d')]],'as':_0x2e9990['as'],'attributes':_0x2e9990['attributes'],'include':_0x2e9990[_0x1081('0x1b')]?_[_0x1081('0x1c')](_0x2e9990['include'],function(_0x1988a3){return{'model':db[_0x1988a3['model']],'as':_0x1988a3['as'],'attributes':_0x1988a3[_0x1081('0x19')],'include':_0x1988a3['include']?_[_0x1081('0x1c')](_0x1988a3['include'],function(_0x2ff141){return{'model':db[_0x2ff141[_0x1081('0x1d')]],'as':_0x2ff141['as'],'attributes':_0x2ff141[_0x1081('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a21ef){logger[_0x1081('0xd')](_0x1081('0x1f'),_0x51ca8e);logger[_0x1081('0x10')](_0x1081('0x1f'),_0x51ca8e,JSON[_0x1081('0x11')](_0x4a21ef));_0x5994cb(_0x4a21ef);})[_0x1081('0x15')](function(_0x15ffd1){logger['error'](_0x1081('0x1f'),_0x15ffd1[_0x1081('0x14')],_0x51ca8e);_0x34d267(_0x3d2417[_0x1081('0x13')](0x1f4,_0x15ffd1[_0x1081('0x14')]));});});}; \ No newline at end of file +var _0x41e1=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','attributes','map','include','model','stringify','ShowServicenowAccount','find','lodash','util'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0x41e1,0x10e));var _0x141e=function(_0x29c882,_0x25e63b){_0x29c882=_0x29c882-0x0;var _0x4d74b2=_0x41e1[_0x29c882];return _0x4d74b2;};'use strict';var _=require(_0x141e('0x0'));var util=require(_0x141e('0x1'));var moment=require(_0x141e('0x2'));var BPromise=require('bluebird');var rs=require(_0x141e('0x3'));var fs=require('fs');var Redis=require(_0x141e('0x4'));var db=require(_0x141e('0x5'))['db'];var utils=require(_0x141e('0x6'));var logger=require('../../config/logger')(_0x141e('0x7'));var config=require(_0x141e('0x8'));var jayson=require(_0x141e('0x9'));var client=jayson[_0x141e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x413220,_0x31d0dc,_0x4fd5f0){return new BPromise(function(_0x4ff001,_0x27530c){return client[_0x141e('0xb')](_0x413220,_0x4fd5f0)[_0x141e('0xc')](function(_0x110dd3){logger['info'](_0x141e('0xd'),_0x31d0dc,_0x141e('0xe'));logger[_0x141e('0xf')](_0x141e('0x10'),_0x31d0dc,_0x141e('0xe'),JSON['stringify'](_0x110dd3));if(_0x110dd3['error']){if(_0x110dd3[_0x141e('0x11')]['code']===0x1f4){logger[_0x141e('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x31d0dc,_0x110dd3['error'][_0x141e('0x12')]);return _0x27530c(_0x110dd3[_0x141e('0x11')][_0x141e('0x12')]);}logger[_0x141e('0x11')](_0x141e('0xd'),_0x31d0dc,_0x110dd3['error'][_0x141e('0x12')]);return _0x4ff001(_0x110dd3[_0x141e('0x11')][_0x141e('0x12')]);}else{logger[_0x141e('0x13')](_0x141e('0xd'),_0x31d0dc,_0x141e('0xe'));_0x4ff001(_0x110dd3[_0x141e('0x14')][_0x141e('0x12')]);}})[_0x141e('0x15')](function(_0xea24ec){logger[_0x141e('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x31d0dc,_0xea24ec);_0x27530c(_0xea24ec);});});}exports[_0x141e('0x16')]=function(_0x4b2d58){var _0x2666bf=this;return new Promise(function(_0x5ccc39,_0x1e22dd){return db[_0x141e('0x17')][_0x141e('0x18')]({'raw':_0x4b2d58[_0x141e('0x19')]?_0x4b2d58[_0x141e('0x19')][_0x141e('0x1a')]===undefined?!![]:![]:!![],'where':_0x4b2d58[_0x141e('0x19')]?_0x4b2d58['options']['where']||null:null,'attributes':_0x4b2d58[_0x141e('0x19')]?_0x4b2d58[_0x141e('0x19')][_0x141e('0x1b')]||null:null,'limit':_0x4b2d58[_0x141e('0x19')]?_0x4b2d58[_0x141e('0x19')]['limit']||null:null,'include':_0x4b2d58[_0x141e('0x19')]?_0x4b2d58[_0x141e('0x19')]['include']?_[_0x141e('0x1c')](_0x4b2d58[_0x141e('0x19')][_0x141e('0x1d')],function(_0x40b148){return{'model':db[_0x40b148[_0x141e('0x1e')]],'as':_0x40b148['as'],'attributes':_0x40b148['attributes'],'include':_0x40b148[_0x141e('0x1d')]?_['map'](_0x40b148[_0x141e('0x1d')],function(_0x2abaff){return{'model':db[_0x2abaff[_0x141e('0x1e')]],'as':_0x2abaff['as'],'attributes':_0x2abaff['attributes'],'include':_0x2abaff[_0x141e('0x1d')]?_[_0x141e('0x1c')](_0x2abaff['include'],function(_0x281c0e){return{'model':db[_0x281c0e[_0x141e('0x1e')]],'as':_0x281c0e['as'],'attributes':_0x281c0e[_0x141e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x141e('0xc')](function(_0x1cec1d){logger[_0x141e('0x13')](_0x141e('0x16'),_0x4b2d58);logger[_0x141e('0xf')]('GetServicenowAccount',_0x4b2d58,JSON[_0x141e('0x1f')](_0x1cec1d));_0x5ccc39(_0x1cec1d);})['catch'](function(_0x2892ac){logger[_0x141e('0x11')](_0x141e('0x16'),_0x2892ac[_0x141e('0x12')],_0x4b2d58);_0x1e22dd(_0x2666bf[_0x141e('0x11')](0x1f4,_0x2892ac[_0x141e('0x12')]));});});};exports[_0x141e('0x20')]=function(_0x1bb32a){var _0x3bf3bf=this;return new Promise(function(_0x5e52cd,_0x36d96a){return db[_0x141e('0x17')][_0x141e('0x21')]({'raw':_0x1bb32a[_0x141e('0x19')]?_0x1bb32a[_0x141e('0x19')][_0x141e('0x1a')]===undefined?!![]:![]:!![],'where':_0x1bb32a[_0x141e('0x19')]?_0x1bb32a['options']['where']||null:null,'attributes':_0x1bb32a['options']?_0x1bb32a[_0x141e('0x19')][_0x141e('0x1b')]||null:null,'include':_0x1bb32a['options']?_0x1bb32a[_0x141e('0x19')][_0x141e('0x1d')]?_[_0x141e('0x1c')](_0x1bb32a[_0x141e('0x19')][_0x141e('0x1d')],function(_0x3675e1){return{'model':db[_0x3675e1['model']],'as':_0x3675e1['as'],'attributes':_0x3675e1[_0x141e('0x1b')],'include':_0x3675e1[_0x141e('0x1d')]?_[_0x141e('0x1c')](_0x3675e1[_0x141e('0x1d')],function(_0x244029){return{'model':db[_0x244029[_0x141e('0x1e')]],'as':_0x244029['as'],'attributes':_0x244029[_0x141e('0x1b')],'include':_0x244029[_0x141e('0x1d')]?_[_0x141e('0x1c')](_0x244029[_0x141e('0x1d')],function(_0x15863d){return{'model':db[_0x15863d[_0x141e('0x1e')]],'as':_0x15863d['as'],'attributes':_0x15863d[_0x141e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x141e('0xc')](function(_0x34a53c){logger['info'](_0x141e('0x20'),_0x1bb32a);logger[_0x141e('0xf')](_0x141e('0x20'),_0x1bb32a,JSON['stringify'](_0x34a53c));_0x5e52cd(_0x34a53c);})[_0x141e('0x15')](function(_0x3bf8aa){logger[_0x141e('0x11')](_0x141e('0x20'),_0x3bf8aa[_0x141e('0x12')],_0x1bb32a);_0x36d96a(_0x3bf3bf[_0x141e('0x11')](0x1f4,_0x3bf8aa[_0x141e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index d5f15a6..26ebfaa 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 _0x9f84=['./intServicenowConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','create','put','/:id','update','delete','multer','util','connect-timeout','../../components/interaction/service','../../config/environment'];(function(_0x2e0a25,_0x2da7a6){var _0x359873=function(_0x47fb4b){while(--_0x47fb4b){_0x2e0a25['push'](_0x2e0a25['shift']());}};_0x359873(++_0x2da7a6);}(_0x9f84,0x12b));var _0x49f8=function(_0x2aa733,_0xcde568){_0x2aa733=_0x2aa733-0x0;var _0x2bcf85=_0x9f84[_0x2aa733];return _0x2bcf85;};'use strict';var multer=require(_0x49f8('0x0'));var util=require(_0x49f8('0x1'));var path=require('path');var timeout=require(_0x49f8('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x49f8('0x3'));var config=require(_0x49f8('0x4'));var controller=require(_0x49f8('0x5'));router[_0x49f8('0x6')]('/',auth[_0x49f8('0x7')](),controller[_0x49f8('0x8')]);router[_0x49f8('0x6')]('/:id',auth[_0x49f8('0x7')](),controller[_0x49f8('0x9')]);router[_0x49f8('0x6')](_0x49f8('0xa'),auth[_0x49f8('0x7')](),controller[_0x49f8('0xb')]);router[_0x49f8('0x6')](_0x49f8('0xc'),auth[_0x49f8('0x7')](),controller[_0x49f8('0xd')]);router[_0x49f8('0x6')]('/:id/descriptions',auth[_0x49f8('0x7')](),controller['getDescriptions']);router['post']('/',auth[_0x49f8('0x7')](),controller[_0x49f8('0xe')]);router[_0x49f8('0xf')](_0x49f8('0x10'),auth[_0x49f8('0x7')](),controller[_0x49f8('0x11')]);router[_0x49f8('0x12')](_0x49f8('0x10'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xffc6=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','/:id','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','exports','multer'];(function(_0x3e2c88,_0x591433){var _0x55655f=function(_0x46f89a){while(--_0x46f89a){_0x3e2c88['push'](_0x3e2c88['shift']());}};_0x55655f(++_0x591433);}(_0xffc6,0x110));var _0x6ffc=function(_0x3709e3,_0x3383d4){_0x3709e3=_0x3709e3-0x0;var _0x4e3e8d=_0xffc6[_0x3709e3];return _0x4e3e8d;};'use strict';var multer=require(_0x6ffc('0x0'));var util=require(_0x6ffc('0x1'));var path=require(_0x6ffc('0x2'));var timeout=require(_0x6ffc('0x3'));var express=require(_0x6ffc('0x4'));var router=express[_0x6ffc('0x5')]();var auth=require(_0x6ffc('0x6'));var interaction=require(_0x6ffc('0x7'));var config=require('../../config/environment');var controller=require(_0x6ffc('0x8'));router[_0x6ffc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6ffc('0x9')](_0x6ffc('0xa'),auth[_0x6ffc('0xb')](),controller['show']);router[_0x6ffc('0x9')]('/:id/fields',auth[_0x6ffc('0xb')](),controller['getFields']);router[_0x6ffc('0x9')](_0x6ffc('0xc'),auth['isAuthenticated'](),controller[_0x6ffc('0xd')]);router[_0x6ffc('0x9')](_0x6ffc('0xe'),auth['isAuthenticated'](),controller[_0x6ffc('0xf')]);router['post']('/',auth[_0x6ffc('0xb')](),controller[_0x6ffc('0x10')]);router[_0x6ffc('0x11')](_0x6ffc('0xa'),auth['isAuthenticated'](),controller[_0x6ffc('0x12')]);router[_0x6ffc('0x13')](_0x6ffc('0xa'),auth[_0x6ffc('0xb')](),controller['destroy']);module[_0x6ffc('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 4f06c34..57dff49 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 _0xf1f6=['exports','STRING','sequelize'];(function(_0xba6358,_0x339f9a){var _0x332e12=function(_0x4c121d){while(--_0x4c121d){_0xba6358['push'](_0xba6358['shift']());}};_0x332e12(++_0x339f9a);}(_0xf1f6,0xaa));var _0x6f1f=function(_0x2fdf12,_0x24e697){_0x2fdf12=_0x2fdf12-0x0;var _0x5386f8=_0xf1f6[_0x2fdf12];return _0x5386f8;};'use strict';var Sequelize=require(_0x6f1f('0x0'));module[_0x6f1f('0x1')]={'name':{'type':Sequelize[_0x6f1f('0x2')]},'description':{'type':Sequelize[_0x6f1f('0x2')]}}; \ No newline at end of file +var _0x86e3=['STRING','sequelize'];(function(_0x499847,_0x222ee2){var _0x3fbc7f=function(_0x413be2){while(--_0x413be2){_0x499847['push'](_0x499847['shift']());}};_0x3fbc7f(++_0x222ee2);}(_0x86e3,0x155));var _0x386e=function(_0x3c50cf,_0x98e708){_0x3c50cf=_0x3c50cf-0x0;var _0x10214a=_0x86e3[_0x3c50cf];return _0x10214a;};'use strict';var Sequelize=require(_0x386e('0x0'));module['exports']={'name':{'type':Sequelize[_0x386e('0x1')]},'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 0caa4fa..2f0ea76 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 _0x3c3a=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','destroy','stack','name','send','index','rawAttributes','model','query','keys','attributes','intersection','order','sort','filters','pick','filter','where','type','key','merge','options','count','includeAll','include','ServicenowConfiguration','findAll','rows','params','fields','length','create','body','find','getFields','hasOwnProperty','nolimit','getSubjects','ServicenowField','map','findOne','getDescriptions'];(function(_0x4a9045,_0x342830){var _0x17c0a1=function(_0x2a9874){while(--_0x2a9874){_0x4a9045['push'](_0x4a9045['shift']());}};_0x17c0a1(++_0x342830);}(_0x3c3a,0x1c7));var _0xa3c3=function(_0x42921a,_0xa0c379){_0x42921a=_0x42921a-0x0;var _0x557bfb=_0x3c3a[_0x42921a];return _0x557bfb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa3c3('0x0'));var rimraf=require(_0xa3c3('0x1'));var zipdir=require(_0xa3c3('0x2'));var jsonpatch=require(_0xa3c3('0x3'));var rp=require(_0xa3c3('0x4'));var moment=require(_0xa3c3('0x5'));var BPromise=require(_0xa3c3('0x6'));var Mustache=require(_0xa3c3('0x7'));var util=require('util');var path=require(_0xa3c3('0x8'));var sox=require(_0xa3c3('0x9'));var csv=require('to-csv');var ejs=require(_0xa3c3('0xa'));var fs=require('fs');var _=require(_0xa3c3('0xb'));var squel=require(_0xa3c3('0xc'));var crypto=require(_0xa3c3('0xd'));var jsforce=require(_0xa3c3('0xe'));var deskjs=require(_0xa3c3('0xf'));var toCsv=require(_0xa3c3('0x10'));var querystring=require('querystring');var Papa=require(_0xa3c3('0x11'));var Redis=require(_0xa3c3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa3c3('0x13'));var hardwareService=require(_0xa3c3('0x14'));var logger=require(_0xa3c3('0x15'))(_0xa3c3('0x16'));var utils=require(_0xa3c3('0x17'));var config=require(_0xa3c3('0x18'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xa3c3('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x12e71d,_0x320142,_0xc9446f){if(_0xc9446f){var _0x1bbfb3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1bbfb3[_0xa3c3('0x1a')](_0x320142)){return _0x12e71d;}else{throw new Error(_0xa3c3('0x1b'));}}else{return _0x12e71d;}}function respondWithRpcPromise(_0x3f52e2,_0x21c75a,_0x24878b,_0xbdf0f0){return new BPromise(function(_0x4ce597,_0xbb2028){var _0x5c9ec1=_0xbdf0f0||client;return _0x5c9ec1[_0xa3c3('0x1c')](_0x3f52e2,_0x24878b)[_0xa3c3('0x1d')](function(_0x14c0b7){logger[_0xa3c3('0x1e')](_0xa3c3('0x1f'),_0x21c75a,_0xa3c3('0x20'));logger['debug'](_0xa3c3('0x21'),_0x21c75a,_0xa3c3('0x20'),JSON[_0xa3c3('0x22')](_0x14c0b7));if(_0x14c0b7[_0xa3c3('0x23')]){if(_0x14c0b7[_0xa3c3('0x23')][_0xa3c3('0x24')]===0x1f4){logger[_0xa3c3('0x23')]('ServicenowConfiguration,\x20%s,\x20%s',_0x21c75a,_0x14c0b7[_0xa3c3('0x23')][_0xa3c3('0x25')]);return _0xbb2028(_0x14c0b7['error'][_0xa3c3('0x25')]);}logger[_0xa3c3('0x23')](_0xa3c3('0x1f'),_0x21c75a,_0x14c0b7['error'][_0xa3c3('0x25')]);return _0x4ce597(_0x14c0b7[_0xa3c3('0x23')][_0xa3c3('0x25')]);}else{logger[_0xa3c3('0x1e')](_0xa3c3('0x1f'),_0x21c75a,_0xa3c3('0x20'));_0x4ce597(_0x14c0b7[_0xa3c3('0x26')]['message']);}})[_0xa3c3('0x27')](function(_0x179a7c){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x21c75a,_0x179a7c);_0xbb2028(_0x179a7c);});});}function respondWithStatusCode(_0x34056b,_0x1161d2){_0x1161d2=_0x1161d2||0xcc;return function(_0x50f120){if(_0x50f120){return _0x34056b[_0xa3c3('0x28')](_0x1161d2);}return _0x34056b[_0xa3c3('0x29')](_0x1161d2)[_0xa3c3('0x2a')]();};}function respondWithResult(_0x8d4e61,_0xc3bc6d){_0xc3bc6d=_0xc3bc6d||0xc8;return function(_0x1e1c06){if(_0x1e1c06){return _0x8d4e61[_0xa3c3('0x29')](_0xc3bc6d)[_0xa3c3('0x2b')](_0x1e1c06);}};}function respondWithFilteredResult(_0x5934a8,_0xc16013){return function(_0x42796a){if(_0x42796a){var _0x2ced29=_0x42796a['count'],_0x488c62=_0xc16013['offset'],_0x26c864=_0xc16013[_0xa3c3('0x2c')]+_0xc16013[_0xa3c3('0x2d')],_0x3ba2d8;if(_0x26c864>=_0x2ced29){_0x26c864=_0x2ced29;_0x3ba2d8=0xc8;}else{_0x3ba2d8=0xce;}_0x5934a8[_0xa3c3('0x29')](_0x3ba2d8);return _0x5934a8['set'](_0xa3c3('0x2e'),_0x488c62+'-'+_0x26c864+'/'+_0x2ced29)[_0xa3c3('0x2b')](_0x42796a);}return null;};}function patchUpdates(_0x36e6fa){return function(_0x13e92e){try{jsonpatch[_0xa3c3('0x2f')](_0x13e92e,_0x36e6fa,!![]);}catch(_0x548483){return BPromise[_0xa3c3('0x30')](_0x548483);}return _0x13e92e[_0xa3c3('0x31')]();};}function saveUpdates(_0x1b3c93,_0x3a385c){return function(_0x1b6cfb){if(_0x1b6cfb){return _0x1b6cfb['update'](_0x1b3c93)[_0xa3c3('0x1d')](function(_0x396b66){return _0x396b66;});}return null;};}function removeEntity(_0x4ef7e1,_0x389ce5){return function(_0x499267){if(_0x499267){return _0x499267[_0xa3c3('0x32')]()[_0xa3c3('0x1d')](function(){_0x4ef7e1[_0xa3c3('0x29')](0xcc)[_0xa3c3('0x2a')]();});}};}function handleEntityNotFound(_0x4776b8,_0x427d57){return function(_0x493994){if(!_0x493994){_0x4776b8[_0xa3c3('0x28')](0x194);}return _0x493994;};}function handleError(_0x4b1c69,_0x1bf507){_0x1bf507=_0x1bf507||0x1f4;return function(_0x43a7bf){logger[_0xa3c3('0x23')](_0x43a7bf[_0xa3c3('0x33')]);if(_0x43a7bf[_0xa3c3('0x34')]){delete _0x43a7bf[_0xa3c3('0x34')];}_0x4b1c69[_0xa3c3('0x29')](_0x1bf507)[_0xa3c3('0x35')](_0x43a7bf);};}exports[_0xa3c3('0x36')]=function(_0x1d7d7d,_0x47bb1f){var _0x5be06a={},_0x2daf24={},_0x5be349={'count':0x0,'rows':[]};var _0x25b157=db['ServicenowConfiguration'][_0xa3c3('0x37')];_0x2daf24[_0xa3c3('0x38')]=_['keys'](_0x25b157);_0x2daf24[_0xa3c3('0x39')]=_[_0xa3c3('0x3a')](_0x1d7d7d[_0xa3c3('0x39')]);_0x2daf24['filters']=_['intersection'](_0x2daf24[_0xa3c3('0x38')],_0x2daf24[_0xa3c3('0x39')]);_0x5be06a[_0xa3c3('0x3b')]=_[_0xa3c3('0x3c')](_0x2daf24[_0xa3c3('0x38')],qs['fields'](_0x1d7d7d['query']['fields']));_0x5be06a['attributes']=_0x5be06a[_0xa3c3('0x3b')]['length']?_0x5be06a['attributes']:_0x2daf24[_0xa3c3('0x38')];if(!_0x1d7d7d[_0xa3c3('0x39')]['hasOwnProperty']('nolimit')){_0x5be06a[_0xa3c3('0x2d')]=qs[_0xa3c3('0x2d')](_0x1d7d7d[_0xa3c3('0x39')][_0xa3c3('0x2d')]);_0x5be06a[_0xa3c3('0x2c')]=qs[_0xa3c3('0x2c')](_0x1d7d7d[_0xa3c3('0x39')][_0xa3c3('0x2c')]);}_0x5be06a[_0xa3c3('0x3d')]=qs[_0xa3c3('0x3e')](_0x1d7d7d[_0xa3c3('0x39')]['sort']);_0x5be06a['where']=qs[_0xa3c3('0x3f')](_[_0xa3c3('0x40')](_0x1d7d7d[_0xa3c3('0x39')],_0x2daf24[_0xa3c3('0x3f')]));if(_0x1d7d7d[_0xa3c3('0x39')][_0xa3c3('0x41')]){_0x5be06a[_0xa3c3('0x42')]=_['merge'](_0x5be06a[_0xa3c3('0x42')],{'$or':_['map'](_0x25b157,function(_0x191919){if(_0x191919[_0xa3c3('0x43')][_0xa3c3('0x44')]!=='VIRTUAL'){var _0x9b9224={};_0x9b9224[_0x191919['field']]={'$like':'%'+_0x1d7d7d[_0xa3c3('0x39')][_0xa3c3('0x41')]+'%'};return _0x9b9224;}})});}_0x5be06a=_[_0xa3c3('0x45')]({},_0x5be06a,_0x1d7d7d[_0xa3c3('0x46')]);var _0x21c0f8={'where':_0x5be06a['where']};return db['ServicenowConfiguration']['count'](_0x21c0f8)[_0xa3c3('0x1d')](function(_0x502439){_0x5be349[_0xa3c3('0x47')]=_0x502439;if(_0x1d7d7d[_0xa3c3('0x39')][_0xa3c3('0x48')]){_0x5be06a[_0xa3c3('0x49')]=[{'all':!![]}];}return db[_0xa3c3('0x4a')][_0xa3c3('0x4b')](_0x5be06a);})[_0xa3c3('0x1d')](function(_0x4803d5){_0x5be349[_0xa3c3('0x4c')]=_0x4803d5;return _0x5be349;})[_0xa3c3('0x1d')](respondWithFilteredResult(_0x47bb1f,_0x5be06a))['catch'](handleError(_0x47bb1f,null));};exports['show']=function(_0x499b2d,_0x35abec){var _0x32d85e={'raw':![],'where':{'id':_0x499b2d[_0xa3c3('0x4d')]['id']}},_0xe38c82={};_0xe38c82[_0xa3c3('0x38')]=_[_0xa3c3('0x3a')](db[_0xa3c3('0x4a')][_0xa3c3('0x37')]);_0xe38c82['query']=_[_0xa3c3('0x3a')](_0x499b2d[_0xa3c3('0x39')]);_0xe38c82['filters']=_[_0xa3c3('0x3c')](_0xe38c82[_0xa3c3('0x38')],_0xe38c82[_0xa3c3('0x39')]);_0x32d85e[_0xa3c3('0x3b')]=_['intersection'](_0xe38c82['model'],qs['fields'](_0x499b2d[_0xa3c3('0x39')][_0xa3c3('0x4e')]));_0x32d85e['attributes']=_0x32d85e[_0xa3c3('0x3b')][_0xa3c3('0x4f')]?_0x32d85e[_0xa3c3('0x3b')]:_0xe38c82[_0xa3c3('0x38')];if(_0x499b2d[_0xa3c3('0x39')][_0xa3c3('0x48')]){_0x32d85e[_0xa3c3('0x49')]=[{'all':!![]}];}_0x32d85e=_[_0xa3c3('0x45')]({},_0x32d85e,_0x499b2d[_0xa3c3('0x46')]);return db[_0xa3c3('0x4a')]['find'](_0x32d85e)[_0xa3c3('0x1d')](handleEntityNotFound(_0x35abec,null))[_0xa3c3('0x1d')](respondWithResult(_0x35abec,null))[_0xa3c3('0x27')](handleError(_0x35abec,null));};exports['create']=function(_0x286f5c,_0xeb0875){return db[_0xa3c3('0x4a')][_0xa3c3('0x50')](_0x286f5c[_0xa3c3('0x51')],{})[_0xa3c3('0x1d')](respondWithResult(_0xeb0875,0xc9))[_0xa3c3('0x27')](handleError(_0xeb0875,null));};exports['update']=function(_0x2f6e27,_0x3320c7){if(_0x2f6e27['body']['id']){delete _0x2f6e27[_0xa3c3('0x51')]['id'];}return db[_0xa3c3('0x4a')][_0xa3c3('0x52')]({'where':{'id':_0x2f6e27['params']['id']}})[_0xa3c3('0x1d')](handleEntityNotFound(_0x3320c7,null))['then'](saveUpdates(_0x2f6e27[_0xa3c3('0x51')],null))['then'](respondWithResult(_0x3320c7,null))['catch'](handleError(_0x3320c7,null));};exports[_0xa3c3('0x32')]=function(_0x5930fa,_0x3fa109){return db[_0xa3c3('0x4a')]['find']({'where':{'id':_0x5930fa['params']['id']}})[_0xa3c3('0x1d')](handleEntityNotFound(_0x3fa109,null))[_0xa3c3('0x1d')](removeEntity(_0x3fa109,null))[_0xa3c3('0x27')](handleError(_0x3fa109,null));};exports[_0xa3c3('0x53')]=function(_0x295480,_0x21dce6,_0x1a664b){var _0x368a1f={};var _0x59ff10={};var _0x3e07af;var _0x1c3311;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x295480[_0xa3c3('0x4d')]['id']}})[_0xa3c3('0x1d')](handleEntityNotFound(_0x21dce6,null))[_0xa3c3('0x1d')](function(_0x4f2390){if(_0x4f2390){_0x3e07af=_0x4f2390;_0x59ff10['model']=_[_0xa3c3('0x3a')](db['ServicenowField'][_0xa3c3('0x37')]);_0x59ff10[_0xa3c3('0x39')]=_[_0xa3c3('0x3a')](_0x295480['query']);_0x59ff10['filters']=_[_0xa3c3('0x3c')](_0x59ff10[_0xa3c3('0x38')],_0x59ff10[_0xa3c3('0x39')]);_0x368a1f[_0xa3c3('0x3b')]=_[_0xa3c3('0x3c')](_0x59ff10[_0xa3c3('0x38')],qs['fields'](_0x295480[_0xa3c3('0x39')]['fields']));_0x368a1f['attributes']=_0x368a1f[_0xa3c3('0x3b')][_0xa3c3('0x4f')]?_0x368a1f[_0xa3c3('0x3b')]:_0x59ff10[_0xa3c3('0x38')];_0x368a1f[_0xa3c3('0x3d')]=qs['sort'](_0x295480['query'][_0xa3c3('0x3e')]);_0x368a1f[_0xa3c3('0x42')]=qs[_0xa3c3('0x3f')](_[_0xa3c3('0x40')](_0x295480[_0xa3c3('0x39')],_0x59ff10[_0xa3c3('0x3f')]));if(_0x295480[_0xa3c3('0x39')][_0xa3c3('0x41')]){_0x368a1f['where']=_[_0xa3c3('0x45')](_0x368a1f[_0xa3c3('0x42')],{'$or':_['map'](_0x368a1f[_0xa3c3('0x3b')],function(_0x374067){var _0x3a590d={};_0x3a590d[_0x374067]={'$like':'%'+_0x295480[_0xa3c3('0x39')][_0xa3c3('0x41')]+'%'};return _0x3a590d;})});}_0x368a1f=_[_0xa3c3('0x45')]({},_0x368a1f,_0x295480['options']);return _0x3e07af['getFields'](_0x368a1f);}})['then'](function(_0xeee07b){if(_0xeee07b){_0x1c3311=_0xeee07b[_0xa3c3('0x4f')];if(!_0x295480[_0xa3c3('0x39')][_0xa3c3('0x54')](_0xa3c3('0x55'))){_0x368a1f[_0xa3c3('0x2d')]=qs[_0xa3c3('0x2d')](_0x295480[_0xa3c3('0x39')][_0xa3c3('0x2d')]);_0x368a1f['offset']=qs[_0xa3c3('0x2c')](_0x295480['query']['offset']);}return _0x3e07af[_0xa3c3('0x53')](_0x368a1f);}})['then'](function(_0x2be3a9){if(_0x2be3a9){return _0x2be3a9?{'count':_0x1c3311,'rows':_0x2be3a9}:null;}})['then'](respondWithResult(_0x21dce6,null))[_0xa3c3('0x27')](handleError(_0x21dce6,null));};exports[_0xa3c3('0x56')]=function(_0x1c449a,_0x478d04,_0x5c25f4){var _0x4a843b={};var _0x1f4d74={};var _0x2f05d6;var _0x324a88;return db[_0xa3c3('0x4a')]['findOne']({'where':{'id':_0x1c449a[_0xa3c3('0x4d')]['id']}})[_0xa3c3('0x1d')](handleEntityNotFound(_0x478d04,null))[_0xa3c3('0x1d')](function(_0x391044){if(_0x391044){_0x2f05d6=_0x391044;_0x1f4d74[_0xa3c3('0x38')]=_[_0xa3c3('0x3a')](db[_0xa3c3('0x57')]['rawAttributes']);_0x1f4d74['query']=_[_0xa3c3('0x3a')](_0x1c449a[_0xa3c3('0x39')]);_0x1f4d74[_0xa3c3('0x3f')]=_[_0xa3c3('0x3c')](_0x1f4d74['model'],_0x1f4d74[_0xa3c3('0x39')]);_0x4a843b[_0xa3c3('0x3b')]=_[_0xa3c3('0x3c')](_0x1f4d74[_0xa3c3('0x38')],qs[_0xa3c3('0x4e')](_0x1c449a['query']['fields']));_0x4a843b[_0xa3c3('0x3b')]=_0x4a843b[_0xa3c3('0x3b')][_0xa3c3('0x4f')]?_0x4a843b[_0xa3c3('0x3b')]:_0x1f4d74[_0xa3c3('0x38')];_0x4a843b[_0xa3c3('0x3d')]=qs['sort'](_0x1c449a['query']['sort']);_0x4a843b[_0xa3c3('0x42')]=qs[_0xa3c3('0x3f')](_['pick'](_0x1c449a[_0xa3c3('0x39')],_0x1f4d74[_0xa3c3('0x3f')]));if(_0x1c449a[_0xa3c3('0x39')][_0xa3c3('0x41')]){_0x4a843b[_0xa3c3('0x42')]=_[_0xa3c3('0x45')](_0x4a843b[_0xa3c3('0x42')],{'$or':_[_0xa3c3('0x58')](_0x4a843b['attributes'],function(_0x2bf707){var _0x3eb62f={};_0x3eb62f[_0x2bf707]={'$like':'%'+_0x1c449a[_0xa3c3('0x39')][_0xa3c3('0x41')]+'%'};return _0x3eb62f;})});}_0x4a843b=_[_0xa3c3('0x45')]({},_0x4a843b,_0x1c449a[_0xa3c3('0x46')]);return _0x2f05d6['getSubjects'](_0x4a843b);}})[_0xa3c3('0x1d')](function(_0x2a8b38){if(_0x2a8b38){_0x324a88=_0x2a8b38[_0xa3c3('0x4f')];if(!_0x1c449a['query'][_0xa3c3('0x54')]('nolimit')){_0x4a843b[_0xa3c3('0x2d')]=qs[_0xa3c3('0x2d')](_0x1c449a[_0xa3c3('0x39')][_0xa3c3('0x2d')]);_0x4a843b[_0xa3c3('0x2c')]=qs[_0xa3c3('0x2c')](_0x1c449a[_0xa3c3('0x39')]['offset']);}return _0x2f05d6[_0xa3c3('0x56')](_0x4a843b);}})[_0xa3c3('0x1d')](function(_0x362ba9){if(_0x362ba9){return _0x362ba9?{'count':_0x324a88,'rows':_0x362ba9}:null;}})[_0xa3c3('0x1d')](respondWithResult(_0x478d04,null))['catch'](handleError(_0x478d04,null));};exports['getDescriptions']=function(_0x4bd9dc,_0x38a2ca,_0x5e1997){var _0x39d51b={};var _0x32cf16={};var _0x216447;var _0x6373b;return db[_0xa3c3('0x4a')][_0xa3c3('0x59')]({'where':{'id':_0x4bd9dc[_0xa3c3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x38a2ca,null))[_0xa3c3('0x1d')](function(_0x36a647){if(_0x36a647){_0x216447=_0x36a647;_0x32cf16[_0xa3c3('0x38')]=_[_0xa3c3('0x3a')](db[_0xa3c3('0x57')]['rawAttributes']);_0x32cf16[_0xa3c3('0x39')]=_[_0xa3c3('0x3a')](_0x4bd9dc['query']);_0x32cf16['filters']=_[_0xa3c3('0x3c')](_0x32cf16[_0xa3c3('0x38')],_0x32cf16[_0xa3c3('0x39')]);_0x39d51b[_0xa3c3('0x3b')]=_[_0xa3c3('0x3c')](_0x32cf16[_0xa3c3('0x38')],qs['fields'](_0x4bd9dc[_0xa3c3('0x39')][_0xa3c3('0x4e')]));_0x39d51b[_0xa3c3('0x3b')]=_0x39d51b['attributes'][_0xa3c3('0x4f')]?_0x39d51b['attributes']:_0x32cf16[_0xa3c3('0x38')];_0x39d51b[_0xa3c3('0x3d')]=qs[_0xa3c3('0x3e')](_0x4bd9dc[_0xa3c3('0x39')][_0xa3c3('0x3e')]);_0x39d51b[_0xa3c3('0x42')]=qs[_0xa3c3('0x3f')](_[_0xa3c3('0x40')](_0x4bd9dc[_0xa3c3('0x39')],_0x32cf16[_0xa3c3('0x3f')]));if(_0x4bd9dc[_0xa3c3('0x39')][_0xa3c3('0x41')]){_0x39d51b['where']=_[_0xa3c3('0x45')](_0x39d51b[_0xa3c3('0x42')],{'$or':_[_0xa3c3('0x58')](_0x39d51b['attributes'],function(_0x598f60){var _0x38e93e={};_0x38e93e[_0x598f60]={'$like':'%'+_0x4bd9dc['query']['filter']+'%'};return _0x38e93e;})});}_0x39d51b=_[_0xa3c3('0x45')]({},_0x39d51b,_0x4bd9dc['options']);return _0x216447['getDescriptions'](_0x39d51b);}})[_0xa3c3('0x1d')](function(_0x8a7928){if(_0x8a7928){_0x6373b=_0x8a7928[_0xa3c3('0x4f')];if(!_0x4bd9dc['query'][_0xa3c3('0x54')](_0xa3c3('0x55'))){_0x39d51b[_0xa3c3('0x2d')]=qs['limit'](_0x4bd9dc[_0xa3c3('0x39')]['limit']);_0x39d51b[_0xa3c3('0x2c')]=qs['offset'](_0x4bd9dc[_0xa3c3('0x39')][_0xa3c3('0x2c')]);}return _0x216447[_0xa3c3('0x5a')](_0x39d51b);}})[_0xa3c3('0x1d')](function(_0x3a9420){if(_0x3a9420){return _0x3a9420?{'count':_0x6373b,'rows':_0x3a9420}:null;}})[_0xa3c3('0x1d')](respondWithResult(_0x38a2ca,null))['catch'](handleError(_0x38a2ca,null));}; \ No newline at end of file +var _0x3a4b=['catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','ServicenowConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','key','VIRTUAL','field','options','includeAll','include','rows','show','find','create','body','params','findOne','getFields','hasOwnProperty','getSubjects','ServicenowField','getDescriptions','map','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowConfiguration,\x20%s,\x20%s','result'];(function(_0xd065b5,_0x5660b7){var _0x1ddb4e=function(_0x4d7d4a){while(--_0x4d7d4a){_0xd065b5['push'](_0xd065b5['shift']());}};_0x1ddb4e(++_0x5660b7);}(_0x3a4b,0xf4));var _0xb3a4=function(_0x2b6a4c,_0x19f1e6){_0x2b6a4c=_0x2b6a4c-0x0;var _0x5d3a5b=_0x3a4b[_0x2b6a4c];return _0x5d3a5b;};'use strict';var pdf=require(_0xb3a4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb3a4('0x1'));var zipdir=require(_0xb3a4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb3a4('0x3'));var moment=require(_0xb3a4('0x4'));var BPromise=require(_0xb3a4('0x5'));var Mustache=require(_0xb3a4('0x6'));var util=require(_0xb3a4('0x7'));var path=require('path');var sox=require(_0xb3a4('0x8'));var csv=require(_0xb3a4('0x9'));var ejs=require(_0xb3a4('0xa'));var fs=require('fs');var _=require(_0xb3a4('0xb'));var squel=require(_0xb3a4('0xc'));var crypto=require(_0xb3a4('0xd'));var jsforce=require(_0xb3a4('0xe'));var deskjs=require(_0xb3a4('0xf'));var toCsv=require(_0xb3a4('0x9'));var querystring=require(_0xb3a4('0x10'));var Papa=require(_0xb3a4('0x11'));var Redis=require(_0xb3a4('0x12'));var authService=require(_0xb3a4('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb3a4('0x14'));var logger=require(_0xb3a4('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xb3a4('0x16'));var db=require(_0xb3a4('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb3a4('0x18')][_0xb3a4('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5e970e,_0x527201,_0x3ac20d){if(_0x3ac20d){var _0x4f6ed0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4f6ed0[_0xb3a4('0x1a')](_0x527201)){return _0x5e970e;}else{throw new Error(_0xb3a4('0x1b'));}}else{return _0x5e970e;}}function respondWithRpcPromise(_0xf33a40,_0x447a42,_0x444310,_0x2be21d){return new BPromise(function(_0x465e9e,_0x3efef9){var _0x2ffa3d=_0x2be21d||client;return _0x2ffa3d[_0xb3a4('0x1c')](_0xf33a40,_0x444310)['then'](function(_0x3ff95f){logger[_0xb3a4('0x1d')]('ServicenowConfiguration,\x20%s,\x20%s',_0x447a42,'request\x20sent');logger['debug'](_0xb3a4('0x1e'),_0x447a42,_0xb3a4('0x1f'),JSON[_0xb3a4('0x20')](_0x3ff95f));if(_0x3ff95f['error']){if(_0x3ff95f[_0xb3a4('0x21')][_0xb3a4('0x22')]===0x1f4){logger[_0xb3a4('0x21')]('ServicenowConfiguration,\x20%s,\x20%s',_0x447a42,_0x3ff95f[_0xb3a4('0x21')][_0xb3a4('0x23')]);return _0x3efef9(_0x3ff95f['error'][_0xb3a4('0x23')]);}logger['error'](_0xb3a4('0x24'),_0x447a42,_0x3ff95f[_0xb3a4('0x21')]['message']);return _0x465e9e(_0x3ff95f[_0xb3a4('0x21')][_0xb3a4('0x23')]);}else{logger['info'](_0xb3a4('0x24'),_0x447a42,_0xb3a4('0x1f'));_0x465e9e(_0x3ff95f[_0xb3a4('0x25')][_0xb3a4('0x23')]);}})[_0xb3a4('0x26')](function(_0x30743a){logger[_0xb3a4('0x21')](_0xb3a4('0x24'),_0x447a42,_0x30743a);_0x3efef9(_0x30743a);});});}function respondWithStatusCode(_0x2cd516,_0x47d2fc){_0x47d2fc=_0x47d2fc||0xcc;return function(_0x535fdd){if(_0x535fdd){return _0x2cd516[_0xb3a4('0x27')](_0x47d2fc);}return _0x2cd516[_0xb3a4('0x28')](_0x47d2fc)[_0xb3a4('0x29')]();};}function respondWithResult(_0x544ca3,_0x2078e5){_0x2078e5=_0x2078e5||0xc8;return function(_0x181ead){if(_0x181ead){return _0x544ca3[_0xb3a4('0x28')](_0x2078e5)[_0xb3a4('0x2a')](_0x181ead);}};}function respondWithFilteredResult(_0x2d0042,_0x4b1e37){return function(_0x5ce64b){if(_0x5ce64b){var _0x4287d2=_0x5ce64b[_0xb3a4('0x2b')],_0x110e77=_0x4b1e37[_0xb3a4('0x2c')],_0x2189be=_0x4b1e37[_0xb3a4('0x2c')]+_0x4b1e37[_0xb3a4('0x2d')],_0xce9410;if(_0x2189be>=_0x4287d2){_0x2189be=_0x4287d2;_0xce9410=0xc8;}else{_0xce9410=0xce;}_0x2d0042[_0xb3a4('0x28')](_0xce9410);return _0x2d0042[_0xb3a4('0x2e')](_0xb3a4('0x2f'),_0x110e77+'-'+_0x2189be+'/'+_0x4287d2)['json'](_0x5ce64b);}return null;};}function patchUpdates(_0xa166d0){return function(_0x2d2e54){try{jsonpatch[_0xb3a4('0x30')](_0x2d2e54,_0xa166d0,!![]);}catch(_0x10a9b7){return BPromise[_0xb3a4('0x31')](_0x10a9b7);}return _0x2d2e54[_0xb3a4('0x32')]();};}function saveUpdates(_0x385f71,_0x3422a3){return function(_0x58d7e3){if(_0x58d7e3){return _0x58d7e3[_0xb3a4('0x33')](_0x385f71)[_0xb3a4('0x34')](function(_0x143d9d){return _0x143d9d;});}return null;};}function removeEntity(_0x4432c5,_0x8795e3){return function(_0x4567de){if(_0x4567de){return _0x4567de[_0xb3a4('0x35')]()['then'](function(){_0x4432c5[_0xb3a4('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x309c75,_0x220929){return function(_0x17b449){if(!_0x17b449){_0x309c75[_0xb3a4('0x27')](0x194);}return _0x17b449;};}function handleError(_0x2f1836,_0xa2c878){_0xa2c878=_0xa2c878||0x1f4;return function(_0x57a2d3){logger['error'](_0x57a2d3[_0xb3a4('0x36')]);if(_0x57a2d3[_0xb3a4('0x37')]){delete _0x57a2d3['name'];}_0x2f1836['status'](_0xa2c878)[_0xb3a4('0x38')](_0x57a2d3);};}exports[_0xb3a4('0x39')]=function(_0x3d215a,_0x14a003){var _0x5e3620={},_0x5247d3={},_0x819e7b={'count':0x0,'rows':[]};var _0x4f2fdf=db[_0xb3a4('0x3a')][_0xb3a4('0x3b')];_0x5247d3[_0xb3a4('0x3c')]=_[_0xb3a4('0x3d')](_0x4f2fdf);_0x5247d3['query']=_[_0xb3a4('0x3d')](_0x3d215a[_0xb3a4('0x3e')]);_0x5247d3[_0xb3a4('0x3f')]=_[_0xb3a4('0x40')](_0x5247d3['model'],_0x5247d3[_0xb3a4('0x3e')]);_0x5e3620[_0xb3a4('0x41')]=_[_0xb3a4('0x40')](_0x5247d3['model'],qs['fields'](_0x3d215a[_0xb3a4('0x3e')][_0xb3a4('0x42')]));_0x5e3620['attributes']=_0x5e3620[_0xb3a4('0x41')][_0xb3a4('0x43')]?_0x5e3620[_0xb3a4('0x41')]:_0x5247d3[_0xb3a4('0x3c')];if(!_0x3d215a[_0xb3a4('0x3e')]['hasOwnProperty'](_0xb3a4('0x44'))){_0x5e3620[_0xb3a4('0x2d')]=qs[_0xb3a4('0x2d')](_0x3d215a[_0xb3a4('0x3e')][_0xb3a4('0x2d')]);_0x5e3620[_0xb3a4('0x2c')]=qs[_0xb3a4('0x2c')](_0x3d215a[_0xb3a4('0x3e')][_0xb3a4('0x2c')]);}_0x5e3620[_0xb3a4('0x45')]=qs[_0xb3a4('0x46')](_0x3d215a[_0xb3a4('0x3e')][_0xb3a4('0x46')]);_0x5e3620['where']=qs[_0xb3a4('0x3f')](_[_0xb3a4('0x47')](_0x3d215a[_0xb3a4('0x3e')],_0x5247d3['filters']));if(_0x3d215a[_0xb3a4('0x3e')][_0xb3a4('0x48')]){_0x5e3620[_0xb3a4('0x49')]=_[_0xb3a4('0x4a')](_0x5e3620[_0xb3a4('0x49')],{'$or':_['map'](_0x4f2fdf,function(_0x21f0f7){if(_0x21f0f7['type'][_0xb3a4('0x4b')]!==_0xb3a4('0x4c')){var _0x3d744b={};_0x3d744b[_0x21f0f7[_0xb3a4('0x4d')]]={'$like':'%'+_0x3d215a[_0xb3a4('0x3e')][_0xb3a4('0x48')]+'%'};return _0x3d744b;}})});}_0x5e3620=_[_0xb3a4('0x4a')]({},_0x5e3620,_0x3d215a[_0xb3a4('0x4e')]);var _0x4fe0c4={'where':_0x5e3620[_0xb3a4('0x49')]};return db['ServicenowConfiguration'][_0xb3a4('0x2b')](_0x4fe0c4)[_0xb3a4('0x34')](function(_0x426a6e){_0x819e7b[_0xb3a4('0x2b')]=_0x426a6e;if(_0x3d215a['query'][_0xb3a4('0x4f')]){_0x5e3620[_0xb3a4('0x50')]=[{'all':!![]}];}return db[_0xb3a4('0x3a')]['findAll'](_0x5e3620);})[_0xb3a4('0x34')](function(_0x1a7166){_0x819e7b[_0xb3a4('0x51')]=_0x1a7166;return _0x819e7b;})['then'](respondWithFilteredResult(_0x14a003,_0x5e3620))['catch'](handleError(_0x14a003,null));};exports[_0xb3a4('0x52')]=function(_0x27dad0,_0x865ace){var _0x4f1bdf={'raw':![],'where':{'id':_0x27dad0['params']['id']}},_0x144efc={};_0x144efc[_0xb3a4('0x3c')]=_[_0xb3a4('0x3d')](db[_0xb3a4('0x3a')][_0xb3a4('0x3b')]);_0x144efc[_0xb3a4('0x3e')]=_[_0xb3a4('0x3d')](_0x27dad0[_0xb3a4('0x3e')]);_0x144efc[_0xb3a4('0x3f')]=_['intersection'](_0x144efc[_0xb3a4('0x3c')],_0x144efc[_0xb3a4('0x3e')]);_0x4f1bdf[_0xb3a4('0x41')]=_[_0xb3a4('0x40')](_0x144efc['model'],qs[_0xb3a4('0x42')](_0x27dad0[_0xb3a4('0x3e')][_0xb3a4('0x42')]));_0x4f1bdf[_0xb3a4('0x41')]=_0x4f1bdf[_0xb3a4('0x41')]['length']?_0x4f1bdf[_0xb3a4('0x41')]:_0x144efc['model'];if(_0x27dad0[_0xb3a4('0x3e')][_0xb3a4('0x4f')]){_0x4f1bdf[_0xb3a4('0x50')]=[{'all':!![]}];}_0x4f1bdf=_['merge']({},_0x4f1bdf,_0x27dad0[_0xb3a4('0x4e')]);return db['ServicenowConfiguration'][_0xb3a4('0x53')](_0x4f1bdf)[_0xb3a4('0x34')](handleEntityNotFound(_0x865ace,null))[_0xb3a4('0x34')](respondWithResult(_0x865ace,null))[_0xb3a4('0x26')](handleError(_0x865ace,null));};exports['create']=function(_0x203e08,_0x14af14){return db[_0xb3a4('0x3a')][_0xb3a4('0x54')](_0x203e08[_0xb3a4('0x55')],{})[_0xb3a4('0x34')](respondWithResult(_0x14af14,0xc9))['catch'](handleError(_0x14af14,null));};exports[_0xb3a4('0x33')]=function(_0x4eda82,_0x4ce5f3){if(_0x4eda82[_0xb3a4('0x55')]['id']){delete _0x4eda82[_0xb3a4('0x55')]['id'];}return db[_0xb3a4('0x3a')][_0xb3a4('0x53')]({'where':{'id':_0x4eda82[_0xb3a4('0x56')]['id']}})['then'](handleEntityNotFound(_0x4ce5f3,null))['then'](saveUpdates(_0x4eda82['body'],null))[_0xb3a4('0x34')](respondWithResult(_0x4ce5f3,null))[_0xb3a4('0x26')](handleError(_0x4ce5f3,null));};exports['destroy']=function(_0x49656c,_0x478357){return db[_0xb3a4('0x3a')][_0xb3a4('0x53')]({'where':{'id':_0x49656c[_0xb3a4('0x56')]['id']}})[_0xb3a4('0x34')](handleEntityNotFound(_0x478357,null))[_0xb3a4('0x34')](removeEntity(_0x478357,null))[_0xb3a4('0x26')](handleError(_0x478357,null));};exports['getFields']=function(_0x3932a9,_0x56884e,_0x265305){var _0x580cd8={};var _0x3734cd={};var _0x58d3d8;var _0x3135cb;return db[_0xb3a4('0x3a')][_0xb3a4('0x57')]({'where':{'id':_0x3932a9[_0xb3a4('0x56')]['id']}})['then'](handleEntityNotFound(_0x56884e,null))[_0xb3a4('0x34')](function(_0xfe043b){if(_0xfe043b){_0x58d3d8=_0xfe043b;_0x3734cd['model']=_[_0xb3a4('0x3d')](db['ServicenowField'][_0xb3a4('0x3b')]);_0x3734cd[_0xb3a4('0x3e')]=_[_0xb3a4('0x3d')](_0x3932a9['query']);_0x3734cd[_0xb3a4('0x3f')]=_[_0xb3a4('0x40')](_0x3734cd[_0xb3a4('0x3c')],_0x3734cd[_0xb3a4('0x3e')]);_0x580cd8[_0xb3a4('0x41')]=_['intersection'](_0x3734cd[_0xb3a4('0x3c')],qs[_0xb3a4('0x42')](_0x3932a9['query'][_0xb3a4('0x42')]));_0x580cd8[_0xb3a4('0x41')]=_0x580cd8['attributes'][_0xb3a4('0x43')]?_0x580cd8['attributes']:_0x3734cd['model'];_0x580cd8[_0xb3a4('0x45')]=qs[_0xb3a4('0x46')](_0x3932a9[_0xb3a4('0x3e')][_0xb3a4('0x46')]);_0x580cd8[_0xb3a4('0x49')]=qs['filters'](_[_0xb3a4('0x47')](_0x3932a9[_0xb3a4('0x3e')],_0x3734cd[_0xb3a4('0x3f')]));if(_0x3932a9[_0xb3a4('0x3e')][_0xb3a4('0x48')]){_0x580cd8[_0xb3a4('0x49')]=_[_0xb3a4('0x4a')](_0x580cd8[_0xb3a4('0x49')],{'$or':_['map'](_0x580cd8[_0xb3a4('0x41')],function(_0x2755ff){var _0x55f29f={};_0x55f29f[_0x2755ff]={'$like':'%'+_0x3932a9[_0xb3a4('0x3e')]['filter']+'%'};return _0x55f29f;})});}_0x580cd8=_[_0xb3a4('0x4a')]({},_0x580cd8,_0x3932a9[_0xb3a4('0x4e')]);return _0x58d3d8[_0xb3a4('0x58')](_0x580cd8);}})[_0xb3a4('0x34')](function(_0x3db503){if(_0x3db503){_0x3135cb=_0x3db503[_0xb3a4('0x43')];if(!_0x3932a9[_0xb3a4('0x3e')][_0xb3a4('0x59')](_0xb3a4('0x44'))){_0x580cd8[_0xb3a4('0x2d')]=qs[_0xb3a4('0x2d')](_0x3932a9['query'][_0xb3a4('0x2d')]);_0x580cd8['offset']=qs[_0xb3a4('0x2c')](_0x3932a9['query']['offset']);}return _0x58d3d8['getFields'](_0x580cd8);}})[_0xb3a4('0x34')](function(_0x216ffc){if(_0x216ffc){return _0x216ffc?{'count':_0x3135cb,'rows':_0x216ffc}:null;}})['then'](respondWithResult(_0x56884e,null))['catch'](handleError(_0x56884e,null));};exports[_0xb3a4('0x5a')]=function(_0x2ce61a,_0xe23c62,_0x165438){var _0x505db8={};var _0x35f017={};var _0x4c0265;var _0x34b654;return db[_0xb3a4('0x3a')][_0xb3a4('0x57')]({'where':{'id':_0x2ce61a[_0xb3a4('0x56')]['id']}})['then'](handleEntityNotFound(_0xe23c62,null))[_0xb3a4('0x34')](function(_0xabf213){if(_0xabf213){_0x4c0265=_0xabf213;_0x35f017[_0xb3a4('0x3c')]=_[_0xb3a4('0x3d')](db[_0xb3a4('0x5b')]['rawAttributes']);_0x35f017[_0xb3a4('0x3e')]=_[_0xb3a4('0x3d')](_0x2ce61a['query']);_0x35f017[_0xb3a4('0x3f')]=_[_0xb3a4('0x40')](_0x35f017[_0xb3a4('0x3c')],_0x35f017[_0xb3a4('0x3e')]);_0x505db8['attributes']=_[_0xb3a4('0x40')](_0x35f017[_0xb3a4('0x3c')],qs[_0xb3a4('0x42')](_0x2ce61a[_0xb3a4('0x3e')][_0xb3a4('0x42')]));_0x505db8[_0xb3a4('0x41')]=_0x505db8[_0xb3a4('0x41')][_0xb3a4('0x43')]?_0x505db8[_0xb3a4('0x41')]:_0x35f017[_0xb3a4('0x3c')];_0x505db8['order']=qs[_0xb3a4('0x46')](_0x2ce61a['query'][_0xb3a4('0x46')]);_0x505db8[_0xb3a4('0x49')]=qs[_0xb3a4('0x3f')](_[_0xb3a4('0x47')](_0x2ce61a[_0xb3a4('0x3e')],_0x35f017['filters']));if(_0x2ce61a[_0xb3a4('0x3e')][_0xb3a4('0x48')]){_0x505db8[_0xb3a4('0x49')]=_[_0xb3a4('0x4a')](_0x505db8['where'],{'$or':_['map'](_0x505db8[_0xb3a4('0x41')],function(_0x2aadef){var _0x288dcc={};_0x288dcc[_0x2aadef]={'$like':'%'+_0x2ce61a[_0xb3a4('0x3e')][_0xb3a4('0x48')]+'%'};return _0x288dcc;})});}_0x505db8=_[_0xb3a4('0x4a')]({},_0x505db8,_0x2ce61a['options']);return _0x4c0265[_0xb3a4('0x5a')](_0x505db8);}})[_0xb3a4('0x34')](function(_0x363674){if(_0x363674){_0x34b654=_0x363674[_0xb3a4('0x43')];if(!_0x2ce61a['query'][_0xb3a4('0x59')](_0xb3a4('0x44'))){_0x505db8['limit']=qs[_0xb3a4('0x2d')](_0x2ce61a['query'][_0xb3a4('0x2d')]);_0x505db8[_0xb3a4('0x2c')]=qs['offset'](_0x2ce61a[_0xb3a4('0x3e')]['offset']);}return _0x4c0265[_0xb3a4('0x5a')](_0x505db8);}})[_0xb3a4('0x34')](function(_0x46176a){if(_0x46176a){return _0x46176a?{'count':_0x34b654,'rows':_0x46176a}:null;}})['then'](respondWithResult(_0xe23c62,null))[_0xb3a4('0x26')](handleError(_0xe23c62,null));};exports[_0xb3a4('0x5c')]=function(_0x429e31,_0x5b008a,_0x27d38b){var _0x340dc4={};var _0x423f34={};var _0x2335e1;var _0x5e2943;return db['ServicenowConfiguration'][_0xb3a4('0x57')]({'where':{'id':_0x429e31[_0xb3a4('0x56')]['id']}})[_0xb3a4('0x34')](handleEntityNotFound(_0x5b008a,null))[_0xb3a4('0x34')](function(_0x2e2ea1){if(_0x2e2ea1){_0x2335e1=_0x2e2ea1;_0x423f34['model']=_['keys'](db[_0xb3a4('0x5b')]['rawAttributes']);_0x423f34[_0xb3a4('0x3e')]=_[_0xb3a4('0x3d')](_0x429e31[_0xb3a4('0x3e')]);_0x423f34[_0xb3a4('0x3f')]=_[_0xb3a4('0x40')](_0x423f34[_0xb3a4('0x3c')],_0x423f34['query']);_0x340dc4[_0xb3a4('0x41')]=_['intersection'](_0x423f34[_0xb3a4('0x3c')],qs[_0xb3a4('0x42')](_0x429e31['query'][_0xb3a4('0x42')]));_0x340dc4[_0xb3a4('0x41')]=_0x340dc4['attributes'][_0xb3a4('0x43')]?_0x340dc4[_0xb3a4('0x41')]:_0x423f34[_0xb3a4('0x3c')];_0x340dc4[_0xb3a4('0x45')]=qs['sort'](_0x429e31[_0xb3a4('0x3e')][_0xb3a4('0x46')]);_0x340dc4['where']=qs[_0xb3a4('0x3f')](_['pick'](_0x429e31[_0xb3a4('0x3e')],_0x423f34[_0xb3a4('0x3f')]));if(_0x429e31['query']['filter']){_0x340dc4['where']=_[_0xb3a4('0x4a')](_0x340dc4[_0xb3a4('0x49')],{'$or':_[_0xb3a4('0x5d')](_0x340dc4[_0xb3a4('0x41')],function(_0x3103dc){var _0x464e99={};_0x464e99[_0x3103dc]={'$like':'%'+_0x429e31['query'][_0xb3a4('0x48')]+'%'};return _0x464e99;})});}_0x340dc4=_['merge']({},_0x340dc4,_0x429e31[_0xb3a4('0x4e')]);return _0x2335e1[_0xb3a4('0x5c')](_0x340dc4);}})[_0xb3a4('0x34')](function(_0x485ae6){if(_0x485ae6){_0x5e2943=_0x485ae6[_0xb3a4('0x43')];if(!_0x429e31['query'][_0xb3a4('0x59')](_0xb3a4('0x44'))){_0x340dc4[_0xb3a4('0x2d')]=qs[_0xb3a4('0x2d')](_0x429e31['query'][_0xb3a4('0x2d')]);_0x340dc4[_0xb3a4('0x2c')]=qs[_0xb3a4('0x2c')](_0x429e31[_0xb3a4('0x3e')][_0xb3a4('0x2c')]);}return _0x2335e1[_0xb3a4('0x5c')](_0x340dc4);}})['then'](function(_0x2e5972){if(_0x2e5972){return _0x2e5972?{'count':_0x5e2943,'rows':_0x2e5972}:null;}})[_0xb3a4('0x34')](respondWithResult(_0x5b008a,null))[_0xb3a4('0x26')](handleError(_0x5b008a,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 3464332..4c2ce2c 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 _0x39f8=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowConfiguration','int_servicenow_configurations','util','../../config/logger','api'];(function(_0x523d79,_0x158546){var _0x5dfe1f=function(_0x4535ef){while(--_0x4535ef){_0x523d79['push'](_0x523d79['shift']());}};_0x5dfe1f(++_0x158546);}(_0x39f8,0xa5));var _0x839f=function(_0x19eb76,_0x47fec3){_0x19eb76=_0x19eb76-0x0;var _0x49e394=_0x39f8[_0x19eb76];return _0x49e394;};'use strict';var _=require('lodash');var util=require(_0x839f('0x0'));var logger=require(_0x839f('0x1'))(_0x839f('0x2'));var moment=require('moment');var BPromise=require(_0x839f('0x3'));var rp=require(_0x839f('0x4'));var fs=require('fs');var path=require(_0x839f('0x5'));var rimraf=require(_0x839f('0x6'));var config=require(_0x839f('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x839f('0x8')]=function(_0x34549f,_0x5d1b33){return _0x34549f[_0x839f('0x9')](_0x839f('0xa'),attributes,{'tableName':_0x839f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4aa1=['define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x4aa1,0x18b));var _0x14aa=function(_0x261361,_0x3bdc66){_0x261361=_0x261361-0x0;var _0x208c1b=_0x4aa1[_0x261361];return _0x208c1b;};'use strict';var _=require(_0x14aa('0x0'));var util=require(_0x14aa('0x1'));var logger=require(_0x14aa('0x2'))(_0x14aa('0x3'));var moment=require(_0x14aa('0x4'));var BPromise=require(_0x14aa('0x5'));var rp=require(_0x14aa('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x14aa('0x7'));var config=require(_0x14aa('0x8'));var attributes=require(_0x14aa('0x9'));module[_0x14aa('0xa')]=function(_0x1f547f,_0x259944){return _0x1f547f[_0x14aa('0xb')](_0x14aa('0xc'),attributes,{'tableName':_0x14aa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index d3801bb..518d1fd 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 _0xf04c=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ServicenowConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x2378a0,_0x5a6191){var _0xe5c45e=function(_0x33800f){while(--_0x33800f){_0x2378a0['push'](_0x2378a0['shift']());}};_0xe5c45e(++_0x5a6191);}(_0xf04c,0x1cd));var _0xcf04=function(_0x4d4e57,_0x48d5a7){_0x4d4e57=_0x4d4e57-0x0;var _0x2a2e56=_0xf04c[_0x4d4e57];return _0x2a2e56;};'use strict';var _=require(_0xcf04('0x0'));var util=require('util');var moment=require(_0xcf04('0x1'));var BPromise=require(_0xcf04('0x2'));var rs=require(_0xcf04('0x3'));var fs=require('fs');var Redis=require(_0xcf04('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf04('0x5'));var logger=require('../../config/logger')(_0xcf04('0x6'));var config=require(_0xcf04('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcf04('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fac7a,_0x366975,_0x5d5dd9){return new BPromise(function(_0x4b4991,_0x22d0f6){return client[_0xcf04('0x9')](_0x2fac7a,_0x5d5dd9)[_0xcf04('0xa')](function(_0x1a93af){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x366975,_0xcf04('0xb'));logger[_0xcf04('0xc')](_0xcf04('0xd'),_0x366975,_0xcf04('0xb'),JSON[_0xcf04('0xe')](_0x1a93af));if(_0x1a93af['error']){if(_0x1a93af[_0xcf04('0xf')]['code']===0x1f4){logger[_0xcf04('0xf')](_0xcf04('0x10'),_0x366975,_0x1a93af[_0xcf04('0xf')][_0xcf04('0x11')]);return _0x22d0f6(_0x1a93af[_0xcf04('0xf')]['message']);}logger[_0xcf04('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x366975,_0x1a93af[_0xcf04('0xf')]['message']);return _0x4b4991(_0x1a93af[_0xcf04('0xf')]['message']);}else{logger[_0xcf04('0x12')](_0xcf04('0x10'),_0x366975,_0xcf04('0xb'));_0x4b4991(_0x1a93af[_0xcf04('0x13')][_0xcf04('0x11')]);}})[_0xcf04('0x14')](function(_0x2c172b){logger[_0xcf04('0xf')](_0xcf04('0x10'),_0x366975,_0x2c172b);_0x22d0f6(_0x2c172b);});});} \ No newline at end of file +var _0x5318=['jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4b6703,_0x497f22){var _0x4e7595=function(_0x29e554){while(--_0x29e554){_0x4b6703['push'](_0x4b6703['shift']());}};_0x4e7595(++_0x497f22);}(_0x5318,0x10b));var _0x8531=function(_0x4496d4,_0x35a23c){_0x4496d4=_0x4496d4-0x0;var _0x549149=_0x5318[_0x4496d4];return _0x549149;};'use strict';var _=require(_0x8531('0x0'));var util=require(_0x8531('0x1'));var moment=require(_0x8531('0x2'));var BPromise=require(_0x8531('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8531('0x4'))['db'];var utils=require(_0x8531('0x5'));var logger=require(_0x8531('0x6'))(_0x8531('0x7'));var config=require(_0x8531('0x8'));var jayson=require(_0x8531('0x9'));var client=jayson[_0x8531('0xa')][_0x8531('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44d947,_0x5232ed,_0x14209c){return new BPromise(function(_0x57756b,_0x51f8eb){return client[_0x8531('0xc')](_0x44d947,_0x14209c)[_0x8531('0xd')](function(_0x42ae44){logger[_0x8531('0xe')](_0x8531('0xf'),_0x5232ed,_0x8531('0x10'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x5232ed,'request\x20sent',JSON[_0x8531('0x11')](_0x42ae44));if(_0x42ae44['error']){if(_0x42ae44[_0x8531('0x12')][_0x8531('0x13')]===0x1f4){logger[_0x8531('0x12')](_0x8531('0xf'),_0x5232ed,_0x42ae44[_0x8531('0x12')]['message']);return _0x51f8eb(_0x42ae44[_0x8531('0x12')][_0x8531('0x14')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x5232ed,_0x42ae44[_0x8531('0x12')]['message']);return _0x57756b(_0x42ae44[_0x8531('0x12')][_0x8531('0x14')]);}else{logger[_0x8531('0xe')](_0x8531('0xf'),_0x5232ed,_0x8531('0x10'));_0x57756b(_0x42ae44[_0x8531('0x15')][_0x8531('0x14')]);}})[_0x8531('0x16')](function(_0x3a3e96){logger[_0x8531('0x12')](_0x8531('0xf'),_0x5232ed,_0x3a3e96);_0x51f8eb(_0x3a3e96);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 3259cf4..2cfc19b 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 _0x4f97=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x34bcc3,_0x424db0){var _0x297051=function(_0x3adb21){while(--_0x3adb21){_0x34bcc3['push'](_0x34bcc3['shift']());}};_0x297051(++_0x424db0);}(_0x4f97,0xf5));var _0x74f9=function(_0x69ac1b,_0x524d4c){_0x69ac1b=_0x69ac1b-0x0;var _0x3c9698=_0x4f97[_0x69ac1b];return _0x3c9698;};'use strict';var multer=require(_0x74f9('0x0'));var util=require(_0x74f9('0x1'));var path=require(_0x74f9('0x2'));var timeout=require(_0x74f9('0x3'));var express=require(_0x74f9('0x4'));var router=express[_0x74f9('0x5')]();var auth=require(_0x74f9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x74f9('0x7'));var controller=require(_0x74f9('0x8'));router[_0x74f9('0x9')]('/',auth['isAuthenticated'](),controller[_0x74f9('0xa')]);router[_0x74f9('0x9')](_0x74f9('0xb'),auth[_0x74f9('0xc')](),controller[_0x74f9('0xd')]);router[_0x74f9('0xe')]('/',auth[_0x74f9('0xc')](),controller[_0x74f9('0xf')]);router['put']('/:id',auth[_0x74f9('0xc')](),controller[_0x74f9('0x10')]);router[_0x74f9('0x11')]('/:id',auth[_0x74f9('0xc')](),controller[_0x74f9('0x12')]);module[_0x74f9('0x13')]=router; \ No newline at end of file +var _0x22bc=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','/:id'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x22bc,0x126));var _0xc22b=function(_0x3a537a,_0x3276fe){_0x3a537a=_0x3a537a-0x0;var _0x1df6e7=_0x22bc[_0x3a537a];return _0x1df6e7;};'use strict';var multer=require('multer');var util=require(_0xc22b('0x0'));var path=require(_0xc22b('0x1'));var timeout=require(_0xc22b('0x2'));var express=require('express');var router=express[_0xc22b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xc22b('0x4'));var config=require(_0xc22b('0x5'));var controller=require(_0xc22b('0x6'));router[_0xc22b('0x7')]('/',auth['isAuthenticated'](),controller[_0xc22b('0x8')]);router[_0xc22b('0x7')](_0xc22b('0x9'),auth[_0xc22b('0xa')](),controller[_0xc22b('0xb')]);router[_0xc22b('0xc')]('/',auth[_0xc22b('0xa')](),controller[_0xc22b('0xd')]);router[_0xc22b('0xe')](_0xc22b('0x9'),auth[_0xc22b('0xa')](),controller[_0xc22b('0xf')]);router[_0xc22b('0x10')](_0xc22b('0x9'),auth[_0xc22b('0xa')](),controller[_0xc22b('0x11')]);module[_0xc22b('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 0e32855..d79f31e 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 _0xfcd6=['sequelize','ENUM','string','keyValue','STRING','variable','customVariable','BOOLEAN'];(function(_0x58fad2,_0xb39887){var _0x49f947=function(_0x1b22c2){while(--_0x1b22c2){_0x58fad2['push'](_0x58fad2['shift']());}};_0x49f947(++_0xb39887);}(_0xfcd6,0x1d8));var _0x6fcd=function(_0x11df5a,_0xd0e0b7){_0x11df5a=_0x11df5a-0x0;var _0x492524=_0xfcd6[_0x11df5a];return _0x492524;};'use strict';var Sequelize=require(_0x6fcd('0x0'));module['exports']={'type':{'type':Sequelize[_0x6fcd('0x1')](_0x6fcd('0x2'),'variable','customVariable',_0x6fcd('0x3')),'defaultValue':_0x6fcd('0x2')},'content':{'type':Sequelize[_0x6fcd('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6fcd('0x1')](_0x6fcd('0x2'),_0x6fcd('0x5'),_0x6fcd('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6fcd('0x4')]},'nameField':{'type':Sequelize[_0x6fcd('0x4')]},'customField':{'type':Sequelize[_0x6fcd('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6fcd('0x4')]}}; \ No newline at end of file +var _0x011f=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x34e0e9,_0x1f54fe){var _0x59a61b=function(_0x40fe75){while(--_0x40fe75){_0x34e0e9['push'](_0x34e0e9['shift']());}};_0x59a61b(++_0x1f54fe);}(_0x011f,0x11f));var _0xf011=function(_0x2002b3,_0x11e91c){_0x2002b3=_0x2002b3-0x0;var _0x2756f0=_0x011f[_0x2002b3];return _0x2756f0;};'use strict';var Sequelize=require(_0xf011('0x0'));module[_0xf011('0x1')]={'type':{'type':Sequelize[_0xf011('0x2')](_0xf011('0x3'),_0xf011('0x4'),_0xf011('0x5'),_0xf011('0x6')),'defaultValue':_0xf011('0x3')},'content':{'type':Sequelize[_0xf011('0x7')]},'key':{'type':Sequelize[_0xf011('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0xf011('0x4'),_0xf011('0x5'))},'keyContent':{'type':Sequelize[_0xf011('0x7')]},'idField':{'type':Sequelize[_0xf011('0x7')]},'nameField':{'type':Sequelize[_0xf011('0x7')]},'customField':{'type':Sequelize[_0xf011('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf011('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 32ad9ee..25dcc9d 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 _0xc1e6=['catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','field','options','ServicenowField','count','includeAll','include','findAll','rows','show','find','create','body','params'];(function(_0xbc5e53,_0x5c06ae){var _0x56b9a8=function(_0xece28d){while(--_0xece28d){_0xbc5e53['push'](_0xbc5e53['shift']());}};_0x56b9a8(++_0x5c06ae);}(_0xc1e6,0x125));var _0x6c1e=function(_0x3d8d87,_0x59bdaf){_0x3d8d87=_0x3d8d87-0x0;var _0x3a5a29=_0xc1e6[_0x3d8d87];return _0x3a5a29;};'use strict';var pdf=require(_0x6c1e('0x0'));var emlformat=require(_0x6c1e('0x1'));var rimraf=require(_0x6c1e('0x2'));var zipdir=require(_0x6c1e('0x3'));var jsonpatch=require(_0x6c1e('0x4'));var rp=require(_0x6c1e('0x5'));var moment=require(_0x6c1e('0x6'));var BPromise=require(_0x6c1e('0x7'));var Mustache=require(_0x6c1e('0x8'));var util=require('util');var path=require('path');var sox=require(_0x6c1e('0x9'));var csv=require(_0x6c1e('0xa'));var ejs=require(_0x6c1e('0xb'));var fs=require('fs');var _=require(_0x6c1e('0xc'));var squel=require(_0x6c1e('0xd'));var crypto=require(_0x6c1e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6c1e('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6c1e('0x10'));var authService=require(_0x6c1e('0x11'));var qs=require(_0x6c1e('0x12'));var hardwareService=require(_0x6c1e('0x13'));var logger=require(_0x6c1e('0x14'))(_0x6c1e('0x15'));var utils=require(_0x6c1e('0x16'));var config=require('../../config/environment');var db=require(_0x6c1e('0x17'))['db'];function respondWithStatusCode(_0x546e56,_0x2718d7){_0x2718d7=_0x2718d7||0xcc;return function(_0x3ae2a0){if(_0x3ae2a0){return _0x546e56['sendStatus'](_0x2718d7);}return _0x546e56[_0x6c1e('0x18')](_0x2718d7)[_0x6c1e('0x19')]();};}function respondWithResult(_0x5c5243,_0x17283e){_0x17283e=_0x17283e||0xc8;return function(_0x53d18a){if(_0x53d18a){return _0x5c5243[_0x6c1e('0x18')](_0x17283e)['json'](_0x53d18a);}};}function respondWithFilteredResult(_0x5425dc,_0x24f9a0){return function(_0x3066c9){if(_0x3066c9){var _0x11ac95=_0x3066c9['count'],_0x35e960=_0x24f9a0[_0x6c1e('0x1a')],_0x1f60e7=_0x24f9a0['offset']+_0x24f9a0[_0x6c1e('0x1b')],_0x498d62;if(_0x1f60e7>=_0x11ac95){_0x1f60e7=_0x11ac95;_0x498d62=0xc8;}else{_0x498d62=0xce;}_0x5425dc[_0x6c1e('0x18')](_0x498d62);return _0x5425dc[_0x6c1e('0x1c')](_0x6c1e('0x1d'),_0x35e960+'-'+_0x1f60e7+'/'+_0x11ac95)['json'](_0x3066c9);}return null;};}function patchUpdates(_0x47c432){return function(_0x5ee245){try{jsonpatch[_0x6c1e('0x1e')](_0x5ee245,_0x47c432,!![]);}catch(_0x33582d){return BPromise[_0x6c1e('0x1f')](_0x33582d);}return _0x5ee245[_0x6c1e('0x20')]();};}function saveUpdates(_0xcb980e,_0x4b704a){return function(_0x41f51d){if(_0x41f51d){return _0x41f51d[_0x6c1e('0x21')](_0xcb980e)[_0x6c1e('0x22')](function(_0x3c0215){return _0x3c0215;});}return null;};}function removeEntity(_0x2474d5,_0x4f6d78){return function(_0x514b64){if(_0x514b64){return _0x514b64['destroy']()[_0x6c1e('0x22')](function(){_0x2474d5[_0x6c1e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12703b,_0x1c2bb6){return function(_0x3a5cc1){if(!_0x3a5cc1){_0x12703b[_0x6c1e('0x23')](0x194);}return _0x3a5cc1;};}function handleError(_0x1cb9da,_0x55bca7){_0x55bca7=_0x55bca7||0x1f4;return function(_0x16fc73){logger[_0x6c1e('0x24')](_0x16fc73['stack']);if(_0x16fc73[_0x6c1e('0x25')]){delete _0x16fc73['name'];}_0x1cb9da[_0x6c1e('0x18')](_0x55bca7)[_0x6c1e('0x26')](_0x16fc73);};}exports[_0x6c1e('0x27')]=function(_0x21ca8a,_0x1b6f20){var _0x5097c4={},_0x56235f={},_0xa97d35={'count':0x0,'rows':[]};var _0x4b7475=db['ServicenowField'][_0x6c1e('0x28')];_0x56235f[_0x6c1e('0x29')]=_[_0x6c1e('0x2a')](_0x4b7475);_0x56235f['query']=_[_0x6c1e('0x2a')](_0x21ca8a[_0x6c1e('0x2b')]);_0x56235f['filters']=_[_0x6c1e('0x2c')](_0x56235f['model'],_0x56235f[_0x6c1e('0x2b')]);_0x5097c4[_0x6c1e('0x2d')]=_[_0x6c1e('0x2c')](_0x56235f['model'],qs[_0x6c1e('0x2e')](_0x21ca8a[_0x6c1e('0x2b')][_0x6c1e('0x2e')]));_0x5097c4[_0x6c1e('0x2d')]=_0x5097c4[_0x6c1e('0x2d')][_0x6c1e('0x2f')]?_0x5097c4['attributes']:_0x56235f['model'];if(!_0x21ca8a[_0x6c1e('0x2b')][_0x6c1e('0x30')](_0x6c1e('0x31'))){_0x5097c4[_0x6c1e('0x1b')]=qs['limit'](_0x21ca8a[_0x6c1e('0x2b')][_0x6c1e('0x1b')]);_0x5097c4[_0x6c1e('0x1a')]=qs[_0x6c1e('0x1a')](_0x21ca8a[_0x6c1e('0x2b')]['offset']);}_0x5097c4[_0x6c1e('0x32')]=qs[_0x6c1e('0x33')](_0x21ca8a[_0x6c1e('0x2b')][_0x6c1e('0x33')]);_0x5097c4[_0x6c1e('0x34')]=qs[_0x6c1e('0x35')](_[_0x6c1e('0x36')](_0x21ca8a[_0x6c1e('0x2b')],_0x56235f[_0x6c1e('0x35')]));if(_0x21ca8a['query'][_0x6c1e('0x37')]){_0x5097c4['where']=_[_0x6c1e('0x38')](_0x5097c4[_0x6c1e('0x34')],{'$or':_['map'](_0x4b7475,function(_0x415329){if(_0x415329[_0x6c1e('0x39')]['key']!==_0x6c1e('0x3a')){var _0x1c0f40={};_0x1c0f40[_0x415329[_0x6c1e('0x3b')]]={'$like':'%'+_0x21ca8a[_0x6c1e('0x2b')][_0x6c1e('0x37')]+'%'};return _0x1c0f40;}})});}_0x5097c4=_[_0x6c1e('0x38')]({},_0x5097c4,_0x21ca8a[_0x6c1e('0x3c')]);var _0x1a5fd7={'where':_0x5097c4[_0x6c1e('0x34')]};return db[_0x6c1e('0x3d')][_0x6c1e('0x3e')](_0x1a5fd7)[_0x6c1e('0x22')](function(_0x323532){_0xa97d35['count']=_0x323532;if(_0x21ca8a[_0x6c1e('0x2b')][_0x6c1e('0x3f')]){_0x5097c4[_0x6c1e('0x40')]=[{'all':!![]}];}return db['ServicenowField'][_0x6c1e('0x41')](_0x5097c4);})['then'](function(_0x1f5cf1){_0xa97d35[_0x6c1e('0x42')]=_0x1f5cf1;return _0xa97d35;})[_0x6c1e('0x22')](respondWithFilteredResult(_0x1b6f20,_0x5097c4))['catch'](handleError(_0x1b6f20,null));};exports[_0x6c1e('0x43')]=function(_0x3d3a7f,_0x13e661){var _0x22761f={'raw':!![],'where':{'id':_0x3d3a7f['params']['id']}},_0x54a650={};_0x54a650[_0x6c1e('0x29')]=_[_0x6c1e('0x2a')](db['ServicenowField'][_0x6c1e('0x28')]);_0x54a650['query']=_[_0x6c1e('0x2a')](_0x3d3a7f[_0x6c1e('0x2b')]);_0x54a650['filters']=_[_0x6c1e('0x2c')](_0x54a650[_0x6c1e('0x29')],_0x54a650[_0x6c1e('0x2b')]);_0x22761f[_0x6c1e('0x2d')]=_[_0x6c1e('0x2c')](_0x54a650[_0x6c1e('0x29')],qs['fields'](_0x3d3a7f[_0x6c1e('0x2b')][_0x6c1e('0x2e')]));_0x22761f[_0x6c1e('0x2d')]=_0x22761f[_0x6c1e('0x2d')]['length']?_0x22761f['attributes']:_0x54a650['model'];if(_0x3d3a7f[_0x6c1e('0x2b')][_0x6c1e('0x3f')]){_0x22761f[_0x6c1e('0x40')]=[{'all':!![]}];}_0x22761f=_[_0x6c1e('0x38')]({},_0x22761f,_0x3d3a7f['options']);return db[_0x6c1e('0x3d')][_0x6c1e('0x44')](_0x22761f)[_0x6c1e('0x22')](handleEntityNotFound(_0x13e661,null))[_0x6c1e('0x22')](respondWithResult(_0x13e661,null))['catch'](handleError(_0x13e661,null));};exports[_0x6c1e('0x45')]=function(_0x4c6dc6,_0x5b5fc1){return db['ServicenowField'][_0x6c1e('0x45')](_0x4c6dc6[_0x6c1e('0x46')],{})[_0x6c1e('0x22')](respondWithResult(_0x5b5fc1,0xc9))['catch'](handleError(_0x5b5fc1,null));};exports['update']=function(_0x4e3c76,_0x1fccda){if(_0x4e3c76[_0x6c1e('0x46')]['id']){delete _0x4e3c76[_0x6c1e('0x46')]['id'];}return db[_0x6c1e('0x3d')][_0x6c1e('0x44')]({'where':{'id':_0x4e3c76[_0x6c1e('0x47')]['id']}})[_0x6c1e('0x22')](handleEntityNotFound(_0x1fccda,null))[_0x6c1e('0x22')](saveUpdates(_0x4e3c76[_0x6c1e('0x46')],null))[_0x6c1e('0x22')](respondWithResult(_0x1fccda,null))[_0x6c1e('0x48')](handleError(_0x1fccda,null));};exports['destroy']=function(_0x45b513,_0xaf8163){return db[_0x6c1e('0x3d')][_0x6c1e('0x44')]({'where':{'id':_0x45b513[_0x6c1e('0x47')]['id']}})[_0x6c1e('0x22')](handleEntityNotFound(_0xaf8163,null))[_0x6c1e('0x22')](removeEntity(_0xaf8163,null))[_0x6c1e('0x48')](handleError(_0xaf8163,null));}; \ No newline at end of file +var _0x05ed=['sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','error','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','merge','ServicenowField','includeAll','include','rows','catch','show','params','length','options','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0xab9f3d,_0xb336fa){var _0x5283bf=function(_0x505e6c){while(--_0x505e6c){_0xab9f3d['push'](_0xab9f3d['shift']());}};_0x5283bf(++_0xb336fa);}(_0x05ed,0xc0));var _0xd05e=function(_0x3a6d3e,_0x4f0ac5){_0x3a6d3e=_0x3a6d3e-0x0;var _0x735896=_0x05ed[_0x3a6d3e];return _0x735896;};'use strict';var pdf=require(_0xd05e('0x0'));var emlformat=require(_0xd05e('0x1'));var rimraf=require(_0xd05e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd05e('0x3'));var rp=require(_0xd05e('0x4'));var moment=require(_0xd05e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd05e('0x6'));var path=require(_0xd05e('0x7'));var sox=require(_0xd05e('0x8'));var csv=require('to-csv');var ejs=require(_0xd05e('0x9'));var fs=require('fs');var _=require(_0xd05e('0xa'));var squel=require(_0xd05e('0xb'));var crypto=require(_0xd05e('0xc'));var jsforce=require(_0xd05e('0xd'));var deskjs=require(_0xd05e('0xe'));var toCsv=require(_0xd05e('0xf'));var querystring=require(_0xd05e('0x10'));var Papa=require(_0xd05e('0x11'));var Redis=require('ioredis');var authService=require(_0xd05e('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd05e('0x13'));var logger=require(_0xd05e('0x14'))('api');var utils=require(_0xd05e('0x15'));var config=require(_0xd05e('0x16'));var db=require(_0xd05e('0x17'))['db'];function respondWithStatusCode(_0x1638a6,_0xfe7443){_0xfe7443=_0xfe7443||0xcc;return function(_0x248916){if(_0x248916){return _0x1638a6[_0xd05e('0x18')](_0xfe7443);}return _0x1638a6['status'](_0xfe7443)['end']();};}function respondWithResult(_0x1ecca5,_0x5690bd){_0x5690bd=_0x5690bd||0xc8;return function(_0x28ce27){if(_0x28ce27){return _0x1ecca5[_0xd05e('0x19')](_0x5690bd)[_0xd05e('0x1a')](_0x28ce27);}};}function respondWithFilteredResult(_0x422438,_0x537482){return function(_0x4df850){if(_0x4df850){var _0x5d11a7=_0x4df850[_0xd05e('0x1b')],_0x416ce3=_0x537482[_0xd05e('0x1c')],_0x591224=_0x537482[_0xd05e('0x1c')]+_0x537482[_0xd05e('0x1d')],_0x1b2642;if(_0x591224>=_0x5d11a7){_0x591224=_0x5d11a7;_0x1b2642=0xc8;}else{_0x1b2642=0xce;}_0x422438[_0xd05e('0x19')](_0x1b2642);return _0x422438[_0xd05e('0x1e')](_0xd05e('0x1f'),_0x416ce3+'-'+_0x591224+'/'+_0x5d11a7)[_0xd05e('0x1a')](_0x4df850);}return null;};}function patchUpdates(_0x40d378){return function(_0x2ad5db){try{jsonpatch[_0xd05e('0x20')](_0x2ad5db,_0x40d378,!![]);}catch(_0x142b5a){return BPromise['reject'](_0x142b5a);}return _0x2ad5db[_0xd05e('0x21')]();};}function saveUpdates(_0x5073d0,_0x5d99a3){return function(_0x22b1c6){if(_0x22b1c6){return _0x22b1c6[_0xd05e('0x22')](_0x5073d0)['then'](function(_0x1379aa){return _0x1379aa;});}return null;};}function removeEntity(_0x2cf902,_0x208f65){return function(_0x163dd8){if(_0x163dd8){return _0x163dd8[_0xd05e('0x23')]()[_0xd05e('0x24')](function(){_0x2cf902[_0xd05e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x460916,_0x26fc8d){return function(_0x4a7301){if(!_0x4a7301){_0x460916[_0xd05e('0x18')](0x194);}return _0x4a7301;};}function handleError(_0x137888,_0x387f61){_0x387f61=_0x387f61||0x1f4;return function(_0x1a5ebd){logger[_0xd05e('0x25')](_0x1a5ebd['stack']);if(_0x1a5ebd[_0xd05e('0x26')]){delete _0x1a5ebd[_0xd05e('0x26')];}_0x137888[_0xd05e('0x19')](_0x387f61)[_0xd05e('0x27')](_0x1a5ebd);};}exports[_0xd05e('0x28')]=function(_0x2a36aa,_0x548b30){var _0x5a1ae4={},_0x33b2b9={},_0x464dce={'count':0x0,'rows':[]};var _0x503662=db['ServicenowField'][_0xd05e('0x29')];_0x33b2b9[_0xd05e('0x2a')]=_[_0xd05e('0x2b')](_0x503662);_0x33b2b9[_0xd05e('0x2c')]=_[_0xd05e('0x2b')](_0x2a36aa[_0xd05e('0x2c')]);_0x33b2b9[_0xd05e('0x2d')]=_[_0xd05e('0x2e')](_0x33b2b9[_0xd05e('0x2a')],_0x33b2b9[_0xd05e('0x2c')]);_0x5a1ae4[_0xd05e('0x2f')]=_[_0xd05e('0x2e')](_0x33b2b9[_0xd05e('0x2a')],qs[_0xd05e('0x30')](_0x2a36aa[_0xd05e('0x2c')][_0xd05e('0x30')]));_0x5a1ae4[_0xd05e('0x2f')]=_0x5a1ae4[_0xd05e('0x2f')]['length']?_0x5a1ae4['attributes']:_0x33b2b9[_0xd05e('0x2a')];if(!_0x2a36aa[_0xd05e('0x2c')][_0xd05e('0x31')](_0xd05e('0x32'))){_0x5a1ae4[_0xd05e('0x1d')]=qs[_0xd05e('0x1d')](_0x2a36aa['query'][_0xd05e('0x1d')]);_0x5a1ae4['offset']=qs[_0xd05e('0x1c')](_0x2a36aa[_0xd05e('0x2c')]['offset']);}_0x5a1ae4[_0xd05e('0x33')]=qs[_0xd05e('0x34')](_0x2a36aa[_0xd05e('0x2c')][_0xd05e('0x34')]);_0x5a1ae4[_0xd05e('0x35')]=qs[_0xd05e('0x2d')](_['pick'](_0x2a36aa[_0xd05e('0x2c')],_0x33b2b9[_0xd05e('0x2d')]));if(_0x2a36aa[_0xd05e('0x2c')][_0xd05e('0x36')]){_0x5a1ae4['where']=_['merge'](_0x5a1ae4[_0xd05e('0x35')],{'$or':_['map'](_0x503662,function(_0x8beff0){if(_0x8beff0[_0xd05e('0x37')][_0xd05e('0x38')]!==_0xd05e('0x39')){var _0x1eeda7={};_0x1eeda7[_0x8beff0[_0xd05e('0x3a')]]={'$like':'%'+_0x2a36aa[_0xd05e('0x2c')]['filter']+'%'};return _0x1eeda7;}})});}_0x5a1ae4=_[_0xd05e('0x3b')]({},_0x5a1ae4,_0x2a36aa['options']);var _0x3e2803={'where':_0x5a1ae4[_0xd05e('0x35')]};return db[_0xd05e('0x3c')][_0xd05e('0x1b')](_0x3e2803)[_0xd05e('0x24')](function(_0x3f9550){_0x464dce[_0xd05e('0x1b')]=_0x3f9550;if(_0x2a36aa[_0xd05e('0x2c')][_0xd05e('0x3d')]){_0x5a1ae4[_0xd05e('0x3e')]=[{'all':!![]}];}return db[_0xd05e('0x3c')]['findAll'](_0x5a1ae4);})['then'](function(_0x12275a){_0x464dce[_0xd05e('0x3f')]=_0x12275a;return _0x464dce;})[_0xd05e('0x24')](respondWithFilteredResult(_0x548b30,_0x5a1ae4))[_0xd05e('0x40')](handleError(_0x548b30,null));};exports[_0xd05e('0x41')]=function(_0xae4d0d,_0x150069){var _0x500e48={'raw':!![],'where':{'id':_0xae4d0d[_0xd05e('0x42')]['id']}},_0x343cb4={};_0x343cb4[_0xd05e('0x2a')]=_[_0xd05e('0x2b')](db[_0xd05e('0x3c')][_0xd05e('0x29')]);_0x343cb4[_0xd05e('0x2c')]=_[_0xd05e('0x2b')](_0xae4d0d[_0xd05e('0x2c')]);_0x343cb4[_0xd05e('0x2d')]=_[_0xd05e('0x2e')](_0x343cb4[_0xd05e('0x2a')],_0x343cb4[_0xd05e('0x2c')]);_0x500e48[_0xd05e('0x2f')]=_['intersection'](_0x343cb4[_0xd05e('0x2a')],qs[_0xd05e('0x30')](_0xae4d0d[_0xd05e('0x2c')][_0xd05e('0x30')]));_0x500e48['attributes']=_0x500e48[_0xd05e('0x2f')][_0xd05e('0x43')]?_0x500e48[_0xd05e('0x2f')]:_0x343cb4['model'];if(_0xae4d0d[_0xd05e('0x2c')][_0xd05e('0x3d')]){_0x500e48[_0xd05e('0x3e')]=[{'all':!![]}];}_0x500e48=_['merge']({},_0x500e48,_0xae4d0d[_0xd05e('0x44')]);return db[_0xd05e('0x3c')][_0xd05e('0x45')](_0x500e48)[_0xd05e('0x24')](handleEntityNotFound(_0x150069,null))[_0xd05e('0x24')](respondWithResult(_0x150069,null))[_0xd05e('0x40')](handleError(_0x150069,null));};exports[_0xd05e('0x46')]=function(_0x2ebf0b,_0x49a757){return db['ServicenowField'][_0xd05e('0x46')](_0x2ebf0b[_0xd05e('0x47')],{})[_0xd05e('0x24')](respondWithResult(_0x49a757,0xc9))[_0xd05e('0x40')](handleError(_0x49a757,null));};exports[_0xd05e('0x22')]=function(_0x57f70d,_0x4f4f7d){if(_0x57f70d['body']['id']){delete _0x57f70d[_0xd05e('0x47')]['id'];}return db['ServicenowField'][_0xd05e('0x45')]({'where':{'id':_0x57f70d[_0xd05e('0x42')]['id']}})[_0xd05e('0x24')](handleEntityNotFound(_0x4f4f7d,null))[_0xd05e('0x24')](saveUpdates(_0x57f70d[_0xd05e('0x47')],null))[_0xd05e('0x24')](respondWithResult(_0x4f4f7d,null))[_0xd05e('0x40')](handleError(_0x4f4f7d,null));};exports[_0xd05e('0x23')]=function(_0x3ce047,_0x3e8759){return db[_0xd05e('0x3c')]['find']({'where':{'id':_0x3ce047['params']['id']}})[_0xd05e('0x24')](handleEntityNotFound(_0x3e8759,null))[_0xd05e('0x24')](removeEntity(_0x3e8759,null))[_0xd05e('0x40')](handleError(_0x3e8759,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index cae8ba1..453c501 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 _0x95bf=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','servicenow_unique_index','idField'];(function(_0x352f92,_0x282fe0){var _0xd2cd62=function(_0x1e9f9d){while(--_0x1e9f9d){_0x352f92['push'](_0x352f92['shift']());}};_0xd2cd62(++_0x282fe0);}(_0x95bf,0x1a5));var _0xf95b=function(_0xb1ae86,_0x1b7c95){_0xb1ae86=_0xb1ae86-0x0;var _0x2fc7e8=_0x95bf[_0xb1ae86];return _0x2fc7e8;};'use strict';var _=require(_0xf95b('0x0'));var util=require(_0xf95b('0x1'));var logger=require(_0xf95b('0x2'))(_0xf95b('0x3'));var moment=require(_0xf95b('0x4'));var BPromise=require(_0xf95b('0x5'));var rp=require(_0xf95b('0x6'));var fs=require('fs');var path=require(_0xf95b('0x7'));var rimraf=require(_0xf95b('0x8'));var config=require(_0xf95b('0x9'));var attributes=require('./intServicenowField.attributes');module[_0xf95b('0xa')]=function(_0x3e385d,_0x1cb8a9){return _0x3e385d[_0xf95b('0xb')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xf95b('0xc'),'fields':[_0xf95b('0xd'),_0xf95b('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7c79=['request-promise','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','api','moment','bluebird'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0x7c79,0x135));var _0x97c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c79[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x97c7('0x0'));var moment=require(_0x97c7('0x1'));var BPromise=require(_0x97c7('0x2'));var rp=require(_0x97c7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x97c7('0x4'));var config=require(_0x97c7('0x5'));var attributes=require(_0x97c7('0x6'));module[_0x97c7('0x7')]=function(_0x30f6ed,_0xe3d4e8){return _0x30f6ed[_0x97c7('0x8')](_0x97c7('0x9'),attributes,{'tableName':_0x97c7('0xa'),'paranoid':![],'indexes':[{'name':_0x97c7('0xb'),'fields':[_0x97c7('0xc'),'FieldId'],'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 5e0154b..eef5cec 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 _0x1cf0=['catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x33bddd,_0x45d05b){var _0x38d64d=function(_0x4b402d){while(--_0x4b402d){_0x33bddd['push'](_0x33bddd['shift']());}};_0x38d64d(++_0x45d05b);}(_0x1cf0,0x1cd));var _0x01cf=function(_0x344adc,_0x183c37){_0x344adc=_0x344adc-0x0;var _0x4014b2=_0x1cf0[_0x344adc];return _0x4014b2;};'use strict';var _=require('lodash');var util=require(_0x01cf('0x0'));var moment=require(_0x01cf('0x1'));var BPromise=require(_0x01cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x01cf('0x3'));var db=require(_0x01cf('0x4'))['db'];var utils=require(_0x01cf('0x5'));var logger=require(_0x01cf('0x6'))('rpc');var config=require(_0x01cf('0x7'));var jayson=require(_0x01cf('0x8'));var client=jayson['client'][_0x01cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33f7fe,_0x374fda,_0x2fca53){return new BPromise(function(_0x220dd0,_0x17ae7f){return client['request'](_0x33f7fe,_0x2fca53)[_0x01cf('0xa')](function(_0x3d999c){logger[_0x01cf('0xb')](_0x01cf('0xc'),_0x374fda,_0x01cf('0xd'));logger[_0x01cf('0xe')](_0x01cf('0xf'),_0x374fda,_0x01cf('0xd'),JSON[_0x01cf('0x10')](_0x3d999c));if(_0x3d999c[_0x01cf('0x11')]){if(_0x3d999c['error']['code']===0x1f4){logger['error']('ServicenowField,\x20%s,\x20%s',_0x374fda,_0x3d999c[_0x01cf('0x11')][_0x01cf('0x12')]);return _0x17ae7f(_0x3d999c[_0x01cf('0x11')][_0x01cf('0x12')]);}logger[_0x01cf('0x11')](_0x01cf('0xc'),_0x374fda,_0x3d999c[_0x01cf('0x11')]['message']);return _0x220dd0(_0x3d999c[_0x01cf('0x11')][_0x01cf('0x12')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x374fda,'request\x20sent');_0x220dd0(_0x3d999c['result'][_0x01cf('0x12')]);}})[_0x01cf('0x13')](function(_0x5abf55){logger['error'](_0x01cf('0xc'),_0x374fda,_0x5abf55);_0x17ae7f(_0x5abf55);});});} \ No newline at end of file +var _0x43c5=['debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','ServicenowField,\x20%s,\x20%s','message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x3c30ff,_0x266bef){var _0x3ce280=function(_0x3eed01){while(--_0x3eed01){_0x3c30ff['push'](_0x3c30ff['shift']());}};_0x3ce280(++_0x266bef);}(_0x43c5,0x75));var _0x543c=function(_0x392335,_0x2983aa){_0x392335=_0x392335-0x0;var _0x4b97fc=_0x43c5[_0x392335];return _0x4b97fc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x543c('0x0'));var BPromise=require('bluebird');var rs=require(_0x543c('0x1'));var fs=require('fs');var Redis=require(_0x543c('0x2'));var db=require(_0x543c('0x3'))['db'];var utils=require(_0x543c('0x4'));var logger=require(_0x543c('0x5'))(_0x543c('0x6'));var config=require(_0x543c('0x7'));var jayson=require(_0x543c('0x8'));var client=jayson[_0x543c('0x9')][_0x543c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3366e3,_0x2aaf43,_0x44d667){return new BPromise(function(_0xba2b1f,_0x3f72c6){return client[_0x543c('0xb')](_0x3366e3,_0x44d667)[_0x543c('0xc')](function(_0x41735e){logger[_0x543c('0xd')]('ServicenowField,\x20%s,\x20%s',_0x2aaf43,_0x543c('0xe'));logger[_0x543c('0xf')](_0x543c('0x10'),_0x2aaf43,'request\x20sent',JSON[_0x543c('0x11')](_0x41735e));if(_0x41735e[_0x543c('0x12')]){if(_0x41735e['error']['code']===0x1f4){logger['error'](_0x543c('0x13'),_0x2aaf43,_0x41735e[_0x543c('0x12')][_0x543c('0x14')]);return _0x3f72c6(_0x41735e[_0x543c('0x12')][_0x543c('0x14')]);}logger[_0x543c('0x12')](_0x543c('0x13'),_0x2aaf43,_0x41735e[_0x543c('0x12')][_0x543c('0x14')]);return _0xba2b1f(_0x41735e[_0x543c('0x12')]['message']);}else{logger[_0x543c('0xd')](_0x543c('0x13'),_0x2aaf43,'request\x20sent');_0xba2b1f(_0x41735e[_0x543c('0x15')]['message']);}})['catch'](function(_0x26639e){logger[_0x543c('0x12')]('ServicenowField,\x20%s,\x20%s',_0x2aaf43,_0x26639e);_0x3f72c6(_0x26639e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 59791f7..8549c11 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 _0xd506=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','create','post','put','update','delete','destroy'];(function(_0x34577f,_0x4ea440){var _0x2d500d=function(_0x214129){while(--_0x214129){_0x34577f['push'](_0x34577f['shift']());}};_0x2d500d(++_0x4ea440);}(_0xd506,0x11f));var _0x6d50=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xd506[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0x6d50('0x0'));var util=require(_0x6d50('0x1'));var path=require(_0x6d50('0x2'));var timeout=require(_0x6d50('0x3'));var express=require(_0x6d50('0x4'));var router=express[_0x6d50('0x5')]();var auth=require(_0x6d50('0x6'));var interaction=require(_0x6d50('0x7'));var config=require(_0x6d50('0x8'));var controller=require('./intSugarcrmAccount.controller');router[_0x6d50('0x9')]('/',auth[_0x6d50('0xa')](),controller['index']);router[_0x6d50('0x9')](_0x6d50('0xb'),auth[_0x6d50('0xa')](),controller[_0x6d50('0xc')]);router[_0x6d50('0x9')](_0x6d50('0xd'),auth['isAuthenticated'](),controller[_0x6d50('0xe')]);router[_0x6d50('0x9')]('/:id/fields',auth[_0x6d50('0xa')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x6d50('0xf')]);router[_0x6d50('0x10')](_0x6d50('0xd'),auth[_0x6d50('0xa')](),controller['addConfiguration']);router[_0x6d50('0x11')]('/:id',auth[_0x6d50('0xa')](),controller[_0x6d50('0x12')]);router[_0x6d50('0x13')]('/:id',auth[_0x6d50('0xa')](),controller[_0x6d50('0x14')]);module[_0x6d50('0x15')]=router; \ No newline at end of file +var _0x003c=['get','isAuthenticated','index','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller'];(function(_0x566dd6,_0x3ccf8d){var _0x285d15=function(_0x16234b){while(--_0x16234b){_0x566dd6['push'](_0x566dd6['shift']());}};_0x285d15(++_0x3ccf8d);}(_0x003c,0x160));var _0xc003=function(_0x3db503,_0x3ab705){_0x3db503=_0x3db503-0x0;var _0x5ee278=_0x003c[_0x3db503];return _0x5ee278;};'use strict';var multer=require(_0xc003('0x0'));var util=require(_0xc003('0x1'));var path=require(_0xc003('0x2'));var timeout=require('connect-timeout');var express=require(_0xc003('0x3'));var router=express[_0xc003('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc003('0x5'));var config=require(_0xc003('0x6'));var controller=require(_0xc003('0x7'));router[_0xc003('0x8')]('/',auth[_0xc003('0x9')](),controller[_0xc003('0xa')]);router['get']('/:id',auth[_0xc003('0x9')](),controller[_0xc003('0xb')]);router[_0xc003('0x8')]('/:id/configurations',auth[_0xc003('0x9')](),controller[_0xc003('0xc')]);router[_0xc003('0x8')](_0xc003('0xd'),auth['isAuthenticated'](),controller[_0xc003('0xe')]);router[_0xc003('0xf')]('/',auth[_0xc003('0x9')](),controller[_0xc003('0x10')]);router[_0xc003('0xf')]('/:id/configurations',auth[_0xc003('0x9')](),controller[_0xc003('0x11')]);router[_0xc003('0x12')](_0xc003('0x13'),auth[_0xc003('0x9')](),controller[_0xc003('0x14')]);router[_0xc003('0x15')](_0xc003('0x13'),auth[_0xc003('0x9')](),controller[_0xc003('0x16')]);module[_0xc003('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 e118030..9444b79 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 _0xba1e=['sequelize','exports','STRING','username','remoteUri'];(function(_0x3903ef,_0x30063f){var _0x5a340b=function(_0x14ef71){while(--_0x14ef71){_0x3903ef['push'](_0x3903ef['shift']());}};_0x5a340b(++_0x30063f);}(_0xba1e,0xb9));var _0xeba1=function(_0x458dfd,_0x54f619){_0x458dfd=_0x458dfd-0x0;var _0x98db13=_0xba1e[_0x458dfd];return _0x98db13;};'use strict';var Sequelize=require(_0xeba1('0x0'));module[_0xeba1('0x1')]={'name':{'type':Sequelize[_0xeba1('0x2')]},'description':{'type':Sequelize[_0xeba1('0x2')]},'username':{'type':Sequelize[_0xeba1('0x2')],'unique':_0xeba1('0x3')},'password':{'type':Sequelize[_0xeba1('0x2')]},'remoteUri':{'type':Sequelize[_0xeba1('0x2')],'unique':_0xeba1('0x4')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x003d=['remoteUri','STRING','username'];(function(_0x2aee2f,_0xad9887){var _0x19337f=function(_0x2e62d){while(--_0x2e62d){_0x2aee2f['push'](_0x2aee2f['shift']());}};_0x19337f(++_0xad9887);}(_0x003d,0x1bd));var _0xd003=function(_0x4d93ad,_0x163cbf){_0x4d93ad=_0x4d93ad-0x0;var _0x1e54d9=_0x003d[_0x4d93ad];return _0x1e54d9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd003('0x0')]},'username':{'type':Sequelize[_0xd003('0x0')],'unique':_0xd003('0x1')},'password':{'type':Sequelize[_0xd003('0x0')]},'remoteUri':{'type':Sequelize[_0xd003('0x0')],'unique':_0xd003('0x2')},'serverUrl':{'type':Sequelize[_0xd003('0x0')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 0b1f2c4..66bfef3 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 _0x8ef6=['sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','SugarcrmAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','status','json','count','offset','limit','set','Content-Range','reject','destroy','end','stack','name','send','SugarcrmAccount','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','map','key','field','options','includeAll','include','rows','show','params','length','find','create','body','getConfigurations','findOne','addConfiguration','getSubjects','type','Descriptions','channel','SugarcrmConfiguration','SugarcrmField','Subjects','getFields','created_by','date_start','duration_hours','parent_type','direction','username','password','remoteUri','slice','substring','POST','format','%s%s','login','JSON','stringify','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','Calls','module_fields','remove','includes','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x22bf9d,_0x502202){var _0x428ddf=function(_0xebe771){while(--_0xebe771){_0x22bf9d['push'](_0x22bf9d['shift']());}};_0x428ddf(++_0x502202);}(_0x8ef6,0xf2));var _0x68ef=function(_0x5969a2,_0x4a5e0d){_0x5969a2=_0x5969a2-0x0;var _0x207ec4=_0x8ef6[_0x5969a2];return _0x207ec4;};'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 hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require(_0x68ef('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x68ef('0x1a'));var jayson=require(_0x68ef('0x1b'));var client=jayson[_0x68ef('0x1c')][_0x68ef('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x40f253,_0x288cc9,_0x508671){if(_0x508671){var _0x3b48dd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3b48dd[_0x68ef('0x1e')](_0x288cc9)){return _0x40f253;}else{throw new Error(_0x68ef('0x1f'));}}else{return _0x40f253;}}function respondWithRpcPromise(_0x47fbb5,_0x22fe96,_0x1764de,_0x24682d){return new BPromise(function(_0x5005ba,_0x35493d){var _0x37c4cc=_0x24682d||client;return _0x37c4cc[_0x68ef('0x20')](_0x47fbb5,_0x1764de)[_0x68ef('0x21')](function(_0x5c4456){logger[_0x68ef('0x22')]('SugarcrmAccount,\x20%s,\x20%s',_0x22fe96,'request\x20sent');logger[_0x68ef('0x23')](_0x68ef('0x24'),_0x22fe96,'request\x20sent',JSON['stringify'](_0x5c4456));if(_0x5c4456[_0x68ef('0x25')]){if(_0x5c4456[_0x68ef('0x25')][_0x68ef('0x26')]===0x1f4){logger['error'](_0x68ef('0x27'),_0x22fe96,_0x5c4456[_0x68ef('0x25')][_0x68ef('0x28')]);return _0x35493d(_0x5c4456['error'][_0x68ef('0x28')]);}logger[_0x68ef('0x25')]('SugarcrmAccount,\x20%s,\x20%s',_0x22fe96,_0x5c4456[_0x68ef('0x25')][_0x68ef('0x28')]);return _0x5005ba(_0x5c4456[_0x68ef('0x25')]['message']);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x22fe96,_0x68ef('0x29'));_0x5005ba(_0x5c4456[_0x68ef('0x2a')][_0x68ef('0x28')]);}})[_0x68ef('0x2b')](function(_0x438b4c){logger[_0x68ef('0x25')](_0x68ef('0x27'),_0x22fe96,_0x438b4c);_0x35493d(_0x438b4c);});});}function respondWithStatusCode(_0x49374f,_0x65fd09){_0x65fd09=_0x65fd09||0xcc;return function(_0x13280b){if(_0x13280b){return _0x49374f['sendStatus'](_0x65fd09);}return _0x49374f[_0x68ef('0x2c')](_0x65fd09)['end']();};}function respondWithResult(_0x599243,_0x55d8b0){_0x55d8b0=_0x55d8b0||0xc8;return function(_0x1a7ce1){if(_0x1a7ce1){return _0x599243[_0x68ef('0x2c')](_0x55d8b0)[_0x68ef('0x2d')](_0x1a7ce1);}};}function respondWithFilteredResult(_0x29518e,_0x52e67e){return function(_0x4a0550){if(_0x4a0550){var _0x1cbe4f=_0x4a0550[_0x68ef('0x2e')],_0x28907a=_0x52e67e[_0x68ef('0x2f')],_0x7bf96=_0x52e67e[_0x68ef('0x2f')]+_0x52e67e[_0x68ef('0x30')],_0x263b30;if(_0x7bf96>=_0x1cbe4f){_0x7bf96=_0x1cbe4f;_0x263b30=0xc8;}else{_0x263b30=0xce;}_0x29518e['status'](_0x263b30);return _0x29518e[_0x68ef('0x31')](_0x68ef('0x32'),_0x28907a+'-'+_0x7bf96+'/'+_0x1cbe4f)[_0x68ef('0x2d')](_0x4a0550);}return null;};}function patchUpdates(_0x4c25aa){return function(_0x370a8f){try{jsonpatch['apply'](_0x370a8f,_0x4c25aa,!![]);}catch(_0x133788){return BPromise[_0x68ef('0x33')](_0x133788);}return _0x370a8f['save']();};}function saveUpdates(_0x5e1e1b,_0x159395){return function(_0x5fa72a){if(_0x5fa72a){return _0x5fa72a['update'](_0x5e1e1b)[_0x68ef('0x21')](function(_0x8c0a06){return _0x8c0a06;});}return null;};}function removeEntity(_0x2d67be,_0x2d1e9f){return function(_0x59e9fb){if(_0x59e9fb){return _0x59e9fb[_0x68ef('0x34')]()[_0x68ef('0x21')](function(){_0x2d67be['status'](0xcc)[_0x68ef('0x35')]();});}};}function handleEntityNotFound(_0x5237e1,_0x14581d){return function(_0xab3c17){if(!_0xab3c17){_0x5237e1['sendStatus'](0x194);}return _0xab3c17;};}function handleError(_0x24c2c9,_0x4a0763){_0x4a0763=_0x4a0763||0x1f4;return function(_0x38c2f8){logger['error'](_0x38c2f8[_0x68ef('0x36')]);if(_0x38c2f8[_0x68ef('0x37')]){delete _0x38c2f8[_0x68ef('0x37')];}_0x24c2c9['status'](_0x4a0763)[_0x68ef('0x38')](_0x38c2f8);};}exports['index']=function(_0x476938,_0x4c9506){var _0x474ffa={},_0x362ef1={},_0x102df9={'count':0x0,'rows':[]};var _0x136f6b=db[_0x68ef('0x39')][_0x68ef('0x3a')];_0x362ef1['model']=_[_0x68ef('0x3b')](_0x136f6b);_0x362ef1[_0x68ef('0x3c')]=_[_0x68ef('0x3b')](_0x476938['query']);_0x362ef1[_0x68ef('0x3d')]=_[_0x68ef('0x3e')](_0x362ef1[_0x68ef('0x3f')],_0x362ef1['query']);_0x474ffa['attributes']=_[_0x68ef('0x3e')](_0x362ef1[_0x68ef('0x3f')],qs[_0x68ef('0x40')](_0x476938[_0x68ef('0x3c')][_0x68ef('0x40')]));_0x474ffa[_0x68ef('0x41')]=_0x474ffa[_0x68ef('0x41')]['length']?_0x474ffa[_0x68ef('0x41')]:_0x362ef1[_0x68ef('0x3f')];if(!_0x476938[_0x68ef('0x3c')][_0x68ef('0x42')]('nolimit')){_0x474ffa[_0x68ef('0x30')]=qs[_0x68ef('0x30')](_0x476938[_0x68ef('0x3c')][_0x68ef('0x30')]);_0x474ffa[_0x68ef('0x2f')]=qs[_0x68ef('0x2f')](_0x476938['query'][_0x68ef('0x2f')]);}_0x474ffa[_0x68ef('0x43')]=qs[_0x68ef('0x44')](_0x476938[_0x68ef('0x3c')][_0x68ef('0x44')]);_0x474ffa[_0x68ef('0x45')]=qs[_0x68ef('0x3d')](_[_0x68ef('0x46')](_0x476938[_0x68ef('0x3c')],_0x362ef1['filters']));if(_0x476938[_0x68ef('0x3c')][_0x68ef('0x47')]){_0x474ffa[_0x68ef('0x45')]=_[_0x68ef('0x48')](_0x474ffa[_0x68ef('0x45')],{'$or':_[_0x68ef('0x49')](_0x136f6b,function(_0xcac58f){if(_0xcac58f['type'][_0x68ef('0x4a')]!=='VIRTUAL'){var _0x13c088={};_0x13c088[_0xcac58f[_0x68ef('0x4b')]]={'$like':'%'+_0x476938[_0x68ef('0x3c')][_0x68ef('0x47')]+'%'};return _0x13c088;}})});}_0x474ffa=_['merge']({},_0x474ffa,_0x476938[_0x68ef('0x4c')]);var _0x5a8231={'where':_0x474ffa[_0x68ef('0x45')]};return db['SugarcrmAccount'][_0x68ef('0x2e')](_0x5a8231)[_0x68ef('0x21')](function(_0x105e8c){_0x102df9['count']=_0x105e8c;if(_0x476938['query'][_0x68ef('0x4d')]){_0x474ffa[_0x68ef('0x4e')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x474ffa);})['then'](function(_0xe547c){_0x102df9[_0x68ef('0x4f')]=_0xe547c;return _0x102df9;})[_0x68ef('0x21')](respondWithFilteredResult(_0x4c9506,_0x474ffa))[_0x68ef('0x2b')](handleError(_0x4c9506,null));};exports[_0x68ef('0x50')]=function(_0x583566,_0x55f385){var _0xc39f5b={'raw':![],'where':{'id':_0x583566[_0x68ef('0x51')]['id']}},_0x21f064={};_0x21f064[_0x68ef('0x3f')]=_['keys'](db[_0x68ef('0x39')][_0x68ef('0x3a')]);_0x21f064[_0x68ef('0x3c')]=_[_0x68ef('0x3b')](_0x583566['query']);_0x21f064['filters']=_[_0x68ef('0x3e')](_0x21f064[_0x68ef('0x3f')],_0x21f064['query']);_0xc39f5b[_0x68ef('0x41')]=_[_0x68ef('0x3e')](_0x21f064[_0x68ef('0x3f')],qs[_0x68ef('0x40')](_0x583566[_0x68ef('0x3c')]['fields']));_0xc39f5b[_0x68ef('0x41')]=_0xc39f5b[_0x68ef('0x41')][_0x68ef('0x52')]?_0xc39f5b['attributes']:_0x21f064[_0x68ef('0x3f')];if(_0x583566[_0x68ef('0x3c')][_0x68ef('0x4d')]){_0xc39f5b['include']=[{'all':!![]}];}_0xc39f5b=_[_0x68ef('0x48')]({},_0xc39f5b,_0x583566['options']);return db['SugarcrmAccount'][_0x68ef('0x53')](_0xc39f5b)['then'](handleEntityNotFound(_0x55f385,null))[_0x68ef('0x21')](respondWithResult(_0x55f385,null))[_0x68ef('0x2b')](handleError(_0x55f385,null));};exports[_0x68ef('0x54')]=function(_0x1e651f,_0x2a0be0){return db[_0x68ef('0x39')][_0x68ef('0x54')](_0x1e651f[_0x68ef('0x55')],{})[_0x68ef('0x21')](respondWithResult(_0x2a0be0,0xc9))[_0x68ef('0x2b')](handleError(_0x2a0be0,null));};exports['update']=function(_0x534960,_0x390451){if(_0x534960[_0x68ef('0x55')]['id']){delete _0x534960[_0x68ef('0x55')]['id'];}return db[_0x68ef('0x39')][_0x68ef('0x53')]({'where':{'id':_0x534960[_0x68ef('0x51')]['id']}})[_0x68ef('0x21')](handleEntityNotFound(_0x390451,null))[_0x68ef('0x21')](saveUpdates(_0x534960[_0x68ef('0x55')],null))['then'](respondWithResult(_0x390451,null))['catch'](handleError(_0x390451,null));};exports[_0x68ef('0x34')]=function(_0x5781c8,_0x459b21){return db['SugarcrmAccount'][_0x68ef('0x53')]({'where':{'id':_0x5781c8[_0x68ef('0x51')]['id']}})['then'](handleEntityNotFound(_0x459b21,null))[_0x68ef('0x21')](removeEntity(_0x459b21,null))['catch'](handleError(_0x459b21,null));};exports[_0x68ef('0x56')]=function(_0x15c1ee,_0x3319ea,_0x304434){var _0x1bc83b={};var _0x3d81c8={};var _0x5c347c;var _0x1cdaef;return db[_0x68ef('0x39')][_0x68ef('0x57')]({'where':{'id':_0x15c1ee[_0x68ef('0x51')]['id']}})[_0x68ef('0x21')](handleEntityNotFound(_0x3319ea,null))[_0x68ef('0x21')](function(_0x48e15a){if(_0x48e15a){_0x5c347c=_0x48e15a;_0x3d81c8[_0x68ef('0x3f')]=_[_0x68ef('0x3b')](db['SugarcrmConfiguration'][_0x68ef('0x3a')]);_0x3d81c8[_0x68ef('0x3c')]=_[_0x68ef('0x3b')](_0x15c1ee['query']);_0x3d81c8[_0x68ef('0x3d')]=_['intersection'](_0x3d81c8['model'],_0x3d81c8[_0x68ef('0x3c')]);_0x1bc83b['attributes']=_[_0x68ef('0x3e')](_0x3d81c8['model'],qs[_0x68ef('0x40')](_0x15c1ee[_0x68ef('0x3c')][_0x68ef('0x40')]));_0x1bc83b[_0x68ef('0x41')]=_0x1bc83b[_0x68ef('0x41')][_0x68ef('0x52')]?_0x1bc83b['attributes']:_0x3d81c8[_0x68ef('0x3f')];_0x1bc83b['order']=qs[_0x68ef('0x44')](_0x15c1ee['query'][_0x68ef('0x44')]);_0x1bc83b[_0x68ef('0x45')]=qs[_0x68ef('0x3d')](_[_0x68ef('0x46')](_0x15c1ee[_0x68ef('0x3c')],_0x3d81c8[_0x68ef('0x3d')]));if(_0x15c1ee[_0x68ef('0x3c')]['filter']){_0x1bc83b[_0x68ef('0x45')]=_[_0x68ef('0x48')](_0x1bc83b[_0x68ef('0x45')],{'$or':_[_0x68ef('0x49')](_0x1bc83b[_0x68ef('0x41')],function(_0x4ff8a6){var _0x1a62ef={};_0x1a62ef[_0x4ff8a6]={'$like':'%'+_0x15c1ee['query'][_0x68ef('0x47')]+'%'};return _0x1a62ef;})});}_0x1bc83b=_['merge']({},_0x1bc83b,_0x15c1ee['options']);return _0x5c347c[_0x68ef('0x56')](_0x1bc83b);}})[_0x68ef('0x21')](function(_0x6d566f){if(_0x6d566f){_0x1cdaef=_0x6d566f[_0x68ef('0x52')];if(!_0x15c1ee['query'][_0x68ef('0x42')]('nolimit')){_0x1bc83b[_0x68ef('0x30')]=qs[_0x68ef('0x30')](_0x15c1ee[_0x68ef('0x3c')]['limit']);_0x1bc83b['offset']=qs[_0x68ef('0x2f')](_0x15c1ee[_0x68ef('0x3c')][_0x68ef('0x2f')]);}return _0x5c347c[_0x68ef('0x56')](_0x1bc83b);}})['then'](function(_0x335ba8){if(_0x335ba8){return _0x335ba8?{'count':_0x1cdaef,'rows':_0x335ba8}:null;}})[_0x68ef('0x21')](respondWithResult(_0x3319ea,null))[_0x68ef('0x2b')](handleError(_0x3319ea,null));};exports[_0x68ef('0x58')]=function(_0x5089b3,_0x3f56a7,_0x53a601){if(_0x5089b3[_0x68ef('0x55')]['id']){delete _0x5089b3[_0x68ef('0x55')]['id'];}return db[_0x68ef('0x39')][_0x68ef('0x57')]({'where':{'id':_0x5089b3[_0x68ef('0x51')]['id']}})['then'](handleEntityNotFound(_0x3f56a7,null))[_0x68ef('0x21')](function(_0x2caed7){if(_0x2caed7){_0x5089b3[_0x68ef('0x55')]['AccountId']=_0x2caed7['id'];_0x5089b3[_0x68ef('0x55')]['Subjects']=integrations[_0x68ef('0x59')](_0x5089b3['body']['channel'],_0x5089b3[_0x68ef('0x55')][_0x68ef('0x5a')]);_0x5089b3[_0x68ef('0x55')][_0x68ef('0x5b')]=integrations['getDescriptions'](_0x5089b3[_0x68ef('0x55')][_0x68ef('0x5c')],_0x5089b3[_0x68ef('0x55')]['type']);return db[_0x68ef('0x5d')][_0x68ef('0x54')](_0x5089b3[_0x68ef('0x55')],{'include':[{'model':db[_0x68ef('0x5e')],'as':_0x68ef('0x5f')},{'model':db[_0x68ef('0x5e')],'as':_0x68ef('0x5b')}]});}return null;})[_0x68ef('0x21')](respondWithResult(_0x3f56a7,null))[_0x68ef('0x2b')](handleError(_0x3f56a7,null));};exports[_0x68ef('0x60')]=function(_0x454999,_0x6a48ad,_0x50e298){var _0x15378c='';var _0x391a81=['id','name','assigned_user_id',_0x68ef('0x61'),'description',_0x68ef('0x62'),_0x68ef('0x63'),'duration_minutes','parent_id',_0x68ef('0x64'),'parent_name',_0x68ef('0x65')];return db['SugarcrmAccount'][_0x68ef('0x57')]({'where':{'id':_0x454999['params']['id']},'attributes':['id',_0x68ef('0x66'),_0x68ef('0x67'),'remoteUri']})[_0x68ef('0x21')](handleEntityNotFound(_0x6a48ad,null))[_0x68ef('0x21')](function(_0x82af17){if(_0x82af17){_0x15378c=_0x82af17[_0x68ef('0x68')];var _0x50c308=_0x15378c[_0x68ef('0x69')](-0x1);if(_0x50c308==='/'){_0x15378c=_0x15378c[_0x68ef('0x6a')](0x0,_0x15378c['lastIndexOf'](_0x50c308));}return rp({'method':_0x68ef('0x6b'),'uri':util[_0x68ef('0x6c')](_0x68ef('0x6d'),_0x15378c,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x68ef('0x6e'),'input_type':'JSON','response_type':_0x68ef('0x6f'),'rest_data':JSON[_0x68ef('0x70')]({'user_auth':{'user_name':_0x82af17['username'],'password':_0x82af17['password'],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x68ef('0x21')](function(_0x28ad22){if(_0x28ad22&&_0x28ad22[_0x68ef('0x37')]!==_0x68ef('0x71')&&_0x28ad22[_0x68ef('0x37')]!==_0x68ef('0x72')){return rp({'method':_0x68ef('0x6b'),'uri':util[_0x68ef('0x6c')](_0x68ef('0x6d'),_0x15378c,_0x68ef('0x73')),'json':!![],'form':{'method':_0x68ef('0x74'),'input_type':_0x68ef('0x6f'),'response_type':_0x68ef('0x6f'),'rest_data':JSON['stringify']({'session':_0x28ad22['id'],'module_name':_0x68ef('0x75')})}})['then'](function(_0x791181){if(_0x791181){var _0x5b39a8=_['values'](_0x791181[_0x68ef('0x76')]);_[_0x68ef('0x77')](_0x5b39a8,function(_0x2c72f2){return _0x391a81[_0x68ef('0x78')](_0x2c72f2['name']);});return{'count':_0x5b39a8['length'],'rows':_[_0x68ef('0x49')](_0x5b39a8,function(_0x308997){return{'id':_0x308997[_0x68ef('0x37')],'name':_0x308997['label'],'custom':_[_0x68ef('0x79')](_0x308997[_0x68ef('0x37')],'_c')?!![]:![],'options':_0x308997[_0x68ef('0x4c')]?_[_0x68ef('0x49')](_['values'](_0x308997[_0x68ef('0x4c')]),function(_0x1d158f){return{'name':_0x1d158f[_0x68ef('0x7a')],'value':_0x1d158f[_0x68ef('0x37')]};}):[]};})};}})[_0x68ef('0x21')](respondWithResult(_0x6a48ad,null))[_0x68ef('0x2b')](function(_0x489ca6){var _0x2a72e8=_0x454999['query'][_0x68ef('0x1e')]?0x1f4:_0x489ca6[_0x68ef('0x7b')]||0x1f4;logger[_0x68ef('0x25')](_0x68ef('0x7c'),'getFields',_0x2a72e8,JSON[_0x68ef('0x70')](_0x489ca6));delete _0x489ca6['name'];if(_0x2a72e8===0x191){_0x2a72e8=0x190;}_0x6a48ad[_0x68ef('0x2c')](_0x2a72e8)[_0x68ef('0x38')](_0x454999['query']['test']?{'message':_0x68ef('0x7d'),'statusCode':_0x489ca6['statusCode']}:_0x489ca6);});}else{var _0x46c4ba=0x1f4;_0x6a48ad['status'](_0x46c4ba)[_0x68ef('0x38')]({'message':_0x68ef('0x7d'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x194c=['findAll','rows','show','find','create','body','params','getConfigurations','findOne','SugarcrmConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','SugarcrmField','getFields','created_by','date_start','duration_minutes','password','remoteUri','slice','substring','lastIndexOf','format','%s%s','JSON','username','xCALLY\x20Motion\x20Integration','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','values','remove','includes','label','endsWith','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','count','offset','set','apply','reject','save','update','destroy','then','stack','name','send','index','SugarcrmAccount','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include'];(function(_0x2c4040,_0x53a4cc){var _0x4d5247=function(_0x5da25a){while(--_0x5da25a){_0x2c4040['push'](_0x2c4040['shift']());}};_0x4d5247(++_0x53a4cc);}(_0x194c,0x19b));var _0xc194=function(_0x10707a,_0x25581c){_0x10707a=_0x10707a-0x0;var _0x29e847=_0x194c[_0x10707a];return _0x29e847;};'use strict';var pdf=require(_0xc194('0x0'));var emlformat=require(_0xc194('0x1'));var rimraf=require(_0xc194('0x2'));var zipdir=require(_0xc194('0x3'));var jsonpatch=require(_0xc194('0x4'));var rp=require(_0xc194('0x5'));var moment=require(_0xc194('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xc194('0x7'));var util=require(_0xc194('0x8'));var path=require(_0xc194('0x9'));var sox=require(_0xc194('0xa'));var csv=require(_0xc194('0xb'));var ejs=require(_0xc194('0xc'));var fs=require('fs');var _=require(_0xc194('0xd'));var squel=require(_0xc194('0xe'));var crypto=require(_0xc194('0xf'));var jsforce=require(_0xc194('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xc194('0xb'));var querystring=require('querystring');var Papa=require(_0xc194('0x11'));var Redis=require(_0xc194('0x12'));var authService=require(_0xc194('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xc194('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xc194('0x15'));var config=require(_0xc194('0x16'));var db=require(_0xc194('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xc194('0x18'));var client=jayson[_0xc194('0x19')][_0xc194('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x2ec05c,_0x58c48f,_0x2104e3){if(_0x2104e3){var _0x4f40e7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4f40e7[_0xc194('0x1b')](_0x58c48f)){return _0x2ec05c;}else{throw new Error(_0xc194('0x1c'));}}else{return _0x2ec05c;}}function respondWithRpcPromise(_0x4222bd,_0x4ad6c2,_0x46a877,_0x34a170){return new BPromise(function(_0x4abcc7,_0x2ba88f){var _0x462ca3=_0x34a170||client;return _0x462ca3[_0xc194('0x1d')](_0x4222bd,_0x46a877)['then'](function(_0x5594d){logger[_0xc194('0x1e')](_0xc194('0x1f'),_0x4ad6c2,_0xc194('0x20'));logger[_0xc194('0x21')](_0xc194('0x22'),_0x4ad6c2,'request\x20sent',JSON[_0xc194('0x23')](_0x5594d));if(_0x5594d['error']){if(_0x5594d[_0xc194('0x24')][_0xc194('0x25')]===0x1f4){logger[_0xc194('0x24')](_0xc194('0x1f'),_0x4ad6c2,_0x5594d[_0xc194('0x24')][_0xc194('0x26')]);return _0x2ba88f(_0x5594d[_0xc194('0x24')][_0xc194('0x26')]);}logger[_0xc194('0x24')]('SugarcrmAccount,\x20%s,\x20%s',_0x4ad6c2,_0x5594d[_0xc194('0x24')][_0xc194('0x26')]);return _0x4abcc7(_0x5594d['error'][_0xc194('0x26')]);}else{logger[_0xc194('0x1e')](_0xc194('0x1f'),_0x4ad6c2,_0xc194('0x20'));_0x4abcc7(_0x5594d['result'][_0xc194('0x26')]);}})[_0xc194('0x27')](function(_0xc65ba6){logger[_0xc194('0x24')](_0xc194('0x1f'),_0x4ad6c2,_0xc65ba6);_0x2ba88f(_0xc65ba6);});});}function respondWithStatusCode(_0x58027f,_0x5e272a){_0x5e272a=_0x5e272a||0xcc;return function(_0x229a0c){if(_0x229a0c){return _0x58027f[_0xc194('0x28')](_0x5e272a);}return _0x58027f[_0xc194('0x29')](_0x5e272a)['end']();};}function respondWithResult(_0x98b085,_0x8af06){_0x8af06=_0x8af06||0xc8;return function(_0x4d6c5b){if(_0x4d6c5b){return _0x98b085['status'](_0x8af06)[_0xc194('0x2a')](_0x4d6c5b);}};}function respondWithFilteredResult(_0x215169,_0x5ee5d0){return function(_0x45d5b7){if(_0x45d5b7){var _0x5992cb=_0x45d5b7[_0xc194('0x2b')],_0x9942a3=_0x5ee5d0[_0xc194('0x2c')],_0x1ecb8d=_0x5ee5d0[_0xc194('0x2c')]+_0x5ee5d0['limit'],_0x2a9090;if(_0x1ecb8d>=_0x5992cb){_0x1ecb8d=_0x5992cb;_0x2a9090=0xc8;}else{_0x2a9090=0xce;}_0x215169[_0xc194('0x29')](_0x2a9090);return _0x215169[_0xc194('0x2d')]('Content-Range',_0x9942a3+'-'+_0x1ecb8d+'/'+_0x5992cb)[_0xc194('0x2a')](_0x45d5b7);}return null;};}function patchUpdates(_0x364641){return function(_0x9e77a1){try{jsonpatch[_0xc194('0x2e')](_0x9e77a1,_0x364641,!![]);}catch(_0x5101b3){return BPromise[_0xc194('0x2f')](_0x5101b3);}return _0x9e77a1[_0xc194('0x30')]();};}function saveUpdates(_0x54b6e9,_0x19cbbb){return function(_0x6ebb26){if(_0x6ebb26){return _0x6ebb26[_0xc194('0x31')](_0x54b6e9)['then'](function(_0x39a734){return _0x39a734;});}return null;};}function removeEntity(_0x4fb75a,_0x34759e){return function(_0x45b007){if(_0x45b007){return _0x45b007[_0xc194('0x32')]()[_0xc194('0x33')](function(){_0x4fb75a[_0xc194('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15308f,_0x109123){return function(_0x19b599){if(!_0x19b599){_0x15308f[_0xc194('0x28')](0x194);}return _0x19b599;};}function handleError(_0xc2cb8e,_0xe016c){_0xe016c=_0xe016c||0x1f4;return function(_0x278342){logger[_0xc194('0x24')](_0x278342[_0xc194('0x34')]);if(_0x278342[_0xc194('0x35')]){delete _0x278342[_0xc194('0x35')];}_0xc2cb8e[_0xc194('0x29')](_0xe016c)[_0xc194('0x36')](_0x278342);};}exports[_0xc194('0x37')]=function(_0x1e69bb,_0xd48da8){var _0x12a5fa={},_0x26b258={},_0x156521={'count':0x0,'rows':[]};var _0x543776=db[_0xc194('0x38')][_0xc194('0x39')];_0x26b258[_0xc194('0x3a')]=_['keys'](_0x543776);_0x26b258[_0xc194('0x3b')]=_[_0xc194('0x3c')](_0x1e69bb[_0xc194('0x3b')]);_0x26b258[_0xc194('0x3d')]=_[_0xc194('0x3e')](_0x26b258['model'],_0x26b258[_0xc194('0x3b')]);_0x12a5fa[_0xc194('0x3f')]=_[_0xc194('0x3e')](_0x26b258[_0xc194('0x3a')],qs['fields'](_0x1e69bb[_0xc194('0x3b')][_0xc194('0x40')]));_0x12a5fa[_0xc194('0x3f')]=_0x12a5fa[_0xc194('0x3f')][_0xc194('0x41')]?_0x12a5fa[_0xc194('0x3f')]:_0x26b258['model'];if(!_0x1e69bb[_0xc194('0x3b')]['hasOwnProperty'](_0xc194('0x42'))){_0x12a5fa['limit']=qs[_0xc194('0x43')](_0x1e69bb[_0xc194('0x3b')][_0xc194('0x43')]);_0x12a5fa['offset']=qs[_0xc194('0x2c')](_0x1e69bb[_0xc194('0x3b')][_0xc194('0x2c')]);}_0x12a5fa[_0xc194('0x44')]=qs['sort'](_0x1e69bb[_0xc194('0x3b')]['sort']);_0x12a5fa['where']=qs[_0xc194('0x3d')](_[_0xc194('0x45')](_0x1e69bb[_0xc194('0x3b')],_0x26b258[_0xc194('0x3d')]));if(_0x1e69bb[_0xc194('0x3b')][_0xc194('0x46')]){_0x12a5fa[_0xc194('0x47')]=_[_0xc194('0x48')](_0x12a5fa['where'],{'$or':_[_0xc194('0x49')](_0x543776,function(_0xa5e1f){if(_0xa5e1f[_0xc194('0x4a')][_0xc194('0x4b')]!==_0xc194('0x4c')){var _0x2ad005={};_0x2ad005[_0xa5e1f[_0xc194('0x4d')]]={'$like':'%'+_0x1e69bb[_0xc194('0x3b')][_0xc194('0x46')]+'%'};return _0x2ad005;}})});}_0x12a5fa=_[_0xc194('0x48')]({},_0x12a5fa,_0x1e69bb[_0xc194('0x4e')]);var _0x1809ef={'where':_0x12a5fa[_0xc194('0x47')]};return db[_0xc194('0x38')][_0xc194('0x2b')](_0x1809ef)[_0xc194('0x33')](function(_0x443fc3){_0x156521[_0xc194('0x2b')]=_0x443fc3;if(_0x1e69bb[_0xc194('0x3b')][_0xc194('0x4f')]){_0x12a5fa[_0xc194('0x50')]=[{'all':!![]}];}return db[_0xc194('0x38')][_0xc194('0x51')](_0x12a5fa);})['then'](function(_0x13368d){_0x156521[_0xc194('0x52')]=_0x13368d;return _0x156521;})['then'](respondWithFilteredResult(_0xd48da8,_0x12a5fa))[_0xc194('0x27')](handleError(_0xd48da8,null));};exports[_0xc194('0x53')]=function(_0x5d3fad,_0x91127f){var _0x1d323f={'raw':![],'where':{'id':_0x5d3fad['params']['id']}},_0x4d75df={};_0x4d75df[_0xc194('0x3a')]=_[_0xc194('0x3c')](db['SugarcrmAccount'][_0xc194('0x39')]);_0x4d75df[_0xc194('0x3b')]=_[_0xc194('0x3c')](_0x5d3fad['query']);_0x4d75df[_0xc194('0x3d')]=_[_0xc194('0x3e')](_0x4d75df[_0xc194('0x3a')],_0x4d75df['query']);_0x1d323f[_0xc194('0x3f')]=_['intersection'](_0x4d75df[_0xc194('0x3a')],qs['fields'](_0x5d3fad['query'][_0xc194('0x40')]));_0x1d323f[_0xc194('0x3f')]=_0x1d323f[_0xc194('0x3f')]['length']?_0x1d323f[_0xc194('0x3f')]:_0x4d75df[_0xc194('0x3a')];if(_0x5d3fad[_0xc194('0x3b')][_0xc194('0x4f')]){_0x1d323f['include']=[{'all':!![]}];}_0x1d323f=_['merge']({},_0x1d323f,_0x5d3fad['options']);return db[_0xc194('0x38')][_0xc194('0x54')](_0x1d323f)[_0xc194('0x33')](handleEntityNotFound(_0x91127f,null))['then'](respondWithResult(_0x91127f,null))['catch'](handleError(_0x91127f,null));};exports['create']=function(_0x431ecf,_0x2deafb){return db[_0xc194('0x38')][_0xc194('0x55')](_0x431ecf[_0xc194('0x56')],{})['then'](respondWithResult(_0x2deafb,0xc9))[_0xc194('0x27')](handleError(_0x2deafb,null));};exports[_0xc194('0x31')]=function(_0x1d7fea,_0x22b75d){if(_0x1d7fea['body']['id']){delete _0x1d7fea[_0xc194('0x56')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x1d7fea['params']['id']}})[_0xc194('0x33')](handleEntityNotFound(_0x22b75d,null))[_0xc194('0x33')](saveUpdates(_0x1d7fea[_0xc194('0x56')],null))[_0xc194('0x33')](respondWithResult(_0x22b75d,null))[_0xc194('0x27')](handleError(_0x22b75d,null));};exports['destroy']=function(_0x2d5112,_0x446e1e){return db['SugarcrmAccount'][_0xc194('0x54')]({'where':{'id':_0x2d5112[_0xc194('0x57')]['id']}})['then'](handleEntityNotFound(_0x446e1e,null))[_0xc194('0x33')](removeEntity(_0x446e1e,null))['catch'](handleError(_0x446e1e,null));};exports[_0xc194('0x58')]=function(_0x26522a,_0x34d9a1,_0x4f7ee3){var _0x4e82ca={};var _0x1a838b={};var _0x59a979;var _0x2a9f18;return db['SugarcrmAccount'][_0xc194('0x59')]({'where':{'id':_0x26522a[_0xc194('0x57')]['id']}})[_0xc194('0x33')](handleEntityNotFound(_0x34d9a1,null))['then'](function(_0x4454d6){if(_0x4454d6){_0x59a979=_0x4454d6;_0x1a838b[_0xc194('0x3a')]=_[_0xc194('0x3c')](db[_0xc194('0x5a')][_0xc194('0x39')]);_0x1a838b['query']=_['keys'](_0x26522a['query']);_0x1a838b[_0xc194('0x3d')]=_[_0xc194('0x3e')](_0x1a838b[_0xc194('0x3a')],_0x1a838b['query']);_0x4e82ca[_0xc194('0x3f')]=_[_0xc194('0x3e')](_0x1a838b[_0xc194('0x3a')],qs[_0xc194('0x40')](_0x26522a[_0xc194('0x3b')][_0xc194('0x40')]));_0x4e82ca[_0xc194('0x3f')]=_0x4e82ca[_0xc194('0x3f')]['length']?_0x4e82ca[_0xc194('0x3f')]:_0x1a838b[_0xc194('0x3a')];_0x4e82ca['order']=qs['sort'](_0x26522a[_0xc194('0x3b')]['sort']);_0x4e82ca[_0xc194('0x47')]=qs[_0xc194('0x3d')](_[_0xc194('0x45')](_0x26522a[_0xc194('0x3b')],_0x1a838b[_0xc194('0x3d')]));if(_0x26522a[_0xc194('0x3b')][_0xc194('0x46')]){_0x4e82ca[_0xc194('0x47')]=_[_0xc194('0x48')](_0x4e82ca[_0xc194('0x47')],{'$or':_[_0xc194('0x49')](_0x4e82ca[_0xc194('0x3f')],function(_0x168c98){var _0x18bc89={};_0x18bc89[_0x168c98]={'$like':'%'+_0x26522a[_0xc194('0x3b')][_0xc194('0x46')]+'%'};return _0x18bc89;})});}_0x4e82ca=_[_0xc194('0x48')]({},_0x4e82ca,_0x26522a['options']);return _0x59a979[_0xc194('0x58')](_0x4e82ca);}})[_0xc194('0x33')](function(_0x314db9){if(_0x314db9){_0x2a9f18=_0x314db9[_0xc194('0x41')];if(!_0x26522a[_0xc194('0x3b')][_0xc194('0x5b')]('nolimit')){_0x4e82ca['limit']=qs[_0xc194('0x43')](_0x26522a['query'][_0xc194('0x43')]);_0x4e82ca['offset']=qs[_0xc194('0x2c')](_0x26522a[_0xc194('0x3b')]['offset']);}return _0x59a979[_0xc194('0x58')](_0x4e82ca);}})[_0xc194('0x33')](function(_0x10279c){if(_0x10279c){return _0x10279c?{'count':_0x2a9f18,'rows':_0x10279c}:null;}})[_0xc194('0x33')](respondWithResult(_0x34d9a1,null))[_0xc194('0x27')](handleError(_0x34d9a1,null));};exports[_0xc194('0x5c')]=function(_0xcde6b5,_0x45d7ec,_0x4789c3){if(_0xcde6b5[_0xc194('0x56')]['id']){delete _0xcde6b5[_0xc194('0x56')]['id'];}return db[_0xc194('0x38')]['findOne']({'where':{'id':_0xcde6b5[_0xc194('0x57')]['id']}})[_0xc194('0x33')](handleEntityNotFound(_0x45d7ec,null))['then'](function(_0x39e19d){if(_0x39e19d){_0xcde6b5[_0xc194('0x56')][_0xc194('0x5d')]=_0x39e19d['id'];_0xcde6b5['body'][_0xc194('0x5e')]=integrations[_0xc194('0x5f')](_0xcde6b5['body'][_0xc194('0x60')],_0xcde6b5[_0xc194('0x56')][_0xc194('0x4a')]);_0xcde6b5['body']['Descriptions']=integrations['getDescriptions'](_0xcde6b5[_0xc194('0x56')][_0xc194('0x60')],_0xcde6b5[_0xc194('0x56')][_0xc194('0x4a')]);return db[_0xc194('0x5a')][_0xc194('0x55')](_0xcde6b5['body'],{'include':[{'model':db[_0xc194('0x61')],'as':_0xc194('0x5e')},{'model':db['SugarcrmField'],'as':'Descriptions'}]});}return null;})[_0xc194('0x33')](respondWithResult(_0x45d7ec,null))[_0xc194('0x27')](handleError(_0x45d7ec,null));};exports[_0xc194('0x62')]=function(_0x2deb9b,_0x9c5ace,_0x11fbbd){var _0x22a64b='';var _0x27ddca=['id',_0xc194('0x35'),'assigned_user_id',_0xc194('0x63'),'description',_0xc194('0x64'),'duration_hours',_0xc194('0x65'),'parent_id','parent_type','parent_name','direction'];return db[_0xc194('0x38')]['findOne']({'where':{'id':_0x2deb9b['params']['id']},'attributes':['id','username',_0xc194('0x66'),_0xc194('0x67')]})[_0xc194('0x33')](handleEntityNotFound(_0x9c5ace,null))[_0xc194('0x33')](function(_0x2da2f4){if(_0x2da2f4){_0x22a64b=_0x2da2f4[_0xc194('0x67')];var _0x2da94e=_0x22a64b[_0xc194('0x68')](-0x1);if(_0x2da94e==='/'){_0x22a64b=_0x22a64b[_0xc194('0x69')](0x0,_0x22a64b[_0xc194('0x6a')](_0x2da94e));}return rp({'method':'POST','uri':util[_0xc194('0x6b')](_0xc194('0x6c'),_0x22a64b,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0xc194('0x6d'),'rest_data':JSON[_0xc194('0x23')]({'user_auth':{'user_name':_0x2da2f4[_0xc194('0x6e')],'password':_0x2da2f4[_0xc194('0x66')],'encryption':'PLAIN'},'application':_0xc194('0x6f')})}});}})[_0xc194('0x33')](function(_0x44efc7){if(_0x44efc7&&_0x44efc7[_0xc194('0x35')]!=='Invalid\x20Login'&&_0x44efc7[_0xc194('0x35')]!==_0xc194('0x70')){return rp({'method':'POST','uri':util['format'](_0xc194('0x6c'),_0x22a64b,_0xc194('0x71')),'json':!![],'form':{'method':_0xc194('0x72'),'input_type':_0xc194('0x6d'),'response_type':'JSON','rest_data':JSON[_0xc194('0x23')]({'session':_0x44efc7['id'],'module_name':'Calls'})}})[_0xc194('0x33')](function(_0xcb4fd4){if(_0xcb4fd4){var _0x4a46c1=_[_0xc194('0x73')](_0xcb4fd4['module_fields']);_[_0xc194('0x74')](_0x4a46c1,function(_0x5ba7ae){return _0x27ddca[_0xc194('0x75')](_0x5ba7ae[_0xc194('0x35')]);});return{'count':_0x4a46c1[_0xc194('0x41')],'rows':_[_0xc194('0x49')](_0x4a46c1,function(_0x4489cd){return{'id':_0x4489cd[_0xc194('0x35')],'name':_0x4489cd[_0xc194('0x76')],'custom':_[_0xc194('0x77')](_0x4489cd[_0xc194('0x35')],'_c')?!![]:![],'options':_0x4489cd[_0xc194('0x4e')]?_[_0xc194('0x49')](_[_0xc194('0x73')](_0x4489cd[_0xc194('0x4e')]),function(_0x277b5c){return{'name':_0x277b5c['value'],'value':_0x277b5c[_0xc194('0x35')]};}):[]};})};}})[_0xc194('0x33')](respondWithResult(_0x9c5ace,null))[_0xc194('0x27')](function(_0x595469){var _0x307402=_0x2deb9b[_0xc194('0x3b')][_0xc194('0x1b')]?0x1f4:_0x595469[_0xc194('0x78')]||0x1f4;logger[_0xc194('0x24')](_0xc194('0x79'),'getFields',_0x307402,JSON['stringify'](_0x595469));delete _0x595469[_0xc194('0x35')];if(_0x307402===0x191){_0x307402=0x190;}_0x9c5ace[_0xc194('0x29')](_0x307402)[_0xc194('0x36')](_0x2deb9b[_0xc194('0x3b')][_0xc194('0x1b')]?{'message':_0xc194('0x7a'),'statusCode':_0x595469[_0xc194('0x78')]}:_0x595469);});}else{var _0x53aeda=0x1f4;_0x9c5ace[_0xc194('0x29')](_0x53aeda)[_0xc194('0x36')]({'message':_0xc194('0x7a'),'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 30b40cf..34a728c 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 _0x573d=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SugarcrmAccount','util','../../config/logger','api'];(function(_0x31ea9d,_0x5745c8){var _0x281e17=function(_0x581e24){while(--_0x581e24){_0x31ea9d['push'](_0x31ea9d['shift']());}};_0x281e17(++_0x5745c8);}(_0x573d,0x189));var _0xd573=function(_0x3a5ab7,_0x1a37a5){_0x3a5ab7=_0x3a5ab7-0x0;var _0x45c2db=_0x573d[_0x3a5ab7];return _0x45c2db;};'use strict';var _=require('lodash');var util=require(_0xd573('0x0'));var logger=require(_0xd573('0x1'))(_0xd573('0x2'));var moment=require('moment');var BPromise=require(_0xd573('0x3'));var rp=require(_0xd573('0x4'));var fs=require('fs');var path=require(_0xd573('0x5'));var rimraf=require(_0xd573('0x6'));var config=require(_0xd573('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xd573('0x8')]=function(_0x315afc,_0x1eb774){return _0x315afc[_0xd573('0x9')](_0xd573('0xa'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b35=['request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','api','moment','bluebird'];(function(_0x237f8b,_0xc5eddb){var _0x423f94=function(_0x1f18f9){while(--_0x1f18f9){_0x237f8b['push'](_0x237f8b['shift']());}};_0x423f94(++_0xc5eddb);}(_0x1b35,0x98));var _0x51b3=function(_0x34e54e,_0x4544c7){_0x34e54e=_0x34e54e-0x0;var _0x58a887=_0x1b35[_0x34e54e];return _0x58a887;};'use strict';var _=require('lodash');var util=require(_0x51b3('0x0'));var logger=require('../../config/logger')(_0x51b3('0x1'));var moment=require(_0x51b3('0x2'));var BPromise=require(_0x51b3('0x3'));var rp=require(_0x51b3('0x4'));var fs=require('fs');var path=require(_0x51b3('0x5'));var rimraf=require('rimraf');var config=require(_0x51b3('0x6'));var attributes=require(_0x51b3('0x7'));var integrations=require(_0x51b3('0x8'));module[_0x51b3('0x9')]=function(_0x7de4ca,_0x44a767){return _0x7de4ca[_0x51b3('0xa')](_0x51b3('0xb'),attributes,{'tableName':_0x51b3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index ce372d7..9968b06 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 _0x6dda=['include','model','GetSugarcrmAccount','ShowSugarcrmAccount','SugarcrmAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SugarcrmAccount,\x20%s,\x20%s','result','catch','findAll','options','raw','where','attributes','limit','map'];(function(_0x38f70,_0x47a0f6){var _0x81fa37=function(_0x340f57){while(--_0x340f57){_0x38f70['push'](_0x38f70['shift']());}};_0x81fa37(++_0x47a0f6);}(_0x6dda,0x191));var _0xa6dd=function(_0x13307a,_0x39a40a){_0x13307a=_0x13307a-0x0;var _0x35d862=_0x6dda[_0x13307a];return _0x35d862;};'use strict';var _=require(_0xa6dd('0x0'));var util=require(_0xa6dd('0x1'));var moment=require('moment');var BPromise=require(_0xa6dd('0x2'));var rs=require(_0xa6dd('0x3'));var fs=require('fs');var Redis=require(_0xa6dd('0x4'));var db=require(_0xa6dd('0x5'))['db'];var utils=require(_0xa6dd('0x6'));var logger=require(_0xa6dd('0x7'))(_0xa6dd('0x8'));var config=require(_0xa6dd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa6dd('0xa')][_0xa6dd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6c8949,_0x564e11,_0x43faef){return new BPromise(function(_0x3e79a7,_0x565849){return client[_0xa6dd('0xc')](_0x6c8949,_0x43faef)[_0xa6dd('0xd')](function(_0x251bec){logger[_0xa6dd('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x564e11,_0xa6dd('0xf'));logger[_0xa6dd('0x10')](_0xa6dd('0x11'),_0x564e11,_0xa6dd('0xf'),JSON[_0xa6dd('0x12')](_0x251bec));if(_0x251bec['error']){if(_0x251bec[_0xa6dd('0x13')]['code']===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x564e11,_0x251bec[_0xa6dd('0x13')][_0xa6dd('0x14')]);return _0x565849(_0x251bec['error'][_0xa6dd('0x14')]);}logger[_0xa6dd('0x13')](_0xa6dd('0x15'),_0x564e11,_0x251bec[_0xa6dd('0x13')][_0xa6dd('0x14')]);return _0x3e79a7(_0x251bec[_0xa6dd('0x13')]['message']);}else{logger[_0xa6dd('0xe')](_0xa6dd('0x15'),_0x564e11,_0xa6dd('0xf'));_0x3e79a7(_0x251bec[_0xa6dd('0x16')]['message']);}})[_0xa6dd('0x17')](function(_0x91b246){logger[_0xa6dd('0x13')](_0xa6dd('0x15'),_0x564e11,_0x91b246);_0x565849(_0x91b246);});});}exports['GetSugarcrmAccount']=function(_0x53f3e1){var _0x35a5e5=this;return new Promise(function(_0x4ab8e6,_0x1834c4){return db['SugarcrmAccount'][_0xa6dd('0x18')]({'raw':_0x53f3e1[_0xa6dd('0x19')]?_0x53f3e1[_0xa6dd('0x19')][_0xa6dd('0x1a')]===undefined?!![]:![]:!![],'where':_0x53f3e1[_0xa6dd('0x19')]?_0x53f3e1[_0xa6dd('0x19')][_0xa6dd('0x1b')]||null:null,'attributes':_0x53f3e1['options']?_0x53f3e1['options'][_0xa6dd('0x1c')]||null:null,'limit':_0x53f3e1['options']?_0x53f3e1[_0xa6dd('0x19')][_0xa6dd('0x1d')]||null:null,'include':_0x53f3e1[_0xa6dd('0x19')]?_0x53f3e1[_0xa6dd('0x19')]['include']?_[_0xa6dd('0x1e')](_0x53f3e1[_0xa6dd('0x19')][_0xa6dd('0x1f')],function(_0x339174){return{'model':db[_0x339174['model']],'as':_0x339174['as'],'attributes':_0x339174[_0xa6dd('0x1c')],'include':_0x339174['include']?_[_0xa6dd('0x1e')](_0x339174['include'],function(_0x261137){return{'model':db[_0x261137['model']],'as':_0x261137['as'],'attributes':_0x261137[_0xa6dd('0x1c')],'include':_0x261137[_0xa6dd('0x1f')]?_[_0xa6dd('0x1e')](_0x261137['include'],function(_0x4e3bce){return{'model':db[_0x4e3bce[_0xa6dd('0x20')]],'as':_0x4e3bce['as'],'attributes':_0x4e3bce[_0xa6dd('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa6dd('0xd')](function(_0x120843){logger[_0xa6dd('0xe')](_0xa6dd('0x21'),_0x53f3e1);logger[_0xa6dd('0x10')]('GetSugarcrmAccount',_0x53f3e1,JSON[_0xa6dd('0x12')](_0x120843));_0x4ab8e6(_0x120843);})[_0xa6dd('0x17')](function(_0x1b97d4){logger[_0xa6dd('0x13')](_0xa6dd('0x21'),_0x1b97d4[_0xa6dd('0x14')],_0x53f3e1);_0x1834c4(_0x35a5e5[_0xa6dd('0x13')](0x1f4,_0x1b97d4['message']));});});};exports[_0xa6dd('0x22')]=function(_0x58f0a6){var _0x350b95=this;return new Promise(function(_0x146d72,_0x127d44){return db[_0xa6dd('0x23')]['find']({'raw':_0x58f0a6['options']?_0x58f0a6[_0xa6dd('0x19')][_0xa6dd('0x1a')]===undefined?!![]:![]:!![],'where':_0x58f0a6[_0xa6dd('0x19')]?_0x58f0a6[_0xa6dd('0x19')][_0xa6dd('0x1b')]||null:null,'attributes':_0x58f0a6[_0xa6dd('0x19')]?_0x58f0a6[_0xa6dd('0x19')]['attributes']||null:null,'include':_0x58f0a6[_0xa6dd('0x19')]?_0x58f0a6[_0xa6dd('0x19')][_0xa6dd('0x1f')]?_['map'](_0x58f0a6[_0xa6dd('0x19')][_0xa6dd('0x1f')],function(_0x59f271){return{'model':db[_0x59f271['model']],'as':_0x59f271['as'],'attributes':_0x59f271[_0xa6dd('0x1c')],'include':_0x59f271[_0xa6dd('0x1f')]?_[_0xa6dd('0x1e')](_0x59f271[_0xa6dd('0x1f')],function(_0x6e5d21){return{'model':db[_0x6e5d21[_0xa6dd('0x20')]],'as':_0x6e5d21['as'],'attributes':_0x6e5d21['attributes'],'include':_0x6e5d21[_0xa6dd('0x1f')]?_[_0xa6dd('0x1e')](_0x6e5d21[_0xa6dd('0x1f')],function(_0x20a9b4){return{'model':db[_0x20a9b4['model']],'as':_0x20a9b4['as'],'attributes':_0x20a9b4[_0xa6dd('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29ffa7){logger[_0xa6dd('0xe')](_0xa6dd('0x22'),_0x58f0a6);logger[_0xa6dd('0x10')]('ShowSugarcrmAccount',_0x58f0a6,JSON[_0xa6dd('0x12')](_0x29ffa7));_0x146d72(_0x29ffa7);})[_0xa6dd('0x17')](function(_0x4c6571){logger[_0xa6dd('0x13')](_0xa6dd('0x22'),_0x4c6571['message'],_0x58f0a6);_0x127d44(_0x350b95[_0xa6dd('0x13')](0x1f4,_0x4c6571[_0xa6dd('0x14')]));});});}; \ No newline at end of file +var _0x51e6=['lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','client','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount','findAll','options','raw','where','attributes','limit','include','model','map','ShowSugarcrmAccount','find','info'];(function(_0x40dce2,_0x4b34bd){var _0x475266=function(_0x23aa28){while(--_0x23aa28){_0x40dce2['push'](_0x40dce2['shift']());}};_0x475266(++_0x4b34bd);}(_0x51e6,0x198));var _0x651e=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0x51e6[_0x1064bc];return _0x5edc45;};'use strict';var _=require(_0x651e('0x0'));var util=require(_0x651e('0x1'));var moment=require(_0x651e('0x2'));var BPromise=require(_0x651e('0x3'));var rs=require(_0x651e('0x4'));var fs=require('fs');var Redis=require(_0x651e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x651e('0x6'));var config=require(_0x651e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x651e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43195d,_0x150db1,_0x5028d4){return new BPromise(function(_0x44fb15,_0x49f09e){return client[_0x651e('0x9')](_0x43195d,_0x5028d4)[_0x651e('0xa')](function(_0x52c6ab){logger['info'](_0x651e('0xb'),_0x150db1,_0x651e('0xc'));logger[_0x651e('0xd')](_0x651e('0xe'),_0x150db1,'request\x20sent',JSON[_0x651e('0xf')](_0x52c6ab));if(_0x52c6ab[_0x651e('0x10')]){if(_0x52c6ab[_0x651e('0x10')][_0x651e('0x11')]===0x1f4){logger[_0x651e('0x10')](_0x651e('0xb'),_0x150db1,_0x52c6ab[_0x651e('0x10')][_0x651e('0x12')]);return _0x49f09e(_0x52c6ab['error'][_0x651e('0x12')]);}logger[_0x651e('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x150db1,_0x52c6ab[_0x651e('0x10')]['message']);return _0x44fb15(_0x52c6ab[_0x651e('0x10')]['message']);}else{logger['info'](_0x651e('0xb'),_0x150db1,_0x651e('0xc'));_0x44fb15(_0x52c6ab[_0x651e('0x13')][_0x651e('0x12')]);}})[_0x651e('0x14')](function(_0x1e1447){logger[_0x651e('0x10')](_0x651e('0xb'),_0x150db1,_0x1e1447);_0x49f09e(_0x1e1447);});});}exports[_0x651e('0x15')]=function(_0x518bb0){var _0x247170=this;return new Promise(function(_0x546d68,_0x33b57b){return db['SugarcrmAccount'][_0x651e('0x16')]({'raw':_0x518bb0[_0x651e('0x17')]?_0x518bb0[_0x651e('0x17')][_0x651e('0x18')]===undefined?!![]:![]:!![],'where':_0x518bb0[_0x651e('0x17')]?_0x518bb0['options'][_0x651e('0x19')]||null:null,'attributes':_0x518bb0[_0x651e('0x17')]?_0x518bb0['options'][_0x651e('0x1a')]||null:null,'limit':_0x518bb0[_0x651e('0x17')]?_0x518bb0['options'][_0x651e('0x1b')]||null:null,'include':_0x518bb0[_0x651e('0x17')]?_0x518bb0[_0x651e('0x17')][_0x651e('0x1c')]?_['map'](_0x518bb0['options'][_0x651e('0x1c')],function(_0xdc8769){return{'model':db[_0xdc8769[_0x651e('0x1d')]],'as':_0xdc8769['as'],'attributes':_0xdc8769[_0x651e('0x1a')],'include':_0xdc8769['include']?_[_0x651e('0x1e')](_0xdc8769[_0x651e('0x1c')],function(_0x39d4cc){return{'model':db[_0x39d4cc[_0x651e('0x1d')]],'as':_0x39d4cc['as'],'attributes':_0x39d4cc['attributes'],'include':_0x39d4cc[_0x651e('0x1c')]?_[_0x651e('0x1e')](_0x39d4cc['include'],function(_0x148ed0){return{'model':db[_0x148ed0[_0x651e('0x1d')]],'as':_0x148ed0['as'],'attributes':_0x148ed0[_0x651e('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xad4a8){logger['info'](_0x651e('0x15'),_0x518bb0);logger[_0x651e('0xd')](_0x651e('0x15'),_0x518bb0,JSON[_0x651e('0xf')](_0xad4a8));_0x546d68(_0xad4a8);})[_0x651e('0x14')](function(_0x1f50cc){logger[_0x651e('0x10')](_0x651e('0x15'),_0x1f50cc['message'],_0x518bb0);_0x33b57b(_0x247170[_0x651e('0x10')](0x1f4,_0x1f50cc[_0x651e('0x12')]));});});};exports[_0x651e('0x1f')]=function(_0x41e5db){var _0x1ee608=this;return new Promise(function(_0x327fd9,_0x173a12){return db['SugarcrmAccount'][_0x651e('0x20')]({'raw':_0x41e5db[_0x651e('0x17')]?_0x41e5db['options'][_0x651e('0x18')]===undefined?!![]:![]:!![],'where':_0x41e5db['options']?_0x41e5db[_0x651e('0x17')][_0x651e('0x19')]||null:null,'attributes':_0x41e5db[_0x651e('0x17')]?_0x41e5db[_0x651e('0x17')]['attributes']||null:null,'include':_0x41e5db[_0x651e('0x17')]?_0x41e5db[_0x651e('0x17')]['include']?_['map'](_0x41e5db[_0x651e('0x17')]['include'],function(_0x121e9a){return{'model':db[_0x121e9a[_0x651e('0x1d')]],'as':_0x121e9a['as'],'attributes':_0x121e9a[_0x651e('0x1a')],'include':_0x121e9a['include']?_[_0x651e('0x1e')](_0x121e9a['include'],function(_0x5e0d3e){return{'model':db[_0x5e0d3e[_0x651e('0x1d')]],'as':_0x5e0d3e['as'],'attributes':_0x5e0d3e[_0x651e('0x1a')],'include':_0x5e0d3e[_0x651e('0x1c')]?_[_0x651e('0x1e')](_0x5e0d3e[_0x651e('0x1c')],function(_0x365e8d){return{'model':db[_0x365e8d['model']],'as':_0x365e8d['as'],'attributes':_0x365e8d[_0x651e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x651e('0xa')](function(_0x51e793){logger[_0x651e('0x21')](_0x651e('0x1f'),_0x41e5db);logger[_0x651e('0xd')](_0x651e('0x1f'),_0x41e5db,JSON['stringify'](_0x51e793));_0x327fd9(_0x51e793);})[_0x651e('0x14')](function(_0xd1f92b){logger[_0x651e('0x10')](_0x651e('0x1f'),_0xd1f92b[_0x651e('0x12')],_0x41e5db);_0x173a12(_0x1ee608[_0x651e('0x10')](0x1f4,_0xd1f92b[_0x651e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index c54d499..8be223b 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 _0xb124=['getFields','/:id/subjects','getSubjects','getDescriptions','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields'];(function(_0x49d0ea,_0x4b46b9){var _0x260282=function(_0x96590a){while(--_0x96590a){_0x49d0ea['push'](_0x49d0ea['shift']());}};_0x260282(++_0x4b46b9);}(_0xb124,0x11c));var _0x4b12=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xb124[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x4b12('0x0'));var util=require(_0x4b12('0x1'));var path=require(_0x4b12('0x2'));var timeout=require(_0x4b12('0x3'));var express=require(_0x4b12('0x4'));var router=express[_0x4b12('0x5')]();var auth=require(_0x4b12('0x6'));var interaction=require(_0x4b12('0x7'));var config=require(_0x4b12('0x8'));var controller=require(_0x4b12('0x9'));router[_0x4b12('0xa')]('/',auth['isAuthenticated'](),controller[_0x4b12('0xb')]);router[_0x4b12('0xa')](_0x4b12('0xc'),auth[_0x4b12('0xd')](),controller[_0x4b12('0xe')]);router[_0x4b12('0xa')](_0x4b12('0xf'),auth[_0x4b12('0xd')](),controller[_0x4b12('0x10')]);router['get'](_0x4b12('0x11'),auth[_0x4b12('0xd')](),controller[_0x4b12('0x12')]);router[_0x4b12('0xa')]('/:id/descriptions',auth[_0x4b12('0xd')](),controller[_0x4b12('0x13')]);router['post']('/',auth[_0x4b12('0xd')](),controller[_0x4b12('0x14')]);router[_0x4b12('0x15')](_0x4b12('0xc'),auth[_0x4b12('0xd')](),controller['update']);router[_0x4b12('0x16')](_0x4b12('0xc'),auth[_0x4b12('0xd')](),controller[_0x4b12('0x17')]);module[_0x4b12('0x18')]=router; \ No newline at end of file +var _0x8f89=['../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8f89,0x18a));var _0x98f8=function(_0x3fe84b,_0xa79773){_0x3fe84b=_0x3fe84b-0x0;var _0x8b8992=_0x8f89[_0x3fe84b];return _0x8b8992;};'use strict';var multer=require('multer');var util=require(_0x98f8('0x0'));var path=require(_0x98f8('0x1'));var timeout=require(_0x98f8('0x2'));var express=require(_0x98f8('0x3'));var router=express[_0x98f8('0x4')]();var auth=require(_0x98f8('0x5'));var interaction=require(_0x98f8('0x6'));var config=require(_0x98f8('0x7'));var controller=require(_0x98f8('0x8'));router[_0x98f8('0x9')]('/',auth['isAuthenticated'](),controller[_0x98f8('0xa')]);router['get'](_0x98f8('0xb'),auth[_0x98f8('0xc')](),controller[_0x98f8('0xd')]);router[_0x98f8('0x9')](_0x98f8('0xe'),auth[_0x98f8('0xc')](),controller[_0x98f8('0xf')]);router[_0x98f8('0x9')](_0x98f8('0x10'),auth[_0x98f8('0xc')](),controller[_0x98f8('0x11')]);router[_0x98f8('0x9')]('/:id/descriptions',auth[_0x98f8('0xc')](),controller['getDescriptions']);router[_0x98f8('0x12')]('/',auth[_0x98f8('0xc')](),controller[_0x98f8('0x13')]);router[_0x98f8('0x14')](_0x98f8('0xb'),auth[_0x98f8('0xc')](),controller[_0x98f8('0x15')]);router[_0x98f8('0x16')](_0x98f8('0xb'),auth[_0x98f8('0xc')](),controller[_0x98f8('0x17')]);module[_0x98f8('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 7de106c..9bf5af3 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 _0xdec4=['sequelize','exports','STRING'];(function(_0x5f4ac1,_0xb20f2f){var _0x236303=function(_0x3e8ced){while(--_0x3e8ced){_0x5f4ac1['push'](_0x5f4ac1['shift']());}};_0x236303(++_0xb20f2f);}(_0xdec4,0x8a));var _0x4dec=function(_0x35ed46,_0x302ee8){_0x35ed46=_0x35ed46-0x0;var _0x21c831=_0xdec4[_0x35ed46];return _0x21c831;};'use strict';var Sequelize=require(_0x4dec('0x0'));module[_0x4dec('0x1')]={'name':{'type':Sequelize[_0x4dec('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfa56=['exports','sequelize'];(function(_0x2338ae,_0x1896f8){var _0x4adad9=function(_0x1f6ed1){while(--_0x1f6ed1){_0x2338ae['push'](_0x2338ae['shift']());}};_0x4adad9(++_0x1896f8);}(_0xfa56,0xc7));var _0x6fa5=function(_0x60b940,_0x12c62c){_0x60b940=_0x60b940-0x0;var _0xf71966=_0xfa56[_0x60b940];return _0xf71966;};'use strict';var Sequelize=require(_0x6fa5('0x0'));module[_0x6fa5('0x1')]={'name':{'type':Sequelize['STRING']},'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 7ea3a47..d4175c2 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 _0xa774=['body','destroy','params','findOne','SugarcrmField','order','sort','getFields','getSubjects','hasOwnProperty','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','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','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','count','offset','limit','set','save','update','stack','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','pick','filter','where','map','type','key','VIRTUAL','field','merge','SugarcrmConfiguration','includeAll','show','length','options','find','catch'];(function(_0x1d046e,_0x34004c){var _0x238c98=function(_0x2e9b83){while(--_0x2e9b83){_0x1d046e['push'](_0x1d046e['shift']());}};_0x238c98(++_0x34004c);}(_0xa774,0x16b));var _0x4a77=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xa774[_0xaa1b3e];return _0x454d7d;};'use strict';var pdf=require(_0x4a77('0x0'));var emlformat=require(_0x4a77('0x1'));var rimraf=require(_0x4a77('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a77('0x3'));var rp=require(_0x4a77('0x4'));var moment=require(_0x4a77('0x5'));var BPromise=require(_0x4a77('0x6'));var Mustache=require('mustache');var util=require(_0x4a77('0x7'));var path=require(_0x4a77('0x8'));var sox=require(_0x4a77('0x9'));var csv=require(_0x4a77('0xa'));var ejs=require(_0x4a77('0xb'));var fs=require('fs');var _=require(_0x4a77('0xc'));var squel=require(_0x4a77('0xd'));var crypto=require('crypto');var jsforce=require(_0x4a77('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4a77('0xa'));var querystring=require(_0x4a77('0xf'));var Papa=require(_0x4a77('0x10'));var Redis=require('ioredis');var authService=require(_0x4a77('0x11'));var qs=require(_0x4a77('0x12'));var hardwareService=require(_0x4a77('0x13'));var logger=require(_0x4a77('0x14'))('api');var utils=require(_0x4a77('0x15'));var config=require(_0x4a77('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x4a77('0x17'));var client=jayson[_0x4a77('0x18')][_0x4a77('0x19')]({'port':0x232a});function checkPasswordPattern(_0xca8747,_0x54cd15,_0x49af14){if(_0x49af14){var _0x15a33d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x15a33d[_0x4a77('0x1a')](_0x54cd15)){return _0xca8747;}else{throw new Error(_0x4a77('0x1b'));}}else{return _0xca8747;}}function respondWithRpcPromise(_0x17b1fe,_0x3f3ac6,_0x14bcf7,_0xa65751){return new BPromise(function(_0x4514aa,_0x180698){var _0x31af5e=_0xa65751||client;return _0x31af5e[_0x4a77('0x1c')](_0x17b1fe,_0x14bcf7)[_0x4a77('0x1d')](function(_0x25a0b0){logger[_0x4a77('0x1e')](_0x4a77('0x1f'),_0x3f3ac6,_0x4a77('0x20'));logger[_0x4a77('0x21')](_0x4a77('0x22'),_0x3f3ac6,_0x4a77('0x20'),JSON[_0x4a77('0x23')](_0x25a0b0));if(_0x25a0b0['error']){if(_0x25a0b0[_0x4a77('0x24')][_0x4a77('0x25')]===0x1f4){logger[_0x4a77('0x24')](_0x4a77('0x1f'),_0x3f3ac6,_0x25a0b0['error']['message']);return _0x180698(_0x25a0b0['error']['message']);}logger[_0x4a77('0x24')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3f3ac6,_0x25a0b0['error'][_0x4a77('0x26')]);return _0x4514aa(_0x25a0b0['error'][_0x4a77('0x26')]);}else{logger[_0x4a77('0x1e')](_0x4a77('0x1f'),_0x3f3ac6,_0x4a77('0x20'));_0x4514aa(_0x25a0b0['result'][_0x4a77('0x26')]);}})['catch'](function(_0x3124bc){logger[_0x4a77('0x24')](_0x4a77('0x1f'),_0x3f3ac6,_0x3124bc);_0x180698(_0x3124bc);});});}function respondWithStatusCode(_0x58df81,_0x5158e2){_0x5158e2=_0x5158e2||0xcc;return function(_0x1973e0){if(_0x1973e0){return _0x58df81[_0x4a77('0x27')](_0x5158e2);}return _0x58df81[_0x4a77('0x28')](_0x5158e2)[_0x4a77('0x29')]();};}function respondWithResult(_0x171bd3,_0x522f20){_0x522f20=_0x522f20||0xc8;return function(_0x24246d){if(_0x24246d){return _0x171bd3[_0x4a77('0x28')](_0x522f20)[_0x4a77('0x2a')](_0x24246d);}};}function respondWithFilteredResult(_0x2509d4,_0x37b39b){return function(_0x87a91c){if(_0x87a91c){var _0x4a1d32=_0x87a91c[_0x4a77('0x2b')],_0x2295de=_0x37b39b['offset'],_0x198184=_0x37b39b[_0x4a77('0x2c')]+_0x37b39b[_0x4a77('0x2d')],_0x1ee601;if(_0x198184>=_0x4a1d32){_0x198184=_0x4a1d32;_0x1ee601=0xc8;}else{_0x1ee601=0xce;}_0x2509d4[_0x4a77('0x28')](_0x1ee601);return _0x2509d4[_0x4a77('0x2e')]('Content-Range',_0x2295de+'-'+_0x198184+'/'+_0x4a1d32)[_0x4a77('0x2a')](_0x87a91c);}return null;};}function patchUpdates(_0x78ebde){return function(_0x31c9c3){try{jsonpatch['apply'](_0x31c9c3,_0x78ebde,!![]);}catch(_0x172723){return BPromise['reject'](_0x172723);}return _0x31c9c3[_0x4a77('0x2f')]();};}function saveUpdates(_0x41b27a,_0x129c43){return function(_0x5f445f){if(_0x5f445f){return _0x5f445f[_0x4a77('0x30')](_0x41b27a)[_0x4a77('0x1d')](function(_0x51ca71){return _0x51ca71;});}return null;};}function removeEntity(_0x188547,_0x16c885){return function(_0x4524a5){if(_0x4524a5){return _0x4524a5['destroy']()[_0x4a77('0x1d')](function(){_0x188547['status'](0xcc)[_0x4a77('0x29')]();});}};}function handleEntityNotFound(_0x14d747,_0x38df50){return function(_0x21a986){if(!_0x21a986){_0x14d747['sendStatus'](0x194);}return _0x21a986;};}function handleError(_0x28c3cb,_0x1384d9){_0x1384d9=_0x1384d9||0x1f4;return function(_0x107529){logger['error'](_0x107529[_0x4a77('0x31')]);if(_0x107529[_0x4a77('0x32')]){delete _0x107529[_0x4a77('0x32')];}_0x28c3cb[_0x4a77('0x28')](_0x1384d9)['send'](_0x107529);};}exports[_0x4a77('0x33')]=function(_0x240e53,_0x461635){var _0x45740e={},_0x29ac6a={},_0x418d7b={'count':0x0,'rows':[]};var _0x54b074=db['SugarcrmConfiguration'][_0x4a77('0x34')];_0x29ac6a[_0x4a77('0x35')]=_[_0x4a77('0x36')](_0x54b074);_0x29ac6a[_0x4a77('0x37')]=_[_0x4a77('0x36')](_0x240e53[_0x4a77('0x37')]);_0x29ac6a[_0x4a77('0x38')]=_[_0x4a77('0x39')](_0x29ac6a[_0x4a77('0x35')],_0x29ac6a[_0x4a77('0x37')]);_0x45740e[_0x4a77('0x3a')]=_['intersection'](_0x29ac6a[_0x4a77('0x35')],qs['fields'](_0x240e53[_0x4a77('0x37')][_0x4a77('0x3b')]));_0x45740e[_0x4a77('0x3a')]=_0x45740e[_0x4a77('0x3a')]['length']?_0x45740e[_0x4a77('0x3a')]:_0x29ac6a[_0x4a77('0x35')];if(!_0x240e53[_0x4a77('0x37')]['hasOwnProperty'](_0x4a77('0x3c'))){_0x45740e['limit']=qs[_0x4a77('0x2d')](_0x240e53[_0x4a77('0x37')]['limit']);_0x45740e['offset']=qs['offset'](_0x240e53[_0x4a77('0x37')][_0x4a77('0x2c')]);}_0x45740e['order']=qs['sort'](_0x240e53[_0x4a77('0x37')]['sort']);_0x45740e['where']=qs['filters'](_[_0x4a77('0x3d')](_0x240e53[_0x4a77('0x37')],_0x29ac6a['filters']));if(_0x240e53['query'][_0x4a77('0x3e')]){_0x45740e[_0x4a77('0x3f')]=_['merge'](_0x45740e[_0x4a77('0x3f')],{'$or':_[_0x4a77('0x40')](_0x54b074,function(_0xa62cbe){if(_0xa62cbe[_0x4a77('0x41')][_0x4a77('0x42')]!==_0x4a77('0x43')){var _0x5bdf6a={};_0x5bdf6a[_0xa62cbe[_0x4a77('0x44')]]={'$like':'%'+_0x240e53['query'][_0x4a77('0x3e')]+'%'};return _0x5bdf6a;}})});}_0x45740e=_[_0x4a77('0x45')]({},_0x45740e,_0x240e53['options']);var _0x1ad25e={'where':_0x45740e[_0x4a77('0x3f')]};return db[_0x4a77('0x46')][_0x4a77('0x2b')](_0x1ad25e)[_0x4a77('0x1d')](function(_0x40f0f1){_0x418d7b[_0x4a77('0x2b')]=_0x40f0f1;if(_0x240e53[_0x4a77('0x37')][_0x4a77('0x47')]){_0x45740e['include']=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x45740e);})[_0x4a77('0x1d')](function(_0x41aa9f){_0x418d7b['rows']=_0x41aa9f;return _0x418d7b;})[_0x4a77('0x1d')](respondWithFilteredResult(_0x461635,_0x45740e))['catch'](handleError(_0x461635,null));};exports[_0x4a77('0x48')]=function(_0x59b03f,_0xb6b0ef){var _0x32e236={'raw':![],'where':{'id':_0x59b03f['params']['id']}},_0x55bb8b={};_0x55bb8b[_0x4a77('0x35')]=_[_0x4a77('0x36')](db[_0x4a77('0x46')][_0x4a77('0x34')]);_0x55bb8b[_0x4a77('0x37')]=_['keys'](_0x59b03f['query']);_0x55bb8b['filters']=_[_0x4a77('0x39')](_0x55bb8b[_0x4a77('0x35')],_0x55bb8b[_0x4a77('0x37')]);_0x32e236[_0x4a77('0x3a')]=_[_0x4a77('0x39')](_0x55bb8b[_0x4a77('0x35')],qs[_0x4a77('0x3b')](_0x59b03f[_0x4a77('0x37')]['fields']));_0x32e236[_0x4a77('0x3a')]=_0x32e236[_0x4a77('0x3a')][_0x4a77('0x49')]?_0x32e236[_0x4a77('0x3a')]:_0x55bb8b[_0x4a77('0x35')];if(_0x59b03f[_0x4a77('0x37')][_0x4a77('0x47')]){_0x32e236['include']=[{'all':!![]}];}_0x32e236=_[_0x4a77('0x45')]({},_0x32e236,_0x59b03f[_0x4a77('0x4a')]);return db[_0x4a77('0x46')][_0x4a77('0x4b')](_0x32e236)['then'](handleEntityNotFound(_0xb6b0ef,null))[_0x4a77('0x1d')](respondWithResult(_0xb6b0ef,null))['catch'](handleError(_0xb6b0ef,null));};exports['create']=function(_0x2a7062,_0x2af591){return db[_0x4a77('0x46')]['create'](_0x2a7062['body'],{})[_0x4a77('0x1d')](respondWithResult(_0x2af591,0xc9))[_0x4a77('0x4c')](handleError(_0x2af591,null));};exports[_0x4a77('0x30')]=function(_0x10039f,_0x521f84){if(_0x10039f[_0x4a77('0x4d')]['id']){delete _0x10039f['body']['id'];}return db[_0x4a77('0x46')][_0x4a77('0x4b')]({'where':{'id':_0x10039f['params']['id']}})[_0x4a77('0x1d')](handleEntityNotFound(_0x521f84,null))[_0x4a77('0x1d')](saveUpdates(_0x10039f[_0x4a77('0x4d')],null))[_0x4a77('0x1d')](respondWithResult(_0x521f84,null))[_0x4a77('0x4c')](handleError(_0x521f84,null));};exports[_0x4a77('0x4e')]=function(_0x232261,_0x23b4f5){return db[_0x4a77('0x46')][_0x4a77('0x4b')]({'where':{'id':_0x232261[_0x4a77('0x4f')]['id']}})[_0x4a77('0x1d')](handleEntityNotFound(_0x23b4f5,null))['then'](removeEntity(_0x23b4f5,null))[_0x4a77('0x4c')](handleError(_0x23b4f5,null));};exports['getFields']=function(_0x703e2c,_0x3e7a23,_0x31094e){var _0x244e99={};var _0x33f2d9={};var _0x2fc2d1;var _0x46bad7;return db[_0x4a77('0x46')][_0x4a77('0x50')]({'where':{'id':_0x703e2c[_0x4a77('0x4f')]['id']}})[_0x4a77('0x1d')](handleEntityNotFound(_0x3e7a23,null))[_0x4a77('0x1d')](function(_0x38c1a){if(_0x38c1a){_0x2fc2d1=_0x38c1a;_0x33f2d9['model']=_['keys'](db[_0x4a77('0x51')][_0x4a77('0x34')]);_0x33f2d9[_0x4a77('0x37')]=_[_0x4a77('0x36')](_0x703e2c[_0x4a77('0x37')]);_0x33f2d9[_0x4a77('0x38')]=_['intersection'](_0x33f2d9[_0x4a77('0x35')],_0x33f2d9['query']);_0x244e99[_0x4a77('0x3a')]=_['intersection'](_0x33f2d9[_0x4a77('0x35')],qs[_0x4a77('0x3b')](_0x703e2c[_0x4a77('0x37')][_0x4a77('0x3b')]));_0x244e99['attributes']=_0x244e99[_0x4a77('0x3a')][_0x4a77('0x49')]?_0x244e99['attributes']:_0x33f2d9[_0x4a77('0x35')];_0x244e99[_0x4a77('0x52')]=qs['sort'](_0x703e2c[_0x4a77('0x37')][_0x4a77('0x53')]);_0x244e99[_0x4a77('0x3f')]=qs[_0x4a77('0x38')](_[_0x4a77('0x3d')](_0x703e2c[_0x4a77('0x37')],_0x33f2d9['filters']));if(_0x703e2c['query'][_0x4a77('0x3e')]){_0x244e99['where']=_['merge'](_0x244e99[_0x4a77('0x3f')],{'$or':_[_0x4a77('0x40')](_0x244e99[_0x4a77('0x3a')],function(_0x332987){var _0x18a4f0={};_0x18a4f0[_0x332987]={'$like':'%'+_0x703e2c[_0x4a77('0x37')][_0x4a77('0x3e')]+'%'};return _0x18a4f0;})});}_0x244e99=_[_0x4a77('0x45')]({},_0x244e99,_0x703e2c[_0x4a77('0x4a')]);return _0x2fc2d1[_0x4a77('0x54')](_0x244e99);}})[_0x4a77('0x1d')](function(_0x57ff6e){if(_0x57ff6e){_0x46bad7=_0x57ff6e['length'];if(!_0x703e2c[_0x4a77('0x37')]['hasOwnProperty']('nolimit')){_0x244e99[_0x4a77('0x2d')]=qs[_0x4a77('0x2d')](_0x703e2c['query'][_0x4a77('0x2d')]);_0x244e99[_0x4a77('0x2c')]=qs[_0x4a77('0x2c')](_0x703e2c[_0x4a77('0x37')][_0x4a77('0x2c')]);}return _0x2fc2d1[_0x4a77('0x54')](_0x244e99);}})[_0x4a77('0x1d')](function(_0x3df65c){if(_0x3df65c){return _0x3df65c?{'count':_0x46bad7,'rows':_0x3df65c}:null;}})[_0x4a77('0x1d')](respondWithResult(_0x3e7a23,null))[_0x4a77('0x4c')](handleError(_0x3e7a23,null));};exports[_0x4a77('0x55')]=function(_0x5f8c5,_0x47d70e,_0x22a633){var _0x454add={};var _0xea083d={};var _0x1ab190;var _0x380aa8;return db[_0x4a77('0x46')]['findOne']({'where':{'id':_0x5f8c5[_0x4a77('0x4f')]['id']}})[_0x4a77('0x1d')](handleEntityNotFound(_0x47d70e,null))[_0x4a77('0x1d')](function(_0x1de7e4){if(_0x1de7e4){_0x1ab190=_0x1de7e4;_0xea083d[_0x4a77('0x35')]=_[_0x4a77('0x36')](db[_0x4a77('0x51')][_0x4a77('0x34')]);_0xea083d[_0x4a77('0x37')]=_[_0x4a77('0x36')](_0x5f8c5[_0x4a77('0x37')]);_0xea083d['filters']=_[_0x4a77('0x39')](_0xea083d[_0x4a77('0x35')],_0xea083d['query']);_0x454add[_0x4a77('0x3a')]=_[_0x4a77('0x39')](_0xea083d[_0x4a77('0x35')],qs['fields'](_0x5f8c5['query'][_0x4a77('0x3b')]));_0x454add[_0x4a77('0x3a')]=_0x454add['attributes']['length']?_0x454add[_0x4a77('0x3a')]:_0xea083d[_0x4a77('0x35')];_0x454add[_0x4a77('0x52')]=qs[_0x4a77('0x53')](_0x5f8c5[_0x4a77('0x37')][_0x4a77('0x53')]);_0x454add[_0x4a77('0x3f')]=qs[_0x4a77('0x38')](_[_0x4a77('0x3d')](_0x5f8c5['query'],_0xea083d[_0x4a77('0x38')]));if(_0x5f8c5[_0x4a77('0x37')][_0x4a77('0x3e')]){_0x454add[_0x4a77('0x3f')]=_[_0x4a77('0x45')](_0x454add[_0x4a77('0x3f')],{'$or':_[_0x4a77('0x40')](_0x454add[_0x4a77('0x3a')],function(_0x3d911e){var _0x2d6aae={};_0x2d6aae[_0x3d911e]={'$like':'%'+_0x5f8c5[_0x4a77('0x37')][_0x4a77('0x3e')]+'%'};return _0x2d6aae;})});}_0x454add=_[_0x4a77('0x45')]({},_0x454add,_0x5f8c5['options']);return _0x1ab190['getSubjects'](_0x454add);}})[_0x4a77('0x1d')](function(_0x4d5b00){if(_0x4d5b00){_0x380aa8=_0x4d5b00['length'];if(!_0x5f8c5[_0x4a77('0x37')][_0x4a77('0x56')](_0x4a77('0x3c'))){_0x454add[_0x4a77('0x2d')]=qs[_0x4a77('0x2d')](_0x5f8c5[_0x4a77('0x37')]['limit']);_0x454add[_0x4a77('0x2c')]=qs[_0x4a77('0x2c')](_0x5f8c5[_0x4a77('0x37')][_0x4a77('0x2c')]);}return _0x1ab190[_0x4a77('0x55')](_0x454add);}})['then'](function(_0xc07104){if(_0xc07104){return _0xc07104?{'count':_0x380aa8,'rows':_0xc07104}:null;}})['then'](respondWithResult(_0x47d70e,null))[_0x4a77('0x4c')](handleError(_0x47d70e,null));};exports[_0x4a77('0x57')]=function(_0x3ec317,_0xce7f84,_0x5d7075){var _0x205402={};var _0x22a536={};var _0x4de8b0;var _0x16c126;return db[_0x4a77('0x46')]['findOne']({'where':{'id':_0x3ec317[_0x4a77('0x4f')]['id']}})[_0x4a77('0x1d')](handleEntityNotFound(_0xce7f84,null))[_0x4a77('0x1d')](function(_0x4a57cb){if(_0x4a57cb){_0x4de8b0=_0x4a57cb;_0x22a536[_0x4a77('0x35')]=_[_0x4a77('0x36')](db[_0x4a77('0x51')][_0x4a77('0x34')]);_0x22a536[_0x4a77('0x37')]=_[_0x4a77('0x36')](_0x3ec317[_0x4a77('0x37')]);_0x22a536[_0x4a77('0x38')]=_['intersection'](_0x22a536[_0x4a77('0x35')],_0x22a536[_0x4a77('0x37')]);_0x205402[_0x4a77('0x3a')]=_[_0x4a77('0x39')](_0x22a536[_0x4a77('0x35')],qs[_0x4a77('0x3b')](_0x3ec317[_0x4a77('0x37')][_0x4a77('0x3b')]));_0x205402['attributes']=_0x205402[_0x4a77('0x3a')][_0x4a77('0x49')]?_0x205402[_0x4a77('0x3a')]:_0x22a536[_0x4a77('0x35')];_0x205402[_0x4a77('0x52')]=qs[_0x4a77('0x53')](_0x3ec317['query'][_0x4a77('0x53')]);_0x205402[_0x4a77('0x3f')]=qs[_0x4a77('0x38')](_['pick'](_0x3ec317['query'],_0x22a536['filters']));if(_0x3ec317[_0x4a77('0x37')][_0x4a77('0x3e')]){_0x205402[_0x4a77('0x3f')]=_[_0x4a77('0x45')](_0x205402[_0x4a77('0x3f')],{'$or':_[_0x4a77('0x40')](_0x205402[_0x4a77('0x3a')],function(_0x79301b){var _0x49741a={};_0x49741a[_0x79301b]={'$like':'%'+_0x3ec317[_0x4a77('0x37')][_0x4a77('0x3e')]+'%'};return _0x49741a;})});}_0x205402=_[_0x4a77('0x45')]({},_0x205402,_0x3ec317[_0x4a77('0x4a')]);return _0x4de8b0[_0x4a77('0x57')](_0x205402);}})['then'](function(_0x38ba62){if(_0x38ba62){_0x16c126=_0x38ba62[_0x4a77('0x49')];if(!_0x3ec317[_0x4a77('0x37')][_0x4a77('0x56')](_0x4a77('0x3c'))){_0x205402['limit']=qs['limit'](_0x3ec317[_0x4a77('0x37')]['limit']);_0x205402[_0x4a77('0x2c')]=qs[_0x4a77('0x2c')](_0x3ec317[_0x4a77('0x37')][_0x4a77('0x2c')]);}return _0x4de8b0[_0x4a77('0x57')](_0x205402);}})[_0x4a77('0x1d')](function(_0x454969){if(_0x454969){return _0x454969?{'count':_0x16c126,'rows':_0x454969}:null;}})[_0x4a77('0x1d')](respondWithResult(_0xce7f84,null))[_0x4a77('0x4c')](handleError(_0xce7f84,null));}; \ No newline at end of file +var _0x7ecd=['lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../mysqldb','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','end','stack','name','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','field','options','SugarcrmConfiguration','includeAll','include','findAll','rows','show','find','create','body','params','destroy','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x4ba9d7,_0x2ec6cc){var _0x45866e=function(_0x19036a){while(--_0x19036a){_0x4ba9d7['push'](_0x4ba9d7['shift']());}};_0x45866e(++_0x2ec6cc);}(_0x7ecd,0xa4));var _0xd7ec=function(_0x1c832e,_0x916f43){_0x1c832e=_0x1c832e-0x0;var _0x58cb2a=_0x7ecd[_0x1c832e];return _0x58cb2a;};'use strict';var pdf=require(_0xd7ec('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd7ec('0x1'));var zipdir=require(_0xd7ec('0x2'));var jsonpatch=require(_0xd7ec('0x3'));var rp=require(_0xd7ec('0x4'));var moment=require(_0xd7ec('0x5'));var BPromise=require(_0xd7ec('0x6'));var Mustache=require(_0xd7ec('0x7'));var util=require(_0xd7ec('0x8'));var path=require(_0xd7ec('0x9'));var sox=require(_0xd7ec('0xa'));var csv=require('to-csv');var ejs=require(_0xd7ec('0xb'));var fs=require('fs');var _=require(_0xd7ec('0xc'));var squel=require(_0xd7ec('0xd'));var crypto=require('crypto');var jsforce=require(_0xd7ec('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd7ec('0xf'));var querystring=require(_0xd7ec('0x10'));var Papa=require(_0xd7ec('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd7ec('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7ec('0x13'))(_0xd7ec('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xd7ec('0x15'))['db'];var jayson=require(_0xd7ec('0x16'));var client=jayson[_0xd7ec('0x17')][_0xd7ec('0x18')]({'port':0x232a});function checkPasswordPattern(_0x2c4433,_0x3efe93,_0x3e8a65){if(_0x3e8a65){var _0x1a74b5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a74b5['test'](_0x3efe93)){return _0x2c4433;}else{throw new Error(_0xd7ec('0x19'));}}else{return _0x2c4433;}}function respondWithRpcPromise(_0x154ead,_0x3687a6,_0x3ecf86,_0x5bc103){return new BPromise(function(_0x3b554d,_0x8d34e2){var _0x1cd4fd=_0x5bc103||client;return _0x1cd4fd[_0xd7ec('0x1a')](_0x154ead,_0x3ecf86)[_0xd7ec('0x1b')](function(_0x3ca0c1){logger[_0xd7ec('0x1c')](_0xd7ec('0x1d'),_0x3687a6,_0xd7ec('0x1e'));logger[_0xd7ec('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x3687a6,_0xd7ec('0x1e'),JSON[_0xd7ec('0x20')](_0x3ca0c1));if(_0x3ca0c1['error']){if(_0x3ca0c1[_0xd7ec('0x21')]['code']===0x1f4){logger[_0xd7ec('0x21')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3687a6,_0x3ca0c1['error'][_0xd7ec('0x22')]);return _0x8d34e2(_0x3ca0c1[_0xd7ec('0x21')][_0xd7ec('0x22')]);}logger[_0xd7ec('0x21')](_0xd7ec('0x1d'),_0x3687a6,_0x3ca0c1[_0xd7ec('0x21')][_0xd7ec('0x22')]);return _0x3b554d(_0x3ca0c1[_0xd7ec('0x21')]['message']);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x3687a6,_0xd7ec('0x1e'));_0x3b554d(_0x3ca0c1['result'][_0xd7ec('0x22')]);}})[_0xd7ec('0x23')](function(_0x365941){logger[_0xd7ec('0x21')](_0xd7ec('0x1d'),_0x3687a6,_0x365941);_0x8d34e2(_0x365941);});});}function respondWithStatusCode(_0x1f050b,_0x405f2a){_0x405f2a=_0x405f2a||0xcc;return function(_0x62278a){if(_0x62278a){return _0x1f050b['sendStatus'](_0x405f2a);}return _0x1f050b[_0xd7ec('0x24')](_0x405f2a)['end']();};}function respondWithResult(_0x54d93d,_0x2815e2){_0x2815e2=_0x2815e2||0xc8;return function(_0x100dbf){if(_0x100dbf){return _0x54d93d['status'](_0x2815e2)[_0xd7ec('0x25')](_0x100dbf);}};}function respondWithFilteredResult(_0xfd803c,_0xc38281){return function(_0x9bb8c9){if(_0x9bb8c9){var _0x3cea82=_0x9bb8c9[_0xd7ec('0x26')],_0x51fa99=_0xc38281[_0xd7ec('0x27')],_0x4505e0=_0xc38281[_0xd7ec('0x27')]+_0xc38281[_0xd7ec('0x28')],_0x38ac7e;if(_0x4505e0>=_0x3cea82){_0x4505e0=_0x3cea82;_0x38ac7e=0xc8;}else{_0x38ac7e=0xce;}_0xfd803c[_0xd7ec('0x24')](_0x38ac7e);return _0xfd803c[_0xd7ec('0x29')](_0xd7ec('0x2a'),_0x51fa99+'-'+_0x4505e0+'/'+_0x3cea82)[_0xd7ec('0x25')](_0x9bb8c9);}return null;};}function patchUpdates(_0x238b2e){return function(_0xd419cd){try{jsonpatch[_0xd7ec('0x2b')](_0xd419cd,_0x238b2e,!![]);}catch(_0x118662){return BPromise[_0xd7ec('0x2c')](_0x118662);}return _0xd419cd[_0xd7ec('0x2d')]();};}function saveUpdates(_0x429c3b,_0x1175dd){return function(_0xc412f2){if(_0xc412f2){return _0xc412f2[_0xd7ec('0x2e')](_0x429c3b)[_0xd7ec('0x1b')](function(_0x14afee){return _0x14afee;});}return null;};}function removeEntity(_0x479d8a,_0x1ed98d){return function(_0x4e7a9d){if(_0x4e7a9d){return _0x4e7a9d['destroy']()[_0xd7ec('0x1b')](function(){_0x479d8a[_0xd7ec('0x24')](0xcc)[_0xd7ec('0x2f')]();});}};}function handleEntityNotFound(_0x11fd24,_0x3f8ec4){return function(_0x425877){if(!_0x425877){_0x11fd24['sendStatus'](0x194);}return _0x425877;};}function handleError(_0x831362,_0x5318c2){_0x5318c2=_0x5318c2||0x1f4;return function(_0x1eede1){logger[_0xd7ec('0x21')](_0x1eede1[_0xd7ec('0x30')]);if(_0x1eede1['name']){delete _0x1eede1[_0xd7ec('0x31')];}_0x831362[_0xd7ec('0x24')](_0x5318c2)['send'](_0x1eede1);};}exports['index']=function(_0x58dffe,_0xb6b8d1){var _0x10a2ea={},_0xdb0bea={},_0x57462c={'count':0x0,'rows':[]};var _0x77a7cf=db['SugarcrmConfiguration'][_0xd7ec('0x32')];_0xdb0bea[_0xd7ec('0x33')]=_['keys'](_0x77a7cf);_0xdb0bea['query']=_[_0xd7ec('0x34')](_0x58dffe[_0xd7ec('0x35')]);_0xdb0bea[_0xd7ec('0x36')]=_['intersection'](_0xdb0bea[_0xd7ec('0x33')],_0xdb0bea[_0xd7ec('0x35')]);_0x10a2ea[_0xd7ec('0x37')]=_[_0xd7ec('0x38')](_0xdb0bea[_0xd7ec('0x33')],qs[_0xd7ec('0x39')](_0x58dffe['query'][_0xd7ec('0x39')]));_0x10a2ea['attributes']=_0x10a2ea[_0xd7ec('0x37')][_0xd7ec('0x3a')]?_0x10a2ea[_0xd7ec('0x37')]:_0xdb0bea[_0xd7ec('0x33')];if(!_0x58dffe[_0xd7ec('0x35')][_0xd7ec('0x3b')](_0xd7ec('0x3c'))){_0x10a2ea[_0xd7ec('0x28')]=qs[_0xd7ec('0x28')](_0x58dffe['query'][_0xd7ec('0x28')]);_0x10a2ea[_0xd7ec('0x27')]=qs[_0xd7ec('0x27')](_0x58dffe[_0xd7ec('0x35')][_0xd7ec('0x27')]);}_0x10a2ea[_0xd7ec('0x3d')]=qs['sort'](_0x58dffe['query'][_0xd7ec('0x3e')]);_0x10a2ea['where']=qs[_0xd7ec('0x36')](_[_0xd7ec('0x3f')](_0x58dffe[_0xd7ec('0x35')],_0xdb0bea['filters']));if(_0x58dffe[_0xd7ec('0x35')][_0xd7ec('0x40')]){_0x10a2ea[_0xd7ec('0x41')]=_[_0xd7ec('0x42')](_0x10a2ea[_0xd7ec('0x41')],{'$or':_[_0xd7ec('0x43')](_0x77a7cf,function(_0xa64641){if(_0xa64641[_0xd7ec('0x44')]['key']!==_0xd7ec('0x45')){var _0x2b3cd6={};_0x2b3cd6[_0xa64641[_0xd7ec('0x46')]]={'$like':'%'+_0x58dffe[_0xd7ec('0x35')][_0xd7ec('0x40')]+'%'};return _0x2b3cd6;}})});}_0x10a2ea=_[_0xd7ec('0x42')]({},_0x10a2ea,_0x58dffe[_0xd7ec('0x47')]);var _0x4f21e4={'where':_0x10a2ea[_0xd7ec('0x41')]};return db[_0xd7ec('0x48')][_0xd7ec('0x26')](_0x4f21e4)[_0xd7ec('0x1b')](function(_0x5123ef){_0x57462c[_0xd7ec('0x26')]=_0x5123ef;if(_0x58dffe['query'][_0xd7ec('0x49')]){_0x10a2ea[_0xd7ec('0x4a')]=[{'all':!![]}];}return db[_0xd7ec('0x48')][_0xd7ec('0x4b')](_0x10a2ea);})[_0xd7ec('0x1b')](function(_0x26e8af){_0x57462c[_0xd7ec('0x4c')]=_0x26e8af;return _0x57462c;})['then'](respondWithFilteredResult(_0xb6b8d1,_0x10a2ea))[_0xd7ec('0x23')](handleError(_0xb6b8d1,null));};exports[_0xd7ec('0x4d')]=function(_0x309236,_0x55a3bc){var _0x245d1b={'raw':![],'where':{'id':_0x309236['params']['id']}},_0x18bbda={};_0x18bbda[_0xd7ec('0x33')]=_[_0xd7ec('0x34')](db[_0xd7ec('0x48')][_0xd7ec('0x32')]);_0x18bbda['query']=_[_0xd7ec('0x34')](_0x309236[_0xd7ec('0x35')]);_0x18bbda['filters']=_[_0xd7ec('0x38')](_0x18bbda[_0xd7ec('0x33')],_0x18bbda[_0xd7ec('0x35')]);_0x245d1b[_0xd7ec('0x37')]=_[_0xd7ec('0x38')](_0x18bbda[_0xd7ec('0x33')],qs[_0xd7ec('0x39')](_0x309236['query'][_0xd7ec('0x39')]));_0x245d1b[_0xd7ec('0x37')]=_0x245d1b['attributes']['length']?_0x245d1b[_0xd7ec('0x37')]:_0x18bbda[_0xd7ec('0x33')];if(_0x309236[_0xd7ec('0x35')][_0xd7ec('0x49')]){_0x245d1b[_0xd7ec('0x4a')]=[{'all':!![]}];}_0x245d1b=_[_0xd7ec('0x42')]({},_0x245d1b,_0x309236['options']);return db[_0xd7ec('0x48')][_0xd7ec('0x4e')](_0x245d1b)['then'](handleEntityNotFound(_0x55a3bc,null))[_0xd7ec('0x1b')](respondWithResult(_0x55a3bc,null))[_0xd7ec('0x23')](handleError(_0x55a3bc,null));};exports[_0xd7ec('0x4f')]=function(_0x1b455c,_0x542403){return db['SugarcrmConfiguration'][_0xd7ec('0x4f')](_0x1b455c[_0xd7ec('0x50')],{})[_0xd7ec('0x1b')](respondWithResult(_0x542403,0xc9))[_0xd7ec('0x23')](handleError(_0x542403,null));};exports[_0xd7ec('0x2e')]=function(_0x235845,_0x19b3e2){if(_0x235845['body']['id']){delete _0x235845[_0xd7ec('0x50')]['id'];}return db[_0xd7ec('0x48')][_0xd7ec('0x4e')]({'where':{'id':_0x235845[_0xd7ec('0x51')]['id']}})[_0xd7ec('0x1b')](handleEntityNotFound(_0x19b3e2,null))[_0xd7ec('0x1b')](saveUpdates(_0x235845['body'],null))[_0xd7ec('0x1b')](respondWithResult(_0x19b3e2,null))[_0xd7ec('0x23')](handleError(_0x19b3e2,null));};exports[_0xd7ec('0x52')]=function(_0x2f0b34,_0x358b1f){return db[_0xd7ec('0x48')][_0xd7ec('0x4e')]({'where':{'id':_0x2f0b34[_0xd7ec('0x51')]['id']}})['then'](handleEntityNotFound(_0x358b1f,null))[_0xd7ec('0x1b')](removeEntity(_0x358b1f,null))[_0xd7ec('0x23')](handleError(_0x358b1f,null));};exports[_0xd7ec('0x53')]=function(_0x4bfb16,_0x2de998,_0x1610e1){var _0x4d4a09={};var _0x4a1ce2={};var _0x5dff43;var _0xabeb95;return db[_0xd7ec('0x48')][_0xd7ec('0x54')]({'where':{'id':_0x4bfb16[_0xd7ec('0x51')]['id']}})[_0xd7ec('0x1b')](handleEntityNotFound(_0x2de998,null))['then'](function(_0x3a6309){if(_0x3a6309){_0x5dff43=_0x3a6309;_0x4a1ce2['model']=_[_0xd7ec('0x34')](db[_0xd7ec('0x55')][_0xd7ec('0x32')]);_0x4a1ce2[_0xd7ec('0x35')]=_[_0xd7ec('0x34')](_0x4bfb16['query']);_0x4a1ce2[_0xd7ec('0x36')]=_[_0xd7ec('0x38')](_0x4a1ce2['model'],_0x4a1ce2[_0xd7ec('0x35')]);_0x4d4a09[_0xd7ec('0x37')]=_[_0xd7ec('0x38')](_0x4a1ce2[_0xd7ec('0x33')],qs['fields'](_0x4bfb16[_0xd7ec('0x35')]['fields']));_0x4d4a09[_0xd7ec('0x37')]=_0x4d4a09[_0xd7ec('0x37')]['length']?_0x4d4a09[_0xd7ec('0x37')]:_0x4a1ce2['model'];_0x4d4a09[_0xd7ec('0x3d')]=qs['sort'](_0x4bfb16[_0xd7ec('0x35')][_0xd7ec('0x3e')]);_0x4d4a09[_0xd7ec('0x41')]=qs[_0xd7ec('0x36')](_[_0xd7ec('0x3f')](_0x4bfb16[_0xd7ec('0x35')],_0x4a1ce2[_0xd7ec('0x36')]));if(_0x4bfb16['query'][_0xd7ec('0x40')]){_0x4d4a09[_0xd7ec('0x41')]=_[_0xd7ec('0x42')](_0x4d4a09[_0xd7ec('0x41')],{'$or':_[_0xd7ec('0x43')](_0x4d4a09[_0xd7ec('0x37')],function(_0x1351fb){var _0x5ca209={};_0x5ca209[_0x1351fb]={'$like':'%'+_0x4bfb16[_0xd7ec('0x35')]['filter']+'%'};return _0x5ca209;})});}_0x4d4a09=_[_0xd7ec('0x42')]({},_0x4d4a09,_0x4bfb16['options']);return _0x5dff43[_0xd7ec('0x53')](_0x4d4a09);}})['then'](function(_0x508730){if(_0x508730){_0xabeb95=_0x508730[_0xd7ec('0x3a')];if(!_0x4bfb16[_0xd7ec('0x35')][_0xd7ec('0x3b')](_0xd7ec('0x3c'))){_0x4d4a09[_0xd7ec('0x28')]=qs['limit'](_0x4bfb16[_0xd7ec('0x35')][_0xd7ec('0x28')]);_0x4d4a09[_0xd7ec('0x27')]=qs[_0xd7ec('0x27')](_0x4bfb16['query'][_0xd7ec('0x27')]);}return _0x5dff43[_0xd7ec('0x53')](_0x4d4a09);}})['then'](function(_0x504b3e){if(_0x504b3e){return _0x504b3e?{'count':_0xabeb95,'rows':_0x504b3e}:null;}})['then'](respondWithResult(_0x2de998,null))[_0xd7ec('0x23')](handleError(_0x2de998,null));};exports['getSubjects']=function(_0x41f660,_0x24de4c,_0x4312ef){var _0x1e3218={};var _0x547b48={};var _0xe6c73c;var _0x273bdb;return db[_0xd7ec('0x48')][_0xd7ec('0x54')]({'where':{'id':_0x41f660[_0xd7ec('0x51')]['id']}})[_0xd7ec('0x1b')](handleEntityNotFound(_0x24de4c,null))[_0xd7ec('0x1b')](function(_0x257aae){if(_0x257aae){_0xe6c73c=_0x257aae;_0x547b48[_0xd7ec('0x33')]=_[_0xd7ec('0x34')](db[_0xd7ec('0x55')][_0xd7ec('0x32')]);_0x547b48[_0xd7ec('0x35')]=_[_0xd7ec('0x34')](_0x41f660[_0xd7ec('0x35')]);_0x547b48[_0xd7ec('0x36')]=_[_0xd7ec('0x38')](_0x547b48[_0xd7ec('0x33')],_0x547b48[_0xd7ec('0x35')]);_0x1e3218['attributes']=_['intersection'](_0x547b48[_0xd7ec('0x33')],qs[_0xd7ec('0x39')](_0x41f660['query'][_0xd7ec('0x39')]));_0x1e3218['attributes']=_0x1e3218[_0xd7ec('0x37')][_0xd7ec('0x3a')]?_0x1e3218[_0xd7ec('0x37')]:_0x547b48[_0xd7ec('0x33')];_0x1e3218[_0xd7ec('0x3d')]=qs[_0xd7ec('0x3e')](_0x41f660[_0xd7ec('0x35')][_0xd7ec('0x3e')]);_0x1e3218[_0xd7ec('0x41')]=qs[_0xd7ec('0x36')](_['pick'](_0x41f660[_0xd7ec('0x35')],_0x547b48[_0xd7ec('0x36')]));if(_0x41f660[_0xd7ec('0x35')][_0xd7ec('0x40')]){_0x1e3218[_0xd7ec('0x41')]=_['merge'](_0x1e3218['where'],{'$or':_[_0xd7ec('0x43')](_0x1e3218[_0xd7ec('0x37')],function(_0x191f9d){var _0x18a4b8={};_0x18a4b8[_0x191f9d]={'$like':'%'+_0x41f660[_0xd7ec('0x35')][_0xd7ec('0x40')]+'%'};return _0x18a4b8;})});}_0x1e3218=_[_0xd7ec('0x42')]({},_0x1e3218,_0x41f660['options']);return _0xe6c73c[_0xd7ec('0x56')](_0x1e3218);}})['then'](function(_0x4999f1){if(_0x4999f1){_0x273bdb=_0x4999f1[_0xd7ec('0x3a')];if(!_0x41f660['query'][_0xd7ec('0x3b')](_0xd7ec('0x3c'))){_0x1e3218['limit']=qs[_0xd7ec('0x28')](_0x41f660[_0xd7ec('0x35')][_0xd7ec('0x28')]);_0x1e3218['offset']=qs[_0xd7ec('0x27')](_0x41f660[_0xd7ec('0x35')][_0xd7ec('0x27')]);}return _0xe6c73c['getSubjects'](_0x1e3218);}})[_0xd7ec('0x1b')](function(_0x20c2ce){if(_0x20c2ce){return _0x20c2ce?{'count':_0x273bdb,'rows':_0x20c2ce}:null;}})[_0xd7ec('0x1b')](respondWithResult(_0x24de4c,null))[_0xd7ec('0x23')](handleError(_0x24de4c,null));};exports[_0xd7ec('0x57')]=function(_0x41ec67,_0xb9b9fa,_0x462169){var _0x46d45b={};var _0x45952d={};var _0x4cf967;var _0x579d07;return db[_0xd7ec('0x48')][_0xd7ec('0x54')]({'where':{'id':_0x41ec67[_0xd7ec('0x51')]['id']}})[_0xd7ec('0x1b')](handleEntityNotFound(_0xb9b9fa,null))[_0xd7ec('0x1b')](function(_0x68fe1a){if(_0x68fe1a){_0x4cf967=_0x68fe1a;_0x45952d['model']=_['keys'](db[_0xd7ec('0x55')][_0xd7ec('0x32')]);_0x45952d[_0xd7ec('0x35')]=_['keys'](_0x41ec67[_0xd7ec('0x35')]);_0x45952d[_0xd7ec('0x36')]=_['intersection'](_0x45952d[_0xd7ec('0x33')],_0x45952d[_0xd7ec('0x35')]);_0x46d45b[_0xd7ec('0x37')]=_[_0xd7ec('0x38')](_0x45952d[_0xd7ec('0x33')],qs[_0xd7ec('0x39')](_0x41ec67[_0xd7ec('0x35')][_0xd7ec('0x39')]));_0x46d45b[_0xd7ec('0x37')]=_0x46d45b[_0xd7ec('0x37')][_0xd7ec('0x3a')]?_0x46d45b[_0xd7ec('0x37')]:_0x45952d[_0xd7ec('0x33')];_0x46d45b[_0xd7ec('0x3d')]=qs[_0xd7ec('0x3e')](_0x41ec67[_0xd7ec('0x35')][_0xd7ec('0x3e')]);_0x46d45b[_0xd7ec('0x41')]=qs[_0xd7ec('0x36')](_[_0xd7ec('0x3f')](_0x41ec67[_0xd7ec('0x35')],_0x45952d['filters']));if(_0x41ec67[_0xd7ec('0x35')]['filter']){_0x46d45b[_0xd7ec('0x41')]=_[_0xd7ec('0x42')](_0x46d45b[_0xd7ec('0x41')],{'$or':_['map'](_0x46d45b[_0xd7ec('0x37')],function(_0x55600d){var _0x2f1cb3={};_0x2f1cb3[_0x55600d]={'$like':'%'+_0x41ec67[_0xd7ec('0x35')][_0xd7ec('0x40')]+'%'};return _0x2f1cb3;})});}_0x46d45b=_[_0xd7ec('0x42')]({},_0x46d45b,_0x41ec67['options']);return _0x4cf967[_0xd7ec('0x57')](_0x46d45b);}})[_0xd7ec('0x1b')](function(_0x3709d0){if(_0x3709d0){_0x579d07=_0x3709d0[_0xd7ec('0x3a')];if(!_0x41ec67[_0xd7ec('0x35')][_0xd7ec('0x3b')]('nolimit')){_0x46d45b[_0xd7ec('0x28')]=qs[_0xd7ec('0x28')](_0x41ec67[_0xd7ec('0x35')][_0xd7ec('0x28')]);_0x46d45b[_0xd7ec('0x27')]=qs[_0xd7ec('0x27')](_0x41ec67[_0xd7ec('0x35')][_0xd7ec('0x27')]);}return _0x4cf967[_0xd7ec('0x57')](_0x46d45b);}})[_0xd7ec('0x1b')](function(_0x35002c){if(_0x35002c){return _0x35002c?{'count':_0x579d07,'rows':_0x35002c}:null;}})['then'](respondWithResult(_0xb9b9fa,null))[_0xd7ec('0x23')](handleError(_0xb9b9fa,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 8df2980..736fd13 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 _0x7447=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','lodash'];(function(_0x3f2063,_0xae6aba){var _0x5efd51=function(_0x586578){while(--_0x586578){_0x3f2063['push'](_0x3f2063['shift']());}};_0x5efd51(++_0xae6aba);}(_0x7447,0x1a1));var _0x7744=function(_0x298064,_0x1d2bfb){_0x298064=_0x298064-0x0;var _0x2512ea=_0x7447[_0x298064];return _0x2512ea;};'use strict';var _=require(_0x7744('0x0'));var util=require(_0x7744('0x1'));var logger=require(_0x7744('0x2'))(_0x7744('0x3'));var moment=require(_0x7744('0x4'));var BPromise=require(_0x7744('0x5'));var rp=require(_0x7744('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7744('0x7'));var config=require('../../config/environment');var attributes=require(_0x7744('0x8'));module[_0x7744('0x9')]=function(_0x24290f,_0x2a96c7){return _0x24290f['define'](_0x7744('0xa'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b5d=['../../config/logger','api','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0x6b5d,0x142));var _0xd6b5=function(_0x218c63,_0x148e6e){_0x218c63=_0x218c63-0x0;var _0x1b74ca=_0x6b5d[_0x218c63];return _0x1b74ca;};'use strict';var _=require(_0xd6b5('0x0'));var util=require(_0xd6b5('0x1'));var logger=require(_0xd6b5('0x2'))(_0xd6b5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd6b5('0x4'));var fs=require('fs');var path=require(_0xd6b5('0x5'));var rimraf=require(_0xd6b5('0x6'));var config=require('../../config/environment');var attributes=require(_0xd6b5('0x7'));module[_0xd6b5('0x8')]=function(_0x103e07,_0x13ae3d){return _0x103e07[_0xd6b5('0x9')](_0xd6b5('0xa'),attributes,{'tableName':_0xd6b5('0xb'),'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 f3cbb76..a4bfb56 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 _0x1de5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis'];(function(_0x41414e,_0x24b8c9){var _0xc7fdc3=function(_0x5bc6c9){while(--_0x5bc6c9){_0x41414e['push'](_0x41414e['shift']());}};_0xc7fdc3(++_0x24b8c9);}(_0x1de5,0x156));var _0x51de=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x1de5[_0x4f9b18];return _0x29f20c;};'use strict';var _=require('lodash');var util=require(_0x51de('0x0'));var moment=require(_0x51de('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x51de('0x2'));var db=require(_0x51de('0x3'))['db'];var utils=require(_0x51de('0x4'));var logger=require(_0x51de('0x5'))(_0x51de('0x6'));var config=require(_0x51de('0x7'));var jayson=require(_0x51de('0x8'));var client=jayson[_0x51de('0x9')][_0x51de('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x398910,_0x1214d3,_0x12e113){return new BPromise(function(_0x1d712b,_0x16860d){return client[_0x51de('0xb')](_0x398910,_0x12e113)[_0x51de('0xc')](function(_0x27f4d5){logger[_0x51de('0xd')](_0x51de('0xe'),_0x1214d3,_0x51de('0xf'));logger['debug'](_0x51de('0x10'),_0x1214d3,_0x51de('0xf'),JSON[_0x51de('0x11')](_0x27f4d5));if(_0x27f4d5[_0x51de('0x12')]){if(_0x27f4d5[_0x51de('0x12')][_0x51de('0x13')]===0x1f4){logger[_0x51de('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1214d3,_0x27f4d5[_0x51de('0x12')][_0x51de('0x14')]);return _0x16860d(_0x27f4d5[_0x51de('0x12')]['message']);}logger[_0x51de('0x12')](_0x51de('0xe'),_0x1214d3,_0x27f4d5['error']['message']);return _0x1d712b(_0x27f4d5[_0x51de('0x12')][_0x51de('0x14')]);}else{logger[_0x51de('0xd')](_0x51de('0xe'),_0x1214d3,_0x51de('0xf'));_0x1d712b(_0x27f4d5[_0x51de('0x15')][_0x51de('0x14')]);}})[_0x51de('0x16')](function(_0x5e02f9){logger[_0x51de('0x12')](_0x51de('0xe'),_0x1214d3,_0x5e02f9);_0x16860d(_0x5e02f9);});});} \ No newline at end of file +var _0x4425=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x4425,0x199));var _0x5442=function(_0x1ae908,_0x10a203){_0x1ae908=_0x1ae908-0x0;var _0x5cee06=_0x4425[_0x1ae908];return _0x5cee06;};'use strict';var _=require(_0x5442('0x0'));var util=require('util');var moment=require(_0x5442('0x1'));var BPromise=require(_0x5442('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5442('0x3'));var db=require(_0x5442('0x4'))['db'];var utils=require(_0x5442('0x5'));var logger=require('../../config/logger')(_0x5442('0x6'));var config=require(_0x5442('0x7'));var jayson=require(_0x5442('0x8'));var client=jayson[_0x5442('0x9')][_0x5442('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55c37e,_0xf2f72a,_0x2871e3){return new BPromise(function(_0x5e5423,_0x15ce0e){return client[_0x5442('0xb')](_0x55c37e,_0x2871e3)[_0x5442('0xc')](function(_0x41735a){logger[_0x5442('0xd')](_0x5442('0xe'),_0xf2f72a,_0x5442('0xf'));logger[_0x5442('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xf2f72a,_0x5442('0xf'),JSON[_0x5442('0x11')](_0x41735a));if(_0x41735a['error']){if(_0x41735a['error'][_0x5442('0x12')]===0x1f4){logger[_0x5442('0x13')](_0x5442('0xe'),_0xf2f72a,_0x41735a[_0x5442('0x13')][_0x5442('0x14')]);return _0x15ce0e(_0x41735a[_0x5442('0x13')][_0x5442('0x14')]);}logger[_0x5442('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xf2f72a,_0x41735a[_0x5442('0x13')][_0x5442('0x14')]);return _0x5e5423(_0x41735a[_0x5442('0x13')][_0x5442('0x14')]);}else{logger[_0x5442('0xd')](_0x5442('0xe'),_0xf2f72a,_0x5442('0xf'));_0x5e5423(_0x41735a[_0x5442('0x15')][_0x5442('0x14')]);}})[_0x5442('0x16')](function(_0x1f0cb7){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0xf2f72a,_0x1f0cb7);_0x15ce0e(_0x1f0cb7);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index b485ed6..ab91acc 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 _0xf159=['post','create','put','update','delete','/:id','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','show'];(function(_0xf36a76,_0x3967b3){var _0x414aa5=function(_0x84dc89){while(--_0x84dc89){_0xf36a76['push'](_0xf36a76['shift']());}};_0x414aa5(++_0x3967b3);}(_0xf159,0x1b8));var _0x9f15=function(_0x15588b,_0x3782a3){_0x15588b=_0x15588b-0x0;var _0x3a7c62=_0xf159[_0x15588b];return _0x3a7c62;};'use strict';var multer=require('multer');var util=require(_0x9f15('0x0'));var path=require('path');var timeout=require(_0x9f15('0x1'));var express=require(_0x9f15('0x2'));var router=express[_0x9f15('0x3')]();var auth=require(_0x9f15('0x4'));var interaction=require(_0x9f15('0x5'));var config=require('../../config/environment');var controller=require(_0x9f15('0x6'));router[_0x9f15('0x7')]('/',auth[_0x9f15('0x8')](),controller['index']);router[_0x9f15('0x7')]('/:id',auth[_0x9f15('0x8')](),controller[_0x9f15('0x9')]);router[_0x9f15('0xa')]('/',auth[_0x9f15('0x8')](),controller[_0x9f15('0xb')]);router[_0x9f15('0xc')]('/:id',auth[_0x9f15('0x8')](),controller[_0x9f15('0xd')]);router[_0x9f15('0xe')](_0x9f15('0xf'),auth[_0x9f15('0x8')](),controller[_0x9f15('0x10')]);module[_0x9f15('0x11')]=router; \ No newline at end of file +var _0x336c=['express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x336c,0x10e));var _0xc336=function(_0x3a7fb6,_0x2794b7){_0x3a7fb6=_0x3a7fb6-0x0;var _0x581efc=_0x336c[_0x3a7fb6];return _0x581efc;};'use strict';var multer=require(_0xc336('0x0'));var util=require(_0xc336('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc336('0x2'));var router=express[_0xc336('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xc336('0x4'));var config=require(_0xc336('0x5'));var controller=require(_0xc336('0x6'));router[_0xc336('0x7')]('/',auth[_0xc336('0x8')](),controller[_0xc336('0x9')]);router[_0xc336('0x7')](_0xc336('0xa'),auth[_0xc336('0x8')](),controller['show']);router[_0xc336('0xb')]('/',auth[_0xc336('0x8')](),controller[_0xc336('0xc')]);router['put'](_0xc336('0xa'),auth['isAuthenticated'](),controller[_0xc336('0xd')]);router[_0xc336('0xe')](_0xc336('0xa'),auth[_0xc336('0x8')](),controller[_0xc336('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index f37f454..5a34442 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 _0x75f0=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x2ba971,_0x40c20a){var _0x1f5769=function(_0x3a519a){while(--_0x3a519a){_0x2ba971['push'](_0x2ba971['shift']());}};_0x1f5769(++_0x40c20a);}(_0x75f0,0x196));var _0x075f=function(_0xa2fc8c,_0x17b23b){_0xa2fc8c=_0xa2fc8c-0x0;var _0xa1ddf5=_0x75f0[_0xa2fc8c];return _0xa1ddf5;};'use strict';var Sequelize=require(_0x075f('0x0'));module[_0x075f('0x1')]={'type':{'type':Sequelize[_0x075f('0x2')](_0x075f('0x3'),_0x075f('0x4'),_0x075f('0x5'),_0x075f('0x6')),'defaultValue':_0x075f('0x3')},'content':{'type':Sequelize[_0x075f('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x075f('0x2')](_0x075f('0x3'),_0x075f('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x075f('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x075f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x075f('0x7')]}}; \ No newline at end of file +var _0x4553=['string','keyValue','STRING','variable','customVariable','exports','ENUM'];(function(_0x4e8d0b,_0x599476){var _0x436ba6=function(_0xb9c630){while(--_0xb9c630){_0x4e8d0b['push'](_0x4e8d0b['shift']());}};_0x436ba6(++_0x599476);}(_0x4553,0x1be));var _0x3455=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x4553[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require('sequelize');module[_0x3455('0x0')]={'type':{'type':Sequelize[_0x3455('0x1')](_0x3455('0x2'),'variable','customVariable',_0x3455('0x3')),'defaultValue':_0x3455('0x2')},'content':{'type':Sequelize[_0x3455('0x4')]},'key':{'type':Sequelize[_0x3455('0x4')]},'keyType':{'type':Sequelize[_0x3455('0x1')](_0x3455('0x2'),_0x3455('0x5'),_0x3455('0x6'))},'keyContent':{'type':Sequelize[_0x3455('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3455('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3455('0x4')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index e405f99..0b4f950 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 _0xae4a=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','field','SugarcrmField','findAll','catch','show','params','includeAll','include','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','rawAttributes'];(function(_0x13af04,_0x34696c){var _0xd04e49=function(_0x3e5475){while(--_0x3e5475){_0x13af04['push'](_0x13af04['shift']());}};_0xd04e49(++_0x34696c);}(_0xae4a,0x68));var _0xaae4=function(_0x111513,_0x114116){_0x111513=_0x111513-0x0;var _0x457262=_0xae4a[_0x111513];return _0x457262;};'use strict';var pdf=require(_0xaae4('0x0'));var emlformat=require(_0xaae4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xaae4('0x2'));var jsonpatch=require(_0xaae4('0x3'));var rp=require('request-promise');var moment=require(_0xaae4('0x4'));var BPromise=require(_0xaae4('0x5'));var Mustache=require(_0xaae4('0x6'));var util=require(_0xaae4('0x7'));var path=require(_0xaae4('0x8'));var sox=require(_0xaae4('0x9'));var csv=require(_0xaae4('0xa'));var ejs=require(_0xaae4('0xb'));var fs=require('fs');var _=require(_0xaae4('0xc'));var squel=require(_0xaae4('0xd'));var crypto=require(_0xaae4('0xe'));var jsforce=require(_0xaae4('0xf'));var deskjs=require(_0xaae4('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xaae4('0x11'));var Redis=require(_0xaae4('0x12'));var authService=require(_0xaae4('0x13'));var qs=require(_0xaae4('0x14'));var hardwareService=require(_0xaae4('0x15'));var logger=require(_0xaae4('0x16'))(_0xaae4('0x17'));var utils=require(_0xaae4('0x18'));var config=require(_0xaae4('0x19'));var db=require(_0xaae4('0x1a'))['db'];function respondWithStatusCode(_0x31f724,_0x1c0e59){_0x1c0e59=_0x1c0e59||0xcc;return function(_0x16fc1c){if(_0x16fc1c){return _0x31f724[_0xaae4('0x1b')](_0x1c0e59);}return _0x31f724[_0xaae4('0x1c')](_0x1c0e59)[_0xaae4('0x1d')]();};}function respondWithResult(_0x2c516d,_0x419ec2){_0x419ec2=_0x419ec2||0xc8;return function(_0x4963b4){if(_0x4963b4){return _0x2c516d[_0xaae4('0x1c')](_0x419ec2)[_0xaae4('0x1e')](_0x4963b4);}};}function respondWithFilteredResult(_0x235218,_0x3a5259){return function(_0x30ee7e){if(_0x30ee7e){var _0x56bbab=_0x30ee7e[_0xaae4('0x1f')],_0xe8c9e0=_0x3a5259[_0xaae4('0x20')],_0x590d43=_0x3a5259[_0xaae4('0x20')]+_0x3a5259[_0xaae4('0x21')],_0x433051;if(_0x590d43>=_0x56bbab){_0x590d43=_0x56bbab;_0x433051=0xc8;}else{_0x433051=0xce;}_0x235218[_0xaae4('0x1c')](_0x433051);return _0x235218['set'](_0xaae4('0x22'),_0xe8c9e0+'-'+_0x590d43+'/'+_0x56bbab)[_0xaae4('0x1e')](_0x30ee7e);}return null;};}function patchUpdates(_0x3061c1){return function(_0x5bd875){try{jsonpatch[_0xaae4('0x23')](_0x5bd875,_0x3061c1,!![]);}catch(_0x59264f){return BPromise[_0xaae4('0x24')](_0x59264f);}return _0x5bd875[_0xaae4('0x25')]();};}function saveUpdates(_0x1d5aa6,_0x24bf5b){return function(_0x4763bc){if(_0x4763bc){return _0x4763bc[_0xaae4('0x26')](_0x1d5aa6)['then'](function(_0x2cc1c3){return _0x2cc1c3;});}return null;};}function removeEntity(_0x54b133,_0x55ba4f){return function(_0xc11363){if(_0xc11363){return _0xc11363[_0xaae4('0x27')]()[_0xaae4('0x28')](function(){_0x54b133[_0xaae4('0x1c')](0xcc)[_0xaae4('0x1d')]();});}};}function handleEntityNotFound(_0xa7c364,_0x5849d7){return function(_0x244a7f){if(!_0x244a7f){_0xa7c364[_0xaae4('0x1b')](0x194);}return _0x244a7f;};}function handleError(_0x2f6624,_0x1ed384){_0x1ed384=_0x1ed384||0x1f4;return function(_0x4058b9){logger[_0xaae4('0x29')](_0x4058b9['stack']);if(_0x4058b9[_0xaae4('0x2a')]){delete _0x4058b9[_0xaae4('0x2a')];}_0x2f6624['status'](_0x1ed384)[_0xaae4('0x2b')](_0x4058b9);};}exports[_0xaae4('0x2c')]=function(_0x46e767,_0x3aa41c){var _0x58f0a9={},_0xb7c974={},_0x6c8d9f={'count':0x0,'rows':[]};var _0x41420e=db['SugarcrmField'][_0xaae4('0x2d')];_0xb7c974[_0xaae4('0x2e')]=_[_0xaae4('0x2f')](_0x41420e);_0xb7c974[_0xaae4('0x30')]=_[_0xaae4('0x2f')](_0x46e767['query']);_0xb7c974[_0xaae4('0x31')]=_[_0xaae4('0x32')](_0xb7c974[_0xaae4('0x2e')],_0xb7c974[_0xaae4('0x30')]);_0x58f0a9[_0xaae4('0x33')]=_[_0xaae4('0x32')](_0xb7c974[_0xaae4('0x2e')],qs[_0xaae4('0x34')](_0x46e767['query'][_0xaae4('0x34')]));_0x58f0a9[_0xaae4('0x33')]=_0x58f0a9[_0xaae4('0x33')][_0xaae4('0x35')]?_0x58f0a9['attributes']:_0xb7c974[_0xaae4('0x2e')];if(!_0x46e767['query'][_0xaae4('0x36')](_0xaae4('0x37'))){_0x58f0a9['limit']=qs['limit'](_0x46e767['query']['limit']);_0x58f0a9[_0xaae4('0x20')]=qs[_0xaae4('0x20')](_0x46e767['query'][_0xaae4('0x20')]);}_0x58f0a9['order']=qs[_0xaae4('0x38')](_0x46e767[_0xaae4('0x30')][_0xaae4('0x38')]);_0x58f0a9[_0xaae4('0x39')]=qs['filters'](_[_0xaae4('0x3a')](_0x46e767['query'],_0xb7c974[_0xaae4('0x31')]));if(_0x46e767['query'][_0xaae4('0x3b')]){_0x58f0a9[_0xaae4('0x39')]=_[_0xaae4('0x3c')](_0x58f0a9[_0xaae4('0x39')],{'$or':_[_0xaae4('0x3d')](_0x41420e,function(_0x295321){if(_0x295321[_0xaae4('0x3e')]['key']!==_0xaae4('0x3f')){var _0x51bcb5={};_0x51bcb5[_0x295321[_0xaae4('0x40')]]={'$like':'%'+_0x46e767[_0xaae4('0x30')][_0xaae4('0x3b')]+'%'};return _0x51bcb5;}})});}_0x58f0a9=_[_0xaae4('0x3c')]({},_0x58f0a9,_0x46e767['options']);var _0x5984d7={'where':_0x58f0a9[_0xaae4('0x39')]};return db[_0xaae4('0x41')][_0xaae4('0x1f')](_0x5984d7)[_0xaae4('0x28')](function(_0x7fc993){_0x6c8d9f['count']=_0x7fc993;if(_0x46e767['query']['includeAll']){_0x58f0a9['include']=[{'all':!![]}];}return db[_0xaae4('0x41')][_0xaae4('0x42')](_0x58f0a9);})['then'](function(_0x4e0549){_0x6c8d9f['rows']=_0x4e0549;return _0x6c8d9f;})[_0xaae4('0x28')](respondWithFilteredResult(_0x3aa41c,_0x58f0a9))[_0xaae4('0x43')](handleError(_0x3aa41c,null));};exports[_0xaae4('0x44')]=function(_0x5cb508,_0x298b20){var _0x2d7149={'raw':!![],'where':{'id':_0x5cb508[_0xaae4('0x45')]['id']}},_0x3fbd3b={};_0x3fbd3b[_0xaae4('0x2e')]=_['keys'](db[_0xaae4('0x41')][_0xaae4('0x2d')]);_0x3fbd3b[_0xaae4('0x30')]=_[_0xaae4('0x2f')](_0x5cb508[_0xaae4('0x30')]);_0x3fbd3b[_0xaae4('0x31')]=_['intersection'](_0x3fbd3b['model'],_0x3fbd3b[_0xaae4('0x30')]);_0x2d7149[_0xaae4('0x33')]=_[_0xaae4('0x32')](_0x3fbd3b[_0xaae4('0x2e')],qs[_0xaae4('0x34')](_0x5cb508[_0xaae4('0x30')][_0xaae4('0x34')]));_0x2d7149[_0xaae4('0x33')]=_0x2d7149[_0xaae4('0x33')][_0xaae4('0x35')]?_0x2d7149[_0xaae4('0x33')]:_0x3fbd3b['model'];if(_0x5cb508[_0xaae4('0x30')][_0xaae4('0x46')]){_0x2d7149[_0xaae4('0x47')]=[{'all':!![]}];}_0x2d7149=_[_0xaae4('0x3c')]({},_0x2d7149,_0x5cb508['options']);return db[_0xaae4('0x41')][_0xaae4('0x48')](_0x2d7149)['then'](handleEntityNotFound(_0x298b20,null))[_0xaae4('0x28')](respondWithResult(_0x298b20,null))[_0xaae4('0x43')](handleError(_0x298b20,null));};exports['create']=function(_0x5ea2f3,_0x5bc893){return db[_0xaae4('0x41')][_0xaae4('0x49')](_0x5ea2f3[_0xaae4('0x4a')],{})[_0xaae4('0x28')](respondWithResult(_0x5bc893,0xc9))['catch'](handleError(_0x5bc893,null));};exports[_0xaae4('0x26')]=function(_0x3ff5a6,_0x4b48f7){if(_0x3ff5a6[_0xaae4('0x4a')]['id']){delete _0x3ff5a6[_0xaae4('0x4a')]['id'];}return db['SugarcrmField'][_0xaae4('0x48')]({'where':{'id':_0x3ff5a6[_0xaae4('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b48f7,null))[_0xaae4('0x28')](saveUpdates(_0x3ff5a6[_0xaae4('0x4a')],null))[_0xaae4('0x28')](respondWithResult(_0x4b48f7,null))[_0xaae4('0x43')](handleError(_0x4b48f7,null));};exports[_0xaae4('0x27')]=function(_0x5c3c3b,_0x23a110){return db[_0xaae4('0x41')][_0xaae4('0x48')]({'where':{'id':_0x5c3c3b[_0xaae4('0x45')]['id']}})[_0xaae4('0x28')](handleEntityNotFound(_0x23a110,null))[_0xaae4('0x28')](removeEntity(_0x23a110,null))[_0xaae4('0x43')](handleError(_0x23a110,null));}; \ No newline at end of file +var _0x2fa9=['sendStatus','status','json','count','offset','set','Content-Range','apply','update','then','end','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','limit','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','SugarcrmField','include','rows','show','params','find','create','body','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x1392dd,_0x1780ed){var _0x4346f4=function(_0x1c9c8a){while(--_0x1c9c8a){_0x1392dd['push'](_0x1392dd['shift']());}};_0x4346f4(++_0x1780ed);}(_0x2fa9,0x144));var _0x92fa=function(_0x4986e6,_0x5af8f8){_0x4986e6=_0x4986e6-0x0;var _0x159f5e=_0x2fa9[_0x4986e6];return _0x159f5e;};'use strict';var pdf=require(_0x92fa('0x0'));var emlformat=require(_0x92fa('0x1'));var rimraf=require(_0x92fa('0x2'));var zipdir=require(_0x92fa('0x3'));var jsonpatch=require(_0x92fa('0x4'));var rp=require(_0x92fa('0x5'));var moment=require('moment');var BPromise=require(_0x92fa('0x6'));var Mustache=require(_0x92fa('0x7'));var util=require(_0x92fa('0x8'));var path=require('path');var sox=require(_0x92fa('0x9'));var csv=require(_0x92fa('0xa'));var ejs=require(_0x92fa('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x92fa('0xc'));var crypto=require(_0x92fa('0xd'));var jsforce=require(_0x92fa('0xe'));var deskjs=require(_0x92fa('0xf'));var toCsv=require('to-csv');var querystring=require(_0x92fa('0x10'));var Papa=require(_0x92fa('0x11'));var Redis=require('ioredis');var authService=require(_0x92fa('0x12'));var qs=require(_0x92fa('0x13'));var hardwareService=require(_0x92fa('0x14'));var logger=require(_0x92fa('0x15'))(_0x92fa('0x16'));var utils=require(_0x92fa('0x17'));var config=require(_0x92fa('0x18'));var db=require(_0x92fa('0x19'))['db'];function respondWithStatusCode(_0xf63217,_0x21837f){_0x21837f=_0x21837f||0xcc;return function(_0x45888e){if(_0x45888e){return _0xf63217[_0x92fa('0x1a')](_0x21837f);}return _0xf63217[_0x92fa('0x1b')](_0x21837f)['end']();};}function respondWithResult(_0x4055c0,_0x7224d7){_0x7224d7=_0x7224d7||0xc8;return function(_0x461714){if(_0x461714){return _0x4055c0[_0x92fa('0x1b')](_0x7224d7)[_0x92fa('0x1c')](_0x461714);}};}function respondWithFilteredResult(_0x4c2815,_0x3f3941){return function(_0x1d2eb2){if(_0x1d2eb2){var _0x2363ef=_0x1d2eb2[_0x92fa('0x1d')],_0x474a12=_0x3f3941[_0x92fa('0x1e')],_0x64b0e0=_0x3f3941[_0x92fa('0x1e')]+_0x3f3941['limit'],_0x4e7501;if(_0x64b0e0>=_0x2363ef){_0x64b0e0=_0x2363ef;_0x4e7501=0xc8;}else{_0x4e7501=0xce;}_0x4c2815[_0x92fa('0x1b')](_0x4e7501);return _0x4c2815[_0x92fa('0x1f')](_0x92fa('0x20'),_0x474a12+'-'+_0x64b0e0+'/'+_0x2363ef)[_0x92fa('0x1c')](_0x1d2eb2);}return null;};}function patchUpdates(_0x2cc8e3){return function(_0x18cc2c){try{jsonpatch[_0x92fa('0x21')](_0x18cc2c,_0x2cc8e3,!![]);}catch(_0x53c468){return BPromise['reject'](_0x53c468);}return _0x18cc2c['save']();};}function saveUpdates(_0x5837db,_0x86f82d){return function(_0x55a54d){if(_0x55a54d){return _0x55a54d[_0x92fa('0x22')](_0x5837db)['then'](function(_0x32f282){return _0x32f282;});}return null;};}function removeEntity(_0x25dc80,_0x5c7863){return function(_0x3bb537){if(_0x3bb537){return _0x3bb537['destroy']()[_0x92fa('0x23')](function(){_0x25dc80[_0x92fa('0x1b')](0xcc)[_0x92fa('0x24')]();});}};}function handleEntityNotFound(_0x5f5c50,_0x4fada0){return function(_0x1ea8ad){if(!_0x1ea8ad){_0x5f5c50['sendStatus'](0x194);}return _0x1ea8ad;};}function handleError(_0x4a7a99,_0x4799d1){_0x4799d1=_0x4799d1||0x1f4;return function(_0x736360){logger['error'](_0x736360['stack']);if(_0x736360['name']){delete _0x736360[_0x92fa('0x25')];}_0x4a7a99['status'](_0x4799d1)[_0x92fa('0x26')](_0x736360);};}exports[_0x92fa('0x27')]=function(_0x1d4a2b,_0x5a2f34){var _0x3acd1b={},_0x45ecad={},_0x2c440d={'count':0x0,'rows':[]};var _0xf94a22=db['SugarcrmField'][_0x92fa('0x28')];_0x45ecad[_0x92fa('0x29')]=_[_0x92fa('0x2a')](_0xf94a22);_0x45ecad[_0x92fa('0x2b')]=_[_0x92fa('0x2a')](_0x1d4a2b[_0x92fa('0x2b')]);_0x45ecad[_0x92fa('0x2c')]=_['intersection'](_0x45ecad[_0x92fa('0x29')],_0x45ecad[_0x92fa('0x2b')]);_0x3acd1b[_0x92fa('0x2d')]=_[_0x92fa('0x2e')](_0x45ecad[_0x92fa('0x29')],qs[_0x92fa('0x2f')](_0x1d4a2b[_0x92fa('0x2b')][_0x92fa('0x2f')]));_0x3acd1b[_0x92fa('0x2d')]=_0x3acd1b[_0x92fa('0x2d')][_0x92fa('0x30')]?_0x3acd1b['attributes']:_0x45ecad[_0x92fa('0x29')];if(!_0x1d4a2b[_0x92fa('0x2b')]['hasOwnProperty'](_0x92fa('0x31'))){_0x3acd1b[_0x92fa('0x32')]=qs[_0x92fa('0x32')](_0x1d4a2b['query'][_0x92fa('0x32')]);_0x3acd1b[_0x92fa('0x1e')]=qs[_0x92fa('0x1e')](_0x1d4a2b['query'][_0x92fa('0x1e')]);}_0x3acd1b['order']=qs[_0x92fa('0x33')](_0x1d4a2b[_0x92fa('0x2b')][_0x92fa('0x33')]);_0x3acd1b[_0x92fa('0x34')]=qs[_0x92fa('0x2c')](_[_0x92fa('0x35')](_0x1d4a2b['query'],_0x45ecad[_0x92fa('0x2c')]));if(_0x1d4a2b[_0x92fa('0x2b')][_0x92fa('0x36')]){_0x3acd1b['where']=_[_0x92fa('0x37')](_0x3acd1b[_0x92fa('0x34')],{'$or':_[_0x92fa('0x38')](_0xf94a22,function(_0x2bf160){if(_0x2bf160[_0x92fa('0x39')]['key']!==_0x92fa('0x3a')){var _0x6deb63={};_0x6deb63[_0x2bf160[_0x92fa('0x3b')]]={'$like':'%'+_0x1d4a2b[_0x92fa('0x2b')][_0x92fa('0x36')]+'%'};return _0x6deb63;}})});}_0x3acd1b=_[_0x92fa('0x37')]({},_0x3acd1b,_0x1d4a2b[_0x92fa('0x3c')]);var _0x53ade2={'where':_0x3acd1b[_0x92fa('0x34')]};return db[_0x92fa('0x3d')][_0x92fa('0x1d')](_0x53ade2)[_0x92fa('0x23')](function(_0x10f43f){_0x2c440d[_0x92fa('0x1d')]=_0x10f43f;if(_0x1d4a2b[_0x92fa('0x2b')]['includeAll']){_0x3acd1b[_0x92fa('0x3e')]=[{'all':!![]}];}return db[_0x92fa('0x3d')]['findAll'](_0x3acd1b);})[_0x92fa('0x23')](function(_0x306fac){_0x2c440d[_0x92fa('0x3f')]=_0x306fac;return _0x2c440d;})[_0x92fa('0x23')](respondWithFilteredResult(_0x5a2f34,_0x3acd1b))['catch'](handleError(_0x5a2f34,null));};exports[_0x92fa('0x40')]=function(_0x349e5c,_0x1bec9d){var _0x337a42={'raw':!![],'where':{'id':_0x349e5c[_0x92fa('0x41')]['id']}},_0x32de5b={};_0x32de5b[_0x92fa('0x29')]=_['keys'](db[_0x92fa('0x3d')]['rawAttributes']);_0x32de5b[_0x92fa('0x2b')]=_[_0x92fa('0x2a')](_0x349e5c[_0x92fa('0x2b')]);_0x32de5b[_0x92fa('0x2c')]=_[_0x92fa('0x2e')](_0x32de5b['model'],_0x32de5b['query']);_0x337a42[_0x92fa('0x2d')]=_[_0x92fa('0x2e')](_0x32de5b[_0x92fa('0x29')],qs[_0x92fa('0x2f')](_0x349e5c[_0x92fa('0x2b')][_0x92fa('0x2f')]));_0x337a42['attributes']=_0x337a42[_0x92fa('0x2d')][_0x92fa('0x30')]?_0x337a42[_0x92fa('0x2d')]:_0x32de5b[_0x92fa('0x29')];if(_0x349e5c[_0x92fa('0x2b')]['includeAll']){_0x337a42[_0x92fa('0x3e')]=[{'all':!![]}];}_0x337a42=_['merge']({},_0x337a42,_0x349e5c[_0x92fa('0x3c')]);return db[_0x92fa('0x3d')][_0x92fa('0x42')](_0x337a42)['then'](handleEntityNotFound(_0x1bec9d,null))['then'](respondWithResult(_0x1bec9d,null))['catch'](handleError(_0x1bec9d,null));};exports['create']=function(_0x44c5d4,_0x284602){return db[_0x92fa('0x3d')][_0x92fa('0x43')](_0x44c5d4[_0x92fa('0x44')],{})[_0x92fa('0x23')](respondWithResult(_0x284602,0xc9))[_0x92fa('0x45')](handleError(_0x284602,null));};exports[_0x92fa('0x22')]=function(_0x347845,_0x162095){if(_0x347845['body']['id']){delete _0x347845['body']['id'];}return db[_0x92fa('0x3d')][_0x92fa('0x42')]({'where':{'id':_0x347845[_0x92fa('0x41')]['id']}})['then'](handleEntityNotFound(_0x162095,null))['then'](saveUpdates(_0x347845[_0x92fa('0x44')],null))[_0x92fa('0x23')](respondWithResult(_0x162095,null))[_0x92fa('0x45')](handleError(_0x162095,null));};exports['destroy']=function(_0x5a99b0,_0x189013){return db['SugarcrmField'][_0x92fa('0x42')]({'where':{'id':_0x5a99b0['params']['id']}})[_0x92fa('0x23')](handleEntityNotFound(_0x189013,null))[_0x92fa('0x23')](removeEntity(_0x189013,null))[_0x92fa('0x45')](handleError(_0x189013,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index dbc4f6b..e0e5615 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 _0x64a9=['../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x16fc99,_0x23589d){var _0x8ed00a=function(_0x1431b5){while(--_0x1431b5){_0x16fc99['push'](_0x16fc99['shift']());}};_0x8ed00a(++_0x23589d);}(_0x64a9,0xe8));var _0x964a=function(_0x1f320a,_0xe8a0ae){_0x1f320a=_0x1f320a-0x0;var _0x2a52f1=_0x64a9[_0x1f320a];return _0x2a52f1;};'use strict';var _=require('lodash');var util=require(_0x964a('0x0'));var logger=require(_0x964a('0x1'))(_0x964a('0x2'));var moment=require('moment');var BPromise=require(_0x964a('0x3'));var rp=require(_0x964a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x964a('0x5'));var config=require(_0x964a('0x6'));var attributes=require(_0x964a('0x7'));module[_0x964a('0x8')]=function(_0x3efa6a,_0xff5b84){return _0x3efa6a[_0x964a('0x9')](_0x964a('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x964a('0xb'),'fields':[_0x964a('0xc'),_0x964a('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe3d2=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','sugarcrm_unique_index','idField','FieldId','lodash'];(function(_0x4c7db9,_0x4af129){var _0x252a39=function(_0x3e25d8){while(--_0x3e25d8){_0x4c7db9['push'](_0x4c7db9['shift']());}};_0x252a39(++_0x4af129);}(_0xe3d2,0x15d));var _0x2e3d=function(_0x28586f,_0x19383b){_0x28586f=_0x28586f-0x0;var _0xb81282=_0xe3d2[_0x28586f];return _0xb81282;};'use strict';var _=require(_0x2e3d('0x0'));var util=require(_0x2e3d('0x1'));var logger=require(_0x2e3d('0x2'))(_0x2e3d('0x3'));var moment=require(_0x2e3d('0x4'));var BPromise=require(_0x2e3d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2e3d('0x6'));var config=require(_0x2e3d('0x7'));var attributes=require(_0x2e3d('0x8'));module[_0x2e3d('0x9')]=function(_0x20764a,_0x24450e){return _0x20764a[_0x2e3d('0xa')]('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x2e3d('0xb'),'fields':[_0x2e3d('0xc'),_0x2e3d('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 73ecec4..7c3b16d 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 _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xf3dfbc,_0x4daf4a){var _0x3ab372=function(_0x133407){while(--_0x133407){_0xf3dfbc['push'](_0xf3dfbc['shift']());}};_0x3ab372(++_0x4daf4a);}(_0xb10b,0x12a));var _0xbb10=function(_0x3878e9,_0x14fcf2){_0x3878e9=_0x3878e9-0x0;var _0x2ad526=_0xb10b[_0x3878e9];return _0x2ad526;};'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 _0x2032=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','util','moment','bluebird'];(function(_0x40b473,_0x19225b){var _0xd4cdf4=function(_0x1193c9){while(--_0x1193c9){_0x40b473['push'](_0x40b473['shift']());}};_0xd4cdf4(++_0x19225b);}(_0x2032,0xd9));var _0x2203=function(_0xb93d3e,_0x313945){_0xb93d3e=_0xb93d3e-0x0;var _0x28e136=_0x2032[_0xb93d3e];return _0x28e136;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var BPromise=require(_0x2203('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2203('0x3'));var db=require(_0x2203('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2203('0x5'))(_0x2203('0x6'));var config=require(_0x2203('0x7'));var jayson=require(_0x2203('0x8'));var client=jayson[_0x2203('0x9')][_0x2203('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e0f63,_0x2676aa,_0x18c4d6){return new BPromise(function(_0x2049ff,_0x2999ed){return client['request'](_0x2e0f63,_0x18c4d6)['then'](function(_0x10f055){logger['info'](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));logger[_0x2203('0xd')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x2676aa,_0x2203('0xc'),JSON['stringify'](_0x10f055));if(_0x10f055[_0x2203('0xe')]){if(_0x10f055['error'][_0x2203('0xf')]===0x1f4){logger[_0x2203('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x2676aa,_0x10f055['error']['message']);return _0x2999ed(_0x10f055['error']['message']);}logger[_0x2203('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x2676aa,_0x10f055['error'][_0x2203('0x10')]);return _0x2049ff(_0x10f055[_0x2203('0xe')][_0x2203('0x10')]);}else{logger[_0x2203('0x11')](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));_0x2049ff(_0x10f055[_0x2203('0x12')][_0x2203('0x10')]);}})[_0x2203('0x13')](function(_0x3053f3){logger['error'](_0x2203('0xb'),_0x2676aa,_0x3053f3);_0x2999ed(_0x3053f3);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 44603c1..9b0c3ff 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 _0x8451=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getFields','create','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x1ca9eb,_0x99a10b){var _0x2e284e=function(_0x1196a4){while(--_0x1196a4){_0x1ca9eb['push'](_0x1ca9eb['shift']());}};_0x2e284e(++_0x99a10b);}(_0x8451,0x105));var _0x1845=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x8451[_0x4ae6ef];return _0x3cbb4e;};'use strict';var multer=require(_0x1845('0x0'));var util=require(_0x1845('0x1'));var path=require(_0x1845('0x2'));var timeout=require(_0x1845('0x3'));var express=require(_0x1845('0x4'));var router=express[_0x1845('0x5')]();var auth=require(_0x1845('0x6'));var interaction=require(_0x1845('0x7'));var config=require(_0x1845('0x8'));var controller=require('./intVtigerAccount.controller');router[_0x1845('0x9')]('/',auth[_0x1845('0xa')](),controller[_0x1845('0xb')]);router['get'](_0x1845('0xc'),auth['isAuthenticated'](),controller[_0x1845('0xd')]);router[_0x1845('0x9')](_0x1845('0xe'),auth[_0x1845('0xa')](),controller['getConfigurations']);router[_0x1845('0x9')]('/:id/fields',auth[_0x1845('0xa')](),controller[_0x1845('0xf')]);router['post']('/',auth[_0x1845('0xa')](),controller[_0x1845('0x10')]);router['post'](_0x1845('0xe'),auth['isAuthenticated'](),controller[_0x1845('0x11')]);router[_0x1845('0x12')](_0x1845('0xc'),auth[_0x1845('0xa')](),controller[_0x1845('0x13')]);router['delete'](_0x1845('0xc'),auth[_0x1845('0xa')](),controller[_0x1845('0x14')]);module[_0x1845('0x15')]=router; \ No newline at end of file +var _0x978d=['delete','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','update'];(function(_0x4fd2d1,_0x43f306){var _0x564564=function(_0x54121a){while(--_0x54121a){_0x4fd2d1['push'](_0x4fd2d1['shift']());}};_0x564564(++_0x43f306);}(_0x978d,0x144));var _0xd978=function(_0x372003,_0x2cd56a){_0x372003=_0x372003-0x0;var _0x104ab5=_0x978d[_0x372003];return _0x104ab5;};'use strict';var multer=require(_0xd978('0x0'));var util=require(_0xd978('0x1'));var path=require(_0xd978('0x2'));var timeout=require('connect-timeout');var express=require(_0xd978('0x3'));var router=express[_0xd978('0x4')]();var auth=require(_0xd978('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd978('0x6'));var controller=require(_0xd978('0x7'));router[_0xd978('0x8')]('/',auth[_0xd978('0x9')](),controller[_0xd978('0xa')]);router[_0xd978('0x8')](_0xd978('0xb'),auth[_0xd978('0x9')](),controller['show']);router[_0xd978('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xd978('0xc')]);router['get'](_0xd978('0xd'),auth[_0xd978('0x9')](),controller[_0xd978('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd978('0xf')]);router[_0xd978('0x10')](_0xd978('0x11'),auth[_0xd978('0x9')](),controller[_0xd978('0x12')]);router[_0xd978('0x13')](_0xd978('0xb'),auth[_0xd978('0x9')](),controller[_0xd978('0x14')]);router[_0xd978('0x15')](_0xd978('0xb'),auth[_0xd978('0x9')](),controller['destroy']);module[_0xd978('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index a568c47..cdddf42 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 _0x86ce=['exports','STRING'];(function(_0x39e904,_0x548da1){var _0x1a958e=function(_0x46c309){while(--_0x46c309){_0x39e904['push'](_0x39e904['shift']());}};_0x1a958e(++_0x548da1);}(_0x86ce,0xe8));var _0xe86c=function(_0x2e68db,_0x275d04){_0x2e68db=_0x2e68db-0x0;var _0x12df4c=_0x86ce[_0x2e68db];return _0x12df4c;};'use strict';var Sequelize=require('sequelize');module[_0xe86c('0x0')]={'name':{'type':Sequelize[_0xe86c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe86c('0x1')]},'username':{'type':Sequelize[_0xe86c('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe86c('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe86c('0x1')]},'accessKey':{'type':Sequelize[_0xe86c('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x13b3=['STRING','sequelize','exports'];(function(_0x2a5099,_0x329e92){var _0x2802f1=function(_0x53f99b){while(--_0x53f99b){_0x2a5099['push'](_0x2a5099['shift']());}};_0x2802f1(++_0x329e92);}(_0x13b3,0x91));var _0x313b=function(_0x22b5da,_0x43cf53){_0x22b5da=_0x22b5da-0x0;var _0x46b7da=_0x13b3[_0x22b5da];return _0x46b7da;};'use strict';var Sequelize=require(_0x313b('0x0'));module[_0x313b('0x1')]={'name':{'type':Sequelize[_0x313b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x313b('0x2')]},'username':{'type':Sequelize[_0x313b('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x313b('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x313b('0x2')]},'accessKey':{'type':Sequelize[_0x313b('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 063007b..94ccffa 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 _0x9468=['offset','set','apply','reject','save','update','end','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','VtigerAccount','findAll','rows','show','params','fields','find','create','body','getConfigurations','VtigerConfiguration','order','addConfiguration','findOne','AccountId','getSubjects','channel','getDescriptions','VtigerField','Subjects','md5','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','POST','login','token','success','reference','owner','remove','includes','editable','false','startsWith','cf_','picklist','picklistValues','label','value','log','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','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','../../config/license/hardware','../../config/logger','api','../../config/utils','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VtigerAccount,\x20%s,\x20%s','result','catch','sendStatus','status','count'];(function(_0x4bb1cf,_0x28688e){var _0x39fe72=function(_0x2a8bc5){while(--_0x2a8bc5){_0x4bb1cf['push'](_0x4bb1cf['shift']());}};_0x39fe72(++_0x28688e);}(_0x9468,0x1e6));var _0x8946=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x9468[_0x2f3848];return _0x102668;};'use strict';var pdf=require(_0x8946('0x0'));var emlformat=require(_0x8946('0x1'));var rimraf=require(_0x8946('0x2'));var zipdir=require(_0x8946('0x3'));var jsonpatch=require(_0x8946('0x4'));var rp=require(_0x8946('0x5'));var moment=require(_0x8946('0x6'));var BPromise=require(_0x8946('0x7'));var Mustache=require('mustache');var util=require(_0x8946('0x8'));var path=require(_0x8946('0x9'));var sox=require(_0x8946('0xa'));var csv=require(_0x8946('0xb'));var ejs=require(_0x8946('0xc'));var fs=require('fs');var _=require(_0x8946('0xd'));var squel=require(_0x8946('0xe'));var crypto=require(_0x8946('0xf'));var jsforce=require(_0x8946('0x10'));var deskjs=require(_0x8946('0x11'));var toCsv=require('to-csv');var querystring=require(_0x8946('0x12'));var Papa=require('papaparse');var Redis=require(_0x8946('0x13'));var authService=require(_0x8946('0x14'));var qs=require(_0x8946('0x15'));var hardwareService=require(_0x8946('0x16'));var logger=require(_0x8946('0x17'))(_0x8946('0x18'));var utils=require(_0x8946('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x8946('0x1a'));var client=jayson[_0x8946('0x1b')][_0x8946('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x11528b,_0x471fa7,_0x1e9e5a){if(_0x1e9e5a){var _0x4caeaf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4caeaf[_0x8946('0x1d')](_0x471fa7)){return _0x11528b;}else{throw new Error(_0x8946('0x1e'));}}else{return _0x11528b;}}function respondWithRpcPromise(_0xefe991,_0x1f8034,_0x49bd36,_0x5b1f8e){return new BPromise(function(_0x2bfdf5,_0x370a31){var _0xe37d1e=_0x5b1f8e||client;return _0xe37d1e[_0x8946('0x1f')](_0xefe991,_0x49bd36)[_0x8946('0x20')](function(_0x4c6ce1){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x1f8034,_0x8946('0x21'));logger[_0x8946('0x22')](_0x8946('0x23'),_0x1f8034,_0x8946('0x21'),JSON[_0x8946('0x24')](_0x4c6ce1));if(_0x4c6ce1[_0x8946('0x25')]){if(_0x4c6ce1[_0x8946('0x25')][_0x8946('0x26')]===0x1f4){logger[_0x8946('0x25')]('VtigerAccount,\x20%s,\x20%s',_0x1f8034,_0x4c6ce1[_0x8946('0x25')][_0x8946('0x27')]);return _0x370a31(_0x4c6ce1['error'][_0x8946('0x27')]);}logger[_0x8946('0x25')]('VtigerAccount,\x20%s,\x20%s',_0x1f8034,_0x4c6ce1[_0x8946('0x25')][_0x8946('0x27')]);return _0x2bfdf5(_0x4c6ce1['error']['message']);}else{logger['info'](_0x8946('0x28'),_0x1f8034,_0x8946('0x21'));_0x2bfdf5(_0x4c6ce1[_0x8946('0x29')][_0x8946('0x27')]);}})[_0x8946('0x2a')](function(_0x29c8dc){logger['error'](_0x8946('0x28'),_0x1f8034,_0x29c8dc);_0x370a31(_0x29c8dc);});});}function respondWithStatusCode(_0x2abc0b,_0x188591){_0x188591=_0x188591||0xcc;return function(_0x25fb8d){if(_0x25fb8d){return _0x2abc0b[_0x8946('0x2b')](_0x188591);}return _0x2abc0b[_0x8946('0x2c')](_0x188591)['end']();};}function respondWithResult(_0x43b923,_0x5dd1f8){_0x5dd1f8=_0x5dd1f8||0xc8;return function(_0x3de602){if(_0x3de602){return _0x43b923['status'](_0x5dd1f8)['json'](_0x3de602);}};}function respondWithFilteredResult(_0x227ef7,_0x156d8b){return function(_0x485635){if(_0x485635){var _0x4d8d24=_0x485635[_0x8946('0x2d')],_0x771e2=_0x156d8b[_0x8946('0x2e')],_0x3edb41=_0x156d8b['offset']+_0x156d8b['limit'],_0x4d1572;if(_0x3edb41>=_0x4d8d24){_0x3edb41=_0x4d8d24;_0x4d1572=0xc8;}else{_0x4d1572=0xce;}_0x227ef7[_0x8946('0x2c')](_0x4d1572);return _0x227ef7[_0x8946('0x2f')]('Content-Range',_0x771e2+'-'+_0x3edb41+'/'+_0x4d8d24)['json'](_0x485635);}return null;};}function patchUpdates(_0x38c3c2){return function(_0x4d8958){try{jsonpatch[_0x8946('0x30')](_0x4d8958,_0x38c3c2,!![]);}catch(_0x20b176){return BPromise[_0x8946('0x31')](_0x20b176);}return _0x4d8958[_0x8946('0x32')]();};}function saveUpdates(_0x59bac6,_0x10ae05){return function(_0xa3b4ab){if(_0xa3b4ab){return _0xa3b4ab[_0x8946('0x33')](_0x59bac6)[_0x8946('0x20')](function(_0x859859){return _0x859859;});}return null;};}function removeEntity(_0x555d22,_0x11d035){return function(_0x158652){if(_0x158652){return _0x158652['destroy']()[_0x8946('0x20')](function(){_0x555d22[_0x8946('0x2c')](0xcc)[_0x8946('0x34')]();});}};}function handleEntityNotFound(_0x94a3,_0x302064){return function(_0x452aa1){if(!_0x452aa1){_0x94a3[_0x8946('0x2b')](0x194);}return _0x452aa1;};}function handleError(_0x4b1a6d,_0x198b87){_0x198b87=_0x198b87||0x1f4;return function(_0x2d6b1e){logger[_0x8946('0x25')](_0x2d6b1e[_0x8946('0x35')]);if(_0x2d6b1e[_0x8946('0x36')]){delete _0x2d6b1e[_0x8946('0x36')];}_0x4b1a6d[_0x8946('0x2c')](_0x198b87)[_0x8946('0x37')](_0x2d6b1e);};}exports[_0x8946('0x38')]=function(_0x15207f,_0x3fddc3){var _0x43b789={},_0x4252df={},_0x21593a={'count':0x0,'rows':[]};var _0x1baabf=db['VtigerAccount'][_0x8946('0x39')];_0x4252df[_0x8946('0x3a')]=_[_0x8946('0x3b')](_0x1baabf);_0x4252df[_0x8946('0x3c')]=_['keys'](_0x15207f[_0x8946('0x3c')]);_0x4252df[_0x8946('0x3d')]=_[_0x8946('0x3e')](_0x4252df[_0x8946('0x3a')],_0x4252df['query']);_0x43b789[_0x8946('0x3f')]=_['intersection'](_0x4252df[_0x8946('0x3a')],qs['fields'](_0x15207f['query']['fields']));_0x43b789['attributes']=_0x43b789[_0x8946('0x3f')][_0x8946('0x40')]?_0x43b789[_0x8946('0x3f')]:_0x4252df[_0x8946('0x3a')];if(!_0x15207f[_0x8946('0x3c')][_0x8946('0x41')](_0x8946('0x42'))){_0x43b789['limit']=qs[_0x8946('0x43')](_0x15207f[_0x8946('0x3c')][_0x8946('0x43')]);_0x43b789[_0x8946('0x2e')]=qs[_0x8946('0x2e')](_0x15207f['query'][_0x8946('0x2e')]);}_0x43b789['order']=qs[_0x8946('0x44')](_0x15207f[_0x8946('0x3c')][_0x8946('0x44')]);_0x43b789[_0x8946('0x45')]=qs[_0x8946('0x3d')](_[_0x8946('0x46')](_0x15207f[_0x8946('0x3c')],_0x4252df[_0x8946('0x3d')]));if(_0x15207f[_0x8946('0x3c')][_0x8946('0x47')]){_0x43b789['where']=_[_0x8946('0x48')](_0x43b789[_0x8946('0x45')],{'$or':_[_0x8946('0x49')](_0x1baabf,function(_0x5106af){if(_0x5106af[_0x8946('0x4a')]['key']!==_0x8946('0x4b')){var _0x4f617d={};_0x4f617d[_0x5106af[_0x8946('0x4c')]]={'$like':'%'+_0x15207f['query'][_0x8946('0x47')]+'%'};return _0x4f617d;}})});}_0x43b789=_[_0x8946('0x48')]({},_0x43b789,_0x15207f[_0x8946('0x4d')]);var _0x52af9f={'where':_0x43b789[_0x8946('0x45')]};return db['VtigerAccount'][_0x8946('0x2d')](_0x52af9f)[_0x8946('0x20')](function(_0x468569){_0x21593a[_0x8946('0x2d')]=_0x468569;if(_0x15207f[_0x8946('0x3c')][_0x8946('0x4e')]){_0x43b789[_0x8946('0x4f')]=[{'all':!![]}];}return db[_0x8946('0x50')][_0x8946('0x51')](_0x43b789);})[_0x8946('0x20')](function(_0x37f8da){_0x21593a[_0x8946('0x52')]=_0x37f8da;return _0x21593a;})[_0x8946('0x20')](respondWithFilteredResult(_0x3fddc3,_0x43b789))[_0x8946('0x2a')](handleError(_0x3fddc3,null));};exports[_0x8946('0x53')]=function(_0x14d44f,_0x56333b){var _0x193e8f={'raw':![],'where':{'id':_0x14d44f[_0x8946('0x54')]['id']}},_0x58584a={};_0x58584a[_0x8946('0x3a')]=_[_0x8946('0x3b')](db[_0x8946('0x50')][_0x8946('0x39')]);_0x58584a[_0x8946('0x3c')]=_[_0x8946('0x3b')](_0x14d44f[_0x8946('0x3c')]);_0x58584a[_0x8946('0x3d')]=_['intersection'](_0x58584a['model'],_0x58584a[_0x8946('0x3c')]);_0x193e8f[_0x8946('0x3f')]=_[_0x8946('0x3e')](_0x58584a[_0x8946('0x3a')],qs[_0x8946('0x55')](_0x14d44f['query'][_0x8946('0x55')]));_0x193e8f['attributes']=_0x193e8f[_0x8946('0x3f')][_0x8946('0x40')]?_0x193e8f[_0x8946('0x3f')]:_0x58584a[_0x8946('0x3a')];if(_0x14d44f['query'][_0x8946('0x4e')]){_0x193e8f[_0x8946('0x4f')]=[{'all':!![]}];}_0x193e8f=_[_0x8946('0x48')]({},_0x193e8f,_0x14d44f[_0x8946('0x4d')]);return db[_0x8946('0x50')][_0x8946('0x56')](_0x193e8f)['then'](handleEntityNotFound(_0x56333b,null))[_0x8946('0x20')](respondWithResult(_0x56333b,null))['catch'](handleError(_0x56333b,null));};exports[_0x8946('0x57')]=function(_0xb8c50e,_0x97fc4a){return db[_0x8946('0x50')]['create'](_0xb8c50e['body'],{})[_0x8946('0x20')](respondWithResult(_0x97fc4a,0xc9))[_0x8946('0x2a')](handleError(_0x97fc4a,null));};exports['update']=function(_0x101b88,_0x6d7135){if(_0x101b88[_0x8946('0x58')]['id']){delete _0x101b88[_0x8946('0x58')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x101b88['params']['id']}})[_0x8946('0x20')](handleEntityNotFound(_0x6d7135,null))[_0x8946('0x20')](saveUpdates(_0x101b88[_0x8946('0x58')],null))[_0x8946('0x20')](respondWithResult(_0x6d7135,null))[_0x8946('0x2a')](handleError(_0x6d7135,null));};exports['destroy']=function(_0x149dbd,_0x48e1ef){return db[_0x8946('0x50')][_0x8946('0x56')]({'where':{'id':_0x149dbd[_0x8946('0x54')]['id']}})[_0x8946('0x20')](handleEntityNotFound(_0x48e1ef,null))[_0x8946('0x20')](removeEntity(_0x48e1ef,null))[_0x8946('0x2a')](handleError(_0x48e1ef,null));};exports[_0x8946('0x59')]=function(_0x1af56c,_0x409f3d,_0x36f4fd){var _0x36cf24={};var _0xce374f={};var _0x539c0a;var _0x43270f;return db[_0x8946('0x50')]['findOne']({'where':{'id':_0x1af56c['params']['id']}})[_0x8946('0x20')](handleEntityNotFound(_0x409f3d,null))[_0x8946('0x20')](function(_0x42f0da){if(_0x42f0da){_0x539c0a=_0x42f0da;_0xce374f[_0x8946('0x3a')]=_[_0x8946('0x3b')](db[_0x8946('0x5a')][_0x8946('0x39')]);_0xce374f[_0x8946('0x3c')]=_[_0x8946('0x3b')](_0x1af56c[_0x8946('0x3c')]);_0xce374f[_0x8946('0x3d')]=_[_0x8946('0x3e')](_0xce374f[_0x8946('0x3a')],_0xce374f[_0x8946('0x3c')]);_0x36cf24[_0x8946('0x3f')]=_['intersection'](_0xce374f[_0x8946('0x3a')],qs[_0x8946('0x55')](_0x1af56c[_0x8946('0x3c')][_0x8946('0x55')]));_0x36cf24['attributes']=_0x36cf24[_0x8946('0x3f')]['length']?_0x36cf24['attributes']:_0xce374f['model'];_0x36cf24[_0x8946('0x5b')]=qs[_0x8946('0x44')](_0x1af56c[_0x8946('0x3c')][_0x8946('0x44')]);_0x36cf24['where']=qs[_0x8946('0x3d')](_[_0x8946('0x46')](_0x1af56c[_0x8946('0x3c')],_0xce374f['filters']));if(_0x1af56c[_0x8946('0x3c')][_0x8946('0x47')]){_0x36cf24[_0x8946('0x45')]=_['merge'](_0x36cf24[_0x8946('0x45')],{'$or':_['map'](_0x36cf24[_0x8946('0x3f')],function(_0x598638){var _0x994737={};_0x994737[_0x598638]={'$like':'%'+_0x1af56c[_0x8946('0x3c')]['filter']+'%'};return _0x994737;})});}_0x36cf24=_[_0x8946('0x48')]({},_0x36cf24,_0x1af56c['options']);return _0x539c0a[_0x8946('0x59')](_0x36cf24);}})['then'](function(_0x17918f){if(_0x17918f){_0x43270f=_0x17918f[_0x8946('0x40')];if(!_0x1af56c[_0x8946('0x3c')][_0x8946('0x41')](_0x8946('0x42'))){_0x36cf24[_0x8946('0x43')]=qs[_0x8946('0x43')](_0x1af56c[_0x8946('0x3c')][_0x8946('0x43')]);_0x36cf24[_0x8946('0x2e')]=qs[_0x8946('0x2e')](_0x1af56c[_0x8946('0x3c')]['offset']);}return _0x539c0a[_0x8946('0x59')](_0x36cf24);}})[_0x8946('0x20')](function(_0x58a371){if(_0x58a371){return _0x58a371?{'count':_0x43270f,'rows':_0x58a371}:null;}})['then'](respondWithResult(_0x409f3d,null))[_0x8946('0x2a')](handleError(_0x409f3d,null));};exports[_0x8946('0x5c')]=function(_0x246741,_0x42aa13,_0x1a1977){if(_0x246741[_0x8946('0x58')]['id']){delete _0x246741['body']['id'];}return db[_0x8946('0x50')][_0x8946('0x5d')]({'where':{'id':_0x246741[_0x8946('0x54')]['id']}})[_0x8946('0x20')](handleEntityNotFound(_0x42aa13,null))[_0x8946('0x20')](function(_0x250b61){if(_0x250b61){_0x246741[_0x8946('0x58')][_0x8946('0x5e')]=_0x250b61['id'];_0x246741['body']['Subjects']=integrations[_0x8946('0x5f')](_0x246741['body'][_0x8946('0x60')],_0x246741[_0x8946('0x58')][_0x8946('0x4a')]);_0x246741[_0x8946('0x58')]['Descriptions']=integrations[_0x8946('0x61')](_0x246741[_0x8946('0x58')]['channel'],_0x246741[_0x8946('0x58')][_0x8946('0x4a')]);return db[_0x8946('0x5a')][_0x8946('0x57')](_0x246741[_0x8946('0x58')],{'include':[{'model':db[_0x8946('0x62')],'as':_0x8946('0x63')},{'model':db[_0x8946('0x62')],'as':'Descriptions'}]});}return null;})[_0x8946('0x20')](respondWithResult(_0x42aa13,null))[_0x8946('0x2a')](handleError(_0x42aa13,null));};var md5=require(_0x8946('0x64'));exports['getFields']=function(_0x253cda,_0x1cb34f,_0xbc2b70){var _0x5eff51=null;var _0x3c27df=null;var _0x163b86=null;var _0x226a36=null;var _0x17df76='';return db[_0x8946('0x50')]['findOne']({'where':{'id':_0x253cda['params']['id']},'attributes':['id',_0x8946('0x36'),_0x8946('0x65'),_0x8946('0x66'),_0x8946('0x67'),_0x8946('0x68'),_0x8946('0x69'),_0x8946('0x6a')]})['then'](handleEntityNotFound(_0x1cb34f,null))['then'](function(_0x53c99b){if(_0x53c99b){_0x5eff51=_0x53c99b['username'];_0x3c27df=_0x53c99b[_0x8946('0x6a')];_0x163b86=_0x53c99b[_0x8946('0x67')];_0x17df76=_0x53c99b[_0x8946('0x68')];var _0x45de8b=_0x17df76[_0x8946('0x6b')](-0x1);if(_0x45de8b==='/'){_0x17df76=_0x17df76[_0x8946('0x6c')](0x0,_0x17df76[_0x8946('0x6d')](_0x45de8b));}_0x226a36=util[_0x8946('0x6e')](_0x8946('0x6f'),_0x17df76);var _0x5a59bf={'method':_0x8946('0x70'),'uri':_0x226a36,'qs':{'operation':'getchallenge','username':_0x53c99b[_0x8946('0x65')]},'json':!![]};return rp(_0x5a59bf);}})['then'](function(_0x145dbb){if(_0x145dbb['success']){var _0x284471={'method':_0x8946('0x71'),'uri':_0x226a36,'form':{'operation':_0x8946('0x72'),'username':_0x5eff51,'accessKey':md5(_0x145dbb['result'][_0x8946('0x73')]+_0x3c27df)},'json':!![]};return rp(_0x284471);}})['then'](function(_0x35a806){if(_0x35a806[_0x8946('0x74')]){var _0x3f3126={'method':_0x8946('0x70'),'uri':_0x226a36,'qs':{'operation':'describe','username':_0x5eff51,'sessionName':_0x35a806[_0x8946('0x29')]['sessionName'],'elementType':_0x163b86},'json':!![]};return rp(_0x3f3126);}})[_0x8946('0x20')](function(_0x44e61c){if(_0x44e61c[_0x8946('0x74')]){var _0x1565eb=['autogenerated',_0x8946('0x75'),_0x8946('0x76')];_[_0x8946('0x77')](_0x44e61c[_0x8946('0x29')][_0x8946('0x55')],function(_0x3ed1c2){return _0x1565eb[_0x8946('0x78')](_0x3ed1c2[_0x8946('0x4a')]['name']);});_[_0x8946('0x77')](_0x44e61c['result'][_0x8946('0x55')],function(_0x553b6a){return _0x553b6a[_0x8946('0x79')]===_0x8946('0x7a');});return{'count':_0x44e61c['result'][_0x8946('0x55')][_0x8946('0x40')],'rows':_['map'](_0x44e61c[_0x8946('0x29')]['fields'],function(_0x7e9e54){return{'id':_0x7e9e54['name'],'name':_0x7e9e54['label'],'custom':_[_0x8946('0x7b')](_0x7e9e54[_0x8946('0x36')],_0x8946('0x7c'))?!![]:![],'options':_0x7e9e54[_0x8946('0x4a')]['name']===_0x8946('0x7d')&&_0x7e9e54[_0x8946('0x4a')]['picklistValues'][_0x8946('0x40')]>0x0?_['map'](_0x7e9e54[_0x8946('0x4a')][_0x8946('0x7e')],function(_0x4a4dc2){return{'name':_0x4a4dc2[_0x8946('0x7f')],'value':_0x4a4dc2[_0x8946('0x80')]};}):[]};})};}})[_0x8946('0x20')](respondWithResult(_0x1cb34f,null))[_0x8946('0x2a')](function(_0x10c9e7){console[_0x8946('0x81')]('vTiger\x20error:\x20'+_0x10c9e7);var _0x173254=_0x253cda[_0x8946('0x3c')][_0x8946('0x1d')]?0x1f4:_0x10c9e7[_0x8946('0x82')]||0x1f4;logger[_0x8946('0x25')](_0x8946('0x83'),'getFields',_0x173254,JSON[_0x8946('0x24')](_0x10c9e7));delete _0x10c9e7['name'];if(_0x173254===0x191){_0x173254=0x190;}_0x1cb34f[_0x8946('0x2c')](_0x173254)[_0x8946('0x37')](_0x253cda[_0x8946('0x3c')]['test']?{'message':_0x8946('0x84'),'statusCode':_0x10c9e7['statusCode']}:_0x10c9e7);});}; \ No newline at end of file +var _0xd9af=['type','VIRTUAL','field','options','count','includeAll','findAll','find','create','body','params','getConfigurations','VtigerConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','findOne','username','description','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','%s/webservice.php','GET','success','POST','login','result','token','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','picklistValues','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','set','Content-Range','apply','destroy','sendStatus','stack','name','send','index','VtigerAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','map'];(function(_0x608345,_0x24ed9c){var _0x56cf57=function(_0x3d0f9b){while(--_0x3d0f9b){_0x608345['push'](_0x608345['shift']());}};_0x56cf57(++_0x24ed9c);}(_0xd9af,0xb2));var _0xfd9a=function(_0x1c3001,_0x28277f){_0x1c3001=_0x1c3001-0x0;var _0x1486bd=_0xd9af[_0x1c3001];return _0x1486bd;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xfd9a('0x0'));var zipdir=require(_0xfd9a('0x1'));var jsonpatch=require(_0xfd9a('0x2'));var rp=require(_0xfd9a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfd9a('0x4'));var util=require('util');var path=require(_0xfd9a('0x5'));var sox=require(_0xfd9a('0x6'));var csv=require(_0xfd9a('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfd9a('0x8'));var squel=require(_0xfd9a('0x9'));var crypto=require(_0xfd9a('0xa'));var jsforce=require(_0xfd9a('0xb'));var deskjs=require(_0xfd9a('0xc'));var toCsv=require(_0xfd9a('0x7'));var querystring=require(_0xfd9a('0xd'));var Papa=require('papaparse');var Redis=require(_0xfd9a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xfd9a('0xf'));var hardwareService=require(_0xfd9a('0x10'));var logger=require(_0xfd9a('0x11'))(_0xfd9a('0x12'));var utils=require(_0xfd9a('0x13'));var config=require(_0xfd9a('0x14'));var db=require(_0xfd9a('0x15'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xfd9a('0x16'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x52273e,_0x2fe297,_0x37db3c){if(_0x37db3c){var _0x1404a5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1404a5[_0xfd9a('0x17')](_0x2fe297)){return _0x52273e;}else{throw new Error(_0xfd9a('0x18'));}}else{return _0x52273e;}}function respondWithRpcPromise(_0x38ba43,_0x377e07,_0xcd3f49,_0x91008e){return new BPromise(function(_0x2a1dd9,_0x542b90){var _0x2cb1f2=_0x91008e||client;return _0x2cb1f2['request'](_0x38ba43,_0xcd3f49)[_0xfd9a('0x19')](function(_0x3ee3cc){logger[_0xfd9a('0x1a')](_0xfd9a('0x1b'),_0x377e07,_0xfd9a('0x1c'));logger[_0xfd9a('0x1d')](_0xfd9a('0x1e'),_0x377e07,_0xfd9a('0x1c'),JSON[_0xfd9a('0x1f')](_0x3ee3cc));if(_0x3ee3cc[_0xfd9a('0x20')]){if(_0x3ee3cc[_0xfd9a('0x20')][_0xfd9a('0x21')]===0x1f4){logger['error'](_0xfd9a('0x1b'),_0x377e07,_0x3ee3cc[_0xfd9a('0x20')]['message']);return _0x542b90(_0x3ee3cc[_0xfd9a('0x20')][_0xfd9a('0x22')]);}logger[_0xfd9a('0x20')](_0xfd9a('0x1b'),_0x377e07,_0x3ee3cc[_0xfd9a('0x20')][_0xfd9a('0x22')]);return _0x2a1dd9(_0x3ee3cc[_0xfd9a('0x20')][_0xfd9a('0x22')]);}else{logger[_0xfd9a('0x1a')]('VtigerAccount,\x20%s,\x20%s',_0x377e07,_0xfd9a('0x1c'));_0x2a1dd9(_0x3ee3cc['result']['message']);}})[_0xfd9a('0x23')](function(_0x5966fd){logger[_0xfd9a('0x20')](_0xfd9a('0x1b'),_0x377e07,_0x5966fd);_0x542b90(_0x5966fd);});});}function respondWithStatusCode(_0xa8e229,_0x3476b2){_0x3476b2=_0x3476b2||0xcc;return function(_0x493910){if(_0x493910){return _0xa8e229['sendStatus'](_0x3476b2);}return _0xa8e229[_0xfd9a('0x24')](_0x3476b2)[_0xfd9a('0x25')]();};}function respondWithResult(_0x169f28,_0x541d7d){_0x541d7d=_0x541d7d||0xc8;return function(_0x7210a4){if(_0x7210a4){return _0x169f28[_0xfd9a('0x24')](_0x541d7d)[_0xfd9a('0x26')](_0x7210a4);}};}function respondWithFilteredResult(_0x11d0d8,_0xd9eea8){return function(_0xc43fea){if(_0xc43fea){var _0x4fed25=_0xc43fea['count'],_0x42ef43=_0xd9eea8['offset'],_0x1ed331=_0xd9eea8[_0xfd9a('0x27')]+_0xd9eea8['limit'],_0x587e10;if(_0x1ed331>=_0x4fed25){_0x1ed331=_0x4fed25;_0x587e10=0xc8;}else{_0x587e10=0xce;}_0x11d0d8[_0xfd9a('0x24')](_0x587e10);return _0x11d0d8[_0xfd9a('0x28')](_0xfd9a('0x29'),_0x42ef43+'-'+_0x1ed331+'/'+_0x4fed25)[_0xfd9a('0x26')](_0xc43fea);}return null;};}function patchUpdates(_0x3ed144){return function(_0x573a83){try{jsonpatch[_0xfd9a('0x2a')](_0x573a83,_0x3ed144,!![]);}catch(_0x2681da){return BPromise['reject'](_0x2681da);}return _0x573a83['save']();};}function saveUpdates(_0xa9536b,_0x3e7a50){return function(_0x128304){if(_0x128304){return _0x128304['update'](_0xa9536b)[_0xfd9a('0x19')](function(_0x307845){return _0x307845;});}return null;};}function removeEntity(_0x356e87,_0x308f49){return function(_0x16cee5){if(_0x16cee5){return _0x16cee5[_0xfd9a('0x2b')]()[_0xfd9a('0x19')](function(){_0x356e87[_0xfd9a('0x24')](0xcc)[_0xfd9a('0x25')]();});}};}function handleEntityNotFound(_0x5dfa79,_0x5b9cfd){return function(_0x33d463){if(!_0x33d463){_0x5dfa79[_0xfd9a('0x2c')](0x194);}return _0x33d463;};}function handleError(_0x4c12d0,_0x43520d){_0x43520d=_0x43520d||0x1f4;return function(_0x4e9acb){logger[_0xfd9a('0x20')](_0x4e9acb[_0xfd9a('0x2d')]);if(_0x4e9acb[_0xfd9a('0x2e')]){delete _0x4e9acb[_0xfd9a('0x2e')];}_0x4c12d0[_0xfd9a('0x24')](_0x43520d)[_0xfd9a('0x2f')](_0x4e9acb);};}exports[_0xfd9a('0x30')]=function(_0xb697fa,_0x97d985){var _0x13bcde={},_0x52f712={},_0x43b963={'count':0x0,'rows':[]};var _0x53e2b7=db[_0xfd9a('0x31')][_0xfd9a('0x32')];_0x52f712[_0xfd9a('0x33')]=_[_0xfd9a('0x34')](_0x53e2b7);_0x52f712[_0xfd9a('0x35')]=_['keys'](_0xb697fa[_0xfd9a('0x35')]);_0x52f712[_0xfd9a('0x36')]=_[_0xfd9a('0x37')](_0x52f712[_0xfd9a('0x33')],_0x52f712['query']);_0x13bcde[_0xfd9a('0x38')]=_[_0xfd9a('0x37')](_0x52f712[_0xfd9a('0x33')],qs[_0xfd9a('0x39')](_0xb697fa['query'][_0xfd9a('0x39')]));_0x13bcde[_0xfd9a('0x38')]=_0x13bcde[_0xfd9a('0x38')][_0xfd9a('0x3a')]?_0x13bcde[_0xfd9a('0x38')]:_0x52f712[_0xfd9a('0x33')];if(!_0xb697fa[_0xfd9a('0x35')]['hasOwnProperty'](_0xfd9a('0x3b'))){_0x13bcde[_0xfd9a('0x3c')]=qs[_0xfd9a('0x3c')](_0xb697fa['query']['limit']);_0x13bcde['offset']=qs[_0xfd9a('0x27')](_0xb697fa[_0xfd9a('0x35')][_0xfd9a('0x27')]);}_0x13bcde[_0xfd9a('0x3d')]=qs[_0xfd9a('0x3e')](_0xb697fa[_0xfd9a('0x35')]['sort']);_0x13bcde[_0xfd9a('0x3f')]=qs[_0xfd9a('0x36')](_[_0xfd9a('0x40')](_0xb697fa[_0xfd9a('0x35')],_0x52f712[_0xfd9a('0x36')]));if(_0xb697fa[_0xfd9a('0x35')][_0xfd9a('0x41')]){_0x13bcde[_0xfd9a('0x3f')]=_[_0xfd9a('0x42')](_0x13bcde['where'],{'$or':_[_0xfd9a('0x43')](_0x53e2b7,function(_0x5bcebb){if(_0x5bcebb[_0xfd9a('0x44')]['key']!==_0xfd9a('0x45')){var _0x8440aa={};_0x8440aa[_0x5bcebb[_0xfd9a('0x46')]]={'$like':'%'+_0xb697fa['query']['filter']+'%'};return _0x8440aa;}})});}_0x13bcde=_['merge']({},_0x13bcde,_0xb697fa[_0xfd9a('0x47')]);var _0x4c2e5e={'where':_0x13bcde[_0xfd9a('0x3f')]};return db[_0xfd9a('0x31')][_0xfd9a('0x48')](_0x4c2e5e)[_0xfd9a('0x19')](function(_0x8c1ac3){_0x43b963['count']=_0x8c1ac3;if(_0xb697fa[_0xfd9a('0x35')][_0xfd9a('0x49')]){_0x13bcde['include']=[{'all':!![]}];}return db[_0xfd9a('0x31')][_0xfd9a('0x4a')](_0x13bcde);})[_0xfd9a('0x19')](function(_0x2d3002){_0x43b963['rows']=_0x2d3002;return _0x43b963;})[_0xfd9a('0x19')](respondWithFilteredResult(_0x97d985,_0x13bcde))[_0xfd9a('0x23')](handleError(_0x97d985,null));};exports['show']=function(_0x3a7b0d,_0x3b59f0){var _0x4d5df9={'raw':![],'where':{'id':_0x3a7b0d['params']['id']}},_0x1892b6={};_0x1892b6['model']=_['keys'](db['VtigerAccount'][_0xfd9a('0x32')]);_0x1892b6['query']=_[_0xfd9a('0x34')](_0x3a7b0d[_0xfd9a('0x35')]);_0x1892b6[_0xfd9a('0x36')]=_[_0xfd9a('0x37')](_0x1892b6[_0xfd9a('0x33')],_0x1892b6[_0xfd9a('0x35')]);_0x4d5df9[_0xfd9a('0x38')]=_[_0xfd9a('0x37')](_0x1892b6[_0xfd9a('0x33')],qs[_0xfd9a('0x39')](_0x3a7b0d[_0xfd9a('0x35')][_0xfd9a('0x39')]));_0x4d5df9[_0xfd9a('0x38')]=_0x4d5df9[_0xfd9a('0x38')][_0xfd9a('0x3a')]?_0x4d5df9[_0xfd9a('0x38')]:_0x1892b6[_0xfd9a('0x33')];if(_0x3a7b0d[_0xfd9a('0x35')][_0xfd9a('0x49')]){_0x4d5df9['include']=[{'all':!![]}];}_0x4d5df9=_['merge']({},_0x4d5df9,_0x3a7b0d[_0xfd9a('0x47')]);return db[_0xfd9a('0x31')][_0xfd9a('0x4b')](_0x4d5df9)[_0xfd9a('0x19')](handleEntityNotFound(_0x3b59f0,null))[_0xfd9a('0x19')](respondWithResult(_0x3b59f0,null))['catch'](handleError(_0x3b59f0,null));};exports[_0xfd9a('0x4c')]=function(_0x127422,_0x5e1faa){return db['VtigerAccount']['create'](_0x127422[_0xfd9a('0x4d')],{})[_0xfd9a('0x19')](respondWithResult(_0x5e1faa,0xc9))[_0xfd9a('0x23')](handleError(_0x5e1faa,null));};exports['update']=function(_0x58828e,_0x2eb0d7){if(_0x58828e[_0xfd9a('0x4d')]['id']){delete _0x58828e[_0xfd9a('0x4d')]['id'];}return db[_0xfd9a('0x31')]['find']({'where':{'id':_0x58828e['params']['id']}})[_0xfd9a('0x19')](handleEntityNotFound(_0x2eb0d7,null))['then'](saveUpdates(_0x58828e['body'],null))[_0xfd9a('0x19')](respondWithResult(_0x2eb0d7,null))[_0xfd9a('0x23')](handleError(_0x2eb0d7,null));};exports[_0xfd9a('0x2b')]=function(_0x18d4da,_0x5a00d1){return db[_0xfd9a('0x31')][_0xfd9a('0x4b')]({'where':{'id':_0x18d4da[_0xfd9a('0x4e')]['id']}})[_0xfd9a('0x19')](handleEntityNotFound(_0x5a00d1,null))[_0xfd9a('0x19')](removeEntity(_0x5a00d1,null))[_0xfd9a('0x23')](handleError(_0x5a00d1,null));};exports[_0xfd9a('0x4f')]=function(_0x59ee1d,_0x38c2cd,_0x25057b){var _0x4a71b8={};var _0x2f1a97={};var _0x132e8c;var _0x3338cf;return db[_0xfd9a('0x31')]['findOne']({'where':{'id':_0x59ee1d[_0xfd9a('0x4e')]['id']}})[_0xfd9a('0x19')](handleEntityNotFound(_0x38c2cd,null))['then'](function(_0x4d0676){if(_0x4d0676){_0x132e8c=_0x4d0676;_0x2f1a97[_0xfd9a('0x33')]=_[_0xfd9a('0x34')](db[_0xfd9a('0x50')][_0xfd9a('0x32')]);_0x2f1a97[_0xfd9a('0x35')]=_['keys'](_0x59ee1d[_0xfd9a('0x35')]);_0x2f1a97[_0xfd9a('0x36')]=_['intersection'](_0x2f1a97[_0xfd9a('0x33')],_0x2f1a97['query']);_0x4a71b8[_0xfd9a('0x38')]=_[_0xfd9a('0x37')](_0x2f1a97[_0xfd9a('0x33')],qs[_0xfd9a('0x39')](_0x59ee1d[_0xfd9a('0x35')][_0xfd9a('0x39')]));_0x4a71b8[_0xfd9a('0x38')]=_0x4a71b8[_0xfd9a('0x38')][_0xfd9a('0x3a')]?_0x4a71b8['attributes']:_0x2f1a97['model'];_0x4a71b8[_0xfd9a('0x3d')]=qs['sort'](_0x59ee1d[_0xfd9a('0x35')][_0xfd9a('0x3e')]);_0x4a71b8['where']=qs[_0xfd9a('0x36')](_['pick'](_0x59ee1d[_0xfd9a('0x35')],_0x2f1a97[_0xfd9a('0x36')]));if(_0x59ee1d[_0xfd9a('0x35')]['filter']){_0x4a71b8[_0xfd9a('0x3f')]=_[_0xfd9a('0x42')](_0x4a71b8[_0xfd9a('0x3f')],{'$or':_[_0xfd9a('0x43')](_0x4a71b8[_0xfd9a('0x38')],function(_0x3c8578){var _0x18b918={};_0x18b918[_0x3c8578]={'$like':'%'+_0x59ee1d[_0xfd9a('0x35')][_0xfd9a('0x41')]+'%'};return _0x18b918;})});}_0x4a71b8=_[_0xfd9a('0x42')]({},_0x4a71b8,_0x59ee1d[_0xfd9a('0x47')]);return _0x132e8c[_0xfd9a('0x4f')](_0x4a71b8);}})[_0xfd9a('0x19')](function(_0x30d80b){if(_0x30d80b){_0x3338cf=_0x30d80b['length'];if(!_0x59ee1d[_0xfd9a('0x35')][_0xfd9a('0x51')](_0xfd9a('0x3b'))){_0x4a71b8[_0xfd9a('0x3c')]=qs[_0xfd9a('0x3c')](_0x59ee1d['query'][_0xfd9a('0x3c')]);_0x4a71b8[_0xfd9a('0x27')]=qs[_0xfd9a('0x27')](_0x59ee1d[_0xfd9a('0x35')]['offset']);}return _0x132e8c[_0xfd9a('0x4f')](_0x4a71b8);}})[_0xfd9a('0x19')](function(_0x179af2){if(_0x179af2){return _0x179af2?{'count':_0x3338cf,'rows':_0x179af2}:null;}})['then'](respondWithResult(_0x38c2cd,null))[_0xfd9a('0x23')](handleError(_0x38c2cd,null));};exports[_0xfd9a('0x52')]=function(_0x3970b5,_0x50ea8f,_0x5dfc70){if(_0x3970b5['body']['id']){delete _0x3970b5[_0xfd9a('0x4d')]['id'];}return db[_0xfd9a('0x31')]['findOne']({'where':{'id':_0x3970b5[_0xfd9a('0x4e')]['id']}})[_0xfd9a('0x19')](handleEntityNotFound(_0x50ea8f,null))[_0xfd9a('0x19')](function(_0x25b5e7){if(_0x25b5e7){_0x3970b5[_0xfd9a('0x4d')][_0xfd9a('0x53')]=_0x25b5e7['id'];_0x3970b5[_0xfd9a('0x4d')][_0xfd9a('0x54')]=integrations[_0xfd9a('0x55')](_0x3970b5[_0xfd9a('0x4d')][_0xfd9a('0x56')],_0x3970b5[_0xfd9a('0x4d')][_0xfd9a('0x44')]);_0x3970b5[_0xfd9a('0x4d')][_0xfd9a('0x57')]=integrations[_0xfd9a('0x58')](_0x3970b5['body'][_0xfd9a('0x56')],_0x3970b5[_0xfd9a('0x4d')][_0xfd9a('0x44')]);return db[_0xfd9a('0x50')][_0xfd9a('0x4c')](_0x3970b5[_0xfd9a('0x4d')],{'include':[{'model':db['VtigerField'],'as':_0xfd9a('0x54')},{'model':db[_0xfd9a('0x59')],'as':_0xfd9a('0x57')}]});}return null;})[_0xfd9a('0x19')](respondWithResult(_0x50ea8f,null))[_0xfd9a('0x23')](handleError(_0x50ea8f,null));};var md5=require(_0xfd9a('0x5a'));exports[_0xfd9a('0x5b')]=function(_0x487ba2,_0x47877e,_0x5a9936){var _0x3f4676=null;var _0x3f50ef=null;var _0x22a0bf=null;var _0x2a691b=null;var _0x1a2609='';return db[_0xfd9a('0x31')][_0xfd9a('0x5c')]({'where':{'id':_0x487ba2[_0xfd9a('0x4e')]['id']},'attributes':['id','name',_0xfd9a('0x5d'),_0xfd9a('0x5e'),_0xfd9a('0x5f'),_0xfd9a('0x60'),'serverUrl',_0xfd9a('0x61')]})[_0xfd9a('0x19')](handleEntityNotFound(_0x47877e,null))[_0xfd9a('0x19')](function(_0xa8c8d6){if(_0xa8c8d6){_0x3f4676=_0xa8c8d6[_0xfd9a('0x5d')];_0x3f50ef=_0xa8c8d6[_0xfd9a('0x61')];_0x22a0bf=_0xa8c8d6['moduleName'];_0x1a2609=_0xa8c8d6['remoteUri'];var _0x1cc015=_0x1a2609[_0xfd9a('0x62')](-0x1);if(_0x1cc015==='/'){_0x1a2609=_0x1a2609[_0xfd9a('0x63')](0x0,_0x1a2609[_0xfd9a('0x64')](_0x1cc015));}_0x2a691b=util['format'](_0xfd9a('0x65'),_0x1a2609);var _0x39713d={'method':_0xfd9a('0x66'),'uri':_0x2a691b,'qs':{'operation':'getchallenge','username':_0xa8c8d6[_0xfd9a('0x5d')]},'json':!![]};return rp(_0x39713d);}})[_0xfd9a('0x19')](function(_0x1d3c1a){if(_0x1d3c1a[_0xfd9a('0x67')]){var _0xc1f039={'method':_0xfd9a('0x68'),'uri':_0x2a691b,'form':{'operation':_0xfd9a('0x69'),'username':_0x3f4676,'accessKey':md5(_0x1d3c1a[_0xfd9a('0x6a')][_0xfd9a('0x6b')]+_0x3f50ef)},'json':!![]};return rp(_0xc1f039);}})['then'](function(_0x1f4477){if(_0x1f4477[_0xfd9a('0x67')]){var _0x40f40a={'method':_0xfd9a('0x66'),'uri':_0x2a691b,'qs':{'operation':'describe','username':_0x3f4676,'sessionName':_0x1f4477[_0xfd9a('0x6a')][_0xfd9a('0x6c')],'elementType':_0x22a0bf},'json':!![]};return rp(_0x40f40a);}})['then'](function(_0x3dfdba){if(_0x3dfdba['success']){var _0x1e244a=[_0xfd9a('0x6d'),_0xfd9a('0x6e'),_0xfd9a('0x6f')];_[_0xfd9a('0x70')](_0x3dfdba[_0xfd9a('0x6a')]['fields'],function(_0x598dbe){return _0x1e244a[_0xfd9a('0x71')](_0x598dbe[_0xfd9a('0x44')][_0xfd9a('0x2e')]);});_[_0xfd9a('0x70')](_0x3dfdba[_0xfd9a('0x6a')][_0xfd9a('0x39')],function(_0x3bf1ec){return _0x3bf1ec[_0xfd9a('0x72')]===_0xfd9a('0x73');});return{'count':_0x3dfdba[_0xfd9a('0x6a')][_0xfd9a('0x39')][_0xfd9a('0x3a')],'rows':_['map'](_0x3dfdba[_0xfd9a('0x6a')]['fields'],function(_0x872a2b){return{'id':_0x872a2b[_0xfd9a('0x2e')],'name':_0x872a2b[_0xfd9a('0x74')],'custom':_['startsWith'](_0x872a2b[_0xfd9a('0x2e')],'cf_')?!![]:![],'options':_0x872a2b[_0xfd9a('0x44')][_0xfd9a('0x2e')]==='picklist'&&_0x872a2b['type'][_0xfd9a('0x75')][_0xfd9a('0x3a')]>0x0?_[_0xfd9a('0x43')](_0x872a2b['type'][_0xfd9a('0x75')],function(_0x393fa6){return{'name':_0x393fa6[_0xfd9a('0x74')],'value':_0x393fa6['value']};}):[]};})};}})[_0xfd9a('0x19')](respondWithResult(_0x47877e,null))[_0xfd9a('0x23')](function(_0x5da1f8){console[_0xfd9a('0x76')](_0xfd9a('0x77')+_0x5da1f8);var _0x13a271=_0x487ba2[_0xfd9a('0x35')][_0xfd9a('0x17')]?0x1f4:_0x5da1f8[_0xfd9a('0x78')]||0x1f4;logger[_0xfd9a('0x20')](_0xfd9a('0x79'),_0xfd9a('0x5b'),_0x13a271,JSON[_0xfd9a('0x1f')](_0x5da1f8));delete _0x5da1f8[_0xfd9a('0x2e')];if(_0x13a271===0x191){_0x13a271=0x190;}_0x47877e[_0xfd9a('0x24')](_0x13a271)['send'](_0x487ba2[_0xfd9a('0x35')][_0xfd9a('0x17')]?{'message':_0xfd9a('0x7a'),'statusCode':_0x5da1f8[_0xfd9a('0x78')]}:_0x5da1f8);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index b4b5306..915a9b8 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 _0xcfc1=['../../config/logger','api','moment','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','lodash','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcfc1,0xe2));var _0x1cfc=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xcfc1[_0x1b6c6d];return _0x290d9d;};'use strict';var _=require(_0x1cfc('0x0'));var util=require(_0x1cfc('0x1'));var logger=require(_0x1cfc('0x2'))(_0x1cfc('0x3'));var moment=require(_0x1cfc('0x4'));var BPromise=require('bluebird');var rp=require(_0x1cfc('0x5'));var fs=require('fs');var path=require(_0x1cfc('0x6'));var rimraf=require(_0x1cfc('0x7'));var config=require('../../config/environment');var attributes=require(_0x1cfc('0x8'));var integrations=require(_0x1cfc('0x9'));module[_0x1cfc('0xa')]=function(_0x5d1bd5,_0x4eb3a5){return _0x5d1bd5['define'](_0x1cfc('0xb'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4af=['int_vtiger_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','exports','define','VtigerAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4af,0xd1));var _0xfc4a=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xc4af[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0xfc4a('0x0'));var util=require(_0xfc4a('0x1'));var logger=require(_0xfc4a('0x2'))(_0xfc4a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfc4a('0x4'));var fs=require('fs');var path=require(_0xfc4a('0x5'));var rimraf=require(_0xfc4a('0x6'));var config=require(_0xfc4a('0x7'));var attributes=require(_0xfc4a('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xfc4a('0x9')]=function(_0x34b5c5,_0xdf1589){return _0x34b5c5[_0xfc4a('0xa')](_0xfc4a('0xb'),attributes,{'tableName':_0xfc4a('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 f2c4326..ec32d69 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 _0x2b3a=['attributes','limit','include','map','model','ShowVtigerAccount','find','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0x2b3a,0xfc));var _0xa2b3=function(_0x397b78,_0x14fa5f){_0x397b78=_0x397b78-0x0;var _0x313598=_0x2b3a[_0x397b78];return _0x313598;};'use strict';var _=require(_0xa2b3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa2b3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa2b3('0x2'));var db=require(_0xa2b3('0x3'))['db'];var utils=require(_0xa2b3('0x4'));var logger=require('../../config/logger')(_0xa2b3('0x5'));var config=require(_0xa2b3('0x6'));var jayson=require(_0xa2b3('0x7'));var client=jayson[_0xa2b3('0x8')][_0xa2b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c0049,_0x34091e,_0x3443ea){return new BPromise(function(_0x2d6937,_0xb45c6a){return client[_0xa2b3('0xa')](_0x3c0049,_0x3443ea)[_0xa2b3('0xb')](function(_0x5875e){logger[_0xa2b3('0xc')](_0xa2b3('0xd'),_0x34091e,_0xa2b3('0xe'));logger[_0xa2b3('0xf')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x34091e,_0xa2b3('0xe'),JSON[_0xa2b3('0x10')](_0x5875e));if(_0x5875e['error']){if(_0x5875e[_0xa2b3('0x11')][_0xa2b3('0x12')]===0x1f4){logger[_0xa2b3('0x11')](_0xa2b3('0xd'),_0x34091e,_0x5875e[_0xa2b3('0x11')][_0xa2b3('0x13')]);return _0xb45c6a(_0x5875e[_0xa2b3('0x11')][_0xa2b3('0x13')]);}logger[_0xa2b3('0x11')](_0xa2b3('0xd'),_0x34091e,_0x5875e[_0xa2b3('0x11')]['message']);return _0x2d6937(_0x5875e[_0xa2b3('0x11')][_0xa2b3('0x13')]);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x34091e,'request\x20sent');_0x2d6937(_0x5875e[_0xa2b3('0x14')][_0xa2b3('0x13')]);}})[_0xa2b3('0x15')](function(_0x5c0e04){logger[_0xa2b3('0x11')](_0xa2b3('0xd'),_0x34091e,_0x5c0e04);_0xb45c6a(_0x5c0e04);});});}exports[_0xa2b3('0x16')]=function(_0xcb3e68){var _0x3a48e1=this;return new Promise(function(_0x166e56,_0x525e61){return db[_0xa2b3('0x17')][_0xa2b3('0x18')]({'raw':_0xcb3e68[_0xa2b3('0x19')]?_0xcb3e68[_0xa2b3('0x19')][_0xa2b3('0x1a')]===undefined?!![]:![]:!![],'where':_0xcb3e68['options']?_0xcb3e68[_0xa2b3('0x19')][_0xa2b3('0x1b')]||null:null,'attributes':_0xcb3e68[_0xa2b3('0x19')]?_0xcb3e68[_0xa2b3('0x19')][_0xa2b3('0x1c')]||null:null,'limit':_0xcb3e68['options']?_0xcb3e68[_0xa2b3('0x19')][_0xa2b3('0x1d')]||null:null,'include':_0xcb3e68[_0xa2b3('0x19')]?_0xcb3e68['options']['include']?_['map'](_0xcb3e68[_0xa2b3('0x19')][_0xa2b3('0x1e')],function(_0x7da46d){return{'model':db[_0x7da46d['model']],'as':_0x7da46d['as'],'attributes':_0x7da46d[_0xa2b3('0x1c')],'include':_0x7da46d[_0xa2b3('0x1e')]?_[_0xa2b3('0x1f')](_0x7da46d['include'],function(_0x389db7){return{'model':db[_0x389db7['model']],'as':_0x389db7['as'],'attributes':_0x389db7[_0xa2b3('0x1c')],'include':_0x389db7[_0xa2b3('0x1e')]?_[_0xa2b3('0x1f')](_0x389db7[_0xa2b3('0x1e')],function(_0xd79eb1){return{'model':db[_0xd79eb1[_0xa2b3('0x20')]],'as':_0xd79eb1['as'],'attributes':_0xd79eb1[_0xa2b3('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x840e94){logger[_0xa2b3('0xc')](_0xa2b3('0x16'),_0xcb3e68);logger[_0xa2b3('0xf')](_0xa2b3('0x16'),_0xcb3e68,JSON[_0xa2b3('0x10')](_0x840e94));_0x166e56(_0x840e94);})[_0xa2b3('0x15')](function(_0x3e083d){logger[_0xa2b3('0x11')]('GetVtigerAccount',_0x3e083d[_0xa2b3('0x13')],_0xcb3e68);_0x525e61(_0x3a48e1[_0xa2b3('0x11')](0x1f4,_0x3e083d[_0xa2b3('0x13')]));});});};exports[_0xa2b3('0x21')]=function(_0x1f07d6){var _0x2f27f8=this;return new Promise(function(_0x2dea68,_0xde8fe1){return db['VtigerAccount'][_0xa2b3('0x22')]({'raw':_0x1f07d6[_0xa2b3('0x19')]?_0x1f07d6[_0xa2b3('0x19')][_0xa2b3('0x1a')]===undefined?!![]:![]:!![],'where':_0x1f07d6['options']?_0x1f07d6[_0xa2b3('0x19')][_0xa2b3('0x1b')]||null:null,'attributes':_0x1f07d6['options']?_0x1f07d6[_0xa2b3('0x19')]['attributes']||null:null,'include':_0x1f07d6[_0xa2b3('0x19')]?_0x1f07d6[_0xa2b3('0x19')][_0xa2b3('0x1e')]?_[_0xa2b3('0x1f')](_0x1f07d6[_0xa2b3('0x19')][_0xa2b3('0x1e')],function(_0x215d65){return{'model':db[_0x215d65[_0xa2b3('0x20')]],'as':_0x215d65['as'],'attributes':_0x215d65[_0xa2b3('0x1c')],'include':_0x215d65[_0xa2b3('0x1e')]?_['map'](_0x215d65[_0xa2b3('0x1e')],function(_0x429500){return{'model':db[_0x429500[_0xa2b3('0x20')]],'as':_0x429500['as'],'attributes':_0x429500[_0xa2b3('0x1c')],'include':_0x429500[_0xa2b3('0x1e')]?_[_0xa2b3('0x1f')](_0x429500[_0xa2b3('0x1e')],function(_0x568c38){return{'model':db[_0x568c38[_0xa2b3('0x20')]],'as':_0x568c38['as'],'attributes':_0x568c38['attributes']};}):[]};}):[]};}):[]:[]})[_0xa2b3('0xb')](function(_0x5ed404){logger['info'](_0xa2b3('0x21'),_0x1f07d6);logger[_0xa2b3('0xf')](_0xa2b3('0x21'),_0x1f07d6,JSON[_0xa2b3('0x10')](_0x5ed404));_0x2dea68(_0x5ed404);})[_0xa2b3('0x15')](function(_0x6a3741){logger[_0xa2b3('0x11')](_0xa2b3('0x21'),_0x6a3741[_0xa2b3('0x13')],_0x1f07d6);_0xde8fe1(_0x2f27f8[_0xa2b3('0x11')](0x1f4,_0x6a3741[_0xa2b3('0x13')]));});});}; \ No newline at end of file +var _0xab0d=['attributes','limit','include','model','map','stringify','ShowVtigerAccount','VtigerAccount','find','where','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetVtigerAccount','options','raw'];(function(_0x1ed590,_0xcf3203){var _0x2de65f=function(_0xcabcd1){while(--_0xcabcd1){_0x1ed590['push'](_0x1ed590['shift']());}};_0x2de65f(++_0xcf3203);}(_0xab0d,0x196));var _0xdab0=function(_0x2ae044,_0x5c21c4){_0x2ae044=_0x2ae044-0x0;var _0x2524f8=_0xab0d[_0x2ae044];return _0x2524f8;};'use strict';var _=require(_0xdab0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdab0('0x1'));var rs=require(_0xdab0('0x2'));var fs=require('fs');var Redis=require(_0xdab0('0x3'));var db=require(_0xdab0('0x4'))['db'];var utils=require(_0xdab0('0x5'));var logger=require(_0xdab0('0x6'))(_0xdab0('0x7'));var config=require(_0xdab0('0x8'));var jayson=require(_0xdab0('0x9'));var client=jayson[_0xdab0('0xa')][_0xdab0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59ea5f,_0x20e5cd,_0x13de21){return new BPromise(function(_0x33337c,_0x2fa987){return client[_0xdab0('0xc')](_0x59ea5f,_0x13de21)[_0xdab0('0xd')](function(_0xbcecfe){logger[_0xdab0('0xe')](_0xdab0('0xf'),_0x20e5cd,_0xdab0('0x10'));logger[_0xdab0('0x11')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x20e5cd,_0xdab0('0x10'),JSON['stringify'](_0xbcecfe));if(_0xbcecfe[_0xdab0('0x12')]){if(_0xbcecfe[_0xdab0('0x12')][_0xdab0('0x13')]===0x1f4){logger[_0xdab0('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x20e5cd,_0xbcecfe[_0xdab0('0x12')][_0xdab0('0x14')]);return _0x2fa987(_0xbcecfe['error'][_0xdab0('0x14')]);}logger[_0xdab0('0x12')](_0xdab0('0xf'),_0x20e5cd,_0xbcecfe['error'][_0xdab0('0x14')]);return _0x33337c(_0xbcecfe[_0xdab0('0x12')][_0xdab0('0x14')]);}else{logger[_0xdab0('0xe')](_0xdab0('0xf'),_0x20e5cd,_0xdab0('0x10'));_0x33337c(_0xbcecfe[_0xdab0('0x15')][_0xdab0('0x14')]);}})[_0xdab0('0x16')](function(_0x275034){logger['error'](_0xdab0('0xf'),_0x20e5cd,_0x275034);_0x2fa987(_0x275034);});});}exports[_0xdab0('0x17')]=function(_0x555929){var _0x240c9d=this;return new Promise(function(_0x30d549,_0x11032e){return db['VtigerAccount']['findAll']({'raw':_0x555929[_0xdab0('0x18')]?_0x555929['options'][_0xdab0('0x19')]===undefined?!![]:![]:!![],'where':_0x555929['options']?_0x555929[_0xdab0('0x18')]['where']||null:null,'attributes':_0x555929['options']?_0x555929[_0xdab0('0x18')][_0xdab0('0x1a')]||null:null,'limit':_0x555929[_0xdab0('0x18')]?_0x555929[_0xdab0('0x18')][_0xdab0('0x1b')]||null:null,'include':_0x555929[_0xdab0('0x18')]?_0x555929['options'][_0xdab0('0x1c')]?_['map'](_0x555929[_0xdab0('0x18')][_0xdab0('0x1c')],function(_0x327913){return{'model':db[_0x327913[_0xdab0('0x1d')]],'as':_0x327913['as'],'attributes':_0x327913['attributes'],'include':_0x327913['include']?_[_0xdab0('0x1e')](_0x327913[_0xdab0('0x1c')],function(_0x254c2b){return{'model':db[_0x254c2b[_0xdab0('0x1d')]],'as':_0x254c2b['as'],'attributes':_0x254c2b[_0xdab0('0x1a')],'include':_0x254c2b['include']?_[_0xdab0('0x1e')](_0x254c2b[_0xdab0('0x1c')],function(_0x2e0d9d){return{'model':db[_0x2e0d9d[_0xdab0('0x1d')]],'as':_0x2e0d9d['as'],'attributes':_0x2e0d9d[_0xdab0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xdab0('0xd')](function(_0x51d9b0){logger[_0xdab0('0xe')]('GetVtigerAccount',_0x555929);logger[_0xdab0('0x11')](_0xdab0('0x17'),_0x555929,JSON[_0xdab0('0x1f')](_0x51d9b0));_0x30d549(_0x51d9b0);})['catch'](function(_0x1b1cd7){logger[_0xdab0('0x12')]('GetVtigerAccount',_0x1b1cd7[_0xdab0('0x14')],_0x555929);_0x11032e(_0x240c9d[_0xdab0('0x12')](0x1f4,_0x1b1cd7['message']));});});};exports[_0xdab0('0x20')]=function(_0x59ef84){var _0x31d3e9=this;return new Promise(function(_0x3cbd31,_0x5d8b83){return db[_0xdab0('0x21')][_0xdab0('0x22')]({'raw':_0x59ef84['options']?_0x59ef84[_0xdab0('0x18')][_0xdab0('0x19')]===undefined?!![]:![]:!![],'where':_0x59ef84[_0xdab0('0x18')]?_0x59ef84['options'][_0xdab0('0x23')]||null:null,'attributes':_0x59ef84['options']?_0x59ef84[_0xdab0('0x18')][_0xdab0('0x1a')]||null:null,'include':_0x59ef84[_0xdab0('0x18')]?_0x59ef84[_0xdab0('0x18')][_0xdab0('0x1c')]?_['map'](_0x59ef84['options'][_0xdab0('0x1c')],function(_0x392706){return{'model':db[_0x392706[_0xdab0('0x1d')]],'as':_0x392706['as'],'attributes':_0x392706[_0xdab0('0x1a')],'include':_0x392706['include']?_[_0xdab0('0x1e')](_0x392706[_0xdab0('0x1c')],function(_0x501117){return{'model':db[_0x501117[_0xdab0('0x1d')]],'as':_0x501117['as'],'attributes':_0x501117['attributes'],'include':_0x501117['include']?_[_0xdab0('0x1e')](_0x501117['include'],function(_0xed1e97){return{'model':db[_0xed1e97[_0xdab0('0x1d')]],'as':_0xed1e97['as'],'attributes':_0xed1e97[_0xdab0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xdab0('0xd')](function(_0x1ec1ac){logger[_0xdab0('0xe')](_0xdab0('0x20'),_0x59ef84);logger[_0xdab0('0x11')](_0xdab0('0x20'),_0x59ef84,JSON[_0xdab0('0x1f')](_0x1ec1ac));_0x3cbd31(_0x1ec1ac);})[_0xdab0('0x16')](function(_0x2ddf60){logger[_0xdab0('0x12')](_0xdab0('0x20'),_0x2ddf60['message'],_0x59ef84);_0x5d8b83(_0x31d3e9[_0xdab0('0x12')](0x1f4,_0x2ddf60[_0xdab0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index f3cc266..db0c48f 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 _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(_0x77892,_0x5b6471){var _0x2bca29=function(_0x51926e){while(--_0x51926e){_0x77892['push'](_0x77892['shift']());}};_0x2bca29(++_0x5b6471);}(_0xb10b,0x12a));var _0xbb10=function(_0xb77dfe,_0x39c4c7){_0xb77dfe=_0xb77dfe-0x0;var _0x5e4f5d=_0xb10b[_0xb77dfe];return _0x5e4f5d;};'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 +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(_0x27a1cd,_0x2fc468){var _0x529a9c=function(_0x11b7be){while(--_0x11b7be){_0x27a1cd['push'](_0x27a1cd['shift']());}};_0x529a9c(++_0x2fc468);}(_0xb10b,0x12a));var _0xbb10=function(_0x574de7,_0x24ce60){_0x574de7=_0x574de7-0x0;var _0x568f46=_0xb10b[_0x574de7];return _0x568f46;};'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 05e2791..8b45cc3 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 _0x6a25=['STRING','sequelize','exports'];(function(_0x17c24d,_0x378a33){var _0x4b6195=function(_0xe67f8c){while(--_0xe67f8c){_0x17c24d['push'](_0x17c24d['shift']());}};_0x4b6195(++_0x378a33);}(_0x6a25,0x64));var _0x56a2=function(_0x221fb6,_0x342c2f){_0x221fb6=_0x221fb6-0x0;var _0x2531c0=_0x6a25[_0x221fb6];return _0x2531c0;};'use strict';var Sequelize=require(_0x56a2('0x0'));module[_0x56a2('0x1')]={'name':{'type':Sequelize[_0x56a2('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4dba=['STRING','sequelize','exports'];(function(_0x213692,_0x42828a){var _0x5ed887=function(_0x3ca436){while(--_0x3ca436){_0x213692['push'](_0x213692['shift']());}};_0x5ed887(++_0x42828a);}(_0x4dba,0xb5));var _0xa4db=function(_0x3d6969,_0x151484){_0x3d6969=_0x3d6969-0x0;var _0x56132d=_0x4dba[_0x3d6969];return _0x56132d;};'use strict';var Sequelize=require(_0xa4db('0x0'));module[_0xa4db('0x1')]={'name':{'type':Sequelize[_0xa4db('0x2')]},'description':{'type':Sequelize[_0xa4db('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 46a515c..652c18a 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 _0x126e=['sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','client','http','test','then','info','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','update','end','stack','name','index','VtigerConfiguration','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','findAll','rows','catch','show','params','include','create','body','find','destroy','getFields','findOne','where','getSubjects','VtigerField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x52b3c8,_0x4395e4){var _0x12e300=function(_0x18cd63){while(--_0x18cd63){_0x52b3c8['push'](_0x52b3c8['shift']());}};_0x12e300(++_0x4395e4);}(_0x126e,0x108));var _0xe126=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x126e[_0x5c351c];return _0x26f3b3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe126('0x0'));var rimraf=require(_0xe126('0x1'));var zipdir=require(_0xe126('0x2'));var jsonpatch=require(_0xe126('0x3'));var rp=require(_0xe126('0x4'));var moment=require(_0xe126('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe126('0x6'));var util=require(_0xe126('0x7'));var path=require(_0xe126('0x8'));var sox=require(_0xe126('0x9'));var csv=require(_0xe126('0xa'));var ejs=require(_0xe126('0xb'));var fs=require('fs');var _=require(_0xe126('0xc'));var squel=require('squel');var crypto=require(_0xe126('0xd'));var jsforce=require(_0xe126('0xe'));var deskjs=require(_0xe126('0xf'));var toCsv=require(_0xe126('0xa'));var querystring=require(_0xe126('0x10'));var Papa=require('papaparse');var Redis=require(_0xe126('0x11'));var authService=require(_0xe126('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe126('0x13'));var logger=require(_0xe126('0x14'))('api');var utils=require(_0xe126('0x15'));var config=require('../../config/environment');var db=require(_0xe126('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe126('0x17')][_0xe126('0x18')]({'port':0x232a});function checkPasswordPattern(_0x23ff02,_0x38b8c3,_0x197c91){if(_0x197c91){var _0x1a57c4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a57c4[_0xe126('0x19')](_0x38b8c3)){return _0x23ff02;}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 _0x23ff02;}}function respondWithRpcPromise(_0xd55baf,_0x1c02c9,_0x4d335f,_0x2f952f){return new BPromise(function(_0x28d7dd,_0x10bc24){var _0x38b0c0=_0x2f952f||client;return _0x38b0c0['request'](_0xd55baf,_0x4d335f)[_0xe126('0x1a')](function(_0x3a4996){logger[_0xe126('0x1b')]('VtigerConfiguration,\x20%s,\x20%s',_0x1c02c9,_0xe126('0x1c'));logger['debug'](_0xe126('0x1d'),_0x1c02c9,_0xe126('0x1c'),JSON[_0xe126('0x1e')](_0x3a4996));if(_0x3a4996[_0xe126('0x1f')]){if(_0x3a4996[_0xe126('0x1f')][_0xe126('0x20')]===0x1f4){logger[_0xe126('0x1f')](_0xe126('0x21'),_0x1c02c9,_0x3a4996['error'][_0xe126('0x22')]);return _0x10bc24(_0x3a4996[_0xe126('0x1f')][_0xe126('0x22')]);}logger[_0xe126('0x1f')](_0xe126('0x21'),_0x1c02c9,_0x3a4996[_0xe126('0x1f')][_0xe126('0x22')]);return _0x28d7dd(_0x3a4996[_0xe126('0x1f')]['message']);}else{logger['info'](_0xe126('0x21'),_0x1c02c9,_0xe126('0x1c'));_0x28d7dd(_0x3a4996[_0xe126('0x23')]['message']);}})['catch'](function(_0x47f179){logger[_0xe126('0x1f')](_0xe126('0x21'),_0x1c02c9,_0x47f179);_0x10bc24(_0x47f179);});});}function respondWithStatusCode(_0x4b3833,_0x264082){_0x264082=_0x264082||0xcc;return function(_0x2f05ec){if(_0x2f05ec){return _0x4b3833[_0xe126('0x24')](_0x264082);}return _0x4b3833[_0xe126('0x25')](_0x264082)['end']();};}function respondWithResult(_0x49d70d,_0x26482f){_0x26482f=_0x26482f||0xc8;return function(_0x4facea){if(_0x4facea){return _0x49d70d[_0xe126('0x25')](_0x26482f)[_0xe126('0x26')](_0x4facea);}};}function respondWithFilteredResult(_0x630bcc,_0x5b31a4){return function(_0x45f55c){if(_0x45f55c){var _0x449309=_0x45f55c['count'],_0x4f5d09=_0x5b31a4[_0xe126('0x27')],_0x5efeab=_0x5b31a4[_0xe126('0x27')]+_0x5b31a4[_0xe126('0x28')],_0x259059;if(_0x5efeab>=_0x449309){_0x5efeab=_0x449309;_0x259059=0xc8;}else{_0x259059=0xce;}_0x630bcc[_0xe126('0x25')](_0x259059);return _0x630bcc['set'](_0xe126('0x29'),_0x4f5d09+'-'+_0x5efeab+'/'+_0x449309)[_0xe126('0x26')](_0x45f55c);}return null;};}function patchUpdates(_0x5e7bab){return function(_0x4e61a8){try{jsonpatch[_0xe126('0x2a')](_0x4e61a8,_0x5e7bab,!![]);}catch(_0x590d35){return BPromise[_0xe126('0x2b')](_0x590d35);}return _0x4e61a8[_0xe126('0x2c')]();};}function saveUpdates(_0x249e4f,_0x5bdf16){return function(_0x3240ed){if(_0x3240ed){return _0x3240ed[_0xe126('0x2d')](_0x249e4f)[_0xe126('0x1a')](function(_0x5e24e9){return _0x5e24e9;});}return null;};}function removeEntity(_0x1ecbd1,_0x2c1e63){return function(_0x5ee92d){if(_0x5ee92d){return _0x5ee92d['destroy']()[_0xe126('0x1a')](function(){_0x1ecbd1[_0xe126('0x25')](0xcc)[_0xe126('0x2e')]();});}};}function handleEntityNotFound(_0xd3ebfe,_0x33e671){return function(_0x2a5d82){if(!_0x2a5d82){_0xd3ebfe[_0xe126('0x24')](0x194);}return _0x2a5d82;};}function handleError(_0xd03338,_0x577fc6){_0x577fc6=_0x577fc6||0x1f4;return function(_0x427a1e){logger[_0xe126('0x1f')](_0x427a1e[_0xe126('0x2f')]);if(_0x427a1e[_0xe126('0x30')]){delete _0x427a1e[_0xe126('0x30')];}_0xd03338[_0xe126('0x25')](_0x577fc6)['send'](_0x427a1e);};}exports[_0xe126('0x31')]=function(_0x1de471,_0x42874d){var _0x11058a={},_0x32f84b={},_0x5e5cae={'count':0x0,'rows':[]};var _0x29b6e6=db[_0xe126('0x32')][_0xe126('0x33')];_0x32f84b[_0xe126('0x34')]=_['keys'](_0x29b6e6);_0x32f84b[_0xe126('0x35')]=_[_0xe126('0x36')](_0x1de471[_0xe126('0x35')]);_0x32f84b[_0xe126('0x37')]=_[_0xe126('0x38')](_0x32f84b[_0xe126('0x34')],_0x32f84b['query']);_0x11058a[_0xe126('0x39')]=_[_0xe126('0x38')](_0x32f84b[_0xe126('0x34')],qs['fields'](_0x1de471['query'][_0xe126('0x3a')]));_0x11058a[_0xe126('0x39')]=_0x11058a[_0xe126('0x39')][_0xe126('0x3b')]?_0x11058a[_0xe126('0x39')]:_0x32f84b[_0xe126('0x34')];if(!_0x1de471['query'][_0xe126('0x3c')](_0xe126('0x3d'))){_0x11058a['limit']=qs[_0xe126('0x28')](_0x1de471[_0xe126('0x35')][_0xe126('0x28')]);_0x11058a['offset']=qs[_0xe126('0x27')](_0x1de471[_0xe126('0x35')]['offset']);}_0x11058a[_0xe126('0x3e')]=qs[_0xe126('0x3f')](_0x1de471['query'][_0xe126('0x3f')]);_0x11058a['where']=qs[_0xe126('0x37')](_[_0xe126('0x40')](_0x1de471['query'],_0x32f84b[_0xe126('0x37')]));if(_0x1de471[_0xe126('0x35')][_0xe126('0x41')]){_0x11058a['where']=_[_0xe126('0x42')](_0x11058a['where'],{'$or':_[_0xe126('0x43')](_0x29b6e6,function(_0xe8dab9){if(_0xe8dab9[_0xe126('0x44')][_0xe126('0x45')]!==_0xe126('0x46')){var _0x3d76a3={};_0x3d76a3[_0xe8dab9[_0xe126('0x47')]]={'$like':'%'+_0x1de471[_0xe126('0x35')][_0xe126('0x41')]+'%'};return _0x3d76a3;}})});}_0x11058a=_[_0xe126('0x42')]({},_0x11058a,_0x1de471[_0xe126('0x48')]);var _0x5cb62d={'where':_0x11058a['where']};return db[_0xe126('0x32')][_0xe126('0x49')](_0x5cb62d)['then'](function(_0x47217b){_0x5e5cae[_0xe126('0x49')]=_0x47217b;if(_0x1de471[_0xe126('0x35')][_0xe126('0x4a')]){_0x11058a['include']=[{'all':!![]}];}return db[_0xe126('0x32')][_0xe126('0x4b')](_0x11058a);})[_0xe126('0x1a')](function(_0x45ac4a){_0x5e5cae[_0xe126('0x4c')]=_0x45ac4a;return _0x5e5cae;})[_0xe126('0x1a')](respondWithFilteredResult(_0x42874d,_0x11058a))[_0xe126('0x4d')](handleError(_0x42874d,null));};exports[_0xe126('0x4e')]=function(_0x23179a,_0xccc25d){var _0x23007d={'raw':![],'where':{'id':_0x23179a[_0xe126('0x4f')]['id']}},_0x237181={};_0x237181['model']=_['keys'](db['VtigerConfiguration']['rawAttributes']);_0x237181[_0xe126('0x35')]=_[_0xe126('0x36')](_0x23179a[_0xe126('0x35')]);_0x237181[_0xe126('0x37')]=_[_0xe126('0x38')](_0x237181[_0xe126('0x34')],_0x237181[_0xe126('0x35')]);_0x23007d['attributes']=_['intersection'](_0x237181[_0xe126('0x34')],qs[_0xe126('0x3a')](_0x23179a['query'][_0xe126('0x3a')]));_0x23007d[_0xe126('0x39')]=_0x23007d['attributes'][_0xe126('0x3b')]?_0x23007d[_0xe126('0x39')]:_0x237181['model'];if(_0x23179a['query'][_0xe126('0x4a')]){_0x23007d[_0xe126('0x50')]=[{'all':!![]}];}_0x23007d=_[_0xe126('0x42')]({},_0x23007d,_0x23179a['options']);return db[_0xe126('0x32')]['find'](_0x23007d)[_0xe126('0x1a')](handleEntityNotFound(_0xccc25d,null))[_0xe126('0x1a')](respondWithResult(_0xccc25d,null))['catch'](handleError(_0xccc25d,null));};exports[_0xe126('0x51')]=function(_0x376600,_0x502199){return db['VtigerConfiguration']['create'](_0x376600[_0xe126('0x52')],{})[_0xe126('0x1a')](respondWithResult(_0x502199,0xc9))[_0xe126('0x4d')](handleError(_0x502199,null));};exports[_0xe126('0x2d')]=function(_0x5f1df6,_0x1a5e94){if(_0x5f1df6[_0xe126('0x52')]['id']){delete _0x5f1df6[_0xe126('0x52')]['id'];}return db[_0xe126('0x32')][_0xe126('0x53')]({'where':{'id':_0x5f1df6[_0xe126('0x4f')]['id']}})[_0xe126('0x1a')](handleEntityNotFound(_0x1a5e94,null))[_0xe126('0x1a')](saveUpdates(_0x5f1df6[_0xe126('0x52')],null))[_0xe126('0x1a')](respondWithResult(_0x1a5e94,null))[_0xe126('0x4d')](handleError(_0x1a5e94,null));};exports[_0xe126('0x54')]=function(_0x1357d2,_0x2cfa0b){return db[_0xe126('0x32')][_0xe126('0x53')]({'where':{'id':_0x1357d2[_0xe126('0x4f')]['id']}})[_0xe126('0x1a')](handleEntityNotFound(_0x2cfa0b,null))[_0xe126('0x1a')](removeEntity(_0x2cfa0b,null))[_0xe126('0x4d')](handleError(_0x2cfa0b,null));};exports[_0xe126('0x55')]=function(_0xb8493c,_0x78747e,_0x100e7f){var _0x2b5095={};var _0x3e128d={};var _0x4180a6;var _0x4f9db8;return db[_0xe126('0x32')][_0xe126('0x56')]({'where':{'id':_0xb8493c[_0xe126('0x4f')]['id']}})[_0xe126('0x1a')](handleEntityNotFound(_0x78747e,null))[_0xe126('0x1a')](function(_0x541d1a){if(_0x541d1a){_0x4180a6=_0x541d1a;_0x3e128d[_0xe126('0x34')]=_[_0xe126('0x36')](db['VtigerField'][_0xe126('0x33')]);_0x3e128d[_0xe126('0x35')]=_['keys'](_0xb8493c[_0xe126('0x35')]);_0x3e128d[_0xe126('0x37')]=_[_0xe126('0x38')](_0x3e128d[_0xe126('0x34')],_0x3e128d[_0xe126('0x35')]);_0x2b5095[_0xe126('0x39')]=_[_0xe126('0x38')](_0x3e128d['model'],qs[_0xe126('0x3a')](_0xb8493c[_0xe126('0x35')]['fields']));_0x2b5095[_0xe126('0x39')]=_0x2b5095[_0xe126('0x39')][_0xe126('0x3b')]?_0x2b5095['attributes']:_0x3e128d[_0xe126('0x34')];_0x2b5095[_0xe126('0x3e')]=qs[_0xe126('0x3f')](_0xb8493c[_0xe126('0x35')][_0xe126('0x3f')]);_0x2b5095[_0xe126('0x57')]=qs[_0xe126('0x37')](_[_0xe126('0x40')](_0xb8493c[_0xe126('0x35')],_0x3e128d[_0xe126('0x37')]));if(_0xb8493c[_0xe126('0x35')][_0xe126('0x41')]){_0x2b5095[_0xe126('0x57')]=_[_0xe126('0x42')](_0x2b5095[_0xe126('0x57')],{'$or':_[_0xe126('0x43')](_0x2b5095[_0xe126('0x39')],function(_0x339b2f){var _0x33073d={};_0x33073d[_0x339b2f]={'$like':'%'+_0xb8493c[_0xe126('0x35')][_0xe126('0x41')]+'%'};return _0x33073d;})});}_0x2b5095=_[_0xe126('0x42')]({},_0x2b5095,_0xb8493c['options']);return _0x4180a6[_0xe126('0x55')](_0x2b5095);}})[_0xe126('0x1a')](function(_0xc00fac){if(_0xc00fac){_0x4f9db8=_0xc00fac[_0xe126('0x3b')];if(!_0xb8493c[_0xe126('0x35')][_0xe126('0x3c')](_0xe126('0x3d'))){_0x2b5095[_0xe126('0x28')]=qs[_0xe126('0x28')](_0xb8493c[_0xe126('0x35')]['limit']);_0x2b5095[_0xe126('0x27')]=qs[_0xe126('0x27')](_0xb8493c[_0xe126('0x35')][_0xe126('0x27')]);}return _0x4180a6[_0xe126('0x55')](_0x2b5095);}})[_0xe126('0x1a')](function(_0x13e742){if(_0x13e742){return _0x13e742?{'count':_0x4f9db8,'rows':_0x13e742}:null;}})[_0xe126('0x1a')](respondWithResult(_0x78747e,null))[_0xe126('0x4d')](handleError(_0x78747e,null));};exports[_0xe126('0x58')]=function(_0x18ae9b,_0xa0e0b3,_0x3426ae){var _0xff474f={};var _0x354da2={};var _0x250502;var _0x900d93;return db[_0xe126('0x32')][_0xe126('0x56')]({'where':{'id':_0x18ae9b[_0xe126('0x4f')]['id']}})[_0xe126('0x1a')](handleEntityNotFound(_0xa0e0b3,null))[_0xe126('0x1a')](function(_0x3369c1){if(_0x3369c1){_0x250502=_0x3369c1;_0x354da2[_0xe126('0x34')]=_['keys'](db[_0xe126('0x59')]['rawAttributes']);_0x354da2[_0xe126('0x35')]=_[_0xe126('0x36')](_0x18ae9b[_0xe126('0x35')]);_0x354da2[_0xe126('0x37')]=_[_0xe126('0x38')](_0x354da2[_0xe126('0x34')],_0x354da2['query']);_0xff474f[_0xe126('0x39')]=_['intersection'](_0x354da2[_0xe126('0x34')],qs[_0xe126('0x3a')](_0x18ae9b[_0xe126('0x35')]['fields']));_0xff474f[_0xe126('0x39')]=_0xff474f[_0xe126('0x39')][_0xe126('0x3b')]?_0xff474f[_0xe126('0x39')]:_0x354da2[_0xe126('0x34')];_0xff474f[_0xe126('0x3e')]=qs['sort'](_0x18ae9b[_0xe126('0x35')]['sort']);_0xff474f['where']=qs['filters'](_[_0xe126('0x40')](_0x18ae9b[_0xe126('0x35')],_0x354da2['filters']));if(_0x18ae9b[_0xe126('0x35')][_0xe126('0x41')]){_0xff474f[_0xe126('0x57')]=_[_0xe126('0x42')](_0xff474f['where'],{'$or':_[_0xe126('0x43')](_0xff474f[_0xe126('0x39')],function(_0x395d88){var _0x347491={};_0x347491[_0x395d88]={'$like':'%'+_0x18ae9b[_0xe126('0x35')][_0xe126('0x41')]+'%'};return _0x347491;})});}_0xff474f=_[_0xe126('0x42')]({},_0xff474f,_0x18ae9b[_0xe126('0x48')]);return _0x250502[_0xe126('0x58')](_0xff474f);}})['then'](function(_0x1f3ffb){if(_0x1f3ffb){_0x900d93=_0x1f3ffb[_0xe126('0x3b')];if(!_0x18ae9b['query'][_0xe126('0x3c')](_0xe126('0x3d'))){_0xff474f[_0xe126('0x28')]=qs[_0xe126('0x28')](_0x18ae9b[_0xe126('0x35')][_0xe126('0x28')]);_0xff474f[_0xe126('0x27')]=qs[_0xe126('0x27')](_0x18ae9b[_0xe126('0x35')][_0xe126('0x27')]);}return _0x250502[_0xe126('0x58')](_0xff474f);}})['then'](function(_0x1fde6a){if(_0x1fde6a){return _0x1fde6a?{'count':_0x900d93,'rows':_0x1fde6a}:null;}})[_0xe126('0x1a')](respondWithResult(_0xa0e0b3,null))['catch'](handleError(_0xa0e0b3,null));};exports[_0xe126('0x5a')]=function(_0x12d7f8,_0x45d7ce,_0x5a16a1){var _0x3533b0={};var _0x53316f={};var _0x5cb6f7;var _0x25e22b;return db[_0xe126('0x32')]['findOne']({'where':{'id':_0x12d7f8[_0xe126('0x4f')]['id']}})[_0xe126('0x1a')](handleEntityNotFound(_0x45d7ce,null))['then'](function(_0x3b6081){if(_0x3b6081){_0x5cb6f7=_0x3b6081;_0x53316f[_0xe126('0x34')]=_[_0xe126('0x36')](db['VtigerField'][_0xe126('0x33')]);_0x53316f[_0xe126('0x35')]=_['keys'](_0x12d7f8[_0xe126('0x35')]);_0x53316f[_0xe126('0x37')]=_['intersection'](_0x53316f[_0xe126('0x34')],_0x53316f[_0xe126('0x35')]);_0x3533b0[_0xe126('0x39')]=_['intersection'](_0x53316f['model'],qs[_0xe126('0x3a')](_0x12d7f8[_0xe126('0x35')]['fields']));_0x3533b0[_0xe126('0x39')]=_0x3533b0[_0xe126('0x39')][_0xe126('0x3b')]?_0x3533b0[_0xe126('0x39')]:_0x53316f['model'];_0x3533b0[_0xe126('0x3e')]=qs[_0xe126('0x3f')](_0x12d7f8[_0xe126('0x35')][_0xe126('0x3f')]);_0x3533b0['where']=qs[_0xe126('0x37')](_[_0xe126('0x40')](_0x12d7f8[_0xe126('0x35')],_0x53316f[_0xe126('0x37')]));if(_0x12d7f8[_0xe126('0x35')][_0xe126('0x41')]){_0x3533b0[_0xe126('0x57')]=_[_0xe126('0x42')](_0x3533b0[_0xe126('0x57')],{'$or':_['map'](_0x3533b0['attributes'],function(_0xa5fe06){var _0x1baa43={};_0x1baa43[_0xa5fe06]={'$like':'%'+_0x12d7f8[_0xe126('0x35')]['filter']+'%'};return _0x1baa43;})});}_0x3533b0=_['merge']({},_0x3533b0,_0x12d7f8['options']);return _0x5cb6f7[_0xe126('0x5a')](_0x3533b0);}})[_0xe126('0x1a')](function(_0x3cbd56){if(_0x3cbd56){_0x25e22b=_0x3cbd56[_0xe126('0x3b')];if(!_0x12d7f8[_0xe126('0x35')][_0xe126('0x3c')](_0xe126('0x3d'))){_0x3533b0['limit']=qs[_0xe126('0x28')](_0x12d7f8[_0xe126('0x35')]['limit']);_0x3533b0[_0xe126('0x27')]=qs[_0xe126('0x27')](_0x12d7f8[_0xe126('0x35')]['offset']);}return _0x5cb6f7['getDescriptions'](_0x3533b0);}})[_0xe126('0x1a')](function(_0x34d6a8){if(_0x34d6a8){return _0x34d6a8?{'count':_0x25e22b,'rows':_0x34d6a8}:null;}})[_0xe126('0x1a')](respondWithResult(_0x45d7ce,null))[_0xe126('0x4d')](handleError(_0x45d7ce,null));}; \ No newline at end of file +var _0x7d9f=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../mysqldb','jayson/promise','client','http','test','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','count','offset','limit','set','Content-Range','reject','destroy','then','end','stack','name','send','index','VtigerConfiguration','rawAttributes','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','field','filter','options','includeAll','include','rows','show','params','keys','length','find','create','body','update','getFields','findOne','VtigerField','map','nolimit','getSubjects','getDescriptions'];(function(_0x4c4101,_0x45a4ab){var _0x37a7f9=function(_0x35299d){while(--_0x35299d){_0x4c4101['push'](_0x4c4101['shift']());}};_0x37a7f9(++_0x45a4ab);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x40e1ed,_0x297e89){_0x40e1ed=_0x40e1ed-0x0;var _0x220ddd=_0x7d9f[_0x40e1ed];return _0x220ddd;};'use strict';var pdf=require(_0xf7d9('0x0'));var emlformat=require(_0xf7d9('0x1'));var rimraf=require(_0xf7d9('0x2'));var zipdir=require(_0xf7d9('0x3'));var jsonpatch=require(_0xf7d9('0x4'));var rp=require('request-promise');var moment=require(_0xf7d9('0x5'));var BPromise=require(_0xf7d9('0x6'));var Mustache=require(_0xf7d9('0x7'));var util=require(_0xf7d9('0x8'));var path=require(_0xf7d9('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf7d9('0xa'));var fs=require('fs');var _=require(_0xf7d9('0xb'));var squel=require('squel');var crypto=require(_0xf7d9('0xc'));var jsforce=require(_0xf7d9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf7d9('0xe'));var querystring=require('querystring');var Papa=require(_0xf7d9('0xf'));var Redis=require(_0xf7d9('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf7d9('0x11'));var logger=require(_0xf7d9('0x12'))(_0xf7d9('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf7d9('0x14'))['db'];var jayson=require(_0xf7d9('0x15'));var client=jayson[_0xf7d9('0x16')][_0xf7d9('0x17')]({'port':0x232a});function checkPasswordPattern(_0x594dfe,_0x16e680,_0xb9e0b7){if(_0xb9e0b7){var _0x22787d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x22787d[_0xf7d9('0x18')](_0x16e680)){return _0x594dfe;}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 _0x594dfe;}}function respondWithRpcPromise(_0x189c82,_0x359843,_0x296348,_0x18b119){return new BPromise(function(_0x5d3029,_0x405ed4){var _0x22ed4a=_0x18b119||client;return _0x22ed4a[_0xf7d9('0x19')](_0x189c82,_0x296348)['then'](function(_0x539ea7){logger[_0xf7d9('0x1a')](_0xf7d9('0x1b'),_0x359843,_0xf7d9('0x1c'));logger['debug'](_0xf7d9('0x1d'),_0x359843,_0xf7d9('0x1c'),JSON['stringify'](_0x539ea7));if(_0x539ea7[_0xf7d9('0x1e')]){if(_0x539ea7['error'][_0xf7d9('0x1f')]===0x1f4){logger[_0xf7d9('0x1e')]('VtigerConfiguration,\x20%s,\x20%s',_0x359843,_0x539ea7[_0xf7d9('0x1e')][_0xf7d9('0x20')]);return _0x405ed4(_0x539ea7[_0xf7d9('0x1e')][_0xf7d9('0x20')]);}logger[_0xf7d9('0x1e')](_0xf7d9('0x1b'),_0x359843,_0x539ea7[_0xf7d9('0x1e')][_0xf7d9('0x20')]);return _0x5d3029(_0x539ea7['error']['message']);}else{logger[_0xf7d9('0x1a')]('VtigerConfiguration,\x20%s,\x20%s',_0x359843,_0xf7d9('0x1c'));_0x5d3029(_0x539ea7[_0xf7d9('0x21')]['message']);}})[_0xf7d9('0x22')](function(_0x27ba8c){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x359843,_0x27ba8c);_0x405ed4(_0x27ba8c);});});}function respondWithStatusCode(_0x19d595,_0x2d6ad6){_0x2d6ad6=_0x2d6ad6||0xcc;return function(_0x3bf24f){if(_0x3bf24f){return _0x19d595['sendStatus'](_0x2d6ad6);}return _0x19d595[_0xf7d9('0x23')](_0x2d6ad6)['end']();};}function respondWithResult(_0x1bcaf1,_0x3b3ea5){_0x3b3ea5=_0x3b3ea5||0xc8;return function(_0x144ae2){if(_0x144ae2){return _0x1bcaf1['status'](_0x3b3ea5)[_0xf7d9('0x24')](_0x144ae2);}};}function respondWithFilteredResult(_0x3218bb,_0x2e52){return function(_0xf9373a){if(_0xf9373a){var _0x1a9d8b=_0xf9373a[_0xf7d9('0x25')],_0x540086=_0x2e52[_0xf7d9('0x26')],_0x313ca8=_0x2e52['offset']+_0x2e52[_0xf7d9('0x27')],_0x3847ff;if(_0x313ca8>=_0x1a9d8b){_0x313ca8=_0x1a9d8b;_0x3847ff=0xc8;}else{_0x3847ff=0xce;}_0x3218bb[_0xf7d9('0x23')](_0x3847ff);return _0x3218bb[_0xf7d9('0x28')](_0xf7d9('0x29'),_0x540086+'-'+_0x313ca8+'/'+_0x1a9d8b)[_0xf7d9('0x24')](_0xf9373a);}return null;};}function patchUpdates(_0x16318f){return function(_0x5ea74d){try{jsonpatch['apply'](_0x5ea74d,_0x16318f,!![]);}catch(_0x5a673a){return BPromise[_0xf7d9('0x2a')](_0x5a673a);}return _0x5ea74d['save']();};}function saveUpdates(_0x38efd9,_0x48c13c){return function(_0x3ecbb9){if(_0x3ecbb9){return _0x3ecbb9['update'](_0x38efd9)['then'](function(_0x51d2bd){return _0x51d2bd;});}return null;};}function removeEntity(_0x14ec19,_0x48295a){return function(_0x311a9e){if(_0x311a9e){return _0x311a9e[_0xf7d9('0x2b')]()[_0xf7d9('0x2c')](function(){_0x14ec19[_0xf7d9('0x23')](0xcc)[_0xf7d9('0x2d')]();});}};}function handleEntityNotFound(_0x86a7a1,_0x22db91){return function(_0x4225b5){if(!_0x4225b5){_0x86a7a1['sendStatus'](0x194);}return _0x4225b5;};}function handleError(_0x200d72,_0x3ee156){_0x3ee156=_0x3ee156||0x1f4;return function(_0x4a09fc){logger['error'](_0x4a09fc[_0xf7d9('0x2e')]);if(_0x4a09fc[_0xf7d9('0x2f')]){delete _0x4a09fc[_0xf7d9('0x2f')];}_0x200d72['status'](_0x3ee156)[_0xf7d9('0x30')](_0x4a09fc);};}exports[_0xf7d9('0x31')]=function(_0x40e6f7,_0x1be610){var _0x1f5587={},_0xa74e15={},_0x427963={'count':0x0,'rows':[]};var _0x1280fa=db[_0xf7d9('0x32')][_0xf7d9('0x33')];_0xa74e15[_0xf7d9('0x34')]=_['keys'](_0x1280fa);_0xa74e15[_0xf7d9('0x35')]=_['keys'](_0x40e6f7[_0xf7d9('0x35')]);_0xa74e15[_0xf7d9('0x36')]=_[_0xf7d9('0x37')](_0xa74e15[_0xf7d9('0x34')],_0xa74e15['query']);_0x1f5587['attributes']=_[_0xf7d9('0x37')](_0xa74e15['model'],qs[_0xf7d9('0x38')](_0x40e6f7[_0xf7d9('0x35')][_0xf7d9('0x38')]));_0x1f5587[_0xf7d9('0x39')]=_0x1f5587['attributes']['length']?_0x1f5587[_0xf7d9('0x39')]:_0xa74e15[_0xf7d9('0x34')];if(!_0x40e6f7[_0xf7d9('0x35')][_0xf7d9('0x3a')]('nolimit')){_0x1f5587[_0xf7d9('0x27')]=qs[_0xf7d9('0x27')](_0x40e6f7[_0xf7d9('0x35')][_0xf7d9('0x27')]);_0x1f5587[_0xf7d9('0x26')]=qs['offset'](_0x40e6f7[_0xf7d9('0x35')][_0xf7d9('0x26')]);}_0x1f5587[_0xf7d9('0x3b')]=qs[_0xf7d9('0x3c')](_0x40e6f7[_0xf7d9('0x35')][_0xf7d9('0x3c')]);_0x1f5587[_0xf7d9('0x3d')]=qs[_0xf7d9('0x36')](_[_0xf7d9('0x3e')](_0x40e6f7[_0xf7d9('0x35')],_0xa74e15[_0xf7d9('0x36')]));if(_0x40e6f7[_0xf7d9('0x35')]['filter']){_0x1f5587[_0xf7d9('0x3d')]=_[_0xf7d9('0x3f')](_0x1f5587['where'],{'$or':_['map'](_0x1280fa,function(_0x5efe10){if(_0x5efe10[_0xf7d9('0x40')]['key']!==_0xf7d9('0x41')){var _0x3f00df={};_0x3f00df[_0x5efe10[_0xf7d9('0x42')]]={'$like':'%'+_0x40e6f7[_0xf7d9('0x35')][_0xf7d9('0x43')]+'%'};return _0x3f00df;}})});}_0x1f5587=_['merge']({},_0x1f5587,_0x40e6f7[_0xf7d9('0x44')]);var _0x3ba2f8={'where':_0x1f5587[_0xf7d9('0x3d')]};return db[_0xf7d9('0x32')][_0xf7d9('0x25')](_0x3ba2f8)['then'](function(_0x556f7e){_0x427963[_0xf7d9('0x25')]=_0x556f7e;if(_0x40e6f7[_0xf7d9('0x35')][_0xf7d9('0x45')]){_0x1f5587[_0xf7d9('0x46')]=[{'all':!![]}];}return db[_0xf7d9('0x32')]['findAll'](_0x1f5587);})[_0xf7d9('0x2c')](function(_0x48a579){_0x427963[_0xf7d9('0x47')]=_0x48a579;return _0x427963;})[_0xf7d9('0x2c')](respondWithFilteredResult(_0x1be610,_0x1f5587))[_0xf7d9('0x22')](handleError(_0x1be610,null));};exports[_0xf7d9('0x48')]=function(_0x1417ac,_0x1e3a53){var _0x4003e9={'raw':![],'where':{'id':_0x1417ac[_0xf7d9('0x49')]['id']}},_0x3087d8={};_0x3087d8[_0xf7d9('0x34')]=_[_0xf7d9('0x4a')](db[_0xf7d9('0x32')][_0xf7d9('0x33')]);_0x3087d8[_0xf7d9('0x35')]=_['keys'](_0x1417ac[_0xf7d9('0x35')]);_0x3087d8[_0xf7d9('0x36')]=_['intersection'](_0x3087d8['model'],_0x3087d8[_0xf7d9('0x35')]);_0x4003e9['attributes']=_['intersection'](_0x3087d8[_0xf7d9('0x34')],qs[_0xf7d9('0x38')](_0x1417ac[_0xf7d9('0x35')][_0xf7d9('0x38')]));_0x4003e9[_0xf7d9('0x39')]=_0x4003e9[_0xf7d9('0x39')][_0xf7d9('0x4b')]?_0x4003e9[_0xf7d9('0x39')]:_0x3087d8[_0xf7d9('0x34')];if(_0x1417ac[_0xf7d9('0x35')][_0xf7d9('0x45')]){_0x4003e9[_0xf7d9('0x46')]=[{'all':!![]}];}_0x4003e9=_['merge']({},_0x4003e9,_0x1417ac['options']);return db[_0xf7d9('0x32')][_0xf7d9('0x4c')](_0x4003e9)[_0xf7d9('0x2c')](handleEntityNotFound(_0x1e3a53,null))[_0xf7d9('0x2c')](respondWithResult(_0x1e3a53,null))['catch'](handleError(_0x1e3a53,null));};exports[_0xf7d9('0x4d')]=function(_0x51129e,_0x46f5ad){return db[_0xf7d9('0x32')][_0xf7d9('0x4d')](_0x51129e[_0xf7d9('0x4e')],{})[_0xf7d9('0x2c')](respondWithResult(_0x46f5ad,0xc9))[_0xf7d9('0x22')](handleError(_0x46f5ad,null));};exports[_0xf7d9('0x4f')]=function(_0xb856f,_0x444222){if(_0xb856f['body']['id']){delete _0xb856f[_0xf7d9('0x4e')]['id'];}return db[_0xf7d9('0x32')][_0xf7d9('0x4c')]({'where':{'id':_0xb856f[_0xf7d9('0x49')]['id']}})[_0xf7d9('0x2c')](handleEntityNotFound(_0x444222,null))[_0xf7d9('0x2c')](saveUpdates(_0xb856f['body'],null))[_0xf7d9('0x2c')](respondWithResult(_0x444222,null))[_0xf7d9('0x22')](handleError(_0x444222,null));};exports[_0xf7d9('0x2b')]=function(_0x3d839d,_0x20ecc1){return db['VtigerConfiguration'][_0xf7d9('0x4c')]({'where':{'id':_0x3d839d[_0xf7d9('0x49')]['id']}})[_0xf7d9('0x2c')](handleEntityNotFound(_0x20ecc1,null))[_0xf7d9('0x2c')](removeEntity(_0x20ecc1,null))[_0xf7d9('0x22')](handleError(_0x20ecc1,null));};exports[_0xf7d9('0x50')]=function(_0x471b5b,_0x45a7dd,_0x3189f0){var _0x1dba54={};var _0x3b94a8={};var _0x1e98fb;var _0x1f763e;return db[_0xf7d9('0x32')][_0xf7d9('0x51')]({'where':{'id':_0x471b5b[_0xf7d9('0x49')]['id']}})['then'](handleEntityNotFound(_0x45a7dd,null))[_0xf7d9('0x2c')](function(_0x37704c){if(_0x37704c){_0x1e98fb=_0x37704c;_0x3b94a8['model']=_[_0xf7d9('0x4a')](db[_0xf7d9('0x52')][_0xf7d9('0x33')]);_0x3b94a8[_0xf7d9('0x35')]=_[_0xf7d9('0x4a')](_0x471b5b['query']);_0x3b94a8[_0xf7d9('0x36')]=_[_0xf7d9('0x37')](_0x3b94a8['model'],_0x3b94a8[_0xf7d9('0x35')]);_0x1dba54[_0xf7d9('0x39')]=_['intersection'](_0x3b94a8[_0xf7d9('0x34')],qs[_0xf7d9('0x38')](_0x471b5b[_0xf7d9('0x35')]['fields']));_0x1dba54['attributes']=_0x1dba54['attributes'][_0xf7d9('0x4b')]?_0x1dba54['attributes']:_0x3b94a8[_0xf7d9('0x34')];_0x1dba54['order']=qs['sort'](_0x471b5b[_0xf7d9('0x35')][_0xf7d9('0x3c')]);_0x1dba54[_0xf7d9('0x3d')]=qs[_0xf7d9('0x36')](_[_0xf7d9('0x3e')](_0x471b5b[_0xf7d9('0x35')],_0x3b94a8['filters']));if(_0x471b5b[_0xf7d9('0x35')]['filter']){_0x1dba54[_0xf7d9('0x3d')]=_[_0xf7d9('0x3f')](_0x1dba54[_0xf7d9('0x3d')],{'$or':_[_0xf7d9('0x53')](_0x1dba54[_0xf7d9('0x39')],function(_0xe43172){var _0x1088d5={};_0x1088d5[_0xe43172]={'$like':'%'+_0x471b5b['query']['filter']+'%'};return _0x1088d5;})});}_0x1dba54=_[_0xf7d9('0x3f')]({},_0x1dba54,_0x471b5b[_0xf7d9('0x44')]);return _0x1e98fb['getFields'](_0x1dba54);}})[_0xf7d9('0x2c')](function(_0x267c6e){if(_0x267c6e){_0x1f763e=_0x267c6e['length'];if(!_0x471b5b[_0xf7d9('0x35')][_0xf7d9('0x3a')](_0xf7d9('0x54'))){_0x1dba54[_0xf7d9('0x27')]=qs[_0xf7d9('0x27')](_0x471b5b[_0xf7d9('0x35')]['limit']);_0x1dba54[_0xf7d9('0x26')]=qs[_0xf7d9('0x26')](_0x471b5b['query'][_0xf7d9('0x26')]);}return _0x1e98fb['getFields'](_0x1dba54);}})[_0xf7d9('0x2c')](function(_0xa4181c){if(_0xa4181c){return _0xa4181c?{'count':_0x1f763e,'rows':_0xa4181c}:null;}})['then'](respondWithResult(_0x45a7dd,null))['catch'](handleError(_0x45a7dd,null));};exports[_0xf7d9('0x55')]=function(_0x19496d,_0x128ce2,_0x1e56f4){var _0x483a7a={};var _0x35320c={};var _0x120ec9;var _0x27b983;return db[_0xf7d9('0x32')][_0xf7d9('0x51')]({'where':{'id':_0x19496d[_0xf7d9('0x49')]['id']}})[_0xf7d9('0x2c')](handleEntityNotFound(_0x128ce2,null))[_0xf7d9('0x2c')](function(_0x1730de){if(_0x1730de){_0x120ec9=_0x1730de;_0x35320c[_0xf7d9('0x34')]=_[_0xf7d9('0x4a')](db[_0xf7d9('0x52')]['rawAttributes']);_0x35320c[_0xf7d9('0x35')]=_[_0xf7d9('0x4a')](_0x19496d[_0xf7d9('0x35')]);_0x35320c['filters']=_[_0xf7d9('0x37')](_0x35320c[_0xf7d9('0x34')],_0x35320c[_0xf7d9('0x35')]);_0x483a7a[_0xf7d9('0x39')]=_[_0xf7d9('0x37')](_0x35320c[_0xf7d9('0x34')],qs[_0xf7d9('0x38')](_0x19496d[_0xf7d9('0x35')][_0xf7d9('0x38')]));_0x483a7a[_0xf7d9('0x39')]=_0x483a7a['attributes'][_0xf7d9('0x4b')]?_0x483a7a[_0xf7d9('0x39')]:_0x35320c[_0xf7d9('0x34')];_0x483a7a[_0xf7d9('0x3b')]=qs[_0xf7d9('0x3c')](_0x19496d[_0xf7d9('0x35')][_0xf7d9('0x3c')]);_0x483a7a['where']=qs[_0xf7d9('0x36')](_['pick'](_0x19496d['query'],_0x35320c[_0xf7d9('0x36')]));if(_0x19496d[_0xf7d9('0x35')][_0xf7d9('0x43')]){_0x483a7a[_0xf7d9('0x3d')]=_[_0xf7d9('0x3f')](_0x483a7a[_0xf7d9('0x3d')],{'$or':_[_0xf7d9('0x53')](_0x483a7a[_0xf7d9('0x39')],function(_0xa2e625){var _0x506804={};_0x506804[_0xa2e625]={'$like':'%'+_0x19496d[_0xf7d9('0x35')][_0xf7d9('0x43')]+'%'};return _0x506804;})});}_0x483a7a=_['merge']({},_0x483a7a,_0x19496d['options']);return _0x120ec9['getSubjects'](_0x483a7a);}})['then'](function(_0x4dadb2){if(_0x4dadb2){_0x27b983=_0x4dadb2[_0xf7d9('0x4b')];if(!_0x19496d[_0xf7d9('0x35')]['hasOwnProperty'](_0xf7d9('0x54'))){_0x483a7a['limit']=qs[_0xf7d9('0x27')](_0x19496d['query'][_0xf7d9('0x27')]);_0x483a7a['offset']=qs[_0xf7d9('0x26')](_0x19496d['query'][_0xf7d9('0x26')]);}return _0x120ec9[_0xf7d9('0x55')](_0x483a7a);}})[_0xf7d9('0x2c')](function(_0x16b441){if(_0x16b441){return _0x16b441?{'count':_0x27b983,'rows':_0x16b441}:null;}})[_0xf7d9('0x2c')](respondWithResult(_0x128ce2,null))['catch'](handleError(_0x128ce2,null));};exports[_0xf7d9('0x56')]=function(_0x5708f3,_0x4f9e50,_0x7510aa){var _0x52673b={};var _0x150d8a={};var _0x50ec3c;var _0x488e;return db[_0xf7d9('0x32')][_0xf7d9('0x51')]({'where':{'id':_0x5708f3['params']['id']}})[_0xf7d9('0x2c')](handleEntityNotFound(_0x4f9e50,null))['then'](function(_0x4b45bd){if(_0x4b45bd){_0x50ec3c=_0x4b45bd;_0x150d8a[_0xf7d9('0x34')]=_['keys'](db[_0xf7d9('0x52')]['rawAttributes']);_0x150d8a[_0xf7d9('0x35')]=_[_0xf7d9('0x4a')](_0x5708f3[_0xf7d9('0x35')]);_0x150d8a[_0xf7d9('0x36')]=_[_0xf7d9('0x37')](_0x150d8a[_0xf7d9('0x34')],_0x150d8a[_0xf7d9('0x35')]);_0x52673b[_0xf7d9('0x39')]=_['intersection'](_0x150d8a[_0xf7d9('0x34')],qs[_0xf7d9('0x38')](_0x5708f3['query'][_0xf7d9('0x38')]));_0x52673b['attributes']=_0x52673b['attributes'][_0xf7d9('0x4b')]?_0x52673b[_0xf7d9('0x39')]:_0x150d8a['model'];_0x52673b[_0xf7d9('0x3b')]=qs[_0xf7d9('0x3c')](_0x5708f3[_0xf7d9('0x35')][_0xf7d9('0x3c')]);_0x52673b[_0xf7d9('0x3d')]=qs[_0xf7d9('0x36')](_[_0xf7d9('0x3e')](_0x5708f3[_0xf7d9('0x35')],_0x150d8a[_0xf7d9('0x36')]));if(_0x5708f3[_0xf7d9('0x35')][_0xf7d9('0x43')]){_0x52673b[_0xf7d9('0x3d')]=_[_0xf7d9('0x3f')](_0x52673b[_0xf7d9('0x3d')],{'$or':_[_0xf7d9('0x53')](_0x52673b[_0xf7d9('0x39')],function(_0x2dc1c0){var _0x4f0467={};_0x4f0467[_0x2dc1c0]={'$like':'%'+_0x5708f3[_0xf7d9('0x35')][_0xf7d9('0x43')]+'%'};return _0x4f0467;})});}_0x52673b=_[_0xf7d9('0x3f')]({},_0x52673b,_0x5708f3[_0xf7d9('0x44')]);return _0x50ec3c[_0xf7d9('0x56')](_0x52673b);}})[_0xf7d9('0x2c')](function(_0x36931b){if(_0x36931b){_0x488e=_0x36931b['length'];if(!_0x5708f3[_0xf7d9('0x35')][_0xf7d9('0x3a')](_0xf7d9('0x54'))){_0x52673b[_0xf7d9('0x27')]=qs[_0xf7d9('0x27')](_0x5708f3['query'][_0xf7d9('0x27')]);_0x52673b[_0xf7d9('0x26')]=qs['offset'](_0x5708f3[_0xf7d9('0x35')][_0xf7d9('0x26')]);}return _0x50ec3c[_0xf7d9('0x56')](_0x52673b);}})['then'](function(_0x40a000){if(_0x40a000){return _0x40a000?{'count':_0x488e,'rows':_0x40a000}:null;}})[_0xf7d9('0x2c')](respondWithResult(_0x4f9e50,null))[_0xf7d9('0x22')](handleError(_0x4f9e50,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index cc6083f..2cd420f 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 _0x16dc=['moment','bluebird','request-promise','path','../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api'];(function(_0x4f1da5,_0x4ced17){var _0xe972a8=function(_0x278ba3){while(--_0x278ba3){_0x4f1da5['push'](_0x4f1da5['shift']());}};_0xe972a8(++_0x4ced17);}(_0x16dc,0x7e));var _0xc16d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16dc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc16d('0x0'));var util=require(_0xc16d('0x1'));var logger=require(_0xc16d('0x2'))(_0xc16d('0x3'));var moment=require(_0xc16d('0x4'));var BPromise=require(_0xc16d('0x5'));var rp=require(_0xc16d('0x6'));var fs=require('fs');var path=require(_0xc16d('0x7'));var rimraf=require('rimraf');var config=require(_0xc16d('0x8'));var attributes=require(_0xc16d('0x9'));module['exports']=function(_0x23398c,_0xbb9b7b){return _0x23398c[_0xc16d('0xa')](_0xc16d('0xb'),attributes,{'tableName':_0xc16d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14e7=['./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3b4493,_0x106e71){var _0x28fc72=function(_0x1c6ec5){while(--_0x1c6ec5){_0x3b4493['push'](_0x3b4493['shift']());}};_0x28fc72(++_0x106e71);}(_0x14e7,0x7d));var _0x714e=function(_0x87dc56,_0x44ece4){_0x87dc56=_0x87dc56-0x0;var _0x3d17a4=_0x14e7[_0x87dc56];return _0x3d17a4;};'use strict';var _=require(_0x714e('0x0'));var util=require(_0x714e('0x1'));var logger=require(_0x714e('0x2'))(_0x714e('0x3'));var moment=require(_0x714e('0x4'));var BPromise=require(_0x714e('0x5'));var rp=require(_0x714e('0x6'));var fs=require('fs');var path=require(_0x714e('0x7'));var rimraf=require(_0x714e('0x8'));var config=require(_0x714e('0x9'));var attributes=require(_0x714e('0xa'));module[_0x714e('0xb')]=function(_0x57ccab,_0xb58523){return _0x57ccab[_0x714e('0xc')](_0x714e('0xd'),attributes,{'tableName':_0x714e('0xe'),'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 2aff6cf..dea8a6e 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 _0xd16c=['stringify','error','code','message','info','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd16c,0x141));var _0xcd16=function(_0x4423b,_0x37ba70){_0x4423b=_0x4423b-0x0;var _0x5df2a9=_0xd16c[_0x4423b];return _0x5df2a9;};'use strict';var _=require(_0xcd16('0x0'));var util=require('util');var moment=require(_0xcd16('0x1'));var BPromise=require('bluebird');var rs=require(_0xcd16('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd16('0x3'))['db'];var utils=require(_0xcd16('0x4'));var logger=require(_0xcd16('0x5'))(_0xcd16('0x6'));var config=require(_0xcd16('0x7'));var jayson=require(_0xcd16('0x8'));var client=jayson[_0xcd16('0x9')][_0xcd16('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1926fd,_0x4af195,_0x3c8cdd){return new BPromise(function(_0x3146c2,_0x5533df){return client['request'](_0x1926fd,_0x3c8cdd)[_0xcd16('0xb')](function(_0x4b4b84){logger['info'](_0xcd16('0xc'),_0x4af195,_0xcd16('0xd'));logger['debug'](_0xcd16('0xe'),_0x4af195,'request\x20sent',JSON[_0xcd16('0xf')](_0x4b4b84));if(_0x4b4b84[_0xcd16('0x10')]){if(_0x4b4b84[_0xcd16('0x10')][_0xcd16('0x11')]===0x1f4){logger['error'](_0xcd16('0xc'),_0x4af195,_0x4b4b84[_0xcd16('0x10')][_0xcd16('0x12')]);return _0x5533df(_0x4b4b84['error'][_0xcd16('0x12')]);}logger[_0xcd16('0x10')](_0xcd16('0xc'),_0x4af195,_0x4b4b84[_0xcd16('0x10')][_0xcd16('0x12')]);return _0x3146c2(_0x4b4b84[_0xcd16('0x10')][_0xcd16('0x12')]);}else{logger[_0xcd16('0x13')](_0xcd16('0xc'),_0x4af195,'request\x20sent');_0x3146c2(_0x4b4b84['result']['message']);}})[_0xcd16('0x14')](function(_0x847c11){logger[_0xcd16('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x4af195,_0x847c11);_0x5533df(_0x847c11);});});} \ No newline at end of file +var _0x2fe7=['client','request','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x2fe7,0xbf));var _0x72fe=function(_0x291dcd,_0x4ce6c4){_0x291dcd=_0x291dcd-0x0;var _0x4a607d=_0x2fe7[_0x291dcd];return _0x4a607d;};'use strict';var _=require('lodash');var util=require(_0x72fe('0x0'));var moment=require(_0x72fe('0x1'));var BPromise=require(_0x72fe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x72fe('0x3'));var db=require(_0x72fe('0x4'))['db'];var utils=require(_0x72fe('0x5'));var logger=require(_0x72fe('0x6'))(_0x72fe('0x7'));var config=require(_0x72fe('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x72fe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c3b41,_0x7c4143,_0x403157){return new BPromise(function(_0x4a75fc,_0x238980){return client[_0x72fe('0xa')](_0x1c3b41,_0x403157)['then'](function(_0x373c71){logger[_0x72fe('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x7c4143,_0x72fe('0xc'));logger[_0x72fe('0xd')](_0x72fe('0xe'),_0x7c4143,_0x72fe('0xc'),JSON['stringify'](_0x373c71));if(_0x373c71[_0x72fe('0xf')]){if(_0x373c71[_0x72fe('0xf')][_0x72fe('0x10')]===0x1f4){logger['error'](_0x72fe('0x11'),_0x7c4143,_0x373c71[_0x72fe('0xf')][_0x72fe('0x12')]);return _0x238980(_0x373c71[_0x72fe('0xf')][_0x72fe('0x12')]);}logger[_0x72fe('0xf')](_0x72fe('0x11'),_0x7c4143,_0x373c71['error'][_0x72fe('0x12')]);return _0x4a75fc(_0x373c71[_0x72fe('0xf')]['message']);}else{logger['info'](_0x72fe('0x11'),_0x7c4143,_0x72fe('0xc'));_0x4a75fc(_0x373c71[_0x72fe('0x13')][_0x72fe('0x12')]);}})['catch'](function(_0x2346ce){logger[_0x72fe('0xf')](_0x72fe('0x11'),_0x7c4143,_0x2346ce);_0x238980(_0x2346ce);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 8ef493b..93993ac 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 _0x8864=['post','create','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','/:id','show'];(function(_0x2f0057,_0x448b27){var _0x17f2c3=function(_0x12efc3){while(--_0x12efc3){_0x2f0057['push'](_0x2f0057['shift']());}};_0x17f2c3(++_0x448b27);}(_0x8864,0x148));var _0x4886=function(_0x563614,_0x12187a){_0x563614=_0x563614-0x0;var _0x3f9c3a=_0x8864[_0x563614];return _0x3f9c3a;};'use strict';var multer=require(_0x4886('0x0'));var util=require('util');var path=require(_0x4886('0x1'));var timeout=require(_0x4886('0x2'));var express=require(_0x4886('0x3'));var router=express[_0x4886('0x4')]();var auth=require(_0x4886('0x5'));var interaction=require(_0x4886('0x6'));var config=require(_0x4886('0x7'));var controller=require(_0x4886('0x8'));router['get']('/',auth[_0x4886('0x9')](),controller['index']);router['get'](_0x4886('0xa'),auth[_0x4886('0x9')](),controller[_0x4886('0xb')]);router[_0x4886('0xc')]('/',auth[_0x4886('0x9')](),controller[_0x4886('0xd')]);router['put'](_0x4886('0xa'),auth[_0x4886('0x9')](),controller[_0x4886('0xe')]);router[_0x4886('0xf')](_0x4886('0xa'),auth[_0x4886('0x9')](),controller[_0x4886('0x10')]);module['exports']=router; \ No newline at end of file +var _0x869e=['connect-timeout','express','Router','../../components/auth/service','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','util'];(function(_0x59ae8f,_0x148344){var _0x3900b5=function(_0x63af51){while(--_0x63af51){_0x59ae8f['push'](_0x59ae8f['shift']());}};_0x3900b5(++_0x148344);}(_0x869e,0x1ec));var _0xe869=function(_0x20eef4,_0x257309){_0x20eef4=_0x20eef4-0x0;var _0xfbd8b8=_0x869e[_0x20eef4];return _0xfbd8b8;};'use strict';var multer=require('multer');var util=require(_0xe869('0x0'));var path=require('path');var timeout=require(_0xe869('0x1'));var express=require(_0xe869('0x2'));var router=express[_0xe869('0x3')]();var auth=require(_0xe869('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe869('0x5'));router[_0xe869('0x6')]('/',auth[_0xe869('0x7')](),controller[_0xe869('0x8')]);router['get'](_0xe869('0x9'),auth[_0xe869('0x7')](),controller[_0xe869('0xa')]);router[_0xe869('0xb')]('/',auth[_0xe869('0x7')](),controller[_0xe869('0xc')]);router[_0xe869('0xd')](_0xe869('0x9'),auth[_0xe869('0x7')](),controller[_0xe869('0xe')]);router['delete'](_0xe869('0x9'),auth[_0xe869('0x7')](),controller[_0xe869('0xf')]);module[_0xe869('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index dbdbb37..4e3b55d 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 _0xf442=['exports','ENUM','variable','customVariable','keyValue','string','STRING','BOOLEAN','sequelize'];(function(_0x59cf9c,_0x387c09){var _0xf6f984=function(_0x3107b3){while(--_0x3107b3){_0x59cf9c['push'](_0x59cf9c['shift']());}};_0xf6f984(++_0x387c09);}(_0xf442,0xbc));var _0x2f44=function(_0x38040b,_0x438b30){_0x38040b=_0x38040b-0x0;var _0xd08cc=_0xf442[_0x38040b];return _0xd08cc;};'use strict';var Sequelize=require(_0x2f44('0x0'));module[_0x2f44('0x1')]={'type':{'type':Sequelize[_0x2f44('0x2')]('string',_0x2f44('0x3'),_0x2f44('0x4'),_0x2f44('0x5')),'defaultValue':_0x2f44('0x6')},'content':{'type':Sequelize[_0x2f44('0x7')]},'key':{'type':Sequelize[_0x2f44('0x7')]},'keyType':{'type':Sequelize[_0x2f44('0x2')](_0x2f44('0x6'),_0x2f44('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x2f44('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2f44('0x7')]},'customField':{'type':Sequelize[_0x2f44('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2f44('0x7')]}}; \ No newline at end of file +var _0x5db2=['sequelize','exports','ENUM','variable','customVariable','keyValue','string','STRING','BOOLEAN'];(function(_0x1f492a,_0x19efad){var _0x22d92c=function(_0x151213){while(--_0x151213){_0x1f492a['push'](_0x1f492a['shift']());}};_0x22d92c(++_0x19efad);}(_0x5db2,0xf3));var _0x25db=function(_0x38ab50,_0x230a08){_0x38ab50=_0x38ab50-0x0;var _0x39a83b=_0x5db2[_0x38ab50];return _0x39a83b;};'use strict';var Sequelize=require(_0x25db('0x0'));module[_0x25db('0x1')]={'type':{'type':Sequelize[_0x25db('0x2')]('string',_0x25db('0x3'),_0x25db('0x4'),_0x25db('0x5')),'defaultValue':_0x25db('0x6')},'content':{'type':Sequelize[_0x25db('0x7')]},'key':{'type':Sequelize[_0x25db('0x7')]},'keyType':{'type':Sequelize[_0x25db('0x2')](_0x25db('0x6'),_0x25db('0x3'),_0x25db('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x25db('0x7')]},'nameField':{'type':Sequelize[_0x25db('0x7')]},'customField':{'type':Sequelize[_0x25db('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x25db('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index cc10521..5588f7e 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 _0xe393=['rows','includeAll','find','catch','VtigerField','create','body','params','html-pdf','eml-format','zip-dir','request-promise','bluebird','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','field','options','count','include','findAll'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xe393,0x8c));var _0x3e39=function(_0x1b126a,_0x354ce0){_0x1b126a=_0x1b126a-0x0;var _0x1da353=_0xe393[_0x1b126a];return _0x1da353;};'use strict';var pdf=require(_0x3e39('0x0'));var emlformat=require(_0x3e39('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3e39('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e39('0x3'));var moment=require('moment');var BPromise=require(_0x3e39('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3e39('0x5'));var csv=require(_0x3e39('0x6'));var ejs=require(_0x3e39('0x7'));var fs=require('fs');var _=require(_0x3e39('0x8'));var squel=require(_0x3e39('0x9'));var crypto=require(_0x3e39('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3e39('0xb'));var toCsv=require(_0x3e39('0x6'));var querystring=require('querystring');var Papa=require(_0x3e39('0xc'));var Redis=require('ioredis');var authService=require(_0x3e39('0xd'));var qs=require(_0x3e39('0xe'));var hardwareService=require(_0x3e39('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x3e39('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb6ca0d,_0x229e35){_0x229e35=_0x229e35||0xcc;return function(_0x2016cf){if(_0x2016cf){return _0xb6ca0d[_0x3e39('0x11')](_0x229e35);}return _0xb6ca0d[_0x3e39('0x12')](_0x229e35)[_0x3e39('0x13')]();};}function respondWithResult(_0x442ae8,_0x421fa7){_0x421fa7=_0x421fa7||0xc8;return function(_0x515fc7){if(_0x515fc7){return _0x442ae8['status'](_0x421fa7)[_0x3e39('0x14')](_0x515fc7);}};}function respondWithFilteredResult(_0x18365b,_0xc58348){return function(_0x3f8792){if(_0x3f8792){var _0x3e0e3d=_0x3f8792['count'],_0x743de2=_0xc58348[_0x3e39('0x15')],_0x1de433=_0xc58348[_0x3e39('0x15')]+_0xc58348[_0x3e39('0x16')],_0x19c3ab;if(_0x1de433>=_0x3e0e3d){_0x1de433=_0x3e0e3d;_0x19c3ab=0xc8;}else{_0x19c3ab=0xce;}_0x18365b[_0x3e39('0x12')](_0x19c3ab);return _0x18365b[_0x3e39('0x17')](_0x3e39('0x18'),_0x743de2+'-'+_0x1de433+'/'+_0x3e0e3d)[_0x3e39('0x14')](_0x3f8792);}return null;};}function patchUpdates(_0x5f1dbb){return function(_0x226cae){try{jsonpatch[_0x3e39('0x19')](_0x226cae,_0x5f1dbb,!![]);}catch(_0x82aac7){return BPromise[_0x3e39('0x1a')](_0x82aac7);}return _0x226cae[_0x3e39('0x1b')]();};}function saveUpdates(_0x579f6a,_0x1b5404){return function(_0x5f4f04){if(_0x5f4f04){return _0x5f4f04[_0x3e39('0x1c')](_0x579f6a)[_0x3e39('0x1d')](function(_0x2f5ef9){return _0x2f5ef9;});}return null;};}function removeEntity(_0x575bce,_0x346cf7){return function(_0x5ca2ba){if(_0x5ca2ba){return _0x5ca2ba[_0x3e39('0x1e')]()[_0x3e39('0x1d')](function(){_0x575bce[_0x3e39('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46a2e3,_0xa696a2){return function(_0x20a045){if(!_0x20a045){_0x46a2e3['sendStatus'](0x194);}return _0x20a045;};}function handleError(_0x1e1407,_0x557ec0){_0x557ec0=_0x557ec0||0x1f4;return function(_0x4e575d){logger['error'](_0x4e575d[_0x3e39('0x1f')]);if(_0x4e575d[_0x3e39('0x20')]){delete _0x4e575d[_0x3e39('0x20')];}_0x1e1407['status'](_0x557ec0)[_0x3e39('0x21')](_0x4e575d);};}exports[_0x3e39('0x22')]=function(_0x427783,_0x561f27){var _0x14e878={},_0xe77104={},_0x2d0f42={'count':0x0,'rows':[]};var _0x4fbee5=db['VtigerField'][_0x3e39('0x23')];_0xe77104[_0x3e39('0x24')]=_[_0x3e39('0x25')](_0x4fbee5);_0xe77104[_0x3e39('0x26')]=_[_0x3e39('0x25')](_0x427783[_0x3e39('0x26')]);_0xe77104[_0x3e39('0x27')]=_[_0x3e39('0x28')](_0xe77104[_0x3e39('0x24')],_0xe77104[_0x3e39('0x26')]);_0x14e878[_0x3e39('0x29')]=_[_0x3e39('0x28')](_0xe77104[_0x3e39('0x24')],qs[_0x3e39('0x2a')](_0x427783[_0x3e39('0x26')][_0x3e39('0x2a')]));_0x14e878['attributes']=_0x14e878['attributes']['length']?_0x14e878[_0x3e39('0x29')]:_0xe77104['model'];if(!_0x427783[_0x3e39('0x26')][_0x3e39('0x2b')]('nolimit')){_0x14e878[_0x3e39('0x16')]=qs['limit'](_0x427783['query'][_0x3e39('0x16')]);_0x14e878[_0x3e39('0x15')]=qs[_0x3e39('0x15')](_0x427783['query'][_0x3e39('0x15')]);}_0x14e878[_0x3e39('0x2c')]=qs[_0x3e39('0x2d')](_0x427783[_0x3e39('0x26')]['sort']);_0x14e878[_0x3e39('0x2e')]=qs['filters'](_[_0x3e39('0x2f')](_0x427783['query'],_0xe77104[_0x3e39('0x27')]));if(_0x427783['query'][_0x3e39('0x30')]){_0x14e878[_0x3e39('0x2e')]=_[_0x3e39('0x31')](_0x14e878[_0x3e39('0x2e')],{'$or':_[_0x3e39('0x32')](_0x4fbee5,function(_0xbd27de){if(_0xbd27de[_0x3e39('0x33')][_0x3e39('0x34')]!=='VIRTUAL'){var _0x5a09b5={};_0x5a09b5[_0xbd27de[_0x3e39('0x35')]]={'$like':'%'+_0x427783[_0x3e39('0x26')][_0x3e39('0x30')]+'%'};return _0x5a09b5;}})});}_0x14e878=_[_0x3e39('0x31')]({},_0x14e878,_0x427783[_0x3e39('0x36')]);var _0x3ca351={'where':_0x14e878[_0x3e39('0x2e')]};return db['VtigerField'][_0x3e39('0x37')](_0x3ca351)[_0x3e39('0x1d')](function(_0x577a9b){_0x2d0f42[_0x3e39('0x37')]=_0x577a9b;if(_0x427783[_0x3e39('0x26')]['includeAll']){_0x14e878[_0x3e39('0x38')]=[{'all':!![]}];}return db['VtigerField'][_0x3e39('0x39')](_0x14e878);})[_0x3e39('0x1d')](function(_0x38a23d){_0x2d0f42[_0x3e39('0x3a')]=_0x38a23d;return _0x2d0f42;})[_0x3e39('0x1d')](respondWithFilteredResult(_0x561f27,_0x14e878))['catch'](handleError(_0x561f27,null));};exports['show']=function(_0x153814,_0x21189a){var _0x4f18ab={'raw':!![],'where':{'id':_0x153814['params']['id']}},_0x514a25={};_0x514a25[_0x3e39('0x24')]=_[_0x3e39('0x25')](db['VtigerField'][_0x3e39('0x23')]);_0x514a25[_0x3e39('0x26')]=_[_0x3e39('0x25')](_0x153814['query']);_0x514a25['filters']=_[_0x3e39('0x28')](_0x514a25[_0x3e39('0x24')],_0x514a25[_0x3e39('0x26')]);_0x4f18ab[_0x3e39('0x29')]=_['intersection'](_0x514a25[_0x3e39('0x24')],qs[_0x3e39('0x2a')](_0x153814[_0x3e39('0x26')][_0x3e39('0x2a')]));_0x4f18ab[_0x3e39('0x29')]=_0x4f18ab[_0x3e39('0x29')]['length']?_0x4f18ab[_0x3e39('0x29')]:_0x514a25[_0x3e39('0x24')];if(_0x153814['query'][_0x3e39('0x3b')]){_0x4f18ab['include']=[{'all':!![]}];}_0x4f18ab=_[_0x3e39('0x31')]({},_0x4f18ab,_0x153814[_0x3e39('0x36')]);return db['VtigerField'][_0x3e39('0x3c')](_0x4f18ab)[_0x3e39('0x1d')](handleEntityNotFound(_0x21189a,null))[_0x3e39('0x1d')](respondWithResult(_0x21189a,null))[_0x3e39('0x3d')](handleError(_0x21189a,null));};exports['create']=function(_0x52b4bf,_0x15b391){return db[_0x3e39('0x3e')][_0x3e39('0x3f')](_0x52b4bf[_0x3e39('0x40')],{})[_0x3e39('0x1d')](respondWithResult(_0x15b391,0xc9))[_0x3e39('0x3d')](handleError(_0x15b391,null));};exports[_0x3e39('0x1c')]=function(_0x57f6f2,_0x464fba){if(_0x57f6f2['body']['id']){delete _0x57f6f2[_0x3e39('0x40')]['id'];}return db[_0x3e39('0x3e')][_0x3e39('0x3c')]({'where':{'id':_0x57f6f2[_0x3e39('0x41')]['id']}})[_0x3e39('0x1d')](handleEntityNotFound(_0x464fba,null))['then'](saveUpdates(_0x57f6f2[_0x3e39('0x40')],null))[_0x3e39('0x1d')](respondWithResult(_0x464fba,null))[_0x3e39('0x3d')](handleError(_0x464fba,null));};exports[_0x3e39('0x1e')]=function(_0x52f6f7,_0xf04c68){return db[_0x3e39('0x3e')]['find']({'where':{'id':_0x52f6f7[_0x3e39('0x41')]['id']}})[_0x3e39('0x1d')](handleEntityNotFound(_0xf04c68,null))['then'](removeEntity(_0xf04c68,null))[_0x3e39('0x3d')](handleError(_0xf04c68,null));}; \ No newline at end of file +var _0xa4f8=['where','map','type','key','VIRTUAL','field','filter','options','count','include','findAll','rows','show','params','includeAll','find','catch','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','VtigerField','rawAttributes','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','merge'];(function(_0x48db27,_0x2c8b2c){var _0x2b3142=function(_0xed47b7){while(--_0xed47b7){_0x48db27['push'](_0x48db27['shift']());}};_0x2b3142(++_0x2c8b2c);}(_0xa4f8,0x143));var _0x8a4f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa4f8[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x8a4f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8a4f('0x1'));var zipdir=require(_0x8a4f('0x2'));var jsonpatch=require(_0x8a4f('0x3'));var rp=require(_0x8a4f('0x4'));var moment=require('moment');var BPromise=require(_0x8a4f('0x5'));var Mustache=require(_0x8a4f('0x6'));var util=require(_0x8a4f('0x7'));var path=require(_0x8a4f('0x8'));var sox=require(_0x8a4f('0x9'));var csv=require(_0x8a4f('0xa'));var ejs=require(_0x8a4f('0xb'));var fs=require('fs');var _=require(_0x8a4f('0xc'));var squel=require(_0x8a4f('0xd'));var crypto=require(_0x8a4f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8a4f('0xf'));var toCsv=require(_0x8a4f('0xa'));var querystring=require('querystring');var Papa=require(_0x8a4f('0x10'));var Redis=require(_0x8a4f('0x11'));var authService=require(_0x8a4f('0x12'));var qs=require(_0x8a4f('0x13'));var hardwareService=require(_0x8a4f('0x14'));var logger=require(_0x8a4f('0x15'))(_0x8a4f('0x16'));var utils=require(_0x8a4f('0x17'));var config=require(_0x8a4f('0x18'));var db=require(_0x8a4f('0x19'))['db'];function respondWithStatusCode(_0x54a2f2,_0x3b06fd){_0x3b06fd=_0x3b06fd||0xcc;return function(_0x4bf5a3){if(_0x4bf5a3){return _0x54a2f2[_0x8a4f('0x1a')](_0x3b06fd);}return _0x54a2f2[_0x8a4f('0x1b')](_0x3b06fd)[_0x8a4f('0x1c')]();};}function respondWithResult(_0x5efbee,_0x153e4a){_0x153e4a=_0x153e4a||0xc8;return function(_0x3bf6e8){if(_0x3bf6e8){return _0x5efbee[_0x8a4f('0x1b')](_0x153e4a)['json'](_0x3bf6e8);}};}function respondWithFilteredResult(_0x2e8ced,_0x39fd88){return function(_0x275c7b){if(_0x275c7b){var _0x374a7b=_0x275c7b['count'],_0x371dcb=_0x39fd88[_0x8a4f('0x1d')],_0x33f58b=_0x39fd88[_0x8a4f('0x1d')]+_0x39fd88[_0x8a4f('0x1e')],_0x1e7039;if(_0x33f58b>=_0x374a7b){_0x33f58b=_0x374a7b;_0x1e7039=0xc8;}else{_0x1e7039=0xce;}_0x2e8ced[_0x8a4f('0x1b')](_0x1e7039);return _0x2e8ced[_0x8a4f('0x1f')](_0x8a4f('0x20'),_0x371dcb+'-'+_0x33f58b+'/'+_0x374a7b)[_0x8a4f('0x21')](_0x275c7b);}return null;};}function patchUpdates(_0x3ad56a){return function(_0x538bdb){try{jsonpatch[_0x8a4f('0x22')](_0x538bdb,_0x3ad56a,!![]);}catch(_0x591f03){return BPromise[_0x8a4f('0x23')](_0x591f03);}return _0x538bdb[_0x8a4f('0x24')]();};}function saveUpdates(_0x1e095b,_0x58a4c8){return function(_0x601bd0){if(_0x601bd0){return _0x601bd0[_0x8a4f('0x25')](_0x1e095b)[_0x8a4f('0x26')](function(_0x2dcb09){return _0x2dcb09;});}return null;};}function removeEntity(_0x2999c1,_0x44be63){return function(_0x1b81cb){if(_0x1b81cb){return _0x1b81cb[_0x8a4f('0x27')]()[_0x8a4f('0x26')](function(){_0x2999c1['status'](0xcc)[_0x8a4f('0x1c')]();});}};}function handleEntityNotFound(_0x22ecf0,_0x46decc){return function(_0x52d0f1){if(!_0x52d0f1){_0x22ecf0[_0x8a4f('0x1a')](0x194);}return _0x52d0f1;};}function handleError(_0x3ab3f8,_0x18d8f3){_0x18d8f3=_0x18d8f3||0x1f4;return function(_0x35aab0){logger['error'](_0x35aab0['stack']);if(_0x35aab0[_0x8a4f('0x28')]){delete _0x35aab0['name'];}_0x3ab3f8['status'](_0x18d8f3)[_0x8a4f('0x29')](_0x35aab0);};}exports[_0x8a4f('0x2a')]=function(_0x5b1e6e,_0x4b24bb){var _0x4ddff4={},_0x4edfad={},_0x2d777b={'count':0x0,'rows':[]};var _0x271a36=db[_0x8a4f('0x2b')][_0x8a4f('0x2c')];_0x4edfad['model']=_['keys'](_0x271a36);_0x4edfad[_0x8a4f('0x2d')]=_[_0x8a4f('0x2e')](_0x5b1e6e[_0x8a4f('0x2d')]);_0x4edfad['filters']=_[_0x8a4f('0x2f')](_0x4edfad[_0x8a4f('0x30')],_0x4edfad[_0x8a4f('0x2d')]);_0x4ddff4[_0x8a4f('0x31')]=_[_0x8a4f('0x2f')](_0x4edfad['model'],qs[_0x8a4f('0x32')](_0x5b1e6e['query'][_0x8a4f('0x32')]));_0x4ddff4['attributes']=_0x4ddff4[_0x8a4f('0x31')][_0x8a4f('0x33')]?_0x4ddff4['attributes']:_0x4edfad['model'];if(!_0x5b1e6e[_0x8a4f('0x2d')][_0x8a4f('0x34')](_0x8a4f('0x35'))){_0x4ddff4[_0x8a4f('0x1e')]=qs['limit'](_0x5b1e6e[_0x8a4f('0x2d')][_0x8a4f('0x1e')]);_0x4ddff4[_0x8a4f('0x1d')]=qs['offset'](_0x5b1e6e[_0x8a4f('0x2d')][_0x8a4f('0x1d')]);}_0x4ddff4['order']=qs[_0x8a4f('0x36')](_0x5b1e6e['query'][_0x8a4f('0x36')]);_0x4ddff4['where']=qs[_0x8a4f('0x37')](_['pick'](_0x5b1e6e[_0x8a4f('0x2d')],_0x4edfad['filters']));if(_0x5b1e6e[_0x8a4f('0x2d')]['filter']){_0x4ddff4['where']=_[_0x8a4f('0x38')](_0x4ddff4[_0x8a4f('0x39')],{'$or':_[_0x8a4f('0x3a')](_0x271a36,function(_0x111492){if(_0x111492[_0x8a4f('0x3b')][_0x8a4f('0x3c')]!==_0x8a4f('0x3d')){var _0x490bc7={};_0x490bc7[_0x111492[_0x8a4f('0x3e')]]={'$like':'%'+_0x5b1e6e[_0x8a4f('0x2d')][_0x8a4f('0x3f')]+'%'};return _0x490bc7;}})});}_0x4ddff4=_[_0x8a4f('0x38')]({},_0x4ddff4,_0x5b1e6e[_0x8a4f('0x40')]);var _0x36bd82={'where':_0x4ddff4[_0x8a4f('0x39')]};return db[_0x8a4f('0x2b')][_0x8a4f('0x41')](_0x36bd82)[_0x8a4f('0x26')](function(_0x2bab7d){_0x2d777b[_0x8a4f('0x41')]=_0x2bab7d;if(_0x5b1e6e[_0x8a4f('0x2d')]['includeAll']){_0x4ddff4[_0x8a4f('0x42')]=[{'all':!![]}];}return db[_0x8a4f('0x2b')][_0x8a4f('0x43')](_0x4ddff4);})[_0x8a4f('0x26')](function(_0xb6ee26){_0x2d777b[_0x8a4f('0x44')]=_0xb6ee26;return _0x2d777b;})['then'](respondWithFilteredResult(_0x4b24bb,_0x4ddff4))['catch'](handleError(_0x4b24bb,null));};exports[_0x8a4f('0x45')]=function(_0x48fb6b,_0x278535){var _0x32350d={'raw':!![],'where':{'id':_0x48fb6b[_0x8a4f('0x46')]['id']}},_0x21b999={};_0x21b999[_0x8a4f('0x30')]=_[_0x8a4f('0x2e')](db[_0x8a4f('0x2b')][_0x8a4f('0x2c')]);_0x21b999['query']=_[_0x8a4f('0x2e')](_0x48fb6b[_0x8a4f('0x2d')]);_0x21b999[_0x8a4f('0x37')]=_[_0x8a4f('0x2f')](_0x21b999[_0x8a4f('0x30')],_0x21b999[_0x8a4f('0x2d')]);_0x32350d['attributes']=_[_0x8a4f('0x2f')](_0x21b999[_0x8a4f('0x30')],qs[_0x8a4f('0x32')](_0x48fb6b['query']['fields']));_0x32350d[_0x8a4f('0x31')]=_0x32350d[_0x8a4f('0x31')]['length']?_0x32350d[_0x8a4f('0x31')]:_0x21b999['model'];if(_0x48fb6b[_0x8a4f('0x2d')][_0x8a4f('0x47')]){_0x32350d[_0x8a4f('0x42')]=[{'all':!![]}];}_0x32350d=_['merge']({},_0x32350d,_0x48fb6b['options']);return db['VtigerField'][_0x8a4f('0x48')](_0x32350d)[_0x8a4f('0x26')](handleEntityNotFound(_0x278535,null))[_0x8a4f('0x26')](respondWithResult(_0x278535,null))[_0x8a4f('0x49')](handleError(_0x278535,null));};exports[_0x8a4f('0x4a')]=function(_0x3dde13,_0x473ecd){return db[_0x8a4f('0x2b')]['create'](_0x3dde13['body'],{})['then'](respondWithResult(_0x473ecd,0xc9))[_0x8a4f('0x49')](handleError(_0x473ecd,null));};exports[_0x8a4f('0x25')]=function(_0x4d35df,_0x31bbc7){if(_0x4d35df[_0x8a4f('0x4b')]['id']){delete _0x4d35df[_0x8a4f('0x4b')]['id'];}return db['VtigerField'][_0x8a4f('0x48')]({'where':{'id':_0x4d35df[_0x8a4f('0x46')]['id']}})[_0x8a4f('0x26')](handleEntityNotFound(_0x31bbc7,null))['then'](saveUpdates(_0x4d35df[_0x8a4f('0x4b')],null))[_0x8a4f('0x26')](respondWithResult(_0x31bbc7,null))[_0x8a4f('0x49')](handleError(_0x31bbc7,null));};exports[_0x8a4f('0x27')]=function(_0x5c815f,_0x4870c8){return db[_0x8a4f('0x2b')][_0x8a4f('0x48')]({'where':{'id':_0x5c815f[_0x8a4f('0x46')]['id']}})[_0x8a4f('0x26')](handleEntityNotFound(_0x4870c8,null))[_0x8a4f('0x26')](removeEntity(_0x4870c8,null))['catch'](handleError(_0x4870c8,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index bb0c116..bb26b19 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(_0x2359f4,_0x153461){var _0x103f19=function(_0xdfeec8){while(--_0xdfeec8){_0x2359f4['push'](_0x2359f4['shift']());}};_0x103f19(++_0x153461);}(_0x7a54,0x106));var _0x47a5=function(_0x429661,_0x3891b8){_0x429661=_0x429661-0x0;var _0xf2b572=_0x7a54[_0x429661];return _0xf2b572;};'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(_0x3f50dd,_0x133b2b){var _0x197909=function(_0x3d4329){while(--_0x3d4329){_0x3f50dd['push'](_0x3f50dd['shift']());}};_0x197909(++_0x133b2b);}(_0x7a54,0x106));var _0x47a5=function(_0x51c164,_0xb76f88){_0x51c164=_0x51c164-0x0;var _0xfeb94=_0x7a54[_0x51c164];return _0xfeb94;};'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 221345e..639c1f4 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 _0x3306=['then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x48728c,_0x1b2bb2){var _0x100c17=function(_0x255fa0){while(--_0x255fa0){_0x48728c['push'](_0x48728c['shift']());}};_0x100c17(++_0x1b2bb2);}(_0x3306,0x107));var _0x6330=function(_0x34c61d,_0x4895f0){_0x34c61d=_0x34c61d-0x0;var _0x354d81=_0x3306[_0x34c61d];return _0x354d81;};'use strict';var _=require(_0x6330('0x0'));var util=require(_0x6330('0x1'));var moment=require(_0x6330('0x2'));var BPromise=require(_0x6330('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6330('0x4'));var db=require(_0x6330('0x5'))['db'];var utils=require(_0x6330('0x6'));var logger=require(_0x6330('0x7'))(_0x6330('0x8'));var config=require('../../config/environment');var jayson=require(_0x6330('0x9'));var client=jayson[_0x6330('0xa')][_0x6330('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f164b,_0x27183c,_0x4561f7){return new BPromise(function(_0x274386,_0x3c8375){return client[_0x6330('0xc')](_0x1f164b,_0x4561f7)[_0x6330('0xd')](function(_0x554305){logger[_0x6330('0xe')]('VtigerField,\x20%s,\x20%s',_0x27183c,_0x6330('0xf'));logger[_0x6330('0x10')](_0x6330('0x11'),_0x27183c,_0x6330('0xf'),JSON[_0x6330('0x12')](_0x554305));if(_0x554305[_0x6330('0x13')]){if(_0x554305[_0x6330('0x13')][_0x6330('0x14')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x27183c,_0x554305[_0x6330('0x13')][_0x6330('0x15')]);return _0x3c8375(_0x554305[_0x6330('0x13')][_0x6330('0x15')]);}logger[_0x6330('0x13')]('VtigerField,\x20%s,\x20%s',_0x27183c,_0x554305[_0x6330('0x13')][_0x6330('0x15')]);return _0x274386(_0x554305[_0x6330('0x13')][_0x6330('0x15')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x27183c,_0x6330('0xf'));_0x274386(_0x554305[_0x6330('0x16')][_0x6330('0x15')]);}})['catch'](function(_0x32f1b3){logger[_0x6330('0x13')]('VtigerField,\x20%s,\x20%s',_0x27183c,_0x32f1b3);_0x3c8375(_0x32f1b3);});});} \ No newline at end of file +var _0xd0e4=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash'];(function(_0x3557dc,_0x5dd343){var _0x1c9a6a=function(_0x16889e){while(--_0x16889e){_0x3557dc['push'](_0x3557dc['shift']());}};_0x1c9a6a(++_0x5dd343);}(_0xd0e4,0x1d3));var _0x4d0e=function(_0x5d7747,_0x55c074){_0x5d7747=_0x5d7747-0x0;var _0x291142=_0xd0e4[_0x5d7747];return _0x291142;};'use strict';var _=require(_0x4d0e('0x0'));var util=require(_0x4d0e('0x1'));var moment=require(_0x4d0e('0x2'));var BPromise=require(_0x4d0e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4d0e('0x4'))['db'];var utils=require(_0x4d0e('0x5'));var logger=require(_0x4d0e('0x6'))(_0x4d0e('0x7'));var config=require(_0x4d0e('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x103596,_0x39e5c6,_0x50cd74){return new BPromise(function(_0x2f900a,_0x1731e4){return client['request'](_0x103596,_0x50cd74)['then'](function(_0x9358f5){logger['info'](_0x4d0e('0x9'),_0x39e5c6,_0x4d0e('0xa'));logger[_0x4d0e('0xb')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x39e5c6,_0x4d0e('0xa'),JSON[_0x4d0e('0xc')](_0x9358f5));if(_0x9358f5['error']){if(_0x9358f5['error'][_0x4d0e('0xd')]===0x1f4){logger[_0x4d0e('0xe')](_0x4d0e('0x9'),_0x39e5c6,_0x9358f5[_0x4d0e('0xe')][_0x4d0e('0xf')]);return _0x1731e4(_0x9358f5[_0x4d0e('0xe')][_0x4d0e('0xf')]);}logger[_0x4d0e('0xe')](_0x4d0e('0x9'),_0x39e5c6,_0x9358f5['error'][_0x4d0e('0xf')]);return _0x2f900a(_0x9358f5[_0x4d0e('0xe')][_0x4d0e('0xf')]);}else{logger['info'](_0x4d0e('0x9'),_0x39e5c6,'request\x20sent');_0x2f900a(_0x9358f5[_0x4d0e('0x10')][_0x4d0e('0xf')]);}})[_0x4d0e('0x11')](function(_0x956477){logger[_0x4d0e('0xe')](_0x4d0e('0x9'),_0x39e5c6,_0x956477);_0x1731e4(_0x956477);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index d6c7521..f02466b 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 _0x226b=['isAuthenticated','getFields','post','create','addConfiguration','put','update','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0xed0089,_0xdf1f6c){var _0x4655c8=function(_0x30b32e){while(--_0x30b32e){_0xed0089['push'](_0xed0089['shift']());}};_0x4655c8(++_0xdf1f6c);}(_0x226b,0x16d));var _0xb226=function(_0x4c1eec,_0x515aa1){_0x4c1eec=_0x4c1eec-0x0;var _0x5d8475=_0x226b[_0x4c1eec];return _0x5d8475;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb226('0x0'));var timeout=require('connect-timeout');var express=require(_0xb226('0x1'));var router=express[_0xb226('0x2')]();var auth=require(_0xb226('0x3'));var interaction=require(_0xb226('0x4'));var config=require(_0xb226('0x5'));var controller=require('./intZendeskAccount.controller');router[_0xb226('0x6')]('/',auth['isAuthenticated'](),controller[_0xb226('0x7')]);router[_0xb226('0x6')](_0xb226('0x8'),auth['isAuthenticated'](),controller[_0xb226('0x9')]);router[_0xb226('0x6')](_0xb226('0xa'),auth['isAuthenticated'](),controller[_0xb226('0xb')]);router[_0xb226('0x6')](_0xb226('0xc'),auth[_0xb226('0xd')](),controller[_0xb226('0xe')]);router[_0xb226('0xf')]('/',auth[_0xb226('0xd')](),controller[_0xb226('0x10')]);router[_0xb226('0xf')](_0xb226('0xa'),auth[_0xb226('0xd')](),controller[_0xb226('0x11')]);router[_0xb226('0x12')](_0xb226('0x8'),auth[_0xb226('0xd')](),controller[_0xb226('0x13')]);router['delete'](_0xb226('0x8'),auth[_0xb226('0xd')](),controller['destroy']);module[_0xb226('0x14')]=router; \ No newline at end of file +var _0xa936=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/configurations','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x22f963,_0x4bb343){var _0x3ef3ee=function(_0x1bbbac){while(--_0x1bbbac){_0x22f963['push'](_0x22f963['shift']());}};_0x3ef3ee(++_0x4bb343);}(_0xa936,0x7a));var _0x6a93=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xa936[_0xaa1b3e];return _0x454d7d;};'use strict';var multer=require(_0x6a93('0x0'));var util=require('util');var path=require(_0x6a93('0x1'));var timeout=require(_0x6a93('0x2'));var express=require('express');var router=express[_0x6a93('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x6a93('0x4'));var config=require(_0x6a93('0x5'));var controller=require('./intZendeskAccount.controller');router[_0x6a93('0x6')]('/',auth[_0x6a93('0x7')](),controller['index']);router[_0x6a93('0x6')](_0x6a93('0x8'),auth[_0x6a93('0x7')](),controller['show']);router[_0x6a93('0x6')](_0x6a93('0x9'),auth[_0x6a93('0x7')](),controller['getConfigurations']);router[_0x6a93('0x6')]('/:id/fields',auth[_0x6a93('0x7')](),controller[_0x6a93('0xa')]);router[_0x6a93('0xb')]('/',auth[_0x6a93('0x7')](),controller['create']);router['post'](_0x6a93('0x9'),auth[_0x6a93('0x7')](),controller[_0x6a93('0xc')]);router[_0x6a93('0xd')](_0x6a93('0x8'),auth[_0x6a93('0x7')](),controller[_0x6a93('0xe')]);router[_0x6a93('0xf')]('/:id',auth[_0x6a93('0x7')](),controller[_0x6a93('0x10')]);module[_0x6a93('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 88e956f..ac7b977 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 _0xd33c=['password','newTab','integrationTab','STRING','username','ENUM','token'];(function(_0x47585b,_0x45d4cb){var _0x2f1621=function(_0x5362e3){while(--_0x5362e3){_0x47585b['push'](_0x47585b['shift']());}};_0x2f1621(++_0x45d4cb);}(_0xd33c,0x129));var _0xcd33=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xd33c[_0x373dee];return _0x46798f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xcd33('0x0')]},'description':{'type':Sequelize[_0xcd33('0x0')]},'username':{'type':Sequelize['STRING'],'unique':_0xcd33('0x1')},'password':{'type':Sequelize[_0xcd33('0x0')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xcd33('0x0')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xcd33('0x2')]('password',_0xcd33('0x3')),'defaultValue':_0xcd33('0x4')},'serverUrl':{'type':Sequelize[_0xcd33('0x0')]},'type':{'type':Sequelize[_0xcd33('0x2')]('integrationTab',_0xcd33('0x5')),'defaultValue':_0xcd33('0x6')}}; \ No newline at end of file +var _0xa98a=['password','integrationTab','newTab','sequelize','exports','STRING','ENUM'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa98a,0xab));var _0xaa98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa98a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaa98('0x0'));module[_0xaa98('0x1')]={'name':{'type':Sequelize[_0xaa98('0x2')]},'description':{'type':Sequelize[_0xaa98('0x2')]},'username':{'type':Sequelize[_0xaa98('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xaa98('0x2')]},'token':{'type':Sequelize[_0xaa98('0x2')]},'remoteUri':{'type':Sequelize[_0xaa98('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xaa98('0x3')](_0xaa98('0x4'),'token'),'defaultValue':_0xaa98('0x4')},'serverUrl':{'type':Sequelize[_0xaa98('0x2')]},'type':{'type':Sequelize[_0xaa98('0x3')](_0xaa98('0x5'),_0xaa98('0x6')),'defaultValue':_0xaa98('0x5')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index a00178a..1998d15 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 _0xae3d=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/integrations/configuration','jayson/promise','client','test','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\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','ZendeskAccount','rawAttributes','model','keys','query','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','count','includeAll','findAll','rows','show','params','fields','find','create','body','getConfigurations','findOne','ZendeskConfiguration','length','addConfiguration','Subjects','getSubjects','channel','Descriptions','ZendeskField','getFields','username','token','remoteUri','slice','substring','format','%s/%s','ticket_fields','password','headers','Basic\x20%s','%s:%s','base64','%s/token:%s','toString','Sequelize','subject','assignee','remove','includes','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','request-promise','moment','bluebird','util','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1ad5a0,_0x416fed){var _0x2a391d=function(_0x2562b9){while(--_0x2562b9){_0x1ad5a0['push'](_0x1ad5a0['shift']());}};_0x2a391d(++_0x416fed);}(_0xae3d,0x68));var _0xdae3=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xae3d[_0x35da42];return _0x370035;};'use strict';var pdf=require(_0xdae3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdae3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdae3('0x2'));var moment=require(_0xdae3('0x3'));var BPromise=require(_0xdae3('0x4'));var Mustache=require('mustache');var util=require(_0xdae3('0x5'));var path=require('path');var sox=require(_0xdae3('0x6'));var csv=require('to-csv');var ejs=require(_0xdae3('0x7'));var fs=require('fs');var _=require(_0xdae3('0x8'));var squel=require('squel');var crypto=require(_0xdae3('0x9'));var jsforce=require(_0xdae3('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xdae3('0xb'));var querystring=require(_0xdae3('0xc'));var Papa=require(_0xdae3('0xd'));var Redis=require(_0xdae3('0xe'));var authService=require(_0xdae3('0xf'));var qs=require(_0xdae3('0x10'));var hardwareService=require(_0xdae3('0x11'));var logger=require(_0xdae3('0x12'))(_0xdae3('0x13'));var utils=require('../../config/utils');var config=require(_0xdae3('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0xdae3('0x15'));var jayson=require(_0xdae3('0x16'));var client=jayson[_0xdae3('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x57af46,_0x131606,_0x4c3d20){if(_0x4c3d20){var _0x184625=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x184625[_0xdae3('0x18')](_0x131606)){return _0x57af46;}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 _0x57af46;}}function respondWithRpcPromise(_0x428a37,_0xb095ba,_0x3bfa91,_0x103da3){return new BPromise(function(_0x2bb755,_0x1b8094){var _0x127381=_0x103da3||client;return _0x127381[_0xdae3('0x19')](_0x428a37,_0x3bfa91)[_0xdae3('0x1a')](function(_0x165648){logger[_0xdae3('0x1b')](_0xdae3('0x1c'),_0xb095ba,_0xdae3('0x1d'));logger[_0xdae3('0x1e')](_0xdae3('0x1f'),_0xb095ba,_0xdae3('0x1d'),JSON[_0xdae3('0x20')](_0x165648));if(_0x165648[_0xdae3('0x21')]){if(_0x165648['error'][_0xdae3('0x22')]===0x1f4){logger[_0xdae3('0x21')](_0xdae3('0x1c'),_0xb095ba,_0x165648['error'][_0xdae3('0x23')]);return _0x1b8094(_0x165648[_0xdae3('0x21')]['message']);}logger[_0xdae3('0x21')](_0xdae3('0x1c'),_0xb095ba,_0x165648[_0xdae3('0x21')][_0xdae3('0x23')]);return _0x2bb755(_0x165648[_0xdae3('0x21')]['message']);}else{logger[_0xdae3('0x1b')](_0xdae3('0x1c'),_0xb095ba,_0xdae3('0x1d'));_0x2bb755(_0x165648[_0xdae3('0x24')][_0xdae3('0x23')]);}})[_0xdae3('0x25')](function(_0x528ede){logger[_0xdae3('0x21')](_0xdae3('0x1c'),_0xb095ba,_0x528ede);_0x1b8094(_0x528ede);});});}function respondWithStatusCode(_0x322914,_0xf4e130){_0xf4e130=_0xf4e130||0xcc;return function(_0x69e8c4){if(_0x69e8c4){return _0x322914[_0xdae3('0x26')](_0xf4e130);}return _0x322914[_0xdae3('0x27')](_0xf4e130)[_0xdae3('0x28')]();};}function respondWithResult(_0x26e7bd,_0x150c16){_0x150c16=_0x150c16||0xc8;return function(_0xc2e829){if(_0xc2e829){return _0x26e7bd['status'](_0x150c16)[_0xdae3('0x29')](_0xc2e829);}};}function respondWithFilteredResult(_0x3e6ee4,_0x720f12){return function(_0x2f376a){if(_0x2f376a){var _0x1852ae=_0x2f376a['count'],_0x36e040=_0x720f12[_0xdae3('0x2a')],_0x19262a=_0x720f12[_0xdae3('0x2a')]+_0x720f12[_0xdae3('0x2b')],_0x488992;if(_0x19262a>=_0x1852ae){_0x19262a=_0x1852ae;_0x488992=0xc8;}else{_0x488992=0xce;}_0x3e6ee4[_0xdae3('0x27')](_0x488992);return _0x3e6ee4[_0xdae3('0x2c')](_0xdae3('0x2d'),_0x36e040+'-'+_0x19262a+'/'+_0x1852ae)[_0xdae3('0x29')](_0x2f376a);}return null;};}function patchUpdates(_0x386120){return function(_0x274457){try{jsonpatch[_0xdae3('0x2e')](_0x274457,_0x386120,!![]);}catch(_0x4868cf){return BPromise['reject'](_0x4868cf);}return _0x274457[_0xdae3('0x2f')]();};}function saveUpdates(_0x55d08f,_0x4aa044){return function(_0x226b28){if(_0x226b28){return _0x226b28[_0xdae3('0x30')](_0x55d08f)[_0xdae3('0x1a')](function(_0x2c07e3){return _0x2c07e3;});}return null;};}function removeEntity(_0xc126a0,_0x115898){return function(_0x8ceaf9){if(_0x8ceaf9){return _0x8ceaf9[_0xdae3('0x31')]()[_0xdae3('0x1a')](function(){_0xc126a0[_0xdae3('0x27')](0xcc)[_0xdae3('0x28')]();});}};}function handleEntityNotFound(_0x3700dc,_0x110de9){return function(_0x58d224){if(!_0x58d224){_0x3700dc['sendStatus'](0x194);}return _0x58d224;};}function handleError(_0xbef9a1,_0x5d977b){_0x5d977b=_0x5d977b||0x1f4;return function(_0x3cadfb){logger[_0xdae3('0x21')](_0x3cadfb[_0xdae3('0x32')]);if(_0x3cadfb[_0xdae3('0x33')]){delete _0x3cadfb['name'];}_0xbef9a1[_0xdae3('0x27')](_0x5d977b)[_0xdae3('0x34')](_0x3cadfb);};}exports['index']=function(_0x4bdfca,_0x1217bd){var _0x3ce14b={},_0x44e2e9={},_0x56cc55={'count':0x0,'rows':[]};var _0x4c3830=db[_0xdae3('0x35')][_0xdae3('0x36')];_0x44e2e9[_0xdae3('0x37')]=_[_0xdae3('0x38')](_0x4c3830);_0x44e2e9[_0xdae3('0x39')]=_[_0xdae3('0x38')](_0x4bdfca[_0xdae3('0x39')]);_0x44e2e9[_0xdae3('0x3a')]=_[_0xdae3('0x3b')](_0x44e2e9['model'],_0x44e2e9['query']);_0x3ce14b[_0xdae3('0x3c')]=_[_0xdae3('0x3b')](_0x44e2e9[_0xdae3('0x37')],qs['fields'](_0x4bdfca[_0xdae3('0x39')]['fields']));_0x3ce14b[_0xdae3('0x3c')]=_0x3ce14b['attributes']['length']?_0x3ce14b['attributes']:_0x44e2e9[_0xdae3('0x37')];if(!_0x4bdfca['query']['hasOwnProperty'](_0xdae3('0x3d'))){_0x3ce14b['limit']=qs[_0xdae3('0x2b')](_0x4bdfca[_0xdae3('0x39')]['limit']);_0x3ce14b[_0xdae3('0x2a')]=qs[_0xdae3('0x2a')](_0x4bdfca[_0xdae3('0x39')][_0xdae3('0x2a')]);}_0x3ce14b[_0xdae3('0x3e')]=qs[_0xdae3('0x3f')](_0x4bdfca['query'][_0xdae3('0x3f')]);_0x3ce14b[_0xdae3('0x40')]=qs['filters'](_[_0xdae3('0x41')](_0x4bdfca[_0xdae3('0x39')],_0x44e2e9[_0xdae3('0x3a')]));if(_0x4bdfca[_0xdae3('0x39')][_0xdae3('0x42')]){_0x3ce14b[_0xdae3('0x40')]=_[_0xdae3('0x43')](_0x3ce14b[_0xdae3('0x40')],{'$or':_[_0xdae3('0x44')](_0x4c3830,function(_0x45af16){if(_0x45af16[_0xdae3('0x45')][_0xdae3('0x46')]!==_0xdae3('0x47')){var _0x29e423={};_0x29e423[_0x45af16['field']]={'$like':'%'+_0x4bdfca[_0xdae3('0x39')][_0xdae3('0x42')]+'%'};return _0x29e423;}})});}_0x3ce14b=_['merge']({},_0x3ce14b,_0x4bdfca[_0xdae3('0x48')]);var _0x2074f5={'where':_0x3ce14b[_0xdae3('0x40')]};return db[_0xdae3('0x35')]['count'](_0x2074f5)[_0xdae3('0x1a')](function(_0x2f9517){_0x56cc55[_0xdae3('0x49')]=_0x2f9517;if(_0x4bdfca[_0xdae3('0x39')][_0xdae3('0x4a')]){_0x3ce14b['include']=[{'all':!![]}];}return db[_0xdae3('0x35')][_0xdae3('0x4b')](_0x3ce14b);})[_0xdae3('0x1a')](function(_0x1a5722){_0x56cc55[_0xdae3('0x4c')]=_0x1a5722;return _0x56cc55;})['then'](respondWithFilteredResult(_0x1217bd,_0x3ce14b))[_0xdae3('0x25')](handleError(_0x1217bd,null));};exports[_0xdae3('0x4d')]=function(_0x471b57,_0x4f637a){var _0x3f590f={'raw':![],'where':{'id':_0x471b57[_0xdae3('0x4e')]['id']}},_0x4cc713={};_0x4cc713['model']=_[_0xdae3('0x38')](db[_0xdae3('0x35')][_0xdae3('0x36')]);_0x4cc713['query']=_[_0xdae3('0x38')](_0x471b57[_0xdae3('0x39')]);_0x4cc713[_0xdae3('0x3a')]=_[_0xdae3('0x3b')](_0x4cc713[_0xdae3('0x37')],_0x4cc713[_0xdae3('0x39')]);_0x3f590f[_0xdae3('0x3c')]=_['intersection'](_0x4cc713[_0xdae3('0x37')],qs[_0xdae3('0x4f')](_0x471b57[_0xdae3('0x39')][_0xdae3('0x4f')]));_0x3f590f['attributes']=_0x3f590f[_0xdae3('0x3c')]['length']?_0x3f590f['attributes']:_0x4cc713[_0xdae3('0x37')];if(_0x471b57[_0xdae3('0x39')]['includeAll']){_0x3f590f['include']=[{'all':!![]}];}_0x3f590f=_[_0xdae3('0x43')]({},_0x3f590f,_0x471b57[_0xdae3('0x48')]);return db[_0xdae3('0x35')][_0xdae3('0x50')](_0x3f590f)[_0xdae3('0x1a')](handleEntityNotFound(_0x4f637a,null))['then'](respondWithResult(_0x4f637a,null))['catch'](handleError(_0x4f637a,null));};exports[_0xdae3('0x51')]=function(_0x91f44,_0x34426e){return db['ZendeskAccount'][_0xdae3('0x51')](_0x91f44[_0xdae3('0x52')],{})[_0xdae3('0x1a')](respondWithResult(_0x34426e,0xc9))[_0xdae3('0x25')](handleError(_0x34426e,null));};exports['update']=function(_0x1d5265,_0x38fb4e){if(_0x1d5265[_0xdae3('0x52')]['id']){delete _0x1d5265[_0xdae3('0x52')]['id'];}return db[_0xdae3('0x35')]['find']({'where':{'id':_0x1d5265[_0xdae3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x38fb4e,null))['then'](saveUpdates(_0x1d5265[_0xdae3('0x52')],null))[_0xdae3('0x1a')](respondWithResult(_0x38fb4e,null))[_0xdae3('0x25')](handleError(_0x38fb4e,null));};exports[_0xdae3('0x31')]=function(_0x4fe1a8,_0x5dbdee){return db[_0xdae3('0x35')]['find']({'where':{'id':_0x4fe1a8[_0xdae3('0x4e')]['id']}})[_0xdae3('0x1a')](handleEntityNotFound(_0x5dbdee,null))[_0xdae3('0x1a')](removeEntity(_0x5dbdee,null))[_0xdae3('0x25')](handleError(_0x5dbdee,null));};exports[_0xdae3('0x53')]=function(_0x455d84,_0x3b3d81,_0x5f16ad){var _0x4b505c={};var _0x1d1e1b={};var _0x17377b;var _0xfe8579;return db[_0xdae3('0x35')][_0xdae3('0x54')]({'where':{'id':_0x455d84['params']['id']}})[_0xdae3('0x1a')](handleEntityNotFound(_0x3b3d81,null))[_0xdae3('0x1a')](function(_0x305ec5){if(_0x305ec5){_0x17377b=_0x305ec5;_0x1d1e1b[_0xdae3('0x37')]=_[_0xdae3('0x38')](db[_0xdae3('0x55')][_0xdae3('0x36')]);_0x1d1e1b[_0xdae3('0x39')]=_[_0xdae3('0x38')](_0x455d84[_0xdae3('0x39')]);_0x1d1e1b['filters']=_[_0xdae3('0x3b')](_0x1d1e1b[_0xdae3('0x37')],_0x1d1e1b[_0xdae3('0x39')]);_0x4b505c[_0xdae3('0x3c')]=_[_0xdae3('0x3b')](_0x1d1e1b[_0xdae3('0x37')],qs[_0xdae3('0x4f')](_0x455d84[_0xdae3('0x39')][_0xdae3('0x4f')]));_0x4b505c['attributes']=_0x4b505c[_0xdae3('0x3c')][_0xdae3('0x56')]?_0x4b505c[_0xdae3('0x3c')]:_0x1d1e1b[_0xdae3('0x37')];_0x4b505c[_0xdae3('0x3e')]=qs[_0xdae3('0x3f')](_0x455d84[_0xdae3('0x39')][_0xdae3('0x3f')]);_0x4b505c['where']=qs[_0xdae3('0x3a')](_['pick'](_0x455d84['query'],_0x1d1e1b[_0xdae3('0x3a')]));if(_0x455d84[_0xdae3('0x39')]['filter']){_0x4b505c['where']=_[_0xdae3('0x43')](_0x4b505c[_0xdae3('0x40')],{'$or':_[_0xdae3('0x44')](_0x4b505c[_0xdae3('0x3c')],function(_0x1774de){var _0x52e13b={};_0x52e13b[_0x1774de]={'$like':'%'+_0x455d84[_0xdae3('0x39')]['filter']+'%'};return _0x52e13b;})});}_0x4b505c=_[_0xdae3('0x43')]({},_0x4b505c,_0x455d84[_0xdae3('0x48')]);return _0x17377b['getConfigurations'](_0x4b505c);}})[_0xdae3('0x1a')](function(_0x29129a){if(_0x29129a){_0xfe8579=_0x29129a[_0xdae3('0x56')];if(!_0x455d84[_0xdae3('0x39')]['hasOwnProperty'](_0xdae3('0x3d'))){_0x4b505c[_0xdae3('0x2b')]=qs[_0xdae3('0x2b')](_0x455d84[_0xdae3('0x39')][_0xdae3('0x2b')]);_0x4b505c['offset']=qs[_0xdae3('0x2a')](_0x455d84[_0xdae3('0x39')][_0xdae3('0x2a')]);}return _0x17377b[_0xdae3('0x53')](_0x4b505c);}})['then'](function(_0x2e7e9d){if(_0x2e7e9d){return _0x2e7e9d?{'count':_0xfe8579,'rows':_0x2e7e9d}:null;}})[_0xdae3('0x1a')](respondWithResult(_0x3b3d81,null))[_0xdae3('0x25')](handleError(_0x3b3d81,null));};exports[_0xdae3('0x57')]=function(_0x537e91,_0x3c07ab,_0x1817b6){if(_0x537e91[_0xdae3('0x52')]['id']){delete _0x537e91['body']['id'];}return db[_0xdae3('0x35')][_0xdae3('0x54')]({'where':{'id':_0x537e91['params']['id']}})[_0xdae3('0x1a')](handleEntityNotFound(_0x3c07ab,null))[_0xdae3('0x1a')](function(_0xac95){if(_0xac95){_0x537e91[_0xdae3('0x52')]['AccountId']=_0xac95['id'];_0x537e91['body'][_0xdae3('0x58')]=integrations[_0xdae3('0x59')](_0x537e91[_0xdae3('0x52')][_0xdae3('0x5a')],_0x537e91[_0xdae3('0x52')][_0xdae3('0x45')]);_0x537e91['body'][_0xdae3('0x5b')]=integrations['getDescriptions'](_0x537e91[_0xdae3('0x52')][_0xdae3('0x5a')],_0x537e91['body'][_0xdae3('0x45')]);return db[_0xdae3('0x55')][_0xdae3('0x51')](_0x537e91['body'],{'include':[{'model':db[_0xdae3('0x5c')],'as':_0xdae3('0x58')},{'model':db['ZendeskField'],'as':_0xdae3('0x5b')}]});}return null;})['then'](respondWithResult(_0x3c07ab,null))[_0xdae3('0x25')](handleError(_0x3c07ab,null));};exports[_0xdae3('0x5d')]=function(_0x2be1a4,_0x2c8ff3,_0x1e17cb){var _0x1d9c31='';return db[_0xdae3('0x35')][_0xdae3('0x54')]({'where':{'id':_0x2be1a4[_0xdae3('0x4e')]['id']},'attributes':['id',_0xdae3('0x5e'),'password',_0xdae3('0x5f'),'authType',_0xdae3('0x60')]})[_0xdae3('0x1a')](handleEntityNotFound(_0x2c8ff3,null))['then'](function(_0x352c92){if(_0x352c92){_0x1d9c31=_0x352c92[_0xdae3('0x60')];var _0x224b3a=_0x1d9c31[_0xdae3('0x61')](-0x1);if(_0x224b3a==='/'){_0x1d9c31=_0x1d9c31[_0xdae3('0x62')](0x0,_0x1d9c31['lastIndexOf'](_0x224b3a));}var _0x37ab47={'method':'GET','uri':util[_0xdae3('0x63')](_0xdae3('0x64'),_0x1d9c31,_0xdae3('0x65')),'json':!![]};switch(_0x352c92['authType']){case _0xdae3('0x66'):_0x37ab47[_0xdae3('0x67')]={'Authorization':util['format'](_0xdae3('0x68'),new Buffer(util[_0xdae3('0x63')](_0xdae3('0x69'),_0x352c92[_0xdae3('0x5e')],_0x352c92['password']))['toString'](_0xdae3('0x6a')))};break;case _0xdae3('0x5f'):_0x37ab47[_0xdae3('0x67')]={'Authorization':util[_0xdae3('0x63')](_0xdae3('0x68'),new Buffer(util[_0xdae3('0x63')](_0xdae3('0x6b'),_0x352c92[_0xdae3('0x5e')],_0x352c92[_0xdae3('0x5f')]))[_0xdae3('0x6c')]('base64'))};break;default:throw new db[(_0xdae3('0x6d'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x37ab47);}})[_0xdae3('0x1a')](function(_0x31bb6a){if(_0x31bb6a){var _0x2cee7a=[_0xdae3('0x6e'),'description','group',_0xdae3('0x6f')];_[_0xdae3('0x70')](_0x31bb6a[_0xdae3('0x65')],function(_0x2fdf64){return _0x2cee7a[_0xdae3('0x71')](_0x2fdf64[_0xdae3('0x45')]);});return{'count':_0x31bb6a['ticket_fields'][_0xdae3('0x56')],'rows':_[_0xdae3('0x44')](_0x31bb6a[_0xdae3('0x65')],function(_0x4262f1){return{'id':_0x4262f1['id'],'name':_0x4262f1[_0xdae3('0x72')]>0x7?_0x4262f1['title']:_0x4262f1[_0xdae3('0x45')],'custom':_0x4262f1[_0xdae3('0x72')]>0x7?!![]:![],'options':_0x4262f1['system_field_options']?_0x4262f1[_0xdae3('0x73')]:_0x4262f1[_0xdae3('0x74')]?_0x4262f1[_0xdae3('0x74')]:[]};})};}})[_0xdae3('0x1a')](respondWithResult(_0x2c8ff3,null))[_0xdae3('0x25')](function(_0x3c2cd6){var _0x44bbdb=_0x2be1a4[_0xdae3('0x39')][_0xdae3('0x18')]?0x1f4:_0x3c2cd6[_0xdae3('0x75')]||0x1f4;logger['error'](_0xdae3('0x76'),_0xdae3('0x5d'),_0x44bbdb,JSON[_0xdae3('0x20')](_0x3c2cd6));delete _0x3c2cd6['name'];if(_0x44bbdb===0x191){_0x44bbdb=0x190;}_0x2c8ff3['status'](_0x44bbdb)[_0xdae3('0x34')](_0x2be1a4['query']['test']?{'message':_0xdae3('0x77'),'statusCode':_0x3c2cd6['statusCode']}:_0x3c2cd6);});}; \ No newline at end of file +var _0xbbf5=['system_field_options','custom_field_options','test','statusCode','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','name','send','index','ZendeskAccount','rawAttributes','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','pick','where','merge','map','key','field','filter','includeAll','include','findAll','rows','show','params','options','find','create','body','destroy','getConfigurations','ZendeskConfiguration','order','addConfiguration','findOne','AccountId','channel','type','Descriptions','getDescriptions','Subjects','ZendeskField','getFields','username','password','token','remoteUri','slice','substring','lastIndexOf','%s/%s','ticket_fields','authType','headers','format','Basic\x20%s','%s:%s','toString','base64','Sequelize','Unknown\x20authentication\x20type','subject','assignee','includes','position'];(function(_0x2bced3,_0x59c962){var _0x5d9a81=function(_0x3a0741){while(--_0x3a0741){_0x2bced3['push'](_0x2bced3['shift']());}};_0x5d9a81(++_0x59c962);}(_0xbbf5,0x1f1));var _0x5bbf=function(_0x68c0b0,_0xbee36c){_0x68c0b0=_0x68c0b0-0x0;var _0x5c9f10=_0xbbf5[_0x68c0b0];return _0x5c9f10;};'use strict';var pdf=require(_0x5bbf('0x0'));var emlformat=require(_0x5bbf('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5bbf('0x2'));var jsonpatch=require(_0x5bbf('0x3'));var rp=require('request-promise');var moment=require(_0x5bbf('0x4'));var BPromise=require(_0x5bbf('0x5'));var Mustache=require(_0x5bbf('0x6'));var util=require(_0x5bbf('0x7'));var path=require(_0x5bbf('0x8'));var sox=require(_0x5bbf('0x9'));var csv=require(_0x5bbf('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5bbf('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5bbf('0xc'));var deskjs=require(_0x5bbf('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5bbf('0xe'));var Redis=require(_0x5bbf('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5bbf('0x10'));var hardwareService=require(_0x5bbf('0x11'));var logger=require(_0x5bbf('0x12'))(_0x5bbf('0x13'));var utils=require('../../config/utils');var config=require(_0x5bbf('0x14'));var db=require(_0x5bbf('0x15'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x5bbf('0x16')][_0x5bbf('0x17')]({'port':0x232a});function checkPasswordPattern(_0x50a1ab,_0x5369f8,_0x3059ed){if(_0x3059ed){var _0x54ee20=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x54ee20['test'](_0x5369f8)){return _0x50a1ab;}else{throw new Error(_0x5bbf('0x18'));}}else{return _0x50a1ab;}}function respondWithRpcPromise(_0x4c7b0f,_0x208d16,_0x5290cf,_0x646b8c){return new BPromise(function(_0x5d8820,_0x2c2880){var _0x270b91=_0x646b8c||client;return _0x270b91[_0x5bbf('0x19')](_0x4c7b0f,_0x5290cf)[_0x5bbf('0x1a')](function(_0x1d670a){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x208d16,'request\x20sent');logger[_0x5bbf('0x1b')](_0x5bbf('0x1c'),_0x208d16,_0x5bbf('0x1d'),JSON[_0x5bbf('0x1e')](_0x1d670a));if(_0x1d670a[_0x5bbf('0x1f')]){if(_0x1d670a[_0x5bbf('0x1f')][_0x5bbf('0x20')]===0x1f4){logger['error'](_0x5bbf('0x21'),_0x208d16,_0x1d670a[_0x5bbf('0x1f')][_0x5bbf('0x22')]);return _0x2c2880(_0x1d670a['error']['message']);}logger[_0x5bbf('0x1f')](_0x5bbf('0x21'),_0x208d16,_0x1d670a[_0x5bbf('0x1f')][_0x5bbf('0x22')]);return _0x5d8820(_0x1d670a[_0x5bbf('0x1f')]['message']);}else{logger[_0x5bbf('0x23')](_0x5bbf('0x21'),_0x208d16,_0x5bbf('0x1d'));_0x5d8820(_0x1d670a['result'][_0x5bbf('0x22')]);}})[_0x5bbf('0x24')](function(_0x5aeef2){logger[_0x5bbf('0x1f')](_0x5bbf('0x21'),_0x208d16,_0x5aeef2);_0x2c2880(_0x5aeef2);});});}function respondWithStatusCode(_0x3d807d,_0x115d58){_0x115d58=_0x115d58||0xcc;return function(_0x1450e0){if(_0x1450e0){return _0x3d807d[_0x5bbf('0x25')](_0x115d58);}return _0x3d807d[_0x5bbf('0x26')](_0x115d58)[_0x5bbf('0x27')]();};}function respondWithResult(_0x34c634,_0x19e16e){_0x19e16e=_0x19e16e||0xc8;return function(_0x376843){if(_0x376843){return _0x34c634[_0x5bbf('0x26')](_0x19e16e)[_0x5bbf('0x28')](_0x376843);}};}function respondWithFilteredResult(_0xf8899d,_0x36adfb){return function(_0x1306c0){if(_0x1306c0){var _0x37dc7f=_0x1306c0['count'],_0x4e3e1c=_0x36adfb[_0x5bbf('0x29')],_0x5b470d=_0x36adfb['offset']+_0x36adfb[_0x5bbf('0x2a')],_0x35b5f1;if(_0x5b470d>=_0x37dc7f){_0x5b470d=_0x37dc7f;_0x35b5f1=0xc8;}else{_0x35b5f1=0xce;}_0xf8899d[_0x5bbf('0x26')](_0x35b5f1);return _0xf8899d[_0x5bbf('0x2b')](_0x5bbf('0x2c'),_0x4e3e1c+'-'+_0x5b470d+'/'+_0x37dc7f)[_0x5bbf('0x28')](_0x1306c0);}return null;};}function patchUpdates(_0x3bb53e){return function(_0x4d871e){try{jsonpatch[_0x5bbf('0x2d')](_0x4d871e,_0x3bb53e,!![]);}catch(_0x5745fe){return BPromise[_0x5bbf('0x2e')](_0x5745fe);}return _0x4d871e[_0x5bbf('0x2f')]();};}function saveUpdates(_0x36cafd,_0x3a9fdb){return function(_0x4499f5){if(_0x4499f5){return _0x4499f5[_0x5bbf('0x30')](_0x36cafd)[_0x5bbf('0x1a')](function(_0x56e1f8){return _0x56e1f8;});}return null;};}function removeEntity(_0x27e77e,_0x41a65e){return function(_0x4f3fc7){if(_0x4f3fc7){return _0x4f3fc7['destroy']()[_0x5bbf('0x1a')](function(){_0x27e77e[_0x5bbf('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4abf3c,_0x2c13d2){return function(_0x41d03b){if(!_0x41d03b){_0x4abf3c[_0x5bbf('0x25')](0x194);}return _0x41d03b;};}function handleError(_0x1e248f,_0xa3a273){_0xa3a273=_0xa3a273||0x1f4;return function(_0xd62788){logger[_0x5bbf('0x1f')](_0xd62788['stack']);if(_0xd62788['name']){delete _0xd62788[_0x5bbf('0x31')];}_0x1e248f[_0x5bbf('0x26')](_0xa3a273)[_0x5bbf('0x32')](_0xd62788);};}exports[_0x5bbf('0x33')]=function(_0x5e2d2b,_0x298268){var _0x47e367={},_0x29821b={},_0x551572={'count':0x0,'rows':[]};var _0x129064=db[_0x5bbf('0x34')][_0x5bbf('0x35')];_0x29821b['model']=_[_0x5bbf('0x36')](_0x129064);_0x29821b[_0x5bbf('0x37')]=_[_0x5bbf('0x36')](_0x5e2d2b[_0x5bbf('0x37')]);_0x29821b[_0x5bbf('0x38')]=_[_0x5bbf('0x39')](_0x29821b['model'],_0x29821b[_0x5bbf('0x37')]);_0x47e367[_0x5bbf('0x3a')]=_[_0x5bbf('0x39')](_0x29821b['model'],qs['fields'](_0x5e2d2b['query'][_0x5bbf('0x3b')]));_0x47e367[_0x5bbf('0x3a')]=_0x47e367[_0x5bbf('0x3a')][_0x5bbf('0x3c')]?_0x47e367['attributes']:_0x29821b[_0x5bbf('0x3d')];if(!_0x5e2d2b[_0x5bbf('0x37')][_0x5bbf('0x3e')](_0x5bbf('0x3f'))){_0x47e367[_0x5bbf('0x2a')]=qs[_0x5bbf('0x2a')](_0x5e2d2b[_0x5bbf('0x37')]['limit']);_0x47e367['offset']=qs[_0x5bbf('0x29')](_0x5e2d2b[_0x5bbf('0x37')][_0x5bbf('0x29')]);}_0x47e367['order']=qs['sort'](_0x5e2d2b[_0x5bbf('0x37')][_0x5bbf('0x40')]);_0x47e367['where']=qs['filters'](_[_0x5bbf('0x41')](_0x5e2d2b['query'],_0x29821b['filters']));if(_0x5e2d2b['query']['filter']){_0x47e367[_0x5bbf('0x42')]=_[_0x5bbf('0x43')](_0x47e367[_0x5bbf('0x42')],{'$or':_[_0x5bbf('0x44')](_0x129064,function(_0x459e7c){if(_0x459e7c['type'][_0x5bbf('0x45')]!=='VIRTUAL'){var _0x41e1d2={};_0x41e1d2[_0x459e7c[_0x5bbf('0x46')]]={'$like':'%'+_0x5e2d2b[_0x5bbf('0x37')][_0x5bbf('0x47')]+'%'};return _0x41e1d2;}})});}_0x47e367=_[_0x5bbf('0x43')]({},_0x47e367,_0x5e2d2b['options']);var _0x11a012={'where':_0x47e367[_0x5bbf('0x42')]};return db[_0x5bbf('0x34')]['count'](_0x11a012)[_0x5bbf('0x1a')](function(_0x3cb62e){_0x551572['count']=_0x3cb62e;if(_0x5e2d2b[_0x5bbf('0x37')][_0x5bbf('0x48')]){_0x47e367[_0x5bbf('0x49')]=[{'all':!![]}];}return db[_0x5bbf('0x34')][_0x5bbf('0x4a')](_0x47e367);})[_0x5bbf('0x1a')](function(_0xa42c4b){_0x551572[_0x5bbf('0x4b')]=_0xa42c4b;return _0x551572;})[_0x5bbf('0x1a')](respondWithFilteredResult(_0x298268,_0x47e367))['catch'](handleError(_0x298268,null));};exports[_0x5bbf('0x4c')]=function(_0x52c56a,_0x544a67){var _0x2bc23d={'raw':![],'where':{'id':_0x52c56a[_0x5bbf('0x4d')]['id']}},_0x187956={};_0x187956['model']=_[_0x5bbf('0x36')](db[_0x5bbf('0x34')][_0x5bbf('0x35')]);_0x187956[_0x5bbf('0x37')]=_[_0x5bbf('0x36')](_0x52c56a[_0x5bbf('0x37')]);_0x187956[_0x5bbf('0x38')]=_[_0x5bbf('0x39')](_0x187956[_0x5bbf('0x3d')],_0x187956[_0x5bbf('0x37')]);_0x2bc23d[_0x5bbf('0x3a')]=_[_0x5bbf('0x39')](_0x187956[_0x5bbf('0x3d')],qs[_0x5bbf('0x3b')](_0x52c56a[_0x5bbf('0x37')]['fields']));_0x2bc23d['attributes']=_0x2bc23d[_0x5bbf('0x3a')]['length']?_0x2bc23d['attributes']:_0x187956[_0x5bbf('0x3d')];if(_0x52c56a['query']['includeAll']){_0x2bc23d[_0x5bbf('0x49')]=[{'all':!![]}];}_0x2bc23d=_[_0x5bbf('0x43')]({},_0x2bc23d,_0x52c56a[_0x5bbf('0x4e')]);return db[_0x5bbf('0x34')][_0x5bbf('0x4f')](_0x2bc23d)[_0x5bbf('0x1a')](handleEntityNotFound(_0x544a67,null))[_0x5bbf('0x1a')](respondWithResult(_0x544a67,null))[_0x5bbf('0x24')](handleError(_0x544a67,null));};exports['create']=function(_0x5d94c3,_0x5e8615){return db[_0x5bbf('0x34')][_0x5bbf('0x50')](_0x5d94c3['body'],{})['then'](respondWithResult(_0x5e8615,0xc9))[_0x5bbf('0x24')](handleError(_0x5e8615,null));};exports['update']=function(_0x272020,_0x20e055){if(_0x272020[_0x5bbf('0x51')]['id']){delete _0x272020[_0x5bbf('0x51')]['id'];}return db[_0x5bbf('0x34')][_0x5bbf('0x4f')]({'where':{'id':_0x272020[_0x5bbf('0x4d')]['id']}})[_0x5bbf('0x1a')](handleEntityNotFound(_0x20e055,null))[_0x5bbf('0x1a')](saveUpdates(_0x272020[_0x5bbf('0x51')],null))[_0x5bbf('0x1a')](respondWithResult(_0x20e055,null))[_0x5bbf('0x24')](handleError(_0x20e055,null));};exports[_0x5bbf('0x52')]=function(_0x2b9dfe,_0x164383){return db[_0x5bbf('0x34')][_0x5bbf('0x4f')]({'where':{'id':_0x2b9dfe[_0x5bbf('0x4d')]['id']}})[_0x5bbf('0x1a')](handleEntityNotFound(_0x164383,null))[_0x5bbf('0x1a')](removeEntity(_0x164383,null))['catch'](handleError(_0x164383,null));};exports[_0x5bbf('0x53')]=function(_0x4493e8,_0x159048,_0x29c391){var _0xc69591={};var _0x4a9748={};var _0x4e78cd;var _0x3e219e;return db[_0x5bbf('0x34')]['findOne']({'where':{'id':_0x4493e8['params']['id']}})['then'](handleEntityNotFound(_0x159048,null))[_0x5bbf('0x1a')](function(_0x3ca798){if(_0x3ca798){_0x4e78cd=_0x3ca798;_0x4a9748['model']=_[_0x5bbf('0x36')](db[_0x5bbf('0x54')]['rawAttributes']);_0x4a9748['query']=_[_0x5bbf('0x36')](_0x4493e8[_0x5bbf('0x37')]);_0x4a9748[_0x5bbf('0x38')]=_[_0x5bbf('0x39')](_0x4a9748[_0x5bbf('0x3d')],_0x4a9748[_0x5bbf('0x37')]);_0xc69591[_0x5bbf('0x3a')]=_[_0x5bbf('0x39')](_0x4a9748[_0x5bbf('0x3d')],qs[_0x5bbf('0x3b')](_0x4493e8[_0x5bbf('0x37')][_0x5bbf('0x3b')]));_0xc69591[_0x5bbf('0x3a')]=_0xc69591['attributes'][_0x5bbf('0x3c')]?_0xc69591[_0x5bbf('0x3a')]:_0x4a9748[_0x5bbf('0x3d')];_0xc69591[_0x5bbf('0x55')]=qs[_0x5bbf('0x40')](_0x4493e8['query'][_0x5bbf('0x40')]);_0xc69591[_0x5bbf('0x42')]=qs[_0x5bbf('0x38')](_[_0x5bbf('0x41')](_0x4493e8[_0x5bbf('0x37')],_0x4a9748[_0x5bbf('0x38')]));if(_0x4493e8[_0x5bbf('0x37')][_0x5bbf('0x47')]){_0xc69591[_0x5bbf('0x42')]=_[_0x5bbf('0x43')](_0xc69591[_0x5bbf('0x42')],{'$or':_[_0x5bbf('0x44')](_0xc69591[_0x5bbf('0x3a')],function(_0x3e2aea){var _0x171db9={};_0x171db9[_0x3e2aea]={'$like':'%'+_0x4493e8[_0x5bbf('0x37')]['filter']+'%'};return _0x171db9;})});}_0xc69591=_[_0x5bbf('0x43')]({},_0xc69591,_0x4493e8[_0x5bbf('0x4e')]);return _0x4e78cd[_0x5bbf('0x53')](_0xc69591);}})[_0x5bbf('0x1a')](function(_0xc36cfb){if(_0xc36cfb){_0x3e219e=_0xc36cfb['length'];if(!_0x4493e8[_0x5bbf('0x37')]['hasOwnProperty'](_0x5bbf('0x3f'))){_0xc69591[_0x5bbf('0x2a')]=qs['limit'](_0x4493e8[_0x5bbf('0x37')][_0x5bbf('0x2a')]);_0xc69591[_0x5bbf('0x29')]=qs[_0x5bbf('0x29')](_0x4493e8[_0x5bbf('0x37')]['offset']);}return _0x4e78cd[_0x5bbf('0x53')](_0xc69591);}})['then'](function(_0x8617f5){if(_0x8617f5){return _0x8617f5?{'count':_0x3e219e,'rows':_0x8617f5}:null;}})[_0x5bbf('0x1a')](respondWithResult(_0x159048,null))[_0x5bbf('0x24')](handleError(_0x159048,null));};exports[_0x5bbf('0x56')]=function(_0x17961f,_0x5c0569,_0x1164a7){if(_0x17961f[_0x5bbf('0x51')]['id']){delete _0x17961f[_0x5bbf('0x51')]['id'];}return db['ZendeskAccount'][_0x5bbf('0x57')]({'where':{'id':_0x17961f[_0x5bbf('0x4d')]['id']}})[_0x5bbf('0x1a')](handleEntityNotFound(_0x5c0569,null))['then'](function(_0x38e1df){if(_0x38e1df){_0x17961f[_0x5bbf('0x51')][_0x5bbf('0x58')]=_0x38e1df['id'];_0x17961f[_0x5bbf('0x51')]['Subjects']=integrations['getSubjects'](_0x17961f[_0x5bbf('0x51')][_0x5bbf('0x59')],_0x17961f[_0x5bbf('0x51')][_0x5bbf('0x5a')]);_0x17961f[_0x5bbf('0x51')][_0x5bbf('0x5b')]=integrations[_0x5bbf('0x5c')](_0x17961f[_0x5bbf('0x51')]['channel'],_0x17961f[_0x5bbf('0x51')][_0x5bbf('0x5a')]);return db[_0x5bbf('0x54')][_0x5bbf('0x50')](_0x17961f[_0x5bbf('0x51')],{'include':[{'model':db['ZendeskField'],'as':_0x5bbf('0x5d')},{'model':db[_0x5bbf('0x5e')],'as':_0x5bbf('0x5b')}]});}return null;})[_0x5bbf('0x1a')](respondWithResult(_0x5c0569,null))[_0x5bbf('0x24')](handleError(_0x5c0569,null));};exports[_0x5bbf('0x5f')]=function(_0x1cb301,_0x36db98,_0x22f575){var _0x1d1a04='';return db[_0x5bbf('0x34')][_0x5bbf('0x57')]({'where':{'id':_0x1cb301[_0x5bbf('0x4d')]['id']},'attributes':['id',_0x5bbf('0x60'),_0x5bbf('0x61'),_0x5bbf('0x62'),'authType',_0x5bbf('0x63')]})[_0x5bbf('0x1a')](handleEntityNotFound(_0x36db98,null))[_0x5bbf('0x1a')](function(_0x2bc177){if(_0x2bc177){_0x1d1a04=_0x2bc177[_0x5bbf('0x63')];var _0xf617=_0x1d1a04[_0x5bbf('0x64')](-0x1);if(_0xf617==='/'){_0x1d1a04=_0x1d1a04[_0x5bbf('0x65')](0x0,_0x1d1a04[_0x5bbf('0x66')](_0xf617));}var _0x1468bd={'method':'GET','uri':util['format'](_0x5bbf('0x67'),_0x1d1a04,_0x5bbf('0x68')),'json':!![]};switch(_0x2bc177[_0x5bbf('0x69')]){case _0x5bbf('0x61'):_0x1468bd[_0x5bbf('0x6a')]={'Authorization':util[_0x5bbf('0x6b')](_0x5bbf('0x6c'),new Buffer(util[_0x5bbf('0x6b')](_0x5bbf('0x6d'),_0x2bc177['username'],_0x2bc177[_0x5bbf('0x61')]))[_0x5bbf('0x6e')](_0x5bbf('0x6f')))};break;case _0x5bbf('0x62'):_0x1468bd[_0x5bbf('0x6a')]={'Authorization':util['format'](_0x5bbf('0x6c'),new Buffer(util['format']('%s/token:%s',_0x2bc177['username'],_0x2bc177['token']))['toString'](_0x5bbf('0x6f')))};break;default:throw new db[(_0x5bbf('0x70'))]['ValidationError'](_0x5bbf('0x71'));}return rp(_0x1468bd);}})[_0x5bbf('0x1a')](function(_0x34695e){if(_0x34695e){var _0x5a38f1=[_0x5bbf('0x72'),'description','group',_0x5bbf('0x73')];_['remove'](_0x34695e[_0x5bbf('0x68')],function(_0x3c1cdb){return _0x5a38f1[_0x5bbf('0x74')](_0x3c1cdb[_0x5bbf('0x5a')]);});return{'count':_0x34695e[_0x5bbf('0x68')][_0x5bbf('0x3c')],'rows':_['map'](_0x34695e['ticket_fields'],function(_0x21096b){return{'id':_0x21096b['id'],'name':_0x21096b[_0x5bbf('0x75')]>0x7?_0x21096b['title']:_0x21096b[_0x5bbf('0x5a')],'custom':_0x21096b[_0x5bbf('0x75')]>0x7?!![]:![],'options':_0x21096b[_0x5bbf('0x76')]?_0x21096b[_0x5bbf('0x76')]:_0x21096b[_0x5bbf('0x77')]?_0x21096b['custom_field_options']:[]};})};}})[_0x5bbf('0x1a')](respondWithResult(_0x36db98,null))[_0x5bbf('0x24')](function(_0x417a63){var _0x2458c8=_0x1cb301['query'][_0x5bbf('0x78')]?0x1f4:_0x417a63[_0x5bbf('0x79')]||0x1f4;logger[_0x5bbf('0x1f')]('getFields,\x20%s,\x20%s,\x20%s',_0x5bbf('0x5f'),_0x2458c8,JSON[_0x5bbf('0x1e')](_0x417a63));delete _0x417a63[_0x5bbf('0x31')];if(_0x2458c8===0x191){_0x2458c8=0x190;}_0x36db98[_0x5bbf('0x26')](_0x2458c8)[_0x5bbf('0x32')](_0x1cb301[_0x5bbf('0x37')]['test']?{'message':_0x5bbf('0x7a'),'statusCode':_0x417a63[_0x5bbf('0x79')]}:_0x417a63);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 32e37a0..8998b3d 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 _0xb810=['api','moment','bluebird','request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash','util','../../config/logger'];(function(_0x5064fb,_0x42f403){var _0x1b43f7=function(_0x8a77fb){while(--_0x8a77fb){_0x5064fb['push'](_0x5064fb['shift']());}};_0x1b43f7(++_0x42f403);}(_0xb810,0x14d));var _0x0b81=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xb810[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x0b81('0x0'));var util=require(_0x0b81('0x1'));var logger=require(_0x0b81('0x2'))(_0x0b81('0x3'));var moment=require(_0x0b81('0x4'));var BPromise=require(_0x0b81('0x5'));var rp=require(_0x0b81('0x6'));var fs=require('fs');var path=require(_0x0b81('0x7'));var rimraf=require('rimraf');var config=require(_0x0b81('0x8'));var attributes=require(_0x0b81('0x9'));var integrations=require(_0x0b81('0xa'));module[_0x0b81('0xb')]=function(_0x1ae9e2,_0x1c7390){return _0x1ae9e2[_0x0b81('0xc')]('ZendeskAccount',attributes,{'tableName':_0x0b81('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe8e=['path','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger','api','request-promise'];(function(_0x858a0d,_0x232926){var _0x183128=function(_0x119245){while(--_0x119245){_0x858a0d['push'](_0x858a0d['shift']());}};_0x183128(++_0x232926);}(_0xfe8e,0x1f0));var _0xefe8=function(_0x59145a,_0x1f60f1){_0x59145a=_0x59145a-0x0;var _0xf04d7=_0xfe8e[_0x59145a];return _0xf04d7;};'use strict';var _=require('lodash');var util=require(_0xefe8('0x0'));var logger=require(_0xefe8('0x1'))(_0xefe8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xefe8('0x3'));var fs=require('fs');var path=require(_0xefe8('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xefe8('0x5'));module[_0xefe8('0x6')]=function(_0x221c0e,_0x3c61c3){return _0x221c0e[_0xefe8('0x7')](_0xefe8('0x8'),attributes,{'tableName':_0xefe8('0x9'),'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 8c31c07..86217a0 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 _0x757a=['stringify','error','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','map','model','ShowZendeskAccount','find','raw','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4c450b,_0x43b742){var _0x3d6168=function(_0x56fda9){while(--_0x56fda9){_0x4c450b['push'](_0x4c450b['shift']());}};_0x3d6168(++_0x43b742);}(_0x757a,0xde));var _0xa757=function(_0x196664,_0xa77af2){_0x196664=_0x196664-0x0;var _0x2a1de2=_0x757a[_0x196664];return _0x2a1de2;};'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']('ZendeskAccount,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('ZendeskAccount,\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']('GetZendeskAccount',_0x4d9f58);logger['debug']('GetZendeskAccount',_0x4d9f58,JSON[_0xa757('0x10')](_0x449a7d));_0x151c04(_0x449a7d);})['catch'](function(_0x2208f9){logger[_0xa757('0x11')]('GetZendeskAccount',_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 +var _0xb7e7=['request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','limit','include','map','model','ShowZendeskAccount','find','where','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http'];(function(_0x2a6fca,_0x53981d){var _0x41cd42=function(_0x10379e){while(--_0x10379e){_0x2a6fca['push'](_0x2a6fca['shift']());}};_0x41cd42(++_0x53981d);}(_0xb7e7,0x121));var _0x7b7e=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xb7e7[_0xe66cf2];return _0x2d84e7;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});}exports[_0x7b7e('0x14')]=function(_0x242368){var _0x200ef7=this;return new Promise(function(_0x2acb8c,_0x429a0e){return db[_0x7b7e('0x15')][_0x7b7e('0x16')]({'raw':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x18')]===undefined?!![]:![]:!![],'where':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')]['where']||null:null,'attributes':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x19')]||null:null,'limit':_0x242368['options']?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1a')]||null:null,'include':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1b')],function(_0x53bbb3){return{'model':db[_0x53bbb3['model']],'as':_0x53bbb3['as'],'attributes':_0x53bbb3['attributes'],'include':_0x53bbb3[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x53bbb3[_0x7b7e('0x1b')],function(_0x483c6f){return{'model':db[_0x483c6f['model']],'as':_0x483c6f['as'],'attributes':_0x483c6f['attributes'],'include':_0x483c6f[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x483c6f[_0x7b7e('0x1b')],function(_0x7aa71){return{'model':db[_0x7aa71[_0x7b7e('0x1d')]],'as':_0x7aa71['as'],'attributes':_0x7aa71['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b7e('0x9')](function(_0x21a15){logger['info']('GetZendeskAccount',_0x242368);logger['debug'](_0x7b7e('0x14'),_0x242368,JSON[_0x7b7e('0xf')](_0x21a15));_0x2acb8c(_0x21a15);})['catch'](function(_0x3db8c4){logger['error'](_0x7b7e('0x14'),_0x3db8c4[_0x7b7e('0x12')],_0x242368);_0x429a0e(_0x200ef7[_0x7b7e('0x10')](0x1f4,_0x3db8c4['message']));});});};exports[_0x7b7e('0x1e')]=function(_0xe31336){var _0x35602a=this;return new Promise(function(_0x326dd2,_0x33f9a1){return db['ZendeskAccount'][_0x7b7e('0x1f')]({'raw':_0xe31336['options']?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x18')]===undefined?!![]:![]:!![],'where':_0xe31336[_0x7b7e('0x17')]?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x20')]||null:null,'attributes':_0xe31336[_0x7b7e('0x17')]?_0xe31336[_0x7b7e('0x17')]['attributes']||null:null,'include':_0xe31336['options']?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x1b')]?_['map'](_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x1b')],function(_0x2ca366){return{'model':db[_0x2ca366['model']],'as':_0x2ca366['as'],'attributes':_0x2ca366[_0x7b7e('0x19')],'include':_0x2ca366[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x2ca366[_0x7b7e('0x1b')],function(_0x31043a){return{'model':db[_0x31043a[_0x7b7e('0x1d')]],'as':_0x31043a['as'],'attributes':_0x31043a[_0x7b7e('0x19')],'include':_0x31043a[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x31043a[_0x7b7e('0x1b')],function(_0xd5a64d){return{'model':db[_0xd5a64d[_0x7b7e('0x1d')]],'as':_0xd5a64d['as'],'attributes':_0xd5a64d[_0x7b7e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7b7e('0x9')](function(_0x116563){logger[_0x7b7e('0xa')]('ShowZendeskAccount',_0xe31336);logger[_0x7b7e('0xc')](_0x7b7e('0x1e'),_0xe31336,JSON[_0x7b7e('0xf')](_0x116563));_0x326dd2(_0x116563);})[_0x7b7e('0x13')](function(_0x36abfc){logger[_0x7b7e('0x10')](_0x7b7e('0x1e'),_0x36abfc[_0x7b7e('0x12')],_0xe31336);_0x33f9a1(_0x35602a[_0x7b7e('0x10')](0x1f4,_0x36abfc[_0x7b7e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index efe03d0..56e8cca 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 _0x5720=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','create','setTags','put'];(function(_0x492a9f,_0x28752e){var _0xa72548=function(_0xf91b99){while(--_0xf91b99){_0x492a9f['push'](_0x492a9f['shift']());}};_0xa72548(++_0x28752e);}(_0x5720,0xb9));var _0x0572=function(_0x3937e7,_0x91712b){_0x3937e7=_0x3937e7-0x0;var _0x197ad7=_0x5720[_0x3937e7];return _0x197ad7;};'use strict';var multer=require(_0x0572('0x0'));var util=require(_0x0572('0x1'));var path=require(_0x0572('0x2'));var timeout=require(_0x0572('0x3'));var express=require(_0x0572('0x4'));var router=express[_0x0572('0x5')]();var auth=require(_0x0572('0x6'));var interaction=require(_0x0572('0x7'));var config=require(_0x0572('0x8'));var controller=require(_0x0572('0x9'));router[_0x0572('0xa')]('/',auth[_0x0572('0xb')](),controller['index']);router[_0x0572('0xa')](_0x0572('0xc'),auth[_0x0572('0xb')](),controller[_0x0572('0xd')]);router[_0x0572('0xa')](_0x0572('0xe'),auth[_0x0572('0xb')](),controller[_0x0572('0xf')]);router[_0x0572('0xa')](_0x0572('0x10'),auth[_0x0572('0xb')](),controller[_0x0572('0x11')]);router[_0x0572('0xa')](_0x0572('0x12'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x0572('0xa')](_0x0572('0x13'),auth[_0x0572('0xb')](),controller['getTags']);router['post']('/',auth[_0x0572('0xb')](),controller[_0x0572('0x14')]);router['post']('/:id/tags',auth[_0x0572('0xb')](),controller[_0x0572('0x15')]);router[_0x0572('0x16')](_0x0572('0xc'),auth[_0x0572('0xb')](),controller[_0x0572('0x17')]);router[_0x0572('0x18')](_0x0572('0xc'),auth[_0x0572('0xb')](),controller[_0x0572('0x19')]);module['exports']=router; \ No newline at end of file +var _0x2e68=['getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','/:id','update','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects'];(function(_0x59ae57,_0x393799){var _0xb24978=function(_0x327c1e){while(--_0x327c1e){_0x59ae57['push'](_0x59ae57['shift']());}};_0xb24978(++_0x393799);}(_0x2e68,0x15b));var _0x82e6=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2e68[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x82e6('0x0'));var util=require('util');var path=require(_0x82e6('0x1'));var timeout=require(_0x82e6('0x2'));var express=require('express');var router=express[_0x82e6('0x3')]();var auth=require(_0x82e6('0x4'));var interaction=require(_0x82e6('0x5'));var config=require('../../config/environment');var controller=require(_0x82e6('0x6'));router[_0x82e6('0x7')]('/',auth[_0x82e6('0x8')](),controller[_0x82e6('0x9')]);router[_0x82e6('0x7')]('/:id',auth[_0x82e6('0x8')](),controller['show']);router[_0x82e6('0x7')](_0x82e6('0xa'),auth[_0x82e6('0x8')](),controller[_0x82e6('0xb')]);router['get'](_0x82e6('0xc'),auth[_0x82e6('0x8')](),controller[_0x82e6('0xd')]);router['get'](_0x82e6('0xe'),auth[_0x82e6('0x8')](),controller[_0x82e6('0xf')]);router[_0x82e6('0x7')](_0x82e6('0x10'),auth['isAuthenticated'](),controller[_0x82e6('0x11')]);router[_0x82e6('0x12')]('/',auth[_0x82e6('0x8')](),controller['create']);router['post'](_0x82e6('0x10'),auth['isAuthenticated'](),controller[_0x82e6('0x13')]);router['put'](_0x82e6('0x14'),auth['isAuthenticated'](),controller[_0x82e6('0x15')]);router['delete'](_0x82e6('0x14'),auth[_0x82e6('0x8')](),controller[_0x82e6('0x16')]);module[_0x82e6('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index ab4c96b..bd68de9 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 _0xb549=['sequelize','STRING'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xb549,0x1e6));var _0x9b54=function(_0x43f21c,_0xfb6ea6){_0x43f21c=_0x43f21c-0x0;var _0x51f224=_0xb549[_0x43f21c];return _0x51f224;};'use strict';var Sequelize=require(_0x9b54('0x0'));module['exports']={'name':{'type':Sequelize[_0x9b54('0x1')]},'description':{'type':Sequelize[_0x9b54('0x1')]}}; \ No newline at end of file +var _0x3175=['STRING','exports'];(function(_0x37ddbb,_0x4103f6){var _0xecd5d0=function(_0x24c5cb){while(--_0x24c5cb){_0x37ddbb['push'](_0x37ddbb['shift']());}};_0xecd5d0(++_0x4103f6);}(_0x3175,0x1cf));var _0x5317=function(_0x1e5cc3,_0x238a87){_0x1e5cc3=_0x1e5cc3-0x0;var _0x15c596=_0x3175[_0x1e5cc3];return _0x15c596;};'use strict';var Sequelize=require('sequelize');module[_0x5317('0x0')]={'name':{'type':Sequelize[_0x5317('0x1')]},'description':{'type':Sequelize[_0x5317('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 23340b4..ff9868a 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 _0xac4a=['index','ZendeskConfiguration','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','map','type','key','field','options','count','includeAll','include','findAll','rows','show','find','create','body','params','getFields','findOne','ZendeskField','getSubjects','sort','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send'];(function(_0x5db051,_0x57a0d1){var _0x247c90=function(_0x797d9b){while(--_0x797d9b){_0x5db051['push'](_0x5db051['shift']());}};_0x247c90(++_0x57a0d1);}(_0xac4a,0x13f));var _0xaac4=function(_0x1d6505,_0x54884e){_0x1d6505=_0x1d6505-0x0;var _0x618899=_0xac4a[_0x1d6505];return _0x618899;};'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 hardwareService=require(_0xaac4('0xf'));var logger=require(_0xaac4('0x10'))(_0xaac4('0x11'));var utils=require(_0xaac4('0x12'));var config=require(_0xaac4('0x13'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x14')][_0xaac4('0x15')]({'port':0x232a});function checkPasswordPattern(_0x45e512,_0x5a4801,_0x6a808d){if(_0x6a808d){var _0x45c129=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x45c129['test'](_0x5a4801)){return _0x45e512;}else{throw new Error(_0xaac4('0x16'));}}else{return _0x45e512;}}function respondWithRpcPromise(_0x2b20d0,_0x46698d,_0x150fdd,_0x187624){return new BPromise(function(_0x2fbeb7,_0x31b7e5){var _0x1df9ae=_0x187624||client;return _0x1df9ae[_0xaac4('0x17')](_0x2b20d0,_0x150fdd)[_0xaac4('0x18')](function(_0x35bc32){logger[_0xaac4('0x19')](_0xaac4('0x1a'),_0x46698d,'request\x20sent');logger[_0xaac4('0x1b')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x46698d,_0xaac4('0x1c'),JSON['stringify'](_0x35bc32));if(_0x35bc32[_0xaac4('0x1d')]){if(_0x35bc32[_0xaac4('0x1d')][_0xaac4('0x1e')]===0x1f4){logger[_0xaac4('0x1d')](_0xaac4('0x1a'),_0x46698d,_0x35bc32[_0xaac4('0x1d')][_0xaac4('0x1f')]);return _0x31b7e5(_0x35bc32[_0xaac4('0x1d')][_0xaac4('0x1f')]);}logger['error'](_0xaac4('0x1a'),_0x46698d,_0x35bc32['error'][_0xaac4('0x1f')]);return _0x2fbeb7(_0x35bc32[_0xaac4('0x1d')][_0xaac4('0x1f')]);}else{logger[_0xaac4('0x19')](_0xaac4('0x1a'),_0x46698d,_0xaac4('0x1c'));_0x2fbeb7(_0x35bc32['result'][_0xaac4('0x1f')]);}})[_0xaac4('0x20')](function(_0x174860){logger[_0xaac4('0x1d')](_0xaac4('0x1a'),_0x46698d,_0x174860);_0x31b7e5(_0x174860);});});}function respondWithStatusCode(_0x2dcc59,_0xb2577b){_0xb2577b=_0xb2577b||0xcc;return function(_0x577b3d){if(_0x577b3d){return _0x2dcc59[_0xaac4('0x21')](_0xb2577b);}return _0x2dcc59['status'](_0xb2577b)['end']();};}function respondWithResult(_0x4fac85,_0x5a0bb3){_0x5a0bb3=_0x5a0bb3||0xc8;return function(_0x22d5a6){if(_0x22d5a6){return _0x4fac85[_0xaac4('0x22')](_0x5a0bb3)[_0xaac4('0x23')](_0x22d5a6);}};}function respondWithFilteredResult(_0xe93120,_0x3c1445){return function(_0x249a5d){if(_0x249a5d){var _0x43b122=_0x249a5d['count'],_0x2d68b6=_0x3c1445[_0xaac4('0x24')],_0x2f36ad=_0x3c1445[_0xaac4('0x24')]+_0x3c1445[_0xaac4('0x25')],_0x386c9b;if(_0x2f36ad>=_0x43b122){_0x2f36ad=_0x43b122;_0x386c9b=0xc8;}else{_0x386c9b=0xce;}_0xe93120[_0xaac4('0x22')](_0x386c9b);return _0xe93120[_0xaac4('0x26')](_0xaac4('0x27'),_0x2d68b6+'-'+_0x2f36ad+'/'+_0x43b122)['json'](_0x249a5d);}return null;};}function patchUpdates(_0xcf6c1){return function(_0x5d2c9a){try{jsonpatch[_0xaac4('0x28')](_0x5d2c9a,_0xcf6c1,!![]);}catch(_0xab5d04){return BPromise[_0xaac4('0x29')](_0xab5d04);}return _0x5d2c9a[_0xaac4('0x2a')]();};}function saveUpdates(_0x48bf50,_0x5000e1){return function(_0x58f748){if(_0x58f748){return _0x58f748[_0xaac4('0x2b')](_0x48bf50)[_0xaac4('0x18')](function(_0x2df196){return _0x2df196;});}return null;};}function removeEntity(_0x244e36,_0x2479bb){return function(_0x1e9062){if(_0x1e9062){return _0x1e9062[_0xaac4('0x2c')]()[_0xaac4('0x18')](function(){_0x244e36[_0xaac4('0x22')](0xcc)[_0xaac4('0x2d')]();});}};}function handleEntityNotFound(_0x8b003b,_0x22c902){return function(_0x10e67b){if(!_0x10e67b){_0x8b003b[_0xaac4('0x21')](0x194);}return _0x10e67b;};}function handleError(_0x1f7646,_0x5b38a4){_0x5b38a4=_0x5b38a4||0x1f4;return function(_0x5bad9f){logger[_0xaac4('0x1d')](_0x5bad9f[_0xaac4('0x2e')]);if(_0x5bad9f[_0xaac4('0x2f')]){delete _0x5bad9f['name'];}_0x1f7646[_0xaac4('0x22')](_0x5b38a4)[_0xaac4('0x30')](_0x5bad9f);};}exports[_0xaac4('0x31')]=function(_0x1bce61,_0x1ec59d){var _0x1e1853={},_0x418939={},_0x53b7cb={'count':0x0,'rows':[]};var _0x36591a=db[_0xaac4('0x32')][_0xaac4('0x33')];_0x418939['model']=_[_0xaac4('0x34')](_0x36591a);_0x418939['query']=_['keys'](_0x1bce61[_0xaac4('0x35')]);_0x418939[_0xaac4('0x36')]=_[_0xaac4('0x37')](_0x418939['model'],_0x418939['query']);_0x1e1853[_0xaac4('0x38')]=_[_0xaac4('0x37')](_0x418939[_0xaac4('0x39')],qs[_0xaac4('0x3a')](_0x1bce61[_0xaac4('0x35')][_0xaac4('0x3a')]));_0x1e1853['attributes']=_0x1e1853['attributes'][_0xaac4('0x3b')]?_0x1e1853[_0xaac4('0x38')]:_0x418939['model'];if(!_0x1bce61[_0xaac4('0x35')][_0xaac4('0x3c')](_0xaac4('0x3d'))){_0x1e1853['limit']=qs[_0xaac4('0x25')](_0x1bce61[_0xaac4('0x35')][_0xaac4('0x25')]);_0x1e1853['offset']=qs[_0xaac4('0x24')](_0x1bce61[_0xaac4('0x35')][_0xaac4('0x24')]);}_0x1e1853[_0xaac4('0x3e')]=qs['sort'](_0x1bce61[_0xaac4('0x35')]['sort']);_0x1e1853['where']=qs[_0xaac4('0x36')](_[_0xaac4('0x3f')](_0x1bce61[_0xaac4('0x35')],_0x418939[_0xaac4('0x36')]));if(_0x1bce61[_0xaac4('0x35')][_0xaac4('0x40')]){_0x1e1853[_0xaac4('0x41')]=_[_0xaac4('0x42')](_0x1e1853['where'],{'$or':_[_0xaac4('0x43')](_0x36591a,function(_0x36ac31){if(_0x36ac31[_0xaac4('0x44')][_0xaac4('0x45')]!=='VIRTUAL'){var _0x371d1d={};_0x371d1d[_0x36ac31[_0xaac4('0x46')]]={'$like':'%'+_0x1bce61[_0xaac4('0x35')]['filter']+'%'};return _0x371d1d;}})});}_0x1e1853=_[_0xaac4('0x42')]({},_0x1e1853,_0x1bce61[_0xaac4('0x47')]);var _0x141eb9={'where':_0x1e1853[_0xaac4('0x41')]};return db['ZendeskConfiguration'][_0xaac4('0x48')](_0x141eb9)[_0xaac4('0x18')](function(_0x17ef72){_0x53b7cb['count']=_0x17ef72;if(_0x1bce61[_0xaac4('0x35')][_0xaac4('0x49')]){_0x1e1853[_0xaac4('0x4a')]=[{'all':!![]}];}return db[_0xaac4('0x32')][_0xaac4('0x4b')](_0x1e1853);})[_0xaac4('0x18')](function(_0x25e1b1){_0x53b7cb[_0xaac4('0x4c')]=_0x25e1b1;return _0x53b7cb;})[_0xaac4('0x18')](respondWithFilteredResult(_0x1ec59d,_0x1e1853))['catch'](handleError(_0x1ec59d,null));};exports[_0xaac4('0x4d')]=function(_0x1df765,_0x27425a){var _0x360420={'raw':![],'where':{'id':_0x1df765['params']['id']}},_0x130bb5={};_0x130bb5['model']=_[_0xaac4('0x34')](db[_0xaac4('0x32')][_0xaac4('0x33')]);_0x130bb5[_0xaac4('0x35')]=_['keys'](_0x1df765[_0xaac4('0x35')]);_0x130bb5['filters']=_[_0xaac4('0x37')](_0x130bb5[_0xaac4('0x39')],_0x130bb5['query']);_0x360420[_0xaac4('0x38')]=_[_0xaac4('0x37')](_0x130bb5[_0xaac4('0x39')],qs['fields'](_0x1df765['query'][_0xaac4('0x3a')]));_0x360420[_0xaac4('0x38')]=_0x360420[_0xaac4('0x38')][_0xaac4('0x3b')]?_0x360420[_0xaac4('0x38')]:_0x130bb5[_0xaac4('0x39')];if(_0x1df765['query'][_0xaac4('0x49')]){_0x360420[_0xaac4('0x4a')]=[{'all':!![]}];}_0x360420=_[_0xaac4('0x42')]({},_0x360420,_0x1df765[_0xaac4('0x47')]);return db['ZendeskConfiguration'][_0xaac4('0x4e')](_0x360420)['then'](handleEntityNotFound(_0x27425a,null))[_0xaac4('0x18')](respondWithResult(_0x27425a,null))[_0xaac4('0x20')](handleError(_0x27425a,null));};exports[_0xaac4('0x4f')]=function(_0x3922a0,_0x324305){return db[_0xaac4('0x32')][_0xaac4('0x4f')](_0x3922a0[_0xaac4('0x50')],{})[_0xaac4('0x18')](respondWithResult(_0x324305,0xc9))[_0xaac4('0x20')](handleError(_0x324305,null));};exports[_0xaac4('0x2b')]=function(_0x3224c4,_0x3ce31f){if(_0x3224c4[_0xaac4('0x50')]['id']){delete _0x3224c4['body']['id'];}return db[_0xaac4('0x32')][_0xaac4('0x4e')]({'where':{'id':_0x3224c4[_0xaac4('0x51')]['id']}})[_0xaac4('0x18')](handleEntityNotFound(_0x3ce31f,null))[_0xaac4('0x18')](saveUpdates(_0x3224c4[_0xaac4('0x50')],null))[_0xaac4('0x18')](respondWithResult(_0x3ce31f,null))[_0xaac4('0x20')](handleError(_0x3ce31f,null));};exports['destroy']=function(_0x3d7ccc,_0x501664){return db[_0xaac4('0x32')]['find']({'where':{'id':_0x3d7ccc[_0xaac4('0x51')]['id']}})['then'](handleEntityNotFound(_0x501664,null))['then'](removeEntity(_0x501664,null))[_0xaac4('0x20')](handleError(_0x501664,null));};exports[_0xaac4('0x52')]=function(_0x48ae39,_0x2f287c,_0x3f66e6){var _0xc93260={};var _0x1848c6={};var _0x3f8dc2;var _0x19d9c1;return db['ZendeskConfiguration'][_0xaac4('0x53')]({'where':{'id':_0x48ae39['params']['id']}})[_0xaac4('0x18')](handleEntityNotFound(_0x2f287c,null))['then'](function(_0x4dcc7d){if(_0x4dcc7d){_0x3f8dc2=_0x4dcc7d;_0x1848c6['model']=_[_0xaac4('0x34')](db[_0xaac4('0x54')][_0xaac4('0x33')]);_0x1848c6[_0xaac4('0x35')]=_['keys'](_0x48ae39[_0xaac4('0x35')]);_0x1848c6[_0xaac4('0x36')]=_[_0xaac4('0x37')](_0x1848c6['model'],_0x1848c6[_0xaac4('0x35')]);_0xc93260[_0xaac4('0x38')]=_[_0xaac4('0x37')](_0x1848c6[_0xaac4('0x39')],qs[_0xaac4('0x3a')](_0x48ae39[_0xaac4('0x35')][_0xaac4('0x3a')]));_0xc93260['attributes']=_0xc93260['attributes'][_0xaac4('0x3b')]?_0xc93260['attributes']:_0x1848c6['model'];_0xc93260[_0xaac4('0x3e')]=qs['sort'](_0x48ae39[_0xaac4('0x35')]['sort']);_0xc93260[_0xaac4('0x41')]=qs[_0xaac4('0x36')](_['pick'](_0x48ae39['query'],_0x1848c6['filters']));if(_0x48ae39['query'][_0xaac4('0x40')]){_0xc93260[_0xaac4('0x41')]=_[_0xaac4('0x42')](_0xc93260[_0xaac4('0x41')],{'$or':_['map'](_0xc93260[_0xaac4('0x38')],function(_0x354ec9){var _0x3b0470={};_0x3b0470[_0x354ec9]={'$like':'%'+_0x48ae39[_0xaac4('0x35')][_0xaac4('0x40')]+'%'};return _0x3b0470;})});}_0xc93260=_[_0xaac4('0x42')]({},_0xc93260,_0x48ae39[_0xaac4('0x47')]);return _0x3f8dc2[_0xaac4('0x52')](_0xc93260);}})[_0xaac4('0x18')](function(_0x40271c){if(_0x40271c){_0x19d9c1=_0x40271c[_0xaac4('0x3b')];if(!_0x48ae39['query']['hasOwnProperty'](_0xaac4('0x3d'))){_0xc93260['limit']=qs['limit'](_0x48ae39[_0xaac4('0x35')]['limit']);_0xc93260[_0xaac4('0x24')]=qs[_0xaac4('0x24')](_0x48ae39[_0xaac4('0x35')][_0xaac4('0x24')]);}return _0x3f8dc2['getFields'](_0xc93260);}})[_0xaac4('0x18')](function(_0x2de8d4){if(_0x2de8d4){return _0x2de8d4?{'count':_0x19d9c1,'rows':_0x2de8d4}:null;}})[_0xaac4('0x18')](respondWithResult(_0x2f287c,null))[_0xaac4('0x20')](handleError(_0x2f287c,null));};exports[_0xaac4('0x55')]=function(_0x3a1b41,_0x5b20c6,_0x1db7c7){var _0x429661={};var _0x5b5e57={};var _0x2e3fd9;var _0x1deac8;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x3a1b41[_0xaac4('0x51')]['id']}})[_0xaac4('0x18')](handleEntityNotFound(_0x5b20c6,null))[_0xaac4('0x18')](function(_0x458a17){if(_0x458a17){_0x2e3fd9=_0x458a17;_0x5b5e57[_0xaac4('0x39')]=_[_0xaac4('0x34')](db[_0xaac4('0x54')][_0xaac4('0x33')]);_0x5b5e57['query']=_[_0xaac4('0x34')](_0x3a1b41[_0xaac4('0x35')]);_0x5b5e57[_0xaac4('0x36')]=_[_0xaac4('0x37')](_0x5b5e57[_0xaac4('0x39')],_0x5b5e57[_0xaac4('0x35')]);_0x429661['attributes']=_[_0xaac4('0x37')](_0x5b5e57[_0xaac4('0x39')],qs['fields'](_0x3a1b41['query']['fields']));_0x429661[_0xaac4('0x38')]=_0x429661['attributes']['length']?_0x429661['attributes']:_0x5b5e57['model'];_0x429661['order']=qs[_0xaac4('0x56')](_0x3a1b41[_0xaac4('0x35')][_0xaac4('0x56')]);_0x429661[_0xaac4('0x41')]=qs['filters'](_[_0xaac4('0x3f')](_0x3a1b41[_0xaac4('0x35')],_0x5b5e57[_0xaac4('0x36')]));if(_0x3a1b41[_0xaac4('0x35')][_0xaac4('0x40')]){_0x429661[_0xaac4('0x41')]=_[_0xaac4('0x42')](_0x429661['where'],{'$or':_[_0xaac4('0x43')](_0x429661['attributes'],function(_0x551e53){var _0x20dff9={};_0x20dff9[_0x551e53]={'$like':'%'+_0x3a1b41[_0xaac4('0x35')][_0xaac4('0x40')]+'%'};return _0x20dff9;})});}_0x429661=_[_0xaac4('0x42')]({},_0x429661,_0x3a1b41[_0xaac4('0x47')]);return _0x2e3fd9[_0xaac4('0x55')](_0x429661);}})[_0xaac4('0x18')](function(_0x18d567){if(_0x18d567){_0x1deac8=_0x18d567[_0xaac4('0x3b')];if(!_0x3a1b41[_0xaac4('0x35')][_0xaac4('0x3c')](_0xaac4('0x3d'))){_0x429661[_0xaac4('0x25')]=qs[_0xaac4('0x25')](_0x3a1b41[_0xaac4('0x35')][_0xaac4('0x25')]);_0x429661[_0xaac4('0x24')]=qs[_0xaac4('0x24')](_0x3a1b41[_0xaac4('0x35')][_0xaac4('0x24')]);}return _0x2e3fd9[_0xaac4('0x55')](_0x429661);}})[_0xaac4('0x18')](function(_0x1d3500){if(_0x1d3500){return _0x1d3500?{'count':_0x1deac8,'rows':_0x1d3500}:null;}})[_0xaac4('0x18')](respondWithResult(_0x5b20c6,null))[_0xaac4('0x20')](handleError(_0x5b20c6,null));};exports['getDescriptions']=function(_0xb12069,_0x2f77d4,_0x29cd95){var _0x1d8c13={};var _0x4098e6={};var _0x4a5d76;var _0x1bbb55;return db[_0xaac4('0x32')][_0xaac4('0x53')]({'where':{'id':_0xb12069[_0xaac4('0x51')]['id']}})[_0xaac4('0x18')](handleEntityNotFound(_0x2f77d4,null))['then'](function(_0x30818a){if(_0x30818a){_0x4a5d76=_0x30818a;_0x4098e6['model']=_[_0xaac4('0x34')](db[_0xaac4('0x54')]['rawAttributes']);_0x4098e6[_0xaac4('0x35')]=_['keys'](_0xb12069[_0xaac4('0x35')]);_0x4098e6[_0xaac4('0x36')]=_['intersection'](_0x4098e6[_0xaac4('0x39')],_0x4098e6[_0xaac4('0x35')]);_0x1d8c13['attributes']=_[_0xaac4('0x37')](_0x4098e6[_0xaac4('0x39')],qs[_0xaac4('0x3a')](_0xb12069[_0xaac4('0x35')][_0xaac4('0x3a')]));_0x1d8c13[_0xaac4('0x38')]=_0x1d8c13[_0xaac4('0x38')][_0xaac4('0x3b')]?_0x1d8c13[_0xaac4('0x38')]:_0x4098e6['model'];_0x1d8c13[_0xaac4('0x3e')]=qs[_0xaac4('0x56')](_0xb12069[_0xaac4('0x35')]['sort']);_0x1d8c13[_0xaac4('0x41')]=qs[_0xaac4('0x36')](_[_0xaac4('0x3f')](_0xb12069[_0xaac4('0x35')],_0x4098e6[_0xaac4('0x36')]));if(_0xb12069[_0xaac4('0x35')][_0xaac4('0x40')]){_0x1d8c13[_0xaac4('0x41')]=_[_0xaac4('0x42')](_0x1d8c13[_0xaac4('0x41')],{'$or':_[_0xaac4('0x43')](_0x1d8c13[_0xaac4('0x38')],function(_0x7a53d0){var _0x72b39c={};_0x72b39c[_0x7a53d0]={'$like':'%'+_0xb12069[_0xaac4('0x35')][_0xaac4('0x40')]+'%'};return _0x72b39c;})});}_0x1d8c13=_['merge']({},_0x1d8c13,_0xb12069[_0xaac4('0x47')]);return _0x4a5d76[_0xaac4('0x57')](_0x1d8c13);}})[_0xaac4('0x18')](function(_0x553bca){if(_0x553bca){_0x1bbb55=_0x553bca[_0xaac4('0x3b')];if(!_0xb12069[_0xaac4('0x35')]['hasOwnProperty'](_0xaac4('0x3d'))){_0x1d8c13['limit']=qs[_0xaac4('0x25')](_0xb12069[_0xaac4('0x35')][_0xaac4('0x25')]);_0x1d8c13[_0xaac4('0x24')]=qs[_0xaac4('0x24')](_0xb12069[_0xaac4('0x35')]['offset']);}return _0x4a5d76[_0xaac4('0x57')](_0x1d8c13);}})[_0xaac4('0x18')](function(_0x3639f3){if(_0x3639f3){return _0x3639f3?{'count':_0x1bbb55,'rows':_0x3639f3}:null;}})[_0xaac4('0x18')](respondWithResult(_0x2f77d4,null))['catch'](handleError(_0x2f77d4,null));};exports[_0xaac4('0x58')]=function(_0x31fc7b,_0x25416c,_0x52bd35){var _0xa78f15={};var _0x8f9f2d={};var _0x1c03ab;var _0x391f6c;return db[_0xaac4('0x32')]['findOne']({'where':{'id':_0x31fc7b['params']['id']}})[_0xaac4('0x18')](handleEntityNotFound(_0x25416c,null))[_0xaac4('0x18')](function(_0x43528c){if(_0x43528c){_0x1c03ab=_0x43528c;_0x8f9f2d[_0xaac4('0x39')]=_['keys'](db[_0xaac4('0x59')][_0xaac4('0x33')]);_0x8f9f2d[_0xaac4('0x35')]=_[_0xaac4('0x34')](_0x31fc7b[_0xaac4('0x35')]);_0x8f9f2d[_0xaac4('0x36')]=_[_0xaac4('0x37')](_0x8f9f2d[_0xaac4('0x39')],_0x8f9f2d[_0xaac4('0x35')]);_0xa78f15[_0xaac4('0x38')]=_[_0xaac4('0x37')](_0x8f9f2d[_0xaac4('0x39')],qs[_0xaac4('0x3a')](_0x31fc7b['query'][_0xaac4('0x3a')]));_0xa78f15[_0xaac4('0x38')]=_0xa78f15[_0xaac4('0x38')][_0xaac4('0x3b')]?_0xa78f15[_0xaac4('0x38')]:_0x8f9f2d[_0xaac4('0x39')];_0xa78f15[_0xaac4('0x3e')]=qs['sort'](_0x31fc7b[_0xaac4('0x35')][_0xaac4('0x56')]);_0xa78f15[_0xaac4('0x41')]=qs[_0xaac4('0x36')](_[_0xaac4('0x3f')](_0x31fc7b[_0xaac4('0x35')],_0x8f9f2d[_0xaac4('0x36')]));if(_0x31fc7b[_0xaac4('0x35')]['filter']){_0xa78f15[_0xaac4('0x41')]=_[_0xaac4('0x42')](_0xa78f15[_0xaac4('0x41')],{'$or':_[_0xaac4('0x43')](_0xa78f15[_0xaac4('0x38')],function(_0x297019){var _0x2dd099={};_0x2dd099[_0x297019]={'$like':'%'+_0x31fc7b[_0xaac4('0x35')][_0xaac4('0x40')]+'%'};return _0x2dd099;})});}_0xa78f15=_[_0xaac4('0x42')]({},_0xa78f15,_0x31fc7b['options']);return _0x1c03ab['getTags'](_0xa78f15);}})[_0xaac4('0x18')](function(_0xd9ea37){if(_0xd9ea37){_0x391f6c=_0xd9ea37[_0xaac4('0x3b')];if(!_0x31fc7b[_0xaac4('0x35')][_0xaac4('0x3c')]('nolimit')){_0xa78f15[_0xaac4('0x25')]=qs[_0xaac4('0x25')](_0x31fc7b[_0xaac4('0x35')][_0xaac4('0x25')]);_0xa78f15[_0xaac4('0x24')]=qs[_0xaac4('0x24')](_0x31fc7b[_0xaac4('0x35')][_0xaac4('0x24')]);}return _0x1c03ab[_0xaac4('0x58')](_0xa78f15);}})[_0xaac4('0x18')](function(_0x277554){if(_0x277554){return _0x277554?{'count':_0x391f6c,'rows':_0x277554}:null;}})[_0xaac4('0x18')](respondWithResult(_0x25416c,null))[_0xaac4('0x20')](handleError(_0x25416c,null));};exports[_0xaac4('0x5a')]=function(_0x103cb0,_0x3a6411,_0x4782e3){if(_0x103cb0[_0xaac4('0x50')]['id']){delete _0x103cb0[_0xaac4('0x50')]['id'];}return db[_0xaac4('0x32')][_0xaac4('0x53')]({'where':{'id':_0x103cb0[_0xaac4('0x51')]['id']}})[_0xaac4('0x18')](handleEntityNotFound(_0x3a6411,null))[_0xaac4('0x18')](function(_0x1e6318){if(_0x1e6318){return _0x1e6318[_0xaac4('0x5a')](_0x103cb0[_0xaac4('0x50')][_0xaac4('0x5b')]||[]);}return null;})[_0xaac4('0x18')](respondWithResult(_0x3a6411,null))[_0xaac4('0x20')](handleError(_0x3a6411,null));}; \ No newline at end of file +var _0x13f6=['type','key','VIRTUAL','field','includeAll','include','catch','show','params','keys','rawAttributes','find','create','body','destroy','getFields','findOne','ZendeskField','options','getSubjects','getDescriptions','Tag','getTags','setTags','ids','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZendeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','sendStatus','status','count','set','Content-Range','apply','save','update','then','end','stack','name','ZendeskConfiguration','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filters','filter','merge','map'];(function(_0x2c3463,_0x184d3b){var _0x577207=function(_0x42275f){while(--_0x42275f){_0x2c3463['push'](_0x2c3463['shift']());}};_0x577207(++_0x184d3b);}(_0x13f6,0x124));var _0x613f=function(_0xedbfd,_0x3df491){_0xedbfd=_0xedbfd-0x0;var _0x3b0cff=_0x13f6[_0xedbfd];return _0x3b0cff;};'use strict';var pdf=require(_0x613f('0x0'));var emlformat=require(_0x613f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x613f('0x2'));var rp=require(_0x613f('0x3'));var moment=require(_0x613f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x613f('0x5'));var util=require(_0x613f('0x6'));var path=require(_0x613f('0x7'));var sox=require('sox');var csv=require(_0x613f('0x8'));var ejs=require(_0x613f('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x613f('0xa'));var toCsv=require(_0x613f('0x8'));var querystring=require(_0x613f('0xb'));var Papa=require(_0x613f('0xc'));var Redis=require('ioredis');var authService=require(_0x613f('0xd'));var qs=require(_0x613f('0xe'));var hardwareService=require(_0x613f('0xf'));var logger=require('../../config/logger')(_0x613f('0x10'));var utils=require(_0x613f('0x11'));var config=require(_0x613f('0x12'));var db=require('../../mysqldb')['db'];var jayson=require(_0x613f('0x13'));var client=jayson[_0x613f('0x14')]['http']({'port':0x232a});function checkPasswordPattern(_0x4c2a85,_0x517f57,_0x38d90a){if(_0x38d90a){var _0x1ebab5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ebab5[_0x613f('0x15')](_0x517f57)){return _0x4c2a85;}else{throw new Error(_0x613f('0x16'));}}else{return _0x4c2a85;}}function respondWithRpcPromise(_0x329fcf,_0x4a6fc,_0x305894,_0x291268){return new BPromise(function(_0x2eee4d,_0x1d68fd){var _0x548218=_0x291268||client;return _0x548218[_0x613f('0x17')](_0x329fcf,_0x305894)['then'](function(_0x5c769c){logger[_0x613f('0x18')](_0x613f('0x19'),_0x4a6fc,'request\x20sent');logger[_0x613f('0x1a')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4a6fc,_0x613f('0x1b'),JSON[_0x613f('0x1c')](_0x5c769c));if(_0x5c769c[_0x613f('0x1d')]){if(_0x5c769c[_0x613f('0x1d')][_0x613f('0x1e')]===0x1f4){logger[_0x613f('0x1d')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4a6fc,_0x5c769c['error'][_0x613f('0x1f')]);return _0x1d68fd(_0x5c769c['error']['message']);}logger[_0x613f('0x1d')](_0x613f('0x19'),_0x4a6fc,_0x5c769c['error'][_0x613f('0x1f')]);return _0x2eee4d(_0x5c769c[_0x613f('0x1d')][_0x613f('0x1f')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x4a6fc,_0x613f('0x1b'));_0x2eee4d(_0x5c769c[_0x613f('0x20')][_0x613f('0x1f')]);}})['catch'](function(_0x41104e){logger[_0x613f('0x1d')](_0x613f('0x19'),_0x4a6fc,_0x41104e);_0x1d68fd(_0x41104e);});});}function respondWithStatusCode(_0x1ee050,_0x3013a1){_0x3013a1=_0x3013a1||0xcc;return function(_0x4e3d5a){if(_0x4e3d5a){return _0x1ee050[_0x613f('0x21')](_0x3013a1);}return _0x1ee050[_0x613f('0x22')](_0x3013a1)['end']();};}function respondWithResult(_0x22035f,_0x5d4ff6){_0x5d4ff6=_0x5d4ff6||0xc8;return function(_0x32e747){if(_0x32e747){return _0x22035f['status'](_0x5d4ff6)['json'](_0x32e747);}};}function respondWithFilteredResult(_0x5a4a8b,_0x379920){return function(_0x594c28){if(_0x594c28){var _0x412269=_0x594c28[_0x613f('0x23')],_0x1767db=_0x379920['offset'],_0x4ca372=_0x379920['offset']+_0x379920['limit'],_0x121241;if(_0x4ca372>=_0x412269){_0x4ca372=_0x412269;_0x121241=0xc8;}else{_0x121241=0xce;}_0x5a4a8b[_0x613f('0x22')](_0x121241);return _0x5a4a8b[_0x613f('0x24')](_0x613f('0x25'),_0x1767db+'-'+_0x4ca372+'/'+_0x412269)['json'](_0x594c28);}return null;};}function patchUpdates(_0x23eda8){return function(_0x439478){try{jsonpatch[_0x613f('0x26')](_0x439478,_0x23eda8,!![]);}catch(_0x19bb8f){return BPromise['reject'](_0x19bb8f);}return _0x439478[_0x613f('0x27')]();};}function saveUpdates(_0x5b2a1f,_0x165852){return function(_0x728f45){if(_0x728f45){return _0x728f45[_0x613f('0x28')](_0x5b2a1f)[_0x613f('0x29')](function(_0x5d7e9a){return _0x5d7e9a;});}return null;};}function removeEntity(_0x2ab751,_0x3575ac){return function(_0x314819){if(_0x314819){return _0x314819['destroy']()[_0x613f('0x29')](function(){_0x2ab751['status'](0xcc)[_0x613f('0x2a')]();});}};}function handleEntityNotFound(_0x11e7c2,_0xc8976c){return function(_0x28c06c){if(!_0x28c06c){_0x11e7c2[_0x613f('0x21')](0x194);}return _0x28c06c;};}function handleError(_0x2e5590,_0x589157){_0x589157=_0x589157||0x1f4;return function(_0x1a18ce){logger[_0x613f('0x1d')](_0x1a18ce[_0x613f('0x2b')]);if(_0x1a18ce[_0x613f('0x2c')]){delete _0x1a18ce[_0x613f('0x2c')];}_0x2e5590['status'](_0x589157)['send'](_0x1a18ce);};}exports['index']=function(_0x3d79f0,_0x72c804){var _0x22074f={},_0x14ceeb={},_0x5b36cf={'count':0x0,'rows':[]};var _0x2fc02e=db[_0x613f('0x2d')]['rawAttributes'];_0x14ceeb[_0x613f('0x2e')]=_['keys'](_0x2fc02e);_0x14ceeb[_0x613f('0x2f')]=_['keys'](_0x3d79f0[_0x613f('0x2f')]);_0x14ceeb['filters']=_[_0x613f('0x30')](_0x14ceeb[_0x613f('0x2e')],_0x14ceeb[_0x613f('0x2f')]);_0x22074f['attributes']=_[_0x613f('0x30')](_0x14ceeb[_0x613f('0x2e')],qs[_0x613f('0x31')](_0x3d79f0[_0x613f('0x2f')][_0x613f('0x31')]));_0x22074f[_0x613f('0x32')]=_0x22074f[_0x613f('0x32')][_0x613f('0x33')]?_0x22074f[_0x613f('0x32')]:_0x14ceeb[_0x613f('0x2e')];if(!_0x3d79f0['query'][_0x613f('0x34')](_0x613f('0x35'))){_0x22074f[_0x613f('0x36')]=qs[_0x613f('0x36')](_0x3d79f0[_0x613f('0x2f')][_0x613f('0x36')]);_0x22074f[_0x613f('0x37')]=qs['offset'](_0x3d79f0[_0x613f('0x2f')][_0x613f('0x37')]);}_0x22074f[_0x613f('0x38')]=qs[_0x613f('0x39')](_0x3d79f0[_0x613f('0x2f')][_0x613f('0x39')]);_0x22074f[_0x613f('0x3a')]=qs['filters'](_[_0x613f('0x3b')](_0x3d79f0[_0x613f('0x2f')],_0x14ceeb[_0x613f('0x3c')]));if(_0x3d79f0[_0x613f('0x2f')][_0x613f('0x3d')]){_0x22074f[_0x613f('0x3a')]=_[_0x613f('0x3e')](_0x22074f[_0x613f('0x3a')],{'$or':_[_0x613f('0x3f')](_0x2fc02e,function(_0x2d2574){if(_0x2d2574[_0x613f('0x40')][_0x613f('0x41')]!==_0x613f('0x42')){var _0x50fe35={};_0x50fe35[_0x2d2574[_0x613f('0x43')]]={'$like':'%'+_0x3d79f0[_0x613f('0x2f')][_0x613f('0x3d')]+'%'};return _0x50fe35;}})});}_0x22074f=_[_0x613f('0x3e')]({},_0x22074f,_0x3d79f0['options']);var _0x152a3c={'where':_0x22074f[_0x613f('0x3a')]};return db[_0x613f('0x2d')][_0x613f('0x23')](_0x152a3c)[_0x613f('0x29')](function(_0x12c36f){_0x5b36cf[_0x613f('0x23')]=_0x12c36f;if(_0x3d79f0[_0x613f('0x2f')][_0x613f('0x44')]){_0x22074f[_0x613f('0x45')]=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x22074f);})[_0x613f('0x29')](function(_0x3e42ac){_0x5b36cf['rows']=_0x3e42ac;return _0x5b36cf;})[_0x613f('0x29')](respondWithFilteredResult(_0x72c804,_0x22074f))[_0x613f('0x46')](handleError(_0x72c804,null));};exports[_0x613f('0x47')]=function(_0x2a60bd,_0x39b8b2){var _0x1c0b07={'raw':![],'where':{'id':_0x2a60bd[_0x613f('0x48')]['id']}},_0x412dd4={};_0x412dd4[_0x613f('0x2e')]=_[_0x613f('0x49')](db[_0x613f('0x2d')][_0x613f('0x4a')]);_0x412dd4[_0x613f('0x2f')]=_[_0x613f('0x49')](_0x2a60bd[_0x613f('0x2f')]);_0x412dd4[_0x613f('0x3c')]=_[_0x613f('0x30')](_0x412dd4[_0x613f('0x2e')],_0x412dd4['query']);_0x1c0b07['attributes']=_[_0x613f('0x30')](_0x412dd4[_0x613f('0x2e')],qs['fields'](_0x2a60bd['query'][_0x613f('0x31')]));_0x1c0b07['attributes']=_0x1c0b07['attributes'][_0x613f('0x33')]?_0x1c0b07[_0x613f('0x32')]:_0x412dd4[_0x613f('0x2e')];if(_0x2a60bd['query'][_0x613f('0x44')]){_0x1c0b07[_0x613f('0x45')]=[{'all':!![]}];}_0x1c0b07=_['merge']({},_0x1c0b07,_0x2a60bd['options']);return db[_0x613f('0x2d')][_0x613f('0x4b')](_0x1c0b07)[_0x613f('0x29')](handleEntityNotFound(_0x39b8b2,null))[_0x613f('0x29')](respondWithResult(_0x39b8b2,null))[_0x613f('0x46')](handleError(_0x39b8b2,null));};exports[_0x613f('0x4c')]=function(_0x24d162,_0x5e849a){return db['ZendeskConfiguration'][_0x613f('0x4c')](_0x24d162['body'],{})['then'](respondWithResult(_0x5e849a,0xc9))[_0x613f('0x46')](handleError(_0x5e849a,null));};exports[_0x613f('0x28')]=function(_0x13e3a4,_0x59d6bb){if(_0x13e3a4[_0x613f('0x4d')]['id']){delete _0x13e3a4[_0x613f('0x4d')]['id'];}return db[_0x613f('0x2d')][_0x613f('0x4b')]({'where':{'id':_0x13e3a4[_0x613f('0x48')]['id']}})[_0x613f('0x29')](handleEntityNotFound(_0x59d6bb,null))[_0x613f('0x29')](saveUpdates(_0x13e3a4['body'],null))[_0x613f('0x29')](respondWithResult(_0x59d6bb,null))['catch'](handleError(_0x59d6bb,null));};exports[_0x613f('0x4e')]=function(_0x199afe,_0x33bbde){return db[_0x613f('0x2d')][_0x613f('0x4b')]({'where':{'id':_0x199afe[_0x613f('0x48')]['id']}})[_0x613f('0x29')](handleEntityNotFound(_0x33bbde,null))[_0x613f('0x29')](removeEntity(_0x33bbde,null))[_0x613f('0x46')](handleError(_0x33bbde,null));};exports[_0x613f('0x4f')]=function(_0x2ebce1,_0x63781a,_0x43c238){var _0x54ad8f={};var _0x4f316c={};var _0x687e56;var _0x4b6eb3;return db[_0x613f('0x2d')][_0x613f('0x50')]({'where':{'id':_0x2ebce1[_0x613f('0x48')]['id']}})[_0x613f('0x29')](handleEntityNotFound(_0x63781a,null))[_0x613f('0x29')](function(_0x46a945){if(_0x46a945){_0x687e56=_0x46a945;_0x4f316c[_0x613f('0x2e')]=_[_0x613f('0x49')](db[_0x613f('0x51')][_0x613f('0x4a')]);_0x4f316c[_0x613f('0x2f')]=_['keys'](_0x2ebce1[_0x613f('0x2f')]);_0x4f316c[_0x613f('0x3c')]=_[_0x613f('0x30')](_0x4f316c[_0x613f('0x2e')],_0x4f316c['query']);_0x54ad8f[_0x613f('0x32')]=_[_0x613f('0x30')](_0x4f316c['model'],qs['fields'](_0x2ebce1[_0x613f('0x2f')]['fields']));_0x54ad8f['attributes']=_0x54ad8f['attributes'][_0x613f('0x33')]?_0x54ad8f['attributes']:_0x4f316c['model'];_0x54ad8f['order']=qs[_0x613f('0x39')](_0x2ebce1[_0x613f('0x2f')]['sort']);_0x54ad8f[_0x613f('0x3a')]=qs[_0x613f('0x3c')](_[_0x613f('0x3b')](_0x2ebce1[_0x613f('0x2f')],_0x4f316c['filters']));if(_0x2ebce1[_0x613f('0x2f')][_0x613f('0x3d')]){_0x54ad8f['where']=_[_0x613f('0x3e')](_0x54ad8f[_0x613f('0x3a')],{'$or':_[_0x613f('0x3f')](_0x54ad8f[_0x613f('0x32')],function(_0x1d28d5){var _0xdf8993={};_0xdf8993[_0x1d28d5]={'$like':'%'+_0x2ebce1[_0x613f('0x2f')][_0x613f('0x3d')]+'%'};return _0xdf8993;})});}_0x54ad8f=_[_0x613f('0x3e')]({},_0x54ad8f,_0x2ebce1[_0x613f('0x52')]);return _0x687e56[_0x613f('0x4f')](_0x54ad8f);}})[_0x613f('0x29')](function(_0x50d7ca){if(_0x50d7ca){_0x4b6eb3=_0x50d7ca[_0x613f('0x33')];if(!_0x2ebce1[_0x613f('0x2f')][_0x613f('0x34')](_0x613f('0x35'))){_0x54ad8f[_0x613f('0x36')]=qs[_0x613f('0x36')](_0x2ebce1['query'][_0x613f('0x36')]);_0x54ad8f[_0x613f('0x37')]=qs[_0x613f('0x37')](_0x2ebce1[_0x613f('0x2f')][_0x613f('0x37')]);}return _0x687e56[_0x613f('0x4f')](_0x54ad8f);}})['then'](function(_0x4efc80){if(_0x4efc80){return _0x4efc80?{'count':_0x4b6eb3,'rows':_0x4efc80}:null;}})[_0x613f('0x29')](respondWithResult(_0x63781a,null))[_0x613f('0x46')](handleError(_0x63781a,null));};exports[_0x613f('0x53')]=function(_0xddcd6,_0x4f28c7,_0x11d2f4){var _0x29e5c8={};var _0x3d8777={};var _0x3403f8;var _0x5af9c6;return db[_0x613f('0x2d')][_0x613f('0x50')]({'where':{'id':_0xddcd6[_0x613f('0x48')]['id']}})[_0x613f('0x29')](handleEntityNotFound(_0x4f28c7,null))[_0x613f('0x29')](function(_0x45e933){if(_0x45e933){_0x3403f8=_0x45e933;_0x3d8777[_0x613f('0x2e')]=_[_0x613f('0x49')](db['ZendeskField'][_0x613f('0x4a')]);_0x3d8777[_0x613f('0x2f')]=_[_0x613f('0x49')](_0xddcd6[_0x613f('0x2f')]);_0x3d8777[_0x613f('0x3c')]=_[_0x613f('0x30')](_0x3d8777[_0x613f('0x2e')],_0x3d8777[_0x613f('0x2f')]);_0x29e5c8[_0x613f('0x32')]=_[_0x613f('0x30')](_0x3d8777['model'],qs[_0x613f('0x31')](_0xddcd6[_0x613f('0x2f')][_0x613f('0x31')]));_0x29e5c8[_0x613f('0x32')]=_0x29e5c8[_0x613f('0x32')][_0x613f('0x33')]?_0x29e5c8[_0x613f('0x32')]:_0x3d8777[_0x613f('0x2e')];_0x29e5c8[_0x613f('0x38')]=qs[_0x613f('0x39')](_0xddcd6[_0x613f('0x2f')]['sort']);_0x29e5c8[_0x613f('0x3a')]=qs[_0x613f('0x3c')](_[_0x613f('0x3b')](_0xddcd6[_0x613f('0x2f')],_0x3d8777[_0x613f('0x3c')]));if(_0xddcd6[_0x613f('0x2f')][_0x613f('0x3d')]){_0x29e5c8[_0x613f('0x3a')]=_[_0x613f('0x3e')](_0x29e5c8[_0x613f('0x3a')],{'$or':_[_0x613f('0x3f')](_0x29e5c8[_0x613f('0x32')],function(_0x5b8563){var _0x30c62f={};_0x30c62f[_0x5b8563]={'$like':'%'+_0xddcd6[_0x613f('0x2f')]['filter']+'%'};return _0x30c62f;})});}_0x29e5c8=_[_0x613f('0x3e')]({},_0x29e5c8,_0xddcd6['options']);return _0x3403f8[_0x613f('0x53')](_0x29e5c8);}})['then'](function(_0x49cb13){if(_0x49cb13){_0x5af9c6=_0x49cb13[_0x613f('0x33')];if(!_0xddcd6[_0x613f('0x2f')][_0x613f('0x34')](_0x613f('0x35'))){_0x29e5c8[_0x613f('0x36')]=qs[_0x613f('0x36')](_0xddcd6[_0x613f('0x2f')]['limit']);_0x29e5c8[_0x613f('0x37')]=qs[_0x613f('0x37')](_0xddcd6[_0x613f('0x2f')][_0x613f('0x37')]);}return _0x3403f8[_0x613f('0x53')](_0x29e5c8);}})['then'](function(_0x3395b6){if(_0x3395b6){return _0x3395b6?{'count':_0x5af9c6,'rows':_0x3395b6}:null;}})[_0x613f('0x29')](respondWithResult(_0x4f28c7,null))['catch'](handleError(_0x4f28c7,null));};exports[_0x613f('0x54')]=function(_0x8073b2,_0x24d5e1,_0x4bb82e){var _0x48bee4={};var _0x5605c9={};var _0x39ae92;var _0x34a375;return db['ZendeskConfiguration'][_0x613f('0x50')]({'where':{'id':_0x8073b2[_0x613f('0x48')]['id']}})[_0x613f('0x29')](handleEntityNotFound(_0x24d5e1,null))['then'](function(_0x4618e9){if(_0x4618e9){_0x39ae92=_0x4618e9;_0x5605c9['model']=_[_0x613f('0x49')](db['ZendeskField']['rawAttributes']);_0x5605c9[_0x613f('0x2f')]=_[_0x613f('0x49')](_0x8073b2[_0x613f('0x2f')]);_0x5605c9[_0x613f('0x3c')]=_[_0x613f('0x30')](_0x5605c9[_0x613f('0x2e')],_0x5605c9[_0x613f('0x2f')]);_0x48bee4[_0x613f('0x32')]=_[_0x613f('0x30')](_0x5605c9[_0x613f('0x2e')],qs[_0x613f('0x31')](_0x8073b2['query'][_0x613f('0x31')]));_0x48bee4[_0x613f('0x32')]=_0x48bee4[_0x613f('0x32')][_0x613f('0x33')]?_0x48bee4[_0x613f('0x32')]:_0x5605c9[_0x613f('0x2e')];_0x48bee4[_0x613f('0x38')]=qs['sort'](_0x8073b2[_0x613f('0x2f')][_0x613f('0x39')]);_0x48bee4[_0x613f('0x3a')]=qs[_0x613f('0x3c')](_['pick'](_0x8073b2[_0x613f('0x2f')],_0x5605c9[_0x613f('0x3c')]));if(_0x8073b2[_0x613f('0x2f')][_0x613f('0x3d')]){_0x48bee4[_0x613f('0x3a')]=_[_0x613f('0x3e')](_0x48bee4['where'],{'$or':_[_0x613f('0x3f')](_0x48bee4[_0x613f('0x32')],function(_0x4ecf93){var _0x3fb109={};_0x3fb109[_0x4ecf93]={'$like':'%'+_0x8073b2[_0x613f('0x2f')][_0x613f('0x3d')]+'%'};return _0x3fb109;})});}_0x48bee4=_[_0x613f('0x3e')]({},_0x48bee4,_0x8073b2[_0x613f('0x52')]);return _0x39ae92['getDescriptions'](_0x48bee4);}})[_0x613f('0x29')](function(_0x16b071){if(_0x16b071){_0x34a375=_0x16b071[_0x613f('0x33')];if(!_0x8073b2[_0x613f('0x2f')][_0x613f('0x34')](_0x613f('0x35'))){_0x48bee4['limit']=qs['limit'](_0x8073b2[_0x613f('0x2f')][_0x613f('0x36')]);_0x48bee4[_0x613f('0x37')]=qs['offset'](_0x8073b2[_0x613f('0x2f')][_0x613f('0x37')]);}return _0x39ae92[_0x613f('0x54')](_0x48bee4);}})[_0x613f('0x29')](function(_0x5bf46e){if(_0x5bf46e){return _0x5bf46e?{'count':_0x34a375,'rows':_0x5bf46e}:null;}})[_0x613f('0x29')](respondWithResult(_0x24d5e1,null))[_0x613f('0x46')](handleError(_0x24d5e1,null));};exports['getTags']=function(_0x59df0c,_0x4b1256,_0xd4af6b){var _0x47f1f0={};var _0x2dc994={};var _0x35cc4d;var _0x2be5a8;return db[_0x613f('0x2d')]['findOne']({'where':{'id':_0x59df0c[_0x613f('0x48')]['id']}})[_0x613f('0x29')](handleEntityNotFound(_0x4b1256,null))[_0x613f('0x29')](function(_0x31762e){if(_0x31762e){_0x35cc4d=_0x31762e;_0x2dc994[_0x613f('0x2e')]=_[_0x613f('0x49')](db[_0x613f('0x55')]['rawAttributes']);_0x2dc994[_0x613f('0x2f')]=_[_0x613f('0x49')](_0x59df0c[_0x613f('0x2f')]);_0x2dc994['filters']=_[_0x613f('0x30')](_0x2dc994[_0x613f('0x2e')],_0x2dc994[_0x613f('0x2f')]);_0x47f1f0['attributes']=_[_0x613f('0x30')](_0x2dc994[_0x613f('0x2e')],qs[_0x613f('0x31')](_0x59df0c[_0x613f('0x2f')][_0x613f('0x31')]));_0x47f1f0[_0x613f('0x32')]=_0x47f1f0[_0x613f('0x32')][_0x613f('0x33')]?_0x47f1f0['attributes']:_0x2dc994['model'];_0x47f1f0[_0x613f('0x38')]=qs[_0x613f('0x39')](_0x59df0c[_0x613f('0x2f')][_0x613f('0x39')]);_0x47f1f0[_0x613f('0x3a')]=qs['filters'](_[_0x613f('0x3b')](_0x59df0c['query'],_0x2dc994[_0x613f('0x3c')]));if(_0x59df0c[_0x613f('0x2f')][_0x613f('0x3d')]){_0x47f1f0[_0x613f('0x3a')]=_['merge'](_0x47f1f0[_0x613f('0x3a')],{'$or':_[_0x613f('0x3f')](_0x47f1f0['attributes'],function(_0x1d1e26){var _0x59dd1f={};_0x59dd1f[_0x1d1e26]={'$like':'%'+_0x59df0c[_0x613f('0x2f')][_0x613f('0x3d')]+'%'};return _0x59dd1f;})});}_0x47f1f0=_[_0x613f('0x3e')]({},_0x47f1f0,_0x59df0c[_0x613f('0x52')]);return _0x35cc4d[_0x613f('0x56')](_0x47f1f0);}})['then'](function(_0x3f11b3){if(_0x3f11b3){_0x2be5a8=_0x3f11b3[_0x613f('0x33')];if(!_0x59df0c['query'][_0x613f('0x34')]('nolimit')){_0x47f1f0[_0x613f('0x36')]=qs[_0x613f('0x36')](_0x59df0c[_0x613f('0x2f')][_0x613f('0x36')]);_0x47f1f0[_0x613f('0x37')]=qs[_0x613f('0x37')](_0x59df0c[_0x613f('0x2f')]['offset']);}return _0x35cc4d[_0x613f('0x56')](_0x47f1f0);}})[_0x613f('0x29')](function(_0x3f98c4){if(_0x3f98c4){return _0x3f98c4?{'count':_0x2be5a8,'rows':_0x3f98c4}:null;}})[_0x613f('0x29')](respondWithResult(_0x4b1256,null))[_0x613f('0x46')](handleError(_0x4b1256,null));};exports[_0x613f('0x57')]=function(_0x13bcb8,_0x50d7ce,_0x1b3d21){if(_0x13bcb8[_0x613f('0x4d')]['id']){delete _0x13bcb8['body']['id'];}return db[_0x613f('0x2d')][_0x613f('0x50')]({'where':{'id':_0x13bcb8['params']['id']}})[_0x613f('0x29')](handleEntityNotFound(_0x50d7ce,null))[_0x613f('0x29')](function(_0x57eca4){if(_0x57eca4){return _0x57eca4[_0x613f('0x57')](_0x13bcb8[_0x613f('0x4d')][_0x613f('0x58')]||[]);}return null;})[_0x613f('0x29')](respondWithResult(_0x50d7ce,null))[_0x613f('0x46')](handleError(_0x50d7ce,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 77d16ac..981876c 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 _0xe065=['../../config/environment','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','int_zendesk_configurations','../../config/logger','api','bluebird','request-promise'];(function(_0x513545,_0x158f2e){var _0x18b7c5=function(_0x58514c){while(--_0x58514c){_0x513545['push'](_0x513545['shift']());}};_0x18b7c5(++_0x158f2e);}(_0xe065,0x16d));var _0x5e06=function(_0x1cacb9,_0x2b5680){_0x1cacb9=_0x1cacb9-0x0;var _0x5b2b49=_0xe065[_0x1cacb9];return _0x5b2b49;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5e06('0x0'))(_0x5e06('0x1'));var moment=require('moment');var BPromise=require(_0x5e06('0x2'));var rp=require(_0x5e06('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e06('0x4'));var attributes=require(_0x5e06('0x5'));module[_0x5e06('0x6')]=function(_0x21680f,_0x16da16){return _0x21680f['define'](_0x5e06('0x7'),attributes,{'tableName':_0x5e06('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa70d=['ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','moment','bluebird','request-promise','path','exports'];(function(_0x1e7af6,_0x3ab98b){var _0x67e6f9=function(_0x3ee13b){while(--_0x3ee13b){_0x1e7af6['push'](_0x1e7af6['shift']());}};_0x67e6f9(++_0x3ab98b);}(_0xa70d,0x14c));var _0xda70=function(_0x4a5554,_0x2dc0ea){_0x4a5554=_0x4a5554-0x0;var _0x457ab4=_0xa70d[_0x4a5554];return _0x457ab4;};'use strict';var _=require(_0xda70('0x0'));var util=require(_0xda70('0x1'));var logger=require('../../config/logger')(_0xda70('0x2'));var moment=require(_0xda70('0x3'));var BPromise=require(_0xda70('0x4'));var rp=require(_0xda70('0x5'));var fs=require('fs');var path=require(_0xda70('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0xda70('0x7')]=function(_0x427883,_0x39d107){return _0x427883['define'](_0xda70('0x8'),attributes,{'tableName':_0xda70('0x9'),'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 ee89a08..dfff5ff 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 _0x1b47=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1e8b1e,_0x407bbd){var _0x4a0fde=function(_0x4fd2be){while(--_0x4fd2be){_0x1e8b1e['push'](_0x1e8b1e['shift']());}};_0x4a0fde(++_0x407bbd);}(_0x1b47,0x125));var _0x71b4=function(_0x33b986,_0x40da5f){_0x33b986=_0x33b986-0x0;var _0x4ddaca=_0x1b47[_0x33b986];return _0x4ddaca;};'use strict';var _=require(_0x71b4('0x0'));var util=require(_0x71b4('0x1'));var moment=require('moment');var BPromise=require(_0x71b4('0x2'));var rs=require(_0x71b4('0x3'));var fs=require('fs');var Redis=require(_0x71b4('0x4'));var db=require(_0x71b4('0x5'))['db'];var utils=require(_0x71b4('0x6'));var logger=require(_0x71b4('0x7'))('rpc');var config=require(_0x71b4('0x8'));var jayson=require(_0x71b4('0x9'));var client=jayson[_0x71b4('0xa')][_0x71b4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6e54c8,_0x373f51,_0x209b00){return new BPromise(function(_0x2a4cc3,_0x238ca9){return client[_0x71b4('0xc')](_0x6e54c8,_0x209b00)[_0x71b4('0xd')](function(_0x34339a){logger[_0x71b4('0xe')](_0x71b4('0xf'),_0x373f51,_0x71b4('0x10'));logger['debug'](_0x71b4('0x11'),_0x373f51,_0x71b4('0x10'),JSON[_0x71b4('0x12')](_0x34339a));if(_0x34339a[_0x71b4('0x13')]){if(_0x34339a[_0x71b4('0x13')]['code']===0x1f4){logger['error'](_0x71b4('0xf'),_0x373f51,_0x34339a[_0x71b4('0x13')][_0x71b4('0x14')]);return _0x238ca9(_0x34339a[_0x71b4('0x13')]['message']);}logger[_0x71b4('0x13')](_0x71b4('0xf'),_0x373f51,_0x34339a['error'][_0x71b4('0x14')]);return _0x2a4cc3(_0x34339a[_0x71b4('0x13')][_0x71b4('0x14')]);}else{logger[_0x71b4('0xe')](_0x71b4('0xf'),_0x373f51,_0x71b4('0x10'));_0x2a4cc3(_0x34339a[_0x71b4('0x15')][_0x71b4('0x14')]);}})[_0x71b4('0x16')](function(_0x576ee4){logger[_0x71b4('0x13')](_0x71b4('0xf'),_0x373f51,_0x576ee4);_0x238ca9(_0x576ee4);});});} \ No newline at end of file +var _0x50bb=['result','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x44e14e,_0x293a2e){var _0x446768=function(_0x39b8d0){while(--_0x39b8d0){_0x44e14e['push'](_0x44e14e['shift']());}};_0x446768(++_0x293a2e);}(_0x50bb,0x19f));var _0xb50b=function(_0x4e86a3,_0xda2301){_0x4e86a3=_0x4e86a3-0x0;var _0x420a8f=_0x50bb[_0x4e86a3];return _0x420a8f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb50b('0x0'));var rs=require(_0xb50b('0x1'));var fs=require('fs');var Redis=require(_0xb50b('0x2'));var db=require(_0xb50b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb50b('0x4'))(_0xb50b('0x5'));var config=require(_0xb50b('0x6'));var jayson=require(_0xb50b('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xbd0c02,_0x359f54,_0x2c6a53){return new BPromise(function(_0x467766,_0x554515){return client['request'](_0xbd0c02,_0x2c6a53)[_0xb50b('0x8')](function(_0xbdd909){logger[_0xb50b('0x9')](_0xb50b('0xa'),_0x359f54,'request\x20sent');logger[_0xb50b('0xb')](_0xb50b('0xc'),_0x359f54,_0xb50b('0xd'),JSON['stringify'](_0xbdd909));if(_0xbdd909['error']){if(_0xbdd909[_0xb50b('0xe')][_0xb50b('0xf')]===0x1f4){logger[_0xb50b('0xe')](_0xb50b('0xa'),_0x359f54,_0xbdd909['error']['message']);return _0x554515(_0xbdd909['error'][_0xb50b('0x10')]);}logger[_0xb50b('0xe')](_0xb50b('0xa'),_0x359f54,_0xbdd909[_0xb50b('0xe')]['message']);return _0x467766(_0xbdd909[_0xb50b('0xe')][_0xb50b('0x10')]);}else{logger[_0xb50b('0x9')](_0xb50b('0xa'),_0x359f54,_0xb50b('0xd'));_0x467766(_0xbdd909[_0xb50b('0x11')]['message']);}})['catch'](function(_0x2283cc){logger[_0xb50b('0xe')](_0xb50b('0xa'),_0x359f54,_0x2283cc);_0x554515(_0x2283cc);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 1e469e7..cc1fe0e 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 _0xe9da=['./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4e1a63,_0x348c7d){var _0x3058f3=function(_0x968495){while(--_0x968495){_0x4e1a63['push'](_0x4e1a63['shift']());}};_0x3058f3(++_0x348c7d);}(_0xe9da,0x1dd));var _0xae9d=function(_0x12d47a,_0x4d9629){_0x12d47a=_0x12d47a-0x0;var _0x1b21d1=_0xe9da[_0x12d47a];return _0x1b21d1;};'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[_0xae9d('0x0')]();var auth=require(_0xae9d('0x1'));var interaction=require(_0xae9d('0x2'));var config=require('../../config/environment');var controller=require(_0xae9d('0x3'));router[_0xae9d('0x4')]('/',auth[_0xae9d('0x5')](),controller[_0xae9d('0x6')]);router[_0xae9d('0x4')](_0xae9d('0x7'),auth[_0xae9d('0x5')](),controller[_0xae9d('0x8')]);router[_0xae9d('0x9')]('/',auth[_0xae9d('0x5')](),controller[_0xae9d('0xa')]);router['put'](_0xae9d('0x7'),auth[_0xae9d('0x5')](),controller[_0xae9d('0xb')]);router[_0xae9d('0xc')]('/:id',auth[_0xae9d('0x5')](),controller[_0xae9d('0xd')]);module[_0xae9d('0xe')]=router; \ No newline at end of file +var _0xb82a=['get','/:id','show','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index'];(function(_0x2b7d31,_0x10e1c7){var _0x5b15ac=function(_0x105b29){while(--_0x105b29){_0x2b7d31['push'](_0x2b7d31['shift']());}};_0x5b15ac(++_0x10e1c7);}(_0xb82a,0x82));var _0xab82=function(_0x4afece,_0x410511){_0x4afece=_0x4afece-0x0;var _0x554dcc=_0xb82a[_0x4afece];return _0x554dcc;};'use strict';var multer=require(_0xab82('0x0'));var util=require(_0xab82('0x1'));var path=require(_0xab82('0x2'));var timeout=require(_0xab82('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xab82('0x4'));var interaction=require(_0xab82('0x5'));var config=require(_0xab82('0x6'));var controller=require(_0xab82('0x7'));router['get']('/',auth[_0xab82('0x8')](),controller[_0xab82('0x9')]);router[_0xab82('0xa')](_0xab82('0xb'),auth[_0xab82('0x8')](),controller[_0xab82('0xc')]);router['post']('/',auth[_0xab82('0x8')](),controller['create']);router['put'](_0xab82('0xb'),auth[_0xab82('0x8')](),controller['update']);router['delete'](_0xab82('0xb'),auth['isAuthenticated'](),controller[_0xab82('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 128d0e2..d886c61 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 _0x7bbd=['exports','ENUM','string','STRING','variable','customVariable','BOOLEAN','sequelize'];(function(_0x52484e,_0x15b3c7){var _0x2c6a43=function(_0x3a2f5b){while(--_0x3a2f5b){_0x52484e['push'](_0x52484e['shift']());}};_0x2c6a43(++_0x15b3c7);}(_0x7bbd,0x11f));var _0xd7bb=function(_0x404e9f,_0x492480){_0x404e9f=_0x404e9f-0x0;var _0x10db0d=_0x7bbd[_0x404e9f];return _0x10db0d;};'use strict';var Sequelize=require(_0xd7bb('0x0'));module[_0xd7bb('0x1')]={'type':{'type':Sequelize[_0xd7bb('0x2')](_0xd7bb('0x3'),'variable','customVariable','keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0xd7bb('0x4')]},'key':{'type':Sequelize[_0xd7bb('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xd7bb('0x3'),_0xd7bb('0x5'),_0xd7bb('0x6'))},'keyContent':{'type':Sequelize[_0xd7bb('0x4')]},'idField':{'type':Sequelize[_0xd7bb('0x4')]},'nameField':{'type':Sequelize[_0xd7bb('0x4')]},'customField':{'type':Sequelize[_0xd7bb('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd7bb('0x4')]}}; \ No newline at end of file +var _0x0588=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0588,0xd8));var _0x8058=function(_0x253173,_0x188791){_0x253173=_0x253173-0x0;var _0x5e2159=_0x0588[_0x253173];return _0x5e2159;};'use strict';var Sequelize=require(_0x8058('0x0'));module[_0x8058('0x1')]={'type':{'type':Sequelize[_0x8058('0x2')](_0x8058('0x3'),_0x8058('0x4'),_0x8058('0x5'),_0x8058('0x6')),'defaultValue':_0x8058('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8058('0x2')](_0x8058('0x3'),_0x8058('0x4'),_0x8058('0x5'))},'keyContent':{'type':Sequelize[_0x8058('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8058('0x7')]},'customField':{'type':Sequelize[_0x8058('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8058('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index e1a219b..fb81511 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 _0xa5a4=['../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','ZendeskField','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x5da8db,_0x5c2103){var _0x1eb753=function(_0xb498c6){while(--_0xb498c6){_0x5da8db['push'](_0x5da8db['shift']());}};_0x1eb753(++_0x5c2103);}(_0xa5a4,0x10c));var _0x4a5a=function(_0x81dcac,_0x8ff7db){_0x81dcac=_0x81dcac-0x0;var _0xc7803b=_0xa5a4[_0x81dcac];return _0xc7803b;};'use strict';var pdf=require(_0x4a5a('0x0'));var emlformat=require(_0x4a5a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4a5a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4a5a('0x3'));var moment=require(_0x4a5a('0x4'));var BPromise=require(_0x4a5a('0x5'));var Mustache=require(_0x4a5a('0x6'));var util=require(_0x4a5a('0x7'));var path=require(_0x4a5a('0x8'));var sox=require(_0x4a5a('0x9'));var csv=require(_0x4a5a('0xa'));var ejs=require(_0x4a5a('0xb'));var fs=require('fs');var _=require(_0x4a5a('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4a5a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4a5a('0xa'));var querystring=require('querystring');var Papa=require(_0x4a5a('0xe'));var Redis=require('ioredis');var authService=require(_0x4a5a('0xf'));var qs=require(_0x4a5a('0x10'));var hardwareService=require(_0x4a5a('0x11'));var logger=require(_0x4a5a('0x12'))(_0x4a5a('0x13'));var utils=require(_0x4a5a('0x14'));var config=require('../../config/environment');var db=require(_0x4a5a('0x15'))['db'];function respondWithStatusCode(_0xfdc363,_0x2dfc74){_0x2dfc74=_0x2dfc74||0xcc;return function(_0x45444d){if(_0x45444d){return _0xfdc363[_0x4a5a('0x16')](_0x2dfc74);}return _0xfdc363[_0x4a5a('0x17')](_0x2dfc74)[_0x4a5a('0x18')]();};}function respondWithResult(_0x4308d4,_0x484949){_0x484949=_0x484949||0xc8;return function(_0x1b95dd){if(_0x1b95dd){return _0x4308d4['status'](_0x484949)[_0x4a5a('0x19')](_0x1b95dd);}};}function respondWithFilteredResult(_0x1d04d5,_0x5d6e68){return function(_0x284917){if(_0x284917){var _0x40abe2=_0x284917['count'],_0x4fa10d=_0x5d6e68['offset'],_0xb63538=_0x5d6e68[_0x4a5a('0x1a')]+_0x5d6e68[_0x4a5a('0x1b')],_0xfa9f4;if(_0xb63538>=_0x40abe2){_0xb63538=_0x40abe2;_0xfa9f4=0xc8;}else{_0xfa9f4=0xce;}_0x1d04d5[_0x4a5a('0x17')](_0xfa9f4);return _0x1d04d5[_0x4a5a('0x1c')](_0x4a5a('0x1d'),_0x4fa10d+'-'+_0xb63538+'/'+_0x40abe2)['json'](_0x284917);}return null;};}function patchUpdates(_0x20ebab){return function(_0x16f536){try{jsonpatch[_0x4a5a('0x1e')](_0x16f536,_0x20ebab,!![]);}catch(_0x575422){return BPromise[_0x4a5a('0x1f')](_0x575422);}return _0x16f536[_0x4a5a('0x20')]();};}function saveUpdates(_0x58fbb3,_0x19dee2){return function(_0x2594cd){if(_0x2594cd){return _0x2594cd['update'](_0x58fbb3)[_0x4a5a('0x21')](function(_0x457cf7){return _0x457cf7;});}return null;};}function removeEntity(_0x5ab990,_0x9c096){return function(_0x1f92aa){if(_0x1f92aa){return _0x1f92aa[_0x4a5a('0x22')]()[_0x4a5a('0x21')](function(){_0x5ab990['status'](0xcc)[_0x4a5a('0x18')]();});}};}function handleEntityNotFound(_0x195055,_0x459a1a){return function(_0x356778){if(!_0x356778){_0x195055[_0x4a5a('0x16')](0x194);}return _0x356778;};}function handleError(_0x2fae3e,_0x5c379e){_0x5c379e=_0x5c379e||0x1f4;return function(_0xddb4a9){logger[_0x4a5a('0x23')](_0xddb4a9[_0x4a5a('0x24')]);if(_0xddb4a9['name']){delete _0xddb4a9[_0x4a5a('0x25')];}_0x2fae3e['status'](_0x5c379e)[_0x4a5a('0x26')](_0xddb4a9);};}exports['index']=function(_0x126142,_0x5b30cd){var _0x530996={},_0x29e1c2={},_0x27640a={'count':0x0,'rows':[]};var _0x29b518=db[_0x4a5a('0x27')][_0x4a5a('0x28')];_0x29e1c2[_0x4a5a('0x29')]=_[_0x4a5a('0x2a')](_0x29b518);_0x29e1c2['query']=_['keys'](_0x126142[_0x4a5a('0x2b')]);_0x29e1c2['filters']=_['intersection'](_0x29e1c2[_0x4a5a('0x29')],_0x29e1c2['query']);_0x530996['attributes']=_[_0x4a5a('0x2c')](_0x29e1c2[_0x4a5a('0x29')],qs[_0x4a5a('0x2d')](_0x126142[_0x4a5a('0x2b')][_0x4a5a('0x2d')]));_0x530996[_0x4a5a('0x2e')]=_0x530996[_0x4a5a('0x2e')][_0x4a5a('0x2f')]?_0x530996[_0x4a5a('0x2e')]:_0x29e1c2[_0x4a5a('0x29')];if(!_0x126142['query'][_0x4a5a('0x30')](_0x4a5a('0x31'))){_0x530996[_0x4a5a('0x1b')]=qs['limit'](_0x126142[_0x4a5a('0x2b')]['limit']);_0x530996[_0x4a5a('0x1a')]=qs[_0x4a5a('0x1a')](_0x126142['query'][_0x4a5a('0x1a')]);}_0x530996[_0x4a5a('0x32')]=qs[_0x4a5a('0x33')](_0x126142[_0x4a5a('0x2b')][_0x4a5a('0x33')]);_0x530996[_0x4a5a('0x34')]=qs[_0x4a5a('0x35')](_[_0x4a5a('0x36')](_0x126142[_0x4a5a('0x2b')],_0x29e1c2[_0x4a5a('0x35')]));if(_0x126142[_0x4a5a('0x2b')]['filter']){_0x530996['where']=_[_0x4a5a('0x37')](_0x530996[_0x4a5a('0x34')],{'$or':_[_0x4a5a('0x38')](_0x29b518,function(_0x56017e){if(_0x56017e['type'][_0x4a5a('0x39')]!==_0x4a5a('0x3a')){var _0x4c374f={};_0x4c374f[_0x56017e[_0x4a5a('0x3b')]]={'$like':'%'+_0x126142[_0x4a5a('0x2b')]['filter']+'%'};return _0x4c374f;}})});}_0x530996=_[_0x4a5a('0x37')]({},_0x530996,_0x126142[_0x4a5a('0x3c')]);var _0x232660={'where':_0x530996[_0x4a5a('0x34')]};return db[_0x4a5a('0x27')][_0x4a5a('0x3d')](_0x232660)[_0x4a5a('0x21')](function(_0x37e781){_0x27640a['count']=_0x37e781;if(_0x126142[_0x4a5a('0x2b')][_0x4a5a('0x3e')]){_0x530996[_0x4a5a('0x3f')]=[{'all':!![]}];}return db[_0x4a5a('0x27')][_0x4a5a('0x40')](_0x530996);})[_0x4a5a('0x21')](function(_0x255ae4){_0x27640a[_0x4a5a('0x41')]=_0x255ae4;return _0x27640a;})[_0x4a5a('0x21')](respondWithFilteredResult(_0x5b30cd,_0x530996))['catch'](handleError(_0x5b30cd,null));};exports[_0x4a5a('0x42')]=function(_0x50fa90,_0x3f8fa6){var _0x2dcb7d={'raw':!![],'where':{'id':_0x50fa90[_0x4a5a('0x43')]['id']}},_0x325eac={};_0x325eac[_0x4a5a('0x29')]=_['keys'](db[_0x4a5a('0x27')][_0x4a5a('0x28')]);_0x325eac[_0x4a5a('0x2b')]=_[_0x4a5a('0x2a')](_0x50fa90['query']);_0x325eac[_0x4a5a('0x35')]=_[_0x4a5a('0x2c')](_0x325eac[_0x4a5a('0x29')],_0x325eac[_0x4a5a('0x2b')]);_0x2dcb7d['attributes']=_['intersection'](_0x325eac[_0x4a5a('0x29')],qs[_0x4a5a('0x2d')](_0x50fa90['query'][_0x4a5a('0x2d')]));_0x2dcb7d['attributes']=_0x2dcb7d[_0x4a5a('0x2e')][_0x4a5a('0x2f')]?_0x2dcb7d['attributes']:_0x325eac[_0x4a5a('0x29')];if(_0x50fa90['query']['includeAll']){_0x2dcb7d[_0x4a5a('0x3f')]=[{'all':!![]}];}_0x2dcb7d=_['merge']({},_0x2dcb7d,_0x50fa90[_0x4a5a('0x3c')]);return db[_0x4a5a('0x27')][_0x4a5a('0x44')](_0x2dcb7d)[_0x4a5a('0x21')](handleEntityNotFound(_0x3f8fa6,null))['then'](respondWithResult(_0x3f8fa6,null))[_0x4a5a('0x45')](handleError(_0x3f8fa6,null));};exports['create']=function(_0x411339,_0x293d0c){return db[_0x4a5a('0x27')][_0x4a5a('0x46')](_0x411339[_0x4a5a('0x47')],{})[_0x4a5a('0x21')](respondWithResult(_0x293d0c,0xc9))['catch'](handleError(_0x293d0c,null));};exports['update']=function(_0x32f0c3,_0x33e938){if(_0x32f0c3[_0x4a5a('0x47')]['id']){delete _0x32f0c3['body']['id'];}return db[_0x4a5a('0x27')][_0x4a5a('0x44')]({'where':{'id':_0x32f0c3[_0x4a5a('0x43')]['id']}})[_0x4a5a('0x21')](handleEntityNotFound(_0x33e938,null))[_0x4a5a('0x21')](saveUpdates(_0x32f0c3[_0x4a5a('0x47')],null))[_0x4a5a('0x21')](respondWithResult(_0x33e938,null))[_0x4a5a('0x45')](handleError(_0x33e938,null));};exports[_0x4a5a('0x22')]=function(_0x27195e,_0x2ab01f){return db['ZendeskField'][_0x4a5a('0x44')]({'where':{'id':_0x27195e['params']['id']}})[_0x4a5a('0x21')](handleEntityNotFound(_0x2ab01f,null))['then'](removeEntity(_0x2ab01f,null))[_0x4a5a('0x45')](handleError(_0x2ab01f,null));}; \ No newline at end of file +var _0x7db5=['filter','where','map','key','VIRTUAL','field','merge','options','includeAll','include','rows','catch','show','params','find','create','body','html-pdf','eml-format','fast-json-patch','moment','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','save','update','then','destroy','error','stack','name','index','ZendeskField','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x5e745e,_0xde2931){var _0x122dab=function(_0xe396a5){while(--_0xe396a5){_0x5e745e['push'](_0x5e745e['shift']());}};_0x122dab(++_0xde2931);}(_0x7db5,0x9d));var _0x57db=function(_0x131246,_0x1a9613){_0x131246=_0x131246-0x0;var _0x437429=_0x7db5[_0x131246];return _0x437429;};'use strict';var pdf=require(_0x57db('0x0'));var emlformat=require(_0x57db('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x57db('0x2'));var rp=require('request-promise');var moment=require(_0x57db('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x57db('0x4'));var sox=require(_0x57db('0x5'));var csv=require('to-csv');var ejs=require(_0x57db('0x6'));var fs=require('fs');var _=require(_0x57db('0x7'));var squel=require(_0x57db('0x8'));var crypto=require(_0x57db('0x9'));var jsforce=require(_0x57db('0xa'));var deskjs=require(_0x57db('0xb'));var toCsv=require(_0x57db('0xc'));var querystring=require(_0x57db('0xd'));var Papa=require(_0x57db('0xe'));var Redis=require(_0x57db('0xf'));var authService=require(_0x57db('0x10'));var qs=require(_0x57db('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x57db('0x12'))(_0x57db('0x13'));var utils=require('../../config/utils');var config=require(_0x57db('0x14'));var db=require(_0x57db('0x15'))['db'];function respondWithStatusCode(_0x42b5f8,_0x19745f){_0x19745f=_0x19745f||0xcc;return function(_0x41a4ef){if(_0x41a4ef){return _0x42b5f8[_0x57db('0x16')](_0x19745f);}return _0x42b5f8[_0x57db('0x17')](_0x19745f)[_0x57db('0x18')]();};}function respondWithResult(_0x35ffb8,_0x4530b4){_0x4530b4=_0x4530b4||0xc8;return function(_0x249c79){if(_0x249c79){return _0x35ffb8['status'](_0x4530b4)[_0x57db('0x19')](_0x249c79);}};}function respondWithFilteredResult(_0x3852fd,_0x43f09f){return function(_0x2455ed){if(_0x2455ed){var _0x841103=_0x2455ed[_0x57db('0x1a')],_0x1ecb05=_0x43f09f[_0x57db('0x1b')],_0x19ea13=_0x43f09f[_0x57db('0x1b')]+_0x43f09f[_0x57db('0x1c')],_0x1e8029;if(_0x19ea13>=_0x841103){_0x19ea13=_0x841103;_0x1e8029=0xc8;}else{_0x1e8029=0xce;}_0x3852fd['status'](_0x1e8029);return _0x3852fd[_0x57db('0x1d')]('Content-Range',_0x1ecb05+'-'+_0x19ea13+'/'+_0x841103)[_0x57db('0x19')](_0x2455ed);}return null;};}function patchUpdates(_0xf64812){return function(_0x101073){try{jsonpatch['apply'](_0x101073,_0xf64812,!![]);}catch(_0x294e4f){return BPromise['reject'](_0x294e4f);}return _0x101073[_0x57db('0x1e')]();};}function saveUpdates(_0x5174d5,_0x3a260c){return function(_0x4c2024){if(_0x4c2024){return _0x4c2024[_0x57db('0x1f')](_0x5174d5)[_0x57db('0x20')](function(_0x1ed80a){return _0x1ed80a;});}return null;};}function removeEntity(_0x408350,_0x3b76d7){return function(_0x38ecf1){if(_0x38ecf1){return _0x38ecf1[_0x57db('0x21')]()['then'](function(){_0x408350[_0x57db('0x17')](0xcc)[_0x57db('0x18')]();});}};}function handleEntityNotFound(_0x4f20c4,_0x39125a){return function(_0x442043){if(!_0x442043){_0x4f20c4['sendStatus'](0x194);}return _0x442043;};}function handleError(_0x4128e6,_0x22892e){_0x22892e=_0x22892e||0x1f4;return function(_0x232409){logger[_0x57db('0x22')](_0x232409[_0x57db('0x23')]);if(_0x232409[_0x57db('0x24')]){delete _0x232409[_0x57db('0x24')];}_0x4128e6['status'](_0x22892e)['send'](_0x232409);};}exports[_0x57db('0x25')]=function(_0x457aee,_0x1775fc){var _0x24cc25={},_0x34ce85={},_0x57ca9d={'count':0x0,'rows':[]};var _0x4515aa=db[_0x57db('0x26')][_0x57db('0x27')];_0x34ce85[_0x57db('0x28')]=_[_0x57db('0x29')](_0x4515aa);_0x34ce85[_0x57db('0x2a')]=_['keys'](_0x457aee[_0x57db('0x2a')]);_0x34ce85[_0x57db('0x2b')]=_[_0x57db('0x2c')](_0x34ce85['model'],_0x34ce85['query']);_0x24cc25['attributes']=_[_0x57db('0x2c')](_0x34ce85[_0x57db('0x28')],qs[_0x57db('0x2d')](_0x457aee[_0x57db('0x2a')]['fields']));_0x24cc25['attributes']=_0x24cc25[_0x57db('0x2e')][_0x57db('0x2f')]?_0x24cc25['attributes']:_0x34ce85[_0x57db('0x28')];if(!_0x457aee['query'][_0x57db('0x30')](_0x57db('0x31'))){_0x24cc25[_0x57db('0x1c')]=qs[_0x57db('0x1c')](_0x457aee[_0x57db('0x2a')]['limit']);_0x24cc25[_0x57db('0x1b')]=qs[_0x57db('0x1b')](_0x457aee[_0x57db('0x2a')]['offset']);}_0x24cc25[_0x57db('0x32')]=qs[_0x57db('0x33')](_0x457aee['query']['sort']);_0x24cc25['where']=qs[_0x57db('0x2b')](_[_0x57db('0x34')](_0x457aee[_0x57db('0x2a')],_0x34ce85['filters']));if(_0x457aee[_0x57db('0x2a')][_0x57db('0x35')]){_0x24cc25[_0x57db('0x36')]=_['merge'](_0x24cc25[_0x57db('0x36')],{'$or':_[_0x57db('0x37')](_0x4515aa,function(_0x1b554e){if(_0x1b554e['type'][_0x57db('0x38')]!==_0x57db('0x39')){var _0x5a69b0={};_0x5a69b0[_0x1b554e[_0x57db('0x3a')]]={'$like':'%'+_0x457aee[_0x57db('0x2a')]['filter']+'%'};return _0x5a69b0;}})});}_0x24cc25=_[_0x57db('0x3b')]({},_0x24cc25,_0x457aee[_0x57db('0x3c')]);var _0x42c995={'where':_0x24cc25[_0x57db('0x36')]};return db[_0x57db('0x26')]['count'](_0x42c995)[_0x57db('0x20')](function(_0x28b5db){_0x57ca9d['count']=_0x28b5db;if(_0x457aee[_0x57db('0x2a')][_0x57db('0x3d')]){_0x24cc25[_0x57db('0x3e')]=[{'all':!![]}];}return db[_0x57db('0x26')]['findAll'](_0x24cc25);})['then'](function(_0xd17679){_0x57ca9d[_0x57db('0x3f')]=_0xd17679;return _0x57ca9d;})[_0x57db('0x20')](respondWithFilteredResult(_0x1775fc,_0x24cc25))[_0x57db('0x40')](handleError(_0x1775fc,null));};exports[_0x57db('0x41')]=function(_0x136291,_0x2b0f34){var _0x43efa1={'raw':!![],'where':{'id':_0x136291[_0x57db('0x42')]['id']}},_0x15cb42={};_0x15cb42[_0x57db('0x28')]=_[_0x57db('0x29')](db[_0x57db('0x26')]['rawAttributes']);_0x15cb42[_0x57db('0x2a')]=_[_0x57db('0x29')](_0x136291['query']);_0x15cb42['filters']=_[_0x57db('0x2c')](_0x15cb42[_0x57db('0x28')],_0x15cb42[_0x57db('0x2a')]);_0x43efa1[_0x57db('0x2e')]=_[_0x57db('0x2c')](_0x15cb42['model'],qs['fields'](_0x136291['query'][_0x57db('0x2d')]));_0x43efa1['attributes']=_0x43efa1[_0x57db('0x2e')][_0x57db('0x2f')]?_0x43efa1[_0x57db('0x2e')]:_0x15cb42[_0x57db('0x28')];if(_0x136291[_0x57db('0x2a')][_0x57db('0x3d')]){_0x43efa1[_0x57db('0x3e')]=[{'all':!![]}];}_0x43efa1=_['merge']({},_0x43efa1,_0x136291[_0x57db('0x3c')]);return db[_0x57db('0x26')][_0x57db('0x43')](_0x43efa1)[_0x57db('0x20')](handleEntityNotFound(_0x2b0f34,null))['then'](respondWithResult(_0x2b0f34,null))[_0x57db('0x40')](handleError(_0x2b0f34,null));};exports['create']=function(_0x244686,_0x2fc055){return db[_0x57db('0x26')][_0x57db('0x44')](_0x244686['body'],{})['then'](respondWithResult(_0x2fc055,0xc9))[_0x57db('0x40')](handleError(_0x2fc055,null));};exports[_0x57db('0x1f')]=function(_0x4a4c3e,_0x156a91){if(_0x4a4c3e[_0x57db('0x45')]['id']){delete _0x4a4c3e[_0x57db('0x45')]['id'];}return db[_0x57db('0x26')]['find']({'where':{'id':_0x4a4c3e[_0x57db('0x42')]['id']}})[_0x57db('0x20')](handleEntityNotFound(_0x156a91,null))['then'](saveUpdates(_0x4a4c3e[_0x57db('0x45')],null))[_0x57db('0x20')](respondWithResult(_0x156a91,null))['catch'](handleError(_0x156a91,null));};exports[_0x57db('0x21')]=function(_0x3ccddc,_0xd8cd08){return db['ZendeskField'][_0x57db('0x43')]({'where':{'id':_0x3ccddc['params']['id']}})[_0x57db('0x20')](handleEntityNotFound(_0xd8cd08,null))[_0x57db('0x20')](removeEntity(_0xd8cd08,null))[_0x57db('0x40')](handleError(_0xd8cd08,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 2221674..0bb8695 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 _0x8369=['api','moment','bluebird','request-promise','rimraf','./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x330851,_0x46769a){var _0x4294d3=function(_0x3ab3fc){while(--_0x3ab3fc){_0x330851['push'](_0x330851['shift']());}};_0x4294d3(++_0x46769a);}(_0x8369,0x10b));var _0x9836=function(_0x1ec1f7,_0x71c8e6){_0x1ec1f7=_0x1ec1f7-0x0;var _0x92e482=_0x8369[_0x1ec1f7];return _0x92e482;};'use strict';var _=require(_0x9836('0x0'));var util=require(_0x9836('0x1'));var logger=require(_0x9836('0x2'))(_0x9836('0x3'));var moment=require(_0x9836('0x4'));var BPromise=require(_0x9836('0x5'));var rp=require(_0x9836('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9836('0x7'));var config=require('../../config/environment');var attributes=require(_0x9836('0x8'));module[_0x9836('0x9')]=function(_0x4e937c,_0x33ac6d){return _0x4e937c[_0x9836('0xa')]('ZendeskField',attributes,{'tableName':_0x9836('0xb'),'paranoid':![],'indexes':[{'name':_0x9836('0xc'),'fields':[_0x9836('0xd'),_0x9836('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5397=['request-promise','path','rimraf','../../config/environment','exports','define','ZendeskField','zendesk_unique_index','FieldId','util','../../config/logger','api','moment','bluebird'];(function(_0x14b6ad,_0xc94c37){var _0x49f6f3=function(_0x52f81a){while(--_0x52f81a){_0x14b6ad['push'](_0x14b6ad['shift']());}};_0x49f6f3(++_0xc94c37);}(_0x5397,0x105));var _0x7539=function(_0x1b5a4a,_0x30c601){_0x1b5a4a=_0x1b5a4a-0x0;var _0x19e4ef=_0x5397[_0x1b5a4a];return _0x19e4ef;};'use strict';var _=require('lodash');var util=require(_0x7539('0x0'));var logger=require(_0x7539('0x1'))(_0x7539('0x2'));var moment=require(_0x7539('0x3'));var BPromise=require(_0x7539('0x4'));var rp=require(_0x7539('0x5'));var fs=require('fs');var path=require(_0x7539('0x6'));var rimraf=require(_0x7539('0x7'));var config=require(_0x7539('0x8'));var attributes=require('./intZendeskField.attributes');module[_0x7539('0x9')]=function(_0x3486c2,_0x4486c0){return _0x3486c2[_0x7539('0xa')](_0x7539('0xb'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x7539('0xc'),'fields':['idField',_0x7539('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 3ae753d..5d9233e 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 _0x9b9a=['error','code','message','ZendeskField,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1bda6c,_0x5440b1){var _0x501a86=function(_0x1de54c){while(--_0x1de54c){_0x1bda6c['push'](_0x1bda6c['shift']());}};_0x501a86(++_0x5440b1);}(_0x9b9a,0xff));var _0xa9b9=function(_0x7b9649,_0x5eb7c1){_0x7b9649=_0x7b9649-0x0;var _0x3f7fed=_0x9b9a[_0x7b9649];return _0x3f7fed;};'use strict';var _=require(_0xa9b9('0x0'));var util=require(_0xa9b9('0x1'));var moment=require(_0xa9b9('0x2'));var BPromise=require(_0xa9b9('0x3'));var rs=require(_0xa9b9('0x4'));var fs=require('fs');var Redis=require(_0xa9b9('0x5'));var db=require(_0xa9b9('0x6'))['db'];var utils=require(_0xa9b9('0x7'));var logger=require(_0xa9b9('0x8'))(_0xa9b9('0x9'));var config=require(_0xa9b9('0xa'));var jayson=require(_0xa9b9('0xb'));var client=jayson[_0xa9b9('0xc')][_0xa9b9('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3d9396,_0x4b795c,_0x5a6b3e){return new BPromise(function(_0x3034da,_0x2a97f4){return client[_0xa9b9('0xe')](_0x3d9396,_0x5a6b3e)[_0xa9b9('0xf')](function(_0x35adc5){logger[_0xa9b9('0x10')]('ZendeskField,\x20%s,\x20%s',_0x4b795c,'request\x20sent');logger['debug'](_0xa9b9('0x11'),_0x4b795c,_0xa9b9('0x12'),JSON[_0xa9b9('0x13')](_0x35adc5));if(_0x35adc5['error']){if(_0x35adc5[_0xa9b9('0x14')][_0xa9b9('0x15')]===0x1f4){logger[_0xa9b9('0x14')]('ZendeskField,\x20%s,\x20%s',_0x4b795c,_0x35adc5[_0xa9b9('0x14')][_0xa9b9('0x16')]);return _0x2a97f4(_0x35adc5[_0xa9b9('0x14')][_0xa9b9('0x16')]);}logger[_0xa9b9('0x14')](_0xa9b9('0x17'),_0x4b795c,_0x35adc5[_0xa9b9('0x14')][_0xa9b9('0x16')]);return _0x3034da(_0x35adc5[_0xa9b9('0x14')][_0xa9b9('0x16')]);}else{logger[_0xa9b9('0x10')](_0xa9b9('0x17'),_0x4b795c,'request\x20sent');_0x3034da(_0x35adc5['result'][_0xa9b9('0x16')]);}})[_0xa9b9('0x18')](function(_0x445f5f){logger[_0xa9b9('0x14')](_0xa9b9('0x17'),_0x4b795c,_0x445f5f);_0x2a97f4(_0x445f5f);});});} \ No newline at end of file +var _0x200d=['client','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x5b906a,_0x31b5fc){var _0x2a1dcf=function(_0xfa4904){while(--_0xfa4904){_0x5b906a['push'](_0x5b906a['shift']());}};_0x2a1dcf(++_0x31b5fc);}(_0x200d,0x15f));var _0xd200=function(_0x3074f1,_0x4901aa){_0x3074f1=_0x3074f1-0x0;var _0x149af8=_0x200d[_0x3074f1];return _0x149af8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd200('0x0'));var fs=require('fs');var Redis=require(_0xd200('0x1'));var db=require(_0xd200('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd200('0x3'));var config=require(_0xd200('0x4'));var jayson=require(_0xd200('0x5'));var client=jayson[_0xd200('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x531953,_0x3248a0,_0x5f53c6){return new BPromise(function(_0x1fe02f,_0x1e6d81){return client['request'](_0x531953,_0x5f53c6)[_0xd200('0x7')](function(_0x7b006f){logger['info'](_0xd200('0x8'),_0x3248a0,_0xd200('0x9'));logger[_0xd200('0xa')](_0xd200('0xb'),_0x3248a0,'request\x20sent',JSON['stringify'](_0x7b006f));if(_0x7b006f[_0xd200('0xc')]){if(_0x7b006f['error'][_0xd200('0xd')]===0x1f4){logger[_0xd200('0xc')](_0xd200('0x8'),_0x3248a0,_0x7b006f[_0xd200('0xc')]['message']);return _0x1e6d81(_0x7b006f[_0xd200('0xc')][_0xd200('0xe')]);}logger['error'](_0xd200('0x8'),_0x3248a0,_0x7b006f[_0xd200('0xc')]['message']);return _0x1fe02f(_0x7b006f[_0xd200('0xc')][_0xd200('0xe')]);}else{logger[_0xd200('0xf')]('ZendeskField,\x20%s,\x20%s',_0x3248a0,_0xd200('0x9'));_0x1fe02f(_0x7b006f[_0xd200('0x10')][_0xd200('0xe')]);}})['catch'](function(_0x561547){logger[_0xd200('0xc')]('ZendeskField,\x20%s,\x20%s',_0x3248a0,_0x561547);_0x1e6d81(_0x561547);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 7367af0..a80106a 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 _0x2d54=['create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d54,0x16b));var _0x42d5=function(_0x48c85d,_0x5c90b2){_0x48c85d=_0x48c85d-0x0;var _0x194214=_0x2d54[_0x48c85d];return _0x194214;};'use strict';var multer=require(_0x42d5('0x0'));var util=require(_0x42d5('0x1'));var path=require('path');var timeout=require(_0x42d5('0x2'));var express=require('express');var router=express[_0x42d5('0x3')]();var auth=require(_0x42d5('0x4'));var interaction=require(_0x42d5('0x5'));var config=require(_0x42d5('0x6'));var controller=require('./intZohoAccount.controller');router[_0x42d5('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x42d5('0x8'),auth[_0x42d5('0x9')](),controller[_0x42d5('0xa')]);router[_0x42d5('0x7')](_0x42d5('0xb'),auth[_0x42d5('0x9')](),controller[_0x42d5('0xc')]);router['get']('/:id/fields',auth[_0x42d5('0x9')](),controller[_0x42d5('0xd')]);router[_0x42d5('0xe')]('/',auth['isAuthenticated'](),controller[_0x42d5('0xf')]);router[_0x42d5('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x42d5('0x10')](_0x42d5('0x8'),auth[_0x42d5('0x9')](),controller[_0x42d5('0x11')]);router[_0x42d5('0x12')](_0x42d5('0x8'),auth['isAuthenticated'](),controller[_0x42d5('0x13')]);module[_0x42d5('0x14')]=router; \ No newline at end of file +var _0x5d5d=['show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','destroy','exports','multer','connect-timeout','express','Router','./intZohoAccount.controller','get','isAuthenticated','/:id'];(function(_0x85e2f0,_0x2b255c){var _0x25b323=function(_0x1ce3ab){while(--_0x1ce3ab){_0x85e2f0['push'](_0x85e2f0['shift']());}};_0x25b323(++_0x2b255c);}(_0x5d5d,0x7d));var _0xd5d5=function(_0x5f45bb,_0xb63da1){_0x5f45bb=_0x5f45bb-0x0;var _0x65b12c=_0x5d5d[_0x5f45bb];return _0x65b12c;};'use strict';var multer=require(_0xd5d5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd5d5('0x1'));var express=require(_0xd5d5('0x2'));var router=express[_0xd5d5('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd5d5('0x4'));router[_0xd5d5('0x5')]('/',auth[_0xd5d5('0x6')](),controller['index']);router['get'](_0xd5d5('0x7'),auth[_0xd5d5('0x6')](),controller[_0xd5d5('0x8')]);router[_0xd5d5('0x5')](_0xd5d5('0x9'),auth['isAuthenticated'](),controller[_0xd5d5('0xa')]);router[_0xd5d5('0x5')](_0xd5d5('0xb'),auth[_0xd5d5('0x6')](),controller[_0xd5d5('0xc')]);router[_0xd5d5('0xd')]('/',auth['isAuthenticated'](),controller[_0xd5d5('0xe')]);router[_0xd5d5('0xd')]('/:id/configurations',auth[_0xd5d5('0x6')](),controller[_0xd5d5('0xf')]);router[_0xd5d5('0x10')](_0xd5d5('0x7'),auth[_0xd5d5('0x6')](),controller['update']);router['delete'](_0xd5d5('0x7'),auth['isAuthenticated'](),controller[_0xd5d5('0x11')]);module[_0xd5d5('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 5717da7..187f63c 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 _0xe9dd=['STRING','sequelize','exports'];(function(_0x2922e5,_0x5966f4){var _0x74fb8a=function(_0x4a76b6){while(--_0x4a76b6){_0x2922e5['push'](_0x2922e5['shift']());}};_0x74fb8a(++_0x5966f4);}(_0xe9dd,0x103));var _0xde9d=function(_0x1f0ad7,_0xbdbf69){_0x1f0ad7=_0x1f0ad7-0x0;var _0xc907ef=_0xe9dd[_0x1f0ad7];return _0xc907ef;};'use strict';var Sequelize=require(_0xde9d('0x0'));module[_0xde9d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xde9d('0x2')]},'host':{'type':Sequelize[_0xde9d('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xde9d('0x2')]},'clientSecret':{'type':Sequelize[_0xde9d('0x2')]},'serverUrl':{'type':Sequelize[_0xde9d('0x2')]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4a37=['STRING','exports'];(function(_0x249864,_0x50a672){var _0x153ae2=function(_0x4d250d){while(--_0x4d250d){_0x249864['push'](_0x249864['shift']());}};_0x153ae2(++_0x50a672);}(_0x4a37,0xb1));var _0x74a3=function(_0x468c37,_0x4c9bce){_0x468c37=_0x468c37-0x0;var _0x5c7626=_0x4a37[_0x468c37];return _0x5c7626;};'use strict';var Sequelize=require('sequelize');module[_0x74a3('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x74a3('0x1')]},'host':{'type':Sequelize[_0x74a3('0x1')]},'zone':{'type':Sequelize[_0x74a3('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x74a3('0x1')]},'serverUrl':{'type':Sequelize[_0x74a3('0x1')]},'code':{'type':Sequelize[_0x74a3('0x1')]},'refreshToken':{'type':Sequelize[_0x74a3('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index b1b2e68..05b0f87 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 _0x2bda=['https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','host','serverUrl','zoho.eu','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','update','end','name','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','field','ZohoAccount','include','show','params','length','options','find','create','body','destroy','getConfigurations','findOne','map','addConfiguration','AccountId','type','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','Subjects','zone'];(function(_0x100ac3,_0x1c96b7){var _0x4098a4=function(_0x54c039){while(--_0x54c039){_0x100ac3['push'](_0x100ac3['shift']());}};_0x4098a4(++_0x1c96b7);}(_0x2bda,0x1cb));var _0xa2bd=function(_0x715d76,_0x402d60){_0x715d76=_0x715d76-0x0;var _0x48fe88=_0x2bda[_0x715d76];return _0x48fe88;};'use strict';var pdf=require(_0xa2bd('0x0'));var emlformat=require(_0xa2bd('0x1'));var rimraf=require(_0xa2bd('0x2'));var zipdir=require(_0xa2bd('0x3'));var jsonpatch=require(_0xa2bd('0x4'));var rp=require(_0xa2bd('0x5'));var moment=require(_0xa2bd('0x6'));var BPromise=require(_0xa2bd('0x7'));var Mustache=require(_0xa2bd('0x8'));var util=require(_0xa2bd('0x9'));var path=require(_0xa2bd('0xa'));var sox=require(_0xa2bd('0xb'));var csv=require('to-csv');var ejs=require(_0xa2bd('0xc'));var fs=require('fs');var _=require(_0xa2bd('0xd'));var squel=require('squel');var crypto=require(_0xa2bd('0xe'));var jsforce=require(_0xa2bd('0xf'));var deskjs=require(_0xa2bd('0x10'));var toCsv=require(_0xa2bd('0x11'));var querystring=require('querystring');var Papa=require(_0xa2bd('0x12'));var Redis=require(_0xa2bd('0x13'));var authService=require(_0xa2bd('0x14'));var qs=require(_0xa2bd('0x15'));var hardwareService=require(_0xa2bd('0x16'));var logger=require(_0xa2bd('0x17'))(_0xa2bd('0x18'));var utils=require('../../config/utils');var config=require(_0xa2bd('0x19'));var db=require(_0xa2bd('0x1a'))['db'];var integrations=require(_0xa2bd('0x1b'));var jayson=require(_0xa2bd('0x1c'));var client=jayson[_0xa2bd('0x1d')][_0xa2bd('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x3545be,_0x24eff8,_0x2fd549){if(_0x2fd549){var _0x220b61=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x220b61[_0xa2bd('0x1f')](_0x24eff8)){return _0x3545be;}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 _0x3545be;}}function respondWithRpcPromise(_0x3c786a,_0x285d47,_0x3e3563,_0x51c75a){return new BPromise(function(_0x1462c4,_0x78a214){var _0x3d40e1=_0x51c75a||client;return _0x3d40e1[_0xa2bd('0x20')](_0x3c786a,_0x3e3563)[_0xa2bd('0x21')](function(_0x3e78d6){logger[_0xa2bd('0x22')](_0xa2bd('0x23'),_0x285d47,_0xa2bd('0x24'));logger[_0xa2bd('0x25')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x285d47,_0xa2bd('0x24'),JSON[_0xa2bd('0x26')](_0x3e78d6));if(_0x3e78d6[_0xa2bd('0x27')]){if(_0x3e78d6[_0xa2bd('0x27')][_0xa2bd('0x28')]===0x1f4){logger[_0xa2bd('0x27')](_0xa2bd('0x23'),_0x285d47,_0x3e78d6[_0xa2bd('0x27')][_0xa2bd('0x29')]);return _0x78a214(_0x3e78d6[_0xa2bd('0x27')]['message']);}logger[_0xa2bd('0x27')](_0xa2bd('0x23'),_0x285d47,_0x3e78d6[_0xa2bd('0x27')]['message']);return _0x1462c4(_0x3e78d6[_0xa2bd('0x27')][_0xa2bd('0x29')]);}else{logger[_0xa2bd('0x22')](_0xa2bd('0x23'),_0x285d47,_0xa2bd('0x24'));_0x1462c4(_0x3e78d6['result']['message']);}})[_0xa2bd('0x2a')](function(_0x3d4b60){logger[_0xa2bd('0x27')](_0xa2bd('0x23'),_0x285d47,_0x3d4b60);_0x78a214(_0x3d4b60);});});}function respondWithStatusCode(_0x4ec048,_0x567faa){_0x567faa=_0x567faa||0xcc;return function(_0x139c02){if(_0x139c02){return _0x4ec048[_0xa2bd('0x2b')](_0x567faa);}return _0x4ec048[_0xa2bd('0x2c')](_0x567faa)['end']();};}function respondWithResult(_0x35ae8a,_0x34d5f1){_0x34d5f1=_0x34d5f1||0xc8;return function(_0x3880fe){if(_0x3880fe){return _0x35ae8a[_0xa2bd('0x2c')](_0x34d5f1)['json'](_0x3880fe);}};}function respondWithFilteredResult(_0x16153a,_0x3537cc){return function(_0x108649){if(_0x108649){var _0x3ff307=_0x108649[_0xa2bd('0x2d')],_0x122587=_0x3537cc[_0xa2bd('0x2e')],_0x2878e2=_0x3537cc[_0xa2bd('0x2e')]+_0x3537cc['limit'],_0x202b55;if(_0x2878e2>=_0x3ff307){_0x2878e2=_0x3ff307;_0x202b55=0xc8;}else{_0x202b55=0xce;}_0x16153a['status'](_0x202b55);return _0x16153a[_0xa2bd('0x2f')](_0xa2bd('0x30'),_0x122587+'-'+_0x2878e2+'/'+_0x3ff307)[_0xa2bd('0x31')](_0x108649);}return null;};}function patchUpdates(_0x5edbc3){return function(_0x44ea7e){try{jsonpatch[_0xa2bd('0x32')](_0x44ea7e,_0x5edbc3,!![]);}catch(_0x28a5dc){return BPromise[_0xa2bd('0x33')](_0x28a5dc);}return _0x44ea7e[_0xa2bd('0x34')]();};}function saveUpdates(_0x17efbc,_0x46c63b){return function(_0x4503db){if(_0x4503db){return _0x4503db[_0xa2bd('0x35')](_0x17efbc)[_0xa2bd('0x21')](function(_0x1d900c){return _0x1d900c;});}return null;};}function removeEntity(_0x2c30df,_0x239865){return function(_0x4f56fe){if(_0x4f56fe){return _0x4f56fe['destroy']()[_0xa2bd('0x21')](function(){_0x2c30df[_0xa2bd('0x2c')](0xcc)[_0xa2bd('0x36')]();});}};}function handleEntityNotFound(_0x4e53f3,_0x4f7684){return function(_0xe8f514){if(!_0xe8f514){_0x4e53f3['sendStatus'](0x194);}return _0xe8f514;};}function handleError(_0x1782bd,_0x2a1b28){_0x2a1b28=_0x2a1b28||0x1f4;return function(_0x144609){logger[_0xa2bd('0x27')](_0x144609['stack']);if(_0x144609[_0xa2bd('0x37')]){delete _0x144609[_0xa2bd('0x37')];}_0x1782bd[_0xa2bd('0x2c')](_0x2a1b28)['send'](_0x144609);};}exports['index']=function(_0x430eec,_0xaf226b){var _0x1dc7d0={},_0x3b1459={},_0x251fa8={'count':0x0,'rows':[]};var _0x9e5c55=db['ZohoAccount'][_0xa2bd('0x38')];_0x3b1459[_0xa2bd('0x39')]=_[_0xa2bd('0x3a')](_0x9e5c55);_0x3b1459['query']=_[_0xa2bd('0x3a')](_0x430eec[_0xa2bd('0x3b')]);_0x3b1459[_0xa2bd('0x3c')]=_[_0xa2bd('0x3d')](_0x3b1459['model'],_0x3b1459[_0xa2bd('0x3b')]);_0x1dc7d0[_0xa2bd('0x3e')]=_[_0xa2bd('0x3d')](_0x3b1459['model'],qs['fields'](_0x430eec[_0xa2bd('0x3b')][_0xa2bd('0x3f')]));_0x1dc7d0[_0xa2bd('0x3e')]=_0x1dc7d0[_0xa2bd('0x3e')]['length']?_0x1dc7d0[_0xa2bd('0x3e')]:_0x3b1459['model'];if(!_0x430eec['query'][_0xa2bd('0x40')](_0xa2bd('0x41'))){_0x1dc7d0[_0xa2bd('0x42')]=qs[_0xa2bd('0x42')](_0x430eec[_0xa2bd('0x3b')][_0xa2bd('0x42')]);_0x1dc7d0[_0xa2bd('0x2e')]=qs[_0xa2bd('0x2e')](_0x430eec[_0xa2bd('0x3b')][_0xa2bd('0x2e')]);}_0x1dc7d0[_0xa2bd('0x43')]=qs[_0xa2bd('0x44')](_0x430eec[_0xa2bd('0x3b')][_0xa2bd('0x44')]);_0x1dc7d0[_0xa2bd('0x45')]=qs[_0xa2bd('0x3c')](_[_0xa2bd('0x46')](_0x430eec['query'],_0x3b1459['filters']));if(_0x430eec[_0xa2bd('0x3b')][_0xa2bd('0x47')]){_0x1dc7d0['where']=_[_0xa2bd('0x48')](_0x1dc7d0[_0xa2bd('0x45')],{'$or':_['map'](_0x9e5c55,function(_0x2d6ddb){if(_0x2d6ddb['type']['key']!==_0xa2bd('0x49')){var _0x34e616={};_0x34e616[_0x2d6ddb[_0xa2bd('0x4a')]]={'$like':'%'+_0x430eec[_0xa2bd('0x3b')][_0xa2bd('0x47')]+'%'};return _0x34e616;}})});}_0x1dc7d0=_[_0xa2bd('0x48')]({},_0x1dc7d0,_0x430eec['options']);var _0x445036={'where':_0x1dc7d0[_0xa2bd('0x45')]};return db[_0xa2bd('0x4b')][_0xa2bd('0x2d')](_0x445036)['then'](function(_0x41bb62){_0x251fa8[_0xa2bd('0x2d')]=_0x41bb62;if(_0x430eec['query']['includeAll']){_0x1dc7d0[_0xa2bd('0x4c')]=[{'all':!![]}];}return db[_0xa2bd('0x4b')]['findAll'](_0x1dc7d0);})[_0xa2bd('0x21')](function(_0x4b7a18){_0x251fa8['rows']=_0x4b7a18;return _0x251fa8;})['then'](respondWithFilteredResult(_0xaf226b,_0x1dc7d0))['catch'](handleError(_0xaf226b,null));};exports[_0xa2bd('0x4d')]=function(_0x5a16f6,_0x54b99f){var _0x286abf={'raw':![],'where':{'id':_0x5a16f6[_0xa2bd('0x4e')]['id']}},_0x3cf22b={};_0x3cf22b[_0xa2bd('0x39')]=_[_0xa2bd('0x3a')](db[_0xa2bd('0x4b')][_0xa2bd('0x38')]);_0x3cf22b[_0xa2bd('0x3b')]=_[_0xa2bd('0x3a')](_0x5a16f6[_0xa2bd('0x3b')]);_0x3cf22b[_0xa2bd('0x3c')]=_[_0xa2bd('0x3d')](_0x3cf22b['model'],_0x3cf22b[_0xa2bd('0x3b')]);_0x286abf['attributes']=_['intersection'](_0x3cf22b[_0xa2bd('0x39')],qs[_0xa2bd('0x3f')](_0x5a16f6['query']['fields']));_0x286abf[_0xa2bd('0x3e')]=_0x286abf[_0xa2bd('0x3e')][_0xa2bd('0x4f')]?_0x286abf[_0xa2bd('0x3e')]:_0x3cf22b['model'];if(_0x5a16f6[_0xa2bd('0x3b')]['includeAll']){_0x286abf[_0xa2bd('0x4c')]=[{'all':!![]}];}_0x286abf=_[_0xa2bd('0x48')]({},_0x286abf,_0x5a16f6[_0xa2bd('0x50')]);return db[_0xa2bd('0x4b')][_0xa2bd('0x51')](_0x286abf)['then'](handleEntityNotFound(_0x54b99f,null))['then'](respondWithResult(_0x54b99f,null))['catch'](handleError(_0x54b99f,null));};exports[_0xa2bd('0x52')]=function(_0x4fab29,_0x593fe1){return db[_0xa2bd('0x4b')][_0xa2bd('0x52')](_0x4fab29[_0xa2bd('0x53')],{})['then'](respondWithResult(_0x593fe1,0xc9))[_0xa2bd('0x2a')](handleError(_0x593fe1,null));};exports[_0xa2bd('0x35')]=function(_0x5322fc,_0x2f4df5){if(_0x5322fc['body']['id']){delete _0x5322fc['body']['id'];}return db[_0xa2bd('0x4b')][_0xa2bd('0x51')]({'where':{'id':_0x5322fc[_0xa2bd('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2f4df5,null))[_0xa2bd('0x21')](saveUpdates(_0x5322fc[_0xa2bd('0x53')],null))['then'](respondWithResult(_0x2f4df5,null))[_0xa2bd('0x2a')](handleError(_0x2f4df5,null));};exports[_0xa2bd('0x54')]=function(_0x31343c,_0x1eedfe){return db['ZohoAccount']['find']({'where':{'id':_0x31343c['params']['id']}})[_0xa2bd('0x21')](handleEntityNotFound(_0x1eedfe,null))[_0xa2bd('0x21')](removeEntity(_0x1eedfe,null))['catch'](handleError(_0x1eedfe,null));};exports[_0xa2bd('0x55')]=function(_0x4ac3ee,_0x364a38,_0x36fd52){var _0x157f68={};var _0x57b201={};var _0x49adf4;var _0x52b99c;return db[_0xa2bd('0x4b')][_0xa2bd('0x56')]({'where':{'id':_0x4ac3ee[_0xa2bd('0x4e')]['id']}})[_0xa2bd('0x21')](handleEntityNotFound(_0x364a38,null))['then'](function(_0x42603f){if(_0x42603f){_0x49adf4=_0x42603f;_0x57b201[_0xa2bd('0x39')]=_[_0xa2bd('0x3a')](db['ZohoConfiguration'][_0xa2bd('0x38')]);_0x57b201['query']=_['keys'](_0x4ac3ee[_0xa2bd('0x3b')]);_0x57b201['filters']=_[_0xa2bd('0x3d')](_0x57b201[_0xa2bd('0x39')],_0x57b201[_0xa2bd('0x3b')]);_0x157f68[_0xa2bd('0x3e')]=_[_0xa2bd('0x3d')](_0x57b201[_0xa2bd('0x39')],qs[_0xa2bd('0x3f')](_0x4ac3ee['query']['fields']));_0x157f68[_0xa2bd('0x3e')]=_0x157f68[_0xa2bd('0x3e')][_0xa2bd('0x4f')]?_0x157f68[_0xa2bd('0x3e')]:_0x57b201[_0xa2bd('0x39')];_0x157f68['order']=qs[_0xa2bd('0x44')](_0x4ac3ee['query'][_0xa2bd('0x44')]);_0x157f68[_0xa2bd('0x45')]=qs[_0xa2bd('0x3c')](_[_0xa2bd('0x46')](_0x4ac3ee[_0xa2bd('0x3b')],_0x57b201[_0xa2bd('0x3c')]));if(_0x4ac3ee[_0xa2bd('0x3b')][_0xa2bd('0x47')]){_0x157f68['where']=_['merge'](_0x157f68['where'],{'$or':_[_0xa2bd('0x57')](_0x157f68[_0xa2bd('0x3e')],function(_0x3304ae){var _0x36d124={};_0x36d124[_0x3304ae]={'$like':'%'+_0x4ac3ee[_0xa2bd('0x3b')][_0xa2bd('0x47')]+'%'};return _0x36d124;})});}_0x157f68=_['merge']({},_0x157f68,_0x4ac3ee[_0xa2bd('0x50')]);return _0x49adf4[_0xa2bd('0x55')](_0x157f68);}})[_0xa2bd('0x21')](function(_0x5413e5){if(_0x5413e5){_0x52b99c=_0x5413e5['length'];if(!_0x4ac3ee[_0xa2bd('0x3b')][_0xa2bd('0x40')]('nolimit')){_0x157f68[_0xa2bd('0x42')]=qs[_0xa2bd('0x42')](_0x4ac3ee[_0xa2bd('0x3b')][_0xa2bd('0x42')]);_0x157f68[_0xa2bd('0x2e')]=qs[_0xa2bd('0x2e')](_0x4ac3ee['query'][_0xa2bd('0x2e')]);}return _0x49adf4[_0xa2bd('0x55')](_0x157f68);}})['then'](function(_0x57f8b3){if(_0x57f8b3){return _0x57f8b3?{'count':_0x52b99c,'rows':_0x57f8b3}:null;}})['then'](respondWithResult(_0x364a38,null))['catch'](handleError(_0x364a38,null));};exports[_0xa2bd('0x58')]=function(_0x42840b,_0x1d1e00,_0x144479){if(_0x42840b[_0xa2bd('0x53')]['id']){delete _0x42840b['body']['id'];}return db['ZohoAccount'][_0xa2bd('0x56')]({'where':{'id':_0x42840b['params']['id']}})[_0xa2bd('0x21')](handleEntityNotFound(_0x1d1e00,null))[_0xa2bd('0x21')](function(_0x2c0725){if(_0x2c0725){_0x42840b[_0xa2bd('0x53')][_0xa2bd('0x59')]=_0x2c0725['id'];_0x42840b[_0xa2bd('0x53')]['Subjects']=integrations['getSubjects'](_0x42840b['body']['channel'],_0x42840b[_0xa2bd('0x53')][_0xa2bd('0x5a')]);_0x42840b[_0xa2bd('0x53')][_0xa2bd('0x5b')]=integrations[_0xa2bd('0x5c')](_0x42840b[_0xa2bd('0x53')]['channel'],_0x42840b[_0xa2bd('0x53')]['type']);return db[_0xa2bd('0x5d')][_0xa2bd('0x52')](_0x42840b[_0xa2bd('0x53')],{'include':[{'model':db[_0xa2bd('0x5e')],'as':_0xa2bd('0x5f')},{'model':db[_0xa2bd('0x5e')],'as':_0xa2bd('0x5b')}]});}return null;})[_0xa2bd('0x21')](respondWithResult(_0x1d1e00,null))[_0xa2bd('0x2a')](handleError(_0x1d1e00,null));};function getAccessToken(_0x35474c){return new Promise(function(_0x1eb58f,_0x4f2efe){var _0xaf8652;switch(_0x35474c[_0xa2bd('0x60')]){case'US':_0xaf8652=_0xa2bd('0x61');break;case'AU':_0xaf8652=_0xa2bd('0x62');break;case'EU':_0xaf8652=_0xa2bd('0x63');break;case'IN':_0xaf8652=_0xa2bd('0x64');break;case'CN':_0xaf8652=_0xa2bd('0x65');break;default:_0xaf8652='https://accounts.zoho.eu';break;}var _0x57f497={'method':'POST','uri':_0xaf8652+_0xa2bd('0x66'),'qs':{'refresh_token':_0x35474c[_0xa2bd('0x67')],'client_id':_0x35474c[_0xa2bd('0x68')],'client_secret':_0x35474c[_0xa2bd('0x69')],'grant_type':_0xa2bd('0x6a')},'json':!![]};return rp(_0x57f497)[_0xa2bd('0x21')](function(_0x42880f){if(_0x42880f[_0xa2bd('0x6b')]){_0x1eb58f(_0x42880f[_0xa2bd('0x6b')]);}else{_0x4f2efe('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xa2bd('0x2a')](function(_0x4709dc){_0x4f2efe(_0x4709dc);});});}exports[_0xa2bd('0x6c')]=function(_0x2994dc,_0x39bdce,_0x5b2f46){var _0xd92062,_0x44a26b,_0x10af42,_0x5affbb,_0x3e8e9b;return db[_0xa2bd('0x4b')]['findOne']({'where':{'id':_0x2994dc[_0xa2bd('0x4e')]['id']},'attributes':['id',_0xa2bd('0x6d'),_0xa2bd('0x60'),_0xa2bd('0x68'),_0xa2bd('0x69'),_0xa2bd('0x6e'),_0xa2bd('0x28'),_0xa2bd('0x67')]})[_0xa2bd('0x21')](handleEntityNotFound(_0x39bdce,null))[_0xa2bd('0x21')](function(_0x2bd7c0){_0x3e8e9b=_0x2bd7c0;_0xd92062=_0x3e8e9b[_0xa2bd('0x6d')];_0x44a26b=_0xd92062===_0xa2bd('0x6f')?'eu':_0xa2bd('0x70');_0x10af42=_0x3e8e9b[_0xa2bd('0x6e')];var _0x3bdc3a=_0x10af42[_0xa2bd('0x71')](-0x1);if(_0x3bdc3a==='/'||_0x3bdc3a==='\x5c'||_0x3bdc3a===':'){_0x10af42=_0x10af42['substring'](0x0,_0x10af42[_0xa2bd('0x72')](_0x3bdc3a));}if(!_0x3e8e9b[_0xa2bd('0x67')]){throw new Error(_0xa2bd('0x73'));}return getAccessToken(_0x3e8e9b);})[_0xa2bd('0x21')](function(_0x4f1d84){if(_0x4f1d84){return rp({'method':_0xa2bd('0x74'),'uri':util[_0xa2bd('0x75')](_0xa2bd('0x76'),_0x44a26b),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4f1d84},'json':!![]});}})[_0xa2bd('0x21')](function(_0x37af49){if(_0x37af49){if(_0x37af49[_0xa2bd('0x77')]&&_0x37af49['response'][_0xa2bd('0x27')]){throw new Error(_0x37af49['response']['error'][_0xa2bd('0x29')]);}var _0x40b4fc=[];var _0x41cec2=[];var _0x1d3c68=[_0xa2bd('0x78'),_0xa2bd('0x79'),_0xa2bd('0x7a'),_0xa2bd('0x7b'),_0xa2bd('0x7c'),_0xa2bd('0x7d'),_0xa2bd('0x7e'),_0xa2bd('0x7f')];_0x41cec2=_[_0xa2bd('0x80')](_0x37af49[_0xa2bd('0x3f')],function(_0x2c714f){return _0x1d3c68['includes'](_0x2c714f[_0xa2bd('0x81')]);});for(var _0xf2621c=0x0;_0xf2621c<_0x41cec2['length'];_0xf2621c++){if(_0x41cec2[_0xf2621c]['system_mandatory']===![]){_0x40b4fc[_0xa2bd('0x82')]({'id':_0x41cec2[_0xf2621c]['id'],'name':_0x41cec2[_0xf2621c][_0xa2bd('0x83')],'custom':_0x41cec2[_0xf2621c][_0xa2bd('0x84')],'options':_0x41cec2[_0xf2621c][_0xa2bd('0x85')]===_0xa2bd('0x86')&&_0x41cec2[_0xf2621c][_0xa2bd('0x87')]['length']>-0x1?_[_0xa2bd('0x57')](_0x41cec2[_0xf2621c][_0xa2bd('0x87')],function(_0x27577e){return{'name':_0x27577e,'value':_0x27577e};}):[]});}}return{'count':_0x40b4fc[_0xa2bd('0x4f')],'rows':_0x40b4fc};}else{return{'count':0x0,'rows':[]};}})[_0xa2bd('0x21')](respondWithResult(_0x39bdce,null))[_0xa2bd('0x2a')](function(_0x122f90){var _0x426cac=_0x2994dc[_0xa2bd('0x3b')][_0xa2bd('0x1f')]?0x1f4:_0x122f90[_0xa2bd('0x88')]||0x1f4;logger[_0xa2bd('0x27')](_0xa2bd('0x89'),'getFields',_0x426cac,JSON[_0xa2bd('0x26')](_0x122f90));delete _0x122f90[_0xa2bd('0x37')];if(_0x426cac===0x191){_0x426cac=0x190;}_0x39bdce[_0xa2bd('0x2c')](_0x426cac)['send'](_0x2994dc[_0xa2bd('0x3b')]['test']?{'message':_0xa2bd('0x8a'),'statusCode':_0x122f90[_0xa2bd('0x88')]}:_0x122f90);});}; \ No newline at end of file +var _0x2b34=['name','send','index','ZohoAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','merge','map','VIRTUAL','options','where','includeAll','include','findAll','rows','show','params','find','create','body','update','findOne','ZohoConfiguration','order','getConfigurations','length','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId','serverUrl','code','zoho.eu','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','Subject','Description','WhoId','Call_Start_Time','Call_Type','remove','system_mandatory','push','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','count','offset','limit','Content-Range','apply','reject','save','destroy','sendStatus','stack'];(function(_0x16e03f,_0x504b21){var _0x1218b0=function(_0x1418a8){while(--_0x1418a8){_0x16e03f['push'](_0x16e03f['shift']());}};_0x1218b0(++_0x504b21);}(_0x2b34,0x165));var _0x42b3=function(_0x1c47b0,_0x19e61c){_0x1c47b0=_0x1c47b0-0x0;var _0x5ae2e3=_0x2b34[_0x1c47b0];return _0x5ae2e3;};'use strict';var pdf=require(_0x42b3('0x0'));var emlformat=require(_0x42b3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x42b3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x42b3('0x3'));var moment=require('moment');var BPromise=require(_0x42b3('0x4'));var Mustache=require(_0x42b3('0x5'));var util=require(_0x42b3('0x6'));var path=require(_0x42b3('0x7'));var sox=require(_0x42b3('0x8'));var csv=require(_0x42b3('0x9'));var ejs=require(_0x42b3('0xa'));var fs=require('fs');var _=require(_0x42b3('0xb'));var squel=require(_0x42b3('0xc'));var crypto=require(_0x42b3('0xd'));var jsforce=require(_0x42b3('0xe'));var deskjs=require(_0x42b3('0xf'));var toCsv=require(_0x42b3('0x9'));var querystring=require('querystring');var Papa=require(_0x42b3('0x10'));var Redis=require(_0x42b3('0x11'));var authService=require(_0x42b3('0x12'));var qs=require(_0x42b3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x42b3('0x14'))('api');var utils=require(_0x42b3('0x15'));var config=require('../../config/environment');var db=require(_0x42b3('0x16'))['db'];var integrations=require(_0x42b3('0x17'));var jayson=require(_0x42b3('0x18'));var client=jayson[_0x42b3('0x19')][_0x42b3('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x179f31,_0x3711a6,_0x44a98a){if(_0x44a98a){var _0x1d5e3d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d5e3d[_0x42b3('0x1b')](_0x3711a6)){return _0x179f31;}else{throw new Error(_0x42b3('0x1c'));}}else{return _0x179f31;}}function respondWithRpcPromise(_0x16c6aa,_0x52942f,_0x5d2a56,_0x587abf){return new BPromise(function(_0x59ffda,_0x476a45){var _0x5706c3=_0x587abf||client;return _0x5706c3[_0x42b3('0x1d')](_0x16c6aa,_0x5d2a56)[_0x42b3('0x1e')](function(_0x498e16){logger[_0x42b3('0x1f')](_0x42b3('0x20'),_0x52942f,_0x42b3('0x21'));logger[_0x42b3('0x22')](_0x42b3('0x23'),_0x52942f,_0x42b3('0x21'),JSON[_0x42b3('0x24')](_0x498e16));if(_0x498e16[_0x42b3('0x25')]){if(_0x498e16['error']['code']===0x1f4){logger[_0x42b3('0x25')](_0x42b3('0x20'),_0x52942f,_0x498e16[_0x42b3('0x25')][_0x42b3('0x26')]);return _0x476a45(_0x498e16['error'][_0x42b3('0x26')]);}logger[_0x42b3('0x25')](_0x42b3('0x20'),_0x52942f,_0x498e16[_0x42b3('0x25')][_0x42b3('0x26')]);return _0x59ffda(_0x498e16[_0x42b3('0x25')][_0x42b3('0x26')]);}else{logger[_0x42b3('0x1f')]('ZohoAccount,\x20%s,\x20%s',_0x52942f,_0x42b3('0x21'));_0x59ffda(_0x498e16[_0x42b3('0x27')][_0x42b3('0x26')]);}})[_0x42b3('0x28')](function(_0x5b03eb){logger['error'](_0x42b3('0x20'),_0x52942f,_0x5b03eb);_0x476a45(_0x5b03eb);});});}function respondWithStatusCode(_0x5b266d,_0x3534a5){_0x3534a5=_0x3534a5||0xcc;return function(_0x51b860){if(_0x51b860){return _0x5b266d['sendStatus'](_0x3534a5);}return _0x5b266d[_0x42b3('0x29')](_0x3534a5)[_0x42b3('0x2a')]();};}function respondWithResult(_0x247dc1,_0x2c9471){_0x2c9471=_0x2c9471||0xc8;return function(_0x2c2f1e){if(_0x2c2f1e){return _0x247dc1[_0x42b3('0x29')](_0x2c9471)[_0x42b3('0x2b')](_0x2c2f1e);}};}function respondWithFilteredResult(_0xd9c4f,_0x2cf535){return function(_0x5a29df){if(_0x5a29df){var _0x26e1be=_0x5a29df[_0x42b3('0x2c')],_0x104ec8=_0x2cf535[_0x42b3('0x2d')],_0x59b772=_0x2cf535[_0x42b3('0x2d')]+_0x2cf535[_0x42b3('0x2e')],_0x486deb;if(_0x59b772>=_0x26e1be){_0x59b772=_0x26e1be;_0x486deb=0xc8;}else{_0x486deb=0xce;}_0xd9c4f[_0x42b3('0x29')](_0x486deb);return _0xd9c4f['set'](_0x42b3('0x2f'),_0x104ec8+'-'+_0x59b772+'/'+_0x26e1be)[_0x42b3('0x2b')](_0x5a29df);}return null;};}function patchUpdates(_0x3367a1){return function(_0x57955e){try{jsonpatch[_0x42b3('0x30')](_0x57955e,_0x3367a1,!![]);}catch(_0xa35be0){return BPromise[_0x42b3('0x31')](_0xa35be0);}return _0x57955e[_0x42b3('0x32')]();};}function saveUpdates(_0x31f4db,_0x13a507){return function(_0x12d0a2){if(_0x12d0a2){return _0x12d0a2['update'](_0x31f4db)[_0x42b3('0x1e')](function(_0xce40c1){return _0xce40c1;});}return null;};}function removeEntity(_0x442629,_0xeea02){return function(_0x1f719d){if(_0x1f719d){return _0x1f719d[_0x42b3('0x33')]()[_0x42b3('0x1e')](function(){_0x442629[_0x42b3('0x29')](0xcc)[_0x42b3('0x2a')]();});}};}function handleEntityNotFound(_0x5707bd,_0x5323ae){return function(_0x52390f){if(!_0x52390f){_0x5707bd[_0x42b3('0x34')](0x194);}return _0x52390f;};}function handleError(_0x26ff7e,_0x439c2e){_0x439c2e=_0x439c2e||0x1f4;return function(_0x2c8b7a){logger[_0x42b3('0x25')](_0x2c8b7a[_0x42b3('0x35')]);if(_0x2c8b7a[_0x42b3('0x36')]){delete _0x2c8b7a['name'];}_0x26ff7e[_0x42b3('0x29')](_0x439c2e)[_0x42b3('0x37')](_0x2c8b7a);};}exports[_0x42b3('0x38')]=function(_0x5c4406,_0x2e1cc4){var _0x30bd82={},_0x1cd319={},_0x42def5={'count':0x0,'rows':[]};var _0x2a23bd=db[_0x42b3('0x39')][_0x42b3('0x3a')];_0x1cd319[_0x42b3('0x3b')]=_[_0x42b3('0x3c')](_0x2a23bd);_0x1cd319[_0x42b3('0x3d')]=_[_0x42b3('0x3c')](_0x5c4406[_0x42b3('0x3d')]);_0x1cd319[_0x42b3('0x3e')]=_[_0x42b3('0x3f')](_0x1cd319['model'],_0x1cd319[_0x42b3('0x3d')]);_0x30bd82[_0x42b3('0x40')]=_['intersection'](_0x1cd319[_0x42b3('0x3b')],qs[_0x42b3('0x41')](_0x5c4406[_0x42b3('0x3d')][_0x42b3('0x41')]));_0x30bd82['attributes']=_0x30bd82[_0x42b3('0x40')]['length']?_0x30bd82[_0x42b3('0x40')]:_0x1cd319[_0x42b3('0x3b')];if(!_0x5c4406[_0x42b3('0x3d')][_0x42b3('0x42')]('nolimit')){_0x30bd82[_0x42b3('0x2e')]=qs['limit'](_0x5c4406[_0x42b3('0x3d')][_0x42b3('0x2e')]);_0x30bd82[_0x42b3('0x2d')]=qs[_0x42b3('0x2d')](_0x5c4406[_0x42b3('0x3d')][_0x42b3('0x2d')]);}_0x30bd82['order']=qs[_0x42b3('0x43')](_0x5c4406['query']['sort']);_0x30bd82['where']=qs[_0x42b3('0x3e')](_[_0x42b3('0x44')](_0x5c4406[_0x42b3('0x3d')],_0x1cd319['filters']));if(_0x5c4406[_0x42b3('0x3d')][_0x42b3('0x45')]){_0x30bd82['where']=_[_0x42b3('0x46')](_0x30bd82['where'],{'$or':_[_0x42b3('0x47')](_0x2a23bd,function(_0x1dfe53){if(_0x1dfe53['type']['key']!==_0x42b3('0x48')){var _0x2d4538={};_0x2d4538[_0x1dfe53['field']]={'$like':'%'+_0x5c4406[_0x42b3('0x3d')]['filter']+'%'};return _0x2d4538;}})});}_0x30bd82=_[_0x42b3('0x46')]({},_0x30bd82,_0x5c4406[_0x42b3('0x49')]);var _0x1801ad={'where':_0x30bd82[_0x42b3('0x4a')]};return db['ZohoAccount'][_0x42b3('0x2c')](_0x1801ad)[_0x42b3('0x1e')](function(_0xa8a7fe){_0x42def5[_0x42b3('0x2c')]=_0xa8a7fe;if(_0x5c4406[_0x42b3('0x3d')][_0x42b3('0x4b')]){_0x30bd82[_0x42b3('0x4c')]=[{'all':!![]}];}return db['ZohoAccount'][_0x42b3('0x4d')](_0x30bd82);})[_0x42b3('0x1e')](function(_0x34b4b3){_0x42def5[_0x42b3('0x4e')]=_0x34b4b3;return _0x42def5;})[_0x42b3('0x1e')](respondWithFilteredResult(_0x2e1cc4,_0x30bd82))[_0x42b3('0x28')](handleError(_0x2e1cc4,null));};exports[_0x42b3('0x4f')]=function(_0x24175d,_0x46163f){var _0x512bd0={'raw':![],'where':{'id':_0x24175d[_0x42b3('0x50')]['id']}},_0x21fee8={};_0x21fee8[_0x42b3('0x3b')]=_[_0x42b3('0x3c')](db['ZohoAccount'][_0x42b3('0x3a')]);_0x21fee8[_0x42b3('0x3d')]=_[_0x42b3('0x3c')](_0x24175d[_0x42b3('0x3d')]);_0x21fee8[_0x42b3('0x3e')]=_['intersection'](_0x21fee8[_0x42b3('0x3b')],_0x21fee8[_0x42b3('0x3d')]);_0x512bd0[_0x42b3('0x40')]=_['intersection'](_0x21fee8[_0x42b3('0x3b')],qs['fields'](_0x24175d[_0x42b3('0x3d')][_0x42b3('0x41')]));_0x512bd0[_0x42b3('0x40')]=_0x512bd0[_0x42b3('0x40')]['length']?_0x512bd0[_0x42b3('0x40')]:_0x21fee8[_0x42b3('0x3b')];if(_0x24175d['query'][_0x42b3('0x4b')]){_0x512bd0['include']=[{'all':!![]}];}_0x512bd0=_['merge']({},_0x512bd0,_0x24175d[_0x42b3('0x49')]);return db[_0x42b3('0x39')][_0x42b3('0x51')](_0x512bd0)['then'](handleEntityNotFound(_0x46163f,null))[_0x42b3('0x1e')](respondWithResult(_0x46163f,null))[_0x42b3('0x28')](handleError(_0x46163f,null));};exports['create']=function(_0x3f8b71,_0xf582b){return db[_0x42b3('0x39')][_0x42b3('0x52')](_0x3f8b71[_0x42b3('0x53')],{})[_0x42b3('0x1e')](respondWithResult(_0xf582b,0xc9))[_0x42b3('0x28')](handleError(_0xf582b,null));};exports[_0x42b3('0x54')]=function(_0x331ffe,_0x44697f){if(_0x331ffe[_0x42b3('0x53')]['id']){delete _0x331ffe['body']['id'];}return db[_0x42b3('0x39')][_0x42b3('0x51')]({'where':{'id':_0x331ffe[_0x42b3('0x50')]['id']}})[_0x42b3('0x1e')](handleEntityNotFound(_0x44697f,null))['then'](saveUpdates(_0x331ffe[_0x42b3('0x53')],null))[_0x42b3('0x1e')](respondWithResult(_0x44697f,null))[_0x42b3('0x28')](handleError(_0x44697f,null));};exports[_0x42b3('0x33')]=function(_0x22ea9e,_0x175853){return db[_0x42b3('0x39')][_0x42b3('0x51')]({'where':{'id':_0x22ea9e['params']['id']}})['then'](handleEntityNotFound(_0x175853,null))[_0x42b3('0x1e')](removeEntity(_0x175853,null))[_0x42b3('0x28')](handleError(_0x175853,null));};exports['getConfigurations']=function(_0x128308,_0x41b8f0,_0x1345a9){var _0x414a8b={};var _0x839191={};var _0x114fe7;var _0x3ef055;return db[_0x42b3('0x39')][_0x42b3('0x55')]({'where':{'id':_0x128308['params']['id']}})[_0x42b3('0x1e')](handleEntityNotFound(_0x41b8f0,null))['then'](function(_0x3cae93){if(_0x3cae93){_0x114fe7=_0x3cae93;_0x839191[_0x42b3('0x3b')]=_[_0x42b3('0x3c')](db[_0x42b3('0x56')]['rawAttributes']);_0x839191[_0x42b3('0x3d')]=_[_0x42b3('0x3c')](_0x128308['query']);_0x839191[_0x42b3('0x3e')]=_[_0x42b3('0x3f')](_0x839191[_0x42b3('0x3b')],_0x839191['query']);_0x414a8b[_0x42b3('0x40')]=_[_0x42b3('0x3f')](_0x839191[_0x42b3('0x3b')],qs['fields'](_0x128308['query']['fields']));_0x414a8b[_0x42b3('0x40')]=_0x414a8b['attributes']['length']?_0x414a8b[_0x42b3('0x40')]:_0x839191['model'];_0x414a8b[_0x42b3('0x57')]=qs[_0x42b3('0x43')](_0x128308[_0x42b3('0x3d')][_0x42b3('0x43')]);_0x414a8b['where']=qs[_0x42b3('0x3e')](_['pick'](_0x128308[_0x42b3('0x3d')],_0x839191[_0x42b3('0x3e')]));if(_0x128308[_0x42b3('0x3d')][_0x42b3('0x45')]){_0x414a8b[_0x42b3('0x4a')]=_['merge'](_0x414a8b[_0x42b3('0x4a')],{'$or':_[_0x42b3('0x47')](_0x414a8b[_0x42b3('0x40')],function(_0x5d228a){var _0x5e8a97={};_0x5e8a97[_0x5d228a]={'$like':'%'+_0x128308[_0x42b3('0x3d')][_0x42b3('0x45')]+'%'};return _0x5e8a97;})});}_0x414a8b=_['merge']({},_0x414a8b,_0x128308['options']);return _0x114fe7[_0x42b3('0x58')](_0x414a8b);}})['then'](function(_0x2a215f){if(_0x2a215f){_0x3ef055=_0x2a215f[_0x42b3('0x59')];if(!_0x128308['query']['hasOwnProperty'](_0x42b3('0x5a'))){_0x414a8b[_0x42b3('0x2e')]=qs[_0x42b3('0x2e')](_0x128308[_0x42b3('0x3d')][_0x42b3('0x2e')]);_0x414a8b['offset']=qs[_0x42b3('0x2d')](_0x128308[_0x42b3('0x3d')][_0x42b3('0x2d')]);}return _0x114fe7['getConfigurations'](_0x414a8b);}})[_0x42b3('0x1e')](function(_0x256612){if(_0x256612){return _0x256612?{'count':_0x3ef055,'rows':_0x256612}:null;}})[_0x42b3('0x1e')](respondWithResult(_0x41b8f0,null))[_0x42b3('0x28')](handleError(_0x41b8f0,null));};exports[_0x42b3('0x5b')]=function(_0x1b7f70,_0x1795a6,_0x1018ca){if(_0x1b7f70[_0x42b3('0x53')]['id']){delete _0x1b7f70[_0x42b3('0x53')]['id'];}return db[_0x42b3('0x39')][_0x42b3('0x55')]({'where':{'id':_0x1b7f70[_0x42b3('0x50')]['id']}})['then'](handleEntityNotFound(_0x1795a6,null))[_0x42b3('0x1e')](function(_0x23be3d){if(_0x23be3d){_0x1b7f70[_0x42b3('0x53')][_0x42b3('0x5c')]=_0x23be3d['id'];_0x1b7f70[_0x42b3('0x53')][_0x42b3('0x5d')]=integrations[_0x42b3('0x5e')](_0x1b7f70['body'][_0x42b3('0x5f')],_0x1b7f70[_0x42b3('0x53')][_0x42b3('0x60')]);_0x1b7f70[_0x42b3('0x53')][_0x42b3('0x61')]=integrations['getDescriptions'](_0x1b7f70[_0x42b3('0x53')][_0x42b3('0x5f')],_0x1b7f70[_0x42b3('0x53')][_0x42b3('0x60')]);return db[_0x42b3('0x56')][_0x42b3('0x52')](_0x1b7f70['body'],{'include':[{'model':db[_0x42b3('0x62')],'as':'Subjects'},{'model':db[_0x42b3('0x62')],'as':_0x42b3('0x61')}]});}return null;})[_0x42b3('0x1e')](respondWithResult(_0x1795a6,null))['catch'](handleError(_0x1795a6,null));};function getAccessToken(_0x583804){return new Promise(function(_0x159da6,_0x34294d){var _0x5aed15;switch(_0x583804[_0x42b3('0x63')]){case'US':_0x5aed15='https://accounts.zoho.com';break;case'AU':_0x5aed15=_0x42b3('0x64');break;case'EU':_0x5aed15=_0x42b3('0x65');break;case'IN':_0x5aed15=_0x42b3('0x66');break;case'CN':_0x5aed15=_0x42b3('0x67');break;default:_0x5aed15=_0x42b3('0x65');break;}var _0x2cc7da={'method':_0x42b3('0x68'),'uri':_0x5aed15+'/oauth/v2/token','qs':{'refresh_token':_0x583804[_0x42b3('0x69')],'client_id':_0x583804['clientId'],'client_secret':_0x583804[_0x42b3('0x6a')],'grant_type':_0x42b3('0x6b')},'json':!![]};return rp(_0x2cc7da)[_0x42b3('0x1e')](function(_0xc5261f){if(_0xc5261f[_0x42b3('0x6c')]){_0x159da6(_0xc5261f[_0x42b3('0x6c')]);}else{_0x34294d(_0x42b3('0x6d'));}})['catch'](function(_0x326fdd){_0x34294d(_0x326fdd);});});}exports[_0x42b3('0x6e')]=function(_0x35bcd5,_0x198689,_0x5bf675){var _0x55729a,_0x1b6b57,_0x50a216,_0x3891df,_0x4ab2fe;return db[_0x42b3('0x39')][_0x42b3('0x55')]({'where':{'id':_0x35bcd5['params']['id']},'attributes':['id',_0x42b3('0x6f'),_0x42b3('0x63'),_0x42b3('0x70'),_0x42b3('0x6a'),_0x42b3('0x71'),_0x42b3('0x72'),_0x42b3('0x69')]})['then'](handleEntityNotFound(_0x198689,null))[_0x42b3('0x1e')](function(_0x4bb591){_0x4ab2fe=_0x4bb591;_0x55729a=_0x4ab2fe['host'];_0x1b6b57=_0x55729a===_0x42b3('0x73')?'eu':_0x42b3('0x74');_0x50a216=_0x4ab2fe[_0x42b3('0x71')];var _0x4e47c7=_0x50a216[_0x42b3('0x75')](-0x1);if(_0x4e47c7==='/'||_0x4e47c7==='\x5c'||_0x4e47c7===':'){_0x50a216=_0x50a216['substring'](0x0,_0x50a216[_0x42b3('0x76')](_0x4e47c7));}if(!_0x4ab2fe[_0x42b3('0x69')]){throw new Error(_0x42b3('0x77'));}return getAccessToken(_0x4ab2fe);})['then'](function(_0x16a344){if(_0x16a344){return rp({'method':_0x42b3('0x78'),'uri':util[_0x42b3('0x79')](_0x42b3('0x7a'),_0x1b6b57),'qs':{'module':_0x42b3('0x7b')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x16a344},'json':!![]});}})[_0x42b3('0x1e')](function(_0xeaf1a6){if(_0xeaf1a6){if(_0xeaf1a6['response']&&_0xeaf1a6[_0x42b3('0x7c')][_0x42b3('0x25')]){throw new Error(_0xeaf1a6[_0x42b3('0x7c')][_0x42b3('0x25')][_0x42b3('0x26')]);}var _0x377b0c=[];var _0x52358b=[];var _0x576ba5=['Owner',_0x42b3('0x7d'),_0x42b3('0x7e'),_0x42b3('0x7f'),'Call_Duration','Call_Result',_0x42b3('0x80'),_0x42b3('0x81')];_0x52358b=_[_0x42b3('0x82')](_0xeaf1a6[_0x42b3('0x41')],function(_0x281a6e){return _0x576ba5['includes'](_0x281a6e['api_name']);});for(var _0x469046=0x0;_0x469046<_0x52358b[_0x42b3('0x59')];_0x469046++){if(_0x52358b[_0x469046][_0x42b3('0x83')]===![]){_0x377b0c[_0x42b3('0x84')]({'id':_0x52358b[_0x469046]['id'],'name':_0x52358b[_0x469046]['display_label'],'custom':_0x52358b[_0x469046]['custom_field'],'options':_0x52358b[_0x469046][_0x42b3('0x85')]==='picklist'&&_0x52358b[_0x469046][_0x42b3('0x86')][_0x42b3('0x59')]>-0x1?_[_0x42b3('0x47')](_0x52358b[_0x469046]['pick_list_values'],function(_0x5b0a13){return{'name':_0x5b0a13,'value':_0x5b0a13};}):[]});}}return{'count':_0x377b0c[_0x42b3('0x59')],'rows':_0x377b0c};}else{return{'count':0x0,'rows':[]};}})[_0x42b3('0x1e')](respondWithResult(_0x198689,null))['catch'](function(_0x51cd8d){var _0x332265=_0x35bcd5['query'][_0x42b3('0x1b')]?0x1f4:_0x51cd8d[_0x42b3('0x87')]||0x1f4;logger[_0x42b3('0x25')](_0x42b3('0x88'),_0x42b3('0x6e'),_0x332265,JSON[_0x42b3('0x24')](_0x51cd8d));delete _0x51cd8d['name'];if(_0x332265===0x191){_0x332265=0x190;}_0x198689[_0x42b3('0x29')](_0x332265)[_0x42b3('0x37')](_0x35bcd5[_0x42b3('0x3d')][_0x42b3('0x1b')]?{'message':'Wrong\x20credentials','statusCode':_0x51cd8d['statusCode']}:_0x51cd8d);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index fa3e5dc..ba13749 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 _0x648d=['serverUrl','clientId','code','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','authorization_code','then','parse','refreshToken','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','error','host','slice','lastIndexOf','https://accounts.zoho.com.cn','/oauth/v2/token','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x648d,0x1aa));var _0xd648=function(_0x3a2323,_0x2c1756){_0x3a2323=_0x3a2323-0x0;var _0x866b8=_0x648d[_0x3a2323];return _0x866b8;};'use strict';var _=require(_0xd648('0x0'));var util=require(_0xd648('0x1'));var logger=require(_0xd648('0x2'))(_0xd648('0x3'));var moment=require(_0xd648('0x4'));var BPromise=require(_0xd648('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd648('0x6'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xd648('0x7'));module[_0xd648('0x8')]=function(_0x18641d,_0x5d8297){return _0x18641d[_0xd648('0x9')](_0xd648('0xa'),attributes,{'tableName':_0xd648('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x174bbb,_0x12f839,_0x39c545){if(_0x174bbb[_0xd648('0xc')](_0xd648('0xd'))||_0x174bbb[_0xd648('0xc')](_0xd648('0xe'))||_0x174bbb['changed'](_0xd648('0xf'))||_0x174bbb[_0xd648('0xc')]('clientSecret')||_0x174bbb['changed'](_0xd648('0x10'))||_0x174bbb[_0xd648('0xc')]('host')){var _0x19fdd3,_0x3e005c;_0x19fdd3=_0x174bbb[_0xd648('0xe')];var _0x582e30=_0x19fdd3['slice'](-0x1);if(_0x582e30==='/'||_0x582e30==='\x5c'||_0x582e30===':'){_0x19fdd3=_0x19fdd3[_0xd648('0x11')](0x0,_0x19fdd3['lastIndexOf'](_0x582e30));}switch(_0x174bbb[_0xd648('0xd')]){case'US':_0x3e005c=_0xd648('0x12');break;case'AU':_0x3e005c=_0xd648('0x13');break;case'IN':_0x3e005c=_0xd648('0x14');break;case'CN':_0x3e005c='https://accounts.zoho.com.cn';break;default:_0x3e005c=_0xd648('0x15');break;}var _0x4e7022={'method':_0xd648('0x16'),'uri':_0x3e005c+'/oauth/v2/token','form':{'grant_type':_0xd648('0x17'),'client_id':_0x174bbb[_0xd648('0xf')],'client_secret':_0x174bbb['clientSecret'],'redirect_uri':_0x174bbb[_0xd648('0xe')],'code':_0x174bbb['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4e7022)[_0xd648('0x18')](function(_0x56f6f){var _0x66ffc0=JSON[_0xd648('0x19')](_0x56f6f);if(_0x66ffc0['refresh_token']){_0x174bbb[_0xd648('0x1a')]=_0x66ffc0[_0xd648('0x1b')];logger[_0xd648('0x1c')](util[_0xd648('0x1d')](_0xd648('0x1e'),_0x174bbb['name'],_0x174bbb['id']));}else{logger['error'](util[_0xd648('0x1d')](_0xd648('0x1f'),_0x174bbb[_0xd648('0x20')],_0x174bbb['id']),util[_0xd648('0x21')](_0x66ffc0,{'showHidden':![],'depth':null}));}return _0x39c545(null,_0x12f839);})['catch'](function(_0x429070){logger[_0xd648('0x22')](util[_0xd648('0x1d')](_0xd648('0x1f'),_0x174bbb[_0xd648('0x20')],_0x174bbb['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x39c545(_0x429070);});}else{return _0x39c545(null,_0x12f839);}},'beforeUpdate':function(_0xaf94a6,_0x350598,_0x5079be){if(_0xaf94a6[_0xd648('0xc')](_0xd648('0xd'))||_0xaf94a6[_0xd648('0xc')](_0xd648('0xe'))||_0xaf94a6[_0xd648('0xc')](_0xd648('0xf'))||_0xaf94a6[_0xd648('0xc')]('clientSecret')||_0xaf94a6[_0xd648('0xc')](_0xd648('0x10'))||_0xaf94a6[_0xd648('0xc')](_0xd648('0x23'))){var _0x27f8df,_0x499bd3;_0x27f8df=_0xaf94a6[_0xd648('0xe')];var _0x24ff08=_0x27f8df[_0xd648('0x24')](-0x1);if(_0x24ff08==='/'||_0x24ff08==='\x5c'||_0x24ff08===':'){_0x27f8df=_0x27f8df['substring'](0x0,_0x27f8df[_0xd648('0x25')](_0x24ff08));}switch(_0xaf94a6['zone']){case'US':_0x499bd3=_0xd648('0x12');break;case'AU':_0x499bd3=_0xd648('0x13');break;case'IN':_0x499bd3=_0xd648('0x14');break;case'CN':_0x499bd3=_0xd648('0x26');break;default:_0x499bd3=_0xd648('0x15');break;}var _0x22fecc={'method':'POST','uri':_0x499bd3+_0xd648('0x27'),'form':{'grant_type':_0xd648('0x17'),'client_id':_0xaf94a6[_0xd648('0xf')],'client_secret':_0xaf94a6['clientSecret'],'redirect_uri':_0xaf94a6[_0xd648('0xe')],'code':_0xaf94a6[_0xd648('0x10')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x22fecc)[_0xd648('0x18')](function(_0x4726db){var _0x33baab=JSON[_0xd648('0x19')](_0x4726db);if(_0x33baab[_0xd648('0x1b')]){_0xaf94a6[_0xd648('0x1a')]=_0x33baab['refresh_token'];logger[_0xd648('0x1c')](util[_0xd648('0x1d')](_0xd648('0x1e'),_0xaf94a6['name'],_0xaf94a6['id']));}else{logger[_0xd648('0x22')](util[_0xd648('0x1d')](_0xd648('0x1f'),_0xaf94a6[_0xd648('0x20')],_0xaf94a6['id']),util[_0xd648('0x21')](_0x33baab,{'showHidden':![],'depth':null}));}return _0x5079be(null,_0x350598);})['catch'](function(_0x5c3997){logger[_0xd648('0x22')](util['format'](_0xd648('0x1f'),_0xaf94a6[_0xd648('0x20')],_0xaf94a6['id']),util[_0xd648('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x5079be(_0x5c3997);});}else{return _0x5079be(null,_0x350598);}}}});}; \ No newline at end of file +var _0x13a5=['authorization_code','code','application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','format','substring','lastIndexOf','POST','parse','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','slice','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x13a5,0x13f));var _0x513a=function(_0x13d3ef,_0x3b7930){_0x13d3ef=_0x13d3ef-0x0;var _0x5bd705=_0x13a5[_0x13d3ef];return _0x5bd705;};'use strict';var _=require('lodash');var util=require(_0x513a('0x0'));var logger=require(_0x513a('0x1'))(_0x513a('0x2'));var moment=require(_0x513a('0x3'));var BPromise=require(_0x513a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x513a('0x5'));var rimraf=require(_0x513a('0x6'));var config=require(_0x513a('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x513a('0x8'));module[_0x513a('0x9')]=function(_0x49e1ab,_0x34cabe){return _0x49e1ab[_0x513a('0xa')](_0x513a('0xb'),attributes,{'tableName':_0x513a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1c7aab,_0xed815e,_0x1d1d71){if(_0x1c7aab[_0x513a('0xd')](_0x513a('0xe'))||_0x1c7aab['changed'](_0x513a('0xf'))||_0x1c7aab[_0x513a('0xd')](_0x513a('0x10'))||_0x1c7aab[_0x513a('0xd')](_0x513a('0x11'))||_0x1c7aab['changed']('code')||_0x1c7aab[_0x513a('0xd')]('host')){var _0x8296fa,_0x1c7471;_0x8296fa=_0x1c7aab['serverUrl'];var _0x54b9d2=_0x8296fa[_0x513a('0x12')](-0x1);if(_0x54b9d2==='/'||_0x54b9d2==='\x5c'||_0x54b9d2===':'){_0x8296fa=_0x8296fa['substring'](0x0,_0x8296fa['lastIndexOf'](_0x54b9d2));}switch(_0x1c7aab[_0x513a('0xe')]){case'US':_0x1c7471=_0x513a('0x13');break;case'AU':_0x1c7471=_0x513a('0x14');break;case'IN':_0x1c7471=_0x513a('0x15');break;case'CN':_0x1c7471=_0x513a('0x16');break;default:_0x1c7471=_0x513a('0x17');break;}var _0x23b647={'method':'POST','uri':_0x1c7471+_0x513a('0x18'),'form':{'grant_type':_0x513a('0x19'),'client_id':_0x1c7aab[_0x513a('0x10')],'client_secret':_0x1c7aab['clientSecret'],'redirect_uri':_0x1c7aab['serverUrl'],'code':_0x1c7aab[_0x513a('0x1a')]},'headers':{'Content-Type':_0x513a('0x1b')}};return rp(_0x23b647)[_0x513a('0x1c')](function(_0x58e206){var _0x1c938f=JSON['parse'](_0x58e206);if(_0x1c938f[_0x513a('0x1d')]){_0x1c7aab[_0x513a('0x1e')]=_0x1c938f[_0x513a('0x1d')];logger[_0x513a('0x1f')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1c7aab[_0x513a('0x20')],_0x1c7aab['id']));}else{logger[_0x513a('0x21')](util['format'](_0x513a('0x22'),_0x1c7aab[_0x513a('0x20')],_0x1c7aab['id']),util[_0x513a('0x23')](_0x1c938f,{'showHidden':![],'depth':null}));}return _0x1d1d71(null,_0xed815e);})[_0x513a('0x24')](function(_0xcda48d){logger[_0x513a('0x21')](util[_0x513a('0x25')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1c7aab[_0x513a('0x20')],_0x1c7aab['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1d1d71(_0xcda48d);});}else{return _0x1d1d71(null,_0xed815e);}},'beforeUpdate':function(_0x2d5011,_0x4beb7c,_0x14e607){if(_0x2d5011['changed'](_0x513a('0xe'))||_0x2d5011[_0x513a('0xd')](_0x513a('0xf'))||_0x2d5011[_0x513a('0xd')](_0x513a('0x10'))||_0x2d5011[_0x513a('0xd')](_0x513a('0x11'))||_0x2d5011[_0x513a('0xd')]('code')||_0x2d5011[_0x513a('0xd')]('host')){var _0x15421d,_0x58d0b5;_0x15421d=_0x2d5011[_0x513a('0xf')];var _0x402e31=_0x15421d['slice'](-0x1);if(_0x402e31==='/'||_0x402e31==='\x5c'||_0x402e31===':'){_0x15421d=_0x15421d[_0x513a('0x26')](0x0,_0x15421d[_0x513a('0x27')](_0x402e31));}switch(_0x2d5011[_0x513a('0xe')]){case'US':_0x58d0b5=_0x513a('0x13');break;case'AU':_0x58d0b5=_0x513a('0x14');break;case'IN':_0x58d0b5='https://accounts.zoho.in';break;case'CN':_0x58d0b5=_0x513a('0x16');break;default:_0x58d0b5=_0x513a('0x17');break;}var _0x552606={'method':_0x513a('0x28'),'uri':_0x58d0b5+_0x513a('0x18'),'form':{'grant_type':_0x513a('0x19'),'client_id':_0x2d5011[_0x513a('0x10')],'client_secret':_0x2d5011[_0x513a('0x11')],'redirect_uri':_0x2d5011['serverUrl'],'code':_0x2d5011[_0x513a('0x1a')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x552606)[_0x513a('0x1c')](function(_0x27bb71){var _0x4ca92=JSON[_0x513a('0x29')](_0x27bb71);if(_0x4ca92['refresh_token']){_0x2d5011[_0x513a('0x1e')]=_0x4ca92['refresh_token'];logger[_0x513a('0x1f')](util['format'](_0x513a('0x2a'),_0x2d5011[_0x513a('0x20')],_0x2d5011['id']));}else{logger[_0x513a('0x21')](util[_0x513a('0x25')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2d5011['name'],_0x2d5011['id']),util[_0x513a('0x23')](_0x4ca92,{'showHidden':![],'depth':null}));}return _0x14e607(null,_0x4beb7c);})[_0x513a('0x24')](function(_0x3e2897){logger[_0x513a('0x21')](util[_0x513a('0x25')](_0x513a('0x22'),_0x2d5011[_0x513a('0x20')],_0x2d5011['id']),util[_0x513a('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x14e607(_0x3e2897);});}else{return _0x14e607(null,_0x4beb7c);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 5fedcd7..5dcd2b3 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 _0x57f0=['jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','info','catch','GetZohoAccount','ZohoAccount','options','raw','where','attributes','limit','include','model','map','ShowZohoAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x57f0,0x164));var _0x057f=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x57f0[_0x3b5ad9];return _0x611ae9;};'use strict';var _=require(_0x057f('0x0'));var util=require(_0x057f('0x1'));var moment=require(_0x057f('0x2'));var BPromise=require(_0x057f('0x3'));var rs=require(_0x057f('0x4'));var fs=require('fs');var Redis=require(_0x057f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x057f('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x057f('0x7'));var client=jayson[_0x057f('0x8')][_0x057f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4cc2a2,_0x2c7f1a,_0x130029){return new BPromise(function(_0x495da5,_0x422c7a){return client[_0x057f('0xa')](_0x4cc2a2,_0x130029)[_0x057f('0xb')](function(_0x5eb814){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x2c7f1a,_0x057f('0xc'));logger[_0x057f('0xd')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x2c7f1a,'request\x20sent',JSON[_0x057f('0xe')](_0x5eb814));if(_0x5eb814['error']){if(_0x5eb814[_0x057f('0xf')][_0x057f('0x10')]===0x1f4){logger[_0x057f('0xf')](_0x057f('0x11'),_0x2c7f1a,_0x5eb814['error'][_0x057f('0x12')]);return _0x422c7a(_0x5eb814[_0x057f('0xf')][_0x057f('0x12')]);}logger[_0x057f('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x2c7f1a,_0x5eb814[_0x057f('0xf')]['message']);return _0x495da5(_0x5eb814['error'][_0x057f('0x12')]);}else{logger[_0x057f('0x13')](_0x057f('0x11'),_0x2c7f1a,_0x057f('0xc'));_0x495da5(_0x5eb814['result'][_0x057f('0x12')]);}})[_0x057f('0x14')](function(_0x2d5962){logger[_0x057f('0xf')](_0x057f('0x11'),_0x2c7f1a,_0x2d5962);_0x422c7a(_0x2d5962);});});}exports[_0x057f('0x15')]=function(_0x32b33d){var _0x210f3f=this;return new Promise(function(_0xb628c0,_0x1e48b6){return db[_0x057f('0x16')]['findAll']({'raw':_0x32b33d[_0x057f('0x17')]?_0x32b33d[_0x057f('0x17')][_0x057f('0x18')]===undefined?!![]:![]:!![],'where':_0x32b33d['options']?_0x32b33d[_0x057f('0x17')][_0x057f('0x19')]||null:null,'attributes':_0x32b33d[_0x057f('0x17')]?_0x32b33d['options'][_0x057f('0x1a')]||null:null,'limit':_0x32b33d[_0x057f('0x17')]?_0x32b33d[_0x057f('0x17')][_0x057f('0x1b')]||null:null,'include':_0x32b33d['options']?_0x32b33d[_0x057f('0x17')][_0x057f('0x1c')]?_['map'](_0x32b33d['options'][_0x057f('0x1c')],function(_0x21e3cb){return{'model':db[_0x21e3cb[_0x057f('0x1d')]],'as':_0x21e3cb['as'],'attributes':_0x21e3cb['attributes'],'include':_0x21e3cb[_0x057f('0x1c')]?_['map'](_0x21e3cb['include'],function(_0x3639c6){return{'model':db[_0x3639c6[_0x057f('0x1d')]],'as':_0x3639c6['as'],'attributes':_0x3639c6[_0x057f('0x1a')],'include':_0x3639c6[_0x057f('0x1c')]?_[_0x057f('0x1e')](_0x3639c6[_0x057f('0x1c')],function(_0x9154fb){return{'model':db[_0x9154fb['model']],'as':_0x9154fb['as'],'attributes':_0x9154fb['attributes']};}):[]};}):[]};}):[]:[]})[_0x057f('0xb')](function(_0x12438e){logger['info'](_0x057f('0x15'),_0x32b33d);logger[_0x057f('0xd')](_0x057f('0x15'),_0x32b33d,JSON['stringify'](_0x12438e));_0xb628c0(_0x12438e);})[_0x057f('0x14')](function(_0x5dfcfc){logger[_0x057f('0xf')]('GetZohoAccount',_0x5dfcfc[_0x057f('0x12')],_0x32b33d);_0x1e48b6(_0x210f3f['error'](0x1f4,_0x5dfcfc['message']));});});};exports[_0x057f('0x1f')]=function(_0x1aeab5){var _0x2b0f9f=this;return new Promise(function(_0x2502e9,_0x571970){return db[_0x057f('0x16')][_0x057f('0x20')]({'raw':_0x1aeab5[_0x057f('0x17')]?_0x1aeab5[_0x057f('0x17')][_0x057f('0x18')]===undefined?!![]:![]:!![],'where':_0x1aeab5['options']?_0x1aeab5[_0x057f('0x17')][_0x057f('0x19')]||null:null,'attributes':_0x1aeab5[_0x057f('0x17')]?_0x1aeab5['options'][_0x057f('0x1a')]||null:null,'include':_0x1aeab5['options']?_0x1aeab5['options'][_0x057f('0x1c')]?_[_0x057f('0x1e')](_0x1aeab5['options'][_0x057f('0x1c')],function(_0x3581b3){return{'model':db[_0x3581b3[_0x057f('0x1d')]],'as':_0x3581b3['as'],'attributes':_0x3581b3[_0x057f('0x1a')],'include':_0x3581b3[_0x057f('0x1c')]?_['map'](_0x3581b3[_0x057f('0x1c')],function(_0x3630ed){return{'model':db[_0x3630ed['model']],'as':_0x3630ed['as'],'attributes':_0x3630ed[_0x057f('0x1a')],'include':_0x3630ed[_0x057f('0x1c')]?_['map'](_0x3630ed[_0x057f('0x1c')],function(_0x45442a){return{'model':db[_0x45442a[_0x057f('0x1d')]],'as':_0x45442a['as'],'attributes':_0x45442a['attributes']};}):[]};}):[]};}):[]:[]})[_0x057f('0xb')](function(_0x55914b){logger[_0x057f('0x13')](_0x057f('0x1f'),_0x1aeab5);logger[_0x057f('0xd')](_0x057f('0x1f'),_0x1aeab5,JSON[_0x057f('0xe')](_0x55914b));_0x2502e9(_0x55914b);})['catch'](function(_0x3b5359){logger[_0x057f('0xf')](_0x057f('0x1f'),_0x3b5359[_0x057f('0x12')],_0x1aeab5);_0x571970(_0x2b0f9f[_0x057f('0xf')](0x1f4,_0x3b5359['message']));});});}; \ No newline at end of file +var _0xb2e8=['find','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetZohoAccount','findAll','options','where','limit','include','map','model','attributes','ShowZohoAccount','ZohoAccount'];(function(_0x512532,_0x411ff2){var _0x25cccf=function(_0x212c7b){while(--_0x212c7b){_0x512532['push'](_0x512532['shift']());}};_0x25cccf(++_0x411ff2);}(_0xb2e8,0x1a6));var _0x8b2e=function(_0x142105,_0xbdb110){_0x142105=_0x142105-0x0;var _0xa862b=_0xb2e8[_0x142105];return _0xa862b;};'use strict';var _=require(_0x8b2e('0x0'));var util=require(_0x8b2e('0x1'));var moment=require('moment');var BPromise=require(_0x8b2e('0x2'));var rs=require(_0x8b2e('0x3'));var fs=require('fs');var Redis=require(_0x8b2e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8b2e('0x5'));var logger=require(_0x8b2e('0x6'))(_0x8b2e('0x7'));var config=require(_0x8b2e('0x8'));var jayson=require(_0x8b2e('0x9'));var client=jayson['client'][_0x8b2e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30b35e,_0x5dc009,_0x36d0e8){return new BPromise(function(_0x1f0fe1,_0x191617){return client[_0x8b2e('0xb')](_0x30b35e,_0x36d0e8)[_0x8b2e('0xc')](function(_0x3e9562){logger['info'](_0x8b2e('0xd'),_0x5dc009,'request\x20sent');logger[_0x8b2e('0xe')](_0x8b2e('0xf'),_0x5dc009,'request\x20sent',JSON[_0x8b2e('0x10')](_0x3e9562));if(_0x3e9562[_0x8b2e('0x11')]){if(_0x3e9562['error']['code']===0x1f4){logger[_0x8b2e('0x11')](_0x8b2e('0xd'),_0x5dc009,_0x3e9562[_0x8b2e('0x11')][_0x8b2e('0x12')]);return _0x191617(_0x3e9562[_0x8b2e('0x11')][_0x8b2e('0x12')]);}logger[_0x8b2e('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x5dc009,_0x3e9562[_0x8b2e('0x11')][_0x8b2e('0x12')]);return _0x1f0fe1(_0x3e9562['error'][_0x8b2e('0x12')]);}else{logger[_0x8b2e('0x13')](_0x8b2e('0xd'),_0x5dc009,'request\x20sent');_0x1f0fe1(_0x3e9562[_0x8b2e('0x14')][_0x8b2e('0x12')]);}})[_0x8b2e('0x15')](function(_0x929d24){logger[_0x8b2e('0x11')](_0x8b2e('0xd'),_0x5dc009,_0x929d24);_0x191617(_0x929d24);});});}exports[_0x8b2e('0x16')]=function(_0x2fe36e){var _0xbd6725=this;return new Promise(function(_0x53710a,_0x590c0c){return db['ZohoAccount'][_0x8b2e('0x17')]({'raw':_0x2fe36e[_0x8b2e('0x18')]?_0x2fe36e[_0x8b2e('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2fe36e[_0x8b2e('0x18')]?_0x2fe36e[_0x8b2e('0x18')][_0x8b2e('0x19')]||null:null,'attributes':_0x2fe36e[_0x8b2e('0x18')]?_0x2fe36e[_0x8b2e('0x18')]['attributes']||null:null,'limit':_0x2fe36e['options']?_0x2fe36e[_0x8b2e('0x18')][_0x8b2e('0x1a')]||null:null,'include':_0x2fe36e[_0x8b2e('0x18')]?_0x2fe36e[_0x8b2e('0x18')][_0x8b2e('0x1b')]?_[_0x8b2e('0x1c')](_0x2fe36e['options'][_0x8b2e('0x1b')],function(_0x12cc7b){return{'model':db[_0x12cc7b[_0x8b2e('0x1d')]],'as':_0x12cc7b['as'],'attributes':_0x12cc7b[_0x8b2e('0x1e')],'include':_0x12cc7b[_0x8b2e('0x1b')]?_[_0x8b2e('0x1c')](_0x12cc7b[_0x8b2e('0x1b')],function(_0x4fc5ac){return{'model':db[_0x4fc5ac[_0x8b2e('0x1d')]],'as':_0x4fc5ac['as'],'attributes':_0x4fc5ac['attributes'],'include':_0x4fc5ac['include']?_[_0x8b2e('0x1c')](_0x4fc5ac[_0x8b2e('0x1b')],function(_0x4c085a){return{'model':db[_0x4c085a['model']],'as':_0x4c085a['as'],'attributes':_0x4c085a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x519e03){logger[_0x8b2e('0x13')](_0x8b2e('0x16'),_0x2fe36e);logger[_0x8b2e('0xe')](_0x8b2e('0x16'),_0x2fe36e,JSON['stringify'](_0x519e03));_0x53710a(_0x519e03);})['catch'](function(_0x52a626){logger[_0x8b2e('0x11')]('GetZohoAccount',_0x52a626[_0x8b2e('0x12')],_0x2fe36e);_0x590c0c(_0xbd6725[_0x8b2e('0x11')](0x1f4,_0x52a626['message']));});});};exports[_0x8b2e('0x1f')]=function(_0x4fd37f){var _0x3a4e69=this;return new Promise(function(_0x2ca6fc,_0x461b77){return db[_0x8b2e('0x20')][_0x8b2e('0x21')]({'raw':_0x4fd37f['options']?_0x4fd37f[_0x8b2e('0x18')][_0x8b2e('0x22')]===undefined?!![]:![]:!![],'where':_0x4fd37f[_0x8b2e('0x18')]?_0x4fd37f[_0x8b2e('0x18')][_0x8b2e('0x19')]||null:null,'attributes':_0x4fd37f['options']?_0x4fd37f[_0x8b2e('0x18')][_0x8b2e('0x1e')]||null:null,'include':_0x4fd37f[_0x8b2e('0x18')]?_0x4fd37f[_0x8b2e('0x18')][_0x8b2e('0x1b')]?_[_0x8b2e('0x1c')](_0x4fd37f['options'][_0x8b2e('0x1b')],function(_0x316ffb){return{'model':db[_0x316ffb[_0x8b2e('0x1d')]],'as':_0x316ffb['as'],'attributes':_0x316ffb[_0x8b2e('0x1e')],'include':_0x316ffb['include']?_[_0x8b2e('0x1c')](_0x316ffb[_0x8b2e('0x1b')],function(_0x3ca31c){return{'model':db[_0x3ca31c['model']],'as':_0x3ca31c['as'],'attributes':_0x3ca31c[_0x8b2e('0x1e')],'include':_0x3ca31c[_0x8b2e('0x1b')]?_[_0x8b2e('0x1c')](_0x3ca31c['include'],function(_0x273b38){return{'model':db[_0x273b38[_0x8b2e('0x1d')]],'as':_0x273b38['as'],'attributes':_0x273b38[_0x8b2e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8b2e('0xc')](function(_0x2243b2){logger[_0x8b2e('0x13')](_0x8b2e('0x1f'),_0x4fd37f);logger['debug'](_0x8b2e('0x1f'),_0x4fd37f,JSON[_0x8b2e('0x10')](_0x2243b2));_0x2ca6fc(_0x2243b2);})[_0x8b2e('0x15')](function(_0x3c4df5){logger[_0x8b2e('0x11')](_0x8b2e('0x1f'),_0x3c4df5[_0x8b2e('0x12')],_0x4fd37f);_0x461b77(_0x3a4e69[_0x8b2e('0x11')](0x1f4,_0x3c4df5['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 109b7f1..9067cfa 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 _0x79e2=['/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show'];(function(_0x155f27,_0x164989){var _0x48b237=function(_0x358f5c){while(--_0x358f5c){_0x155f27['push'](_0x155f27['shift']());}};_0x48b237(++_0x164989);}(_0x79e2,0x1c3));var _0x279e=function(_0x3a402c,_0x947df1){_0x3a402c=_0x3a402c-0x0;var _0x396fa6=_0x79e2[_0x3a402c];return _0x396fa6;};'use strict';var multer=require(_0x279e('0x0'));var util=require('util');var path=require(_0x279e('0x1'));var timeout=require(_0x279e('0x2'));var express=require(_0x279e('0x3'));var router=express['Router']();var auth=require(_0x279e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x279e('0x5'));var controller=require(_0x279e('0x6'));router[_0x279e('0x7')]('/',auth[_0x279e('0x8')](),controller['index']);router['get'](_0x279e('0x9'),auth[_0x279e('0x8')](),controller[_0x279e('0xa')]);router[_0x279e('0x7')](_0x279e('0xb'),auth['isAuthenticated'](),controller[_0x279e('0xc')]);router[_0x279e('0x7')](_0x279e('0xd'),auth['isAuthenticated'](),controller[_0x279e('0xe')]);router[_0x279e('0x7')]('/:id/descriptions',auth[_0x279e('0x8')](),controller[_0x279e('0xf')]);router[_0x279e('0x10')]('/',auth[_0x279e('0x8')](),controller[_0x279e('0x11')]);router[_0x279e('0x12')](_0x279e('0x9'),auth[_0x279e('0x8')](),controller['update']);router[_0x279e('0x13')]('/:id',auth[_0x279e('0x8')](),controller[_0x279e('0x14')]);module[_0x279e('0x15')]=router; \ No newline at end of file +var _0xdc08=['delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','post','create','put','update'];(function(_0x1f245d,_0x408a0e){var _0x444056=function(_0x571d38){while(--_0x571d38){_0x1f245d['push'](_0x1f245d['shift']());}};_0x444056(++_0x408a0e);}(_0xdc08,0xb2));var _0x8dc0=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xdc08[_0x278e3c];return _0x3e2d9b;};'use strict';var multer=require(_0x8dc0('0x0'));var util=require(_0x8dc0('0x1'));var path=require(_0x8dc0('0x2'));var timeout=require(_0x8dc0('0x3'));var express=require(_0x8dc0('0x4'));var router=express['Router']();var auth=require(_0x8dc0('0x5'));var interaction=require(_0x8dc0('0x6'));var config=require(_0x8dc0('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0x8dc0('0x8')]('/',auth[_0x8dc0('0x9')](),controller[_0x8dc0('0xa')]);router[_0x8dc0('0x8')](_0x8dc0('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x8dc0('0x8')](_0x8dc0('0xc'),auth[_0x8dc0('0x9')](),controller[_0x8dc0('0xd')]);router[_0x8dc0('0x8')](_0x8dc0('0xe'),auth[_0x8dc0('0x9')](),controller[_0x8dc0('0xf')]);router[_0x8dc0('0x8')]('/:id/descriptions',auth[_0x8dc0('0x9')](),controller['getDescriptions']);router[_0x8dc0('0x10')]('/',auth[_0x8dc0('0x9')](),controller[_0x8dc0('0x11')]);router[_0x8dc0('0x12')](_0x8dc0('0xb'),auth[_0x8dc0('0x9')](),controller[_0x8dc0('0x13')]);router[_0x8dc0('0x14')](_0x8dc0('0xb'),auth[_0x8dc0('0x9')](),controller['destroy']);module[_0x8dc0('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 9fa60b4..6defe6a 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 _0xe5f8=['STRING','sequelize','exports'];(function(_0x3b036e,_0x59b18c){var _0x22e2ae=function(_0x5039f1){while(--_0x5039f1){_0x3b036e['push'](_0x3b036e['shift']());}};_0x22e2ae(++_0x59b18c);}(_0xe5f8,0x100));var _0x8e5f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe5f8[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x8e5f('0x0'));module[_0x8e5f('0x1')]={'name':{'type':Sequelize[_0x8e5f('0x2')]},'description':{'type':Sequelize[_0x8e5f('0x2')]}}; \ No newline at end of file +var _0x290f=['sequelize','exports','STRING'];(function(_0x10b684,_0x298fb0){var _0x494735=function(_0x28e48a){while(--_0x28e48a){_0x10b684['push'](_0x10b684['shift']());}};_0x494735(++_0x298fb0);}(_0x290f,0x13b));var _0xf290=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x290f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf290('0x0'));module[_0xf290('0x1')]={'name':{'type':Sequelize[_0xf290('0x2')]},'description':{'type':Sequelize[_0xf290('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 6982eca..8d30391 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 _0x656f=['merge','type','key','filter','options','includeAll','include','rows','show','params','length','find','create','body','findOne','order','map','getFields','hasOwnProperty','ZohoField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','update','destroy','stack','name','send','index','ZohoConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','pick'];(function(_0x209926,_0x3b4253){var _0x38b0e9=function(_0x271608){while(--_0x271608){_0x209926['push'](_0x209926['shift']());}};_0x38b0e9(++_0x3b4253);}(_0x656f,0xc8));var _0xf656=function(_0x371b66,_0x2c23e1){_0x371b66=_0x371b66-0x0;var _0x1129fe=_0x656f[_0x371b66];return _0x1129fe;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xf656('0x0'));var zipdir=require(_0xf656('0x1'));var jsonpatch=require(_0xf656('0x2'));var rp=require(_0xf656('0x3'));var moment=require(_0xf656('0x4'));var BPromise=require(_0xf656('0x5'));var Mustache=require(_0xf656('0x6'));var util=require(_0xf656('0x7'));var path=require(_0xf656('0x8'));var sox=require(_0xf656('0x9'));var csv=require(_0xf656('0xa'));var ejs=require(_0xf656('0xb'));var fs=require('fs');var _=require(_0xf656('0xc'));var squel=require(_0xf656('0xd'));var crypto=require(_0xf656('0xe'));var jsforce=require(_0xf656('0xf'));var deskjs=require(_0xf656('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf656('0x11'));var Redis=require(_0xf656('0x12'));var authService=require(_0xf656('0x13'));var qs=require(_0xf656('0x14'));var hardwareService=require(_0xf656('0x15'));var logger=require(_0xf656('0x16'))(_0xf656('0x17'));var utils=require('../../config/utils');var config=require(_0xf656('0x18'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xf656('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x4feb72,_0x30051f,_0x419188){if(_0x419188){var _0x258802=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x258802[_0xf656('0x1a')](_0x30051f)){return _0x4feb72;}else{throw new Error(_0xf656('0x1b'));}}else{return _0x4feb72;}}function respondWithRpcPromise(_0x2cfa61,_0x417131,_0x363cf5,_0x5766d3){return new BPromise(function(_0x2631c7,_0x5ed848){var _0x54fb05=_0x5766d3||client;return _0x54fb05['request'](_0x2cfa61,_0x363cf5)[_0xf656('0x1c')](function(_0x5ea8ec){logger[_0xf656('0x1d')](_0xf656('0x1e'),_0x417131,'request\x20sent');logger[_0xf656('0x1f')](_0xf656('0x20'),_0x417131,'request\x20sent',JSON[_0xf656('0x21')](_0x5ea8ec));if(_0x5ea8ec['error']){if(_0x5ea8ec['error']['code']===0x1f4){logger[_0xf656('0x22')]('ZohoConfiguration,\x20%s,\x20%s',_0x417131,_0x5ea8ec[_0xf656('0x22')][_0xf656('0x23')]);return _0x5ed848(_0x5ea8ec[_0xf656('0x22')]['message']);}logger[_0xf656('0x22')]('ZohoConfiguration,\x20%s,\x20%s',_0x417131,_0x5ea8ec[_0xf656('0x22')][_0xf656('0x23')]);return _0x2631c7(_0x5ea8ec[_0xf656('0x22')]['message']);}else{logger['info'](_0xf656('0x1e'),_0x417131,'request\x20sent');_0x2631c7(_0x5ea8ec[_0xf656('0x24')]['message']);}})[_0xf656('0x25')](function(_0xca5fa5){logger['error'](_0xf656('0x1e'),_0x417131,_0xca5fa5);_0x5ed848(_0xca5fa5);});});}function respondWithStatusCode(_0x2f02ff,_0x3a4691){_0x3a4691=_0x3a4691||0xcc;return function(_0x2cfd21){if(_0x2cfd21){return _0x2f02ff[_0xf656('0x26')](_0x3a4691);}return _0x2f02ff['status'](_0x3a4691)[_0xf656('0x27')]();};}function respondWithResult(_0x8b82a1,_0x37bf9d){_0x37bf9d=_0x37bf9d||0xc8;return function(_0x31cda0){if(_0x31cda0){return _0x8b82a1[_0xf656('0x28')](_0x37bf9d)[_0xf656('0x29')](_0x31cda0);}};}function respondWithFilteredResult(_0x38de76,_0x5b76e4){return function(_0x548967){if(_0x548967){var _0x91a135=_0x548967[_0xf656('0x2a')],_0x2357d3=_0x5b76e4[_0xf656('0x2b')],_0x5a93ca=_0x5b76e4[_0xf656('0x2b')]+_0x5b76e4[_0xf656('0x2c')],_0x15efa3;if(_0x5a93ca>=_0x91a135){_0x5a93ca=_0x91a135;_0x15efa3=0xc8;}else{_0x15efa3=0xce;}_0x38de76[_0xf656('0x28')](_0x15efa3);return _0x38de76['set'](_0xf656('0x2d'),_0x2357d3+'-'+_0x5a93ca+'/'+_0x91a135)['json'](_0x548967);}return null;};}function patchUpdates(_0x1390cf){return function(_0xd664eb){try{jsonpatch['apply'](_0xd664eb,_0x1390cf,!![]);}catch(_0x55162d){return BPromise[_0xf656('0x2e')](_0x55162d);}return _0xd664eb[_0xf656('0x2f')]();};}function saveUpdates(_0x174dc5,_0x40377c){return function(_0xe6543c){if(_0xe6543c){return _0xe6543c[_0xf656('0x30')](_0x174dc5)['then'](function(_0x1822a1){return _0x1822a1;});}return null;};}function removeEntity(_0x79b824,_0x464d1c){return function(_0x340d9f){if(_0x340d9f){return _0x340d9f[_0xf656('0x31')]()[_0xf656('0x1c')](function(){_0x79b824[_0xf656('0x28')](0xcc)[_0xf656('0x27')]();});}};}function handleEntityNotFound(_0x41d670,_0x22496b){return function(_0x4ac5a2){if(!_0x4ac5a2){_0x41d670['sendStatus'](0x194);}return _0x4ac5a2;};}function handleError(_0x4f1b99,_0x2d93ce){_0x2d93ce=_0x2d93ce||0x1f4;return function(_0xc8eccb){logger['error'](_0xc8eccb[_0xf656('0x32')]);if(_0xc8eccb['name']){delete _0xc8eccb[_0xf656('0x33')];}_0x4f1b99[_0xf656('0x28')](_0x2d93ce)[_0xf656('0x34')](_0xc8eccb);};}exports[_0xf656('0x35')]=function(_0x141f3c,_0x3477d1){var _0x18f423={},_0x35f5e9={},_0x26f158={'count':0x0,'rows':[]};var _0x44811b=db[_0xf656('0x36')][_0xf656('0x37')];_0x35f5e9[_0xf656('0x38')]=_[_0xf656('0x39')](_0x44811b);_0x35f5e9[_0xf656('0x3a')]=_['keys'](_0x141f3c[_0xf656('0x3a')]);_0x35f5e9[_0xf656('0x3b')]=_[_0xf656('0x3c')](_0x35f5e9[_0xf656('0x38')],_0x35f5e9[_0xf656('0x3a')]);_0x18f423[_0xf656('0x3d')]=_[_0xf656('0x3c')](_0x35f5e9[_0xf656('0x38')],qs[_0xf656('0x3e')](_0x141f3c[_0xf656('0x3a')][_0xf656('0x3e')]));_0x18f423[_0xf656('0x3d')]=_0x18f423[_0xf656('0x3d')]['length']?_0x18f423[_0xf656('0x3d')]:_0x35f5e9['model'];if(!_0x141f3c[_0xf656('0x3a')]['hasOwnProperty'](_0xf656('0x3f'))){_0x18f423[_0xf656('0x2c')]=qs[_0xf656('0x2c')](_0x141f3c[_0xf656('0x3a')]['limit']);_0x18f423['offset']=qs[_0xf656('0x2b')](_0x141f3c[_0xf656('0x3a')]['offset']);}_0x18f423['order']=qs[_0xf656('0x40')](_0x141f3c[_0xf656('0x3a')][_0xf656('0x40')]);_0x18f423[_0xf656('0x41')]=qs[_0xf656('0x3b')](_[_0xf656('0x42')](_0x141f3c[_0xf656('0x3a')],_0x35f5e9[_0xf656('0x3b')]));if(_0x141f3c['query']['filter']){_0x18f423['where']=_[_0xf656('0x43')](_0x18f423[_0xf656('0x41')],{'$or':_['map'](_0x44811b,function(_0x42ae7e){if(_0x42ae7e[_0xf656('0x44')][_0xf656('0x45')]!=='VIRTUAL'){var _0x146bd9={};_0x146bd9[_0x42ae7e['field']]={'$like':'%'+_0x141f3c[_0xf656('0x3a')][_0xf656('0x46')]+'%'};return _0x146bd9;}})});}_0x18f423=_['merge']({},_0x18f423,_0x141f3c[_0xf656('0x47')]);var _0x574894={'where':_0x18f423[_0xf656('0x41')]};return db[_0xf656('0x36')]['count'](_0x574894)['then'](function(_0xd860bb){_0x26f158['count']=_0xd860bb;if(_0x141f3c[_0xf656('0x3a')][_0xf656('0x48')]){_0x18f423[_0xf656('0x49')]=[{'all':!![]}];}return db[_0xf656('0x36')]['findAll'](_0x18f423);})[_0xf656('0x1c')](function(_0x3ff6d5){_0x26f158[_0xf656('0x4a')]=_0x3ff6d5;return _0x26f158;})['then'](respondWithFilteredResult(_0x3477d1,_0x18f423))['catch'](handleError(_0x3477d1,null));};exports[_0xf656('0x4b')]=function(_0x5193a9,_0x1a9c1c){var _0x10db5f={'raw':![],'where':{'id':_0x5193a9[_0xf656('0x4c')]['id']}},_0x1b89a1={};_0x1b89a1[_0xf656('0x38')]=_[_0xf656('0x39')](db['ZohoConfiguration'][_0xf656('0x37')]);_0x1b89a1[_0xf656('0x3a')]=_[_0xf656('0x39')](_0x5193a9[_0xf656('0x3a')]);_0x1b89a1[_0xf656('0x3b')]=_['intersection'](_0x1b89a1[_0xf656('0x38')],_0x1b89a1[_0xf656('0x3a')]);_0x10db5f[_0xf656('0x3d')]=_[_0xf656('0x3c')](_0x1b89a1['model'],qs[_0xf656('0x3e')](_0x5193a9['query'][_0xf656('0x3e')]));_0x10db5f[_0xf656('0x3d')]=_0x10db5f['attributes'][_0xf656('0x4d')]?_0x10db5f[_0xf656('0x3d')]:_0x1b89a1[_0xf656('0x38')];if(_0x5193a9[_0xf656('0x3a')]['includeAll']){_0x10db5f[_0xf656('0x49')]=[{'all':!![]}];}_0x10db5f=_['merge']({},_0x10db5f,_0x5193a9[_0xf656('0x47')]);return db[_0xf656('0x36')][_0xf656('0x4e')](_0x10db5f)[_0xf656('0x1c')](handleEntityNotFound(_0x1a9c1c,null))['then'](respondWithResult(_0x1a9c1c,null))['catch'](handleError(_0x1a9c1c,null));};exports['create']=function(_0x382485,_0x45ca3f){return db['ZohoConfiguration'][_0xf656('0x4f')](_0x382485['body'],{})[_0xf656('0x1c')](respondWithResult(_0x45ca3f,0xc9))[_0xf656('0x25')](handleError(_0x45ca3f,null));};exports[_0xf656('0x30')]=function(_0x507d20,_0x2623c9){if(_0x507d20[_0xf656('0x50')]['id']){delete _0x507d20[_0xf656('0x50')]['id'];}return db[_0xf656('0x36')][_0xf656('0x4e')]({'where':{'id':_0x507d20['params']['id']}})['then'](handleEntityNotFound(_0x2623c9,null))[_0xf656('0x1c')](saveUpdates(_0x507d20[_0xf656('0x50')],null))[_0xf656('0x1c')](respondWithResult(_0x2623c9,null))[_0xf656('0x25')](handleError(_0x2623c9,null));};exports[_0xf656('0x31')]=function(_0x2fa275,_0x45023f){return db[_0xf656('0x36')]['find']({'where':{'id':_0x2fa275[_0xf656('0x4c')]['id']}})['then'](handleEntityNotFound(_0x45023f,null))[_0xf656('0x1c')](removeEntity(_0x45023f,null))[_0xf656('0x25')](handleError(_0x45023f,null));};exports['getFields']=function(_0x2a5356,_0x2257ae,_0x8c12e4){var _0x3f85f6={};var _0x47c3cd={};var _0x549be5;var _0x11cf91;return db[_0xf656('0x36')][_0xf656('0x51')]({'where':{'id':_0x2a5356[_0xf656('0x4c')]['id']}})[_0xf656('0x1c')](handleEntityNotFound(_0x2257ae,null))[_0xf656('0x1c')](function(_0xa35fbb){if(_0xa35fbb){_0x549be5=_0xa35fbb;_0x47c3cd[_0xf656('0x38')]=_[_0xf656('0x39')](db['ZohoField'][_0xf656('0x37')]);_0x47c3cd[_0xf656('0x3a')]=_['keys'](_0x2a5356[_0xf656('0x3a')]);_0x47c3cd[_0xf656('0x3b')]=_[_0xf656('0x3c')](_0x47c3cd[_0xf656('0x38')],_0x47c3cd['query']);_0x3f85f6['attributes']=_[_0xf656('0x3c')](_0x47c3cd[_0xf656('0x38')],qs[_0xf656('0x3e')](_0x2a5356['query']['fields']));_0x3f85f6[_0xf656('0x3d')]=_0x3f85f6[_0xf656('0x3d')][_0xf656('0x4d')]?_0x3f85f6['attributes']:_0x47c3cd['model'];_0x3f85f6[_0xf656('0x52')]=qs[_0xf656('0x40')](_0x2a5356[_0xf656('0x3a')][_0xf656('0x40')]);_0x3f85f6[_0xf656('0x41')]=qs[_0xf656('0x3b')](_[_0xf656('0x42')](_0x2a5356['query'],_0x47c3cd[_0xf656('0x3b')]));if(_0x2a5356[_0xf656('0x3a')][_0xf656('0x46')]){_0x3f85f6[_0xf656('0x41')]=_['merge'](_0x3f85f6['where'],{'$or':_[_0xf656('0x53')](_0x3f85f6[_0xf656('0x3d')],function(_0x203c7e){var _0x1cdbee={};_0x1cdbee[_0x203c7e]={'$like':'%'+_0x2a5356[_0xf656('0x3a')][_0xf656('0x46')]+'%'};return _0x1cdbee;})});}_0x3f85f6=_[_0xf656('0x43')]({},_0x3f85f6,_0x2a5356[_0xf656('0x47')]);return _0x549be5[_0xf656('0x54')](_0x3f85f6);}})[_0xf656('0x1c')](function(_0x116912){if(_0x116912){_0x11cf91=_0x116912[_0xf656('0x4d')];if(!_0x2a5356[_0xf656('0x3a')][_0xf656('0x55')](_0xf656('0x3f'))){_0x3f85f6['limit']=qs[_0xf656('0x2c')](_0x2a5356[_0xf656('0x3a')][_0xf656('0x2c')]);_0x3f85f6['offset']=qs[_0xf656('0x2b')](_0x2a5356[_0xf656('0x3a')][_0xf656('0x2b')]);}return _0x549be5[_0xf656('0x54')](_0x3f85f6);}})['then'](function(_0x3fe1f4){if(_0x3fe1f4){return _0x3fe1f4?{'count':_0x11cf91,'rows':_0x3fe1f4}:null;}})['then'](respondWithResult(_0x2257ae,null))[_0xf656('0x25')](handleError(_0x2257ae,null));};exports['getSubjects']=function(_0x3e1c12,_0x2eb15c,_0x12ab26){var _0x531649={};var _0x14a792={};var _0x2f52df;var _0x1364e0;return db['ZohoConfiguration'][_0xf656('0x51')]({'where':{'id':_0x3e1c12[_0xf656('0x4c')]['id']}})[_0xf656('0x1c')](handleEntityNotFound(_0x2eb15c,null))['then'](function(_0x265ccb){if(_0x265ccb){_0x2f52df=_0x265ccb;_0x14a792[_0xf656('0x38')]=_[_0xf656('0x39')](db[_0xf656('0x56')]['rawAttributes']);_0x14a792[_0xf656('0x3a')]=_[_0xf656('0x39')](_0x3e1c12[_0xf656('0x3a')]);_0x14a792[_0xf656('0x3b')]=_[_0xf656('0x3c')](_0x14a792['model'],_0x14a792[_0xf656('0x3a')]);_0x531649[_0xf656('0x3d')]=_[_0xf656('0x3c')](_0x14a792[_0xf656('0x38')],qs[_0xf656('0x3e')](_0x3e1c12['query'][_0xf656('0x3e')]));_0x531649['attributes']=_0x531649[_0xf656('0x3d')][_0xf656('0x4d')]?_0x531649['attributes']:_0x14a792['model'];_0x531649[_0xf656('0x52')]=qs[_0xf656('0x40')](_0x3e1c12[_0xf656('0x3a')][_0xf656('0x40')]);_0x531649[_0xf656('0x41')]=qs[_0xf656('0x3b')](_[_0xf656('0x42')](_0x3e1c12[_0xf656('0x3a')],_0x14a792['filters']));if(_0x3e1c12['query'][_0xf656('0x46')]){_0x531649[_0xf656('0x41')]=_['merge'](_0x531649[_0xf656('0x41')],{'$or':_[_0xf656('0x53')](_0x531649['attributes'],function(_0x5b869f){var _0x50bb3c={};_0x50bb3c[_0x5b869f]={'$like':'%'+_0x3e1c12['query'][_0xf656('0x46')]+'%'};return _0x50bb3c;})});}_0x531649=_[_0xf656('0x43')]({},_0x531649,_0x3e1c12['options']);return _0x2f52df[_0xf656('0x57')](_0x531649);}})[_0xf656('0x1c')](function(_0x3d9b53){if(_0x3d9b53){_0x1364e0=_0x3d9b53[_0xf656('0x4d')];if(!_0x3e1c12['query'][_0xf656('0x55')](_0xf656('0x3f'))){_0x531649['limit']=qs['limit'](_0x3e1c12[_0xf656('0x3a')][_0xf656('0x2c')]);_0x531649['offset']=qs[_0xf656('0x2b')](_0x3e1c12[_0xf656('0x3a')][_0xf656('0x2b')]);}return _0x2f52df[_0xf656('0x57')](_0x531649);}})[_0xf656('0x1c')](function(_0x4b4b49){if(_0x4b4b49){return _0x4b4b49?{'count':_0x1364e0,'rows':_0x4b4b49}:null;}})[_0xf656('0x1c')](respondWithResult(_0x2eb15c,null))[_0xf656('0x25')](handleError(_0x2eb15c,null));};exports[_0xf656('0x58')]=function(_0x34eaa3,_0x3b3e48,_0x581fa7){var _0x356469={};var _0x322bd6={};var _0x24e2a0;var _0x5594ba;return db[_0xf656('0x36')][_0xf656('0x51')]({'where':{'id':_0x34eaa3['params']['id']}})[_0xf656('0x1c')](handleEntityNotFound(_0x3b3e48,null))[_0xf656('0x1c')](function(_0x8733f4){if(_0x8733f4){_0x24e2a0=_0x8733f4;_0x322bd6[_0xf656('0x38')]=_[_0xf656('0x39')](db[_0xf656('0x56')][_0xf656('0x37')]);_0x322bd6[_0xf656('0x3a')]=_[_0xf656('0x39')](_0x34eaa3[_0xf656('0x3a')]);_0x322bd6[_0xf656('0x3b')]=_[_0xf656('0x3c')](_0x322bd6['model'],_0x322bd6[_0xf656('0x3a')]);_0x356469[_0xf656('0x3d')]=_[_0xf656('0x3c')](_0x322bd6[_0xf656('0x38')],qs[_0xf656('0x3e')](_0x34eaa3[_0xf656('0x3a')][_0xf656('0x3e')]));_0x356469[_0xf656('0x3d')]=_0x356469[_0xf656('0x3d')][_0xf656('0x4d')]?_0x356469[_0xf656('0x3d')]:_0x322bd6[_0xf656('0x38')];_0x356469[_0xf656('0x52')]=qs[_0xf656('0x40')](_0x34eaa3[_0xf656('0x3a')][_0xf656('0x40')]);_0x356469[_0xf656('0x41')]=qs[_0xf656('0x3b')](_['pick'](_0x34eaa3[_0xf656('0x3a')],_0x322bd6[_0xf656('0x3b')]));if(_0x34eaa3[_0xf656('0x3a')]['filter']){_0x356469[_0xf656('0x41')]=_[_0xf656('0x43')](_0x356469['where'],{'$or':_[_0xf656('0x53')](_0x356469[_0xf656('0x3d')],function(_0x453cfe){var _0x29049d={};_0x29049d[_0x453cfe]={'$like':'%'+_0x34eaa3[_0xf656('0x3a')][_0xf656('0x46')]+'%'};return _0x29049d;})});}_0x356469=_[_0xf656('0x43')]({},_0x356469,_0x34eaa3['options']);return _0x24e2a0[_0xf656('0x58')](_0x356469);}})[_0xf656('0x1c')](function(_0x1a0262){if(_0x1a0262){_0x5594ba=_0x1a0262[_0xf656('0x4d')];if(!_0x34eaa3['query'][_0xf656('0x55')](_0xf656('0x3f'))){_0x356469[_0xf656('0x2c')]=qs['limit'](_0x34eaa3[_0xf656('0x3a')][_0xf656('0x2c')]);_0x356469[_0xf656('0x2b')]=qs['offset'](_0x34eaa3[_0xf656('0x3a')][_0xf656('0x2b')]);}return _0x24e2a0[_0xf656('0x58')](_0x356469);}})[_0xf656('0x1c')](function(_0x573bdf){if(_0x573bdf){return _0x573bdf?{'count':_0x5594ba,'rows':_0x573bdf}:null;}})['then'](respondWithResult(_0x3b3e48,null))[_0xf656('0x25')](handleError(_0x3b3e48,null));}; \ No newline at end of file +var _0xc297=['moment','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','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','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','set','Content-Range','save','update','destroy','stack','name','send','index','ZohoConfiguration','rawAttributes','keys','query','intersection','model','attributes','nolimit','limit','order','sort','where','pick','filters','filter','map','type','key','field','merge','options','count','includeAll','include','findAll','rows','show','fields','length','find','catch','create','body','params','getFields','hasOwnProperty','getSubjects','findOne','ZohoField','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0xc297,0x1b9));var _0x7c29=function(_0x46b22a,_0x5bf83a){_0x46b22a=_0x46b22a-0x0;var _0x44c2e8=_0xc297[_0x46b22a];return _0x44c2e8;};'use strict';var pdf=require(_0x7c29('0x0'));var emlformat=require(_0x7c29('0x1'));var rimraf=require(_0x7c29('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7c29('0x3'));var rp=require('request-promise');var moment=require(_0x7c29('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7c29('0x5'));var sox=require(_0x7c29('0x6'));var csv=require(_0x7c29('0x7'));var ejs=require(_0x7c29('0x8'));var fs=require('fs');var _=require(_0x7c29('0x9'));var squel=require(_0x7c29('0xa'));var crypto=require(_0x7c29('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7c29('0x7'));var querystring=require('querystring');var Papa=require(_0x7c29('0xc'));var Redis=require('ioredis');var authService=require(_0x7c29('0xd'));var qs=require(_0x7c29('0xe'));var hardwareService=require(_0x7c29('0xf'));var logger=require(_0x7c29('0x10'))('api');var utils=require(_0x7c29('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x7c29('0x12'));var client=jayson[_0x7c29('0x13')][_0x7c29('0x14')]({'port':0x232a});function checkPasswordPattern(_0x5a0bd4,_0x1974d8,_0x2d9811){if(_0x2d9811){var _0x2a3b54=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2a3b54[_0x7c29('0x15')](_0x1974d8)){return _0x5a0bd4;}else{throw new Error(_0x7c29('0x16'));}}else{return _0x5a0bd4;}}function respondWithRpcPromise(_0x40ec8a,_0x51a6a7,_0x56953b,_0x180fe9){return new BPromise(function(_0x4d1c46,_0x4aca23){var _0x114ad4=_0x180fe9||client;return _0x114ad4[_0x7c29('0x17')](_0x40ec8a,_0x56953b)[_0x7c29('0x18')](function(_0x3bb8ae){logger[_0x7c29('0x19')](_0x7c29('0x1a'),_0x51a6a7,_0x7c29('0x1b'));logger[_0x7c29('0x1c')](_0x7c29('0x1d'),_0x51a6a7,_0x7c29('0x1b'),JSON[_0x7c29('0x1e')](_0x3bb8ae));if(_0x3bb8ae[_0x7c29('0x1f')]){if(_0x3bb8ae[_0x7c29('0x1f')][_0x7c29('0x20')]===0x1f4){logger[_0x7c29('0x1f')]('ZohoConfiguration,\x20%s,\x20%s',_0x51a6a7,_0x3bb8ae[_0x7c29('0x1f')][_0x7c29('0x21')]);return _0x4aca23(_0x3bb8ae[_0x7c29('0x1f')][_0x7c29('0x21')]);}logger['error'](_0x7c29('0x1a'),_0x51a6a7,_0x3bb8ae[_0x7c29('0x1f')][_0x7c29('0x21')]);return _0x4d1c46(_0x3bb8ae[_0x7c29('0x1f')][_0x7c29('0x21')]);}else{logger[_0x7c29('0x19')](_0x7c29('0x1a'),_0x51a6a7,_0x7c29('0x1b'));_0x4d1c46(_0x3bb8ae[_0x7c29('0x22')]['message']);}})['catch'](function(_0x3cdf03){logger[_0x7c29('0x1f')](_0x7c29('0x1a'),_0x51a6a7,_0x3cdf03);_0x4aca23(_0x3cdf03);});});}function respondWithStatusCode(_0x235dfd,_0x545116){_0x545116=_0x545116||0xcc;return function(_0x62b1ca){if(_0x62b1ca){return _0x235dfd[_0x7c29('0x23')](_0x545116);}return _0x235dfd[_0x7c29('0x24')](_0x545116)[_0x7c29('0x25')]();};}function respondWithResult(_0x55007e,_0x491eff){_0x491eff=_0x491eff||0xc8;return function(_0x2d3d45){if(_0x2d3d45){return _0x55007e['status'](_0x491eff)[_0x7c29('0x26')](_0x2d3d45);}};}function respondWithFilteredResult(_0xe0d991,_0x42462a){return function(_0x437602){if(_0x437602){var _0x24effb=_0x437602['count'],_0x26de57=_0x42462a['offset'],_0xac3ccb=_0x42462a[_0x7c29('0x27')]+_0x42462a['limit'],_0x5d0d4c;if(_0xac3ccb>=_0x24effb){_0xac3ccb=_0x24effb;_0x5d0d4c=0xc8;}else{_0x5d0d4c=0xce;}_0xe0d991[_0x7c29('0x24')](_0x5d0d4c);return _0xe0d991[_0x7c29('0x28')](_0x7c29('0x29'),_0x26de57+'-'+_0xac3ccb+'/'+_0x24effb)[_0x7c29('0x26')](_0x437602);}return null;};}function patchUpdates(_0x407b37){return function(_0x1aa17e){try{jsonpatch['apply'](_0x1aa17e,_0x407b37,!![]);}catch(_0x85a758){return BPromise['reject'](_0x85a758);}return _0x1aa17e[_0x7c29('0x2a')]();};}function saveUpdates(_0x293cc0,_0x88cb05){return function(_0x3544c6){if(_0x3544c6){return _0x3544c6[_0x7c29('0x2b')](_0x293cc0)[_0x7c29('0x18')](function(_0x351785){return _0x351785;});}return null;};}function removeEntity(_0x5b1dc1,_0x489c4c){return function(_0x20bc5a){if(_0x20bc5a){return _0x20bc5a[_0x7c29('0x2c')]()['then'](function(){_0x5b1dc1[_0x7c29('0x24')](0xcc)[_0x7c29('0x25')]();});}};}function handleEntityNotFound(_0x3d9390,_0x3850d2){return function(_0x455ebe){if(!_0x455ebe){_0x3d9390[_0x7c29('0x23')](0x194);}return _0x455ebe;};}function handleError(_0x540aa9,_0x56a914){_0x56a914=_0x56a914||0x1f4;return function(_0x5638c8){logger[_0x7c29('0x1f')](_0x5638c8[_0x7c29('0x2d')]);if(_0x5638c8[_0x7c29('0x2e')]){delete _0x5638c8[_0x7c29('0x2e')];}_0x540aa9[_0x7c29('0x24')](_0x56a914)[_0x7c29('0x2f')](_0x5638c8);};}exports[_0x7c29('0x30')]=function(_0xf8384a,_0x44a372){var _0x105669={},_0x4eb531={},_0xb63233={'count':0x0,'rows':[]};var _0x2dab49=db[_0x7c29('0x31')][_0x7c29('0x32')];_0x4eb531['model']=_[_0x7c29('0x33')](_0x2dab49);_0x4eb531[_0x7c29('0x34')]=_[_0x7c29('0x33')](_0xf8384a[_0x7c29('0x34')]);_0x4eb531['filters']=_[_0x7c29('0x35')](_0x4eb531[_0x7c29('0x36')],_0x4eb531['query']);_0x105669[_0x7c29('0x37')]=_[_0x7c29('0x35')](_0x4eb531[_0x7c29('0x36')],qs['fields'](_0xf8384a[_0x7c29('0x34')]['fields']));_0x105669[_0x7c29('0x37')]=_0x105669[_0x7c29('0x37')]['length']?_0x105669['attributes']:_0x4eb531[_0x7c29('0x36')];if(!_0xf8384a[_0x7c29('0x34')]['hasOwnProperty'](_0x7c29('0x38'))){_0x105669['limit']=qs[_0x7c29('0x39')](_0xf8384a[_0x7c29('0x34')][_0x7c29('0x39')]);_0x105669[_0x7c29('0x27')]=qs[_0x7c29('0x27')](_0xf8384a[_0x7c29('0x34')][_0x7c29('0x27')]);}_0x105669[_0x7c29('0x3a')]=qs[_0x7c29('0x3b')](_0xf8384a[_0x7c29('0x34')]['sort']);_0x105669[_0x7c29('0x3c')]=qs['filters'](_[_0x7c29('0x3d')](_0xf8384a[_0x7c29('0x34')],_0x4eb531[_0x7c29('0x3e')]));if(_0xf8384a[_0x7c29('0x34')][_0x7c29('0x3f')]){_0x105669[_0x7c29('0x3c')]=_['merge'](_0x105669['where'],{'$or':_[_0x7c29('0x40')](_0x2dab49,function(_0x74f243){if(_0x74f243[_0x7c29('0x41')][_0x7c29('0x42')]!=='VIRTUAL'){var _0x3413ee={};_0x3413ee[_0x74f243[_0x7c29('0x43')]]={'$like':'%'+_0xf8384a[_0x7c29('0x34')]['filter']+'%'};return _0x3413ee;}})});}_0x105669=_[_0x7c29('0x44')]({},_0x105669,_0xf8384a[_0x7c29('0x45')]);var _0x1a4f1b={'where':_0x105669[_0x7c29('0x3c')]};return db[_0x7c29('0x31')][_0x7c29('0x46')](_0x1a4f1b)[_0x7c29('0x18')](function(_0x33ac87){_0xb63233[_0x7c29('0x46')]=_0x33ac87;if(_0xf8384a[_0x7c29('0x34')][_0x7c29('0x47')]){_0x105669[_0x7c29('0x48')]=[{'all':!![]}];}return db[_0x7c29('0x31')][_0x7c29('0x49')](_0x105669);})[_0x7c29('0x18')](function(_0x353eef){_0xb63233[_0x7c29('0x4a')]=_0x353eef;return _0xb63233;})[_0x7c29('0x18')](respondWithFilteredResult(_0x44a372,_0x105669))['catch'](handleError(_0x44a372,null));};exports[_0x7c29('0x4b')]=function(_0xfee127,_0x13bee4){var _0x11f8c0={'raw':![],'where':{'id':_0xfee127['params']['id']}},_0x17e00a={};_0x17e00a[_0x7c29('0x36')]=_[_0x7c29('0x33')](db['ZohoConfiguration'][_0x7c29('0x32')]);_0x17e00a['query']=_[_0x7c29('0x33')](_0xfee127['query']);_0x17e00a[_0x7c29('0x3e')]=_[_0x7c29('0x35')](_0x17e00a[_0x7c29('0x36')],_0x17e00a[_0x7c29('0x34')]);_0x11f8c0[_0x7c29('0x37')]=_['intersection'](_0x17e00a[_0x7c29('0x36')],qs[_0x7c29('0x4c')](_0xfee127[_0x7c29('0x34')][_0x7c29('0x4c')]));_0x11f8c0[_0x7c29('0x37')]=_0x11f8c0[_0x7c29('0x37')][_0x7c29('0x4d')]?_0x11f8c0[_0x7c29('0x37')]:_0x17e00a[_0x7c29('0x36')];if(_0xfee127[_0x7c29('0x34')]['includeAll']){_0x11f8c0[_0x7c29('0x48')]=[{'all':!![]}];}_0x11f8c0=_['merge']({},_0x11f8c0,_0xfee127[_0x7c29('0x45')]);return db[_0x7c29('0x31')][_0x7c29('0x4e')](_0x11f8c0)['then'](handleEntityNotFound(_0x13bee4,null))[_0x7c29('0x18')](respondWithResult(_0x13bee4,null))[_0x7c29('0x4f')](handleError(_0x13bee4,null));};exports['create']=function(_0x4d96f0,_0x4a1f7a){return db[_0x7c29('0x31')][_0x7c29('0x50')](_0x4d96f0[_0x7c29('0x51')],{})[_0x7c29('0x18')](respondWithResult(_0x4a1f7a,0xc9))['catch'](handleError(_0x4a1f7a,null));};exports[_0x7c29('0x2b')]=function(_0x495100,_0x154b87){if(_0x495100['body']['id']){delete _0x495100[_0x7c29('0x51')]['id'];}return db[_0x7c29('0x31')][_0x7c29('0x4e')]({'where':{'id':_0x495100[_0x7c29('0x52')]['id']}})[_0x7c29('0x18')](handleEntityNotFound(_0x154b87,null))[_0x7c29('0x18')](saveUpdates(_0x495100[_0x7c29('0x51')],null))[_0x7c29('0x18')](respondWithResult(_0x154b87,null))[_0x7c29('0x4f')](handleError(_0x154b87,null));};exports[_0x7c29('0x2c')]=function(_0x10fe4f,_0x2c425f){return db['ZohoConfiguration'][_0x7c29('0x4e')]({'where':{'id':_0x10fe4f[_0x7c29('0x52')]['id']}})[_0x7c29('0x18')](handleEntityNotFound(_0x2c425f,null))[_0x7c29('0x18')](removeEntity(_0x2c425f,null))['catch'](handleError(_0x2c425f,null));};exports[_0x7c29('0x53')]=function(_0x49b4a8,_0x335534,_0x44bb74){var _0x4ffe9c={};var _0x5e0b5e={};var _0x38d80c;var _0x38a81d;return db[_0x7c29('0x31')]['findOne']({'where':{'id':_0x49b4a8[_0x7c29('0x52')]['id']}})[_0x7c29('0x18')](handleEntityNotFound(_0x335534,null))[_0x7c29('0x18')](function(_0x9cb5ab){if(_0x9cb5ab){_0x38d80c=_0x9cb5ab;_0x5e0b5e[_0x7c29('0x36')]=_['keys'](db['ZohoField']['rawAttributes']);_0x5e0b5e[_0x7c29('0x34')]=_['keys'](_0x49b4a8['query']);_0x5e0b5e[_0x7c29('0x3e')]=_[_0x7c29('0x35')](_0x5e0b5e['model'],_0x5e0b5e[_0x7c29('0x34')]);_0x4ffe9c['attributes']=_[_0x7c29('0x35')](_0x5e0b5e[_0x7c29('0x36')],qs[_0x7c29('0x4c')](_0x49b4a8['query'][_0x7c29('0x4c')]));_0x4ffe9c['attributes']=_0x4ffe9c['attributes']['length']?_0x4ffe9c[_0x7c29('0x37')]:_0x5e0b5e[_0x7c29('0x36')];_0x4ffe9c[_0x7c29('0x3a')]=qs[_0x7c29('0x3b')](_0x49b4a8[_0x7c29('0x34')][_0x7c29('0x3b')]);_0x4ffe9c['where']=qs['filters'](_[_0x7c29('0x3d')](_0x49b4a8[_0x7c29('0x34')],_0x5e0b5e[_0x7c29('0x3e')]));if(_0x49b4a8[_0x7c29('0x34')]['filter']){_0x4ffe9c[_0x7c29('0x3c')]=_[_0x7c29('0x44')](_0x4ffe9c[_0x7c29('0x3c')],{'$or':_[_0x7c29('0x40')](_0x4ffe9c[_0x7c29('0x37')],function(_0x562747){var _0x2e13e1={};_0x2e13e1[_0x562747]={'$like':'%'+_0x49b4a8[_0x7c29('0x34')][_0x7c29('0x3f')]+'%'};return _0x2e13e1;})});}_0x4ffe9c=_[_0x7c29('0x44')]({},_0x4ffe9c,_0x49b4a8[_0x7c29('0x45')]);return _0x38d80c['getFields'](_0x4ffe9c);}})['then'](function(_0x373c7c){if(_0x373c7c){_0x38a81d=_0x373c7c[_0x7c29('0x4d')];if(!_0x49b4a8[_0x7c29('0x34')][_0x7c29('0x54')](_0x7c29('0x38'))){_0x4ffe9c[_0x7c29('0x39')]=qs[_0x7c29('0x39')](_0x49b4a8[_0x7c29('0x34')][_0x7c29('0x39')]);_0x4ffe9c['offset']=qs[_0x7c29('0x27')](_0x49b4a8[_0x7c29('0x34')][_0x7c29('0x27')]);}return _0x38d80c['getFields'](_0x4ffe9c);}})['then'](function(_0x2e7236){if(_0x2e7236){return _0x2e7236?{'count':_0x38a81d,'rows':_0x2e7236}:null;}})[_0x7c29('0x18')](respondWithResult(_0x335534,null))['catch'](handleError(_0x335534,null));};exports[_0x7c29('0x55')]=function(_0x101989,_0x4aa738,_0x2f40b0){var _0x167f50={};var _0x17cb3a={};var _0x2964c5;var _0x298007;return db[_0x7c29('0x31')][_0x7c29('0x56')]({'where':{'id':_0x101989[_0x7c29('0x52')]['id']}})[_0x7c29('0x18')](handleEntityNotFound(_0x4aa738,null))['then'](function(_0x3b65b4){if(_0x3b65b4){_0x2964c5=_0x3b65b4;_0x17cb3a[_0x7c29('0x36')]=_[_0x7c29('0x33')](db['ZohoField']['rawAttributes']);_0x17cb3a[_0x7c29('0x34')]=_[_0x7c29('0x33')](_0x101989[_0x7c29('0x34')]);_0x17cb3a['filters']=_['intersection'](_0x17cb3a[_0x7c29('0x36')],_0x17cb3a['query']);_0x167f50['attributes']=_[_0x7c29('0x35')](_0x17cb3a[_0x7c29('0x36')],qs[_0x7c29('0x4c')](_0x101989[_0x7c29('0x34')][_0x7c29('0x4c')]));_0x167f50[_0x7c29('0x37')]=_0x167f50[_0x7c29('0x37')][_0x7c29('0x4d')]?_0x167f50[_0x7c29('0x37')]:_0x17cb3a['model'];_0x167f50[_0x7c29('0x3a')]=qs[_0x7c29('0x3b')](_0x101989['query'][_0x7c29('0x3b')]);_0x167f50[_0x7c29('0x3c')]=qs[_0x7c29('0x3e')](_[_0x7c29('0x3d')](_0x101989['query'],_0x17cb3a[_0x7c29('0x3e')]));if(_0x101989[_0x7c29('0x34')][_0x7c29('0x3f')]){_0x167f50[_0x7c29('0x3c')]=_[_0x7c29('0x44')](_0x167f50[_0x7c29('0x3c')],{'$or':_[_0x7c29('0x40')](_0x167f50[_0x7c29('0x37')],function(_0x276847){var _0x4ad012={};_0x4ad012[_0x276847]={'$like':'%'+_0x101989[_0x7c29('0x34')]['filter']+'%'};return _0x4ad012;})});}_0x167f50=_[_0x7c29('0x44')]({},_0x167f50,_0x101989[_0x7c29('0x45')]);return _0x2964c5[_0x7c29('0x55')](_0x167f50);}})['then'](function(_0x4a694c){if(_0x4a694c){_0x298007=_0x4a694c[_0x7c29('0x4d')];if(!_0x101989['query']['hasOwnProperty'](_0x7c29('0x38'))){_0x167f50[_0x7c29('0x39')]=qs[_0x7c29('0x39')](_0x101989[_0x7c29('0x34')]['limit']);_0x167f50['offset']=qs['offset'](_0x101989['query']['offset']);}return _0x2964c5['getSubjects'](_0x167f50);}})[_0x7c29('0x18')](function(_0x3d0cdd){if(_0x3d0cdd){return _0x3d0cdd?{'count':_0x298007,'rows':_0x3d0cdd}:null;}})[_0x7c29('0x18')](respondWithResult(_0x4aa738,null))[_0x7c29('0x4f')](handleError(_0x4aa738,null));};exports['getDescriptions']=function(_0x193998,_0xc3c705,_0x3330f1){var _0x1fc129={};var _0x107396={};var _0x8c69cf;var _0xa221c4;return db['ZohoConfiguration'][_0x7c29('0x56')]({'where':{'id':_0x193998[_0x7c29('0x52')]['id']}})[_0x7c29('0x18')](handleEntityNotFound(_0xc3c705,null))['then'](function(_0xeb65d2){if(_0xeb65d2){_0x8c69cf=_0xeb65d2;_0x107396[_0x7c29('0x36')]=_[_0x7c29('0x33')](db[_0x7c29('0x57')]['rawAttributes']);_0x107396[_0x7c29('0x34')]=_[_0x7c29('0x33')](_0x193998[_0x7c29('0x34')]);_0x107396['filters']=_[_0x7c29('0x35')](_0x107396[_0x7c29('0x36')],_0x107396[_0x7c29('0x34')]);_0x1fc129[_0x7c29('0x37')]=_[_0x7c29('0x35')](_0x107396[_0x7c29('0x36')],qs[_0x7c29('0x4c')](_0x193998[_0x7c29('0x34')]['fields']));_0x1fc129['attributes']=_0x1fc129[_0x7c29('0x37')][_0x7c29('0x4d')]?_0x1fc129['attributes']:_0x107396[_0x7c29('0x36')];_0x1fc129[_0x7c29('0x3a')]=qs[_0x7c29('0x3b')](_0x193998['query'][_0x7c29('0x3b')]);_0x1fc129[_0x7c29('0x3c')]=qs[_0x7c29('0x3e')](_[_0x7c29('0x3d')](_0x193998[_0x7c29('0x34')],_0x107396[_0x7c29('0x3e')]));if(_0x193998[_0x7c29('0x34')]['filter']){_0x1fc129['where']=_[_0x7c29('0x44')](_0x1fc129[_0x7c29('0x3c')],{'$or':_[_0x7c29('0x40')](_0x1fc129[_0x7c29('0x37')],function(_0x48a8df){var _0xabab54={};_0xabab54[_0x48a8df]={'$like':'%'+_0x193998[_0x7c29('0x34')]['filter']+'%'};return _0xabab54;})});}_0x1fc129=_[_0x7c29('0x44')]({},_0x1fc129,_0x193998[_0x7c29('0x45')]);return _0x8c69cf[_0x7c29('0x58')](_0x1fc129);}})['then'](function(_0x3b9e94){if(_0x3b9e94){_0xa221c4=_0x3b9e94[_0x7c29('0x4d')];if(!_0x193998[_0x7c29('0x34')]['hasOwnProperty'](_0x7c29('0x38'))){_0x1fc129[_0x7c29('0x39')]=qs['limit'](_0x193998[_0x7c29('0x34')][_0x7c29('0x39')]);_0x1fc129[_0x7c29('0x27')]=qs[_0x7c29('0x27')](_0x193998[_0x7c29('0x34')][_0x7c29('0x27')]);}return _0x8c69cf[_0x7c29('0x58')](_0x1fc129);}})[_0x7c29('0x18')](function(_0x37c959){if(_0x37c959){return _0x37c959?{'count':_0xa221c4,'rows':_0x37c959}:null;}})['then'](respondWithResult(_0xc3c705,null))[_0x7c29('0x4f')](handleError(_0xc3c705,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index fe88595..d1f363c 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 _0x6463=['int_zoho_configurations','lodash','util','../../config/logger','bluebird','request-promise','./intZohoConfiguration.attributes','ZohoConfiguration'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x6463,0x101));var _0x3646=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6463[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3646('0x0'));var util=require(_0x3646('0x1'));var logger=require(_0x3646('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3646('0x3'));var rp=require(_0x3646('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3646('0x5'));module['exports']=function(_0x2b3602,_0x515995){return _0x2b3602['define'](_0x3646('0x6'),attributes,{'tableName':_0x3646('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x207c=['path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x3d478a,_0x5310d1){var _0x1d94c6=function(_0xc7ccd2){while(--_0xc7ccd2){_0x3d478a['push'](_0x3d478a['shift']());}};_0x1d94c6(++_0x5310d1);}(_0x207c,0x181));var _0xc207=function(_0x5218c0,_0x2591df){_0x5218c0=_0x5218c0-0x0;var _0xc5dba=_0x207c[_0x5218c0];return _0xc5dba;};'use strict';var _=require(_0xc207('0x0'));var util=require(_0xc207('0x1'));var logger=require(_0xc207('0x2'))(_0xc207('0x3'));var moment=require(_0xc207('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc207('0x5'));var rimraf=require(_0xc207('0x6'));var config=require(_0xc207('0x7'));var attributes=require(_0xc207('0x8'));module[_0xc207('0x9')]=function(_0x511054,_0x39b871){return _0x511054[_0xc207('0xa')](_0xc207('0xb'),attributes,{'tableName':_0xc207('0xc'),'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 bfe3236..fa16e97 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 _0x00b2=['ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x215d80,_0x1dd660){var _0xdec77a=function(_0x3b6f53){while(--_0x3b6f53){_0x215d80['push'](_0x215d80['shift']());}};_0xdec77a(++_0x1dd660);}(_0x00b2,0x137));var _0x200b=function(_0x2c3b4f,_0xaa6be3){_0x2c3b4f=_0x2c3b4f-0x0;var _0x408a81=_0x00b2[_0x2c3b4f];return _0x408a81;};'use strict';var _=require('lodash');var util=require(_0x200b('0x0'));var moment=require(_0x200b('0x1'));var BPromise=require(_0x200b('0x2'));var rs=require(_0x200b('0x3'));var fs=require('fs');var Redis=require(_0x200b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x200b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x200b('0x6'));var jayson=require(_0x200b('0x7'));var client=jayson['client'][_0x200b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a2f79,_0x383009,_0x22323f){return new BPromise(function(_0x407259,_0x51ca0f){return client[_0x200b('0x9')](_0x2a2f79,_0x22323f)[_0x200b('0xa')](function(_0x14874d){logger[_0x200b('0xb')](_0x200b('0xc'),_0x383009,_0x200b('0xd'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x383009,_0x200b('0xd'),JSON[_0x200b('0xe')](_0x14874d));if(_0x14874d[_0x200b('0xf')]){if(_0x14874d[_0x200b('0xf')][_0x200b('0x10')]===0x1f4){logger[_0x200b('0xf')](_0x200b('0xc'),_0x383009,_0x14874d[_0x200b('0xf')][_0x200b('0x11')]);return _0x51ca0f(_0x14874d[_0x200b('0xf')][_0x200b('0x11')]);}logger[_0x200b('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x383009,_0x14874d['error'][_0x200b('0x11')]);return _0x407259(_0x14874d[_0x200b('0xf')][_0x200b('0x11')]);}else{logger[_0x200b('0xb')](_0x200b('0xc'),_0x383009,_0x200b('0xd'));_0x407259(_0x14874d['result'][_0x200b('0x11')]);}})[_0x200b('0x12')](function(_0x3d4057){logger[_0x200b('0xf')](_0x200b('0xc'),_0x383009,_0x3d4057);_0x51ca0f(_0x3d4057);});});} \ No newline at end of file +var _0x6cf5=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x88286,_0x3d0a16){var _0x1ffe64=function(_0x5ea022){while(--_0x5ea022){_0x88286['push'](_0x88286['shift']());}};_0x1ffe64(++_0x3d0a16);}(_0x6cf5,0x1a2));var _0x56cf=function(_0x1602f4,_0x108186){_0x1602f4=_0x1602f4-0x0;var _0x382312=_0x6cf5[_0x1602f4];return _0x382312;};'use strict';var _=require(_0x56cf('0x0'));var util=require(_0x56cf('0x1'));var moment=require('moment');var BPromise=require(_0x56cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56cf('0x3'));var db=require(_0x56cf('0x4'))['db'];var utils=require(_0x56cf('0x5'));var logger=require(_0x56cf('0x6'))(_0x56cf('0x7'));var config=require(_0x56cf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x56cf('0x9')][_0x56cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x201d29,_0x3d7891,_0x3bb65a){return new BPromise(function(_0x1461d0,_0x13fafc){return client[_0x56cf('0xb')](_0x201d29,_0x3bb65a)[_0x56cf('0xc')](function(_0x574384){logger[_0x56cf('0xd')](_0x56cf('0xe'),_0x3d7891,_0x56cf('0xf'));logger['debug'](_0x56cf('0x10'),_0x3d7891,_0x56cf('0xf'),JSON[_0x56cf('0x11')](_0x574384));if(_0x574384[_0x56cf('0x12')]){if(_0x574384[_0x56cf('0x12')][_0x56cf('0x13')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x3d7891,_0x574384[_0x56cf('0x12')][_0x56cf('0x14')]);return _0x13fafc(_0x574384['error']['message']);}logger['error'](_0x56cf('0xe'),_0x3d7891,_0x574384[_0x56cf('0x12')][_0x56cf('0x14')]);return _0x1461d0(_0x574384[_0x56cf('0x12')]['message']);}else{logger[_0x56cf('0xd')](_0x56cf('0xe'),_0x3d7891,_0x56cf('0xf'));_0x1461d0(_0x574384['result']['message']);}})[_0x56cf('0x15')](function(_0x3a7c7a){logger[_0x56cf('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x3d7891,_0x3a7c7a);_0x13fafc(_0x3a7c7a);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 1274816..09c24c4 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 _0xd117=['get','isAuthenticated','index','/:id','post','create','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller'];(function(_0x3ee636,_0x2d2fb7){var _0x232f38=function(_0x4fe630){while(--_0x4fe630){_0x3ee636['push'](_0x3ee636['shift']());}};_0x232f38(++_0x2d2fb7);}(_0xd117,0x182));var _0x7d11=function(_0x5dc45d,_0x55f90f){_0x5dc45d=_0x5dc45d-0x0;var _0x4ce697=_0xd117[_0x5dc45d];return _0x4ce697;};'use strict';var multer=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var path=require(_0x7d11('0x2'));var timeout=require(_0x7d11('0x3'));var express=require(_0x7d11('0x4'));var router=express[_0x7d11('0x5')]();var auth=require(_0x7d11('0x6'));var interaction=require(_0x7d11('0x7'));var config=require(_0x7d11('0x8'));var controller=require(_0x7d11('0x9'));router[_0x7d11('0xa')]('/',auth[_0x7d11('0xb')](),controller[_0x7d11('0xc')]);router[_0x7d11('0xa')](_0x7d11('0xd'),auth[_0x7d11('0xb')](),controller['show']);router[_0x7d11('0xe')]('/',auth[_0x7d11('0xb')](),controller[_0x7d11('0xf')]);router['put'](_0x7d11('0xd'),auth[_0x7d11('0xb')](),controller[_0x7d11('0x10')]);router['delete'](_0x7d11('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x7d11('0x11')]=router; \ No newline at end of file +var _0x14a0=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','put','/:id','destroy','exports','util','path'];(function(_0x12d93a,_0x460b08){var _0x5e0913=function(_0x353783){while(--_0x353783){_0x12d93a['push'](_0x12d93a['shift']());}};_0x5e0913(++_0x460b08);}(_0x14a0,0x8e));var _0x014a=function(_0x35acc0,_0x1a93a0){_0x35acc0=_0x35acc0-0x0;var _0x1b8474=_0x14a0[_0x35acc0];return _0x1b8474;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var auth=require(_0x014a('0x5'));var interaction=require(_0x014a('0x6'));var config=require('../../config/environment');var controller=require('./intZohoField.controller');router[_0x014a('0x7')]('/',auth[_0x014a('0x8')](),controller[_0x014a('0x9')]);router['get']('/:id',auth[_0x014a('0x8')](),controller[_0x014a('0xa')]);router[_0x014a('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x014a('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x014a('0xd'),auth['isAuthenticated'](),controller[_0x014a('0xe')]);module[_0x014a('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 2451d9d..59b7dfb 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 _0x46b3=['variable','keyValue','STRING','customVariable','sequelize','exports','ENUM','string'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x46b3,0x194));var _0x346b=function(_0x5d1e50,_0x365ece){_0x5d1e50=_0x5d1e50-0x0;var _0x428240=_0x46b3[_0x5d1e50];return _0x428240;};'use strict';var Sequelize=require(_0x346b('0x0'));module[_0x346b('0x1')]={'type':{'type':Sequelize[_0x346b('0x2')](_0x346b('0x3'),_0x346b('0x4'),'customVariable',_0x346b('0x5')),'defaultValue':_0x346b('0x3')},'content':{'type':Sequelize[_0x346b('0x6')]},'key':{'type':Sequelize[_0x346b('0x6')]},'keyType':{'type':Sequelize[_0x346b('0x2')]('string',_0x346b('0x4'),_0x346b('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x346b('0x6')]},'nameField':{'type':Sequelize[_0x346b('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x346b('0x6')]}}; \ No newline at end of file +var _0x67cb=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x141f27,_0xc2dee6){var _0x339017=function(_0x13ca6e){while(--_0x13ca6e){_0x141f27['push'](_0x141f27['shift']());}};_0x339017(++_0xc2dee6);}(_0x67cb,0x19e));var _0xb67c=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x67cb[_0x4eafed];return _0x159c85;};'use strict';var Sequelize=require(_0xb67c('0x0'));module['exports']={'type':{'type':Sequelize[_0xb67c('0x1')](_0xb67c('0x2'),_0xb67c('0x3'),_0xb67c('0x4'),_0xb67c('0x5')),'defaultValue':_0xb67c('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb67c('0x1')](_0xb67c('0x2'),_0xb67c('0x3'),_0xb67c('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb67c('0x6')]},'nameField':{'type':Sequelize[_0xb67c('0x6')]},'customField':{'type':Sequelize[_0xb67c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb67c('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 3e29a1e..75a429d 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 _0xec70=['type','options','include','findAll','rows','catch','show','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','ZohoField','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x3b677a,_0x274ecc){var _0x2e2eb6=function(_0x79d253){while(--_0x79d253){_0x3b677a['push'](_0x3b677a['shift']());}};_0x2e2eb6(++_0x274ecc);}(_0xec70,0x16e));var _0x0ec7=function(_0x483cc3,_0xa49180){_0x483cc3=_0x483cc3-0x0;var _0x40901d=_0xec70[_0x483cc3];return _0x40901d;};'use strict';var pdf=require(_0x0ec7('0x0'));var emlformat=require(_0x0ec7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0ec7('0x2'));var jsonpatch=require(_0x0ec7('0x3'));var rp=require(_0x0ec7('0x4'));var moment=require(_0x0ec7('0x5'));var BPromise=require(_0x0ec7('0x6'));var Mustache=require(_0x0ec7('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0ec7('0x8'));var csv=require(_0x0ec7('0x9'));var ejs=require(_0x0ec7('0xa'));var fs=require('fs');var _=require(_0x0ec7('0xb'));var squel=require('squel');var crypto=require(_0x0ec7('0xc'));var jsforce=require(_0x0ec7('0xd'));var deskjs=require(_0x0ec7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0ec7('0xf'));var Papa=require(_0x0ec7('0x10'));var Redis=require(_0x0ec7('0x11'));var authService=require(_0x0ec7('0x12'));var qs=require(_0x0ec7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ec7('0x14'))(_0x0ec7('0x15'));var utils=require('../../config/utils');var config=require(_0x0ec7('0x16'));var db=require(_0x0ec7('0x17'))['db'];function respondWithStatusCode(_0xf87c28,_0x1968f5){_0x1968f5=_0x1968f5||0xcc;return function(_0x17d185){if(_0x17d185){return _0xf87c28[_0x0ec7('0x18')](_0x1968f5);}return _0xf87c28[_0x0ec7('0x19')](_0x1968f5)[_0x0ec7('0x1a')]();};}function respondWithResult(_0x46a73f,_0x56c57f){_0x56c57f=_0x56c57f||0xc8;return function(_0xcd3ebf){if(_0xcd3ebf){return _0x46a73f[_0x0ec7('0x19')](_0x56c57f)[_0x0ec7('0x1b')](_0xcd3ebf);}};}function respondWithFilteredResult(_0x168bfb,_0x2aff2d){return function(_0x5c92cf){if(_0x5c92cf){var _0x1c4dbf=_0x5c92cf[_0x0ec7('0x1c')],_0x38f2cf=_0x2aff2d[_0x0ec7('0x1d')],_0x40de19=_0x2aff2d[_0x0ec7('0x1d')]+_0x2aff2d[_0x0ec7('0x1e')],_0x1c8526;if(_0x40de19>=_0x1c4dbf){_0x40de19=_0x1c4dbf;_0x1c8526=0xc8;}else{_0x1c8526=0xce;}_0x168bfb[_0x0ec7('0x19')](_0x1c8526);return _0x168bfb[_0x0ec7('0x1f')](_0x0ec7('0x20'),_0x38f2cf+'-'+_0x40de19+'/'+_0x1c4dbf)[_0x0ec7('0x1b')](_0x5c92cf);}return null;};}function patchUpdates(_0x24d954){return function(_0x2364aa){try{jsonpatch[_0x0ec7('0x21')](_0x2364aa,_0x24d954,!![]);}catch(_0x1dafa0){return BPromise[_0x0ec7('0x22')](_0x1dafa0);}return _0x2364aa[_0x0ec7('0x23')]();};}function saveUpdates(_0x3921b5,_0x43c34d){return function(_0x596d77){if(_0x596d77){return _0x596d77[_0x0ec7('0x24')](_0x3921b5)[_0x0ec7('0x25')](function(_0x475106){return _0x475106;});}return null;};}function removeEntity(_0x394d0b,_0x5cbffd){return function(_0x1851d6){if(_0x1851d6){return _0x1851d6[_0x0ec7('0x26')]()[_0x0ec7('0x25')](function(){_0x394d0b[_0x0ec7('0x19')](0xcc)[_0x0ec7('0x1a')]();});}};}function handleEntityNotFound(_0x511638,_0x48e712){return function(_0x27db15){if(!_0x27db15){_0x511638[_0x0ec7('0x18')](0x194);}return _0x27db15;};}function handleError(_0x194ef3,_0x1a4d5a){_0x1a4d5a=_0x1a4d5a||0x1f4;return function(_0x3a6c49){logger[_0x0ec7('0x27')](_0x3a6c49[_0x0ec7('0x28')]);if(_0x3a6c49[_0x0ec7('0x29')]){delete _0x3a6c49[_0x0ec7('0x29')];}_0x194ef3[_0x0ec7('0x19')](_0x1a4d5a)['send'](_0x3a6c49);};}exports[_0x0ec7('0x2a')]=function(_0x17a05c,_0x5d67d6){var _0x12b977={},_0x466a71={},_0x2460b5={'count':0x0,'rows':[]};var _0x2594ea=db[_0x0ec7('0x2b')][_0x0ec7('0x2c')];_0x466a71[_0x0ec7('0x2d')]=_[_0x0ec7('0x2e')](_0x2594ea);_0x466a71[_0x0ec7('0x2f')]=_[_0x0ec7('0x2e')](_0x17a05c[_0x0ec7('0x2f')]);_0x466a71[_0x0ec7('0x30')]=_[_0x0ec7('0x31')](_0x466a71[_0x0ec7('0x2d')],_0x466a71[_0x0ec7('0x2f')]);_0x12b977['attributes']=_[_0x0ec7('0x31')](_0x466a71[_0x0ec7('0x2d')],qs[_0x0ec7('0x32')](_0x17a05c[_0x0ec7('0x2f')][_0x0ec7('0x32')]));_0x12b977[_0x0ec7('0x33')]=_0x12b977[_0x0ec7('0x33')][_0x0ec7('0x34')]?_0x12b977['attributes']:_0x466a71[_0x0ec7('0x2d')];if(!_0x17a05c[_0x0ec7('0x2f')][_0x0ec7('0x35')](_0x0ec7('0x36'))){_0x12b977[_0x0ec7('0x1e')]=qs[_0x0ec7('0x1e')](_0x17a05c['query'][_0x0ec7('0x1e')]);_0x12b977['offset']=qs[_0x0ec7('0x1d')](_0x17a05c[_0x0ec7('0x2f')][_0x0ec7('0x1d')]);}_0x12b977['order']=qs[_0x0ec7('0x37')](_0x17a05c['query'][_0x0ec7('0x37')]);_0x12b977[_0x0ec7('0x38')]=qs[_0x0ec7('0x30')](_[_0x0ec7('0x39')](_0x17a05c[_0x0ec7('0x2f')],_0x466a71[_0x0ec7('0x30')]));if(_0x17a05c['query'][_0x0ec7('0x3a')]){_0x12b977[_0x0ec7('0x38')]=_[_0x0ec7('0x3b')](_0x12b977[_0x0ec7('0x38')],{'$or':_['map'](_0x2594ea,function(_0x2fc5ef){if(_0x2fc5ef[_0x0ec7('0x3c')]['key']!=='VIRTUAL'){var _0x3efda6={};_0x3efda6[_0x2fc5ef['field']]={'$like':'%'+_0x17a05c[_0x0ec7('0x2f')]['filter']+'%'};return _0x3efda6;}})});}_0x12b977=_[_0x0ec7('0x3b')]({},_0x12b977,_0x17a05c[_0x0ec7('0x3d')]);var _0x3349ec={'where':_0x12b977['where']};return db['ZohoField']['count'](_0x3349ec)['then'](function(_0x584be9){_0x2460b5[_0x0ec7('0x1c')]=_0x584be9;if(_0x17a05c[_0x0ec7('0x2f')]['includeAll']){_0x12b977[_0x0ec7('0x3e')]=[{'all':!![]}];}return db[_0x0ec7('0x2b')][_0x0ec7('0x3f')](_0x12b977);})[_0x0ec7('0x25')](function(_0x8d51e7){_0x2460b5[_0x0ec7('0x40')]=_0x8d51e7;return _0x2460b5;})[_0x0ec7('0x25')](respondWithFilteredResult(_0x5d67d6,_0x12b977))[_0x0ec7('0x41')](handleError(_0x5d67d6,null));};exports[_0x0ec7('0x42')]=function(_0x380e37,_0x490918){var _0x5131bc={'raw':!![],'where':{'id':_0x380e37['params']['id']}},_0x59cf17={};_0x59cf17[_0x0ec7('0x2d')]=_[_0x0ec7('0x2e')](db[_0x0ec7('0x2b')][_0x0ec7('0x2c')]);_0x59cf17['query']=_[_0x0ec7('0x2e')](_0x380e37['query']);_0x59cf17['filters']=_[_0x0ec7('0x31')](_0x59cf17[_0x0ec7('0x2d')],_0x59cf17['query']);_0x5131bc[_0x0ec7('0x33')]=_[_0x0ec7('0x31')](_0x59cf17['model'],qs[_0x0ec7('0x32')](_0x380e37[_0x0ec7('0x2f')][_0x0ec7('0x32')]));_0x5131bc['attributes']=_0x5131bc[_0x0ec7('0x33')]['length']?_0x5131bc[_0x0ec7('0x33')]:_0x59cf17['model'];if(_0x380e37['query']['includeAll']){_0x5131bc['include']=[{'all':!![]}];}_0x5131bc=_[_0x0ec7('0x3b')]({},_0x5131bc,_0x380e37[_0x0ec7('0x3d')]);return db['ZohoField'][_0x0ec7('0x43')](_0x5131bc)[_0x0ec7('0x25')](handleEntityNotFound(_0x490918,null))[_0x0ec7('0x25')](respondWithResult(_0x490918,null))[_0x0ec7('0x41')](handleError(_0x490918,null));};exports[_0x0ec7('0x44')]=function(_0x3eb924,_0x5830f0){return db[_0x0ec7('0x2b')][_0x0ec7('0x44')](_0x3eb924[_0x0ec7('0x45')],{})[_0x0ec7('0x25')](respondWithResult(_0x5830f0,0xc9))[_0x0ec7('0x41')](handleError(_0x5830f0,null));};exports[_0x0ec7('0x24')]=function(_0xce5034,_0x2489ae){if(_0xce5034[_0x0ec7('0x45')]['id']){delete _0xce5034['body']['id'];}return db[_0x0ec7('0x2b')][_0x0ec7('0x43')]({'where':{'id':_0xce5034[_0x0ec7('0x46')]['id']}})[_0x0ec7('0x25')](handleEntityNotFound(_0x2489ae,null))[_0x0ec7('0x25')](saveUpdates(_0xce5034[_0x0ec7('0x45')],null))[_0x0ec7('0x25')](respondWithResult(_0x2489ae,null))[_0x0ec7('0x41')](handleError(_0x2489ae,null));};exports[_0x0ec7('0x26')]=function(_0x54b299,_0x382fb2){return db[_0x0ec7('0x2b')][_0x0ec7('0x43')]({'where':{'id':_0x54b299[_0x0ec7('0x46')]['id']}})['then'](handleEntityNotFound(_0x382fb2,null))[_0x0ec7('0x25')](removeEntity(_0x382fb2,null))[_0x0ec7('0x41')](handleError(_0x382fb2,null));}; \ No newline at end of file +var _0x5432=['eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','then','destroy','error','name','send','ZohoField','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','rows','catch','include','find','create','body','params','html-pdf'];(function(_0x422038,_0x2d78a4){var _0x568dee=function(_0x44f3a5){while(--_0x44f3a5){_0x422038['push'](_0x422038['shift']());}};_0x568dee(++_0x2d78a4);}(_0x5432,0x113));var _0x2543=function(_0x5dbd84,_0x3126d3){_0x5dbd84=_0x5dbd84-0x0;var _0x3a3f30=_0x5432[_0x5dbd84];return _0x3a3f30;};'use strict';var pdf=require(_0x2543('0x0'));var emlformat=require(_0x2543('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2543('0x2'));var rp=require(_0x2543('0x3'));var moment=require('moment');var BPromise=require(_0x2543('0x4'));var Mustache=require(_0x2543('0x5'));var util=require(_0x2543('0x6'));var path=require(_0x2543('0x7'));var sox=require('sox');var csv=require(_0x2543('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2543('0x9'));var squel=require(_0x2543('0xa'));var crypto=require(_0x2543('0xb'));var jsforce=require(_0x2543('0xc'));var deskjs=require(_0x2543('0xd'));var toCsv=require(_0x2543('0x8'));var querystring=require('querystring');var Papa=require(_0x2543('0xe'));var Redis=require(_0x2543('0xf'));var authService=require(_0x2543('0x10'));var qs=require(_0x2543('0x11'));var hardwareService=require(_0x2543('0x12'));var logger=require(_0x2543('0x13'))(_0x2543('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x2543('0x15'))['db'];function respondWithStatusCode(_0x26f331,_0x3cece1){_0x3cece1=_0x3cece1||0xcc;return function(_0x64a3a0){if(_0x64a3a0){return _0x26f331[_0x2543('0x16')](_0x3cece1);}return _0x26f331[_0x2543('0x17')](_0x3cece1)[_0x2543('0x18')]();};}function respondWithResult(_0x260b39,_0x30e469){_0x30e469=_0x30e469||0xc8;return function(_0x3e1111){if(_0x3e1111){return _0x260b39[_0x2543('0x17')](_0x30e469)['json'](_0x3e1111);}};}function respondWithFilteredResult(_0x11664d,_0x5e69b6){return function(_0x27d307){if(_0x27d307){var _0xce9448=_0x27d307[_0x2543('0x19')],_0x4f8498=_0x5e69b6[_0x2543('0x1a')],_0x227805=_0x5e69b6[_0x2543('0x1a')]+_0x5e69b6[_0x2543('0x1b')],_0x49e6ab;if(_0x227805>=_0xce9448){_0x227805=_0xce9448;_0x49e6ab=0xc8;}else{_0x49e6ab=0xce;}_0x11664d['status'](_0x49e6ab);return _0x11664d[_0x2543('0x1c')](_0x2543('0x1d'),_0x4f8498+'-'+_0x227805+'/'+_0xce9448)[_0x2543('0x1e')](_0x27d307);}return null;};}function patchUpdates(_0x511284){return function(_0x41439a){try{jsonpatch[_0x2543('0x1f')](_0x41439a,_0x511284,!![]);}catch(_0x17cf30){return BPromise['reject'](_0x17cf30);}return _0x41439a[_0x2543('0x20')]();};}function saveUpdates(_0x2b3a0a,_0x30c7f2){return function(_0x566f1d){if(_0x566f1d){return _0x566f1d['update'](_0x2b3a0a)[_0x2543('0x21')](function(_0x175492){return _0x175492;});}return null;};}function removeEntity(_0x55d39b,_0x547691){return function(_0x487677){if(_0x487677){return _0x487677[_0x2543('0x22')]()['then'](function(){_0x55d39b[_0x2543('0x17')](0xcc)[_0x2543('0x18')]();});}};}function handleEntityNotFound(_0x27ed86,_0x4112d9){return function(_0x571e85){if(!_0x571e85){_0x27ed86[_0x2543('0x16')](0x194);}return _0x571e85;};}function handleError(_0x47f94c,_0x108e1a){_0x108e1a=_0x108e1a||0x1f4;return function(_0x542429){logger[_0x2543('0x23')](_0x542429['stack']);if(_0x542429['name']){delete _0x542429[_0x2543('0x24')];}_0x47f94c[_0x2543('0x17')](_0x108e1a)[_0x2543('0x25')](_0x542429);};}exports['index']=function(_0x694e18,_0x392ff4){var _0x592323={},_0x13ec66={},_0x39efd1={'count':0x0,'rows':[]};var _0xc39ead=db[_0x2543('0x26')][_0x2543('0x27')];_0x13ec66[_0x2543('0x28')]=_['keys'](_0xc39ead);_0x13ec66[_0x2543('0x29')]=_[_0x2543('0x2a')](_0x694e18[_0x2543('0x29')]);_0x13ec66[_0x2543('0x2b')]=_[_0x2543('0x2c')](_0x13ec66[_0x2543('0x28')],_0x13ec66[_0x2543('0x29')]);_0x592323[_0x2543('0x2d')]=_[_0x2543('0x2c')](_0x13ec66[_0x2543('0x28')],qs[_0x2543('0x2e')](_0x694e18[_0x2543('0x29')]['fields']));_0x592323[_0x2543('0x2d')]=_0x592323[_0x2543('0x2d')][_0x2543('0x2f')]?_0x592323[_0x2543('0x2d')]:_0x13ec66[_0x2543('0x28')];if(!_0x694e18['query'][_0x2543('0x30')](_0x2543('0x31'))){_0x592323['limit']=qs[_0x2543('0x1b')](_0x694e18['query'][_0x2543('0x1b')]);_0x592323[_0x2543('0x1a')]=qs[_0x2543('0x1a')](_0x694e18[_0x2543('0x29')][_0x2543('0x1a')]);}_0x592323['order']=qs[_0x2543('0x32')](_0x694e18[_0x2543('0x29')][_0x2543('0x32')]);_0x592323[_0x2543('0x33')]=qs[_0x2543('0x2b')](_[_0x2543('0x34')](_0x694e18['query'],_0x13ec66[_0x2543('0x2b')]));if(_0x694e18[_0x2543('0x29')]['filter']){_0x592323[_0x2543('0x33')]=_[_0x2543('0x35')](_0x592323[_0x2543('0x33')],{'$or':_[_0x2543('0x36')](_0xc39ead,function(_0x35e9da){if(_0x35e9da[_0x2543('0x37')][_0x2543('0x38')]!==_0x2543('0x39')){var _0x2f07de={};_0x2f07de[_0x35e9da[_0x2543('0x3a')]]={'$like':'%'+_0x694e18[_0x2543('0x29')][_0x2543('0x3b')]+'%'};return _0x2f07de;}})});}_0x592323=_[_0x2543('0x35')]({},_0x592323,_0x694e18[_0x2543('0x3c')]);var _0x3d4664={'where':_0x592323[_0x2543('0x33')]};return db[_0x2543('0x26')][_0x2543('0x19')](_0x3d4664)[_0x2543('0x21')](function(_0x2fc7f3){_0x39efd1['count']=_0x2fc7f3;if(_0x694e18['query'][_0x2543('0x3d')]){_0x592323['include']=[{'all':!![]}];}return db[_0x2543('0x26')]['findAll'](_0x592323);})[_0x2543('0x21')](function(_0x1a8f18){_0x39efd1[_0x2543('0x3e')]=_0x1a8f18;return _0x39efd1;})[_0x2543('0x21')](respondWithFilteredResult(_0x392ff4,_0x592323))[_0x2543('0x3f')](handleError(_0x392ff4,null));};exports['show']=function(_0x42befe,_0x319ce6){var _0x36f7d0={'raw':!![],'where':{'id':_0x42befe['params']['id']}},_0x115340={};_0x115340[_0x2543('0x28')]=_['keys'](db[_0x2543('0x26')][_0x2543('0x27')]);_0x115340[_0x2543('0x29')]=_['keys'](_0x42befe[_0x2543('0x29')]);_0x115340['filters']=_[_0x2543('0x2c')](_0x115340[_0x2543('0x28')],_0x115340['query']);_0x36f7d0[_0x2543('0x2d')]=_[_0x2543('0x2c')](_0x115340[_0x2543('0x28')],qs[_0x2543('0x2e')](_0x42befe[_0x2543('0x29')][_0x2543('0x2e')]));_0x36f7d0[_0x2543('0x2d')]=_0x36f7d0[_0x2543('0x2d')][_0x2543('0x2f')]?_0x36f7d0[_0x2543('0x2d')]:_0x115340[_0x2543('0x28')];if(_0x42befe[_0x2543('0x29')]['includeAll']){_0x36f7d0[_0x2543('0x40')]=[{'all':!![]}];}_0x36f7d0=_[_0x2543('0x35')]({},_0x36f7d0,_0x42befe[_0x2543('0x3c')]);return db['ZohoField'][_0x2543('0x41')](_0x36f7d0)[_0x2543('0x21')](handleEntityNotFound(_0x319ce6,null))['then'](respondWithResult(_0x319ce6,null))[_0x2543('0x3f')](handleError(_0x319ce6,null));};exports[_0x2543('0x42')]=function(_0x5c3343,_0x2a1ec9){return db[_0x2543('0x26')][_0x2543('0x42')](_0x5c3343[_0x2543('0x43')],{})[_0x2543('0x21')](respondWithResult(_0x2a1ec9,0xc9))[_0x2543('0x3f')](handleError(_0x2a1ec9,null));};exports['update']=function(_0x1da8fe,_0x1afa28){if(_0x1da8fe['body']['id']){delete _0x1da8fe[_0x2543('0x43')]['id'];}return db[_0x2543('0x26')][_0x2543('0x41')]({'where':{'id':_0x1da8fe[_0x2543('0x44')]['id']}})['then'](handleEntityNotFound(_0x1afa28,null))[_0x2543('0x21')](saveUpdates(_0x1da8fe['body'],null))[_0x2543('0x21')](respondWithResult(_0x1afa28,null))[_0x2543('0x3f')](handleError(_0x1afa28,null));};exports[_0x2543('0x22')]=function(_0x7cb1f2,_0x44809c){return db['ZohoField'][_0x2543('0x41')]({'where':{'id':_0x7cb1f2[_0x2543('0x44')]['id']}})['then'](handleEntityNotFound(_0x44809c,null))[_0x2543('0x21')](removeEntity(_0x44809c,null))['catch'](handleError(_0x44809c,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 78751fe..a114a89 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 _0x6adc=['define','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports'];(function(_0x1e1e7a,_0x8fcb53){var _0x57dab4=function(_0x2524ab){while(--_0x2524ab){_0x1e1e7a['push'](_0x1e1e7a['shift']());}};_0x57dab4(++_0x8fcb53);}(_0x6adc,0x9a));var _0xc6ad=function(_0x3f4cf7,_0x22cf31){_0x3f4cf7=_0x3f4cf7-0x0;var _0x588281=_0x6adc[_0x3f4cf7];return _0x588281;};'use strict';var _=require(_0xc6ad('0x0'));var util=require(_0xc6ad('0x1'));var logger=require(_0xc6ad('0x2'))(_0xc6ad('0x3'));var moment=require('moment');var BPromise=require(_0xc6ad('0x4'));var rp=require(_0xc6ad('0x5'));var fs=require('fs');var path=require(_0xc6ad('0x6'));var rimraf=require(_0xc6ad('0x7'));var config=require(_0xc6ad('0x8'));var attributes=require(_0xc6ad('0x9'));module[_0xc6ad('0xa')]=function(_0x5dd1a0,_0x24b66b){return _0x5dd1a0[_0xc6ad('0xb')]('ZohoField',attributes,{'tableName':_0xc6ad('0xc'),'paranoid':![],'indexes':[{'name':_0xc6ad('0xd'),'fields':[_0xc6ad('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc90d=['path','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x7e8437,_0x3e7c58){var _0x316453=function(_0x4d3a71){while(--_0x4d3a71){_0x7e8437['push'](_0x7e8437['shift']());}};_0x316453(++_0x3e7c58);}(_0xc90d,0xb0));var _0xdc90=function(_0x336ca2,_0x1a813a){_0x336ca2=_0x336ca2-0x0;var _0xda59a6=_0xc90d[_0x336ca2];return _0xda59a6;};'use strict';var _=require(_0xdc90('0x0'));var util=require('util');var logger=require(_0xdc90('0x1'))(_0xdc90('0x2'));var moment=require(_0xdc90('0x3'));var BPromise=require(_0xdc90('0x4'));var rp=require(_0xdc90('0x5'));var fs=require('fs');var path=require(_0xdc90('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdc90('0x7'));module[_0xdc90('0x8')]=function(_0x14ec49,_0x5e04b6){return _0x14ec49[_0xdc90('0x9')](_0xdc90('0xa'),attributes,{'tableName':_0xdc90('0xb'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField',_0xdc90('0xc')],'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 c0e614b..9c617fd 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 _0xed1f=['request','then','info','ZohoField,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3d03b3,_0x40f22a){var _0x2a4f33=function(_0x2386ee){while(--_0x2386ee){_0x3d03b3['push'](_0x3d03b3['shift']());}};_0x2a4f33(++_0x40f22a);}(_0xed1f,0x6a));var _0xfed1=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xed1f[_0x45783c];return _0x1161da;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x380e18,_0x612b38,_0x2a6082){return new BPromise(function(_0x2967ef,_0x568d48){return client[_0xfed1('0xe')](_0x380e18,_0x2a6082)[_0xfed1('0xf')](function(_0x48862d){logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,'request\x20sent');logger[_0xfed1('0x12')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x612b38,_0xfed1('0x13'),JSON[_0xfed1('0x14')](_0x48862d));if(_0x48862d['error']){if(_0x48862d['error'][_0xfed1('0x15')]===0x1f4){logger[_0xfed1('0x16')]('ZohoField,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x568d48(_0x48862d['error'][_0xfed1('0x17')]);}logger[_0xfed1('0x16')]('ZohoField,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x2967ef(_0x48862d['error'][_0xfed1('0x17')]);}else{logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,_0xfed1('0x13'));_0x2967ef(_0x48862d['result'][_0xfed1('0x17')]);}})['catch'](function(_0x36ff34){logger[_0xfed1('0x16')]('ZohoField,\x20%s,\x20%s',_0x612b38,_0x36ff34);_0x568d48(_0x36ff34);});});} \ No newline at end of file +var _0x55ca=['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','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x117c0d,_0x4bd001){var _0xa8f1f8=function(_0x5230cd){while(--_0x5230cd){_0x117c0d['push'](_0x117c0d['shift']());}};_0xa8f1f8(++_0x4bd001);}(_0x55ca,0x126));var _0xa55c=function(_0x4b6792,_0x1098bb){_0x4b6792=_0x4b6792-0x0;var _0x406802=_0x55ca[_0x4b6792];return _0x406802;};'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')]('ZohoField,\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')]('ZohoField,\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/integration/index.js b/server/api/integration/index.js index 8daec2d..ac201cf 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 _0x1bec=['path','express','Router','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x485305,_0x43f44a){var _0x205f72=function(_0x4c16c3){while(--_0x4c16c3){_0x485305['push'](_0x485305['shift']());}};_0x205f72(++_0x43f44a);}(_0x1bec,0x168));var _0xc1be=function(_0x3fcc20,_0x57c31b){_0x3fcc20=_0x3fcc20-0x0;var _0x15d3ce=_0x1bec[_0x3fcc20];return _0x15d3ce;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc1be('0x0'));var timeout=require('connect-timeout');var express=require(_0xc1be('0x1'));var router=express[_0xc1be('0x2')]();var auth=require(_0xc1be('0x3'));var interaction=require(_0xc1be('0x4'));var config=require('../../config/environment');module[_0xc1be('0x5')]=router; \ No newline at end of file +var _0xd734=['util','connect-timeout','express','../../components/auth/service','../../config/environment','exports'];(function(_0x2c94b1,_0x150e09){var _0x2fee60=function(_0x5a6f6a){while(--_0x5a6f6a){_0x2c94b1['push'](_0x2c94b1['shift']());}};_0x2fee60(++_0x150e09);}(_0xd734,0x6c));var _0x4d73=function(_0x51f626,_0x1644c1){_0x51f626=_0x51f626-0x0;var _0x3ee5ba=_0xd734[_0x51f626];return _0x3ee5ba;};'use strict';var multer=require('multer');var util=require(_0x4d73('0x0'));var path=require('path');var timeout=require(_0x4d73('0x1'));var express=require(_0x4d73('0x2'));var router=express['Router']();var auth=require(_0x4d73('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4d73('0x4'));module[_0x4d73('0x5')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 138e5d2..b5c35a9 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 _0xdd22=['INTEGER','BOOLEAN','state','sequelize','exports','STRING','app.js'];(function(_0x22277e,_0x9e9f4d){var _0x120115=function(_0x551bd1){while(--_0x551bd1){_0x22277e['push'](_0x22277e['shift']());}};_0x120115(++_0x9e9f4d);}(_0xdd22,0x13e));var _0x2dd2=function(_0x3e41f7,_0xb5ff25){_0x3e41f7=_0x3e41f7-0x0;var _0x43282a=_0xdd22[_0x3e41f7];return _0x43282a;};'use strict';var Sequelize=require(_0x2dd2('0x0'));module[_0x2dd2('0x1')]={'name':{'type':Sequelize[_0x2dd2('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x2dd2('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':_0x2dd2('0x3')},'filename':{'type':Sequelize[_0x2dd2('0x2')]},'path':{'type':Sequelize[_0x2dd2('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x2dd2('0x4')]},'active':{'type':Sequelize[_0x2dd2('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x2dd2('0x2')]},'logo':{'type':Sequelize[_0x2dd2('0x2')]},'state':{'type':Sequelize[_0x2dd2('0x2')],'unique':_0x2dd2('0x6')},'description':{'type':Sequelize[_0x2dd2('0x2')]},'title':{'type':Sequelize[_0x2dd2('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x2dd2('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x856c=['sequelize','exports','STRING','unique_name_and_version','INTEGER','BOOLEAN','state'];(function(_0x5cd151,_0x316144){var _0x1e60c7=function(_0x28a6f3){while(--_0x28a6f3){_0x5cd151['push'](_0x5cd151['shift']());}};_0x1e60c7(++_0x316144);}(_0x856c,0x173));var _0xc856=function(_0x43e2fe,_0x34ba01){_0x43e2fe=_0x43e2fe-0x0;var _0x1ee2a9=_0x856c[_0x43e2fe];return _0x1ee2a9;};'use strict';var Sequelize=require(_0xc856('0x0'));module[_0xc856('0x1')]={'name':{'type':Sequelize[_0xc856('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc856('0x3')},'main':{'type':Sequelize[_0xc856('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xc856('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc856('0x2')]},'size':{'type':Sequelize[_0xc856('0x4')]},'active':{'type':Sequelize[_0xc856('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xc856('0x2')]},'state':{'type':Sequelize[_0xc856('0x2')],'unique':_0xc856('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xc856('0x2')]},'remoteUri':{'type':Sequelize[_0xc856('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index d90b860..61b99a1 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 _0x687f=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','end','json','count','offset','set','Content-Range','reject','save','then','sendStatus','stack','name','send','Integration','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','where','filter','merge','VIRTUAL','field','options','includeAll','findAll','rows','catch','params','include','find','create','body','update','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel'];(function(_0x4d0df6,_0x4634f3){var _0x4e2615=function(_0x5285e2){while(--_0x5285e2){_0x4d0df6['push'](_0x4d0df6['shift']());}};_0x4e2615(++_0x4634f3);}(_0x687f,0x14b));var _0xf687=function(_0xd02bb,_0x26e2d0){_0xd02bb=_0xd02bb-0x0;var _0x1cdf23=_0x687f[_0xd02bb];return _0x1cdf23;};'use strict';var pdf=require(_0xf687('0x0'));var emlformat=require(_0xf687('0x1'));var rimraf=require(_0xf687('0x2'));var zipdir=require(_0xf687('0x3'));var jsonpatch=require(_0xf687('0x4'));var rp=require(_0xf687('0x5'));var moment=require(_0xf687('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xf687('0x7'));var util=require('util');var path=require(_0xf687('0x8'));var sox=require(_0xf687('0x9'));var csv=require(_0xf687('0xa'));var ejs=require(_0xf687('0xb'));var fs=require('fs');var _=require(_0xf687('0xc'));var squel=require(_0xf687('0xd'));var crypto=require(_0xf687('0xe'));var jsforce=require(_0xf687('0xf'));var deskjs=require(_0xf687('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf687('0x11'));var Papa=require('papaparse');var Redis=require(_0xf687('0x12'));var authService=require(_0xf687('0x13'));var qs=require(_0xf687('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf687('0x15'))(_0xf687('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf687('0x17'))['db'];function respondWithStatusCode(_0xc312dc,_0x1d52e3){_0x1d52e3=_0x1d52e3||0xcc;return function(_0x2223a8){if(_0x2223a8){return _0xc312dc['sendStatus'](_0x1d52e3);}return _0xc312dc[_0xf687('0x18')](_0x1d52e3)[_0xf687('0x19')]();};}function respondWithResult(_0x3b1707,_0x3e6654){_0x3e6654=_0x3e6654||0xc8;return function(_0x5761db){if(_0x5761db){return _0x3b1707[_0xf687('0x18')](_0x3e6654)[_0xf687('0x1a')](_0x5761db);}};}function respondWithFilteredResult(_0x39b18f,_0x4a3d3e){return function(_0x289b88){if(_0x289b88){var _0x32f913=_0x289b88[_0xf687('0x1b')],_0x1bd562=_0x4a3d3e['offset'],_0x2996e4=_0x4a3d3e[_0xf687('0x1c')]+_0x4a3d3e['limit'],_0x27ad50;if(_0x2996e4>=_0x32f913){_0x2996e4=_0x32f913;_0x27ad50=0xc8;}else{_0x27ad50=0xce;}_0x39b18f[_0xf687('0x18')](_0x27ad50);return _0x39b18f[_0xf687('0x1d')](_0xf687('0x1e'),_0x1bd562+'-'+_0x2996e4+'/'+_0x32f913)[_0xf687('0x1a')](_0x289b88);}return null;};}function patchUpdates(_0x486240){return function(_0x5cdfde){try{jsonpatch['apply'](_0x5cdfde,_0x486240,!![]);}catch(_0x14dbad){return BPromise[_0xf687('0x1f')](_0x14dbad);}return _0x5cdfde[_0xf687('0x20')]();};}function saveUpdates(_0xb7597d,_0xa55a1f){return function(_0x38c58c){if(_0x38c58c){return _0x38c58c['update'](_0xb7597d)[_0xf687('0x21')](function(_0x334178){return _0x334178;});}return null;};}function removeEntity(_0x590eb0,_0x77c5ea){return function(_0x174763){if(_0x174763){return _0x174763['destroy']()[_0xf687('0x21')](function(){_0x590eb0[_0xf687('0x18')](0xcc)[_0xf687('0x19')]();});}};}function handleEntityNotFound(_0xcd9d84,_0x24ef60){return function(_0x1e2129){if(!_0x1e2129){_0xcd9d84[_0xf687('0x22')](0x194);}return _0x1e2129;};}function handleError(_0x1b88b8,_0x5865f0){_0x5865f0=_0x5865f0||0x1f4;return function(_0x3883f2){logger['error'](_0x3883f2[_0xf687('0x23')]);if(_0x3883f2[_0xf687('0x24')]){delete _0x3883f2['name'];}_0x1b88b8['status'](_0x5865f0)[_0xf687('0x25')](_0x3883f2);};}exports['index']=function(_0x574b1e,_0x495334){var _0x3b1b09={},_0x8e8273={},_0x52cbd4={'count':0x0,'rows':[]};var _0x4f61dc=db[_0xf687('0x26')][_0xf687('0x27')];_0x8e8273[_0xf687('0x28')]=_[_0xf687('0x29')](_0x4f61dc);_0x8e8273['query']=_['keys'](_0x574b1e[_0xf687('0x2a')]);_0x8e8273[_0xf687('0x2b')]=_['intersection'](_0x8e8273[_0xf687('0x28')],_0x8e8273[_0xf687('0x2a')]);_0x3b1b09[_0xf687('0x2c')]=_[_0xf687('0x2d')](_0x8e8273[_0xf687('0x28')],qs['fields'](_0x574b1e[_0xf687('0x2a')][_0xf687('0x2e')]));_0x3b1b09[_0xf687('0x2c')]=_0x3b1b09[_0xf687('0x2c')][_0xf687('0x2f')]?_0x3b1b09[_0xf687('0x2c')]:_0x8e8273['model'];if(!_0x574b1e[_0xf687('0x2a')][_0xf687('0x30')](_0xf687('0x31'))){_0x3b1b09['limit']=qs[_0xf687('0x32')](_0x574b1e[_0xf687('0x2a')][_0xf687('0x32')]);_0x3b1b09['offset']=qs['offset'](_0x574b1e[_0xf687('0x2a')][_0xf687('0x1c')]);}_0x3b1b09[_0xf687('0x33')]=qs['sort'](_0x574b1e[_0xf687('0x2a')]['sort']);_0x3b1b09[_0xf687('0x34')]=qs[_0xf687('0x2b')](_['pick'](_0x574b1e[_0xf687('0x2a')],_0x8e8273[_0xf687('0x2b')]));if(_0x574b1e[_0xf687('0x2a')][_0xf687('0x35')]){_0x3b1b09[_0xf687('0x34')]=_[_0xf687('0x36')](_0x3b1b09[_0xf687('0x34')],{'$or':_['map'](_0x4f61dc,function(_0x4e97e8){if(_0x4e97e8['type']['key']!==_0xf687('0x37')){var _0x39bbaf={};_0x39bbaf[_0x4e97e8[_0xf687('0x38')]]={'$like':'%'+_0x574b1e['query']['filter']+'%'};return _0x39bbaf;}})});}_0x3b1b09=_[_0xf687('0x36')]({},_0x3b1b09,_0x574b1e[_0xf687('0x39')]);var _0x4e5bd1={'where':_0x3b1b09['where']};return db[_0xf687('0x26')][_0xf687('0x1b')](_0x4e5bd1)[_0xf687('0x21')](function(_0x69ebfb){_0x52cbd4['count']=_0x69ebfb;if(_0x574b1e[_0xf687('0x2a')][_0xf687('0x3a')]){_0x3b1b09['include']=[{'all':!![]}];}return db[_0xf687('0x26')][_0xf687('0x3b')](_0x3b1b09);})[_0xf687('0x21')](function(_0x4f3fb5){_0x52cbd4[_0xf687('0x3c')]=_0x4f3fb5;return _0x52cbd4;})[_0xf687('0x21')](respondWithFilteredResult(_0x495334,_0x3b1b09))[_0xf687('0x3d')](handleError(_0x495334,null));};exports['show']=function(_0x2c35df,_0x33e048){var _0x12e94f={'raw':![],'where':{'id':_0x2c35df[_0xf687('0x3e')]['id']}},_0x4a3a3b={};_0x4a3a3b[_0xf687('0x28')]=_['keys'](db[_0xf687('0x26')][_0xf687('0x27')]);_0x4a3a3b[_0xf687('0x2a')]=_['keys'](_0x2c35df[_0xf687('0x2a')]);_0x4a3a3b[_0xf687('0x2b')]=_['intersection'](_0x4a3a3b[_0xf687('0x28')],_0x4a3a3b[_0xf687('0x2a')]);_0x12e94f['attributes']=_[_0xf687('0x2d')](_0x4a3a3b[_0xf687('0x28')],qs[_0xf687('0x2e')](_0x2c35df['query'][_0xf687('0x2e')]));_0x12e94f['attributes']=_0x12e94f[_0xf687('0x2c')][_0xf687('0x2f')]?_0x12e94f[_0xf687('0x2c')]:_0x4a3a3b[_0xf687('0x28')];if(_0x2c35df[_0xf687('0x2a')][_0xf687('0x3a')]){_0x12e94f[_0xf687('0x3f')]=[{'all':!![]}];}_0x12e94f=_[_0xf687('0x36')]({},_0x12e94f,_0x2c35df[_0xf687('0x39')]);return db[_0xf687('0x26')][_0xf687('0x40')](_0x12e94f)[_0xf687('0x21')](handleEntityNotFound(_0x33e048,null))['then'](respondWithResult(_0x33e048,null))[_0xf687('0x3d')](handleError(_0x33e048,null));};exports['create']=function(_0x2272e2,_0x1d4a3a){return db[_0xf687('0x26')][_0xf687('0x41')](_0x2272e2[_0xf687('0x42')],{})[_0xf687('0x21')](respondWithResult(_0x1d4a3a,0xc9))['catch'](handleError(_0x1d4a3a,null));};exports[_0xf687('0x43')]=function(_0x26ade6,_0x2cbd2c){if(_0x26ade6[_0xf687('0x42')]['id']){delete _0x26ade6[_0xf687('0x42')]['id'];}return db[_0xf687('0x26')][_0xf687('0x40')]({'where':{'id':_0x26ade6[_0xf687('0x3e')]['id']}})[_0xf687('0x21')](handleEntityNotFound(_0x2cbd2c,null))['then'](saveUpdates(_0x26ade6['body'],null))['then'](respondWithResult(_0x2cbd2c,null))['catch'](handleError(_0x2cbd2c,null));};exports[_0xf687('0x44')]=function(_0x5033cf,_0x226ef7){return db['Integration'][_0xf687('0x40')]({'where':{'id':_0x5033cf['params']['id']}})[_0xf687('0x21')](handleEntityNotFound(_0x226ef7,null))[_0xf687('0x21')](removeEntity(_0x226ef7,null))[_0xf687('0x3d')](handleError(_0x226ef7,null));}; \ No newline at end of file +var _0x9e39=['query','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','stack','name','send','index','Integration','rawAttributes','keys','filters','attributes','intersection','model','fields'];(function(_0x3ef743,_0x102927){var _0x58b5fb=function(_0x2de196){while(--_0x2de196){_0x3ef743['push'](_0x3ef743['shift']());}};_0x58b5fb(++_0x102927);}(_0x9e39,0x191));var _0x99e3=function(_0x1e72e4,_0x59341c){_0x1e72e4=_0x1e72e4-0x0;var _0x2ba797=_0x9e39[_0x1e72e4];return _0x2ba797;};'use strict';var pdf=require(_0x99e3('0x0'));var emlformat=require(_0x99e3('0x1'));var rimraf=require(_0x99e3('0x2'));var zipdir=require(_0x99e3('0x3'));var jsonpatch=require(_0x99e3('0x4'));var rp=require(_0x99e3('0x5'));var moment=require(_0x99e3('0x6'));var BPromise=require(_0x99e3('0x7'));var Mustache=require(_0x99e3('0x8'));var util=require(_0x99e3('0x9'));var path=require(_0x99e3('0xa'));var sox=require('sox');var csv=require(_0x99e3('0xb'));var ejs=require(_0x99e3('0xc'));var fs=require('fs');var _=require(_0x99e3('0xd'));var squel=require('squel');var crypto=require(_0x99e3('0xe'));var jsforce=require(_0x99e3('0xf'));var deskjs=require(_0x99e3('0x10'));var toCsv=require('to-csv');var querystring=require(_0x99e3('0x11'));var Papa=require(_0x99e3('0x12'));var Redis=require(_0x99e3('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x99e3('0x14'));var hardwareService=require(_0x99e3('0x15'));var logger=require('../../config/logger')(_0x99e3('0x16'));var utils=require(_0x99e3('0x17'));var config=require('../../config/environment');var db=require(_0x99e3('0x18'))['db'];function respondWithStatusCode(_0x5c1823,_0x335857){_0x335857=_0x335857||0xcc;return function(_0x22c94c){if(_0x22c94c){return _0x5c1823[_0x99e3('0x19')](_0x335857);}return _0x5c1823[_0x99e3('0x1a')](_0x335857)[_0x99e3('0x1b')]();};}function respondWithResult(_0xe84433,_0x4b06ea){_0x4b06ea=_0x4b06ea||0xc8;return function(_0x50d9cd){if(_0x50d9cd){return _0xe84433[_0x99e3('0x1a')](_0x4b06ea)[_0x99e3('0x1c')](_0x50d9cd);}};}function respondWithFilteredResult(_0x2c77c1,_0x1a7502){return function(_0x684d14){if(_0x684d14){var _0x20d09a=_0x684d14[_0x99e3('0x1d')],_0x5c9a90=_0x1a7502[_0x99e3('0x1e')],_0x5f231c=_0x1a7502[_0x99e3('0x1e')]+_0x1a7502['limit'],_0x4856e9;if(_0x5f231c>=_0x20d09a){_0x5f231c=_0x20d09a;_0x4856e9=0xc8;}else{_0x4856e9=0xce;}_0x2c77c1[_0x99e3('0x1a')](_0x4856e9);return _0x2c77c1[_0x99e3('0x1f')](_0x99e3('0x20'),_0x5c9a90+'-'+_0x5f231c+'/'+_0x20d09a)[_0x99e3('0x1c')](_0x684d14);}return null;};}function patchUpdates(_0xd5d0c3){return function(_0x5cabea){try{jsonpatch['apply'](_0x5cabea,_0xd5d0c3,!![]);}catch(_0x279bb4){return BPromise[_0x99e3('0x21')](_0x279bb4);}return _0x5cabea[_0x99e3('0x22')]();};}function saveUpdates(_0x5292f1,_0x396e54){return function(_0x4aaee0){if(_0x4aaee0){return _0x4aaee0[_0x99e3('0x23')](_0x5292f1)[_0x99e3('0x24')](function(_0x156f29){return _0x156f29;});}return null;};}function removeEntity(_0x551e9a,_0x3a392d){return function(_0x49aba4){if(_0x49aba4){return _0x49aba4['destroy']()[_0x99e3('0x24')](function(){_0x551e9a[_0x99e3('0x1a')](0xcc)[_0x99e3('0x1b')]();});}};}function handleEntityNotFound(_0x463f86,_0x6992d3){return function(_0x4ce515){if(!_0x4ce515){_0x463f86['sendStatus'](0x194);}return _0x4ce515;};}function handleError(_0x357e45,_0x2af8e1){_0x2af8e1=_0x2af8e1||0x1f4;return function(_0x17f37c){logger['error'](_0x17f37c[_0x99e3('0x25')]);if(_0x17f37c[_0x99e3('0x26')]){delete _0x17f37c[_0x99e3('0x26')];}_0x357e45[_0x99e3('0x1a')](_0x2af8e1)[_0x99e3('0x27')](_0x17f37c);};}exports[_0x99e3('0x28')]=function(_0x660607,_0x4f3017){var _0x1145a7={},_0xed68cc={},_0x51d4d7={'count':0x0,'rows':[]};var _0x532e9b=db[_0x99e3('0x29')][_0x99e3('0x2a')];_0xed68cc['model']=_[_0x99e3('0x2b')](_0x532e9b);_0xed68cc['query']=_[_0x99e3('0x2b')](_0x660607['query']);_0xed68cc[_0x99e3('0x2c')]=_['intersection'](_0xed68cc['model'],_0xed68cc['query']);_0x1145a7[_0x99e3('0x2d')]=_[_0x99e3('0x2e')](_0xed68cc[_0x99e3('0x2f')],qs[_0x99e3('0x30')](_0x660607[_0x99e3('0x31')]['fields']));_0x1145a7[_0x99e3('0x2d')]=_0x1145a7[_0x99e3('0x2d')][_0x99e3('0x32')]?_0x1145a7['attributes']:_0xed68cc[_0x99e3('0x2f')];if(!_0x660607['query'][_0x99e3('0x33')](_0x99e3('0x34'))){_0x1145a7[_0x99e3('0x35')]=qs['limit'](_0x660607['query']['limit']);_0x1145a7[_0x99e3('0x1e')]=qs['offset'](_0x660607['query']['offset']);}_0x1145a7[_0x99e3('0x36')]=qs[_0x99e3('0x37')](_0x660607[_0x99e3('0x31')][_0x99e3('0x37')]);_0x1145a7[_0x99e3('0x38')]=qs[_0x99e3('0x2c')](_['pick'](_0x660607[_0x99e3('0x31')],_0xed68cc[_0x99e3('0x2c')]));if(_0x660607[_0x99e3('0x31')][_0x99e3('0x39')]){_0x1145a7[_0x99e3('0x38')]=_[_0x99e3('0x3a')](_0x1145a7[_0x99e3('0x38')],{'$or':_['map'](_0x532e9b,function(_0x41dc5b){if(_0x41dc5b[_0x99e3('0x3b')][_0x99e3('0x3c')]!==_0x99e3('0x3d')){var _0x1aae18={};_0x1aae18[_0x41dc5b[_0x99e3('0x3e')]]={'$like':'%'+_0x660607[_0x99e3('0x31')]['filter']+'%'};return _0x1aae18;}})});}_0x1145a7=_[_0x99e3('0x3a')]({},_0x1145a7,_0x660607[_0x99e3('0x3f')]);var _0x1b31be={'where':_0x1145a7[_0x99e3('0x38')]};return db[_0x99e3('0x29')][_0x99e3('0x1d')](_0x1b31be)[_0x99e3('0x24')](function(_0xb2c552){_0x51d4d7[_0x99e3('0x1d')]=_0xb2c552;if(_0x660607[_0x99e3('0x31')][_0x99e3('0x40')]){_0x1145a7[_0x99e3('0x41')]=[{'all':!![]}];}return db['Integration'][_0x99e3('0x42')](_0x1145a7);})[_0x99e3('0x24')](function(_0xbf4031){_0x51d4d7[_0x99e3('0x43')]=_0xbf4031;return _0x51d4d7;})[_0x99e3('0x24')](respondWithFilteredResult(_0x4f3017,_0x1145a7))[_0x99e3('0x44')](handleError(_0x4f3017,null));};exports[_0x99e3('0x45')]=function(_0x140ffb,_0x4a1069){var _0x3f590e={'raw':![],'where':{'id':_0x140ffb[_0x99e3('0x46')]['id']}},_0x4359bd={};_0x4359bd[_0x99e3('0x2f')]=_[_0x99e3('0x2b')](db[_0x99e3('0x29')][_0x99e3('0x2a')]);_0x4359bd[_0x99e3('0x31')]=_[_0x99e3('0x2b')](_0x140ffb['query']);_0x4359bd[_0x99e3('0x2c')]=_[_0x99e3('0x2e')](_0x4359bd['model'],_0x4359bd[_0x99e3('0x31')]);_0x3f590e[_0x99e3('0x2d')]=_[_0x99e3('0x2e')](_0x4359bd[_0x99e3('0x2f')],qs[_0x99e3('0x30')](_0x140ffb[_0x99e3('0x31')][_0x99e3('0x30')]));_0x3f590e[_0x99e3('0x2d')]=_0x3f590e[_0x99e3('0x2d')][_0x99e3('0x32')]?_0x3f590e['attributes']:_0x4359bd[_0x99e3('0x2f')];if(_0x140ffb['query']['includeAll']){_0x3f590e[_0x99e3('0x41')]=[{'all':!![]}];}_0x3f590e=_[_0x99e3('0x3a')]({},_0x3f590e,_0x140ffb[_0x99e3('0x3f')]);return db[_0x99e3('0x29')][_0x99e3('0x47')](_0x3f590e)[_0x99e3('0x24')](handleEntityNotFound(_0x4a1069,null))[_0x99e3('0x24')](respondWithResult(_0x4a1069,null))[_0x99e3('0x44')](handleError(_0x4a1069,null));};exports[_0x99e3('0x48')]=function(_0x457c35,_0xcd18c4){return db[_0x99e3('0x29')][_0x99e3('0x48')](_0x457c35[_0x99e3('0x49')],{})[_0x99e3('0x24')](respondWithResult(_0xcd18c4,0xc9))['catch'](handleError(_0xcd18c4,null));};exports[_0x99e3('0x23')]=function(_0x31dfed,_0x492764){if(_0x31dfed[_0x99e3('0x49')]['id']){delete _0x31dfed[_0x99e3('0x49')]['id'];}return db[_0x99e3('0x29')][_0x99e3('0x47')]({'where':{'id':_0x31dfed[_0x99e3('0x46')]['id']}})[_0x99e3('0x24')](handleEntityNotFound(_0x492764,null))[_0x99e3('0x24')](saveUpdates(_0x31dfed[_0x99e3('0x49')],null))['then'](respondWithResult(_0x492764,null))[_0x99e3('0x44')](handleError(_0x492764,null));};exports[_0x99e3('0x4a')]=function(_0x48892a,_0x2e7e91){return db[_0x99e3('0x29')][_0x99e3('0x47')]({'where':{'id':_0x48892a[_0x99e3('0x46')]['id']}})['then'](handleEntityNotFound(_0x2e7e91,null))[_0x99e3('0x24')](removeEntity(_0x2e7e91,null))['catch'](handleError(_0x2e7e91,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 62946ae..5ef149b 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 _0x8145=['exports','define','integrations','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./integration.attributes'];(function(_0x5efa26,_0x372633){var _0xcd29a=function(_0x53aa78){while(--_0x53aa78){_0x5efa26['push'](_0x5efa26['shift']());}};_0xcd29a(++_0x372633);}(_0x8145,0x158));var _0x5814=function(_0xe834d5,_0x45a88e){_0xe834d5=_0xe834d5-0x0;var _0x318d61=_0x8145[_0xe834d5];return _0x318d61;};'use strict';var _=require(_0x5814('0x0'));var util=require(_0x5814('0x1'));var logger=require('../../config/logger')(_0x5814('0x2'));var moment=require(_0x5814('0x3'));var BPromise=require(_0x5814('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5814('0x5'));var config=require(_0x5814('0x6'));var attributes=require(_0x5814('0x7'));module[_0x5814('0x8')]=function(_0x28dee8,_0x5c79ad){return _0x28dee8[_0x5814('0x9')]('Integration',attributes,{'tableName':_0x5814('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xccfe=['api','moment','bluebird','request-promise','rimraf','./integration.attributes','exports','define','Integration','integrations','lodash','util'];(function(_0x2fd674,_0x1f8c6b){var _0x58fb4b=function(_0x489307){while(--_0x489307){_0x2fd674['push'](_0x2fd674['shift']());}};_0x58fb4b(++_0x1f8c6b);}(_0xccfe,0x166));var _0xeccf=function(_0x30c16a,_0x13ca1b){_0x30c16a=_0x30c16a-0x0;var _0x5f3a7c=_0xccfe[_0x30c16a];return _0x5f3a7c;};'use strict';var _=require(_0xeccf('0x0'));var util=require(_0xeccf('0x1'));var logger=require('../../config/logger')(_0xeccf('0x2'));var moment=require(_0xeccf('0x3'));var BPromise=require(_0xeccf('0x4'));var rp=require(_0xeccf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeccf('0x6'));var config=require('../../config/environment');var attributes=require(_0xeccf('0x7'));module[_0xeccf('0x8')]=function(_0x2cdc01,_0x2c578a){return _0x2cdc01[_0xeccf('0x9')](_0xeccf('0xa'),attributes,{'tableName':_0xeccf('0xb'),'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 533993b..2d93396 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 _0x3d94=['message','Integration,\x20%s,\x20%s','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','request','then','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x3d94,0xd7));var _0x43d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d94[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x43d9('0x0'));var moment=require(_0x43d9('0x1'));var BPromise=require(_0x43d9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43d9('0x3'));var db=require(_0x43d9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x43d9('0x5'));var config=require(_0x43d9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x43d9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1301ae,_0x33f4a7,_0x4f1f5b){return new BPromise(function(_0x3b3ce9,_0x30953b){return client[_0x43d9('0x8')](_0x1301ae,_0x4f1f5b)[_0x43d9('0x9')](function(_0x39e73e){logger['info']('Integration,\x20%s,\x20%s',_0x33f4a7,_0x43d9('0xa'));logger[_0x43d9('0xb')](_0x43d9('0xc'),_0x33f4a7,_0x43d9('0xa'),JSON[_0x43d9('0xd')](_0x39e73e));if(_0x39e73e[_0x43d9('0xe')]){if(_0x39e73e[_0x43d9('0xe')][_0x43d9('0xf')]===0x1f4){logger[_0x43d9('0xe')]('Integration,\x20%s,\x20%s',_0x33f4a7,_0x39e73e[_0x43d9('0xe')][_0x43d9('0x10')]);return _0x30953b(_0x39e73e['error'][_0x43d9('0x10')]);}logger[_0x43d9('0xe')](_0x43d9('0x11'),_0x33f4a7,_0x39e73e[_0x43d9('0xe')][_0x43d9('0x10')]);return _0x3b3ce9(_0x39e73e[_0x43d9('0xe')][_0x43d9('0x10')]);}else{logger[_0x43d9('0x12')]('Integration,\x20%s,\x20%s',_0x33f4a7,_0x43d9('0xa'));_0x3b3ce9(_0x39e73e[_0x43d9('0x13')][_0x43d9('0x10')]);}})[_0x43d9('0x14')](function(_0x50c605){logger[_0x43d9('0xe')](_0x43d9('0x11'),_0x33f4a7,_0x50c605);_0x30953b(_0x50c605);});});} \ No newline at end of file +var _0xc716=['debug','stringify','error','code','Integration,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent'];(function(_0x4fefce,_0x5a590d){var _0x369ab0=function(_0x46a522){while(--_0x46a522){_0x4fefce['push'](_0x4fefce['shift']());}};_0x369ab0(++_0x5a590d);}(_0xc716,0x16c));var _0x6c71=function(_0x2daf63,_0x3dcdef){_0x2daf63=_0x2daf63-0x0;var _0x32a1ef=_0xc716[_0x2daf63];return _0x32a1ef;};'use strict';var _=require(_0x6c71('0x0'));var util=require('util');var moment=require(_0x6c71('0x1'));var BPromise=require(_0x6c71('0x2'));var rs=require(_0x6c71('0x3'));var fs=require('fs');var Redis=require(_0x6c71('0x4'));var db=require(_0x6c71('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6c71('0x6'))('rpc');var config=require(_0x6c71('0x7'));var jayson=require(_0x6c71('0x8'));var client=jayson[_0x6c71('0x9')][_0x6c71('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2156c3,_0xbabaa2,_0x18a140){return new BPromise(function(_0x8888c8,_0x46d311){return client['request'](_0x2156c3,_0x18a140)[_0x6c71('0xb')](function(_0x5a6f1a){logger[_0x6c71('0xc')]('Integration,\x20%s,\x20%s',_0xbabaa2,_0x6c71('0xd'));logger[_0x6c71('0xe')]('Integration,\x20%s,\x20%s,\x20%s',_0xbabaa2,_0x6c71('0xd'),JSON[_0x6c71('0xf')](_0x5a6f1a));if(_0x5a6f1a[_0x6c71('0x10')]){if(_0x5a6f1a[_0x6c71('0x10')][_0x6c71('0x11')]===0x1f4){logger[_0x6c71('0x10')](_0x6c71('0x12'),_0xbabaa2,_0x5a6f1a[_0x6c71('0x10')]['message']);return _0x46d311(_0x5a6f1a[_0x6c71('0x10')][_0x6c71('0x13')]);}logger[_0x6c71('0x10')]('Integration,\x20%s,\x20%s',_0xbabaa2,_0x5a6f1a[_0x6c71('0x10')][_0x6c71('0x13')]);return _0x8888c8(_0x5a6f1a['error'][_0x6c71('0x13')]);}else{logger['info'](_0x6c71('0x12'),_0xbabaa2,'request\x20sent');_0x8888c8(_0x5a6f1a['result'][_0x6c71('0x13')]);}})[_0x6c71('0x14')](function(_0x4e616e){logger['error']('Integration,\x20%s,\x20%s',_0xbabaa2,_0x4e616e);_0x46d311(_0x4e616e);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 7d8750f..7cb06d1 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 _0xcb2c=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x1a4975,_0x121581){var _0xb71cfd=function(_0x171da5){while(--_0x171da5){_0x1a4975['push'](_0x1a4975['shift']());}};_0xb71cfd(++_0x121581);}(_0xcb2c,0x17a));var _0xccb2=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xcb2c[_0x5e3b04];return _0x1fc44d;};'use strict';var multer=require(_0xccb2('0x0'));var util=require(_0xccb2('0x1'));var path=require(_0xccb2('0x2'));var timeout=require(_0xccb2('0x3'));var express=require(_0xccb2('0x4'));var router=express['Router']();var auth=require(_0xccb2('0x5'));var interaction=require(_0xccb2('0x6'));var config=require(_0xccb2('0x7'));var controller=require(_0xccb2('0x8'));router[_0xccb2('0x9')]('/',auth[_0xccb2('0xa')](),controller['index']);router['get'](_0xccb2('0xb'),auth[_0xccb2('0xa')](),controller[_0xccb2('0xc')]);router[_0xccb2('0x9')](_0xccb2('0xd'),auth[_0xccb2('0xa')](),controller[_0xccb2('0xe')]);router[_0xccb2('0xf')]('/',auth[_0xccb2('0xa')](),controller[_0xccb2('0x10')]);router[_0xccb2('0x11')](_0xccb2('0xd'),auth['isAuthenticated'](),controller[_0xccb2('0x12')]);router[_0xccb2('0x13')](_0xccb2('0xd'),auth[_0xccb2('0xa')](),controller[_0xccb2('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa0bd=['/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x1d32b3,_0x526ab2){var _0x2d7884=function(_0x344827){while(--_0x344827){_0x1d32b3['push'](_0x1d32b3['shift']());}};_0x2d7884(++_0x526ab2);}(_0xa0bd,0x17e));var _0xda0b=function(_0x1055e9,_0x3b097e){_0x1055e9=_0x1055e9-0x0;var _0x1a54ee=_0xa0bd[_0x1055e9];return _0x1a54ee;};'use strict';var multer=require('multer');var util=require(_0xda0b('0x0'));var path=require(_0xda0b('0x1'));var timeout=require(_0xda0b('0x2'));var express=require(_0xda0b('0x3'));var router=express[_0xda0b('0x4')]();var auth=require(_0xda0b('0x5'));var interaction=require(_0xda0b('0x6'));var config=require(_0xda0b('0x7'));var controller=require(_0xda0b('0x8'));router[_0xda0b('0x9')]('/',auth[_0xda0b('0xa')](),controller[_0xda0b('0xb')]);router[_0xda0b('0x9')](_0xda0b('0xc'),auth[_0xda0b('0xa')](),controller[_0xda0b('0xd')]);router[_0xda0b('0x9')](_0xda0b('0xe'),auth[_0xda0b('0xa')](),controller[_0xda0b('0xf')]);router[_0xda0b('0x10')]('/',auth[_0xda0b('0xa')](),controller[_0xda0b('0x11')]);router['put'](_0xda0b('0xe'),auth[_0xda0b('0xa')](),controller[_0xda0b('0x12')]);router[_0xda0b('0x13')](_0xda0b('0xe'),auth[_0xda0b('0xa')](),controller[_0xda0b('0x14')]);module[_0xda0b('0x15')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 9fefe08..4d5c7a4 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 _0xead1=['BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x4c2b96,_0x17ab0d){var _0x2a62bf=function(_0x6069bd){while(--_0x6069bd){_0x4c2b96['push'](_0x4c2b96['shift']());}};_0x2a62bf(++_0x17ab0d);}(_0xead1,0x1ea));var _0x1ead=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xead1[_0x1d9aa0];return _0x226868;};'use strict';var Sequelize=require(_0x1ead('0x0'));module[_0x1ead('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x1ead('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1ead('0x2')]},'calleridnum':{'type':Sequelize[_0x1ead('0x2')]},'calleridname':{'type':Sequelize[_0x1ead('0x2')]},'queue':{'type':Sequelize[_0x1ead('0x2')]},'interface':{'type':Sequelize[_0x1ead('0x2')]},'membername':{'type':Sequelize[_0x1ead('0x2')]},'agentcalledAt':{'type':Sequelize[_0x1ead('0x3')]},'agentconnectAt':{'type':Sequelize[_0x1ead('0x3')]},'holdtime':{'type':Sequelize[_0x1ead('0x4')]},'agentcomplete':{'type':Sequelize[_0x1ead('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x1ead('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x1ead('0x4')]},'reason':{'type':Sequelize[_0x1ead('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x1ead('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x1ead('0x3')]},'lastevent':{'type':Sequelize[_0x1ead('0x2')]},'channel':{'type':Sequelize[_0x1ead('0x2')]},'channelstate':{'type':Sequelize[_0x1ead('0x4')]},'channelstatedesc':{'type':Sequelize[_0x1ead('0x2')]},'connectedlinenum':{'type':Sequelize[_0x1ead('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x1ead('0x2')]},'accountcode':{'type':Sequelize[_0x1ead('0x2')]},'context':{'type':Sequelize[_0x1ead('0x2')]},'exten':{'type':Sequelize[_0x1ead('0x2')]},'priority':{'type':Sequelize[_0x1ead('0x2')]},'destchannel':{'type':Sequelize[_0x1ead('0x2')]},'destchannelstate':{'type':Sequelize[_0x1ead('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x1ead('0x2')]},'destcalleridnum':{'type':Sequelize[_0x1ead('0x2')]},'destcalleridname':{'type':Sequelize[_0x1ead('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x1ead('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x1ead('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x1ead('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x1ead('0x2')]},'destuniqueid':{'type':Sequelize[_0x1ead('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x1ead('0x2')]},'subject':{'type':Sequelize[_0x1ead('0x2')]},'from':{'type':Sequelize[_0x1ead('0x2')]},'to':{'type':Sequelize[_0x1ead('0x2')]},'cc':{'type':Sequelize[_0x1ead('0x2')]},'attachment':{'type':Sequelize[_0x1ead('0x6')]},'html':{'type':Sequelize[_0x1ead('0x6')]},'text':{'type':Sequelize[_0x1ead('0x6')]},'status':{'type':Sequelize[_0x1ead('0x7')](_0x1ead('0x8'),_0x1ead('0x9'),_0x1ead('0xa'),'FAILED')},'url':{'type':Sequelize[_0x1ead('0x2')]},'app':{'type':Sequelize[_0x1ead('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x1ead('0x4')]}}; \ No newline at end of file +var _0x81f2=['BOOLEAN','TEXT','SENDING','sequelize','STRING','INTEGER','DATE'];(function(_0x6a7ff3,_0x3062db){var _0x482e7d=function(_0x4aeb24){while(--_0x4aeb24){_0x6a7ff3['push'](_0x6a7ff3['shift']());}};_0x482e7d(++_0x3062db);}(_0x81f2,0x13e));var _0x281f=function(_0xf9a6cf,_0x11870e){_0xf9a6cf=_0xf9a6cf-0x0;var _0x59e2bc=_0x81f2[_0xf9a6cf];return _0x59e2bc;};'use strict';var Sequelize=require(_0x281f('0x0'));module['exports']={'integration':{'type':Sequelize[_0x281f('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x281f('0x1')]},'ticketId':{'type':Sequelize[_0x281f('0x1')]},'integrationId':{'type':Sequelize[_0x281f('0x2')]},'contacts':{'type':Sequelize[_0x281f('0x1')]},'uniqueid':{'type':Sequelize[_0x281f('0x1')]},'calleridnum':{'type':Sequelize[_0x281f('0x1')]},'calleridname':{'type':Sequelize[_0x281f('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x281f('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x281f('0x3')]},'agentconnectAt':{'type':Sequelize[_0x281f('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x281f('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x281f('0x3')]},'talktime':{'type':Sequelize[_0x281f('0x2')]},'agentacw':{'type':Sequelize[_0x281f('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x281f('0x2')]},'reason':{'type':Sequelize[_0x281f('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x281f('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x281f('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x281f('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x281f('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x281f('0x1')]},'connectedlinenum':{'type':Sequelize[_0x281f('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x281f('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x281f('0x1')]},'priority':{'type':Sequelize[_0x281f('0x1')]},'destchannel':{'type':Sequelize[_0x281f('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x281f('0x1')]},'destcalleridname':{'type':Sequelize[_0x281f('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x281f('0x1')]},'destaccountcode':{'type':Sequelize[_0x281f('0x1')]},'destcontext':{'type':Sequelize[_0x281f('0x1')]},'destexten':{'type':Sequelize[_0x281f('0x1')]},'destpriority':{'type':Sequelize[_0x281f('0x1')]},'destuniqueid':{'type':Sequelize[_0x281f('0x1')]},'messageId':{'type':Sequelize[_0x281f('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x281f('0x1')]},'to':{'type':Sequelize[_0x281f('0x1')]},'cc':{'type':Sequelize[_0x281f('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x281f('0x5')]},'status':{'type':Sequelize['ENUM']('SENT',_0x281f('0x6'),'RECEIVED','FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x281f('0x1')]},'appdata':{'type':Sequelize[_0x281f('0x1')]},'projectId':{'type':Sequelize[_0x281f('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index bed11e7..53bf93e 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 _0xd8bf=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','save','update','then','destroy','error','stack','name','index','IntegrationReport','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','type','key','field','merge','options','includeAll','include','findAll','catch','show','length','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','lodash','squel'];(function(_0x53eba7,_0x38744c){var _0x32491b=function(_0x61ea1d){while(--_0x61ea1d){_0x53eba7['push'](_0x53eba7['shift']());}};_0x32491b(++_0x38744c);}(_0xd8bf,0x10e));var _0xfd8b=function(_0x2db935,_0x2eea44){_0x2db935=_0x2db935-0x0;var _0x41db74=_0xd8bf[_0x2db935];return _0x41db74;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfd8b('0x0'));var rimraf=require(_0xfd8b('0x1'));var zipdir=require(_0xfd8b('0x2'));var jsonpatch=require(_0xfd8b('0x3'));var rp=require(_0xfd8b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xfd8b('0x5'));var sox=require(_0xfd8b('0x6'));var csv=require(_0xfd8b('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfd8b('0x8'));var squel=require(_0xfd8b('0x9'));var crypto=require('crypto');var jsforce=require(_0xfd8b('0xa'));var deskjs=require(_0xfd8b('0xb'));var toCsv=require(_0xfd8b('0x7'));var querystring=require(_0xfd8b('0xc'));var Papa=require(_0xfd8b('0xd'));var Redis=require(_0xfd8b('0xe'));var authService=require(_0xfd8b('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xfd8b('0x10'));var logger=require(_0xfd8b('0x11'))(_0xfd8b('0x12'));var utils=require(_0xfd8b('0x13'));var config=require(_0xfd8b('0x14'));var db=require(_0xfd8b('0x15'))['db'];function respondWithStatusCode(_0x20122f,_0x35996b){_0x35996b=_0x35996b||0xcc;return function(_0x55db31){if(_0x55db31){return _0x20122f[_0xfd8b('0x16')](_0x35996b);}return _0x20122f[_0xfd8b('0x17')](_0x35996b)[_0xfd8b('0x18')]();};}function respondWithResult(_0x508234,_0xf87753){_0xf87753=_0xf87753||0xc8;return function(_0x16a863){if(_0x16a863){return _0x508234['status'](_0xf87753)['json'](_0x16a863);}};}function respondWithFilteredResult(_0x598d35,_0x5e2ea3){return function(_0x4870b0){if(_0x4870b0){var _0xf44675=_0x4870b0[_0xfd8b('0x19')],_0x1d2281=_0x5e2ea3['offset'],_0x1340b9=_0x5e2ea3[_0xfd8b('0x1a')]+_0x5e2ea3[_0xfd8b('0x1b')],_0x5440d0;if(_0x1340b9>=_0xf44675){_0x1340b9=_0xf44675;_0x5440d0=0xc8;}else{_0x5440d0=0xce;}_0x598d35[_0xfd8b('0x17')](_0x5440d0);return _0x598d35[_0xfd8b('0x1c')](_0xfd8b('0x1d'),_0x1d2281+'-'+_0x1340b9+'/'+_0xf44675)[_0xfd8b('0x1e')](_0x4870b0);}return null;};}function patchUpdates(_0x5e9a25){return function(_0x5c8a91){try{jsonpatch['apply'](_0x5c8a91,_0x5e9a25,!![]);}catch(_0xc2f196){return BPromise['reject'](_0xc2f196);}return _0x5c8a91[_0xfd8b('0x1f')]();};}function saveUpdates(_0x12c240,_0x72557d){return function(_0x1ee331){if(_0x1ee331){return _0x1ee331[_0xfd8b('0x20')](_0x12c240)[_0xfd8b('0x21')](function(_0x51f8a6){return _0x51f8a6;});}return null;};}function removeEntity(_0x6dcad2,_0x5d3b23){return function(_0x5d237e){if(_0x5d237e){return _0x5d237e[_0xfd8b('0x22')]()[_0xfd8b('0x21')](function(){_0x6dcad2[_0xfd8b('0x17')](0xcc)[_0xfd8b('0x18')]();});}};}function handleEntityNotFound(_0x43d982,_0x95ea61){return function(_0x4678e2){if(!_0x4678e2){_0x43d982[_0xfd8b('0x16')](0x194);}return _0x4678e2;};}function handleError(_0x452116,_0x1d9373){_0x1d9373=_0x1d9373||0x1f4;return function(_0x151278){logger[_0xfd8b('0x23')](_0x151278[_0xfd8b('0x24')]);if(_0x151278[_0xfd8b('0x25')]){delete _0x151278['name'];}_0x452116[_0xfd8b('0x17')](_0x1d9373)['send'](_0x151278);};}exports[_0xfd8b('0x26')]=function(_0x408996,_0x542813){var _0x386f74={},_0x4a536d={},_0x39fefc={'count':0x0,'rows':[]};var _0x4283a6=db[_0xfd8b('0x27')][_0xfd8b('0x28')];_0x4a536d['model']=_[_0xfd8b('0x29')](_0x4283a6);_0x4a536d[_0xfd8b('0x2a')]=_[_0xfd8b('0x29')](_0x408996[_0xfd8b('0x2a')]);_0x4a536d[_0xfd8b('0x2b')]=_[_0xfd8b('0x2c')](_0x4a536d[_0xfd8b('0x2d')],_0x4a536d[_0xfd8b('0x2a')]);_0x386f74['attributes']=_[_0xfd8b('0x2c')](_0x4a536d[_0xfd8b('0x2d')],qs[_0xfd8b('0x2e')](_0x408996[_0xfd8b('0x2a')]['fields']));_0x386f74[_0xfd8b('0x2f')]=_0x386f74[_0xfd8b('0x2f')]['length']?_0x386f74[_0xfd8b('0x2f')]:_0x4a536d[_0xfd8b('0x2d')];if(!_0x408996[_0xfd8b('0x2a')][_0xfd8b('0x30')](_0xfd8b('0x31'))){_0x386f74['limit']=qs['limit'](_0x408996[_0xfd8b('0x2a')][_0xfd8b('0x1b')]);_0x386f74[_0xfd8b('0x1a')]=qs[_0xfd8b('0x1a')](_0x408996[_0xfd8b('0x2a')][_0xfd8b('0x1a')]);}_0x386f74['order']=qs[_0xfd8b('0x32')](_0x408996['query']['sort']);_0x386f74['where']=qs['filters'](_[_0xfd8b('0x33')](_0x408996['query'],_0x4a536d[_0xfd8b('0x2b')]));if(_0x408996[_0xfd8b('0x2a')][_0xfd8b('0x34')]){_0x386f74[_0xfd8b('0x35')]=_['merge'](_0x386f74[_0xfd8b('0x35')],{'$or':_['map'](_0x4283a6,function(_0x1b069a){if(_0x1b069a[_0xfd8b('0x36')][_0xfd8b('0x37')]!=='VIRTUAL'){var _0x1c01f3={};_0x1c01f3[_0x1b069a[_0xfd8b('0x38')]]={'$like':'%'+_0x408996[_0xfd8b('0x2a')]['filter']+'%'};return _0x1c01f3;}})});}_0x386f74=_[_0xfd8b('0x39')]({},_0x386f74,_0x408996[_0xfd8b('0x3a')]);var _0x3cf20b={'where':_0x386f74[_0xfd8b('0x35')]};return db[_0xfd8b('0x27')][_0xfd8b('0x19')](_0x3cf20b)['then'](function(_0x4d24e8){_0x39fefc[_0xfd8b('0x19')]=_0x4d24e8;if(_0x408996[_0xfd8b('0x2a')][_0xfd8b('0x3b')]){_0x386f74[_0xfd8b('0x3c')]=[{'all':!![]}];}return db[_0xfd8b('0x27')][_0xfd8b('0x3d')](_0x386f74);})[_0xfd8b('0x21')](function(_0x2428bc){_0x39fefc['rows']=_0x2428bc;return _0x39fefc;})[_0xfd8b('0x21')](respondWithFilteredResult(_0x542813,_0x386f74))[_0xfd8b('0x3e')](handleError(_0x542813,null));};exports[_0xfd8b('0x3f')]=function(_0x82c4e2,_0x1725f4){var _0x30148c={'raw':![],'where':{'id':_0x82c4e2['params']['id']}},_0x122f57={};_0x122f57['model']=_[_0xfd8b('0x29')](db[_0xfd8b('0x27')][_0xfd8b('0x28')]);_0x122f57[_0xfd8b('0x2a')]=_['keys'](_0x82c4e2[_0xfd8b('0x2a')]);_0x122f57[_0xfd8b('0x2b')]=_[_0xfd8b('0x2c')](_0x122f57[_0xfd8b('0x2d')],_0x122f57[_0xfd8b('0x2a')]);_0x30148c[_0xfd8b('0x2f')]=_[_0xfd8b('0x2c')](_0x122f57['model'],qs[_0xfd8b('0x2e')](_0x82c4e2[_0xfd8b('0x2a')]['fields']));_0x30148c[_0xfd8b('0x2f')]=_0x30148c[_0xfd8b('0x2f')][_0xfd8b('0x40')]?_0x30148c[_0xfd8b('0x2f')]:_0x122f57[_0xfd8b('0x2d')];if(_0x82c4e2[_0xfd8b('0x2a')][_0xfd8b('0x3b')]){_0x30148c[_0xfd8b('0x3c')]=[{'all':!![]}];}_0x30148c=_[_0xfd8b('0x39')]({},_0x30148c,_0x82c4e2[_0xfd8b('0x3a')]);return db[_0xfd8b('0x27')]['find'](_0x30148c)[_0xfd8b('0x21')](handleEntityNotFound(_0x1725f4,null))[_0xfd8b('0x21')](respondWithResult(_0x1725f4,null))[_0xfd8b('0x3e')](handleError(_0x1725f4,null));};exports[_0xfd8b('0x41')]=function(_0x40d6c2,_0x132336){return db['IntegrationReport'][_0xfd8b('0x41')](_0x40d6c2[_0xfd8b('0x42')],{})[_0xfd8b('0x21')](respondWithResult(_0x132336,0xc9))[_0xfd8b('0x3e')](handleError(_0x132336,null));};exports[_0xfd8b('0x20')]=function(_0x267a3f,_0x4732da){if(_0x267a3f[_0xfd8b('0x42')]['id']){delete _0x267a3f[_0xfd8b('0x42')]['id'];}return db[_0xfd8b('0x27')][_0xfd8b('0x43')]({'where':{'id':_0x267a3f['params']['id']}})[_0xfd8b('0x21')](handleEntityNotFound(_0x4732da,null))[_0xfd8b('0x21')](saveUpdates(_0x267a3f['body'],null))[_0xfd8b('0x21')](respondWithResult(_0x4732da,null))[_0xfd8b('0x3e')](handleError(_0x4732da,null));};exports[_0xfd8b('0x22')]=function(_0x50bd88,_0x28f61c){return db['IntegrationReport'][_0xfd8b('0x43')]({'where':{'id':_0x50bd88[_0xfd8b('0x44')]['id']}})['then'](handleEntityNotFound(_0x28f61c,null))[_0xfd8b('0x21')](removeEntity(_0x28f61c,null))[_0xfd8b('0x3e')](handleError(_0x28f61c,null));};exports[_0xfd8b('0x45')]=function(_0x2cd288,_0x41ed27){return db[_0xfd8b('0x27')][_0xfd8b('0x45')]()[_0xfd8b('0x21')](respondWithResult(_0x41ed27,null))[_0xfd8b('0x3e')](handleError(_0x41ed27,null));}; \ No newline at end of file +var _0x9715=['filters','pick','merge','map','type','key','VIRTUAL','field','filter','options','findAll','rows','catch','show','params','create','update','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','reject','save','then','destroy','stack','name','send','index','IntegrationReport','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x526e70,_0x3aeb03){var _0x308bd5=function(_0xc090d9){while(--_0xc090d9){_0x526e70['push'](_0x526e70['shift']());}};_0x308bd5(++_0x3aeb03);}(_0x9715,0x1ca));var _0x5971=function(_0x2757fc,_0xfbd23){_0x2757fc=_0x2757fc-0x0;var _0x58efc4=_0x9715[_0x2757fc];return _0x58efc4;};'use strict';var pdf=require(_0x5971('0x0'));var emlformat=require(_0x5971('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5971('0x2'));var jsonpatch=require(_0x5971('0x3'));var rp=require('request-promise');var moment=require(_0x5971('0x4'));var BPromise=require(_0x5971('0x5'));var Mustache=require(_0x5971('0x6'));var util=require(_0x5971('0x7'));var path=require(_0x5971('0x8'));var sox=require(_0x5971('0x9'));var csv=require(_0x5971('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5971('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5971('0xc'));var Papa=require(_0x5971('0xd'));var Redis=require(_0x5971('0xe'));var authService=require(_0x5971('0xf'));var qs=require(_0x5971('0x10'));var hardwareService=require(_0x5971('0x11'));var logger=require(_0x5971('0x12'))(_0x5971('0x13'));var utils=require(_0x5971('0x14'));var config=require(_0x5971('0x15'));var db=require(_0x5971('0x16'))['db'];function respondWithStatusCode(_0x3f807a,_0x26ed09){_0x26ed09=_0x26ed09||0xcc;return function(_0x41f5c0){if(_0x41f5c0){return _0x3f807a[_0x5971('0x17')](_0x26ed09);}return _0x3f807a[_0x5971('0x18')](_0x26ed09)[_0x5971('0x19')]();};}function respondWithResult(_0x5d03c8,_0x5aadd8){_0x5aadd8=_0x5aadd8||0xc8;return function(_0x5400ea){if(_0x5400ea){return _0x5d03c8[_0x5971('0x18')](_0x5aadd8)['json'](_0x5400ea);}};}function respondWithFilteredResult(_0x3015aa,_0x217c47){return function(_0x3ee170){if(_0x3ee170){var _0xf96f5d=_0x3ee170[_0x5971('0x1a')],_0x3d8c28=_0x217c47[_0x5971('0x1b')],_0x450a01=_0x217c47[_0x5971('0x1b')]+_0x217c47[_0x5971('0x1c')],_0x5cc561;if(_0x450a01>=_0xf96f5d){_0x450a01=_0xf96f5d;_0x5cc561=0xc8;}else{_0x5cc561=0xce;}_0x3015aa[_0x5971('0x18')](_0x5cc561);return _0x3015aa['set'](_0x5971('0x1d'),_0x3d8c28+'-'+_0x450a01+'/'+_0xf96f5d)[_0x5971('0x1e')](_0x3ee170);}return null;};}function patchUpdates(_0x48a297){return function(_0x28bba3){try{jsonpatch['apply'](_0x28bba3,_0x48a297,!![]);}catch(_0x13bcbe){return BPromise[_0x5971('0x1f')](_0x13bcbe);}return _0x28bba3[_0x5971('0x20')]();};}function saveUpdates(_0x1343bf,_0xbc1dcc){return function(_0x5254b1){if(_0x5254b1){return _0x5254b1['update'](_0x1343bf)[_0x5971('0x21')](function(_0x32e22e){return _0x32e22e;});}return null;};}function removeEntity(_0x552c3d,_0x308117){return function(_0x48f111){if(_0x48f111){return _0x48f111[_0x5971('0x22')]()[_0x5971('0x21')](function(){_0x552c3d[_0x5971('0x18')](0xcc)[_0x5971('0x19')]();});}};}function handleEntityNotFound(_0xf7c0e8,_0x4a5fe6){return function(_0x117665){if(!_0x117665){_0xf7c0e8['sendStatus'](0x194);}return _0x117665;};}function handleError(_0x2f9134,_0x218080){_0x218080=_0x218080||0x1f4;return function(_0x2e532c){logger['error'](_0x2e532c[_0x5971('0x23')]);if(_0x2e532c[_0x5971('0x24')]){delete _0x2e532c[_0x5971('0x24')];}_0x2f9134[_0x5971('0x18')](_0x218080)[_0x5971('0x25')](_0x2e532c);};}exports[_0x5971('0x26')]=function(_0x49fefa,_0x357414){var _0x5e7940={},_0x2a67f6={},_0x4d5e0a={'count':0x0,'rows':[]};var _0x69970c=db[_0x5971('0x27')][_0x5971('0x28')];_0x2a67f6['model']=_[_0x5971('0x29')](_0x69970c);_0x2a67f6[_0x5971('0x2a')]=_['keys'](_0x49fefa[_0x5971('0x2a')]);_0x2a67f6['filters']=_[_0x5971('0x2b')](_0x2a67f6[_0x5971('0x2c')],_0x2a67f6[_0x5971('0x2a')]);_0x5e7940[_0x5971('0x2d')]=_['intersection'](_0x2a67f6[_0x5971('0x2c')],qs[_0x5971('0x2e')](_0x49fefa[_0x5971('0x2a')][_0x5971('0x2e')]));_0x5e7940[_0x5971('0x2d')]=_0x5e7940[_0x5971('0x2d')][_0x5971('0x2f')]?_0x5e7940[_0x5971('0x2d')]:_0x2a67f6[_0x5971('0x2c')];if(!_0x49fefa[_0x5971('0x2a')][_0x5971('0x30')](_0x5971('0x31'))){_0x5e7940['limit']=qs['limit'](_0x49fefa[_0x5971('0x2a')][_0x5971('0x1c')]);_0x5e7940[_0x5971('0x1b')]=qs[_0x5971('0x1b')](_0x49fefa[_0x5971('0x2a')][_0x5971('0x1b')]);}_0x5e7940[_0x5971('0x32')]=qs[_0x5971('0x33')](_0x49fefa[_0x5971('0x2a')][_0x5971('0x33')]);_0x5e7940[_0x5971('0x34')]=qs[_0x5971('0x35')](_[_0x5971('0x36')](_0x49fefa[_0x5971('0x2a')],_0x2a67f6[_0x5971('0x35')]));if(_0x49fefa[_0x5971('0x2a')]['filter']){_0x5e7940[_0x5971('0x34')]=_[_0x5971('0x37')](_0x5e7940[_0x5971('0x34')],{'$or':_[_0x5971('0x38')](_0x69970c,function(_0x26a3a1){if(_0x26a3a1[_0x5971('0x39')][_0x5971('0x3a')]!==_0x5971('0x3b')){var _0x59f9e1={};_0x59f9e1[_0x26a3a1[_0x5971('0x3c')]]={'$like':'%'+_0x49fefa[_0x5971('0x2a')][_0x5971('0x3d')]+'%'};return _0x59f9e1;}})});}_0x5e7940=_[_0x5971('0x37')]({},_0x5e7940,_0x49fefa[_0x5971('0x3e')]);var _0x29abf4={'where':_0x5e7940[_0x5971('0x34')]};return db['IntegrationReport'][_0x5971('0x1a')](_0x29abf4)[_0x5971('0x21')](function(_0x1449ff){_0x4d5e0a['count']=_0x1449ff;if(_0x49fefa[_0x5971('0x2a')]['includeAll']){_0x5e7940['include']=[{'all':!![]}];}return db[_0x5971('0x27')][_0x5971('0x3f')](_0x5e7940);})[_0x5971('0x21')](function(_0x10b79a){_0x4d5e0a[_0x5971('0x40')]=_0x10b79a;return _0x4d5e0a;})[_0x5971('0x21')](respondWithFilteredResult(_0x357414,_0x5e7940))[_0x5971('0x41')](handleError(_0x357414,null));};exports[_0x5971('0x42')]=function(_0x5bff5d,_0x3ce40f){var _0x48d298={'raw':![],'where':{'id':_0x5bff5d[_0x5971('0x43')]['id']}},_0x566759={};_0x566759[_0x5971('0x2c')]=_[_0x5971('0x29')](db[_0x5971('0x27')]['rawAttributes']);_0x566759[_0x5971('0x2a')]=_['keys'](_0x5bff5d[_0x5971('0x2a')]);_0x566759['filters']=_['intersection'](_0x566759[_0x5971('0x2c')],_0x566759['query']);_0x48d298[_0x5971('0x2d')]=_[_0x5971('0x2b')](_0x566759['model'],qs[_0x5971('0x2e')](_0x5bff5d['query'][_0x5971('0x2e')]));_0x48d298[_0x5971('0x2d')]=_0x48d298['attributes']['length']?_0x48d298['attributes']:_0x566759[_0x5971('0x2c')];if(_0x5bff5d['query']['includeAll']){_0x48d298['include']=[{'all':!![]}];}_0x48d298=_['merge']({},_0x48d298,_0x5bff5d[_0x5971('0x3e')]);return db[_0x5971('0x27')]['find'](_0x48d298)[_0x5971('0x21')](handleEntityNotFound(_0x3ce40f,null))[_0x5971('0x21')](respondWithResult(_0x3ce40f,null))[_0x5971('0x41')](handleError(_0x3ce40f,null));};exports[_0x5971('0x44')]=function(_0x3a8a9f,_0x5e0790){return db[_0x5971('0x27')][_0x5971('0x44')](_0x3a8a9f['body'],{})['then'](respondWithResult(_0x5e0790,0xc9))[_0x5971('0x41')](handleError(_0x5e0790,null));};exports[_0x5971('0x45')]=function(_0x2a148f,_0x51eeb8){if(_0x2a148f[_0x5971('0x46')]['id']){delete _0x2a148f['body']['id'];}return db['IntegrationReport'][_0x5971('0x47')]({'where':{'id':_0x2a148f[_0x5971('0x43')]['id']}})[_0x5971('0x21')](handleEntityNotFound(_0x51eeb8,null))[_0x5971('0x21')](saveUpdates(_0x2a148f['body'],null))['then'](respondWithResult(_0x51eeb8,null))['catch'](handleError(_0x51eeb8,null));};exports[_0x5971('0x22')]=function(_0x5221c0,_0x4af536){return db[_0x5971('0x27')][_0x5971('0x47')]({'where':{'id':_0x5221c0[_0x5971('0x43')]['id']}})[_0x5971('0x21')](handleEntityNotFound(_0x4af536,null))[_0x5971('0x21')](removeEntity(_0x4af536,null))[_0x5971('0x41')](handleError(_0x4af536,null));};exports[_0x5971('0x48')]=function(_0x223096,_0x4f1cc7){return db[_0x5971('0x27')][_0x5971('0x48')]()[_0x5971('0x21')](respondWithResult(_0x4f1cc7,null))[_0x5971('0x41')](handleError(_0x4f1cc7,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index e10f0c4..3fc2261 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 _0xe7ba=['../../config/environment','./integrationReport.attributes','exports','define','report_integration','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x1723af,_0x4db22d){var _0x4fba65=function(_0x1c2136){while(--_0x1c2136){_0x1723af['push'](_0x1723af['shift']());}};_0x4fba65(++_0x4db22d);}(_0xe7ba,0xd6));var _0xae7b=function(_0x54fc68,_0x4d6cd3){_0x54fc68=_0x54fc68-0x0;var _0x23d6d8=_0xe7ba[_0x54fc68];return _0x23d6d8;};'use strict';var _=require('lodash');var util=require(_0xae7b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xae7b('0x1'));var BPromise=require(_0xae7b('0x2'));var rp=require(_0xae7b('0x3'));var fs=require('fs');var path=require(_0xae7b('0x4'));var rimraf=require(_0xae7b('0x5'));var config=require(_0xae7b('0x6'));var attributes=require(_0xae7b('0x7'));module[_0xae7b('0x8')]=function(_0x1fadca,_0x2e75c2){return _0x1fadca[_0xae7b('0x9')]('IntegrationReport',attributes,{'tableName':_0xae7b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x78c6=['api','moment','bluebird','request-promise','path','rimraf','./integrationReport.attributes','exports','IntegrationReport','lodash','util'];(function(_0x5b9586,_0x1665cf){var _0x563916=function(_0x11734e){while(--_0x11734e){_0x5b9586['push'](_0x5b9586['shift']());}};_0x563916(++_0x1665cf);}(_0x78c6,0x153));var _0x678c=function(_0x456db2,_0x4d30df){_0x456db2=_0x456db2-0x0;var _0x1217aa=_0x78c6[_0x456db2];return _0x1217aa;};'use strict';var _=require(_0x678c('0x0'));var util=require(_0x678c('0x1'));var logger=require('../../config/logger')(_0x678c('0x2'));var moment=require(_0x678c('0x3'));var BPromise=require(_0x678c('0x4'));var rp=require(_0x678c('0x5'));var fs=require('fs');var path=require(_0x678c('0x6'));var rimraf=require(_0x678c('0x7'));var config=require('../../config/environment');var attributes=require(_0x678c('0x8'));module[_0x678c('0x9')]=function(_0x5659a7,_0x5026cc){return _0x5659a7['define'](_0x678c('0xa'),attributes,{'tableName':'report_integration','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 0d8f05a..ba8326f 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 _0x8603=['message','info','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8603,0x190));var _0x3860=function(_0x8b3eae,_0x2fb0b2){_0x8b3eae=_0x8b3eae-0x0;var _0x55a650=_0x8603[_0x8b3eae];return _0x55a650;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1eca44,_0xd3ce26,_0x472bf2){return new BPromise(function(_0x4aba10,_0x5c7350){return client['request'](_0x1eca44,_0x472bf2)[_0x3860('0x9')](function(_0x441dc4){logger['info'](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));logger['debug'](_0x3860('0xc'),_0xd3ce26,_0x3860('0xb'),JSON['stringify'](_0x441dc4));if(_0x441dc4[_0x3860('0xd')]){if(_0x441dc4[_0x3860('0xd')]['code']===0x1f4){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x5c7350(_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);}logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x4aba10(_0x441dc4['error'][_0x3860('0xe')]);}else{logger[_0x3860('0xf')](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));_0x4aba10(_0x441dc4[_0x3860('0x10')][_0x3860('0xe')]);}})[_0x3860('0x11')](function(_0x378305){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x378305);_0x5c7350(_0x378305);});});} \ No newline at end of file +var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x45146f,_0x459616){var _0x41cb84=function(_0x3b953c){while(--_0x3b953c){_0x45146f['push'](_0x45146f['shift']());}};_0x41cb84(++_0x459616);}(_0xb10b,0x12a));var _0xbb10=function(_0x5f519b,_0x5b606f){_0x5f519b=_0x5f519b-0x0;var _0x2461e2=_0xb10b[_0x5f519b];return _0x2461e2;};'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 diff --git a/server/api/interval/index.js b/server/api/interval/index.js index ee1e7b1..453713b 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 _0x7217=['multer','path','connect-timeout','express','Router','../../components/auth/service','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','destroy','exports'];(function(_0x4ab9f0,_0x548c3c){var _0x364cbc=function(_0x193c1c){while(--_0x193c1c){_0x4ab9f0['push'](_0x4ab9f0['shift']());}};_0x364cbc(++_0x548c3c);}(_0x7217,0x19e));var _0x7721=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7217[_0x2dafbe];return _0x58a45a;};'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')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0x9')]);router[_0x7721('0x7')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0xb')]);router[_0x7721('0x7')](_0x7721('0xc'),auth[_0x7721('0x8')](),controller[_0x7721('0xd')]);router[_0x7721('0xe')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0xf')]);router['post'](_0x7721('0xc'),auth[_0x7721('0x8')](),controller[_0x7721('0x10')]);router[_0x7721('0xe')](_0x7721('0x11'),auth[_0x7721('0x8')](),controller[_0x7721('0x12')]);router[_0x7721('0x13')]('/:id',auth[_0x7721('0x8')](),controller[_0x7721('0x14')]);router['delete'](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x15')]);module[_0x7721('0x16')]=router; \ No newline at end of file +var _0x008c=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','exports','multer','util','path','connect-timeout'];(function(_0x2fdc7d,_0x3fcdeb){var _0x4a0e9d=function(_0xb4971){while(--_0xb4971){_0x2fdc7d['push'](_0x2fdc7d['shift']());}};_0x4a0e9d(++_0x3fcdeb);}(_0x008c,0x188));var _0xc008=function(_0x471273,_0x1587f1){_0x471273=_0x471273-0x0;var _0x56c63e=_0x008c[_0x471273];return _0x56c63e;};'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['getIntervals']);router[_0xc008('0xf')]('/',auth[_0xc008('0xa')](),controller['create']);router['post']('/:id/sub_intervals',auth[_0xc008('0xa')](),controller[_0xc008('0x10')]);router['post'](_0xc008('0x11'),auth[_0xc008('0xa')](),controller[_0xc008('0x12')]);router[_0xc008('0x13')](_0xc008('0xc'),auth[_0xc008('0xa')](),controller[_0xc008('0x14')]);router['delete']('/:id',auth[_0xc008('0xa')](),controller['destroy']);module[_0xc008('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 e75faa0..01dd2f6 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 _0x07d8=['STRING','exports'];(function(_0x2002f0,_0x465e18){var _0x5d0653=function(_0x5e50bc){while(--_0x5e50bc){_0x2002f0['push'](_0x2002f0['shift']());}};_0x5d0653(++_0x465e18);}(_0x07d8,0x95));var _0x807d=function(_0xc3745e,_0x5bb692){_0xc3745e=_0xc3745e-0x0;var _0x1c1b31=_0x07d8[_0xc3745e];return _0x1c1b31;};'use strict';var Sequelize=require('sequelize');module[_0x807d('0x0')]={'name':{'type':Sequelize[_0x807d('0x1')]},'description':{'type':Sequelize[_0x807d('0x1')]},'interval':{'type':Sequelize[_0x807d('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xb184=['exports','STRING','sequelize'];(function(_0x2a19c1,_0x56d2cb){var _0x1b69e0=function(_0x51db98){while(--_0x51db98){_0x2a19c1['push'](_0x2a19c1['shift']());}};_0x1b69e0(++_0x56d2cb);}(_0xb184,0x1d9));var _0x4b18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb184[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4b18('0x0'));module[_0x4b18('0x1')]={'name':{'type':Sequelize[_0x4b18('0x2')]},'description':{'type':Sequelize[_0x4b18('0x2')]},'interval':{'type':Sequelize[_0x4b18('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 06f6b85..34aa611 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 _0x5af2=['request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','get','then','error','name','index','Interval','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','catch','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Intervals','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','hasOwnProperty','sequelize','transaction','html-pdf','eml-format','rimraf'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x5af2,0xfc));var _0x25af=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5af2[_0x19950b];return _0x3c6b41;};'use strict';var pdf=require(_0x25af('0x0'));var emlformat=require(_0x25af('0x1'));var rimraf=require(_0x25af('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x25af('0x3'));var moment=require(_0x25af('0x4'));var BPromise=require(_0x25af('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x25af('0x6'));var csv=require(_0x25af('0x7'));var ejs=require(_0x25af('0x8'));var fs=require('fs');var _=require(_0x25af('0x9'));var squel=require(_0x25af('0xa'));var crypto=require(_0x25af('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x25af('0xc'));var toCsv=require(_0x25af('0x7'));var querystring=require('querystring');var Papa=require(_0x25af('0xd'));var Redis=require(_0x25af('0xe'));var authService=require(_0x25af('0xf'));var qs=require(_0x25af('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x25af('0x11'))(_0x25af('0x12'));var utils=require(_0x25af('0x13'));var config=require(_0x25af('0x14'));var db=require(_0x25af('0x15'))['db'];var extensions=require(_0x25af('0x16'));function respondWithStatusCode(_0x417e74,_0x3ca243){_0x3ca243=_0x3ca243||0xcc;return function(_0x3fd48c){if(_0x3fd48c){return _0x417e74[_0x25af('0x17')](_0x3ca243);}return _0x417e74[_0x25af('0x18')](_0x3ca243)[_0x25af('0x19')]();};}function respondWithResult(_0xabb238,_0x914a3b){_0x914a3b=_0x914a3b||0xc8;return function(_0x411d94){if(_0x411d94){return _0xabb238[_0x25af('0x18')](_0x914a3b)[_0x25af('0x1a')](_0x411d94);}};}function respondWithFilteredResult(_0x1a82d9,_0x7cc9b2){return function(_0x439f21){if(_0x439f21){var _0x269164=_0x439f21[_0x25af('0x1b')],_0x325a89=_0x7cc9b2[_0x25af('0x1c')],_0x4e5479=_0x7cc9b2[_0x25af('0x1c')]+_0x7cc9b2[_0x25af('0x1d')],_0x226b59;if(_0x4e5479>=_0x269164){_0x4e5479=_0x269164;_0x226b59=0xc8;}else{_0x226b59=0xce;}_0x1a82d9[_0x25af('0x18')](_0x226b59);return _0x1a82d9[_0x25af('0x1e')](_0x25af('0x1f'),_0x325a89+'-'+_0x4e5479+'/'+_0x269164)[_0x25af('0x1a')](_0x439f21);}return null;};}function patchUpdates(_0x5bb989){return function(_0x33bc38){try{jsonpatch[_0x25af('0x20')](_0x33bc38,_0x5bb989,!![]);}catch(_0x3381dd){return BPromise['reject'](_0x3381dd);}return _0x33bc38[_0x25af('0x21')]();};}function saveUpdates(_0x62e5d0,_0x2b69f7){return function(_0x3985df){if(_0x3985df){return _0x3985df[_0x25af('0x22')](_0x62e5d0)['then'](function(_0x494e09){return _0x494e09;});}return null;};}function removeEntity(_0x499d52,_0x242e21){return function(_0x275fec){if(_0x275fec){return _0x275fec[_0x25af('0x23')]()['then'](function(){var _0x509418=_0x275fec[_0x25af('0x24')]({'plain':!![]});var _0x1244bf='Intervals';return db['UserProfileResource']['destroy']({'where':{'type':_0x1244bf,'resourceId':_0x509418['id']}})[_0x25af('0x25')](function(){return _0x275fec;});})['then'](function(){_0x499d52[_0x25af('0x18')](0xcc)[_0x25af('0x19')]();});}};}function handleEntityNotFound(_0x5ab9c0,_0x49b35a){return function(_0xca462b){if(!_0xca462b){_0x5ab9c0[_0x25af('0x17')](0x194);}return _0xca462b;};}function handleError(_0x3eb637,_0x28299d){_0x28299d=_0x28299d||0x1f4;return function(_0x58a325){logger[_0x25af('0x26')](_0x58a325['stack']);if(_0x58a325[_0x25af('0x27')]){delete _0x58a325[_0x25af('0x27')];}_0x3eb637[_0x25af('0x18')](_0x28299d)['send'](_0x58a325);};}exports[_0x25af('0x28')]=function(_0x8fff8d,_0x3c330c){var _0x34545c={},_0x181098={},_0x3171d6={'count':0x0,'rows':[]};var _0x5c3023=db[_0x25af('0x29')][_0x25af('0x2a')];_0x181098[_0x25af('0x2b')]=_['keys'](_0x5c3023);_0x181098['query']=_[_0x25af('0x2c')](_0x8fff8d[_0x25af('0x2d')]);_0x181098[_0x25af('0x2e')]=_[_0x25af('0x2f')](_0x181098[_0x25af('0x2b')],_0x181098[_0x25af('0x2d')]);_0x34545c[_0x25af('0x30')]=_['intersection'](_0x181098[_0x25af('0x2b')],qs[_0x25af('0x31')](_0x8fff8d['query'][_0x25af('0x31')]));_0x34545c[_0x25af('0x30')]=_0x34545c[_0x25af('0x30')]['length']?_0x34545c[_0x25af('0x30')]:_0x181098[_0x25af('0x2b')];if(!_0x8fff8d[_0x25af('0x2d')]['hasOwnProperty'](_0x25af('0x32'))){_0x34545c[_0x25af('0x1d')]=qs[_0x25af('0x1d')](_0x8fff8d[_0x25af('0x2d')][_0x25af('0x1d')]);_0x34545c['offset']=qs[_0x25af('0x1c')](_0x8fff8d[_0x25af('0x2d')][_0x25af('0x1c')]);}_0x34545c[_0x25af('0x33')]=qs[_0x25af('0x34')](_0x8fff8d['query']['sort']);_0x34545c[_0x25af('0x35')]=qs[_0x25af('0x2e')](_['pick'](_0x8fff8d['query'],_0x181098[_0x25af('0x2e')]));if(_0x8fff8d['query'][_0x25af('0x36')]){_0x34545c[_0x25af('0x35')]=_[_0x25af('0x37')](_0x34545c[_0x25af('0x35')],{'$or':_[_0x25af('0x38')](_0x5c3023,function(_0x24630b){if(_0x24630b['type'][_0x25af('0x39')]!==_0x25af('0x3a')){var _0x4953cd={};_0x4953cd[_0x24630b[_0x25af('0x3b')]]={'$like':'%'+_0x8fff8d[_0x25af('0x2d')][_0x25af('0x36')]+'%'};return _0x4953cd;}})});}_0x34545c=_[_0x25af('0x37')]({},_0x34545c,_0x8fff8d[_0x25af('0x3c')]);var _0x662b57={'where':_0x34545c[_0x25af('0x35')]};return db[_0x25af('0x29')][_0x25af('0x1b')](_0x662b57)[_0x25af('0x25')](function(_0x4fd2d9){_0x3171d6['count']=_0x4fd2d9;if(_0x8fff8d[_0x25af('0x2d')][_0x25af('0x3d')]){_0x34545c[_0x25af('0x3e')]=[{'all':!![]}];}return db[_0x25af('0x29')][_0x25af('0x3f')](_0x34545c);})[_0x25af('0x25')](function(_0x2798c9){_0x3171d6['rows']=_0x2798c9;return _0x3171d6;})[_0x25af('0x25')](respondWithFilteredResult(_0x3c330c,_0x34545c))[_0x25af('0x40')](handleError(_0x3c330c,null));};exports[_0x25af('0x41')]=function(_0x40fe9a,_0x2c6af9){var _0x461d49={'raw':!![],'where':{'id':_0x40fe9a[_0x25af('0x42')]['id']}},_0x6d0c75={};_0x6d0c75[_0x25af('0x2b')]=_[_0x25af('0x2c')](db[_0x25af('0x29')][_0x25af('0x2a')]);_0x6d0c75[_0x25af('0x2d')]=_['keys'](_0x40fe9a[_0x25af('0x2d')]);_0x6d0c75[_0x25af('0x2e')]=_['intersection'](_0x6d0c75[_0x25af('0x2b')],_0x6d0c75['query']);_0x461d49[_0x25af('0x30')]=_['intersection'](_0x6d0c75[_0x25af('0x2b')],qs[_0x25af('0x31')](_0x40fe9a[_0x25af('0x2d')]['fields']));_0x461d49[_0x25af('0x30')]=_0x461d49[_0x25af('0x30')][_0x25af('0x43')]?_0x461d49[_0x25af('0x30')]:_0x6d0c75[_0x25af('0x2b')];if(_0x40fe9a[_0x25af('0x2d')][_0x25af('0x3d')]){_0x461d49['include']=[{'all':!![]}];}_0x461d49=_[_0x25af('0x37')]({},_0x461d49,_0x40fe9a[_0x25af('0x3c')]);return db[_0x25af('0x29')][_0x25af('0x44')](_0x461d49)['then'](handleEntityNotFound(_0x2c6af9,null))[_0x25af('0x25')](respondWithResult(_0x2c6af9,null))[_0x25af('0x40')](handleError(_0x2c6af9,null));};exports[_0x25af('0x45')]=function(_0x13ebea,_0x4c430e){return db[_0x25af('0x29')][_0x25af('0x45')](_0x13ebea[_0x25af('0x46')],{})[_0x25af('0x25')](function(_0x34b4e6){var _0x2df8d9=_0x13ebea['user'][_0x25af('0x24')]({'plain':!![]});if(!_0x2df8d9)throw new Error(_0x25af('0x47'));if(_0x2df8d9['role']===_0x25af('0x48')){var _0xe756e6=_0x34b4e6[_0x25af('0x24')]({'plain':!![]});var _0x267a31=_0x25af('0x49');return db[_0x25af('0x4a')][_0x25af('0x44')]({'where':{'name':_0x267a31,'userProfileId':_0x2df8d9[_0x25af('0x4b')]},'raw':!![]})[_0x25af('0x25')](function(_0x5634e8){if(_0x5634e8&&_0x5634e8[_0x25af('0x4c')]===0x0){return db['UserProfileResource'][_0x25af('0x45')]({'name':_0xe756e6['name'],'resourceId':_0xe756e6['id'],'type':_0x5634e8[_0x25af('0x27')],'sectionId':_0x5634e8['id']},{})[_0x25af('0x25')](function(){return _0x34b4e6;});}else{return _0x34b4e6;}})['catch'](function(_0x34c2eb){logger[_0x25af('0x26')](_0x25af('0x4d'),_0x34c2eb);throw _0x34c2eb;});}return _0x34b4e6;})['then'](respondWithResult(_0x4c430e,0xc9))[_0x25af('0x40')](handleError(_0x4c430e,null));};exports[_0x25af('0x22')]=function(_0x39e0ff,_0x2d00a0){if(_0x39e0ff['body']['id']){delete _0x39e0ff['body']['id'];}return db[_0x25af('0x29')]['find']({'where':{'id':_0x39e0ff[_0x25af('0x42')]['id']}})[_0x25af('0x25')](handleEntityNotFound(_0x2d00a0,null))[_0x25af('0x25')](saveUpdates(_0x39e0ff[_0x25af('0x46')],null))['then'](respondWithResult(_0x2d00a0,null))[_0x25af('0x40')](handleError(_0x2d00a0,null));};exports[_0x25af('0x23')]=function(_0x28ffa3,_0x202d61){return db[_0x25af('0x29')][_0x25af('0x44')]({'where':{'id':_0x28ffa3[_0x25af('0x42')]['id']}})[_0x25af('0x25')](handleEntityNotFound(_0x202d61,null))[_0x25af('0x25')](removeEntity(_0x202d61,null))[_0x25af('0x40')](handleError(_0x202d61,null));};exports[_0x25af('0x4e')]=function(_0x56de1e,_0x520a29,_0x132b73){if(_0x56de1e['body']['id']){delete _0x56de1e[_0x25af('0x46')]['id'];}return db['Interval'][_0x25af('0x44')]({'where':{'id':_0x56de1e[_0x25af('0x42')]['id']}})[_0x25af('0x25')](handleEntityNotFound(_0x520a29,null))[_0x25af('0x25')](function(_0x3ae355){if(_0x3ae355){_0x56de1e['body'][_0x25af('0x4f')]=_0x3ae355['id'];return db['Interval']['create'](_0x56de1e[_0x25af('0x46')]);}})[_0x25af('0x25')](respondWithResult(_0x520a29,null))[_0x25af('0x40')](handleError(_0x520a29,null));};exports[_0x25af('0x50')]=function(_0x6fd2f5,_0x4cfc60,_0xce2356){var _0x227f29={};var _0x3012ac={};var _0x2c820e;var _0x211e89;return db[_0x25af('0x29')][_0x25af('0x51')]({'where':{'id':_0x6fd2f5[_0x25af('0x42')]['id']}})['then'](handleEntityNotFound(_0x4cfc60,null))[_0x25af('0x25')](function(_0x2142d8){if(_0x2142d8){_0x2c820e=_0x2142d8;_0x3012ac['model']=_[_0x25af('0x2c')](db[_0x25af('0x29')]['rawAttributes']);_0x3012ac[_0x25af('0x2d')]=_['keys'](_0x6fd2f5[_0x25af('0x2d')]);_0x3012ac[_0x25af('0x2e')]=_[_0x25af('0x2f')](_0x3012ac[_0x25af('0x2b')],_0x3012ac[_0x25af('0x2d')]);_0x227f29[_0x25af('0x30')]=_['intersection'](_0x3012ac[_0x25af('0x2b')],qs[_0x25af('0x31')](_0x6fd2f5[_0x25af('0x2d')][_0x25af('0x31')]));_0x227f29[_0x25af('0x30')]=_0x227f29['attributes'][_0x25af('0x43')]?_0x227f29['attributes']:_0x3012ac[_0x25af('0x2b')];_0x227f29['order']=qs[_0x25af('0x34')](_0x6fd2f5[_0x25af('0x2d')]['sort']);_0x227f29[_0x25af('0x35')]=qs['filters'](_['pick'](_0x6fd2f5['query'],_0x3012ac[_0x25af('0x2e')]));if(_0x6fd2f5[_0x25af('0x2d')][_0x25af('0x36')]){_0x227f29['where']=_[_0x25af('0x37')](_0x227f29[_0x25af('0x35')],{'$or':_[_0x25af('0x38')](_0x227f29[_0x25af('0x30')],function(_0x452fc5){var _0x115cc7={};_0x115cc7[_0x452fc5]={'$like':'%'+_0x6fd2f5[_0x25af('0x2d')][_0x25af('0x36')]+'%'};return _0x115cc7;})});}_0x227f29=_[_0x25af('0x37')]({},_0x227f29,_0x6fd2f5[_0x25af('0x3c')]);return _0x2c820e['getIntervals'](_0x227f29);}})['then'](function(_0x303dff){if(_0x303dff){_0x211e89=_0x303dff[_0x25af('0x43')];if(!_0x6fd2f5[_0x25af('0x2d')][_0x25af('0x52')](_0x25af('0x32'))){_0x227f29[_0x25af('0x1d')]=qs[_0x25af('0x1d')](_0x6fd2f5[_0x25af('0x2d')]['limit']);_0x227f29[_0x25af('0x1c')]=qs['offset'](_0x6fd2f5[_0x25af('0x2d')][_0x25af('0x1c')]);}return _0x2c820e['getIntervals'](_0x227f29);}})[_0x25af('0x25')](function(_0x39c3f2){if(_0x39c3f2){return _0x39c3f2?{'count':_0x211e89,'rows':_0x39c3f2}:null;}})['then'](respondWithResult(_0x4cfc60,null))['catch'](handleError(_0x4cfc60,null));};exports['addIntervals']=function(_0x2635fb,_0x744d3,_0x2f6225){return db[_0x25af('0x29')][_0x25af('0x51')]({'where':{'id':_0x2635fb[_0x25af('0x42')]['id']}})[_0x25af('0x25')](handleEntityNotFound(_0x744d3,null))[_0x25af('0x25')](function(_0x1c36d4){if(_0x1c36d4){return db[_0x25af('0x53')][_0x25af('0x54')](function(_0x4bd585){return db[_0x25af('0x29')][_0x25af('0x23')]({'where':{'IntervalId':_0x2635fb[_0x25af('0x42')]['id']},'transaction':_0x4bd585})['then'](function(_0x2ace42){var _0x2bd203=_['map'](_0x2635fb[_0x25af('0x46')],function(_0x5e9258){delete _0x5e9258['id'];_0x5e9258[_0x25af('0x4f')]=_0x2635fb[_0x25af('0x42')]['id'];return _0x5e9258;});return db[_0x25af('0x29')]['bulkCreate'](_0x2bd203,{'transaction':_0x4bd585});});})[_0x25af('0x25')](function(){return db[_0x25af('0x29')]['findAll']({'where':{'IntervalId':_0x2635fb[_0x25af('0x42')]['id']}});});}})[_0x25af('0x25')](respondWithResult(_0x744d3,null))['catch'](handleError(_0x744d3,null));}; \ No newline at end of file +var _0xf883=['squel','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','count','offset','set','apply','reject','save','then','Intervals','UserProfileResource','destroy','stack','name','send','index','Interval','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','includeAll','findAll','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval','getIntervals','findOne','pick','sequelize','transaction','IntervalId','bulkCreate','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x43c040,_0x3fe3d7){var _0x280d9e=function(_0x386a82){while(--_0x386a82){_0x43c040['push'](_0x43c040['shift']());}};_0x280d9e(++_0x3fe3d7);}(_0xf883,0x101));var _0x3f88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf883[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x3f88('0x0'));var emlformat=require(_0x3f88('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3f88('0x2'));var jsonpatch=require(_0x3f88('0x3'));var rp=require('request-promise');var moment=require(_0x3f88('0x4'));var BPromise=require(_0x3f88('0x5'));var Mustache=require(_0x3f88('0x6'));var util=require(_0x3f88('0x7'));var path=require(_0x3f88('0x8'));var sox=require(_0x3f88('0x9'));var csv=require(_0x3f88('0xa'));var ejs=require(_0x3f88('0xb'));var fs=require('fs');var _=require(_0x3f88('0xc'));var squel=require(_0x3f88('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3f88('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3f88('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3f88('0x10'));var hardwareService=require(_0x3f88('0x11'));var logger=require('../../config/logger')(_0x3f88('0x12'));var utils=require(_0x3f88('0x13'));var config=require(_0x3f88('0x14'));var db=require(_0x3f88('0x15'))['db'];var extensions=require(_0x3f88('0x16'));function respondWithStatusCode(_0x2f5343,_0xe8d2d6){_0xe8d2d6=_0xe8d2d6||0xcc;return function(_0x438005){if(_0x438005){return _0x2f5343[_0x3f88('0x17')](_0xe8d2d6);}return _0x2f5343['status'](_0xe8d2d6)[_0x3f88('0x18')]();};}function respondWithResult(_0x29f386,_0x4660ae){_0x4660ae=_0x4660ae||0xc8;return function(_0x42e0c8){if(_0x42e0c8){return _0x29f386[_0x3f88('0x19')](_0x4660ae)[_0x3f88('0x1a')](_0x42e0c8);}};}function respondWithFilteredResult(_0x3dc83d,_0x17cf1d){return function(_0x187eb7){if(_0x187eb7){var _0xd7b5e2=_0x187eb7[_0x3f88('0x1b')],_0x522a20=_0x17cf1d[_0x3f88('0x1c')],_0x529795=_0x17cf1d[_0x3f88('0x1c')]+_0x17cf1d['limit'],_0x3d4b8a;if(_0x529795>=_0xd7b5e2){_0x529795=_0xd7b5e2;_0x3d4b8a=0xc8;}else{_0x3d4b8a=0xce;}_0x3dc83d[_0x3f88('0x19')](_0x3d4b8a);return _0x3dc83d[_0x3f88('0x1d')]('Content-Range',_0x522a20+'-'+_0x529795+'/'+_0xd7b5e2)[_0x3f88('0x1a')](_0x187eb7);}return null;};}function patchUpdates(_0x327a63){return function(_0x2a946){try{jsonpatch[_0x3f88('0x1e')](_0x2a946,_0x327a63,!![]);}catch(_0x3a67a6){return BPromise[_0x3f88('0x1f')](_0x3a67a6);}return _0x2a946[_0x3f88('0x20')]();};}function saveUpdates(_0xa1524d,_0x57e98c){return function(_0x4d2d34){if(_0x4d2d34){return _0x4d2d34['update'](_0xa1524d)[_0x3f88('0x21')](function(_0x2e5e5a){return _0x2e5e5a;});}return null;};}function removeEntity(_0x16aa7a,_0x581d0a){return function(_0x2189ce){if(_0x2189ce){return _0x2189ce['destroy']()[_0x3f88('0x21')](function(){var _0x1a099e=_0x2189ce['get']({'plain':!![]});var _0x1a559c=_0x3f88('0x22');return db[_0x3f88('0x23')][_0x3f88('0x24')]({'where':{'type':_0x1a559c,'resourceId':_0x1a099e['id']}})[_0x3f88('0x21')](function(){return _0x2189ce;});})[_0x3f88('0x21')](function(){_0x16aa7a[_0x3f88('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d8ff9,_0x2f00da){return function(_0x1b4635){if(!_0x1b4635){_0x4d8ff9['sendStatus'](0x194);}return _0x1b4635;};}function handleError(_0x26e806,_0x39ea22){_0x39ea22=_0x39ea22||0x1f4;return function(_0x3c6749){logger['error'](_0x3c6749[_0x3f88('0x25')]);if(_0x3c6749[_0x3f88('0x26')]){delete _0x3c6749[_0x3f88('0x26')];}_0x26e806['status'](_0x39ea22)[_0x3f88('0x27')](_0x3c6749);};}exports[_0x3f88('0x28')]=function(_0x4f5b35,_0x42027e){var _0x33d29e={},_0x525ab4={},_0x2fcc38={'count':0x0,'rows':[]};var _0x1a01f0=db[_0x3f88('0x29')][_0x3f88('0x2a')];_0x525ab4[_0x3f88('0x2b')]=_[_0x3f88('0x2c')](_0x1a01f0);_0x525ab4[_0x3f88('0x2d')]=_[_0x3f88('0x2c')](_0x4f5b35[_0x3f88('0x2d')]);_0x525ab4[_0x3f88('0x2e')]=_['intersection'](_0x525ab4['model'],_0x525ab4[_0x3f88('0x2d')]);_0x33d29e[_0x3f88('0x2f')]=_[_0x3f88('0x30')](_0x525ab4['model'],qs[_0x3f88('0x31')](_0x4f5b35[_0x3f88('0x2d')][_0x3f88('0x31')]));_0x33d29e[_0x3f88('0x2f')]=_0x33d29e[_0x3f88('0x2f')][_0x3f88('0x32')]?_0x33d29e[_0x3f88('0x2f')]:_0x525ab4[_0x3f88('0x2b')];if(!_0x4f5b35[_0x3f88('0x2d')][_0x3f88('0x33')]('nolimit')){_0x33d29e['limit']=qs[_0x3f88('0x34')](_0x4f5b35[_0x3f88('0x2d')][_0x3f88('0x34')]);_0x33d29e[_0x3f88('0x1c')]=qs[_0x3f88('0x1c')](_0x4f5b35['query'][_0x3f88('0x1c')]);}_0x33d29e[_0x3f88('0x35')]=qs[_0x3f88('0x36')](_0x4f5b35[_0x3f88('0x2d')]['sort']);_0x33d29e[_0x3f88('0x37')]=qs['filters'](_['pick'](_0x4f5b35[_0x3f88('0x2d')],_0x525ab4[_0x3f88('0x2e')]));if(_0x4f5b35[_0x3f88('0x2d')][_0x3f88('0x38')]){_0x33d29e[_0x3f88('0x37')]=_[_0x3f88('0x39')](_0x33d29e['where'],{'$or':_[_0x3f88('0x3a')](_0x1a01f0,function(_0x5c6122){if(_0x5c6122[_0x3f88('0x3b')][_0x3f88('0x3c')]!==_0x3f88('0x3d')){var _0x178cf9={};_0x178cf9[_0x5c6122[_0x3f88('0x3e')]]={'$like':'%'+_0x4f5b35[_0x3f88('0x2d')][_0x3f88('0x38')]+'%'};return _0x178cf9;}})});}_0x33d29e=_[_0x3f88('0x39')]({},_0x33d29e,_0x4f5b35['options']);var _0x1e3d8c={'where':_0x33d29e[_0x3f88('0x37')]};return db['Interval'][_0x3f88('0x1b')](_0x1e3d8c)[_0x3f88('0x21')](function(_0x1a0691){_0x2fcc38['count']=_0x1a0691;if(_0x4f5b35['query'][_0x3f88('0x3f')]){_0x33d29e['include']=[{'all':!![]}];}return db[_0x3f88('0x29')][_0x3f88('0x40')](_0x33d29e);})[_0x3f88('0x21')](function(_0x189d57){_0x2fcc38['rows']=_0x189d57;return _0x2fcc38;})[_0x3f88('0x21')](respondWithFilteredResult(_0x42027e,_0x33d29e))[_0x3f88('0x41')](handleError(_0x42027e,null));};exports[_0x3f88('0x42')]=function(_0xc2fe96,_0x34159c){var _0x2a7392={'raw':!![],'where':{'id':_0xc2fe96[_0x3f88('0x43')]['id']}},_0x401401={};_0x401401[_0x3f88('0x2b')]=_[_0x3f88('0x2c')](db['Interval'][_0x3f88('0x2a')]);_0x401401['query']=_[_0x3f88('0x2c')](_0xc2fe96[_0x3f88('0x2d')]);_0x401401['filters']=_[_0x3f88('0x30')](_0x401401[_0x3f88('0x2b')],_0x401401['query']);_0x2a7392[_0x3f88('0x2f')]=_[_0x3f88('0x30')](_0x401401[_0x3f88('0x2b')],qs[_0x3f88('0x31')](_0xc2fe96[_0x3f88('0x2d')][_0x3f88('0x31')]));_0x2a7392['attributes']=_0x2a7392[_0x3f88('0x2f')]['length']?_0x2a7392[_0x3f88('0x2f')]:_0x401401[_0x3f88('0x2b')];if(_0xc2fe96[_0x3f88('0x2d')][_0x3f88('0x3f')]){_0x2a7392['include']=[{'all':!![]}];}_0x2a7392=_['merge']({},_0x2a7392,_0xc2fe96[_0x3f88('0x44')]);return db[_0x3f88('0x29')][_0x3f88('0x45')](_0x2a7392)[_0x3f88('0x21')](handleEntityNotFound(_0x34159c,null))[_0x3f88('0x21')](respondWithResult(_0x34159c,null))[_0x3f88('0x41')](handleError(_0x34159c,null));};exports[_0x3f88('0x46')]=function(_0x2ab4d3,_0x124ffb){return db['Interval']['create'](_0x2ab4d3[_0x3f88('0x47')],{})[_0x3f88('0x21')](function(_0x14de22){var _0x2a8d48=_0x2ab4d3['user']['get']({'plain':!![]});if(!_0x2a8d48)throw new Error(_0x3f88('0x48'));if(_0x2a8d48[_0x3f88('0x49')]===_0x3f88('0x4a')){var _0x474a18=_0x14de22[_0x3f88('0x4b')]({'plain':!![]});var _0x28682f=_0x3f88('0x22');return db[_0x3f88('0x4c')]['find']({'where':{'name':_0x28682f,'userProfileId':_0x2a8d48[_0x3f88('0x4d')]},'raw':!![]})[_0x3f88('0x21')](function(_0x5ac506){if(_0x5ac506&&_0x5ac506[_0x3f88('0x4e')]===0x0){return db['UserProfileResource'][_0x3f88('0x46')]({'name':_0x474a18[_0x3f88('0x26')],'resourceId':_0x474a18['id'],'type':_0x5ac506['name'],'sectionId':_0x5ac506['id']},{})[_0x3f88('0x21')](function(){return _0x14de22;});}else{return _0x14de22;}})[_0x3f88('0x41')](function(_0x447f33){logger[_0x3f88('0x4f')](_0x3f88('0x50'),_0x447f33);throw _0x447f33;});}return _0x14de22;})[_0x3f88('0x21')](respondWithResult(_0x124ffb,0xc9))['catch'](handleError(_0x124ffb,null));};exports[_0x3f88('0x51')]=function(_0x19ab9c,_0x2bf247){if(_0x19ab9c[_0x3f88('0x47')]['id']){delete _0x19ab9c[_0x3f88('0x47')]['id'];}return db['Interval']['find']({'where':{'id':_0x19ab9c[_0x3f88('0x43')]['id']}})[_0x3f88('0x21')](handleEntityNotFound(_0x2bf247,null))[_0x3f88('0x21')](saveUpdates(_0x19ab9c[_0x3f88('0x47')],null))[_0x3f88('0x21')](respondWithResult(_0x2bf247,null))[_0x3f88('0x41')](handleError(_0x2bf247,null));};exports['destroy']=function(_0x4266c5,_0x416c29){return db[_0x3f88('0x29')][_0x3f88('0x45')]({'where':{'id':_0x4266c5[_0x3f88('0x43')]['id']}})[_0x3f88('0x21')](handleEntityNotFound(_0x416c29,null))[_0x3f88('0x21')](removeEntity(_0x416c29,null))[_0x3f88('0x41')](handleError(_0x416c29,null));};exports[_0x3f88('0x52')]=function(_0x1e0fea,_0x3a5cb6,_0x4caaad){if(_0x1e0fea[_0x3f88('0x47')]['id']){delete _0x1e0fea[_0x3f88('0x47')]['id'];}return db['Interval'][_0x3f88('0x45')]({'where':{'id':_0x1e0fea[_0x3f88('0x43')]['id']}})[_0x3f88('0x21')](handleEntityNotFound(_0x3a5cb6,null))[_0x3f88('0x21')](function(_0x27f554){if(_0x27f554){_0x1e0fea[_0x3f88('0x47')]['IntervalId']=_0x27f554['id'];return db[_0x3f88('0x29')][_0x3f88('0x46')](_0x1e0fea['body']);}})[_0x3f88('0x21')](respondWithResult(_0x3a5cb6,null))[_0x3f88('0x41')](handleError(_0x3a5cb6,null));};exports[_0x3f88('0x53')]=function(_0x54923d,_0x340d95,_0x5ced0e){var _0x438c7b={};var _0x5769e8={};var _0x38d4d3;var _0x2b5938;return db[_0x3f88('0x29')][_0x3f88('0x54')]({'where':{'id':_0x54923d[_0x3f88('0x43')]['id']}})[_0x3f88('0x21')](handleEntityNotFound(_0x340d95,null))['then'](function(_0x25aa28){if(_0x25aa28){_0x38d4d3=_0x25aa28;_0x5769e8[_0x3f88('0x2b')]=_[_0x3f88('0x2c')](db['Interval'][_0x3f88('0x2a')]);_0x5769e8[_0x3f88('0x2d')]=_[_0x3f88('0x2c')](_0x54923d[_0x3f88('0x2d')]);_0x5769e8[_0x3f88('0x2e')]=_[_0x3f88('0x30')](_0x5769e8[_0x3f88('0x2b')],_0x5769e8['query']);_0x438c7b[_0x3f88('0x2f')]=_[_0x3f88('0x30')](_0x5769e8[_0x3f88('0x2b')],qs[_0x3f88('0x31')](_0x54923d[_0x3f88('0x2d')][_0x3f88('0x31')]));_0x438c7b['attributes']=_0x438c7b[_0x3f88('0x2f')][_0x3f88('0x32')]?_0x438c7b[_0x3f88('0x2f')]:_0x5769e8[_0x3f88('0x2b')];_0x438c7b[_0x3f88('0x35')]=qs['sort'](_0x54923d[_0x3f88('0x2d')][_0x3f88('0x36')]);_0x438c7b[_0x3f88('0x37')]=qs[_0x3f88('0x2e')](_[_0x3f88('0x55')](_0x54923d['query'],_0x5769e8[_0x3f88('0x2e')]));if(_0x54923d['query'][_0x3f88('0x38')]){_0x438c7b[_0x3f88('0x37')]=_[_0x3f88('0x39')](_0x438c7b['where'],{'$or':_[_0x3f88('0x3a')](_0x438c7b[_0x3f88('0x2f')],function(_0x2ce04b){var _0x4c4304={};_0x4c4304[_0x2ce04b]={'$like':'%'+_0x54923d['query']['filter']+'%'};return _0x4c4304;})});}_0x438c7b=_[_0x3f88('0x39')]({},_0x438c7b,_0x54923d[_0x3f88('0x44')]);return _0x38d4d3[_0x3f88('0x53')](_0x438c7b);}})[_0x3f88('0x21')](function(_0x5116ba){if(_0x5116ba){_0x2b5938=_0x5116ba[_0x3f88('0x32')];if(!_0x54923d[_0x3f88('0x2d')]['hasOwnProperty']('nolimit')){_0x438c7b[_0x3f88('0x34')]=qs[_0x3f88('0x34')](_0x54923d['query'][_0x3f88('0x34')]);_0x438c7b[_0x3f88('0x1c')]=qs[_0x3f88('0x1c')](_0x54923d[_0x3f88('0x2d')][_0x3f88('0x1c')]);}return _0x38d4d3['getIntervals'](_0x438c7b);}})['then'](function(_0x12e36e){if(_0x12e36e){return _0x12e36e?{'count':_0x2b5938,'rows':_0x12e36e}:null;}})[_0x3f88('0x21')](respondWithResult(_0x340d95,null))['catch'](handleError(_0x340d95,null));};exports['addIntervals']=function(_0x4f4348,_0x4fd93a,_0x449840){return db['Interval']['findOne']({'where':{'id':_0x4f4348[_0x3f88('0x43')]['id']}})[_0x3f88('0x21')](handleEntityNotFound(_0x4fd93a,null))[_0x3f88('0x21')](function(_0x5d4b4b){if(_0x5d4b4b){return db[_0x3f88('0x56')][_0x3f88('0x57')](function(_0x3feeff){return db['Interval'][_0x3f88('0x24')]({'where':{'IntervalId':_0x4f4348['params']['id']},'transaction':_0x3feeff})['then'](function(_0x579b9f){var _0x5b4abc=_['map'](_0x4f4348[_0x3f88('0x47')],function(_0x5365c6){delete _0x5365c6['id'];_0x5365c6[_0x3f88('0x58')]=_0x4f4348[_0x3f88('0x43')]['id'];return _0x5365c6;});return db[_0x3f88('0x29')][_0x3f88('0x59')](_0x5b4abc,{'transaction':_0x3feeff});});})[_0x3f88('0x21')](function(){return db[_0x3f88('0x29')][_0x3f88('0x40')]({'where':{'IntervalId':_0x4f4348[_0x3f88('0x43')]['id']}});});}})[_0x3f88('0x21')](respondWithResult(_0x4fd93a,null))['catch'](handleError(_0x4fd93a,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index be749bd..5e05676 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 _0x74a1=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x74a1,0xff));var _0x174a=function(_0x5a03fa,_0xcf3275){_0x5a03fa=_0x5a03fa-0x0;var _0x29e6c2=_0x74a1[_0x5a03fa];return _0x29e6c2;};'use strict';var _=require(_0x174a('0x0'));var util=require(_0x174a('0x1'));var logger=require('../../config/logger')(_0x174a('0x2'));var moment=require('moment');var BPromise=require(_0x174a('0x3'));var rp=require(_0x174a('0x4'));var fs=require('fs');var path=require(_0x174a('0x5'));var rimraf=require(_0x174a('0x6'));var config=require(_0x174a('0x7'));var attributes=require(_0x174a('0x8'));var extensions=require(_0x174a('0x9'));module[_0x174a('0xa')]=function(_0x3d3656,_0x3297b6){return _0x3d3656[_0x174a('0xb')](_0x174a('0xc'),attributes,{'tableName':_0x174a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a4bf7,_0x157538){extensions[_0x174a('0xe')](_0x3d3656,_0x2a4bf7);},'afterBulkCreate':function(_0x1f1a52,_0x352f20,_0x1e69f7){_0x1e69f7();extensions[_0x174a('0xe')](_0x3d3656,_0x1f1a52[0x0]);},'afterUpdate':function(_0x459c10,_0x2d18f8){extensions[_0x174a('0xe')](_0x3d3656,_0x459c10);},'afterDestroy':function(_0x28fb10,_0x33d275){extensions[_0x174a('0xe')](_0x3d3656,_0x28fb10);}}});}; \ No newline at end of file +var _0x7633=['moment','request-promise','path','../../config/environment','./interval.attributes','define','Interval','rewrite','lodash','util','../../config/logger','api'];(function(_0x5382f0,_0x2f03d3){var _0x56386e=function(_0x126d91){while(--_0x126d91){_0x5382f0['push'](_0x5382f0['shift']());}};_0x56386e(++_0x2f03d3);}(_0x7633,0x1c4));var _0x3763=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x7633[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x3763('0x0'));var util=require(_0x3763('0x1'));var logger=require(_0x3763('0x2'))(_0x3763('0x3'));var moment=require(_0x3763('0x4'));var BPromise=require('bluebird');var rp=require(_0x3763('0x5'));var fs=require('fs');var path=require(_0x3763('0x6'));var rimraf=require('rimraf');var config=require(_0x3763('0x7'));var attributes=require(_0x3763('0x8'));var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x396634,_0x8a2d3e){return _0x396634[_0x3763('0x9')](_0x3763('0xa'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x550b39,_0x232c86){extensions[_0x3763('0xb')](_0x396634,_0x550b39);},'afterBulkCreate':function(_0x4aa292,_0x5c872d,_0x44dc63){_0x44dc63();extensions[_0x3763('0xb')](_0x396634,_0x4aa292[0x0]);},'afterUpdate':function(_0x401909,_0x29ec1c){extensions[_0x3763('0xb')](_0x396634,_0x401909);},'afterDestroy':function(_0x7335b9,_0x8fc2be){extensions['rewrite'](_0x396634,_0x7335b9);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 4550201..240049e 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 _0x4f30=['code','message','result','catch','GetInterval','Interval','findAll','options','where','attributes','limit','include','map','model','then','find','raw','ShowInterval','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','info','Interval,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x2bca8b,_0x10422d){var _0x4c971e=function(_0x5a94e9){while(--_0x5a94e9){_0x2bca8b['push'](_0x2bca8b['shift']());}};_0x4c971e(++_0x10422d);}(_0x4f30,0x144));var _0x04f3=function(_0x30714a,_0x5da31d){_0x30714a=_0x30714a-0x0;var _0xd6ff66=_0x4f30[_0x30714a];return _0xd6ff66;};'use strict';var _=require('lodash');var util=require(_0x04f3('0x0'));var moment=require(_0x04f3('0x1'));var BPromise=require(_0x04f3('0x2'));var rs=require(_0x04f3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x04f3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x04f3('0x5'))('rpc');var config=require(_0x04f3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x04f3('0x7')][_0x04f3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc54a83,_0x50f2a0,_0x25fc15){return new BPromise(function(_0x179b62,_0x10ad5d){return client[_0x04f3('0x9')](_0xc54a83,_0x25fc15)['then'](function(_0xe7d36){logger[_0x04f3('0xa')](_0x04f3('0xb'),_0x50f2a0,_0x04f3('0xc'));logger[_0x04f3('0xd')]('Interval,\x20%s,\x20%s,\x20%s',_0x50f2a0,_0x04f3('0xc'),JSON[_0x04f3('0xe')](_0xe7d36));if(_0xe7d36[_0x04f3('0xf')]){if(_0xe7d36[_0x04f3('0xf')][_0x04f3('0x10')]===0x1f4){logger[_0x04f3('0xf')](_0x04f3('0xb'),_0x50f2a0,_0xe7d36[_0x04f3('0xf')][_0x04f3('0x11')]);return _0x10ad5d(_0xe7d36['error'][_0x04f3('0x11')]);}logger[_0x04f3('0xf')]('Interval,\x20%s,\x20%s',_0x50f2a0,_0xe7d36[_0x04f3('0xf')][_0x04f3('0x11')]);return _0x179b62(_0xe7d36[_0x04f3('0xf')][_0x04f3('0x11')]);}else{logger[_0x04f3('0xa')](_0x04f3('0xb'),_0x50f2a0,_0x04f3('0xc'));_0x179b62(_0xe7d36[_0x04f3('0x12')][_0x04f3('0x11')]);}})[_0x04f3('0x13')](function(_0x233982){logger[_0x04f3('0xf')](_0x04f3('0xb'),_0x50f2a0,_0x233982);_0x10ad5d(_0x233982);});});}exports[_0x04f3('0x14')]=function(_0x4f921a){var _0x4ccccb=this;return new Promise(function(_0x563fb8,_0x9fc4d2){return db[_0x04f3('0x15')][_0x04f3('0x16')]({'raw':_0x4f921a[_0x04f3('0x17')]?_0x4f921a[_0x04f3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4f921a[_0x04f3('0x17')]?_0x4f921a['options'][_0x04f3('0x18')]||null:null,'attributes':_0x4f921a['options']?_0x4f921a[_0x04f3('0x17')][_0x04f3('0x19')]||null:null,'limit':_0x4f921a[_0x04f3('0x17')]?_0x4f921a[_0x04f3('0x17')][_0x04f3('0x1a')]||null:null,'include':_0x4f921a[_0x04f3('0x17')]?_0x4f921a['options'][_0x04f3('0x1b')]?_[_0x04f3('0x1c')](_0x4f921a[_0x04f3('0x17')][_0x04f3('0x1b')],function(_0x30ff33){return{'model':db[_0x30ff33[_0x04f3('0x1d')]],'as':_0x30ff33['as'],'attributes':_0x30ff33[_0x04f3('0x19')],'include':_0x30ff33[_0x04f3('0x1b')]?_[_0x04f3('0x1c')](_0x30ff33['include'],function(_0x1c934c){return{'model':db[_0x1c934c['model']],'as':_0x1c934c['as'],'attributes':_0x1c934c[_0x04f3('0x19')],'include':_0x1c934c[_0x04f3('0x1b')]?_[_0x04f3('0x1c')](_0x1c934c[_0x04f3('0x1b')],function(_0x3674d6){return{'model':db[_0x3674d6[_0x04f3('0x1d')]],'as':_0x3674d6['as'],'attributes':_0x3674d6[_0x04f3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x04f3('0x1e')](function(_0x2c51c8){logger[_0x04f3('0xa')]('GetInterval',_0x4f921a);logger['debug'](_0x04f3('0x14'),_0x4f921a,JSON[_0x04f3('0xe')](_0x2c51c8));_0x563fb8(_0x2c51c8);})[_0x04f3('0x13')](function(_0x131961){logger['error'](_0x04f3('0x14'),_0x131961[_0x04f3('0x11')],_0x4f921a);_0x9fc4d2(_0x4ccccb[_0x04f3('0xf')](0x1f4,_0x131961[_0x04f3('0x11')]));});});};exports['ShowInterval']=function(_0x376935){var _0x6f8df8=this;return new Promise(function(_0x1af318,_0x45368c){return db['Interval'][_0x04f3('0x1f')]({'raw':_0x376935['options']?_0x376935['options'][_0x04f3('0x20')]===undefined?!![]:![]:!![],'where':_0x376935[_0x04f3('0x17')]?_0x376935[_0x04f3('0x17')][_0x04f3('0x18')]||null:null,'attributes':_0x376935['options']?_0x376935[_0x04f3('0x17')][_0x04f3('0x19')]||null:null,'include':_0x376935[_0x04f3('0x17')]?_0x376935[_0x04f3('0x17')]['include']?_['map'](_0x376935['options'][_0x04f3('0x1b')],function(_0x358f1c){return{'model':db[_0x358f1c[_0x04f3('0x1d')]],'as':_0x358f1c['as'],'attributes':_0x358f1c['attributes'],'include':_0x358f1c[_0x04f3('0x1b')]?_[_0x04f3('0x1c')](_0x358f1c[_0x04f3('0x1b')],function(_0x2f7e8b){return{'model':db[_0x2f7e8b[_0x04f3('0x1d')]],'as':_0x2f7e8b['as'],'attributes':_0x2f7e8b[_0x04f3('0x19')],'include':_0x2f7e8b[_0x04f3('0x1b')]?_[_0x04f3('0x1c')](_0x2f7e8b[_0x04f3('0x1b')],function(_0x5dc233){return{'model':db[_0x5dc233[_0x04f3('0x1d')]],'as':_0x5dc233['as'],'attributes':_0x5dc233[_0x04f3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x04f3('0x1e')](function(_0xee98f8){logger['info'](_0x04f3('0x21'),_0x376935);logger['debug'](_0x04f3('0x21'),_0x376935,JSON['stringify'](_0xee98f8));_0x1af318(_0xee98f8);})[_0x04f3('0x13')](function(_0x73122a){logger['error'](_0x04f3('0x21'),_0x73122a[_0x04f3('0x11')],_0x376935);_0x45368c(_0x6f8df8[_0x04f3('0xf')](0x1f4,_0x73122a[_0x04f3('0x11')]));});});}; \ No newline at end of file +var _0x63ca=['model','ShowInterval','find','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','debug','Interval,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Interval,\x20%s,\x20%s','message','result','catch','GetInterval','Interval','findAll','options','raw','where','attributes','include','map'];(function(_0x536425,_0x57c4c5){var _0x6a868e=function(_0x5bd26e){while(--_0x5bd26e){_0x536425['push'](_0x536425['shift']());}};_0x6a868e(++_0x57c4c5);}(_0x63ca,0x12c));var _0xa63c=function(_0x50e8ae,_0x39549c){_0x50e8ae=_0x50e8ae-0x0;var _0x3e6c4c=_0x63ca[_0x50e8ae];return _0x3e6c4c;};'use strict';var _=require('lodash');var util=require(_0xa63c('0x0'));var moment=require('moment');var BPromise=require(_0xa63c('0x1'));var rs=require(_0xa63c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa63c('0x3'))['db'];var utils=require(_0xa63c('0x4'));var logger=require(_0xa63c('0x5'))('rpc');var config=require(_0xa63c('0x6'));var jayson=require(_0xa63c('0x7'));var client=jayson[_0xa63c('0x8')][_0xa63c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x283d2b,_0x277ae4,_0x46e7a1){return new BPromise(function(_0x320e94,_0x7513a){return client['request'](_0x283d2b,_0x46e7a1)[_0xa63c('0xa')](function(_0x428558){logger[_0xa63c('0xb')]('Interval,\x20%s,\x20%s',_0x277ae4,'request\x20sent');logger[_0xa63c('0xc')](_0xa63c('0xd'),_0x277ae4,_0xa63c('0xe'),JSON[_0xa63c('0xf')](_0x428558));if(_0x428558[_0xa63c('0x10')]){if(_0x428558[_0xa63c('0x10')]['code']===0x1f4){logger['error'](_0xa63c('0x11'),_0x277ae4,_0x428558[_0xa63c('0x10')][_0xa63c('0x12')]);return _0x7513a(_0x428558[_0xa63c('0x10')][_0xa63c('0x12')]);}logger[_0xa63c('0x10')](_0xa63c('0x11'),_0x277ae4,_0x428558[_0xa63c('0x10')][_0xa63c('0x12')]);return _0x320e94(_0x428558[_0xa63c('0x10')]['message']);}else{logger[_0xa63c('0xb')](_0xa63c('0x11'),_0x277ae4,_0xa63c('0xe'));_0x320e94(_0x428558[_0xa63c('0x13')][_0xa63c('0x12')]);}})[_0xa63c('0x14')](function(_0x2cf5e0){logger[_0xa63c('0x10')]('Interval,\x20%s,\x20%s',_0x277ae4,_0x2cf5e0);_0x7513a(_0x2cf5e0);});});}exports[_0xa63c('0x15')]=function(_0x32f3f6){var _0x29303b=this;return new Promise(function(_0x6edec5,_0x3cb1e2){return db[_0xa63c('0x16')][_0xa63c('0x17')]({'raw':_0x32f3f6[_0xa63c('0x18')]?_0x32f3f6[_0xa63c('0x18')][_0xa63c('0x19')]===undefined?!![]:![]:!![],'where':_0x32f3f6[_0xa63c('0x18')]?_0x32f3f6['options'][_0xa63c('0x1a')]||null:null,'attributes':_0x32f3f6[_0xa63c('0x18')]?_0x32f3f6[_0xa63c('0x18')][_0xa63c('0x1b')]||null:null,'limit':_0x32f3f6[_0xa63c('0x18')]?_0x32f3f6[_0xa63c('0x18')]['limit']||null:null,'include':_0x32f3f6[_0xa63c('0x18')]?_0x32f3f6[_0xa63c('0x18')][_0xa63c('0x1c')]?_[_0xa63c('0x1d')](_0x32f3f6[_0xa63c('0x18')][_0xa63c('0x1c')],function(_0x533d4d){return{'model':db[_0x533d4d['model']],'as':_0x533d4d['as'],'attributes':_0x533d4d[_0xa63c('0x1b')],'include':_0x533d4d['include']?_[_0xa63c('0x1d')](_0x533d4d[_0xa63c('0x1c')],function(_0x31f6ac){return{'model':db[_0x31f6ac[_0xa63c('0x1e')]],'as':_0x31f6ac['as'],'attributes':_0x31f6ac[_0xa63c('0x1b')],'include':_0x31f6ac['include']?_[_0xa63c('0x1d')](_0x31f6ac['include'],function(_0x145ee7){return{'model':db[_0x145ee7[_0xa63c('0x1e')]],'as':_0x145ee7['as'],'attributes':_0x145ee7[_0xa63c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa63c('0xa')](function(_0x4ba4a3){logger[_0xa63c('0xb')](_0xa63c('0x15'),_0x32f3f6);logger[_0xa63c('0xc')](_0xa63c('0x15'),_0x32f3f6,JSON[_0xa63c('0xf')](_0x4ba4a3));_0x6edec5(_0x4ba4a3);})[_0xa63c('0x14')](function(_0x1a4095){logger[_0xa63c('0x10')](_0xa63c('0x15'),_0x1a4095['message'],_0x32f3f6);_0x3cb1e2(_0x29303b[_0xa63c('0x10')](0x1f4,_0x1a4095[_0xa63c('0x12')]));});});};exports[_0xa63c('0x1f')]=function(_0x267541){var _0x356830=this;return new Promise(function(_0x3d0dd2,_0x557b83){return db[_0xa63c('0x16')][_0xa63c('0x20')]({'raw':_0x267541['options']?_0x267541[_0xa63c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x267541['options']?_0x267541[_0xa63c('0x18')][_0xa63c('0x1a')]||null:null,'attributes':_0x267541[_0xa63c('0x18')]?_0x267541['options'][_0xa63c('0x1b')]||null:null,'include':_0x267541[_0xa63c('0x18')]?_0x267541['options'][_0xa63c('0x1c')]?_[_0xa63c('0x1d')](_0x267541[_0xa63c('0x18')][_0xa63c('0x1c')],function(_0x46a79b){return{'model':db[_0x46a79b[_0xa63c('0x1e')]],'as':_0x46a79b['as'],'attributes':_0x46a79b[_0xa63c('0x1b')],'include':_0x46a79b[_0xa63c('0x1c')]?_[_0xa63c('0x1d')](_0x46a79b[_0xa63c('0x1c')],function(_0x2ccc4d){return{'model':db[_0x2ccc4d[_0xa63c('0x1e')]],'as':_0x2ccc4d['as'],'attributes':_0x2ccc4d['attributes'],'include':_0x2ccc4d[_0xa63c('0x1c')]?_[_0xa63c('0x1d')](_0x2ccc4d['include'],function(_0x367438){return{'model':db[_0x367438[_0xa63c('0x1e')]],'as':_0x367438['as'],'attributes':_0x367438['attributes']};}):[]};}):[]};}):[]:[]})[_0xa63c('0xa')](function(_0x5118b8){logger[_0xa63c('0xb')](_0xa63c('0x1f'),_0x267541);logger[_0xa63c('0xc')]('ShowInterval',_0x267541,JSON[_0xa63c('0xf')](_0x5118b8));_0x3d0dd2(_0x5118b8);})['catch'](function(_0x22997c){logger[_0xa63c('0x10')](_0xa63c('0x1f'),_0x22997c[_0xa63c('0x12')],_0x267541);_0x557b83(_0x356830[_0xa63c('0x10')](0x1f4,_0x22997c[_0xa63c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 094625b..908ac52 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 _0x5565=['Router','./jira.controller','isAuthenticated','send','exports'];(function(_0x44bfef,_0x399046){var _0x38a406=function(_0x5e7995){while(--_0x5e7995){_0x44bfef['push'](_0x44bfef['shift']());}};_0x38a406(++_0x399046);}(_0x5565,0x104));var _0x5556=function(_0x39d75c,_0x245e75){_0x39d75c=_0x39d75c-0x0;var _0xca8554=_0x5565[_0x39d75c];return _0xca8554;};'use strict';var express=require('express');var router=express[_0x5556('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5556('0x1'));router['post']('/',auth[_0x5556('0x2')](),controller[_0x5556('0x3')]);module[_0x5556('0x4')]=router; \ No newline at end of file +var _0xb39f=['exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x5326dc,_0x526083){var _0x27da77=function(_0x24e25d){while(--_0x24e25d){_0x5326dc['push'](_0x5326dc['shift']());}};_0x27da77(++_0x526083);}(_0xb39f,0x1e6));var _0xfb39=function(_0x2bc672,_0x45795c){_0x2bc672=_0x2bc672-0x0;var _0x527c5f=_0xb39f[_0x2bc672];return _0x527c5f;};'use strict';var express=require(_0xfb39('0x0'));var router=express[_0xfb39('0x1')]();var auth=require(_0xfb39('0x2'));var controller=require(_0xfb39('0x3'));router['post']('/',auth['isAuthenticated'](),controller['send']);module[_0xfb39('0x4')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 2d37ed5..eb40dfc 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 _0xbcbd=['/rest/api/2/issue','POST','application/json','Basic\x20','toString','request','setEncoding','utf8','end','status','json','api.jira','write','send','headers','connection','remoteAddress','socket','body','bluebird','https','../../config/logger','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','description','stringify','issuetype','customfield_11500','email','fields','customfield_11501','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com'];(function(_0x90f681,_0x535a04){var _0xdd5181=function(_0xfe2013){while(--_0xfe2013){_0x90f681['push'](_0x90f681['shift']());}};_0xdd5181(++_0x535a04);}(_0xbcbd,0x1b7));var _0xdbcb=function(_0x582628,_0x45dc5d){_0x582628=_0x582628-0x0;var _0x4dfea5=_0xbcbd[_0x582628];return _0x4dfea5;};'use strict';var BPromise=require(_0xdbcb('0x0'));var https=require(_0xdbcb('0x1'));var logger=require(_0xdbcb('0x2'))('api');var USERNAME=_0xdbcb('0x3');var PASSWORD=_0xdbcb('0x4');function openIssue(_0x2bd959,_0x58a591){var _0x4e2104={'fields':{'project':{'key':_0x2bd959[_0xdbcb('0x5')]||_0xdbcb('0x6')},'summary':(_0x2bd959['summary']||_0xdbcb('0x7'))+_0xdbcb('0x8')+_0x2bd959['ip'],'description':_0x2bd959[_0xdbcb('0x9')]||JSON[_0xdbcb('0xa')](_0x2bd959),'issuetype':{'name':_0x2bd959[_0xdbcb('0xb')]||'Bug'}}};_0x4e2104['fields'][_0xdbcb('0xc')]=_0x2bd959[_0xdbcb('0xd')];_0x4e2104[_0xdbcb('0xe')][_0xdbcb('0xf')]=_0x2bd959['oldToken'];_0x4e2104[_0xdbcb('0xe')]['customfield_11502']=_0x2bd959[_0xdbcb('0x10')];_0x4e2104['fields'][_0xdbcb('0x11')]=_0x2bd959[_0xdbcb('0x12')];_0x4e2104[_0xdbcb('0xe')][_0xdbcb('0x13')]=_0x2bd959[_0xdbcb('0x14')];_0x4e2104['fields'][_0xdbcb('0x15')]=_0x2bd959['ip'];var _0x565a80={'host':_0xdbcb('0x16'),'port':0x1bb,'path':_0xdbcb('0x17'),'method':_0xdbcb('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0xdbcb('0x19'),'Authorization':_0xdbcb('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0xdbcb('0x1b')]('base64')}};var _0x41dabf=JSON[_0xdbcb('0xa')](_0x4e2104);var _0x18807b=https[_0xdbcb('0x1c')](_0x565a80,function(_0xd15375){_0xd15375[_0xdbcb('0x1d')](_0xdbcb('0x1e'));var _0x12016f='';_0xd15375['on']('data',function(_0x4a3ee2){_0x12016f+=_0x4a3ee2;});_0xd15375['on'](_0xdbcb('0x1f'),function(){if(_0x58a591){return _0x58a591[_0xdbcb('0x20')](_0xd15375['statusCode'])[_0xdbcb('0x21')](JSON['parse'](_0x12016f));}});});_0x18807b['on']('error',function(_0x1a6503){if(_0x58a591){return _0x58a591[_0xdbcb('0x20')](0x1f4)[_0xdbcb('0x21')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xdbcb('0x22')}]});}});_0x18807b[_0xdbcb('0x23')](_0x41dabf);_0x18807b[_0xdbcb('0x1f')]();}exports['openIssue']=openIssue;exports[_0xdbcb('0x24')]=function(_0x1314f1,_0x585914){_0x1314f1['body']['ip']=_0x1314f1[_0xdbcb('0x25')]['x-forwarded-for']||_0x1314f1[_0xdbcb('0x26')][_0xdbcb('0x27')]||_0x1314f1['socket'][_0xdbcb('0x27')]||_0x1314f1['connection'][_0xdbcb('0x28')][_0xdbcb('0x27')];return openIssue(_0x1314f1[_0xdbcb('0x29')],_0x585914);}; \ No newline at end of file +var _0xce50=['\x20from\x20','description','stringify','Bug','fields','oldToken','newToken','customfield_11503','name','customfield_11504','customfield_10102','/rest/api/2/issue','POST','application/json','toString','base64','request','utf8','data','status','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','send','body','headers','connection','socket','remoteAddress','https','api','key','summary'];(function(_0x14c0b6,_0x570e94){var _0x1a34f5=function(_0x573c40){while(--_0x573c40){_0x14c0b6['push'](_0x14c0b6['shift']());}};_0x1a34f5(++_0x570e94);}(_0xce50,0x1c3));var _0x0ce5=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xce50[_0x1203f];return _0x365f0a;};'use strict';var BPromise=require('bluebird');var https=require(_0x0ce5('0x0'));var logger=require('../../config/logger')(_0x0ce5('0x1'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x4b6910,_0x66337e){var _0x5d3cc2={'fields':{'project':{'key':_0x4b6910[_0x0ce5('0x2')]||'MOTGUI'},'summary':(_0x4b6910[_0x0ce5('0x3')]||'Report')+_0x0ce5('0x4')+_0x4b6910['ip'],'description':_0x4b6910[_0x0ce5('0x5')]||JSON[_0x0ce5('0x6')](_0x4b6910),'issuetype':{'name':_0x4b6910['issuetype']||_0x0ce5('0x7')}}};_0x5d3cc2[_0x0ce5('0x8')]['customfield_11500']=_0x4b6910['email'];_0x5d3cc2['fields']['customfield_11501']=_0x4b6910[_0x0ce5('0x9')];_0x5d3cc2[_0x0ce5('0x8')]['customfield_11502']=_0x4b6910[_0x0ce5('0xa')];_0x5d3cc2['fields'][_0x0ce5('0xb')]=_0x4b6910[_0x0ce5('0xc')];_0x5d3cc2['fields'][_0x0ce5('0xd')]=_0x4b6910['reason'];_0x5d3cc2[_0x0ce5('0x8')][_0x0ce5('0xe')]=_0x4b6910['ip'];var _0x3ee668={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x0ce5('0xf'),'method':_0x0ce5('0x10'),'timeout':0x4e20,'headers':{'Content-Type':_0x0ce5('0x11'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x0ce5('0x12')](_0x0ce5('0x13'))}};var _0x400ccd=JSON['stringify'](_0x5d3cc2);var _0x3045e3=https[_0x0ce5('0x14')](_0x3ee668,function(_0x5abe96){_0x5abe96['setEncoding'](_0x0ce5('0x15'));var _0x2991c2='';_0x5abe96['on'](_0x0ce5('0x16'),function(_0x144a6b){_0x2991c2+=_0x144a6b;});_0x5abe96['on']('end',function(){if(_0x66337e){return _0x66337e[_0x0ce5('0x17')](_0x5abe96['statusCode'])['json'](JSON[_0x0ce5('0x18')](_0x2991c2));}});});_0x3045e3['on']('error',function(_0x54c55d){if(_0x66337e){return _0x66337e[_0x0ce5('0x17')](0x1f4)['json']({'errors':[{'message':_0x0ce5('0x19'),'type':_0x0ce5('0x1a')}]});}});_0x3045e3[_0x0ce5('0x1b')](_0x400ccd);_0x3045e3[_0x0ce5('0x1c')]();}exports['openIssue']=openIssue;exports[_0x0ce5('0x1d')]=function(_0x5c9ad9,_0x2ac96a){_0x5c9ad9[_0x0ce5('0x1e')]['ip']=_0x5c9ad9[_0x0ce5('0x1f')]['x-forwarded-for']||_0x5c9ad9[_0x0ce5('0x20')]['remoteAddress']||_0x5c9ad9[_0x0ce5('0x21')][_0x0ce5('0x22')]||_0x5c9ad9[_0x0ce5('0x20')]['socket'][_0x0ce5('0x22')];return openIssue(_0x5c9ad9[_0x0ce5('0x1e')],_0x2ac96a);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 7e97a48..f8f0f0a 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 _0xa82f=['../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','post','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x2f2fd3,_0x1c3aef){var _0x5a854e=function(_0x3905dc){while(--_0x3905dc){_0x2f2fd3['push'](_0x2f2fd3['shift']());}};_0x5a854e(++_0x1c3aef);}(_0xa82f,0xa5));var _0xfa82=function(_0x20b696,_0x334435){_0x20b696=_0x20b696-0x0;var _0x2ecf64=_0xa82f[_0x20b696];return _0x2ecf64;};'use strict';var multer=require('multer');var util=require(_0xfa82('0x0'));var path=require(_0xfa82('0x1'));var timeout=require(_0xfa82('0x2'));var express=require(_0xfa82('0x3'));var router=express[_0xfa82('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xfa82('0x5'));var config=require(_0xfa82('0x6'));var controller=require(_0xfa82('0x7'));router[_0xfa82('0x8')]('/',auth[_0xfa82('0x9')](),controller[_0xfa82('0xa')]);router[_0xfa82('0x8')](_0xfa82('0xb'),auth[_0xfa82('0x9')](),controller['describe']);router[_0xfa82('0x8')](_0xfa82('0xc'),auth[_0xfa82('0x9')](),controller['show']);router[_0xfa82('0xd')]('/',auth[_0xfa82('0x9')](),controller['create']);router['put'](_0xfa82('0xc'),auth[_0xfa82('0x9')](),controller[_0xfa82('0xe')]);router[_0xfa82('0xf')](_0xfa82('0xc'),auth[_0xfa82('0x9')](),controller[_0xfa82('0x10')]);module['exports']=router; \ No newline at end of file +var _0x8978=['update','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put'];(function(_0x3ecea6,_0x22cec2){var _0x3923e9=function(_0x5735a6){while(--_0x5735a6){_0x3ecea6['push'](_0x3ecea6['shift']());}};_0x3923e9(++_0x22cec2);}(_0x8978,0x1bd));var _0x8897=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x8978[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require(_0x8897('0x0'));var util=require(_0x8897('0x1'));var path=require('path');var timeout=require(_0x8897('0x2'));var express=require(_0x8897('0x3'));var router=express['Router']();var auth=require(_0x8897('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8897('0x5'));router[_0x8897('0x6')]('/',auth[_0x8897('0x7')](),controller[_0x8897('0x8')]);router[_0x8897('0x6')]('/describe',auth[_0x8897('0x7')](),controller[_0x8897('0x9')]);router[_0x8897('0x6')](_0x8897('0xa'),auth[_0x8897('0x7')](),controller[_0x8897('0xb')]);router['post']('/',auth[_0x8897('0x7')](),controller[_0x8897('0xc')]);router[_0x8897('0xd')](_0x8897('0xa'),auth['isAuthenticated'](),controller[_0x8897('0xe')]);router['delete']('/:id',auth[_0x8897('0x7')](),controller[_0x8897('0xf')]);module[_0x8897('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 3f1c185..cfa72b8 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 _0x498d=['long','sequelize','exports','STRING','TEXT'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x498d,0x1c8));var _0xd498=function(_0x2ab3d9,_0x50e716){_0x2ab3d9=_0x2ab3d9-0x0;var _0x210a54=_0x498d[_0x2ab3d9];return _0x210a54;};'use strict';var Sequelize=require(_0xd498('0x0'));module[_0xd498('0x1')]={'question':{'type':Sequelize[_0xd498('0x2')]},'answer':{'type':Sequelize[_0xd498('0x3')](_0xd498('0x4'))},'membername':{'type':Sequelize[_0xd498('0x2')]},'projectname':{'type':Sequelize[_0xd498('0x2')]},'queue':{'type':Sequelize[_0xd498('0x2')]},'uniqueid':{'type':Sequelize[_0xd498('0x2')]},'calleridname':{'type':Sequelize[_0xd498('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0xd498('0x2')]}}; \ No newline at end of file +var _0xeada=['STRING','long','sequelize'];(function(_0x546ba1,_0x260829){var _0x40681b=function(_0x12938a){while(--_0x12938a){_0x546ba1['push'](_0x546ba1['shift']());}};_0x40681b(++_0x260829);}(_0xeada,0x173));var _0xaead=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xeada[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xaead('0x0'));module['exports']={'question':{'type':Sequelize[_0xaead('0x1')]},'answer':{'type':Sequelize['TEXT'](_0xaead('0x2'))},'membername':{'type':Sequelize[_0xaead('0x1')]},'projectname':{'type':Sequelize[_0xaead('0x1')]},'queue':{'type':Sequelize[_0xaead('0x1')]},'uniqueid':{'type':Sequelize[_0xaead('0x1')]},'calleridname':{'type':Sequelize[_0xaead('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0xaead('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 99b52a9..63b6d94 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 _0x18b4=['papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','destroy','error','stack','name','index','JscriptyAnswerReport','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','findAll','then','catch','show','filters','find','create','body','params','describe','html-pdf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x236140,_0x5782e5){var _0x529f2f=function(_0x4c8b64){while(--_0x4c8b64){_0x236140['push'](_0x236140['shift']());}};_0x529f2f(++_0x5782e5);}(_0x18b4,0x7a));var _0x418b=function(_0x22b108,_0x462562){_0x22b108=_0x22b108-0x0;var _0x4ce9a9=_0x18b4[_0x22b108];return _0x4ce9a9;};'use strict';var pdf=require(_0x418b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x418b('0x1'));var jsonpatch=require(_0x418b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x418b('0x3'));var Mustache=require(_0x418b('0x4'));var util=require(_0x418b('0x5'));var path=require('path');var sox=require(_0x418b('0x6'));var csv=require(_0x418b('0x7'));var ejs=require(_0x418b('0x8'));var fs=require('fs');var _=require(_0x418b('0x9'));var squel=require('squel');var crypto=require(_0x418b('0xa'));var jsforce=require(_0x418b('0xb'));var deskjs=require(_0x418b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x418b('0xd'));var Papa=require(_0x418b('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x418b('0xf'));var hardwareService=require(_0x418b('0x10'));var logger=require(_0x418b('0x11'))(_0x418b('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x418b('0x13'))['db'];function respondWithStatusCode(_0x98d161,_0xbe7a5){_0xbe7a5=_0xbe7a5||0xcc;return function(_0xbcbb10){if(_0xbcbb10){return _0x98d161[_0x418b('0x14')](_0xbe7a5);}return _0x98d161[_0x418b('0x15')](_0xbe7a5)[_0x418b('0x16')]();};}function respondWithResult(_0x5495a1,_0x5c0297){_0x5c0297=_0x5c0297||0xc8;return function(_0xee0bde){if(_0xee0bde){return _0x5495a1[_0x418b('0x15')](_0x5c0297)['json'](_0xee0bde);}};}function respondWithFilteredResult(_0x554c1c,_0x5f03c0){return function(_0x1d6725){if(_0x1d6725){var _0x8af556=_0x1d6725[_0x418b('0x17')],_0x34c347=_0x5f03c0['offset'],_0x4fa9a6=_0x5f03c0[_0x418b('0x18')]+_0x5f03c0[_0x418b('0x19')],_0x580fee;if(_0x4fa9a6>=_0x8af556){_0x4fa9a6=_0x8af556;_0x580fee=0xc8;}else{_0x580fee=0xce;}_0x554c1c[_0x418b('0x15')](_0x580fee);return _0x554c1c[_0x418b('0x1a')]('Content-Range',_0x34c347+'-'+_0x4fa9a6+'/'+_0x8af556)[_0x418b('0x1b')](_0x1d6725);}return null;};}function patchUpdates(_0x46b4e3){return function(_0x141d3d){try{jsonpatch[_0x418b('0x1c')](_0x141d3d,_0x46b4e3,!![]);}catch(_0x2f3246){return BPromise[_0x418b('0x1d')](_0x2f3246);}return _0x141d3d[_0x418b('0x1e')]();};}function saveUpdates(_0x4f0fc3,_0xf60d8c){return function(_0x4dd1aa){if(_0x4dd1aa){return _0x4dd1aa[_0x418b('0x1f')](_0x4f0fc3)['then'](function(_0x16de3d){return _0x16de3d;});}return null;};}function removeEntity(_0x20af65,_0x1c1437){return function(_0xf1b861){if(_0xf1b861){return _0xf1b861[_0x418b('0x20')]()['then'](function(){_0x20af65[_0x418b('0x15')](0xcc)[_0x418b('0x16')]();});}};}function handleEntityNotFound(_0x34983c,_0x241430){return function(_0x3e8d51){if(!_0x3e8d51){_0x34983c[_0x418b('0x14')](0x194);}return _0x3e8d51;};}function handleError(_0x37989a,_0x3ea575){_0x3ea575=_0x3ea575||0x1f4;return function(_0x1a1f66){logger[_0x418b('0x21')](_0x1a1f66[_0x418b('0x22')]);if(_0x1a1f66[_0x418b('0x23')]){delete _0x1a1f66[_0x418b('0x23')];}_0x37989a['status'](_0x3ea575)['send'](_0x1a1f66);};}exports[_0x418b('0x24')]=function(_0x5c0cf0,_0x45334d){var _0x5a03ac={},_0x3440b0={},_0x426373={'count':0x0,'rows':[]};var _0x308641=db[_0x418b('0x25')][_0x418b('0x26')];_0x3440b0[_0x418b('0x27')]=_[_0x418b('0x28')](_0x308641);_0x3440b0['query']=_[_0x418b('0x28')](_0x5c0cf0[_0x418b('0x29')]);_0x3440b0['filters']=_[_0x418b('0x2a')](_0x3440b0[_0x418b('0x27')],_0x3440b0[_0x418b('0x29')]);_0x5a03ac[_0x418b('0x2b')]=_[_0x418b('0x2a')](_0x3440b0[_0x418b('0x27')],qs[_0x418b('0x2c')](_0x5c0cf0[_0x418b('0x29')][_0x418b('0x2c')]));_0x5a03ac['attributes']=_0x5a03ac[_0x418b('0x2b')]['length']?_0x5a03ac[_0x418b('0x2b')]:_0x3440b0[_0x418b('0x27')];if(!_0x5c0cf0[_0x418b('0x29')][_0x418b('0x2d')]('nolimit')){_0x5a03ac['limit']=qs[_0x418b('0x19')](_0x5c0cf0[_0x418b('0x29')][_0x418b('0x19')]);_0x5a03ac[_0x418b('0x18')]=qs[_0x418b('0x18')](_0x5c0cf0[_0x418b('0x29')][_0x418b('0x18')]);}_0x5a03ac[_0x418b('0x2e')]=qs[_0x418b('0x2f')](_0x5c0cf0[_0x418b('0x29')]['sort']);_0x5a03ac[_0x418b('0x30')]=qs['filters'](_[_0x418b('0x31')](_0x5c0cf0[_0x418b('0x29')],_0x3440b0['filters']));if(_0x5c0cf0['query'][_0x418b('0x32')]){_0x5a03ac[_0x418b('0x30')]=_[_0x418b('0x33')](_0x5a03ac['where'],{'$or':_['map'](_0x308641,function(_0x5684cc){if(_0x5684cc[_0x418b('0x34')][_0x418b('0x35')]!==_0x418b('0x36')){var _0x2d2db2={};_0x2d2db2[_0x5684cc['field']]={'$like':'%'+_0x5c0cf0[_0x418b('0x29')][_0x418b('0x32')]+'%'};return _0x2d2db2;}})});}_0x5a03ac=_['merge']({},_0x5a03ac,_0x5c0cf0[_0x418b('0x37')]);var _0x40d5f4={'where':_0x5a03ac[_0x418b('0x30')]};return db['JscriptyAnswerReport'][_0x418b('0x17')](_0x40d5f4)['then'](function(_0x4626c9){_0x426373[_0x418b('0x17')]=_0x4626c9;if(_0x5c0cf0['query'][_0x418b('0x38')]){_0x5a03ac[_0x418b('0x39')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x418b('0x3a')](_0x5a03ac);})['then'](function(_0x245522){_0x426373['rows']=_0x245522;return _0x426373;})[_0x418b('0x3b')](respondWithFilteredResult(_0x45334d,_0x5a03ac))[_0x418b('0x3c')](handleError(_0x45334d,null));};exports[_0x418b('0x3d')]=function(_0x275251,_0x4e7a8b){var _0x1d0888={'raw':!![],'where':{'id':_0x275251['params']['id']}},_0x512e26={};_0x512e26[_0x418b('0x27')]=_[_0x418b('0x28')](db[_0x418b('0x25')][_0x418b('0x26')]);_0x512e26[_0x418b('0x29')]=_['keys'](_0x275251[_0x418b('0x29')]);_0x512e26[_0x418b('0x3e')]=_[_0x418b('0x2a')](_0x512e26[_0x418b('0x27')],_0x512e26[_0x418b('0x29')]);_0x1d0888[_0x418b('0x2b')]=_[_0x418b('0x2a')](_0x512e26[_0x418b('0x27')],qs[_0x418b('0x2c')](_0x275251[_0x418b('0x29')][_0x418b('0x2c')]));_0x1d0888[_0x418b('0x2b')]=_0x1d0888['attributes']['length']?_0x1d0888[_0x418b('0x2b')]:_0x512e26[_0x418b('0x27')];if(_0x275251['query'][_0x418b('0x38')]){_0x1d0888['include']=[{'all':!![]}];}_0x1d0888=_[_0x418b('0x33')]({},_0x1d0888,_0x275251[_0x418b('0x37')]);return db[_0x418b('0x25')][_0x418b('0x3f')](_0x1d0888)['then'](handleEntityNotFound(_0x4e7a8b,null))['then'](respondWithResult(_0x4e7a8b,null))[_0x418b('0x3c')](handleError(_0x4e7a8b,null));};exports['create']=function(_0x518729,_0x48dd16){return db[_0x418b('0x25')][_0x418b('0x40')](_0x518729['body'],{})[_0x418b('0x3b')](respondWithResult(_0x48dd16,0xc9))[_0x418b('0x3c')](handleError(_0x48dd16,null));};exports['update']=function(_0x158304,_0x1836b1){if(_0x158304[_0x418b('0x41')]['id']){delete _0x158304['body']['id'];}return db[_0x418b('0x25')][_0x418b('0x3f')]({'where':{'id':_0x158304[_0x418b('0x42')]['id']}})['then'](handleEntityNotFound(_0x1836b1,null))['then'](saveUpdates(_0x158304[_0x418b('0x41')],null))['then'](respondWithResult(_0x1836b1,null))[_0x418b('0x3c')](handleError(_0x1836b1,null));};exports[_0x418b('0x20')]=function(_0x473b34,_0x159ab6){return db[_0x418b('0x25')][_0x418b('0x3f')]({'where':{'id':_0x473b34[_0x418b('0x42')]['id']}})[_0x418b('0x3b')](handleEntityNotFound(_0x159ab6,null))[_0x418b('0x3b')](removeEntity(_0x159ab6,null))['catch'](handleError(_0x159ab6,null));};exports[_0x418b('0x43')]=function(_0x44b9b2,_0x1d39c4){return db['JscriptyAnswerReport'][_0x418b('0x43')]()[_0x418b('0x3b')](respondWithResult(_0x1d39c4,null))['catch'](handleError(_0x1d39c4,null));}; \ No newline at end of file +var _0x9ff4=['json','count','offset','limit','status','set','apply','reject','save','destroy','then','sendStatus','error','name','send','index','JscriptyAnswerReport','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','end'];(function(_0x33565c,_0x4236ce){var _0x1fd89a=function(_0x271578){while(--_0x271578){_0x33565c['push'](_0x33565c['shift']());}};_0x1fd89a(++_0x4236ce);}(_0x9ff4,0xc7));var _0x49ff=function(_0x2fca2c,_0x5886be){_0x2fca2c=_0x2fca2c-0x0;var _0x685378=_0x9ff4[_0x2fca2c];return _0x685378;};'use strict';var pdf=require(_0x49ff('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x49ff('0x1'));var zipdir=require(_0x49ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x49ff('0x3'));var moment=require(_0x49ff('0x4'));var BPromise=require(_0x49ff('0x5'));var Mustache=require(_0x49ff('0x6'));var util=require('util');var path=require(_0x49ff('0x7'));var sox=require(_0x49ff('0x8'));var csv=require(_0x49ff('0x9'));var ejs=require(_0x49ff('0xa'));var fs=require('fs');var _=require(_0x49ff('0xb'));var squel=require(_0x49ff('0xc'));var crypto=require('crypto');var jsforce=require(_0x49ff('0xd'));var deskjs=require(_0x49ff('0xe'));var toCsv=require(_0x49ff('0x9'));var querystring=require(_0x49ff('0xf'));var Papa=require('papaparse');var Redis=require(_0x49ff('0x10'));var authService=require(_0x49ff('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x49ff('0x12'));var logger=require(_0x49ff('0x13'))(_0x49ff('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x49ff('0x15'))['db'];function respondWithStatusCode(_0x688a47,_0x244031){_0x244031=_0x244031||0xcc;return function(_0x47bbaa){if(_0x47bbaa){return _0x688a47['sendStatus'](_0x244031);}return _0x688a47['status'](_0x244031)[_0x49ff('0x16')]();};}function respondWithResult(_0x4dbdeb,_0x3fe875){_0x3fe875=_0x3fe875||0xc8;return function(_0x239b90){if(_0x239b90){return _0x4dbdeb['status'](_0x3fe875)[_0x49ff('0x17')](_0x239b90);}};}function respondWithFilteredResult(_0x36958e,_0x1ec8ce){return function(_0xecd2a3){if(_0xecd2a3){var _0x2e59c6=_0xecd2a3[_0x49ff('0x18')],_0x5f0fea=_0x1ec8ce[_0x49ff('0x19')],_0x39f68e=_0x1ec8ce[_0x49ff('0x19')]+_0x1ec8ce[_0x49ff('0x1a')],_0x2ccc98;if(_0x39f68e>=_0x2e59c6){_0x39f68e=_0x2e59c6;_0x2ccc98=0xc8;}else{_0x2ccc98=0xce;}_0x36958e[_0x49ff('0x1b')](_0x2ccc98);return _0x36958e[_0x49ff('0x1c')]('Content-Range',_0x5f0fea+'-'+_0x39f68e+'/'+_0x2e59c6)[_0x49ff('0x17')](_0xecd2a3);}return null;};}function patchUpdates(_0x70fd04){return function(_0x5b2cc9){try{jsonpatch[_0x49ff('0x1d')](_0x5b2cc9,_0x70fd04,!![]);}catch(_0x1bb818){return BPromise[_0x49ff('0x1e')](_0x1bb818);}return _0x5b2cc9[_0x49ff('0x1f')]();};}function saveUpdates(_0x2f4350,_0x239dda){return function(_0x2333bb){if(_0x2333bb){return _0x2333bb['update'](_0x2f4350)['then'](function(_0x581e4f){return _0x581e4f;});}return null;};}function removeEntity(_0x315749,_0x54b821){return function(_0x5bddae){if(_0x5bddae){return _0x5bddae[_0x49ff('0x20')]()[_0x49ff('0x21')](function(){_0x315749['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x345006,_0x59f17a){return function(_0x49d74f){if(!_0x49d74f){_0x345006[_0x49ff('0x22')](0x194);}return _0x49d74f;};}function handleError(_0x886fc8,_0x422559){_0x422559=_0x422559||0x1f4;return function(_0x24beb6){logger[_0x49ff('0x23')](_0x24beb6['stack']);if(_0x24beb6[_0x49ff('0x24')]){delete _0x24beb6[_0x49ff('0x24')];}_0x886fc8[_0x49ff('0x1b')](_0x422559)[_0x49ff('0x25')](_0x24beb6);};}exports[_0x49ff('0x26')]=function(_0x4d0d9a,_0x5a4b1a){var _0x2a27e3={},_0x11d445={},_0x4709c3={'count':0x0,'rows':[]};var _0x421a46=db[_0x49ff('0x27')][_0x49ff('0x28')];_0x11d445[_0x49ff('0x29')]=_['keys'](_0x421a46);_0x11d445[_0x49ff('0x2a')]=_[_0x49ff('0x2b')](_0x4d0d9a[_0x49ff('0x2a')]);_0x11d445[_0x49ff('0x2c')]=_['intersection'](_0x11d445[_0x49ff('0x29')],_0x11d445[_0x49ff('0x2a')]);_0x2a27e3[_0x49ff('0x2d')]=_[_0x49ff('0x2e')](_0x11d445[_0x49ff('0x29')],qs[_0x49ff('0x2f')](_0x4d0d9a[_0x49ff('0x2a')][_0x49ff('0x2f')]));_0x2a27e3[_0x49ff('0x2d')]=_0x2a27e3['attributes'][_0x49ff('0x30')]?_0x2a27e3[_0x49ff('0x2d')]:_0x11d445[_0x49ff('0x29')];if(!_0x4d0d9a[_0x49ff('0x2a')][_0x49ff('0x31')](_0x49ff('0x32'))){_0x2a27e3[_0x49ff('0x1a')]=qs[_0x49ff('0x1a')](_0x4d0d9a['query'][_0x49ff('0x1a')]);_0x2a27e3[_0x49ff('0x19')]=qs[_0x49ff('0x19')](_0x4d0d9a[_0x49ff('0x2a')][_0x49ff('0x19')]);}_0x2a27e3[_0x49ff('0x33')]=qs[_0x49ff('0x34')](_0x4d0d9a['query'][_0x49ff('0x34')]);_0x2a27e3[_0x49ff('0x35')]=qs[_0x49ff('0x2c')](_[_0x49ff('0x36')](_0x4d0d9a[_0x49ff('0x2a')],_0x11d445['filters']));if(_0x4d0d9a[_0x49ff('0x2a')][_0x49ff('0x37')]){_0x2a27e3['where']=_[_0x49ff('0x38')](_0x2a27e3[_0x49ff('0x35')],{'$or':_[_0x49ff('0x39')](_0x421a46,function(_0x5e1b7e){if(_0x5e1b7e[_0x49ff('0x3a')][_0x49ff('0x3b')]!=='VIRTUAL'){var _0x4ef92d={};_0x4ef92d[_0x5e1b7e[_0x49ff('0x3c')]]={'$like':'%'+_0x4d0d9a['query'][_0x49ff('0x37')]+'%'};return _0x4ef92d;}})});}_0x2a27e3=_[_0x49ff('0x38')]({},_0x2a27e3,_0x4d0d9a[_0x49ff('0x3d')]);var _0x4bb8b6={'where':_0x2a27e3[_0x49ff('0x35')]};return db[_0x49ff('0x27')][_0x49ff('0x18')](_0x4bb8b6)['then'](function(_0x548917){_0x4709c3[_0x49ff('0x18')]=_0x548917;if(_0x4d0d9a[_0x49ff('0x2a')][_0x49ff('0x3e')]){_0x2a27e3[_0x49ff('0x3f')]=[{'all':!![]}];}return db[_0x49ff('0x27')][_0x49ff('0x40')](_0x2a27e3);})[_0x49ff('0x21')](function(_0x26e144){_0x4709c3[_0x49ff('0x41')]=_0x26e144;return _0x4709c3;})[_0x49ff('0x21')](respondWithFilteredResult(_0x5a4b1a,_0x2a27e3))[_0x49ff('0x42')](handleError(_0x5a4b1a,null));};exports[_0x49ff('0x43')]=function(_0x1d88af,_0x76efdf){var _0x260e0a={'raw':!![],'where':{'id':_0x1d88af[_0x49ff('0x44')]['id']}},_0x5f393a={};_0x5f393a[_0x49ff('0x29')]=_[_0x49ff('0x2b')](db[_0x49ff('0x27')][_0x49ff('0x28')]);_0x5f393a[_0x49ff('0x2a')]=_[_0x49ff('0x2b')](_0x1d88af[_0x49ff('0x2a')]);_0x5f393a[_0x49ff('0x2c')]=_[_0x49ff('0x2e')](_0x5f393a[_0x49ff('0x29')],_0x5f393a[_0x49ff('0x2a')]);_0x260e0a[_0x49ff('0x2d')]=_[_0x49ff('0x2e')](_0x5f393a[_0x49ff('0x29')],qs['fields'](_0x1d88af['query'][_0x49ff('0x2f')]));_0x260e0a['attributes']=_0x260e0a[_0x49ff('0x2d')]['length']?_0x260e0a[_0x49ff('0x2d')]:_0x5f393a[_0x49ff('0x29')];if(_0x1d88af[_0x49ff('0x2a')]['includeAll']){_0x260e0a[_0x49ff('0x3f')]=[{'all':!![]}];}_0x260e0a=_['merge']({},_0x260e0a,_0x1d88af[_0x49ff('0x3d')]);return db[_0x49ff('0x27')][_0x49ff('0x45')](_0x260e0a)['then'](handleEntityNotFound(_0x76efdf,null))[_0x49ff('0x21')](respondWithResult(_0x76efdf,null))[_0x49ff('0x42')](handleError(_0x76efdf,null));};exports[_0x49ff('0x46')]=function(_0x99ddf,_0x3b0a7e){return db['JscriptyAnswerReport'][_0x49ff('0x46')](_0x99ddf['body'],{})['then'](respondWithResult(_0x3b0a7e,0xc9))[_0x49ff('0x42')](handleError(_0x3b0a7e,null));};exports[_0x49ff('0x47')]=function(_0x1a6539,_0x42df9a){if(_0x1a6539[_0x49ff('0x48')]['id']){delete _0x1a6539[_0x49ff('0x48')]['id'];}return db[_0x49ff('0x27')][_0x49ff('0x45')]({'where':{'id':_0x1a6539[_0x49ff('0x44')]['id']}})[_0x49ff('0x21')](handleEntityNotFound(_0x42df9a,null))[_0x49ff('0x21')](saveUpdates(_0x1a6539[_0x49ff('0x48')],null))[_0x49ff('0x21')](respondWithResult(_0x42df9a,null))[_0x49ff('0x42')](handleError(_0x42df9a,null));};exports['destroy']=function(_0x13d798,_0x329fe9){return db[_0x49ff('0x27')][_0x49ff('0x45')]({'where':{'id':_0x13d798['params']['id']}})[_0x49ff('0x21')](handleEntityNotFound(_0x329fe9,null))[_0x49ff('0x21')](removeEntity(_0x329fe9,null))[_0x49ff('0x42')](handleError(_0x329fe9,null));};exports[_0x49ff('0x49')]=function(_0x115738,_0x542a3a){return db[_0x49ff('0x27')][_0x49ff('0x49')]()['then'](respondWithResult(_0x542a3a,null))['catch'](handleError(_0x542a3a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index c6f6c60..7c1973b 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 _0x5e7e=['lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0x27066f,_0xce5a46){var _0x5f4dff=function(_0x506a41){while(--_0x506a41){_0x27066f['push'](_0x27066f['shift']());}};_0x5f4dff(++_0xce5a46);}(_0x5e7e,0x9c));var _0xe5e7=function(_0x3acb14,_0xde2bc4){_0x3acb14=_0x3acb14-0x0;var _0x3baaac=_0x5e7e[_0x3acb14];return _0x3baaac;};'use strict';var _=require(_0xe5e7('0x0'));var util=require('util');var logger=require(_0xe5e7('0x1'))(_0xe5e7('0x2'));var moment=require('moment');var BPromise=require(_0xe5e7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe5e7('0x4'));var rimraf=require(_0xe5e7('0x5'));var config=require(_0xe5e7('0x6'));var attributes=require(_0xe5e7('0x7'));module[_0xe5e7('0x8')]=function(_0x2fe5a8,_0x4b2340){return _0x2fe5a8[_0xe5e7('0x9')](_0xe5e7('0xa'),attributes,{'tableName':_0xe5e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x123e=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x123e,0x15f));var _0xe123=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x123e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe123('0x0'));var util=require(_0xe123('0x1'));var logger=require(_0xe123('0x2'))('api');var moment=require(_0xe123('0x3'));var BPromise=require(_0xe123('0x4'));var rp=require(_0xe123('0x5'));var fs=require('fs');var path=require(_0xe123('0x6'));var rimraf=require('rimraf');var config=require(_0xe123('0x7'));var attributes=require(_0xe123('0x8'));module[_0xe123('0x9')]=function(_0x11c92e,_0x4293aa){return _0x11c92e[_0xe123('0xa')](_0xe123('0xb'),attributes,{'tableName':_0xe123('0xc'),'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 6cb6177..e52cded 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 _0xd1f9=['result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','debug','request\x20sent','stringify','error','code','message','JscriptyAnswerReport,\x20%s,\x20%s'];(function(_0x48e2f6,_0x71cf0e){var _0x4a6e75=function(_0x11d879){while(--_0x11d879){_0x48e2f6['push'](_0x48e2f6['shift']());}};_0x4a6e75(++_0x71cf0e);}(_0xd1f9,0xd4));var _0x9d1f=function(_0x2d2e85,_0x22faa9){_0x2d2e85=_0x2d2e85-0x0;var _0x3e9f5e=_0xd1f9[_0x2d2e85];return _0x3e9f5e;};'use strict';var _=require(_0x9d1f('0x0'));var util=require(_0x9d1f('0x1'));var moment=require(_0x9d1f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d1f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d1f('0x4'));var logger=require(_0x9d1f('0x5'))('rpc');var config=require(_0x9d1f('0x6'));var jayson=require(_0x9d1f('0x7'));var client=jayson[_0x9d1f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e3dfd,_0x241d74,_0x420b60){return new BPromise(function(_0x34ff59,_0x4bf24c){return client[_0x9d1f('0x9')](_0x5e3dfd,_0x420b60)[_0x9d1f('0xa')](function(_0x32e38c){logger[_0x9d1f('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x241d74,'request\x20sent');logger[_0x9d1f('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x241d74,_0x9d1f('0xd'),JSON[_0x9d1f('0xe')](_0x32e38c));if(_0x32e38c[_0x9d1f('0xf')]){if(_0x32e38c[_0x9d1f('0xf')][_0x9d1f('0x10')]===0x1f4){logger[_0x9d1f('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x241d74,_0x32e38c[_0x9d1f('0xf')]['message']);return _0x4bf24c(_0x32e38c['error'][_0x9d1f('0x11')]);}logger[_0x9d1f('0xf')](_0x9d1f('0x12'),_0x241d74,_0x32e38c[_0x9d1f('0xf')]['message']);return _0x34ff59(_0x32e38c[_0x9d1f('0xf')][_0x9d1f('0x11')]);}else{logger['info'](_0x9d1f('0x12'),_0x241d74,_0x9d1f('0xd'));_0x34ff59(_0x32e38c[_0x9d1f('0x13')][_0x9d1f('0x11')]);}})[_0x9d1f('0x14')](function(_0x133ade){logger[_0x9d1f('0xf')](_0x9d1f('0x12'),_0x241d74,_0x133ade);_0x4bf24c(_0x133ade);});});} \ No newline at end of file +var _0x0618=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyAnswerReport,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0618,0xf4));var _0x8061=function(_0x4dfbed,_0xf04fc1){_0x4dfbed=_0x4dfbed-0x0;var _0x5232f6=_0x0618[_0x4dfbed];return _0x5232f6;};'use strict';var _=require(_0x8061('0x0'));var util=require(_0x8061('0x1'));var moment=require(_0x8061('0x2'));var BPromise=require(_0x8061('0x3'));var rs=require(_0x8061('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8061('0x5'))['db'];var utils=require(_0x8061('0x6'));var logger=require(_0x8061('0x7'))('rpc');var config=require(_0x8061('0x8'));var jayson=require(_0x8061('0x9'));var client=jayson['client'][_0x8061('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45127b,_0x533d3e,_0x57d770){return new BPromise(function(_0x489533,_0x484344){return client['request'](_0x45127b,_0x57d770)[_0x8061('0xb')](function(_0x148522){logger[_0x8061('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x533d3e,_0x8061('0xd'));logger['debug'](_0x8061('0xe'),_0x533d3e,_0x8061('0xd'),JSON[_0x8061('0xf')](_0x148522));if(_0x148522[_0x8061('0x10')]){if(_0x148522[_0x8061('0x10')][_0x8061('0x11')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x533d3e,_0x148522[_0x8061('0x10')]['message']);return _0x484344(_0x148522[_0x8061('0x10')][_0x8061('0x12')]);}logger['error'](_0x8061('0x13'),_0x533d3e,_0x148522[_0x8061('0x10')][_0x8061('0x12')]);return _0x489533(_0x148522[_0x8061('0x10')][_0x8061('0x12')]);}else{logger[_0x8061('0xc')](_0x8061('0x13'),_0x533d3e,_0x8061('0xd'));_0x489533(_0x148522[_0x8061('0x14')]['message']);}})[_0x8061('0x15')](function(_0x34d5e6){logger[_0x8061('0x10')](_0x8061('0x13'),_0x533d3e,_0x34d5e6);_0x484344(_0x34d5e6);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 8a48432..7258a86 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 _0xbc4a=['get','/:id','show','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','clone','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index'];(function(_0x4abb7f,_0x510c1d){var _0x347d76=function(_0x279751){while(--_0x279751){_0x4abb7f['push'](_0x4abb7f['shift']());}};_0x347d76(++_0x510c1d);}(_0xbc4a,0xbe));var _0xabc4=function(_0x407f4d,_0x41be41){_0x407f4d=_0x407f4d-0x0;var _0x49be66=_0xbc4a[_0x407f4d];return _0x49be66;};'use strict';var multer=require('multer');var util=require(_0xabc4('0x0'));var path=require(_0xabc4('0x1'));var timeout=require(_0xabc4('0x2'));var express=require('express');var router=express[_0xabc4('0x3')]();var auth=require(_0xabc4('0x4'));var interaction=require(_0xabc4('0x5'));var config=require(_0xabc4('0x6'));var controller=require(_0xabc4('0x7'));router['get']('/',auth[_0xabc4('0x8')](),controller[_0xabc4('0x9')]);router[_0xabc4('0xa')](_0xabc4('0xb'),auth[_0xabc4('0x8')](),controller[_0xabc4('0xc')]);router['get']('/:id/sessions',auth[_0xabc4('0x8')](),controller['getSessions']);router['get'](_0xabc4('0xd'),auth[_0xabc4('0x8')](),controller[_0xabc4('0xe')]);router[_0xabc4('0xa')](_0xabc4('0xf'),auth[_0xabc4('0x8')](),timeout(_0xabc4('0x10')),controller[_0xabc4('0x11')]);router[_0xabc4('0x12')]('/',auth['isAuthenticated'](),controller[_0xabc4('0x13')]);router['post']('/:id/clone',auth[_0xabc4('0x8')](),controller[_0xabc4('0x14')]);router[_0xabc4('0x15')](_0xabc4('0xb'),auth['isAuthenticated'](),controller[_0xabc4('0x16')]);router['delete'](_0xabc4('0xb'),auth[_0xabc4('0x8')](),controller[_0xabc4('0x17')]);module[_0xabc4('0x18')]=router; \ No newline at end of file +var _0x65a6=['delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','get','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','create','post','clone','put'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x65a6,0x1c9));var _0x665a=function(_0x1529a3,_0x529f63){_0x1529a3=_0x1529a3-0x0;var _0x1a0d4b=_0x65a6[_0x1529a3];return _0x1a0d4b;};'use strict';var multer=require(_0x665a('0x0'));var util=require(_0x665a('0x1'));var path=require('path');var timeout=require(_0x665a('0x2'));var express=require(_0x665a('0x3'));var router=express[_0x665a('0x4')]();var auth=require(_0x665a('0x5'));var interaction=require(_0x665a('0x6'));var config=require(_0x665a('0x7'));var controller=require(_0x665a('0x8'));router['get']('/',auth[_0x665a('0x9')](),controller['index']);router[_0x665a('0xa')](_0x665a('0xb'),auth[_0x665a('0x9')](),controller[_0x665a('0xc')]);router[_0x665a('0xa')](_0x665a('0xd'),auth[_0x665a('0x9')](),controller[_0x665a('0xe')]);router[_0x665a('0xa')](_0x665a('0xf'),auth['isAuthenticated'](),controller[_0x665a('0x10')]);router[_0x665a('0xa')](_0x665a('0x11'),auth[_0x665a('0x9')](),timeout('30s'),controller[_0x665a('0x12')]);router['post']('/',auth[_0x665a('0x9')](),controller[_0x665a('0x13')]);router[_0x665a('0x14')]('/:id/clone',auth[_0x665a('0x9')](),controller[_0x665a('0x15')]);router[_0x665a('0x16')]('/:id',auth[_0x665a('0x9')](),controller['update']);router[_0x665a('0x17')]('/:id',auth[_0x665a('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 2cae190..f1cd969 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 _0xc5d9=['isObjectLike','setDataValue','formData','stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','exports','STRING','name','TEXT','long'];(function(_0x159bc5,_0x587461){var _0x16edc2=function(_0x511fcd){while(--_0x511fcd){_0x159bc5['push'](_0x159bc5['shift']());}};_0x16edc2(++_0x587461);}(_0xc5d9,0x1d9));var _0x9c5d=function(_0x3d0b3e,_0x3032c7){_0x3d0b3e=_0x3d0b3e-0x0;var _0x3c645a=_0xc5d9[_0x3d0b3e];return _0x3c645a;};'use strict';var Sequelize=require(_0x9c5d('0x0'));var _=require(_0x9c5d('0x1'));var util=require('util');module[_0x9c5d('0x2')]={'name':{'type':Sequelize[_0x9c5d('0x3')],'unique':_0x9c5d('0x4')},'description':{'type':Sequelize[_0x9c5d('0x3')]},'formData':{'type':Sequelize[_0x9c5d('0x5')](_0x9c5d('0x6')),'set':function(_0x22cb61){if(_[_0x9c5d('0x7')](_0x22cb61)){this[_0x9c5d('0x8')](_0x9c5d('0x9'),JSON[_0x9c5d('0xa')](_0x22cb61));}else if(_['isString'](_0x22cb61)){this[_0x9c5d('0x8')](_0x9c5d('0x9'),_0x22cb61);}else{this[_0x9c5d('0x8')]('formData',util[_0x9c5d('0xb')](_0x9c5d('0xc'),this[_0x9c5d('0xd')](_0x9c5d('0x4'))||'',this[_0x9c5d('0xd')](_0x9c5d('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x9c5d('0xf')],'defaultValue':!![]}}; \ No newline at end of file +var _0x80de=['setDataValue','formData','stringify','isString','format','getDataValue','description','sequelize','util','exports','STRING','name','TEXT','long','isObjectLike'];(function(_0x1b944d,_0x14ac0f){var _0x1caddc=function(_0x3290b3){while(--_0x3290b3){_0x1b944d['push'](_0x1b944d['shift']());}};_0x1caddc(++_0x14ac0f);}(_0x80de,0xbb));var _0xe80d=function(_0x37ddb4,_0x277652){_0x37ddb4=_0x37ddb4-0x0;var _0x24a230=_0x80de[_0x37ddb4];return _0x24a230;};'use strict';var Sequelize=require(_0xe80d('0x0'));var _=require('lodash');var util=require(_0xe80d('0x1'));module[_0xe80d('0x2')]={'name':{'type':Sequelize[_0xe80d('0x3')],'unique':_0xe80d('0x4')},'description':{'type':Sequelize[_0xe80d('0x3')]},'formData':{'type':Sequelize[_0xe80d('0x5')](_0xe80d('0x6')),'set':function(_0x157a6d){if(_[_0xe80d('0x7')](_0x157a6d)){this[_0xe80d('0x8')](_0xe80d('0x9'),JSON[_0xe80d('0xa')](_0x157a6d));}else if(_[_0xe80d('0xb')](_0x157a6d)){this['setDataValue'](_0xe80d('0x9'),_0x157a6d);}else{this['setDataValue'](_0xe80d('0x9'),util[_0xe80d('0xc')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue'](_0xe80d('0x4'))||'',this[_0xe80d('0xd')](_0xe80d('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index c54051f..51a98f3 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 _0x7a54=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','JscriptySessionReport','nolimit','order','sort','ProjectId','getAnswers','JscriptyAnswerReport','fromCharCode','toString','indexOf','getSummary','starttime','parse','startTime','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Content-type','text/csv','download','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','save','update','destroy','then','get','Projects','UserProfileResource','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','offset','where','pick','filter','merge','map','type','key','field','options','JscriptyProject','includeAll','include','findAll','rows','catch','show','params','length','find','create','role','user','UserProfileSection'];(function(_0xfd6aa6,_0x13d9f7){var _0x184681=function(_0x488ee7){while(--_0x488ee7){_0xfd6aa6['push'](_0xfd6aa6['shift']());}};_0x184681(++_0x13d9f7);}(_0x7a54,0x106));var _0x47a5=function(_0x1e0835,_0x5cda6f){_0x1e0835=_0x1e0835-0x0;var _0x18aa48=_0x7a54[_0x1e0835];return _0x18aa48;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];function respondWithStatusCode(_0x250fad,_0xd612dd){_0xd612dd=_0xd612dd||0xcc;return function(_0xd308b8){if(_0xd308b8){return _0x250fad[_0x47a5('0x14')](_0xd612dd);}return _0x250fad['status'](_0xd612dd)[_0x47a5('0x15')]();};}function respondWithResult(_0x221b54,_0x1cf309){_0x1cf309=_0x1cf309||0xc8;return function(_0x711793){if(_0x711793){return _0x221b54[_0x47a5('0x16')](_0x1cf309)[_0x47a5('0x17')](_0x711793);}};}function respondWithFilteredResult(_0x3c6c46,_0x190faa){return function(_0x4e99a8){if(_0x4e99a8){var _0x362359=_0x4e99a8[_0x47a5('0x18')],_0x11faf5=_0x190faa['offset'],_0x3b001e=_0x190faa['offset']+_0x190faa[_0x47a5('0x19')],_0x2a2cbb;if(_0x3b001e>=_0x362359){_0x3b001e=_0x362359;_0x2a2cbb=0xc8;}else{_0x2a2cbb=0xce;}_0x3c6c46['status'](_0x2a2cbb);return _0x3c6c46['set'](_0x47a5('0x1a'),_0x11faf5+'-'+_0x3b001e+'/'+_0x362359)[_0x47a5('0x17')](_0x4e99a8);}return null;};}function patchUpdates(_0x2ce454){return function(_0x1ef371){try{jsonpatch[_0x47a5('0x1b')](_0x1ef371,_0x2ce454,!![]);}catch(_0x12b98e){return BPromise[_0x47a5('0x1c')](_0x12b98e);}return _0x1ef371[_0x47a5('0x1d')]();};}function saveUpdates(_0x3aed38,_0x4a9fcb){return function(_0x1570bc){if(_0x1570bc){return _0x1570bc[_0x47a5('0x1e')](_0x3aed38)['then'](function(_0x2b0360){return _0x2b0360;});}return null;};}function removeEntity(_0x1f03f7,_0x36874d){return function(_0x4c5910){if(_0x4c5910){return _0x4c5910[_0x47a5('0x1f')]()[_0x47a5('0x20')](function(){var _0x23db32=_0x4c5910[_0x47a5('0x21')]({'plain':!![]});var _0x5ef1b1=_0x47a5('0x22');return db[_0x47a5('0x23')]['destroy']({'where':{'type':_0x5ef1b1,'resourceId':_0x23db32['id']}})[_0x47a5('0x20')](function(){return _0x4c5910;});})[_0x47a5('0x20')](function(){_0x1f03f7[_0x47a5('0x16')](0xcc)[_0x47a5('0x15')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x14')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x24')](_0x5b6c4e[_0x47a5('0x25')]);if(_0x5b6c4e[_0x47a5('0x26')]){delete _0x5b6c4e[_0x47a5('0x26')];}_0x5686db[_0x47a5('0x16')](_0x1ea9c8)[_0x47a5('0x27')](_0x5b6c4e);};}exports[_0x47a5('0x28')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=db['JscriptyProject'][_0x47a5('0x29')];_0x1127f8['model']=_[_0x47a5('0x2a')](_0x3ad507);_0x1127f8[_0x47a5('0x2b')]=_[_0x47a5('0x2a')](_0x136b14['query']);_0x1127f8[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x1127f8[_0x47a5('0x2e')],_0x1127f8[_0x47a5('0x2b')]);_0x361bfa['attributes']=_['intersection'](_0x1127f8[_0x47a5('0x2e')],qs[_0x47a5('0x2f')](_0x136b14['query']['fields']));_0x361bfa[_0x47a5('0x30')]=_0x361bfa[_0x47a5('0x30')]['length']?_0x361bfa[_0x47a5('0x30')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2b')][_0x47a5('0x31')]('nolimit')){_0x361bfa['limit']=qs[_0x47a5('0x19')](_0x136b14['query'][_0x47a5('0x19')]);_0x361bfa[_0x47a5('0x32')]=qs[_0x47a5('0x32')](_0x136b14['query'][_0x47a5('0x32')]);}_0x361bfa['order']=qs['sort'](_0x136b14[_0x47a5('0x2b')]['sort']);_0x361bfa[_0x47a5('0x33')]=qs['filters'](_[_0x47a5('0x34')](_0x136b14[_0x47a5('0x2b')],_0x1127f8[_0x47a5('0x2c')]));if(_0x136b14[_0x47a5('0x2b')][_0x47a5('0x35')]){_0x361bfa[_0x47a5('0x33')]=_[_0x47a5('0x36')](_0x361bfa[_0x47a5('0x33')],{'$or':_[_0x47a5('0x37')](_0x3ad507,function(_0x4caed5){if(_0x4caed5[_0x47a5('0x38')][_0x47a5('0x39')]!=='VIRTUAL'){var _0x2c50d6={};_0x2c50d6[_0x4caed5[_0x47a5('0x3a')]]={'$like':'%'+_0x136b14[_0x47a5('0x2b')]['filter']+'%'};return _0x2c50d6;}})});}_0x361bfa=_[_0x47a5('0x36')]({},_0x361bfa,_0x136b14[_0x47a5('0x3b')]);var _0x596097={'where':_0x361bfa[_0x47a5('0x33')]};return db[_0x47a5('0x3c')]['count'](_0x596097)['then'](function(_0x5ebd8c){_0x11a4fa[_0x47a5('0x18')]=_0x5ebd8c;if(_0x136b14['query'][_0x47a5('0x3d')]){_0x361bfa[_0x47a5('0x3e')]=[{'all':!![]}];}return db[_0x47a5('0x3c')][_0x47a5('0x3f')](_0x361bfa);})[_0x47a5('0x20')](function(_0xcb5243){_0x11a4fa[_0x47a5('0x40')]=_0xcb5243;return _0x11a4fa;})[_0x47a5('0x20')](respondWithFilteredResult(_0x16631f,_0x361bfa))[_0x47a5('0x41')](handleError(_0x16631f,null));};exports[_0x47a5('0x42')]=function(_0x280500,_0x1658e8){var _0x23d6d8={'raw':![],'where':{'id':_0x280500[_0x47a5('0x43')]['id']}},_0x56dbbd={};_0x56dbbd[_0x47a5('0x2e')]=_[_0x47a5('0x2a')](db[_0x47a5('0x3c')]['rawAttributes']);_0x56dbbd[_0x47a5('0x2b')]=_['keys'](_0x280500['query']);_0x56dbbd['filters']=_['intersection'](_0x56dbbd[_0x47a5('0x2e')],_0x56dbbd['query']);_0x23d6d8[_0x47a5('0x30')]=_[_0x47a5('0x2d')](_0x56dbbd[_0x47a5('0x2e')],qs['fields'](_0x280500[_0x47a5('0x2b')][_0x47a5('0x2f')]));_0x23d6d8['attributes']=_0x23d6d8['attributes'][_0x47a5('0x44')]?_0x23d6d8['attributes']:_0x56dbbd[_0x47a5('0x2e')];if(_0x280500[_0x47a5('0x2b')][_0x47a5('0x3d')]){_0x23d6d8[_0x47a5('0x3e')]=[{'all':!![]}];}_0x23d6d8=_[_0x47a5('0x36')]({},_0x23d6d8,_0x280500[_0x47a5('0x3b')]);return db[_0x47a5('0x3c')][_0x47a5('0x45')](_0x23d6d8)[_0x47a5('0x20')](handleEntityNotFound(_0x1658e8,null))[_0x47a5('0x20')](respondWithResult(_0x1658e8,null))[_0x47a5('0x41')](handleError(_0x1658e8,null));};exports[_0x47a5('0x46')]=function(_0xe28d76,_0x3574d4){return db[_0x47a5('0x3c')][_0x47a5('0x46')](_0xe28d76['body'],{})[_0x47a5('0x20')](function(_0x23bb04){var _0x49eab1=_0xe28d76['user'][_0x47a5('0x21')]({'plain':!![]});if(!_0x49eab1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49eab1[_0x47a5('0x47')]===_0x47a5('0x48')){var _0x54c35f=_0x23bb04['get']({'plain':!![]});var _0x3d85cc='Projects';return db[_0x47a5('0x49')][_0x47a5('0x45')]({'where':{'name':_0x3d85cc,'userProfileId':_0x49eab1[_0x47a5('0x4a')]},'raw':!![]})[_0x47a5('0x20')](function(_0x44fe8a){if(_0x44fe8a&&_0x44fe8a[_0x47a5('0x4b')]===0x0){return db[_0x47a5('0x23')]['create']({'name':_0x54c35f['name'],'resourceId':_0x54c35f['id'],'type':_0x44fe8a[_0x47a5('0x26')],'sectionId':_0x44fe8a['id']},{})[_0x47a5('0x20')](function(){return _0x23bb04;});}else{return _0x23bb04;}})[_0x47a5('0x41')](function(_0x9ea93e){logger[_0x47a5('0x24')](_0x47a5('0x4c'),_0x9ea93e);throw _0x9ea93e;});}return _0x23bb04;})[_0x47a5('0x20')](respondWithResult(_0x3574d4,0xc9))['catch'](handleError(_0x3574d4,null));};exports[_0x47a5('0x4d')]=function(_0x1c9a62,_0x5f6a){var _0x5c3c75={'raw':![],'where':{'id':_0x1c9a62['params']['id']}},_0x12ca40={};_0x12ca40[_0x47a5('0x2e')]=_[_0x47a5('0x2a')](db[_0x47a5('0x3c')][_0x47a5('0x29')]);_0x5c3c75['attributes']=_[_0x47a5('0x2d')](_0x12ca40[_0x47a5('0x2e')],qs[_0x47a5('0x2f')](_0x1c9a62[_0x47a5('0x2b')][_0x47a5('0x2f')]));_0x5c3c75[_0x47a5('0x30')]=_0x5c3c75[_0x47a5('0x30')]['length']?_0x5c3c75[_0x47a5('0x30')]:_0x12ca40[_0x47a5('0x2e')];if(_0x1c9a62[_0x47a5('0x2b')][_0x47a5('0x3d')]){_0x5c3c75[_0x47a5('0x3e')]=[{'all':!![]}];}_0x5c3c75=_[_0x47a5('0x36')]({},_0x5c3c75,_0x1c9a62['options']);return db[_0x47a5('0x3c')][_0x47a5('0x45')](_0x5c3c75)[_0x47a5('0x20')](handleEntityNotFound(_0x5f6a,null))['then'](function(_0x4c5ed){if(_0x4c5ed){var _0x3c78b7=_0x4c5ed[_0x47a5('0x21')]({'plain':!![]});_0x3c78b7=qs['omit'](_0x3c78b7,['id','createdAt',_0x47a5('0x4e')]);_0x1c9a62[_0x47a5('0x4f')]=_['omit'](_0x1c9a62['body'],['id',_0x47a5('0x50'),'updatedAt']);return db[_0x47a5('0x3c')]['create'](_['merge'](_0x3c78b7,_0x1c9a62[_0x47a5('0x4f')]),{'include':_0x1c9a62[_0x47a5('0x2b')]['includeAll']?[{'all':!![]}]:undefined})[_0x47a5('0x20')](function(_0x72fe){var _0x4b706a=_0x1c9a62['user'][_0x47a5('0x21')]({'plain':!![]});if(!_0x4b706a)throw new Error(_0x47a5('0x51'));if(_0x4b706a[_0x47a5('0x47')]===_0x47a5('0x48')){var _0x5996c4=_0x72fe[_0x47a5('0x21')]({'plain':!![]});var _0x2b4255=_0x47a5('0x22');return db['UserProfileSection'][_0x47a5('0x45')]({'where':{'name':_0x2b4255,'userProfileId':_0x4b706a['userProfileId']},'raw':!![]})[_0x47a5('0x20')](function(_0x470da6){if(_0x470da6&&_0x470da6[_0x47a5('0x4b')]===0x0){return db[_0x47a5('0x23')][_0x47a5('0x46')]({'name':_0x5996c4['name'],'resourceId':_0x5996c4['id'],'type':_0x470da6[_0x47a5('0x26')],'sectionId':_0x470da6['id']},{})['then'](function(){return _0x72fe;});}else{return _0x72fe;}})['catch'](function(_0x5eb150){logger['error'](_0x47a5('0x4c'),_0x5eb150);throw _0x5eb150;});}return _0x72fe;});}})[_0x47a5('0x20')](respondWithResult(_0x5f6a,0xc9))[_0x47a5('0x41')](handleError(_0x5f6a,null));};exports['update']=function(_0x4d3db1,_0x139229){if(_0x4d3db1[_0x47a5('0x4f')]['id']){delete _0x4d3db1[_0x47a5('0x4f')]['id'];}return db[_0x47a5('0x3c')][_0x47a5('0x45')]({'where':{'id':_0x4d3db1['params']['id']}})[_0x47a5('0x20')](handleEntityNotFound(_0x139229,null))['then'](saveUpdates(_0x4d3db1[_0x47a5('0x4f')],null))[_0x47a5('0x20')](respondWithResult(_0x139229,null))['catch'](handleError(_0x139229,null));};exports[_0x47a5('0x1f')]=function(_0x345104,_0x132854){return db[_0x47a5('0x3c')][_0x47a5('0x45')]({'where':{'id':_0x345104[_0x47a5('0x43')]['id']}})[_0x47a5('0x20')](handleEntityNotFound(_0x132854,null))[_0x47a5('0x20')](removeEntity(_0x132854,null))['catch'](handleError(_0x132854,null));};exports[_0x47a5('0x52')]=function(_0x2a3a57,_0x3c75c6,_0x26e7fc){var _0x396cb0={'raw':!![],'where':{}};var _0x4bbe14={};var _0xbec033={'count':0x0,'rows':[]};return db[_0x47a5('0x3c')][_0x47a5('0x53')]({'where':{'id':_0x2a3a57[_0x47a5('0x43')]['id']}})[_0x47a5('0x20')](handleEntityNotFound(_0x3c75c6,null))[_0x47a5('0x20')](function(_0x453191){if(_0x453191){_0x4bbe14[_0x47a5('0x2e')]=_[_0x47a5('0x2a')](db[_0x47a5('0x54')][_0x47a5('0x29')]);_0x4bbe14[_0x47a5('0x2b')]=_[_0x47a5('0x2a')](_0x2a3a57[_0x47a5('0x2b')]);_0x4bbe14[_0x47a5('0x2c')]=_['intersection'](_0x4bbe14[_0x47a5('0x2e')],_0x4bbe14[_0x47a5('0x2b')]);_0x396cb0[_0x47a5('0x30')]=_['intersection'](_0x4bbe14[_0x47a5('0x2e')],qs[_0x47a5('0x2f')](_0x2a3a57[_0x47a5('0x2b')][_0x47a5('0x2f')]));_0x396cb0['attributes']=_0x396cb0[_0x47a5('0x30')]['length']?_0x396cb0[_0x47a5('0x30')]:_0x4bbe14['model'];if(!_0x2a3a57[_0x47a5('0x2b')]['hasOwnProperty'](_0x47a5('0x55'))){_0x396cb0[_0x47a5('0x19')]=qs[_0x47a5('0x19')](_0x2a3a57['query']['limit']);_0x396cb0['offset']=qs[_0x47a5('0x32')](_0x2a3a57[_0x47a5('0x2b')][_0x47a5('0x32')]);}_0x396cb0[_0x47a5('0x56')]=qs['sort'](_0x2a3a57[_0x47a5('0x2b')][_0x47a5('0x57')]);_0x396cb0[_0x47a5('0x33')]=qs[_0x47a5('0x2c')](_[_0x47a5('0x34')](_0x2a3a57[_0x47a5('0x2b')],_0x4bbe14[_0x47a5('0x2c')]));_0x396cb0[_0x47a5('0x33')][_0x47a5('0x58')]=_0x453191['id'];if(_0x2a3a57[_0x47a5('0x2b')][_0x47a5('0x35')]){_0x396cb0[_0x47a5('0x33')]=_['merge'](_0x396cb0[_0x47a5('0x33')],{'$or':_['map'](_0x396cb0[_0x47a5('0x30')],function(_0x2ac30f){var _0x281e5f={};_0x281e5f[_0x2ac30f]={'$like':'%'+_0x2a3a57[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x281e5f;})});}_0x396cb0=_[_0x47a5('0x36')]({},_0x396cb0,_0x2a3a57[_0x47a5('0x3b')]);return db[_0x47a5('0x54')][_0x47a5('0x18')]({'where':_0x396cb0[_0x47a5('0x33')]})[_0x47a5('0x20')](function(_0x1f07ac){_0xbec033[_0x47a5('0x18')]=_0x1f07ac;if(_0x2a3a57[_0x47a5('0x2b')][_0x47a5('0x3d')]){_0x396cb0['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x396cb0);})['then'](function(_0x490e28){_0xbec033[_0x47a5('0x40')]=_0x490e28;return _0xbec033;});}})['then'](respondWithFilteredResult(_0x3c75c6,_0x396cb0))[_0x47a5('0x41')](handleError(_0x3c75c6,null));};exports[_0x47a5('0x59')]=function(_0x1baa5a,_0x396102,_0x3cd335){var _0x930d25={'raw':!![],'where':{}};var _0x218dfa={};var _0x1c7302={'count':0x0,'rows':[]};return db[_0x47a5('0x3c')][_0x47a5('0x53')]({'where':{'id':_0x1baa5a[_0x47a5('0x43')]['id']}})['then'](handleEntityNotFound(_0x396102,null))[_0x47a5('0x20')](function(_0x1fbd42){if(_0x1fbd42){_0x218dfa[_0x47a5('0x2e')]=_['keys'](db[_0x47a5('0x5a')][_0x47a5('0x29')]);_0x218dfa[_0x47a5('0x2b')]=_['keys'](_0x1baa5a[_0x47a5('0x2b')]);_0x218dfa['filters']=_['intersection'](_0x218dfa[_0x47a5('0x2e')],_0x218dfa[_0x47a5('0x2b')]);_0x930d25[_0x47a5('0x30')]=_[_0x47a5('0x2d')](_0x218dfa[_0x47a5('0x2e')],qs[_0x47a5('0x2f')](_0x1baa5a['query']['fields']));_0x930d25[_0x47a5('0x30')]=_0x930d25['attributes'][_0x47a5('0x44')]?_0x930d25[_0x47a5('0x30')]:_0x218dfa[_0x47a5('0x2e')];if(!_0x1baa5a[_0x47a5('0x2b')]['hasOwnProperty'](_0x47a5('0x55'))){_0x930d25['limit']=qs['limit'](_0x1baa5a[_0x47a5('0x2b')][_0x47a5('0x19')]);_0x930d25['offset']=qs[_0x47a5('0x32')](_0x1baa5a[_0x47a5('0x2b')][_0x47a5('0x32')]);}_0x930d25['order']=qs[_0x47a5('0x57')](_0x1baa5a['query'][_0x47a5('0x57')]);_0x930d25[_0x47a5('0x33')]=qs[_0x47a5('0x2c')](_['pick'](_0x1baa5a[_0x47a5('0x2b')],_0x218dfa[_0x47a5('0x2c')]));_0x930d25[_0x47a5('0x33')]['ProjectId']=_0x1fbd42['id'];if(_0x1baa5a[_0x47a5('0x2b')]['filter']){_0x930d25[_0x47a5('0x33')]=_['merge'](_0x930d25[_0x47a5('0x33')],{'$or':_[_0x47a5('0x37')](_0x930d25[_0x47a5('0x30')],function(_0x211fbf){var _0x51738b={};_0x51738b[_0x211fbf]={'$like':'%'+_0x1baa5a[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x51738b;})});}_0x930d25=_[_0x47a5('0x36')]({},_0x930d25,_0x1baa5a[_0x47a5('0x3b')]);return db[_0x47a5('0x5a')]['count']({'where':_0x930d25['where']})[_0x47a5('0x20')](function(_0x4ab01f){_0x1c7302[_0x47a5('0x18')]=_0x4ab01f;if(_0x1baa5a[_0x47a5('0x2b')][_0x47a5('0x3d')]){_0x930d25['include']=[{'all':!![]}];}return db[_0x47a5('0x5a')][_0x47a5('0x3f')](_0x930d25);})['then'](function(_0xf7fc4e){_0x1c7302[_0x47a5('0x40')]=_0xf7fc4e;return _0x1c7302;});}})[_0x47a5('0x20')](respondWithFilteredResult(_0x396102,_0x930d25))[_0x47a5('0x41')](handleError(_0x396102,null));};function char(_0x58dacd){return'number'===typeof _0x58dacd?String[_0x47a5('0x5b')][_0x47a5('0x1b')](null,arguments):_0x58dacd;}function needsEncapsulation(_0x48e7f3){return!!_0x48e7f3&&(_0x48e7f3[_0x47a5('0x5c')]()[_0x47a5('0x5d')](char(0xd))>=0x0||_0x48e7f3['toString']()[_0x47a5('0x5d')](char(0xa))>=0x0||_0x48e7f3[_0x47a5('0x5c')]()[_0x47a5('0x5d')](char(0x2c))>=0x0||_0x48e7f3['toString']()[_0x47a5('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x59b4a5){var _0x663778=char(0x22),_0x5e2946='\x5c'+char(0x22),_0x243c8b=_0x59b4a5[_0x47a5('0x5c')]()['replace'](new RegExp(_0x663778,'g'),_0x5e2946);return _0x663778+_0x243c8b+_0x663778;}exports[_0x47a5('0x5e')]=function(_0x597cb2,_0x1eabef,_0x36f619){var _0x37e045,_0x2be771;var _0x49b76a={'where':{'ProjectId':_0x597cb2[_0x47a5('0x43')]['id']}};if(_0x597cb2['query']['startTime']){_0x49b76a[_0x47a5('0x33')][_0x47a5('0x5f')]=JSON[_0x47a5('0x60')](_0x597cb2[_0x47a5('0x2b')][_0x47a5('0x61')]);}return db['JscriptySessionReport'][_0x47a5('0x3f')](_0x49b76a)[_0x47a5('0x20')](handleEntityNotFound(_0x1eabef,null))[_0x47a5('0x20')](function(_0x11b68b){if(_0x11b68b){_0x37e045=_0x11b68b;return db['JscriptyQuestionReport'][_0x47a5('0x3f')]({'where':{'SessionId':{'$in':_['map'](_0x37e045,'id')},'ProjectId':_0x597cb2[_0x47a5('0x43')]['id']},'order':_0x47a5('0x62')});}})[_0x47a5('0x20')](handleEntityNotFound(_0x1eabef,null))[_0x47a5('0x20')](function(_0x29a1cf){if(_0x29a1cf){_0x2be771=_0x29a1cf;var _0x3ec264={};for(var _0x92bfd7=0x0,_0x1fec11=_0x2be771[_0x47a5('0x44')];_0x92bfd7<_0x1fec11;_0x92bfd7++){if(!_0x3ec264['hasOwnProperty'](_0x2be771[_0x92bfd7][_0x47a5('0x63')])){_0x3ec264[_0x2be771[_0x92bfd7][_0x47a5('0x63')]]=needsEncapsulation(_0x2be771[_0x92bfd7]['question'])?encapsulate(_0x2be771[_0x92bfd7][_0x47a5('0x64')]):_0x2be771[_0x92bfd7][_0x47a5('0x64')];}}var _0x6d6a5=[],_0x5b85cd={};for(var _0x4bf1f5=0x0,_0x126bb1=_0x37e045[_0x47a5('0x44')];_0x4bf1f5<_0x126bb1;_0x4bf1f5++){_0x5b85cd={'ProjectId':_0x597cb2['params']['id'],'SessionId':_0x37e045[_0x4bf1f5]['id'],'StartTime':moment(_0x37e045[_0x4bf1f5]['starttime'])[_0x47a5('0x65')](_0x47a5('0x66'))};for(var _0x54eab1=0x0,_0x29e384=_0x2be771[_0x47a5('0x44')];_0x54eab1<_0x29e384;_0x54eab1++){if(_0x2be771[_0x54eab1]['SessionId']==_0x37e045[_0x4bf1f5]['id']&&_0x3ec264[_0x47a5('0x31')](_0x2be771[_0x54eab1][_0x47a5('0x63')])){_0x5b85cd[_0x3ec264[_0x2be771[_0x54eab1][_0x47a5('0x63')]]]=_0x2be771[_0x54eab1][_0x47a5('0x67')];}}for(var _0x364bb0 in _0x3ec264){if(!_0x5b85cd[_0x47a5('0x31')](_0x3ec264[_0x364bb0])){_0x5b85cd[_0x3ec264[_0x364bb0]]=null;}}_0x6d6a5['push'](_0x5b85cd);}return _0x6d6a5;}})['then'](function(_0x5bd86e){if(!_[_0x47a5('0x68')](_0x5bd86e)){var _0xce5ada=toCsv(_0x5bd86e);var _0x4e0f2b=Date[_0x47a5('0x69')]();fs[_0x47a5('0x6a')](util[_0x47a5('0x65')](_0x47a5('0x6b'),_0x597cb2[_0x47a5('0x43')]['id'],_0x4e0f2b),_0xce5ada);_0x1eabef['setHeader'](_0x47a5('0x6c'),'attachment;\x20filename='+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x597cb2[_0x47a5('0x43')]['id'],_0x4e0f2b));_0x1eabef['setHeader'](_0x47a5('0x6d'),_0x47a5('0x6e'));return _0x1eabef[_0x47a5('0x6f')](util['format'](_0x47a5('0x6b'),_0x597cb2[_0x47a5('0x43')]['id'],_0x4e0f2b));}else{return _0x1eabef[_0x47a5('0x14')](0xcc);}})[_0x47a5('0x41')](handleError(_0x1eabef,null));}; \ No newline at end of file +var _0x7a54=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','JscriptySessionReport','nolimit','order','sort','ProjectId','getAnswers','JscriptyAnswerReport','fromCharCode','toString','indexOf','getSummary','starttime','parse','startTime','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Content-type','text/csv','download','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','save','update','destroy','then','get','Projects','UserProfileResource','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','offset','where','pick','filter','merge','map','type','key','field','options','JscriptyProject','includeAll','include','findAll','rows','catch','show','params','length','find','create','role','user','UserProfileSection'];(function(_0x2814ee,_0x3d4466){var _0x1e99a3=function(_0x350b8a){while(--_0x350b8a){_0x2814ee['push'](_0x2814ee['shift']());}};_0x1e99a3(++_0x3d4466);}(_0x7a54,0x106));var _0x47a5=function(_0x4c2211,_0x376c5a){_0x4c2211=_0x4c2211-0x0;var _0x2e54a0=_0x7a54[_0x4c2211];return _0x2e54a0;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];function respondWithStatusCode(_0x250fad,_0xd612dd){_0xd612dd=_0xd612dd||0xcc;return function(_0xd308b8){if(_0xd308b8){return _0x250fad[_0x47a5('0x14')](_0xd612dd);}return _0x250fad['status'](_0xd612dd)[_0x47a5('0x15')]();};}function respondWithResult(_0x221b54,_0x1cf309){_0x1cf309=_0x1cf309||0xc8;return function(_0x711793){if(_0x711793){return _0x221b54[_0x47a5('0x16')](_0x1cf309)[_0x47a5('0x17')](_0x711793);}};}function respondWithFilteredResult(_0x3c6c46,_0x190faa){return function(_0x4e99a8){if(_0x4e99a8){var _0x362359=_0x4e99a8[_0x47a5('0x18')],_0x11faf5=_0x190faa['offset'],_0x3b001e=_0x190faa['offset']+_0x190faa[_0x47a5('0x19')],_0x2a2cbb;if(_0x3b001e>=_0x362359){_0x3b001e=_0x362359;_0x2a2cbb=0xc8;}else{_0x2a2cbb=0xce;}_0x3c6c46['status'](_0x2a2cbb);return _0x3c6c46['set'](_0x47a5('0x1a'),_0x11faf5+'-'+_0x3b001e+'/'+_0x362359)[_0x47a5('0x17')](_0x4e99a8);}return null;};}function patchUpdates(_0x2ce454){return function(_0x1ef371){try{jsonpatch[_0x47a5('0x1b')](_0x1ef371,_0x2ce454,!![]);}catch(_0x12b98e){return BPromise[_0x47a5('0x1c')](_0x12b98e);}return _0x1ef371[_0x47a5('0x1d')]();};}function saveUpdates(_0x3aed38,_0x4a9fcb){return function(_0x1570bc){if(_0x1570bc){return _0x1570bc[_0x47a5('0x1e')](_0x3aed38)['then'](function(_0x2b0360){return _0x2b0360;});}return null;};}function removeEntity(_0x1f03f7,_0x36874d){return function(_0x4c5910){if(_0x4c5910){return _0x4c5910[_0x47a5('0x1f')]()[_0x47a5('0x20')](function(){var _0x23db32=_0x4c5910[_0x47a5('0x21')]({'plain':!![]});var _0x5ef1b1=_0x47a5('0x22');return db[_0x47a5('0x23')]['destroy']({'where':{'type':_0x5ef1b1,'resourceId':_0x23db32['id']}})[_0x47a5('0x20')](function(){return _0x4c5910;});})[_0x47a5('0x20')](function(){_0x1f03f7[_0x47a5('0x16')](0xcc)[_0x47a5('0x15')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x14')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x24')](_0x5b6c4e[_0x47a5('0x25')]);if(_0x5b6c4e[_0x47a5('0x26')]){delete _0x5b6c4e[_0x47a5('0x26')];}_0x5686db[_0x47a5('0x16')](_0x1ea9c8)[_0x47a5('0x27')](_0x5b6c4e);};}exports[_0x47a5('0x28')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=db['JscriptyProject'][_0x47a5('0x29')];_0x1127f8['model']=_[_0x47a5('0x2a')](_0x3ad507);_0x1127f8[_0x47a5('0x2b')]=_[_0x47a5('0x2a')](_0x136b14['query']);_0x1127f8[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x1127f8[_0x47a5('0x2e')],_0x1127f8[_0x47a5('0x2b')]);_0x361bfa['attributes']=_['intersection'](_0x1127f8[_0x47a5('0x2e')],qs[_0x47a5('0x2f')](_0x136b14['query']['fields']));_0x361bfa[_0x47a5('0x30')]=_0x361bfa[_0x47a5('0x30')]['length']?_0x361bfa[_0x47a5('0x30')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2b')][_0x47a5('0x31')]('nolimit')){_0x361bfa['limit']=qs[_0x47a5('0x19')](_0x136b14['query'][_0x47a5('0x19')]);_0x361bfa[_0x47a5('0x32')]=qs[_0x47a5('0x32')](_0x136b14['query'][_0x47a5('0x32')]);}_0x361bfa['order']=qs['sort'](_0x136b14[_0x47a5('0x2b')]['sort']);_0x361bfa[_0x47a5('0x33')]=qs['filters'](_[_0x47a5('0x34')](_0x136b14[_0x47a5('0x2b')],_0x1127f8[_0x47a5('0x2c')]));if(_0x136b14[_0x47a5('0x2b')][_0x47a5('0x35')]){_0x361bfa[_0x47a5('0x33')]=_[_0x47a5('0x36')](_0x361bfa[_0x47a5('0x33')],{'$or':_[_0x47a5('0x37')](_0x3ad507,function(_0x4caed5){if(_0x4caed5[_0x47a5('0x38')][_0x47a5('0x39')]!=='VIRTUAL'){var _0x2c50d6={};_0x2c50d6[_0x4caed5[_0x47a5('0x3a')]]={'$like':'%'+_0x136b14[_0x47a5('0x2b')]['filter']+'%'};return _0x2c50d6;}})});}_0x361bfa=_[_0x47a5('0x36')]({},_0x361bfa,_0x136b14[_0x47a5('0x3b')]);var _0x596097={'where':_0x361bfa[_0x47a5('0x33')]};return db[_0x47a5('0x3c')]['count'](_0x596097)['then'](function(_0x5ebd8c){_0x11a4fa[_0x47a5('0x18')]=_0x5ebd8c;if(_0x136b14['query'][_0x47a5('0x3d')]){_0x361bfa[_0x47a5('0x3e')]=[{'all':!![]}];}return db[_0x47a5('0x3c')][_0x47a5('0x3f')](_0x361bfa);})[_0x47a5('0x20')](function(_0xcb5243){_0x11a4fa[_0x47a5('0x40')]=_0xcb5243;return _0x11a4fa;})[_0x47a5('0x20')](respondWithFilteredResult(_0x16631f,_0x361bfa))[_0x47a5('0x41')](handleError(_0x16631f,null));};exports[_0x47a5('0x42')]=function(_0x280500,_0x1658e8){var _0x23d6d8={'raw':![],'where':{'id':_0x280500[_0x47a5('0x43')]['id']}},_0x56dbbd={};_0x56dbbd[_0x47a5('0x2e')]=_[_0x47a5('0x2a')](db[_0x47a5('0x3c')]['rawAttributes']);_0x56dbbd[_0x47a5('0x2b')]=_['keys'](_0x280500['query']);_0x56dbbd['filters']=_['intersection'](_0x56dbbd[_0x47a5('0x2e')],_0x56dbbd['query']);_0x23d6d8[_0x47a5('0x30')]=_[_0x47a5('0x2d')](_0x56dbbd[_0x47a5('0x2e')],qs['fields'](_0x280500[_0x47a5('0x2b')][_0x47a5('0x2f')]));_0x23d6d8['attributes']=_0x23d6d8['attributes'][_0x47a5('0x44')]?_0x23d6d8['attributes']:_0x56dbbd[_0x47a5('0x2e')];if(_0x280500[_0x47a5('0x2b')][_0x47a5('0x3d')]){_0x23d6d8[_0x47a5('0x3e')]=[{'all':!![]}];}_0x23d6d8=_[_0x47a5('0x36')]({},_0x23d6d8,_0x280500[_0x47a5('0x3b')]);return db[_0x47a5('0x3c')][_0x47a5('0x45')](_0x23d6d8)[_0x47a5('0x20')](handleEntityNotFound(_0x1658e8,null))[_0x47a5('0x20')](respondWithResult(_0x1658e8,null))[_0x47a5('0x41')](handleError(_0x1658e8,null));};exports[_0x47a5('0x46')]=function(_0xe28d76,_0x3574d4){return db[_0x47a5('0x3c')][_0x47a5('0x46')](_0xe28d76['body'],{})[_0x47a5('0x20')](function(_0x23bb04){var _0x49eab1=_0xe28d76['user'][_0x47a5('0x21')]({'plain':!![]});if(!_0x49eab1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49eab1[_0x47a5('0x47')]===_0x47a5('0x48')){var _0x54c35f=_0x23bb04['get']({'plain':!![]});var _0x3d85cc='Projects';return db[_0x47a5('0x49')][_0x47a5('0x45')]({'where':{'name':_0x3d85cc,'userProfileId':_0x49eab1[_0x47a5('0x4a')]},'raw':!![]})[_0x47a5('0x20')](function(_0x44fe8a){if(_0x44fe8a&&_0x44fe8a[_0x47a5('0x4b')]===0x0){return db[_0x47a5('0x23')]['create']({'name':_0x54c35f['name'],'resourceId':_0x54c35f['id'],'type':_0x44fe8a[_0x47a5('0x26')],'sectionId':_0x44fe8a['id']},{})[_0x47a5('0x20')](function(){return _0x23bb04;});}else{return _0x23bb04;}})[_0x47a5('0x41')](function(_0x9ea93e){logger[_0x47a5('0x24')](_0x47a5('0x4c'),_0x9ea93e);throw _0x9ea93e;});}return _0x23bb04;})[_0x47a5('0x20')](respondWithResult(_0x3574d4,0xc9))['catch'](handleError(_0x3574d4,null));};exports[_0x47a5('0x4d')]=function(_0x1c9a62,_0x5f6a){var _0x5c3c75={'raw':![],'where':{'id':_0x1c9a62['params']['id']}},_0x12ca40={};_0x12ca40[_0x47a5('0x2e')]=_[_0x47a5('0x2a')](db[_0x47a5('0x3c')][_0x47a5('0x29')]);_0x5c3c75['attributes']=_[_0x47a5('0x2d')](_0x12ca40[_0x47a5('0x2e')],qs[_0x47a5('0x2f')](_0x1c9a62[_0x47a5('0x2b')][_0x47a5('0x2f')]));_0x5c3c75[_0x47a5('0x30')]=_0x5c3c75[_0x47a5('0x30')]['length']?_0x5c3c75[_0x47a5('0x30')]:_0x12ca40[_0x47a5('0x2e')];if(_0x1c9a62[_0x47a5('0x2b')][_0x47a5('0x3d')]){_0x5c3c75[_0x47a5('0x3e')]=[{'all':!![]}];}_0x5c3c75=_[_0x47a5('0x36')]({},_0x5c3c75,_0x1c9a62['options']);return db[_0x47a5('0x3c')][_0x47a5('0x45')](_0x5c3c75)[_0x47a5('0x20')](handleEntityNotFound(_0x5f6a,null))['then'](function(_0x4c5ed){if(_0x4c5ed){var _0x3c78b7=_0x4c5ed[_0x47a5('0x21')]({'plain':!![]});_0x3c78b7=qs['omit'](_0x3c78b7,['id','createdAt',_0x47a5('0x4e')]);_0x1c9a62[_0x47a5('0x4f')]=_['omit'](_0x1c9a62['body'],['id',_0x47a5('0x50'),'updatedAt']);return db[_0x47a5('0x3c')]['create'](_['merge'](_0x3c78b7,_0x1c9a62[_0x47a5('0x4f')]),{'include':_0x1c9a62[_0x47a5('0x2b')]['includeAll']?[{'all':!![]}]:undefined})[_0x47a5('0x20')](function(_0x72fe){var _0x4b706a=_0x1c9a62['user'][_0x47a5('0x21')]({'plain':!![]});if(!_0x4b706a)throw new Error(_0x47a5('0x51'));if(_0x4b706a[_0x47a5('0x47')]===_0x47a5('0x48')){var _0x5996c4=_0x72fe[_0x47a5('0x21')]({'plain':!![]});var _0x2b4255=_0x47a5('0x22');return db['UserProfileSection'][_0x47a5('0x45')]({'where':{'name':_0x2b4255,'userProfileId':_0x4b706a['userProfileId']},'raw':!![]})[_0x47a5('0x20')](function(_0x470da6){if(_0x470da6&&_0x470da6[_0x47a5('0x4b')]===0x0){return db[_0x47a5('0x23')][_0x47a5('0x46')]({'name':_0x5996c4['name'],'resourceId':_0x5996c4['id'],'type':_0x470da6[_0x47a5('0x26')],'sectionId':_0x470da6['id']},{})['then'](function(){return _0x72fe;});}else{return _0x72fe;}})['catch'](function(_0x5eb150){logger['error'](_0x47a5('0x4c'),_0x5eb150);throw _0x5eb150;});}return _0x72fe;});}})[_0x47a5('0x20')](respondWithResult(_0x5f6a,0xc9))[_0x47a5('0x41')](handleError(_0x5f6a,null));};exports['update']=function(_0x4d3db1,_0x139229){if(_0x4d3db1[_0x47a5('0x4f')]['id']){delete _0x4d3db1[_0x47a5('0x4f')]['id'];}return db[_0x47a5('0x3c')][_0x47a5('0x45')]({'where':{'id':_0x4d3db1['params']['id']}})[_0x47a5('0x20')](handleEntityNotFound(_0x139229,null))['then'](saveUpdates(_0x4d3db1[_0x47a5('0x4f')],null))[_0x47a5('0x20')](respondWithResult(_0x139229,null))['catch'](handleError(_0x139229,null));};exports[_0x47a5('0x1f')]=function(_0x345104,_0x132854){return db[_0x47a5('0x3c')][_0x47a5('0x45')]({'where':{'id':_0x345104[_0x47a5('0x43')]['id']}})[_0x47a5('0x20')](handleEntityNotFound(_0x132854,null))[_0x47a5('0x20')](removeEntity(_0x132854,null))['catch'](handleError(_0x132854,null));};exports[_0x47a5('0x52')]=function(_0x2a3a57,_0x3c75c6,_0x26e7fc){var _0x396cb0={'raw':!![],'where':{}};var _0x4bbe14={};var _0xbec033={'count':0x0,'rows':[]};return db[_0x47a5('0x3c')][_0x47a5('0x53')]({'where':{'id':_0x2a3a57[_0x47a5('0x43')]['id']}})[_0x47a5('0x20')](handleEntityNotFound(_0x3c75c6,null))[_0x47a5('0x20')](function(_0x453191){if(_0x453191){_0x4bbe14[_0x47a5('0x2e')]=_[_0x47a5('0x2a')](db[_0x47a5('0x54')][_0x47a5('0x29')]);_0x4bbe14[_0x47a5('0x2b')]=_[_0x47a5('0x2a')](_0x2a3a57[_0x47a5('0x2b')]);_0x4bbe14[_0x47a5('0x2c')]=_['intersection'](_0x4bbe14[_0x47a5('0x2e')],_0x4bbe14[_0x47a5('0x2b')]);_0x396cb0[_0x47a5('0x30')]=_['intersection'](_0x4bbe14[_0x47a5('0x2e')],qs[_0x47a5('0x2f')](_0x2a3a57[_0x47a5('0x2b')][_0x47a5('0x2f')]));_0x396cb0['attributes']=_0x396cb0[_0x47a5('0x30')]['length']?_0x396cb0[_0x47a5('0x30')]:_0x4bbe14['model'];if(!_0x2a3a57[_0x47a5('0x2b')]['hasOwnProperty'](_0x47a5('0x55'))){_0x396cb0[_0x47a5('0x19')]=qs[_0x47a5('0x19')](_0x2a3a57['query']['limit']);_0x396cb0['offset']=qs[_0x47a5('0x32')](_0x2a3a57[_0x47a5('0x2b')][_0x47a5('0x32')]);}_0x396cb0[_0x47a5('0x56')]=qs['sort'](_0x2a3a57[_0x47a5('0x2b')][_0x47a5('0x57')]);_0x396cb0[_0x47a5('0x33')]=qs[_0x47a5('0x2c')](_[_0x47a5('0x34')](_0x2a3a57[_0x47a5('0x2b')],_0x4bbe14[_0x47a5('0x2c')]));_0x396cb0[_0x47a5('0x33')][_0x47a5('0x58')]=_0x453191['id'];if(_0x2a3a57[_0x47a5('0x2b')][_0x47a5('0x35')]){_0x396cb0[_0x47a5('0x33')]=_['merge'](_0x396cb0[_0x47a5('0x33')],{'$or':_['map'](_0x396cb0[_0x47a5('0x30')],function(_0x2ac30f){var _0x281e5f={};_0x281e5f[_0x2ac30f]={'$like':'%'+_0x2a3a57[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x281e5f;})});}_0x396cb0=_[_0x47a5('0x36')]({},_0x396cb0,_0x2a3a57[_0x47a5('0x3b')]);return db[_0x47a5('0x54')][_0x47a5('0x18')]({'where':_0x396cb0[_0x47a5('0x33')]})[_0x47a5('0x20')](function(_0x1f07ac){_0xbec033[_0x47a5('0x18')]=_0x1f07ac;if(_0x2a3a57[_0x47a5('0x2b')][_0x47a5('0x3d')]){_0x396cb0['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x396cb0);})['then'](function(_0x490e28){_0xbec033[_0x47a5('0x40')]=_0x490e28;return _0xbec033;});}})['then'](respondWithFilteredResult(_0x3c75c6,_0x396cb0))[_0x47a5('0x41')](handleError(_0x3c75c6,null));};exports[_0x47a5('0x59')]=function(_0x1baa5a,_0x396102,_0x3cd335){var _0x930d25={'raw':!![],'where':{}};var _0x218dfa={};var _0x1c7302={'count':0x0,'rows':[]};return db[_0x47a5('0x3c')][_0x47a5('0x53')]({'where':{'id':_0x1baa5a[_0x47a5('0x43')]['id']}})['then'](handleEntityNotFound(_0x396102,null))[_0x47a5('0x20')](function(_0x1fbd42){if(_0x1fbd42){_0x218dfa[_0x47a5('0x2e')]=_['keys'](db[_0x47a5('0x5a')][_0x47a5('0x29')]);_0x218dfa[_0x47a5('0x2b')]=_['keys'](_0x1baa5a[_0x47a5('0x2b')]);_0x218dfa['filters']=_['intersection'](_0x218dfa[_0x47a5('0x2e')],_0x218dfa[_0x47a5('0x2b')]);_0x930d25[_0x47a5('0x30')]=_[_0x47a5('0x2d')](_0x218dfa[_0x47a5('0x2e')],qs[_0x47a5('0x2f')](_0x1baa5a['query']['fields']));_0x930d25[_0x47a5('0x30')]=_0x930d25['attributes'][_0x47a5('0x44')]?_0x930d25[_0x47a5('0x30')]:_0x218dfa[_0x47a5('0x2e')];if(!_0x1baa5a[_0x47a5('0x2b')]['hasOwnProperty'](_0x47a5('0x55'))){_0x930d25['limit']=qs['limit'](_0x1baa5a[_0x47a5('0x2b')][_0x47a5('0x19')]);_0x930d25['offset']=qs[_0x47a5('0x32')](_0x1baa5a[_0x47a5('0x2b')][_0x47a5('0x32')]);}_0x930d25['order']=qs[_0x47a5('0x57')](_0x1baa5a['query'][_0x47a5('0x57')]);_0x930d25[_0x47a5('0x33')]=qs[_0x47a5('0x2c')](_['pick'](_0x1baa5a[_0x47a5('0x2b')],_0x218dfa[_0x47a5('0x2c')]));_0x930d25[_0x47a5('0x33')]['ProjectId']=_0x1fbd42['id'];if(_0x1baa5a[_0x47a5('0x2b')]['filter']){_0x930d25[_0x47a5('0x33')]=_['merge'](_0x930d25[_0x47a5('0x33')],{'$or':_[_0x47a5('0x37')](_0x930d25[_0x47a5('0x30')],function(_0x211fbf){var _0x51738b={};_0x51738b[_0x211fbf]={'$like':'%'+_0x1baa5a[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x51738b;})});}_0x930d25=_[_0x47a5('0x36')]({},_0x930d25,_0x1baa5a[_0x47a5('0x3b')]);return db[_0x47a5('0x5a')]['count']({'where':_0x930d25['where']})[_0x47a5('0x20')](function(_0x4ab01f){_0x1c7302[_0x47a5('0x18')]=_0x4ab01f;if(_0x1baa5a[_0x47a5('0x2b')][_0x47a5('0x3d')]){_0x930d25['include']=[{'all':!![]}];}return db[_0x47a5('0x5a')][_0x47a5('0x3f')](_0x930d25);})['then'](function(_0xf7fc4e){_0x1c7302[_0x47a5('0x40')]=_0xf7fc4e;return _0x1c7302;});}})[_0x47a5('0x20')](respondWithFilteredResult(_0x396102,_0x930d25))[_0x47a5('0x41')](handleError(_0x396102,null));};function char(_0x58dacd){return'number'===typeof _0x58dacd?String[_0x47a5('0x5b')][_0x47a5('0x1b')](null,arguments):_0x58dacd;}function needsEncapsulation(_0x48e7f3){return!!_0x48e7f3&&(_0x48e7f3[_0x47a5('0x5c')]()[_0x47a5('0x5d')](char(0xd))>=0x0||_0x48e7f3['toString']()[_0x47a5('0x5d')](char(0xa))>=0x0||_0x48e7f3[_0x47a5('0x5c')]()[_0x47a5('0x5d')](char(0x2c))>=0x0||_0x48e7f3['toString']()[_0x47a5('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x59b4a5){var _0x663778=char(0x22),_0x5e2946='\x5c'+char(0x22),_0x243c8b=_0x59b4a5[_0x47a5('0x5c')]()['replace'](new RegExp(_0x663778,'g'),_0x5e2946);return _0x663778+_0x243c8b+_0x663778;}exports[_0x47a5('0x5e')]=function(_0x597cb2,_0x1eabef,_0x36f619){var _0x37e045,_0x2be771;var _0x49b76a={'where':{'ProjectId':_0x597cb2[_0x47a5('0x43')]['id']}};if(_0x597cb2['query']['startTime']){_0x49b76a[_0x47a5('0x33')][_0x47a5('0x5f')]=JSON[_0x47a5('0x60')](_0x597cb2[_0x47a5('0x2b')][_0x47a5('0x61')]);}return db['JscriptySessionReport'][_0x47a5('0x3f')](_0x49b76a)[_0x47a5('0x20')](handleEntityNotFound(_0x1eabef,null))[_0x47a5('0x20')](function(_0x11b68b){if(_0x11b68b){_0x37e045=_0x11b68b;return db['JscriptyQuestionReport'][_0x47a5('0x3f')]({'where':{'SessionId':{'$in':_['map'](_0x37e045,'id')},'ProjectId':_0x597cb2[_0x47a5('0x43')]['id']},'order':_0x47a5('0x62')});}})[_0x47a5('0x20')](handleEntityNotFound(_0x1eabef,null))[_0x47a5('0x20')](function(_0x29a1cf){if(_0x29a1cf){_0x2be771=_0x29a1cf;var _0x3ec264={};for(var _0x92bfd7=0x0,_0x1fec11=_0x2be771[_0x47a5('0x44')];_0x92bfd7<_0x1fec11;_0x92bfd7++){if(!_0x3ec264['hasOwnProperty'](_0x2be771[_0x92bfd7][_0x47a5('0x63')])){_0x3ec264[_0x2be771[_0x92bfd7][_0x47a5('0x63')]]=needsEncapsulation(_0x2be771[_0x92bfd7]['question'])?encapsulate(_0x2be771[_0x92bfd7][_0x47a5('0x64')]):_0x2be771[_0x92bfd7][_0x47a5('0x64')];}}var _0x6d6a5=[],_0x5b85cd={};for(var _0x4bf1f5=0x0,_0x126bb1=_0x37e045[_0x47a5('0x44')];_0x4bf1f5<_0x126bb1;_0x4bf1f5++){_0x5b85cd={'ProjectId':_0x597cb2['params']['id'],'SessionId':_0x37e045[_0x4bf1f5]['id'],'StartTime':moment(_0x37e045[_0x4bf1f5]['starttime'])[_0x47a5('0x65')](_0x47a5('0x66'))};for(var _0x54eab1=0x0,_0x29e384=_0x2be771[_0x47a5('0x44')];_0x54eab1<_0x29e384;_0x54eab1++){if(_0x2be771[_0x54eab1]['SessionId']==_0x37e045[_0x4bf1f5]['id']&&_0x3ec264[_0x47a5('0x31')](_0x2be771[_0x54eab1][_0x47a5('0x63')])){_0x5b85cd[_0x3ec264[_0x2be771[_0x54eab1][_0x47a5('0x63')]]]=_0x2be771[_0x54eab1][_0x47a5('0x67')];}}for(var _0x364bb0 in _0x3ec264){if(!_0x5b85cd[_0x47a5('0x31')](_0x3ec264[_0x364bb0])){_0x5b85cd[_0x3ec264[_0x364bb0]]=null;}}_0x6d6a5['push'](_0x5b85cd);}return _0x6d6a5;}})['then'](function(_0x5bd86e){if(!_[_0x47a5('0x68')](_0x5bd86e)){var _0xce5ada=toCsv(_0x5bd86e);var _0x4e0f2b=Date[_0x47a5('0x69')]();fs[_0x47a5('0x6a')](util[_0x47a5('0x65')](_0x47a5('0x6b'),_0x597cb2[_0x47a5('0x43')]['id'],_0x4e0f2b),_0xce5ada);_0x1eabef['setHeader'](_0x47a5('0x6c'),'attachment;\x20filename='+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x597cb2[_0x47a5('0x43')]['id'],_0x4e0f2b));_0x1eabef['setHeader'](_0x47a5('0x6d'),_0x47a5('0x6e'));return _0x1eabef[_0x47a5('0x6f')](util['format'](_0x47a5('0x6b'),_0x597cb2[_0x47a5('0x43')]['id'],_0x4e0f2b));}else{return _0x1eabef[_0x47a5('0x14')](0xcc);}})[_0x47a5('0x41')](handleError(_0x1eabef,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 9f71ac6..e24fbda 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 _0x7627=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','../../config/logger','api'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7627,0x172));var _0x7762=function(_0x5101d4,_0x2ee56c){_0x5101d4=_0x5101d4-0x0;var _0x41324e=_0x7627[_0x5101d4];return _0x41324e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7762('0x0'))(_0x7762('0x1'));var moment=require(_0x7762('0x2'));var BPromise=require(_0x7762('0x3'));var rp=require(_0x7762('0x4'));var fs=require('fs');var path=require(_0x7762('0x5'));var rimraf=require(_0x7762('0x6'));var config=require(_0x7762('0x7'));var attributes=require(_0x7762('0x8'));module[_0x7762('0x9')]=function(_0x245762,_0x421d21){return _0x245762[_0x7762('0xa')](_0x7762('0xb'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c04=['path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4ab92f,_0x41c7f5){var _0x51566c=function(_0x1687a5){while(--_0x1687a5){_0x4ab92f['push'](_0x4ab92f['shift']());}};_0x51566c(++_0x41c7f5);}(_0x5c04,0xbe));var _0x45c0=function(_0x2bae70,_0x2d7caf){_0x2bae70=_0x2bae70-0x0;var _0x4ffcf5=_0x5c04[_0x2bae70];return _0x4ffcf5;};'use strict';var _=require('lodash');var util=require(_0x45c0('0x0'));var logger=require(_0x45c0('0x1'))(_0x45c0('0x2'));var moment=require(_0x45c0('0x3'));var BPromise=require(_0x45c0('0x4'));var rp=require(_0x45c0('0x5'));var fs=require('fs');var path=require(_0x45c0('0x6'));var rimraf=require(_0x45c0('0x7'));var config=require(_0x45c0('0x8'));var attributes=require(_0x45c0('0x9'));module[_0x45c0('0xa')]=function(_0x52ccd5,_0x564603){return _0x52ccd5[_0x45c0('0xb')](_0x45c0('0xc'),attributes,{'tableName':_0x45c0('0xd'),'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 c5bd205..78aada8 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 _0x663e=['request\x20sent','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','JscriptyProject,\x20%s,\x20%s'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0x663e,0xee));var _0xe663=function(_0x5b44d5,_0x31c990){_0x5b44d5=_0x5b44d5-0x0;var _0x57234c=_0x663e[_0x5b44d5];return _0x57234c;};'use strict';var _=require(_0xe663('0x0'));var util=require('util');var moment=require(_0xe663('0x1'));var BPromise=require('bluebird');var rs=require(_0xe663('0x2'));var fs=require('fs');var Redis=require(_0xe663('0x3'));var db=require(_0xe663('0x4'))['db'];var utils=require(_0xe663('0x5'));var logger=require(_0xe663('0x6'))('rpc');var config=require(_0xe663('0x7'));var jayson=require(_0xe663('0x8'));var client=jayson[_0xe663('0x9')][_0xe663('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4efff0,_0x5c9c95,_0xdfc724){return new BPromise(function(_0x58b4f2,_0x50346f){return client[_0xe663('0xb')](_0x4efff0,_0xdfc724)['then'](function(_0x2cda33){logger[_0xe663('0xc')](_0xe663('0xd'),_0x5c9c95,_0xe663('0xe'));logger['debug'](_0xe663('0xf'),_0x5c9c95,_0xe663('0xe'),JSON[_0xe663('0x10')](_0x2cda33));if(_0x2cda33['error']){if(_0x2cda33[_0xe663('0x11')][_0xe663('0x12')]===0x1f4){logger[_0xe663('0x11')](_0xe663('0xd'),_0x5c9c95,_0x2cda33[_0xe663('0x11')][_0xe663('0x13')]);return _0x50346f(_0x2cda33[_0xe663('0x11')]['message']);}logger[_0xe663('0x11')](_0xe663('0xd'),_0x5c9c95,_0x2cda33[_0xe663('0x11')][_0xe663('0x13')]);return _0x58b4f2(_0x2cda33[_0xe663('0x11')][_0xe663('0x13')]);}else{logger[_0xe663('0xc')](_0xe663('0xd'),_0x5c9c95,_0xe663('0xe'));_0x58b4f2(_0x2cda33[_0xe663('0x14')][_0xe663('0x13')]);}})['catch'](function(_0x47198f){logger['error'](_0xe663('0xd'),_0x5c9c95,_0x47198f);_0x50346f(_0x47198f);});});} \ No newline at end of file +var _0xba2f=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request\x20sent','debug','stringify','error','JscriptyProject,\x20%s,\x20%s','message','info','result','catch'];(function(_0x591e16,_0x5aefc1){var _0x543b35=function(_0x81e3be){while(--_0x81e3be){_0x591e16['push'](_0x591e16['shift']());}};_0x543b35(++_0x5aefc1);}(_0xba2f,0xbd));var _0xfba2=function(_0x531049,_0x369227){_0x531049=_0x531049-0x0;var _0x18151b=_0xba2f[_0x531049];return _0x18151b;};'use strict';var _=require(_0xfba2('0x0'));var util=require(_0xfba2('0x1'));var moment=require(_0xfba2('0x2'));var BPromise=require(_0xfba2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfba2('0x4'));var db=require(_0xfba2('0x5'))['db'];var utils=require(_0xfba2('0x6'));var logger=require(_0xfba2('0x7'))(_0xfba2('0x8'));var config=require(_0xfba2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfba2('0xa')][_0xfba2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2518d3,_0x2227e8,_0xde879b){return new BPromise(function(_0x428aae,_0x191dc8){return client['request'](_0x2518d3,_0xde879b)['then'](function(_0x574e8e){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2227e8,_0xfba2('0xc'));logger[_0xfba2('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2227e8,'request\x20sent',JSON[_0xfba2('0xe')](_0x574e8e));if(_0x574e8e[_0xfba2('0xf')]){if(_0x574e8e[_0xfba2('0xf')]['code']===0x1f4){logger[_0xfba2('0xf')](_0xfba2('0x10'),_0x2227e8,_0x574e8e[_0xfba2('0xf')][_0xfba2('0x11')]);return _0x191dc8(_0x574e8e[_0xfba2('0xf')][_0xfba2('0x11')]);}logger[_0xfba2('0xf')](_0xfba2('0x10'),_0x2227e8,_0x574e8e[_0xfba2('0xf')][_0xfba2('0x11')]);return _0x428aae(_0x574e8e['error'][_0xfba2('0x11')]);}else{logger[_0xfba2('0x12')](_0xfba2('0x10'),_0x2227e8,_0xfba2('0xc'));_0x428aae(_0x574e8e[_0xfba2('0x13')][_0xfba2('0x11')]);}})[_0xfba2('0x14')](function(_0x5f1011){logger[_0xfba2('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2227e8,_0x5f1011);_0x191dc8(_0x5f1011);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 315fe43..e3f2ccc 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 _0x6001=['isAuthenticated','describe','/:id','show','post','create','put','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe'];(function(_0x26fb16,_0x4d40ad){var _0x1e6e90=function(_0x2dd264){while(--_0x2dd264){_0x26fb16['push'](_0x26fb16['shift']());}};_0x1e6e90(++_0x4d40ad);}(_0x6001,0x1d5));var _0x1600=function(_0x4c96e4,_0x2fe2ea){_0x4c96e4=_0x4c96e4-0x0;var _0x2dd5d2=_0x6001[_0x4c96e4];return _0x2dd5d2;};'use strict';var multer=require(_0x1600('0x0'));var util=require(_0x1600('0x1'));var path=require('path');var timeout=require(_0x1600('0x2'));var express=require(_0x1600('0x3'));var router=express['Router']();var auth=require(_0x1600('0x4'));var interaction=require(_0x1600('0x5'));var config=require(_0x1600('0x6'));var controller=require(_0x1600('0x7'));router[_0x1600('0x8')]('/',auth['isAuthenticated'](),controller[_0x1600('0x9')]);router['get'](_0x1600('0xa'),auth[_0x1600('0xb')](),controller[_0x1600('0xc')]);router[_0x1600('0x8')](_0x1600('0xd'),auth[_0x1600('0xb')](),controller[_0x1600('0xe')]);router[_0x1600('0xf')]('/',auth[_0x1600('0xb')](),controller[_0x1600('0x10')]);router[_0x1600('0x11')](_0x1600('0xd'),auth[_0x1600('0xb')](),controller['update']);router['delete'](_0x1600('0xd'),auth[_0x1600('0xb')](),controller[_0x1600('0x12')]);module[_0x1600('0x13')]=router; \ No newline at end of file +var _0x53a4=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','util','path','connect-timeout','express','Router'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x53a4,0x151));var _0x453a=function(_0x4e58e3,_0x9c4995){_0x4e58e3=_0x4e58e3-0x0;var _0x11927a=_0x53a4[_0x4e58e3];return _0x11927a;};'use strict';var multer=require('multer');var util=require(_0x453a('0x0'));var path=require(_0x453a('0x1'));var timeout=require(_0x453a('0x2'));var express=require(_0x453a('0x3'));var router=express[_0x453a('0x4')]();var auth=require(_0x453a('0x5'));var interaction=require(_0x453a('0x6'));var config=require(_0x453a('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0x453a('0x8')]('/',auth[_0x453a('0x9')](),controller[_0x453a('0xa')]);router['get'](_0x453a('0xb'),auth[_0x453a('0x9')](),controller['describe']);router[_0x453a('0x8')](_0x453a('0xc'),auth[_0x453a('0x9')](),controller[_0x453a('0xd')]);router[_0x453a('0xe')]('/',auth[_0x453a('0x9')](),controller[_0x453a('0xf')]);router[_0x453a('0x10')](_0x453a('0xc'),auth[_0x453a('0x9')](),controller[_0x453a('0x11')]);router['delete']('/:id',auth[_0x453a('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index c34d43c..2e26185 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 _0xe7d7=['sequelize','exports','long','STRING'];(function(_0x96cefd,_0x25cb5d){var _0x4310c1=function(_0x4e9c5f){while(--_0x4e9c5f){_0x96cefd['push'](_0x96cefd['shift']());}};_0x4310c1(++_0x25cb5d);}(_0xe7d7,0x1b0));var _0x7e7d=function(_0x54394b,_0x5e1f19){_0x54394b=_0x54394b-0x0;var _0x356ae1=_0xe7d7[_0x54394b];return _0x356ae1;};'use strict';var Sequelize=require(_0x7e7d('0x0'));module[_0x7e7d('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize['TEXT'](_0x7e7d('0x2'))},'membername':{'type':Sequelize[_0x7e7d('0x3')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x7e7d('0x3')]},'uniqueid':{'type':Sequelize[_0x7e7d('0x3')]},'calleridname':{'type':Sequelize[_0x7e7d('0x3')]},'calleridnum':{'type':Sequelize[_0x7e7d('0x3')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0ff7=['TEXT','long','sequelize','STRING'];(function(_0x47932a,_0x54cc54){var _0x447d24=function(_0x2123d1){while(--_0x2123d1){_0x47932a['push'](_0x47932a['shift']());}};_0x447d24(++_0x54cc54);}(_0x0ff7,0x102));var _0x70ff=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x0ff7[_0x5f3f88];return _0xd08119;};'use strict';var Sequelize=require(_0x70ff('0x0'));module['exports']={'question':{'type':Sequelize[_0x70ff('0x1')]},'answer':{'type':Sequelize[_0x70ff('0x2')](_0x70ff('0x3'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x70ff('0x1')]},'queue':{'type':Sequelize[_0x70ff('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x70ff('0x1')]},'questionId':{'type':Sequelize[_0x70ff('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 7c00fc3..2ea1b3f 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 _0x8710=['keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','JscriptyQuestionReport','includeAll','rows','show','params','include','find','catch','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','model'];(function(_0x5b61a6,_0x224238){var _0x231578=function(_0x59e192){while(--_0x59e192){_0x5b61a6['push'](_0x5b61a6['shift']());}};_0x231578(++_0x224238);}(_0x8710,0x68));var _0x0871=function(_0x58e9bb,_0x546894){_0x58e9bb=_0x58e9bb-0x0;var _0x1da546=_0x8710[_0x58e9bb];return _0x1da546;};'use strict';var pdf=require(_0x0871('0x0'));var emlformat=require(_0x0871('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0871('0x2'));var jsonpatch=require(_0x0871('0x3'));var rp=require(_0x0871('0x4'));var moment=require('moment');var BPromise=require(_0x0871('0x5'));var Mustache=require(_0x0871('0x6'));var util=require('util');var path=require(_0x0871('0x7'));var sox=require('sox');var csv=require(_0x0871('0x8'));var ejs=require(_0x0871('0x9'));var fs=require('fs');var _=require(_0x0871('0xa'));var squel=require(_0x0871('0xb'));var crypto=require(_0x0871('0xc'));var jsforce=require(_0x0871('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0871('0x8'));var querystring=require(_0x0871('0xe'));var Papa=require(_0x0871('0xf'));var Redis=require(_0x0871('0x10'));var authService=require(_0x0871('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0871('0x12'));var logger=require(_0x0871('0x13'))(_0x0871('0x14'));var utils=require(_0x0871('0x15'));var config=require(_0x0871('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd833bd,_0x3d14be){_0x3d14be=_0x3d14be||0xcc;return function(_0xc94c7b){if(_0xc94c7b){return _0xd833bd[_0x0871('0x17')](_0x3d14be);}return _0xd833bd[_0x0871('0x18')](_0x3d14be)[_0x0871('0x19')]();};}function respondWithResult(_0xe0925d,_0x3b111e){_0x3b111e=_0x3b111e||0xc8;return function(_0x552807){if(_0x552807){return _0xe0925d['status'](_0x3b111e)[_0x0871('0x1a')](_0x552807);}};}function respondWithFilteredResult(_0x1bc43e,_0x14bc80){return function(_0xcba761){if(_0xcba761){var _0x153f30=_0xcba761[_0x0871('0x1b')],_0x2dde49=_0x14bc80['offset'],_0x43ccae=_0x14bc80[_0x0871('0x1c')]+_0x14bc80['limit'],_0x1d4858;if(_0x43ccae>=_0x153f30){_0x43ccae=_0x153f30;_0x1d4858=0xc8;}else{_0x1d4858=0xce;}_0x1bc43e[_0x0871('0x18')](_0x1d4858);return _0x1bc43e[_0x0871('0x1d')]('Content-Range',_0x2dde49+'-'+_0x43ccae+'/'+_0x153f30)[_0x0871('0x1a')](_0xcba761);}return null;};}function patchUpdates(_0x22db5a){return function(_0x10ad02){try{jsonpatch[_0x0871('0x1e')](_0x10ad02,_0x22db5a,!![]);}catch(_0x4d2033){return BPromise['reject'](_0x4d2033);}return _0x10ad02[_0x0871('0x1f')]();};}function saveUpdates(_0x440ac1,_0x23613c){return function(_0x1c7426){if(_0x1c7426){return _0x1c7426[_0x0871('0x20')](_0x440ac1)[_0x0871('0x21')](function(_0x360dd2){return _0x360dd2;});}return null;};}function removeEntity(_0x25e519,_0x2e977c){return function(_0x10ecb6){if(_0x10ecb6){return _0x10ecb6[_0x0871('0x22')]()[_0x0871('0x21')](function(){_0x25e519[_0x0871('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x292e57,_0xe92246){return function(_0x20ca39){if(!_0x20ca39){_0x292e57[_0x0871('0x17')](0x194);}return _0x20ca39;};}function handleError(_0x4df19e,_0x15fe61){_0x15fe61=_0x15fe61||0x1f4;return function(_0x3ac5c0){logger[_0x0871('0x23')](_0x3ac5c0[_0x0871('0x24')]);if(_0x3ac5c0['name']){delete _0x3ac5c0[_0x0871('0x25')];}_0x4df19e['status'](_0x15fe61)[_0x0871('0x26')](_0x3ac5c0);};}exports[_0x0871('0x27')]=function(_0x128720,_0x2eb02a){var _0x367b41={},_0x37b516={},_0x31b331={'count':0x0,'rows':[]};var _0x2787cb=db['JscriptyQuestionReport'][_0x0871('0x28')];_0x37b516[_0x0871('0x29')]=_[_0x0871('0x2a')](_0x2787cb);_0x37b516[_0x0871('0x2b')]=_[_0x0871('0x2a')](_0x128720[_0x0871('0x2b')]);_0x37b516[_0x0871('0x2c')]=_[_0x0871('0x2d')](_0x37b516[_0x0871('0x29')],_0x37b516[_0x0871('0x2b')]);_0x367b41['attributes']=_[_0x0871('0x2d')](_0x37b516[_0x0871('0x29')],qs[_0x0871('0x2e')](_0x128720[_0x0871('0x2b')]['fields']));_0x367b41[_0x0871('0x2f')]=_0x367b41[_0x0871('0x2f')][_0x0871('0x30')]?_0x367b41[_0x0871('0x2f')]:_0x37b516['model'];if(!_0x128720['query'][_0x0871('0x31')]('nolimit')){_0x367b41[_0x0871('0x32')]=qs[_0x0871('0x32')](_0x128720[_0x0871('0x2b')][_0x0871('0x32')]);_0x367b41['offset']=qs[_0x0871('0x1c')](_0x128720[_0x0871('0x2b')][_0x0871('0x1c')]);}_0x367b41[_0x0871('0x33')]=qs[_0x0871('0x34')](_0x128720[_0x0871('0x2b')][_0x0871('0x34')]);_0x367b41[_0x0871('0x35')]=qs[_0x0871('0x2c')](_['pick'](_0x128720[_0x0871('0x2b')],_0x37b516[_0x0871('0x2c')]));if(_0x128720['query'][_0x0871('0x36')]){_0x367b41[_0x0871('0x35')]=_[_0x0871('0x37')](_0x367b41[_0x0871('0x35')],{'$or':_[_0x0871('0x38')](_0x2787cb,function(_0x2d78e4){if(_0x2d78e4[_0x0871('0x39')][_0x0871('0x3a')]!==_0x0871('0x3b')){var _0x165162={};_0x165162[_0x2d78e4[_0x0871('0x3c')]]={'$like':'%'+_0x128720[_0x0871('0x2b')][_0x0871('0x36')]+'%'};return _0x165162;}})});}_0x367b41=_[_0x0871('0x37')]({},_0x367b41,_0x128720[_0x0871('0x3d')]);var _0x1c11da={'where':_0x367b41[_0x0871('0x35')]};return db[_0x0871('0x3e')]['count'](_0x1c11da)[_0x0871('0x21')](function(_0x2d3899){_0x31b331[_0x0871('0x1b')]=_0x2d3899;if(_0x128720[_0x0871('0x2b')][_0x0871('0x3f')]){_0x367b41['include']=[{'all':!![]}];}return db[_0x0871('0x3e')]['findAll'](_0x367b41);})[_0x0871('0x21')](function(_0x435e57){_0x31b331[_0x0871('0x40')]=_0x435e57;return _0x31b331;})[_0x0871('0x21')](respondWithFilteredResult(_0x2eb02a,_0x367b41))['catch'](handleError(_0x2eb02a,null));};exports[_0x0871('0x41')]=function(_0x28d6da,_0x997a3a){var _0x4a3f1d={'raw':!![],'where':{'id':_0x28d6da[_0x0871('0x42')]['id']}},_0xfc8934={};_0xfc8934[_0x0871('0x29')]=_[_0x0871('0x2a')](db[_0x0871('0x3e')][_0x0871('0x28')]);_0xfc8934[_0x0871('0x2b')]=_['keys'](_0x28d6da[_0x0871('0x2b')]);_0xfc8934[_0x0871('0x2c')]=_[_0x0871('0x2d')](_0xfc8934[_0x0871('0x29')],_0xfc8934[_0x0871('0x2b')]);_0x4a3f1d[_0x0871('0x2f')]=_[_0x0871('0x2d')](_0xfc8934[_0x0871('0x29')],qs[_0x0871('0x2e')](_0x28d6da[_0x0871('0x2b')][_0x0871('0x2e')]));_0x4a3f1d[_0x0871('0x2f')]=_0x4a3f1d['attributes'][_0x0871('0x30')]?_0x4a3f1d['attributes']:_0xfc8934[_0x0871('0x29')];if(_0x28d6da['query']['includeAll']){_0x4a3f1d[_0x0871('0x43')]=[{'all':!![]}];}_0x4a3f1d=_[_0x0871('0x37')]({},_0x4a3f1d,_0x28d6da[_0x0871('0x3d')]);return db[_0x0871('0x3e')][_0x0871('0x44')](_0x4a3f1d)[_0x0871('0x21')](handleEntityNotFound(_0x997a3a,null))[_0x0871('0x21')](respondWithResult(_0x997a3a,null))[_0x0871('0x45')](handleError(_0x997a3a,null));};exports[_0x0871('0x46')]=function(_0x402722,_0x41e7b0){return db['JscriptyQuestionReport']['create'](_0x402722[_0x0871('0x47')],{})[_0x0871('0x21')](respondWithResult(_0x41e7b0,0xc9))[_0x0871('0x45')](handleError(_0x41e7b0,null));};exports[_0x0871('0x20')]=function(_0x5f2f41,_0xd20bd7){if(_0x5f2f41['body']['id']){delete _0x5f2f41[_0x0871('0x47')]['id'];}return db[_0x0871('0x3e')]['find']({'where':{'id':_0x5f2f41[_0x0871('0x42')]['id']}})[_0x0871('0x21')](handleEntityNotFound(_0xd20bd7,null))['then'](saveUpdates(_0x5f2f41[_0x0871('0x47')],null))['then'](respondWithResult(_0xd20bd7,null))[_0x0871('0x45')](handleError(_0xd20bd7,null));};exports[_0x0871('0x22')]=function(_0x2cfa7d,_0x1799fe){return db[_0x0871('0x3e')]['find']({'where':{'id':_0x2cfa7d[_0x0871('0x42')]['id']}})['then'](handleEntityNotFound(_0x1799fe,null))['then'](removeEntity(_0x1799fe,null))[_0x0871('0x45')](handleError(_0x1799fe,null));};exports[_0x0871('0x48')]=function(_0x3b7359,_0x33f6f0){return db[_0x0871('0x3e')]['describe']()[_0x0871('0x21')](respondWithResult(_0x33f6f0,null))[_0x0871('0x45')](handleError(_0x33f6f0,null));}; \ No newline at end of file +var _0x3d04=['json','offset','limit','set','reject','update','then','destroy','sendStatus','stack','name','send','JscriptyQuestionReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','count','includeAll','findAll','rows','catch','show','include','create','body','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end'];(function(_0x264609,_0x7609b9){var _0x1f38b9=function(_0x641c96){while(--_0x641c96){_0x264609['push'](_0x264609['shift']());}};_0x1f38b9(++_0x7609b9);}(_0x3d04,0xbe));var _0x43d0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3d04[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0x43d0('0x0'));var emlformat=require(_0x43d0('0x1'));var rimraf=require(_0x43d0('0x2'));var zipdir=require(_0x43d0('0x3'));var jsonpatch=require(_0x43d0('0x4'));var rp=require(_0x43d0('0x5'));var moment=require(_0x43d0('0x6'));var BPromise=require(_0x43d0('0x7'));var Mustache=require('mustache');var util=require(_0x43d0('0x8'));var path=require(_0x43d0('0x9'));var sox=require(_0x43d0('0xa'));var csv=require(_0x43d0('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x43d0('0xc'));var deskjs=require(_0x43d0('0xd'));var toCsv=require(_0x43d0('0xb'));var querystring=require(_0x43d0('0xe'));var Papa=require(_0x43d0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43d0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x43d0('0x11'));var utils=require(_0x43d0('0x12'));var config=require(_0x43d0('0x13'));var db=require(_0x43d0('0x14'))['db'];function respondWithStatusCode(_0x4a93ab,_0x45e9b2){_0x45e9b2=_0x45e9b2||0xcc;return function(_0x23daaa){if(_0x23daaa){return _0x4a93ab['sendStatus'](_0x45e9b2);}return _0x4a93ab[_0x43d0('0x15')](_0x45e9b2)[_0x43d0('0x16')]();};}function respondWithResult(_0x1b4f09,_0x5ed340){_0x5ed340=_0x5ed340||0xc8;return function(_0xd262a8){if(_0xd262a8){return _0x1b4f09[_0x43d0('0x15')](_0x5ed340)[_0x43d0('0x17')](_0xd262a8);}};}function respondWithFilteredResult(_0x47f3c6,_0x257510){return function(_0x357f87){if(_0x357f87){var _0x44e6ec=_0x357f87['count'],_0x1218b5=_0x257510[_0x43d0('0x18')],_0x91b4a1=_0x257510[_0x43d0('0x18')]+_0x257510[_0x43d0('0x19')],_0x4aa32a;if(_0x91b4a1>=_0x44e6ec){_0x91b4a1=_0x44e6ec;_0x4aa32a=0xc8;}else{_0x4aa32a=0xce;}_0x47f3c6['status'](_0x4aa32a);return _0x47f3c6[_0x43d0('0x1a')]('Content-Range',_0x1218b5+'-'+_0x91b4a1+'/'+_0x44e6ec)[_0x43d0('0x17')](_0x357f87);}return null;};}function patchUpdates(_0x468ca2){return function(_0x2ef23f){try{jsonpatch['apply'](_0x2ef23f,_0x468ca2,!![]);}catch(_0x3d7dcc){return BPromise[_0x43d0('0x1b')](_0x3d7dcc);}return _0x2ef23f['save']();};}function saveUpdates(_0x474d96,_0x135126){return function(_0x348429){if(_0x348429){return _0x348429[_0x43d0('0x1c')](_0x474d96)[_0x43d0('0x1d')](function(_0x28381b){return _0x28381b;});}return null;};}function removeEntity(_0x39fe00,_0x1e7993){return function(_0x30febc){if(_0x30febc){return _0x30febc[_0x43d0('0x1e')]()[_0x43d0('0x1d')](function(){_0x39fe00[_0x43d0('0x15')](0xcc)[_0x43d0('0x16')]();});}};}function handleEntityNotFound(_0xbc72e6,_0x2efd77){return function(_0x48aa18){if(!_0x48aa18){_0xbc72e6[_0x43d0('0x1f')](0x194);}return _0x48aa18;};}function handleError(_0x1bf6ae,_0x509041){_0x509041=_0x509041||0x1f4;return function(_0x1fe708){logger['error'](_0x1fe708[_0x43d0('0x20')]);if(_0x1fe708[_0x43d0('0x21')]){delete _0x1fe708['name'];}_0x1bf6ae[_0x43d0('0x15')](_0x509041)[_0x43d0('0x22')](_0x1fe708);};}exports['index']=function(_0x12df30,_0x4692bc){var _0x22ae3c={},_0x5f16ac={},_0x447725={'count':0x0,'rows':[]};var _0x38e89e=db[_0x43d0('0x23')][_0x43d0('0x24')];_0x5f16ac[_0x43d0('0x25')]=_[_0x43d0('0x26')](_0x38e89e);_0x5f16ac[_0x43d0('0x27')]=_['keys'](_0x12df30[_0x43d0('0x27')]);_0x5f16ac[_0x43d0('0x28')]=_[_0x43d0('0x29')](_0x5f16ac['model'],_0x5f16ac['query']);_0x22ae3c['attributes']=_[_0x43d0('0x29')](_0x5f16ac[_0x43d0('0x25')],qs[_0x43d0('0x2a')](_0x12df30[_0x43d0('0x27')][_0x43d0('0x2a')]));_0x22ae3c[_0x43d0('0x2b')]=_0x22ae3c['attributes'][_0x43d0('0x2c')]?_0x22ae3c[_0x43d0('0x2b')]:_0x5f16ac[_0x43d0('0x25')];if(!_0x12df30[_0x43d0('0x27')][_0x43d0('0x2d')](_0x43d0('0x2e'))){_0x22ae3c[_0x43d0('0x19')]=qs[_0x43d0('0x19')](_0x12df30[_0x43d0('0x27')][_0x43d0('0x19')]);_0x22ae3c[_0x43d0('0x18')]=qs['offset'](_0x12df30[_0x43d0('0x27')][_0x43d0('0x18')]);}_0x22ae3c[_0x43d0('0x2f')]=qs[_0x43d0('0x30')](_0x12df30['query'][_0x43d0('0x30')]);_0x22ae3c['where']=qs[_0x43d0('0x28')](_[_0x43d0('0x31')](_0x12df30['query'],_0x5f16ac[_0x43d0('0x28')]));if(_0x12df30[_0x43d0('0x27')][_0x43d0('0x32')]){_0x22ae3c[_0x43d0('0x33')]=_[_0x43d0('0x34')](_0x22ae3c[_0x43d0('0x33')],{'$or':_[_0x43d0('0x35')](_0x38e89e,function(_0x21d26e){if(_0x21d26e[_0x43d0('0x36')][_0x43d0('0x37')]!==_0x43d0('0x38')){var _0x498334={};_0x498334[_0x21d26e[_0x43d0('0x39')]]={'$like':'%'+_0x12df30[_0x43d0('0x27')][_0x43d0('0x32')]+'%'};return _0x498334;}})});}_0x22ae3c=_[_0x43d0('0x34')]({},_0x22ae3c,_0x12df30[_0x43d0('0x3a')]);var _0x201453={'where':_0x22ae3c[_0x43d0('0x33')]};return db[_0x43d0('0x23')][_0x43d0('0x3b')](_0x201453)[_0x43d0('0x1d')](function(_0x235fb2){_0x447725[_0x43d0('0x3b')]=_0x235fb2;if(_0x12df30[_0x43d0('0x27')][_0x43d0('0x3c')]){_0x22ae3c['include']=[{'all':!![]}];}return db[_0x43d0('0x23')][_0x43d0('0x3d')](_0x22ae3c);})[_0x43d0('0x1d')](function(_0xc3f9c7){_0x447725[_0x43d0('0x3e')]=_0xc3f9c7;return _0x447725;})[_0x43d0('0x1d')](respondWithFilteredResult(_0x4692bc,_0x22ae3c))[_0x43d0('0x3f')](handleError(_0x4692bc,null));};exports[_0x43d0('0x40')]=function(_0x4ae965,_0x5b536c){var _0x45566a={'raw':!![],'where':{'id':_0x4ae965['params']['id']}},_0x5ad2d0={};_0x5ad2d0[_0x43d0('0x25')]=_['keys'](db[_0x43d0('0x23')]['rawAttributes']);_0x5ad2d0[_0x43d0('0x27')]=_['keys'](_0x4ae965[_0x43d0('0x27')]);_0x5ad2d0[_0x43d0('0x28')]=_[_0x43d0('0x29')](_0x5ad2d0['model'],_0x5ad2d0[_0x43d0('0x27')]);_0x45566a['attributes']=_[_0x43d0('0x29')](_0x5ad2d0['model'],qs['fields'](_0x4ae965[_0x43d0('0x27')][_0x43d0('0x2a')]));_0x45566a['attributes']=_0x45566a[_0x43d0('0x2b')][_0x43d0('0x2c')]?_0x45566a[_0x43d0('0x2b')]:_0x5ad2d0[_0x43d0('0x25')];if(_0x4ae965[_0x43d0('0x27')]['includeAll']){_0x45566a[_0x43d0('0x41')]=[{'all':!![]}];}_0x45566a=_[_0x43d0('0x34')]({},_0x45566a,_0x4ae965[_0x43d0('0x3a')]);return db[_0x43d0('0x23')]['find'](_0x45566a)[_0x43d0('0x1d')](handleEntityNotFound(_0x5b536c,null))[_0x43d0('0x1d')](respondWithResult(_0x5b536c,null))[_0x43d0('0x3f')](handleError(_0x5b536c,null));};exports[_0x43d0('0x42')]=function(_0x5e9000,_0x52d26a){return db[_0x43d0('0x23')][_0x43d0('0x42')](_0x5e9000['body'],{})[_0x43d0('0x1d')](respondWithResult(_0x52d26a,0xc9))[_0x43d0('0x3f')](handleError(_0x52d26a,null));};exports[_0x43d0('0x1c')]=function(_0x4c6a26,_0x5c6bb1){if(_0x4c6a26['body']['id']){delete _0x4c6a26[_0x43d0('0x43')]['id'];}return db['JscriptyQuestionReport'][_0x43d0('0x44')]({'where':{'id':_0x4c6a26[_0x43d0('0x45')]['id']}})[_0x43d0('0x1d')](handleEntityNotFound(_0x5c6bb1,null))[_0x43d0('0x1d')](saveUpdates(_0x4c6a26[_0x43d0('0x43')],null))['then'](respondWithResult(_0x5c6bb1,null))[_0x43d0('0x3f')](handleError(_0x5c6bb1,null));};exports['destroy']=function(_0x5a6364,_0x3e7392){return db[_0x43d0('0x23')][_0x43d0('0x44')]({'where':{'id':_0x5a6364[_0x43d0('0x45')]['id']}})[_0x43d0('0x1d')](handleEntityNotFound(_0x3e7392,null))[_0x43d0('0x1d')](removeEntity(_0x3e7392,null))[_0x43d0('0x3f')](handleError(_0x3e7392,null));};exports[_0x43d0('0x46')]=function(_0x313c3e,_0x27affd){return db[_0x43d0('0x23')]['describe']()[_0x43d0('0x1d')](respondWithResult(_0x27affd,null))[_0x43d0('0x3f')](handleError(_0x27affd,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 1afeab8..1d6f685 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 _0x3da0=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./jscriptyQuestionReport.attributes','exports','lodash','util'];(function(_0x2207dc,_0x2b2c9c){var _0x26213d=function(_0x1bf3b3){while(--_0x1bf3b3){_0x2207dc['push'](_0x2207dc['shift']());}};_0x26213d(++_0x2b2c9c);}(_0x3da0,0x76));var _0x03da=function(_0xa8369a,_0x3d2319){_0xa8369a=_0xa8369a-0x0;var _0x4b74b7=_0x3da0[_0xa8369a];return _0x4b74b7;};'use strict';var _=require(_0x03da('0x0'));var util=require(_0x03da('0x1'));var logger=require(_0x03da('0x2'))('api');var moment=require(_0x03da('0x3'));var BPromise=require(_0x03da('0x4'));var rp=require(_0x03da('0x5'));var fs=require('fs');var path=require(_0x03da('0x6'));var rimraf=require(_0x03da('0x7'));var config=require('../../config/environment');var attributes=require(_0x03da('0x8'));module[_0x03da('0x9')]=function(_0x4675f1,_0x5b2455){return _0x4675f1['define']('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x487d=['api','moment','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x487d,0x99));var _0xd487=function(_0x58c654,_0x56f774){_0x58c654=_0x58c654-0x0;var _0x1b1164=_0x487d[_0x58c654];return _0x1b1164;};'use strict';var _=require(_0xd487('0x0'));var util=require(_0xd487('0x1'));var logger=require(_0xd487('0x2'))(_0xd487('0x3'));var moment=require(_0xd487('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd487('0x5'));var rimraf=require('rimraf');var config=require(_0xd487('0x6'));var attributes=require(_0xd487('0x7'));module[_0xd487('0x8')]=function(_0x434b28,_0xcb648e){return _0x434b28[_0xd487('0x9')](_0xd487('0xa'),attributes,{'tableName':_0xd487('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 1a6e308..9428a8b 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 _0x636c=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1c184b,_0x4d61b4){var _0x22bcf0=function(_0x5c4802){while(--_0x5c4802){_0x1c184b['push'](_0x1c184b['shift']());}};_0x22bcf0(++_0x4d61b4);}(_0x636c,0x8b));var _0xc636=function(_0x2992c3,_0x25a9c0){_0x2992c3=_0x2992c3-0x0;var _0xcd98b5=_0x636c[_0x2992c3];return _0xcd98b5;};'use strict';var _=require(_0xc636('0x0'));var util=require(_0xc636('0x1'));var moment=require(_0xc636('0x2'));var BPromise=require(_0xc636('0x3'));var rs=require(_0xc636('0x4'));var fs=require('fs');var Redis=require(_0xc636('0x5'));var db=require(_0xc636('0x6'))['db'];var utils=require(_0xc636('0x7'));var logger=require(_0xc636('0x8'))(_0xc636('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc636('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x294e90,_0x21d997,_0x5ac6c0){return new BPromise(function(_0x1626e0,_0x692e1e){return client[_0xc636('0xb')](_0x294e90,_0x5ac6c0)[_0xc636('0xc')](function(_0x59ddaa){logger[_0xc636('0xd')](_0xc636('0xe'),_0x21d997,_0xc636('0xf'));logger['debug'](_0xc636('0x10'),_0x21d997,_0xc636('0xf'),JSON[_0xc636('0x11')](_0x59ddaa));if(_0x59ddaa[_0xc636('0x12')]){if(_0x59ddaa[_0xc636('0x12')][_0xc636('0x13')]===0x1f4){logger[_0xc636('0x12')](_0xc636('0xe'),_0x21d997,_0x59ddaa[_0xc636('0x12')][_0xc636('0x14')]);return _0x692e1e(_0x59ddaa['error'][_0xc636('0x14')]);}logger[_0xc636('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x21d997,_0x59ddaa[_0xc636('0x12')][_0xc636('0x14')]);return _0x1626e0(_0x59ddaa[_0xc636('0x12')][_0xc636('0x14')]);}else{logger[_0xc636('0xd')](_0xc636('0xe'),_0x21d997,_0xc636('0xf'));_0x1626e0(_0x59ddaa[_0xc636('0x15')]['message']);}})[_0xc636('0x16')](function(_0x5058b4){logger[_0xc636('0x12')](_0xc636('0xe'),_0x21d997,_0x5058b4);_0x692e1e(_0x5058b4);});});} \ No newline at end of file +var _0x1109=['JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','code','error','JscriptyQuestionReport,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','request\x20sent','debug'];(function(_0x208bc9,_0x4f36f6){var _0x2675a8=function(_0x452e72){while(--_0x452e72){_0x208bc9['push'](_0x208bc9['shift']());}};_0x2675a8(++_0x4f36f6);}(_0x1109,0x1d3));var _0x9110=function(_0x1c0781,_0x4a19f1){_0x1c0781=_0x1c0781-0x0;var _0x1f577e=_0x1109[_0x1c0781];return _0x1f577e;};'use strict';var _=require(_0x9110('0x0'));var util=require(_0x9110('0x1'));var moment=require(_0x9110('0x2'));var BPromise=require(_0x9110('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9110('0x4'));var db=require(_0x9110('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9110('0x6'))(_0x9110('0x7'));var config=require(_0x9110('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9110('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bd75d,_0x4fb225,_0x3f7db0){return new BPromise(function(_0x234b83,_0x13eeb9){return client['request'](_0x2bd75d,_0x3f7db0)[_0x9110('0xa')](function(_0x17fb2e){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x4fb225,_0x9110('0xb'));logger[_0x9110('0xc')](_0x9110('0xd'),_0x4fb225,_0x9110('0xb'),JSON['stringify'](_0x17fb2e));if(_0x17fb2e['error']){if(_0x17fb2e['error'][_0x9110('0xe')]===0x1f4){logger[_0x9110('0xf')](_0x9110('0x10'),_0x4fb225,_0x17fb2e[_0x9110('0xf')][_0x9110('0x11')]);return _0x13eeb9(_0x17fb2e[_0x9110('0xf')]['message']);}logger[_0x9110('0xf')](_0x9110('0x10'),_0x4fb225,_0x17fb2e['error'][_0x9110('0x11')]);return _0x234b83(_0x17fb2e[_0x9110('0xf')][_0x9110('0x11')]);}else{logger[_0x9110('0x12')](_0x9110('0x10'),_0x4fb225,'request\x20sent');_0x234b83(_0x17fb2e['result'][_0x9110('0x11')]);}})[_0x9110('0x13')](function(_0x6c3ff2){logger[_0x9110('0xf')](_0x9110('0x10'),_0x4fb225,_0x6c3ff2);_0x13eeb9(_0x6c3ff2);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 7faded4..b4c72fa 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 _0x4c4e=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','/:id/questions','getQuestions','post','create','update','delete','destroy','multer','path'];(function(_0x9df43c,_0xd7d637){var _0x2dc703=function(_0x17c8d9){while(--_0x17c8d9){_0x9df43c['push'](_0x9df43c['shift']());}};_0x2dc703(++_0xd7d637);}(_0x4c4e,0x152));var _0xe4c4=function(_0x196311,_0xbed27c){_0x196311=_0x196311-0x0;var _0x239562=_0x4c4e[_0x196311];return _0x239562;};'use strict';var multer=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var timeout=require(_0xe4c4('0x2'));var express=require(_0xe4c4('0x3'));var router=express['Router']();var auth=require(_0xe4c4('0x4'));var interaction=require(_0xe4c4('0x5'));var config=require(_0xe4c4('0x6'));var controller=require('./jscriptySessionReport.controller');router[_0xe4c4('0x7')]('/',auth['isAuthenticated'](),controller[_0xe4c4('0x8')]);router[_0xe4c4('0x7')](_0xe4c4('0x9'),auth[_0xe4c4('0xa')](),controller[_0xe4c4('0xb')]);router[_0xe4c4('0x7')](_0xe4c4('0xc'),auth[_0xe4c4('0xa')](),controller['show']);router['get'](_0xe4c4('0xd'),auth[_0xe4c4('0xa')](),controller[_0xe4c4('0xe')]);router[_0xe4c4('0xf')]('/',auth[_0xe4c4('0xa')](),controller[_0xe4c4('0x10')]);router['put'](_0xe4c4('0xc'),auth[_0xe4c4('0xa')](),controller[_0xe4c4('0x11')]);router[_0xe4c4('0x12')]('/:id',auth[_0xe4c4('0xa')](),controller[_0xe4c4('0x13')]);module['exports']=router; \ No newline at end of file +var _0x885a=['create','update','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','/:id','/:id/questions','getQuestions','post'];(function(_0x5447aa,_0x3afc00){var _0xb21e53=function(_0x2d05f6){while(--_0x2d05f6){_0x5447aa['push'](_0x5447aa['shift']());}};_0xb21e53(++_0x3afc00);}(_0x885a,0x180));var _0xa885=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x885a[_0x4a9fb1];return _0x348672;};'use strict';var multer=require('multer');var util=require(_0xa885('0x0'));var path=require(_0xa885('0x1'));var timeout=require(_0xa885('0x2'));var express=require(_0xa885('0x3'));var router=express['Router']();var auth=require(_0xa885('0x4'));var interaction=require(_0xa885('0x5'));var config=require(_0xa885('0x6'));var controller=require(_0xa885('0x7'));router[_0xa885('0x8')]('/',auth[_0xa885('0x9')](),controller['index']);router[_0xa885('0x8')](_0xa885('0xa'),auth[_0xa885('0x9')](),controller['describe']);router[_0xa885('0x8')](_0xa885('0xb'),auth[_0xa885('0x9')](),controller['show']);router[_0xa885('0x8')](_0xa885('0xc'),auth[_0xa885('0x9')](),controller[_0xa885('0xd')]);router[_0xa885('0xe')]('/',auth[_0xa885('0x9')](),controller[_0xa885('0xf')]);router['put'](_0xa885('0xb'),auth[_0xa885('0x9')](),controller[_0xa885('0x10')]);router[_0xa885('0x11')](_0xa885('0xb'),auth[_0xa885('0x9')](),controller[_0xa885('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 0ac6db6..2b1616a 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 _0xca1e=['BOOLEAN','sequelize','exports','DATE','setDataValue','starttime','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x472a35,_0x6606b2){var _0x4bc440=function(_0x5d901e){while(--_0x5d901e){_0x472a35['push'](_0x472a35['shift']());}};_0x4bc440(++_0x6606b2);}(_0xca1e,0xb9));var _0xeca1=function(_0x52622d,_0x5b2934){_0x52622d=_0x52622d-0x0;var _0x29ab16=_0xca1e[_0x52622d];return _0x29ab16;};'use strict';var moment=require('moment');var Sequelize=require(_0xeca1('0x0'));module[_0xeca1('0x1')]={'starttime':{'type':Sequelize[_0xeca1('0x2')],'set':function(_0x19e759){this[_0xeca1('0x3')](_0xeca1('0x4'),_0x19e759);this[_0xeca1('0x3')]('endtime',moment()['format'](_0xeca1('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xeca1('0x6')]},'projectname':{'type':Sequelize[_0xeca1('0x6')]},'queue':{'type':Sequelize[_0xeca1('0x6')]},'uniqueid':{'type':Sequelize[_0xeca1('0x6')]},'calleridname':{'type':Sequelize[_0xeca1('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xeca1('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xe7d6=['exports','DATE','starttime','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize'];(function(_0x2b909e,_0x506c2b){var _0xe69a1c=function(_0x1c26ad){while(--_0x1c26ad){_0x2b909e['push'](_0x2b909e['shift']());}};_0xe69a1c(++_0x506c2b);}(_0xe7d6,0x103));var _0x6e7d=function(_0x11b36c,_0x4caf31){_0x11b36c=_0x11b36c-0x0;var _0x560cc2=_0xe7d6[_0x11b36c];return _0x560cc2;};'use strict';var moment=require(_0x6e7d('0x0'));var Sequelize=require(_0x6e7d('0x1'));module[_0x6e7d('0x2')]={'starttime':{'type':Sequelize[_0x6e7d('0x3')],'set':function(_0x2eba41){this['setDataValue'](_0x6e7d('0x4'),_0x2eba41);this[_0x6e7d('0x5')](_0x6e7d('0x6'),moment()['format'](_0x6e7d('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x6e7d('0x8')]},'projectname':{'type':Sequelize[_0x6e7d('0x8')]},'queue':{'type':Sequelize[_0x6e7d('0x8')]},'uniqueid':{'type':Sequelize[_0x6e7d('0x8')]},'calleridname':{'type':Sequelize[_0x6e7d('0x8')]},'calleridnum':{'type':Sequelize['STRING']},'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 6e45f9e..5ea733a 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 _0x3a92=['name','send','JscriptySessionReport','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','type','key','include','findAll','rows','params','includeAll','find','catch','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','pick','SessionId','options','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','count','offset','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','stack'];(function(_0x3b9d5f,_0x2e9039){var _0x39924e=function(_0x5752ee){while(--_0x5752ee){_0x3b9d5f['push'](_0x3b9d5f['shift']());}};_0x39924e(++_0x2e9039);}(_0x3a92,0x1dd));var _0x23a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a92[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x23a9('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x23a9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x23a9('0x2'));var moment=require(_0x23a9('0x3'));var BPromise=require(_0x23a9('0x4'));var Mustache=require(_0x23a9('0x5'));var util=require(_0x23a9('0x6'));var path=require('path');var sox=require(_0x23a9('0x7'));var csv=require('to-csv');var ejs=require(_0x23a9('0x8'));var fs=require('fs');var _=require(_0x23a9('0x9'));var squel=require('squel');var crypto=require(_0x23a9('0xa'));var jsforce=require(_0x23a9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x23a9('0xc'));var querystring=require('querystring');var Papa=require(_0x23a9('0xd'));var Redis=require('ioredis');var authService=require(_0x23a9('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x23a9('0xf'))(_0x23a9('0x10'));var utils=require(_0x23a9('0x11'));var config=require(_0x23a9('0x12'));var db=require(_0x23a9('0x13'))['db'];function respondWithStatusCode(_0x599332,_0x39bed6){_0x39bed6=_0x39bed6||0xcc;return function(_0x1c880b){if(_0x1c880b){return _0x599332['sendStatus'](_0x39bed6);}return _0x599332['status'](_0x39bed6)[_0x23a9('0x14')]();};}function respondWithResult(_0xb89d2,_0xcacf12){_0xcacf12=_0xcacf12||0xc8;return function(_0x5a0966){if(_0x5a0966){return _0xb89d2[_0x23a9('0x15')](_0xcacf12)['json'](_0x5a0966);}};}function respondWithFilteredResult(_0x420727,_0x5ce18a){return function(_0x28dc91){if(_0x28dc91){var _0x4ac845=_0x28dc91[_0x23a9('0x16')],_0x191f6d=_0x5ce18a[_0x23a9('0x17')],_0x5d25f3=_0x5ce18a[_0x23a9('0x17')]+_0x5ce18a['limit'],_0x2ce1ea;if(_0x5d25f3>=_0x4ac845){_0x5d25f3=_0x4ac845;_0x2ce1ea=0xc8;}else{_0x2ce1ea=0xce;}_0x420727[_0x23a9('0x15')](_0x2ce1ea);return _0x420727[_0x23a9('0x18')](_0x23a9('0x19'),_0x191f6d+'-'+_0x5d25f3+'/'+_0x4ac845)[_0x23a9('0x1a')](_0x28dc91);}return null;};}function patchUpdates(_0x36acd9){return function(_0xa6ff10){try{jsonpatch[_0x23a9('0x1b')](_0xa6ff10,_0x36acd9,!![]);}catch(_0x115c77){return BPromise['reject'](_0x115c77);}return _0xa6ff10[_0x23a9('0x1c')]();};}function saveUpdates(_0x574c64,_0x3f0756){return function(_0x54dcdf){if(_0x54dcdf){return _0x54dcdf[_0x23a9('0x1d')](_0x574c64)[_0x23a9('0x1e')](function(_0x355f31){return _0x355f31;});}return null;};}function removeEntity(_0x5b5205,_0x550530){return function(_0x4c1866){if(_0x4c1866){return _0x4c1866[_0x23a9('0x1f')]()[_0x23a9('0x1e')](function(){_0x5b5205[_0x23a9('0x15')](0xcc)[_0x23a9('0x14')]();});}};}function handleEntityNotFound(_0xf067ae,_0x21b664){return function(_0x2306e6){if(!_0x2306e6){_0xf067ae[_0x23a9('0x20')](0x194);}return _0x2306e6;};}function handleError(_0x4e1796,_0x40d990){_0x40d990=_0x40d990||0x1f4;return function(_0x231f6a){logger['error'](_0x231f6a[_0x23a9('0x21')]);if(_0x231f6a[_0x23a9('0x22')]){delete _0x231f6a[_0x23a9('0x22')];}_0x4e1796['status'](_0x40d990)[_0x23a9('0x23')](_0x231f6a);};}exports['index']=function(_0x20f884,_0x32dc2a){var _0x24db2c={},_0x8f16cb={},_0x10ad91={'count':0x0,'rows':[]};var _0xc368da=db[_0x23a9('0x24')][_0x23a9('0x25')];_0x8f16cb[_0x23a9('0x26')]=_['keys'](_0xc368da);_0x8f16cb[_0x23a9('0x27')]=_[_0x23a9('0x28')](_0x20f884[_0x23a9('0x27')]);_0x8f16cb[_0x23a9('0x29')]=_['intersection'](_0x8f16cb[_0x23a9('0x26')],_0x8f16cb[_0x23a9('0x27')]);_0x24db2c[_0x23a9('0x2a')]=_[_0x23a9('0x2b')](_0x8f16cb[_0x23a9('0x26')],qs['fields'](_0x20f884['query'][_0x23a9('0x2c')]));_0x24db2c[_0x23a9('0x2a')]=_0x24db2c[_0x23a9('0x2a')][_0x23a9('0x2d')]?_0x24db2c[_0x23a9('0x2a')]:_0x8f16cb['model'];if(!_0x20f884[_0x23a9('0x27')][_0x23a9('0x2e')](_0x23a9('0x2f'))){_0x24db2c[_0x23a9('0x30')]=qs[_0x23a9('0x30')](_0x20f884['query'][_0x23a9('0x30')]);_0x24db2c[_0x23a9('0x17')]=qs[_0x23a9('0x17')](_0x20f884[_0x23a9('0x27')][_0x23a9('0x17')]);}_0x24db2c[_0x23a9('0x31')]=qs[_0x23a9('0x32')](_0x20f884[_0x23a9('0x27')][_0x23a9('0x32')]);_0x24db2c[_0x23a9('0x33')]=qs[_0x23a9('0x29')](_['pick'](_0x20f884['query'],_0x8f16cb['filters']));if(_0x20f884['query'][_0x23a9('0x34')]){_0x24db2c[_0x23a9('0x33')]=_[_0x23a9('0x35')](_0x24db2c['where'],{'$or':_[_0x23a9('0x36')](_0xc368da,function(_0x1d85b5){if(_0x1d85b5[_0x23a9('0x37')][_0x23a9('0x38')]!=='VIRTUAL'){var _0x3e2fc3={};_0x3e2fc3[_0x1d85b5['field']]={'$like':'%'+_0x20f884[_0x23a9('0x27')][_0x23a9('0x34')]+'%'};return _0x3e2fc3;}})});}_0x24db2c=_['merge']({},_0x24db2c,_0x20f884['options']);var _0x2656ab={'where':_0x24db2c[_0x23a9('0x33')]};return db[_0x23a9('0x24')][_0x23a9('0x16')](_0x2656ab)[_0x23a9('0x1e')](function(_0xa1e97e){_0x10ad91[_0x23a9('0x16')]=_0xa1e97e;if(_0x20f884[_0x23a9('0x27')]['includeAll']){_0x24db2c[_0x23a9('0x39')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x23a9('0x3a')](_0x24db2c);})['then'](function(_0x449846){_0x10ad91[_0x23a9('0x3b')]=_0x449846;return _0x10ad91;})[_0x23a9('0x1e')](respondWithFilteredResult(_0x32dc2a,_0x24db2c))['catch'](handleError(_0x32dc2a,null));};exports['show']=function(_0x22c3ac,_0x33c1bf){var _0x27c37a={'raw':!![],'where':{'id':_0x22c3ac[_0x23a9('0x3c')]['id']}},_0x3ad750={};_0x3ad750[_0x23a9('0x26')]=_['keys'](db[_0x23a9('0x24')][_0x23a9('0x25')]);_0x3ad750[_0x23a9('0x27')]=_[_0x23a9('0x28')](_0x22c3ac[_0x23a9('0x27')]);_0x3ad750[_0x23a9('0x29')]=_[_0x23a9('0x2b')](_0x3ad750['model'],_0x3ad750[_0x23a9('0x27')]);_0x27c37a[_0x23a9('0x2a')]=_[_0x23a9('0x2b')](_0x3ad750[_0x23a9('0x26')],qs[_0x23a9('0x2c')](_0x22c3ac[_0x23a9('0x27')][_0x23a9('0x2c')]));_0x27c37a[_0x23a9('0x2a')]=_0x27c37a[_0x23a9('0x2a')][_0x23a9('0x2d')]?_0x27c37a[_0x23a9('0x2a')]:_0x3ad750[_0x23a9('0x26')];if(_0x22c3ac[_0x23a9('0x27')][_0x23a9('0x3d')]){_0x27c37a[_0x23a9('0x39')]=[{'all':!![]}];}_0x27c37a=_['merge']({},_0x27c37a,_0x22c3ac['options']);return db['JscriptySessionReport'][_0x23a9('0x3e')](_0x27c37a)[_0x23a9('0x1e')](handleEntityNotFound(_0x33c1bf,null))[_0x23a9('0x1e')](respondWithResult(_0x33c1bf,null))[_0x23a9('0x3f')](handleError(_0x33c1bf,null));};exports[_0x23a9('0x40')]=function(_0xd31df3,_0x43aebd){return db[_0x23a9('0x24')][_0x23a9('0x40')](_0xd31df3[_0x23a9('0x41')],{})[_0x23a9('0x1e')](respondWithResult(_0x43aebd,0xc9))[_0x23a9('0x3f')](handleError(_0x43aebd,null));};exports['update']=function(_0x1b0092,_0x36b367){if(_0x1b0092[_0x23a9('0x41')]['id']){delete _0x1b0092['body']['id'];}return db[_0x23a9('0x24')]['find']({'where':{'id':_0x1b0092[_0x23a9('0x3c')]['id']}})['then'](handleEntityNotFound(_0x36b367,null))[_0x23a9('0x1e')](saveUpdates(_0x1b0092['body'],null))[_0x23a9('0x1e')](respondWithResult(_0x36b367,null))[_0x23a9('0x3f')](handleError(_0x36b367,null));};exports['destroy']=function(_0x3e5370,_0x242be3){return db[_0x23a9('0x24')][_0x23a9('0x3e')]({'where':{'id':_0x3e5370[_0x23a9('0x3c')]['id']}})[_0x23a9('0x1e')](handleEntityNotFound(_0x242be3,null))[_0x23a9('0x1e')](removeEntity(_0x242be3,null))[_0x23a9('0x3f')](handleError(_0x242be3,null));};exports[_0x23a9('0x42')]=function(_0xb66e39,_0x2c79ec){return db[_0x23a9('0x24')]['describe']()[_0x23a9('0x1e')](respondWithResult(_0x2c79ec,null))[_0x23a9('0x3f')](handleError(_0x2c79ec,null));};exports[_0x23a9('0x43')]=function(_0x486a4c,_0x1585ba,_0x380bec){var _0x511b90={'raw':!![],'where':{}};var _0x5d8d66={};var _0x45376f={'count':0x0,'rows':[]};return db[_0x23a9('0x24')][_0x23a9('0x44')]({'where':{'id':_0x486a4c[_0x23a9('0x3c')]['id']}})[_0x23a9('0x1e')](handleEntityNotFound(_0x1585ba,null))['then'](function(_0x51d5ea){if(_0x51d5ea){_0x5d8d66[_0x23a9('0x26')]=_[_0x23a9('0x28')](db[_0x23a9('0x45')][_0x23a9('0x25')]);_0x5d8d66[_0x23a9('0x27')]=_[_0x23a9('0x28')](_0x486a4c['query']);_0x5d8d66[_0x23a9('0x29')]=_[_0x23a9('0x2b')](_0x5d8d66[_0x23a9('0x26')],_0x5d8d66[_0x23a9('0x27')]);_0x511b90[_0x23a9('0x2a')]=_[_0x23a9('0x2b')](_0x5d8d66[_0x23a9('0x26')],qs[_0x23a9('0x2c')](_0x486a4c[_0x23a9('0x27')][_0x23a9('0x2c')]));_0x511b90[_0x23a9('0x2a')]=_0x511b90['attributes'][_0x23a9('0x2d')]?_0x511b90[_0x23a9('0x2a')]:_0x5d8d66[_0x23a9('0x26')];if(!_0x486a4c[_0x23a9('0x27')]['hasOwnProperty'](_0x23a9('0x2f'))){_0x511b90['limit']=qs[_0x23a9('0x30')](_0x486a4c['query'][_0x23a9('0x30')]);_0x511b90['offset']=qs[_0x23a9('0x17')](_0x486a4c[_0x23a9('0x27')][_0x23a9('0x17')]);}_0x511b90['order']=qs['sort'](_0x486a4c['query'][_0x23a9('0x32')]);_0x511b90['where']=qs[_0x23a9('0x29')](_[_0x23a9('0x46')](_0x486a4c[_0x23a9('0x27')],_0x5d8d66[_0x23a9('0x29')]));_0x511b90['where'][_0x23a9('0x47')]=_0x51d5ea['id'];if(_0x486a4c[_0x23a9('0x27')][_0x23a9('0x34')]){_0x511b90[_0x23a9('0x33')]=_[_0x23a9('0x35')](_0x511b90[_0x23a9('0x33')],{'$or':_['map'](_0x511b90[_0x23a9('0x2a')],function(_0xb7490f){var _0x4e256c={};_0x4e256c[_0xb7490f]={'$like':'%'+_0x486a4c['query'][_0x23a9('0x34')]+'%'};return _0x4e256c;})});}_0x511b90=_[_0x23a9('0x35')]({},_0x511b90,_0x486a4c[_0x23a9('0x48')]);return db[_0x23a9('0x45')][_0x23a9('0x16')]({'where':_0x511b90['where']})['then'](function(_0x3a1999){_0x45376f['count']=_0x3a1999;if(_0x486a4c[_0x23a9('0x27')][_0x23a9('0x3d')]){_0x511b90[_0x23a9('0x39')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x23a9('0x3a')](_0x511b90);})['then'](function(_0x300853){_0x45376f[_0x23a9('0x3b')]=_0x300853;return _0x45376f;});}})[_0x23a9('0x1e')](respondWithFilteredResult(_0x1585ba,_0x511b90))['catch'](handleError(_0x1585ba,null));}; \ No newline at end of file +var _0x8816=['show','params','rawAttributes','find','create','body','destroy','describe','getQuestions','findOne','SessionId','JscriptyQuestionReport','rows','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','JscriptySessionReport','includeAll','include','findAll','catch'];(function(_0xf210cd,_0x3f4f86){var _0x571220=function(_0x57e5a2){while(--_0x57e5a2){_0xf210cd['push'](_0xf210cd['shift']());}};_0x571220(++_0x3f4f86);}(_0x8816,0x1ed));var _0x6881=function(_0x2b02e9,_0x1d6bad){_0x2b02e9=_0x2b02e9-0x0;var _0x266cba=_0x8816[_0x2b02e9];return _0x266cba;};'use strict';var pdf=require(_0x6881('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6881('0x1'));var zipdir=require(_0x6881('0x2'));var jsonpatch=require(_0x6881('0x3'));var rp=require('request-promise');var moment=require(_0x6881('0x4'));var BPromise=require(_0x6881('0x5'));var Mustache=require(_0x6881('0x6'));var util=require('util');var path=require(_0x6881('0x7'));var sox=require(_0x6881('0x8'));var csv=require(_0x6881('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6881('0xa'));var squel=require('squel');var crypto=require(_0x6881('0xb'));var jsforce=require(_0x6881('0xc'));var deskjs=require(_0x6881('0xd'));var toCsv=require(_0x6881('0x9'));var querystring=require(_0x6881('0xe'));var Papa=require(_0x6881('0xf'));var Redis=require(_0x6881('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6881('0x11'));var hardwareService=require(_0x6881('0x12'));var logger=require(_0x6881('0x13'))(_0x6881('0x14'));var utils=require(_0x6881('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41c36f,_0x38970b){_0x38970b=_0x38970b||0xcc;return function(_0x5848b3){if(_0x5848b3){return _0x41c36f[_0x6881('0x16')](_0x38970b);}return _0x41c36f[_0x6881('0x17')](_0x38970b)[_0x6881('0x18')]();};}function respondWithResult(_0x3fcbdd,_0x3fe49c){_0x3fe49c=_0x3fe49c||0xc8;return function(_0x504938){if(_0x504938){return _0x3fcbdd[_0x6881('0x17')](_0x3fe49c)['json'](_0x504938);}};}function respondWithFilteredResult(_0xe85d2d,_0x1a2876){return function(_0x27ab5c){if(_0x27ab5c){var _0x2730cb=_0x27ab5c[_0x6881('0x19')],_0x1f2f96=_0x1a2876['offset'],_0x2badd4=_0x1a2876['offset']+_0x1a2876[_0x6881('0x1a')],_0x4f2cb4;if(_0x2badd4>=_0x2730cb){_0x2badd4=_0x2730cb;_0x4f2cb4=0xc8;}else{_0x4f2cb4=0xce;}_0xe85d2d[_0x6881('0x17')](_0x4f2cb4);return _0xe85d2d[_0x6881('0x1b')](_0x6881('0x1c'),_0x1f2f96+'-'+_0x2badd4+'/'+_0x2730cb)[_0x6881('0x1d')](_0x27ab5c);}return null;};}function patchUpdates(_0x22f0ca){return function(_0x2978bb){try{jsonpatch[_0x6881('0x1e')](_0x2978bb,_0x22f0ca,!![]);}catch(_0x1a9bc2){return BPromise[_0x6881('0x1f')](_0x1a9bc2);}return _0x2978bb[_0x6881('0x20')]();};}function saveUpdates(_0x110933,_0x2a6b43){return function(_0x1a0983){if(_0x1a0983){return _0x1a0983[_0x6881('0x21')](_0x110933)[_0x6881('0x22')](function(_0x2ae801){return _0x2ae801;});}return null;};}function removeEntity(_0x518c48,_0x17afe2){return function(_0x4f48df){if(_0x4f48df){return _0x4f48df['destroy']()[_0x6881('0x22')](function(){_0x518c48['status'](0xcc)[_0x6881('0x18')]();});}};}function handleEntityNotFound(_0x16ab09,_0x2e56d3){return function(_0x4fd8ed){if(!_0x4fd8ed){_0x16ab09[_0x6881('0x16')](0x194);}return _0x4fd8ed;};}function handleError(_0x88ded,_0x5bb2bf){_0x5bb2bf=_0x5bb2bf||0x1f4;return function(_0x455767){logger[_0x6881('0x23')](_0x455767[_0x6881('0x24')]);if(_0x455767[_0x6881('0x25')]){delete _0x455767[_0x6881('0x25')];}_0x88ded[_0x6881('0x17')](_0x5bb2bf)[_0x6881('0x26')](_0x455767);};}exports[_0x6881('0x27')]=function(_0x44d567,_0x3fb46c){var _0x40c190={},_0x500522={},_0x26bb0e={'count':0x0,'rows':[]};var _0x344704=db['JscriptySessionReport']['rawAttributes'];_0x500522[_0x6881('0x28')]=_[_0x6881('0x29')](_0x344704);_0x500522[_0x6881('0x2a')]=_[_0x6881('0x29')](_0x44d567[_0x6881('0x2a')]);_0x500522[_0x6881('0x2b')]=_[_0x6881('0x2c')](_0x500522[_0x6881('0x28')],_0x500522[_0x6881('0x2a')]);_0x40c190[_0x6881('0x2d')]=_[_0x6881('0x2c')](_0x500522['model'],qs[_0x6881('0x2e')](_0x44d567[_0x6881('0x2a')][_0x6881('0x2e')]));_0x40c190[_0x6881('0x2d')]=_0x40c190[_0x6881('0x2d')][_0x6881('0x2f')]?_0x40c190[_0x6881('0x2d')]:_0x500522[_0x6881('0x28')];if(!_0x44d567[_0x6881('0x2a')][_0x6881('0x30')](_0x6881('0x31'))){_0x40c190[_0x6881('0x1a')]=qs[_0x6881('0x1a')](_0x44d567[_0x6881('0x2a')][_0x6881('0x1a')]);_0x40c190[_0x6881('0x32')]=qs['offset'](_0x44d567[_0x6881('0x2a')][_0x6881('0x32')]);}_0x40c190[_0x6881('0x33')]=qs['sort'](_0x44d567[_0x6881('0x2a')][_0x6881('0x34')]);_0x40c190[_0x6881('0x35')]=qs[_0x6881('0x2b')](_[_0x6881('0x36')](_0x44d567[_0x6881('0x2a')],_0x500522[_0x6881('0x2b')]));if(_0x44d567[_0x6881('0x2a')][_0x6881('0x37')]){_0x40c190['where']=_[_0x6881('0x38')](_0x40c190[_0x6881('0x35')],{'$or':_[_0x6881('0x39')](_0x344704,function(_0x5f0e4b){if(_0x5f0e4b[_0x6881('0x3a')][_0x6881('0x3b')]!==_0x6881('0x3c')){var _0x53b2da={};_0x53b2da[_0x5f0e4b['field']]={'$like':'%'+_0x44d567[_0x6881('0x2a')][_0x6881('0x37')]+'%'};return _0x53b2da;}})});}_0x40c190=_[_0x6881('0x38')]({},_0x40c190,_0x44d567[_0x6881('0x3d')]);var _0xecbfd7={'where':_0x40c190[_0x6881('0x35')]};return db[_0x6881('0x3e')][_0x6881('0x19')](_0xecbfd7)[_0x6881('0x22')](function(_0x359e6a){_0x26bb0e[_0x6881('0x19')]=_0x359e6a;if(_0x44d567['query'][_0x6881('0x3f')]){_0x40c190[_0x6881('0x40')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x6881('0x41')](_0x40c190);})[_0x6881('0x22')](function(_0x2ab227){_0x26bb0e['rows']=_0x2ab227;return _0x26bb0e;})['then'](respondWithFilteredResult(_0x3fb46c,_0x40c190))[_0x6881('0x42')](handleError(_0x3fb46c,null));};exports[_0x6881('0x43')]=function(_0x2a828a,_0x5aeae0){var _0x5b3fa0={'raw':!![],'where':{'id':_0x2a828a[_0x6881('0x44')]['id']}},_0xba0683={};_0xba0683[_0x6881('0x28')]=_[_0x6881('0x29')](db[_0x6881('0x3e')][_0x6881('0x45')]);_0xba0683[_0x6881('0x2a')]=_[_0x6881('0x29')](_0x2a828a['query']);_0xba0683[_0x6881('0x2b')]=_['intersection'](_0xba0683[_0x6881('0x28')],_0xba0683['query']);_0x5b3fa0['attributes']=_[_0x6881('0x2c')](_0xba0683['model'],qs[_0x6881('0x2e')](_0x2a828a[_0x6881('0x2a')]['fields']));_0x5b3fa0['attributes']=_0x5b3fa0[_0x6881('0x2d')][_0x6881('0x2f')]?_0x5b3fa0['attributes']:_0xba0683[_0x6881('0x28')];if(_0x2a828a['query'][_0x6881('0x3f')]){_0x5b3fa0[_0x6881('0x40')]=[{'all':!![]}];}_0x5b3fa0=_[_0x6881('0x38')]({},_0x5b3fa0,_0x2a828a['options']);return db[_0x6881('0x3e')][_0x6881('0x46')](_0x5b3fa0)[_0x6881('0x22')](handleEntityNotFound(_0x5aeae0,null))['then'](respondWithResult(_0x5aeae0,null))[_0x6881('0x42')](handleError(_0x5aeae0,null));};exports[_0x6881('0x47')]=function(_0x5d33bb,_0x6be94d){return db[_0x6881('0x3e')][_0x6881('0x47')](_0x5d33bb[_0x6881('0x48')],{})[_0x6881('0x22')](respondWithResult(_0x6be94d,0xc9))[_0x6881('0x42')](handleError(_0x6be94d,null));};exports[_0x6881('0x21')]=function(_0x5630b3,_0x41f645){if(_0x5630b3[_0x6881('0x48')]['id']){delete _0x5630b3[_0x6881('0x48')]['id'];}return db[_0x6881('0x3e')]['find']({'where':{'id':_0x5630b3['params']['id']}})['then'](handleEntityNotFound(_0x41f645,null))[_0x6881('0x22')](saveUpdates(_0x5630b3['body'],null))['then'](respondWithResult(_0x41f645,null))[_0x6881('0x42')](handleError(_0x41f645,null));};exports[_0x6881('0x49')]=function(_0x29ca96,_0x4e189e){return db[_0x6881('0x3e')][_0x6881('0x46')]({'where':{'id':_0x29ca96[_0x6881('0x44')]['id']}})[_0x6881('0x22')](handleEntityNotFound(_0x4e189e,null))['then'](removeEntity(_0x4e189e,null))['catch'](handleError(_0x4e189e,null));};exports[_0x6881('0x4a')]=function(_0x454f2c,_0x326961){return db[_0x6881('0x3e')][_0x6881('0x4a')]()['then'](respondWithResult(_0x326961,null))[_0x6881('0x42')](handleError(_0x326961,null));};exports[_0x6881('0x4b')]=function(_0x21dd49,_0x5df2cd,_0x3c4f29){var _0x3b3113={'raw':!![],'where':{}};var _0x1fee0a={};var _0x137ffd={'count':0x0,'rows':[]};return db[_0x6881('0x3e')][_0x6881('0x4c')]({'where':{'id':_0x21dd49[_0x6881('0x44')]['id']}})[_0x6881('0x22')](handleEntityNotFound(_0x5df2cd,null))[_0x6881('0x22')](function(_0x148fcf){if(_0x148fcf){_0x1fee0a[_0x6881('0x28')]=_[_0x6881('0x29')](db['JscriptyQuestionReport'][_0x6881('0x45')]);_0x1fee0a[_0x6881('0x2a')]=_['keys'](_0x21dd49[_0x6881('0x2a')]);_0x1fee0a[_0x6881('0x2b')]=_['intersection'](_0x1fee0a[_0x6881('0x28')],_0x1fee0a['query']);_0x3b3113['attributes']=_[_0x6881('0x2c')](_0x1fee0a[_0x6881('0x28')],qs[_0x6881('0x2e')](_0x21dd49[_0x6881('0x2a')][_0x6881('0x2e')]));_0x3b3113[_0x6881('0x2d')]=_0x3b3113['attributes'][_0x6881('0x2f')]?_0x3b3113[_0x6881('0x2d')]:_0x1fee0a[_0x6881('0x28')];if(!_0x21dd49[_0x6881('0x2a')][_0x6881('0x30')](_0x6881('0x31'))){_0x3b3113['limit']=qs[_0x6881('0x1a')](_0x21dd49[_0x6881('0x2a')]['limit']);_0x3b3113['offset']=qs[_0x6881('0x32')](_0x21dd49[_0x6881('0x2a')][_0x6881('0x32')]);}_0x3b3113[_0x6881('0x33')]=qs[_0x6881('0x34')](_0x21dd49[_0x6881('0x2a')][_0x6881('0x34')]);_0x3b3113[_0x6881('0x35')]=qs[_0x6881('0x2b')](_[_0x6881('0x36')](_0x21dd49[_0x6881('0x2a')],_0x1fee0a[_0x6881('0x2b')]));_0x3b3113[_0x6881('0x35')][_0x6881('0x4d')]=_0x148fcf['id'];if(_0x21dd49[_0x6881('0x2a')][_0x6881('0x37')]){_0x3b3113[_0x6881('0x35')]=_[_0x6881('0x38')](_0x3b3113[_0x6881('0x35')],{'$or':_[_0x6881('0x39')](_0x3b3113[_0x6881('0x2d')],function(_0x4a38ef){var _0x4e077b={};_0x4e077b[_0x4a38ef]={'$like':'%'+_0x21dd49[_0x6881('0x2a')][_0x6881('0x37')]+'%'};return _0x4e077b;})});}_0x3b3113=_[_0x6881('0x38')]({},_0x3b3113,_0x21dd49[_0x6881('0x3d')]);return db[_0x6881('0x4e')][_0x6881('0x19')]({'where':_0x3b3113[_0x6881('0x35')]})['then'](function(_0x2ac0bd){_0x137ffd[_0x6881('0x19')]=_0x2ac0bd;if(_0x21dd49[_0x6881('0x2a')][_0x6881('0x3f')]){_0x3b3113[_0x6881('0x40')]=[{'all':!![]}];}return db[_0x6881('0x4e')][_0x6881('0x41')](_0x3b3113);})['then'](function(_0x3907ad){_0x137ffd[_0x6881('0x4f')]=_0x3907ad;return _0x137ffd;});}})['then'](respondWithFilteredResult(_0x5df2cd,_0x3b3113))[_0x6881('0x42')](handleError(_0x5df2cd,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 7864885..ddd2169 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 _0xcd21=['rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd21,0xbd));var _0x1cd2=function(_0x5c12b6,_0x58c3a3){_0x5c12b6=_0x5c12b6-0x0;var _0x3485d9=_0xcd21[_0x5c12b6];return _0x3485d9;};'use strict';var _=require(_0x1cd2('0x0'));var util=require(_0x1cd2('0x1'));var logger=require(_0x1cd2('0x2'))(_0x1cd2('0x3'));var moment=require(_0x1cd2('0x4'));var BPromise=require(_0x1cd2('0x5'));var rp=require(_0x1cd2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1cd2('0x7'));var config=require(_0x1cd2('0x8'));var attributes=require(_0x1cd2('0x9'));module[_0x1cd2('0xa')]=function(_0x37a65e,_0x257e57){return _0x37a65e[_0x1cd2('0xb')](_0x1cd2('0xc'),attributes,{'tableName':_0x1cd2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ff2=['define','JscriptySessionReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8ff2,0x1c9));var _0x28ff=function(_0x3dcac5,_0x341ee4){_0x3dcac5=_0x3dcac5-0x0;var _0x45126b=_0x8ff2[_0x3dcac5];return _0x45126b;};'use strict';var _=require(_0x28ff('0x0'));var util=require(_0x28ff('0x1'));var logger=require(_0x28ff('0x2'))(_0x28ff('0x3'));var moment=require(_0x28ff('0x4'));var BPromise=require(_0x28ff('0x5'));var rp=require(_0x28ff('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x28ff('0x7'));var config=require(_0x28ff('0x8'));var attributes=require(_0x28ff('0x9'));module[_0x28ff('0xa')]=function(_0x72ee27,_0x328ef5){return _0x72ee27[_0x28ff('0xb')](_0x28ff('0xc'),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 000438a..d5113b0 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 _0x1816=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x1816,0x15e));var _0x6181=function(_0x2d0c5e,_0x47be4d){_0x2d0c5e=_0x2d0c5e-0x0;var _0x4493fc=_0x1816[_0x2d0c5e];return _0x4493fc;};'use strict';var _=require('lodash');var util=require(_0x6181('0x0'));var moment=require(_0x6181('0x1'));var BPromise=require('bluebird');var rs=require(_0x6181('0x2'));var fs=require('fs');var Redis=require(_0x6181('0x3'));var db=require(_0x6181('0x4'))['db'];var utils=require(_0x6181('0x5'));var logger=require('../../config/logger')(_0x6181('0x6'));var config=require(_0x6181('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6181('0x8')][_0x6181('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2669a5,_0x31bb34,_0x4dec74){return new BPromise(function(_0x32a0be,_0x5286d6){return client[_0x6181('0xa')](_0x2669a5,_0x4dec74)[_0x6181('0xb')](function(_0x1b2728){logger[_0x6181('0xc')](_0x6181('0xd'),_0x31bb34,_0x6181('0xe'));logger[_0x6181('0xf')](_0x6181('0x10'),_0x31bb34,_0x6181('0xe'),JSON['stringify'](_0x1b2728));if(_0x1b2728[_0x6181('0x11')]){if(_0x1b2728[_0x6181('0x11')][_0x6181('0x12')]===0x1f4){logger[_0x6181('0x11')](_0x6181('0xd'),_0x31bb34,_0x1b2728['error'][_0x6181('0x13')]);return _0x5286d6(_0x1b2728[_0x6181('0x11')][_0x6181('0x13')]);}logger['error'](_0x6181('0xd'),_0x31bb34,_0x1b2728['error'][_0x6181('0x13')]);return _0x32a0be(_0x1b2728[_0x6181('0x11')][_0x6181('0x13')]);}else{logger[_0x6181('0xc')](_0x6181('0xd'),_0x31bb34,'request\x20sent');_0x32a0be(_0x1b2728[_0x6181('0x14')][_0x6181('0x13')]);}})[_0x6181('0x15')](function(_0x53da42){logger[_0x6181('0x11')](_0x6181('0xd'),_0x31bb34,_0x53da42);_0x5286d6(_0x53da42);});});} \ No newline at end of file +var _0x2f7a=['request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s'];(function(_0x34ff75,_0x1b0dbc){var _0x42ee3a=function(_0x11a4d7){while(--_0x11a4d7){_0x34ff75['push'](_0x34ff75['shift']());}};_0x42ee3a(++_0x1b0dbc);}(_0x2f7a,0xcc));var _0xa2f7=function(_0x5b26a1,_0x48bbde){_0x5b26a1=_0x5b26a1-0x0;var _0x45a2ff=_0x2f7a[_0x5b26a1];return _0x45a2ff;};'use strict';var _=require('lodash');var util=require(_0xa2f7('0x0'));var moment=require(_0xa2f7('0x1'));var BPromise=require(_0xa2f7('0x2'));var rs=require(_0xa2f7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa2f7('0x4'))['db'];var utils=require(_0xa2f7('0x5'));var logger=require(_0xa2f7('0x6'))(_0xa2f7('0x7'));var config=require(_0xa2f7('0x8'));var jayson=require(_0xa2f7('0x9'));var client=jayson[_0xa2f7('0xa')][_0xa2f7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e37db,_0x115a59,_0x365052){return new BPromise(function(_0x1c7d5e,_0x45bbf2){return client[_0xa2f7('0xc')](_0x3e37db,_0x365052)[_0xa2f7('0xd')](function(_0x1cc42c){logger[_0xa2f7('0xe')](_0xa2f7('0xf'),_0x115a59,'request\x20sent');logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x115a59,_0xa2f7('0x10'),JSON[_0xa2f7('0x11')](_0x1cc42c));if(_0x1cc42c[_0xa2f7('0x12')]){if(_0x1cc42c[_0xa2f7('0x12')][_0xa2f7('0x13')]===0x1f4){logger['error'](_0xa2f7('0xf'),_0x115a59,_0x1cc42c[_0xa2f7('0x12')][_0xa2f7('0x14')]);return _0x45bbf2(_0x1cc42c['error'][_0xa2f7('0x14')]);}logger[_0xa2f7('0x12')](_0xa2f7('0xf'),_0x115a59,_0x1cc42c[_0xa2f7('0x12')][_0xa2f7('0x14')]);return _0x1c7d5e(_0x1cc42c[_0xa2f7('0x12')][_0xa2f7('0x14')]);}else{logger[_0xa2f7('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0x115a59,_0xa2f7('0x10'));_0x1c7d5e(_0x1cc42c['result']['message']);}})[_0xa2f7('0x15')](function(_0x45bf7e){logger['error'](_0xa2f7('0xf'),_0x115a59,_0x45bf7e);_0x45bbf2(_0x45bf7e);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 07021d7..3cc9bce 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 _0x1fce=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','index','put','/:id','isAuthenticated','update','exports','multer','util'];(function(_0x2e183b,_0x59f988){var _0x5de34a=function(_0x338973){while(--_0x338973){_0x2e183b['push'](_0x2e183b['shift']());}};_0x5de34a(++_0x59f988);}(_0x1fce,0x1cc));var _0xe1fc=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x1fce[_0xbeb808];return _0x5d6909;};'use strict';var multer=require(_0xe1fc('0x0'));var util=require(_0xe1fc('0x1'));var path=require('path');var timeout=require(_0xe1fc('0x2'));var express=require(_0xe1fc('0x3'));var router=express['Router']();var auth=require(_0xe1fc('0x4'));var interaction=require(_0xe1fc('0x5'));var config=require(_0xe1fc('0x6'));var controller=require(_0xe1fc('0x7'));router['get']('/',controller[_0xe1fc('0x8')]);router[_0xe1fc('0x9')](_0xe1fc('0xa'),auth[_0xe1fc('0xb')](),controller[_0xe1fc('0xc')]);module[_0xe1fc('0xd')]=router; \ No newline at end of file +var _0xb905=['isAuthenticated','update','exports','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./license.controller','put','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb905,0x163));var _0x5b90=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xb905[_0x1969a7];return _0x3d665f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5b90('0x0'));var express=require(_0x5b90('0x1'));var router=express[_0x5b90('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x5b90('0x3'));var config=require(_0x5b90('0x4'));var controller=require(_0x5b90('0x5'));router['get']('/',controller['index']);router[_0x5b90('0x6')](_0x5b90('0x7'),auth[_0x5b90('0x8')](),controller[_0x5b90('0x9')]);module[_0x5b90('0xa')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 154aeee..815be7a 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 _0xc4aa=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x31f4cb,_0x3698de){var _0x2e55b8=function(_0x52b370){while(--_0x52b370){_0x31f4cb['push'](_0x31f4cb['shift']());}};_0x2e55b8(++_0x3698de);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'license':{'type':Sequelize[_0xac4a('0x2')]},'data1':{'type':Sequelize[_0xac4a('0x3')]},'data2':{'type':Sequelize[_0xac4a('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xac4a('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc4aa=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x3f02c2,_0x123c6f){var _0x3f6dad=function(_0xa33fb4){while(--_0xa33fb4){_0x3f02c2['push'](_0x3f02c2['shift']());}};_0x3f6dad(++_0x123c6f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'license':{'type':Sequelize[_0xac4a('0x2')]},'data1':{'type':Sequelize[_0xac4a('0x3')]},'data2':{'type':Sequelize[_0xac4a('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xac4a('0x4')],'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 aecd530..56768a3 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 _0x7318=['attributes','merge','getLicense','catch','body','License','find','params','then','get','checkLicense','key','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','update','destroy','stack','name','send','../../config/license/util','index','model','keys','rawAttributes','query','filters','intersection','fields'];(function(_0x2f7248,_0xd18a78){var _0x35cd84=function(_0x57e3e3){while(--_0x57e3e3){_0x2f7248['push'](_0x2f7248['shift']());}};_0x35cd84(++_0xd18a78);}(_0x7318,0x139));var _0x8731=function(_0x651dc8,_0x1c734e){_0x651dc8=_0x651dc8-0x0;var _0x19cfb4=_0x7318[_0x651dc8];return _0x19cfb4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8731('0x0'));var rimraf=require(_0x8731('0x1'));var zipdir=require(_0x8731('0x2'));var jsonpatch=require(_0x8731('0x3'));var rp=require(_0x8731('0x4'));var moment=require(_0x8731('0x5'));var BPromise=require(_0x8731('0x6'));var Mustache=require('mustache');var util=require(_0x8731('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8731('0x8'));var fs=require('fs');var _=require(_0x8731('0x9'));var squel=require(_0x8731('0xa'));var crypto=require('crypto');var jsforce=require(_0x8731('0xb'));var deskjs=require(_0x8731('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8731('0xd'));var Redis=require(_0x8731('0xe'));var authService=require(_0x8731('0xf'));var qs=require(_0x8731('0x10'));var hardwareService=require(_0x8731('0x11'));var logger=require(_0x8731('0x12'))(_0x8731('0x13'));var utils=require(_0x8731('0x14'));var config=require(_0x8731('0x15'));var db=require(_0x8731('0x16'))['db'];function respondWithStatusCode(_0x3e488b,_0x12275f){_0x12275f=_0x12275f||0xcc;return function(_0x1abe41){if(_0x1abe41){return _0x3e488b[_0x8731('0x17')](_0x12275f);}return _0x3e488b['status'](_0x12275f)[_0x8731('0x18')]();};}function respondWithResult(_0x1bd74a,_0x508acd){_0x508acd=_0x508acd||0xc8;return function(_0x514f0a){if(_0x514f0a){return _0x1bd74a[_0x8731('0x19')](_0x508acd)[_0x8731('0x1a')](_0x514f0a);}};}function respondWithFilteredResult(_0x1fbda4,_0x412817){return function(_0x26cdcc){if(_0x26cdcc){var _0x11ec3b=_0x26cdcc[_0x8731('0x1b')],_0x4f2613=_0x412817[_0x8731('0x1c')],_0x394f30=_0x412817[_0x8731('0x1c')]+_0x412817[_0x8731('0x1d')],_0x3631b9;if(_0x394f30>=_0x11ec3b){_0x394f30=_0x11ec3b;_0x3631b9=0xc8;}else{_0x3631b9=0xce;}_0x1fbda4['status'](_0x3631b9);return _0x1fbda4[_0x8731('0x1e')](_0x8731('0x1f'),_0x4f2613+'-'+_0x394f30+'/'+_0x11ec3b)[_0x8731('0x1a')](_0x26cdcc);}return null;};}function patchUpdates(_0x5e84e5){return function(_0x4fae81){try{jsonpatch[_0x8731('0x20')](_0x4fae81,_0x5e84e5,!![]);}catch(_0x4be17c){return BPromise['reject'](_0x4be17c);}return _0x4fae81['save']();};}function saveUpdates(_0xbc80d5,_0x22b6d6){return function(_0x3caa55){if(_0x3caa55){return _0x3caa55[_0x8731('0x21')](_0xbc80d5)['then'](function(_0x18513c){return _0x18513c;});}return null;};}function removeEntity(_0x314e4c,_0x28004c){return function(_0x49ef86){if(_0x49ef86){return _0x49ef86[_0x8731('0x22')]()['then'](function(){_0x314e4c[_0x8731('0x19')](0xcc)[_0x8731('0x18')]();});}};}function handleEntityNotFound(_0x25a582,_0xebdacb){return function(_0x172660){if(!_0x172660){_0x25a582[_0x8731('0x17')](0x194);}return _0x172660;};}function handleError(_0x2b3340,_0x49c064){_0x49c064=_0x49c064||0x1f4;return function(_0x4569b6){logger['error'](_0x4569b6[_0x8731('0x23')]);if(_0x4569b6['name']){delete _0x4569b6[_0x8731('0x24')];}_0x2b3340[_0x8731('0x19')](_0x49c064)[_0x8731('0x25')](_0x4569b6);};}var utilLicense=require(_0x8731('0x26'));exports[_0x8731('0x27')]=function(_0xe2efcd,_0x4b9819){var _0x2ec74c={'raw':!![],'where':{'id':0x1}},_0x295b68={};_0x295b68[_0x8731('0x28')]=_[_0x8731('0x29')](db['License'][_0x8731('0x2a')]);_0x295b68['query']=_['keys'](_0xe2efcd[_0x8731('0x2b')]);_0x295b68[_0x8731('0x2c')]=_['intersection'](_0x295b68[_0x8731('0x28')],_0x295b68['query']);_0x2ec74c['attributes']=_[_0x8731('0x2d')](_0x295b68[_0x8731('0x28')],qs[_0x8731('0x2e')](_0xe2efcd[_0x8731('0x2b')][_0x8731('0x2e')]));_0x2ec74c[_0x8731('0x2f')]=_0x2ec74c[_0x8731('0x2f')]['length']?_0x2ec74c[_0x8731('0x2f')]:_0x295b68[_0x8731('0x28')];_0x2ec74c=_[_0x8731('0x30')]({},_0x2ec74c,_0xe2efcd['options']);return utilLicense[_0x8731('0x31')](_0x2ec74c)['then'](respondWithResult(_0x4b9819,null))[_0x8731('0x32')](handleError(_0x4b9819,null));};exports['update']=function(_0x36ba2c,_0x469c0e){if(_0x36ba2c[_0x8731('0x33')]['id']){delete _0x36ba2c[_0x8731('0x33')]['id'];}return db[_0x8731('0x34')][_0x8731('0x35')]({'where':{'id':_0x36ba2c[_0x8731('0x36')]['id']}})[_0x8731('0x37')](handleEntityNotFound(_0x469c0e,null))[_0x8731('0x37')](function(_0x2929f1){var _0x1a3238=_0x2929f1[_0x8731('0x38')]({'plain':!![]});return utilLicense[_0x8731('0x39')](_0x1a3238,_0x36ba2c[_0x8731('0x33')][_0x8731('0x3a')]);})[_0x8731('0x37')](function(_0x372b9c){if(!_0x372b9c[_0x8731('0x3b')]){return saveUpdates(_0x36ba2c[_0x8731('0x33')],null);}return _0x372b9c;})[_0x8731('0x37')](respondWithResult(_0x469c0e,null))[_0x8731('0x32')](handleError(_0x469c0e,null));}; \ No newline at end of file +var _0x2817=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','apply','reject','save','then','end','error','name','../../config/license/util','model','License','rawAttributes','query','keys','filters','intersection','attributes','fields','length','options','getLicense','update','body','find','get','checkLicense','demo','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x2817,0x9d));var _0x7281=function(_0x1dc3fb,_0x170250){_0x1dc3fb=_0x1dc3fb-0x0;var _0x3423fa=_0x2817[_0x1dc3fb];return _0x3423fa;};'use strict';var pdf=require(_0x7281('0x0'));var emlformat=require(_0x7281('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7281('0x2'));var jsonpatch=require(_0x7281('0x3'));var rp=require(_0x7281('0x4'));var moment=require(_0x7281('0x5'));var BPromise=require(_0x7281('0x6'));var Mustache=require(_0x7281('0x7'));var util=require('util');var path=require('path');var sox=require(_0x7281('0x8'));var csv=require(_0x7281('0x9'));var ejs=require(_0x7281('0xa'));var fs=require('fs');var _=require(_0x7281('0xb'));var squel=require(_0x7281('0xc'));var crypto=require(_0x7281('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7281('0xe'));var toCsv=require(_0x7281('0x9'));var querystring=require(_0x7281('0xf'));var Papa=require(_0x7281('0x10'));var Redis=require('ioredis');var authService=require(_0x7281('0x11'));var qs=require(_0x7281('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7281('0x13'))(_0x7281('0x14'));var utils=require(_0x7281('0x15'));var config=require(_0x7281('0x16'));var db=require(_0x7281('0x17'))['db'];function respondWithStatusCode(_0x1cda9e,_0x3c74d7){_0x3c74d7=_0x3c74d7||0xcc;return function(_0x2b0d67){if(_0x2b0d67){return _0x1cda9e['sendStatus'](_0x3c74d7);}return _0x1cda9e[_0x7281('0x18')](_0x3c74d7)['end']();};}function respondWithResult(_0x556e33,_0x2ed7f0){_0x2ed7f0=_0x2ed7f0||0xc8;return function(_0x1794ff){if(_0x1794ff){return _0x556e33[_0x7281('0x18')](_0x2ed7f0)[_0x7281('0x19')](_0x1794ff);}};}function respondWithFilteredResult(_0x3c92b8,_0x24001f){return function(_0x30bd03){if(_0x30bd03){var _0x5a94d1=_0x30bd03[_0x7281('0x1a')],_0x23a864=_0x24001f[_0x7281('0x1b')],_0x3a3c47=_0x24001f['offset']+_0x24001f[_0x7281('0x1c')],_0x5b5bfd;if(_0x3a3c47>=_0x5a94d1){_0x3a3c47=_0x5a94d1;_0x5b5bfd=0xc8;}else{_0x5b5bfd=0xce;}_0x3c92b8[_0x7281('0x18')](_0x5b5bfd);return _0x3c92b8[_0x7281('0x1d')]('Content-Range',_0x23a864+'-'+_0x3a3c47+'/'+_0x5a94d1)[_0x7281('0x19')](_0x30bd03);}return null;};}function patchUpdates(_0x223c5e){return function(_0x4db3a8){try{jsonpatch[_0x7281('0x1e')](_0x4db3a8,_0x223c5e,!![]);}catch(_0x362f54){return BPromise[_0x7281('0x1f')](_0x362f54);}return _0x4db3a8[_0x7281('0x20')]();};}function saveUpdates(_0x111c42,_0x41d5b6){return function(_0x27b324){if(_0x27b324){return _0x27b324['update'](_0x111c42)[_0x7281('0x21')](function(_0x2061f5){return _0x2061f5;});}return null;};}function removeEntity(_0x3f1c64,_0xbb2825){return function(_0x2e1d48){if(_0x2e1d48){return _0x2e1d48['destroy']()['then'](function(){_0x3f1c64[_0x7281('0x18')](0xcc)[_0x7281('0x22')]();});}};}function handleEntityNotFound(_0x4c27de,_0x357c9a){return function(_0x1cb271){if(!_0x1cb271){_0x4c27de['sendStatus'](0x194);}return _0x1cb271;};}function handleError(_0x25a198,_0x408e14){_0x408e14=_0x408e14||0x1f4;return function(_0x210a0b){logger[_0x7281('0x23')](_0x210a0b['stack']);if(_0x210a0b[_0x7281('0x24')]){delete _0x210a0b[_0x7281('0x24')];}_0x25a198[_0x7281('0x18')](_0x408e14)['send'](_0x210a0b);};}var utilLicense=require(_0x7281('0x25'));exports['index']=function(_0x11d383,_0x42b1fb){var _0x24baee={'raw':!![],'where':{'id':0x1}},_0x100144={};_0x100144[_0x7281('0x26')]=_['keys'](db[_0x7281('0x27')][_0x7281('0x28')]);_0x100144[_0x7281('0x29')]=_[_0x7281('0x2a')](_0x11d383['query']);_0x100144[_0x7281('0x2b')]=_[_0x7281('0x2c')](_0x100144[_0x7281('0x26')],_0x100144['query']);_0x24baee[_0x7281('0x2d')]=_[_0x7281('0x2c')](_0x100144[_0x7281('0x26')],qs[_0x7281('0x2e')](_0x11d383[_0x7281('0x29')]['fields']));_0x24baee[_0x7281('0x2d')]=_0x24baee['attributes'][_0x7281('0x2f')]?_0x24baee['attributes']:_0x100144[_0x7281('0x26')];_0x24baee=_['merge']({},_0x24baee,_0x11d383[_0x7281('0x30')]);return utilLicense[_0x7281('0x31')](_0x24baee)['then'](respondWithResult(_0x42b1fb,null))['catch'](handleError(_0x42b1fb,null));};exports[_0x7281('0x32')]=function(_0x155c83,_0x57fbd4){if(_0x155c83[_0x7281('0x33')]['id']){delete _0x155c83[_0x7281('0x33')]['id'];}return db[_0x7281('0x27')][_0x7281('0x34')]({'where':{'id':_0x155c83['params']['id']}})[_0x7281('0x21')](handleEntityNotFound(_0x57fbd4,null))[_0x7281('0x21')](function(_0x3d2c34){var _0x5b4439=_0x3d2c34[_0x7281('0x35')]({'plain':!![]});return utilLicense[_0x7281('0x36')](_0x5b4439,_0x155c83['body']['key']);})[_0x7281('0x21')](function(_0x86c7e4){if(!_0x86c7e4[_0x7281('0x37')]){return saveUpdates(_0x155c83['body'],null);}return _0x86c7e4;})['then'](respondWithResult(_0x57fbd4,null))['catch'](handleError(_0x57fbd4,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 4bc1f98..de6239f 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 _0xa664=['bluebird','path','../../config/environment','./license.attributes','exports','License','lodash','util','api','moment'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xa664,0x1f0));var _0x4a66=function(_0x1c057f,_0x403e06){_0x1c057f=_0x1c057f-0x0;var _0x45a238=_0xa664[_0x1c057f];return _0x45a238;};'use strict';var _=require(_0x4a66('0x0'));var util=require(_0x4a66('0x1'));var logger=require('../../config/logger')(_0x4a66('0x2'));var moment=require(_0x4a66('0x3'));var BPromise=require(_0x4a66('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a66('0x5'));var rimraf=require('rimraf');var config=require(_0x4a66('0x6'));var attributes=require(_0x4a66('0x7'));module[_0x4a66('0x8')]=function(_0x5560d4,_0x21b4e8){return _0x5560d4['define'](_0x4a66('0x9'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa47e=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./license.attributes','License','license'];(function(_0x36a346,_0x230a63){var _0x6109cf=function(_0x413f42){while(--_0x413f42){_0x36a346['push'](_0x36a346['shift']());}};_0x6109cf(++_0x230a63);}(_0xa47e,0x9a));var _0xea47=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa47e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xea47('0x0'));var util=require(_0xea47('0x1'));var logger=require('../../config/logger')(_0xea47('0x2'));var moment=require(_0xea47('0x3'));var BPromise=require(_0xea47('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea47('0x5'));var rimraf=require(_0xea47('0x6'));var config=require(_0xea47('0x7'));var attributes=require(_0xea47('0x8'));module['exports']=function(_0x452caa,_0x22412a){return _0x452caa['define'](_0xea47('0x9'),attributes,{'tableName':_0xea47('0xa'),'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 f3af778..645dfb6 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 _0x4fad=['info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0xda8c2e,_0x470be6){var _0x1a8ccf=function(_0x39cbb4){while(--_0x39cbb4){_0xda8c2e['push'](_0xda8c2e['shift']());}};_0x1a8ccf(++_0x470be6);}(_0x4fad,0xcb));var _0xd4fa=function(_0x3af550,_0x1e5363){_0x3af550=_0x3af550-0x0;var _0x57fe5e=_0x4fad[_0x3af550];return _0x57fe5e;};'use strict';var _=require(_0xd4fa('0x0'));var util=require(_0xd4fa('0x1'));var moment=require(_0xd4fa('0x2'));var BPromise=require('bluebird');var rs=require(_0xd4fa('0x3'));var fs=require('fs');var Redis=require(_0xd4fa('0x4'));var db=require(_0xd4fa('0x5'))['db'];var utils=require(_0xd4fa('0x6'));var logger=require(_0xd4fa('0x7'))(_0xd4fa('0x8'));var config=require(_0xd4fa('0x9'));var jayson=require(_0xd4fa('0xa'));var client=jayson['client'][_0xd4fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52b426,_0x2b9f6a,_0x19a910){return new BPromise(function(_0x155c09,_0x3fff99){return client[_0xd4fa('0xc')](_0x52b426,_0x19a910)['then'](function(_0x26a894){logger[_0xd4fa('0xd')](_0xd4fa('0xe'),_0x2b9f6a,'request\x20sent');logger[_0xd4fa('0xf')](_0xd4fa('0x10'),_0x2b9f6a,_0xd4fa('0x11'),JSON[_0xd4fa('0x12')](_0x26a894));if(_0x26a894['error']){if(_0x26a894[_0xd4fa('0x13')][_0xd4fa('0x14')]===0x1f4){logger[_0xd4fa('0x13')]('License,\x20%s,\x20%s',_0x2b9f6a,_0x26a894[_0xd4fa('0x13')][_0xd4fa('0x15')]);return _0x3fff99(_0x26a894[_0xd4fa('0x13')][_0xd4fa('0x15')]);}logger[_0xd4fa('0x13')](_0xd4fa('0xe'),_0x2b9f6a,_0x26a894['error'][_0xd4fa('0x15')]);return _0x155c09(_0x26a894[_0xd4fa('0x13')][_0xd4fa('0x15')]);}else{logger[_0xd4fa('0xd')](_0xd4fa('0xe'),_0x2b9f6a,_0xd4fa('0x11'));_0x155c09(_0x26a894[_0xd4fa('0x16')]['message']);}})[_0xd4fa('0x17')](function(_0x3a3b8c){logger[_0xd4fa('0x13')]('License,\x20%s,\x20%s',_0x2b9f6a,_0x3a3b8c);_0x3fff99(_0x3a3b8c);});});} \ No newline at end of file +var _0x3c81=['License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xd2cf49,_0x4e740b){var _0x288eb6=function(_0x119773){while(--_0x119773){_0xd2cf49['push'](_0xd2cf49['shift']());}};_0x288eb6(++_0x4e740b);}(_0x3c81,0x102));var _0x13c8=function(_0x42b594,_0xed91ac){_0x42b594=_0x42b594-0x0;var _0x56c9ec=_0x3c81[_0x42b594];return _0x56c9ec;};'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});function respondWithRpcPromise(_0x3f0bd2,_0x445b69,_0x4f7bcc){return new BPromise(function(_0x17c228,_0x4905c3){return client[_0x13c8('0x9')](_0x3f0bd2,_0x4f7bcc)[_0x13c8('0xa')](function(_0x189ce6){logger[_0x13c8('0xb')](_0x13c8('0xc'),_0x445b69,_0x13c8('0xd'));logger[_0x13c8('0xe')](_0x13c8('0xf'),_0x445b69,_0x13c8('0xd'),JSON[_0x13c8('0x10')](_0x189ce6));if(_0x189ce6[_0x13c8('0x11')]){if(_0x189ce6[_0x13c8('0x11')][_0x13c8('0x12')]===0x1f4){logger[_0x13c8('0x11')]('License,\x20%s,\x20%s',_0x445b69,_0x189ce6[_0x13c8('0x11')][_0x13c8('0x13')]);return _0x4905c3(_0x189ce6[_0x13c8('0x11')][_0x13c8('0x13')]);}logger['error'](_0x13c8('0xc'),_0x445b69,_0x189ce6['error']['message']);return _0x17c228(_0x189ce6['error'][_0x13c8('0x13')]);}else{logger['info'](_0x13c8('0xc'),_0x445b69,_0x13c8('0xd'));_0x17c228(_0x189ce6[_0x13c8('0x14')][_0x13c8('0x13')]);}})['catch'](function(_0x13a9e1){logger[_0x13c8('0x11')](_0x13c8('0xc'),_0x445b69,_0x13a9e1);_0x4905c3(_0x13a9e1);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index e6cdbb8..5865054 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 _0x92cb=['removeImap','removeSmtp','destroy','/:id/users','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','/:id/interactions','getInteractions','/:id/applications','/:id/messages','/:id/verify','getAgents','post','/:id/dispositions','addDisposition','addAnswer','addSmtp','addInteraction','addAgents','put','/:id','update','delete','removeAnswers'];(function(_0x4bd06e,_0x593701){var _0x85ebb=function(_0x26a7f2){while(--_0x26a7f2){_0x4bd06e['push'](_0x4bd06e['shift']());}};_0x85ebb(++_0x593701);}(_0x92cb,0xd3));var _0xb92c=function(_0x4e1e00,_0x2a3117){_0x4e1e00=_0x4e1e00-0x0;var _0x1a9cc1=_0x92cb[_0x4e1e00];return _0x1a9cc1;};'use strict';var multer=require(_0xb92c('0x0'));var util=require(_0xb92c('0x1'));var path=require(_0xb92c('0x2'));var timeout=require('connect-timeout');var express=require(_0xb92c('0x3'));var router=express[_0xb92c('0x4')]();var auth=require(_0xb92c('0x5'));var interaction=require(_0xb92c('0x6'));var config=require(_0xb92c('0x7'));var controller=require('./mailAccount.controller');router[_0xb92c('0x8')]('/',auth[_0xb92c('0x9')](),controller[_0xb92c('0xa')]);router[_0xb92c('0x8')](_0xb92c('0xb'),auth[_0xb92c('0x9')](),controller['describe']);router[_0xb92c('0x8')]('/:id',auth[_0xb92c('0x9')](),controller[_0xb92c('0xc')]);router[_0xb92c('0x8')]('/:id/dispositions',auth[_0xb92c('0x9')](),controller[_0xb92c('0xd')]);router[_0xb92c('0x8')](_0xb92c('0xe'),auth[_0xb92c('0x9')](),controller['getAnswers']);router[_0xb92c('0x8')](_0xb92c('0xf'),auth[_0xb92c('0x9')](),controller[_0xb92c('0x10')]);router['get']('/:id/out_servers',auth['isAuthenticated'](),controller['getSmtp']);router[_0xb92c('0x8')](_0xb92c('0x11'),auth[_0xb92c('0x9')](),controller[_0xb92c('0x12')]);router[_0xb92c('0x8')](_0xb92c('0x13'),auth[_0xb92c('0x9')](),controller['getApplications']);router['get'](_0xb92c('0x14'),auth['isAuthenticated'](),controller['getMessages']);router[_0xb92c('0x8')](_0xb92c('0x15'),auth[_0xb92c('0x9')](),controller['verifySmtp']);router[_0xb92c('0x8')]('/:id/users',auth[_0xb92c('0x9')](),controller[_0xb92c('0x16')]);router[_0xb92c('0x17')](_0xb92c('0x18'),auth['isAuthenticated'](),controller[_0xb92c('0x19')]);router[_0xb92c('0x17')]('/:id/canned_answers',auth[_0xb92c('0x9')](),controller[_0xb92c('0x1a')]);router['post']('/',auth[_0xb92c('0x9')](),controller['create']);router[_0xb92c('0x17')](_0xb92c('0xf'),auth['isAuthenticated'](),controller['addImap']);router[_0xb92c('0x17')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0xb92c('0x1b')]);router[_0xb92c('0x17')](_0xb92c('0x11'),auth[_0xb92c('0x9')](),controller[_0xb92c('0x1c')]);router[_0xb92c('0x17')]('/:id/applications',auth[_0xb92c('0x9')](),controller['addApplications']);router[_0xb92c('0x17')]('/:id/send',auth[_0xb92c('0x9')](),controller['send']);router[_0xb92c('0x17')]('/:id/users',auth[_0xb92c('0x9')](),controller[_0xb92c('0x1d')]);router[_0xb92c('0x1e')](_0xb92c('0x1f'),auth[_0xb92c('0x9')](),controller[_0xb92c('0x20')]);router[_0xb92c('0x21')](_0xb92c('0x18'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xb92c('0x21')]('/:id/canned_answers',auth[_0xb92c('0x9')](),controller[_0xb92c('0x22')]);router[_0xb92c('0x21')]('/:id/in_servers',auth[_0xb92c('0x9')](),controller[_0xb92c('0x23')]);router[_0xb92c('0x21')]('/:id/out_servers',auth[_0xb92c('0x9')](),controller[_0xb92c('0x24')]);router[_0xb92c('0x21')](_0xb92c('0x1f'),auth[_0xb92c('0x9')](),controller[_0xb92c('0x25')]);router['delete'](_0xb92c('0x26'),auth[_0xb92c('0x9')](),controller[_0xb92c('0x27')]);module[_0xb92c('0x28')]=router; \ No newline at end of file +var _0xeda4=['/:id/applications','addApplications','send','/:id/users','addAgents','update','removeDispositions','delete','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','/:id/dispositions','getDispositions','getAnswers','getImap','/:id/out_servers','/:id/interactions','getInteractions','getApplications','/:id/messages','/:id/verify','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','/:id/in_servers','addImap','addSmtp','addInteraction'];(function(_0x4f2a9e,_0xcfb666){var _0x393843=function(_0x24fcfa){while(--_0x24fcfa){_0x4f2a9e['push'](_0x4f2a9e['shift']());}};_0x393843(++_0xcfb666);}(_0xeda4,0xe9));var _0x4eda=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0xeda4[_0x2a5b3b];return _0xae665a;};'use strict';var multer=require(_0x4eda('0x0'));var util=require(_0x4eda('0x1'));var path=require('path');var timeout=require(_0x4eda('0x2'));var express=require(_0x4eda('0x3'));var router=express[_0x4eda('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4eda('0x5'));var config=require(_0x4eda('0x6'));var controller=require('./mailAccount.controller');router[_0x4eda('0x7')]('/',auth[_0x4eda('0x8')](),controller[_0x4eda('0x9')]);router[_0x4eda('0x7')](_0x4eda('0xa'),auth[_0x4eda('0x8')](),controller['describe']);router[_0x4eda('0x7')](_0x4eda('0xb'),auth[_0x4eda('0x8')](),controller['show']);router[_0x4eda('0x7')](_0x4eda('0xc'),auth[_0x4eda('0x8')](),controller[_0x4eda('0xd')]);router[_0x4eda('0x7')]('/:id/canned_answers',auth[_0x4eda('0x8')](),controller[_0x4eda('0xe')]);router[_0x4eda('0x7')]('/:id/in_servers',auth[_0x4eda('0x8')](),controller[_0x4eda('0xf')]);router[_0x4eda('0x7')](_0x4eda('0x10'),auth['isAuthenticated'](),controller['getSmtp']);router['get'](_0x4eda('0x11'),auth[_0x4eda('0x8')](),controller[_0x4eda('0x12')]);router[_0x4eda('0x7')]('/:id/applications',auth[_0x4eda('0x8')](),controller[_0x4eda('0x13')]);router[_0x4eda('0x7')](_0x4eda('0x14'),auth[_0x4eda('0x8')](),controller['getMessages']);router['get'](_0x4eda('0x15'),auth['isAuthenticated'](),controller['verifySmtp']);router[_0x4eda('0x7')]('/:id/users',auth[_0x4eda('0x8')](),controller[_0x4eda('0x16')]);router[_0x4eda('0x17')](_0x4eda('0xc'),auth[_0x4eda('0x8')](),controller[_0x4eda('0x18')]);router[_0x4eda('0x17')](_0x4eda('0x19'),auth['isAuthenticated'](),controller[_0x4eda('0x1a')]);router['post']('/',auth[_0x4eda('0x8')](),controller['create']);router[_0x4eda('0x17')](_0x4eda('0x1b'),auth[_0x4eda('0x8')](),controller[_0x4eda('0x1c')]);router[_0x4eda('0x17')](_0x4eda('0x10'),auth[_0x4eda('0x8')](),controller[_0x4eda('0x1d')]);router['post']('/:id/interactions',auth[_0x4eda('0x8')](),controller[_0x4eda('0x1e')]);router['post'](_0x4eda('0x1f'),auth[_0x4eda('0x8')](),controller[_0x4eda('0x20')]);router['post']('/:id/send',auth[_0x4eda('0x8')](),controller[_0x4eda('0x21')]);router[_0x4eda('0x17')](_0x4eda('0x22'),auth[_0x4eda('0x8')](),controller[_0x4eda('0x23')]);router['put'](_0x4eda('0xb'),auth[_0x4eda('0x8')](),controller[_0x4eda('0x24')]);router['delete'](_0x4eda('0xc'),auth[_0x4eda('0x8')](),controller[_0x4eda('0x25')]);router[_0x4eda('0x26')]('/:id/canned_answers',auth[_0x4eda('0x8')](),controller['removeAnswers']);router[_0x4eda('0x26')](_0x4eda('0x1b'),auth[_0x4eda('0x8')](),controller[_0x4eda('0x27')]);router['delete'](_0x4eda('0x10'),auth[_0x4eda('0x8')](),controller[_0x4eda('0x28')]);router[_0x4eda('0x26')](_0x4eda('0xb'),auth[_0x4eda('0x8')](),controller[_0x4eda('0x29')]);router[_0x4eda('0x26')]('/:id/users',auth[_0x4eda('0x8')](),controller[_0x4eda('0x2a')]);module[_0x4eda('0x2b')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index bd83d7c..5c28827 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 _0xd48d=['INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd48d,0x156));var _0xdd48=function(_0x497cf5,_0x4e2e25){_0x497cf5=_0x497cf5-0x0;var _0x705cfb=_0xd48d[_0x497cf5];return _0x705cfb;};'use strict';var Sequelize=require(_0xdd48('0x0'));module[_0xdd48('0x1')]={'description':{'type':Sequelize[_0xdd48('0x2')]},'name':{'type':Sequelize[_0xdd48('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xdd48('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xdd48('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xdd48('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xdd48('0x4')]},'markAsUnread':{'type':Sequelize[_0xdd48('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdd48('0x5')},'fontSize':{'type':Sequelize[_0xdd48('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xdd48('0x4')],'defaultValue':function(){return _0xdd48('0x7');}},'notificationSound':{'type':Sequelize[_0xdd48('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdd48('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdd48('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdd48('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdd48('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdd48('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdd48('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdd48('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xdd48('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xdd48('0x3')],'defaultValue':![],'comment':_0xdd48('0x9'),'set':function(_0x87f41b){if(!_0x87f41b)this['setDataValue'](_0xdd48('0xa'),null);this[_0xdd48('0xb')]('mandatoryDisposition',_0x87f41b);}}}; \ No newline at end of file +var _0x0501=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','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(_0xf1af27,_0x598bb1){var _0x46b274=function(_0x1dba43){while(--_0x1dba43){_0xf1af27['push'](_0xf1af27['shift']());}};_0x46b274(++_0x598bb1);}(_0x0501,0x177));var _0x1050=function(_0x446186,_0x116e31){_0x446186=_0x446186-0x0;var _0x63b564=_0x0501[_0x446186];return _0x63b564;};'use strict';var Sequelize=require(_0x1050('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x1050('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x1050('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x1050('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x1050('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x1050('0x3')]},'markAsUnread':{'type':Sequelize[_0x1050('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1050('0x4')},'fontSize':{'type':Sequelize[_0x1050('0x5')](0x2)[_0x1050('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x1050('0x3')],'defaultValue':function(){return _0x1050('0x7');}},'notificationSound':{'type':Sequelize[_0x1050('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1050('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1050('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1050('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1050('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x1050('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x1050('0x2')],'defaultValue':![],'comment':_0x1050('0x9'),'set':function(_0x478e6c){if(!_0x478e6c)this[_0x1050('0xa')]('mandatoryDispositionPauseId',null);this[_0x1050('0xa')](_0x1050('0xb'),_0x478e6c);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index aac0cdd..4a2a097 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 _0x7a54=['password','pass','cpassword','authentication','port','host','service','cuser','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','omit','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','DESC','from','format','email','attachments','join','server/files/attachments','auth','secure','SendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','VerifySmtp','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','json','count','offset','set','Content-Range','apply','update','destroy','get','UserProfileResource','stack','name','send','MailServerIn','MailServerOut','Smtp','MailAccount','model','keys','query','filters','intersection','attributes','fields','length','limit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','include','findAll','rows','params','Imap','Pause','mandatoryDispositionPause','rawAttributes','includeAll','find','body','catch','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','nolimit','options','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','hasOwnProperty','removeAnswers','ListId','isNil','active','description','cservice','cauthentication','user'];(function(_0x1336de,_0x3bdbf5){var _0x31dbdd=function(_0x446862){while(--_0x446862){_0x1336de['push'](_0x1336de['shift']());}};_0x31dbdd(++_0x3bdbf5);}(_0x7a54,0x106));var _0x47a5=function(_0x25a7f7,_0x81397a){_0x25a7f7=_0x25a7f7-0x0;var _0xba6f2c=_0x7a54[_0x25a7f7];return _0xba6f2c;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];config[_0x47a5('0x14')]=_[_0x47a5('0x15')](config[_0x47a5('0x14')],{'host':_0x47a5('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x14')]));require(_0x47a5('0x17'))[_0x47a5('0x18')](socket);var jayson=require(_0x47a5('0x19'));var client=jayson[_0x47a5('0x1a')][_0x47a5('0x1b')]({'port':0x232b});function checkPasswordPattern(_0x3c6c46,_0x190faa,_0x4e99a8){if(_0x4e99a8){var _0x362359=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x362359[_0x47a5('0x1c')](_0x190faa)){return _0x3c6c46;}else{throw new Error(_0x47a5('0x1d'));}}else{return _0x3c6c46;}}function respondWithRpcPromise(_0x2a2cbb,_0x1ef44c,_0x574af6,_0x549de3){return new BPromise(function(_0x138bc0,_0x4b966e){var _0x5247fd=_0x549de3||client;return _0x5247fd[_0x47a5('0x1e')](_0x2a2cbb,_0x574af6)[_0x47a5('0x1f')](function(_0x2ce454){logger[_0x47a5('0x20')](_0x47a5('0x21'),_0x1ef44c,_0x47a5('0x22'));logger[_0x47a5('0x23')](_0x47a5('0x24'),_0x1ef44c,_0x47a5('0x22'),JSON['stringify'](_0x2ce454));if(_0x2ce454[_0x47a5('0x25')]){if(_0x2ce454[_0x47a5('0x25')]['code']===0x1f4){logger[_0x47a5('0x25')](_0x47a5('0x21'),_0x1ef44c,_0x2ce454[_0x47a5('0x25')]['message']);return _0x4b966e(_0x2ce454[_0x47a5('0x25')][_0x47a5('0x26')]);}logger[_0x47a5('0x25')](_0x47a5('0x21'),_0x1ef44c,_0x2ce454['error'][_0x47a5('0x26')]);return _0x138bc0(_0x2ce454[_0x47a5('0x25')]['message']);}else{logger[_0x47a5('0x20')](_0x47a5('0x21'),_0x1ef44c,_0x47a5('0x22'));_0x138bc0(_0x2ce454[_0x47a5('0x27')][_0x47a5('0x26')]);}})['catch'](function(_0x53078a){logger[_0x47a5('0x25')]('MailAccount,\x20%s,\x20%s',_0x1ef44c,_0x53078a);_0x4b966e(_0x53078a);});});}function respondWithStatusCode(_0x1ea9c8,_0x5b6c4e){_0x5b6c4e=_0x5b6c4e||0xcc;return function(_0x23cb77){if(_0x23cb77){return _0x1ea9c8[_0x47a5('0x28')](_0x5b6c4e);}return _0x1ea9c8[_0x47a5('0x29')](_0x5b6c4e)[_0x47a5('0x2a')]();};}function respondWithResult(_0x21f296,_0x3ba0b7){_0x3ba0b7=_0x3ba0b7||0xc8;return function(_0x24b162){if(_0x24b162){return _0x21f296[_0x47a5('0x29')](_0x3ba0b7)[_0x47a5('0x2b')](_0x24b162);}};}function respondWithFilteredResult(_0x361bfa,_0x1127f8){return function(_0x11a4fa){if(_0x11a4fa){var _0x3ad507=_0x11a4fa[_0x47a5('0x2c')],_0x528582=_0x1127f8[_0x47a5('0x2d')],_0x243210=_0x1127f8[_0x47a5('0x2d')]+_0x1127f8['limit'],_0x51833b;if(_0x243210>=_0x3ad507){_0x243210=_0x3ad507;_0x51833b=0xc8;}else{_0x51833b=0xce;}_0x361bfa[_0x47a5('0x29')](_0x51833b);return _0x361bfa[_0x47a5('0x2e')](_0x47a5('0x2f'),_0x528582+'-'+_0x243210+'/'+_0x3ad507)[_0x47a5('0x2b')](_0x11a4fa);}return null;};}function patchUpdates(_0x51cc81){return function(_0x50d875){try{jsonpatch[_0x47a5('0x30')](_0x50d875,_0x51cc81,!![]);}catch(_0xfb5ddb){return BPromise['reject'](_0xfb5ddb);}return _0x50d875['save']();};}function saveUpdates(_0x836303,_0x51544e){return function(_0x57bff6){if(_0x57bff6){return _0x57bff6[_0x47a5('0x31')](_0x836303)['then'](function(_0x122ed6){return _0x122ed6;});}return null;};}function removeEntity(_0xd972c,_0x5c5162){return function(_0x4843c0){if(_0x4843c0){return _0x4843c0[_0x47a5('0x32')]()['then'](function(){var _0x403028=_0x4843c0[_0x47a5('0x33')]({'plain':!![]});var _0xf269a8='MailAccounts';return db[_0x47a5('0x34')]['destroy']({'where':{'type':_0xf269a8,'resourceId':_0x403028['id']}})['then'](function(){return _0x4843c0;});})[_0x47a5('0x1f')](function(){_0xd972c['status'](0xcc)[_0x47a5('0x2a')]();});}};}function handleEntityNotFound(_0x5ef577,_0x21ad34){return function(_0x3534cb){if(!_0x3534cb){_0x5ef577[_0x47a5('0x28')](0x194);}return _0x3534cb;};}function handleError(_0x199698,_0x36add5){_0x36add5=_0x36add5||0x1f4;return function(_0xed6320){logger[_0x47a5('0x25')](_0xed6320[_0x47a5('0x35')]);if(_0xed6320[_0x47a5('0x36')]){delete _0xed6320['name'];}_0x199698[_0x47a5('0x29')](_0x36add5)[_0x47a5('0x37')](_0xed6320);};}exports['index']=function(_0x2c50d6,_0x2bf53d){var _0x1d4348={'include':[{'model':db[_0x47a5('0x38')],'as':'Imap'},{'model':db[_0x47a5('0x39')],'as':_0x47a5('0x3a')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x49c4b5={},_0x101f70={'count':0x0,'rows':[]};var _0x5ebd8c=db[_0x47a5('0x3b')]['rawAttributes'];_0x49c4b5[_0x47a5('0x3c')]=_[_0x47a5('0x3d')](_0x5ebd8c);_0x49c4b5[_0x47a5('0x3e')]=_[_0x47a5('0x3d')](_0x2c50d6[_0x47a5('0x3e')]);_0x49c4b5[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x49c4b5[_0x47a5('0x3c')],_0x49c4b5[_0x47a5('0x3e')]);_0x1d4348[_0x47a5('0x41')]=_[_0x47a5('0x40')](_0x49c4b5[_0x47a5('0x3c')],qs[_0x47a5('0x42')](_0x2c50d6['query'][_0x47a5('0x42')]));_0x1d4348[_0x47a5('0x41')]=_0x1d4348[_0x47a5('0x41')][_0x47a5('0x43')]?_0x1d4348['attributes']:_0x49c4b5[_0x47a5('0x3c')];if(!_0x2c50d6['query']['hasOwnProperty']('nolimit')){_0x1d4348['limit']=qs[_0x47a5('0x44')](_0x2c50d6['query'][_0x47a5('0x44')]);_0x1d4348[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x2c50d6['query'][_0x47a5('0x2d')]);}_0x1d4348[_0x47a5('0x45')]=qs['sort'](_0x2c50d6['query'][_0x47a5('0x46')]);_0x1d4348['where']=qs[_0x47a5('0x3f')](_[_0x47a5('0x47')](_0x2c50d6[_0x47a5('0x3e')],_0x49c4b5[_0x47a5('0x3f')]));if(_0x2c50d6[_0x47a5('0x3e')][_0x47a5('0x48')]){_0x1d4348[_0x47a5('0x49')]=_[_0x47a5('0x4a')](_0x1d4348[_0x47a5('0x49')],{'$or':_[_0x47a5('0x4b')](_0x5ebd8c,function(_0x24ecb1){if(_0x24ecb1[_0x47a5('0x4c')][_0x47a5('0x4d')]!==_0x47a5('0x4e')){var _0x4e5e7={};_0x4e5e7[_0x24ecb1[_0x47a5('0x4f')]]={'$like':'%'+_0x2c50d6['query'][_0x47a5('0x48')]+'%'};return _0x4e5e7;}})});}_0x1d4348=_[_0x47a5('0x4a')]({},_0x1d4348,_0x2c50d6['options']);var _0x52b3a8={'where':_0x1d4348[_0x47a5('0x49')]};return db['MailAccount'][_0x47a5('0x2c')](_0x52b3a8)[_0x47a5('0x1f')](function(_0x54c35f){_0x101f70['count']=_0x54c35f;if(_0x2c50d6[_0x47a5('0x3e')]['includeAll']){_0x1d4348[_0x47a5('0x50')]=[{'all':!![]}];}return db[_0x47a5('0x3b')][_0x47a5('0x51')](_0x1d4348);})[_0x47a5('0x1f')](function(_0x44fe8a){_0x101f70[_0x47a5('0x52')]=_0x44fe8a;return _0x101f70;})[_0x47a5('0x1f')](respondWithFilteredResult(_0x2bf53d,_0x1d4348))['catch'](handleError(_0x2bf53d,null));};exports['show']=function(_0x2dd1db,_0x411230){var _0x1163e3={'raw':![],'where':{'id':_0x2dd1db[_0x47a5('0x53')]['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x54')},{'model':db['MailServerOut'],'as':_0x47a5('0x3a')},{'model':db[_0x47a5('0x55')],'as':_0x47a5('0x56')}]},_0x9ea93e={};_0x9ea93e['model']=_[_0x47a5('0x3d')](db['MailAccount'][_0x47a5('0x57')]);_0x9ea93e[_0x47a5('0x3e')]=_[_0x47a5('0x3d')](_0x2dd1db[_0x47a5('0x3e')]);_0x9ea93e['filters']=_[_0x47a5('0x40')](_0x9ea93e[_0x47a5('0x3c')],_0x9ea93e[_0x47a5('0x3e')]);_0x1163e3[_0x47a5('0x41')]=_[_0x47a5('0x40')](_0x9ea93e[_0x47a5('0x3c')],qs[_0x47a5('0x42')](_0x2dd1db['query'][_0x47a5('0x42')]));_0x1163e3[_0x47a5('0x41')]=_0x1163e3[_0x47a5('0x41')][_0x47a5('0x43')]?_0x1163e3[_0x47a5('0x41')]:_0x9ea93e[_0x47a5('0x3c')];if(_0x2dd1db['query'][_0x47a5('0x58')]){_0x1163e3[_0x47a5('0x50')]=[{'all':!![]}];}_0x1163e3=_[_0x47a5('0x4a')]({},_0x1163e3,_0x2dd1db['options']);return db[_0x47a5('0x3b')][_0x47a5('0x59')](_0x1163e3)[_0x47a5('0x1f')](handleEntityNotFound(_0x411230,null))['then'](respondWithResult(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x31')]=function(_0x376e1d,_0x4fa1da){if(_0x376e1d['body']['id']){delete _0x376e1d[_0x47a5('0x5a')]['id'];}return db['MailAccount'][_0x47a5('0x59')]({'where':{'id':_0x376e1d['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x47a5('0x54')},{'model':db[_0x47a5('0x39')],'as':'Smtp'},{'model':db[_0x47a5('0x55')],'as':_0x47a5('0x56')}]})['then'](handleEntityNotFound(_0x4fa1da,null))['then'](saveUpdates(_0x376e1d[_0x47a5('0x5a')],null))[_0x47a5('0x1f')](function(_0x867da0){if(_0x867da0&&_0x376e1d[_0x47a5('0x5a')]['Imap']){return db[_0x47a5('0x38')][_0x47a5('0x31')](_0x376e1d[_0x47a5('0x5a')]['Imap'],{'where':{'MailAccountId':_0x867da0['id']}})[_0x47a5('0x1f')](function(){return _0x867da0;});}return _0x867da0;})['then'](function(_0x485e3c){if(_0x485e3c&&_0x376e1d[_0x47a5('0x5a')][_0x47a5('0x3a')]){return db[_0x47a5('0x39')][_0x47a5('0x31')](_0x376e1d['body'][_0x47a5('0x3a')],{'where':{'MailAccountId':_0x485e3c['id']}})['then'](function(){return _0x485e3c;});}return _0x485e3c;})['then'](respondWithResult(_0x4fa1da,null))['catch'](handleError(_0x4fa1da,null));};exports['describe']=function(_0x212d92,_0x6cd4ea){return db[_0x47a5('0x3b')]['describe']()['then'](respondWithResult(_0x6cd4ea,null))[_0x47a5('0x5b')](handleError(_0x6cd4ea,null));};exports[_0x47a5('0x5c')]=function(_0x45d4b6,_0x3c2b46,_0xc45e25){if(_0x45d4b6['body']['id']){delete _0x45d4b6[_0x47a5('0x5a')]['id'];}return db['MailAccount'][_0x47a5('0x59')]({'where':{'id':_0x45d4b6[_0x47a5('0x53')]['id']}})['then'](handleEntityNotFound(_0x3c2b46,null))[_0x47a5('0x1f')](function(_0x345104){if(_0x345104){_0x45d4b6[_0x47a5('0x5a')][_0x47a5('0x5d')]=_0x345104['id'];return db[_0x47a5('0x5e')][_0x47a5('0x5f')](_0x45d4b6[_0x47a5('0x5a')]);}})[_0x47a5('0x1f')](respondWithResult(_0x3c2b46,null))['catch'](handleError(_0x3c2b46,null));};exports[_0x47a5('0x60')]=function(_0x2a3a57,_0x3c75c6,_0x26e7fc){var _0x396cb0={'raw':![],'where':{}};var _0x4bbe14={};var _0xbec033={'count':0x0,'rows':[]};return db[_0x47a5('0x3b')][_0x47a5('0x61')]({'where':{'id':_0x2a3a57[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x3c75c6,null))[_0x47a5('0x1f')](function(_0x453191){if(_0x453191){_0x4bbe14[_0x47a5('0x3c')]=_[_0x47a5('0x3d')](db[_0x47a5('0x5e')][_0x47a5('0x57')]);_0x4bbe14[_0x47a5('0x3e')]=_[_0x47a5('0x3d')](_0x2a3a57[_0x47a5('0x3e')]);_0x4bbe14[_0x47a5('0x3f')]=_['intersection'](_0x4bbe14[_0x47a5('0x3c')],_0x4bbe14[_0x47a5('0x3e')]);_0x396cb0[_0x47a5('0x41')]=_['intersection'](_0x4bbe14[_0x47a5('0x3c')],qs[_0x47a5('0x42')](_0x2a3a57[_0x47a5('0x3e')][_0x47a5('0x42')]));_0x396cb0['attributes']=_0x396cb0[_0x47a5('0x41')]['length']?_0x396cb0[_0x47a5('0x41')]:_0x4bbe14['model'];if(!_0x2a3a57[_0x47a5('0x3e')]['hasOwnProperty'](_0x47a5('0x62'))){_0x396cb0[_0x47a5('0x44')]=qs[_0x47a5('0x44')](_0x2a3a57['query']['limit']);_0x396cb0['offset']=qs[_0x47a5('0x2d')](_0x2a3a57[_0x47a5('0x3e')][_0x47a5('0x2d')]);}_0x396cb0[_0x47a5('0x45')]=qs['sort'](_0x2a3a57[_0x47a5('0x3e')][_0x47a5('0x46')]);_0x396cb0[_0x47a5('0x49')]=qs[_0x47a5('0x3f')](_[_0x47a5('0x47')](_0x2a3a57[_0x47a5('0x3e')],_0x4bbe14[_0x47a5('0x3f')]));_0x396cb0[_0x47a5('0x49')][_0x47a5('0x5d')]=_0x453191['id'];if(_0x2a3a57[_0x47a5('0x3e')][_0x47a5('0x48')]){_0x396cb0[_0x47a5('0x49')]=_['merge'](_0x396cb0[_0x47a5('0x49')],{'$or':_['map'](_0x396cb0[_0x47a5('0x41')],function(_0x2ac30f){var _0x281e5f={};_0x281e5f[_0x2ac30f]={'$like':'%'+_0x2a3a57[_0x47a5('0x3e')][_0x47a5('0x48')]+'%'};return _0x281e5f;})});}_0x396cb0=_[_0x47a5('0x4a')]({},_0x396cb0,_0x2a3a57[_0x47a5('0x63')]);return db[_0x47a5('0x5e')][_0x47a5('0x2c')]({'where':_0x396cb0[_0x47a5('0x49')]})[_0x47a5('0x1f')](function(_0x1f07ac){_0xbec033[_0x47a5('0x2c')]=_0x1f07ac;if(_0x2a3a57[_0x47a5('0x3e')][_0x47a5('0x58')]){_0x396cb0['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x396cb0);})['then'](function(_0x490e28){_0xbec033[_0x47a5('0x52')]=_0x490e28;return _0xbec033;});}})['then'](respondWithFilteredResult(_0x3c75c6,_0x396cb0))[_0x47a5('0x5b')](handleError(_0x3c75c6,null));};exports[_0x47a5('0x64')]=function(_0x1baa5a,_0x396102,_0x3cd335){return db[_0x47a5('0x3b')][_0x47a5('0x59')]({'where':{'id':_0x1baa5a[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x396102,null))[_0x47a5('0x1f')](function(_0x24a6c1){if(_0x24a6c1){return _0x24a6c1['removeDispositions'](_0x1baa5a[_0x47a5('0x3e')][_0x47a5('0x65')]);}})[_0x47a5('0x1f')](respondWithStatusCode(_0x396102,null))['catch'](handleError(_0x396102,null));};exports[_0x47a5('0x66')]=function(_0x32f393,_0x17b61d,_0x5d41d8){if(_0x32f393[_0x47a5('0x5a')]['id']){delete _0x32f393['body']['id'];}return db['MailAccount'][_0x47a5('0x59')]({'where':{'id':_0x32f393[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x17b61d,null))[_0x47a5('0x1f')](function(_0x164d42){if(_0x164d42){_0x32f393[_0x47a5('0x5a')]['MailAccountId']=_0x164d42['id'];return db['CannedAnswer'][_0x47a5('0x5f')](_0x32f393['body']);}})[_0x47a5('0x1f')](respondWithResult(_0x17b61d,null))[_0x47a5('0x5b')](handleError(_0x17b61d,null));};exports[_0x47a5('0x67')]=function(_0xb16bdd,_0x53ea2b,_0x3c66e3){var _0x550bde={'raw':![],'where':{}};var _0x5f3a04={};var _0x139c79={'count':0x0,'rows':[]};return db[_0x47a5('0x3b')]['findOne']({'where':{'id':_0xb16bdd[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x53ea2b,null))[_0x47a5('0x1f')](function(_0x4c25ec){if(_0x4c25ec){_0x5f3a04[_0x47a5('0x3c')]=_['keys'](db[_0x47a5('0x68')][_0x47a5('0x57')]);_0x5f3a04[_0x47a5('0x3e')]=_['keys'](_0xb16bdd[_0x47a5('0x3e')]);_0x5f3a04[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x5f3a04['model'],_0x5f3a04[_0x47a5('0x3e')]);_0x550bde['attributes']=_[_0x47a5('0x40')](_0x5f3a04['model'],qs[_0x47a5('0x42')](_0xb16bdd[_0x47a5('0x3e')][_0x47a5('0x42')]));_0x550bde[_0x47a5('0x41')]=_0x550bde['attributes'][_0x47a5('0x43')]?_0x550bde[_0x47a5('0x41')]:_0x5f3a04[_0x47a5('0x3c')];if(!_0xb16bdd[_0x47a5('0x3e')][_0x47a5('0x69')]('nolimit')){_0x550bde['limit']=qs[_0x47a5('0x44')](_0xb16bdd['query'][_0x47a5('0x44')]);_0x550bde[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0xb16bdd['query'][_0x47a5('0x2d')]);}_0x550bde[_0x47a5('0x45')]=qs['sort'](_0xb16bdd[_0x47a5('0x3e')][_0x47a5('0x46')]);_0x550bde[_0x47a5('0x49')]=qs[_0x47a5('0x3f')](_['pick'](_0xb16bdd['query'],_0x5f3a04[_0x47a5('0x3f')]));_0x550bde[_0x47a5('0x49')]['MailAccountId']=_0x4c25ec['id'];if(_0xb16bdd[_0x47a5('0x3e')][_0x47a5('0x48')]){_0x550bde['where']=_[_0x47a5('0x4a')](_0x550bde[_0x47a5('0x49')],{'$or':_[_0x47a5('0x4b')](_0x550bde['attributes'],function(_0x3f2ad9){var _0x59b4a5={};_0x59b4a5[_0x3f2ad9]={'$like':'%'+_0xb16bdd[_0x47a5('0x3e')]['filter']+'%'};return _0x59b4a5;})});}_0x550bde=_[_0x47a5('0x4a')]({},_0x550bde,_0xb16bdd[_0x47a5('0x63')]);return db['CannedAnswer'][_0x47a5('0x2c')]({'where':_0x550bde['where']})[_0x47a5('0x1f')](function(_0x36f619){_0x139c79[_0x47a5('0x2c')]=_0x36f619;if(_0xb16bdd[_0x47a5('0x3e')]['includeAll']){_0x550bde[_0x47a5('0x50')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x550bde);})[_0x47a5('0x1f')](function(_0x46bdb1){_0x139c79[_0x47a5('0x52')]=_0x46bdb1;return _0x139c79;});}})[_0x47a5('0x1f')](respondWithFilteredResult(_0x53ea2b,_0x550bde))[_0x47a5('0x5b')](handleError(_0x53ea2b,null));};exports['removeAnswers']=function(_0x1522a6,_0x8be6a2,_0x241e1d){return db[_0x47a5('0x3b')]['find']({'where':{'id':_0x1522a6[_0x47a5('0x53')]['id']}})['then'](handleEntityNotFound(_0x8be6a2,null))[_0x47a5('0x1f')](function(_0x13b958){if(_0x13b958){return _0x13b958[_0x47a5('0x6a')](_0x1522a6[_0x47a5('0x3e')][_0x47a5('0x65')]);}})[_0x47a5('0x1f')](respondWithStatusCode(_0x8be6a2,null))[_0x47a5('0x5b')](handleError(_0x8be6a2,null));};exports[_0x47a5('0x5f')]=function(_0x11eaf7,_0x583746){var _0x36796e={'name':_0x11eaf7[_0x47a5('0x5a')]['name'],'key':_0x11eaf7[_0x47a5('0x5a')][_0x47a5('0x4d')],'email':_0x11eaf7[_0x47a5('0x5a')]['email'],'ListId':_0x11eaf7['body'][_0x47a5('0x6b')],'active':!_[_0x47a5('0x6c')](_0x11eaf7['body']['active'])?_0x11eaf7[_0x47a5('0x5a')][_0x47a5('0x6d')]:!![],'description':_0x11eaf7['body'][_0x47a5('0x6e')]||null,'Imap':{},'Smtp':{}};if(_[_0x47a5('0x6c')](_0x11eaf7['body'][_0x47a5('0x6f')])){if(_0x11eaf7[_0x47a5('0x5a')][_0x47a5('0x70')]){_0x36796e[_0x47a5('0x54')][_0x47a5('0x71')]=_0x36796e[_0x47a5('0x3a')]['user']=_0x11eaf7['body']['cuser'];_0x36796e[_0x47a5('0x54')][_0x47a5('0x72')]=_0x36796e['Smtp'][_0x47a5('0x73')]=_0x11eaf7[_0x47a5('0x5a')][_0x47a5('0x74')];}else{_0x36796e[_0x47a5('0x54')][_0x47a5('0x75')]=_0x36796e['Smtp'][_0x47a5('0x75')]=![];}_0x36796e['Imap']['host']=_0x11eaf7['body'][_0x47a5('0x54')]['host'];_0x36796e[_0x47a5('0x54')][_0x47a5('0x76')]=_0x11eaf7[_0x47a5('0x5a')]['Imap'][_0x47a5('0x76')];_0x36796e[_0x47a5('0x3a')][_0x47a5('0x77')]=_0x11eaf7[_0x47a5('0x5a')][_0x47a5('0x3a')]['host'];_0x36796e[_0x47a5('0x3a')][_0x47a5('0x76')]=_0x11eaf7['body'][_0x47a5('0x3a')][_0x47a5('0x76')];}else{_0x36796e[_0x47a5('0x54')][_0x47a5('0x78')]=_0x36796e[_0x47a5('0x3a')][_0x47a5('0x78')]=_0x11eaf7['body'][_0x47a5('0x6f')];_0x36796e[_0x47a5('0x54')]['user']=_0x36796e[_0x47a5('0x3a')][_0x47a5('0x71')]=_0x11eaf7[_0x47a5('0x5a')][_0x47a5('0x79')];_0x36796e['Imap']['password']=_0x36796e['Smtp']['pass']=_0x11eaf7[_0x47a5('0x5a')][_0x47a5('0x74')];}return db[_0x47a5('0x3b')][_0x47a5('0x5f')](_0x36796e,{'include':[{'model':db[_0x47a5('0x39')],'as':_0x47a5('0x3a')},{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x54')}]})['then'](function(_0x272b10){var _0x24e39a=_0x11eaf7[_0x47a5('0x71')][_0x47a5('0x33')]({'plain':!![]});if(!_0x24e39a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24e39a['role']===_0x47a5('0x71')){var _0x54ae9a=_0x272b10['get']({'plain':!![]});return db[_0x47a5('0x7a')][_0x47a5('0x59')]({'where':{'name':'MailAccounts','userProfileId':_0x24e39a[_0x47a5('0x7b')]},'raw':!![]})[_0x47a5('0x1f')](function(_0x2beda0){if(_0x2beda0&&_0x2beda0['autoAssociation']===0x0){return db[_0x47a5('0x34')][_0x47a5('0x5f')]({'name':_0x54ae9a['name'],'resourceId':_0x54ae9a['id'],'type':_0x2beda0[_0x47a5('0x36')],'sectionId':_0x2beda0['id']},{})[_0x47a5('0x1f')](function(){return _0x272b10;});}else{return _0x272b10;}})[_0x47a5('0x5b')](function(_0x311109){logger[_0x47a5('0x25')](_0x47a5('0x7c'),_0x311109);throw _0x311109;});}return _0x272b10;})['then'](respondWithResult(_0x583746,0xc9))[_0x47a5('0x5b')](handleError(_0x583746,null));};exports['getImap']=function(_0x2a3f32,_0x3ab7ac,_0xe3f69f){return db[_0x47a5('0x3b')]['findOne']({'where':{'id':_0x2a3f32[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x3ab7ac,null))[_0x47a5('0x1f')](function(_0x27baad){if(_0x27baad){return _0x27baad[_0x47a5('0x7d')]();}return null;})[_0x47a5('0x1f')](respondWithResult(_0x3ab7ac,null))[_0x47a5('0x5b')](handleError(_0x3ab7ac,null));};exports[_0x47a5('0x7e')]=function(_0x1b3e82,_0xa2045c,_0x109738){if(_0x1b3e82[_0x47a5('0x5a')]['id']){delete _0x1b3e82['body']['id'];}return db[_0x47a5('0x3b')][_0x47a5('0x59')]({'where':{'id':_0x1b3e82['params']['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0xa2045c,null))[_0x47a5('0x1f')](function(_0x390123){if(_0x390123){_0x1b3e82[_0x47a5('0x5a')][_0x47a5('0x5d')]=_0x390123['id'];return db['MailServerIn'][_0x47a5('0x5f')](_0x1b3e82[_0x47a5('0x5a')]);}})[_0x47a5('0x1f')](respondWithResult(_0xa2045c,null))[_0x47a5('0x5b')](handleError(_0xa2045c,null));};exports[_0x47a5('0x7f')]=function(_0x363077,_0x29c205,_0x5e4387){return db['MailAccount'][_0x47a5('0x61')]({'where':{'id':_0x363077['params']['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x29c205,null))['then'](function(_0x12572f){if(_0x12572f){return _0x12572f[_0x47a5('0x80')](null);}return null;})[_0x47a5('0x1f')](respondWithStatusCode(_0x29c205,null))[_0x47a5('0x5b')](handleError(_0x29c205,null));};exports['getSmtp']=function(_0x220557,_0x11f07b,_0xaca12c){return db['MailAccount']['findOne']({'where':{'id':_0x220557[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x11f07b,null))[_0x47a5('0x1f')](function(_0xfccf9c){if(_0xfccf9c){return _0xfccf9c[_0x47a5('0x81')]();}return null;})[_0x47a5('0x1f')](respondWithResult(_0x11f07b,null))[_0x47a5('0x5b')](handleError(_0x11f07b,null));};exports[_0x47a5('0x82')]=function(_0x566630,_0x38d101,_0x4d333b){if(_0x566630[_0x47a5('0x5a')]['id']){delete _0x566630[_0x47a5('0x5a')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x566630[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x38d101,null))['then'](function(_0x4420fa){if(_0x4420fa){_0x566630[_0x47a5('0x5a')][_0x47a5('0x5d')]=_0x4420fa['id'];return db[_0x47a5('0x39')]['create'](_0x566630[_0x47a5('0x5a')]);}})['then'](respondWithResult(_0x38d101,null))['catch'](handleError(_0x38d101,null));};exports['removeSmtp']=function(_0x1e0171,_0x5a975d,_0x16bf1a){return db[_0x47a5('0x3b')][_0x47a5('0x61')]({'where':{'id':_0x1e0171[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x5a975d,null))[_0x47a5('0x1f')](function(_0x6cd737){if(_0x6cd737){return _0x6cd737[_0x47a5('0x83')](null);}return null;})[_0x47a5('0x1f')](respondWithStatusCode(_0x5a975d,null))[_0x47a5('0x5b')](handleError(_0x5a975d,null));};exports[_0x47a5('0x84')]=function(_0xf05c39,_0x328faa,_0x1bfa3b){return db[_0x47a5('0x85')]['find']({'where':{'id':_0xf05c39[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x328faa,null))[_0x47a5('0x1f')](function(_0x2fa5e3){if(_0x2fa5e3){return _0x2fa5e3['addInteraction'](_0xf05c39[_0x47a5('0x5a')]['ids'],_[_0x47a5('0x86')](_0xf05c39['body'],[_0x47a5('0x65'),'id'])||{});}})[_0x47a5('0x1f')](respondWithResult(_0x328faa,null))[_0x47a5('0x5b')](handleError(_0x328faa,null));};exports['getInteractions']=function(_0x35f735,_0x217e04,_0x14771b){var _0x4ac804={'raw':![],'where':{}};var _0x52798d={};var _0x20f320={'count':0x0,'rows':[]};return db[_0x47a5('0x3b')][_0x47a5('0x61')]({'where':{'id':_0x35f735[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x217e04,null))['then'](function(_0x1196a0){if(_0x1196a0){_0x52798d['model']=_[_0x47a5('0x3d')](db[_0x47a5('0x85')][_0x47a5('0x57')]);_0x52798d[_0x47a5('0x3e')]=_['keys'](_0x35f735['query']);_0x52798d[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x52798d[_0x47a5('0x3c')],_0x52798d[_0x47a5('0x3e')]);_0x4ac804[_0x47a5('0x41')]=_[_0x47a5('0x40')](_0x52798d[_0x47a5('0x3c')],qs[_0x47a5('0x42')](_0x35f735[_0x47a5('0x3e')]['fields']));_0x4ac804['attributes']=_0x4ac804[_0x47a5('0x41')]['length']?_0x4ac804[_0x47a5('0x41')]:_0x52798d[_0x47a5('0x3c')];if(!_0x35f735[_0x47a5('0x3e')]['hasOwnProperty'](_0x47a5('0x62'))){_0x4ac804[_0x47a5('0x44')]=qs['limit'](_0x35f735[_0x47a5('0x3e')]['limit']);_0x4ac804[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x35f735[_0x47a5('0x3e')]['offset']);}_0x4ac804['order']=qs['sort'](_0x35f735['query']['sort']);_0x4ac804[_0x47a5('0x49')]=qs['filters'](_[_0x47a5('0x47')](_0x35f735[_0x47a5('0x3e')],_0x52798d['filters']));_0x4ac804['where']['MailAccountId']=_0x1196a0['id'];if(_0x35f735[_0x47a5('0x3e')]['filter']){_0x4ac804['where']=_['merge'](_0x4ac804[_0x47a5('0x49')],{'$or':_[_0x47a5('0x4b')](_0x4ac804[_0x47a5('0x41')],function(_0xdb9128){var _0x513d6f={};_0x513d6f[_0xdb9128]={'$like':'%'+_0x35f735[_0x47a5('0x3e')]['filter']+'%'};return _0x513d6f;})});}_0x4ac804=_[_0x47a5('0x4a')]({},_0x4ac804,_0x35f735['options']);return db[_0x47a5('0x85')][_0x47a5('0x2c')]({'where':_0x4ac804[_0x47a5('0x49')]})['then'](function(_0x106bbe){_0x20f320[_0x47a5('0x2c')]=_0x106bbe;if(_0x35f735[_0x47a5('0x3e')][_0x47a5('0x58')]){_0x4ac804['include']=[{'model':db[_0x47a5('0x87')],'as':_0x47a5('0x88'),'required':![]},{'model':db[_0x47a5('0x89')],'as':_0x47a5('0x8a'),'attributes':[_0x47a5('0x36'),_0x47a5('0x8b'),'internal'],'required':![]},{'model':db[_0x47a5('0x8c')],'as':_0x47a5('0x8d'),'attributes':['id',_0x47a5('0x36'),_0x47a5('0x8e')],'where':_0x35f735[_0x47a5('0x3e')][_0x47a5('0x8f')]?{'id':_0x35f735[_0x47a5('0x3e')][_0x47a5('0x8f')]}:undefined,'required':_0x35f735[_0x47a5('0x3e')][_0x47a5('0x8f')]?!![]:![]}];}return db[_0x47a5('0x85')][_0x47a5('0x51')](_0x4ac804);})[_0x47a5('0x1f')](function(_0x106b70){_0x20f320[_0x47a5('0x52')]=_0x106b70;return _0x20f320;});}})[_0x47a5('0x1f')](respondWithFilteredResult(_0x217e04,_0x4ac804))[_0x47a5('0x5b')](handleError(_0x217e04,null));};exports['addApplications']=function(_0xe0376c,_0x5ee5c5,_0x51bfb8){return db[_0x47a5('0x3b')][_0x47a5('0x61')]({'where':{'id':_0xe0376c[_0x47a5('0x53')]['id']}})['then'](handleEntityNotFound(_0x5ee5c5,null))[_0x47a5('0x1f')](function(_0xd8381b){if(_0xd8381b){return db[_0x47a5('0x90')][_0x47a5('0x91')](function(_0x30e5fb){return db[_0x47a5('0x92')][_0x47a5('0x32')]({'where':{'MailAccountId':_0xe0376c[_0x47a5('0x53')]['id']},'transaction':_0x30e5fb})[_0x47a5('0x1f')](function(_0x15f273){var _0x10952f=_[_0x47a5('0x4b')](_0xe0376c[_0x47a5('0x5a')],function(_0x4d7fd4){_0x4d7fd4['MailAccountId']=_0xe0376c[_0x47a5('0x53')]['id'];return _0x4d7fd4;});return db['MailApplication'][_0x47a5('0x93')](_0x10952f,{'transaction':_0x30e5fb});});})[_0x47a5('0x1f')](function(){return db[_0x47a5('0x92')][_0x47a5('0x94')]({'where':{'MailAccountId':_0xe0376c[_0x47a5('0x53')]['id']},'order':_0x47a5('0x95')});});}})['then'](respondWithResult(_0x5ee5c5,null))[_0x47a5('0x5b')](handleError(_0x5ee5c5,null));};exports[_0x47a5('0x96')]=function(_0x380eca,_0x5ca5bc,_0x19c94a){var _0x439f60={};var _0x3ecc41={};var _0x3e4148;var _0x4c46ea;return db[_0x47a5('0x3b')][_0x47a5('0x61')]({'where':{'id':_0x380eca[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x5ca5bc,null))[_0x47a5('0x1f')](function(_0x1b91ad){if(_0x1b91ad){_0x3e4148=_0x1b91ad;_0x3ecc41[_0x47a5('0x3c')]=_[_0x47a5('0x3d')](db[_0x47a5('0x92')][_0x47a5('0x57')]);_0x3ecc41[_0x47a5('0x3e')]=_[_0x47a5('0x3d')](_0x380eca[_0x47a5('0x3e')]);_0x3ecc41[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x3ecc41[_0x47a5('0x3c')],_0x3ecc41[_0x47a5('0x3e')]);_0x439f60['attributes']=_[_0x47a5('0x40')](_0x3ecc41['model'],qs[_0x47a5('0x42')](_0x380eca[_0x47a5('0x3e')][_0x47a5('0x42')]));_0x439f60[_0x47a5('0x41')]=_0x439f60[_0x47a5('0x41')][_0x47a5('0x43')]?_0x439f60[_0x47a5('0x41')]:_0x3ecc41[_0x47a5('0x3c')];_0x439f60['order']=qs[_0x47a5('0x46')](_0x380eca[_0x47a5('0x3e')][_0x47a5('0x46')]);_0x439f60['where']=qs[_0x47a5('0x3f')](_[_0x47a5('0x47')](_0x380eca[_0x47a5('0x3e')],_0x3ecc41[_0x47a5('0x3f')]));if(_0x380eca['query'][_0x47a5('0x48')]){_0x439f60[_0x47a5('0x49')]=_[_0x47a5('0x4a')](_0x439f60[_0x47a5('0x49')],{'$or':_['map'](_0x439f60[_0x47a5('0x41')],function(_0x57ee4c){var _0x5be91a={};_0x5be91a[_0x57ee4c]={'$like':'%'+_0x380eca[_0x47a5('0x3e')][_0x47a5('0x48')]+'%'};return _0x5be91a;})});}_0x439f60=_[_0x47a5('0x4a')]({},_0x439f60,_0x380eca[_0x47a5('0x63')]);return _0x3e4148['getApplications'](_0x439f60);}})[_0x47a5('0x1f')](function(_0xe3f0d7){if(_0xe3f0d7){_0x4c46ea=_0xe3f0d7[_0x47a5('0x43')];if(!_0x380eca[_0x47a5('0x3e')][_0x47a5('0x69')](_0x47a5('0x62'))){_0x439f60['limit']=qs[_0x47a5('0x44')](_0x380eca[_0x47a5('0x3e')][_0x47a5('0x44')]);_0x439f60[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x380eca['query'][_0x47a5('0x2d')]);}return _0x3e4148['getApplications'](_0x439f60);}})[_0x47a5('0x1f')](function(_0x56010f){if(_0x56010f){return _0x56010f?{'count':_0x4c46ea,'rows':_0x56010f}:null;}})[_0x47a5('0x1f')](respondWithResult(_0x5ca5bc,null))['catch'](handleError(_0x5ca5bc,null));};exports['getMessages']=function(_0x2a4e69,_0x445fc8,_0x488a4c){var _0xa07bc6={'raw':!![],'where':{}};var _0x2d7e13={};var _0x530542={'count':0x0,'rows':[]};return db[_0x47a5('0x3b')][_0x47a5('0x61')]({'where':{'id':_0x2a4e69[_0x47a5('0x53')]['id']}})['then'](handleEntityNotFound(_0x445fc8,null))[_0x47a5('0x1f')](function(_0x3b83ec){if(_0x3b83ec){_0x2d7e13[_0x47a5('0x3c')]=_[_0x47a5('0x3d')](db[_0x47a5('0x97')]['rawAttributes']);_0x2d7e13['query']=_[_0x47a5('0x3d')](_0x2a4e69['query']);_0x2d7e13[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x2d7e13['model'],_0x2d7e13['query']);_0xa07bc6[_0x47a5('0x41')]=_['intersection'](_0x2d7e13[_0x47a5('0x3c')],qs[_0x47a5('0x42')](_0x2a4e69[_0x47a5('0x3e')][_0x47a5('0x42')]));_0xa07bc6[_0x47a5('0x41')]=_0xa07bc6[_0x47a5('0x41')][_0x47a5('0x43')]?_0xa07bc6['attributes']:_0x2d7e13[_0x47a5('0x3c')];if(!_0x2a4e69['query'][_0x47a5('0x69')](_0x47a5('0x62'))){_0xa07bc6[_0x47a5('0x44')]=qs[_0x47a5('0x44')](_0x2a4e69[_0x47a5('0x3e')][_0x47a5('0x44')]);_0xa07bc6[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x2a4e69[_0x47a5('0x3e')][_0x47a5('0x2d')]);}_0xa07bc6[_0x47a5('0x45')]=qs[_0x47a5('0x46')](_0x2a4e69['query'][_0x47a5('0x46')]);_0xa07bc6[_0x47a5('0x49')]=qs[_0x47a5('0x3f')](_['pick'](_0x2a4e69[_0x47a5('0x3e')],_0x2d7e13[_0x47a5('0x3f')]));_0xa07bc6[_0x47a5('0x49')][_0x47a5('0x5d')]=_0x3b83ec['id'];if(_0x2a4e69[_0x47a5('0x3e')][_0x47a5('0x48')]){_0xa07bc6['where']=_[_0x47a5('0x4a')](_0xa07bc6[_0x47a5('0x49')],{'$or':_[_0x47a5('0x4b')](_0xa07bc6[_0x47a5('0x41')],function(_0x30dcbf){var _0x3c80d7={};_0x3c80d7[_0x30dcbf]={'$like':'%'+_0x2a4e69[_0x47a5('0x3e')][_0x47a5('0x48')]+'%'};return _0x3c80d7;})});}if(_0x2a4e69[_0x47a5('0x3e')][_0x47a5('0x98')]){var _0x4817f8=_0x2a4e69['query'][_0x47a5('0x98')][_0x47a5('0x99')](',');var _0x3f1d5a={};_0x3f1d5a[_0x4817f8[0x0]]={'$gte':moment(_0x4817f8[0x1])['format'](_0x47a5('0x9a'))};_0xa07bc6['where']=_['merge'](_0xa07bc6[_0x47a5('0x49')],_0x3f1d5a);}_0xa07bc6=_[_0x47a5('0x4a')]({},_0xa07bc6,_0x2a4e69[_0x47a5('0x63')]);return db[_0x47a5('0x97')]['count']({'where':_0xa07bc6[_0x47a5('0x49')]})[_0x47a5('0x1f')](function(_0x4ff2a5){_0x530542['count']=_0x4ff2a5;if(_0x2a4e69['query'][_0x47a5('0x58')]){_0xa07bc6[_0x47a5('0x50')]=[{'all':!![]}];}return db[_0x47a5('0x97')][_0x47a5('0x51')](_0xa07bc6);})[_0x47a5('0x1f')](function(_0x4c555c){_0x530542['rows']=_0x4c555c;return _0x530542;});}})[_0x47a5('0x1f')](respondWithFilteredResult(_0x445fc8,_0xa07bc6))[_0x47a5('0x5b')](handleError(_0x445fc8,null));};exports[_0x47a5('0x37')]=function(_0x1ca53c,_0x4d26f4,_0x873e26){var _0x392e23,_0x17253b={},_0x57a70d;if(_0x1ca53c['body']['to']){_0x57a70d=_0x1ca53c['body']['to']['split'](',')[0x0];}return db[_0x47a5('0x3b')][_0x47a5('0x59')]({'where':{'id':_0x1ca53c[_0x47a5('0x53')]['id']},'include':[{'model':db[_0x47a5('0x9b')],'as':_0x47a5('0x9c'),'include':[{'model':db[_0x47a5('0x87')],'as':_0x47a5('0x9d'),'where':{'email':_0x57a70d},'limit':0x1,'order':[[_0x47a5('0x9e'),_0x47a5('0x9f')]]}]},{'model':db['MailServerOut'],'as':_0x47a5('0x3a'),'raw':!![]}]})[_0x47a5('0x1f')](handleEntityNotFound(_0x4d26f4,null))['then'](function(_0x34ff37){if(_0x34ff37){_0x392e23=_0x34ff37;if(_0x34ff37[_0x47a5('0x3a')]){if(_[_0x47a5('0x6c')](_0x1ca53c[_0x47a5('0x5a')]['from'])){_0x1ca53c[_0x47a5('0x5a')][_0x47a5('0xa0')]=util[_0x47a5('0xa1')]('%s\x20<%s>',_0x34ff37['name'],_0x34ff37[_0x47a5('0xa2')]||_0x34ff37['Smtp'][_0x47a5('0x71')]);}if(_0x1ca53c['body'][_0x47a5('0xa3')]&&_0x1ca53c[_0x47a5('0x5a')][_0x47a5('0xa3')][_0x47a5('0x43')]){for(var _0x1cef82=0x0;_0x1cef82<_0x1ca53c['body']['attachments'][_0x47a5('0x43')];_0x1cef82+=0x1){_0x1ca53c[_0x47a5('0x5a')][_0x47a5('0xa3')][_0x1cef82]={'filename':_0x1ca53c[_0x47a5('0x5a')]['attachments'][_0x1cef82]['name'],'path':path[_0x47a5('0xa4')](config['root'],_0x47a5('0xa5'),_0x1ca53c['body'][_0x47a5('0xa3')][_0x1cef82]['basename'])};}}var _0x41bbe6={'tls':{'rejectUnauthorized':![]}};if(_[_0x47a5('0x6c')](_0x34ff37[_0x47a5('0x3a')][_0x47a5('0x78')])){if(_0x34ff37[_0x47a5('0x3a')][_0x47a5('0x75')]){_0x41bbe6[_0x47a5('0xa6')]={'user':_0x34ff37[_0x47a5('0x3a')]['user'],'pass':_0x34ff37[_0x47a5('0x3a')][_0x47a5('0x73')]};}_0x41bbe6['host']=_0x34ff37[_0x47a5('0x3a')][_0x47a5('0x77')];_0x41bbe6['port']=_0x34ff37['Smtp'][_0x47a5('0x76')];_0x41bbe6['secure']=_0x34ff37[_0x47a5('0x3a')][_0x47a5('0xa7')];}else{_0x41bbe6[_0x47a5('0x78')]=_0x34ff37['Smtp'][_0x47a5('0x78')];_0x41bbe6[_0x47a5('0xa6')]={'user':_0x34ff37[_0x47a5('0x3a')][_0x47a5('0x71')],'pass':_0x34ff37[_0x47a5('0x3a')][_0x47a5('0x73')]};}return respondWithRpcPromise(_0x47a5('0xa8'),'sendMail',{'account':_0x41bbe6,'message':_0x1ca53c[_0x47a5('0x5a')]});}else{throw new Error(_0x47a5('0xa9'));}}})[_0x47a5('0x1f')](function(_0xa6c86e){if(_0xa6c86e){_0x17253b=_0xa6c86e;if(_0x392e23[_0x47a5('0x9c')]){if(_0x392e23[_0x47a5('0x9c')][_0x47a5('0x9d')]['length']){return _0x392e23['List'][_0x47a5('0x9d')][0x0];}else{return db[_0x47a5('0x87')][_0x47a5('0x5f')](_['defaults'](_0x1ca53c['body'],{'firstName':_0x1ca53c[_0x47a5('0x5a')]['to'],'email':_0x1ca53c[_0x47a5('0x5a')]['to'],'phone':_0x1ca53c[_0x47a5('0x5a')]['to'],'ListId':_0x392e23[_0x47a5('0x6b')]}));}}else{throw new Error(_0x47a5('0xa9'));}}})[_0x47a5('0x1f')](function(_0x2e0add){if(_0x2e0add){var _0x58e85b={'UserId':_0x1ca53c[_0x47a5('0x71')]['id'],'ContactId':_0x2e0add['id'],'MailAccountId':_0x392e23['id'],'inReplyTo':_0x17253b[_0x47a5('0xaa')],'to':_0x1ca53c[_0x47a5('0x5a')]['from'],'cc':_0x1ca53c[_0x47a5('0x5a')]['cc'],'subject':_0x1ca53c[_0x47a5('0x5a')][_0x47a5('0xab')],'attach':_0x1ca53c[_0x47a5('0x5a')][_0x47a5('0xac')],'firstMsgDirection':_0x47a5('0xad'),'lastMsgAt':moment()[_0x47a5('0xa1')](_0x47a5('0x9a')),'lastMsgDirection':_0x47a5('0xad'),'lastMsgBody':_0x1ca53c[_0x47a5('0x5a')][_0x47a5('0x5a')],'Messages':[_[_0x47a5('0x4a')](_0x1ca53c[_0x47a5('0x5a')],{'messageId':_0x17253b['messageId'],'sentAt':moment()[_0x47a5('0xa1')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x392e23['id'],'UserId':_0x1ca53c[_0x47a5('0x71')]['id'],'ContactId':_0x2e0add['id']})]};if(_0x1ca53c['body'][_0x47a5('0xae')]){_0x58e85b=_[_0x47a5('0x4a')](_0x58e85b,_0x1ca53c[_0x47a5('0x5a')]['Interaction']);}return db[_0x47a5('0x85')]['create'](_0x58e85b,{'include':[{'model':db[_0x47a5('0x97')],'as':_0x47a5('0xaf')}]});}})[_0x47a5('0x1f')](respondWithResult(_0x4d26f4,null))[_0x47a5('0x5b')](handleError(_0x4d26f4,null));};exports['verifySmtp']=function(_0x265f50,_0x512607,_0x5cabb3){return db[_0x47a5('0x3b')][_0x47a5('0x59')]({'where':{'id':_0x265f50[_0x47a5('0x53')]['id']},'include':[{'model':db[_0x47a5('0x39')],'as':_0x47a5('0x3a'),'raw':!![]}]})[_0x47a5('0x1f')](handleEntityNotFound(_0x512607,null))[_0x47a5('0x1f')](function(_0x33ac8b){if(_0x33ac8b&&_0x33ac8b[_0x47a5('0x3a')]){var _0x598c19={'id':_0x33ac8b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x33ac8b['Smtp'][_0x47a5('0x78')]){_0x598c19[_0x47a5('0x78')]=_0x33ac8b[_0x47a5('0x3a')][_0x47a5('0x78')];}else{_0x598c19[_0x47a5('0x77')]=_0x33ac8b['Smtp'][_0x47a5('0x77')];_0x598c19[_0x47a5('0x76')]=_0x33ac8b[_0x47a5('0x3a')]['port'];_0x598c19['secure']=_0x33ac8b[_0x47a5('0x3a')][_0x47a5('0xa7')];}if(_0x33ac8b['Smtp'][_0x47a5('0x75')]){_0x598c19[_0x47a5('0xa6')]={'user':_0x33ac8b[_0x47a5('0x3a')]['user'],'pass':_0x33ac8b[_0x47a5('0x3a')][_0x47a5('0x73')]};}return respondWithRpcPromise(_0x47a5('0xb0'),_0x47a5('0xb1'),{'account':_0x598c19});}})[_0x47a5('0x1f')](respondWithResult(_0x512607,null))['catch'](handleError(_0x512607,null));};exports[_0x47a5('0x32')]=function(_0x38accb,_0x245e90){return db[_0x47a5('0x3b')]['find']({'where':{'id':_0x38accb['params']['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x245e90,null))['then'](function(_0x200742){if(_0x200742&&_0x200742[_0x47a5('0x78')]){throw new db[(_0x47a5('0xb2'))][(_0x47a5('0xb3'))](_0x47a5('0xb4'));}return _0x200742;})[_0x47a5('0x1f')](removeEntity(_0x245e90,null))['catch'](handleError(_0x245e90,null));};exports[_0x47a5('0xb5')]=function(_0x4035c6,_0x32143a,_0x52864b){return db['MailAccount'][_0x47a5('0x59')]({'where':{'id':_0x4035c6['params']['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x32143a,null))[_0x47a5('0x1f')](function(_0x3641f8){if(_0x3641f8){return _0x3641f8[_0x47a5('0xb5')](_0x4035c6[_0x47a5('0x5a')]['ids'],_['omit'](_0x4035c6[_0x47a5('0x5a')],[_0x47a5('0x65'),'id'])||{})[_0x47a5('0xb6')](function(_0x9fdee1){for(var _0x358d0b=0x0;_0x358d0b<_0x4035c6['body'][_0x47a5('0x65')][_0x47a5('0x43')];_0x358d0b+=0x1){socket[_0x47a5('0xb7')](_0x47a5('0xb8'),{'UserId':_0x4035c6[_0x47a5('0x5a')]['ids'][_0x358d0b],'MailAccountId':_0x4035c6[_0x47a5('0x53')]['id']});}return _0x9fdee1;});}})[_0x47a5('0x1f')](respondWithResult(_0x32143a,null))[_0x47a5('0x5b')](handleError(_0x32143a,null));};exports[_0x47a5('0xb9')]=function(_0x231977,_0x3eec46,_0x3e994b){return db[_0x47a5('0x3b')][_0x47a5('0x59')]({'where':{'id':_0x231977[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x3eec46,null))['then'](function(_0x39786a){if(_0x39786a){return _0x39786a[_0x47a5('0xb9')](_0x231977[_0x47a5('0x3e')][_0x47a5('0x65')])['then'](function(){if(_['isArray'](_0x231977['query'][_0x47a5('0x65')])){for(var _0x52e921=0x0;_0x52e921<_0x231977[_0x47a5('0x3e')][_0x47a5('0x65')]['length'];_0x52e921+=0x1){socket[_0x47a5('0xb7')](_0x47a5('0xba'),{'UserId':Number(_0x231977[_0x47a5('0x3e')]['ids'][_0x52e921]),'MailAccountId':Number(_0x231977[_0x47a5('0x53')]['id'])});}}else{socket['emit'](_0x47a5('0xba'),{'UserId':Number(_0x231977[_0x47a5('0x3e')][_0x47a5('0x65')]),'MailAccountId':Number(_0x231977[_0x47a5('0x53')]['id'])});}});}})[_0x47a5('0x1f')](respondWithStatusCode(_0x3eec46,null))[_0x47a5('0x5b')](handleError(_0x3eec46,null));};exports['getAgents']=function(_0x5709f8,_0x4ebc5c,_0x2647c3){var _0x2da818={};var _0x1d6349={};var _0x9d1a3b;var _0x28bf10;return db[_0x47a5('0x3b')][_0x47a5('0x61')]({'where':{'id':_0x5709f8[_0x47a5('0x53')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x4ebc5c,null))[_0x47a5('0x1f')](function(_0x277061){if(_0x277061){_0x9d1a3b=_0x277061;_0x1d6349[_0x47a5('0x3c')]=_[_0x47a5('0x3d')](db[_0x47a5('0x89')][_0x47a5('0x57')]);_0x1d6349[_0x47a5('0x3e')]=_['keys'](_0x5709f8[_0x47a5('0x3e')]);_0x1d6349[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x1d6349[_0x47a5('0x3c')],_0x1d6349[_0x47a5('0x3e')]);_0x2da818[_0x47a5('0x41')]=_[_0x47a5('0x40')](_0x1d6349[_0x47a5('0x3c')],qs['fields'](_0x5709f8[_0x47a5('0x3e')]['fields']));_0x2da818[_0x47a5('0x41')]=_0x2da818[_0x47a5('0x41')]['length']?_0x2da818[_0x47a5('0x41')]:_0x1d6349['model'];_0x2da818[_0x47a5('0x45')]=qs[_0x47a5('0x46')](_0x5709f8[_0x47a5('0x3e')][_0x47a5('0x46')]);_0x2da818[_0x47a5('0x49')]=qs['filters'](_[_0x47a5('0x47')](_0x5709f8[_0x47a5('0x3e')],_0x1d6349[_0x47a5('0x3f')]));if(_0x5709f8['query']['filter']){_0x2da818[_0x47a5('0x49')]=_[_0x47a5('0x4a')](_0x2da818[_0x47a5('0x49')],{'$or':_['map'](_0x2da818[_0x47a5('0x41')],function(_0x18f6d1){var _0x312ac7={};_0x312ac7[_0x18f6d1]={'$like':'%'+_0x5709f8['query'][_0x47a5('0x48')]+'%'};return _0x312ac7;})});}_0x2da818=_[_0x47a5('0x4a')]({},_0x2da818,_0x5709f8[_0x47a5('0x63')]);return _0x9d1a3b[_0x47a5('0xbb')](_0x2da818);}})['then'](function(_0x1a1be9){if(_0x1a1be9){_0x28bf10=_0x1a1be9['length'];if(!_0x5709f8[_0x47a5('0x3e')][_0x47a5('0x69')](_0x47a5('0x62'))){_0x2da818[_0x47a5('0x44')]=qs['limit'](_0x5709f8[_0x47a5('0x3e')][_0x47a5('0x44')]);_0x2da818[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x5709f8[_0x47a5('0x3e')]['offset']);}return _0x9d1a3b[_0x47a5('0xbb')](_0x2da818);}})[_0x47a5('0x1f')](function(_0xc46ed6){if(_0xc46ed6){return _0xc46ed6?{'count':_0x28bf10,'rows':_0xc46ed6}:null;}})[_0x47a5('0x1f')](respondWithResult(_0x4ebc5c,null))[_0x47a5('0x5b')](handleError(_0x4ebc5c,null));}; \ No newline at end of file +var _0x814b=['format','YYYY-MM-DD\x20HH:mm:ss','split','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','attach','out','messageId','Interaction','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','Content-Range','reject','update','destroy','get','MailAccounts','name','index','MailServerOut','Smtp','Pause','mandatoryDispositionPause','rawAttributes','keys','query','filters','intersection','model','attributes','length','nolimit','limit','order','sort','where','filter','merge','map','type','key','field','options','MailAccount','count','includeAll','findAll','rows','show','MailServerIn','fields','include','find','body','params','Imap','describe','MailAccountId','Disposition','create','getDispositions','findOne','hasOwnProperty','pick','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','email','ListId','isNil','active','description','cservice','user','pass','authentication','host','port','service','cuser','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','$gte'];(function(_0x4b8d93,_0x3ab6f1){var _0x46b65e=function(_0x1db7d4){while(--_0x1db7d4){_0x4b8d93['push'](_0x4b8d93['shift']());}};_0x46b65e(++_0x3ab6f1);}(_0x814b,0x1a2));var _0xb814=function(_0x3ad737,_0x300131){_0x3ad737=_0x3ad737-0x0;var _0x16c1e2=_0x814b[_0x3ad737];return _0x16c1e2;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var hardwareService=require(_0xb814('0x15'));var logger=require(_0xb814('0x16'))(_0xb814('0x17'));var utils=require('../../config/utils');var config=require(_0xb814('0x18'));var db=require('../../mysqldb')['db'];config[_0xb814('0x19')]=_[_0xb814('0x1a')](config[_0xb814('0x19')],{'host':_0xb814('0x1b'),'port':0x18eb});var socket=require(_0xb814('0x1c'))(new Redis(config[_0xb814('0x19')]));require(_0xb814('0x1d'))[_0xb814('0x1e')](socket);var jayson=require(_0xb814('0x1f'));var client=jayson[_0xb814('0x20')][_0xb814('0x21')]({'port':0x232b});function checkPasswordPattern(_0x44fb96,_0x17f5bd,_0x39bfcf){if(_0x39bfcf){var _0x303aca=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x303aca[_0xb814('0x22')](_0x17f5bd)){return _0x44fb96;}else{throw new Error(_0xb814('0x23'));}}else{return _0x44fb96;}}function respondWithRpcPromise(_0x265a83,_0x125ce2,_0x21b73f,_0x7a21ef){return new BPromise(function(_0x48c9df,_0x168a48){var _0x55ba16=_0x7a21ef||client;return _0x55ba16[_0xb814('0x24')](_0x265a83,_0x21b73f)[_0xb814('0x25')](function(_0x4c3007){logger['info']('MailAccount,\x20%s,\x20%s',_0x125ce2,_0xb814('0x26'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x125ce2,_0xb814('0x26'),JSON[_0xb814('0x27')](_0x4c3007));if(_0x4c3007[_0xb814('0x28')]){if(_0x4c3007['error'][_0xb814('0x29')]===0x1f4){logger['error'](_0xb814('0x2a'),_0x125ce2,_0x4c3007[_0xb814('0x28')][_0xb814('0x2b')]);return _0x168a48(_0x4c3007[_0xb814('0x28')][_0xb814('0x2b')]);}logger[_0xb814('0x28')](_0xb814('0x2a'),_0x125ce2,_0x4c3007['error'][_0xb814('0x2b')]);return _0x48c9df(_0x4c3007['error'][_0xb814('0x2b')]);}else{logger[_0xb814('0x2c')](_0xb814('0x2a'),_0x125ce2,_0xb814('0x26'));_0x48c9df(_0x4c3007[_0xb814('0x2d')][_0xb814('0x2b')]);}})[_0xb814('0x2e')](function(_0x5755ea){logger[_0xb814('0x28')](_0xb814('0x2a'),_0x125ce2,_0x5755ea);_0x168a48(_0x5755ea);});});}function respondWithStatusCode(_0x1c2625,_0x349394){_0x349394=_0x349394||0xcc;return function(_0x32ed56){if(_0x32ed56){return _0x1c2625[_0xb814('0x2f')](_0x349394);}return _0x1c2625[_0xb814('0x30')](_0x349394)[_0xb814('0x31')]();};}function respondWithResult(_0x5a6291,_0x271aa8){_0x271aa8=_0x271aa8||0xc8;return function(_0x328a08){if(_0x328a08){return _0x5a6291['status'](_0x271aa8)[_0xb814('0x32')](_0x328a08);}};}function respondWithFilteredResult(_0x37d24d,_0x530744){return function(_0x499f22){if(_0x499f22){var _0x20577b=_0x499f22['count'],_0x2051d0=_0x530744[_0xb814('0x33')],_0x58c3ca=_0x530744['offset']+_0x530744['limit'],_0x338a28;if(_0x58c3ca>=_0x20577b){_0x58c3ca=_0x20577b;_0x338a28=0xc8;}else{_0x338a28=0xce;}_0x37d24d[_0xb814('0x30')](_0x338a28);return _0x37d24d['set'](_0xb814('0x34'),_0x2051d0+'-'+_0x58c3ca+'/'+_0x20577b)[_0xb814('0x32')](_0x499f22);}return null;};}function patchUpdates(_0x2b91bd){return function(_0x599f9f){try{jsonpatch['apply'](_0x599f9f,_0x2b91bd,!![]);}catch(_0x26d3a9){return BPromise[_0xb814('0x35')](_0x26d3a9);}return _0x599f9f['save']();};}function saveUpdates(_0x2c8943,_0xe558d5){return function(_0x692c72){if(_0x692c72){return _0x692c72[_0xb814('0x36')](_0x2c8943)[_0xb814('0x25')](function(_0x60024d){return _0x60024d;});}return null;};}function removeEntity(_0x3672f3,_0x4df4e6){return function(_0x3207ec){if(_0x3207ec){return _0x3207ec[_0xb814('0x37')]()[_0xb814('0x25')](function(){var _0x424e2b=_0x3207ec[_0xb814('0x38')]({'plain':!![]});var _0x4ff31a=_0xb814('0x39');return db['UserProfileResource'][_0xb814('0x37')]({'where':{'type':_0x4ff31a,'resourceId':_0x424e2b['id']}})[_0xb814('0x25')](function(){return _0x3207ec;});})[_0xb814('0x25')](function(){_0x3672f3['status'](0xcc)[_0xb814('0x31')]();});}};}function handleEntityNotFound(_0xbdb3e9,_0x4ea6f8){return function(_0x2fcd92){if(!_0x2fcd92){_0xbdb3e9[_0xb814('0x2f')](0x194);}return _0x2fcd92;};}function handleError(_0x1a8bd0,_0x1f7cd8){_0x1f7cd8=_0x1f7cd8||0x1f4;return function(_0xd77d96){logger[_0xb814('0x28')](_0xd77d96['stack']);if(_0xd77d96[_0xb814('0x3a')]){delete _0xd77d96['name'];}_0x1a8bd0[_0xb814('0x30')](_0x1f7cd8)['send'](_0xd77d96);};}exports[_0xb814('0x3b')]=function(_0x4b9233,_0x2f8a2e){var _0x26675a={'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0xb814('0x3c')],'as':_0xb814('0x3d')},{'model':db[_0xb814('0x3e')],'as':_0xb814('0x3f')}]},_0x54a7fb={},_0x4d308a={'count':0x0,'rows':[]};var _0x51cdba=db['MailAccount'][_0xb814('0x40')];_0x54a7fb['model']=_[_0xb814('0x41')](_0x51cdba);_0x54a7fb[_0xb814('0x42')]=_[_0xb814('0x41')](_0x4b9233[_0xb814('0x42')]);_0x54a7fb[_0xb814('0x43')]=_[_0xb814('0x44')](_0x54a7fb[_0xb814('0x45')],_0x54a7fb[_0xb814('0x42')]);_0x26675a[_0xb814('0x46')]=_['intersection'](_0x54a7fb['model'],qs['fields'](_0x4b9233[_0xb814('0x42')]['fields']));_0x26675a[_0xb814('0x46')]=_0x26675a['attributes'][_0xb814('0x47')]?_0x26675a[_0xb814('0x46')]:_0x54a7fb[_0xb814('0x45')];if(!_0x4b9233[_0xb814('0x42')]['hasOwnProperty'](_0xb814('0x48'))){_0x26675a[_0xb814('0x49')]=qs[_0xb814('0x49')](_0x4b9233[_0xb814('0x42')][_0xb814('0x49')]);_0x26675a[_0xb814('0x33')]=qs['offset'](_0x4b9233[_0xb814('0x42')][_0xb814('0x33')]);}_0x26675a[_0xb814('0x4a')]=qs[_0xb814('0x4b')](_0x4b9233[_0xb814('0x42')][_0xb814('0x4b')]);_0x26675a[_0xb814('0x4c')]=qs['filters'](_['pick'](_0x4b9233[_0xb814('0x42')],_0x54a7fb[_0xb814('0x43')]));if(_0x4b9233[_0xb814('0x42')][_0xb814('0x4d')]){_0x26675a[_0xb814('0x4c')]=_[_0xb814('0x4e')](_0x26675a[_0xb814('0x4c')],{'$or':_[_0xb814('0x4f')](_0x51cdba,function(_0x2eb9b6){if(_0x2eb9b6[_0xb814('0x50')][_0xb814('0x51')]!=='VIRTUAL'){var _0x37800a={};_0x37800a[_0x2eb9b6[_0xb814('0x52')]]={'$like':'%'+_0x4b9233['query'][_0xb814('0x4d')]+'%'};return _0x37800a;}})});}_0x26675a=_['merge']({},_0x26675a,_0x4b9233[_0xb814('0x53')]);var _0x37866f={'where':_0x26675a[_0xb814('0x4c')]};return db[_0xb814('0x54')][_0xb814('0x55')](_0x37866f)[_0xb814('0x25')](function(_0x2cc806){_0x4d308a[_0xb814('0x55')]=_0x2cc806;if(_0x4b9233[_0xb814('0x42')][_0xb814('0x56')]){_0x26675a['include']=[{'all':!![]}];}return db['MailAccount'][_0xb814('0x57')](_0x26675a);})[_0xb814('0x25')](function(_0x4156d8){_0x4d308a[_0xb814('0x58')]=_0x4156d8;return _0x4d308a;})[_0xb814('0x25')](respondWithFilteredResult(_0x2f8a2e,_0x26675a))[_0xb814('0x2e')](handleError(_0x2f8a2e,null));};exports[_0xb814('0x59')]=function(_0x4a4f9a,_0x26fd0b){var _0x388324={'raw':![],'where':{'id':_0x4a4f9a['params']['id']},'include':[{'model':db[_0xb814('0x5a')],'as':'Imap'},{'model':db[_0xb814('0x3c')],'as':'Smtp'},{'model':db[_0xb814('0x3e')],'as':_0xb814('0x3f')}]},_0xf27a6e={};_0xf27a6e['model']=_[_0xb814('0x41')](db[_0xb814('0x54')][_0xb814('0x40')]);_0xf27a6e['query']=_[_0xb814('0x41')](_0x4a4f9a['query']);_0xf27a6e[_0xb814('0x43')]=_[_0xb814('0x44')](_0xf27a6e['model'],_0xf27a6e[_0xb814('0x42')]);_0x388324['attributes']=_['intersection'](_0xf27a6e[_0xb814('0x45')],qs[_0xb814('0x5b')](_0x4a4f9a[_0xb814('0x42')]['fields']));_0x388324[_0xb814('0x46')]=_0x388324['attributes'][_0xb814('0x47')]?_0x388324[_0xb814('0x46')]:_0xf27a6e['model'];if(_0x4a4f9a[_0xb814('0x42')]['includeAll']){_0x388324[_0xb814('0x5c')]=[{'all':!![]}];}_0x388324=_[_0xb814('0x4e')]({},_0x388324,_0x4a4f9a[_0xb814('0x53')]);return db[_0xb814('0x54')][_0xb814('0x5d')](_0x388324)[_0xb814('0x25')](handleEntityNotFound(_0x26fd0b,null))[_0xb814('0x25')](respondWithResult(_0x26fd0b,null))[_0xb814('0x2e')](handleError(_0x26fd0b,null));};exports['update']=function(_0x374532,_0x5441c5){if(_0x374532['body']['id']){delete _0x374532[_0xb814('0x5e')]['id'];}return db[_0xb814('0x54')]['find']({'where':{'id':_0x374532[_0xb814('0x5f')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0xb814('0x3c')],'as':'Smtp'},{'model':db[_0xb814('0x3e')],'as':_0xb814('0x3f')}]})[_0xb814('0x25')](handleEntityNotFound(_0x5441c5,null))['then'](saveUpdates(_0x374532[_0xb814('0x5e')],null))['then'](function(_0x2ef77d){if(_0x2ef77d&&_0x374532[_0xb814('0x5e')][_0xb814('0x60')]){return db[_0xb814('0x5a')][_0xb814('0x36')](_0x374532[_0xb814('0x5e')][_0xb814('0x60')],{'where':{'MailAccountId':_0x2ef77d['id']}})[_0xb814('0x25')](function(){return _0x2ef77d;});}return _0x2ef77d;})[_0xb814('0x25')](function(_0x4d611d){if(_0x4d611d&&_0x374532[_0xb814('0x5e')][_0xb814('0x3d')]){return db[_0xb814('0x3c')][_0xb814('0x36')](_0x374532[_0xb814('0x5e')][_0xb814('0x3d')],{'where':{'MailAccountId':_0x4d611d['id']}})['then'](function(){return _0x4d611d;});}return _0x4d611d;})[_0xb814('0x25')](respondWithResult(_0x5441c5,null))['catch'](handleError(_0x5441c5,null));};exports[_0xb814('0x61')]=function(_0x39b754,_0xac95cf){return db['MailAccount'][_0xb814('0x61')]()['then'](respondWithResult(_0xac95cf,null))[_0xb814('0x2e')](handleError(_0xac95cf,null));};exports['addDisposition']=function(_0x2f0c94,_0x417e45,_0xa03cd2){if(_0x2f0c94[_0xb814('0x5e')]['id']){delete _0x2f0c94[_0xb814('0x5e')]['id'];}return db[_0xb814('0x54')][_0xb814('0x5d')]({'where':{'id':_0x2f0c94['params']['id']}})[_0xb814('0x25')](handleEntityNotFound(_0x417e45,null))['then'](function(_0x255047){if(_0x255047){_0x2f0c94[_0xb814('0x5e')][_0xb814('0x62')]=_0x255047['id'];return db[_0xb814('0x63')][_0xb814('0x64')](_0x2f0c94[_0xb814('0x5e')]);}})['then'](respondWithResult(_0x417e45,null))[_0xb814('0x2e')](handleError(_0x417e45,null));};exports[_0xb814('0x65')]=function(_0x4a49ba,_0x3bb2b4,_0x32a37a){var _0x263699={'raw':![],'where':{}};var _0x130033={};var _0x2161eb={'count':0x0,'rows':[]};return db['MailAccount'][_0xb814('0x66')]({'where':{'id':_0x4a49ba['params']['id']}})[_0xb814('0x25')](handleEntityNotFound(_0x3bb2b4,null))[_0xb814('0x25')](function(_0x2645f6){if(_0x2645f6){_0x130033[_0xb814('0x45')]=_[_0xb814('0x41')](db[_0xb814('0x63')]['rawAttributes']);_0x130033['query']=_['keys'](_0x4a49ba[_0xb814('0x42')]);_0x130033['filters']=_[_0xb814('0x44')](_0x130033[_0xb814('0x45')],_0x130033[_0xb814('0x42')]);_0x263699['attributes']=_[_0xb814('0x44')](_0x130033[_0xb814('0x45')],qs[_0xb814('0x5b')](_0x4a49ba['query'][_0xb814('0x5b')]));_0x263699[_0xb814('0x46')]=_0x263699[_0xb814('0x46')][_0xb814('0x47')]?_0x263699['attributes']:_0x130033['model'];if(!_0x4a49ba[_0xb814('0x42')][_0xb814('0x67')](_0xb814('0x48'))){_0x263699[_0xb814('0x49')]=qs[_0xb814('0x49')](_0x4a49ba[_0xb814('0x42')][_0xb814('0x49')]);_0x263699[_0xb814('0x33')]=qs[_0xb814('0x33')](_0x4a49ba[_0xb814('0x42')][_0xb814('0x33')]);}_0x263699[_0xb814('0x4a')]=qs[_0xb814('0x4b')](_0x4a49ba[_0xb814('0x42')][_0xb814('0x4b')]);_0x263699['where']=qs[_0xb814('0x43')](_[_0xb814('0x68')](_0x4a49ba[_0xb814('0x42')],_0x130033[_0xb814('0x43')]));_0x263699[_0xb814('0x4c')][_0xb814('0x62')]=_0x2645f6['id'];if(_0x4a49ba['query'][_0xb814('0x4d')]){_0x263699['where']=_[_0xb814('0x4e')](_0x263699[_0xb814('0x4c')],{'$or':_[_0xb814('0x4f')](_0x263699[_0xb814('0x46')],function(_0x265a25){var _0x5ce177={};_0x5ce177[_0x265a25]={'$like':'%'+_0x4a49ba['query'][_0xb814('0x4d')]+'%'};return _0x5ce177;})});}_0x263699=_[_0xb814('0x4e')]({},_0x263699,_0x4a49ba[_0xb814('0x53')]);return db[_0xb814('0x63')]['count']({'where':_0x263699[_0xb814('0x4c')]})['then'](function(_0x39073c){_0x2161eb[_0xb814('0x55')]=_0x39073c;if(_0x4a49ba['query']['includeAll']){_0x263699[_0xb814('0x5c')]=[{'all':!![]}];}return db['Disposition'][_0xb814('0x57')](_0x263699);})[_0xb814('0x25')](function(_0x3c770d){_0x2161eb[_0xb814('0x58')]=_0x3c770d;return _0x2161eb;});}})[_0xb814('0x25')](respondWithFilteredResult(_0x3bb2b4,_0x263699))[_0xb814('0x2e')](handleError(_0x3bb2b4,null));};exports[_0xb814('0x69')]=function(_0x4bd56c,_0x1d37ea,_0x54413d){return db[_0xb814('0x54')]['find']({'where':{'id':_0x4bd56c[_0xb814('0x5f')]['id']}})[_0xb814('0x25')](handleEntityNotFound(_0x1d37ea,null))['then'](function(_0x10a90d){if(_0x10a90d){return _0x10a90d['removeDispositions'](_0x4bd56c[_0xb814('0x42')][_0xb814('0x6a')]);}})['then'](respondWithStatusCode(_0x1d37ea,null))['catch'](handleError(_0x1d37ea,null));};exports[_0xb814('0x6b')]=function(_0x25d976,_0x3309c5,_0x6f5e6a){if(_0x25d976[_0xb814('0x5e')]['id']){delete _0x25d976[_0xb814('0x5e')]['id'];}return db[_0xb814('0x54')][_0xb814('0x5d')]({'where':{'id':_0x25d976[_0xb814('0x5f')]['id']}})[_0xb814('0x25')](handleEntityNotFound(_0x3309c5,null))['then'](function(_0x5b0fcd){if(_0x5b0fcd){_0x25d976['body']['MailAccountId']=_0x5b0fcd['id'];return db['CannedAnswer'][_0xb814('0x64')](_0x25d976[_0xb814('0x5e')]);}})[_0xb814('0x25')](respondWithResult(_0x3309c5,null))['catch'](handleError(_0x3309c5,null));};exports[_0xb814('0x6c')]=function(_0x1fb1ea,_0x31c072,_0x26ce5b){var _0x161658={'raw':![],'where':{}};var _0x35c18e={};var _0x3367b8={'count':0x0,'rows':[]};return db[_0xb814('0x54')]['findOne']({'where':{'id':_0x1fb1ea[_0xb814('0x5f')]['id']}})[_0xb814('0x25')](handleEntityNotFound(_0x31c072,null))[_0xb814('0x25')](function(_0x30faa0){if(_0x30faa0){_0x35c18e['model']=_[_0xb814('0x41')](db[_0xb814('0x6d')][_0xb814('0x40')]);_0x35c18e[_0xb814('0x42')]=_[_0xb814('0x41')](_0x1fb1ea['query']);_0x35c18e['filters']=_[_0xb814('0x44')](_0x35c18e['model'],_0x35c18e[_0xb814('0x42')]);_0x161658[_0xb814('0x46')]=_['intersection'](_0x35c18e[_0xb814('0x45')],qs['fields'](_0x1fb1ea[_0xb814('0x42')]['fields']));_0x161658[_0xb814('0x46')]=_0x161658[_0xb814('0x46')][_0xb814('0x47')]?_0x161658[_0xb814('0x46')]:_0x35c18e[_0xb814('0x45')];if(!_0x1fb1ea[_0xb814('0x42')][_0xb814('0x67')]('nolimit')){_0x161658['limit']=qs[_0xb814('0x49')](_0x1fb1ea['query']['limit']);_0x161658[_0xb814('0x33')]=qs[_0xb814('0x33')](_0x1fb1ea[_0xb814('0x42')]['offset']);}_0x161658[_0xb814('0x4a')]=qs['sort'](_0x1fb1ea[_0xb814('0x42')][_0xb814('0x4b')]);_0x161658[_0xb814('0x4c')]=qs[_0xb814('0x43')](_['pick'](_0x1fb1ea[_0xb814('0x42')],_0x35c18e[_0xb814('0x43')]));_0x161658[_0xb814('0x4c')]['MailAccountId']=_0x30faa0['id'];if(_0x1fb1ea[_0xb814('0x42')][_0xb814('0x4d')]){_0x161658[_0xb814('0x4c')]=_['merge'](_0x161658[_0xb814('0x4c')],{'$or':_[_0xb814('0x4f')](_0x161658[_0xb814('0x46')],function(_0x216d67){var _0x40b3c5={};_0x40b3c5[_0x216d67]={'$like':'%'+_0x1fb1ea[_0xb814('0x42')][_0xb814('0x4d')]+'%'};return _0x40b3c5;})});}_0x161658=_[_0xb814('0x4e')]({},_0x161658,_0x1fb1ea[_0xb814('0x53')]);return db[_0xb814('0x6d')][_0xb814('0x55')]({'where':_0x161658[_0xb814('0x4c')]})[_0xb814('0x25')](function(_0x5b8d2e){_0x3367b8['count']=_0x5b8d2e;if(_0x1fb1ea[_0xb814('0x42')]['includeAll']){_0x161658[_0xb814('0x5c')]=[{'all':!![]}];}return db[_0xb814('0x6d')][_0xb814('0x57')](_0x161658);})[_0xb814('0x25')](function(_0x405db7){_0x3367b8[_0xb814('0x58')]=_0x405db7;return _0x3367b8;});}})[_0xb814('0x25')](respondWithFilteredResult(_0x31c072,_0x161658))['catch'](handleError(_0x31c072,null));};exports['removeAnswers']=function(_0x3f6df9,_0x4f3125,_0x18678f){return db[_0xb814('0x54')][_0xb814('0x5d')]({'where':{'id':_0x3f6df9['params']['id']}})[_0xb814('0x25')](handleEntityNotFound(_0x4f3125,null))[_0xb814('0x25')](function(_0x35c60f){if(_0x35c60f){return _0x35c60f[_0xb814('0x6e')](_0x3f6df9[_0xb814('0x42')]['ids']);}})[_0xb814('0x25')](respondWithStatusCode(_0x4f3125,null))[_0xb814('0x2e')](handleError(_0x4f3125,null));};exports['create']=function(_0x4530ed,_0x20f6ca){var _0x3e3f69={'name':_0x4530ed['body'][_0xb814('0x3a')],'key':_0x4530ed[_0xb814('0x5e')]['key'],'email':_0x4530ed[_0xb814('0x5e')][_0xb814('0x6f')],'ListId':_0x4530ed['body'][_0xb814('0x70')],'active':!_[_0xb814('0x71')](_0x4530ed[_0xb814('0x5e')][_0xb814('0x72')])?_0x4530ed[_0xb814('0x5e')][_0xb814('0x72')]:!![],'description':_0x4530ed[_0xb814('0x5e')][_0xb814('0x73')]||null,'Imap':{},'Smtp':{}};if(_[_0xb814('0x71')](_0x4530ed[_0xb814('0x5e')][_0xb814('0x74')])){if(_0x4530ed[_0xb814('0x5e')]['cauthentication']){_0x3e3f69['Imap'][_0xb814('0x75')]=_0x3e3f69['Smtp']['user']=_0x4530ed[_0xb814('0x5e')]['cuser'];_0x3e3f69['Imap']['password']=_0x3e3f69[_0xb814('0x3d')][_0xb814('0x76')]=_0x4530ed[_0xb814('0x5e')]['cpassword'];}else{_0x3e3f69[_0xb814('0x60')]['authentication']=_0x3e3f69[_0xb814('0x3d')][_0xb814('0x77')]=![];}_0x3e3f69['Imap'][_0xb814('0x78')]=_0x4530ed['body'][_0xb814('0x60')][_0xb814('0x78')];_0x3e3f69[_0xb814('0x60')][_0xb814('0x79')]=_0x4530ed[_0xb814('0x5e')][_0xb814('0x60')][_0xb814('0x79')];_0x3e3f69[_0xb814('0x3d')][_0xb814('0x78')]=_0x4530ed[_0xb814('0x5e')][_0xb814('0x3d')][_0xb814('0x78')];_0x3e3f69[_0xb814('0x3d')][_0xb814('0x79')]=_0x4530ed[_0xb814('0x5e')]['Smtp'][_0xb814('0x79')];}else{_0x3e3f69[_0xb814('0x60')]['service']=_0x3e3f69[_0xb814('0x3d')][_0xb814('0x7a')]=_0x4530ed[_0xb814('0x5e')]['cservice'];_0x3e3f69['Imap'][_0xb814('0x75')]=_0x3e3f69['Smtp'][_0xb814('0x75')]=_0x4530ed['body'][_0xb814('0x7b')];_0x3e3f69['Imap']['password']=_0x3e3f69[_0xb814('0x3d')][_0xb814('0x76')]=_0x4530ed[_0xb814('0x5e')][_0xb814('0x7c')];}return db[_0xb814('0x54')][_0xb814('0x64')](_0x3e3f69,{'include':[{'model':db[_0xb814('0x3c')],'as':_0xb814('0x3d')},{'model':db[_0xb814('0x5a')],'as':_0xb814('0x60')}]})[_0xb814('0x25')](function(_0x5050db){var _0x5bd85=_0x4530ed['user'][_0xb814('0x38')]({'plain':!![]});if(!_0x5bd85)throw new Error(_0xb814('0x7d'));if(_0x5bd85[_0xb814('0x7e')]==='user'){var _0x6e5486=_0x5050db[_0xb814('0x38')]({'plain':!![]});return db[_0xb814('0x7f')][_0xb814('0x5d')]({'where':{'name':_0xb814('0x39'),'userProfileId':_0x5bd85[_0xb814('0x80')]},'raw':!![]})[_0xb814('0x25')](function(_0x44588a){if(_0x44588a&&_0x44588a[_0xb814('0x81')]===0x0){return db[_0xb814('0x82')][_0xb814('0x64')]({'name':_0x6e5486[_0xb814('0x3a')],'resourceId':_0x6e5486['id'],'type':_0x44588a[_0xb814('0x3a')],'sectionId':_0x44588a['id']},{})[_0xb814('0x25')](function(){return _0x5050db;});}else{return _0x5050db;}})[_0xb814('0x2e')](function(_0x4c2be5){logger[_0xb814('0x28')](_0xb814('0x83'),_0x4c2be5);throw _0x4c2be5;});}return _0x5050db;})[_0xb814('0x25')](respondWithResult(_0x20f6ca,0xc9))['catch'](handleError(_0x20f6ca,null));};exports['getImap']=function(_0x40f43,_0x4ffb15,_0x4d9af3){return db['MailAccount']['findOne']({'where':{'id':_0x40f43[_0xb814('0x5f')]['id']}})[_0xb814('0x25')](handleEntityNotFound(_0x4ffb15,null))['then'](function(_0x559d84){if(_0x559d84){return _0x559d84[_0xb814('0x84')]();}return null;})[_0xb814('0x25')](respondWithResult(_0x4ffb15,null))[_0xb814('0x2e')](handleError(_0x4ffb15,null));};exports[_0xb814('0x85')]=function(_0x1bd9ab,_0x20e608,_0x7b9948){if(_0x1bd9ab[_0xb814('0x5e')]['id']){delete _0x1bd9ab[_0xb814('0x5e')]['id'];}return db[_0xb814('0x54')]['find']({'where':{'id':_0x1bd9ab[_0xb814('0x5f')]['id']}})['then'](handleEntityNotFound(_0x20e608,null))[_0xb814('0x25')](function(_0x8c4544){if(_0x8c4544){_0x1bd9ab[_0xb814('0x5e')][_0xb814('0x62')]=_0x8c4544['id'];return db[_0xb814('0x5a')][_0xb814('0x64')](_0x1bd9ab[_0xb814('0x5e')]);}})[_0xb814('0x25')](respondWithResult(_0x20e608,null))['catch'](handleError(_0x20e608,null));};exports['removeImap']=function(_0x58630e,_0xfe3ae4,_0x4a2e90){return db[_0xb814('0x54')][_0xb814('0x66')]({'where':{'id':_0x58630e[_0xb814('0x5f')]['id']}})[_0xb814('0x25')](handleEntityNotFound(_0xfe3ae4,null))[_0xb814('0x25')](function(_0x118bb2){if(_0x118bb2){return _0x118bb2[_0xb814('0x86')](null);}return null;})[_0xb814('0x25')](respondWithStatusCode(_0xfe3ae4,null))['catch'](handleError(_0xfe3ae4,null));};exports['getSmtp']=function(_0x41486b,_0x16c05b,_0x24fcd0){return db[_0xb814('0x54')][_0xb814('0x66')]({'where':{'id':_0x41486b[_0xb814('0x5f')]['id']}})['then'](handleEntityNotFound(_0x16c05b,null))[_0xb814('0x25')](function(_0x52899a){if(_0x52899a){return _0x52899a[_0xb814('0x87')]();}return null;})[_0xb814('0x25')](respondWithResult(_0x16c05b,null))[_0xb814('0x2e')](handleError(_0x16c05b,null));};exports[_0xb814('0x88')]=function(_0xa073ac,_0x2c2238,_0x29ccad){if(_0xa073ac['body']['id']){delete _0xa073ac[_0xb814('0x5e')]['id'];}return db[_0xb814('0x54')][_0xb814('0x5d')]({'where':{'id':_0xa073ac[_0xb814('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2c2238,null))[_0xb814('0x25')](function(_0x363c9a){if(_0x363c9a){_0xa073ac[_0xb814('0x5e')][_0xb814('0x62')]=_0x363c9a['id'];return db[_0xb814('0x3c')]['create'](_0xa073ac[_0xb814('0x5e')]);}})[_0xb814('0x25')](respondWithResult(_0x2c2238,null))[_0xb814('0x2e')](handleError(_0x2c2238,null));};exports['removeSmtp']=function(_0x406fb8,_0x52ef26,_0x39eaf8){return db['MailAccount'][_0xb814('0x66')]({'where':{'id':_0x406fb8[_0xb814('0x5f')]['id']}})[_0xb814('0x25')](handleEntityNotFound(_0x52ef26,null))[_0xb814('0x25')](function(_0x5a4bf2){if(_0x5a4bf2){return _0x5a4bf2[_0xb814('0x89')](null);}return null;})[_0xb814('0x25')](respondWithStatusCode(_0x52ef26,null))[_0xb814('0x2e')](handleError(_0x52ef26,null));};exports[_0xb814('0x8a')]=function(_0x3fa23a,_0x32c9ca,_0x45943c){return db[_0xb814('0x8b')][_0xb814('0x5d')]({'where':{'id':_0x3fa23a[_0xb814('0x5f')]['id']}})[_0xb814('0x25')](handleEntityNotFound(_0x32c9ca,null))[_0xb814('0x25')](function(_0x35d186){if(_0x35d186){return _0x35d186[_0xb814('0x8a')](_0x3fa23a[_0xb814('0x5e')]['ids'],_[_0xb814('0x8c')](_0x3fa23a[_0xb814('0x5e')],[_0xb814('0x6a'),'id'])||{});}})[_0xb814('0x25')](respondWithResult(_0x32c9ca,null))[_0xb814('0x2e')](handleError(_0x32c9ca,null));};exports[_0xb814('0x8d')]=function(_0x54475c,_0xea321c,_0x29b773){var _0x14036d={'raw':![],'where':{}};var _0x31b4f5={};var _0x488c53={'count':0x0,'rows':[]};return db['MailAccount'][_0xb814('0x66')]({'where':{'id':_0x54475c[_0xb814('0x5f')]['id']}})[_0xb814('0x25')](handleEntityNotFound(_0xea321c,null))[_0xb814('0x25')](function(_0x2c1a13){if(_0x2c1a13){_0x31b4f5[_0xb814('0x45')]=_['keys'](db[_0xb814('0x8b')][_0xb814('0x40')]);_0x31b4f5[_0xb814('0x42')]=_[_0xb814('0x41')](_0x54475c['query']);_0x31b4f5[_0xb814('0x43')]=_[_0xb814('0x44')](_0x31b4f5[_0xb814('0x45')],_0x31b4f5[_0xb814('0x42')]);_0x14036d[_0xb814('0x46')]=_['intersection'](_0x31b4f5[_0xb814('0x45')],qs[_0xb814('0x5b')](_0x54475c[_0xb814('0x42')][_0xb814('0x5b')]));_0x14036d[_0xb814('0x46')]=_0x14036d[_0xb814('0x46')][_0xb814('0x47')]?_0x14036d[_0xb814('0x46')]:_0x31b4f5[_0xb814('0x45')];if(!_0x54475c[_0xb814('0x42')][_0xb814('0x67')](_0xb814('0x48'))){_0x14036d[_0xb814('0x49')]=qs['limit'](_0x54475c['query'][_0xb814('0x49')]);_0x14036d[_0xb814('0x33')]=qs[_0xb814('0x33')](_0x54475c['query'][_0xb814('0x33')]);}_0x14036d[_0xb814('0x4a')]=qs[_0xb814('0x4b')](_0x54475c['query'][_0xb814('0x4b')]);_0x14036d[_0xb814('0x4c')]=qs[_0xb814('0x43')](_[_0xb814('0x68')](_0x54475c[_0xb814('0x42')],_0x31b4f5[_0xb814('0x43')]));_0x14036d['where'][_0xb814('0x62')]=_0x2c1a13['id'];if(_0x54475c['query'][_0xb814('0x4d')]){_0x14036d['where']=_[_0xb814('0x4e')](_0x14036d[_0xb814('0x4c')],{'$or':_[_0xb814('0x4f')](_0x14036d['attributes'],function(_0x197413){var _0x2114c2={};_0x2114c2[_0x197413]={'$like':'%'+_0x54475c[_0xb814('0x42')]['filter']+'%'};return _0x2114c2;})});}_0x14036d=_[_0xb814('0x4e')]({},_0x14036d,_0x54475c['options']);return db[_0xb814('0x8b')][_0xb814('0x55')]({'where':_0x14036d[_0xb814('0x4c')]})['then'](function(_0x1730bd){_0x488c53[_0xb814('0x55')]=_0x1730bd;if(_0x54475c[_0xb814('0x42')][_0xb814('0x56')]){_0x14036d['include']=[{'model':db[_0xb814('0x8e')],'as':_0xb814('0x8f'),'required':![]},{'model':db[_0xb814('0x90')],'as':_0xb814('0x91'),'attributes':[_0xb814('0x3a'),_0xb814('0x92'),_0xb814('0x93')],'required':![]},{'model':db[_0xb814('0x94')],'as':_0xb814('0x95'),'attributes':['id','name',_0xb814('0x96')],'where':_0x54475c[_0xb814('0x42')][_0xb814('0x97')]?{'id':_0x54475c['query'][_0xb814('0x97')]}:undefined,'required':_0x54475c['query']['tag']?!![]:![]}];}return db['MailInteraction'][_0xb814('0x57')](_0x14036d);})['then'](function(_0x4512df){_0x488c53[_0xb814('0x58')]=_0x4512df;return _0x488c53;});}})['then'](respondWithFilteredResult(_0xea321c,_0x14036d))['catch'](handleError(_0xea321c,null));};exports[_0xb814('0x98')]=function(_0x5634b5,_0x35e464,_0x50f72a){return db[_0xb814('0x54')][_0xb814('0x66')]({'where':{'id':_0x5634b5[_0xb814('0x5f')]['id']}})['then'](handleEntityNotFound(_0x35e464,null))['then'](function(_0x54ab1a){if(_0x54ab1a){return db[_0xb814('0x99')]['transaction'](function(_0x50fa7c){return db[_0xb814('0x9a')]['destroy']({'where':{'MailAccountId':_0x5634b5['params']['id']},'transaction':_0x50fa7c})['then'](function(_0xb1db37){var _0x438003=_[_0xb814('0x4f')](_0x5634b5['body'],function(_0x270656){_0x270656[_0xb814('0x62')]=_0x5634b5[_0xb814('0x5f')]['id'];return _0x270656;});return db[_0xb814('0x9a')][_0xb814('0x9b')](_0x438003,{'transaction':_0x50fa7c});});})[_0xb814('0x25')](function(){return db['MailApplication'][_0xb814('0x9c')]({'where':{'MailAccountId':_0x5634b5[_0xb814('0x5f')]['id']},'order':_0xb814('0x9d')});});}})[_0xb814('0x25')](respondWithResult(_0x35e464,null))['catch'](handleError(_0x35e464,null));};exports[_0xb814('0x9e')]=function(_0x1e5f40,_0x2e2ace,_0x3be287){var _0x3d1f3c={};var _0x2cb01d={};var _0x1f4540;var _0x3ab919;return db[_0xb814('0x54')][_0xb814('0x66')]({'where':{'id':_0x1e5f40['params']['id']}})[_0xb814('0x25')](handleEntityNotFound(_0x2e2ace,null))[_0xb814('0x25')](function(_0x5706ad){if(_0x5706ad){_0x1f4540=_0x5706ad;_0x2cb01d[_0xb814('0x45')]=_['keys'](db[_0xb814('0x9a')][_0xb814('0x40')]);_0x2cb01d['query']=_[_0xb814('0x41')](_0x1e5f40['query']);_0x2cb01d[_0xb814('0x43')]=_[_0xb814('0x44')](_0x2cb01d[_0xb814('0x45')],_0x2cb01d[_0xb814('0x42')]);_0x3d1f3c[_0xb814('0x46')]=_['intersection'](_0x2cb01d[_0xb814('0x45')],qs['fields'](_0x1e5f40[_0xb814('0x42')][_0xb814('0x5b')]));_0x3d1f3c[_0xb814('0x46')]=_0x3d1f3c[_0xb814('0x46')][_0xb814('0x47')]?_0x3d1f3c[_0xb814('0x46')]:_0x2cb01d[_0xb814('0x45')];_0x3d1f3c[_0xb814('0x4a')]=qs[_0xb814('0x4b')](_0x1e5f40['query'][_0xb814('0x4b')]);_0x3d1f3c[_0xb814('0x4c')]=qs[_0xb814('0x43')](_[_0xb814('0x68')](_0x1e5f40['query'],_0x2cb01d[_0xb814('0x43')]));if(_0x1e5f40[_0xb814('0x42')]['filter']){_0x3d1f3c[_0xb814('0x4c')]=_['merge'](_0x3d1f3c['where'],{'$or':_['map'](_0x3d1f3c[_0xb814('0x46')],function(_0x40ad6b){var _0x2c484f={};_0x2c484f[_0x40ad6b]={'$like':'%'+_0x1e5f40[_0xb814('0x42')][_0xb814('0x4d')]+'%'};return _0x2c484f;})});}_0x3d1f3c=_['merge']({},_0x3d1f3c,_0x1e5f40[_0xb814('0x53')]);return _0x1f4540[_0xb814('0x9e')](_0x3d1f3c);}})['then'](function(_0xb3dac5){if(_0xb3dac5){_0x3ab919=_0xb3dac5['length'];if(!_0x1e5f40[_0xb814('0x42')][_0xb814('0x67')](_0xb814('0x48'))){_0x3d1f3c[_0xb814('0x49')]=qs[_0xb814('0x49')](_0x1e5f40[_0xb814('0x42')]['limit']);_0x3d1f3c['offset']=qs[_0xb814('0x33')](_0x1e5f40['query'][_0xb814('0x33')]);}return _0x1f4540['getApplications'](_0x3d1f3c);}})[_0xb814('0x25')](function(_0x413347){if(_0x413347){return _0x413347?{'count':_0x3ab919,'rows':_0x413347}:null;}})[_0xb814('0x25')](respondWithResult(_0x2e2ace,null))[_0xb814('0x2e')](handleError(_0x2e2ace,null));};exports['getMessages']=function(_0x306bb1,_0x55f8d7,_0x59b7b1){var _0x37cde3={'raw':!![],'where':{}};var _0x301453={};var _0x52a385={'count':0x0,'rows':[]};return db[_0xb814('0x54')][_0xb814('0x66')]({'where':{'id':_0x306bb1[_0xb814('0x5f')]['id']}})[_0xb814('0x25')](handleEntityNotFound(_0x55f8d7,null))['then'](function(_0x1c8361){if(_0x1c8361){_0x301453[_0xb814('0x45')]=_[_0xb814('0x41')](db[_0xb814('0x9f')][_0xb814('0x40')]);_0x301453[_0xb814('0x42')]=_[_0xb814('0x41')](_0x306bb1[_0xb814('0x42')]);_0x301453[_0xb814('0x43')]=_[_0xb814('0x44')](_0x301453[_0xb814('0x45')],_0x301453[_0xb814('0x42')]);_0x37cde3[_0xb814('0x46')]=_['intersection'](_0x301453[_0xb814('0x45')],qs[_0xb814('0x5b')](_0x306bb1[_0xb814('0x42')][_0xb814('0x5b')]));_0x37cde3[_0xb814('0x46')]=_0x37cde3[_0xb814('0x46')][_0xb814('0x47')]?_0x37cde3[_0xb814('0x46')]:_0x301453['model'];if(!_0x306bb1[_0xb814('0x42')][_0xb814('0x67')](_0xb814('0x48'))){_0x37cde3[_0xb814('0x49')]=qs[_0xb814('0x49')](_0x306bb1[_0xb814('0x42')][_0xb814('0x49')]);_0x37cde3[_0xb814('0x33')]=qs['offset'](_0x306bb1[_0xb814('0x42')]['offset']);}_0x37cde3['order']=qs[_0xb814('0x4b')](_0x306bb1['query'][_0xb814('0x4b')]);_0x37cde3[_0xb814('0x4c')]=qs[_0xb814('0x43')](_['pick'](_0x306bb1[_0xb814('0x42')],_0x301453[_0xb814('0x43')]));_0x37cde3[_0xb814('0x4c')][_0xb814('0x62')]=_0x1c8361['id'];if(_0x306bb1[_0xb814('0x42')]['filter']){_0x37cde3[_0xb814('0x4c')]=_[_0xb814('0x4e')](_0x37cde3[_0xb814('0x4c')],{'$or':_['map'](_0x37cde3[_0xb814('0x46')],function(_0x26f149){var _0x3fc239={};_0x3fc239[_0x26f149]={'$like':'%'+_0x306bb1[_0xb814('0x42')][_0xb814('0x4d')]+'%'};return _0x3fc239;})});}if(_0x306bb1[_0xb814('0x42')]['$gte']){var _0x117d26=_0x306bb1[_0xb814('0x42')][_0xb814('0xa0')]['split'](',');var _0x4b0adb={};_0x4b0adb[_0x117d26[0x0]]={'$gte':moment(_0x117d26[0x1])[_0xb814('0xa1')](_0xb814('0xa2'))};_0x37cde3[_0xb814('0x4c')]=_[_0xb814('0x4e')](_0x37cde3['where'],_0x4b0adb);}_0x37cde3=_[_0xb814('0x4e')]({},_0x37cde3,_0x306bb1['options']);return db['MailMessage']['count']({'where':_0x37cde3[_0xb814('0x4c')]})[_0xb814('0x25')](function(_0xdcb11d){_0x52a385[_0xb814('0x55')]=_0xdcb11d;if(_0x306bb1[_0xb814('0x42')]['includeAll']){_0x37cde3[_0xb814('0x5c')]=[{'all':!![]}];}return db[_0xb814('0x9f')][_0xb814('0x57')](_0x37cde3);})[_0xb814('0x25')](function(_0x25fc23){_0x52a385[_0xb814('0x58')]=_0x25fc23;return _0x52a385;});}})[_0xb814('0x25')](respondWithFilteredResult(_0x55f8d7,_0x37cde3))['catch'](handleError(_0x55f8d7,null));};exports['send']=function(_0x5f5ad5,_0x44a0a9,_0x586ff1){var _0x1da04c,_0x1f60b3={},_0x2a1d69;if(_0x5f5ad5['body']['to']){_0x2a1d69=_0x5f5ad5[_0xb814('0x5e')]['to'][_0xb814('0xa3')](',')[0x0];}return db['MailAccount'][_0xb814('0x5d')]({'where':{'id':_0x5f5ad5[_0xb814('0x5f')]['id']},'include':[{'model':db[_0xb814('0xa4')],'as':_0xb814('0xa5'),'include':[{'model':db[_0xb814('0x8e')],'as':_0xb814('0xa6'),'where':{'email':_0x2a1d69},'limit':0x1,'order':[[_0xb814('0xa7'),_0xb814('0xa8')]]}]},{'model':db[_0xb814('0x3c')],'as':_0xb814('0x3d'),'raw':!![]}]})['then'](handleEntityNotFound(_0x44a0a9,null))[_0xb814('0x25')](function(_0x59df7a){if(_0x59df7a){_0x1da04c=_0x59df7a;if(_0x59df7a[_0xb814('0x3d')]){if(_[_0xb814('0x71')](_0x5f5ad5[_0xb814('0x5e')][_0xb814('0xa9')])){_0x5f5ad5[_0xb814('0x5e')]['from']=util[_0xb814('0xa1')](_0xb814('0xaa'),_0x59df7a[_0xb814('0x3a')],_0x59df7a[_0xb814('0x6f')]||_0x59df7a[_0xb814('0x3d')][_0xb814('0x75')]);}if(_0x5f5ad5[_0xb814('0x5e')][_0xb814('0xab')]&&_0x5f5ad5[_0xb814('0x5e')][_0xb814('0xab')][_0xb814('0x47')]){for(var _0x30bd41=0x0;_0x30bd41<_0x5f5ad5[_0xb814('0x5e')][_0xb814('0xab')][_0xb814('0x47')];_0x30bd41+=0x1){_0x5f5ad5[_0xb814('0x5e')][_0xb814('0xab')][_0x30bd41]={'filename':_0x5f5ad5[_0xb814('0x5e')][_0xb814('0xab')][_0x30bd41][_0xb814('0x3a')],'path':path['join'](config[_0xb814('0xac')],_0xb814('0xad'),_0x5f5ad5[_0xb814('0x5e')][_0xb814('0xab')][_0x30bd41][_0xb814('0xae')])};}}var _0xbff80c={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x59df7a[_0xb814('0x3d')][_0xb814('0x7a')])){if(_0x59df7a[_0xb814('0x3d')][_0xb814('0x77')]){_0xbff80c[_0xb814('0xaf')]={'user':_0x59df7a[_0xb814('0x3d')][_0xb814('0x75')],'pass':_0x59df7a[_0xb814('0x3d')][_0xb814('0x76')]};}_0xbff80c[_0xb814('0x78')]=_0x59df7a[_0xb814('0x3d')][_0xb814('0x78')];_0xbff80c[_0xb814('0x79')]=_0x59df7a[_0xb814('0x3d')]['port'];_0xbff80c[_0xb814('0xb0')]=_0x59df7a[_0xb814('0x3d')][_0xb814('0xb0')];}else{_0xbff80c[_0xb814('0x7a')]=_0x59df7a[_0xb814('0x3d')][_0xb814('0x7a')];_0xbff80c[_0xb814('0xaf')]={'user':_0x59df7a[_0xb814('0x3d')]['user'],'pass':_0x59df7a['Smtp'][_0xb814('0x76')]};}return respondWithRpcPromise(_0xb814('0xb1'),_0xb814('0xb2'),{'account':_0xbff80c,'message':_0x5f5ad5[_0xb814('0x5e')]});}else{throw new Error(_0xb814('0xb3'));}}})['then'](function(_0x231886){if(_0x231886){_0x1f60b3=_0x231886;if(_0x1da04c[_0xb814('0xa5')]){if(_0x1da04c[_0xb814('0xa5')][_0xb814('0xa6')]['length']){return _0x1da04c['List'][_0xb814('0xa6')][0x0];}else{return db[_0xb814('0x8e')][_0xb814('0x64')](_['defaults'](_0x5f5ad5[_0xb814('0x5e')],{'firstName':_0x5f5ad5[_0xb814('0x5e')]['to'],'email':_0x5f5ad5[_0xb814('0x5e')]['to'],'phone':_0x5f5ad5[_0xb814('0x5e')]['to'],'ListId':_0x1da04c['ListId']}));}}else{throw new Error('List\x20not\x20found');}}})[_0xb814('0x25')](function(_0x400e18){if(_0x400e18){var _0x34950f={'UserId':_0x5f5ad5['user']['id'],'ContactId':_0x400e18['id'],'MailAccountId':_0x1da04c['id'],'inReplyTo':_0x1f60b3['messageId'],'to':_0x5f5ad5['body']['from'],'cc':_0x5f5ad5[_0xb814('0x5e')]['cc'],'subject':_0x5f5ad5[_0xb814('0x5e')]['subject'],'attach':_0x5f5ad5[_0xb814('0x5e')][_0xb814('0xb4')],'firstMsgDirection':_0xb814('0xb5'),'lastMsgAt':moment()[_0xb814('0xa1')](_0xb814('0xa2')),'lastMsgDirection':_0xb814('0xb5'),'lastMsgBody':_0x5f5ad5[_0xb814('0x5e')]['body'],'Messages':[_[_0xb814('0x4e')](_0x5f5ad5[_0xb814('0x5e')],{'messageId':_0x1f60b3[_0xb814('0xb6')],'sentAt':moment()[_0xb814('0xa1')](_0xb814('0xa2')),'read':!![],'MailAccountId':_0x1da04c['id'],'UserId':_0x5f5ad5[_0xb814('0x75')]['id'],'ContactId':_0x400e18['id']})]};if(_0x5f5ad5[_0xb814('0x5e')][_0xb814('0xb7')]){_0x34950f=_[_0xb814('0x4e')](_0x34950f,_0x5f5ad5[_0xb814('0x5e')]['Interaction']);}return db[_0xb814('0x8b')]['create'](_0x34950f,{'include':[{'model':db[_0xb814('0x9f')],'as':'Messages'}]});}})['then'](respondWithResult(_0x44a0a9,null))[_0xb814('0x2e')](handleError(_0x44a0a9,null));};exports['verifySmtp']=function(_0x5bb365,_0x189200,_0x43d49b){return db[_0xb814('0x54')]['find']({'where':{'id':_0x5bb365['params']['id']},'include':[{'model':db[_0xb814('0x3c')],'as':_0xb814('0x3d'),'raw':!![]}]})['then'](handleEntityNotFound(_0x189200,null))[_0xb814('0x25')](function(_0x29bfcf){if(_0x29bfcf&&_0x29bfcf[_0xb814('0x3d')]){var _0x3b2707={'id':_0x29bfcf['id'],'tls':{'rejectUnauthorized':![]}};if(_0x29bfcf[_0xb814('0x3d')]['service']){_0x3b2707[_0xb814('0x7a')]=_0x29bfcf['Smtp'][_0xb814('0x7a')];}else{_0x3b2707[_0xb814('0x78')]=_0x29bfcf[_0xb814('0x3d')][_0xb814('0x78')];_0x3b2707[_0xb814('0x79')]=_0x29bfcf[_0xb814('0x3d')][_0xb814('0x79')];_0x3b2707[_0xb814('0xb0')]=_0x29bfcf[_0xb814('0x3d')][_0xb814('0xb0')];}if(_0x29bfcf[_0xb814('0x3d')]['authentication']){_0x3b2707[_0xb814('0xaf')]={'user':_0x29bfcf[_0xb814('0x3d')][_0xb814('0x75')],'pass':_0x29bfcf[_0xb814('0x3d')][_0xb814('0x76')]};}return respondWithRpcPromise(_0xb814('0xb8'),'verifySmtp',{'account':_0x3b2707});}})[_0xb814('0x25')](respondWithResult(_0x189200,null))['catch'](handleError(_0x189200,null));};exports[_0xb814('0x37')]=function(_0x20d49b,_0x4368f0){return db[_0xb814('0x54')][_0xb814('0x5d')]({'where':{'id':_0x20d49b[_0xb814('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4368f0,null))['then'](function(_0x391526){if(_0x391526&&_0x391526[_0xb814('0x7a')]){throw new db['Sequelize'][(_0xb814('0xb9'))](_0xb814('0xba'));}return _0x391526;})['then'](removeEntity(_0x4368f0,null))[_0xb814('0x2e')](handleError(_0x4368f0,null));};exports[_0xb814('0xbb')]=function(_0x4fc561,_0x3766d6,_0x289e49){return db[_0xb814('0x54')][_0xb814('0x5d')]({'where':{'id':_0x4fc561['params']['id']}})[_0xb814('0x25')](handleEntityNotFound(_0x3766d6,null))['then'](function(_0x54f37a){if(_0x54f37a){return _0x54f37a[_0xb814('0xbb')](_0x4fc561[_0xb814('0x5e')][_0xb814('0x6a')],_['omit'](_0x4fc561[_0xb814('0x5e')],[_0xb814('0x6a'),'id'])||{})[_0xb814('0xbc')](function(_0x1aca0b){for(var _0x366606=0x0;_0x366606<_0x4fc561['body'][_0xb814('0x6a')]['length'];_0x366606+=0x1){socket[_0xb814('0xbd')](_0xb814('0xbe'),{'UserId':_0x4fc561['body'][_0xb814('0x6a')][_0x366606],'MailAccountId':_0x4fc561[_0xb814('0x5f')]['id']});}return _0x1aca0b;});}})['then'](respondWithResult(_0x3766d6,null))[_0xb814('0x2e')](handleError(_0x3766d6,null));};exports['removeAgents']=function(_0x3f2f27,_0x5de4ed,_0x588941){return db[_0xb814('0x54')][_0xb814('0x5d')]({'where':{'id':_0x3f2f27[_0xb814('0x5f')]['id']}})[_0xb814('0x25')](handleEntityNotFound(_0x5de4ed,null))[_0xb814('0x25')](function(_0x3f78b3){if(_0x3f78b3){return _0x3f78b3['removeAgents'](_0x3f2f27[_0xb814('0x42')][_0xb814('0x6a')])[_0xb814('0x25')](function(){if(_['isArray'](_0x3f2f27[_0xb814('0x42')][_0xb814('0x6a')])){for(var _0x591839=0x0;_0x591839<_0x3f2f27['query'][_0xb814('0x6a')][_0xb814('0x47')];_0x591839+=0x1){socket[_0xb814('0xbd')](_0xb814('0xbf'),{'UserId':Number(_0x3f2f27[_0xb814('0x42')]['ids'][_0x591839]),'MailAccountId':Number(_0x3f2f27['params']['id'])});}}else{socket[_0xb814('0xbd')]('userMailAccount:remove',{'UserId':Number(_0x3f2f27['query'][_0xb814('0x6a')]),'MailAccountId':Number(_0x3f2f27[_0xb814('0x5f')]['id'])});}});}})[_0xb814('0x25')](respondWithStatusCode(_0x5de4ed,null))[_0xb814('0x2e')](handleError(_0x5de4ed,null));};exports[_0xb814('0xc0')]=function(_0x53d1fa,_0x2fad3a,_0x208c9e){var _0x17f56d={};var _0xf543d2={};var _0x65a4ff;var _0x1153a3;return db[_0xb814('0x54')][_0xb814('0x66')]({'where':{'id':_0x53d1fa[_0xb814('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2fad3a,null))[_0xb814('0x25')](function(_0x25bee1){if(_0x25bee1){_0x65a4ff=_0x25bee1;_0xf543d2[_0xb814('0x45')]=_['keys'](db['User'][_0xb814('0x40')]);_0xf543d2[_0xb814('0x42')]=_[_0xb814('0x41')](_0x53d1fa['query']);_0xf543d2[_0xb814('0x43')]=_[_0xb814('0x44')](_0xf543d2[_0xb814('0x45')],_0xf543d2[_0xb814('0x42')]);_0x17f56d[_0xb814('0x46')]=_[_0xb814('0x44')](_0xf543d2[_0xb814('0x45')],qs[_0xb814('0x5b')](_0x53d1fa['query'][_0xb814('0x5b')]));_0x17f56d[_0xb814('0x46')]=_0x17f56d[_0xb814('0x46')][_0xb814('0x47')]?_0x17f56d[_0xb814('0x46')]:_0xf543d2[_0xb814('0x45')];_0x17f56d[_0xb814('0x4a')]=qs['sort'](_0x53d1fa[_0xb814('0x42')]['sort']);_0x17f56d[_0xb814('0x4c')]=qs[_0xb814('0x43')](_[_0xb814('0x68')](_0x53d1fa[_0xb814('0x42')],_0xf543d2[_0xb814('0x43')]));if(_0x53d1fa['query']['filter']){_0x17f56d['where']=_[_0xb814('0x4e')](_0x17f56d[_0xb814('0x4c')],{'$or':_[_0xb814('0x4f')](_0x17f56d['attributes'],function(_0x292540){var _0xa8d528={};_0xa8d528[_0x292540]={'$like':'%'+_0x53d1fa[_0xb814('0x42')][_0xb814('0x4d')]+'%'};return _0xa8d528;})});}_0x17f56d=_['merge']({},_0x17f56d,_0x53d1fa[_0xb814('0x53')]);return _0x65a4ff[_0xb814('0xc0')](_0x17f56d);}})[_0xb814('0x25')](function(_0x5e48cd){if(_0x5e48cd){_0x1153a3=_0x5e48cd[_0xb814('0x47')];if(!_0x53d1fa[_0xb814('0x42')]['hasOwnProperty'](_0xb814('0x48'))){_0x17f56d['limit']=qs[_0xb814('0x49')](_0x53d1fa[_0xb814('0x42')][_0xb814('0x49')]);_0x17f56d[_0xb814('0x33')]=qs[_0xb814('0x33')](_0x53d1fa[_0xb814('0x42')][_0xb814('0x33')]);}return _0x65a4ff['getAgents'](_0x17f56d);}})[_0xb814('0x25')](function(_0x2af595){if(_0x2af595){return _0x2af595?{'count':_0x1153a3,'rows':_0x2af595}:null;}})[_0xb814('0x25')](respondWithResult(_0x2fad3a,null))['catch'](handleError(_0x2fad3a,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index e3061e6..dc40217 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 _0x2aac=['hasOwnProperty','exports','events','MailAccount','save','update','remove','emit'];(function(_0x2792fc,_0x4b0917){var _0x2576c4=function(_0x12caf9){while(--_0x12caf9){_0x2792fc['push'](_0x2792fc['shift']());}};_0x2576c4(++_0x4b0917);}(_0x2aac,0x9a));var _0xc2aa=function(_0x5dbfa5,_0x783535){_0x5dbfa5=_0x5dbfa5-0x0;var _0x1ccf71=_0x2aac[_0x5dbfa5];return _0x1ccf71;};'use strict';var EventEmitter=require(_0xc2aa('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xc2aa('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc2aa('0x2'),'afterUpdate':_0xc2aa('0x3'),'afterDestroy':_0xc2aa('0x4')};function emitEvent(_0x12a4dd){return function(_0x440399,_0x558f41,_0x596e81){MailAccountEvents[_0xc2aa('0x5')](_0x12a4dd+':'+_0x440399['id'],_0x440399);MailAccountEvents[_0xc2aa('0x5')](_0x12a4dd,_0x440399);_0x596e81(null);};}for(var e in events){if(events[_0xc2aa('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xc2aa('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xe520=['hook','exports','events','MailAccount','setMaxListeners','save','remove','hasOwnProperty'];(function(_0x10b4d6,_0xbffa3){var _0x51c115=function(_0x58d856){while(--_0x58d856){_0x10b4d6['push'](_0x10b4d6['shift']());}};_0x51c115(++_0xbffa3);}(_0xe520,0x1b2));var _0x0e52=function(_0x31e643,_0x1d6ef3){_0x31e643=_0x31e643-0x0;var _0x22bbcf=_0xe520[_0x31e643];return _0x22bbcf;};'use strict';var EventEmitter=require(_0x0e52('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x0e52('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x0e52('0x2')](0x0);var events={'afterCreate':_0x0e52('0x3'),'afterUpdate':'update','afterDestroy':_0x0e52('0x4')};function emitEvent(_0x5d7c91){return function(_0x5e6fa1,_0x307870,_0x48d9cc){MailAccountEvents['emit'](_0x5d7c91+':'+_0x5e6fa1['id'],_0x5e6fa1);MailAccountEvents['emit'](_0x5d7c91,_0x5e6fa1);_0x48d9cc(null);};}for(var e in events){if(events[_0x0e52('0x5')](e)){var event=events[e];MailAccount[_0x0e52('0x6')](e,emitEvent(event));}}module[_0x0e52('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 7b9c223..6eeff06 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 _0x261b=['./mailAccount.attributes','define','MailAccount','lodash','util','request-promise','rimraf'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x261b,0x15a));var _0xb261=function(_0x417435,_0x5cbc50){_0x417435=_0x417435-0x0;var _0x5bd753=_0x261b[_0x417435];return _0x5bd753;};'use strict';var _=require(_0xb261('0x0'));var util=require(_0xb261('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb261('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb261('0x3'));var config=require('../../config/environment');var attributes=require(_0xb261('0x4'));module['exports']=function(_0x10f7ba,_0xaf0725){return _0x10f7ba[_0xb261('0x5')](_0xb261('0x6'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49ac=['request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','define','MailAccount','mail_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5c085f,_0x39ac9a){var _0x5e857c=function(_0x53db8b){while(--_0x53db8b){_0x5c085f['push'](_0x5c085f['shift']());}};_0x5e857c(++_0x39ac9a);}(_0x49ac,0x19e));var _0xc49a=function(_0x40df5f,_0x8fd59f){_0x40df5f=_0x40df5f-0x0;var _0x1573f1=_0x49ac[_0x40df5f];return _0x1573f1;};'use strict';var _=require(_0xc49a('0x0'));var util=require(_0xc49a('0x1'));var logger=require(_0xc49a('0x2'))(_0xc49a('0x3'));var moment=require(_0xc49a('0x4'));var BPromise=require(_0xc49a('0x5'));var rp=require(_0xc49a('0x6'));var fs=require('fs');var path=require(_0xc49a('0x7'));var rimraf=require(_0xc49a('0x8'));var config=require(_0xc49a('0x9'));var attributes=require(_0xc49a('0xa'));module['exports']=function(_0x40017e,_0x5acdcf){return _0x40017e[_0xc49a('0xb')](_0xc49a('0xc'),attributes,{'tableName':_0xc49a('0xd'),'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 633c5d3..71dd6ae 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 _0x81d5=['List','MailApplication','MailServerOut','Smtp','get','account','Applications','applications','list','priority','asc','autoclose','length','Contacts','CmContact','List\x20not\x20found','messageId','subject','attach','format','MailMessage','Messages','inReplyTo','MailInteraction','create','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','contact','attachments','originTo','bcc','Attachment','Attachments','UserId','name','unshift','agent','*,*,*,*','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','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','find','body','mail','difference','keys','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','includes','mapKey','CmList'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x81d5,0x1ab));var _0x581d=function(_0x4a2028,_0x1b4521){_0x4a2028=_0x4a2028-0x0;var _0x4b3645=_0x81d5[_0x4a2028];return _0x4b3645;};'use strict';var _=require(_0x581d('0x0'));var util=require(_0x581d('0x1'));var moment=require('moment');var BPromise=require(_0x581d('0x2'));var rs=require(_0x581d('0x3'));var fs=require('fs');var Redis=require(_0x581d('0x4'));var db=require(_0x581d('0x5'))['db'];var utils=require(_0x581d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x581d('0x7'));var jayson=require(_0x581d('0x8'));var client=jayson[_0x581d('0x9')]['http']({'port':0x232c});config[_0x581d('0xa')]=_[_0x581d('0xb')](config[_0x581d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x581d('0xc'))(new Redis(config['redis']));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0xdeeb73,_0x3435a9,_0x2b73b1){return new BPromise(function(_0x1cd001,_0x21fb9e){return client['request'](_0xdeeb73,_0x2b73b1)[_0x581d('0xd')](function(_0xc8e15a){logger[_0x581d('0xe')](_0x581d('0xf'),_0x3435a9,_0x581d('0x10'));logger[_0x581d('0x11')](_0x581d('0x12'),_0x3435a9,_0x581d('0x10'),JSON[_0x581d('0x13')](_0xc8e15a));if(_0xc8e15a[_0x581d('0x14')]){if(_0xc8e15a['error'][_0x581d('0x15')]===0x1f4){logger[_0x581d('0x14')]('MailAccount,\x20%s,\x20%s',_0x3435a9,_0xc8e15a['error']['message']);return _0x21fb9e(_0xc8e15a['error'][_0x581d('0x16')]);}logger['error'](_0x581d('0xf'),_0x3435a9,_0xc8e15a[_0x581d('0x14')]['message']);return _0x1cd001(_0xc8e15a[_0x581d('0x14')]['message']);}else{logger[_0x581d('0xe')](_0x581d('0xf'),_0x3435a9,_0x581d('0x10'));_0x1cd001(_0xc8e15a[_0x581d('0x17')][_0x581d('0x16')]);}})[_0x581d('0x18')](function(_0x21888c){logger['error'](_0x581d('0xf'),_0x3435a9,_0x21888c);_0x21fb9e(_0x21888c);});});}exports[_0x581d('0x19')]=function(_0x223b00){var _0x2cbc60=this;return new Promise(function(_0x352700,_0x2a2aba){return db[_0x581d('0x1a')][_0x581d('0x1b')]({'raw':_0x223b00[_0x581d('0x1c')]?_0x223b00[_0x581d('0x1c')][_0x581d('0x1d')]===undefined?!![]:![]:!![],'where':_0x223b00[_0x581d('0x1c')]?_0x223b00['options'][_0x581d('0x1e')]||null:null,'attributes':_0x223b00[_0x581d('0x1c')]?_0x223b00[_0x581d('0x1c')][_0x581d('0x1f')]||null:null,'limit':_0x223b00[_0x581d('0x1c')]?_0x223b00['options'][_0x581d('0x20')]||null:null,'include':_0x223b00[_0x581d('0x1c')]?_0x223b00['options'][_0x581d('0x21')]?_[_0x581d('0x22')](_0x223b00[_0x581d('0x1c')]['include'],function(_0x190545){return{'model':db[_0x190545[_0x581d('0x23')]],'as':_0x190545['as'],'attributes':_0x190545[_0x581d('0x1f')],'include':_0x190545[_0x581d('0x21')]?_[_0x581d('0x22')](_0x190545[_0x581d('0x21')],function(_0x4b9b62){return{'model':db[_0x4b9b62[_0x581d('0x23')]],'as':_0x4b9b62['as'],'attributes':_0x4b9b62[_0x581d('0x1f')],'include':_0x4b9b62[_0x581d('0x21')]?_['map'](_0x4b9b62['include'],function(_0x504f71){return{'model':db[_0x504f71['model']],'as':_0x504f71['as'],'attributes':_0x504f71[_0x581d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x581d('0xd')](function(_0x337361){logger[_0x581d('0xe')](_0x581d('0x19'),_0x223b00);logger[_0x581d('0x11')](_0x581d('0x19'),_0x223b00,JSON[_0x581d('0x13')](_0x337361));_0x352700(_0x337361);})[_0x581d('0x18')](function(_0xda8a98){logger[_0x581d('0x14')]('GetMailAccount',_0xda8a98[_0x581d('0x16')],_0x223b00);_0x2a2aba(_0x2cbc60['error'](0x1f4,_0xda8a98[_0x581d('0x16')]));});});};exports[_0x581d('0x24')]=function(_0x40931d){var _0x565954=this;return new Promise(function(_0x42767c,_0x1d045e){return db['MailAccount'][_0x581d('0x25')]({'raw':_0x40931d[_0x581d('0x1c')]?_0x40931d['options']['raw']===undefined?!![]:![]:!![],'where':_0x40931d['options']?_0x40931d[_0x581d('0x1c')][_0x581d('0x1e')]||null:null,'attributes':_0x40931d[_0x581d('0x1c')]?_0x40931d[_0x581d('0x1c')][_0x581d('0x1f')]||null:null,'include':_0x40931d[_0x581d('0x1c')]?_0x40931d[_0x581d('0x1c')]['include']?_[_0x581d('0x22')](_0x40931d[_0x581d('0x1c')]['include'],function(_0x389e97){return{'model':db[_0x389e97[_0x581d('0x23')]],'as':_0x389e97['as'],'attributes':_0x389e97[_0x581d('0x1f')],'include':_0x389e97[_0x581d('0x21')]?_[_0x581d('0x22')](_0x389e97['include'],function(_0x1cc7b4){return{'model':db[_0x1cc7b4['model']],'as':_0x1cc7b4['as'],'attributes':_0x1cc7b4[_0x581d('0x1f')],'include':_0x1cc7b4[_0x581d('0x21')]?_['map'](_0x1cc7b4['include'],function(_0x5eb9eb){return{'model':db[_0x5eb9eb['model']],'as':_0x5eb9eb['as'],'attributes':_0x5eb9eb[_0x581d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b6b7b){logger['info'](_0x581d('0x24'),_0x40931d);logger[_0x581d('0x11')](_0x581d('0x24'),_0x40931d,JSON[_0x581d('0x13')](_0x2b6b7b));_0x42767c(_0x2b6b7b);})[_0x581d('0x18')](function(_0x2e466e){logger[_0x581d('0x14')](_0x581d('0x24'),_0x2e466e[_0x581d('0x16')],_0x40931d);_0x1d045e(_0x565954[_0x581d('0x14')](0x1f4,_0x2e466e['message']));});});};exports['NotifyMailAccount']=function(_0x47668c){var _0x250f50=this;return new Promise(function(_0x109d34,_0x4ca064){var _0x17e2b2={'body':_0x47668c[_0x581d('0x26')],'channel':_0x581d('0x27')};var _0x5a7b58=_[_0x581d('0x28')](_[_0x581d('0x29')](db['CmContact'][_0x581d('0x2a')]),[_0x581d('0x2b'),_0x581d('0x2c'),_0x581d('0x2d'),_0x581d('0x2e')]);var _0xbc57c3=![];if(_0x47668c[_0x581d('0x26')]['id']){delete _0x47668c['body']['id'];}if(_[_0x581d('0x2f')](_0x47668c[_0x581d('0x26')][_0x581d('0x30')])){return _0x4ca064(_0x250f50['error'](0x1f4,_0x581d('0x31')));}if(_[_0x581d('0x2f')](_0x47668c['body']['body'])||_0x47668c[_0x581d('0x26')][_0x581d('0x26')]===''){return _0x4ca064(_0x250f50[_0x581d('0x14')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x581d('0x2f')](_0x47668c[_0x581d('0x26')]['mapKey'])){return _0x4ca064(_0x250f50[_0x581d('0x14')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5a7b58));}if(!_[_0x581d('0x32')](_0x5a7b58,_0x47668c['body'][_0x581d('0x33')])){return _0x4ca064(_0x250f50['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5a7b58));}var _0x364359={};_0x364359[_0x47668c['body']['mapKey']]=_0x47668c['body'][_0x581d('0x30')];return db[_0x581d('0x1a')][_0x581d('0x25')]({'where':{'id':_0x47668c['account']['id']},'include':[{'model':db[_0x581d('0x34')],'as':_0x581d('0x35'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x364359,'limit':0x1,'order':[[_0x581d('0x2c'),'DESC']]}]},{'model':db[_0x581d('0x36')],'as':'Applications'},{'model':db[_0x581d('0x37')],'as':_0x581d('0x38')}]})['then'](function(_0x4460e8){if(_0x4460e8&&_0x4460e8[_0x581d('0x35')]){var _0x2fe25c=_0x4460e8[_0x581d('0x39')]({'plain':!![]});_0x17e2b2[_0x581d('0x3a')]=_['omit'](_0x2fe25c,[_0x581d('0x3b'),_0x581d('0x35')]);_0x17e2b2[_0x581d('0x3c')]=_0x2fe25c[_0x581d('0x3b')];_0x17e2b2[_0x581d('0x3d')]=_0x2fe25c[_0x581d('0x35')];_0x17e2b2[_0x581d('0x3c')]=_['orderBy'](_0x17e2b2[_0x581d('0x3c')],[_0x581d('0x3e')],[_0x581d('0x3f')]);if(_0x17e2b2[_0x581d('0x3a')]&&_0x17e2b2[_0x581d('0x3a')][_0x581d('0x40')]){_0x17e2b2[_0x581d('0x3c')]['push']({'id':0x0,'priority':_0x17e2b2[_0x581d('0x3c')][_0x581d('0x41')]+0x1,'app':'close','appdata':_0x581d('0x40'),'interval':'*,*,*,*'});}if(_0x17e2b2[_0x581d('0x3a')][_0x581d('0x3b')]){delete _0x17e2b2[_0x581d('0x3a')][_0x581d('0x3b')];}if(_0x17e2b2['account']['List']){delete _0x17e2b2[_0x581d('0x3a')][_0x581d('0x35')];}if(_0x2fe25c['List']['Contacts'][_0x581d('0x41')]){return _0x2fe25c[_0x581d('0x35')][_0x581d('0x42')][0x0];}var _0x43bd60=_['defaults'](_0x47668c[_0x581d('0x26')],{'firstName':_0x47668c[_0x581d('0x26')][_0x581d('0x30')],'ListId':_0x2fe25c[_0x581d('0x2e')]});_0x43bd60[_0x47668c[_0x581d('0x26')][_0x581d('0x33')]]=_0x47668c[_0x581d('0x26')][_0x581d('0x30')];return db[_0x581d('0x43')]['create'](_0x43bd60);}else{throw new Error(_0x581d('0x44'));}})[_0x581d('0xd')](function(_0x2115b5){_0x17e2b2['contact']=_0x2115b5;if(_0x2115b5){if(!_0x47668c[_0x581d('0x26')]['message'][_0x581d('0x45')]){_0x47668c[_0x581d('0x26')][_0x581d('0x16')][_0x581d('0x45')]=rs['generate']()+'\x20'+_0x47668c['body'][_0x581d('0x16')][_0x581d('0x30')];}var _0x3b0290={'ContactId':_0x2115b5['id'],'MailAccountId':_0x47668c[_0x581d('0x3a')]['id'],'inReplyTo':_0x47668c[_0x581d('0x26')]['message']['messageId'],'to':_0x47668c[_0x581d('0x26')][_0x581d('0x16')][_0x581d('0x30')],'cc':_0x47668c['body'][_0x581d('0x16')]['cc'],'subject':_0x47668c[_0x581d('0x26')][_0x581d('0x16')][_0x581d('0x46')],'attach':_0x47668c[_0x581d('0x26')][_0x581d('0x16')][_0x581d('0x47')],'lastMsgAt':moment()[_0x581d('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x47668c[_0x581d('0x26')][_0x581d('0x26')]};return db['MailInteraction'][_0x581d('0x25')]({'where':{'closed':![],'MailAccountId':_0x47668c[_0x581d('0x3a')]['id']},'include':[{'model':db[_0x581d('0x49')],'as':_0x581d('0x4a'),'attributes':[_0x581d('0x45')],'where':{'messageId':_0x47668c[_0x581d('0x26')][_0x581d('0x16')][_0x581d('0x4b')]}}]})[_0x581d('0xd')](function(_0x21d1c4){if(_0x21d1c4){return[_0x21d1c4,![]];}return db[_0x581d('0x4c')][_0x581d('0x4d')](_0x3b0290)['then'](function(_0x15725e){return[_0x15725e,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x581d('0x4e')](function(_0x4ab433,_0x2ba920){if(_0x4ab433){_0xbc57c3=_0x2ba920;if(!_0x2ba920){return _0x4ab433[_0x581d('0x4f')]({'inReplyTo':_0x47668c[_0x581d('0x26')][_0x581d('0x16')][_0x581d('0x45')],'to':_0x47668c['body'][_0x581d('0x16')]['from'],'cc':_0x47668c[_0x581d('0x26')]['message']['cc'],'subject':_0x47668c[_0x581d('0x26')][_0x581d('0x16')][_0x581d('0x46')],'attach':_0x4ab433[_0x581d('0x47')]?_0x4ab433[_0x581d('0x47')]:_0x47668c[_0x581d('0x26')]['message']['attach'],'substatus':null,'substatusAt':moment()[_0x581d('0x48')](_0x581d('0x50')),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x47668c[_0x581d('0x26')][_0x581d('0x26')]});}else{return _0x4ab433;}}})['then'](function(_0x2071b7){_0x17e2b2[_0x581d('0x51')]=_0x2071b7[_0x581d('0x39')]({'plain':!![]});_0x17e2b2['interaction'][_0x581d('0x52')]=_0xbc57c3;return db['MailMessage']['create']({'body':_0x47668c[_0x581d('0x26')][_0x581d('0x26')],'MailAccountId':_0x47668c[_0x581d('0x3a')]['id'],'MailInteractionId':_0x2071b7['id'],'direction':'in','ContactId':_0x17e2b2[_0x581d('0x53')]['id'],'messageId':_0x47668c[_0x581d('0x26')]['message'][_0x581d('0x45')],'from':_0x47668c[_0x581d('0x26')][_0x581d('0x16')][_0x581d('0x30')],'to':_0x47668c[_0x581d('0x26')][_0x581d('0x16')]['to'],'cc':_0x47668c[_0x581d('0x26')][_0x581d('0x16')]['cc'],'subject':_0x47668c['body'][_0x581d('0x16')][_0x581d('0x46')],'attach':_0x47668c[_0x581d('0x26')][_0x581d('0x16')][_0x581d('0x47')],'Attachments':_0x47668c[_0x581d('0x26')][_0x581d('0x16')][_0x581d('0x54')],'originTo':_0x47668c[_0x581d('0x26')]['message'][_0x581d('0x55')],'originCc':_0x47668c[_0x581d('0x26')][_0x581d('0x16')]['originCc'],'bcc':_0x47668c[_0x581d('0x26')][_0x581d('0x16')][_0x581d('0x56')]},{'include':[{'model':db[_0x581d('0x57')],'as':_0x581d('0x58')}]});})[_0x581d('0xd')](function(_0x1579e0){_0x17e2b2[_0x581d('0x16')]=_0x1579e0;if(_0x17e2b2[_0x581d('0x51')][_0x581d('0x59')]){return db['User'][_0x581d('0x25')]({'attributes':['id',_0x581d('0x5a')],'where':{'id':_0x17e2b2[_0x581d('0x51')][_0x581d('0x59')]}})[_0x581d('0xd')](function(_0x17f7fc){if(_0x17f7fc){_0x17e2b2[_0x581d('0x3c')][_0x581d('0x5b')]({'id':0x0,'priority':0x0,'app':_0x581d('0x5c'),'appdata':_0x17f7fc[_0x581d('0x5a')]+','+(_0x17e2b2['account']['waitForTheAssignedAgent']||0xa),'interval':_0x581d('0x5d')});}return respondWithRpcPromise(_0x581d('0x5e'),_0x581d('0x5f'),_0x17e2b2);});}return respondWithRpcPromise(_0x581d('0x5e'),_0x581d('0x5f'),_0x17e2b2);})[_0x581d('0xd')](function(_0xb7c37c){_0x109d34(_0xb7c37c);})['catch'](function(_0x1573b3){_0x4ca064(_0x250f50['error'](0x1f4,_0x1573b3[_0x581d('0x16')]));});});}; \ No newline at end of file +var _0xd240=['Smtp','get','omit','list','applications','orderBy','priority','asc','autoclose','push','length','close','List\x20not\x20found','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','Contact\x20not\x20found','spread','format','interaction','created','MailMessage','attachments','originTo','Attachment','UserId','User','unshift','agent','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','GetMailAccount','debug','ShowMailAccount','find','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut'];(function(_0x318256,_0xa773f3){var _0xb1e352=function(_0x4bb14e){while(--_0x4bb14e){_0x318256['push'](_0x318256['shift']());}};_0xb1e352(++_0xa773f3);}(_0xd240,0x1c7));var _0x0d24=function(_0x2062ea,_0x574661){_0x2062ea=_0x2062ea-0x0;var _0x4b4d98=_0xd240[_0x2062ea];return _0x4b4d98;};'use strict';var _=require('lodash');var util=require(_0x0d24('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0d24('0x1'));var fs=require('fs');var Redis=require(_0x0d24('0x2'));var db=require(_0x0d24('0x3'))['db'];var utils=require(_0x0d24('0x4'));var logger=require(_0x0d24('0x5'))(_0x0d24('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d24('0x7')][_0x0d24('0x8')]({'port':0x232c});config[_0x0d24('0x9')]=_[_0x0d24('0xa')](config['redis'],{'host':_0x0d24('0xb'),'port':0x18eb});var socket=require(_0x0d24('0xc'))(new Redis(config[_0x0d24('0x9')]));require(_0x0d24('0xd'))[_0x0d24('0xe')](socket);function respondWithRpcPromise(_0x29742e,_0x23f9ed,_0x4b55f0){return new BPromise(function(_0x3aedef,_0x4b0749){return client[_0x0d24('0xf')](_0x29742e,_0x4b55f0)['then'](function(_0x1603a8){logger[_0x0d24('0x10')](_0x0d24('0x11'),_0x23f9ed,'request\x20sent');logger['debug'](_0x0d24('0x12'),_0x23f9ed,_0x0d24('0x13'),JSON[_0x0d24('0x14')](_0x1603a8));if(_0x1603a8['error']){if(_0x1603a8[_0x0d24('0x15')][_0x0d24('0x16')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x23f9ed,_0x1603a8[_0x0d24('0x15')][_0x0d24('0x17')]);return _0x4b0749(_0x1603a8[_0x0d24('0x15')][_0x0d24('0x17')]);}logger[_0x0d24('0x15')](_0x0d24('0x11'),_0x23f9ed,_0x1603a8[_0x0d24('0x15')][_0x0d24('0x17')]);return _0x3aedef(_0x1603a8['error'][_0x0d24('0x17')]);}else{logger[_0x0d24('0x10')]('MailAccount,\x20%s,\x20%s',_0x23f9ed,_0x0d24('0x13'));_0x3aedef(_0x1603a8[_0x0d24('0x18')][_0x0d24('0x17')]);}})[_0x0d24('0x19')](function(_0x4c5a1e){logger[_0x0d24('0x15')](_0x0d24('0x11'),_0x23f9ed,_0x4c5a1e);_0x4b0749(_0x4c5a1e);});});}exports['GetMailAccount']=function(_0x583b82){var _0x131848=this;return new Promise(function(_0x2eca09,_0x3af97e){return db[_0x0d24('0x1a')][_0x0d24('0x1b')]({'raw':_0x583b82[_0x0d24('0x1c')]?_0x583b82[_0x0d24('0x1c')][_0x0d24('0x1d')]===undefined?!![]:![]:!![],'where':_0x583b82[_0x0d24('0x1c')]?_0x583b82['options'][_0x0d24('0x1e')]||null:null,'attributes':_0x583b82[_0x0d24('0x1c')]?_0x583b82[_0x0d24('0x1c')][_0x0d24('0x1f')]||null:null,'limit':_0x583b82['options']?_0x583b82[_0x0d24('0x1c')][_0x0d24('0x20')]||null:null,'include':_0x583b82[_0x0d24('0x1c')]?_0x583b82['options'][_0x0d24('0x21')]?_[_0x0d24('0x22')](_0x583b82[_0x0d24('0x1c')]['include'],function(_0x26db95){return{'model':db[_0x26db95[_0x0d24('0x23')]],'as':_0x26db95['as'],'attributes':_0x26db95[_0x0d24('0x1f')],'include':_0x26db95['include']?_[_0x0d24('0x22')](_0x26db95[_0x0d24('0x21')],function(_0x36a3f1){return{'model':db[_0x36a3f1[_0x0d24('0x23')]],'as':_0x36a3f1['as'],'attributes':_0x36a3f1[_0x0d24('0x1f')],'include':_0x36a3f1[_0x0d24('0x21')]?_['map'](_0x36a3f1['include'],function(_0x5b7305){return{'model':db[_0x5b7305[_0x0d24('0x23')]],'as':_0x5b7305['as'],'attributes':_0x5b7305[_0x0d24('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0d24('0x24')](function(_0xa1bccb){logger[_0x0d24('0x10')](_0x0d24('0x25'),_0x583b82);logger[_0x0d24('0x26')](_0x0d24('0x25'),_0x583b82,JSON[_0x0d24('0x14')](_0xa1bccb));_0x2eca09(_0xa1bccb);})[_0x0d24('0x19')](function(_0x3bf5f4){logger['error']('GetMailAccount',_0x3bf5f4[_0x0d24('0x17')],_0x583b82);_0x3af97e(_0x131848['error'](0x1f4,_0x3bf5f4['message']));});});};exports[_0x0d24('0x27')]=function(_0x413bac){var _0x3a1f27=this;return new Promise(function(_0x4eb1ab,_0x2f6ac4){return db['MailAccount'][_0x0d24('0x28')]({'raw':_0x413bac[_0x0d24('0x1c')]?_0x413bac[_0x0d24('0x1c')][_0x0d24('0x1d')]===undefined?!![]:![]:!![],'where':_0x413bac[_0x0d24('0x1c')]?_0x413bac['options']['where']||null:null,'attributes':_0x413bac[_0x0d24('0x1c')]?_0x413bac[_0x0d24('0x1c')][_0x0d24('0x1f')]||null:null,'include':_0x413bac[_0x0d24('0x1c')]?_0x413bac[_0x0d24('0x1c')][_0x0d24('0x21')]?_['map'](_0x413bac[_0x0d24('0x1c')][_0x0d24('0x21')],function(_0x5a8404){return{'model':db[_0x5a8404[_0x0d24('0x23')]],'as':_0x5a8404['as'],'attributes':_0x5a8404[_0x0d24('0x1f')],'include':_0x5a8404['include']?_[_0x0d24('0x22')](_0x5a8404[_0x0d24('0x21')],function(_0x1b5a4a){return{'model':db[_0x1b5a4a['model']],'as':_0x1b5a4a['as'],'attributes':_0x1b5a4a[_0x0d24('0x1f')],'include':_0x1b5a4a[_0x0d24('0x21')]?_[_0x0d24('0x22')](_0x1b5a4a[_0x0d24('0x21')],function(_0x4bf7b0){return{'model':db[_0x4bf7b0['model']],'as':_0x4bf7b0['as'],'attributes':_0x4bf7b0[_0x0d24('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4deac7){logger['info'](_0x0d24('0x27'),_0x413bac);logger['debug'](_0x0d24('0x27'),_0x413bac,JSON[_0x0d24('0x14')](_0x4deac7));_0x4eb1ab(_0x4deac7);})[_0x0d24('0x19')](function(_0x3c76fd){logger[_0x0d24('0x15')](_0x0d24('0x27'),_0x3c76fd[_0x0d24('0x17')],_0x413bac);_0x2f6ac4(_0x3a1f27[_0x0d24('0x15')](0x1f4,_0x3c76fd[_0x0d24('0x17')]));});});};exports['NotifyMailAccount']=function(_0x265f61){var _0x554917=this;return new Promise(function(_0x578199,_0x30ba29){var _0x25c248={'body':_0x265f61[_0x0d24('0x29')],'channel':_0x0d24('0x2a')};var _0xe5edf9=_[_0x0d24('0x2b')](_[_0x0d24('0x2c')](db[_0x0d24('0x2d')][_0x0d24('0x2e')]),[_0x0d24('0x2f'),_0x0d24('0x30'),'CompanyId',_0x0d24('0x31')]);var _0x1e99da=![];if(_0x265f61['body']['id']){delete _0x265f61[_0x0d24('0x29')]['id'];}if(_[_0x0d24('0x32')](_0x265f61[_0x0d24('0x29')][_0x0d24('0x33')])){return _0x30ba29(_0x554917[_0x0d24('0x15')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x0d24('0x32')](_0x265f61['body'][_0x0d24('0x29')])||_0x265f61[_0x0d24('0x29')]['body']===''){return _0x30ba29(_0x554917[_0x0d24('0x15')](0x1f4,_0x0d24('0x34')));}if(_['isNil'](_0x265f61['body']['mapKey'])){return _0x30ba29(_0x554917[_0x0d24('0x15')](0x1f4,_0x0d24('0x35')+_0xe5edf9));}if(!_[_0x0d24('0x36')](_0xe5edf9,_0x265f61[_0x0d24('0x29')][_0x0d24('0x37')])){return _0x30ba29(_0x554917['error'](0x1f4,_0x0d24('0x38')+_0xe5edf9));}var _0x41bbeb={};_0x41bbeb[_0x265f61['body'][_0x0d24('0x37')]]=_0x265f61['body'][_0x0d24('0x33')];return db[_0x0d24('0x1a')]['find']({'where':{'id':_0x265f61[_0x0d24('0x39')]['id']},'include':[{'model':db[_0x0d24('0x3a')],'as':_0x0d24('0x3b'),'include':[{'model':db[_0x0d24('0x2d')],'as':_0x0d24('0x3c'),'where':_0x41bbeb,'limit':0x1,'order':[[_0x0d24('0x30'),_0x0d24('0x3d')]]}]},{'model':db[_0x0d24('0x3e')],'as':_0x0d24('0x3f')},{'model':db[_0x0d24('0x40')],'as':_0x0d24('0x41')}]})[_0x0d24('0x24')](function(_0x4c3d55){if(_0x4c3d55&&_0x4c3d55[_0x0d24('0x3b')]){var _0x23b90b=_0x4c3d55[_0x0d24('0x42')]({'plain':!![]});_0x25c248[_0x0d24('0x39')]=_[_0x0d24('0x43')](_0x23b90b,[_0x0d24('0x3f'),_0x0d24('0x3b')]);_0x25c248['applications']=_0x23b90b['Applications'];_0x25c248[_0x0d24('0x44')]=_0x23b90b[_0x0d24('0x3b')];_0x25c248[_0x0d24('0x45')]=_[_0x0d24('0x46')](_0x25c248['applications'],[_0x0d24('0x47')],[_0x0d24('0x48')]);if(_0x25c248[_0x0d24('0x39')]&&_0x25c248['account'][_0x0d24('0x49')]){_0x25c248[_0x0d24('0x45')][_0x0d24('0x4a')]({'id':0x0,'priority':_0x25c248[_0x0d24('0x45')][_0x0d24('0x4b')]+0x1,'app':_0x0d24('0x4c'),'appdata':_0x0d24('0x49'),'interval':'*,*,*,*'});}if(_0x25c248['account'][_0x0d24('0x3f')]){delete _0x25c248[_0x0d24('0x39')][_0x0d24('0x3f')];}if(_0x25c248['account'][_0x0d24('0x3b')]){delete _0x25c248[_0x0d24('0x39')][_0x0d24('0x3b')];}if(_0x23b90b[_0x0d24('0x3b')][_0x0d24('0x3c')][_0x0d24('0x4b')]){return _0x23b90b[_0x0d24('0x3b')]['Contacts'][0x0];}var _0x217988=_[_0x0d24('0xa')](_0x265f61[_0x0d24('0x29')],{'firstName':_0x265f61[_0x0d24('0x29')][_0x0d24('0x33')],'ListId':_0x23b90b['ListId']});_0x217988[_0x265f61[_0x0d24('0x29')][_0x0d24('0x37')]]=_0x265f61[_0x0d24('0x29')][_0x0d24('0x33')];return db[_0x0d24('0x2d')]['create'](_0x217988);}else{throw new Error(_0x0d24('0x4d'));}})['then'](function(_0x2485cf){_0x25c248[_0x0d24('0x4e')]=_0x2485cf;if(_0x2485cf){if(!_0x265f61['body'][_0x0d24('0x17')][_0x0d24('0x4f')]){_0x265f61[_0x0d24('0x29')][_0x0d24('0x17')][_0x0d24('0x4f')]=rs[_0x0d24('0x50')]()+'\x20'+_0x265f61[_0x0d24('0x29')][_0x0d24('0x17')][_0x0d24('0x33')];}var _0x252605={'ContactId':_0x2485cf['id'],'MailAccountId':_0x265f61[_0x0d24('0x39')]['id'],'inReplyTo':_0x265f61[_0x0d24('0x29')][_0x0d24('0x17')][_0x0d24('0x4f')],'to':_0x265f61[_0x0d24('0x29')]['message'][_0x0d24('0x33')],'cc':_0x265f61[_0x0d24('0x29')][_0x0d24('0x17')]['cc'],'subject':_0x265f61[_0x0d24('0x29')][_0x0d24('0x17')][_0x0d24('0x51')],'attach':_0x265f61[_0x0d24('0x29')][_0x0d24('0x17')][_0x0d24('0x52')],'lastMsgAt':moment()['format'](_0x0d24('0x53')),'lastMsgDirection':'in','lastMsgBody':_0x265f61['body'][_0x0d24('0x29')]};return db[_0x0d24('0x54')][_0x0d24('0x28')]({'where':{'closed':![],'MailAccountId':_0x265f61[_0x0d24('0x39')]['id']},'include':[{'model':db['MailMessage'],'as':_0x0d24('0x55'),'attributes':[_0x0d24('0x4f')],'where':{'messageId':_0x265f61[_0x0d24('0x29')][_0x0d24('0x17')]['inReplyTo']}}]})[_0x0d24('0x24')](function(_0x35d97){if(_0x35d97){return[_0x35d97,![]];}return db[_0x0d24('0x54')]['create'](_0x252605)['then'](function(_0x10578b){return[_0x10578b,!![]];});});}else{throw new Error(_0x0d24('0x56'));}})[_0x0d24('0x57')](function(_0x5cc2f5,_0xcd9309){if(_0x5cc2f5){_0x1e99da=_0xcd9309;if(!_0xcd9309){return _0x5cc2f5['update']({'inReplyTo':_0x265f61[_0x0d24('0x29')][_0x0d24('0x17')]['messageId'],'to':_0x265f61[_0x0d24('0x29')]['message'][_0x0d24('0x33')],'cc':_0x265f61[_0x0d24('0x29')][_0x0d24('0x17')]['cc'],'subject':_0x265f61[_0x0d24('0x29')][_0x0d24('0x17')]['subject'],'attach':_0x5cc2f5[_0x0d24('0x52')]?_0x5cc2f5[_0x0d24('0x52')]:_0x265f61[_0x0d24('0x29')][_0x0d24('0x17')][_0x0d24('0x52')],'substatus':null,'substatusAt':moment()[_0x0d24('0x58')](_0x0d24('0x53')),'lastMsgAt':moment()[_0x0d24('0x58')](_0x0d24('0x53')),'lastMsgDirection':'in','lastMsgBody':_0x265f61[_0x0d24('0x29')][_0x0d24('0x29')]});}else{return _0x5cc2f5;}}})[_0x0d24('0x24')](function(_0x1b4a63){_0x25c248[_0x0d24('0x59')]=_0x1b4a63[_0x0d24('0x42')]({'plain':!![]});_0x25c248['interaction'][_0x0d24('0x5a')]=_0x1e99da;return db[_0x0d24('0x5b')]['create']({'body':_0x265f61[_0x0d24('0x29')][_0x0d24('0x29')],'MailAccountId':_0x265f61[_0x0d24('0x39')]['id'],'MailInteractionId':_0x1b4a63['id'],'direction':'in','ContactId':_0x25c248[_0x0d24('0x4e')]['id'],'messageId':_0x265f61['body'][_0x0d24('0x17')][_0x0d24('0x4f')],'from':_0x265f61[_0x0d24('0x29')][_0x0d24('0x17')]['from'],'to':_0x265f61[_0x0d24('0x29')][_0x0d24('0x17')]['to'],'cc':_0x265f61[_0x0d24('0x29')][_0x0d24('0x17')]['cc'],'subject':_0x265f61[_0x0d24('0x29')][_0x0d24('0x17')][_0x0d24('0x51')],'attach':_0x265f61[_0x0d24('0x29')][_0x0d24('0x17')][_0x0d24('0x52')],'Attachments':_0x265f61[_0x0d24('0x29')][_0x0d24('0x17')][_0x0d24('0x5c')],'originTo':_0x265f61['body'][_0x0d24('0x17')][_0x0d24('0x5d')],'originCc':_0x265f61['body'][_0x0d24('0x17')]['originCc'],'bcc':_0x265f61[_0x0d24('0x29')]['message']['bcc']},{'include':[{'model':db[_0x0d24('0x5e')],'as':'Attachments'}]});})[_0x0d24('0x24')](function(_0xd836d4){_0x25c248[_0x0d24('0x17')]=_0xd836d4;if(_0x25c248['interaction'][_0x0d24('0x5f')]){return db[_0x0d24('0x60')][_0x0d24('0x28')]({'attributes':['id','name'],'where':{'id':_0x25c248[_0x0d24('0x59')][_0x0d24('0x5f')]}})[_0x0d24('0x24')](function(_0x265f51){if(_0x265f51){_0x25c248[_0x0d24('0x45')][_0x0d24('0x61')]({'id':0x0,'priority':0x0,'app':_0x0d24('0x62'),'appdata':_0x265f51[_0x0d24('0x63')]+','+(_0x25c248['account'][_0x0d24('0x64')]||0xa),'interval':_0x0d24('0x65')});}return respondWithRpcPromise(_0x0d24('0x66'),_0x0d24('0x67'),_0x25c248);});}return respondWithRpcPromise(_0x0d24('0x66'),'startRouting',_0x25c248);})[_0x0d24('0x24')](function(_0x6f7ffc){_0x578199(_0x6f7ffc);})[_0x0d24('0x19')](function(_0x1d5dbc){_0x30ba29(_0x554917[_0x0d24('0x15')](0x1f4,_0x1d5dbc[_0x0d24('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 0b93f13..6ce1b69 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 _0xdbfa=['update','removeListener','register','length'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xdbfa,0x128));var _0xadbf=function(_0x43b6fc,_0x5ba6d7){_0x43b6fc=_0x43b6fc-0x0;var _0x40b07c=_0xdbfa[_0x43b6fc];return _0x40b07c;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save','remove',_0xadbf('0x0')];function createListener(_0x534d5d,_0x3ebcae){return function(_0x10e430){_0x3ebcae['emit'](_0x534d5d,_0x10e430);};}function removeListener(_0x825f51,_0x34e95a){return function(){MailAccountEvents[_0xadbf('0x1')](_0x825f51,_0x34e95a);};}exports[_0xadbf('0x2')]=function(_0xd2abca){for(var _0x5bad41=0x0,_0x1204f4=events[_0xadbf('0x3')];_0x5bad41<_0x1204f4;_0x5bad41++){var _0x16704e=events[_0x5bad41];var _0x2bbd13=createListener('mailAccount:'+_0x16704e,_0xd2abca);MailAccountEvents['on'](_0x16704e,_0x2bbd13);}}; \ No newline at end of file +var _0x972c=['register','length','remove','update','removeListener'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x972c,0xf2));var _0xc972=function(_0x45c46e,_0x479fac){_0x45c46e=_0x45c46e-0x0;var _0x148ecb=_0x972c[_0x45c46e];return _0x148ecb;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0xc972('0x0'),_0xc972('0x1')];function createListener(_0x5ebc6c,_0x3c04a5){return function(_0x1a41f9){_0x3c04a5['emit'](_0x5ebc6c,_0x1a41f9);};}function removeListener(_0x511ad4,_0x140e13){return function(){MailAccountEvents[_0xc972('0x2')](_0x511ad4,_0x140e13);};}exports[_0xc972('0x3')]=function(_0x5dd2c8){for(var _0xd70261=0x0,_0x4cff66=events[_0xc972('0x4')];_0xd70261<_0x4cff66;_0xd70261++){var _0xd8cd25=events[_0xd70261];var _0x304d08=createListener('mailAccount:'+_0xd8cd25,_0x5dd2c8);MailAccountEvents['on'](_0xd8cd25,_0x304d08);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 34a0c7e..dc58ce4 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 _0x373d=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailApplication.controller','isAuthenticated','show','put','/:id','update'];(function(_0x3ceb03,_0x320c8a){var _0x3d205c=function(_0x34bc7a){while(--_0x34bc7a){_0x3ceb03['push'](_0x3ceb03['shift']());}};_0x3d205c(++_0x320c8a);}(_0x373d,0x1e2));var _0xd373=function(_0x1e4535,_0x37cf32){_0x1e4535=_0x1e4535-0x0;var _0x4d8658=_0x373d[_0x1e4535];return _0x4d8658;};'use strict';var multer=require(_0xd373('0x0'));var util=require('util');var path=require(_0xd373('0x1'));var timeout=require(_0xd373('0x2'));var express=require(_0xd373('0x3'));var router=express[_0xd373('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd373('0x5'));var config=require(_0xd373('0x6'));var controller=require(_0xd373('0x7'));router['get']('/:id',auth[_0xd373('0x8')](),controller[_0xd373('0x9')]);router[_0xd373('0xa')](_0xd373('0xb'),auth['isAuthenticated'](),controller[_0xd373('0xc')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd373('0xd')]);module[_0xd373('0xe')]=router; \ No newline at end of file +var _0x6c76=['Router','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x515401,_0x3c8ec8){var _0x57d501=function(_0x3bc5d6){while(--_0x3bc5d6){_0x515401['push'](_0x515401['shift']());}};_0x57d501(++_0x3c8ec8);}(_0x6c76,0x184));var _0x66c7=function(_0x4214e4,_0x3aeb68){_0x4214e4=_0x4214e4-0x0;var _0x1e937f=_0x6c76[_0x4214e4];return _0x1e937f;};'use strict';var multer=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var path=require(_0x66c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x66c7('0x3'));var router=express[_0x66c7('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x66c7('0x5'));var controller=require(_0x66c7('0x6'));router['get'](_0x66c7('0x7'),auth[_0x66c7('0x8')](),controller['show']);router[_0x66c7('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x66c7('0xa')]);router[_0x66c7('0xb')](_0x66c7('0x7'),auth['isAuthenticated'](),controller[_0x66c7('0xc')]);module[_0x66c7('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 3b60fd6..38f2f64 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 _0xa878=['exports','STRING','TEXT','*,*,*,*'];(function(_0xcbaa44,_0x599ce0){var _0x36797a=function(_0x2f07a6){while(--_0x2f07a6){_0xcbaa44['push'](_0xcbaa44['shift']());}};_0x36797a(++_0x599ce0);}(_0xa878,0x130));var _0x8a87=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa878[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x8a87('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x8a87('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x8a87('0x2')]()},'description':{'type':Sequelize[_0x8a87('0x1')]},'interval':{'type':Sequelize[_0x8a87('0x1')],'defaultValue':_0x8a87('0x3')}}; \ No newline at end of file +var _0x6ea1=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x34d79f,_0xf6da77){var _0x287e17=function(_0x58878d){while(--_0x58878d){_0x34d79f['push'](_0x34d79f['shift']());}};_0x287e17(++_0xf6da77);}(_0x6ea1,0x1c2));var _0x16ea=function(_0x234050,_0x2a4534){_0x234050=_0x234050-0x0;var _0x89e1e0=_0x6ea1[_0x234050];return _0x89e1e0;};'use strict';var Sequelize=require(_0x16ea('0x0'));module[_0x16ea('0x1')]={'priority':{'type':Sequelize[_0x16ea('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x16ea('0x3')],'allowNull':![],'defaultValue':_0x16ea('0x4')},'appdata':{'type':Sequelize[_0x16ea('0x5')]()},'description':{'type':Sequelize[_0x16ea('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index bc6eca1..ed76092 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 _0xe28e=['intersection','fields','attributes','includeAll','include','merge','options','find','body','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','save','update','then','destroy','error','stack','name','show','model','keys','MailApplication','rawAttributes','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe28e,0x1ba));var _0xee28=function(_0x54bec2,_0x1508df){_0x54bec2=_0x54bec2-0x0;var _0x32ab98=_0xe28e[_0x54bec2];return _0x32ab98;};'use strict';var pdf=require(_0xee28('0x0'));var emlformat=require(_0xee28('0x1'));var rimraf=require(_0xee28('0x2'));var zipdir=require(_0xee28('0x3'));var jsonpatch=require(_0xee28('0x4'));var rp=require(_0xee28('0x5'));var moment=require(_0xee28('0x6'));var BPromise=require(_0xee28('0x7'));var Mustache=require(_0xee28('0x8'));var util=require(_0xee28('0x9'));var path=require(_0xee28('0xa'));var sox=require(_0xee28('0xb'));var csv=require(_0xee28('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xee28('0xd'));var squel=require(_0xee28('0xe'));var crypto=require(_0xee28('0xf'));var jsforce=require(_0xee28('0x10'));var deskjs=require(_0xee28('0x11'));var toCsv=require(_0xee28('0xc'));var querystring=require(_0xee28('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xee28('0x13'));var hardwareService=require(_0xee28('0x14'));var logger=require('../../config/logger')(_0xee28('0x15'));var utils=require(_0xee28('0x16'));var config=require('../../config/environment');var db=require(_0xee28('0x17'))['db'];function respondWithStatusCode(_0x3b595d,_0x3feffa){_0x3feffa=_0x3feffa||0xcc;return function(_0x2488cf){if(_0x2488cf){return _0x3b595d[_0xee28('0x18')](_0x3feffa);}return _0x3b595d[_0xee28('0x19')](_0x3feffa)[_0xee28('0x1a')]();};}function respondWithResult(_0x5caa81,_0x4201ad){_0x4201ad=_0x4201ad||0xc8;return function(_0x1df69a){if(_0x1df69a){return _0x5caa81[_0xee28('0x19')](_0x4201ad)[_0xee28('0x1b')](_0x1df69a);}};}function respondWithFilteredResult(_0x2ae3e0,_0x5b510a){return function(_0x11ac93){if(_0x11ac93){var _0x17c99a=_0x11ac93[_0xee28('0x1c')],_0x3d3a5c=_0x5b510a['offset'],_0x343358=_0x5b510a[_0xee28('0x1d')]+_0x5b510a['limit'],_0x1ff99e;if(_0x343358>=_0x17c99a){_0x343358=_0x17c99a;_0x1ff99e=0xc8;}else{_0x1ff99e=0xce;}_0x2ae3e0[_0xee28('0x19')](_0x1ff99e);return _0x2ae3e0[_0xee28('0x1e')]('Content-Range',_0x3d3a5c+'-'+_0x343358+'/'+_0x17c99a)[_0xee28('0x1b')](_0x11ac93);}return null;};}function patchUpdates(_0x49be69){return function(_0x3c9ac6){try{jsonpatch['apply'](_0x3c9ac6,_0x49be69,!![]);}catch(_0x28da88){return BPromise['reject'](_0x28da88);}return _0x3c9ac6[_0xee28('0x1f')]();};}function saveUpdates(_0x590137,_0x2fdf11){return function(_0x2a01ff){if(_0x2a01ff){return _0x2a01ff[_0xee28('0x20')](_0x590137)[_0xee28('0x21')](function(_0x21ee24){return _0x21ee24;});}return null;};}function removeEntity(_0x1280f5,_0x2dbd49){return function(_0x4bda53){if(_0x4bda53){return _0x4bda53[_0xee28('0x22')]()[_0xee28('0x21')](function(){_0x1280f5[_0xee28('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b500b,_0x17d8e4){return function(_0x4a524d){if(!_0x4a524d){_0x5b500b[_0xee28('0x18')](0x194);}return _0x4a524d;};}function handleError(_0x29360e,_0x57b11a){_0x57b11a=_0x57b11a||0x1f4;return function(_0x3acfc9){logger[_0xee28('0x23')](_0x3acfc9[_0xee28('0x24')]);if(_0x3acfc9[_0xee28('0x25')]){delete _0x3acfc9[_0xee28('0x25')];}_0x29360e[_0xee28('0x19')](_0x57b11a)['send'](_0x3acfc9);};}exports[_0xee28('0x26')]=function(_0x5b1b1e,_0x51a87e){var _0x54528b={'raw':!![],'where':{'id':_0x5b1b1e['params']['id']}},_0x587aac={};_0x587aac[_0xee28('0x27')]=_[_0xee28('0x28')](db[_0xee28('0x29')][_0xee28('0x2a')]);_0x587aac[_0xee28('0x2b')]=_[_0xee28('0x28')](_0x5b1b1e[_0xee28('0x2b')]);_0x587aac['filters']=_[_0xee28('0x2c')](_0x587aac[_0xee28('0x27')],_0x587aac[_0xee28('0x2b')]);_0x54528b['attributes']=_[_0xee28('0x2c')](_0x587aac[_0xee28('0x27')],qs[_0xee28('0x2d')](_0x5b1b1e[_0xee28('0x2b')][_0xee28('0x2d')]));_0x54528b[_0xee28('0x2e')]=_0x54528b[_0xee28('0x2e')]['length']?_0x54528b[_0xee28('0x2e')]:_0x587aac[_0xee28('0x27')];if(_0x5b1b1e['query'][_0xee28('0x2f')]){_0x54528b[_0xee28('0x30')]=[{'all':!![]}];}_0x54528b=_[_0xee28('0x31')]({},_0x54528b,_0x5b1b1e[_0xee28('0x32')]);return db[_0xee28('0x29')][_0xee28('0x33')](_0x54528b)[_0xee28('0x21')](handleEntityNotFound(_0x51a87e,null))['then'](respondWithResult(_0x51a87e,null))['catch'](handleError(_0x51a87e,null));};exports['update']=function(_0x1a8ef0,_0x390a03){if(_0x1a8ef0[_0xee28('0x34')]['id']){delete _0x1a8ef0[_0xee28('0x34')]['id'];}return db[_0xee28('0x29')][_0xee28('0x33')]({'where':{'id':_0x1a8ef0['params']['id']}})[_0xee28('0x21')](handleEntityNotFound(_0x390a03,null))[_0xee28('0x21')](saveUpdates(_0x1a8ef0['body'],null))['then'](respondWithResult(_0x390a03,null))[_0xee28('0x35')](handleError(_0x390a03,null));};exports[_0xee28('0x22')]=function(_0x595d6c,_0x4e1933){return db[_0xee28('0x29')][_0xee28('0x33')]({'where':{'id':_0x595d6c['params']['id']}})[_0xee28('0x21')](handleEntityNotFound(_0x4e1933,null))[_0xee28('0x21')](removeEntity(_0x4e1933,null))[_0xee28('0x35')](handleError(_0x4e1933,null));}; \ No newline at end of file +var _0xbec5=['error','stack','name','params','model','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','include','options','find','catch','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','apply','reject','save','update','then','destroy'];(function(_0x5eb1d4,_0x34cb0c){var _0x8bb784=function(_0xb651ff){while(--_0xb651ff){_0x5eb1d4['push'](_0x5eb1d4['shift']());}};_0x8bb784(++_0x34cb0c);}(_0xbec5,0xe5));var _0x5bec=function(_0x31172e,_0xa59e5){_0x31172e=_0x31172e-0x0;var _0x414ada=_0xbec5[_0x31172e];return _0x414ada;};'use strict';var pdf=require(_0x5bec('0x0'));var emlformat=require(_0x5bec('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5bec('0x2'));var jsonpatch=require(_0x5bec('0x3'));var rp=require(_0x5bec('0x4'));var moment=require(_0x5bec('0x5'));var BPromise=require(_0x5bec('0x6'));var Mustache=require('mustache');var util=require(_0x5bec('0x7'));var path=require(_0x5bec('0x8'));var sox=require(_0x5bec('0x9'));var csv=require('to-csv');var ejs=require(_0x5bec('0xa'));var fs=require('fs');var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x10'));var querystring=require(_0x5bec('0x11'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require(_0x5bec('0x15'))('api');var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var db=require(_0x5bec('0x18'))['db'];function respondWithStatusCode(_0x57ffc4,_0x6bee21){_0x6bee21=_0x6bee21||0xcc;return function(_0x1c888f){if(_0x1c888f){return _0x57ffc4['sendStatus'](_0x6bee21);}return _0x57ffc4[_0x5bec('0x19')](_0x6bee21)[_0x5bec('0x1a')]();};}function respondWithResult(_0x35393a,_0x6888a4){_0x6888a4=_0x6888a4||0xc8;return function(_0x3198e0){if(_0x3198e0){return _0x35393a[_0x5bec('0x19')](_0x6888a4)[_0x5bec('0x1b')](_0x3198e0);}};}function respondWithFilteredResult(_0x43fd2a,_0x259588){return function(_0x3ebc41){if(_0x3ebc41){var _0x31b9e4=_0x3ebc41['count'],_0x325daf=_0x259588[_0x5bec('0x1c')],_0x11fb8e=_0x259588[_0x5bec('0x1c')]+_0x259588[_0x5bec('0x1d')],_0x506639;if(_0x11fb8e>=_0x31b9e4){_0x11fb8e=_0x31b9e4;_0x506639=0xc8;}else{_0x506639=0xce;}_0x43fd2a[_0x5bec('0x19')](_0x506639);return _0x43fd2a['set']('Content-Range',_0x325daf+'-'+_0x11fb8e+'/'+_0x31b9e4)[_0x5bec('0x1b')](_0x3ebc41);}return null;};}function patchUpdates(_0x6c0d35){return function(_0x4e0191){try{jsonpatch[_0x5bec('0x1e')](_0x4e0191,_0x6c0d35,!![]);}catch(_0xa7e223){return BPromise[_0x5bec('0x1f')](_0xa7e223);}return _0x4e0191[_0x5bec('0x20')]();};}function saveUpdates(_0x554f9f,_0xab397b){return function(_0x5be91c){if(_0x5be91c){return _0x5be91c[_0x5bec('0x21')](_0x554f9f)[_0x5bec('0x22')](function(_0x3e1896){return _0x3e1896;});}return null;};}function removeEntity(_0x43a62d,_0xfed23){return function(_0x5e154e){if(_0x5e154e){return _0x5e154e[_0x5bec('0x23')]()['then'](function(){_0x43a62d[_0x5bec('0x19')](0xcc)[_0x5bec('0x1a')]();});}};}function handleEntityNotFound(_0x5b2636,_0xa414f8){return function(_0xbef70b){if(!_0xbef70b){_0x5b2636['sendStatus'](0x194);}return _0xbef70b;};}function handleError(_0x45afb7,_0x218c13){_0x218c13=_0x218c13||0x1f4;return function(_0x43d460){logger[_0x5bec('0x24')](_0x43d460[_0x5bec('0x25')]);if(_0x43d460[_0x5bec('0x26')]){delete _0x43d460[_0x5bec('0x26')];}_0x45afb7['status'](_0x218c13)['send'](_0x43d460);};}exports['show']=function(_0x2961bd,_0x2cdd2f){var _0x338c25={'raw':!![],'where':{'id':_0x2961bd[_0x5bec('0x27')]['id']}},_0x4939a5={};_0x4939a5[_0x5bec('0x28')]=_['keys'](db[_0x5bec('0x29')][_0x5bec('0x2a')]);_0x4939a5['query']=_['keys'](_0x2961bd[_0x5bec('0x2b')]);_0x4939a5[_0x5bec('0x2c')]=_[_0x5bec('0x2d')](_0x4939a5[_0x5bec('0x28')],_0x4939a5[_0x5bec('0x2b')]);_0x338c25[_0x5bec('0x2e')]=_['intersection'](_0x4939a5[_0x5bec('0x28')],qs['fields'](_0x2961bd[_0x5bec('0x2b')][_0x5bec('0x2f')]));_0x338c25[_0x5bec('0x2e')]=_0x338c25[_0x5bec('0x2e')]['length']?_0x338c25[_0x5bec('0x2e')]:_0x4939a5[_0x5bec('0x28')];if(_0x2961bd[_0x5bec('0x2b')]['includeAll']){_0x338c25[_0x5bec('0x30')]=[{'all':!![]}];}_0x338c25=_['merge']({},_0x338c25,_0x2961bd[_0x5bec('0x31')]);return db[_0x5bec('0x29')][_0x5bec('0x32')](_0x338c25)['then'](handleEntityNotFound(_0x2cdd2f,null))[_0x5bec('0x22')](respondWithResult(_0x2cdd2f,null))[_0x5bec('0x33')](handleError(_0x2cdd2f,null));};exports['update']=function(_0x34b441,_0x2e5efc){if(_0x34b441[_0x5bec('0x34')]['id']){delete _0x34b441[_0x5bec('0x34')]['id'];}return db[_0x5bec('0x29')]['find']({'where':{'id':_0x34b441[_0x5bec('0x27')]['id']}})['then'](handleEntityNotFound(_0x2e5efc,null))[_0x5bec('0x22')](saveUpdates(_0x34b441[_0x5bec('0x34')],null))[_0x5bec('0x22')](respondWithResult(_0x2e5efc,null))[_0x5bec('0x33')](handleError(_0x2e5efc,null));};exports[_0x5bec('0x23')]=function(_0x1923fc,_0x49c8ef){return db[_0x5bec('0x29')][_0x5bec('0x32')]({'where':{'id':_0x1923fc[_0x5bec('0x27')]['id']}})['then'](handleEntityNotFound(_0x49c8ef,null))[_0x5bec('0x22')](removeEntity(_0x49c8ef,null))[_0x5bec('0x33')](handleError(_0x49c8ef,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 964cc9e..7c89aa5 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 _0x014c=['./mailApplication.attributes','exports','define','MailApplication','utf8mb4','util','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x506b42,_0x43d941){var _0x5cf004=function(_0x3fcc12){while(--_0x3fcc12){_0x506b42['push'](_0x506b42['shift']());}};_0x5cf004(++_0x43d941);}(_0x014c,0x17b));var _0xc014=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0x014c[_0x5b27da];return _0x3254f4;};'use strict';var _=require('lodash');var util=require(_0xc014('0x0'));var logger=require('../../config/logger')(_0xc014('0x1'));var moment=require(_0xc014('0x2'));var BPromise=require(_0xc014('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc014('0x4'));var config=require(_0xc014('0x5'));var attributes=require(_0xc014('0x6'));module[_0xc014('0x7')]=function(_0x10f3cb,_0x5138a8){return _0x10f3cb[_0xc014('0x8')](_0xc014('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc014('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8276=['moment','bluebird','path','rimraf','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0x8276,0xa7));var _0x6827=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8276[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6827('0x0'));var util=require(_0x6827('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6827('0x2'));var BPromise=require(_0x6827('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6827('0x4'));var rimraf=require(_0x6827('0x5'));var config=require('../../config/environment');var attributes=require(_0x6827('0x6'));module[_0x6827('0x7')]=function(_0xc96297,_0x1c7983){return _0xc96297[_0x6827('0x8')](_0x6827('0x9'),attributes,{'tableName':_0x6827('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6827('0xb'),'collate':_0x6827('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 040074a..2eb600e 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 _0x48fd=['body','options','raw','where','attributes','limit','UpdateMailApplication','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailApplication'];(function(_0x48b3bf,_0x39517f){var _0x3dcacf=function(_0x3b2b8e){while(--_0x3b2b8e){_0x48b3bf['push'](_0x48b3bf['shift']());}};_0x3dcacf(++_0x39517f);}(_0x48fd,0x147));var _0xd48f=function(_0x530bb8,_0x5e77ea){_0x530bb8=_0x530bb8-0x0;var _0x447b46=_0x48fd[_0x530bb8];return _0x447b46;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd48f('0x0'));var BPromise=require('bluebird');var rs=require(_0xd48f('0x1'));var fs=require('fs');var Redis=require(_0xd48f('0x2'));var db=require(_0xd48f('0x3'))['db'];var utils=require(_0xd48f('0x4'));var logger=require('../../config/logger')(_0xd48f('0x5'));var config=require(_0xd48f('0x6'));var jayson=require(_0xd48f('0x7'));var client=jayson[_0xd48f('0x8')][_0xd48f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcdce14,_0x6607bb,_0x17d152){return new BPromise(function(_0x566335,_0x489e08){return client['request'](_0xcdce14,_0x17d152)[_0xd48f('0xa')](function(_0x5c66bc){logger[_0xd48f('0xb')](_0xd48f('0xc'),_0x6607bb,_0xd48f('0xd'));logger[_0xd48f('0xe')](_0xd48f('0xf'),_0x6607bb,_0xd48f('0xd'),JSON[_0xd48f('0x10')](_0x5c66bc));if(_0x5c66bc[_0xd48f('0x11')]){if(_0x5c66bc[_0xd48f('0x11')][_0xd48f('0x12')]===0x1f4){logger[_0xd48f('0x11')](_0xd48f('0xc'),_0x6607bb,_0x5c66bc[_0xd48f('0x11')][_0xd48f('0x13')]);return _0x489e08(_0x5c66bc[_0xd48f('0x11')][_0xd48f('0x13')]);}logger[_0xd48f('0x11')](_0xd48f('0xc'),_0x6607bb,_0x5c66bc[_0xd48f('0x11')]['message']);return _0x566335(_0x5c66bc[_0xd48f('0x11')]['message']);}else{logger[_0xd48f('0xb')](_0xd48f('0xc'),_0x6607bb,_0xd48f('0xd'));_0x566335(_0x5c66bc['result'][_0xd48f('0x13')]);}})['catch'](function(_0x2c08ee){logger[_0xd48f('0x11')](_0xd48f('0xc'),_0x6607bb,_0x2c08ee);_0x489e08(_0x2c08ee);});});}exports['UpdateMailApplication']=function(_0x4ea7f1){var _0x2c5ecf=this;return new Promise(function(_0x2e9c62,_0x155e11){return db[_0xd48f('0x14')]['update'](_0x4ea7f1[_0xd48f('0x15')],{'raw':_0x4ea7f1[_0xd48f('0x16')]?_0x4ea7f1[_0xd48f('0x16')][_0xd48f('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ea7f1[_0xd48f('0x16')]?_0x4ea7f1[_0xd48f('0x16')][_0xd48f('0x18')]||null:null,'attributes':_0x4ea7f1[_0xd48f('0x16')]?_0x4ea7f1[_0xd48f('0x16')][_0xd48f('0x19')]||null:null,'limit':_0x4ea7f1['options']?_0x4ea7f1[_0xd48f('0x16')][_0xd48f('0x1a')]||null:null})[_0xd48f('0xa')](function(_0x4639e4){logger['info'](_0xd48f('0x1b'),_0x4ea7f1);logger['debug'](_0xd48f('0x1b'),_0x4ea7f1,JSON[_0xd48f('0x10')](_0x4639e4));_0x2e9c62(_0x4639e4);})[_0xd48f('0x1c')](function(_0x3bd5ed){logger[_0xd48f('0x11')](_0xd48f('0x1b'),_0x3bd5ed[_0xd48f('0x13')],_0x4ea7f1);_0x155e11(_0x2c5ecf[_0xd48f('0x11')](0x1f4,_0x3bd5ed['message']));});});}; \ No newline at end of file +var _0x0da7=['rpc','jayson/promise','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateMailApplication','MailApplication','body','options','raw','where','attributes','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3ba844,_0x42d868){var _0x416f06=function(_0x46c5e8){while(--_0x46c5e8){_0x3ba844['push'](_0x3ba844['shift']());}};_0x416f06(++_0x42d868);}(_0x0da7,0xb7));var _0x70da=function(_0x5458a6,_0x1688c5){_0x5458a6=_0x5458a6-0x0;var _0x2669fc=_0x0da7[_0x5458a6];return _0x2669fc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x70da('0x0'));var BPromise=require('bluebird');var rs=require(_0x70da('0x1'));var fs=require('fs');var Redis=require(_0x70da('0x2'));var db=require(_0x70da('0x3'))['db'];var utils=require(_0x70da('0x4'));var logger=require(_0x70da('0x5'))(_0x70da('0x6'));var config=require('../../config/environment');var jayson=require(_0x70da('0x7'));var client=jayson['client'][_0x70da('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x268ce6,_0x2b07d4,_0x5e4771){return new BPromise(function(_0x1c1743,_0x17ec39){return client[_0x70da('0x9')](_0x268ce6,_0x5e4771)[_0x70da('0xa')](function(_0x5c72f7){logger[_0x70da('0xb')](_0x70da('0xc'),_0x2b07d4,_0x70da('0xd'));logger[_0x70da('0xe')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x2b07d4,_0x70da('0xd'),JSON[_0x70da('0xf')](_0x5c72f7));if(_0x5c72f7[_0x70da('0x10')]){if(_0x5c72f7['error'][_0x70da('0x11')]===0x1f4){logger[_0x70da('0x10')](_0x70da('0xc'),_0x2b07d4,_0x5c72f7[_0x70da('0x10')]['message']);return _0x17ec39(_0x5c72f7[_0x70da('0x10')][_0x70da('0x12')]);}logger[_0x70da('0x10')]('MailApplication,\x20%s,\x20%s',_0x2b07d4,_0x5c72f7[_0x70da('0x10')][_0x70da('0x12')]);return _0x1c1743(_0x5c72f7[_0x70da('0x10')]['message']);}else{logger['info'](_0x70da('0xc'),_0x2b07d4,_0x70da('0xd'));_0x1c1743(_0x5c72f7['result']['message']);}})[_0x70da('0x13')](function(_0x177822){logger['error'](_0x70da('0xc'),_0x2b07d4,_0x177822);_0x17ec39(_0x177822);});});}exports[_0x70da('0x14')]=function(_0x188c44){var _0x32926e=this;return new Promise(function(_0x467755,_0x3ec646){return db[_0x70da('0x15')]['update'](_0x188c44[_0x70da('0x16')],{'raw':_0x188c44[_0x70da('0x17')]?_0x188c44['options'][_0x70da('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x188c44['options']?_0x188c44[_0x70da('0x17')][_0x70da('0x19')]||null:null,'attributes':_0x188c44[_0x70da('0x17')]?_0x188c44[_0x70da('0x17')][_0x70da('0x1a')]||null:null,'limit':_0x188c44[_0x70da('0x17')]?_0x188c44[_0x70da('0x17')]['limit']||null:null})[_0x70da('0xa')](function(_0x411061){logger[_0x70da('0xb')]('UpdateMailApplication',_0x188c44);logger[_0x70da('0xe')](_0x70da('0x14'),_0x188c44,JSON[_0x70da('0xf')](_0x411061));_0x467755(_0x411061);})[_0x70da('0x13')](function(_0x268ba0){logger['error'](_0x70da('0x14'),_0x268ba0[_0x70da('0x12')],_0x188c44);_0x3ec646(_0x32926e['error'](0x1f4,_0x268ba0[_0x70da('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index d48da2d..523f2a0 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 _0x93bb=['index','/describe','get','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','mail','addTags','put','update','mailinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','isAuthenticated'];(function(_0x463326,_0x344cca){var _0x18f5f5=function(_0x451b0e){while(--_0x451b0e){_0x463326['push'](_0x463326['shift']());}};_0x18f5f5(++_0x344cca);}(_0x93bb,0x135));var _0xb93b=function(_0x29b2bb,_0x48620e){_0x29b2bb=_0x29b2bb-0x0;var _0x20f30d=_0x93bb[_0x29b2bb];return _0x20f30d;};'use strict';var multer=require(_0xb93b('0x0'));var util=require(_0xb93b('0x1'));var path=require(_0xb93b('0x2'));var timeout=require(_0xb93b('0x3'));var express=require(_0xb93b('0x4'));var router=express[_0xb93b('0x5')]();var auth=require(_0xb93b('0x6'));var interaction=require(_0xb93b('0x7'));var config=require(_0xb93b('0x8'));var controller=require(_0xb93b('0x9'));router['get']('/',auth[_0xb93b('0xa')](),controller[_0xb93b('0xb')]);router['get'](_0xb93b('0xc'),auth[_0xb93b('0xa')](),controller['describe']);router[_0xb93b('0xd')](_0xb93b('0xe'),auth[_0xb93b('0xa')](),controller[_0xb93b('0xf')]);router[_0xb93b('0xd')](_0xb93b('0x10'),auth[_0xb93b('0xa')](),controller[_0xb93b('0x11')]);router[_0xb93b('0xd')](_0xb93b('0x12'),auth[_0xb93b('0xa')](),controller['download']);router[_0xb93b('0x13')]('/',auth[_0xb93b('0xa')](),controller[_0xb93b('0x14')]);router[_0xb93b('0x13')]('/:id/messages',auth[_0xb93b('0xa')](),controller[_0xb93b('0x15')]);router[_0xb93b('0x13')](_0xb93b('0x16'),auth[_0xb93b('0xa')](),interaction[_0xb93b('0x17')](_0xb93b('0x18'),'mailinteraction:addtags'),controller[_0xb93b('0x19')]);router[_0xb93b('0x1a')](_0xb93b('0xe'),auth[_0xb93b('0xa')](),interaction[_0xb93b('0x17')](_0xb93b('0x18'),'mailinteraction:update'),controller[_0xb93b('0x1b')]);router['delete'](_0xb93b('0xe'),auth[_0xb93b('0xa')](),interaction[_0xb93b('0x17')](_0xb93b('0x18'),_0xb93b('0x1c')),controller[_0xb93b('0x1d')]);router['delete'](_0xb93b('0x16'),auth[_0xb93b('0xa')](),controller[_0xb93b('0x1e')]);module[_0xb93b('0x1f')]=router; \ No newline at end of file +var _0x62dd=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','isAuthenticated','get','/describe','describe','show','getMessages','download','post','create','/:id/messages','addMessage','/:id/tags','mail','put','/:id','tracked','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x62dd,0x6c));var _0xd62d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62dd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd62d('0x0'));var util=require(_0xd62d('0x1'));var path=require(_0xd62d('0x2'));var timeout=require(_0xd62d('0x3'));var express=require(_0xd62d('0x4'));var router=express['Router']();var auth=require(_0xd62d('0x5'));var interaction=require(_0xd62d('0x6'));var config=require(_0xd62d('0x7'));var controller=require(_0xd62d('0x8'));router['get']('/',auth[_0xd62d('0x9')](),controller['index']);router[_0xd62d('0xa')](_0xd62d('0xb'),auth[_0xd62d('0x9')](),controller[_0xd62d('0xc')]);router[_0xd62d('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xd62d('0xd')]);router[_0xd62d('0xa')]('/:id/messages',auth[_0xd62d('0x9')](),controller[_0xd62d('0xe')]);router[_0xd62d('0xa')]('/:id/download',auth[_0xd62d('0x9')](),controller[_0xd62d('0xf')]);router[_0xd62d('0x10')]('/',auth[_0xd62d('0x9')](),controller[_0xd62d('0x11')]);router['post'](_0xd62d('0x12'),auth[_0xd62d('0x9')](),controller[_0xd62d('0x13')]);router[_0xd62d('0x10')](_0xd62d('0x14'),auth[_0xd62d('0x9')](),interaction['tracked'](_0xd62d('0x15'),'mailinteraction:addtags'),controller['addTags']);router[_0xd62d('0x16')](_0xd62d('0x17'),auth[_0xd62d('0x9')](),interaction[_0xd62d('0x18')]('mail','mailinteraction:update'),controller[_0xd62d('0x19')]);router['delete'](_0xd62d('0x17'),auth[_0xd62d('0x9')](),interaction[_0xd62d('0x18')](_0xd62d('0x15'),'mailinteraction:destroy'),controller[_0xd62d('0x1a')]);router['delete'](_0xd62d('0x14'),auth[_0xd62d('0x9')](),controller['removeTags']);module[_0xd62d('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 6eedced..587398b 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 _0x7f17=['sequelize','exports','BOOLEAN','DATE','TEXT','STRING','out','ENUM','long'];(function(_0x3f3bad,_0x193f06){var _0x4f0801=function(_0x5cfd32){while(--_0x5cfd32){_0x3f3bad['push'](_0x3f3bad['shift']());}};_0x4f0801(++_0x193f06);}(_0x7f17,0xbd));var _0x77f1=function(_0x2741d1,_0x501426){_0x2741d1=_0x2741d1-0x0;var _0x521e37=_0x7f17[_0x2741d1];return _0x521e37;};'use strict';var Sequelize=require(_0x77f1('0x0'));var iconv=require('iconv');module[_0x77f1('0x1')]={'closed':{'type':Sequelize[_0x77f1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x77f1('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x77f1('0x4')]('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x77f1('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x77f1('0x3')]},'substatus':{'type':Sequelize[_0x77f1('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x77f1('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x77f1('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x77f1('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x77f1('0x7')]('in',_0x77f1('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x77f1('0x4')](_0x77f1('0x8'))},'lastMsgText':{'type':Sequelize[_0x77f1('0x4')](_0x77f1('0x8'))}}; \ No newline at end of file +var _0x6543=['TEXT','long','BOOLEAN','out','iconv','DATE','STRING'];(function(_0x138d25,_0x3824e5){var _0x51d564=function(_0x520dbf){while(--_0x520dbf){_0x138d25['push'](_0x138d25['shift']());}};_0x51d564(++_0x3824e5);}(_0x6543,0x1ee));var _0x3654=function(_0x35007a,_0x535aaa){_0x35007a=_0x35007a-0x0;var _0x5a830c=_0x6543[_0x35007a];return _0x5a830c;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x3654('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3654('0x1')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3654('0x2')]},'inReplyTo':{'type':Sequelize[_0x3654('0x2')](0x1fe)},'to':{'type':Sequelize[_0x3654('0x2')]},'cc':{'type':Sequelize[_0x3654('0x3')](_0x3654('0x4'))},'subject':{'type':Sequelize[_0x3654('0x3')]()},'attach':{'type':Sequelize[_0x3654('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x3654('0x2')](0x3c)},'substatusAt':{'type':Sequelize[_0x3654('0x1')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x3654('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3654('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3654('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x3654('0x3')]('long')},'lastMsgText':{'type':Sequelize[_0x3654('0x3')](_0x3654('0x4'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index db61173..dec89c7 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 _0x5566=['QueryTypes','SELECT','clone','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','expr','sequelize','keyBy','merge','Account.key','a.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.subject','i.disposition','i.to','i.MailAccountId','c.firstName','Contact.firstName','Contact.lastName','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','map','groupBy','MailInteractionId','enableEmailPreview','all','show','params','fields','includeAll','include','options','find','create','body','describe','addMessage','MailMessage','ids','omit','getMessages','rawAttributes','$gte','split','findAll','rows','addTags','setTags','spread','Tag','emit','mailInteractionTags:save','removeTags','download','unix','root','server','attachments','join','tmp','interaction-%s.zip','bcc','Attachment','Attachments','each','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','existsSync','type','build','writeFileSync','message%d.eml','log','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','html-to-text','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','Users','TagIds','Tags','push','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','select','field','color','from','tools_tags','COUNT(*)','mail_messages','where','me.MailInteractionId\x20=\x20i.id','me.read\x20=\x20false','u.id','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','advancedFilter','forEach','createdAt','value','dateStart','startOf','day','format','endOf','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','TagId','unreadMessages','isArray','and','\x20IN\x20?','tableAlias','\x20=\x20?','LIKE','ContactId','\x20LIKE\x20?','c.lastName','\x20>\x20?','\x20<\x20?','c.email','filter','isNil','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','parse','$lte','null','\x20IS\x20NULL','replace','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','toString','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','DESC','group','i.id'];(function(_0xee5d2a,_0x534134){var _0x346948=function(_0x458fdf){while(--_0x458fdf){_0xee5d2a['push'](_0xee5d2a['shift']());}};_0x346948(++_0x534134);}(_0x5566,0x140));var _0x6556=function(_0x245e0f,_0x17bccf){_0x245e0f=_0x245e0f-0x0;var _0x1818f7=_0x5566[_0x245e0f];return _0x1818f7;};'use strict';var pdf=require(_0x6556('0x0'));var emlformat=require(_0x6556('0x1'));var rimraf=require(_0x6556('0x2'));var zipdir=require(_0x6556('0x3'));var jsonpatch=require(_0x6556('0x4'));var rp=require(_0x6556('0x5'));var moment=require(_0x6556('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x6556('0x7'));var util=require(_0x6556('0x8'));var path=require(_0x6556('0x9'));var sox=require(_0x6556('0xa'));var csv=require(_0x6556('0xb'));var ejs=require(_0x6556('0xc'));var fs=require('fs');var _=require(_0x6556('0xd'));var squel=require(_0x6556('0xe'));var crypto=require(_0x6556('0xf'));var jsforce=require(_0x6556('0x10'));var deskjs=require(_0x6556('0x11'));var toCsv=require('to-csv');var querystring=require(_0x6556('0x12'));var Papa=require('papaparse');var htmlToText=require(_0x6556('0x13'));var Redis=require(_0x6556('0x14'));var authService=require(_0x6556('0x15'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6556('0x16'));var logger=require(_0x6556('0x17'))(_0x6556('0x18'));var utils=require('../../config/utils');var config=require(_0x6556('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x6556('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6556('0x1b'))(new Redis(config[_0x6556('0x1c')]));require(_0x6556('0x1d'))['register'](socket);function respondWithStatusCode(_0x375e53,_0xc5e0a9){_0xc5e0a9=_0xc5e0a9||0xcc;return function(_0x3b7ec4){if(_0x3b7ec4){return _0x375e53['sendStatus'](_0xc5e0a9);}return _0x375e53[_0x6556('0x1e')](_0xc5e0a9)[_0x6556('0x1f')]();};}function respondWithResult(_0x2c177c,_0x434be3){_0x434be3=_0x434be3||0xc8;return function(_0x200a24){if(_0x200a24){return _0x2c177c['status'](_0x434be3)[_0x6556('0x20')](_0x200a24);}};}function respondWithFilteredResult(_0x162b05,_0x198912){return function(_0x2ab5e2){if(_0x2ab5e2){var _0x592687=_0x2ab5e2[_0x6556('0x21')],_0x2f6c41=_0x198912['offset'],_0x4f705d=_0x198912['offset']+_0x198912[_0x6556('0x22')],_0x53336d;if(_0x4f705d>=_0x592687){_0x4f705d=_0x592687;_0x53336d=0xc8;}else{_0x53336d=0xce;}_0x162b05[_0x6556('0x1e')](_0x53336d);return _0x162b05[_0x6556('0x23')](_0x6556('0x24'),_0x2f6c41+'-'+_0x4f705d+'/'+_0x592687)[_0x6556('0x20')](_0x2ab5e2);}return null;};}function patchUpdates(_0x2e905c){return function(_0x402096){try{jsonpatch[_0x6556('0x25')](_0x402096,_0x2e905c,!![]);}catch(_0x2aaadf){return BPromise[_0x6556('0x26')](_0x2aaadf);}return _0x402096[_0x6556('0x27')]();};}function saveUpdates(_0x5870be,_0x5b9280){return function(_0xeb672a){if(_0xeb672a){return _0xeb672a[_0x6556('0x28')](_0x5870be)[_0x6556('0x29')](function(_0x1bd1b7){return _0x1bd1b7;});}return null;};}function removeEntity(_0x15feb8,_0x1589a0){return function(_0x47ff44){if(_0x47ff44){return _0x47ff44['destroy']()[_0x6556('0x29')](function(){_0x15feb8['status'](0xcc)[_0x6556('0x1f')]();});}};}function handleEntityNotFound(_0x55852d,_0x38a955){return function(_0x6fd62a){if(!_0x6fd62a){_0x55852d[_0x6556('0x2a')](0x194);}return _0x6fd62a;};}function handleError(_0x59e405,_0x341fed){_0x341fed=_0x341fed||0x1f4;return function(_0x3834ad){logger[_0x6556('0x2b')](_0x3834ad['stack']);if(_0x3834ad[_0x6556('0x2c')]){delete _0x3834ad['name'];}_0x59e405[_0x6556('0x1e')](_0x341fed)[_0x6556('0x2d')](_0x3834ad);};}function getInteractionUsers(_0x2de973,_0x1a28dc){return new BPromise(function(_0x589ad7,_0x5370b6){try{if(_0x1a28dc[_0x2de973['id']]){_0x2de973[_0x6556('0x2e')]=_['map'](_0x1a28dc[_0x2de973['id']],function(_0x1a9941){return{'id':_0x1a9941['id']};});}}catch(_0x520bed){_0x5370b6(_0x520bed);}_0x589ad7(_0x2de973);});}function getInteractionTags(_0x5f2903,_0x2a5cad){return new BPromise(function(_0x2dafc4,_0x43e39f){try{if(_0x5f2903[_0x6556('0x2f')]){_0x5f2903[_0x6556('0x30')]=[];_0x5f2903[_0x6556('0x2f')]['split'](',')['forEach'](function(_0x3bcb1f){_0x5f2903[_0x6556('0x30')][_0x6556('0x31')](_0x2a5cad[_0x3bcb1f]);});}delete _0x5f2903[_0x6556('0x2f')];}catch(_0x142a42){_0x43e39f(_0x142a42);}_0x2dafc4(_0x5f2903);});}function getLastMessageText(_0xf10760){return new BPromise(function(_0x2eda93,_0x5231f0){return db[_0x6556('0x32')][_0x6556('0x33')]({'where':{'id':_0xf10760['id']},'attributes':['lastMsgBody',_0x6556('0x34')],'raw':!![]})[_0x6556('0x29')](function(_0x54f8bf){if(!_0x54f8bf[_0x6556('0x34')]){_0xf10760['lastMsgText']=_[_0x6556('0x35')](htmlToText[_0x6556('0x36')](_0x54f8bf[_0x6556('0x37')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0xf10760[_0x6556('0x34')]=_0x54f8bf[_0x6556('0x34')];}_0x2eda93(_0xf10760);})[_0x6556('0x38')](function(_0x20fd68){_0x5231f0(_0x20fd68);});});}function updateMailInteraction(_0x427b6e,_0x2bbd0f,_0x1cf251,_0x1a14f7){return new BPromise(function(_0x507c2c,_0x210aed){return getInteractionUsers(_0x427b6e,_0x1cf251)[_0x6556('0x29')](function(_0x1a1c34){return getInteractionTags(_0x1a1c34,_0x2bbd0f);})[_0x6556('0x29')](function(_0x4a0885){if(_0x1a14f7){_0x507c2c(getLastMessageText(_0x4a0885));}else{_0x507c2c(_0x4a0885);}})['catch'](function(_0x132da2){_0x210aed(_0x132da2);});});}exports['index']=function(_0x1bc13c,_0x2d142b){var _0x16b4a1={},_0xda68b0={},_0x369ac3={'count':0x0,'rows':[]};var _0xb32b70=db[_0x6556('0x32')]['rawAttributes'];_0xda68b0[_0x6556('0x39')]=_[_0x6556('0x3a')](_0xb32b70);_0xda68b0[_0x6556('0x3b')]=_[_0x6556('0x3a')](_0x1bc13c['query']);_0xda68b0[_0x6556('0x3c')]=_[_0x6556('0x3d')](_0xda68b0[_0x6556('0x39')],_0xda68b0[_0x6556('0x3b')]);_0x16b4a1[_0x6556('0x3e')]=_[_0x6556('0x3d')](_0xda68b0[_0x6556('0x39')],qs['fields'](_0x1bc13c['query']['fields']));_0x16b4a1[_0x6556('0x3e')]=_0x16b4a1[_0x6556('0x3e')][_0x6556('0x3f')]?_0x16b4a1[_0x6556('0x3e')]:_0xda68b0[_0x6556('0x39')];if(!_0x1bc13c['query'][_0x6556('0x40')](_0x6556('0x41'))){_0x16b4a1[_0x6556('0x22')]=qs[_0x6556('0x22')](_0x1bc13c['query'][_0x6556('0x22')]);_0x16b4a1[_0x6556('0x42')]=qs[_0x6556('0x42')](_0x1bc13c[_0x6556('0x3b')]['offset']);}_0x16b4a1[_0x6556('0x43')]=qs['sort'](_0x1bc13c[_0x6556('0x3b')][_0x6556('0x44')]);_0x16b4a1['where']=qs[_0x6556('0x3c')](_[_0x6556('0x45')](_0x1bc13c[_0x6556('0x3b')],_0xda68b0[_0x6556('0x3c')]));var _0x5cef92=[];var _0xb4e19f=squel[_0x6556('0x46')]()[_0x6556('0x47')]('id')[_0x6556('0x47')](_0x6556('0x2c'))[_0x6556('0x47')](_0x6556('0x48'))[_0x6556('0x49')](_0x6556('0x4a'));var _0x4ddbe3=squel['select']()[_0x6556('0x47')](_0x6556('0x4b'))['from'](_0x6556('0x4c'),'me')[_0x6556('0x4d')](_0x6556('0x4e'))['where']('me.direction\x20=\x20\x27in\x27')[_0x6556('0x4d')](_0x6556('0x4f'));var _0x365131=squel[_0x6556('0x46')]()['field'](_0x6556('0x50'))[_0x6556('0x47')](_0x6556('0x51'))['from']('user_has_mail_interactions','ui')[_0x6556('0x52')](_0x6556('0x53'),'u',_0x6556('0x54'));var _0x3ec6fa=squel['select']()[_0x6556('0x49')](_0x6556('0x55'),'i')[_0x6556('0x52')](_0x6556('0x56'),'c',_0x6556('0x57'))[_0x6556('0x52')](_0x6556('0x53'),'o',_0x6556('0x58'))[_0x6556('0x52')](_0x6556('0x59'),'a',_0x6556('0x5a'))['left_join']('mail_messages','me',_0x6556('0x5b'));var _0x147f4f=squel['expr']();if(_0x1bc13c[_0x6556('0x3b')][_0x6556('0x5c')]){var _0x10a26f=JSON['parse'](_0x1bc13c['query'][_0x6556('0x5c')]);_[_0x6556('0x3a')](_0x10a26f)[_0x6556('0x5d')](function(_0x12c8b4){var _0xaff13e=_0x10a26f[_0x12c8b4];if(_0x12c8b4===_0x6556('0x5e')){var _0x5551c7=moment(_0xaff13e[_0x6556('0x5f')][_0x6556('0x60')])[_0x6556('0x61')](_0x6556('0x62'))['utc']()[_0x6556('0x63')]();var _0x34488e=moment(_0x34488e)['utc']()[_0x6556('0x64')]('day')[_0x6556('0x63')]();_0x147f4f['and'](_0x6556('0x65'),_0x5551c7,_0x34488e);}else{if(_['isArray'](_0xaff13e[_0x6556('0x66')])){_0xaff13e[_0x6556('0x66')][_0x6556('0x5d')](function(_0x1c4404){switch(_0xaff13e[_0x6556('0x66')][_0x6556('0x5f')]){case'IS':if(_0x12c8b4!==_0x6556('0x67')&&_0x12c8b4!==_0x6556('0x68')){if(_[_0x6556('0x69')](_0xaff13e[_0x6556('0x5f')])&&_0xaff13e[_0x6556('0x5f')][_0x6556('0x3f')]>0x1){_0x147f4f[_0x6556('0x6a')](_0xaff13e['tableAlias']+'.'+_0x12c8b4+_0x6556('0x6b'),_0xaff13e[_0x6556('0x5f')]);}else{_0x147f4f[_0x6556('0x6a')](_0xaff13e[_0x6556('0x6c')]+'.'+_0x12c8b4+'\x20=\x20?',_0xaff13e[_0x6556('0x5f')][0x0]);}}break;case'=':_0x147f4f[_0x6556('0x6a')](_0xaff13e[_0x6556('0x6c')]+'.'+_0x12c8b4+_0x6556('0x6d'),_0xaff13e[_0x6556('0x5f')]);break;case _0x6556('0x6e'):if(_0x12c8b4===_0x6556('0x6f')){_0x147f4f[_0x6556('0x6a')]('c.firstName'+_0x6556('0x70'),'%'+_0xaff13e[_0x6556('0x5f')]+'%');_0x147f4f['or'](_0x6556('0x71')+_0x6556('0x70'),'%'+_0xaff13e[_0x6556('0x5f')]+'%');_0x147f4f['or']('c.email'+_0x6556('0x70'),'%'+_0xaff13e[_0x6556('0x5f')]+'%');}else{_0x147f4f[_0x6556('0x6a')](_0xaff13e[_0x6556('0x6c')]+'.'+_0x12c8b4+_0x6556('0x70'),'%'+_0xaff13e[_0x6556('0x5f')]+'%');}break;case'>':_0x147f4f['and'](_0xaff13e[_0x6556('0x6c')]+'.'+_0x12c8b4+_0x6556('0x72'),_0xaff13e[_0x6556('0x5f')]);break;case'<':_0x147f4f['and'](_0xaff13e[_0x6556('0x6c')]+'.'+_0x12c8b4+_0x6556('0x73'),_0xaff13e[_0x6556('0x5f')]);break;}});}else{switch(_0xaff13e[_0x6556('0x66')]['value']){case'IS':if(_0x12c8b4!==_0x6556('0x67')&&_0x12c8b4!==_0x6556('0x68')){if(_[_0x6556('0x69')](_0xaff13e[_0x6556('0x5f')])&&_0xaff13e[_0x6556('0x5f')]['length']>0x1){_0x147f4f[_0x6556('0x6a')](_0xaff13e['tableAlias']+'.'+_0x12c8b4+'\x20IN\x20?',_0xaff13e['value']);}else{_0x147f4f[_0x6556('0x6a')](_0xaff13e['tableAlias']+'.'+_0x12c8b4+_0x6556('0x6d'),_0xaff13e[_0x6556('0x5f')][0x0]);}}break;case'=':_0x147f4f[_0x6556('0x6a')](_0xaff13e[_0x6556('0x6c')]+'.'+_0x12c8b4+_0x6556('0x6d'),_0xaff13e['value']);break;case _0x6556('0x6e'):if(_0x12c8b4===_0x6556('0x6f')){_0x147f4f[_0x6556('0x6a')]('c.firstName'+_0x6556('0x70'),'%'+_0xaff13e[_0x6556('0x5f')]+'%');_0x147f4f['or'](_0x6556('0x71')+_0x6556('0x70'),'%'+_0xaff13e['value']+'%');_0x147f4f['or'](_0x6556('0x74')+'\x20LIKE\x20?','%'+_0xaff13e['value']+'%');}else{_0x147f4f['and'](_0xaff13e[_0x6556('0x6c')]+'.'+_0x12c8b4+_0x6556('0x70'),'%'+_0xaff13e[_0x6556('0x5f')]+'%');}break;case'>':_0x147f4f[_0x6556('0x6a')](_0xaff13e['tableAlias']+'.'+_0x12c8b4+_0x6556('0x72'),_0xaff13e[_0x6556('0x5f')]);break;case'<':_0x147f4f['and'](_0xaff13e[_0x6556('0x6c')]+'.'+_0x12c8b4+'\x20<\x20?',_0xaff13e[_0x6556('0x5f')]);break;}}}});}else{var _0x3ad751=_(Object[_0x6556('0x3a')](_0x1bc13c[_0x6556('0x3b')]))['map'](function(_0x37ae8d){return _0xb32b70[_0x6556('0x40')](_0x37ae8d)?_0x37ae8d:undefined;})[_0x6556('0x75')](function(_0x1d1c21){return!_[_0x6556('0x76')](_0x1d1c21);})['value']();if(!_[_0x6556('0x77')](_0x3ad751)){_0x3ad751[_0x6556('0x5d')](function(_0x59f4a6){if(_0x59f4a6===_0x6556('0x78')){_0x3ec6fa[_0x6556('0x4d')](_0x6556('0x79'),[][_0x6556('0x7a')](_0x1bc13c[_0x6556('0x3b')][_0x59f4a6]));}else if(_0x59f4a6===_0x6556('0x5e')){var _0x5a59de=JSON[_0x6556('0x7b')](_0x1bc13c[_0x6556('0x3b')][_0x59f4a6])['$gte'];var _0x34e0b6=JSON[_0x6556('0x7b')](_0x1bc13c[_0x6556('0x3b')][_0x59f4a6])[_0x6556('0x7c')];_0x3ec6fa[_0x6556('0x4d')](_0x6556('0x65'),_0x5a59de,_0x34e0b6);}else{if(_0x1bc13c['query'][_0x59f4a6]===_0x6556('0x7d')){_0x3ec6fa[_0x6556('0x4d')]('i.'+_0x59f4a6+_0x6556('0x7e'));}else{_0x3ec6fa[_0x6556('0x4d')]('i.'+_0x59f4a6+_0x6556('0x6d'),_0x1bc13c[_0x6556('0x3b')][_0x59f4a6]);}}});}if(_0x1bc13c[_0x6556('0x3b')][_0x6556('0x75')]){var _0x21dcad=_0x1bc13c['query']['filter']['replace']('\x5c','\x5c\x5c')[_0x6556('0x7f')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x21dcad)){_0x147f4f['or'](_0x6556('0x80'),_0x21dcad+'%');}else if(qs[_0x6556('0x81')](_0x21dcad)){_0x147f4f['or'](_0x6556('0x82'),_0x21dcad+'%');}else{var _0x46753e=[];_0x21dcad['split']('\x20')[_0x6556('0x5d')](function(_0x5090f9){_0x46753e['push']('+'+_0x5090f9[_0x6556('0x83')]());});var _0xc95147=_0x46753e['join']('\x20');_0x147f4f['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0xc95147)['or'](_0x6556('0x84'),_0xc95147);}}}_0x3ec6fa[_0x6556('0x4d')](_0x147f4f);if(_0x16b4a1['order']){_0x16b4a1[_0x6556('0x43')][_0x6556('0x5d')](function(_0x1d289f){_0x3ec6fa['order']('i.'+_0x1d289f[0x0],_0x1d289f[0x1]===_0x6556('0x85')?![]:!![]);});}_0x3ec6fa[_0x6556('0x86')](_0x6556('0x87'));var _0x56efc9={'type':db['Sequelize'][_0x6556('0x88')][_0x6556('0x89')],'raw':!![]};var _0x5a7b10=_0x3ec6fa[_0x6556('0x8a')]()[_0x6556('0x47')](_0x6556('0x4b'))[_0x6556('0x47')](_0x6556('0x8b'),_0x6556('0x68'));if(!_0x1bc13c[_0x6556('0x3b')][_0x6556('0x5c')]){if(_0x1bc13c[_0x6556('0x3b')]['read']){if(_0x1bc13c[_0x6556('0x3b')][_0x6556('0x8c')]==0x1){_0x5a7b10[_0x6556('0x8d')](_0x6556('0x8e'));_0x3ec6fa[_0x6556('0x8d')](_0x6556('0x8e'));}else{_0x5a7b10[_0x6556('0x8d')](_0x6556('0x8f'));_0x3ec6fa[_0x6556('0x8d')]('`unreadMessages`\x20>\x200');}}if(_0x1bc13c[_0x6556('0x3b')][_0x6556('0x90')]){var _0x18bd93=_['isArray'](_0x1bc13c['query'][_0x6556('0x90')])?_0x1bc13c[_0x6556('0x3b')][_0x6556('0x90')]:new Array(_0x1bc13c[_0x6556('0x3b')]['tag']);var _0x444a7c=squel['expr']();_0x18bd93[_0x6556('0x5d')](function(_0x43edd4){_0x444a7c['or'](_0x6556('0x91'),'%,'+_0x43edd4+',%');});_0x3ec6fa[_0x6556('0x8d')](_0x444a7c);_0x5a7b10[_0x6556('0x52')](_0x6556('0x92'),'it',_0x6556('0x93'));_0x5a7b10['left_join'](_0x6556('0x4a'),'t',_0x6556('0x94'));_0x5a7b10[_0x6556('0x4d')](_0x6556('0x95'),_0x18bd93);}}else{var _0x10a26f=JSON[_0x6556('0x7b')](_0x1bc13c[_0x6556('0x3b')][_0x6556('0x5c')]);_[_0x6556('0x3a')](_0x10a26f)['forEach'](function(_0x5c2568){var _0x1b2536=_0x10a26f[_0x5c2568];if(_0x5c2568==='TagId'){var _0x1a12cc=_0x1b2536[_0x6556('0x5f')];var _0x15be46=squel[_0x6556('0x96')]();_0x1a12cc[_0x6556('0x5d')](function(_0x3ac44e){_0x15be46['or'](_0x6556('0x91'),'%,'+_0x3ac44e+',%');});_0x3ec6fa['having'](_0x15be46);_0x5a7b10[_0x6556('0x52')](_0x6556('0x92'),'it',_0x6556('0x93'));_0x5a7b10[_0x6556('0x52')](_0x6556('0x4a'),'t',_0x6556('0x94'));_0x5a7b10['where'](_0x6556('0x95'),_0x1a12cc);}else if(_0x5c2568==='unreadMessages'){if(_0x1b2536[_0x6556('0x5f')][_0x6556('0x3f')]===0x1){if(_0x1b2536[_0x6556('0x5f')][0x0]===0x1){_0x5a7b10['having'](_0x6556('0x8e'));_0x3ec6fa[_0x6556('0x8d')]('`unreadMessages`\x20=\x200');}else{_0x5a7b10[_0x6556('0x8d')]('`unreadMessages`\x20>\x200');_0x3ec6fa[_0x6556('0x8d')](_0x6556('0x8f'));}}}});}db[_0x6556('0x97')][_0x6556('0x3b')](_0x5a7b10[_0x6556('0x83')](),_0x56efc9)[_0x6556('0x29')](function(_0x13df9d){_0x369ac3[_0x6556('0x21')]=_0x13df9d[_0x6556('0x3f')];if(_0x369ac3[_0x6556('0x21')]===0x0)return[];return db[_0x6556('0x97')][_0x6556('0x3b')](_0xb4e19f['toString'](),_0x56efc9)['then'](function(_0x38c25e){_0x5cef92=_[_0x6556('0x98')](_0x38c25e,'id');_0x56efc9=_[_0x6556('0x99')](_0x56efc9,{'model':db[_0x6556('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x3ec6fa[_0x6556('0x47')](_0x6556('0x8b'),'unreadMessages');_0x3ec6fa[_0x6556('0x47')]('a.key',_0x6556('0x9a'));_0x3ec6fa['field'](_0x6556('0x9b'),'Account.mandatoryDisposition');_0x3ec6fa[_0x6556('0x47')](_0x6556('0x87'));_0x3ec6fa[_0x6556('0x47')](_0x6556('0x9c'));_0x3ec6fa[_0x6556('0x47')](_0x6556('0x9d'));_0x3ec6fa[_0x6556('0x47')](_0x6556('0x9e'));_0x3ec6fa[_0x6556('0x47')](_0x6556('0x9f'));_0x3ec6fa[_0x6556('0x47')](_0x6556('0xa0'));_0x3ec6fa['field']('i.lastMsgAt');_0x3ec6fa[_0x6556('0x47')]('i.lastMsgDirection');_0x3ec6fa[_0x6556('0x47')](_0x6556('0xa1'));_0x3ec6fa['field'](_0x6556('0xa2'));_0x3ec6fa['field']('i.substatus');_0x3ec6fa[_0x6556('0x47')](_0x6556('0xa3'));_0x3ec6fa[_0x6556('0x47')]('i.ContactId');_0x3ec6fa['field'](_0x6556('0xa4'));_0x3ec6fa[_0x6556('0x47')]('i.UserId');_0x3ec6fa[_0x6556('0x47')](_0x6556('0xa5'),_0x6556('0xa6'));_0x3ec6fa[_0x6556('0x47')](_0x6556('0x71'),_0x6556('0xa7'));_0x3ec6fa[_0x6556('0x47')]('c.email','Contact.email');_0x3ec6fa[_0x6556('0x47')](_0x6556('0xa8'),_0x6556('0xa9'));_0x3ec6fa['field'](_0x6556('0xaa'),'Contact.mobile');_0x3ec6fa[_0x6556('0x47')](_0x6556('0xab'),_0x6556('0xac'));_0x3ec6fa[_0x6556('0x47')](_0x6556('0xad'),_0x6556('0x2f'));_0x3ec6fa[_0x6556('0x52')](_0x6556('0x92'),'it',_0x6556('0x93'));_0x3ec6fa[_0x6556('0x52')]('tools_tags','t',_0x6556('0x94'));_0x3ec6fa['limit'](_0x16b4a1[_0x6556('0x22')]);_0x3ec6fa['offset'](_0x16b4a1[_0x6556('0x42')]);return db['sequelize'][_0x6556('0x3b')](_0x3ec6fa[_0x6556('0x83')](),_0x56efc9);})['then'](function(_0x471ec2){_0x365131[_0x6556('0x4d')](_0x6556('0xae'),_[_0x6556('0xaf')](_0x471ec2,'id'));return db[_0x6556('0x97')][_0x6556('0x3b')](_0x365131[_0x6556('0x83')](),_0x56efc9)[_0x6556('0x29')](function(_0x448b8d){var _0x208e48=_[_0x6556('0xb0')](_0x448b8d,_0x6556('0xb1'));var _0x32e519=[];return db['Setting'][_0x6556('0x33')]({'attributes':[_0x6556('0xb2')],'raw':!![]})[_0x6556('0x29')](function(_0x543ae2){var _0x21edf4=_0x543ae2[_0x6556('0xb2')];_0x471ec2['forEach'](function(_0x52ab9d){_0x32e519[_0x6556('0x31')](updateMailInteraction(_0x52ab9d,_0x5cef92,_0x208e48,_0x21edf4));});return BPromise[_0x6556('0xb3')](_0x32e519);});});});})[_0x6556('0x29')](function(_0x5b7920){_0x369ac3['rows']=_0x5b7920;return _0x369ac3;})['then'](respondWithFilteredResult(_0x2d142b,_0x16b4a1))[_0x6556('0x38')](handleError(_0x2d142b,null));};exports[_0x6556('0xb4')]=function(_0x2790fd,_0xb10e5){var _0xf01248={'raw':![],'where':{'id':_0x2790fd[_0x6556('0xb5')]['id']}},_0x86230={};_0x86230[_0x6556('0x39')]=_[_0x6556('0x3a')](db[_0x6556('0x32')]['rawAttributes']);_0x86230[_0x6556('0x3b')]=_[_0x6556('0x3a')](_0x2790fd['query']);_0x86230[_0x6556('0x3c')]=_['intersection'](_0x86230[_0x6556('0x39')],_0x86230[_0x6556('0x3b')]);_0xf01248[_0x6556('0x3e')]=_[_0x6556('0x3d')](_0x86230['model'],qs[_0x6556('0xb6')](_0x2790fd['query'][_0x6556('0xb6')]));_0xf01248[_0x6556('0x3e')]=_0xf01248[_0x6556('0x3e')][_0x6556('0x3f')]?_0xf01248['attributes']:_0x86230[_0x6556('0x39')];if(_0x2790fd[_0x6556('0x3b')][_0x6556('0xb7')]){_0xf01248[_0x6556('0xb8')]=[{'all':!![]}];}_0xf01248=_[_0x6556('0x99')]({},_0xf01248,_0x2790fd[_0x6556('0xb9')]);return db['MailInteraction'][_0x6556('0xba')](_0xf01248)[_0x6556('0x29')](handleEntityNotFound(_0xb10e5,null))[_0x6556('0x29')](respondWithResult(_0xb10e5,null))[_0x6556('0x38')](handleError(_0xb10e5,null));};exports[_0x6556('0xbb')]=function(_0x4c98d3,_0x17ef9d){return db[_0x6556('0x32')][_0x6556('0xbb')](_0x4c98d3[_0x6556('0xbc')],{})['then'](respondWithResult(_0x17ef9d,0xc9))[_0x6556('0x38')](handleError(_0x17ef9d,null));};exports[_0x6556('0x28')]=function(_0x58f8ad,_0x518852){if(_0x58f8ad[_0x6556('0xbc')]['id']){delete _0x58f8ad[_0x6556('0xbc')]['id'];}return db[_0x6556('0x32')]['find']({'where':{'id':_0x58f8ad[_0x6556('0xb5')]['id']}})['then'](handleEntityNotFound(_0x518852,null))['then'](saveUpdates(_0x58f8ad[_0x6556('0xbc')],null))[_0x6556('0x29')](respondWithResult(_0x518852,null))[_0x6556('0x38')](handleError(_0x518852,null));};exports['destroy']=function(_0x9f95df,_0x45c58e){return db[_0x6556('0x32')][_0x6556('0xba')]({'where':{'id':_0x9f95df[_0x6556('0xb5')]['id']}})['then'](handleEntityNotFound(_0x45c58e,null))['then'](removeEntity(_0x45c58e,null))[_0x6556('0x38')](handleError(_0x45c58e,null));};exports[_0x6556('0xbd')]=function(_0x7d4099,_0x22bcd3){return db[_0x6556('0x32')][_0x6556('0xbd')]()[_0x6556('0x29')](respondWithResult(_0x22bcd3,null))[_0x6556('0x38')](handleError(_0x22bcd3,null));};exports[_0x6556('0xbe')]=function(_0x34beea,_0x16eef4,_0x5aa544){return db[_0x6556('0xbf')][_0x6556('0xba')]({'where':{'id':_0x34beea[_0x6556('0xb5')]['id']}})[_0x6556('0x29')](handleEntityNotFound(_0x16eef4,null))[_0x6556('0x29')](function(_0x21c621){if(_0x21c621){return _0x21c621[_0x6556('0xbe')](_0x34beea[_0x6556('0xbc')][_0x6556('0xc0')],_[_0x6556('0xc1')](_0x34beea['body'],[_0x6556('0xc0'),'id'])||{});}})[_0x6556('0x29')](respondWithResult(_0x16eef4,null))[_0x6556('0x38')](handleError(_0x16eef4,null));};exports[_0x6556('0xc2')]=function(_0x3c24f0,_0x3086e9,_0x3d4c81){var _0x201b9f={'raw':![],'where':{}};var _0xb4d27d={};var _0x2dfec4={'count':0x0,'rows':[]};return db[_0x6556('0x32')][_0x6556('0x33')]({'where':{'id':_0x3c24f0[_0x6556('0xb5')]['id']}})[_0x6556('0x29')](handleEntityNotFound(_0x3086e9,null))[_0x6556('0x29')](function(_0x138f85){if(_0x138f85){_0xb4d27d[_0x6556('0x39')]=_[_0x6556('0x3a')](db['MailMessage'][_0x6556('0xc3')]);_0xb4d27d['query']=_[_0x6556('0x3a')](_0x3c24f0[_0x6556('0x3b')]);_0xb4d27d[_0x6556('0x3c')]=_['intersection'](_0xb4d27d[_0x6556('0x39')],_0xb4d27d['query']);_0x201b9f[_0x6556('0x3e')]=_[_0x6556('0x3d')](_0xb4d27d[_0x6556('0x39')],qs[_0x6556('0xb6')](_0x3c24f0[_0x6556('0x3b')][_0x6556('0xb6')]));_0x201b9f[_0x6556('0x3e')]=_0x201b9f['attributes'][_0x6556('0x3f')]?_0x201b9f[_0x6556('0x3e')]:_0xb4d27d['model'];if(!_0x3c24f0[_0x6556('0x3b')]['hasOwnProperty']('nolimit')){_0x201b9f['limit']=qs[_0x6556('0x22')](_0x3c24f0[_0x6556('0x3b')]['limit']);_0x201b9f[_0x6556('0x42')]=qs[_0x6556('0x42')](_0x3c24f0[_0x6556('0x3b')]['offset']);}_0x201b9f[_0x6556('0x43')]=qs[_0x6556('0x44')](_0x3c24f0[_0x6556('0x3b')][_0x6556('0x44')]);_0x201b9f[_0x6556('0x4d')]=qs['filters'](_[_0x6556('0x45')](_0x3c24f0[_0x6556('0x3b')],_0xb4d27d['filters']));_0x201b9f[_0x6556('0x4d')][_0x6556('0xb1')]=_0x138f85['id'];if(_0x3c24f0[_0x6556('0x3b')][_0x6556('0x75')]){_0x201b9f[_0x6556('0x4d')]=_[_0x6556('0x99')](_0x201b9f[_0x6556('0x4d')],{'$or':_[_0x6556('0xaf')](_0x201b9f[_0x6556('0x3e')],function(_0x369e84){var _0xb9d541={};_0xb9d541[_0x369e84]={'$like':'%'+_0x3c24f0['query']['filter']+'%'};return _0xb9d541;})});}if(_0x3c24f0[_0x6556('0x3b')][_0x6556('0xc4')]){var _0x1c427f=_0x3c24f0[_0x6556('0x3b')][_0x6556('0xc4')][_0x6556('0xc5')](',');var _0x1efd85={};_0x1efd85[_0x1c427f[0x0]]={'$gte':moment(_0x1c427f[0x1])[_0x6556('0x63')]('YYYY-MM-DD\x20HH:mm:ss')};_0x201b9f[_0x6556('0x4d')]=_[_0x6556('0x99')](_0x201b9f['where'],_0x1efd85);}_0x201b9f=_[_0x6556('0x99')]({},_0x201b9f,_0x3c24f0[_0x6556('0xb9')]);return db['MailMessage'][_0x6556('0x21')]({'where':_0x201b9f[_0x6556('0x4d')]})['then'](function(_0x35968e){_0x2dfec4['count']=_0x35968e;if(_0x3c24f0['query'][_0x6556('0xb7')]){_0x201b9f[_0x6556('0xb8')]=[{'all':!![]}];}return db[_0x6556('0xbf')][_0x6556('0xc6')](_0x201b9f);})[_0x6556('0x29')](function(_0x20199d){_0x2dfec4[_0x6556('0xc7')]=_0x20199d;return _0x2dfec4;});}})['then'](respondWithFilteredResult(_0x3086e9,_0x201b9f))[_0x6556('0x38')](handleError(_0x3086e9,null));};exports[_0x6556('0xc8')]=function(_0x100350,_0x1c6931,_0xcaa775){return db[_0x6556('0x32')]['find']({'where':{'id':_0x100350['params']['id']}})[_0x6556('0x29')](handleEntityNotFound(_0x1c6931,null))['then'](function(_0x314238){if(_0x314238){return _0x314238[_0x6556('0xc9')](_0x100350[_0x6556('0xbc')][_0x6556('0xc0')],_[_0x6556('0xc1')](_0x100350[_0x6556('0xbc')],['ids','id'])||{})[_0x6556('0xca')](function(){return db[_0x6556('0xcb')][_0x6556('0xc6')]({'attributes':['id','name',_0x6556('0x48')],'where':{'id':_0x100350['body'][_0x6556('0xc0')]}});})[_0x6556('0x29')](function(_0xe05876){socket[_0x6556('0xcc')](_0x6556('0xcd'),{'id':Number(_0x100350[_0x6556('0xb5')]['id']),'tags':_0xe05876||[]});return{'id':Number(_0x100350[_0x6556('0xb5')]['id']),'tags':_0xe05876||[]};});}})[_0x6556('0x29')](respondWithResult(_0x1c6931,null))[_0x6556('0x38')](handleError(_0x1c6931,null));};exports['removeTags']=function(_0x3ded1d,_0x3406b4,_0x53278a){return db[_0x6556('0x32')][_0x6556('0xba')]({'where':{'id':_0x3ded1d[_0x6556('0xb5')]['id']}})[_0x6556('0x29')](handleEntityNotFound(_0x3406b4,null))[_0x6556('0x29')](function(_0xa3e49c){if(_0xa3e49c){return _0xa3e49c[_0x6556('0xce')](_0x3ded1d[_0x6556('0x3b')]['ids']);}})[_0x6556('0x29')](respondWithStatusCode(_0x3406b4,null))[_0x6556('0x38')](handleError(_0x3406b4,null));};exports[_0x6556('0xcf')]=function(_0x25b33d,_0x33f713){var _0x1efad9=moment()[_0x6556('0xd0')]()['toString']();var _0x3160f1=path['join'](config[_0x6556('0xd1')],_0x6556('0xd2'),'files',_0x6556('0xd3'));var _0x361d2d=path[_0x6556('0xd4')](config['root'],_0x6556('0xd2'),'files',_0x6556('0xd5'));var _0x9fac80=path['join'](_0x361d2d,_0x1efad9);var _0x281c0c=util[_0x6556('0x63')](_0x6556('0xd6'),_0x1efad9);var _0x3aa872=path[_0x6556('0xd4')](_0x361d2d,_0x281c0c);var _0xf9d1ed=![];return db[_0x6556('0x32')][_0x6556('0xba')]({'where':{'id':_0x25b33d[_0x6556('0xb5')]['id']}})['then'](handleEntityNotFound(_0x33f713,null))['then'](function(_0x5cf697){if(_0x5cf697){return _0x5cf697[_0x6556('0xc2')]({'attributes':['id',_0x6556('0xbc'),'from','to','cc',_0x6556('0xd7'),'subject',_0x6556('0x5e')],'where':{'secret':![]},'include':_0x25b33d[_0x6556('0x3b')][_0x6556('0xd3')]?[{'model':db[_0x6556('0xd8')],'as':_0x6556('0xd9')}]:undefined,'order':qs[_0x6556('0x44')]('id')});}return[];})[_0x6556('0x29')](function(_0x4fa911){_0xf9d1ed=_0x4fa911['length'];if(_0x4fa911['length']){fs['mkdirSync'](_0x9fac80);return BPromise[_0x6556('0xda')](_0x4fa911,function(_0x41ac8f,_0x2059e0){var _0x45c17a=_0x41ac8f;var _0x1c95f8={'from':_0x45c17a[_0x6556('0x49')],'to':_0x45c17a['to'],'subject':_0x45c17a[_0x6556('0xdb')],'html':_0x45c17a[_0x6556('0xbc')],'headers':{'Date':moment(_0x45c17a[_0x6556('0x5e')])[_0x6556('0x63')](_0x6556('0xdc'))},'attachments':[]};if(_0x41ac8f['cc']){_0x1c95f8['headers']['Cc']=_0x41ac8f['cc'];}if(_0x41ac8f[_0x6556('0xd7')]){_0x1c95f8['headers']['Bcc']=_0x41ac8f[_0x6556('0xd7')];}return new BPromise(function(_0x69d5f6,_0x5e05e4){if(_0x41ac8f['Attachments']){for(var _0x3e5663=0x0;_0x3e5663<_0x41ac8f[_0x6556('0xd9')][_0x6556('0x3f')];_0x3e5663++){var _0x2ac05d=_0x41ac8f[_0x6556('0xd9')][_0x3e5663];var _0x38a38a=path[_0x6556('0xd4')](_0x3160f1,_0x2ac05d['basename']);if(fs[_0x6556('0xdd')](_0x38a38a)){_0x1c95f8[_0x6556('0xd3')][_0x6556('0x31')]({'name':_0x2ac05d['name'],'contentType':_0x2ac05d[_0x6556('0xde')],'data':fs['readFileSync'](_0x38a38a)});}}}emlformat[_0x6556('0xdf')](_0x1c95f8,function(_0x3fe17a,_0x413b36){if(_0x3fe17a)return _0x5e05e4(_0x3fe17a);fs[_0x6556('0xe0')](path[_0x6556('0xd4')](_0x9fac80,util[_0x6556('0x63')](_0x6556('0xe1'),_0x2059e0)),_0x413b36);return _0x69d5f6(_0x413b36);});});});}})[_0x6556('0x29')](function(){if(_0xf9d1ed){return new BPromise(function(_0x38348a,_0x51606d){zipdir(_0x9fac80,{'saveTo':_0x3aa872},function(_0xc3d6b0,_0x164f4f){if(_0xc3d6b0)return _0x51606d(_0xc3d6b0);return _0x38348a(_0x164f4f);});});}})[_0x6556('0x29')](function(){if(_0xf9d1ed){return new BPromise(function(_0x32170c,_0x51885a){rimraf(_0x9fac80,function(_0x29c4f0){if(_0x29c4f0)_0x51885a(_0x29c4f0);return _0x32170c();});});}})[_0x6556('0x29')](function(){if(_0xf9d1ed){return _0x33f713[_0x6556('0xcf')](_0x3aa872,_0x281c0c,function(_0x24b7bb){if(_0x24b7bb){console[_0x6556('0xe2')](_0x6556('0xe3'),_0x24b7bb);}else{fs['unlinkSync'](_0x3aa872);}});}else{return _0x33f713[_0x6556('0x2a')](0xc8);}})['catch'](handleError(_0x33f713,null));}; \ No newline at end of file +var _0x3425=['replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','split','toString','join','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','DESC','group','i.id','Sequelize','QueryTypes','SELECT','COUNT(me.id)','read','`unreadMessages`\x20=\x200','having','`unreadMessages`\x20>\x200','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','sequelize','count','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.lastName','Contact.phone','Contact.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','enableEmailPreview','all','rows','show','params','filters','includeAll','create','body','update','find','describe','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','options','MailMessage','include','findAll','addTags','setTags','Tag','color','emit','mailInteractionTags:save','removeTags','unix','root','server','files','attachments','tmp','bcc','subject','Attachment','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','type','readFileSync','message%d.eml','download','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','set','reject','save','then','stack','send','Users','map','TagIds','Tags','push','MailInteraction','findOne','lastMsgBody','lastMsgText','trimStart','fromString','catch','index','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','select','field','name','from','COUNT(*)','me.MailInteractionId\x20=\x20i.id','me.read\x20=\x20false','u.id','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','parse','advancedFilter','forEach','createdAt','value','dateStart','startOf','day','format','utc','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','TagId','unreadMessages','\x20IN\x20?','filter','isEmpty','concat','$gte','$lte','null','\x20IS\x20NULL'];(function(_0x21de89,_0x367053){var _0x290b7e=function(_0x540704){while(--_0x540704){_0x21de89['push'](_0x21de89['shift']());}};_0x290b7e(++_0x367053);}(_0x3425,0x146));var _0x5342=function(_0x1ecd65,_0x4a7ec6){_0x1ecd65=_0x1ecd65-0x0;var _0x1b2609=_0x3425[_0x1ecd65];return _0x1b2609;};'use strict';var pdf=require(_0x5342('0x0'));var emlformat=require(_0x5342('0x1'));var rimraf=require(_0x5342('0x2'));var zipdir=require(_0x5342('0x3'));var jsonpatch=require(_0x5342('0x4'));var rp=require('request-promise');var moment=require(_0x5342('0x5'));var BPromise=require(_0x5342('0x6'));var Mustache=require('mustache');var util=require(_0x5342('0x7'));var path=require(_0x5342('0x8'));var sox=require(_0x5342('0x9'));var csv=require('to-csv');var ejs=require(_0x5342('0xa'));var fs=require('fs');var _=require(_0x5342('0xb'));var squel=require('squel');var crypto=require(_0x5342('0xc'));var jsforce=require(_0x5342('0xd'));var deskjs=require(_0x5342('0xe'));var toCsv=require(_0x5342('0xf'));var querystring=require(_0x5342('0x10'));var Papa=require('papaparse');var htmlToText=require(_0x5342('0x11'));var Redis=require(_0x5342('0x12'));var authService=require(_0x5342('0x13'));var qs=require(_0x5342('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5342('0x15'));var utils=require(_0x5342('0x16'));var config=require(_0x5342('0x17'));var db=require('../../mysqldb')['db'];config[_0x5342('0x18')]=_[_0x5342('0x19')](config[_0x5342('0x18')],{'host':_0x5342('0x1a'),'port':0x18eb});var socket=require(_0x5342('0x1b'))(new Redis(config[_0x5342('0x18')]));require('./mailInteraction.socket')[_0x5342('0x1c')](socket);function respondWithStatusCode(_0x3afbe0,_0x2be49f){_0x2be49f=_0x2be49f||0xcc;return function(_0x416900){if(_0x416900){return _0x3afbe0[_0x5342('0x1d')](_0x2be49f);}return _0x3afbe0[_0x5342('0x1e')](_0x2be49f)[_0x5342('0x1f')]();};}function respondWithResult(_0x34722c,_0x337b14){_0x337b14=_0x337b14||0xc8;return function(_0x35d58b){if(_0x35d58b){return _0x34722c[_0x5342('0x1e')](_0x337b14)[_0x5342('0x20')](_0x35d58b);}};}function respondWithFilteredResult(_0x4b8cf4,_0x158ae9){return function(_0x270e27){if(_0x270e27){var _0x40ee6d=_0x270e27['count'],_0x1cd0f0=_0x158ae9[_0x5342('0x21')],_0x437334=_0x158ae9[_0x5342('0x21')]+_0x158ae9['limit'],_0x49657c;if(_0x437334>=_0x40ee6d){_0x437334=_0x40ee6d;_0x49657c=0xc8;}else{_0x49657c=0xce;}_0x4b8cf4[_0x5342('0x1e')](_0x49657c);return _0x4b8cf4[_0x5342('0x22')]('Content-Range',_0x1cd0f0+'-'+_0x437334+'/'+_0x40ee6d)[_0x5342('0x20')](_0x270e27);}return null;};}function patchUpdates(_0x500975){return function(_0x40c891){try{jsonpatch['apply'](_0x40c891,_0x500975,!![]);}catch(_0x188fba){return BPromise[_0x5342('0x23')](_0x188fba);}return _0x40c891[_0x5342('0x24')]();};}function saveUpdates(_0x388804,_0x143215){return function(_0x4200a6){if(_0x4200a6){return _0x4200a6['update'](_0x388804)[_0x5342('0x25')](function(_0x1dfbba){return _0x1dfbba;});}return null;};}function removeEntity(_0x517975,_0x35f073){return function(_0x20c9e0){if(_0x20c9e0){return _0x20c9e0['destroy']()[_0x5342('0x25')](function(){_0x517975[_0x5342('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14f10b,_0x3def9a){return function(_0x37920c){if(!_0x37920c){_0x14f10b['sendStatus'](0x194);}return _0x37920c;};}function handleError(_0x2b0467,_0x560011){_0x560011=_0x560011||0x1f4;return function(_0x412c10){logger['error'](_0x412c10[_0x5342('0x26')]);if(_0x412c10['name']){delete _0x412c10['name'];}_0x2b0467[_0x5342('0x1e')](_0x560011)[_0x5342('0x27')](_0x412c10);};}function getInteractionUsers(_0x595678,_0x1a35b3){return new BPromise(function(_0x25e593,_0x7415be){try{if(_0x1a35b3[_0x595678['id']]){_0x595678[_0x5342('0x28')]=_[_0x5342('0x29')](_0x1a35b3[_0x595678['id']],function(_0x36e973){return{'id':_0x36e973['id']};});}}catch(_0x4d5fe7){_0x7415be(_0x4d5fe7);}_0x25e593(_0x595678);});}function getInteractionTags(_0x15fc26,_0x2d033d){return new BPromise(function(_0x2fec4a,_0x504e88){try{if(_0x15fc26[_0x5342('0x2a')]){_0x15fc26[_0x5342('0x2b')]=[];_0x15fc26['TagIds']['split'](',')['forEach'](function(_0x2dc658){_0x15fc26[_0x5342('0x2b')][_0x5342('0x2c')](_0x2d033d[_0x2dc658]);});}delete _0x15fc26[_0x5342('0x2a')];}catch(_0x11a041){_0x504e88(_0x11a041);}_0x2fec4a(_0x15fc26);});}function getLastMessageText(_0x20cc98){return new BPromise(function(_0x44b175,_0x1cca2e){return db[_0x5342('0x2d')][_0x5342('0x2e')]({'where':{'id':_0x20cc98['id']},'attributes':[_0x5342('0x2f'),_0x5342('0x30')],'raw':!![]})[_0x5342('0x25')](function(_0x5a71f8){if(!_0x5a71f8[_0x5342('0x30')]){_0x20cc98[_0x5342('0x30')]=_[_0x5342('0x31')](htmlToText[_0x5342('0x32')](_0x5a71f8[_0x5342('0x2f')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x20cc98[_0x5342('0x30')]=_0x5a71f8['lastMsgText'];}_0x44b175(_0x20cc98);})['catch'](function(_0x2620e8){_0x1cca2e(_0x2620e8);});});}function updateMailInteraction(_0x57a324,_0x15726f,_0x3f2bf7,_0x3c662b){return new BPromise(function(_0x48c9cb,_0x52cfc4){return getInteractionUsers(_0x57a324,_0x3f2bf7)[_0x5342('0x25')](function(_0x563430){return getInteractionTags(_0x563430,_0x15726f);})[_0x5342('0x25')](function(_0xddcb9b){if(_0x3c662b){_0x48c9cb(getLastMessageText(_0xddcb9b));}else{_0x48c9cb(_0xddcb9b);}})[_0x5342('0x33')](function(_0x57488d){_0x52cfc4(_0x57488d);});});}exports[_0x5342('0x34')]=function(_0x369e80,_0x3ac6c5){var _0x554a3d={},_0x2304c6={},_0x7ab70a={'count':0x0,'rows':[]};var _0x599508=db[_0x5342('0x2d')]['rawAttributes'];_0x2304c6[_0x5342('0x35')]=_[_0x5342('0x36')](_0x599508);_0x2304c6['query']=_['keys'](_0x369e80[_0x5342('0x37')]);_0x2304c6['filters']=_[_0x5342('0x38')](_0x2304c6[_0x5342('0x35')],_0x2304c6['query']);_0x554a3d[_0x5342('0x39')]=_[_0x5342('0x38')](_0x2304c6[_0x5342('0x35')],qs[_0x5342('0x3a')](_0x369e80[_0x5342('0x37')][_0x5342('0x3a')]));_0x554a3d[_0x5342('0x39')]=_0x554a3d[_0x5342('0x39')][_0x5342('0x3b')]?_0x554a3d[_0x5342('0x39')]:_0x2304c6[_0x5342('0x35')];if(!_0x369e80['query'][_0x5342('0x3c')](_0x5342('0x3d'))){_0x554a3d[_0x5342('0x3e')]=qs[_0x5342('0x3e')](_0x369e80['query'][_0x5342('0x3e')]);_0x554a3d[_0x5342('0x21')]=qs[_0x5342('0x21')](_0x369e80[_0x5342('0x37')][_0x5342('0x21')]);}_0x554a3d[_0x5342('0x3f')]=qs[_0x5342('0x40')](_0x369e80[_0x5342('0x37')]['sort']);_0x554a3d[_0x5342('0x41')]=qs['filters'](_[_0x5342('0x42')](_0x369e80[_0x5342('0x37')],_0x2304c6['filters']));var _0x2dec6b=[];var _0x496e51=squel[_0x5342('0x43')]()[_0x5342('0x44')]('id')[_0x5342('0x44')](_0x5342('0x45'))[_0x5342('0x44')]('color')[_0x5342('0x46')]('tools_tags');var _0x30cef3=squel[_0x5342('0x43')]()[_0x5342('0x44')](_0x5342('0x47'))[_0x5342('0x46')]('mail_messages','me')[_0x5342('0x41')](_0x5342('0x48'))['where']('me.direction\x20=\x20\x27in\x27')['where'](_0x5342('0x49'));var _0x19d396=squel[_0x5342('0x43')]()[_0x5342('0x44')](_0x5342('0x4a'))['field'](_0x5342('0x4b'))[_0x5342('0x46')]('user_has_mail_interactions','ui')[_0x5342('0x4c')](_0x5342('0x4d'),'u',_0x5342('0x4e'));var _0x12ce96=squel[_0x5342('0x43')]()['from']('mail_interactions','i')[_0x5342('0x4c')](_0x5342('0x4f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x5342('0x4c')]('users','o',_0x5342('0x50'))[_0x5342('0x4c')]('mail_accounts','a',_0x5342('0x51'))['left_join']('mail_messages','me',_0x5342('0x52'));var _0x20951f=squel['expr']();if(_0x369e80[_0x5342('0x37')]['advancedFilter']){var _0x5a4e01=JSON[_0x5342('0x53')](_0x369e80[_0x5342('0x37')][_0x5342('0x54')]);_['keys'](_0x5a4e01)[_0x5342('0x55')](function(_0x112ed6){var _0x1bc2eb=_0x5a4e01[_0x112ed6];if(_0x112ed6===_0x5342('0x56')){var _0x344cad=moment(_0x1bc2eb[_0x5342('0x57')][_0x5342('0x58')])[_0x5342('0x59')](_0x5342('0x5a'))['utc']()[_0x5342('0x5b')]();var _0x5150db=moment(_0x5150db)[_0x5342('0x5c')]()[_0x5342('0x5d')](_0x5342('0x5a'))[_0x5342('0x5b')]();_0x20951f[_0x5342('0x5e')](_0x5342('0x5f'),_0x344cad,_0x5150db);}else{if(_[_0x5342('0x60')](_0x1bc2eb[_0x5342('0x61')])){_0x1bc2eb[_0x5342('0x61')][_0x5342('0x55')](function(_0x370428){switch(_0x1bc2eb[_0x5342('0x61')][_0x5342('0x57')]){case'IS':if(_0x112ed6!=='TagId'&&_0x112ed6!=='unreadMessages'){if(_[_0x5342('0x60')](_0x1bc2eb[_0x5342('0x57')])&&_0x1bc2eb[_0x5342('0x57')]['length']>0x1){_0x20951f['and'](_0x1bc2eb['tableAlias']+'.'+_0x112ed6+'\x20IN\x20?',_0x1bc2eb[_0x5342('0x57')]);}else{_0x20951f['and'](_0x1bc2eb[_0x5342('0x62')]+'.'+_0x112ed6+_0x5342('0x63'),_0x1bc2eb['value'][0x0]);}}break;case'=':_0x20951f['and'](_0x1bc2eb[_0x5342('0x62')]+'.'+_0x112ed6+'\x20=\x20?',_0x1bc2eb[_0x5342('0x57')]);break;case _0x5342('0x64'):if(_0x112ed6===_0x5342('0x65')){_0x20951f[_0x5342('0x5e')](_0x5342('0x66')+_0x5342('0x67'),'%'+_0x1bc2eb[_0x5342('0x57')]+'%');_0x20951f['or'](_0x5342('0x68')+'\x20LIKE\x20?','%'+_0x1bc2eb[_0x5342('0x57')]+'%');_0x20951f['or'](_0x5342('0x69')+_0x5342('0x67'),'%'+_0x1bc2eb[_0x5342('0x57')]+'%');}else{_0x20951f[_0x5342('0x5e')](_0x1bc2eb[_0x5342('0x62')]+'.'+_0x112ed6+_0x5342('0x67'),'%'+_0x1bc2eb[_0x5342('0x57')]+'%');}break;case'>':_0x20951f[_0x5342('0x5e')](_0x1bc2eb[_0x5342('0x62')]+'.'+_0x112ed6+_0x5342('0x6a'),_0x1bc2eb[_0x5342('0x57')]);break;case'<':_0x20951f[_0x5342('0x5e')](_0x1bc2eb[_0x5342('0x62')]+'.'+_0x112ed6+_0x5342('0x6b'),_0x1bc2eb[_0x5342('0x57')]);break;}});}else{switch(_0x1bc2eb[_0x5342('0x61')]['value']){case'IS':if(_0x112ed6!==_0x5342('0x6c')&&_0x112ed6!==_0x5342('0x6d')){if(_[_0x5342('0x60')](_0x1bc2eb[_0x5342('0x57')])&&_0x1bc2eb[_0x5342('0x57')][_0x5342('0x3b')]>0x1){_0x20951f['and'](_0x1bc2eb[_0x5342('0x62')]+'.'+_0x112ed6+_0x5342('0x6e'),_0x1bc2eb[_0x5342('0x57')]);}else{_0x20951f[_0x5342('0x5e')](_0x1bc2eb[_0x5342('0x62')]+'.'+_0x112ed6+_0x5342('0x63'),_0x1bc2eb[_0x5342('0x57')][0x0]);}}break;case'=':_0x20951f['and'](_0x1bc2eb[_0x5342('0x62')]+'.'+_0x112ed6+_0x5342('0x63'),_0x1bc2eb['value']);break;case _0x5342('0x64'):if(_0x112ed6===_0x5342('0x65')){_0x20951f[_0x5342('0x5e')](_0x5342('0x66')+'\x20LIKE\x20?','%'+_0x1bc2eb[_0x5342('0x57')]+'%');_0x20951f['or']('c.lastName'+_0x5342('0x67'),'%'+_0x1bc2eb[_0x5342('0x57')]+'%');_0x20951f['or'](_0x5342('0x69')+_0x5342('0x67'),'%'+_0x1bc2eb[_0x5342('0x57')]+'%');}else{_0x20951f[_0x5342('0x5e')](_0x1bc2eb['tableAlias']+'.'+_0x112ed6+_0x5342('0x67'),'%'+_0x1bc2eb[_0x5342('0x57')]+'%');}break;case'>':_0x20951f['and'](_0x1bc2eb[_0x5342('0x62')]+'.'+_0x112ed6+'\x20>\x20?',_0x1bc2eb[_0x5342('0x57')]);break;case'<':_0x20951f[_0x5342('0x5e')](_0x1bc2eb[_0x5342('0x62')]+'.'+_0x112ed6+_0x5342('0x6b'),_0x1bc2eb[_0x5342('0x57')]);break;}}}});}else{var _0x378a63=_(Object[_0x5342('0x36')](_0x369e80[_0x5342('0x37')]))['map'](function(_0x6d51d){return _0x599508[_0x5342('0x3c')](_0x6d51d)?_0x6d51d:undefined;})[_0x5342('0x6f')](function(_0x2e2ee8){return!_['isNil'](_0x2e2ee8);})[_0x5342('0x57')]();if(!_[_0x5342('0x70')](_0x378a63)){_0x378a63[_0x5342('0x55')](function(_0x429c79){if(_0x429c79==='MailAccountId'){_0x12ce96[_0x5342('0x41')]('i.MailAccountId\x20IN\x20?',[][_0x5342('0x71')](_0x369e80[_0x5342('0x37')][_0x429c79]));}else if(_0x429c79==='createdAt'){var _0x1e4329=JSON[_0x5342('0x53')](_0x369e80[_0x5342('0x37')][_0x429c79])[_0x5342('0x72')];var _0x4f42e4=JSON[_0x5342('0x53')](_0x369e80[_0x5342('0x37')][_0x429c79])[_0x5342('0x73')];_0x12ce96[_0x5342('0x41')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1e4329,_0x4f42e4);}else{if(_0x369e80[_0x5342('0x37')][_0x429c79]===_0x5342('0x74')){_0x12ce96[_0x5342('0x41')]('i.'+_0x429c79+_0x5342('0x75'));}else{_0x12ce96['where']('i.'+_0x429c79+_0x5342('0x63'),_0x369e80[_0x5342('0x37')][_0x429c79]);}}});}if(_0x369e80[_0x5342('0x37')][_0x5342('0x6f')]){var _0xb8c85e=_0x369e80['query'][_0x5342('0x6f')][_0x5342('0x76')]('\x5c','\x5c\x5c')[_0x5342('0x76')]('\x27\x27',_0x5342('0x77'));if(qs[_0x5342('0x78')](_0xb8c85e)){_0x20951f['or'](_0x5342('0x79'),_0xb8c85e+'%');}else if(qs[_0x5342('0x7a')](_0xb8c85e)){_0x20951f['or'](_0x5342('0x7b'),_0xb8c85e+'%');}else{var _0x270264=[];_0xb8c85e[_0x5342('0x7c')]('\x20')['forEach'](function(_0x5def82){_0x270264[_0x5342('0x2c')]('+'+_0x5def82[_0x5342('0x7d')]());});var _0x59cbfd=_0x270264[_0x5342('0x7e')]('\x20');_0x20951f['or'](_0x5342('0x7f'),_0x59cbfd)['or'](_0x5342('0x80'),_0x59cbfd);}}}_0x12ce96[_0x5342('0x41')](_0x20951f);if(_0x554a3d[_0x5342('0x3f')]){_0x554a3d[_0x5342('0x3f')][_0x5342('0x55')](function(_0x53225e){_0x12ce96[_0x5342('0x3f')]('i.'+_0x53225e[0x0],_0x53225e[0x1]===_0x5342('0x81')?![]:!![]);});}_0x12ce96[_0x5342('0x82')](_0x5342('0x83'));var _0x5b1084={'type':db[_0x5342('0x84')][_0x5342('0x85')][_0x5342('0x86')],'raw':!![]};var _0x366134=_0x12ce96['clone']()[_0x5342('0x44')](_0x5342('0x47'))[_0x5342('0x44')](_0x5342('0x87'),_0x5342('0x6d'));if(!_0x369e80['query'][_0x5342('0x54')]){if(_0x369e80['query'][_0x5342('0x88')]){if(_0x369e80[_0x5342('0x37')][_0x5342('0x88')]==0x1){_0x366134['having'](_0x5342('0x89'));_0x12ce96[_0x5342('0x8a')]('`unreadMessages`\x20=\x200');}else{_0x366134['having'](_0x5342('0x8b'));_0x12ce96[_0x5342('0x8a')](_0x5342('0x8b'));}}if(_0x369e80[_0x5342('0x37')][_0x5342('0x8c')]){var _0x2b1afa=_[_0x5342('0x60')](_0x369e80[_0x5342('0x37')][_0x5342('0x8c')])?_0x369e80['query'][_0x5342('0x8c')]:new Array(_0x369e80[_0x5342('0x37')][_0x5342('0x8c')]);var _0xa7cab7=squel[_0x5342('0x8d')]();_0x2b1afa[_0x5342('0x55')](function(_0x8c0dbe){_0xa7cab7['or'](_0x5342('0x8e'),'%,'+_0x8c0dbe+',%');});_0x12ce96['having'](_0xa7cab7);_0x366134[_0x5342('0x4c')](_0x5342('0x8f'),'it',_0x5342('0x90'));_0x366134[_0x5342('0x4c')](_0x5342('0x91'),'t','t.id\x20=\x20it.TagId');_0x366134['where']('t.id\x20IN\x20?',_0x2b1afa);}}else{var _0x5a4e01=JSON[_0x5342('0x53')](_0x369e80[_0x5342('0x37')][_0x5342('0x54')]);_['keys'](_0x5a4e01)[_0x5342('0x55')](function(_0x1474d9){var _0xc4301a=_0x5a4e01[_0x1474d9];if(_0x1474d9==='TagId'){var _0x541963=_0xc4301a[_0x5342('0x57')];var _0x28b8b6=squel['expr']();_0x541963[_0x5342('0x55')](function(_0x4fb384){_0x28b8b6['or'](_0x5342('0x8e'),'%,'+_0x4fb384+',%');});_0x12ce96[_0x5342('0x8a')](_0x28b8b6);_0x366134['left_join'](_0x5342('0x8f'),'it',_0x5342('0x90'));_0x366134[_0x5342('0x4c')](_0x5342('0x91'),'t',_0x5342('0x92'));_0x366134[_0x5342('0x41')](_0x5342('0x93'),_0x541963);}else if(_0x1474d9===_0x5342('0x6d')){if(_0xc4301a[_0x5342('0x57')][_0x5342('0x3b')]===0x1){if(_0xc4301a[_0x5342('0x57')][0x0]===0x1){_0x366134[_0x5342('0x8a')](_0x5342('0x89'));_0x12ce96[_0x5342('0x8a')]('`unreadMessages`\x20=\x200');}else{_0x366134[_0x5342('0x8a')]('`unreadMessages`\x20>\x200');_0x12ce96['having'](_0x5342('0x8b'));}}}});}db[_0x5342('0x94')][_0x5342('0x37')](_0x366134['toString'](),_0x5b1084)[_0x5342('0x25')](function(_0x36e1e6){_0x7ab70a[_0x5342('0x95')]=_0x36e1e6[_0x5342('0x3b')];if(_0x7ab70a['count']===0x0)return[];return db[_0x5342('0x94')][_0x5342('0x37')](_0x496e51[_0x5342('0x7d')](),_0x5b1084)[_0x5342('0x25')](function(_0x1dc1e2){_0x2dec6b=_[_0x5342('0x96')](_0x1dc1e2,'id');_0x5b1084=_[_0x5342('0x97')](_0x5b1084,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x12ce96['field'](_0x5342('0x87'),_0x5342('0x6d'));_0x12ce96[_0x5342('0x44')](_0x5342('0x98'),'Account.key');_0x12ce96['field'](_0x5342('0x99'),_0x5342('0x9a'));_0x12ce96[_0x5342('0x44')]('i.id');_0x12ce96['field']('i.createdAt');_0x12ce96['field']('i.updatedAt');_0x12ce96['field'](_0x5342('0x9b'));_0x12ce96[_0x5342('0x44')](_0x5342('0x9c'));_0x12ce96[_0x5342('0x44')](_0x5342('0x9d'));_0x12ce96[_0x5342('0x44')](_0x5342('0x9e'));_0x12ce96[_0x5342('0x44')](_0x5342('0x9f'));_0x12ce96[_0x5342('0x44')]('i.subject');_0x12ce96[_0x5342('0x44')]('i.disposition');_0x12ce96['field']('i.substatus');_0x12ce96[_0x5342('0x44')](_0x5342('0xa0'));_0x12ce96[_0x5342('0x44')](_0x5342('0xa1'));_0x12ce96[_0x5342('0x44')](_0x5342('0xa2'));_0x12ce96[_0x5342('0x44')](_0x5342('0xa3'));_0x12ce96[_0x5342('0x44')]('c.firstName','Contact.firstName');_0x12ce96[_0x5342('0x44')]('c.lastName',_0x5342('0xa4'));_0x12ce96[_0x5342('0x44')](_0x5342('0x69'),'Contact.email');_0x12ce96[_0x5342('0x44')]('c.phone',_0x5342('0xa5'));_0x12ce96[_0x5342('0x44')]('c.mobile',_0x5342('0xa6'));_0x12ce96['field']('c.fax',_0x5342('0xa7'));_0x12ce96[_0x5342('0x44')](_0x5342('0xa8'),'TagIds');_0x12ce96[_0x5342('0x4c')](_0x5342('0x8f'),'it',_0x5342('0x90'));_0x12ce96[_0x5342('0x4c')](_0x5342('0x91'),'t',_0x5342('0x92'));_0x12ce96[_0x5342('0x3e')](_0x554a3d['limit']);_0x12ce96['offset'](_0x554a3d[_0x5342('0x21')]);return db[_0x5342('0x94')][_0x5342('0x37')](_0x12ce96['toString'](),_0x5b1084);})[_0x5342('0x25')](function(_0x3a9eaf){_0x19d396[_0x5342('0x41')](_0x5342('0xa9'),_['map'](_0x3a9eaf,'id'));return db[_0x5342('0x94')]['query'](_0x19d396[_0x5342('0x7d')](),_0x5b1084)[_0x5342('0x25')](function(_0x4e156a){var _0x498503=_[_0x5342('0xaa')](_0x4e156a,_0x5342('0xab'));var _0x34a64f=[];return db['Setting'][_0x5342('0x2e')]({'attributes':[_0x5342('0xac')],'raw':!![]})[_0x5342('0x25')](function(_0x1da7ba){var _0x563ef8=_0x1da7ba['enableEmailPreview'];_0x3a9eaf['forEach'](function(_0x308676){_0x34a64f[_0x5342('0x2c')](updateMailInteraction(_0x308676,_0x2dec6b,_0x498503,_0x563ef8));});return BPromise[_0x5342('0xad')](_0x34a64f);});});});})[_0x5342('0x25')](function(_0x52b076){_0x7ab70a[_0x5342('0xae')]=_0x52b076;return _0x7ab70a;})[_0x5342('0x25')](respondWithFilteredResult(_0x3ac6c5,_0x554a3d))[_0x5342('0x33')](handleError(_0x3ac6c5,null));};exports[_0x5342('0xaf')]=function(_0x195874,_0x3e9e14){var _0x1fde41={'raw':![],'where':{'id':_0x195874[_0x5342('0xb0')]['id']}},_0x2248b5={};_0x2248b5[_0x5342('0x35')]=_[_0x5342('0x36')](db[_0x5342('0x2d')]['rawAttributes']);_0x2248b5['query']=_[_0x5342('0x36')](_0x195874['query']);_0x2248b5[_0x5342('0xb1')]=_[_0x5342('0x38')](_0x2248b5[_0x5342('0x35')],_0x2248b5[_0x5342('0x37')]);_0x1fde41[_0x5342('0x39')]=_[_0x5342('0x38')](_0x2248b5[_0x5342('0x35')],qs[_0x5342('0x3a')](_0x195874[_0x5342('0x37')]['fields']));_0x1fde41[_0x5342('0x39')]=_0x1fde41[_0x5342('0x39')][_0x5342('0x3b')]?_0x1fde41[_0x5342('0x39')]:_0x2248b5[_0x5342('0x35')];if(_0x195874['query'][_0x5342('0xb2')]){_0x1fde41['include']=[{'all':!![]}];}_0x1fde41=_[_0x5342('0x97')]({},_0x1fde41,_0x195874['options']);return db['MailInteraction']['find'](_0x1fde41)['then'](handleEntityNotFound(_0x3e9e14,null))[_0x5342('0x25')](respondWithResult(_0x3e9e14,null))[_0x5342('0x33')](handleError(_0x3e9e14,null));};exports[_0x5342('0xb3')]=function(_0x2f5147,_0x25f56f){return db[_0x5342('0x2d')][_0x5342('0xb3')](_0x2f5147[_0x5342('0xb4')],{})['then'](respondWithResult(_0x25f56f,0xc9))[_0x5342('0x33')](handleError(_0x25f56f,null));};exports[_0x5342('0xb5')]=function(_0x2e6689,_0x42f152){if(_0x2e6689['body']['id']){delete _0x2e6689[_0x5342('0xb4')]['id'];}return db[_0x5342('0x2d')][_0x5342('0xb6')]({'where':{'id':_0x2e6689['params']['id']}})[_0x5342('0x25')](handleEntityNotFound(_0x42f152,null))[_0x5342('0x25')](saveUpdates(_0x2e6689[_0x5342('0xb4')],null))[_0x5342('0x25')](respondWithResult(_0x42f152,null))[_0x5342('0x33')](handleError(_0x42f152,null));};exports['destroy']=function(_0x22e4e0,_0x1ad35e){return db[_0x5342('0x2d')][_0x5342('0xb6')]({'where':{'id':_0x22e4e0[_0x5342('0xb0')]['id']}})[_0x5342('0x25')](handleEntityNotFound(_0x1ad35e,null))[_0x5342('0x25')](removeEntity(_0x1ad35e,null))[_0x5342('0x33')](handleError(_0x1ad35e,null));};exports[_0x5342('0xb7')]=function(_0x3cb968,_0x3f1f52){return db[_0x5342('0x2d')]['describe']()[_0x5342('0x25')](respondWithResult(_0x3f1f52,null))[_0x5342('0x33')](handleError(_0x3f1f52,null));};exports[_0x5342('0xb8')]=function(_0x489fff,_0x3b1529,_0x3dbddb){return db['MailMessage'][_0x5342('0xb6')]({'where':{'id':_0x489fff[_0x5342('0xb0')]['id']}})[_0x5342('0x25')](handleEntityNotFound(_0x3b1529,null))[_0x5342('0x25')](function(_0x2f3b2){if(_0x2f3b2){return _0x2f3b2['addMessage'](_0x489fff[_0x5342('0xb4')][_0x5342('0xb9')],_[_0x5342('0xba')](_0x489fff['body'],[_0x5342('0xb9'),'id'])||{});}})[_0x5342('0x25')](respondWithResult(_0x3b1529,null))[_0x5342('0x33')](handleError(_0x3b1529,null));};exports[_0x5342('0xbb')]=function(_0x112dc5,_0x5402e8,_0x1f29c1){var _0x1b4bf0={'raw':![],'where':{}};var _0x1b8a60={};var _0x30a12a={'count':0x0,'rows':[]};return db[_0x5342('0x2d')][_0x5342('0x2e')]({'where':{'id':_0x112dc5[_0x5342('0xb0')]['id']}})[_0x5342('0x25')](handleEntityNotFound(_0x5402e8,null))[_0x5342('0x25')](function(_0x123d59){if(_0x123d59){_0x1b8a60['model']=_[_0x5342('0x36')](db['MailMessage']['rawAttributes']);_0x1b8a60[_0x5342('0x37')]=_['keys'](_0x112dc5['query']);_0x1b8a60['filters']=_[_0x5342('0x38')](_0x1b8a60['model'],_0x1b8a60[_0x5342('0x37')]);_0x1b4bf0[_0x5342('0x39')]=_[_0x5342('0x38')](_0x1b8a60['model'],qs['fields'](_0x112dc5[_0x5342('0x37')][_0x5342('0x3a')]));_0x1b4bf0[_0x5342('0x39')]=_0x1b4bf0[_0x5342('0x39')][_0x5342('0x3b')]?_0x1b4bf0[_0x5342('0x39')]:_0x1b8a60[_0x5342('0x35')];if(!_0x112dc5[_0x5342('0x37')][_0x5342('0x3c')](_0x5342('0x3d'))){_0x1b4bf0['limit']=qs['limit'](_0x112dc5[_0x5342('0x37')]['limit']);_0x1b4bf0['offset']=qs[_0x5342('0x21')](_0x112dc5['query'][_0x5342('0x21')]);}_0x1b4bf0[_0x5342('0x3f')]=qs[_0x5342('0x40')](_0x112dc5[_0x5342('0x37')][_0x5342('0x40')]);_0x1b4bf0[_0x5342('0x41')]=qs['filters'](_[_0x5342('0x42')](_0x112dc5[_0x5342('0x37')],_0x1b8a60[_0x5342('0xb1')]));_0x1b4bf0['where']['MailInteractionId']=_0x123d59['id'];if(_0x112dc5[_0x5342('0x37')][_0x5342('0x6f')]){_0x1b4bf0[_0x5342('0x41')]=_[_0x5342('0x97')](_0x1b4bf0[_0x5342('0x41')],{'$or':_['map'](_0x1b4bf0['attributes'],function(_0x5ea4c3){var _0x439d12={};_0x439d12[_0x5ea4c3]={'$like':'%'+_0x112dc5[_0x5342('0x37')][_0x5342('0x6f')]+'%'};return _0x439d12;})});}if(_0x112dc5[_0x5342('0x37')][_0x5342('0x72')]){var _0x24e0b5=_0x112dc5[_0x5342('0x37')][_0x5342('0x72')][_0x5342('0x7c')](',');var _0x81e482={};_0x81e482[_0x24e0b5[0x0]]={'$gte':moment(_0x24e0b5[0x1])[_0x5342('0x5b')](_0x5342('0xbc'))};_0x1b4bf0['where']=_[_0x5342('0x97')](_0x1b4bf0['where'],_0x81e482);}_0x1b4bf0=_['merge']({},_0x1b4bf0,_0x112dc5[_0x5342('0xbd')]);return db[_0x5342('0xbe')]['count']({'where':_0x1b4bf0[_0x5342('0x41')]})['then'](function(_0x3c9ade){_0x30a12a[_0x5342('0x95')]=_0x3c9ade;if(_0x112dc5[_0x5342('0x37')][_0x5342('0xb2')]){_0x1b4bf0[_0x5342('0xbf')]=[{'all':!![]}];}return db[_0x5342('0xbe')][_0x5342('0xc0')](_0x1b4bf0);})[_0x5342('0x25')](function(_0x24ab2d){_0x30a12a['rows']=_0x24ab2d;return _0x30a12a;});}})[_0x5342('0x25')](respondWithFilteredResult(_0x5402e8,_0x1b4bf0))['catch'](handleError(_0x5402e8,null));};exports[_0x5342('0xc1')]=function(_0x1b42ab,_0x440ae3,_0x14b1dd){return db[_0x5342('0x2d')]['find']({'where':{'id':_0x1b42ab[_0x5342('0xb0')]['id']}})[_0x5342('0x25')](handleEntityNotFound(_0x440ae3,null))[_0x5342('0x25')](function(_0x270b95){if(_0x270b95){return _0x270b95[_0x5342('0xc2')](_0x1b42ab[_0x5342('0xb4')][_0x5342('0xb9')],_[_0x5342('0xba')](_0x1b42ab['body'],[_0x5342('0xb9'),'id'])||{})['spread'](function(){return db[_0x5342('0xc3')][_0x5342('0xc0')]({'attributes':['id',_0x5342('0x45'),_0x5342('0xc4')],'where':{'id':_0x1b42ab['body'][_0x5342('0xb9')]}});})[_0x5342('0x25')](function(_0x59cc44){socket[_0x5342('0xc5')](_0x5342('0xc6'),{'id':Number(_0x1b42ab[_0x5342('0xb0')]['id']),'tags':_0x59cc44||[]});return{'id':Number(_0x1b42ab[_0x5342('0xb0')]['id']),'tags':_0x59cc44||[]};});}})[_0x5342('0x25')](respondWithResult(_0x440ae3,null))['catch'](handleError(_0x440ae3,null));};exports['removeTags']=function(_0x6b122,_0x4265b5,_0x48f8da){return db['MailInteraction'][_0x5342('0xb6')]({'where':{'id':_0x6b122[_0x5342('0xb0')]['id']}})['then'](handleEntityNotFound(_0x4265b5,null))['then'](function(_0x3980b4){if(_0x3980b4){return _0x3980b4[_0x5342('0xc7')](_0x6b122[_0x5342('0x37')]['ids']);}})['then'](respondWithStatusCode(_0x4265b5,null))['catch'](handleError(_0x4265b5,null));};exports['download']=function(_0x3697f5,_0xd0a59b){var _0x1b6eb6=moment()[_0x5342('0xc8')]()[_0x5342('0x7d')]();var _0x4d0a05=path[_0x5342('0x7e')](config[_0x5342('0xc9')],_0x5342('0xca'),_0x5342('0xcb'),_0x5342('0xcc'));var _0x5d7afc=path[_0x5342('0x7e')](config[_0x5342('0xc9')],'server',_0x5342('0xcb'),_0x5342('0xcd'));var _0x5019ae=path[_0x5342('0x7e')](_0x5d7afc,_0x1b6eb6);var _0x43126f=util['format']('interaction-%s.zip',_0x1b6eb6);var _0x560b16=path[_0x5342('0x7e')](_0x5d7afc,_0x43126f);var _0x5998ec=![];return db[_0x5342('0x2d')][_0x5342('0xb6')]({'where':{'id':_0x3697f5['params']['id']}})[_0x5342('0x25')](handleEntityNotFound(_0xd0a59b,null))['then'](function(_0x1ec5b3){if(_0x1ec5b3){return _0x1ec5b3['getMessages']({'attributes':['id',_0x5342('0xb4'),'from','to','cc',_0x5342('0xce'),_0x5342('0xcf'),'createdAt'],'where':{'secret':![]},'include':_0x3697f5[_0x5342('0x37')][_0x5342('0xcc')]?[{'model':db[_0x5342('0xd0')],'as':'Attachments'}]:undefined,'order':qs[_0x5342('0x40')]('id')});}return[];})[_0x5342('0x25')](function(_0x2e6321){_0x5998ec=_0x2e6321[_0x5342('0x3b')];if(_0x2e6321[_0x5342('0x3b')]){fs[_0x5342('0xd1')](_0x5019ae);return BPromise[_0x5342('0xd2')](_0x2e6321,function(_0x2784fb,_0x786e21){var _0x474515=_0x2784fb;var _0x65b482={'from':_0x474515[_0x5342('0x46')],'to':_0x474515['to'],'subject':_0x474515[_0x5342('0xcf')],'html':_0x474515[_0x5342('0xb4')],'headers':{'Date':moment(_0x474515[_0x5342('0x56')])[_0x5342('0x5b')](_0x5342('0xd3'))},'attachments':[]};if(_0x2784fb['cc']){_0x65b482[_0x5342('0xd4')]['Cc']=_0x2784fb['cc'];}if(_0x2784fb[_0x5342('0xce')]){_0x65b482[_0x5342('0xd4')][_0x5342('0xd5')]=_0x2784fb[_0x5342('0xce')];}return new BPromise(function(_0xec996a,_0xad019d){if(_0x2784fb[_0x5342('0xd6')]){for(var _0x5021fc=0x0;_0x5021fc<_0x2784fb['Attachments'][_0x5342('0x3b')];_0x5021fc++){var _0x6dcf75=_0x2784fb[_0x5342('0xd6')][_0x5021fc];var _0x21cb23=path['join'](_0x4d0a05,_0x6dcf75[_0x5342('0xd7')]);if(fs['existsSync'](_0x21cb23)){_0x65b482[_0x5342('0xcc')]['push']({'name':_0x6dcf75[_0x5342('0x45')],'contentType':_0x6dcf75[_0x5342('0xd8')],'data':fs[_0x5342('0xd9')](_0x21cb23)});}}}emlformat['build'](_0x65b482,function(_0x34a8c6,_0x5b0708){if(_0x34a8c6)return _0xad019d(_0x34a8c6);fs['writeFileSync'](path[_0x5342('0x7e')](_0x5019ae,util[_0x5342('0x5b')](_0x5342('0xda'),_0x786e21)),_0x5b0708);return _0xec996a(_0x5b0708);});});});}})['then'](function(){if(_0x5998ec){return new BPromise(function(_0x1ed285,_0x3b1f00){zipdir(_0x5019ae,{'saveTo':_0x560b16},function(_0x503ad9,_0x3fbf47){if(_0x503ad9)return _0x3b1f00(_0x503ad9);return _0x1ed285(_0x3fbf47);});});}})[_0x5342('0x25')](function(){if(_0x5998ec){return new BPromise(function(_0x3d18c8,_0x5a8c8c){rimraf(_0x5019ae,function(_0x4113e4){if(_0x4113e4)_0x5a8c8c(_0x4113e4);return _0x3d18c8();});});}})[_0x5342('0x25')](function(){if(_0x5998ec){return _0xd0a59b[_0x5342('0xdb')](_0x560b16,_0x43126f,function(_0x560b86){if(_0x560b86){console[_0x5342('0xdc')]('err',_0x560b86);}else{fs[_0x5342('0xdd')](_0x560b16);}});}else{return _0xd0a59b[_0x5342('0x1d')](0xc8);}})['catch'](handleError(_0xd0a59b,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 1c083a8..10480af 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 _0x3406=['map','findAll','unreadMessages','length','emit','catch','hook','exports','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','remove','getUsers','setDataValue','Users'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x3406,0x1a0));var _0x6340=function(_0x3b43c6,_0x3667e2){_0x3b43c6=_0x3b43c6-0x0;var _0x29eb7b=_0x3406[_0x3b43c6];return _0x29eb7b;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x6340('0x0'))['db'][_0x6340('0x1')];var MailMessage=require('../../mysqldb')['db'][_0x6340('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x6340('0x3')](0x0);var events={'afterCreate':_0x6340('0x4'),'afterUpdate':'update','afterDestroy':_0x6340('0x5')};function emitEvent(_0x244e27){return function(_0x58b9a9,_0x53a973,_0x32cee6){_0x58b9a9[_0x6340('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3b6124){_0x58b9a9[_0x6340('0x7')](_0x6340('0x8'),_0x3b6124[_0x6340('0x9')](function(_0x7c72e7){return{'id':_0x7c72e7['id']};}));return MailMessage[_0x6340('0xa')]({'where':{'MailInteractionId':_0x58b9a9['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2d8d22){_0x58b9a9['setDataValue'](_0x6340('0xb'),_0x2d8d22[_0x6340('0xc')]);MailInteractionEvents[_0x6340('0xd')](_0x244e27+':'+_0x58b9a9['id'],_0x58b9a9);MailInteractionEvents['emit'](_0x244e27,_0x58b9a9);_0x32cee6(null);})[_0x6340('0xe')](_0x32cee6(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x6340('0xf')](e,emitEvent(event));}}module[_0x6340('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x5bac=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','update'];(function(_0x3033a,_0x481c8e){var _0x10c4a7=function(_0x485c0b){while(--_0x485c0b){_0x3033a['push'](_0x3033a['shift']());}};_0x10c4a7(++_0x481c8e);}(_0x5bac,0x1e8));var _0xc5ba=function(_0x4b0dfd,_0x2694e4){_0x4b0dfd=_0x4b0dfd-0x0;var _0x27ca1b=_0x5bac[_0x4b0dfd];return _0x27ca1b;};'use strict';var EventEmitter=require(_0xc5ba('0x0'));var MailInteraction=require(_0xc5ba('0x1'))['db'][_0xc5ba('0x2')];var MailMessage=require(_0xc5ba('0x1'))['db'][_0xc5ba('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xc5ba('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc5ba('0x5'),'afterDestroy':'remove'};function emitEvent(_0x43cfd4){return function(_0x359113,_0x3ac19a,_0x494ab5){_0x359113[_0xc5ba('0x6')]({'attributes':['id'],'raw':!![]})[_0xc5ba('0x7')](function(_0x185ace){_0x359113[_0xc5ba('0x8')](_0xc5ba('0x9'),_0x185ace[_0xc5ba('0xa')](function(_0x493ed7){return{'id':_0x493ed7['id']};}));return MailMessage[_0xc5ba('0xb')]({'where':{'MailInteractionId':_0x359113['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc5ba('0x7')](function(_0x167b14){_0x359113['setDataValue'](_0xc5ba('0xc'),_0x167b14[_0xc5ba('0xd')]);MailInteractionEvents[_0xc5ba('0xe')](_0x43cfd4+':'+_0x359113['id'],_0x359113);MailInteractionEvents[_0xc5ba('0xe')](_0x43cfd4,_0x359113);_0x494ab5(null);})[_0xc5ba('0xf')](_0x494ab5(null));};}for(var e in events){if(events[_0xc5ba('0x10')](e)){var event=events[e];MailInteraction[_0xc5ba('0x11')](e,emitEvent(event));}}module[_0xc5ba('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 4943c38..f4bdffb 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 _0x8625=['subject','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','closed','models','get','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','MailInteraction','mail_interactions','fti_mail_interactions'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x8625,0x1b3));var _0x5862=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0x8625[_0x504df1];return _0x1063b5;};'use strict';var _=require(_0x5862('0x0'));var util=require(_0x5862('0x1'));var logger=require('../../config/logger')(_0x5862('0x2'));var moment=require(_0x5862('0x3'));var BPromise=require(_0x5862('0x4'));var rp=require(_0x5862('0x5'));var fs=require('fs');var path=require(_0x5862('0x6'));var rimraf=require(_0x5862('0x7'));var config=require(_0x5862('0x8'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0xfb10e,_0x243d28){return _0xfb10e[_0x5862('0x9')](_0x5862('0xa'),attributes,{'tableName':_0x5862('0xb'),'paranoid':![],'indexes':[{'name':_0x5862('0xc'),'fields':[_0x5862('0xd'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3bd366,_0x302756,_0x1c1ccc){if(_0x3bd366[_0x5862('0xe')]){_0x3bd366[_0x5862('0xf')]=moment()[_0x5862('0x10')](_0x5862('0x11'));}if(_0x3bd366['closed']){_0x3bd366[_0x5862('0x12')]=moment()[_0x5862('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1c1ccc(null,_0x302756);},'beforeUpdate':function(_0x37b225,_0x44f1d9,_0x834709){if(_0x37b225[_0x5862('0x13')](_0x5862('0xe'))){_0x37b225[_0x5862('0xf')]=moment()[_0x5862('0x10')](_0x5862('0x11'));}if(_0x37b225['changed'](_0x5862('0x14'))){_0x37b225[_0x5862('0x12')]=moment()[_0x5862('0x10')](_0x5862('0x11'));}_0x834709(null,_0x37b225);},'afterUpdate':function(_0x280c34,_0x53a0c8,_0x333f96){var _0x350c2c=_0xfb10e[_0x5862('0x15')];var _0x4426d9=_0x280c34[_0x5862('0x16')]({'plain':!![]});if(_0x4426d9[_0x5862('0x14')]){return _0x350c2c['MailMessage'][_0x5862('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x4426d9['id']}})[_0x5862('0x18')](function(){_0x333f96();})[_0x5862('0x19')](function(_0x5576fa){_0x333f96(_0x5576fa);});}else{_0x333f96();}}},'charset':_0x5862('0x1a'),'collate':_0x5862('0x1b')});}; \ No newline at end of file +var _0x90c7=['closed','models','get','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./mailInteraction.attributes','MailInteraction','mail_interactions','fti_mail_interactions','subject','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_0x90c7,0xc5));var _0x790c=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x90c7[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x790c('0x0'));var util=require(_0x790c('0x1'));var logger=require(_0x790c('0x2'))(_0x790c('0x3'));var moment=require(_0x790c('0x4'));var BPromise=require(_0x790c('0x5'));var rp=require(_0x790c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x790c('0x7'));var attributes=require(_0x790c('0x8'));module['exports']=function(_0xb17f93,_0x196550){return _0xb17f93['define'](_0x790c('0x9'),attributes,{'tableName':_0x790c('0xa'),'paranoid':![],'indexes':[{'name':_0x790c('0xb'),'fields':[_0x790c('0xc'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xf530c3,_0x56d57e,_0x5a2bc0){if(_0xf530c3[_0x790c('0xd')]){_0xf530c3[_0x790c('0xe')]=moment()[_0x790c('0xf')](_0x790c('0x10'));}if(_0xf530c3['closed']){_0xf530c3[_0x790c('0x11')]=moment()[_0x790c('0xf')](_0x790c('0x10'));}_0x5a2bc0(null,_0x56d57e);},'beforeUpdate':function(_0x12a7ea,_0x587b3b,_0x2bc996){if(_0x12a7ea[_0x790c('0x12')](_0x790c('0xd'))){_0x12a7ea[_0x790c('0xe')]=moment()[_0x790c('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x12a7ea[_0x790c('0x12')](_0x790c('0x13'))){_0x12a7ea[_0x790c('0x11')]=moment()['format'](_0x790c('0x10'));}_0x2bc996(null,_0x12a7ea);},'afterUpdate':function(_0x12146d,_0x1510d1,_0x3ab7f1){var _0x55c7b1=_0xb17f93[_0x790c('0x14')];var _0x2a1900=_0x12146d[_0x790c('0x15')]({'plain':!![]});if(_0x2a1900['closed']){return _0x55c7b1['MailMessage'][_0x790c('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x2a1900['id']}})[_0x790c('0x17')](function(){_0x3ab7f1();})[_0x790c('0x18')](function(_0x2c6d38){_0x3ab7f1(_0x2c6d38);});}else{_0x3ab7f1();}}},'charset':_0x790c('0x19'),'collate':_0x790c('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 5de08f4..8e11f7d 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 _0xa74d=['AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../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','error','code','MailInteraction,\x20%s,\x20%s','message','result','UpdateMailInteraction','options','raw','attributes','limit','catch','MailInteraction','find','addTags','ids','omit','body'];(function(_0x563c93,_0x27068d){var _0x3cab10=function(_0x3047a3){while(--_0x3047a3){_0x563c93['push'](_0x563c93['shift']());}};_0x3cab10(++_0x27068d);}(_0xa74d,0x1cf));var _0xda74=function(_0x25fef4,_0x5f2877){_0x25fef4=_0x25fef4-0x0;var _0x3ec1f3=_0xa74d[_0x25fef4];return _0x3ec1f3;};'use strict';var _=require('lodash');var util=require(_0xda74('0x0'));var moment=require(_0xda74('0x1'));var BPromise=require(_0xda74('0x2'));var rs=require(_0xda74('0x3'));var fs=require('fs');var Redis=require(_0xda74('0x4'));var db=require(_0xda74('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xda74('0x6'))(_0xda74('0x7'));var config=require(_0xda74('0x8'));var jayson=require(_0xda74('0x9'));var client=jayson[_0xda74('0xa')][_0xda74('0xb')]({'port':0x232a});config[_0xda74('0xc')]=_[_0xda74('0xd')](config['redis'],{'host':_0xda74('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xda74('0xf'))[_0xda74('0x10')](socket);function respondWithRpcPromise(_0x4f7fab,_0x3804cc,_0x3f55ac){return new BPromise(function(_0x3180c3,_0x15fd0d){return client[_0xda74('0x11')](_0x4f7fab,_0x3f55ac)[_0xda74('0x12')](function(_0x25a4b4){logger[_0xda74('0x13')]('MailInteraction,\x20%s,\x20%s',_0x3804cc,_0xda74('0x14'));logger[_0xda74('0x15')](_0xda74('0x16'),_0x3804cc,'request\x20sent',JSON[_0xda74('0x17')](_0x25a4b4));if(_0x25a4b4[_0xda74('0x18')]){if(_0x25a4b4[_0xda74('0x18')][_0xda74('0x19')]===0x1f4){logger[_0xda74('0x18')](_0xda74('0x1a'),_0x3804cc,_0x25a4b4[_0xda74('0x18')]['message']);return _0x15fd0d(_0x25a4b4[_0xda74('0x18')][_0xda74('0x1b')]);}logger[_0xda74('0x18')](_0xda74('0x1a'),_0x3804cc,_0x25a4b4[_0xda74('0x18')]['message']);return _0x3180c3(_0x25a4b4[_0xda74('0x18')][_0xda74('0x1b')]);}else{logger[_0xda74('0x13')](_0xda74('0x1a'),_0x3804cc,_0xda74('0x14'));_0x3180c3(_0x25a4b4[_0xda74('0x1c')][_0xda74('0x1b')]);}})['catch'](function(_0x260e33){logger[_0xda74('0x18')](_0xda74('0x1a'),_0x3804cc,_0x260e33);_0x15fd0d(_0x260e33);});});}exports[_0xda74('0x1d')]=function(_0xd07402){var _0x3fb049=this;return new Promise(function(_0x2ba203,_0x291dd6){return db['MailInteraction']['update'](_0xd07402['body'],{'raw':_0xd07402[_0xda74('0x1e')]?_0xd07402[_0xda74('0x1e')][_0xda74('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd07402[_0xda74('0x1e')]?_0xd07402['options']['where']||null:null,'attributes':_0xd07402[_0xda74('0x1e')]?_0xd07402[_0xda74('0x1e')][_0xda74('0x20')]||null:null,'limit':_0xd07402[_0xda74('0x1e')]?_0xd07402[_0xda74('0x1e')][_0xda74('0x21')]||null:null})[_0xda74('0x12')](function(_0x5d0bf8){logger[_0xda74('0x13')](_0xda74('0x1d'),_0xd07402);logger[_0xda74('0x15')]('UpdateMailInteraction',_0xd07402,JSON[_0xda74('0x17')](_0x5d0bf8));_0x2ba203(_0x5d0bf8);})[_0xda74('0x22')](function(_0x4fea29){logger[_0xda74('0x18')](_0xda74('0x1d'),_0x4fea29[_0xda74('0x1b')],_0xd07402);_0x291dd6(_0x3fb049[_0xda74('0x18')](0x1f4,_0x4fea29[_0xda74('0x1b')]));});});};exports['AddTagsToMailInteraction']=function(_0x5b869c){return new Promise(function(_0x1ead55,_0x4d0098){return db[_0xda74('0x23')][_0xda74('0x24')]({'where':_0x5b869c['options']?_0x5b869c[_0xda74('0x1e')]['where']||null:null})[_0xda74('0x12')](function(_0xf67c5c){if(_0xf67c5c){return _0xf67c5c[_0xda74('0x25')](_0x5b869c['body'][_0xda74('0x26')],_[_0xda74('0x27')](_0x5b869c[_0xda74('0x28')],[_0xda74('0x26'),'id'])||{});}})['spread'](function(_0x25d14e){logger[_0xda74('0x13')]('AddTags',_0x5b869c);logger[_0xda74('0x15')](_0xda74('0x29'),_0x5b869c,JSON[_0xda74('0x17')](_0x25d14e));_0x1ead55(_0x25d14e);})[_0xda74('0x22')](function(_0xd703f){logger['error'](_0xda74('0x29'),_0xd703f[_0xda74('0x1b')],_0x5b869c);_0x4d0098(_this['error'](0x1f4,_0xd703f['message']));});});}; \ No newline at end of file +var _0xc560=['options','where','attributes','limit','AddTagsToMailInteraction','find','addTags','omit','spread','AddTags','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateMailInteraction','MailInteraction','update','body','raw'];(function(_0x279fb0,_0x23ee9e){var _0x1b4a73=function(_0x5dcf78){while(--_0x5dcf78){_0x279fb0['push'](_0x279fb0['shift']());}};_0x1b4a73(++_0x23ee9e);}(_0xc560,0x82));var _0x0c56=function(_0x4d8bce,_0x586813){_0x4d8bce=_0x4d8bce-0x0;var _0x3ab0fe=_0xc560[_0x4d8bce];return _0x3ab0fe;};'use strict';var _=require(_0x0c56('0x0'));var util=require('util');var moment=require(_0x0c56('0x1'));var BPromise=require('bluebird');var rs=require(_0x0c56('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0c56('0x3'));var logger=require(_0x0c56('0x4'))(_0x0c56('0x5'));var config=require(_0x0c56('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0c56('0x7')][_0x0c56('0x8')]({'port':0x232a});config[_0x0c56('0x9')]=_[_0x0c56('0xa')](config['redis'],{'host':_0x0c56('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0c56('0x9')]));require(_0x0c56('0xc'))[_0x0c56('0xd')](socket);function respondWithRpcPromise(_0x535444,_0x15979a,_0x41fd41){return new BPromise(function(_0x3651c6,_0x5e80cd){return client[_0x0c56('0xe')](_0x535444,_0x41fd41)[_0x0c56('0xf')](function(_0x2e2bec){logger[_0x0c56('0x10')](_0x0c56('0x11'),_0x15979a,_0x0c56('0x12'));logger[_0x0c56('0x13')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x15979a,'request\x20sent',JSON[_0x0c56('0x14')](_0x2e2bec));if(_0x2e2bec[_0x0c56('0x15')]){if(_0x2e2bec[_0x0c56('0x15')][_0x0c56('0x16')]===0x1f4){logger[_0x0c56('0x15')](_0x0c56('0x11'),_0x15979a,_0x2e2bec['error'][_0x0c56('0x17')]);return _0x5e80cd(_0x2e2bec[_0x0c56('0x15')][_0x0c56('0x17')]);}logger[_0x0c56('0x15')](_0x0c56('0x11'),_0x15979a,_0x2e2bec['error'][_0x0c56('0x17')]);return _0x3651c6(_0x2e2bec['error']['message']);}else{logger[_0x0c56('0x10')]('MailInteraction,\x20%s,\x20%s',_0x15979a,_0x0c56('0x12'));_0x3651c6(_0x2e2bec['result']['message']);}})[_0x0c56('0x18')](function(_0x11fc53){logger[_0x0c56('0x15')](_0x0c56('0x11'),_0x15979a,_0x11fc53);_0x5e80cd(_0x11fc53);});});}exports[_0x0c56('0x19')]=function(_0x253a86){var _0x34fdee=this;return new Promise(function(_0x3b9e6a,_0x27c230){return db[_0x0c56('0x1a')][_0x0c56('0x1b')](_0x253a86[_0x0c56('0x1c')],{'raw':_0x253a86['options']?_0x253a86['options'][_0x0c56('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x253a86[_0x0c56('0x1e')]?_0x253a86[_0x0c56('0x1e')][_0x0c56('0x1f')]||null:null,'attributes':_0x253a86[_0x0c56('0x1e')]?_0x253a86['options'][_0x0c56('0x20')]||null:null,'limit':_0x253a86[_0x0c56('0x1e')]?_0x253a86[_0x0c56('0x1e')][_0x0c56('0x21')]||null:null})[_0x0c56('0xf')](function(_0x48ced5){logger[_0x0c56('0x10')]('UpdateMailInteraction',_0x253a86);logger[_0x0c56('0x13')]('UpdateMailInteraction',_0x253a86,JSON[_0x0c56('0x14')](_0x48ced5));_0x3b9e6a(_0x48ced5);})[_0x0c56('0x18')](function(_0x885e5c){logger[_0x0c56('0x15')](_0x0c56('0x19'),_0x885e5c['message'],_0x253a86);_0x27c230(_0x34fdee[_0x0c56('0x15')](0x1f4,_0x885e5c['message']));});});};exports[_0x0c56('0x22')]=function(_0x3a8f23){return new Promise(function(_0x5f2077,_0x23fd09){return db['MailInteraction'][_0x0c56('0x23')]({'where':_0x3a8f23[_0x0c56('0x1e')]?_0x3a8f23[_0x0c56('0x1e')][_0x0c56('0x1f')]||null:null})[_0x0c56('0xf')](function(_0x21d8df){if(_0x21d8df){return _0x21d8df[_0x0c56('0x24')](_0x3a8f23[_0x0c56('0x1c')]['ids'],_[_0x0c56('0x25')](_0x3a8f23[_0x0c56('0x1c')],['ids','id'])||{});}})[_0x0c56('0x26')](function(_0x3a70a2){logger[_0x0c56('0x10')](_0x0c56('0x27'),_0x3a8f23);logger['debug'](_0x0c56('0x27'),_0x3a8f23,JSON[_0x0c56('0x14')](_0x3a70a2));_0x5f2077(_0x3a70a2);})['catch'](function(_0x33b1ca){logger['error'](_0x0c56('0x27'),_0x33b1ca[_0x0c56('0x17')],_0x3a8f23);_0x23fd09(_this[_0x0c56('0x15')](0x1f4,_0x33b1ca[_0x0c56('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index a58de8e..5bcd816 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 _0x577b=['length','mailInteraction:','./mailInteraction.events','remove','update','emit','removeListener','register'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x577b,0x10a));var _0xb577=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x577b[_0x525c7b];return _0x27b33e;};'use strict';var MailInteractionEvents=require(_0xb577('0x0'));var events=['save',_0xb577('0x1'),_0xb577('0x2')];function createListener(_0x1889c7,_0x2dc12c){return function(_0x319c63){_0x2dc12c[_0xb577('0x3')](_0x1889c7,_0x319c63);};}function removeListener(_0x4c9387,_0x3bcc6e){return function(){MailInteractionEvents[_0xb577('0x4')](_0x4c9387,_0x3bcc6e);};}exports[_0xb577('0x5')]=function(_0x322ce3){for(var _0x1efe53=0x0,_0xca21e7=events[_0xb577('0x6')];_0x1efe53<_0xca21e7;_0x1efe53++){var _0x37d684=events[_0x1efe53];var _0x583100=createListener(_0xb577('0x7')+_0x37d684,_0x322ce3);MailInteractionEvents['on'](_0x37d684,_0x583100);}}; \ No newline at end of file +var _0xb8ae=['length','mailInteraction:','./mailInteraction.events','save','remove','removeListener','register'];(function(_0x2af2dc,_0x20cfe4){var _0x2df30a=function(_0x53cdc7){while(--_0x53cdc7){_0x2af2dc['push'](_0x2af2dc['shift']());}};_0x2df30a(++_0x20cfe4);}(_0xb8ae,0xb1));var _0xeb8a=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xb8ae[_0x4c445a];return _0x2f611c;};'use strict';var MailInteractionEvents=require(_0xeb8a('0x0'));var events=[_0xeb8a('0x1'),_0xeb8a('0x2'),'update'];function createListener(_0x4c6bf6,_0x5f3f94){return function(_0x40cbd2){_0x5f3f94['emit'](_0x4c6bf6,_0x40cbd2);};}function removeListener(_0x84eceb,_0x4f5b83){return function(){MailInteractionEvents[_0xeb8a('0x3')](_0x84eceb,_0x4f5b83);};}exports[_0xeb8a('0x4')]=function(_0x39ffbc){for(var _0x38c288=0x0,_0x33b141=events[_0xeb8a('0x5')];_0x38c288<_0x33b141;_0x38c288++){var _0x5f0899=events[_0x38c288];var _0x17e34a=createListener(_0xeb8a('0x6')+_0x5f0899,_0x39ffbc);MailInteractionEvents['on'](_0x5f0899,_0x17e34a);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 4bf7d61..4071d04 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 _0x9f62=['./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id/download','tracked','mailmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','/:id','destroy','exports','util','connect-timeout','express','Router','../../config/environment'];(function(_0x3523ff,_0x4b8413){var _0xee01c1=function(_0x4c4724){while(--_0x4c4724){_0x3523ff['push'](_0x3523ff['shift']());}};_0xee01c1(++_0x4b8413);}(_0x9f62,0x154));var _0x29f6=function(_0x3c1519,_0x26fee2){_0x3c1519=_0x3c1519-0x0;var _0x212a32=_0x9f62[_0x3c1519];return _0x212a32;};'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('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x29f6('0xa'),auth[_0x29f6('0x7')](),controller['download']);router['post']('/',auth[_0x29f6('0x7')](),interaction[_0x29f6('0xb')]('mail',_0x29f6('0xc')),controller[_0x29f6('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x29f6('0xe')](_0x29f6('0xf'),auth[_0x29f6('0x7')](),controller[_0x29f6('0x10')]);router[_0x29f6('0xe')](_0x29f6('0x11'),auth[_0x29f6('0x7')](),controller[_0x29f6('0x12')]);router[_0x29f6('0x13')](_0x29f6('0x14'),auth[_0x29f6('0x7')](),controller[_0x29f6('0x15')]);module[_0x29f6('0x16')]=router; \ No newline at end of file +var _0x24ca=['../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','update','put','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x562fc7,_0x4c3017){var _0x35d49a=function(_0x135a78){while(--_0x135a78){_0x562fc7['push'](_0x562fc7['shift']());}};_0x35d49a(++_0x4c3017);}(_0x24ca,0x1bc));var _0xa24c=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0x24ca[_0x5f5cce];return _0x705ecf;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var auth=require(_0xa24c('0x4'));var interaction=require(_0xa24c('0x5'));var config=require(_0xa24c('0x6'));var controller=require(_0xa24c('0x7'));router[_0xa24c('0x8')]('/',auth[_0xa24c('0x9')](),controller[_0xa24c('0xa')]);router[_0xa24c('0x8')](_0xa24c('0xb'),auth[_0xa24c('0x9')](),controller[_0xa24c('0xc')]);router['get'](_0xa24c('0xd'),auth[_0xa24c('0x9')](),controller[_0xa24c('0xe')]);router['get'](_0xa24c('0xf'),auth[_0xa24c('0x9')](),controller[_0xa24c('0x10')]);router[_0xa24c('0x11')]('/',auth[_0xa24c('0x9')](),interaction[_0xa24c('0x12')](_0xa24c('0x13'),_0xa24c('0x14')),controller[_0xa24c('0x15')]);router['put'](_0xa24c('0xd'),auth[_0xa24c('0x9')](),controller[_0xa24c('0x16')]);router[_0xa24c('0x17')]('/:id/accept',auth[_0xa24c('0x9')](),controller[_0xa24c('0x18')]);router[_0xa24c('0x17')](_0xa24c('0x19'),auth[_0xa24c('0x9')](),controller[_0xa24c('0x1a')]);router[_0xa24c('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xa24c('0x1c')]);module[_0xa24c('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index f59ef2b..949bb24 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 _0xf5b6=['ENUM','out','DATE','INTEGER','exports','TEXT','long','BOOLEAN'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xf5b6,0x1b4));var _0x6f5b=function(_0x10b9d6,_0x255dbd){_0x10b9d6=_0x10b9d6-0x0;var _0x2bdb92=_0xf5b6[_0x10b9d6];return _0x2bdb92;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x6f5b('0x0')]={'body':{'type':Sequelize[_0x6f5b('0x1')](_0x6f5b('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x6f5b('0x1')]('medium')},'read':{'type':Sequelize[_0x6f5b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6f5b('0x4')]('in',_0x6f5b('0x5')),'defaultValue':_0x6f5b('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x6f5b('0x1')](_0x6f5b('0x2'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0x6f5b('0x1')]('long')},'subject':{'type':Sequelize[_0x6f5b('0x1')]},'sentAt':{'type':Sequelize[_0x6f5b('0x6')]},'attach':{'type':Sequelize[_0x6f5b('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x6f5b('0x6')]},'originTo':{'type':Sequelize['TEXT'](_0x6f5b('0x2'))},'originCc':{'type':Sequelize[_0x6f5b('0x1')](_0x6f5b('0x2'))}}; \ No newline at end of file +var _0xe820=['sequelize','exports','TEXT','medium','BOOLEAN','out','STRING','long','DATE','INTEGER'];(function(_0x1eb0bc,_0x575c6e){var _0x11dfe9=function(_0x4f696b){while(--_0x4f696b){_0x1eb0bc['push'](_0x1eb0bc['shift']());}};_0x11dfe9(++_0x575c6e);}(_0xe820,0xd2));var _0x0e82=function(_0x46a18b,_0x503131){_0x46a18b=_0x46a18b-0x0;var _0x2ff910=_0xe820[_0x46a18b];return _0x2ff910;};'use strict';var Sequelize=require(_0x0e82('0x0'));var _=require('lodash');module[_0x0e82('0x1')]={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x0e82('0x2')](_0x0e82('0x3'))},'read':{'type':Sequelize[_0x0e82('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x0e82('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x0e82('0x6')](0x1fe)},'from':{'type':Sequelize[_0x0e82('0x6')]},'to':{'type':Sequelize[_0x0e82('0x2')](_0x0e82('0x7'))},'cc':{'type':Sequelize[_0x0e82('0x2')]('long')},'bcc':{'type':Sequelize[_0x0e82('0x2')](_0x0e82('0x7'))},'subject':{'type':Sequelize[_0x0e82('0x2')]},'sentAt':{'type':Sequelize[_0x0e82('0x8')]},'attach':{'type':Sequelize[_0x0e82('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x0e82('0x8')]},'originTo':{'type':Sequelize[_0x0e82('0x2')](_0x0e82('0x7'))},'originCc':{'type':Sequelize[_0x0e82('0x2')](_0x0e82('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index fa6e48f..e45ddc3 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 _0x1e96=['./mailMessage.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message','info','catch','status','end','count','offset','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','stack','name','send','rawAttributes','model','query','attributes','intersection','fields','length','limit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','MailMessage','include','findAll','rows','show','params','keys','options','body','find','create','out','secret','MailAccount','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','messageId','stringify','mail-interactions','mail','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','MailInteraction','MailInteractionId','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','manual','SIP/%s','channel','event','accept','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','rejectmessage','unix','server','tmp','files','from','bcc','subject','createdAt','Attachment','Attachments','headers','Bcc','existsSync','push','readFileSync','download','log','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x1e96,0x11a));var _0x61e9=function(_0x559e71,_0x467331){_0x559e71=_0x559e71-0x0;var _0x48b222=_0x1e96[_0x559e71];return _0x48b222;};'use strict';var pdf=require(_0x61e9('0x0'));var emlformat=require(_0x61e9('0x1'));var rimraf=require(_0x61e9('0x2'));var zipdir=require(_0x61e9('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x61e9('0x4'));var moment=require(_0x61e9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x61e9('0x6'));var util=require('util');var path=require(_0x61e9('0x7'));var sox=require(_0x61e9('0x8'));var csv=require(_0x61e9('0x9'));var ejs=require(_0x61e9('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x61e9('0xb'));var crypto=require(_0x61e9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x61e9('0xd'));var toCsv=require(_0x61e9('0x9'));var querystring=require('querystring');var Papa=require(_0x61e9('0xe'));var Redis=require(_0x61e9('0xf'));var authService=require(_0x61e9('0x10'));var qs=require(_0x61e9('0x11'));var hardwareService=require(_0x61e9('0x12'));var logger=require('../../config/logger')(_0x61e9('0x13'));var utils=require(_0x61e9('0x14'));var config=require(_0x61e9('0x15'));var db=require(_0x61e9('0x16'))['db'];config[_0x61e9('0x17')]=_['defaults'](config[_0x61e9('0x17')],{'host':_0x61e9('0x18'),'port':0x18eb});var socket=require(_0x61e9('0x19'))(new Redis(config['redis']));require(_0x61e9('0x1a'))[_0x61e9('0x1b')](socket);var jayson=require(_0x61e9('0x1c'));var client=jayson[_0x61e9('0x1d')][_0x61e9('0x1e')]({'port':0x232c});var client9003=jayson[_0x61e9('0x1d')][_0x61e9('0x1e')]({'port':0x232b});var client9002=jayson[_0x61e9('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x33c598,_0x230991,_0x20dec7){if(_0x20dec7){var _0xa7258b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa7258b['test'](_0x230991)){return _0x33c598;}else{throw new Error(_0x61e9('0x1f'));}}else{return _0x33c598;}}function respondWithRpcPromise(_0x20b45f,_0x4883f4,_0x2bf711,_0x333682){return new BPromise(function(_0x154baa,_0x5e70ba){var _0x45903a=_0x333682||client;return _0x45903a['request'](_0x20b45f,_0x2bf711)['then'](function(_0x18c536){logger['info']('MailMessage,\x20%s,\x20%s',_0x4883f4,_0x61e9('0x20'));logger['debug'](_0x61e9('0x21'),_0x4883f4,_0x61e9('0x20'),JSON['stringify'](_0x18c536));if(_0x18c536[_0x61e9('0x22')]){if(_0x18c536[_0x61e9('0x22')][_0x61e9('0x23')]===0x1f4){logger[_0x61e9('0x22')](_0x61e9('0x24'),_0x4883f4,_0x18c536['error'][_0x61e9('0x25')]);return _0x5e70ba(_0x18c536[_0x61e9('0x22')][_0x61e9('0x25')]);}logger[_0x61e9('0x22')](_0x61e9('0x24'),_0x4883f4,_0x18c536[_0x61e9('0x22')]['message']);return _0x154baa(_0x18c536[_0x61e9('0x22')][_0x61e9('0x25')]);}else{logger[_0x61e9('0x26')](_0x61e9('0x24'),_0x4883f4,_0x61e9('0x20'));_0x154baa(_0x18c536['result']['message']);}})[_0x61e9('0x27')](function(_0x3abf32){logger[_0x61e9('0x22')](_0x61e9('0x24'),_0x4883f4,_0x3abf32);_0x5e70ba(_0x3abf32);});});}function respondWithStatusCode(_0x6869ab,_0x977aa7){_0x977aa7=_0x977aa7||0xcc;return function(_0x92d93e){if(_0x92d93e){return _0x6869ab['sendStatus'](_0x977aa7);}return _0x6869ab[_0x61e9('0x28')](_0x977aa7)[_0x61e9('0x29')]();};}function respondWithResult(_0x464776,_0x31e722){_0x31e722=_0x31e722||0xc8;return function(_0x35a5e1){if(_0x35a5e1){return _0x464776[_0x61e9('0x28')](_0x31e722)['json'](_0x35a5e1);}};}function respondWithFilteredResult(_0x14f584,_0x3d8888){return function(_0x51e1dc){if(_0x51e1dc){var _0x120685=_0x51e1dc[_0x61e9('0x2a')],_0x212fa6=_0x3d8888[_0x61e9('0x2b')],_0x6421c5=_0x3d8888[_0x61e9('0x2b')]+_0x3d8888['limit'],_0x1b6d7c;if(_0x6421c5>=_0x120685){_0x6421c5=_0x120685;_0x1b6d7c=0xc8;}else{_0x1b6d7c=0xce;}_0x14f584['status'](_0x1b6d7c);return _0x14f584[_0x61e9('0x2c')](_0x61e9('0x2d'),_0x212fa6+'-'+_0x6421c5+'/'+_0x120685)[_0x61e9('0x2e')](_0x51e1dc);}return null;};}function patchUpdates(_0x3cb70c){return function(_0x2025bb){try{jsonpatch[_0x61e9('0x2f')](_0x2025bb,_0x3cb70c,!![]);}catch(_0x200f9e){return BPromise['reject'](_0x200f9e);}return _0x2025bb[_0x61e9('0x30')]();};}function saveUpdates(_0x41615a,_0x3ff210){return function(_0x2280e1){if(_0x2280e1){return _0x2280e1[_0x61e9('0x31')](_0x41615a)[_0x61e9('0x32')](function(_0x5a2c66){return _0x5a2c66;});}return null;};}function removeEntity(_0x298816,_0x408634){return function(_0x3ee712){if(_0x3ee712){return _0x3ee712[_0x61e9('0x33')]()[_0x61e9('0x32')](function(){_0x298816[_0x61e9('0x28')](0xcc)[_0x61e9('0x29')]();});}};}function handleEntityNotFound(_0x148bfb,_0x1cebb7){return function(_0x5f0dfe){if(!_0x5f0dfe){_0x148bfb[_0x61e9('0x34')](0x194);}return _0x5f0dfe;};}function handleError(_0x540d66,_0x332cde){_0x332cde=_0x332cde||0x1f4;return function(_0xe6c3c5){logger[_0x61e9('0x22')](_0xe6c3c5[_0x61e9('0x35')]);if(_0xe6c3c5[_0x61e9('0x36')]){delete _0xe6c3c5[_0x61e9('0x36')];}_0x540d66[_0x61e9('0x28')](_0x332cde)[_0x61e9('0x37')](_0xe6c3c5);};}exports['index']=function(_0x11c93e,_0x48ef8c){var _0x1bdd2c={},_0x3c29c0={},_0x3a4c83={'count':0x0,'rows':[]};var _0x13c358=db['MailMessage'][_0x61e9('0x38')];_0x3c29c0[_0x61e9('0x39')]=_['keys'](_0x13c358);_0x3c29c0[_0x61e9('0x3a')]=_['keys'](_0x11c93e[_0x61e9('0x3a')]);_0x3c29c0['filters']=_['intersection'](_0x3c29c0['model'],_0x3c29c0[_0x61e9('0x3a')]);_0x1bdd2c[_0x61e9('0x3b')]=_[_0x61e9('0x3c')](_0x3c29c0[_0x61e9('0x39')],qs[_0x61e9('0x3d')](_0x11c93e[_0x61e9('0x3a')][_0x61e9('0x3d')]));_0x1bdd2c[_0x61e9('0x3b')]=_0x1bdd2c[_0x61e9('0x3b')][_0x61e9('0x3e')]?_0x1bdd2c[_0x61e9('0x3b')]:_0x3c29c0[_0x61e9('0x39')];if(!_0x11c93e[_0x61e9('0x3a')]['hasOwnProperty']('nolimit')){_0x1bdd2c['limit']=qs['limit'](_0x11c93e[_0x61e9('0x3a')][_0x61e9('0x3f')]);_0x1bdd2c[_0x61e9('0x2b')]=qs[_0x61e9('0x2b')](_0x11c93e['query'][_0x61e9('0x2b')]);}_0x1bdd2c[_0x61e9('0x40')]=qs[_0x61e9('0x41')](_0x11c93e[_0x61e9('0x3a')]['sort']);_0x1bdd2c[_0x61e9('0x42')]=qs[_0x61e9('0x43')](_[_0x61e9('0x44')](_0x11c93e['query'],_0x3c29c0['filters']));if(_0x11c93e['query'][_0x61e9('0x45')]){_0x1bdd2c[_0x61e9('0x42')]=_[_0x61e9('0x46')](_0x1bdd2c[_0x61e9('0x42')],{'$or':_[_0x61e9('0x47')](_0x13c358,function(_0x206471){if(_0x206471[_0x61e9('0x48')][_0x61e9('0x49')]!==_0x61e9('0x4a')){var _0x4b75dd={};_0x4b75dd[_0x206471[_0x61e9('0x4b')]]={'$like':'%'+_0x11c93e[_0x61e9('0x3a')][_0x61e9('0x45')]+'%'};return _0x4b75dd;}})});}_0x1bdd2c=_[_0x61e9('0x46')]({},_0x1bdd2c,_0x11c93e['options']);var _0x540ee1={'where':_0x1bdd2c[_0x61e9('0x42')]};return db[_0x61e9('0x4c')][_0x61e9('0x2a')](_0x540ee1)[_0x61e9('0x32')](function(_0x1e6310){_0x3a4c83[_0x61e9('0x2a')]=_0x1e6310;if(_0x11c93e[_0x61e9('0x3a')]['includeAll']){_0x1bdd2c[_0x61e9('0x4d')]=[{'all':!![]}];}return db['MailMessage'][_0x61e9('0x4e')](_0x1bdd2c);})[_0x61e9('0x32')](function(_0x24cfc3){_0x3a4c83[_0x61e9('0x4f')]=_0x24cfc3;return _0x3a4c83;})['then'](respondWithFilteredResult(_0x48ef8c,_0x1bdd2c))[_0x61e9('0x27')](handleError(_0x48ef8c,null));};exports[_0x61e9('0x50')]=function(_0x4dc38b,_0x2e3f88){var _0x287953={'raw':!![],'where':{'id':_0x4dc38b[_0x61e9('0x51')]['id']}},_0x3a53d0={};_0x3a53d0[_0x61e9('0x39')]=_[_0x61e9('0x52')](db['MailMessage']['rawAttributes']);_0x3a53d0[_0x61e9('0x3a')]=_['keys'](_0x4dc38b['query']);_0x3a53d0['filters']=_[_0x61e9('0x3c')](_0x3a53d0['model'],_0x3a53d0[_0x61e9('0x3a')]);_0x287953['attributes']=_[_0x61e9('0x3c')](_0x3a53d0[_0x61e9('0x39')],qs[_0x61e9('0x3d')](_0x4dc38b[_0x61e9('0x3a')][_0x61e9('0x3d')]));_0x287953[_0x61e9('0x3b')]=_0x287953['attributes'][_0x61e9('0x3e')]?_0x287953['attributes']:_0x3a53d0['model'];if(_0x4dc38b['query']['includeAll']){_0x287953['include']=[{'all':!![]}];}_0x287953=_['merge']({},_0x287953,_0x4dc38b[_0x61e9('0x53')]);return db[_0x61e9('0x4c')]['find'](_0x287953)['then'](handleEntityNotFound(_0x2e3f88,null))[_0x61e9('0x32')](respondWithResult(_0x2e3f88,null))[_0x61e9('0x27')](handleError(_0x2e3f88,null));};exports[_0x61e9('0x31')]=function(_0x93229e,_0x183a5b){if(_0x93229e[_0x61e9('0x54')]['id']){delete _0x93229e[_0x61e9('0x54')]['id'];}return db['MailMessage']['find']({'where':{'id':_0x93229e['params']['id']}})['then'](handleEntityNotFound(_0x183a5b,null))[_0x61e9('0x32')](saveUpdates(_0x93229e[_0x61e9('0x54')],null))[_0x61e9('0x32')](respondWithResult(_0x183a5b,null))[_0x61e9('0x27')](handleError(_0x183a5b,null));};exports[_0x61e9('0x33')]=function(_0x1de290,_0x18daab){return db[_0x61e9('0x4c')][_0x61e9('0x55')]({'where':{'id':_0x1de290[_0x61e9('0x51')]['id']}})[_0x61e9('0x32')](handleEntityNotFound(_0x18daab,null))[_0x61e9('0x32')](removeEntity(_0x18daab,null))[_0x61e9('0x27')](handleError(_0x18daab,null));};exports['describe']=function(_0x2d5248,_0x5517f4){return db[_0x61e9('0x4c')]['describe']()[_0x61e9('0x32')](respondWithResult(_0x5517f4,null))[_0x61e9('0x27')](handleError(_0x5517f4,null));};exports[_0x61e9('0x56')]=function(_0x5d4a6b,_0x2d3de8){return db[_0x61e9('0x4c')][_0x61e9('0x56')](_0x5d4a6b[_0x61e9('0x54')])[_0x61e9('0x32')](function(_0x502c23){if(_0x502c23){if(_0x502c23['direction']===_0x61e9('0x57')&&!_0x502c23[_0x61e9('0x58')]){return db[_0x61e9('0x59')]['findOne']({'where':{'id':_0x502c23['MailAccountId']},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})['then'](function(_0x3b5359){if(_0x3b5359&&_0x3b5359[_0x61e9('0x5a')]){var _0x12552c={'tls':{'rejectUnauthorized':![]}};if(_[_0x61e9('0x5b')](_0x3b5359[_0x61e9('0x5a')][_0x61e9('0x5c')])){_0x12552c[_0x61e9('0x5d')]=_0x3b5359[_0x61e9('0x5a')][_0x61e9('0x5d')];_0x12552c['port']=_0x3b5359[_0x61e9('0x5a')][_0x61e9('0x5e')];_0x12552c[_0x61e9('0x5f')]=_0x3b5359[_0x61e9('0x5a')][_0x61e9('0x5f')];if(_0x3b5359[_0x61e9('0x5a')][_0x61e9('0x60')]){_0x12552c[_0x61e9('0x61')]={'user':_0x3b5359[_0x61e9('0x5a')][_0x61e9('0x62')],'pass':_0x3b5359[_0x61e9('0x5a')][_0x61e9('0x63')]};}}else{_0x12552c['service']=_0x3b5359['Smtp'][_0x61e9('0x5c')];_0x12552c[_0x61e9('0x61')]={'user':_0x3b5359[_0x61e9('0x5a')][_0x61e9('0x62')],'pass':_0x3b5359[_0x61e9('0x5a')][_0x61e9('0x63')]};_0x12552c['secure']=_0x3b5359[_0x61e9('0x5a')][_0x61e9('0x5f')];}if(_0x5d4a6b['body']['attachments']&&_0x5d4a6b[_0x61e9('0x54')][_0x61e9('0x64')]['length']){for(var _0x38f5ee=0x0;_0x38f5ee<_0x5d4a6b[_0x61e9('0x54')][_0x61e9('0x64')][_0x61e9('0x3e')];_0x38f5ee+=0x1){_0x5d4a6b[_0x61e9('0x54')][_0x61e9('0x64')][_0x38f5ee]={'filename':_0x5d4a6b[_0x61e9('0x54')][_0x61e9('0x64')][_0x38f5ee][_0x61e9('0x36')],'path':path[_0x61e9('0x65')](config[_0x61e9('0x66')],_0x61e9('0x67'),_0x5d4a6b[_0x61e9('0x54')]['attachments'][_0x38f5ee][_0x61e9('0x68')])};}}return{'account':_0x12552c,'message':_0x5d4a6b['body']};}})['then'](function(_0x3c5167){if(_0x3c5167){return respondWithRpcPromise(_0x61e9('0x69'),_0x61e9('0x6a'),_0x3c5167,client9003)[_0x61e9('0x32')](function(_0x59684a){return _0x502c23[_0x61e9('0x31')]({'read':!![],'messageId':_0x59684a[_0x61e9('0x6b')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x61e9('0x27')](function(_0x122210){logger[_0x61e9('0x22')]('%s',JSON[_0x61e9('0x6c')](_0x122210));return _0x502c23;});}return _0x502c23;});}return _0x502c23;}})[_0x61e9('0x32')](respondWithResult(_0x2d3de8,0xc9))['catch'](handleError(_0x2d3de8,null));};var interaction_log=require('../../config/logger')(_0x61e9('0x6d'));exports['accept']=function(_0x22a14,_0x4e1561,_0x39d240){var _0x158c1c={'channel':_0x61e9('0x6e')};if(_0x22a14['body']['id']){delete _0x22a14[_0x61e9('0x54')]['id'];}_0x22a14[_0x61e9('0x54')][_0x61e9('0x6f')]=!![];_0x22a14[_0x61e9('0x54')]['readAt']=moment()[_0x61e9('0x70')](_0x61e9('0x71'));_0x22a14[_0x61e9('0x54')]['UserId']=_0x22a14[_0x61e9('0x54')][_0x61e9('0x72')]||_0x22a14[_0x61e9('0x62')]['id'];return db[_0x61e9('0x4c')][_0x61e9('0x55')]({'where':{'id':_0x22a14[_0x61e9('0x51')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x61e9('0x73')}]})[_0x61e9('0x32')](handleEntityNotFound(_0x4e1561,null))['then'](saveUpdates(_0x22a14[_0x61e9('0x54')],null))[_0x61e9('0x32')](function(_0x4e651e){if(_0x4e651e){_0x158c1c[_0x61e9('0x25')]=_0x4e651e[_0x61e9('0x74')]({'plain':!![]});return db[_0x61e9('0x75')][_0x61e9('0x55')]({'where':{'id':_0x4e651e[_0x61e9('0x76')]}});}return null;})['then'](handleEntityNotFound(_0x4e1561,null))[_0x61e9('0x32')](function(_0x331e1b){if(_0x331e1b){return _0x331e1b[_0x61e9('0x31')]({'UserId':_0x22a14['body'][_0x61e9('0x72')],'read1stAt':_['isNil'](_0x331e1b[_0x61e9('0x77')])?moment()[_0x61e9('0x70')](_0x61e9('0x71')):undefined});}return null;})[_0x61e9('0x32')](function(_0x23f128){if(_0x23f128){_0x158c1c['interaction']=_0x23f128[_0x61e9('0x74')]({'plain':!![]});interaction_log[_0x61e9('0x26')](_0x61e9('0x78'),_0x22a14[_0x61e9('0x62')]['id'],_0x22a14[_0x61e9('0x62')][_0x61e9('0x36')],_0x22a14['user'][_0x61e9('0x79')],_0x158c1c[_0x61e9('0x7a')]['id'],_0x22a14[_0x61e9('0x54')]?JSON[_0x61e9('0x6c')](_0x22a14[_0x61e9('0x54')]):_0x61e9('0x7b'));return respondWithRpcPromise(_0x61e9('0x7c'),'acceptMessage',_0x158c1c);}return null;})['then'](function(_0x1c7c85){if(_0x1c7c85){if(_0x22a14[_0x61e9('0x54')][_0x61e9('0x7d')]){_0x158c1c[_0x61e9('0x25')]['interface']=util[_0x61e9('0x70')](_0x61e9('0x7e'),_0x22a14[_0x61e9('0x62')]['name']);_0x158c1c[_0x61e9('0x25')][_0x61e9('0x7f')]=_0x158c1c[_0x61e9('0x7f')];_0x158c1c[_0x61e9('0x25')][_0x61e9('0x80')]=_0x61e9('0x81');return respondWithRpcPromise(_0x61e9('0x82'),_0x61e9('0x82'),{'event':'acceptmessage','message':_0x158c1c[_0x61e9('0x25')]},client9002)[_0x61e9('0x32')](function(){return _0x158c1c;});}return _0x158c1c;}return null;})[_0x61e9('0x32')](respondWithResult(_0x4e1561,null))['catch'](handleError(_0x4e1561,null));};var interaction_log=require('../../config/logger')(_0x61e9('0x6d'));exports[_0x61e9('0x83')]=function(_0x222d19,_0x1c13a2,_0x1aa1fd){var _0x4d08b4={'agent':{},'channel':_0x61e9('0x6e')};if(_0x222d19['body']['id']){delete _0x222d19[_0x61e9('0x54')]['id'];}_0x222d19[_0x61e9('0x54')][_0x61e9('0x72')]=_0x222d19['body']['UserId']||_0x222d19[_0x61e9('0x62')]['id'];_0x4d08b4['agent']['id']=_0x222d19[_0x61e9('0x54')]['UserId'];return db[_0x61e9('0x4c')][_0x61e9('0x55')]({'where':{'id':_0x222d19[_0x61e9('0x51')]['id'],'UserId':null}})[_0x61e9('0x32')](handleEntityNotFound(_0x1c13a2,null))['then'](function(_0x176f56){if(_0x176f56){_0x4d08b4['message']=_0x176f56[_0x61e9('0x74')]({'plain':!![]});return db[_0x61e9('0x75')][_0x61e9('0x55')]({'where':{'id':_0x176f56['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1c13a2,null))[_0x61e9('0x32')](function(_0x542f27){if(_0x542f27){_0x4d08b4[_0x61e9('0x7a')]=_0x542f27[_0x61e9('0x74')]({'plain':!![]});interaction_log['info'](_0x61e9('0x84'),_0x222d19[_0x61e9('0x62')]['id'],_0x222d19[_0x61e9('0x62')]['name'],_0x222d19[_0x61e9('0x62')][_0x61e9('0x79')],_0x4d08b4[_0x61e9('0x7a')]['id'],_0x222d19['body']?JSON[_0x61e9('0x6c')](_0x222d19[_0x61e9('0x54')]):_0x61e9('0x7b'));return respondWithRpcPromise(_0x61e9('0x85'),_0x61e9('0x86'),_0x4d08b4);}return null;})[_0x61e9('0x32')](function(_0x1b7ba4){if(_0x1b7ba4){_0x1b7ba4[_0x61e9('0x25')][_0x61e9('0x87')]=util[_0x61e9('0x70')]('SIP/%s',_0x222d19[_0x61e9('0x62')][_0x61e9('0x36')]);_0x1b7ba4[_0x61e9('0x25')][_0x61e9('0x7f')]=_0x4d08b4['channel'];_0x1b7ba4['message'][_0x61e9('0x80')]=_0x61e9('0x83');respondWithRpcPromise(_0x61e9('0x82'),'EventManager',{'event':_0x61e9('0x88'),'message':_0x1b7ba4['message']},client9002);return _0x4d08b4;}return null;})[_0x61e9('0x32')](respondWithResult(_0x1c13a2,null))['catch'](handleError(_0x1c13a2,null));};exports['download']=function(_0x413cd4,_0x3d049e){var _0x30ed10=moment()[_0x61e9('0x89')]()['toString']();var _0x58c412=path[_0x61e9('0x65')](config[_0x61e9('0x66')],_0x61e9('0x8a'),'files',_0x61e9('0x8b'));var _0x3406d9=path[_0x61e9('0x65')](config['root'],_0x61e9('0x8a'),_0x61e9('0x8c'),_0x61e9('0x64'));var _0x153951=util[_0x61e9('0x70')]('message-%s.eml',_0x30ed10);return db[_0x61e9('0x4c')][_0x61e9('0x55')]({'where':{'id':_0x413cd4[_0x61e9('0x51')]['id']},'attributes':['id',_0x61e9('0x54'),_0x61e9('0x8d'),'to','cc',_0x61e9('0x8e'),_0x61e9('0x8f'),_0x61e9('0x90')],'include':_0x413cd4[_0x61e9('0x3a')]['attachments']?[{'model':db[_0x61e9('0x91')],'as':_0x61e9('0x92')}]:undefined})[_0x61e9('0x32')](handleEntityNotFound(_0x3d049e,null))[_0x61e9('0x32')](function(_0x2f28b1){if(_0x2f28b1){var _0x402cfc=_0x2f28b1;var _0x16539b={'from':_0x402cfc['from'],'to':_0x402cfc['to'],'subject':_0x402cfc[_0x61e9('0x8f')],'html':_0x402cfc[_0x61e9('0x54')],'headers':{'Date':moment(_0x402cfc[_0x61e9('0x90')])[_0x61e9('0x70')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x2f28b1['cc']){_0x16539b[_0x61e9('0x93')]['Cc']=_0x2f28b1['cc'];}if(_0x2f28b1[_0x61e9('0x8e')]){_0x16539b[_0x61e9('0x93')][_0x61e9('0x94')]=_0x2f28b1[_0x61e9('0x8e')];}return new BPromise(function(_0xab4799,_0x2099ec){if(_0x2f28b1[_0x61e9('0x92')]){for(var _0x1db1f5=0x0;_0x1db1f5<_0x2f28b1[_0x61e9('0x92')][_0x61e9('0x3e')];_0x1db1f5++){var _0x24085d=_0x2f28b1[_0x61e9('0x92')][_0x1db1f5];var _0x2cd216=path[_0x61e9('0x65')](_0x3406d9,_0x24085d['basename']);if(fs[_0x61e9('0x95')](_0x2cd216)){_0x16539b['attachments'][_0x61e9('0x96')]({'name':_0x24085d['name'],'contentType':_0x24085d['type'],'data':fs[_0x61e9('0x97')](_0x2cd216)});}}}emlformat['build'](_0x16539b,function(_0x5daa71,_0x3b792e){if(_0x5daa71)return _0x2099ec(_0x5daa71);fs['writeFileSync'](path[_0x61e9('0x65')](_0x58c412,_0x153951),_0x3b792e);return _0xab4799(_0x3b792e);});});}})['then'](function(_0x125287){if(_0x125287){return _0x3d049e[_0x61e9('0x98')](path[_0x61e9('0x65')](_0x58c412,_0x153951),_0x153951,function(_0x4be15e){if(_0x4be15e){console[_0x61e9('0x99')]('err',_0x4be15e);}else{fs['unlinkSync'](path[_0x61e9('0x65')](_0x58c412,_0x153951));}});}})[_0x61e9('0x27')](handleError(_0x3d049e,null));}; \ No newline at end of file +var _0xab80=['squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','update','index','rawAttributes','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','map','key','VIRTUAL','field','merge','options','MailMessage','include','findAll','rows','params','keys','find','body','destroy','describe','direction','out','secret','MailAccount','findOne','MailAccountId','MailServerOut','Smtp','isNil','host','port','authentication','user','service','auth','pass','secure','attachments','name','root','server/files/attachments','basename','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','readAt','UserId','CmContact','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','mail-interactions','mail','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','rejectmessage','download','unix','toString','join','server','files','tmp','message-%s.eml','from','subject','createdAt','Attachment','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','headers','Attachments','existsSync','push','readFileSync','writeFileSync','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xab80,0x137));var _0x0ab8=function(_0x443cc1,_0xe795b8){_0x443cc1=_0x443cc1-0x0;var _0x1e3ba8=_0xab80[_0x443cc1];return _0x1e3ba8;};'use strict';var pdf=require(_0x0ab8('0x0'));var emlformat=require(_0x0ab8('0x1'));var rimraf=require(_0x0ab8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ab8('0x3'));var rp=require('request-promise');var moment=require(_0x0ab8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0ab8('0x5'));var util=require(_0x0ab8('0x6'));var path=require(_0x0ab8('0x7'));var sox=require(_0x0ab8('0x8'));var csv=require('to-csv');var ejs=require(_0x0ab8('0x9'));var fs=require('fs');var _=require(_0x0ab8('0xa'));var squel=require(_0x0ab8('0xb'));var crypto=require(_0x0ab8('0xc'));var jsforce=require(_0x0ab8('0xd'));var deskjs=require(_0x0ab8('0xe'));var toCsv=require(_0x0ab8('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0ab8('0x10'));var authService=require(_0x0ab8('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0ab8('0x12'));var logger=require(_0x0ab8('0x13'))(_0x0ab8('0x14'));var utils=require(_0x0ab8('0x15'));var config=require('../../config/environment');var db=require(_0x0ab8('0x16'))['db'];config[_0x0ab8('0x17')]=_['defaults'](config[_0x0ab8('0x17')],{'host':_0x0ab8('0x18'),'port':0x18eb});var socket=require(_0x0ab8('0x19'))(new Redis(config[_0x0ab8('0x17')]));require(_0x0ab8('0x1a'))[_0x0ab8('0x1b')](socket);var jayson=require(_0x0ab8('0x1c'));var client=jayson[_0x0ab8('0x1d')][_0x0ab8('0x1e')]({'port':0x232c});var client9003=jayson[_0x0ab8('0x1d')][_0x0ab8('0x1e')]({'port':0x232b});var client9002=jayson[_0x0ab8('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0xdd9fe,_0x3a8804,_0x2d0873){if(_0x2d0873){var _0x22e8e5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x22e8e5[_0x0ab8('0x1f')](_0x3a8804)){return _0xdd9fe;}else{throw new Error(_0x0ab8('0x20'));}}else{return _0xdd9fe;}}function respondWithRpcPromise(_0x57d9b6,_0x31dbce,_0x2c7d88,_0x241cd5){return new BPromise(function(_0x15751c,_0x71a38){var _0x547b2e=_0x241cd5||client;return _0x547b2e['request'](_0x57d9b6,_0x2c7d88)[_0x0ab8('0x21')](function(_0x1731d2){logger[_0x0ab8('0x22')](_0x0ab8('0x23'),_0x31dbce,'request\x20sent');logger[_0x0ab8('0x24')](_0x0ab8('0x25'),_0x31dbce,'request\x20sent',JSON[_0x0ab8('0x26')](_0x1731d2));if(_0x1731d2['error']){if(_0x1731d2['error'][_0x0ab8('0x27')]===0x1f4){logger[_0x0ab8('0x28')](_0x0ab8('0x23'),_0x31dbce,_0x1731d2[_0x0ab8('0x28')][_0x0ab8('0x29')]);return _0x71a38(_0x1731d2[_0x0ab8('0x28')][_0x0ab8('0x29')]);}logger[_0x0ab8('0x28')](_0x0ab8('0x23'),_0x31dbce,_0x1731d2[_0x0ab8('0x28')][_0x0ab8('0x29')]);return _0x15751c(_0x1731d2[_0x0ab8('0x28')][_0x0ab8('0x29')]);}else{logger[_0x0ab8('0x22')]('MailMessage,\x20%s,\x20%s',_0x31dbce,_0x0ab8('0x2a'));_0x15751c(_0x1731d2[_0x0ab8('0x2b')][_0x0ab8('0x29')]);}})[_0x0ab8('0x2c')](function(_0x13caa1){logger['error'](_0x0ab8('0x23'),_0x31dbce,_0x13caa1);_0x71a38(_0x13caa1);});});}function respondWithStatusCode(_0x4698b7,_0x58031e){_0x58031e=_0x58031e||0xcc;return function(_0x3b676d){if(_0x3b676d){return _0x4698b7[_0x0ab8('0x2d')](_0x58031e);}return _0x4698b7['status'](_0x58031e)[_0x0ab8('0x2e')]();};}function respondWithResult(_0x1ad854,_0x110a91){_0x110a91=_0x110a91||0xc8;return function(_0x56de4e){if(_0x56de4e){return _0x1ad854[_0x0ab8('0x2f')](_0x110a91)[_0x0ab8('0x30')](_0x56de4e);}};}function respondWithFilteredResult(_0x20d2b7,_0x103788){return function(_0x105a3c){if(_0x105a3c){var _0x4e4e2f=_0x105a3c[_0x0ab8('0x31')],_0x381a1e=_0x103788['offset'],_0x108d0e=_0x103788[_0x0ab8('0x32')]+_0x103788[_0x0ab8('0x33')],_0x587c6d;if(_0x108d0e>=_0x4e4e2f){_0x108d0e=_0x4e4e2f;_0x587c6d=0xc8;}else{_0x587c6d=0xce;}_0x20d2b7[_0x0ab8('0x2f')](_0x587c6d);return _0x20d2b7['set'](_0x0ab8('0x34'),_0x381a1e+'-'+_0x108d0e+'/'+_0x4e4e2f)['json'](_0x105a3c);}return null;};}function patchUpdates(_0xfd3ac6){return function(_0x12a645){try{jsonpatch['apply'](_0x12a645,_0xfd3ac6,!![]);}catch(_0x1782ed){return BPromise[_0x0ab8('0x35')](_0x1782ed);}return _0x12a645[_0x0ab8('0x36')]();};}function saveUpdates(_0x4db577,_0x25bea9){return function(_0xa6661e){if(_0xa6661e){return _0xa6661e[_0x0ab8('0x37')](_0x4db577)[_0x0ab8('0x21')](function(_0x3e75e1){return _0x3e75e1;});}return null;};}function removeEntity(_0xf8faa5,_0x35af69){return function(_0x1307e1){if(_0x1307e1){return _0x1307e1['destroy']()[_0x0ab8('0x21')](function(){_0xf8faa5[_0x0ab8('0x2f')](0xcc)[_0x0ab8('0x2e')]();});}};}function handleEntityNotFound(_0x15b471,_0x27267b){return function(_0x51fce2){if(!_0x51fce2){_0x15b471[_0x0ab8('0x2d')](0x194);}return _0x51fce2;};}function handleError(_0x445299,_0x72a6ae){_0x72a6ae=_0x72a6ae||0x1f4;return function(_0xd806ce){logger['error'](_0xd806ce['stack']);if(_0xd806ce['name']){delete _0xd806ce['name'];}_0x445299[_0x0ab8('0x2f')](_0x72a6ae)['send'](_0xd806ce);};}exports[_0x0ab8('0x38')]=function(_0x3ab72f,_0x231e92){var _0xe7887c={},_0x58b0bb={},_0x4fbcd7={'count':0x0,'rows':[]};var _0x5d874f=db['MailMessage'][_0x0ab8('0x39')];_0x58b0bb['model']=_['keys'](_0x5d874f);_0x58b0bb['query']=_['keys'](_0x3ab72f[_0x0ab8('0x3a')]);_0x58b0bb[_0x0ab8('0x3b')]=_['intersection'](_0x58b0bb[_0x0ab8('0x3c')],_0x58b0bb[_0x0ab8('0x3a')]);_0xe7887c[_0x0ab8('0x3d')]=_[_0x0ab8('0x3e')](_0x58b0bb['model'],qs['fields'](_0x3ab72f[_0x0ab8('0x3a')][_0x0ab8('0x3f')]));_0xe7887c[_0x0ab8('0x3d')]=_0xe7887c[_0x0ab8('0x3d')][_0x0ab8('0x40')]?_0xe7887c[_0x0ab8('0x3d')]:_0x58b0bb[_0x0ab8('0x3c')];if(!_0x3ab72f[_0x0ab8('0x3a')][_0x0ab8('0x41')](_0x0ab8('0x42'))){_0xe7887c[_0x0ab8('0x33')]=qs[_0x0ab8('0x33')](_0x3ab72f['query'][_0x0ab8('0x33')]);_0xe7887c[_0x0ab8('0x32')]=qs[_0x0ab8('0x32')](_0x3ab72f[_0x0ab8('0x3a')][_0x0ab8('0x32')]);}_0xe7887c['order']=qs[_0x0ab8('0x43')](_0x3ab72f[_0x0ab8('0x3a')][_0x0ab8('0x43')]);_0xe7887c[_0x0ab8('0x44')]=qs[_0x0ab8('0x3b')](_['pick'](_0x3ab72f[_0x0ab8('0x3a')],_0x58b0bb[_0x0ab8('0x3b')]));if(_0x3ab72f[_0x0ab8('0x3a')][_0x0ab8('0x45')]){_0xe7887c['where']=_['merge'](_0xe7887c[_0x0ab8('0x44')],{'$or':_[_0x0ab8('0x46')](_0x5d874f,function(_0x2b54d0){if(_0x2b54d0['type'][_0x0ab8('0x47')]!==_0x0ab8('0x48')){var _0x916fc1={};_0x916fc1[_0x2b54d0[_0x0ab8('0x49')]]={'$like':'%'+_0x3ab72f['query']['filter']+'%'};return _0x916fc1;}})});}_0xe7887c=_[_0x0ab8('0x4a')]({},_0xe7887c,_0x3ab72f[_0x0ab8('0x4b')]);var _0x105fa1={'where':_0xe7887c[_0x0ab8('0x44')]};return db[_0x0ab8('0x4c')][_0x0ab8('0x31')](_0x105fa1)[_0x0ab8('0x21')](function(_0x491009){_0x4fbcd7[_0x0ab8('0x31')]=_0x491009;if(_0x3ab72f[_0x0ab8('0x3a')]['includeAll']){_0xe7887c[_0x0ab8('0x4d')]=[{'all':!![]}];}return db[_0x0ab8('0x4c')][_0x0ab8('0x4e')](_0xe7887c);})['then'](function(_0x21e5e1){_0x4fbcd7[_0x0ab8('0x4f')]=_0x21e5e1;return _0x4fbcd7;})[_0x0ab8('0x21')](respondWithFilteredResult(_0x231e92,_0xe7887c))['catch'](handleError(_0x231e92,null));};exports['show']=function(_0x4aa12e,_0x57f315){var _0x5ae067={'raw':!![],'where':{'id':_0x4aa12e[_0x0ab8('0x50')]['id']}},_0x18bc24={};_0x18bc24[_0x0ab8('0x3c')]=_[_0x0ab8('0x51')](db[_0x0ab8('0x4c')][_0x0ab8('0x39')]);_0x18bc24[_0x0ab8('0x3a')]=_[_0x0ab8('0x51')](_0x4aa12e['query']);_0x18bc24['filters']=_['intersection'](_0x18bc24['model'],_0x18bc24[_0x0ab8('0x3a')]);_0x5ae067[_0x0ab8('0x3d')]=_[_0x0ab8('0x3e')](_0x18bc24[_0x0ab8('0x3c')],qs['fields'](_0x4aa12e[_0x0ab8('0x3a')]['fields']));_0x5ae067[_0x0ab8('0x3d')]=_0x5ae067[_0x0ab8('0x3d')][_0x0ab8('0x40')]?_0x5ae067['attributes']:_0x18bc24[_0x0ab8('0x3c')];if(_0x4aa12e[_0x0ab8('0x3a')]['includeAll']){_0x5ae067[_0x0ab8('0x4d')]=[{'all':!![]}];}_0x5ae067=_['merge']({},_0x5ae067,_0x4aa12e[_0x0ab8('0x4b')]);return db['MailMessage'][_0x0ab8('0x52')](_0x5ae067)[_0x0ab8('0x21')](handleEntityNotFound(_0x57f315,null))[_0x0ab8('0x21')](respondWithResult(_0x57f315,null))[_0x0ab8('0x2c')](handleError(_0x57f315,null));};exports[_0x0ab8('0x37')]=function(_0x4ce490,_0xe82747){if(_0x4ce490[_0x0ab8('0x53')]['id']){delete _0x4ce490[_0x0ab8('0x53')]['id'];}return db[_0x0ab8('0x4c')][_0x0ab8('0x52')]({'where':{'id':_0x4ce490['params']['id']}})[_0x0ab8('0x21')](handleEntityNotFound(_0xe82747,null))[_0x0ab8('0x21')](saveUpdates(_0x4ce490[_0x0ab8('0x53')],null))['then'](respondWithResult(_0xe82747,null))[_0x0ab8('0x2c')](handleError(_0xe82747,null));};exports[_0x0ab8('0x54')]=function(_0x48647b,_0x3e7e80){return db['MailMessage'][_0x0ab8('0x52')]({'where':{'id':_0x48647b[_0x0ab8('0x50')]['id']}})['then'](handleEntityNotFound(_0x3e7e80,null))[_0x0ab8('0x21')](removeEntity(_0x3e7e80,null))[_0x0ab8('0x2c')](handleError(_0x3e7e80,null));};exports[_0x0ab8('0x55')]=function(_0x5021b5,_0x3c4f1e){return db['MailMessage']['describe']()['then'](respondWithResult(_0x3c4f1e,null))[_0x0ab8('0x2c')](handleError(_0x3c4f1e,null));};exports['create']=function(_0x2c4bb2,_0x175e1f){return db[_0x0ab8('0x4c')]['create'](_0x2c4bb2[_0x0ab8('0x53')])[_0x0ab8('0x21')](function(_0x3a4907){if(_0x3a4907){if(_0x3a4907[_0x0ab8('0x56')]===_0x0ab8('0x57')&&!_0x3a4907[_0x0ab8('0x58')]){return db[_0x0ab8('0x59')][_0x0ab8('0x5a')]({'where':{'id':_0x3a4907[_0x0ab8('0x5b')]},'include':[{'model':db[_0x0ab8('0x5c')],'as':'Smtp','raw':!![]}]})[_0x0ab8('0x21')](function(_0x205bf6){if(_0x205bf6&&_0x205bf6[_0x0ab8('0x5d')]){var _0x2b5cda={'tls':{'rejectUnauthorized':![]}};if(_[_0x0ab8('0x5e')](_0x205bf6['Smtp']['service'])){_0x2b5cda[_0x0ab8('0x5f')]=_0x205bf6[_0x0ab8('0x5d')][_0x0ab8('0x5f')];_0x2b5cda[_0x0ab8('0x60')]=_0x205bf6['Smtp'][_0x0ab8('0x60')];_0x2b5cda['secure']=_0x205bf6[_0x0ab8('0x5d')]['secure'];if(_0x205bf6[_0x0ab8('0x5d')][_0x0ab8('0x61')]){_0x2b5cda['auth']={'user':_0x205bf6['Smtp'][_0x0ab8('0x62')],'pass':_0x205bf6[_0x0ab8('0x5d')]['pass']};}}else{_0x2b5cda[_0x0ab8('0x63')]=_0x205bf6[_0x0ab8('0x5d')][_0x0ab8('0x63')];_0x2b5cda[_0x0ab8('0x64')]={'user':_0x205bf6[_0x0ab8('0x5d')][_0x0ab8('0x62')],'pass':_0x205bf6['Smtp'][_0x0ab8('0x65')]};_0x2b5cda[_0x0ab8('0x66')]=_0x205bf6[_0x0ab8('0x5d')][_0x0ab8('0x66')];}if(_0x2c4bb2['body']['attachments']&&_0x2c4bb2[_0x0ab8('0x53')][_0x0ab8('0x67')][_0x0ab8('0x40')]){for(var _0x1f2444=0x0;_0x1f2444<_0x2c4bb2[_0x0ab8('0x53')]['attachments'][_0x0ab8('0x40')];_0x1f2444+=0x1){_0x2c4bb2[_0x0ab8('0x53')][_0x0ab8('0x67')][_0x1f2444]={'filename':_0x2c4bb2[_0x0ab8('0x53')][_0x0ab8('0x67')][_0x1f2444][_0x0ab8('0x68')],'path':path['join'](config[_0x0ab8('0x69')],_0x0ab8('0x6a'),_0x2c4bb2[_0x0ab8('0x53')][_0x0ab8('0x67')][_0x1f2444][_0x0ab8('0x6b')])};}}return{'account':_0x2b5cda,'message':_0x2c4bb2['body']};}})[_0x0ab8('0x21')](function(_0x213510){if(_0x213510){return respondWithRpcPromise(_0x0ab8('0x6c'),_0x0ab8('0x6d'),_0x213510,client9003)['then'](function(_0x483089){return _0x3a4907[_0x0ab8('0x37')]({'read':!![],'messageId':_0x483089[_0x0ab8('0x6e')],'sentAt':moment()[_0x0ab8('0x6f')](_0x0ab8('0x70'))});})[_0x0ab8('0x2c')](function(_0x11dc15){logger[_0x0ab8('0x28')]('%s',JSON[_0x0ab8('0x26')](_0x11dc15));return _0x3a4907;});}return _0x3a4907;});}return _0x3a4907;}})[_0x0ab8('0x21')](respondWithResult(_0x175e1f,0xc9))[_0x0ab8('0x2c')](handleError(_0x175e1f,null));};var interaction_log=require(_0x0ab8('0x13'))('mail-interactions');exports[_0x0ab8('0x71')]=function(_0x57e885,_0x5f1d3c,_0x49306e){var _0x2432d0={'channel':'mail'};if(_0x57e885[_0x0ab8('0x53')]['id']){delete _0x57e885[_0x0ab8('0x53')]['id'];}_0x57e885[_0x0ab8('0x53')]['read']=!![];_0x57e885[_0x0ab8('0x53')][_0x0ab8('0x72')]=moment()[_0x0ab8('0x6f')](_0x0ab8('0x70'));_0x57e885[_0x0ab8('0x53')]['UserId']=_0x57e885[_0x0ab8('0x53')][_0x0ab8('0x73')]||_0x57e885[_0x0ab8('0x62')]['id'];return db[_0x0ab8('0x4c')][_0x0ab8('0x52')]({'where':{'id':_0x57e885[_0x0ab8('0x50')]['id'],'UserId':null},'include':[{'model':db[_0x0ab8('0x74')],'as':'Contact'}]})[_0x0ab8('0x21')](handleEntityNotFound(_0x5f1d3c,null))[_0x0ab8('0x21')](saveUpdates(_0x57e885[_0x0ab8('0x53')],null))[_0x0ab8('0x21')](function(_0x2bb50a){if(_0x2bb50a){_0x2432d0[_0x0ab8('0x29')]=_0x2bb50a[_0x0ab8('0x75')]({'plain':!![]});return db[_0x0ab8('0x76')][_0x0ab8('0x52')]({'where':{'id':_0x2bb50a[_0x0ab8('0x77')]}});}return null;})[_0x0ab8('0x21')](handleEntityNotFound(_0x5f1d3c,null))[_0x0ab8('0x21')](function(_0x2274cc){if(_0x2274cc){return _0x2274cc['update']({'UserId':_0x57e885[_0x0ab8('0x53')][_0x0ab8('0x73')],'read1stAt':_[_0x0ab8('0x5e')](_0x2274cc[_0x0ab8('0x78')])?moment()[_0x0ab8('0x6f')](_0x0ab8('0x70')):undefined});}return null;})['then'](function(_0x36e939){if(_0x36e939){_0x2432d0[_0x0ab8('0x79')]=_0x36e939['get']({'plain':!![]});interaction_log['info'](_0x0ab8('0x7a'),_0x57e885[_0x0ab8('0x62')]['id'],_0x57e885[_0x0ab8('0x62')]['name'],_0x57e885[_0x0ab8('0x62')]['role'],_0x2432d0['interaction']['id'],_0x57e885['body']?JSON[_0x0ab8('0x26')](_0x57e885['body']):_0x0ab8('0x7b'));return respondWithRpcPromise('AcceptMessage',_0x0ab8('0x7c'),_0x2432d0);}return null;})[_0x0ab8('0x21')](function(_0x5108d7){if(_0x5108d7){if(_0x57e885[_0x0ab8('0x53')][_0x0ab8('0x7d')]){_0x2432d0[_0x0ab8('0x29')][_0x0ab8('0x7e')]=util[_0x0ab8('0x6f')](_0x0ab8('0x7f'),_0x57e885[_0x0ab8('0x62')]['name']);_0x2432d0[_0x0ab8('0x29')]['channel']=_0x2432d0[_0x0ab8('0x80')];_0x2432d0['message'][_0x0ab8('0x81')]=_0x0ab8('0x71');return respondWithRpcPromise('EventManager',_0x0ab8('0x82'),{'event':_0x0ab8('0x83'),'message':_0x2432d0[_0x0ab8('0x29')]},client9002)[_0x0ab8('0x21')](function(){return _0x2432d0;});}return _0x2432d0;}return null;})[_0x0ab8('0x21')](respondWithResult(_0x5f1d3c,null))[_0x0ab8('0x2c')](handleError(_0x5f1d3c,null));};var interaction_log=require(_0x0ab8('0x13'))(_0x0ab8('0x84'));exports[_0x0ab8('0x35')]=function(_0x8b2155,_0x14a7d2,_0x21cb43){var _0x859f79={'agent':{},'channel':_0x0ab8('0x85')};if(_0x8b2155[_0x0ab8('0x53')]['id']){delete _0x8b2155[_0x0ab8('0x53')]['id'];}_0x8b2155[_0x0ab8('0x53')]['UserId']=_0x8b2155[_0x0ab8('0x53')][_0x0ab8('0x73')]||_0x8b2155['user']['id'];_0x859f79[_0x0ab8('0x86')]['id']=_0x8b2155[_0x0ab8('0x53')][_0x0ab8('0x73')];return db[_0x0ab8('0x4c')][_0x0ab8('0x52')]({'where':{'id':_0x8b2155['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x14a7d2,null))[_0x0ab8('0x21')](function(_0xc8a98f){if(_0xc8a98f){_0x859f79[_0x0ab8('0x29')]=_0xc8a98f['get']({'plain':!![]});return db[_0x0ab8('0x76')]['find']({'where':{'id':_0xc8a98f[_0x0ab8('0x77')]}});}return null;})['then'](handleEntityNotFound(_0x14a7d2,null))['then'](function(_0x3c75ab){if(_0x3c75ab){_0x859f79[_0x0ab8('0x79')]=_0x3c75ab[_0x0ab8('0x75')]({'plain':!![]});interaction_log['info'](_0x0ab8('0x87'),_0x8b2155['user']['id'],_0x8b2155['user']['name'],_0x8b2155['user'][_0x0ab8('0x88')],_0x859f79[_0x0ab8('0x79')]['id'],_0x8b2155['body']?JSON[_0x0ab8('0x26')](_0x8b2155[_0x0ab8('0x53')]):'null');return respondWithRpcPromise(_0x0ab8('0x89'),_0x0ab8('0x8a'),_0x859f79);}return null;})[_0x0ab8('0x21')](function(_0xb64f61){if(_0xb64f61){_0xb64f61[_0x0ab8('0x29')][_0x0ab8('0x7e')]=util[_0x0ab8('0x6f')]('SIP/%s',_0x8b2155[_0x0ab8('0x62')][_0x0ab8('0x68')]);_0xb64f61[_0x0ab8('0x29')][_0x0ab8('0x80')]=_0x859f79[_0x0ab8('0x80')];_0xb64f61['message'][_0x0ab8('0x81')]=_0x0ab8('0x35');respondWithRpcPromise(_0x0ab8('0x82'),_0x0ab8('0x82'),{'event':_0x0ab8('0x8b'),'message':_0xb64f61[_0x0ab8('0x29')]},client9002);return _0x859f79;}return null;})[_0x0ab8('0x21')](respondWithResult(_0x14a7d2,null))[_0x0ab8('0x2c')](handleError(_0x14a7d2,null));};exports[_0x0ab8('0x8c')]=function(_0xd67157,_0x2a5f99){var _0x18fc07=moment()[_0x0ab8('0x8d')]()[_0x0ab8('0x8e')]();var _0x155404=path[_0x0ab8('0x8f')](config[_0x0ab8('0x69')],_0x0ab8('0x90'),_0x0ab8('0x91'),_0x0ab8('0x92'));var _0x1bcdad=path[_0x0ab8('0x8f')](config[_0x0ab8('0x69')],_0x0ab8('0x90'),_0x0ab8('0x91'),_0x0ab8('0x67'));var _0x16716f=util[_0x0ab8('0x6f')](_0x0ab8('0x93'),_0x18fc07);return db[_0x0ab8('0x4c')][_0x0ab8('0x52')]({'where':{'id':_0xd67157['params']['id']},'attributes':['id',_0x0ab8('0x53'),_0x0ab8('0x94'),'to','cc','bcc',_0x0ab8('0x95'),_0x0ab8('0x96')],'include':_0xd67157[_0x0ab8('0x3a')][_0x0ab8('0x67')]?[{'model':db[_0x0ab8('0x97')],'as':'Attachments'}]:undefined})[_0x0ab8('0x21')](handleEntityNotFound(_0x2a5f99,null))[_0x0ab8('0x21')](function(_0x5d9905){if(_0x5d9905){var _0x15b17c=_0x5d9905;var _0x34f7f8={'from':_0x15b17c[_0x0ab8('0x94')],'to':_0x15b17c['to'],'subject':_0x15b17c[_0x0ab8('0x95')],'html':_0x15b17c[_0x0ab8('0x53')],'headers':{'Date':moment(_0x15b17c[_0x0ab8('0x96')])[_0x0ab8('0x6f')](_0x0ab8('0x98'))},'attachments':[]};if(_0x5d9905['cc']){_0x34f7f8['headers']['Cc']=_0x5d9905['cc'];}if(_0x5d9905[_0x0ab8('0x99')]){_0x34f7f8[_0x0ab8('0x9a')]['Bcc']=_0x5d9905[_0x0ab8('0x99')];}return new BPromise(function(_0x2a5aba,_0x2e05b5){if(_0x5d9905[_0x0ab8('0x9b')]){for(var _0x352ece=0x0;_0x352ece<_0x5d9905[_0x0ab8('0x9b')][_0x0ab8('0x40')];_0x352ece++){var _0x4bf735=_0x5d9905[_0x0ab8('0x9b')][_0x352ece];var _0x4e4dfa=path['join'](_0x1bcdad,_0x4bf735[_0x0ab8('0x6b')]);if(fs[_0x0ab8('0x9c')](_0x4e4dfa)){_0x34f7f8[_0x0ab8('0x67')][_0x0ab8('0x9d')]({'name':_0x4bf735[_0x0ab8('0x68')],'contentType':_0x4bf735['type'],'data':fs[_0x0ab8('0x9e')](_0x4e4dfa)});}}}emlformat['build'](_0x34f7f8,function(_0x3fd10a,_0x769046){if(_0x3fd10a)return _0x2e05b5(_0x3fd10a);fs[_0x0ab8('0x9f')](path['join'](_0x155404,_0x16716f),_0x769046);return _0x2a5aba(_0x769046);});});}})[_0x0ab8('0x21')](function(_0x1af34b){if(_0x1af34b){return _0x2a5f99[_0x0ab8('0x8c')](path[_0x0ab8('0x8f')](_0x155404,_0x16716f),_0x16716f,function(_0xe753d4){if(_0xe753d4){console['log']('err',_0xe753d4);}else{fs[_0x0ab8('0xa0')](path[_0x0ab8('0x8f')](_0x155404,_0x16716f));}});}})[_0x0ab8('0x2c')](handleError(_0x2a5f99,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index fdf912f..4bed370 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 _0x2efb=['events','MailMessage','update','remove','emit','hasOwnProperty','hook'];(function(_0x476220,_0x2c6833){var _0x333d0c=function(_0x85c02d){while(--_0x85c02d){_0x476220['push'](_0x476220['shift']());}};_0x333d0c(++_0x2c6833);}(_0x2efb,0x1c0));var _0xb2ef=function(_0xe44c90,_0x1633b3){_0xe44c90=_0xe44c90-0x0;var _0x107c70=_0x2efb[_0xe44c90];return _0x107c70;};'use strict';var EventEmitter=require(_0xb2ef('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xb2ef('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb2ef('0x2'),'afterDestroy':_0xb2ef('0x3')};function emitEvent(_0x5d0109){return function(_0x32c2d2,_0x3ae77c,_0x1fa6be){MailMessageEvents[_0xb2ef('0x4')](_0x5d0109+':'+_0x32c2d2['id'],_0x32c2d2);MailMessageEvents[_0xb2ef('0x4')](_0x5d0109,_0x32c2d2);_0x1fa6be(null);};}for(var e in events){if(events[_0xb2ef('0x5')](e)){var event=events[e];MailMessage[_0xb2ef('0x6')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0x0489=['hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','remove','emit'];(function(_0x1df622,_0x25d371){var _0x49530b=function(_0x201fc6){while(--_0x201fc6){_0x1df622['push'](_0x1df622['shift']());}};_0x49530b(++_0x25d371);}(_0x0489,0xe3));var _0x9048=function(_0x158e3b,_0x4534b){_0x158e3b=_0x158e3b-0x0;var _0x551a1d=_0x0489[_0x158e3b];return _0x551a1d;};'use strict';var EventEmitter=require(_0x9048('0x0'));var MailMessage=require(_0x9048('0x1'))['db'][_0x9048('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x9048('0x3')](0x0);var events={'afterCreate':_0x9048('0x4'),'afterUpdate':'update','afterDestroy':_0x9048('0x5')};function emitEvent(_0x25bdb6){return function(_0x17bf32,_0x21cf08,_0x30e4ee){MailMessageEvents[_0x9048('0x6')](_0x25bdb6+':'+_0x17bf32['id'],_0x17bf32);MailMessageEvents[_0x9048('0x6')](_0x25bdb6,_0x17bf32);_0x30e4ee(null);};}for(var e in events){if(events[_0x9048('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x9048('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 443d37b..ee61dde 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 _0x8191=['utf8mb4','utf8mb4_unicode_ci','util','api','moment','request-promise','html-to-text','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','models','get','toLowerCase','direction','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error'];(function(_0x59cfcb,_0x1c96d2){var _0x1efad9=function(_0x2a3b16){while(--_0x2a3b16){_0x59cfcb['push'](_0x59cfcb['shift']());}};_0x1efad9(++_0x1c96d2);}(_0x8191,0x122));var _0x1819=function(_0x2b93a5,_0x31934c){_0x2b93a5=_0x2b93a5-0x0;var _0x4111dc=_0x8191[_0x2b93a5];return _0x4111dc;};'use strict';var _=require('lodash');var util=require(_0x1819('0x0'));var logger=require('../../config/logger')(_0x1819('0x1'));var moment=require(_0x1819('0x2'));var BPromise=require('bluebird');var rp=require(_0x1819('0x3'));var htmlToText=require(_0x1819('0x4'));var fs=require('fs');var path=require(_0x1819('0x5'));var rimraf=require(_0x1819('0x6'));var config=require('../../config/environment');var attributes=require(_0x1819('0x7'));module[_0x1819('0x8')]=function(_0x428c3a,_0x32e840){return _0x428c3a[_0x1819('0x9')](_0x1819('0xa'),attributes,{'tableName':_0x1819('0xb'),'paranoid':![],'indexes':[{'name':_0x1819('0xc'),'fields':['messageId']},{'name':_0x1819('0xd'),'fields':[_0x1819('0xe'),_0x1819('0xf')],'type':_0x1819('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x18476a,_0x5304e0,_0x5eefdd){if(_0x18476a[_0x1819('0x11')]){_0x18476a[_0x1819('0xe')]=htmlToText['fromString'](_0x18476a[_0x1819('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5eefdd(null,_0x5304e0);},'afterCreate':function(_0x542d01,_0x276ef6,_0x307f72){var _0x38949d=_0x428c3a[_0x1819('0x12')];var _0x59afe6=_0x542d01[_0x1819('0x13')]({'plain':!![]});if(_0x59afe6['direction'][_0x1819('0x14')]()==='in'||_0x59afe6[_0x1819('0x15')][_0x1819('0x14')]()===_0x1819('0x16')&&!_0x59afe6[_0x1819('0x17')]&&!_[_0x1819('0x18')](_0x59afe6[_0x1819('0x19')])){_0x38949d[_0x1819('0x1a')][_0x1819('0x1b')]({'where':{'id':_0x59afe6[_0x1819('0x1c')]}})[_0x1819('0x1d')](function(_0x4e4294){if(_0x4e4294){_0x4e4294[_0x1819('0x1e')]({'lastMsgAt':_0x59afe6[_0x1819('0x1f')],'lastMsgDirection':_0x59afe6[_0x1819('0x15')][_0x1819('0x14')](),'lastMsgBody':_0x59afe6[_0x1819('0x11')]});}})[_0x1819('0x20')](function(_0x1ae4ca){console[_0x1819('0x21')](_0x1ae4ca);});}_0x307f72();}},'charset':_0x1819('0x22'),'collate':_0x1819('0x23')});}; \ No newline at end of file +var _0x7287=['messageId','fti_mail_messages','FULLTEXT','body','plainBody','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','exports','define','mail_messages'];(function(_0x45e473,_0xacce){var _0xcad6bc=function(_0x3c82c5){while(--_0x3c82c5){_0x45e473['push'](_0x45e473['shift']());}};_0xcad6bc(++_0xacce);}(_0x7287,0xb9));var _0x7728=function(_0x242419,_0x1162d1){_0x242419=_0x242419-0x0;var _0x1f791d=_0x7287[_0x242419];return _0x1f791d;};'use strict';var _=require(_0x7728('0x0'));var util=require(_0x7728('0x1'));var logger=require('../../config/logger')(_0x7728('0x2'));var moment=require(_0x7728('0x3'));var BPromise=require(_0x7728('0x4'));var rp=require(_0x7728('0x5'));var htmlToText=require(_0x7728('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7728('0x7'));var config=require(_0x7728('0x8'));var attributes=require(_0x7728('0x9'));module[_0x7728('0xa')]=function(_0x1508dc,_0x2f6983){return _0x1508dc[_0x7728('0xb')]('MailMessage',attributes,{'tableName':_0x7728('0xc'),'paranoid':![],'indexes':[{'name':_0x7728('0xd'),'fields':[_0x7728('0xd')]},{'name':_0x7728('0xe'),'fields':['plainBody','subject'],'type':_0x7728('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x6eb838,_0x263406,_0x14f5e9){if(_0x6eb838[_0x7728('0x10')]){_0x6eb838[_0x7728('0x11')]=htmlToText['fromString'](_0x6eb838[_0x7728('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x14f5e9(null,_0x263406);},'afterCreate':function(_0x2e3381,_0x2943a5,_0x31c0c6){var _0x5a29f3=_0x1508dc[_0x7728('0x12')];var _0x580133=_0x2e3381[_0x7728('0x13')]({'plain':!![]});if(_0x580133[_0x7728('0x14')][_0x7728('0x15')]()==='in'||_0x580133[_0x7728('0x14')]['toLowerCase']()===_0x7728('0x16')&&!_0x580133[_0x7728('0x17')]&&!_[_0x7728('0x18')](_0x580133[_0x7728('0x19')])){_0x5a29f3['MailInteraction'][_0x7728('0x1a')]({'where':{'id':_0x580133['MailInteractionId']}})[_0x7728('0x1b')](function(_0x55a03f){if(_0x55a03f){_0x55a03f[_0x7728('0x1c')]({'lastMsgAt':_0x580133['createdAt'],'lastMsgDirection':_0x580133[_0x7728('0x14')]['toLowerCase'](),'lastMsgBody':_0x580133['body']});}})[_0x7728('0x1d')](function(_0x57dfc7){console[_0x7728('0x1e')](_0x57dfc7);});}_0x31c0c6();}},'charset':_0x7728('0x1f'),'collate':_0x7728('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index f64d247..aa18d3d 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 _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateMailMessage','create','options','info'];(function(_0x2a5331,_0x42d0bb){var _0xdc0996=function(_0x114207){while(--_0x114207){_0x2a5331['push'](_0x2a5331['shift']());}};_0xdc0996(++_0x42d0bb);}(_0x2ef3,0xba));var _0x32ef=function(_0x1ccb97,_0x367d5a){_0x1ccb97=_0x1ccb97-0x0;var _0x171dfe=_0x2ef3[_0x1ccb97];return _0x171dfe;};'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});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('MailMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['MailMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateMailMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file +var _0xc73a=['../../config/environment','jayson/promise','client','redis','defaults','localhost','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateMailMessage','MailMessage','create','body','options','raw','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1a4dd5,_0xc33137){var _0x44fc38=function(_0x483787){while(--_0x483787){_0x1a4dd5['push'](_0x1a4dd5['shift']());}};_0x44fc38(++_0xc33137);}(_0xc73a,0x72));var _0xac73=function(_0x4da56f,_0x34c59b){_0x4da56f=_0x4da56f-0x0;var _0x3441a8=_0xc73a[_0x4da56f];return _0x3441a8;};'use strict';var _=require('lodash');var util=require(_0xac73('0x0'));var moment=require(_0xac73('0x1'));var BPromise=require(_0xac73('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac73('0x3'))['db'];var utils=require(_0xac73('0x4'));var logger=require(_0xac73('0x5'))('rpc');var config=require(_0xac73('0x6'));var jayson=require(_0xac73('0x7'));var client=jayson[_0xac73('0x8')]['http']({'port':0x232a});config[_0xac73('0x9')]=_[_0xac73('0xa')](config[_0xac73('0x9')],{'host':_0xac73('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xac73('0x9')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0xf3b7e6,_0x454f8c,_0x468ee9){return new BPromise(function(_0x1844fe,_0x280be1){return client[_0xac73('0xc')](_0xf3b7e6,_0x468ee9)[_0xac73('0xd')](function(_0x2c8bfa){logger['info'](_0xac73('0xe'),_0x454f8c,_0xac73('0xf'));logger[_0xac73('0x10')](_0xac73('0x11'),_0x454f8c,_0xac73('0xf'),JSON[_0xac73('0x12')](_0x2c8bfa));if(_0x2c8bfa['error']){if(_0x2c8bfa[_0xac73('0x13')]['code']===0x1f4){logger[_0xac73('0x13')](_0xac73('0xe'),_0x454f8c,_0x2c8bfa[_0xac73('0x13')][_0xac73('0x14')]);return _0x280be1(_0x2c8bfa['error'][_0xac73('0x14')]);}logger[_0xac73('0x13')]('MailMessage,\x20%s,\x20%s',_0x454f8c,_0x2c8bfa[_0xac73('0x13')][_0xac73('0x14')]);return _0x1844fe(_0x2c8bfa[_0xac73('0x13')]['message']);}else{logger[_0xac73('0x15')](_0xac73('0xe'),_0x454f8c,_0xac73('0xf'));_0x1844fe(_0x2c8bfa[_0xac73('0x16')][_0xac73('0x14')]);}})['catch'](function(_0x1e2bfd){logger[_0xac73('0x13')]('MailMessage,\x20%s,\x20%s',_0x454f8c,_0x1e2bfd);_0x280be1(_0x1e2bfd);});});}exports[_0xac73('0x17')]=function(_0x1b3cea){var _0x1341d3=this;return new Promise(function(_0x150ee5,_0x102a02){return db[_0xac73('0x18')][_0xac73('0x19')](_0x1b3cea[_0xac73('0x1a')],{'raw':_0x1b3cea[_0xac73('0x1b')]?_0x1b3cea['options'][_0xac73('0x1c')]===undefined?!![]:![]:!![]})[_0xac73('0xd')](function(_0x3b2c93){logger['info'](_0xac73('0x17'),_0x1b3cea);logger['debug'](_0xac73('0x17'),_0x1b3cea,JSON[_0xac73('0x12')](_0x3b2c93));_0x150ee5(_0x3b2c93);})[_0xac73('0x1d')](function(_0x205b3e){logger[_0xac73('0x13')](_0xac73('0x17'),_0x205b3e[_0xac73('0x14')],_0x1b3cea);_0x102a02(_0x1341d3['error'](0x1f4,_0x205b3e[_0xac73('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 7719ba8..f62cf64 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 _0x5a1f=['update','emit','removeListener','length','save','remove'];(function(_0x46d4e5,_0x16eb6e){var _0x279b73=function(_0x3f8598){while(--_0x3f8598){_0x46d4e5['push'](_0x46d4e5['shift']());}};_0x279b73(++_0x16eb6e);}(_0x5a1f,0x1ba));var _0xf5a1=function(_0x5979df,_0x4de687){_0x5979df=_0x5979df-0x0;var _0x53faac=_0x5a1f[_0x5979df];return _0x53faac;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xf5a1('0x0'),_0xf5a1('0x1'),_0xf5a1('0x2')];function createListener(_0x286f31,_0x1542db){return function(_0x2d4910){_0x1542db[_0xf5a1('0x3')](_0x286f31,_0x2d4910);};}function removeListener(_0x5e9535,_0x24065){return function(){MailMessageEvents[_0xf5a1('0x4')](_0x5e9535,_0x24065);};}exports['register']=function(_0x30bc64){for(var _0x5774ba=0x0,_0x413018=events[_0xf5a1('0x5')];_0x5774ba<_0x413018;_0x5774ba++){var _0x52161a=events[_0x5774ba];var _0x18a789=createListener('mailMessage:'+_0x52161a,_0x30bc64);MailMessageEvents['on'](_0x52161a,_0x18a789);}}; \ No newline at end of file +var _0x0ccb=['save','emit','removeListener','length','mailMessage:','./mailMessage.events'];(function(_0x44a253,_0x351f7b){var _0x8d5178=function(_0x46c1f8){while(--_0x46c1f8){_0x44a253['push'](_0x44a253['shift']());}};_0x8d5178(++_0x351f7b);}(_0x0ccb,0x77));var _0xb0cc=function(_0xe2b013,_0x5790ce){_0xe2b013=_0xe2b013-0x0;var _0x37e2cc=_0x0ccb[_0xe2b013];return _0x37e2cc;};'use strict';var MailMessageEvents=require(_0xb0cc('0x0'));var events=[_0xb0cc('0x1'),'remove','update'];function createListener(_0x44e6d3,_0x5121fd){return function(_0x159847){_0x5121fd[_0xb0cc('0x2')](_0x44e6d3,_0x159847);};}function removeListener(_0x24b31b,_0xc2c86d){return function(){MailMessageEvents[_0xb0cc('0x3')](_0x24b31b,_0xc2c86d);};}exports['register']=function(_0x1310c1){for(var _0x320268=0x0,_0x11357b=events[_0xb0cc('0x4')];_0x320268<_0x11357b;_0x320268++){var _0x1a4517=events[_0x320268];var _0x40a23a=createListener(_0xb0cc('0x5')+_0x1a4517,_0x1310c1);MailMessageEvents['on'](_0x1a4517,_0x40a23a);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 6a2c82b..a31789a 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 _0xbe91=['../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','post','create','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','express','../../components/auth/service'];(function(_0x3acc31,_0x263292){var _0x5bfb72=function(_0x2560b2){while(--_0x2560b2){_0x3acc31['push'](_0x3acc31['shift']());}};_0x5bfb72(++_0x263292);}(_0xbe91,0x15b));var _0x1be9=function(_0x5d7504,_0x2ba214){_0x5d7504=_0x5d7504-0x0;var _0x29157a=_0xbe91[_0x5d7504];return _0x29157a;};'use strict';var multer=require(_0x1be9('0x0'));var util=require(_0x1be9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1be9('0x2'));var router=express['Router']();var auth=require(_0x1be9('0x3'));var interaction=require(_0x1be9('0x4'));var config=require(_0x1be9('0x5'));var controller=require(_0x1be9('0x6'));router[_0x1be9('0x7')]('/',auth[_0x1be9('0x8')](),controller[_0x1be9('0x9')]);router[_0x1be9('0x7')](_0x1be9('0xa'),auth['isAuthenticated'](),controller[_0x1be9('0xb')]);router[_0x1be9('0x7')](_0x1be9('0xc'),auth[_0x1be9('0x8')](),controller[_0x1be9('0xd')]);router[_0x1be9('0x7')](_0x1be9('0xe'),auth[_0x1be9('0x8')](),controller[_0x1be9('0xf')]);router[_0x1be9('0x7')]('/:id/teams',auth[_0x1be9('0x8')](),controller['getTeams']);router[_0x1be9('0x7')](_0x1be9('0x10'),auth[_0x1be9('0x8')](),controller[_0x1be9('0x11')]);router[_0x1be9('0x12')]('/',auth[_0x1be9('0x8')](),controller[_0x1be9('0x13')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0x1be9('0x12')](_0x1be9('0x10'),auth[_0x1be9('0x8')](),controller[_0x1be9('0x14')]);router[_0x1be9('0x15')](_0x1be9('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x1be9('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x1be9('0x17')]);router['delete']('/:id/teams',auth[_0x1be9('0x8')](),controller[_0x1be9('0x18')]);router[_0x1be9('0x16')](_0x1be9('0x10'),auth[_0x1be9('0x8')](),controller[_0x1be9('0x19')]);module[_0x1be9('0x1a')]=router; \ No newline at end of file +var _0x3167=['removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy'];(function(_0x3b9908,_0x20e78b){var _0x361271=function(_0x4242df){while(--_0x4242df){_0x3b9908['push'](_0x3b9908['shift']());}};_0x361271(++_0x20e78b);}(_0x3167,0x14d));var _0x7316=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0x3167[_0x1e03a6];return _0x295b64;};'use strict';var multer=require(_0x7316('0x0'));var util=require(_0x7316('0x1'));var path=require(_0x7316('0x2'));var timeout=require(_0x7316('0x3'));var express=require(_0x7316('0x4'));var router=express[_0x7316('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7316('0x6'));var controller=require('./mailQueue.controller');router[_0x7316('0x7')]('/',auth[_0x7316('0x8')](),controller[_0x7316('0x9')]);router[_0x7316('0x7')](_0x7316('0xa'),auth[_0x7316('0x8')](),controller['describe']);router[_0x7316('0x7')](_0x7316('0xb'),auth[_0x7316('0x8')](),controller[_0x7316('0xc')]);router[_0x7316('0x7')](_0x7316('0xd'),auth[_0x7316('0x8')](),controller[_0x7316('0xe')]);router[_0x7316('0x7')](_0x7316('0xf'),auth['isAuthenticated'](),controller[_0x7316('0x10')]);router['get'](_0x7316('0x11'),auth[_0x7316('0x8')](),controller[_0x7316('0x12')]);router[_0x7316('0x13')]('/',auth['isAuthenticated'](),controller[_0x7316('0x14')]);router[_0x7316('0x13')](_0x7316('0xf'),auth[_0x7316('0x8')](),controller[_0x7316('0x15')]);router['post']('/:id/users',auth[_0x7316('0x8')](),controller[_0x7316('0x16')]);router[_0x7316('0x17')]('/:id',auth[_0x7316('0x8')](),controller[_0x7316('0x18')]);router[_0x7316('0x19')](_0x7316('0xb'),auth[_0x7316('0x8')](),controller[_0x7316('0x1a')]);router[_0x7316('0x19')](_0x7316('0xf'),auth[_0x7316('0x8')](),controller[_0x7316('0x1b')]);router[_0x7316('0x19')](_0x7316('0x11'),auth[_0x7316('0x8')](),controller[_0x7316('0x1c')]);module[_0x7316('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 855a65c..2eda61b 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 _0xaf0d=['roundrobin','exports','STRING','beepall'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0xaf0d,0x6d));var _0xdaf0=function(_0x5ab706,_0x48de91){_0x5ab706=_0x5ab706-0x0;var _0x5ecfcf=_0xaf0d[_0x5ab706];return _0x5ecfcf;};'use strict';var Sequelize=require('sequelize');module[_0xdaf0('0x0')]={'name':{'type':Sequelize[_0xdaf0('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xdaf0('0x2'),_0xdaf0('0x3'))}}; \ No newline at end of file +var _0xa73a=['STRING','INTEGER','rrmemory','beepall','roundrobin','exports','name'];(function(_0x1535ff,_0x4d27bd){var _0x137dae=function(_0x3042ec){while(--_0x3042ec){_0x1535ff['push'](_0x1535ff['shift']());}};_0x137dae(++_0x4d27bd);}(_0xa73a,0xe5));var _0xaa73=function(_0x3cfb0d,_0x4df584){_0x3cfb0d=_0x3cfb0d-0x0;var _0x3486b4=_0xa73a[_0x3cfb0d];return _0x3486b4;};'use strict';var Sequelize=require('sequelize');module[_0xaa73('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xaa73('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xaa73('0x2')]},'timeout':{'type':Sequelize[_0xaa73('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xaa73('0x4'),_0xaa73('0x5'),_0xaa73('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index cdcefca..8787ebc 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 _0xfb65=['path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','count','offset','set','Content-Range','json','apply','save','update','then','destroy','get','UserProfileResource','sendStatus','error','name','send','MailQueue','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','key','VIRTUAL','field','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','role','MailQueues','UserProfileSection','autoAssociation','describe','findOne','UserMailQueue','MailQueueId','map','User','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','SIP','mailPause','createdAt','getTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','forEach','emit','userMailQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_mail_queues','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','compact','isEmpty','userMailQueue:remove','addAgents','removeAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x3b08c0,_0x3713df){var _0x1772a3=function(_0x1ebbff){while(--_0x1ebbff){_0x3b08c0['push'](_0x3b08c0['shift']());}};_0x1772a3(++_0x3713df);}(_0xfb65,0x82));var _0x5fb6=function(_0x7577b9,_0x4fe21c){_0x7577b9=_0x7577b9-0x0;var _0x2660c8=_0xfb65[_0x7577b9];return _0x2660c8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5fb6('0x0'));var rimraf=require(_0x5fb6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5fb6('0x2'));var rp=require('request-promise');var moment=require(_0x5fb6('0x3'));var BPromise=require(_0x5fb6('0x4'));var Mustache=require(_0x5fb6('0x5'));var util=require(_0x5fb6('0x6'));var path=require(_0x5fb6('0x7'));var sox=require(_0x5fb6('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x5fb6('0x9'));var squel=require(_0x5fb6('0xa'));var crypto=require(_0x5fb6('0xb'));var jsforce=require(_0x5fb6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5fb6('0xd'));var querystring=require(_0x5fb6('0xe'));var Papa=require(_0x5fb6('0xf'));var Redis=require(_0x5fb6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5fb6('0x11'));var hardwareService=require(_0x5fb6('0x12'));var logger=require('../../config/logger')(_0x5fb6('0x13'));var utils=require(_0x5fb6('0x14'));var config=require(_0x5fb6('0x15'));var db=require(_0x5fb6('0x16'))['db'];config[_0x5fb6('0x17')]=_['defaults'](config[_0x5fb6('0x17')],{'host':_0x5fb6('0x18'),'port':0x18eb});var socket=require(_0x5fb6('0x19'))(new Redis(config[_0x5fb6('0x17')]));require(_0x5fb6('0x1a'))[_0x5fb6('0x1b')](socket);function respondWithStatusCode(_0x1a391f,_0x1ded21){_0x1ded21=_0x1ded21||0xcc;return function(_0x5e69c3){if(_0x5e69c3){return _0x1a391f['sendStatus'](_0x1ded21);}return _0x1a391f[_0x5fb6('0x1c')](_0x1ded21)[_0x5fb6('0x1d')]();};}function respondWithResult(_0x58febe,_0x1d57b1){_0x1d57b1=_0x1d57b1||0xc8;return function(_0x21ddd3){if(_0x21ddd3){return _0x58febe[_0x5fb6('0x1c')](_0x1d57b1)['json'](_0x21ddd3);}};}function respondWithFilteredResult(_0x48f94d,_0x3ebbec){return function(_0x27bd8b){if(_0x27bd8b){var _0x182af5=_0x27bd8b[_0x5fb6('0x1e')],_0x167354=_0x3ebbec['offset'],_0x226c61=_0x3ebbec[_0x5fb6('0x1f')]+_0x3ebbec['limit'],_0x50bca8;if(_0x226c61>=_0x182af5){_0x226c61=_0x182af5;_0x50bca8=0xc8;}else{_0x50bca8=0xce;}_0x48f94d[_0x5fb6('0x1c')](_0x50bca8);return _0x48f94d[_0x5fb6('0x20')](_0x5fb6('0x21'),_0x167354+'-'+_0x226c61+'/'+_0x182af5)[_0x5fb6('0x22')](_0x27bd8b);}return null;};}function patchUpdates(_0x5885f1){return function(_0x418f58){try{jsonpatch[_0x5fb6('0x23')](_0x418f58,_0x5885f1,!![]);}catch(_0x50a414){return BPromise['reject'](_0x50a414);}return _0x418f58[_0x5fb6('0x24')]();};}function saveUpdates(_0x39ace4,_0x48a70e){return function(_0xdf1794){if(_0xdf1794){return _0xdf1794[_0x5fb6('0x25')](_0x39ace4)[_0x5fb6('0x26')](function(_0x36457e){return _0x36457e;});}return null;};}function removeEntity(_0x582f60,_0x2fca34){return function(_0x44aebe){if(_0x44aebe){return _0x44aebe[_0x5fb6('0x27')]()[_0x5fb6('0x26')](function(){var _0x1b6953=_0x44aebe[_0x5fb6('0x28')]({'plain':!![]});var _0x4e2bff='MailQueues';return db[_0x5fb6('0x29')][_0x5fb6('0x27')]({'where':{'type':_0x4e2bff,'resourceId':_0x1b6953['id']}})[_0x5fb6('0x26')](function(){return _0x44aebe;});})[_0x5fb6('0x26')](function(){_0x582f60[_0x5fb6('0x1c')](0xcc)[_0x5fb6('0x1d')]();});}};}function handleEntityNotFound(_0x36ac58,_0x4d6e01){return function(_0xe9a4cc){if(!_0xe9a4cc){_0x36ac58[_0x5fb6('0x2a')](0x194);}return _0xe9a4cc;};}function handleError(_0xac9a34,_0x5a1f0d){_0x5a1f0d=_0x5a1f0d||0x1f4;return function(_0x2afc08){logger[_0x5fb6('0x2b')](_0x2afc08['stack']);if(_0x2afc08[_0x5fb6('0x2c')]){delete _0x2afc08[_0x5fb6('0x2c')];}_0xac9a34['status'](_0x5a1f0d)[_0x5fb6('0x2d')](_0x2afc08);};}exports['index']=function(_0x462027,_0x53dbeb){var _0x4e7587={},_0x159971={},_0x30bc6c={'count':0x0,'rows':[]};var _0x3199d4=db[_0x5fb6('0x2e')][_0x5fb6('0x2f')];_0x159971[_0x5fb6('0x30')]=_['keys'](_0x3199d4);_0x159971[_0x5fb6('0x31')]=_[_0x5fb6('0x32')](_0x462027[_0x5fb6('0x31')]);_0x159971[_0x5fb6('0x33')]=_[_0x5fb6('0x34')](_0x159971[_0x5fb6('0x30')],_0x159971[_0x5fb6('0x31')]);_0x4e7587[_0x5fb6('0x35')]=_[_0x5fb6('0x34')](_0x159971[_0x5fb6('0x30')],qs[_0x5fb6('0x36')](_0x462027['query'][_0x5fb6('0x36')]));_0x4e7587[_0x5fb6('0x35')]=_0x4e7587['attributes'][_0x5fb6('0x37')]?_0x4e7587['attributes']:_0x159971['model'];if(!_0x462027[_0x5fb6('0x31')][_0x5fb6('0x38')](_0x5fb6('0x39'))){_0x4e7587['limit']=qs[_0x5fb6('0x3a')](_0x462027['query']['limit']);_0x4e7587[_0x5fb6('0x1f')]=qs[_0x5fb6('0x1f')](_0x462027[_0x5fb6('0x31')][_0x5fb6('0x1f')]);}_0x4e7587[_0x5fb6('0x3b')]=qs[_0x5fb6('0x3c')](_0x462027[_0x5fb6('0x31')][_0x5fb6('0x3c')]);_0x4e7587[_0x5fb6('0x3d')]=qs[_0x5fb6('0x33')](_[_0x5fb6('0x3e')](_0x462027[_0x5fb6('0x31')],_0x159971['filters']));if(_0x462027[_0x5fb6('0x31')][_0x5fb6('0x3f')]){_0x4e7587[_0x5fb6('0x3d')]=_['merge'](_0x4e7587[_0x5fb6('0x3d')],{'$or':_['map'](_0x3199d4,function(_0x211851){if(_0x211851['type'][_0x5fb6('0x40')]!==_0x5fb6('0x41')){var _0x414112={};_0x414112[_0x211851[_0x5fb6('0x42')]]={'$like':'%'+_0x462027[_0x5fb6('0x31')]['filter']+'%'};return _0x414112;}})});}_0x4e7587=_[_0x5fb6('0x43')]({},_0x4e7587,_0x462027[_0x5fb6('0x44')]);var _0x3ab41f={'where':_0x4e7587[_0x5fb6('0x3d')]};return db['MailQueue'][_0x5fb6('0x1e')](_0x3ab41f)[_0x5fb6('0x26')](function(_0x821f45){_0x30bc6c[_0x5fb6('0x1e')]=_0x821f45;if(_0x462027[_0x5fb6('0x31')][_0x5fb6('0x45')]){_0x4e7587['include']=[{'all':!![]}];}return db[_0x5fb6('0x2e')][_0x5fb6('0x46')](_0x4e7587);})[_0x5fb6('0x26')](function(_0x63664a){_0x30bc6c[_0x5fb6('0x47')]=_0x63664a;return _0x30bc6c;})[_0x5fb6('0x26')](respondWithFilteredResult(_0x53dbeb,_0x4e7587))[_0x5fb6('0x48')](handleError(_0x53dbeb,null));};exports[_0x5fb6('0x49')]=function(_0x2e3f97,_0x33d742){var _0x3a4b28={'raw':!![],'where':{'id':_0x2e3f97[_0x5fb6('0x4a')]['id']}},_0x54e911={};_0x54e911['model']=_[_0x5fb6('0x32')](db[_0x5fb6('0x2e')]['rawAttributes']);_0x54e911[_0x5fb6('0x31')]=_[_0x5fb6('0x32')](_0x2e3f97[_0x5fb6('0x31')]);_0x54e911['filters']=_['intersection'](_0x54e911[_0x5fb6('0x30')],_0x54e911[_0x5fb6('0x31')]);_0x3a4b28[_0x5fb6('0x35')]=_[_0x5fb6('0x34')](_0x54e911[_0x5fb6('0x30')],qs[_0x5fb6('0x36')](_0x2e3f97[_0x5fb6('0x31')][_0x5fb6('0x36')]));_0x3a4b28[_0x5fb6('0x35')]=_0x3a4b28[_0x5fb6('0x35')][_0x5fb6('0x37')]?_0x3a4b28['attributes']:_0x54e911[_0x5fb6('0x30')];if(_0x2e3f97['query']['includeAll']){_0x3a4b28[_0x5fb6('0x4b')]=[{'all':!![]}];}_0x3a4b28=_[_0x5fb6('0x43')]({},_0x3a4b28,_0x2e3f97[_0x5fb6('0x44')]);return db[_0x5fb6('0x2e')][_0x5fb6('0x4c')](_0x3a4b28)[_0x5fb6('0x26')](handleEntityNotFound(_0x33d742,null))[_0x5fb6('0x26')](respondWithResult(_0x33d742,null))['catch'](handleError(_0x33d742,null));};exports[_0x5fb6('0x4d')]=function(_0xf3571d,_0x59c923){return db[_0x5fb6('0x2e')][_0x5fb6('0x4d')](_0xf3571d[_0x5fb6('0x4e')],{})[_0x5fb6('0x26')](function(_0x3b508a){var _0x136a54=_0xf3571d[_0x5fb6('0x4f')][_0x5fb6('0x28')]({'plain':!![]});if(!_0x136a54)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x136a54[_0x5fb6('0x50')]===_0x5fb6('0x4f')){var _0x4be1df=_0x3b508a[_0x5fb6('0x28')]({'plain':!![]});var _0x40e71e=_0x5fb6('0x51');return db[_0x5fb6('0x52')]['find']({'where':{'name':_0x40e71e,'userProfileId':_0x136a54['userProfileId']},'raw':!![]})[_0x5fb6('0x26')](function(_0x41cb22){if(_0x41cb22&&_0x41cb22[_0x5fb6('0x53')]===0x0){return db['UserProfileResource'][_0x5fb6('0x4d')]({'name':_0x4be1df['name'],'resourceId':_0x4be1df['id'],'type':_0x41cb22[_0x5fb6('0x2c')],'sectionId':_0x41cb22['id']},{})['then'](function(){return _0x3b508a;});}else{return _0x3b508a;}})[_0x5fb6('0x48')](function(_0xcace6a){logger[_0x5fb6('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xcace6a);throw _0xcace6a;});}return _0x3b508a;})[_0x5fb6('0x26')](respondWithResult(_0x59c923,0xc9))[_0x5fb6('0x48')](handleError(_0x59c923,null));};exports[_0x5fb6('0x25')]=function(_0x1fba21,_0x1d89db){if(_0x1fba21[_0x5fb6('0x4e')]['id']){delete _0x1fba21[_0x5fb6('0x4e')]['id'];}return db[_0x5fb6('0x2e')][_0x5fb6('0x4c')]({'where':{'id':_0x1fba21[_0x5fb6('0x4a')]['id']}})[_0x5fb6('0x26')](handleEntityNotFound(_0x1d89db,null))['then'](saveUpdates(_0x1fba21[_0x5fb6('0x4e')],null))['then'](respondWithResult(_0x1d89db,null))[_0x5fb6('0x48')](handleError(_0x1d89db,null));};exports[_0x5fb6('0x27')]=function(_0x324cc3,_0x3a3d20){return db[_0x5fb6('0x2e')][_0x5fb6('0x4c')]({'where':{'id':_0x324cc3['params']['id']}})['then'](handleEntityNotFound(_0x3a3d20,null))['then'](removeEntity(_0x3a3d20,null))['catch'](handleError(_0x3a3d20,null));};exports[_0x5fb6('0x54')]=function(_0x2082dc,_0x3342d1){return db[_0x5fb6('0x2e')]['describe']()[_0x5fb6('0x26')](respondWithResult(_0x3342d1,null))[_0x5fb6('0x48')](handleError(_0x3342d1,null));};exports['getMembers']=function(_0xbd31ab,_0x492e94,_0x2a879e){var _0x19ded3={'raw':!![],'where':{}},_0x4d541d={},_0x405ecb;return db[_0x5fb6('0x2e')][_0x5fb6('0x55')]({'where':{'id':_0xbd31ab[_0x5fb6('0x4a')]['id']}})[_0x5fb6('0x26')](handleEntityNotFound(_0x492e94,null))[_0x5fb6('0x26')](function(_0x27ae23){if(_0x27ae23){_0x405ecb=_0x27ae23[_0x5fb6('0x28')]({'plain':!![]});_0x4d541d[_0x5fb6('0x30')]=_[_0x5fb6('0x32')](db[_0x5fb6('0x56')]['rawAttributes']);_0x4d541d[_0x5fb6('0x31')]=_[_0x5fb6('0x32')](_0xbd31ab[_0x5fb6('0x31')]);_0x4d541d[_0x5fb6('0x33')]=_[_0x5fb6('0x34')](_0x4d541d[_0x5fb6('0x30')],_0x4d541d['query']);_0x19ded3[_0x5fb6('0x35')]=_['intersection'](_0x4d541d[_0x5fb6('0x30')],qs[_0x5fb6('0x36')](_0xbd31ab[_0x5fb6('0x31')][_0x5fb6('0x36')]));_0x19ded3[_0x5fb6('0x35')]=_0x19ded3[_0x5fb6('0x35')][_0x5fb6('0x37')]?_0x19ded3[_0x5fb6('0x35')]:_0x4d541d['model'];if(!_0xbd31ab['query'][_0x5fb6('0x38')](_0x5fb6('0x39'))){_0x19ded3[_0x5fb6('0x3a')]=qs[_0x5fb6('0x3a')](_0xbd31ab['query']['limit']);_0x19ded3[_0x5fb6('0x1f')]=qs['offset'](_0xbd31ab['query'][_0x5fb6('0x1f')]);}_0x19ded3[_0x5fb6('0x3b')]=qs[_0x5fb6('0x3c')](_0xbd31ab[_0x5fb6('0x31')][_0x5fb6('0x3c')]);_0x19ded3['where']=qs[_0x5fb6('0x33')](_['pick'](_0xbd31ab[_0x5fb6('0x31')],_0x4d541d[_0x5fb6('0x33')]));_0x19ded3[_0x5fb6('0x3d')][_0x5fb6('0x57')]=_0x27ae23['id'];if(_0xbd31ab[_0x5fb6('0x31')][_0x5fb6('0x3f')]){_0x19ded3['where']=_[_0x5fb6('0x43')](_0x19ded3[_0x5fb6('0x3d')],{'$or':_[_0x5fb6('0x58')](_0x19ded3['attributes'],function(_0x517355){var _0x4a8934={};_0x4a8934[_0x517355]={'$like':'%'+_0xbd31ab[_0x5fb6('0x31')][_0x5fb6('0x3f')]+'%'};return _0x4a8934;})});}_0x19ded3=_[_0x5fb6('0x43')]({},_0x19ded3,_0xbd31ab[_0x5fb6('0x44')]);return db[_0x5fb6('0x56')][_0x5fb6('0x46')](_0x19ded3);}})[_0x5fb6('0x26')](function(_0x573072){if(_0x573072){return db[_0x5fb6('0x59')][_0x5fb6('0x5a')]({'where':{'id':_[_0x5fb6('0x58')](_0x573072,_0x5fb6('0x5b')),'role':_0x5fb6('0x5c')},'attributes':['id','name','mailPause',_0x5fb6('0x5d'),'createdAt']});}})['then'](function(_0x360170){if(_0x360170){return{'count':_0x360170['count'],'rows':_['map'](_0x360170['rows'],function(_0x4683fb){return{'membername':_0x4683fb[_0x5fb6('0x2c')],'UserId':_0x4683fb['id'],'queue_name':_0x405ecb[_0x5fb6('0x2c')],'MailQueueId':_0x405ecb['id'],'interface':util[_0x5fb6('0x5e')](_0x5fb6('0x5f'),_0x5fb6('0x60'),_0x4683fb[_0x5fb6('0x2c')]),'penalty':0x0,'paused':_0x4683fb[_0x5fb6('0x61')],'createdAt':_0x4683fb[_0x5fb6('0x62')],'updatedAt':_0x4683fb[_0x5fb6('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5fb6('0x26')](respondWithFilteredResult(_0x492e94,_0x19ded3))[_0x5fb6('0x48')](handleError(_0x492e94,null));};exports[_0x5fb6('0x63')]=function(_0x26dc0e,_0xa0d65d,_0x26dedf){var _0x2e378c={};var _0x333976={};var _0x54a8e4;var _0x5af783;return db[_0x5fb6('0x2e')]['findOne']({'where':{'id':_0x26dc0e['params']['id']}})[_0x5fb6('0x26')](handleEntityNotFound(_0xa0d65d,null))[_0x5fb6('0x26')](function(_0x5843d5){if(_0x5843d5){_0x54a8e4=_0x5843d5;_0x333976[_0x5fb6('0x30')]=_[_0x5fb6('0x32')](db[_0x5fb6('0x64')]['rawAttributes']);_0x333976[_0x5fb6('0x31')]=_[_0x5fb6('0x32')](_0x26dc0e[_0x5fb6('0x31')]);_0x333976[_0x5fb6('0x33')]=_[_0x5fb6('0x34')](_0x333976['model'],_0x333976['query']);_0x2e378c['attributes']=_[_0x5fb6('0x34')](_0x333976[_0x5fb6('0x30')],qs[_0x5fb6('0x36')](_0x26dc0e[_0x5fb6('0x31')][_0x5fb6('0x36')]));_0x2e378c[_0x5fb6('0x35')]=_0x2e378c[_0x5fb6('0x35')][_0x5fb6('0x37')]?_0x2e378c[_0x5fb6('0x35')]:_0x333976[_0x5fb6('0x30')];_0x2e378c[_0x5fb6('0x3b')]=qs['sort'](_0x26dc0e['query']['sort']);_0x2e378c[_0x5fb6('0x3d')]=qs[_0x5fb6('0x33')](_[_0x5fb6('0x3e')](_0x26dc0e[_0x5fb6('0x31')],_0x333976[_0x5fb6('0x33')]));if(_0x26dc0e['query'][_0x5fb6('0x3f')]){_0x2e378c['where']=_[_0x5fb6('0x43')](_0x2e378c[_0x5fb6('0x3d')],{'$or':_['map'](_0x2e378c[_0x5fb6('0x35')],function(_0x5a66f7){var _0x8cbcd8={};_0x8cbcd8[_0x5a66f7]={'$like':'%'+_0x26dc0e[_0x5fb6('0x31')][_0x5fb6('0x3f')]+'%'};return _0x8cbcd8;})});}_0x2e378c=_[_0x5fb6('0x43')]({},_0x2e378c,_0x26dc0e['options']);return _0x54a8e4[_0x5fb6('0x63')](_0x2e378c);}})[_0x5fb6('0x26')](function(_0x34a69a){if(_0x34a69a){_0x5af783=_0x34a69a[_0x5fb6('0x37')];if(!_0x26dc0e[_0x5fb6('0x31')][_0x5fb6('0x38')](_0x5fb6('0x39'))){_0x2e378c[_0x5fb6('0x3a')]=qs[_0x5fb6('0x3a')](_0x26dc0e[_0x5fb6('0x31')][_0x5fb6('0x3a')]);_0x2e378c[_0x5fb6('0x1f')]=qs['offset'](_0x26dc0e[_0x5fb6('0x31')][_0x5fb6('0x1f')]);}return _0x54a8e4[_0x5fb6('0x63')](_0x2e378c);}})[_0x5fb6('0x26')](function(_0x13bf83){if(_0x13bf83){return _0x13bf83?{'count':_0x5af783,'rows':_0x13bf83}:null;}})['then'](respondWithResult(_0xa0d65d,null))[_0x5fb6('0x48')](handleError(_0xa0d65d,null));};exports['addTeams']=function(_0x5ba363,_0x55b06e,_0x278083){var _0x308599=_0x5ba363[_0x5fb6('0x4e')]['teams'];return db[_0x5fb6('0x64')]['findAll']({'where':{'id':_['map'](_0x308599,'id')},'attributes':['id'],'include':[{'model':db[_0x5fb6('0x59')],'as':_0x5fb6('0x65'),'attributes':['id',_0x5fb6('0x2c'),_0x5fb6('0x66'),_0x5fb6('0x67'),_0x5fb6('0x68')],'raw':!![]}]})[_0x5fb6('0x26')](function(_0x469bfb){if(_0x469bfb){var _0xbbeca5=_[_0x5fb6('0x69')](_0x469bfb,function(_0x47a686){var _0x51f27f=_0x47a686[_0x5fb6('0x28')]({'plain':!![]});return _0x51f27f[_0x5fb6('0x65')];});return db[_0x5fb6('0x2e')][_0x5fb6('0x4c')]({'where':{'id':_0x5ba363[_0x5fb6('0x4a')]['id']}})[_0x5fb6('0x26')](function(_0xb09144){return db[_0x5fb6('0x6a')][_0x5fb6('0x6b')](function(_0x2eda7e){return _0xb09144[_0x5fb6('0x6c')](_[_0x5fb6('0x58')](_0x308599,'id'),{'transaction':_0x2eda7e})[_0x5fb6('0x26')](function(){return BPromise[_0x5fb6('0x6d')](_0xbbeca5,function(_0x801778){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x801778['id'],'MailQueueId':_0x5ba363['params']['id']},'transaction':_0x2eda7e});});})[_0x5fb6('0x26')](function(){_0xbbeca5[_0x5fb6('0x6e')](function(_0x1afa65){socket[_0x5fb6('0x6f')](_0x5fb6('0x70'),{'UserId':_0x1afa65['id'],'MailQueueId':_0xb09144['id']});});});});});}})['then'](respondWithStatusCode(_0x55b06e,null))[_0x5fb6('0x48')](handleError(_0x55b06e,null));};exports[_0x5fb6('0x71')]=function(_0x4bb44e,_0xc4635a,_0x12e012){return db[_0x5fb6('0x64')][_0x5fb6('0x46')]({'where':{'id':_0x4bb44e[_0x5fb6('0x31')][_0x5fb6('0x72')]},'attributes':['id'],'include':[{'model':db[_0x5fb6('0x59')],'as':_0x5fb6('0x65'),'attributes':['id'],'raw':!![]}]})[_0x5fb6('0x26')](handleEntityNotFound(_0xc4635a,null))['then'](function(_0x14acfe){var _0x355887=_['map'](_0x14acfe,'id');var _0x2bb231=[];var _0x864c0c=[];var _0x21591b=squel[_0x5fb6('0x73')]();_0x21591b[_0x5fb6('0x42')](_0x5fb6('0x74'))[_0x5fb6('0x75')](_0x5fb6('0x76'),'tq')['join']('user_has_teams','ut',_0x5fb6('0x77'))[_0x5fb6('0x3d')](_0x5fb6('0x78'),_0x4bb44e['params']['id']);for(var _0x1fb737=0x0;_0x1fb737<_0x14acfe[_0x5fb6('0x37')];_0x1fb737+=0x1){let _0x402a3c=_0x14acfe[_0x1fb737];for(var _0x48459d=0x0;_0x48459d<_0x402a3c[_0x5fb6('0x65')][_0x5fb6('0x37')];_0x48459d+=0x1){let _0x50e2ac=_0x402a3c['Agents'][_0x48459d];var _0x46f5ff=_0x21591b[_0x5fb6('0x79')]();_0x46f5ff['where'](_0x5fb6('0x7a'),_0x50e2ac['id']);_0x864c0c[_0x5fb6('0x7b')](db[_0x5fb6('0x6a')]['query'](_0x46f5ff['toString'](),{'type':db[_0x5fb6('0x6a')][_0x5fb6('0x7c')][_0x5fb6('0x7d')]})[_0x5fb6('0x26')](function(_0x39bca0){if(_0x39bca0[_0x5fb6('0x37')]===0x1){return _0x50e2ac['id'];}else{var _0x127787=_[_0x5fb6('0x7e')](_['map'](_0x39bca0,_0x5fb6('0x7f')),function(_0x20ef95){return _[_0x5fb6('0x80')](_0x355887,_0x20ef95);});if(_0x127787){return _0x50e2ac['id'];}}}));}}return BPromise[_0x5fb6('0x81')](_0x864c0c)[_0x5fb6('0x26')](function(_0x4582cc){_0x2bb231=_(_0x2bb231)['union'](_0x4582cc)[_0x5fb6('0x82')]()['value']();return db[_0x5fb6('0x2e')][_0x5fb6('0x4c')]({'where':{'id':_0x4bb44e[_0x5fb6('0x4a')]['id']}})['then'](function(_0x440958){return db[_0x5fb6('0x6a')]['transaction'](function(_0x3fcf75){return _0x440958[_0x5fb6('0x71')](_0x4bb44e[_0x5fb6('0x31')][_0x5fb6('0x72')],{'transaction':_0x3fcf75})[_0x5fb6('0x26')](function(){if(!_[_0x5fb6('0x83')](_0x2bb231)){return _0x440958['removeAgents'](_0x2bb231,{'transaction':_0x3fcf75});}})[_0x5fb6('0x26')](function(){_0x2bb231[_0x5fb6('0x6e')](function(_0x1e7bf0){socket[_0x5fb6('0x6f')](_0x5fb6('0x84'),{'UserId':_0x1e7bf0,'MailQueueId':_0x440958['id']});});});});});});})[_0x5fb6('0x26')](respondWithStatusCode(_0xc4635a,null))[_0x5fb6('0x48')](handleError(_0xc4635a,null));};exports[_0x5fb6('0x85')]=function(_0x3ba814,_0x219c8e,_0x4ee6d9){return db['MailQueue'][_0x5fb6('0x4c')]({'where':{'id':_0x3ba814['params']['id']}})[_0x5fb6('0x26')](handleEntityNotFound(_0x219c8e,null))[_0x5fb6('0x26')](function(_0x1e3027){if(_0x1e3027){return _0x1e3027['addAgents'](_0x3ba814['body'][_0x5fb6('0x72')],_['omit'](_0x3ba814[_0x5fb6('0x4e')],[_0x5fb6('0x72'),'id'])||{})['spread'](function(_0x4c4ddd){for(var _0x57b274=0x0;_0x57b274<_0x3ba814[_0x5fb6('0x4e')][_0x5fb6('0x72')][_0x5fb6('0x37')];_0x57b274+=0x1){socket[_0x5fb6('0x6f')](_0x5fb6('0x70'),{'UserId':_0x3ba814[_0x5fb6('0x4e')][_0x5fb6('0x72')][_0x57b274],'MailQueueId':_0x3ba814[_0x5fb6('0x4a')]['id']});}return _0x4c4ddd;});}})['then'](respondWithResult(_0x219c8e,null))[_0x5fb6('0x48')](handleError(_0x219c8e,null));};exports[_0x5fb6('0x86')]=function(_0x869ada,_0xd7d35c,_0x263314){return db[_0x5fb6('0x2e')][_0x5fb6('0x4c')]({'where':{'id':_0x869ada['params']['id']}})[_0x5fb6('0x26')](handleEntityNotFound(_0xd7d35c,null))[_0x5fb6('0x26')](function(_0x49b522){if(_0x49b522){return _0x49b522[_0x5fb6('0x86')](_0x869ada[_0x5fb6('0x31')][_0x5fb6('0x72')])['then'](function(){if(_[_0x5fb6('0x87')](_0x869ada[_0x5fb6('0x31')][_0x5fb6('0x72')])){for(var _0x10b12d=0x0;_0x10b12d<_0x869ada[_0x5fb6('0x31')][_0x5fb6('0x72')][_0x5fb6('0x37')];_0x10b12d+=0x1){socket[_0x5fb6('0x6f')](_0x5fb6('0x84'),{'UserId':Number(_0x869ada['query'][_0x5fb6('0x72')][_0x10b12d]),'MailQueueId':Number(_0x869ada[_0x5fb6('0x4a')]['id'])});}}else{socket[_0x5fb6('0x6f')](_0x5fb6('0x84'),{'UserId':Number(_0x869ada[_0x5fb6('0x31')][_0x5fb6('0x72')]),'MailQueueId':Number(_0x869ada[_0x5fb6('0x4a')]['id'])});}});}})[_0x5fb6('0x26')](respondWithStatusCode(_0xd7d35c,null))[_0x5fb6('0x48')](handleError(_0xd7d35c,null));};exports[_0x5fb6('0x88')]=function(_0x354e1d,_0x3b94c0,_0x129bd1){var _0x4b3c4a={};var _0x316b63={};var _0x3fb8c4;var _0x1af4b6;return db[_0x5fb6('0x2e')][_0x5fb6('0x55')]({'where':{'id':_0x354e1d[_0x5fb6('0x4a')]['id']}})[_0x5fb6('0x26')](handleEntityNotFound(_0x3b94c0,null))[_0x5fb6('0x26')](function(_0x1d65a5){if(_0x1d65a5){_0x3fb8c4=_0x1d65a5;_0x316b63[_0x5fb6('0x30')]=_[_0x5fb6('0x32')](db[_0x5fb6('0x59')]['rawAttributes']);_0x316b63[_0x5fb6('0x31')]=_['keys'](_0x354e1d['query']);_0x316b63[_0x5fb6('0x33')]=_['intersection'](_0x316b63[_0x5fb6('0x30')],_0x316b63[_0x5fb6('0x31')]);_0x4b3c4a[_0x5fb6('0x35')]=_[_0x5fb6('0x34')](_0x316b63['model'],qs['fields'](_0x354e1d[_0x5fb6('0x31')]['fields']));_0x4b3c4a[_0x5fb6('0x35')]=_0x4b3c4a[_0x5fb6('0x35')][_0x5fb6('0x37')]?_0x4b3c4a['attributes']:_0x316b63[_0x5fb6('0x30')];_0x4b3c4a[_0x5fb6('0x3b')]=qs[_0x5fb6('0x3c')](_0x354e1d[_0x5fb6('0x31')][_0x5fb6('0x3c')]);_0x4b3c4a[_0x5fb6('0x3d')]=qs['filters'](_[_0x5fb6('0x3e')](_0x354e1d[_0x5fb6('0x31')],_0x316b63[_0x5fb6('0x33')]));if(_0x354e1d['query']['filter']){_0x4b3c4a[_0x5fb6('0x3d')]=_[_0x5fb6('0x43')](_0x4b3c4a[_0x5fb6('0x3d')],{'$or':_[_0x5fb6('0x58')](_0x4b3c4a[_0x5fb6('0x35')],function(_0x576ce4){var _0x36711e={};_0x36711e[_0x576ce4]={'$like':'%'+_0x354e1d['query']['filter']+'%'};return _0x36711e;})});}_0x4b3c4a=_[_0x5fb6('0x43')]({},_0x4b3c4a,_0x354e1d[_0x5fb6('0x44')]);return _0x3fb8c4[_0x5fb6('0x88')](_0x4b3c4a);}})[_0x5fb6('0x26')](function(_0x2620cb){if(_0x2620cb){_0x1af4b6=_0x2620cb[_0x5fb6('0x37')];if(!_0x354e1d[_0x5fb6('0x31')][_0x5fb6('0x38')](_0x5fb6('0x39'))){_0x4b3c4a['limit']=qs['limit'](_0x354e1d[_0x5fb6('0x31')][_0x5fb6('0x3a')]);_0x4b3c4a[_0x5fb6('0x1f')]=qs[_0x5fb6('0x1f')](_0x354e1d[_0x5fb6('0x31')]['offset']);}return _0x3fb8c4[_0x5fb6('0x88')](_0x4b3c4a);}})[_0x5fb6('0x26')](function(_0x5104ea){if(_0x5104ea){return _0x5104ea?{'count':_0x1af4b6,'rows':_0x5104ea}:null;}})['then'](respondWithResult(_0x3b94c0,null))[_0x5fb6('0x48')](handleError(_0x3b94c0,null));}; \ No newline at end of file +var _0xf006=['UserId','agent','mailPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','addTeams','Agents','online','voicePause','flatMap','sequelize','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_mail_queues','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','get','MailQueues','destroy','error','stack','name','send','index','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','pick','where','map','type','VIRTUAL','field','filter','merge','options','includeAll','findAll','rows','catch','show','MailQueue','rawAttributes','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','UserMailQueue','order','User','findAndCountAll'];(function(_0x2c4486,_0x40c156){var _0x5cac5b=function(_0x2a1ac8){while(--_0x2a1ac8){_0x2c4486['push'](_0x2c4486['shift']());}};_0x5cac5b(++_0x40c156);}(_0xf006,0x146));var _0x6f00=function(_0x147e5b,_0x106879){_0x147e5b=_0x147e5b-0x0;var _0x336b55=_0xf006[_0x147e5b];return _0x336b55;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6f00('0x0'));var zipdir=require(_0x6f00('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f00('0x2'));var moment=require('moment');var BPromise=require(_0x6f00('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6f00('0x4'));var sox=require(_0x6f00('0x5'));var csv=require(_0x6f00('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6f00('0x7'));var squel=require('squel');var crypto=require(_0x6f00('0x8'));var jsforce=require(_0x6f00('0x9'));var deskjs=require(_0x6f00('0xa'));var toCsv=require(_0x6f00('0x6'));var querystring=require(_0x6f00('0xb'));var Papa=require(_0x6f00('0xc'));var Redis=require(_0x6f00('0xd'));var authService=require(_0x6f00('0xe'));var qs=require(_0x6f00('0xf'));var hardwareService=require(_0x6f00('0x10'));var logger=require(_0x6f00('0x11'))(_0x6f00('0x12'));var utils=require(_0x6f00('0x13'));var config=require('../../config/environment');var db=require(_0x6f00('0x14'))['db'];config[_0x6f00('0x15')]=_[_0x6f00('0x16')](config[_0x6f00('0x15')],{'host':_0x6f00('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6f00('0x15')]));require('./mailQueue.socket')[_0x6f00('0x18')](socket);function respondWithStatusCode(_0x5047f5,_0x324e67){_0x324e67=_0x324e67||0xcc;return function(_0x220e68){if(_0x220e68){return _0x5047f5[_0x6f00('0x19')](_0x324e67);}return _0x5047f5[_0x6f00('0x1a')](_0x324e67)[_0x6f00('0x1b')]();};}function respondWithResult(_0x411203,_0x46bc2c){_0x46bc2c=_0x46bc2c||0xc8;return function(_0x4d8aee){if(_0x4d8aee){return _0x411203[_0x6f00('0x1a')](_0x46bc2c)['json'](_0x4d8aee);}};}function respondWithFilteredResult(_0x14b15d,_0x5085f0){return function(_0x534275){if(_0x534275){var _0x7c047e=_0x534275[_0x6f00('0x1c')],_0x6cf83f=_0x5085f0[_0x6f00('0x1d')],_0x466c7c=_0x5085f0[_0x6f00('0x1d')]+_0x5085f0[_0x6f00('0x1e')],_0x340f78;if(_0x466c7c>=_0x7c047e){_0x466c7c=_0x7c047e;_0x340f78=0xc8;}else{_0x340f78=0xce;}_0x14b15d[_0x6f00('0x1a')](_0x340f78);return _0x14b15d[_0x6f00('0x1f')](_0x6f00('0x20'),_0x6cf83f+'-'+_0x466c7c+'/'+_0x7c047e)[_0x6f00('0x21')](_0x534275);}return null;};}function patchUpdates(_0x4e11de){return function(_0x4f3031){try{jsonpatch['apply'](_0x4f3031,_0x4e11de,!![]);}catch(_0x2a5286){return BPromise[_0x6f00('0x22')](_0x2a5286);}return _0x4f3031[_0x6f00('0x23')]();};}function saveUpdates(_0x57340f,_0xe301e5){return function(_0x9066ff){if(_0x9066ff){return _0x9066ff[_0x6f00('0x24')](_0x57340f)[_0x6f00('0x25')](function(_0x388983){return _0x388983;});}return null;};}function removeEntity(_0x1cbf1c,_0x90d74c){return function(_0x1ea061){if(_0x1ea061){return _0x1ea061['destroy']()[_0x6f00('0x25')](function(){var _0x45945e=_0x1ea061[_0x6f00('0x26')]({'plain':!![]});var _0x4d41ef=_0x6f00('0x27');return db['UserProfileResource'][_0x6f00('0x28')]({'where':{'type':_0x4d41ef,'resourceId':_0x45945e['id']}})['then'](function(){return _0x1ea061;});})[_0x6f00('0x25')](function(){_0x1cbf1c[_0x6f00('0x1a')](0xcc)[_0x6f00('0x1b')]();});}};}function handleEntityNotFound(_0x1f84a6,_0x375d76){return function(_0x49eb87){if(!_0x49eb87){_0x1f84a6[_0x6f00('0x19')](0x194);}return _0x49eb87;};}function handleError(_0x25cc71,_0x35c16c){_0x35c16c=_0x35c16c||0x1f4;return function(_0x4366a4){logger[_0x6f00('0x29')](_0x4366a4[_0x6f00('0x2a')]);if(_0x4366a4[_0x6f00('0x2b')]){delete _0x4366a4[_0x6f00('0x2b')];}_0x25cc71[_0x6f00('0x1a')](_0x35c16c)[_0x6f00('0x2c')](_0x4366a4);};}exports[_0x6f00('0x2d')]=function(_0x448888,_0x29555d){var _0x17d9d1={},_0x5dde51={},_0x5775c5={'count':0x0,'rows':[]};var _0x5d16ad=db['MailQueue']['rawAttributes'];_0x5dde51['model']=_[_0x6f00('0x2e')](_0x5d16ad);_0x5dde51['query']=_[_0x6f00('0x2e')](_0x448888[_0x6f00('0x2f')]);_0x5dde51[_0x6f00('0x30')]=_[_0x6f00('0x31')](_0x5dde51[_0x6f00('0x32')],_0x5dde51[_0x6f00('0x2f')]);_0x17d9d1['attributes']=_[_0x6f00('0x31')](_0x5dde51[_0x6f00('0x32')],qs[_0x6f00('0x33')](_0x448888[_0x6f00('0x2f')][_0x6f00('0x33')]));_0x17d9d1['attributes']=_0x17d9d1['attributes']['length']?_0x17d9d1[_0x6f00('0x34')]:_0x5dde51[_0x6f00('0x32')];if(!_0x448888[_0x6f00('0x2f')][_0x6f00('0x35')](_0x6f00('0x36'))){_0x17d9d1['limit']=qs[_0x6f00('0x1e')](_0x448888[_0x6f00('0x2f')][_0x6f00('0x1e')]);_0x17d9d1[_0x6f00('0x1d')]=qs[_0x6f00('0x1d')](_0x448888[_0x6f00('0x2f')][_0x6f00('0x1d')]);}_0x17d9d1['order']=qs[_0x6f00('0x37')](_0x448888[_0x6f00('0x2f')][_0x6f00('0x37')]);_0x17d9d1['where']=qs[_0x6f00('0x30')](_[_0x6f00('0x38')](_0x448888[_0x6f00('0x2f')],_0x5dde51['filters']));if(_0x448888[_0x6f00('0x2f')]['filter']){_0x17d9d1[_0x6f00('0x39')]=_['merge'](_0x17d9d1[_0x6f00('0x39')],{'$or':_[_0x6f00('0x3a')](_0x5d16ad,function(_0x37c791){if(_0x37c791[_0x6f00('0x3b')]['key']!==_0x6f00('0x3c')){var _0x5e32c1={};_0x5e32c1[_0x37c791[_0x6f00('0x3d')]]={'$like':'%'+_0x448888['query'][_0x6f00('0x3e')]+'%'};return _0x5e32c1;}})});}_0x17d9d1=_[_0x6f00('0x3f')]({},_0x17d9d1,_0x448888[_0x6f00('0x40')]);var _0x1ed015={'where':_0x17d9d1['where']};return db['MailQueue'][_0x6f00('0x1c')](_0x1ed015)['then'](function(_0x209d39){_0x5775c5[_0x6f00('0x1c')]=_0x209d39;if(_0x448888['query'][_0x6f00('0x41')]){_0x17d9d1['include']=[{'all':!![]}];}return db['MailQueue'][_0x6f00('0x42')](_0x17d9d1);})[_0x6f00('0x25')](function(_0x1a9f4c){_0x5775c5[_0x6f00('0x43')]=_0x1a9f4c;return _0x5775c5;})['then'](respondWithFilteredResult(_0x29555d,_0x17d9d1))[_0x6f00('0x44')](handleError(_0x29555d,null));};exports[_0x6f00('0x45')]=function(_0x2bb5aa,_0x407f35){var _0x2788ad={'raw':!![],'where':{'id':_0x2bb5aa['params']['id']}},_0x1059e9={};_0x1059e9[_0x6f00('0x32')]=_[_0x6f00('0x2e')](db[_0x6f00('0x46')][_0x6f00('0x47')]);_0x1059e9[_0x6f00('0x2f')]=_[_0x6f00('0x2e')](_0x2bb5aa['query']);_0x1059e9[_0x6f00('0x30')]=_[_0x6f00('0x31')](_0x1059e9[_0x6f00('0x32')],_0x1059e9['query']);_0x2788ad[_0x6f00('0x34')]=_['intersection'](_0x1059e9[_0x6f00('0x32')],qs[_0x6f00('0x33')](_0x2bb5aa['query'][_0x6f00('0x33')]));_0x2788ad['attributes']=_0x2788ad[_0x6f00('0x34')][_0x6f00('0x48')]?_0x2788ad[_0x6f00('0x34')]:_0x1059e9[_0x6f00('0x32')];if(_0x2bb5aa['query'][_0x6f00('0x41')]){_0x2788ad['include']=[{'all':!![]}];}_0x2788ad=_[_0x6f00('0x3f')]({},_0x2788ad,_0x2bb5aa['options']);return db[_0x6f00('0x46')][_0x6f00('0x49')](_0x2788ad)[_0x6f00('0x25')](handleEntityNotFound(_0x407f35,null))[_0x6f00('0x25')](respondWithResult(_0x407f35,null))[_0x6f00('0x44')](handleError(_0x407f35,null));};exports[_0x6f00('0x4a')]=function(_0x189109,_0x23af58){return db['MailQueue'][_0x6f00('0x4a')](_0x189109['body'],{})[_0x6f00('0x25')](function(_0x31fb17){var _0x27f38b=_0x189109['user']['get']({'plain':!![]});if(!_0x27f38b)throw new Error(_0x6f00('0x4b'));if(_0x27f38b[_0x6f00('0x4c')]==='user'){var _0x3b15c6=_0x31fb17['get']({'plain':!![]});var _0x28130d='MailQueues';return db[_0x6f00('0x4d')][_0x6f00('0x49')]({'where':{'name':_0x28130d,'userProfileId':_0x27f38b['userProfileId']},'raw':!![]})['then'](function(_0x418543){if(_0x418543&&_0x418543[_0x6f00('0x4e')]===0x0){return db['UserProfileResource'][_0x6f00('0x4a')]({'name':_0x3b15c6['name'],'resourceId':_0x3b15c6['id'],'type':_0x418543[_0x6f00('0x2b')],'sectionId':_0x418543['id']},{})[_0x6f00('0x25')](function(){return _0x31fb17;});}else{return _0x31fb17;}})[_0x6f00('0x44')](function(_0x14f58c){logger[_0x6f00('0x29')](_0x6f00('0x4f'),_0x14f58c);throw _0x14f58c;});}return _0x31fb17;})[_0x6f00('0x25')](respondWithResult(_0x23af58,0xc9))[_0x6f00('0x44')](handleError(_0x23af58,null));};exports[_0x6f00('0x24')]=function(_0x17ff62,_0x1ddfa2){if(_0x17ff62[_0x6f00('0x50')]['id']){delete _0x17ff62[_0x6f00('0x50')]['id'];}return db[_0x6f00('0x46')][_0x6f00('0x49')]({'where':{'id':_0x17ff62[_0x6f00('0x51')]['id']}})[_0x6f00('0x25')](handleEntityNotFound(_0x1ddfa2,null))[_0x6f00('0x25')](saveUpdates(_0x17ff62[_0x6f00('0x50')],null))[_0x6f00('0x25')](respondWithResult(_0x1ddfa2,null))['catch'](handleError(_0x1ddfa2,null));};exports['destroy']=function(_0x13f299,_0x5eda94){return db[_0x6f00('0x46')][_0x6f00('0x49')]({'where':{'id':_0x13f299['params']['id']}})[_0x6f00('0x25')](handleEntityNotFound(_0x5eda94,null))[_0x6f00('0x25')](removeEntity(_0x5eda94,null))[_0x6f00('0x44')](handleError(_0x5eda94,null));};exports['describe']=function(_0x3f9123,_0x4e5638){return db[_0x6f00('0x46')][_0x6f00('0x52')]()['then'](respondWithResult(_0x4e5638,null))[_0x6f00('0x44')](handleError(_0x4e5638,null));};exports[_0x6f00('0x53')]=function(_0xd2e139,_0x111fd4,_0x3cf1a5){var _0x1bb9f5={'raw':!![],'where':{}},_0x2f8720={},_0x4a4905;return db['MailQueue']['findOne']({'where':{'id':_0xd2e139['params']['id']}})[_0x6f00('0x25')](handleEntityNotFound(_0x111fd4,null))[_0x6f00('0x25')](function(_0x5bbfdb){if(_0x5bbfdb){_0x4a4905=_0x5bbfdb['get']({'plain':!![]});_0x2f8720[_0x6f00('0x32')]=_[_0x6f00('0x2e')](db[_0x6f00('0x54')][_0x6f00('0x47')]);_0x2f8720['query']=_[_0x6f00('0x2e')](_0xd2e139['query']);_0x2f8720['filters']=_[_0x6f00('0x31')](_0x2f8720[_0x6f00('0x32')],_0x2f8720[_0x6f00('0x2f')]);_0x1bb9f5[_0x6f00('0x34')]=_[_0x6f00('0x31')](_0x2f8720['model'],qs[_0x6f00('0x33')](_0xd2e139[_0x6f00('0x2f')][_0x6f00('0x33')]));_0x1bb9f5[_0x6f00('0x34')]=_0x1bb9f5['attributes']['length']?_0x1bb9f5[_0x6f00('0x34')]:_0x2f8720['model'];if(!_0xd2e139[_0x6f00('0x2f')][_0x6f00('0x35')](_0x6f00('0x36'))){_0x1bb9f5[_0x6f00('0x1e')]=qs['limit'](_0xd2e139['query'][_0x6f00('0x1e')]);_0x1bb9f5[_0x6f00('0x1d')]=qs[_0x6f00('0x1d')](_0xd2e139[_0x6f00('0x2f')]['offset']);}_0x1bb9f5[_0x6f00('0x55')]=qs[_0x6f00('0x37')](_0xd2e139[_0x6f00('0x2f')][_0x6f00('0x37')]);_0x1bb9f5[_0x6f00('0x39')]=qs['filters'](_['pick'](_0xd2e139['query'],_0x2f8720[_0x6f00('0x30')]));_0x1bb9f5[_0x6f00('0x39')]['MailQueueId']=_0x5bbfdb['id'];if(_0xd2e139['query'][_0x6f00('0x3e')]){_0x1bb9f5[_0x6f00('0x39')]=_['merge'](_0x1bb9f5['where'],{'$or':_[_0x6f00('0x3a')](_0x1bb9f5[_0x6f00('0x34')],function(_0x31c809){var _0x19d095={};_0x19d095[_0x31c809]={'$like':'%'+_0xd2e139[_0x6f00('0x2f')][_0x6f00('0x3e')]+'%'};return _0x19d095;})});}_0x1bb9f5=_[_0x6f00('0x3f')]({},_0x1bb9f5,_0xd2e139[_0x6f00('0x40')]);return db['UserMailQueue']['findAll'](_0x1bb9f5);}})[_0x6f00('0x25')](function(_0x31bdd8){if(_0x31bdd8){return db[_0x6f00('0x56')][_0x6f00('0x57')]({'where':{'id':_[_0x6f00('0x3a')](_0x31bdd8,_0x6f00('0x58')),'role':_0x6f00('0x59')},'attributes':['id',_0x6f00('0x2b'),_0x6f00('0x5a'),_0x6f00('0x5b'),_0x6f00('0x5c')]});}})[_0x6f00('0x25')](function(_0x27e146){if(_0x27e146){return{'count':_0x27e146[_0x6f00('0x1c')],'rows':_[_0x6f00('0x3a')](_0x27e146[_0x6f00('0x43')],function(_0x284eaf){return{'membername':_0x284eaf['name'],'UserId':_0x284eaf['id'],'queue_name':_0x4a4905['name'],'MailQueueId':_0x4a4905['id'],'interface':util[_0x6f00('0x5d')]('%s/%s',_0x6f00('0x5e'),_0x284eaf[_0x6f00('0x2b')]),'penalty':0x0,'paused':_0x284eaf[_0x6f00('0x5a')],'createdAt':_0x284eaf[_0x6f00('0x5c')],'updatedAt':_0x284eaf[_0x6f00('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x111fd4,_0x1bb9f5))[_0x6f00('0x44')](handleError(_0x111fd4,null));};exports[_0x6f00('0x5f')]=function(_0x35d7a2,_0x248a5e,_0x23260e){var _0xd1f5a8={};var _0x25f90e={};var _0x120fd5;var _0x18bcba;return db[_0x6f00('0x46')][_0x6f00('0x60')]({'where':{'id':_0x35d7a2['params']['id']}})[_0x6f00('0x25')](handleEntityNotFound(_0x248a5e,null))[_0x6f00('0x25')](function(_0x422318){if(_0x422318){_0x120fd5=_0x422318;_0x25f90e['model']=_['keys'](db[_0x6f00('0x61')][_0x6f00('0x47')]);_0x25f90e[_0x6f00('0x2f')]=_[_0x6f00('0x2e')](_0x35d7a2['query']);_0x25f90e['filters']=_['intersection'](_0x25f90e['model'],_0x25f90e[_0x6f00('0x2f')]);_0xd1f5a8[_0x6f00('0x34')]=_[_0x6f00('0x31')](_0x25f90e[_0x6f00('0x32')],qs[_0x6f00('0x33')](_0x35d7a2['query'][_0x6f00('0x33')]));_0xd1f5a8[_0x6f00('0x34')]=_0xd1f5a8['attributes'][_0x6f00('0x48')]?_0xd1f5a8[_0x6f00('0x34')]:_0x25f90e[_0x6f00('0x32')];_0xd1f5a8[_0x6f00('0x55')]=qs[_0x6f00('0x37')](_0x35d7a2[_0x6f00('0x2f')][_0x6f00('0x37')]);_0xd1f5a8[_0x6f00('0x39')]=qs['filters'](_[_0x6f00('0x38')](_0x35d7a2['query'],_0x25f90e[_0x6f00('0x30')]));if(_0x35d7a2[_0x6f00('0x2f')][_0x6f00('0x3e')]){_0xd1f5a8[_0x6f00('0x39')]=_[_0x6f00('0x3f')](_0xd1f5a8[_0x6f00('0x39')],{'$or':_[_0x6f00('0x3a')](_0xd1f5a8[_0x6f00('0x34')],function(_0x1b086b){var _0x1c2685={};_0x1c2685[_0x1b086b]={'$like':'%'+_0x35d7a2[_0x6f00('0x2f')][_0x6f00('0x3e')]+'%'};return _0x1c2685;})});}_0xd1f5a8=_[_0x6f00('0x3f')]({},_0xd1f5a8,_0x35d7a2[_0x6f00('0x40')]);return _0x120fd5['getTeams'](_0xd1f5a8);}})[_0x6f00('0x25')](function(_0xdfa8ff){if(_0xdfa8ff){_0x18bcba=_0xdfa8ff[_0x6f00('0x48')];if(!_0x35d7a2['query'][_0x6f00('0x35')](_0x6f00('0x36'))){_0xd1f5a8['limit']=qs[_0x6f00('0x1e')](_0x35d7a2[_0x6f00('0x2f')][_0x6f00('0x1e')]);_0xd1f5a8[_0x6f00('0x1d')]=qs['offset'](_0x35d7a2['query']['offset']);}return _0x120fd5[_0x6f00('0x5f')](_0xd1f5a8);}})[_0x6f00('0x25')](function(_0x26fd77){if(_0x26fd77){return _0x26fd77?{'count':_0x18bcba,'rows':_0x26fd77}:null;}})[_0x6f00('0x25')](respondWithResult(_0x248a5e,null))['catch'](handleError(_0x248a5e,null));};exports[_0x6f00('0x62')]=function(_0x331b55,_0x46a846,_0x46be3d){var _0x163885=_0x331b55[_0x6f00('0x50')]['teams'];return db['Team'][_0x6f00('0x42')]({'where':{'id':_[_0x6f00('0x3a')](_0x163885,'id')},'attributes':['id'],'include':[{'model':db[_0x6f00('0x56')],'as':_0x6f00('0x63'),'attributes':['id',_0x6f00('0x2b'),_0x6f00('0x64'),_0x6f00('0x65'),'interface'],'raw':!![]}]})[_0x6f00('0x25')](function(_0x404e04){if(_0x404e04){var _0x53cd84=_[_0x6f00('0x66')](_0x404e04,function(_0x3530f4){var _0x5f5248=_0x3530f4['get']({'plain':!![]});return _0x5f5248[_0x6f00('0x63')];});return db[_0x6f00('0x46')][_0x6f00('0x49')]({'where':{'id':_0x331b55[_0x6f00('0x51')]['id']}})[_0x6f00('0x25')](function(_0x37b4aa){return db[_0x6f00('0x67')]['transaction'](function(_0xe1246){return _0x37b4aa[_0x6f00('0x62')](_[_0x6f00('0x3a')](_0x163885,'id'),{'transaction':_0xe1246})[_0x6f00('0x25')](function(){return BPromise[_0x6f00('0x68')](_0x53cd84,function(_0x42f2ba){return db[_0x6f00('0x54')][_0x6f00('0x69')]({'where':{'UserId':_0x42f2ba['id'],'MailQueueId':_0x331b55[_0x6f00('0x51')]['id']},'transaction':_0xe1246});});})[_0x6f00('0x25')](function(){_0x53cd84[_0x6f00('0x6a')](function(_0x1f2f3b){socket[_0x6f00('0x6b')](_0x6f00('0x6c'),{'UserId':_0x1f2f3b['id'],'MailQueueId':_0x37b4aa['id']});});});});});}})[_0x6f00('0x25')](respondWithStatusCode(_0x46a846,null))['catch'](handleError(_0x46a846,null));};exports[_0x6f00('0x6d')]=function(_0x1e7153,_0x39113c,_0x10694d){return db['Team'][_0x6f00('0x42')]({'where':{'id':_0x1e7153[_0x6f00('0x2f')][_0x6f00('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x6f00('0x56')],'as':_0x6f00('0x63'),'attributes':['id'],'raw':!![]}]})[_0x6f00('0x25')](handleEntityNotFound(_0x39113c,null))[_0x6f00('0x25')](function(_0x260c28){var _0x86d885=_[_0x6f00('0x3a')](_0x260c28,'id');var _0x396f8a=[];var _0x2069e5=[];var _0x3692dd=squel[_0x6f00('0x6f')]();_0x3692dd['field'](_0x6f00('0x70'))[_0x6f00('0x71')](_0x6f00('0x72'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6f00('0x39')](_0x6f00('0x73'),_0x1e7153[_0x6f00('0x51')]['id']);for(var _0x1fb025=0x0;_0x1fb025<_0x260c28['length'];_0x1fb025+=0x1){let _0x39c8f1=_0x260c28[_0x1fb025];for(var _0x52193e=0x0;_0x52193e<_0x39c8f1['Agents'][_0x6f00('0x48')];_0x52193e+=0x1){let _0x2301ab=_0x39c8f1[_0x6f00('0x63')][_0x52193e];var _0x1d8637=_0x3692dd[_0x6f00('0x74')]();_0x1d8637[_0x6f00('0x39')](_0x6f00('0x75'),_0x2301ab['id']);_0x2069e5[_0x6f00('0x76')](db[_0x6f00('0x67')][_0x6f00('0x2f')](_0x1d8637[_0x6f00('0x77')](),{'type':db['sequelize'][_0x6f00('0x78')][_0x6f00('0x79')]})[_0x6f00('0x25')](function(_0x503d43){if(_0x503d43['length']===0x1){return _0x2301ab['id'];}else{var _0xd3ebda=_[_0x6f00('0x7a')](_[_0x6f00('0x3a')](_0x503d43,_0x6f00('0x7b')),function(_0x173541){return _[_0x6f00('0x7c')](_0x86d885,_0x173541);});if(_0xd3ebda){return _0x2301ab['id'];}}}));}}return BPromise[_0x6f00('0x7d')](_0x2069e5)[_0x6f00('0x25')](function(_0x533056){_0x396f8a=_(_0x396f8a)[_0x6f00('0x7e')](_0x533056)[_0x6f00('0x7f')]()[_0x6f00('0x80')]();return db[_0x6f00('0x46')][_0x6f00('0x49')]({'where':{'id':_0x1e7153[_0x6f00('0x51')]['id']}})[_0x6f00('0x25')](function(_0xddfbbb){return db[_0x6f00('0x67')][_0x6f00('0x81')](function(_0x1bc2ee){return _0xddfbbb['removeTeams'](_0x1e7153[_0x6f00('0x2f')][_0x6f00('0x6e')],{'transaction':_0x1bc2ee})['then'](function(){if(!_[_0x6f00('0x82')](_0x396f8a)){return _0xddfbbb[_0x6f00('0x83')](_0x396f8a,{'transaction':_0x1bc2ee});}})[_0x6f00('0x25')](function(){_0x396f8a['forEach'](function(_0x3c4fb7){socket[_0x6f00('0x6b')](_0x6f00('0x84'),{'UserId':_0x3c4fb7,'MailQueueId':_0xddfbbb['id']});});});});});});})[_0x6f00('0x25')](respondWithStatusCode(_0x39113c,null))['catch'](handleError(_0x39113c,null));};exports[_0x6f00('0x85')]=function(_0x2a98d7,_0x26bcc1,_0xb4f9a4){return db[_0x6f00('0x46')][_0x6f00('0x49')]({'where':{'id':_0x2a98d7['params']['id']}})[_0x6f00('0x25')](handleEntityNotFound(_0x26bcc1,null))[_0x6f00('0x25')](function(_0x3edb84){if(_0x3edb84){return _0x3edb84[_0x6f00('0x85')](_0x2a98d7[_0x6f00('0x50')]['ids'],_[_0x6f00('0x86')](_0x2a98d7['body'],[_0x6f00('0x6e'),'id'])||{})[_0x6f00('0x87')](function(_0x3150eb){for(var _0x46f291=0x0;_0x46f291<_0x2a98d7['body'][_0x6f00('0x6e')][_0x6f00('0x48')];_0x46f291+=0x1){socket['emit'](_0x6f00('0x6c'),{'UserId':_0x2a98d7[_0x6f00('0x50')]['ids'][_0x46f291],'MailQueueId':_0x2a98d7[_0x6f00('0x51')]['id']});}return _0x3150eb;});}})[_0x6f00('0x25')](respondWithResult(_0x26bcc1,null))[_0x6f00('0x44')](handleError(_0x26bcc1,null));};exports[_0x6f00('0x83')]=function(_0x49daf1,_0xa0aa8c,_0x19bf03){return db[_0x6f00('0x46')][_0x6f00('0x49')]({'where':{'id':_0x49daf1[_0x6f00('0x51')]['id']}})[_0x6f00('0x25')](handleEntityNotFound(_0xa0aa8c,null))[_0x6f00('0x25')](function(_0x1cfd0d){if(_0x1cfd0d){return _0x1cfd0d[_0x6f00('0x83')](_0x49daf1[_0x6f00('0x2f')][_0x6f00('0x6e')])['then'](function(){if(_[_0x6f00('0x88')](_0x49daf1[_0x6f00('0x2f')][_0x6f00('0x6e')])){for(var _0x29b5bd=0x0;_0x29b5bd<_0x49daf1['query'][_0x6f00('0x6e')][_0x6f00('0x48')];_0x29b5bd+=0x1){socket['emit'](_0x6f00('0x84'),{'UserId':Number(_0x49daf1['query'][_0x6f00('0x6e')][_0x29b5bd]),'MailQueueId':Number(_0x49daf1['params']['id'])});}}else{socket[_0x6f00('0x6b')]('userMailQueue:remove',{'UserId':Number(_0x49daf1[_0x6f00('0x2f')][_0x6f00('0x6e')]),'MailQueueId':Number(_0x49daf1['params']['id'])});}});}})[_0x6f00('0x25')](respondWithStatusCode(_0xa0aa8c,null))[_0x6f00('0x44')](handleError(_0xa0aa8c,null));};exports['getAgents']=function(_0x32232e,_0x377f1c,_0x54b377){var _0x37cf97={};var _0x42f565={};var _0x2150c3;var _0x9b3729;return db['MailQueue'][_0x6f00('0x60')]({'where':{'id':_0x32232e[_0x6f00('0x51')]['id']}})[_0x6f00('0x25')](handleEntityNotFound(_0x377f1c,null))['then'](function(_0x4f5b3f){if(_0x4f5b3f){_0x2150c3=_0x4f5b3f;_0x42f565[_0x6f00('0x32')]=_[_0x6f00('0x2e')](db[_0x6f00('0x56')][_0x6f00('0x47')]);_0x42f565[_0x6f00('0x2f')]=_['keys'](_0x32232e[_0x6f00('0x2f')]);_0x42f565[_0x6f00('0x30')]=_['intersection'](_0x42f565[_0x6f00('0x32')],_0x42f565[_0x6f00('0x2f')]);_0x37cf97['attributes']=_[_0x6f00('0x31')](_0x42f565['model'],qs[_0x6f00('0x33')](_0x32232e[_0x6f00('0x2f')][_0x6f00('0x33')]));_0x37cf97[_0x6f00('0x34')]=_0x37cf97[_0x6f00('0x34')][_0x6f00('0x48')]?_0x37cf97[_0x6f00('0x34')]:_0x42f565['model'];_0x37cf97[_0x6f00('0x55')]=qs[_0x6f00('0x37')](_0x32232e['query'][_0x6f00('0x37')]);_0x37cf97[_0x6f00('0x39')]=qs[_0x6f00('0x30')](_[_0x6f00('0x38')](_0x32232e[_0x6f00('0x2f')],_0x42f565[_0x6f00('0x30')]));if(_0x32232e[_0x6f00('0x2f')][_0x6f00('0x3e')]){_0x37cf97['where']=_[_0x6f00('0x3f')](_0x37cf97['where'],{'$or':_[_0x6f00('0x3a')](_0x37cf97['attributes'],function(_0x353035){var _0x21df30={};_0x21df30[_0x353035]={'$like':'%'+_0x32232e[_0x6f00('0x2f')][_0x6f00('0x3e')]+'%'};return _0x21df30;})});}_0x37cf97=_[_0x6f00('0x3f')]({},_0x37cf97,_0x32232e[_0x6f00('0x40')]);return _0x2150c3[_0x6f00('0x89')](_0x37cf97);}})[_0x6f00('0x25')](function(_0x4642a5){if(_0x4642a5){_0x9b3729=_0x4642a5[_0x6f00('0x48')];if(!_0x32232e[_0x6f00('0x2f')]['hasOwnProperty'](_0x6f00('0x36'))){_0x37cf97[_0x6f00('0x1e')]=qs[_0x6f00('0x1e')](_0x32232e[_0x6f00('0x2f')][_0x6f00('0x1e')]);_0x37cf97['offset']=qs[_0x6f00('0x1d')](_0x32232e[_0x6f00('0x2f')][_0x6f00('0x1d')]);}return _0x2150c3['getAgents'](_0x37cf97);}})['then'](function(_0x1ea084){if(_0x1ea084){return _0x1ea084?{'count':_0x9b3729,'rows':_0x1ea084}:null;}})[_0x6f00('0x25')](respondWithResult(_0x377f1c,null))['catch'](handleError(_0x377f1c,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 696aada..f590db3 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 _0xfd4e=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','save'];(function(_0x1eed1c,_0x107a79){var _0x4c613e=function(_0x56b1fb){while(--_0x56b1fb){_0x1eed1c['push'](_0x1eed1c['shift']());}};_0x4c613e(++_0x107a79);}(_0xfd4e,0x1d6));var _0xefd4=function(_0x193279,_0x3c4cfa){_0x193279=_0x193279-0x0;var _0x59cc4f=_0xfd4e[_0x193279];return _0x59cc4f;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xefd4('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xefd4('0x1'),'afterUpdate':_0xefd4('0x2'),'afterDestroy':_0xefd4('0x3')};function emitEvent(_0x3af758){return function(_0x297aca,_0x493e68,_0x5733ca){MailQueueEvents[_0xefd4('0x4')](_0x3af758+':'+_0x297aca['id'],_0x297aca);MailQueueEvents[_0xefd4('0x4')](_0x3af758,_0x297aca);_0x5733ca(null);};}for(var e in events){if(events[_0xefd4('0x5')](e)){var event=events[e];MailQueue[_0xefd4('0x6')](e,emitEvent(event));}}module[_0xefd4('0x7')]=MailQueueEvents; \ No newline at end of file +var _0xc6cb=['exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','hasOwnProperty','hook'];(function(_0x3a5769,_0x9f449e){var _0x47451d=function(_0x1aba93){while(--_0x1aba93){_0x3a5769['push'](_0x3a5769['shift']());}};_0x47451d(++_0x9f449e);}(_0xc6cb,0xfb));var _0xbc6c=function(_0x21b2e7,_0x4ab44f){_0x21b2e7=_0x21b2e7-0x0;var _0x18f1a2=_0xc6cb[_0x21b2e7];return _0x18f1a2;};'use strict';var EventEmitter=require(_0xbc6c('0x0'));var MailQueue=require(_0xbc6c('0x1'))['db'][_0xbc6c('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xbc6c('0x3')](0x0);var events={'afterCreate':_0xbc6c('0x4'),'afterUpdate':_0xbc6c('0x5'),'afterDestroy':_0xbc6c('0x6')};function emitEvent(_0xbd4242){return function(_0x31c945,_0xca6824,_0x2996d2){MailQueueEvents['emit'](_0xbd4242+':'+_0x31c945['id'],_0x31c945);MailQueueEvents['emit'](_0xbd4242,_0x31c945);_0x2996d2(null);};}for(var e in events){if(events[_0xbc6c('0x7')](e)){var event=events[e];MailQueue[_0xbc6c('0x8')](e,emitEvent(event));}}module[_0xbc6c('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index ce03638..42d0b69 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 _0xea10=['request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x580521,_0x3fb4c8){var _0x46db24=function(_0x1f08c6){while(--_0x1f08c6){_0x580521['push'](_0x580521['shift']());}};_0x46db24(++_0x3fb4c8);}(_0xea10,0x86));var _0x0ea1=function(_0x29957f,_0x208d01){_0x29957f=_0x29957f-0x0;var _0x23fd15=_0xea10[_0x29957f];return _0x23fd15;};'use strict';var _=require(_0x0ea1('0x0'));var util=require(_0x0ea1('0x1'));var logger=require(_0x0ea1('0x2'))(_0x0ea1('0x3'));var moment=require(_0x0ea1('0x4'));var BPromise=require(_0x0ea1('0x5'));var rp=require(_0x0ea1('0x6'));var fs=require('fs');var path=require(_0x0ea1('0x7'));var rimraf=require(_0x0ea1('0x8'));var config=require(_0x0ea1('0x9'));var attributes=require(_0x0ea1('0xa'));module[_0x0ea1('0xb')]=function(_0xca6d13,_0x4649d4){return _0xca6d13['define'](_0x0ea1('0xc'),attributes,{'tableName':_0x0ea1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30ec=['../../config/environment','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x58b233,_0x10b1e5){var _0x342f68=function(_0x1139aa){while(--_0x1139aa){_0x58b233['push'](_0x58b233['shift']());}};_0x342f68(++_0x10b1e5);}(_0x30ec,0xc0));var _0xc30e=function(_0x2980d9,_0xef7ff){_0x2980d9=_0x2980d9-0x0;var _0x37994e=_0x30ec[_0x2980d9];return _0x37994e;};'use strict';var _=require(_0xc30e('0x0'));var util=require(_0xc30e('0x1'));var logger=require(_0xc30e('0x2'))(_0xc30e('0x3'));var moment=require('moment');var BPromise=require(_0xc30e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc30e('0x5'));var rimraf=require('rimraf');var config=require(_0xc30e('0x6'));var attributes=require(_0xc30e('0x7'));module['exports']=function(_0x4f999d,_0x2fd67a){return _0x4f999d[_0xc30e('0x8')](_0xc30e('0x9'),attributes,{'tableName':_0xc30e('0xa'),'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 d0fe5ca..39be926 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 _0x65f8=['catch','MailQueue','findAll','options','raw','where','attributes','limit','include','model','map','then','GetMailQueue','debug','ShowMailQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x4bea4e,_0x445f6a){var _0x57e10d=function(_0x46ee40){while(--_0x46ee40){_0x4bea4e['push'](_0x4bea4e['shift']());}};_0x57e10d(++_0x445f6a);}(_0x65f8,0x87));var _0x865f=function(_0x500aeb,_0x29fdba){_0x500aeb=_0x500aeb-0x0;var _0x5f3052=_0x65f8[_0x500aeb];return _0x5f3052;};'use strict';var _=require(_0x865f('0x0'));var util=require(_0x865f('0x1'));var moment=require('moment');var BPromise=require(_0x865f('0x2'));var rs=require(_0x865f('0x3'));var fs=require('fs');var Redis=require(_0x865f('0x4'));var db=require(_0x865f('0x5'))['db'];var utils=require(_0x865f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x865f('0x7'));var jayson=require(_0x865f('0x8'));var client=jayson[_0x865f('0x9')][_0x865f('0xa')]({'port':0x232a});config[_0x865f('0xb')]=_[_0x865f('0xc')](config[_0x865f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x865f('0xd'))(new Redis(config[_0x865f('0xb')]));require(_0x865f('0xe'))[_0x865f('0xf')](socket);function respondWithRpcPromise(_0x7fdd8f,_0x2f2840,_0x24c9d7){return new BPromise(function(_0x579c60,_0x106d63){return client[_0x865f('0x10')](_0x7fdd8f,_0x24c9d7)['then'](function(_0x1d9add){logger[_0x865f('0x11')](_0x865f('0x12'),_0x2f2840,_0x865f('0x13'));logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x2f2840,_0x865f('0x13'),JSON[_0x865f('0x14')](_0x1d9add));if(_0x1d9add['error']){if(_0x1d9add[_0x865f('0x15')][_0x865f('0x16')]===0x1f4){logger[_0x865f('0x15')](_0x865f('0x12'),_0x2f2840,_0x1d9add[_0x865f('0x15')]['message']);return _0x106d63(_0x1d9add['error'][_0x865f('0x17')]);}logger[_0x865f('0x15')](_0x865f('0x12'),_0x2f2840,_0x1d9add[_0x865f('0x15')][_0x865f('0x17')]);return _0x579c60(_0x1d9add[_0x865f('0x15')]['message']);}else{logger['info'](_0x865f('0x12'),_0x2f2840,_0x865f('0x13'));_0x579c60(_0x1d9add[_0x865f('0x18')]['message']);}})[_0x865f('0x19')](function(_0x48a73f){logger[_0x865f('0x15')]('MailQueue,\x20%s,\x20%s',_0x2f2840,_0x48a73f);_0x106d63(_0x48a73f);});});}exports['GetMailQueue']=function(_0x4f582b){var _0x4129f1=this;return new Promise(function(_0x17b1ee,_0x5ca29c){return db[_0x865f('0x1a')][_0x865f('0x1b')]({'raw':_0x4f582b[_0x865f('0x1c')]?_0x4f582b[_0x865f('0x1c')][_0x865f('0x1d')]===undefined?!![]:![]:!![],'where':_0x4f582b[_0x865f('0x1c')]?_0x4f582b[_0x865f('0x1c')][_0x865f('0x1e')]||null:null,'attributes':_0x4f582b['options']?_0x4f582b[_0x865f('0x1c')][_0x865f('0x1f')]||null:null,'limit':_0x4f582b[_0x865f('0x1c')]?_0x4f582b[_0x865f('0x1c')][_0x865f('0x20')]||null:null,'include':_0x4f582b[_0x865f('0x1c')]?_0x4f582b[_0x865f('0x1c')]['include']?_['map'](_0x4f582b[_0x865f('0x1c')][_0x865f('0x21')],function(_0x3c7bbf){return{'model':db[_0x3c7bbf[_0x865f('0x22')]],'as':_0x3c7bbf['as'],'attributes':_0x3c7bbf['attributes'],'include':_0x3c7bbf[_0x865f('0x21')]?_[_0x865f('0x23')](_0x3c7bbf[_0x865f('0x21')],function(_0xdddca2){return{'model':db[_0xdddca2[_0x865f('0x22')]],'as':_0xdddca2['as'],'attributes':_0xdddca2[_0x865f('0x1f')],'include':_0xdddca2[_0x865f('0x21')]?_['map'](_0xdddca2[_0x865f('0x21')],function(_0x4419c6){return{'model':db[_0x4419c6[_0x865f('0x22')]],'as':_0x4419c6['as'],'attributes':_0x4419c6['attributes']};}):[]};}):[]};}):[]:[]})[_0x865f('0x24')](function(_0x368502){logger[_0x865f('0x11')](_0x865f('0x25'),_0x4f582b);logger[_0x865f('0x26')]('GetMailQueue',_0x4f582b,JSON['stringify'](_0x368502));_0x17b1ee(_0x368502);})[_0x865f('0x19')](function(_0xb71de){logger[_0x865f('0x15')](_0x865f('0x25'),_0xb71de[_0x865f('0x17')],_0x4f582b);_0x5ca29c(_0x4129f1[_0x865f('0x15')](0x1f4,_0xb71de['message']));});});};exports[_0x865f('0x27')]=function(_0x286516){var _0x2fbb96=this;return new Promise(function(_0x240357,_0x27a1cf){return db[_0x865f('0x1a')]['find']({'raw':_0x286516[_0x865f('0x1c')]?_0x286516[_0x865f('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x286516['options']?_0x286516[_0x865f('0x1c')]['where']||null:null,'attributes':_0x286516[_0x865f('0x1c')]?_0x286516[_0x865f('0x1c')][_0x865f('0x1f')]||null:null,'include':_0x286516[_0x865f('0x1c')]?_0x286516[_0x865f('0x1c')][_0x865f('0x21')]?_[_0x865f('0x23')](_0x286516['options'][_0x865f('0x21')],function(_0xea64bb){return{'model':db[_0xea64bb[_0x865f('0x22')]],'as':_0xea64bb['as'],'attributes':_0xea64bb[_0x865f('0x1f')],'include':_0xea64bb[_0x865f('0x21')]?_['map'](_0xea64bb[_0x865f('0x21')],function(_0x3dfd65){return{'model':db[_0x3dfd65['model']],'as':_0x3dfd65['as'],'attributes':_0x3dfd65[_0x865f('0x1f')],'include':_0x3dfd65[_0x865f('0x21')]?_[_0x865f('0x23')](_0x3dfd65['include'],function(_0x32337b){return{'model':db[_0x32337b[_0x865f('0x22')]],'as':_0x32337b['as'],'attributes':_0x32337b[_0x865f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x865f('0x24')](function(_0x3e7529){logger[_0x865f('0x11')]('ShowMailQueue',_0x286516);logger['debug'](_0x865f('0x27'),_0x286516,JSON[_0x865f('0x14')](_0x3e7529));_0x240357(_0x3e7529);})[_0x865f('0x19')](function(_0x2309a1){logger[_0x865f('0x15')](_0x865f('0x27'),_0x2309a1[_0x865f('0x17')],_0x286516);_0x27a1cf(_0x2fbb96[_0x865f('0x15')](0x1f4,_0x2309a1['message']));});});}; \ No newline at end of file +var _0x0c75=['where','limit','map','include','model','attributes','then','ShowMailQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','localhost','socket.io-emitter','redis','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw'];(function(_0xd0f620,_0x30033a){var _0x3c1a3a=function(_0x5c4e0c){while(--_0x5c4e0c){_0xd0f620['push'](_0xd0f620['shift']());}};_0x3c1a3a(++_0x30033a);}(_0x0c75,0xb0));var _0x50c7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0c75[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x50c7('0x0'));var util=require(_0x50c7('0x1'));var moment=require(_0x50c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x50c7('0x3'));var fs=require('fs');var Redis=require(_0x50c7('0x4'));var db=require(_0x50c7('0x5'))['db'];var utils=require(_0x50c7('0x6'));var logger=require(_0x50c7('0x7'))(_0x50c7('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x50c7('0x9')][_0x50c7('0xa')]({'port':0x232a});config['redis']=_[_0x50c7('0xb')](config['redis'],{'host':_0x50c7('0xc'),'port':0x18eb});var socket=require(_0x50c7('0xd'))(new Redis(config[_0x50c7('0xe')]));require(_0x50c7('0xf'))[_0x50c7('0x10')](socket);function respondWithRpcPromise(_0x2c298a,_0x3e088f,_0x15c9c2){return new BPromise(function(_0x35859a,_0x2e3aa4){return client[_0x50c7('0x11')](_0x2c298a,_0x15c9c2)['then'](function(_0xadeae){logger[_0x50c7('0x12')](_0x50c7('0x13'),_0x3e088f,_0x50c7('0x14'));logger[_0x50c7('0x15')](_0x50c7('0x16'),_0x3e088f,'request\x20sent',JSON[_0x50c7('0x17')](_0xadeae));if(_0xadeae[_0x50c7('0x18')]){if(_0xadeae['error'][_0x50c7('0x19')]===0x1f4){logger[_0x50c7('0x18')]('MailQueue,\x20%s,\x20%s',_0x3e088f,_0xadeae[_0x50c7('0x18')][_0x50c7('0x1a')]);return _0x2e3aa4(_0xadeae[_0x50c7('0x18')][_0x50c7('0x1a')]);}logger[_0x50c7('0x18')](_0x50c7('0x13'),_0x3e088f,_0xadeae[_0x50c7('0x18')][_0x50c7('0x1a')]);return _0x35859a(_0xadeae['error'][_0x50c7('0x1a')]);}else{logger[_0x50c7('0x12')](_0x50c7('0x13'),_0x3e088f,_0x50c7('0x14'));_0x35859a(_0xadeae[_0x50c7('0x1b')]['message']);}})[_0x50c7('0x1c')](function(_0x11d70f){logger[_0x50c7('0x18')](_0x50c7('0x13'),_0x3e088f,_0x11d70f);_0x2e3aa4(_0x11d70f);});});}exports[_0x50c7('0x1d')]=function(_0x13e3df){var _0x2ac89d=this;return new Promise(function(_0x542a67,_0x39b6b9){return db[_0x50c7('0x1e')][_0x50c7('0x1f')]({'raw':_0x13e3df['options']?_0x13e3df[_0x50c7('0x20')][_0x50c7('0x21')]===undefined?!![]:![]:!![],'where':_0x13e3df[_0x50c7('0x20')]?_0x13e3df[_0x50c7('0x20')][_0x50c7('0x22')]||null:null,'attributes':_0x13e3df[_0x50c7('0x20')]?_0x13e3df[_0x50c7('0x20')]['attributes']||null:null,'limit':_0x13e3df[_0x50c7('0x20')]?_0x13e3df['options'][_0x50c7('0x23')]||null:null,'include':_0x13e3df[_0x50c7('0x20')]?_0x13e3df[_0x50c7('0x20')]['include']?_[_0x50c7('0x24')](_0x13e3df['options'][_0x50c7('0x25')],function(_0x2e763a){return{'model':db[_0x2e763a[_0x50c7('0x26')]],'as':_0x2e763a['as'],'attributes':_0x2e763a[_0x50c7('0x27')],'include':_0x2e763a[_0x50c7('0x25')]?_[_0x50c7('0x24')](_0x2e763a['include'],function(_0x5de7b9){return{'model':db[_0x5de7b9[_0x50c7('0x26')]],'as':_0x5de7b9['as'],'attributes':_0x5de7b9[_0x50c7('0x27')],'include':_0x5de7b9[_0x50c7('0x25')]?_['map'](_0x5de7b9[_0x50c7('0x25')],function(_0x257540){return{'model':db[_0x257540[_0x50c7('0x26')]],'as':_0x257540['as'],'attributes':_0x257540['attributes']};}):[]};}):[]};}):[]:[]})[_0x50c7('0x28')](function(_0x3a27ff){logger[_0x50c7('0x12')](_0x50c7('0x1d'),_0x13e3df);logger[_0x50c7('0x15')](_0x50c7('0x1d'),_0x13e3df,JSON['stringify'](_0x3a27ff));_0x542a67(_0x3a27ff);})[_0x50c7('0x1c')](function(_0x52a9ca){logger[_0x50c7('0x18')]('GetMailQueue',_0x52a9ca[_0x50c7('0x1a')],_0x13e3df);_0x39b6b9(_0x2ac89d[_0x50c7('0x18')](0x1f4,_0x52a9ca['message']));});});};exports[_0x50c7('0x29')]=function(_0x4af7d9){var _0x14d82a=this;return new Promise(function(_0x351d41,_0x4006a1){return db['MailQueue']['find']({'raw':_0x4af7d9[_0x50c7('0x20')]?_0x4af7d9[_0x50c7('0x20')][_0x50c7('0x21')]===undefined?!![]:![]:!![],'where':_0x4af7d9[_0x50c7('0x20')]?_0x4af7d9['options'][_0x50c7('0x22')]||null:null,'attributes':_0x4af7d9[_0x50c7('0x20')]?_0x4af7d9['options'][_0x50c7('0x27')]||null:null,'include':_0x4af7d9[_0x50c7('0x20')]?_0x4af7d9['options'][_0x50c7('0x25')]?_[_0x50c7('0x24')](_0x4af7d9[_0x50c7('0x20')][_0x50c7('0x25')],function(_0xe454d1){return{'model':db[_0xe454d1[_0x50c7('0x26')]],'as':_0xe454d1['as'],'attributes':_0xe454d1[_0x50c7('0x27')],'include':_0xe454d1[_0x50c7('0x25')]?_[_0x50c7('0x24')](_0xe454d1[_0x50c7('0x25')],function(_0x25eb59){return{'model':db[_0x25eb59[_0x50c7('0x26')]],'as':_0x25eb59['as'],'attributes':_0x25eb59[_0x50c7('0x27')],'include':_0x25eb59[_0x50c7('0x25')]?_[_0x50c7('0x24')](_0x25eb59[_0x50c7('0x25')],function(_0x401290){return{'model':db[_0x401290[_0x50c7('0x26')]],'as':_0x401290['as'],'attributes':_0x401290['attributes']};}):[]};}):[]};}):[]:[]})[_0x50c7('0x28')](function(_0x114999){logger[_0x50c7('0x12')](_0x50c7('0x29'),_0x4af7d9);logger[_0x50c7('0x15')](_0x50c7('0x29'),_0x4af7d9,JSON[_0x50c7('0x17')](_0x114999));_0x351d41(_0x114999);})[_0x50c7('0x1c')](function(_0xd14e46){logger[_0x50c7('0x18')](_0x50c7('0x29'),_0xd14e46[_0x50c7('0x1a')],_0x4af7d9);_0x4006a1(_0x14d82a['error'](0x1f4,_0xd14e46[_0x50c7('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index be504ae..9edcb6f 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 _0x39c2=['removeListener','length','mailQueue:','save','remove','update','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x39c2,0xc7));var _0x239c=function(_0x2240a5,_0x4db631){_0x2240a5=_0x2240a5-0x0;var _0x5d08c7=_0x39c2[_0x2240a5];return _0x5d08c7;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x239c('0x0'),_0x239c('0x1'),_0x239c('0x2')];function createListener(_0x4d578c,_0x1eb578){return function(_0x2e7493){_0x1eb578[_0x239c('0x3')](_0x4d578c,_0x2e7493);};}function removeListener(_0x384faa,_0x1e512b){return function(){MailQueueEvents[_0x239c('0x4')](_0x384faa,_0x1e512b);};}exports['register']=function(_0x2f02a4){for(var _0x1e5386=0x0,_0x213105=events[_0x239c('0x5')];_0x1e5386<_0x213105;_0x1e5386++){var _0x40a20a=events[_0x1e5386];var _0x6ca484=createListener(_0x239c('0x6')+_0x40a20a,_0x2f02a4);MailQueueEvents['on'](_0x40a20a,_0x6ca484);}}; \ No newline at end of file +var _0x7044=['register','length','mailQueue:','./mailQueue.events','remove','update','emit'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x7044,0xf8));var _0x4704=function(_0x44d9cc,_0x3d912c){_0x44d9cc=_0x44d9cc-0x0;var _0x15b090=_0x7044[_0x44d9cc];return _0x15b090;};'use strict';var MailQueueEvents=require(_0x4704('0x0'));var events=['save',_0x4704('0x1'),_0x4704('0x2')];function createListener(_0x1ef121,_0x57ae20){return function(_0x3289e1){_0x57ae20[_0x4704('0x3')](_0x1ef121,_0x3289e1);};}function removeListener(_0xcc0585,_0x7eba9f){return function(){MailQueueEvents['removeListener'](_0xcc0585,_0x7eba9f);};}exports[_0x4704('0x4')]=function(_0x1e979){for(var _0x2ff7fd=0x0,_0x5a787d=events[_0x4704('0x5')];_0x2ff7fd<_0x5a787d;_0x2ff7fd++){var _0x100268=events[_0x2ff7fd];var _0x28115f=createListener(_0x4704('0x6')+_0x100268,_0x1e979);MailQueueEvents['on'](_0x100268,_0x28115f);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 5c05135..0c09029 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 _0x35ab=['index','/describe','describe','get','/:id','post','create','put','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x383220,_0x1bff48){var _0x371bed=function(_0x3b74ff){while(--_0x3b74ff){_0x383220['push'](_0x383220['shift']());}};_0x371bed(++_0x1bff48);}(_0x35ab,0x173));var _0xb35a=function(_0x519bfa,_0x52dd02){_0x519bfa=_0x519bfa-0x0;var _0x136a25=_0x35ab[_0x519bfa];return _0x136a25;};'use strict';var multer=require(_0xb35a('0x0'));var util=require(_0xb35a('0x1'));var path=require('path');var timeout=require(_0xb35a('0x2'));var express=require(_0xb35a('0x3'));var router=express[_0xb35a('0x4')]();var auth=require(_0xb35a('0x5'));var interaction=require(_0xb35a('0x6'));var config=require(_0xb35a('0x7'));var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0xb35a('0x8')](),controller[_0xb35a('0x9')]);router['get'](_0xb35a('0xa'),auth[_0xb35a('0x8')](),controller[_0xb35a('0xb')]);router[_0xb35a('0xc')](_0xb35a('0xd'),auth[_0xb35a('0x8')](),controller['show']);router[_0xb35a('0xe')]('/',auth[_0xb35a('0x8')](),controller[_0xb35a('0xf')]);router[_0xb35a('0x10')](_0xb35a('0xd'),auth[_0xb35a('0x8')](),controller[_0xb35a('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb35a('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb33d=['get','isAuthenticated','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xb33d,0x173));var _0xdb33=function(_0x225a75,_0x43c1de){_0x225a75=_0x225a75-0x0;var _0xee995d=_0xb33d[_0x225a75];return _0xee995d;};'use strict';var multer=require(_0xdb33('0x0'));var util=require(_0xdb33('0x1'));var path=require('path');var timeout=require(_0xdb33('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xdb33('0x3'));var interaction=require(_0xdb33('0x4'));var config=require(_0xdb33('0x5'));var controller=require(_0xdb33('0x6'));router[_0xdb33('0x7')]('/',auth[_0xdb33('0x8')](),controller['index']);router[_0xdb33('0x7')](_0xdb33('0x9'),auth[_0xdb33('0x8')](),controller[_0xdb33('0xa')]);router[_0xdb33('0x7')](_0xdb33('0xb'),auth[_0xdb33('0x8')](),controller[_0xdb33('0xc')]);router['post']('/',auth[_0xdb33('0x8')](),controller[_0xdb33('0xd')]);router[_0xdb33('0xe')]('/:id',auth[_0xdb33('0x8')](),controller['update']);router[_0xdb33('0xf')](_0xdb33('0xb'),auth[_0xdb33('0x8')](),controller[_0xdb33('0x10')]);module[_0xdb33('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index a731fa4..058546f 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 _0xf5f3=['moment','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5f3,0x11a));var _0x3f5f=function(_0x2da2ff,_0x531765){_0x2da2ff=_0x2da2ff-0x0;var _0x1f8b7f=_0xf5f3[_0x2da2ff];return _0x1f8b7f;};'use strict';var moment=require(_0x3f5f('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x3f5f('0x1')]},'joinAt':{'type':Sequelize[_0x3f5f('0x2')]},'leaveAt':{'type':Sequelize[_0x3f5f('0x2')]},'acceptAt':{'type':Sequelize[_0x3f5f('0x2')]},'exitAt':{'type':Sequelize[_0x3f5f('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe3ca=['exports','STRING','DATE','moment','sequelize'];(function(_0x5b946c,_0x597757){var _0x42cdf3=function(_0x7bc710){while(--_0x7bc710){_0x5b946c['push'](_0x5b946c['shift']());}};_0x42cdf3(++_0x597757);}(_0xe3ca,0x1ed));var _0xae3c=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xe3ca[_0x173441];return _0x2423a8;};'use strict';var moment=require(_0xae3c('0x0'));var Sequelize=require(_0xae3c('0x1'));module[_0xae3c('0x2')]={'uniqueid':{'type':Sequelize[_0xae3c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xae3c('0x3')]},'joinAt':{'type':Sequelize[_0xae3c('0x4')]},'leaveAt':{'type':Sequelize[_0xae3c('0x4')]},'acceptAt':{'type':Sequelize[_0xae3c('0x4')]},'exitAt':{'type':Sequelize[_0xae3c('0x4')]},'reason':{'type':Sequelize[_0xae3c('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 4604f5f..247ecfc 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 _0xd0c5=['create','body','catch','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','reject','save','update','then','error','stack','name','index','MailQueueReport','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','count','findAll','rows','show','include','find'];(function(_0x1510c5,_0xde9022){var _0x433a86=function(_0x114896){while(--_0x114896){_0x1510c5['push'](_0x1510c5['shift']());}};_0x433a86(++_0xde9022);}(_0xd0c5,0x19d));var _0x5d0c=function(_0x23a0af,_0x571e3a){_0x23a0af=_0x23a0af-0x0;var _0x34e8be=_0xd0c5[_0x23a0af];return _0x34e8be;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5d0c('0x0'));var rimraf=require(_0x5d0c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5d0c('0x2'));var rp=require(_0x5d0c('0x3'));var moment=require(_0x5d0c('0x4'));var BPromise=require(_0x5d0c('0x5'));var Mustache=require('mustache');var util=require(_0x5d0c('0x6'));var path=require(_0x5d0c('0x7'));var sox=require(_0x5d0c('0x8'));var csv=require(_0x5d0c('0x9'));var ejs=require(_0x5d0c('0xa'));var fs=require('fs');var _=require(_0x5d0c('0xb'));var squel=require('squel');var crypto=require(_0x5d0c('0xc'));var jsforce=require(_0x5d0c('0xd'));var deskjs=require(_0x5d0c('0xe'));var toCsv=require(_0x5d0c('0x9'));var querystring=require(_0x5d0c('0xf'));var Papa=require(_0x5d0c('0x10'));var Redis=require(_0x5d0c('0x11'));var authService=require(_0x5d0c('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5d0c('0x13'));var logger=require(_0x5d0c('0x14'))(_0x5d0c('0x15'));var utils=require(_0x5d0c('0x16'));var config=require(_0x5d0c('0x17'));var db=require(_0x5d0c('0x18'))['db'];function respondWithStatusCode(_0x485b69,_0x5091d6){_0x5091d6=_0x5091d6||0xcc;return function(_0x3c5459){if(_0x3c5459){return _0x485b69[_0x5d0c('0x19')](_0x5091d6);}return _0x485b69['status'](_0x5091d6)[_0x5d0c('0x1a')]();};}function respondWithResult(_0x27c595,_0x2d1c77){_0x2d1c77=_0x2d1c77||0xc8;return function(_0x1beae3){if(_0x1beae3){return _0x27c595[_0x5d0c('0x1b')](_0x2d1c77)[_0x5d0c('0x1c')](_0x1beae3);}};}function respondWithFilteredResult(_0x52e88b,_0x298f92){return function(_0x3de4e4){if(_0x3de4e4){var _0x5a6364=_0x3de4e4['count'],_0xaaf45=_0x298f92[_0x5d0c('0x1d')],_0x375952=_0x298f92[_0x5d0c('0x1d')]+_0x298f92[_0x5d0c('0x1e')],_0x30c364;if(_0x375952>=_0x5a6364){_0x375952=_0x5a6364;_0x30c364=0xc8;}else{_0x30c364=0xce;}_0x52e88b[_0x5d0c('0x1b')](_0x30c364);return _0x52e88b['set']('Content-Range',_0xaaf45+'-'+_0x375952+'/'+_0x5a6364)['json'](_0x3de4e4);}return null;};}function patchUpdates(_0x30ec32){return function(_0x248a35){try{jsonpatch['apply'](_0x248a35,_0x30ec32,!![]);}catch(_0x5179dd){return BPromise[_0x5d0c('0x1f')](_0x5179dd);}return _0x248a35[_0x5d0c('0x20')]();};}function saveUpdates(_0x4d6bae,_0x414cd6){return function(_0x1d97aa){if(_0x1d97aa){return _0x1d97aa[_0x5d0c('0x21')](_0x4d6bae)[_0x5d0c('0x22')](function(_0x190122){return _0x190122;});}return null;};}function removeEntity(_0x16ecad,_0x4680ae){return function(_0x111fc1){if(_0x111fc1){return _0x111fc1['destroy']()[_0x5d0c('0x22')](function(){_0x16ecad['status'](0xcc)[_0x5d0c('0x1a')]();});}};}function handleEntityNotFound(_0xb3eb86,_0x298139){return function(_0x2d1af7){if(!_0x2d1af7){_0xb3eb86['sendStatus'](0x194);}return _0x2d1af7;};}function handleError(_0x596ce7,_0x512568){_0x512568=_0x512568||0x1f4;return function(_0x75e320){logger[_0x5d0c('0x23')](_0x75e320[_0x5d0c('0x24')]);if(_0x75e320[_0x5d0c('0x25')]){delete _0x75e320[_0x5d0c('0x25')];}_0x596ce7[_0x5d0c('0x1b')](_0x512568)['send'](_0x75e320);};}exports[_0x5d0c('0x26')]=function(_0x2397a9,_0x30ca47){var _0x21d264={},_0x3dba11={},_0x5396c3={'count':0x0,'rows':[]};var _0x47c58b=db[_0x5d0c('0x27')][_0x5d0c('0x28')];_0x3dba11[_0x5d0c('0x29')]=_['keys'](_0x47c58b);_0x3dba11[_0x5d0c('0x2a')]=_[_0x5d0c('0x2b')](_0x2397a9[_0x5d0c('0x2a')]);_0x3dba11[_0x5d0c('0x2c')]=_['intersection'](_0x3dba11[_0x5d0c('0x29')],_0x3dba11[_0x5d0c('0x2a')]);_0x21d264[_0x5d0c('0x2d')]=_[_0x5d0c('0x2e')](_0x3dba11[_0x5d0c('0x29')],qs[_0x5d0c('0x2f')](_0x2397a9['query'][_0x5d0c('0x2f')]));_0x21d264[_0x5d0c('0x2d')]=_0x21d264[_0x5d0c('0x2d')][_0x5d0c('0x30')]?_0x21d264[_0x5d0c('0x2d')]:_0x3dba11[_0x5d0c('0x29')];if(!_0x2397a9[_0x5d0c('0x2a')][_0x5d0c('0x31')](_0x5d0c('0x32'))){_0x21d264[_0x5d0c('0x1e')]=qs['limit'](_0x2397a9['query'][_0x5d0c('0x1e')]);_0x21d264[_0x5d0c('0x1d')]=qs[_0x5d0c('0x1d')](_0x2397a9[_0x5d0c('0x2a')][_0x5d0c('0x1d')]);}_0x21d264['order']=qs['sort'](_0x2397a9[_0x5d0c('0x2a')][_0x5d0c('0x33')]);_0x21d264[_0x5d0c('0x34')]=qs[_0x5d0c('0x2c')](_['pick'](_0x2397a9['query'],_0x3dba11['filters']));if(_0x2397a9['query']['filter']){_0x21d264[_0x5d0c('0x34')]=_[_0x5d0c('0x35')](_0x21d264['where'],{'$or':_['map'](_0x47c58b,function(_0x38de6d){if(_0x38de6d['type']['key']!==_0x5d0c('0x36')){var _0x4b5da5={};_0x4b5da5[_0x38de6d['field']]={'$like':'%'+_0x2397a9[_0x5d0c('0x2a')][_0x5d0c('0x37')]+'%'};return _0x4b5da5;}})});}_0x21d264=_[_0x5d0c('0x35')]({},_0x21d264,_0x2397a9[_0x5d0c('0x38')]);var _0x1d840c={'where':_0x21d264[_0x5d0c('0x34')]};return db[_0x5d0c('0x27')][_0x5d0c('0x39')](_0x1d840c)[_0x5d0c('0x22')](function(_0x5b77ab){_0x5396c3[_0x5d0c('0x39')]=_0x5b77ab;if(_0x2397a9[_0x5d0c('0x2a')]['includeAll']){_0x21d264['include']=[{'all':!![]}];}return db['MailQueueReport'][_0x5d0c('0x3a')](_0x21d264);})[_0x5d0c('0x22')](function(_0x3ca2a3){_0x5396c3[_0x5d0c('0x3b')]=_0x3ca2a3;return _0x5396c3;})[_0x5d0c('0x22')](respondWithFilteredResult(_0x30ca47,_0x21d264))['catch'](handleError(_0x30ca47,null));};exports[_0x5d0c('0x3c')]=function(_0x4002d9,_0x7e899c){var _0x319a1c={'raw':!![],'where':{'id':_0x4002d9['params']['id']}},_0x486ee7={};_0x486ee7[_0x5d0c('0x29')]=_[_0x5d0c('0x2b')](db['MailQueueReport'][_0x5d0c('0x28')]);_0x486ee7[_0x5d0c('0x2a')]=_[_0x5d0c('0x2b')](_0x4002d9[_0x5d0c('0x2a')]);_0x486ee7['filters']=_[_0x5d0c('0x2e')](_0x486ee7[_0x5d0c('0x29')],_0x486ee7[_0x5d0c('0x2a')]);_0x319a1c[_0x5d0c('0x2d')]=_['intersection'](_0x486ee7[_0x5d0c('0x29')],qs[_0x5d0c('0x2f')](_0x4002d9[_0x5d0c('0x2a')][_0x5d0c('0x2f')]));_0x319a1c[_0x5d0c('0x2d')]=_0x319a1c['attributes'][_0x5d0c('0x30')]?_0x319a1c[_0x5d0c('0x2d')]:_0x486ee7[_0x5d0c('0x29')];if(_0x4002d9[_0x5d0c('0x2a')]['includeAll']){_0x319a1c[_0x5d0c('0x3d')]=[{'all':!![]}];}_0x319a1c=_[_0x5d0c('0x35')]({},_0x319a1c,_0x4002d9[_0x5d0c('0x38')]);return db[_0x5d0c('0x27')][_0x5d0c('0x3e')](_0x319a1c)[_0x5d0c('0x22')](handleEntityNotFound(_0x7e899c,null))['then'](respondWithResult(_0x7e899c,null))['catch'](handleError(_0x7e899c,null));};exports[_0x5d0c('0x3f')]=function(_0x44d63a,_0x5df2ab){return db[_0x5d0c('0x27')][_0x5d0c('0x3f')](_0x44d63a[_0x5d0c('0x40')],{})[_0x5d0c('0x22')](respondWithResult(_0x5df2ab,0xc9))[_0x5d0c('0x41')](handleError(_0x5df2ab,null));};exports[_0x5d0c('0x21')]=function(_0x29ad04,_0x4009f4){if(_0x29ad04[_0x5d0c('0x40')]['id']){delete _0x29ad04[_0x5d0c('0x40')]['id'];}return db['MailQueueReport'][_0x5d0c('0x3e')]({'where':{'id':_0x29ad04[_0x5d0c('0x42')]['id']}})['then'](handleEntityNotFound(_0x4009f4,null))[_0x5d0c('0x22')](saveUpdates(_0x29ad04[_0x5d0c('0x40')],null))['then'](respondWithResult(_0x4009f4,null))['catch'](handleError(_0x4009f4,null));};exports['destroy']=function(_0x5d058b,_0x39cd90){return db[_0x5d0c('0x27')]['find']({'where':{'id':_0x5d058b[_0x5d0c('0x42')]['id']}})['then'](handleEntityNotFound(_0x39cd90,null))[_0x5d0c('0x22')](removeEntity(_0x39cd90,null))['catch'](handleError(_0x39cd90,null));};exports[_0x5d0c('0x43')]=function(_0xad223c,_0x28c1d7){return db['MailQueueReport']['describe']()[_0x5d0c('0x22')](respondWithResult(_0x28c1d7,null))['catch'](handleError(_0x28c1d7,null));}; \ No newline at end of file +var _0x1dc6=['send','index','rawAttributes','model','keys','query','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','key','VIRTUAL','field','filter','MailQueueReport','count','include','findAll','catch','show','params','intersection','fields','options','find','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0x45afc1,_0x52a029){var _0x182539=function(_0x547e72){while(--_0x547e72){_0x45afc1['push'](_0x45afc1['shift']());}};_0x182539(++_0x52a029);}(_0x1dc6,0xac));var _0x61dc=function(_0x17ff24,_0x2d02d0){_0x17ff24=_0x17ff24-0x0;var _0x56b374=_0x1dc6[_0x17ff24];return _0x56b374;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x61dc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x61dc('0x1'));var jsonpatch=require(_0x61dc('0x2'));var rp=require('request-promise');var moment=require(_0x61dc('0x3'));var BPromise=require(_0x61dc('0x4'));var Mustache=require(_0x61dc('0x5'));var util=require('util');var path=require('path');var sox=require(_0x61dc('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x61dc('0x7'));var squel=require(_0x61dc('0x8'));var crypto=require('crypto');var jsforce=require(_0x61dc('0x9'));var deskjs=require(_0x61dc('0xa'));var toCsv=require(_0x61dc('0xb'));var querystring=require(_0x61dc('0xc'));var Papa=require(_0x61dc('0xd'));var Redis=require(_0x61dc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x61dc('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x61dc('0x10'))(_0x61dc('0x11'));var utils=require(_0x61dc('0x12'));var config=require('../../config/environment');var db=require(_0x61dc('0x13'))['db'];function respondWithStatusCode(_0x58b507,_0x9ba48d){_0x9ba48d=_0x9ba48d||0xcc;return function(_0x4e36ac){if(_0x4e36ac){return _0x58b507[_0x61dc('0x14')](_0x9ba48d);}return _0x58b507[_0x61dc('0x15')](_0x9ba48d)[_0x61dc('0x16')]();};}function respondWithResult(_0x560762,_0x5c22ce){_0x5c22ce=_0x5c22ce||0xc8;return function(_0x1aed7e){if(_0x1aed7e){return _0x560762[_0x61dc('0x15')](_0x5c22ce)[_0x61dc('0x17')](_0x1aed7e);}};}function respondWithFilteredResult(_0xd7b376,_0x2971c8){return function(_0x4af79b){if(_0x4af79b){var _0x3416fc=_0x4af79b['count'],_0x529231=_0x2971c8[_0x61dc('0x18')],_0x184ab8=_0x2971c8['offset']+_0x2971c8[_0x61dc('0x19')],_0x4c3c31;if(_0x184ab8>=_0x3416fc){_0x184ab8=_0x3416fc;_0x4c3c31=0xc8;}else{_0x4c3c31=0xce;}_0xd7b376['status'](_0x4c3c31);return _0xd7b376['set'](_0x61dc('0x1a'),_0x529231+'-'+_0x184ab8+'/'+_0x3416fc)[_0x61dc('0x17')](_0x4af79b);}return null;};}function patchUpdates(_0x4363dc){return function(_0x5a7f23){try{jsonpatch[_0x61dc('0x1b')](_0x5a7f23,_0x4363dc,!![]);}catch(_0x18bae5){return BPromise[_0x61dc('0x1c')](_0x18bae5);}return _0x5a7f23[_0x61dc('0x1d')]();};}function saveUpdates(_0x1542fd,_0x42de1e){return function(_0x3e1176){if(_0x3e1176){return _0x3e1176[_0x61dc('0x1e')](_0x1542fd)[_0x61dc('0x1f')](function(_0x47862c){return _0x47862c;});}return null;};}function removeEntity(_0x191943,_0x18c8e1){return function(_0x2b2dca){if(_0x2b2dca){return _0x2b2dca[_0x61dc('0x20')]()[_0x61dc('0x1f')](function(){_0x191943[_0x61dc('0x15')](0xcc)[_0x61dc('0x16')]();});}};}function handleEntityNotFound(_0x310c05,_0x21e4e9){return function(_0x19336f){if(!_0x19336f){_0x310c05[_0x61dc('0x14')](0x194);}return _0x19336f;};}function handleError(_0x5bb56a,_0x319987){_0x319987=_0x319987||0x1f4;return function(_0x112f05){logger[_0x61dc('0x21')](_0x112f05[_0x61dc('0x22')]);if(_0x112f05['name']){delete _0x112f05['name'];}_0x5bb56a[_0x61dc('0x15')](_0x319987)[_0x61dc('0x23')](_0x112f05);};}exports[_0x61dc('0x24')]=function(_0x51444e,_0x170ee4){var _0x53ca86={},_0x10d41e={},_0x205d81={'count':0x0,'rows':[]};var _0x1fd90e=db['MailQueueReport'][_0x61dc('0x25')];_0x10d41e[_0x61dc('0x26')]=_[_0x61dc('0x27')](_0x1fd90e);_0x10d41e[_0x61dc('0x28')]=_[_0x61dc('0x27')](_0x51444e[_0x61dc('0x28')]);_0x10d41e[_0x61dc('0x29')]=_['intersection'](_0x10d41e[_0x61dc('0x26')],_0x10d41e[_0x61dc('0x28')]);_0x53ca86[_0x61dc('0x2a')]=_['intersection'](_0x10d41e['model'],qs['fields'](_0x51444e[_0x61dc('0x28')]['fields']));_0x53ca86[_0x61dc('0x2a')]=_0x53ca86[_0x61dc('0x2a')][_0x61dc('0x2b')]?_0x53ca86[_0x61dc('0x2a')]:_0x10d41e['model'];if(!_0x51444e[_0x61dc('0x28')][_0x61dc('0x2c')](_0x61dc('0x2d'))){_0x53ca86[_0x61dc('0x19')]=qs[_0x61dc('0x19')](_0x51444e[_0x61dc('0x28')][_0x61dc('0x19')]);_0x53ca86[_0x61dc('0x18')]=qs[_0x61dc('0x18')](_0x51444e[_0x61dc('0x28')]['offset']);}_0x53ca86[_0x61dc('0x2e')]=qs[_0x61dc('0x2f')](_0x51444e[_0x61dc('0x28')]['sort']);_0x53ca86[_0x61dc('0x30')]=qs[_0x61dc('0x29')](_[_0x61dc('0x31')](_0x51444e['query'],_0x10d41e['filters']));if(_0x51444e[_0x61dc('0x28')]['filter']){_0x53ca86[_0x61dc('0x30')]=_[_0x61dc('0x32')](_0x53ca86['where'],{'$or':_[_0x61dc('0x33')](_0x1fd90e,function(_0x2efa4d){if(_0x2efa4d['type'][_0x61dc('0x34')]!==_0x61dc('0x35')){var _0x3101d6={};_0x3101d6[_0x2efa4d[_0x61dc('0x36')]]={'$like':'%'+_0x51444e[_0x61dc('0x28')][_0x61dc('0x37')]+'%'};return _0x3101d6;}})});}_0x53ca86=_[_0x61dc('0x32')]({},_0x53ca86,_0x51444e['options']);var _0x436f11={'where':_0x53ca86[_0x61dc('0x30')]};return db[_0x61dc('0x38')][_0x61dc('0x39')](_0x436f11)[_0x61dc('0x1f')](function(_0x32bf33){_0x205d81[_0x61dc('0x39')]=_0x32bf33;if(_0x51444e[_0x61dc('0x28')]['includeAll']){_0x53ca86[_0x61dc('0x3a')]=[{'all':!![]}];}return db[_0x61dc('0x38')][_0x61dc('0x3b')](_0x53ca86);})[_0x61dc('0x1f')](function(_0x1ec940){_0x205d81['rows']=_0x1ec940;return _0x205d81;})[_0x61dc('0x1f')](respondWithFilteredResult(_0x170ee4,_0x53ca86))[_0x61dc('0x3c')](handleError(_0x170ee4,null));};exports[_0x61dc('0x3d')]=function(_0x39af3d,_0x2c078b){var _0x298540={'raw':!![],'where':{'id':_0x39af3d[_0x61dc('0x3e')]['id']}},_0x22520e={};_0x22520e['model']=_[_0x61dc('0x27')](db['MailQueueReport'][_0x61dc('0x25')]);_0x22520e[_0x61dc('0x28')]=_['keys'](_0x39af3d[_0x61dc('0x28')]);_0x22520e['filters']=_[_0x61dc('0x3f')](_0x22520e[_0x61dc('0x26')],_0x22520e[_0x61dc('0x28')]);_0x298540[_0x61dc('0x2a')]=_[_0x61dc('0x3f')](_0x22520e[_0x61dc('0x26')],qs[_0x61dc('0x40')](_0x39af3d[_0x61dc('0x28')][_0x61dc('0x40')]));_0x298540[_0x61dc('0x2a')]=_0x298540[_0x61dc('0x2a')][_0x61dc('0x2b')]?_0x298540[_0x61dc('0x2a')]:_0x22520e['model'];if(_0x39af3d[_0x61dc('0x28')]['includeAll']){_0x298540['include']=[{'all':!![]}];}_0x298540=_[_0x61dc('0x32')]({},_0x298540,_0x39af3d[_0x61dc('0x41')]);return db[_0x61dc('0x38')][_0x61dc('0x42')](_0x298540)[_0x61dc('0x1f')](handleEntityNotFound(_0x2c078b,null))[_0x61dc('0x1f')](respondWithResult(_0x2c078b,null))['catch'](handleError(_0x2c078b,null));};exports['create']=function(_0x373686,_0x218765){return db[_0x61dc('0x38')]['create'](_0x373686[_0x61dc('0x43')],{})[_0x61dc('0x1f')](respondWithResult(_0x218765,0xc9))[_0x61dc('0x3c')](handleError(_0x218765,null));};exports[_0x61dc('0x1e')]=function(_0x3a5b65,_0x11f9b1){if(_0x3a5b65[_0x61dc('0x43')]['id']){delete _0x3a5b65[_0x61dc('0x43')]['id'];}return db['MailQueueReport'][_0x61dc('0x42')]({'where':{'id':_0x3a5b65['params']['id']}})[_0x61dc('0x1f')](handleEntityNotFound(_0x11f9b1,null))[_0x61dc('0x1f')](saveUpdates(_0x3a5b65[_0x61dc('0x43')],null))[_0x61dc('0x1f')](respondWithResult(_0x11f9b1,null))[_0x61dc('0x3c')](handleError(_0x11f9b1,null));};exports[_0x61dc('0x20')]=function(_0x600bb2,_0x195136){return db[_0x61dc('0x38')]['find']({'where':{'id':_0x600bb2[_0x61dc('0x3e')]['id']}})[_0x61dc('0x1f')](handleEntityNotFound(_0x195136,null))['then'](removeEntity(_0x195136,null))[_0x61dc('0x3c')](handleError(_0x195136,null));};exports[_0x61dc('0x44')]=function(_0x3e34e8,_0x5ec4a6){return db['MailQueueReport'][_0x61dc('0x44')]()['then'](respondWithResult(_0x5ec4a6,null))['catch'](handleError(_0x5ec4a6,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index d1c249c..7d699f0 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 _0xfbdc=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util'];(function(_0x3fd3a3,_0x36c863){var _0xa3e4d5=function(_0x1fd03b){while(--_0x1fd03b){_0x3fd3a3['push'](_0x3fd3a3['shift']());}};_0xa3e4d5(++_0x36c863);}(_0xfbdc,0x1d2));var _0xcfbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfbdc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcfbd('0x0'));var util=require(_0xcfbd('0x1'));var logger=require(_0xcfbd('0x2'))(_0xcfbd('0x3'));var moment=require('moment');var BPromise=require(_0xcfbd('0x4'));var rp=require(_0xcfbd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcfbd('0x6'));var config=require(_0xcfbd('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0xcfbd('0x8')]=function(_0x190121,_0x433b3c){return _0x190121[_0xcfbd('0x9')](_0xcfbd('0xa'),attributes,{'tableName':_0xcfbd('0xb'),'paranoid':![],'indexes':[{'name':_0xcfbd('0xc'),'fields':[_0xcfbd('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf73a=['exports','define','MailQueueReport','uniqueid','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes'];(function(_0x3d581b,_0x1a941e){var _0x1d73d0=function(_0x4b9056){while(--_0x4b9056){_0x3d581b['push'](_0x3d581b['shift']());}};_0x1d73d0(++_0x1a941e);}(_0xf73a,0x115));var _0xaf73=function(_0x1239bc,_0x459460){_0x1239bc=_0x1239bc-0x0;var _0x1a77bb=_0xf73a[_0x1239bc];return _0x1a77bb;};'use strict';var _=require(_0xaf73('0x0'));var util=require(_0xaf73('0x1'));var logger=require('../../config/logger')(_0xaf73('0x2'));var moment=require('moment');var BPromise=require(_0xaf73('0x3'));var rp=require(_0xaf73('0x4'));var fs=require('fs');var path=require(_0xaf73('0x5'));var rimraf=require(_0xaf73('0x6'));var config=require(_0xaf73('0x7'));var attributes=require(_0xaf73('0x8'));module[_0xaf73('0x9')]=function(_0x9aac6f,_0x8b99c3){return _0x9aac6f[_0xaf73('0xa')](_0xaf73('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xaf73('0xc'),'fields':[_0xaf73('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index eade0e3..ee6f56c 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 _0x33af=['raw','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','body','options'];(function(_0x3b1d01,_0x559660){var _0x503a56=function(_0xae1b21){while(--_0xae1b21){_0x3b1d01['push'](_0x3b1d01['shift']());}};_0x503a56(++_0x559660);}(_0x33af,0xec));var _0xf33a=function(_0x1bb11e,_0x58fd78){_0x1bb11e=_0x1bb11e-0x0;var _0x422492=_0x33af[_0x1bb11e];return _0x422492;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var moment=require('moment');var BPromise=require(_0xf33a('0x1'));var rs=require(_0xf33a('0x2'));var fs=require('fs');var Redis=require(_0xf33a('0x3'));var db=require(_0xf33a('0x4'))['db'];var utils=require(_0xf33a('0x5'));var logger=require(_0xf33a('0x6'))('rpc');var config=require(_0xf33a('0x7'));var jayson=require(_0xf33a('0x8'));var client=jayson['client'][_0xf33a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x384b14,_0x1b2b01,_0x2f3730){return new BPromise(function(_0x2baabb,_0x2cb169){return client['request'](_0x384b14,_0x2f3730)[_0xf33a('0xa')](function(_0x14eb0e){logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,_0xf33a('0xd'));logger[_0xf33a('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x1b2b01,'request\x20sent',JSON[_0xf33a('0xf')](_0x14eb0e));if(_0x14eb0e[_0xf33a('0x10')]){if(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x11')]===0x1f4){logger[_0xf33a('0x10')]('MailQueueReport,\x20%s,\x20%s',_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2cb169(_0x14eb0e['error']['message']);}logger[_0xf33a('0x10')](_0xf33a('0xc'),_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2baabb(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);}else{logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,'request\x20sent');_0x2baabb(_0x14eb0e[_0xf33a('0x13')]['message']);}})[_0xf33a('0x14')](function(_0x229389){logger['error'](_0xf33a('0xc'),_0x1b2b01,_0x229389);_0x2cb169(_0x229389);});});}exports[_0xf33a('0x15')]=function(_0x524109){var _0x2946ef=this;return new Promise(function(_0x23d9e2,_0x38d69a){return db[_0xf33a('0x16')]['create'](_0x524109[_0xf33a('0x17')],{'raw':_0x524109[_0xf33a('0x18')]?_0x524109[_0xf33a('0x18')][_0xf33a('0x19')]===undefined?!![]:![]:!![]})[_0xf33a('0xa')](function(_0x6cdf7b){logger[_0xf33a('0xb')](_0xf33a('0x15'),_0x524109);logger[_0xf33a('0xe')](_0xf33a('0x15'),_0x524109,JSON['stringify'](_0x6cdf7b));_0x23d9e2(_0x6cdf7b);})[_0xf33a('0x14')](function(_0x272e60){logger[_0xf33a('0x10')](_0xf33a('0x15'),_0x272e60[_0xf33a('0x12')],_0x524109);_0x38d69a(_0x2946ef['error'](0x1f4,_0x272e60[_0xf33a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x492986){var _0x3f9ef7=this;return new Promise(function(_0x394468,_0x17b12d){return db[_0xf33a('0x16')]['update'](_0x492986[_0xf33a('0x17')],{'raw':_0x492986[_0xf33a('0x18')]?_0x492986['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x492986[_0xf33a('0x18')]?_0x492986['options']['where']||null:null,'attributes':_0x492986[_0xf33a('0x18')]?_0x492986['options'][_0xf33a('0x1a')]||null:null,'limit':_0x492986['options']?_0x492986[_0xf33a('0x18')][_0xf33a('0x1b')]||null:null})[_0xf33a('0xa')](function(_0x729fca){logger[_0xf33a('0xb')](_0xf33a('0x1c'),_0x492986);logger[_0xf33a('0xe')](_0xf33a('0x1c'),_0x492986,JSON[_0xf33a('0xf')](_0x729fca));_0x394468(_0x729fca);})[_0xf33a('0x14')](function(_0x77b7c1){logger[_0xf33a('0x10')](_0xf33a('0x1c'),_0x77b7c1[_0xf33a('0x12')],_0x492986);_0x17b12d(_0x3f9ef7[_0xf33a('0x10')](0x1f4,_0x77b7c1['message']));});});}; \ No newline at end of file +var _0xafc4=['info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','CreateMailQueueReport','MailQueueReport','body','options','raw','debug','UpdateMailQueueReport','update','attributes','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then'];(function(_0x37612b,_0x7338a8){var _0x1ee7e7=function(_0x2ff0b5){while(--_0x2ff0b5){_0x37612b['push'](_0x37612b['shift']());}};_0x1ee7e7(++_0x7338a8);}(_0xafc4,0x69));var _0x4afc=function(_0x514d0e,_0x5ca180){_0x514d0e=_0x514d0e-0x0;var _0x399703=_0xafc4[_0x514d0e];return _0x399703;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var moment=require(_0x4afc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4afc('0x2'));var fs=require('fs');var Redis=require(_0x4afc('0x3'));var db=require(_0x4afc('0x4'))['db'];var utils=require(_0x4afc('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4afc('0x6'));var client=jayson[_0x4afc('0x7')][_0x4afc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bb281,_0xc828d9,_0xaf053d){return new BPromise(function(_0x5e1e29,_0x31e165){return client[_0x4afc('0x9')](_0x1bb281,_0xaf053d)[_0x4afc('0xa')](function(_0x1e6bf5){logger[_0x4afc('0xb')](_0x4afc('0xc'),_0xc828d9,'request\x20sent');logger['debug'](_0x4afc('0xd'),_0xc828d9,'request\x20sent',JSON[_0x4afc('0xe')](_0x1e6bf5));if(_0x1e6bf5[_0x4afc('0xf')]){if(_0x1e6bf5['error'][_0x4afc('0x10')]===0x1f4){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x31e165(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}logger[_0x4afc('0xf')]('MailQueueReport,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('MailQueueReport,\x20%s,\x20%s',_0xc828d9,_0x4afc('0x12'));_0x5e1e29(_0x1e6bf5['result'][_0x4afc('0x11')]);}})[_0x4afc('0x13')](function(_0x2b928b){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x2b928b);_0x31e165(_0x2b928b);});});}exports[_0x4afc('0x14')]=function(_0x22f809){var _0x3ad418=this;return new Promise(function(_0x16365f,_0x135349){return db[_0x4afc('0x15')]['create'](_0x22f809[_0x4afc('0x16')],{'raw':_0x22f809[_0x4afc('0x17')]?_0x22f809[_0x4afc('0x17')][_0x4afc('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x3bddc0){logger[_0x4afc('0xb')](_0x4afc('0x14'),_0x22f809);logger[_0x4afc('0x19')](_0x4afc('0x14'),_0x22f809,JSON[_0x4afc('0xe')](_0x3bddc0));_0x16365f(_0x3bddc0);})[_0x4afc('0x13')](function(_0x573a75){logger[_0x4afc('0xf')](_0x4afc('0x14'),_0x573a75['message'],_0x22f809);_0x135349(_0x3ad418[_0x4afc('0xf')](0x1f4,_0x573a75['message']));});});};exports[_0x4afc('0x1a')]=function(_0x2a0314){var _0x1e454e=this;return new Promise(function(_0x2876f2,_0x86dbd4){return db[_0x4afc('0x15')][_0x4afc('0x1b')](_0x2a0314[_0x4afc('0x16')],{'raw':_0x2a0314[_0x4afc('0x17')]?_0x2a0314[_0x4afc('0x17')][_0x4afc('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a0314[_0x4afc('0x17')]?_0x2a0314[_0x4afc('0x17')]['where']||null:null,'attributes':_0x2a0314[_0x4afc('0x17')]?_0x2a0314[_0x4afc('0x17')][_0x4afc('0x1c')]||null:null,'limit':_0x2a0314['options']?_0x2a0314['options']['limit']||null:null})[_0x4afc('0xa')](function(_0x5db47e){logger['info'](_0x4afc('0x1a'),_0x2a0314);logger[_0x4afc('0x19')]('UpdateMailQueueReport',_0x2a0314,JSON['stringify'](_0x5db47e));_0x2876f2(_0x5db47e);})['catch'](function(_0x3bae1a){logger[_0x4afc('0xf')](_0x4afc('0x1a'),_0x3bae1a[_0x4afc('0x11')],_0x2a0314);_0x86dbd4(_0x1e454e[_0x4afc('0xf')](0x1f4,_0x3bae1a[_0x4afc('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 37820fd..8926d6a 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 _0xb730=['express','Router','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0x270e5b,_0xa6c9b3){var _0x1d18fd=function(_0x50c9de){while(--_0x50c9de){_0x270e5b['push'](_0x270e5b['shift']());}};_0x1d18fd(++_0xa6c9b3);}(_0xb730,0x1eb));var _0x0b73=function(_0x4ef15b,_0x32aae2){_0x4ef15b=_0x4ef15b-0x0;var _0x43965b=_0xb730[_0x4ef15b];return _0x43965b;};'use strict';var multer=require(_0x0b73('0x0'));var util=require(_0x0b73('0x1'));var path=require(_0x0b73('0x2'));var timeout=require(_0x0b73('0x3'));var express=require(_0x0b73('0x4'));var router=express[_0x0b73('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x0b73('0x6'));var config=require(_0x0b73('0x7'));module[_0x0b73('0x8')]=router; \ No newline at end of file +var _0x8aa5=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','multer','util'];(function(_0x378220,_0x47065c){var _0x1f7352=function(_0x5c2f72){while(--_0x5c2f72){_0x378220['push'](_0x378220['shift']());}};_0x1f7352(++_0x47065c);}(_0x8aa5,0x1c5));var _0x58aa=function(_0x166bea,_0xebc08){_0x166bea=_0x166bea-0x0;var _0x589313=_0x8aa5[_0x166bea];return _0x589313;};'use strict';var multer=require(_0x58aa('0x0'));var util=require(_0x58aa('0x1'));var path=require('path');var timeout=require(_0x58aa('0x2'));var express=require(_0x58aa('0x3'));var router=express[_0x58aa('0x4')]();var auth=require(_0x58aa('0x5'));var interaction=require(_0x58aa('0x6'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 5265dbd..89e2a21 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 _0x9b43=['INTEGER','INBOX','sequelize','exports','STRING','BOOLEAN','username'];(function(_0x5e846a,_0x503ba5){var _0x282ec6=function(_0x41542e){while(--_0x41542e){_0x5e846a['push'](_0x5e846a['shift']());}};_0x282ec6(++_0x503ba5);}(_0x9b43,0x136));var _0x39b4=function(_0x3062d5,_0x233e56){_0x3062d5=_0x3062d5-0x0;var _0x12be94=_0x9b43[_0x3062d5];return _0x12be94;};'use strict';var Sequelize=require(_0x39b4('0x0'));module[_0x39b4('0x1')]={'description':{'type':Sequelize[_0x39b4('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x39b4('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x39b4('0x2')],'unique':_0x39b4('0x4')},'password':{'type':Sequelize[_0x39b4('0x2')]},'port':{'type':Sequelize[_0x39b4('0x5')]},'tls':{'type':Sequelize[_0x39b4('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x39b4('0x2')],'defaultValue':_0x39b4('0x6')},'connTimeout':{'type':Sequelize[_0x39b4('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x39b4('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x39b4('0x2')]}}; \ No newline at end of file +var _0x305b=['INTEGER','INBOX','sequelize','STRING','BOOLEAN','username'];(function(_0x2d9e27,_0x5965b2){var _0xd35381=function(_0x343d18){while(--_0x343d18){_0x2d9e27['push'](_0x2d9e27['shift']());}};_0xd35381(++_0x5965b2);}(_0x305b,0x1d6));var _0xb305=function(_0x2f87cd,_0xcaf299){_0x2f87cd=_0x2f87cd-0x0;var _0x5d7eda=_0x305b[_0x2f87cd];return _0x5d7eda;};'use strict';var Sequelize=require(_0xb305('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xb305('0x1')]},'authentication':{'type':Sequelize[_0xb305('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xb305('0x1')],'unique':_0xb305('0x3')},'password':{'type':Sequelize[_0xb305('0x1')]},'port':{'type':Sequelize[_0xb305('0x4')]},'tls':{'type':Sequelize[_0xb305('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xb305('0x1')],'defaultValue':_0xb305('0x5')},'connTimeout':{'type':Sequelize[_0xb305('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index de89c17..84e5037 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 _0x337f=['rimraf','../../config/environment','exports','MailServerIn','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x24a972,_0x5079b5){var _0x2d4871=function(_0xa273b2){while(--_0xa273b2){_0x24a972['push'](_0x24a972['shift']());}};_0x2d4871(++_0x5079b5);}(_0x337f,0x11c));var _0xf337=function(_0x4d6380,_0x4fabc7){_0x4d6380=_0x4d6380-0x0;var _0x14d7de=_0x337f[_0x4d6380];return _0x14d7de;};'use strict';var _=require(_0xf337('0x0'));var util=require(_0xf337('0x1'));var logger=require(_0xf337('0x2'))('api');var moment=require(_0xf337('0x3'));var BPromise=require(_0xf337('0x4'));var rp=require(_0xf337('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf337('0x6'));var config=require(_0xf337('0x7'));var attributes=require('./mailServerIn.attributes');module[_0xf337('0x8')]=function(_0x485b2a,_0x4580a3){return _0x485b2a['define'](_0xf337('0x9'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x19e1=['define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./mailServerIn.attributes'];(function(_0x34a791,_0x4ea4dd){var _0xa550ee=function(_0x44d64d){while(--_0x44d64d){_0x34a791['push'](_0x34a791['shift']());}};_0xa550ee(++_0x4ea4dd);}(_0x19e1,0x163));var _0x119e=function(_0x4704dc,_0x575a5f){_0x4704dc=_0x4704dc-0x0;var _0x254d81=_0x19e1[_0x4704dc];return _0x254d81;};'use strict';var _=require(_0x119e('0x0'));var util=require(_0x119e('0x1'));var logger=require(_0x119e('0x2'))(_0x119e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x119e('0x4'));var fs=require('fs');var path=require(_0x119e('0x5'));var rimraf=require('rimraf');var config=require(_0x119e('0x6'));var attributes=require(_0x119e('0x7'));module['exports']=function(_0x2ce0a3,_0x5a6b88){return _0x2ce0a3[_0x119e('0x8')](_0x119e('0x9'),attributes,{'tableName':_0x119e('0xa'),'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 32c63e7..6e7b898 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 _0xa239=['../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailServerIn','raw','options','attributes','limit','include','map','model','GetMailServerIn','lodash','util','moment','bluebird','randomstring'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xa239,0x19b));var _0x9a23=function(_0x19e7e4,_0x5e01ce){_0x19e7e4=_0x19e7e4-0x0;var _0xcb9af8=_0xa239[_0x19e7e4];return _0xcb9af8;};'use strict';var _=require(_0x9a23('0x0'));var util=require(_0x9a23('0x1'));var moment=require(_0x9a23('0x2'));var BPromise=require(_0x9a23('0x3'));var rs=require(_0x9a23('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a23('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9a23('0x6'));var config=require(_0x9a23('0x7'));var jayson=require(_0x9a23('0x8'));var client=jayson['client'][_0x9a23('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d68fa,_0x1ab801,_0x3ad5b3){return new BPromise(function(_0x3143e9,_0x42499c){return client[_0x9a23('0xa')](_0x1d68fa,_0x3ad5b3)[_0x9a23('0xb')](function(_0x2c7b07){logger[_0x9a23('0xc')](_0x9a23('0xd'),_0x1ab801,_0x9a23('0xe'));logger[_0x9a23('0xf')](_0x9a23('0x10'),_0x1ab801,_0x9a23('0xe'),JSON[_0x9a23('0x11')](_0x2c7b07));if(_0x2c7b07[_0x9a23('0x12')]){if(_0x2c7b07['error'][_0x9a23('0x13')]===0x1f4){logger[_0x9a23('0x12')]('MailServerIn,\x20%s,\x20%s',_0x1ab801,_0x2c7b07[_0x9a23('0x12')][_0x9a23('0x14')]);return _0x42499c(_0x2c7b07['error'][_0x9a23('0x14')]);}logger['error'](_0x9a23('0xd'),_0x1ab801,_0x2c7b07[_0x9a23('0x12')][_0x9a23('0x14')]);return _0x3143e9(_0x2c7b07[_0x9a23('0x12')][_0x9a23('0x14')]);}else{logger[_0x9a23('0xc')]('MailServerIn,\x20%s,\x20%s',_0x1ab801,_0x9a23('0xe'));_0x3143e9(_0x2c7b07[_0x9a23('0x15')][_0x9a23('0x14')]);}})[_0x9a23('0x16')](function(_0x20de8b){logger[_0x9a23('0x12')]('MailServerIn,\x20%s,\x20%s',_0x1ab801,_0x20de8b);_0x42499c(_0x20de8b);});});}exports['GetMailServerIn']=function(_0xc79615){var _0x5a71ce=this;return new Promise(function(_0x4db44b,_0x5ac15d){return db[_0x9a23('0x17')]['findAll']({'raw':_0xc79615['options']?_0xc79615['options'][_0x9a23('0x18')]===undefined?!![]:![]:!![],'where':_0xc79615[_0x9a23('0x19')]?_0xc79615['options']['where']||null:null,'attributes':_0xc79615[_0x9a23('0x19')]?_0xc79615[_0x9a23('0x19')][_0x9a23('0x1a')]||null:null,'limit':_0xc79615['options']?_0xc79615['options'][_0x9a23('0x1b')]||null:null,'include':_0xc79615[_0x9a23('0x19')]?_0xc79615['options'][_0x9a23('0x1c')]?_[_0x9a23('0x1d')](_0xc79615[_0x9a23('0x19')]['include'],function(_0x577c5e){return{'model':db[_0x577c5e[_0x9a23('0x1e')]],'as':_0x577c5e['as'],'attributes':_0x577c5e['attributes'],'include':_0x577c5e[_0x9a23('0x1c')]?_['map'](_0x577c5e[_0x9a23('0x1c')],function(_0x311492){return{'model':db[_0x311492[_0x9a23('0x1e')]],'as':_0x311492['as'],'attributes':_0x311492[_0x9a23('0x1a')],'include':_0x311492[_0x9a23('0x1c')]?_[_0x9a23('0x1d')](_0x311492[_0x9a23('0x1c')],function(_0x140c8a){return{'model':db[_0x140c8a[_0x9a23('0x1e')]],'as':_0x140c8a['as'],'attributes':_0x140c8a[_0x9a23('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9a23('0xb')](function(_0x3c8844){logger[_0x9a23('0xc')](_0x9a23('0x1f'),_0xc79615);logger[_0x9a23('0xf')](_0x9a23('0x1f'),_0xc79615,JSON[_0x9a23('0x11')](_0x3c8844));_0x4db44b(_0x3c8844);})[_0x9a23('0x16')](function(_0x517dc5){logger['error'](_0x9a23('0x1f'),_0x517dc5[_0x9a23('0x14')],_0xc79615);_0x5ac15d(_0x5a71ce[_0x9a23('0x12')](0x1f4,_0x517dc5[_0x9a23('0x14')]));});});}; \ No newline at end of file +var _0x8a62=['message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','map','include','model','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x49bfb8,_0x5b6e2b){var _0x1be0b7=function(_0x3df70f){while(--_0x3df70f){_0x49bfb8['push'](_0x49bfb8['shift']());}};_0x1be0b7(++_0x5b6e2b);}(_0x8a62,0xc1));var _0x28a6=function(_0x1c29c5,_0x25ab85){_0x1c29c5=_0x1c29c5-0x0;var _0x332766=_0x8a62[_0x1c29c5];return _0x332766;};'use strict';var _=require(_0x28a6('0x0'));var util=require(_0x28a6('0x1'));var moment=require(_0x28a6('0x2'));var BPromise=require(_0x28a6('0x3'));var rs=require(_0x28a6('0x4'));var fs=require('fs');var Redis=require(_0x28a6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x28a6('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x28a6('0x7'));var jayson=require(_0x28a6('0x8'));var client=jayson['client'][_0x28a6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b33a9,_0x51cd7f,_0x81109e){return new BPromise(function(_0xe3c1f3,_0x106f4c){return client[_0x28a6('0xa')](_0x5b33a9,_0x81109e)['then'](function(_0x17a7e8){logger[_0x28a6('0xb')](_0x28a6('0xc'),_0x51cd7f,_0x28a6('0xd'));logger[_0x28a6('0xe')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x51cd7f,_0x28a6('0xd'),JSON[_0x28a6('0xf')](_0x17a7e8));if(_0x17a7e8[_0x28a6('0x10')]){if(_0x17a7e8[_0x28a6('0x10')]['code']===0x1f4){logger['error'](_0x28a6('0xc'),_0x51cd7f,_0x17a7e8[_0x28a6('0x10')]['message']);return _0x106f4c(_0x17a7e8[_0x28a6('0x10')]['message']);}logger[_0x28a6('0x10')](_0x28a6('0xc'),_0x51cd7f,_0x17a7e8[_0x28a6('0x10')][_0x28a6('0x11')]);return _0xe3c1f3(_0x17a7e8[_0x28a6('0x10')]['message']);}else{logger['info']('MailServerIn,\x20%s,\x20%s',_0x51cd7f,_0x28a6('0xd'));_0xe3c1f3(_0x17a7e8[_0x28a6('0x12')]['message']);}})[_0x28a6('0x13')](function(_0x53a41c){logger[_0x28a6('0x10')](_0x28a6('0xc'),_0x51cd7f,_0x53a41c);_0x106f4c(_0x53a41c);});});}exports[_0x28a6('0x14')]=function(_0x4c8f7d){var _0x2ad98a=this;return new Promise(function(_0x1c4ae2,_0x315c1b){return db[_0x28a6('0x15')][_0x28a6('0x16')]({'raw':_0x4c8f7d[_0x28a6('0x17')]?_0x4c8f7d[_0x28a6('0x17')][_0x28a6('0x18')]===undefined?!![]:![]:!![],'where':_0x4c8f7d[_0x28a6('0x17')]?_0x4c8f7d[_0x28a6('0x17')][_0x28a6('0x19')]||null:null,'attributes':_0x4c8f7d[_0x28a6('0x17')]?_0x4c8f7d[_0x28a6('0x17')][_0x28a6('0x1a')]||null:null,'limit':_0x4c8f7d[_0x28a6('0x17')]?_0x4c8f7d[_0x28a6('0x17')]['limit']||null:null,'include':_0x4c8f7d['options']?_0x4c8f7d[_0x28a6('0x17')]['include']?_[_0x28a6('0x1b')](_0x4c8f7d[_0x28a6('0x17')][_0x28a6('0x1c')],function(_0x20242c){return{'model':db[_0x20242c[_0x28a6('0x1d')]],'as':_0x20242c['as'],'attributes':_0x20242c['attributes'],'include':_0x20242c['include']?_[_0x28a6('0x1b')](_0x20242c[_0x28a6('0x1c')],function(_0x14d885){return{'model':db[_0x14d885[_0x28a6('0x1d')]],'as':_0x14d885['as'],'attributes':_0x14d885[_0x28a6('0x1a')],'include':_0x14d885['include']?_['map'](_0x14d885[_0x28a6('0x1c')],function(_0x1f16f8){return{'model':db[_0x1f16f8[_0x28a6('0x1d')]],'as':_0x1f16f8['as'],'attributes':_0x1f16f8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b7823){logger[_0x28a6('0xb')]('GetMailServerIn',_0x4c8f7d);logger[_0x28a6('0xe')]('GetMailServerIn',_0x4c8f7d,JSON['stringify'](_0x2b7823));_0x1c4ae2(_0x2b7823);})[_0x28a6('0x13')](function(_0x2e756b){logger[_0x28a6('0x10')]('GetMailServerIn',_0x2e756b[_0x28a6('0x11')],_0x4c8f7d);_0x315c1b(_0x2ad98a['error'](0x1f4,_0x2e756b['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 8f7f0ef..914359b 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 _0xa8f2=['destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','/:id','show','create','update'];(function(_0x59f16f,_0x5a5d67){var _0x3619e2=function(_0x7c9c85){while(--_0x7c9c85){_0x59f16f['push'](_0x59f16f['shift']());}};_0x3619e2(++_0x5a5d67);}(_0xa8f2,0x192));var _0x2a8f=function(_0x41e7e3,_0x5d6cc6){_0x41e7e3=_0x41e7e3-0x0;var _0xe85b33=_0xa8f2[_0x41e7e3];return _0xe85b33;};'use strict';var multer=require(_0x2a8f('0x0'));var util=require(_0x2a8f('0x1'));var path=require(_0x2a8f('0x2'));var timeout=require(_0x2a8f('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x2a8f('0x4'));var interaction=require(_0x2a8f('0x5'));var config=require(_0x2a8f('0x6'));var controller=require(_0x2a8f('0x7'));router[_0x2a8f('0x8')]('/',auth[_0x2a8f('0x9')](),controller['index']);router[_0x2a8f('0x8')](_0x2a8f('0xa'),auth[_0x2a8f('0x9')](),controller[_0x2a8f('0xb')]);router['post']('/',auth[_0x2a8f('0x9')](),controller[_0x2a8f('0xc')]);router['put'](_0x2a8f('0xa'),auth[_0x2a8f('0x9')](),controller[_0x2a8f('0xd')]);router['delete'](_0x2a8f('0xa'),auth[_0x2a8f('0x9')](),controller[_0x2a8f('0xe')]);module[_0x2a8f('0xf')]=router; \ No newline at end of file +var _0x7da9=['/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','index'];(function(_0x1eb081,_0x2c5f25){var _0x5d6d87=function(_0x5910fc){while(--_0x5910fc){_0x1eb081['push'](_0x1eb081['shift']());}};_0x5d6d87(++_0x2c5f25);}(_0x7da9,0x79));var _0x97da=function(_0x26148e,_0x2cd6e3){_0x26148e=_0x26148e-0x0;var _0x3f0ee9=_0x7da9[_0x26148e];return _0x3f0ee9;};'use strict';var multer=require(_0x97da('0x0'));var util=require(_0x97da('0x1'));var path=require(_0x97da('0x2'));var timeout=require(_0x97da('0x3'));var express=require(_0x97da('0x4'));var router=express[_0x97da('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x97da('0x6'));var config=require(_0x97da('0x7'));var controller=require(_0x97da('0x8'));router[_0x97da('0x9')]('/',auth[_0x97da('0xa')](),controller[_0x97da('0xb')]);router[_0x97da('0x9')](_0x97da('0xc'),auth[_0x97da('0xa')](),controller[_0x97da('0xd')]);router[_0x97da('0xe')]('/',auth[_0x97da('0xa')](),controller['create']);router['put']('/:id',auth[_0x97da('0xa')](),controller[_0x97da('0xf')]);router[_0x97da('0x10')](_0x97da('0xc'),auth[_0x97da('0xa')](),controller[_0x97da('0x11')]);module[_0x97da('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 2a855d5..7b48ecd 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 _0xf7f7=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf7f7,0x192));var _0x7f7f=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xf7f7[_0x1b5aea];return _0x15cfc6;};'use strict';var Sequelize=require(_0x7f7f('0x0'));module[_0x7f7f('0x1')]={'description':{'type':Sequelize[_0x7f7f('0x2')]},'host':{'type':Sequelize[_0x7f7f('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x7f7f('0x3')]},'secure':{'type':Sequelize[_0x7f7f('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x7f7f('0x2')]},'authentication':{'type':Sequelize[_0x7f7f('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2d2c=['exports','STRING','BOOLEAN','sequelize'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0x49cb71,_0x2f0149){_0x49cb71=_0x49cb71-0x0;var _0x3a50fd=_0x2d2c[_0x49cb71];return _0x3a50fd;};'use strict';var Sequelize=require(_0xc2d2('0x0'));module[_0xc2d2('0x1')]={'description':{'type':Sequelize[_0xc2d2('0x2')]},'host':{'type':Sequelize[_0xc2d2('0x2')]},'user':{'type':Sequelize[_0xc2d2('0x2')]},'pass':{'type':Sequelize[_0xc2d2('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xc2d2('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xc2d2('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 f083df5..f95e4a8 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 _0xf130=['end','count','offset','limit','set','json','apply','save','update','then','error','stack','name','send','index','rawAttributes','keys','query','filters','model','fields','attributes','length','hasOwnProperty','order','sort','where','merge','map','key','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','MailServerOut','intersection','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x43576f,_0x1356ed){var _0x4d2466=function(_0x865deb){while(--_0x865deb){_0x43576f['push'](_0x43576f['shift']());}};_0x4d2466(++_0x1356ed);}(_0xf130,0x149));var _0x0f13=function(_0x376ac8,_0x37c8e0){_0x376ac8=_0x376ac8-0x0;var _0x3bc388=_0xf130[_0x376ac8];return _0x3bc388;};'use strict';var pdf=require(_0x0f13('0x0'));var emlformat=require(_0x0f13('0x1'));var rimraf=require(_0x0f13('0x2'));var zipdir=require(_0x0f13('0x3'));var jsonpatch=require(_0x0f13('0x4'));var rp=require(_0x0f13('0x5'));var moment=require(_0x0f13('0x6'));var BPromise=require(_0x0f13('0x7'));var Mustache=require('mustache');var util=require(_0x0f13('0x8'));var path=require(_0x0f13('0x9'));var sox=require(_0x0f13('0xa'));var csv=require(_0x0f13('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0f13('0xc'));var squel=require(_0x0f13('0xd'));var crypto=require(_0x0f13('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0f13('0xf'));var toCsv=require(_0x0f13('0xb'));var querystring=require(_0x0f13('0x10'));var Papa=require(_0x0f13('0x11'));var Redis=require(_0x0f13('0x12'));var authService=require(_0x0f13('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f13('0x14'))('api');var utils=require(_0x0f13('0x15'));var config=require(_0x0f13('0x16'));var db=require(_0x0f13('0x17'))['db'];function respondWithStatusCode(_0x5dece6,_0x2e99c2){_0x2e99c2=_0x2e99c2||0xcc;return function(_0x216bb7){if(_0x216bb7){return _0x5dece6[_0x0f13('0x18')](_0x2e99c2);}return _0x5dece6[_0x0f13('0x19')](_0x2e99c2)[_0x0f13('0x1a')]();};}function respondWithResult(_0x15463b,_0x4bd8e6){_0x4bd8e6=_0x4bd8e6||0xc8;return function(_0x273e5f){if(_0x273e5f){return _0x15463b[_0x0f13('0x19')](_0x4bd8e6)['json'](_0x273e5f);}};}function respondWithFilteredResult(_0x1626a9,_0x115948){return function(_0x36c09e){if(_0x36c09e){var _0xe171cd=_0x36c09e[_0x0f13('0x1b')],_0x187568=_0x115948['offset'],_0x308893=_0x115948[_0x0f13('0x1c')]+_0x115948[_0x0f13('0x1d')],_0x154fe7;if(_0x308893>=_0xe171cd){_0x308893=_0xe171cd;_0x154fe7=0xc8;}else{_0x154fe7=0xce;}_0x1626a9['status'](_0x154fe7);return _0x1626a9[_0x0f13('0x1e')]('Content-Range',_0x187568+'-'+_0x308893+'/'+_0xe171cd)[_0x0f13('0x1f')](_0x36c09e);}return null;};}function patchUpdates(_0x115343){return function(_0x43469a){try{jsonpatch[_0x0f13('0x20')](_0x43469a,_0x115343,!![]);}catch(_0x4c544e){return BPromise['reject'](_0x4c544e);}return _0x43469a[_0x0f13('0x21')]();};}function saveUpdates(_0x4652ab,_0x44e7d1){return function(_0x1ad99a){if(_0x1ad99a){return _0x1ad99a[_0x0f13('0x22')](_0x4652ab)[_0x0f13('0x23')](function(_0x14f657){return _0x14f657;});}return null;};}function removeEntity(_0x1193e4,_0x188c77){return function(_0x728b17){if(_0x728b17){return _0x728b17['destroy']()['then'](function(){_0x1193e4[_0x0f13('0x19')](0xcc)[_0x0f13('0x1a')]();});}};}function handleEntityNotFound(_0x860f0c,_0x2e71b4){return function(_0x36b170){if(!_0x36b170){_0x860f0c[_0x0f13('0x18')](0x194);}return _0x36b170;};}function handleError(_0x507d0f,_0xcf272e){_0xcf272e=_0xcf272e||0x1f4;return function(_0x1fae09){logger[_0x0f13('0x24')](_0x1fae09[_0x0f13('0x25')]);if(_0x1fae09['name']){delete _0x1fae09[_0x0f13('0x26')];}_0x507d0f['status'](_0xcf272e)[_0x0f13('0x27')](_0x1fae09);};}exports[_0x0f13('0x28')]=function(_0x1f5c7e,_0x5c6141){var _0x196fc6={},_0x378238={},_0x25f4f5={'count':0x0,'rows':[]};var _0x33664d=db['MailServerOut'][_0x0f13('0x29')];_0x378238['model']=_['keys'](_0x33664d);_0x378238['query']=_[_0x0f13('0x2a')](_0x1f5c7e[_0x0f13('0x2b')]);_0x378238[_0x0f13('0x2c')]=_['intersection'](_0x378238[_0x0f13('0x2d')],_0x378238[_0x0f13('0x2b')]);_0x196fc6['attributes']=_['intersection'](_0x378238[_0x0f13('0x2d')],qs[_0x0f13('0x2e')](_0x1f5c7e['query']['fields']));_0x196fc6[_0x0f13('0x2f')]=_0x196fc6[_0x0f13('0x2f')][_0x0f13('0x30')]?_0x196fc6[_0x0f13('0x2f')]:_0x378238['model'];if(!_0x1f5c7e[_0x0f13('0x2b')][_0x0f13('0x31')]('nolimit')){_0x196fc6[_0x0f13('0x1d')]=qs[_0x0f13('0x1d')](_0x1f5c7e[_0x0f13('0x2b')][_0x0f13('0x1d')]);_0x196fc6[_0x0f13('0x1c')]=qs['offset'](_0x1f5c7e['query']['offset']);}_0x196fc6[_0x0f13('0x32')]=qs['sort'](_0x1f5c7e[_0x0f13('0x2b')][_0x0f13('0x33')]);_0x196fc6[_0x0f13('0x34')]=qs[_0x0f13('0x2c')](_['pick'](_0x1f5c7e[_0x0f13('0x2b')],_0x378238[_0x0f13('0x2c')]));if(_0x1f5c7e[_0x0f13('0x2b')]['filter']){_0x196fc6[_0x0f13('0x34')]=_[_0x0f13('0x35')](_0x196fc6[_0x0f13('0x34')],{'$or':_[_0x0f13('0x36')](_0x33664d,function(_0x1b3a93){if(_0x1b3a93['type'][_0x0f13('0x37')]!==_0x0f13('0x38')){var _0x5b5af4={};_0x5b5af4[_0x1b3a93['field']]={'$like':'%'+_0x1f5c7e[_0x0f13('0x2b')][_0x0f13('0x39')]+'%'};return _0x5b5af4;}})});}_0x196fc6=_[_0x0f13('0x35')]({},_0x196fc6,_0x1f5c7e[_0x0f13('0x3a')]);var _0x54ef43={'where':_0x196fc6[_0x0f13('0x34')]};return db['MailServerOut'][_0x0f13('0x1b')](_0x54ef43)[_0x0f13('0x23')](function(_0x36e65e){_0x25f4f5[_0x0f13('0x1b')]=_0x36e65e;if(_0x1f5c7e[_0x0f13('0x2b')][_0x0f13('0x3b')]){_0x196fc6[_0x0f13('0x3c')]=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x196fc6);})[_0x0f13('0x23')](function(_0x54b225){_0x25f4f5[_0x0f13('0x3d')]=_0x54b225;return _0x25f4f5;})['then'](respondWithFilteredResult(_0x5c6141,_0x196fc6))[_0x0f13('0x3e')](handleError(_0x5c6141,null));};exports[_0x0f13('0x3f')]=function(_0x1f7b0d,_0x14ab1c){var _0x58d0ad={'raw':!![],'where':{'id':_0x1f7b0d[_0x0f13('0x40')]['id']}},_0x1ab190={};_0x1ab190['model']=_[_0x0f13('0x2a')](db[_0x0f13('0x41')]['rawAttributes']);_0x1ab190['query']=_[_0x0f13('0x2a')](_0x1f7b0d[_0x0f13('0x2b')]);_0x1ab190[_0x0f13('0x2c')]=_[_0x0f13('0x42')](_0x1ab190[_0x0f13('0x2d')],_0x1ab190['query']);_0x58d0ad[_0x0f13('0x2f')]=_[_0x0f13('0x42')](_0x1ab190['model'],qs[_0x0f13('0x2e')](_0x1f7b0d[_0x0f13('0x2b')][_0x0f13('0x2e')]));_0x58d0ad[_0x0f13('0x2f')]=_0x58d0ad[_0x0f13('0x2f')]['length']?_0x58d0ad[_0x0f13('0x2f')]:_0x1ab190[_0x0f13('0x2d')];if(_0x1f7b0d[_0x0f13('0x2b')][_0x0f13('0x3b')]){_0x58d0ad[_0x0f13('0x3c')]=[{'all':!![]}];}_0x58d0ad=_[_0x0f13('0x35')]({},_0x58d0ad,_0x1f7b0d[_0x0f13('0x3a')]);return db[_0x0f13('0x41')][_0x0f13('0x43')](_0x58d0ad)[_0x0f13('0x23')](handleEntityNotFound(_0x14ab1c,null))[_0x0f13('0x23')](respondWithResult(_0x14ab1c,null))['catch'](handleError(_0x14ab1c,null));};exports[_0x0f13('0x44')]=function(_0x101377,_0x14bd8f){return db[_0x0f13('0x41')]['create'](_0x101377[_0x0f13('0x45')],{})[_0x0f13('0x23')](respondWithResult(_0x14bd8f,0xc9))[_0x0f13('0x3e')](handleError(_0x14bd8f,null));};exports[_0x0f13('0x22')]=function(_0x5dab4b,_0x3f8970){if(_0x5dab4b[_0x0f13('0x45')]['id']){delete _0x5dab4b[_0x0f13('0x45')]['id'];}return db[_0x0f13('0x41')]['find']({'where':{'id':_0x5dab4b[_0x0f13('0x40')]['id']}})[_0x0f13('0x23')](handleEntityNotFound(_0x3f8970,null))['then'](saveUpdates(_0x5dab4b['body'],null))[_0x0f13('0x23')](respondWithResult(_0x3f8970,null))[_0x0f13('0x3e')](handleError(_0x3f8970,null));};exports[_0x0f13('0x46')]=function(_0x1f896d,_0x317691){return db[_0x0f13('0x41')][_0x0f13('0x43')]({'where':{'id':_0x1f896d['params']['id']}})[_0x0f13('0x23')](handleEntityNotFound(_0x317691,null))[_0x0f13('0x23')](removeEntity(_0x317691,null))[_0x0f13('0x3e')](handleError(_0x317691,null));}; \ No newline at end of file +var _0xd8fd=['findAll','rows','catch','show','params','include','find','create','body','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','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','set','apply','reject','save','update','then','destroy','stack','send','index','MailServerOut','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','map','type','key','VIRTUAL','options','includeAll'];(function(_0x2c0ded,_0x3de22c){var _0x4473e5=function(_0x3705bc){while(--_0x3705bc){_0x2c0ded['push'](_0x2c0ded['shift']());}};_0x4473e5(++_0x3de22c);}(_0xd8fd,0xe4));var _0xdd8f=function(_0x1152e5,_0x5a8eaf){_0x1152e5=_0x1152e5-0x0;var _0xd1fcdb=_0xd8fd[_0x1152e5];return _0xd1fcdb;};'use strict';var pdf=require(_0xdd8f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdd8f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd8f('0x2'));var rp=require(_0xdd8f('0x3'));var moment=require('moment');var BPromise=require(_0xdd8f('0x4'));var Mustache=require(_0xdd8f('0x5'));var util=require(_0xdd8f('0x6'));var path=require(_0xdd8f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdd8f('0x8'));var fs=require('fs');var _=require(_0xdd8f('0x9'));var squel=require(_0xdd8f('0xa'));var crypto=require(_0xdd8f('0xb'));var jsforce=require(_0xdd8f('0xc'));var deskjs=require(_0xdd8f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdd8f('0xe'));var Papa=require(_0xdd8f('0xf'));var Redis=require(_0xdd8f('0x10'));var authService=require(_0xdd8f('0x11'));var qs=require(_0xdd8f('0x12'));var hardwareService=require(_0xdd8f('0x13'));var logger=require(_0xdd8f('0x14'))(_0xdd8f('0x15'));var utils=require(_0xdd8f('0x16'));var config=require(_0xdd8f('0x17'));var db=require(_0xdd8f('0x18'))['db'];function respondWithStatusCode(_0x2adf98,_0x317491){_0x317491=_0x317491||0xcc;return function(_0x4aacfd){if(_0x4aacfd){return _0x2adf98[_0xdd8f('0x19')](_0x317491);}return _0x2adf98[_0xdd8f('0x1a')](_0x317491)[_0xdd8f('0x1b')]();};}function respondWithResult(_0x57a8ae,_0x5935c8){_0x5935c8=_0x5935c8||0xc8;return function(_0x16e610){if(_0x16e610){return _0x57a8ae[_0xdd8f('0x1a')](_0x5935c8)[_0xdd8f('0x1c')](_0x16e610);}};}function respondWithFilteredResult(_0x5db0e1,_0x35e345){return function(_0x472cb8){if(_0x472cb8){var _0x39ae2a=_0x472cb8[_0xdd8f('0x1d')],_0x5cec56=_0x35e345[_0xdd8f('0x1e')],_0x3aaac8=_0x35e345['offset']+_0x35e345[_0xdd8f('0x1f')],_0x464b14;if(_0x3aaac8>=_0x39ae2a){_0x3aaac8=_0x39ae2a;_0x464b14=0xc8;}else{_0x464b14=0xce;}_0x5db0e1['status'](_0x464b14);return _0x5db0e1[_0xdd8f('0x20')]('Content-Range',_0x5cec56+'-'+_0x3aaac8+'/'+_0x39ae2a)['json'](_0x472cb8);}return null;};}function patchUpdates(_0x13af7b){return function(_0x100f3c){try{jsonpatch[_0xdd8f('0x21')](_0x100f3c,_0x13af7b,!![]);}catch(_0x421947){return BPromise[_0xdd8f('0x22')](_0x421947);}return _0x100f3c[_0xdd8f('0x23')]();};}function saveUpdates(_0x13ed25,_0x30d925){return function(_0x4bc834){if(_0x4bc834){return _0x4bc834[_0xdd8f('0x24')](_0x13ed25)[_0xdd8f('0x25')](function(_0x2b475f){return _0x2b475f;});}return null;};}function removeEntity(_0x2ff49e,_0x3e8b9c){return function(_0x370405){if(_0x370405){return _0x370405[_0xdd8f('0x26')]()['then'](function(){_0x2ff49e[_0xdd8f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a631e,_0x1de8b8){return function(_0x4b07e3){if(!_0x4b07e3){_0x2a631e[_0xdd8f('0x19')](0x194);}return _0x4b07e3;};}function handleError(_0x4c7283,_0x4c6a7f){_0x4c6a7f=_0x4c6a7f||0x1f4;return function(_0x324cc4){logger['error'](_0x324cc4[_0xdd8f('0x27')]);if(_0x324cc4['name']){delete _0x324cc4['name'];}_0x4c7283[_0xdd8f('0x1a')](_0x4c6a7f)[_0xdd8f('0x28')](_0x324cc4);};}exports[_0xdd8f('0x29')]=function(_0x1fbd70,_0x1e4166){var _0x5a983b={},_0x1500d3={},_0x4cd68c={'count':0x0,'rows':[]};var _0x13f8dc=db[_0xdd8f('0x2a')][_0xdd8f('0x2b')];_0x1500d3[_0xdd8f('0x2c')]=_['keys'](_0x13f8dc);_0x1500d3['query']=_[_0xdd8f('0x2d')](_0x1fbd70[_0xdd8f('0x2e')]);_0x1500d3[_0xdd8f('0x2f')]=_[_0xdd8f('0x30')](_0x1500d3[_0xdd8f('0x2c')],_0x1500d3[_0xdd8f('0x2e')]);_0x5a983b[_0xdd8f('0x31')]=_[_0xdd8f('0x30')](_0x1500d3['model'],qs[_0xdd8f('0x32')](_0x1fbd70['query'][_0xdd8f('0x32')]));_0x5a983b['attributes']=_0x5a983b[_0xdd8f('0x31')][_0xdd8f('0x33')]?_0x5a983b[_0xdd8f('0x31')]:_0x1500d3[_0xdd8f('0x2c')];if(!_0x1fbd70[_0xdd8f('0x2e')][_0xdd8f('0x34')]('nolimit')){_0x5a983b[_0xdd8f('0x1f')]=qs[_0xdd8f('0x1f')](_0x1fbd70[_0xdd8f('0x2e')][_0xdd8f('0x1f')]);_0x5a983b[_0xdd8f('0x1e')]=qs[_0xdd8f('0x1e')](_0x1fbd70['query'][_0xdd8f('0x1e')]);}_0x5a983b[_0xdd8f('0x35')]=qs['sort'](_0x1fbd70[_0xdd8f('0x2e')][_0xdd8f('0x36')]);_0x5a983b['where']=qs[_0xdd8f('0x2f')](_['pick'](_0x1fbd70[_0xdd8f('0x2e')],_0x1500d3['filters']));if(_0x1fbd70[_0xdd8f('0x2e')][_0xdd8f('0x37')]){_0x5a983b[_0xdd8f('0x38')]=_[_0xdd8f('0x39')](_0x5a983b[_0xdd8f('0x38')],{'$or':_[_0xdd8f('0x3a')](_0x13f8dc,function(_0x3e70a3){if(_0x3e70a3[_0xdd8f('0x3b')][_0xdd8f('0x3c')]!==_0xdd8f('0x3d')){var _0x57dd48={};_0x57dd48[_0x3e70a3['field']]={'$like':'%'+_0x1fbd70[_0xdd8f('0x2e')]['filter']+'%'};return _0x57dd48;}})});}_0x5a983b=_['merge']({},_0x5a983b,_0x1fbd70[_0xdd8f('0x3e')]);var _0x1d3617={'where':_0x5a983b[_0xdd8f('0x38')]};return db[_0xdd8f('0x2a')]['count'](_0x1d3617)[_0xdd8f('0x25')](function(_0x2c7398){_0x4cd68c[_0xdd8f('0x1d')]=_0x2c7398;if(_0x1fbd70[_0xdd8f('0x2e')][_0xdd8f('0x3f')]){_0x5a983b['include']=[{'all':!![]}];}return db['MailServerOut'][_0xdd8f('0x40')](_0x5a983b);})[_0xdd8f('0x25')](function(_0x5e76b2){_0x4cd68c[_0xdd8f('0x41')]=_0x5e76b2;return _0x4cd68c;})[_0xdd8f('0x25')](respondWithFilteredResult(_0x1e4166,_0x5a983b))[_0xdd8f('0x42')](handleError(_0x1e4166,null));};exports[_0xdd8f('0x43')]=function(_0x149ef7,_0xe1acaa){var _0x273044={'raw':!![],'where':{'id':_0x149ef7[_0xdd8f('0x44')]['id']}},_0x2f2144={};_0x2f2144['model']=_[_0xdd8f('0x2d')](db['MailServerOut']['rawAttributes']);_0x2f2144['query']=_['keys'](_0x149ef7[_0xdd8f('0x2e')]);_0x2f2144[_0xdd8f('0x2f')]=_[_0xdd8f('0x30')](_0x2f2144[_0xdd8f('0x2c')],_0x2f2144['query']);_0x273044[_0xdd8f('0x31')]=_[_0xdd8f('0x30')](_0x2f2144[_0xdd8f('0x2c')],qs[_0xdd8f('0x32')](_0x149ef7['query'][_0xdd8f('0x32')]));_0x273044[_0xdd8f('0x31')]=_0x273044[_0xdd8f('0x31')]['length']?_0x273044[_0xdd8f('0x31')]:_0x2f2144[_0xdd8f('0x2c')];if(_0x149ef7['query'][_0xdd8f('0x3f')]){_0x273044[_0xdd8f('0x45')]=[{'all':!![]}];}_0x273044=_['merge']({},_0x273044,_0x149ef7[_0xdd8f('0x3e')]);return db['MailServerOut'][_0xdd8f('0x46')](_0x273044)['then'](handleEntityNotFound(_0xe1acaa,null))['then'](respondWithResult(_0xe1acaa,null))['catch'](handleError(_0xe1acaa,null));};exports[_0xdd8f('0x47')]=function(_0x169af6,_0x5b45c1){return db[_0xdd8f('0x2a')]['create'](_0x169af6[_0xdd8f('0x48')],{})['then'](respondWithResult(_0x5b45c1,0xc9))[_0xdd8f('0x42')](handleError(_0x5b45c1,null));};exports[_0xdd8f('0x24')]=function(_0x4a70eb,_0x19391a){if(_0x4a70eb[_0xdd8f('0x48')]['id']){delete _0x4a70eb['body']['id'];}return db[_0xdd8f('0x2a')][_0xdd8f('0x46')]({'where':{'id':_0x4a70eb[_0xdd8f('0x44')]['id']}})['then'](handleEntityNotFound(_0x19391a,null))[_0xdd8f('0x25')](saveUpdates(_0x4a70eb[_0xdd8f('0x48')],null))['then'](respondWithResult(_0x19391a,null))[_0xdd8f('0x42')](handleError(_0x19391a,null));};exports[_0xdd8f('0x26')]=function(_0x1b5eca,_0x242201){return db[_0xdd8f('0x2a')][_0xdd8f('0x46')]({'where':{'id':_0x1b5eca['params']['id']}})[_0xdd8f('0x25')](handleEntityNotFound(_0x242201,null))[_0xdd8f('0x25')](removeEntity(_0x242201,null))['catch'](handleError(_0x242201,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index ec00ed6..de58d38 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 _0xda19=['exports','define','MailServerOut','mail_servers_out','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./mailServerOut.attributes'];(function(_0x1926a4,_0x122133){var _0x30d8f2=function(_0x4ee321){while(--_0x4ee321){_0x1926a4['push'](_0x1926a4['shift']());}};_0x30d8f2(++_0x122133);}(_0xda19,0xd5));var _0x9da1=function(_0x471b8c,_0x656b04){_0x471b8c=_0x471b8c-0x0;var _0x45a4ac=_0xda19[_0x471b8c];return _0x45a4ac;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['./mailServerOut.attributes','exports','define','MailServerOut','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x348985,_0x165339){var _0x4a1e13=function(_0x1db209){while(--_0x1db209){_0x348985['push'](_0x348985['shift']());}};_0x4a1e13(++_0x165339);}(_0x1cb9,0x14e));var _0x91cb=function(_0x14eb30,_0x45db68){_0x14eb30=_0x14eb30-0x0;var _0x123f8a=_0x1cb9[_0x14eb30];return _0x123f8a;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'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 9e819bc..6b657d8 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 _0x82e4=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x41e8c4,_0x30d9ff){var _0x54ffbe=function(_0x4131af){while(--_0x4131af){_0x41e8c4['push'](_0x41e8c4['shift']());}};_0x54ffbe(++_0x30d9ff);}(_0x82e4,0x13f));var _0x482e=function(_0x81f000,_0x15df85){_0x81f000=_0x81f000-0x0;var _0x337aa2=_0x82e4[_0x81f000];return _0x337aa2;};'use strict';var _=require(_0x482e('0x0'));var util=require(_0x482e('0x1'));var moment=require(_0x482e('0x2'));var BPromise=require(_0x482e('0x3'));var rs=require(_0x482e('0x4'));var fs=require('fs');var Redis=require(_0x482e('0x5'));var db=require(_0x482e('0x6'))['db'];var utils=require(_0x482e('0x7'));var logger=require(_0x482e('0x8'))(_0x482e('0x9'));var config=require(_0x482e('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x482e('0xb')][_0x482e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a7d65,_0x1244ce,_0x184e33){return new BPromise(function(_0x18620c,_0x5c5c6d){return client['request'](_0x1a7d65,_0x184e33)['then'](function(_0x39806f){logger[_0x482e('0xd')](_0x482e('0xe'),_0x1244ce,_0x482e('0xf'));logger[_0x482e('0x10')](_0x482e('0x11'),_0x1244ce,_0x482e('0xf'),JSON['stringify'](_0x39806f));if(_0x39806f[_0x482e('0x12')]){if(_0x39806f[_0x482e('0x12')][_0x482e('0x13')]===0x1f4){logger[_0x482e('0x12')](_0x482e('0xe'),_0x1244ce,_0x39806f[_0x482e('0x12')][_0x482e('0x14')]);return _0x5c5c6d(_0x39806f[_0x482e('0x12')][_0x482e('0x14')]);}logger[_0x482e('0x12')](_0x482e('0xe'),_0x1244ce,_0x39806f[_0x482e('0x12')][_0x482e('0x14')]);return _0x18620c(_0x39806f[_0x482e('0x12')][_0x482e('0x14')]);}else{logger[_0x482e('0xd')](_0x482e('0xe'),_0x1244ce,_0x482e('0xf'));_0x18620c(_0x39806f[_0x482e('0x15')][_0x482e('0x14')]);}})[_0x482e('0x16')](function(_0x1b8dee){logger[_0x482e('0x12')](_0x482e('0xe'),_0x1244ce,_0x1b8dee);_0x5c5c6d(_0x1b8dee);});});} \ No newline at end of file +var _0x4ddc=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','debug','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x26a74d,_0x37ecfc){var _0xcbb1a3=function(_0x24b978){while(--_0x24b978){_0x26a74d['push'](_0x26a74d['shift']());}};_0xcbb1a3(++_0x37ecfc);}(_0x4ddc,0x145));var _0xc4dd=function(_0x5cc8d2,_0x4816f0){_0x5cc8d2=_0x5cc8d2-0x0;var _0x286659=_0x4ddc[_0x5cc8d2];return _0x286659;};'use strict';var _=require(_0xc4dd('0x0'));var util=require(_0xc4dd('0x1'));var moment=require(_0xc4dd('0x2'));var BPromise=require(_0xc4dd('0x3'));var rs=require(_0xc4dd('0x4'));var fs=require('fs');var Redis=require(_0xc4dd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc4dd('0x6'));var logger=require(_0xc4dd('0x7'))(_0xc4dd('0x8'));var config=require(_0xc4dd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc4dd('0xa')][_0xc4dd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38eb94,_0x50409f,_0x4a8cc5){return new BPromise(function(_0x124177,_0xb69e02){return client[_0xc4dd('0xc')](_0x38eb94,_0x4a8cc5)[_0xc4dd('0xd')](function(_0x4ea08f){logger[_0xc4dd('0xe')](_0xc4dd('0xf'),_0x50409f,'request\x20sent');logger[_0xc4dd('0x10')](_0xc4dd('0x11'),_0x50409f,_0xc4dd('0x12'),JSON[_0xc4dd('0x13')](_0x4ea08f));if(_0x4ea08f[_0xc4dd('0x14')]){if(_0x4ea08f[_0xc4dd('0x14')][_0xc4dd('0x15')]===0x1f4){logger[_0xc4dd('0x14')]('MailServerOut,\x20%s,\x20%s',_0x50409f,_0x4ea08f[_0xc4dd('0x14')]['message']);return _0xb69e02(_0x4ea08f['error'][_0xc4dd('0x16')]);}logger[_0xc4dd('0x14')](_0xc4dd('0xf'),_0x50409f,_0x4ea08f[_0xc4dd('0x14')][_0xc4dd('0x16')]);return _0x124177(_0x4ea08f[_0xc4dd('0x14')][_0xc4dd('0x16')]);}else{logger['info']('MailServerOut,\x20%s,\x20%s',_0x50409f,_0xc4dd('0x12'));_0x124177(_0x4ea08f[_0xc4dd('0x17')][_0xc4dd('0x16')]);}})[_0xc4dd('0x18')](function(_0x26f5e3){logger[_0xc4dd('0x14')](_0xc4dd('0xf'),_0x50409f,_0x26f5e3);_0xb69e02(_0x26f5e3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 733386c..140813f 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 _0x99cc=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','post','create','destroy','exports'];(function(_0x578890,_0x462634){var _0x50e1f3=function(_0x3b38c5){while(--_0x3b38c5){_0x578890['push'](_0x578890['shift']());}};_0x50e1f3(++_0x462634);}(_0x99cc,0xdd));var _0xc99c=function(_0x7dcb5d,_0x3791a2){_0x7dcb5d=_0x7dcb5d-0x0;var _0x2f0f7e=_0x99cc[_0x7dcb5d];return _0x2f0f7e;};'use strict';var multer=require(_0xc99c('0x0'));var util=require(_0xc99c('0x1'));var path=require(_0xc99c('0x2'));var timeout=require(_0xc99c('0x3'));var express=require(_0xc99c('0x4'));var router=express[_0xc99c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc99c('0x6'));var config=require(_0xc99c('0x7'));var controller=require('./mailSubstatus.controller');router[_0xc99c('0x8')]('/',auth[_0xc99c('0x9')](),controller['index']);router['get'](_0xc99c('0xa'),auth[_0xc99c('0x9')](),controller[_0xc99c('0xb')]);router[_0xc99c('0x8')](_0xc99c('0xc'),auth[_0xc99c('0x9')](),controller['show']);router[_0xc99c('0xd')]('/',auth['isAuthenticated'](),controller[_0xc99c('0xe')]);router['put'](_0xc99c('0xc'),auth[_0xc99c('0x9')](),controller['update']);router['delete'](_0xc99c('0xc'),auth[_0xc99c('0x9')](),controller[_0xc99c('0xf')]);module[_0xc99c('0x10')]=router; \ No newline at end of file +var _0xb9fa=['../../config/environment','get','index','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service'];(function(_0x5966a1,_0x574ec6){var _0x4aeb00=function(_0x5c95bf){while(--_0x5c95bf){_0x5966a1['push'](_0x5966a1['shift']());}};_0x4aeb00(++_0x574ec6);}(_0xb9fa,0x163));var _0xab9f=function(_0x12641f,_0x335309){_0x12641f=_0x12641f-0x0;var _0x357825=_0xb9fa[_0x12641f];return _0x357825;};'use strict';var multer=require(_0xab9f('0x0'));var util=require(_0xab9f('0x1'));var path=require(_0xab9f('0x2'));var timeout=require(_0xab9f('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xab9f('0x4'));var config=require(_0xab9f('0x5'));var controller=require('./mailSubstatus.controller');router[_0xab9f('0x6')]('/',auth['isAuthenticated'](),controller[_0xab9f('0x7')]);router[_0xab9f('0x6')]('/describe',auth[_0xab9f('0x8')](),controller[_0xab9f('0x9')]);router[_0xab9f('0x6')](_0xab9f('0xa'),auth[_0xab9f('0x8')](),controller[_0xab9f('0xb')]);router[_0xab9f('0xc')]('/',auth[_0xab9f('0x8')](),controller['create']);router[_0xab9f('0xd')](_0xab9f('0xa'),auth[_0xab9f('0x8')](),controller[_0xab9f('0xe')]);router[_0xab9f('0xf')]('/:id',auth[_0xab9f('0x8')](),controller[_0xab9f('0x10')]);module[_0xab9f('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 15e1db4..7338af2 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 _0xc274=['STRING','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc274,0x151));var _0x4c27=function(_0x3d862c,_0x2c3c92){_0x3d862c=_0x3d862c-0x0;var _0x35841a=_0xc274[_0x3d862c];return _0x35841a;};'use strict';var Sequelize=require('sequelize');module[_0x4c27('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4c27('0x1')]}}; \ No newline at end of file +var _0xb458=['STRING','sequelize','exports'];(function(_0x13f6f3,_0x556326){var _0x2f0c0e=function(_0x3cb1e9){while(--_0x3cb1e9){_0x13f6f3['push'](_0x13f6f3['shift']());}};_0x2f0c0e(++_0x556326);}(_0xb458,0x94));var _0x8b45=function(_0x4d6ebc,_0x341479){_0x4d6ebc=_0x4d6ebc-0x0;var _0x32a2a3=_0xb458[_0x4d6ebc];return _0x32a2a3;};'use strict';var Sequelize=require(_0x8b45('0x0'));module[_0x8b45('0x1')]={'name':{'type':Sequelize[_0x8b45('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index f30673c..1b13273 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 _0x8eea=['eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','filter','type','key','field','merge','options','MailSubstatus','includeAll','include','findAll','catch','params','length','find','create','body','describe','html-pdf'];(function(_0x4a5e80,_0x2cd372){var _0x36e432=function(_0x4ec0d0){while(--_0x4ec0d0){_0x4a5e80['push'](_0x4a5e80['shift']());}};_0x36e432(++_0x2cd372);}(_0x8eea,0xce));var _0xa8ee=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x8eea[_0x40bffc];return _0x3007e9;};'use strict';var pdf=require(_0xa8ee('0x0'));var emlformat=require(_0xa8ee('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa8ee('0x2'));var jsonpatch=require(_0xa8ee('0x3'));var rp=require('request-promise');var moment=require(_0xa8ee('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa8ee('0x5'));var util=require(_0xa8ee('0x6'));var path=require(_0xa8ee('0x7'));var sox=require(_0xa8ee('0x8'));var csv=require('to-csv');var ejs=require(_0xa8ee('0x9'));var fs=require('fs');var _=require(_0xa8ee('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa8ee('0xb'));var toCsv=require(_0xa8ee('0xc'));var querystring=require('querystring');var Papa=require(_0xa8ee('0xd'));var Redis=require('ioredis');var authService=require(_0xa8ee('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa8ee('0xf'));var logger=require(_0xa8ee('0x10'))('api');var utils=require(_0xa8ee('0x11'));var config=require(_0xa8ee('0x12'));var db=require(_0xa8ee('0x13'))['db'];function respondWithStatusCode(_0x2e8260,_0x28c489){_0x28c489=_0x28c489||0xcc;return function(_0x178dbc){if(_0x178dbc){return _0x2e8260[_0xa8ee('0x14')](_0x28c489);}return _0x2e8260[_0xa8ee('0x15')](_0x28c489)[_0xa8ee('0x16')]();};}function respondWithResult(_0x2ac1f6,_0x3cffb7){_0x3cffb7=_0x3cffb7||0xc8;return function(_0x10c331){if(_0x10c331){return _0x2ac1f6['status'](_0x3cffb7)['json'](_0x10c331);}};}function respondWithFilteredResult(_0x5a4798,_0x4c6d16){return function(_0x4cb1a8){if(_0x4cb1a8){var _0x229b18=_0x4cb1a8[_0xa8ee('0x17')],_0x2a804c=_0x4c6d16[_0xa8ee('0x18')],_0x3a27f4=_0x4c6d16[_0xa8ee('0x18')]+_0x4c6d16['limit'],_0x57defd;if(_0x3a27f4>=_0x229b18){_0x3a27f4=_0x229b18;_0x57defd=0xc8;}else{_0x57defd=0xce;}_0x5a4798[_0xa8ee('0x15')](_0x57defd);return _0x5a4798[_0xa8ee('0x19')](_0xa8ee('0x1a'),_0x2a804c+'-'+_0x3a27f4+'/'+_0x229b18)['json'](_0x4cb1a8);}return null;};}function patchUpdates(_0x4721cb){return function(_0x5db377){try{jsonpatch[_0xa8ee('0x1b')](_0x5db377,_0x4721cb,!![]);}catch(_0x490e14){return BPromise[_0xa8ee('0x1c')](_0x490e14);}return _0x5db377[_0xa8ee('0x1d')]();};}function saveUpdates(_0x2ffabd,_0x52dcb0){return function(_0x3c5471){if(_0x3c5471){return _0x3c5471[_0xa8ee('0x1e')](_0x2ffabd)['then'](function(_0x9a18e7){return _0x9a18e7;});}return null;};}function removeEntity(_0x2aba14,_0x44b409){return function(_0x653ab){if(_0x653ab){return _0x653ab[_0xa8ee('0x1f')]()[_0xa8ee('0x20')](function(){_0x2aba14[_0xa8ee('0x15')](0xcc)[_0xa8ee('0x16')]();});}};}function handleEntityNotFound(_0x48fa1c,_0x15d69e){return function(_0x16f5f2){if(!_0x16f5f2){_0x48fa1c['sendStatus'](0x194);}return _0x16f5f2;};}function handleError(_0x14841a,_0x3396e6){_0x3396e6=_0x3396e6||0x1f4;return function(_0x240815){logger[_0xa8ee('0x21')](_0x240815[_0xa8ee('0x22')]);if(_0x240815[_0xa8ee('0x23')]){delete _0x240815['name'];}_0x14841a['status'](_0x3396e6)[_0xa8ee('0x24')](_0x240815);};}exports[_0xa8ee('0x25')]=function(_0x5cc20f,_0x11b1fa){var _0x512266={},_0x24226a={},_0xd748e1={'count':0x0,'rows':[]};var _0x4d1d43=db['MailSubstatus'][_0xa8ee('0x26')];_0x24226a[_0xa8ee('0x27')]=_[_0xa8ee('0x28')](_0x4d1d43);_0x24226a['query']=_['keys'](_0x5cc20f[_0xa8ee('0x29')]);_0x24226a[_0xa8ee('0x2a')]=_[_0xa8ee('0x2b')](_0x24226a['model'],_0x24226a[_0xa8ee('0x29')]);_0x512266[_0xa8ee('0x2c')]=_['intersection'](_0x24226a['model'],qs[_0xa8ee('0x2d')](_0x5cc20f[_0xa8ee('0x29')][_0xa8ee('0x2d')]));_0x512266[_0xa8ee('0x2c')]=_0x512266[_0xa8ee('0x2c')]['length']?_0x512266[_0xa8ee('0x2c')]:_0x24226a[_0xa8ee('0x27')];if(!_0x5cc20f[_0xa8ee('0x29')]['hasOwnProperty'](_0xa8ee('0x2e'))){_0x512266['limit']=qs[_0xa8ee('0x2f')](_0x5cc20f[_0xa8ee('0x29')]['limit']);_0x512266[_0xa8ee('0x18')]=qs[_0xa8ee('0x18')](_0x5cc20f[_0xa8ee('0x29')][_0xa8ee('0x18')]);}_0x512266[_0xa8ee('0x30')]=qs['sort'](_0x5cc20f[_0xa8ee('0x29')][_0xa8ee('0x31')]);_0x512266[_0xa8ee('0x32')]=qs[_0xa8ee('0x2a')](_[_0xa8ee('0x33')](_0x5cc20f[_0xa8ee('0x29')],_0x24226a[_0xa8ee('0x2a')]));if(_0x5cc20f[_0xa8ee('0x29')][_0xa8ee('0x34')]){_0x512266[_0xa8ee('0x32')]=_['merge'](_0x512266['where'],{'$or':_['map'](_0x4d1d43,function(_0x1486bc){if(_0x1486bc[_0xa8ee('0x35')][_0xa8ee('0x36')]!=='VIRTUAL'){var _0x4d9c82={};_0x4d9c82[_0x1486bc[_0xa8ee('0x37')]]={'$like':'%'+_0x5cc20f[_0xa8ee('0x29')]['filter']+'%'};return _0x4d9c82;}})});}_0x512266=_[_0xa8ee('0x38')]({},_0x512266,_0x5cc20f[_0xa8ee('0x39')]);var _0x33a504={'where':_0x512266[_0xa8ee('0x32')]};return db[_0xa8ee('0x3a')][_0xa8ee('0x17')](_0x33a504)[_0xa8ee('0x20')](function(_0x3dc153){_0xd748e1[_0xa8ee('0x17')]=_0x3dc153;if(_0x5cc20f[_0xa8ee('0x29')][_0xa8ee('0x3b')]){_0x512266[_0xa8ee('0x3c')]=[{'all':!![]}];}return db[_0xa8ee('0x3a')][_0xa8ee('0x3d')](_0x512266);})[_0xa8ee('0x20')](function(_0x133c96){_0xd748e1['rows']=_0x133c96;return _0xd748e1;})[_0xa8ee('0x20')](respondWithFilteredResult(_0x11b1fa,_0x512266))[_0xa8ee('0x3e')](handleError(_0x11b1fa,null));};exports['show']=function(_0x31107a,_0x2615f3){var _0x1938b4={'raw':!![],'where':{'id':_0x31107a[_0xa8ee('0x3f')]['id']}},_0x4ef0c0={};_0x4ef0c0[_0xa8ee('0x27')]=_[_0xa8ee('0x28')](db['MailSubstatus'][_0xa8ee('0x26')]);_0x4ef0c0['query']=_[_0xa8ee('0x28')](_0x31107a[_0xa8ee('0x29')]);_0x4ef0c0[_0xa8ee('0x2a')]=_[_0xa8ee('0x2b')](_0x4ef0c0[_0xa8ee('0x27')],_0x4ef0c0[_0xa8ee('0x29')]);_0x1938b4[_0xa8ee('0x2c')]=_[_0xa8ee('0x2b')](_0x4ef0c0[_0xa8ee('0x27')],qs['fields'](_0x31107a[_0xa8ee('0x29')][_0xa8ee('0x2d')]));_0x1938b4['attributes']=_0x1938b4[_0xa8ee('0x2c')][_0xa8ee('0x40')]?_0x1938b4['attributes']:_0x4ef0c0[_0xa8ee('0x27')];if(_0x31107a['query'][_0xa8ee('0x3b')]){_0x1938b4['include']=[{'all':!![]}];}_0x1938b4=_[_0xa8ee('0x38')]({},_0x1938b4,_0x31107a[_0xa8ee('0x39')]);return db[_0xa8ee('0x3a')][_0xa8ee('0x41')](_0x1938b4)[_0xa8ee('0x20')](handleEntityNotFound(_0x2615f3,null))[_0xa8ee('0x20')](respondWithResult(_0x2615f3,null))[_0xa8ee('0x3e')](handleError(_0x2615f3,null));};exports[_0xa8ee('0x42')]=function(_0x178dae,_0x4c5ae4){return db[_0xa8ee('0x3a')][_0xa8ee('0x42')](_0x178dae[_0xa8ee('0x43')],{})[_0xa8ee('0x20')](respondWithResult(_0x4c5ae4,0xc9))[_0xa8ee('0x3e')](handleError(_0x4c5ae4,null));};exports[_0xa8ee('0x1e')]=function(_0x35fbaa,_0x376db3){if(_0x35fbaa[_0xa8ee('0x43')]['id']){delete _0x35fbaa[_0xa8ee('0x43')]['id'];}return db['MailSubstatus'][_0xa8ee('0x41')]({'where':{'id':_0x35fbaa[_0xa8ee('0x3f')]['id']}})[_0xa8ee('0x20')](handleEntityNotFound(_0x376db3,null))['then'](saveUpdates(_0x35fbaa[_0xa8ee('0x43')],null))['then'](respondWithResult(_0x376db3,null))[_0xa8ee('0x3e')](handleError(_0x376db3,null));};exports['destroy']=function(_0x6de069,_0x376dae){return db[_0xa8ee('0x3a')]['find']({'where':{'id':_0x6de069[_0xa8ee('0x3f')]['id']}})['then'](handleEntityNotFound(_0x376dae,null))['then'](removeEntity(_0x376dae,null))[_0xa8ee('0x3e')](handleError(_0x376dae,null));};exports['describe']=function(_0x532744,_0x2b629b){return db['MailSubstatus'][_0xa8ee('0x44')]()[_0xa8ee('0x20')](respondWithResult(_0x2b629b,null))[_0xa8ee('0x3e')](handleError(_0x2b629b,null));}; \ No newline at end of file +var _0xc775=['status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','MailSubstatus','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xc775,0x106));var _0x5c77=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xc775[_0x21a9d9];return _0x46adce;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5c77('0x0'));var jsonpatch=require(_0x5c77('0x1'));var rp=require(_0x5c77('0x2'));var moment=require(_0x5c77('0x3'));var BPromise=require(_0x5c77('0x4'));var Mustache=require(_0x5c77('0x5'));var util=require(_0x5c77('0x6'));var path=require('path');var sox=require(_0x5c77('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x5c77('0x8'));var squel=require(_0x5c77('0x9'));var crypto=require(_0x5c77('0xa'));var jsforce=require(_0x5c77('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5c77('0xc'));var querystring=require(_0x5c77('0xd'));var Papa=require(_0x5c77('0xe'));var Redis=require(_0x5c77('0xf'));var authService=require(_0x5c77('0x10'));var qs=require(_0x5c77('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5c77('0x12'));var utils=require(_0x5c77('0x13'));var config=require(_0x5c77('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16f450,_0x34d8be){_0x34d8be=_0x34d8be||0xcc;return function(_0x24dd29){if(_0x24dd29){return _0x16f450[_0x5c77('0x15')](_0x34d8be);}return _0x16f450['status'](_0x34d8be)['end']();};}function respondWithResult(_0x471517,_0x27cfa7){_0x27cfa7=_0x27cfa7||0xc8;return function(_0x326ea9){if(_0x326ea9){return _0x471517[_0x5c77('0x16')](_0x27cfa7)[_0x5c77('0x17')](_0x326ea9);}};}function respondWithFilteredResult(_0x1901d1,_0x112cdd){return function(_0x51da18){if(_0x51da18){var _0xeb4bde=_0x51da18[_0x5c77('0x18')],_0xbe7d70=_0x112cdd[_0x5c77('0x19')],_0x390bb7=_0x112cdd['offset']+_0x112cdd[_0x5c77('0x1a')],_0x52253c;if(_0x390bb7>=_0xeb4bde){_0x390bb7=_0xeb4bde;_0x52253c=0xc8;}else{_0x52253c=0xce;}_0x1901d1['status'](_0x52253c);return _0x1901d1['set'](_0x5c77('0x1b'),_0xbe7d70+'-'+_0x390bb7+'/'+_0xeb4bde)['json'](_0x51da18);}return null;};}function patchUpdates(_0x5ce351){return function(_0x2e64ab){try{jsonpatch[_0x5c77('0x1c')](_0x2e64ab,_0x5ce351,!![]);}catch(_0x5af8d2){return BPromise[_0x5c77('0x1d')](_0x5af8d2);}return _0x2e64ab[_0x5c77('0x1e')]();};}function saveUpdates(_0x38e483,_0x2d21fa){return function(_0xc78316){if(_0xc78316){return _0xc78316[_0x5c77('0x1f')](_0x38e483)[_0x5c77('0x20')](function(_0x29e1dd){return _0x29e1dd;});}return null;};}function removeEntity(_0x32568c,_0x4dca6c){return function(_0x2288f9){if(_0x2288f9){return _0x2288f9[_0x5c77('0x21')]()[_0x5c77('0x20')](function(){_0x32568c[_0x5c77('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57ec4a,_0x3fc915){return function(_0x408c63){if(!_0x408c63){_0x57ec4a[_0x5c77('0x15')](0x194);}return _0x408c63;};}function handleError(_0x4a6a64,_0x4c276d){_0x4c276d=_0x4c276d||0x1f4;return function(_0x314a00){logger[_0x5c77('0x22')](_0x314a00[_0x5c77('0x23')]);if(_0x314a00[_0x5c77('0x24')]){delete _0x314a00['name'];}_0x4a6a64[_0x5c77('0x16')](_0x4c276d)[_0x5c77('0x25')](_0x314a00);};}exports[_0x5c77('0x26')]=function(_0x356719,_0x36f449){var _0x152bc4={},_0x41af5f={},_0x50da99={'count':0x0,'rows':[]};var _0x3bc96b=db[_0x5c77('0x27')][_0x5c77('0x28')];_0x41af5f[_0x5c77('0x29')]=_[_0x5c77('0x2a')](_0x3bc96b);_0x41af5f[_0x5c77('0x2b')]=_[_0x5c77('0x2a')](_0x356719[_0x5c77('0x2b')]);_0x41af5f[_0x5c77('0x2c')]=_[_0x5c77('0x2d')](_0x41af5f[_0x5c77('0x29')],_0x41af5f[_0x5c77('0x2b')]);_0x152bc4[_0x5c77('0x2e')]=_[_0x5c77('0x2d')](_0x41af5f[_0x5c77('0x29')],qs[_0x5c77('0x2f')](_0x356719['query']['fields']));_0x152bc4[_0x5c77('0x2e')]=_0x152bc4[_0x5c77('0x2e')][_0x5c77('0x30')]?_0x152bc4['attributes']:_0x41af5f['model'];if(!_0x356719['query'][_0x5c77('0x31')](_0x5c77('0x32'))){_0x152bc4['limit']=qs[_0x5c77('0x1a')](_0x356719[_0x5c77('0x2b')][_0x5c77('0x1a')]);_0x152bc4[_0x5c77('0x19')]=qs[_0x5c77('0x19')](_0x356719[_0x5c77('0x2b')][_0x5c77('0x19')]);}_0x152bc4[_0x5c77('0x33')]=qs[_0x5c77('0x34')](_0x356719[_0x5c77('0x2b')][_0x5c77('0x34')]);_0x152bc4[_0x5c77('0x35')]=qs[_0x5c77('0x2c')](_[_0x5c77('0x36')](_0x356719[_0x5c77('0x2b')],_0x41af5f['filters']));if(_0x356719[_0x5c77('0x2b')][_0x5c77('0x37')]){_0x152bc4['where']=_[_0x5c77('0x38')](_0x152bc4[_0x5c77('0x35')],{'$or':_[_0x5c77('0x39')](_0x3bc96b,function(_0xdb6912){if(_0xdb6912[_0x5c77('0x3a')]['key']!==_0x5c77('0x3b')){var _0x1655e9={};_0x1655e9[_0xdb6912[_0x5c77('0x3c')]]={'$like':'%'+_0x356719['query'][_0x5c77('0x37')]+'%'};return _0x1655e9;}})});}_0x152bc4=_[_0x5c77('0x38')]({},_0x152bc4,_0x356719[_0x5c77('0x3d')]);var _0x5e1655={'where':_0x152bc4[_0x5c77('0x35')]};return db[_0x5c77('0x27')][_0x5c77('0x18')](_0x5e1655)[_0x5c77('0x20')](function(_0x4d38df){_0x50da99[_0x5c77('0x18')]=_0x4d38df;if(_0x356719[_0x5c77('0x2b')][_0x5c77('0x3e')]){_0x152bc4[_0x5c77('0x3f')]=[{'all':!![]}];}return db[_0x5c77('0x27')]['findAll'](_0x152bc4);})[_0x5c77('0x20')](function(_0x4a6208){_0x50da99[_0x5c77('0x40')]=_0x4a6208;return _0x50da99;})['then'](respondWithFilteredResult(_0x36f449,_0x152bc4))[_0x5c77('0x41')](handleError(_0x36f449,null));};exports['show']=function(_0x529076,_0x2f5d9c){var _0x40b7eb={'raw':!![],'where':{'id':_0x529076[_0x5c77('0x42')]['id']}},_0x1c04a4={};_0x1c04a4[_0x5c77('0x29')]=_[_0x5c77('0x2a')](db[_0x5c77('0x27')][_0x5c77('0x28')]);_0x1c04a4[_0x5c77('0x2b')]=_[_0x5c77('0x2a')](_0x529076[_0x5c77('0x2b')]);_0x1c04a4['filters']=_[_0x5c77('0x2d')](_0x1c04a4['model'],_0x1c04a4['query']);_0x40b7eb[_0x5c77('0x2e')]=_[_0x5c77('0x2d')](_0x1c04a4['model'],qs[_0x5c77('0x2f')](_0x529076[_0x5c77('0x2b')][_0x5c77('0x2f')]));_0x40b7eb[_0x5c77('0x2e')]=_0x40b7eb[_0x5c77('0x2e')][_0x5c77('0x30')]?_0x40b7eb['attributes']:_0x1c04a4[_0x5c77('0x29')];if(_0x529076[_0x5c77('0x2b')][_0x5c77('0x3e')]){_0x40b7eb[_0x5c77('0x3f')]=[{'all':!![]}];}_0x40b7eb=_[_0x5c77('0x38')]({},_0x40b7eb,_0x529076[_0x5c77('0x3d')]);return db[_0x5c77('0x27')][_0x5c77('0x43')](_0x40b7eb)['then'](handleEntityNotFound(_0x2f5d9c,null))[_0x5c77('0x20')](respondWithResult(_0x2f5d9c,null))[_0x5c77('0x41')](handleError(_0x2f5d9c,null));};exports[_0x5c77('0x44')]=function(_0x4a6164,_0x20d0b8){return db[_0x5c77('0x27')][_0x5c77('0x44')](_0x4a6164[_0x5c77('0x45')],{})['then'](respondWithResult(_0x20d0b8,0xc9))[_0x5c77('0x41')](handleError(_0x20d0b8,null));};exports['update']=function(_0x47600b,_0x22fce2){if(_0x47600b[_0x5c77('0x45')]['id']){delete _0x47600b[_0x5c77('0x45')]['id'];}return db[_0x5c77('0x27')][_0x5c77('0x43')]({'where':{'id':_0x47600b[_0x5c77('0x42')]['id']}})[_0x5c77('0x20')](handleEntityNotFound(_0x22fce2,null))[_0x5c77('0x20')](saveUpdates(_0x47600b[_0x5c77('0x45')],null))[_0x5c77('0x20')](respondWithResult(_0x22fce2,null))[_0x5c77('0x41')](handleError(_0x22fce2,null));};exports[_0x5c77('0x21')]=function(_0x11b608,_0x257d7f){return db['MailSubstatus']['find']({'where':{'id':_0x11b608['params']['id']}})[_0x5c77('0x20')](handleEntityNotFound(_0x257d7f,null))[_0x5c77('0x20')](removeEntity(_0x257d7f,null))[_0x5c77('0x41')](handleError(_0x257d7f,null));};exports[_0x5c77('0x46')]=function(_0x2b6143,_0x49e0e7){return db['MailSubstatus'][_0x5c77('0x46')]()[_0x5c77('0x20')](respondWithResult(_0x49e0e7,null))[_0x5c77('0x41')](handleError(_0x49e0e7,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 027b637..c7a8bce 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 _0xaa64=['../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','lodash','util','api','bluebird','request-promise','path'];(function(_0x494659,_0x1b8e75){var _0x36a11d=function(_0x1b4e77){while(--_0x1b4e77){_0x494659['push'](_0x494659['shift']());}};_0x36a11d(++_0x1b8e75);}(_0xaa64,0xf7));var _0x4aa6=function(_0x4f3b26,_0x1de290){_0x4f3b26=_0x4f3b26-0x0;var _0x79d0e1=_0xaa64[_0x4f3b26];return _0x79d0e1;};'use strict';var _=require(_0x4aa6('0x0'));var util=require(_0x4aa6('0x1'));var logger=require('../../config/logger')(_0x4aa6('0x2'));var moment=require('moment');var BPromise=require(_0x4aa6('0x3'));var rp=require(_0x4aa6('0x4'));var fs=require('fs');var path=require(_0x4aa6('0x5'));var rimraf=require('rimraf');var config=require(_0x4aa6('0x6'));var attributes=require(_0x4aa6('0x7'));module[_0x4aa6('0x8')]=function(_0x37a260,_0x426bd6){return _0x37a260[_0x4aa6('0x9')](_0x4aa6('0xa'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb98e=['moment','bluebird','request-promise','rimraf','../../config/environment','./mailSubstatus.attributes','define','mail_substatuses','lodash','util'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0xb98e,0x184));var _0xeb98=function(_0x1d5746,_0x4166c9){_0x1d5746=_0x1d5746-0x0;var _0x28ea74=_0xb98e[_0x1d5746];return _0x28ea74;};'use strict';var _=require(_0xeb98('0x0'));var util=require(_0xeb98('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xeb98('0x2'));var BPromise=require(_0xeb98('0x3'));var rp=require(_0xeb98('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb98('0x5'));var config=require(_0xeb98('0x6'));var attributes=require(_0xeb98('0x7'));module['exports']=function(_0x33a16e,_0x5d12df){return _0x33a16e[_0xeb98('0x8')]('MailSubstatus',attributes,{'tableName':_0xeb98('0x9'),'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 ca9d152..357a54f 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 _0x6f0d=['MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent'];(function(_0x14fecb,_0x479142){var _0x53a8ba=function(_0x3e032c){while(--_0x3e032c){_0x14fecb['push'](_0x14fecb['shift']());}};_0x53a8ba(++_0x479142);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x4f2840,_0x1369cf){_0x4f2840=_0x4f2840-0x0;var _0x1c91cb=_0x6f0d[_0x4f2840];return _0x1c91cb;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f0('0x4'))['db'];var utils=require(_0xd6f0('0x5'));var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6f0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe21ac4,_0x1af29c,_0x8b89a9){return new BPromise(function(_0x1a48a0,_0x4c4916){return client['request'](_0xe21ac4,_0x8b89a9)[_0xd6f0('0xa')](function(_0x272c4e){logger[_0xd6f0('0xb')](_0xd6f0('0xc'),_0x1af29c,_0xd6f0('0xd'));logger['debug'](_0xd6f0('0xe'),_0x1af29c,_0xd6f0('0xd'),JSON[_0xd6f0('0xf')](_0x272c4e));if(_0x272c4e[_0xd6f0('0x10')]){if(_0x272c4e['error'][_0xd6f0('0x11')]===0x1f4){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);return _0x4c4916(_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);}logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e['error'][_0xd6f0('0x12')]);return _0x1a48a0(_0x272c4e[_0xd6f0('0x10')]['message']);}else{logger[_0xd6f0('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x1af29c,_0xd6f0('0xd'));_0x1a48a0(_0x272c4e[_0xd6f0('0x13')][_0xd6f0('0x12')]);}})[_0xd6f0('0x14')](function(_0x64ff5f){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x64ff5f);_0x4c4916(_0x64ff5f);});});} \ No newline at end of file +var _0xa75b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3ff1ae,_0x373d43){var _0x35b378=function(_0x2f48e8){while(--_0x2f48e8){_0x3ff1ae['push'](_0x3ff1ae['shift']());}};_0x35b378(++_0x373d43);}(_0xa75b,0x170));var _0xba75=function(_0x1b7fce,_0xfcfbcd){_0x1b7fce=_0x1b7fce-0x0;var _0x281776=_0xa75b[_0x1b7fce];return _0x281776;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xba75('0x1'));var rs=require(_0xba75('0x2'));var fs=require('fs');var Redis=require(_0xba75('0x3'));var db=require(_0xba75('0x4'))['db'];var utils=require(_0xba75('0x5'));var logger=require(_0xba75('0x6'))(_0xba75('0x7'));var config=require(_0xba75('0x8'));var jayson=require(_0xba75('0x9'));var client=jayson[_0xba75('0xa')][_0xba75('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x238a33,_0x3ccab5,_0x5c79e3){return new BPromise(function(_0x4b842d,_0x731cae){return client['request'](_0x238a33,_0x5c79e3)['then'](function(_0x218dbd){logger['info'](_0xba75('0xc'),_0x3ccab5,_0xba75('0xd'));logger[_0xba75('0xe')](_0xba75('0xf'),_0x3ccab5,_0xba75('0xd'),JSON[_0xba75('0x10')](_0x218dbd));if(_0x218dbd[_0xba75('0x11')]){if(_0x218dbd[_0xba75('0x11')][_0xba75('0x12')]===0x1f4){logger[_0xba75('0x11')](_0xba75('0xc'),_0x3ccab5,_0x218dbd[_0xba75('0x11')]['message']);return _0x731cae(_0x218dbd['error'][_0xba75('0x13')]);}logger['error'](_0xba75('0xc'),_0x3ccab5,_0x218dbd[_0xba75('0x11')][_0xba75('0x13')]);return _0x4b842d(_0x218dbd[_0xba75('0x11')]['message']);}else{logger[_0xba75('0x14')](_0xba75('0xc'),_0x3ccab5,_0xba75('0xd'));_0x4b842d(_0x218dbd[_0xba75('0x15')][_0xba75('0x13')]);}})['catch'](function(_0x350a9d){logger[_0xba75('0x11')](_0xba75('0xc'),_0x3ccab5,_0x350a9d);_0x731cae(_0x350a9d);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index c712852..33ae7b8 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 _0x8326=['update','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id'];(function(_0x5e7577,_0x2c0c4e){var _0x122cf9=function(_0x5ece39){while(--_0x5ece39){_0x5e7577['push'](_0x5e7577['shift']());}};_0x122cf9(++_0x2c0c4e);}(_0x8326,0x1d5));var _0x6832=function(_0xc415c7,_0x5239ce){_0xc415c7=_0xc415c7-0x0;var _0x2e3806=_0x8326[_0xc415c7];return _0x2e3806;};'use strict';var multer=require(_0x6832('0x0'));var util=require('util');var path=require(_0x6832('0x1'));var timeout=require('connect-timeout');var express=require(_0x6832('0x2'));var router=express[_0x6832('0x3')]();var auth=require(_0x6832('0x4'));var interaction=require(_0x6832('0x5'));var config=require(_0x6832('0x6'));var controller=require(_0x6832('0x7'));router[_0x6832('0x8')]('/',auth[_0x6832('0x9')](),controller['index']);router[_0x6832('0x8')](_0x6832('0xa'),auth['isAuthenticated'](),controller[_0x6832('0xb')]);router[_0x6832('0x8')]('/:id',auth[_0x6832('0x9')](),controller[_0x6832('0xc')]);router[_0x6832('0xd')]('/',auth[_0x6832('0x9')](),controller[_0x6832('0xe')]);router[_0x6832('0xf')](_0x6832('0x10'),auth[_0x6832('0x9')](),controller[_0x6832('0x11')]);router['delete']('/:id',auth[_0x6832('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xea33=['path','connect-timeout','express','Router','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','post','put','update','delete','destroy','exports','multer','util'];(function(_0x25f805,_0x59caf3){var _0xf6628f=function(_0x3cb938){while(--_0x3cb938){_0x25f805['push'](_0x25f805['shift']());}};_0xf6628f(++_0x59caf3);}(_0xea33,0x167));var _0x3ea3=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xea33[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x3ea3('0x0'));var util=require(_0x3ea3('0x1'));var path=require(_0x3ea3('0x2'));var timeout=require(_0x3ea3('0x3'));var express=require(_0x3ea3('0x4'));var router=express[_0x3ea3('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x3ea3('0x6'));var config=require('../../config/environment');var controller=require(_0x3ea3('0x7'));router[_0x3ea3('0x8')]('/',auth[_0x3ea3('0x9')](),controller[_0x3ea3('0xa')]);router[_0x3ea3('0x8')](_0x3ea3('0xb'),auth['isAuthenticated'](),controller[_0x3ea3('0xc')]);router[_0x3ea3('0x8')]('/:id',auth[_0x3ea3('0x9')](),controller['show']);router[_0x3ea3('0xd')]('/',auth[_0x3ea3('0x9')](),controller['create']);router[_0x3ea3('0xe')]('/:id',auth[_0x3ea3('0x9')](),controller[_0x3ea3('0xf')]);router[_0x3ea3('0x10')]('/:id',auth[_0x3ea3('0x9')](),controller[_0x3ea3('0x11')]);module[_0x3ea3('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 0b71542..f33d58a 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 _0x40d1=['agent','queue','NOW','sequelize','exports','STRING','ENUM','account'];(function(_0x45dd0e,_0x28e603){var _0x50e5ca=function(_0x46a412){while(--_0x46a412){_0x45dd0e['push'](_0x45dd0e['shift']());}};_0x50e5ca(++_0x28e603);}(_0x40d1,0x173));var _0x140d=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x40d1[_0x618414];return _0x21c19a;};'use strict';var moment=require('moment');var Sequelize=require(_0x140d('0x0'));module[_0x140d('0x1')]={'uniqueid':{'type':Sequelize[_0x140d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x140d('0x3')](_0x140d('0x4'),_0x140d('0x5'),_0x140d('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x140d('0x7')]}}; \ No newline at end of file +var _0xdd06=['sequelize','exports','STRING','ENUM','agent','NOW'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd06,0x6c));var _0x6dd0=function(_0x247b0b,_0x3df01f){_0x247b0b=_0x247b0b-0x0;var _0x44dfde=_0xdd06[_0x247b0b];return _0x44dfde;};'use strict';var moment=require('moment');var Sequelize=require(_0x6dd0('0x0'));module[_0x6dd0('0x1')]={'uniqueid':{'type':Sequelize[_0x6dd0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6dd0('0x3')]('account',_0x6dd0('0x4'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x6dd0('0x5')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 5a1e2bb..1ac747a 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 _0x8ca9=['fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','update','destroy','find','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','json','apply','reject','then','error','stack','name','send','index','MailTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes'];(function(_0x4108e8,_0x26ec7d){var _0x34290c=function(_0x497634){while(--_0x497634){_0x4108e8['push'](_0x4108e8['shift']());}};_0x34290c(++_0x26ec7d);}(_0x8ca9,0xf1));var _0x98ca=function(_0x45ead0,_0x6b09d8){_0x45ead0=_0x45ead0-0x0;var _0x5698c7=_0x8ca9[_0x45ead0];return _0x5698c7;};'use strict';var pdf=require(_0x98ca('0x0'));var emlformat=require(_0x98ca('0x1'));var rimraf=require(_0x98ca('0x2'));var zipdir=require(_0x98ca('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x98ca('0x4'));var moment=require(_0x98ca('0x5'));var BPromise=require(_0x98ca('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x98ca('0x7'));var csv=require(_0x98ca('0x8'));var ejs=require(_0x98ca('0x9'));var fs=require('fs');var _=require(_0x98ca('0xa'));var squel=require(_0x98ca('0xb'));var crypto=require(_0x98ca('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x98ca('0xd'));var toCsv=require(_0x98ca('0x8'));var querystring=require(_0x98ca('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x98ca('0xf'));var qs=require(_0x98ca('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x98ca('0x11'));var utils=require(_0x98ca('0x12'));var config=require('../../config/environment');var db=require(_0x98ca('0x13'))['db'];function respondWithStatusCode(_0x1799cc,_0x15fb99){_0x15fb99=_0x15fb99||0xcc;return function(_0x2db443){if(_0x2db443){return _0x1799cc[_0x98ca('0x14')](_0x15fb99);}return _0x1799cc[_0x98ca('0x15')](_0x15fb99)[_0x98ca('0x16')]();};}function respondWithResult(_0xf8ae7b,_0x4a1f39){_0x4a1f39=_0x4a1f39||0xc8;return function(_0x28ef78){if(_0x28ef78){return _0xf8ae7b[_0x98ca('0x15')](_0x4a1f39)['json'](_0x28ef78);}};}function respondWithFilteredResult(_0x3458cd,_0x19933e){return function(_0x311969){if(_0x311969){var _0x4e1a12=_0x311969[_0x98ca('0x17')],_0x5d18dc=_0x19933e[_0x98ca('0x18')],_0x406be0=_0x19933e['offset']+_0x19933e[_0x98ca('0x19')],_0x4b522d;if(_0x406be0>=_0x4e1a12){_0x406be0=_0x4e1a12;_0x4b522d=0xc8;}else{_0x4b522d=0xce;}_0x3458cd['status'](_0x4b522d);return _0x3458cd['set']('Content-Range',_0x5d18dc+'-'+_0x406be0+'/'+_0x4e1a12)[_0x98ca('0x1a')](_0x311969);}return null;};}function patchUpdates(_0x326ac3){return function(_0x3ff16b){try{jsonpatch[_0x98ca('0x1b')](_0x3ff16b,_0x326ac3,!![]);}catch(_0x59f2e2){return BPromise[_0x98ca('0x1c')](_0x59f2e2);}return _0x3ff16b['save']();};}function saveUpdates(_0x56e516,_0x174d69){return function(_0x52fe16){if(_0x52fe16){return _0x52fe16['update'](_0x56e516)[_0x98ca('0x1d')](function(_0x2d37bf){return _0x2d37bf;});}return null;};}function removeEntity(_0x2aaac2,_0x3b8e20){return function(_0x463881){if(_0x463881){return _0x463881['destroy']()[_0x98ca('0x1d')](function(){_0x2aaac2[_0x98ca('0x15')](0xcc)[_0x98ca('0x16')]();});}};}function handleEntityNotFound(_0x797d5e,_0x561610){return function(_0x5ba9a4){if(!_0x5ba9a4){_0x797d5e[_0x98ca('0x14')](0x194);}return _0x5ba9a4;};}function handleError(_0x34b651,_0x2ab091){_0x2ab091=_0x2ab091||0x1f4;return function(_0x562584){logger[_0x98ca('0x1e')](_0x562584[_0x98ca('0x1f')]);if(_0x562584['name']){delete _0x562584[_0x98ca('0x20')];}_0x34b651[_0x98ca('0x15')](_0x2ab091)[_0x98ca('0x21')](_0x562584);};}exports[_0x98ca('0x22')]=function(_0xc8295c,_0x522941){var _0x2d1e1a={},_0xe43073={},_0x3efeac={'count':0x0,'rows':[]};var _0x2570d1=db[_0x98ca('0x23')][_0x98ca('0x24')];_0xe43073[_0x98ca('0x25')]=_[_0x98ca('0x26')](_0x2570d1);_0xe43073[_0x98ca('0x27')]=_[_0x98ca('0x26')](_0xc8295c[_0x98ca('0x27')]);_0xe43073[_0x98ca('0x28')]=_[_0x98ca('0x29')](_0xe43073[_0x98ca('0x25')],_0xe43073[_0x98ca('0x27')]);_0x2d1e1a[_0x98ca('0x2a')]=_[_0x98ca('0x29')](_0xe43073[_0x98ca('0x25')],qs[_0x98ca('0x2b')](_0xc8295c[_0x98ca('0x27')][_0x98ca('0x2b')]));_0x2d1e1a['attributes']=_0x2d1e1a[_0x98ca('0x2a')][_0x98ca('0x2c')]?_0x2d1e1a[_0x98ca('0x2a')]:_0xe43073[_0x98ca('0x25')];if(!_0xc8295c[_0x98ca('0x27')][_0x98ca('0x2d')](_0x98ca('0x2e'))){_0x2d1e1a[_0x98ca('0x19')]=qs['limit'](_0xc8295c[_0x98ca('0x27')]['limit']);_0x2d1e1a['offset']=qs[_0x98ca('0x18')](_0xc8295c[_0x98ca('0x27')][_0x98ca('0x18')]);}_0x2d1e1a[_0x98ca('0x2f')]=qs[_0x98ca('0x30')](_0xc8295c[_0x98ca('0x27')]['sort']);_0x2d1e1a['where']=qs['filters'](_[_0x98ca('0x31')](_0xc8295c[_0x98ca('0x27')],_0xe43073['filters']));if(_0xc8295c['query'][_0x98ca('0x32')]){_0x2d1e1a[_0x98ca('0x33')]=_[_0x98ca('0x34')](_0x2d1e1a[_0x98ca('0x33')],{'$or':_[_0x98ca('0x35')](_0x2570d1,function(_0x2abb4a){if(_0x2abb4a[_0x98ca('0x36')][_0x98ca('0x37')]!==_0x98ca('0x38')){var _0x29440b={};_0x29440b[_0x2abb4a['field']]={'$like':'%'+_0xc8295c[_0x98ca('0x27')][_0x98ca('0x32')]+'%'};return _0x29440b;}})});}_0x2d1e1a=_[_0x98ca('0x34')]({},_0x2d1e1a,_0xc8295c[_0x98ca('0x39')]);var _0xabc2cb={'where':_0x2d1e1a[_0x98ca('0x33')]};return db['MailTransferReport']['count'](_0xabc2cb)[_0x98ca('0x1d')](function(_0x2cff03){_0x3efeac[_0x98ca('0x17')]=_0x2cff03;if(_0xc8295c[_0x98ca('0x27')][_0x98ca('0x3a')]){_0x2d1e1a[_0x98ca('0x3b')]=[{'all':!![]}];}return db[_0x98ca('0x23')][_0x98ca('0x3c')](_0x2d1e1a);})['then'](function(_0x552064){_0x3efeac[_0x98ca('0x3d')]=_0x552064;return _0x3efeac;})[_0x98ca('0x1d')](respondWithFilteredResult(_0x522941,_0x2d1e1a))[_0x98ca('0x3e')](handleError(_0x522941,null));};exports[_0x98ca('0x3f')]=function(_0x296504,_0x761cee){var _0xf19db3={'raw':!![],'where':{'id':_0x296504[_0x98ca('0x40')]['id']}},_0x2875a1={};_0x2875a1[_0x98ca('0x25')]=_['keys'](db[_0x98ca('0x23')][_0x98ca('0x24')]);_0x2875a1[_0x98ca('0x27')]=_[_0x98ca('0x26')](_0x296504[_0x98ca('0x27')]);_0x2875a1[_0x98ca('0x28')]=_[_0x98ca('0x29')](_0x2875a1[_0x98ca('0x25')],_0x2875a1[_0x98ca('0x27')]);_0xf19db3['attributes']=_['intersection'](_0x2875a1['model'],qs[_0x98ca('0x2b')](_0x296504[_0x98ca('0x27')]['fields']));_0xf19db3[_0x98ca('0x2a')]=_0xf19db3[_0x98ca('0x2a')][_0x98ca('0x2c')]?_0xf19db3[_0x98ca('0x2a')]:_0x2875a1[_0x98ca('0x25')];if(_0x296504[_0x98ca('0x27')]['includeAll']){_0xf19db3[_0x98ca('0x3b')]=[{'all':!![]}];}_0xf19db3=_['merge']({},_0xf19db3,_0x296504[_0x98ca('0x39')]);return db[_0x98ca('0x23')]['find'](_0xf19db3)[_0x98ca('0x1d')](handleEntityNotFound(_0x761cee,null))['then'](respondWithResult(_0x761cee,null))[_0x98ca('0x3e')](handleError(_0x761cee,null));};exports[_0x98ca('0x41')]=function(_0x266ddf,_0x48e576){return db[_0x98ca('0x23')][_0x98ca('0x41')](_0x266ddf[_0x98ca('0x42')],{})[_0x98ca('0x1d')](respondWithResult(_0x48e576,0xc9))['catch'](handleError(_0x48e576,null));};exports[_0x98ca('0x43')]=function(_0x5b6250,_0x4cf5d9){if(_0x5b6250[_0x98ca('0x42')]['id']){delete _0x5b6250['body']['id'];}return db[_0x98ca('0x23')]['find']({'where':{'id':_0x5b6250[_0x98ca('0x40')]['id']}})['then'](handleEntityNotFound(_0x4cf5d9,null))[_0x98ca('0x1d')](saveUpdates(_0x5b6250[_0x98ca('0x42')],null))[_0x98ca('0x1d')](respondWithResult(_0x4cf5d9,null))[_0x98ca('0x3e')](handleError(_0x4cf5d9,null));};exports[_0x98ca('0x44')]=function(_0x5409cb,_0x457f13){return db[_0x98ca('0x23')][_0x98ca('0x45')]({'where':{'id':_0x5409cb['params']['id']}})[_0x98ca('0x1d')](handleEntityNotFound(_0x457f13,null))['then'](removeEntity(_0x457f13,null))[_0x98ca('0x3e')](handleError(_0x457f13,null));};exports[_0x98ca('0x46')]=function(_0x3eb128,_0x2b704b){return db['MailTransferReport']['describe']()[_0x98ca('0x1d')](respondWithResult(_0x2b704b,null))[_0x98ca('0x3e')](handleError(_0x2b704b,null));}; \ No newline at end of file +var _0x3133=['bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','save','update','then','end','name','send','index','MailTransferReport','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','key','options','count','includeAll','include','catch','params','rawAttributes','find','create','body','destroy','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x2535f2,_0xd4214d){var _0x323199=function(_0x292648){while(--_0x292648){_0x2535f2['push'](_0x2535f2['shift']());}};_0x323199(++_0xd4214d);}(_0x3133,0x149));var _0x3313=function(_0x4c408c,_0x4aa273){_0x4c408c=_0x4c408c-0x0;var _0x4a19e0=_0x3133[_0x4c408c];return _0x4a19e0;};'use strict';var pdf=require(_0x3313('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3313('0x1'));var zipdir=require(_0x3313('0x2'));var jsonpatch=require(_0x3313('0x3'));var rp=require(_0x3313('0x4'));var moment=require(_0x3313('0x5'));var BPromise=require(_0x3313('0x6'));var Mustache=require(_0x3313('0x7'));var util=require(_0x3313('0x8'));var path=require(_0x3313('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3313('0xa'));var fs=require('fs');var _=require(_0x3313('0xb'));var squel=require('squel');var crypto=require(_0x3313('0xc'));var jsforce=require(_0x3313('0xd'));var deskjs=require(_0x3313('0xe'));var toCsv=require(_0x3313('0xf'));var querystring=require('querystring');var Papa=require(_0x3313('0x10'));var Redis=require('ioredis');var authService=require(_0x3313('0x11'));var qs=require(_0x3313('0x12'));var hardwareService=require(_0x3313('0x13'));var logger=require('../../config/logger')(_0x3313('0x14'));var utils=require(_0x3313('0x15'));var config=require(_0x3313('0x16'));var db=require(_0x3313('0x17'))['db'];function respondWithStatusCode(_0x341dbb,_0x24e68a){_0x24e68a=_0x24e68a||0xcc;return function(_0x33a53f){if(_0x33a53f){return _0x341dbb[_0x3313('0x18')](_0x24e68a);}return _0x341dbb[_0x3313('0x19')](_0x24e68a)['end']();};}function respondWithResult(_0x4037f2,_0x30644e){_0x30644e=_0x30644e||0xc8;return function(_0x5df85d){if(_0x5df85d){return _0x4037f2[_0x3313('0x19')](_0x30644e)[_0x3313('0x1a')](_0x5df85d);}};}function respondWithFilteredResult(_0x3ee512,_0x18073d){return function(_0x573573){if(_0x573573){var _0x3243c9=_0x573573['count'],_0x350ed0=_0x18073d[_0x3313('0x1b')],_0x22def0=_0x18073d[_0x3313('0x1b')]+_0x18073d['limit'],_0x24023c;if(_0x22def0>=_0x3243c9){_0x22def0=_0x3243c9;_0x24023c=0xc8;}else{_0x24023c=0xce;}_0x3ee512[_0x3313('0x19')](_0x24023c);return _0x3ee512[_0x3313('0x1c')]('Content-Range',_0x350ed0+'-'+_0x22def0+'/'+_0x3243c9)[_0x3313('0x1a')](_0x573573);}return null;};}function patchUpdates(_0x19b81d){return function(_0x58cc94){try{jsonpatch['apply'](_0x58cc94,_0x19b81d,!![]);}catch(_0x40283d){return BPromise['reject'](_0x40283d);}return _0x58cc94[_0x3313('0x1d')]();};}function saveUpdates(_0x188ded,_0x3fa77b){return function(_0x490a61){if(_0x490a61){return _0x490a61[_0x3313('0x1e')](_0x188ded)[_0x3313('0x1f')](function(_0x359326){return _0x359326;});}return null;};}function removeEntity(_0x556ab0,_0xa30900){return function(_0x27cfc5){if(_0x27cfc5){return _0x27cfc5['destroy']()[_0x3313('0x1f')](function(){_0x556ab0[_0x3313('0x19')](0xcc)[_0x3313('0x20')]();});}};}function handleEntityNotFound(_0x218784,_0x389a80){return function(_0x5bab2e){if(!_0x5bab2e){_0x218784[_0x3313('0x18')](0x194);}return _0x5bab2e;};}function handleError(_0x14a0a4,_0x4dc5bc){_0x4dc5bc=_0x4dc5bc||0x1f4;return function(_0x2c8f76){logger['error'](_0x2c8f76['stack']);if(_0x2c8f76[_0x3313('0x21')]){delete _0x2c8f76[_0x3313('0x21')];}_0x14a0a4[_0x3313('0x19')](_0x4dc5bc)[_0x3313('0x22')](_0x2c8f76);};}exports[_0x3313('0x23')]=function(_0xfc11a5,_0x555ade){var _0x5d461b={},_0x22cccc={},_0x46e800={'count':0x0,'rows':[]};var _0x1b4c0d=db[_0x3313('0x24')]['rawAttributes'];_0x22cccc[_0x3313('0x25')]=_[_0x3313('0x26')](_0x1b4c0d);_0x22cccc[_0x3313('0x27')]=_['keys'](_0xfc11a5[_0x3313('0x27')]);_0x22cccc[_0x3313('0x28')]=_['intersection'](_0x22cccc[_0x3313('0x25')],_0x22cccc[_0x3313('0x27')]);_0x5d461b['attributes']=_[_0x3313('0x29')](_0x22cccc['model'],qs[_0x3313('0x2a')](_0xfc11a5[_0x3313('0x27')][_0x3313('0x2a')]));_0x5d461b['attributes']=_0x5d461b[_0x3313('0x2b')][_0x3313('0x2c')]?_0x5d461b[_0x3313('0x2b')]:_0x22cccc[_0x3313('0x25')];if(!_0xfc11a5['query'][_0x3313('0x2d')](_0x3313('0x2e'))){_0x5d461b[_0x3313('0x2f')]=qs['limit'](_0xfc11a5['query'][_0x3313('0x2f')]);_0x5d461b[_0x3313('0x1b')]=qs['offset'](_0xfc11a5[_0x3313('0x27')][_0x3313('0x1b')]);}_0x5d461b[_0x3313('0x30')]=qs['sort'](_0xfc11a5[_0x3313('0x27')][_0x3313('0x31')]);_0x5d461b[_0x3313('0x32')]=qs[_0x3313('0x28')](_['pick'](_0xfc11a5['query'],_0x22cccc[_0x3313('0x28')]));if(_0xfc11a5['query'][_0x3313('0x33')]){_0x5d461b[_0x3313('0x32')]=_[_0x3313('0x34')](_0x5d461b[_0x3313('0x32')],{'$or':_['map'](_0x1b4c0d,function(_0x1e4473){if(_0x1e4473[_0x3313('0x35')][_0x3313('0x36')]!=='VIRTUAL'){var _0x245d17={};_0x245d17[_0x1e4473['field']]={'$like':'%'+_0xfc11a5[_0x3313('0x27')][_0x3313('0x33')]+'%'};return _0x245d17;}})});}_0x5d461b=_['merge']({},_0x5d461b,_0xfc11a5[_0x3313('0x37')]);var _0x298378={'where':_0x5d461b['where']};return db['MailTransferReport']['count'](_0x298378)[_0x3313('0x1f')](function(_0x72f716){_0x46e800[_0x3313('0x38')]=_0x72f716;if(_0xfc11a5[_0x3313('0x27')][_0x3313('0x39')]){_0x5d461b[_0x3313('0x3a')]=[{'all':!![]}];}return db[_0x3313('0x24')]['findAll'](_0x5d461b);})[_0x3313('0x1f')](function(_0x365066){_0x46e800['rows']=_0x365066;return _0x46e800;})[_0x3313('0x1f')](respondWithFilteredResult(_0x555ade,_0x5d461b))[_0x3313('0x3b')](handleError(_0x555ade,null));};exports['show']=function(_0x40e6c3,_0x15b3b2){var _0x1fd18a={'raw':!![],'where':{'id':_0x40e6c3[_0x3313('0x3c')]['id']}},_0x340e51={};_0x340e51['model']=_['keys'](db['MailTransferReport'][_0x3313('0x3d')]);_0x340e51[_0x3313('0x27')]=_[_0x3313('0x26')](_0x40e6c3[_0x3313('0x27')]);_0x340e51['filters']=_[_0x3313('0x29')](_0x340e51[_0x3313('0x25')],_0x340e51[_0x3313('0x27')]);_0x1fd18a['attributes']=_[_0x3313('0x29')](_0x340e51['model'],qs['fields'](_0x40e6c3['query'][_0x3313('0x2a')]));_0x1fd18a['attributes']=_0x1fd18a[_0x3313('0x2b')][_0x3313('0x2c')]?_0x1fd18a[_0x3313('0x2b')]:_0x340e51[_0x3313('0x25')];if(_0x40e6c3[_0x3313('0x27')][_0x3313('0x39')]){_0x1fd18a['include']=[{'all':!![]}];}_0x1fd18a=_[_0x3313('0x34')]({},_0x1fd18a,_0x40e6c3[_0x3313('0x37')]);return db[_0x3313('0x24')][_0x3313('0x3e')](_0x1fd18a)[_0x3313('0x1f')](handleEntityNotFound(_0x15b3b2,null))[_0x3313('0x1f')](respondWithResult(_0x15b3b2,null))[_0x3313('0x3b')](handleError(_0x15b3b2,null));};exports[_0x3313('0x3f')]=function(_0x35319a,_0x1d59bc){return db[_0x3313('0x24')][_0x3313('0x3f')](_0x35319a[_0x3313('0x40')],{})[_0x3313('0x1f')](respondWithResult(_0x1d59bc,0xc9))[_0x3313('0x3b')](handleError(_0x1d59bc,null));};exports[_0x3313('0x1e')]=function(_0x388500,_0x383d9c){if(_0x388500[_0x3313('0x40')]['id']){delete _0x388500[_0x3313('0x40')]['id'];}return db[_0x3313('0x24')]['find']({'where':{'id':_0x388500[_0x3313('0x3c')]['id']}})[_0x3313('0x1f')](handleEntityNotFound(_0x383d9c,null))[_0x3313('0x1f')](saveUpdates(_0x388500[_0x3313('0x40')],null))['then'](respondWithResult(_0x383d9c,null))[_0x3313('0x3b')](handleError(_0x383d9c,null));};exports[_0x3313('0x41')]=function(_0x162e84,_0x33b3d4){return db[_0x3313('0x24')][_0x3313('0x3e')]({'where':{'id':_0x162e84['params']['id']}})[_0x3313('0x1f')](handleEntityNotFound(_0x33b3d4,null))[_0x3313('0x1f')](removeEntity(_0x33b3d4,null))[_0x3313('0x3b')](handleError(_0x33b3d4,null));};exports['describe']=function(_0x5de15c,_0x5aae50){return db[_0x3313('0x24')][_0x3313('0x42')]()[_0x3313('0x1f')](respondWithResult(_0x5aae50,null))[_0x3313('0x3b')](handleError(_0x5aae50,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 22742f4..058050b 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 _0xaf98=['request-promise','../../config/environment','exports','define','MailTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xaf98,0x1ce));var _0x8af9=function(_0x5667a7,_0x4960bf){_0x5667a7=_0x5667a7-0x0;var _0x5188ac=_0xaf98[_0x5667a7];return _0x5188ac;};'use strict';var _=require(_0x8af9('0x0'));var util=require(_0x8af9('0x1'));var logger=require(_0x8af9('0x2'))(_0x8af9('0x3'));var moment=require(_0x8af9('0x4'));var BPromise=require(_0x8af9('0x5'));var rp=require(_0x8af9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8af9('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0x8af9('0x8')]=function(_0x1f8471,_0x3aad0c){return _0x1f8471[_0x8af9('0x9')](_0x8af9('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x8af9('0xb'),'fields':[_0x8af9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x164e=['../../config/logger','api','moment','bluebird','path','rimraf','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash'];(function(_0x3a4303,_0x39df7c){var _0x43ec8b=function(_0x22b831){while(--_0x22b831){_0x3a4303['push'](_0x3a4303['shift']());}};_0x43ec8b(++_0x39df7c);}(_0x164e,0x1a3));var _0xe164=function(_0x365b03,_0x251a56){_0x365b03=_0x365b03-0x0;var _0x49426a=_0x164e[_0x365b03];return _0x49426a;};'use strict';var _=require(_0xe164('0x0'));var util=require('util');var logger=require(_0xe164('0x1'))(_0xe164('0x2'));var moment=require(_0xe164('0x3'));var BPromise=require(_0xe164('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe164('0x5'));var rimraf=require(_0xe164('0x6'));var config=require('../../config/environment');var attributes=require(_0xe164('0x7'));module[_0xe164('0x8')]=function(_0x1c8742,_0x2daafe){return _0x1c8742[_0xe164('0x9')]('MailTransferReport',attributes,{'tableName':_0xe164('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe164('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index c577ab2..82f0207 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 _0x7899=['code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2fffd5,_0xb8a1e4){var _0x120dc0=function(_0x4f5c1f){while(--_0x4f5c1f){_0x2fffd5['push'](_0x2fffd5['shift']());}};_0x120dc0(++_0xb8a1e4);}(_0x7899,0x18e));var _0x9789=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0x7899[_0x2e2681];return _0x368a64;};'use strict';var _=require(_0x9789('0x0'));var util=require(_0x9789('0x1'));var moment=require(_0x9789('0x2'));var BPromise=require(_0x9789('0x3'));var rs=require(_0x9789('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9789('0x5'))['db'];var utils=require(_0x9789('0x6'));var logger=require(_0x9789('0x7'))(_0x9789('0x8'));var config=require(_0x9789('0x9'));var jayson=require(_0x9789('0xa'));var client=jayson[_0x9789('0xb')][_0x9789('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47031c,_0x5b452c,_0x652eae){return new BPromise(function(_0x2bd67d,_0x330746){return client[_0x9789('0xd')](_0x47031c,_0x652eae)['then'](function(_0x240dbe){logger[_0x9789('0xe')](_0x9789('0xf'),_0x5b452c,_0x9789('0x10'));logger['debug'](_0x9789('0x11'),_0x5b452c,'request\x20sent',JSON[_0x9789('0x12')](_0x240dbe));if(_0x240dbe['error']){if(_0x240dbe[_0x9789('0x13')][_0x9789('0x14')]===0x1f4){logger[_0x9789('0x13')](_0x9789('0xf'),_0x5b452c,_0x240dbe[_0x9789('0x13')]['message']);return _0x330746(_0x240dbe[_0x9789('0x13')]['message']);}logger[_0x9789('0x13')](_0x9789('0xf'),_0x5b452c,_0x240dbe[_0x9789('0x13')]['message']);return _0x2bd67d(_0x240dbe[_0x9789('0x13')]['message']);}else{logger[_0x9789('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x5b452c,'request\x20sent');_0x2bd67d(_0x240dbe['result'][_0x9789('0x15')]);}})['catch'](function(_0x2aa695){logger['error'](_0x9789('0xf'),_0x5b452c,_0x2aa695);_0x330746(_0x2aa695);});});} \ No newline at end of file +var _0xa126=['client','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0xe09dec,_0x1eed30){var _0x5777ab=function(_0x2c65a9){while(--_0x2c65a9){_0xe09dec['push'](_0xe09dec['shift']());}};_0x5777ab(++_0x1eed30);}(_0xa126,0xf2));var _0x6a12=function(_0x1dba61,_0x2c16a1){_0x1dba61=_0x1dba61-0x0;var _0x3138a0=_0xa126[_0x1dba61];return _0x3138a0;};'use strict';var _=require(_0x6a12('0x0'));var util=require(_0x6a12('0x1'));var moment=require(_0x6a12('0x2'));var BPromise=require('bluebird');var rs=require(_0x6a12('0x3'));var fs=require('fs');var Redis=require(_0x6a12('0x4'));var db=require(_0x6a12('0x5'))['db'];var utils=require(_0x6a12('0x6'));var logger=require('../../config/logger')(_0x6a12('0x7'));var config=require(_0x6a12('0x8'));var jayson=require(_0x6a12('0x9'));var client=jayson[_0x6a12('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f2ad5,_0x308910,_0x5629ed){return new BPromise(function(_0x6bae1a,_0x327858){return client['request'](_0x1f2ad5,_0x5629ed)['then'](function(_0x19acca){logger[_0x6a12('0xb')](_0x6a12('0xc'),_0x308910,_0x6a12('0xd'));logger[_0x6a12('0xe')](_0x6a12('0xf'),_0x308910,_0x6a12('0xd'),JSON[_0x6a12('0x10')](_0x19acca));if(_0x19acca['error']){if(_0x19acca[_0x6a12('0x11')][_0x6a12('0x12')]===0x1f4){logger[_0x6a12('0x11')](_0x6a12('0xc'),_0x308910,_0x19acca[_0x6a12('0x11')][_0x6a12('0x13')]);return _0x327858(_0x19acca['error']['message']);}logger['error'](_0x6a12('0xc'),_0x308910,_0x19acca['error'][_0x6a12('0x13')]);return _0x6bae1a(_0x19acca['error']['message']);}else{logger[_0x6a12('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x308910,_0x6a12('0xd'));_0x6bae1a(_0x19acca[_0x6a12('0x14')]['message']);}})['catch'](function(_0x488a3d){logger['error'](_0x6a12('0xc'),_0x308910,_0x488a3d);_0x327858(_0x488a3d);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 648931c..b0234d5 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 _0x596e=['create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','show','post'];(function(_0x29d623,_0x1a5c9c){var _0x242e59=function(_0x2c78ab){while(--_0x2c78ab){_0x29d623['push'](_0x29d623['shift']());}};_0x242e59(++_0x1a5c9c);}(_0x596e,0xb1));var _0xe596=function(_0x20044e,_0x4a5aec){_0x20044e=_0x20044e-0x0;var _0x3d56f6=_0x596e[_0x20044e];return _0x3d56f6;};'use strict';var multer=require(_0xe596('0x0'));var util=require(_0xe596('0x1'));var path=require(_0xe596('0x2'));var timeout=require(_0xe596('0x3'));var express=require('express');var router=express[_0xe596('0x4')]();var auth=require(_0xe596('0x5'));var interaction=require(_0xe596('0x6'));var config=require(_0xe596('0x7'));var controller=require('./memberReport.controller');router[_0xe596('0x8')]('/',auth[_0xe596('0x9')](),controller['index']);router[_0xe596('0x8')](_0xe596('0xa'),auth[_0xe596('0x9')](),controller['describe']);router[_0xe596('0x8')]('/:id',auth[_0xe596('0x9')](),controller[_0xe596('0xb')]);router[_0xe596('0xc')]('/',auth['isAuthenticated'](),controller[_0xe596('0xd')]);router[_0xe596('0xe')](_0xe596('0xf'),auth[_0xe596('0x9')](),controller[_0xe596('0x10')]);router[_0xe596('0x11')](_0xe596('0xf'),auth[_0xe596('0x9')](),controller['destroy']);module[_0xe596('0x12')]=router; \ No newline at end of file +var _0xcb69=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put'];(function(_0x32e2b2,_0x231202){var _0x49c6f8=function(_0x25db61){while(--_0x25db61){_0x32e2b2['push'](_0x32e2b2['shift']());}};_0x49c6f8(++_0x231202);}(_0xcb69,0xab));var _0x9cb6=function(_0xf8a5a1,_0x5b693f){_0xf8a5a1=_0xf8a5a1-0x0;var _0x38ba72=_0xcb69[_0xf8a5a1];return _0x38ba72;};'use strict';var multer=require(_0x9cb6('0x0'));var util=require(_0x9cb6('0x1'));var path=require(_0x9cb6('0x2'));var timeout=require(_0x9cb6('0x3'));var express=require(_0x9cb6('0x4'));var router=express[_0x9cb6('0x5')]();var auth=require(_0x9cb6('0x6'));var interaction=require(_0x9cb6('0x7'));var config=require('../../config/environment');var controller=require(_0x9cb6('0x8'));router[_0x9cb6('0x9')]('/',auth['isAuthenticated'](),controller[_0x9cb6('0xa')]);router[_0x9cb6('0x9')](_0x9cb6('0xb'),auth[_0x9cb6('0xc')](),controller['describe']);router[_0x9cb6('0x9')](_0x9cb6('0xd'),auth[_0x9cb6('0xc')](),controller[_0x9cb6('0xe')]);router[_0x9cb6('0xf')]('/',auth[_0x9cb6('0xc')](),controller[_0x9cb6('0x10')]);router[_0x9cb6('0x11')](_0x9cb6('0xd'),auth[_0x9cb6('0xc')](),controller['update']);router[_0x9cb6('0x12')](_0x9cb6('0xd'),auth[_0x9cb6('0xc')](),controller[_0x9cb6('0x13')]);module[_0x9cb6('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index e9b941f..fe36e46 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 _0xf750=['talk:[start]','talk:[destination]','talk:[dial\x20string]','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]'];(function(_0xb83ec2,_0x18e73b){var _0x4d2fbf=function(_0x16538a){while(--_0x16538a){_0xb83ec2['push'](_0xb83ec2['shift']());}};_0x4d2fbf(++_0x18e73b);}(_0xf750,0x129));var _0x0f75=function(_0x416cea,_0x7d4ee0){_0x416cea=_0x416cea-0x0;var _0x43fdd4=_0xf750[_0x416cea];return _0x43fdd4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0f75('0x0'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0f75('0x1')]},'interface':{'type':Sequelize[_0x0f75('0x1')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x0f75('0x2'),'comment':_0x0f75('0x3')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x0f75('0x4')]},'exitAt':{'type':Sequelize[_0x0f75('0x4')],'set':function(_0x11f990){var _0x274039=moment(_0x11f990);var _0x3b7e45=moment(this[_0x0f75('0x5')](_0x0f75('0x6')));var _0x183727=_0x274039['diff'](_0x3b7e45,_0x0f75('0x7'));this[_0x0f75('0x8')]('exitAt',_0x11f990);this[_0x0f75('0x8')](_0x0f75('0x9'),_0x183727||null);}},'data1':{'type':Sequelize[_0x0f75('0x1')],'comment':_0x0f75('0xa')},'data2':{'type':Sequelize['STRING'],'comment':_0x0f75('0xb')},'data3':{'type':Sequelize['STRING'],'comment':_0x0f75('0xc')},'data4':{'type':Sequelize[_0x0f75('0x1')],'comment':_0x0f75('0xd')},'data5':{'type':Sequelize[_0x0f75('0x1')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x0f75('0x1')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x874b=['seconds','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff'];(function(_0x25a570,_0x4e9d32){var _0x45334e=function(_0x26b4b6){while(--_0x26b4b6){_0x25a570['push'](_0x25a570['shift']());}};_0x45334e(++_0x4e9d32);}(_0x874b,0xa6));var _0xb874=function(_0x1cfd93,_0x2e5014){_0x1cfd93=_0x1cfd93-0x0;var _0x361d75=_0x874b[_0x1cfd93];return _0x361d75;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb874('0x0'));module[_0xb874('0x1')]={'channel':{'type':Sequelize[_0xb874('0x2')]},'membername':{'type':Sequelize[_0xb874('0x2')]},'interface':{'type':Sequelize[_0xb874('0x2')]},'type':{'type':Sequelize[_0xb874('0x2')],'defaultValue':_0xb874('0x3'),'comment':_0xb874('0x4')},'duration':{'type':Sequelize[_0xb874('0x5')]},'enterAt':{'type':Sequelize[_0xb874('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x5bd093){var _0x268321=moment(_0x5bd093);var _0x1adf21=moment(this[_0xb874('0x7')](_0xb874('0x8')));var _0x52e8e4=_0x268321[_0xb874('0x9')](_0x1adf21,_0xb874('0xa'));this[_0xb874('0xb')]('exitAt',_0x5bd093);this['setDataValue']('duration',_0x52e8e4||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xb874('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0xb874('0xd')},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xb874('0x2')],'comment':_0xb874('0xe')},'data5':{'type':Sequelize[_0xb874('0x2')],'comment':_0xb874('0xf')},'role':{'type':Sequelize[_0xb874('0x2')]},'internal':{'type':Sequelize[_0xb874('0x5')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 5909e85..2be0f20 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 _0x3e74=['map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','end','error','name','send','index','MemberReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','merge'];(function(_0x1ac8ac,_0x4a7019){var _0x106ec3=function(_0x19c3cf){while(--_0x19c3cf){_0x1ac8ac['push'](_0x1ac8ac['shift']());}};_0x106ec3(++_0x4a7019);}(_0x3e74,0x175));var _0x43e7=function(_0x377f73,_0x3d60bd){_0x377f73=_0x377f73-0x0;var _0x4e0cda=_0x3e74[_0x377f73];return _0x4e0cda;};'use strict';var pdf=require(_0x43e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x43e7('0x1'));var zipdir=require(_0x43e7('0x2'));var jsonpatch=require(_0x43e7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x43e7('0x4'));var Mustache=require('mustache');var util=require(_0x43e7('0x5'));var path=require(_0x43e7('0x6'));var sox=require(_0x43e7('0x7'));var csv=require(_0x43e7('0x8'));var ejs=require(_0x43e7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x8'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var hardwareService=require(_0x43e7('0x10'));var logger=require('../../config/logger')(_0x43e7('0x11'));var utils=require('../../config/utils');var config=require(_0x43e7('0x12'));var db=require(_0x43e7('0x13'))['db'];function respondWithStatusCode(_0x4ebc8e,_0x3eb206){_0x3eb206=_0x3eb206||0xcc;return function(_0xc960ea){if(_0xc960ea){return _0x4ebc8e[_0x43e7('0x14')](_0x3eb206);}return _0x4ebc8e[_0x43e7('0x15')](_0x3eb206)['end']();};}function respondWithResult(_0x583d85,_0x2fcb36){_0x2fcb36=_0x2fcb36||0xc8;return function(_0x21fdd3){if(_0x21fdd3){return _0x583d85[_0x43e7('0x15')](_0x2fcb36)['json'](_0x21fdd3);}};}function respondWithFilteredResult(_0x5e641c,_0x16849c){return function(_0x14c146){if(_0x14c146){var _0x203378=_0x14c146[_0x43e7('0x16')],_0x328445=_0x16849c[_0x43e7('0x17')],_0x4de324=_0x16849c[_0x43e7('0x17')]+_0x16849c['limit'],_0x5c4eaa;if(_0x4de324>=_0x203378){_0x4de324=_0x203378;_0x5c4eaa=0xc8;}else{_0x5c4eaa=0xce;}_0x5e641c['status'](_0x5c4eaa);return _0x5e641c[_0x43e7('0x18')](_0x43e7('0x19'),_0x328445+'-'+_0x4de324+'/'+_0x203378)[_0x43e7('0x1a')](_0x14c146);}return null;};}function patchUpdates(_0x140657){return function(_0x3776f5){try{jsonpatch[_0x43e7('0x1b')](_0x3776f5,_0x140657,!![]);}catch(_0x619236){return BPromise[_0x43e7('0x1c')](_0x619236);}return _0x3776f5[_0x43e7('0x1d')]();};}function saveUpdates(_0xab63cf,_0x191dd5){return function(_0x177ee1){if(_0x177ee1){return _0x177ee1['update'](_0xab63cf)[_0x43e7('0x1e')](function(_0x3c6625){return _0x3c6625;});}return null;};}function removeEntity(_0x4b386b,_0x2898b5){return function(_0x3e281e){if(_0x3e281e){return _0x3e281e[_0x43e7('0x1f')]()[_0x43e7('0x1e')](function(){_0x4b386b[_0x43e7('0x15')](0xcc)[_0x43e7('0x20')]();});}};}function handleEntityNotFound(_0x54a9e7,_0x454359){return function(_0x4eea52){if(!_0x4eea52){_0x54a9e7['sendStatus'](0x194);}return _0x4eea52;};}function handleError(_0x47204e,_0x43f4ff){_0x43f4ff=_0x43f4ff||0x1f4;return function(_0x4b2b9f){logger[_0x43e7('0x21')](_0x4b2b9f['stack']);if(_0x4b2b9f[_0x43e7('0x22')]){delete _0x4b2b9f['name'];}_0x47204e[_0x43e7('0x15')](_0x43f4ff)[_0x43e7('0x23')](_0x4b2b9f);};}exports[_0x43e7('0x24')]=function(_0x405f85,_0x51f4d7){var _0x52b7b3={},_0x805b54={},_0x501551={'count':0x0,'rows':[]};var _0x2dd5f=db[_0x43e7('0x25')][_0x43e7('0x26')];_0x805b54[_0x43e7('0x27')]=_['keys'](_0x2dd5f);_0x805b54[_0x43e7('0x28')]=_[_0x43e7('0x29')](_0x405f85[_0x43e7('0x28')]);_0x805b54[_0x43e7('0x2a')]=_[_0x43e7('0x2b')](_0x805b54[_0x43e7('0x27')],_0x805b54[_0x43e7('0x28')]);_0x52b7b3[_0x43e7('0x2c')]=_[_0x43e7('0x2b')](_0x805b54[_0x43e7('0x27')],qs[_0x43e7('0x2d')](_0x405f85[_0x43e7('0x28')][_0x43e7('0x2d')]));_0x52b7b3[_0x43e7('0x2c')]=_0x52b7b3['attributes'][_0x43e7('0x2e')]?_0x52b7b3[_0x43e7('0x2c')]:_0x805b54[_0x43e7('0x27')];if(!_0x405f85[_0x43e7('0x28')][_0x43e7('0x2f')]('nolimit')){_0x52b7b3[_0x43e7('0x30')]=qs[_0x43e7('0x30')](_0x405f85[_0x43e7('0x28')][_0x43e7('0x30')]);_0x52b7b3['offset']=qs['offset'](_0x405f85['query'][_0x43e7('0x17')]);}_0x52b7b3[_0x43e7('0x31')]=qs[_0x43e7('0x32')](_0x405f85[_0x43e7('0x28')][_0x43e7('0x32')]);_0x52b7b3[_0x43e7('0x33')]=qs['filters'](_['pick'](_0x405f85['query'],_0x805b54['filters']));if(_0x405f85['query']['filter']){_0x52b7b3['where']=_[_0x43e7('0x34')](_0x52b7b3['where'],{'$or':_[_0x43e7('0x35')](_0x2dd5f,function(_0x8e9f40){if(_0x8e9f40[_0x43e7('0x36')][_0x43e7('0x37')]!==_0x43e7('0x38')){var _0x449803={};_0x449803[_0x8e9f40[_0x43e7('0x39')]]={'$like':'%'+_0x405f85['query']['filter']+'%'};return _0x449803;}})});}_0x52b7b3=_['merge']({},_0x52b7b3,_0x405f85[_0x43e7('0x3a')]);var _0xfe70e9={'where':_0x52b7b3[_0x43e7('0x33')]};return db[_0x43e7('0x25')][_0x43e7('0x16')](_0xfe70e9)[_0x43e7('0x1e')](function(_0x1d4589){_0x501551[_0x43e7('0x16')]=_0x1d4589;if(_0x405f85['query'][_0x43e7('0x3b')]){_0x52b7b3[_0x43e7('0x3c')]=[{'all':!![]}];}return db['MemberReport'][_0x43e7('0x3d')](_0x52b7b3);})['then'](function(_0x44d8e4){_0x501551[_0x43e7('0x3e')]=_0x44d8e4;return _0x501551;})[_0x43e7('0x1e')](respondWithFilteredResult(_0x51f4d7,_0x52b7b3))[_0x43e7('0x3f')](handleError(_0x51f4d7,null));};exports[_0x43e7('0x40')]=function(_0x234d8f,_0x5e731b){var _0x574a93={'raw':!![],'where':{'id':_0x234d8f[_0x43e7('0x41')]['id']}},_0x30dfa9={};_0x30dfa9[_0x43e7('0x27')]=_[_0x43e7('0x29')](db[_0x43e7('0x25')]['rawAttributes']);_0x30dfa9[_0x43e7('0x28')]=_[_0x43e7('0x29')](_0x234d8f['query']);_0x30dfa9[_0x43e7('0x2a')]=_['intersection'](_0x30dfa9[_0x43e7('0x27')],_0x30dfa9['query']);_0x574a93[_0x43e7('0x2c')]=_[_0x43e7('0x2b')](_0x30dfa9[_0x43e7('0x27')],qs[_0x43e7('0x2d')](_0x234d8f['query']['fields']));_0x574a93[_0x43e7('0x2c')]=_0x574a93[_0x43e7('0x2c')][_0x43e7('0x2e')]?_0x574a93[_0x43e7('0x2c')]:_0x30dfa9['model'];if(_0x234d8f['query']['includeAll']){_0x574a93[_0x43e7('0x3c')]=[{'all':!![]}];}_0x574a93=_['merge']({},_0x574a93,_0x234d8f[_0x43e7('0x3a')]);return db['MemberReport']['find'](_0x574a93)[_0x43e7('0x1e')](handleEntityNotFound(_0x5e731b,null))['then'](respondWithResult(_0x5e731b,null))[_0x43e7('0x3f')](handleError(_0x5e731b,null));};exports[_0x43e7('0x42')]=function(_0x257bd8,_0x99b9e1){return db['MemberReport'][_0x43e7('0x42')](_0x257bd8[_0x43e7('0x43')],{})[_0x43e7('0x1e')](respondWithResult(_0x99b9e1,0xc9))[_0x43e7('0x3f')](handleError(_0x99b9e1,null));};exports[_0x43e7('0x44')]=function(_0x1efe59,_0x51eef4){if(_0x1efe59['body']['id']){delete _0x1efe59[_0x43e7('0x43')]['id'];}return db[_0x43e7('0x25')][_0x43e7('0x45')]({'where':{'id':_0x1efe59['params']['id']}})['then'](handleEntityNotFound(_0x51eef4,null))['then'](saveUpdates(_0x1efe59[_0x43e7('0x43')],null))[_0x43e7('0x1e')](respondWithResult(_0x51eef4,null))['catch'](handleError(_0x51eef4,null));};exports[_0x43e7('0x1f')]=function(_0x47686e,_0x3c96fe){return db['MemberReport']['find']({'where':{'id':_0x47686e['params']['id']}})['then'](handleEntityNotFound(_0x3c96fe,null))[_0x43e7('0x1e')](removeEntity(_0x3c96fe,null))[_0x43e7('0x3f')](handleError(_0x3c96fe,null));};exports['describe']=function(_0x23e7cb,_0x82d32f){return db[_0x43e7('0x25')][_0x43e7('0x46')]()['then'](respondWithResult(_0x82d32f,null))[_0x43e7('0x3f')](handleError(_0x82d32f,null));}; \ No newline at end of file +var _0x34e8=['util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','set','Content-Range','apply','reject','save','update','then','stack','name','send','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','key','VIRTUAL','field','options','MemberReport','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x3df3c6,_0x496e1a){var _0x254c43=function(_0x371daa){while(--_0x371daa){_0x3df3c6['push'](_0x3df3c6['shift']());}};_0x254c43(++_0x496e1a);}(_0x34e8,0x12c));var _0x834e=function(_0x4c3fed,_0x1e512c){_0x4c3fed=_0x4c3fed-0x0;var _0x3e0ade=_0x34e8[_0x4c3fed];return _0x3e0ade;};'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 hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var db=require(_0x834e('0x1b'))['db'];function respondWithStatusCode(_0x2fd95c,_0x538bb3){_0x538bb3=_0x538bb3||0xcc;return function(_0x5e5b6d){if(_0x5e5b6d){return _0x2fd95c[_0x834e('0x1c')](_0x538bb3);}return _0x2fd95c['status'](_0x538bb3)[_0x834e('0x1d')]();};}function respondWithResult(_0x2d95f2,_0x28e659){_0x28e659=_0x28e659||0xc8;return function(_0x21cc0a){if(_0x21cc0a){return _0x2d95f2['status'](_0x28e659)[_0x834e('0x1e')](_0x21cc0a);}};}function respondWithFilteredResult(_0x302cbd,_0x57274a){return function(_0x316205){if(_0x316205){var _0x4a9cdc=_0x316205[_0x834e('0x1f')],_0x38a8cd=_0x57274a[_0x834e('0x20')],_0x36d443=_0x57274a[_0x834e('0x20')]+_0x57274a['limit'],_0x478afe;if(_0x36d443>=_0x4a9cdc){_0x36d443=_0x4a9cdc;_0x478afe=0xc8;}else{_0x478afe=0xce;}_0x302cbd[_0x834e('0x21')](_0x478afe);return _0x302cbd[_0x834e('0x22')](_0x834e('0x23'),_0x38a8cd+'-'+_0x36d443+'/'+_0x4a9cdc)[_0x834e('0x1e')](_0x316205);}return null;};}function patchUpdates(_0x237947){return function(_0x254677){try{jsonpatch[_0x834e('0x24')](_0x254677,_0x237947,!![]);}catch(_0x595515){return BPromise[_0x834e('0x25')](_0x595515);}return _0x254677[_0x834e('0x26')]();};}function saveUpdates(_0x113ff4,_0x325a99){return function(_0x4ab05d){if(_0x4ab05d){return _0x4ab05d[_0x834e('0x27')](_0x113ff4)[_0x834e('0x28')](function(_0x5a05c0){return _0x5a05c0;});}return null;};}function removeEntity(_0x1b4bdf,_0x28d687){return function(_0x8d406e){if(_0x8d406e){return _0x8d406e['destroy']()['then'](function(){_0x1b4bdf[_0x834e('0x21')](0xcc)[_0x834e('0x1d')]();});}};}function handleEntityNotFound(_0x589dde,_0x25ee1d){return function(_0x1dc1e0){if(!_0x1dc1e0){_0x589dde['sendStatus'](0x194);}return _0x1dc1e0;};}function handleError(_0x3bc4f7,_0x2e1983){_0x2e1983=_0x2e1983||0x1f4;return function(_0x338636){logger['error'](_0x338636[_0x834e('0x29')]);if(_0x338636[_0x834e('0x2a')]){delete _0x338636['name'];}_0x3bc4f7['status'](_0x2e1983)[_0x834e('0x2b')](_0x338636);};}exports['index']=function(_0x2826ec,_0x3f1b0b){var _0x3db026={},_0x2cc2eb={},_0x3cd928={'count':0x0,'rows':[]};var _0x130cc5=db['MemberReport']['rawAttributes'];_0x2cc2eb['model']=_['keys'](_0x130cc5);_0x2cc2eb[_0x834e('0x2c')]=_[_0x834e('0x2d')](_0x2826ec[_0x834e('0x2c')]);_0x2cc2eb['filters']=_[_0x834e('0x2e')](_0x2cc2eb[_0x834e('0x2f')],_0x2cc2eb[_0x834e('0x2c')]);_0x3db026[_0x834e('0x30')]=_[_0x834e('0x2e')](_0x2cc2eb[_0x834e('0x2f')],qs[_0x834e('0x31')](_0x2826ec[_0x834e('0x2c')][_0x834e('0x31')]));_0x3db026['attributes']=_0x3db026[_0x834e('0x30')]['length']?_0x3db026[_0x834e('0x30')]:_0x2cc2eb[_0x834e('0x2f')];if(!_0x2826ec[_0x834e('0x2c')][_0x834e('0x32')](_0x834e('0x33'))){_0x3db026[_0x834e('0x34')]=qs[_0x834e('0x34')](_0x2826ec[_0x834e('0x2c')][_0x834e('0x34')]);_0x3db026[_0x834e('0x20')]=qs['offset'](_0x2826ec[_0x834e('0x2c')][_0x834e('0x20')]);}_0x3db026[_0x834e('0x35')]=qs[_0x834e('0x36')](_0x2826ec['query'][_0x834e('0x36')]);_0x3db026[_0x834e('0x37')]=qs['filters'](_['pick'](_0x2826ec['query'],_0x2cc2eb[_0x834e('0x38')]));if(_0x2826ec[_0x834e('0x2c')][_0x834e('0x39')]){_0x3db026[_0x834e('0x37')]=_[_0x834e('0x3a')](_0x3db026[_0x834e('0x37')],{'$or':_['map'](_0x130cc5,function(_0x2c2d94){if(_0x2c2d94['type'][_0x834e('0x3b')]!==_0x834e('0x3c')){var _0x47abed={};_0x47abed[_0x2c2d94[_0x834e('0x3d')]]={'$like':'%'+_0x2826ec[_0x834e('0x2c')]['filter']+'%'};return _0x47abed;}})});}_0x3db026=_['merge']({},_0x3db026,_0x2826ec[_0x834e('0x3e')]);var _0xd0d43a={'where':_0x3db026[_0x834e('0x37')]};return db[_0x834e('0x3f')][_0x834e('0x1f')](_0xd0d43a)['then'](function(_0x1c5ed6){_0x3cd928['count']=_0x1c5ed6;if(_0x2826ec['query'][_0x834e('0x40')]){_0x3db026['include']=[{'all':!![]}];}return db[_0x834e('0x3f')][_0x834e('0x41')](_0x3db026);})[_0x834e('0x28')](function(_0x3c59af){_0x3cd928[_0x834e('0x42')]=_0x3c59af;return _0x3cd928;})['then'](respondWithFilteredResult(_0x3f1b0b,_0x3db026))[_0x834e('0x43')](handleError(_0x3f1b0b,null));};exports[_0x834e('0x44')]=function(_0x38f266,_0x58c5fb){var _0x35380e={'raw':!![],'where':{'id':_0x38f266['params']['id']}},_0x16ac45={};_0x16ac45[_0x834e('0x2f')]=_['keys'](db[_0x834e('0x3f')][_0x834e('0x45')]);_0x16ac45['query']=_['keys'](_0x38f266[_0x834e('0x2c')]);_0x16ac45[_0x834e('0x38')]=_[_0x834e('0x2e')](_0x16ac45[_0x834e('0x2f')],_0x16ac45[_0x834e('0x2c')]);_0x35380e[_0x834e('0x30')]=_[_0x834e('0x2e')](_0x16ac45['model'],qs[_0x834e('0x31')](_0x38f266['query'][_0x834e('0x31')]));_0x35380e['attributes']=_0x35380e[_0x834e('0x30')]['length']?_0x35380e[_0x834e('0x30')]:_0x16ac45[_0x834e('0x2f')];if(_0x38f266['query'][_0x834e('0x40')]){_0x35380e[_0x834e('0x46')]=[{'all':!![]}];}_0x35380e=_[_0x834e('0x3a')]({},_0x35380e,_0x38f266[_0x834e('0x3e')]);return db[_0x834e('0x3f')][_0x834e('0x47')](_0x35380e)[_0x834e('0x28')](handleEntityNotFound(_0x58c5fb,null))[_0x834e('0x28')](respondWithResult(_0x58c5fb,null))[_0x834e('0x43')](handleError(_0x58c5fb,null));};exports[_0x834e('0x48')]=function(_0x5f3943,_0x3124be){return db[_0x834e('0x3f')]['create'](_0x5f3943[_0x834e('0x49')],{})[_0x834e('0x28')](respondWithResult(_0x3124be,0xc9))[_0x834e('0x43')](handleError(_0x3124be,null));};exports[_0x834e('0x27')]=function(_0x19b5ef,_0x4264b8){if(_0x19b5ef['body']['id']){delete _0x19b5ef['body']['id'];}return db[_0x834e('0x3f')][_0x834e('0x47')]({'where':{'id':_0x19b5ef[_0x834e('0x4a')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x4264b8,null))[_0x834e('0x28')](saveUpdates(_0x19b5ef[_0x834e('0x49')],null))[_0x834e('0x28')](respondWithResult(_0x4264b8,null))[_0x834e('0x43')](handleError(_0x4264b8,null));};exports[_0x834e('0x4b')]=function(_0x390c45,_0xf02f0d){return db[_0x834e('0x3f')][_0x834e('0x47')]({'where':{'id':_0x390c45[_0x834e('0x4a')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x28')](removeEntity(_0xf02f0d,null))[_0x834e('0x43')](handleError(_0xf02f0d,null));};exports[_0x834e('0x4c')]=function(_0x420841,_0x1adf86){return db['MemberReport'][_0x834e('0x4c')]()[_0x834e('0x28')](respondWithResult(_0x1adf86,null))['catch'](handleError(_0x1adf86,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index e3eb2d0..4435a38 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 _0xc873=['bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername','interface','lodash','util','api'];(function(_0x2cd944,_0x8ba004){var _0x39e44e=function(_0x3d60da){while(--_0x3d60da){_0x2cd944['push'](_0x2cd944['shift']());}};_0x39e44e(++_0x8ba004);}(_0xc873,0x193));var _0x3c87=function(_0x5292d1,_0x298978){_0x5292d1=_0x5292d1-0x0;var _0x185c2f=_0xc873[_0x5292d1];return _0x185c2f;};'use strict';var _=require(_0x3c87('0x0'));var util=require(_0x3c87('0x1'));var logger=require('../../config/logger')(_0x3c87('0x2'));var moment=require('moment');var BPromise=require(_0x3c87('0x3'));var rp=require(_0x3c87('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c87('0x5'));var config=require(_0x3c87('0x6'));var attributes=require(_0x3c87('0x7'));module[_0x3c87('0x8')]=function(_0x1f65d4,_0x5792af){return _0x1f65d4[_0x3c87('0x9')](_0x3c87('0xa'),attributes,{'tableName':_0x3c87('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x3c87('0xc'),_0x3c87('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xecb5=['exports','define','MemberReport','report_member','membername_interface','interface','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./memberReport.attributes'];(function(_0x2d9a60,_0x10fcb8){var _0x9fe2a1=function(_0x1d64d2){while(--_0x1d64d2){_0x2d9a60['push'](_0x2d9a60['shift']());}};_0x9fe2a1(++_0x10fcb8);}(_0xecb5,0xe6));var _0x5ecb=function(_0x9e01d0,_0x3770c3){_0x9e01d0=_0x9e01d0-0x0;var _0x50059b=_0xecb5[_0x9e01d0];return _0x50059b;};'use strict';var _=require(_0x5ecb('0x0'));var util=require(_0x5ecb('0x1'));var logger=require(_0x5ecb('0x2'))(_0x5ecb('0x3'));var moment=require(_0x5ecb('0x4'));var BPromise=require('bluebird');var rp=require(_0x5ecb('0x5'));var fs=require('fs');var path=require(_0x5ecb('0x6'));var rimraf=require(_0x5ecb('0x7'));var config=require(_0x5ecb('0x8'));var attributes=require(_0x5ecb('0x9'));module[_0x5ecb('0xa')]=function(_0x57c4f4,_0xff188a){return _0x57c4f4[_0x5ecb('0xb')](_0x5ecb('0xc'),attributes,{'tableName':_0x5ecb('0xd'),'paranoid':![],'indexes':[{'name':_0x5ecb('0xe'),'fields':['membername',_0x5ecb('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index c64681b..2b3b813 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 _0x18d9=['../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MemberReport','findAll','options','where','include','map','model','attributes','GetMemberReport','raw','CreateMemberReport','UpdateMemberReport','update','body','limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x1d58a0,_0x5b440e){var _0x458ddb=function(_0x44c973){while(--_0x44c973){_0x1d58a0['push'](_0x1d58a0['shift']());}};_0x458ddb(++_0x5b440e);}(_0x18d9,0xe3));var _0x918d=function(_0x16e460,_0x42d2ac){_0x16e460=_0x16e460-0x0;var _0x1fef9f=_0x18d9[_0x16e460];return _0x1fef9f;};'use strict';var _=require(_0x918d('0x0'));var util=require('util');var moment=require(_0x918d('0x1'));var BPromise=require(_0x918d('0x2'));var rs=require(_0x918d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x918d('0x4'));var logger=require(_0x918d('0x5'))(_0x918d('0x6'));var config=require(_0x918d('0x7'));var jayson=require(_0x918d('0x8'));var client=jayson[_0x918d('0x9')][_0x918d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45ad74,_0xf328ce,_0x510e89){return new BPromise(function(_0x45920c,_0x31b595){return client[_0x918d('0xb')](_0x45ad74,_0x510e89)[_0x918d('0xc')](function(_0x499035){logger[_0x918d('0xd')](_0x918d('0xe'),_0xf328ce,_0x918d('0xf'));logger[_0x918d('0x10')](_0x918d('0x11'),_0xf328ce,'request\x20sent',JSON[_0x918d('0x12')](_0x499035));if(_0x499035[_0x918d('0x13')]){if(_0x499035['error'][_0x918d('0x14')]===0x1f4){logger['error'](_0x918d('0xe'),_0xf328ce,_0x499035['error']['message']);return _0x31b595(_0x499035[_0x918d('0x13')]['message']);}logger['error'](_0x918d('0xe'),_0xf328ce,_0x499035[_0x918d('0x13')][_0x918d('0x15')]);return _0x45920c(_0x499035[_0x918d('0x13')][_0x918d('0x15')]);}else{logger[_0x918d('0xd')](_0x918d('0xe'),_0xf328ce,_0x918d('0xf'));_0x45920c(_0x499035[_0x918d('0x16')][_0x918d('0x15')]);}})[_0x918d('0x17')](function(_0x54f4d7){logger[_0x918d('0x13')](_0x918d('0xe'),_0xf328ce,_0x54f4d7);_0x31b595(_0x54f4d7);});});}exports['GetMemberReport']=function(_0x11c245){var _0x3dad6b=this;return new Promise(function(_0x519107,_0x2da2e7){return db[_0x918d('0x18')][_0x918d('0x19')]({'raw':_0x11c245[_0x918d('0x1a')]?_0x11c245[_0x918d('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x11c245[_0x918d('0x1a')]?_0x11c245[_0x918d('0x1a')][_0x918d('0x1b')]||null:null,'attributes':_0x11c245['options']?_0x11c245[_0x918d('0x1a')]['attributes']||null:null,'limit':_0x11c245['options']?_0x11c245[_0x918d('0x1a')]['limit']||null:null,'include':_0x11c245['options']?_0x11c245[_0x918d('0x1a')][_0x918d('0x1c')]?_[_0x918d('0x1d')](_0x11c245[_0x918d('0x1a')][_0x918d('0x1c')],function(_0xd9af9f){return{'model':db[_0xd9af9f[_0x918d('0x1e')]],'as':_0xd9af9f['as'],'attributes':_0xd9af9f[_0x918d('0x1f')],'include':_0xd9af9f[_0x918d('0x1c')]?_[_0x918d('0x1d')](_0xd9af9f['include'],function(_0x2b95d8){return{'model':db[_0x2b95d8['model']],'as':_0x2b95d8['as'],'attributes':_0x2b95d8['attributes'],'include':_0x2b95d8[_0x918d('0x1c')]?_[_0x918d('0x1d')](_0x2b95d8[_0x918d('0x1c')],function(_0x2b80){return{'model':db[_0x2b80[_0x918d('0x1e')]],'as':_0x2b80['as'],'attributes':_0x2b80['attributes']};}):[]};}):[]};}):[]:[]})[_0x918d('0xc')](function(_0x5a470c){logger[_0x918d('0xd')](_0x918d('0x20'),_0x11c245);logger[_0x918d('0x10')](_0x918d('0x20'),_0x11c245,JSON[_0x918d('0x12')](_0x5a470c));_0x519107(_0x5a470c);})[_0x918d('0x17')](function(_0x536215){logger[_0x918d('0x13')](_0x918d('0x20'),_0x536215[_0x918d('0x15')],_0x11c245);_0x2da2e7(_0x3dad6b[_0x918d('0x13')](0x1f4,_0x536215[_0x918d('0x15')]));});});};exports['CreateMemberReport']=function(_0x5f3809){var _0x3c329c=this;return new Promise(function(_0x109fde,_0x22e9ea){return db[_0x918d('0x18')]['create'](_0x5f3809['body'],{'raw':_0x5f3809[_0x918d('0x1a')]?_0x5f3809[_0x918d('0x1a')][_0x918d('0x21')]===undefined?!![]:![]:!![]})[_0x918d('0xc')](function(_0x77c471){logger[_0x918d('0xd')](_0x918d('0x22'),_0x5f3809);logger['debug'](_0x918d('0x22'),_0x5f3809,JSON[_0x918d('0x12')](_0x77c471));_0x109fde(_0x77c471);})[_0x918d('0x17')](function(_0xfcfc87){logger['error'](_0x918d('0x22'),_0xfcfc87[_0x918d('0x15')],_0x5f3809);_0x22e9ea(_0x3c329c[_0x918d('0x13')](0x1f4,_0xfcfc87[_0x918d('0x15')]));});});};exports[_0x918d('0x23')]=function(_0x570fa4){var _0x3b672e=this;return new Promise(function(_0x1eb6e3,_0x5c1030){return db[_0x918d('0x18')][_0x918d('0x24')](_0x570fa4[_0x918d('0x25')],{'raw':_0x570fa4[_0x918d('0x1a')]?_0x570fa4[_0x918d('0x1a')][_0x918d('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x570fa4[_0x918d('0x1a')]?_0x570fa4[_0x918d('0x1a')][_0x918d('0x1b')]||null:null,'attributes':_0x570fa4[_0x918d('0x1a')]?_0x570fa4[_0x918d('0x1a')][_0x918d('0x1f')]||null:null,'limit':_0x570fa4[_0x918d('0x1a')]?_0x570fa4[_0x918d('0x1a')][_0x918d('0x26')]||null:null})['then'](function(_0x256d74){logger[_0x918d('0xd')](_0x918d('0x23'),_0x570fa4);logger[_0x918d('0x10')](_0x918d('0x23'),_0x570fa4,JSON[_0x918d('0x12')](_0x256d74));_0x1eb6e3(_0x256d74);})[_0x918d('0x17')](function(_0x8ef344){logger[_0x918d('0x13')](_0x918d('0x23'),_0x8ef344['message'],_0x570fa4);_0x5c1030(_0x3b672e[_0x918d('0x13')](0x1f4,_0x8ef344[_0x918d('0x15')]));});});}; \ No newline at end of file +var _0x432a=['moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','MemberReport','findAll','options','raw','where','attributes','limit','include','model','map','GetMemberReport','body','CreateMemberReport','UpdateMemberReport','update','lodash','util'];(function(_0x59b4ab,_0x34bf55){var _0x2adb22=function(_0x364ba8){while(--_0x364ba8){_0x59b4ab['push'](_0x59b4ab['shift']());}};_0x2adb22(++_0x34bf55);}(_0x432a,0x166));var _0xa432=function(_0x13bb3f,_0x4da948){_0x13bb3f=_0x13bb3f-0x0;var _0x2f71bd=_0x432a[_0x13bb3f];return _0x2f71bd;};'use strict';var _=require(_0xa432('0x0'));var util=require(_0xa432('0x1'));var moment=require(_0xa432('0x2'));var BPromise=require(_0xa432('0x3'));var rs=require(_0xa432('0x4'));var fs=require('fs');var Redis=require(_0xa432('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa432('0x6'))('rpc');var config=require(_0xa432('0x7'));var jayson=require(_0xa432('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x261ac6,_0x1f05aa,_0xcd8c36){return new BPromise(function(_0x9b15b5,_0x50089a){return client[_0xa432('0x9')](_0x261ac6,_0xcd8c36)[_0xa432('0xa')](function(_0x28459a){logger[_0xa432('0xb')](_0xa432('0xc'),_0x1f05aa,_0xa432('0xd'));logger[_0xa432('0xe')](_0xa432('0xf'),_0x1f05aa,_0xa432('0xd'),JSON[_0xa432('0x10')](_0x28459a));if(_0x28459a['error']){if(_0x28459a['error']['code']===0x1f4){logger[_0xa432('0x11')](_0xa432('0xc'),_0x1f05aa,_0x28459a[_0xa432('0x11')][_0xa432('0x12')]);return _0x50089a(_0x28459a[_0xa432('0x11')][_0xa432('0x12')]);}logger['error'](_0xa432('0xc'),_0x1f05aa,_0x28459a['error'][_0xa432('0x12')]);return _0x9b15b5(_0x28459a[_0xa432('0x11')]['message']);}else{logger[_0xa432('0xb')](_0xa432('0xc'),_0x1f05aa,_0xa432('0xd'));_0x9b15b5(_0x28459a[_0xa432('0x13')]['message']);}})[_0xa432('0x14')](function(_0x2b2877){logger[_0xa432('0x11')]('MemberReport,\x20%s,\x20%s',_0x1f05aa,_0x2b2877);_0x50089a(_0x2b2877);});});}exports['GetMemberReport']=function(_0xdc6022){var _0x44c9ec=this;return new Promise(function(_0x12a9f8,_0x87411a){return db[_0xa432('0x15')][_0xa432('0x16')]({'raw':_0xdc6022['options']?_0xdc6022[_0xa432('0x17')][_0xa432('0x18')]===undefined?!![]:![]:!![],'where':_0xdc6022[_0xa432('0x17')]?_0xdc6022['options'][_0xa432('0x19')]||null:null,'attributes':_0xdc6022['options']?_0xdc6022[_0xa432('0x17')][_0xa432('0x1a')]||null:null,'limit':_0xdc6022[_0xa432('0x17')]?_0xdc6022[_0xa432('0x17')][_0xa432('0x1b')]||null:null,'include':_0xdc6022[_0xa432('0x17')]?_0xdc6022[_0xa432('0x17')][_0xa432('0x1c')]?_['map'](_0xdc6022['options'][_0xa432('0x1c')],function(_0x16bd2a){return{'model':db[_0x16bd2a[_0xa432('0x1d')]],'as':_0x16bd2a['as'],'attributes':_0x16bd2a[_0xa432('0x1a')],'include':_0x16bd2a[_0xa432('0x1c')]?_['map'](_0x16bd2a[_0xa432('0x1c')],function(_0x2f1342){return{'model':db[_0x2f1342['model']],'as':_0x2f1342['as'],'attributes':_0x2f1342[_0xa432('0x1a')],'include':_0x2f1342[_0xa432('0x1c')]?_[_0xa432('0x1e')](_0x2f1342[_0xa432('0x1c')],function(_0x2c7ab1){return{'model':db[_0x2c7ab1[_0xa432('0x1d')]],'as':_0x2c7ab1['as'],'attributes':_0x2c7ab1['attributes']};}):[]};}):[]};}):[]:[]})[_0xa432('0xa')](function(_0x2a560e){logger[_0xa432('0xb')](_0xa432('0x1f'),_0xdc6022);logger[_0xa432('0xe')](_0xa432('0x1f'),_0xdc6022,JSON[_0xa432('0x10')](_0x2a560e));_0x12a9f8(_0x2a560e);})['catch'](function(_0x4e31e6){logger[_0xa432('0x11')](_0xa432('0x1f'),_0x4e31e6['message'],_0xdc6022);_0x87411a(_0x44c9ec[_0xa432('0x11')](0x1f4,_0x4e31e6[_0xa432('0x12')]));});});};exports['CreateMemberReport']=function(_0x3ce9ad){var _0x5d2423=this;return new Promise(function(_0xe71d0,_0x7f038b){return db['MemberReport']['create'](_0x3ce9ad[_0xa432('0x20')],{'raw':_0x3ce9ad[_0xa432('0x17')]?_0x3ce9ad[_0xa432('0x17')][_0xa432('0x18')]===undefined?!![]:![]:!![]})[_0xa432('0xa')](function(_0x7b9b6a){logger[_0xa432('0xb')](_0xa432('0x21'),_0x3ce9ad);logger['debug'](_0xa432('0x21'),_0x3ce9ad,JSON[_0xa432('0x10')](_0x7b9b6a));_0xe71d0(_0x7b9b6a);})[_0xa432('0x14')](function(_0x199464){logger[_0xa432('0x11')]('CreateMemberReport',_0x199464['message'],_0x3ce9ad);_0x7f038b(_0x5d2423[_0xa432('0x11')](0x1f4,_0x199464[_0xa432('0x12')]));});});};exports[_0xa432('0x22')]=function(_0x5f25af){var _0x120b4e=this;return new Promise(function(_0x240ace,_0x4d4e8a){return db[_0xa432('0x15')][_0xa432('0x23')](_0x5f25af[_0xa432('0x20')],{'raw':_0x5f25af[_0xa432('0x17')]?_0x5f25af[_0xa432('0x17')][_0xa432('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f25af['options']?_0x5f25af['options']['where']||null:null,'attributes':_0x5f25af[_0xa432('0x17')]?_0x5f25af['options'][_0xa432('0x1a')]||null:null,'limit':_0x5f25af['options']?_0x5f25af[_0xa432('0x17')][_0xa432('0x1b')]||null:null})[_0xa432('0xa')](function(_0x56cc58){logger[_0xa432('0xb')](_0xa432('0x22'),_0x5f25af);logger[_0xa432('0xe')](_0xa432('0x22'),_0x5f25af,JSON[_0xa432('0x10')](_0x56cc58));_0x240ace(_0x56cc58);})[_0xa432('0x14')](function(_0x352db0){logger['error']('UpdateMemberReport',_0x352db0[_0xa432('0x12')],_0x5f25af);_0x4d4e8a(_0x120b4e[_0xa432('0x11')](0x1f4,_0x352db0[_0xa432('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 6056673..694797f 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 _0xab40=['../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','exports','multer','util','Router'];(function(_0x527f74,_0x3c719e){var _0x2147fe=function(_0xd3c17e){while(--_0xd3c17e){_0x527f74['push'](_0x527f74['shift']());}};_0x2147fe(++_0x3c719e);}(_0xab40,0xcd));var _0x0ab4=function(_0x27e569,_0x377144){_0x27e569=_0x27e569-0x0;var _0x406e3f=_0xab40[_0x27e569];return _0x406e3f;};'use strict';var multer=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0ab4('0x2')]();var auth=require(_0x0ab4('0x3'));var interaction=require(_0x0ab4('0x4'));var config=require(_0x0ab4('0x5'));var controller=require(_0x0ab4('0x6'));router['get']('/',controller['index']);module[_0x0ab4('0x7')]=router; \ No newline at end of file +var _0xe511=['connect-timeout','Router','../../components/auth/service','../../config/environment','./migration.controller','get','index','multer','util'];(function(_0x589c61,_0x4e928c){var _0x54986e=function(_0x14299e){while(--_0x14299e){_0x589c61['push'](_0x589c61['shift']());}};_0x54986e(++_0x4e928c);}(_0xe511,0x16f));var _0x1e51=function(_0x49cbdd,_0x476a3f){_0x49cbdd=_0x49cbdd-0x0;var _0x116832=_0xe511[_0x49cbdd];return _0x116832;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var auth=require(_0x1e51('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1e51('0x5'));var controller=require(_0x1e51('0x6'));router[_0x1e51('0x7')]('/',controller[_0x1e51('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 355ebc6..867bb7d 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 _0x80af=['exports','STRING','version'];(function(_0x197df3,_0x57d366){var _0xafdaf7=function(_0x5489b5){while(--_0x5489b5){_0x197df3['push'](_0x197df3['shift']());}};_0xafdaf7(++_0x57d366);}(_0x80af,0x1bc));var _0xf80a=function(_0x35a2e9,_0x5d00c8){_0x35a2e9=_0x35a2e9-0x0;var _0x132006=_0x80af[_0x35a2e9];return _0x132006;};'use strict';var Sequelize=require('sequelize');module[_0xf80a('0x0')]={'version':{'type':Sequelize[_0xf80a('0x1')],'unique':_0xf80a('0x2')}}; \ No newline at end of file +var _0xfa0e=['version','STRING'];(function(_0x1e1c1e,_0x63d716){var _0x3e0911=function(_0x1a08b3){while(--_0x1a08b3){_0x1e1c1e['push'](_0x1e1c1e['shift']());}};_0x3e0911(++_0x63d716);}(_0xfa0e,0x7d));var _0xefa0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfa0e[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize[_0xefa0('0x0')],'unique':_0xefa0('0x1')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index c912569..76e7c92 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 _0x3114=['end','status','count','offset','limit','set','json','apply','update','then','error','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','filter','map','type','key','field','merge','options','Migration','includeAll','include','findAll','rows','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x31f94d,_0x97563){var _0xca77c0=function(_0x1e9e04){while(--_0x1e9e04){_0x31f94d['push'](_0x31f94d['shift']());}};_0xca77c0(++_0x97563);}(_0x3114,0xdd));var _0x4311=function(_0x79c11c,_0x19db17){_0x79c11c=_0x79c11c-0x0;var _0x50f3c8=_0x3114[_0x79c11c];return _0x50f3c8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4311('0x0'));var rimraf=require(_0x4311('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4311('0x2'));var rp=require('request-promise');var moment=require(_0x4311('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4311('0x4'));var util=require(_0x4311('0x5'));var path=require(_0x4311('0x6'));var sox=require('sox');var csv=require(_0x4311('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4311('0x8'));var squel=require(_0x4311('0x9'));var crypto=require(_0x4311('0xa'));var jsforce=require(_0x4311('0xb'));var deskjs=require(_0x4311('0xc'));var toCsv=require(_0x4311('0x7'));var querystring=require(_0x4311('0xd'));var Papa=require(_0x4311('0xe'));var Redis=require(_0x4311('0xf'));var authService=require(_0x4311('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4311('0x11'));var logger=require(_0x4311('0x12'))(_0x4311('0x13'));var utils=require(_0x4311('0x14'));var config=require(_0x4311('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32cca0,_0x57587c){_0x57587c=_0x57587c||0xcc;return function(_0x1bb13d){if(_0x1bb13d){return _0x32cca0[_0x4311('0x16')](_0x57587c);}return _0x32cca0['status'](_0x57587c)[_0x4311('0x17')]();};}function respondWithResult(_0x1a2b74,_0x48e510){_0x48e510=_0x48e510||0xc8;return function(_0x5cae39){if(_0x5cae39){return _0x1a2b74[_0x4311('0x18')](_0x48e510)['json'](_0x5cae39);}};}function respondWithFilteredResult(_0x33c4a3,_0x3c7283){return function(_0x561a1b){if(_0x561a1b){var _0x26d0ee=_0x561a1b[_0x4311('0x19')],_0x5af766=_0x3c7283['offset'],_0x28ae5e=_0x3c7283[_0x4311('0x1a')]+_0x3c7283[_0x4311('0x1b')],_0x532890;if(_0x28ae5e>=_0x26d0ee){_0x28ae5e=_0x26d0ee;_0x532890=0xc8;}else{_0x532890=0xce;}_0x33c4a3[_0x4311('0x18')](_0x532890);return _0x33c4a3[_0x4311('0x1c')]('Content-Range',_0x5af766+'-'+_0x28ae5e+'/'+_0x26d0ee)[_0x4311('0x1d')](_0x561a1b);}return null;};}function patchUpdates(_0x57032f){return function(_0x480572){try{jsonpatch[_0x4311('0x1e')](_0x480572,_0x57032f,!![]);}catch(_0x4b7b26){return BPromise['reject'](_0x4b7b26);}return _0x480572['save']();};}function saveUpdates(_0x354a64,_0x11df40){return function(_0x348d6a){if(_0x348d6a){return _0x348d6a[_0x4311('0x1f')](_0x354a64)['then'](function(_0x3b955b){return _0x3b955b;});}return null;};}function removeEntity(_0xc1df57,_0x65aa73){return function(_0x349506){if(_0x349506){return _0x349506['destroy']()[_0x4311('0x20')](function(){_0xc1df57[_0x4311('0x18')](0xcc)[_0x4311('0x17')]();});}};}function handleEntityNotFound(_0x5f3c35,_0x12ee2e){return function(_0x5968d8){if(!_0x5968d8){_0x5f3c35[_0x4311('0x16')](0x194);}return _0x5968d8;};}function handleError(_0x239334,_0x1e3178){_0x1e3178=_0x1e3178||0x1f4;return function(_0xde815b){logger[_0x4311('0x21')](_0xde815b['stack']);if(_0xde815b['name']){delete _0xde815b[_0x4311('0x22')];}_0x239334[_0x4311('0x18')](_0x1e3178)[_0x4311('0x23')](_0xde815b);};}exports[_0x4311('0x24')]=function(_0x26dfe8,_0x397c37){var _0x19fd30={},_0x45e3b0={},_0xff8215={'count':0x0,'rows':[]};var _0xe8a128=db['Migration'][_0x4311('0x25')];_0x45e3b0[_0x4311('0x26')]=_[_0x4311('0x27')](_0xe8a128);_0x45e3b0['query']=_[_0x4311('0x27')](_0x26dfe8[_0x4311('0x28')]);_0x45e3b0[_0x4311('0x29')]=_[_0x4311('0x2a')](_0x45e3b0['model'],_0x45e3b0[_0x4311('0x28')]);_0x19fd30[_0x4311('0x2b')]=_[_0x4311('0x2a')](_0x45e3b0[_0x4311('0x26')],qs[_0x4311('0x2c')](_0x26dfe8['query'][_0x4311('0x2c')]));_0x19fd30[_0x4311('0x2b')]=_0x19fd30[_0x4311('0x2b')][_0x4311('0x2d')]?_0x19fd30[_0x4311('0x2b')]:_0x45e3b0[_0x4311('0x26')];if(!_0x26dfe8['query']['hasOwnProperty']('nolimit')){_0x19fd30[_0x4311('0x1b')]=qs[_0x4311('0x1b')](_0x26dfe8[_0x4311('0x28')][_0x4311('0x1b')]);_0x19fd30[_0x4311('0x1a')]=qs['offset'](_0x26dfe8['query']['offset']);}_0x19fd30[_0x4311('0x2e')]=qs[_0x4311('0x2f')](_0x26dfe8[_0x4311('0x28')]['sort']);_0x19fd30[_0x4311('0x30')]=qs[_0x4311('0x29')](_['pick'](_0x26dfe8[_0x4311('0x28')],_0x45e3b0[_0x4311('0x29')]));if(_0x26dfe8[_0x4311('0x28')][_0x4311('0x31')]){_0x19fd30[_0x4311('0x30')]=_['merge'](_0x19fd30['where'],{'$or':_[_0x4311('0x32')](_0xe8a128,function(_0x42ebe1){if(_0x42ebe1[_0x4311('0x33')][_0x4311('0x34')]!=='VIRTUAL'){var _0x3e3523={};_0x3e3523[_0x42ebe1[_0x4311('0x35')]]={'$like':'%'+_0x26dfe8[_0x4311('0x28')][_0x4311('0x31')]+'%'};return _0x3e3523;}})});}_0x19fd30=_[_0x4311('0x36')]({},_0x19fd30,_0x26dfe8[_0x4311('0x37')]);var _0x4f1b6a={'where':_0x19fd30[_0x4311('0x30')]};return db[_0x4311('0x38')][_0x4311('0x19')](_0x4f1b6a)[_0x4311('0x20')](function(_0x5c281f){_0xff8215[_0x4311('0x19')]=_0x5c281f;if(_0x26dfe8[_0x4311('0x28')][_0x4311('0x39')]){_0x19fd30[_0x4311('0x3a')]=[{'all':!![]}];}return db['Migration'][_0x4311('0x3b')](_0x19fd30);})[_0x4311('0x20')](function(_0x341ea3){_0xff8215[_0x4311('0x3c')]=_0x341ea3;return _0xff8215;})[_0x4311('0x20')](respondWithFilteredResult(_0x397c37,_0x19fd30))['catch'](handleError(_0x397c37,null));}; \ No newline at end of file +var _0xbdbe=['intersection','model','attributes','fields','hasOwnProperty','offset','order','sort','where','pick','filter','merge','type','key','field','includeAll','include','findAll','rows','html-pdf','rimraf','fast-json-patch','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','Content-Range','reject','save','then','error','stack','name','send','index','Migration','keys','query','filters'];(function(_0x228dcb,_0x18a262){var _0x54103a=function(_0xa01976){while(--_0xa01976){_0x228dcb['push'](_0x228dcb['shift']());}};_0x54103a(++_0x18a262);}(_0xbdbe,0x1f3));var _0xebdb=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xbdbe[_0x178e48];return _0x440d7e;};'use strict';var pdf=require(_0xebdb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xebdb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebdb('0x2'));var rp=require('request-promise');var moment=require(_0xebdb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xebdb('0x4'));var util=require('util');var path=require(_0xebdb('0x5'));var sox=require('sox');var csv=require(_0xebdb('0x6'));var ejs=require(_0xebdb('0x7'));var fs=require('fs');var _=require(_0xebdb('0x8'));var squel=require(_0xebdb('0x9'));var crypto=require(_0xebdb('0xa'));var jsforce=require(_0xebdb('0xb'));var deskjs=require(_0xebdb('0xc'));var toCsv=require(_0xebdb('0x6'));var querystring=require(_0xebdb('0xd'));var Papa=require(_0xebdb('0xe'));var Redis=require(_0xebdb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xebdb('0x10'));var hardwareService=require(_0xebdb('0x11'));var logger=require('../../config/logger')(_0xebdb('0x12'));var utils=require(_0xebdb('0x13'));var config=require(_0xebdb('0x14'));var db=require(_0xebdb('0x15'))['db'];function respondWithStatusCode(_0x50a521,_0x5cdcb5){_0x5cdcb5=_0x5cdcb5||0xcc;return function(_0xb4bc79){if(_0xb4bc79){return _0x50a521[_0xebdb('0x16')](_0x5cdcb5);}return _0x50a521[_0xebdb('0x17')](_0x5cdcb5)[_0xebdb('0x18')]();};}function respondWithResult(_0x50a29c,_0x21f802){_0x21f802=_0x21f802||0xc8;return function(_0x13187a){if(_0x13187a){return _0x50a29c[_0xebdb('0x17')](_0x21f802)[_0xebdb('0x19')](_0x13187a);}};}function respondWithFilteredResult(_0x1a87bc,_0x373880){return function(_0x3fee99){if(_0x3fee99){var _0x9118e0=_0x3fee99[_0xebdb('0x1a')],_0xced6f8=_0x373880['offset'],_0x74f971=_0x373880['offset']+_0x373880[_0xebdb('0x1b')],_0x4ab0f9;if(_0x74f971>=_0x9118e0){_0x74f971=_0x9118e0;_0x4ab0f9=0xc8;}else{_0x4ab0f9=0xce;}_0x1a87bc[_0xebdb('0x17')](_0x4ab0f9);return _0x1a87bc['set'](_0xebdb('0x1c'),_0xced6f8+'-'+_0x74f971+'/'+_0x9118e0)[_0xebdb('0x19')](_0x3fee99);}return null;};}function patchUpdates(_0x4cc029){return function(_0x2de2f5){try{jsonpatch['apply'](_0x2de2f5,_0x4cc029,!![]);}catch(_0x5d5ac8){return BPromise[_0xebdb('0x1d')](_0x5d5ac8);}return _0x2de2f5[_0xebdb('0x1e')]();};}function saveUpdates(_0x28e85b,_0x5c76cc){return function(_0x38a4dd){if(_0x38a4dd){return _0x38a4dd['update'](_0x28e85b)[_0xebdb('0x1f')](function(_0x42f688){return _0x42f688;});}return null;};}function removeEntity(_0x53957b,_0x561653){return function(_0x2efa43){if(_0x2efa43){return _0x2efa43['destroy']()[_0xebdb('0x1f')](function(){_0x53957b[_0xebdb('0x17')](0xcc)[_0xebdb('0x18')]();});}};}function handleEntityNotFound(_0x5a6576,_0x5cbd95){return function(_0x349f8f){if(!_0x349f8f){_0x5a6576[_0xebdb('0x16')](0x194);}return _0x349f8f;};}function handleError(_0x24f4ce,_0xdb4ad8){_0xdb4ad8=_0xdb4ad8||0x1f4;return function(_0xae2fed){logger[_0xebdb('0x20')](_0xae2fed[_0xebdb('0x21')]);if(_0xae2fed[_0xebdb('0x22')]){delete _0xae2fed['name'];}_0x24f4ce[_0xebdb('0x17')](_0xdb4ad8)[_0xebdb('0x23')](_0xae2fed);};}exports[_0xebdb('0x24')]=function(_0x577abd,_0x24b409){var _0x59d9f7={},_0x3da0b4={},_0x1ce629={'count':0x0,'rows':[]};var _0x4e1bd5=db[_0xebdb('0x25')]['rawAttributes'];_0x3da0b4['model']=_[_0xebdb('0x26')](_0x4e1bd5);_0x3da0b4[_0xebdb('0x27')]=_[_0xebdb('0x26')](_0x577abd['query']);_0x3da0b4[_0xebdb('0x28')]=_[_0xebdb('0x29')](_0x3da0b4[_0xebdb('0x2a')],_0x3da0b4[_0xebdb('0x27')]);_0x59d9f7[_0xebdb('0x2b')]=_['intersection'](_0x3da0b4['model'],qs[_0xebdb('0x2c')](_0x577abd[_0xebdb('0x27')]['fields']));_0x59d9f7['attributes']=_0x59d9f7['attributes']['length']?_0x59d9f7[_0xebdb('0x2b')]:_0x3da0b4['model'];if(!_0x577abd[_0xebdb('0x27')][_0xebdb('0x2d')]('nolimit')){_0x59d9f7['limit']=qs[_0xebdb('0x1b')](_0x577abd[_0xebdb('0x27')][_0xebdb('0x1b')]);_0x59d9f7['offset']=qs[_0xebdb('0x2e')](_0x577abd[_0xebdb('0x27')][_0xebdb('0x2e')]);}_0x59d9f7[_0xebdb('0x2f')]=qs[_0xebdb('0x30')](_0x577abd[_0xebdb('0x27')]['sort']);_0x59d9f7[_0xebdb('0x31')]=qs[_0xebdb('0x28')](_[_0xebdb('0x32')](_0x577abd[_0xebdb('0x27')],_0x3da0b4[_0xebdb('0x28')]));if(_0x577abd[_0xebdb('0x27')][_0xebdb('0x33')]){_0x59d9f7[_0xebdb('0x31')]=_[_0xebdb('0x34')](_0x59d9f7['where'],{'$or':_['map'](_0x4e1bd5,function(_0x599720){if(_0x599720[_0xebdb('0x35')][_0xebdb('0x36')]!=='VIRTUAL'){var _0x41713a={};_0x41713a[_0x599720[_0xebdb('0x37')]]={'$like':'%'+_0x577abd['query'][_0xebdb('0x33')]+'%'};return _0x41713a;}})});}_0x59d9f7=_[_0xebdb('0x34')]({},_0x59d9f7,_0x577abd['options']);var _0x512739={'where':_0x59d9f7[_0xebdb('0x31')]};return db[_0xebdb('0x25')][_0xebdb('0x1a')](_0x512739)['then'](function(_0xb06bea){_0x1ce629[_0xebdb('0x1a')]=_0xb06bea;if(_0x577abd[_0xebdb('0x27')][_0xebdb('0x38')]){_0x59d9f7[_0xebdb('0x39')]=[{'all':!![]}];}return db[_0xebdb('0x25')][_0xebdb('0x3a')](_0x59d9f7);})[_0xebdb('0x1f')](function(_0x3a66c5){_0x1ce629[_0xebdb('0x3b')]=_0x3a66c5;return _0x1ce629;})[_0xebdb('0x1f')](respondWithFilteredResult(_0x24b409,_0x59d9f7))['catch'](handleError(_0x24b409,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index d6c51c3..72d2302 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 _0xf5ea=['./migration.attributes','define','migrations','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x5da88a,_0x45e322){var _0x24cf44=function(_0x484d9e){while(--_0x484d9e){_0x5da88a['push'](_0x5da88a['shift']());}};_0x24cf44(++_0x45e322);}(_0xf5ea,0x1c6));var _0xaf5e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xf5ea[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xaf5e('0x0'));var util=require(_0xaf5e('0x1'));var logger=require(_0xaf5e('0x2'))(_0xaf5e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaf5e('0x4'));var fs=require('fs');var path=require(_0xaf5e('0x5'));var rimraf=require(_0xaf5e('0x6'));var config=require(_0xaf5e('0x7'));var attributes=require(_0xaf5e('0x8'));module['exports']=function(_0x589af8,_0x4f66c8){return _0x589af8[_0xaf5e('0x9')]('Migration',attributes,{'tableName':_0xaf5e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3679=['path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1d6960,_0x11a48a){var _0x278934=function(_0x36dd3d){while(--_0x36dd3d){_0x1d6960['push'](_0x1d6960['shift']());}};_0x278934(++_0x11a48a);}(_0x3679,0x1e4));var _0x9367=function(_0xc7ada6,_0x1082d9){_0xc7ada6=_0xc7ada6-0x0;var _0x350b98=_0x3679[_0xc7ada6];return _0x350b98;};'use strict';var _=require(_0x9367('0x0'));var util=require(_0x9367('0x1'));var logger=require('../../config/logger')(_0x9367('0x2'));var moment=require(_0x9367('0x3'));var BPromise=require(_0x9367('0x4'));var rp=require(_0x9367('0x5'));var fs=require('fs');var path=require(_0x9367('0x6'));var rimraf=require(_0x9367('0x7'));var config=require(_0x9367('0x8'));var attributes=require(_0x9367('0x9'));module[_0x9367('0xa')]=function(_0x2e1a5d,_0x55ffb3){return _0x2e1a5d[_0x9367('0xb')](_0x9367('0xc'),attributes,{'tableName':_0x9367('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index f61d36e..aea5b2e 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 _0x04bc=['request','then','info','Migration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2384bb,_0x39682f){var _0x299201=function(_0x22c20d){while(--_0x22c20d){_0x2384bb['push'](_0x2384bb['shift']());}};_0x299201(++_0x39682f);}(_0x04bc,0x87));var _0xc04b=function(_0x153634,_0x1149e1){_0x153634=_0x153634-0x0;var _0x3ca49e=_0x04bc[_0x153634];return _0x3ca49e;};'use strict';var _=require(_0xc04b('0x0'));var util=require(_0xc04b('0x1'));var moment=require(_0xc04b('0x2'));var BPromise=require(_0xc04b('0x3'));var rs=require(_0xc04b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc04b('0x5'))['db'];var utils=require(_0xc04b('0x6'));var logger=require(_0xc04b('0x7'))(_0xc04b('0x8'));var config=require(_0xc04b('0x9'));var jayson=require(_0xc04b('0xa'));var client=jayson['client'][_0xc04b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12a8b9,_0x2751b7,_0x4b6e31){return new BPromise(function(_0x560f16,_0x50a66d){return client[_0xc04b('0xc')](_0x12a8b9,_0x4b6e31)[_0xc04b('0xd')](function(_0x50a5e2){logger[_0xc04b('0xe')](_0xc04b('0xf'),_0x2751b7,_0xc04b('0x10'));logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x2751b7,_0xc04b('0x10'),JSON[_0xc04b('0x11')](_0x50a5e2));if(_0x50a5e2[_0xc04b('0x12')]){if(_0x50a5e2[_0xc04b('0x12')][_0xc04b('0x13')]===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x2751b7,_0x50a5e2['error'][_0xc04b('0x14')]);return _0x50a66d(_0x50a5e2[_0xc04b('0x12')][_0xc04b('0x14')]);}logger[_0xc04b('0x12')]('Migration,\x20%s,\x20%s',_0x2751b7,_0x50a5e2['error'][_0xc04b('0x14')]);return _0x560f16(_0x50a5e2['error'][_0xc04b('0x14')]);}else{logger[_0xc04b('0xe')]('Migration,\x20%s,\x20%s',_0x2751b7,_0xc04b('0x10'));_0x560f16(_0x50a5e2['result']['message']);}})['catch'](function(_0x1393b5){logger['error']('Migration,\x20%s,\x20%s',_0x2751b7,_0x1393b5);_0x50a66d(_0x1393b5);});});} \ No newline at end of file +var _0x7381=['message','lodash','bluebird','rpc','../../config/environment','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dbb62,_0x4584f5){var _0x238c7c=function(_0x1054de){while(--_0x1054de){_0x3dbb62['push'](_0x3dbb62['shift']());}};_0x238c7c(++_0x4584f5);}(_0x7381,0x133));var _0x1738=function(_0x350258,_0x4e0a50){_0x350258=_0x350258-0x0;var _0x3714b3=_0x7381[_0x350258];return _0x3714b3;};'use strict';var _=require(_0x1738('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1738('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1738('0x2'));var config=require(_0x1738('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x1738('0x4')][_0x1738('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x274fa3,_0x340485,_0x42e934){return new BPromise(function(_0x14b828,_0x4f7b54){return client[_0x1738('0x6')](_0x274fa3,_0x42e934)[_0x1738('0x7')](function(_0x22f43a){logger[_0x1738('0x8')](_0x1738('0x9'),_0x340485,_0x1738('0xa'));logger[_0x1738('0xb')](_0x1738('0xc'),_0x340485,'request\x20sent',JSON[_0x1738('0xd')](_0x22f43a));if(_0x22f43a[_0x1738('0xe')]){if(_0x22f43a[_0x1738('0xe')][_0x1738('0xf')]===0x1f4){logger[_0x1738('0xe')]('Migration,\x20%s,\x20%s',_0x340485,_0x22f43a[_0x1738('0xe')][_0x1738('0x10')]);return _0x4f7b54(_0x22f43a['error'][_0x1738('0x10')]);}logger[_0x1738('0xe')](_0x1738('0x9'),_0x340485,_0x22f43a[_0x1738('0xe')][_0x1738('0x10')]);return _0x14b828(_0x22f43a[_0x1738('0xe')][_0x1738('0x10')]);}else{logger[_0x1738('0x8')](_0x1738('0x9'),_0x340485,_0x1738('0xa'));_0x14b828(_0x22f43a['result'][_0x1738('0x10')]);}})['catch'](function(_0x241e33){logger[_0x1738('0xe')]('Migration,\x20%s,\x20%s',_0x340485,_0x241e33);_0x4f7b54(_0x241e33);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index b87ef68..277768d 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 _0xc9b0=['get','index','/:id','isAuthenticated','show','post','create','put','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xc9b0,0x14c));var _0x0c9b=function(_0x8f2de2,_0x18a2de){_0x8f2de2=_0x8f2de2-0x0;var _0x24096d=_0xc9b0[_0x8f2de2];return _0x24096d;};'use strict';var multer=require(_0x0c9b('0x0'));var util=require(_0x0c9b('0x1'));var path=require(_0x0c9b('0x2'));var timeout=require(_0x0c9b('0x3'));var express=require(_0x0c9b('0x4'));var router=express[_0x0c9b('0x5')]();var auth=require(_0x0c9b('0x6'));var interaction=require(_0x0c9b('0x7'));var config=require(_0x0c9b('0x8'));var controller=require(_0x0c9b('0x9'));router[_0x0c9b('0xa')]('/',auth['isAuthenticated'](),controller[_0x0c9b('0xb')]);router[_0x0c9b('0xa')](_0x0c9b('0xc'),auth[_0x0c9b('0xd')](),controller[_0x0c9b('0xe')]);router[_0x0c9b('0xf')]('/',auth[_0x0c9b('0xd')](),controller[_0x0c9b('0x10')]);router[_0x0c9b('0x11')](_0x0c9b('0xc'),auth[_0x0c9b('0xd')](),controller['update']);router['delete'](_0x0c9b('0xc'),auth[_0x0c9b('0xd')](),controller['destroy']);module[_0x0c9b('0x12')]=router; \ No newline at end of file +var _0x7948=['/:id','show','post','create','put','update','delete','path','connect-timeout','express','../../components/auth/service','../../config/environment','./network.controller','isAuthenticated','index','get'];(function(_0x105b1f,_0x534168){var _0x3c5085=function(_0x30bf71){while(--_0x30bf71){_0x105b1f['push'](_0x105b1f['shift']());}};_0x3c5085(++_0x534168);}(_0x7948,0xc7));var _0x8794=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0x7948[_0x26b5ff];return _0x58603e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8794('0x0'));var timeout=require(_0x8794('0x1'));var express=require(_0x8794('0x2'));var router=express['Router']();var auth=require(_0x8794('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8794('0x4'));var controller=require(_0x8794('0x5'));router['get']('/',auth[_0x8794('0x6')](),controller[_0x8794('0x7')]);router[_0x8794('0x8')](_0x8794('0x9'),auth[_0x8794('0x6')](),controller[_0x8794('0xa')]);router[_0x8794('0xb')]('/',auth['isAuthenticated'](),controller[_0x8794('0xc')]);router[_0x8794('0xd')]('/:id',auth[_0x8794('0x6')](),controller[_0x8794('0xe')]);router[_0x8794('0xf')](_0x8794('0x9'),auth[_0x8794('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index f7ee6dd..0afca63 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 _0x738a=['exports','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x738a,0x1ac));var _0xa738=function(_0x492221,_0x9e2521){_0x492221=_0x492221-0x0;var _0x398bf9=_0x738a[_0x492221];return _0x398bf9;};'use strict';var Sequelize=require(_0xa738('0x0'));module[_0xa738('0x1')]={'type':{'type':Sequelize['ENUM']('localnet','externip')},'value':{'type':Sequelize[_0xa738('0x2')]}}; \ No newline at end of file +var _0x1b3b=['STRING','sequelize','exports','ENUM','localnet','externip'];(function(_0x1969b0,_0x25600a){var _0x3eaf21=function(_0x2f4e61){while(--_0x2f4e61){_0x1969b0['push'](_0x1969b0['shift']());}};_0x3eaf21(++_0x25600a);}(_0x1b3b,0x145));var _0xb1b3=function(_0x34f457,_0x5cf355){_0x34f457=_0x34f457-0x0;var _0x256b5a=_0x1b3b[_0x34f457];return _0x256b5a;};'use strict';var Sequelize=require(_0xb1b3('0x0'));module[_0xb1b3('0x1')]={'type':{'type':Sequelize[_0xb1b3('0x2')](_0xb1b3('0x3'),_0xb1b3('0x4'))},'value':{'type':Sequelize[_0xb1b3('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index c286aa8..08a0daf 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 _0x2836=['end','json','count','offset','limit','set','apply','reject','save','update','destroy','stack','name','index','Network','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','map','type','key','field','filter','include','findAll','show','params','rawAttributes','includeAll','find','create','sequelize','transaction','body','readFileSync','join','root','server/files/templates/network.ejs','utf8','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','Reload','render','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status'];(function(_0x20a944,_0xfef5f2){var _0x2fd486=function(_0x46fd46){while(--_0x46fd46){_0x20a944['push'](_0x20a944['shift']());}};_0x2fd486(++_0xfef5f2);}(_0x2836,0x1c6));var _0x6283=function(_0x2f73bc,_0x36e825){_0x2f73bc=_0x2f73bc-0x0;var _0x276cda=_0x2836[_0x2f73bc];return _0x276cda;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6283('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6283('0x1'));var jsonpatch=require(_0x6283('0x2'));var rp=require(_0x6283('0x3'));var moment=require(_0x6283('0x4'));var BPromise=require(_0x6283('0x5'));var Mustache=require(_0x6283('0x6'));var util=require(_0x6283('0x7'));var path=require('path');var sox=require(_0x6283('0x8'));var csv=require(_0x6283('0x9'));var ejs=require(_0x6283('0xa'));var fs=require('fs');var _=require(_0x6283('0xb'));var squel=require('squel');var crypto=require(_0x6283('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6283('0xd'));var toCsv=require(_0x6283('0x9'));var querystring=require(_0x6283('0xe'));var Papa=require(_0x6283('0xf'));var Redis=require(_0x6283('0x10'));var authService=require(_0x6283('0x11'));var qs=require(_0x6283('0x12'));var hardwareService=require(_0x6283('0x13'));var logger=require(_0x6283('0x14'))(_0x6283('0x15'));var utils=require(_0x6283('0x16'));var config=require(_0x6283('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x6283('0x18'));var client=jayson['client'][_0x6283('0x19')]({'port':0x232a});function checkPasswordPattern(_0x346a7b,_0x5b0872,_0x2e353e){if(_0x2e353e){var _0x19acce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x19acce[_0x6283('0x1a')](_0x5b0872)){return _0x346a7b;}else{throw new Error(_0x6283('0x1b'));}}else{return _0x346a7b;}}function respondWithRpcPromise(_0x27b50d,_0x386c19,_0x4ec729,_0x28b5ee){return new BPromise(function(_0x338df8,_0x4a794e){var _0x8fa82d=_0x28b5ee||client;return _0x8fa82d['request'](_0x27b50d,_0x4ec729)[_0x6283('0x1c')](function(_0x5b555d){logger[_0x6283('0x1d')](_0x6283('0x1e'),_0x386c19,_0x6283('0x1f'));logger[_0x6283('0x20')](_0x6283('0x21'),_0x386c19,'request\x20sent',JSON[_0x6283('0x22')](_0x5b555d));if(_0x5b555d[_0x6283('0x23')]){if(_0x5b555d[_0x6283('0x23')][_0x6283('0x24')]===0x1f4){logger[_0x6283('0x23')](_0x6283('0x1e'),_0x386c19,_0x5b555d['error'][_0x6283('0x25')]);return _0x4a794e(_0x5b555d[_0x6283('0x23')]['message']);}logger[_0x6283('0x23')]('Network,\x20%s,\x20%s',_0x386c19,_0x5b555d[_0x6283('0x23')][_0x6283('0x25')]);return _0x338df8(_0x5b555d[_0x6283('0x23')]['message']);}else{logger['info'](_0x6283('0x1e'),_0x386c19,'request\x20sent');_0x338df8(_0x5b555d['result']['message']);}})[_0x6283('0x26')](function(_0x139aa6){logger[_0x6283('0x23')](_0x6283('0x1e'),_0x386c19,_0x139aa6);_0x4a794e(_0x139aa6);});});}function respondWithStatusCode(_0x55c006,_0x1d81e8){_0x1d81e8=_0x1d81e8||0xcc;return function(_0x16d6e8){if(_0x16d6e8){return _0x55c006[_0x6283('0x27')](_0x1d81e8);}return _0x55c006[_0x6283('0x28')](_0x1d81e8)[_0x6283('0x29')]();};}function respondWithResult(_0x291fa8,_0x13ead8){_0x13ead8=_0x13ead8||0xc8;return function(_0x4d1abc){if(_0x4d1abc){return _0x291fa8[_0x6283('0x28')](_0x13ead8)[_0x6283('0x2a')](_0x4d1abc);}};}function respondWithFilteredResult(_0x4cd0c2,_0x512761){return function(_0x5a9f01){if(_0x5a9f01){var _0x18e98a=_0x5a9f01[_0x6283('0x2b')],_0x5e1263=_0x512761[_0x6283('0x2c')],_0x51fdf6=_0x512761[_0x6283('0x2c')]+_0x512761[_0x6283('0x2d')],_0x43d852;if(_0x51fdf6>=_0x18e98a){_0x51fdf6=_0x18e98a;_0x43d852=0xc8;}else{_0x43d852=0xce;}_0x4cd0c2['status'](_0x43d852);return _0x4cd0c2[_0x6283('0x2e')]('Content-Range',_0x5e1263+'-'+_0x51fdf6+'/'+_0x18e98a)[_0x6283('0x2a')](_0x5a9f01);}return null;};}function patchUpdates(_0x108626){return function(_0x5ede88){try{jsonpatch[_0x6283('0x2f')](_0x5ede88,_0x108626,!![]);}catch(_0x4c20f8){return BPromise[_0x6283('0x30')](_0x4c20f8);}return _0x5ede88[_0x6283('0x31')]();};}function saveUpdates(_0x123b7a,_0x2a76f5){return function(_0x3c7a63){if(_0x3c7a63){return _0x3c7a63[_0x6283('0x32')](_0x123b7a)['then'](function(_0x4f9497){return _0x4f9497;});}return null;};}function removeEntity(_0x1621ed,_0x5cc581){return function(_0x40e6ee){if(_0x40e6ee){return _0x40e6ee[_0x6283('0x33')]()[_0x6283('0x1c')](function(){_0x1621ed[_0x6283('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x237d38,_0x27b20b){return function(_0x1d5c67){if(!_0x1d5c67){_0x237d38['sendStatus'](0x194);}return _0x1d5c67;};}function handleError(_0x5e29af,_0x7ccc18){_0x7ccc18=_0x7ccc18||0x1f4;return function(_0x1e9366){logger[_0x6283('0x23')](_0x1e9366[_0x6283('0x34')]);if(_0x1e9366['name']){delete _0x1e9366[_0x6283('0x35')];}_0x5e29af[_0x6283('0x28')](_0x7ccc18)['send'](_0x1e9366);};}exports[_0x6283('0x36')]=function(_0x5bb3c2,_0x2da573){var _0x4af0be={},_0x33894b={},_0xcce0c5={'count':0x0,'rows':[]};var _0x5ef354=db[_0x6283('0x37')]['rawAttributes'];_0x33894b[_0x6283('0x38')]=_[_0x6283('0x39')](_0x5ef354);_0x33894b[_0x6283('0x3a')]=_[_0x6283('0x39')](_0x5bb3c2[_0x6283('0x3a')]);_0x33894b[_0x6283('0x3b')]=_[_0x6283('0x3c')](_0x33894b[_0x6283('0x38')],_0x33894b[_0x6283('0x3a')]);_0x4af0be[_0x6283('0x3d')]=_[_0x6283('0x3c')](_0x33894b[_0x6283('0x38')],qs[_0x6283('0x3e')](_0x5bb3c2['query'][_0x6283('0x3e')]));_0x4af0be[_0x6283('0x3d')]=_0x4af0be[_0x6283('0x3d')][_0x6283('0x3f')]?_0x4af0be[_0x6283('0x3d')]:_0x33894b[_0x6283('0x38')];if(!_0x5bb3c2[_0x6283('0x3a')][_0x6283('0x40')](_0x6283('0x41'))){_0x4af0be['limit']=qs[_0x6283('0x2d')](_0x5bb3c2[_0x6283('0x3a')][_0x6283('0x2d')]);_0x4af0be['offset']=qs[_0x6283('0x2c')](_0x5bb3c2[_0x6283('0x3a')][_0x6283('0x2c')]);}_0x4af0be[_0x6283('0x42')]=qs['sort'](_0x5bb3c2[_0x6283('0x3a')][_0x6283('0x43')]);_0x4af0be['where']=qs[_0x6283('0x3b')](_[_0x6283('0x44')](_0x5bb3c2['query'],_0x33894b[_0x6283('0x3b')]));if(_0x5bb3c2['query']['filter']){_0x4af0be['where']=_[_0x6283('0x45')](_0x4af0be[_0x6283('0x46')],{'$or':_[_0x6283('0x47')](_0x5ef354,function(_0x440042){if(_0x440042[_0x6283('0x48')][_0x6283('0x49')]!=='VIRTUAL'){var _0x26c1b7={};_0x26c1b7[_0x440042[_0x6283('0x4a')]]={'$like':'%'+_0x5bb3c2[_0x6283('0x3a')][_0x6283('0x4b')]+'%'};return _0x26c1b7;}})});}_0x4af0be=_['merge']({},_0x4af0be,_0x5bb3c2['options']);var _0x5cb237={'where':_0x4af0be['where']};return db[_0x6283('0x37')][_0x6283('0x2b')](_0x5cb237)[_0x6283('0x1c')](function(_0x2b440a){_0xcce0c5[_0x6283('0x2b')]=_0x2b440a;if(_0x5bb3c2[_0x6283('0x3a')]['includeAll']){_0x4af0be[_0x6283('0x4c')]=[{'all':!![]}];}return db[_0x6283('0x37')][_0x6283('0x4d')](_0x4af0be);})['then'](function(_0x1382cb){_0xcce0c5['rows']=_0x1382cb;return _0xcce0c5;})[_0x6283('0x1c')](respondWithFilteredResult(_0x2da573,_0x4af0be))[_0x6283('0x26')](handleError(_0x2da573,null));};exports[_0x6283('0x4e')]=function(_0x9a90a5,_0x2e2263){var _0x143c4b={'raw':!![],'where':{'id':_0x9a90a5[_0x6283('0x4f')]['id']}},_0x579e0e={};_0x579e0e['model']=_[_0x6283('0x39')](db[_0x6283('0x37')][_0x6283('0x50')]);_0x579e0e['query']=_[_0x6283('0x39')](_0x9a90a5[_0x6283('0x3a')]);_0x579e0e[_0x6283('0x3b')]=_['intersection'](_0x579e0e[_0x6283('0x38')],_0x579e0e['query']);_0x143c4b['attributes']=_['intersection'](_0x579e0e[_0x6283('0x38')],qs[_0x6283('0x3e')](_0x9a90a5['query']['fields']));_0x143c4b['attributes']=_0x143c4b[_0x6283('0x3d')][_0x6283('0x3f')]?_0x143c4b[_0x6283('0x3d')]:_0x579e0e[_0x6283('0x38')];if(_0x9a90a5[_0x6283('0x3a')][_0x6283('0x51')]){_0x143c4b['include']=[{'all':!![]}];}_0x143c4b=_['merge']({},_0x143c4b,_0x9a90a5['options']);return db[_0x6283('0x37')][_0x6283('0x52')](_0x143c4b)[_0x6283('0x1c')](handleEntityNotFound(_0x2e2263,null))['then'](respondWithResult(_0x2e2263,null))['catch'](handleError(_0x2e2263,null));};exports[_0x6283('0x53')]=function(_0x4baa54,_0x39c3e9,_0x3b7bfd){var _0x3e14cf;return db[_0x6283('0x54')][_0x6283('0x55')](function(_0x2ba88d){return db[_0x6283('0x37')][_0x6283('0x53')](_0x4baa54['body'],{'raw':!![]})[_0x6283('0x1c')](function(_0x5a32ce){_0x3e14cf=_0x5a32ce;return db[_0x6283('0x37')]['findAll']({'where':{'type':_0x4baa54[_0x6283('0x56')]['type']},'raw':!![]});})[_0x6283('0x1c')](function(_0x7c1968){var _0x28701f=fs[_0x6283('0x57')](path[_0x6283('0x58')](config[_0x6283('0x59')],_0x6283('0x5a')),_0x6283('0x5b'));var _0x3529cc=ejs['render'](_0x28701f,{'networks':_0x7c1968||[]});fs[_0x6283('0x5c')](util[_0x6283('0x5d')](_0x6283('0x5e'),_0x4baa54[_0x6283('0x56')][_0x6283('0x48')][_0x6283('0x5f')]()),_0x3529cc);})[_0x6283('0x1c')](function(){return respondWithRpcPromise('Reload',_0x6283('0x53'),{'module':_0x6283('0x60')});})[_0x6283('0x1c')](function(){return _0x3e14cf;});})[_0x6283('0x1c')](respondWithResult(_0x39c3e9,0xc9))['catch'](handleError(_0x39c3e9,null));};exports[_0x6283('0x32')]=function(_0x50334d,_0xc4ce6c,_0x494975){var _0xc67e6c;return db['sequelize'][_0x6283('0x55')](function(_0x561a6a){return db[_0x6283('0x37')][_0x6283('0x52')]({'where':{'id':_0x50334d['params']['id']}})[_0x6283('0x1c')](handleEntityNotFound(_0xc4ce6c,null))['then'](saveUpdates(_0x50334d[_0x6283('0x56')],null))[_0x6283('0x1c')](function(_0x16b16d){if(_0x16b16d){_0xc67e6c=_0x16b16d;return db[_0x6283('0x37')]['findAll']({'where':{'type':_0xc67e6c[_0x6283('0x48')]},'raw':!![]});}return null;})['then'](function(_0x5d1021){if(_0x5d1021){var _0x591ea7=fs[_0x6283('0x57')](path[_0x6283('0x58')](config[_0x6283('0x59')],_0x6283('0x5a')),_0x6283('0x5b'));var _0x256433=ejs['render'](_0x591ea7,{'networks':_0x5d1021||[]});fs[_0x6283('0x5c')](util[_0x6283('0x5d')](_0x6283('0x5e'),_0xc67e6c[_0x6283('0x48')]['toLowerCase']()),_0x256433);return respondWithRpcPromise(_0x6283('0x61'),_0x6283('0x32'),{'module':_0x6283('0x60')});}return null;})[_0x6283('0x1c')](function(_0x21d74a){if(_0x21d74a){return _0xc67e6c;}return null;});})[_0x6283('0x1c')](respondWithResult(_0xc4ce6c,null))[_0x6283('0x26')](handleError(_0xc4ce6c,null));};exports[_0x6283('0x33')]=function(_0x154190,_0x246e3f,_0x52e04d){var _0x514d09;return db[_0x6283('0x37')][_0x6283('0x52')]({'where':{'id':_0x154190[_0x6283('0x4f')]['id']}})[_0x6283('0x1c')](function(_0x36ffcf){_0x514d09=_0x36ffcf;return _0x36ffcf;})['then'](handleEntityNotFound(_0x246e3f,null))[_0x6283('0x1c')](removeEntity(_0x246e3f,null))[_0x6283('0x1c')](function(){if(_0x514d09){return db['Network'][_0x6283('0x4d')]({'where':{'type':_0x514d09[_0x6283('0x48')]},'raw':!![]});}})[_0x6283('0x1c')](function(_0x3fadb8){if(_0x3fadb8){var _0x2f946d=fs[_0x6283('0x57')](path['join'](config[_0x6283('0x59')],_0x6283('0x5a')),_0x6283('0x5b'));var _0xf78576=ejs[_0x6283('0x62')](_0x2f946d,{'networks':_0x3fadb8||[]});fs['writeFileSync'](util['format'](_0x6283('0x5e'),_0x514d09[_0x6283('0x48')][_0x6283('0x5f')]()),_0xf78576);return respondWithRpcPromise(_0x6283('0x61'),_0x6283('0x33'),{'module':_0x6283('0x60')});}})['catch'](handleError(_0x246e3f,null));}; \ No newline at end of file +var _0x878e=['format','/etc/asterisk/sip_xcally_%s.conf','Reload','create','chan_sip.so','transaction','join','toLowerCase','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','Network,\x20%s,\x20%s','Network,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','Network','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','limit','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','sequelize','body','findAll','readFileSync','root','server/files/templates/network.ejs','utf8','render'];(function(_0x587305,_0x592c76){var _0x4e7e82=function(_0x576688){while(--_0x576688){_0x587305['push'](_0x587305['shift']());}};_0x4e7e82(++_0x592c76);}(_0x878e,0x199));var _0xe878=function(_0x307b9b,_0x517387){_0x307b9b=_0x307b9b-0x0;var _0x15b860=_0x878e[_0x307b9b];return _0x15b860;};'use strict';var pdf=require(_0xe878('0x0'));var emlformat=require(_0xe878('0x1'));var rimraf=require(_0xe878('0x2'));var zipdir=require(_0xe878('0x3'));var jsonpatch=require(_0xe878('0x4'));var rp=require('request-promise');var moment=require(_0xe878('0x5'));var BPromise=require(_0xe878('0x6'));var Mustache=require(_0xe878('0x7'));var util=require('util');var path=require(_0xe878('0x8'));var sox=require(_0xe878('0x9'));var csv=require('to-csv');var ejs=require(_0xe878('0xa'));var fs=require('fs');var _=require(_0xe878('0xb'));var squel=require(_0xe878('0xc'));var crypto=require(_0xe878('0xd'));var jsforce=require(_0xe878('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe878('0xf'));var querystring=require(_0xe878('0x10'));var Papa=require(_0xe878('0x11'));var Redis=require('ioredis');var authService=require(_0xe878('0x12'));var qs=require(_0xe878('0x13'));var hardwareService=require(_0xe878('0x14'));var logger=require(_0xe878('0x15'))(_0xe878('0x16'));var utils=require(_0xe878('0x17'));var config=require('../../config/environment');var db=require(_0xe878('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe878('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x47ec73,_0x8e0f60,_0x12531a){if(_0x12531a){var _0x4db888=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4db888[_0xe878('0x1a')](_0x8e0f60)){return _0x47ec73;}else{throw new Error(_0xe878('0x1b'));}}else{return _0x47ec73;}}function respondWithRpcPromise(_0x26f96c,_0x4df9d6,_0x1b29d8,_0x6f388f){return new BPromise(function(_0x145e46,_0x2f76a9){var _0x470080=_0x6f388f||client;return _0x470080[_0xe878('0x1c')](_0x26f96c,_0x1b29d8)[_0xe878('0x1d')](function(_0x368ac8){logger['info'](_0xe878('0x1e'),_0x4df9d6,'request\x20sent');logger['debug'](_0xe878('0x1f'),_0x4df9d6,_0xe878('0x20'),JSON['stringify'](_0x368ac8));if(_0x368ac8[_0xe878('0x21')]){if(_0x368ac8[_0xe878('0x21')][_0xe878('0x22')]===0x1f4){logger[_0xe878('0x21')](_0xe878('0x1e'),_0x4df9d6,_0x368ac8[_0xe878('0x21')]['message']);return _0x2f76a9(_0x368ac8[_0xe878('0x21')]['message']);}logger[_0xe878('0x21')](_0xe878('0x1e'),_0x4df9d6,_0x368ac8[_0xe878('0x21')][_0xe878('0x23')]);return _0x145e46(_0x368ac8['error'][_0xe878('0x23')]);}else{logger[_0xe878('0x24')](_0xe878('0x1e'),_0x4df9d6,'request\x20sent');_0x145e46(_0x368ac8[_0xe878('0x25')][_0xe878('0x23')]);}})['catch'](function(_0x4d4ad7){logger[_0xe878('0x21')]('Network,\x20%s,\x20%s',_0x4df9d6,_0x4d4ad7);_0x2f76a9(_0x4d4ad7);});});}function respondWithStatusCode(_0x16a616,_0x11dabd){_0x11dabd=_0x11dabd||0xcc;return function(_0x5bd250){if(_0x5bd250){return _0x16a616[_0xe878('0x26')](_0x11dabd);}return _0x16a616[_0xe878('0x27')](_0x11dabd)[_0xe878('0x28')]();};}function respondWithResult(_0x372850,_0x56d14e){_0x56d14e=_0x56d14e||0xc8;return function(_0x4c0a60){if(_0x4c0a60){return _0x372850[_0xe878('0x27')](_0x56d14e)[_0xe878('0x29')](_0x4c0a60);}};}function respondWithFilteredResult(_0x587e58,_0x513c87){return function(_0x4726f2){if(_0x4726f2){var _0x4d86cb=_0x4726f2[_0xe878('0x2a')],_0x3c78e5=_0x513c87['offset'],_0xf6fce2=_0x513c87[_0xe878('0x2b')]+_0x513c87['limit'],_0x1d718f;if(_0xf6fce2>=_0x4d86cb){_0xf6fce2=_0x4d86cb;_0x1d718f=0xc8;}else{_0x1d718f=0xce;}_0x587e58[_0xe878('0x27')](_0x1d718f);return _0x587e58[_0xe878('0x2c')](_0xe878('0x2d'),_0x3c78e5+'-'+_0xf6fce2+'/'+_0x4d86cb)['json'](_0x4726f2);}return null;};}function patchUpdates(_0x5bd612){return function(_0x320eff){try{jsonpatch[_0xe878('0x2e')](_0x320eff,_0x5bd612,!![]);}catch(_0x24bb03){return BPromise[_0xe878('0x2f')](_0x24bb03);}return _0x320eff[_0xe878('0x30')]();};}function saveUpdates(_0x40baa9,_0x3a3604){return function(_0x4278c3){if(_0x4278c3){return _0x4278c3[_0xe878('0x31')](_0x40baa9)[_0xe878('0x1d')](function(_0x5b15b1){return _0x5b15b1;});}return null;};}function removeEntity(_0x2d9707,_0x1e9152){return function(_0x447dbc){if(_0x447dbc){return _0x447dbc[_0xe878('0x32')]()[_0xe878('0x1d')](function(){_0x2d9707['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28ae57,_0x233989){return function(_0x22acf7){if(!_0x22acf7){_0x28ae57[_0xe878('0x26')](0x194);}return _0x22acf7;};}function handleError(_0x330f64,_0x585cd4){_0x585cd4=_0x585cd4||0x1f4;return function(_0x5a54e9){logger[_0xe878('0x21')](_0x5a54e9[_0xe878('0x33')]);if(_0x5a54e9[_0xe878('0x34')]){delete _0x5a54e9['name'];}_0x330f64[_0xe878('0x27')](_0x585cd4)[_0xe878('0x35')](_0x5a54e9);};}exports[_0xe878('0x36')]=function(_0x58d652,_0x431b1b){var _0x4a8e87={},_0x1f5e6c={},_0x2624af={'count':0x0,'rows':[]};var _0x4d088c=db[_0xe878('0x37')][_0xe878('0x38')];_0x1f5e6c[_0xe878('0x39')]=_[_0xe878('0x3a')](_0x4d088c);_0x1f5e6c[_0xe878('0x3b')]=_[_0xe878('0x3a')](_0x58d652['query']);_0x1f5e6c['filters']=_[_0xe878('0x3c')](_0x1f5e6c[_0xe878('0x39')],_0x1f5e6c[_0xe878('0x3b')]);_0x4a8e87['attributes']=_['intersection'](_0x1f5e6c['model'],qs[_0xe878('0x3d')](_0x58d652[_0xe878('0x3b')][_0xe878('0x3d')]));_0x4a8e87['attributes']=_0x4a8e87[_0xe878('0x3e')][_0xe878('0x3f')]?_0x4a8e87[_0xe878('0x3e')]:_0x1f5e6c[_0xe878('0x39')];if(!_0x58d652[_0xe878('0x3b')]['hasOwnProperty'](_0xe878('0x40'))){_0x4a8e87[_0xe878('0x41')]=qs[_0xe878('0x41')](_0x58d652['query']['limit']);_0x4a8e87[_0xe878('0x2b')]=qs['offset'](_0x58d652[_0xe878('0x3b')]['offset']);}_0x4a8e87['order']=qs[_0xe878('0x42')](_0x58d652[_0xe878('0x3b')]['sort']);_0x4a8e87[_0xe878('0x43')]=qs[_0xe878('0x44')](_[_0xe878('0x45')](_0x58d652[_0xe878('0x3b')],_0x1f5e6c[_0xe878('0x44')]));if(_0x58d652[_0xe878('0x3b')][_0xe878('0x46')]){_0x4a8e87[_0xe878('0x43')]=_[_0xe878('0x47')](_0x4a8e87['where'],{'$or':_[_0xe878('0x48')](_0x4d088c,function(_0x4828d0){if(_0x4828d0[_0xe878('0x49')][_0xe878('0x4a')]!==_0xe878('0x4b')){var _0xeeec72={};_0xeeec72[_0x4828d0['field']]={'$like':'%'+_0x58d652[_0xe878('0x3b')][_0xe878('0x46')]+'%'};return _0xeeec72;}})});}_0x4a8e87=_[_0xe878('0x47')]({},_0x4a8e87,_0x58d652[_0xe878('0x4c')]);var _0x338b2d={'where':_0x4a8e87[_0xe878('0x43')]};return db['Network'][_0xe878('0x2a')](_0x338b2d)['then'](function(_0x91414b){_0x2624af[_0xe878('0x2a')]=_0x91414b;if(_0x58d652[_0xe878('0x3b')][_0xe878('0x4d')]){_0x4a8e87[_0xe878('0x4e')]=[{'all':!![]}];}return db[_0xe878('0x37')]['findAll'](_0x4a8e87);})['then'](function(_0x3c673b){_0x2624af[_0xe878('0x4f')]=_0x3c673b;return _0x2624af;})['then'](respondWithFilteredResult(_0x431b1b,_0x4a8e87))[_0xe878('0x50')](handleError(_0x431b1b,null));};exports[_0xe878('0x51')]=function(_0x53ee78,_0xd38df6){var _0x402e9f={'raw':!![],'where':{'id':_0x53ee78[_0xe878('0x52')]['id']}},_0x558984={};_0x558984['model']=_[_0xe878('0x3a')](db[_0xe878('0x37')][_0xe878('0x38')]);_0x558984['query']=_[_0xe878('0x3a')](_0x53ee78[_0xe878('0x3b')]);_0x558984['filters']=_[_0xe878('0x3c')](_0x558984['model'],_0x558984[_0xe878('0x3b')]);_0x402e9f[_0xe878('0x3e')]=_['intersection'](_0x558984[_0xe878('0x39')],qs[_0xe878('0x3d')](_0x53ee78[_0xe878('0x3b')]['fields']));_0x402e9f['attributes']=_0x402e9f[_0xe878('0x3e')][_0xe878('0x3f')]?_0x402e9f[_0xe878('0x3e')]:_0x558984[_0xe878('0x39')];if(_0x53ee78[_0xe878('0x3b')]['includeAll']){_0x402e9f['include']=[{'all':!![]}];}_0x402e9f=_['merge']({},_0x402e9f,_0x53ee78[_0xe878('0x4c')]);return db[_0xe878('0x37')]['find'](_0x402e9f)[_0xe878('0x1d')](handleEntityNotFound(_0xd38df6,null))[_0xe878('0x1d')](respondWithResult(_0xd38df6,null))[_0xe878('0x50')](handleError(_0xd38df6,null));};exports['create']=function(_0x5c0822,_0x4fa6e5,_0x385b2e){var _0x3028fd;return db[_0xe878('0x53')]['transaction'](function(_0xd8044c){return db[_0xe878('0x37')]['create'](_0x5c0822[_0xe878('0x54')],{'raw':!![]})['then'](function(_0x50921e){_0x3028fd=_0x50921e;return db[_0xe878('0x37')][_0xe878('0x55')]({'where':{'type':_0x5c0822[_0xe878('0x54')][_0xe878('0x49')]},'raw':!![]});})[_0xe878('0x1d')](function(_0x10c1cb){var _0x4b8cc8=fs[_0xe878('0x56')](path['join'](config[_0xe878('0x57')],_0xe878('0x58')),_0xe878('0x59'));var _0x4eaf82=ejs[_0xe878('0x5a')](_0x4b8cc8,{'networks':_0x10c1cb||[]});fs['writeFileSync'](util[_0xe878('0x5b')](_0xe878('0x5c'),_0x5c0822['body'][_0xe878('0x49')]['toLowerCase']()),_0x4eaf82);})[_0xe878('0x1d')](function(){return respondWithRpcPromise(_0xe878('0x5d'),_0xe878('0x5e'),{'module':_0xe878('0x5f')});})['then'](function(){return _0x3028fd;});})['then'](respondWithResult(_0x4fa6e5,0xc9))[_0xe878('0x50')](handleError(_0x4fa6e5,null));};exports['update']=function(_0x482d64,_0x58f622,_0x135abd){var _0x4f94bd;return db[_0xe878('0x53')][_0xe878('0x60')](function(_0x1d9951){return db[_0xe878('0x37')]['find']({'where':{'id':_0x482d64[_0xe878('0x52')]['id']}})['then'](handleEntityNotFound(_0x58f622,null))['then'](saveUpdates(_0x482d64[_0xe878('0x54')],null))[_0xe878('0x1d')](function(_0x975c77){if(_0x975c77){_0x4f94bd=_0x975c77;return db['Network'][_0xe878('0x55')]({'where':{'type':_0x4f94bd[_0xe878('0x49')]},'raw':!![]});}return null;})[_0xe878('0x1d')](function(_0xf8d1e5){if(_0xf8d1e5){var _0x3486ce=fs['readFileSync'](path[_0xe878('0x61')](config['root'],_0xe878('0x58')),'utf8');var _0x109a26=ejs[_0xe878('0x5a')](_0x3486ce,{'networks':_0xf8d1e5||[]});fs['writeFileSync'](util[_0xe878('0x5b')](_0xe878('0x5c'),_0x4f94bd[_0xe878('0x49')][_0xe878('0x62')]()),_0x109a26);return respondWithRpcPromise(_0xe878('0x5d'),_0xe878('0x31'),{'module':_0xe878('0x5f')});}return null;})[_0xe878('0x1d')](function(_0x3384b4){if(_0x3384b4){return _0x4f94bd;}return null;});})[_0xe878('0x1d')](respondWithResult(_0x58f622,null))['catch'](handleError(_0x58f622,null));};exports[_0xe878('0x32')]=function(_0x2cae21,_0x140e93,_0x32dcc2){var _0x191156;return db[_0xe878('0x37')][_0xe878('0x63')]({'where':{'id':_0x2cae21[_0xe878('0x52')]['id']}})['then'](function(_0x1c47a2){_0x191156=_0x1c47a2;return _0x1c47a2;})['then'](handleEntityNotFound(_0x140e93,null))[_0xe878('0x1d')](removeEntity(_0x140e93,null))[_0xe878('0x1d')](function(){if(_0x191156){return db[_0xe878('0x37')][_0xe878('0x55')]({'where':{'type':_0x191156[_0xe878('0x49')]},'raw':!![]});}})[_0xe878('0x1d')](function(_0x39ae27){if(_0x39ae27){var _0x5529c7=fs[_0xe878('0x56')](path['join'](config['root'],_0xe878('0x58')),_0xe878('0x59'));var _0x2633c3=ejs[_0xe878('0x5a')](_0x5529c7,{'networks':_0x39ae27||[]});fs['writeFileSync'](util['format'](_0xe878('0x5c'),_0x191156[_0xe878('0x49')][_0xe878('0x62')]()),_0x2633c3);return respondWithRpcPromise(_0xe878('0x5d'),_0xe878('0x32'),{'module':'chan_sip.so'});}})['catch'](handleError(_0x140e93,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 345d4bf..803cf40 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 _0x6258=['bluebird','request-promise','path','../../config/environment','./network.attributes','exports','lodash','util','../../config/logger','moment'];(function(_0x21a6ff,_0x2556e4){var _0x174123=function(_0x251b71){while(--_0x251b71){_0x21a6ff['push'](_0x21a6ff['shift']());}};_0x174123(++_0x2556e4);}(_0x6258,0x164));var _0x8625=function(_0x91238c,_0x3baa9e){_0x91238c=_0x91238c-0x0;var _0x577a80=_0x6258[_0x91238c];return _0x577a80;};'use strict';var _=require(_0x8625('0x0'));var util=require(_0x8625('0x1'));var logger=require(_0x8625('0x2'))('api');var moment=require(_0x8625('0x3'));var BPromise=require(_0x8625('0x4'));var rp=require(_0x8625('0x5'));var fs=require('fs');var path=require(_0x8625('0x6'));var rimraf=require('rimraf');var config=require(_0x8625('0x7'));var attributes=require(_0x8625('0x8'));module[_0x8625('0x9')]=function(_0x5d9acb,_0x503f3b){return _0x5d9acb['define']('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf537=['request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','moment','bluebird'];(function(_0x41adde,_0x48f5be){var _0x3c7332=function(_0xb8e5cd){while(--_0xb8e5cd){_0x41adde['push'](_0x41adde['shift']());}};_0x3c7332(++_0x48f5be);}(_0xf537,0x95));var _0x7f53=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf537[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x7f53('0x0'));var util=require(_0x7f53('0x1'));var logger=require(_0x7f53('0x2'))('api');var moment=require(_0x7f53('0x3'));var BPromise=require(_0x7f53('0x4'));var rp=require(_0x7f53('0x5'));var fs=require('fs');var path=require(_0x7f53('0x6'));var rimraf=require(_0x7f53('0x7'));var config=require(_0x7f53('0x8'));var attributes=require(_0x7f53('0x9'));module[_0x7f53('0xa')]=function(_0x4b9227,_0x14d923){return _0x4b9227[_0x7f53('0xb')](_0x7f53('0xc'),attributes,{'tableName':_0x7f53('0xd'),'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 e62ae8f..b2105ab 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 _0xb392=['client','http','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','Network,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4b747e,_0x426e88){var _0x5d42e5=function(_0xabf4e7){while(--_0xabf4e7){_0x4b747e['push'](_0x4b747e['shift']());}};_0x5d42e5(++_0x426e88);}(_0xb392,0x182));var _0x2b39=function(_0x1b5ebe,_0x141a12){_0x1b5ebe=_0x1b5ebe-0x0;var _0x5be4c6=_0xb392[_0x1b5ebe];return _0x5be4c6;};'use strict';var _=require(_0x2b39('0x0'));var util=require(_0x2b39('0x1'));var moment=require(_0x2b39('0x2'));var BPromise=require(_0x2b39('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b39('0x4'));var db=require(_0x2b39('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b39('0x6'))(_0x2b39('0x7'));var config=require(_0x2b39('0x8'));var jayson=require(_0x2b39('0x9'));var client=jayson[_0x2b39('0xa')][_0x2b39('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bee95,_0xa95079,_0x90fd78){return new BPromise(function(_0x55a50e,_0x4be19a){return client['request'](_0x1bee95,_0x90fd78)[_0x2b39('0xc')](function(_0x19dc7f){logger[_0x2b39('0xd')]('Network,\x20%s,\x20%s',_0xa95079,_0x2b39('0xe'));logger[_0x2b39('0xf')](_0x2b39('0x10'),_0xa95079,_0x2b39('0xe'),JSON['stringify'](_0x19dc7f));if(_0x19dc7f[_0x2b39('0x11')]){if(_0x19dc7f[_0x2b39('0x11')]['code']===0x1f4){logger[_0x2b39('0x11')](_0x2b39('0x12'),_0xa95079,_0x19dc7f[_0x2b39('0x11')][_0x2b39('0x13')]);return _0x4be19a(_0x19dc7f[_0x2b39('0x11')][_0x2b39('0x13')]);}logger[_0x2b39('0x11')](_0x2b39('0x12'),_0xa95079,_0x19dc7f['error'][_0x2b39('0x13')]);return _0x55a50e(_0x19dc7f['error']['message']);}else{logger[_0x2b39('0xd')](_0x2b39('0x12'),_0xa95079,_0x2b39('0xe'));_0x55a50e(_0x19dc7f[_0x2b39('0x14')][_0x2b39('0x13')]);}})[_0x2b39('0x15')](function(_0x2cfc12){logger['error']('Network,\x20%s,\x20%s',_0xa95079,_0x2cfc12);_0x4be19a(_0x2cfc12);});});} \ No newline at end of file +var _0xda7c=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x46d43f,_0x16ec5e){var _0x21d4c0=function(_0x5620f6){while(--_0x5620f6){_0x46d43f['push'](_0x46d43f['shift']());}};_0x21d4c0(++_0x16ec5e);}(_0xda7c,0x115));var _0xcda7=function(_0x1aa36c,_0x217c35){_0x1aa36c=_0x1aa36c-0x0;var _0x50b719=_0xda7c[_0x1aa36c];return _0x50b719;};'use strict';var _=require(_0xcda7('0x0'));var util=require(_0xcda7('0x1'));var moment=require(_0xcda7('0x2'));var BPromise=require(_0xcda7('0x3'));var rs=require(_0xcda7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcda7('0x5'))['db'];var utils=require(_0xcda7('0x6'));var logger=require('../../config/logger')(_0xcda7('0x7'));var config=require(_0xcda7('0x8'));var jayson=require(_0xcda7('0x9'));var client=jayson[_0xcda7('0xa')][_0xcda7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf19968,_0x193f42,_0x35a44c){return new BPromise(function(_0x2a15dc,_0x5c167b){return client[_0xcda7('0xc')](_0xf19968,_0x35a44c)[_0xcda7('0xd')](function(_0x39191d){logger[_0xcda7('0xe')](_0xcda7('0xf'),_0x193f42,_0xcda7('0x10'));logger[_0xcda7('0x11')]('Network,\x20%s,\x20%s,\x20%s',_0x193f42,_0xcda7('0x10'),JSON[_0xcda7('0x12')](_0x39191d));if(_0x39191d[_0xcda7('0x13')]){if(_0x39191d[_0xcda7('0x13')][_0xcda7('0x14')]===0x1f4){logger['error'](_0xcda7('0xf'),_0x193f42,_0x39191d[_0xcda7('0x13')][_0xcda7('0x15')]);return _0x5c167b(_0x39191d['error'][_0xcda7('0x15')]);}logger['error'](_0xcda7('0xf'),_0x193f42,_0x39191d[_0xcda7('0x13')][_0xcda7('0x15')]);return _0x2a15dc(_0x39191d['error'][_0xcda7('0x15')]);}else{logger[_0xcda7('0xe')](_0xcda7('0xf'),_0x193f42,_0xcda7('0x10'));_0x2a15dc(_0x39191d['result'][_0xcda7('0x15')]);}})[_0xcda7('0x16')](function(_0x41beab){logger[_0xcda7('0x13')]('Network,\x20%s,\x20%s',_0x193f42,_0x41beab);_0x5c167b(_0x41beab);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index eee5cd8..ad6bad1 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 _0xf514=['/:id/canned_answers','/:id/applications','/:id/interactions','getInteractions','/:id/users','post','create','addDisposition','notify','addApplications','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/describe','show','/:id/dispositions','getDispositions'];(function(_0x4ba3de,_0x44d777){var _0x32c87a=function(_0x13eb81){while(--_0x13eb81){_0x4ba3de['push'](_0x4ba3de['shift']());}};_0x32c87a(++_0x44d777);}(_0xf514,0xa5));var _0x4f51=function(_0x129641,_0x171b99){_0x129641=_0x129641-0x0;var _0x4797d5=_0xf514[_0x129641];return _0x4797d5;};'use strict';var multer=require(_0x4f51('0x0'));var util=require('util');var path=require(_0x4f51('0x1'));var timeout=require(_0x4f51('0x2'));var express=require(_0x4f51('0x3'));var router=express[_0x4f51('0x4')]();var auth=require(_0x4f51('0x5'));var interaction=require(_0x4f51('0x6'));var config=require(_0x4f51('0x7'));var controller=require(_0x4f51('0x8'));router[_0x4f51('0x9')]('/',auth[_0x4f51('0xa')](),controller['index']);router[_0x4f51('0x9')](_0x4f51('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4f51('0x9')]('/:id',auth[_0x4f51('0xa')](),controller[_0x4f51('0xc')]);router[_0x4f51('0x9')](_0x4f51('0xd'),auth[_0x4f51('0xa')](),controller[_0x4f51('0xe')]);router[_0x4f51('0x9')](_0x4f51('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x4f51('0x9')](_0x4f51('0x10'),auth['isAuthenticated'](),controller['getApplications']);router['get'](_0x4f51('0x11'),auth[_0x4f51('0xa')](),controller[_0x4f51('0x12')]);router[_0x4f51('0x9')](_0x4f51('0x13'),auth[_0x4f51('0xa')](),controller['getAgents']);router[_0x4f51('0x14')]('/',auth[_0x4f51('0xa')](),controller[_0x4f51('0x15')]);router[_0x4f51('0x14')](_0x4f51('0xd'),auth[_0x4f51('0xa')](),controller[_0x4f51('0x16')]);router[_0x4f51('0x14')](_0x4f51('0xf'),auth[_0x4f51('0xa')](),controller['addAnswer']);router[_0x4f51('0x14')]('/:id/notify',controller[_0x4f51('0x17')]);router[_0x4f51('0x14')](_0x4f51('0x10'),auth[_0x4f51('0xa')](),controller[_0x4f51('0x18')]);router[_0x4f51('0x14')](_0x4f51('0x13'),auth['isAuthenticated'](),controller['addAgents']);router[_0x4f51('0x14')](_0x4f51('0x19'),auth['isAuthenticated'](),controller[_0x4f51('0x1a')]);router[_0x4f51('0x1b')](_0x4f51('0x1c'),auth['isAuthenticated'](),controller[_0x4f51('0x1d')]);router[_0x4f51('0x1e')](_0x4f51('0x1c'),auth[_0x4f51('0xa')](),controller[_0x4f51('0x1f')]);router['delete'](_0x4f51('0xd'),auth[_0x4f51('0xa')](),controller[_0x4f51('0x20')]);router['delete'](_0x4f51('0xf'),auth['isAuthenticated'](),controller[_0x4f51('0x21')]);router['delete'](_0x4f51('0x13'),auth['isAuthenticated'](),controller[_0x4f51('0x22')]);module[_0x4f51('0x23')]=router; \ No newline at end of file +var _0x5c2d=['show','getAnswers','getApplications','getInteractions','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','notify','/:id/applications','addApplications','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x1babf4,_0x415dc1){var _0x569406=function(_0x396161){while(--_0x396161){_0x1babf4['push'](_0x1babf4['shift']());}};_0x569406(++_0x415dc1);}(_0x5c2d,0x151));var _0xd5c2=function(_0xfc6ab4,_0xe82cc8){_0xfc6ab4=_0xfc6ab4-0x0;var _0x14244b=_0x5c2d[_0xfc6ab4];return _0x14244b;};'use strict';var multer=require(_0xd5c2('0x0'));var util=require(_0xd5c2('0x1'));var path=require(_0xd5c2('0x2'));var timeout=require(_0xd5c2('0x3'));var express=require(_0xd5c2('0x4'));var router=express[_0xd5c2('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xd5c2('0x6'));var config=require(_0xd5c2('0x7'));var controller=require(_0xd5c2('0x8'));router[_0xd5c2('0x9')]('/',auth[_0xd5c2('0xa')](),controller['index']);router[_0xd5c2('0x9')](_0xd5c2('0xb'),auth[_0xd5c2('0xa')](),controller[_0xd5c2('0xc')]);router[_0xd5c2('0x9')](_0xd5c2('0xd'),auth[_0xd5c2('0xa')](),controller[_0xd5c2('0xe')]);router['get']('/:id/dispositions',auth[_0xd5c2('0xa')](),controller['getDispositions']);router[_0xd5c2('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xd5c2('0xf')]);router[_0xd5c2('0x9')]('/:id/applications',auth[_0xd5c2('0xa')](),controller[_0xd5c2('0x10')]);router['get']('/:id/interactions',auth[_0xd5c2('0xa')](),controller[_0xd5c2('0x11')]);router[_0xd5c2('0x9')](_0xd5c2('0x12'),auth[_0xd5c2('0xa')](),controller[_0xd5c2('0x13')]);router[_0xd5c2('0x14')]('/',auth['isAuthenticated'](),controller[_0xd5c2('0x15')]);router[_0xd5c2('0x14')](_0xd5c2('0x16'),auth[_0xd5c2('0xa')](),controller[_0xd5c2('0x17')]);router['post'](_0xd5c2('0x18'),auth[_0xd5c2('0xa')](),controller[_0xd5c2('0x19')]);router[_0xd5c2('0x14')]('/:id/notify',controller[_0xd5c2('0x1a')]);router['post'](_0xd5c2('0x1b'),auth[_0xd5c2('0xa')](),controller[_0xd5c2('0x1c')]);router['post'](_0xd5c2('0x12'),auth[_0xd5c2('0xa')](),controller['addAgents']);router[_0xd5c2('0x14')](_0xd5c2('0x1d'),auth[_0xd5c2('0xa')](),controller[_0xd5c2('0x1e')]);router[_0xd5c2('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0xd5c2('0x20')]);router[_0xd5c2('0x21')]('/:id',auth['isAuthenticated'](),controller[_0xd5c2('0x22')]);router['delete'](_0xd5c2('0x16'),auth[_0xd5c2('0xa')](),controller[_0xd5c2('0x23')]);router[_0xd5c2('0x21')](_0xd5c2('0x18'),auth[_0xd5c2('0xa')](),controller[_0xd5c2('0x24')]);router[_0xd5c2('0x21')](_0xd5c2('0x12'),auth[_0xd5c2('0xa')](),controller[_0xd5c2('0x25')]);module[_0xd5c2('0x26')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 06e71a6..40b4e8f 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 _0xe43d=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate'];(function(_0x390457,_0x4c7304){var _0x388c1b=function(_0x3c2262){while(--_0x3c2262){_0x390457['push'](_0x390457['shift']());}};_0x388c1b(++_0x4c7304);}(_0xe43d,0x173));var _0xde43=function(_0x57d11b,_0x2a4299){_0x57d11b=_0x57d11b-0x0;var _0x63ad6e=_0xe43d[_0x57d11b];return _0x63ad6e;};'use strict';var Sequelize=require(_0xde43('0x0'));var rs=require(_0xde43('0x1'));module[_0xde43('0x2')]={'name':{'type':Sequelize[_0xde43('0x3')],'unique':_0xde43('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xde43('0x3')]},'token':{'type':Sequelize[_0xde43('0x3')],'defaultValue':function(){return rs[_0xde43('0x5')]();}},'replyUri':{'type':Sequelize[_0xde43('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xde43('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xde43('0x6');}},'notificationSound':{'type':Sequelize[_0xde43('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xde43('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xde43('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xde43('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xde43('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xde43('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xde43('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xde43('0x7')],'defaultValue':![],'comment':_0xde43('0x9'),'set':function(_0x5123df){if(!_0x5123df)this[_0xde43('0xa')](_0xde43('0xb'),null);this['setDataValue'](_0xde43('0xc'),_0x5123df);}}}; \ No newline at end of file +var _0xd926=['randomstring','exports','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x22765c,_0x11bbf7){var _0x533cec=function(_0x2d4541){while(--_0x2d4541){_0x22765c['push'](_0x22765c['shift']());}};_0x533cec(++_0x11bbf7);}(_0xd926,0xcf));var _0x6d92=function(_0x33ba54,_0x109117){_0x33ba54=_0x33ba54-0x0;var _0x21d839=_0xd926[_0x33ba54];return _0x21d839;};'use strict';var Sequelize=require(_0x6d92('0x0'));var rs=require(_0x6d92('0x1'));module[_0x6d92('0x2')]={'name':{'type':Sequelize[_0x6d92('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x6d92('0x3')],'defaultValue':function(){return rs[_0x6d92('0x4')]();}},'replyUri':{'type':Sequelize[_0x6d92('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x6d92('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6d92('0x5')],'defaultValue':function(){return _0x6d92('0x6');}},'notificationSound':{'type':Sequelize[_0x6d92('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6d92('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x6d92('0x3')]},'queueTransfer':{'type':Sequelize[_0x6d92('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6d92('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6d92('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x6d92('0x7')],'defaultValue':![],'comment':_0x6d92('0x9'),'set':function(_0x4ab4aa){if(!_0x4ab4aa)this[_0x6d92('0xa')](_0x6d92('0xb'),null);this[_0x6d92('0xa')](_0x6d92('0xc'),_0x4ab4aa);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 8518f93..3995c09 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 _0xef74=['result','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','update','get','UserProfileResource','destroy','end','name','send','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filters','filter','where','map','type','VIRTUAL','field','merge','options','findAll','rows','show','params','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','OpenchannelAccounts','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','order','pick','OpenchannelAccountId','include','removeDispositions','ids','CannedAnswer','findOne','includeAll','removeAnswers','notify','openchannel','Sequelize','ValidationError','difference','createdAt','CompanyId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','DESC','OpenchannelApplication','account','applications','Applications','list','orderBy','priority','asc','Contacts','defaults','lastName','threadId','OpenchannelInteraction','externalUrl','spread','firstName','contact','messageId','interaction','created','autoclose','push','close','unmanaged','AttachmentId','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','getApplications','Owner','internal','Tags','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','User','updatedAt','OpenchannelMessage','dataValues','Messages','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','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','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x5deda9,_0x7ca205){var _0x35f848=function(_0x4478e2){while(--_0x4478e2){_0x5deda9['push'](_0x5deda9['shift']());}};_0x35f848(++_0x7ca205);}(_0xef74,0x8d));var _0x4ef7=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0xef74[_0x20ef64];return _0x3707d8;};'use strict';var pdf=require(_0x4ef7('0x0'));var emlformat=require(_0x4ef7('0x1'));var rimraf=require(_0x4ef7('0x2'));var zipdir=require(_0x4ef7('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ef7('0x4'));var moment=require(_0x4ef7('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ef7('0x6'));var path=require(_0x4ef7('0x7'));var sox=require(_0x4ef7('0x8'));var csv=require(_0x4ef7('0x9'));var ejs=require(_0x4ef7('0xa'));var fs=require('fs');var _=require(_0x4ef7('0xb'));var squel=require(_0x4ef7('0xc'));var crypto=require(_0x4ef7('0xd'));var jsforce=require(_0x4ef7('0xe'));var deskjs=require(_0x4ef7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4ef7('0x10'));var Papa=require(_0x4ef7('0x11'));var Redis=require(_0x4ef7('0x12'));var authService=require(_0x4ef7('0x13'));var qs=require(_0x4ef7('0x14'));var hardwareService=require(_0x4ef7('0x15'));var logger=require(_0x4ef7('0x16'))('api');var utils=require(_0x4ef7('0x17'));var config=require(_0x4ef7('0x18'));var db=require(_0x4ef7('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x4ef7('0x1a'),'port':0x18eb});var socket=require(_0x4ef7('0x1b'))(new Redis(config['redis']));require(_0x4ef7('0x1c'))[_0x4ef7('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4ef7('0x1e')][_0x4ef7('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x241819,_0x2da450,_0x11dec2){if(_0x11dec2){var _0x1f0df5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1f0df5[_0x4ef7('0x20')](_0x2da450)){return _0x241819;}else{throw new Error(_0x4ef7('0x21'));}}else{return _0x241819;}}function respondWithRpcPromise(_0x1f87f3,_0x6ffbd9,_0x2ffad6,_0x592ce3){return new BPromise(function(_0x1fadac,_0x3ce6a6){var _0x43331d=_0x592ce3||client;return _0x43331d[_0x4ef7('0x22')](_0x1f87f3,_0x2ffad6)[_0x4ef7('0x23')](function(_0x1dd455){logger[_0x4ef7('0x24')](_0x4ef7('0x25'),_0x6ffbd9,'request\x20sent');logger[_0x4ef7('0x26')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x6ffbd9,_0x4ef7('0x27'),JSON[_0x4ef7('0x28')](_0x1dd455));if(_0x1dd455[_0x4ef7('0x29')]){if(_0x1dd455['error'][_0x4ef7('0x2a')]===0x1f4){logger[_0x4ef7('0x29')](_0x4ef7('0x25'),_0x6ffbd9,_0x1dd455['error'][_0x4ef7('0x2b')]);return _0x3ce6a6(_0x1dd455[_0x4ef7('0x29')]['message']);}logger['error'](_0x4ef7('0x25'),_0x6ffbd9,_0x1dd455['error'][_0x4ef7('0x2b')]);return _0x1fadac(_0x1dd455['error']['message']);}else{logger[_0x4ef7('0x24')](_0x4ef7('0x25'),_0x6ffbd9,'request\x20sent');_0x1fadac(_0x1dd455[_0x4ef7('0x2c')][_0x4ef7('0x2b')]);}})[_0x4ef7('0x2d')](function(_0xfe558e){logger[_0x4ef7('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x6ffbd9,_0xfe558e);_0x3ce6a6(_0xfe558e);});});}function respondWithStatusCode(_0x4433c2,_0x132c4d){_0x132c4d=_0x132c4d||0xcc;return function(_0x467601){if(_0x467601){return _0x4433c2[_0x4ef7('0x2e')](_0x132c4d);}return _0x4433c2[_0x4ef7('0x2f')](_0x132c4d)['end']();};}function respondWithResult(_0x345876,_0x21a84f){_0x21a84f=_0x21a84f||0xc8;return function(_0x29d6a5){if(_0x29d6a5){return _0x345876[_0x4ef7('0x2f')](_0x21a84f)[_0x4ef7('0x30')](_0x29d6a5);}};}function respondWithFilteredResult(_0x2d1c05,_0x1d0e15){return function(_0x1798e3){if(_0x1798e3){var _0x497c10=_0x1798e3[_0x4ef7('0x31')],_0x182afe=_0x1d0e15[_0x4ef7('0x32')],_0x32fbbb=_0x1d0e15[_0x4ef7('0x32')]+_0x1d0e15['limit'],_0x4e6747;if(_0x32fbbb>=_0x497c10){_0x32fbbb=_0x497c10;_0x4e6747=0xc8;}else{_0x4e6747=0xce;}_0x2d1c05['status'](_0x4e6747);return _0x2d1c05[_0x4ef7('0x33')](_0x4ef7('0x34'),_0x182afe+'-'+_0x32fbbb+'/'+_0x497c10)[_0x4ef7('0x30')](_0x1798e3);}return null;};}function patchUpdates(_0x18d42e){return function(_0x54599a){try{jsonpatch[_0x4ef7('0x35')](_0x54599a,_0x18d42e,!![]);}catch(_0x1afe82){return BPromise[_0x4ef7('0x36')](_0x1afe82);}return _0x54599a['save']();};}function saveUpdates(_0x34cc30,_0x421629){return function(_0x3036c9){if(_0x3036c9){return _0x3036c9[_0x4ef7('0x37')](_0x34cc30)['then'](function(_0x4e5b96){return _0x4e5b96;});}return null;};}function removeEntity(_0x55ced6,_0x33e5c2){return function(_0x532341){if(_0x532341){return _0x532341['destroy']()[_0x4ef7('0x23')](function(){var _0x1d9ca4=_0x532341[_0x4ef7('0x38')]({'plain':!![]});var _0xc51262='OpenchannelAccounts';return db[_0x4ef7('0x39')][_0x4ef7('0x3a')]({'where':{'type':_0xc51262,'resourceId':_0x1d9ca4['id']}})[_0x4ef7('0x23')](function(){return _0x532341;});})[_0x4ef7('0x23')](function(){_0x55ced6[_0x4ef7('0x2f')](0xcc)[_0x4ef7('0x3b')]();});}};}function handleEntityNotFound(_0x26c486,_0x509f57){return function(_0x1ed374){if(!_0x1ed374){_0x26c486[_0x4ef7('0x2e')](0x194);}return _0x1ed374;};}function handleError(_0x306489,_0x203ee1){_0x203ee1=_0x203ee1||0x1f4;return function(_0xfeae66){logger[_0x4ef7('0x29')](_0xfeae66['stack']);if(_0xfeae66[_0x4ef7('0x3c')]){delete _0xfeae66['name'];}_0x306489[_0x4ef7('0x2f')](_0x203ee1)[_0x4ef7('0x3d')](_0xfeae66);};}exports['index']=function(_0xa462d0,_0x3d15a0){var _0x3b2668={'include':[{'model':db['Pause'],'as':_0x4ef7('0x3e')}]},_0x182717={},_0x5336ec={'count':0x0,'rows':[]};var _0x536e3f=db[_0x4ef7('0x3f')][_0x4ef7('0x40')];_0x182717[_0x4ef7('0x41')]=_['keys'](_0x536e3f);_0x182717['query']=_[_0x4ef7('0x42')](_0xa462d0[_0x4ef7('0x43')]);_0x182717['filters']=_[_0x4ef7('0x44')](_0x182717[_0x4ef7('0x41')],_0x182717[_0x4ef7('0x43')]);_0x3b2668[_0x4ef7('0x45')]=_[_0x4ef7('0x44')](_0x182717[_0x4ef7('0x41')],qs['fields'](_0xa462d0[_0x4ef7('0x43')][_0x4ef7('0x46')]));_0x3b2668[_0x4ef7('0x45')]=_0x3b2668[_0x4ef7('0x45')][_0x4ef7('0x47')]?_0x3b2668['attributes']:_0x182717['model'];if(!_0xa462d0[_0x4ef7('0x43')][_0x4ef7('0x48')](_0x4ef7('0x49'))){_0x3b2668['limit']=qs[_0x4ef7('0x4a')](_0xa462d0['query'][_0x4ef7('0x4a')]);_0x3b2668[_0x4ef7('0x32')]=qs[_0x4ef7('0x32')](_0xa462d0[_0x4ef7('0x43')][_0x4ef7('0x32')]);}_0x3b2668['order']=qs[_0x4ef7('0x4b')](_0xa462d0[_0x4ef7('0x43')][_0x4ef7('0x4b')]);_0x3b2668['where']=qs[_0x4ef7('0x4c')](_['pick'](_0xa462d0['query'],_0x182717['filters']));if(_0xa462d0['query'][_0x4ef7('0x4d')]){_0x3b2668[_0x4ef7('0x4e')]=_['merge'](_0x3b2668[_0x4ef7('0x4e')],{'$or':_[_0x4ef7('0x4f')](_0x536e3f,function(_0x392776){if(_0x392776[_0x4ef7('0x50')]['key']!==_0x4ef7('0x51')){var _0x4dc223={};_0x4dc223[_0x392776[_0x4ef7('0x52')]]={'$like':'%'+_0xa462d0['query'][_0x4ef7('0x4d')]+'%'};return _0x4dc223;}})});}_0x3b2668=_[_0x4ef7('0x53')]({},_0x3b2668,_0xa462d0[_0x4ef7('0x54')]);var _0x4d655d={'where':_0x3b2668[_0x4ef7('0x4e')]};return db[_0x4ef7('0x3f')][_0x4ef7('0x31')](_0x4d655d)[_0x4ef7('0x23')](function(_0x3ae511){_0x5336ec[_0x4ef7('0x31')]=_0x3ae511;if(_0xa462d0[_0x4ef7('0x43')]['includeAll']){_0x3b2668['include']=[{'all':!![]}];}return db[_0x4ef7('0x3f')][_0x4ef7('0x55')](_0x3b2668);})['then'](function(_0x84d01c){_0x5336ec[_0x4ef7('0x56')]=_0x84d01c;return _0x5336ec;})[_0x4ef7('0x23')](respondWithFilteredResult(_0x3d15a0,_0x3b2668))[_0x4ef7('0x2d')](handleError(_0x3d15a0,null));};exports[_0x4ef7('0x57')]=function(_0x2233ab,_0x3d702e){var _0x271d19={'raw':![],'where':{'id':_0x2233ab[_0x4ef7('0x58')]['id']},'include':[{'model':db[_0x4ef7('0x59')],'as':_0x4ef7('0x3e')}]},_0x315bf7={};_0x315bf7['model']=_[_0x4ef7('0x42')](db[_0x4ef7('0x3f')][_0x4ef7('0x40')]);_0x315bf7[_0x4ef7('0x43')]=_[_0x4ef7('0x42')](_0x2233ab[_0x4ef7('0x43')]);_0x315bf7[_0x4ef7('0x4c')]=_[_0x4ef7('0x44')](_0x315bf7[_0x4ef7('0x41')],_0x315bf7[_0x4ef7('0x43')]);_0x271d19['attributes']=_[_0x4ef7('0x44')](_0x315bf7[_0x4ef7('0x41')],qs['fields'](_0x2233ab[_0x4ef7('0x43')][_0x4ef7('0x46')]));_0x271d19[_0x4ef7('0x45')]=_0x271d19['attributes'][_0x4ef7('0x47')]?_0x271d19[_0x4ef7('0x45')]:_0x315bf7[_0x4ef7('0x41')];if(_0x2233ab['query']['includeAll']){_0x271d19['include']=[{'all':!![]}];}_0x271d19=_['merge']({},_0x271d19,_0x2233ab[_0x4ef7('0x54')]);return db[_0x4ef7('0x3f')][_0x4ef7('0x5a')](_0x271d19)[_0x4ef7('0x23')](handleEntityNotFound(_0x3d702e,null))[_0x4ef7('0x23')](respondWithResult(_0x3d702e,null))['catch'](handleError(_0x3d702e,null));};exports[_0x4ef7('0x5b')]=function(_0x23de21,_0x3e6e6b){return db[_0x4ef7('0x3f')]['create'](_0x23de21[_0x4ef7('0x5c')],{})[_0x4ef7('0x23')](function(_0x3c1048){var _0x27161f=_0x23de21[_0x4ef7('0x5d')]['get']({'plain':!![]});if(!_0x27161f)throw new Error(_0x4ef7('0x5e'));if(_0x27161f['role']===_0x4ef7('0x5d')){var _0x31af6d=_0x3c1048[_0x4ef7('0x38')]({'plain':!![]});var _0x257eab=_0x4ef7('0x5f');return db[_0x4ef7('0x60')]['find']({'where':{'name':_0x257eab,'userProfileId':_0x27161f[_0x4ef7('0x61')]},'raw':!![]})[_0x4ef7('0x23')](function(_0x11b1b3){if(_0x11b1b3&&_0x11b1b3['autoAssociation']===0x0){return db[_0x4ef7('0x39')]['create']({'name':_0x31af6d[_0x4ef7('0x3c')],'resourceId':_0x31af6d['id'],'type':_0x11b1b3[_0x4ef7('0x3c')],'sectionId':_0x11b1b3['id']},{})[_0x4ef7('0x23')](function(){return _0x3c1048;});}else{return _0x3c1048;}})[_0x4ef7('0x2d')](function(_0x10d6a3){logger[_0x4ef7('0x29')](_0x4ef7('0x62'),_0x10d6a3);throw _0x10d6a3;});}return _0x3c1048;})['then'](respondWithResult(_0x3e6e6b,0xc9))[_0x4ef7('0x2d')](handleError(_0x3e6e6b,null));};exports['update']=function(_0x467e7e,_0x3f97eb){if(_0x467e7e[_0x4ef7('0x5c')]['id']){delete _0x467e7e[_0x4ef7('0x5c')]['id'];}return db[_0x4ef7('0x3f')]['find']({'where':{'id':_0x467e7e[_0x4ef7('0x58')]['id']},'include':[{'model':db[_0x4ef7('0x59')],'as':_0x4ef7('0x3e')}]})[_0x4ef7('0x23')](handleEntityNotFound(_0x3f97eb,null))[_0x4ef7('0x23')](saveUpdates(_0x467e7e[_0x4ef7('0x5c')],null))[_0x4ef7('0x23')](respondWithResult(_0x3f97eb,null))[_0x4ef7('0x2d')](handleError(_0x3f97eb,null));};exports['destroy']=function(_0x1fb352,_0x1d7fe5){return db['OpenchannelAccount']['find']({'where':{'id':_0x1fb352[_0x4ef7('0x58')]['id']}})[_0x4ef7('0x23')](handleEntityNotFound(_0x1d7fe5,null))['then'](removeEntity(_0x1d7fe5,null))[_0x4ef7('0x2d')](handleError(_0x1d7fe5,null));};exports[_0x4ef7('0x63')]=function(_0x459f60,_0x5f0c5a){return db[_0x4ef7('0x3f')]['describe']()['then'](respondWithResult(_0x5f0c5a,null))[_0x4ef7('0x2d')](handleError(_0x5f0c5a,null));};exports[_0x4ef7('0x64')]=function(_0x3c223e,_0x31b3f4,_0x396b95){if(_0x3c223e[_0x4ef7('0x5c')]['id']){delete _0x3c223e['body']['id'];}return db[_0x4ef7('0x3f')][_0x4ef7('0x5a')]({'where':{'id':_0x3c223e[_0x4ef7('0x58')]['id']}})['then'](handleEntityNotFound(_0x31b3f4,null))[_0x4ef7('0x23')](function(_0x34756){if(_0x34756){_0x3c223e[_0x4ef7('0x5c')]['OpnechannelAccountId']=_0x34756['id'];return db[_0x4ef7('0x65')]['create'](_0x3c223e[_0x4ef7('0x5c')]);}})[_0x4ef7('0x23')](respondWithResult(_0x31b3f4,null))[_0x4ef7('0x2d')](handleError(_0x31b3f4,null));};exports[_0x4ef7('0x66')]=function(_0x3008fb,_0x1d3b67,_0x29d89){var _0x4276ce={'raw':![],'where':{}};var _0x5e9983={};var _0x2a4bef={'count':0x0,'rows':[]};return db[_0x4ef7('0x3f')]['findOne']({'where':{'id':_0x3008fb[_0x4ef7('0x58')]['id']}})['then'](handleEntityNotFound(_0x1d3b67,null))['then'](function(_0x38002f){if(_0x38002f){_0x5e9983['model']=_['keys'](db[_0x4ef7('0x65')]['rawAttributes']);_0x5e9983[_0x4ef7('0x43')]=_[_0x4ef7('0x42')](_0x3008fb[_0x4ef7('0x43')]);_0x5e9983[_0x4ef7('0x4c')]=_[_0x4ef7('0x44')](_0x5e9983['model'],_0x5e9983[_0x4ef7('0x43')]);_0x4276ce[_0x4ef7('0x45')]=_['intersection'](_0x5e9983[_0x4ef7('0x41')],qs[_0x4ef7('0x46')](_0x3008fb[_0x4ef7('0x43')][_0x4ef7('0x46')]));_0x4276ce[_0x4ef7('0x45')]=_0x4276ce[_0x4ef7('0x45')][_0x4ef7('0x47')]?_0x4276ce[_0x4ef7('0x45')]:_0x5e9983[_0x4ef7('0x41')];if(!_0x3008fb['query'][_0x4ef7('0x48')]('nolimit')){_0x4276ce[_0x4ef7('0x4a')]=qs[_0x4ef7('0x4a')](_0x3008fb[_0x4ef7('0x43')][_0x4ef7('0x4a')]);_0x4276ce[_0x4ef7('0x32')]=qs[_0x4ef7('0x32')](_0x3008fb['query'][_0x4ef7('0x32')]);}_0x4276ce[_0x4ef7('0x67')]=qs[_0x4ef7('0x4b')](_0x3008fb[_0x4ef7('0x43')]['sort']);_0x4276ce[_0x4ef7('0x4e')]=qs[_0x4ef7('0x4c')](_[_0x4ef7('0x68')](_0x3008fb['query'],_0x5e9983[_0x4ef7('0x4c')]));_0x4276ce[_0x4ef7('0x4e')][_0x4ef7('0x69')]=_0x38002f['id'];if(_0x3008fb[_0x4ef7('0x43')][_0x4ef7('0x4d')]){_0x4276ce[_0x4ef7('0x4e')]=_['merge'](_0x4276ce['where'],{'$or':_['map'](_0x4276ce[_0x4ef7('0x45')],function(_0x1a750d){var _0x179af6={};_0x179af6[_0x1a750d]={'$like':'%'+_0x3008fb[_0x4ef7('0x43')][_0x4ef7('0x4d')]+'%'};return _0x179af6;})});}_0x4276ce=_[_0x4ef7('0x53')]({},_0x4276ce,_0x3008fb[_0x4ef7('0x54')]);return db[_0x4ef7('0x65')][_0x4ef7('0x31')]({'where':_0x4276ce['where']})[_0x4ef7('0x23')](function(_0x36e909){_0x2a4bef['count']=_0x36e909;if(_0x3008fb[_0x4ef7('0x43')]['includeAll']){_0x4276ce[_0x4ef7('0x6a')]=[{'all':!![]}];}return db[_0x4ef7('0x65')][_0x4ef7('0x55')](_0x4276ce);})['then'](function(_0x470fb3){_0x2a4bef[_0x4ef7('0x56')]=_0x470fb3;return _0x2a4bef;});}})[_0x4ef7('0x23')](respondWithFilteredResult(_0x1d3b67,_0x4276ce))[_0x4ef7('0x2d')](handleError(_0x1d3b67,null));};exports[_0x4ef7('0x6b')]=function(_0x5d17eb,_0x27b10a,_0xfaff6){return db['OpenchannelAccount'][_0x4ef7('0x5a')]({'where':{'id':_0x5d17eb[_0x4ef7('0x58')]['id']}})[_0x4ef7('0x23')](handleEntityNotFound(_0x27b10a,null))[_0x4ef7('0x23')](function(_0x3c48f2){if(_0x3c48f2){return _0x3c48f2['removeDispositions'](_0x5d17eb[_0x4ef7('0x43')][_0x4ef7('0x6c')]);}})[_0x4ef7('0x23')](respondWithStatusCode(_0x27b10a,null))[_0x4ef7('0x2d')](handleError(_0x27b10a,null));};exports['addAnswer']=function(_0x90d452,_0xeb5b04,_0x2bba57){if(_0x90d452[_0x4ef7('0x5c')]['id']){delete _0x90d452[_0x4ef7('0x5c')]['id'];}return db[_0x4ef7('0x3f')]['find']({'where':{'id':_0x90d452[_0x4ef7('0x58')]['id']}})[_0x4ef7('0x23')](handleEntityNotFound(_0xeb5b04,null))[_0x4ef7('0x23')](function(_0xfdda61){if(_0xfdda61){_0x90d452['body'][_0x4ef7('0x69')]=_0xfdda61['id'];return db[_0x4ef7('0x6d')]['create'](_0x90d452[_0x4ef7('0x5c')]);}})['then'](respondWithResult(_0xeb5b04,null))[_0x4ef7('0x2d')](handleError(_0xeb5b04,null));};exports['getAnswers']=function(_0x53710a,_0x10c388,_0x560b48){var _0x1044a8={'raw':![],'where':{}};var _0x2ff57a={};var _0x5630e9={'count':0x0,'rows':[]};return db[_0x4ef7('0x3f')][_0x4ef7('0x6e')]({'where':{'id':_0x53710a['params']['id']}})[_0x4ef7('0x23')](handleEntityNotFound(_0x10c388,null))[_0x4ef7('0x23')](function(_0xf7e469){if(_0xf7e469){_0x2ff57a[_0x4ef7('0x41')]=_[_0x4ef7('0x42')](db['CannedAnswer'][_0x4ef7('0x40')]);_0x2ff57a[_0x4ef7('0x43')]=_['keys'](_0x53710a[_0x4ef7('0x43')]);_0x2ff57a[_0x4ef7('0x4c')]=_[_0x4ef7('0x44')](_0x2ff57a[_0x4ef7('0x41')],_0x2ff57a[_0x4ef7('0x43')]);_0x1044a8['attributes']=_[_0x4ef7('0x44')](_0x2ff57a[_0x4ef7('0x41')],qs[_0x4ef7('0x46')](_0x53710a[_0x4ef7('0x43')]['fields']));_0x1044a8['attributes']=_0x1044a8[_0x4ef7('0x45')][_0x4ef7('0x47')]?_0x1044a8[_0x4ef7('0x45')]:_0x2ff57a[_0x4ef7('0x41')];if(!_0x53710a[_0x4ef7('0x43')][_0x4ef7('0x48')](_0x4ef7('0x49'))){_0x1044a8[_0x4ef7('0x4a')]=qs[_0x4ef7('0x4a')](_0x53710a['query'][_0x4ef7('0x4a')]);_0x1044a8[_0x4ef7('0x32')]=qs[_0x4ef7('0x32')](_0x53710a['query'][_0x4ef7('0x32')]);}_0x1044a8[_0x4ef7('0x67')]=qs['sort'](_0x53710a[_0x4ef7('0x43')][_0x4ef7('0x4b')]);_0x1044a8[_0x4ef7('0x4e')]=qs[_0x4ef7('0x4c')](_[_0x4ef7('0x68')](_0x53710a['query'],_0x2ff57a[_0x4ef7('0x4c')]));_0x1044a8['where'][_0x4ef7('0x69')]=_0xf7e469['id'];if(_0x53710a[_0x4ef7('0x43')]['filter']){_0x1044a8[_0x4ef7('0x4e')]=_['merge'](_0x1044a8['where'],{'$or':_['map'](_0x1044a8[_0x4ef7('0x45')],function(_0x4e989a){var _0x46830f={};_0x46830f[_0x4e989a]={'$like':'%'+_0x53710a[_0x4ef7('0x43')][_0x4ef7('0x4d')]+'%'};return _0x46830f;})});}_0x1044a8=_[_0x4ef7('0x53')]({},_0x1044a8,_0x53710a[_0x4ef7('0x54')]);return db[_0x4ef7('0x6d')][_0x4ef7('0x31')]({'where':_0x1044a8[_0x4ef7('0x4e')]})[_0x4ef7('0x23')](function(_0x4a5718){_0x5630e9[_0x4ef7('0x31')]=_0x4a5718;if(_0x53710a[_0x4ef7('0x43')][_0x4ef7('0x6f')]){_0x1044a8['include']=[{'all':!![]}];}return db[_0x4ef7('0x6d')]['findAll'](_0x1044a8);})[_0x4ef7('0x23')](function(_0x3b439b){_0x5630e9['rows']=_0x3b439b;return _0x5630e9;});}})[_0x4ef7('0x23')](respondWithFilteredResult(_0x10c388,_0x1044a8))[_0x4ef7('0x2d')](handleError(_0x10c388,null));};exports[_0x4ef7('0x70')]=function(_0x11057b,_0x3907c3,_0xc9cae2){return db[_0x4ef7('0x3f')]['find']({'where':{'id':_0x11057b[_0x4ef7('0x58')]['id']}})[_0x4ef7('0x23')](handleEntityNotFound(_0x3907c3,null))[_0x4ef7('0x23')](function(_0x4195be){if(_0x4195be){return _0x4195be[_0x4ef7('0x70')](_0x11057b[_0x4ef7('0x43')][_0x4ef7('0x6c')]);}})[_0x4ef7('0x23')](respondWithStatusCode(_0x3907c3,null))[_0x4ef7('0x2d')](handleError(_0x3907c3,null));};exports[_0x4ef7('0x71')]=function(_0x4c9e9d,_0x5b63d5,_0x5a3235){var _0x40eaaa={'body':_0x4c9e9d[_0x4ef7('0x5c')],'channel':_0x4ef7('0x72')};var _0x298eae=[];var _0x3f9357=[];var _0x22a7a={};var _0x57331e=![];return db['CmContact']['describe']()[_0x4ef7('0x23')](function(_0x2e5c0f){if(!_0x2e5c0f){throw new db[(_0x4ef7('0x73'))][(_0x4ef7('0x74'))]('no\x20available\x20attributes');}_0x298eae=_[_0x4ef7('0x75')](_[_0x4ef7('0x42')](_0x2e5c0f),[_0x4ef7('0x76'),'updatedAt']);_0x3f9357=_[_0x4ef7('0x75')](_['keys'](_0x2e5c0f),[_0x4ef7('0x76'),'updatedAt',_0x4ef7('0x77'),'ListId']);if(_0x4c9e9d['body']['id']){delete _0x4c9e9d[_0x4ef7('0x5c')]['id'];}if(_['isNil'](_0x4c9e9d[_0x4ef7('0x5c')][_0x4ef7('0x78')])){throw new db[(_0x4ef7('0x73'))][(_0x4ef7('0x74'))](_0x4ef7('0x79'));}if(_[_0x4ef7('0x7a')](_0x4c9e9d['body']['body'])||_0x4c9e9d['body'][_0x4ef7('0x5c')]===''){throw new db[(_0x4ef7('0x73'))]['ValidationError'](_0x4ef7('0x7b'));}if(_[_0x4ef7('0x7a')](_0x4c9e9d[_0x4ef7('0x5c')]['mapKey'])){throw new db[(_0x4ef7('0x73'))][(_0x4ef7('0x74'))](_0x4ef7('0x7c')+_0x3f9357);}if(!_[_0x4ef7('0x7d')](_0x3f9357,_0x4c9e9d[_0x4ef7('0x5c')][_0x4ef7('0x7e')])){throw new db[(_0x4ef7('0x73'))][(_0x4ef7('0x74'))](_0x4ef7('0x7f')+_0x3f9357);}_0x22a7a[_0x4c9e9d[_0x4ef7('0x5c')]['mapKey']]=_0x4c9e9d[_0x4ef7('0x5c')][_0x4ef7('0x78')];})['then'](function(){return db['OpenchannelAccount'][_0x4ef7('0x5a')]({'where':{'id':_0x4c9e9d[_0x4ef7('0x58')]['id']},'include':[{'model':db[_0x4ef7('0x80')],'as':_0x4ef7('0x81'),'include':[{'model':db[_0x4ef7('0x82')],'as':'Contacts','where':_0x22a7a,'limit':0x1,'order':[['updatedAt',_0x4ef7('0x83')]]}]},{'model':db[_0x4ef7('0x84')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x5b63d5,null))[_0x4ef7('0x23')](function(_0x73bfa1){if(_0x73bfa1&&_0x73bfa1['List']){_0x40eaaa[_0x4ef7('0x85')]=_0x73bfa1;_0x40eaaa[_0x4ef7('0x86')]=_0x73bfa1[_0x4ef7('0x87')];_0x40eaaa[_0x4ef7('0x88')]=_0x73bfa1[_0x4ef7('0x81')];_0x40eaaa[_0x4ef7('0x86')]=_[_0x4ef7('0x89')](_0x40eaaa['applications'],[_0x4ef7('0x8a')],[_0x4ef7('0x8b')]);if(_0x40eaaa[_0x4ef7('0x85')][_0x4ef7('0x87')]){delete _0x40eaaa[_0x4ef7('0x85')][_0x4ef7('0x87')];}if(_0x40eaaa[_0x4ef7('0x85')]['List']&&_0x40eaaa['account'][_0x4ef7('0x81')]['Contacts'][_0x4ef7('0x47')]){return _0x40eaaa[_0x4ef7('0x85')][_0x4ef7('0x81')][_0x4ef7('0x8c')][0x0];}var _0x6187c3=_[_0x4ef7('0x8d')](_0x4c9e9d[_0x4ef7('0x5c')],{'firstName':_0x4c9e9d[_0x4ef7('0x5c')][_0x4ef7('0x78')],'ListId':_0x73bfa1['ListId']});_0x6187c3[_0x4c9e9d['body'][_0x4ef7('0x7e')]]=_0x4c9e9d[_0x4ef7('0x5c')][_0x4ef7('0x78')];return db[_0x4ef7('0x82')][_0x4ef7('0x5b')](_0x6187c3,{'fields':_0x298eae,'raw':!![]});}})['then'](handleEntityNotFound(_0x5b63d5,null))['then'](function(_0x1d872a){_0x40eaaa['contact']=_0x1d872a;if(_0x1d872a){var _0x3ce906={'ContactId':_0x1d872a['id'],'OpenchannelAccountId':_0x4c9e9d['params']['id'],'from':(_0x1d872a['firstName']||'')+'\x20'+(_0x1d872a[_0x4ef7('0x8e')]||'')};var _0x1cf1b7={'OpenchannelAccountId':_0x4c9e9d[_0x4ef7('0x58')]['id'],'closed':![]};if(_0x4c9e9d['body']['threadId']){_0x1cf1b7[_0x4ef7('0x8f')]=_0x4c9e9d[_0x4ef7('0x5c')][_0x4ef7('0x8f')];return db[_0x4ef7('0x90')][_0x4ef7('0x5a')]({'where':_0x1cf1b7})[_0x4ef7('0x23')](function(_0x3c78d6){if(_0x3c78d6){return[_0x3c78d6,![]];}_0x3ce906[_0x4ef7('0x8f')]=_0x4c9e9d[_0x4ef7('0x5c')][_0x4ef7('0x8f')];_0x3ce906[_0x4ef7('0x91')]=_0x4c9e9d[_0x4ef7('0x5c')]['externalUrl'];return db[_0x4ef7('0x90')][_0x4ef7('0x5b')](_0x3ce906)[_0x4ef7('0x23')](function(_0x329bed){return[_0x329bed,!![]];});});}else{_0x1cf1b7[_0x4ef7('0x8f')]=null;}_0x1cf1b7['ContactId']=_0x1d872a['id'];return db[_0x4ef7('0x90')]['find']({'where':_0x1cf1b7})[_0x4ef7('0x23')](function(_0x4eca88){if(_0x4eca88){return[_0x4eca88,![]];}return db[_0x4ef7('0x90')][_0x4ef7('0x5b')](_0x3ce906)['then'](function(_0x5e5cbf){return[_0x5e5cbf,!![]];});});}})[_0x4ef7('0x92')](function(_0x36369c,_0x3983cd){if(_0x36369c){_0x57331e=_0x3983cd;if(!_0x3983cd){var _0x260923={'from':(_0x40eaaa['contact'][_0x4ef7('0x93')]||'')+'\x20'+(_0x40eaaa[_0x4ef7('0x94')][_0x4ef7('0x8e')]||'')};if(_0x4c9e9d['body'][_0x4ef7('0x8f')]&&_0x4c9e9d['body'][_0x4ef7('0x95')]&&_0x4c9e9d[_0x4ef7('0x5c')]['threadId']!=_0x4c9e9d[_0x4ef7('0x5c')][_0x4ef7('0x95')]){_0x260923[_0x4ef7('0x8f')]=_0x4c9e9d['body'][_0x4ef7('0x95')];}return _0x36369c[_0x4ef7('0x37')](_0x260923);}else{return _0x36369c;}}})[_0x4ef7('0x23')](function(_0x23050b){_0x40eaaa[_0x4ef7('0x96')]=_0x23050b[_0x4ef7('0x38')]({'plain':!![]});_0x40eaaa['interaction'][_0x4ef7('0x97')]=_0x57331e;if(_0x40eaaa[_0x4ef7('0x96')][_0x4ef7('0x97')]){if(_0x40eaaa[_0x4ef7('0x85')][_0x4ef7('0x98')]){_0x40eaaa[_0x4ef7('0x86')][_0x4ef7('0x99')]({'id':0x0,'priority':_0x40eaaa[_0x4ef7('0x86')][_0x4ef7('0x47')]+0x1,'app':_0x4ef7('0x9a'),'appdata':_0x4ef7('0x9b'),'interval':'*,*,*,*'});}}return db['OpenchannelMessage']['create']({'body':_0x4c9e9d[_0x4ef7('0x5c')]['body'],'OpenchannelAccountId':_0x4c9e9d['params']['id'],'OpenchannelInteractionId':_0x23050b['id'],'direction':'in','ContactId':_0x40eaaa['contact']['id'],'AttachmentId':_0x4c9e9d['body'][_0x4ef7('0x9c')]});})[_0x4ef7('0x23')](function(_0x43ccf9){_0x40eaaa[_0x4ef7('0x2b')]=_0x43ccf9;if(_0x40eaaa[_0x4ef7('0x96')][_0x4ef7('0x9d')]){return db['User'][_0x4ef7('0x5a')]({'attributes':['id','name'],'where':{'id':_0x40eaaa[_0x4ef7('0x96')][_0x4ef7('0x9d')]}})[_0x4ef7('0x23')](function(_0x3cae08){if(_0x3cae08){_0x40eaaa[_0x4ef7('0x86')]['unshift']({'id':0x0,'priority':0x0,'app':_0x4ef7('0x9e'),'appdata':_0x3cae08[_0x4ef7('0x3c')]+','+(_0x40eaaa[_0x4ef7('0x85')][_0x4ef7('0x9f')]||0xa),'interval':'*,*,*,*'});_0x40eaaa[_0x4ef7('0xa0')]=![];}return respondWithRpcPromise(_0x4ef7('0xa1'),_0x4ef7('0xa2'),_0x40eaaa);});}return respondWithRpcPromise(_0x4ef7('0xa1'),_0x4ef7('0xa2'),_0x40eaaa);})[_0x4ef7('0x23')](function(_0x2f0210){respondWithRpcPromise(_0x4ef7('0xa3'),_0x4ef7('0xa3'),{'event':_0x4ef7('0x71'),'message':_0x2f0210},client9002);return _0x2f0210;})['then'](respondWithResult(_0x5b63d5,null))[_0x4ef7('0x2d')](handleError(_0x5b63d5,null));};exports[_0x4ef7('0xa4')]=function(_0x1dd91d,_0x162560,_0x246c64){return db['OpenchannelAccount'][_0x4ef7('0x6e')]({'where':{'id':_0x1dd91d[_0x4ef7('0x58')]['id']}})[_0x4ef7('0x23')](handleEntityNotFound(_0x162560,null))[_0x4ef7('0x23')](function(_0x12fc43){if(_0x12fc43){return db[_0x4ef7('0xa5')][_0x4ef7('0xa6')](function(_0x5697e7){return db[_0x4ef7('0x84')][_0x4ef7('0x3a')]({'where':{'OpenchannelAccountId':_0x1dd91d[_0x4ef7('0x58')]['id']},'transaction':_0x5697e7})[_0x4ef7('0x23')](function(_0x566530){var _0x104b42=_['map'](_0x1dd91d[_0x4ef7('0x5c')],function(_0x49a558){_0x49a558[_0x4ef7('0x69')]=_0x1dd91d[_0x4ef7('0x58')]['id'];return _0x49a558;});return db[_0x4ef7('0x84')][_0x4ef7('0xa7')](_0x104b42,{'transaction':_0x5697e7});});})['then'](function(){return db[_0x4ef7('0x84')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x1dd91d[_0x4ef7('0x58')]['id']},'order':'priority'});});}})[_0x4ef7('0x23')](respondWithResult(_0x162560,null))[_0x4ef7('0x2d')](handleError(_0x162560,null));};exports[_0x4ef7('0xa8')]=function(_0x486898,_0x165b99,_0x35bd45){var _0x601c73={};var _0x549bc8={};var _0x2ef273;var _0x73275d;return db[_0x4ef7('0x3f')]['findOne']({'where':{'id':_0x486898[_0x4ef7('0x58')]['id']}})[_0x4ef7('0x23')](handleEntityNotFound(_0x165b99,null))[_0x4ef7('0x23')](function(_0x34dad3){if(_0x34dad3){_0x2ef273=_0x34dad3;_0x549bc8[_0x4ef7('0x41')]=_[_0x4ef7('0x42')](db[_0x4ef7('0x84')]['rawAttributes']);_0x549bc8[_0x4ef7('0x43')]=_[_0x4ef7('0x42')](_0x486898[_0x4ef7('0x43')]);_0x549bc8['filters']=_[_0x4ef7('0x44')](_0x549bc8[_0x4ef7('0x41')],_0x549bc8[_0x4ef7('0x43')]);_0x601c73[_0x4ef7('0x45')]=_[_0x4ef7('0x44')](_0x549bc8[_0x4ef7('0x41')],qs[_0x4ef7('0x46')](_0x486898[_0x4ef7('0x43')][_0x4ef7('0x46')]));_0x601c73[_0x4ef7('0x45')]=_0x601c73[_0x4ef7('0x45')]['length']?_0x601c73[_0x4ef7('0x45')]:_0x549bc8['model'];_0x601c73[_0x4ef7('0x67')]=qs[_0x4ef7('0x4b')](_0x486898[_0x4ef7('0x43')][_0x4ef7('0x4b')]);_0x601c73[_0x4ef7('0x4e')]=qs[_0x4ef7('0x4c')](_[_0x4ef7('0x68')](_0x486898[_0x4ef7('0x43')],_0x549bc8['filters']));if(_0x486898[_0x4ef7('0x43')]['filter']){_0x601c73[_0x4ef7('0x4e')]=_[_0x4ef7('0x53')](_0x601c73[_0x4ef7('0x4e')],{'$or':_[_0x4ef7('0x4f')](_0x601c73[_0x4ef7('0x45')],function(_0x492fc5){var _0x34bcae={};_0x34bcae[_0x492fc5]={'$like':'%'+_0x486898[_0x4ef7('0x43')][_0x4ef7('0x4d')]+'%'};return _0x34bcae;})});}_0x601c73=_['merge']({},_0x601c73,_0x486898[_0x4ef7('0x54')]);return _0x2ef273[_0x4ef7('0xa8')](_0x601c73);}})[_0x4ef7('0x23')](function(_0x56e8a0){if(_0x56e8a0){_0x73275d=_0x56e8a0[_0x4ef7('0x47')];if(!_0x486898[_0x4ef7('0x43')][_0x4ef7('0x48')](_0x4ef7('0x49'))){_0x601c73[_0x4ef7('0x4a')]=qs[_0x4ef7('0x4a')](_0x486898['query'][_0x4ef7('0x4a')]);_0x601c73['offset']=qs[_0x4ef7('0x32')](_0x486898['query']['offset']);}return _0x2ef273[_0x4ef7('0xa8')](_0x601c73);}})[_0x4ef7('0x23')](function(_0x500ec6){if(_0x500ec6){return _0x500ec6?{'count':_0x73275d,'rows':_0x500ec6}:null;}})[_0x4ef7('0x23')](respondWithResult(_0x165b99,null))[_0x4ef7('0x2d')](handleError(_0x165b99,null));};exports['getInteractions']=function(_0x5eba14,_0x2a246b,_0x176c2e){var _0xe4929c={'raw':![],'where':{}};var _0x4dc88c={};var _0x1bf07e={'count':0x0,'rows':[]};return db[_0x4ef7('0x3f')]['findOne']({'where':{'id':_0x5eba14[_0x4ef7('0x58')]['id']}})[_0x4ef7('0x23')](handleEntityNotFound(_0x2a246b,null))[_0x4ef7('0x23')](function(_0x4dc898){if(_0x4dc898){_0x4dc88c[_0x4ef7('0x41')]=_[_0x4ef7('0x42')](db[_0x4ef7('0x90')][_0x4ef7('0x40')]);_0x4dc88c[_0x4ef7('0x43')]=_[_0x4ef7('0x42')](_0x5eba14[_0x4ef7('0x43')]);_0x4dc88c['filters']=_[_0x4ef7('0x44')](_0x4dc88c[_0x4ef7('0x41')],_0x4dc88c[_0x4ef7('0x43')]);_0xe4929c[_0x4ef7('0x45')]=_[_0x4ef7('0x44')](_0x4dc88c['model'],qs[_0x4ef7('0x46')](_0x5eba14[_0x4ef7('0x43')][_0x4ef7('0x46')]));_0xe4929c[_0x4ef7('0x45')]=_0xe4929c[_0x4ef7('0x45')][_0x4ef7('0x47')]?_0xe4929c[_0x4ef7('0x45')]:_0x4dc88c[_0x4ef7('0x41')];if(!_0x5eba14[_0x4ef7('0x43')]['hasOwnProperty'](_0x4ef7('0x49'))){_0xe4929c['limit']=qs[_0x4ef7('0x4a')](_0x5eba14[_0x4ef7('0x43')][_0x4ef7('0x4a')]);_0xe4929c['offset']=qs[_0x4ef7('0x32')](_0x5eba14[_0x4ef7('0x43')][_0x4ef7('0x32')]);}_0xe4929c['order']=qs[_0x4ef7('0x4b')](_0x5eba14[_0x4ef7('0x43')][_0x4ef7('0x4b')]);_0xe4929c[_0x4ef7('0x4e')]=qs['filters'](_[_0x4ef7('0x68')](_0x5eba14[_0x4ef7('0x43')],_0x4dc88c[_0x4ef7('0x4c')]));_0xe4929c['where'][_0x4ef7('0x69')]=_0x4dc898['id'];if(_0x5eba14[_0x4ef7('0x43')][_0x4ef7('0x4d')]){_0xe4929c[_0x4ef7('0x4e')]=_[_0x4ef7('0x53')](_0xe4929c[_0x4ef7('0x4e')],{'$or':_[_0x4ef7('0x4f')](_0xe4929c[_0x4ef7('0x45')],function(_0x191077){var _0xbc0c9a={};_0xbc0c9a[_0x191077]={'$like':'%'+_0x5eba14[_0x4ef7('0x43')]['filter']+'%'};return _0xbc0c9a;})});}_0xe4929c=_[_0x4ef7('0x53')]({},_0xe4929c,_0x5eba14[_0x4ef7('0x54')]);return db[_0x4ef7('0x90')]['count']({'where':_0xe4929c[_0x4ef7('0x4e')]})[_0x4ef7('0x23')](function(_0x268bab){_0x1bf07e[_0x4ef7('0x31')]=_0x268bab;if(_0x5eba14[_0x4ef7('0x43')][_0x4ef7('0x6f')]){_0xe4929c['include']=[{'model':db[_0x4ef7('0x82')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x4ef7('0xa9'),'attributes':[_0x4ef7('0x3c'),'fullname',_0x4ef7('0xaa')],'required':![]},{'model':db['Tag'],'as':_0x4ef7('0xab'),'attributes':['id',_0x4ef7('0x3c'),'color'],'where':_0x5eba14[_0x4ef7('0x43')][_0x4ef7('0xac')]?{'id':_0x5eba14[_0x4ef7('0x43')][_0x4ef7('0xac')]}:undefined,'required':_0x5eba14['query']['tag']?!![]:![]}];}return db['OpenchannelInteraction'][_0x4ef7('0x55')](_0xe4929c);})[_0x4ef7('0x23')](function(_0x2fa32d){_0x1bf07e[_0x4ef7('0x56')]=_0x2fa32d;return _0x1bf07e;});}})[_0x4ef7('0x23')](respondWithFilteredResult(_0x2a246b,_0xe4929c))[_0x4ef7('0x2d')](handleError(_0x2a246b,null));};exports[_0x4ef7('0xad')]=function(_0x5c1948,_0x3916e8,_0x4d5754){return db[_0x4ef7('0x3f')]['find']({'where':{'id':_0x5c1948[_0x4ef7('0x58')]['id']}})[_0x4ef7('0x23')](handleEntityNotFound(_0x3916e8,null))['then'](function(_0x260d8c){if(_0x260d8c){return _0x260d8c[_0x4ef7('0xad')](_0x5c1948[_0x4ef7('0x5c')][_0x4ef7('0x6c')],_[_0x4ef7('0xae')](_0x5c1948[_0x4ef7('0x5c')],[_0x4ef7('0x6c'),'id'])||{})[_0x4ef7('0x92')](function(_0x10eaeb){for(var _0x44d839=0x0;_0x44d839<_0x5c1948[_0x4ef7('0x5c')]['ids'][_0x4ef7('0x47')];_0x44d839+=0x1){socket[_0x4ef7('0xaf')]('userOpenchannelAccount:save',{'UserId':_0x5c1948[_0x4ef7('0x5c')][_0x4ef7('0x6c')][_0x44d839],'OpenchannelAccountId':_0x5c1948[_0x4ef7('0x58')]['id']});}return _0x10eaeb;});}})[_0x4ef7('0x23')](respondWithResult(_0x3916e8,null))[_0x4ef7('0x2d')](handleError(_0x3916e8,null));};exports[_0x4ef7('0xb0')]=function(_0x37dce8,_0x1aa7f1,_0x141f21){return db[_0x4ef7('0x3f')][_0x4ef7('0x5a')]({'where':{'id':_0x37dce8['params']['id']}})[_0x4ef7('0x23')](handleEntityNotFound(_0x1aa7f1,null))[_0x4ef7('0x23')](function(_0x4d20e2){if(_0x4d20e2){return _0x4d20e2[_0x4ef7('0xb0')](_0x37dce8[_0x4ef7('0x43')][_0x4ef7('0x6c')])['then'](function(){if(_[_0x4ef7('0xb1')](_0x37dce8[_0x4ef7('0x43')][_0x4ef7('0x6c')])){for(var _0x343f66=0x0;_0x343f66<_0x37dce8[_0x4ef7('0x43')][_0x4ef7('0x6c')]['length'];_0x343f66+=0x1){socket[_0x4ef7('0xaf')](_0x4ef7('0xb2'),{'UserId':Number(_0x37dce8['query'][_0x4ef7('0x6c')][_0x343f66]),'OpenchannelAccountId':Number(_0x37dce8[_0x4ef7('0x58')]['id'])});}}else{socket['emit'](_0x4ef7('0xb2'),{'UserId':Number(_0x37dce8[_0x4ef7('0x43')][_0x4ef7('0x6c')]),'OpenchannelAccountId':Number(_0x37dce8[_0x4ef7('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x1aa7f1,null))[_0x4ef7('0x2d')](handleError(_0x1aa7f1,null));};exports[_0x4ef7('0xb3')]=function(_0x3f3779,_0x5b8fad,_0x127ca7){var _0x209bd0={};var _0x292a8b={};var _0x38c65c;var _0x684d6;return db[_0x4ef7('0x3f')]['findOne']({'where':{'id':_0x3f3779[_0x4ef7('0x58')]['id']}})[_0x4ef7('0x23')](handleEntityNotFound(_0x5b8fad,null))['then'](function(_0x5f31e1){if(_0x5f31e1){_0x38c65c=_0x5f31e1;_0x292a8b[_0x4ef7('0x41')]=_[_0x4ef7('0x42')](db[_0x4ef7('0xb4')][_0x4ef7('0x40')]);_0x292a8b[_0x4ef7('0x43')]=_[_0x4ef7('0x42')](_0x3f3779[_0x4ef7('0x43')]);_0x292a8b[_0x4ef7('0x4c')]=_['intersection'](_0x292a8b['model'],_0x292a8b[_0x4ef7('0x43')]);_0x209bd0[_0x4ef7('0x45')]=_[_0x4ef7('0x44')](_0x292a8b[_0x4ef7('0x41')],qs['fields'](_0x3f3779['query']['fields']));_0x209bd0[_0x4ef7('0x45')]=_0x209bd0['attributes'][_0x4ef7('0x47')]?_0x209bd0[_0x4ef7('0x45')]:_0x292a8b[_0x4ef7('0x41')];_0x209bd0[_0x4ef7('0x67')]=qs['sort'](_0x3f3779[_0x4ef7('0x43')][_0x4ef7('0x4b')]);_0x209bd0[_0x4ef7('0x4e')]=qs[_0x4ef7('0x4c')](_[_0x4ef7('0x68')](_0x3f3779[_0x4ef7('0x43')],_0x292a8b[_0x4ef7('0x4c')]));if(_0x3f3779[_0x4ef7('0x43')][_0x4ef7('0x4d')]){_0x209bd0[_0x4ef7('0x4e')]=_[_0x4ef7('0x53')](_0x209bd0['where'],{'$or':_[_0x4ef7('0x4f')](_0x209bd0[_0x4ef7('0x45')],function(_0x55dcd5){var _0x211344={};_0x211344[_0x55dcd5]={'$like':'%'+_0x3f3779[_0x4ef7('0x43')][_0x4ef7('0x4d')]+'%'};return _0x211344;})});}_0x209bd0=_[_0x4ef7('0x53')]({},_0x209bd0,_0x3f3779[_0x4ef7('0x54')]);return _0x38c65c['getAgents'](_0x209bd0);}})['then'](function(_0x1dd52c){if(_0x1dd52c){_0x684d6=_0x1dd52c[_0x4ef7('0x47')];if(!_0x3f3779[_0x4ef7('0x43')][_0x4ef7('0x48')](_0x4ef7('0x49'))){_0x209bd0[_0x4ef7('0x4a')]=qs['limit'](_0x3f3779[_0x4ef7('0x43')][_0x4ef7('0x4a')]);_0x209bd0[_0x4ef7('0x32')]=qs[_0x4ef7('0x32')](_0x3f3779[_0x4ef7('0x43')][_0x4ef7('0x32')]);}return _0x38c65c[_0x4ef7('0xb3')](_0x209bd0);}})['then'](function(_0x2b106d){if(_0x2b106d){return _0x2b106d?{'count':_0x684d6,'rows':_0x2b106d}:null;}})['then'](respondWithResult(_0x5b8fad,null))[_0x4ef7('0x2d')](handleError(_0x5b8fad,null));};exports['send']=function(_0x5d5216,_0x1e45d0,_0xc947e8){var _0x55f4cb,_0x4c5fae,_0x332566;if(_[_0x4ef7('0x7a')](_0x5d5216['body']['body'])||_0x5d5216[_0x4ef7('0x5c')][_0x4ef7('0x5c')]===''){throw new db[(_0x4ef7('0x73'))][(_0x4ef7('0x74'))](_0x4ef7('0x7b'));}if(_['isNil'](_0x5d5216[_0x4ef7('0x5c')]['to'])){}_0x55f4cb=_0x5d5216[_0x4ef7('0x5c')]['to'];return db[_0x4ef7('0x3f')][_0x4ef7('0x6e')]({'where':{'id':_0x5d5216['params']['id']}})[_0x4ef7('0x23')](handleEntityNotFound(_0x1e45d0,null))[_0x4ef7('0x23')](function(_0x2a30a5){if(_0x2a30a5){return db[_0x4ef7('0x3f')]['find']({'where':{'id':_0x2a30a5['id']},'include':[{'model':db[_0x4ef7('0x80')],'as':'List','include':[{'model':db[_0x4ef7('0x82')],'as':_0x4ef7('0x8c'),'where':{[_0x2a30a5[_0x4ef7('0x7e')]]:_0x55f4cb},'limit':0x1,'order':[[_0x4ef7('0xb5'),_0x4ef7('0x83')]]}]}]})['then'](handleEntityNotFound(_0x1e45d0,null))[_0x4ef7('0x23')](function(_0x427b01){if(_0x427b01&&_0x427b01[_0x4ef7('0x81')]){_0x4c5fae=_0x427b01['get']({'plain':!![]});if(_0x4c5fae[_0x4ef7('0x81')]&&_0x4c5fae[_0x4ef7('0x81')]['Contacts'][_0x4ef7('0x47')]){return _0x4c5fae[_0x4ef7('0x81')]['Contacts'][0x0];}return db[_0x4ef7('0x82')][_0x4ef7('0x5b')](_[_0x4ef7('0x8d')](_0x5d5216['body'],{'firstName':_0x55f4cb,[_0x427b01[_0x4ef7('0x7e')]]:_0x55f4cb,'phone':_0x55f4cb,'ListId':_0x4c5fae['ListId']}));}})[_0x4ef7('0x23')](handleEntityNotFound(_0x1e45d0,null))[_0x4ef7('0x23')](function(_0x556542){if(_0x556542){_0x332566=_0x556542;return db[_0x4ef7('0x90')][_0x4ef7('0x5a')]({'where':{'ContactId':_0x332566['id'],'closed':![],'OpenchannelAccountId':_0x4c5fae['id']}})[_0x4ef7('0x23')](function(_0x77eca3){if(_0x77eca3){return[_0x77eca3,![]];}return db[_0x4ef7('0x90')][_0x4ef7('0x5b')]({'UserId':_0x5d5216[_0x4ef7('0x5d')]['id'],'ContactId':_0x332566['id'],'OpenchannelAccountId':_0x4c5fae['id'],'lastMsgDirection':'out','Messages':[_[_0x4ef7('0x53')](_0x5d5216[_0x4ef7('0x5c')],{'read':![],'body':_0x5d5216[_0x4ef7('0x5c')][_0x4ef7('0x5c')],'OpenchannelAccountId':_0x4c5fae['id'],'UserId':_0x5d5216['user']['id'],'ContactId':_0x332566['id']})]},{'include':[{'model':db[_0x4ef7('0xb6')],'as':'Messages'}]})[_0x4ef7('0x23')](function(_0xb7097e){return[_0xb7097e,!![]];});});}})['spread'](function(_0x3e0188,_0x41c5bd){if(_0x41c5bd){return _0x3e0188;}return db[_0x4ef7('0xb6')][_0x4ef7('0x5b')](_[_0x4ef7('0x53')](_0x5d5216['body'],{'read':![],'body':_0x5d5216[_0x4ef7('0x5c')]['body'],'OpenchannelAccountId':_0x4c5fae['id'],'OpenchannelInteractionId':_0x3e0188['id'],'UserId':_0x5d5216[_0x4ef7('0x5d')]['id'],'ContactId':_0x332566['id']}))['then'](function(_0x31a07d){_0x3e0188[_0x4ef7('0xb7')][_0x4ef7('0xb8')]=[];_0x3e0188[_0x4ef7('0xb7')][_0x4ef7('0xb8')]['push'](_0x31a07d['dataValues']);return _0x3e0188;});});}})['then'](respondWithResult(_0x1e45d0,null))['catch'](handleError(_0x1e45d0,null));}; \ No newline at end of file +var _0x4b16=['field','filter','options','count','include','findAll','show','params','mandatoryDispositionPause','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','pick','OpenchannelAccountId','includeAll','rows','ids','addAnswer','getAnswers','nolimit','CannedAnswer','notify','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','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','CmList','List','DESC','OpenchannelApplication','Applications','account','list','orderBy','applications','priority','asc','Contacts','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','findOne','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','push','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','OpenchannelAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','type','key','VIRTUAL'];(function(_0x40f62c,_0x5c26f8){var _0x3aa655=function(_0x4ad5fc){while(--_0x4ad5fc){_0x40f62c['push'](_0x40f62c['shift']());}};_0x3aa655(++_0x5c26f8);}(_0x4b16,0x1e4));var _0x64b1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b16[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x64b1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x64b1('0x1'));var zipdir=require(_0x64b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x64b1('0x3'));var moment=require('moment');var BPromise=require(_0x64b1('0x4'));var Mustache=require(_0x64b1('0x5'));var util=require(_0x64b1('0x6'));var path=require(_0x64b1('0x7'));var sox=require(_0x64b1('0x8'));var csv=require(_0x64b1('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x64b1('0xa'));var crypto=require(_0x64b1('0xb'));var jsforce=require(_0x64b1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x64b1('0x9'));var querystring=require('querystring');var Papa=require(_0x64b1('0xd'));var Redis=require(_0x64b1('0xe'));var authService=require(_0x64b1('0xf'));var qs=require(_0x64b1('0x10'));var hardwareService=require(_0x64b1('0x11'));var logger=require(_0x64b1('0x12'))(_0x64b1('0x13'));var utils=require(_0x64b1('0x14'));var config=require(_0x64b1('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x64b1('0x16')](config[_0x64b1('0x17')],{'host':_0x64b1('0x18'),'port':0x18eb});var socket=require(_0x64b1('0x19'))(new Redis(config[_0x64b1('0x17')]));require(_0x64b1('0x1a'))[_0x64b1('0x1b')](socket);var jayson=require(_0x64b1('0x1c'));var client=jayson[_0x64b1('0x1d')][_0x64b1('0x1e')]({'port':0x232c});var client9002=jayson[_0x64b1('0x1d')][_0x64b1('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x1ee4ac,_0x5853cc,_0x32ed33){if(_0x32ed33){var _0x1117f4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1117f4[_0x64b1('0x1f')](_0x5853cc)){return _0x1ee4ac;}else{throw new Error(_0x64b1('0x20'));}}else{return _0x1ee4ac;}}function respondWithRpcPromise(_0x50d7b1,_0x25f577,_0x4ae411,_0x4c80c3){return new BPromise(function(_0x114c96,_0xfcd940){var _0x2ed806=_0x4c80c3||client;return _0x2ed806['request'](_0x50d7b1,_0x4ae411)[_0x64b1('0x21')](function(_0x3da574){logger['info'](_0x64b1('0x22'),_0x25f577,_0x64b1('0x23'));logger[_0x64b1('0x24')](_0x64b1('0x25'),_0x25f577,_0x64b1('0x23'),JSON['stringify'](_0x3da574));if(_0x3da574[_0x64b1('0x26')]){if(_0x3da574[_0x64b1('0x26')][_0x64b1('0x27')]===0x1f4){logger[_0x64b1('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x25f577,_0x3da574[_0x64b1('0x26')][_0x64b1('0x28')]);return _0xfcd940(_0x3da574['error'][_0x64b1('0x28')]);}logger[_0x64b1('0x26')](_0x64b1('0x22'),_0x25f577,_0x3da574['error'][_0x64b1('0x28')]);return _0x114c96(_0x3da574[_0x64b1('0x26')]['message']);}else{logger[_0x64b1('0x29')](_0x64b1('0x22'),_0x25f577,'request\x20sent');_0x114c96(_0x3da574[_0x64b1('0x2a')][_0x64b1('0x28')]);}})[_0x64b1('0x2b')](function(_0x2252ae){logger[_0x64b1('0x26')](_0x64b1('0x22'),_0x25f577,_0x2252ae);_0xfcd940(_0x2252ae);});});}function respondWithStatusCode(_0x7ed372,_0x1f0888){_0x1f0888=_0x1f0888||0xcc;return function(_0x459e8f){if(_0x459e8f){return _0x7ed372[_0x64b1('0x2c')](_0x1f0888);}return _0x7ed372['status'](_0x1f0888)[_0x64b1('0x2d')]();};}function respondWithResult(_0x46c1f1,_0x115d2e){_0x115d2e=_0x115d2e||0xc8;return function(_0x1a315b){if(_0x1a315b){return _0x46c1f1[_0x64b1('0x2e')](_0x115d2e)[_0x64b1('0x2f')](_0x1a315b);}};}function respondWithFilteredResult(_0x28f9f0,_0x178722){return function(_0xcdf314){if(_0xcdf314){var _0x56c345=_0xcdf314['count'],_0x11af04=_0x178722[_0x64b1('0x30')],_0x2d1cb2=_0x178722[_0x64b1('0x30')]+_0x178722[_0x64b1('0x31')],_0x5024aa;if(_0x2d1cb2>=_0x56c345){_0x2d1cb2=_0x56c345;_0x5024aa=0xc8;}else{_0x5024aa=0xce;}_0x28f9f0[_0x64b1('0x2e')](_0x5024aa);return _0x28f9f0[_0x64b1('0x32')](_0x64b1('0x33'),_0x11af04+'-'+_0x2d1cb2+'/'+_0x56c345)[_0x64b1('0x2f')](_0xcdf314);}return null;};}function patchUpdates(_0x2f5b7b){return function(_0x548fcf){try{jsonpatch[_0x64b1('0x34')](_0x548fcf,_0x2f5b7b,!![]);}catch(_0x3bcd5a){return BPromise['reject'](_0x3bcd5a);}return _0x548fcf[_0x64b1('0x35')]();};}function saveUpdates(_0x61926f,_0x4b797a){return function(_0x3bda35){if(_0x3bda35){return _0x3bda35[_0x64b1('0x36')](_0x61926f)[_0x64b1('0x21')](function(_0x2b4ed4){return _0x2b4ed4;});}return null;};}function removeEntity(_0x4b34c7,_0xc398a8){return function(_0x163aeb){if(_0x163aeb){return _0x163aeb[_0x64b1('0x37')]()['then'](function(){var _0x56fa73=_0x163aeb[_0x64b1('0x38')]({'plain':!![]});var _0x4048e6=_0x64b1('0x39');return db[_0x64b1('0x3a')][_0x64b1('0x37')]({'where':{'type':_0x4048e6,'resourceId':_0x56fa73['id']}})['then'](function(){return _0x163aeb;});})[_0x64b1('0x21')](function(){_0x4b34c7[_0x64b1('0x2e')](0xcc)[_0x64b1('0x2d')]();});}};}function handleEntityNotFound(_0x2f3fac,_0x5cd068){return function(_0x38ab5d){if(!_0x38ab5d){_0x2f3fac[_0x64b1('0x2c')](0x194);}return _0x38ab5d;};}function handleError(_0x28b90b,_0x49d291){_0x49d291=_0x49d291||0x1f4;return function(_0xc77fb9){logger[_0x64b1('0x26')](_0xc77fb9[_0x64b1('0x3b')]);if(_0xc77fb9[_0x64b1('0x3c')]){delete _0xc77fb9[_0x64b1('0x3c')];}_0x28b90b[_0x64b1('0x2e')](_0x49d291)[_0x64b1('0x3d')](_0xc77fb9);};}exports[_0x64b1('0x3e')]=function(_0xcbc4ad,_0x4c75b0){var _0x243b2b={'include':[{'model':db[_0x64b1('0x3f')],'as':'mandatoryDispositionPause'}]},_0x1f0cb5={},_0x39dfa8={'count':0x0,'rows':[]};var _0x3786ce=db[_0x64b1('0x40')][_0x64b1('0x41')];_0x1f0cb5[_0x64b1('0x42')]=_[_0x64b1('0x43')](_0x3786ce);_0x1f0cb5[_0x64b1('0x44')]=_[_0x64b1('0x43')](_0xcbc4ad[_0x64b1('0x44')]);_0x1f0cb5[_0x64b1('0x45')]=_[_0x64b1('0x46')](_0x1f0cb5[_0x64b1('0x42')],_0x1f0cb5[_0x64b1('0x44')]);_0x243b2b[_0x64b1('0x47')]=_[_0x64b1('0x46')](_0x1f0cb5[_0x64b1('0x42')],qs[_0x64b1('0x48')](_0xcbc4ad[_0x64b1('0x44')]['fields']));_0x243b2b[_0x64b1('0x47')]=_0x243b2b[_0x64b1('0x47')][_0x64b1('0x49')]?_0x243b2b[_0x64b1('0x47')]:_0x1f0cb5[_0x64b1('0x42')];if(!_0xcbc4ad[_0x64b1('0x44')][_0x64b1('0x4a')]('nolimit')){_0x243b2b[_0x64b1('0x31')]=qs[_0x64b1('0x31')](_0xcbc4ad[_0x64b1('0x44')][_0x64b1('0x31')]);_0x243b2b['offset']=qs['offset'](_0xcbc4ad[_0x64b1('0x44')]['offset']);}_0x243b2b[_0x64b1('0x4b')]=qs['sort'](_0xcbc4ad[_0x64b1('0x44')][_0x64b1('0x4c')]);_0x243b2b[_0x64b1('0x4d')]=qs['filters'](_['pick'](_0xcbc4ad[_0x64b1('0x44')],_0x1f0cb5[_0x64b1('0x45')]));if(_0xcbc4ad['query']['filter']){_0x243b2b[_0x64b1('0x4d')]=_[_0x64b1('0x4e')](_0x243b2b[_0x64b1('0x4d')],{'$or':_[_0x64b1('0x4f')](_0x3786ce,function(_0xa9feaf){if(_0xa9feaf[_0x64b1('0x50')][_0x64b1('0x51')]!==_0x64b1('0x52')){var _0x1d6b9d={};_0x1d6b9d[_0xa9feaf[_0x64b1('0x53')]]={'$like':'%'+_0xcbc4ad[_0x64b1('0x44')][_0x64b1('0x54')]+'%'};return _0x1d6b9d;}})});}_0x243b2b=_[_0x64b1('0x4e')]({},_0x243b2b,_0xcbc4ad[_0x64b1('0x55')]);var _0x192add={'where':_0x243b2b[_0x64b1('0x4d')]};return db[_0x64b1('0x40')][_0x64b1('0x56')](_0x192add)[_0x64b1('0x21')](function(_0x1dd8d6){_0x39dfa8[_0x64b1('0x56')]=_0x1dd8d6;if(_0xcbc4ad[_0x64b1('0x44')]['includeAll']){_0x243b2b[_0x64b1('0x57')]=[{'all':!![]}];}return db[_0x64b1('0x40')][_0x64b1('0x58')](_0x243b2b);})[_0x64b1('0x21')](function(_0x2474ed){_0x39dfa8['rows']=_0x2474ed;return _0x39dfa8;})[_0x64b1('0x21')](respondWithFilteredResult(_0x4c75b0,_0x243b2b))['catch'](handleError(_0x4c75b0,null));};exports[_0x64b1('0x59')]=function(_0x2449c0,_0x6c86a8){var _0x2897db={'raw':![],'where':{'id':_0x2449c0[_0x64b1('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x64b1('0x5b')}]},_0x4e9f51={};_0x4e9f51[_0x64b1('0x42')]=_[_0x64b1('0x43')](db['OpenchannelAccount'][_0x64b1('0x41')]);_0x4e9f51[_0x64b1('0x44')]=_[_0x64b1('0x43')](_0x2449c0[_0x64b1('0x44')]);_0x4e9f51[_0x64b1('0x45')]=_[_0x64b1('0x46')](_0x4e9f51[_0x64b1('0x42')],_0x4e9f51[_0x64b1('0x44')]);_0x2897db[_0x64b1('0x47')]=_[_0x64b1('0x46')](_0x4e9f51['model'],qs['fields'](_0x2449c0[_0x64b1('0x44')][_0x64b1('0x48')]));_0x2897db['attributes']=_0x2897db['attributes'][_0x64b1('0x49')]?_0x2897db[_0x64b1('0x47')]:_0x4e9f51[_0x64b1('0x42')];if(_0x2449c0[_0x64b1('0x44')]['includeAll']){_0x2897db[_0x64b1('0x57')]=[{'all':!![]}];}_0x2897db=_['merge']({},_0x2897db,_0x2449c0[_0x64b1('0x55')]);return db[_0x64b1('0x40')][_0x64b1('0x5c')](_0x2897db)['then'](handleEntityNotFound(_0x6c86a8,null))[_0x64b1('0x21')](respondWithResult(_0x6c86a8,null))['catch'](handleError(_0x6c86a8,null));};exports['create']=function(_0x3516c1,_0xba006d){return db[_0x64b1('0x40')]['create'](_0x3516c1[_0x64b1('0x5d')],{})['then'](function(_0x368285){var _0x51448a=_0x3516c1[_0x64b1('0x5e')][_0x64b1('0x38')]({'plain':!![]});if(!_0x51448a)throw new Error(_0x64b1('0x5f'));if(_0x51448a[_0x64b1('0x60')]===_0x64b1('0x5e')){var _0x425028=_0x368285[_0x64b1('0x38')]({'plain':!![]});var _0x11d286=_0x64b1('0x39');return db['UserProfileSection']['find']({'where':{'name':_0x11d286,'userProfileId':_0x51448a[_0x64b1('0x61')]},'raw':!![]})[_0x64b1('0x21')](function(_0x104b43){if(_0x104b43&&_0x104b43[_0x64b1('0x62')]===0x0){return db[_0x64b1('0x3a')][_0x64b1('0x63')]({'name':_0x425028[_0x64b1('0x3c')],'resourceId':_0x425028['id'],'type':_0x104b43[_0x64b1('0x3c')],'sectionId':_0x104b43['id']},{})[_0x64b1('0x21')](function(){return _0x368285;});}else{return _0x368285;}})[_0x64b1('0x2b')](function(_0x4ce152){logger[_0x64b1('0x26')](_0x64b1('0x64'),_0x4ce152);throw _0x4ce152;});}return _0x368285;})[_0x64b1('0x21')](respondWithResult(_0xba006d,0xc9))[_0x64b1('0x2b')](handleError(_0xba006d,null));};exports['update']=function(_0x3c0540,_0x5a5c0f){if(_0x3c0540[_0x64b1('0x5d')]['id']){delete _0x3c0540[_0x64b1('0x5d')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x3c0540[_0x64b1('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x64b1('0x5b')}]})[_0x64b1('0x21')](handleEntityNotFound(_0x5a5c0f,null))[_0x64b1('0x21')](saveUpdates(_0x3c0540[_0x64b1('0x5d')],null))['then'](respondWithResult(_0x5a5c0f,null))['catch'](handleError(_0x5a5c0f,null));};exports[_0x64b1('0x37')]=function(_0x13cd74,_0x3af2eb){return db[_0x64b1('0x40')]['find']({'where':{'id':_0x13cd74[_0x64b1('0x5a')]['id']}})[_0x64b1('0x21')](handleEntityNotFound(_0x3af2eb,null))['then'](removeEntity(_0x3af2eb,null))['catch'](handleError(_0x3af2eb,null));};exports[_0x64b1('0x65')]=function(_0x375166,_0x38c576){return db[_0x64b1('0x40')][_0x64b1('0x65')]()[_0x64b1('0x21')](respondWithResult(_0x38c576,null))['catch'](handleError(_0x38c576,null));};exports['addDisposition']=function(_0x25a691,_0x205743,_0x291162){if(_0x25a691['body']['id']){delete _0x25a691['body']['id'];}return db[_0x64b1('0x40')]['find']({'where':{'id':_0x25a691[_0x64b1('0x5a')]['id']}})[_0x64b1('0x21')](handleEntityNotFound(_0x205743,null))[_0x64b1('0x21')](function(_0x3d680f){if(_0x3d680f){_0x25a691[_0x64b1('0x5d')]['OpnechannelAccountId']=_0x3d680f['id'];return db[_0x64b1('0x66')][_0x64b1('0x63')](_0x25a691[_0x64b1('0x5d')]);}})['then'](respondWithResult(_0x205743,null))[_0x64b1('0x2b')](handleError(_0x205743,null));};exports['getDispositions']=function(_0xb139cc,_0x1981c3,_0x1633bf){var _0x25bee3={'raw':![],'where':{}};var _0x57ff2e={};var _0x1b3810={'count':0x0,'rows':[]};return db[_0x64b1('0x40')]['findOne']({'where':{'id':_0xb139cc[_0x64b1('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1981c3,null))['then'](function(_0x558d52){if(_0x558d52){_0x57ff2e[_0x64b1('0x42')]=_['keys'](db[_0x64b1('0x66')][_0x64b1('0x41')]);_0x57ff2e[_0x64b1('0x44')]=_[_0x64b1('0x43')](_0xb139cc[_0x64b1('0x44')]);_0x57ff2e[_0x64b1('0x45')]=_[_0x64b1('0x46')](_0x57ff2e[_0x64b1('0x42')],_0x57ff2e[_0x64b1('0x44')]);_0x25bee3['attributes']=_['intersection'](_0x57ff2e[_0x64b1('0x42')],qs[_0x64b1('0x48')](_0xb139cc[_0x64b1('0x44')][_0x64b1('0x48')]));_0x25bee3[_0x64b1('0x47')]=_0x25bee3[_0x64b1('0x47')][_0x64b1('0x49')]?_0x25bee3[_0x64b1('0x47')]:_0x57ff2e['model'];if(!_0xb139cc[_0x64b1('0x44')][_0x64b1('0x4a')]('nolimit')){_0x25bee3[_0x64b1('0x31')]=qs[_0x64b1('0x31')](_0xb139cc['query'][_0x64b1('0x31')]);_0x25bee3[_0x64b1('0x30')]=qs[_0x64b1('0x30')](_0xb139cc['query']['offset']);}_0x25bee3[_0x64b1('0x4b')]=qs[_0x64b1('0x4c')](_0xb139cc[_0x64b1('0x44')][_0x64b1('0x4c')]);_0x25bee3[_0x64b1('0x4d')]=qs['filters'](_[_0x64b1('0x67')](_0xb139cc[_0x64b1('0x44')],_0x57ff2e[_0x64b1('0x45')]));_0x25bee3[_0x64b1('0x4d')][_0x64b1('0x68')]=_0x558d52['id'];if(_0xb139cc[_0x64b1('0x44')][_0x64b1('0x54')]){_0x25bee3[_0x64b1('0x4d')]=_['merge'](_0x25bee3['where'],{'$or':_[_0x64b1('0x4f')](_0x25bee3[_0x64b1('0x47')],function(_0x4cde66){var _0x121cef={};_0x121cef[_0x4cde66]={'$like':'%'+_0xb139cc[_0x64b1('0x44')][_0x64b1('0x54')]+'%'};return _0x121cef;})});}_0x25bee3=_['merge']({},_0x25bee3,_0xb139cc['options']);return db[_0x64b1('0x66')][_0x64b1('0x56')]({'where':_0x25bee3[_0x64b1('0x4d')]})[_0x64b1('0x21')](function(_0x228cc7){_0x1b3810[_0x64b1('0x56')]=_0x228cc7;if(_0xb139cc[_0x64b1('0x44')][_0x64b1('0x69')]){_0x25bee3['include']=[{'all':!![]}];}return db[_0x64b1('0x66')][_0x64b1('0x58')](_0x25bee3);})['then'](function(_0x2f31eb){_0x1b3810[_0x64b1('0x6a')]=_0x2f31eb;return _0x1b3810;});}})[_0x64b1('0x21')](respondWithFilteredResult(_0x1981c3,_0x25bee3))[_0x64b1('0x2b')](handleError(_0x1981c3,null));};exports['removeDispositions']=function(_0xd00eb5,_0x2dd2fd,_0xaec4ee){return db[_0x64b1('0x40')][_0x64b1('0x5c')]({'where':{'id':_0xd00eb5[_0x64b1('0x5a')]['id']}})[_0x64b1('0x21')](handleEntityNotFound(_0x2dd2fd,null))['then'](function(_0xb4b326){if(_0xb4b326){return _0xb4b326['removeDispositions'](_0xd00eb5[_0x64b1('0x44')][_0x64b1('0x6b')]);}})[_0x64b1('0x21')](respondWithStatusCode(_0x2dd2fd,null))['catch'](handleError(_0x2dd2fd,null));};exports[_0x64b1('0x6c')]=function(_0x1b2c6a,_0xe61bc6,_0x3ae918){if(_0x1b2c6a[_0x64b1('0x5d')]['id']){delete _0x1b2c6a['body']['id'];}return db[_0x64b1('0x40')][_0x64b1('0x5c')]({'where':{'id':_0x1b2c6a['params']['id']}})[_0x64b1('0x21')](handleEntityNotFound(_0xe61bc6,null))[_0x64b1('0x21')](function(_0x597d2a){if(_0x597d2a){_0x1b2c6a[_0x64b1('0x5d')]['OpenchannelAccountId']=_0x597d2a['id'];return db['CannedAnswer']['create'](_0x1b2c6a[_0x64b1('0x5d')]);}})[_0x64b1('0x21')](respondWithResult(_0xe61bc6,null))['catch'](handleError(_0xe61bc6,null));};exports[_0x64b1('0x6d')]=function(_0x3e546c,_0x3faffa,_0x37c4dc){var _0x1a4d14={'raw':![],'where':{}};var _0x1c4156={};var _0x3dd9eb={'count':0x0,'rows':[]};return db[_0x64b1('0x40')]['findOne']({'where':{'id':_0x3e546c[_0x64b1('0x5a')]['id']}})[_0x64b1('0x21')](handleEntityNotFound(_0x3faffa,null))[_0x64b1('0x21')](function(_0x10b189){if(_0x10b189){_0x1c4156['model']=_[_0x64b1('0x43')](db['CannedAnswer']['rawAttributes']);_0x1c4156[_0x64b1('0x44')]=_['keys'](_0x3e546c[_0x64b1('0x44')]);_0x1c4156[_0x64b1('0x45')]=_[_0x64b1('0x46')](_0x1c4156[_0x64b1('0x42')],_0x1c4156[_0x64b1('0x44')]);_0x1a4d14[_0x64b1('0x47')]=_[_0x64b1('0x46')](_0x1c4156[_0x64b1('0x42')],qs[_0x64b1('0x48')](_0x3e546c[_0x64b1('0x44')][_0x64b1('0x48')]));_0x1a4d14[_0x64b1('0x47')]=_0x1a4d14['attributes'][_0x64b1('0x49')]?_0x1a4d14[_0x64b1('0x47')]:_0x1c4156['model'];if(!_0x3e546c[_0x64b1('0x44')][_0x64b1('0x4a')](_0x64b1('0x6e'))){_0x1a4d14['limit']=qs[_0x64b1('0x31')](_0x3e546c['query']['limit']);_0x1a4d14[_0x64b1('0x30')]=qs['offset'](_0x3e546c[_0x64b1('0x44')][_0x64b1('0x30')]);}_0x1a4d14['order']=qs[_0x64b1('0x4c')](_0x3e546c[_0x64b1('0x44')][_0x64b1('0x4c')]);_0x1a4d14[_0x64b1('0x4d')]=qs[_0x64b1('0x45')](_[_0x64b1('0x67')](_0x3e546c[_0x64b1('0x44')],_0x1c4156[_0x64b1('0x45')]));_0x1a4d14[_0x64b1('0x4d')]['OpenchannelAccountId']=_0x10b189['id'];if(_0x3e546c[_0x64b1('0x44')][_0x64b1('0x54')]){_0x1a4d14[_0x64b1('0x4d')]=_[_0x64b1('0x4e')](_0x1a4d14[_0x64b1('0x4d')],{'$or':_[_0x64b1('0x4f')](_0x1a4d14['attributes'],function(_0x48706b){var _0x5b84a4={};_0x5b84a4[_0x48706b]={'$like':'%'+_0x3e546c['query'][_0x64b1('0x54')]+'%'};return _0x5b84a4;})});}_0x1a4d14=_[_0x64b1('0x4e')]({},_0x1a4d14,_0x3e546c[_0x64b1('0x55')]);return db[_0x64b1('0x6f')][_0x64b1('0x56')]({'where':_0x1a4d14[_0x64b1('0x4d')]})[_0x64b1('0x21')](function(_0x4ab45d){_0x3dd9eb[_0x64b1('0x56')]=_0x4ab45d;if(_0x3e546c[_0x64b1('0x44')][_0x64b1('0x69')]){_0x1a4d14[_0x64b1('0x57')]=[{'all':!![]}];}return db[_0x64b1('0x6f')]['findAll'](_0x1a4d14);})[_0x64b1('0x21')](function(_0x17bdf0){_0x3dd9eb[_0x64b1('0x6a')]=_0x17bdf0;return _0x3dd9eb;});}})[_0x64b1('0x21')](respondWithFilteredResult(_0x3faffa,_0x1a4d14))[_0x64b1('0x2b')](handleError(_0x3faffa,null));};exports['removeAnswers']=function(_0x35cd09,_0x357f79,_0x347d4f){return db[_0x64b1('0x40')][_0x64b1('0x5c')]({'where':{'id':_0x35cd09[_0x64b1('0x5a')]['id']}})[_0x64b1('0x21')](handleEntityNotFound(_0x357f79,null))[_0x64b1('0x21')](function(_0x32c9c3){if(_0x32c9c3){return _0x32c9c3['removeAnswers'](_0x35cd09['query'][_0x64b1('0x6b')]);}})[_0x64b1('0x21')](respondWithStatusCode(_0x357f79,null))[_0x64b1('0x2b')](handleError(_0x357f79,null));};exports[_0x64b1('0x70')]=function(_0x55eef6,_0x147047,_0x32dff4){var _0x3f88ef={'body':_0x55eef6['body'],'channel':'openchannel'};var _0x549745=[];var _0x4c4730=[];var _0x551dd2={};var _0x2db545=![];return db[_0x64b1('0x71')]['describe']()[_0x64b1('0x21')](function(_0x50e49d){if(!_0x50e49d){throw new db[(_0x64b1('0x72'))][(_0x64b1('0x73'))](_0x64b1('0x74'));}_0x549745=_[_0x64b1('0x75')](_[_0x64b1('0x43')](_0x50e49d),[_0x64b1('0x76'),'updatedAt']);_0x4c4730=_['difference'](_['keys'](_0x50e49d),['createdAt',_0x64b1('0x77'),_0x64b1('0x78'),_0x64b1('0x79')]);if(_0x55eef6['body']['id']){delete _0x55eef6[_0x64b1('0x5d')]['id'];}if(_['isNil'](_0x55eef6['body'][_0x64b1('0x7a')])){throw new db[(_0x64b1('0x72'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x64b1('0x7b')](_0x55eef6[_0x64b1('0x5d')][_0x64b1('0x5d')])||_0x55eef6[_0x64b1('0x5d')][_0x64b1('0x5d')]===''){throw new db[(_0x64b1('0x72'))][(_0x64b1('0x73'))](_0x64b1('0x7c'));}if(_[_0x64b1('0x7b')](_0x55eef6[_0x64b1('0x5d')][_0x64b1('0x7d')])){throw new db[(_0x64b1('0x72'))][(_0x64b1('0x73'))](_0x64b1('0x7e')+_0x4c4730);}if(!_[_0x64b1('0x7f')](_0x4c4730,_0x55eef6[_0x64b1('0x5d')][_0x64b1('0x7d')])){throw new db[(_0x64b1('0x72'))]['ValidationError'](_0x64b1('0x80')+_0x4c4730);}_0x551dd2[_0x55eef6['body'][_0x64b1('0x7d')]]=_0x55eef6[_0x64b1('0x5d')][_0x64b1('0x7a')];})[_0x64b1('0x21')](function(){return db[_0x64b1('0x40')][_0x64b1('0x5c')]({'where':{'id':_0x55eef6[_0x64b1('0x5a')]['id']},'include':[{'model':db[_0x64b1('0x81')],'as':_0x64b1('0x82'),'include':[{'model':db[_0x64b1('0x71')],'as':'Contacts','where':_0x551dd2,'limit':0x1,'order':[['updatedAt',_0x64b1('0x83')]]}]},{'model':db[_0x64b1('0x84')],'as':_0x64b1('0x85')}]});})[_0x64b1('0x21')](handleEntityNotFound(_0x147047,null))['then'](function(_0x108eb2){if(_0x108eb2&&_0x108eb2[_0x64b1('0x82')]){_0x3f88ef[_0x64b1('0x86')]=_0x108eb2;_0x3f88ef['applications']=_0x108eb2[_0x64b1('0x85')];_0x3f88ef[_0x64b1('0x87')]=_0x108eb2['List'];_0x3f88ef['applications']=_[_0x64b1('0x88')](_0x3f88ef[_0x64b1('0x89')],[_0x64b1('0x8a')],[_0x64b1('0x8b')]);if(_0x3f88ef[_0x64b1('0x86')][_0x64b1('0x85')]){delete _0x3f88ef[_0x64b1('0x86')][_0x64b1('0x85')];}if(_0x3f88ef[_0x64b1('0x86')][_0x64b1('0x82')]&&_0x3f88ef[_0x64b1('0x86')]['List'][_0x64b1('0x8c')][_0x64b1('0x49')]){return _0x3f88ef[_0x64b1('0x86')]['List'][_0x64b1('0x8c')][0x0];}var _0x55b499=_[_0x64b1('0x16')](_0x55eef6[_0x64b1('0x5d')],{'firstName':_0x55eef6[_0x64b1('0x5d')][_0x64b1('0x7a')],'ListId':_0x108eb2[_0x64b1('0x79')]});_0x55b499[_0x55eef6[_0x64b1('0x5d')]['mapKey']]=_0x55eef6[_0x64b1('0x5d')][_0x64b1('0x7a')];return db[_0x64b1('0x71')][_0x64b1('0x63')](_0x55b499,{'fields':_0x549745,'raw':!![]});}})[_0x64b1('0x21')](handleEntityNotFound(_0x147047,null))[_0x64b1('0x21')](function(_0x32cdba){_0x3f88ef[_0x64b1('0x8d')]=_0x32cdba;if(_0x32cdba){var _0x297cab={'ContactId':_0x32cdba['id'],'OpenchannelAccountId':_0x55eef6[_0x64b1('0x5a')]['id'],'from':(_0x32cdba[_0x64b1('0x8e')]||'')+'\x20'+(_0x32cdba['lastName']||'')};var _0x4378ba={'OpenchannelAccountId':_0x55eef6[_0x64b1('0x5a')]['id'],'closed':![]};if(_0x55eef6[_0x64b1('0x5d')][_0x64b1('0x8f')]){_0x4378ba[_0x64b1('0x8f')]=_0x55eef6[_0x64b1('0x5d')][_0x64b1('0x8f')];return db[_0x64b1('0x90')][_0x64b1('0x5c')]({'where':_0x4378ba})['then'](function(_0x84cf29){if(_0x84cf29){return[_0x84cf29,![]];}_0x297cab[_0x64b1('0x8f')]=_0x55eef6[_0x64b1('0x5d')]['threadId'];_0x297cab[_0x64b1('0x91')]=_0x55eef6['body']['externalUrl'];return db[_0x64b1('0x90')][_0x64b1('0x63')](_0x297cab)[_0x64b1('0x21')](function(_0x23bc40){return[_0x23bc40,!![]];});});}else{_0x4378ba[_0x64b1('0x8f')]=null;}_0x4378ba[_0x64b1('0x92')]=_0x32cdba['id'];return db[_0x64b1('0x90')][_0x64b1('0x5c')]({'where':_0x4378ba})['then'](function(_0x728f1){if(_0x728f1){return[_0x728f1,![]];}return db['OpenchannelInteraction']['create'](_0x297cab)['then'](function(_0x144e26){return[_0x144e26,!![]];});});}})[_0x64b1('0x93')](function(_0x43ef05,_0x560b67){if(_0x43ef05){_0x2db545=_0x560b67;if(!_0x560b67){var _0x475b82={'from':(_0x3f88ef[_0x64b1('0x8d')][_0x64b1('0x8e')]||'')+'\x20'+(_0x3f88ef['contact']['lastName']||'')};if(_0x55eef6[_0x64b1('0x5d')][_0x64b1('0x8f')]&&_0x55eef6['body']['messageId']&&_0x55eef6[_0x64b1('0x5d')][_0x64b1('0x8f')]!=_0x55eef6[_0x64b1('0x5d')][_0x64b1('0x94')]){_0x475b82['threadId']=_0x55eef6[_0x64b1('0x5d')]['messageId'];}return _0x43ef05['update'](_0x475b82);}else{return _0x43ef05;}}})[_0x64b1('0x21')](function(_0x1ab1ce){_0x3f88ef[_0x64b1('0x95')]=_0x1ab1ce[_0x64b1('0x38')]({'plain':!![]});_0x3f88ef['interaction'][_0x64b1('0x96')]=_0x2db545;if(_0x3f88ef['interaction']['created']){if(_0x3f88ef[_0x64b1('0x86')][_0x64b1('0x97')]){_0x3f88ef[_0x64b1('0x89')]['push']({'id':0x0,'priority':_0x3f88ef[_0x64b1('0x89')]['length']+0x1,'app':_0x64b1('0x98'),'appdata':'unmanaged','interval':_0x64b1('0x99')});}}return db[_0x64b1('0x9a')]['create']({'body':_0x55eef6[_0x64b1('0x5d')][_0x64b1('0x5d')],'OpenchannelAccountId':_0x55eef6[_0x64b1('0x5a')]['id'],'OpenchannelInteractionId':_0x1ab1ce['id'],'direction':'in','ContactId':_0x3f88ef['contact']['id'],'AttachmentId':_0x55eef6['body'][_0x64b1('0x9b')]});})[_0x64b1('0x21')](function(_0x43592b){_0x3f88ef[_0x64b1('0x28')]=_0x43592b;if(_0x3f88ef[_0x64b1('0x95')][_0x64b1('0x9c')]){return db['User'][_0x64b1('0x5c')]({'attributes':['id',_0x64b1('0x3c')],'where':{'id':_0x3f88ef[_0x64b1('0x95')][_0x64b1('0x9c')]}})[_0x64b1('0x21')](function(_0x3f5c54){if(_0x3f5c54){_0x3f88ef[_0x64b1('0x89')][_0x64b1('0x9d')]({'id':0x0,'priority':0x0,'app':_0x64b1('0x9e'),'appdata':_0x3f5c54[_0x64b1('0x3c')]+','+(_0x3f88ef[_0x64b1('0x86')][_0x64b1('0x9f')]||0xa),'interval':_0x64b1('0x99')});_0x3f88ef[_0x64b1('0xa0')]=![];}return respondWithRpcPromise(_0x64b1('0xa1'),'startRouting',_0x3f88ef);});}return respondWithRpcPromise(_0x64b1('0xa1'),_0x64b1('0xa2'),_0x3f88ef);})[_0x64b1('0x21')](function(_0x338fa7){respondWithRpcPromise('EventManager','EventManager',{'event':'notify','message':_0x338fa7},client9002);return _0x338fa7;})['then'](respondWithResult(_0x147047,null))[_0x64b1('0x2b')](handleError(_0x147047,null));};exports['addApplications']=function(_0x23f8a1,_0x44e4b7,_0x1ba3f2){return db['OpenchannelAccount'][_0x64b1('0xa3')]({'where':{'id':_0x23f8a1[_0x64b1('0x5a')]['id']}})[_0x64b1('0x21')](handleEntityNotFound(_0x44e4b7,null))[_0x64b1('0x21')](function(_0x10c0a7){if(_0x10c0a7){return db[_0x64b1('0xa4')]['transaction'](function(_0x43df44){return db[_0x64b1('0x84')][_0x64b1('0x37')]({'where':{'OpenchannelAccountId':_0x23f8a1[_0x64b1('0x5a')]['id']},'transaction':_0x43df44})[_0x64b1('0x21')](function(_0xa6c6f6){var _0x4f65f8=_[_0x64b1('0x4f')](_0x23f8a1[_0x64b1('0x5d')],function(_0x487c81){_0x487c81['OpenchannelAccountId']=_0x23f8a1[_0x64b1('0x5a')]['id'];return _0x487c81;});return db[_0x64b1('0x84')][_0x64b1('0xa5')](_0x4f65f8,{'transaction':_0x43df44});});})[_0x64b1('0x21')](function(){return db[_0x64b1('0x84')][_0x64b1('0xa6')]({'where':{'OpenchannelAccountId':_0x23f8a1[_0x64b1('0x5a')]['id']},'order':_0x64b1('0x8a')});});}})['then'](respondWithResult(_0x44e4b7,null))['catch'](handleError(_0x44e4b7,null));};exports[_0x64b1('0xa7')]=function(_0x221a46,_0x1ec3c5,_0xf05cf1){var _0x550403={};var _0x5d8f92={};var _0x4a8230;var _0x95b73e;return db[_0x64b1('0x40')][_0x64b1('0xa3')]({'where':{'id':_0x221a46['params']['id']}})[_0x64b1('0x21')](handleEntityNotFound(_0x1ec3c5,null))[_0x64b1('0x21')](function(_0xd97ec9){if(_0xd97ec9){_0x4a8230=_0xd97ec9;_0x5d8f92[_0x64b1('0x42')]=_[_0x64b1('0x43')](db[_0x64b1('0x84')][_0x64b1('0x41')]);_0x5d8f92[_0x64b1('0x44')]=_['keys'](_0x221a46[_0x64b1('0x44')]);_0x5d8f92[_0x64b1('0x45')]=_['intersection'](_0x5d8f92[_0x64b1('0x42')],_0x5d8f92['query']);_0x550403['attributes']=_['intersection'](_0x5d8f92[_0x64b1('0x42')],qs[_0x64b1('0x48')](_0x221a46[_0x64b1('0x44')][_0x64b1('0x48')]));_0x550403['attributes']=_0x550403[_0x64b1('0x47')]['length']?_0x550403['attributes']:_0x5d8f92[_0x64b1('0x42')];_0x550403[_0x64b1('0x4b')]=qs[_0x64b1('0x4c')](_0x221a46[_0x64b1('0x44')][_0x64b1('0x4c')]);_0x550403[_0x64b1('0x4d')]=qs[_0x64b1('0x45')](_[_0x64b1('0x67')](_0x221a46[_0x64b1('0x44')],_0x5d8f92['filters']));if(_0x221a46[_0x64b1('0x44')][_0x64b1('0x54')]){_0x550403['where']=_[_0x64b1('0x4e')](_0x550403[_0x64b1('0x4d')],{'$or':_[_0x64b1('0x4f')](_0x550403[_0x64b1('0x47')],function(_0x1a7654){var _0x31ea34={};_0x31ea34[_0x1a7654]={'$like':'%'+_0x221a46[_0x64b1('0x44')][_0x64b1('0x54')]+'%'};return _0x31ea34;})});}_0x550403=_[_0x64b1('0x4e')]({},_0x550403,_0x221a46[_0x64b1('0x55')]);return _0x4a8230[_0x64b1('0xa7')](_0x550403);}})[_0x64b1('0x21')](function(_0x48de6b){if(_0x48de6b){_0x95b73e=_0x48de6b[_0x64b1('0x49')];if(!_0x221a46[_0x64b1('0x44')][_0x64b1('0x4a')](_0x64b1('0x6e'))){_0x550403[_0x64b1('0x31')]=qs[_0x64b1('0x31')](_0x221a46[_0x64b1('0x44')]['limit']);_0x550403[_0x64b1('0x30')]=qs[_0x64b1('0x30')](_0x221a46[_0x64b1('0x44')][_0x64b1('0x30')]);}return _0x4a8230['getApplications'](_0x550403);}})[_0x64b1('0x21')](function(_0x356053){if(_0x356053){return _0x356053?{'count':_0x95b73e,'rows':_0x356053}:null;}})[_0x64b1('0x21')](respondWithResult(_0x1ec3c5,null))[_0x64b1('0x2b')](handleError(_0x1ec3c5,null));};exports[_0x64b1('0xa8')]=function(_0x3d6b3e,_0x2e0efa,_0x4a2e50){var _0x221f82={'raw':![],'where':{}};var _0x3fc883={};var _0x3df74e={'count':0x0,'rows':[]};return db[_0x64b1('0x40')][_0x64b1('0xa3')]({'where':{'id':_0x3d6b3e[_0x64b1('0x5a')]['id']}})[_0x64b1('0x21')](handleEntityNotFound(_0x2e0efa,null))['then'](function(_0xd3b9f7){if(_0xd3b9f7){_0x3fc883[_0x64b1('0x42')]=_['keys'](db[_0x64b1('0x90')][_0x64b1('0x41')]);_0x3fc883[_0x64b1('0x44')]=_['keys'](_0x3d6b3e[_0x64b1('0x44')]);_0x3fc883[_0x64b1('0x45')]=_['intersection'](_0x3fc883[_0x64b1('0x42')],_0x3fc883[_0x64b1('0x44')]);_0x221f82[_0x64b1('0x47')]=_['intersection'](_0x3fc883['model'],qs[_0x64b1('0x48')](_0x3d6b3e['query']['fields']));_0x221f82[_0x64b1('0x47')]=_0x221f82[_0x64b1('0x47')]['length']?_0x221f82[_0x64b1('0x47')]:_0x3fc883[_0x64b1('0x42')];if(!_0x3d6b3e[_0x64b1('0x44')][_0x64b1('0x4a')](_0x64b1('0x6e'))){_0x221f82[_0x64b1('0x31')]=qs['limit'](_0x3d6b3e['query'][_0x64b1('0x31')]);_0x221f82['offset']=qs[_0x64b1('0x30')](_0x3d6b3e[_0x64b1('0x44')][_0x64b1('0x30')]);}_0x221f82[_0x64b1('0x4b')]=qs['sort'](_0x3d6b3e['query'][_0x64b1('0x4c')]);_0x221f82[_0x64b1('0x4d')]=qs['filters'](_[_0x64b1('0x67')](_0x3d6b3e[_0x64b1('0x44')],_0x3fc883[_0x64b1('0x45')]));_0x221f82['where'][_0x64b1('0x68')]=_0xd3b9f7['id'];if(_0x3d6b3e[_0x64b1('0x44')]['filter']){_0x221f82[_0x64b1('0x4d')]=_[_0x64b1('0x4e')](_0x221f82[_0x64b1('0x4d')],{'$or':_[_0x64b1('0x4f')](_0x221f82['attributes'],function(_0x4b1090){var _0x2bccba={};_0x2bccba[_0x4b1090]={'$like':'%'+_0x3d6b3e[_0x64b1('0x44')][_0x64b1('0x54')]+'%'};return _0x2bccba;})});}_0x221f82=_['merge']({},_0x221f82,_0x3d6b3e[_0x64b1('0x55')]);return db[_0x64b1('0x90')][_0x64b1('0x56')]({'where':_0x221f82['where']})['then'](function(_0x6bf64f){_0x3df74e[_0x64b1('0x56')]=_0x6bf64f;if(_0x3d6b3e[_0x64b1('0x44')]['includeAll']){_0x221f82[_0x64b1('0x57')]=[{'model':db[_0x64b1('0x71')],'as':_0x64b1('0xa9'),'required':![]},{'model':db[_0x64b1('0xaa')],'as':_0x64b1('0xab'),'attributes':[_0x64b1('0x3c'),_0x64b1('0xac'),_0x64b1('0xad')],'required':![]},{'model':db[_0x64b1('0xae')],'as':_0x64b1('0xaf'),'attributes':['id',_0x64b1('0x3c'),'color'],'where':_0x3d6b3e[_0x64b1('0x44')][_0x64b1('0xb0')]?{'id':_0x3d6b3e[_0x64b1('0x44')][_0x64b1('0xb0')]}:undefined,'required':_0x3d6b3e[_0x64b1('0x44')][_0x64b1('0xb0')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x221f82);})[_0x64b1('0x21')](function(_0x101a23){_0x3df74e[_0x64b1('0x6a')]=_0x101a23;return _0x3df74e;});}})[_0x64b1('0x21')](respondWithFilteredResult(_0x2e0efa,_0x221f82))[_0x64b1('0x2b')](handleError(_0x2e0efa,null));};exports[_0x64b1('0xb1')]=function(_0x5e9dd9,_0x2c38dc,_0x5c9fa1){return db['OpenchannelAccount'][_0x64b1('0x5c')]({'where':{'id':_0x5e9dd9[_0x64b1('0x5a')]['id']}})[_0x64b1('0x21')](handleEntityNotFound(_0x2c38dc,null))[_0x64b1('0x21')](function(_0x597ec8){if(_0x597ec8){return _0x597ec8[_0x64b1('0xb1')](_0x5e9dd9[_0x64b1('0x5d')][_0x64b1('0x6b')],_[_0x64b1('0xb2')](_0x5e9dd9['body'],[_0x64b1('0x6b'),'id'])||{})['spread'](function(_0x33b421){for(var _0x480599=0x0;_0x480599<_0x5e9dd9['body'][_0x64b1('0x6b')][_0x64b1('0x49')];_0x480599+=0x1){socket['emit'](_0x64b1('0xb3'),{'UserId':_0x5e9dd9[_0x64b1('0x5d')][_0x64b1('0x6b')][_0x480599],'OpenchannelAccountId':_0x5e9dd9[_0x64b1('0x5a')]['id']});}return _0x33b421;});}})[_0x64b1('0x21')](respondWithResult(_0x2c38dc,null))['catch'](handleError(_0x2c38dc,null));};exports[_0x64b1('0xb4')]=function(_0xee3833,_0x9c3dd0,_0xdae342){return db[_0x64b1('0x40')][_0x64b1('0x5c')]({'where':{'id':_0xee3833[_0x64b1('0x5a')]['id']}})[_0x64b1('0x21')](handleEntityNotFound(_0x9c3dd0,null))[_0x64b1('0x21')](function(_0x3d2c61){if(_0x3d2c61){return _0x3d2c61['removeAgents'](_0xee3833[_0x64b1('0x44')][_0x64b1('0x6b')])[_0x64b1('0x21')](function(){if(_[_0x64b1('0xb5')](_0xee3833['query'][_0x64b1('0x6b')])){for(var _0x2e80c8=0x0;_0x2e80c8<_0xee3833['query'][_0x64b1('0x6b')][_0x64b1('0x49')];_0x2e80c8+=0x1){socket[_0x64b1('0xb6')]('userOpenchannelAccount:remove',{'UserId':Number(_0xee3833['query'][_0x64b1('0x6b')][_0x2e80c8]),'OpenchannelAccountId':Number(_0xee3833[_0x64b1('0x5a')]['id'])});}}else{socket[_0x64b1('0xb6')](_0x64b1('0xb7'),{'UserId':Number(_0xee3833[_0x64b1('0x44')][_0x64b1('0x6b')]),'OpenchannelAccountId':Number(_0xee3833[_0x64b1('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x9c3dd0,null))[_0x64b1('0x2b')](handleError(_0x9c3dd0,null));};exports[_0x64b1('0xb8')]=function(_0x29f61c,_0x419689,_0x3b4fae){var _0x848ebe={};var _0x1060e3={};var _0x4fdf4f;var _0x32fa2b;return db[_0x64b1('0x40')]['findOne']({'where':{'id':_0x29f61c['params']['id']}})[_0x64b1('0x21')](handleEntityNotFound(_0x419689,null))[_0x64b1('0x21')](function(_0x1d2652){if(_0x1d2652){_0x4fdf4f=_0x1d2652;_0x1060e3[_0x64b1('0x42')]=_['keys'](db[_0x64b1('0xaa')][_0x64b1('0x41')]);_0x1060e3['query']=_[_0x64b1('0x43')](_0x29f61c[_0x64b1('0x44')]);_0x1060e3[_0x64b1('0x45')]=_[_0x64b1('0x46')](_0x1060e3['model'],_0x1060e3[_0x64b1('0x44')]);_0x848ebe['attributes']=_['intersection'](_0x1060e3[_0x64b1('0x42')],qs[_0x64b1('0x48')](_0x29f61c[_0x64b1('0x44')][_0x64b1('0x48')]));_0x848ebe['attributes']=_0x848ebe[_0x64b1('0x47')][_0x64b1('0x49')]?_0x848ebe[_0x64b1('0x47')]:_0x1060e3[_0x64b1('0x42')];_0x848ebe['order']=qs['sort'](_0x29f61c['query'][_0x64b1('0x4c')]);_0x848ebe[_0x64b1('0x4d')]=qs[_0x64b1('0x45')](_[_0x64b1('0x67')](_0x29f61c[_0x64b1('0x44')],_0x1060e3[_0x64b1('0x45')]));if(_0x29f61c[_0x64b1('0x44')]['filter']){_0x848ebe[_0x64b1('0x4d')]=_[_0x64b1('0x4e')](_0x848ebe[_0x64b1('0x4d')],{'$or':_[_0x64b1('0x4f')](_0x848ebe['attributes'],function(_0xdd9e11){var _0x30d54e={};_0x30d54e[_0xdd9e11]={'$like':'%'+_0x29f61c[_0x64b1('0x44')][_0x64b1('0x54')]+'%'};return _0x30d54e;})});}_0x848ebe=_[_0x64b1('0x4e')]({},_0x848ebe,_0x29f61c['options']);return _0x4fdf4f['getAgents'](_0x848ebe);}})[_0x64b1('0x21')](function(_0x4da83e){if(_0x4da83e){_0x32fa2b=_0x4da83e[_0x64b1('0x49')];if(!_0x29f61c[_0x64b1('0x44')]['hasOwnProperty'](_0x64b1('0x6e'))){_0x848ebe[_0x64b1('0x31')]=qs['limit'](_0x29f61c[_0x64b1('0x44')]['limit']);_0x848ebe['offset']=qs[_0x64b1('0x30')](_0x29f61c['query'][_0x64b1('0x30')]);}return _0x4fdf4f[_0x64b1('0xb8')](_0x848ebe);}})[_0x64b1('0x21')](function(_0x1b08af){if(_0x1b08af){return _0x1b08af?{'count':_0x32fa2b,'rows':_0x1b08af}:null;}})[_0x64b1('0x21')](respondWithResult(_0x419689,null))[_0x64b1('0x2b')](handleError(_0x419689,null));};exports['send']=function(_0x374d79,_0x5d16b0,_0x44b760){var _0x14db6c,_0x59a8ae,_0x3e1cab;if(_[_0x64b1('0x7b')](_0x374d79[_0x64b1('0x5d')]['body'])||_0x374d79['body'][_0x64b1('0x5d')]===''){throw new db[(_0x64b1('0x72'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x64b1('0x7b')](_0x374d79[_0x64b1('0x5d')]['to'])){}_0x14db6c=_0x374d79['body']['to'];return db[_0x64b1('0x40')]['findOne']({'where':{'id':_0x374d79[_0x64b1('0x5a')]['id']}})[_0x64b1('0x21')](handleEntityNotFound(_0x5d16b0,null))[_0x64b1('0x21')](function(_0x3dd76a){if(_0x3dd76a){return db['OpenchannelAccount'][_0x64b1('0x5c')]({'where':{'id':_0x3dd76a['id']},'include':[{'model':db[_0x64b1('0x81')],'as':_0x64b1('0x82'),'include':[{'model':db['CmContact'],'as':_0x64b1('0x8c'),'where':{[_0x3dd76a['mapKey']]:_0x14db6c},'limit':0x1,'order':[['updatedAt',_0x64b1('0x83')]]}]}]})['then'](handleEntityNotFound(_0x5d16b0,null))[_0x64b1('0x21')](function(_0x56642a){if(_0x56642a&&_0x56642a['List']){_0x59a8ae=_0x56642a[_0x64b1('0x38')]({'plain':!![]});if(_0x59a8ae['List']&&_0x59a8ae[_0x64b1('0x82')]['Contacts'][_0x64b1('0x49')]){return _0x59a8ae[_0x64b1('0x82')][_0x64b1('0x8c')][0x0];}return db[_0x64b1('0x71')][_0x64b1('0x63')](_[_0x64b1('0x16')](_0x374d79[_0x64b1('0x5d')],{'firstName':_0x14db6c,[_0x56642a[_0x64b1('0x7d')]]:_0x14db6c,'phone':_0x14db6c,'ListId':_0x59a8ae[_0x64b1('0x79')]}));}})[_0x64b1('0x21')](handleEntityNotFound(_0x5d16b0,null))[_0x64b1('0x21')](function(_0xf06526){if(_0xf06526){_0x3e1cab=_0xf06526;return db[_0x64b1('0x90')][_0x64b1('0x5c')]({'where':{'ContactId':_0x3e1cab['id'],'closed':![],'OpenchannelAccountId':_0x59a8ae['id']}})[_0x64b1('0x21')](function(_0x475ee5){if(_0x475ee5){return[_0x475ee5,![]];}return db[_0x64b1('0x90')][_0x64b1('0x63')]({'UserId':_0x374d79[_0x64b1('0x5e')]['id'],'ContactId':_0x3e1cab['id'],'OpenchannelAccountId':_0x59a8ae['id'],'lastMsgDirection':_0x64b1('0xb9'),'Messages':[_[_0x64b1('0x4e')](_0x374d79[_0x64b1('0x5d')],{'read':![],'body':_0x374d79[_0x64b1('0x5d')][_0x64b1('0x5d')],'OpenchannelAccountId':_0x59a8ae['id'],'UserId':_0x374d79[_0x64b1('0x5e')]['id'],'ContactId':_0x3e1cab['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x64b1('0xba')}]})['then'](function(_0x120483){return[_0x120483,!![]];});});}})[_0x64b1('0x93')](function(_0x41e834,_0x2693a2){if(_0x2693a2){return _0x41e834;}return db['OpenchannelMessage'][_0x64b1('0x63')](_[_0x64b1('0x4e')](_0x374d79[_0x64b1('0x5d')],{'read':![],'body':_0x374d79['body'][_0x64b1('0x5d')],'OpenchannelAccountId':_0x59a8ae['id'],'OpenchannelInteractionId':_0x41e834['id'],'UserId':_0x374d79['user']['id'],'ContactId':_0x3e1cab['id']}))[_0x64b1('0x21')](function(_0x27bf18){_0x41e834[_0x64b1('0xbb')][_0x64b1('0xba')]=[];_0x41e834['dataValues'][_0x64b1('0xba')][_0x64b1('0xbc')](_0x27bf18[_0x64b1('0xbb')]);return _0x41e834;});});}})[_0x64b1('0x21')](respondWithResult(_0x5d16b0,null))[_0x64b1('0x2b')](handleError(_0x5d16b0,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 2362f08..a9b9d4c 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 _0xe68b=['hasOwnProperty','hook','exports','events','OpenchannelAccount','setMaxListeners','emit'];(function(_0x5f14ef,_0x50f314){var _0x2407a8=function(_0x1a7317){while(--_0x1a7317){_0x5f14ef['push'](_0x5f14ef['shift']());}};_0x2407a8(++_0x50f314);}(_0xe68b,0x137));var _0xbe68=function(_0x715698,_0x2f50a){_0x715698=_0x715698-0x0;var _0x458a0d=_0xe68b[_0x715698];return _0x458a0d;};'use strict';var EventEmitter=require(_0xbe68('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xbe68('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbe68('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x50d775){return function(_0x4c23ae,_0x8f2d36,_0x243884){OpenchannelAccountEvents[_0xbe68('0x3')](_0x50d775+':'+_0x4c23ae['id'],_0x4c23ae);OpenchannelAccountEvents[_0xbe68('0x3')](_0x50d775,_0x4c23ae);_0x243884(null);};}for(var e in events){if(events[_0xbe68('0x4')](e)){var event=events[e];OpenchannelAccount[_0xbe68('0x5')](e,emitEvent(event));}}module[_0xbe68('0x6')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x7c75=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x1a5501,_0x37781e){var _0x16da06=function(_0x2e7ab6){while(--_0x2e7ab6){_0x1a5501['push'](_0x1a5501['shift']());}};_0x16da06(++_0x37781e);}(_0x7c75,0xca));var _0x57c7=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x7c75[_0x1abb09];return _0xea1c07;};'use strict';var EventEmitter=require(_0x57c7('0x0'));var OpenchannelAccount=require(_0x57c7('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x57c7('0x2')](0x0);var events={'afterCreate':_0x57c7('0x3'),'afterUpdate':_0x57c7('0x4'),'afterDestroy':_0x57c7('0x5')};function emitEvent(_0x1f5e51){return function(_0x3364b6,_0x8b3814,_0x4593b7){OpenchannelAccountEvents['emit'](_0x1f5e51+':'+_0x3364b6['id'],_0x3364b6);OpenchannelAccountEvents[_0x57c7('0x6')](_0x1f5e51,_0x3364b6);_0x4593b7(null);};}for(var e in events){if(events[_0x57c7('0x7')](e)){var event=events[e];OpenchannelAccount[_0x57c7('0x8')](e,emitEvent(event));}}module[_0x57c7('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 648e8d9..2bc12d1 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 _0x2b7a=['OpenchannelAccount','openchannel_accounts','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelAccount.attributes','exports','define'];(function(_0x73d5aa,_0xf43815){var _0x165803=function(_0x5859c9){while(--_0x5859c9){_0x73d5aa['push'](_0x73d5aa['shift']());}};_0x165803(++_0xf43815);}(_0x2b7a,0x1d6));var _0xa2b7=function(_0x41fa5c,_0x411cce){_0x41fa5c=_0x41fa5c-0x0;var _0x3b02b1=_0x2b7a[_0x41fa5c];return _0x3b02b1;};'use strict';var _=require(_0xa2b7('0x0'));var util=require(_0xa2b7('0x1'));var logger=require(_0xa2b7('0x2'))('api');var moment=require(_0xa2b7('0x3'));var BPromise=require(_0xa2b7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2b7('0x5'));var rimraf=require(_0xa2b7('0x6'));var config=require(_0xa2b7('0x7'));var attributes=require(_0xa2b7('0x8'));module[_0xa2b7('0x9')]=function(_0x38d142,_0x3a2778){return _0x38d142[_0xa2b7('0xa')](_0xa2b7('0xb'),attributes,{'tableName':_0xa2b7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc56a=['request-promise','rimraf','../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','api','bluebird'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc56a,0x14b));var _0xac56=function(_0x2dd079,_0x13305b){_0x2dd079=_0x2dd079-0x0;var _0x50b01c=_0xc56a[_0x2dd079];return _0x50b01c;};'use strict';var _=require(_0xac56('0x0'));var util=require(_0xac56('0x1'));var logger=require(_0xac56('0x2'))(_0xac56('0x3'));var moment=require('moment');var BPromise=require(_0xac56('0x4'));var rp=require(_0xac56('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac56('0x6'));var config=require(_0xac56('0x7'));var attributes=require(_0xac56('0x8'));module[_0xac56('0x9')]=function(_0x92d787,_0x3fcf15){return _0x92d787[_0xac56('0xa')](_0xac56('0xb'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index 406ab07..d3f64f7 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 _0x79cb=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x79cb,0x16c));var _0xb79c=function(_0x437b8a,_0x4ed384){_0x437b8a=_0x437b8a-0x0;var _0x1837bc=_0x79cb[_0x437b8a];return _0x1837bc;};'use strict';var _=require(_0xb79c('0x0'));var util=require(_0xb79c('0x1'));var moment=require(_0xb79c('0x2'));var BPromise=require(_0xb79c('0x3'));var rs=require(_0xb79c('0x4'));var fs=require('fs');var Redis=require(_0xb79c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb79c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb79c('0x7'));var jayson=require(_0xb79c('0x8'));var client=jayson[_0xb79c('0x9')]['http']({'port':0x232a});config['redis']=_[_0xb79c('0xa')](config[_0xb79c('0xb')],{'host':_0xb79c('0xc'),'port':0x18eb});var socket=require(_0xb79c('0xd'))(new Redis(config[_0xb79c('0xb')]));require(_0xb79c('0xe'))['register'](socket);function respondWithRpcPromise(_0x45211d,_0x3aeb0e,_0x3b6ed2){return new BPromise(function(_0x1429b2,_0x543407){return client[_0xb79c('0xf')](_0x45211d,_0x3b6ed2)[_0xb79c('0x10')](function(_0x338d4e){logger['info'](_0xb79c('0x11'),_0x3aeb0e,'request\x20sent');logger[_0xb79c('0x12')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x3aeb0e,_0xb79c('0x13'),JSON[_0xb79c('0x14')](_0x338d4e));if(_0x338d4e[_0xb79c('0x15')]){if(_0x338d4e['error'][_0xb79c('0x16')]===0x1f4){logger[_0xb79c('0x15')](_0xb79c('0x11'),_0x3aeb0e,_0x338d4e['error'][_0xb79c('0x17')]);return _0x543407(_0x338d4e[_0xb79c('0x15')][_0xb79c('0x17')]);}logger[_0xb79c('0x15')](_0xb79c('0x11'),_0x3aeb0e,_0x338d4e[_0xb79c('0x15')][_0xb79c('0x17')]);return _0x1429b2(_0x338d4e[_0xb79c('0x15')]['message']);}else{logger[_0xb79c('0x18')](_0xb79c('0x11'),_0x3aeb0e,_0xb79c('0x13'));_0x1429b2(_0x338d4e[_0xb79c('0x19')]['message']);}})['catch'](function(_0xc39fab){logger['error'](_0xb79c('0x11'),_0x3aeb0e,_0xc39fab);_0x543407(_0xc39fab);});});} \ No newline at end of file +var _0x9832=['redis','defaults','localhost','socket.io-emitter','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x9832,0x81));var _0x2983=function(_0x19748e,_0x3b2beb){_0x19748e=_0x19748e-0x0;var _0x3f14f0=_0x9832[_0x19748e];return _0x3f14f0;};'use strict';var _=require('lodash');var util=require(_0x2983('0x0'));var moment=require(_0x2983('0x1'));var BPromise=require('bluebird');var rs=require(_0x2983('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2983('0x3'))(_0x2983('0x4'));var config=require(_0x2983('0x5'));var jayson=require(_0x2983('0x6'));var client=jayson[_0x2983('0x7')][_0x2983('0x8')]({'port':0x232a});config[_0x2983('0x9')]=_[_0x2983('0xa')](config[_0x2983('0x9')],{'host':_0x2983('0xb'),'port':0x18eb});var socket=require(_0x2983('0xc'))(new Redis(config[_0x2983('0x9')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x518cd0,_0x33278f,_0x39ac43){return new BPromise(function(_0xf64ac5,_0x23c862){return client['request'](_0x518cd0,_0x39ac43)['then'](function(_0x3eefd1){logger[_0x2983('0xd')](_0x2983('0xe'),_0x33278f,_0x2983('0xf'));logger[_0x2983('0x10')](_0x2983('0x11'),_0x33278f,_0x2983('0xf'),JSON[_0x2983('0x12')](_0x3eefd1));if(_0x3eefd1[_0x2983('0x13')]){if(_0x3eefd1['error']['code']===0x1f4){logger['error'](_0x2983('0xe'),_0x33278f,_0x3eefd1[_0x2983('0x13')]['message']);return _0x23c862(_0x3eefd1[_0x2983('0x13')][_0x2983('0x14')]);}logger[_0x2983('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x33278f,_0x3eefd1[_0x2983('0x13')][_0x2983('0x14')]);return _0xf64ac5(_0x3eefd1[_0x2983('0x13')]['message']);}else{logger[_0x2983('0xd')](_0x2983('0xe'),_0x33278f,_0x2983('0xf'));_0xf64ac5(_0x3eefd1[_0x2983('0x15')][_0x2983('0x14')]);}})[_0x2983('0x16')](function(_0x5e4d55){logger[_0x2983('0x13')](_0x2983('0xe'),_0x33278f,_0x5e4d55);_0x23c862(_0x5e4d55);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 06ee0af..03880d7 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 _0xec7b=['register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update','emit'];(function(_0x27adba,_0x49183f){var _0x301ca7=function(_0x13d9ba){while(--_0x13d9ba){_0x27adba['push'](_0x27adba['shift']());}};_0x301ca7(++_0x49183f);}(_0xec7b,0x7b));var _0xbec7=function(_0x1ac6e5,_0x40f47f){_0x1ac6e5=_0x1ac6e5-0x0;var _0x5877dc=_0xec7b[_0x1ac6e5];return _0x5877dc;};'use strict';var OpenchannelAccountEvents=require(_0xbec7('0x0'));var events=[_0xbec7('0x1'),_0xbec7('0x2'),_0xbec7('0x3')];function createListener(_0x53e60d,_0x4e0a55){return function(_0x273f17){_0x4e0a55[_0xbec7('0x4')](_0x53e60d,_0x273f17);};}function removeListener(_0x5f43be,_0xc352d6){return function(){OpenchannelAccountEvents['removeListener'](_0x5f43be,_0xc352d6);};}exports[_0xbec7('0x5')]=function(_0x4a4aab){for(var _0x4b7fa0=0x0,_0x689afb=events[_0xbec7('0x6')];_0x4b7fa0<_0x689afb;_0x4b7fa0++){var _0x10a42e=events[_0x4b7fa0];var _0x4592ac=createListener(_0xbec7('0x7')+_0x10a42e,_0x4a4aab);OpenchannelAccountEvents['on'](_0x10a42e,_0x4592ac);}}; \ No newline at end of file +var _0xaada=['./openchannelAccount.events','save','remove','emit','removeListener','register','openchannelAccount:'];(function(_0x3fcfb6,_0x515024){var _0x3b99a7=function(_0x10ddfd){while(--_0x10ddfd){_0x3fcfb6['push'](_0x3fcfb6['shift']());}};_0x3b99a7(++_0x515024);}(_0xaada,0xd9));var _0xaaad=function(_0x5308df,_0x421609){_0x5308df=_0x5308df-0x0;var _0xa1dbdb=_0xaada[_0x5308df];return _0xa1dbdb;};'use strict';var OpenchannelAccountEvents=require(_0xaaad('0x0'));var events=[_0xaaad('0x1'),_0xaaad('0x2'),'update'];function createListener(_0x374cb3,_0x469f9b){return function(_0x50b8f9){_0x469f9b[_0xaaad('0x3')](_0x374cb3,_0x50b8f9);};}function removeListener(_0x56d0e0,_0x494714){return function(){OpenchannelAccountEvents[_0xaaad('0x4')](_0x56d0e0,_0x494714);};}exports[_0xaaad('0x5')]=function(_0x6ca3a1){for(var _0x58a5d0=0x0,_0x3332ad=events['length'];_0x58a5d0<_0x3332ad;_0x58a5d0++){var _0x4bfb90=events[_0x58a5d0];var _0x38cff6=createListener(_0xaaad('0x6')+_0x4bfb90,_0x6ca3a1);OpenchannelAccountEvents['on'](_0x4bfb90,_0x38cff6);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 63c5dca..1fa53d5 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 _0x43b7=['index','show','post','put','/:id','update','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated'];(function(_0x4532ca,_0x4d1b8c){var _0x551912=function(_0x172b85){while(--_0x172b85){_0x4532ca['push'](_0x4532ca['shift']());}};_0x551912(++_0x4d1b8c);}(_0x43b7,0xe0));var _0x743b=function(_0x1441ed,_0x3b7383){_0x1441ed=_0x1441ed-0x0;var _0x3cb952=_0x43b7[_0x1441ed];return _0x3cb952;};'use strict';var multer=require(_0x743b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x743b('0x1'));var express=require(_0x743b('0x2'));var router=express[_0x743b('0x3')]();var auth=require(_0x743b('0x4'));var interaction=require(_0x743b('0x5'));var config=require(_0x743b('0x6'));var controller=require(_0x743b('0x7'));router[_0x743b('0x8')]('/',auth[_0x743b('0x9')](),controller[_0x743b('0xa')]);router[_0x743b('0x8')]('/:id',auth[_0x743b('0x9')](),controller[_0x743b('0xb')]);router[_0x743b('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x743b('0xd')](_0x743b('0xe'),auth['isAuthenticated'](),controller[_0x743b('0xf')]);router[_0x743b('0x10')]('/:id',auth[_0x743b('0x9')](),controller['destroy']);module[_0x743b('0x11')]=router; \ No newline at end of file +var _0x8b2e=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put'];(function(_0x1098a9,_0x2748f9){var _0x166c83=function(_0x55a645){while(--_0x55a645){_0x1098a9['push'](_0x1098a9['shift']());}};_0x166c83(++_0x2748f9);}(_0x8b2e,0x15a));var _0xe8b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b2e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xe8b2('0x0'));var path=require(_0xe8b2('0x1'));var timeout=require(_0xe8b2('0x2'));var express=require(_0xe8b2('0x3'));var router=express[_0xe8b2('0x4')]();var auth=require(_0xe8b2('0x5'));var interaction=require(_0xe8b2('0x6'));var config=require(_0xe8b2('0x7'));var controller=require('./openchannelApplication.controller');router[_0xe8b2('0x8')]('/',auth[_0xe8b2('0x9')](),controller[_0xe8b2('0xa')]);router[_0xe8b2('0x8')](_0xe8b2('0xb'),auth[_0xe8b2('0x9')](),controller[_0xe8b2('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe8b2('0xd')]);router[_0xe8b2('0xe')](_0xe8b2('0xb'),auth['isAuthenticated'](),controller[_0xe8b2('0xf')]);router[_0xe8b2('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xe8b2('0x11')]);module[_0xe8b2('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index de77243..d53f22d 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 _0xf2d9=['sequelize','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x2a0e05,_0x39bf1c){var _0x486d00=function(_0x4525c1){while(--_0x4525c1){_0x2a0e05['push'](_0x2a0e05['shift']());}};_0x486d00(++_0x39bf1c);}(_0xf2d9,0xd2));var _0x9f2d=function(_0xe06e63,_0x416e00){_0xe06e63=_0xe06e63-0x0;var _0x4dbd66=_0xf2d9[_0xe06e63];return _0x4dbd66;};'use strict';var Sequelize=require(_0x9f2d('0x0'));module['exports']={'priority':{'type':Sequelize[_0x9f2d('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x9f2d('0x2')],'allowNull':![],'defaultValue':_0x9f2d('0x3')},'appdata':{'type':Sequelize[_0x9f2d('0x4')]()},'description':{'type':Sequelize[_0x9f2d('0x2')]},'interval':{'type':Sequelize[_0x9f2d('0x2')],'defaultValue':_0x9f2d('0x5')}}; \ No newline at end of file +var _0x593b=['*,*,*,*','INTEGER','STRING','TEXT'];(function(_0x1e9b71,_0x2bc67e){var _0x506183=function(_0x50e065){while(--_0x50e065){_0x1e9b71['push'](_0x1e9b71['shift']());}};_0x506183(++_0x2bc67e);}(_0x593b,0xa9));var _0xb593=function(_0x331dc4,_0x21c684){_0x331dc4=_0x331dc4-0x0;var _0x33e68a=_0x593b[_0x331dc4];return _0x33e68a;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xb593('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xb593('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb593('0x2')]()},'description':{'type':Sequelize[_0xb593('0x1')]},'interval':{'type':Sequelize[_0xb593('0x1')],'defaultValue':_0xb593('0x3')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index b21e95e..89396c9 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 _0x7665=['includeAll','findAll','rows','catch','params','include','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','util','ejs','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','update','then','destroy','error','name','send','index','OpenchannelApplication','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','map','type','key','VIRTUAL','merge'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7665,0x1d0));var _0x5766=function(_0xc5f94,_0x365d46){_0xc5f94=_0xc5f94-0x0;var _0x39f4d8=_0x7665[_0xc5f94];return _0x39f4d8;};'use strict';var pdf=require(_0x5766('0x0'));var emlformat=require(_0x5766('0x1'));var rimraf=require(_0x5766('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5766('0x3'));var rp=require(_0x5766('0x4'));var moment=require(_0x5766('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5766('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5766('0x7'));var fs=require('fs');var _=require(_0x5766('0x8'));var squel=require(_0x5766('0x9'));var crypto=require('crypto');var jsforce=require(_0x5766('0xa'));var deskjs=require(_0x5766('0xb'));var toCsv=require(_0x5766('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5766('0xd'));var authService=require(_0x5766('0xe'));var qs=require(_0x5766('0xf'));var hardwareService=require(_0x5766('0x10'));var logger=require(_0x5766('0x11'))(_0x5766('0x12'));var utils=require(_0x5766('0x13'));var config=require('../../config/environment');var db=require(_0x5766('0x14'))['db'];function respondWithStatusCode(_0x44ed2b,_0x7ece86){_0x7ece86=_0x7ece86||0xcc;return function(_0xb14519){if(_0xb14519){return _0x44ed2b['sendStatus'](_0x7ece86);}return _0x44ed2b[_0x5766('0x15')](_0x7ece86)[_0x5766('0x16')]();};}function respondWithResult(_0x37bd3a,_0x1846b9){_0x1846b9=_0x1846b9||0xc8;return function(_0x4a6f3a){if(_0x4a6f3a){return _0x37bd3a['status'](_0x1846b9)[_0x5766('0x17')](_0x4a6f3a);}};}function respondWithFilteredResult(_0x2acd25,_0x8f2514){return function(_0x79b471){if(_0x79b471){var _0x873aab=_0x79b471[_0x5766('0x18')],_0x19a8ca=_0x8f2514[_0x5766('0x19')],_0x13cb51=_0x8f2514['offset']+_0x8f2514[_0x5766('0x1a')],_0xbf87f9;if(_0x13cb51>=_0x873aab){_0x13cb51=_0x873aab;_0xbf87f9=0xc8;}else{_0xbf87f9=0xce;}_0x2acd25[_0x5766('0x15')](_0xbf87f9);return _0x2acd25[_0x5766('0x1b')](_0x5766('0x1c'),_0x19a8ca+'-'+_0x13cb51+'/'+_0x873aab)[_0x5766('0x17')](_0x79b471);}return null;};}function patchUpdates(_0x55bab9){return function(_0x14a2b6){try{jsonpatch['apply'](_0x14a2b6,_0x55bab9,!![]);}catch(_0x5c1956){return BPromise['reject'](_0x5c1956);}return _0x14a2b6['save']();};}function saveUpdates(_0x4de935,_0x425e63){return function(_0x2f8b67){if(_0x2f8b67){return _0x2f8b67[_0x5766('0x1d')](_0x4de935)[_0x5766('0x1e')](function(_0x2f0e0c){return _0x2f0e0c;});}return null;};}function removeEntity(_0x318e17,_0x17b312){return function(_0x4bbc74){if(_0x4bbc74){return _0x4bbc74[_0x5766('0x1f')]()[_0x5766('0x1e')](function(){_0x318e17['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fe457,_0x58dfb0){return function(_0x56fa39){if(!_0x56fa39){_0x1fe457['sendStatus'](0x194);}return _0x56fa39;};}function handleError(_0xf51ee2,_0x534df8){_0x534df8=_0x534df8||0x1f4;return function(_0x4dd245){logger[_0x5766('0x20')](_0x4dd245['stack']);if(_0x4dd245['name']){delete _0x4dd245[_0x5766('0x21')];}_0xf51ee2[_0x5766('0x15')](_0x534df8)[_0x5766('0x22')](_0x4dd245);};}exports[_0x5766('0x23')]=function(_0x338794,_0x59fc08){var _0x92cbf0={},_0x54548b={},_0x2e67ea={'count':0x0,'rows':[]};var _0x4ff987=db[_0x5766('0x24')][_0x5766('0x25')];_0x54548b[_0x5766('0x26')]=_[_0x5766('0x27')](_0x4ff987);_0x54548b[_0x5766('0x28')]=_['keys'](_0x338794[_0x5766('0x28')]);_0x54548b[_0x5766('0x29')]=_[_0x5766('0x2a')](_0x54548b[_0x5766('0x26')],_0x54548b[_0x5766('0x28')]);_0x92cbf0[_0x5766('0x2b')]=_[_0x5766('0x2a')](_0x54548b[_0x5766('0x26')],qs[_0x5766('0x2c')](_0x338794[_0x5766('0x28')][_0x5766('0x2c')]));_0x92cbf0[_0x5766('0x2b')]=_0x92cbf0[_0x5766('0x2b')]['length']?_0x92cbf0[_0x5766('0x2b')]:_0x54548b['model'];if(!_0x338794[_0x5766('0x28')][_0x5766('0x2d')]('nolimit')){_0x92cbf0['limit']=qs[_0x5766('0x1a')](_0x338794[_0x5766('0x28')][_0x5766('0x1a')]);_0x92cbf0['offset']=qs[_0x5766('0x19')](_0x338794[_0x5766('0x28')][_0x5766('0x19')]);}_0x92cbf0[_0x5766('0x2e')]=qs[_0x5766('0x2f')](_0x338794[_0x5766('0x28')][_0x5766('0x2f')]);_0x92cbf0[_0x5766('0x30')]=qs[_0x5766('0x29')](_[_0x5766('0x31')](_0x338794[_0x5766('0x28')],_0x54548b[_0x5766('0x29')]));if(_0x338794[_0x5766('0x28')][_0x5766('0x32')]){_0x92cbf0['where']=_['merge'](_0x92cbf0[_0x5766('0x30')],{'$or':_[_0x5766('0x33')](_0x4ff987,function(_0x417544){if(_0x417544[_0x5766('0x34')][_0x5766('0x35')]!==_0x5766('0x36')){var _0x534256={};_0x534256[_0x417544['field']]={'$like':'%'+_0x338794[_0x5766('0x28')][_0x5766('0x32')]+'%'};return _0x534256;}})});}_0x92cbf0=_[_0x5766('0x37')]({},_0x92cbf0,_0x338794['options']);var _0x5e7e35={'where':_0x92cbf0[_0x5766('0x30')]};return db[_0x5766('0x24')][_0x5766('0x18')](_0x5e7e35)[_0x5766('0x1e')](function(_0x3cb36b){_0x2e67ea['count']=_0x3cb36b;if(_0x338794[_0x5766('0x28')][_0x5766('0x38')]){_0x92cbf0['include']=[{'all':!![]}];}return db[_0x5766('0x24')][_0x5766('0x39')](_0x92cbf0);})['then'](function(_0x3a1f74){_0x2e67ea[_0x5766('0x3a')]=_0x3a1f74;return _0x2e67ea;})['then'](respondWithFilteredResult(_0x59fc08,_0x92cbf0))[_0x5766('0x3b')](handleError(_0x59fc08,null));};exports['show']=function(_0x7571d8,_0x536710){var _0x1edbee={'raw':!![],'where':{'id':_0x7571d8[_0x5766('0x3c')]['id']}},_0x19fb1d={};_0x19fb1d[_0x5766('0x26')]=_[_0x5766('0x27')](db[_0x5766('0x24')][_0x5766('0x25')]);_0x19fb1d[_0x5766('0x28')]=_[_0x5766('0x27')](_0x7571d8[_0x5766('0x28')]);_0x19fb1d[_0x5766('0x29')]=_['intersection'](_0x19fb1d['model'],_0x19fb1d[_0x5766('0x28')]);_0x1edbee[_0x5766('0x2b')]=_['intersection'](_0x19fb1d['model'],qs['fields'](_0x7571d8['query']['fields']));_0x1edbee[_0x5766('0x2b')]=_0x1edbee[_0x5766('0x2b')]['length']?_0x1edbee['attributes']:_0x19fb1d[_0x5766('0x26')];if(_0x7571d8[_0x5766('0x28')][_0x5766('0x38')]){_0x1edbee[_0x5766('0x3d')]=[{'all':!![]}];}_0x1edbee=_['merge']({},_0x1edbee,_0x7571d8['options']);return db[_0x5766('0x24')][_0x5766('0x3e')](_0x1edbee)[_0x5766('0x1e')](handleEntityNotFound(_0x536710,null))['then'](respondWithResult(_0x536710,null))['catch'](handleError(_0x536710,null));};exports[_0x5766('0x3f')]=function(_0x51e650,_0x32df13){return db['OpenchannelApplication']['create'](_0x51e650['body'],{})['then'](respondWithResult(_0x32df13,0xc9))[_0x5766('0x3b')](handleError(_0x32df13,null));};exports[_0x5766('0x1d')]=function(_0x335cae,_0x28f3f2){if(_0x335cae[_0x5766('0x40')]['id']){delete _0x335cae['body']['id'];}return db[_0x5766('0x24')][_0x5766('0x3e')]({'where':{'id':_0x335cae['params']['id']}})['then'](handleEntityNotFound(_0x28f3f2,null))[_0x5766('0x1e')](saveUpdates(_0x335cae[_0x5766('0x40')],null))[_0x5766('0x1e')](respondWithResult(_0x28f3f2,null))['catch'](handleError(_0x28f3f2,null));};exports[_0x5766('0x1f')]=function(_0x1577bf,_0x3c4ff2){return db[_0x5766('0x24')][_0x5766('0x3e')]({'where':{'id':_0x1577bf[_0x5766('0x3c')]['id']}})[_0x5766('0x1e')](handleEntityNotFound(_0x3c4ff2,null))[_0x5766('0x1e')](removeEntity(_0x3c4ff2,null))[_0x5766('0x3b')](handleError(_0x3c4ff2,null));}; \ No newline at end of file +var _0x5b5a=['body','find','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','OpenchannelApplication','rawAttributes','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','params','create'];(function(_0x121ffa,_0x5087b7){var _0x18341d=function(_0x19083d){while(--_0x19083d){_0x121ffa['push'](_0x121ffa['shift']());}};_0x18341d(++_0x5087b7);}(_0x5b5a,0x90));var _0xa5b5=function(_0x23c262,_0x74765a){_0x23c262=_0x23c262-0x0;var _0x9b913f=_0x5b5a[_0x23c262];return _0x9b913f;};'use strict';var pdf=require(_0xa5b5('0x0'));var emlformat=require(_0xa5b5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa5b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa5b5('0x3'));var moment=require(_0xa5b5('0x4'));var BPromise=require(_0xa5b5('0x5'));var Mustache=require('mustache');var util=require(_0xa5b5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xa5b5('0x7'));var ejs=require(_0xa5b5('0x8'));var fs=require('fs');var _=require(_0xa5b5('0x9'));var squel=require(_0xa5b5('0xa'));var crypto=require(_0xa5b5('0xb'));var jsforce=require(_0xa5b5('0xc'));var deskjs=require(_0xa5b5('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa5b5('0xe'));var Papa=require(_0xa5b5('0xf'));var Redis=require(_0xa5b5('0x10'));var authService=require(_0xa5b5('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa5b5('0x12'));var logger=require(_0xa5b5('0x13'))(_0xa5b5('0x14'));var utils=require(_0xa5b5('0x15'));var config=require('../../config/environment');var db=require(_0xa5b5('0x16'))['db'];function respondWithStatusCode(_0xa3f103,_0xbabb05){_0xbabb05=_0xbabb05||0xcc;return function(_0x2a1a3c){if(_0x2a1a3c){return _0xa3f103[_0xa5b5('0x17')](_0xbabb05);}return _0xa3f103['status'](_0xbabb05)[_0xa5b5('0x18')]();};}function respondWithResult(_0x190c3f,_0x67592){_0x67592=_0x67592||0xc8;return function(_0x230aaa){if(_0x230aaa){return _0x190c3f[_0xa5b5('0x19')](_0x67592)[_0xa5b5('0x1a')](_0x230aaa);}};}function respondWithFilteredResult(_0x1f02b3,_0x165836){return function(_0x483791){if(_0x483791){var _0x53da08=_0x483791[_0xa5b5('0x1b')],_0x58471e=_0x165836[_0xa5b5('0x1c')],_0x237459=_0x165836['offset']+_0x165836['limit'],_0x395301;if(_0x237459>=_0x53da08){_0x237459=_0x53da08;_0x395301=0xc8;}else{_0x395301=0xce;}_0x1f02b3[_0xa5b5('0x19')](_0x395301);return _0x1f02b3[_0xa5b5('0x1d')](_0xa5b5('0x1e'),_0x58471e+'-'+_0x237459+'/'+_0x53da08)[_0xa5b5('0x1a')](_0x483791);}return null;};}function patchUpdates(_0x11bf21){return function(_0x196cf2){try{jsonpatch[_0xa5b5('0x1f')](_0x196cf2,_0x11bf21,!![]);}catch(_0xe6b663){return BPromise[_0xa5b5('0x20')](_0xe6b663);}return _0x196cf2[_0xa5b5('0x21')]();};}function saveUpdates(_0x124c91,_0x4293a4){return function(_0x5b326f){if(_0x5b326f){return _0x5b326f[_0xa5b5('0x22')](_0x124c91)[_0xa5b5('0x23')](function(_0x43d509){return _0x43d509;});}return null;};}function removeEntity(_0x3c4bd7,_0x50388c){return function(_0x243d96){if(_0x243d96){return _0x243d96[_0xa5b5('0x24')]()[_0xa5b5('0x23')](function(){_0x3c4bd7[_0xa5b5('0x19')](0xcc)[_0xa5b5('0x18')]();});}};}function handleEntityNotFound(_0x492bc1,_0x3fd573){return function(_0x16b0a0){if(!_0x16b0a0){_0x492bc1[_0xa5b5('0x17')](0x194);}return _0x16b0a0;};}function handleError(_0x2e802e,_0x4bd464){_0x4bd464=_0x4bd464||0x1f4;return function(_0xcc4421){logger['error'](_0xcc4421[_0xa5b5('0x25')]);if(_0xcc4421['name']){delete _0xcc4421[_0xa5b5('0x26')];}_0x2e802e[_0xa5b5('0x19')](_0x4bd464)[_0xa5b5('0x27')](_0xcc4421);};}exports[_0xa5b5('0x28')]=function(_0x433fa9,_0x4b0252){var _0x22d4db={},_0x1ef5eb={},_0x5c59f7={'count':0x0,'rows':[]};var _0x26db49=db[_0xa5b5('0x29')][_0xa5b5('0x2a')];_0x1ef5eb['model']=_[_0xa5b5('0x2b')](_0x26db49);_0x1ef5eb[_0xa5b5('0x2c')]=_[_0xa5b5('0x2b')](_0x433fa9[_0xa5b5('0x2c')]);_0x1ef5eb['filters']=_['intersection'](_0x1ef5eb[_0xa5b5('0x2d')],_0x1ef5eb[_0xa5b5('0x2c')]);_0x22d4db[_0xa5b5('0x2e')]=_[_0xa5b5('0x2f')](_0x1ef5eb[_0xa5b5('0x2d')],qs['fields'](_0x433fa9[_0xa5b5('0x2c')][_0xa5b5('0x30')]));_0x22d4db[_0xa5b5('0x2e')]=_0x22d4db[_0xa5b5('0x2e')][_0xa5b5('0x31')]?_0x22d4db['attributes']:_0x1ef5eb[_0xa5b5('0x2d')];if(!_0x433fa9['query'][_0xa5b5('0x32')]('nolimit')){_0x22d4db['limit']=qs[_0xa5b5('0x33')](_0x433fa9[_0xa5b5('0x2c')]['limit']);_0x22d4db['offset']=qs[_0xa5b5('0x1c')](_0x433fa9[_0xa5b5('0x2c')][_0xa5b5('0x1c')]);}_0x22d4db[_0xa5b5('0x34')]=qs[_0xa5b5('0x35')](_0x433fa9[_0xa5b5('0x2c')][_0xa5b5('0x35')]);_0x22d4db[_0xa5b5('0x36')]=qs[_0xa5b5('0x37')](_[_0xa5b5('0x38')](_0x433fa9[_0xa5b5('0x2c')],_0x1ef5eb['filters']));if(_0x433fa9[_0xa5b5('0x2c')][_0xa5b5('0x39')]){_0x22d4db[_0xa5b5('0x36')]=_['merge'](_0x22d4db[_0xa5b5('0x36')],{'$or':_['map'](_0x26db49,function(_0x3513){if(_0x3513['type']['key']!==_0xa5b5('0x3a')){var _0x3cdd96={};_0x3cdd96[_0x3513[_0xa5b5('0x3b')]]={'$like':'%'+_0x433fa9['query'][_0xa5b5('0x39')]+'%'};return _0x3cdd96;}})});}_0x22d4db=_[_0xa5b5('0x3c')]({},_0x22d4db,_0x433fa9[_0xa5b5('0x3d')]);var _0x495ff3={'where':_0x22d4db[_0xa5b5('0x36')]};return db['OpenchannelApplication'][_0xa5b5('0x1b')](_0x495ff3)[_0xa5b5('0x23')](function(_0xa45d64){_0x5c59f7[_0xa5b5('0x1b')]=_0xa45d64;if(_0x433fa9['query'][_0xa5b5('0x3e')]){_0x22d4db[_0xa5b5('0x3f')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0xa5b5('0x40')](_0x22d4db);})[_0xa5b5('0x23')](function(_0x1bac7e){_0x5c59f7[_0xa5b5('0x41')]=_0x1bac7e;return _0x5c59f7;})[_0xa5b5('0x23')](respondWithFilteredResult(_0x4b0252,_0x22d4db))[_0xa5b5('0x42')](handleError(_0x4b0252,null));};exports['show']=function(_0x26e75d,_0xb05c3e){var _0x1e34f9={'raw':!![],'where':{'id':_0x26e75d[_0xa5b5('0x43')]['id']}},_0x3456de={};_0x3456de[_0xa5b5('0x2d')]=_[_0xa5b5('0x2b')](db[_0xa5b5('0x29')][_0xa5b5('0x2a')]);_0x3456de[_0xa5b5('0x2c')]=_[_0xa5b5('0x2b')](_0x26e75d[_0xa5b5('0x2c')]);_0x3456de[_0xa5b5('0x37')]=_['intersection'](_0x3456de[_0xa5b5('0x2d')],_0x3456de['query']);_0x1e34f9[_0xa5b5('0x2e')]=_['intersection'](_0x3456de[_0xa5b5('0x2d')],qs[_0xa5b5('0x30')](_0x26e75d['query'][_0xa5b5('0x30')]));_0x1e34f9['attributes']=_0x1e34f9[_0xa5b5('0x2e')][_0xa5b5('0x31')]?_0x1e34f9[_0xa5b5('0x2e')]:_0x3456de[_0xa5b5('0x2d')];if(_0x26e75d[_0xa5b5('0x2c')]['includeAll']){_0x1e34f9[_0xa5b5('0x3f')]=[{'all':!![]}];}_0x1e34f9=_[_0xa5b5('0x3c')]({},_0x1e34f9,_0x26e75d[_0xa5b5('0x3d')]);return db[_0xa5b5('0x29')]['find'](_0x1e34f9)[_0xa5b5('0x23')](handleEntityNotFound(_0xb05c3e,null))[_0xa5b5('0x23')](respondWithResult(_0xb05c3e,null))[_0xa5b5('0x42')](handleError(_0xb05c3e,null));};exports[_0xa5b5('0x44')]=function(_0x3ca697,_0x2ddfb4){return db[_0xa5b5('0x29')][_0xa5b5('0x44')](_0x3ca697['body'],{})[_0xa5b5('0x23')](respondWithResult(_0x2ddfb4,0xc9))[_0xa5b5('0x42')](handleError(_0x2ddfb4,null));};exports[_0xa5b5('0x22')]=function(_0x1c02f1,_0x4be4bc){if(_0x1c02f1[_0xa5b5('0x45')]['id']){delete _0x1c02f1[_0xa5b5('0x45')]['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x1c02f1[_0xa5b5('0x43')]['id']}})[_0xa5b5('0x23')](handleEntityNotFound(_0x4be4bc,null))[_0xa5b5('0x23')](saveUpdates(_0x1c02f1['body'],null))[_0xa5b5('0x23')](respondWithResult(_0x4be4bc,null))[_0xa5b5('0x42')](handleError(_0x4be4bc,null));};exports[_0xa5b5('0x24')]=function(_0x42ce8b,_0x3938a1){return db[_0xa5b5('0x29')][_0xa5b5('0x46')]({'where':{'id':_0x42ce8b[_0xa5b5('0x43')]['id']}})['then'](handleEntityNotFound(_0x3938a1,null))[_0xa5b5('0x23')](removeEntity(_0x3938a1,null))['catch'](handleError(_0x3938a1,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 30774b9..44d7d0d 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 _0xf29d=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x5e08be,_0x9bf344){var _0x4db79e=function(_0x3b8cc3){while(--_0x3b8cc3){_0x5e08be['push'](_0x5e08be['shift']());}};_0x4db79e(++_0x9bf344);}(_0xf29d,0x11b));var _0xdf29=function(_0x230799,_0x1f5cc9){_0x230799=_0x230799-0x0;var _0x5685ef=_0xf29d[_0x230799];return _0x5685ef;};'use strict';var _=require(_0xdf29('0x0'));var util=require(_0xdf29('0x1'));var logger=require(_0xdf29('0x2'))(_0xdf29('0x3'));var moment=require(_0xdf29('0x4'));var BPromise=require(_0xdf29('0x5'));var rp=require(_0xdf29('0x6'));var fs=require('fs');var path=require(_0xdf29('0x7'));var rimraf=require(_0xdf29('0x8'));var config=require(_0xdf29('0x9'));var attributes=require(_0xdf29('0xa'));module['exports']=function(_0x47f914,_0x44196b){return _0x47f914['define'](_0xdf29('0xb'),attributes,{'tableName':_0xdf29('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdf29('0xd'),'collate':_0xdf29('0xe')});}; \ No newline at end of file +var _0x5db8=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications'];(function(_0x3abff5,_0x3e737a){var _0x29eaae=function(_0x52bcc4){while(--_0x52bcc4){_0x3abff5['push'](_0x3abff5['shift']());}};_0x29eaae(++_0x3e737a);}(_0x5db8,0x8f));var _0x85db=function(_0x4fa738,_0x2a491c){_0x4fa738=_0x4fa738-0x0;var _0x55bf55=_0x5db8[_0x4fa738];return _0x55bf55;};'use strict';var _=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var logger=require(_0x85db('0x2'))(_0x85db('0x3'));var moment=require(_0x85db('0x4'));var BPromise=require(_0x85db('0x5'));var rp=require(_0x85db('0x6'));var fs=require('fs');var path=require(_0x85db('0x7'));var rimraf=require(_0x85db('0x8'));var config=require('../../config/environment');var attributes=require(_0x85db('0x9'));module['exports']=function(_0x3ed1e0,_0x5bbc70){return _0x3ed1e0[_0x85db('0xa')](_0x85db('0xb'),attributes,{'tableName':_0x85db('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 760b963..9c9025e 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 _0x5f2f=['error','code','message','request\x20sent','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','debug','stringify'];(function(_0x54f493,_0x385811){var _0x5f2b47=function(_0x2d2323){while(--_0x2d2323){_0x54f493['push'](_0x54f493['shift']());}};_0x5f2b47(++_0x385811);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4ace37,_0x4a3d1e){_0x4ace37=_0x4ace37-0x0;var _0x4f9370=_0x5f2f[_0x4ace37];return _0x4f9370;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20fccd['options']?_0x20fccd['options'][_0xf5f2('0x1d')]||null:null,'attributes':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd['options'][_0xf5f2('0x1e')]||null:null,'limit':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null})[_0xf5f2('0x20')](function(_0x4c691a){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x4c691a));_0x4ff59b(_0x4c691a);})['catch'](function(_0x529f07){logger[_0xf5f2('0x11')](_0xf5f2('0x17'),_0x529f07[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x529f07[_0xf5f2('0x13')]));});});}; \ 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(_0x602242,_0x3ecec6){var _0x37e751=function(_0x421285){while(--_0x421285){_0x602242['push'](_0x602242['shift']());}};_0x37e751(++_0x3ecec6);}(_0xb10b,0x12a));var _0xbb10=function(_0x3e36b6,_0x43de3b){_0x3e36b6=_0x3e36b6-0x0;var _0x4a3a36=_0xb10b[_0x3e36b6];return _0x4a3a36;};'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 d2b084f..a724725 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 _0x0a77=['../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','/:id','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','addTags','openchannel','update','openchannelinteraction:destroy','removeTags','multer','util','path','connect-timeout','../../components/interaction/service'];(function(_0x43d0a9,_0xdb99f4){var _0x43e212=function(_0x352413){while(--_0x352413){_0x43d0a9['push'](_0x43d0a9['shift']());}};_0x43e212(++_0xdb99f4);}(_0x0a77,0x1ef));var _0x70a7=function(_0x272806,_0x41fe53){_0x272806=_0x272806-0x0;var _0xb8c23a=_0x0a77[_0x272806];return _0xb8c23a;};'use strict';var multer=require(_0x70a7('0x0'));var util=require(_0x70a7('0x1'));var path=require(_0x70a7('0x2'));var timeout=require(_0x70a7('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x70a7('0x4'));var config=require(_0x70a7('0x5'));var controller=require(_0x70a7('0x6'));router[_0x70a7('0x7')]('/',auth[_0x70a7('0x8')](),controller[_0x70a7('0x9')]);router[_0x70a7('0x7')](_0x70a7('0xa'),auth[_0x70a7('0x8')](),controller['describe']);router['get'](_0x70a7('0xb'),auth[_0x70a7('0x8')](),controller['show']);router[_0x70a7('0x7')](_0x70a7('0xc'),auth['isAuthenticated'](),controller[_0x70a7('0xd')]);router[_0x70a7('0x7')](_0x70a7('0xe'),auth[_0x70a7('0x8')](),controller['download']);router[_0x70a7('0xf')]('/',auth[_0x70a7('0x8')](),controller['create']);router[_0x70a7('0xf')](_0x70a7('0xc'),auth['isAuthenticated'](),controller[_0x70a7('0x10')]);router[_0x70a7('0xf')](_0x70a7('0x11'),auth[_0x70a7('0x8')](),interaction[_0x70a7('0x12')]('openchannel',_0x70a7('0x13')),controller[_0x70a7('0x14')]);router['put'](_0x70a7('0xb'),auth[_0x70a7('0x8')](),interaction['tracked'](_0x70a7('0x15'),'openchannelinteraction:update'),controller[_0x70a7('0x16')]);router['delete'](_0x70a7('0xb'),auth['isAuthenticated'](),interaction[_0x70a7('0x12')](_0x70a7('0x15'),_0x70a7('0x17')),controller['destroy']);router['delete'](_0x70a7('0x11'),auth[_0x70a7('0x8')](),controller[_0x70a7('0x18')]);module['exports']=router; \ No newline at end of file +var _0xdd9b=['create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','post'];(function(_0x24f98b,_0x28f4a5){var _0x37be13=function(_0x2ac8c2){while(--_0x2ac8c2){_0x24f98b['push'](_0x24f98b['shift']());}};_0x37be13(++_0x28f4a5);}(_0xdd9b,0x86));var _0xbdd9=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xdd9b[_0x3ab9ee];return _0x82ee88;};'use strict';var multer=require(_0xbdd9('0x0'));var util=require(_0xbdd9('0x1'));var path=require('path');var timeout=require(_0xbdd9('0x2'));var express=require('express');var router=express[_0xbdd9('0x3')]();var auth=require(_0xbdd9('0x4'));var interaction=require(_0xbdd9('0x5'));var config=require('../../config/environment');var controller=require('./openchannelInteraction.controller');router[_0xbdd9('0x6')]('/',auth[_0xbdd9('0x7')](),controller[_0xbdd9('0x8')]);router['get'](_0xbdd9('0x9'),auth[_0xbdd9('0x7')](),controller[_0xbdd9('0xa')]);router['get'](_0xbdd9('0xb'),auth[_0xbdd9('0x7')](),controller[_0xbdd9('0xc')]);router[_0xbdd9('0x6')](_0xbdd9('0xd'),auth[_0xbdd9('0x7')](),controller[_0xbdd9('0xe')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xbdd9('0xf')]('/',auth['isAuthenticated'](),controller[_0xbdd9('0x10')]);router[_0xbdd9('0xf')](_0xbdd9('0xd'),auth['isAuthenticated'](),controller[_0xbdd9('0x11')]);router[_0xbdd9('0xf')](_0xbdd9('0x12'),auth['isAuthenticated'](),interaction[_0xbdd9('0x13')](_0xbdd9('0x14'),_0xbdd9('0x15')),controller[_0xbdd9('0x16')]);router['put'](_0xbdd9('0xb'),auth['isAuthenticated'](),interaction[_0xbdd9('0x13')](_0xbdd9('0x14'),_0xbdd9('0x17')),controller[_0xbdd9('0x18')]);router[_0xbdd9('0x19')](_0xbdd9('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0xbdd9('0x14'),_0xbdd9('0x1a')),controller[_0xbdd9('0x1b')]);router[_0xbdd9('0x19')](_0xbdd9('0x12'),auth[_0xbdd9('0x7')](),controller[_0xbdd9('0x1c')]);module[_0xbdd9('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index d10468c..f115c33 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 _0x2e24=['ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0x23000d,_0x4037aa){var _0xfef2b3=function(_0xd3c44b){while(--_0xd3c44b){_0x23000d['push'](_0x23000d['shift']());}};_0xfef2b3(++_0x4037aa);}(_0x2e24,0x18e));var _0x42e2=function(_0x231d89,_0x21fc6c){_0x231d89=_0x231d89-0x0;var _0x47b1fb=_0x2e24[_0x231d89];return _0x47b1fb;};'use strict';var Sequelize=require(_0x42e2('0x0'));module[_0x42e2('0x1')]={'closed':{'type':Sequelize[_0x42e2('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x42e2('0x3')]},'note':{'type':Sequelize[_0x42e2('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x42e2('0x3')]},'externalUrl':{'type':Sequelize[_0x42e2('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x42e2('0x4')]('in',_0x42e2('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x42e2('0x3')]}}; \ No newline at end of file +var _0xd041=['DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x4fdb66,_0x10362f){var _0x4a3b79=function(_0x48624d){while(--_0x48624d){_0x4fdb66['push'](_0x4fdb66['shift']());}};_0x4a3b79(++_0x10362f);}(_0xd041,0x90));var _0x1d04=function(_0x40fb1a,_0xc40248){_0x40fb1a=_0x40fb1a-0x0;var _0x5a7770=_0xd041[_0x40fb1a];return _0x5a7770;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x1d04('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1d04('0x1')]},'disposition':{'type':Sequelize[_0x1d04('0x2')]},'note':{'type':Sequelize[_0x1d04('0x2')]},'read1stAt':{'type':Sequelize[_0x1d04('0x1')]},'threadId':{'type':Sequelize[_0x1d04('0x2')]},'externalUrl':{'type':Sequelize[_0x1d04('0x2')]},'lastMsgAt':{'type':Sequelize[_0x1d04('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x1d04('0x3')]('in',_0x1d04('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 28a36cd..6f14dca 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 _0xfa94=['threadId','Public','Private','basename','existsSync','createReadStream','createWriteStream','out','System','renderFile','views','downloadInteraction.html','transcript-','download','err','unlinkSync','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','Users','map','TagIds','Tags','split','forEach','catch','rawAttributes','model','keys','query','filters','intersection','attributes','fields','order','sort','where','select','field','color','from','tools_tags','COUNT(*)','me.OpenchannelInteractionId\x20=\x20i.id','me.read\x20=\x20false','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','me.OpenchannelInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','createdAt','dateStart','startOf','utc','format','endOf','day','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','value','TagId','isArray','length','and','tableAlias','\x20IN\x20?','\x20=\x20?','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','LIKE','c.firstName','hasOwnProperty','filter','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20IS\x20NULL','isNumeric','i.id\x20LIKE\x20?','push','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','i.id','Sequelize','clone','COUNT(me.id)','unreadMessages','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','count','keyBy','merge','OpenchannelInteraction','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','rows','show','params','includeAll','include','options','create','body','find','describe','OpenchannelMessage','addMessage','ids','findOne','nolimit','findAll','addTags','setTags','omit','Tag','emit','openchannelInteractionTags:save','removeTags','root','server','tmp','direction','secret','User','fullname','CmContact','Contact','firstName','lastName','Attachment','OpenchannelAccount','Account','Owner','get','10px','40px','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','mkdirSync','YYYY-MM-DD\x20HH:mm:ss','disposition'];(function(_0x57e249,_0x395466){var _0x488bf1=function(_0x2f619e){while(--_0x2f619e){_0x57e249['push'](_0x57e249['shift']());}};_0x488bf1(++_0x395466);}(_0xfa94,0xef));var _0x4fa9=function(_0x5bd98b,_0x22bf1c){_0x5bd98b=_0x5bd98b-0x0;var _0x49efe7=_0xfa94[_0x5bd98b];return _0x49efe7;};'use strict';var pdf=require(_0x4fa9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4fa9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4fa9('0x2'));var rp=require(_0x4fa9('0x3'));var moment=require('moment');var BPromise=require(_0x4fa9('0x4'));var Mustache=require(_0x4fa9('0x5'));var util=require(_0x4fa9('0x6'));var path=require(_0x4fa9('0x7'));var sox=require(_0x4fa9('0x8'));var csv=require(_0x4fa9('0x9'));var ejs=require(_0x4fa9('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4fa9('0xb'));var crypto=require(_0x4fa9('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4fa9('0x9'));var querystring=require('querystring');var Papa=require(_0x4fa9('0xd'));var Redis=require(_0x4fa9('0xe'));var authService=require(_0x4fa9('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4fa9('0x10'));var logger=require('../../config/logger')(_0x4fa9('0x11'));var utils=require(_0x4fa9('0x12'));var config=require('../../config/environment');var db=require(_0x4fa9('0x13'))['db'];config[_0x4fa9('0x14')]=_[_0x4fa9('0x15')](config['redis'],{'host':_0x4fa9('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4fa9('0x14')]));require(_0x4fa9('0x17'))['register'](socket);function respondWithStatusCode(_0x47953e,_0x4279c0){_0x4279c0=_0x4279c0||0xcc;return function(_0x43b71d){if(_0x43b71d){return _0x47953e[_0x4fa9('0x18')](_0x4279c0);}return _0x47953e[_0x4fa9('0x19')](_0x4279c0)[_0x4fa9('0x1a')]();};}function respondWithResult(_0x438850,_0x2c28be){_0x2c28be=_0x2c28be||0xc8;return function(_0x328770){if(_0x328770){return _0x438850['status'](_0x2c28be)[_0x4fa9('0x1b')](_0x328770);}};}function respondWithFilteredResult(_0x1a1117,_0x4c164f){return function(_0x56cf7d){if(_0x56cf7d){var _0x2b93a2=_0x56cf7d['count'],_0x4f58bd=_0x4c164f[_0x4fa9('0x1c')],_0x2fe920=_0x4c164f['offset']+_0x4c164f[_0x4fa9('0x1d')],_0x416e08;if(_0x2fe920>=_0x2b93a2){_0x2fe920=_0x2b93a2;_0x416e08=0xc8;}else{_0x416e08=0xce;}_0x1a1117[_0x4fa9('0x19')](_0x416e08);return _0x1a1117[_0x4fa9('0x1e')](_0x4fa9('0x1f'),_0x4f58bd+'-'+_0x2fe920+'/'+_0x2b93a2)[_0x4fa9('0x1b')](_0x56cf7d);}return null;};}function patchUpdates(_0x5e2576){return function(_0x2e5142){try{jsonpatch[_0x4fa9('0x20')](_0x2e5142,_0x5e2576,!![]);}catch(_0xa43250){return BPromise['reject'](_0xa43250);}return _0x2e5142[_0x4fa9('0x21')]();};}function saveUpdates(_0x1544b1,_0x31333c){return function(_0x475624){if(_0x475624){return _0x475624[_0x4fa9('0x22')](_0x1544b1)[_0x4fa9('0x23')](function(_0x360262){return _0x360262;});}return null;};}function removeEntity(_0x261db9,_0x185806){return function(_0x1189c6){if(_0x1189c6){return _0x1189c6[_0x4fa9('0x24')]()[_0x4fa9('0x23')](function(){_0x261db9[_0x4fa9('0x19')](0xcc)[_0x4fa9('0x1a')]();});}};}function handleEntityNotFound(_0x1d00c9,_0x244c95){return function(_0x1bac66){if(!_0x1bac66){_0x1d00c9[_0x4fa9('0x18')](0x194);}return _0x1bac66;};}function handleError(_0x1fe8ba,_0x31a3fb){_0x31a3fb=_0x31a3fb||0x1f4;return function(_0x498a6f){logger[_0x4fa9('0x25')](_0x498a6f[_0x4fa9('0x26')]);if(_0x498a6f[_0x4fa9('0x27')]){delete _0x498a6f[_0x4fa9('0x27')];}_0x1fe8ba[_0x4fa9('0x19')](_0x31a3fb)[_0x4fa9('0x28')](_0x498a6f);};}function getInteractionUsers(_0x31ada4,_0x5545b9){return new BPromise(function(_0x384d4e,_0x1185df){try{if(_0x5545b9[_0x31ada4['id']]){_0x31ada4[_0x4fa9('0x29')]=_[_0x4fa9('0x2a')](_0x5545b9[_0x31ada4['id']],function(_0x112673){return{'id':_0x112673['id']};});}}catch(_0xb9fed8){_0x1185df(_0xb9fed8);}_0x384d4e(_0x31ada4);});}function getInteractionTags(_0x3c8d57,_0x2f7d40){return new BPromise(function(_0xa9932f,_0x472173){try{if(_0x3c8d57[_0x4fa9('0x2b')]){_0x3c8d57[_0x4fa9('0x2c')]=[];_0x3c8d57[_0x4fa9('0x2b')][_0x4fa9('0x2d')](',')[_0x4fa9('0x2e')](function(_0x1fa94e){_0x3c8d57[_0x4fa9('0x2c')]['push'](_0x2f7d40[_0x1fa94e]);});}delete _0x3c8d57[_0x4fa9('0x2b')];}catch(_0x12cb4b){_0x472173(_0x12cb4b);}_0xa9932f(_0x3c8d57);});}function updateOpenchannelInteraction(_0x224297,_0x96945,_0x4163f4){return new BPromise(function(_0x357bd3,_0x5389ff){return getInteractionUsers(_0x224297,_0x4163f4)[_0x4fa9('0x23')](function(_0x2fe7d3){return getInteractionTags(_0x2fe7d3,_0x96945);})[_0x4fa9('0x23')](function(_0x515ba3){_0x357bd3(_0x515ba3);})[_0x4fa9('0x2f')](function(_0x4c14fd){_0x5389ff(_0x4c14fd);});});}exports['index']=function(_0xa8e93e,_0x591844){var _0x3d5739={},_0x2b80de={},_0x2e9e10={'count':0x0,'rows':[]};var _0x58c70c=db['OpenchannelInteraction'][_0x4fa9('0x30')];_0x2b80de[_0x4fa9('0x31')]=_[_0x4fa9('0x32')](_0x58c70c);_0x2b80de['query']=_[_0x4fa9('0x32')](_0xa8e93e[_0x4fa9('0x33')]);_0x2b80de[_0x4fa9('0x34')]=_[_0x4fa9('0x35')](_0x2b80de[_0x4fa9('0x31')],_0x2b80de[_0x4fa9('0x33')]);_0x3d5739[_0x4fa9('0x36')]=_[_0x4fa9('0x35')](_0x2b80de[_0x4fa9('0x31')],qs[_0x4fa9('0x37')](_0xa8e93e[_0x4fa9('0x33')][_0x4fa9('0x37')]));_0x3d5739['attributes']=_0x3d5739[_0x4fa9('0x36')]['length']?_0x3d5739['attributes']:_0x2b80de[_0x4fa9('0x31')];if(!_0xa8e93e['query']['hasOwnProperty']('nolimit')){_0x3d5739[_0x4fa9('0x1d')]=qs[_0x4fa9('0x1d')](_0xa8e93e['query'][_0x4fa9('0x1d')]);_0x3d5739['offset']=qs['offset'](_0xa8e93e[_0x4fa9('0x33')][_0x4fa9('0x1c')]);}_0x3d5739[_0x4fa9('0x38')]=qs[_0x4fa9('0x39')](_0xa8e93e[_0x4fa9('0x33')][_0x4fa9('0x39')]);_0x3d5739[_0x4fa9('0x3a')]=qs['filters'](_['pick'](_0xa8e93e[_0x4fa9('0x33')],_0x2b80de['filters']));var _0x3e4458=[];var _0x19fe0f=squel[_0x4fa9('0x3b')]()[_0x4fa9('0x3c')]('id')['field'](_0x4fa9('0x27'))['field'](_0x4fa9('0x3d'))[_0x4fa9('0x3e')](_0x4fa9('0x3f'));var _0x3738a1=squel[_0x4fa9('0x3b')]()[_0x4fa9('0x3c')](_0x4fa9('0x40'))[_0x4fa9('0x3e')]('openchannel_messages','me')[_0x4fa9('0x3a')](_0x4fa9('0x41'))[_0x4fa9('0x3a')]('me.direction\x20=\x20\x27in\x27')[_0x4fa9('0x3a')](_0x4fa9('0x42'));var _0x1627ee=squel[_0x4fa9('0x3b')]()[_0x4fa9('0x3c')](_0x4fa9('0x43'))[_0x4fa9('0x3c')](_0x4fa9('0x44'))[_0x4fa9('0x3e')](_0x4fa9('0x45'),'ui')[_0x4fa9('0x46')](_0x4fa9('0x47'),'u','u.id\x20=\x20ui.UserId');var _0x7addd3=squel[_0x4fa9('0x3b')]()[_0x4fa9('0x3e')](_0x4fa9('0x48'),'i')[_0x4fa9('0x46')](_0x4fa9('0x49'),'c',_0x4fa9('0x4a'))[_0x4fa9('0x46')](_0x4fa9('0x47'),'o',_0x4fa9('0x4b'))[_0x4fa9('0x46')]('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')[_0x4fa9('0x46')]('openchannel_messages','me',_0x4fa9('0x4c'));var _0xbb7424=squel[_0x4fa9('0x4d')]();if(_0xa8e93e[_0x4fa9('0x33')][_0x4fa9('0x4e')]){var _0x28574a=JSON['parse'](_0xa8e93e['query']['advancedFilter']);_[_0x4fa9('0x32')](_0x28574a)['forEach'](function(_0x38c8a0){var _0x374c4b=_0x28574a[_0x38c8a0];if(_0x38c8a0===_0x4fa9('0x4f')){var _0x12a746=moment(_0x374c4b['value'][_0x4fa9('0x50')])[_0x4fa9('0x51')]('day')[_0x4fa9('0x52')]()[_0x4fa9('0x53')]();var _0xbda79=moment(_0xbda79)[_0x4fa9('0x52')]()[_0x4fa9('0x54')](_0x4fa9('0x55'))['format']();_0xbb7424['and'](_0x4fa9('0x56'),_0x12a746,_0xbda79);}else{if(_['isArray'](_0x374c4b[_0x4fa9('0x57')])){_0x374c4b[_0x4fa9('0x57')][_0x4fa9('0x2e')](function(_0x129162){switch(_0x374c4b[_0x4fa9('0x57')][_0x4fa9('0x58')]){case'IS':if(_0x38c8a0!==_0x4fa9('0x59')&&_0x38c8a0!=='unreadMessages'){if(_[_0x4fa9('0x5a')](_0x374c4b['value'])&&_0x374c4b[_0x4fa9('0x58')][_0x4fa9('0x5b')]>0x1){_0xbb7424[_0x4fa9('0x5c')](_0x374c4b[_0x4fa9('0x5d')]+'.'+_0x38c8a0+_0x4fa9('0x5e'),_0x374c4b[_0x4fa9('0x58')]);}else{_0xbb7424['and'](_0x374c4b['tableAlias']+'.'+_0x38c8a0+'\x20=\x20?',_0x374c4b[_0x4fa9('0x58')][0x0]);}}break;case'=':_0xbb7424['and'](_0x374c4b[_0x4fa9('0x5d')]+'.'+_0x38c8a0+_0x4fa9('0x5f'),_0x374c4b[_0x4fa9('0x58')]);break;case'LIKE':if(_0x38c8a0==='ContactId'){_0xbb7424['and']('c.firstName'+_0x4fa9('0x60'),'%'+_0x374c4b['value']+'%');_0xbb7424['or'](_0x4fa9('0x61')+'\x20LIKE\x20?','%'+_0x374c4b[_0x4fa9('0x58')]+'%');_0xbb7424['or'](_0x4fa9('0x62')+_0x4fa9('0x60'),'%'+_0x374c4b[_0x4fa9('0x58')]+'%');}else{_0xbb7424[_0x4fa9('0x5c')](_0x374c4b[_0x4fa9('0x5d')]+'.'+_0x38c8a0+_0x4fa9('0x60'),'%'+_0x374c4b[_0x4fa9('0x58')]+'%');}break;case'>':_0xbb7424[_0x4fa9('0x5c')](_0x374c4b[_0x4fa9('0x5d')]+'.'+_0x38c8a0+_0x4fa9('0x63'),_0x374c4b[_0x4fa9('0x58')]);break;case'<':_0xbb7424['and'](_0x374c4b[_0x4fa9('0x5d')]+'.'+_0x38c8a0+_0x4fa9('0x64'),_0x374c4b[_0x4fa9('0x58')]);break;}});}else{switch(_0x374c4b[_0x4fa9('0x57')][_0x4fa9('0x58')]){case'IS':if(_0x38c8a0!=='TagId'&&_0x38c8a0!=='unreadMessages'){if(_[_0x4fa9('0x5a')](_0x374c4b[_0x4fa9('0x58')])&&_0x374c4b[_0x4fa9('0x58')][_0x4fa9('0x5b')]>0x1){_0xbb7424[_0x4fa9('0x5c')](_0x374c4b[_0x4fa9('0x5d')]+'.'+_0x38c8a0+'\x20IN\x20?',_0x374c4b[_0x4fa9('0x58')]);}else{_0xbb7424[_0x4fa9('0x5c')](_0x374c4b[_0x4fa9('0x5d')]+'.'+_0x38c8a0+_0x4fa9('0x5f'),_0x374c4b[_0x4fa9('0x58')][0x0]);}}break;case'=':_0xbb7424['and'](_0x374c4b[_0x4fa9('0x5d')]+'.'+_0x38c8a0+_0x4fa9('0x5f'),_0x374c4b[_0x4fa9('0x58')]);break;case _0x4fa9('0x65'):if(_0x38c8a0==='ContactId'){_0xbb7424[_0x4fa9('0x5c')](_0x4fa9('0x66')+_0x4fa9('0x60'),'%'+_0x374c4b[_0x4fa9('0x58')]+'%');_0xbb7424['or'](_0x4fa9('0x61')+_0x4fa9('0x60'),'%'+_0x374c4b['value']+'%');_0xbb7424['or'](_0x4fa9('0x62')+'\x20LIKE\x20?','%'+_0x374c4b[_0x4fa9('0x58')]+'%');}else{_0xbb7424[_0x4fa9('0x5c')](_0x374c4b[_0x4fa9('0x5d')]+'.'+_0x38c8a0+_0x4fa9('0x60'),'%'+_0x374c4b['value']+'%');}break;case'>':_0xbb7424[_0x4fa9('0x5c')](_0x374c4b[_0x4fa9('0x5d')]+'.'+_0x38c8a0+_0x4fa9('0x63'),_0x374c4b[_0x4fa9('0x58')]);break;case'<':_0xbb7424['and'](_0x374c4b[_0x4fa9('0x5d')]+'.'+_0x38c8a0+'\x20<\x20?',_0x374c4b[_0x4fa9('0x58')]);break;}}}});}else{var _0x58ea8d=_(Object[_0x4fa9('0x32')](_0xa8e93e[_0x4fa9('0x33')]))[_0x4fa9('0x2a')](function(_0x121d50){return _0x58c70c[_0x4fa9('0x67')](_0x121d50)?_0x121d50:undefined;})[_0x4fa9('0x68')](function(_0xb2673f){return!_['isNil'](_0xb2673f);})[_0x4fa9('0x58')]();if(!_['isEmpty'](_0x58ea8d)){_0x58ea8d[_0x4fa9('0x2e')](function(_0x555fb3){if(_0x555fb3===_0x4fa9('0x69')){_0x7addd3[_0x4fa9('0x3a')](_0x4fa9('0x6a'),[][_0x4fa9('0x6b')](_0xa8e93e[_0x4fa9('0x33')][_0x555fb3]));}else if(_0x555fb3===_0x4fa9('0x4f')){var _0x18ea4b=JSON[_0x4fa9('0x6c')](_0xa8e93e[_0x4fa9('0x33')][_0x555fb3])[_0x4fa9('0x6d')];var _0x171f03=JSON[_0x4fa9('0x6c')](_0xa8e93e[_0x4fa9('0x33')][_0x555fb3])[_0x4fa9('0x6e')];_0x7addd3[_0x4fa9('0x3a')](_0x4fa9('0x56'),_0x18ea4b,_0x171f03);}else{if(_0xa8e93e[_0x4fa9('0x33')][_0x555fb3]===_0x4fa9('0x6f')){_0x7addd3[_0x4fa9('0x3a')]('i.'+_0x555fb3+_0x4fa9('0x70'));}else{_0x7addd3[_0x4fa9('0x3a')]('i.'+_0x555fb3+_0x4fa9('0x5f'),_0xa8e93e[_0x4fa9('0x33')][_0x555fb3]);}}});}if(_0xa8e93e[_0x4fa9('0x33')][_0x4fa9('0x68')]){var _0x59cb39=_0xa8e93e['query']['filter']['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs[_0x4fa9('0x71')](_0x59cb39)){_0xbb7424['or'](_0x4fa9('0x72'),_0x59cb39+'%');}else{var _0x40d02b=[];_0x59cb39[_0x4fa9('0x2d')]('\x20')['forEach'](function(_0x19874e){_0x40d02b[_0x4fa9('0x73')]('+'+_0x19874e[_0x4fa9('0x74')]());});var _0x4a13c9=_0x40d02b[_0x4fa9('0x75')]('\x20');_0xbb7424['or'](_0x4fa9('0x76'),_0x4a13c9)['or'](_0x4fa9('0x77'),_0x59cb39+'%')['or'](_0x4fa9('0x78'),_0x59cb39+'%');}}}_0x7addd3[_0x4fa9('0x3a')](_0xbb7424);if(_0x3d5739[_0x4fa9('0x38')]){_0x3d5739['order'][_0x4fa9('0x2e')](function(_0x5481b0){_0x7addd3[_0x4fa9('0x38')]('i.'+_0x5481b0[0x0],_0x5481b0[0x1]===_0x4fa9('0x79')?![]:!![]);});}_0x7addd3['group'](_0x4fa9('0x7a'));var _0xdc8971={'type':db[_0x4fa9('0x7b')]['QueryTypes']['SELECT'],'raw':!![]};var _0xf1aee8=_0x7addd3[_0x4fa9('0x7c')]()[_0x4fa9('0x3c')](_0x4fa9('0x40'))['field'](_0x4fa9('0x7d'),_0x4fa9('0x7e'));if(!_0xa8e93e[_0x4fa9('0x33')]['advancedFilter']){if(_0xa8e93e[_0x4fa9('0x33')][_0x4fa9('0x7f')]){if(_0xa8e93e[_0x4fa9('0x33')]['read']==0x1){_0xf1aee8[_0x4fa9('0x80')]('`unreadMessages`\x20=\x200');_0x7addd3[_0x4fa9('0x80')](_0x4fa9('0x81'));}else{_0xf1aee8[_0x4fa9('0x80')](_0x4fa9('0x82'));_0x7addd3[_0x4fa9('0x80')]('`unreadMessages`\x20>\x200');}}if(_0xa8e93e['query'][_0x4fa9('0x83')]){var _0x3cae67=_[_0x4fa9('0x5a')](_0xa8e93e[_0x4fa9('0x33')][_0x4fa9('0x83')])?_0xa8e93e['query']['tag']:new Array(_0xa8e93e[_0x4fa9('0x33')][_0x4fa9('0x83')]);var _0x257068=squel[_0x4fa9('0x4d')]();_0x3cae67[_0x4fa9('0x2e')](function(_0x3d7c28){_0x257068['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3d7c28+',%');});_0x7addd3[_0x4fa9('0x80')](_0x257068);_0xf1aee8[_0x4fa9('0x46')](_0x4fa9('0x84'),'it',_0x4fa9('0x85'));_0xf1aee8[_0x4fa9('0x46')](_0x4fa9('0x3f'),'t',_0x4fa9('0x86'));_0xf1aee8[_0x4fa9('0x3a')](_0x4fa9('0x87'),_0x3cae67);}}else{var _0x28574a=JSON[_0x4fa9('0x6c')](_0xa8e93e[_0x4fa9('0x33')][_0x4fa9('0x4e')]);_[_0x4fa9('0x32')](_0x28574a)[_0x4fa9('0x2e')](function(_0x46684a){var _0x477993=_0x28574a[_0x46684a];if(_0x46684a===_0x4fa9('0x59')){var _0x517461=_0x477993['value'];var _0x328b90=squel[_0x4fa9('0x4d')]();_0x517461[_0x4fa9('0x2e')](function(_0x3b4565){_0x328b90['or'](_0x4fa9('0x88'),'%,'+_0x3b4565+',%');});_0x7addd3[_0x4fa9('0x80')](_0x328b90);_0xf1aee8[_0x4fa9('0x46')](_0x4fa9('0x89'),'it',_0x4fa9('0x8a'));_0xf1aee8[_0x4fa9('0x46')](_0x4fa9('0x3f'),'t',_0x4fa9('0x86'));_0xf1aee8[_0x4fa9('0x3a')](_0x4fa9('0x87'),_0x517461);}else if(_0x46684a==='unreadMessages'){if(_0x477993[_0x4fa9('0x58')][_0x4fa9('0x5b')]===0x1){if(_0x477993[_0x4fa9('0x58')][0x0]===0x1){_0xf1aee8[_0x4fa9('0x80')]('`unreadMessages`\x20=\x200');_0x7addd3[_0x4fa9('0x80')](_0x4fa9('0x81'));}else{_0xf1aee8[_0x4fa9('0x80')](_0x4fa9('0x82'));_0x7addd3[_0x4fa9('0x80')](_0x4fa9('0x82'));}}}});}db[_0x4fa9('0x8b')][_0x4fa9('0x33')](_0xf1aee8['toString'](),_0xdc8971)[_0x4fa9('0x23')](function(_0x4b0f54){_0x2e9e10[_0x4fa9('0x8c')]=_0x4b0f54[_0x4fa9('0x5b')];if(_0x2e9e10[_0x4fa9('0x8c')]===0x0)return[];return db[_0x4fa9('0x8b')][_0x4fa9('0x33')](_0x19fe0f[_0x4fa9('0x74')](),_0xdc8971)['then'](function(_0x4e1fdc){_0x3e4458=_[_0x4fa9('0x8d')](_0x4e1fdc,'id');_0xdc8971=_[_0x4fa9('0x8e')](_0xdc8971,{'model':db[_0x4fa9('0x8f')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x7addd3[_0x4fa9('0x3c')]('COUNT(me.id)',_0x4fa9('0x7e'));_0x7addd3[_0x4fa9('0x3c')](_0x4fa9('0x90'),'Account.key');_0x7addd3[_0x4fa9('0x3c')](_0x4fa9('0x91'),_0x4fa9('0x92'));_0x7addd3[_0x4fa9('0x3c')]('i.*');_0x7addd3[_0x4fa9('0x3c')]('c.firstName','Contact.firstName');_0x7addd3[_0x4fa9('0x3c')](_0x4fa9('0x61'),_0x4fa9('0x93'));_0x7addd3['field'](_0x4fa9('0x62'),_0x4fa9('0x94'));_0x7addd3[_0x4fa9('0x3c')](_0x4fa9('0x95'),_0x4fa9('0x96'));_0x7addd3[_0x4fa9('0x3c')](_0x4fa9('0x97'),_0x4fa9('0x98'));_0x7addd3['field'](_0x4fa9('0x99'),_0x4fa9('0x9a'));_0x7addd3[_0x4fa9('0x3c')](_0x4fa9('0x9b'),'TagIds');_0x7addd3[_0x4fa9('0x46')]('openchannel_interaction_has_tags','it',_0x4fa9('0x85'));_0x7addd3[_0x4fa9('0x46')]('tools_tags','t',_0x4fa9('0x86'));_0x7addd3[_0x4fa9('0x1d')](_0x3d5739[_0x4fa9('0x1d')]);_0x7addd3['offset'](_0x3d5739[_0x4fa9('0x1c')]);return db['sequelize']['query'](_0x7addd3[_0x4fa9('0x74')](),_0xdc8971);})['then'](function(_0x309a46){_0x1627ee[_0x4fa9('0x3a')](_0x4fa9('0x9c'),_[_0x4fa9('0x2a')](_0x309a46,'id'));return db[_0x4fa9('0x8b')][_0x4fa9('0x33')](_0x1627ee[_0x4fa9('0x74')](),_0xdc8971)[_0x4fa9('0x23')](function(_0x24f9e8){var _0x66e5cb=_[_0x4fa9('0x9d')](_0x24f9e8,_0x4fa9('0x9e'));var _0x3b602e=[];_0x309a46[_0x4fa9('0x2e')](function(_0x2ecf1d){_0x3b602e[_0x4fa9('0x73')](updateOpenchannelInteraction(_0x2ecf1d,_0x3e4458,_0x66e5cb));});return BPromise['all'](_0x3b602e);});});})['then'](function(_0x43051b){_0x2e9e10[_0x4fa9('0x9f')]=_0x43051b;return _0x2e9e10;})[_0x4fa9('0x23')](respondWithFilteredResult(_0x591844,_0x3d5739))[_0x4fa9('0x2f')](handleError(_0x591844,null));};exports[_0x4fa9('0xa0')]=function(_0x381710,_0x1b5c0b){var _0x973ffe={'raw':![],'where':{'id':_0x381710[_0x4fa9('0xa1')]['id']}},_0x2e96b4={};_0x2e96b4[_0x4fa9('0x31')]=_[_0x4fa9('0x32')](db['OpenchannelInteraction']['rawAttributes']);_0x2e96b4[_0x4fa9('0x33')]=_[_0x4fa9('0x32')](_0x381710[_0x4fa9('0x33')]);_0x2e96b4[_0x4fa9('0x34')]=_[_0x4fa9('0x35')](_0x2e96b4[_0x4fa9('0x31')],_0x2e96b4['query']);_0x973ffe[_0x4fa9('0x36')]=_['intersection'](_0x2e96b4[_0x4fa9('0x31')],qs[_0x4fa9('0x37')](_0x381710[_0x4fa9('0x33')]['fields']));_0x973ffe[_0x4fa9('0x36')]=_0x973ffe['attributes'][_0x4fa9('0x5b')]?_0x973ffe[_0x4fa9('0x36')]:_0x2e96b4[_0x4fa9('0x31')];if(_0x381710[_0x4fa9('0x33')][_0x4fa9('0xa2')]){_0x973ffe[_0x4fa9('0xa3')]=[{'all':!![]}];}_0x973ffe=_[_0x4fa9('0x8e')]({},_0x973ffe,_0x381710[_0x4fa9('0xa4')]);return db[_0x4fa9('0x8f')]['find'](_0x973ffe)[_0x4fa9('0x23')](handleEntityNotFound(_0x1b5c0b,null))[_0x4fa9('0x23')](respondWithResult(_0x1b5c0b,null))['catch'](handleError(_0x1b5c0b,null));};exports[_0x4fa9('0xa5')]=function(_0x78b666,_0x1b2af9){return db['OpenchannelInteraction'][_0x4fa9('0xa5')](_0x78b666[_0x4fa9('0xa6')],{})[_0x4fa9('0x23')](respondWithResult(_0x1b2af9,0xc9))['catch'](handleError(_0x1b2af9,null));};exports[_0x4fa9('0x22')]=function(_0x26187b,_0x324ae8){if(_0x26187b[_0x4fa9('0xa6')]['id']){delete _0x26187b['body']['id'];}return db[_0x4fa9('0x8f')][_0x4fa9('0xa7')]({'where':{'id':_0x26187b[_0x4fa9('0xa1')]['id']}})[_0x4fa9('0x23')](handleEntityNotFound(_0x324ae8,null))[_0x4fa9('0x23')](saveUpdates(_0x26187b[_0x4fa9('0xa6')],null))[_0x4fa9('0x23')](respondWithResult(_0x324ae8,null))[_0x4fa9('0x2f')](handleError(_0x324ae8,null));};exports[_0x4fa9('0x24')]=function(_0x21794f,_0x467ff9){return db['OpenchannelInteraction'][_0x4fa9('0xa7')]({'where':{'id':_0x21794f['params']['id']}})[_0x4fa9('0x23')](handleEntityNotFound(_0x467ff9,null))[_0x4fa9('0x23')](removeEntity(_0x467ff9,null))['catch'](handleError(_0x467ff9,null));};exports[_0x4fa9('0xa8')]=function(_0x1f88f6,_0x1a87ba){return db['OpenchannelInteraction'][_0x4fa9('0xa8')]()[_0x4fa9('0x23')](respondWithResult(_0x1a87ba,null))['catch'](handleError(_0x1a87ba,null));};exports['addMessage']=function(_0x4352d8,_0x1ac109,_0x3b4890){return db[_0x4fa9('0xa9')][_0x4fa9('0xa7')]({'where':{'id':_0x4352d8[_0x4fa9('0xa1')]['id']}})['then'](handleEntityNotFound(_0x1ac109,null))[_0x4fa9('0x23')](function(_0x229a9b){if(_0x229a9b){return _0x229a9b[_0x4fa9('0xaa')](_0x4352d8[_0x4fa9('0xa6')]['ids'],_['omit'](_0x4352d8[_0x4fa9('0xa6')],[_0x4fa9('0xab'),'id'])||{});}})[_0x4fa9('0x23')](respondWithResult(_0x1ac109,null))['catch'](handleError(_0x1ac109,null));};exports['getMessages']=function(_0x28cc43,_0x237be8,_0x4cffca){var _0x4eade2={'raw':![],'where':{}};var _0x47b0b5={};var _0x563eba={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x4fa9('0xac')]({'where':{'id':_0x28cc43[_0x4fa9('0xa1')]['id']}})[_0x4fa9('0x23')](handleEntityNotFound(_0x237be8,null))['then'](function(_0x53ae14){if(_0x53ae14){_0x47b0b5['model']=_[_0x4fa9('0x32')](db[_0x4fa9('0xa9')][_0x4fa9('0x30')]);_0x47b0b5['query']=_[_0x4fa9('0x32')](_0x28cc43[_0x4fa9('0x33')]);_0x47b0b5[_0x4fa9('0x34')]=_[_0x4fa9('0x35')](_0x47b0b5[_0x4fa9('0x31')],_0x47b0b5[_0x4fa9('0x33')]);_0x4eade2[_0x4fa9('0x36')]=_[_0x4fa9('0x35')](_0x47b0b5[_0x4fa9('0x31')],qs['fields'](_0x28cc43[_0x4fa9('0x33')][_0x4fa9('0x37')]));_0x4eade2['attributes']=_0x4eade2[_0x4fa9('0x36')][_0x4fa9('0x5b')]?_0x4eade2[_0x4fa9('0x36')]:_0x47b0b5[_0x4fa9('0x31')];if(!_0x28cc43[_0x4fa9('0x33')]['hasOwnProperty'](_0x4fa9('0xad'))){_0x4eade2[_0x4fa9('0x1d')]=qs[_0x4fa9('0x1d')](_0x28cc43[_0x4fa9('0x33')][_0x4fa9('0x1d')]);_0x4eade2[_0x4fa9('0x1c')]=qs[_0x4fa9('0x1c')](_0x28cc43[_0x4fa9('0x33')][_0x4fa9('0x1c')]);}_0x4eade2[_0x4fa9('0x38')]=qs[_0x4fa9('0x39')](_0x28cc43['query'][_0x4fa9('0x39')]);_0x4eade2[_0x4fa9('0x3a')]=qs[_0x4fa9('0x34')](_['pick'](_0x28cc43[_0x4fa9('0x33')],_0x47b0b5[_0x4fa9('0x34')]));_0x4eade2[_0x4fa9('0x3a')][_0x4fa9('0x9e')]=_0x53ae14['id'];if(_0x28cc43[_0x4fa9('0x33')]['filter']){_0x4eade2['where']=_[_0x4fa9('0x8e')](_0x4eade2[_0x4fa9('0x3a')],{'$or':_[_0x4fa9('0x2a')](_0x4eade2['attributes'],function(_0x182b26){var _0x370d88={};_0x370d88[_0x182b26]={'$like':'%'+_0x28cc43['query']['filter']+'%'};return _0x370d88;})});}if(_0x28cc43['query'][_0x4fa9('0x6d')]){var _0x273af6=_0x28cc43['query'][_0x4fa9('0x6d')][_0x4fa9('0x2d')](',');var _0x26d0fc={};_0x26d0fc[_0x273af6[0x0]]={'$gte':moment(_0x273af6[0x1])[_0x4fa9('0x53')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4eade2[_0x4fa9('0x3a')]=_[_0x4fa9('0x8e')](_0x4eade2[_0x4fa9('0x3a')],_0x26d0fc);}_0x4eade2=_[_0x4fa9('0x8e')]({},_0x4eade2,_0x28cc43[_0x4fa9('0xa4')]);return db[_0x4fa9('0xa9')][_0x4fa9('0x8c')]({'where':_0x4eade2[_0x4fa9('0x3a')]})[_0x4fa9('0x23')](function(_0x43a536){_0x563eba[_0x4fa9('0x8c')]=_0x43a536;if(_0x28cc43[_0x4fa9('0x33')][_0x4fa9('0xa2')]){_0x4eade2[_0x4fa9('0xa3')]=[{'all':!![]}];}return db[_0x4fa9('0xa9')][_0x4fa9('0xae')](_0x4eade2);})[_0x4fa9('0x23')](function(_0x4b56dc){_0x563eba[_0x4fa9('0x9f')]=_0x4b56dc;return _0x563eba;});}})[_0x4fa9('0x23')](respondWithFilteredResult(_0x237be8,_0x4eade2))[_0x4fa9('0x2f')](handleError(_0x237be8,null));};exports[_0x4fa9('0xaf')]=function(_0x21cddd,_0x4c1f23,_0x4c55d5){return db['OpenchannelInteraction'][_0x4fa9('0xa7')]({'where':{'id':_0x21cddd['params']['id']}})[_0x4fa9('0x23')](handleEntityNotFound(_0x4c1f23,null))[_0x4fa9('0x23')](function(_0x2baa4f){if(_0x2baa4f){return _0x2baa4f[_0x4fa9('0xb0')](_0x21cddd[_0x4fa9('0xa6')][_0x4fa9('0xab')],_[_0x4fa9('0xb1')](_0x21cddd['body'],[_0x4fa9('0xab'),'id'])||{})['spread'](function(){return db[_0x4fa9('0xb2')][_0x4fa9('0xae')]({'attributes':['id','name',_0x4fa9('0x3d')],'where':{'id':_0x21cddd[_0x4fa9('0xa6')][_0x4fa9('0xab')]}});})[_0x4fa9('0x23')](function(_0x33af29){socket[_0x4fa9('0xb3')](_0x4fa9('0xb4'),{'id':Number(_0x21cddd[_0x4fa9('0xa1')]['id']),'tags':_0x33af29||[]});return{'id':Number(_0x21cddd[_0x4fa9('0xa1')]['id']),'tags':_0x33af29||[]};});}})[_0x4fa9('0x23')](respondWithResult(_0x4c1f23,null))[_0x4fa9('0x2f')](handleError(_0x4c1f23,null));};exports[_0x4fa9('0xb5')]=function(_0x2184e1,_0x470ba9,_0x360278){return db['OpenchannelInteraction'][_0x4fa9('0xa7')]({'where':{'id':_0x2184e1[_0x4fa9('0xa1')]['id']}})['then'](handleEntityNotFound(_0x470ba9,null))['then'](function(_0x265b4d){if(_0x265b4d){return _0x265b4d[_0x4fa9('0xb5')](_0x2184e1[_0x4fa9('0x33')][_0x4fa9('0xab')]);}})[_0x4fa9('0x23')](respondWithStatusCode(_0x470ba9,null))['catch'](handleError(_0x470ba9,null));};exports['download']=function(_0x5abe82,_0x2684bb){var _0x23bd5c=moment()['unix']()['toString']();var _0x12083f=path[_0x4fa9('0x75')](config[_0x4fa9('0xb6')],_0x4fa9('0xb7'),'files',_0x4fa9('0xb8'));var _0x65fe24=path[_0x4fa9('0x75')](config[_0x4fa9('0xb6')],'server','files','attachments');var _0x74d86d=path[_0x4fa9('0x75')](_0x12083f,_0x23bd5c);var _0x2e2999=util[_0x4fa9('0x53')]('transcript-%d-%s.zip',_0x5abe82[_0x4fa9('0xa1')]['id'],_0x23bd5c);var _0x20ad2e=path[_0x4fa9('0x75')](_0x12083f,_0x2e2999);var _0xab1d10=![];return db['OpenchannelInteraction'][_0x4fa9('0xa7')]({'where':{'id':_0x5abe82['params']['id']},'include':[{'model':db[_0x4fa9('0xa9')],'as':'Messages','attributes':['id',_0x4fa9('0xa6'),_0x4fa9('0x4f'),_0x4fa9('0xb9'),_0x4fa9('0xba')],'include':[{'model':db[_0x4fa9('0xbb')],'as':_0x4fa9('0xbb'),'attributes':['id',_0x4fa9('0xbc')],'raw':!![]},{'model':db[_0x4fa9('0xbd')],'as':_0x4fa9('0xbe'),'attributes':['id',_0x4fa9('0xbf'),_0x4fa9('0xc0')],'raw':!![]},{'model':db[_0x4fa9('0xc1')],'as':_0x4fa9('0xc1'),'raw':!![]}]},{'model':db[_0x4fa9('0xc2')],'as':_0x4fa9('0xc3'),'attributes':['id','name']},{'model':db[_0x4fa9('0xbb')],'as':_0x4fa9('0xc4'),'attributes':['id',_0x4fa9('0xbc')]}]})[_0x4fa9('0x23')](handleEntityNotFound(_0x2684bb,null))[_0x4fa9('0x23')](function(_0x2c5eba){if(_0x2c5eba){var _0x378c58=_0x2c5eba[_0x4fa9('0xc5')]({'plain':!![]});_0xab1d10=!![];var _0x29c985={'format':'A4','border':_0x4fa9('0xc6'),'header':{'height':_0x4fa9('0xc7'),'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':_0x4fa9('0xc8'),'contents':{'default':util['format'](_0x4fa9('0xc9'),util['format'](_0x4fa9('0xca'),_0x4fa9('0xcb'),_0x378c58['id']),moment()['format']('YYYY-MM-DD')[_0x4fa9('0x74')]())}}};fs[_0x4fa9('0xcc')](_0x74d86d);var _0x4bba2b={'channel':_0x4fa9('0xcb'),'account':_0x378c58[_0x4fa9('0xc3')]['name'],'agent':_0x378c58[_0x4fa9('0xc4')]?_0x378c58[_0x4fa9('0xc4')][_0x4fa9('0xbc')]:'N.A.','createdAt':moment(_0x378c58[_0x4fa9('0x4f')])[_0x4fa9('0x53')](_0x4fa9('0xcd'))[_0x4fa9('0x74')](),'closedAt':_0x378c58['closed']?moment(_0x378c58['closedAt'])[_0x4fa9('0x53')](_0x4fa9('0xcd'))['toString']():'','disposition':_0x378c58[_0x4fa9('0xce')],'visibility':_0x378c58[_0x4fa9('0xcf')]?_0x4fa9('0xd0'):_0x4fa9('0xd1'),'messages':_(_0x378c58['Messages'])[_0x4fa9('0x68')]({'secret':![]})['map'](function(_0x22bf47){if(_0x22bf47[_0x4fa9('0xc1')]){var _0x30bf36=path[_0x4fa9('0x75')](_0x65fe24,_0x22bf47['Attachment'][_0x4fa9('0xd2')]);if(fs[_0x4fa9('0xd3')](_0x30bf36)){fs[_0x4fa9('0xd4')](_0x30bf36)['pipe'](fs[_0x4fa9('0xd5')](path[_0x4fa9('0x75')](_0x74d86d,_0x22bf47[_0x4fa9('0xc1')][_0x4fa9('0xd2')])));}}return{'date':moment(_0x22bf47[_0x4fa9('0x4f')])['format'](_0x4fa9('0xcd'))[_0x4fa9('0x74')](),'sender':_0x22bf47['direction']===_0x4fa9('0xd6')?_0x22bf47[_0x4fa9('0xbb')]?_0x22bf47['User']['fullname']:_0x4fa9('0xd7'):_0x22bf47[_0x4fa9('0xbe')][_0x4fa9('0xbf')]+(_0x22bf47[_0x4fa9('0xbe')][_0x4fa9('0xc0')]?'\x20'+_0x22bf47[_0x4fa9('0xbe')][_0x4fa9('0xc0')]:''),'body':_0x22bf47[_0x4fa9('0xc1')]?_0x22bf47['Attachment'][_0x4fa9('0xd2')]:_0x22bf47['body'],'direction':_0x22bf47[_0x4fa9('0xb9')]===_0x4fa9('0xd6')?'A':'C','secret':_0x22bf47[_0x4fa9('0xba')],'attachment':_0x22bf47['Attachment']};})[_0x4fa9('0x58')]()};return ejs[_0x4fa9('0xd8')](path['join'](config[_0x4fa9('0xb6')],_0x4fa9('0xb7'),_0x4fa9('0xd9'),_0x4fa9('0xda')),{'interaction':_0x4bba2b})[_0x4fa9('0x23')](function(_0x398392){return new BPromise(function(_0x431c96,_0x423943){pdf[_0x4fa9('0xa5')](_0x398392,_0x29c985)['toFile'](path[_0x4fa9('0x75')](_0x74d86d,_0x4fa9('0xdb')+_0x378c58['id']+'-'+_0x23bd5c+'.pdf'),function(_0x216b7c,_0x3a2fbd){if(_0x216b7c)return _0x423943(_0x216b7c);_0x431c96(_0x3a2fbd);});});});}})[_0x4fa9('0x23')](function(){if(_0xab1d10){return new BPromise(function(_0x3e665a,_0x31a6c7){zipdir(_0x74d86d,{'saveTo':_0x20ad2e},function(_0x167b52,_0x144b89){if(_0x167b52)return _0x31a6c7(_0x167b52);return _0x3e665a(_0x144b89);});})[_0x4fa9('0x23')](function(){return new BPromise(function(_0x1fd9bf,_0x5c25d4){rimraf(_0x74d86d,function(_0xa6f984){if(_0xa6f984)_0x5c25d4(_0xa6f984);return _0x1fd9bf();});});})[_0x4fa9('0x23')](function(){return _0x2684bb[_0x4fa9('0xdc')](_0x20ad2e,_0x2e2999,function(_0x163431){if(_0x163431){console['log'](_0x4fa9('0xdd'),_0x163431);}else{fs[_0x4fa9('0xde')](_0x20ad2e);}});});}else{return _0x2684bb['sendStatus'](0xc8);}})[_0x4fa9('0x2f')](handleError(_0x2684bb,null));}; \ No newline at end of file +var _0x9512=['OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','$lte','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','SELECT','clone','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20IN\x20?','it.MailInteractionId\x20=\x20i.id','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','Contact.firstName','Contact.lastName','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','all','catch','params','rawAttributes','intersection','includeAll','include','options','find','create','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','setTags','spread','Tag','emit','removeTags','download','root','server','files','tmp','attachments','transcript-%d-%s.zip','secret','User','fullname','CmContact','Contact','firstName','lastName','Attachment','OpenchannelAccount','Account','get','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','YYYY-MM-DD','mkdirSync','Owner','N.A.','closed','disposition','threadId','Public','Messages','basename','existsSync','createReadStream','createWriteStream','direction','out','System','renderFile','toFile','transcript-','.pdf','log','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','save','update','then','destroy','error','stack','name','send','Users','map','TagIds','split','forEach','Tags','push','index','OpenchannelInteraction','keys','query','filters','attributes','fields','length','model','hasOwnProperty','nolimit','limit','order','sort','where','pick','select','field','color','from','tools_tags','COUNT(*)','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.OpenchannelInteractionId','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','expr','advancedFilter','createdAt','day','utc','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','value','unreadMessages','isArray','\x20IN\x20?','\x20=\x20?','tableAlias','LIKE','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','TagId','ContactId','filter','isNil'];(function(_0x9bd1eb,_0x24ccb4){var _0x51b468=function(_0x2b5e79){while(--_0x2b5e79){_0x9bd1eb['push'](_0x9bd1eb['shift']());}};_0x51b468(++_0x24ccb4);}(_0x9512,0x75));var _0x2951=function(_0x582df7,_0x3d02cf){_0x582df7=_0x582df7-0x0;var _0x5081fd=_0x9512[_0x582df7];return _0x5081fd;};'use strict';var pdf=require(_0x2951('0x0'));var emlformat=require(_0x2951('0x1'));var rimraf=require(_0x2951('0x2'));var zipdir=require(_0x2951('0x3'));var jsonpatch=require(_0x2951('0x4'));var rp=require(_0x2951('0x5'));var moment=require(_0x2951('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x2951('0x7'));var util=require(_0x2951('0x8'));var path=require(_0x2951('0x9'));var sox=require(_0x2951('0xa'));var csv=require(_0x2951('0xb'));var ejs=require(_0x2951('0xc'));var fs=require('fs');var _=require(_0x2951('0xd'));var squel=require('squel');var crypto=require(_0x2951('0xe'));var jsforce=require(_0x2951('0xf'));var deskjs=require(_0x2951('0x10'));var toCsv=require(_0x2951('0xb'));var querystring=require(_0x2951('0x11'));var Papa=require(_0x2951('0x12'));var Redis=require('ioredis');var authService=require(_0x2951('0x13'));var qs=require(_0x2951('0x14'));var hardwareService=require(_0x2951('0x15'));var logger=require(_0x2951('0x16'))('api');var utils=require(_0x2951('0x17'));var config=require(_0x2951('0x18'));var db=require(_0x2951('0x19'))['db'];config[_0x2951('0x1a')]=_[_0x2951('0x1b')](config['redis'],{'host':_0x2951('0x1c'),'port':0x18eb});var socket=require(_0x2951('0x1d'))(new Redis(config[_0x2951('0x1a')]));require(_0x2951('0x1e'))[_0x2951('0x1f')](socket);function respondWithStatusCode(_0x13a494,_0x240479){_0x240479=_0x240479||0xcc;return function(_0x25d7fc){if(_0x25d7fc){return _0x13a494[_0x2951('0x20')](_0x240479);}return _0x13a494[_0x2951('0x21')](_0x240479)[_0x2951('0x22')]();};}function respondWithResult(_0x402072,_0x3ea695){_0x3ea695=_0x3ea695||0xc8;return function(_0x5750e9){if(_0x5750e9){return _0x402072[_0x2951('0x21')](_0x3ea695)[_0x2951('0x23')](_0x5750e9);}};}function respondWithFilteredResult(_0x18e89d,_0x5bf49f){return function(_0x3d0a9c){if(_0x3d0a9c){var _0x16e1b5=_0x3d0a9c[_0x2951('0x24')],_0x4a9cb2=_0x5bf49f[_0x2951('0x25')],_0x3ef33b=_0x5bf49f[_0x2951('0x25')]+_0x5bf49f['limit'],_0xdbc682;if(_0x3ef33b>=_0x16e1b5){_0x3ef33b=_0x16e1b5;_0xdbc682=0xc8;}else{_0xdbc682=0xce;}_0x18e89d['status'](_0xdbc682);return _0x18e89d[_0x2951('0x26')](_0x2951('0x27'),_0x4a9cb2+'-'+_0x3ef33b+'/'+_0x16e1b5)[_0x2951('0x23')](_0x3d0a9c);}return null;};}function patchUpdates(_0x367343){return function(_0x55e473){try{jsonpatch['apply'](_0x55e473,_0x367343,!![]);}catch(_0x2b8938){return BPromise['reject'](_0x2b8938);}return _0x55e473[_0x2951('0x28')]();};}function saveUpdates(_0x17f5d0,_0x24a027){return function(_0x579f2b){if(_0x579f2b){return _0x579f2b[_0x2951('0x29')](_0x17f5d0)[_0x2951('0x2a')](function(_0x567fcd){return _0x567fcd;});}return null;};}function removeEntity(_0x22c841,_0x3e86b0){return function(_0x4afea7){if(_0x4afea7){return _0x4afea7[_0x2951('0x2b')]()[_0x2951('0x2a')](function(){_0x22c841[_0x2951('0x21')](0xcc)[_0x2951('0x22')]();});}};}function handleEntityNotFound(_0x5ee6e2,_0x1269d5){return function(_0x7082b){if(!_0x7082b){_0x5ee6e2[_0x2951('0x20')](0x194);}return _0x7082b;};}function handleError(_0x1acb0a,_0xaa447c){_0xaa447c=_0xaa447c||0x1f4;return function(_0x263380){logger[_0x2951('0x2c')](_0x263380[_0x2951('0x2d')]);if(_0x263380[_0x2951('0x2e')]){delete _0x263380['name'];}_0x1acb0a[_0x2951('0x21')](_0xaa447c)[_0x2951('0x2f')](_0x263380);};}function getInteractionUsers(_0x5beac6,_0x1bfca1){return new BPromise(function(_0x287628,_0x233c14){try{if(_0x1bfca1[_0x5beac6['id']]){_0x5beac6[_0x2951('0x30')]=_[_0x2951('0x31')](_0x1bfca1[_0x5beac6['id']],function(_0x2dc926){return{'id':_0x2dc926['id']};});}}catch(_0x51e46a){_0x233c14(_0x51e46a);}_0x287628(_0x5beac6);});}function getInteractionTags(_0x3fd587,_0x1c1c92){return new BPromise(function(_0x53b493,_0x1012e3){try{if(_0x3fd587[_0x2951('0x32')]){_0x3fd587['Tags']=[];_0x3fd587[_0x2951('0x32')][_0x2951('0x33')](',')[_0x2951('0x34')](function(_0x551778){_0x3fd587[_0x2951('0x35')][_0x2951('0x36')](_0x1c1c92[_0x551778]);});}delete _0x3fd587[_0x2951('0x32')];}catch(_0x419e52){_0x1012e3(_0x419e52);}_0x53b493(_0x3fd587);});}function updateOpenchannelInteraction(_0x38d019,_0x4eec74,_0x5b736b){return new BPromise(function(_0x3b5dc1,_0x211126){return getInteractionUsers(_0x38d019,_0x5b736b)['then'](function(_0x1feea4){return getInteractionTags(_0x1feea4,_0x4eec74);})[_0x2951('0x2a')](function(_0x1f7891){_0x3b5dc1(_0x1f7891);})['catch'](function(_0x18e1f1){_0x211126(_0x18e1f1);});});}exports[_0x2951('0x37')]=function(_0x5a1ca4,_0x152a64){var _0x2ec05f={},_0x3f377c={},_0x4e0847={'count':0x0,'rows':[]};var _0x44968f=db[_0x2951('0x38')]['rawAttributes'];_0x3f377c['model']=_[_0x2951('0x39')](_0x44968f);_0x3f377c[_0x2951('0x3a')]=_[_0x2951('0x39')](_0x5a1ca4[_0x2951('0x3a')]);_0x3f377c[_0x2951('0x3b')]=_['intersection'](_0x3f377c['model'],_0x3f377c[_0x2951('0x3a')]);_0x2ec05f[_0x2951('0x3c')]=_['intersection'](_0x3f377c['model'],qs[_0x2951('0x3d')](_0x5a1ca4[_0x2951('0x3a')][_0x2951('0x3d')]));_0x2ec05f[_0x2951('0x3c')]=_0x2ec05f['attributes'][_0x2951('0x3e')]?_0x2ec05f[_0x2951('0x3c')]:_0x3f377c[_0x2951('0x3f')];if(!_0x5a1ca4[_0x2951('0x3a')][_0x2951('0x40')](_0x2951('0x41'))){_0x2ec05f[_0x2951('0x42')]=qs[_0x2951('0x42')](_0x5a1ca4[_0x2951('0x3a')][_0x2951('0x42')]);_0x2ec05f[_0x2951('0x25')]=qs['offset'](_0x5a1ca4[_0x2951('0x3a')]['offset']);}_0x2ec05f[_0x2951('0x43')]=qs[_0x2951('0x44')](_0x5a1ca4[_0x2951('0x3a')]['sort']);_0x2ec05f[_0x2951('0x45')]=qs[_0x2951('0x3b')](_[_0x2951('0x46')](_0x5a1ca4['query'],_0x3f377c[_0x2951('0x3b')]));var _0x3636d1=[];var _0x37fb45=squel[_0x2951('0x47')]()[_0x2951('0x48')]('id')[_0x2951('0x48')](_0x2951('0x2e'))[_0x2951('0x48')](_0x2951('0x49'))[_0x2951('0x4a')](_0x2951('0x4b'));var _0x27b55f=squel[_0x2951('0x47')]()[_0x2951('0x48')](_0x2951('0x4c'))[_0x2951('0x4a')](_0x2951('0x4d'),'me')['where'](_0x2951('0x4e'))[_0x2951('0x45')](_0x2951('0x4f'))['where'](_0x2951('0x50'));var _0x191d99=squel['select']()[_0x2951('0x48')](_0x2951('0x51'))[_0x2951('0x48')](_0x2951('0x52'))['from']('user_has_openchannel_interactions','ui')[_0x2951('0x53')](_0x2951('0x54'),'u',_0x2951('0x55'));var _0xbc3ca2=squel[_0x2951('0x47')]()[_0x2951('0x4a')](_0x2951('0x56'),'i')[_0x2951('0x53')](_0x2951('0x57'),'c',_0x2951('0x58'))[_0x2951('0x53')](_0x2951('0x54'),'o','o.id\x20=\x20i.UserId')[_0x2951('0x53')](_0x2951('0x59'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x2951('0x53')](_0x2951('0x4d'),'me','me.OpenchannelInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false');var _0x3a1ff1=squel[_0x2951('0x5a')]();if(_0x5a1ca4['query'][_0x2951('0x5b')]){var _0x22b790=JSON['parse'](_0x5a1ca4[_0x2951('0x3a')][_0x2951('0x5b')]);_[_0x2951('0x39')](_0x22b790)[_0x2951('0x34')](function(_0x4c0e6d){var _0x4b5fcf=_0x22b790[_0x4c0e6d];if(_0x4c0e6d===_0x2951('0x5c')){var _0x336b66=moment(_0x4b5fcf['value']['dateStart'])['startOf'](_0x2951('0x5d'))[_0x2951('0x5e')]()[_0x2951('0x5f')]();var _0x3f53ac=moment(_0x3f53ac)['utc']()['endOf'](_0x2951('0x5d'))[_0x2951('0x5f')]();_0x3a1ff1[_0x2951('0x60')](_0x2951('0x61'),_0x336b66,_0x3f53ac);}else{if(_['isArray'](_0x4b5fcf[_0x2951('0x62')])){_0x4b5fcf[_0x2951('0x62')][_0x2951('0x34')](function(_0x4656ca){switch(_0x4b5fcf['condition'][_0x2951('0x63')]){case'IS':if(_0x4c0e6d!=='TagId'&&_0x4c0e6d!==_0x2951('0x64')){if(_[_0x2951('0x65')](_0x4b5fcf[_0x2951('0x63')])&&_0x4b5fcf[_0x2951('0x63')]['length']>0x1){_0x3a1ff1[_0x2951('0x60')](_0x4b5fcf['tableAlias']+'.'+_0x4c0e6d+_0x2951('0x66'),_0x4b5fcf['value']);}else{_0x3a1ff1['and'](_0x4b5fcf['tableAlias']+'.'+_0x4c0e6d+_0x2951('0x67'),_0x4b5fcf[_0x2951('0x63')][0x0]);}}break;case'=':_0x3a1ff1[_0x2951('0x60')](_0x4b5fcf[_0x2951('0x68')]+'.'+_0x4c0e6d+_0x2951('0x67'),_0x4b5fcf[_0x2951('0x63')]);break;case _0x2951('0x69'):if(_0x4c0e6d==='ContactId'){_0x3a1ff1[_0x2951('0x60')](_0x2951('0x6a')+_0x2951('0x6b'),'%'+_0x4b5fcf[_0x2951('0x63')]+'%');_0x3a1ff1['or'](_0x2951('0x6c')+_0x2951('0x6b'),'%'+_0x4b5fcf[_0x2951('0x63')]+'%');_0x3a1ff1['or'](_0x2951('0x6d')+'\x20LIKE\x20?','%'+_0x4b5fcf['value']+'%');}else{_0x3a1ff1[_0x2951('0x60')](_0x4b5fcf[_0x2951('0x68')]+'.'+_0x4c0e6d+_0x2951('0x6b'),'%'+_0x4b5fcf['value']+'%');}break;case'>':_0x3a1ff1[_0x2951('0x60')](_0x4b5fcf['tableAlias']+'.'+_0x4c0e6d+_0x2951('0x6e'),_0x4b5fcf[_0x2951('0x63')]);break;case'<':_0x3a1ff1[_0x2951('0x60')](_0x4b5fcf[_0x2951('0x68')]+'.'+_0x4c0e6d+_0x2951('0x6f'),_0x4b5fcf[_0x2951('0x63')]);break;}});}else{switch(_0x4b5fcf[_0x2951('0x62')][_0x2951('0x63')]){case'IS':if(_0x4c0e6d!==_0x2951('0x70')&&_0x4c0e6d!==_0x2951('0x64')){if(_[_0x2951('0x65')](_0x4b5fcf['value'])&&_0x4b5fcf['value']['length']>0x1){_0x3a1ff1[_0x2951('0x60')](_0x4b5fcf[_0x2951('0x68')]+'.'+_0x4c0e6d+'\x20IN\x20?',_0x4b5fcf[_0x2951('0x63')]);}else{_0x3a1ff1['and'](_0x4b5fcf[_0x2951('0x68')]+'.'+_0x4c0e6d+_0x2951('0x67'),_0x4b5fcf['value'][0x0]);}}break;case'=':_0x3a1ff1[_0x2951('0x60')](_0x4b5fcf[_0x2951('0x68')]+'.'+_0x4c0e6d+_0x2951('0x67'),_0x4b5fcf[_0x2951('0x63')]);break;case _0x2951('0x69'):if(_0x4c0e6d===_0x2951('0x71')){_0x3a1ff1[_0x2951('0x60')](_0x2951('0x6a')+_0x2951('0x6b'),'%'+_0x4b5fcf[_0x2951('0x63')]+'%');_0x3a1ff1['or'](_0x2951('0x6c')+_0x2951('0x6b'),'%'+_0x4b5fcf['value']+'%');_0x3a1ff1['or'](_0x2951('0x6d')+_0x2951('0x6b'),'%'+_0x4b5fcf['value']+'%');}else{_0x3a1ff1['and'](_0x4b5fcf['tableAlias']+'.'+_0x4c0e6d+_0x2951('0x6b'),'%'+_0x4b5fcf['value']+'%');}break;case'>':_0x3a1ff1['and'](_0x4b5fcf[_0x2951('0x68')]+'.'+_0x4c0e6d+'\x20>\x20?',_0x4b5fcf['value']);break;case'<':_0x3a1ff1[_0x2951('0x60')](_0x4b5fcf[_0x2951('0x68')]+'.'+_0x4c0e6d+_0x2951('0x6f'),_0x4b5fcf['value']);break;}}}});}else{var _0x26144e=_(Object[_0x2951('0x39')](_0x5a1ca4['query']))[_0x2951('0x31')](function(_0x594274){return _0x44968f[_0x2951('0x40')](_0x594274)?_0x594274:undefined;})[_0x2951('0x72')](function(_0x5b08bf){return!_[_0x2951('0x73')](_0x5b08bf);})[_0x2951('0x63')]();if(!_['isEmpty'](_0x26144e)){_0x26144e[_0x2951('0x34')](function(_0x49aa33){if(_0x49aa33===_0x2951('0x74')){_0xbc3ca2[_0x2951('0x45')](_0x2951('0x75'),[][_0x2951('0x76')](_0x5a1ca4[_0x2951('0x3a')][_0x49aa33]));}else if(_0x49aa33==='createdAt'){var _0x1ce931=JSON[_0x2951('0x77')](_0x5a1ca4['query'][_0x49aa33])[_0x2951('0x78')];var _0x445214=JSON[_0x2951('0x77')](_0x5a1ca4[_0x2951('0x3a')][_0x49aa33])[_0x2951('0x79')];_0xbc3ca2[_0x2951('0x45')](_0x2951('0x61'),_0x1ce931,_0x445214);}else{if(_0x5a1ca4['query'][_0x49aa33]==='null'){_0xbc3ca2['where']('i.'+_0x49aa33+_0x2951('0x7a'));}else{_0xbc3ca2[_0x2951('0x45')]('i.'+_0x49aa33+_0x2951('0x67'),_0x5a1ca4[_0x2951('0x3a')][_0x49aa33]);}}});}if(_0x5a1ca4[_0x2951('0x3a')][_0x2951('0x72')]){var _0x265c91=_0x5a1ca4[_0x2951('0x3a')]['filter'][_0x2951('0x7b')]('\x5c','\x5c\x5c')[_0x2951('0x7b')]('\x27\x27',_0x2951('0x7c'));if(qs[_0x2951('0x7d')](_0x265c91)){_0x3a1ff1['or'](_0x2951('0x7e'),_0x265c91+'%');}else{var _0x58b323=[];_0x265c91[_0x2951('0x33')]('\x20')[_0x2951('0x34')](function(_0x2faafc){_0x58b323[_0x2951('0x36')]('+'+_0x2faafc[_0x2951('0x7f')]());});var _0x426de2=_0x58b323[_0x2951('0x80')]('\x20');_0x3a1ff1['or'](_0x2951('0x81'),_0x426de2)['or'](_0x2951('0x82'),_0x265c91+'%')['or'](_0x2951('0x83'),_0x265c91+'%');}}}_0xbc3ca2[_0x2951('0x45')](_0x3a1ff1);if(_0x2ec05f[_0x2951('0x43')]){_0x2ec05f['order'][_0x2951('0x34')](function(_0x9efe65){_0xbc3ca2['order']('i.'+_0x9efe65[0x0],_0x9efe65[0x1]==='DESC'?![]:!![]);});}_0xbc3ca2[_0x2951('0x84')]('i.id');var _0x3c485={'type':db['Sequelize']['QueryTypes'][_0x2951('0x85')],'raw':!![]};var _0x1a2ce6=_0xbc3ca2[_0x2951('0x86')]()[_0x2951('0x48')](_0x2951('0x4c'))[_0x2951('0x48')](_0x2951('0x87'),_0x2951('0x64'));if(!_0x5a1ca4[_0x2951('0x3a')]['advancedFilter']){if(_0x5a1ca4[_0x2951('0x3a')][_0x2951('0x88')]){if(_0x5a1ca4[_0x2951('0x3a')][_0x2951('0x88')]==0x1){_0x1a2ce6[_0x2951('0x89')](_0x2951('0x8a'));_0xbc3ca2['having'](_0x2951('0x8a'));}else{_0x1a2ce6[_0x2951('0x89')](_0x2951('0x8b'));_0xbc3ca2[_0x2951('0x89')]('`unreadMessages`\x20>\x200');}}if(_0x5a1ca4[_0x2951('0x3a')][_0x2951('0x8c')]){var _0x10a816=_[_0x2951('0x65')](_0x5a1ca4[_0x2951('0x3a')]['tag'])?_0x5a1ca4[_0x2951('0x3a')][_0x2951('0x8c')]:new Array(_0x5a1ca4[_0x2951('0x3a')][_0x2951('0x8c')]);var _0x38d9e5=squel[_0x2951('0x5a')]();_0x10a816[_0x2951('0x34')](function(_0x1e6104){_0x38d9e5['or'](_0x2951('0x8d'),'%,'+_0x1e6104+',%');});_0xbc3ca2[_0x2951('0x89')](_0x38d9e5);_0x1a2ce6[_0x2951('0x53')]('openchannel_interaction_has_tags','it',_0x2951('0x8e'));_0x1a2ce6['left_join'](_0x2951('0x4b'),'t','t.id\x20=\x20it.TagId');_0x1a2ce6['where'](_0x2951('0x8f'),_0x10a816);}}else{var _0x22b790=JSON['parse'](_0x5a1ca4['query'][_0x2951('0x5b')]);_[_0x2951('0x39')](_0x22b790)[_0x2951('0x34')](function(_0x383f4e){var _0x3da1e2=_0x22b790[_0x383f4e];if(_0x383f4e==='TagId'){var _0x50a659=_0x3da1e2[_0x2951('0x63')];var _0x4416f5=squel[_0x2951('0x5a')]();_0x50a659[_0x2951('0x34')](function(_0x3ef3d9){_0x4416f5['or'](_0x2951('0x8d'),'%,'+_0x3ef3d9+',%');});_0xbc3ca2['having'](_0x4416f5);_0x1a2ce6[_0x2951('0x53')]('mail_interaction_has_tags','it',_0x2951('0x90'));_0x1a2ce6[_0x2951('0x53')](_0x2951('0x4b'),'t','t.id\x20=\x20it.TagId');_0x1a2ce6[_0x2951('0x45')](_0x2951('0x8f'),_0x50a659);}else if(_0x383f4e===_0x2951('0x64')){if(_0x3da1e2[_0x2951('0x63')]['length']===0x1){if(_0x3da1e2[_0x2951('0x63')][0x0]===0x1){_0x1a2ce6[_0x2951('0x89')](_0x2951('0x8a'));_0xbc3ca2['having'](_0x2951('0x8a'));}else{_0x1a2ce6[_0x2951('0x89')](_0x2951('0x8b'));_0xbc3ca2[_0x2951('0x89')](_0x2951('0x8b'));}}}});}db[_0x2951('0x91')][_0x2951('0x3a')](_0x1a2ce6[_0x2951('0x7f')](),_0x3c485)[_0x2951('0x2a')](function(_0x56af7e){_0x4e0847[_0x2951('0x24')]=_0x56af7e[_0x2951('0x3e')];if(_0x4e0847[_0x2951('0x24')]===0x0)return[];return db['sequelize'][_0x2951('0x3a')](_0x37fb45[_0x2951('0x7f')](),_0x3c485)[_0x2951('0x2a')](function(_0x445702){_0x3636d1=_[_0x2951('0x92')](_0x445702,'id');_0x3c485=_[_0x2951('0x93')](_0x3c485,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0xbc3ca2[_0x2951('0x48')]('COUNT(me.id)','unreadMessages');_0xbc3ca2[_0x2951('0x48')](_0x2951('0x94'),_0x2951('0x95'));_0xbc3ca2['field'](_0x2951('0x96'),_0x2951('0x97'));_0xbc3ca2[_0x2951('0x48')]('i.*');_0xbc3ca2['field']('c.firstName',_0x2951('0x98'));_0xbc3ca2[_0x2951('0x48')]('c.lastName',_0x2951('0x99'));_0xbc3ca2[_0x2951('0x48')](_0x2951('0x6d'),'Contact.email');_0xbc3ca2[_0x2951('0x48')](_0x2951('0x9a'),'Contact.phone');_0xbc3ca2[_0x2951('0x48')](_0x2951('0x9b'),_0x2951('0x9c'));_0xbc3ca2[_0x2951('0x48')](_0x2951('0x9d'),_0x2951('0x9e'));_0xbc3ca2['field'](_0x2951('0x9f'),'TagIds');_0xbc3ca2[_0x2951('0x53')](_0x2951('0xa0'),'it',_0x2951('0x8e'));_0xbc3ca2[_0x2951('0x53')](_0x2951('0x4b'),'t',_0x2951('0xa1'));_0xbc3ca2[_0x2951('0x42')](_0x2ec05f['limit']);_0xbc3ca2['offset'](_0x2ec05f[_0x2951('0x25')]);return db[_0x2951('0x91')][_0x2951('0x3a')](_0xbc3ca2[_0x2951('0x7f')](),_0x3c485);})[_0x2951('0x2a')](function(_0x3dda71){_0x191d99['where'](_0x2951('0xa2'),_[_0x2951('0x31')](_0x3dda71,'id'));return db[_0x2951('0x91')][_0x2951('0x3a')](_0x191d99[_0x2951('0x7f')](),_0x3c485)[_0x2951('0x2a')](function(_0x56c0ed){var _0x5cda63=_[_0x2951('0xa3')](_0x56c0ed,'OpenchannelInteractionId');var _0x49f273=[];_0x3dda71[_0x2951('0x34')](function(_0x1459cf){_0x49f273['push'](updateOpenchannelInteraction(_0x1459cf,_0x3636d1,_0x5cda63));});return BPromise[_0x2951('0xa4')](_0x49f273);});});})[_0x2951('0x2a')](function(_0x2c835c){_0x4e0847['rows']=_0x2c835c;return _0x4e0847;})[_0x2951('0x2a')](respondWithFilteredResult(_0x152a64,_0x2ec05f))[_0x2951('0xa5')](handleError(_0x152a64,null));};exports['show']=function(_0x273047,_0x2e8046){var _0x1c6e4f={'raw':![],'where':{'id':_0x273047[_0x2951('0xa6')]['id']}},_0x18752f={};_0x18752f[_0x2951('0x3f')]=_[_0x2951('0x39')](db[_0x2951('0x38')][_0x2951('0xa7')]);_0x18752f[_0x2951('0x3a')]=_[_0x2951('0x39')](_0x273047[_0x2951('0x3a')]);_0x18752f[_0x2951('0x3b')]=_[_0x2951('0xa8')](_0x18752f[_0x2951('0x3f')],_0x18752f[_0x2951('0x3a')]);_0x1c6e4f[_0x2951('0x3c')]=_[_0x2951('0xa8')](_0x18752f['model'],qs[_0x2951('0x3d')](_0x273047[_0x2951('0x3a')][_0x2951('0x3d')]));_0x1c6e4f[_0x2951('0x3c')]=_0x1c6e4f['attributes'][_0x2951('0x3e')]?_0x1c6e4f[_0x2951('0x3c')]:_0x18752f[_0x2951('0x3f')];if(_0x273047[_0x2951('0x3a')][_0x2951('0xa9')]){_0x1c6e4f[_0x2951('0xaa')]=[{'all':!![]}];}_0x1c6e4f=_[_0x2951('0x93')]({},_0x1c6e4f,_0x273047[_0x2951('0xab')]);return db[_0x2951('0x38')][_0x2951('0xac')](_0x1c6e4f)['then'](handleEntityNotFound(_0x2e8046,null))[_0x2951('0x2a')](respondWithResult(_0x2e8046,null))['catch'](handleError(_0x2e8046,null));};exports['create']=function(_0x56781d,_0x3a0b9c){return db[_0x2951('0x38')][_0x2951('0xad')](_0x56781d['body'],{})[_0x2951('0x2a')](respondWithResult(_0x3a0b9c,0xc9))['catch'](handleError(_0x3a0b9c,null));};exports[_0x2951('0x29')]=function(_0x39ff15,_0x32110a){if(_0x39ff15[_0x2951('0xae')]['id']){delete _0x39ff15['body']['id'];}return db[_0x2951('0x38')][_0x2951('0xac')]({'where':{'id':_0x39ff15['params']['id']}})[_0x2951('0x2a')](handleEntityNotFound(_0x32110a,null))[_0x2951('0x2a')](saveUpdates(_0x39ff15['body'],null))[_0x2951('0x2a')](respondWithResult(_0x32110a,null))['catch'](handleError(_0x32110a,null));};exports[_0x2951('0x2b')]=function(_0x4c377f,_0x1fd4f3){return db['OpenchannelInteraction'][_0x2951('0xac')]({'where':{'id':_0x4c377f[_0x2951('0xa6')]['id']}})[_0x2951('0x2a')](handleEntityNotFound(_0x1fd4f3,null))[_0x2951('0x2a')](removeEntity(_0x1fd4f3,null))[_0x2951('0xa5')](handleError(_0x1fd4f3,null));};exports[_0x2951('0xaf')]=function(_0x348b08,_0x33c927){return db[_0x2951('0x38')][_0x2951('0xaf')]()[_0x2951('0x2a')](respondWithResult(_0x33c927,null))[_0x2951('0xa5')](handleError(_0x33c927,null));};exports[_0x2951('0xb0')]=function(_0xe20689,_0x5d95b6,_0x285240){return db[_0x2951('0xb1')][_0x2951('0xac')]({'where':{'id':_0xe20689[_0x2951('0xa6')]['id']}})[_0x2951('0x2a')](handleEntityNotFound(_0x5d95b6,null))[_0x2951('0x2a')](function(_0x384a99){if(_0x384a99){return _0x384a99['addMessage'](_0xe20689[_0x2951('0xae')][_0x2951('0xb2')],_[_0x2951('0xb3')](_0xe20689[_0x2951('0xae')],[_0x2951('0xb2'),'id'])||{});}})[_0x2951('0x2a')](respondWithResult(_0x5d95b6,null))[_0x2951('0xa5')](handleError(_0x5d95b6,null));};exports[_0x2951('0xb4')]=function(_0xcb47eb,_0x2ee38d,_0x21d7d4){var _0x197c3c={'raw':![],'where':{}};var _0x4c17fc={};var _0x434d70={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x2951('0xb5')]({'where':{'id':_0xcb47eb[_0x2951('0xa6')]['id']}})['then'](handleEntityNotFound(_0x2ee38d,null))['then'](function(_0x91ec17){if(_0x91ec17){_0x4c17fc[_0x2951('0x3f')]=_['keys'](db[_0x2951('0xb1')][_0x2951('0xa7')]);_0x4c17fc[_0x2951('0x3a')]=_[_0x2951('0x39')](_0xcb47eb[_0x2951('0x3a')]);_0x4c17fc[_0x2951('0x3b')]=_[_0x2951('0xa8')](_0x4c17fc[_0x2951('0x3f')],_0x4c17fc[_0x2951('0x3a')]);_0x197c3c[_0x2951('0x3c')]=_[_0x2951('0xa8')](_0x4c17fc[_0x2951('0x3f')],qs[_0x2951('0x3d')](_0xcb47eb[_0x2951('0x3a')][_0x2951('0x3d')]));_0x197c3c[_0x2951('0x3c')]=_0x197c3c[_0x2951('0x3c')][_0x2951('0x3e')]?_0x197c3c[_0x2951('0x3c')]:_0x4c17fc[_0x2951('0x3f')];if(!_0xcb47eb['query'][_0x2951('0x40')]('nolimit')){_0x197c3c[_0x2951('0x42')]=qs['limit'](_0xcb47eb[_0x2951('0x3a')][_0x2951('0x42')]);_0x197c3c[_0x2951('0x25')]=qs[_0x2951('0x25')](_0xcb47eb[_0x2951('0x3a')][_0x2951('0x25')]);}_0x197c3c[_0x2951('0x43')]=qs[_0x2951('0x44')](_0xcb47eb[_0x2951('0x3a')][_0x2951('0x44')]);_0x197c3c[_0x2951('0x45')]=qs[_0x2951('0x3b')](_[_0x2951('0x46')](_0xcb47eb[_0x2951('0x3a')],_0x4c17fc[_0x2951('0x3b')]));_0x197c3c[_0x2951('0x45')]['OpenchannelInteractionId']=_0x91ec17['id'];if(_0xcb47eb[_0x2951('0x3a')][_0x2951('0x72')]){_0x197c3c[_0x2951('0x45')]=_['merge'](_0x197c3c[_0x2951('0x45')],{'$or':_[_0x2951('0x31')](_0x197c3c[_0x2951('0x3c')],function(_0xde93cc){var _0x89cd4b={};_0x89cd4b[_0xde93cc]={'$like':'%'+_0xcb47eb['query'][_0x2951('0x72')]+'%'};return _0x89cd4b;})});}if(_0xcb47eb[_0x2951('0x3a')]['$gte']){var _0x247d40=_0xcb47eb['query'][_0x2951('0x78')][_0x2951('0x33')](',');var _0x2ee796={};_0x2ee796[_0x247d40[0x0]]={'$gte':moment(_0x247d40[0x1])[_0x2951('0x5f')](_0x2951('0xb6'))};_0x197c3c[_0x2951('0x45')]=_[_0x2951('0x93')](_0x197c3c[_0x2951('0x45')],_0x2ee796);}_0x197c3c=_[_0x2951('0x93')]({},_0x197c3c,_0xcb47eb['options']);return db[_0x2951('0xb1')]['count']({'where':_0x197c3c['where']})['then'](function(_0x3731fa){_0x434d70[_0x2951('0x24')]=_0x3731fa;if(_0xcb47eb[_0x2951('0x3a')]['includeAll']){_0x197c3c[_0x2951('0xaa')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x2951('0xb7')](_0x197c3c);})['then'](function(_0x350d29){_0x434d70[_0x2951('0xb8')]=_0x350d29;return _0x434d70;});}})[_0x2951('0x2a')](respondWithFilteredResult(_0x2ee38d,_0x197c3c))[_0x2951('0xa5')](handleError(_0x2ee38d,null));};exports['addTags']=function(_0x3bd131,_0x15a955,_0x54996c){return db['OpenchannelInteraction']['find']({'where':{'id':_0x3bd131[_0x2951('0xa6')]['id']}})[_0x2951('0x2a')](handleEntityNotFound(_0x15a955,null))['then'](function(_0x28d882){if(_0x28d882){return _0x28d882[_0x2951('0xb9')](_0x3bd131['body'][_0x2951('0xb2')],_[_0x2951('0xb3')](_0x3bd131[_0x2951('0xae')],['ids','id'])||{})[_0x2951('0xba')](function(){return db[_0x2951('0xbb')][_0x2951('0xb7')]({'attributes':['id',_0x2951('0x2e'),_0x2951('0x49')],'where':{'id':_0x3bd131[_0x2951('0xae')][_0x2951('0xb2')]}});})[_0x2951('0x2a')](function(_0xb77fac){socket[_0x2951('0xbc')]('openchannelInteractionTags:save',{'id':Number(_0x3bd131[_0x2951('0xa6')]['id']),'tags':_0xb77fac||[]});return{'id':Number(_0x3bd131[_0x2951('0xa6')]['id']),'tags':_0xb77fac||[]};});}})['then'](respondWithResult(_0x15a955,null))[_0x2951('0xa5')](handleError(_0x15a955,null));};exports['removeTags']=function(_0x41cef8,_0x4c4a8e,_0x4b1284){return db[_0x2951('0x38')]['find']({'where':{'id':_0x41cef8[_0x2951('0xa6')]['id']}})['then'](handleEntityNotFound(_0x4c4a8e,null))[_0x2951('0x2a')](function(_0x5a125c){if(_0x5a125c){return _0x5a125c[_0x2951('0xbd')](_0x41cef8[_0x2951('0x3a')][_0x2951('0xb2')]);}})[_0x2951('0x2a')](respondWithStatusCode(_0x4c4a8e,null))['catch'](handleError(_0x4c4a8e,null));};exports[_0x2951('0xbe')]=function(_0x1d45e2,_0x3c1c94){var _0x2268b5=moment()['unix']()['toString']();var _0x440437=path['join'](config[_0x2951('0xbf')],_0x2951('0xc0'),_0x2951('0xc1'),_0x2951('0xc2'));var _0x449e50=path['join'](config[_0x2951('0xbf')],_0x2951('0xc0'),_0x2951('0xc1'),_0x2951('0xc3'));var _0x3e5d50=path[_0x2951('0x80')](_0x440437,_0x2268b5);var _0x4a33f1=util['format'](_0x2951('0xc4'),_0x1d45e2[_0x2951('0xa6')]['id'],_0x2268b5);var _0x56b677=path['join'](_0x440437,_0x4a33f1);var _0x89f7fe=![];return db[_0x2951('0x38')][_0x2951('0xac')]({'where':{'id':_0x1d45e2[_0x2951('0xa6')]['id']},'include':[{'model':db[_0x2951('0xb1')],'as':'Messages','attributes':['id','body',_0x2951('0x5c'),'direction',_0x2951('0xc5')],'include':[{'model':db[_0x2951('0xc6')],'as':'User','attributes':['id',_0x2951('0xc7')],'raw':!![]},{'model':db[_0x2951('0xc8')],'as':_0x2951('0xc9'),'attributes':['id',_0x2951('0xca'),_0x2951('0xcb')],'raw':!![]},{'model':db[_0x2951('0xcc')],'as':_0x2951('0xcc'),'raw':!![]}]},{'model':db[_0x2951('0xcd')],'as':_0x2951('0xce'),'attributes':['id','name']},{'model':db[_0x2951('0xc6')],'as':'Owner','attributes':['id',_0x2951('0xc7')]}]})[_0x2951('0x2a')](handleEntityNotFound(_0x3c1c94,null))['then'](function(_0x40770f){if(_0x40770f){var _0x1a09fe=_0x40770f[_0x2951('0xcf')]({'plain':!![]});_0x89f7fe=!![];var _0x2c4d9f={'format':'A4','border':'10px','header':{'height':'40px','contents':{'first':_0x2951('0xd0')}},'footer':{'height':'30px','contents':{'default':util[_0x2951('0x5f')]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util['format'](_0x2951('0xd1'),_0x2951('0xd2'),_0x1a09fe['id']),moment()['format'](_0x2951('0xd3'))[_0x2951('0x7f')]())}}};fs[_0x2951('0xd4')](_0x3e5d50);var _0x50465b={'channel':_0x2951('0xd2'),'account':_0x1a09fe[_0x2951('0xce')][_0x2951('0x2e')],'agent':_0x1a09fe[_0x2951('0xd5')]?_0x1a09fe[_0x2951('0xd5')][_0x2951('0xc7')]:_0x2951('0xd6'),'createdAt':moment(_0x1a09fe[_0x2951('0x5c')])[_0x2951('0x5f')](_0x2951('0xb6'))[_0x2951('0x7f')](),'closedAt':_0x1a09fe[_0x2951('0xd7')]?moment(_0x1a09fe['closedAt'])[_0x2951('0x5f')](_0x2951('0xb6'))[_0x2951('0x7f')]():'','disposition':_0x1a09fe[_0x2951('0xd8')],'visibility':_0x1a09fe[_0x2951('0xd9')]?_0x2951('0xda'):'Private','messages':_(_0x1a09fe[_0x2951('0xdb')])[_0x2951('0x72')]({'secret':![]})['map'](function(_0x18c79c){if(_0x18c79c[_0x2951('0xcc')]){var _0x87c81=path[_0x2951('0x80')](_0x449e50,_0x18c79c[_0x2951('0xcc')][_0x2951('0xdc')]);if(fs[_0x2951('0xdd')](_0x87c81)){fs[_0x2951('0xde')](_0x87c81)['pipe'](fs[_0x2951('0xdf')](path['join'](_0x3e5d50,_0x18c79c[_0x2951('0xcc')][_0x2951('0xdc')])));}}return{'date':moment(_0x18c79c['createdAt'])[_0x2951('0x5f')](_0x2951('0xb6'))[_0x2951('0x7f')](),'sender':_0x18c79c[_0x2951('0xe0')]===_0x2951('0xe1')?_0x18c79c[_0x2951('0xc6')]?_0x18c79c[_0x2951('0xc6')][_0x2951('0xc7')]:_0x2951('0xe2'):_0x18c79c[_0x2951('0xc9')][_0x2951('0xca')]+(_0x18c79c[_0x2951('0xc9')][_0x2951('0xcb')]?'\x20'+_0x18c79c['Contact'][_0x2951('0xcb')]:''),'body':_0x18c79c[_0x2951('0xcc')]?_0x18c79c[_0x2951('0xcc')]['basename']:_0x18c79c[_0x2951('0xae')],'direction':_0x18c79c[_0x2951('0xe0')]==='out'?'A':'C','secret':_0x18c79c[_0x2951('0xc5')],'attachment':_0x18c79c['Attachment']};})[_0x2951('0x63')]()};return ejs[_0x2951('0xe3')](path[_0x2951('0x80')](config[_0x2951('0xbf')],_0x2951('0xc0'),'views','downloadInteraction.html'),{'interaction':_0x50465b})[_0x2951('0x2a')](function(_0x5f3b0c){return new BPromise(function(_0x82804,_0x55f8df){pdf[_0x2951('0xad')](_0x5f3b0c,_0x2c4d9f)[_0x2951('0xe4')](path['join'](_0x3e5d50,_0x2951('0xe5')+_0x1a09fe['id']+'-'+_0x2268b5+_0x2951('0xe6')),function(_0x15e73c,_0x57c55f){if(_0x15e73c)return _0x55f8df(_0x15e73c);_0x82804(_0x57c55f);});});});}})[_0x2951('0x2a')](function(){if(_0x89f7fe){return new BPromise(function(_0x22948e,_0x170348){zipdir(_0x3e5d50,{'saveTo':_0x56b677},function(_0x4d09f9,_0x555be7){if(_0x4d09f9)return _0x170348(_0x4d09f9);return _0x22948e(_0x555be7);});})[_0x2951('0x2a')](function(){return new BPromise(function(_0x7cd3b0,_0x5d669f){rimraf(_0x3e5d50,function(_0x5e0660){if(_0x5e0660)_0x5d669f(_0x5e0660);return _0x7cd3b0();});});})[_0x2951('0x2a')](function(){return _0x3c1c94[_0x2951('0xbe')](_0x56b677,_0x4a33f1,function(_0x48abb2){if(_0x48abb2){console[_0x2951('0xe7')](_0x2951('0xe8'),_0x48abb2);}else{fs['unlinkSync'](_0x56b677);}});});}else{return _0x3c1c94[_0x2951('0x20')](0xc8);}})['catch'](handleError(_0x3c1c94,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index b5d71f5..02444d3 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 _0x9c9c=['remove','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x40170d,_0x471af4){var _0x178fd7=function(_0x2b73b3){while(--_0x2b73b3){_0x40170d['push'](_0x40170d['shift']());}};_0x178fd7(++_0x471af4);}(_0x9c9c,0x1e8));var _0xc9c9=function(_0x45aa18,_0x412fc5){_0x45aa18=_0x45aa18-0x0;var _0x26119d=_0x9c9c[_0x45aa18];return _0x26119d;};'use strict';var EventEmitter=require(_0xc9c9('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xc9c9('0x1'))['db'][_0xc9c9('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xc9c9('0x3')](0x0);var events={'afterCreate':_0xc9c9('0x4'),'afterUpdate':_0xc9c9('0x5'),'afterDestroy':_0xc9c9('0x6')};function emitEvent(_0x4639a2){return function(_0x25c207,_0x17bda6,_0x4d9996){_0x25c207['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1491ac){_0x25c207[_0xc9c9('0x7')](_0xc9c9('0x8'),_0x1491ac[_0xc9c9('0x9')](function(_0x2017bf){return{'id':_0x2017bf['id']};}));return OpenchannelMessage[_0xc9c9('0xa')]({'where':{'OpenchannelInteractionId':_0x25c207['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc9c9('0xb')](function(_0x242b5e){_0x25c207[_0xc9c9('0x7')](_0xc9c9('0xc'),_0x242b5e[_0xc9c9('0xd')]);OpenchannelInteractionEvents['emit'](_0x4639a2+':'+_0x25c207['id'],_0x25c207);OpenchannelInteractionEvents[_0xc9c9('0xe')](_0x4639a2,_0x25c207);_0x4d9996(null);})[_0xc9c9('0xf')](_0x4d9996(null));};}for(var e in events){if(events[_0xc9c9('0x10')](e)){var event=events[e];OpenchannelInteraction[_0xc9c9('0x11')](e,emitEvent(event));}}module[_0xc9c9('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x90bf=['setDataValue','Users','map','findAll','then','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','save','update','remove','getUsers'];(function(_0x3652c7,_0x39cf32){var _0x2443ba=function(_0x3ea35d){while(--_0x3ea35d){_0x3652c7['push'](_0x3652c7['shift']());}};_0x2443ba(++_0x39cf32);}(_0x90bf,0x174));var _0xf90b=function(_0x4c3679,_0x4f4f02){_0x4c3679=_0x4c3679-0x0;var _0x24f210=_0x90bf[_0x4c3679];return _0x24f210;};'use strict';var EventEmitter=require(_0xf90b('0x0'));var OpenchannelInteraction=require(_0xf90b('0x1'))['db'][_0xf90b('0x2')];var OpenchannelMessage=require(_0xf90b('0x1'))['db'][_0xf90b('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf90b('0x4'),'afterUpdate':_0xf90b('0x5'),'afterDestroy':_0xf90b('0x6')};function emitEvent(_0x5a11ba){return function(_0x44c9f1,_0x238400,_0x1e30b8){_0x44c9f1[_0xf90b('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x31c3f3){_0x44c9f1[_0xf90b('0x8')](_0xf90b('0x9'),_0x31c3f3[_0xf90b('0xa')](function(_0x455f4c){return{'id':_0x455f4c['id']};}));return OpenchannelMessage[_0xf90b('0xb')]({'where':{'OpenchannelInteractionId':_0x44c9f1['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf90b('0xc')](function(_0x2a63a9){_0x44c9f1['setDataValue'](_0xf90b('0xd'),_0x2a63a9['length']);OpenchannelInteractionEvents['emit'](_0x5a11ba+':'+_0x44c9f1['id'],_0x44c9f1);OpenchannelInteractionEvents[_0xf90b('0xe')](_0x5a11ba,_0x44c9f1);_0x1e30b8(null);})[_0xf90b('0xf')](_0x1e30b8(null));};}for(var e in events){if(events[_0xf90b('0x10')](e)){var event=events[e];OpenchannelInteraction[_0xf90b('0x11')](e,emitEvent(event));}}module[_0xf90b('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 5f5fb46..e445ece 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 _0x9957=['path','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x24f862,_0x4b645a){var _0x198aa4=function(_0x131195){while(--_0x131195){_0x24f862['push'](_0x24f862['shift']());}};_0x198aa4(++_0x4b645a);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x465276,_0x1cad37,_0x4a64f7){if(_0x465276[_0x7995('0xc')](_0x7995('0xd'))){_0x465276[_0x7995('0xe')]=moment()[_0x7995('0xf')](_0x7995('0x10'));}_0x4a64f7(null,_0x465276);}}});}; \ No newline at end of file +var _0xc4aa=['define','OpenchannelInteraction','openchannel_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./openchannelInteraction.attributes','exports'];(function(_0x54fd73,_0x1f224d){var _0x344793=function(_0x20d9be){while(--_0x20d9be){_0x54fd73['push'](_0x54fd73['shift']());}};_0x344793(++_0x1f224d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xc4aa[_0x4b055c];return _0x4b62bb;};'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':!![],'hooks':{'beforeUpdate':function(_0x5c6179,_0x5b8339,_0x1aba6d){if(_0x5c6179[_0xac4a('0xc')](_0xac4a('0xd'))){_0x5c6179['closedAt']=moment()[_0xac4a('0xe')](_0xac4a('0xf'));}_0x1aba6d(null,_0x5c6179);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 1795449..2a0a85c 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 _0x57ae=['catch','OpenchannelInteraction','find','where','addTags','ids','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelInteraction','update','body','options','raw','attributes','limit'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x57ae,0xda));var _0xe57a=function(_0x2a3000,_0x55b313){_0x2a3000=_0x2a3000-0x0;var _0x254139=_0x57ae[_0x2a3000];return _0x254139;};'use strict';var _=require('lodash');var util=require(_0xe57a('0x0'));var moment=require('moment');var BPromise=require(_0xe57a('0x1'));var rs=require(_0xe57a('0x2'));var fs=require('fs');var Redis=require(_0xe57a('0x3'));var db=require(_0xe57a('0x4'))['db'];var utils=require(_0xe57a('0x5'));var logger=require(_0xe57a('0x6'))('rpc');var config=require(_0xe57a('0x7'));var jayson=require(_0xe57a('0x8'));var client=jayson[_0xe57a('0x9')][_0xe57a('0xa')]({'port':0x232a});config['redis']=_[_0xe57a('0xb')](config[_0xe57a('0xc')],{'host':_0xe57a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe57a('0xc')]));require(_0xe57a('0xe'))['register'](socket);function respondWithRpcPromise(_0x2dfad6,_0x42aee6,_0x2a3081){return new BPromise(function(_0x241e75,_0x2168f1){return client[_0xe57a('0xf')](_0x2dfad6,_0x2a3081)[_0xe57a('0x10')](function(_0x313b71){logger[_0xe57a('0x11')](_0xe57a('0x12'),_0x42aee6,_0xe57a('0x13'));logger[_0xe57a('0x14')](_0xe57a('0x15'),_0x42aee6,_0xe57a('0x13'),JSON[_0xe57a('0x16')](_0x313b71));if(_0x313b71[_0xe57a('0x17')]){if(_0x313b71[_0xe57a('0x17')][_0xe57a('0x18')]===0x1f4){logger[_0xe57a('0x17')](_0xe57a('0x12'),_0x42aee6,_0x313b71['error']['message']);return _0x2168f1(_0x313b71[_0xe57a('0x17')][_0xe57a('0x19')]);}logger[_0xe57a('0x17')](_0xe57a('0x12'),_0x42aee6,_0x313b71[_0xe57a('0x17')][_0xe57a('0x19')]);return _0x241e75(_0x313b71['error'][_0xe57a('0x19')]);}else{logger[_0xe57a('0x11')](_0xe57a('0x12'),_0x42aee6,_0xe57a('0x13'));_0x241e75(_0x313b71[_0xe57a('0x1a')][_0xe57a('0x19')]);}})['catch'](function(_0x5bb25b){logger[_0xe57a('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x42aee6,_0x5bb25b);_0x2168f1(_0x5bb25b);});});}exports[_0xe57a('0x1b')]=function(_0x1d5376){var _0x45fa67=this;return new Promise(function(_0xdb68a0,_0x19d1cd){return db['OpenchannelInteraction'][_0xe57a('0x1c')](_0x1d5376[_0xe57a('0x1d')],{'raw':_0x1d5376[_0xe57a('0x1e')]?_0x1d5376['options'][_0xe57a('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d5376[_0xe57a('0x1e')]?_0x1d5376['options']['where']||null:null,'attributes':_0x1d5376[_0xe57a('0x1e')]?_0x1d5376['options'][_0xe57a('0x20')]||null:null,'limit':_0x1d5376['options']?_0x1d5376['options'][_0xe57a('0x21')]||null:null})[_0xe57a('0x10')](function(_0x5c7de6){logger[_0xe57a('0x11')](_0xe57a('0x1b'),_0x1d5376);logger[_0xe57a('0x14')]('UpdateOpenchannelInteraction',_0x1d5376,JSON['stringify'](_0x5c7de6));_0xdb68a0(_0x5c7de6);})[_0xe57a('0x22')](function(_0x2f4866){logger['error']('UpdateOpenchannelInteraction',_0x2f4866[_0xe57a('0x19')],_0x1d5376);_0x19d1cd(_0x45fa67['error'](0x1f4,_0x2f4866[_0xe57a('0x19')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x4d2733){return new Promise(function(_0x184aaf,_0xc58d1a){return db[_0xe57a('0x23')][_0xe57a('0x24')]({'where':_0x4d2733['options']?_0x4d2733[_0xe57a('0x1e')][_0xe57a('0x25')]||null:null})[_0xe57a('0x10')](function(_0x27db7e){if(_0x27db7e){return _0x27db7e[_0xe57a('0x26')](_0x4d2733[_0xe57a('0x1d')][_0xe57a('0x27')],_['omit'](_0x4d2733[_0xe57a('0x1d')],[_0xe57a('0x27'),'id'])||{});}})[_0xe57a('0x28')](function(_0x4de72f){logger[_0xe57a('0x11')](_0xe57a('0x29'),_0x4d2733);logger[_0xe57a('0x14')](_0xe57a('0x29'),_0x4d2733,JSON[_0xe57a('0x16')](_0x4de72f));_0x184aaf(_0x4de72f);})[_0xe57a('0x22')](function(_0xdc06b){logger['error'](_0xe57a('0x29'),_0xdc06b['message'],_0x4d2733);_0xc58d1a(_this[_0xe57a('0x17')](0x1f4,_0xdc06b['message']));});});}; \ No newline at end of file +var _0x4a2f=['redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','UpdateOpenchannelInteraction','update','options','where','attributes','limit','stringify','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','body','ids','omit','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x539fed,_0x430eb0){var _0x21df15=function(_0x5f5627){while(--_0x5f5627){_0x539fed['push'](_0x539fed['shift']());}};_0x21df15(++_0x430eb0);}(_0x4a2f,0x7d));var _0xf4a2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4a2f[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xf4a2('0x0'));var util=require('util');var moment=require(_0xf4a2('0x1'));var BPromise=require(_0xf4a2('0x2'));var rs=require(_0xf4a2('0x3'));var fs=require('fs');var Redis=require(_0xf4a2('0x4'));var db=require(_0xf4a2('0x5'))['db'];var utils=require(_0xf4a2('0x6'));var logger=require(_0xf4a2('0x7'))(_0xf4a2('0x8'));var config=require(_0xf4a2('0x9'));var jayson=require(_0xf4a2('0xa'));var client=jayson[_0xf4a2('0xb')][_0xf4a2('0xc')]({'port':0x232a});config[_0xf4a2('0xd')]=_[_0xf4a2('0xe')](config[_0xf4a2('0xd')],{'host':_0xf4a2('0xf'),'port':0x18eb});var socket=require(_0xf4a2('0x10'))(new Redis(config[_0xf4a2('0xd')]));require(_0xf4a2('0x11'))[_0xf4a2('0x12')](socket);function respondWithRpcPromise(_0x49e0da,_0x3a5cd8,_0x45ba74){return new BPromise(function(_0x136ad9,_0x4d5261){return client[_0xf4a2('0x13')](_0x49e0da,_0x45ba74)[_0xf4a2('0x14')](function(_0x53618f){logger['info'](_0xf4a2('0x15'),_0x3a5cd8,_0xf4a2('0x16'));logger[_0xf4a2('0x17')](_0xf4a2('0x18'),_0x3a5cd8,_0xf4a2('0x16'),JSON['stringify'](_0x53618f));if(_0x53618f['error']){if(_0x53618f[_0xf4a2('0x19')][_0xf4a2('0x1a')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x3a5cd8,_0x53618f[_0xf4a2('0x19')][_0xf4a2('0x1b')]);return _0x4d5261(_0x53618f[_0xf4a2('0x19')][_0xf4a2('0x1b')]);}logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x3a5cd8,_0x53618f[_0xf4a2('0x19')][_0xf4a2('0x1b')]);return _0x136ad9(_0x53618f['error']['message']);}else{logger[_0xf4a2('0x1c')](_0xf4a2('0x15'),_0x3a5cd8,_0xf4a2('0x16'));_0x136ad9(_0x53618f[_0xf4a2('0x1d')][_0xf4a2('0x1b')]);}})[_0xf4a2('0x1e')](function(_0x26bc58){logger[_0xf4a2('0x19')](_0xf4a2('0x15'),_0x3a5cd8,_0x26bc58);_0x4d5261(_0x26bc58);});});}exports[_0xf4a2('0x1f')]=function(_0x4c81fc){var _0x48be52=this;return new Promise(function(_0x49b537,_0x1ecc75){return db['OpenchannelInteraction'][_0xf4a2('0x20')](_0x4c81fc['body'],{'raw':_0x4c81fc['options']?_0x4c81fc[_0xf4a2('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c81fc[_0xf4a2('0x21')]?_0x4c81fc[_0xf4a2('0x21')][_0xf4a2('0x22')]||null:null,'attributes':_0x4c81fc[_0xf4a2('0x21')]?_0x4c81fc[_0xf4a2('0x21')][_0xf4a2('0x23')]||null:null,'limit':_0x4c81fc[_0xf4a2('0x21')]?_0x4c81fc[_0xf4a2('0x21')][_0xf4a2('0x24')]||null:null})[_0xf4a2('0x14')](function(_0x19ec75){logger[_0xf4a2('0x1c')](_0xf4a2('0x1f'),_0x4c81fc);logger['debug']('UpdateOpenchannelInteraction',_0x4c81fc,JSON[_0xf4a2('0x25')](_0x19ec75));_0x49b537(_0x19ec75);})[_0xf4a2('0x1e')](function(_0x237c3b){logger['error'](_0xf4a2('0x1f'),_0x237c3b[_0xf4a2('0x1b')],_0x4c81fc);_0x1ecc75(_0x48be52[_0xf4a2('0x19')](0x1f4,_0x237c3b['message']));});});};exports[_0xf4a2('0x26')]=function(_0x37de58){return new Promise(function(_0x4c879d,_0x45450a){return db[_0xf4a2('0x27')][_0xf4a2('0x28')]({'where':_0x37de58[_0xf4a2('0x21')]?_0x37de58[_0xf4a2('0x21')]['where']||null:null})['then'](function(_0x4b7fd1){if(_0x4b7fd1){return _0x4b7fd1[_0xf4a2('0x29')](_0x37de58[_0xf4a2('0x2a')][_0xf4a2('0x2b')],_[_0xf4a2('0x2c')](_0x37de58['body'],[_0xf4a2('0x2b'),'id'])||{});}})['spread'](function(_0x6be71e){logger[_0xf4a2('0x1c')]('AddTags',_0x37de58);logger[_0xf4a2('0x17')](_0xf4a2('0x2d'),_0x37de58,JSON['stringify'](_0x6be71e));_0x4c879d(_0x6be71e);})[_0xf4a2('0x1e')](function(_0xaebea9){logger[_0xf4a2('0x19')](_0xf4a2('0x2d'),_0xaebea9[_0xf4a2('0x1b')],_0x37de58);_0x45450a(_this[_0xf4a2('0x19')](0x1f4,_0xaebea9['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 35c89fe..aff1104 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 _0x4c62=['openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit','removeListener'];(function(_0x4b1525,_0x3341ff){var _0x1d77cb=function(_0x594377){while(--_0x594377){_0x4b1525['push'](_0x4b1525['shift']());}};_0x1d77cb(++_0x3341ff);}(_0x4c62,0x6a));var _0x24c6=function(_0x5883d3,_0x11f3c6){_0x5883d3=_0x5883d3-0x0;var _0x4f0bce=_0x4c62[_0x5883d3];return _0x4f0bce;};'use strict';var OpenchannelInteractionEvents=require(_0x24c6('0x0'));var events=[_0x24c6('0x1'),_0x24c6('0x2'),_0x24c6('0x3')];function createListener(_0x53bf69,_0x1bd68a){return function(_0x31a228){_0x1bd68a[_0x24c6('0x4')](_0x53bf69,_0x31a228);};}function removeListener(_0x2d882c,_0x1b65e9){return function(){OpenchannelInteractionEvents[_0x24c6('0x5')](_0x2d882c,_0x1b65e9);};}exports['register']=function(_0x32ef76){for(var _0x2a12f2=0x0,_0x58126e=events['length'];_0x2a12f2<_0x58126e;_0x2a12f2++){var _0x26cb59=events[_0x2a12f2];var _0x4d32c1=createListener(_0x24c6('0x6')+_0x26cb59,_0x32ef76);OpenchannelInteractionEvents['on'](_0x26cb59,_0x4d32c1);}}; \ No newline at end of file +var _0xab68=['./openchannelInteraction.events','save','update','length'];(function(_0x22e1bd,_0x4f025a){var _0x55d396=function(_0x19647a){while(--_0x19647a){_0x22e1bd['push'](_0x22e1bd['shift']());}};_0x55d396(++_0x4f025a);}(_0xab68,0xc4));var _0x8ab6=function(_0x344a20,_0x470729){_0x344a20=_0x344a20-0x0;var _0x2b2064=_0xab68[_0x344a20];return _0x2b2064;};'use strict';var OpenchannelInteractionEvents=require(_0x8ab6('0x0'));var events=[_0x8ab6('0x1'),'remove',_0x8ab6('0x2')];function createListener(_0x451d2e,_0x853c78){return function(_0x50fac9){_0x853c78['emit'](_0x451d2e,_0x50fac9);};}function removeListener(_0x2fdb8e,_0x5b962b){return function(){OpenchannelInteractionEvents['removeListener'](_0x2fdb8e,_0x5b962b);};}exports['register']=function(_0x2c9b3c){for(var _0x36227f=0x0,_0x2fbd22=events[_0x8ab6('0x3')];_0x36227f<_0x2fbd22;_0x36227f++){var _0x5f289f=events[_0x36227f];var _0x465abd=createListener('openchannelInteraction:'+_0x5f289f,_0x2c9b3c);OpenchannelInteractionEvents['on'](_0x5f289f,_0x465abd);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index f4d5637..d859233 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 _0x16dc=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','openchannel','openchannelmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x5d4aff,_0x4d58e9){var _0x28ef30=function(_0x3a5c03){while(--_0x3a5c03){_0x5d4aff['push'](_0x5d4aff['shift']());}};_0x28ef30(++_0x4d58e9);}(_0x16dc,0x1ef));var _0xc16d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x16dc[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xc16d('0x0'));var path=require(_0xc16d('0x1'));var timeout=require(_0xc16d('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xc16d('0x3'));var interaction=require(_0xc16d('0x4'));var config=require(_0xc16d('0x5'));var controller=require('./openchannelMessage.controller');router[_0xc16d('0x6')]('/',auth[_0xc16d('0x7')](),controller[_0xc16d('0x8')]);router[_0xc16d('0x6')](_0xc16d('0x9'),auth[_0xc16d('0x7')](),controller[_0xc16d('0xa')]);router['get'](_0xc16d('0xb'),auth[_0xc16d('0x7')](),controller[_0xc16d('0xc')]);router['post']('/',auth[_0xc16d('0x7')](),interaction[_0xc16d('0xd')](_0xc16d('0xe'),_0xc16d('0xf')),controller[_0xc16d('0x10')]);router[_0xc16d('0x11')]('/:id',auth[_0xc16d('0x7')](),controller[_0xc16d('0x12')]);router[_0xc16d('0x11')](_0xc16d('0x13'),auth[_0xc16d('0x7')](),controller[_0xc16d('0x14')]);router[_0xc16d('0x11')](_0xc16d('0x15'),auth[_0xc16d('0x7')](),controller['reject']);router[_0xc16d('0x16')](_0xc16d('0xb'),auth['isAuthenticated'](),controller[_0xc16d('0x17')]);module[_0xc16d('0x18')]=router; \ No newline at end of file +var _0x18bc=['put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','isAuthenticated','get','/describe','describe','/:id','post','openchannel','openchannelmessage:create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x18bc,0x166));var _0xc18b=function(_0x59ae8f,_0x148344){_0x59ae8f=_0x59ae8f-0x0;var _0x3900b5=_0x18bc[_0x59ae8f];return _0x3900b5;};'use strict';var multer=require(_0xc18b('0x0'));var util=require(_0xc18b('0x1'));var path=require(_0xc18b('0x2'));var timeout=require('connect-timeout');var express=require(_0xc18b('0x3'));var router=express[_0xc18b('0x4')]();var auth=require(_0xc18b('0x5'));var interaction=require(_0xc18b('0x6'));var config=require(_0xc18b('0x7'));var controller=require(_0xc18b('0x8'));router['get']('/',auth[_0xc18b('0x9')](),controller['index']);router[_0xc18b('0xa')](_0xc18b('0xb'),auth['isAuthenticated'](),controller[_0xc18b('0xc')]);router[_0xc18b('0xa')](_0xc18b('0xd'),auth[_0xc18b('0x9')](),controller['show']);router[_0xc18b('0xe')]('/',auth[_0xc18b('0x9')](),interaction['tracked'](_0xc18b('0xf'),_0xc18b('0x10')),controller['create']);router[_0xc18b('0x11')](_0xc18b('0xd'),auth[_0xc18b('0x9')](),controller[_0xc18b('0x12')]);router[_0xc18b('0x11')](_0xc18b('0x13'),auth[_0xc18b('0x9')](),controller[_0xc18b('0x14')]);router['put']('/:id/reject',auth[_0xc18b('0x9')](),controller[_0xc18b('0x15')]);router[_0xc18b('0x16')]('/:id',auth[_0xc18b('0x9')](),controller[_0xc18b('0x17')]);module[_0xc18b('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index d201c1a..265e409 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 _0x6538=['out','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x46b392,_0x59e8bd){var _0x30963a=function(_0xe26c37){while(--_0xe26c37){_0x46b392['push'](_0x46b392['shift']());}};_0x30963a(++_0x59e8bd);}(_0x6538,0x183));var _0x8653=function(_0x83af7f,_0x49c6fd){_0x83af7f=_0x83af7f-0x0;var _0x32d85c=_0x6538[_0x83af7f];return _0x32d85c;};'use strict';var Sequelize=require(_0x8653('0x0'));module['exports']={'body':{'type':Sequelize[_0x8653('0x1')](_0x8653('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8653('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x8653('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8653('0x4')]('in',_0x8653('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8653('0x6')]}}; \ No newline at end of file +var _0x2227=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x9d1721,_0x20bf33){var _0x14997a=function(_0x12f876){while(--_0x12f876){_0x9d1721['push'](_0x9d1721['shift']());}};_0x14997a(++_0x20bf33);}(_0x2227,0xee));var _0x7222=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x2227[_0x934425];return _0x31d596;};'use strict';var Sequelize=require(_0x7222('0x0'));module[_0x7222('0x1')]={'body':{'type':Sequelize[_0x7222('0x2')](_0x7222('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7222('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7222('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7222('0x5')]('in',_0x7222('0x6')),'defaultValue':_0x7222('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7222('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 446f4a2..71c904a 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 _0x271c=['apply','reject','save','update','destroy','stack','send','index','OpenchannelMessage','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','body','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','OpenchannelInteraction','isNil','read1stAt','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','name','null','manual','interface','channel','event','EventManager','acceptmessage','openchannel-interactions','agent','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SIP/%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./openchannelMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range'];(function(_0x3ad7ad,_0x291a8d){var _0x225a60=function(_0xca7354){while(--_0xca7354){_0x3ad7ad['push'](_0x3ad7ad['shift']());}};_0x225a60(++_0x291a8d);}(_0x271c,0x1b9));var _0xc271=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x271c[_0x21a9d9];return _0x46adce;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xc271('0x0'));var zipdir=require(_0xc271('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc271('0x2'));var moment=require(_0xc271('0x3'));var BPromise=require(_0xc271('0x4'));var Mustache=require(_0xc271('0x5'));var util=require('util');var path=require(_0xc271('0x6'));var sox=require('sox');var csv=require(_0xc271('0x7'));var ejs=require(_0xc271('0x8'));var fs=require('fs');var _=require(_0xc271('0x9'));var squel=require('squel');var crypto=require(_0xc271('0xa'));var jsforce=require(_0xc271('0xb'));var deskjs=require(_0xc271('0xc'));var toCsv=require(_0xc271('0x7'));var querystring=require(_0xc271('0xd'));var Papa=require('papaparse');var Redis=require(_0xc271('0xe'));var authService=require(_0xc271('0xf'));var qs=require(_0xc271('0x10'));var hardwareService=require(_0xc271('0x11'));var logger=require(_0xc271('0x12'))(_0xc271('0x13'));var utils=require('../../config/utils');var config=require(_0xc271('0x14'));var db=require(_0xc271('0x15'))['db'];config[_0xc271('0x16')]=_[_0xc271('0x17')](config[_0xc271('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc271('0x16')]));require(_0xc271('0x18'))[_0xc271('0x19')](socket);var jayson=require(_0xc271('0x1a'));var client=jayson[_0xc271('0x1b')][_0xc271('0x1c')]({'port':0x232c});var client9002=jayson[_0xc271('0x1b')][_0xc271('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x16f274,_0x30b8e4,_0x64f5ad){if(_0x64f5ad){var _0x383d87=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x383d87[_0xc271('0x1d')](_0x30b8e4)){return _0x16f274;}else{throw new Error(_0xc271('0x1e'));}}else{return _0x16f274;}}function respondWithRpcPromise(_0x17be79,_0xdc6fb9,_0x74466b,_0x4c0d27){return new BPromise(function(_0x5a7173,_0x50faf8){var _0x367a3e=_0x4c0d27||client;return _0x367a3e[_0xc271('0x1f')](_0x17be79,_0x74466b)[_0xc271('0x20')](function(_0x499318){logger[_0xc271('0x21')](_0xc271('0x22'),_0xdc6fb9,_0xc271('0x23'));logger[_0xc271('0x24')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0xdc6fb9,'request\x20sent',JSON[_0xc271('0x25')](_0x499318));if(_0x499318[_0xc271('0x26')]){if(_0x499318[_0xc271('0x26')][_0xc271('0x27')]===0x1f4){logger[_0xc271('0x26')](_0xc271('0x22'),_0xdc6fb9,_0x499318[_0xc271('0x26')][_0xc271('0x28')]);return _0x50faf8(_0x499318['error'][_0xc271('0x28')]);}logger[_0xc271('0x26')](_0xc271('0x22'),_0xdc6fb9,_0x499318[_0xc271('0x26')][_0xc271('0x28')]);return _0x5a7173(_0x499318[_0xc271('0x26')]['message']);}else{logger[_0xc271('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0xdc6fb9,_0xc271('0x23'));_0x5a7173(_0x499318[_0xc271('0x29')][_0xc271('0x28')]);}})['catch'](function(_0x18bc8f){logger['error'](_0xc271('0x22'),_0xdc6fb9,_0x18bc8f);_0x50faf8(_0x18bc8f);});});}function respondWithStatusCode(_0x62777e,_0x5289ea){_0x5289ea=_0x5289ea||0xcc;return function(_0x4654e8){if(_0x4654e8){return _0x62777e[_0xc271('0x2a')](_0x5289ea);}return _0x62777e[_0xc271('0x2b')](_0x5289ea)[_0xc271('0x2c')]();};}function respondWithResult(_0x21cc25,_0x962277){_0x962277=_0x962277||0xc8;return function(_0x354478){if(_0x354478){return _0x21cc25[_0xc271('0x2b')](_0x962277)[_0xc271('0x2d')](_0x354478);}};}function respondWithFilteredResult(_0x413134,_0x2eaece){return function(_0x26e56d){if(_0x26e56d){var _0x2d226a=_0x26e56d[_0xc271('0x2e')],_0x4fd371=_0x2eaece[_0xc271('0x2f')],_0x5df052=_0x2eaece[_0xc271('0x2f')]+_0x2eaece[_0xc271('0x30')],_0x24ebcf;if(_0x5df052>=_0x2d226a){_0x5df052=_0x2d226a;_0x24ebcf=0xc8;}else{_0x24ebcf=0xce;}_0x413134[_0xc271('0x2b')](_0x24ebcf);return _0x413134[_0xc271('0x31')](_0xc271('0x32'),_0x4fd371+'-'+_0x5df052+'/'+_0x2d226a)[_0xc271('0x2d')](_0x26e56d);}return null;};}function patchUpdates(_0x19b47b){return function(_0x572fbc){try{jsonpatch[_0xc271('0x33')](_0x572fbc,_0x19b47b,!![]);}catch(_0xabe5d6){return BPromise[_0xc271('0x34')](_0xabe5d6);}return _0x572fbc[_0xc271('0x35')]();};}function saveUpdates(_0x3359c0,_0x132d92){return function(_0x2f246b){if(_0x2f246b){return _0x2f246b[_0xc271('0x36')](_0x3359c0)[_0xc271('0x20')](function(_0x363851){return _0x363851;});}return null;};}function removeEntity(_0x24a15a,_0x27b26a){return function(_0x12771d){if(_0x12771d){return _0x12771d[_0xc271('0x37')]()['then'](function(){_0x24a15a['status'](0xcc)[_0xc271('0x2c')]();});}};}function handleEntityNotFound(_0x5d5313,_0x1d5695){return function(_0x485147){if(!_0x485147){_0x5d5313['sendStatus'](0x194);}return _0x485147;};}function handleError(_0x3ffaae,_0x4114a9){_0x4114a9=_0x4114a9||0x1f4;return function(_0x13df57){logger[_0xc271('0x26')](_0x13df57[_0xc271('0x38')]);if(_0x13df57['name']){delete _0x13df57['name'];}_0x3ffaae[_0xc271('0x2b')](_0x4114a9)[_0xc271('0x39')](_0x13df57);};}exports[_0xc271('0x3a')]=function(_0x53a7f9,_0x34193a){var _0x4a8c03={},_0x23272e={},_0x2c1d66={'count':0x0,'rows':[]};var _0x50eaad=db[_0xc271('0x3b')]['rawAttributes'];_0x23272e[_0xc271('0x3c')]=_[_0xc271('0x3d')](_0x50eaad);_0x23272e[_0xc271('0x3e')]=_[_0xc271('0x3d')](_0x53a7f9[_0xc271('0x3e')]);_0x23272e[_0xc271('0x3f')]=_[_0xc271('0x40')](_0x23272e[_0xc271('0x3c')],_0x23272e[_0xc271('0x3e')]);_0x4a8c03[_0xc271('0x41')]=_[_0xc271('0x40')](_0x23272e[_0xc271('0x3c')],qs[_0xc271('0x42')](_0x53a7f9['query']['fields']));_0x4a8c03[_0xc271('0x41')]=_0x4a8c03[_0xc271('0x41')][_0xc271('0x43')]?_0x4a8c03[_0xc271('0x41')]:_0x23272e['model'];if(!_0x53a7f9[_0xc271('0x3e')][_0xc271('0x44')](_0xc271('0x45'))){_0x4a8c03[_0xc271('0x30')]=qs[_0xc271('0x30')](_0x53a7f9[_0xc271('0x3e')][_0xc271('0x30')]);_0x4a8c03[_0xc271('0x2f')]=qs[_0xc271('0x2f')](_0x53a7f9[_0xc271('0x3e')][_0xc271('0x2f')]);}_0x4a8c03['order']=qs[_0xc271('0x46')](_0x53a7f9[_0xc271('0x3e')]['sort']);_0x4a8c03[_0xc271('0x47')]=qs[_0xc271('0x3f')](_[_0xc271('0x48')](_0x53a7f9[_0xc271('0x3e')],_0x23272e[_0xc271('0x3f')]));if(_0x53a7f9['query'][_0xc271('0x49')]){_0x4a8c03[_0xc271('0x47')]=_[_0xc271('0x4a')](_0x4a8c03[_0xc271('0x47')],{'$or':_[_0xc271('0x4b')](_0x50eaad,function(_0x54ed96){if(_0x54ed96[_0xc271('0x4c')][_0xc271('0x4d')]!==_0xc271('0x4e')){var _0x769f68={};_0x769f68[_0x54ed96[_0xc271('0x4f')]]={'$like':'%'+_0x53a7f9[_0xc271('0x3e')]['filter']+'%'};return _0x769f68;}})});}_0x4a8c03=_[_0xc271('0x4a')]({},_0x4a8c03,_0x53a7f9[_0xc271('0x50')]);var _0x13d04a={'where':_0x4a8c03[_0xc271('0x47')]};return db[_0xc271('0x3b')][_0xc271('0x2e')](_0x13d04a)[_0xc271('0x20')](function(_0x3bb0e5){_0x2c1d66[_0xc271('0x2e')]=_0x3bb0e5;if(_0x53a7f9[_0xc271('0x3e')][_0xc271('0x51')]){_0x4a8c03['include']=[{'all':!![]}];}return db[_0xc271('0x3b')][_0xc271('0x52')](_0x4a8c03);})[_0xc271('0x20')](function(_0x30e7a3){_0x2c1d66[_0xc271('0x53')]=_0x30e7a3;return _0x2c1d66;})[_0xc271('0x20')](respondWithFilteredResult(_0x34193a,_0x4a8c03))['catch'](handleError(_0x34193a,null));};exports[_0xc271('0x54')]=function(_0x3b2a3a,_0x101cd1){var _0x123efa={'raw':!![],'where':{'id':_0x3b2a3a[_0xc271('0x55')]['id']}},_0x56a425={};_0x56a425['model']=_['keys'](db[_0xc271('0x3b')][_0xc271('0x56')]);_0x56a425['query']=_[_0xc271('0x3d')](_0x3b2a3a['query']);_0x56a425[_0xc271('0x3f')]=_[_0xc271('0x40')](_0x56a425['model'],_0x56a425['query']);_0x123efa[_0xc271('0x41')]=_[_0xc271('0x40')](_0x56a425['model'],qs['fields'](_0x3b2a3a[_0xc271('0x3e')][_0xc271('0x42')]));_0x123efa[_0xc271('0x41')]=_0x123efa[_0xc271('0x41')][_0xc271('0x43')]?_0x123efa[_0xc271('0x41')]:_0x56a425[_0xc271('0x3c')];if(_0x3b2a3a[_0xc271('0x3e')][_0xc271('0x51')]){_0x123efa[_0xc271('0x57')]=[{'all':!![]}];}_0x123efa=_[_0xc271('0x4a')]({},_0x123efa,_0x3b2a3a[_0xc271('0x50')]);return db[_0xc271('0x3b')][_0xc271('0x58')](_0x123efa)[_0xc271('0x20')](handleEntityNotFound(_0x101cd1,null))[_0xc271('0x20')](respondWithResult(_0x101cd1,null))[_0xc271('0x59')](handleError(_0x101cd1,null));};exports['create']=function(_0x458db7,_0xde35ae){return db['OpenchannelMessage'][_0xc271('0x5a')](_0x458db7[_0xc271('0x5b')],{})['then'](respondWithResult(_0xde35ae,0xc9))[_0xc271('0x59')](handleError(_0xde35ae,null));};exports[_0xc271('0x36')]=function(_0x10b286,_0x1a747f){if(_0x10b286['body']['id']){delete _0x10b286[_0xc271('0x5b')]['id'];}return db[_0xc271('0x3b')][_0xc271('0x58')]({'where':{'id':_0x10b286[_0xc271('0x55')]['id']}})[_0xc271('0x20')](handleEntityNotFound(_0x1a747f,null))['then'](saveUpdates(_0x10b286['body'],null))['then'](respondWithResult(_0x1a747f,null))[_0xc271('0x59')](handleError(_0x1a747f,null));};exports[_0xc271('0x37')]=function(_0x44f1f3,_0x29a606){return db['OpenchannelMessage']['find']({'where':{'id':_0x44f1f3[_0xc271('0x55')]['id']}})[_0xc271('0x20')](handleEntityNotFound(_0x29a606,null))[_0xc271('0x20')](removeEntity(_0x29a606,null))['catch'](handleError(_0x29a606,null));};exports['describe']=function(_0x55d89a,_0xeaeb64){return db['OpenchannelMessage']['describe']()[_0xc271('0x20')](respondWithResult(_0xeaeb64,null))[_0xc271('0x59')](handleError(_0xeaeb64,null));};var interaction_log=require(_0xc271('0x12'))('openchannel-interactions');exports[_0xc271('0x5c')]=function(_0x4cf4ff,_0x4df8a5,_0xe2dc45){var _0x364f66={'channel':_0xc271('0x5d')};if(_0x4cf4ff[_0xc271('0x5b')]['id']){delete _0x4cf4ff[_0xc271('0x5b')]['id'];}_0x4cf4ff['body'][_0xc271('0x5e')]=!![];_0x4cf4ff[_0xc271('0x5b')][_0xc271('0x5f')]=moment()[_0xc271('0x60')](_0xc271('0x61'));_0x4cf4ff[_0xc271('0x5b')][_0xc271('0x62')]=_0x4cf4ff[_0xc271('0x5b')][_0xc271('0x62')]||_0x4cf4ff['user']['id'];return db[_0xc271('0x3b')][_0xc271('0x58')]({'where':{'id':_0x4cf4ff[_0xc271('0x55')]['id'],'UserId':null},'include':[{'model':db[_0xc271('0x63')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x4df8a5,null))[_0xc271('0x20')](saveUpdates(_0x4cf4ff[_0xc271('0x5b')],null))['then'](function(_0xb4dbf1){if(_0xb4dbf1){_0x364f66['message']=_0xb4dbf1['get']({'plain':!![]});return db[_0xc271('0x64')][_0xc271('0x58')]({'where':{'id':_0xb4dbf1['OpenchannelInteractionId']}});}return null;})[_0xc271('0x20')](handleEntityNotFound(_0x4df8a5,null))[_0xc271('0x20')](function(_0x4eb3aa){if(_0x4eb3aa){return _0x4eb3aa['update']({'UserId':_0x4cf4ff[_0xc271('0x5b')][_0xc271('0x62')],'read1stAt':_[_0xc271('0x65')](_0x4eb3aa[_0xc271('0x66')])?moment()[_0xc271('0x60')](_0xc271('0x61')):undefined});}return null;})[_0xc271('0x20')](function(_0xb98ee3){if(_0xb98ee3){_0x364f66[_0xc271('0x67')]=_0xb98ee3[_0xc271('0x68')]({'plain':!![]});interaction_log[_0xc271('0x21')](_0xc271('0x69'),_0x4cf4ff[_0xc271('0x6a')]['id'],_0x4cf4ff[_0xc271('0x6a')][_0xc271('0x6b')],_0x4cf4ff[_0xc271('0x6a')]['role'],_0x364f66[_0xc271('0x67')]['id'],_0x4cf4ff[_0xc271('0x5b')]?JSON[_0xc271('0x25')](_0x4cf4ff[_0xc271('0x5b')]):_0xc271('0x6c'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x364f66);}return null;})[_0xc271('0x20')](function(_0x2b98e8){if(_0x2b98e8){if(_0x4cf4ff[_0xc271('0x5b')][_0xc271('0x6d')]){_0x364f66['message'][_0xc271('0x6e')]=util[_0xc271('0x60')]('SIP/%s',_0x4cf4ff[_0xc271('0x6a')]['name']);_0x364f66['message']['channel']=_0x364f66[_0xc271('0x6f')];_0x364f66[_0xc271('0x28')][_0xc271('0x70')]='accept';return respondWithRpcPromise('EventManager',_0xc271('0x71'),{'event':_0xc271('0x72'),'message':_0x364f66[_0xc271('0x28')]},client9002)[_0xc271('0x20')](function(){return _0x364f66;});}return _0x364f66;}return null;})[_0xc271('0x20')](respondWithResult(_0x4df8a5,null))[_0xc271('0x59')](handleError(_0x4df8a5,null));};var interaction_log=require(_0xc271('0x12'))(_0xc271('0x73'));exports[_0xc271('0x34')]=function(_0x337e8c,_0x5a0412,_0x24d60f){var _0x4b9874={'agent':{},'channel':_0xc271('0x5d')};if(_0x337e8c[_0xc271('0x5b')]['id']){delete _0x337e8c['body']['id'];}_0x337e8c[_0xc271('0x5b')][_0xc271('0x62')]=_0x337e8c['body'][_0xc271('0x62')]||_0x337e8c['user']['id'];_0x4b9874[_0xc271('0x74')]['id']=_0x337e8c['body'][_0xc271('0x62')];return db[_0xc271('0x3b')][_0xc271('0x58')]({'where':{'id':_0x337e8c[_0xc271('0x55')]['id'],'UserId':null}})[_0xc271('0x20')](handleEntityNotFound(_0x5a0412,null))[_0xc271('0x20')](function(_0x14f604){if(_0x14f604){_0x4b9874[_0xc271('0x28')]=_0x14f604[_0xc271('0x68')]({'plain':!![]});return db['OpenchannelInteraction'][_0xc271('0x58')]({'where':{'id':_0x14f604[_0xc271('0x75')]}});}return null;})['then'](handleEntityNotFound(_0x5a0412,null))[_0xc271('0x20')](function(_0x433acd){if(_0x433acd){_0x4b9874['interaction']=_0x433acd[_0xc271('0x68')]({'plain':!![]});interaction_log[_0xc271('0x21')](_0xc271('0x76'),_0x337e8c[_0xc271('0x6a')]['id'],_0x337e8c[_0xc271('0x6a')][_0xc271('0x6b')],_0x337e8c['user'][_0xc271('0x77')],_0x4b9874[_0xc271('0x67')]['id'],_0x337e8c['body']?JSON[_0xc271('0x25')](_0x337e8c['body']):_0xc271('0x6c'));return respondWithRpcPromise(_0xc271('0x78'),_0xc271('0x79'),_0x4b9874);}return null;})['then'](function(_0x4d68f4){if(_0x4d68f4){_0x4d68f4['message'][_0xc271('0x6e')]=util['format'](_0xc271('0x7a'),_0x337e8c[_0xc271('0x6a')][_0xc271('0x6b')]);_0x4d68f4[_0xc271('0x28')][_0xc271('0x6f')]=_0x4b9874[_0xc271('0x6f')];_0x4d68f4[_0xc271('0x28')][_0xc271('0x70')]=_0xc271('0x34');respondWithRpcPromise(_0xc271('0x71'),_0xc271('0x71'),{'event':'rejectmessage','message':_0x4d68f4[_0xc271('0x28')]},client9002);return _0x4b9874;}return null;})['then'](respondWithResult(_0x5a0412,null))['catch'](handleError(_0x5a0412,null));}; \ No newline at end of file +var _0x443e=['request\x20sent','stringify','error','message','status','end','count','offset','limit','set','json','save','update','then','destroy','sendStatus','stack','name','send','index','OpenchannelMessage','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','create','body','params','find','describe','../../config/logger','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','isNil','read1stAt','format','interaction','user','role','manual','interface','channel','event','EventManager','openchannel-interactions','reject','agent','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','http','test','request','info','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x171bb3,_0x3f7d86){var _0x3f48e7=function(_0x40fc28){while(--_0x40fc28){_0x171bb3['push'](_0x171bb3['shift']());}};_0x3f48e7(++_0x3f7d86);}(_0x443e,0xbf));var _0xe443=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0x443e[_0x528575];return _0x3063b7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe443('0x0'));var rimraf=require(_0xe443('0x1'));var zipdir=require(_0xe443('0x2'));var jsonpatch=require(_0xe443('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe443('0x4'));var util=require(_0xe443('0x5'));var path=require(_0xe443('0x6'));var sox=require(_0xe443('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe443('0x8'));var crypto=require(_0xe443('0x9'));var jsforce=require(_0xe443('0xa'));var deskjs=require(_0xe443('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe443('0xc'));var Papa=require('papaparse');var Redis=require(_0xe443('0xd'));var authService=require(_0xe443('0xe'));var qs=require(_0xe443('0xf'));var hardwareService=require(_0xe443('0x10'));var logger=require('../../config/logger')(_0xe443('0x11'));var utils=require(_0xe443('0x12'));var config=require(_0xe443('0x13'));var db=require(_0xe443('0x14'))['db'];config[_0xe443('0x15')]=_[_0xe443('0x16')](config['redis'],{'host':_0xe443('0x17'),'port':0x18eb});var socket=require(_0xe443('0x18'))(new Redis(config[_0xe443('0x15')]));require('./openchannelMessage.socket')[_0xe443('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xe443('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0xe443('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xbc2a53,_0x32ae88,_0xdd8ae6){if(_0xdd8ae6){var _0x584f4e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x584f4e[_0xe443('0x1b')](_0x32ae88)){return _0xbc2a53;}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 _0xbc2a53;}}function respondWithRpcPromise(_0x3e1fe5,_0x2475b0,_0x39ea66,_0x25eb54){return new BPromise(function(_0x2053c3,_0x22705b){var _0x4b0e06=_0x25eb54||client;return _0x4b0e06[_0xe443('0x1c')](_0x3e1fe5,_0x39ea66)['then'](function(_0xb43657){logger[_0xe443('0x1d')](_0xe443('0x1e'),_0x2475b0,_0xe443('0x1f'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x2475b0,'request\x20sent',JSON[_0xe443('0x20')](_0xb43657));if(_0xb43657[_0xe443('0x21')]){if(_0xb43657['error']['code']===0x1f4){logger[_0xe443('0x21')](_0xe443('0x1e'),_0x2475b0,_0xb43657['error']['message']);return _0x22705b(_0xb43657['error'][_0xe443('0x22')]);}logger[_0xe443('0x21')](_0xe443('0x1e'),_0x2475b0,_0xb43657[_0xe443('0x21')]['message']);return _0x2053c3(_0xb43657[_0xe443('0x21')][_0xe443('0x22')]);}else{logger[_0xe443('0x1d')]('OpenchannelMessage,\x20%s,\x20%s',_0x2475b0,_0xe443('0x1f'));_0x2053c3(_0xb43657['result']['message']);}})['catch'](function(_0x18f274){logger[_0xe443('0x21')](_0xe443('0x1e'),_0x2475b0,_0x18f274);_0x22705b(_0x18f274);});});}function respondWithStatusCode(_0x4e9d5c,_0x1465e1){_0x1465e1=_0x1465e1||0xcc;return function(_0x24bd94){if(_0x24bd94){return _0x4e9d5c['sendStatus'](_0x1465e1);}return _0x4e9d5c[_0xe443('0x23')](_0x1465e1)[_0xe443('0x24')]();};}function respondWithResult(_0x13d3c1,_0x396bc8){_0x396bc8=_0x396bc8||0xc8;return function(_0x373096){if(_0x373096){return _0x13d3c1[_0xe443('0x23')](_0x396bc8)['json'](_0x373096);}};}function respondWithFilteredResult(_0x8ea0f6,_0x163c13){return function(_0x43d685){if(_0x43d685){var _0x217f36=_0x43d685[_0xe443('0x25')],_0x1154f3=_0x163c13[_0xe443('0x26')],_0x5943a0=_0x163c13[_0xe443('0x26')]+_0x163c13[_0xe443('0x27')],_0x1d59ee;if(_0x5943a0>=_0x217f36){_0x5943a0=_0x217f36;_0x1d59ee=0xc8;}else{_0x1d59ee=0xce;}_0x8ea0f6['status'](_0x1d59ee);return _0x8ea0f6[_0xe443('0x28')]('Content-Range',_0x1154f3+'-'+_0x5943a0+'/'+_0x217f36)[_0xe443('0x29')](_0x43d685);}return null;};}function patchUpdates(_0x31e220){return function(_0x188ccf){try{jsonpatch['apply'](_0x188ccf,_0x31e220,!![]);}catch(_0x3253bf){return BPromise['reject'](_0x3253bf);}return _0x188ccf[_0xe443('0x2a')]();};}function saveUpdates(_0x316638,_0x3e6026){return function(_0x362c66){if(_0x362c66){return _0x362c66[_0xe443('0x2b')](_0x316638)[_0xe443('0x2c')](function(_0x4c3f74){return _0x4c3f74;});}return null;};}function removeEntity(_0x24ef00,_0x36c15f){return function(_0x22ff75){if(_0x22ff75){return _0x22ff75[_0xe443('0x2d')]()[_0xe443('0x2c')](function(){_0x24ef00[_0xe443('0x23')](0xcc)[_0xe443('0x24')]();});}};}function handleEntityNotFound(_0xc88583,_0x11127a){return function(_0xbf7b5e){if(!_0xbf7b5e){_0xc88583[_0xe443('0x2e')](0x194);}return _0xbf7b5e;};}function handleError(_0x12da52,_0x24f69e){_0x24f69e=_0x24f69e||0x1f4;return function(_0x3a355f){logger[_0xe443('0x21')](_0x3a355f[_0xe443('0x2f')]);if(_0x3a355f[_0xe443('0x30')]){delete _0x3a355f[_0xe443('0x30')];}_0x12da52['status'](_0x24f69e)[_0xe443('0x31')](_0x3a355f);};}exports[_0xe443('0x32')]=function(_0x2635dc,_0x1d1fdf){var _0x2de244={},_0x5bce59={},_0x5e8822={'count':0x0,'rows':[]};var _0x16916c=db[_0xe443('0x33')][_0xe443('0x34')];_0x5bce59[_0xe443('0x35')]=_[_0xe443('0x36')](_0x16916c);_0x5bce59[_0xe443('0x37')]=_[_0xe443('0x36')](_0x2635dc[_0xe443('0x37')]);_0x5bce59['filters']=_['intersection'](_0x5bce59['model'],_0x5bce59[_0xe443('0x37')]);_0x2de244[_0xe443('0x38')]=_[_0xe443('0x39')](_0x5bce59[_0xe443('0x35')],qs['fields'](_0x2635dc[_0xe443('0x37')][_0xe443('0x3a')]));_0x2de244[_0xe443('0x38')]=_0x2de244['attributes'][_0xe443('0x3b')]?_0x2de244[_0xe443('0x38')]:_0x5bce59[_0xe443('0x35')];if(!_0x2635dc['query'][_0xe443('0x3c')](_0xe443('0x3d'))){_0x2de244[_0xe443('0x27')]=qs[_0xe443('0x27')](_0x2635dc[_0xe443('0x37')]['limit']);_0x2de244[_0xe443('0x26')]=qs['offset'](_0x2635dc['query'][_0xe443('0x26')]);}_0x2de244[_0xe443('0x3e')]=qs[_0xe443('0x3f')](_0x2635dc[_0xe443('0x37')][_0xe443('0x3f')]);_0x2de244[_0xe443('0x40')]=qs[_0xe443('0x41')](_[_0xe443('0x42')](_0x2635dc['query'],_0x5bce59[_0xe443('0x41')]));if(_0x2635dc[_0xe443('0x37')]['filter']){_0x2de244[_0xe443('0x40')]=_[_0xe443('0x43')](_0x2de244['where'],{'$or':_['map'](_0x16916c,function(_0x4fa440){if(_0x4fa440[_0xe443('0x44')]['key']!==_0xe443('0x45')){var _0x1f8202={};_0x1f8202[_0x4fa440['field']]={'$like':'%'+_0x2635dc['query']['filter']+'%'};return _0x1f8202;}})});}_0x2de244=_['merge']({},_0x2de244,_0x2635dc[_0xe443('0x46')]);var _0x223e20={'where':_0x2de244[_0xe443('0x40')]};return db['OpenchannelMessage'][_0xe443('0x25')](_0x223e20)[_0xe443('0x2c')](function(_0x569115){_0x5e8822[_0xe443('0x25')]=_0x569115;if(_0x2635dc[_0xe443('0x37')][_0xe443('0x47')]){_0x2de244[_0xe443('0x48')]=[{'all':!![]}];}return db[_0xe443('0x33')]['findAll'](_0x2de244);})[_0xe443('0x2c')](function(_0x2cea66){_0x5e8822[_0xe443('0x49')]=_0x2cea66;return _0x5e8822;})[_0xe443('0x2c')](respondWithFilteredResult(_0x1d1fdf,_0x2de244))[_0xe443('0x4a')](handleError(_0x1d1fdf,null));};exports[_0xe443('0x4b')]=function(_0x571997,_0x55a25f){var _0x25339b={'raw':!![],'where':{'id':_0x571997['params']['id']}},_0x51192d={};_0x51192d['model']=_[_0xe443('0x36')](db['OpenchannelMessage']['rawAttributes']);_0x51192d[_0xe443('0x37')]=_['keys'](_0x571997['query']);_0x51192d[_0xe443('0x41')]=_[_0xe443('0x39')](_0x51192d[_0xe443('0x35')],_0x51192d[_0xe443('0x37')]);_0x25339b['attributes']=_[_0xe443('0x39')](_0x51192d[_0xe443('0x35')],qs[_0xe443('0x3a')](_0x571997[_0xe443('0x37')][_0xe443('0x3a')]));_0x25339b[_0xe443('0x38')]=_0x25339b['attributes'][_0xe443('0x3b')]?_0x25339b[_0xe443('0x38')]:_0x51192d[_0xe443('0x35')];if(_0x571997['query'][_0xe443('0x47')]){_0x25339b['include']=[{'all':!![]}];}_0x25339b=_[_0xe443('0x43')]({},_0x25339b,_0x571997[_0xe443('0x46')]);return db[_0xe443('0x33')]['find'](_0x25339b)[_0xe443('0x2c')](handleEntityNotFound(_0x55a25f,null))[_0xe443('0x2c')](respondWithResult(_0x55a25f,null))[_0xe443('0x4a')](handleError(_0x55a25f,null));};exports[_0xe443('0x4c')]=function(_0xb915c2,_0x93f98f){return db[_0xe443('0x33')][_0xe443('0x4c')](_0xb915c2[_0xe443('0x4d')],{})[_0xe443('0x2c')](respondWithResult(_0x93f98f,0xc9))[_0xe443('0x4a')](handleError(_0x93f98f,null));};exports[_0xe443('0x2b')]=function(_0x256a5c,_0x12f129){if(_0x256a5c[_0xe443('0x4d')]['id']){delete _0x256a5c[_0xe443('0x4d')]['id'];}return db[_0xe443('0x33')]['find']({'where':{'id':_0x256a5c[_0xe443('0x4e')]['id']}})[_0xe443('0x2c')](handleEntityNotFound(_0x12f129,null))['then'](saveUpdates(_0x256a5c['body'],null))[_0xe443('0x2c')](respondWithResult(_0x12f129,null))[_0xe443('0x4a')](handleError(_0x12f129,null));};exports[_0xe443('0x2d')]=function(_0x3ce834,_0x2214b8){return db[_0xe443('0x33')][_0xe443('0x4f')]({'where':{'id':_0x3ce834[_0xe443('0x4e')]['id']}})[_0xe443('0x2c')](handleEntityNotFound(_0x2214b8,null))[_0xe443('0x2c')](removeEntity(_0x2214b8,null))['catch'](handleError(_0x2214b8,null));};exports[_0xe443('0x50')]=function(_0x25da8c,_0x4ffa36){return db['OpenchannelMessage'][_0xe443('0x50')]()[_0xe443('0x2c')](respondWithResult(_0x4ffa36,null))[_0xe443('0x4a')](handleError(_0x4ffa36,null));};var interaction_log=require(_0xe443('0x51'))('openchannel-interactions');exports[_0xe443('0x52')]=function(_0x10247c,_0xb4163b,_0x4ffd66){var _0x2bf9f9={'channel':_0xe443('0x53')};if(_0x10247c[_0xe443('0x4d')]['id']){delete _0x10247c['body']['id'];}_0x10247c[_0xe443('0x4d')][_0xe443('0x54')]=!![];_0x10247c[_0xe443('0x4d')][_0xe443('0x55')]=moment()['format'](_0xe443('0x56'));_0x10247c[_0xe443('0x4d')][_0xe443('0x57')]=_0x10247c['body'][_0xe443('0x57')]||_0x10247c['user']['id'];return db[_0xe443('0x33')]['find']({'where':{'id':_0x10247c[_0xe443('0x4e')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xe443('0x58')}]})['then'](handleEntityNotFound(_0xb4163b,null))[_0xe443('0x2c')](saveUpdates(_0x10247c[_0xe443('0x4d')],null))[_0xe443('0x2c')](function(_0x3ec8d4){if(_0x3ec8d4){_0x2bf9f9['message']=_0x3ec8d4[_0xe443('0x59')]({'plain':!![]});return db['OpenchannelInteraction'][_0xe443('0x4f')]({'where':{'id':_0x3ec8d4['OpenchannelInteractionId']}});}return null;})[_0xe443('0x2c')](handleEntityNotFound(_0xb4163b,null))[_0xe443('0x2c')](function(_0x52c7c1){if(_0x52c7c1){return _0x52c7c1[_0xe443('0x2b')]({'UserId':_0x10247c['body'][_0xe443('0x57')],'read1stAt':_[_0xe443('0x5a')](_0x52c7c1[_0xe443('0x5b')])?moment()[_0xe443('0x5c')](_0xe443('0x56')):undefined});}return null;})[_0xe443('0x2c')](function(_0x73ebfa){if(_0x73ebfa){_0x2bf9f9[_0xe443('0x5d')]=_0x73ebfa[_0xe443('0x59')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x10247c[_0xe443('0x5e')]['id'],_0x10247c['user'][_0xe443('0x30')],_0x10247c[_0xe443('0x5e')][_0xe443('0x5f')],_0x2bf9f9[_0xe443('0x5d')]['id'],_0x10247c[_0xe443('0x4d')]?JSON[_0xe443('0x20')](_0x10247c[_0xe443('0x4d')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x2bf9f9);}return null;})['then'](function(_0x59d94a){if(_0x59d94a){if(_0x10247c[_0xe443('0x4d')][_0xe443('0x60')]){_0x2bf9f9['message'][_0xe443('0x61')]=util['format']('SIP/%s',_0x10247c[_0xe443('0x5e')][_0xe443('0x30')]);_0x2bf9f9['message'][_0xe443('0x62')]=_0x2bf9f9[_0xe443('0x62')];_0x2bf9f9['message'][_0xe443('0x63')]=_0xe443('0x52');return respondWithRpcPromise(_0xe443('0x64'),_0xe443('0x64'),{'event':'acceptmessage','message':_0x2bf9f9[_0xe443('0x22')]},client9002)[_0xe443('0x2c')](function(){return _0x2bf9f9;});}return _0x2bf9f9;}return null;})[_0xe443('0x2c')](respondWithResult(_0xb4163b,null))[_0xe443('0x4a')](handleError(_0xb4163b,null));};var interaction_log=require('../../config/logger')(_0xe443('0x65'));exports[_0xe443('0x66')]=function(_0x317ef4,_0x5dbc53,_0x165680){var _0x506f7a={'agent':{},'channel':_0xe443('0x53')};if(_0x317ef4[_0xe443('0x4d')]['id']){delete _0x317ef4[_0xe443('0x4d')]['id'];}_0x317ef4[_0xe443('0x4d')][_0xe443('0x57')]=_0x317ef4[_0xe443('0x4d')][_0xe443('0x57')]||_0x317ef4['user']['id'];_0x506f7a[_0xe443('0x67')]['id']=_0x317ef4[_0xe443('0x4d')]['UserId'];return db[_0xe443('0x33')][_0xe443('0x4f')]({'where':{'id':_0x317ef4[_0xe443('0x4e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5dbc53,null))[_0xe443('0x2c')](function(_0x2372c0){if(_0x2372c0){_0x506f7a[_0xe443('0x22')]=_0x2372c0[_0xe443('0x59')]({'plain':!![]});return db['OpenchannelInteraction'][_0xe443('0x4f')]({'where':{'id':_0x2372c0[_0xe443('0x68')]}});}return null;})[_0xe443('0x2c')](handleEntityNotFound(_0x5dbc53,null))['then'](function(_0x3be42a){if(_0x3be42a){_0x506f7a[_0xe443('0x5d')]=_0x3be42a[_0xe443('0x59')]({'plain':!![]});interaction_log[_0xe443('0x1d')](_0xe443('0x69'),_0x317ef4['user']['id'],_0x317ef4[_0xe443('0x5e')]['name'],_0x317ef4[_0xe443('0x5e')][_0xe443('0x5f')],_0x506f7a[_0xe443('0x5d')]['id'],_0x317ef4[_0xe443('0x4d')]?JSON[_0xe443('0x20')](_0x317ef4['body']):_0xe443('0x6a'));return respondWithRpcPromise(_0xe443('0x6b'),_0xe443('0x6c'),_0x506f7a);}return null;})[_0xe443('0x2c')](function(_0x19e51d){if(_0x19e51d){_0x19e51d[_0xe443('0x22')]['interface']=util[_0xe443('0x5c')](_0xe443('0x6d'),_0x317ef4[_0xe443('0x5e')][_0xe443('0x30')]);_0x19e51d['message'][_0xe443('0x62')]=_0x506f7a[_0xe443('0x62')];_0x19e51d['message']['event']='reject';respondWithRpcPromise('EventManager',_0xe443('0x64'),{'event':_0xe443('0x6e'),'message':_0x19e51d[_0xe443('0x22')]},client9002);return _0x506f7a;}return null;})[_0xe443('0x2c')](respondWithResult(_0x5dbc53,null))[_0xe443('0x4a')](handleError(_0x5dbc53,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 1f4722f..6c7418b 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 _0x064e=['hook','exports','events','../../mysqldb','OpenchannelMessage','save','emit'];(function(_0x7ae8f7,_0x13df72){var _0x22f076=function(_0x4163c9){while(--_0x4163c9){_0x7ae8f7['push'](_0x7ae8f7['shift']());}};_0x22f076(++_0x13df72);}(_0x064e,0x72));var _0xe064=function(_0x312c9f,_0x4a426d){_0x312c9f=_0x312c9f-0x0;var _0x2225fc=_0x064e[_0x312c9f];return _0x2225fc;};'use strict';var EventEmitter=require(_0xe064('0x0'));var OpenchannelMessage=require(_0xe064('0x1'))['db'][_0xe064('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe064('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x213ef7){return function(_0x1f908c,_0x698902,_0x190990){OpenchannelMessageEvents[_0xe064('0x4')](_0x213ef7+':'+_0x1f908c['id'],_0x1f908c);OpenchannelMessageEvents[_0xe064('0x4')](_0x213ef7,_0x1f908c);_0x190990(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xe064('0x5')](e,emitEvent(event));}}module[_0xe064('0x6')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x19c9=['hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners','remove','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x19c9,0x158));var _0x919c=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x19c9[_0x2faddb];return _0x273c05;};'use strict';var EventEmitter=require(_0x919c('0x0'));var OpenchannelMessage=require(_0x919c('0x1'))['db'][_0x919c('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x919c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x919c('0x4')};function emitEvent(_0x22577f){return function(_0x839c74,_0x1a2cab,_0x3f5ede){OpenchannelMessageEvents[_0x919c('0x5')](_0x22577f+':'+_0x839c74['id'],_0x839c74);OpenchannelMessageEvents[_0x919c('0x5')](_0x22577f,_0x839c74);_0x3f5ede(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x919c('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 9057784..96ad651 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 _0xb8c8=['OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','replyUri','length','Interaction','POST','method','GET','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','out','isNil','OpenchannelInteraction','then','update','createdAt','direction','catch','OpenchannelAccount','find','Interactions','CmContact','Contact','keys'];(function(_0x2f8742,_0x3c55b8){var _0x3f3bd3=function(_0x919c4b){while(--_0x919c4b){_0x2f8742['push'](_0x2f8742['shift']());}};_0x3f3bd3(++_0x3c55b8);}(_0xb8c8,0x150));var _0x8b8c=function(_0x1c22e6,_0x561cec){_0x1c22e6=_0x1c22e6-0x0;var _0x1e51a4=_0xb8c8[_0x1c22e6];return _0x1e51a4;};'use strict';var _=require(_0x8b8c('0x0'));var util=require(_0x8b8c('0x1'));var logger=require(_0x8b8c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8b8c('0x3'));var rp=require(_0x8b8c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b8c('0x5'));var config=require(_0x8b8c('0x6'));var attributes=require(_0x8b8c('0x7'));module[_0x8b8c('0x8')]=function(_0x25dbab,_0x236c84){return _0x25dbab[_0x8b8c('0x9')](_0x8b8c('0xa'),attributes,{'tableName':_0x8b8c('0xb'),'paranoid':![],'indexes':[{'name':_0x8b8c('0xc'),'fields':[_0x8b8c('0xd')],'type':_0x8b8c('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c12a0,_0x362cdb,_0x44453f){var _0x4ec84a=_0x25dbab[_0x8b8c('0xf')];var _0x5bf99f=_0x1c12a0[_0x8b8c('0x10')]({'plain':!![]});if(_0x5bf99f['direction'][_0x8b8c('0x11')]()==='in'||_0x5bf99f['direction']['toLowerCase']()===_0x8b8c('0x12')&&!_0x5bf99f['secret']&&!_[_0x8b8c('0x13')](_0x5bf99f['UserId'])){_0x4ec84a[_0x8b8c('0x14')]['findOne']({'where':{'id':_0x5bf99f['OpenchannelInteractionId']}})[_0x8b8c('0x15')](function(_0x5af3cf){if(_0x5af3cf){_0x5af3cf[_0x8b8c('0x16')]({'lastMsgAt':_0x5bf99f[_0x8b8c('0x17')],'lastMsgDirection':_0x5bf99f[_0x8b8c('0x18')][_0x8b8c('0x11')]()});}})[_0x8b8c('0x19')](function(_0x1ecd61){console['error'](_0x1ecd61);});}if(_0x5bf99f['direction']==='out'&&!_0x5bf99f['secret']){var _0x2ea08a;_0x4ec84a['CmContact']['describe']()[_0x8b8c('0x15')](function(_0x50a25b){return _0x4ec84a[_0x8b8c('0x1a')][_0x8b8c('0x1b')]({'where':{'id':_0x5bf99f['OpenchannelAccountId']},'include':[{'model':_0x4ec84a[_0x8b8c('0x14')],'as':_0x8b8c('0x1c'),'where':{'id':_0x5bf99f['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x4ec84a[_0x8b8c('0x1d')],'as':_0x8b8c('0x1e'),'attributes':_[_0x8b8c('0x1f')](_0x50a25b)}]}]});})[_0x8b8c('0x15')](function(_0x253043){_0x2ea08a=_0x253043[_0x8b8c('0x10')]({'plain':!![]});if(_0x2ea08a&&_0x2ea08a['replyUri']){logger['info'](_0x8b8c('0x20'),_0x8b8c('0x21'),util[_0x8b8c('0x22')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x5bf99f['id'],_0x2ea08a[_0x8b8c('0x23')]));if(_0x2ea08a[_0x8b8c('0x1c')]&&_0x2ea08a[_0x8b8c('0x1c')][_0x8b8c('0x24')]){_0x5bf99f[_0x8b8c('0x25')]=_['omit'](_0x2ea08a[_0x8b8c('0x1c')][0x0],_0x8b8c('0x1e'));_0x5bf99f[_0x8b8c('0x1e')]=_0x2ea08a[_0x8b8c('0x1c')][0x0][_0x8b8c('0x1e')];}var _0x362cdb={'method':_0x8b8c('0x26'),'uri':encodeURI(_0x2ea08a[_0x8b8c('0x23')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x362cdb[_0x8b8c('0x27')]){case _0x8b8c('0x28'):_0x362cdb['qs']=_0x5bf99f;break;case _0x8b8c('0x26'):_0x362cdb[_0x8b8c('0xd')]=_0x5bf99f;break;}return rp(_0x362cdb)[_0x8b8c('0x15')](function(_0x397bed){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x8b8c('0x21'),util[_0x8b8c('0x22')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x5bf99f['id'],_0x2ea08a['replyUri']));if(_0x397bed[_0x8b8c('0xd')][_0x8b8c('0x29')]&&_0x397bed[_0x8b8c('0xd')][_0x8b8c('0x29')]!=_0x5bf99f[_0x8b8c('0x25')][_0x8b8c('0x29')]){return _0x4ec84a[_0x8b8c('0x14')][_0x8b8c('0x16')]({'threadId':_0x397bed[_0x8b8c('0xd')][_0x8b8c('0x29')]},{'logging':!![],'where':{'id':_0x5bf99f[_0x8b8c('0x25')]['id']}});}else{return;}})[_0x8b8c('0x15')](function(){return _0x1c12a0[_0x8b8c('0x16')]({'read':!![]});})['catch'](function(_0x966f5a){logger['error'](_0x8b8c('0x20'),_0x8b8c('0x21'),util[_0x8b8c('0x2a')](_0x966f5a,{'showHidden':![],'depth':null}));_0x44453f();});}else{_0x44453f();}})[_0x8b8c('0x2b')](function(){_0x44453f();});}else{_0x44453f();}}},'charset':_0x8b8c('0x2c'),'collate':_0x8b8c('0x2d')});}; \ No newline at end of file +var _0xd1bc=['api','moment','bluebird','path','rimraf','../../config/environment','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId','createdAt','catch','error','out','CmContact','describe','OpenchannelAccount','find','Interactions','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','POST','method','GET','then','info','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','update','inspect','finally','utf8mb4','lodash','util','../../config/logger'];(function(_0x25b737,_0x321d69){var _0x66d5b7=function(_0x559640){while(--_0x559640){_0x25b737['push'](_0x25b737['shift']());}};_0x66d5b7(++_0x321d69);}(_0xd1bc,0xd1));var _0xcd1b=function(_0x42d2af,_0x3961b5){_0x42d2af=_0x42d2af-0x0;var _0x1d6d63=_0xd1bc[_0x42d2af];return _0x1d6d63;};'use strict';var _=require(_0xcd1b('0x0'));var util=require(_0xcd1b('0x1'));var logger=require(_0xcd1b('0x2'))(_0xcd1b('0x3'));var moment=require(_0xcd1b('0x4'));var BPromise=require(_0xcd1b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd1b('0x6'));var rimraf=require(_0xcd1b('0x7'));var config=require(_0xcd1b('0x8'));var attributes=require('./openchannelMessage.attributes');module[_0xcd1b('0x9')]=function(_0x20debe,_0x2e5cf8){return _0x20debe['define'](_0xcd1b('0xa'),attributes,{'tableName':_0xcd1b('0xb'),'paranoid':![],'indexes':[{'name':_0xcd1b('0xc'),'fields':[_0xcd1b('0xd')],'type':_0xcd1b('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x169ba6,_0x51670b,_0x58db25){var _0x2f8edb=_0x20debe[_0xcd1b('0xf')];var _0x5d27cf=_0x169ba6['get']({'plain':!![]});if(_0x5d27cf[_0xcd1b('0x10')][_0xcd1b('0x11')]()==='in'||_0x5d27cf['direction']['toLowerCase']()==='out'&&!_0x5d27cf[_0xcd1b('0x12')]&&!_[_0xcd1b('0x13')](_0x5d27cf['UserId'])){_0x2f8edb[_0xcd1b('0x14')][_0xcd1b('0x15')]({'where':{'id':_0x5d27cf[_0xcd1b('0x16')]}})['then'](function(_0x34fca8){if(_0x34fca8){_0x34fca8['update']({'lastMsgAt':_0x5d27cf[_0xcd1b('0x17')],'lastMsgDirection':_0x5d27cf['direction'][_0xcd1b('0x11')]()});}})[_0xcd1b('0x18')](function(_0x1def00){console[_0xcd1b('0x19')](_0x1def00);});}if(_0x5d27cf[_0xcd1b('0x10')]===_0xcd1b('0x1a')&&!_0x5d27cf[_0xcd1b('0x12')]){var _0x2c8432;_0x2f8edb[_0xcd1b('0x1b')][_0xcd1b('0x1c')]()['then'](function(_0x2f43e2){return _0x2f8edb[_0xcd1b('0x1d')][_0xcd1b('0x1e')]({'where':{'id':_0x5d27cf['OpenchannelAccountId']},'include':[{'model':_0x2f8edb[_0xcd1b('0x14')],'as':_0xcd1b('0x1f'),'where':{'id':_0x5d27cf[_0xcd1b('0x16')]},'limit':0x1,'include':[{'model':_0x2f8edb[_0xcd1b('0x1b')],'as':_0xcd1b('0x20'),'attributes':_[_0xcd1b('0x21')](_0x2f43e2)}]}]});})['then'](function(_0x462f75){_0x2c8432=_0x462f75['get']({'plain':!![]});if(_0x2c8432&&_0x2c8432[_0xcd1b('0x22')]){logger['info'](_0xcd1b('0x23'),_0xcd1b('0x24'),util['format'](_0xcd1b('0x25'),_0x5d27cf['id'],_0x2c8432[_0xcd1b('0x22')]));if(_0x2c8432[_0xcd1b('0x1f')]&&_0x2c8432[_0xcd1b('0x1f')][_0xcd1b('0x26')]){_0x5d27cf['Interaction']=_[_0xcd1b('0x27')](_0x2c8432[_0xcd1b('0x1f')][0x0],_0xcd1b('0x20'));_0x5d27cf[_0xcd1b('0x20')]=_0x2c8432[_0xcd1b('0x1f')][0x0][_0xcd1b('0x20')];}var _0x51670b={'method':_0xcd1b('0x28'),'uri':encodeURI(_0x2c8432[_0xcd1b('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x51670b[_0xcd1b('0x29')]){case _0xcd1b('0x2a'):_0x51670b['qs']=_0x5d27cf;break;case _0xcd1b('0x28'):_0x51670b[_0xcd1b('0xd')]=_0x5d27cf;break;}return rp(_0x51670b)[_0xcd1b('0x2b')](function(_0x39072f){logger[_0xcd1b('0x2c')](_0xcd1b('0x23'),_0xcd1b('0x24'),util[_0xcd1b('0x2d')](_0xcd1b('0x2e'),_0x5d27cf['id'],_0x2c8432[_0xcd1b('0x22')]));if(_0x39072f['body'][_0xcd1b('0x2f')]&&_0x39072f['body'][_0xcd1b('0x2f')]!=_0x5d27cf[_0xcd1b('0x30')][_0xcd1b('0x2f')]){return _0x2f8edb[_0xcd1b('0x14')][_0xcd1b('0x31')]({'threadId':_0x39072f[_0xcd1b('0xd')][_0xcd1b('0x2f')]},{'logging':!![],'where':{'id':_0x5d27cf['Interaction']['id']}});}else{return;}})[_0xcd1b('0x2b')](function(){return _0x169ba6[_0xcd1b('0x31')]({'read':!![]});})[_0xcd1b('0x18')](function(_0x3fdd50){logger[_0xcd1b('0x19')](_0xcd1b('0x23'),_0xcd1b('0x24'),util[_0xcd1b('0x32')](_0x3fdd50,{'showHidden':![],'depth':null}));_0x58db25();});}else{_0x58db25();}})[_0xcd1b('0x33')](function(){_0x58db25();});}else{_0x58db25();}}},'charset':_0xcd1b('0x34'),'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 94bdecd..18b80b7 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 _0xe5af=['result','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe5af,0x9c));var _0xfe5a=function(_0x2edbf9,_0x1f52a9){_0x2edbf9=_0x2edbf9-0x0;var _0x3f0791=_0xe5af[_0x2edbf9];return _0x3f0791;};'use strict';var _=require('lodash');var util=require(_0xfe5a('0x0'));var moment=require(_0xfe5a('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe5a('0x2'));var fs=require('fs');var Redis=require(_0xfe5a('0x3'));var db=require(_0xfe5a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe5a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfe5a('0x6'));var client=jayson[_0xfe5a('0x7')]['http']({'port':0x232a});config['redis']=_[_0xfe5a('0x8')](config[_0xfe5a('0x9')],{'host':_0xfe5a('0xa'),'port':0x18eb});var socket=require(_0xfe5a('0xb'))(new Redis(config['redis']));require(_0xfe5a('0xc'))['register'](socket);function respondWithRpcPromise(_0x51718e,_0x259e8a,_0x2cb946){return new BPromise(function(_0x543619,_0xb51e47){return client[_0xfe5a('0xd')](_0x51718e,_0x2cb946)[_0xfe5a('0xe')](function(_0x50024c){logger[_0xfe5a('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x259e8a,_0xfe5a('0x10'));logger[_0xfe5a('0x11')](_0xfe5a('0x12'),_0x259e8a,_0xfe5a('0x10'),JSON[_0xfe5a('0x13')](_0x50024c));if(_0x50024c['error']){if(_0x50024c[_0xfe5a('0x14')][_0xfe5a('0x15')]===0x1f4){logger[_0xfe5a('0x14')](_0xfe5a('0x16'),_0x259e8a,_0x50024c[_0xfe5a('0x14')][_0xfe5a('0x17')]);return _0xb51e47(_0x50024c[_0xfe5a('0x14')][_0xfe5a('0x17')]);}logger[_0xfe5a('0x14')](_0xfe5a('0x16'),_0x259e8a,_0x50024c[_0xfe5a('0x14')][_0xfe5a('0x17')]);return _0x543619(_0x50024c[_0xfe5a('0x14')][_0xfe5a('0x17')]);}else{logger[_0xfe5a('0xf')](_0xfe5a('0x16'),_0x259e8a,'request\x20sent');_0x543619(_0x50024c[_0xfe5a('0x18')][_0xfe5a('0x17')]);}})['catch'](function(_0x3b0101){logger[_0xfe5a('0x14')](_0xfe5a('0x16'),_0x259e8a,_0x3b0101);_0xb51e47(_0x3b0101);});});}exports['CreateOpenchannelMessage']=function(_0x485c15){var _0x3e11ad=this;return new Promise(function(_0x1c6ba7,_0xded538){return db[_0xfe5a('0x19')][_0xfe5a('0x1a')](_0x485c15[_0xfe5a('0x1b')],{'raw':_0x485c15['options']?_0x485c15[_0xfe5a('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xfe5a('0xe')](function(_0x39d825){logger[_0xfe5a('0xf')]('CreateOpenchannelMessage',_0x485c15);logger['debug'](_0xfe5a('0x1d'),_0x485c15,JSON[_0xfe5a('0x13')](_0x39d825));_0x1c6ba7(_0x39d825);})['catch'](function(_0x44a0bd){logger[_0xfe5a('0x14')]('CreateOpenchannelMessage',_0x44a0bd[_0xfe5a('0x17')],_0x485c15);_0xded538(_0x3e11ad[_0xfe5a('0x14')](0x1f4,_0x44a0bd[_0xfe5a('0x17')]));});});}; \ No newline at end of file +var _0x6343=['jayson/promise','client','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','create','options','raw','moment','bluebird','../../config/logger','rpc'];(function(_0x4960ab,_0x4318bf){var _0x4d06ce=function(_0x18a559){while(--_0x18a559){_0x4960ab['push'](_0x4960ab['shift']());}};_0x4d06ce(++_0x4318bf);}(_0x6343,0x168));var _0x3634=function(_0x30ab25,_0x13df72){_0x30ab25=_0x30ab25-0x0;var _0x304a30=_0x6343[_0x30ab25];return _0x304a30;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3634('0x0'));var BPromise=require(_0x3634('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3634('0x2'))(_0x3634('0x3'));var config=require('../../config/environment');var jayson=require(_0x3634('0x4'));var client=jayson[_0x3634('0x5')]['http']({'port':0x232a});config[_0x3634('0x6')]=_[_0x3634('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3634('0x8'))(new Redis(config[_0x3634('0x6')]));require(_0x3634('0x9'))[_0x3634('0xa')](socket);function respondWithRpcPromise(_0x2e8e8b,_0x43f681,_0x5e907a){return new BPromise(function(_0x4b965a,_0x31bcfc){return client[_0x3634('0xb')](_0x2e8e8b,_0x5e907a)['then'](function(_0x2bb4db){logger[_0x3634('0xc')](_0x3634('0xd'),_0x43f681,_0x3634('0xe'));logger[_0x3634('0xf')](_0x3634('0x10'),_0x43f681,_0x3634('0xe'),JSON[_0x3634('0x11')](_0x2bb4db));if(_0x2bb4db[_0x3634('0x12')]){if(_0x2bb4db[_0x3634('0x12')][_0x3634('0x13')]===0x1f4){logger[_0x3634('0x12')](_0x3634('0xd'),_0x43f681,_0x2bb4db[_0x3634('0x12')]['message']);return _0x31bcfc(_0x2bb4db[_0x3634('0x12')]['message']);}logger[_0x3634('0x12')](_0x3634('0xd'),_0x43f681,_0x2bb4db[_0x3634('0x12')][_0x3634('0x14')]);return _0x4b965a(_0x2bb4db[_0x3634('0x12')]['message']);}else{logger[_0x3634('0xc')]('OpenchannelMessage,\x20%s,\x20%s',_0x43f681,'request\x20sent');_0x4b965a(_0x2bb4db[_0x3634('0x15')]['message']);}})[_0x3634('0x16')](function(_0x32e3c6){logger[_0x3634('0x12')]('OpenchannelMessage,\x20%s,\x20%s',_0x43f681,_0x32e3c6);_0x31bcfc(_0x32e3c6);});});}exports[_0x3634('0x17')]=function(_0x4366bc){var _0x577a6c=this;return new Promise(function(_0xeb9231,_0x506281){return db[_0x3634('0x18')][_0x3634('0x19')](_0x4366bc['body'],{'raw':_0x4366bc[_0x3634('0x1a')]?_0x4366bc[_0x3634('0x1a')][_0x3634('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x22b7ef){logger[_0x3634('0xc')]('CreateOpenchannelMessage',_0x4366bc);logger[_0x3634('0xf')]('CreateOpenchannelMessage',_0x4366bc,JSON['stringify'](_0x22b7ef));_0xeb9231(_0x22b7ef);})[_0x3634('0x16')](function(_0x862ab5){logger['error'](_0x3634('0x17'),_0x862ab5[_0x3634('0x14')],_0x4366bc);_0x506281(_0x577a6c[_0x3634('0x12')](0x1f4,_0x862ab5[_0x3634('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 98cbecb..9c916ef 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 _0xb43b=['./openchannelMessage.events','save','update','emit','removeListener','length','openchannelMessage:'];(function(_0x1ad659,_0x1ab26a){var _0x56d7e2=function(_0x3c3f02){while(--_0x3c3f02){_0x1ad659['push'](_0x1ad659['shift']());}};_0x56d7e2(++_0x1ab26a);}(_0xb43b,0x1b2));var _0xbb43=function(_0x5dcdbf,_0x5002e9){_0x5dcdbf=_0x5dcdbf-0x0;var _0x3dd2eb=_0xb43b[_0x5dcdbf];return _0x3dd2eb;};'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 +var _0xcb91=['remove','update','emit','removeListener','register'];(function(_0x548590,_0x1aea92){var _0x2a555d=function(_0x3dadc7){while(--_0x3dadc7){_0x548590['push'](_0x548590['shift']());}};_0x2a555d(++_0x1aea92);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xcb91[_0x10004e];return _0x5af990;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0x1cb9('0x0'),_0x1cb9('0x1')];function createListener(_0x17d4ec,_0x22c4b8){return function(_0x4c37e8){_0x22c4b8[_0x1cb9('0x2')](_0x17d4ec,_0x4c37e8);};}function removeListener(_0x2c17b8,_0x545a34){return function(){OpenchannelMessageEvents[_0x1cb9('0x3')](_0x2c17b8,_0x545a34);};}exports[_0x1cb9('0x4')]=function(_0x53ffbd){for(var _0x226b69=0x0,_0x3f7deb=events['length'];_0x226b69<_0x3f7deb;_0x226b69++){var _0x38737d=events[_0x226b69];var _0x12567c=createListener('openchannelMessage:'+_0x38737d,_0x53ffbd);OpenchannelMessageEvents['on'](_0x38737d,_0x12567c);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 9f0bf04..8e033bb 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 _0xdbf5=['../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getTeams','post','create','/:id/teams','/:id/users','addAgents','put','update','delete','removeTeams','util','express','Router','../../components/auth/service'];(function(_0x49a573,_0x185b3b){var _0x51e9dd=function(_0x4857cc){while(--_0x4857cc){_0x49a573['push'](_0x49a573['shift']());}};_0x51e9dd(++_0x185b3b);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x15997a,_0x5a9dea){_0x15997a=_0x15997a-0x0;var _0x4de0dd=_0xdbf5[_0x15997a];return _0x4de0dd;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var auth=require(_0x5dbf('0x3'));var interaction=require(_0x5dbf('0x4'));var config=require(_0x5dbf('0x5'));var controller=require(_0x5dbf('0x6'));router[_0x5dbf('0x7')]('/',auth[_0x5dbf('0x8')](),controller[_0x5dbf('0x9')]);router[_0x5dbf('0x7')](_0x5dbf('0xa'),auth[_0x5dbf('0x8')](),controller[_0x5dbf('0xb')]);router['get'](_0x5dbf('0xc'),auth['isAuthenticated'](),controller[_0x5dbf('0xd')]);router[_0x5dbf('0x7')](_0x5dbf('0xe'),auth[_0x5dbf('0x8')](),controller['getMembers']);router[_0x5dbf('0x7')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5dbf('0xf')]);router['get']('/:id/users',auth[_0x5dbf('0x8')](),controller['getAgents']);router[_0x5dbf('0x10')]('/',auth[_0x5dbf('0x8')](),controller[_0x5dbf('0x11')]);router[_0x5dbf('0x10')](_0x5dbf('0x12'),auth['isAuthenticated'](),controller['addTeams']);router[_0x5dbf('0x10')](_0x5dbf('0x13'),auth['isAuthenticated'](),controller[_0x5dbf('0x14')]);router[_0x5dbf('0x15')](_0x5dbf('0xc'),auth[_0x5dbf('0x8')](),controller[_0x5dbf('0x16')]);router[_0x5dbf('0x17')](_0x5dbf('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x5dbf('0x17')](_0x5dbf('0x12'),auth[_0x5dbf('0x8')](),controller[_0x5dbf('0x18')]);router[_0x5dbf('0x17')]('/:id/users',auth[_0x5dbf('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x2f74=['removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','destroy'];(function(_0x4abcf4,_0x4d80bc){var _0x24c066=function(_0x52ef99){while(--_0x52ef99){_0x4abcf4['push'](_0x4abcf4['shift']());}};_0x24c066(++_0x4d80bc);}(_0x2f74,0x7b));var _0x42f7=function(_0x5f4902,_0x1198fb){_0x5f4902=_0x5f4902-0x0;var _0x743933=_0x2f74[_0x5f4902];return _0x743933;};'use strict';var multer=require(_0x42f7('0x0'));var util=require('util');var path=require(_0x42f7('0x1'));var timeout=require(_0x42f7('0x2'));var express=require(_0x42f7('0x3'));var router=express[_0x42f7('0x4')]();var auth=require(_0x42f7('0x5'));var interaction=require(_0x42f7('0x6'));var config=require(_0x42f7('0x7'));var controller=require(_0x42f7('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x42f7('0x9')](_0x42f7('0xa'),auth[_0x42f7('0xb')](),controller[_0x42f7('0xc')]);router[_0x42f7('0x9')](_0x42f7('0xd'),auth[_0x42f7('0xb')](),controller[_0x42f7('0xe')]);router['get'](_0x42f7('0xf'),auth[_0x42f7('0xb')](),controller[_0x42f7('0x10')]);router[_0x42f7('0x9')](_0x42f7('0x11'),auth[_0x42f7('0xb')](),controller['getTeams']);router[_0x42f7('0x9')](_0x42f7('0x12'),auth[_0x42f7('0xb')](),controller[_0x42f7('0x13')]);router[_0x42f7('0x14')]('/',auth[_0x42f7('0xb')](),controller[_0x42f7('0x15')]);router[_0x42f7('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x42f7('0x16')]);router[_0x42f7('0x14')](_0x42f7('0x12'),auth[_0x42f7('0xb')](),controller[_0x42f7('0x17')]);router['put'](_0x42f7('0xd'),auth['isAuthenticated'](),controller[_0x42f7('0x18')]);router[_0x42f7('0x19')](_0x42f7('0xd'),auth[_0x42f7('0xb')](),controller[_0x42f7('0x1a')]);router[_0x42f7('0x19')](_0x42f7('0x11'),auth['isAuthenticated'](),controller[_0x42f7('0x1b')]);router[_0x42f7('0x19')](_0x42f7('0x12'),auth[_0x42f7('0xb')](),controller[_0x42f7('0x1c')]);module[_0x42f7('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 2c08d48..73650cd 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 _0x40a4=['exports','STRING','name','INTEGER','rrmemory','beepall','sequelize'];(function(_0x464097,_0x4df563){var _0x5ab454=function(_0x2a0fa1){while(--_0x2a0fa1){_0x464097['push'](_0x464097['shift']());}};_0x5ab454(++_0x4df563);}(_0x40a4,0x12c));var _0x440a=function(_0x53ac7b,_0x2bbcf4){_0x53ac7b=_0x53ac7b-0x0;var _0x27d4bd=_0x40a4[_0x53ac7b];return _0x27d4bd;};'use strict';var Sequelize=require(_0x440a('0x0'));module[_0x440a('0x1')]={'name':{'type':Sequelize[_0x440a('0x2')],'unique':_0x440a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x440a('0x2')]},'timeout':{'type':Sequelize[_0x440a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x440a('0x5'),_0x440a('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x33e6=['sequelize','INTEGER','ENUM','rrmemory','beepall'];(function(_0x47604d,_0x15a014){var _0x388e4c=function(_0x42a446){while(--_0x42a446){_0x47604d['push'](_0x47604d['shift']());}};_0x388e4c(++_0x15a014);}(_0x33e6,0xaa));var _0x633e=function(_0xd993c,_0x519b26){_0xd993c=_0xd993c-0x0;var _0x1bdded=_0x33e6[_0xd993c];return _0x1bdded;};'use strict';var Sequelize=require(_0x633e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x633e('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x633e('0x2')](_0x633e('0x3'),_0x633e('0x4'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index e9dfbc2..05484f1 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 _0x17ee=['hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','field','merge','options','includeAll','include','findAll','show','params','find','catch','create','body','role','UserProfileSection','userProfileId','autoAssociation','update','describe','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','rows','format','%s/%s','createdAt','findOne','Team','getTeams','teams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','removeTeams','ids','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','every','includes','union','compact','value','isEmpty','emit','userOpenchannelQueue:remove','addAgents','omit','userOpenchannelQueue:save','removeAgents','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','ejs','lodash','squel','crypto','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','socket.io-emitter','./openchannelQueue.socket','register','status','end','count','offset','limit','set','json','apply','reject','save','then','destroy','get','OpenchannelQueues','UserProfileResource','sendStatus','stack','name','send','index','OpenchannelQueue','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length'];(function(_0x47659f,_0x150248){var _0x27d9f4=function(_0x3d6f79){while(--_0x3d6f79){_0x47659f['push'](_0x47659f['shift']());}};_0x27d9f4(++_0x150248);}(_0x17ee,0x1d8));var _0xe17e=function(_0x4c6a7f,_0x452cf6){_0x4c6a7f=_0x4c6a7f-0x0;var _0x1a5474=_0x17ee[_0x4c6a7f];return _0x1a5474;};'use strict';var pdf=require(_0xe17e('0x0'));var emlformat=require(_0xe17e('0x1'));var rimraf=require(_0xe17e('0x2'));var zipdir=require(_0xe17e('0x3'));var jsonpatch=require(_0xe17e('0x4'));var rp=require('request-promise');var moment=require(_0xe17e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe17e('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe17e('0x7'));var csv=require('to-csv');var ejs=require(_0xe17e('0x8'));var fs=require('fs');var _=require(_0xe17e('0x9'));var squel=require(_0xe17e('0xa'));var crypto=require(_0xe17e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe17e('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe17e('0xd'));var hardwareService=require(_0xe17e('0xe'));var logger=require(_0xe17e('0xf'))('api');var utils=require(_0xe17e('0x10'));var config=require('../../config/environment');var db=require(_0xe17e('0x11'))['db'];config[_0xe17e('0x12')]=_['defaults'](config[_0xe17e('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0xe17e('0x13'))(new Redis(config['redis']));require(_0xe17e('0x14'))[_0xe17e('0x15')](socket);function respondWithStatusCode(_0x590121,_0x3e1d7f){_0x3e1d7f=_0x3e1d7f||0xcc;return function(_0x98e148){if(_0x98e148){return _0x590121['sendStatus'](_0x3e1d7f);}return _0x590121[_0xe17e('0x16')](_0x3e1d7f)[_0xe17e('0x17')]();};}function respondWithResult(_0x229cf4,_0x24ea5e){_0x24ea5e=_0x24ea5e||0xc8;return function(_0x305a15){if(_0x305a15){return _0x229cf4[_0xe17e('0x16')](_0x24ea5e)['json'](_0x305a15);}};}function respondWithFilteredResult(_0x1ff000,_0x4fd424){return function(_0xd7028c){if(_0xd7028c){var _0x9599d4=_0xd7028c[_0xe17e('0x18')],_0x5c29b2=_0x4fd424[_0xe17e('0x19')],_0x5c4e4f=_0x4fd424[_0xe17e('0x19')]+_0x4fd424[_0xe17e('0x1a')],_0x5657d7;if(_0x5c4e4f>=_0x9599d4){_0x5c4e4f=_0x9599d4;_0x5657d7=0xc8;}else{_0x5657d7=0xce;}_0x1ff000['status'](_0x5657d7);return _0x1ff000[_0xe17e('0x1b')]('Content-Range',_0x5c29b2+'-'+_0x5c4e4f+'/'+_0x9599d4)[_0xe17e('0x1c')](_0xd7028c);}return null;};}function patchUpdates(_0x209224){return function(_0x1f781a){try{jsonpatch[_0xe17e('0x1d')](_0x1f781a,_0x209224,!![]);}catch(_0x3ff754){return BPromise[_0xe17e('0x1e')](_0x3ff754);}return _0x1f781a[_0xe17e('0x1f')]();};}function saveUpdates(_0x2b924f,_0x15cca6){return function(_0x445aa1){if(_0x445aa1){return _0x445aa1['update'](_0x2b924f)[_0xe17e('0x20')](function(_0x38919a){return _0x38919a;});}return null;};}function removeEntity(_0x20c9f7,_0x6e10cf){return function(_0x9e8ad0){if(_0x9e8ad0){return _0x9e8ad0[_0xe17e('0x21')]()['then'](function(){var _0x541b22=_0x9e8ad0[_0xe17e('0x22')]({'plain':!![]});var _0x420597=_0xe17e('0x23');return db[_0xe17e('0x24')][_0xe17e('0x21')]({'where':{'type':_0x420597,'resourceId':_0x541b22['id']}})[_0xe17e('0x20')](function(){return _0x9e8ad0;});})['then'](function(){_0x20c9f7[_0xe17e('0x16')](0xcc)[_0xe17e('0x17')]();});}};}function handleEntityNotFound(_0x3fe40c,_0xf1484){return function(_0x30b077){if(!_0x30b077){_0x3fe40c[_0xe17e('0x25')](0x194);}return _0x30b077;};}function handleError(_0x27aa6d,_0x484784){_0x484784=_0x484784||0x1f4;return function(_0x800685){logger['error'](_0x800685[_0xe17e('0x26')]);if(_0x800685[_0xe17e('0x27')]){delete _0x800685['name'];}_0x27aa6d[_0xe17e('0x16')](_0x484784)[_0xe17e('0x28')](_0x800685);};}exports[_0xe17e('0x29')]=function(_0x333079,_0x3c01ef){var _0x3efc42={},_0x386267={},_0x4942ab={'count':0x0,'rows':[]};var _0x77b16d=db[_0xe17e('0x2a')][_0xe17e('0x2b')];_0x386267['model']=_[_0xe17e('0x2c')](_0x77b16d);_0x386267[_0xe17e('0x2d')]=_['keys'](_0x333079['query']);_0x386267[_0xe17e('0x2e')]=_[_0xe17e('0x2f')](_0x386267[_0xe17e('0x30')],_0x386267[_0xe17e('0x2d')]);_0x3efc42['attributes']=_[_0xe17e('0x2f')](_0x386267[_0xe17e('0x30')],qs[_0xe17e('0x31')](_0x333079[_0xe17e('0x2d')][_0xe17e('0x31')]));_0x3efc42[_0xe17e('0x32')]=_0x3efc42[_0xe17e('0x32')][_0xe17e('0x33')]?_0x3efc42[_0xe17e('0x32')]:_0x386267[_0xe17e('0x30')];if(!_0x333079[_0xe17e('0x2d')][_0xe17e('0x34')](_0xe17e('0x35'))){_0x3efc42[_0xe17e('0x1a')]=qs[_0xe17e('0x1a')](_0x333079['query'][_0xe17e('0x1a')]);_0x3efc42[_0xe17e('0x19')]=qs['offset'](_0x333079[_0xe17e('0x2d')]['offset']);}_0x3efc42[_0xe17e('0x36')]=qs[_0xe17e('0x37')](_0x333079['query'][_0xe17e('0x37')]);_0x3efc42[_0xe17e('0x38')]=qs['filters'](_[_0xe17e('0x39')](_0x333079[_0xe17e('0x2d')],_0x386267[_0xe17e('0x2e')]));if(_0x333079[_0xe17e('0x2d')][_0xe17e('0x3a')]){_0x3efc42[_0xe17e('0x38')]=_['merge'](_0x3efc42[_0xe17e('0x38')],{'$or':_[_0xe17e('0x3b')](_0x77b16d,function(_0x4e7fff){if(_0x4e7fff[_0xe17e('0x3c')][_0xe17e('0x3d')]!=='VIRTUAL'){var _0x1490e2={};_0x1490e2[_0x4e7fff[_0xe17e('0x3e')]]={'$like':'%'+_0x333079[_0xe17e('0x2d')][_0xe17e('0x3a')]+'%'};return _0x1490e2;}})});}_0x3efc42=_[_0xe17e('0x3f')]({},_0x3efc42,_0x333079[_0xe17e('0x40')]);var _0x5edd59={'where':_0x3efc42[_0xe17e('0x38')]};return db[_0xe17e('0x2a')][_0xe17e('0x18')](_0x5edd59)['then'](function(_0x376c12){_0x4942ab['count']=_0x376c12;if(_0x333079[_0xe17e('0x2d')][_0xe17e('0x41')]){_0x3efc42[_0xe17e('0x42')]=[{'all':!![]}];}return db[_0xe17e('0x2a')][_0xe17e('0x43')](_0x3efc42);})[_0xe17e('0x20')](function(_0x12bc39){_0x4942ab['rows']=_0x12bc39;return _0x4942ab;})[_0xe17e('0x20')](respondWithFilteredResult(_0x3c01ef,_0x3efc42))['catch'](handleError(_0x3c01ef,null));};exports[_0xe17e('0x44')]=function(_0x4d3709,_0x4e612b){var _0x37fefa={'raw':!![],'where':{'id':_0x4d3709[_0xe17e('0x45')]['id']}},_0xe79d43={};_0xe79d43[_0xe17e('0x30')]=_[_0xe17e('0x2c')](db[_0xe17e('0x2a')][_0xe17e('0x2b')]);_0xe79d43[_0xe17e('0x2d')]=_[_0xe17e('0x2c')](_0x4d3709[_0xe17e('0x2d')]);_0xe79d43['filters']=_['intersection'](_0xe79d43['model'],_0xe79d43[_0xe17e('0x2d')]);_0x37fefa['attributes']=_[_0xe17e('0x2f')](_0xe79d43[_0xe17e('0x30')],qs[_0xe17e('0x31')](_0x4d3709['query'][_0xe17e('0x31')]));_0x37fefa[_0xe17e('0x32')]=_0x37fefa[_0xe17e('0x32')]['length']?_0x37fefa['attributes']:_0xe79d43['model'];if(_0x4d3709[_0xe17e('0x2d')][_0xe17e('0x41')]){_0x37fefa['include']=[{'all':!![]}];}_0x37fefa=_[_0xe17e('0x3f')]({},_0x37fefa,_0x4d3709[_0xe17e('0x40')]);return db['OpenchannelQueue'][_0xe17e('0x46')](_0x37fefa)['then'](handleEntityNotFound(_0x4e612b,null))[_0xe17e('0x20')](respondWithResult(_0x4e612b,null))[_0xe17e('0x47')](handleError(_0x4e612b,null));};exports[_0xe17e('0x48')]=function(_0x47c0df,_0x48e5f8){return db[_0xe17e('0x2a')][_0xe17e('0x48')](_0x47c0df[_0xe17e('0x49')],{})[_0xe17e('0x20')](function(_0x5e9cd4){var _0x42aae5=_0x47c0df['user'][_0xe17e('0x22')]({'plain':!![]});if(!_0x42aae5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42aae5[_0xe17e('0x4a')]==='user'){var _0x460a3d=_0x5e9cd4[_0xe17e('0x22')]({'plain':!![]});var _0x236fdb=_0xe17e('0x23');return db[_0xe17e('0x4b')][_0xe17e('0x46')]({'where':{'name':_0x236fdb,'userProfileId':_0x42aae5[_0xe17e('0x4c')]},'raw':!![]})['then'](function(_0x335efe){if(_0x335efe&&_0x335efe[_0xe17e('0x4d')]===0x0){return db[_0xe17e('0x24')][_0xe17e('0x48')]({'name':_0x460a3d[_0xe17e('0x27')],'resourceId':_0x460a3d['id'],'type':_0x335efe[_0xe17e('0x27')],'sectionId':_0x335efe['id']},{})['then'](function(){return _0x5e9cd4;});}else{return _0x5e9cd4;}})['catch'](function(_0x5a7c12){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a7c12);throw _0x5a7c12;});}return _0x5e9cd4;})[_0xe17e('0x20')](respondWithResult(_0x48e5f8,0xc9))[_0xe17e('0x47')](handleError(_0x48e5f8,null));};exports[_0xe17e('0x4e')]=function(_0x4a8331,_0x2282ec){if(_0x4a8331[_0xe17e('0x49')]['id']){delete _0x4a8331[_0xe17e('0x49')]['id'];}return db[_0xe17e('0x2a')][_0xe17e('0x46')]({'where':{'id':_0x4a8331[_0xe17e('0x45')]['id']}})[_0xe17e('0x20')](handleEntityNotFound(_0x2282ec,null))[_0xe17e('0x20')](saveUpdates(_0x4a8331[_0xe17e('0x49')],null))[_0xe17e('0x20')](respondWithResult(_0x2282ec,null))[_0xe17e('0x47')](handleError(_0x2282ec,null));};exports[_0xe17e('0x21')]=function(_0x56c995,_0xd1a1d5){return db[_0xe17e('0x2a')][_0xe17e('0x46')]({'where':{'id':_0x56c995['params']['id']}})[_0xe17e('0x20')](handleEntityNotFound(_0xd1a1d5,null))['then'](removeEntity(_0xd1a1d5,null))[_0xe17e('0x47')](handleError(_0xd1a1d5,null));};exports[_0xe17e('0x4f')]=function(_0x54758f,_0x2f6109){return db[_0xe17e('0x2a')][_0xe17e('0x4f')]()[_0xe17e('0x20')](respondWithResult(_0x2f6109,null))[_0xe17e('0x47')](handleError(_0x2f6109,null));};exports['getMembers']=function(_0x31048b,_0x704e7,_0x496eb5){var _0xd1d29f={'raw':!![],'where':{}},_0x4b3a6f={},_0x4de25f;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x31048b[_0xe17e('0x45')]['id']}})[_0xe17e('0x20')](handleEntityNotFound(_0x704e7,null))[_0xe17e('0x20')](function(_0x370dcf){if(_0x370dcf){_0x4de25f=_0x370dcf[_0xe17e('0x22')]({'plain':!![]});_0x4b3a6f['model']=_[_0xe17e('0x2c')](db[_0xe17e('0x50')]['rawAttributes']);_0x4b3a6f[_0xe17e('0x2d')]=_[_0xe17e('0x2c')](_0x31048b[_0xe17e('0x2d')]);_0x4b3a6f[_0xe17e('0x2e')]=_[_0xe17e('0x2f')](_0x4b3a6f[_0xe17e('0x30')],_0x4b3a6f['query']);_0xd1d29f[_0xe17e('0x32')]=_['intersection'](_0x4b3a6f['model'],qs[_0xe17e('0x31')](_0x31048b[_0xe17e('0x2d')][_0xe17e('0x31')]));_0xd1d29f['attributes']=_0xd1d29f[_0xe17e('0x32')][_0xe17e('0x33')]?_0xd1d29f[_0xe17e('0x32')]:_0x4b3a6f[_0xe17e('0x30')];if(!_0x31048b[_0xe17e('0x2d')][_0xe17e('0x34')](_0xe17e('0x35'))){_0xd1d29f[_0xe17e('0x1a')]=qs[_0xe17e('0x1a')](_0x31048b[_0xe17e('0x2d')]['limit']);_0xd1d29f[_0xe17e('0x19')]=qs[_0xe17e('0x19')](_0x31048b[_0xe17e('0x2d')][_0xe17e('0x19')]);}_0xd1d29f[_0xe17e('0x36')]=qs[_0xe17e('0x37')](_0x31048b[_0xe17e('0x2d')]['sort']);_0xd1d29f['where']=qs[_0xe17e('0x2e')](_[_0xe17e('0x39')](_0x31048b['query'],_0x4b3a6f['filters']));_0xd1d29f['where'][_0xe17e('0x51')]=_0x370dcf['id'];if(_0x31048b[_0xe17e('0x2d')][_0xe17e('0x3a')]){_0xd1d29f[_0xe17e('0x38')]=_[_0xe17e('0x3f')](_0xd1d29f[_0xe17e('0x38')],{'$or':_[_0xe17e('0x3b')](_0xd1d29f[_0xe17e('0x32')],function(_0x27c3ac){var _0x94ed83={};_0x94ed83[_0x27c3ac]={'$like':'%'+_0x31048b[_0xe17e('0x2d')][_0xe17e('0x3a')]+'%'};return _0x94ed83;})});}_0xd1d29f=_[_0xe17e('0x3f')]({},_0xd1d29f,_0x31048b[_0xe17e('0x40')]);return db[_0xe17e('0x50')][_0xe17e('0x43')](_0xd1d29f);}})[_0xe17e('0x20')](function(_0x42cb91){if(_0x42cb91){return db[_0xe17e('0x52')][_0xe17e('0x53')]({'where':{'id':_[_0xe17e('0x3b')](_0x42cb91,_0xe17e('0x54')),'role':_0xe17e('0x55')},'attributes':['id',_0xe17e('0x27'),_0xe17e('0x56'),_0xe17e('0x57'),'createdAt']});}})[_0xe17e('0x20')](function(_0x3ae68d){if(_0x3ae68d){return{'count':_0x3ae68d[_0xe17e('0x18')],'rows':_[_0xe17e('0x3b')](_0x3ae68d[_0xe17e('0x58')],function(_0x2082ee){return{'membername':_0x2082ee['name'],'UserId':_0x2082ee['id'],'queue_name':_0x4de25f[_0xe17e('0x27')],'OpenchannelQueueId':_0x4de25f['id'],'interface':util[_0xe17e('0x59')](_0xe17e('0x5a'),'SIP',_0x2082ee[_0xe17e('0x27')]),'penalty':0x0,'paused':_0x2082ee[_0xe17e('0x56')],'createdAt':_0x2082ee[_0xe17e('0x5b')],'updatedAt':_0x2082ee[_0xe17e('0x57')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe17e('0x20')](respondWithFilteredResult(_0x704e7,_0xd1d29f))[_0xe17e('0x47')](handleError(_0x704e7,null));};exports['getTeams']=function(_0x51acaa,_0x4a038c,_0x2232dc){var _0x2b471d={};var _0x1c2c23={};var _0xa3a02f;var _0x3c912c;return db[_0xe17e('0x2a')][_0xe17e('0x5c')]({'where':{'id':_0x51acaa[_0xe17e('0x45')]['id']}})[_0xe17e('0x20')](handleEntityNotFound(_0x4a038c,null))[_0xe17e('0x20')](function(_0x278c3a){if(_0x278c3a){_0xa3a02f=_0x278c3a;_0x1c2c23[_0xe17e('0x30')]=_[_0xe17e('0x2c')](db[_0xe17e('0x5d')][_0xe17e('0x2b')]);_0x1c2c23[_0xe17e('0x2d')]=_[_0xe17e('0x2c')](_0x51acaa[_0xe17e('0x2d')]);_0x1c2c23[_0xe17e('0x2e')]=_[_0xe17e('0x2f')](_0x1c2c23['model'],_0x1c2c23[_0xe17e('0x2d')]);_0x2b471d['attributes']=_[_0xe17e('0x2f')](_0x1c2c23[_0xe17e('0x30')],qs[_0xe17e('0x31')](_0x51acaa[_0xe17e('0x2d')][_0xe17e('0x31')]));_0x2b471d[_0xe17e('0x32')]=_0x2b471d['attributes'][_0xe17e('0x33')]?_0x2b471d[_0xe17e('0x32')]:_0x1c2c23[_0xe17e('0x30')];_0x2b471d[_0xe17e('0x36')]=qs[_0xe17e('0x37')](_0x51acaa['query'][_0xe17e('0x37')]);_0x2b471d[_0xe17e('0x38')]=qs[_0xe17e('0x2e')](_['pick'](_0x51acaa['query'],_0x1c2c23[_0xe17e('0x2e')]));if(_0x51acaa['query'][_0xe17e('0x3a')]){_0x2b471d[_0xe17e('0x38')]=_[_0xe17e('0x3f')](_0x2b471d[_0xe17e('0x38')],{'$or':_[_0xe17e('0x3b')](_0x2b471d['attributes'],function(_0x2854d3){var _0x2de237={};_0x2de237[_0x2854d3]={'$like':'%'+_0x51acaa[_0xe17e('0x2d')][_0xe17e('0x3a')]+'%'};return _0x2de237;})});}_0x2b471d=_['merge']({},_0x2b471d,_0x51acaa[_0xe17e('0x40')]);return _0xa3a02f[_0xe17e('0x5e')](_0x2b471d);}})[_0xe17e('0x20')](function(_0x1844d7){if(_0x1844d7){_0x3c912c=_0x1844d7['length'];if(!_0x51acaa[_0xe17e('0x2d')]['hasOwnProperty']('nolimit')){_0x2b471d['limit']=qs[_0xe17e('0x1a')](_0x51acaa[_0xe17e('0x2d')][_0xe17e('0x1a')]);_0x2b471d[_0xe17e('0x19')]=qs[_0xe17e('0x19')](_0x51acaa[_0xe17e('0x2d')][_0xe17e('0x19')]);}return _0xa3a02f[_0xe17e('0x5e')](_0x2b471d);}})[_0xe17e('0x20')](function(_0x15795f){if(_0x15795f){return _0x15795f?{'count':_0x3c912c,'rows':_0x15795f}:null;}})[_0xe17e('0x20')](respondWithResult(_0x4a038c,null))[_0xe17e('0x47')](handleError(_0x4a038c,null));};exports['addTeams']=function(_0x5b9dd2,_0xd5ed64,_0xaccee2){var _0x38ce57=_0x5b9dd2[_0xe17e('0x49')][_0xe17e('0x5f')];return db[_0xe17e('0x5d')][_0xe17e('0x43')]({'where':{'id':_[_0xe17e('0x3b')](_0x38ce57,'id')},'attributes':['id'],'include':[{'model':db[_0xe17e('0x52')],'as':_0xe17e('0x60'),'attributes':['id',_0xe17e('0x27'),_0xe17e('0x61'),_0xe17e('0x62'),_0xe17e('0x63')],'raw':!![]}]})[_0xe17e('0x20')](function(_0x2553bb){if(_0x2553bb){var _0x1d7be3=_[_0xe17e('0x64')](_0x2553bb,function(_0x5b9b9a){var _0x26f6e5=_0x5b9b9a[_0xe17e('0x22')]({'plain':!![]});return _0x26f6e5[_0xe17e('0x60')];});return db[_0xe17e('0x2a')][_0xe17e('0x46')]({'where':{'id':_0x5b9dd2[_0xe17e('0x45')]['id']}})[_0xe17e('0x20')](function(_0x4fa5f6){return db[_0xe17e('0x65')][_0xe17e('0x66')](function(_0x430604){return _0x4fa5f6[_0xe17e('0x67')](_[_0xe17e('0x3b')](_0x38ce57,'id'),{'transaction':_0x430604})[_0xe17e('0x20')](function(){return BPromise['each'](_0x1d7be3,function(_0x14903e){return db['UserOpenchannelQueue'][_0xe17e('0x68')]({'where':{'UserId':_0x14903e['id'],'OpenchannelQueueId':_0x5b9dd2['params']['id']},'transaction':_0x430604});});})['then'](function(){_0x1d7be3[_0xe17e('0x69')](function(_0x5825f7){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x5825f7['id'],'OpenchannelQueueId':_0x4fa5f6['id']});});});});});}})[_0xe17e('0x20')](respondWithStatusCode(_0xd5ed64,null))[_0xe17e('0x47')](handleError(_0xd5ed64,null));};exports[_0xe17e('0x6a')]=function(_0x51ccfa,_0x2d4923,_0x33f111){return db[_0xe17e('0x5d')]['findAll']({'where':{'id':_0x51ccfa[_0xe17e('0x2d')][_0xe17e('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xe17e('0x52')],'as':_0xe17e('0x60'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2d4923,null))['then'](function(_0x56438a){var _0x2cd25c=_['map'](_0x56438a,'id');var _0x139a7b=[];var _0x448f0c=[];var _0x4de76b=squel[_0xe17e('0x6c')]();_0x4de76b[_0xe17e('0x3e')](_0xe17e('0x6d'))[_0xe17e('0x6e')]('team_has_openchannel_queues','tq')[_0xe17e('0x6f')](_0xe17e('0x70'),'ut',_0xe17e('0x71'))[_0xe17e('0x38')](_0xe17e('0x72'),_0x51ccfa[_0xe17e('0x45')]['id']);for(var _0x7d09fa=0x0;_0x7d09fa<_0x56438a['length'];_0x7d09fa+=0x1){let _0x22ddea=_0x56438a[_0x7d09fa];for(var _0x473d39=0x0;_0x473d39<_0x22ddea['Agents'][_0xe17e('0x33')];_0x473d39+=0x1){let _0x2ed8ca=_0x22ddea['Agents'][_0x473d39];var _0x6f023e=_0x4de76b[_0xe17e('0x73')]();_0x6f023e[_0xe17e('0x38')](_0xe17e('0x74'),_0x2ed8ca['id']);_0x448f0c['push'](db['sequelize'][_0xe17e('0x2d')](_0x6f023e[_0xe17e('0x75')](),{'type':db[_0xe17e('0x65')]['QueryTypes']['SELECT']})[_0xe17e('0x20')](function(_0x443295){if(_0x443295[_0xe17e('0x33')]===0x1){return _0x2ed8ca['id'];}else{var _0x44a930=_[_0xe17e('0x76')](_[_0xe17e('0x3b')](_0x443295,'TeamId'),function(_0x41a30e){return _[_0xe17e('0x77')](_0x2cd25c,_0x41a30e);});if(_0x44a930){return _0x2ed8ca['id'];}}}));}}return BPromise['all'](_0x448f0c)[_0xe17e('0x20')](function(_0x1d5aff){_0x139a7b=_(_0x139a7b)[_0xe17e('0x78')](_0x1d5aff)[_0xe17e('0x79')]()[_0xe17e('0x7a')]();return db[_0xe17e('0x2a')][_0xe17e('0x46')]({'where':{'id':_0x51ccfa[_0xe17e('0x45')]['id']}})['then'](function(_0x517c0b){return db['sequelize']['transaction'](function(_0x55e287){return _0x517c0b[_0xe17e('0x6a')](_0x51ccfa[_0xe17e('0x2d')][_0xe17e('0x6b')],{'transaction':_0x55e287})[_0xe17e('0x20')](function(){if(!_[_0xe17e('0x7b')](_0x139a7b)){return _0x517c0b['removeAgents'](_0x139a7b,{'transaction':_0x55e287});}})[_0xe17e('0x20')](function(){_0x139a7b[_0xe17e('0x69')](function(_0xc77b74){socket[_0xe17e('0x7c')](_0xe17e('0x7d'),{'UserId':_0xc77b74,'OpenchannelQueueId':_0x517c0b['id']});});});});});});})[_0xe17e('0x20')](respondWithStatusCode(_0x2d4923,null))[_0xe17e('0x47')](handleError(_0x2d4923,null));};exports[_0xe17e('0x7e')]=function(_0x39fcc5,_0x11f4ef,_0x4c5baf){return db[_0xe17e('0x2a')][_0xe17e('0x46')]({'where':{'id':_0x39fcc5[_0xe17e('0x45')]['id']}})[_0xe17e('0x20')](handleEntityNotFound(_0x11f4ef,null))[_0xe17e('0x20')](function(_0x561b7f){if(_0x561b7f){return _0x561b7f[_0xe17e('0x7e')](_0x39fcc5[_0xe17e('0x49')]['ids'],_[_0xe17e('0x7f')](_0x39fcc5['body'],[_0xe17e('0x6b'),'id'])||{})['spread'](function(_0x23f588){for(var _0x306e0b=0x0;_0x306e0b<_0x39fcc5[_0xe17e('0x49')][_0xe17e('0x6b')][_0xe17e('0x33')];_0x306e0b+=0x1){socket[_0xe17e('0x7c')](_0xe17e('0x80'),{'UserId':_0x39fcc5[_0xe17e('0x49')][_0xe17e('0x6b')][_0x306e0b],'OpenchannelQueueId':_0x39fcc5[_0xe17e('0x45')]['id']});}return _0x23f588;});}})[_0xe17e('0x20')](respondWithResult(_0x11f4ef,null))[_0xe17e('0x47')](handleError(_0x11f4ef,null));};exports[_0xe17e('0x81')]=function(_0x5581ce,_0x1d07ac,_0x54dfba){return db[_0xe17e('0x2a')][_0xe17e('0x46')]({'where':{'id':_0x5581ce[_0xe17e('0x45')]['id']}})[_0xe17e('0x20')](handleEntityNotFound(_0x1d07ac,null))['then'](function(_0x373d9c){if(_0x373d9c){return _0x373d9c[_0xe17e('0x81')](_0x5581ce[_0xe17e('0x2d')][_0xe17e('0x6b')])[_0xe17e('0x20')](function(){if(_['isArray'](_0x5581ce[_0xe17e('0x2d')][_0xe17e('0x6b')])){for(var _0xf3a557=0x0;_0xf3a557<_0x5581ce[_0xe17e('0x2d')][_0xe17e('0x6b')]['length'];_0xf3a557+=0x1){socket[_0xe17e('0x7c')](_0xe17e('0x7d'),{'UserId':Number(_0x5581ce[_0xe17e('0x2d')][_0xe17e('0x6b')][_0xf3a557]),'OpenchannelQueueId':Number(_0x5581ce['params']['id'])});}}else{socket['emit'](_0xe17e('0x7d'),{'UserId':Number(_0x5581ce[_0xe17e('0x2d')]['ids']),'OpenchannelQueueId':Number(_0x5581ce[_0xe17e('0x45')]['id'])});}});}})[_0xe17e('0x20')](respondWithStatusCode(_0x1d07ac,null))[_0xe17e('0x47')](handleError(_0x1d07ac,null));};exports[_0xe17e('0x82')]=function(_0x3925e1,_0x5a2318,_0x4342a5){var _0x20507a={};var _0x2a41c0={};var _0x178100;var _0x15a7ec;return db['OpenchannelQueue'][_0xe17e('0x5c')]({'where':{'id':_0x3925e1['params']['id']}})[_0xe17e('0x20')](handleEntityNotFound(_0x5a2318,null))['then'](function(_0x417d42){if(_0x417d42){_0x178100=_0x417d42;_0x2a41c0[_0xe17e('0x30')]=_[_0xe17e('0x2c')](db[_0xe17e('0x52')][_0xe17e('0x2b')]);_0x2a41c0['query']=_[_0xe17e('0x2c')](_0x3925e1[_0xe17e('0x2d')]);_0x2a41c0[_0xe17e('0x2e')]=_['intersection'](_0x2a41c0[_0xe17e('0x30')],_0x2a41c0[_0xe17e('0x2d')]);_0x20507a[_0xe17e('0x32')]=_[_0xe17e('0x2f')](_0x2a41c0[_0xe17e('0x30')],qs[_0xe17e('0x31')](_0x3925e1['query'][_0xe17e('0x31')]));_0x20507a[_0xe17e('0x32')]=_0x20507a[_0xe17e('0x32')][_0xe17e('0x33')]?_0x20507a[_0xe17e('0x32')]:_0x2a41c0['model'];_0x20507a['order']=qs[_0xe17e('0x37')](_0x3925e1[_0xe17e('0x2d')][_0xe17e('0x37')]);_0x20507a['where']=qs[_0xe17e('0x2e')](_[_0xe17e('0x39')](_0x3925e1[_0xe17e('0x2d')],_0x2a41c0['filters']));if(_0x3925e1[_0xe17e('0x2d')][_0xe17e('0x3a')]){_0x20507a[_0xe17e('0x38')]=_[_0xe17e('0x3f')](_0x20507a[_0xe17e('0x38')],{'$or':_[_0xe17e('0x3b')](_0x20507a[_0xe17e('0x32')],function(_0x36be9c){var _0x1147a2={};_0x1147a2[_0x36be9c]={'$like':'%'+_0x3925e1[_0xe17e('0x2d')][_0xe17e('0x3a')]+'%'};return _0x1147a2;})});}_0x20507a=_[_0xe17e('0x3f')]({},_0x20507a,_0x3925e1[_0xe17e('0x40')]);return _0x178100['getAgents'](_0x20507a);}})['then'](function(_0x56e6a5){if(_0x56e6a5){_0x15a7ec=_0x56e6a5[_0xe17e('0x33')];if(!_0x3925e1[_0xe17e('0x2d')]['hasOwnProperty']('nolimit')){_0x20507a[_0xe17e('0x1a')]=qs[_0xe17e('0x1a')](_0x3925e1[_0xe17e('0x2d')][_0xe17e('0x1a')]);_0x20507a['offset']=qs['offset'](_0x3925e1[_0xe17e('0x2d')][_0xe17e('0x19')]);}return _0x178100[_0xe17e('0x82')](_0x20507a);}})[_0xe17e('0x20')](function(_0x2502f3){if(_0x2502f3){return _0x2502f3?{'count':_0x15a7ec,'rows':_0x2502f3}:null;}})[_0xe17e('0x20')](respondWithResult(_0x5a2318,null))['catch'](handleError(_0x5a2318,null));}; \ No newline at end of file +var _0x2343=['moment','mustache','util','path','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','OpenchannelQueue','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','key','VIRTUAL','field','filter','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','fields','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','pick','map','UserOpenchannelQueue','User','UserId','agent','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','teams','Agents','online','interface','flatMap','sequelize','addTeams','each','findOrCreate','emit','removeTeams','ids','select','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','SELECT','includes','all','union','value','transaction','isEmpty','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x27c9d7,_0x2b70a0){var _0x8c5ede=function(_0x3ce2ca){while(--_0x3ce2ca){_0x27c9d7['push'](_0x27c9d7['shift']());}};_0x8c5ede(++_0x2b70a0);}(_0x2343,0x115));var _0x3234=function(_0x277721,_0x46971e){_0x277721=_0x277721-0x0;var _0x286051=_0x2343[_0x277721];return _0x286051;};'use strict';var pdf=require(_0x3234('0x0'));var emlformat=require(_0x3234('0x1'));var rimraf=require(_0x3234('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3234('0x3'));var rp=require(_0x3234('0x4'));var moment=require(_0x3234('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3234('0x6'));var util=require(_0x3234('0x7'));var path=require(_0x3234('0x8'));var sox=require('sox');var csv=require(_0x3234('0x9'));var ejs=require(_0x3234('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3234('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3234('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3234('0xd'));var Papa=require(_0x3234('0xe'));var Redis=require(_0x3234('0xf'));var authService=require(_0x3234('0x10'));var qs=require(_0x3234('0x11'));var hardwareService=require(_0x3234('0x12'));var logger=require('../../config/logger')(_0x3234('0x13'));var utils=require(_0x3234('0x14'));var config=require(_0x3234('0x15'));var db=require(_0x3234('0x16'))['db'];config[_0x3234('0x17')]=_[_0x3234('0x18')](config['redis'],{'host':_0x3234('0x19'),'port':0x18eb});var socket=require(_0x3234('0x1a'))(new Redis(config[_0x3234('0x17')]));require('./openchannelQueue.socket')[_0x3234('0x1b')](socket);function respondWithStatusCode(_0x1a5ae9,_0x529b05){_0x529b05=_0x529b05||0xcc;return function(_0x4f1919){if(_0x4f1919){return _0x1a5ae9[_0x3234('0x1c')](_0x529b05);}return _0x1a5ae9[_0x3234('0x1d')](_0x529b05)[_0x3234('0x1e')]();};}function respondWithResult(_0x4b77b1,_0x216f6c){_0x216f6c=_0x216f6c||0xc8;return function(_0x380360){if(_0x380360){return _0x4b77b1[_0x3234('0x1d')](_0x216f6c)[_0x3234('0x1f')](_0x380360);}};}function respondWithFilteredResult(_0x4d6ac6,_0x12ac1b){return function(_0x22351f){if(_0x22351f){var _0x142d8f=_0x22351f[_0x3234('0x20')],_0x494be3=_0x12ac1b[_0x3234('0x21')],_0x4077aa=_0x12ac1b[_0x3234('0x21')]+_0x12ac1b[_0x3234('0x22')],_0xa929da;if(_0x4077aa>=_0x142d8f){_0x4077aa=_0x142d8f;_0xa929da=0xc8;}else{_0xa929da=0xce;}_0x4d6ac6['status'](_0xa929da);return _0x4d6ac6[_0x3234('0x23')](_0x3234('0x24'),_0x494be3+'-'+_0x4077aa+'/'+_0x142d8f)[_0x3234('0x1f')](_0x22351f);}return null;};}function patchUpdates(_0x2bfe96){return function(_0x25a8d){try{jsonpatch[_0x3234('0x25')](_0x25a8d,_0x2bfe96,!![]);}catch(_0x1ee84e){return BPromise[_0x3234('0x26')](_0x1ee84e);}return _0x25a8d[_0x3234('0x27')]();};}function saveUpdates(_0x114d8d,_0x1f4f62){return function(_0x450ba1){if(_0x450ba1){return _0x450ba1[_0x3234('0x28')](_0x114d8d)['then'](function(_0x54da44){return _0x54da44;});}return null;};}function removeEntity(_0x4d11cf,_0x7d8320){return function(_0x42a6c0){if(_0x42a6c0){return _0x42a6c0['destroy']()[_0x3234('0x29')](function(){var _0x258edb=_0x42a6c0[_0x3234('0x2a')]({'plain':!![]});var _0x22f7fa='OpenchannelQueues';return db[_0x3234('0x2b')][_0x3234('0x2c')]({'where':{'type':_0x22f7fa,'resourceId':_0x258edb['id']}})['then'](function(){return _0x42a6c0;});})[_0x3234('0x29')](function(){_0x4d11cf[_0x3234('0x1d')](0xcc)[_0x3234('0x1e')]();});}};}function handleEntityNotFound(_0x22a366,_0x3605da){return function(_0x3e08fa){if(!_0x3e08fa){_0x22a366['sendStatus'](0x194);}return _0x3e08fa;};}function handleError(_0x5bc442,_0x8615f0){_0x8615f0=_0x8615f0||0x1f4;return function(_0x5b5f76){logger[_0x3234('0x2d')](_0x5b5f76[_0x3234('0x2e')]);if(_0x5b5f76[_0x3234('0x2f')]){delete _0x5b5f76[_0x3234('0x2f')];}_0x5bc442[_0x3234('0x1d')](_0x8615f0)[_0x3234('0x30')](_0x5b5f76);};}exports[_0x3234('0x31')]=function(_0x51dd90,_0x26aa71){var _0x3a086e={},_0x4c3e92={},_0x5ecbf9={'count':0x0,'rows':[]};var _0x5f09a4=db[_0x3234('0x32')]['rawAttributes'];_0x4c3e92[_0x3234('0x33')]=_['keys'](_0x5f09a4);_0x4c3e92['query']=_['keys'](_0x51dd90[_0x3234('0x34')]);_0x4c3e92['filters']=_[_0x3234('0x35')](_0x4c3e92[_0x3234('0x33')],_0x4c3e92[_0x3234('0x34')]);_0x3a086e[_0x3234('0x36')]=_['intersection'](_0x4c3e92[_0x3234('0x33')],qs['fields'](_0x51dd90['query']['fields']));_0x3a086e[_0x3234('0x36')]=_0x3a086e[_0x3234('0x36')][_0x3234('0x37')]?_0x3a086e['attributes']:_0x4c3e92[_0x3234('0x33')];if(!_0x51dd90['query'][_0x3234('0x38')](_0x3234('0x39'))){_0x3a086e[_0x3234('0x22')]=qs[_0x3234('0x22')](_0x51dd90[_0x3234('0x34')][_0x3234('0x22')]);_0x3a086e[_0x3234('0x21')]=qs[_0x3234('0x21')](_0x51dd90[_0x3234('0x34')][_0x3234('0x21')]);}_0x3a086e[_0x3234('0x3a')]=qs[_0x3234('0x3b')](_0x51dd90['query'][_0x3234('0x3b')]);_0x3a086e[_0x3234('0x3c')]=qs[_0x3234('0x3d')](_['pick'](_0x51dd90['query'],_0x4c3e92['filters']));if(_0x51dd90[_0x3234('0x34')]['filter']){_0x3a086e[_0x3234('0x3c')]=_[_0x3234('0x3e')](_0x3a086e[_0x3234('0x3c')],{'$or':_['map'](_0x5f09a4,function(_0x1749a7){if(_0x1749a7['type'][_0x3234('0x3f')]!==_0x3234('0x40')){var _0x31c920={};_0x31c920[_0x1749a7[_0x3234('0x41')]]={'$like':'%'+_0x51dd90[_0x3234('0x34')][_0x3234('0x42')]+'%'};return _0x31c920;}})});}_0x3a086e=_['merge']({},_0x3a086e,_0x51dd90[_0x3234('0x43')]);var _0x579ac4={'where':_0x3a086e[_0x3234('0x3c')]};return db[_0x3234('0x32')][_0x3234('0x20')](_0x579ac4)[_0x3234('0x29')](function(_0x19454b){_0x5ecbf9['count']=_0x19454b;if(_0x51dd90[_0x3234('0x34')][_0x3234('0x44')]){_0x3a086e['include']=[{'all':!![]}];}return db[_0x3234('0x32')][_0x3234('0x45')](_0x3a086e);})[_0x3234('0x29')](function(_0x1502dd){_0x5ecbf9[_0x3234('0x46')]=_0x1502dd;return _0x5ecbf9;})[_0x3234('0x29')](respondWithFilteredResult(_0x26aa71,_0x3a086e))[_0x3234('0x47')](handleError(_0x26aa71,null));};exports[_0x3234('0x48')]=function(_0x2c91a4,_0x259056){var _0x4718bc={'raw':!![],'where':{'id':_0x2c91a4[_0x3234('0x49')]['id']}},_0x1aaf2b={};_0x1aaf2b[_0x3234('0x33')]=_[_0x3234('0x4a')](db[_0x3234('0x32')][_0x3234('0x4b')]);_0x1aaf2b[_0x3234('0x34')]=_[_0x3234('0x4a')](_0x2c91a4[_0x3234('0x34')]);_0x1aaf2b[_0x3234('0x3d')]=_[_0x3234('0x35')](_0x1aaf2b[_0x3234('0x33')],_0x1aaf2b[_0x3234('0x34')]);_0x4718bc[_0x3234('0x36')]=_['intersection'](_0x1aaf2b['model'],qs[_0x3234('0x4c')](_0x2c91a4[_0x3234('0x34')][_0x3234('0x4c')]));_0x4718bc[_0x3234('0x36')]=_0x4718bc[_0x3234('0x36')][_0x3234('0x37')]?_0x4718bc['attributes']:_0x1aaf2b[_0x3234('0x33')];if(_0x2c91a4['query'][_0x3234('0x44')]){_0x4718bc[_0x3234('0x4d')]=[{'all':!![]}];}_0x4718bc=_[_0x3234('0x3e')]({},_0x4718bc,_0x2c91a4[_0x3234('0x43')]);return db[_0x3234('0x32')]['find'](_0x4718bc)[_0x3234('0x29')](handleEntityNotFound(_0x259056,null))[_0x3234('0x29')](respondWithResult(_0x259056,null))[_0x3234('0x47')](handleError(_0x259056,null));};exports[_0x3234('0x4e')]=function(_0x437ce6,_0x1d953b){return db[_0x3234('0x32')][_0x3234('0x4e')](_0x437ce6['body'],{})[_0x3234('0x29')](function(_0x35f2c9){var _0x2e5660=_0x437ce6[_0x3234('0x4f')][_0x3234('0x2a')]({'plain':!![]});if(!_0x2e5660)throw new Error(_0x3234('0x50'));if(_0x2e5660[_0x3234('0x51')]===_0x3234('0x4f')){var _0x462390=_0x35f2c9[_0x3234('0x2a')]({'plain':!![]});var _0xebef9c='OpenchannelQueues';return db[_0x3234('0x52')][_0x3234('0x53')]({'where':{'name':_0xebef9c,'userProfileId':_0x2e5660[_0x3234('0x54')]},'raw':!![]})['then'](function(_0xeca82f){if(_0xeca82f&&_0xeca82f[_0x3234('0x55')]===0x0){return db[_0x3234('0x2b')]['create']({'name':_0x462390[_0x3234('0x2f')],'resourceId':_0x462390['id'],'type':_0xeca82f[_0x3234('0x2f')],'sectionId':_0xeca82f['id']},{})[_0x3234('0x29')](function(){return _0x35f2c9;});}else{return _0x35f2c9;}})[_0x3234('0x47')](function(_0x43417d){logger[_0x3234('0x2d')](_0x3234('0x56'),_0x43417d);throw _0x43417d;});}return _0x35f2c9;})[_0x3234('0x29')](respondWithResult(_0x1d953b,0xc9))[_0x3234('0x47')](handleError(_0x1d953b,null));};exports[_0x3234('0x28')]=function(_0x4bd155,_0x68ad6d){if(_0x4bd155[_0x3234('0x57')]['id']){delete _0x4bd155['body']['id'];}return db[_0x3234('0x32')]['find']({'where':{'id':_0x4bd155['params']['id']}})[_0x3234('0x29')](handleEntityNotFound(_0x68ad6d,null))[_0x3234('0x29')](saveUpdates(_0x4bd155[_0x3234('0x57')],null))[_0x3234('0x29')](respondWithResult(_0x68ad6d,null))['catch'](handleError(_0x68ad6d,null));};exports['destroy']=function(_0x2da5a2,_0x25c3f3){return db[_0x3234('0x32')][_0x3234('0x53')]({'where':{'id':_0x2da5a2[_0x3234('0x49')]['id']}})[_0x3234('0x29')](handleEntityNotFound(_0x25c3f3,null))[_0x3234('0x29')](removeEntity(_0x25c3f3,null))[_0x3234('0x47')](handleError(_0x25c3f3,null));};exports[_0x3234('0x58')]=function(_0x426deb,_0x17abbb){return db['OpenchannelQueue'][_0x3234('0x58')]()[_0x3234('0x29')](respondWithResult(_0x17abbb,null))[_0x3234('0x47')](handleError(_0x17abbb,null));};exports['getMembers']=function(_0x318b23,_0x754946,_0x481e63){var _0x821b19={'raw':!![],'where':{}},_0x5e1da3={},_0x14a75d;return db[_0x3234('0x32')][_0x3234('0x59')]({'where':{'id':_0x318b23[_0x3234('0x49')]['id']}})['then'](handleEntityNotFound(_0x754946,null))[_0x3234('0x29')](function(_0x2572d7){if(_0x2572d7){_0x14a75d=_0x2572d7[_0x3234('0x2a')]({'plain':!![]});_0x5e1da3[_0x3234('0x33')]=_[_0x3234('0x4a')](db['UserOpenchannelQueue']['rawAttributes']);_0x5e1da3['query']=_[_0x3234('0x4a')](_0x318b23['query']);_0x5e1da3['filters']=_[_0x3234('0x35')](_0x5e1da3['model'],_0x5e1da3[_0x3234('0x34')]);_0x821b19[_0x3234('0x36')]=_['intersection'](_0x5e1da3[_0x3234('0x33')],qs[_0x3234('0x4c')](_0x318b23[_0x3234('0x34')][_0x3234('0x4c')]));_0x821b19[_0x3234('0x36')]=_0x821b19[_0x3234('0x36')][_0x3234('0x37')]?_0x821b19[_0x3234('0x36')]:_0x5e1da3[_0x3234('0x33')];if(!_0x318b23['query'][_0x3234('0x38')](_0x3234('0x39'))){_0x821b19[_0x3234('0x22')]=qs[_0x3234('0x22')](_0x318b23['query'][_0x3234('0x22')]);_0x821b19[_0x3234('0x21')]=qs['offset'](_0x318b23[_0x3234('0x34')]['offset']);}_0x821b19['order']=qs['sort'](_0x318b23[_0x3234('0x34')][_0x3234('0x3b')]);_0x821b19[_0x3234('0x3c')]=qs['filters'](_[_0x3234('0x5a')](_0x318b23[_0x3234('0x34')],_0x5e1da3[_0x3234('0x3d')]));_0x821b19['where']['OpenchannelQueueId']=_0x2572d7['id'];if(_0x318b23[_0x3234('0x34')]['filter']){_0x821b19['where']=_[_0x3234('0x3e')](_0x821b19[_0x3234('0x3c')],{'$or':_[_0x3234('0x5b')](_0x821b19[_0x3234('0x36')],function(_0x3c4c69){var _0x4cf185={};_0x4cf185[_0x3c4c69]={'$like':'%'+_0x318b23['query'][_0x3234('0x42')]+'%'};return _0x4cf185;})});}_0x821b19=_[_0x3234('0x3e')]({},_0x821b19,_0x318b23[_0x3234('0x43')]);return db[_0x3234('0x5c')]['findAll'](_0x821b19);}})[_0x3234('0x29')](function(_0x4391cc){if(_0x4391cc){return db[_0x3234('0x5d')]['findAndCountAll']({'where':{'id':_[_0x3234('0x5b')](_0x4391cc,_0x3234('0x5e')),'role':_0x3234('0x5f')},'attributes':['id',_0x3234('0x2f'),_0x3234('0x60'),'updatedAt',_0x3234('0x61')]});}})['then'](function(_0x4c8115){if(_0x4c8115){return{'count':_0x4c8115['count'],'rows':_['map'](_0x4c8115[_0x3234('0x46')],function(_0x5791be){return{'membername':_0x5791be[_0x3234('0x2f')],'UserId':_0x5791be['id'],'queue_name':_0x14a75d['name'],'OpenchannelQueueId':_0x14a75d['id'],'interface':util[_0x3234('0x62')](_0x3234('0x63'),_0x3234('0x64'),_0x5791be[_0x3234('0x2f')]),'penalty':0x0,'paused':_0x5791be[_0x3234('0x60')],'createdAt':_0x5791be[_0x3234('0x61')],'updatedAt':_0x5791be[_0x3234('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3234('0x29')](respondWithFilteredResult(_0x754946,_0x821b19))['catch'](handleError(_0x754946,null));};exports[_0x3234('0x66')]=function(_0x28ba68,_0xf171aa,_0x29109c){var _0x35ada3={};var _0x1ba78e={};var _0x44d923;var _0x28abb8;return db['OpenchannelQueue'][_0x3234('0x59')]({'where':{'id':_0x28ba68[_0x3234('0x49')]['id']}})[_0x3234('0x29')](handleEntityNotFound(_0xf171aa,null))[_0x3234('0x29')](function(_0x125883){if(_0x125883){_0x44d923=_0x125883;_0x1ba78e['model']=_[_0x3234('0x4a')](db[_0x3234('0x67')][_0x3234('0x4b')]);_0x1ba78e['query']=_['keys'](_0x28ba68[_0x3234('0x34')]);_0x1ba78e[_0x3234('0x3d')]=_[_0x3234('0x35')](_0x1ba78e['model'],_0x1ba78e[_0x3234('0x34')]);_0x35ada3[_0x3234('0x36')]=_[_0x3234('0x35')](_0x1ba78e[_0x3234('0x33')],qs[_0x3234('0x4c')](_0x28ba68[_0x3234('0x34')][_0x3234('0x4c')]));_0x35ada3['attributes']=_0x35ada3[_0x3234('0x36')][_0x3234('0x37')]?_0x35ada3[_0x3234('0x36')]:_0x1ba78e['model'];_0x35ada3['order']=qs[_0x3234('0x3b')](_0x28ba68[_0x3234('0x34')][_0x3234('0x3b')]);_0x35ada3['where']=qs[_0x3234('0x3d')](_['pick'](_0x28ba68[_0x3234('0x34')],_0x1ba78e[_0x3234('0x3d')]));if(_0x28ba68[_0x3234('0x34')][_0x3234('0x42')]){_0x35ada3['where']=_['merge'](_0x35ada3[_0x3234('0x3c')],{'$or':_['map'](_0x35ada3[_0x3234('0x36')],function(_0x2039bf){var _0x5b5334={};_0x5b5334[_0x2039bf]={'$like':'%'+_0x28ba68[_0x3234('0x34')]['filter']+'%'};return _0x5b5334;})});}_0x35ada3=_[_0x3234('0x3e')]({},_0x35ada3,_0x28ba68[_0x3234('0x43')]);return _0x44d923[_0x3234('0x66')](_0x35ada3);}})[_0x3234('0x29')](function(_0x4b52a3){if(_0x4b52a3){_0x28abb8=_0x4b52a3[_0x3234('0x37')];if(!_0x28ba68['query'][_0x3234('0x38')](_0x3234('0x39'))){_0x35ada3[_0x3234('0x22')]=qs[_0x3234('0x22')](_0x28ba68[_0x3234('0x34')][_0x3234('0x22')]);_0x35ada3[_0x3234('0x21')]=qs[_0x3234('0x21')](_0x28ba68[_0x3234('0x34')]['offset']);}return _0x44d923[_0x3234('0x66')](_0x35ada3);}})[_0x3234('0x29')](function(_0x4f58be){if(_0x4f58be){return _0x4f58be?{'count':_0x28abb8,'rows':_0x4f58be}:null;}})[_0x3234('0x29')](respondWithResult(_0xf171aa,null))[_0x3234('0x47')](handleError(_0xf171aa,null));};exports['addTeams']=function(_0x1a2463,_0x570e15,_0xfae54){var _0x5c2426=_0x1a2463[_0x3234('0x57')][_0x3234('0x68')];return db['Team']['findAll']({'where':{'id':_['map'](_0x5c2426,'id')},'attributes':['id'],'include':[{'model':db[_0x3234('0x5d')],'as':_0x3234('0x69'),'attributes':['id',_0x3234('0x2f'),_0x3234('0x6a'),'voicePause',_0x3234('0x6b')],'raw':!![]}]})[_0x3234('0x29')](function(_0x168dfb){if(_0x168dfb){var _0x2b7eff=_[_0x3234('0x6c')](_0x168dfb,function(_0x478f95){var _0x255376=_0x478f95['get']({'plain':!![]});return _0x255376[_0x3234('0x69')];});return db[_0x3234('0x32')][_0x3234('0x53')]({'where':{'id':_0x1a2463[_0x3234('0x49')]['id']}})[_0x3234('0x29')](function(_0x17179c){return db[_0x3234('0x6d')]['transaction'](function(_0x1215ef){return _0x17179c[_0x3234('0x6e')](_['map'](_0x5c2426,'id'),{'transaction':_0x1215ef})['then'](function(){return BPromise[_0x3234('0x6f')](_0x2b7eff,function(_0x182656){return db['UserOpenchannelQueue'][_0x3234('0x70')]({'where':{'UserId':_0x182656['id'],'OpenchannelQueueId':_0x1a2463['params']['id']},'transaction':_0x1215ef});});})[_0x3234('0x29')](function(){_0x2b7eff['forEach'](function(_0x3aa485){socket[_0x3234('0x71')]('userOpenchannelQueue:save',{'UserId':_0x3aa485['id'],'OpenchannelQueueId':_0x17179c['id']});});});});});}})['then'](respondWithStatusCode(_0x570e15,null))['catch'](handleError(_0x570e15,null));};exports[_0x3234('0x72')]=function(_0xe8c364,_0x249f0c,_0x1c3567){return db[_0x3234('0x67')][_0x3234('0x45')]({'where':{'id':_0xe8c364[_0x3234('0x34')][_0x3234('0x73')]},'attributes':['id'],'include':[{'model':db[_0x3234('0x5d')],'as':_0x3234('0x69'),'attributes':['id'],'raw':!![]}]})[_0x3234('0x29')](handleEntityNotFound(_0x249f0c,null))[_0x3234('0x29')](function(_0x306fe5){var _0x2ab609=_[_0x3234('0x5b')](_0x306fe5,'id');var _0x40b3f6=[];var _0x3fc1bb=[];var _0x4cc802=squel[_0x3234('0x74')]();_0x4cc802[_0x3234('0x41')](_0x3234('0x75'))[_0x3234('0x76')](_0x3234('0x77'),'tq')['join'](_0x3234('0x78'),'ut',_0x3234('0x79'))[_0x3234('0x3c')](_0x3234('0x7a'),_0xe8c364[_0x3234('0x49')]['id']);for(var _0x578c5b=0x0;_0x578c5b<_0x306fe5[_0x3234('0x37')];_0x578c5b+=0x1){let _0x293344=_0x306fe5[_0x578c5b];for(var _0x9563fa=0x0;_0x9563fa<_0x293344[_0x3234('0x69')][_0x3234('0x37')];_0x9563fa+=0x1){let _0x369afa=_0x293344['Agents'][_0x9563fa];var _0x7d54da=_0x4cc802[_0x3234('0x7b')]();_0x7d54da[_0x3234('0x3c')]('ut.UserId\x20=\x20?',_0x369afa['id']);_0x3fc1bb[_0x3234('0x7c')](db[_0x3234('0x6d')][_0x3234('0x34')](_0x7d54da[_0x3234('0x7d')](),{'type':db['sequelize']['QueryTypes'][_0x3234('0x7e')]})[_0x3234('0x29')](function(_0xaf90ec){if(_0xaf90ec[_0x3234('0x37')]===0x1){return _0x369afa['id'];}else{var _0x246805=_['every'](_[_0x3234('0x5b')](_0xaf90ec,'TeamId'),function(_0xd35658){return _[_0x3234('0x7f')](_0x2ab609,_0xd35658);});if(_0x246805){return _0x369afa['id'];}}}));}}return BPromise[_0x3234('0x80')](_0x3fc1bb)['then'](function(_0x252834){_0x40b3f6=_(_0x40b3f6)[_0x3234('0x81')](_0x252834)['compact']()[_0x3234('0x82')]();return db[_0x3234('0x32')][_0x3234('0x53')]({'where':{'id':_0xe8c364[_0x3234('0x49')]['id']}})[_0x3234('0x29')](function(_0x2c5fdc){return db[_0x3234('0x6d')][_0x3234('0x83')](function(_0x161095){return _0x2c5fdc['removeTeams'](_0xe8c364[_0x3234('0x34')][_0x3234('0x73')],{'transaction':_0x161095})[_0x3234('0x29')](function(){if(!_[_0x3234('0x84')](_0x40b3f6)){return _0x2c5fdc['removeAgents'](_0x40b3f6,{'transaction':_0x161095});}})['then'](function(){_0x40b3f6[_0x3234('0x85')](function(_0x21ccbb){socket[_0x3234('0x71')](_0x3234('0x86'),{'UserId':_0x21ccbb,'OpenchannelQueueId':_0x2c5fdc['id']});});});});});});})['then'](respondWithStatusCode(_0x249f0c,null))[_0x3234('0x47')](handleError(_0x249f0c,null));};exports[_0x3234('0x87')]=function(_0x5e5e07,_0x2395b3,_0x51818a){return db['OpenchannelQueue']['find']({'where':{'id':_0x5e5e07['params']['id']}})['then'](handleEntityNotFound(_0x2395b3,null))['then'](function(_0x4e2f58){if(_0x4e2f58){return _0x4e2f58[_0x3234('0x87')](_0x5e5e07[_0x3234('0x57')][_0x3234('0x73')],_[_0x3234('0x88')](_0x5e5e07[_0x3234('0x57')],['ids','id'])||{})[_0x3234('0x89')](function(_0x5cdca7){for(var _0x71307=0x0;_0x71307<_0x5e5e07[_0x3234('0x57')][_0x3234('0x73')][_0x3234('0x37')];_0x71307+=0x1){socket[_0x3234('0x71')]('userOpenchannelQueue:save',{'UserId':_0x5e5e07[_0x3234('0x57')][_0x3234('0x73')][_0x71307],'OpenchannelQueueId':_0x5e5e07[_0x3234('0x49')]['id']});}return _0x5cdca7;});}})[_0x3234('0x29')](respondWithResult(_0x2395b3,null))['catch'](handleError(_0x2395b3,null));};exports[_0x3234('0x8a')]=function(_0x2e837c,_0x5db69a,_0x5e3c4c){return db['OpenchannelQueue'][_0x3234('0x53')]({'where':{'id':_0x2e837c[_0x3234('0x49')]['id']}})['then'](handleEntityNotFound(_0x5db69a,null))[_0x3234('0x29')](function(_0x5add24){if(_0x5add24){return _0x5add24[_0x3234('0x8a')](_0x2e837c[_0x3234('0x34')][_0x3234('0x73')])['then'](function(){if(_[_0x3234('0x8b')](_0x2e837c[_0x3234('0x34')][_0x3234('0x73')])){for(var _0x2d6b40=0x0;_0x2d6b40<_0x2e837c[_0x3234('0x34')]['ids'][_0x3234('0x37')];_0x2d6b40+=0x1){socket[_0x3234('0x71')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2e837c['query'][_0x3234('0x73')][_0x2d6b40]),'OpenchannelQueueId':Number(_0x2e837c[_0x3234('0x49')]['id'])});}}else{socket[_0x3234('0x71')](_0x3234('0x86'),{'UserId':Number(_0x2e837c[_0x3234('0x34')][_0x3234('0x73')]),'OpenchannelQueueId':Number(_0x2e837c[_0x3234('0x49')]['id'])});}});}})[_0x3234('0x29')](respondWithStatusCode(_0x5db69a,null))[_0x3234('0x47')](handleError(_0x5db69a,null));};exports[_0x3234('0x8c')]=function(_0xccfb65,_0x1a6437,_0x409fa7){var _0x59804b={};var _0x44ab71={};var _0x48e110;var _0x451bb2;return db[_0x3234('0x32')][_0x3234('0x59')]({'where':{'id':_0xccfb65[_0x3234('0x49')]['id']}})[_0x3234('0x29')](handleEntityNotFound(_0x1a6437,null))[_0x3234('0x29')](function(_0x105d8b){if(_0x105d8b){_0x48e110=_0x105d8b;_0x44ab71[_0x3234('0x33')]=_[_0x3234('0x4a')](db['User'][_0x3234('0x4b')]);_0x44ab71['query']=_[_0x3234('0x4a')](_0xccfb65['query']);_0x44ab71['filters']=_[_0x3234('0x35')](_0x44ab71['model'],_0x44ab71[_0x3234('0x34')]);_0x59804b[_0x3234('0x36')]=_[_0x3234('0x35')](_0x44ab71[_0x3234('0x33')],qs[_0x3234('0x4c')](_0xccfb65['query'][_0x3234('0x4c')]));_0x59804b[_0x3234('0x36')]=_0x59804b[_0x3234('0x36')][_0x3234('0x37')]?_0x59804b[_0x3234('0x36')]:_0x44ab71[_0x3234('0x33')];_0x59804b[_0x3234('0x3a')]=qs['sort'](_0xccfb65['query'][_0x3234('0x3b')]);_0x59804b[_0x3234('0x3c')]=qs[_0x3234('0x3d')](_[_0x3234('0x5a')](_0xccfb65['query'],_0x44ab71[_0x3234('0x3d')]));if(_0xccfb65[_0x3234('0x34')][_0x3234('0x42')]){_0x59804b[_0x3234('0x3c')]=_['merge'](_0x59804b['where'],{'$or':_[_0x3234('0x5b')](_0x59804b[_0x3234('0x36')],function(_0x4eda1b){var _0x564fd5={};_0x564fd5[_0x4eda1b]={'$like':'%'+_0xccfb65['query']['filter']+'%'};return _0x564fd5;})});}_0x59804b=_[_0x3234('0x3e')]({},_0x59804b,_0xccfb65[_0x3234('0x43')]);return _0x48e110[_0x3234('0x8c')](_0x59804b);}})[_0x3234('0x29')](function(_0x47ade1){if(_0x47ade1){_0x451bb2=_0x47ade1['length'];if(!_0xccfb65[_0x3234('0x34')]['hasOwnProperty']('nolimit')){_0x59804b[_0x3234('0x22')]=qs[_0x3234('0x22')](_0xccfb65['query'][_0x3234('0x22')]);_0x59804b[_0x3234('0x21')]=qs[_0x3234('0x21')](_0xccfb65['query'][_0x3234('0x21')]);}return _0x48e110[_0x3234('0x8c')](_0x59804b);}})[_0x3234('0x29')](function(_0x24e2eb){if(_0x24e2eb){return _0x24e2eb?{'count':_0x451bb2,'rows':_0x24e2eb}:null;}})[_0x3234('0x29')](respondWithResult(_0x1a6437,null))[_0x3234('0x47')](handleError(_0x1a6437,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index d00c4b3..044800c 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 _0x1140=['events','../../mysqldb','OpenchannelQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2cd568,_0x26a4bf){var _0x139f64=function(_0xa992c0){while(--_0xa992c0){_0x2cd568['push'](_0x2cd568['shift']());}};_0x139f64(++_0x26a4bf);}(_0x1140,0x1ea));var _0x0114=function(_0x396015,_0x2dc176){_0x396015=_0x396015-0x0;var _0x4f6d53=_0x1140[_0x396015];return _0x4f6d53;};'use strict';var EventEmitter=require(_0x0114('0x0'));var OpenchannelQueue=require(_0x0114('0x1'))['db'][_0x0114('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x0114('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0114('0x4'),'afterDestroy':_0x0114('0x5')};function emitEvent(_0x4b86ca){return function(_0x11ce97,_0x19ee15,_0x4c96cf){OpenchannelQueueEvents[_0x0114('0x6')](_0x4b86ca+':'+_0x11ce97['id'],_0x11ce97);OpenchannelQueueEvents[_0x0114('0x6')](_0x4b86ca,_0x11ce97);_0x4c96cf(null);};}for(var e in events){if(events[_0x0114('0x7')](e)){var event=events[e];OpenchannelQueue[_0x0114('0x8')](e,emitEvent(event));}}module[_0x0114('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x6732=['events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x292fbe,_0x1148ec){var _0x53ddce=function(_0x1890e5){while(--_0x1890e5){_0x292fbe['push'](_0x292fbe['shift']());}};_0x53ddce(++_0x1148ec);}(_0x6732,0xf0));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x2673('0x0'));var OpenchannelQueue=require(_0x2673('0x1'))['db'][_0x2673('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x2673('0x3')](0x0);var events={'afterCreate':_0x2673('0x4'),'afterUpdate':'update','afterDestroy':_0x2673('0x5')};function emitEvent(_0x30c1e6){return function(_0x5bc6b9,_0x10747a,_0x25542c){OpenchannelQueueEvents[_0x2673('0x6')](_0x30c1e6+':'+_0x5bc6b9['id'],_0x5bc6b9);OpenchannelQueueEvents['emit'](_0x30c1e6,_0x5bc6b9);_0x25542c(null);};}for(var e in events){if(events[_0x2673('0x7')](e)){var event=events[e];OpenchannelQueue[_0x2673('0x8')](e,emitEvent(event));}}module[_0x2673('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index d98c58a..8eb75bd 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 _0x1cf3=['exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./openchannelQueue.attributes'];(function(_0x297ce4,_0x1d7136){var _0x25ae12=function(_0xb1d813){while(--_0xb1d813){_0x297ce4['push'](_0x297ce4['shift']());}};_0x25ae12(++_0x1d7136);}(_0x1cf3,0x1be));var _0x31cf=function(_0x4a5bec,_0x26c1d6){_0x4a5bec=_0x4a5bec-0x0;var _0x221616=_0x1cf3[_0x4a5bec];return _0x221616;};'use strict';var _=require(_0x31cf('0x0'));var util=require(_0x31cf('0x1'));var logger=require(_0x31cf('0x2'))(_0x31cf('0x3'));var moment=require('moment');var BPromise=require(_0x31cf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31cf('0x5'));var rimraf=require(_0x31cf('0x6'));var config=require(_0x31cf('0x7'));var attributes=require(_0x31cf('0x8'));module[_0x31cf('0x9')]=function(_0x44dd04,_0x2b7cd4){return _0x44dd04[_0x31cf('0xa')](_0x31cf('0xb'),attributes,{'tableName':_0x31cf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec81=['exports','define','OpenchannelQueue','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xec81,0x71));var _0x1ec8=function(_0x505733,_0x4f7706){_0x505733=_0x505733-0x0;var _0x4d7dad=_0xec81[_0x505733];return _0x4d7dad;};'use strict';var _=require('lodash');var util=require(_0x1ec8('0x0'));var logger=require('../../config/logger')(_0x1ec8('0x1'));var moment=require('moment');var BPromise=require(_0x1ec8('0x2'));var rp=require(_0x1ec8('0x3'));var fs=require('fs');var path=require(_0x1ec8('0x4'));var rimraf=require(_0x1ec8('0x5'));var config=require(_0x1ec8('0x6'));var attributes=require(_0x1ec8('0x7'));module[_0x1ec8('0x8')]=function(_0x255380,_0x58ab6d){return _0x255380[_0x1ec8('0x9')](_0x1ec8('0xa'),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 8f9db69..76b60b9 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 _0x2b61=['options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue','stringify','ShowOpenchannelQueue','OpenchannelQueue','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b61,0xea));var _0x12b6=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0x2b61[_0x4da356];return _0x321b07;};'use strict';var _=require(_0x12b6('0x0'));var util=require(_0x12b6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x12b6('0x2'));var fs=require('fs');var Redis=require(_0x12b6('0x3'));var db=require(_0x12b6('0x4'))['db'];var utils=require(_0x12b6('0x5'));var logger=require(_0x12b6('0x6'))('rpc');var config=require(_0x12b6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x12b6('0x8')][_0x12b6('0x9')]({'port':0x232a});config[_0x12b6('0xa')]=_[_0x12b6('0xb')](config[_0x12b6('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x12b6('0xc'))(new Redis(config[_0x12b6('0xa')]));require('./openchannelQueue.socket')[_0x12b6('0xd')](socket);function respondWithRpcPromise(_0x4bd961,_0x588dec,_0x610a3d){return new BPromise(function(_0x4967c2,_0x2045ac){return client[_0x12b6('0xe')](_0x4bd961,_0x610a3d)[_0x12b6('0xf')](function(_0x568b8e){logger['info'](_0x12b6('0x10'),_0x588dec,_0x12b6('0x11'));logger[_0x12b6('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x588dec,_0x12b6('0x11'),JSON['stringify'](_0x568b8e));if(_0x568b8e[_0x12b6('0x13')]){if(_0x568b8e[_0x12b6('0x13')][_0x12b6('0x14')]===0x1f4){logger[_0x12b6('0x13')](_0x12b6('0x10'),_0x588dec,_0x568b8e[_0x12b6('0x13')][_0x12b6('0x15')]);return _0x2045ac(_0x568b8e['error']['message']);}logger['error'](_0x12b6('0x10'),_0x588dec,_0x568b8e[_0x12b6('0x13')]['message']);return _0x4967c2(_0x568b8e['error'][_0x12b6('0x15')]);}else{logger[_0x12b6('0x16')](_0x12b6('0x10'),_0x588dec,_0x12b6('0x11'));_0x4967c2(_0x568b8e['result'][_0x12b6('0x15')]);}})[_0x12b6('0x17')](function(_0x23c5ab){logger[_0x12b6('0x13')](_0x12b6('0x10'),_0x588dec,_0x23c5ab);_0x2045ac(_0x23c5ab);});});}exports['GetOpenchannelQueue']=function(_0xec34e9){var _0x571f2d=this;return new Promise(function(_0x23a662,_0x59ec0c){return db['OpenchannelQueue'][_0x12b6('0x18')]({'raw':_0xec34e9['options']?_0xec34e9[_0x12b6('0x19')][_0x12b6('0x1a')]===undefined?!![]:![]:!![],'where':_0xec34e9[_0x12b6('0x19')]?_0xec34e9[_0x12b6('0x19')][_0x12b6('0x1b')]||null:null,'attributes':_0xec34e9[_0x12b6('0x19')]?_0xec34e9[_0x12b6('0x19')][_0x12b6('0x1c')]||null:null,'limit':_0xec34e9['options']?_0xec34e9[_0x12b6('0x19')][_0x12b6('0x1d')]||null:null,'include':_0xec34e9[_0x12b6('0x19')]?_0xec34e9[_0x12b6('0x19')][_0x12b6('0x1e')]?_[_0x12b6('0x1f')](_0xec34e9['options'][_0x12b6('0x1e')],function(_0x1def12){return{'model':db[_0x1def12['model']],'as':_0x1def12['as'],'attributes':_0x1def12[_0x12b6('0x1c')],'include':_0x1def12[_0x12b6('0x1e')]?_['map'](_0x1def12[_0x12b6('0x1e')],function(_0x2143ce){return{'model':db[_0x2143ce[_0x12b6('0x20')]],'as':_0x2143ce['as'],'attributes':_0x2143ce['attributes'],'include':_0x2143ce['include']?_[_0x12b6('0x1f')](_0x2143ce['include'],function(_0x582615){return{'model':db[_0x582615['model']],'as':_0x582615['as'],'attributes':_0x582615[_0x12b6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x12b6('0xf')](function(_0x47f76d){logger[_0x12b6('0x16')](_0x12b6('0x21'),_0xec34e9);logger['debug'](_0x12b6('0x21'),_0xec34e9,JSON[_0x12b6('0x22')](_0x47f76d));_0x23a662(_0x47f76d);})[_0x12b6('0x17')](function(_0x47a288){logger[_0x12b6('0x13')]('GetOpenchannelQueue',_0x47a288[_0x12b6('0x15')],_0xec34e9);_0x59ec0c(_0x571f2d[_0x12b6('0x13')](0x1f4,_0x47a288['message']));});});};exports[_0x12b6('0x23')]=function(_0x19fa0a){var _0x34983d=this;return new Promise(function(_0x2cdb18,_0x77d0c3){return db[_0x12b6('0x24')]['find']({'raw':_0x19fa0a[_0x12b6('0x19')]?_0x19fa0a[_0x12b6('0x19')][_0x12b6('0x1a')]===undefined?!![]:![]:!![],'where':_0x19fa0a[_0x12b6('0x19')]?_0x19fa0a[_0x12b6('0x19')][_0x12b6('0x1b')]||null:null,'attributes':_0x19fa0a['options']?_0x19fa0a['options'][_0x12b6('0x1c')]||null:null,'include':_0x19fa0a['options']?_0x19fa0a[_0x12b6('0x19')][_0x12b6('0x1e')]?_[_0x12b6('0x1f')](_0x19fa0a[_0x12b6('0x19')]['include'],function(_0x231168){return{'model':db[_0x231168[_0x12b6('0x20')]],'as':_0x231168['as'],'attributes':_0x231168['attributes'],'include':_0x231168[_0x12b6('0x1e')]?_[_0x12b6('0x1f')](_0x231168['include'],function(_0x56a2d2){return{'model':db[_0x56a2d2['model']],'as':_0x56a2d2['as'],'attributes':_0x56a2d2[_0x12b6('0x1c')],'include':_0x56a2d2[_0x12b6('0x1e')]?_[_0x12b6('0x1f')](_0x56a2d2['include'],function(_0x534620){return{'model':db[_0x534620[_0x12b6('0x20')]],'as':_0x534620['as'],'attributes':_0x534620['attributes']};}):[]};}):[]};}):[]:[]})[_0x12b6('0xf')](function(_0x42a400){logger[_0x12b6('0x16')](_0x12b6('0x23'),_0x19fa0a);logger['debug'](_0x12b6('0x23'),_0x19fa0a,JSON[_0x12b6('0x22')](_0x42a400));_0x2cdb18(_0x42a400);})[_0x12b6('0x17')](function(_0x119901){logger[_0x12b6('0x13')]('ShowOpenchannelQueue',_0x119901['message'],_0x19fa0a);_0x77d0c3(_0x34983d[_0x12b6('0x13')](0x1f4,_0x119901[_0x12b6('0x15')]));});});}; \ No newline at end of file +var _0x6eed=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','include','map','model','info','ShowOpenchannelQueue','find','where'];(function(_0x1a9a0c,_0x56aafd){var _0x5d9231=function(_0x29c332){while(--_0x29c332){_0x1a9a0c['push'](_0x1a9a0c['shift']());}};_0x5d9231(++_0x56aafd);}(_0x6eed,0xf0));var _0xd6ee=function(_0x236092,_0x2f90ba){_0x236092=_0x236092-0x0;var _0x353481=_0x6eed[_0x236092];return _0x353481;};'use strict';var _=require(_0xd6ee('0x0'));var util=require('util');var moment=require(_0xd6ee('0x1'));var BPromise=require(_0xd6ee('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6ee('0x3'));var db=require(_0xd6ee('0x4'))['db'];var utils=require(_0xd6ee('0x5'));var logger=require('../../config/logger')(_0xd6ee('0x6'));var config=require(_0xd6ee('0x7'));var jayson=require(_0xd6ee('0x8'));var client=jayson[_0xd6ee('0x9')]['http']({'port':0x232a});config[_0xd6ee('0xa')]=_[_0xd6ee('0xb')](config[_0xd6ee('0xa')],{'host':_0xd6ee('0xc'),'port':0x18eb});var socket=require(_0xd6ee('0xd'))(new Redis(config['redis']));require(_0xd6ee('0xe'))['register'](socket);function respondWithRpcPromise(_0x5c7bbf,_0x550723,_0x598cdf){return new BPromise(function(_0x3d897e,_0x2d62a8){return client[_0xd6ee('0xf')](_0x5c7bbf,_0x598cdf)[_0xd6ee('0x10')](function(_0x2c61ee){logger['info'](_0xd6ee('0x11'),_0x550723,_0xd6ee('0x12'));logger[_0xd6ee('0x13')](_0xd6ee('0x14'),_0x550723,_0xd6ee('0x12'),JSON[_0xd6ee('0x15')](_0x2c61ee));if(_0x2c61ee[_0xd6ee('0x16')]){if(_0x2c61ee[_0xd6ee('0x16')][_0xd6ee('0x17')]===0x1f4){logger[_0xd6ee('0x16')](_0xd6ee('0x11'),_0x550723,_0x2c61ee[_0xd6ee('0x16')][_0xd6ee('0x18')]);return _0x2d62a8(_0x2c61ee['error'][_0xd6ee('0x18')]);}logger[_0xd6ee('0x16')](_0xd6ee('0x11'),_0x550723,_0x2c61ee[_0xd6ee('0x16')][_0xd6ee('0x18')]);return _0x3d897e(_0x2c61ee[_0xd6ee('0x16')][_0xd6ee('0x18')]);}else{logger['info'](_0xd6ee('0x11'),_0x550723,_0xd6ee('0x12'));_0x3d897e(_0x2c61ee[_0xd6ee('0x19')][_0xd6ee('0x18')]);}})[_0xd6ee('0x1a')](function(_0x2deb3b){logger['error'](_0xd6ee('0x11'),_0x550723,_0x2deb3b);_0x2d62a8(_0x2deb3b);});});}exports[_0xd6ee('0x1b')]=function(_0x41224f){var _0x4ac4eb=this;return new Promise(function(_0x5434d7,_0x554131){return db[_0xd6ee('0x1c')][_0xd6ee('0x1d')]({'raw':_0x41224f[_0xd6ee('0x1e')]?_0x41224f[_0xd6ee('0x1e')][_0xd6ee('0x1f')]===undefined?!![]:![]:!![],'where':_0x41224f[_0xd6ee('0x1e')]?_0x41224f['options']['where']||null:null,'attributes':_0x41224f['options']?_0x41224f[_0xd6ee('0x1e')][_0xd6ee('0x20')]||null:null,'limit':_0x41224f[_0xd6ee('0x1e')]?_0x41224f['options']['limit']||null:null,'include':_0x41224f[_0xd6ee('0x1e')]?_0x41224f[_0xd6ee('0x1e')][_0xd6ee('0x21')]?_[_0xd6ee('0x22')](_0x41224f[_0xd6ee('0x1e')][_0xd6ee('0x21')],function(_0x2f7aa5){return{'model':db[_0x2f7aa5[_0xd6ee('0x23')]],'as':_0x2f7aa5['as'],'attributes':_0x2f7aa5[_0xd6ee('0x20')],'include':_0x2f7aa5[_0xd6ee('0x21')]?_[_0xd6ee('0x22')](_0x2f7aa5[_0xd6ee('0x21')],function(_0x26dd66){return{'model':db[_0x26dd66[_0xd6ee('0x23')]],'as':_0x26dd66['as'],'attributes':_0x26dd66[_0xd6ee('0x20')],'include':_0x26dd66[_0xd6ee('0x21')]?_[_0xd6ee('0x22')](_0x26dd66[_0xd6ee('0x21')],function(_0x2c9be7){return{'model':db[_0x2c9be7[_0xd6ee('0x23')]],'as':_0x2c9be7['as'],'attributes':_0x2c9be7[_0xd6ee('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27a199){logger[_0xd6ee('0x24')](_0xd6ee('0x1b'),_0x41224f);logger['debug'](_0xd6ee('0x1b'),_0x41224f,JSON['stringify'](_0x27a199));_0x5434d7(_0x27a199);})[_0xd6ee('0x1a')](function(_0x55efa2){logger[_0xd6ee('0x16')]('GetOpenchannelQueue',_0x55efa2[_0xd6ee('0x18')],_0x41224f);_0x554131(_0x4ac4eb[_0xd6ee('0x16')](0x1f4,_0x55efa2[_0xd6ee('0x18')]));});});};exports[_0xd6ee('0x25')]=function(_0x5744af){var _0x232766=this;return new Promise(function(_0x3f0c57,_0x4afee6){return db['OpenchannelQueue'][_0xd6ee('0x26')]({'raw':_0x5744af[_0xd6ee('0x1e')]?_0x5744af[_0xd6ee('0x1e')][_0xd6ee('0x1f')]===undefined?!![]:![]:!![],'where':_0x5744af[_0xd6ee('0x1e')]?_0x5744af[_0xd6ee('0x1e')][_0xd6ee('0x27')]||null:null,'attributes':_0x5744af[_0xd6ee('0x1e')]?_0x5744af['options'][_0xd6ee('0x20')]||null:null,'include':_0x5744af[_0xd6ee('0x1e')]?_0x5744af['options'][_0xd6ee('0x21')]?_[_0xd6ee('0x22')](_0x5744af[_0xd6ee('0x1e')][_0xd6ee('0x21')],function(_0x3f4bd8){return{'model':db[_0x3f4bd8[_0xd6ee('0x23')]],'as':_0x3f4bd8['as'],'attributes':_0x3f4bd8[_0xd6ee('0x20')],'include':_0x3f4bd8['include']?_[_0xd6ee('0x22')](_0x3f4bd8['include'],function(_0x575716){return{'model':db[_0x575716[_0xd6ee('0x23')]],'as':_0x575716['as'],'attributes':_0x575716[_0xd6ee('0x20')],'include':_0x575716[_0xd6ee('0x21')]?_[_0xd6ee('0x22')](_0x575716[_0xd6ee('0x21')],function(_0x41004f){return{'model':db[_0x41004f[_0xd6ee('0x23')]],'as':_0x41004f['as'],'attributes':_0x41004f[_0xd6ee('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd6ee('0x10')](function(_0x3065c1){logger[_0xd6ee('0x24')](_0xd6ee('0x25'),_0x5744af);logger[_0xd6ee('0x13')]('ShowOpenchannelQueue',_0x5744af,JSON[_0xd6ee('0x15')](_0x3065c1));_0x3f0c57(_0x3065c1);})[_0xd6ee('0x1a')](function(_0x114620){logger[_0xd6ee('0x16')]('ShowOpenchannelQueue',_0x114620[_0xd6ee('0x18')],_0x5744af);_0x4afee6(_0x232766[_0xd6ee('0x16')](0x1f4,_0x114620[_0xd6ee('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 2fd4e0d..84b2151 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 _0x5e85=['./openchannelQueue.events','save','emit','removeListener','register','openchannelQueue:'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x5e85,0x90));var _0x55e8=function(_0x300d03,_0x2d3768){_0x300d03=_0x300d03-0x0;var _0x4c12a1=_0x5e85[_0x300d03];return _0x4c12a1;};'use strict';var OpenchannelQueueEvents=require(_0x55e8('0x0'));var events=[_0x55e8('0x1'),'remove','update'];function createListener(_0x5886b3,_0x4f0e25){return function(_0x32d5d5){_0x4f0e25[_0x55e8('0x2')](_0x5886b3,_0x32d5d5);};}function removeListener(_0x3aa928,_0x42a24f){return function(){OpenchannelQueueEvents[_0x55e8('0x3')](_0x3aa928,_0x42a24f);};}exports[_0x55e8('0x4')]=function(_0x45d7b8){for(var _0x14c274=0x0,_0x29053c=events['length'];_0x14c274<_0x29053c;_0x14c274++){var _0x1e10b7=events[_0x14c274];var _0x1cfb89=createListener(_0x55e8('0x5')+_0x1e10b7,_0x45d7b8);OpenchannelQueueEvents['on'](_0x1e10b7,_0x1cfb89);}}; \ No newline at end of file +var _0xce71=['removeListener','register','length','openchannelQueue:','./openchannelQueue.events','remove','update','emit'];(function(_0x4d7379,_0x4b4e63){var _0x46d7cf=function(_0x53f5f0){while(--_0x53f5f0){_0x4d7379['push'](_0x4d7379['shift']());}};_0x46d7cf(++_0x4b4e63);}(_0xce71,0xac));var _0x1ce7=function(_0x35f7c3,_0x455238){_0x35f7c3=_0x35f7c3-0x0;var _0x20720f=_0xce71[_0x35f7c3];return _0x20720f;};'use strict';var OpenchannelQueueEvents=require(_0x1ce7('0x0'));var events=['save',_0x1ce7('0x1'),_0x1ce7('0x2')];function createListener(_0x5285a8,_0x1fd3ec){return function(_0x21cb9d){_0x1fd3ec[_0x1ce7('0x3')](_0x5285a8,_0x21cb9d);};}function removeListener(_0x2ece4f,_0x970802){return function(){OpenchannelQueueEvents[_0x1ce7('0x4')](_0x2ece4f,_0x970802);};}exports[_0x1ce7('0x5')]=function(_0x122002){for(var _0x7824a9=0x0,_0x1d377f=events[_0x1ce7('0x6')];_0x7824a9<_0x1d377f;_0x7824a9++){var _0x76c1be=events[_0x7824a9];var _0x411173=createListener(_0x1ce7('0x7')+_0x76c1be,_0x122002);OpenchannelQueueEvents['on'](_0x76c1be,_0x411173);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index bfe911f..745d129 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 _0x8975=['update','delete','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create'];(function(_0x8bf294,_0x1ca4ae){var _0x596021=function(_0x2d1e15){while(--_0x2d1e15){_0x8bf294['push'](_0x8bf294['shift']());}};_0x596021(++_0x1ca4ae);}(_0x8975,0xff));var _0x5897=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x8975[_0x138adb];return _0x1b27f2;};'use strict';var multer=require(_0x5897('0x0'));var util=require(_0x5897('0x1'));var path=require(_0x5897('0x2'));var timeout=require(_0x5897('0x3'));var express=require(_0x5897('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5897('0x5'));var config=require(_0x5897('0x6'));var controller=require(_0x5897('0x7'));router[_0x5897('0x8')]('/',auth[_0x5897('0x9')](),controller['index']);router['get'](_0x5897('0xa'),auth[_0x5897('0x9')](),controller[_0x5897('0xb')]);router[_0x5897('0x8')](_0x5897('0xc'),auth['isAuthenticated'](),controller[_0x5897('0xd')]);router['post']('/',auth[_0x5897('0x9')](),controller[_0x5897('0xe')]);router['put'](_0x5897('0xc'),auth[_0x5897('0x9')](),controller[_0x5897('0xf')]);router[_0x5897('0x10')]('/:id',auth[_0x5897('0x9')](),controller['destroy']);module[_0x5897('0x11')]=router; \ No newline at end of file +var _0xeccd=['exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','/describe','/:id','post','put','update','delete','destroy'];(function(_0x2fc026,_0xdc4f7a){var _0x34d056=function(_0x457d02){while(--_0x457d02){_0x2fc026['push'](_0x2fc026['shift']());}};_0x34d056(++_0xdc4f7a);}(_0xeccd,0x1d5));var _0xdecc=function(_0xfff43f,_0xc670d4){_0xfff43f=_0xfff43f-0x0;var _0x353c84=_0xeccd[_0xfff43f];return _0x353c84;};'use strict';var multer=require(_0xdecc('0x0'));var util=require('util');var path=require(_0xdecc('0x1'));var timeout=require(_0xdecc('0x2'));var express=require('express');var router=express[_0xdecc('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xdecc('0x4'));var config=require(_0xdecc('0x5'));var controller=require(_0xdecc('0x6'));router['get']('/',auth[_0xdecc('0x7')](),controller[_0xdecc('0x8')]);router[_0xdecc('0x9')](_0xdecc('0xa'),auth[_0xdecc('0x7')](),controller['describe']);router['get'](_0xdecc('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xdecc('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdecc('0xd')](_0xdecc('0xb'),auth[_0xdecc('0x7')](),controller[_0xdecc('0xe')]);router[_0xdecc('0xf')](_0xdecc('0xb'),auth[_0xdecc('0x7')](),controller[_0xdecc('0x10')]);module[_0xdecc('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 1c6b737..b87b591 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 _0x71a4=['DATE','moment','exports','STRING'];(function(_0x30867c,_0x53364c){var _0x4a39e6=function(_0x2c0502){while(--_0x2c0502){_0x30867c['push'](_0x30867c['shift']());}};_0x4a39e6(++_0x53364c);}(_0x71a4,0x151));var _0x471a=function(_0x1ffe5d,_0x53763f){_0x1ffe5d=_0x1ffe5d-0x0;var _0x4505b1=_0x71a4[_0x1ffe5d];return _0x4505b1;};'use strict';var moment=require(_0x471a('0x0'));var Sequelize=require('sequelize');module[_0x471a('0x1')]={'uniqueid':{'type':Sequelize[_0x471a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x471a('0x2')]},'joinAt':{'type':Sequelize[_0x471a('0x3')]},'leaveAt':{'type':Sequelize[_0x471a('0x3')]},'acceptAt':{'type':Sequelize[_0x471a('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf43d=['moment','sequelize','exports','STRING','DATE'];(function(_0x401b0a,_0x4f7dbb){var _0x6c2841=function(_0x4ee46d){while(--_0x4ee46d){_0x401b0a['push'](_0x401b0a['shift']());}};_0x6c2841(++_0x4f7dbb);}(_0xf43d,0x1ef));var _0xdf43=function(_0x331167,_0x211eeb){_0x331167=_0x331167-0x0;var _0x9d001b=_0xf43d[_0x331167];return _0x9d001b;};'use strict';var moment=require(_0xdf43('0x0'));var Sequelize=require(_0xdf43('0x1'));module[_0xdf43('0x2')]={'uniqueid':{'type':Sequelize[_0xdf43('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xdf43('0x3')]},'joinAt':{'type':Sequelize[_0xdf43('0x4')]},'leaveAt':{'type':Sequelize[_0xdf43('0x4')]},'acceptAt':{'type':Sequelize[_0xdf43('0x4')]},'exitAt':{'type':Sequelize[_0xdf43('0x4')]},'reason':{'type':Sequelize[_0xdf43('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 3dc7e1b..205d531 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 _0xeb5d=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','save','then','destroy','error','stack','name','send','index','OpenchannelQueueReport','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../config/logger'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xeb5d,0x164));var _0xdeb5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xeb5d[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0xdeb5('0x0'));var emlformat=require(_0xdeb5('0x1'));var rimraf=require(_0xdeb5('0x2'));var zipdir=require(_0xdeb5('0x3'));var jsonpatch=require(_0xdeb5('0x4'));var rp=require(_0xdeb5('0x5'));var moment=require(_0xdeb5('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xdeb5('0x7'));var util=require(_0xdeb5('0x8'));var path=require(_0xdeb5('0x9'));var sox=require(_0xdeb5('0xa'));var csv=require(_0xdeb5('0xb'));var ejs=require(_0xdeb5('0xc'));var fs=require('fs');var _=require(_0xdeb5('0xd'));var squel=require('squel');var crypto=require(_0xdeb5('0xe'));var jsforce=require(_0xdeb5('0xf'));var deskjs=require(_0xdeb5('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdeb5('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdeb5('0x12'))('api');var utils=require(_0xdeb5('0x13'));var config=require(_0xdeb5('0x14'));var db=require(_0xdeb5('0x15'))['db'];function respondWithStatusCode(_0x1f0e26,_0x3662e4){_0x3662e4=_0x3662e4||0xcc;return function(_0x2bb07d){if(_0x2bb07d){return _0x1f0e26[_0xdeb5('0x16')](_0x3662e4);}return _0x1f0e26[_0xdeb5('0x17')](_0x3662e4)[_0xdeb5('0x18')]();};}function respondWithResult(_0x2984ad,_0x9e520d){_0x9e520d=_0x9e520d||0xc8;return function(_0x275c16){if(_0x275c16){return _0x2984ad[_0xdeb5('0x17')](_0x9e520d)['json'](_0x275c16);}};}function respondWithFilteredResult(_0x37fab5,_0x373a20){return function(_0x42ef8c){if(_0x42ef8c){var _0x4ce61f=_0x42ef8c[_0xdeb5('0x19')],_0x5178ac=_0x373a20[_0xdeb5('0x1a')],_0x2c0491=_0x373a20['offset']+_0x373a20[_0xdeb5('0x1b')],_0x1cca85;if(_0x2c0491>=_0x4ce61f){_0x2c0491=_0x4ce61f;_0x1cca85=0xc8;}else{_0x1cca85=0xce;}_0x37fab5[_0xdeb5('0x17')](_0x1cca85);return _0x37fab5[_0xdeb5('0x1c')]('Content-Range',_0x5178ac+'-'+_0x2c0491+'/'+_0x4ce61f)[_0xdeb5('0x1d')](_0x42ef8c);}return null;};}function patchUpdates(_0x41cacd){return function(_0x2b7c47){try{jsonpatch[_0xdeb5('0x1e')](_0x2b7c47,_0x41cacd,!![]);}catch(_0x10d2db){return BPromise['reject'](_0x10d2db);}return _0x2b7c47[_0xdeb5('0x1f')]();};}function saveUpdates(_0x2abbc3,_0x10f27c){return function(_0x329076){if(_0x329076){return _0x329076['update'](_0x2abbc3)[_0xdeb5('0x20')](function(_0x221e0d){return _0x221e0d;});}return null;};}function removeEntity(_0x18cb02,_0x223bdc){return function(_0x216dbe){if(_0x216dbe){return _0x216dbe[_0xdeb5('0x21')]()[_0xdeb5('0x20')](function(){_0x18cb02['status'](0xcc)[_0xdeb5('0x18')]();});}};}function handleEntityNotFound(_0x12c07b,_0x40a780){return function(_0x454d14){if(!_0x454d14){_0x12c07b[_0xdeb5('0x16')](0x194);}return _0x454d14;};}function handleError(_0x10d4a0,_0x1643f9){_0x1643f9=_0x1643f9||0x1f4;return function(_0x5be3e6){logger[_0xdeb5('0x22')](_0x5be3e6[_0xdeb5('0x23')]);if(_0x5be3e6[_0xdeb5('0x24')]){delete _0x5be3e6[_0xdeb5('0x24')];}_0x10d4a0[_0xdeb5('0x17')](_0x1643f9)[_0xdeb5('0x25')](_0x5be3e6);};}exports[_0xdeb5('0x26')]=function(_0x55e374,_0x459041){var _0x4afe4d={},_0x2f4906={},_0x826627={'count':0x0,'rows':[]};var _0x5f0179=db[_0xdeb5('0x27')][_0xdeb5('0x28')];_0x2f4906[_0xdeb5('0x29')]=_['keys'](_0x5f0179);_0x2f4906['query']=_['keys'](_0x55e374[_0xdeb5('0x2a')]);_0x2f4906[_0xdeb5('0x2b')]=_[_0xdeb5('0x2c')](_0x2f4906['model'],_0x2f4906['query']);_0x4afe4d[_0xdeb5('0x2d')]=_['intersection'](_0x2f4906['model'],qs['fields'](_0x55e374[_0xdeb5('0x2a')][_0xdeb5('0x2e')]));_0x4afe4d[_0xdeb5('0x2d')]=_0x4afe4d[_0xdeb5('0x2d')][_0xdeb5('0x2f')]?_0x4afe4d['attributes']:_0x2f4906['model'];if(!_0x55e374['query'][_0xdeb5('0x30')](_0xdeb5('0x31'))){_0x4afe4d[_0xdeb5('0x1b')]=qs[_0xdeb5('0x1b')](_0x55e374[_0xdeb5('0x2a')]['limit']);_0x4afe4d['offset']=qs[_0xdeb5('0x1a')](_0x55e374[_0xdeb5('0x2a')]['offset']);}_0x4afe4d[_0xdeb5('0x32')]=qs[_0xdeb5('0x33')](_0x55e374[_0xdeb5('0x2a')]['sort']);_0x4afe4d[_0xdeb5('0x34')]=qs[_0xdeb5('0x2b')](_[_0xdeb5('0x35')](_0x55e374[_0xdeb5('0x2a')],_0x2f4906[_0xdeb5('0x2b')]));if(_0x55e374[_0xdeb5('0x2a')]['filter']){_0x4afe4d[_0xdeb5('0x34')]=_[_0xdeb5('0x36')](_0x4afe4d[_0xdeb5('0x34')],{'$or':_[_0xdeb5('0x37')](_0x5f0179,function(_0x5b73b4){if(_0x5b73b4[_0xdeb5('0x38')][_0xdeb5('0x39')]!==_0xdeb5('0x3a')){var _0x1e6e96={};_0x1e6e96[_0x5b73b4[_0xdeb5('0x3b')]]={'$like':'%'+_0x55e374[_0xdeb5('0x2a')][_0xdeb5('0x3c')]+'%'};return _0x1e6e96;}})});}_0x4afe4d=_[_0xdeb5('0x36')]({},_0x4afe4d,_0x55e374[_0xdeb5('0x3d')]);var _0x221a07={'where':_0x4afe4d[_0xdeb5('0x34')]};return db[_0xdeb5('0x27')][_0xdeb5('0x19')](_0x221a07)[_0xdeb5('0x20')](function(_0x5b61c0){_0x826627['count']=_0x5b61c0;if(_0x55e374[_0xdeb5('0x2a')][_0xdeb5('0x3e')]){_0x4afe4d[_0xdeb5('0x3f')]=[{'all':!![]}];}return db[_0xdeb5('0x27')][_0xdeb5('0x40')](_0x4afe4d);})['then'](function(_0xb7206){_0x826627[_0xdeb5('0x41')]=_0xb7206;return _0x826627;})['then'](respondWithFilteredResult(_0x459041,_0x4afe4d))['catch'](handleError(_0x459041,null));};exports[_0xdeb5('0x42')]=function(_0x349538,_0x4ce3de){var _0x3374ee={'raw':!![],'where':{'id':_0x349538[_0xdeb5('0x43')]['id']}},_0x337dff={};_0x337dff[_0xdeb5('0x29')]=_[_0xdeb5('0x44')](db[_0xdeb5('0x27')][_0xdeb5('0x28')]);_0x337dff[_0xdeb5('0x2a')]=_[_0xdeb5('0x44')](_0x349538[_0xdeb5('0x2a')]);_0x337dff[_0xdeb5('0x2b')]=_[_0xdeb5('0x2c')](_0x337dff[_0xdeb5('0x29')],_0x337dff[_0xdeb5('0x2a')]);_0x3374ee[_0xdeb5('0x2d')]=_[_0xdeb5('0x2c')](_0x337dff[_0xdeb5('0x29')],qs[_0xdeb5('0x2e')](_0x349538[_0xdeb5('0x2a')]['fields']));_0x3374ee[_0xdeb5('0x2d')]=_0x3374ee['attributes'][_0xdeb5('0x2f')]?_0x3374ee[_0xdeb5('0x2d')]:_0x337dff[_0xdeb5('0x29')];if(_0x349538[_0xdeb5('0x2a')][_0xdeb5('0x3e')]){_0x3374ee[_0xdeb5('0x3f')]=[{'all':!![]}];}_0x3374ee=_[_0xdeb5('0x36')]({},_0x3374ee,_0x349538['options']);return db[_0xdeb5('0x27')][_0xdeb5('0x45')](_0x3374ee)[_0xdeb5('0x20')](handleEntityNotFound(_0x4ce3de,null))[_0xdeb5('0x20')](respondWithResult(_0x4ce3de,null))[_0xdeb5('0x46')](handleError(_0x4ce3de,null));};exports[_0xdeb5('0x47')]=function(_0x4b76f0,_0x330a9f){return db['OpenchannelQueueReport'][_0xdeb5('0x47')](_0x4b76f0[_0xdeb5('0x48')],{})[_0xdeb5('0x20')](respondWithResult(_0x330a9f,0xc9))[_0xdeb5('0x46')](handleError(_0x330a9f,null));};exports[_0xdeb5('0x49')]=function(_0x4fdc44,_0x51b4de){if(_0x4fdc44['body']['id']){delete _0x4fdc44[_0xdeb5('0x48')]['id'];}return db[_0xdeb5('0x27')][_0xdeb5('0x45')]({'where':{'id':_0x4fdc44[_0xdeb5('0x43')]['id']}})[_0xdeb5('0x20')](handleEntityNotFound(_0x51b4de,null))[_0xdeb5('0x20')](saveUpdates(_0x4fdc44[_0xdeb5('0x48')],null))[_0xdeb5('0x20')](respondWithResult(_0x51b4de,null))[_0xdeb5('0x46')](handleError(_0x51b4de,null));};exports['destroy']=function(_0x2beceb,_0x16a972){return db[_0xdeb5('0x27')]['find']({'where':{'id':_0x2beceb['params']['id']}})['then'](handleEntityNotFound(_0x16a972,null))[_0xdeb5('0x20')](removeEntity(_0x16a972,null))[_0xdeb5('0x46')](handleError(_0x16a972,null));};exports['describe']=function(_0x4fe33e,_0x5b0fc2){return db['OpenchannelQueueReport'][_0xdeb5('0x4a')]()[_0xdeb5('0x20')](respondWithResult(_0x5b0fc2,null))[_0xdeb5('0x46')](handleError(_0x5b0fc2,null));}; \ No newline at end of file +var _0xce15=['include','catch','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','OpenchannelQueueReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','key','VIRTUAL','field','options','includeAll'];(function(_0x306df1,_0x917f06){var _0x2c0394=function(_0x205f48){while(--_0x205f48){_0x306df1['push'](_0x306df1['shift']());}};_0x2c0394(++_0x917f06);}(_0xce15,0x10f));var _0x5ce1=function(_0x481844,_0x259b1f){_0x481844=_0x481844-0x0;var _0x2afc17=_0xce15[_0x481844];return _0x2afc17;};'use strict';var pdf=require(_0x5ce1('0x0'));var emlformat=require(_0x5ce1('0x1'));var rimraf=require(_0x5ce1('0x2'));var zipdir=require(_0x5ce1('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5ce1('0x4'));var Mustache=require(_0x5ce1('0x5'));var util=require(_0x5ce1('0x6'));var path=require(_0x5ce1('0x7'));var sox=require(_0x5ce1('0x8'));var csv=require(_0x5ce1('0x9'));var ejs=require(_0x5ce1('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5ce1('0xb'));var crypto=require(_0x5ce1('0xc'));var jsforce=require(_0x5ce1('0xd'));var deskjs=require(_0x5ce1('0xe'));var toCsv=require(_0x5ce1('0x9'));var querystring=require(_0x5ce1('0xf'));var Papa=require(_0x5ce1('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5ce1('0x11'));var logger=require(_0x5ce1('0x12'))(_0x5ce1('0x13'));var utils=require(_0x5ce1('0x14'));var config=require(_0x5ce1('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10770d,_0x54e592){_0x54e592=_0x54e592||0xcc;return function(_0x137b29){if(_0x137b29){return _0x10770d['sendStatus'](_0x54e592);}return _0x10770d[_0x5ce1('0x16')](_0x54e592)[_0x5ce1('0x17')]();};}function respondWithResult(_0x2d50c8,_0x1d474f){_0x1d474f=_0x1d474f||0xc8;return function(_0x4e2d4a){if(_0x4e2d4a){return _0x2d50c8[_0x5ce1('0x16')](_0x1d474f)['json'](_0x4e2d4a);}};}function respondWithFilteredResult(_0x3da4aa,_0x1d5f6c){return function(_0xddce06){if(_0xddce06){var _0x219109=_0xddce06[_0x5ce1('0x18')],_0x47756=_0x1d5f6c['offset'],_0x565abe=_0x1d5f6c[_0x5ce1('0x19')]+_0x1d5f6c['limit'],_0x1c0f94;if(_0x565abe>=_0x219109){_0x565abe=_0x219109;_0x1c0f94=0xc8;}else{_0x1c0f94=0xce;}_0x3da4aa['status'](_0x1c0f94);return _0x3da4aa[_0x5ce1('0x1a')](_0x5ce1('0x1b'),_0x47756+'-'+_0x565abe+'/'+_0x219109)['json'](_0xddce06);}return null;};}function patchUpdates(_0x17897a){return function(_0x5a353c){try{jsonpatch[_0x5ce1('0x1c')](_0x5a353c,_0x17897a,!![]);}catch(_0x165662){return BPromise[_0x5ce1('0x1d')](_0x165662);}return _0x5a353c[_0x5ce1('0x1e')]();};}function saveUpdates(_0x109e2b,_0x1acd47){return function(_0x7ec96c){if(_0x7ec96c){return _0x7ec96c[_0x5ce1('0x1f')](_0x109e2b)[_0x5ce1('0x20')](function(_0x38516f){return _0x38516f;});}return null;};}function removeEntity(_0x449486,_0xb7de84){return function(_0x284831){if(_0x284831){return _0x284831[_0x5ce1('0x21')]()['then'](function(){_0x449486['status'](0xcc)[_0x5ce1('0x17')]();});}};}function handleEntityNotFound(_0x786120,_0x3dd3e0){return function(_0x56a86a){if(!_0x56a86a){_0x786120['sendStatus'](0x194);}return _0x56a86a;};}function handleError(_0x3897d8,_0x405831){_0x405831=_0x405831||0x1f4;return function(_0x459bdd){logger['error'](_0x459bdd[_0x5ce1('0x22')]);if(_0x459bdd[_0x5ce1('0x23')]){delete _0x459bdd['name'];}_0x3897d8[_0x5ce1('0x16')](_0x405831)[_0x5ce1('0x24')](_0x459bdd);};}exports['index']=function(_0x4e831f,_0x384681){var _0x35142d={},_0x936510={},_0x516b66={'count':0x0,'rows':[]};var _0x3d5fa4=db[_0x5ce1('0x25')][_0x5ce1('0x26')];_0x936510[_0x5ce1('0x27')]=_['keys'](_0x3d5fa4);_0x936510['query']=_[_0x5ce1('0x28')](_0x4e831f[_0x5ce1('0x29')]);_0x936510['filters']=_[_0x5ce1('0x2a')](_0x936510[_0x5ce1('0x27')],_0x936510[_0x5ce1('0x29')]);_0x35142d[_0x5ce1('0x2b')]=_[_0x5ce1('0x2a')](_0x936510[_0x5ce1('0x27')],qs[_0x5ce1('0x2c')](_0x4e831f[_0x5ce1('0x29')][_0x5ce1('0x2c')]));_0x35142d[_0x5ce1('0x2b')]=_0x35142d[_0x5ce1('0x2b')][_0x5ce1('0x2d')]?_0x35142d[_0x5ce1('0x2b')]:_0x936510['model'];if(!_0x4e831f[_0x5ce1('0x29')][_0x5ce1('0x2e')](_0x5ce1('0x2f'))){_0x35142d['limit']=qs['limit'](_0x4e831f['query']['limit']);_0x35142d['offset']=qs[_0x5ce1('0x19')](_0x4e831f[_0x5ce1('0x29')][_0x5ce1('0x19')]);}_0x35142d[_0x5ce1('0x30')]=qs['sort'](_0x4e831f['query'][_0x5ce1('0x31')]);_0x35142d[_0x5ce1('0x32')]=qs[_0x5ce1('0x33')](_['pick'](_0x4e831f[_0x5ce1('0x29')],_0x936510['filters']));if(_0x4e831f[_0x5ce1('0x29')][_0x5ce1('0x34')]){_0x35142d[_0x5ce1('0x32')]=_[_0x5ce1('0x35')](_0x35142d[_0x5ce1('0x32')],{'$or':_['map'](_0x3d5fa4,function(_0x272ef2){if(_0x272ef2['type'][_0x5ce1('0x36')]!==_0x5ce1('0x37')){var _0x8bd7e4={};_0x8bd7e4[_0x272ef2[_0x5ce1('0x38')]]={'$like':'%'+_0x4e831f[_0x5ce1('0x29')][_0x5ce1('0x34')]+'%'};return _0x8bd7e4;}})});}_0x35142d=_['merge']({},_0x35142d,_0x4e831f[_0x5ce1('0x39')]);var _0x2f171b={'where':_0x35142d[_0x5ce1('0x32')]};return db[_0x5ce1('0x25')][_0x5ce1('0x18')](_0x2f171b)[_0x5ce1('0x20')](function(_0x3eca18){_0x516b66[_0x5ce1('0x18')]=_0x3eca18;if(_0x4e831f[_0x5ce1('0x29')][_0x5ce1('0x3a')]){_0x35142d[_0x5ce1('0x3b')]=[{'all':!![]}];}return db[_0x5ce1('0x25')]['findAll'](_0x35142d);})['then'](function(_0x18d8a5){_0x516b66['rows']=_0x18d8a5;return _0x516b66;})['then'](respondWithFilteredResult(_0x384681,_0x35142d))[_0x5ce1('0x3c')](handleError(_0x384681,null));};exports['show']=function(_0x3997d4,_0x186f43){var _0x1eef01={'raw':!![],'where':{'id':_0x3997d4[_0x5ce1('0x3d')]['id']}},_0x1f5fd8={};_0x1f5fd8['model']=_[_0x5ce1('0x28')](db['OpenchannelQueueReport'][_0x5ce1('0x26')]);_0x1f5fd8[_0x5ce1('0x29')]=_[_0x5ce1('0x28')](_0x3997d4[_0x5ce1('0x29')]);_0x1f5fd8[_0x5ce1('0x33')]=_['intersection'](_0x1f5fd8[_0x5ce1('0x27')],_0x1f5fd8['query']);_0x1eef01[_0x5ce1('0x2b')]=_[_0x5ce1('0x2a')](_0x1f5fd8[_0x5ce1('0x27')],qs[_0x5ce1('0x2c')](_0x3997d4[_0x5ce1('0x29')][_0x5ce1('0x2c')]));_0x1eef01[_0x5ce1('0x2b')]=_0x1eef01[_0x5ce1('0x2b')][_0x5ce1('0x2d')]?_0x1eef01[_0x5ce1('0x2b')]:_0x1f5fd8[_0x5ce1('0x27')];if(_0x3997d4[_0x5ce1('0x29')][_0x5ce1('0x3a')]){_0x1eef01[_0x5ce1('0x3b')]=[{'all':!![]}];}_0x1eef01=_[_0x5ce1('0x35')]({},_0x1eef01,_0x3997d4[_0x5ce1('0x39')]);return db[_0x5ce1('0x25')][_0x5ce1('0x3e')](_0x1eef01)[_0x5ce1('0x20')](handleEntityNotFound(_0x186f43,null))['then'](respondWithResult(_0x186f43,null))[_0x5ce1('0x3c')](handleError(_0x186f43,null));};exports[_0x5ce1('0x3f')]=function(_0x167ee5,_0x45a1ef){return db['OpenchannelQueueReport']['create'](_0x167ee5['body'],{})[_0x5ce1('0x20')](respondWithResult(_0x45a1ef,0xc9))['catch'](handleError(_0x45a1ef,null));};exports['update']=function(_0x2fc011,_0x5ef001){if(_0x2fc011[_0x5ce1('0x40')]['id']){delete _0x2fc011[_0x5ce1('0x40')]['id'];}return db[_0x5ce1('0x25')][_0x5ce1('0x3e')]({'where':{'id':_0x2fc011[_0x5ce1('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5ef001,null))['then'](saveUpdates(_0x2fc011['body'],null))[_0x5ce1('0x20')](respondWithResult(_0x5ef001,null))[_0x5ce1('0x3c')](handleError(_0x5ef001,null));};exports['destroy']=function(_0x2e0f08,_0x52e364){return db[_0x5ce1('0x25')][_0x5ce1('0x3e')]({'where':{'id':_0x2e0f08[_0x5ce1('0x3d')]['id']}})[_0x5ce1('0x20')](handleEntityNotFound(_0x52e364,null))[_0x5ce1('0x20')](removeEntity(_0x52e364,null))[_0x5ce1('0x3c')](handleError(_0x52e364,null));};exports[_0x5ce1('0x41')]=function(_0x142f4f,_0x1a398b){return db[_0x5ce1('0x25')][_0x5ce1('0x41')]()[_0x5ce1('0x20')](respondWithResult(_0x1a398b,null))[_0x5ce1('0x3c')](handleError(_0x1a398b,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index a4a0a76..a634fcd 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 _0xa92e=['request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x10a89c,_0x3b9db9){var _0x15f7c6=function(_0x30ea87){while(--_0x30ea87){_0x10a89c['push'](_0x10a89c['shift']());}};_0x15f7c6(++_0x3b9db9);}(_0xa92e,0x1e5));var _0xea92=function(_0x5efbcb,_0x5319b2){_0x5efbcb=_0x5efbcb-0x0;var _0x4d44af=_0xa92e[_0x5efbcb];return _0x4d44af;};'use strict';var _=require(_0xea92('0x0'));var util=require('util');var logger=require(_0xea92('0x1'))(_0xea92('0x2'));var moment=require(_0xea92('0x3'));var BPromise=require(_0xea92('0x4'));var rp=require(_0xea92('0x5'));var fs=require('fs');var path=require(_0xea92('0x6'));var rimraf=require(_0xea92('0x7'));var config=require(_0xea92('0x8'));var attributes=require('./openchannelQueueReport.attributes');module[_0xea92('0x9')]=function(_0x786b1,_0x39ddce){return _0x786b1[_0xea92('0xa')](_0xea92('0xb'),attributes,{'tableName':_0xea92('0xc'),'paranoid':![],'indexes':[{'name':_0xea92('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x503a=['path','rimraf','../../config/environment','define','report_openchannel_queue','uniqueid','lodash','util','api','bluebird','request-promise'];(function(_0xa63003,_0x121f14){var _0xbf9166=function(_0x574133){while(--_0x574133){_0xa63003['push'](_0xa63003['shift']());}};_0xbf9166(++_0x121f14);}(_0x503a,0x19d));var _0xa503=function(_0x3116d6,_0x2d574f){_0x3116d6=_0x3116d6-0x0;var _0x18729d=_0x503a[_0x3116d6];return _0x18729d;};'use strict';var _=require(_0xa503('0x0'));var util=require(_0xa503('0x1'));var logger=require('../../config/logger')(_0xa503('0x2'));var moment=require('moment');var BPromise=require(_0xa503('0x3'));var rp=require(_0xa503('0x4'));var fs=require('fs');var path=require(_0xa503('0x5'));var rimraf=require(_0xa503('0x6'));var config=require(_0xa503('0x7'));var attributes=require('./openchannelQueueReport.attributes');module['exports']=function(_0x47f11d,_0x1eb8d1){return _0x47f11d[_0xa503('0x8')]('OpenchannelQueueReport',attributes,{'tableName':_0xa503('0x9'),'paranoid':![],'indexes':[{'name':_0xa503('0xa'),'fields':[_0xa503('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 2562c1d..1c5d522 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 _0xb422=['where','attributes','then','bluebird','../../mysqldb','../../config/logger','../../config/environment','client','http','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','UpdateOpenchannelQueueReport'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xb422,0x85));var _0x2b42=function(_0x3b22e9,_0x354406){_0x3b22e9=_0x3b22e9-0x0;var _0x230314=_0xb422[_0x3b22e9];return _0x230314;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2b42('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b42('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b42('0x2'))('rpc');var config=require(_0x2b42('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x2b42('0x4')][_0x2b42('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x750c2,_0x51b3bd,_0xde9c67){return new BPromise(function(_0x1b64f7,_0x12b303){return client['request'](_0x750c2,_0xde9c67)['then'](function(_0x4174e8){logger['info'](_0x2b42('0x6'),_0x51b3bd,_0x2b42('0x7'));logger[_0x2b42('0x8')](_0x2b42('0x9'),_0x51b3bd,'request\x20sent',JSON[_0x2b42('0xa')](_0x4174e8));if(_0x4174e8[_0x2b42('0xb')]){if(_0x4174e8['error'][_0x2b42('0xc')]===0x1f4){logger[_0x2b42('0xb')](_0x2b42('0x6'),_0x51b3bd,_0x4174e8[_0x2b42('0xb')]['message']);return _0x12b303(_0x4174e8['error'][_0x2b42('0xd')]);}logger[_0x2b42('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x51b3bd,_0x4174e8[_0x2b42('0xb')][_0x2b42('0xd')]);return _0x1b64f7(_0x4174e8[_0x2b42('0xb')][_0x2b42('0xd')]);}else{logger[_0x2b42('0xe')](_0x2b42('0x6'),_0x51b3bd,_0x2b42('0x7'));_0x1b64f7(_0x4174e8[_0x2b42('0xf')][_0x2b42('0xd')]);}})[_0x2b42('0x10')](function(_0x4897d8){logger[_0x2b42('0xb')](_0x2b42('0x6'),_0x51b3bd,_0x4897d8);_0x12b303(_0x4897d8);});});}exports[_0x2b42('0x11')]=function(_0x3e3426){var _0x27419d=this;return new Promise(function(_0x3ab83c,_0xa28ba4){return db[_0x2b42('0x12')]['create'](_0x3e3426[_0x2b42('0x13')],{'raw':_0x3e3426[_0x2b42('0x14')]?_0x3e3426['options'][_0x2b42('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x38d41c){logger[_0x2b42('0xe')](_0x2b42('0x11'),_0x3e3426);logger['debug']('CreateOpenchannelQueueReport',_0x3e3426,JSON[_0x2b42('0xa')](_0x38d41c));_0x3ab83c(_0x38d41c);})[_0x2b42('0x10')](function(_0x24ac96){logger[_0x2b42('0xb')]('CreateOpenchannelQueueReport',_0x24ac96[_0x2b42('0xd')],_0x3e3426);_0xa28ba4(_0x27419d[_0x2b42('0xb')](0x1f4,_0x24ac96['message']));});});};exports[_0x2b42('0x16')]=function(_0x2e9aa1){var _0x5ae878=this;return new Promise(function(_0x7b989d,_0x252b8){return db[_0x2b42('0x12')]['update'](_0x2e9aa1[_0x2b42('0x13')],{'raw':_0x2e9aa1[_0x2b42('0x14')]?_0x2e9aa1[_0x2b42('0x14')][_0x2b42('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e9aa1[_0x2b42('0x14')]?_0x2e9aa1[_0x2b42('0x14')][_0x2b42('0x17')]||null:null,'attributes':_0x2e9aa1[_0x2b42('0x14')]?_0x2e9aa1[_0x2b42('0x14')][_0x2b42('0x18')]||null:null,'limit':_0x2e9aa1[_0x2b42('0x14')]?_0x2e9aa1['options']['limit']||null:null})[_0x2b42('0x19')](function(_0xcb30f5){logger[_0x2b42('0xe')](_0x2b42('0x16'),_0x2e9aa1);logger['debug'](_0x2b42('0x16'),_0x2e9aa1,JSON[_0x2b42('0xa')](_0xcb30f5));_0x7b989d(_0xcb30f5);})[_0x2b42('0x10')](function(_0x5ba827){logger['error'](_0x2b42('0x16'),_0x5ba827[_0x2b42('0xd')],_0x2e9aa1);_0x252b8(_0x5ae878[_0x2b42('0xb')](0x1f4,_0x5ba827[_0x2b42('0xd')]));});});}; \ No newline at end of file +var _0xcaf2=['options','raw','CreateOpenchannelQueueReport','stringify','catch','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','OpenchannelQueueReport','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcaf2,0x8a));var _0x2caf=function(_0x2ceb31,_0x40ecf1){_0x2ceb31=_0x2ceb31-0x0;var _0x168859=_0xcaf2[_0x2ceb31];return _0x168859;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var moment=require(_0x2caf('0x1'));var BPromise=require(_0x2caf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2caf('0x3'));var db=require(_0x2caf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2caf('0x5'))('rpc');var config=require(_0x2caf('0x6'));var jayson=require(_0x2caf('0x7'));var client=jayson[_0x2caf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc44e4e,_0x314486,_0x4667c6){return new BPromise(function(_0x34e792,_0x5611aa){return client[_0x2caf('0x9')](_0xc44e4e,_0x4667c6)[_0x2caf('0xa')](function(_0x45e520){logger[_0x2caf('0xb')](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));logger[_0x2caf('0xe')](_0x2caf('0xf'),_0x314486,_0x2caf('0xd'),JSON['stringify'](_0x45e520));if(_0x45e520[_0x2caf('0x10')]){if(_0x45e520[_0x2caf('0x10')][_0x2caf('0x11')]===0x1f4){logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520[_0x2caf('0x10')][_0x2caf('0x12')]);return _0x5611aa(_0x45e520[_0x2caf('0x10')]['message']);}logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520['error']['message']);return _0x34e792(_0x45e520['error'][_0x2caf('0x12')]);}else{logger['info'](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));_0x34e792(_0x45e520[_0x2caf('0x13')][_0x2caf('0x12')]);}})['catch'](function(_0x184355){logger['error'](_0x2caf('0xc'),_0x314486,_0x184355);_0x5611aa(_0x184355);});});}exports['CreateOpenchannelQueueReport']=function(_0x4a33fc){var _0x3e975f=this;return new Promise(function(_0x58047b,_0xe72440){return db[_0x2caf('0x14')]['create'](_0x4a33fc[_0x2caf('0x15')],{'raw':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x17')]===undefined?!![]:![]:!![]})[_0x2caf('0xa')](function(_0x595f2f){logger[_0x2caf('0xb')](_0x2caf('0x18'),_0x4a33fc);logger[_0x2caf('0xe')](_0x2caf('0x18'),_0x4a33fc,JSON[_0x2caf('0x19')](_0x595f2f));_0x58047b(_0x595f2f);})[_0x2caf('0x1a')](function(_0x4092ba){logger[_0x2caf('0x10')](_0x2caf('0x18'),_0x4092ba[_0x2caf('0x12')],_0x4a33fc);_0xe72440(_0x3e975f[_0x2caf('0x10')](0x1f4,_0x4092ba['message']));});});};exports[_0x2caf('0x1b')]=function(_0x14bfd2){var _0x1f29b0=this;return new Promise(function(_0x401ea2,_0x3efa4e){return db[_0x2caf('0x14')][_0x2caf('0x1c')](_0x14bfd2[_0x2caf('0x15')],{'raw':_0x14bfd2[_0x2caf('0x16')]?_0x14bfd2[_0x2caf('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14bfd2[_0x2caf('0x16')]?_0x14bfd2[_0x2caf('0x16')][_0x2caf('0x1d')]||null:null,'attributes':_0x14bfd2[_0x2caf('0x16')]?_0x14bfd2[_0x2caf('0x16')][_0x2caf('0x1e')]||null:null,'limit':_0x14bfd2[_0x2caf('0x16')]?_0x14bfd2[_0x2caf('0x16')][_0x2caf('0x1f')]||null:null})[_0x2caf('0xa')](function(_0x30da75){logger[_0x2caf('0xb')](_0x2caf('0x1b'),_0x14bfd2);logger['debug'](_0x2caf('0x1b'),_0x14bfd2,JSON[_0x2caf('0x19')](_0x30da75));_0x401ea2(_0x30da75);})[_0x2caf('0x1a')](function(_0x25bbfc){logger[_0x2caf('0x10')](_0x2caf('0x1b'),_0x25bbfc[_0x2caf('0x12')],_0x14bfd2);_0x3efa4e(_0x1f29b0['error'](0x1f4,_0x25bbfc[_0x2caf('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index cc8c632..5623411 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(_0x2bf5bd,_0x120787){var _0xc810c0=function(_0xba9dd3){while(--_0xba9dd3){_0x2bf5bd['push'](_0x2bf5bd['shift']());}};_0xc810c0(++_0x120787);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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(_0x22663b,_0xc8c6e3){var _0x310d0a=function(_0x151e66){while(--_0x151e66){_0x22663b['push'](_0x22663b['shift']());}};_0x310d0a(++_0xc8c6e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 d91a132..9ff1113 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 _0x8606=['DATE','sequelize','exports','STRING','ENUM','agent','queue'];(function(_0x631a3c,_0x1b61b6){var _0x2bdfa3=function(_0x21711b){while(--_0x21711b){_0x631a3c['push'](_0x631a3c['shift']());}};_0x2bdfa3(++_0x1b61b6);}(_0x8606,0xbe));var _0x6860=function(_0x308ddd,_0x3a8401){_0x308ddd=_0x308ddd-0x0;var _0x3224c3=_0x8606[_0x308ddd];return _0x3224c3;};'use strict';var moment=require('moment');var Sequelize=require(_0x6860('0x0'));module[_0x6860('0x1')]={'uniqueid':{'type':Sequelize[_0x6860('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6860('0x3')]('account',_0x6860('0x4'),'queue'),'allowNull':![],'defaultValue':_0x6860('0x5')},'transferredAt':{'type':Sequelize[_0x6860('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x5f00=['account','queue','DATE','NOW','sequelize','exports','STRING','ENUM'];(function(_0x42c5c5,_0x3477a2){var _0x35d2a7=function(_0x29e0c2){while(--_0x29e0c2){_0x42c5c5['push'](_0x42c5c5['shift']());}};_0x35d2a7(++_0x3477a2);}(_0x5f00,0x13c));var _0x05f0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f00[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0x05f0('0x0'));module[_0x05f0('0x1')]={'uniqueid':{'type':Sequelize[_0x05f0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x05f0('0x3')](_0x05f0('0x4'),'agent',_0x05f0('0x5')),'allowNull':![],'defaultValue':_0x05f0('0x5')},'transferredAt':{'type':Sequelize[_0x05f0('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x05f0('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index cdace75..0eda5d1 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 _0xe5af=['key','options','OpenchannelTransferReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','update','then','destroy','error','stack','name','send','index','model','query','keys','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','type'];(function(_0x48069d,_0x4a402e){var _0x5adf14=function(_0x4b5e81){while(--_0x4b5e81){_0x48069d['push'](_0x48069d['shift']());}};_0x5adf14(++_0x4a402e);}(_0xe5af,0x9c));var _0xfe5a=function(_0x1e0ca5,_0x57fd4f){_0x1e0ca5=_0x1e0ca5-0x0;var _0x410923=_0xe5af[_0x1e0ca5];return _0x410923;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfe5a('0x0'));var rimraf=require(_0xfe5a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe5a('0x2'));var rp=require(_0xfe5a('0x3'));var moment=require(_0xfe5a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfe5a('0x5'));var util=require('util');var path=require('path');var sox=require(_0xfe5a('0x6'));var csv=require(_0xfe5a('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xfe5a('0x8'));var crypto=require(_0xfe5a('0x9'));var jsforce=require(_0xfe5a('0xa'));var deskjs=require(_0xfe5a('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfe5a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe5a('0xd'));var qs=require(_0xfe5a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe5a('0xf'))(_0xfe5a('0x10'));var utils=require(_0xfe5a('0x11'));var config=require(_0xfe5a('0x12'));var db=require(_0xfe5a('0x13'))['db'];function respondWithStatusCode(_0x5bf3b4,_0x2086c7){_0x2086c7=_0x2086c7||0xcc;return function(_0x9d1f4f){if(_0x9d1f4f){return _0x5bf3b4[_0xfe5a('0x14')](_0x2086c7);}return _0x5bf3b4[_0xfe5a('0x15')](_0x2086c7)[_0xfe5a('0x16')]();};}function respondWithResult(_0x58b72c,_0x33e574){_0x33e574=_0x33e574||0xc8;return function(_0x17bbbe){if(_0x17bbbe){return _0x58b72c[_0xfe5a('0x15')](_0x33e574)[_0xfe5a('0x17')](_0x17bbbe);}};}function respondWithFilteredResult(_0x319482,_0x217976){return function(_0x375380){if(_0x375380){var _0xeb454=_0x375380[_0xfe5a('0x18')],_0x111d4d=_0x217976[_0xfe5a('0x19')],_0x18c57b=_0x217976[_0xfe5a('0x19')]+_0x217976[_0xfe5a('0x1a')],_0x38f12e;if(_0x18c57b>=_0xeb454){_0x18c57b=_0xeb454;_0x38f12e=0xc8;}else{_0x38f12e=0xce;}_0x319482[_0xfe5a('0x15')](_0x38f12e);return _0x319482['set'](_0xfe5a('0x1b'),_0x111d4d+'-'+_0x18c57b+'/'+_0xeb454)[_0xfe5a('0x17')](_0x375380);}return null;};}function patchUpdates(_0x54d5fb){return function(_0x3b0101){try{jsonpatch[_0xfe5a('0x1c')](_0x3b0101,_0x54d5fb,!![]);}catch(_0x39d905){return BPromise['reject'](_0x39d905);}return _0x3b0101['save']();};}function saveUpdates(_0x3e11ad,_0x1c6ba7){return function(_0xded538){if(_0xded538){return _0xded538[_0xfe5a('0x1d')](_0x3e11ad)[_0xfe5a('0x1e')](function(_0x355869){return _0x355869;});}return null;};}function removeEntity(_0x564c1d,_0x4770bb){return function(_0x592521){if(_0x592521){return _0x592521[_0xfe5a('0x1f')]()[_0xfe5a('0x1e')](function(){_0x564c1d[_0xfe5a('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bbef1,_0x247be4){return function(_0x3e55fd){if(!_0x3e55fd){_0x4bbef1['sendStatus'](0x194);}return _0x3e55fd;};}function handleError(_0x44a0bd,_0x26f744){_0x26f744=_0x26f744||0x1f4;return function(_0x578d3e){logger[_0xfe5a('0x20')](_0x578d3e[_0xfe5a('0x21')]);if(_0x578d3e[_0xfe5a('0x22')]){delete _0x578d3e[_0xfe5a('0x22')];}_0x44a0bd['status'](_0x26f744)[_0xfe5a('0x23')](_0x578d3e);};}exports[_0xfe5a('0x24')]=function(_0x24481f,_0x1cd531){var _0x36bf20={},_0x222490={},_0xdbf1e0={'count':0x0,'rows':[]};var _0x2374b9=db['OpenchannelTransferReport']['rawAttributes'];_0x222490[_0xfe5a('0x25')]=_['keys'](_0x2374b9);_0x222490[_0xfe5a('0x26')]=_[_0xfe5a('0x27')](_0x24481f[_0xfe5a('0x26')]);_0x222490['filters']=_['intersection'](_0x222490['model'],_0x222490[_0xfe5a('0x26')]);_0x36bf20['attributes']=_['intersection'](_0x222490['model'],qs[_0xfe5a('0x28')](_0x24481f[_0xfe5a('0x26')][_0xfe5a('0x28')]));_0x36bf20[_0xfe5a('0x29')]=_0x36bf20[_0xfe5a('0x29')][_0xfe5a('0x2a')]?_0x36bf20[_0xfe5a('0x29')]:_0x222490[_0xfe5a('0x25')];if(!_0x24481f[_0xfe5a('0x26')][_0xfe5a('0x2b')](_0xfe5a('0x2c'))){_0x36bf20['limit']=qs[_0xfe5a('0x1a')](_0x24481f[_0xfe5a('0x26')]['limit']);_0x36bf20[_0xfe5a('0x19')]=qs[_0xfe5a('0x19')](_0x24481f[_0xfe5a('0x26')][_0xfe5a('0x19')]);}_0x36bf20[_0xfe5a('0x2d')]=qs['sort'](_0x24481f['query'][_0xfe5a('0x2e')]);_0x36bf20['where']=qs[_0xfe5a('0x2f')](_[_0xfe5a('0x30')](_0x24481f[_0xfe5a('0x26')],_0x222490[_0xfe5a('0x2f')]));if(_0x24481f['query'][_0xfe5a('0x31')]){_0x36bf20[_0xfe5a('0x32')]=_[_0xfe5a('0x33')](_0x36bf20['where'],{'$or':_[_0xfe5a('0x34')](_0x2374b9,function(_0x35588b){if(_0x35588b[_0xfe5a('0x35')][_0xfe5a('0x36')]!=='VIRTUAL'){var _0x2ab654={};_0x2ab654[_0x35588b['field']]={'$like':'%'+_0x24481f[_0xfe5a('0x26')][_0xfe5a('0x31')]+'%'};return _0x2ab654;}})});}_0x36bf20=_['merge']({},_0x36bf20,_0x24481f[_0xfe5a('0x37')]);var _0x45e31a={'where':_0x36bf20[_0xfe5a('0x32')]};return db[_0xfe5a('0x38')]['count'](_0x45e31a)[_0xfe5a('0x1e')](function(_0xd6edc4){_0xdbf1e0[_0xfe5a('0x18')]=_0xd6edc4;if(_0x24481f['query'][_0xfe5a('0x39')]){_0x36bf20[_0xfe5a('0x3a')]=[{'all':!![]}];}return db[_0xfe5a('0x38')][_0xfe5a('0x3b')](_0x36bf20);})[_0xfe5a('0x1e')](function(_0x162c48){_0xdbf1e0[_0xfe5a('0x3c')]=_0x162c48;return _0xdbf1e0;})[_0xfe5a('0x1e')](respondWithFilteredResult(_0x1cd531,_0x36bf20))[_0xfe5a('0x3d')](handleError(_0x1cd531,null));};exports[_0xfe5a('0x3e')]=function(_0x20da14,_0x585752){var _0x355d05={'raw':!![],'where':{'id':_0x20da14[_0xfe5a('0x3f')]['id']}},_0x315396={};_0x315396[_0xfe5a('0x25')]=_[_0xfe5a('0x27')](db[_0xfe5a('0x38')][_0xfe5a('0x40')]);_0x315396['query']=_[_0xfe5a('0x27')](_0x20da14[_0xfe5a('0x26')]);_0x315396['filters']=_['intersection'](_0x315396[_0xfe5a('0x25')],_0x315396['query']);_0x355d05['attributes']=_[_0xfe5a('0x41')](_0x315396[_0xfe5a('0x25')],qs['fields'](_0x20da14[_0xfe5a('0x26')]['fields']));_0x355d05[_0xfe5a('0x29')]=_0x355d05[_0xfe5a('0x29')][_0xfe5a('0x2a')]?_0x355d05[_0xfe5a('0x29')]:_0x315396[_0xfe5a('0x25')];if(_0x20da14[_0xfe5a('0x26')]['includeAll']){_0x355d05[_0xfe5a('0x3a')]=[{'all':!![]}];}_0x355d05=_[_0xfe5a('0x33')]({},_0x355d05,_0x20da14[_0xfe5a('0x37')]);return db[_0xfe5a('0x38')][_0xfe5a('0x42')](_0x355d05)[_0xfe5a('0x1e')](handleEntityNotFound(_0x585752,null))[_0xfe5a('0x1e')](respondWithResult(_0x585752,null))[_0xfe5a('0x3d')](handleError(_0x585752,null));};exports[_0xfe5a('0x43')]=function(_0x3fd4fc,_0x394609){return db[_0xfe5a('0x38')][_0xfe5a('0x43')](_0x3fd4fc[_0xfe5a('0x44')],{})['then'](respondWithResult(_0x394609,0xc9))[_0xfe5a('0x3d')](handleError(_0x394609,null));};exports[_0xfe5a('0x1d')]=function(_0x587204,_0x5ecb4c){if(_0x587204[_0xfe5a('0x44')]['id']){delete _0x587204[_0xfe5a('0x44')]['id'];}return db[_0xfe5a('0x38')][_0xfe5a('0x42')]({'where':{'id':_0x587204[_0xfe5a('0x3f')]['id']}})[_0xfe5a('0x1e')](handleEntityNotFound(_0x5ecb4c,null))[_0xfe5a('0x1e')](saveUpdates(_0x587204['body'],null))[_0xfe5a('0x1e')](respondWithResult(_0x5ecb4c,null))['catch'](handleError(_0x5ecb4c,null));};exports[_0xfe5a('0x1f')]=function(_0x5a807e,_0x433562){return db[_0xfe5a('0x38')][_0xfe5a('0x42')]({'where':{'id':_0x5a807e[_0xfe5a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x433562,null))[_0xfe5a('0x1e')](removeEntity(_0x433562,null))[_0xfe5a('0x3d')](handleError(_0x433562,null));};exports['describe']=function(_0x2db94b,_0x4d064f){return db['OpenchannelTransferReport'][_0xfe5a('0x45')]()['then'](respondWithResult(_0x4d064f,null))[_0xfe5a('0x3d')](handleError(_0x4d064f,null));}; \ No newline at end of file +var _0xd290=['where','pick','map','type','key','field','merge','options','includeAll','include','catch','params','rawAttributes','find','create','body','describe','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','count','offset','limit','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','OpenchannelTransferReport','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0xd290,0x165));var _0x0d29=function(_0x12e33e,_0x373b4f){_0x12e33e=_0x12e33e-0x0;var _0x8ac0f0=_0xd290[_0x12e33e];return _0x8ac0f0;};'use strict';var pdf=require(_0x0d29('0x0'));var emlformat=require(_0x0d29('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0d29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d29('0x3'));var BPromise=require(_0x0d29('0x4'));var Mustache=require(_0x0d29('0x5'));var util=require(_0x0d29('0x6'));var path=require(_0x0d29('0x7'));var sox=require('sox');var csv=require(_0x0d29('0x8'));var ejs=require(_0x0d29('0x9'));var fs=require('fs');var _=require(_0x0d29('0xa'));var squel=require(_0x0d29('0xb'));var crypto=require(_0x0d29('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0d29('0xd'));var toCsv=require(_0x0d29('0x8'));var querystring=require(_0x0d29('0xe'));var Papa=require('papaparse');var Redis=require(_0x0d29('0xf'));var authService=require(_0x0d29('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0d29('0x11'));var logger=require(_0x0d29('0x12'))('api');var utils=require(_0x0d29('0x13'));var config=require('../../config/environment');var db=require(_0x0d29('0x14'))['db'];function respondWithStatusCode(_0x2713af,_0x259768){_0x259768=_0x259768||0xcc;return function(_0x87cf36){if(_0x87cf36){return _0x2713af[_0x0d29('0x15')](_0x259768);}return _0x2713af['status'](_0x259768)[_0x0d29('0x16')]();};}function respondWithResult(_0x399d1a,_0x26d2b6){_0x26d2b6=_0x26d2b6||0xc8;return function(_0x94b2f5){if(_0x94b2f5){return _0x399d1a[_0x0d29('0x17')](_0x26d2b6)['json'](_0x94b2f5);}};}function respondWithFilteredResult(_0x5f2076,_0x49f132){return function(_0x247d1d){if(_0x247d1d){var _0x4acfd6=_0x247d1d[_0x0d29('0x18')],_0x44fe29=_0x49f132[_0x0d29('0x19')],_0x4c4044=_0x49f132[_0x0d29('0x19')]+_0x49f132[_0x0d29('0x1a')],_0x3131e1;if(_0x4c4044>=_0x4acfd6){_0x4c4044=_0x4acfd6;_0x3131e1=0xc8;}else{_0x3131e1=0xce;}_0x5f2076[_0x0d29('0x17')](_0x3131e1);return _0x5f2076['set'](_0x0d29('0x1b'),_0x44fe29+'-'+_0x4c4044+'/'+_0x4acfd6)[_0x0d29('0x1c')](_0x247d1d);}return null;};}function patchUpdates(_0xca30af){return function(_0x24e774){try{jsonpatch[_0x0d29('0x1d')](_0x24e774,_0xca30af,!![]);}catch(_0x244351){return BPromise[_0x0d29('0x1e')](_0x244351);}return _0x24e774['save']();};}function saveUpdates(_0x39722d,_0x11d2ec){return function(_0x215cd7){if(_0x215cd7){return _0x215cd7[_0x0d29('0x1f')](_0x39722d)[_0x0d29('0x20')](function(_0x20b278){return _0x20b278;});}return null;};}function removeEntity(_0x392394,_0x822a9a){return function(_0x44fbce){if(_0x44fbce){return _0x44fbce[_0x0d29('0x21')]()[_0x0d29('0x20')](function(){_0x392394[_0x0d29('0x17')](0xcc)[_0x0d29('0x16')]();});}};}function handleEntityNotFound(_0x5856df,_0x30e109){return function(_0x1b78b7){if(!_0x1b78b7){_0x5856df[_0x0d29('0x15')](0x194);}return _0x1b78b7;};}function handleError(_0xd3afa0,_0x4adc85){_0x4adc85=_0x4adc85||0x1f4;return function(_0x249205){logger[_0x0d29('0x22')](_0x249205[_0x0d29('0x23')]);if(_0x249205[_0x0d29('0x24')]){delete _0x249205[_0x0d29('0x24')];}_0xd3afa0[_0x0d29('0x17')](_0x4adc85)[_0x0d29('0x25')](_0x249205);};}exports['index']=function(_0x511281,_0x2f1814){var _0x4e1219={},_0x4083c3={},_0x50e519={'count':0x0,'rows':[]};var _0x5a6348=db[_0x0d29('0x26')]['rawAttributes'];_0x4083c3[_0x0d29('0x27')]=_['keys'](_0x5a6348);_0x4083c3[_0x0d29('0x28')]=_[_0x0d29('0x29')](_0x511281['query']);_0x4083c3[_0x0d29('0x2a')]=_[_0x0d29('0x2b')](_0x4083c3[_0x0d29('0x27')],_0x4083c3['query']);_0x4e1219[_0x0d29('0x2c')]=_[_0x0d29('0x2b')](_0x4083c3[_0x0d29('0x27')],qs[_0x0d29('0x2d')](_0x511281[_0x0d29('0x28')][_0x0d29('0x2d')]));_0x4e1219[_0x0d29('0x2c')]=_0x4e1219[_0x0d29('0x2c')][_0x0d29('0x2e')]?_0x4e1219[_0x0d29('0x2c')]:_0x4083c3['model'];if(!_0x511281[_0x0d29('0x28')][_0x0d29('0x2f')](_0x0d29('0x30'))){_0x4e1219[_0x0d29('0x1a')]=qs[_0x0d29('0x1a')](_0x511281[_0x0d29('0x28')]['limit']);_0x4e1219[_0x0d29('0x19')]=qs[_0x0d29('0x19')](_0x511281[_0x0d29('0x28')][_0x0d29('0x19')]);}_0x4e1219[_0x0d29('0x31')]=qs[_0x0d29('0x32')](_0x511281[_0x0d29('0x28')]['sort']);_0x4e1219[_0x0d29('0x33')]=qs[_0x0d29('0x2a')](_[_0x0d29('0x34')](_0x511281[_0x0d29('0x28')],_0x4083c3[_0x0d29('0x2a')]));if(_0x511281[_0x0d29('0x28')]['filter']){_0x4e1219[_0x0d29('0x33')]=_['merge'](_0x4e1219[_0x0d29('0x33')],{'$or':_[_0x0d29('0x35')](_0x5a6348,function(_0x2c74ec){if(_0x2c74ec[_0x0d29('0x36')][_0x0d29('0x37')]!=='VIRTUAL'){var _0x1404ac={};_0x1404ac[_0x2c74ec[_0x0d29('0x38')]]={'$like':'%'+_0x511281[_0x0d29('0x28')]['filter']+'%'};return _0x1404ac;}})});}_0x4e1219=_[_0x0d29('0x39')]({},_0x4e1219,_0x511281[_0x0d29('0x3a')]);var _0x5c47db={'where':_0x4e1219['where']};return db['OpenchannelTransferReport'][_0x0d29('0x18')](_0x5c47db)[_0x0d29('0x20')](function(_0x24a679){_0x50e519[_0x0d29('0x18')]=_0x24a679;if(_0x511281['query'][_0x0d29('0x3b')]){_0x4e1219[_0x0d29('0x3c')]=[{'all':!![]}];}return db[_0x0d29('0x26')]['findAll'](_0x4e1219);})['then'](function(_0x4fe57e){_0x50e519['rows']=_0x4fe57e;return _0x50e519;})[_0x0d29('0x20')](respondWithFilteredResult(_0x2f1814,_0x4e1219))[_0x0d29('0x3d')](handleError(_0x2f1814,null));};exports['show']=function(_0xf190ce,_0x3c46e9){var _0x341b8d={'raw':!![],'where':{'id':_0xf190ce[_0x0d29('0x3e')]['id']}},_0x207324={};_0x207324[_0x0d29('0x27')]=_[_0x0d29('0x29')](db[_0x0d29('0x26')][_0x0d29('0x3f')]);_0x207324['query']=_[_0x0d29('0x29')](_0xf190ce['query']);_0x207324[_0x0d29('0x2a')]=_[_0x0d29('0x2b')](_0x207324[_0x0d29('0x27')],_0x207324[_0x0d29('0x28')]);_0x341b8d[_0x0d29('0x2c')]=_[_0x0d29('0x2b')](_0x207324[_0x0d29('0x27')],qs[_0x0d29('0x2d')](_0xf190ce[_0x0d29('0x28')][_0x0d29('0x2d')]));_0x341b8d['attributes']=_0x341b8d[_0x0d29('0x2c')]['length']?_0x341b8d['attributes']:_0x207324[_0x0d29('0x27')];if(_0xf190ce['query'][_0x0d29('0x3b')]){_0x341b8d[_0x0d29('0x3c')]=[{'all':!![]}];}_0x341b8d=_[_0x0d29('0x39')]({},_0x341b8d,_0xf190ce[_0x0d29('0x3a')]);return db[_0x0d29('0x26')][_0x0d29('0x40')](_0x341b8d)[_0x0d29('0x20')](handleEntityNotFound(_0x3c46e9,null))['then'](respondWithResult(_0x3c46e9,null))[_0x0d29('0x3d')](handleError(_0x3c46e9,null));};exports['create']=function(_0x44069f,_0x5986d8){return db['OpenchannelTransferReport'][_0x0d29('0x41')](_0x44069f[_0x0d29('0x42')],{})[_0x0d29('0x20')](respondWithResult(_0x5986d8,0xc9))[_0x0d29('0x3d')](handleError(_0x5986d8,null));};exports[_0x0d29('0x1f')]=function(_0x35a95b,_0x4dedca){if(_0x35a95b[_0x0d29('0x42')]['id']){delete _0x35a95b['body']['id'];}return db['OpenchannelTransferReport'][_0x0d29('0x40')]({'where':{'id':_0x35a95b[_0x0d29('0x3e')]['id']}})[_0x0d29('0x20')](handleEntityNotFound(_0x4dedca,null))['then'](saveUpdates(_0x35a95b['body'],null))[_0x0d29('0x20')](respondWithResult(_0x4dedca,null))[_0x0d29('0x3d')](handleError(_0x4dedca,null));};exports[_0x0d29('0x21')]=function(_0x241ea1,_0x5ea255){return db[_0x0d29('0x26')][_0x0d29('0x40')]({'where':{'id':_0x241ea1['params']['id']}})[_0x0d29('0x20')](handleEntityNotFound(_0x5ea255,null))[_0x0d29('0x20')](removeEntity(_0x5ea255,null))[_0x0d29('0x3d')](handleError(_0x5ea255,null));};exports[_0x0d29('0x43')]=function(_0x491c6d,_0x1c341d){return db['OpenchannelTransferReport'][_0x0d29('0x43')]()[_0x0d29('0x20')](respondWithResult(_0x1c341d,null))[_0x0d29('0x3d')](handleError(_0x1c341d,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 2314920..c8ef8ff 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 _0xdb4d=['./openchannelTransferReport.attributes','define','report_openchannel_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0xdb4d,0x1d0));var _0xddb4=function(_0x7f20e2,_0x56fc19){_0x7f20e2=_0x7f20e2-0x0;var _0x56221b=_0xdb4d[_0x7f20e2];return _0x56221b;};'use strict';var _=require(_0xddb4('0x0'));var util=require(_0xddb4('0x1'));var logger=require('../../config/logger')(_0xddb4('0x2'));var moment=require(_0xddb4('0x3'));var BPromise=require(_0xddb4('0x4'));var rp=require(_0xddb4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xddb4('0x6'));module['exports']=function(_0x203780,_0x43af75){return _0x203780[_0xddb4('0x7')]('OpenchannelTransferReport',attributes,{'tableName':_0xddb4('0x8'),'paranoid':![],'indexes':[{'name':_0xddb4('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa23d=['exports','OpenchannelTransferReport','uniqueid','lodash','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x3db69e,_0x1980a6){var _0x3698bb=function(_0x31b859){while(--_0x31b859){_0x3db69e['push'](_0x3db69e['shift']());}};_0x3698bb(++_0x1980a6);}(_0xa23d,0x1c5));var _0xda23=function(_0x5d45b4,_0x29f0ea){_0x5d45b4=_0x5d45b4-0x0;var _0x2c6454=_0xa23d[_0x5d45b4];return _0x2c6454;};'use strict';var _=require(_0xda23('0x0'));var util=require(_0xda23('0x1'));var logger=require('../../config/logger')(_0xda23('0x2'));var moment=require(_0xda23('0x3'));var BPromise=require('bluebird');var rp=require(_0xda23('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xda23('0x5'));var config=require(_0xda23('0x6'));var attributes=require('./openchannelTransferReport.attributes');module[_0xda23('0x7')]=function(_0x1fef13,_0x498462){return _0x1fef13['define'](_0xda23('0x8'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xda23('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 9992125..bf9f191 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 _0xe633=['result','catch','lodash','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x395f5b,_0x46a83e){var _0x2358a2=function(_0x5195d4){while(--_0x5195d4){_0x395f5b['push'](_0x395f5b['shift']());}};_0x2358a2(++_0x46a83e);}(_0xe633,0xe6));var _0x3e63=function(_0x4c8d27,_0x2ebd0e){_0x4c8d27=_0x4c8d27-0x0;var _0x5ecd2e=_0xe633[_0x4c8d27];return _0x5ecd2e;};'use strict';var _=require(_0x3e63('0x0'));var util=require('util');var moment=require(_0x3e63('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e63('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3e63('0x3'));var logger=require(_0x3e63('0x4'))('rpc');var config=require(_0x3e63('0x5'));var jayson=require(_0x3e63('0x6'));var client=jayson[_0x3e63('0x7')][_0x3e63('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f40c9,_0x4bccb7,_0x4f23ba){return new BPromise(function(_0x328fd6,_0x44a6ae){return client[_0x3e63('0x9')](_0x3f40c9,_0x4f23ba)['then'](function(_0x2fd418){logger[_0x3e63('0xa')](_0x3e63('0xb'),_0x4bccb7,_0x3e63('0xc'));logger[_0x3e63('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x4bccb7,_0x3e63('0xc'),JSON['stringify'](_0x2fd418));if(_0x2fd418[_0x3e63('0xe')]){if(_0x2fd418[_0x3e63('0xe')][_0x3e63('0xf')]===0x1f4){logger[_0x3e63('0xe')](_0x3e63('0xb'),_0x4bccb7,_0x2fd418[_0x3e63('0xe')][_0x3e63('0x10')]);return _0x44a6ae(_0x2fd418[_0x3e63('0xe')][_0x3e63('0x10')]);}logger[_0x3e63('0xe')](_0x3e63('0xb'),_0x4bccb7,_0x2fd418[_0x3e63('0xe')]['message']);return _0x328fd6(_0x2fd418[_0x3e63('0xe')]['message']);}else{logger['info'](_0x3e63('0xb'),_0x4bccb7,_0x3e63('0xc'));_0x328fd6(_0x2fd418[_0x3e63('0x11')]['message']);}})[_0x3e63('0x12')](function(_0x3e67ef){logger[_0x3e63('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4bccb7,_0x3e67ef);_0x44a6ae(_0x3e67ef);});});} \ No newline at end of file +var _0x8f40=['request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f40,0x80));var _0x08f4=function(_0x323bec,_0x4a4ba9){_0x323bec=_0x323bec-0x0;var _0x35b5d9=_0x8f40[_0x323bec];return _0x35b5d9;};'use strict';var _=require('lodash');var util=require(_0x08f4('0x0'));var moment=require(_0x08f4('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x08f4('0x2'));var db=require(_0x08f4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x08f4('0x4'))(_0x08f4('0x5'));var config=require(_0x08f4('0x6'));var jayson=require(_0x08f4('0x7'));var client=jayson[_0x08f4('0x8')][_0x08f4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31ac91,_0x43d38f,_0xf2d0e5){return new BPromise(function(_0x18b96d,_0x189971){return client[_0x08f4('0xa')](_0x31ac91,_0xf2d0e5)[_0x08f4('0xb')](function(_0x52fd62){logger[_0x08f4('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x43d38f,_0x08f4('0xd'));logger[_0x08f4('0xe')](_0x08f4('0xf'),_0x43d38f,_0x08f4('0xd'),JSON[_0x08f4('0x10')](_0x52fd62));if(_0x52fd62['error']){if(_0x52fd62[_0x08f4('0x11')][_0x08f4('0x12')]===0x1f4){logger['error'](_0x08f4('0x13'),_0x43d38f,_0x52fd62[_0x08f4('0x11')][_0x08f4('0x14')]);return _0x189971(_0x52fd62[_0x08f4('0x11')][_0x08f4('0x14')]);}logger[_0x08f4('0x11')](_0x08f4('0x13'),_0x43d38f,_0x52fd62[_0x08f4('0x11')][_0x08f4('0x14')]);return _0x18b96d(_0x52fd62[_0x08f4('0x11')][_0x08f4('0x14')]);}else{logger[_0x08f4('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x43d38f,'request\x20sent');_0x18b96d(_0x52fd62[_0x08f4('0x15')]['message']);}})[_0x08f4('0x16')](function(_0x591ab7){logger[_0x08f4('0x11')](_0x08f4('0x13'),_0x43d38f,_0x591ab7);_0x189971(_0x591ab7);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 6cf1c9f..62063bd 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 _0x7877=['express','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','/:id','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x7877,0xed));var _0x7787=function(_0x426b0c,_0x29ed24){_0x426b0c=_0x426b0c-0x0;var _0x3723e0=_0x7877[_0x426b0c];return _0x3723e0;};'use strict';var multer=require('multer');var util=require(_0x7787('0x0'));var path=require(_0x7787('0x1'));var timeout=require(_0x7787('0x2'));var express=require(_0x7787('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7787('0x4'));var config=require(_0x7787('0x5'));var controller=require(_0x7787('0x6'));router['get']('/',auth[_0x7787('0x7')](),controller['index']);router['get'](_0x7787('0x8'),auth[_0x7787('0x7')](),controller['show']);router[_0x7787('0x9')]('/',auth['isAuthenticated'](),controller[_0x7787('0xa')]);router[_0x7787('0xb')](_0x7787('0x8'),auth[_0x7787('0x7')](),controller[_0x7787('0xc')]);router[_0x7787('0xd')](_0x7787('0x8'),auth[_0x7787('0x7')](),controller[_0x7787('0xe')]);module['exports']=router; \ No newline at end of file +var _0xfa6d=['show','post','create','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./pause.controller','get','isAuthenticated','index','/:id'];(function(_0x5aa2bd,_0x5c445b){var _0x52bcba=function(_0x4acf1f){while(--_0x4acf1f){_0x5aa2bd['push'](_0x5aa2bd['shift']());}};_0x52bcba(++_0x5c445b);}(_0xfa6d,0x14a));var _0xdfa6=function(_0x3a6c46,_0x5f42cb){_0x3a6c46=_0x3a6c46-0x0;var _0x2a8699=_0xfa6d[_0x3a6c46];return _0x2a8699;};'use strict';var multer=require(_0xdfa6('0x0'));var util=require(_0xdfa6('0x1'));var path=require(_0xdfa6('0x2'));var timeout=require('connect-timeout');var express=require(_0xdfa6('0x3'));var router=express[_0xdfa6('0x4')]();var auth=require(_0xdfa6('0x5'));var interaction=require(_0xdfa6('0x6'));var config=require('../../config/environment');var controller=require(_0xdfa6('0x7'));router[_0xdfa6('0x8')]('/',auth[_0xdfa6('0x9')](),controller[_0xdfa6('0xa')]);router[_0xdfa6('0x8')](_0xdfa6('0xb'),auth[_0xdfa6('0x9')](),controller[_0xdfa6('0xc')]);router[_0xdfa6('0xd')]('/',auth[_0xdfa6('0x9')](),controller[_0xdfa6('0xe')]);router[_0xdfa6('0xf')](_0xdfa6('0xb'),auth[_0xdfa6('0x9')](),controller[_0xdfa6('0x10')]);router['delete'](_0xdfa6('0xb'),auth[_0xdfa6('0x9')](),controller[_0xdfa6('0x11')]);module[_0xdfa6('0x12')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index ccd08cf..3f85d75 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 _0x1d28=['sequelize','name','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1d28,0x99));var _0x81d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d28[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x81d2('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x81d2('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x81d2('0x2')]}}; \ No newline at end of file +var _0xd825=['sequelize','exports','STRING','name'];(function(_0x3d3073,_0x2efa17){var _0x31df5a=function(_0x4ac194){while(--_0x4ac194){_0x3d3073['push'](_0x3d3073['shift']());}};_0x31df5a(++_0x2efa17);}(_0xd825,0x138));var _0x5d82=function(_0x5098f7,_0x2a5030){_0x5098f7=_0x5098f7-0x0;var _0x1161db=_0xd825[_0x5098f7];return _0x1161db;};'use strict';var Sequelize=require(_0x5d82('0x0'));module[_0x5d82('0x1')]={'name':{'type':Sequelize[_0x5d82('0x2')],'unique':_0x5d82('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 5b54f99..4912cdf 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 _0x44bc=['index','Pause','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','get','Pauses','destroy','stack','name','send'];(function(_0x1658ad,_0x487c1f){var _0x3b1927=function(_0xc06bb2){while(--_0xc06bb2){_0x1658ad['push'](_0x1658ad['shift']());}};_0x3b1927(++_0x487c1f);}(_0x44bc,0x1bd));var _0xc44b=function(_0x58dabf,_0x43bbe2){_0x58dabf=_0x58dabf-0x0;var _0x3b7323=_0x44bc[_0x58dabf];return _0x3b7323;};'use strict';var pdf=require(_0xc44b('0x0'));var emlformat=require(_0xc44b('0x1'));var rimraf=require(_0xc44b('0x2'));var zipdir=require(_0xc44b('0x3'));var jsonpatch=require(_0xc44b('0x4'));var rp=require(_0xc44b('0x5'));var moment=require(_0xc44b('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xc44b('0x7'));var util=require('util');var path=require('path');var sox=require(_0xc44b('0x8'));var csv=require(_0xc44b('0x9'));var ejs=require(_0xc44b('0xa'));var fs=require('fs');var _=require(_0xc44b('0xb'));var squel=require(_0xc44b('0xc'));var crypto=require(_0xc44b('0xd'));var jsforce=require(_0xc44b('0xe'));var deskjs=require(_0xc44b('0xf'));var toCsv=require(_0xc44b('0x9'));var querystring=require(_0xc44b('0x10'));var Papa=require(_0xc44b('0x11'));var Redis=require('ioredis');var authService=require(_0xc44b('0x12'));var qs=require(_0xc44b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc44b('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xc44b('0x15'));var db=require(_0xc44b('0x16'))['db'];function respondWithStatusCode(_0x1dc1e6,_0xa4ff61){_0xa4ff61=_0xa4ff61||0xcc;return function(_0x3c0b2a){if(_0x3c0b2a){return _0x1dc1e6['sendStatus'](_0xa4ff61);}return _0x1dc1e6[_0xc44b('0x17')](_0xa4ff61)[_0xc44b('0x18')]();};}function respondWithResult(_0x330f7d,_0x151ccd){_0x151ccd=_0x151ccd||0xc8;return function(_0x39d782){if(_0x39d782){return _0x330f7d[_0xc44b('0x17')](_0x151ccd)[_0xc44b('0x19')](_0x39d782);}};}function respondWithFilteredResult(_0x12ef72,_0x1cd9fe){return function(_0x1690a0){if(_0x1690a0){var _0x3f60d0=_0x1690a0[_0xc44b('0x1a')],_0x325fb9=_0x1cd9fe[_0xc44b('0x1b')],_0x14199f=_0x1cd9fe[_0xc44b('0x1b')]+_0x1cd9fe[_0xc44b('0x1c')],_0x582be1;if(_0x14199f>=_0x3f60d0){_0x14199f=_0x3f60d0;_0x582be1=0xc8;}else{_0x582be1=0xce;}_0x12ef72[_0xc44b('0x17')](_0x582be1);return _0x12ef72[_0xc44b('0x1d')](_0xc44b('0x1e'),_0x325fb9+'-'+_0x14199f+'/'+_0x3f60d0)[_0xc44b('0x19')](_0x1690a0);}return null;};}function patchUpdates(_0x4666cf){return function(_0x30dd48){try{jsonpatch[_0xc44b('0x1f')](_0x30dd48,_0x4666cf,!![]);}catch(_0x81574e){return BPromise[_0xc44b('0x20')](_0x81574e);}return _0x30dd48[_0xc44b('0x21')]();};}function saveUpdates(_0x5dabac,_0x1ae852){return function(_0x397e4f){if(_0x397e4f){return _0x397e4f[_0xc44b('0x22')](_0x5dabac)['then'](function(_0x2812c3){return _0x2812c3;});}return null;};}function removeEntity(_0x22ca30,_0x3854cc){return function(_0x5da605){if(_0x5da605){return _0x5da605['destroy']()['then'](function(){var _0x28fedd=_0x5da605[_0xc44b('0x23')]({'plain':!![]});var _0x54aa03=_0xc44b('0x24');return db['UserProfileResource'][_0xc44b('0x25')]({'where':{'type':_0x54aa03,'resourceId':_0x28fedd['id']}})['then'](function(){return _0x5da605;});})['then'](function(){_0x22ca30[_0xc44b('0x17')](0xcc)[_0xc44b('0x18')]();});}};}function handleEntityNotFound(_0x11c173,_0x16db10){return function(_0x3c4bd3){if(!_0x3c4bd3){_0x11c173['sendStatus'](0x194);}return _0x3c4bd3;};}function handleError(_0x2a12e8,_0x1164bc){_0x1164bc=_0x1164bc||0x1f4;return function(_0x19f87c){logger['error'](_0x19f87c[_0xc44b('0x26')]);if(_0x19f87c[_0xc44b('0x27')]){delete _0x19f87c[_0xc44b('0x27')];}_0x2a12e8['status'](_0x1164bc)[_0xc44b('0x28')](_0x19f87c);};}exports[_0xc44b('0x29')]=function(_0x4ab2a8,_0x50d2f2){var _0xe103dd={},_0x1f2075={},_0x13c0db={'count':0x0,'rows':[]};var _0x45b5b6=db[_0xc44b('0x2a')][_0xc44b('0x2b')];_0x1f2075[_0xc44b('0x2c')]=_[_0xc44b('0x2d')](_0x45b5b6);_0x1f2075[_0xc44b('0x2e')]=_[_0xc44b('0x2d')](_0x4ab2a8[_0xc44b('0x2e')]);_0x1f2075[_0xc44b('0x2f')]=_[_0xc44b('0x30')](_0x1f2075[_0xc44b('0x2c')],_0x1f2075[_0xc44b('0x2e')]);_0xe103dd['attributes']=_[_0xc44b('0x30')](_0x1f2075[_0xc44b('0x2c')],qs[_0xc44b('0x31')](_0x4ab2a8['query']['fields']));_0xe103dd[_0xc44b('0x32')]=_0xe103dd['attributes'][_0xc44b('0x33')]?_0xe103dd[_0xc44b('0x32')]:_0x1f2075[_0xc44b('0x2c')];if(!_0x4ab2a8[_0xc44b('0x2e')][_0xc44b('0x34')]('nolimit')){_0xe103dd[_0xc44b('0x1c')]=qs[_0xc44b('0x1c')](_0x4ab2a8[_0xc44b('0x2e')][_0xc44b('0x1c')]);_0xe103dd[_0xc44b('0x1b')]=qs[_0xc44b('0x1b')](_0x4ab2a8['query']['offset']);}_0xe103dd[_0xc44b('0x35')]=qs['sort'](_0x4ab2a8[_0xc44b('0x2e')][_0xc44b('0x36')]);_0xe103dd[_0xc44b('0x37')]=qs[_0xc44b('0x2f')](_[_0xc44b('0x38')](_0x4ab2a8['query'],_0x1f2075[_0xc44b('0x2f')]));if(_0x4ab2a8[_0xc44b('0x2e')][_0xc44b('0x39')]){_0xe103dd['where']=_[_0xc44b('0x3a')](_0xe103dd[_0xc44b('0x37')],{'$or':_['map'](_0x45b5b6,function(_0x273c5b){if(_0x273c5b[_0xc44b('0x3b')][_0xc44b('0x3c')]!==_0xc44b('0x3d')){var _0x20d8c3={};_0x20d8c3[_0x273c5b[_0xc44b('0x3e')]]={'$like':'%'+_0x4ab2a8['query']['filter']+'%'};return _0x20d8c3;}})});}_0xe103dd=_['merge']({},_0xe103dd,_0x4ab2a8[_0xc44b('0x3f')]);var _0x5a0a8f={'where':_0xe103dd[_0xc44b('0x37')]};return db['Pause'][_0xc44b('0x1a')](_0x5a0a8f)[_0xc44b('0x40')](function(_0xf668dd){_0x13c0db['count']=_0xf668dd;if(_0x4ab2a8[_0xc44b('0x2e')][_0xc44b('0x41')]){_0xe103dd[_0xc44b('0x42')]=[{'all':!![]}];}return db['Pause'][_0xc44b('0x43')](_0xe103dd);})['then'](function(_0x449284){_0x13c0db[_0xc44b('0x44')]=_0x449284;return _0x13c0db;})['then'](respondWithFilteredResult(_0x50d2f2,_0xe103dd))[_0xc44b('0x45')](handleError(_0x50d2f2,null));};exports[_0xc44b('0x46')]=function(_0x331093,_0xc44f4a){var _0x1a5599={'raw':!![],'where':{'id':_0x331093[_0xc44b('0x47')]['id']}},_0xe04bfd={};_0xe04bfd[_0xc44b('0x2c')]=_[_0xc44b('0x2d')](db[_0xc44b('0x2a')]['rawAttributes']);_0xe04bfd[_0xc44b('0x2e')]=_[_0xc44b('0x2d')](_0x331093[_0xc44b('0x2e')]);_0xe04bfd['filters']=_[_0xc44b('0x30')](_0xe04bfd[_0xc44b('0x2c')],_0xe04bfd[_0xc44b('0x2e')]);_0x1a5599[_0xc44b('0x32')]=_[_0xc44b('0x30')](_0xe04bfd[_0xc44b('0x2c')],qs[_0xc44b('0x31')](_0x331093['query'][_0xc44b('0x31')]));_0x1a5599[_0xc44b('0x32')]=_0x1a5599[_0xc44b('0x32')]['length']?_0x1a5599[_0xc44b('0x32')]:_0xe04bfd[_0xc44b('0x2c')];if(_0x331093['query']['includeAll']){_0x1a5599[_0xc44b('0x42')]=[{'all':!![]}];}_0x1a5599=_[_0xc44b('0x3a')]({},_0x1a5599,_0x331093[_0xc44b('0x3f')]);return db[_0xc44b('0x2a')][_0xc44b('0x48')](_0x1a5599)[_0xc44b('0x40')](handleEntityNotFound(_0xc44f4a,null))[_0xc44b('0x40')](respondWithResult(_0xc44f4a,null))[_0xc44b('0x45')](handleError(_0xc44f4a,null));};exports[_0xc44b('0x49')]=function(_0x5c2844,_0x5fbb20){return db['Pause'][_0xc44b('0x49')](_0x5c2844[_0xc44b('0x4a')],{})[_0xc44b('0x40')](function(_0x52765b){var _0x35e05b=_0x5c2844[_0xc44b('0x4b')]['get']({'plain':!![]});if(!_0x35e05b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35e05b[_0xc44b('0x4c')]===_0xc44b('0x4b')){var _0x243b9e=_0x52765b['get']({'plain':!![]});var _0xea0c6a=_0xc44b('0x24');return db['UserProfileSection'][_0xc44b('0x48')]({'where':{'name':_0xea0c6a,'userProfileId':_0x35e05b['userProfileId']},'raw':!![]})[_0xc44b('0x40')](function(_0x3688a8){if(_0x3688a8&&_0x3688a8[_0xc44b('0x4d')]===0x0){return db[_0xc44b('0x4e')][_0xc44b('0x49')]({'name':_0x243b9e['name'],'resourceId':_0x243b9e['id'],'type':_0x3688a8[_0xc44b('0x27')],'sectionId':_0x3688a8['id']},{})['then'](function(){return _0x52765b;});}else{return _0x52765b;}})[_0xc44b('0x45')](function(_0x357b74){logger[_0xc44b('0x4f')](_0xc44b('0x50'),_0x357b74);throw _0x357b74;});}return _0x52765b;})[_0xc44b('0x40')](respondWithResult(_0x5fbb20,0xc9))[_0xc44b('0x45')](handleError(_0x5fbb20,null));};exports['update']=function(_0x5bdb7e,_0x3d7144){if(_0x5bdb7e[_0xc44b('0x4a')]['id']){delete _0x5bdb7e['body']['id'];}return db[_0xc44b('0x2a')][_0xc44b('0x48')]({'where':{'id':_0x5bdb7e['params']['id']}})[_0xc44b('0x40')](handleEntityNotFound(_0x3d7144,null))['then'](saveUpdates(_0x5bdb7e['body'],null))['then'](respondWithResult(_0x3d7144,null))[_0xc44b('0x45')](handleError(_0x3d7144,null));};exports[_0xc44b('0x25')]=function(_0xddf501,_0x51d37a){return db[_0xc44b('0x2a')][_0xc44b('0x48')]({'where':{'id':_0xddf501[_0xc44b('0x47')]['id']}})[_0xc44b('0x40')](handleEntityNotFound(_0x51d37a,null))[_0xc44b('0x40')](removeEntity(_0x51d37a,null))[_0xc44b('0x45')](handleError(_0x51d37a,null));}; \ No newline at end of file +var _0x3304=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','Pause','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','map','type','VIRTUAL','field','merge','options','includeAll','rows','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel'];(function(_0x285463,_0xa8eb45){var _0x23240d=function(_0x2f31c3){while(--_0x2f31c3){_0x285463['push'](_0x285463['shift']());}};_0x23240d(++_0xa8eb45);}(_0x3304,0x197));var _0x4330=function(_0x5a8b0d,_0x5377d3){_0x5a8b0d=_0x5a8b0d-0x0;var _0x3abc5c=_0x3304[_0x5a8b0d];return _0x3abc5c;};'use strict';var pdf=require(_0x4330('0x0'));var emlformat=require(_0x4330('0x1'));var rimraf=require(_0x4330('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4330('0x3'));var moment=require(_0x4330('0x4'));var BPromise=require(_0x4330('0x5'));var Mustache=require(_0x4330('0x6'));var util=require('util');var path=require(_0x4330('0x7'));var sox=require(_0x4330('0x8'));var csv=require(_0x4330('0x9'));var ejs=require(_0x4330('0xa'));var fs=require('fs');var _=require(_0x4330('0xb'));var squel=require(_0x4330('0xc'));var crypto=require(_0x4330('0xd'));var jsforce=require(_0x4330('0xe'));var deskjs=require(_0x4330('0xf'));var toCsv=require(_0x4330('0x9'));var querystring=require(_0x4330('0x10'));var Papa=require(_0x4330('0x11'));var Redis=require(_0x4330('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4330('0x13'));var hardwareService=require(_0x4330('0x14'));var logger=require(_0x4330('0x15'))(_0x4330('0x16'));var utils=require(_0x4330('0x17'));var config=require(_0x4330('0x18'));var db=require(_0x4330('0x19'))['db'];function respondWithStatusCode(_0x3f9586,_0x1007e5){_0x1007e5=_0x1007e5||0xcc;return function(_0x532d1d){if(_0x532d1d){return _0x3f9586[_0x4330('0x1a')](_0x1007e5);}return _0x3f9586[_0x4330('0x1b')](_0x1007e5)[_0x4330('0x1c')]();};}function respondWithResult(_0x4f48b0,_0x3b9372){_0x3b9372=_0x3b9372||0xc8;return function(_0x381ed0){if(_0x381ed0){return _0x4f48b0[_0x4330('0x1b')](_0x3b9372)[_0x4330('0x1d')](_0x381ed0);}};}function respondWithFilteredResult(_0x43b21d,_0x371bbc){return function(_0x3971b2){if(_0x3971b2){var _0x36916f=_0x3971b2[_0x4330('0x1e')],_0x1ae9b0=_0x371bbc[_0x4330('0x1f')],_0x4bcdff=_0x371bbc[_0x4330('0x1f')]+_0x371bbc[_0x4330('0x20')],_0xda86dd;if(_0x4bcdff>=_0x36916f){_0x4bcdff=_0x36916f;_0xda86dd=0xc8;}else{_0xda86dd=0xce;}_0x43b21d[_0x4330('0x1b')](_0xda86dd);return _0x43b21d[_0x4330('0x21')]('Content-Range',_0x1ae9b0+'-'+_0x4bcdff+'/'+_0x36916f)['json'](_0x3971b2);}return null;};}function patchUpdates(_0x521eba){return function(_0x2109b0){try{jsonpatch[_0x4330('0x22')](_0x2109b0,_0x521eba,!![]);}catch(_0x41acd6){return BPromise[_0x4330('0x23')](_0x41acd6);}return _0x2109b0[_0x4330('0x24')]();};}function saveUpdates(_0x5ec123,_0x1ab98e){return function(_0x3f4bd2){if(_0x3f4bd2){return _0x3f4bd2[_0x4330('0x25')](_0x5ec123)[_0x4330('0x26')](function(_0x4d53da){return _0x4d53da;});}return null;};}function removeEntity(_0x7ac231,_0xeaeb20){return function(_0x4a81fb){if(_0x4a81fb){return _0x4a81fb[_0x4330('0x27')]()[_0x4330('0x26')](function(){var _0x31d9dd=_0x4a81fb[_0x4330('0x28')]({'plain':!![]});var _0x1ecf00=_0x4330('0x29');return db[_0x4330('0x2a')][_0x4330('0x27')]({'where':{'type':_0x1ecf00,'resourceId':_0x31d9dd['id']}})[_0x4330('0x26')](function(){return _0x4a81fb;});})[_0x4330('0x26')](function(){_0x7ac231[_0x4330('0x1b')](0xcc)[_0x4330('0x1c')]();});}};}function handleEntityNotFound(_0x20f5cb,_0x17a4d4){return function(_0x55ad90){if(!_0x55ad90){_0x20f5cb[_0x4330('0x1a')](0x194);}return _0x55ad90;};}function handleError(_0x5ad55f,_0x62c5a2){_0x62c5a2=_0x62c5a2||0x1f4;return function(_0x136245){logger[_0x4330('0x2b')](_0x136245[_0x4330('0x2c')]);if(_0x136245[_0x4330('0x2d')]){delete _0x136245[_0x4330('0x2d')];}_0x5ad55f[_0x4330('0x1b')](_0x62c5a2)[_0x4330('0x2e')](_0x136245);};}exports[_0x4330('0x2f')]=function(_0x4ba028,_0x3eeafa){var _0x5da716={},_0x4a7086={},_0x216ee5={'count':0x0,'rows':[]};var _0x154f1b=db[_0x4330('0x30')][_0x4330('0x31')];_0x4a7086[_0x4330('0x32')]=_[_0x4330('0x33')](_0x154f1b);_0x4a7086[_0x4330('0x34')]=_[_0x4330('0x33')](_0x4ba028['query']);_0x4a7086[_0x4330('0x35')]=_[_0x4330('0x36')](_0x4a7086['model'],_0x4a7086[_0x4330('0x34')]);_0x5da716['attributes']=_['intersection'](_0x4a7086['model'],qs[_0x4330('0x37')](_0x4ba028[_0x4330('0x34')][_0x4330('0x37')]));_0x5da716[_0x4330('0x38')]=_0x5da716[_0x4330('0x38')][_0x4330('0x39')]?_0x5da716[_0x4330('0x38')]:_0x4a7086[_0x4330('0x32')];if(!_0x4ba028[_0x4330('0x34')]['hasOwnProperty'](_0x4330('0x3a'))){_0x5da716['limit']=qs['limit'](_0x4ba028['query']['limit']);_0x5da716[_0x4330('0x1f')]=qs[_0x4330('0x1f')](_0x4ba028[_0x4330('0x34')][_0x4330('0x1f')]);}_0x5da716[_0x4330('0x3b')]=qs[_0x4330('0x3c')](_0x4ba028['query']['sort']);_0x5da716[_0x4330('0x3d')]=qs['filters'](_['pick'](_0x4ba028[_0x4330('0x34')],_0x4a7086[_0x4330('0x35')]));if(_0x4ba028[_0x4330('0x34')][_0x4330('0x3e')]){_0x5da716[_0x4330('0x3d')]=_['merge'](_0x5da716[_0x4330('0x3d')],{'$or':_[_0x4330('0x3f')](_0x154f1b,function(_0x3976b8){if(_0x3976b8[_0x4330('0x40')]['key']!==_0x4330('0x41')){var _0x1c137e={};_0x1c137e[_0x3976b8[_0x4330('0x42')]]={'$like':'%'+_0x4ba028[_0x4330('0x34')][_0x4330('0x3e')]+'%'};return _0x1c137e;}})});}_0x5da716=_[_0x4330('0x43')]({},_0x5da716,_0x4ba028[_0x4330('0x44')]);var _0x3952bc={'where':_0x5da716[_0x4330('0x3d')]};return db[_0x4330('0x30')][_0x4330('0x1e')](_0x3952bc)[_0x4330('0x26')](function(_0x4110e5){_0x216ee5[_0x4330('0x1e')]=_0x4110e5;if(_0x4ba028[_0x4330('0x34')][_0x4330('0x45')]){_0x5da716['include']=[{'all':!![]}];}return db[_0x4330('0x30')]['findAll'](_0x5da716);})[_0x4330('0x26')](function(_0x2ea786){_0x216ee5[_0x4330('0x46')]=_0x2ea786;return _0x216ee5;})[_0x4330('0x26')](respondWithFilteredResult(_0x3eeafa,_0x5da716))['catch'](handleError(_0x3eeafa,null));};exports[_0x4330('0x47')]=function(_0x22b154,_0x56152d){var _0x17ff8d={'raw':!![],'where':{'id':_0x22b154[_0x4330('0x48')]['id']}},_0x1b21e0={};_0x1b21e0['model']=_[_0x4330('0x33')](db[_0x4330('0x30')][_0x4330('0x31')]);_0x1b21e0[_0x4330('0x34')]=_['keys'](_0x22b154[_0x4330('0x34')]);_0x1b21e0['filters']=_[_0x4330('0x36')](_0x1b21e0[_0x4330('0x32')],_0x1b21e0[_0x4330('0x34')]);_0x17ff8d[_0x4330('0x38')]=_[_0x4330('0x36')](_0x1b21e0[_0x4330('0x32')],qs['fields'](_0x22b154[_0x4330('0x34')][_0x4330('0x37')]));_0x17ff8d['attributes']=_0x17ff8d['attributes'][_0x4330('0x39')]?_0x17ff8d[_0x4330('0x38')]:_0x1b21e0[_0x4330('0x32')];if(_0x22b154[_0x4330('0x34')]['includeAll']){_0x17ff8d[_0x4330('0x49')]=[{'all':!![]}];}_0x17ff8d=_['merge']({},_0x17ff8d,_0x22b154['options']);return db[_0x4330('0x30')][_0x4330('0x4a')](_0x17ff8d)[_0x4330('0x26')](handleEntityNotFound(_0x56152d,null))['then'](respondWithResult(_0x56152d,null))[_0x4330('0x4b')](handleError(_0x56152d,null));};exports['create']=function(_0x2f0086,_0x576eca){return db['Pause'][_0x4330('0x4c')](_0x2f0086[_0x4330('0x4d')],{})[_0x4330('0x26')](function(_0x5b3929){var _0x570ac8=_0x2f0086[_0x4330('0x4e')][_0x4330('0x28')]({'plain':!![]});if(!_0x570ac8)throw new Error(_0x4330('0x4f'));if(_0x570ac8[_0x4330('0x50')]==='user'){var _0x31cfe1=_0x5b3929[_0x4330('0x28')]({'plain':!![]});var _0x22211c=_0x4330('0x29');return db[_0x4330('0x51')][_0x4330('0x4a')]({'where':{'name':_0x22211c,'userProfileId':_0x570ac8['userProfileId']},'raw':!![]})[_0x4330('0x26')](function(_0x2f9008){if(_0x2f9008&&_0x2f9008[_0x4330('0x52')]===0x0){return db['UserProfileResource'][_0x4330('0x4c')]({'name':_0x31cfe1['name'],'resourceId':_0x31cfe1['id'],'type':_0x2f9008[_0x4330('0x2d')],'sectionId':_0x2f9008['id']},{})[_0x4330('0x26')](function(){return _0x5b3929;});}else{return _0x5b3929;}})[_0x4330('0x4b')](function(_0x4ec36c){logger[_0x4330('0x2b')](_0x4330('0x53'),_0x4ec36c);throw _0x4ec36c;});}return _0x5b3929;})[_0x4330('0x26')](respondWithResult(_0x576eca,0xc9))[_0x4330('0x4b')](handleError(_0x576eca,null));};exports[_0x4330('0x25')]=function(_0x478b7e,_0x1ca63f){if(_0x478b7e[_0x4330('0x4d')]['id']){delete _0x478b7e[_0x4330('0x4d')]['id'];}return db['Pause'][_0x4330('0x4a')]({'where':{'id':_0x478b7e[_0x4330('0x48')]['id']}})[_0x4330('0x26')](handleEntityNotFound(_0x1ca63f,null))['then'](saveUpdates(_0x478b7e[_0x4330('0x4d')],null))['then'](respondWithResult(_0x1ca63f,null))[_0x4330('0x4b')](handleError(_0x1ca63f,null));};exports['destroy']=function(_0x11274b,_0x1d77f4){return db[_0x4330('0x30')]['find']({'where':{'id':_0x11274b[_0x4330('0x48')]['id']}})[_0x4330('0x26')](handleEntityNotFound(_0x1d77f4,null))[_0x4330('0x26')](removeEntity(_0x1d77f4,null))[_0x4330('0x4b')](handleError(_0x1d77f4,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 25452d8..58f26b7 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 _0x4f2f=['request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause','../../config/logger','api','bluebird'];(function(_0x2460d9,_0x15da87){var _0x4bc204=function(_0x40bbce){while(--_0x40bbce){_0x2460d9['push'](_0x2460d9['shift']());}};_0x4bc204(++_0x15da87);}(_0x4f2f,0x1cb));var _0xf4f2=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x4f2f[_0x1e3c16];return _0x47a0c9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf4f2('0x0'))(_0xf4f2('0x1'));var moment=require('moment');var BPromise=require(_0xf4f2('0x2'));var rp=require(_0xf4f2('0x3'));var fs=require('fs');var path=require(_0xf4f2('0x4'));var rimraf=require(_0xf4f2('0x5'));var config=require(_0xf4f2('0x6'));var attributes=require(_0xf4f2('0x7'));module[_0xf4f2('0x8')]=function(_0x2d7c29,_0x1e0ceb){return _0x2d7c29[_0xf4f2('0x9')](_0xf4f2('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1fa=['./pause.attributes','define','tools_pauses','../../config/logger','moment'];(function(_0x2c23ec,_0xbd620d){var _0x57630d=function(_0x43bd0b){while(--_0x43bd0b){_0x2c23ec['push'](_0x2c23ec['shift']());}};_0x57630d(++_0xbd620d);}(_0xb1fa,0x9e));var _0xab1f=function(_0x47a57d,_0x4c00bc){_0x47a57d=_0x47a57d-0x0;var _0x1ea0dd=_0xb1fa[_0x47a57d];return _0x1ea0dd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab1f('0x0'))('api');var moment=require(_0xab1f('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xab1f('0x2'));module['exports']=function(_0x50ada8,_0x4ee73b){return _0x50ada8[_0xab1f('0x3')]('Pause',attributes,{'tableName':_0xab1f('0x4'),'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 ab809d8..818b03e 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 _0xda37=['Pause,\x20%s,\x20%s','debug','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0xda37,0x18a));var _0x7da3=function(_0x5a965f,_0x22d15f){_0x5a965f=_0x5a965f-0x0;var _0x188f8a=_0xda37[_0x5a965f];return _0x188f8a;};'use strict';var _=require(_0x7da3('0x0'));var util=require(_0x7da3('0x1'));var moment=require(_0x7da3('0x2'));var BPromise=require(_0x7da3('0x3'));var rs=require(_0x7da3('0x4'));var fs=require('fs');var Redis=require(_0x7da3('0x5'));var db=require(_0x7da3('0x6'))['db'];var utils=require(_0x7da3('0x7'));var logger=require(_0x7da3('0x8'))(_0x7da3('0x9'));var config=require('../../config/environment');var jayson=require(_0x7da3('0xa'));var client=jayson['client'][_0x7da3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37d952,_0x133c50,_0x71c059){return new BPromise(function(_0x23b6af,_0x34c60){return client['request'](_0x37d952,_0x71c059)[_0x7da3('0xc')](function(_0x3690c5){logger[_0x7da3('0xd')](_0x7da3('0xe'),_0x133c50,'request\x20sent');logger[_0x7da3('0xf')](_0x7da3('0x10'),_0x133c50,_0x7da3('0x11'),JSON[_0x7da3('0x12')](_0x3690c5));if(_0x3690c5[_0x7da3('0x13')]){if(_0x3690c5[_0x7da3('0x13')][_0x7da3('0x14')]===0x1f4){logger['error'](_0x7da3('0xe'),_0x133c50,_0x3690c5[_0x7da3('0x13')][_0x7da3('0x15')]);return _0x34c60(_0x3690c5[_0x7da3('0x13')]['message']);}logger[_0x7da3('0x13')]('Pause,\x20%s,\x20%s',_0x133c50,_0x3690c5[_0x7da3('0x13')]['message']);return _0x23b6af(_0x3690c5['error'][_0x7da3('0x15')]);}else{logger['info'](_0x7da3('0xe'),_0x133c50,'request\x20sent');_0x23b6af(_0x3690c5[_0x7da3('0x16')]['message']);}})['catch'](function(_0x3d9faa){logger[_0x7da3('0x13')](_0x7da3('0xe'),_0x133c50,_0x3d9faa);_0x34c60(_0x3d9faa);});});}exports[_0x7da3('0x17')]=function(_0x1d808f){var _0x271456=this;return new Promise(function(_0x2df464,_0x10cf53){return db[_0x7da3('0x18')][_0x7da3('0x19')]({'raw':_0x1d808f[_0x7da3('0x1a')]?_0x1d808f[_0x7da3('0x1a')][_0x7da3('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d808f[_0x7da3('0x1a')]?_0x1d808f['options'][_0x7da3('0x1c')]||null:null,'attributes':_0x1d808f[_0x7da3('0x1a')]?_0x1d808f['options'][_0x7da3('0x1d')]||null:null,'include':_0x1d808f[_0x7da3('0x1a')]?_0x1d808f['options']['include']?_[_0x7da3('0x1e')](_0x1d808f[_0x7da3('0x1a')][_0x7da3('0x1f')],function(_0xac9ced){return{'model':db[_0xac9ced[_0x7da3('0x20')]],'as':_0xac9ced['as'],'attributes':_0xac9ced['attributes'],'include':_0xac9ced['include']?_[_0x7da3('0x1e')](_0xac9ced[_0x7da3('0x1f')],function(_0x2977bf){return{'model':db[_0x2977bf[_0x7da3('0x20')]],'as':_0x2977bf['as'],'attributes':_0x2977bf[_0x7da3('0x1d')],'include':_0x2977bf[_0x7da3('0x1f')]?_[_0x7da3('0x1e')](_0x2977bf[_0x7da3('0x1f')],function(_0x25ee61){return{'model':db[_0x25ee61[_0x7da3('0x20')]],'as':_0x25ee61['as'],'attributes':_0x25ee61[_0x7da3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7da3('0xc')](function(_0x61200c){logger[_0x7da3('0xd')]('ShowPause',_0x1d808f);logger[_0x7da3('0xf')]('ShowPause',_0x1d808f,JSON['stringify'](_0x61200c));_0x2df464(_0x61200c);})[_0x7da3('0x21')](function(_0x5cdf3b){logger[_0x7da3('0x13')](_0x7da3('0x17'),_0x5cdf3b[_0x7da3('0x15')],_0x1d808f);_0x10cf53(_0x271456['error'](0x1f4,_0x5cdf3b[_0x7da3('0x15')]));});});}; \ No newline at end of file +var _0xe18c=['client','http','then','info','Pause,\x20%s,\x20%s','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowPause','Pause','find','options','raw','where','attributes','map','model','include','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0xe18c,0x178));var _0xce18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe18c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xce18('0x0'));var util=require(_0xce18('0x1'));var moment=require('moment');var BPromise=require(_0xce18('0x2'));var rs=require(_0xce18('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce18('0x4'))['db'];var utils=require(_0xce18('0x5'));var logger=require(_0xce18('0x6'))(_0xce18('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xce18('0x8')][_0xce18('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb09964,_0x261463,_0x38d2c6){return new BPromise(function(_0x9e9d64,_0x1e0c8d){return client['request'](_0xb09964,_0x38d2c6)[_0xce18('0xa')](function(_0x503d21){logger[_0xce18('0xb')](_0xce18('0xc'),_0x261463,_0xce18('0xd'));logger[_0xce18('0xe')](_0xce18('0xf'),_0x261463,_0xce18('0xd'),JSON['stringify'](_0x503d21));if(_0x503d21[_0xce18('0x10')]){if(_0x503d21[_0xce18('0x10')][_0xce18('0x11')]===0x1f4){logger[_0xce18('0x10')]('Pause,\x20%s,\x20%s',_0x261463,_0x503d21['error']['message']);return _0x1e0c8d(_0x503d21[_0xce18('0x10')][_0xce18('0x12')]);}logger[_0xce18('0x10')](_0xce18('0xc'),_0x261463,_0x503d21[_0xce18('0x10')][_0xce18('0x12')]);return _0x9e9d64(_0x503d21[_0xce18('0x10')][_0xce18('0x12')]);}else{logger[_0xce18('0xb')](_0xce18('0xc'),_0x261463,_0xce18('0xd'));_0x9e9d64(_0x503d21[_0xce18('0x13')][_0xce18('0x12')]);}})[_0xce18('0x14')](function(_0x23e401){logger[_0xce18('0x10')](_0xce18('0xc'),_0x261463,_0x23e401);_0x1e0c8d(_0x23e401);});});}exports[_0xce18('0x15')]=function(_0x8edcbc){var _0x5e349f=this;return new Promise(function(_0x256b7f,_0x4cbda0){return db[_0xce18('0x16')][_0xce18('0x17')]({'raw':_0x8edcbc[_0xce18('0x18')]?_0x8edcbc[_0xce18('0x18')][_0xce18('0x19')]===undefined?!![]:![]:!![],'where':_0x8edcbc[_0xce18('0x18')]?_0x8edcbc[_0xce18('0x18')][_0xce18('0x1a')]||null:null,'attributes':_0x8edcbc['options']?_0x8edcbc[_0xce18('0x18')][_0xce18('0x1b')]||null:null,'include':_0x8edcbc['options']?_0x8edcbc[_0xce18('0x18')]['include']?_[_0xce18('0x1c')](_0x8edcbc[_0xce18('0x18')]['include'],function(_0x5a38f0){return{'model':db[_0x5a38f0['model']],'as':_0x5a38f0['as'],'attributes':_0x5a38f0[_0xce18('0x1b')],'include':_0x5a38f0['include']?_[_0xce18('0x1c')](_0x5a38f0['include'],function(_0x3bb612){return{'model':db[_0x3bb612[_0xce18('0x1d')]],'as':_0x3bb612['as'],'attributes':_0x3bb612[_0xce18('0x1b')],'include':_0x3bb612[_0xce18('0x1e')]?_[_0xce18('0x1c')](_0x3bb612[_0xce18('0x1e')],function(_0x22db2f){return{'model':db[_0x22db2f['model']],'as':_0x22db2f['as'],'attributes':_0x22db2f[_0xce18('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xce18('0xa')](function(_0x34c96a){logger[_0xce18('0xb')](_0xce18('0x15'),_0x8edcbc);logger[_0xce18('0xe')](_0xce18('0x15'),_0x8edcbc,JSON[_0xce18('0x1f')](_0x34c96a));_0x256b7f(_0x34c96a);})[_0xce18('0x14')](function(_0x2cccae){logger[_0xce18('0x10')]('ShowPause',_0x2cccae[_0xce18('0x12')],_0x8edcbc);_0x4cbda0(_0x5e349f['error'](0x1f4,_0x2cccae[_0xce18('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 73b9699..cd16370 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 _0xd5c3=['update','delete','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','index','get','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','download','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','single','upload','webhookPost','put'];(function(_0x4e3b66,_0x36e365){var _0x19a4be=function(_0x347258){while(--_0x347258){_0x4e3b66['push'](_0x4e3b66['shift']());}};_0x19a4be(++_0x36e365);}(_0xd5c3,0xdc));var _0x3d5c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd5c3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3d5c('0x0'));var util=require(_0x3d5c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3d5c('0x2'));var router=express['Router']();var auth=require(_0x3d5c('0x3'));var interaction=require(_0x3d5c('0x4'));var config=require(_0x3d5c('0x5'));var controller=require(_0x3d5c('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x3d5c('0x7')]);router[_0x3d5c('0x8')](_0x3d5c('0x9'),controller[_0x3d5c('0xa')]);router[_0x3d5c('0x8')](_0x3d5c('0xb'),auth[_0x3d5c('0xc')](),controller[_0x3d5c('0xd')]);router['get'](_0x3d5c('0xe'),auth['isAuthenticated'](),controller[_0x3d5c('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4420c8,_0x48009b,_0x2839b5){_0x2839b5(null,path['join'](config[_0x3d5c('0x10')],_0x3d5c('0x11')));},'filename':function(_0x33d87f,_0x12ba4a,_0x34fefd){_0x12ba4a[_0x3d5c('0x12')]=_0x12ba4a['originalname'][_0x3d5c('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x34fefd(null,util[_0x3d5c('0x14')](_0x3d5c('0x15'),path[_0x3d5c('0x16')](_0x12ba4a[_0x3d5c('0x12')],path['extname'](_0x12ba4a[_0x3d5c('0x12')])),Date['now'](),path[_0x3d5c('0x17')](_0x12ba4a[_0x3d5c('0x12')])));}})});router['post']('/',upload[_0x3d5c('0x18')]('file'),controller[_0x3d5c('0x19')]);router['post'](_0x3d5c('0x9'),controller[_0x3d5c('0x1a')]);router[_0x3d5c('0x1b')](_0x3d5c('0xb'),auth['isAuthenticated'](),controller[_0x3d5c('0x1c')]);router[_0x3d5c('0x1d')]('/:id',auth[_0x3d5c('0xc')](),controller[_0x3d5c('0x1d')]);module[_0x3d5c('0x1e')]=router; \ No newline at end of file +var _0x3c94=['root','originalname','replace','format','basename','extname','single','file','post','put','update','delete','exports','util','express','Router','../../components/interaction/service','./plugin.controller','get','isAuthenticated','/webhook','/:id','show','/:id/download','diskStorage','join'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x3c94,0x1ad));var _0x43c9=function(_0x399849,_0x3b630d){_0x399849=_0x399849-0x0;var _0xfbb04=_0x3c94[_0x399849];return _0xfbb04;};'use strict';var multer=require('multer');var util=require(_0x43c9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x43c9('0x1'));var router=express[_0x43c9('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x43c9('0x3'));var config=require('../../config/environment');var controller=require(_0x43c9('0x4'));router[_0x43c9('0x5')]('/',auth[_0x43c9('0x6')](),controller['index']);router[_0x43c9('0x5')](_0x43c9('0x7'),controller['webhookGet']);router['get'](_0x43c9('0x8'),auth[_0x43c9('0x6')](),controller[_0x43c9('0x9')]);router['get'](_0x43c9('0xa'),auth[_0x43c9('0x6')](),controller['download']);var upload=multer({'storage':multer[_0x43c9('0xb')]({'destination':function(_0x4b66ee,_0x17cb34,_0x126be4){_0x126be4(null,path[_0x43c9('0xc')](config[_0x43c9('0xd')],'server/files/plugins'));},'filename':function(_0x414fd7,_0x2a465f,_0x5aa8dc){_0x2a465f[_0x43c9('0xe')]=_0x2a465f[_0x43c9('0xe')][_0x43c9('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5aa8dc(null,util[_0x43c9('0x10')]('%s-%s%s',path[_0x43c9('0x11')](_0x2a465f[_0x43c9('0xe')],path[_0x43c9('0x12')](_0x2a465f[_0x43c9('0xe')])),Date['now'](),path[_0x43c9('0x12')](_0x2a465f[_0x43c9('0xe')])));}})});router['post']('/',upload[_0x43c9('0x13')](_0x43c9('0x14')),controller['upload']);router[_0x43c9('0x15')](_0x43c9('0x7'),controller['webhookPost']);router[_0x43c9('0x16')](_0x43c9('0x8'),auth[_0x43c9('0x6')](),controller[_0x43c9('0x17')]);router[_0x43c9('0x18')]('/:id',auth[_0x43c9('0x6')](),controller[_0x43c9('0x18')]);module[_0x43c9('0x19')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 547cc37..41e9a8c 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 _0x721c=['STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','never','always','sequelize'];(function(_0xc36f8c,_0x517dee){var _0xb935e8=function(_0x4e5030){while(--_0x4e5030){_0xc36f8c['push'](_0xc36f8c['shift']());}};_0xb935e8(++_0x517dee);}(_0x721c,0x77));var _0xc721=function(_0x24154e,_0x544846){_0x24154e=_0x24154e-0x0;var _0x3d8d4b=_0x721c[_0x24154e];return _0x3d8d4b;};'use strict';var Sequelize=require(_0xc721('0x0'));module['exports']={'name':{'type':Sequelize[_0xc721('0x1')]},'type':{'type':Sequelize[_0xc721('0x2')](_0xc721('0x3'),_0xc721('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xc721('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0xc721('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc721('0x7')},'sidebar':{'type':Sequelize[_0xc721('0x2')](_0xc721('0x8'),_0xc721('0x9'),'always',_0xc721('0xa')),'defaultValue':_0xc721('0xb'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xc721('0x1')]},'adminUrl':{'type':Sequelize[_0xc721('0x1')]},'agentUrl':{'type':Sequelize[_0xc721('0x1')]},'scriptName':{'type':Sequelize[_0xc721('0x1')]},'scriptPath':{'type':Sequelize[_0xc721('0x1')]}}; \ No newline at end of file +var _0xbbdd=['ENUM','adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html','BOOLEAN'];(function(_0x1a4b42,_0x198645){var _0x4e78a9=function(_0x36b49b){while(--_0x36b49b){_0x1a4b42['push'](_0x1a4b42['shift']());}};_0x4e78a9(++_0x198645);}(_0xbbdd,0x1a9));var _0xdbbd=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xbbdd[_0x5ddaac];return _0x2a9c58;};'use strict';var Sequelize=require(_0xdbbd('0x0'));module[_0xdbbd('0x1')]={'name':{'type':Sequelize[_0xdbbd('0x2')]},'type':{'type':Sequelize['ENUM'](_0xdbbd('0x3'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xdbbd('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xdbbd('0x4')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xdbbd('0x5')](_0xdbbd('0x6'),'agentOnly',_0xdbbd('0x7'),_0xdbbd('0x8')),'defaultValue':'always','comment':_0xdbbd('0x9')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xdbbd('0x2')]},'agentUrl':{'type':Sequelize[_0xdbbd('0x2')]},'scriptName':{'type':Sequelize[_0xdbbd('0x2')]},'scriptPath':{'type':Sequelize[_0xdbbd('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index dbb1f46..d5faba9 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 _0xdc6c=['error','stack','name','send','index','Plugin','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','type','field','options','count','includeAll','include','findAll','rows','catch','show','rawAttributes','find','download','params','path','root','server/files/plugins','format','%s.zip','basename','createWriteStream','warning','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','**/*','join','node_modules/**/*','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20name\x20missing','undefined','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','scriptPath','create','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','set','body','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','%s%s','html-pdf','eml-format','rimraf','zip-dir','moment','util','sox','to-csv','ejs','crypto','desk.js','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource'];(function(_0x24f08d,_0x19ae14){var _0x1233ed=function(_0xefafd9){while(--_0xefafd9){_0x24f08d['push'](_0x24f08d['shift']());}};_0x1233ed(++_0x19ae14);}(_0xdc6c,0x123));var _0xcdc6=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0xdc6c[_0x23b655];return _0x364b32;};'use strict';var pdf=require(_0xcdc6('0x0'));var emlformat=require(_0xcdc6('0x1'));var rimraf=require(_0xcdc6('0x2'));var zipdir=require(_0xcdc6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcdc6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcdc6('0x5'));var path=require('path');var sox=require(_0xcdc6('0x6'));var csv=require(_0xcdc6('0x7'));var ejs=require(_0xcdc6('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xcdc6('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xcdc6('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcdc6('0xb'));var extract=require(_0xcdc6('0xc'));var rimraf=require(_0xcdc6('0x2'));var archiver=require(_0xcdc6('0xd'));var Redis=require(_0xcdc6('0xe'));var authService=require(_0xcdc6('0xf'));var qs=require(_0xcdc6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcdc6('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xcdc6('0x12'));var db=require('../../mysqldb')['db'];config[_0xcdc6('0x13')]=_[_0xcdc6('0x14')](config['redis'],{'host':_0xcdc6('0x15'),'port':0x18eb});var socket=require(_0xcdc6('0x16'))(new Redis(config[_0xcdc6('0x13')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0xea7c69,_0x5b70f6){_0x5b70f6=_0x5b70f6||0xcc;return function(_0x239369){if(_0x239369){return _0xea7c69[_0xcdc6('0x17')](_0x5b70f6);}return _0xea7c69[_0xcdc6('0x18')](_0x5b70f6)[_0xcdc6('0x19')]();};}function respondWithResult(_0x4d4615,_0x172241){_0x172241=_0x172241||0xc8;return function(_0x230938){if(_0x230938){return _0x4d4615[_0xcdc6('0x18')](_0x172241)['json'](_0x230938);}};}function respondWithFilteredResult(_0x52c30d,_0xf9c97a){return function(_0x6ba06a){if(_0x6ba06a){var _0x2bacf5=_0x6ba06a['count'],_0x7ba822=_0xf9c97a[_0xcdc6('0x1a')],_0x54d5ea=_0xf9c97a[_0xcdc6('0x1a')]+_0xf9c97a[_0xcdc6('0x1b')],_0x3bb387;if(_0x54d5ea>=_0x2bacf5){_0x54d5ea=_0x2bacf5;_0x3bb387=0xc8;}else{_0x3bb387=0xce;}_0x52c30d['status'](_0x3bb387);return _0x52c30d['set'](_0xcdc6('0x1c'),_0x7ba822+'-'+_0x54d5ea+'/'+_0x2bacf5)[_0xcdc6('0x1d')](_0x6ba06a);}return null;};}function patchUpdates(_0xf8ea58){return function(_0x3b97ab){try{jsonpatch[_0xcdc6('0x1e')](_0x3b97ab,_0xf8ea58,!![]);}catch(_0x4c0b6){return BPromise[_0xcdc6('0x1f')](_0x4c0b6);}return _0x3b97ab[_0xcdc6('0x20')]();};}function saveUpdates(_0x42f480,_0x3279b1){return function(_0x1b8cd5){if(_0x1b8cd5){return _0x1b8cd5[_0xcdc6('0x21')](_0x42f480)[_0xcdc6('0x22')](function(_0x8b4182){return _0x8b4182;});}return null;};}function removeEntity(_0x5225d3,_0x6cdb43){return function(_0x9926c1){if(_0x9926c1){return _0x9926c1[_0xcdc6('0x23')]()[_0xcdc6('0x22')](function(){var _0x36f615=_0x9926c1[_0xcdc6('0x24')]({'plain':!![]});var _0x35a140=_0xcdc6('0x25');return db[_0xcdc6('0x26')][_0xcdc6('0x23')]({'where':{'type':_0x35a140,'resourceId':_0x36f615['id']}})[_0xcdc6('0x22')](function(){return _0x9926c1;});})[_0xcdc6('0x22')](function(){_0x5225d3[_0xcdc6('0x18')](0xcc)[_0xcdc6('0x19')]();});}};}function handleEntityNotFound(_0x5e53d7,_0x3cc5d6){return function(_0x520c48){if(!_0x520c48){_0x5e53d7['sendStatus'](0x194);}return _0x520c48;};}function handleError(_0x2acc48,_0x3ddbf3){_0x3ddbf3=_0x3ddbf3||0x1f4;return function(_0x501a41){logger[_0xcdc6('0x27')](_0x501a41[_0xcdc6('0x28')]);if(_0x501a41['name']){delete _0x501a41[_0xcdc6('0x29')];}_0x2acc48['status'](_0x3ddbf3)[_0xcdc6('0x2a')](_0x501a41);};}exports[_0xcdc6('0x2b')]=function(_0x534374,_0xa5de51){var _0xd609c8={},_0x2a3ad1={},_0x53e9fc={'count':0x0,'rows':[]};var _0x529329=db[_0xcdc6('0x2c')]['rawAttributes'];_0x2a3ad1['model']=_[_0xcdc6('0x2d')](_0x529329);_0x2a3ad1['query']=_['keys'](_0x534374[_0xcdc6('0x2e')]);_0x2a3ad1['filters']=_[_0xcdc6('0x2f')](_0x2a3ad1[_0xcdc6('0x30')],_0x2a3ad1[_0xcdc6('0x2e')]);_0xd609c8[_0xcdc6('0x31')]=_[_0xcdc6('0x2f')](_0x2a3ad1['model'],qs[_0xcdc6('0x32')](_0x534374[_0xcdc6('0x2e')][_0xcdc6('0x32')]));_0xd609c8['attributes']=_0xd609c8['attributes'][_0xcdc6('0x33')]?_0xd609c8[_0xcdc6('0x31')]:_0x2a3ad1[_0xcdc6('0x30')];if(!_0x534374['query'][_0xcdc6('0x34')](_0xcdc6('0x35'))){_0xd609c8[_0xcdc6('0x1b')]=qs[_0xcdc6('0x1b')](_0x534374[_0xcdc6('0x2e')][_0xcdc6('0x1b')]);_0xd609c8[_0xcdc6('0x1a')]=qs['offset'](_0x534374[_0xcdc6('0x2e')][_0xcdc6('0x1a')]);}_0xd609c8[_0xcdc6('0x36')]=qs[_0xcdc6('0x37')](_0x534374['query'][_0xcdc6('0x37')]);_0xd609c8['where']=qs[_0xcdc6('0x38')](_[_0xcdc6('0x39')](_0x534374[_0xcdc6('0x2e')],_0x2a3ad1['filters']));if(_0x534374[_0xcdc6('0x2e')][_0xcdc6('0x3a')]){_0xd609c8[_0xcdc6('0x3b')]=_[_0xcdc6('0x3c')](_0xd609c8[_0xcdc6('0x3b')],{'$or':_[_0xcdc6('0x3d')](_0x529329,function(_0x4412ff){if(_0x4412ff[_0xcdc6('0x3e')]['key']!=='VIRTUAL'){var _0x1d8490={};_0x1d8490[_0x4412ff[_0xcdc6('0x3f')]]={'$like':'%'+_0x534374['query'][_0xcdc6('0x3a')]+'%'};return _0x1d8490;}})});}_0xd609c8=_[_0xcdc6('0x3c')]({},_0xd609c8,_0x534374[_0xcdc6('0x40')]);var _0x58c947={'where':_0xd609c8['where']};return db[_0xcdc6('0x2c')][_0xcdc6('0x41')](_0x58c947)[_0xcdc6('0x22')](function(_0xaa06d4){_0x53e9fc['count']=_0xaa06d4;if(_0x534374[_0xcdc6('0x2e')][_0xcdc6('0x42')]){_0xd609c8[_0xcdc6('0x43')]=[{'all':!![]}];}return db[_0xcdc6('0x2c')][_0xcdc6('0x44')](_0xd609c8);})[_0xcdc6('0x22')](function(_0x5b79aa){_0x53e9fc[_0xcdc6('0x45')]=_0x5b79aa;return _0x53e9fc;})[_0xcdc6('0x22')](respondWithFilteredResult(_0xa5de51,_0xd609c8))[_0xcdc6('0x46')](handleError(_0xa5de51,null));};exports[_0xcdc6('0x47')]=function(_0x478c48,_0x196ade){var _0x44b975={'raw':!![],'where':{'id':_0x478c48['params']['id']}},_0x53f070={};_0x53f070[_0xcdc6('0x30')]=_[_0xcdc6('0x2d')](db[_0xcdc6('0x2c')][_0xcdc6('0x48')]);_0x53f070[_0xcdc6('0x2e')]=_[_0xcdc6('0x2d')](_0x478c48[_0xcdc6('0x2e')]);_0x53f070[_0xcdc6('0x38')]=_['intersection'](_0x53f070[_0xcdc6('0x30')],_0x53f070[_0xcdc6('0x2e')]);_0x44b975[_0xcdc6('0x31')]=_[_0xcdc6('0x2f')](_0x53f070[_0xcdc6('0x30')],qs[_0xcdc6('0x32')](_0x478c48[_0xcdc6('0x2e')][_0xcdc6('0x32')]));_0x44b975[_0xcdc6('0x31')]=_0x44b975[_0xcdc6('0x31')][_0xcdc6('0x33')]?_0x44b975[_0xcdc6('0x31')]:_0x53f070[_0xcdc6('0x30')];if(_0x478c48[_0xcdc6('0x2e')]['includeAll']){_0x44b975[_0xcdc6('0x43')]=[{'all':!![]}];}_0x44b975=_[_0xcdc6('0x3c')]({},_0x44b975,_0x478c48[_0xcdc6('0x40')]);return db['Plugin'][_0xcdc6('0x49')](_0x44b975)[_0xcdc6('0x22')](handleEntityNotFound(_0x196ade,null))[_0xcdc6('0x22')](respondWithResult(_0x196ade,null))[_0xcdc6('0x46')](handleError(_0x196ade,null));};exports[_0xcdc6('0x4a')]=function(_0x150c0e,_0x10880f,_0x310d47){return db[_0xcdc6('0x2c')]['find']({'where':{'id':_0x150c0e[_0xcdc6('0x4b')]['id']},'attributes':[_0xcdc6('0x29'),_0xcdc6('0x4c')],'raw':!![]})[_0xcdc6('0x22')](handleEntityNotFound(_0x10880f,null))['then'](function(_0x2a1e53){if(_0x2a1e53){var _0x4789b6=path['join'](config[_0xcdc6('0x4d')],_0xcdc6('0x4e'),util[_0xcdc6('0x4f')](_0xcdc6('0x50'),path[_0xcdc6('0x51')](_0x2a1e53[_0xcdc6('0x4c')])));var _0x5373ed=fs[_0xcdc6('0x52')](_0x4789b6);var _0x18a6b6=archiver('zip',{'zlib':{'level':0x9}});_0x18a6b6['on'](_0xcdc6('0x53'),function(_0x184779){if(_0x184779['code']===_0xcdc6('0x54')){logger[_0xcdc6('0x27')](_0x184779);}else{throw new db[(_0xcdc6('0x55'))]['Error'](_0xcdc6('0x56'));}});_0x18a6b6['on'](_0xcdc6('0x27'),function(_0x874d1d){throw new db['Sequelize'][(_0xcdc6('0x57'))](_0xcdc6('0x56'));});_0x18a6b6[_0xcdc6('0x58')](_0x5373ed);_0x18a6b6[_0xcdc6('0x59')](_0xcdc6('0x5a'),{'cwd':path[_0xcdc6('0x5b')](config[_0xcdc6('0x4d')],'server/files/plugins',path['dirname'](_0x2a1e53['path'])),'ignore':[path['join'](path[_0xcdc6('0x51')](_0x2a1e53[_0xcdc6('0x4c')]),_0xcdc6('0x5c')),path[_0xcdc6('0x5b')](path[_0xcdc6('0x51')](_0x2a1e53['path']),'attachments/**/*')],'nodir':!![]})['finalize']();_0x5373ed['on']('close',function(){if(!fs[_0xcdc6('0x5d')](_0x4789b6)){throw new db[(_0xcdc6('0x55'))]['Error'](_0xcdc6('0x5e'));}return _0x10880f[_0xcdc6('0x4a')](_0x4789b6,util['format']('%s.zip',path[_0xcdc6('0x51')](_0x2a1e53[_0xcdc6('0x4c')])),function(_0x16ed5f){if(_0x16ed5f){throw new db[(_0xcdc6('0x55'))][(_0xcdc6('0x57'))](_0xcdc6('0x5f'));}fs[_0xcdc6('0x60')](_0x4789b6);logger['info']('Download\x20completed');logger[_0xcdc6('0x61')](_0xcdc6('0x62'));});});}return null;})[_0xcdc6('0x46')](handleError(_0x10880f,null));};exports[_0xcdc6('0x63')]=function(_0x12b724,_0x4fe985,_0x173a55){var _0x120e5b=path['basename'](_0x12b724[_0xcdc6('0x64')]['filename'],path['extname'](_0x12b724[_0xcdc6('0x64')][_0xcdc6('0x65')]));var _0x10cf96=path[_0xcdc6('0x5b')](config[_0xcdc6('0x4d')],_0xcdc6('0x4e'),_0x12b724[_0xcdc6('0x64')]['filename']);var _0x3261e3=path[_0xcdc6('0x5b')](config[_0xcdc6('0x4d')],'server/files/plugins',_0x120e5b);logger[_0xcdc6('0x61')]('Plugin\x20upload\x20filepath:\x20%s',_0x10cf96);logger['info'](_0xcdc6('0x66'),_0x3261e3);try{fs['chmodSync'](_0x10cf96,parseInt(_0xcdc6('0x67'),0x8));extract(_0x10cf96,{'dir':_0x3261e3},function(_0x18dd4e){if(_0x18dd4e){logger[_0xcdc6('0x27')](_0x18dd4e);handleError(_0x18dd4e,!![]);};var _0x27b946=fs[_0xcdc6('0x68')](_0x3261e3);if(_0x27b946[_0xcdc6('0x33')]>0x1){removeReferences(_0x10cf96,_0x3261e3);logger[_0xcdc6('0x27')](_0xcdc6('0x69'));return _0x173a55(new Error('Invalid\x20plugin\x20structure'));}var _0x338310=fs['lstatSync'](path[_0xcdc6('0x5b')](_0x3261e3,_0x27b946[0x0]));if(_0x338310[_0xcdc6('0x6a')]()){removeReferences(_0x10cf96,_0x3261e3);logger[_0xcdc6('0x27')](_0xcdc6('0x69'));return _0x173a55(new Error('Invalid\x20plugin\x20structure'));}if(_0x338310[_0xcdc6('0x6b')]()){var _0x45bade=fs[_0xcdc6('0x68')](path[_0xcdc6('0x5b')](_0x3261e3,_0x27b946[0x0]));if(_0x45bade['length']===0x0){removeReferences(_0x10cf96,_0x3261e3);logger['error']('Invalid\x20plugin\x20structure');return _0x173a55(new Error(_0xcdc6('0x69')));}var _0x51d81e=_0x45bade[_0xcdc6('0x6c')](function(_0x1856d4){return _0x1856d4===_0xcdc6('0x6d');});if(!_0x51d81e){return _0x173a55(new Error(_0xcdc6('0x6e')));}var _0x244fdf=fs['readFileSync'](path[_0xcdc6('0x5b')](_0x3261e3,_0x27b946[0x0],_0xcdc6('0x6d')));var _0x198442=JSON[_0xcdc6('0x6f')](_0x244fdf);if('undefined'==typeof _0x198442[_0xcdc6('0x29')]){return _0x173a55(new Error(_0xcdc6('0x70')));}if(_0xcdc6('0x71')==typeof _0x198442[_0xcdc6('0x3e')]){return _0x173a55(new Error(_0xcdc6('0x72')));}if(_0xcdc6('0x71')==typeof _0x198442[_0xcdc6('0x73')]){return _0x173a55(new Error(_0xcdc6('0x74')));}if(_0xcdc6('0x71')==typeof _0x198442['parameters']){return _0x173a55(new Error(_0xcdc6('0x75')));}if(_0x198442[_0xcdc6('0x3e')]===_0xcdc6('0x76')){if(_0xcdc6('0x71')==typeof _0x198442[_0xcdc6('0x77')][_0xcdc6('0x78')]){return _0x173a55(new Error(_0xcdc6('0x79')));}if(_0xcdc6('0x71')==typeof _0x198442['parameters'][_0xcdc6('0x78')][_0xcdc6('0x7a')]&&_0xcdc6('0x71')==typeof _0x198442['parameters'][_0xcdc6('0x78')]['agent']){return _0x173a55(new Error(_0xcdc6('0x7b')));}}else if(_0x198442['type']===_0xcdc6('0x7c')){if(_0xcdc6('0x71')==typeof _0x198442['parameters'][_0xcdc6('0x7d')]){return _0x173a55(new Error(_0xcdc6('0x7e')));}if(_0xcdc6('0x71')==typeof _0x198442['parameters']['scriptPath']){return _0x173a55(new Error(_0xcdc6('0x7f')));}}else{return _0x173a55(new Error(_0xcdc6('0x80')));}var _0x914eeb=_0x198442[_0xcdc6('0x29')];var _0x2af157=_0x198442[_0xcdc6('0x81')];var _0x3c1781=_0x198442['type'];var _0x516c7c=_0x198442[_0xcdc6('0x82')]?_0x198442['sidebar']:_0xcdc6('0x83');var _0x115ec3=_0x198442[_0xcdc6('0x84')]?_0x198442[_0xcdc6('0x84')]:_0xcdc6('0x85');var _0x3ea8cf='';var _0x202f08='';var _0x86593b='';var _0x21d9b2='';var _0x3cc28a=_0x198442[_0xcdc6('0x73')];if(_0x3c1781===_0xcdc6('0x76')){if('undefined'!=typeof _0x198442[_0xcdc6('0x77')]['views'][_0xcdc6('0x7a')]){var _0x3d2ed9=_0x198442['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0xcdc6('0x86')](_0x3d2ed9)){_0x3ea8cf=path[_0xcdc6('0x5b')](_0xcdc6('0x87'),_0x120e5b,_0x27b946[0x0],_0x3d2ed9);}else{_0x3ea8cf=_0x3d2ed9;}}else{logger[_0xcdc6('0x61')](_0xcdc6('0x88'));}if(_0xcdc6('0x71')!=typeof _0x198442['parameters'][_0xcdc6('0x78')]['agent']){var _0x50cee0=_0x198442[_0xcdc6('0x77')]['views'][_0xcdc6('0x89')];if(!/^(f|ht)tps?:\/\//i[_0xcdc6('0x86')](_0x50cee0)){_0x202f08=path[_0xcdc6('0x5b')](_0xcdc6('0x87'),_0x120e5b,_0x27b946[0x0],_0x50cee0);}else{_0x202f08=_0x50cee0;}}else{logger[_0xcdc6('0x61')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x3c1781==='script'){_0x86593b=_0x198442[_0xcdc6('0x77')][_0xcdc6('0x7d')];_0x21d9b2=_0x198442['parameters'][_0xcdc6('0x8a')];if(_0xcdc6('0x71')!=typeof _0x198442[_0xcdc6('0x77')]['views']){if(_0xcdc6('0x71')!=typeof _0x198442[_0xcdc6('0x77')]['views'][_0xcdc6('0x7a')]){var _0x3d2ed9=_0x198442['parameters'][_0xcdc6('0x78')][_0xcdc6('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0xcdc6('0x86')](_0x3d2ed9)){_0x3ea8cf=path[_0xcdc6('0x5b')](_0xcdc6('0x87'),_0x120e5b,_0x27b946[0x0],_0x3d2ed9);}else{_0x3ea8cf=_0x3d2ed9;}}if(_0xcdc6('0x71')!=typeof _0x198442['parameters'][_0xcdc6('0x78')][_0xcdc6('0x89')]){var _0x50cee0=_0x198442[_0xcdc6('0x77')]['views'][_0xcdc6('0x89')];if(!/^(f|ht)tps?:\/\//i[_0xcdc6('0x86')](_0x50cee0)){_0x202f08=path['join'](_0xcdc6('0x87'),_0x120e5b,_0x27b946[0x0],_0x50cee0);}else{_0x202f08=_0x50cee0;}}}}var _0x1e5241={'name':_0x914eeb,'description':_0x2af157,'path':path[_0xcdc6('0x5b')](_0x120e5b,_0x27b946[0x0]),'type':_0x3c1781,'sidebar':_0x516c7c,'icon':_0x115ec3,'adminUrl':_0x3ea8cf,'agentUrl':_0x202f08,'scriptName':_0x86593b,'scriptPath':_0x21d9b2,'version':_0x3cc28a};removeReferences(_0x10cf96,null);return db[_0xcdc6('0x2c')][_0xcdc6('0x8b')](_0x1e5241)[_0xcdc6('0x22')](function(_0x44f932){var _0x19570b={'role':_0x12b724['body'][_0xcdc6('0x8c')],'userProfileId':_0x12b724['body'][_0xcdc6('0x8d')]};if(!_0x19570b)throw new Error(_0xcdc6('0x8e'));if(_0x19570b['role']==='user'){var _0x39d2c3=_0x44f932[_0xcdc6('0x24')]({'plain':!![]});return db[_0xcdc6('0x8f')][_0xcdc6('0x49')]({'where':{'name':_0xcdc6('0x25'),'userProfileId':_0x19570b[_0xcdc6('0x8d')]},'raw':!![]})[_0xcdc6('0x22')](function(_0x50123a){if(_0x50123a&&_0x50123a[_0xcdc6('0x90')]===0x0){return db[_0xcdc6('0x26')][_0xcdc6('0x8b')]({'name':_0x39d2c3[_0xcdc6('0x29')],'resourceId':_0x39d2c3['id'],'type':_0x50123a[_0xcdc6('0x29')],'sectionId':_0x50123a['id']},{})[_0xcdc6('0x22')](function(){return _0x44f932;});}else{return _0x44f932;}})[_0xcdc6('0x46')](function(_0x4bfae6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bfae6);throw _0x4bfae6;});}return _0x44f932;})[_0xcdc6('0x22')](respondWithResult(_0x4fe985,null))['catch'](handleError(_0x4fe985,null));}});}catch(_0x38640f){_0x4fe985[_0xcdc6('0x18')](0x1f4)[_0xcdc6('0x2a')](_0x38640f);}};function removeReferences(_0x10fae3,_0x485d56){try{if(_0x10fae3){fs[_0xcdc6('0x60')](_0x10fae3);logger[_0xcdc6('0x61')](_0xcdc6('0x91'));}if(_0x485d56){rimraf(_0x485d56,function(){});logger[_0xcdc6('0x61')](_0xcdc6('0x92'));}}catch(_0x113960){logger['error'](_0x113960);}}exports[_0xcdc6('0x21')]=function(_0x100b9a,_0xd120b7,_0x128ae3){return db[_0xcdc6('0x2c')]['find']({'where':{'id':_0x100b9a[_0xcdc6('0x4b')]['id']}})[_0xcdc6('0x22')](handleEntityNotFound(_0xd120b7,null))['then'](saveUpdates(_0x100b9a['body'],null))[_0xcdc6('0x22')](respondWithResult(_0xd120b7,null))[_0xcdc6('0x46')](handleError(_0xd120b7,null));};exports[_0xcdc6('0x93')]=function(_0x2dc60b,_0x148c31,_0x342cbd){return db['Plugin']['find']({'where':{'id':_0x2dc60b[_0xcdc6('0x4b')]['id']}})[_0xcdc6('0x22')](function(_0x296f7f){if(_0x296f7f){return _0x296f7f[_0xcdc6('0x23')]();}})['then'](function(_0x2ab834){rimraf(path[_0xcdc6('0x5b')](config[_0xcdc6('0x4d')],_0xcdc6('0x4e'),path['dirname'](_0x2ab834[_0xcdc6('0x4c')])),function(){});return _0x2ab834;})[_0xcdc6('0x22')](handleEntityNotFound(_0x148c31,null))[_0xcdc6('0x22')](respondWithStatusCode(_0x148c31,null))[_0xcdc6('0x46')](handleError(_0x148c31,null));};exports['webhookGet']=function(_0x584345,_0x5cddf1,_0x789697){return BPromise[_0xcdc6('0x94')]()[_0xcdc6('0x22')](function(){if(!_0x584345[_0xcdc6('0x2e')][_0xcdc6('0x4c')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x584345['query'][_0xcdc6('0x95')]){throw new Error(_0xcdc6('0x96'));}var _0x1cd018=_0x584345[_0xcdc6('0x2e')][_0xcdc6('0x97')]?_0x584345['query'][_0xcdc6('0x97')]+':'+_0x584345[_0xcdc6('0x2e')][_0xcdc6('0x95')]:_0xcdc6('0x98')+_0x584345[_0xcdc6('0x2e')][_0xcdc6('0x95')];var _0x5edce6=_0x584345[_0xcdc6('0x2e')][_0xcdc6('0x1d')]?_0x584345[_0xcdc6('0x2e')][_0xcdc6('0x1d')]:!![];var _0x1edc6c=_0x584345[_0xcdc6('0x2e')][_0xcdc6('0x99')]?_0x584345[_0xcdc6('0x2e')][_0xcdc6('0x99')]:null;var _0x4c627a={'method':_0x584345[_0xcdc6('0x9a')],'uri':util[_0xcdc6('0x4f')]('%s%s',_0x1cd018,_0x584345[_0xcdc6('0x2e')][_0xcdc6('0x4c')]),'json':_0x5edce6,'resolveWithFullResponse':!![],'encoding':_0x1edc6c,'qs':_0x584345['query']};if(_0x584345['headers']){_0x4c627a[_0xcdc6('0x9b')]=_0x584345[_0xcdc6('0x9b')];if(_0x4c627a['headers']['content-length']){delete _0x4c627a[_0xcdc6('0x9b')][_0xcdc6('0x9c')];}}if(_0x4c627a[_0xcdc6('0x9b')][_0xcdc6('0x9d')]){delete _0x4c627a[_0xcdc6('0x9b')]['content-type'];}return rp(_0x4c627a);})['then'](function(_0x2ff645){if(_0x2ff645){_0x5cddf1[_0xcdc6('0x9e')](_0x2ff645[_0xcdc6('0x9b')]);logger[_0xcdc6('0x61')](_0x2ff645[_0xcdc6('0x9f')]);if(_[_0xcdc6('0xa0')](_0x584345['query'][_0xcdc6('0x4c')],_0xcdc6('0x4a'))&&_0x2ff645['statusCode']==0x1f4){return _0x5cddf1[_0xcdc6('0x17')](_0x2ff645[_0xcdc6('0xa1')]);}else{return _0x5cddf1[_0xcdc6('0x18')](_0x2ff645[_0xcdc6('0xa1')])[_0xcdc6('0x2a')](_0x2ff645[_0xcdc6('0x9f')]);}}else{return _0x5cddf1[_0xcdc6('0x17')](0xc8);}})[_0xcdc6('0x46')](handleError(_0x5cddf1,null));};exports[_0xcdc6('0xa2')]=function(_0x206523,_0x385ddd,_0x180509){return BPromise['resolve']()[_0xcdc6('0x22')](function(){if(!_0x206523[_0xcdc6('0x2e')][_0xcdc6('0x4c')]){throw new Error(_0xcdc6('0xa3'));}if(!_0x206523[_0xcdc6('0x2e')][_0xcdc6('0x95')]){throw new Error(_0xcdc6('0x96'));}var _0x5c31b0=_0x206523[_0xcdc6('0x2e')][_0xcdc6('0x97')]?_0x206523['query'][_0xcdc6('0x97')]+':'+_0x206523[_0xcdc6('0x2e')][_0xcdc6('0x95')]:_0xcdc6('0x98')+_0x206523[_0xcdc6('0x2e')][_0xcdc6('0x95')];var _0x1c28fe=_0x206523[_0xcdc6('0x2e')][_0xcdc6('0x1d')]?_0x206523[_0xcdc6('0x2e')][_0xcdc6('0x1d')]:!![];var _0xc67b38=_0x206523[_0xcdc6('0x2e')]['encoding']?_0x206523[_0xcdc6('0x2e')][_0xcdc6('0x99')]:null;var _0x40a46e={'method':_0x206523[_0xcdc6('0x9a')],'uri':util['format'](_0xcdc6('0xa4'),_0x5c31b0,_0x206523[_0xcdc6('0x2e')][_0xcdc6('0x4c')]),'json':_0x1c28fe,'resolveWithFullResponse':!![],'encoding':_0xc67b38,'body':_0x206523[_0xcdc6('0x9f')]};if(_0x206523[_0xcdc6('0x9b')]){_0x40a46e[_0xcdc6('0x9b')]=_0x206523[_0xcdc6('0x9b')];if(_0x40a46e[_0xcdc6('0x9b')]['content-length']){delete _0x40a46e[_0xcdc6('0x9b')][_0xcdc6('0x9c')];}}if(_0x40a46e[_0xcdc6('0x9b')][_0xcdc6('0x9d')]){delete _0x40a46e[_0xcdc6('0x9b')]['content-type'];}return rp(_0x40a46e);})[_0xcdc6('0x22')](function(_0x4f5a1b){if(_0x4f5a1b){_0x385ddd[_0xcdc6('0x9e')](_0x4f5a1b[_0xcdc6('0x9b')]);logger[_0xcdc6('0x61')](_0x4f5a1b[_0xcdc6('0x9f')]);return _0x385ddd[_0xcdc6('0x18')](_0x4f5a1b[_0xcdc6('0xa1')])[_0xcdc6('0x2a')](_0x4f5a1b[_0xcdc6('0x9f')]);}else{return _0x385ddd[_0xcdc6('0x17')](0xc8);}})['catch'](handleError(_0x385ddd,null));}; \ No newline at end of file +var _0xe4fd=['finalize','close','existsSync','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','Invalid\x20manifest:\x20views\x20missing','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-type','statusCode','webhookPost','resolve','method','content-length','html-pdf','eml-format','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','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','key','Plugin','includeAll','include','findAll','rows','catch','show','params','options','find','download','root','server/files/plugins','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','join','attachments/**/*'];(function(_0x3194b6,_0x26c323){var _0x5ade5f=function(_0x68e30a){while(--_0x68e30a){_0x3194b6['push'](_0x3194b6['shift']());}};_0x5ade5f(++_0x26c323);}(_0xe4fd,0x1af));var _0xde4f=function(_0x3d10f5,_0x2c82e2){_0x3d10f5=_0x3d10f5-0x0;var _0x24f00a=_0xe4fd[_0x3d10f5];return _0x24f00a;};'use strict';var pdf=require(_0xde4f('0x0'));var emlformat=require(_0xde4f('0x1'));var rimraf=require(_0xde4f('0x2'));var zipdir=require(_0xde4f('0x3'));var jsonpatch=require(_0xde4f('0x4'));var rp=require(_0xde4f('0x5'));var moment=require(_0xde4f('0x6'));var BPromise=require(_0xde4f('0x7'));var Mustache=require(_0xde4f('0x8'));var util=require(_0xde4f('0x9'));var path=require(_0xde4f('0xa'));var sox=require(_0xde4f('0xb'));var csv=require(_0xde4f('0xc'));var ejs=require(_0xde4f('0xd'));var fs=require('fs');var _=require(_0xde4f('0xe'));var squel=require(_0xde4f('0xf'));var crypto=require(_0xde4f('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xde4f('0x11'));var toCsv=require(_0xde4f('0xc'));var querystring=require(_0xde4f('0x12'));var Papa=require(_0xde4f('0x13'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0xde4f('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xde4f('0x15'))(_0xde4f('0x16'));var utils=require(_0xde4f('0x17'));var config=require('../../config/environment');var db=require(_0xde4f('0x18'))['db'];config[_0xde4f('0x19')]=_['defaults'](config[_0xde4f('0x19')],{'host':_0xde4f('0x1a'),'port':0x18eb});var socket=require(_0xde4f('0x1b'))(new Redis(config['redis']));require(_0xde4f('0x1c'))[_0xde4f('0x1d')](socket);function respondWithStatusCode(_0x48247e,_0x1d477a){_0x1d477a=_0x1d477a||0xcc;return function(_0x2fd7dc){if(_0x2fd7dc){return _0x48247e[_0xde4f('0x1e')](_0x1d477a);}return _0x48247e[_0xde4f('0x1f')](_0x1d477a)[_0xde4f('0x20')]();};}function respondWithResult(_0x395b2c,_0x46e3e0){_0x46e3e0=_0x46e3e0||0xc8;return function(_0x30c8ef){if(_0x30c8ef){return _0x395b2c[_0xde4f('0x1f')](_0x46e3e0)[_0xde4f('0x21')](_0x30c8ef);}};}function respondWithFilteredResult(_0x6f9441,_0x53f1f0){return function(_0x2a4f06){if(_0x2a4f06){var _0x58e9cd=_0x2a4f06[_0xde4f('0x22')],_0x1c822a=_0x53f1f0[_0xde4f('0x23')],_0x1ca7cb=_0x53f1f0[_0xde4f('0x23')]+_0x53f1f0[_0xde4f('0x24')],_0x333a0e;if(_0x1ca7cb>=_0x58e9cd){_0x1ca7cb=_0x58e9cd;_0x333a0e=0xc8;}else{_0x333a0e=0xce;}_0x6f9441[_0xde4f('0x1f')](_0x333a0e);return _0x6f9441[_0xde4f('0x25')](_0xde4f('0x26'),_0x1c822a+'-'+_0x1ca7cb+'/'+_0x58e9cd)['json'](_0x2a4f06);}return null;};}function patchUpdates(_0x4277b3){return function(_0x580618){try{jsonpatch[_0xde4f('0x27')](_0x580618,_0x4277b3,!![]);}catch(_0x2ddefc){return BPromise[_0xde4f('0x28')](_0x2ddefc);}return _0x580618[_0xde4f('0x29')]();};}function saveUpdates(_0x22d3b1,_0x285ce3){return function(_0x33e587){if(_0x33e587){return _0x33e587[_0xde4f('0x2a')](_0x22d3b1)[_0xde4f('0x2b')](function(_0x1533dd){return _0x1533dd;});}return null;};}function removeEntity(_0x1299d4,_0x122695){return function(_0x2eda0a){if(_0x2eda0a){return _0x2eda0a[_0xde4f('0x2c')]()['then'](function(){var _0x35b3a1=_0x2eda0a[_0xde4f('0x2d')]({'plain':!![]});var _0x251c2e=_0xde4f('0x2e');return db[_0xde4f('0x2f')][_0xde4f('0x2c')]({'where':{'type':_0x251c2e,'resourceId':_0x35b3a1['id']}})['then'](function(){return _0x2eda0a;});})[_0xde4f('0x2b')](function(){_0x1299d4[_0xde4f('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x284cd3,_0x1e6c38){return function(_0xa93c79){if(!_0xa93c79){_0x284cd3[_0xde4f('0x1e')](0x194);}return _0xa93c79;};}function handleError(_0x75b5e5,_0x2ec2bb){_0x2ec2bb=_0x2ec2bb||0x1f4;return function(_0x2267eb){logger[_0xde4f('0x30')](_0x2267eb[_0xde4f('0x31')]);if(_0x2267eb[_0xde4f('0x32')]){delete _0x2267eb[_0xde4f('0x32')];}_0x75b5e5[_0xde4f('0x1f')](_0x2ec2bb)[_0xde4f('0x33')](_0x2267eb);};}exports['index']=function(_0x3e6ecf,_0x2bfd47){var _0x3231fc={},_0x48df54={},_0x3625ee={'count':0x0,'rows':[]};var _0x44c8f0=db['Plugin'][_0xde4f('0x34')];_0x48df54[_0xde4f('0x35')]=_[_0xde4f('0x36')](_0x44c8f0);_0x48df54[_0xde4f('0x37')]=_[_0xde4f('0x36')](_0x3e6ecf[_0xde4f('0x37')]);_0x48df54[_0xde4f('0x38')]=_[_0xde4f('0x39')](_0x48df54[_0xde4f('0x35')],_0x48df54[_0xde4f('0x37')]);_0x3231fc['attributes']=_[_0xde4f('0x39')](_0x48df54[_0xde4f('0x35')],qs['fields'](_0x3e6ecf[_0xde4f('0x37')][_0xde4f('0x3a')]));_0x3231fc['attributes']=_0x3231fc[_0xde4f('0x3b')][_0xde4f('0x3c')]?_0x3231fc[_0xde4f('0x3b')]:_0x48df54[_0xde4f('0x35')];if(!_0x3e6ecf['query'][_0xde4f('0x3d')](_0xde4f('0x3e'))){_0x3231fc[_0xde4f('0x24')]=qs[_0xde4f('0x24')](_0x3e6ecf[_0xde4f('0x37')]['limit']);_0x3231fc[_0xde4f('0x23')]=qs['offset'](_0x3e6ecf['query'][_0xde4f('0x23')]);}_0x3231fc[_0xde4f('0x3f')]=qs[_0xde4f('0x40')](_0x3e6ecf[_0xde4f('0x37')][_0xde4f('0x40')]);_0x3231fc['where']=qs[_0xde4f('0x38')](_[_0xde4f('0x41')](_0x3e6ecf[_0xde4f('0x37')],_0x48df54['filters']));if(_0x3e6ecf[_0xde4f('0x37')][_0xde4f('0x42')]){_0x3231fc[_0xde4f('0x43')]=_[_0xde4f('0x44')](_0x3231fc['where'],{'$or':_['map'](_0x44c8f0,function(_0x1d8b0d){if(_0x1d8b0d[_0xde4f('0x45')][_0xde4f('0x46')]!=='VIRTUAL'){var _0x1d0d05={};_0x1d0d05[_0x1d8b0d['field']]={'$like':'%'+_0x3e6ecf[_0xde4f('0x37')][_0xde4f('0x42')]+'%'};return _0x1d0d05;}})});}_0x3231fc=_[_0xde4f('0x44')]({},_0x3231fc,_0x3e6ecf['options']);var _0x49b821={'where':_0x3231fc['where']};return db[_0xde4f('0x47')][_0xde4f('0x22')](_0x49b821)['then'](function(_0x3c296c){_0x3625ee['count']=_0x3c296c;if(_0x3e6ecf['query'][_0xde4f('0x48')]){_0x3231fc[_0xde4f('0x49')]=[{'all':!![]}];}return db[_0xde4f('0x47')][_0xde4f('0x4a')](_0x3231fc);})[_0xde4f('0x2b')](function(_0x3ef6eb){_0x3625ee[_0xde4f('0x4b')]=_0x3ef6eb;return _0x3625ee;})['then'](respondWithFilteredResult(_0x2bfd47,_0x3231fc))[_0xde4f('0x4c')](handleError(_0x2bfd47,null));};exports[_0xde4f('0x4d')]=function(_0x4388fc,_0xbd9ba0){var _0x51900a={'raw':!![],'where':{'id':_0x4388fc[_0xde4f('0x4e')]['id']}},_0x4255ed={};_0x4255ed[_0xde4f('0x35')]=_['keys'](db[_0xde4f('0x47')][_0xde4f('0x34')]);_0x4255ed['query']=_['keys'](_0x4388fc[_0xde4f('0x37')]);_0x4255ed[_0xde4f('0x38')]=_['intersection'](_0x4255ed[_0xde4f('0x35')],_0x4255ed[_0xde4f('0x37')]);_0x51900a[_0xde4f('0x3b')]=_['intersection'](_0x4255ed[_0xde4f('0x35')],qs[_0xde4f('0x3a')](_0x4388fc[_0xde4f('0x37')][_0xde4f('0x3a')]));_0x51900a['attributes']=_0x51900a[_0xde4f('0x3b')][_0xde4f('0x3c')]?_0x51900a[_0xde4f('0x3b')]:_0x4255ed[_0xde4f('0x35')];if(_0x4388fc[_0xde4f('0x37')][_0xde4f('0x48')]){_0x51900a[_0xde4f('0x49')]=[{'all':!![]}];}_0x51900a=_[_0xde4f('0x44')]({},_0x51900a,_0x4388fc[_0xde4f('0x4f')]);return db[_0xde4f('0x47')][_0xde4f('0x50')](_0x51900a)[_0xde4f('0x2b')](handleEntityNotFound(_0xbd9ba0,null))[_0xde4f('0x2b')](respondWithResult(_0xbd9ba0,null))[_0xde4f('0x4c')](handleError(_0xbd9ba0,null));};exports[_0xde4f('0x51')]=function(_0x2affb8,_0x1ea246,_0x48ee7b){return db[_0xde4f('0x47')][_0xde4f('0x50')]({'where':{'id':_0x2affb8[_0xde4f('0x4e')]['id']},'attributes':[_0xde4f('0x32'),_0xde4f('0xa')],'raw':!![]})[_0xde4f('0x2b')](handleEntityNotFound(_0x1ea246,null))['then'](function(_0x4dc844){if(_0x4dc844){var _0x5a79e3=path['join'](config[_0xde4f('0x52')],_0xde4f('0x53'),util['format'](_0xde4f('0x54'),path[_0xde4f('0x55')](_0x4dc844[_0xde4f('0xa')])));var _0x359101=fs[_0xde4f('0x56')](_0x5a79e3);var _0x2b179f=archiver(_0xde4f('0x57'),{'zlib':{'level':0x9}});_0x2b179f['on'](_0xde4f('0x58'),function(_0x13276f){if(_0x13276f[_0xde4f('0x59')]===_0xde4f('0x5a')){logger[_0xde4f('0x30')](_0x13276f);}else{throw new db[(_0xde4f('0x5b'))][(_0xde4f('0x5c'))](_0xde4f('0x5d'));}});_0x2b179f['on'](_0xde4f('0x30'),function(_0x277c86){throw new db[(_0xde4f('0x5b'))][(_0xde4f('0x5c'))](_0xde4f('0x5d'));});_0x2b179f[_0xde4f('0x5e')](_0x359101);_0x2b179f[_0xde4f('0x5f')](_0xde4f('0x60'),{'cwd':path['join'](config[_0xde4f('0x52')],_0xde4f('0x53'),path[_0xde4f('0x61')](_0x4dc844[_0xde4f('0xa')])),'ignore':[path[_0xde4f('0x62')](path['basename'](_0x4dc844[_0xde4f('0xa')]),'node_modules/**/*'),path[_0xde4f('0x62')](path[_0xde4f('0x55')](_0x4dc844[_0xde4f('0xa')]),_0xde4f('0x63'))],'nodir':!![]})[_0xde4f('0x64')]();_0x359101['on'](_0xde4f('0x65'),function(){if(!fs[_0xde4f('0x66')](_0x5a79e3)){throw new db['Sequelize']['Error'](_0xde4f('0x67'));}return _0x1ea246[_0xde4f('0x51')](_0x5a79e3,util[_0xde4f('0x68')]('%s.zip',path[_0xde4f('0x55')](_0x4dc844[_0xde4f('0xa')])),function(_0x5987e1){if(_0x5987e1){throw new db[(_0xde4f('0x5b'))][(_0xde4f('0x5c'))](_0xde4f('0x69'));}fs[_0xde4f('0x6a')](_0x5a79e3);logger[_0xde4f('0x6b')](_0xde4f('0x6c'));logger[_0xde4f('0x6b')](_0xde4f('0x6d'));});});}return null;})[_0xde4f('0x4c')](handleError(_0x1ea246,null));};exports[_0xde4f('0x6e')]=function(_0x33dec8,_0x54a22c,_0xda6e52){var _0x43371c=path[_0xde4f('0x55')](_0x33dec8[_0xde4f('0x6f')][_0xde4f('0x70')],path['extname'](_0x33dec8['file']['filename']));var _0x83179a=path[_0xde4f('0x62')](config['root'],_0xde4f('0x53'),_0x33dec8[_0xde4f('0x6f')][_0xde4f('0x70')]);var _0x29d0c5=path[_0xde4f('0x62')](config['root'],_0xde4f('0x53'),_0x43371c);logger[_0xde4f('0x6b')](_0xde4f('0x71'),_0x83179a);logger[_0xde4f('0x6b')](_0xde4f('0x72'),_0x29d0c5);try{fs[_0xde4f('0x73')](_0x83179a,parseInt(_0xde4f('0x74'),0x8));extract(_0x83179a,{'dir':_0x29d0c5},function(_0x48d7bc){if(_0x48d7bc){logger[_0xde4f('0x30')](_0x48d7bc);handleError(_0x48d7bc,!![]);};var _0x34e5d9=fs[_0xde4f('0x75')](_0x29d0c5);if(_0x34e5d9[_0xde4f('0x3c')]>0x1){removeReferences(_0x83179a,_0x29d0c5);logger[_0xde4f('0x30')](_0xde4f('0x76'));return _0xda6e52(new Error('Invalid\x20plugin\x20structure'));}var _0x119783=fs[_0xde4f('0x77')](path['join'](_0x29d0c5,_0x34e5d9[0x0]));if(_0x119783[_0xde4f('0x78')]()){removeReferences(_0x83179a,_0x29d0c5);logger[_0xde4f('0x30')](_0xde4f('0x76'));return _0xda6e52(new Error(_0xde4f('0x76')));}if(_0x119783[_0xde4f('0x79')]()){var _0x33d2dd=fs[_0xde4f('0x75')](path[_0xde4f('0x62')](_0x29d0c5,_0x34e5d9[0x0]));if(_0x33d2dd[_0xde4f('0x3c')]===0x0){removeReferences(_0x83179a,_0x29d0c5);logger[_0xde4f('0x30')](_0xde4f('0x76'));return _0xda6e52(new Error(_0xde4f('0x76')));}var _0x158794=_0x33d2dd['some'](function(_0x3db0a4){return _0x3db0a4===_0xde4f('0x7a');});if(!_0x158794){return _0xda6e52(new Error(_0xde4f('0x7b')));}var _0x50ccb5=fs[_0xde4f('0x7c')](path[_0xde4f('0x62')](_0x29d0c5,_0x34e5d9[0x0],'manifest.json'));var _0x13683f=JSON[_0xde4f('0x7d')](_0x50ccb5);if(_0xde4f('0x7e')==typeof _0x13683f['name']){return _0xda6e52(new Error(_0xde4f('0x7f')));}if('undefined'==typeof _0x13683f[_0xde4f('0x45')]){return _0xda6e52(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xde4f('0x7e')==typeof _0x13683f[_0xde4f('0x80')]){return _0xda6e52(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xde4f('0x7e')==typeof _0x13683f[_0xde4f('0x81')]){return _0xda6e52(new Error(_0xde4f('0x82')));}if(_0x13683f[_0xde4f('0x45')]==='html'){if(_0xde4f('0x7e')==typeof _0x13683f[_0xde4f('0x81')]['views']){return _0xda6e52(new Error(_0xde4f('0x83')));}if('undefined'==typeof _0x13683f['parameters'][_0xde4f('0x84')]['admin']&&_0xde4f('0x7e')==typeof _0x13683f[_0xde4f('0x81')][_0xde4f('0x84')][_0xde4f('0x85')]){return _0xda6e52(new Error(_0xde4f('0x86')));}}else if(_0x13683f[_0xde4f('0x45')]===_0xde4f('0x87')){if(_0xde4f('0x7e')==typeof _0x13683f['parameters'][_0xde4f('0x88')]){return _0xda6e52(new Error(_0xde4f('0x89')));}if(_0xde4f('0x7e')==typeof _0x13683f[_0xde4f('0x81')]['scriptPath']){return _0xda6e52(new Error(_0xde4f('0x8a')));}}else{return _0xda6e52(new Error(_0xde4f('0x8b')));}var _0x39274d=_0x13683f['name'];var _0x45b6e3=_0x13683f[_0xde4f('0x8c')];var _0x17dbd7=_0x13683f[_0xde4f('0x45')];var _0x1b121d=_0x13683f[_0xde4f('0x8d')]?_0x13683f[_0xde4f('0x8d')]:_0xde4f('0x8e');var _0x4f6754=_0x13683f['icon']?_0x13683f[_0xde4f('0x8f')]:_0xde4f('0x90');var _0x597b3d='';var _0x1ae563='';var _0x33538d='';var _0x2efec8='';var _0x52dfe7=_0x13683f['version'];if(_0x17dbd7===_0xde4f('0x91')){if(_0xde4f('0x7e')!=typeof _0x13683f[_0xde4f('0x81')]['views'][_0xde4f('0x92')]){var _0x5cae5c=_0x13683f[_0xde4f('0x81')][_0xde4f('0x84')][_0xde4f('0x92')];if(!/^(f|ht)tps?:\/\//i[_0xde4f('0x93')](_0x5cae5c)){_0x597b3d=path[_0xde4f('0x62')](_0xde4f('0x94'),_0x43371c,_0x34e5d9[0x0],_0x5cae5c);}else{_0x597b3d=_0x5cae5c;}}else{logger['info'](_0xde4f('0x95'));}if('undefined'!=typeof _0x13683f[_0xde4f('0x81')][_0xde4f('0x84')][_0xde4f('0x85')]){var _0x393bed=_0x13683f['parameters'][_0xde4f('0x84')][_0xde4f('0x85')];if(!/^(f|ht)tps?:\/\//i['test'](_0x393bed)){_0x1ae563=path[_0xde4f('0x62')](_0xde4f('0x94'),_0x43371c,_0x34e5d9[0x0],_0x393bed);}else{_0x1ae563=_0x393bed;}}else{logger[_0xde4f('0x6b')](_0xde4f('0x96'));}}else if(_0x17dbd7===_0xde4f('0x87')){_0x33538d=_0x13683f[_0xde4f('0x81')][_0xde4f('0x88')];_0x2efec8=_0x13683f['parameters'][_0xde4f('0x97')];if(_0xde4f('0x7e')!=typeof _0x13683f[_0xde4f('0x81')][_0xde4f('0x84')]){if('undefined'!=typeof _0x13683f[_0xde4f('0x81')][_0xde4f('0x84')]['admin']){var _0x5cae5c=_0x13683f[_0xde4f('0x81')][_0xde4f('0x84')][_0xde4f('0x92')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5cae5c)){_0x597b3d=path[_0xde4f('0x62')]('plugins',_0x43371c,_0x34e5d9[0x0],_0x5cae5c);}else{_0x597b3d=_0x5cae5c;}}if('undefined'!=typeof _0x13683f['parameters'][_0xde4f('0x84')]['agent']){var _0x393bed=_0x13683f['parameters']['views'][_0xde4f('0x85')];if(!/^(f|ht)tps?:\/\//i[_0xde4f('0x93')](_0x393bed)){_0x1ae563=path[_0xde4f('0x62')]('plugins',_0x43371c,_0x34e5d9[0x0],_0x393bed);}else{_0x1ae563=_0x393bed;}}}}var _0x594263={'name':_0x39274d,'description':_0x45b6e3,'path':path['join'](_0x43371c,_0x34e5d9[0x0]),'type':_0x17dbd7,'sidebar':_0x1b121d,'icon':_0x4f6754,'adminUrl':_0x597b3d,'agentUrl':_0x1ae563,'scriptName':_0x33538d,'scriptPath':_0x2efec8,'version':_0x52dfe7};removeReferences(_0x83179a,null);return db[_0xde4f('0x47')][_0xde4f('0x98')](_0x594263)[_0xde4f('0x2b')](function(_0x49ed63){var _0x4530d0={'role':_0x33dec8['body']['role'],'userProfileId':_0x33dec8[_0xde4f('0x99')][_0xde4f('0x9a')]};if(!_0x4530d0)throw new Error(_0xde4f('0x9b'));if(_0x4530d0[_0xde4f('0x9c')]===_0xde4f('0x9d')){var _0x5441e8=_0x49ed63[_0xde4f('0x2d')]({'plain':!![]});return db[_0xde4f('0x9e')][_0xde4f('0x50')]({'where':{'name':_0xde4f('0x2e'),'userProfileId':_0x4530d0[_0xde4f('0x9a')]},'raw':!![]})[_0xde4f('0x2b')](function(_0x1b626e){if(_0x1b626e&&_0x1b626e[_0xde4f('0x9f')]===0x0){return db[_0xde4f('0x2f')][_0xde4f('0x98')]({'name':_0x5441e8[_0xde4f('0x32')],'resourceId':_0x5441e8['id'],'type':_0x1b626e[_0xde4f('0x32')],'sectionId':_0x1b626e['id']},{})[_0xde4f('0x2b')](function(){return _0x49ed63;});}else{return _0x49ed63;}})['catch'](function(_0x138afc){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x138afc);throw _0x138afc;});}return _0x49ed63;})[_0xde4f('0x2b')](respondWithResult(_0x54a22c,null))['catch'](handleError(_0x54a22c,null));}});}catch(_0x328304){_0x54a22c[_0xde4f('0x1f')](0x1f4)[_0xde4f('0x33')](_0x328304);}};function removeReferences(_0x380efc,_0x1e93df){try{if(_0x380efc){fs['unlinkSync'](_0x380efc);logger['info'](_0xde4f('0xa0'));}if(_0x1e93df){rimraf(_0x1e93df,function(){});logger[_0xde4f('0x6b')](_0xde4f('0xa1'));}}catch(_0x5ddc3b){logger['error'](_0x5ddc3b);}}exports[_0xde4f('0x2a')]=function(_0x51732d,_0x5548b9,_0x35b2ad){return db[_0xde4f('0x47')]['find']({'where':{'id':_0x51732d['params']['id']}})[_0xde4f('0x2b')](handleEntityNotFound(_0x5548b9,null))['then'](saveUpdates(_0x51732d['body'],null))[_0xde4f('0x2b')](respondWithResult(_0x5548b9,null))[_0xde4f('0x4c')](handleError(_0x5548b9,null));};exports['delete']=function(_0x36c891,_0x1f5981,_0x261287){return db[_0xde4f('0x47')]['find']({'where':{'id':_0x36c891[_0xde4f('0x4e')]['id']}})['then'](function(_0x4195c1){if(_0x4195c1){return _0x4195c1[_0xde4f('0x2c')]();}})['then'](function(_0x39eda0){rimraf(path['join'](config[_0xde4f('0x52')],_0xde4f('0x53'),path['dirname'](_0x39eda0['path'])),function(){});return _0x39eda0;})[_0xde4f('0x2b')](handleEntityNotFound(_0x1f5981,null))[_0xde4f('0x2b')](respondWithStatusCode(_0x1f5981,null))['catch'](handleError(_0x1f5981,null));};exports[_0xde4f('0xa2')]=function(_0x5df3fb,_0x5e1678,_0x529503){return BPromise['resolve']()[_0xde4f('0x2b')](function(){if(!_0x5df3fb[_0xde4f('0x37')][_0xde4f('0xa')]){throw new Error(_0xde4f('0xa3'));}if(!_0x5df3fb[_0xde4f('0x37')][_0xde4f('0xa4')]){throw new Error(_0xde4f('0xa5'));}var _0x5185cf=_0x5df3fb[_0xde4f('0x37')]['hostname']?_0x5df3fb[_0xde4f('0x37')][_0xde4f('0xa6')]+':'+_0x5df3fb[_0xde4f('0x37')][_0xde4f('0xa4')]:_0xde4f('0xa7')+_0x5df3fb['query'][_0xde4f('0xa4')];var _0x11a0c5=_0x5df3fb[_0xde4f('0x37')][_0xde4f('0x21')]?_0x5df3fb[_0xde4f('0x37')][_0xde4f('0x21')]:!![];var _0x36968d=_0x5df3fb[_0xde4f('0x37')][_0xde4f('0xa8')]?_0x5df3fb['query'][_0xde4f('0xa8')]:null;var _0x314358={'method':_0x5df3fb['method'],'uri':util[_0xde4f('0x68')](_0xde4f('0xa9'),_0x5185cf,_0x5df3fb[_0xde4f('0x37')][_0xde4f('0xa')]),'json':_0x11a0c5,'resolveWithFullResponse':!![],'encoding':_0x36968d,'qs':_0x5df3fb[_0xde4f('0x37')]};if(_0x5df3fb['headers']){_0x314358[_0xde4f('0xaa')]=_0x5df3fb[_0xde4f('0xaa')];if(_0x314358[_0xde4f('0xaa')]['content-length']){delete _0x314358['headers']['content-length'];}}if(_0x314358[_0xde4f('0xaa')][_0xde4f('0xab')]){delete _0x314358[_0xde4f('0xaa')][_0xde4f('0xab')];}return rp(_0x314358);})[_0xde4f('0x2b')](function(_0x3c57ae){if(_0x3c57ae){_0x5e1678['set'](_0x3c57ae[_0xde4f('0xaa')]);logger['info'](_0x3c57ae['body']);if(_['endsWith'](_0x5df3fb[_0xde4f('0x37')][_0xde4f('0xa')],_0xde4f('0x51'))&&_0x3c57ae['statusCode']==0x1f4){return _0x5e1678[_0xde4f('0x1e')](_0x3c57ae[_0xde4f('0xac')]);}else{return _0x5e1678[_0xde4f('0x1f')](_0x3c57ae[_0xde4f('0xac')])[_0xde4f('0x33')](_0x3c57ae[_0xde4f('0x99')]);}}else{return _0x5e1678[_0xde4f('0x1e')](0xc8);}})['catch'](handleError(_0x5e1678,null));};exports[_0xde4f('0xad')]=function(_0x4e8f24,_0x4ce8eb,_0x206969){return BPromise[_0xde4f('0xae')]()[_0xde4f('0x2b')](function(){if(!_0x4e8f24[_0xde4f('0x37')][_0xde4f('0xa')]){throw new Error(_0xde4f('0xa3'));}if(!_0x4e8f24[_0xde4f('0x37')][_0xde4f('0xa4')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x4bc8c2=_0x4e8f24[_0xde4f('0x37')][_0xde4f('0xa6')]?_0x4e8f24[_0xde4f('0x37')][_0xde4f('0xa6')]+':'+_0x4e8f24[_0xde4f('0x37')][_0xde4f('0xa4')]:_0xde4f('0xa7')+_0x4e8f24['query']['port'];var _0x1741b7=_0x4e8f24[_0xde4f('0x37')][_0xde4f('0x21')]?_0x4e8f24['query'][_0xde4f('0x21')]:!![];var _0x1b8bb8=_0x4e8f24[_0xde4f('0x37')][_0xde4f('0xa8')]?_0x4e8f24['query'][_0xde4f('0xa8')]:null;var _0x5a4aae={'method':_0x4e8f24[_0xde4f('0xaf')],'uri':util[_0xde4f('0x68')](_0xde4f('0xa9'),_0x4bc8c2,_0x4e8f24[_0xde4f('0x37')][_0xde4f('0xa')]),'json':_0x1741b7,'resolveWithFullResponse':!![],'encoding':_0x1b8bb8,'body':_0x4e8f24[_0xde4f('0x99')]};if(_0x4e8f24[_0xde4f('0xaa')]){_0x5a4aae[_0xde4f('0xaa')]=_0x4e8f24['headers'];if(_0x5a4aae[_0xde4f('0xaa')][_0xde4f('0xb0')]){delete _0x5a4aae[_0xde4f('0xaa')][_0xde4f('0xb0')];}}if(_0x5a4aae[_0xde4f('0xaa')][_0xde4f('0xab')]){delete _0x5a4aae['headers'][_0xde4f('0xab')];}return rp(_0x5a4aae);})['then'](function(_0x5ebc1d){if(_0x5ebc1d){_0x4ce8eb[_0xde4f('0x25')](_0x5ebc1d[_0xde4f('0xaa')]);logger[_0xde4f('0x6b')](_0x5ebc1d[_0xde4f('0x99')]);return _0x4ce8eb[_0xde4f('0x1f')](_0x5ebc1d[_0xde4f('0xac')])[_0xde4f('0x33')](_0x5ebc1d['body']);}else{return _0x4ce8eb[_0xde4f('0x1e')](0xc8);}})[_0xde4f('0x4c')](handleError(_0x4ce8eb,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index f908a32..292249d 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 _0xd824=['save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x3d754d,_0x71aad){var _0x59f912=function(_0x4a2630){while(--_0x4a2630){_0x3d754d['push'](_0x3d754d['shift']());}};_0x59f912(++_0x71aad);}(_0xd824,0xc2));var _0x4d82=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd824[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0x4d82('0x0'));var Plugin=require(_0x4d82('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4d82('0x2'),'afterUpdate':_0x4d82('0x3'),'afterDestroy':_0x4d82('0x4')};function emitEvent(_0x2a976e){return function(_0x287fbf,_0x1c8ad9,_0x4bc746){PluginEvents['emit'](_0x2a976e+':'+_0x287fbf['id'],_0x287fbf);PluginEvents[_0x4d82('0x5')](_0x2a976e,_0x287fbf);_0x4bc746(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x4d82('0x6')]=PluginEvents; \ No newline at end of file +var _0x056b=['hook','exports','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x26880f,_0x130975){var _0x8c72e6=function(_0x2cbb04){while(--_0x2cbb04){_0x26880f['push'](_0x26880f['shift']());}};_0x8c72e6(++_0x130975);}(_0x056b,0xb6));var _0xb056=function(_0x5a27e8,_0x492a2f){_0x5a27e8=_0x5a27e8-0x0;var _0x4e38f7=_0x056b[_0x5a27e8];return _0x4e38f7;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xb056('0x0'))['db'][_0xb056('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xb056('0x2')](0x0);var events={'afterCreate':_0xb056('0x3'),'afterUpdate':_0xb056('0x4'),'afterDestroy':_0xb056('0x5')};function emitEvent(_0x36c992){return function(_0x4157e0,_0x343d88,_0x2ff09d){PluginEvents[_0xb056('0x6')](_0x36c992+':'+_0x4157e0['id'],_0x4157e0);PluginEvents['emit'](_0x36c992,_0x4157e0);_0x2ff09d(null);};}for(var e in events){if(events[_0xb056('0x7')](e)){var event=events[e];Plugin[_0xb056('0x8')](e,emitEvent(event));}}module[_0xb056('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index a2fabe5..18ef7b2 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 _0x4b84=['moment','path','rimraf','../../config/environment','Plugin','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b84,0x1cc));var _0x44b8=function(_0x93942f,_0xb48547){_0x93942f=_0x93942f-0x0;var _0x23fcd8=_0x4b84[_0x93942f];return _0x23fcd8;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44b8('0x3'));var rimraf=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var attributes=require('./plugin.attributes');module['exports']=function(_0x55f25d,_0x996a8b){return _0x55f25d['define'](_0x44b8('0x6'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7dfd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins'];(function(_0x477326,_0x49cb6f){var _0x2b5bf2=function(_0x208836){while(--_0x208836){_0x477326['push'](_0x477326['shift']());}};_0x2b5bf2(++_0x49cb6f);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var logger=require(_0xd7df('0x2'))(_0xd7df('0x3'));var moment=require(_0xd7df('0x4'));var BPromise=require(_0xd7df('0x5'));var rp=require(_0xd7df('0x6'));var fs=require('fs');var path=require(_0xd7df('0x7'));var rimraf=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var attributes=require(_0xd7df('0xa'));module[_0xd7df('0xb')]=function(_0x36cf0f,_0x39ce98){return _0x36cf0f[_0xd7df('0xc')](_0xd7df('0xd'),attributes,{'tableName':_0xd7df('0xe'),'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 7858496..768a438 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 _0x28c3=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Plugin','create','body','options','raw','CreatePlugin','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x528133,_0x2d67fc){var _0x4493b3=function(_0x488fd3){while(--_0x488fd3){_0x528133['push'](_0x528133['shift']());}};_0x4493b3(++_0x2d67fc);}(_0x28c3,0x171));var _0x328c=function(_0x44f976,_0x279d6d){_0x44f976=_0x44f976-0x0;var _0x43c86f=_0x28c3[_0x44f976];return _0x43c86f;};'use strict';var _=require(_0x328c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x328c('0x1'));var rs=require(_0x328c('0x2'));var fs=require('fs');var Redis=require(_0x328c('0x3'));var db=require(_0x328c('0x4'))['db'];var utils=require(_0x328c('0x5'));var logger=require(_0x328c('0x6'))(_0x328c('0x7'));var config=require(_0x328c('0x8'));var jayson=require(_0x328c('0x9'));var client=jayson[_0x328c('0xa')][_0x328c('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x328c('0xc')],{'host':_0x328c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x328c('0xc')]));require(_0x328c('0xe'))[_0x328c('0xf')](socket);function respondWithRpcPromise(_0x2c73e4,_0x1492c0,_0x351c55){return new BPromise(function(_0x508a9f,_0x59a1df){return client['request'](_0x2c73e4,_0x351c55)[_0x328c('0x10')](function(_0x10b85f){logger[_0x328c('0x11')](_0x328c('0x12'),_0x1492c0,_0x328c('0x13'));logger['debug'](_0x328c('0x14'),_0x1492c0,_0x328c('0x13'),JSON[_0x328c('0x15')](_0x10b85f));if(_0x10b85f['error']){if(_0x10b85f[_0x328c('0x16')][_0x328c('0x17')]===0x1f4){logger[_0x328c('0x16')](_0x328c('0x12'),_0x1492c0,_0x10b85f[_0x328c('0x16')]['message']);return _0x59a1df(_0x10b85f[_0x328c('0x16')][_0x328c('0x18')]);}logger[_0x328c('0x16')](_0x328c('0x12'),_0x1492c0,_0x10b85f['error']['message']);return _0x508a9f(_0x10b85f[_0x328c('0x16')]['message']);}else{logger['info'](_0x328c('0x12'),_0x1492c0,_0x328c('0x13'));_0x508a9f(_0x10b85f[_0x328c('0x19')][_0x328c('0x18')]);}})[_0x328c('0x1a')](function(_0x599305){logger[_0x328c('0x16')](_0x328c('0x12'),_0x1492c0,_0x599305);_0x59a1df(_0x599305);});});}exports['CreatePlugin']=function(_0x45fd90){var _0x7e18e2=this;return new Promise(function(_0x28b0b9,_0xb10217){return db[_0x328c('0x1b')][_0x328c('0x1c')](_0x45fd90[_0x328c('0x1d')],{'raw':_0x45fd90[_0x328c('0x1e')]?_0x45fd90[_0x328c('0x1e')][_0x328c('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x561b34){logger[_0x328c('0x11')](_0x328c('0x20'),_0x45fd90);logger[_0x328c('0x21')](_0x328c('0x20'),_0x45fd90,JSON[_0x328c('0x15')](_0x561b34));_0x28b0b9(_0x561b34);})[_0x328c('0x1a')](function(_0x19d3c5){logger[_0x328c('0x16')](_0x328c('0x20'),_0x19d3c5[_0x328c('0x18')],_0x45fd90);_0xb10217(_0x7e18e2[_0x328c('0x16')](0x1f4,_0x19d3c5[_0x328c('0x18')]));});});}; \ No newline at end of file +var _0x90de=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreatePlugin','Plugin','body','options','raw','lodash','moment'];(function(_0x2e914,_0x1c7566){var _0x936e45=function(_0x1b22e4){while(--_0x1b22e4){_0x2e914['push'](_0x2e914['shift']());}};_0x936e45(++_0x1c7566);}(_0x90de,0x1ed));var _0xe90d=function(_0x1f88d4,_0x3f2a9c){_0x1f88d4=_0x1f88d4-0x0;var _0x31970d=_0x90de[_0x1f88d4];return _0x31970d;};'use strict';var _=require(_0xe90d('0x0'));var util=require('util');var moment=require(_0xe90d('0x1'));var BPromise=require(_0xe90d('0x2'));var rs=require(_0xe90d('0x3'));var fs=require('fs');var Redis=require(_0xe90d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe90d('0x5'))(_0xe90d('0x6'));var config=require(_0xe90d('0x7'));var jayson=require(_0xe90d('0x8'));var client=jayson['client'][_0xe90d('0x9')]({'port':0x232a});config[_0xe90d('0xa')]=_[_0xe90d('0xb')](config[_0xe90d('0xa')],{'host':_0xe90d('0xc'),'port':0x18eb});var socket=require(_0xe90d('0xd'))(new Redis(config['redis']));require(_0xe90d('0xe'))[_0xe90d('0xf')](socket);function respondWithRpcPromise(_0x15bd13,_0x55c25d,_0x5c9490){return new BPromise(function(_0x3c4aa3,_0x3f3c40){return client[_0xe90d('0x10')](_0x15bd13,_0x5c9490)[_0xe90d('0x11')](function(_0x5a313a){logger[_0xe90d('0x12')](_0xe90d('0x13'),_0x55c25d,'request\x20sent');logger[_0xe90d('0x14')](_0xe90d('0x15'),_0x55c25d,'request\x20sent',JSON[_0xe90d('0x16')](_0x5a313a));if(_0x5a313a[_0xe90d('0x17')]){if(_0x5a313a[_0xe90d('0x17')]['code']===0x1f4){logger[_0xe90d('0x17')](_0xe90d('0x13'),_0x55c25d,_0x5a313a['error']['message']);return _0x3f3c40(_0x5a313a[_0xe90d('0x17')][_0xe90d('0x18')]);}logger[_0xe90d('0x17')](_0xe90d('0x13'),_0x55c25d,_0x5a313a[_0xe90d('0x17')]['message']);return _0x3c4aa3(_0x5a313a['error']['message']);}else{logger[_0xe90d('0x12')](_0xe90d('0x13'),_0x55c25d,_0xe90d('0x19'));_0x3c4aa3(_0x5a313a[_0xe90d('0x1a')][_0xe90d('0x18')]);}})[_0xe90d('0x1b')](function(_0x33d000){logger[_0xe90d('0x17')]('Plugin,\x20%s,\x20%s',_0x55c25d,_0x33d000);_0x3f3c40(_0x33d000);});});}exports[_0xe90d('0x1c')]=function(_0x3cade8){var _0x41c9fc=this;return new Promise(function(_0x1612c3,_0x5083cb){return db[_0xe90d('0x1d')]['create'](_0x3cade8[_0xe90d('0x1e')],{'raw':_0x3cade8['options']?_0x3cade8[_0xe90d('0x1f')][_0xe90d('0x20')]===undefined?!![]:![]:!![]})[_0xe90d('0x11')](function(_0x5005bf){logger['info'](_0xe90d('0x1c'),_0x3cade8);logger[_0xe90d('0x14')](_0xe90d('0x1c'),_0x3cade8,JSON[_0xe90d('0x16')](_0x5005bf));_0x1612c3(_0x5005bf);})[_0xe90d('0x1b')](function(_0x438868){logger[_0xe90d('0x17')](_0xe90d('0x1c'),_0x438868[_0xe90d('0x18')],_0x3cade8);_0x5083cb(_0x41c9fc[_0xe90d('0x17')](0x1f4,_0x438868[_0xe90d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 3e5f111..9d3a295 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 _0x1d23=['update','emit','register','plugin:','save','remove'];(function(_0x48e329,_0xb44c68){var _0x54fef0=function(_0x432218){while(--_0x432218){_0x48e329['push'](_0x48e329['shift']());}};_0x54fef0(++_0xb44c68);}(_0x1d23,0x14e));var _0x31d2=function(_0x129968,_0x2111e1){_0x129968=_0x129968-0x0;var _0x41e22d=_0x1d23[_0x129968];return _0x41e22d;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x31d2('0x0'),_0x31d2('0x1'),_0x31d2('0x2')];function createListener(_0x3c2382,_0x1bddf0){return function(_0x2c0790){_0x1bddf0[_0x31d2('0x3')](_0x3c2382,_0x2c0790);};}function removeListener(_0x256078,_0x86a862){return function(){PluginEvents['removeListener'](_0x256078,_0x86a862);};}exports[_0x31d2('0x4')]=function(_0x3e858f){for(var _0x4c3d25=0x0,_0x3818ff=events['length'];_0x4c3d25<_0x3818ff;_0x4c3d25++){var _0x1f3dd8=events[_0x4c3d25];var _0x171ec7=createListener(_0x31d2('0x5')+_0x1f3dd8,_0x3e858f);PluginEvents['on'](_0x1f3dd8,_0x171ec7);}}; \ No newline at end of file +var _0xdaa8=['removeListener','register','length','plugin:','./plugin.events','save','remove','update'];(function(_0x458e0b,_0x1944a8){var _0x45edad=function(_0x14f21b){while(--_0x14f21b){_0x458e0b['push'](_0x458e0b['shift']());}};_0x45edad(++_0x1944a8);}(_0xdaa8,0xe4));var _0x8daa=function(_0x1668b4,_0x4055ec){_0x1668b4=_0x1668b4-0x0;var _0x3e2277=_0xdaa8[_0x1668b4];return _0x3e2277;};'use strict';var PluginEvents=require(_0x8daa('0x0'));var events=[_0x8daa('0x1'),_0x8daa('0x2'),_0x8daa('0x3')];function createListener(_0x5a8862,_0x4ce1a9){return function(_0x58f7c0){_0x4ce1a9['emit'](_0x5a8862,_0x58f7c0);};}function removeListener(_0x4d1f23,_0x576670){return function(){PluginEvents[_0x8daa('0x4')](_0x4d1f23,_0x576670);};}exports[_0x8daa('0x5')]=function(_0x46f753){for(var _0x4d2392=0x0,_0x4e8116=events[_0x8daa('0x6')];_0x4d2392<_0x4e8116;_0x4d2392++){var _0x48bf41=events[_0x4d2392];var _0x41de3e=createListener(_0x8daa('0x7')+_0x48bf41,_0x46f753);PluginEvents['on'](_0x48bf41,_0x41de3e);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index d2cc1c1..83afcfe 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 _0x7673=['/:id','show','post','put','update','delete','destroy','exports','Router','./pm2.controller','get','isAuthenticated'];(function(_0x248d46,_0xba08ec){var _0x354942=function(_0x1b52a1){while(--_0x1b52a1){_0x248d46['push'](_0x248d46['shift']());}};_0x354942(++_0xba08ec);}(_0x7673,0xf8));var _0x3767=function(_0x59f860,_0x24716c){_0x59f860=_0x59f860-0x0;var _0x2d558a=_0x7673[_0x59f860];return _0x2d558a;};'use strict';var express=require('express');var router=express[_0x3767('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x3767('0x1'));router[_0x3767('0x2')]('/',auth[_0x3767('0x3')](),controller['index']);router[_0x3767('0x2')](_0x3767('0x4'),auth[_0x3767('0x3')](),controller[_0x3767('0x5')]);router[_0x3767('0x6')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3767('0x7')](_0x3767('0x4'),auth[_0x3767('0x3')](),controller[_0x3767('0x8')]);router[_0x3767('0x9')](_0x3767('0x4'),auth[_0x3767('0x3')](),controller[_0x3767('0xa')]);module[_0x3767('0xb')]=router; \ No newline at end of file +var _0x3ac3=['destroy','exports','express','Router','./pm2.controller','get','isAuthenticated','/:id','show','post','create','put','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ac3,0x1d6));var _0x33ac=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x3ac3[_0x4e6ae6];return _0x23c108;};'use strict';var express=require(_0x33ac('0x0'));var router=express[_0x33ac('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x33ac('0x2'));router[_0x33ac('0x3')]('/',auth[_0x33ac('0x4')](),controller['index']);router[_0x33ac('0x3')](_0x33ac('0x5'),auth[_0x33ac('0x4')](),controller[_0x33ac('0x6')]);router[_0x33ac('0x7')]('/',auth[_0x33ac('0x4')](),controller[_0x33ac('0x8')]);router[_0x33ac('0x9')](_0x33ac('0x5'),auth[_0x33ac('0x4')](),controller['update']);router[_0x33ac('0xa')]('/:id',auth[_0x33ac('0x4')](),controller[_0x33ac('0xb')]);module[_0x33ac('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 f1a53b1..7232654 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 _0xcb9e=['bluebird','status','error','stack','name','send','npm\x20install','info','index','reject','express','length','then','catch','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','update','restart','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','path'];(function(_0x29f2b2,_0xcd1b6b){var _0x27ac9a=function(_0x48127a){while(--_0x48127a){_0x29f2b2['push'](_0x29f2b2['shift']());}};_0x27ac9a(++_0xcd1b6b);}(_0xcb9e,0x149));var _0xecb9=function(_0x2bf13c,_0x21ec31){_0x2bf13c=_0x2bf13c-0x0;var _0x214053=_0xcb9e[_0x2bf13c];return _0x214053;};'use strict';var _=require(_0xecb9('0x0'));var pm2=require(_0xecb9('0x1'));var logger=require(_0xecb9('0x2'))('api');var path=require(_0xecb9('0x3'));var exec=require('child_process')['exec'];var BPromise=require(_0xecb9('0x4'));function handleEntityNotFound(_0x2e51be,_0x46082a){return function(_0x53de02){if(!_0x53de02){_0x2e51be['sendStatus'](0x194);;}return _0x53de02;};}function respondWithResult(_0x29bcd6,_0x554f03){_0x554f03=_0x554f03||0xc8;return function(_0x1de102){if(_0x1de102){return _0x29bcd6[_0xecb9('0x5')](_0x554f03)['json'](_0x1de102);}return null;};}function handleError(_0x1c1440,_0x24fa53){_0x24fa53=_0x24fa53||0x1f4;return function(_0xad90ae){logger[_0xecb9('0x6')](_0xad90ae[_0xecb9('0x7')]);if(_0xad90ae[_0xecb9('0x8')]){delete _0xad90ae[_0xecb9('0x8')];}_0x1c1440[_0xecb9('0x5')](_0x24fa53)[_0xecb9('0x9')](_0xad90ae);};}function execChildProcess(){return new BPromise(function(_0x11c357,_0x2a321f){exec(_0xecb9('0xa'),function(_0xcdaab4,_0x2e3fb3,_0x3e66b7){logger[_0xecb9('0xb')](_0x2e3fb3);logger['info'](_0x3e66b7);if(_0xcdaab4){logger[_0xecb9('0x6')](_0xcdaab4);return _0x2a321f(_0xcdaab4);}return _0x11c357(_0x2e3fb3);});});}exports[_0xecb9('0xc')]=function(_0x2650f1,_0x2c8ae1){return pm2['list']()['then'](function(_0x49e765){if(_0x49e765){var _0x2059e4=_[_0xecb9('0xd')](_0x49e765,function(_0xa1b5b3){return _0xa1b5b3[_0xecb9('0x8')]===_0xecb9('0xe')||_0xa1b5b3[_0xecb9('0x8')]==='motion2';});return{'rows':_0x2059e4,'count':_0x2059e4[_0xecb9('0xf')]};}return null;})[_0xecb9('0x10')](respondWithResult(_0x2c8ae1,null))[_0xecb9('0x11')](handleError(_0x2c8ae1,null));};exports['show']=function(_0x4c3b87,_0x246323){return pm2[_0xecb9('0x12')](_0x4c3b87[_0xecb9('0x13')]['id'])['then'](respondWithResult(_0x246323,null))['then'](handleEntityNotFound(_0x246323,null))['catch'](handleError(_0x246323,null));};exports[_0xecb9('0x14')]=function(_0x25fa1c,_0x2e4184){if(_0x25fa1c[_0xecb9('0x15')][_0xecb9('0x8')]&&_0x25fa1c[_0xecb9('0x15')][_0xecb9('0x16')]){var _0x279c7f=path[_0xecb9('0x17')](__dirname,_0xecb9('0x18'),_0x25fa1c[_0xecb9('0x15')][_0xecb9('0x16')]);var _0x136f81=process[_0xecb9('0x19')]();process[_0xecb9('0x1a')](path[_0xecb9('0x1b')](_0x279c7f));return execChildProcess()[_0xecb9('0x10')](function(_0x3c75ee){process[_0xecb9('0x1a')](_0x136f81);return pm2[_0xecb9('0x1c')]({'name':_0x25fa1c[_0xecb9('0x15')][_0xecb9('0x8')],'script':_0x279c7f});})[_0xecb9('0x10')](function(_0xa9ba04){pm2[_0xecb9('0x1d')]();return _0xa9ba04[0x0];})[_0xecb9('0x10')](respondWithResult(_0x2e4184,0xc9))[_0xecb9('0x11')](handleError(_0x2e4184,null));}else{return _0x2e4184[_0xecb9('0x5')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xecb9('0x1e')]=function(_0x938ae4,_0x4585d4){if(_0x938ae4[_0xecb9('0x15')]['id']){delete _0x938ae4['body']['id'];}var _0x28dd66={'online':_0xecb9('0x1f'),'stopped':'stop'};if(_0x28dd66[_0xecb9('0x20')](_0x938ae4[_0xecb9('0x15')][_0xecb9('0x5')])){return pm2[_0x28dd66[_0x938ae4[_0xecb9('0x15')][_0xecb9('0x5')]]](_0x938ae4[_0xecb9('0x13')]['id'])['then'](respondWithResult(_0x4585d4,0xc8))[_0xecb9('0x11')](handleError(_0x4585d4,null));}else{return _0x4585d4[_0xecb9('0x5')](0x1f4)[_0xecb9('0x9')]({'message':_0xecb9('0x21')});}};exports[_0xecb9('0x22')]=function(_0x2cd901,_0x50e23d){if(_0x2cd901['body']['id']){delete _0x2cd901[_0xecb9('0x15')]['id'];}if(_0x2cd901[_0xecb9('0x13')]['id']){return pm2[_0xecb9('0x23')](_0x2cd901[_0xecb9('0x13')]['id'])[_0xecb9('0x10')](function(_0x5172a2){pm2[_0xecb9('0x1d')]();return _0x5172a2[0x0];})[_0xecb9('0x10')](respondWithResult(_0x50e23d,null))['catch'](handleError(_0x50e23d,null));}else{return _0x50e23d[_0xecb9('0x5')](0x1f4)[_0xecb9('0x9')]({'message':_0xecb9('0x24')});}}; \ No newline at end of file +var _0xd431=['sendStatus','status','error','stack','name','send','npm\x20install','index','list','reject','motion2','then','catch','show','params','create','body','script','join','../../files/plugins','cwd','dirname','start','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','destroy','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','path','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd431,0xf0));var _0x1d43=function(_0x59bd2d,_0x307929){_0x59bd2d=_0x59bd2d-0x0;var _0x572487=_0xd431[_0x59bd2d];return _0x572487;};'use strict';var _=require('lodash');var pm2=require(_0x1d43('0x0'));var logger=require(_0x1d43('0x1'))(_0x1d43('0x2'));var path=require(_0x1d43('0x3'));var exec=require('child_process')['exec'];var BPromise=require(_0x1d43('0x4'));function handleEntityNotFound(_0x4e29c7,_0x19d8cb){return function(_0x1e77a0){if(!_0x1e77a0){_0x4e29c7[_0x1d43('0x5')](0x194);;}return _0x1e77a0;};}function respondWithResult(_0x2316bc,_0x507311){_0x507311=_0x507311||0xc8;return function(_0x21f666){if(_0x21f666){return _0x2316bc[_0x1d43('0x6')](_0x507311)['json'](_0x21f666);}return null;};}function handleError(_0x3e8cde,_0x122578){_0x122578=_0x122578||0x1f4;return function(_0x3b8cce){logger[_0x1d43('0x7')](_0x3b8cce[_0x1d43('0x8')]);if(_0x3b8cce[_0x1d43('0x9')]){delete _0x3b8cce[_0x1d43('0x9')];}_0x3e8cde[_0x1d43('0x6')](_0x122578)[_0x1d43('0xa')](_0x3b8cce);};}function execChildProcess(){return new BPromise(function(_0x371649,_0x3b5079){exec(_0x1d43('0xb'),function(_0xca17ad,_0x3e1479,_0x2a7ffe){logger['info'](_0x3e1479);logger['info'](_0x2a7ffe);if(_0xca17ad){logger[_0x1d43('0x7')](_0xca17ad);return _0x3b5079(_0xca17ad);}return _0x371649(_0x3e1479);});});}exports[_0x1d43('0xc')]=function(_0x21d29c,_0x336b8a){return pm2[_0x1d43('0xd')]()['then'](function(_0x2f41fd){if(_0x2f41fd){var _0x7c48c0=_[_0x1d43('0xe')](_0x2f41fd,function(_0x23eb97){return _0x23eb97[_0x1d43('0x9')]==='express'||_0x23eb97[_0x1d43('0x9')]===_0x1d43('0xf');});return{'rows':_0x7c48c0,'count':_0x7c48c0['length']};}return null;})[_0x1d43('0x10')](respondWithResult(_0x336b8a,null))[_0x1d43('0x11')](handleError(_0x336b8a,null));};exports[_0x1d43('0x12')]=function(_0x568e71,_0x455bb6){return pm2['describe'](_0x568e71[_0x1d43('0x13')]['id'])[_0x1d43('0x10')](respondWithResult(_0x455bb6,null))[_0x1d43('0x10')](handleEntityNotFound(_0x455bb6,null))[_0x1d43('0x11')](handleError(_0x455bb6,null));};exports[_0x1d43('0x14')]=function(_0x255531,_0x236458){if(_0x255531['body']['name']&&_0x255531[_0x1d43('0x15')][_0x1d43('0x16')]){var _0x5ae5f0=path[_0x1d43('0x17')](__dirname,_0x1d43('0x18'),_0x255531[_0x1d43('0x15')][_0x1d43('0x16')]);var _0x373f3=process[_0x1d43('0x19')]();process['chdir'](path[_0x1d43('0x1a')](_0x5ae5f0));return execChildProcess()[_0x1d43('0x10')](function(_0x4e03b0){process['chdir'](_0x373f3);return pm2[_0x1d43('0x1b')]({'name':_0x255531[_0x1d43('0x15')][_0x1d43('0x9')],'script':_0x5ae5f0});})[_0x1d43('0x10')](function(_0x457964){pm2['dump']();return _0x457964[0x0];})[_0x1d43('0x10')](respondWithResult(_0x236458,0xc9))['catch'](handleError(_0x236458,null));}else{return _0x236458['status'](0x1f4)[_0x1d43('0xa')]({'message':_0x1d43('0x1c')});}};exports['update']=function(_0x5a6ad9,_0x505ec6){if(_0x5a6ad9['body']['id']){delete _0x5a6ad9[_0x1d43('0x15')]['id'];}var _0x57d4d4={'online':_0x1d43('0x1d'),'stopped':_0x1d43('0x1e')};if(_0x57d4d4[_0x1d43('0x1f')](_0x5a6ad9[_0x1d43('0x15')][_0x1d43('0x6')])){return pm2[_0x57d4d4[_0x5a6ad9[_0x1d43('0x15')][_0x1d43('0x6')]]](_0x5a6ad9['params']['id'])['then'](respondWithResult(_0x505ec6,0xc8))[_0x1d43('0x11')](handleError(_0x505ec6,null));}else{return _0x505ec6[_0x1d43('0x6')](0x1f4)[_0x1d43('0xa')]({'message':'Unknown\x20status'});}};exports[_0x1d43('0x20')]=function(_0x29ee88,_0x251664){if(_0x29ee88['body']['id']){delete _0x29ee88[_0x1d43('0x15')]['id'];}if(_0x29ee88[_0x1d43('0x13')]['id']){return pm2[_0x1d43('0x21')](_0x29ee88[_0x1d43('0x13')]['id'])[_0x1d43('0x10')](function(_0x5cc622){pm2['dump']();return _0x5cc622[0x0];})[_0x1d43('0x10')](respondWithResult(_0x251664,null))[_0x1d43('0x11')](handleError(_0x251664,null));}else{return _0x251664['status'](0x1f4)[_0x1d43('0xa')]({'message':_0x1d43('0x22')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 380db9b..6943cb2 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 _0xa110=['exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xa38085,_0x1d3889){var _0x2850a2=function(_0x51110d){while(--_0x51110d){_0xa38085['push'](_0xa38085['shift']());}};_0x2850a2(++_0x1d3889);}(_0xa110,0x19e));var _0x0a11=function(_0x2e3ccb,_0x79814f){_0x2e3ccb=_0x2e3ccb-0x0;var _0x2efe9d=_0xa110[_0x2e3ccb];return _0x2efe9d;};'use strict';var multer=require(_0x0a11('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0a11('0x1'));var express=require('express');var router=express[_0x0a11('0x2')]();var auth=require(_0x0a11('0x3'));var interaction=require(_0x0a11('0x4'));var config=require(_0x0a11('0x5'));module[_0x0a11('0x6')]=router; \ No newline at end of file +var _0xf841=['../../components/auth/service','../../components/interaction/service','exports','util','path','connect-timeout','express','Router'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf841,0x7b));var _0x1f84=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0xf841[_0xbc2974];return _0x3a5b4f;};'use strict';var multer=require('multer');var util=require(_0x1f84('0x0'));var path=require(_0x1f84('0x1'));var timeout=require(_0x1f84('0x2'));var express=require(_0x1f84('0x3'));var router=express[_0x1f84('0x4')]();var auth=require(_0x1f84('0x5'));var interaction=require(_0x1f84('0x6'));var config=require('../../config/environment');module[_0x1f84('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index e778ba3..7f7cb10 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 _0x83fa=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x1e2b1f,_0x225881){var _0x4bb65b=function(_0x34d7aa){while(--_0x34d7aa){_0x1e2b1f['push'](_0x1e2b1f['shift']());}};_0x4bb65b(++_0x225881);}(_0x83fa,0xe2));var _0xa83f=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x83fa[_0x125ff8];return _0x2d9ef;};'use strict';var Sequelize=require(_0xa83f('0x0'));module[_0xa83f('0x1')]={'state':{'type':Sequelize[_0xa83f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xa83f('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xa83f('0x3')]},'starttime':{'type':Sequelize[_0xa83f('0x4')]},'responsetime':{'type':Sequelize[_0xa83f('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xa83f('0x3')]},'campaigntype':{'type':Sequelize[_0xa83f('0x3')]},'membername':{'type':Sequelize[_0xa83f('0x3')]}}; \ No newline at end of file +var _0x0c79=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x7da135,_0x55d600){var _0x354d62=function(_0x540273){while(--_0x540273){_0x7da135['push'](_0x7da135['shift']());}};_0x354d62(++_0x55d600);}(_0x0c79,0x13a));var _0x90c7=function(_0x341185,_0x5ba95e){_0x341185=_0x341185-0x0;var _0x462a25=_0x0c79[_0x341185];return _0x462a25;};'use strict';var Sequelize=require(_0x90c7('0x0'));module[_0x90c7('0x1')]={'state':{'type':Sequelize[_0x90c7('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x90c7('0x3')]},'scheduledat':{'type':Sequelize[_0x90c7('0x4')]},'uniqueid':{'type':Sequelize[_0x90c7('0x3')]},'starttime':{'type':Sequelize[_0x90c7('0x4')]},'responsetime':{'type':Sequelize[_0x90c7('0x4')]},'ringtime':{'type':Sequelize[_0x90c7('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x90c7('0x3')]},'campaigntype':{'type':Sequelize[_0x90c7('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 089109c..695def8 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 _0xb565=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','ReportAgentPreview','report_agent_preview'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xb565,0x13f));var _0x5b56=function(_0x1ccc19,_0x2a5e47){_0x1ccc19=_0x1ccc19-0x0;var _0x393065=_0xb565[_0x1ccc19];return _0x393065;};'use strict';var _=require(_0x5b56('0x0'));var util=require(_0x5b56('0x1'));var logger=require(_0x5b56('0x2'))(_0x5b56('0x3'));var moment=require(_0x5b56('0x4'));var BPromise=require('bluebird');var rp=require(_0x5b56('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5b56('0x6'));var config=require(_0x5b56('0x7'));var attributes=require(_0x5b56('0x8'));module['exports']=function(_0x3c91de,_0x3e674f){return _0x3c91de['define'](_0x5b56('0x9'),attributes,{'tableName':_0x5b56('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18e5=['api','moment','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','../../config/logger'];(function(_0x2f0d6d,_0x593ab9){var _0x380db3=function(_0x12d0f7){while(--_0x12d0f7){_0x2f0d6d['push'](_0x2f0d6d['shift']());}};_0x380db3(++_0x593ab9);}(_0x18e5,0x169));var _0x518e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x18e5[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x518e('0x0'));var util=require('util');var logger=require(_0x518e('0x1'))(_0x518e('0x2'));var moment=require(_0x518e('0x3'));var BPromise=require('bluebird');var rp=require(_0x518e('0x4'));var fs=require('fs');var path=require(_0x518e('0x5'));var rimraf=require('rimraf');var config=require(_0x518e('0x6'));var attributes=require(_0x518e('0x7'));module[_0x518e('0x8')]=function(_0x53f875,_0x21205c){return _0x53f875['define'](_0x518e('0x9'),attributes,{'tableName':_0x518e('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 89a1d9d..b5e632e 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 _0x9bdb=['error','code','message','result','catch','create','body','options','raw','then','debug','CreateReportAgentPreview','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x554848,_0x290562){var _0x3d8882=function(_0x5e8525){while(--_0x5e8525){_0x554848['push'](_0x554848['shift']());}};_0x3d8882(++_0x290562);}(_0x9bdb,0xc9));var _0xb9bd=function(_0x4edebc,_0x20a5c6){_0x4edebc=_0x4edebc-0x0;var _0x442070=_0x9bdb[_0x4edebc];return _0x442070;};'use strict';var _=require(_0xb9bd('0x0'));var util=require(_0xb9bd('0x1'));var moment=require('moment');var BPromise=require(_0xb9bd('0x2'));var rs=require(_0xb9bd('0x3'));var fs=require('fs');var Redis=require(_0xb9bd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9bd('0x5'));var logger=require(_0xb9bd('0x6'))('rpc');var config=require(_0xb9bd('0x7'));var jayson=require(_0xb9bd('0x8'));var client=jayson[_0xb9bd('0x9')][_0xb9bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e6d59,_0x397255,_0x17a78f){return new BPromise(function(_0x7bea6c,_0x4c33f3){return client['request'](_0x3e6d59,_0x17a78f)['then'](function(_0x4037b7){logger[_0xb9bd('0xb')](_0xb9bd('0xc'),_0x397255,_0xb9bd('0xd'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x397255,_0xb9bd('0xd'),JSON[_0xb9bd('0xe')](_0x4037b7));if(_0x4037b7[_0xb9bd('0xf')]){if(_0x4037b7[_0xb9bd('0xf')][_0xb9bd('0x10')]===0x1f4){logger[_0xb9bd('0xf')](_0xb9bd('0xc'),_0x397255,_0x4037b7[_0xb9bd('0xf')][_0xb9bd('0x11')]);return _0x4c33f3(_0x4037b7[_0xb9bd('0xf')][_0xb9bd('0x11')]);}logger[_0xb9bd('0xf')](_0xb9bd('0xc'),_0x397255,_0x4037b7[_0xb9bd('0xf')]['message']);return _0x7bea6c(_0x4037b7['error'][_0xb9bd('0x11')]);}else{logger['info'](_0xb9bd('0xc'),_0x397255,_0xb9bd('0xd'));_0x7bea6c(_0x4037b7[_0xb9bd('0x12')][_0xb9bd('0x11')]);}})[_0xb9bd('0x13')](function(_0x2039cd){logger[_0xb9bd('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x397255,_0x2039cd);_0x4c33f3(_0x2039cd);});});}exports['CreateReportAgentPreview']=function(_0xfff069){var _0xbd4d8c=this;return new Promise(function(_0x3387ce,_0xa1e23e){return db['ReportAgentPreview'][_0xb9bd('0x14')](_0xfff069[_0xb9bd('0x15')],{'raw':_0xfff069[_0xb9bd('0x16')]?_0xfff069[_0xb9bd('0x16')][_0xb9bd('0x17')]===undefined?!![]:![]:!![]})[_0xb9bd('0x18')](function(_0x456ecb){logger[_0xb9bd('0xb')]('CreateReportAgentPreview',_0xfff069);logger[_0xb9bd('0x19')](_0xb9bd('0x1a'),_0xfff069,JSON[_0xb9bd('0xe')](_0x456ecb));_0x3387ce(_0x456ecb);})[_0xb9bd('0x13')](function(_0x4dc37e){logger[_0xb9bd('0xf')](_0xb9bd('0x1a'),_0x4dc37e[_0xb9bd('0x11')],_0xfff069);_0xa1e23e(_0xbd4d8c[_0xb9bd('0xf')](0x1f4,_0x4dc37e[_0xb9bd('0x11')]));});});}; \ No newline at end of file +var _0x0174=['body','options','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ReportAgentPreview,\x20%s,\x20%s','message','result','CreateReportAgentPreview','ReportAgentPreview','create'];(function(_0x3ec870,_0x382bbb){var _0x394aed=function(_0x53b9bd){while(--_0x53b9bd){_0x3ec870['push'](_0x3ec870['shift']());}};_0x394aed(++_0x382bbb);}(_0x0174,0x17d));var _0x4017=function(_0x369570,_0x214042){_0x369570=_0x369570-0x0;var _0x36f0c9=_0x0174[_0x369570];return _0x36f0c9;};'use strict';var _=require(_0x4017('0x0'));var util=require('util');var moment=require(_0x4017('0x1'));var BPromise=require('bluebird');var rs=require(_0x4017('0x2'));var fs=require('fs');var Redis=require(_0x4017('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4017('0x4'));var logger=require(_0x4017('0x5'))(_0x4017('0x6'));var config=require(_0x4017('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4017('0x8')][_0x4017('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52116b,_0x35c4b3,_0x508950){return new BPromise(function(_0xed1402,_0x2b081f){return client[_0x4017('0xa')](_0x52116b,_0x508950)[_0x4017('0xb')](function(_0x498679){logger[_0x4017('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x35c4b3,'request\x20sent');logger[_0x4017('0xd')](_0x4017('0xe'),_0x35c4b3,_0x4017('0xf'),JSON[_0x4017('0x10')](_0x498679));if(_0x498679[_0x4017('0x11')]){if(_0x498679[_0x4017('0x11')]['code']===0x1f4){logger[_0x4017('0x11')](_0x4017('0x12'),_0x35c4b3,_0x498679[_0x4017('0x11')]['message']);return _0x2b081f(_0x498679[_0x4017('0x11')][_0x4017('0x13')]);}logger[_0x4017('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x35c4b3,_0x498679['error'][_0x4017('0x13')]);return _0xed1402(_0x498679['error']['message']);}else{logger[_0x4017('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x35c4b3,_0x4017('0xf'));_0xed1402(_0x498679[_0x4017('0x14')][_0x4017('0x13')]);}})['catch'](function(_0xd1f92f){logger[_0x4017('0x11')](_0x4017('0x12'),_0x35c4b3,_0xd1f92f);_0x2b081f(_0xd1f92f);});});}exports[_0x4017('0x15')]=function(_0x4ed30f){var _0x4f9a7a=this;return new Promise(function(_0x47c4c5,_0x3c9adc){return db[_0x4017('0x16')][_0x4017('0x17')](_0x4ed30f[_0x4017('0x18')],{'raw':_0x4ed30f[_0x4017('0x19')]?_0x4ed30f[_0x4017('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x4017('0xb')](function(_0x252f3a){logger[_0x4017('0xc')]('CreateReportAgentPreview',_0x4ed30f);logger[_0x4017('0xd')]('CreateReportAgentPreview',_0x4ed30f,JSON[_0x4017('0x10')](_0x252f3a));_0x47c4c5(_0x252f3a);})[_0x4017('0x1a')](function(_0x39bc9f){logger['error'](_0x4017('0x15'),_0x39bc9f[_0x4017('0x13')],_0x4ed30f);_0x3c9adc(_0x4f9a7a[_0x4017('0x11')](0x1f4,_0x39bc9f[_0x4017('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index c0b8555..6fcb55e 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 _0xa817=['/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','outboundChannels','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','showSmsQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','openchannelQueues','/sms/queues','smsQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xa817,0x7b));var _0x7a81=function(_0x483931,_0x56dc16){_0x483931=_0x483931-0x0;var _0x42d4ab=_0xa817[_0x483931];return _0x42d4ab;};'use strict';var multer=require(_0x7a81('0x0'));var util=require(_0x7a81('0x1'));var path=require(_0x7a81('0x2'));var express=require(_0x7a81('0x3'));var router=express[_0x7a81('0x4')]();var auth=require(_0x7a81('0x5'));var controller=require(_0x7a81('0x6'));router[_0x7a81('0x7')](_0x7a81('0x8'),auth['isAuthenticated'](),controller[_0x7a81('0x9')]);router[_0x7a81('0x7')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x7a81('0xa')](),controller[_0x7a81('0xb')]);router[_0x7a81('0x7')](_0x7a81('0xc'),auth[_0x7a81('0xa')](),controller[_0x7a81('0xd')]);router['get'](_0x7a81('0xe'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0x7a81('0x7')]('/chat/queues',auth[_0x7a81('0xa')](),controller[_0x7a81('0xf')]);router[_0x7a81('0x7')](_0x7a81('0x10'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x11')]);router[_0x7a81('0x7')]('/mail/accounts',auth[_0x7a81('0xa')](),controller[_0x7a81('0x12')]);router[_0x7a81('0x7')]('/openchannel/queues',auth[_0x7a81('0xa')](),controller[_0x7a81('0x13')]);router[_0x7a81('0x7')](_0x7a81('0x14'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x15')]);router['get']('/fax/queues',auth[_0x7a81('0xa')](),controller[_0x7a81('0x16')]);router['get'](_0x7a81('0x17'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x18')]);router[_0x7a81('0x7')](_0x7a81('0x19'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x1a')]);router[_0x7a81('0x7')](_0x7a81('0x1b'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x1c')]);router[_0x7a81('0x7')](_0x7a81('0x1d'),auth['isAuthenticated'](),controller[_0x7a81('0x1e')]);router[_0x7a81('0x7')](_0x7a81('0x1f'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x20')]);router[_0x7a81('0x7')](_0x7a81('0x21'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x22')]);router['get'](_0x7a81('0x23'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x24')]);router[_0x7a81('0x7')](_0x7a81('0x25'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x26')]);router[_0x7a81('0x7')]('/agents',auth[_0x7a81('0xa')](),controller['agents']);router['put'](_0x7a81('0x27'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x28')]);router['get'](_0x7a81('0x29'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x2a')]);router[_0x7a81('0x7')](_0x7a81('0x2b'),auth['isAuthenticated'](),controller[_0x7a81('0x2c')]);router[_0x7a81('0x7')](_0x7a81('0x2d'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x2e')]);router[_0x7a81('0x7')](_0x7a81('0x2f'),auth['isAuthenticated'](),controller[_0x7a81('0x30')]);router['get'](_0x7a81('0x31'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x32')]);router['get'](_0x7a81('0x33'),auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0x7a81('0x7')](_0x7a81('0x34'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x35')]);router[_0x7a81('0x7')]('/sms/queues/waitinginteractions',auth[_0x7a81('0xa')](),controller[_0x7a81('0x36')]);router[_0x7a81('0x7')](_0x7a81('0x37'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x38')]);router[_0x7a81('0x39')]('/mail/queues/:id/notify',auth[_0x7a81('0xa')](),controller[_0x7a81('0x3a')](_0x7a81('0x3b')));router['get'](_0x7a81('0x3c'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x3d')]);router[_0x7a81('0x39')]('/chat/queues/:id/notify',auth[_0x7a81('0xa')](),controller[_0x7a81('0x3a')](_0x7a81('0x3e')));router[_0x7a81('0x7')](_0x7a81('0x3f'),auth['isAuthenticated'](),controller[_0x7a81('0x40')]);router[_0x7a81('0x39')](_0x7a81('0x41'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x3a')](_0x7a81('0x42')));router[_0x7a81('0x7')]('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x7a81('0x43')]);router[_0x7a81('0x39')]('/openchannel/queues/:id/notify',auth[_0x7a81('0xa')](),controller[_0x7a81('0x3a')](_0x7a81('0x44')));router['get'](_0x7a81('0x45'),auth[_0x7a81('0xa')](),controller['showOpenchannelQueues']);router[_0x7a81('0x39')](_0x7a81('0x46'),auth[_0x7a81('0xa')](),controller['queueNotify'](_0x7a81('0x47')));router[_0x7a81('0x7')]('/sms/queues/:id',auth[_0x7a81('0xa')](),controller[_0x7a81('0x48')]);router[_0x7a81('0x39')](_0x7a81('0x49'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x4a')]);module[_0x7a81('0x4b')]=router; \ No newline at end of file +var _0x1a22=['showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','exports','multer','util','express','Router','../../components/auth/service','./rpc.controller','get','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','/mail/queues','mailQueues','mailAccounts','openchannelQueues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','/trunks','/campaigns','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id'];(function(_0x23aa28,_0x316fb1){var _0x5c52ba=function(_0x699c0f){while(--_0x699c0f){_0x23aa28['push'](_0x23aa28['shift']());}};_0x5c52ba(++_0x316fb1);}(_0x1a22,0x125));var _0x21a2=function(_0x548003,_0x19cd0e){_0x548003=_0x548003-0x0;var _0x459a44=_0x1a22[_0x548003];return _0x459a44;};'use strict';var multer=require(_0x21a2('0x0'));var util=require(_0x21a2('0x1'));var path=require('path');var express=require(_0x21a2('0x2'));var router=express[_0x21a2('0x3')]();var auth=require(_0x21a2('0x4'));var controller=require(_0x21a2('0x5'));router[_0x21a2('0x6')]('/voice/channels',auth['isAuthenticated'](),controller[_0x21a2('0x7')]);router[_0x21a2('0x6')](_0x21a2('0x8'),auth[_0x21a2('0x9')](),controller[_0x21a2('0xa')]);router['get'](_0x21a2('0xb'),auth['isAuthenticated'](),controller[_0x21a2('0xc')]);router[_0x21a2('0x6')](_0x21a2('0xd'),auth[_0x21a2('0x9')](),controller['voiceQueues']);router[_0x21a2('0x6')](_0x21a2('0xe'),auth['isAuthenticated'](),controller['chatQueues']);router[_0x21a2('0x6')](_0x21a2('0xf'),auth[_0x21a2('0x9')](),controller[_0x21a2('0x10')]);router[_0x21a2('0x6')]('/mail/accounts',auth[_0x21a2('0x9')](),controller[_0x21a2('0x11')]);router[_0x21a2('0x6')]('/openchannel/queues',auth[_0x21a2('0x9')](),controller[_0x21a2('0x12')]);router['get']('/sms/queues',auth[_0x21a2('0x9')](),controller[_0x21a2('0x13')]);router[_0x21a2('0x6')](_0x21a2('0x14'),auth[_0x21a2('0x9')](),controller[_0x21a2('0x15')]);router[_0x21a2('0x6')](_0x21a2('0x16'),auth[_0x21a2('0x9')](),controller['voiceQueuesPreview']);router[_0x21a2('0x6')](_0x21a2('0x17'),auth[_0x21a2('0x9')](),controller[_0x21a2('0x18')]);router[_0x21a2('0x6')](_0x21a2('0x19'),auth[_0x21a2('0x9')](),controller['voiceQueuesChannel']);router[_0x21a2('0x6')](_0x21a2('0x1a'),auth['isAuthenticated'](),controller[_0x21a2('0x1b')]);router[_0x21a2('0x6')](_0x21a2('0x1c'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router['get'](_0x21a2('0x1d'),auth['isAuthenticated'](),controller['showVoiceQueues']);router[_0x21a2('0x6')](_0x21a2('0x1e'),auth[_0x21a2('0x9')](),controller[_0x21a2('0x1f')]);router['get'](_0x21a2('0x20'),auth[_0x21a2('0x9')](),controller[_0x21a2('0x21')]);router['get'](_0x21a2('0x22'),auth[_0x21a2('0x9')](),controller[_0x21a2('0x23')]);router[_0x21a2('0x24')](_0x21a2('0x25'),auth[_0x21a2('0x9')](),controller[_0x21a2('0x26')]);router[_0x21a2('0x6')](_0x21a2('0x27'),auth['isAuthenticated'](),controller['telephones']);router[_0x21a2('0x6')](_0x21a2('0x28'),auth['isAuthenticated'](),controller['trunks']);router[_0x21a2('0x6')](_0x21a2('0x29'),auth[_0x21a2('0x9')](),controller['campaigns']);router[_0x21a2('0x6')]('/fax/accounts',auth[_0x21a2('0x9')](),controller[_0x21a2('0x2a')]);router['get'](_0x21a2('0x2b'),auth[_0x21a2('0x9')](),controller['chatQueuesWaitingInteractions']);router['get'](_0x21a2('0x2c'),auth[_0x21a2('0x9')](),controller[_0x21a2('0x2d')]);router[_0x21a2('0x6')](_0x21a2('0x2e'),auth[_0x21a2('0x9')](),controller['openchannelQueuesWaitingInteractions']);router[_0x21a2('0x6')](_0x21a2('0x2f'),auth[_0x21a2('0x9')](),controller[_0x21a2('0x30')]);router['get'](_0x21a2('0x31'),auth[_0x21a2('0x9')](),controller['faxQueuesWaitingInteractions']);router[_0x21a2('0x32')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0x21a2('0x33')));router[_0x21a2('0x6')](_0x21a2('0x34'),auth[_0x21a2('0x9')](),controller[_0x21a2('0x35')]);router[_0x21a2('0x32')](_0x21a2('0x36'),auth[_0x21a2('0x9')](),controller[_0x21a2('0x37')](_0x21a2('0x38')));router[_0x21a2('0x6')](_0x21a2('0x39'),auth[_0x21a2('0x9')](),controller[_0x21a2('0x3a')]);router['post'](_0x21a2('0x3b'),auth['isAuthenticated'](),controller['queueNotify'](_0x21a2('0x3c')));router[_0x21a2('0x6')](_0x21a2('0x3d'),auth[_0x21a2('0x9')](),controller[_0x21a2('0x3e')]);router[_0x21a2('0x32')](_0x21a2('0x3f'),auth[_0x21a2('0x9')](),controller[_0x21a2('0x37')](_0x21a2('0x40')));router[_0x21a2('0x6')](_0x21a2('0x41'),auth[_0x21a2('0x9')](),controller['showOpenchannelQueues']);router['post']('/sms/queues/:id/notify',auth[_0x21a2('0x9')](),controller[_0x21a2('0x37')](_0x21a2('0x42')));router[_0x21a2('0x6')](_0x21a2('0x43'),auth[_0x21a2('0x9')](),controller[_0x21a2('0x44')]);router[_0x21a2('0x32')](_0x21a2('0x45'),auth[_0x21a2('0x9')](),controller['agentNotify']);module[_0x21a2('0x46')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 07fa4a7..3ba4106 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 _0x4c39=['From','TransferReport','create','queueTransferTimeout','channel','User','Agent\x20not\x20found','agentTransferTimeout','*,*,*,*','bluebird','moment','util','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','rows','find','voiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','findAll','INTERACTION','length','format','findOrCreate','isNil','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','SmsQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','Account','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId'];(function(_0x48f038,_0x2bde84){var _0x2edc62=function(_0x1e6cc8){while(--_0x1e6cc8){_0x48f038['push'](_0x48f038['shift']());}};_0x2edc62(++_0x2bde84);}(_0x4c39,0x15f));var _0x94c3=function(_0x2bc09e,_0x1ae747){_0x2bc09e=_0x2bc09e-0x0;var _0x3f7c75=_0x4c39[_0x2bc09e];return _0x3f7c75;};'use strict';var BPromise=require(_0x94c3('0x0'));var moment=require(_0x94c3('0x1'));var _=require('lodash');var util=require(_0x94c3('0x2'));var db=require(_0x94c3('0x3'))['db'];var logger=require(_0x94c3('0x4'))('api');var jayson=require(_0x94c3('0x5'));var amiClient=jayson[_0x94c3('0x6')][_0x94c3('0x7')]({'port':0x232a});var mailClient=jayson[_0x94c3('0x6')]['http']({'port':0x232b});var routingClient=jayson[_0x94c3('0x6')][_0x94c3('0x7')]({'port':0x232c});function respondWithRpcPromise(_0xea0f7,_0x5302db,_0x4cc3de){return new BPromise(function(_0x22a8b2,_0x4ea897){var _0x21deef=_0x4cc3de?_0x4cc3de:amiClient;return _0x21deef[_0x94c3('0x8')](_0xea0f7,_0x5302db)[_0x94c3('0x9')](function(_0x19c729){if(_0x19c729[_0x94c3('0xa')]){if(_0x19c729[_0x94c3('0xa')][_0x94c3('0xb')]===0x1f4){return _0x4ea897(_0x19c729[_0x94c3('0xa')][_0x94c3('0xc')]);}return _0x22a8b2(_0x19c729[_0x94c3('0xa')][_0x94c3('0xc')]);}else{_0x22a8b2(_0x19c729[_0x94c3('0xd')]);}})[_0x94c3('0xe')](function(_0x5ebd45){_0x4ea897(_0x5ebd45);});});}function respondWithResult(_0x219e93,_0x4bf12b){_0x4bf12b=_0x4bf12b||0xc8;return function(_0xd43614){if(_0xd43614){return _0x219e93[_0x94c3('0xf')](_0x4bf12b)[_0x94c3('0x10')](_0xd43614);}return _0x219e93['sendStatus'](0x194);};}function handleError(_0x557b70,_0x17b117){_0x17b117=_0x17b117||0x1f4;return function(_0x41b114){logger[_0x94c3('0xa')](_0x41b114['stack']);if(_0x41b114[_0x94c3('0x11')]){delete _0x41b114[_0x94c3('0x11')];}_0x557b70[_0x94c3('0xf')](_0x17b117)[_0x94c3('0x12')](_0x41b114);};}function findById(_0xb0a581){return function(_0x108e8d){if(!_['isNil'](_0xb0a581)&&!_['isNil'](_0x108e8d)&&!_['isNil'](_0x108e8d[_0x94c3('0x13')])){return _[_0x94c3('0x14')](_0x108e8d[_0x94c3('0x13')],function(_0x3e9642){return _0x3e9642['id']==_0xb0a581;});}return null;};}exports[_0x94c3('0x15')]=function(_0x45e516,_0x1fd0eb){return respondWithRpcPromise('VoiceChannels',_0x45e516[_0x94c3('0x16')])['then'](respondWithResult(_0x1fd0eb,null))[_0x94c3('0xe')](handleError(_0x1fd0eb,null));};exports[_0x94c3('0x17')]=function(_0x2c24d8,_0x354c5e){return respondWithRpcPromise(_0x94c3('0x18'),_[_0x94c3('0x19')](_0x2c24d8['query'],_0x2c24d8[_0x94c3('0x1a')]))[_0x94c3('0x9')](respondWithResult(_0x354c5e,null))['catch'](handleError(_0x354c5e,null));};exports['voiceChannelStopMixMonitor']=function(_0x55adc8,_0x185b34){return respondWithRpcPromise(_0x94c3('0x1b'),_[_0x94c3('0x19')](_0x55adc8[_0x94c3('0x16')],_0x55adc8[_0x94c3('0x1a')]))[_0x94c3('0x9')](respondWithResult(_0x185b34,null))[_0x94c3('0xe')](handleError(_0x185b34,null));};exports[_0x94c3('0x1c')]=function(_0x1f46fa,_0xb9ade6){return respondWithRpcPromise(_0x94c3('0x1d'),_0x1f46fa[_0x94c3('0x16')])[_0x94c3('0x9')](respondWithResult(_0xb9ade6,null))[_0x94c3('0xe')](handleError(_0xb9ade6,null));};exports[_0x94c3('0x1e')]=function(_0x160237,_0x162ce7){return respondWithRpcPromise(_0x94c3('0x1d'),_0x160237[_0x94c3('0x16')])['then'](findById(_0x160237['params']['id']))[_0x94c3('0x9')](respondWithResult(_0x162ce7,null))[_0x94c3('0xe')](handleError(_0x162ce7,null));};exports[_0x94c3('0x1f')]=function(_0x2edfdb,_0x5ba13f){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x2edfdb[_0x94c3('0x16')],_0x2edfdb[_0x94c3('0x1a')]))[_0x94c3('0x9')](respondWithResult(_0x5ba13f,null))[_0x94c3('0xe')](handleError(_0x5ba13f,null));};exports['voiceQueuesChannels']=function(_0x1ad096,_0x4425a6){return respondWithRpcPromise(_0x94c3('0x20'),_0x1ad096[_0x94c3('0x16')])['then'](respondWithResult(_0x4425a6,null))['catch'](handleError(_0x4425a6,null));};exports[_0x94c3('0x21')]=function(_0x9df308,_0x2f92ce){return respondWithRpcPromise(_0x94c3('0x22'),_[_0x94c3('0x19')](_0x9df308[_0x94c3('0x16')],_0x9df308[_0x94c3('0x1a')]))['then'](respondWithResult(_0x2f92ce,null))[_0x94c3('0xe')](handleError(_0x2f92ce,null));};exports[_0x94c3('0x23')]=function(_0x172f0d,_0x2ac1f9){return respondWithRpcPromise(_0x94c3('0x24'),_[_0x94c3('0x19')](_0x172f0d[_0x94c3('0x16')],_0x172f0d['params']))[_0x94c3('0x9')](respondWithResult(_0x2ac1f9,null))[_0x94c3('0xe')](handleError(_0x2ac1f9,null));};exports[_0x94c3('0x25')]=function(_0x24391a,_0x259795){return respondWithRpcPromise(_0x94c3('0x26'),_[_0x94c3('0x19')](_0x24391a[_0x94c3('0x16')],_0x24391a[_0x94c3('0x1a')]))[_0x94c3('0x9')](respondWithResult(_0x259795,null))[_0x94c3('0xe')](handleError(_0x259795,null));};exports[_0x94c3('0x27')]=function(_0x5add8a,_0x2393cd){return respondWithRpcPromise('Outbound',_0x5add8a[_0x94c3('0x16')])[_0x94c3('0x9')](respondWithResult(_0x2393cd,null))[_0x94c3('0xe')](handleError(_0x2393cd,null));};exports[_0x94c3('0x28')]=function(_0x1d6427,_0x3e324d){return respondWithRpcPromise(_0x94c3('0x29'),_0x1d6427[_0x94c3('0x16')])[_0x94c3('0x9')](respondWithResult(_0x3e324d,null))[_0x94c3('0xe')](handleError(_0x3e324d,null));};exports[_0x94c3('0x2a')]=function(_0x29b6da,_0x290e6d){var _0x2d90f7;return respondWithRpcPromise(_0x94c3('0x2b'),_0x29b6da[_0x94c3('0x16')])[_0x94c3('0x9')](function(_0x30bdbb){_0x2d90f7=_0x30bdbb;return respondWithRpcPromise(_0x94c3('0x2b'),_0x29b6da[_0x94c3('0x16')],routingClient);})[_0x94c3('0x9')](function(_0x3375fa){return _[_0x94c3('0x19')]({},_0x3375fa,_0x2d90f7);})['then'](respondWithResult(_0x290e6d,null))['catch'](handleError(_0x290e6d,null));};exports[_0x94c3('0x2c')]=function(_0x53b8a6,_0x5b5461){if(_0x53b8a6['body']&&_0x53b8a6[_0x94c3('0x2d')][_0x94c3('0x2e')]&&_0x53b8a6[_0x94c3('0x2f')]&&_0x53b8a6[_0x94c3('0x2f')][_0x94c3('0x11')]){for(var _0x2cceaa in _0x53b8a6[_0x94c3('0x2d')]['interaction']){if(_0x53b8a6[_0x94c3('0x2d')]['interaction']['hasOwnProperty'](_0x2cceaa)){db[_0x94c3('0x30')][_0x94c3('0x31')]({'where':{'channel':_0x2cceaa,'membername':_0x53b8a6[_0x94c3('0x2f')][_0x94c3('0x11')],'type':_0x94c3('0x32'),'exitAt':null,'uniqueid':_0x53b8a6[_0x94c3('0x2d')][_0x94c3('0x2e')][_0x2cceaa]&&_0x53b8a6['body'][_0x94c3('0x2e')][_0x2cceaa][_0x94c3('0x33')]?{'$notIn':_0x53b8a6[_0x94c3('0x2d')]['interaction'][_0x2cceaa]}:{'$ne':null}}})[_0x94c3('0x9')](function(_0x4a187c){var _0x311bcc=moment()[_0x94c3('0x34')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x12f62c=0x0,_0x124a44=_0x4a187c[_0x94c3('0x33')];_0x12f62c<_0x124a44;_0x12f62c+=0x1){_0x4a187c[_0x12f62c]['updateAttributes']({'exitAt':_0x311bcc});}});for(var _0x413b75=0x0;_0x413b75<_0x53b8a6[_0x94c3('0x2d')][_0x94c3('0x2e')][_0x2cceaa][_0x94c3('0x33')];_0x413b75+=0x1){db[_0x94c3('0x30')][_0x94c3('0x35')]({'where':{'channel':_0x2cceaa,'membername':_0x53b8a6[_0x94c3('0x2f')][_0x94c3('0x11')],'type':_0x94c3('0x32'),'uniqueid':_0x53b8a6[_0x94c3('0x2d')][_0x94c3('0x2e')][_0x2cceaa][_0x413b75],'exitAt':null},'defaults':{'channel':_0x2cceaa,'membername':_0x53b8a6[_0x94c3('0x2f')][_0x94c3('0x11')],'interface':_[_0x94c3('0x36')](_0x53b8a6['user'][_0x94c3('0x37')])?util['format'](_0x94c3('0x38'),_0x53b8a6[_0x94c3('0x2f')][_0x94c3('0x11')]):_0x53b8a6['user'][_0x94c3('0x37')],'type':_0x94c3('0x32'),'enterAt':moment()[_0x94c3('0x34')](_0x94c3('0x39')),'role':_0x94c3('0x3a'),'internal':_0x53b8a6[_0x94c3('0x2f')][_0x94c3('0x3b')],'uniqueid':_0x53b8a6[_0x94c3('0x2d')]['interaction'][_0x2cceaa][_0x413b75]}});}}}}return respondWithRpcPromise(_0x94c3('0x3c'),{'id':_0x53b8a6[_0x94c3('0x1a')]['id'],'capacity':_0x53b8a6['body'][_0x94c3('0x3d')]},routingClient)['then'](respondWithResult(_0x5b5461,null))[_0x94c3('0xe')](handleError(_0x5b5461,null));};exports[_0x94c3('0x3e')]=function(_0x15e705,_0x44659b){return respondWithRpcPromise(_0x94c3('0x3f'),_0x15e705[_0x94c3('0x16')])[_0x94c3('0x9')](respondWithResult(_0x44659b,null))[_0x94c3('0xe')](handleError(_0x44659b,null));};exports[_0x94c3('0x40')]=function(_0x200a56,_0x41007b){return respondWithRpcPromise(_0x94c3('0x41'),_0x200a56[_0x94c3('0x16')])['then'](respondWithResult(_0x41007b,null))[_0x94c3('0xe')](handleError(_0x41007b,null));};exports[_0x94c3('0x42')]=function(_0x1a1a17,_0x21e762){return respondWithRpcPromise(_0x94c3('0x43'),_0x1a1a17[_0x94c3('0x16')])[_0x94c3('0x9')](respondWithResult(_0x21e762,null))['catch'](handleError(_0x21e762,null));};exports[_0x94c3('0x44')]=function(_0x58ebfa,_0x1fa275){return respondWithRpcPromise(_0x94c3('0x45'),_0x58ebfa[_0x94c3('0x16')],routingClient)['then'](respondWithResult(_0x1fa275,null))[_0x94c3('0xe')](handleError(_0x1fa275,null));};exports[_0x94c3('0x46')]=function(_0xd147ba,_0x5c1cd3){return respondWithRpcPromise(_0x94c3('0x45'),_0xd147ba[_0x94c3('0x16')],routingClient)[_0x94c3('0x9')](findById(_0xd147ba[_0x94c3('0x1a')]['id']))[_0x94c3('0x9')](respondWithResult(_0x5c1cd3,null))['catch'](handleError(_0x5c1cd3,null));};exports['mailQueues']=function(_0x2ddaf5,_0x5d92df){return respondWithRpcPromise('MailQueues',_0x2ddaf5[_0x94c3('0x16')],routingClient)[_0x94c3('0x9')](respondWithResult(_0x5d92df,null))[_0x94c3('0xe')](handleError(_0x5d92df,null));};exports[_0x94c3('0x47')]=function(_0x4f06c6,_0x2eae09){return respondWithRpcPromise(_0x94c3('0x48'),_0x4f06c6[_0x94c3('0x16')],routingClient)['then'](findById(_0x4f06c6[_0x94c3('0x1a')]['id']))[_0x94c3('0x9')](respondWithResult(_0x2eae09,null))[_0x94c3('0xe')](handleError(_0x2eae09,null));};exports[_0x94c3('0x49')]=function(_0x5a6164,_0x4b9f43){return respondWithRpcPromise(_0x94c3('0x4a'),_0x5a6164[_0x94c3('0x16')],mailClient)['then'](respondWithResult(_0x4b9f43,null))[_0x94c3('0xe')](handleError(_0x4b9f43,null));};exports[_0x94c3('0x4b')]=function(_0x43d022,_0x2aafe6){return respondWithRpcPromise(_0x94c3('0x4c'),_0x43d022[_0x94c3('0x16')],routingClient)[_0x94c3('0x9')](respondWithResult(_0x2aafe6,null))[_0x94c3('0xe')](handleError(_0x2aafe6,null));};exports[_0x94c3('0x4d')]=function(_0x5bcda7,_0x6abf25){return respondWithRpcPromise(_0x94c3('0x4c'),_0x5bcda7[_0x94c3('0x16')],routingClient)['then'](findById(_0x5bcda7[_0x94c3('0x1a')]['id']))[_0x94c3('0x9')](respondWithResult(_0x6abf25,null))[_0x94c3('0xe')](handleError(_0x6abf25,null));};exports['smsQueues']=function(_0x4d2cd6,_0xa23c20){return respondWithRpcPromise(_0x94c3('0x4e'),_0x4d2cd6[_0x94c3('0x16')],routingClient)[_0x94c3('0x9')](respondWithResult(_0xa23c20,null))['catch'](handleError(_0xa23c20,null));};exports['showSmsQueues']=function(_0x5dae7a,_0x282fd2){return respondWithRpcPromise(_0x94c3('0x4e'),_0x5dae7a[_0x94c3('0x16')],routingClient)[_0x94c3('0x9')](findById(_0x5dae7a[_0x94c3('0x1a')]['id']))['then'](respondWithResult(_0x282fd2,null))['catch'](handleError(_0x282fd2,null));};exports[_0x94c3('0x4f')]=function(_0x450d19,_0x230499){return respondWithRpcPromise('FaxQueues',_0x450d19[_0x94c3('0x16')],routingClient)[_0x94c3('0x9')](respondWithResult(_0x230499,null))[_0x94c3('0xe')](handleError(_0x230499,null));};exports[_0x94c3('0x50')]=function(_0x4c5abc,_0x508c2c){return respondWithRpcPromise('FaxQueues',_0x4c5abc['query'],routingClient)[_0x94c3('0x9')](findById(_0x4c5abc[_0x94c3('0x1a')]['id']))[_0x94c3('0x9')](respondWithResult(_0x508c2c,null))[_0x94c3('0xe')](handleError(_0x508c2c,null));};exports[_0x94c3('0x51')]=function(_0x4fc42f,_0x4da447){return respondWithRpcPromise(_0x94c3('0x52'),_0x4fc42f['query'])[_0x94c3('0x9')](respondWithResult(_0x4da447,null))['catch'](handleError(_0x4da447,null));};exports[_0x94c3('0x53')]=function(_0x176224,_0x490be1){return respondWithRpcPromise(_0x94c3('0x54'),_0x176224[_0x94c3('0x16')],routingClient)['then'](respondWithResult(_0x490be1,null))[_0x94c3('0xe')](handleError(_0x490be1,null));};exports[_0x94c3('0x55')]=function(_0x327010,_0x157132){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x327010[_0x94c3('0x16')],routingClient)[_0x94c3('0x9')](respondWithResult(_0x157132,null))[_0x94c3('0xe')](handleError(_0x157132,null));};exports[_0x94c3('0x56')]=function(_0x1f2a40,_0x5c848d){return respondWithRpcPromise(_0x94c3('0x57'),_0x1f2a40[_0x94c3('0x16')],routingClient)[_0x94c3('0x9')](respondWithResult(_0x5c848d,null))['catch'](handleError(_0x5c848d,null));};exports['smsQueuesWaitingInteractions']=function(_0x521e1f,_0xf05a34){return respondWithRpcPromise(_0x94c3('0x58'),_0x521e1f[_0x94c3('0x16')],routingClient)[_0x94c3('0x9')](respondWithResult(_0xf05a34,null))[_0x94c3('0xe')](handleError(_0xf05a34,null));};exports[_0x94c3('0x59')]=function(_0x1f1fce,_0xec0a8d){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x1f1fce[_0x94c3('0x16')],routingClient)[_0x94c3('0x9')](respondWithResult(_0xec0a8d,null))[_0x94c3('0xe')](handleError(_0xec0a8d,null));};exports[_0x94c3('0x5a')]=function(_0x562575){return function(_0x31bcf1,_0x124321){var _0x3c8cc8,_0xc52017;var _0x3d3c89=_[_0x94c3('0x5b')](_0x562575);var _0x36e6c1=_0x562575===_0x94c3('0x5c')?_0x94c3('0x5d'):'Account';return db[_0x3d3c89+_0x94c3('0x5e')][_0x94c3('0x5f')]({'raw':!![],'where':{'id':_0x31bcf1[_0x94c3('0x1a')]['id']}})['then'](function(_0x24baa7){if(_[_0x94c3('0x36')](_0x24baa7)){throw new Error(_0x3d3c89+_0x94c3('0x60'));}_0x3c8cc8=_0x24baa7;return db[_0x3d3c89+_0x94c3('0x61')][_0x94c3('0x5f')]({'where':{'id':_0x31bcf1[_0x94c3('0x2d')]['messageId']},'include':[{'model':db[_0x3d3c89+_0x94c3('0x62')],'as':_0x94c3('0x62')},{'model':db[_0x3d3c89+_0x36e6c1],'as':_0x94c3('0x63')}]});})[_0x94c3('0x9')](function(_0x1edd55){if(_[_0x94c3('0x36')](_0x1edd55)){throw new Error(_0x3d3c89+_0x94c3('0x64'));}_0xc52017=_0x1edd55;return _0x1edd55[_0x94c3('0x65')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x46a756={'uniqueid':_0x562575+'.'+_0xc52017['id']+'.'+_0xc52017[_0x94c3('0x62')]['id'],'FromUserId':_0x31bcf1['user']['id'],'type':_0x94c3('0x66')};_0x46a756[_0x3d3c89+_0x94c3('0x67')]=_0xc52017['id'];_0x46a756[_0x3d3c89+_0x94c3('0x68')]=_0xc52017['Interaction']['id'];_0x46a756[_0x94c3('0x69')+_0x3d3c89+_0x36e6c1+'Id']=_0xc52017[_0x94c3('0x63')]['id'];_0x46a756['To'+_0x3d3c89+'QueueId']=_0x3c8cc8['id'];return db[_0x3d3c89+_0x94c3('0x6a')][_0x94c3('0x6b')](_0x46a756);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x562575,'interaction':_0xc52017[_0x94c3('0x62')],'message':_0xc52017,'account':_0xc52017[_0x94c3('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':_0x94c3('0x66'),'appdata':_0x3c8cc8[_0x94c3('0x11')]+','+(_0xc52017['Account'][_0x94c3('0x6c')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x94c3('0x9')](respondWithResult(_0x124321,null))['catch'](handleError(_0x124321,null));};};exports['agentNotify']=function(_0x31bbea,_0x22c23f){var _0x10ecf6,_0x5ed41a;if(_[_0x94c3('0x36')](_0x31bbea[_0x94c3('0x2d')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x1e1a6a=_0x31bbea[_0x94c3('0x2d')][_0x94c3('0x6d')];var _0xfeaf0e=_['capitalize'](_0x1e1a6a);var _0x13daf6=_0x1e1a6a==='chat'?_0x94c3('0x5d'):_0x94c3('0x63');return db[_0x94c3('0x6e')]['findOne']({'raw':!![],'where':{'id':_0x31bbea[_0x94c3('0x1a')]['id'],'role':_0x94c3('0x3a')}})[_0x94c3('0x9')](function(_0x95b31e){if(_[_0x94c3('0x36')](_0x95b31e)){throw new Error(_0x94c3('0x6f'));}_0x10ecf6=_0x95b31e;return db[_0xfeaf0e+_0x94c3('0x61')][_0x94c3('0x5f')]({'where':{'id':_0x31bbea['body']['messageId']},'include':[{'model':db[_0xfeaf0e+_0x94c3('0x62')],'as':_0x94c3('0x62')},{'model':db[_0xfeaf0e+_0x13daf6],'as':'Account'}]});})[_0x94c3('0x9')](function(_0x2644b0){if(_['isNil'](_0x2644b0)){throw new Error(_0xfeaf0e+'\x20Message\x20not\x20found');}_0x5ed41a=_0x2644b0;return _0x2644b0[_0x94c3('0x65')]({'read':0x0,'readAt':null,'UserId':null});})[_0x94c3('0x9')](function(){var _0x20e73e={'uniqueid':_0x1e1a6a+'.'+_0x5ed41a['id']+'.'+_0x5ed41a[_0x94c3('0x62')]['id'],'FromUserId':_0x31bbea['user']['id'],'type':_0x94c3('0x66'),'ToUserId':_0x10ecf6['id']};_0x20e73e[_0xfeaf0e+_0x94c3('0x67')]=_0x5ed41a['id'];_0x20e73e[_0xfeaf0e+'InteractionId']=_0x5ed41a[_0x94c3('0x62')]['id'];_0x20e73e['From'+_0xfeaf0e+_0x13daf6+'Id']=_0x5ed41a[_0x94c3('0x63')]['id'];return db[_0xfeaf0e+_0x94c3('0x6a')][_0x94c3('0x6b')](_0x20e73e);})[_0x94c3('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x1e1a6a,'interaction':_0x5ed41a['Interaction'],'message':_0x5ed41a,'account':_0x5ed41a[_0x94c3('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':_0x94c3('0x3a'),'appdata':_0x10ecf6[_0x94c3('0x11')]+','+(_0x5ed41a[_0x94c3('0x63')][_0x94c3('0x70')]||0x12c),'interval':_0x94c3('0x71')}]},routingClient);})['then'](respondWithResult(_0x22c23f,null))[_0x94c3('0xe')](handleError(_0x22c23f,null));}; \ No newline at end of file +var _0x950f=['user','hasOwnProperty','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','length','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','Telephones','trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','showMailQueues','MailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','TransferReport','create','Start','queueTransferTimeout','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','Message','messageId','From','agentTransferTimeout','*,*,*,*','bluebird','moment','lodash','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','json','stack','name','status','send','isNil','rows','find','VoiceChannels','query','voiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','params','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','Agents','agentCapacity','body','interaction'];(function(_0x313a00,_0x107929){var _0x46d07b=function(_0x452b30){while(--_0x452b30){_0x313a00['push'](_0x313a00['shift']());}};_0x46d07b(++_0x107929);}(_0x950f,0x1a0));var _0xf950=function(_0x1546c2,_0x22e822){_0x1546c2=_0x1546c2-0x0;var _0x24583c=_0x950f[_0x1546c2];return _0x24583c;};'use strict';var BPromise=require(_0xf950('0x0'));var moment=require(_0xf950('0x1'));var _=require(_0xf950('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0xf950('0x3'))(_0xf950('0x4'));var jayson=require(_0xf950('0x5'));var amiClient=jayson[_0xf950('0x6')][_0xf950('0x7')]({'port':0x232a});var mailClient=jayson[_0xf950('0x6')][_0xf950('0x7')]({'port':0x232b});var routingClient=jayson[_0xf950('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2e2d31,_0x2e56a8,_0x22eaf8){return new BPromise(function(_0x4e4ab5,_0x35e95c){var _0x28bb91=_0x22eaf8?_0x22eaf8:amiClient;return _0x28bb91[_0xf950('0x8')](_0x2e2d31,_0x2e56a8)[_0xf950('0x9')](function(_0x43441e){if(_0x43441e[_0xf950('0xa')]){if(_0x43441e[_0xf950('0xa')][_0xf950('0xb')]===0x1f4){return _0x35e95c(_0x43441e[_0xf950('0xa')][_0xf950('0xc')]);}return _0x4e4ab5(_0x43441e[_0xf950('0xa')][_0xf950('0xc')]);}else{_0x4e4ab5(_0x43441e[_0xf950('0xd')]);}})[_0xf950('0xe')](function(_0xaebdd5){_0x35e95c(_0xaebdd5);});});}function respondWithResult(_0x44b24c,_0x3f5f1b){_0x3f5f1b=_0x3f5f1b||0xc8;return function(_0xa3ad95){if(_0xa3ad95){return _0x44b24c['status'](_0x3f5f1b)[_0xf950('0xf')](_0xa3ad95);}return _0x44b24c['sendStatus'](0x194);};}function handleError(_0x47c437,_0x2a0470){_0x2a0470=_0x2a0470||0x1f4;return function(_0x11b1ae){logger[_0xf950('0xa')](_0x11b1ae[_0xf950('0x10')]);if(_0x11b1ae[_0xf950('0x11')]){delete _0x11b1ae[_0xf950('0x11')];}_0x47c437[_0xf950('0x12')](_0x2a0470)[_0xf950('0x13')](_0x11b1ae);};}function findById(_0x200c2b){return function(_0x46c44f){if(!_[_0xf950('0x14')](_0x200c2b)&&!_[_0xf950('0x14')](_0x46c44f)&&!_[_0xf950('0x14')](_0x46c44f[_0xf950('0x15')])){return _[_0xf950('0x16')](_0x46c44f['rows'],function(_0x1c7658){return _0x1c7658['id']==_0x200c2b;});}return null;};}exports['voiceChannels']=function(_0x360f4a,_0xa6d61a){return respondWithRpcPromise(_0xf950('0x17'),_0x360f4a[_0xf950('0x18')])[_0xf950('0x9')](respondWithResult(_0xa6d61a,null))[_0xf950('0xe')](handleError(_0xa6d61a,null));};exports[_0xf950('0x19')]=function(_0x1df902,_0x1ccb2b){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xf950('0x1a')](_0x1df902[_0xf950('0x18')],_0x1df902['params']))['then'](respondWithResult(_0x1ccb2b,null))['catch'](handleError(_0x1ccb2b,null));};exports[_0xf950('0x1b')]=function(_0x3a8ec5,_0x50ed84){return respondWithRpcPromise(_0xf950('0x1c'),_[_0xf950('0x1a')](_0x3a8ec5[_0xf950('0x18')],_0x3a8ec5['params']))[_0xf950('0x9')](respondWithResult(_0x50ed84,null))[_0xf950('0xe')](handleError(_0x50ed84,null));};exports[_0xf950('0x1d')]=function(_0x453342,_0x2253c4){return respondWithRpcPromise(_0xf950('0x1e'),_0x453342[_0xf950('0x18')])[_0xf950('0x9')](respondWithResult(_0x2253c4,null))[_0xf950('0xe')](handleError(_0x2253c4,null));};exports['showVoiceQueues']=function(_0x1760e6,_0x4f02e2){return respondWithRpcPromise(_0xf950('0x1e'),_0x1760e6['query'])['then'](findById(_0x1760e6[_0xf950('0x1f')]['id']))[_0xf950('0x9')](respondWithResult(_0x4f02e2,null))[_0xf950('0xe')](handleError(_0x4f02e2,null));};exports[_0xf950('0x20')]=function(_0x577989,_0x14d13b){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xf950('0x1a')](_0x577989['query'],_0x577989[_0xf950('0x1f')]))[_0xf950('0x9')](respondWithResult(_0x14d13b,null))[_0xf950('0xe')](handleError(_0x14d13b,null));};exports[_0xf950('0x21')]=function(_0x12ffef,_0x19960a){return respondWithRpcPromise(_0xf950('0x22'),_0x12ffef[_0xf950('0x18')])['then'](respondWithResult(_0x19960a,null))['catch'](handleError(_0x19960a,null));};exports[_0xf950('0x23')]=function(_0x55208f,_0x18832f){return respondWithRpcPromise(_0xf950('0x24'),_[_0xf950('0x1a')](_0x55208f['query'],_0x55208f[_0xf950('0x1f')]))['then'](respondWithResult(_0x18832f,null))[_0xf950('0xe')](handleError(_0x18832f,null));};exports[_0xf950('0x25')]=function(_0x44b931,_0x2c3100){return respondWithRpcPromise(_0xf950('0x26'),_['merge'](_0x44b931[_0xf950('0x18')],_0x44b931[_0xf950('0x1f')]))[_0xf950('0x9')](respondWithResult(_0x2c3100,null))[_0xf950('0xe')](handleError(_0x2c3100,null));};exports[_0xf950('0x27')]=function(_0x437d1e,_0x8b300d){return respondWithRpcPromise(_0xf950('0x28'),_[_0xf950('0x1a')](_0x437d1e[_0xf950('0x18')],_0x437d1e[_0xf950('0x1f')]))['then'](respondWithResult(_0x8b300d,null))[_0xf950('0xe')](handleError(_0x8b300d,null));};exports[_0xf950('0x29')]=function(_0x3a55b3,_0x5236ed){return respondWithRpcPromise(_0xf950('0x2a'),_0x3a55b3[_0xf950('0x18')])[_0xf950('0x9')](respondWithResult(_0x5236ed,null))[_0xf950('0xe')](handleError(_0x5236ed,null));};exports[_0xf950('0x2b')]=function(_0x50fa89,_0x1e3da9){return respondWithRpcPromise('OutboundChannels',_0x50fa89[_0xf950('0x18')])[_0xf950('0x9')](respondWithResult(_0x1e3da9,null))[_0xf950('0xe')](handleError(_0x1e3da9,null));};exports['agents']=function(_0x25b371,_0x15dbb5){var _0xeed934;return respondWithRpcPromise(_0xf950('0x2c'),_0x25b371[_0xf950('0x18')])['then'](function(_0x3bae5f){_0xeed934=_0x3bae5f;return respondWithRpcPromise(_0xf950('0x2c'),_0x25b371[_0xf950('0x18')],routingClient);})[_0xf950('0x9')](function(_0x53949c){return _[_0xf950('0x1a')]({},_0x53949c,_0xeed934);})[_0xf950('0x9')](respondWithResult(_0x15dbb5,null))[_0xf950('0xe')](handleError(_0x15dbb5,null));};exports[_0xf950('0x2d')]=function(_0x3d1d94,_0x315c2a){if(_0x3d1d94[_0xf950('0x2e')]&&_0x3d1d94[_0xf950('0x2e')][_0xf950('0x2f')]&&_0x3d1d94[_0xf950('0x30')]&&_0x3d1d94['user']['name']){for(var _0x6a022e in _0x3d1d94['body']['interaction']){if(_0x3d1d94[_0xf950('0x2e')][_0xf950('0x2f')][_0xf950('0x31')](_0x6a022e)){db[_0xf950('0x32')][_0xf950('0x33')]({'where':{'channel':_0x6a022e,'membername':_0x3d1d94[_0xf950('0x30')]['name'],'type':_0xf950('0x34'),'exitAt':null,'uniqueid':_0x3d1d94['body']['interaction'][_0x6a022e]&&_0x3d1d94['body'][_0xf950('0x2f')][_0x6a022e]['length']?{'$notIn':_0x3d1d94['body']['interaction'][_0x6a022e]}:{'$ne':null}}})[_0xf950('0x9')](function(_0x3e10d0){var _0x514701=moment()[_0xf950('0x35')](_0xf950('0x36'));for(var _0xbd377d=0x0,_0x41adc2=_0x3e10d0['length'];_0xbd377d<_0x41adc2;_0xbd377d+=0x1){_0x3e10d0[_0xbd377d][_0xf950('0x37')]({'exitAt':_0x514701});}});for(var _0xa62fb7=0x0;_0xa62fb7<_0x3d1d94[_0xf950('0x2e')]['interaction'][_0x6a022e][_0xf950('0x38')];_0xa62fb7+=0x1){db['MemberReport'][_0xf950('0x39')]({'where':{'channel':_0x6a022e,'membername':_0x3d1d94[_0xf950('0x30')][_0xf950('0x11')],'type':_0xf950('0x34'),'uniqueid':_0x3d1d94[_0xf950('0x2e')]['interaction'][_0x6a022e][_0xa62fb7],'exitAt':null},'defaults':{'channel':_0x6a022e,'membername':_0x3d1d94['user'][_0xf950('0x11')],'interface':_[_0xf950('0x14')](_0x3d1d94[_0xf950('0x30')][_0xf950('0x3a')])?util[_0xf950('0x35')](_0xf950('0x3b'),_0x3d1d94[_0xf950('0x30')][_0xf950('0x11')]):_0x3d1d94[_0xf950('0x30')][_0xf950('0x3a')],'type':'INTERACTION','enterAt':moment()['format'](_0xf950('0x36')),'role':_0xf950('0x3c'),'internal':_0x3d1d94['user'][_0xf950('0x3d')],'uniqueid':_0x3d1d94[_0xf950('0x2e')][_0xf950('0x2f')][_0x6a022e][_0xa62fb7]}});}}}}return respondWithRpcPromise(_0xf950('0x3e'),{'id':_0x3d1d94['params']['id'],'capacity':_0x3d1d94['body'][_0xf950('0x3f')]},routingClient)[_0xf950('0x9')](respondWithResult(_0x315c2a,null))[_0xf950('0xe')](handleError(_0x315c2a,null));};exports['telephones']=function(_0x2df305,_0x162c43){return respondWithRpcPromise(_0xf950('0x40'),_0x2df305[_0xf950('0x18')])[_0xf950('0x9')](respondWithResult(_0x162c43,null))[_0xf950('0xe')](handleError(_0x162c43,null));};exports[_0xf950('0x41')]=function(_0x5242db,_0x16cfc2){return respondWithRpcPromise('Trunks',_0x5242db[_0xf950('0x18')])[_0xf950('0x9')](respondWithResult(_0x16cfc2,null))[_0xf950('0xe')](handleError(_0x16cfc2,null));};exports[_0xf950('0x42')]=function(_0x33be46,_0x535fee){return respondWithRpcPromise(_0xf950('0x43'),_0x33be46[_0xf950('0x18')])[_0xf950('0x9')](respondWithResult(_0x535fee,null))[_0xf950('0xe')](handleError(_0x535fee,null));};exports[_0xf950('0x44')]=function(_0x484523,_0x5c8a10){return respondWithRpcPromise('ChatQueues',_0x484523[_0xf950('0x18')],routingClient)[_0xf950('0x9')](respondWithResult(_0x5c8a10,null))[_0xf950('0xe')](handleError(_0x5c8a10,null));};exports[_0xf950('0x45')]=function(_0x341179,_0x5633cd){return respondWithRpcPromise(_0xf950('0x46'),_0x341179['query'],routingClient)[_0xf950('0x9')](findById(_0x341179[_0xf950('0x1f')]['id']))[_0xf950('0x9')](respondWithResult(_0x5633cd,null))[_0xf950('0xe')](handleError(_0x5633cd,null));};exports['mailQueues']=function(_0x9a69b4,_0x37d200){return respondWithRpcPromise('MailQueues',_0x9a69b4['query'],routingClient)['then'](respondWithResult(_0x37d200,null))['catch'](handleError(_0x37d200,null));};exports[_0xf950('0x47')]=function(_0x57b8be,_0x2938f9){return respondWithRpcPromise(_0xf950('0x48'),_0x57b8be['query'],routingClient)['then'](findById(_0x57b8be['params']['id']))[_0xf950('0x9')](respondWithResult(_0x2938f9,null))['catch'](handleError(_0x2938f9,null));};exports[_0xf950('0x49')]=function(_0x47cb70,_0x23f0de){return respondWithRpcPromise('MailAccounts',_0x47cb70[_0xf950('0x18')],mailClient)[_0xf950('0x9')](respondWithResult(_0x23f0de,null))[_0xf950('0xe')](handleError(_0x23f0de,null));};exports[_0xf950('0x4a')]=function(_0x35455c,_0xdbc1f3){return respondWithRpcPromise(_0xf950('0x4b'),_0x35455c[_0xf950('0x18')],routingClient)[_0xf950('0x9')](respondWithResult(_0xdbc1f3,null))[_0xf950('0xe')](handleError(_0xdbc1f3,null));};exports[_0xf950('0x4c')]=function(_0x108151,_0x18bf4a){return respondWithRpcPromise('OpenchannelQueues',_0x108151[_0xf950('0x18')],routingClient)['then'](findById(_0x108151[_0xf950('0x1f')]['id']))['then'](respondWithResult(_0x18bf4a,null))[_0xf950('0xe')](handleError(_0x18bf4a,null));};exports[_0xf950('0x4d')]=function(_0x3ab901,_0x5aa139){return respondWithRpcPromise('SmsQueues',_0x3ab901[_0xf950('0x18')],routingClient)[_0xf950('0x9')](respondWithResult(_0x5aa139,null))[_0xf950('0xe')](handleError(_0x5aa139,null));};exports['showSmsQueues']=function(_0x4ee888,_0x24127b){return respondWithRpcPromise(_0xf950('0x4e'),_0x4ee888[_0xf950('0x18')],routingClient)['then'](findById(_0x4ee888[_0xf950('0x1f')]['id']))[_0xf950('0x9')](respondWithResult(_0x24127b,null))[_0xf950('0xe')](handleError(_0x24127b,null));};exports[_0xf950('0x4f')]=function(_0x2dc660,_0x2a8f84){return respondWithRpcPromise(_0xf950('0x50'),_0x2dc660['query'],routingClient)[_0xf950('0x9')](respondWithResult(_0x2a8f84,null))[_0xf950('0xe')](handleError(_0x2a8f84,null));};exports[_0xf950('0x51')]=function(_0x1c53af,_0x58d8b6){return respondWithRpcPromise(_0xf950('0x50'),_0x1c53af[_0xf950('0x18')],routingClient)[_0xf950('0x9')](findById(_0x1c53af[_0xf950('0x1f')]['id']))['then'](respondWithResult(_0x58d8b6,null))[_0xf950('0xe')](handleError(_0x58d8b6,null));};exports[_0xf950('0x52')]=function(_0x551b1f,_0x15e6f7){return respondWithRpcPromise(_0xf950('0x53'),_0x551b1f[_0xf950('0x18')])['then'](respondWithResult(_0x15e6f7,null))[_0xf950('0xe')](handleError(_0x15e6f7,null));};exports['chatQueuesWaitingInteractions']=function(_0x520c81,_0x444264){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x520c81['query'],routingClient)[_0xf950('0x9')](respondWithResult(_0x444264,null))[_0xf950('0xe')](handleError(_0x444264,null));};exports[_0xf950('0x54')]=function(_0x2a7147,_0x40f593){return respondWithRpcPromise(_0xf950('0x55'),_0x2a7147[_0xf950('0x18')],routingClient)[_0xf950('0x9')](respondWithResult(_0x40f593,null))['catch'](handleError(_0x40f593,null));};exports[_0xf950('0x56')]=function(_0x5902ae,_0x376438){return respondWithRpcPromise(_0xf950('0x57'),_0x5902ae[_0xf950('0x18')],routingClient)[_0xf950('0x9')](respondWithResult(_0x376438,null))['catch'](handleError(_0x376438,null));};exports['smsQueuesWaitingInteractions']=function(_0x3b0fca,_0xe8a901){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x3b0fca[_0xf950('0x18')],routingClient)['then'](respondWithResult(_0xe8a901,null))[_0xf950('0xe')](handleError(_0xe8a901,null));};exports[_0xf950('0x58')]=function(_0x2ae8d4,_0x2e522f){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x2ae8d4[_0xf950('0x18')],routingClient)['then'](respondWithResult(_0x2e522f,null))[_0xf950('0xe')](handleError(_0x2e522f,null));};exports[_0xf950('0x59')]=function(_0x3e8b36){return function(_0x2ef712,_0x37ab5f){var _0x4ee0d6,_0x4b602e;var _0x408b08=_[_0xf950('0x5a')](_0x3e8b36);var _0x21758a=_0x3e8b36==='chat'?_0xf950('0x5b'):_0xf950('0x5c');return db[_0x408b08+_0xf950('0x5d')][_0xf950('0x5e')]({'raw':!![],'where':{'id':_0x2ef712[_0xf950('0x1f')]['id']}})['then'](function(_0x261a83){if(_['isNil'](_0x261a83)){throw new Error(_0x408b08+_0xf950('0x5f'));}_0x4ee0d6=_0x261a83;return db[_0x408b08+'Message'][_0xf950('0x5e')]({'where':{'id':_0x2ef712['body']['messageId']},'include':[{'model':db[_0x408b08+'Interaction'],'as':_0xf950('0x60')},{'model':db[_0x408b08+_0x21758a],'as':'Account'}]});})[_0xf950('0x9')](function(_0xf8f301){if(_[_0xf950('0x14')](_0xf8f301)){throw new Error(_0x408b08+_0xf950('0x61'));}_0x4b602e=_0xf8f301;return _0xf8f301['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xf950('0x9')](function(){var _0x17ab92={'uniqueid':_0x3e8b36+'.'+_0x4b602e['id']+'.'+_0x4b602e[_0xf950('0x60')]['id'],'FromUserId':_0x2ef712[_0xf950('0x30')]['id'],'type':_0xf950('0x62')};_0x17ab92[_0x408b08+_0xf950('0x63')]=_0x4b602e['id'];_0x17ab92[_0x408b08+_0xf950('0x64')]=_0x4b602e[_0xf950('0x60')]['id'];_0x17ab92['From'+_0x408b08+_0x21758a+'Id']=_0x4b602e[_0xf950('0x5c')]['id'];_0x17ab92['To'+_0x408b08+'QueueId']=_0x4ee0d6['id'];return db[_0x408b08+_0xf950('0x65')][_0xf950('0x66')](_0x17ab92);})[_0xf950('0x9')](function(){return respondWithRpcPromise(_0xf950('0x67'),{'channel':_0x3e8b36,'interaction':_0x4b602e[_0xf950('0x60')],'message':_0x4b602e,'account':_0x4b602e[_0xf950('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':_0xf950('0x62'),'appdata':_0x4ee0d6['name']+','+(_0x4b602e[_0xf950('0x5c')][_0xf950('0x68')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xf950('0x9')](respondWithResult(_0x37ab5f,null))[_0xf950('0xe')](handleError(_0x37ab5f,null));};};exports[_0xf950('0x69')]=function(_0x54506a,_0x8add7a){var _0x223f4c,_0x1a9135;if(_[_0xf950('0x14')](_0x54506a['body'][_0xf950('0x6a')])){throw new Error(_0xf950('0x6b'));}var _0x1bb726=_0x54506a[_0xf950('0x2e')][_0xf950('0x6a')];var _0x1e62a7=_[_0xf950('0x5a')](_0x1bb726);var _0x46689d=_0x1bb726===_0xf950('0x6c')?_0xf950('0x5b'):_0xf950('0x5c');return db[_0xf950('0x6d')]['findOne']({'raw':!![],'where':{'id':_0x54506a[_0xf950('0x1f')]['id'],'role':_0xf950('0x3c')}})[_0xf950('0x9')](function(_0xe9daaf){if(_['isNil'](_0xe9daaf)){throw new Error(_0xf950('0x6e'));}_0x223f4c=_0xe9daaf;return db[_0x1e62a7+_0xf950('0x6f')][_0xf950('0x5e')]({'where':{'id':_0x54506a[_0xf950('0x2e')][_0xf950('0x70')]},'include':[{'model':db[_0x1e62a7+_0xf950('0x60')],'as':_0xf950('0x60')},{'model':db[_0x1e62a7+_0x46689d],'as':_0xf950('0x5c')}]});})[_0xf950('0x9')](function(_0x33b236){if(_[_0xf950('0x14')](_0x33b236)){throw new Error(_0x1e62a7+'\x20Message\x20not\x20found');}_0x1a9135=_0x33b236;return _0x33b236['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xf950('0x9')](function(){var _0x1d79e8={'uniqueid':_0x1bb726+'.'+_0x1a9135['id']+'.'+_0x1a9135[_0xf950('0x60')]['id'],'FromUserId':_0x54506a[_0xf950('0x30')]['id'],'type':'queue','ToUserId':_0x223f4c['id']};_0x1d79e8[_0x1e62a7+_0xf950('0x63')]=_0x1a9135['id'];_0x1d79e8[_0x1e62a7+'InteractionId']=_0x1a9135[_0xf950('0x60')]['id'];_0x1d79e8[_0xf950('0x71')+_0x1e62a7+_0x46689d+'Id']=_0x1a9135[_0xf950('0x5c')]['id'];return db[_0x1e62a7+'TransferReport'][_0xf950('0x66')](_0x1d79e8);})['then'](function(){return respondWithRpcPromise(_0xf950('0x67'),{'channel':_0x1bb726,'interaction':_0x1a9135[_0xf950('0x60')],'message':_0x1a9135,'account':_0x1a9135[_0xf950('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':_0xf950('0x3c'),'appdata':_0x223f4c[_0xf950('0x11')]+','+(_0x1a9135['Account'][_0xf950('0x72')]||0x12c),'interval':_0xf950('0x73')}]},routingClient);})[_0xf950('0x9')](respondWithResult(_0x8add7a,null))[_0xf950('0xe')](handleError(_0x8add7a,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index d53394a..36bdf00 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 _0xf0a3=['create','put','update','delete','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','post'];(function(_0x1aa8b7,_0x1ff1a7){var _0xf2f26=function(_0x1dd659){while(--_0x1dd659){_0x1aa8b7['push'](_0x1aa8b7['shift']());}};_0xf2f26(++_0x1ff1a7);}(_0xf0a3,0x180));var _0x3f0a=function(_0x4f2b9a,_0x105afc){_0x4f2b9a=_0x4f2b9a-0x0;var _0x5e23b4=_0xf0a3[_0x4f2b9a];return _0x5e23b4;};'use strict';var multer=require(_0x3f0a('0x0'));var util=require(_0x3f0a('0x1'));var path=require('path');var timeout=require(_0x3f0a('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x3f0a('0x3'));var interaction=require(_0x3f0a('0x4'));var config=require(_0x3f0a('0x5'));var controller=require(_0x3f0a('0x6'));router[_0x3f0a('0x7')]('/',auth[_0x3f0a('0x8')](),controller[_0x3f0a('0x9')]);router[_0x3f0a('0x7')](_0x3f0a('0xa'),auth[_0x3f0a('0x8')](),controller[_0x3f0a('0xb')]);router[_0x3f0a('0x7')](_0x3f0a('0xc'),auth[_0x3f0a('0x8')](),controller[_0x3f0a('0xd')]);router[_0x3f0a('0xe')]('/',auth['isAuthenticated'](),controller[_0x3f0a('0xf')]);router[_0x3f0a('0x10')](_0x3f0a('0xa'),auth['isAuthenticated'](),controller[_0x3f0a('0x11')]);router[_0x3f0a('0x12')](_0x3f0a('0xa'),auth[_0x3f0a('0x8')](),controller[_0x3f0a('0x13')]);module[_0x3f0a('0x14')]=router; \ No newline at end of file +var _0x6265=['../../config/environment','isAuthenticated','index','get','show','/:id/run','run','post','put','/:id','update','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service'];(function(_0xb46607,_0x23536d){var _0x41c744=function(_0x515573){while(--_0x515573){_0xb46607['push'](_0xb46607['shift']());}};_0x41c744(++_0x23536d);}(_0x6265,0xa6));var _0x5626=function(_0x1faf7b,_0xbda798){_0x1faf7b=_0x1faf7b-0x0;var _0x4cca5b=_0x6265[_0x1faf7b];return _0x4cca5b;};'use strict';var multer=require(_0x5626('0x0'));var util=require(_0x5626('0x1'));var path=require(_0x5626('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5626('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5626('0x4'));var config=require(_0x5626('0x5'));var controller=require('./schedule.controller');router['get']('/',auth[_0x5626('0x6')](),controller[_0x5626('0x7')]);router[_0x5626('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x5626('0x9')]);router[_0x5626('0x8')](_0x5626('0xa'),auth[_0x5626('0x6')](),controller[_0x5626('0xb')]);router[_0x5626('0xc')]('/',auth[_0x5626('0x6')](),controller['create']);router[_0x5626('0xd')](_0x5626('0xe'),auth['isAuthenticated'](),controller[_0x5626('0xf')]);router[_0x5626('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5626('0x11')]);module[_0x5626('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index d4b5d1d..17382b3 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 _0x1574=['pdf','custom','default','TEXT','BOOLEAN','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','minutes'];(function(_0xbc3ba,_0x5ecfd0){var _0x20514f=function(_0x130ac8){while(--_0x130ac8){_0xbc3ba['push'](_0xbc3ba['shift']());}};_0x20514f(++_0x5ecfd0);}(_0x1574,0x148));var _0x4157=function(_0x3b6ae5,_0x5158bc){_0x3b6ae5=_0x3b6ae5-0x0;var _0x3acfec=_0x1574[_0x3b6ae5];return _0x3acfec;};'use strict';var Sequelize=require(_0x4157('0x0'));module[_0x4157('0x1')]={'name':{'type':Sequelize[_0x4157('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4157('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x4157('0x2')],'allowNull':![],'defaultValue':_0x4157('0x3')},'startAt':{'type':Sequelize[_0x4157('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x4157('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x4157('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x4157('0x6')](_0x4157('0x7'),_0x4157('0x8'),_0x4157('0x9'),_0x4157('0xa'),_0x4157('0xb'),_0x4157('0xc'),_0x4157('0xd')),'allowNull':![],'defaultValue':_0x4157('0xb')},'output':{'type':Sequelize[_0x4157('0x6')]('csv',_0x4157('0xe'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0x4157('0xf'),_0x4157('0x10')),'allowNull':![],'defaultValue':_0x4157('0xf')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x4157('0x2')]},'cc':{'type':Sequelize[_0x4157('0x11')]},'bcc':{'type':Sequelize[_0x4157('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x4157('0x12')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0dee=['days','hours','csv','xlsx','custom','BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','weeks'];(function(_0xb4035,_0x3f2fdf){var _0x1ddc4d=function(_0x5db5d0){while(--_0x5db5d0){_0xb4035['push'](_0xb4035['shift']());}};_0x1ddc4d(++_0x3f2fdf);}(_0x0dee,0xf7));var _0xe0de=function(_0x14e964,_0xc2cbd2){_0x14e964=_0x14e964-0x0;var _0x28d15b=_0x0dee[_0x14e964];return _0x28d15b;};'use strict';var Sequelize=require(_0xe0de('0x0'));module[_0xe0de('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe0de('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xe0de('0x2')],'allowNull':![],'defaultValue':_0xe0de('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xe0de('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xe0de('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xe0de('0x6')]('years',_0xe0de('0x7'),'months',_0xe0de('0x8'),_0xe0de('0x9'),_0xe0de('0xa'),'minutes'),'allowNull':![],'defaultValue':_0xe0de('0x9')},'output':{'type':Sequelize['ENUM'](_0xe0de('0xb'),'pdf',_0xe0de('0xc')),'allowNull':![],'defaultValue':_0xe0de('0xb')},'type':{'type':Sequelize[_0xe0de('0x6')](_0xe0de('0xd'),'default'),'allowNull':![],'defaultValue':_0xe0de('0xd')},'sendMail':{'type':Sequelize[_0xe0de('0xe')],'defaultValue':![]},'email':{'type':Sequelize[_0xe0de('0x2')]},'cc':{'type':Sequelize[_0xe0de('0xf')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index c3c9a31..57e3df7 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 _0x399b=['create','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','../../config/schedule','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','count','offset','limit','apply','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','send','Schedule','keys','query','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','rows','catch','params','rawAttributes'];(function(_0x15fd7b,_0x308bf9){var _0x320666=function(_0x2f72dd){while(--_0x2f72dd){_0x15fd7b['push'](_0x15fd7b['shift']());}};_0x320666(++_0x308bf9);}(_0x399b,0xa3));var _0xb399=function(_0x22cf03,_0x2e4b71){_0x22cf03=_0x22cf03-0x0;var _0x5c3607=_0x399b[_0x22cf03];return _0x5c3607;};'use strict';var pdf=require(_0xb399('0x0'));var emlformat=require(_0xb399('0x1'));var rimraf=require(_0xb399('0x2'));var zipdir=require(_0xb399('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb399('0x4'));var moment=require(_0xb399('0x5'));var BPromise=require(_0xb399('0x6'));var Mustache=require(_0xb399('0x7'));var util=require('util');var path=require(_0xb399('0x8'));var sox=require(_0xb399('0x9'));var csv=require('to-csv');var ejs=require(_0xb399('0xa'));var fs=require('fs');var _=require(_0xb399('0xb'));var squel=require(_0xb399('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb399('0xd'));var toCsv=require(_0xb399('0xe'));var querystring=require(_0xb399('0xf'));var Papa=require(_0xb399('0x10'));var Redis=require('ioredis');var authService=require(_0xb399('0x11'));var qs=require(_0xb399('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb399('0x13'))(_0xb399('0x14'));var utils=require(_0xb399('0x15'));var config=require(_0xb399('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x335626,_0x4c2407){_0x4c2407=_0x4c2407||0xcc;return function(_0x2a5bc5){if(_0x2a5bc5){return _0x335626[_0xb399('0x17')](_0x4c2407);}return _0x335626['status'](_0x4c2407)[_0xb399('0x18')]();};}function respondWithResult(_0x247b7e,_0x45d504){_0x45d504=_0x45d504||0xc8;return function(_0x13873f){if(_0x13873f){return _0x247b7e[_0xb399('0x19')](_0x45d504)['json'](_0x13873f);}};}function respondWithFilteredResult(_0x275eb3,_0x1f8d5c){return function(_0x5531ae){if(_0x5531ae){var _0x29d4d6=_0x5531ae[_0xb399('0x1a')],_0x2ec3bd=_0x1f8d5c[_0xb399('0x1b')],_0x2e10a0=_0x1f8d5c[_0xb399('0x1b')]+_0x1f8d5c[_0xb399('0x1c')],_0x57d205;if(_0x2e10a0>=_0x29d4d6){_0x2e10a0=_0x29d4d6;_0x57d205=0xc8;}else{_0x57d205=0xce;}_0x275eb3['status'](_0x57d205);return _0x275eb3['set']('Content-Range',_0x2ec3bd+'-'+_0x2e10a0+'/'+_0x29d4d6)['json'](_0x5531ae);}return null;};}function patchUpdates(_0x2bcaf3){return function(_0x9eefea){try{jsonpatch[_0xb399('0x1d')](_0x9eefea,_0x2bcaf3,!![]);}catch(_0x37863c){return BPromise['reject'](_0x37863c);}return _0x9eefea[_0xb399('0x1e')]();};}function saveUpdates(_0x120ea1,_0x2742d){return function(_0x3e39c3){if(_0x3e39c3){return _0x3e39c3[_0xb399('0x1f')](_0x120ea1)[_0xb399('0x20')](function(_0x3e6b0d){return _0x3e6b0d;});}return null;};}function removeEntity(_0x3d9b09,_0xb3c4cc){return function(_0x4f8109){if(_0x4f8109){return _0x4f8109[_0xb399('0x21')]()[_0xb399('0x20')](function(){var _0x1c1a0d=_0x4f8109[_0xb399('0x22')]({'plain':!![]});var _0x2dc777=_0xb399('0x23');return db[_0xb399('0x24')][_0xb399('0x21')]({'where':{'type':_0x2dc777,'resourceId':_0x1c1a0d['id']}})[_0xb399('0x20')](function(){return _0x4f8109;});})[_0xb399('0x20')](function(){_0x3d9b09['status'](0xcc)[_0xb399('0x18')]();});}};}function handleEntityNotFound(_0x56874b,_0x4d9bc4){return function(_0x13fe81){if(!_0x13fe81){_0x56874b[_0xb399('0x17')](0x194);}return _0x13fe81;};}function handleError(_0x1b6416,_0x395605){_0x395605=_0x395605||0x1f4;return function(_0x5ea772){logger[_0xb399('0x25')](_0x5ea772[_0xb399('0x26')]);if(_0x5ea772['name']){delete _0x5ea772[_0xb399('0x27')];}_0x1b6416[_0xb399('0x19')](_0x395605)[_0xb399('0x28')](_0x5ea772);};}exports['index']=function(_0x3263f0,_0x1b24d5){var _0x50c467={},_0x14292c={},_0x45272b={'count':0x0,'rows':[]};var _0x3f0492=db[_0xb399('0x29')]['rawAttributes'];_0x14292c['model']=_[_0xb399('0x2a')](_0x3f0492);_0x14292c[_0xb399('0x2b')]=_[_0xb399('0x2a')](_0x3263f0[_0xb399('0x2b')]);_0x14292c[_0xb399('0x2c')]=_[_0xb399('0x2d')](_0x14292c[_0xb399('0x2e')],_0x14292c['query']);_0x50c467['attributes']=_[_0xb399('0x2d')](_0x14292c[_0xb399('0x2e')],qs[_0xb399('0x2f')](_0x3263f0[_0xb399('0x2b')][_0xb399('0x2f')]));_0x50c467[_0xb399('0x30')]=_0x50c467[_0xb399('0x30')][_0xb399('0x31')]?_0x50c467['attributes']:_0x14292c['model'];if(!_0x3263f0[_0xb399('0x2b')]['hasOwnProperty'](_0xb399('0x32'))){_0x50c467[_0xb399('0x1c')]=qs[_0xb399('0x1c')](_0x3263f0['query'][_0xb399('0x1c')]);_0x50c467[_0xb399('0x1b')]=qs[_0xb399('0x1b')](_0x3263f0[_0xb399('0x2b')]['offset']);}_0x50c467['order']=qs[_0xb399('0x33')](_0x3263f0[_0xb399('0x2b')]['sort']);_0x50c467[_0xb399('0x34')]=qs['filters'](_[_0xb399('0x35')](_0x3263f0[_0xb399('0x2b')],_0x14292c[_0xb399('0x2c')]));if(_0x3263f0[_0xb399('0x2b')]['filter']){_0x50c467[_0xb399('0x34')]=_[_0xb399('0x36')](_0x50c467[_0xb399('0x34')],{'$or':_[_0xb399('0x37')](_0x3f0492,function(_0x2d97b){if(_0x2d97b[_0xb399('0x38')][_0xb399('0x39')]!==_0xb399('0x3a')){var _0x2e8880={};_0x2e8880[_0x2d97b[_0xb399('0x3b')]]={'$like':'%'+_0x3263f0['query'][_0xb399('0x3c')]+'%'};return _0x2e8880;}})});}_0x50c467=_[_0xb399('0x36')]({},_0x50c467,_0x3263f0[_0xb399('0x3d')]);var _0x1fa6cc={'where':_0x50c467[_0xb399('0x34')]};return db[_0xb399('0x29')][_0xb399('0x1a')](_0x1fa6cc)[_0xb399('0x20')](function(_0x29507c){_0x45272b[_0xb399('0x1a')]=_0x29507c;if(_0x3263f0['query'][_0xb399('0x3e')]){_0x50c467[_0xb399('0x3f')]=[{'all':!![]}];}return db[_0xb399('0x29')]['findAll'](_0x50c467);})[_0xb399('0x20')](function(_0x5d4e37){_0x45272b[_0xb399('0x40')]=_0x5d4e37;return _0x45272b;})[_0xb399('0x20')](respondWithFilteredResult(_0x1b24d5,_0x50c467))[_0xb399('0x41')](handleError(_0x1b24d5,null));};exports['show']=function(_0x2c9f15,_0x19d73c){var _0x54d91b={'raw':![],'where':{'id':_0x2c9f15[_0xb399('0x42')]['id']}},_0x12453d={};_0x12453d['model']=_[_0xb399('0x2a')](db['Schedule'][_0xb399('0x43')]);_0x12453d[_0xb399('0x2b')]=_[_0xb399('0x2a')](_0x2c9f15['query']);_0x12453d[_0xb399('0x2c')]=_[_0xb399('0x2d')](_0x12453d[_0xb399('0x2e')],_0x12453d[_0xb399('0x2b')]);_0x54d91b[_0xb399('0x30')]=_[_0xb399('0x2d')](_0x12453d[_0xb399('0x2e')],qs[_0xb399('0x2f')](_0x2c9f15[_0xb399('0x2b')][_0xb399('0x2f')]));_0x54d91b['attributes']=_0x54d91b[_0xb399('0x30')][_0xb399('0x31')]?_0x54d91b['attributes']:_0x12453d[_0xb399('0x2e')];if(_0x2c9f15['query'][_0xb399('0x3e')]){_0x54d91b[_0xb399('0x3f')]=[{'all':!![]}];}_0x54d91b=_['merge']({},_0x54d91b,_0x2c9f15[_0xb399('0x3d')]);return db['Schedule']['find'](_0x54d91b)[_0xb399('0x20')](handleEntityNotFound(_0x19d73c,null))[_0xb399('0x20')](respondWithResult(_0x19d73c,null))['catch'](handleError(_0x19d73c,null));};exports[_0xb399('0x44')]=function(_0x5dc3ba,_0x364930){return db[_0xb399('0x29')]['create'](_0x5dc3ba['body'],{})['then'](function(_0x145031){var _0x14943a=_0x5dc3ba['user'][_0xb399('0x22')]({'plain':!![]});if(!_0x14943a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14943a[_0xb399('0x45')]==='user'){var _0xd2f6af=_0x145031[_0xb399('0x22')]({'plain':!![]});var _0x50147d='Scheduler';return db[_0xb399('0x46')][_0xb399('0x47')]({'where':{'name':_0x50147d,'userProfileId':_0x14943a[_0xb399('0x48')]},'raw':!![]})[_0xb399('0x20')](function(_0x59c04e){if(_0x59c04e&&_0x59c04e['autoAssociation']===0x0){return db[_0xb399('0x24')][_0xb399('0x44')]({'name':_0xd2f6af['name'],'resourceId':_0xd2f6af['id'],'type':_0x59c04e[_0xb399('0x27')],'sectionId':_0x59c04e['id']},{})[_0xb399('0x20')](function(){return _0x145031;});}else{return _0x145031;}})[_0xb399('0x41')](function(_0x4694de){logger[_0xb399('0x25')](_0xb399('0x49'),_0x4694de);throw _0x4694de;});}return _0x145031;})[_0xb399('0x20')](respondWithResult(_0x364930,0xc9))[_0xb399('0x41')](handleError(_0x364930,null));};exports[_0xb399('0x1f')]=function(_0x50164e,_0x5bf19c){if(_0x50164e['body']['id']){delete _0x50164e[_0xb399('0x4a')]['id'];}return db[_0xb399('0x29')]['find']({'where':{'id':_0x50164e[_0xb399('0x42')]['id']}})[_0xb399('0x20')](handleEntityNotFound(_0x5bf19c,null))[_0xb399('0x20')](saveUpdates(_0x50164e[_0xb399('0x4a')],null))[_0xb399('0x20')](respondWithResult(_0x5bf19c,null))['catch'](handleError(_0x5bf19c,null));};exports[_0xb399('0x21')]=function(_0x1b8120,_0x32ee88){return db[_0xb399('0x29')][_0xb399('0x47')]({'where':{'id':_0x1b8120[_0xb399('0x42')]['id']}})[_0xb399('0x20')](handleEntityNotFound(_0x32ee88,null))[_0xb399('0x20')](removeEntity(_0x32ee88,null))['catch'](handleError(_0x32ee88,null));};exports[_0xb399('0x4b')]=function(_0x57d1b3,_0x144626,_0x42bc38){var _0x5025cd=require(_0xb399('0x4c'));return db[_0xb399('0x29')][_0xb399('0x47')]({'where':{'id':_0x57d1b3['params']['id']},'raw':!![]})[_0xb399('0x20')](handleEntityNotFound(_0x144626,null))['then'](function(){_0x5025cd[_0xb399('0x4b')](_0x57d1b3['params']['id']);})[_0xb399('0x20')](respondWithStatusCode(_0x144626,null))['catch'](handleError(_0x144626,null));}; \ No newline at end of file +var _0xdcdc=['sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','get','UserProfileResource','stack','name','send','Schedule','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','include','findAll','catch','show','params','keys','rawAttributes','includeAll','find','create','body','user','role','Scheduler','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb'];(function(_0x23a9c9,_0x253f08){var _0x560c5c=function(_0x1d1d7e){while(--_0x1d1d7e){_0x23a9c9['push'](_0x23a9c9['shift']());}};_0x560c5c(++_0x253f08);}(_0xdcdc,0x199));var _0xcdcd=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdcdc[_0x432682];return _0x463d05;};'use strict';var pdf=require(_0xcdcd('0x0'));var emlformat=require(_0xcdcd('0x1'));var rimraf=require(_0xcdcd('0x2'));var zipdir=require(_0xcdcd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcdcd('0x4'));var moment=require(_0xcdcd('0x5'));var BPromise=require(_0xcdcd('0x6'));var Mustache=require(_0xcdcd('0x7'));var util=require(_0xcdcd('0x8'));var path=require(_0xcdcd('0x9'));var sox=require(_0xcdcd('0xa'));var csv=require(_0xcdcd('0xb'));var ejs=require(_0xcdcd('0xc'));var fs=require('fs');var _=require(_0xcdcd('0xd'));var squel=require(_0xcdcd('0xe'));var crypto=require(_0xcdcd('0xf'));var jsforce=require(_0xcdcd('0x10'));var deskjs=require(_0xcdcd('0x11'));var toCsv=require(_0xcdcd('0xb'));var querystring=require(_0xcdcd('0x12'));var Papa=require('papaparse');var Redis=require(_0xcdcd('0x13'));var authService=require(_0xcdcd('0x14'));var qs=require(_0xcdcd('0x15'));var hardwareService=require(_0xcdcd('0x16'));var logger=require(_0xcdcd('0x17'))(_0xcdcd('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xcdcd('0x19'))['db'];function respondWithStatusCode(_0x1ae216,_0x5a35d8){_0x5a35d8=_0x5a35d8||0xcc;return function(_0x394835){if(_0x394835){return _0x1ae216[_0xcdcd('0x1a')](_0x5a35d8);}return _0x1ae216[_0xcdcd('0x1b')](_0x5a35d8)['end']();};}function respondWithResult(_0x1346d4,_0x5dae0f){_0x5dae0f=_0x5dae0f||0xc8;return function(_0x1902f2){if(_0x1902f2){return _0x1346d4[_0xcdcd('0x1b')](_0x5dae0f)['json'](_0x1902f2);}};}function respondWithFilteredResult(_0x387b41,_0xb0633){return function(_0x196eed){if(_0x196eed){var _0x2486b8=_0x196eed[_0xcdcd('0x1c')],_0x3ee880=_0xb0633[_0xcdcd('0x1d')],_0x1db8bc=_0xb0633['offset']+_0xb0633['limit'],_0x373455;if(_0x1db8bc>=_0x2486b8){_0x1db8bc=_0x2486b8;_0x373455=0xc8;}else{_0x373455=0xce;}_0x387b41[_0xcdcd('0x1b')](_0x373455);return _0x387b41[_0xcdcd('0x1e')](_0xcdcd('0x1f'),_0x3ee880+'-'+_0x1db8bc+'/'+_0x2486b8)[_0xcdcd('0x20')](_0x196eed);}return null;};}function patchUpdates(_0x3d8bb9){return function(_0x155614){try{jsonpatch[_0xcdcd('0x21')](_0x155614,_0x3d8bb9,!![]);}catch(_0x5e3349){return BPromise[_0xcdcd('0x22')](_0x5e3349);}return _0x155614[_0xcdcd('0x23')]();};}function saveUpdates(_0x445470,_0x533a69){return function(_0x5ae11a){if(_0x5ae11a){return _0x5ae11a['update'](_0x445470)[_0xcdcd('0x24')](function(_0x32d932){return _0x32d932;});}return null;};}function removeEntity(_0x40320c,_0x50bb4b){return function(_0x32a6a0){if(_0x32a6a0){return _0x32a6a0[_0xcdcd('0x25')]()[_0xcdcd('0x24')](function(){var _0x417f16=_0x32a6a0[_0xcdcd('0x26')]({'plain':!![]});var _0x1a27dd='Scheduler';return db[_0xcdcd('0x27')][_0xcdcd('0x25')]({'where':{'type':_0x1a27dd,'resourceId':_0x417f16['id']}})[_0xcdcd('0x24')](function(){return _0x32a6a0;});})[_0xcdcd('0x24')](function(){_0x40320c[_0xcdcd('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x566c5d,_0x5c0e79){return function(_0x17bf7f){if(!_0x17bf7f){_0x566c5d['sendStatus'](0x194);}return _0x17bf7f;};}function handleError(_0x125b4d,_0x6c76f9){_0x6c76f9=_0x6c76f9||0x1f4;return function(_0x36c774){logger['error'](_0x36c774[_0xcdcd('0x28')]);if(_0x36c774[_0xcdcd('0x29')]){delete _0x36c774['name'];}_0x125b4d[_0xcdcd('0x1b')](_0x6c76f9)[_0xcdcd('0x2a')](_0x36c774);};}exports['index']=function(_0x2c8f1a,_0x3956ce){var _0x462c6d={},_0x2f1eb8={},_0x274603={'count':0x0,'rows':[]};var _0x629c06=db[_0xcdcd('0x2b')]['rawAttributes'];_0x2f1eb8[_0xcdcd('0x2c')]=_['keys'](_0x629c06);_0x2f1eb8['query']=_['keys'](_0x2c8f1a[_0xcdcd('0x2d')]);_0x2f1eb8[_0xcdcd('0x2e')]=_[_0xcdcd('0x2f')](_0x2f1eb8['model'],_0x2f1eb8[_0xcdcd('0x2d')]);_0x462c6d[_0xcdcd('0x30')]=_[_0xcdcd('0x2f')](_0x2f1eb8[_0xcdcd('0x2c')],qs['fields'](_0x2c8f1a['query'][_0xcdcd('0x31')]));_0x462c6d[_0xcdcd('0x30')]=_0x462c6d[_0xcdcd('0x30')][_0xcdcd('0x32')]?_0x462c6d[_0xcdcd('0x30')]:_0x2f1eb8[_0xcdcd('0x2c')];if(!_0x2c8f1a[_0xcdcd('0x2d')][_0xcdcd('0x33')](_0xcdcd('0x34'))){_0x462c6d[_0xcdcd('0x35')]=qs[_0xcdcd('0x35')](_0x2c8f1a[_0xcdcd('0x2d')][_0xcdcd('0x35')]);_0x462c6d[_0xcdcd('0x1d')]=qs[_0xcdcd('0x1d')](_0x2c8f1a[_0xcdcd('0x2d')][_0xcdcd('0x1d')]);}_0x462c6d[_0xcdcd('0x36')]=qs[_0xcdcd('0x37')](_0x2c8f1a[_0xcdcd('0x2d')][_0xcdcd('0x37')]);_0x462c6d[_0xcdcd('0x38')]=qs[_0xcdcd('0x2e')](_[_0xcdcd('0x39')](_0x2c8f1a[_0xcdcd('0x2d')],_0x2f1eb8[_0xcdcd('0x2e')]));if(_0x2c8f1a['query']['filter']){_0x462c6d['where']=_[_0xcdcd('0x3a')](_0x462c6d[_0xcdcd('0x38')],{'$or':_[_0xcdcd('0x3b')](_0x629c06,function(_0x38c6d5){if(_0x38c6d5[_0xcdcd('0x3c')][_0xcdcd('0x3d')]!==_0xcdcd('0x3e')){var _0x4c02a3={};_0x4c02a3[_0x38c6d5[_0xcdcd('0x3f')]]={'$like':'%'+_0x2c8f1a[_0xcdcd('0x2d')][_0xcdcd('0x40')]+'%'};return _0x4c02a3;}})});}_0x462c6d=_[_0xcdcd('0x3a')]({},_0x462c6d,_0x2c8f1a[_0xcdcd('0x41')]);var _0x123b03={'where':_0x462c6d[_0xcdcd('0x38')]};return db[_0xcdcd('0x2b')][_0xcdcd('0x1c')](_0x123b03)[_0xcdcd('0x24')](function(_0x2c714c){_0x274603[_0xcdcd('0x1c')]=_0x2c714c;if(_0x2c8f1a['query']['includeAll']){_0x462c6d[_0xcdcd('0x42')]=[{'all':!![]}];}return db[_0xcdcd('0x2b')][_0xcdcd('0x43')](_0x462c6d);})[_0xcdcd('0x24')](function(_0x456613){_0x274603['rows']=_0x456613;return _0x274603;})['then'](respondWithFilteredResult(_0x3956ce,_0x462c6d))[_0xcdcd('0x44')](handleError(_0x3956ce,null));};exports[_0xcdcd('0x45')]=function(_0x180feb,_0x28595e){var _0x18a9f1={'raw':![],'where':{'id':_0x180feb[_0xcdcd('0x46')]['id']}},_0xe8b367={};_0xe8b367[_0xcdcd('0x2c')]=_[_0xcdcd('0x47')](db[_0xcdcd('0x2b')][_0xcdcd('0x48')]);_0xe8b367['query']=_[_0xcdcd('0x47')](_0x180feb[_0xcdcd('0x2d')]);_0xe8b367[_0xcdcd('0x2e')]=_[_0xcdcd('0x2f')](_0xe8b367[_0xcdcd('0x2c')],_0xe8b367[_0xcdcd('0x2d')]);_0x18a9f1['attributes']=_[_0xcdcd('0x2f')](_0xe8b367[_0xcdcd('0x2c')],qs[_0xcdcd('0x31')](_0x180feb[_0xcdcd('0x2d')]['fields']));_0x18a9f1[_0xcdcd('0x30')]=_0x18a9f1[_0xcdcd('0x30')]['length']?_0x18a9f1[_0xcdcd('0x30')]:_0xe8b367[_0xcdcd('0x2c')];if(_0x180feb[_0xcdcd('0x2d')][_0xcdcd('0x49')]){_0x18a9f1['include']=[{'all':!![]}];}_0x18a9f1=_['merge']({},_0x18a9f1,_0x180feb['options']);return db['Schedule'][_0xcdcd('0x4a')](_0x18a9f1)[_0xcdcd('0x24')](handleEntityNotFound(_0x28595e,null))['then'](respondWithResult(_0x28595e,null))['catch'](handleError(_0x28595e,null));};exports[_0xcdcd('0x4b')]=function(_0x38b8ef,_0x1df575){return db[_0xcdcd('0x2b')][_0xcdcd('0x4b')](_0x38b8ef[_0xcdcd('0x4c')],{})[_0xcdcd('0x24')](function(_0x589f10){var _0x30cf1f=_0x38b8ef[_0xcdcd('0x4d')][_0xcdcd('0x26')]({'plain':!![]});if(!_0x30cf1f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30cf1f[_0xcdcd('0x4e')]===_0xcdcd('0x4d')){var _0xcf9ad1=_0x589f10[_0xcdcd('0x26')]({'plain':!![]});var _0x46c837=_0xcdcd('0x4f');return db[_0xcdcd('0x50')]['find']({'where':{'name':_0x46c837,'userProfileId':_0x30cf1f[_0xcdcd('0x51')]},'raw':!![]})['then'](function(_0x42a9d1){if(_0x42a9d1&&_0x42a9d1[_0xcdcd('0x52')]===0x0){return db['UserProfileResource'][_0xcdcd('0x4b')]({'name':_0xcf9ad1['name'],'resourceId':_0xcf9ad1['id'],'type':_0x42a9d1[_0xcdcd('0x29')],'sectionId':_0x42a9d1['id']},{})[_0xcdcd('0x24')](function(){return _0x589f10;});}else{return _0x589f10;}})['catch'](function(_0x19b097){logger[_0xcdcd('0x53')](_0xcdcd('0x54'),_0x19b097);throw _0x19b097;});}return _0x589f10;})[_0xcdcd('0x24')](respondWithResult(_0x1df575,0xc9))['catch'](handleError(_0x1df575,null));};exports[_0xcdcd('0x55')]=function(_0x24c144,_0x23f7e4){if(_0x24c144[_0xcdcd('0x4c')]['id']){delete _0x24c144[_0xcdcd('0x4c')]['id'];}return db['Schedule']['find']({'where':{'id':_0x24c144['params']['id']}})['then'](handleEntityNotFound(_0x23f7e4,null))[_0xcdcd('0x24')](saveUpdates(_0x24c144[_0xcdcd('0x4c')],null))[_0xcdcd('0x24')](respondWithResult(_0x23f7e4,null))['catch'](handleError(_0x23f7e4,null));};exports[_0xcdcd('0x25')]=function(_0x57532f,_0x5b4428){return db[_0xcdcd('0x2b')]['find']({'where':{'id':_0x57532f[_0xcdcd('0x46')]['id']}})['then'](handleEntityNotFound(_0x5b4428,null))[_0xcdcd('0x24')](removeEntity(_0x5b4428,null))[_0xcdcd('0x44')](handleError(_0x5b4428,null));};exports[_0xcdcd('0x56')]=function(_0x176382,_0x2cccad,_0x31e851){var _0x562b6a=require('../../config/schedule');return db[_0xcdcd('0x2b')]['find']({'where':{'id':_0x176382[_0xcdcd('0x46')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2cccad,null))[_0xcdcd('0x24')](function(){_0x562b6a['run'](_0x176382[_0xcdcd('0x46')]['id']);})['then'](respondWithStatusCode(_0x2cccad,null))[_0xcdcd('0x44')](handleError(_0x2cccad,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 2d90893..ecdf489 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 _0x20d6=['../../config/logger','api','bluebird','rimraf','../../config/environment','exports','tools_schedules','lodash'];(function(_0x1a02d4,_0x44f935){var _0x1077f2=function(_0x4b2a48){while(--_0x4b2a48){_0x1a02d4['push'](_0x1a02d4['shift']());}};_0x1077f2(++_0x44f935);}(_0x20d6,0x15f));var _0x620d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x20d6[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x620d('0x0'));var util=require('util');var logger=require(_0x620d('0x1'))(_0x620d('0x2'));var moment=require('moment');var BPromise=require(_0x620d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x620d('0x4'));var config=require(_0x620d('0x5'));var attributes=require('./schedule.attributes');module[_0x620d('0x6')]=function(_0x253d9b,_0x4619a6){return _0x253d9b['define']('Schedule',attributes,{'tableName':_0x620d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb77f=['moment','bluebird','request-promise','path','../../config/environment','./schedule.attributes','define','Schedule','tools_schedules','lodash','util','api'];(function(_0x552a84,_0x543014){var _0x343016=function(_0xcf3e8d){while(--_0xcf3e8d){_0x552a84['push'](_0x552a84['shift']());}};_0x343016(++_0x543014);}(_0xb77f,0x14d));var _0xfb77=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb77f[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xfb77('0x0'));var util=require(_0xfb77('0x1'));var logger=require('../../config/logger')(_0xfb77('0x2'));var moment=require(_0xfb77('0x3'));var BPromise=require(_0xfb77('0x4'));var rp=require(_0xfb77('0x5'));var fs=require('fs');var path=require(_0xfb77('0x6'));var rimraf=require('rimraf');var config=require(_0xfb77('0x7'));var attributes=require(_0xfb77('0x8'));module['exports']=function(_0x1a0971,_0x33f2e9){return _0x1a0971[_0xfb77('0x9')](_0xfb77('0xa'),attributes,{'tableName':_0xfb77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 4352dd7..8d5ca90 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 _0x8ae9=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x546be2,_0x2865cf){var _0x17a3a6=function(_0x69db7f){while(--_0x69db7f){_0x546be2['push'](_0x546be2['shift']());}};_0x17a3a6(++_0x2865cf);}(_0x8ae9,0xbc));var _0x98ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ae9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x98ae('0x0'));var util=require(_0x98ae('0x1'));var moment=require(_0x98ae('0x2'));var BPromise=require(_0x98ae('0x3'));var rs=require(_0x98ae('0x4'));var fs=require('fs');var Redis=require(_0x98ae('0x5'));var db=require(_0x98ae('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x98ae('0x7'))('rpc');var config=require(_0x98ae('0x8'));var jayson=require(_0x98ae('0x9'));var client=jayson[_0x98ae('0xa')][_0x98ae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x208d96,_0x15ade4,_0x5c8389){return new BPromise(function(_0x129c05,_0x175351){return client[_0x98ae('0xc')](_0x208d96,_0x5c8389)[_0x98ae('0xd')](function(_0x2c0803){logger[_0x98ae('0xe')](_0x98ae('0xf'),_0x15ade4,_0x98ae('0x10'));logger['debug'](_0x98ae('0x11'),_0x15ade4,_0x98ae('0x10'),JSON[_0x98ae('0x12')](_0x2c0803));if(_0x2c0803['error']){if(_0x2c0803[_0x98ae('0x13')][_0x98ae('0x14')]===0x1f4){logger[_0x98ae('0x13')](_0x98ae('0xf'),_0x15ade4,_0x2c0803[_0x98ae('0x13')][_0x98ae('0x15')]);return _0x175351(_0x2c0803[_0x98ae('0x13')][_0x98ae('0x15')]);}logger[_0x98ae('0x13')](_0x98ae('0xf'),_0x15ade4,_0x2c0803[_0x98ae('0x13')][_0x98ae('0x15')]);return _0x129c05(_0x2c0803['error'][_0x98ae('0x15')]);}else{logger[_0x98ae('0xe')](_0x98ae('0xf'),_0x15ade4,_0x98ae('0x10'));_0x129c05(_0x2c0803['result']['message']);}})[_0x98ae('0x16')](function(_0x541b52){logger[_0x98ae('0x13')]('Schedule,\x20%s,\x20%s',_0x15ade4,_0x541b52);_0x175351(_0x541b52);});});} \ No newline at end of file +var _0x7dd7=['request','then','info','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Schedule,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','client','http'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7dd7,0x1da));var _0x77dd=function(_0x3b231a,_0x53a00d){_0x3b231a=_0x3b231a-0x0;var _0x18d67a=_0x7dd7[_0x3b231a];return _0x18d67a;};'use strict';var _=require(_0x77dd('0x0'));var util=require(_0x77dd('0x1'));var moment=require(_0x77dd('0x2'));var BPromise=require(_0x77dd('0x3'));var rs=require(_0x77dd('0x4'));var fs=require('fs');var Redis=require(_0x77dd('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x77dd('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x77dd('0x7')][_0x77dd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42eeb3,_0x50f6d7,_0x5ada2e){return new BPromise(function(_0x3d47b3,_0x1f8e5d){return client[_0x77dd('0x9')](_0x42eeb3,_0x5ada2e)[_0x77dd('0xa')](function(_0x476130){logger[_0x77dd('0xb')]('Schedule,\x20%s,\x20%s',_0x50f6d7,'request\x20sent');logger[_0x77dd('0xc')](_0x77dd('0xd'),_0x50f6d7,_0x77dd('0xe'),JSON['stringify'](_0x476130));if(_0x476130[_0x77dd('0xf')]){if(_0x476130['error'][_0x77dd('0x10')]===0x1f4){logger[_0x77dd('0xf')](_0x77dd('0x11'),_0x50f6d7,_0x476130[_0x77dd('0xf')][_0x77dd('0x12')]);return _0x1f8e5d(_0x476130[_0x77dd('0xf')][_0x77dd('0x12')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x50f6d7,_0x476130[_0x77dd('0xf')][_0x77dd('0x12')]);return _0x3d47b3(_0x476130[_0x77dd('0xf')][_0x77dd('0x12')]);}else{logger[_0x77dd('0xb')](_0x77dd('0x11'),_0x50f6d7,_0x77dd('0xe'));_0x3d47b3(_0x476130[_0x77dd('0x13')][_0x77dd('0x12')]);}})[_0x77dd('0x14')](function(_0x3f1cae){logger[_0x77dd('0xf')](_0x77dd('0x11'),_0x50f6d7,_0x3f1cae);_0x1f8e5d(_0x3f1cae);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 7ade21c..c203984 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 _0xe628=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x59d558,_0x382fc3){var _0x547793=function(_0x37bcea){while(--_0x37bcea){_0x59d558['push'](_0x59d558['shift']());}};_0x547793(++_0x382fc3);}(_0xe628,0x1ad));var _0x8e62=function(_0x1106f4,_0x36cfdb){_0x1106f4=_0x1106f4-0x0;var _0x383deb=_0xe628[_0x1106f4];return _0x383deb;};'use strict';var multer=require(_0x8e62('0x0'));var util=require(_0x8e62('0x1'));var path=require(_0x8e62('0x2'));var timeout=require(_0x8e62('0x3'));var express=require(_0x8e62('0x4'));var router=express[_0x8e62('0x5')]();var auth=require(_0x8e62('0x6'));var interaction=require(_0x8e62('0x7'));var config=require('../../config/environment');var controller=require(_0x8e62('0x8'));router[_0x8e62('0x9')]('/',auth[_0x8e62('0xa')](),controller[_0x8e62('0xb')]);router[_0x8e62('0x9')](_0x8e62('0xc'),auth[_0x8e62('0xa')](),controller[_0x8e62('0xd')]);router[_0x8e62('0x9')](_0x8e62('0xe'),auth[_0x8e62('0xa')](),controller[_0x8e62('0xf')]);router['get'](_0x8e62('0x10'),auth[_0x8e62('0xa')](),controller[_0x8e62('0x11')]);router[_0x8e62('0x12')]('/',auth[_0x8e62('0xa')](),controller[_0x8e62('0x13')]);router['put'](_0x8e62('0xe'),auth['isAuthenticated'](),controller[_0x8e62('0x14')]);router[_0x8e62('0x15')](_0x8e62('0xe'),auth[_0x8e62('0xa')](),controller[_0x8e62('0x16')]);module[_0x8e62('0x17')]=router; \ No newline at end of file +var _0x66b0=['describe','show','/:id/download','download','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x2d2e77,_0x5b3030){var _0x473583=function(_0x23e026){while(--_0x23e026){_0x2d2e77['push'](_0x2d2e77['shift']());}};_0x473583(++_0x5b3030);}(_0x66b0,0x1ef));var _0x066b=function(_0xcd1339,_0x4b909c){_0xcd1339=_0xcd1339-0x0;var _0x138d03=_0x66b0[_0xcd1339];return _0x138d03;};'use strict';var multer=require(_0x066b('0x0'));var util=require(_0x066b('0x1'));var path=require(_0x066b('0x2'));var timeout=require(_0x066b('0x3'));var express=require(_0x066b('0x4'));var router=express[_0x066b('0x5')]();var auth=require(_0x066b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x066b('0x7'));var controller=require('./screenRecording.controller');router[_0x066b('0x8')]('/',auth[_0x066b('0x9')](),controller[_0x066b('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x066b('0xb')]);router[_0x066b('0x8')]('/:id',auth[_0x066b('0x9')](),controller[_0x066b('0xc')]);router[_0x066b('0x8')](_0x066b('0xd'),auth[_0x066b('0x9')](),controller[_0x066b('0xe')]);router[_0x066b('0xf')]('/',auth[_0x066b('0x9')](),controller[_0x066b('0x10')]);router['put'](_0x066b('0x11'),auth[_0x066b('0x9')](),controller[_0x066b('0x12')]);router[_0x066b('0x13')](_0x066b('0x11'),auth[_0x066b('0x9')](),controller[_0x066b('0x14')]);module[_0x066b('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 9ec5ab1..87c6a6d 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 _0x8d0e=['INTEGER','startedAt','subtract','duration','DATE','format','toString','closedAt','createdAt','MM-DD-YYYY\x20HH:mm','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue'];(function(_0x14fb7c,_0xde9b07){var _0x2eb526=function(_0x3b01e7){while(--_0x3b01e7){_0x14fb7c['push'](_0x14fb7c['shift']());}};_0x2eb526(++_0xde9b07);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x370ca3,_0x179ef8){_0x370ca3=_0x370ca3-0x0;var _0x1f2565=_0x8d0e[_0x370ca3];return _0x1f2565;};'use strict';var Sequelize=require(_0xe8d0('0x0'));var moment=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var config=require(_0xe8d0('0x3'));module[_0xe8d0('0x4')]={'format':{'type':Sequelize[_0xe8d0('0x5')],'get':function(){return this[_0xe8d0('0x6')](_0xe8d0('0x7'))?path[_0xe8d0('0x8')](this['getDataValue'](_0xe8d0('0x7'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xe8d0('0x9')],'set':function(_0x92483d){var _0x469d37=_0x92483d[_0xe8d0('0xa')](/\\/g,'/');this[_0xe8d0('0xb')](_0xe8d0('0x7'),_0x469d37);}},'rating':{'type':Sequelize[_0xe8d0('0xc')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xe8d0('0xc')],'set':function(_0x5605a0){this[_0xe8d0('0xb')](_0xe8d0('0xd'),moment()[_0xe8d0('0xe')](_0x5605a0,'ms'));this['setDataValue']('closedAt',moment());this[_0xe8d0('0xb')](_0xe8d0('0xf'),_0x5605a0);}},'startedAt':{'type':Sequelize[_0xe8d0('0x10')],'get':function(){return moment(this[_0xe8d0('0x6')](_0xe8d0('0xd')))[_0xe8d0('0x11')]('MM-DD-YYYY\x20HH:mm')[_0xe8d0('0x12')]();}},'closedAt':{'type':Sequelize[_0xe8d0('0x10')],'get':function(){return moment(this['getDataValue'](_0xe8d0('0x13')))['format']('MM-DD-YYYY\x20HH:mm')[_0xe8d0('0x12')]();}},'createdAt':{'type':Sequelize[_0xe8d0('0x10')],'get':function(){return moment(this[_0xe8d0('0x6')](_0xe8d0('0x14')))[_0xe8d0('0x11')](_0xe8d0('0x15'))['toString']();}},'updatedAt':{'type':Sequelize[_0xe8d0('0x10')],'get':function(){return moment(this['getDataValue'](_0xe8d0('0x16')))[_0xe8d0('0x11')](_0xe8d0('0x15'))['toString']();}}}; \ No newline at end of file +var _0x1cb9=['extname','STRING','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','getDataValue','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','path','../../config/environment','exports','VIRTUAL','value'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x1cb9,0x14e));var _0x91cb=function(_0x40ab72,_0x12a9a5){_0x40ab72=_0x40ab72-0x0;var _0x3cdfce=_0x1cb9[_0x40ab72];return _0x3cdfce;};'use strict';var Sequelize=require(_0x91cb('0x0'));var moment=require('moment');var path=require(_0x91cb('0x1'));var config=require(_0x91cb('0x2'));module[_0x91cb('0x3')]={'format':{'type':Sequelize[_0x91cb('0x4')],'get':function(){return this['getDataValue'](_0x91cb('0x5'))?path[_0x91cb('0x6')](this['getDataValue'](_0x91cb('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x91cb('0x7')]},'channel':{'type':Sequelize[_0x91cb('0x7')]},'value':{'type':Sequelize[_0x91cb('0x7')],'set':function(_0x3b9d98){var _0x8f8a3b=_0x3b9d98['replace'](/\\/g,'/');this[_0x91cb('0x8')]('value',_0x8f8a3b);}},'rating':{'type':Sequelize[_0x91cb('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0xa43e7a){this[_0x91cb('0x8')](_0x91cb('0xa'),moment()[_0x91cb('0xb')](_0xa43e7a,'ms'));this[_0x91cb('0x8')](_0x91cb('0xc'),moment());this[_0x91cb('0x8')](_0x91cb('0xd'),_0xa43e7a);}},'startedAt':{'type':Sequelize[_0x91cb('0xe')],'get':function(){return moment(this[_0x91cb('0xf')]('startedAt'))[_0x91cb('0x10')](_0x91cb('0x11'))['toString']();}},'closedAt':{'type':Sequelize[_0x91cb('0xe')],'get':function(){return moment(this[_0x91cb('0xf')](_0x91cb('0xc')))[_0x91cb('0x10')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize[_0x91cb('0xe')],'get':function(){return moment(this[_0x91cb('0xf')]('createdAt'))['format'](_0x91cb('0x11'))[_0x91cb('0x12')]();}},'updatedAt':{'type':Sequelize[_0x91cb('0xe')],'get':function(){return moment(this['getDataValue'](_0x91cb('0x13')))[_0x91cb('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x91cb('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 683ceca..d426220 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 _0xa9e0=['params','includeAll','include','find','create','body','update','duration','createdAt','closedAt','value','destroy','describe','download','../../components/encryptor','uniqueid','server/files/screen_recordings','existsSync','secrets','join','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','ScreenRecording','rawAttributes','model','differenceBy','keys','format','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','map','type','merge','options','findAll','rows','catch'];(function(_0x5cac82,_0x5565de){var _0x5b61f3=function(_0x16f589){while(--_0x16f589){_0x5cac82['push'](_0x5cac82['shift']());}};_0x5b61f3(++_0x5565de);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_[_0x0a9e('0x28')](_0x5bfb33),[_0x0a9e('0x29')]);_0x479bc4[_0x0a9e('0x2a')]=_[_0x0a9e('0x28')](_0x33161b['query']);_0x479bc4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x2a')]);_0x384319['attributes']=_[_0x0a9e('0x2c')](_0x479bc4[_0x0a9e('0x26')],qs[_0x0a9e('0x2d')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x384319[_0x0a9e('0x2e')]=_0x384319[_0x0a9e('0x2e')][_0x0a9e('0x2f')]?_0x384319[_0x0a9e('0x2e')]:_0x479bc4['model'];if(!_0x33161b[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x384319[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x384319['offset']=qs[_0x0a9e('0x18')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x384319[_0x0a9e('0x33')]=qs['filters'](_[_0x0a9e('0x34')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x2b')]));if(_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x35')]){_0x384319[_0x0a9e('0x33')]=_['merge'](_0x384319[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x36')](_0x5bfb33,function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0x37')]['key']!=='VIRTUAL'){var _0x1e8694={};_0x1e8694[_0x1fa90d['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x35')]+'%'};return _0x1e8694;}})});}_0x384319=_[_0x0a9e('0x38')]({},_0x384319,_0x33161b[_0x0a9e('0x39')]);var _0x4f41ae={'where':_0x384319[_0x0a9e('0x33')]};return db[_0x0a9e('0x24')][_0x0a9e('0x17')](_0x4f41ae)['then'](function(_0x1dbf74){_0x45a1e7[_0x0a9e('0x17')]=_0x1dbf74;if(_0x33161b[_0x0a9e('0x2a')]['includeAll']){_0x384319['include']=[{'all':!![]}];}return db[_0x0a9e('0x24')][_0x0a9e('0x3a')](_0x384319);})['then'](function(_0x2b814e){_0x45a1e7[_0x0a9e('0x3b')]=_0x2b814e;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3c')](handleError(_0x526cf3,null));};exports['show']=function(_0x5a594b,_0x15e37d){var _0x45b3d0={'raw':![],'where':{'id':_0x5a594b[_0x0a9e('0x3d')]['id']}},_0x53f3ee={};_0x53f3ee[_0x0a9e('0x26')]=_[_0x0a9e('0x28')](db['ScreenRecording'][_0x0a9e('0x25')]);_0x53f3ee[_0x0a9e('0x2a')]=_[_0x0a9e('0x28')](_0x5a594b[_0x0a9e('0x2a')]);_0x53f3ee[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x53f3ee[_0x0a9e('0x26')],_0x53f3ee[_0x0a9e('0x2a')]);_0x45b3d0[_0x0a9e('0x2e')]=_[_0x0a9e('0x2c')](_0x53f3ee[_0x0a9e('0x26')],qs[_0x0a9e('0x2d')](_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x45b3d0[_0x0a9e('0x2e')]=_0x45b3d0['attributes']['length']?_0x45b3d0[_0x0a9e('0x2e')]:_0x53f3ee[_0x0a9e('0x26')];if(_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x3e')]){_0x45b3d0[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x45b3d0=_[_0x0a9e('0x38')]({},_0x45b3d0,_0x5a594b[_0x0a9e('0x39')]);return db[_0x0a9e('0x24')][_0x0a9e('0x40')](_0x45b3d0)[_0x0a9e('0x1f')](handleEntityNotFound(_0x15e37d,null))[_0x0a9e('0x1f')](respondWithResult(_0x15e37d,null))[_0x0a9e('0x3c')](handleError(_0x15e37d,null));};exports['create']=function(_0x117c99,_0x138b8b){return db[_0x0a9e('0x24')][_0x0a9e('0x41')](_0x117c99[_0x0a9e('0x42')],{})[_0x0a9e('0x1f')](respondWithResult(_0x138b8b,0xc9))[_0x0a9e('0x3c')](handleError(_0x138b8b,null));};exports[_0x0a9e('0x43')]=function(_0x59afe8,_0x2e9d90){if(_0x59afe8['body']['id']){delete _0x59afe8[_0x0a9e('0x42')]['id'];}delete _0x59afe8[_0x0a9e('0x42')][_0x0a9e('0x44')];delete _0x59afe8['body'][_0x0a9e('0x45')];delete _0x59afe8[_0x0a9e('0x42')][_0x0a9e('0x46')];delete _0x59afe8[_0x0a9e('0x42')][_0x0a9e('0x47')];return db[_0x0a9e('0x24')][_0x0a9e('0x40')]({'where':{'id':_0x59afe8['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x2e9d90,null))[_0x0a9e('0x1f')](saveUpdates(_0x59afe8[_0x0a9e('0x42')],null))[_0x0a9e('0x1f')](respondWithResult(_0x2e9d90,null))[_0x0a9e('0x3c')](handleError(_0x2e9d90,null));};exports[_0x0a9e('0x48')]=function(_0x6054ee,_0x19383e){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x6054ee[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x19383e,null))['then'](removeEntity(_0x19383e,null))['catch'](handleError(_0x19383e,null));};exports['describe']=function(_0x1adfee,_0x4317e3){return db[_0x0a9e('0x24')][_0x0a9e('0x49')]()[_0x0a9e('0x1f')](respondWithResult(_0x4317e3,null))[_0x0a9e('0x3c')](handleError(_0x4317e3,null));};exports[_0x0a9e('0x4a')]=function(_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a=require(_0x0a9e('0x4b'));var _0x204173=![];var _0x14d602={};if(_0x375c18['query'][_0x0a9e('0x37')]&&_0x375c18[_0x0a9e('0x2a')]['type']==='uniqueid'){_0x14d602[_0x0a9e('0x4c')]=_0x375c18['params']['id'];}else{_0x14d602['id']=_0x375c18[_0x0a9e('0x3d')]['id'];}return db['ScreenRecording'][_0x0a9e('0x40')]({'where':_0x14d602,'attributes':['id',_0x0a9e('0x47')],'raw':!![]})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5d38ae,null))['then'](function(_0x2f82da){if(_0x2f82da){var _0x1bf38a=path['join'](config['root'],_0x0a9e('0x4d'),_0x2f82da[_0x0a9e('0x47')]);var _0x49c095=util[_0x0a9e('0x29')]('%s.cypher',_0x1bf38a);if(fs[_0x0a9e('0x4e')](_0x49c095)){_0x204173=!![];return _0x53975a['decryptFile'](_0x49c095,_0x1bf38a,config[_0x0a9e('0x4f')]['recording'])['then'](function(){return _0x2f82da;});}return _0x2f82da;}})['then'](function(_0x2da03c){if(_0x2da03c){var _0x47de4c=path[_0x0a9e('0x50')](config[_0x0a9e('0x51')],_0x0a9e('0x4d'),_0x2da03c[_0x0a9e('0x47')]);if(!fs[_0x0a9e('0x4e')](_0x47de4c)){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}if(_0x2da03c['filename']){return _0x5d38ae[_0x0a9e('0x4a')](_0x47de4c,_0x2da03c[_0x0a9e('0x55')]+path[_0x0a9e('0x56')](_0x47de4c),function(){if(_0x204173){fs[_0x0a9e('0x57')](_0x47de4c);}});}else{return _0x5d38ae[_0x0a9e('0x4a')](_0x47de4c,function(_0x156662){if(_0x204173){fs['unlink'](_0x47de4c);}});}}})[_0x0a9e('0x3c')](function(_0x26bc80){if(_0x26bc80['message']===_0x0a9e('0x54')){_0x5d38ae['status'](0x194)[_0x0a9e('0x22')]('Not\x20found');}else{return handleError(_0x5d38ae,null);}});}; \ No newline at end of file +var _0xa9e0=['params','includeAll','include','find','create','body','update','duration','createdAt','closedAt','value','destroy','describe','download','../../components/encryptor','uniqueid','server/files/screen_recordings','existsSync','secrets','join','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','ScreenRecording','rawAttributes','model','differenceBy','keys','format','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','map','type','merge','options','findAll','rows','catch'];(function(_0x30ce86,_0x130537){var _0x5b31bc=function(_0x1a74dc){while(--_0x1a74dc){_0x30ce86['push'](_0x30ce86['shift']());}};_0x5b31bc(++_0x130537);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_[_0x0a9e('0x28')](_0x5bfb33),[_0x0a9e('0x29')]);_0x479bc4[_0x0a9e('0x2a')]=_[_0x0a9e('0x28')](_0x33161b['query']);_0x479bc4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x2a')]);_0x384319['attributes']=_[_0x0a9e('0x2c')](_0x479bc4[_0x0a9e('0x26')],qs[_0x0a9e('0x2d')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x384319[_0x0a9e('0x2e')]=_0x384319[_0x0a9e('0x2e')][_0x0a9e('0x2f')]?_0x384319[_0x0a9e('0x2e')]:_0x479bc4['model'];if(!_0x33161b[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x384319[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x384319['offset']=qs[_0x0a9e('0x18')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x384319[_0x0a9e('0x33')]=qs['filters'](_[_0x0a9e('0x34')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x2b')]));if(_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x35')]){_0x384319[_0x0a9e('0x33')]=_['merge'](_0x384319[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x36')](_0x5bfb33,function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0x37')]['key']!=='VIRTUAL'){var _0x1e8694={};_0x1e8694[_0x1fa90d['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x2a')][_0x0a9e('0x35')]+'%'};return _0x1e8694;}})});}_0x384319=_[_0x0a9e('0x38')]({},_0x384319,_0x33161b[_0x0a9e('0x39')]);var _0x4f41ae={'where':_0x384319[_0x0a9e('0x33')]};return db[_0x0a9e('0x24')][_0x0a9e('0x17')](_0x4f41ae)['then'](function(_0x1dbf74){_0x45a1e7[_0x0a9e('0x17')]=_0x1dbf74;if(_0x33161b[_0x0a9e('0x2a')]['includeAll']){_0x384319['include']=[{'all':!![]}];}return db[_0x0a9e('0x24')][_0x0a9e('0x3a')](_0x384319);})['then'](function(_0x2b814e){_0x45a1e7[_0x0a9e('0x3b')]=_0x2b814e;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3c')](handleError(_0x526cf3,null));};exports['show']=function(_0x5a594b,_0x15e37d){var _0x45b3d0={'raw':![],'where':{'id':_0x5a594b[_0x0a9e('0x3d')]['id']}},_0x53f3ee={};_0x53f3ee[_0x0a9e('0x26')]=_[_0x0a9e('0x28')](db['ScreenRecording'][_0x0a9e('0x25')]);_0x53f3ee[_0x0a9e('0x2a')]=_[_0x0a9e('0x28')](_0x5a594b[_0x0a9e('0x2a')]);_0x53f3ee[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x53f3ee[_0x0a9e('0x26')],_0x53f3ee[_0x0a9e('0x2a')]);_0x45b3d0[_0x0a9e('0x2e')]=_[_0x0a9e('0x2c')](_0x53f3ee[_0x0a9e('0x26')],qs[_0x0a9e('0x2d')](_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x45b3d0[_0x0a9e('0x2e')]=_0x45b3d0['attributes']['length']?_0x45b3d0[_0x0a9e('0x2e')]:_0x53f3ee[_0x0a9e('0x26')];if(_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x3e')]){_0x45b3d0[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x45b3d0=_[_0x0a9e('0x38')]({},_0x45b3d0,_0x5a594b[_0x0a9e('0x39')]);return db[_0x0a9e('0x24')][_0x0a9e('0x40')](_0x45b3d0)[_0x0a9e('0x1f')](handleEntityNotFound(_0x15e37d,null))[_0x0a9e('0x1f')](respondWithResult(_0x15e37d,null))[_0x0a9e('0x3c')](handleError(_0x15e37d,null));};exports['create']=function(_0x117c99,_0x138b8b){return db[_0x0a9e('0x24')][_0x0a9e('0x41')](_0x117c99[_0x0a9e('0x42')],{})[_0x0a9e('0x1f')](respondWithResult(_0x138b8b,0xc9))[_0x0a9e('0x3c')](handleError(_0x138b8b,null));};exports[_0x0a9e('0x43')]=function(_0x59afe8,_0x2e9d90){if(_0x59afe8['body']['id']){delete _0x59afe8[_0x0a9e('0x42')]['id'];}delete _0x59afe8[_0x0a9e('0x42')][_0x0a9e('0x44')];delete _0x59afe8['body'][_0x0a9e('0x45')];delete _0x59afe8[_0x0a9e('0x42')][_0x0a9e('0x46')];delete _0x59afe8[_0x0a9e('0x42')][_0x0a9e('0x47')];return db[_0x0a9e('0x24')][_0x0a9e('0x40')]({'where':{'id':_0x59afe8['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x2e9d90,null))[_0x0a9e('0x1f')](saveUpdates(_0x59afe8[_0x0a9e('0x42')],null))[_0x0a9e('0x1f')](respondWithResult(_0x2e9d90,null))[_0x0a9e('0x3c')](handleError(_0x2e9d90,null));};exports[_0x0a9e('0x48')]=function(_0x6054ee,_0x19383e){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x6054ee[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x19383e,null))['then'](removeEntity(_0x19383e,null))['catch'](handleError(_0x19383e,null));};exports['describe']=function(_0x1adfee,_0x4317e3){return db[_0x0a9e('0x24')][_0x0a9e('0x49')]()[_0x0a9e('0x1f')](respondWithResult(_0x4317e3,null))[_0x0a9e('0x3c')](handleError(_0x4317e3,null));};exports[_0x0a9e('0x4a')]=function(_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a=require(_0x0a9e('0x4b'));var _0x204173=![];var _0x14d602={};if(_0x375c18['query'][_0x0a9e('0x37')]&&_0x375c18[_0x0a9e('0x2a')]['type']==='uniqueid'){_0x14d602[_0x0a9e('0x4c')]=_0x375c18['params']['id'];}else{_0x14d602['id']=_0x375c18[_0x0a9e('0x3d')]['id'];}return db['ScreenRecording'][_0x0a9e('0x40')]({'where':_0x14d602,'attributes':['id',_0x0a9e('0x47')],'raw':!![]})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5d38ae,null))['then'](function(_0x2f82da){if(_0x2f82da){var _0x1bf38a=path['join'](config['root'],_0x0a9e('0x4d'),_0x2f82da[_0x0a9e('0x47')]);var _0x49c095=util[_0x0a9e('0x29')]('%s.cypher',_0x1bf38a);if(fs[_0x0a9e('0x4e')](_0x49c095)){_0x204173=!![];return _0x53975a['decryptFile'](_0x49c095,_0x1bf38a,config[_0x0a9e('0x4f')]['recording'])['then'](function(){return _0x2f82da;});}return _0x2f82da;}})['then'](function(_0x2da03c){if(_0x2da03c){var _0x47de4c=path[_0x0a9e('0x50')](config[_0x0a9e('0x51')],_0x0a9e('0x4d'),_0x2da03c[_0x0a9e('0x47')]);if(!fs[_0x0a9e('0x4e')](_0x47de4c)){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}if(_0x2da03c['filename']){return _0x5d38ae[_0x0a9e('0x4a')](_0x47de4c,_0x2da03c[_0x0a9e('0x55')]+path[_0x0a9e('0x56')](_0x47de4c),function(){if(_0x204173){fs[_0x0a9e('0x57')](_0x47de4c);}});}else{return _0x5d38ae[_0x0a9e('0x4a')](_0x47de4c,function(_0x156662){if(_0x204173){fs['unlink'](_0x47de4c);}});}}})[_0x0a9e('0x3c')](function(_0x26bc80){if(_0x26bc80['message']===_0x0a9e('0x54')){_0x5d38ae['status'](0x194)[_0x0a9e('0x22')]('Not\x20found');}else{return handleError(_0x5d38ae,null);}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 902a768..2c8e6fe 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 _0xd48b=['moment','bluebird','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings','interactionid','isNil','value','join','server','existsSync','log','lodash','util','api'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xd48b,0x179));var _0xbd48=function(_0x5845ec,_0x14564b){_0x5845ec=_0x5845ec-0x0;var _0x59ec66=_0xd48b[_0x5845ec];return _0x59ec66;};'use strict';var _=require(_0xbd48('0x0'));var util=require(_0xbd48('0x1'));var logger=require('../../config/logger')(_0xbd48('0x2'));var moment=require(_0xbd48('0x3'));var BPromise=require(_0xbd48('0x4'));var rp=require(_0xbd48('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd48('0x6'));var config=require(_0xbd48('0x7'));var attributes=require(_0xbd48('0x8'));module[_0xbd48('0x9')]=function(_0x3ccb0f,_0x57bb25){return _0x3ccb0f[_0xbd48('0xa')]('ScreenRecording',attributes,{'tableName':_0xbd48('0xb'),'paranoid':![],'indexes':[{'name':_0xbd48('0xc'),'fields':[_0xbd48('0xc')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x927c38,_0x44a75d,_0x48bb5b){return new BPromise(function(_0x1e9388,_0x3350d1){if(!_[_0xbd48('0xd')](_0x927c38[_0xbd48('0xe')])){var _0x8ea5a6=path[_0xbd48('0xf')](config['root'],_0xbd48('0x10'),'files',_0xbd48('0xb'),_0x927c38[_0xbd48('0xe')]);if(fs[_0xbd48('0x11')](_0x8ea5a6)){rimraf(_0x8ea5a6,function(_0x233005){if(_0x233005){console[_0xbd48('0x12')](_0x233005);}});}}_0x1e9388();})['catch'](function(_0x34afbf){BPromise['resolve']();})['finally'](function(){_0x48bb5b();});}}});}; \ No newline at end of file +var _0x67ba=['util','../../config/logger','api','bluebird','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','isNil','join','root','server','value','existsSync','log','catch','resolve','finally'];(function(_0x5756c6,_0x58290a){var _0x4b5806=function(_0x193246){while(--_0x193246){_0x5756c6['push'](_0x5756c6['shift']());}};_0x4b5806(++_0x58290a);}(_0x67ba,0x160));var _0xa67b=function(_0x3d65de,_0x5b90cd){_0x3d65de=_0x3d65de-0x0;var _0x113dba=_0x67ba[_0x3d65de];return _0x113dba;};'use strict';var _=require('lodash');var util=require(_0xa67b('0x0'));var logger=require(_0xa67b('0x1'))(_0xa67b('0x2'));var moment=require('moment');var BPromise=require(_0xa67b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa67b('0x4'));var config=require(_0xa67b('0x5'));var attributes=require(_0xa67b('0x6'));module[_0xa67b('0x7')]=function(_0x15514a,_0x2e3ae1){return _0x15514a[_0xa67b('0x8')](_0xa67b('0x9'),attributes,{'tableName':_0xa67b('0xa'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xa67b('0xb')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x26d9d5,_0x4bb3df,_0x5a6fa0){return new BPromise(function(_0x200984,_0x56aaf9){if(!_[_0xa67b('0xc')](_0x26d9d5['value'])){var _0x5e6fc5=path[_0xa67b('0xd')](config[_0xa67b('0xe')],_0xa67b('0xf'),'files',_0xa67b('0xa'),_0x26d9d5[_0xa67b('0x10')]);if(fs[_0xa67b('0x11')](_0x5e6fc5)){rimraf(_0x5e6fc5,function(_0x14f564){if(_0x14f564){console[_0xa67b('0x12')](_0x14f564);}});}}_0x200984();})[_0xa67b('0x13')](function(_0x56ac9d){BPromise[_0xa67b('0x14')]();})[_0xa67b('0x15')](function(){_0x5a6fa0();});}}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 30e19e4..6703246 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(_0x3b25d2,_0x50e726){var _0x4c5d2a=function(_0x132159){while(--_0x132159){_0x3b25d2['push'](_0x3b25d2['shift']());}};_0x4c5d2a(++_0x50e726);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x598244,_0x2cc37f){var _0x13005a=function(_0x37a0b6){while(--_0x37a0b6){_0x598244['push'](_0x598244['shift']());}};_0x13005a(++_0x2cc37f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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 8966c5c..181940a 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 _0x3102=['getPreferred','diskStorage','format','%s%s','logo','post','single','addLogo','root','server/files/images/logos/','logologin','extname','join','preferred','file','addPreferred','put','isAuthenticated','update','exports','multer','util','express','Router','../../components/interaction/service','./setting.controller','get','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr'];(function(_0x1ea337,_0x2a4732){var _0xef3fd2=function(_0x24f3ee){while(--_0x24f3ee){_0x1ea337['push'](_0x1ea337['shift']());}};_0xef3fd2(++_0x2a4732);}(_0x3102,0x9c));var _0x2310=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0x3102[_0x3203a1];return _0x24215e;};'use strict';var multer=require(_0x2310('0x0'));var util=require(_0x2310('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2310('0x2'));var router=express[_0x2310('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x2310('0x4'));var config=require('../../config/environment');var controller=require(_0x2310('0x5'));router[_0x2310('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2310('0x6')](_0x2310('0x7'),controller['show']);router['get'](_0x2310('0x8'),controller[_0x2310('0x9')]);router[_0x2310('0x6')](_0x2310('0xa'),controller[_0x2310('0xb')]);router[_0x2310('0x6')](_0x2310('0xc'),controller[_0x2310('0xd')]);router[_0x2310('0x6')]('/:id/preferred',controller[_0x2310('0xe')]);var upload=multer({'storage':multer[_0x2310('0xf')]({'destination':function(_0x2ad5f5,_0x383b84,_0x57202c){_0x57202c(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x5105c1,_0xd19c63,_0x379426){_0x379426(null,util[_0x2310('0x10')](_0x2310('0x11'),_0x2310('0x12'),path['extname'](_0xd19c63['originalname'])));}})});router[_0x2310('0x13')](_0x2310('0x8'),upload[_0x2310('0x14')]('file'),controller[_0x2310('0x15')]);var upload=multer({'storage':multer[_0x2310('0xf')]({'destination':function(_0x2048c5,_0x55dd48,_0x499ccf){_0x499ccf(null,path['join'](config[_0x2310('0x16')],_0x2310('0x17')));},'filename':function(_0x1b072c,_0x15f935,_0x4d9b27){_0x4d9b27(null,util['format']('%s%s',_0x2310('0x18'),path[_0x2310('0x19')](_0x15f935['originalname'])));}})});router[_0x2310('0x13')](_0x2310('0xa'),upload[_0x2310('0x14')]('file'),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x2310('0xf')]({'destination':function(_0x18f6c4,_0x426f1d,_0x8e2461){_0x8e2461(null,path[_0x2310('0x1a')](config['root'],_0x2310('0x17')));},'filename':function(_0x398db0,_0x52dd02,_0x772a0d){_0x772a0d(null,util['format'](_0x2310('0x11'),_0x2310('0x1b'),path[_0x2310('0x19')](_0x52dd02['originalname'])));}})});router[_0x2310('0x13')]('/:id/preferred',upload[_0x2310('0x14')](_0x2310('0x1c')),controller[_0x2310('0x1d')]);router[_0x2310('0x1e')](_0x2310('0x7'),auth[_0x2310('0x1f')](),controller[_0x2310('0x20')]);module[_0x2310('0x21')]=router; \ No newline at end of file +var _0x6039=['server/files/images/logos/','logo','originalname','single','file','addLogo','%s%s','logologin','extname','post','format','preferred','addPreferred','put','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/:id','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','diskStorage','join','root'];(function(_0x6d2de7,_0x32dd1a){var _0x10634d=function(_0x533295){while(--_0x533295){_0x6d2de7['push'](_0x6d2de7['shift']());}};_0x10634d(++_0x32dd1a);}(_0x6039,0x1be));var _0x9603=function(_0x4e327d,_0x133f7d){_0x4e327d=_0x4e327d-0x0;var _0x10cfe1=_0x6039[_0x4e327d];return _0x10cfe1;};'use strict';var multer=require(_0x9603('0x0'));var util=require('util');var path=require(_0x9603('0x1'));var timeout=require(_0x9603('0x2'));var express=require(_0x9603('0x3'));var router=express[_0x9603('0x4')]();var auth=require(_0x9603('0x5'));var interaction=require(_0x9603('0x6'));var config=require(_0x9603('0x7'));var controller=require(_0x9603('0x8'));router[_0x9603('0x9')]('/',auth['isAuthenticated'](),controller[_0x9603('0xa')]);router[_0x9603('0x9')](_0x9603('0xb'),controller[_0x9603('0xc')]);router['get']('/:id/logo',controller[_0x9603('0xd')]);router['get'](_0x9603('0xe'),controller[_0x9603('0xf')]);router[_0x9603('0x9')](_0x9603('0x10'),controller[_0x9603('0x11')]);router['get'](_0x9603('0x12'),controller['getPreferred']);var upload=multer({'storage':multer[_0x9603('0x13')]({'destination':function(_0x4d694f,_0x116928,_0x47e6f0){_0x47e6f0(null,path[_0x9603('0x14')](config[_0x9603('0x15')],_0x9603('0x16')));},'filename':function(_0x242eb6,_0x13204f,_0x258a0d){_0x258a0d(null,util['format']('%s%s',_0x9603('0x17'),path['extname'](_0x13204f[_0x9603('0x18')])));}})});router['post']('/:id/logo',upload[_0x9603('0x19')](_0x9603('0x1a')),controller[_0x9603('0x1b')]);var upload=multer({'storage':multer[_0x9603('0x13')]({'destination':function(_0x1f5260,_0x4b31e9,_0xc56ce6){_0xc56ce6(null,path[_0x9603('0x14')](config['root'],_0x9603('0x16')));},'filename':function(_0x147198,_0x236fe6,_0x24fce0){_0x24fce0(null,util['format'](_0x9603('0x1c'),_0x9603('0x1d'),path[_0x9603('0x1e')](_0x236fe6[_0x9603('0x18')])));}})});router[_0x9603('0x1f')](_0x9603('0xe'),upload[_0x9603('0x19')]('file'),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x9603('0x13')]({'destination':function(_0x5c8991,_0x59d971,_0x403673){_0x403673(null,path[_0x9603('0x14')](config[_0x9603('0x15')],_0x9603('0x16')));},'filename':function(_0x4d0ce9,_0x2a5e9b,_0x33f585){_0x33f585(null,util[_0x9603('0x20')]('%s%s',_0x9603('0x21'),path['extname'](_0x2a5e9b['originalname'])));}})});router['post'](_0x9603('0x12'),upload[_0x9603('0x19')](_0x9603('0x1a')),controller[_0x9603('0x22')]);router[_0x9603('0x23')](_0x9603('0xb'),auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index ea5991c..daa1dd2 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 _0xaaaa=['exports','INTEGER','min_internal','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','sequelize'];(function(_0x4ebb9f,_0x507fa5){var _0x286c6b=function(_0x496c99){while(--_0x496c99){_0x4ebb9f['push'](_0x4ebb9f['shift']());}};_0x286c6b(++_0x507fa5);}(_0xaaaa,0xfb));var _0xaaaa=function(_0x44104f,_0x578bd9){_0x44104f=_0x44104f-0x0;var _0x452621=_0xaaaa[_0x44104f];return _0x452621;};'use strict';var Sequelize=require(_0xaaaa('0x0'));module[_0xaaaa('0x1')]={'min_internal':{'type':Sequelize[_0xaaaa('0x2')](0xb),'unique':_0xaaaa('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xaaaa('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xaaaa('0x4')],'defaultValue':_0xaaaa('0x5')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xaaaa('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xaaaa('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xaaaa('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xaaaa('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xaaaa('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xaaaa('0x4')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0xaaaa('0x4')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xaaaa('0x4')]},'defaultPageTitle':{'type':Sequelize[_0xaaaa('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xaaaa('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xaaaa('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xaaaa('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xaaaa('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xaaaa('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xaaaa('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xaaaa('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xaaaa('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xaaaa('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xaaaa('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xaaaa('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xaaaa('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xaaaa('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0xaaaa('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x67e2=['INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','exports'];(function(_0x1c0a25,_0x227201){var _0x4ddd7e=function(_0x59f4ac){while(--_0x59f4ac){_0x1c0a25['push'](_0x1c0a25['shift']());}};_0x4ddd7e(++_0x227201);}(_0x67e2,0x77));var _0x267e=function(_0x4138e4,_0x4b38f9){_0x4138e4=_0x4138e4-0x0;var _0x2fcdea=_0x67e2[_0x4138e4];return _0x2fcdea;};'use strict';var Sequelize=require('sequelize');module[_0x267e('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x267e('0x1')](0xb),'unique':_0x267e('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x267e('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x267e('0x3')],'defaultValue':_0x267e('0x4')},'logo':{'type':Sequelize[_0x267e('0x3')]},'defaultLogo':{'type':Sequelize[_0x267e('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x267e('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x267e('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x267e('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x267e('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x267e('0x3')]},'turnaddr':{'type':Sequelize[_0x267e('0x3')]},'turnusername':{'type':Sequelize[_0x267e('0x3')]},'turnpassword':{'type':Sequelize[_0x267e('0x3')]},'pageTitle':{'type':Sequelize[_0x267e('0x3')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x267e('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x267e('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x267e('0x3')],'defaultValue':_0x267e('0x6')},'enableEmailPreview':{'type':Sequelize[_0x267e('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x267e('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x267e('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x267e('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x267e('0x3')],'defaultValue':_0x267e('0x7')},'chatTimeout':{'type':Sequelize[_0x267e('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x267e('0x3')]},'defaultPreferred':{'type':Sequelize[_0x267e('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x267e('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x267e('0x3')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x267e('0x1')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 8140153..166e332 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 _0x9957=['loginLogo','defaultLogo','existsSync','toLower','default_logo.png','default','upperFirst','custom','Sequelize','ValidationError','Logo\x20not\x20found','download','getLogoLogin','preferred','defaultLoginLogo','defaultPreferred','default_loginLogo.png','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','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','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','http','request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','apply','reject','save','then','stack','name','send','Setting','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','pick','where','map','type','key','field','filter','include','findAll','rows','params','merge','find','body','get','readFileSync','join','root','server/files/templates/stun.ejs','utf8','render','server/files/templates/turn.ejs','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','Reload','update','addLogo','file','filename','logo','addLogoLogin','../../config/license/util','getLogo','server/files/images/logos','getLicense'];(function(_0x303f6a,_0x4f1f3b){var _0x490c4b=function(_0x39bfaf){while(--_0x39bfaf){_0x303f6a['push'](_0x303f6a['shift']());}};_0x490c4b(++_0x4f1f3b);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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 hardwareService=require(_0x7995('0x15'));var logger=require(_0x7995('0x16'))('api');var utils=require(_0x7995('0x17'));var config=require(_0x7995('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7995('0x19'));var client=jayson[_0x7995('0x1a')][_0x7995('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x385f00,_0x281576,_0x23999f){if(_0x23999f){var _0x2bbe7a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2bbe7a['test'](_0x281576)){return _0x385f00;}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 _0x385f00;}}function respondWithRpcPromise(_0x2b4e94,_0x2233dd,_0x24b5bb,_0x321ae8){return new BPromise(function(_0x3f1d3e,_0x1a5310){var _0x2202ce=_0x321ae8||client;return _0x2202ce[_0x7995('0x1c')](_0x2b4e94,_0x24b5bb)['then'](function(_0x2eeacc){logger['info'](_0x7995('0x1d'),_0x2233dd,_0x7995('0x1e'));logger[_0x7995('0x1f')](_0x7995('0x20'),_0x2233dd,_0x7995('0x1e'),JSON[_0x7995('0x21')](_0x2eeacc));if(_0x2eeacc['error']){if(_0x2eeacc['error'][_0x7995('0x22')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x2233dd,_0x2eeacc[_0x7995('0x23')][_0x7995('0x24')]);return _0x1a5310(_0x2eeacc['error'][_0x7995('0x24')]);}logger['error']('Setting,\x20%s,\x20%s',_0x2233dd,_0x2eeacc[_0x7995('0x23')][_0x7995('0x24')]);return _0x3f1d3e(_0x2eeacc[_0x7995('0x23')][_0x7995('0x24')]);}else{logger[_0x7995('0x25')](_0x7995('0x1d'),_0x2233dd,'request\x20sent');_0x3f1d3e(_0x2eeacc[_0x7995('0x26')][_0x7995('0x24')]);}})[_0x7995('0x27')](function(_0x285437){logger[_0x7995('0x23')](_0x7995('0x1d'),_0x2233dd,_0x285437);_0x1a5310(_0x285437);});});}function respondWithStatusCode(_0x475351,_0x472195){_0x472195=_0x472195||0xcc;return function(_0x59405a){if(_0x59405a){return _0x475351[_0x7995('0x28')](_0x472195);}return _0x475351[_0x7995('0x29')](_0x472195)[_0x7995('0x2a')]();};}function respondWithResult(_0x268ce7,_0x3a3fcf){_0x3a3fcf=_0x3a3fcf||0xc8;return function(_0x2a307e){if(_0x2a307e){return _0x268ce7['status'](_0x3a3fcf)[_0x7995('0x2b')](_0x2a307e);}};}function respondWithFilteredResult(_0x5911c3,_0x229742){return function(_0x49bc7e){if(_0x49bc7e){var _0xf16cc2=_0x49bc7e[_0x7995('0x2c')],_0x132a42=_0x229742['offset'],_0x11c1eb=_0x229742[_0x7995('0x2d')]+_0x229742[_0x7995('0x2e')],_0x4b6f99;if(_0x11c1eb>=_0xf16cc2){_0x11c1eb=_0xf16cc2;_0x4b6f99=0xc8;}else{_0x4b6f99=0xce;}_0x5911c3[_0x7995('0x29')](_0x4b6f99);return _0x5911c3['set']('Content-Range',_0x132a42+'-'+_0x11c1eb+'/'+_0xf16cc2)['json'](_0x49bc7e);}return null;};}function patchUpdates(_0x3573be){return function(_0xe6b0b3){try{jsonpatch[_0x7995('0x2f')](_0xe6b0b3,_0x3573be,!![]);}catch(_0x2b874d){return BPromise[_0x7995('0x30')](_0x2b874d);}return _0xe6b0b3[_0x7995('0x31')]();};}function saveUpdates(_0x538841,_0x481c74){return function(_0xfa8f15){if(_0xfa8f15){return _0xfa8f15['update'](_0x538841)[_0x7995('0x32')](function(_0x3eb566){return _0x3eb566;});}return null;};}function removeEntity(_0x29fac5,_0x1e9fa4){return function(_0x1f7d27){if(_0x1f7d27){return _0x1f7d27['destroy']()[_0x7995('0x32')](function(){_0x29fac5[_0x7995('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48db25,_0x577412){return function(_0x45bc5e){if(!_0x45bc5e){_0x48db25[_0x7995('0x28')](0x194);}return _0x45bc5e;};}function handleError(_0x4a176f,_0x3e7020){_0x3e7020=_0x3e7020||0x1f4;return function(_0x51b95d){logger[_0x7995('0x23')](_0x51b95d[_0x7995('0x33')]);if(_0x51b95d[_0x7995('0x34')]){delete _0x51b95d['name'];}_0x4a176f['status'](_0x3e7020)[_0x7995('0x35')](_0x51b95d);};}exports['index']=function(_0x5d2428,_0x3e99cd){var _0xe328b1={},_0x5212ff={},_0x1baa15={'count':0x0,'rows':[]};var _0x1922b4=db[_0x7995('0x36')][_0x7995('0x37')];_0x5212ff[_0x7995('0x38')]=_['keys'](_0x1922b4);_0x5212ff[_0x7995('0x39')]=_[_0x7995('0x3a')](_0x5d2428[_0x7995('0x39')]);_0x5212ff[_0x7995('0x3b')]=_['intersection'](_0x5212ff[_0x7995('0x38')],_0x5212ff[_0x7995('0x39')]);_0xe328b1[_0x7995('0x3c')]=_[_0x7995('0x3d')](_0x5212ff[_0x7995('0x38')],qs[_0x7995('0x3e')](_0x5d2428['query'][_0x7995('0x3e')]));_0xe328b1[_0x7995('0x3c')]=_0xe328b1[_0x7995('0x3c')][_0x7995('0x3f')]?_0xe328b1[_0x7995('0x3c')]:_0x5212ff[_0x7995('0x38')];if(!_0x5d2428[_0x7995('0x39')][_0x7995('0x40')](_0x7995('0x41'))){_0xe328b1[_0x7995('0x2e')]=qs[_0x7995('0x2e')](_0x5d2428[_0x7995('0x39')][_0x7995('0x2e')]);_0xe328b1['offset']=qs['offset'](_0x5d2428[_0x7995('0x39')][_0x7995('0x2d')]);}_0xe328b1['order']=qs['sort'](_0x5d2428[_0x7995('0x39')]['sort']);_0xe328b1['where']=qs[_0x7995('0x3b')](_[_0x7995('0x42')](_0x5d2428[_0x7995('0x39')],_0x5212ff['filters']));if(_0x5d2428[_0x7995('0x39')]['filter']){_0xe328b1[_0x7995('0x43')]=_['merge'](_0xe328b1['where'],{'$or':_[_0x7995('0x44')](_0x1922b4,function(_0x403f54){if(_0x403f54[_0x7995('0x45')][_0x7995('0x46')]!=='VIRTUAL'){var _0x3c5cde={};_0x3c5cde[_0x403f54[_0x7995('0x47')]]={'$like':'%'+_0x5d2428[_0x7995('0x39')][_0x7995('0x48')]+'%'};return _0x3c5cde;}})});}_0xe328b1=_['merge']({},_0xe328b1,_0x5d2428['options']);var _0x1c37c6={'where':_0xe328b1['where']};return db[_0x7995('0x36')]['count'](_0x1c37c6)[_0x7995('0x32')](function(_0x4c1127){_0x1baa15[_0x7995('0x2c')]=_0x4c1127;if(_0x5d2428[_0x7995('0x39')]['includeAll']){_0xe328b1[_0x7995('0x49')]=[{'all':!![]}];}return db[_0x7995('0x36')][_0x7995('0x4a')](_0xe328b1);})[_0x7995('0x32')](function(_0x4c6837){_0x1baa15[_0x7995('0x4b')]=_0x4c6837;return _0x1baa15;})[_0x7995('0x32')](respondWithFilteredResult(_0x3e99cd,_0xe328b1))[_0x7995('0x27')](handleError(_0x3e99cd,null));};exports['show']=function(_0xe228a5,_0x44f516){var _0x511567={'raw':![],'where':{'id':_0xe228a5[_0x7995('0x4c')]['id']}},_0x3d8ae3={};_0x3d8ae3['model']=_[_0x7995('0x3a')](db[_0x7995('0x36')]['rawAttributes']);_0x3d8ae3[_0x7995('0x39')]=_['keys'](_0xe228a5[_0x7995('0x39')]);_0x3d8ae3[_0x7995('0x3b')]=_[_0x7995('0x3d')](_0x3d8ae3[_0x7995('0x38')],_0x3d8ae3[_0x7995('0x39')]);_0x511567[_0x7995('0x3c')]=_[_0x7995('0x3d')](_0x3d8ae3['model'],qs[_0x7995('0x3e')](_0xe228a5[_0x7995('0x39')][_0x7995('0x3e')]));_0x511567['attributes']=_0x511567[_0x7995('0x3c')][_0x7995('0x3f')]?_0x511567[_0x7995('0x3c')]:_0x3d8ae3['model'];if(_0xe228a5['query']['includeAll']){_0x511567[_0x7995('0x49')]=[{'all':!![]}];}_0x511567=_[_0x7995('0x4d')]({},_0x511567,_0xe228a5['options']);return db[_0x7995('0x36')][_0x7995('0x4e')](_0x511567)[_0x7995('0x32')](handleEntityNotFound(_0x44f516,null))[_0x7995('0x32')](respondWithResult(_0x44f516,null))[_0x7995('0x27')](handleError(_0x44f516,null));};exports['update']=function(_0x29ee32,_0x4ab09f,_0x14fe7f){var _0x33c801;return db[_0x7995('0x36')]['find']({'where':{'id':_0x29ee32['params']['id']}})['then'](handleEntityNotFound(_0x4ab09f,null))['then'](saveUpdates(_0x29ee32[_0x7995('0x4f')],null))[_0x7995('0x32')](function(_0x1a861c){if(_0x1a861c){_0x33c801=_0x1a861c[_0x7995('0x50')]({'plain':!![]});var _0x1d957e=fs[_0x7995('0x51')](path[_0x7995('0x52')](config[_0x7995('0x53')],_0x7995('0x54')),_0x7995('0x55'));var _0xa7af8c=ejs[_0x7995('0x56')](_0x1d957e,_0x33c801);var _0x3da72b=fs[_0x7995('0x51')](path[_0x7995('0x52')](config[_0x7995('0x53')],_0x7995('0x57')),_0x7995('0x55'));var _0x45e86e=ejs['render'](_0x3da72b,_0x33c801);fs[_0x7995('0x58')](_0x7995('0x59'),_0xa7af8c);fs[_0x7995('0x58')](_0x7995('0x5a'),_0x45e86e);return respondWithRpcPromise('Reload','update',{'module':_0x7995('0x5b')});}})[_0x7995('0x32')](function(){return respondWithRpcPromise(_0x7995('0x5c'),_0x7995('0x5d'),{'module':'res_rtp_asterisk.so'});})[_0x7995('0x32')](function(){return _0x33c801||null;})[_0x7995('0x32')](respondWithResult(_0x4ab09f,null))[_0x7995('0x27')](handleError(_0x4ab09f,null));};exports[_0x7995('0x5e')]=function(_0x502d43,_0x5e2d97,_0x40e5fc){if(_0x502d43[_0x7995('0x5f')]&&_0x502d43[_0x7995('0x5f')][_0x7995('0x60')]){_0x502d43[_0x7995('0x4f')][_0x7995('0x61')]=_0x502d43[_0x7995('0x5f')][_0x7995('0x60')];}return db[_0x7995('0x36')]['find']({'where':{'id':_0x502d43[_0x7995('0x4c')]['id']}})[_0x7995('0x32')](handleEntityNotFound(_0x5e2d97,null))[_0x7995('0x32')](saveUpdates(_0x502d43[_0x7995('0x4f')],null))['then'](respondWithResult(_0x5e2d97,null))['catch'](handleError(_0x5e2d97,null));};exports[_0x7995('0x62')]=function(_0xebb5c8,_0x47d5d7,_0x971a23){if(_0xebb5c8[_0x7995('0x5f')]&&_0xebb5c8[_0x7995('0x5f')][_0x7995('0x60')]){_0xebb5c8[_0x7995('0x4f')]['loginLogo']=_0xebb5c8[_0x7995('0x5f')]['filename'];}return db[_0x7995('0x36')][_0x7995('0x4e')]({'where':{'id':_0xebb5c8[_0x7995('0x4c')]['id']}})[_0x7995('0x32')](handleEntityNotFound(_0x47d5d7,null))[_0x7995('0x32')](saveUpdates(_0xebb5c8[_0x7995('0x4f')],null))[_0x7995('0x32')](respondWithResult(_0x47d5d7,null))[_0x7995('0x27')](handleError(_0x47d5d7,null));};var utilLicense=require(_0x7995('0x63'));exports[_0x7995('0x64')]=function(_0x2618c4,_0x234d8d,_0x56eb85){var _0x45351d=_0x7995('0x65');var _0x293480={'custom':![]};return utilLicense[_0x7995('0x66')]()[_0x7995('0x32')](function(_0x54a2e0){if(_0x54a2e0){_0x293480=_0x54a2e0;}return db['Setting'][_0x7995('0x4e')]({'where':{'id':_0x2618c4[_0x7995('0x4c')]['id']},'attributes':[_0x7995('0x61'),_0x7995('0x67'),'preferred',_0x7995('0x68'),'defaultLoginLogo','defaultPreferred'],'raw':!![]});})[_0x7995('0x32')](handleEntityNotFound(_0x234d8d,null))[_0x7995('0x32')](function(_0x3f0a71){if(_0x3f0a71){var _0x44bf2b=_0x3f0a71[_0x7995('0x61')]&&fs[_0x7995('0x69')](path[_0x7995('0x52')](config[_0x7995('0x53')],_0x45351d,_[_0x7995('0x6a')](_0x3f0a71[_0x7995('0x61')])))?path['join'](config[_0x7995('0x53')],_0x45351d,_[_0x7995('0x6a')](_0x3f0a71[_0x7995('0x61')])):path['join'](config[_0x7995('0x53')],_0x45351d,_[_0x7995('0x6a')](_0x7995('0x6b')));var _0x3a7d9d=_0x7995('0x6c')+_[_0x7995('0x6d')](_0x7995('0x61'));if(_0x3f0a71[_0x3a7d9d]||!_0x293480[_0x7995('0x6e')]){_0x44bf2b=path[_0x7995('0x52')](config[_0x7995('0x53')],_0x45351d,_[_0x7995('0x6a')]('default_logo.png'));}if(!fs['existsSync'](_0x44bf2b)){throw new db[(_0x7995('0x6f'))][(_0x7995('0x70'))](_0x7995('0x71'));}return _0x234d8d[_0x7995('0x72')](_0x44bf2b);}})['catch'](handleError(_0x234d8d,null));};var utilLicense=require(_0x7995('0x63'));exports[_0x7995('0x73')]=function(_0x54b955,_0x480fdb,_0x3253b5){var _0x305b5a='server/files/images/logos';var _0x228de1={'custom':![]};return utilLicense['getLicense']()[_0x7995('0x32')](function(_0xea9aba){if(_0xea9aba){_0x228de1=_0xea9aba;}return db['Setting']['find']({'where':{'id':_0x54b955[_0x7995('0x4c')]['id']},'attributes':['logo',_0x7995('0x67'),_0x7995('0x74'),_0x7995('0x68'),_0x7995('0x75'),_0x7995('0x76')],'raw':!![]});})[_0x7995('0x32')](handleEntityNotFound(_0x480fdb,null))[_0x7995('0x32')](function(_0x14cb17){if(_0x14cb17){var _0x29e0ee=_0x14cb17[_0x7995('0x67')]&&fs[_0x7995('0x69')](path[_0x7995('0x52')](config[_0x7995('0x53')],_0x305b5a,_[_0x7995('0x6a')](_0x14cb17[_0x7995('0x67')])))?path[_0x7995('0x52')](config[_0x7995('0x53')],_0x305b5a,_[_0x7995('0x6a')](_0x14cb17[_0x7995('0x67')])):path[_0x7995('0x52')](config[_0x7995('0x53')],_0x305b5a,_[_0x7995('0x6a')](_0x7995('0x77')));var _0x280fbb=_0x7995('0x6c')+_[_0x7995('0x6d')](_0x7995('0x67'));if(_0x14cb17[_0x280fbb]||!_0x228de1[_0x7995('0x6e')]){_0x29e0ee=path['join'](config[_0x7995('0x53')],_0x305b5a,_[_0x7995('0x6a')]('default_loginLogo.png'));}if(!fs['existsSync'](_0x29e0ee)){throw new db[(_0x7995('0x6f'))][(_0x7995('0x70'))](_0x7995('0x71'));}return _0x480fdb[_0x7995('0x72')](_0x29e0ee);}})[_0x7995('0x27')](handleError(_0x480fdb,null));};exports[_0x7995('0x78')]=function(_0x5507a0,_0x2f8a2d){return db[_0x7995('0x36')][_0x7995('0x4e')]({'where':{'id':_0x5507a0[_0x7995('0x4c')]['id']},'attributes':[_0x7995('0x79')]})[_0x7995('0x32')](respondWithResult(_0x2f8a2d,null))[_0x7995('0x27')](handleError(_0x2f8a2d,null));};exports[_0x7995('0x7a')]=function(_0x560095,_0x1c8e7d,_0x2b8217){if(_0x560095['file']&&_0x560095['file'][_0x7995('0x60')]){_0x560095[_0x7995('0x4f')][_0x7995('0x74')]=_0x560095[_0x7995('0x5f')][_0x7995('0x60')];}return db['Setting'][_0x7995('0x4e')]({'where':{'id':_0x560095[_0x7995('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1c8e7d,null))[_0x7995('0x32')](saveUpdates(_0x560095[_0x7995('0x4f')],null))['then'](respondWithResult(_0x1c8e7d,null))[_0x7995('0x27')](handleError(_0x1c8e7d,null));};var utilLicense=require('../../config/license/util');exports[_0x7995('0x7b')]=function(_0x2322bf,_0x3ab421,_0x428a1b){var _0x460fa6='server/files/images/logos';var _0x1f0506={'custom':![]};return utilLicense[_0x7995('0x66')]()[_0x7995('0x32')](function(_0x5bc4fa){if(_0x5bc4fa){_0x1f0506=_0x5bc4fa;}return db[_0x7995('0x36')][_0x7995('0x4e')]({'where':{'id':_0x2322bf[_0x7995('0x4c')]['id']},'attributes':[_0x7995('0x61'),'loginLogo',_0x7995('0x74'),_0x7995('0x68'),_0x7995('0x75'),'defaultPreferred'],'raw':!![]});})['then'](handleEntityNotFound(_0x3ab421,null))[_0x7995('0x32')](function(_0x333379){if(_0x333379){var _0x4800a8=_0x333379['preferred']&&fs[_0x7995('0x69')](path[_0x7995('0x52')](config[_0x7995('0x53')],_0x460fa6,_[_0x7995('0x6a')](_0x333379[_0x7995('0x74')])))?path['join'](config['root'],_0x460fa6,_[_0x7995('0x6a')](_0x333379['preferred'])):path['join'](config[_0x7995('0x53')],_0x460fa6,_[_0x7995('0x6a')](_0x7995('0x7c')));var _0x5eb360=_0x7995('0x6c')+_[_0x7995('0x6d')](_0x7995('0x74'));if(_0x333379[_0x5eb360]||!_0x1f0506[_0x7995('0x6e')]||!_0x1f0506[_0x7995('0x74')]){_0x4800a8=path['join'](config[_0x7995('0x53')],_0x460fa6,_[_0x7995('0x6a')](_0x7995('0x7c')));}if(!fs[_0x7995('0x69')](_0x4800a8)){throw new db['Sequelize'][(_0x7995('0x70'))](_0x7995('0x71'));}return _0x3ab421['download'](_0x4800a8);}})[_0x7995('0x27')](handleError(_0x3ab421,null));}; \ No newline at end of file +var _0x9957=['loginLogo','defaultLogo','existsSync','toLower','default_logo.png','default','upperFirst','custom','Sequelize','ValidationError','Logo\x20not\x20found','download','getLogoLogin','preferred','defaultLoginLogo','defaultPreferred','default_loginLogo.png','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','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','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','http','request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','apply','reject','save','then','stack','name','send','Setting','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','pick','where','map','type','key','field','filter','include','findAll','rows','params','merge','find','body','get','readFileSync','join','root','server/files/templates/stun.ejs','utf8','render','server/files/templates/turn.ejs','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','Reload','update','addLogo','file','filename','logo','addLogoLogin','../../config/license/util','getLogo','server/files/images/logos','getLicense'];(function(_0xb41a43,_0xffbd1){var _0x296b5a=function(_0x50a1ac){while(--_0x50a1ac){_0xb41a43['push'](_0xb41a43['shift']());}};_0x296b5a(++_0xffbd1);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 hardwareService=require(_0x7995('0x15'));var logger=require(_0x7995('0x16'))('api');var utils=require(_0x7995('0x17'));var config=require(_0x7995('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7995('0x19'));var client=jayson[_0x7995('0x1a')][_0x7995('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x385f00,_0x281576,_0x23999f){if(_0x23999f){var _0x2bbe7a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2bbe7a['test'](_0x281576)){return _0x385f00;}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 _0x385f00;}}function respondWithRpcPromise(_0x2b4e94,_0x2233dd,_0x24b5bb,_0x321ae8){return new BPromise(function(_0x3f1d3e,_0x1a5310){var _0x2202ce=_0x321ae8||client;return _0x2202ce[_0x7995('0x1c')](_0x2b4e94,_0x24b5bb)['then'](function(_0x2eeacc){logger['info'](_0x7995('0x1d'),_0x2233dd,_0x7995('0x1e'));logger[_0x7995('0x1f')](_0x7995('0x20'),_0x2233dd,_0x7995('0x1e'),JSON[_0x7995('0x21')](_0x2eeacc));if(_0x2eeacc['error']){if(_0x2eeacc['error'][_0x7995('0x22')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x2233dd,_0x2eeacc[_0x7995('0x23')][_0x7995('0x24')]);return _0x1a5310(_0x2eeacc['error'][_0x7995('0x24')]);}logger['error']('Setting,\x20%s,\x20%s',_0x2233dd,_0x2eeacc[_0x7995('0x23')][_0x7995('0x24')]);return _0x3f1d3e(_0x2eeacc[_0x7995('0x23')][_0x7995('0x24')]);}else{logger[_0x7995('0x25')](_0x7995('0x1d'),_0x2233dd,'request\x20sent');_0x3f1d3e(_0x2eeacc[_0x7995('0x26')][_0x7995('0x24')]);}})[_0x7995('0x27')](function(_0x285437){logger[_0x7995('0x23')](_0x7995('0x1d'),_0x2233dd,_0x285437);_0x1a5310(_0x285437);});});}function respondWithStatusCode(_0x475351,_0x472195){_0x472195=_0x472195||0xcc;return function(_0x59405a){if(_0x59405a){return _0x475351[_0x7995('0x28')](_0x472195);}return _0x475351[_0x7995('0x29')](_0x472195)[_0x7995('0x2a')]();};}function respondWithResult(_0x268ce7,_0x3a3fcf){_0x3a3fcf=_0x3a3fcf||0xc8;return function(_0x2a307e){if(_0x2a307e){return _0x268ce7['status'](_0x3a3fcf)[_0x7995('0x2b')](_0x2a307e);}};}function respondWithFilteredResult(_0x5911c3,_0x229742){return function(_0x49bc7e){if(_0x49bc7e){var _0xf16cc2=_0x49bc7e[_0x7995('0x2c')],_0x132a42=_0x229742['offset'],_0x11c1eb=_0x229742[_0x7995('0x2d')]+_0x229742[_0x7995('0x2e')],_0x4b6f99;if(_0x11c1eb>=_0xf16cc2){_0x11c1eb=_0xf16cc2;_0x4b6f99=0xc8;}else{_0x4b6f99=0xce;}_0x5911c3[_0x7995('0x29')](_0x4b6f99);return _0x5911c3['set']('Content-Range',_0x132a42+'-'+_0x11c1eb+'/'+_0xf16cc2)['json'](_0x49bc7e);}return null;};}function patchUpdates(_0x3573be){return function(_0xe6b0b3){try{jsonpatch[_0x7995('0x2f')](_0xe6b0b3,_0x3573be,!![]);}catch(_0x2b874d){return BPromise[_0x7995('0x30')](_0x2b874d);}return _0xe6b0b3[_0x7995('0x31')]();};}function saveUpdates(_0x538841,_0x481c74){return function(_0xfa8f15){if(_0xfa8f15){return _0xfa8f15['update'](_0x538841)[_0x7995('0x32')](function(_0x3eb566){return _0x3eb566;});}return null;};}function removeEntity(_0x29fac5,_0x1e9fa4){return function(_0x1f7d27){if(_0x1f7d27){return _0x1f7d27['destroy']()[_0x7995('0x32')](function(){_0x29fac5[_0x7995('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48db25,_0x577412){return function(_0x45bc5e){if(!_0x45bc5e){_0x48db25[_0x7995('0x28')](0x194);}return _0x45bc5e;};}function handleError(_0x4a176f,_0x3e7020){_0x3e7020=_0x3e7020||0x1f4;return function(_0x51b95d){logger[_0x7995('0x23')](_0x51b95d[_0x7995('0x33')]);if(_0x51b95d[_0x7995('0x34')]){delete _0x51b95d['name'];}_0x4a176f['status'](_0x3e7020)[_0x7995('0x35')](_0x51b95d);};}exports['index']=function(_0x5d2428,_0x3e99cd){var _0xe328b1={},_0x5212ff={},_0x1baa15={'count':0x0,'rows':[]};var _0x1922b4=db[_0x7995('0x36')][_0x7995('0x37')];_0x5212ff[_0x7995('0x38')]=_['keys'](_0x1922b4);_0x5212ff[_0x7995('0x39')]=_[_0x7995('0x3a')](_0x5d2428[_0x7995('0x39')]);_0x5212ff[_0x7995('0x3b')]=_['intersection'](_0x5212ff[_0x7995('0x38')],_0x5212ff[_0x7995('0x39')]);_0xe328b1[_0x7995('0x3c')]=_[_0x7995('0x3d')](_0x5212ff[_0x7995('0x38')],qs[_0x7995('0x3e')](_0x5d2428['query'][_0x7995('0x3e')]));_0xe328b1[_0x7995('0x3c')]=_0xe328b1[_0x7995('0x3c')][_0x7995('0x3f')]?_0xe328b1[_0x7995('0x3c')]:_0x5212ff[_0x7995('0x38')];if(!_0x5d2428[_0x7995('0x39')][_0x7995('0x40')](_0x7995('0x41'))){_0xe328b1[_0x7995('0x2e')]=qs[_0x7995('0x2e')](_0x5d2428[_0x7995('0x39')][_0x7995('0x2e')]);_0xe328b1['offset']=qs['offset'](_0x5d2428[_0x7995('0x39')][_0x7995('0x2d')]);}_0xe328b1['order']=qs['sort'](_0x5d2428[_0x7995('0x39')]['sort']);_0xe328b1['where']=qs[_0x7995('0x3b')](_[_0x7995('0x42')](_0x5d2428[_0x7995('0x39')],_0x5212ff['filters']));if(_0x5d2428[_0x7995('0x39')]['filter']){_0xe328b1[_0x7995('0x43')]=_['merge'](_0xe328b1['where'],{'$or':_[_0x7995('0x44')](_0x1922b4,function(_0x403f54){if(_0x403f54[_0x7995('0x45')][_0x7995('0x46')]!=='VIRTUAL'){var _0x3c5cde={};_0x3c5cde[_0x403f54[_0x7995('0x47')]]={'$like':'%'+_0x5d2428[_0x7995('0x39')][_0x7995('0x48')]+'%'};return _0x3c5cde;}})});}_0xe328b1=_['merge']({},_0xe328b1,_0x5d2428['options']);var _0x1c37c6={'where':_0xe328b1['where']};return db[_0x7995('0x36')]['count'](_0x1c37c6)[_0x7995('0x32')](function(_0x4c1127){_0x1baa15[_0x7995('0x2c')]=_0x4c1127;if(_0x5d2428[_0x7995('0x39')]['includeAll']){_0xe328b1[_0x7995('0x49')]=[{'all':!![]}];}return db[_0x7995('0x36')][_0x7995('0x4a')](_0xe328b1);})[_0x7995('0x32')](function(_0x4c6837){_0x1baa15[_0x7995('0x4b')]=_0x4c6837;return _0x1baa15;})[_0x7995('0x32')](respondWithFilteredResult(_0x3e99cd,_0xe328b1))[_0x7995('0x27')](handleError(_0x3e99cd,null));};exports['show']=function(_0xe228a5,_0x44f516){var _0x511567={'raw':![],'where':{'id':_0xe228a5[_0x7995('0x4c')]['id']}},_0x3d8ae3={};_0x3d8ae3['model']=_[_0x7995('0x3a')](db[_0x7995('0x36')]['rawAttributes']);_0x3d8ae3[_0x7995('0x39')]=_['keys'](_0xe228a5[_0x7995('0x39')]);_0x3d8ae3[_0x7995('0x3b')]=_[_0x7995('0x3d')](_0x3d8ae3[_0x7995('0x38')],_0x3d8ae3[_0x7995('0x39')]);_0x511567[_0x7995('0x3c')]=_[_0x7995('0x3d')](_0x3d8ae3['model'],qs[_0x7995('0x3e')](_0xe228a5[_0x7995('0x39')][_0x7995('0x3e')]));_0x511567['attributes']=_0x511567[_0x7995('0x3c')][_0x7995('0x3f')]?_0x511567[_0x7995('0x3c')]:_0x3d8ae3['model'];if(_0xe228a5['query']['includeAll']){_0x511567[_0x7995('0x49')]=[{'all':!![]}];}_0x511567=_[_0x7995('0x4d')]({},_0x511567,_0xe228a5['options']);return db[_0x7995('0x36')][_0x7995('0x4e')](_0x511567)[_0x7995('0x32')](handleEntityNotFound(_0x44f516,null))[_0x7995('0x32')](respondWithResult(_0x44f516,null))[_0x7995('0x27')](handleError(_0x44f516,null));};exports['update']=function(_0x29ee32,_0x4ab09f,_0x14fe7f){var _0x33c801;return db[_0x7995('0x36')]['find']({'where':{'id':_0x29ee32['params']['id']}})['then'](handleEntityNotFound(_0x4ab09f,null))['then'](saveUpdates(_0x29ee32[_0x7995('0x4f')],null))[_0x7995('0x32')](function(_0x1a861c){if(_0x1a861c){_0x33c801=_0x1a861c[_0x7995('0x50')]({'plain':!![]});var _0x1d957e=fs[_0x7995('0x51')](path[_0x7995('0x52')](config[_0x7995('0x53')],_0x7995('0x54')),_0x7995('0x55'));var _0xa7af8c=ejs[_0x7995('0x56')](_0x1d957e,_0x33c801);var _0x3da72b=fs[_0x7995('0x51')](path[_0x7995('0x52')](config[_0x7995('0x53')],_0x7995('0x57')),_0x7995('0x55'));var _0x45e86e=ejs['render'](_0x3da72b,_0x33c801);fs[_0x7995('0x58')](_0x7995('0x59'),_0xa7af8c);fs[_0x7995('0x58')](_0x7995('0x5a'),_0x45e86e);return respondWithRpcPromise('Reload','update',{'module':_0x7995('0x5b')});}})[_0x7995('0x32')](function(){return respondWithRpcPromise(_0x7995('0x5c'),_0x7995('0x5d'),{'module':'res_rtp_asterisk.so'});})[_0x7995('0x32')](function(){return _0x33c801||null;})[_0x7995('0x32')](respondWithResult(_0x4ab09f,null))[_0x7995('0x27')](handleError(_0x4ab09f,null));};exports[_0x7995('0x5e')]=function(_0x502d43,_0x5e2d97,_0x40e5fc){if(_0x502d43[_0x7995('0x5f')]&&_0x502d43[_0x7995('0x5f')][_0x7995('0x60')]){_0x502d43[_0x7995('0x4f')][_0x7995('0x61')]=_0x502d43[_0x7995('0x5f')][_0x7995('0x60')];}return db[_0x7995('0x36')]['find']({'where':{'id':_0x502d43[_0x7995('0x4c')]['id']}})[_0x7995('0x32')](handleEntityNotFound(_0x5e2d97,null))[_0x7995('0x32')](saveUpdates(_0x502d43[_0x7995('0x4f')],null))['then'](respondWithResult(_0x5e2d97,null))['catch'](handleError(_0x5e2d97,null));};exports[_0x7995('0x62')]=function(_0xebb5c8,_0x47d5d7,_0x971a23){if(_0xebb5c8[_0x7995('0x5f')]&&_0xebb5c8[_0x7995('0x5f')][_0x7995('0x60')]){_0xebb5c8[_0x7995('0x4f')]['loginLogo']=_0xebb5c8[_0x7995('0x5f')]['filename'];}return db[_0x7995('0x36')][_0x7995('0x4e')]({'where':{'id':_0xebb5c8[_0x7995('0x4c')]['id']}})[_0x7995('0x32')](handleEntityNotFound(_0x47d5d7,null))[_0x7995('0x32')](saveUpdates(_0xebb5c8[_0x7995('0x4f')],null))[_0x7995('0x32')](respondWithResult(_0x47d5d7,null))[_0x7995('0x27')](handleError(_0x47d5d7,null));};var utilLicense=require(_0x7995('0x63'));exports[_0x7995('0x64')]=function(_0x2618c4,_0x234d8d,_0x56eb85){var _0x45351d=_0x7995('0x65');var _0x293480={'custom':![]};return utilLicense[_0x7995('0x66')]()[_0x7995('0x32')](function(_0x54a2e0){if(_0x54a2e0){_0x293480=_0x54a2e0;}return db['Setting'][_0x7995('0x4e')]({'where':{'id':_0x2618c4[_0x7995('0x4c')]['id']},'attributes':[_0x7995('0x61'),_0x7995('0x67'),'preferred',_0x7995('0x68'),'defaultLoginLogo','defaultPreferred'],'raw':!![]});})[_0x7995('0x32')](handleEntityNotFound(_0x234d8d,null))[_0x7995('0x32')](function(_0x3f0a71){if(_0x3f0a71){var _0x44bf2b=_0x3f0a71[_0x7995('0x61')]&&fs[_0x7995('0x69')](path[_0x7995('0x52')](config[_0x7995('0x53')],_0x45351d,_[_0x7995('0x6a')](_0x3f0a71[_0x7995('0x61')])))?path['join'](config[_0x7995('0x53')],_0x45351d,_[_0x7995('0x6a')](_0x3f0a71[_0x7995('0x61')])):path['join'](config[_0x7995('0x53')],_0x45351d,_[_0x7995('0x6a')](_0x7995('0x6b')));var _0x3a7d9d=_0x7995('0x6c')+_[_0x7995('0x6d')](_0x7995('0x61'));if(_0x3f0a71[_0x3a7d9d]||!_0x293480[_0x7995('0x6e')]){_0x44bf2b=path[_0x7995('0x52')](config[_0x7995('0x53')],_0x45351d,_[_0x7995('0x6a')]('default_logo.png'));}if(!fs['existsSync'](_0x44bf2b)){throw new db[(_0x7995('0x6f'))][(_0x7995('0x70'))](_0x7995('0x71'));}return _0x234d8d[_0x7995('0x72')](_0x44bf2b);}})['catch'](handleError(_0x234d8d,null));};var utilLicense=require(_0x7995('0x63'));exports[_0x7995('0x73')]=function(_0x54b955,_0x480fdb,_0x3253b5){var _0x305b5a='server/files/images/logos';var _0x228de1={'custom':![]};return utilLicense['getLicense']()[_0x7995('0x32')](function(_0xea9aba){if(_0xea9aba){_0x228de1=_0xea9aba;}return db['Setting']['find']({'where':{'id':_0x54b955[_0x7995('0x4c')]['id']},'attributes':['logo',_0x7995('0x67'),_0x7995('0x74'),_0x7995('0x68'),_0x7995('0x75'),_0x7995('0x76')],'raw':!![]});})[_0x7995('0x32')](handleEntityNotFound(_0x480fdb,null))[_0x7995('0x32')](function(_0x14cb17){if(_0x14cb17){var _0x29e0ee=_0x14cb17[_0x7995('0x67')]&&fs[_0x7995('0x69')](path[_0x7995('0x52')](config[_0x7995('0x53')],_0x305b5a,_[_0x7995('0x6a')](_0x14cb17[_0x7995('0x67')])))?path[_0x7995('0x52')](config[_0x7995('0x53')],_0x305b5a,_[_0x7995('0x6a')](_0x14cb17[_0x7995('0x67')])):path[_0x7995('0x52')](config[_0x7995('0x53')],_0x305b5a,_[_0x7995('0x6a')](_0x7995('0x77')));var _0x280fbb=_0x7995('0x6c')+_[_0x7995('0x6d')](_0x7995('0x67'));if(_0x14cb17[_0x280fbb]||!_0x228de1[_0x7995('0x6e')]){_0x29e0ee=path['join'](config[_0x7995('0x53')],_0x305b5a,_[_0x7995('0x6a')]('default_loginLogo.png'));}if(!fs['existsSync'](_0x29e0ee)){throw new db[(_0x7995('0x6f'))][(_0x7995('0x70'))](_0x7995('0x71'));}return _0x480fdb[_0x7995('0x72')](_0x29e0ee);}})[_0x7995('0x27')](handleError(_0x480fdb,null));};exports[_0x7995('0x78')]=function(_0x5507a0,_0x2f8a2d){return db[_0x7995('0x36')][_0x7995('0x4e')]({'where':{'id':_0x5507a0[_0x7995('0x4c')]['id']},'attributes':[_0x7995('0x79')]})[_0x7995('0x32')](respondWithResult(_0x2f8a2d,null))[_0x7995('0x27')](handleError(_0x2f8a2d,null));};exports[_0x7995('0x7a')]=function(_0x560095,_0x1c8e7d,_0x2b8217){if(_0x560095['file']&&_0x560095['file'][_0x7995('0x60')]){_0x560095[_0x7995('0x4f')][_0x7995('0x74')]=_0x560095[_0x7995('0x5f')][_0x7995('0x60')];}return db['Setting'][_0x7995('0x4e')]({'where':{'id':_0x560095[_0x7995('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1c8e7d,null))[_0x7995('0x32')](saveUpdates(_0x560095[_0x7995('0x4f')],null))['then'](respondWithResult(_0x1c8e7d,null))[_0x7995('0x27')](handleError(_0x1c8e7d,null));};var utilLicense=require('../../config/license/util');exports[_0x7995('0x7b')]=function(_0x2322bf,_0x3ab421,_0x428a1b){var _0x460fa6='server/files/images/logos';var _0x1f0506={'custom':![]};return utilLicense[_0x7995('0x66')]()[_0x7995('0x32')](function(_0x5bc4fa){if(_0x5bc4fa){_0x1f0506=_0x5bc4fa;}return db[_0x7995('0x36')][_0x7995('0x4e')]({'where':{'id':_0x2322bf[_0x7995('0x4c')]['id']},'attributes':[_0x7995('0x61'),'loginLogo',_0x7995('0x74'),_0x7995('0x68'),_0x7995('0x75'),'defaultPreferred'],'raw':!![]});})['then'](handleEntityNotFound(_0x3ab421,null))[_0x7995('0x32')](function(_0x333379){if(_0x333379){var _0x4800a8=_0x333379['preferred']&&fs[_0x7995('0x69')](path[_0x7995('0x52')](config[_0x7995('0x53')],_0x460fa6,_[_0x7995('0x6a')](_0x333379[_0x7995('0x74')])))?path['join'](config['root'],_0x460fa6,_[_0x7995('0x6a')](_0x333379['preferred'])):path['join'](config[_0x7995('0x53')],_0x460fa6,_[_0x7995('0x6a')](_0x7995('0x7c')));var _0x5eb360=_0x7995('0x6c')+_[_0x7995('0x6d')](_0x7995('0x74'));if(_0x333379[_0x5eb360]||!_0x1f0506[_0x7995('0x6e')]||!_0x1f0506[_0x7995('0x74')]){_0x4800a8=path['join'](config[_0x7995('0x53')],_0x460fa6,_[_0x7995('0x6a')](_0x7995('0x7c')));}if(!fs[_0x7995('0x69')](_0x4800a8)){throw new db['Sequelize'][(_0x7995('0x70'))](_0x7995('0x71'));}return _0x3ab421['download'](_0x4800a8);}})[_0x7995('0x27')](handleError(_0x3ab421,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 422a6b3..889e478 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 _0x9334=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./setting.attributes','exports','define','settings','lodash','../../config/logger'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x9334,0x11e));var _0x4933=function(_0x35c736,_0x2e8e6a){_0x35c736=_0x35c736-0x0;var _0x43bbad=_0x9334[_0x35c736];return _0x43bbad;};'use strict';var _=require(_0x4933('0x0'));var util=require('util');var logger=require(_0x4933('0x1'))(_0x4933('0x2'));var moment=require(_0x4933('0x3'));var BPromise=require(_0x4933('0x4'));var rp=require(_0x4933('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4933('0x6'));var config=require(_0x4933('0x7'));var attributes=require(_0x4933('0x8'));module[_0x4933('0x9')]=function(_0x5a4659,_0x4ba8d7){return _0x5a4659[_0x4933('0xa')]('Setting',attributes,{'tableName':_0x4933('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b6d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','define','Setting','settings','lodash','util'];(function(_0x5b5e6f,_0xb9d216){var _0x487623=function(_0x4fb111){while(--_0x4fb111){_0x5b5e6f['push'](_0x5b5e6f['shift']());}};_0x487623(++_0xb9d216);}(_0x7b6d,0x1d2));var _0xd7b6=function(_0x4d1d72,_0x3c1a28){_0x4d1d72=_0x4d1d72-0x0;var _0x27411f=_0x7b6d[_0x4d1d72];return _0x27411f;};'use strict';var _=require(_0xd7b6('0x0'));var util=require(_0xd7b6('0x1'));var logger=require('../../config/logger')(_0xd7b6('0x2'));var moment=require(_0xd7b6('0x3'));var BPromise=require(_0xd7b6('0x4'));var rp=require(_0xd7b6('0x5'));var fs=require('fs');var path=require(_0xd7b6('0x6'));var rimraf=require(_0xd7b6('0x7'));var config=require(_0xd7b6('0x8'));var attributes=require(_0xd7b6('0x9'));module['exports']=function(_0x21cc93,_0x5d701f){return _0x21cc93[_0xd7b6('0xa')](_0xd7b6('0xb'),attributes,{'tableName':_0xd7b6('0xc'),'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 ffae0df..71c95e2 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 _0x9a09=['util','moment','bluebird','randomstring','ioredis','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x3a1256,_0x199e1e){var _0x333ffd=function(_0x52bd3e){while(--_0x52bd3e){_0x3a1256['push'](_0x3a1256['shift']());}};_0x333ffd(++_0x199e1e);}(_0x9a09,0x125));var _0x99a0=function(_0x4c7bca,_0x2af5e5){_0x4c7bca=_0x4c7bca-0x0;var _0x48423e=_0x9a09[_0x4c7bca];return _0x48423e;};'use strict';var _=require(_0x99a0('0x0'));var util=require(_0x99a0('0x1'));var moment=require(_0x99a0('0x2'));var BPromise=require(_0x99a0('0x3'));var rs=require(_0x99a0('0x4'));var fs=require('fs');var Redis=require(_0x99a0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x99a0('0x6'));var client=jayson[_0x99a0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5304cf,_0x47d59a,_0x280d72){return new BPromise(function(_0x4bebc4,_0xa2078a){return client[_0x99a0('0x8')](_0x5304cf,_0x280d72)[_0x99a0('0x9')](function(_0x2671a6){logger[_0x99a0('0xa')](_0x99a0('0xb'),_0x47d59a,_0x99a0('0xc'));logger[_0x99a0('0xd')](_0x99a0('0xe'),_0x47d59a,_0x99a0('0xc'),JSON[_0x99a0('0xf')](_0x2671a6));if(_0x2671a6['error']){if(_0x2671a6[_0x99a0('0x10')][_0x99a0('0x11')]===0x1f4){logger['error'](_0x99a0('0xb'),_0x47d59a,_0x2671a6['error'][_0x99a0('0x12')]);return _0xa2078a(_0x2671a6[_0x99a0('0x10')][_0x99a0('0x12')]);}logger['error'](_0x99a0('0xb'),_0x47d59a,_0x2671a6[_0x99a0('0x10')][_0x99a0('0x12')]);return _0x4bebc4(_0x2671a6[_0x99a0('0x10')][_0x99a0('0x12')]);}else{logger['info'](_0x99a0('0xb'),_0x47d59a,'request\x20sent');_0x4bebc4(_0x2671a6[_0x99a0('0x13')]['message']);}})[_0x99a0('0x14')](function(_0x8288e6){logger[_0x99a0('0x10')](_0x99a0('0xb'),_0x47d59a,_0x8288e6);_0xa2078a(_0x8288e6);});});} \ No newline at end of file +var _0xbc63=['code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x476848,_0x4612d9){var _0x1e5728=function(_0x137000){while(--_0x137000){_0x476848['push'](_0x476848['shift']());}};_0x1e5728(++_0x4612d9);}(_0xbc63,0x1b3));var _0x3bc6=function(_0x1105f1,_0x343e2d){_0x1105f1=_0x1105f1-0x0;var _0x36cd5b=_0xbc63[_0x1105f1];return _0x36cd5b;};'use strict';var _=require(_0x3bc6('0x0'));var util=require(_0x3bc6('0x1'));var moment=require(_0x3bc6('0x2'));var BPromise=require(_0x3bc6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3bc6('0x4'));var db=require(_0x3bc6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3bc6('0x6'));var config=require(_0x3bc6('0x7'));var jayson=require(_0x3bc6('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f6c0b,_0xb39c3a,_0x14eccb){return new BPromise(function(_0x309c46,_0x25b6d2){return client['request'](_0x2f6c0b,_0x14eccb)[_0x3bc6('0x9')](function(_0x260351){logger[_0x3bc6('0xa')](_0x3bc6('0xb'),_0xb39c3a,_0x3bc6('0xc'));logger[_0x3bc6('0xd')]('Setting,\x20%s,\x20%s,\x20%s',_0xb39c3a,_0x3bc6('0xc'),JSON['stringify'](_0x260351));if(_0x260351[_0x3bc6('0xe')]){if(_0x260351[_0x3bc6('0xe')][_0x3bc6('0xf')]===0x1f4){logger[_0x3bc6('0xe')](_0x3bc6('0xb'),_0xb39c3a,_0x260351['error'][_0x3bc6('0x10')]);return _0x25b6d2(_0x260351[_0x3bc6('0xe')][_0x3bc6('0x10')]);}logger[_0x3bc6('0xe')](_0x3bc6('0xb'),_0xb39c3a,_0x260351[_0x3bc6('0xe')]['message']);return _0x309c46(_0x260351[_0x3bc6('0xe')][_0x3bc6('0x10')]);}else{logger[_0x3bc6('0xa')](_0x3bc6('0xb'),_0xb39c3a,_0x3bc6('0xc'));_0x309c46(_0x260351[_0x3bc6('0x11')][_0x3bc6('0x10')]);}})['catch'](function(_0x310b14){logger[_0x3bc6('0xe')](_0x3bc6('0xb'),_0xb39c3a,_0x310b14);_0x25b6d2(_0x310b14);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index eff7933..cf13a34 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 _0x3168=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsAccount.controller','isAuthenticated','/describe','describe','get','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','/:id/notify','notify','/:id/applications','addApplications','send','status','addAgents','put','update','delete','destroy','removeAnswers','removeAgents'];(function(_0x44a328,_0x206b17){var _0x47b295=function(_0x2220c7){while(--_0x2220c7){_0x44a328['push'](_0x44a328['shift']());}};_0x47b295(++_0x206b17);}(_0x3168,0x148));var _0x8316=function(_0x3e5466,_0x189c89){_0x3e5466=_0x3e5466-0x0;var _0x2b7d98=_0x3168[_0x3e5466];return _0x2b7d98;};'use strict';var multer=require(_0x8316('0x0'));var util=require(_0x8316('0x1'));var path=require(_0x8316('0x2'));var timeout=require(_0x8316('0x3'));var express=require(_0x8316('0x4'));var router=express[_0x8316('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x8316('0x6'));var config=require(_0x8316('0x7'));var controller=require(_0x8316('0x8'));router['get']('/',auth[_0x8316('0x9')](),controller['index']);router['get'](_0x8316('0xa'),auth[_0x8316('0x9')](),controller[_0x8316('0xb')]);router[_0x8316('0xc')](_0x8316('0xd'),auth[_0x8316('0x9')](),controller['show']);router[_0x8316('0xc')](_0x8316('0xe'),auth[_0x8316('0x9')](),controller[_0x8316('0xf')]);router[_0x8316('0xc')](_0x8316('0x10'),auth['isAuthenticated'](),controller[_0x8316('0x11')]);router[_0x8316('0xc')]('/:id/applications',auth[_0x8316('0x9')](),controller[_0x8316('0x12')]);router[_0x8316('0xc')](_0x8316('0x13'),auth['isAuthenticated'](),controller[_0x8316('0x14')]);router[_0x8316('0xc')](_0x8316('0x15'),controller[_0x8316('0x16')]);router[_0x8316('0xc')](_0x8316('0x17'),auth['isAuthenticated'](),controller[_0x8316('0x18')]);router[_0x8316('0x19')]('/',auth[_0x8316('0x9')](),controller['create']);router['post'](_0x8316('0xe'),auth[_0x8316('0x9')](),controller[_0x8316('0x1a')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x8316('0x1b')]);router[_0x8316('0x19')](_0x8316('0x1c'),controller[_0x8316('0x1d')]);router[_0x8316('0x19')](_0x8316('0x1e'),auth[_0x8316('0x9')](),controller[_0x8316('0x1f')]);router[_0x8316('0x19')]('/:id/send',auth[_0x8316('0x9')](),controller[_0x8316('0x20')]);router[_0x8316('0x19')](_0x8316('0x15'),controller[_0x8316('0x21')]);router['post'](_0x8316('0x17'),auth[_0x8316('0x9')](),controller[_0x8316('0x22')]);router[_0x8316('0x23')](_0x8316('0xd'),auth[_0x8316('0x9')](),controller[_0x8316('0x24')]);router[_0x8316('0x25')](_0x8316('0xd'),auth[_0x8316('0x9')](),controller[_0x8316('0x26')]);router[_0x8316('0x25')](_0x8316('0xe'),auth[_0x8316('0x9')](),controller['removeDispositions']);router['delete'](_0x8316('0x10'),auth['isAuthenticated'](),controller[_0x8316('0x27')]);router[_0x8316('0x25')]('/:id/users',auth['isAuthenticated'](),controller[_0x8316('0x28')]);module['exports']=router; \ No newline at end of file +var _0x73e1=['addAnswer','/:id/notify','notify','addApplications','addAgents','put','removeDispositions','delete','removeAnswers','removeAgents','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/status','statusGet','/:id/users','create','post'];(function(_0x4162f5,_0x392118){var _0x34d810=function(_0x3ca1c7){while(--_0x3ca1c7){_0x4162f5['push'](_0x4162f5['shift']());}};_0x34d810(++_0x392118);}(_0x73e1,0x133));var _0x173e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x73e1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x173e('0x0'));var util=require(_0x173e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x173e('0x2'));var router=express[_0x173e('0x3')]();var auth=require(_0x173e('0x4'));var interaction=require(_0x173e('0x5'));var config=require('../../config/environment');var controller=require(_0x173e('0x6'));router[_0x173e('0x7')]('/',auth[_0x173e('0x8')](),controller[_0x173e('0x9')]);router[_0x173e('0x7')](_0x173e('0xa'),auth[_0x173e('0x8')](),controller[_0x173e('0xb')]);router['get'](_0x173e('0xc'),auth[_0x173e('0x8')](),controller[_0x173e('0xd')]);router[_0x173e('0x7')](_0x173e('0xe'),auth[_0x173e('0x8')](),controller[_0x173e('0xf')]);router['get'](_0x173e('0x10'),auth[_0x173e('0x8')](),controller[_0x173e('0x11')]);router['get'](_0x173e('0x12'),auth[_0x173e('0x8')](),controller[_0x173e('0x13')]);router[_0x173e('0x7')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x173e('0x14')]);router['get'](_0x173e('0x15'),controller[_0x173e('0x16')]);router[_0x173e('0x7')](_0x173e('0x17'),auth[_0x173e('0x8')](),controller['getAgents']);router['post']('/',auth[_0x173e('0x8')](),controller[_0x173e('0x18')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x173e('0x19')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x173e('0x1a')]);router[_0x173e('0x19')](_0x173e('0x1b'),controller[_0x173e('0x1c')]);router[_0x173e('0x19')](_0x173e('0x12'),auth[_0x173e('0x8')](),controller[_0x173e('0x1d')]);router[_0x173e('0x19')]('/:id/send',auth[_0x173e('0x8')](),controller['send']);router[_0x173e('0x19')]('/:id/status',controller['status']);router[_0x173e('0x19')](_0x173e('0x17'),auth['isAuthenticated'](),controller[_0x173e('0x1e')]);router[_0x173e('0x1f')](_0x173e('0xc'),auth[_0x173e('0x8')](),controller['update']);router['delete']('/:id',auth[_0x173e('0x8')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x173e('0x8')](),controller[_0x173e('0x20')]);router[_0x173e('0x21')](_0x173e('0x10'),auth[_0x173e('0x8')](),controller[_0x173e('0x22')]);router['delete']('/:id/users',auth[_0x173e('0x8')](),controller[_0x173e('0x23')]);module[_0x173e('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 9ba95a5..1eeab24 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 _0x55e0=['clickatell','csc','infobip','intelepeer','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','clicksend'];(function(_0x1db5a1,_0x2c8eb0){var _0x89ed93=function(_0x2efc0f){while(--_0x2efc0f){_0x1db5a1['push'](_0x1db5a1['shift']());}};_0x89ed93(++_0x2c8eb0);}(_0x55e0,0xdc));var _0x055e=function(_0x1c19d0,_0x1cef78){_0x1c19d0=_0x1c19d0-0x0;var _0x52693c=_0x55e0[_0x1c19d0];return _0x52693c;};'use strict';var Sequelize=require(_0x055e('0x0'));var rs=require(_0x055e('0x1'));module[_0x055e('0x2')]={'name':{'type':Sequelize[_0x055e('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return rs[_0x055e('0x4')]();}},'phone':{'type':Sequelize[_0x055e('0x3')]},'type':{'type':Sequelize[_0x055e('0x5')](_0x055e('0x6'),'skebby','connectel',_0x055e('0x7'),'plivo',_0x055e('0x8'),_0x055e('0x9'),_0x055e('0xa'),_0x055e('0xb'))},'accountSid':{'type':Sequelize[_0x055e('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x055e('0x3')]},'smsMethod':{'type':Sequelize[_0x055e('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x055e('0x3')]},'password':{'type':Sequelize[_0x055e('0x3')]},'apiKey':{'type':Sequelize[_0x055e('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x055e('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x055e('0xc');}},'notificationSound':{'type':Sequelize[_0x055e('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x055e('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x055e('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x055e('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x055e('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x055e('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x055e('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x055e('0xe')],'comment':_0x055e('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x055e('0xd')],'defaultValue':![],'comment':_0x055e('0x10'),'set':function(_0x56af18){if(!_0x56af18)this[_0x055e('0x11')](_0x055e('0x12'),null);this[_0x055e('0x11')]('mandatoryDisposition',_0x56af18);}}}; \ No newline at end of file +var _0x750a=['randomstring','name','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x1c5a08,_0x371bfe){var _0x9758bb=function(_0x39eeee){while(--_0x39eeee){_0x1c5a08['push'](_0x1c5a08['shift']());}};_0x9758bb(++_0x371bfe);}(_0x750a,0x140));var _0xa750=function(_0x1b20a1,_0x15ec51){_0x1b20a1=_0x1b20a1-0x0;var _0x5249bd=_0x750a[_0x1b20a1];return _0x5249bd;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xa750('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xa750('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0xa750('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xa750('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xa750('0x2')],'defaultValue':function(){return rs[_0xa750('0x3')]();}},'phone':{'type':Sequelize[_0xa750('0x2')]},'type':{'type':Sequelize[_0xa750('0x4')](_0xa750('0x5'),_0xa750('0x6'),_0xa750('0x7'),_0xa750('0x8'),_0xa750('0x9'),_0xa750('0xa'),'csc','infobip',_0xa750('0xb'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xa750('0x2')]},'authToken':{'type':Sequelize[_0xa750('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xa750('0x2')]},'password':{'type':Sequelize[_0xa750('0x2')]},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xa750('0xc')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xa750('0xd')],'defaultValue':function(){return _0xa750('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa750('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa750('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa750('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa750('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa750('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xa750('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa750('0xf')],'comment':_0xa750('0x10')},'mandatoryDisposition':{'type':Sequelize[_0xa750('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3ae2a1){if(!_0x3ae2a1)this[_0xa750('0x11')](_0xa750('0x12'),null);this['setDataValue'](_0xa750('0x13'),_0x3ae2a1);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 8be99ac..3187d48 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 _0x4454=['dataValues','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','message_id','status_code','groupName','DELIVERED','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','statusGet','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','defaults','localhost','socket.io-emitter','redis','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','SmsAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','end','offset','Content-Range','json','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','send','mandatoryDispositionPause','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','type','key','SmsAccount','includeAll','include','rows','show','params','Pause','rawAttributes','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','SmsAccountId','getDispositions','Disposition','pick','options','count','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','from','From','Body','messageId','skebby','sender','text','connectel','clicksend','plivo','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','intelepeer','Sequelize','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','Contacts','DESC','omit','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','set','Content-Type','\x0a','addApplications','sequelize','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','CmList','List','out','Messages'];(function(_0x4a3e6c,_0x24e52b){var _0x8717cc=function(_0x2f927f){while(--_0x2f927f){_0x4a3e6c['push'](_0x4a3e6c['shift']());}};_0x8717cc(++_0x24e52b);}(_0x4454,0x1d8));var _0x4445=function(_0x204a8e,_0x34e0ca){_0x204a8e=_0x204a8e-0x0;var _0x26aa8d=_0x4454[_0x204a8e];return _0x26aa8d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4445('0x0'));var rimraf=require(_0x4445('0x1'));var zipdir=require(_0x4445('0x2'));var jsonpatch=require(_0x4445('0x3'));var rp=require(_0x4445('0x4'));var moment=require(_0x4445('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4445('0x6'));var path=require(_0x4445('0x7'));var sox=require(_0x4445('0x8'));var csv=require(_0x4445('0x9'));var ejs=require(_0x4445('0xa'));var fs=require('fs');var _=require(_0x4445('0xb'));var squel=require('squel');var crypto=require(_0x4445('0xc'));var jsforce=require(_0x4445('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4445('0xe'));var Redis=require(_0x4445('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4445('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4445('0x11'))('api');var utils=require(_0x4445('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x4445('0x13')](config['redis'],{'host':_0x4445('0x14'),'port':0x18eb});var socket=require(_0x4445('0x15'))(new Redis(config[_0x4445('0x16')]));require('./smsAccount.socket')[_0x4445('0x17')](socket);var jayson=require(_0x4445('0x18'));var client=jayson[_0x4445('0x19')][_0x4445('0x1a')]({'port':0x232c});function checkPasswordPattern(_0x525709,_0x12bb36,_0x3808eb){if(_0x3808eb){var _0x4de631=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4de631[_0x4445('0x1b')](_0x12bb36)){return _0x525709;}else{throw new Error(_0x4445('0x1c'));}}else{return _0x525709;}}function respondWithRpcPromise(_0x843e0f,_0x205f18,_0x435eb6,_0x2ad9d0){return new BPromise(function(_0x5c66cc,_0x32e93c){var _0x91b7da=_0x2ad9d0||client;return _0x91b7da[_0x4445('0x1d')](_0x843e0f,_0x435eb6)[_0x4445('0x1e')](function(_0x5c7583){logger[_0x4445('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x205f18,'request\x20sent');logger[_0x4445('0x20')](_0x4445('0x21'),_0x205f18,'request\x20sent',JSON[_0x4445('0x22')](_0x5c7583));if(_0x5c7583['error']){if(_0x5c7583['error'][_0x4445('0x23')]===0x1f4){logger[_0x4445('0x24')](_0x4445('0x25'),_0x205f18,_0x5c7583[_0x4445('0x24')][_0x4445('0x26')]);return _0x32e93c(_0x5c7583[_0x4445('0x24')]['message']);}logger[_0x4445('0x24')](_0x4445('0x25'),_0x205f18,_0x5c7583[_0x4445('0x24')][_0x4445('0x26')]);return _0x5c66cc(_0x5c7583[_0x4445('0x24')][_0x4445('0x26')]);}else{logger[_0x4445('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x205f18,_0x4445('0x27'));_0x5c66cc(_0x5c7583[_0x4445('0x28')][_0x4445('0x26')]);}})[_0x4445('0x29')](function(_0x44bf50){logger['error']('SmsAccount,\x20%s,\x20%s',_0x205f18,_0x44bf50);_0x32e93c(_0x44bf50);});});}function respondWithStatusCode(_0x452ec1,_0x26169b){_0x26169b=_0x26169b||0xcc;return function(_0x14dd24){if(_0x14dd24){return _0x452ec1[_0x4445('0x2a')](_0x26169b);}return _0x452ec1[_0x4445('0x2b')](_0x26169b)[_0x4445('0x2c')]();};}function respondWithResult(_0x1ccb17,_0x299e5f){_0x299e5f=_0x299e5f||0xc8;return function(_0x9938ac){if(_0x9938ac){return _0x1ccb17[_0x4445('0x2b')](_0x299e5f)['json'](_0x9938ac);}};}function respondWithFilteredResult(_0x1b98bf,_0x26094f){return function(_0x59b917){if(_0x59b917){var _0x28861f=_0x59b917['count'],_0x1aeeb5=_0x26094f[_0x4445('0x2d')],_0x362c99=_0x26094f['offset']+_0x26094f['limit'],_0x2a2bfa;if(_0x362c99>=_0x28861f){_0x362c99=_0x28861f;_0x2a2bfa=0xc8;}else{_0x2a2bfa=0xce;}_0x1b98bf[_0x4445('0x2b')](_0x2a2bfa);return _0x1b98bf['set'](_0x4445('0x2e'),_0x1aeeb5+'-'+_0x362c99+'/'+_0x28861f)[_0x4445('0x2f')](_0x59b917);}return null;};}function patchUpdates(_0x3c9304){return function(_0x28159b){try{jsonpatch[_0x4445('0x30')](_0x28159b,_0x3c9304,!![]);}catch(_0x59c380){return BPromise[_0x4445('0x31')](_0x59c380);}return _0x28159b[_0x4445('0x32')]();};}function saveUpdates(_0xedf008,_0x394aca){return function(_0x3c4d17){if(_0x3c4d17){return _0x3c4d17[_0x4445('0x33')](_0xedf008)[_0x4445('0x1e')](function(_0x4bdc78){return _0x4bdc78;});}return null;};}function removeEntity(_0x3a278d,_0x4af495){return function(_0x1435b9){if(_0x1435b9){return _0x1435b9[_0x4445('0x34')]()[_0x4445('0x1e')](function(){var _0x519f41=_0x1435b9[_0x4445('0x35')]({'plain':!![]});var _0x23cc22=_0x4445('0x36');return db[_0x4445('0x37')]['destroy']({'where':{'type':_0x23cc22,'resourceId':_0x519f41['id']}})[_0x4445('0x1e')](function(){return _0x1435b9;});})['then'](function(){_0x3a278d[_0x4445('0x2b')](0xcc)[_0x4445('0x2c')]();});}};}function handleEntityNotFound(_0x30d960,_0x34b3c6){return function(_0x16429c){if(!_0x16429c){_0x30d960[_0x4445('0x2a')](0x194);}return _0x16429c;};}function handleError(_0x2d0500,_0x273d53){_0x273d53=_0x273d53||0x1f4;return function(_0x324f06){logger[_0x4445('0x24')](_0x324f06[_0x4445('0x38')]);if(_0x324f06['name']){delete _0x324f06['name'];}_0x2d0500[_0x4445('0x2b')](_0x273d53)[_0x4445('0x39')](_0x324f06);};}exports['index']=function(_0x4905b8,_0x212001){var _0x16ea22={'include':[{'model':db['Pause'],'as':_0x4445('0x3a')}]},_0x381307={},_0x278d39={'count':0x0,'rows':[]};var _0x319a0c=db['SmsAccount']['rawAttributes'];_0x381307[_0x4445('0x3b')]=_[_0x4445('0x3c')](_0x319a0c);_0x381307[_0x4445('0x3d')]=_[_0x4445('0x3c')](_0x4905b8[_0x4445('0x3d')]);_0x381307[_0x4445('0x3e')]=_['intersection'](_0x381307[_0x4445('0x3b')],_0x381307[_0x4445('0x3d')]);_0x16ea22[_0x4445('0x3f')]=_[_0x4445('0x40')](_0x381307[_0x4445('0x3b')],qs['fields'](_0x4905b8[_0x4445('0x3d')][_0x4445('0x41')]));_0x16ea22[_0x4445('0x3f')]=_0x16ea22['attributes'][_0x4445('0x42')]?_0x16ea22['attributes']:_0x381307[_0x4445('0x3b')];if(!_0x4905b8[_0x4445('0x3d')][_0x4445('0x43')](_0x4445('0x44'))){_0x16ea22[_0x4445('0x45')]=qs[_0x4445('0x45')](_0x4905b8[_0x4445('0x3d')][_0x4445('0x45')]);_0x16ea22[_0x4445('0x2d')]=qs['offset'](_0x4905b8[_0x4445('0x3d')][_0x4445('0x2d')]);}_0x16ea22[_0x4445('0x46')]=qs[_0x4445('0x47')](_0x4905b8[_0x4445('0x3d')]['sort']);_0x16ea22[_0x4445('0x48')]=qs[_0x4445('0x3e')](_['pick'](_0x4905b8[_0x4445('0x3d')],_0x381307[_0x4445('0x3e')]));if(_0x4905b8[_0x4445('0x3d')][_0x4445('0x49')]){_0x16ea22[_0x4445('0x48')]=_[_0x4445('0x4a')](_0x16ea22[_0x4445('0x48')],{'$or':_[_0x4445('0x4b')](_0x319a0c,function(_0x1d367f){if(_0x1d367f[_0x4445('0x4c')][_0x4445('0x4d')]!=='VIRTUAL'){var _0x49f7f0={};_0x49f7f0[_0x1d367f['field']]={'$like':'%'+_0x4905b8[_0x4445('0x3d')][_0x4445('0x49')]+'%'};return _0x49f7f0;}})});}_0x16ea22=_[_0x4445('0x4a')]({},_0x16ea22,_0x4905b8['options']);var _0x2dcac5={'where':_0x16ea22['where']};return db[_0x4445('0x4e')]['count'](_0x2dcac5)[_0x4445('0x1e')](function(_0x457e54){_0x278d39['count']=_0x457e54;if(_0x4905b8[_0x4445('0x3d')][_0x4445('0x4f')]){_0x16ea22[_0x4445('0x50')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x16ea22);})[_0x4445('0x1e')](function(_0x419725){_0x278d39[_0x4445('0x51')]=_0x419725;return _0x278d39;})['then'](respondWithFilteredResult(_0x212001,_0x16ea22))['catch'](handleError(_0x212001,null));};exports[_0x4445('0x52')]=function(_0x588b1c,_0x38304a){var _0x3654de={'raw':![],'where':{'id':_0x588b1c[_0x4445('0x53')]['id']},'include':[{'model':db[_0x4445('0x54')],'as':'mandatoryDispositionPause'}]},_0x3ead3e={};_0x3ead3e[_0x4445('0x3b')]=_[_0x4445('0x3c')](db['SmsAccount'][_0x4445('0x55')]);_0x3ead3e[_0x4445('0x3d')]=_[_0x4445('0x3c')](_0x588b1c[_0x4445('0x3d')]);_0x3ead3e[_0x4445('0x3e')]=_[_0x4445('0x40')](_0x3ead3e[_0x4445('0x3b')],_0x3ead3e['query']);_0x3654de[_0x4445('0x3f')]=_[_0x4445('0x40')](_0x3ead3e['model'],qs['fields'](_0x588b1c[_0x4445('0x3d')][_0x4445('0x41')]));_0x3654de[_0x4445('0x3f')]=_0x3654de['attributes'][_0x4445('0x42')]?_0x3654de['attributes']:_0x3ead3e[_0x4445('0x3b')];if(_0x588b1c[_0x4445('0x3d')][_0x4445('0x4f')]){_0x3654de[_0x4445('0x50')]=[{'all':!![]}];}_0x3654de=_[_0x4445('0x4a')]({},_0x3654de,_0x588b1c['options']);return db[_0x4445('0x4e')][_0x4445('0x56')](_0x3654de)[_0x4445('0x1e')](handleEntityNotFound(_0x38304a,null))[_0x4445('0x1e')](respondWithResult(_0x38304a,null))['catch'](handleError(_0x38304a,null));};exports[_0x4445('0x57')]=function(_0x2e683a,_0x435db7){return db[_0x4445('0x4e')][_0x4445('0x57')](_0x2e683a['body'],{})[_0x4445('0x1e')](function(_0x46e0c1){var _0x11091c=_0x2e683a['user']['get']({'plain':!![]});if(!_0x11091c)throw new Error(_0x4445('0x58'));if(_0x11091c[_0x4445('0x59')]===_0x4445('0x5a')){var _0xa930e0=_0x46e0c1[_0x4445('0x35')]({'plain':!![]});var _0x26c05b='SmsAccounts';return db[_0x4445('0x5b')][_0x4445('0x56')]({'where':{'name':_0x26c05b,'userProfileId':_0x11091c[_0x4445('0x5c')]},'raw':!![]})[_0x4445('0x1e')](function(_0x592497){if(_0x592497&&_0x592497[_0x4445('0x5d')]===0x0){return db[_0x4445('0x37')][_0x4445('0x57')]({'name':_0xa930e0[_0x4445('0x5e')],'resourceId':_0xa930e0['id'],'type':_0x592497['name'],'sectionId':_0x592497['id']},{})[_0x4445('0x1e')](function(){return _0x46e0c1;});}else{return _0x46e0c1;}})['catch'](function(_0x434da7){logger['error'](_0x4445('0x5f'),_0x434da7);throw _0x434da7;});}return _0x46e0c1;})[_0x4445('0x1e')](respondWithResult(_0x435db7,0xc9))[_0x4445('0x29')](handleError(_0x435db7,null));};exports[_0x4445('0x33')]=function(_0x4c91c4,_0x4542cc){if(_0x4c91c4[_0x4445('0x60')]['id']){delete _0x4c91c4[_0x4445('0x60')]['id'];}return db[_0x4445('0x4e')]['find']({'where':{'id':_0x4c91c4[_0x4445('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x4445('0x3a')}]})[_0x4445('0x1e')](handleEntityNotFound(_0x4542cc,null))['then'](saveUpdates(_0x4c91c4['body'],null))[_0x4445('0x1e')](respondWithResult(_0x4542cc,null))[_0x4445('0x29')](handleError(_0x4542cc,null));};exports[_0x4445('0x34')]=function(_0x23763c,_0x3c29bd){return db[_0x4445('0x4e')]['find']({'where':{'id':_0x23763c[_0x4445('0x53')]['id']}})[_0x4445('0x1e')](handleEntityNotFound(_0x3c29bd,null))[_0x4445('0x1e')](removeEntity(_0x3c29bd,null))[_0x4445('0x29')](handleError(_0x3c29bd,null));};exports[_0x4445('0x61')]=function(_0x51679e,_0x16fd83){return db[_0x4445('0x4e')][_0x4445('0x61')]()[_0x4445('0x1e')](respondWithResult(_0x16fd83,null))[_0x4445('0x29')](handleError(_0x16fd83,null));};exports[_0x4445('0x62')]=function(_0x114af6,_0x507c60,_0x519c93){if(_0x114af6['body']['id']){delete _0x114af6[_0x4445('0x60')]['id'];}return db['SmsAccount'][_0x4445('0x56')]({'where':{'id':_0x114af6[_0x4445('0x53')]['id']}})[_0x4445('0x1e')](handleEntityNotFound(_0x507c60,null))[_0x4445('0x1e')](function(_0x181deb){if(_0x181deb){_0x114af6[_0x4445('0x60')][_0x4445('0x63')]=_0x181deb['id'];return db['Disposition'][_0x4445('0x57')](_0x114af6[_0x4445('0x60')]);}})[_0x4445('0x1e')](respondWithResult(_0x507c60,null))[_0x4445('0x29')](handleError(_0x507c60,null));};exports[_0x4445('0x64')]=function(_0x2570bd,_0x474c64,_0x4bd5c0){var _0x31820a={'raw':![],'where':{}};var _0x4fb8fa={};var _0x305ddc={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x2570bd[_0x4445('0x53')]['id']}})[_0x4445('0x1e')](handleEntityNotFound(_0x474c64,null))[_0x4445('0x1e')](function(_0x194973){if(_0x194973){_0x4fb8fa[_0x4445('0x3b')]=_[_0x4445('0x3c')](db[_0x4445('0x65')]['rawAttributes']);_0x4fb8fa['query']=_[_0x4445('0x3c')](_0x2570bd[_0x4445('0x3d')]);_0x4fb8fa[_0x4445('0x3e')]=_[_0x4445('0x40')](_0x4fb8fa['model'],_0x4fb8fa[_0x4445('0x3d')]);_0x31820a['attributes']=_[_0x4445('0x40')](_0x4fb8fa['model'],qs[_0x4445('0x41')](_0x2570bd['query'][_0x4445('0x41')]));_0x31820a[_0x4445('0x3f')]=_0x31820a[_0x4445('0x3f')][_0x4445('0x42')]?_0x31820a[_0x4445('0x3f')]:_0x4fb8fa['model'];if(!_0x2570bd[_0x4445('0x3d')]['hasOwnProperty'](_0x4445('0x44'))){_0x31820a[_0x4445('0x45')]=qs[_0x4445('0x45')](_0x2570bd[_0x4445('0x3d')][_0x4445('0x45')]);_0x31820a[_0x4445('0x2d')]=qs[_0x4445('0x2d')](_0x2570bd[_0x4445('0x3d')]['offset']);}_0x31820a[_0x4445('0x46')]=qs[_0x4445('0x47')](_0x2570bd[_0x4445('0x3d')][_0x4445('0x47')]);_0x31820a[_0x4445('0x48')]=qs[_0x4445('0x3e')](_[_0x4445('0x66')](_0x2570bd['query'],_0x4fb8fa[_0x4445('0x3e')]));_0x31820a['where'][_0x4445('0x63')]=_0x194973['id'];if(_0x2570bd['query'][_0x4445('0x49')]){_0x31820a[_0x4445('0x48')]=_['merge'](_0x31820a[_0x4445('0x48')],{'$or':_[_0x4445('0x4b')](_0x31820a['attributes'],function(_0x4e8108){var _0x148223={};_0x148223[_0x4e8108]={'$like':'%'+_0x2570bd['query'][_0x4445('0x49')]+'%'};return _0x148223;})});}_0x31820a=_[_0x4445('0x4a')]({},_0x31820a,_0x2570bd[_0x4445('0x67')]);return db[_0x4445('0x65')][_0x4445('0x68')]({'where':_0x31820a[_0x4445('0x48')]})[_0x4445('0x1e')](function(_0x1c97cd){_0x305ddc['count']=_0x1c97cd;if(_0x2570bd[_0x4445('0x3d')]['includeAll']){_0x31820a[_0x4445('0x50')]=[{'all':!![]}];}return db[_0x4445('0x65')][_0x4445('0x69')](_0x31820a);})[_0x4445('0x1e')](function(_0x8ce49c){_0x305ddc['rows']=_0x8ce49c;return _0x305ddc;});}})[_0x4445('0x1e')](respondWithFilteredResult(_0x474c64,_0x31820a))['catch'](handleError(_0x474c64,null));};exports[_0x4445('0x6a')]=function(_0x26757,_0x580844,_0x28df96){return db[_0x4445('0x4e')][_0x4445('0x56')]({'where':{'id':_0x26757[_0x4445('0x53')]['id']}})[_0x4445('0x1e')](handleEntityNotFound(_0x580844,null))['then'](function(_0x45a272){if(_0x45a272){return _0x45a272['removeDispositions'](_0x26757[_0x4445('0x3d')][_0x4445('0x6b')]);}})[_0x4445('0x1e')](respondWithStatusCode(_0x580844,null))[_0x4445('0x29')](handleError(_0x580844,null));};exports[_0x4445('0x6c')]=function(_0x5c8102,_0x341b08,_0x538475){if(_0x5c8102[_0x4445('0x60')]['id']){delete _0x5c8102[_0x4445('0x60')]['id'];}return db[_0x4445('0x4e')][_0x4445('0x56')]({'where':{'id':_0x5c8102[_0x4445('0x53')]['id']}})[_0x4445('0x1e')](handleEntityNotFound(_0x341b08,null))[_0x4445('0x1e')](function(_0x530773){if(_0x530773){_0x5c8102[_0x4445('0x60')][_0x4445('0x63')]=_0x530773['id'];return db[_0x4445('0x6d')][_0x4445('0x57')](_0x5c8102[_0x4445('0x60')]);}})[_0x4445('0x1e')](respondWithResult(_0x341b08,null))['catch'](handleError(_0x341b08,null));};exports[_0x4445('0x6e')]=function(_0x5e6803,_0x41d70b,_0x54b322){var _0xdba3a5={'raw':![],'where':{}};var _0x5ca006={};var _0x4cbba9={'count':0x0,'rows':[]};return db[_0x4445('0x4e')][_0x4445('0x6f')]({'where':{'id':_0x5e6803['params']['id']}})[_0x4445('0x1e')](handleEntityNotFound(_0x41d70b,null))[_0x4445('0x1e')](function(_0xa88d2a){if(_0xa88d2a){_0x5ca006['model']=_['keys'](db[_0x4445('0x6d')][_0x4445('0x55')]);_0x5ca006[_0x4445('0x3d')]=_[_0x4445('0x3c')](_0x5e6803['query']);_0x5ca006[_0x4445('0x3e')]=_['intersection'](_0x5ca006[_0x4445('0x3b')],_0x5ca006[_0x4445('0x3d')]);_0xdba3a5[_0x4445('0x3f')]=_[_0x4445('0x40')](_0x5ca006[_0x4445('0x3b')],qs['fields'](_0x5e6803[_0x4445('0x3d')]['fields']));_0xdba3a5['attributes']=_0xdba3a5[_0x4445('0x3f')][_0x4445('0x42')]?_0xdba3a5['attributes']:_0x5ca006[_0x4445('0x3b')];if(!_0x5e6803[_0x4445('0x3d')][_0x4445('0x43')](_0x4445('0x44'))){_0xdba3a5[_0x4445('0x45')]=qs['limit'](_0x5e6803[_0x4445('0x3d')][_0x4445('0x45')]);_0xdba3a5[_0x4445('0x2d')]=qs[_0x4445('0x2d')](_0x5e6803[_0x4445('0x3d')]['offset']);}_0xdba3a5[_0x4445('0x46')]=qs[_0x4445('0x47')](_0x5e6803[_0x4445('0x3d')][_0x4445('0x47')]);_0xdba3a5[_0x4445('0x48')]=qs[_0x4445('0x3e')](_[_0x4445('0x66')](_0x5e6803[_0x4445('0x3d')],_0x5ca006['filters']));_0xdba3a5[_0x4445('0x48')][_0x4445('0x63')]=_0xa88d2a['id'];if(_0x5e6803['query'][_0x4445('0x49')]){_0xdba3a5[_0x4445('0x48')]=_[_0x4445('0x4a')](_0xdba3a5[_0x4445('0x48')],{'$or':_[_0x4445('0x4b')](_0xdba3a5['attributes'],function(_0x3ec3c9){var _0x2a134a={};_0x2a134a[_0x3ec3c9]={'$like':'%'+_0x5e6803[_0x4445('0x3d')][_0x4445('0x49')]+'%'};return _0x2a134a;})});}_0xdba3a5=_['merge']({},_0xdba3a5,_0x5e6803[_0x4445('0x67')]);return db['CannedAnswer'][_0x4445('0x68')]({'where':_0xdba3a5[_0x4445('0x48')]})['then'](function(_0xc247aa){_0x4cbba9['count']=_0xc247aa;if(_0x5e6803[_0x4445('0x3d')][_0x4445('0x4f')]){_0xdba3a5[_0x4445('0x50')]=[{'all':!![]}];}return db[_0x4445('0x6d')][_0x4445('0x69')](_0xdba3a5);})[_0x4445('0x1e')](function(_0x283cfb){_0x4cbba9['rows']=_0x283cfb;return _0x4cbba9;});}})[_0x4445('0x1e')](respondWithFilteredResult(_0x41d70b,_0xdba3a5))['catch'](handleError(_0x41d70b,null));};exports[_0x4445('0x70')]=function(_0x24497b,_0x43da32,_0x5e7025){return db['SmsAccount'][_0x4445('0x56')]({'where':{'id':_0x24497b[_0x4445('0x53')]['id']}})[_0x4445('0x1e')](handleEntityNotFound(_0x43da32,null))[_0x4445('0x1e')](function(_0x5c17a2){if(_0x5c17a2){return _0x5c17a2['removeAnswers'](_0x24497b[_0x4445('0x3d')][_0x4445('0x6b')]);}})['then'](respondWithStatusCode(_0x43da32,null))[_0x4445('0x29')](handleError(_0x43da32,null));};exports[_0x4445('0x71')]=function(_0x5c8054,_0x5887d5,_0x18cef8){var _0x1af946={'channel':_0x4445('0x72')};var _0x574212=[];var _0x22c3e7=[];var _0x23e642={};return db[_0x4445('0x4e')][_0x4445('0x56')]({'where':{'id':_0x5c8054[_0x4445('0x53')]['id']},'include':[{'model':db[_0x4445('0x73')],'as':_0x4445('0x74')}]})[_0x4445('0x1e')](handleEntityNotFound(_0x5887d5,null))[_0x4445('0x1e')](function(_0x280ea7){_0x1af946[_0x4445('0x75')]=_0x280ea7;_0x1af946[_0x4445('0x76')]=_['orderBy'](_0x280ea7[_0x4445('0x74')],['priority'],[_0x4445('0x77')]);if(_0x1af946[_0x4445('0x75')][_0x4445('0x74')]){delete _0x1af946['account'][_0x4445('0x74')];}return db[_0x4445('0x78')]['describe']();})[_0x4445('0x1e')](function(_0x111930){if(!_0x111930){throw new db['Sequelize'][(_0x4445('0x79'))](_0x4445('0x7a'));}_0x574212=_[_0x4445('0x7b')](_[_0x4445('0x3c')](_0x111930),[_0x4445('0x7c'),'updatedAt']);_0x22c3e7=_['difference'](_[_0x4445('0x3c')](_0x111930),[_0x4445('0x7c'),_0x4445('0x7d'),'CompanyId',_0x4445('0x7e')]);_0x1af946[_0x4445('0x60')]={'mapKey':_0x4445('0x7f')};if(_0x1af946[_0x4445('0x75')][_0x4445('0x4c')]){switch(_0x1af946[_0x4445('0x75')][_0x4445('0x4c')]){case'twilio':_0x1af946['body'][_0x4445('0x80')]=_0x5c8054[_0x4445('0x60')][_0x4445('0x81')];_0x1af946[_0x4445('0x60')][_0x4445('0x60')]=_0x5c8054[_0x4445('0x60')][_0x4445('0x82')];_0x1af946['body'][_0x4445('0x83')]=_0x5c8054['body']['MessageSid'];break;case _0x4445('0x84'):_0x1af946[_0x4445('0x60')][_0x4445('0x80')]='+'+_0x5c8054['body'][_0x4445('0x85')];_0x1af946['body'][_0x4445('0x60')]=_0x5c8054['body'][_0x4445('0x86')];break;case _0x4445('0x87'):_0x1af946[_0x4445('0x60')]['from']=_0x5c8054[_0x4445('0x60')]['from'];_0x1af946[_0x4445('0x60')][_0x4445('0x60')]=_0x5c8054[_0x4445('0x60')]['message'];break;case _0x4445('0x88'):_0x1af946[_0x4445('0x60')]['from']=_0x5c8054['body'][_0x4445('0x80')];_0x1af946[_0x4445('0x60')][_0x4445('0x60')]=_0x5c8054[_0x4445('0x60')][_0x4445('0x60')];_0x1af946[_0x4445('0x60')][_0x4445('0x83')]=_0x5c8054[_0x4445('0x60')]['message_id'];break;case _0x4445('0x89'):_0x1af946[_0x4445('0x60')][_0x4445('0x80')]=_0x5c8054[_0x4445('0x60')][_0x4445('0x81')];_0x1af946[_0x4445('0x60')][_0x4445('0x60')]=_0x5c8054['body']['Text'];_0x1af946[_0x4445('0x60')][_0x4445('0x83')]=_0x5c8054[_0x4445('0x60')][_0x4445('0x8a')];break;case _0x4445('0x8b'):_0x1af946[_0x4445('0x60')][_0x4445('0x80')]='+'+_0x5c8054[_0x4445('0x60')][_0x4445('0x8c')][0x0]['from'];_0x1af946[_0x4445('0x60')][_0x4445('0x60')]=_0x5c8054[_0x4445('0x60')]['results'][0x0][_0x4445('0x86')];_0x1af946[_0x4445('0x60')][_0x4445('0x83')]=_0x5c8054[_0x4445('0x60')][_0x4445('0x8c')][0x0][_0x4445('0x83')];break;case _0x4445('0x8d'):_0x1af946['body'][_0x4445('0x80')]=_0x5c8054[_0x4445('0x60')][_0x4445('0x8e')];_0x1af946[_0x4445('0x60')]['body']=_0x5c8054['body']['segmentedMessage'][_0x4445('0x26')];break;case _0x4445('0x8f'):_0x1af946[_0x4445('0x60')][_0x4445('0x80')]=_0x5c8054[_0x4445('0x60')][_0x4445('0x90')];_0x1af946[_0x4445('0x60')][_0x4445('0x60')]=_0x5c8054[_0x4445('0x60')][_0x4445('0x86')];_0x1af946['body'][_0x4445('0x83')]=_0x5c8054[_0x4445('0x60')][_0x4445('0x91')];break;case _0x4445('0x92'):_0x1af946['body'][_0x4445('0x80')]=_0x5c8054[_0x4445('0x60')][_0x4445('0x80')];_0x1af946[_0x4445('0x60')][_0x4445('0x60')]=_0x5c8054[_0x4445('0x60')][_0x4445('0x26')];_0x1af946[_0x4445('0x60')][_0x4445('0x83')]=_0x5c8054[_0x4445('0x60')]['refid'];break;}}if(_0x1af946['body']['id']){delete _0x1af946[_0x4445('0x60')]['id'];}if(_['isNil'](_0x1af946[_0x4445('0x60')][_0x4445('0x80')])){throw new db[(_0x4445('0x93'))][(_0x4445('0x79'))]('from\x20is\x20mandatory');}if(_[_0x4445('0x94')](_0x1af946[_0x4445('0x60')][_0x4445('0x60')])||_0x1af946[_0x4445('0x60')][_0x4445('0x60')]===''){throw new db[(_0x4445('0x93'))]['ValidationError'](_0x4445('0x95'));}if(_[_0x4445('0x94')](_0x1af946[_0x4445('0x60')][_0x4445('0x96')])){throw new db['Sequelize'][(_0x4445('0x79'))](_0x4445('0x97')+_0x22c3e7);}if(!_[_0x4445('0x98')](_0x22c3e7,_0x1af946[_0x4445('0x60')][_0x4445('0x96')])){throw new db[(_0x4445('0x93'))][(_0x4445('0x79'))](_0x4445('0x99')+_0x22c3e7);}_0x23e642[_0x1af946['body'][_0x4445('0x96')]]=_0x1af946[_0x4445('0x60')][_0x4445('0x80')];return db['CmList'][_0x4445('0x56')]({'where':{'id':_0x1af946[_0x4445('0x75')][_0x4445('0x7e')]},'include':[{'model':db[_0x4445('0x78')],'as':_0x4445('0x9a'),'where':_0x23e642,'limit':0x1,'order':[[_0x4445('0x7d'),_0x4445('0x9b')]]}]});})[_0x4445('0x1e')](handleEntityNotFound(_0x5887d5,null))['then'](function(_0x258bcd){if(_0x258bcd){_0x1af946['list']=_[_0x4445('0x9c')](_0x258bcd,[_0x4445('0x9a')]);if(_0x258bcd[_0x4445('0x9a')][_0x4445('0x42')]){return _0x258bcd[_0x4445('0x9a')][0x0];}var _0x27d01e=_['defaults'](_0x1af946['body'],{'firstName':_0x1af946[_0x4445('0x60')][_0x4445('0x80')],'ListId':_0x258bcd['id']});_0x27d01e[_0x1af946[_0x4445('0x60')]['mapKey']]=_0x1af946['body'][_0x4445('0x80')];return db[_0x4445('0x78')][_0x4445('0x57')](_0x27d01e,{'fields':_0x574212,'raw':!![]});}})[_0x4445('0x1e')](handleEntityNotFound(_0x5887d5,null))[_0x4445('0x1e')](function(_0x590eec){if(_0x590eec){_0x1af946['contact']=_0x590eec;var _0x1e7036={'ContactId':_0x590eec['id'],'phone':_0x1af946[_0x4445('0x60')]['from'],'SmsAccountId':_0x5c8054[_0x4445('0x53')]['id']};var _0x3014ec={'ContactId':_0x590eec['id'],'SmsAccountId':_0x5c8054['params']['id'],'closed':![]};return db[_0x4445('0x9d')]['find']({'where':_0x3014ec})[_0x4445('0x1e')](function(_0x1ca982){if(_0x1ca982){return[_0x1ca982,![]];}return db[_0x4445('0x9d')]['create'](_0x1e7036)[_0x4445('0x1e')](function(_0x39ba6b){return[_0x39ba6b,!![]];});});}})[_0x4445('0x9e')](function(_0x421ac1,_0x1c582e){_0x1af946[_0x4445('0x9f')]=_0x421ac1['get']({'plain':!![]});_0x1af946['interaction'][_0x4445('0xa0')]=![];if(_0x1c582e){if(_0x1af946[_0x4445('0x75')][_0x4445('0xa1')]){_0x1af946['applications'][_0x4445('0xa2')]({'id':0x0,'priority':_0x1af946[_0x4445('0x76')][_0x4445('0x42')]+0x1,'app':_0x4445('0xa3'),'appdata':_0x4445('0xa4'),'interval':_0x4445('0xa5')});}_0x1af946[_0x4445('0x9f')][_0x4445('0xa0')]=!![];}return db[_0x4445('0xa6')]['create']({'phone':_0x1af946[_0x4445('0x60')][_0x4445('0x80')],'messageId':_0x1af946[_0x4445('0x60')]['messageId'],'body':_0x1af946[_0x4445('0x60')]['body'],'SmsAccountId':_0x5c8054['params']['id'],'SmsInteractionId':_0x421ac1['id'],'direction':'in','ContactId':_0x421ac1['ContactId'],'AttachmentId':_0x1af946[_0x4445('0x60')][_0x4445('0xa7')]});})['then'](function(_0x36528e){_0x1af946[_0x4445('0x26')]=_0x36528e;if(_0x1af946[_0x4445('0x9f')][_0x4445('0xa8')]){return db[_0x4445('0xa9')][_0x4445('0x56')]({'attributes':['id',_0x4445('0x5e')],'where':{'id':_0x1af946[_0x4445('0x9f')]['UserId']}})[_0x4445('0x1e')](function(_0x5cd7f7){if(_0x5cd7f7){_0x1af946[_0x4445('0x76')][_0x4445('0xaa')]({'id':0x0,'priority':0x0,'app':_0x4445('0xab'),'appdata':_0x5cd7f7[_0x4445('0x5e')]+','+(_0x1af946[_0x4445('0x75')][_0x4445('0xac')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x4445('0xad'),_0x4445('0xae'),_0x1af946);});}return respondWithRpcPromise(_0x4445('0xad'),_0x4445('0xae'),_0x1af946);})[_0x4445('0x1e')](function(_0x5a5fe3){if(_0x5a5fe3){var _0x5314a7=0xc8;var _0x17cfb3=_0x4445('0xaf');logger[_0x4445('0x1f')](_0x4445('0x21'),_0x17cfb3,_0x5314a7,_0x4445('0xb0'));logger[_0x4445('0x20')](_0x4445('0xb1'),_0x17cfb3,_0x5314a7,_0x4445('0xb0'),JSON[_0x4445('0x22')](_0x5a5fe3));if(_0x1af946[_0x4445('0x75')][_0x4445('0x4c')]===_0x4445('0xb2')){return _0x5887d5[_0x4445('0x2b')](_0x5314a7)[_0x4445('0xb3')](_0x4445('0xb4'),'text/xml')[_0x4445('0x39')](_0x4445('0xb5'));}else{return _0x5887d5[_0x4445('0x2b')](_0x5314a7)[_0x4445('0x2f')](_0x5a5fe3);}}})['catch'](handleError(_0x5887d5,null));};exports[_0x4445('0xb6')]=function(_0x35978a,_0x1b0439,_0x10a760){return db[_0x4445('0x4e')][_0x4445('0x6f')]({'where':{'id':_0x35978a[_0x4445('0x53')]['id']}})[_0x4445('0x1e')](handleEntityNotFound(_0x1b0439,null))['then'](function(_0x1e2757){if(_0x1e2757){return db[_0x4445('0xb7')]['transaction'](function(_0x34e21f){return db['SmsApplication'][_0x4445('0x34')]({'where':{'SmsAccountId':_0x35978a[_0x4445('0x53')]['id']},'transaction':_0x34e21f})[_0x4445('0x1e')](function(_0x3ff05c){var _0x1e76fd=_[_0x4445('0x4b')](_0x35978a[_0x4445('0x60')],function(_0x37d6b5){_0x37d6b5[_0x4445('0x63')]=_0x35978a[_0x4445('0x53')]['id'];return _0x37d6b5;});return db[_0x4445('0x73')][_0x4445('0xb8')](_0x1e76fd,{'transaction':_0x34e21f});});})['then'](function(){return db['SmsApplication'][_0x4445('0xb9')]({'where':{'SmsAccountId':_0x35978a[_0x4445('0x53')]['id']},'order':_0x4445('0xba')});});}})['then'](respondWithResult(_0x1b0439,null))['catch'](handleError(_0x1b0439,null));};exports[_0x4445('0xbb')]=function(_0x2267e0,_0x3252c8,_0x44a92e){var _0x436afb={};var _0xfd9879={};var _0x96023c;var _0x5a5c53;return db['SmsAccount'][_0x4445('0x6f')]({'where':{'id':_0x2267e0[_0x4445('0x53')]['id']}})[_0x4445('0x1e')](handleEntityNotFound(_0x3252c8,null))[_0x4445('0x1e')](function(_0x2617c1){if(_0x2617c1){_0x96023c=_0x2617c1;_0xfd9879[_0x4445('0x3b')]=_[_0x4445('0x3c')](db['SmsApplication'][_0x4445('0x55')]);_0xfd9879[_0x4445('0x3d')]=_[_0x4445('0x3c')](_0x2267e0['query']);_0xfd9879[_0x4445('0x3e')]=_[_0x4445('0x40')](_0xfd9879['model'],_0xfd9879['query']);_0x436afb[_0x4445('0x3f')]=_['intersection'](_0xfd9879[_0x4445('0x3b')],qs['fields'](_0x2267e0[_0x4445('0x3d')][_0x4445('0x41')]));_0x436afb[_0x4445('0x3f')]=_0x436afb[_0x4445('0x3f')]['length']?_0x436afb['attributes']:_0xfd9879[_0x4445('0x3b')];_0x436afb[_0x4445('0x46')]=qs[_0x4445('0x47')](_0x2267e0['query']['sort']);_0x436afb[_0x4445('0x48')]=qs[_0x4445('0x3e')](_['pick'](_0x2267e0['query'],_0xfd9879['filters']));if(_0x2267e0[_0x4445('0x3d')]['filter']){_0x436afb['where']=_[_0x4445('0x4a')](_0x436afb[_0x4445('0x48')],{'$or':_[_0x4445('0x4b')](_0x436afb['attributes'],function(_0x4f2358){var _0x15b8da={};_0x15b8da[_0x4f2358]={'$like':'%'+_0x2267e0[_0x4445('0x3d')]['filter']+'%'};return _0x15b8da;})});}_0x436afb=_['merge']({},_0x436afb,_0x2267e0[_0x4445('0x67')]);return _0x96023c[_0x4445('0xbb')](_0x436afb);}})[_0x4445('0x1e')](function(_0x465dd8){if(_0x465dd8){_0x5a5c53=_0x465dd8[_0x4445('0x42')];if(!_0x2267e0[_0x4445('0x3d')]['hasOwnProperty']('nolimit')){_0x436afb[_0x4445('0x45')]=qs['limit'](_0x2267e0[_0x4445('0x3d')]['limit']);_0x436afb['offset']=qs['offset'](_0x2267e0[_0x4445('0x3d')]['offset']);}return _0x96023c['getApplications'](_0x436afb);}})[_0x4445('0x1e')](function(_0x37c8de){if(_0x37c8de){return _0x37c8de?{'count':_0x5a5c53,'rows':_0x37c8de}:null;}})[_0x4445('0x1e')](respondWithResult(_0x3252c8,null))[_0x4445('0x29')](handleError(_0x3252c8,null));};exports[_0x4445('0xbc')]=function(_0x5951aa,_0x261e22,_0x42d63d){var _0x42a4bf={'raw':![],'where':{}};var _0x3545fc={};var _0x5259cc={'count':0x0,'rows':[]};return db[_0x4445('0x4e')][_0x4445('0x6f')]({'where':{'id':_0x5951aa[_0x4445('0x53')]['id']}})['then'](handleEntityNotFound(_0x261e22,null))[_0x4445('0x1e')](function(_0x3cbca7){if(_0x3cbca7){_0x3545fc[_0x4445('0x3b')]=_['keys'](db[_0x4445('0x9d')][_0x4445('0x55')]);_0x3545fc[_0x4445('0x3d')]=_[_0x4445('0x3c')](_0x5951aa[_0x4445('0x3d')]);_0x3545fc[_0x4445('0x3e')]=_[_0x4445('0x40')](_0x3545fc[_0x4445('0x3b')],_0x3545fc[_0x4445('0x3d')]);_0x42a4bf[_0x4445('0x3f')]=_['intersection'](_0x3545fc[_0x4445('0x3b')],qs[_0x4445('0x41')](_0x5951aa[_0x4445('0x3d')][_0x4445('0x41')]));_0x42a4bf[_0x4445('0x3f')]=_0x42a4bf['attributes'][_0x4445('0x42')]?_0x42a4bf[_0x4445('0x3f')]:_0x3545fc[_0x4445('0x3b')];if(!_0x5951aa['query'][_0x4445('0x43')](_0x4445('0x44'))){_0x42a4bf[_0x4445('0x45')]=qs[_0x4445('0x45')](_0x5951aa[_0x4445('0x3d')][_0x4445('0x45')]);_0x42a4bf[_0x4445('0x2d')]=qs[_0x4445('0x2d')](_0x5951aa[_0x4445('0x3d')]['offset']);}_0x42a4bf[_0x4445('0x46')]=qs[_0x4445('0x47')](_0x5951aa[_0x4445('0x3d')][_0x4445('0x47')]);_0x42a4bf[_0x4445('0x48')]=qs['filters'](_[_0x4445('0x66')](_0x5951aa[_0x4445('0x3d')],_0x3545fc['filters']));_0x42a4bf[_0x4445('0x48')][_0x4445('0x63')]=_0x3cbca7['id'];if(_0x5951aa[_0x4445('0x3d')][_0x4445('0x49')]){_0x42a4bf['where']=_[_0x4445('0x4a')](_0x42a4bf['where'],{'$or':_[_0x4445('0x4b')](_0x42a4bf[_0x4445('0x3f')],function(_0x992ad3){var _0x5bbb90={};_0x5bbb90[_0x992ad3]={'$like':'%'+_0x5951aa['query'][_0x4445('0x49')]+'%'};return _0x5bbb90;})});}_0x42a4bf=_['merge']({},_0x42a4bf,_0x5951aa['options']);return db['SmsInteraction'][_0x4445('0x68')]({'where':_0x42a4bf[_0x4445('0x48')]})[_0x4445('0x1e')](function(_0x10ed4a){_0x5259cc[_0x4445('0x68')]=_0x10ed4a;if(_0x5951aa[_0x4445('0x3d')][_0x4445('0x4f')]){_0x42a4bf[_0x4445('0x50')]=[{'model':db[_0x4445('0x78')],'as':_0x4445('0xbd'),'required':![]},{'model':db[_0x4445('0xa9')],'as':'Owner','attributes':[_0x4445('0x5e'),_0x4445('0xbe'),_0x4445('0xbf')],'required':![]},{'model':db[_0x4445('0xc0')],'as':'Tags','attributes':['id',_0x4445('0x5e'),_0x4445('0xc1')],'where':_0x5951aa['query'][_0x4445('0xc2')]?{'id':_0x5951aa[_0x4445('0x3d')]['tag']}:undefined,'required':_0x5951aa[_0x4445('0x3d')]['tag']?!![]:![]}];}return db[_0x4445('0x9d')][_0x4445('0x69')](_0x42a4bf);})[_0x4445('0x1e')](function(_0x451c5b){_0x5259cc[_0x4445('0x51')]=_0x451c5b;return _0x5259cc;});}})[_0x4445('0x1e')](respondWithFilteredResult(_0x261e22,_0x42a4bf))['catch'](handleError(_0x261e22,null));};exports[_0x4445('0x39')]=function(_0x5b8a44,_0x48c109,_0x35fe6c){var _0x47ed2d,_0x1e7855,_0x1e787f;if(_[_0x4445('0x94')](_0x5b8a44[_0x4445('0x60')][_0x4445('0x60')])||_0x5b8a44[_0x4445('0x60')][_0x4445('0x60')]===''){throw new db['Sequelize'][(_0x4445('0x79'))](_0x4445('0x95'));}if(_[_0x4445('0x94')](_0x5b8a44[_0x4445('0x60')]['to'])){throw new db[(_0x4445('0x93'))][(_0x4445('0x79'))](_0x4445('0xc3'));}_0x47ed2d=_0x5b8a44[_0x4445('0x60')]['to'];return db[_0x4445('0x4e')][_0x4445('0x56')]({'where':{'id':_0x5b8a44[_0x4445('0x53')]['id']},'include':[{'model':db[_0x4445('0xc4')],'as':_0x4445('0xc5'),'include':[{'model':db[_0x4445('0x78')],'as':_0x4445('0x9a'),'where':{'mobile':_0x47ed2d},'limit':0x1,'order':[[_0x4445('0x7d'),'DESC']]}]}]})[_0x4445('0x1e')](handleEntityNotFound(_0x48c109,null))['then'](function(_0x50f1e1){if(_0x50f1e1&&_0x50f1e1['List']){_0x1e7855=_0x50f1e1[_0x4445('0x35')]({'plain':!![]});if(_0x1e7855[_0x4445('0xc5')]&&_0x1e7855[_0x4445('0xc5')][_0x4445('0x9a')]['length']){return _0x1e7855[_0x4445('0xc5')][_0x4445('0x9a')][0x0];}return db[_0x4445('0x78')][_0x4445('0x57')](_['defaults'](_0x5b8a44[_0x4445('0x60')],{'firstName':_0x47ed2d,'mobile':_0x47ed2d,'phone':_0x47ed2d,'ListId':_0x1e7855[_0x4445('0x7e')]}));}})[_0x4445('0x1e')](handleEntityNotFound(_0x48c109,null))[_0x4445('0x1e')](function(_0x3449da){if(_0x3449da){_0x1e787f=_0x3449da;return db[_0x4445('0x9d')][_0x4445('0x56')]({'where':{'ContactId':_0x1e787f['id'],'closed':![],'SmsAccountId':_0x1e7855['id']}})[_0x4445('0x1e')](function(_0x586c9f){if(_0x586c9f){return[_0x586c9f,![]];}return db[_0x4445('0x9d')][_0x4445('0x57')]({'UserId':_0x5b8a44[_0x4445('0x5a')]['id'],'ContactId':_0x1e787f['id'],'SmsAccountId':_0x1e7855['id'],'phone':_0x47ed2d,'firstMsgDirection':_0x4445('0xc6'),'Messages':[_[_0x4445('0x4a')](_0x5b8a44[_0x4445('0x60')],{'read':![],'body':_0x5b8a44[_0x4445('0x60')][_0x4445('0x60')],'phone':_0x47ed2d,'SmsAccountId':_0x1e7855['id'],'UserId':_0x5b8a44[_0x4445('0x5a')]['id'],'ContactId':_0x1e787f['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x4445('0xc7')}]})[_0x4445('0x1e')](function(_0x825307){return[_0x825307,!![]];});});}})[_0x4445('0x9e')](function(_0x407fd5,_0x20c578){if(_0x20c578){return _0x407fd5;}return db[_0x4445('0xa6')][_0x4445('0x57')](_[_0x4445('0x4a')](_0x5b8a44[_0x4445('0x60')],{'read':![],'body':_0x5b8a44['body'][_0x4445('0x60')],'phone':_0x47ed2d,'SmsAccountId':_0x1e7855['id'],'SmsInteractionId':_0x407fd5['id'],'UserId':_0x5b8a44['user']['id'],'ContactId':_0x1e787f['id']}))[_0x4445('0x1e')](function(_0x10830b){_0x407fd5['dataValues'][_0x4445('0xc7')]=[];_0x407fd5[_0x4445('0xc8')][_0x4445('0xc7')][_0x4445('0xa2')](_0x10830b['dataValues']);return _0x407fd5;});})[_0x4445('0x1e')](respondWithResult(_0x48c109,null))['catch'](handleError(_0x48c109,null));};exports[_0x4445('0x2b')]=function(_0x45cfdf,_0x32fbc5,_0x52cbc3){if(_0x45cfdf[_0x4445('0x60')]['id']){delete _0x45cfdf[_0x4445('0x60')]['id'];}console['log'](_0x4445('0xc9'),_0x45cfdf[_0x4445('0x60')]);var _0x244fc2,_0x1cc93b,_0x435b0a;return db[_0x4445('0x4e')][_0x4445('0x56')]({'where':{'id':_0x45cfdf[_0x4445('0x53')]['id']}})['then'](handleEntityNotFound(_0x32fbc5,null))[_0x4445('0x1e')](function(_0x22fda5){if(_0x22fda5){_0x435b0a=_0x22fda5;logger[_0x4445('0x20')](_0x4445('0x21'),_0x4445('0x2b'),_0x4445('0xca'),_0x22fda5['type'],util[_0x4445('0xcb')](_0x45cfdf[_0x4445('0x60')],{'showHidden':![],'depth':null}));switch(_0x22fda5['type']){case _0x4445('0x84'):if(_0x45cfdf[_0x4445('0x60')][_0x4445('0xcc')]&&_0x45cfdf[_0x4445('0x60')][_0x4445('0x2b')]){_0x1cc93b=_0x45cfdf[_0x4445('0x60')][_0x4445('0x2b')];return db[_0x4445('0xa6')][_0x4445('0x56')]({'where':{'messageId':_0x45cfdf[_0x4445('0x60')][_0x4445('0xcc')]}});}break;case'connectel':if(_0x45cfdf['body'][_0x4445('0xcd')]&&_0x45cfdf[_0x4445('0x60')]['statusInt']){_0x1cc93b=_0x45cfdf[_0x4445('0x60')]['statusInt'];return db[_0x4445('0xa6')][_0x4445('0x56')]({'where':{'messageId':_0x45cfdf['body'][_0x4445('0xcd')]}});}break;case _0x4445('0x88'):if(_0x45cfdf['body'][_0x4445('0xce')]&&_0x45cfdf[_0x4445('0x60')]['status_code']){_0x1cc93b=_0x45cfdf[_0x4445('0x60')][_0x4445('0xcf')];return db[_0x4445('0xa6')]['find']({'where':{'messageId':_0x45cfdf[_0x4445('0x60')][_0x4445('0xce')]}});}break;case'infobip':var _0x5a31bc=_0x45cfdf[_0x4445('0x60')][_0x4445('0x8c')][0x0];if(_0x5a31bc['messageId']&&_0x5a31bc['status'][_0x4445('0xd0')]===_0x4445('0xd1')){_0x1cc93b=_0x5a31bc['status'][_0x4445('0xd0')];return db[_0x4445('0xa6')]['find']({'where':{'messageId':_0x5a31bc[_0x4445('0x83')]}});}break;case _0x4445('0x8f'):if(_0x45cfdf[_0x4445('0x60')]['messageId']&&_0x45cfdf['body'][_0x4445('0x2b')]){_0x1cc93b=_0x45cfdf[_0x4445('0x60')][_0x4445('0x2b')];return db[_0x4445('0xa6')][_0x4445('0x56')]({'where':{'messageId':_0x45cfdf[_0x4445('0x60')]['messageId']}});}break;case _0x4445('0x92'):if(_0x45cfdf[_0x4445('0x60')][_0x4445('0xd2')]&&_0x45cfdf[_0x4445('0x60')][_0x4445('0x2b')]){_0x1cc93b=_0x45cfdf['body'][_0x4445('0x2b')];return db[_0x4445('0xa6')]['find']({'where':{'messageId':_0x45cfdf[_0x4445('0x60')][_0x4445('0xd2')]}});}break;}}})[_0x4445('0x1e')](handleEntityNotFound(_0x32fbc5,null))[_0x4445('0x1e')](function(_0x243db8){if(_0x243db8){_0x244fc2=_0x243db8;switch(_0x435b0a[_0x4445('0x4c')]){case _0x4445('0x84'):if(_0x1cc93b===_0x4445('0xd1')){return _0x244fc2['update']({'read':!![]});}else{logger[_0x4445('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','skebby',util['inspect'](_0x45cfdf[_0x4445('0x60')],{'showHidden':![],'depth':null}));}break;case _0x4445('0x87'):if(_0x1cc93b==='1'){return _0x244fc2[_0x4445('0x33')]({'read':!![]});}else{logger[_0x4445('0x24')](_0x4445('0x21'),_0x4445('0x2b'),_0x4445('0x84'),util[_0x4445('0xcb')](_0x45cfdf[_0x4445('0x60')],{'showHidden':![],'depth':null}));}break;case _0x4445('0x88'):if(!_0x45cfdf[_0x4445('0x60')]['error_code']&&_0x1cc93b>=0xc8&&_0x1cc93b<=0xce){return _0x244fc2['update']({'read':!![]});}else{logger[_0x4445('0x24')](_0x4445('0x21'),'status',_0x4445('0x88'),util['inspect'](_0x45cfdf[_0x4445('0x60')],{'showHidden':![],'depth':null}));}break;case _0x4445('0x8b'):var _0x3958d8=_0x45cfdf['body']['results'][0x0];if(_0x3958d8[_0x4445('0x2b')][_0x4445('0xd0')]===_0x4445('0xd1')){return _0x244fc2[_0x4445('0x33')]({'read':!![]});}else{logger['error'](_0x4445('0x21'),'status',_0x4445('0x8b'),util[_0x4445('0xcb')](_0x45cfdf['body'],{'showHidden':![],'depth':null}));}break;case _0x4445('0x8f'):if(_0x1cc93b==_0x4445('0xd3')||_0x1cc93b==_0x4445('0xd4')){return _0x244fc2[_0x4445('0x33')]({'read':!![]});}else{logger['error'](_0x4445('0x21'),'status',_0x4445('0x8f'),util['inspect'](_0x45cfdf['body'],{'showHidden':![],'depth':null}));}break;case _0x4445('0x92'):if(_0x1cc93b===_0x4445('0xd5')||_0x1cc93b==='ACCEPTD'){return _0x244fc2[_0x4445('0x33')]({'read':!![]});}else{logger[_0x4445('0x24')](_0x4445('0x21'),_0x4445('0x2b'),_0x4445('0x92'),util[_0x4445('0xcb')](_0x45cfdf[_0x4445('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x244fc2;}})[_0x4445('0x1e')](respondWithResult(_0x32fbc5,null))['catch'](handleError(_0x32fbc5,null));};exports[_0x4445('0xd6')]=function(_0x2682ca,_0x2b36ad,_0x353214){var _0x5d8c94,_0x2520da,_0x17fd61;return db['SmsAccount'][_0x4445('0x56')]({'where':{'id':_0x2682ca[_0x4445('0x53')]['id']}})[_0x4445('0x1e')](handleEntityNotFound(_0x2b36ad,null))[_0x4445('0x1e')](function(_0x370121){if(_0x370121){_0x17fd61=_0x370121;logger['debug'](_0x4445('0x21'),_0x4445('0x2b'),_0x4445('0xca'),_0x370121['type'],util['inspect'](_0x2682ca[_0x4445('0x3d')],{'showHidden':![],'depth':null}));switch(_0x370121[_0x4445('0x4c')]){case _0x4445('0x8d'):if(_0x2682ca['query']['message-id']&&_0x2682ca[_0x4445('0x3d')][_0x4445('0xd7')]){_0x2520da=_0x2682ca['query'][_0x4445('0xd7')];return db['SmsMessage'][_0x4445('0x56')]({'where':{'messageId':_0x2682ca[_0x4445('0x3d')][_0x4445('0xd8')]}});}break;}}})[_0x4445('0x1e')](handleEntityNotFound(_0x2b36ad,null))[_0x4445('0x1e')](function(_0x3151cc){if(_0x3151cc){_0x5d8c94=_0x3151cc;switch(_0x17fd61[_0x4445('0x4c')]){case _0x4445('0x8d'):if(_0x2520da==='2'||_0x2520da==='6'){return _0x5d8c94[_0x4445('0x33')]({'read':!![]});}else{logger[_0x4445('0x24')](_0x4445('0x21'),_0x4445('0x2b'),_0x4445('0x8d'),util[_0x4445('0xcb')](_0x2682ca[_0x4445('0x3d')],{'showHidden':![],'depth':null}));};break;}return _0x5d8c94;}})['then'](respondWithResult(_0x2b36ad,null))[_0x4445('0x29')](handleError(_0x2b36ad,null));};exports[_0x4445('0xd9')]=function(_0x3aa933,_0x144895,_0x3a24a3){return db[_0x4445('0x4e')][_0x4445('0x56')]({'where':{'id':_0x3aa933[_0x4445('0x53')]['id']}})['then'](handleEntityNotFound(_0x144895,null))[_0x4445('0x1e')](function(_0x2c7300){if(_0x2c7300){return _0x2c7300[_0x4445('0xd9')](_0x3aa933[_0x4445('0x60')][_0x4445('0x6b')],_[_0x4445('0x9c')](_0x3aa933[_0x4445('0x60')],[_0x4445('0x6b'),'id'])||{})['spread'](function(_0x1e5cb4){for(var _0x10c466=0x0;_0x10c466<_0x3aa933[_0x4445('0x60')][_0x4445('0x6b')][_0x4445('0x42')];_0x10c466+=0x1){socket[_0x4445('0xda')](_0x4445('0xdb'),{'UserId':_0x3aa933[_0x4445('0x60')]['ids'][_0x10c466],'SmsAccountId':_0x3aa933[_0x4445('0x53')]['id']});}return _0x1e5cb4;});}})[_0x4445('0x1e')](respondWithResult(_0x144895,null))[_0x4445('0x29')](handleError(_0x144895,null));};exports[_0x4445('0xdc')]=function(_0x205503,_0x56b48e,_0x43c8b5){return db['SmsAccount']['find']({'where':{'id':_0x205503[_0x4445('0x53')]['id']}})[_0x4445('0x1e')](handleEntityNotFound(_0x56b48e,null))[_0x4445('0x1e')](function(_0x1b51a4){if(_0x1b51a4){return _0x1b51a4['removeAgents'](_0x205503[_0x4445('0x3d')][_0x4445('0x6b')])[_0x4445('0x1e')](function(){if(_[_0x4445('0xdd')](_0x205503[_0x4445('0x3d')][_0x4445('0x6b')])){for(var _0x313a08=0x0;_0x313a08<_0x205503[_0x4445('0x3d')][_0x4445('0x6b')][_0x4445('0x42')];_0x313a08+=0x1){socket[_0x4445('0xda')](_0x4445('0xde'),{'UserId':Number(_0x205503[_0x4445('0x3d')][_0x4445('0x6b')][_0x313a08]),'SmsAccountId':Number(_0x205503[_0x4445('0x53')]['id'])});}}else{socket[_0x4445('0xda')]('userSmsAccount:remove',{'UserId':Number(_0x205503['query'][_0x4445('0x6b')]),'SmsAccountId':Number(_0x205503[_0x4445('0x53')]['id'])});}});}})[_0x4445('0x1e')](respondWithStatusCode(_0x56b48e,null))[_0x4445('0x29')](handleError(_0x56b48e,null));};exports[_0x4445('0xdf')]=function(_0x4efca4,_0x3ee6a0,_0x476924){var _0x3bdb06={};var _0x1b08b5={};var _0xd46a82;var _0x590db2;return db[_0x4445('0x4e')][_0x4445('0x6f')]({'where':{'id':_0x4efca4[_0x4445('0x53')]['id']}})[_0x4445('0x1e')](handleEntityNotFound(_0x3ee6a0,null))[_0x4445('0x1e')](function(_0x3c8faf){if(_0x3c8faf){_0xd46a82=_0x3c8faf;_0x1b08b5[_0x4445('0x3b')]=_['keys'](db[_0x4445('0xa9')]['rawAttributes']);_0x1b08b5[_0x4445('0x3d')]=_[_0x4445('0x3c')](_0x4efca4[_0x4445('0x3d')]);_0x1b08b5[_0x4445('0x3e')]=_[_0x4445('0x40')](_0x1b08b5[_0x4445('0x3b')],_0x1b08b5[_0x4445('0x3d')]);_0x3bdb06[_0x4445('0x3f')]=_[_0x4445('0x40')](_0x1b08b5[_0x4445('0x3b')],qs[_0x4445('0x41')](_0x4efca4[_0x4445('0x3d')][_0x4445('0x41')]));_0x3bdb06[_0x4445('0x3f')]=_0x3bdb06[_0x4445('0x3f')][_0x4445('0x42')]?_0x3bdb06['attributes']:_0x1b08b5[_0x4445('0x3b')];_0x3bdb06['order']=qs['sort'](_0x4efca4[_0x4445('0x3d')][_0x4445('0x47')]);_0x3bdb06[_0x4445('0x48')]=qs[_0x4445('0x3e')](_[_0x4445('0x66')](_0x4efca4[_0x4445('0x3d')],_0x1b08b5['filters']));if(_0x4efca4[_0x4445('0x3d')]['filter']){_0x3bdb06[_0x4445('0x48')]=_[_0x4445('0x4a')](_0x3bdb06[_0x4445('0x48')],{'$or':_[_0x4445('0x4b')](_0x3bdb06['attributes'],function(_0x57ada6){var _0x3a257a={};_0x3a257a[_0x57ada6]={'$like':'%'+_0x4efca4['query']['filter']+'%'};return _0x3a257a;})});}_0x3bdb06=_[_0x4445('0x4a')]({},_0x3bdb06,_0x4efca4['options']);return _0xd46a82['getAgents'](_0x3bdb06);}})[_0x4445('0x1e')](function(_0x561fd6){if(_0x561fd6){_0x590db2=_0x561fd6[_0x4445('0x42')];if(!_0x4efca4[_0x4445('0x3d')][_0x4445('0x43')](_0x4445('0x44'))){_0x3bdb06[_0x4445('0x45')]=qs['limit'](_0x4efca4[_0x4445('0x3d')][_0x4445('0x45')]);_0x3bdb06['offset']=qs['offset'](_0x4efca4['query'][_0x4445('0x2d')]);}return _0xd46a82[_0x4445('0xdf')](_0x3bdb06);}})[_0x4445('0x1e')](function(_0x469c1c){if(_0x469c1c){return _0x469c1c?{'count':_0x590db2,'rows':_0x469c1c}:null;}})['then'](respondWithResult(_0x3ee6a0,null))['catch'](handleError(_0x3ee6a0,null));}; \ No newline at end of file +var _0xfd85=['removeAnswers','notify','SmsApplication','account','applications','orderBy','Applications','priority','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','type','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','intelepeer','refid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','CmContact','DESC','list','omit','Contacts','contact','SmsInteraction','interaction','created','push','close','*,*,*,*','SmsMessage','AttachmentId','UserId','agent','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','send','\x0a','addApplications','findAndCountAll','getApplications','Contact','User','Owner','fullname','Tags','tag','to\x20is\x20mandatory','List','Messages','spread','dataValues','log','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','clickatell','redif','error_code','DELIVERED_TO_GATEWAY','DELIVRD','ACCEPTD','state','message-id','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','client','test','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','get','SmsAccounts','end','sendStatus','stack','name','index','Pause','SmsAccount','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','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','describe','addDisposition','SmsAccountId','getDispositions','Disposition','pick','removeDispositions','ids','findOne','CannedAnswer','rawAttributes'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xfd85,0x14c));var _0x5fd8=function(_0x2f7cdf,_0x3dd24b){_0x2f7cdf=_0x2f7cdf-0x0;var _0x34fa6d=_0xfd85[_0x2f7cdf];return _0x34fa6d;};'use strict';var pdf=require(_0x5fd8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5fd8('0x1'));var zipdir=require(_0x5fd8('0x2'));var jsonpatch=require(_0x5fd8('0x3'));var rp=require(_0x5fd8('0x4'));var moment=require(_0x5fd8('0x5'));var BPromise=require(_0x5fd8('0x6'));var Mustache=require(_0x5fd8('0x7'));var util=require(_0x5fd8('0x8'));var path=require(_0x5fd8('0x9'));var sox=require('sox');var csv=require(_0x5fd8('0xa'));var ejs=require(_0x5fd8('0xb'));var fs=require('fs');var _=require(_0x5fd8('0xc'));var squel=require(_0x5fd8('0xd'));var crypto=require(_0x5fd8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5fd8('0xf'));var toCsv=require(_0x5fd8('0xa'));var querystring=require('querystring');var Papa=require(_0x5fd8('0x10'));var Redis=require(_0x5fd8('0x11'));var authService=require(_0x5fd8('0x12'));var qs=require(_0x5fd8('0x13'));var hardwareService=require(_0x5fd8('0x14'));var logger=require('../../config/logger')(_0x5fd8('0x15'));var utils=require(_0x5fd8('0x16'));var config=require(_0x5fd8('0x17'));var db=require(_0x5fd8('0x18'))['db'];config['redis']=_[_0x5fd8('0x19')](config[_0x5fd8('0x1a')],{'host':_0x5fd8('0x1b'),'port':0x18eb});var socket=require(_0x5fd8('0x1c'))(new Redis(config['redis']));require(_0x5fd8('0x1d'))['register'](socket);var jayson=require(_0x5fd8('0x1e'));var client=jayson[_0x5fd8('0x1f')]['http']({'port':0x232c});function checkPasswordPattern(_0x4ff0ed,_0x29be81,_0x37196b){if(_0x37196b){var _0x24031d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x24031d[_0x5fd8('0x20')](_0x29be81)){return _0x4ff0ed;}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 _0x4ff0ed;}}function respondWithRpcPromise(_0x480ef9,_0x52aa12,_0x12e52d,_0x7f6324){return new BPromise(function(_0x5c4524,_0x3548d6){var _0x16d180=_0x7f6324||client;return _0x16d180[_0x5fd8('0x21')](_0x480ef9,_0x12e52d)[_0x5fd8('0x22')](function(_0x899548){logger[_0x5fd8('0x23')](_0x5fd8('0x24'),_0x52aa12,_0x5fd8('0x25'));logger[_0x5fd8('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x52aa12,_0x5fd8('0x25'),JSON[_0x5fd8('0x27')](_0x899548));if(_0x899548[_0x5fd8('0x28')]){if(_0x899548[_0x5fd8('0x28')][_0x5fd8('0x29')]===0x1f4){logger['error'](_0x5fd8('0x24'),_0x52aa12,_0x899548[_0x5fd8('0x28')][_0x5fd8('0x2a')]);return _0x3548d6(_0x899548[_0x5fd8('0x28')]['message']);}logger[_0x5fd8('0x28')](_0x5fd8('0x24'),_0x52aa12,_0x899548[_0x5fd8('0x28')][_0x5fd8('0x2a')]);return _0x5c4524(_0x899548[_0x5fd8('0x28')][_0x5fd8('0x2a')]);}else{logger[_0x5fd8('0x23')](_0x5fd8('0x24'),_0x52aa12,_0x5fd8('0x25'));_0x5c4524(_0x899548[_0x5fd8('0x2b')]['message']);}})[_0x5fd8('0x2c')](function(_0x3a25d8){logger[_0x5fd8('0x28')]('SmsAccount,\x20%s,\x20%s',_0x52aa12,_0x3a25d8);_0x3548d6(_0x3a25d8);});});}function respondWithStatusCode(_0x399903,_0x71ca0a){_0x71ca0a=_0x71ca0a||0xcc;return function(_0x356255){if(_0x356255){return _0x399903['sendStatus'](_0x71ca0a);}return _0x399903[_0x5fd8('0x2d')](_0x71ca0a)['end']();};}function respondWithResult(_0x580aca,_0x47db0a){_0x47db0a=_0x47db0a||0xc8;return function(_0x47f5c3){if(_0x47f5c3){return _0x580aca[_0x5fd8('0x2d')](_0x47db0a)['json'](_0x47f5c3);}};}function respondWithFilteredResult(_0x4d0063,_0x2825a6){return function(_0x275321){if(_0x275321){var _0x27a93b=_0x275321[_0x5fd8('0x2e')],_0xacc5c2=_0x2825a6[_0x5fd8('0x2f')],_0xb17536=_0x2825a6[_0x5fd8('0x2f')]+_0x2825a6[_0x5fd8('0x30')],_0x34b7b0;if(_0xb17536>=_0x27a93b){_0xb17536=_0x27a93b;_0x34b7b0=0xc8;}else{_0x34b7b0=0xce;}_0x4d0063['status'](_0x34b7b0);return _0x4d0063[_0x5fd8('0x31')](_0x5fd8('0x32'),_0xacc5c2+'-'+_0xb17536+'/'+_0x27a93b)[_0x5fd8('0x33')](_0x275321);}return null;};}function patchUpdates(_0x1da534){return function(_0x460384){try{jsonpatch[_0x5fd8('0x34')](_0x460384,_0x1da534,!![]);}catch(_0x5d3aa6){return BPromise[_0x5fd8('0x35')](_0x5d3aa6);}return _0x460384[_0x5fd8('0x36')]();};}function saveUpdates(_0x2130f8,_0x4a0095){return function(_0x526611){if(_0x526611){return _0x526611[_0x5fd8('0x37')](_0x2130f8)[_0x5fd8('0x22')](function(_0x4b02a5){return _0x4b02a5;});}return null;};}function removeEntity(_0x54733c,_0x43255b){return function(_0x12fc8c){if(_0x12fc8c){return _0x12fc8c[_0x5fd8('0x38')]()[_0x5fd8('0x22')](function(){var _0x519f7f=_0x12fc8c[_0x5fd8('0x39')]({'plain':!![]});var _0x2c2ab3=_0x5fd8('0x3a');return db['UserProfileResource']['destroy']({'where':{'type':_0x2c2ab3,'resourceId':_0x519f7f['id']}})[_0x5fd8('0x22')](function(){return _0x12fc8c;});})[_0x5fd8('0x22')](function(){_0x54733c[_0x5fd8('0x2d')](0xcc)[_0x5fd8('0x3b')]();});}};}function handleEntityNotFound(_0x2a2cae,_0x57a176){return function(_0x3d40c2){if(!_0x3d40c2){_0x2a2cae[_0x5fd8('0x3c')](0x194);}return _0x3d40c2;};}function handleError(_0x17f7f7,_0x290db2){_0x290db2=_0x290db2||0x1f4;return function(_0x3b3f29){logger[_0x5fd8('0x28')](_0x3b3f29[_0x5fd8('0x3d')]);if(_0x3b3f29[_0x5fd8('0x3e')]){delete _0x3b3f29[_0x5fd8('0x3e')];}_0x17f7f7['status'](_0x290db2)['send'](_0x3b3f29);};}exports[_0x5fd8('0x3f')]=function(_0x18e9c8,_0xe7c8ad){var _0x358ca4={'include':[{'model':db[_0x5fd8('0x40')],'as':'mandatoryDispositionPause'}]},_0x1764ed={},_0x5297c2={'count':0x0,'rows':[]};var _0x498214=db[_0x5fd8('0x41')]['rawAttributes'];_0x1764ed['model']=_[_0x5fd8('0x42')](_0x498214);_0x1764ed[_0x5fd8('0x43')]=_[_0x5fd8('0x42')](_0x18e9c8[_0x5fd8('0x43')]);_0x1764ed[_0x5fd8('0x44')]=_[_0x5fd8('0x45')](_0x1764ed[_0x5fd8('0x46')],_0x1764ed[_0x5fd8('0x43')]);_0x358ca4[_0x5fd8('0x47')]=_[_0x5fd8('0x45')](_0x1764ed[_0x5fd8('0x46')],qs['fields'](_0x18e9c8['query'][_0x5fd8('0x48')]));_0x358ca4[_0x5fd8('0x47')]=_0x358ca4[_0x5fd8('0x47')][_0x5fd8('0x49')]?_0x358ca4['attributes']:_0x1764ed[_0x5fd8('0x46')];if(!_0x18e9c8[_0x5fd8('0x43')][_0x5fd8('0x4a')](_0x5fd8('0x4b'))){_0x358ca4[_0x5fd8('0x30')]=qs[_0x5fd8('0x30')](_0x18e9c8[_0x5fd8('0x43')][_0x5fd8('0x30')]);_0x358ca4[_0x5fd8('0x2f')]=qs[_0x5fd8('0x2f')](_0x18e9c8['query'][_0x5fd8('0x2f')]);}_0x358ca4[_0x5fd8('0x4c')]=qs['sort'](_0x18e9c8[_0x5fd8('0x43')][_0x5fd8('0x4d')]);_0x358ca4[_0x5fd8('0x4e')]=qs['filters'](_['pick'](_0x18e9c8['query'],_0x1764ed['filters']));if(_0x18e9c8['query'][_0x5fd8('0x4f')]){_0x358ca4['where']=_[_0x5fd8('0x50')](_0x358ca4[_0x5fd8('0x4e')],{'$or':_[_0x5fd8('0x51')](_0x498214,function(_0x727471){if(_0x727471['type'][_0x5fd8('0x52')]!==_0x5fd8('0x53')){var _0x4d6276={};_0x4d6276[_0x727471[_0x5fd8('0x54')]]={'$like':'%'+_0x18e9c8['query'][_0x5fd8('0x4f')]+'%'};return _0x4d6276;}})});}_0x358ca4=_['merge']({},_0x358ca4,_0x18e9c8[_0x5fd8('0x55')]);var _0x7a5b6d={'where':_0x358ca4[_0x5fd8('0x4e')]};return db[_0x5fd8('0x41')][_0x5fd8('0x2e')](_0x7a5b6d)[_0x5fd8('0x22')](function(_0x3edc03){_0x5297c2[_0x5fd8('0x2e')]=_0x3edc03;if(_0x18e9c8[_0x5fd8('0x43')][_0x5fd8('0x56')]){_0x358ca4[_0x5fd8('0x57')]=[{'all':!![]}];}return db[_0x5fd8('0x41')][_0x5fd8('0x58')](_0x358ca4);})[_0x5fd8('0x22')](function(_0x46da7b){_0x5297c2[_0x5fd8('0x59')]=_0x46da7b;return _0x5297c2;})[_0x5fd8('0x22')](respondWithFilteredResult(_0xe7c8ad,_0x358ca4))[_0x5fd8('0x2c')](handleError(_0xe7c8ad,null));};exports[_0x5fd8('0x5a')]=function(_0x3fa581,_0xc5662f){var _0x566651={'raw':![],'where':{'id':_0x3fa581[_0x5fd8('0x5b')]['id']},'include':[{'model':db['Pause'],'as':_0x5fd8('0x5c')}]},_0x5b0dac={};_0x5b0dac[_0x5fd8('0x46')]=_[_0x5fd8('0x42')](db['SmsAccount']['rawAttributes']);_0x5b0dac[_0x5fd8('0x43')]=_[_0x5fd8('0x42')](_0x3fa581[_0x5fd8('0x43')]);_0x5b0dac['filters']=_['intersection'](_0x5b0dac[_0x5fd8('0x46')],_0x5b0dac[_0x5fd8('0x43')]);_0x566651[_0x5fd8('0x47')]=_[_0x5fd8('0x45')](_0x5b0dac[_0x5fd8('0x46')],qs[_0x5fd8('0x48')](_0x3fa581[_0x5fd8('0x43')][_0x5fd8('0x48')]));_0x566651['attributes']=_0x566651[_0x5fd8('0x47')][_0x5fd8('0x49')]?_0x566651[_0x5fd8('0x47')]:_0x5b0dac[_0x5fd8('0x46')];if(_0x3fa581[_0x5fd8('0x43')][_0x5fd8('0x56')]){_0x566651[_0x5fd8('0x57')]=[{'all':!![]}];}_0x566651=_[_0x5fd8('0x50')]({},_0x566651,_0x3fa581[_0x5fd8('0x55')]);return db[_0x5fd8('0x41')][_0x5fd8('0x5d')](_0x566651)[_0x5fd8('0x22')](handleEntityNotFound(_0xc5662f,null))[_0x5fd8('0x22')](respondWithResult(_0xc5662f,null))[_0x5fd8('0x2c')](handleError(_0xc5662f,null));};exports[_0x5fd8('0x5e')]=function(_0x226abb,_0x3b0580){return db[_0x5fd8('0x41')][_0x5fd8('0x5e')](_0x226abb[_0x5fd8('0x5f')],{})[_0x5fd8('0x22')](function(_0xfb6944){var _0x26a26e=_0x226abb[_0x5fd8('0x60')][_0x5fd8('0x39')]({'plain':!![]});if(!_0x26a26e)throw new Error(_0x5fd8('0x61'));if(_0x26a26e[_0x5fd8('0x62')]===_0x5fd8('0x60')){var _0x37437e=_0xfb6944[_0x5fd8('0x39')]({'plain':!![]});var _0x4ab200=_0x5fd8('0x3a');return db[_0x5fd8('0x63')][_0x5fd8('0x5d')]({'where':{'name':_0x4ab200,'userProfileId':_0x26a26e[_0x5fd8('0x64')]},'raw':!![]})['then'](function(_0x228e70){if(_0x228e70&&_0x228e70[_0x5fd8('0x65')]===0x0){return db['UserProfileResource'][_0x5fd8('0x5e')]({'name':_0x37437e['name'],'resourceId':_0x37437e['id'],'type':_0x228e70[_0x5fd8('0x3e')],'sectionId':_0x228e70['id']},{})[_0x5fd8('0x22')](function(){return _0xfb6944;});}else{return _0xfb6944;}})[_0x5fd8('0x2c')](function(_0x3d869d){logger[_0x5fd8('0x28')](_0x5fd8('0x66'),_0x3d869d);throw _0x3d869d;});}return _0xfb6944;})['then'](respondWithResult(_0x3b0580,0xc9))[_0x5fd8('0x2c')](handleError(_0x3b0580,null));};exports['update']=function(_0x2c1381,_0x1064a6){if(_0x2c1381[_0x5fd8('0x5f')]['id']){delete _0x2c1381[_0x5fd8('0x5f')]['id'];}return db[_0x5fd8('0x41')][_0x5fd8('0x5d')]({'where':{'id':_0x2c1381['params']['id']},'include':[{'model':db['Pause'],'as':_0x5fd8('0x5c')}]})[_0x5fd8('0x22')](handleEntityNotFound(_0x1064a6,null))[_0x5fd8('0x22')](saveUpdates(_0x2c1381[_0x5fd8('0x5f')],null))['then'](respondWithResult(_0x1064a6,null))[_0x5fd8('0x2c')](handleError(_0x1064a6,null));};exports[_0x5fd8('0x38')]=function(_0x534946,_0x2ba072){return db['SmsAccount'][_0x5fd8('0x5d')]({'where':{'id':_0x534946['params']['id']}})[_0x5fd8('0x22')](handleEntityNotFound(_0x2ba072,null))[_0x5fd8('0x22')](removeEntity(_0x2ba072,null))[_0x5fd8('0x2c')](handleError(_0x2ba072,null));};exports[_0x5fd8('0x67')]=function(_0x2a321b,_0x1837b8){return db[_0x5fd8('0x41')][_0x5fd8('0x67')]()[_0x5fd8('0x22')](respondWithResult(_0x1837b8,null))['catch'](handleError(_0x1837b8,null));};exports[_0x5fd8('0x68')]=function(_0x549ce5,_0x3ac5c0,_0x2df085){if(_0x549ce5['body']['id']){delete _0x549ce5[_0x5fd8('0x5f')]['id'];}return db[_0x5fd8('0x41')][_0x5fd8('0x5d')]({'where':{'id':_0x549ce5[_0x5fd8('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3ac5c0,null))['then'](function(_0xae909){if(_0xae909){_0x549ce5['body'][_0x5fd8('0x69')]=_0xae909['id'];return db['Disposition']['create'](_0x549ce5[_0x5fd8('0x5f')]);}})[_0x5fd8('0x22')](respondWithResult(_0x3ac5c0,null))[_0x5fd8('0x2c')](handleError(_0x3ac5c0,null));};exports[_0x5fd8('0x6a')]=function(_0x59b62c,_0x35d305,_0x50df29){var _0x55bbf5={'raw':![],'where':{}};var _0x5d6a78={};var _0x50fb22={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x59b62c[_0x5fd8('0x5b')]['id']}})[_0x5fd8('0x22')](handleEntityNotFound(_0x35d305,null))[_0x5fd8('0x22')](function(_0x5c7a27){if(_0x5c7a27){_0x5d6a78[_0x5fd8('0x46')]=_[_0x5fd8('0x42')](db[_0x5fd8('0x6b')]['rawAttributes']);_0x5d6a78[_0x5fd8('0x43')]=_[_0x5fd8('0x42')](_0x59b62c['query']);_0x5d6a78[_0x5fd8('0x44')]=_[_0x5fd8('0x45')](_0x5d6a78[_0x5fd8('0x46')],_0x5d6a78[_0x5fd8('0x43')]);_0x55bbf5['attributes']=_[_0x5fd8('0x45')](_0x5d6a78[_0x5fd8('0x46')],qs[_0x5fd8('0x48')](_0x59b62c[_0x5fd8('0x43')][_0x5fd8('0x48')]));_0x55bbf5[_0x5fd8('0x47')]=_0x55bbf5[_0x5fd8('0x47')][_0x5fd8('0x49')]?_0x55bbf5[_0x5fd8('0x47')]:_0x5d6a78['model'];if(!_0x59b62c['query'][_0x5fd8('0x4a')](_0x5fd8('0x4b'))){_0x55bbf5[_0x5fd8('0x30')]=qs[_0x5fd8('0x30')](_0x59b62c[_0x5fd8('0x43')]['limit']);_0x55bbf5[_0x5fd8('0x2f')]=qs[_0x5fd8('0x2f')](_0x59b62c[_0x5fd8('0x43')][_0x5fd8('0x2f')]);}_0x55bbf5['order']=qs['sort'](_0x59b62c[_0x5fd8('0x43')]['sort']);_0x55bbf5['where']=qs['filters'](_[_0x5fd8('0x6c')](_0x59b62c[_0x5fd8('0x43')],_0x5d6a78[_0x5fd8('0x44')]));_0x55bbf5[_0x5fd8('0x4e')][_0x5fd8('0x69')]=_0x5c7a27['id'];if(_0x59b62c[_0x5fd8('0x43')]['filter']){_0x55bbf5['where']=_['merge'](_0x55bbf5[_0x5fd8('0x4e')],{'$or':_[_0x5fd8('0x51')](_0x55bbf5[_0x5fd8('0x47')],function(_0x387abb){var _0x2c1d27={};_0x2c1d27[_0x387abb]={'$like':'%'+_0x59b62c[_0x5fd8('0x43')][_0x5fd8('0x4f')]+'%'};return _0x2c1d27;})});}_0x55bbf5=_[_0x5fd8('0x50')]({},_0x55bbf5,_0x59b62c['options']);return db[_0x5fd8('0x6b')][_0x5fd8('0x2e')]({'where':_0x55bbf5[_0x5fd8('0x4e')]})['then'](function(_0x4f6a9a){_0x50fb22[_0x5fd8('0x2e')]=_0x4f6a9a;if(_0x59b62c[_0x5fd8('0x43')]['includeAll']){_0x55bbf5[_0x5fd8('0x57')]=[{'all':!![]}];}return db['Disposition'][_0x5fd8('0x58')](_0x55bbf5);})['then'](function(_0x9c48e7){_0x50fb22[_0x5fd8('0x59')]=_0x9c48e7;return _0x50fb22;});}})['then'](respondWithFilteredResult(_0x35d305,_0x55bbf5))[_0x5fd8('0x2c')](handleError(_0x35d305,null));};exports[_0x5fd8('0x6d')]=function(_0x37e5ad,_0x1e2b77,_0x5d2aa9){return db[_0x5fd8('0x41')][_0x5fd8('0x5d')]({'where':{'id':_0x37e5ad[_0x5fd8('0x5b')]['id']}})[_0x5fd8('0x22')](handleEntityNotFound(_0x1e2b77,null))[_0x5fd8('0x22')](function(_0x39463d){if(_0x39463d){return _0x39463d[_0x5fd8('0x6d')](_0x37e5ad[_0x5fd8('0x43')][_0x5fd8('0x6e')]);}})[_0x5fd8('0x22')](respondWithStatusCode(_0x1e2b77,null))[_0x5fd8('0x2c')](handleError(_0x1e2b77,null));};exports['addAnswer']=function(_0x36a9ff,_0x1c0add,_0x474632){if(_0x36a9ff['body']['id']){delete _0x36a9ff[_0x5fd8('0x5f')]['id'];}return db[_0x5fd8('0x41')]['find']({'where':{'id':_0x36a9ff[_0x5fd8('0x5b')]['id']}})[_0x5fd8('0x22')](handleEntityNotFound(_0x1c0add,null))['then'](function(_0x5e65ef){if(_0x5e65ef){_0x36a9ff[_0x5fd8('0x5f')]['SmsAccountId']=_0x5e65ef['id'];return db['CannedAnswer'][_0x5fd8('0x5e')](_0x36a9ff['body']);}})[_0x5fd8('0x22')](respondWithResult(_0x1c0add,null))[_0x5fd8('0x2c')](handleError(_0x1c0add,null));};exports['getAnswers']=function(_0x4ca035,_0x54fd63,_0x555eee){var _0x3c56cf={'raw':![],'where':{}};var _0x440041={};var _0x12e470={'count':0x0,'rows':[]};return db[_0x5fd8('0x41')][_0x5fd8('0x6f')]({'where':{'id':_0x4ca035[_0x5fd8('0x5b')]['id']}})[_0x5fd8('0x22')](handleEntityNotFound(_0x54fd63,null))['then'](function(_0x36db09){if(_0x36db09){_0x440041[_0x5fd8('0x46')]=_['keys'](db[_0x5fd8('0x70')][_0x5fd8('0x71')]);_0x440041['query']=_[_0x5fd8('0x42')](_0x4ca035['query']);_0x440041[_0x5fd8('0x44')]=_['intersection'](_0x440041[_0x5fd8('0x46')],_0x440041[_0x5fd8('0x43')]);_0x3c56cf[_0x5fd8('0x47')]=_[_0x5fd8('0x45')](_0x440041[_0x5fd8('0x46')],qs[_0x5fd8('0x48')](_0x4ca035['query'][_0x5fd8('0x48')]));_0x3c56cf[_0x5fd8('0x47')]=_0x3c56cf[_0x5fd8('0x47')]['length']?_0x3c56cf[_0x5fd8('0x47')]:_0x440041[_0x5fd8('0x46')];if(!_0x4ca035[_0x5fd8('0x43')][_0x5fd8('0x4a')](_0x5fd8('0x4b'))){_0x3c56cf[_0x5fd8('0x30')]=qs[_0x5fd8('0x30')](_0x4ca035[_0x5fd8('0x43')]['limit']);_0x3c56cf[_0x5fd8('0x2f')]=qs[_0x5fd8('0x2f')](_0x4ca035[_0x5fd8('0x43')][_0x5fd8('0x2f')]);}_0x3c56cf[_0x5fd8('0x4c')]=qs['sort'](_0x4ca035['query'][_0x5fd8('0x4d')]);_0x3c56cf['where']=qs['filters'](_[_0x5fd8('0x6c')](_0x4ca035[_0x5fd8('0x43')],_0x440041[_0x5fd8('0x44')]));_0x3c56cf[_0x5fd8('0x4e')][_0x5fd8('0x69')]=_0x36db09['id'];if(_0x4ca035['query']['filter']){_0x3c56cf[_0x5fd8('0x4e')]=_[_0x5fd8('0x50')](_0x3c56cf[_0x5fd8('0x4e')],{'$or':_[_0x5fd8('0x51')](_0x3c56cf[_0x5fd8('0x47')],function(_0x5cee20){var _0x2d859b={};_0x2d859b[_0x5cee20]={'$like':'%'+_0x4ca035[_0x5fd8('0x43')][_0x5fd8('0x4f')]+'%'};return _0x2d859b;})});}_0x3c56cf=_[_0x5fd8('0x50')]({},_0x3c56cf,_0x4ca035[_0x5fd8('0x55')]);return db[_0x5fd8('0x70')][_0x5fd8('0x2e')]({'where':_0x3c56cf['where']})['then'](function(_0xf7dcf2){_0x12e470[_0x5fd8('0x2e')]=_0xf7dcf2;if(_0x4ca035[_0x5fd8('0x43')]['includeAll']){_0x3c56cf['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3c56cf);})[_0x5fd8('0x22')](function(_0x35099f){_0x12e470[_0x5fd8('0x59')]=_0x35099f;return _0x12e470;});}})[_0x5fd8('0x22')](respondWithFilteredResult(_0x54fd63,_0x3c56cf))['catch'](handleError(_0x54fd63,null));};exports[_0x5fd8('0x72')]=function(_0x51eb26,_0x2c033e,_0x290687){return db[_0x5fd8('0x41')][_0x5fd8('0x5d')]({'where':{'id':_0x51eb26[_0x5fd8('0x5b')]['id']}})[_0x5fd8('0x22')](handleEntityNotFound(_0x2c033e,null))['then'](function(_0x28d81c){if(_0x28d81c){return _0x28d81c['removeAnswers'](_0x51eb26[_0x5fd8('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x2c033e,null))['catch'](handleError(_0x2c033e,null));};exports[_0x5fd8('0x73')]=function(_0x8d69cb,_0x2458a0,_0x47a7b6){var _0x3b538a={'channel':'sms'};var _0x2caa79=[];var _0x1f5e71=[];var _0x1bbdce={};return db[_0x5fd8('0x41')][_0x5fd8('0x5d')]({'where':{'id':_0x8d69cb['params']['id']},'include':[{'model':db[_0x5fd8('0x74')],'as':'Applications'}]})[_0x5fd8('0x22')](handleEntityNotFound(_0x2458a0,null))[_0x5fd8('0x22')](function(_0x265744){_0x3b538a[_0x5fd8('0x75')]=_0x265744;_0x3b538a[_0x5fd8('0x76')]=_[_0x5fd8('0x77')](_0x265744[_0x5fd8('0x78')],[_0x5fd8('0x79')],['asc']);if(_0x3b538a[_0x5fd8('0x75')]['Applications']){delete _0x3b538a[_0x5fd8('0x75')][_0x5fd8('0x78')];}return db['CmContact'][_0x5fd8('0x67')]();})[_0x5fd8('0x22')](function(_0x2aec7e){if(!_0x2aec7e){throw new db[(_0x5fd8('0x7a'))][(_0x5fd8('0x7b'))](_0x5fd8('0x7c'));}_0x2caa79=_[_0x5fd8('0x7d')](_[_0x5fd8('0x42')](_0x2aec7e),[_0x5fd8('0x7e'),_0x5fd8('0x7f')]);_0x1f5e71=_[_0x5fd8('0x7d')](_[_0x5fd8('0x42')](_0x2aec7e),['createdAt',_0x5fd8('0x7f'),'CompanyId',_0x5fd8('0x80')]);_0x3b538a[_0x5fd8('0x5f')]={'mapKey':_0x5fd8('0x81')};if(_0x3b538a['account'][_0x5fd8('0x82')]){switch(_0x3b538a[_0x5fd8('0x75')][_0x5fd8('0x82')]){case _0x5fd8('0x83'):_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x84')]=_0x8d69cb['body'][_0x5fd8('0x85')];_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x5f')]=_0x8d69cb[_0x5fd8('0x5f')][_0x5fd8('0x86')];_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x87')]=_0x8d69cb['body'][_0x5fd8('0x88')];break;case _0x5fd8('0x89'):_0x3b538a['body']['from']='+'+_0x8d69cb['body'][_0x5fd8('0x8a')];_0x3b538a[_0x5fd8('0x5f')]['body']=_0x8d69cb[_0x5fd8('0x5f')][_0x5fd8('0x8b')];break;case _0x5fd8('0x8c'):_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x84')]=_0x8d69cb[_0x5fd8('0x5f')][_0x5fd8('0x84')];_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x5f')]=_0x8d69cb['body']['message'];break;case _0x5fd8('0x8d'):_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x84')]=_0x8d69cb['body'][_0x5fd8('0x84')];_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x5f')]=_0x8d69cb['body'][_0x5fd8('0x5f')];_0x3b538a[_0x5fd8('0x5f')]['messageId']=_0x8d69cb[_0x5fd8('0x5f')][_0x5fd8('0x8e')];break;case'plivo':_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x84')]=_0x8d69cb[_0x5fd8('0x5f')][_0x5fd8('0x85')];_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x5f')]=_0x8d69cb[_0x5fd8('0x5f')][_0x5fd8('0x8f')];_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x87')]=_0x8d69cb[_0x5fd8('0x5f')][_0x5fd8('0x90')];break;case _0x5fd8('0x91'):_0x3b538a['body'][_0x5fd8('0x84')]='+'+_0x8d69cb[_0x5fd8('0x5f')]['results'][0x0]['from'];_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x5f')]=_0x8d69cb[_0x5fd8('0x5f')][_0x5fd8('0x92')][0x0][_0x5fd8('0x8b')];_0x3b538a[_0x5fd8('0x5f')]['messageId']=_0x8d69cb['body']['results'][0x0][_0x5fd8('0x87')];break;case _0x5fd8('0x93'):_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x84')]=_0x8d69cb[_0x5fd8('0x5f')][_0x5fd8('0x94')];_0x3b538a[_0x5fd8('0x5f')]['body']=_0x8d69cb[_0x5fd8('0x5f')][_0x5fd8('0x95')][_0x5fd8('0x2a')];break;case'clickatell':_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x84')]=_0x8d69cb[_0x5fd8('0x5f')][_0x5fd8('0x96')];_0x3b538a[_0x5fd8('0x5f')]['body']=_0x8d69cb[_0x5fd8('0x5f')]['text'];_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x87')]=_0x8d69cb[_0x5fd8('0x5f')][_0x5fd8('0x97')];break;case _0x5fd8('0x98'):_0x3b538a['body'][_0x5fd8('0x84')]=_0x8d69cb[_0x5fd8('0x5f')][_0x5fd8('0x84')];_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x5f')]=_0x8d69cb['body'][_0x5fd8('0x2a')];_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x87')]=_0x8d69cb[_0x5fd8('0x5f')][_0x5fd8('0x99')];break;}}if(_0x3b538a[_0x5fd8('0x5f')]['id']){delete _0x3b538a[_0x5fd8('0x5f')]['id'];}if(_['isNil'](_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x84')])){throw new db[(_0x5fd8('0x7a'))][(_0x5fd8('0x7b'))](_0x5fd8('0x9a'));}if(_[_0x5fd8('0x9b')](_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x5f')])||_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x5f')]===''){throw new db['Sequelize'][(_0x5fd8('0x7b'))](_0x5fd8('0x9c'));}if(_[_0x5fd8('0x9b')](_0x3b538a['body'][_0x5fd8('0x9d')])){throw new db[(_0x5fd8('0x7a'))][(_0x5fd8('0x7b'))](_0x5fd8('0x9e')+_0x1f5e71);}if(!_[_0x5fd8('0x9f')](_0x1f5e71,_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x9d')])){throw new db[(_0x5fd8('0x7a'))][(_0x5fd8('0x7b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f5e71);}_0x1bbdce[_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x9d')]]=_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x84')];return db[_0x5fd8('0xa0')][_0x5fd8('0x5d')]({'where':{'id':_0x3b538a[_0x5fd8('0x75')][_0x5fd8('0x80')]},'include':[{'model':db[_0x5fd8('0xa1')],'as':'Contacts','where':_0x1bbdce,'limit':0x1,'order':[['updatedAt',_0x5fd8('0xa2')]]}]});})[_0x5fd8('0x22')](handleEntityNotFound(_0x2458a0,null))[_0x5fd8('0x22')](function(_0x4b837b){if(_0x4b837b){_0x3b538a[_0x5fd8('0xa3')]=_[_0x5fd8('0xa4')](_0x4b837b,['Contacts']);if(_0x4b837b[_0x5fd8('0xa5')]['length']){return _0x4b837b[_0x5fd8('0xa5')][0x0];}var _0x3c9235=_['defaults'](_0x3b538a['body'],{'firstName':_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x84')],'ListId':_0x4b837b['id']});_0x3c9235[_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x9d')]]=_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x84')];return db['CmContact']['create'](_0x3c9235,{'fields':_0x2caa79,'raw':!![]});}})['then'](handleEntityNotFound(_0x2458a0,null))[_0x5fd8('0x22')](function(_0x2cdc61){if(_0x2cdc61){_0x3b538a[_0x5fd8('0xa6')]=_0x2cdc61;var _0x244378={'ContactId':_0x2cdc61['id'],'phone':_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x84')],'SmsAccountId':_0x8d69cb[_0x5fd8('0x5b')]['id']};var _0x4fe711={'ContactId':_0x2cdc61['id'],'SmsAccountId':_0x8d69cb[_0x5fd8('0x5b')]['id'],'closed':![]};return db[_0x5fd8('0xa7')]['find']({'where':_0x4fe711})[_0x5fd8('0x22')](function(_0x5d349e){if(_0x5d349e){return[_0x5d349e,![]];}return db[_0x5fd8('0xa7')][_0x5fd8('0x5e')](_0x244378)[_0x5fd8('0x22')](function(_0x49fc67){return[_0x49fc67,!![]];});});}})['spread'](function(_0x594803,_0x12c1bb){_0x3b538a['interaction']=_0x594803['get']({'plain':!![]});_0x3b538a[_0x5fd8('0xa8')][_0x5fd8('0xa9')]=![];if(_0x12c1bb){if(_0x3b538a[_0x5fd8('0x75')]['autoclose']){_0x3b538a[_0x5fd8('0x76')][_0x5fd8('0xaa')]({'id':0x0,'priority':_0x3b538a[_0x5fd8('0x76')][_0x5fd8('0x49')]+0x1,'app':_0x5fd8('0xab'),'appdata':'unmanaged','interval':_0x5fd8('0xac')});}_0x3b538a[_0x5fd8('0xa8')][_0x5fd8('0xa9')]=!![];}return db[_0x5fd8('0xad')][_0x5fd8('0x5e')]({'phone':_0x3b538a[_0x5fd8('0x5f')]['from'],'messageId':_0x3b538a[_0x5fd8('0x5f')]['messageId'],'body':_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0x5f')],'SmsAccountId':_0x8d69cb['params']['id'],'SmsInteractionId':_0x594803['id'],'direction':'in','ContactId':_0x594803['ContactId'],'AttachmentId':_0x3b538a[_0x5fd8('0x5f')][_0x5fd8('0xae')]});})['then'](function(_0x2f78ea){_0x3b538a[_0x5fd8('0x2a')]=_0x2f78ea;if(_0x3b538a[_0x5fd8('0xa8')][_0x5fd8('0xaf')]){return db['User'][_0x5fd8('0x5d')]({'attributes':['id',_0x5fd8('0x3e')],'where':{'id':_0x3b538a['interaction']['UserId']}})['then'](function(_0x46f116){if(_0x46f116){_0x3b538a[_0x5fd8('0x76')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5fd8('0xb0'),'appdata':_0x46f116['name']+','+(_0x3b538a[_0x5fd8('0x75')]['waitForTheAssignedAgent']||0xa),'interval':_0x5fd8('0xac')});}return respondWithRpcPromise(_0x5fd8('0xb1'),_0x5fd8('0xb2'),_0x3b538a);});}return respondWithRpcPromise(_0x5fd8('0xb1'),'startRouting',_0x3b538a);})[_0x5fd8('0x22')](function(_0x2df9ba){if(_0x2df9ba){var _0x4e46c1=0xc8;var _0x3c2be9='receiveMessage';logger[_0x5fd8('0x23')](_0x5fd8('0xb3'),_0x3c2be9,_0x4e46c1,_0x5fd8('0xb4'));logger[_0x5fd8('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3c2be9,_0x4e46c1,_0x5fd8('0xb4'),JSON['stringify'](_0x2df9ba));if(_0x3b538a[_0x5fd8('0x75')]['type']===_0x5fd8('0x83')){return _0x2458a0['status'](_0x4e46c1)[_0x5fd8('0x31')](_0x5fd8('0xb5'),_0x5fd8('0xb6'))[_0x5fd8('0xb7')](_0x5fd8('0xb8'));}else{return _0x2458a0[_0x5fd8('0x2d')](_0x4e46c1)[_0x5fd8('0x33')](_0x2df9ba);}}})[_0x5fd8('0x2c')](handleError(_0x2458a0,null));};exports[_0x5fd8('0xb9')]=function(_0x3d94e0,_0x1bb1b2,_0x2a2f22){return db['SmsAccount'][_0x5fd8('0x6f')]({'where':{'id':_0x3d94e0[_0x5fd8('0x5b')]['id']}})[_0x5fd8('0x22')](handleEntityNotFound(_0x1bb1b2,null))['then'](function(_0x43d61e){if(_0x43d61e){return db['sequelize']['transaction'](function(_0x28576d){return db[_0x5fd8('0x74')][_0x5fd8('0x38')]({'where':{'SmsAccountId':_0x3d94e0[_0x5fd8('0x5b')]['id']},'transaction':_0x28576d})[_0x5fd8('0x22')](function(_0x4faa2e){var _0x4dcbe8=_[_0x5fd8('0x51')](_0x3d94e0['body'],function(_0xba1dd0){_0xba1dd0[_0x5fd8('0x69')]=_0x3d94e0[_0x5fd8('0x5b')]['id'];return _0xba1dd0;});return db[_0x5fd8('0x74')]['bulkCreate'](_0x4dcbe8,{'transaction':_0x28576d});});})[_0x5fd8('0x22')](function(){return db[_0x5fd8('0x74')][_0x5fd8('0xba')]({'where':{'SmsAccountId':_0x3d94e0[_0x5fd8('0x5b')]['id']},'order':_0x5fd8('0x79')});});}})['then'](respondWithResult(_0x1bb1b2,null))[_0x5fd8('0x2c')](handleError(_0x1bb1b2,null));};exports[_0x5fd8('0xbb')]=function(_0x1c0b00,_0x474625,_0x5502e0){var _0x30e917={};var _0x3b3fb8={};var _0x2accee;var _0x1a7a8b;return db[_0x5fd8('0x41')][_0x5fd8('0x6f')]({'where':{'id':_0x1c0b00[_0x5fd8('0x5b')]['id']}})[_0x5fd8('0x22')](handleEntityNotFound(_0x474625,null))[_0x5fd8('0x22')](function(_0x4a7420){if(_0x4a7420){_0x2accee=_0x4a7420;_0x3b3fb8[_0x5fd8('0x46')]=_[_0x5fd8('0x42')](db[_0x5fd8('0x74')][_0x5fd8('0x71')]);_0x3b3fb8['query']=_[_0x5fd8('0x42')](_0x1c0b00['query']);_0x3b3fb8['filters']=_['intersection'](_0x3b3fb8[_0x5fd8('0x46')],_0x3b3fb8[_0x5fd8('0x43')]);_0x30e917['attributes']=_['intersection'](_0x3b3fb8[_0x5fd8('0x46')],qs[_0x5fd8('0x48')](_0x1c0b00['query']['fields']));_0x30e917[_0x5fd8('0x47')]=_0x30e917[_0x5fd8('0x47')]['length']?_0x30e917[_0x5fd8('0x47')]:_0x3b3fb8['model'];_0x30e917[_0x5fd8('0x4c')]=qs[_0x5fd8('0x4d')](_0x1c0b00['query'][_0x5fd8('0x4d')]);_0x30e917[_0x5fd8('0x4e')]=qs[_0x5fd8('0x44')](_[_0x5fd8('0x6c')](_0x1c0b00[_0x5fd8('0x43')],_0x3b3fb8[_0x5fd8('0x44')]));if(_0x1c0b00['query'][_0x5fd8('0x4f')]){_0x30e917[_0x5fd8('0x4e')]=_['merge'](_0x30e917[_0x5fd8('0x4e')],{'$or':_['map'](_0x30e917[_0x5fd8('0x47')],function(_0x48781e){var _0xf038f9={};_0xf038f9[_0x48781e]={'$like':'%'+_0x1c0b00[_0x5fd8('0x43')]['filter']+'%'};return _0xf038f9;})});}_0x30e917=_[_0x5fd8('0x50')]({},_0x30e917,_0x1c0b00[_0x5fd8('0x55')]);return _0x2accee['getApplications'](_0x30e917);}})['then'](function(_0x4d0201){if(_0x4d0201){_0x1a7a8b=_0x4d0201[_0x5fd8('0x49')];if(!_0x1c0b00[_0x5fd8('0x43')][_0x5fd8('0x4a')]('nolimit')){_0x30e917[_0x5fd8('0x30')]=qs[_0x5fd8('0x30')](_0x1c0b00['query'][_0x5fd8('0x30')]);_0x30e917[_0x5fd8('0x2f')]=qs[_0x5fd8('0x2f')](_0x1c0b00[_0x5fd8('0x43')][_0x5fd8('0x2f')]);}return _0x2accee[_0x5fd8('0xbb')](_0x30e917);}})['then'](function(_0x50b517){if(_0x50b517){return _0x50b517?{'count':_0x1a7a8b,'rows':_0x50b517}:null;}})[_0x5fd8('0x22')](respondWithResult(_0x474625,null))['catch'](handleError(_0x474625,null));};exports['getInteractions']=function(_0x5af2ec,_0x25d20,_0x5d7043){var _0x23000={'raw':![],'where':{}};var _0x5b6867={};var _0x3c233d={'count':0x0,'rows':[]};return db[_0x5fd8('0x41')][_0x5fd8('0x6f')]({'where':{'id':_0x5af2ec['params']['id']}})[_0x5fd8('0x22')](handleEntityNotFound(_0x25d20,null))['then'](function(_0x5d7a80){if(_0x5d7a80){_0x5b6867['model']=_[_0x5fd8('0x42')](db[_0x5fd8('0xa7')]['rawAttributes']);_0x5b6867[_0x5fd8('0x43')]=_['keys'](_0x5af2ec[_0x5fd8('0x43')]);_0x5b6867[_0x5fd8('0x44')]=_[_0x5fd8('0x45')](_0x5b6867['model'],_0x5b6867[_0x5fd8('0x43')]);_0x23000[_0x5fd8('0x47')]=_[_0x5fd8('0x45')](_0x5b6867[_0x5fd8('0x46')],qs['fields'](_0x5af2ec[_0x5fd8('0x43')]['fields']));_0x23000['attributes']=_0x23000[_0x5fd8('0x47')][_0x5fd8('0x49')]?_0x23000['attributes']:_0x5b6867['model'];if(!_0x5af2ec[_0x5fd8('0x43')][_0x5fd8('0x4a')](_0x5fd8('0x4b'))){_0x23000['limit']=qs['limit'](_0x5af2ec[_0x5fd8('0x43')]['limit']);_0x23000['offset']=qs['offset'](_0x5af2ec[_0x5fd8('0x43')][_0x5fd8('0x2f')]);}_0x23000[_0x5fd8('0x4c')]=qs[_0x5fd8('0x4d')](_0x5af2ec[_0x5fd8('0x43')][_0x5fd8('0x4d')]);_0x23000[_0x5fd8('0x4e')]=qs[_0x5fd8('0x44')](_[_0x5fd8('0x6c')](_0x5af2ec['query'],_0x5b6867[_0x5fd8('0x44')]));_0x23000[_0x5fd8('0x4e')][_0x5fd8('0x69')]=_0x5d7a80['id'];if(_0x5af2ec[_0x5fd8('0x43')][_0x5fd8('0x4f')]){_0x23000['where']=_[_0x5fd8('0x50')](_0x23000['where'],{'$or':_[_0x5fd8('0x51')](_0x23000[_0x5fd8('0x47')],function(_0x4d8933){var _0x3d1c28={};_0x3d1c28[_0x4d8933]={'$like':'%'+_0x5af2ec[_0x5fd8('0x43')][_0x5fd8('0x4f')]+'%'};return _0x3d1c28;})});}_0x23000=_[_0x5fd8('0x50')]({},_0x23000,_0x5af2ec['options']);return db[_0x5fd8('0xa7')][_0x5fd8('0x2e')]({'where':_0x23000[_0x5fd8('0x4e')]})[_0x5fd8('0x22')](function(_0x128194){_0x3c233d[_0x5fd8('0x2e')]=_0x128194;if(_0x5af2ec['query'][_0x5fd8('0x56')]){_0x23000[_0x5fd8('0x57')]=[{'model':db['CmContact'],'as':_0x5fd8('0xbc'),'required':![]},{'model':db[_0x5fd8('0xbd')],'as':_0x5fd8('0xbe'),'attributes':[_0x5fd8('0x3e'),_0x5fd8('0xbf'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x5fd8('0xc0'),'attributes':['id','name','color'],'where':_0x5af2ec[_0x5fd8('0x43')][_0x5fd8('0xc1')]?{'id':_0x5af2ec[_0x5fd8('0x43')][_0x5fd8('0xc1')]}:undefined,'required':_0x5af2ec[_0x5fd8('0x43')][_0x5fd8('0xc1')]?!![]:![]}];}return db[_0x5fd8('0xa7')]['findAll'](_0x23000);})['then'](function(_0x56809c){_0x3c233d['rows']=_0x56809c;return _0x3c233d;});}})['then'](respondWithFilteredResult(_0x25d20,_0x23000))['catch'](handleError(_0x25d20,null));};exports[_0x5fd8('0xb7')]=function(_0x130127,_0x1c2d87,_0x555f7e){var _0xdda4ed,_0x51e0f9,_0xe561f9;if(_[_0x5fd8('0x9b')](_0x130127[_0x5fd8('0x5f')][_0x5fd8('0x5f')])||_0x130127[_0x5fd8('0x5f')][_0x5fd8('0x5f')]===''){throw new db[(_0x5fd8('0x7a'))][(_0x5fd8('0x7b'))](_0x5fd8('0x9c'));}if(_[_0x5fd8('0x9b')](_0x130127[_0x5fd8('0x5f')]['to'])){throw new db[(_0x5fd8('0x7a'))][(_0x5fd8('0x7b'))](_0x5fd8('0xc2'));}_0xdda4ed=_0x130127[_0x5fd8('0x5f')]['to'];return db[_0x5fd8('0x41')][_0x5fd8('0x5d')]({'where':{'id':_0x130127[_0x5fd8('0x5b')]['id']},'include':[{'model':db[_0x5fd8('0xa0')],'as':_0x5fd8('0xc3'),'include':[{'model':db[_0x5fd8('0xa1')],'as':_0x5fd8('0xa5'),'where':{'mobile':_0xdda4ed},'limit':0x1,'order':[[_0x5fd8('0x7f'),_0x5fd8('0xa2')]]}]}]})[_0x5fd8('0x22')](handleEntityNotFound(_0x1c2d87,null))['then'](function(_0x363688){if(_0x363688&&_0x363688[_0x5fd8('0xc3')]){_0x51e0f9=_0x363688[_0x5fd8('0x39')]({'plain':!![]});if(_0x51e0f9[_0x5fd8('0xc3')]&&_0x51e0f9['List']['Contacts'][_0x5fd8('0x49')]){return _0x51e0f9[_0x5fd8('0xc3')][_0x5fd8('0xa5')][0x0];}return db['CmContact'][_0x5fd8('0x5e')](_[_0x5fd8('0x19')](_0x130127[_0x5fd8('0x5f')],{'firstName':_0xdda4ed,'mobile':_0xdda4ed,'phone':_0xdda4ed,'ListId':_0x51e0f9[_0x5fd8('0x80')]}));}})['then'](handleEntityNotFound(_0x1c2d87,null))[_0x5fd8('0x22')](function(_0x492547){if(_0x492547){_0xe561f9=_0x492547;return db[_0x5fd8('0xa7')]['find']({'where':{'ContactId':_0xe561f9['id'],'closed':![],'SmsAccountId':_0x51e0f9['id']}})[_0x5fd8('0x22')](function(_0x1f7aaa){if(_0x1f7aaa){return[_0x1f7aaa,![]];}return db[_0x5fd8('0xa7')]['create']({'UserId':_0x130127[_0x5fd8('0x60')]['id'],'ContactId':_0xe561f9['id'],'SmsAccountId':_0x51e0f9['id'],'phone':_0xdda4ed,'firstMsgDirection':'out','Messages':[_[_0x5fd8('0x50')](_0x130127[_0x5fd8('0x5f')],{'read':![],'body':_0x130127[_0x5fd8('0x5f')][_0x5fd8('0x5f')],'phone':_0xdda4ed,'SmsAccountId':_0x51e0f9['id'],'UserId':_0x130127[_0x5fd8('0x60')]['id'],'ContactId':_0xe561f9['id']})]},{'include':[{'model':db[_0x5fd8('0xad')],'as':_0x5fd8('0xc4')}]})[_0x5fd8('0x22')](function(_0x2cc3cb){return[_0x2cc3cb,!![]];});});}})[_0x5fd8('0xc5')](function(_0x52477e,_0x1e23ef){if(_0x1e23ef){return _0x52477e;}return db['SmsMessage'][_0x5fd8('0x5e')](_[_0x5fd8('0x50')](_0x130127['body'],{'read':![],'body':_0x130127[_0x5fd8('0x5f')][_0x5fd8('0x5f')],'phone':_0xdda4ed,'SmsAccountId':_0x51e0f9['id'],'SmsInteractionId':_0x52477e['id'],'UserId':_0x130127[_0x5fd8('0x60')]['id'],'ContactId':_0xe561f9['id']}))[_0x5fd8('0x22')](function(_0x5e7f1d){_0x52477e['dataValues'][_0x5fd8('0xc4')]=[];_0x52477e[_0x5fd8('0xc6')][_0x5fd8('0xc4')][_0x5fd8('0xaa')](_0x5e7f1d[_0x5fd8('0xc6')]);return _0x52477e;});})[_0x5fd8('0x22')](respondWithResult(_0x1c2d87,null))[_0x5fd8('0x2c')](handleError(_0x1c2d87,null));};exports[_0x5fd8('0x2d')]=function(_0x18e646,_0x1f0495,_0x41e210){if(_0x18e646[_0x5fd8('0x5f')]['id']){delete _0x18e646[_0x5fd8('0x5f')]['id'];}console[_0x5fd8('0xc7')]('endpoint\x20/status\x20POST\x20/',_0x18e646[_0x5fd8('0x5f')]);var _0x764b36,_0x4a265e,_0x1ea227;return db[_0x5fd8('0x41')][_0x5fd8('0x5d')]({'where':{'id':_0x18e646[_0x5fd8('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1f0495,null))[_0x5fd8('0x22')](function(_0x236071){if(_0x236071){_0x1ea227=_0x236071;logger[_0x5fd8('0x26')](_0x5fd8('0xb3'),_0x5fd8('0x2d'),_0x5fd8('0xc8'),_0x236071[_0x5fd8('0x82')],util[_0x5fd8('0xc9')](_0x18e646[_0x5fd8('0x5f')],{'showHidden':![],'depth':null}));switch(_0x236071[_0x5fd8('0x82')]){case _0x5fd8('0x89'):if(_0x18e646[_0x5fd8('0x5f')][_0x5fd8('0xca')]&&_0x18e646[_0x5fd8('0x5f')][_0x5fd8('0x2d')]){_0x4a265e=_0x18e646['body'][_0x5fd8('0x2d')];return db['SmsMessage'][_0x5fd8('0x5d')]({'where':{'messageId':_0x18e646[_0x5fd8('0x5f')][_0x5fd8('0xca')]}});}break;case'connectel':if(_0x18e646[_0x5fd8('0x5f')][_0x5fd8('0xcb')]&&_0x18e646['body'][_0x5fd8('0xcc')]){_0x4a265e=_0x18e646[_0x5fd8('0x5f')][_0x5fd8('0xcc')];return db['SmsMessage'][_0x5fd8('0x5d')]({'where':{'messageId':_0x18e646[_0x5fd8('0x5f')][_0x5fd8('0xcb')]}});}break;case _0x5fd8('0x8d'):if(_0x18e646['body'][_0x5fd8('0x8e')]&&_0x18e646['body'][_0x5fd8('0xcd')]){_0x4a265e=_0x18e646[_0x5fd8('0x5f')]['status_code'];return db[_0x5fd8('0xad')]['find']({'where':{'messageId':_0x18e646[_0x5fd8('0x5f')][_0x5fd8('0x8e')]}});}break;case'infobip':var _0x232e42=_0x18e646[_0x5fd8('0x5f')][_0x5fd8('0x92')][0x0];if(_0x232e42[_0x5fd8('0x87')]&&_0x232e42[_0x5fd8('0x2d')][_0x5fd8('0xce')]===_0x5fd8('0xcf')){_0x4a265e=_0x232e42['status'][_0x5fd8('0xce')];return db['SmsMessage'][_0x5fd8('0x5d')]({'where':{'messageId':_0x232e42['messageId']}});}break;case _0x5fd8('0xd0'):if(_0x18e646[_0x5fd8('0x5f')][_0x5fd8('0x87')]&&_0x18e646[_0x5fd8('0x5f')]['status']){_0x4a265e=_0x18e646[_0x5fd8('0x5f')][_0x5fd8('0x2d')];return db['SmsMessage'][_0x5fd8('0x5d')]({'where':{'messageId':_0x18e646[_0x5fd8('0x5f')][_0x5fd8('0x87')]}});}break;case _0x5fd8('0x98'):if(_0x18e646[_0x5fd8('0x5f')][_0x5fd8('0xd1')]&&_0x18e646[_0x5fd8('0x5f')][_0x5fd8('0x2d')]){_0x4a265e=_0x18e646['body'][_0x5fd8('0x2d')];return db[_0x5fd8('0xad')][_0x5fd8('0x5d')]({'where':{'messageId':_0x18e646[_0x5fd8('0x5f')]['redif']}});}break;}}})[_0x5fd8('0x22')](handleEntityNotFound(_0x1f0495,null))[_0x5fd8('0x22')](function(_0x1311d6){if(_0x1311d6){_0x764b36=_0x1311d6;switch(_0x1ea227['type']){case _0x5fd8('0x89'):if(_0x4a265e===_0x5fd8('0xcf')){return _0x764b36['update']({'read':!![]});}else{logger[_0x5fd8('0x28')](_0x5fd8('0xb3'),_0x5fd8('0x2d'),_0x5fd8('0x89'),util[_0x5fd8('0xc9')](_0x18e646[_0x5fd8('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x5fd8('0x8c'):if(_0x4a265e==='1'){return _0x764b36[_0x5fd8('0x37')]({'read':!![]});}else{logger[_0x5fd8('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5fd8('0x2d'),_0x5fd8('0x89'),util[_0x5fd8('0xc9')](_0x18e646['body'],{'showHidden':![],'depth':null}));}break;case _0x5fd8('0x8d'):if(!_0x18e646[_0x5fd8('0x5f')][_0x5fd8('0xd2')]&&_0x4a265e>=0xc8&&_0x4a265e<=0xce){return _0x764b36['update']({'read':!![]});}else{logger['error'](_0x5fd8('0xb3'),'status',_0x5fd8('0x8d'),util[_0x5fd8('0xc9')](_0x18e646[_0x5fd8('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x5fd8('0x91'):var _0x521c27=_0x18e646[_0x5fd8('0x5f')][_0x5fd8('0x92')][0x0];if(_0x521c27[_0x5fd8('0x2d')]['groupName']===_0x5fd8('0xcf')){return _0x764b36[_0x5fd8('0x37')]({'read':!![]});}else{logger[_0x5fd8('0x28')](_0x5fd8('0xb3'),'status','infobip',util[_0x5fd8('0xc9')](_0x18e646[_0x5fd8('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x5fd8('0xd0'):if(_0x4a265e==_0x5fd8('0xd3')||_0x4a265e=='RECEIVED_BY_RECIPIENT'){return _0x764b36[_0x5fd8('0x37')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5fd8('0x2d'),_0x5fd8('0xd0'),util[_0x5fd8('0xc9')](_0x18e646[_0x5fd8('0x5f')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x4a265e===_0x5fd8('0xd4')||_0x4a265e===_0x5fd8('0xd5')){return _0x764b36['update']({'read':!![]});}else{logger[_0x5fd8('0x28')](_0x5fd8('0xb3'),_0x5fd8('0x2d'),_0x5fd8('0x98'),util['inspect'](_0x18e646[_0x5fd8('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x764b36;}})[_0x5fd8('0x22')](respondWithResult(_0x1f0495,null))[_0x5fd8('0x2c')](handleError(_0x1f0495,null));};exports['statusGet']=function(_0x3e1804,_0x130556,_0x25e68b){var _0x34c6a5,_0x26b1a0,_0x431314;return db[_0x5fd8('0x41')]['find']({'where':{'id':_0x3e1804[_0x5fd8('0x5b')]['id']}})[_0x5fd8('0x22')](handleEntityNotFound(_0x130556,null))[_0x5fd8('0x22')](function(_0x503600){if(_0x503600){_0x431314=_0x503600;logger[_0x5fd8('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x5fd8('0xc8'),_0x503600['type'],util['inspect'](_0x3e1804[_0x5fd8('0x43')],{'showHidden':![],'depth':null}));switch(_0x503600[_0x5fd8('0x82')]){case _0x5fd8('0x93'):if(_0x3e1804['query']['message-id']&&_0x3e1804[_0x5fd8('0x43')][_0x5fd8('0xd6')]){_0x26b1a0=_0x3e1804[_0x5fd8('0x43')][_0x5fd8('0xd6')];return db[_0x5fd8('0xad')][_0x5fd8('0x5d')]({'where':{'messageId':_0x3e1804[_0x5fd8('0x43')][_0x5fd8('0xd7')]}});}break;}}})[_0x5fd8('0x22')](handleEntityNotFound(_0x130556,null))[_0x5fd8('0x22')](function(_0x31dc15){if(_0x31dc15){_0x34c6a5=_0x31dc15;switch(_0x431314[_0x5fd8('0x82')]){case _0x5fd8('0x93'):if(_0x26b1a0==='2'||_0x26b1a0==='6'){return _0x34c6a5[_0x5fd8('0x37')]({'read':!![]});}else{logger[_0x5fd8('0x28')](_0x5fd8('0xb3'),_0x5fd8('0x2d'),_0x5fd8('0x93'),util[_0x5fd8('0xc9')](_0x3e1804[_0x5fd8('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x34c6a5;}})[_0x5fd8('0x22')](respondWithResult(_0x130556,null))[_0x5fd8('0x2c')](handleError(_0x130556,null));};exports[_0x5fd8('0xd8')]=function(_0x3f92d0,_0x1eeed2,_0x5d1c28){return db[_0x5fd8('0x41')]['find']({'where':{'id':_0x3f92d0[_0x5fd8('0x5b')]['id']}})[_0x5fd8('0x22')](handleEntityNotFound(_0x1eeed2,null))[_0x5fd8('0x22')](function(_0x19ba1d){if(_0x19ba1d){return _0x19ba1d['addAgents'](_0x3f92d0['body'][_0x5fd8('0x6e')],_['omit'](_0x3f92d0[_0x5fd8('0x5f')],[_0x5fd8('0x6e'),'id'])||{})[_0x5fd8('0xc5')](function(_0x1154c6){for(var _0x40281d=0x0;_0x40281d<_0x3f92d0[_0x5fd8('0x5f')][_0x5fd8('0x6e')][_0x5fd8('0x49')];_0x40281d+=0x1){socket['emit'](_0x5fd8('0xd9'),{'UserId':_0x3f92d0[_0x5fd8('0x5f')][_0x5fd8('0x6e')][_0x40281d],'SmsAccountId':_0x3f92d0[_0x5fd8('0x5b')]['id']});}return _0x1154c6;});}})[_0x5fd8('0x22')](respondWithResult(_0x1eeed2,null))[_0x5fd8('0x2c')](handleError(_0x1eeed2,null));};exports[_0x5fd8('0xda')]=function(_0x291551,_0x5f76f0,_0x362cb4){return db['SmsAccount'][_0x5fd8('0x5d')]({'where':{'id':_0x291551[_0x5fd8('0x5b')]['id']}})[_0x5fd8('0x22')](handleEntityNotFound(_0x5f76f0,null))['then'](function(_0x3a69e3){if(_0x3a69e3){return _0x3a69e3['removeAgents'](_0x291551[_0x5fd8('0x43')][_0x5fd8('0x6e')])[_0x5fd8('0x22')](function(){if(_[_0x5fd8('0xdb')](_0x291551[_0x5fd8('0x43')][_0x5fd8('0x6e')])){for(var _0x2ffef6=0x0;_0x2ffef6<_0x291551['query'][_0x5fd8('0x6e')][_0x5fd8('0x49')];_0x2ffef6+=0x1){socket[_0x5fd8('0xdc')](_0x5fd8('0xdd'),{'UserId':Number(_0x291551[_0x5fd8('0x43')][_0x5fd8('0x6e')][_0x2ffef6]),'SmsAccountId':Number(_0x291551[_0x5fd8('0x5b')]['id'])});}}else{socket[_0x5fd8('0xdc')](_0x5fd8('0xdd'),{'UserId':Number(_0x291551[_0x5fd8('0x43')][_0x5fd8('0x6e')]),'SmsAccountId':Number(_0x291551['params']['id'])});}});}})[_0x5fd8('0x22')](respondWithStatusCode(_0x5f76f0,null))[_0x5fd8('0x2c')](handleError(_0x5f76f0,null));};exports[_0x5fd8('0xde')]=function(_0x27de7f,_0x569c19,_0xf5ae74){var _0x2cd115={};var _0x5d5904={};var _0x125c9a;var _0x3ac87f;return db[_0x5fd8('0x41')][_0x5fd8('0x6f')]({'where':{'id':_0x27de7f[_0x5fd8('0x5b')]['id']}})[_0x5fd8('0x22')](handleEntityNotFound(_0x569c19,null))[_0x5fd8('0x22')](function(_0x118ef4){if(_0x118ef4){_0x125c9a=_0x118ef4;_0x5d5904['model']=_[_0x5fd8('0x42')](db[_0x5fd8('0xbd')][_0x5fd8('0x71')]);_0x5d5904[_0x5fd8('0x43')]=_[_0x5fd8('0x42')](_0x27de7f[_0x5fd8('0x43')]);_0x5d5904[_0x5fd8('0x44')]=_[_0x5fd8('0x45')](_0x5d5904['model'],_0x5d5904['query']);_0x2cd115[_0x5fd8('0x47')]=_[_0x5fd8('0x45')](_0x5d5904[_0x5fd8('0x46')],qs[_0x5fd8('0x48')](_0x27de7f[_0x5fd8('0x43')][_0x5fd8('0x48')]));_0x2cd115[_0x5fd8('0x47')]=_0x2cd115[_0x5fd8('0x47')][_0x5fd8('0x49')]?_0x2cd115['attributes']:_0x5d5904[_0x5fd8('0x46')];_0x2cd115[_0x5fd8('0x4c')]=qs[_0x5fd8('0x4d')](_0x27de7f[_0x5fd8('0x43')][_0x5fd8('0x4d')]);_0x2cd115[_0x5fd8('0x4e')]=qs[_0x5fd8('0x44')](_[_0x5fd8('0x6c')](_0x27de7f[_0x5fd8('0x43')],_0x5d5904[_0x5fd8('0x44')]));if(_0x27de7f[_0x5fd8('0x43')][_0x5fd8('0x4f')]){_0x2cd115[_0x5fd8('0x4e')]=_['merge'](_0x2cd115[_0x5fd8('0x4e')],{'$or':_[_0x5fd8('0x51')](_0x2cd115[_0x5fd8('0x47')],function(_0x57621a){var _0x1d16cc={};_0x1d16cc[_0x57621a]={'$like':'%'+_0x27de7f[_0x5fd8('0x43')][_0x5fd8('0x4f')]+'%'};return _0x1d16cc;})});}_0x2cd115=_[_0x5fd8('0x50')]({},_0x2cd115,_0x27de7f['options']);return _0x125c9a['getAgents'](_0x2cd115);}})[_0x5fd8('0x22')](function(_0x30b0ef){if(_0x30b0ef){_0x3ac87f=_0x30b0ef['length'];if(!_0x27de7f[_0x5fd8('0x43')]['hasOwnProperty'](_0x5fd8('0x4b'))){_0x2cd115['limit']=qs[_0x5fd8('0x30')](_0x27de7f['query'][_0x5fd8('0x30')]);_0x2cd115[_0x5fd8('0x2f')]=qs[_0x5fd8('0x2f')](_0x27de7f['query']['offset']);}return _0x125c9a[_0x5fd8('0xde')](_0x2cd115);}})[_0x5fd8('0x22')](function(_0x444771){if(_0x444771){return _0x444771?{'count':_0x3ac87f,'rows':_0x444771}:null;}})[_0x5fd8('0x22')](respondWithResult(_0x569c19,null))[_0x5fd8('0x2c')](handleError(_0x569c19,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 80cfa96..64f4f56 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 _0xbd90=['../../mysqldb','SmsAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbd90,0x1c2));var _0x0bd9=function(_0xcac9c7,_0x505686){_0xcac9c7=_0xcac9c7-0x0;var _0x2f2dc4=_0xbd90[_0xcac9c7];return _0x2f2dc4;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x0bd9('0x0'))['db'][_0x0bd9('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x0bd9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0bd9('0x3'),'afterDestroy':_0x0bd9('0x4')};function emitEvent(_0x5c3698){return function(_0x2fdda4,_0xa017cb,_0x44c769){SmsAccountEvents[_0x0bd9('0x5')](_0x5c3698+':'+_0x2fdda4['id'],_0x2fdda4);SmsAccountEvents[_0x0bd9('0x5')](_0x5c3698,_0x2fdda4);_0x44c769(null);};}for(var e in events){if(events[_0x0bd9('0x6')](e)){var event=events[e];SmsAccount[_0x0bd9('0x7')](e,emitEvent(event));}}module[_0x0bd9('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x7d1e=['SmsAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x7d1e,0x111));var _0xe7d1=function(_0x17045c,_0x470ebe){_0x17045c=_0x17045c-0x0;var _0x844ac5=_0x7d1e[_0x17045c];return _0x844ac5;};'use strict';var EventEmitter=require(_0xe7d1('0x0'));var SmsAccount=require(_0xe7d1('0x1'))['db'][_0xe7d1('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe7d1('0x3')](0x0);var events={'afterCreate':_0xe7d1('0x4'),'afterUpdate':_0xe7d1('0x5'),'afterDestroy':_0xe7d1('0x6')};function emitEvent(_0x4b2efd){return function(_0xfff071,_0x4bdb29,_0x3f1cb4){SmsAccountEvents[_0xe7d1('0x7')](_0x4b2efd+':'+_0xfff071['id'],_0xfff071);SmsAccountEvents[_0xe7d1('0x7')](_0x4b2efd,_0xfff071);_0x3f1cb4(null);};}for(var e in events){if(events[_0xe7d1('0x8')](e)){var event=events[e];SmsAccount[_0xe7d1('0x9')](e,emitEvent(event));}}module[_0xe7d1('0xa')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index c3d4e8a..cc1fc22 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 _0x0776=['define','SmsAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports'];(function(_0xbfba9a,_0x1509ce){var _0x48b95e=function(_0x380c30){while(--_0x380c30){_0xbfba9a['push'](_0xbfba9a['shift']());}};_0x48b95e(++_0x1509ce);}(_0x0776,0x16e));var _0x6077=function(_0xd6fe34,_0x261a1c){_0xd6fe34=_0xd6fe34-0x0;var _0x5a3565=_0x0776[_0xd6fe34];return _0x5a3565;};'use strict';var _=require(_0x6077('0x0'));var util=require(_0x6077('0x1'));var logger=require(_0x6077('0x2'))(_0x6077('0x3'));var moment=require(_0x6077('0x4'));var BPromise=require(_0x6077('0x5'));var rp=require(_0x6077('0x6'));var fs=require('fs');var path=require(_0x6077('0x7'));var rimraf=require(_0x6077('0x8'));var config=require(_0x6077('0x9'));var attributes=require(_0x6077('0xa'));module[_0x6077('0xb')]=function(_0xb6e1d6,_0x8e7583){return _0xb6e1d6[_0x6077('0xc')](_0x6077('0xd'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e52=['api','moment','bluebird','request-promise','rimraf','exports','define','lodash','util'];(function(_0x22910b,_0x5085aa){var _0x33b5ab=function(_0x515f37){while(--_0x515f37){_0x22910b['push'](_0x22910b['shift']());}};_0x33b5ab(++_0x5085aa);}(_0x7e52,0x8e));var _0x27e5=function(_0x54b97a,_0x17e2ea){_0x54b97a=_0x54b97a-0x0;var _0x2c5297=_0x7e52[_0x54b97a];return _0x2c5297;};'use strict';var _=require(_0x27e5('0x0'));var util=require(_0x27e5('0x1'));var logger=require('../../config/logger')(_0x27e5('0x2'));var moment=require(_0x27e5('0x3'));var BPromise=require(_0x27e5('0x4'));var rp=require(_0x27e5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x27e5('0x6'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x27e5('0x7')]=function(_0x3f1bd2,_0xe8b7dd){return _0x3f1bd2[_0x27e5('0x8')]('SmsAccount',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 7927b70..72f816e 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 _0x2590=['error','code','message','ShowSmsAccount','SmsAccount','find','options','raw','attributes','include','map','model','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1e1d07,_0x299b1e){var _0x225dce=function(_0x21fb0a){while(--_0x21fb0a){_0x1e1d07['push'](_0x1e1d07['shift']());}};_0x225dce(++_0x299b1e);}(_0x2590,0x79));var _0x0259=function(_0x16eaf1,_0x18cd3f){_0x16eaf1=_0x16eaf1-0x0;var _0x1c0756=_0x2590[_0x16eaf1];return _0x1c0756;};'use strict';var _=require('lodash');var util=require(_0x0259('0x0'));var moment=require(_0x0259('0x1'));var BPromise=require(_0x0259('0x2'));var rs=require(_0x0259('0x3'));var fs=require('fs');var Redis=require(_0x0259('0x4'));var db=require(_0x0259('0x5'))['db'];var utils=require(_0x0259('0x6'));var logger=require(_0x0259('0x7'))(_0x0259('0x8'));var config=require(_0x0259('0x9'));var jayson=require(_0x0259('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x0259('0xb')]=_[_0x0259('0xc')](config[_0x0259('0xb')],{'host':_0x0259('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0259('0xb')]));require(_0x0259('0xe'))['register'](socket);function respondWithRpcPromise(_0x8354ca,_0x6ace9b,_0x26a0be){return new BPromise(function(_0x2d13f1,_0x1af196){return client[_0x0259('0xf')](_0x8354ca,_0x26a0be)[_0x0259('0x10')](function(_0xee1ba){logger[_0x0259('0x11')](_0x0259('0x12'),_0x6ace9b,_0x0259('0x13'));logger[_0x0259('0x14')](_0x0259('0x15'),_0x6ace9b,_0x0259('0x13'),JSON[_0x0259('0x16')](_0xee1ba));if(_0xee1ba[_0x0259('0x17')]){if(_0xee1ba[_0x0259('0x17')][_0x0259('0x18')]===0x1f4){logger['error'](_0x0259('0x12'),_0x6ace9b,_0xee1ba['error'][_0x0259('0x19')]);return _0x1af196(_0xee1ba[_0x0259('0x17')][_0x0259('0x19')]);}logger[_0x0259('0x17')](_0x0259('0x12'),_0x6ace9b,_0xee1ba['error'][_0x0259('0x19')]);return _0x2d13f1(_0xee1ba[_0x0259('0x17')][_0x0259('0x19')]);}else{logger[_0x0259('0x11')]('SmsAccount,\x20%s,\x20%s',_0x6ace9b,_0x0259('0x13'));_0x2d13f1(_0xee1ba['result'][_0x0259('0x19')]);}})['catch'](function(_0x170ea6){logger[_0x0259('0x17')]('SmsAccount,\x20%s,\x20%s',_0x6ace9b,_0x170ea6);_0x1af196(_0x170ea6);});});}exports[_0x0259('0x1a')]=function(_0x435cbb){var _0x468def=this;return new Promise(function(_0x4b7dc2,_0x3a0d43){return db[_0x0259('0x1b')][_0x0259('0x1c')]({'raw':_0x435cbb[_0x0259('0x1d')]?_0x435cbb['options'][_0x0259('0x1e')]===undefined?!![]:![]:!![],'where':_0x435cbb[_0x0259('0x1d')]?_0x435cbb[_0x0259('0x1d')]['where']||null:null,'attributes':_0x435cbb['options']?_0x435cbb[_0x0259('0x1d')][_0x0259('0x1f')]||null:null,'include':_0x435cbb[_0x0259('0x1d')]?_0x435cbb['options'][_0x0259('0x20')]?_[_0x0259('0x21')](_0x435cbb[_0x0259('0x1d')][_0x0259('0x20')],function(_0x2f9807){return{'model':db[_0x2f9807[_0x0259('0x22')]],'as':_0x2f9807['as'],'attributes':_0x2f9807[_0x0259('0x1f')],'include':_0x2f9807[_0x0259('0x20')]?_[_0x0259('0x21')](_0x2f9807[_0x0259('0x20')],function(_0x3f68d8){return{'model':db[_0x3f68d8[_0x0259('0x22')]],'as':_0x3f68d8['as'],'attributes':_0x3f68d8[_0x0259('0x1f')],'include':_0x3f68d8[_0x0259('0x20')]?_[_0x0259('0x21')](_0x3f68d8['include'],function(_0xd2121f){return{'model':db[_0xd2121f['model']],'as':_0xd2121f['as'],'attributes':_0xd2121f[_0x0259('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0259('0x10')](function(_0x3a682e){logger[_0x0259('0x11')](_0x0259('0x1a'),_0x435cbb);logger['debug'](_0x0259('0x1a'),_0x435cbb,JSON[_0x0259('0x16')](_0x3a682e));_0x4b7dc2(_0x3a682e);})[_0x0259('0x23')](function(_0x3e9c1d){logger[_0x0259('0x17')](_0x0259('0x1a'),_0x3e9c1d[_0x0259('0x19')],_0x435cbb);_0x3a0d43(_0x468def[_0x0259('0x17')](0x1f4,_0x3e9c1d[_0x0259('0x19')]));});});}; \ No newline at end of file +var _0x9521=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SmsAccount','find','raw','options','attributes','include','map','model','debug','ShowSmsAccount'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x9521,0x98));var _0x1952=function(_0x2fa1c6,_0x4a5b8d){_0x2fa1c6=_0x2fa1c6-0x0;var _0x5f3257=_0x9521[_0x2fa1c6];return _0x5f3257;};'use strict';var _=require(_0x1952('0x0'));var util=require(_0x1952('0x1'));var moment=require(_0x1952('0x2'));var BPromise=require(_0x1952('0x3'));var rs=require(_0x1952('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1952('0x5'))['db'];var utils=require(_0x1952('0x6'));var logger=require(_0x1952('0x7'))(_0x1952('0x8'));var config=require(_0x1952('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1952('0xa')]({'port':0x232a});config[_0x1952('0xb')]=_['defaults'](config[_0x1952('0xb')],{'host':_0x1952('0xc'),'port':0x18eb});var socket=require(_0x1952('0xd'))(new Redis(config[_0x1952('0xb')]));require(_0x1952('0xe'))[_0x1952('0xf')](socket);function respondWithRpcPromise(_0x19140f,_0x3d4aac,_0x2a2f3c){return new BPromise(function(_0x53f3c3,_0x4f7082){return client[_0x1952('0x10')](_0x19140f,_0x2a2f3c)[_0x1952('0x11')](function(_0x3c80f0){logger['info'](_0x1952('0x12'),_0x3d4aac,_0x1952('0x13'));logger['debug'](_0x1952('0x14'),_0x3d4aac,_0x1952('0x13'),JSON[_0x1952('0x15')](_0x3c80f0));if(_0x3c80f0[_0x1952('0x16')]){if(_0x3c80f0[_0x1952('0x16')][_0x1952('0x17')]===0x1f4){logger[_0x1952('0x16')](_0x1952('0x12'),_0x3d4aac,_0x3c80f0[_0x1952('0x16')]['message']);return _0x4f7082(_0x3c80f0[_0x1952('0x16')][_0x1952('0x18')]);}logger[_0x1952('0x16')](_0x1952('0x12'),_0x3d4aac,_0x3c80f0[_0x1952('0x16')][_0x1952('0x18')]);return _0x53f3c3(_0x3c80f0[_0x1952('0x16')][_0x1952('0x18')]);}else{logger[_0x1952('0x19')](_0x1952('0x12'),_0x3d4aac,_0x1952('0x13'));_0x53f3c3(_0x3c80f0[_0x1952('0x1a')][_0x1952('0x18')]);}})[_0x1952('0x1b')](function(_0x206014){logger[_0x1952('0x16')](_0x1952('0x12'),_0x3d4aac,_0x206014);_0x4f7082(_0x206014);});});}exports['ShowSmsAccount']=function(_0x15e613){var _0x534e42=this;return new Promise(function(_0x5df7fd,_0x57559a){return db[_0x1952('0x1c')][_0x1952('0x1d')]({'raw':_0x15e613['options']?_0x15e613['options'][_0x1952('0x1e')]===undefined?!![]:![]:!![],'where':_0x15e613['options']?_0x15e613[_0x1952('0x1f')]['where']||null:null,'attributes':_0x15e613[_0x1952('0x1f')]?_0x15e613[_0x1952('0x1f')][_0x1952('0x20')]||null:null,'include':_0x15e613[_0x1952('0x1f')]?_0x15e613[_0x1952('0x1f')][_0x1952('0x21')]?_[_0x1952('0x22')](_0x15e613[_0x1952('0x1f')][_0x1952('0x21')],function(_0x10ee8d){return{'model':db[_0x10ee8d[_0x1952('0x23')]],'as':_0x10ee8d['as'],'attributes':_0x10ee8d[_0x1952('0x20')],'include':_0x10ee8d[_0x1952('0x21')]?_[_0x1952('0x22')](_0x10ee8d[_0x1952('0x21')],function(_0x591e9b){return{'model':db[_0x591e9b[_0x1952('0x23')]],'as':_0x591e9b['as'],'attributes':_0x591e9b[_0x1952('0x20')],'include':_0x591e9b[_0x1952('0x21')]?_[_0x1952('0x22')](_0x591e9b[_0x1952('0x21')],function(_0xb905bf){return{'model':db[_0xb905bf[_0x1952('0x23')]],'as':_0xb905bf['as'],'attributes':_0xb905bf['attributes']};}):[]};}):[]};}):[]:[]})[_0x1952('0x11')](function(_0x4f9300){logger[_0x1952('0x19')]('ShowSmsAccount',_0x15e613);logger[_0x1952('0x24')](_0x1952('0x25'),_0x15e613,JSON[_0x1952('0x15')](_0x4f9300));_0x5df7fd(_0x4f9300);})[_0x1952('0x1b')](function(_0x2c448a){logger['error'](_0x1952('0x25'),_0x2c448a[_0x1952('0x18')],_0x15e613);_0x57559a(_0x534e42[_0x1952('0x16')](0x1f4,_0x2c448a[_0x1952('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 405044b..c07a1be 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 _0x83eb=['length','smsAccount:','./smsAccount.events','remove','update','emit','register'];(function(_0x196078,_0x354c88){var _0x2653b9=function(_0x3e8e14){while(--_0x3e8e14){_0x196078['push'](_0x196078['shift']());}};_0x2653b9(++_0x354c88);}(_0x83eb,0x1e5));var _0xb83e=function(_0x430a19,_0x485604){_0x430a19=_0x430a19-0x0;var _0x44a10f=_0x83eb[_0x430a19];return _0x44a10f;};'use strict';var SmsAccountEvents=require(_0xb83e('0x0'));var events=['save',_0xb83e('0x1'),_0xb83e('0x2')];function createListener(_0x182d0a,_0x432576){return function(_0x8186dd){_0x432576[_0xb83e('0x3')](_0x182d0a,_0x8186dd);};}function removeListener(_0xde763e,_0xe1363a){return function(){SmsAccountEvents['removeListener'](_0xde763e,_0xe1363a);};}exports[_0xb83e('0x4')]=function(_0x5b659a){for(var _0x54ac63=0x0,_0x968a3a=events[_0xb83e('0x5')];_0x54ac63<_0x968a3a;_0x54ac63++){var _0x36d1db=events[_0x54ac63];var _0x40ddee=createListener(_0xb83e('0x6')+_0x36d1db,_0x5b659a);SmsAccountEvents['on'](_0x36d1db,_0x40ddee);}}; \ No newline at end of file +var _0x2e91=['save','update','removeListener','register','./smsAccount.events'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x2e91,0x158));var _0x12e9=function(_0xe3a4f0,_0xc2c5e0){_0xe3a4f0=_0xe3a4f0-0x0;var _0x119daf=_0x2e91[_0xe3a4f0];return _0x119daf;};'use strict';var SmsAccountEvents=require(_0x12e9('0x0'));var events=[_0x12e9('0x1'),'remove',_0x12e9('0x2')];function createListener(_0x32172f,_0x58a510){return function(_0x5f0272){_0x58a510['emit'](_0x32172f,_0x5f0272);};}function removeListener(_0x59d954,_0x5aef2b){return function(){SmsAccountEvents[_0x12e9('0x3')](_0x59d954,_0x5aef2b);};}exports[_0x12e9('0x4')]=function(_0x5aa715){for(var _0x28addd=0x0,_0x24ab3a=events['length'];_0x28addd<_0x24ab3a;_0x28addd++){var _0x44b5d2=events[_0x28addd];var _0x5353a8=createListener('smsAccount:'+_0x44b5d2,_0x5aa715);SmsAccountEvents['on'](_0x44b5d2,_0x5353a8);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 78fb148..f7e75d5 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 _0xfe87=['post','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x120e00,_0xefccff){var _0x35a54b=function(_0x448708){while(--_0x448708){_0x120e00['push'](_0x120e00['shift']());}};_0x35a54b(++_0xefccff);}(_0xfe87,0x95));var _0x7fe8=function(_0x301ad4,_0x3ccbaa){_0x301ad4=_0x301ad4-0x0;var _0x1dfbd7=_0xfe87[_0x301ad4];return _0x1dfbd7;};'use strict';var multer=require('multer');var util=require(_0x7fe8('0x0'));var path=require(_0x7fe8('0x1'));var timeout=require(_0x7fe8('0x2'));var express=require(_0x7fe8('0x3'));var router=express[_0x7fe8('0x4')]();var auth=require(_0x7fe8('0x5'));var interaction=require(_0x7fe8('0x6'));var config=require(_0x7fe8('0x7'));var controller=require(_0x7fe8('0x8'));router[_0x7fe8('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7fe8('0x9')](_0x7fe8('0xa'),auth[_0x7fe8('0xb')](),controller[_0x7fe8('0xc')]);router[_0x7fe8('0xd')]('/',auth[_0x7fe8('0xb')](),controller['create']);router[_0x7fe8('0xe')](_0x7fe8('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x7fe8('0xf')](_0x7fe8('0xa'),auth[_0x7fe8('0xb')](),controller[_0x7fe8('0x10')]);module[_0x7fe8('0x11')]=router; \ No newline at end of file +var _0x5e86=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path'];(function(_0x561849,_0x5334de){var _0x349f76=function(_0x2467c0){while(--_0x2467c0){_0x561849['push'](_0x561849['shift']());}};_0x349f76(++_0x5334de);}(_0x5e86,0x7b));var _0x65e8=function(_0x1150b4,_0x1a1608){_0x1150b4=_0x1150b4-0x0;var _0x1d094f=_0x5e86[_0x1150b4];return _0x1d094f;};'use strict';var multer=require(_0x65e8('0x0'));var util=require(_0x65e8('0x1'));var path=require(_0x65e8('0x2'));var timeout=require(_0x65e8('0x3'));var express=require(_0x65e8('0x4'));var router=express[_0x65e8('0x5')]();var auth=require(_0x65e8('0x6'));var interaction=require(_0x65e8('0x7'));var config=require(_0x65e8('0x8'));var controller=require(_0x65e8('0x9'));router[_0x65e8('0xa')]('/',auth[_0x65e8('0xb')](),controller[_0x65e8('0xc')]);router['get'](_0x65e8('0xd'),auth[_0x65e8('0xb')](),controller[_0x65e8('0xe')]);router[_0x65e8('0xf')]('/',auth['isAuthenticated'](),controller[_0x65e8('0x10')]);router[_0x65e8('0x11')](_0x65e8('0xd'),auth[_0x65e8('0xb')](),controller[_0x65e8('0x12')]);router[_0x65e8('0x13')](_0x65e8('0xd'),auth['isAuthenticated'](),controller[_0x65e8('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index d74555f..52bb426 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 _0x0c2f=['*,*,*,*','INTEGER','STRING','noop','TEXT'];(function(_0x2fd56e,_0x168395){var _0x8562e8=function(_0x2aa0e8){while(--_0x2aa0e8){_0x2fd56e['push'](_0x2fd56e['shift']());}};_0x8562e8(++_0x168395);}(_0x0c2f,0x74));var _0xf0c2=function(_0x3401ce,_0x5d1579){_0x3401ce=_0x3401ce-0x0;var _0x1bb79d=_0x0c2f[_0x3401ce];return _0x1bb79d;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xf0c2('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xf0c2('0x1')],'allowNull':![],'defaultValue':_0xf0c2('0x2')},'appdata':{'type':Sequelize[_0xf0c2('0x3')]()},'description':{'type':Sequelize[_0xf0c2('0x1')]},'interval':{'type':Sequelize[_0xf0c2('0x1')],'defaultValue':_0xf0c2('0x4')}}; \ No newline at end of file +var _0xc2bd=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x3d24a1,_0x51d322){var _0x3535eb=function(_0x2a9702){while(--_0x2a9702){_0x3d24a1['push'](_0x3d24a1['shift']());}};_0x3535eb(++_0x51d322);}(_0xc2bd,0x16c));var _0xdc2b=function(_0x575400,_0x34f199){_0x575400=_0x575400-0x0;var _0x29cb5c=_0xc2bd[_0x575400];return _0x29cb5c;};'use strict';var Sequelize=require('sequelize');module[_0xdc2b('0x0')]={'priority':{'type':Sequelize[_0xdc2b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xdc2b('0x2')],'allowNull':![],'defaultValue':_0xdc2b('0x3')},'appdata':{'type':Sequelize[_0xdc2b('0x4')]()},'description':{'type':Sequelize[_0xdc2b('0x2')]},'interval':{'type':Sequelize[_0xdc2b('0x2')],'defaultValue':_0xdc2b('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 92885a4..7b26ed5 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 _0xb6ad=['path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','end','json','offset','status','Content-Range','apply','reject','save','update','then','destroy','name','send','index','SmsApplication','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','type','key','VIRTUAL','field','filter','merge','options','count','includeAll','rows','catch','show','params','include','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb6ad,0x115));var _0xdb6a=function(_0x1864ef,_0x1f6c8b){_0x1864ef=_0x1864ef-0x0;var _0x662432=_0xb6ad[_0x1864ef];return _0x662432;};'use strict';var pdf=require(_0xdb6a('0x0'));var emlformat=require(_0xdb6a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdb6a('0x2'));var jsonpatch=require(_0xdb6a('0x3'));var rp=require(_0xdb6a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdb6a('0x5'));var util=require(_0xdb6a('0x6'));var path=require(_0xdb6a('0x7'));var sox=require(_0xdb6a('0x8'));var csv=require(_0xdb6a('0x9'));var ejs=require(_0xdb6a('0xa'));var fs=require('fs');var _=require(_0xdb6a('0xb'));var squel=require('squel');var crypto=require(_0xdb6a('0xc'));var jsforce=require(_0xdb6a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdb6a('0x9'));var querystring=require(_0xdb6a('0xe'));var Papa=require(_0xdb6a('0xf'));var Redis=require(_0xdb6a('0x10'));var authService=require(_0xdb6a('0x11'));var qs=require(_0xdb6a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdb6a('0x13'));var utils=require('../../config/utils');var config=require(_0xdb6a('0x14'));var db=require(_0xdb6a('0x15'))['db'];function respondWithStatusCode(_0x554fff,_0x404422){_0x404422=_0x404422||0xcc;return function(_0x47c709){if(_0x47c709){return _0x554fff[_0xdb6a('0x16')](_0x404422);}return _0x554fff['status'](_0x404422)[_0xdb6a('0x17')]();};}function respondWithResult(_0x191dba,_0x2f31d8){_0x2f31d8=_0x2f31d8||0xc8;return function(_0x25b70a){if(_0x25b70a){return _0x191dba['status'](_0x2f31d8)[_0xdb6a('0x18')](_0x25b70a);}};}function respondWithFilteredResult(_0x287801,_0x5ad193){return function(_0x447bee){if(_0x447bee){var _0xc1e498=_0x447bee['count'],_0x2351fa=_0x5ad193[_0xdb6a('0x19')],_0x2f3b2e=_0x5ad193[_0xdb6a('0x19')]+_0x5ad193['limit'],_0x753e95;if(_0x2f3b2e>=_0xc1e498){_0x2f3b2e=_0xc1e498;_0x753e95=0xc8;}else{_0x753e95=0xce;}_0x287801[_0xdb6a('0x1a')](_0x753e95);return _0x287801['set'](_0xdb6a('0x1b'),_0x2351fa+'-'+_0x2f3b2e+'/'+_0xc1e498)[_0xdb6a('0x18')](_0x447bee);}return null;};}function patchUpdates(_0x31eec5){return function(_0x360c92){try{jsonpatch[_0xdb6a('0x1c')](_0x360c92,_0x31eec5,!![]);}catch(_0x2e9a93){return BPromise[_0xdb6a('0x1d')](_0x2e9a93);}return _0x360c92[_0xdb6a('0x1e')]();};}function saveUpdates(_0x17605f,_0x391e0d){return function(_0x159c3a){if(_0x159c3a){return _0x159c3a[_0xdb6a('0x1f')](_0x17605f)[_0xdb6a('0x20')](function(_0x3548f6){return _0x3548f6;});}return null;};}function removeEntity(_0x436b9e,_0xe992a7){return function(_0x487b0b){if(_0x487b0b){return _0x487b0b[_0xdb6a('0x21')]()[_0xdb6a('0x20')](function(){_0x436b9e[_0xdb6a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23810a,_0x1f52b1){return function(_0x22c5d3){if(!_0x22c5d3){_0x23810a['sendStatus'](0x194);}return _0x22c5d3;};}function handleError(_0x244d62,_0x38d626){_0x38d626=_0x38d626||0x1f4;return function(_0x2114bf){logger['error'](_0x2114bf['stack']);if(_0x2114bf[_0xdb6a('0x22')]){delete _0x2114bf[_0xdb6a('0x22')];}_0x244d62[_0xdb6a('0x1a')](_0x38d626)[_0xdb6a('0x23')](_0x2114bf);};}exports[_0xdb6a('0x24')]=function(_0x504647,_0x487cbe){var _0x31bbba={},_0x128ff9={},_0x3d8a7e={'count':0x0,'rows':[]};var _0x51b603=db[_0xdb6a('0x25')][_0xdb6a('0x26')];_0x128ff9[_0xdb6a('0x27')]=_[_0xdb6a('0x28')](_0x51b603);_0x128ff9['query']=_[_0xdb6a('0x28')](_0x504647[_0xdb6a('0x29')]);_0x128ff9[_0xdb6a('0x2a')]=_[_0xdb6a('0x2b')](_0x128ff9[_0xdb6a('0x27')],_0x128ff9[_0xdb6a('0x29')]);_0x31bbba['attributes']=_['intersection'](_0x128ff9[_0xdb6a('0x27')],qs['fields'](_0x504647[_0xdb6a('0x29')][_0xdb6a('0x2c')]));_0x31bbba[_0xdb6a('0x2d')]=_0x31bbba[_0xdb6a('0x2d')][_0xdb6a('0x2e')]?_0x31bbba[_0xdb6a('0x2d')]:_0x128ff9[_0xdb6a('0x27')];if(!_0x504647[_0xdb6a('0x29')][_0xdb6a('0x2f')](_0xdb6a('0x30'))){_0x31bbba[_0xdb6a('0x31')]=qs[_0xdb6a('0x31')](_0x504647['query'][_0xdb6a('0x31')]);_0x31bbba[_0xdb6a('0x19')]=qs['offset'](_0x504647[_0xdb6a('0x29')][_0xdb6a('0x19')]);}_0x31bbba[_0xdb6a('0x32')]=qs[_0xdb6a('0x33')](_0x504647['query'][_0xdb6a('0x33')]);_0x31bbba[_0xdb6a('0x34')]=qs[_0xdb6a('0x2a')](_[_0xdb6a('0x35')](_0x504647[_0xdb6a('0x29')],_0x128ff9[_0xdb6a('0x2a')]));if(_0x504647['query']['filter']){_0x31bbba[_0xdb6a('0x34')]=_['merge'](_0x31bbba[_0xdb6a('0x34')],{'$or':_['map'](_0x51b603,function(_0x216b5b){if(_0x216b5b[_0xdb6a('0x36')][_0xdb6a('0x37')]!==_0xdb6a('0x38')){var _0x1a8acc={};_0x1a8acc[_0x216b5b[_0xdb6a('0x39')]]={'$like':'%'+_0x504647[_0xdb6a('0x29')][_0xdb6a('0x3a')]+'%'};return _0x1a8acc;}})});}_0x31bbba=_[_0xdb6a('0x3b')]({},_0x31bbba,_0x504647[_0xdb6a('0x3c')]);var _0x329710={'where':_0x31bbba['where']};return db[_0xdb6a('0x25')]['count'](_0x329710)[_0xdb6a('0x20')](function(_0x844f65){_0x3d8a7e[_0xdb6a('0x3d')]=_0x844f65;if(_0x504647[_0xdb6a('0x29')][_0xdb6a('0x3e')]){_0x31bbba['include']=[{'all':!![]}];}return db[_0xdb6a('0x25')]['findAll'](_0x31bbba);})[_0xdb6a('0x20')](function(_0x290a4f){_0x3d8a7e[_0xdb6a('0x3f')]=_0x290a4f;return _0x3d8a7e;})['then'](respondWithFilteredResult(_0x487cbe,_0x31bbba))[_0xdb6a('0x40')](handleError(_0x487cbe,null));};exports[_0xdb6a('0x41')]=function(_0x288778,_0x3289b1){var _0x10608b={'raw':!![],'where':{'id':_0x288778[_0xdb6a('0x42')]['id']}},_0x533015={};_0x533015['model']=_[_0xdb6a('0x28')](db[_0xdb6a('0x25')][_0xdb6a('0x26')]);_0x533015[_0xdb6a('0x29')]=_[_0xdb6a('0x28')](_0x288778[_0xdb6a('0x29')]);_0x533015['filters']=_[_0xdb6a('0x2b')](_0x533015[_0xdb6a('0x27')],_0x533015['query']);_0x10608b['attributes']=_['intersection'](_0x533015['model'],qs[_0xdb6a('0x2c')](_0x288778['query'][_0xdb6a('0x2c')]));_0x10608b[_0xdb6a('0x2d')]=_0x10608b[_0xdb6a('0x2d')][_0xdb6a('0x2e')]?_0x10608b[_0xdb6a('0x2d')]:_0x533015[_0xdb6a('0x27')];if(_0x288778[_0xdb6a('0x29')]['includeAll']){_0x10608b[_0xdb6a('0x43')]=[{'all':!![]}];}_0x10608b=_[_0xdb6a('0x3b')]({},_0x10608b,_0x288778['options']);return db[_0xdb6a('0x25')][_0xdb6a('0x44')](_0x10608b)[_0xdb6a('0x20')](handleEntityNotFound(_0x3289b1,null))[_0xdb6a('0x20')](respondWithResult(_0x3289b1,null))[_0xdb6a('0x40')](handleError(_0x3289b1,null));};exports[_0xdb6a('0x45')]=function(_0x18b61d,_0x51e02a){return db[_0xdb6a('0x25')][_0xdb6a('0x45')](_0x18b61d[_0xdb6a('0x46')],{})['then'](respondWithResult(_0x51e02a,0xc9))[_0xdb6a('0x40')](handleError(_0x51e02a,null));};exports['update']=function(_0x415955,_0x9679){if(_0x415955['body']['id']){delete _0x415955[_0xdb6a('0x46')]['id'];}return db[_0xdb6a('0x25')][_0xdb6a('0x44')]({'where':{'id':_0x415955[_0xdb6a('0x42')]['id']}})[_0xdb6a('0x20')](handleEntityNotFound(_0x9679,null))[_0xdb6a('0x20')](saveUpdates(_0x415955['body'],null))[_0xdb6a('0x20')](respondWithResult(_0x9679,null))['catch'](handleError(_0x9679,null));};exports['destroy']=function(_0xe59864,_0xb7ac2e){return db['SmsApplication'][_0xdb6a('0x44')]({'where':{'id':_0xe59864[_0xdb6a('0x42')]['id']}})[_0xdb6a('0x20')](handleEntityNotFound(_0xb7ac2e,null))[_0xdb6a('0x20')](removeEntity(_0xb7ac2e,null))[_0xdb6a('0x40')](handleError(_0xb7ac2e,null));}; \ No newline at end of file +var _0x15e0=['length','create','body','find','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','count','offset','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','SmsApplication','rawAttributes','keys','query','filters','intersection','model','attributes','fields','nolimit','limit','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','include','findAll','rows','catch','show','params'];(function(_0x519df1,_0x23552f){var _0x3427db=function(_0x122020){while(--_0x122020){_0x519df1['push'](_0x519df1['shift']());}};_0x3427db(++_0x23552f);}(_0x15e0,0x153));var _0x015e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x15e0[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x015e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x015e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x015e('0x2'));var rp=require('request-promise');var moment=require(_0x015e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x015e('0x4'));var util=require(_0x015e('0x5'));var path=require(_0x015e('0x6'));var sox=require(_0x015e('0x7'));var csv=require(_0x015e('0x8'));var ejs=require(_0x015e('0x9'));var fs=require('fs');var _=require(_0x015e('0xa'));var squel=require(_0x015e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x015e('0x8'));var querystring=require('querystring');var Papa=require(_0x015e('0xc'));var Redis=require(_0x015e('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x015e('0xe'));var hardwareService=require(_0x015e('0xf'));var logger=require(_0x015e('0x10'))('api');var utils=require(_0x015e('0x11'));var config=require(_0x015e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xba3234,_0x3c675b){_0x3c675b=_0x3c675b||0xcc;return function(_0x165f5d){if(_0x165f5d){return _0xba3234[_0x015e('0x13')](_0x3c675b);}return _0xba3234[_0x015e('0x14')](_0x3c675b)['end']();};}function respondWithResult(_0xa0c704,_0x1a0c62){_0x1a0c62=_0x1a0c62||0xc8;return function(_0x199895){if(_0x199895){return _0xa0c704[_0x015e('0x14')](_0x1a0c62)['json'](_0x199895);}};}function respondWithFilteredResult(_0x362fa8,_0x5a50b0){return function(_0x589f81){if(_0x589f81){var _0x174222=_0x589f81[_0x015e('0x15')],_0x25f39e=_0x5a50b0[_0x015e('0x16')],_0x487573=_0x5a50b0[_0x015e('0x16')]+_0x5a50b0['limit'],_0x51b08d;if(_0x487573>=_0x174222){_0x487573=_0x174222;_0x51b08d=0xc8;}else{_0x51b08d=0xce;}_0x362fa8[_0x015e('0x14')](_0x51b08d);return _0x362fa8['set'](_0x015e('0x17'),_0x25f39e+'-'+_0x487573+'/'+_0x174222)['json'](_0x589f81);}return null;};}function patchUpdates(_0x5af8b3){return function(_0x3d05c2){try{jsonpatch[_0x015e('0x18')](_0x3d05c2,_0x5af8b3,!![]);}catch(_0x385a92){return BPromise[_0x015e('0x19')](_0x385a92);}return _0x3d05c2[_0x015e('0x1a')]();};}function saveUpdates(_0x8d432d,_0x3c9924){return function(_0x4a74ae){if(_0x4a74ae){return _0x4a74ae[_0x015e('0x1b')](_0x8d432d)['then'](function(_0x21840d){return _0x21840d;});}return null;};}function removeEntity(_0x2a742f,_0x441281){return function(_0x1e04c8){if(_0x1e04c8){return _0x1e04c8[_0x015e('0x1c')]()[_0x015e('0x1d')](function(){_0x2a742f[_0x015e('0x14')](0xcc)[_0x015e('0x1e')]();});}};}function handleEntityNotFound(_0x84b5ff,_0x2f5ca2){return function(_0x18b49f){if(!_0x18b49f){_0x84b5ff[_0x015e('0x13')](0x194);}return _0x18b49f;};}function handleError(_0x468e1a,_0x1f8de5){_0x1f8de5=_0x1f8de5||0x1f4;return function(_0xf96b4f){logger[_0x015e('0x1f')](_0xf96b4f[_0x015e('0x20')]);if(_0xf96b4f[_0x015e('0x21')]){delete _0xf96b4f['name'];}_0x468e1a[_0x015e('0x14')](_0x1f8de5)[_0x015e('0x22')](_0xf96b4f);};}exports['index']=function(_0x1d6422,_0x5f17d6){var _0x3b7077={},_0x4838df={},_0x57a14d={'count':0x0,'rows':[]};var _0x116d82=db[_0x015e('0x23')][_0x015e('0x24')];_0x4838df['model']=_[_0x015e('0x25')](_0x116d82);_0x4838df[_0x015e('0x26')]=_[_0x015e('0x25')](_0x1d6422[_0x015e('0x26')]);_0x4838df[_0x015e('0x27')]=_[_0x015e('0x28')](_0x4838df[_0x015e('0x29')],_0x4838df[_0x015e('0x26')]);_0x3b7077[_0x015e('0x2a')]=_[_0x015e('0x28')](_0x4838df[_0x015e('0x29')],qs[_0x015e('0x2b')](_0x1d6422['query'][_0x015e('0x2b')]));_0x3b7077[_0x015e('0x2a')]=_0x3b7077['attributes']['length']?_0x3b7077[_0x015e('0x2a')]:_0x4838df[_0x015e('0x29')];if(!_0x1d6422['query']['hasOwnProperty'](_0x015e('0x2c'))){_0x3b7077[_0x015e('0x2d')]=qs[_0x015e('0x2d')](_0x1d6422[_0x015e('0x26')]['limit']);_0x3b7077[_0x015e('0x16')]=qs[_0x015e('0x16')](_0x1d6422[_0x015e('0x26')][_0x015e('0x16')]);}_0x3b7077['order']=qs[_0x015e('0x2e')](_0x1d6422[_0x015e('0x26')][_0x015e('0x2e')]);_0x3b7077[_0x015e('0x2f')]=qs['filters'](_[_0x015e('0x30')](_0x1d6422[_0x015e('0x26')],_0x4838df[_0x015e('0x27')]));if(_0x1d6422['query'][_0x015e('0x31')]){_0x3b7077[_0x015e('0x2f')]=_['merge'](_0x3b7077[_0x015e('0x2f')],{'$or':_[_0x015e('0x32')](_0x116d82,function(_0x30e5c9){if(_0x30e5c9[_0x015e('0x33')][_0x015e('0x34')]!==_0x015e('0x35')){var _0x2c1ca3={};_0x2c1ca3[_0x30e5c9[_0x015e('0x36')]]={'$like':'%'+_0x1d6422[_0x015e('0x26')][_0x015e('0x31')]+'%'};return _0x2c1ca3;}})});}_0x3b7077=_[_0x015e('0x37')]({},_0x3b7077,_0x1d6422[_0x015e('0x38')]);var _0x2c081f={'where':_0x3b7077['where']};return db[_0x015e('0x23')][_0x015e('0x15')](_0x2c081f)[_0x015e('0x1d')](function(_0x3ba241){_0x57a14d[_0x015e('0x15')]=_0x3ba241;if(_0x1d6422['query']['includeAll']){_0x3b7077[_0x015e('0x39')]=[{'all':!![]}];}return db[_0x015e('0x23')][_0x015e('0x3a')](_0x3b7077);})['then'](function(_0x470437){_0x57a14d[_0x015e('0x3b')]=_0x470437;return _0x57a14d;})['then'](respondWithFilteredResult(_0x5f17d6,_0x3b7077))[_0x015e('0x3c')](handleError(_0x5f17d6,null));};exports[_0x015e('0x3d')]=function(_0x50a4ef,_0x58d3af){var _0x14b619={'raw':!![],'where':{'id':_0x50a4ef[_0x015e('0x3e')]['id']}},_0x35e52b={};_0x35e52b[_0x015e('0x29')]=_[_0x015e('0x25')](db[_0x015e('0x23')]['rawAttributes']);_0x35e52b[_0x015e('0x26')]=_[_0x015e('0x25')](_0x50a4ef[_0x015e('0x26')]);_0x35e52b[_0x015e('0x27')]=_[_0x015e('0x28')](_0x35e52b[_0x015e('0x29')],_0x35e52b[_0x015e('0x26')]);_0x14b619[_0x015e('0x2a')]=_[_0x015e('0x28')](_0x35e52b[_0x015e('0x29')],qs[_0x015e('0x2b')](_0x50a4ef[_0x015e('0x26')][_0x015e('0x2b')]));_0x14b619[_0x015e('0x2a')]=_0x14b619[_0x015e('0x2a')][_0x015e('0x3f')]?_0x14b619['attributes']:_0x35e52b[_0x015e('0x29')];if(_0x50a4ef[_0x015e('0x26')]['includeAll']){_0x14b619[_0x015e('0x39')]=[{'all':!![]}];}_0x14b619=_['merge']({},_0x14b619,_0x50a4ef[_0x015e('0x38')]);return db[_0x015e('0x23')]['find'](_0x14b619)['then'](handleEntityNotFound(_0x58d3af,null))['then'](respondWithResult(_0x58d3af,null))['catch'](handleError(_0x58d3af,null));};exports[_0x015e('0x40')]=function(_0x465483,_0x2581e9){return db[_0x015e('0x23')][_0x015e('0x40')](_0x465483[_0x015e('0x41')],{})[_0x015e('0x1d')](respondWithResult(_0x2581e9,0xc9))[_0x015e('0x3c')](handleError(_0x2581e9,null));};exports[_0x015e('0x1b')]=function(_0x48cfcc,_0x3aa7f9){if(_0x48cfcc[_0x015e('0x41')]['id']){delete _0x48cfcc[_0x015e('0x41')]['id'];}return db['SmsApplication'][_0x015e('0x42')]({'where':{'id':_0x48cfcc[_0x015e('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3aa7f9,null))[_0x015e('0x1d')](saveUpdates(_0x48cfcc['body'],null))[_0x015e('0x1d')](respondWithResult(_0x3aa7f9,null))[_0x015e('0x3c')](handleError(_0x3aa7f9,null));};exports[_0x015e('0x1c')]=function(_0x189e7d,_0x28e724){return db[_0x015e('0x23')][_0x015e('0x42')]({'where':{'id':_0x189e7d[_0x015e('0x3e')]['id']}})[_0x015e('0x1d')](handleEntityNotFound(_0x28e724,null))['then'](removeEntity(_0x28e724,null))[_0x015e('0x3c')](handleError(_0x28e724,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index e6fec03..c3d0eb9 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 _0x5404=['../../config/environment','./smsApplication.attributes','exports','define','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4326eb,_0x1801c5){var _0x2735a3=function(_0x4b1f8d){while(--_0x4b1f8d){_0x4326eb['push'](_0x4326eb['shift']());}};_0x2735a3(++_0x1801c5);}(_0x5404,0x93));var _0x4540=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5404[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x4540('0x0'));var util=require(_0x4540('0x1'));var logger=require(_0x4540('0x2'))(_0x4540('0x3'));var moment=require(_0x4540('0x4'));var BPromise=require('bluebird');var rp=require(_0x4540('0x5'));var fs=require('fs');var path=require(_0x4540('0x6'));var rimraf=require('rimraf');var config=require(_0x4540('0x7'));var attributes=require(_0x4540('0x8'));module[_0x4540('0x9')]=function(_0x5eb09f,_0x3548ae){return _0x5eb09f[_0x4540('0xa')]('SmsApplication',attributes,{'tableName':_0x4540('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4540('0xc'),'collate':_0x4540('0xd')});}; \ No newline at end of file +var _0xc26a=['SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','moment','path','rimraf','./smsApplication.attributes','exports','define'];(function(_0x4b2494,_0x494d41){var _0x2c1436=function(_0x3eaf82){while(--_0x3eaf82){_0x4b2494['push'](_0x4b2494['shift']());}};_0x2c1436(++_0x494d41);}(_0xc26a,0x14d));var _0xac26=function(_0x75276e,_0x4a4015){_0x75276e=_0x75276e-0x0;var _0x3d8d88=_0xc26a[_0x75276e];return _0x3d8d88;};'use strict';var _=require(_0xac26('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xac26('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xac26('0x2'));var rimraf=require(_0xac26('0x3'));var config=require('../../config/environment');var attributes=require(_0xac26('0x4'));module[_0xac26('0x5')]=function(_0x5b8438,_0x3d2101){return _0x5b8438[_0xac26('0x6')](_0xac26('0x7'),attributes,{'tableName':_0xac26('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xac26('0x9')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 60663bd..e67a7a6 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 _0xb957=['info','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','SmsApplication,\x20%s,\x20%s','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x8560d3,_0x26a504){var _0x33b1b5=function(_0x3a2cad){while(--_0x3a2cad){_0x8560d3['push'](_0x8560d3['shift']());}};_0x33b1b5(++_0x26a504);}(_0xb957,0x6d));var _0x7b95=function(_0x58d893,_0x28c39){_0x58d893=_0x58d893-0x0;var _0x3adb71=_0xb957[_0x58d893];return _0x3adb71;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7b95('0x0'));var BPromise=require('bluebird');var rs=require(_0x7b95('0x1'));var fs=require('fs');var Redis=require(_0x7b95('0x2'));var db=require(_0x7b95('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b95('0x4'))(_0x7b95('0x5'));var config=require(_0x7b95('0x6'));var jayson=require(_0x7b95('0x7'));var client=jayson[_0x7b95('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2912d5,_0x16b05a,_0x161768){return new BPromise(function(_0x495bea,_0x5e1421){return client[_0x7b95('0x9')](_0x2912d5,_0x161768)[_0x7b95('0xa')](function(_0x2e82e6){logger[_0x7b95('0xb')]('SmsApplication,\x20%s,\x20%s',_0x16b05a,'request\x20sent');logger['debug'](_0x7b95('0xc'),_0x16b05a,_0x7b95('0xd'),JSON['stringify'](_0x2e82e6));if(_0x2e82e6['error']){if(_0x2e82e6[_0x7b95('0xe')][_0x7b95('0xf')]===0x1f4){logger[_0x7b95('0xe')]('SmsApplication,\x20%s,\x20%s',_0x16b05a,_0x2e82e6['error'][_0x7b95('0x10')]);return _0x5e1421(_0x2e82e6['error'][_0x7b95('0x10')]);}logger[_0x7b95('0xe')](_0x7b95('0x11'),_0x16b05a,_0x2e82e6[_0x7b95('0xe')]['message']);return _0x495bea(_0x2e82e6['error'][_0x7b95('0x10')]);}else{logger[_0x7b95('0xb')](_0x7b95('0x11'),_0x16b05a,_0x7b95('0xd'));_0x495bea(_0x2e82e6[_0x7b95('0x12')][_0x7b95('0x10')]);}})[_0x7b95('0x13')](function(_0x44e836){logger[_0x7b95('0xe')](_0x7b95('0x11'),_0x16b05a,_0x44e836);_0x5e1421(_0x44e836);});});} \ No newline at end of file +var _0x6bb4=['message','info','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x414bb2,_0x5906a1){var _0x47e0c8=function(_0x19d547){while(--_0x19d547){_0x414bb2['push'](_0x414bb2['shift']());}};_0x47e0c8(++_0x5906a1);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x6e9dc1,_0x3283de){_0x6e9dc1=_0x6e9dc1-0x0;var _0x5edd45=_0x6bb4[_0x6e9dc1];return _0x5edd45;};'use strict';var _=require(_0x46bb('0x0'));var util=require(_0x46bb('0x1'));var moment=require(_0x46bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x46bb('0x3'));var fs=require('fs');var Redis=require(_0x46bb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x46bb('0x5'));var logger=require(_0x46bb('0x6'))(_0x46bb('0x7'));var config=require(_0x46bb('0x8'));var jayson=require(_0x46bb('0x9'));var client=jayson[_0x46bb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fa5c4,_0x2f1e64,_0x4338c9){return new BPromise(function(_0x57fb08,_0x5809f5){return client['request'](_0x4fa5c4,_0x4338c9)[_0x46bb('0xb')](function(_0x2c7e4c){logger['info'](_0x46bb('0xc'),_0x2f1e64,_0x46bb('0xd'));logger[_0x46bb('0xe')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x2f1e64,_0x46bb('0xd'),JSON[_0x46bb('0xf')](_0x2c7e4c));if(_0x2c7e4c['error']){if(_0x2c7e4c[_0x46bb('0x10')][_0x46bb('0x11')]===0x1f4){logger[_0x46bb('0x10')]('SmsApplication,\x20%s,\x20%s',_0x2f1e64,_0x2c7e4c[_0x46bb('0x10')]['message']);return _0x5809f5(_0x2c7e4c['error'][_0x46bb('0x12')]);}logger['error'](_0x46bb('0xc'),_0x2f1e64,_0x2c7e4c[_0x46bb('0x10')]['message']);return _0x57fb08(_0x2c7e4c[_0x46bb('0x10')]['message']);}else{logger[_0x46bb('0x13')]('SmsApplication,\x20%s,\x20%s',_0x2f1e64,_0x46bb('0xd'));_0x57fb08(_0x2c7e4c['result']['message']);}})[_0x46bb('0x14')](function(_0x3965ed){logger['error'](_0x46bb('0xc'),_0x2f1e64,_0x3965ed);_0x5809f5(_0x3965ed);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 9a3a37b..15b7757 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 _0x9264=['./smsInteraction.controller','get','/describe','describe','isAuthenticated','show','getMessages','create','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x9264,0xb1));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x4926('0x0'));var util=require(_0x4926('0x1'));var path=require(_0x4926('0x2'));var timeout=require(_0x4926('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x4926('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4926('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4926('0x6')](_0x4926('0x7'),auth['isAuthenticated'](),controller[_0x4926('0x8')]);router[_0x4926('0x6')]('/:id',auth[_0x4926('0x9')](),controller[_0x4926('0xa')]);router[_0x4926('0x6')]('/:id/messages',auth[_0x4926('0x9')](),controller[_0x4926('0xb')]);router[_0x4926('0x6')]('/:id/download',auth[_0x4926('0x9')](),controller['download']);router['post']('/',auth[_0x4926('0x9')](),controller[_0x4926('0xc')]);router[_0x4926('0xd')]('/:id/messages',auth[_0x4926('0x9')](),controller[_0x4926('0xe')]);router[_0x4926('0xd')](_0x4926('0xf'),auth[_0x4926('0x9')](),interaction[_0x4926('0x10')](_0x4926('0x11'),_0x4926('0x12')),controller[_0x4926('0x13')]);router[_0x4926('0x14')](_0x4926('0x15'),auth[_0x4926('0x9')](),interaction[_0x4926('0x10')](_0x4926('0x11'),'smsinteraction:update'),controller[_0x4926('0x16')]);router[_0x4926('0x17')](_0x4926('0x15'),auth['isAuthenticated'](),interaction['tracked'](_0x4926('0x11'),'smsinteraction:destroy'),controller[_0x4926('0x18')]);router[_0x4926('0x17')]('/:id/tags',auth[_0x4926('0x9')](),controller['removeTags']);module[_0x4926('0x19')]=router; \ No newline at end of file +var _0x173d=['create','addMessage','/:id/tags','sms','addTags','put','tracked','smsinteraction:update','smsinteraction:destroy','destroy','delete','exports','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','/describe','describe','/:id','/:id/messages','getMessages','isAuthenticated','download','post'];(function(_0x4f5103,_0x5c85a4){var _0x2463e2=function(_0x125f79){while(--_0x125f79){_0x4f5103['push'](_0x4f5103['shift']());}};_0x2463e2(++_0x5c85a4);}(_0x173d,0x108));var _0xd173=function(_0x5e2bc1,_0xe9e46e){_0x5e2bc1=_0x5e2bc1-0x0;var _0x1d2fac=_0x173d[_0x5e2bc1];return _0x1d2fac;};'use strict';var multer=require('multer');var util=require(_0xd173('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd173('0x1'));var router=express['Router']();var auth=require(_0xd173('0x2'));var interaction=require(_0xd173('0x3'));var config=require(_0xd173('0x4'));var controller=require(_0xd173('0x5'));router[_0xd173('0x6')]('/',auth['isAuthenticated'](),controller[_0xd173('0x7')]);router[_0xd173('0x6')](_0xd173('0x8'),auth['isAuthenticated'](),controller[_0xd173('0x9')]);router['get'](_0xd173('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd173('0x6')](_0xd173('0xb'),auth['isAuthenticated'](),controller[_0xd173('0xc')]);router[_0xd173('0x6')]('/:id/download',auth[_0xd173('0xd')](),controller[_0xd173('0xe')]);router[_0xd173('0xf')]('/',auth[_0xd173('0xd')](),controller[_0xd173('0x10')]);router[_0xd173('0xf')](_0xd173('0xb'),auth[_0xd173('0xd')](),controller[_0xd173('0x11')]);router[_0xd173('0xf')](_0xd173('0x12'),auth[_0xd173('0xd')](),interaction['tracked'](_0xd173('0x13'),'smsinteraction:addtags'),controller[_0xd173('0x14')]);router[_0xd173('0x15')]('/:id',auth[_0xd173('0xd')](),interaction[_0xd173('0x16')](_0xd173('0x13'),_0xd173('0x17')),controller['update']);router['delete'](_0xd173('0xa'),auth[_0xd173('0xd')](),interaction[_0xd173('0x16')]('sms',_0xd173('0x18')),controller[_0xd173('0x19')]);router[_0xd173('0x1a')](_0xd173('0x12'),auth['isAuthenticated'](),controller['removeTags']);module[_0xd173('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 3adb1b3..ccb8ac6 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 _0xe706=['ENUM','out','sequelize','moment','exports','DATE','STRING'];(function(_0x7f05c1,_0x9d322b){var _0x132b01=function(_0x37c365){while(--_0x37c365){_0x7f05c1['push'](_0x7f05c1['shift']());}};_0x132b01(++_0x9d322b);}(_0xe706,0xa3));var _0x6e70=function(_0x1bae3e,_0x12950c){_0x1bae3e=_0x1bae3e-0x0;var _0x170b37=_0xe706[_0x1bae3e];return _0x170b37;};'use strict';var Sequelize=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6e70('0x3')]},'disposition':{'type':Sequelize[_0x6e70('0x4')]},'note':{'type':Sequelize[_0x6e70('0x4')]},'phone':{'type':Sequelize[_0x6e70('0x4')]},'read1stAt':{'type':Sequelize[_0x6e70('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x6e70('0x5')]('in',_0x6e70('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6e70('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x6e70('0x5')]('in',_0x6e70('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x757a=['moment','exports','STRING','DATE','ENUM','out'];(function(_0x1895ce,_0x81e9b2){var _0x4c3c7f=function(_0x2e4d0b){while(--_0x2e4d0b){_0x1895ce['push'](_0x1895ce['shift']());}};_0x4c3c7f(++_0x81e9b2);}(_0x757a,0xde));var _0xa757=function(_0x295c0e,_0x135fb8){_0x295c0e=_0x295c0e-0x0;var _0x145168=_0x757a[_0x295c0e];return _0x145168;};'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 61489bf..e0883f0 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 _0xd3fa=['u.id','user_has_sms_interactions','users','left_join','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','advancedFilter','parse','createdAt','dateStart','startOf','day','utc','format','endOf','and','isArray','condition','forEach','value','unreadMessages','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20<\x20?','\x20>\x20?','isNil','isEmpty','SmsAccountId','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','filter','replace','isNumeric','i.id\x20LIKE\x20?','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','i.id','QueryTypes','SELECT','COUNT(*)','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','sms_interaction_has_tags','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','Contact.firstName','Contact.lastName','Contact.phone','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','it.SmsInteractionId\x20=\x20i.id','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','rows','show','intersection','includeAll','merge','options','find','catch','create','body','params','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','root','tmp','server','attachments','transcript-%d-%s.zip','Messages','direction','secret','User','Contact','firstName','lastName','SmsAccount','Account','Owner','fullname','get','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','N.A.','closedAt','out','System','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','Users','map','TagIds','Tags','split','push','index','SmsInteraction','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','sms_messages','me.SmsInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false'];(function(_0x52e68e,_0x309912){var _0x3211a4=function(_0x467c01){while(--_0x467c01){_0x52e68e['push'](_0x52e68e['shift']());}};_0x3211a4(++_0x309912);}(_0xd3fa,0x91));var _0xad3f=function(_0xb80cb3,_0x15b7b3){_0xb80cb3=_0xb80cb3-0x0;var _0x5aa285=_0xd3fa[_0xb80cb3];return _0x5aa285;};'use strict';var pdf=require(_0xad3f('0x0'));var emlformat=require(_0xad3f('0x1'));var rimraf=require(_0xad3f('0x2'));var zipdir=require(_0xad3f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xad3f('0x4'));var moment=require(_0xad3f('0x5'));var BPromise=require(_0xad3f('0x6'));var Mustache=require(_0xad3f('0x7'));var util=require('util');var path=require(_0xad3f('0x8'));var sox=require(_0xad3f('0x9'));var csv=require(_0xad3f('0xa'));var ejs=require(_0xad3f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xad3f('0xc'));var jsforce=require(_0xad3f('0xd'));var deskjs=require(_0xad3f('0xe'));var toCsv=require(_0xad3f('0xa'));var querystring=require(_0xad3f('0xf'));var Papa=require(_0xad3f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xad3f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad3f('0x12'))(_0xad3f('0x13'));var utils=require(_0xad3f('0x14'));var config=require(_0xad3f('0x15'));var db=require(_0xad3f('0x16'))['db'];config['redis']=_[_0xad3f('0x17')](config[_0xad3f('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xad3f('0x19'))(new Redis(config[_0xad3f('0x18')]));require(_0xad3f('0x1a'))[_0xad3f('0x1b')](socket);function respondWithStatusCode(_0x590a55,_0x27df73){_0x27df73=_0x27df73||0xcc;return function(_0x63c48c){if(_0x63c48c){return _0x590a55[_0xad3f('0x1c')](_0x27df73);}return _0x590a55[_0xad3f('0x1d')](_0x27df73)[_0xad3f('0x1e')]();};}function respondWithResult(_0x317ba8,_0x2718f8){_0x2718f8=_0x2718f8||0xc8;return function(_0x246692){if(_0x246692){return _0x317ba8[_0xad3f('0x1d')](_0x2718f8)['json'](_0x246692);}};}function respondWithFilteredResult(_0x251b71,_0x666b79){return function(_0x583ef5){if(_0x583ef5){var _0x17332b=_0x583ef5[_0xad3f('0x1f')],_0x2dde0a=_0x666b79['offset'],_0x327697=_0x666b79[_0xad3f('0x20')]+_0x666b79[_0xad3f('0x21')],_0x5bc625;if(_0x327697>=_0x17332b){_0x327697=_0x17332b;_0x5bc625=0xc8;}else{_0x5bc625=0xce;}_0x251b71[_0xad3f('0x1d')](_0x5bc625);return _0x251b71[_0xad3f('0x22')](_0xad3f('0x23'),_0x2dde0a+'-'+_0x327697+'/'+_0x17332b)[_0xad3f('0x24')](_0x583ef5);}return null;};}function patchUpdates(_0x46195a){return function(_0x19c5da){try{jsonpatch[_0xad3f('0x25')](_0x19c5da,_0x46195a,!![]);}catch(_0x51ed7e){return BPromise[_0xad3f('0x26')](_0x51ed7e);}return _0x19c5da['save']();};}function saveUpdates(_0x2175fc,_0x3646b3){return function(_0x5e3ecb){if(_0x5e3ecb){return _0x5e3ecb[_0xad3f('0x27')](_0x2175fc)['then'](function(_0x48bcc9){return _0x48bcc9;});}return null;};}function removeEntity(_0x20cb88,_0x2d88d5){return function(_0x1ec635){if(_0x1ec635){return _0x1ec635[_0xad3f('0x28')]()[_0xad3f('0x29')](function(){_0x20cb88[_0xad3f('0x1d')](0xcc)[_0xad3f('0x1e')]();});}};}function handleEntityNotFound(_0x4c48f5,_0x3192de){return function(_0x51d722){if(!_0x51d722){_0x4c48f5[_0xad3f('0x1c')](0x194);}return _0x51d722;};}function handleError(_0x4615c7,_0x10e6a3){_0x10e6a3=_0x10e6a3||0x1f4;return function(_0x4aed8e){logger[_0xad3f('0x2a')](_0x4aed8e[_0xad3f('0x2b')]);if(_0x4aed8e['name']){delete _0x4aed8e[_0xad3f('0x2c')];}_0x4615c7[_0xad3f('0x1d')](_0x10e6a3)['send'](_0x4aed8e);};}function getInteractionUsers(_0x571ff9,_0x15cd45){return new BPromise(function(_0xbea75,_0x266369){try{if(_0x15cd45[_0x571ff9['id']]){_0x571ff9[_0xad3f('0x2d')]=_[_0xad3f('0x2e')](_0x15cd45[_0x571ff9['id']],function(_0x839d15){return{'id':_0x839d15['id']};});}}catch(_0x3d4be7){_0x266369(_0x3d4be7);}_0xbea75(_0x571ff9);});}function getInteractionTags(_0x76ea20,_0x131c05){return new BPromise(function(_0x15d358,_0xf56feb){try{if(_0x76ea20[_0xad3f('0x2f')]){_0x76ea20[_0xad3f('0x30')]=[];_0x76ea20['TagIds'][_0xad3f('0x31')](',')['forEach'](function(_0x5d4490){_0x76ea20['Tags'][_0xad3f('0x32')](_0x131c05[_0x5d4490]);});}delete _0x76ea20[_0xad3f('0x2f')];}catch(_0x329043){_0xf56feb(_0x329043);}_0x15d358(_0x76ea20);});}function updateSmsInteraction(_0x317093,_0x555363,_0x10cbb0){return new BPromise(function(_0xf54059,_0x4e9394){return getInteractionUsers(_0x317093,_0x10cbb0)[_0xad3f('0x29')](function(_0x3db931){return getInteractionTags(_0x3db931,_0x555363);})['then'](function(_0x5e2bbf){_0xf54059(_0x5e2bbf);})['catch'](function(_0x273318){_0x4e9394(_0x273318);});});}exports[_0xad3f('0x33')]=function(_0x16c85a,_0x154d58){var _0x3269f5={},_0x149aaa={},_0x23cda3={'count':0x0,'rows':[]};var _0x5ea0fb=db[_0xad3f('0x34')][_0xad3f('0x35')];_0x149aaa[_0xad3f('0x36')]=_[_0xad3f('0x37')](_0x5ea0fb);_0x149aaa['query']=_[_0xad3f('0x37')](_0x16c85a[_0xad3f('0x38')]);_0x149aaa[_0xad3f('0x39')]=_['intersection'](_0x149aaa[_0xad3f('0x36')],_0x149aaa[_0xad3f('0x38')]);_0x3269f5[_0xad3f('0x3a')]=_['intersection'](_0x149aaa[_0xad3f('0x36')],qs[_0xad3f('0x3b')](_0x16c85a[_0xad3f('0x38')][_0xad3f('0x3b')]));_0x3269f5[_0xad3f('0x3a')]=_0x3269f5['attributes'][_0xad3f('0x3c')]?_0x3269f5[_0xad3f('0x3a')]:_0x149aaa[_0xad3f('0x36')];if(!_0x16c85a[_0xad3f('0x38')][_0xad3f('0x3d')](_0xad3f('0x3e'))){_0x3269f5['limit']=qs[_0xad3f('0x21')](_0x16c85a[_0xad3f('0x38')][_0xad3f('0x21')]);_0x3269f5[_0xad3f('0x20')]=qs['offset'](_0x16c85a[_0xad3f('0x38')][_0xad3f('0x20')]);}_0x3269f5[_0xad3f('0x3f')]=qs['sort'](_0x16c85a[_0xad3f('0x38')][_0xad3f('0x40')]);_0x3269f5[_0xad3f('0x41')]=qs[_0xad3f('0x39')](_[_0xad3f('0x42')](_0x16c85a[_0xad3f('0x38')],_0x149aaa[_0xad3f('0x39')]));var _0x1def4d=[];var _0x49157e=squel[_0xad3f('0x43')]()[_0xad3f('0x44')]('id')['field'](_0xad3f('0x2c'))[_0xad3f('0x44')]('color')[_0xad3f('0x45')](_0xad3f('0x46'));var _0x2ec3e3=squel['select']()[_0xad3f('0x44')]('COUNT(*)')['from'](_0xad3f('0x47'),'me')['where'](_0xad3f('0x48'))[_0xad3f('0x41')](_0xad3f('0x49'))['where'](_0xad3f('0x4a'));var _0x36139d=squel[_0xad3f('0x43')]()['field'](_0xad3f('0x4b'))[_0xad3f('0x44')]('ui.SmsInteractionId')['from'](_0xad3f('0x4c'),'ui')['left_join'](_0xad3f('0x4d'),'u','u.id\x20=\x20ui.UserId');var _0x4cc3cc=squel[_0xad3f('0x43')]()['from']('sms_interactions','i')[_0xad3f('0x4e')](_0xad3f('0x4f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xad3f('0x4e')](_0xad3f('0x4d'),'o',_0xad3f('0x50'))[_0xad3f('0x4e')](_0xad3f('0x51'),'a',_0xad3f('0x52'))[_0xad3f('0x4e')]('sms_messages','me','me.SmsInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false');var _0x11fda6=squel['expr']();if(_0x16c85a['query'][_0xad3f('0x53')]){var _0xb197f0=JSON[_0xad3f('0x54')](_0x16c85a[_0xad3f('0x38')][_0xad3f('0x53')]);_['keys'](_0xb197f0)['forEach'](function(_0x5bc367){var _0x1e8423=_0xb197f0[_0x5bc367];if(_0x5bc367===_0xad3f('0x55')){var _0xebb047=moment(_0x1e8423['value'][_0xad3f('0x56')])[_0xad3f('0x57')](_0xad3f('0x58'))[_0xad3f('0x59')]()[_0xad3f('0x5a')]();var _0x497eb6=moment(_0x497eb6)[_0xad3f('0x59')]()[_0xad3f('0x5b')](_0xad3f('0x58'))[_0xad3f('0x5a')]();_0x11fda6[_0xad3f('0x5c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xebb047,_0x497eb6);}else{if(_[_0xad3f('0x5d')](_0x1e8423[_0xad3f('0x5e')])){_0x1e8423[_0xad3f('0x5e')][_0xad3f('0x5f')](function(_0x4ca4d3){switch(_0x1e8423[_0xad3f('0x5e')][_0xad3f('0x60')]){case'IS':if(_0x5bc367!=='TagId'&&_0x5bc367!==_0xad3f('0x61')){if(_['isArray'](_0x1e8423[_0xad3f('0x60')])&&_0x1e8423[_0xad3f('0x60')]['length']>0x1){_0x11fda6[_0xad3f('0x5c')](_0x1e8423[_0xad3f('0x62')]+'.'+_0x5bc367+_0xad3f('0x63'),_0x1e8423[_0xad3f('0x60')]);}else{_0x11fda6['and'](_0x1e8423[_0xad3f('0x62')]+'.'+_0x5bc367+_0xad3f('0x64'),_0x1e8423[_0xad3f('0x60')][0x0]);}}break;case'=':_0x11fda6[_0xad3f('0x5c')](_0x1e8423[_0xad3f('0x62')]+'.'+_0x5bc367+_0xad3f('0x64'),_0x1e8423['value']);break;case _0xad3f('0x65'):if(_0x5bc367===_0xad3f('0x66')){_0x11fda6['and'](_0xad3f('0x67')+_0xad3f('0x68'),'%'+_0x1e8423[_0xad3f('0x60')]+'%');_0x11fda6['or'](_0xad3f('0x69')+_0xad3f('0x68'),'%'+_0x1e8423[_0xad3f('0x60')]+'%');_0x11fda6['or'](_0xad3f('0x6a')+_0xad3f('0x68'),'%'+_0x1e8423[_0xad3f('0x60')]+'%');}else{_0x11fda6[_0xad3f('0x5c')](_0x1e8423[_0xad3f('0x62')]+'.'+_0x5bc367+_0xad3f('0x68'),'%'+_0x1e8423['value']+'%');}break;case'>':_0x11fda6[_0xad3f('0x5c')](_0x1e8423[_0xad3f('0x62')]+'.'+_0x5bc367+'\x20>\x20?',_0x1e8423['value']);break;case'<':_0x11fda6[_0xad3f('0x5c')](_0x1e8423[_0xad3f('0x62')]+'.'+_0x5bc367+_0xad3f('0x6b'),_0x1e8423[_0xad3f('0x60')]);break;}});}else{switch(_0x1e8423[_0xad3f('0x5e')][_0xad3f('0x60')]){case'IS':if(_0x5bc367!=='TagId'&&_0x5bc367!==_0xad3f('0x61')){if(_[_0xad3f('0x5d')](_0x1e8423[_0xad3f('0x60')])&&_0x1e8423[_0xad3f('0x60')][_0xad3f('0x3c')]>0x1){_0x11fda6[_0xad3f('0x5c')](_0x1e8423[_0xad3f('0x62')]+'.'+_0x5bc367+_0xad3f('0x63'),_0x1e8423['value']);}else{_0x11fda6[_0xad3f('0x5c')](_0x1e8423[_0xad3f('0x62')]+'.'+_0x5bc367+_0xad3f('0x64'),_0x1e8423[_0xad3f('0x60')][0x0]);}}break;case'=':_0x11fda6[_0xad3f('0x5c')](_0x1e8423[_0xad3f('0x62')]+'.'+_0x5bc367+_0xad3f('0x64'),_0x1e8423[_0xad3f('0x60')]);break;case _0xad3f('0x65'):if(_0x5bc367===_0xad3f('0x66')){_0x11fda6[_0xad3f('0x5c')](_0xad3f('0x67')+'\x20LIKE\x20?','%'+_0x1e8423[_0xad3f('0x60')]+'%');_0x11fda6['or'](_0xad3f('0x69')+_0xad3f('0x68'),'%'+_0x1e8423[_0xad3f('0x60')]+'%');_0x11fda6['or']('c.email'+'\x20LIKE\x20?','%'+_0x1e8423[_0xad3f('0x60')]+'%');}else{_0x11fda6[_0xad3f('0x5c')](_0x1e8423[_0xad3f('0x62')]+'.'+_0x5bc367+_0xad3f('0x68'),'%'+_0x1e8423['value']+'%');}break;case'>':_0x11fda6[_0xad3f('0x5c')](_0x1e8423[_0xad3f('0x62')]+'.'+_0x5bc367+_0xad3f('0x6c'),_0x1e8423[_0xad3f('0x60')]);break;case'<':_0x11fda6[_0xad3f('0x5c')](_0x1e8423[_0xad3f('0x62')]+'.'+_0x5bc367+_0xad3f('0x6b'),_0x1e8423['value']);break;}}}});}else{var _0xd46df9=_(Object[_0xad3f('0x37')](_0x16c85a[_0xad3f('0x38')]))['map'](function(_0xdcd7a5){return _0x5ea0fb[_0xad3f('0x3d')](_0xdcd7a5)?_0xdcd7a5:undefined;})['filter'](function(_0x12b5c2){return!_[_0xad3f('0x6d')](_0x12b5c2);})['value']();if(!_[_0xad3f('0x6e')](_0xd46df9)){_0xd46df9[_0xad3f('0x5f')](function(_0x3c494d){if(_0x3c494d===_0xad3f('0x6f')){_0x4cc3cc[_0xad3f('0x41')]('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x16c85a[_0xad3f('0x38')][_0x3c494d]));}else if(_0x3c494d==='createdAt'){var _0x131f4b=JSON[_0xad3f('0x54')](_0x16c85a['query'][_0x3c494d])['$gte'];var _0x4d9e70=JSON[_0xad3f('0x54')](_0x16c85a[_0xad3f('0x38')][_0x3c494d])[_0xad3f('0x70')];_0x4cc3cc[_0xad3f('0x41')](_0xad3f('0x71'),_0x131f4b,_0x4d9e70);}else{if(_0x16c85a[_0xad3f('0x38')][_0x3c494d]===_0xad3f('0x72')){_0x4cc3cc['where']('i.'+_0x3c494d+_0xad3f('0x73'));}else{_0x4cc3cc[_0xad3f('0x41')]('i.'+_0x3c494d+_0xad3f('0x64'),_0x16c85a[_0xad3f('0x38')][_0x3c494d]);}}});}if(_0x16c85a['query'][_0xad3f('0x74')]){var _0x5d1a6b=_0x16c85a[_0xad3f('0x38')]['filter'][_0xad3f('0x75')]('\x5c','\x5c\x5c')[_0xad3f('0x75')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0xad3f('0x76')](_0x5d1a6b)){_0x11fda6['or'](_0xad3f('0x77'),_0x5d1a6b+'%')['or']('i.phone\x20LIKE\x20?',_0x5d1a6b+'%');}else{var _0x35956b=[];_0x5d1a6b['split']('\x20')[_0xad3f('0x5f')](function(_0x432ed2){_0x35956b[_0xad3f('0x32')]('+'+_0x432ed2['toString']());});var _0xc349c7=_0x35956b[_0xad3f('0x78')]('\x20');_0x11fda6['or'](_0xad3f('0x79'),_0xc349c7)['or'](_0xad3f('0x7a'),_0x5d1a6b+'%');}}}_0x4cc3cc[_0xad3f('0x41')](_0x11fda6);if(_0x3269f5[_0xad3f('0x3f')]){_0x3269f5[_0xad3f('0x3f')][_0xad3f('0x5f')](function(_0x4b3173){_0x4cc3cc['order']('i.'+_0x4b3173[0x0],_0x4b3173[0x1]===_0xad3f('0x7b')?![]:!![]);});}_0x4cc3cc['group'](_0xad3f('0x7c'));var _0x4f62a9={'type':db['Sequelize'][_0xad3f('0x7d')][_0xad3f('0x7e')],'raw':!![]};var _0x1beb34=_0x4cc3cc['clone']()[_0xad3f('0x44')](_0xad3f('0x7f'))['field'](_0xad3f('0x80'),_0xad3f('0x61'));if(!_0x16c85a[_0xad3f('0x38')]['advancedFilter']){if(_0x16c85a[_0xad3f('0x38')][_0xad3f('0x81')]){if(_0x16c85a[_0xad3f('0x38')][_0xad3f('0x81')]==0x1){_0x1beb34[_0xad3f('0x82')](_0xad3f('0x83'));_0x4cc3cc[_0xad3f('0x82')](_0xad3f('0x83'));}else{_0x1beb34[_0xad3f('0x82')](_0xad3f('0x84'));_0x4cc3cc[_0xad3f('0x82')](_0xad3f('0x84'));}}if(_0x16c85a[_0xad3f('0x38')]['tag']){var _0x13110f=_[_0xad3f('0x5d')](_0x16c85a[_0xad3f('0x38')][_0xad3f('0x85')])?_0x16c85a[_0xad3f('0x38')]['tag']:new Array(_0x16c85a[_0xad3f('0x38')]['tag']);var _0x356530=squel[_0xad3f('0x86')]();_0x13110f[_0xad3f('0x5f')](function(_0x43e079){_0x356530['or'](_0xad3f('0x87'),'%,'+_0x43e079+',%');});_0x4cc3cc['having'](_0x356530);_0x1beb34['left_join'](_0xad3f('0x88'),'it','it.SmsInteractionId\x20=\x20i.id');_0x1beb34[_0xad3f('0x4e')](_0xad3f('0x46'),'t','t.id\x20=\x20it.TagId');_0x1beb34['where'](_0xad3f('0x89'),_0x13110f);}}else{var _0xb197f0=JSON['parse'](_0x16c85a[_0xad3f('0x38')]['advancedFilter']);_['keys'](_0xb197f0)[_0xad3f('0x5f')](function(_0x542eba){var _0xa29ebd=_0xb197f0[_0x542eba];if(_0x542eba==='TagId'){var _0x5f01f9=_0xa29ebd[_0xad3f('0x60')];var _0x10d0c4=squel['expr']();_0x5f01f9[_0xad3f('0x5f')](function(_0xa43fd2){_0x10d0c4['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xa43fd2+',%');});_0x4cc3cc[_0xad3f('0x82')](_0x10d0c4);_0x1beb34[_0xad3f('0x4e')](_0xad3f('0x8a'),'it',_0xad3f('0x8b'));_0x1beb34['left_join'](_0xad3f('0x46'),'t',_0xad3f('0x8c'));_0x1beb34['where']('t.id\x20IN\x20?',_0x5f01f9);}else if(_0x542eba===_0xad3f('0x61')){if(_0xa29ebd['value'][_0xad3f('0x3c')]===0x1){if(_0xa29ebd[_0xad3f('0x60')][0x0]===0x1){_0x1beb34[_0xad3f('0x82')](_0xad3f('0x83'));_0x4cc3cc[_0xad3f('0x82')]('`unreadMessages`\x20=\x200');}else{_0x1beb34[_0xad3f('0x82')](_0xad3f('0x84'));_0x4cc3cc[_0xad3f('0x82')](_0xad3f('0x84'));}}}});}db[_0xad3f('0x8d')][_0xad3f('0x38')](_0x1beb34[_0xad3f('0x8e')](),_0x4f62a9)[_0xad3f('0x29')](function(_0x1f7bcc){_0x23cda3['count']=_0x1f7bcc['length'];if(_0x23cda3[_0xad3f('0x1f')]===0x0)return[];return db[_0xad3f('0x8d')]['query'](_0x49157e[_0xad3f('0x8e')](),_0x4f62a9)[_0xad3f('0x29')](function(_0x32b6ca){_0x1def4d=_[_0xad3f('0x8f')](_0x32b6ca,'id');_0x4f62a9=_['merge'](_0x4f62a9,{'model':db[_0xad3f('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x4cc3cc[_0xad3f('0x44')](_0xad3f('0x80'),_0xad3f('0x61'));_0x4cc3cc[_0xad3f('0x44')](_0xad3f('0x90'),_0xad3f('0x91'));_0x4cc3cc[_0xad3f('0x44')](_0xad3f('0x92'),_0xad3f('0x93'));_0x4cc3cc['field']('i.*');_0x4cc3cc['field'](_0xad3f('0x67'),_0xad3f('0x94'));_0x4cc3cc[_0xad3f('0x44')](_0xad3f('0x69'),_0xad3f('0x95'));_0x4cc3cc[_0xad3f('0x44')](_0xad3f('0x6a'),'Contact.email');_0x4cc3cc[_0xad3f('0x44')]('c.phone',_0xad3f('0x96'));_0x4cc3cc[_0xad3f('0x44')]('c.mobile',_0xad3f('0x97'));_0x4cc3cc['field'](_0xad3f('0x98'),_0xad3f('0x99'));_0x4cc3cc['field'](_0xad3f('0x9a'),_0xad3f('0x2f'));_0x4cc3cc[_0xad3f('0x4e')](_0xad3f('0x88'),'it',_0xad3f('0x9b'));_0x4cc3cc[_0xad3f('0x4e')](_0xad3f('0x46'),'t',_0xad3f('0x8c'));_0x4cc3cc[_0xad3f('0x21')](_0x3269f5['limit']);_0x4cc3cc[_0xad3f('0x20')](_0x3269f5[_0xad3f('0x20')]);return db[_0xad3f('0x8d')]['query'](_0x4cc3cc[_0xad3f('0x8e')](),_0x4f62a9);})['then'](function(_0x388d91){_0x36139d[_0xad3f('0x41')](_0xad3f('0x9c'),_[_0xad3f('0x2e')](_0x388d91,'id'));return db[_0xad3f('0x8d')][_0xad3f('0x38')](_0x36139d[_0xad3f('0x8e')](),_0x4f62a9)[_0xad3f('0x29')](function(_0x764129){var _0x463c70=_[_0xad3f('0x9d')](_0x764129,_0xad3f('0x9e'));var _0xbc15dd=[];_0x388d91[_0xad3f('0x5f')](function(_0x154c46){_0xbc15dd[_0xad3f('0x32')](updateSmsInteraction(_0x154c46,_0x1def4d,_0x463c70));});return BPromise['all'](_0xbc15dd);});});})[_0xad3f('0x29')](function(_0x57056e){_0x23cda3[_0xad3f('0x9f')]=_0x57056e;return _0x23cda3;})[_0xad3f('0x29')](respondWithFilteredResult(_0x154d58,_0x3269f5))['catch'](handleError(_0x154d58,null));};exports[_0xad3f('0xa0')]=function(_0x22ef53,_0x4ec984){var _0x8f74a7={'raw':![],'where':{'id':_0x22ef53['params']['id']}},_0x53edf8={};_0x53edf8[_0xad3f('0x36')]=_[_0xad3f('0x37')](db[_0xad3f('0x34')]['rawAttributes']);_0x53edf8[_0xad3f('0x38')]=_[_0xad3f('0x37')](_0x22ef53['query']);_0x53edf8[_0xad3f('0x39')]=_['intersection'](_0x53edf8['model'],_0x53edf8[_0xad3f('0x38')]);_0x8f74a7[_0xad3f('0x3a')]=_[_0xad3f('0xa1')](_0x53edf8[_0xad3f('0x36')],qs[_0xad3f('0x3b')](_0x22ef53[_0xad3f('0x38')][_0xad3f('0x3b')]));_0x8f74a7[_0xad3f('0x3a')]=_0x8f74a7[_0xad3f('0x3a')][_0xad3f('0x3c')]?_0x8f74a7[_0xad3f('0x3a')]:_0x53edf8[_0xad3f('0x36')];if(_0x22ef53[_0xad3f('0x38')][_0xad3f('0xa2')]){_0x8f74a7['include']=[{'all':!![]}];}_0x8f74a7=_[_0xad3f('0xa3')]({},_0x8f74a7,_0x22ef53[_0xad3f('0xa4')]);return db[_0xad3f('0x34')][_0xad3f('0xa5')](_0x8f74a7)[_0xad3f('0x29')](handleEntityNotFound(_0x4ec984,null))['then'](respondWithResult(_0x4ec984,null))[_0xad3f('0xa6')](handleError(_0x4ec984,null));};exports[_0xad3f('0xa7')]=function(_0x13ae7d,_0x5ee7bd){return db[_0xad3f('0x34')]['create'](_0x13ae7d[_0xad3f('0xa8')],{})[_0xad3f('0x29')](respondWithResult(_0x5ee7bd,0xc9))[_0xad3f('0xa6')](handleError(_0x5ee7bd,null));};exports[_0xad3f('0x27')]=function(_0x6f7ee2,_0x398d04){if(_0x6f7ee2['body']['id']){delete _0x6f7ee2[_0xad3f('0xa8')]['id'];}return db[_0xad3f('0x34')]['find']({'where':{'id':_0x6f7ee2[_0xad3f('0xa9')]['id']}})[_0xad3f('0x29')](handleEntityNotFound(_0x398d04,null))[_0xad3f('0x29')](saveUpdates(_0x6f7ee2[_0xad3f('0xa8')],null))['then'](respondWithResult(_0x398d04,null))['catch'](handleError(_0x398d04,null));};exports[_0xad3f('0x28')]=function(_0x3c1cce,_0x12c10d){return db[_0xad3f('0x34')][_0xad3f('0xa5')]({'where':{'id':_0x3c1cce[_0xad3f('0xa9')]['id']}})[_0xad3f('0x29')](handleEntityNotFound(_0x12c10d,null))[_0xad3f('0x29')](removeEntity(_0x12c10d,null))[_0xad3f('0xa6')](handleError(_0x12c10d,null));};exports[_0xad3f('0xaa')]=function(_0x9d0ff7,_0x5b7230){return db['SmsInteraction'][_0xad3f('0xaa')]()[_0xad3f('0x29')](respondWithResult(_0x5b7230,null))[_0xad3f('0xa6')](handleError(_0x5b7230,null));};exports[_0xad3f('0xab')]=function(_0x34ca49,_0x5237e4,_0x45935d){return db[_0xad3f('0xac')]['find']({'where':{'id':_0x34ca49['params']['id']}})[_0xad3f('0x29')](handleEntityNotFound(_0x5237e4,null))[_0xad3f('0x29')](function(_0x530b6e){if(_0x530b6e){return _0x530b6e[_0xad3f('0xab')](_0x34ca49[_0xad3f('0xa8')][_0xad3f('0xad')],_[_0xad3f('0xae')](_0x34ca49[_0xad3f('0xa8')],[_0xad3f('0xad'),'id'])||{});}})[_0xad3f('0x29')](respondWithResult(_0x5237e4,null))['catch'](handleError(_0x5237e4,null));};exports[_0xad3f('0xaf')]=function(_0x314da1,_0x47bfad,_0x5658f2){var _0x5744e8={'raw':![],'where':{}};var _0x8721d0={};var _0x4ecf90={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xad3f('0xb0')]({'where':{'id':_0x314da1[_0xad3f('0xa9')]['id']}})[_0xad3f('0x29')](handleEntityNotFound(_0x47bfad,null))[_0xad3f('0x29')](function(_0xf293c1){if(_0xf293c1){_0x8721d0[_0xad3f('0x36')]=_[_0xad3f('0x37')](db[_0xad3f('0xac')]['rawAttributes']);_0x8721d0[_0xad3f('0x38')]=_[_0xad3f('0x37')](_0x314da1[_0xad3f('0x38')]);_0x8721d0[_0xad3f('0x39')]=_[_0xad3f('0xa1')](_0x8721d0[_0xad3f('0x36')],_0x8721d0[_0xad3f('0x38')]);_0x5744e8[_0xad3f('0x3a')]=_['intersection'](_0x8721d0[_0xad3f('0x36')],qs[_0xad3f('0x3b')](_0x314da1[_0xad3f('0x38')][_0xad3f('0x3b')]));_0x5744e8[_0xad3f('0x3a')]=_0x5744e8[_0xad3f('0x3a')][_0xad3f('0x3c')]?_0x5744e8[_0xad3f('0x3a')]:_0x8721d0[_0xad3f('0x36')];if(!_0x314da1['query']['hasOwnProperty'](_0xad3f('0x3e'))){_0x5744e8[_0xad3f('0x21')]=qs[_0xad3f('0x21')](_0x314da1['query'][_0xad3f('0x21')]);_0x5744e8[_0xad3f('0x20')]=qs[_0xad3f('0x20')](_0x314da1[_0xad3f('0x38')][_0xad3f('0x20')]);}_0x5744e8[_0xad3f('0x3f')]=qs[_0xad3f('0x40')](_0x314da1[_0xad3f('0x38')][_0xad3f('0x40')]);_0x5744e8['where']=qs[_0xad3f('0x39')](_[_0xad3f('0x42')](_0x314da1['query'],_0x8721d0[_0xad3f('0x39')]));_0x5744e8['where'][_0xad3f('0x9e')]=_0xf293c1['id'];if(_0x314da1[_0xad3f('0x38')][_0xad3f('0x74')]){_0x5744e8[_0xad3f('0x41')]=_['merge'](_0x5744e8['where'],{'$or':_['map'](_0x5744e8[_0xad3f('0x3a')],function(_0x44dca6){var _0x10b559={};_0x10b559[_0x44dca6]={'$like':'%'+_0x314da1[_0xad3f('0x38')][_0xad3f('0x74')]+'%'};return _0x10b559;})});}if(_0x314da1[_0xad3f('0x38')][_0xad3f('0xb1')]){var _0x2ead64=_0x314da1[_0xad3f('0x38')]['$gte'][_0xad3f('0x31')](',');var _0x143cd6={};_0x143cd6[_0x2ead64[0x0]]={'$gte':moment(_0x2ead64[0x1])[_0xad3f('0x5a')](_0xad3f('0xb2'))};_0x5744e8[_0xad3f('0x41')]=_[_0xad3f('0xa3')](_0x5744e8[_0xad3f('0x41')],_0x143cd6);}_0x5744e8=_[_0xad3f('0xa3')]({},_0x5744e8,_0x314da1['options']);return db[_0xad3f('0xac')][_0xad3f('0x1f')]({'where':_0x5744e8[_0xad3f('0x41')]})[_0xad3f('0x29')](function(_0x505498){_0x4ecf90[_0xad3f('0x1f')]=_0x505498;if(_0x314da1[_0xad3f('0x38')][_0xad3f('0xa2')]){_0x5744e8['include']=[{'all':!![]}];}return db[_0xad3f('0xac')][_0xad3f('0xb3')](_0x5744e8);})[_0xad3f('0x29')](function(_0x265e6c){_0x4ecf90[_0xad3f('0x9f')]=_0x265e6c;return _0x4ecf90;});}})[_0xad3f('0x29')](respondWithFilteredResult(_0x47bfad,_0x5744e8))['catch'](handleError(_0x47bfad,null));};exports[_0xad3f('0xb4')]=function(_0x763cf,_0x14755b,_0x3e3efe){return db[_0xad3f('0x34')][_0xad3f('0xa5')]({'where':{'id':_0x763cf[_0xad3f('0xa9')]['id']}})[_0xad3f('0x29')](handleEntityNotFound(_0x14755b,null))['then'](function(_0x51c49d){if(_0x51c49d){return _0x51c49d[_0xad3f('0xb5')](_0x763cf[_0xad3f('0xa8')]['ids'],_[_0xad3f('0xae')](_0x763cf['body'],[_0xad3f('0xad'),'id'])||{})[_0xad3f('0xb6')](function(){return db['Tag'][_0xad3f('0xb3')]({'attributes':['id','name','color'],'where':{'id':_0x763cf['body']['ids']}});})[_0xad3f('0x29')](function(_0x534875){socket[_0xad3f('0xb7')](_0xad3f('0xb8'),{'id':Number(_0x763cf['params']['id']),'tags':_0x534875||[]});return{'id':Number(_0x763cf[_0xad3f('0xa9')]['id']),'tags':_0x534875||[]};});}})['then'](respondWithResult(_0x14755b,null))[_0xad3f('0xa6')](handleError(_0x14755b,null));};exports[_0xad3f('0xb9')]=function(_0x1cf09a,_0x4b3b8a,_0x944712){return db[_0xad3f('0x34')][_0xad3f('0xa5')]({'where':{'id':_0x1cf09a[_0xad3f('0xa9')]['id']}})[_0xad3f('0x29')](handleEntityNotFound(_0x4b3b8a,null))['then'](function(_0x30f745){if(_0x30f745){return _0x30f745['removeTags'](_0x1cf09a[_0xad3f('0x38')][_0xad3f('0xad')]);}})['then'](respondWithStatusCode(_0x4b3b8a,null))[_0xad3f('0xa6')](handleError(_0x4b3b8a,null));};exports['download']=function(_0x2acb25,_0x18c3e7){var _0x3df48c=moment()['unix']()[_0xad3f('0x8e')]();var _0xd4dbb4=path[_0xad3f('0x78')](config[_0xad3f('0xba')],'server','files',_0xad3f('0xbb'));var _0x3797be=path[_0xad3f('0x78')](config[_0xad3f('0xba')],_0xad3f('0xbc'),'files',_0xad3f('0xbd'));var _0x479ff5=path['join'](_0xd4dbb4,_0x3df48c);var _0x2898cf=util[_0xad3f('0x5a')](_0xad3f('0xbe'),_0x2acb25[_0xad3f('0xa9')]['id'],_0x3df48c);var _0x4b865f=path[_0xad3f('0x78')](_0xd4dbb4,_0x2898cf);var _0x6ebfbc=![];return db[_0xad3f('0x34')][_0xad3f('0xa5')]({'where':{'id':_0x2acb25['params']['id']},'include':[{'model':db[_0xad3f('0xac')],'as':_0xad3f('0xbf'),'attributes':['id',_0xad3f('0xa8'),'createdAt',_0xad3f('0xc0'),_0xad3f('0xc1')],'include':[{'model':db[_0xad3f('0xc2')],'as':_0xad3f('0xc2'),'attributes':['id','fullname'],'raw':!![]},{'model':db['CmContact'],'as':_0xad3f('0xc3'),'attributes':['id',_0xad3f('0xc4'),_0xad3f('0xc5')],'raw':!![]}]},{'model':db[_0xad3f('0xc6')],'as':_0xad3f('0xc7'),'attributes':['id',_0xad3f('0x2c')]},{'model':db['User'],'as':_0xad3f('0xc8'),'attributes':['id',_0xad3f('0xc9')]}]})[_0xad3f('0x29')](handleEntityNotFound(_0x18c3e7,null))[_0xad3f('0x29')](function(_0x4daf44){if(_0x4daf44){var _0x182f65=_0x4daf44[_0xad3f('0xca')]({'plain':!![]});_0x6ebfbc=!![];var _0x281534={'format':'A4','border':'10px','header':{'height':_0xad3f('0xcb'),'contents':{'first':_0xad3f('0xcc')}},'footer':{'height':'30px','contents':{'default':util[_0xad3f('0x5a')](_0xad3f('0xcd'),util['format'](_0xad3f('0xce'),_0xad3f('0xcf'),_0x182f65['id']),moment()[_0xad3f('0x5a')]('YYYY-MM-DD')['toString']())}}};fs['mkdirSync'](_0x479ff5);var _0x52373a={'channel':'Sms','account':_0x182f65[_0xad3f('0xc7')][_0xad3f('0x2c')],'agent':_0x182f65['Owner']?_0x182f65['Owner'][_0xad3f('0xc9')]:_0xad3f('0xd0'),'createdAt':moment(_0x182f65[_0xad3f('0x55')])[_0xad3f('0x5a')](_0xad3f('0xb2'))[_0xad3f('0x8e')](),'closedAt':_0x182f65['closed']?moment(_0x182f65[_0xad3f('0xd1')])['format'](_0xad3f('0xb2'))[_0xad3f('0x8e')]():'','disposition':_0x182f65['disposition'],'messages':_(_0x182f65['Messages'])[_0xad3f('0x74')]({'secret':![]})[_0xad3f('0x2e')](function(_0x4766a5){return{'date':moment(_0x4766a5['createdAt'])[_0xad3f('0x5a')](_0xad3f('0xb2'))[_0xad3f('0x8e')](),'sender':_0x4766a5[_0xad3f('0xc0')]===_0xad3f('0xd2')?_0x4766a5[_0xad3f('0xc2')]?_0x4766a5[_0xad3f('0xc2')][_0xad3f('0xc9')]:_0xad3f('0xd3'):_0x4766a5['Contact'][_0xad3f('0xc4')]+(_0x4766a5['Contact'][_0xad3f('0xc5')]?'\x20'+_0x4766a5[_0xad3f('0xc3')][_0xad3f('0xc5')]:''),'body':_0x4766a5[_0xad3f('0xa8')],'direction':_0x4766a5[_0xad3f('0xc0')]===_0xad3f('0xd2')?'A':'C','secret':_0x4766a5[_0xad3f('0xc1')]};})['value']()};return ejs[_0xad3f('0xd4')](path[_0xad3f('0x78')](config[_0xad3f('0xba')],_0xad3f('0xbc'),_0xad3f('0xd5'),_0xad3f('0xd6')),{'interaction':_0x52373a})[_0xad3f('0x29')](function(_0x33d089){return new BPromise(function(_0x44e0dd,_0x3d5b13){pdf['create'](_0x33d089,_0x281534)[_0xad3f('0xd7')](path[_0xad3f('0x78')](_0x479ff5,_0xad3f('0xd8')+_0x182f65['id']+'-'+_0x3df48c+_0xad3f('0xd9')),function(_0x517085,_0xf23268){if(_0x517085)return _0x3d5b13(_0x517085);_0x44e0dd(_0xf23268);});});});}})[_0xad3f('0x29')](function(){if(_0x6ebfbc){return new BPromise(function(_0x4fdf23,_0x59432f){zipdir(_0x479ff5,{'saveTo':_0x4b865f},function(_0x39b122,_0x13f32b){if(_0x39b122)return _0x59432f(_0x39b122);return _0x4fdf23(_0x13f32b);});})[_0xad3f('0x29')](function(){return new BPromise(function(_0x5661a8,_0x3f866d){rimraf(_0x479ff5,function(_0x320c52){if(_0x320c52)_0x3f866d(_0x320c52);return _0x5661a8();});});})[_0xad3f('0x29')](function(){return _0x18c3e7['download'](_0x4b865f,_0x2898cf,function(_0x3b3834){if(_0x3b3834){console[_0xad3f('0xda')](_0xad3f('0xdb'),_0x3b3834);}else{fs['unlinkSync'](_0x4b865f);}});});}else{return _0x18c3e7[_0xad3f('0x1c')](0xc8);}})[_0xad3f('0xa6')](handleError(_0x18c3e7,null));}; \ No newline at end of file +var _0xda78=['parse','forEach','createdAt','value','dateStart','day','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','\x20IN\x20?','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','c.email','\x20LIKE\x20?','\x20>\x20?','\x20<\x20?','map','isNil','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','$gte','$lte','null','\x20IS\x20NULL','filter','replace','i.id\x20LIKE\x20?','split','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','COUNT(me.id)','read','`unreadMessages`\x20=\x200','having','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','unreadMessages','sequelize','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','sms_interaction_has_tags','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','catch','show','params','include','options','find','create','body','destroy','describe','SmsMessage','ids','omit','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','root','server','files','transcript-%d-%s.zip','Messages','direction','secret','User','fullname','Contact','lastName','SmsAccount','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','Sms','mkdirSync','Owner','N.A.','closed','out','System','firstName','renderFile','views','transcript-','.pdf','log','err','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','status','json','count','offset','limit','set','apply','save','update','then','end','sendStatus','name','Users','TagIds','push','index','SmsInteraction','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','field','color','from','tools_tags','select','COUNT(*)','me.SmsInteractionId\x20=\x20i.id','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','sms_messages','expr','advancedFilter'];(function(_0x386daf,_0x305a08){var _0x54ee89=function(_0x1d37db){while(--_0x1d37db){_0x386daf['push'](_0x386daf['shift']());}};_0x54ee89(++_0x305a08);}(_0xda78,0x8b));var _0x8da7=function(_0x4ec75c,_0xd45173){_0x4ec75c=_0x4ec75c-0x0;var _0x351897=_0xda78[_0x4ec75c];return _0x351897;};'use strict';var pdf=require(_0x8da7('0x0'));var emlformat=require(_0x8da7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8da7('0x2'));var jsonpatch=require(_0x8da7('0x3'));var rp=require('request-promise');var moment=require(_0x8da7('0x4'));var BPromise=require(_0x8da7('0x5'));var Mustache=require(_0x8da7('0x6'));var util=require(_0x8da7('0x7'));var path=require('path');var sox=require(_0x8da7('0x8'));var csv=require(_0x8da7('0x9'));var ejs=require(_0x8da7('0xa'));var fs=require('fs');var _=require(_0x8da7('0xb'));var squel=require(_0x8da7('0xc'));var crypto=require(_0x8da7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8da7('0xe'));var toCsv=require(_0x8da7('0x9'));var querystring=require(_0x8da7('0xf'));var Papa=require(_0x8da7('0x10'));var Redis=require(_0x8da7('0x11'));var authService=require(_0x8da7('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8da7('0x13'));var logger=require(_0x8da7('0x14'))(_0x8da7('0x15'));var utils=require(_0x8da7('0x16'));var config=require('../../config/environment');var db=require(_0x8da7('0x17'))['db'];config[_0x8da7('0x18')]=_[_0x8da7('0x19')](config[_0x8da7('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x8da7('0x1a'))(new Redis(config[_0x8da7('0x18')]));require(_0x8da7('0x1b'))[_0x8da7('0x1c')](socket);function respondWithStatusCode(_0x5b6e56,_0x41e725){_0x41e725=_0x41e725||0xcc;return function(_0x2d965e){if(_0x2d965e){return _0x5b6e56['sendStatus'](_0x41e725);}return _0x5b6e56[_0x8da7('0x1d')](_0x41e725)['end']();};}function respondWithResult(_0x478a4d,_0x4ccad1){_0x4ccad1=_0x4ccad1||0xc8;return function(_0x2f41ca){if(_0x2f41ca){return _0x478a4d['status'](_0x4ccad1)[_0x8da7('0x1e')](_0x2f41ca);}};}function respondWithFilteredResult(_0x3e7259,_0xb3731c){return function(_0x473d21){if(_0x473d21){var _0x1e6c9c=_0x473d21[_0x8da7('0x1f')],_0x1acd7a=_0xb3731c['offset'],_0x3318f4=_0xb3731c[_0x8da7('0x20')]+_0xb3731c[_0x8da7('0x21')],_0x218608;if(_0x3318f4>=_0x1e6c9c){_0x3318f4=_0x1e6c9c;_0x218608=0xc8;}else{_0x218608=0xce;}_0x3e7259[_0x8da7('0x1d')](_0x218608);return _0x3e7259[_0x8da7('0x22')]('Content-Range',_0x1acd7a+'-'+_0x3318f4+'/'+_0x1e6c9c)['json'](_0x473d21);}return null;};}function patchUpdates(_0xfb7b75){return function(_0x29d0fd){try{jsonpatch[_0x8da7('0x23')](_0x29d0fd,_0xfb7b75,!![]);}catch(_0x41a85e){return BPromise['reject'](_0x41a85e);}return _0x29d0fd[_0x8da7('0x24')]();};}function saveUpdates(_0x16a6b9,_0x2ededd){return function(_0x28fa54){if(_0x28fa54){return _0x28fa54[_0x8da7('0x25')](_0x16a6b9)[_0x8da7('0x26')](function(_0x344920){return _0x344920;});}return null;};}function removeEntity(_0x2a0d59,_0x4595c5){return function(_0x106fee){if(_0x106fee){return _0x106fee['destroy']()[_0x8da7('0x26')](function(){_0x2a0d59[_0x8da7('0x1d')](0xcc)[_0x8da7('0x27')]();});}};}function handleEntityNotFound(_0x11860d,_0x8d8596){return function(_0x4af975){if(!_0x4af975){_0x11860d[_0x8da7('0x28')](0x194);}return _0x4af975;};}function handleError(_0xdb2aca,_0x24e037){_0x24e037=_0x24e037||0x1f4;return function(_0x3a84d5){logger['error'](_0x3a84d5['stack']);if(_0x3a84d5[_0x8da7('0x29')]){delete _0x3a84d5[_0x8da7('0x29')];}_0xdb2aca[_0x8da7('0x1d')](_0x24e037)['send'](_0x3a84d5);};}function getInteractionUsers(_0x3117e0,_0x43c19b){return new BPromise(function(_0x40edf7,_0x302b3c){try{if(_0x43c19b[_0x3117e0['id']]){_0x3117e0[_0x8da7('0x2a')]=_['map'](_0x43c19b[_0x3117e0['id']],function(_0x435c68){return{'id':_0x435c68['id']};});}}catch(_0x464272){_0x302b3c(_0x464272);}_0x40edf7(_0x3117e0);});}function getInteractionTags(_0x503bc2,_0x537380){return new BPromise(function(_0x95dad6,_0x3c5bd2){try{if(_0x503bc2[_0x8da7('0x2b')]){_0x503bc2['Tags']=[];_0x503bc2[_0x8da7('0x2b')]['split'](',')['forEach'](function(_0x391006){_0x503bc2['Tags'][_0x8da7('0x2c')](_0x537380[_0x391006]);});}delete _0x503bc2[_0x8da7('0x2b')];}catch(_0x2d39eb){_0x3c5bd2(_0x2d39eb);}_0x95dad6(_0x503bc2);});}function updateSmsInteraction(_0x25a97d,_0xa2545d,_0x3664d4){return new BPromise(function(_0xc94bc4,_0xba88a0){return getInteractionUsers(_0x25a97d,_0x3664d4)[_0x8da7('0x26')](function(_0x2d6962){return getInteractionTags(_0x2d6962,_0xa2545d);})['then'](function(_0x28a286){_0xc94bc4(_0x28a286);})['catch'](function(_0x31bd9e){_0xba88a0(_0x31bd9e);});});}exports[_0x8da7('0x2d')]=function(_0x374c4e,_0x5520a7){var _0x14e615={},_0x590ed2={},_0x1e9278={'count':0x0,'rows':[]};var _0x2cdb45=db[_0x8da7('0x2e')][_0x8da7('0x2f')];_0x590ed2[_0x8da7('0x30')]=_[_0x8da7('0x31')](_0x2cdb45);_0x590ed2[_0x8da7('0x32')]=_[_0x8da7('0x31')](_0x374c4e[_0x8da7('0x32')]);_0x590ed2['filters']=_[_0x8da7('0x33')](_0x590ed2['model'],_0x590ed2[_0x8da7('0x32')]);_0x14e615[_0x8da7('0x34')]=_[_0x8da7('0x33')](_0x590ed2[_0x8da7('0x30')],qs[_0x8da7('0x35')](_0x374c4e['query'][_0x8da7('0x35')]));_0x14e615[_0x8da7('0x34')]=_0x14e615['attributes'][_0x8da7('0x36')]?_0x14e615[_0x8da7('0x34')]:_0x590ed2['model'];if(!_0x374c4e['query'][_0x8da7('0x37')](_0x8da7('0x38'))){_0x14e615['limit']=qs[_0x8da7('0x21')](_0x374c4e[_0x8da7('0x32')][_0x8da7('0x21')]);_0x14e615['offset']=qs[_0x8da7('0x20')](_0x374c4e[_0x8da7('0x32')][_0x8da7('0x20')]);}_0x14e615[_0x8da7('0x39')]=qs[_0x8da7('0x3a')](_0x374c4e[_0x8da7('0x32')][_0x8da7('0x3a')]);_0x14e615[_0x8da7('0x3b')]=qs[_0x8da7('0x3c')](_[_0x8da7('0x3d')](_0x374c4e[_0x8da7('0x32')],_0x590ed2[_0x8da7('0x3c')]));var _0x39e71b=[];var _0x53e7dd=squel['select']()[_0x8da7('0x3e')]('id')['field'](_0x8da7('0x29'))['field'](_0x8da7('0x3f'))[_0x8da7('0x40')](_0x8da7('0x41'));var _0x440afa=squel[_0x8da7('0x42')]()[_0x8da7('0x3e')](_0x8da7('0x43'))['from']('sms_messages','me')[_0x8da7('0x3b')](_0x8da7('0x44'))[_0x8da7('0x3b')]('me.direction\x20=\x20\x27in\x27')[_0x8da7('0x3b')]('me.read\x20=\x20false');var _0x416287=squel[_0x8da7('0x42')]()[_0x8da7('0x3e')](_0x8da7('0x45'))['field'](_0x8da7('0x46'))[_0x8da7('0x40')](_0x8da7('0x47'),'ui')[_0x8da7('0x48')](_0x8da7('0x49'),'u',_0x8da7('0x4a'));var _0x5d91ba=squel[_0x8da7('0x42')]()['from'](_0x8da7('0x4b'),'i')[_0x8da7('0x48')](_0x8da7('0x4c'),'c',_0x8da7('0x4d'))[_0x8da7('0x48')](_0x8da7('0x49'),'o','o.id\x20=\x20i.UserId')[_0x8da7('0x48')](_0x8da7('0x4e'),'a','a.id\x20=\x20i.SmsAccountId')['left_join'](_0x8da7('0x4f'),'me','me.SmsInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false');var _0x5f0342=squel[_0x8da7('0x50')]();if(_0x374c4e[_0x8da7('0x32')][_0x8da7('0x51')]){var _0x1d45f5=JSON[_0x8da7('0x52')](_0x374c4e[_0x8da7('0x32')][_0x8da7('0x51')]);_[_0x8da7('0x31')](_0x1d45f5)[_0x8da7('0x53')](function(_0xa396bd){var _0x49f9b8=_0x1d45f5[_0xa396bd];if(_0xa396bd===_0x8da7('0x54')){var _0x51c1b6=moment(_0x49f9b8[_0x8da7('0x55')][_0x8da7('0x56')])['startOf'](_0x8da7('0x57'))[_0x8da7('0x58')]()[_0x8da7('0x59')]();var _0x4fc70b=moment(_0x4fc70b)[_0x8da7('0x58')]()[_0x8da7('0x5a')]('day')[_0x8da7('0x59')]();_0x5f0342[_0x8da7('0x5b')](_0x8da7('0x5c'),_0x51c1b6,_0x4fc70b);}else{if(_[_0x8da7('0x5d')](_0x49f9b8[_0x8da7('0x5e')])){_0x49f9b8[_0x8da7('0x5e')][_0x8da7('0x53')](function(_0x20d6c8){switch(_0x49f9b8[_0x8da7('0x5e')]['value']){case'IS':if(_0xa396bd!==_0x8da7('0x5f')&&_0xa396bd!=='unreadMessages'){if(_[_0x8da7('0x5d')](_0x49f9b8[_0x8da7('0x55')])&&_0x49f9b8[_0x8da7('0x55')][_0x8da7('0x36')]>0x1){_0x5f0342[_0x8da7('0x5b')](_0x49f9b8['tableAlias']+'.'+_0xa396bd+_0x8da7('0x60'),_0x49f9b8[_0x8da7('0x55')]);}else{_0x5f0342['and'](_0x49f9b8[_0x8da7('0x61')]+'.'+_0xa396bd+_0x8da7('0x62'),_0x49f9b8[_0x8da7('0x55')][0x0]);}}break;case'=':_0x5f0342['and'](_0x49f9b8[_0x8da7('0x61')]+'.'+_0xa396bd+'\x20=\x20?',_0x49f9b8[_0x8da7('0x55')]);break;case _0x8da7('0x63'):if(_0xa396bd===_0x8da7('0x64')){_0x5f0342[_0x8da7('0x5b')](_0x8da7('0x65')+'\x20LIKE\x20?','%'+_0x49f9b8[_0x8da7('0x55')]+'%');_0x5f0342['or']('c.lastName'+'\x20LIKE\x20?','%'+_0x49f9b8['value']+'%');_0x5f0342['or'](_0x8da7('0x66')+'\x20LIKE\x20?','%'+_0x49f9b8[_0x8da7('0x55')]+'%');}else{_0x5f0342[_0x8da7('0x5b')](_0x49f9b8['tableAlias']+'.'+_0xa396bd+_0x8da7('0x67'),'%'+_0x49f9b8[_0x8da7('0x55')]+'%');}break;case'>':_0x5f0342['and'](_0x49f9b8[_0x8da7('0x61')]+'.'+_0xa396bd+_0x8da7('0x68'),_0x49f9b8['value']);break;case'<':_0x5f0342['and'](_0x49f9b8[_0x8da7('0x61')]+'.'+_0xa396bd+_0x8da7('0x69'),_0x49f9b8[_0x8da7('0x55')]);break;}});}else{switch(_0x49f9b8['condition'][_0x8da7('0x55')]){case'IS':if(_0xa396bd!==_0x8da7('0x5f')&&_0xa396bd!=='unreadMessages'){if(_['isArray'](_0x49f9b8[_0x8da7('0x55')])&&_0x49f9b8['value']['length']>0x1){_0x5f0342['and'](_0x49f9b8['tableAlias']+'.'+_0xa396bd+'\x20IN\x20?',_0x49f9b8[_0x8da7('0x55')]);}else{_0x5f0342[_0x8da7('0x5b')](_0x49f9b8[_0x8da7('0x61')]+'.'+_0xa396bd+_0x8da7('0x62'),_0x49f9b8[_0x8da7('0x55')][0x0]);}}break;case'=':_0x5f0342['and'](_0x49f9b8['tableAlias']+'.'+_0xa396bd+_0x8da7('0x62'),_0x49f9b8[_0x8da7('0x55')]);break;case _0x8da7('0x63'):if(_0xa396bd===_0x8da7('0x64')){_0x5f0342[_0x8da7('0x5b')](_0x8da7('0x65')+_0x8da7('0x67'),'%'+_0x49f9b8[_0x8da7('0x55')]+'%');_0x5f0342['or']('c.lastName'+_0x8da7('0x67'),'%'+_0x49f9b8['value']+'%');_0x5f0342['or'](_0x8da7('0x66')+_0x8da7('0x67'),'%'+_0x49f9b8[_0x8da7('0x55')]+'%');}else{_0x5f0342[_0x8da7('0x5b')](_0x49f9b8['tableAlias']+'.'+_0xa396bd+_0x8da7('0x67'),'%'+_0x49f9b8[_0x8da7('0x55')]+'%');}break;case'>':_0x5f0342[_0x8da7('0x5b')](_0x49f9b8[_0x8da7('0x61')]+'.'+_0xa396bd+'\x20>\x20?',_0x49f9b8[_0x8da7('0x55')]);break;case'<':_0x5f0342[_0x8da7('0x5b')](_0x49f9b8[_0x8da7('0x61')]+'.'+_0xa396bd+'\x20<\x20?',_0x49f9b8['value']);break;}}}});}else{var _0x2131fb=_(Object[_0x8da7('0x31')](_0x374c4e['query']))[_0x8da7('0x6a')](function(_0x5be40c){return _0x2cdb45['hasOwnProperty'](_0x5be40c)?_0x5be40c:undefined;})['filter'](function(_0x5aa3c1){return!_[_0x8da7('0x6b')](_0x5aa3c1);})['value']();if(!_[_0x8da7('0x6c')](_0x2131fb)){_0x2131fb['forEach'](function(_0x561362){if(_0x561362===_0x8da7('0x6d')){_0x5d91ba['where'](_0x8da7('0x6e'),[][_0x8da7('0x6f')](_0x374c4e[_0x8da7('0x32')][_0x561362]));}else if(_0x561362==='createdAt'){var _0x16aca9=JSON[_0x8da7('0x52')](_0x374c4e[_0x8da7('0x32')][_0x561362])[_0x8da7('0x70')];var _0x2f0019=JSON[_0x8da7('0x52')](_0x374c4e[_0x8da7('0x32')][_0x561362])[_0x8da7('0x71')];_0x5d91ba[_0x8da7('0x3b')](_0x8da7('0x5c'),_0x16aca9,_0x2f0019);}else{if(_0x374c4e['query'][_0x561362]===_0x8da7('0x72')){_0x5d91ba['where']('i.'+_0x561362+_0x8da7('0x73'));}else{_0x5d91ba[_0x8da7('0x3b')]('i.'+_0x561362+_0x8da7('0x62'),_0x374c4e[_0x8da7('0x32')][_0x561362]);}}});}if(_0x374c4e[_0x8da7('0x32')][_0x8da7('0x74')]){var _0x2ab148=_0x374c4e[_0x8da7('0x32')][_0x8da7('0x74')][_0x8da7('0x75')]('\x5c','\x5c\x5c')[_0x8da7('0x75')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x2ab148)){_0x5f0342['or'](_0x8da7('0x76'),_0x2ab148+'%')['or']('i.phone\x20LIKE\x20?',_0x2ab148+'%');}else{var _0x42cedc=[];_0x2ab148[_0x8da7('0x77')]('\x20')[_0x8da7('0x53')](function(_0x5789e2){_0x42cedc['push']('+'+_0x5789e2[_0x8da7('0x78')]());});var _0x396af5=_0x42cedc[_0x8da7('0x79')]('\x20');_0x5f0342['or'](_0x8da7('0x7a'),_0x396af5)['or'](_0x8da7('0x7b'),_0x2ab148+'%');}}}_0x5d91ba[_0x8da7('0x3b')](_0x5f0342);if(_0x14e615[_0x8da7('0x39')]){_0x14e615[_0x8da7('0x39')][_0x8da7('0x53')](function(_0x24e595){_0x5d91ba[_0x8da7('0x39')]('i.'+_0x24e595[0x0],_0x24e595[0x1]==='DESC'?![]:!![]);});}_0x5d91ba['group'](_0x8da7('0x7c'));var _0x47dd4a={'type':db[_0x8da7('0x7d')][_0x8da7('0x7e')][_0x8da7('0x7f')],'raw':!![]};var _0x3e177f=_0x5d91ba[_0x8da7('0x80')]()[_0x8da7('0x3e')](_0x8da7('0x43'))[_0x8da7('0x3e')](_0x8da7('0x81'),'unreadMessages');if(!_0x374c4e['query']['advancedFilter']){if(_0x374c4e[_0x8da7('0x32')][_0x8da7('0x82')]){if(_0x374c4e[_0x8da7('0x32')]['read']==0x1){_0x3e177f['having'](_0x8da7('0x83'));_0x5d91ba['having']('`unreadMessages`\x20=\x200');}else{_0x3e177f['having']('`unreadMessages`\x20>\x200');_0x5d91ba[_0x8da7('0x84')](_0x8da7('0x85'));}}if(_0x374c4e[_0x8da7('0x32')][_0x8da7('0x86')]){var _0x397f19=_['isArray'](_0x374c4e[_0x8da7('0x32')]['tag'])?_0x374c4e[_0x8da7('0x32')][_0x8da7('0x86')]:new Array(_0x374c4e[_0x8da7('0x32')]['tag']);var _0x562290=squel[_0x8da7('0x50')]();_0x397f19['forEach'](function(_0x2962f4){_0x562290['or'](_0x8da7('0x87'),'%,'+_0x2962f4+',%');});_0x5d91ba[_0x8da7('0x84')](_0x562290);_0x3e177f[_0x8da7('0x48')]('sms_interaction_has_tags','it',_0x8da7('0x88'));_0x3e177f[_0x8da7('0x48')](_0x8da7('0x41'),'t',_0x8da7('0x89'));_0x3e177f['where']('t.id\x20IN\x20?',_0x397f19);}}else{var _0x1d45f5=JSON[_0x8da7('0x52')](_0x374c4e[_0x8da7('0x32')][_0x8da7('0x51')]);_[_0x8da7('0x31')](_0x1d45f5)[_0x8da7('0x53')](function(_0x3b0366){var _0x223fcf=_0x1d45f5[_0x3b0366];if(_0x3b0366==='TagId'){var _0x6c21a6=_0x223fcf['value'];var _0x156bc3=squel[_0x8da7('0x50')]();_0x6c21a6['forEach'](function(_0x44d643){_0x156bc3['or'](_0x8da7('0x87'),'%,'+_0x44d643+',%');});_0x5d91ba[_0x8da7('0x84')](_0x156bc3);_0x3e177f['left_join'](_0x8da7('0x8a'),'it',_0x8da7('0x8b'));_0x3e177f[_0x8da7('0x48')]('tools_tags','t',_0x8da7('0x89'));_0x3e177f[_0x8da7('0x3b')](_0x8da7('0x8c'),_0x6c21a6);}else if(_0x3b0366===_0x8da7('0x8d')){if(_0x223fcf[_0x8da7('0x55')][_0x8da7('0x36')]===0x1){if(_0x223fcf[_0x8da7('0x55')][0x0]===0x1){_0x3e177f['having']('`unreadMessages`\x20=\x200');_0x5d91ba['having']('`unreadMessages`\x20=\x200');}else{_0x3e177f[_0x8da7('0x84')]('`unreadMessages`\x20>\x200');_0x5d91ba[_0x8da7('0x84')](_0x8da7('0x85'));}}}});}db[_0x8da7('0x8e')][_0x8da7('0x32')](_0x3e177f[_0x8da7('0x78')](),_0x47dd4a)[_0x8da7('0x26')](function(_0x29f189){_0x1e9278[_0x8da7('0x1f')]=_0x29f189['length'];if(_0x1e9278['count']===0x0)return[];return db[_0x8da7('0x8e')]['query'](_0x53e7dd[_0x8da7('0x78')](),_0x47dd4a)[_0x8da7('0x26')](function(_0x53b988){_0x39e71b=_[_0x8da7('0x8f')](_0x53b988,'id');_0x47dd4a=_[_0x8da7('0x90')](_0x47dd4a,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5d91ba[_0x8da7('0x3e')](_0x8da7('0x81'),_0x8da7('0x8d'));_0x5d91ba[_0x8da7('0x3e')](_0x8da7('0x91'),'Account.key');_0x5d91ba[_0x8da7('0x3e')](_0x8da7('0x92'),_0x8da7('0x93'));_0x5d91ba[_0x8da7('0x3e')](_0x8da7('0x94'));_0x5d91ba['field'](_0x8da7('0x65'),_0x8da7('0x95'));_0x5d91ba[_0x8da7('0x3e')](_0x8da7('0x96'),_0x8da7('0x97'));_0x5d91ba[_0x8da7('0x3e')](_0x8da7('0x66'),_0x8da7('0x98'));_0x5d91ba[_0x8da7('0x3e')](_0x8da7('0x99'),_0x8da7('0x9a'));_0x5d91ba[_0x8da7('0x3e')](_0x8da7('0x9b'),'Contact.mobile');_0x5d91ba[_0x8da7('0x3e')](_0x8da7('0x9c'),_0x8da7('0x9d'));_0x5d91ba[_0x8da7('0x3e')](_0x8da7('0x9e'),_0x8da7('0x2b'));_0x5d91ba[_0x8da7('0x48')](_0x8da7('0x9f'),'it',_0x8da7('0x88'));_0x5d91ba[_0x8da7('0x48')]('tools_tags','t',_0x8da7('0x89'));_0x5d91ba[_0x8da7('0x21')](_0x14e615[_0x8da7('0x21')]);_0x5d91ba['offset'](_0x14e615['offset']);return db['sequelize'][_0x8da7('0x32')](_0x5d91ba[_0x8da7('0x78')](),_0x47dd4a);})['then'](function(_0x361b2c){_0x416287['where'](_0x8da7('0xa0'),_[_0x8da7('0x6a')](_0x361b2c,'id'));return db['sequelize'][_0x8da7('0x32')](_0x416287['toString'](),_0x47dd4a)[_0x8da7('0x26')](function(_0x5a8c54){var _0x40cf69=_[_0x8da7('0xa1')](_0x5a8c54,_0x8da7('0xa2'));var _0x13f4e8=[];_0x361b2c[_0x8da7('0x53')](function(_0x57b9ef){_0x13f4e8[_0x8da7('0x2c')](updateSmsInteraction(_0x57b9ef,_0x39e71b,_0x40cf69));});return BPromise[_0x8da7('0xa3')](_0x13f4e8);});});})[_0x8da7('0x26')](function(_0x4a7620){_0x1e9278[_0x8da7('0xa4')]=_0x4a7620;return _0x1e9278;})[_0x8da7('0x26')](respondWithFilteredResult(_0x5520a7,_0x14e615))[_0x8da7('0xa5')](handleError(_0x5520a7,null));};exports[_0x8da7('0xa6')]=function(_0x292b80,_0x473892){var _0x1771c5={'raw':![],'where':{'id':_0x292b80[_0x8da7('0xa7')]['id']}},_0x373c9b={};_0x373c9b[_0x8da7('0x30')]=_[_0x8da7('0x31')](db[_0x8da7('0x2e')][_0x8da7('0x2f')]);_0x373c9b[_0x8da7('0x32')]=_[_0x8da7('0x31')](_0x292b80[_0x8da7('0x32')]);_0x373c9b[_0x8da7('0x3c')]=_['intersection'](_0x373c9b[_0x8da7('0x30')],_0x373c9b[_0x8da7('0x32')]);_0x1771c5[_0x8da7('0x34')]=_['intersection'](_0x373c9b['model'],qs[_0x8da7('0x35')](_0x292b80['query']['fields']));_0x1771c5[_0x8da7('0x34')]=_0x1771c5[_0x8da7('0x34')][_0x8da7('0x36')]?_0x1771c5[_0x8da7('0x34')]:_0x373c9b[_0x8da7('0x30')];if(_0x292b80[_0x8da7('0x32')]['includeAll']){_0x1771c5[_0x8da7('0xa8')]=[{'all':!![]}];}_0x1771c5=_[_0x8da7('0x90')]({},_0x1771c5,_0x292b80[_0x8da7('0xa9')]);return db['SmsInteraction'][_0x8da7('0xaa')](_0x1771c5)['then'](handleEntityNotFound(_0x473892,null))[_0x8da7('0x26')](respondWithResult(_0x473892,null))[_0x8da7('0xa5')](handleError(_0x473892,null));};exports[_0x8da7('0xab')]=function(_0x9ea759,_0xe24060){return db[_0x8da7('0x2e')]['create'](_0x9ea759[_0x8da7('0xac')],{})['then'](respondWithResult(_0xe24060,0xc9))[_0x8da7('0xa5')](handleError(_0xe24060,null));};exports[_0x8da7('0x25')]=function(_0x1814d7,_0x3c543d){if(_0x1814d7[_0x8da7('0xac')]['id']){delete _0x1814d7[_0x8da7('0xac')]['id'];}return db[_0x8da7('0x2e')][_0x8da7('0xaa')]({'where':{'id':_0x1814d7[_0x8da7('0xa7')]['id']}})[_0x8da7('0x26')](handleEntityNotFound(_0x3c543d,null))[_0x8da7('0x26')](saveUpdates(_0x1814d7['body'],null))[_0x8da7('0x26')](respondWithResult(_0x3c543d,null))[_0x8da7('0xa5')](handleError(_0x3c543d,null));};exports[_0x8da7('0xad')]=function(_0x46a0d5,_0x56dcc1){return db[_0x8da7('0x2e')][_0x8da7('0xaa')]({'where':{'id':_0x46a0d5[_0x8da7('0xa7')]['id']}})[_0x8da7('0x26')](handleEntityNotFound(_0x56dcc1,null))[_0x8da7('0x26')](removeEntity(_0x56dcc1,null))[_0x8da7('0xa5')](handleError(_0x56dcc1,null));};exports['describe']=function(_0x324ba7,_0x2ff1b0){return db['SmsInteraction'][_0x8da7('0xae')]()[_0x8da7('0x26')](respondWithResult(_0x2ff1b0,null))[_0x8da7('0xa5')](handleError(_0x2ff1b0,null));};exports['addMessage']=function(_0x9d82b,_0x4b942a,_0x549e17){return db[_0x8da7('0xaf')][_0x8da7('0xaa')]({'where':{'id':_0x9d82b['params']['id']}})[_0x8da7('0x26')](handleEntityNotFound(_0x4b942a,null))[_0x8da7('0x26')](function(_0x2f9c8d){if(_0x2f9c8d){return _0x2f9c8d['addMessage'](_0x9d82b[_0x8da7('0xac')][_0x8da7('0xb0')],_[_0x8da7('0xb1')](_0x9d82b[_0x8da7('0xac')],[_0x8da7('0xb0'),'id'])||{});}})[_0x8da7('0x26')](respondWithResult(_0x4b942a,null))[_0x8da7('0xa5')](handleError(_0x4b942a,null));};exports['getMessages']=function(_0x363dbb,_0x58cb1a,_0x26c3b7){var _0x28d3d3={'raw':![],'where':{}};var _0x4690de={};var _0x1d8e90={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x363dbb[_0x8da7('0xa7')]['id']}})['then'](handleEntityNotFound(_0x58cb1a,null))['then'](function(_0x2f02a3){if(_0x2f02a3){_0x4690de['model']=_[_0x8da7('0x31')](db[_0x8da7('0xaf')]['rawAttributes']);_0x4690de[_0x8da7('0x32')]=_['keys'](_0x363dbb[_0x8da7('0x32')]);_0x4690de['filters']=_['intersection'](_0x4690de['model'],_0x4690de[_0x8da7('0x32')]);_0x28d3d3[_0x8da7('0x34')]=_['intersection'](_0x4690de[_0x8da7('0x30')],qs[_0x8da7('0x35')](_0x363dbb[_0x8da7('0x32')]['fields']));_0x28d3d3[_0x8da7('0x34')]=_0x28d3d3[_0x8da7('0x34')][_0x8da7('0x36')]?_0x28d3d3[_0x8da7('0x34')]:_0x4690de[_0x8da7('0x30')];if(!_0x363dbb[_0x8da7('0x32')][_0x8da7('0x37')](_0x8da7('0x38'))){_0x28d3d3[_0x8da7('0x21')]=qs[_0x8da7('0x21')](_0x363dbb[_0x8da7('0x32')][_0x8da7('0x21')]);_0x28d3d3['offset']=qs[_0x8da7('0x20')](_0x363dbb[_0x8da7('0x32')][_0x8da7('0x20')]);}_0x28d3d3[_0x8da7('0x39')]=qs[_0x8da7('0x3a')](_0x363dbb[_0x8da7('0x32')][_0x8da7('0x3a')]);_0x28d3d3[_0x8da7('0x3b')]=qs['filters'](_[_0x8da7('0x3d')](_0x363dbb['query'],_0x4690de[_0x8da7('0x3c')]));_0x28d3d3[_0x8da7('0x3b')][_0x8da7('0xa2')]=_0x2f02a3['id'];if(_0x363dbb[_0x8da7('0x32')][_0x8da7('0x74')]){_0x28d3d3[_0x8da7('0x3b')]=_[_0x8da7('0x90')](_0x28d3d3['where'],{'$or':_[_0x8da7('0x6a')](_0x28d3d3[_0x8da7('0x34')],function(_0x1b144b){var _0x1b06ad={};_0x1b06ad[_0x1b144b]={'$like':'%'+_0x363dbb['query']['filter']+'%'};return _0x1b06ad;})});}if(_0x363dbb['query'][_0x8da7('0x70')]){var _0xbf1f66=_0x363dbb['query']['$gte'][_0x8da7('0x77')](',');var _0x15b2df={};_0x15b2df[_0xbf1f66[0x0]]={'$gte':moment(_0xbf1f66[0x1])[_0x8da7('0x59')](_0x8da7('0xb2'))};_0x28d3d3['where']=_[_0x8da7('0x90')](_0x28d3d3[_0x8da7('0x3b')],_0x15b2df);}_0x28d3d3=_[_0x8da7('0x90')]({},_0x28d3d3,_0x363dbb[_0x8da7('0xa9')]);return db[_0x8da7('0xaf')][_0x8da7('0x1f')]({'where':_0x28d3d3['where']})[_0x8da7('0x26')](function(_0x5b1c53){_0x1d8e90['count']=_0x5b1c53;if(_0x363dbb['query'][_0x8da7('0xb3')]){_0x28d3d3[_0x8da7('0xa8')]=[{'all':!![]}];}return db['SmsMessage'][_0x8da7('0xb4')](_0x28d3d3);})[_0x8da7('0x26')](function(_0x370601){_0x1d8e90['rows']=_0x370601;return _0x1d8e90;});}})[_0x8da7('0x26')](respondWithFilteredResult(_0x58cb1a,_0x28d3d3))[_0x8da7('0xa5')](handleError(_0x58cb1a,null));};exports[_0x8da7('0xb5')]=function(_0x1c7a3e,_0x26b220,_0x3e3878){return db[_0x8da7('0x2e')][_0x8da7('0xaa')]({'where':{'id':_0x1c7a3e[_0x8da7('0xa7')]['id']}})[_0x8da7('0x26')](handleEntityNotFound(_0x26b220,null))[_0x8da7('0x26')](function(_0x1f5969){if(_0x1f5969){return _0x1f5969[_0x8da7('0xb6')](_0x1c7a3e[_0x8da7('0xac')][_0x8da7('0xb0')],_['omit'](_0x1c7a3e[_0x8da7('0xac')],[_0x8da7('0xb0'),'id'])||{})[_0x8da7('0xb7')](function(){return db['Tag']['findAll']({'attributes':['id',_0x8da7('0x29'),_0x8da7('0x3f')],'where':{'id':_0x1c7a3e[_0x8da7('0xac')][_0x8da7('0xb0')]}});})['then'](function(_0x4beaee){socket[_0x8da7('0xb8')](_0x8da7('0xb9'),{'id':Number(_0x1c7a3e[_0x8da7('0xa7')]['id']),'tags':_0x4beaee||[]});return{'id':Number(_0x1c7a3e[_0x8da7('0xa7')]['id']),'tags':_0x4beaee||[]};});}})[_0x8da7('0x26')](respondWithResult(_0x26b220,null))[_0x8da7('0xa5')](handleError(_0x26b220,null));};exports[_0x8da7('0xba')]=function(_0x3d6a40,_0x247a0e,_0x5a8dda){return db['SmsInteraction'][_0x8da7('0xaa')]({'where':{'id':_0x3d6a40['params']['id']}})[_0x8da7('0x26')](handleEntityNotFound(_0x247a0e,null))[_0x8da7('0x26')](function(_0x2f5d6e){if(_0x2f5d6e){return _0x2f5d6e[_0x8da7('0xba')](_0x3d6a40[_0x8da7('0x32')][_0x8da7('0xb0')]);}})[_0x8da7('0x26')](respondWithStatusCode(_0x247a0e,null))['catch'](handleError(_0x247a0e,null));};exports[_0x8da7('0xbb')]=function(_0x56142b,_0x71f04b){var _0x159997=moment()['unix']()[_0x8da7('0x78')]();var _0x19541f=path[_0x8da7('0x79')](config[_0x8da7('0xbc')],_0x8da7('0xbd'),_0x8da7('0xbe'),'tmp');var _0xfef173=path[_0x8da7('0x79')](config[_0x8da7('0xbc')],'server',_0x8da7('0xbe'),'attachments');var _0xb0b7c5=path['join'](_0x19541f,_0x159997);var _0x320e87=util[_0x8da7('0x59')](_0x8da7('0xbf'),_0x56142b[_0x8da7('0xa7')]['id'],_0x159997);var _0x2aa3d7=path['join'](_0x19541f,_0x320e87);var _0x10e16e=![];return db[_0x8da7('0x2e')][_0x8da7('0xaa')]({'where':{'id':_0x56142b[_0x8da7('0xa7')]['id']},'include':[{'model':db[_0x8da7('0xaf')],'as':_0x8da7('0xc0'),'attributes':['id','body','createdAt',_0x8da7('0xc1'),_0x8da7('0xc2')],'include':[{'model':db['User'],'as':_0x8da7('0xc3'),'attributes':['id',_0x8da7('0xc4')],'raw':!![]},{'model':db['CmContact'],'as':_0x8da7('0xc5'),'attributes':['id','firstName',_0x8da7('0xc6')],'raw':!![]}]},{'model':db[_0x8da7('0xc7')],'as':'Account','attributes':['id',_0x8da7('0x29')]},{'model':db[_0x8da7('0xc3')],'as':'Owner','attributes':['id',_0x8da7('0xc4')]}]})[_0x8da7('0x26')](handleEntityNotFound(_0x71f04b,null))['then'](function(_0x5ac8cc){if(_0x5ac8cc){var _0x2b8d02=_0x5ac8cc[_0x8da7('0xc8')]({'plain':!![]});_0x10e16e=!![];var _0x33042c={'format':'A4','border':_0x8da7('0xc9'),'header':{'height':_0x8da7('0xca'),'contents':{'first':_0x8da7('0xcb')}},'footer':{'height':_0x8da7('0xcc'),'contents':{'default':util[_0x8da7('0x59')](_0x8da7('0xcd'),util[_0x8da7('0x59')](_0x8da7('0xce'),_0x8da7('0xcf'),_0x2b8d02['id']),moment()[_0x8da7('0x59')]('YYYY-MM-DD')[_0x8da7('0x78')]())}}};fs[_0x8da7('0xd0')](_0xb0b7c5);var _0x431b65={'channel':_0x8da7('0xcf'),'account':_0x2b8d02['Account']['name'],'agent':_0x2b8d02[_0x8da7('0xd1')]?_0x2b8d02['Owner']['fullname']:_0x8da7('0xd2'),'createdAt':moment(_0x2b8d02[_0x8da7('0x54')])[_0x8da7('0x59')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x2b8d02[_0x8da7('0xd3')]?moment(_0x2b8d02['closedAt'])['format'](_0x8da7('0xb2'))[_0x8da7('0x78')]():'','disposition':_0x2b8d02['disposition'],'messages':_(_0x2b8d02[_0x8da7('0xc0')])[_0x8da7('0x74')]({'secret':![]})[_0x8da7('0x6a')](function(_0x3f7806){return{'date':moment(_0x3f7806[_0x8da7('0x54')])['format'](_0x8da7('0xb2'))['toString'](),'sender':_0x3f7806[_0x8da7('0xc1')]===_0x8da7('0xd4')?_0x3f7806[_0x8da7('0xc3')]?_0x3f7806[_0x8da7('0xc3')]['fullname']:_0x8da7('0xd5'):_0x3f7806[_0x8da7('0xc5')][_0x8da7('0xd6')]+(_0x3f7806[_0x8da7('0xc5')][_0x8da7('0xc6')]?'\x20'+_0x3f7806[_0x8da7('0xc5')][_0x8da7('0xc6')]:''),'body':_0x3f7806[_0x8da7('0xac')],'direction':_0x3f7806[_0x8da7('0xc1')]===_0x8da7('0xd4')?'A':'C','secret':_0x3f7806['secret']};})['value']()};return ejs[_0x8da7('0xd7')](path[_0x8da7('0x79')](config['root'],_0x8da7('0xbd'),_0x8da7('0xd8'),'downloadInteraction.html'),{'interaction':_0x431b65})[_0x8da7('0x26')](function(_0x25be97){return new BPromise(function(_0xe54db8,_0x3d5115){pdf[_0x8da7('0xab')](_0x25be97,_0x33042c)['toFile'](path[_0x8da7('0x79')](_0xb0b7c5,_0x8da7('0xd9')+_0x2b8d02['id']+'-'+_0x159997+_0x8da7('0xda')),function(_0x177715,_0x3900b1){if(_0x177715)return _0x3d5115(_0x177715);_0xe54db8(_0x3900b1);});});});}})[_0x8da7('0x26')](function(){if(_0x10e16e){return new BPromise(function(_0x4eac28,_0x4431cb){zipdir(_0xb0b7c5,{'saveTo':_0x2aa3d7},function(_0x3cbacb,_0x5139cc){if(_0x3cbacb)return _0x4431cb(_0x3cbacb);return _0x4eac28(_0x5139cc);});})[_0x8da7('0x26')](function(){return new BPromise(function(_0x4dd9bc,_0x4d273e){rimraf(_0xb0b7c5,function(_0x4a9cc8){if(_0x4a9cc8)_0x4d273e(_0x4a9cc8);return _0x4dd9bc();});});})[_0x8da7('0x26')](function(){return _0x71f04b[_0x8da7('0xbb')](_0x2aa3d7,_0x320e87,function(_0x5d6fd7){if(_0x5d6fd7){console[_0x8da7('0xdb')](_0x8da7('0xdc'),_0x5d6fd7);}else{fs['unlinkSync'](_0x2aa3d7);}});});}else{return _0x71f04b[_0x8da7('0x28')](0xc8);}})[_0x8da7('0xa5')](handleError(_0x71f04b,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 0ff0512..2ea57b3 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 _0xac95=['emit','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','save','update','getUsers','then','Users','map','findAll','unreadMessages','length'];(function(_0x479fca,_0x5466c5){var _0x5f0526=function(_0x295081){while(--_0x295081){_0x479fca['push'](_0x479fca['shift']());}};_0x5f0526(++_0x5466c5);}(_0xac95,0xa8));var _0x5ac9=function(_0x3d2e9d,_0x4c8759){_0x3d2e9d=_0x3d2e9d-0x0;var _0x154f7d=_0xac95[_0x3d2e9d];return _0x154f7d;};'use strict';var EventEmitter=require(_0x5ac9('0x0'));var SmsInteraction=require(_0x5ac9('0x1'))['db'][_0x5ac9('0x2')];var SmsMessage=require(_0x5ac9('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5ac9('0x3'),'afterUpdate':_0x5ac9('0x4'),'afterDestroy':'remove'};function emitEvent(_0xafa08d){return function(_0x3790d1,_0x5b445a,_0x1dc09a){_0x3790d1[_0x5ac9('0x5')]({'attributes':['id'],'raw':!![]})[_0x5ac9('0x6')](function(_0x4bddcf){_0x3790d1['setDataValue'](_0x5ac9('0x7'),_0x4bddcf[_0x5ac9('0x8')](function(_0x28bc1f){return{'id':_0x28bc1f['id']};}));return SmsMessage[_0x5ac9('0x9')]({'where':{'SmsInteractionId':_0x3790d1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5ac9('0x6')](function(_0x5da6fb){_0x3790d1['setDataValue'](_0x5ac9('0xa'),_0x5da6fb[_0x5ac9('0xb')]);SmsInteractionEvents['emit'](_0xafa08d+':'+_0x3790d1['id'],_0x3790d1);SmsInteractionEvents[_0x5ac9('0xc')](_0xafa08d,_0x3790d1);_0x1dc09a(null);})['catch'](_0x1dc09a(null));};}for(var e in events){if(events[_0x5ac9('0xd')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x5ac9('0xe')]=SmsInteractionEvents; \ No newline at end of file +var _0x7fbe=['then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x2d6e94,_0x5519c0){var _0x4df9ea=function(_0x441bde){while(--_0x441bde){_0x2d6e94['push'](_0x2d6e94['shift']());}};_0x4df9ea(++_0x5519c0);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x35731c,_0x5ab1d1){_0x35731c=_0x35731c-0x0;var _0x2f2957=_0x7fbe[_0x35731c];return _0x2f2957;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0xe7fb('0x0')];var SmsMessage=require(_0xe7fb('0x1'))['db'][_0xe7fb('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xe7fb('0x3')](0x0);var events={'afterCreate':_0xe7fb('0x4'),'afterUpdate':_0xe7fb('0x5'),'afterDestroy':_0xe7fb('0x6')};function emitEvent(_0x4524ff){return function(_0x36ab90,_0x5dbf04,_0x290172){_0x36ab90[_0xe7fb('0x7')]({'attributes':['id'],'raw':!![]})[_0xe7fb('0x8')](function(_0x1f943f){_0x36ab90['setDataValue'](_0xe7fb('0x9'),_0x1f943f[_0xe7fb('0xa')](function(_0x1d0741){return{'id':_0x1d0741['id']};}));return SmsMessage[_0xe7fb('0xb')]({'where':{'SmsInteractionId':_0x36ab90['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x558857){_0x36ab90[_0xe7fb('0xc')](_0xe7fb('0xd'),_0x558857[_0xe7fb('0xe')]);SmsInteractionEvents[_0xe7fb('0xf')](_0x4524ff+':'+_0x36ab90['id'],_0x36ab90);SmsInteractionEvents[_0xe7fb('0xf')](_0x4524ff,_0x36ab90);_0x290172(null);})[_0xe7fb('0x10')](_0x290172(null));};}for(var e in events){if(events[_0xe7fb('0x11')](e)){var event=events[e];SmsInteraction[_0xe7fb('0x12')](e,emitEvent(event));}}module[_0xe7fb('0x13')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 4803a54..47a6902 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 _0x6dff=['api','moment','request-promise','path','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','closed','closedAt','format','lodash','util','../../config/logger'];(function(_0x398379,_0x33acd6){var _0x132ee6=function(_0x2e5b8b){while(--_0x2e5b8b){_0x398379['push'](_0x398379['shift']());}};_0x132ee6(++_0x33acd6);}(_0x6dff,0x75));var _0xf6df=function(_0x370c53,_0xf433d3){_0x370c53=_0x370c53-0x0;var _0x39f704=_0x6dff[_0x370c53];return _0x39f704;};'use strict';var _=require(_0xf6df('0x0'));var util=require(_0xf6df('0x1'));var logger=require(_0xf6df('0x2'))(_0xf6df('0x3'));var moment=require(_0xf6df('0x4'));var BPromise=require('bluebird');var rp=require(_0xf6df('0x5'));var fs=require('fs');var path=require(_0xf6df('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf6df('0x7'));module[_0xf6df('0x8')]=function(_0x2ed95f,_0x2294e5){return _0x2ed95f[_0xf6df('0x9')](_0xf6df('0xa'),attributes,{'tableName':_0xf6df('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc73dfc,_0x2e8b97,_0x5ab670){if(_0xc73dfc['changed'](_0xf6df('0xc'))){_0xc73dfc[_0xf6df('0xd')]=moment()[_0xf6df('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5ab670(null,_0xc73dfc);}}});}; \ No newline at end of file +var _0x9b15=['path','rimraf','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x463dfc,_0x1b72bc){var _0x145d20=function(_0x4bb822){while(--_0x4bb822){_0x463dfc['push'](_0x463dfc['shift']());}};_0x145d20(++_0x1b72bc);}(_0x9b15,0x191));var _0x59b1=function(_0x16a183,_0x32ecf5){_0x16a183=_0x16a183-0x0;var _0x1d4c69=_0x9b15[_0x16a183];return _0x1d4c69;};'use strict';var _=require(_0x59b1('0x0'));var util=require(_0x59b1('0x1'));var logger=require(_0x59b1('0x2'))(_0x59b1('0x3'));var moment=require(_0x59b1('0x4'));var BPromise=require(_0x59b1('0x5'));var rp=require(_0x59b1('0x6'));var fs=require('fs');var path=require(_0x59b1('0x7'));var rimraf=require(_0x59b1('0x8'));var config=require(_0x59b1('0x9'));var attributes=require(_0x59b1('0xa'));module[_0x59b1('0xb')]=function(_0x3cea52,_0x354946){return _0x3cea52['define'](_0x59b1('0xc'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1e0f84,_0x2c43eb,_0x42b58f){if(_0x1e0f84['changed'](_0x59b1('0xd'))){_0x1e0f84[_0x59b1('0xe')]=moment()[_0x59b1('0xf')](_0x59b1('0x10'));}_0x42b58f(null,_0x1e0f84);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 0336da6..39012b3 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 _0xf675=['where','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','addTags','ids','spread','AddTags','debug','lodash','util','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsInteraction','update','body','options','raw'];(function(_0x1d039d,_0x3720e7){var _0xa25033=function(_0x2500a1){while(--_0x2500a1){_0x1d039d['push'](_0x1d039d['shift']());}};_0xa25033(++_0x3720e7);}(_0xf675,0x131));var _0x5f67=function(_0x7d4dc8,_0x14d70e){_0x7d4dc8=_0x7d4dc8-0x0;var _0x20b216=_0xf675[_0x7d4dc8];return _0x20b216;};'use strict';var _=require(_0x5f67('0x0'));var util=require(_0x5f67('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5f67('0x2'));var fs=require('fs');var Redis=require(_0x5f67('0x3'));var db=require(_0x5f67('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5f67('0x5'));var config=require('../../config/environment');var jayson=require(_0x5f67('0x6'));var client=jayson[_0x5f67('0x7')][_0x5f67('0x8')]({'port':0x232a});config[_0x5f67('0x9')]=_[_0x5f67('0xa')](config['redis'],{'host':_0x5f67('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5f67('0xc'))[_0x5f67('0xd')](socket);function respondWithRpcPromise(_0x49e1e8,_0x5267d9,_0x3dba79){return new BPromise(function(_0x593ff6,_0x53db64){return client[_0x5f67('0xe')](_0x49e1e8,_0x3dba79)[_0x5f67('0xf')](function(_0x507295){logger[_0x5f67('0x10')](_0x5f67('0x11'),_0x5267d9,_0x5f67('0x12'));logger['debug'](_0x5f67('0x13'),_0x5267d9,_0x5f67('0x12'),JSON[_0x5f67('0x14')](_0x507295));if(_0x507295[_0x5f67('0x15')]){if(_0x507295[_0x5f67('0x15')][_0x5f67('0x16')]===0x1f4){logger['error'](_0x5f67('0x11'),_0x5267d9,_0x507295[_0x5f67('0x15')]['message']);return _0x53db64(_0x507295[_0x5f67('0x15')][_0x5f67('0x17')]);}logger[_0x5f67('0x15')](_0x5f67('0x11'),_0x5267d9,_0x507295[_0x5f67('0x15')][_0x5f67('0x17')]);return _0x593ff6(_0x507295[_0x5f67('0x15')]['message']);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x5267d9,_0x5f67('0x12'));_0x593ff6(_0x507295[_0x5f67('0x18')][_0x5f67('0x17')]);}})[_0x5f67('0x19')](function(_0x375fd0){logger[_0x5f67('0x15')](_0x5f67('0x11'),_0x5267d9,_0x375fd0);_0x53db64(_0x375fd0);});});}exports['UpdateSmsInteraction']=function(_0xfa083c){var _0x51327e=this;return new Promise(function(_0x82df57,_0x4ab9a5){return db[_0x5f67('0x1a')][_0x5f67('0x1b')](_0xfa083c[_0x5f67('0x1c')],{'raw':_0xfa083c[_0x5f67('0x1d')]?_0xfa083c['options'][_0x5f67('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfa083c['options']?_0xfa083c[_0x5f67('0x1d')][_0x5f67('0x1f')]||null:null,'attributes':_0xfa083c[_0x5f67('0x1d')]?_0xfa083c[_0x5f67('0x1d')][_0x5f67('0x20')]||null:null,'limit':_0xfa083c[_0x5f67('0x1d')]?_0xfa083c[_0x5f67('0x1d')][_0x5f67('0x21')]||null:null})[_0x5f67('0xf')](function(_0x4266a1){logger[_0x5f67('0x10')](_0x5f67('0x22'),_0xfa083c);logger['debug'](_0x5f67('0x22'),_0xfa083c,JSON[_0x5f67('0x14')](_0x4266a1));_0x82df57(_0x4266a1);})[_0x5f67('0x19')](function(_0x52e150){logger[_0x5f67('0x15')](_0x5f67('0x22'),_0x52e150[_0x5f67('0x17')],_0xfa083c);_0x4ab9a5(_0x51327e[_0x5f67('0x15')](0x1f4,_0x52e150[_0x5f67('0x17')]));});});};exports[_0x5f67('0x23')]=function(_0x22fcfd){return new Promise(function(_0x431d53,_0x3a53cd){return db[_0x5f67('0x1a')][_0x5f67('0x24')]({'where':_0x22fcfd[_0x5f67('0x1d')]?_0x22fcfd[_0x5f67('0x1d')]['where']||null:null})[_0x5f67('0xf')](function(_0x28422e){if(_0x28422e){return _0x28422e[_0x5f67('0x25')](_0x22fcfd[_0x5f67('0x1c')][_0x5f67('0x26')],_['omit'](_0x22fcfd[_0x5f67('0x1c')],[_0x5f67('0x26'),'id'])||{});}})[_0x5f67('0x27')](function(_0x220f52){logger[_0x5f67('0x10')](_0x5f67('0x28'),_0x22fcfd);logger[_0x5f67('0x29')](_0x5f67('0x28'),_0x22fcfd,JSON[_0x5f67('0x14')](_0x220f52));_0x431d53(_0x220f52);})[_0x5f67('0x19')](function(_0x36229b){logger['error'](_0x5f67('0x28'),_0x36229b[_0x5f67('0x17')],_0x22fcfd);_0x3a53cd(_this['error'](0x1f4,_0x36229b[_0x5f67('0x17')]));});});}; \ No newline at end of file +var _0x8540=['debug','stringify','error','code','message','request\x20sent','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','info','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','then','SmsInteraction,\x20%s,\x20%s'];(function(_0x2fa9da,_0x2fb5ee){var _0x5ae45b=function(_0x352d8b){while(--_0x352d8b){_0x2fa9da['push'](_0x2fa9da['shift']());}};_0x5ae45b(++_0x2fb5ee);}(_0x8540,0xa2));var _0x0854=function(_0x2a0183,_0x3fc93c){_0x2a0183=_0x2a0183-0x0;var _0x158c3a=_0x8540[_0x2a0183];return _0x158c3a;};'use strict';var _=require(_0x0854('0x0'));var util=require(_0x0854('0x1'));var moment=require(_0x0854('0x2'));var BPromise=require(_0x0854('0x3'));var rs=require(_0x0854('0x4'));var fs=require('fs');var Redis=require(_0x0854('0x5'));var db=require(_0x0854('0x6'))['db'];var utils=require(_0x0854('0x7'));var logger=require(_0x0854('0x8'))(_0x0854('0x9'));var config=require(_0x0854('0xa'));var jayson=require(_0x0854('0xb'));var client=jayson[_0x0854('0xc')][_0x0854('0xd')]({'port':0x232a});config[_0x0854('0xe')]=_[_0x0854('0xf')](config[_0x0854('0xe')],{'host':_0x0854('0x10'),'port':0x18eb});var socket=require(_0x0854('0x11'))(new Redis(config['redis']));require(_0x0854('0x12'))[_0x0854('0x13')](socket);function respondWithRpcPromise(_0x522440,_0x1a6ad9,_0x3157b6){return new BPromise(function(_0x2e5223,_0x92f9e7){return client['request'](_0x522440,_0x3157b6)[_0x0854('0x14')](function(_0x2e0e5a){logger['info'](_0x0854('0x15'),_0x1a6ad9,'request\x20sent');logger[_0x0854('0x16')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x1a6ad9,'request\x20sent',JSON[_0x0854('0x17')](_0x2e0e5a));if(_0x2e0e5a[_0x0854('0x18')]){if(_0x2e0e5a[_0x0854('0x18')][_0x0854('0x19')]===0x1f4){logger[_0x0854('0x18')](_0x0854('0x15'),_0x1a6ad9,_0x2e0e5a[_0x0854('0x18')][_0x0854('0x1a')]);return _0x92f9e7(_0x2e0e5a[_0x0854('0x18')][_0x0854('0x1a')]);}logger[_0x0854('0x18')](_0x0854('0x15'),_0x1a6ad9,_0x2e0e5a[_0x0854('0x18')][_0x0854('0x1a')]);return _0x2e5223(_0x2e0e5a[_0x0854('0x18')][_0x0854('0x1a')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x1a6ad9,_0x0854('0x1b'));_0x2e5223(_0x2e0e5a[_0x0854('0x1c')][_0x0854('0x1a')]);}})[_0x0854('0x1d')](function(_0xe2a72){logger[_0x0854('0x18')](_0x0854('0x15'),_0x1a6ad9,_0xe2a72);_0x92f9e7(_0xe2a72);});});}exports[_0x0854('0x1e')]=function(_0xdb2a4){var _0x3ec663=this;return new Promise(function(_0x2d4787,_0x3b0256){return db[_0x0854('0x1f')][_0x0854('0x20')](_0xdb2a4[_0x0854('0x21')],{'raw':_0xdb2a4[_0x0854('0x22')]?_0xdb2a4[_0x0854('0x22')][_0x0854('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdb2a4[_0x0854('0x22')]?_0xdb2a4[_0x0854('0x22')][_0x0854('0x24')]||null:null,'attributes':_0xdb2a4[_0x0854('0x22')]?_0xdb2a4[_0x0854('0x22')]['attributes']||null:null,'limit':_0xdb2a4['options']?_0xdb2a4[_0x0854('0x22')][_0x0854('0x25')]||null:null})[_0x0854('0x14')](function(_0x261d32){logger[_0x0854('0x26')]('UpdateSmsInteraction',_0xdb2a4);logger[_0x0854('0x16')](_0x0854('0x1e'),_0xdb2a4,JSON[_0x0854('0x17')](_0x261d32));_0x2d4787(_0x261d32);})[_0x0854('0x1d')](function(_0x1ac1b2){logger['error']('UpdateSmsInteraction',_0x1ac1b2['message'],_0xdb2a4);_0x3b0256(_0x3ec663[_0x0854('0x18')](0x1f4,_0x1ac1b2['message']));});});};exports[_0x0854('0x27')]=function(_0x49763c){return new Promise(function(_0x56e1fe,_0x4092bb){return db[_0x0854('0x1f')][_0x0854('0x28')]({'where':_0x49763c[_0x0854('0x22')]?_0x49763c['options'][_0x0854('0x24')]||null:null})['then'](function(_0x26dc6a){if(_0x26dc6a){return _0x26dc6a[_0x0854('0x29')](_0x49763c[_0x0854('0x21')][_0x0854('0x2a')],_[_0x0854('0x2b')](_0x49763c[_0x0854('0x21')],[_0x0854('0x2a'),'id'])||{});}})[_0x0854('0x2c')](function(_0x59b22e){logger[_0x0854('0x26')](_0x0854('0x2d'),_0x49763c);logger[_0x0854('0x16')](_0x0854('0x2d'),_0x49763c,JSON[_0x0854('0x17')](_0x59b22e));_0x56e1fe(_0x59b22e);})['catch'](function(_0x2d9ee6){logger[_0x0854('0x18')](_0x0854('0x2d'),_0x2d9ee6[_0x0854('0x1a')],_0x49763c);_0x4092bb(_this[_0x0854('0x18')](0x1f4,_0x2d9ee6['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index d0f79ed..a47e5dd 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 _0x5f66=['length','smsInteraction:','save','update','emit','register'];(function(_0x1b18fc,_0x1fc0b2){var _0xa67493=function(_0x2de9cd){while(--_0x2de9cd){_0x1b18fc['push'](_0x1b18fc['shift']());}};_0xa67493(++_0x1fc0b2);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x65f6('0x0'),'remove',_0x65f6('0x1')];function createListener(_0x2f06ae,_0x3461cd){return function(_0xbce843){_0x3461cd[_0x65f6('0x2')](_0x2f06ae,_0xbce843);};}function removeListener(_0x5eb9ad,_0x3c5029){return function(){SmsInteractionEvents['removeListener'](_0x5eb9ad,_0x3c5029);};}exports[_0x65f6('0x3')]=function(_0x22b017){for(var _0x4ec221=0x0,_0x4ed98f=events[_0x65f6('0x4')];_0x4ec221<_0x4ed98f;_0x4ec221++){var _0x2c6571=events[_0x4ec221];var _0x112079=createListener(_0x65f6('0x5')+_0x2c6571,_0x22b017);SmsInteractionEvents['on'](_0x2c6571,_0x112079);}}; \ No newline at end of file +var _0xb7e7=['remove','removeListener','length','smsInteraction:','./smsInteraction.events'];(function(_0xf335a0,_0x4b4d5f){var _0x1d649b=function(_0x4bf9a2){while(--_0x4bf9a2){_0xf335a0['push'](_0xf335a0['shift']());}};_0x1d649b(++_0x4b4d5f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb7e7[_0x19e35c];return _0x3e1fe8;};'use strict';var SmsInteractionEvents=require(_0x7b7e('0x0'));var events=['save',_0x7b7e('0x1'),'update'];function createListener(_0x1b7cc7,_0x54a37f){return function(_0x3f5804){_0x54a37f['emit'](_0x1b7cc7,_0x3f5804);};}function removeListener(_0x31d0ed,_0x118577){return function(){SmsInteractionEvents[_0x7b7e('0x2')](_0x31d0ed,_0x118577);};}exports['register']=function(_0x53ed64){for(var _0x333fa4=0x0,_0x372bde=events[_0x7b7e('0x3')];_0x333fa4<_0x372bde;_0x333fa4++){var _0x55ce81=events[_0x333fa4];var _0x42b871=createListener(_0x7b7e('0x4')+_0x55ce81,_0x53ed64);SmsInteractionEvents['on'](_0x55ce81,_0x42b871);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 689ee45..36d7718 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 _0x4449=['create','/:id/status','status','put','update','/:id/accept','accept','reject','delete','destroy','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4449,0xd2));var _0x9444=function(_0x44a391,_0x1b6e10){_0x44a391=_0x44a391-0x0;var _0x5278a5=_0x4449[_0x44a391];return _0x5278a5;};'use strict';var multer=require(_0x9444('0x0'));var util=require(_0x9444('0x1'));var path=require(_0x9444('0x2'));var timeout=require(_0x9444('0x3'));var express=require('express');var router=express[_0x9444('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x9444('0x5'));var config=require(_0x9444('0x6'));var controller=require(_0x9444('0x7'));router['get']('/',auth[_0x9444('0x8')](),controller[_0x9444('0x9')]);router[_0x9444('0xa')](_0x9444('0xb'),auth[_0x9444('0x8')](),controller[_0x9444('0xc')]);router[_0x9444('0xa')](_0x9444('0xd'),auth[_0x9444('0x8')](),controller['show']);router[_0x9444('0xe')]('/',auth[_0x9444('0x8')](),interaction['tracked']('sms','smsmessage:create'),controller[_0x9444('0xf')]);router[_0x9444('0xe')](_0x9444('0x10'),controller[_0x9444('0x11')]);router[_0x9444('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x9444('0x13')]);router[_0x9444('0x12')](_0x9444('0x14'),auth[_0x9444('0x8')](),controller[_0x9444('0x15')]);router[_0x9444('0x12')]('/:id/reject',auth[_0x9444('0x8')](),controller[_0x9444('0x16')]);router[_0x9444('0x17')](_0x9444('0xd'),auth['isAuthenticated'](),controller[_0x9444('0x18')]);module['exports']=router; \ No newline at end of file +var _0x7357=['multer','util','path','express','Router','../../components/auth/service','../../config/environment','./smsMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','sms','smsmessage:create','create','/:id/status','status','put','/:id/accept','accept','/:id/reject','destroy','exports'];(function(_0x32aba4,_0xc703f0){var _0x2439f6=function(_0x1c3bec){while(--_0x1c3bec){_0x32aba4['push'](_0x32aba4['shift']());}};_0x2439f6(++_0xc703f0);}(_0x7357,0x1b0));var _0x7735=function(_0x338fa1,_0x2c301e){_0x338fa1=_0x338fa1-0x0;var _0x87c0f5=_0x7357[_0x338fa1];return _0x87c0f5;};'use strict';var multer=require(_0x7735('0x0'));var util=require(_0x7735('0x1'));var path=require(_0x7735('0x2'));var timeout=require('connect-timeout');var express=require(_0x7735('0x3'));var router=express[_0x7735('0x4')]();var auth=require(_0x7735('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7735('0x6'));var controller=require(_0x7735('0x7'));router[_0x7735('0x8')]('/',auth['isAuthenticated'](),controller[_0x7735('0x9')]);router['get'](_0x7735('0xa'),auth['isAuthenticated'](),controller[_0x7735('0xb')]);router[_0x7735('0x8')](_0x7735('0xc'),auth[_0x7735('0xd')](),controller[_0x7735('0xe')]);router[_0x7735('0xf')]('/',auth[_0x7735('0xd')](),interaction['tracked'](_0x7735('0x10'),_0x7735('0x11')),controller[_0x7735('0x12')]);router[_0x7735('0xf')](_0x7735('0x13'),controller[_0x7735('0x14')]);router[_0x7735('0x15')](_0x7735('0xc'),auth[_0x7735('0xd')](),controller['update']);router['put'](_0x7735('0x16'),auth[_0x7735('0xd')](),controller[_0x7735('0x17')]);router[_0x7735('0x15')](_0x7735('0x18'),auth[_0x7735('0xd')](),controller['reject']);router['delete'](_0x7735('0xc'),auth[_0x7735('0xd')](),controller[_0x7735('0x19')]);module[_0x7735('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 6661b51..879d440 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 _0xd5f9=['medium','out','STRING','DATE','BOOLEAN','exports','TEXT'];(function(_0x5a5be3,_0x529f70){var _0x4827ce=function(_0x2917f1){while(--_0x2917f1){_0x5a5be3['push'](_0x5a5be3['shift']());}};_0x4827ce(++_0x529f70);}(_0xd5f9,0xbb));var _0x9d5f=function(_0xd4636c,_0x34dbf6){_0xd4636c=_0xd4636c-0x0;var _0x5ee17d=_0xd5f9[_0xd4636c];return _0x5ee17d;};'use strict';var Sequelize=require('sequelize');module[_0x9d5f('0x0')]={'body':{'type':Sequelize[_0x9d5f('0x1')](_0x9d5f('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9d5f('0x3')),'defaultValue':_0x9d5f('0x3'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x9d5f('0x4')]},'readAt':{'type':Sequelize[_0x9d5f('0x5')]},'secret':{'type':Sequelize[_0x9d5f('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xf9b0=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xf9b0,0x121));var _0x0f9b=function(_0x3b3a0d,_0x2f4f4c){_0x3b3a0d=_0x3b3a0d-0x0;var _0x5a3c81=_0xf9b0[_0x3b3a0d];return _0x5a3c81;};'use strict';var Sequelize=require(_0x0f9b('0x0'));module[_0x0f9b('0x1')]={'body':{'type':Sequelize[_0x0f9b('0x2')](_0x0f9b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x0f9b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0f9b('0x5')]('in',_0x0f9b('0x6')),'defaultValue':_0x0f9b('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0f9b('0x7')](0xbe)},'phone':{'type':Sequelize[_0x0f9b('0x7')]},'readAt':{'type':Sequelize[_0x0f9b('0x8')]},'secret':{'type':Sequelize[_0x0f9b('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 4e2b25b..fc1d239 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 _0x0309=['set','Content-Range','apply','reject','save','update','destroy','stack','name','send','SmsMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','show','options','find','create','body','params','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','CmContact','Contact','get','SmsInteraction','SmsInteractionId','UserId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','manual','interface','channel','EventManager','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','event','rejectmessage','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','sent','delivered','infobip','results','groupName','DELIVERED','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit'];(function(_0x4843f9,_0x4af459){var _0x193c6a=function(_0x51eca9){while(--_0x51eca9){_0x4843f9['push'](_0x4843f9['shift']());}};_0x193c6a(++_0x4af459);}(_0x0309,0x165));var _0x9030=function(_0x88260f,_0x15cc79){_0x88260f=_0x88260f-0x0;var _0xafda2e=_0x0309[_0x88260f];return _0xafda2e;};'use strict';var pdf=require(_0x9030('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9030('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9030('0x2'));var rp=require(_0x9030('0x3'));var moment=require(_0x9030('0x4'));var BPromise=require(_0x9030('0x5'));var Mustache=require(_0x9030('0x6'));var util=require(_0x9030('0x7'));var path=require(_0x9030('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9030('0x9'));var fs=require('fs');var _=require(_0x9030('0xa'));var squel=require('squel');var crypto=require(_0x9030('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9030('0xc'));var toCsv=require(_0x9030('0xd'));var querystring=require(_0x9030('0xe'));var Papa=require('papaparse');var Redis=require(_0x9030('0xf'));var authService=require(_0x9030('0x10'));var qs=require(_0x9030('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9030('0x12'))(_0x9030('0x13'));var utils=require(_0x9030('0x14'));var config=require(_0x9030('0x15'));var db=require(_0x9030('0x16'))['db'];config[_0x9030('0x17')]=_[_0x9030('0x18')](config['redis'],{'host':_0x9030('0x19'),'port':0x18eb});var socket=require(_0x9030('0x1a'))(new Redis(config[_0x9030('0x17')]));require(_0x9030('0x1b'))['register'](socket);var jayson=require(_0x9030('0x1c'));var client=jayson[_0x9030('0x1d')][_0x9030('0x1e')]({'port':0x232c});var client9002=jayson[_0x9030('0x1d')][_0x9030('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x1615ab,_0x111f3b,_0x1776e6){if(_0x1776e6){var _0xfc6f46=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xfc6f46['test'](_0x111f3b)){return _0x1615ab;}else{throw new Error(_0x9030('0x1f'));}}else{return _0x1615ab;}}function respondWithRpcPromise(_0x17e80d,_0x2bd14d,_0x37afac,_0x319db3){return new BPromise(function(_0x1327ec,_0x229dcd){var _0x28c035=_0x319db3||client;return _0x28c035[_0x9030('0x20')](_0x17e80d,_0x37afac)[_0x9030('0x21')](function(_0x164c88){logger[_0x9030('0x22')](_0x9030('0x23'),_0x2bd14d,_0x9030('0x24'));logger[_0x9030('0x25')](_0x9030('0x26'),_0x2bd14d,_0x9030('0x24'),JSON['stringify'](_0x164c88));if(_0x164c88['error']){if(_0x164c88[_0x9030('0x27')][_0x9030('0x28')]===0x1f4){logger['error'](_0x9030('0x23'),_0x2bd14d,_0x164c88[_0x9030('0x27')][_0x9030('0x29')]);return _0x229dcd(_0x164c88[_0x9030('0x27')]['message']);}logger[_0x9030('0x27')]('SmsMessage,\x20%s,\x20%s',_0x2bd14d,_0x164c88['error'][_0x9030('0x29')]);return _0x1327ec(_0x164c88[_0x9030('0x27')][_0x9030('0x29')]);}else{logger['info'](_0x9030('0x23'),_0x2bd14d,_0x9030('0x24'));_0x1327ec(_0x164c88[_0x9030('0x2a')][_0x9030('0x29')]);}})[_0x9030('0x2b')](function(_0x4d6bf9){logger[_0x9030('0x27')](_0x9030('0x23'),_0x2bd14d,_0x4d6bf9);_0x229dcd(_0x4d6bf9);});});}function respondWithStatusCode(_0x1ff4ef,_0x463dda){_0x463dda=_0x463dda||0xcc;return function(_0x42d1ba){if(_0x42d1ba){return _0x1ff4ef[_0x9030('0x2c')](_0x463dda);}return _0x1ff4ef[_0x9030('0x2d')](_0x463dda)[_0x9030('0x2e')]();};}function respondWithResult(_0x26a803,_0x11c47d){_0x11c47d=_0x11c47d||0xc8;return function(_0x3be936){if(_0x3be936){return _0x26a803[_0x9030('0x2d')](_0x11c47d)[_0x9030('0x2f')](_0x3be936);}};}function respondWithFilteredResult(_0x18de34,_0x584013){return function(_0x1ed9fd){if(_0x1ed9fd){var _0x4b042c=_0x1ed9fd[_0x9030('0x30')],_0x43a31b=_0x584013[_0x9030('0x31')],_0x5b745a=_0x584013['offset']+_0x584013[_0x9030('0x32')],_0x46d055;if(_0x5b745a>=_0x4b042c){_0x5b745a=_0x4b042c;_0x46d055=0xc8;}else{_0x46d055=0xce;}_0x18de34[_0x9030('0x2d')](_0x46d055);return _0x18de34[_0x9030('0x33')](_0x9030('0x34'),_0x43a31b+'-'+_0x5b745a+'/'+_0x4b042c)[_0x9030('0x2f')](_0x1ed9fd);}return null;};}function patchUpdates(_0x14619b){return function(_0x754e00){try{jsonpatch[_0x9030('0x35')](_0x754e00,_0x14619b,!![]);}catch(_0x134260){return BPromise[_0x9030('0x36')](_0x134260);}return _0x754e00[_0x9030('0x37')]();};}function saveUpdates(_0x3ce55c,_0x414b35){return function(_0x2fd58e){if(_0x2fd58e){return _0x2fd58e[_0x9030('0x38')](_0x3ce55c)[_0x9030('0x21')](function(_0x259dd3){return _0x259dd3;});}return null;};}function removeEntity(_0x2cca71,_0x54ebae){return function(_0x582e57){if(_0x582e57){return _0x582e57[_0x9030('0x39')]()[_0x9030('0x21')](function(){_0x2cca71['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f5d3f,_0x3c8645){return function(_0x411077){if(!_0x411077){_0x2f5d3f[_0x9030('0x2c')](0x194);}return _0x411077;};}function handleError(_0x47f069,_0xc8123e){_0xc8123e=_0xc8123e||0x1f4;return function(_0x4d684c){logger[_0x9030('0x27')](_0x4d684c[_0x9030('0x3a')]);if(_0x4d684c['name']){delete _0x4d684c[_0x9030('0x3b')];}_0x47f069[_0x9030('0x2d')](_0xc8123e)[_0x9030('0x3c')](_0x4d684c);};}exports['index']=function(_0x288b97,_0x4864d4){var _0x438828={},_0x556bb8={},_0x3c1797={'count':0x0,'rows':[]};var _0x5e371b=db[_0x9030('0x3d')][_0x9030('0x3e')];_0x556bb8[_0x9030('0x3f')]=_[_0x9030('0x40')](_0x5e371b);_0x556bb8[_0x9030('0x41')]=_[_0x9030('0x40')](_0x288b97[_0x9030('0x41')]);_0x556bb8[_0x9030('0x42')]=_[_0x9030('0x43')](_0x556bb8['model'],_0x556bb8[_0x9030('0x41')]);_0x438828[_0x9030('0x44')]=_[_0x9030('0x43')](_0x556bb8['model'],qs[_0x9030('0x45')](_0x288b97[_0x9030('0x41')][_0x9030('0x45')]));_0x438828[_0x9030('0x44')]=_0x438828['attributes'][_0x9030('0x46')]?_0x438828[_0x9030('0x44')]:_0x556bb8[_0x9030('0x3f')];if(!_0x288b97['query'][_0x9030('0x47')](_0x9030('0x48'))){_0x438828[_0x9030('0x32')]=qs[_0x9030('0x32')](_0x288b97[_0x9030('0x41')]['limit']);_0x438828[_0x9030('0x31')]=qs['offset'](_0x288b97[_0x9030('0x41')][_0x9030('0x31')]);}_0x438828[_0x9030('0x49')]=qs[_0x9030('0x4a')](_0x288b97[_0x9030('0x41')][_0x9030('0x4a')]);_0x438828[_0x9030('0x4b')]=qs[_0x9030('0x42')](_['pick'](_0x288b97[_0x9030('0x41')],_0x556bb8[_0x9030('0x42')]));if(_0x288b97[_0x9030('0x41')][_0x9030('0x4c')]){_0x438828[_0x9030('0x4b')]=_[_0x9030('0x4d')](_0x438828[_0x9030('0x4b')],{'$or':_[_0x9030('0x4e')](_0x5e371b,function(_0x141f97){if(_0x141f97[_0x9030('0x4f')][_0x9030('0x50')]!==_0x9030('0x51')){var _0x2849af={};_0x2849af[_0x141f97[_0x9030('0x52')]]={'$like':'%'+_0x288b97['query'][_0x9030('0x4c')]+'%'};return _0x2849af;}})});}_0x438828=_[_0x9030('0x4d')]({},_0x438828,_0x288b97['options']);var _0x6c14fb={'where':_0x438828[_0x9030('0x4b')]};return db[_0x9030('0x3d')]['count'](_0x6c14fb)['then'](function(_0x16154f){_0x3c1797['count']=_0x16154f;if(_0x288b97['query'][_0x9030('0x53')]){_0x438828[_0x9030('0x54')]=[{'all':!![]}];}return db[_0x9030('0x3d')][_0x9030('0x55')](_0x438828);})['then'](function(_0x2016b3){_0x3c1797['rows']=_0x2016b3;return _0x3c1797;})[_0x9030('0x21')](respondWithFilteredResult(_0x4864d4,_0x438828))[_0x9030('0x2b')](handleError(_0x4864d4,null));};exports[_0x9030('0x56')]=function(_0x513ee4,_0x119c2d){var _0xf54697={'raw':!![],'where':{'id':_0x513ee4['params']['id']}},_0x3a2adf={};_0x3a2adf[_0x9030('0x3f')]=_[_0x9030('0x40')](db['SmsMessage'][_0x9030('0x3e')]);_0x3a2adf['query']=_[_0x9030('0x40')](_0x513ee4['query']);_0x3a2adf[_0x9030('0x42')]=_[_0x9030('0x43')](_0x3a2adf[_0x9030('0x3f')],_0x3a2adf[_0x9030('0x41')]);_0xf54697[_0x9030('0x44')]=_[_0x9030('0x43')](_0x3a2adf['model'],qs[_0x9030('0x45')](_0x513ee4[_0x9030('0x41')][_0x9030('0x45')]));_0xf54697[_0x9030('0x44')]=_0xf54697[_0x9030('0x44')]['length']?_0xf54697['attributes']:_0x3a2adf[_0x9030('0x3f')];if(_0x513ee4[_0x9030('0x41')][_0x9030('0x53')]){_0xf54697[_0x9030('0x54')]=[{'all':!![]}];}_0xf54697=_[_0x9030('0x4d')]({},_0xf54697,_0x513ee4[_0x9030('0x57')]);return db[_0x9030('0x3d')][_0x9030('0x58')](_0xf54697)[_0x9030('0x21')](handleEntityNotFound(_0x119c2d,null))[_0x9030('0x21')](respondWithResult(_0x119c2d,null))[_0x9030('0x2b')](handleError(_0x119c2d,null));};exports[_0x9030('0x59')]=function(_0x3092f8,_0x48234b){return db[_0x9030('0x3d')][_0x9030('0x59')](_0x3092f8['body'],{})['then'](respondWithResult(_0x48234b,0xc9))[_0x9030('0x2b')](handleError(_0x48234b,null));};exports[_0x9030('0x38')]=function(_0x24fc6c,_0x845fc0){if(_0x24fc6c[_0x9030('0x5a')]['id']){delete _0x24fc6c[_0x9030('0x5a')]['id'];}return db['SmsMessage']['find']({'where':{'id':_0x24fc6c[_0x9030('0x5b')]['id']}})[_0x9030('0x21')](handleEntityNotFound(_0x845fc0,null))[_0x9030('0x21')](saveUpdates(_0x24fc6c[_0x9030('0x5a')],null))['then'](respondWithResult(_0x845fc0,null))[_0x9030('0x2b')](handleError(_0x845fc0,null));};exports[_0x9030('0x39')]=function(_0x1ca30b,_0x326782){return db[_0x9030('0x3d')]['find']({'where':{'id':_0x1ca30b['params']['id']}})[_0x9030('0x21')](handleEntityNotFound(_0x326782,null))[_0x9030('0x21')](removeEntity(_0x326782,null))[_0x9030('0x2b')](handleError(_0x326782,null));};exports[_0x9030('0x5c')]=function(_0x3f3153,_0x17bf72){return db[_0x9030('0x3d')][_0x9030('0x5c')]()[_0x9030('0x21')](respondWithResult(_0x17bf72,null))[_0x9030('0x2b')](handleError(_0x17bf72,null));};var interaction_log=require('../../config/logger')(_0x9030('0x5d'));exports[_0x9030('0x5e')]=function(_0x85bc9a,_0x18ee8a,_0xc8dfc1){var _0x101fa5={'channel':_0x9030('0x5f')};if(_0x85bc9a['body']['id']){delete _0x85bc9a['body']['id'];}_0x85bc9a[_0x9030('0x5a')][_0x9030('0x60')]=!![];_0x85bc9a[_0x9030('0x5a')][_0x9030('0x61')]=moment()[_0x9030('0x62')](_0x9030('0x63'));_0x85bc9a[_0x9030('0x5a')]['UserId']=_0x85bc9a['body']['UserId']||_0x85bc9a[_0x9030('0x64')]['id'];return db['SmsMessage'][_0x9030('0x58')]({'where':{'id':_0x85bc9a['params']['id'],'UserId':null},'include':[{'model':db[_0x9030('0x65')],'as':_0x9030('0x66')}]})[_0x9030('0x21')](handleEntityNotFound(_0x18ee8a,null))[_0x9030('0x21')](saveUpdates(_0x85bc9a[_0x9030('0x5a')],null))[_0x9030('0x21')](function(_0x3f46de){if(_0x3f46de){_0x101fa5[_0x9030('0x29')]=_0x3f46de[_0x9030('0x67')]({'plain':!![]});return db[_0x9030('0x68')][_0x9030('0x58')]({'where':{'id':_0x3f46de[_0x9030('0x69')]}});}return null;})[_0x9030('0x21')](handleEntityNotFound(_0x18ee8a,null))[_0x9030('0x21')](function(_0x49bad8){if(_0x49bad8){return _0x49bad8[_0x9030('0x38')]({'UserId':_0x85bc9a[_0x9030('0x5a')][_0x9030('0x6a')],'read1stAt':_[_0x9030('0x6b')](_0x49bad8[_0x9030('0x6c')])?moment()[_0x9030('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x9030('0x21')](function(_0x28fe9d){if(_0x28fe9d){_0x101fa5[_0x9030('0x6d')]=_0x28fe9d[_0x9030('0x67')]({'plain':!![]});interaction_log[_0x9030('0x22')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x85bc9a[_0x9030('0x64')]['id'],_0x85bc9a[_0x9030('0x64')][_0x9030('0x3b')],_0x85bc9a['user'][_0x9030('0x6e')],_0x101fa5[_0x9030('0x6d')]['id'],_0x85bc9a['body']?JSON['stringify'](_0x85bc9a['body']):_0x9030('0x6f'));return respondWithRpcPromise(_0x9030('0x70'),_0x9030('0x71'),_0x101fa5);}return null;})[_0x9030('0x21')](function(_0x9caf7b){if(_0x9caf7b){if(_0x85bc9a['body'][_0x9030('0x72')]){_0x101fa5[_0x9030('0x29')][_0x9030('0x73')]=util[_0x9030('0x62')]('SIP/%s',_0x85bc9a[_0x9030('0x64')][_0x9030('0x3b')]);_0x101fa5[_0x9030('0x29')]['channel']=_0x101fa5[_0x9030('0x74')];_0x101fa5[_0x9030('0x29')]['event']=_0x9030('0x5e');return respondWithRpcPromise(_0x9030('0x75'),_0x9030('0x75'),{'event':'acceptmessage','message':_0x101fa5[_0x9030('0x29')]},client9002)['then'](function(){return _0x101fa5;});}return _0x101fa5;}return null;})[_0x9030('0x21')](respondWithResult(_0x18ee8a,null))[_0x9030('0x2b')](handleError(_0x18ee8a,null));};var interaction_log=require(_0x9030('0x12'))(_0x9030('0x5d'));exports[_0x9030('0x36')]=function(_0x156f46,_0x1fb5a8,_0x52a0ba){var _0xdcf04={'agent':{},'channel':'sms'};if(_0x156f46[_0x9030('0x5a')]['id']){delete _0x156f46[_0x9030('0x5a')]['id'];}_0x156f46[_0x9030('0x5a')][_0x9030('0x6a')]=_0x156f46[_0x9030('0x5a')]['UserId']||_0x156f46['user']['id'];_0xdcf04['agent']['id']=_0x156f46[_0x9030('0x5a')][_0x9030('0x6a')];return db[_0x9030('0x3d')]['find']({'where':{'id':_0x156f46[_0x9030('0x5b')]['id'],'UserId':null}})[_0x9030('0x21')](handleEntityNotFound(_0x1fb5a8,null))[_0x9030('0x21')](function(_0x5a9493){if(_0x5a9493){_0xdcf04[_0x9030('0x29')]=_0x5a9493[_0x9030('0x67')]({'plain':!![]});return db[_0x9030('0x68')][_0x9030('0x58')]({'where':{'id':_0x5a9493[_0x9030('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x1fb5a8,null))[_0x9030('0x21')](function(_0x3a7592){if(_0x3a7592){_0xdcf04[_0x9030('0x6d')]=_0x3a7592['get']({'plain':!![]});interaction_log[_0x9030('0x22')](_0x9030('0x76'),_0x156f46[_0x9030('0x64')]['id'],_0x156f46[_0x9030('0x64')]['name'],_0x156f46['user'][_0x9030('0x6e')],_0xdcf04[_0x9030('0x6d')]['id'],_0x156f46[_0x9030('0x5a')]?JSON[_0x9030('0x77')](_0x156f46[_0x9030('0x5a')]):'null');return respondWithRpcPromise(_0x9030('0x78'),_0x9030('0x79'),_0xdcf04);}return null;})[_0x9030('0x21')](function(_0x3e61e2){if(_0x3e61e2){_0x3e61e2[_0x9030('0x29')]['interface']=util[_0x9030('0x62')]('SIP/%s',_0x156f46[_0x9030('0x64')][_0x9030('0x3b')]);_0x3e61e2[_0x9030('0x29')]['channel']=_0xdcf04['channel'];_0x3e61e2[_0x9030('0x29')][_0x9030('0x7a')]=_0x9030('0x36');respondWithRpcPromise(_0x9030('0x75'),_0x9030('0x75'),{'event':_0x9030('0x7b'),'message':_0x3e61e2[_0x9030('0x29')]},client9002);return _0xdcf04;}return null;})['then'](respondWithResult(_0x1fb5a8,null))[_0x9030('0x2b')](handleError(_0x1fb5a8,null));};exports[_0x9030('0x2d')]=function(_0x539934,_0x13961f,_0x1fd9ea){if(_0x539934[_0x9030('0x5a')]['id']){delete _0x539934[_0x9030('0x5a')]['id'];}var _0x346368;return db[_0x9030('0x3d')][_0x9030('0x58')]({'where':{'id':_0x539934[_0x9030('0x5b')]['id']}})[_0x9030('0x21')](handleEntityNotFound(_0x13961f,null))['then'](function(_0x17c648){if(_0x17c648){_0x346368=_0x17c648;return db['SmsAccount']['find']({'where':{'id':_0x17c648['SmsAccountId']}});}})[_0x9030('0x21')](handleEntityNotFound(_0x13961f,null))[_0x9030('0x21')](function(_0x405e24){if(_0x405e24){logger[_0x9030('0x25')](_0x9030('0x26'),_0x9030('0x2d'),'received\x20delivery\x20report\x20from',_0x405e24[_0x9030('0x4f')],util[_0x9030('0x7c')](_0x539934[_0x9030('0x5a')],{'showHidden':![],'depth':null}));switch(_0x405e24[_0x9030('0x4f')]){case _0x9030('0x7d'):if(_0x539934[_0x9030('0x5a')][_0x9030('0x7e')]&&_0x539934[_0x9030('0x5a')][_0x9030('0x7e')]===_0x346368[_0x9030('0x7f')]){return _0x346368[_0x9030('0x38')]({'read':!![]});}else{logger[_0x9030('0x27')](_0x9030('0x80'),'status','twilio',util[_0x9030('0x7c')](_0x539934[_0x9030('0x5a')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x539934[_0x9030('0x5a')][_0x9030('0x81')]&&_0x539934[_0x9030('0x5a')][_0x9030('0x81')]===_0x346368[_0x9030('0x7f')]&&_['indexOf']([_0x9030('0x82'),_0x9030('0x83')],_0x539934[_0x9030('0x5a')]['Status'])>=0x0){return _0x346368['update']({'read':!![]});}else{logger['error'](_0x9030('0x80'),_0x9030('0x2d'),'plivio',util['inspect'](_0x539934[_0x9030('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x9030('0x84'):var _0x4bb827=_0x539934[_0x9030('0x5a')][_0x9030('0x85')][0x0];if(_0x4bb827[_0x9030('0x2d')][_0x9030('0x86')]===_0x9030('0x87')){return _0x346368[_0x9030('0x38')]({'read':!![]});}else{logger[_0x9030('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9030('0x2d'),'infobip',util[_0x9030('0x7c')](_0x539934[_0x9030('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x346368;}})['then'](respondWithResult(_0x13961f,null))['catch'](handleError(_0x13961f,null));}; \ No newline at end of file +var _0x33c5=['Content-Range','apply','reject','save','update','destroy','stack','name','send','index','SmsMessage','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','map','type','key','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','rows','show','params','create','body','find','describe','../../config/logger','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','SmsInteraction','isNil','interaction','role','stringify','null','AcceptMessage','channel','event','EventManager','agent','get','SmsInteractionId','RejectMessage','rejectMessage','interface','SIP/%s','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','sent','delivered','Status','plivio','results','groupName','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x33c5,0xe6));var _0x533c=function(_0x24fa1a,_0x16d9c2){_0x24fa1a=_0x24fa1a-0x0;var _0xc5621f=_0x33c5[_0x24fa1a];return _0xc5621f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x533c('0x0'));var rimraf=require(_0x533c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x533c('0x2'));var rp=require(_0x533c('0x3'));var moment=require(_0x533c('0x4'));var BPromise=require(_0x533c('0x5'));var Mustache=require(_0x533c('0x6'));var util=require('util');var path=require(_0x533c('0x7'));var sox=require(_0x533c('0x8'));var csv=require(_0x533c('0x9'));var ejs=require(_0x533c('0xa'));var fs=require('fs');var _=require(_0x533c('0xb'));var squel=require(_0x533c('0xc'));var crypto=require(_0x533c('0xd'));var jsforce=require(_0x533c('0xe'));var deskjs=require(_0x533c('0xf'));var toCsv=require(_0x533c('0x9'));var querystring=require(_0x533c('0x10'));var Papa=require(_0x533c('0x11'));var Redis=require(_0x533c('0x12'));var authService=require(_0x533c('0x13'));var qs=require(_0x533c('0x14'));var hardwareService=require(_0x533c('0x15'));var logger=require('../../config/logger')(_0x533c('0x16'));var utils=require(_0x533c('0x17'));var config=require(_0x533c('0x18'));var db=require(_0x533c('0x19'))['db'];config[_0x533c('0x1a')]=_[_0x533c('0x1b')](config['redis'],{'host':_0x533c('0x1c'),'port':0x18eb});var socket=require(_0x533c('0x1d'))(new Redis(config[_0x533c('0x1a')]));require(_0x533c('0x1e'))[_0x533c('0x1f')](socket);var jayson=require(_0x533c('0x20'));var client=jayson[_0x533c('0x21')][_0x533c('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x533c('0x22')]({'port':0x232a});function checkPasswordPattern(_0x7c1d33,_0x3f4a5c,_0x3e544f){if(_0x3e544f){var _0x56dfb7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x56dfb7[_0x533c('0x23')](_0x3f4a5c)){return _0x7c1d33;}else{throw new Error(_0x533c('0x24'));}}else{return _0x7c1d33;}}function respondWithRpcPromise(_0x41e22c,_0x311700,_0x2854ab,_0x4abaa3){return new BPromise(function(_0x1f0a72,_0x35bfd3){var _0x1f9f85=_0x4abaa3||client;return _0x1f9f85[_0x533c('0x25')](_0x41e22c,_0x2854ab)[_0x533c('0x26')](function(_0x2c41e9){logger[_0x533c('0x27')](_0x533c('0x28'),_0x311700,_0x533c('0x29'));logger[_0x533c('0x2a')](_0x533c('0x2b'),_0x311700,_0x533c('0x29'),JSON['stringify'](_0x2c41e9));if(_0x2c41e9[_0x533c('0x2c')]){if(_0x2c41e9['error']['code']===0x1f4){logger[_0x533c('0x2c')](_0x533c('0x28'),_0x311700,_0x2c41e9['error'][_0x533c('0x2d')]);return _0x35bfd3(_0x2c41e9[_0x533c('0x2c')][_0x533c('0x2d')]);}logger[_0x533c('0x2c')]('SmsMessage,\x20%s,\x20%s',_0x311700,_0x2c41e9[_0x533c('0x2c')][_0x533c('0x2d')]);return _0x1f0a72(_0x2c41e9[_0x533c('0x2c')][_0x533c('0x2d')]);}else{logger[_0x533c('0x27')](_0x533c('0x28'),_0x311700,_0x533c('0x29'));_0x1f0a72(_0x2c41e9[_0x533c('0x2e')][_0x533c('0x2d')]);}})[_0x533c('0x2f')](function(_0x4d47d0){logger[_0x533c('0x2c')](_0x533c('0x28'),_0x311700,_0x4d47d0);_0x35bfd3(_0x4d47d0);});});}function respondWithStatusCode(_0x503c2e,_0x3caaa5){_0x3caaa5=_0x3caaa5||0xcc;return function(_0x4f9f4a){if(_0x4f9f4a){return _0x503c2e[_0x533c('0x30')](_0x3caaa5);}return _0x503c2e[_0x533c('0x31')](_0x3caaa5)[_0x533c('0x32')]();};}function respondWithResult(_0x8dd7f1,_0x425f60){_0x425f60=_0x425f60||0xc8;return function(_0x146a8e){if(_0x146a8e){return _0x8dd7f1[_0x533c('0x31')](_0x425f60)[_0x533c('0x33')](_0x146a8e);}};}function respondWithFilteredResult(_0x3c559b,_0x2fc7fa){return function(_0x441680){if(_0x441680){var _0x73c0=_0x441680[_0x533c('0x34')],_0x58ae09=_0x2fc7fa[_0x533c('0x35')],_0x370263=_0x2fc7fa[_0x533c('0x35')]+_0x2fc7fa[_0x533c('0x36')],_0x591499;if(_0x370263>=_0x73c0){_0x370263=_0x73c0;_0x591499=0xc8;}else{_0x591499=0xce;}_0x3c559b[_0x533c('0x31')](_0x591499);return _0x3c559b[_0x533c('0x37')](_0x533c('0x38'),_0x58ae09+'-'+_0x370263+'/'+_0x73c0)[_0x533c('0x33')](_0x441680);}return null;};}function patchUpdates(_0x287ee5){return function(_0x47831f){try{jsonpatch[_0x533c('0x39')](_0x47831f,_0x287ee5,!![]);}catch(_0x3ec4c8){return BPromise[_0x533c('0x3a')](_0x3ec4c8);}return _0x47831f[_0x533c('0x3b')]();};}function saveUpdates(_0x3803d0,_0x5ac6b4){return function(_0x2b801e){if(_0x2b801e){return _0x2b801e[_0x533c('0x3c')](_0x3803d0)[_0x533c('0x26')](function(_0x31129f){return _0x31129f;});}return null;};}function removeEntity(_0x56694f,_0x3f1db9){return function(_0x31b4e4){if(_0x31b4e4){return _0x31b4e4[_0x533c('0x3d')]()[_0x533c('0x26')](function(){_0x56694f[_0x533c('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a006c,_0x538bc0){return function(_0x56cdfd){if(!_0x56cdfd){_0x5a006c['sendStatus'](0x194);}return _0x56cdfd;};}function handleError(_0xf21fa4,_0x4b6c22){_0x4b6c22=_0x4b6c22||0x1f4;return function(_0x42994d){logger['error'](_0x42994d[_0x533c('0x3e')]);if(_0x42994d[_0x533c('0x3f')]){delete _0x42994d[_0x533c('0x3f')];}_0xf21fa4['status'](_0x4b6c22)[_0x533c('0x40')](_0x42994d);};}exports[_0x533c('0x41')]=function(_0x339621,_0x55b010){var _0x160d4b={},_0x20b50c={},_0x30e5eb={'count':0x0,'rows':[]};var _0x5dfe21=db[_0x533c('0x42')][_0x533c('0x43')];_0x20b50c[_0x533c('0x44')]=_[_0x533c('0x45')](_0x5dfe21);_0x20b50c[_0x533c('0x46')]=_[_0x533c('0x45')](_0x339621[_0x533c('0x46')]);_0x20b50c[_0x533c('0x47')]=_[_0x533c('0x48')](_0x20b50c[_0x533c('0x44')],_0x20b50c[_0x533c('0x46')]);_0x160d4b['attributes']=_[_0x533c('0x48')](_0x20b50c[_0x533c('0x44')],qs[_0x533c('0x49')](_0x339621[_0x533c('0x46')][_0x533c('0x49')]));_0x160d4b[_0x533c('0x4a')]=_0x160d4b['attributes'][_0x533c('0x4b')]?_0x160d4b[_0x533c('0x4a')]:_0x20b50c[_0x533c('0x44')];if(!_0x339621['query'][_0x533c('0x4c')](_0x533c('0x4d'))){_0x160d4b[_0x533c('0x36')]=qs[_0x533c('0x36')](_0x339621['query'][_0x533c('0x36')]);_0x160d4b['offset']=qs[_0x533c('0x35')](_0x339621[_0x533c('0x46')]['offset']);}_0x160d4b[_0x533c('0x4e')]=qs[_0x533c('0x4f')](_0x339621[_0x533c('0x46')]['sort']);_0x160d4b['where']=qs['filters'](_['pick'](_0x339621[_0x533c('0x46')],_0x20b50c['filters']));if(_0x339621[_0x533c('0x46')]['filter']){_0x160d4b[_0x533c('0x50')]=_['merge'](_0x160d4b[_0x533c('0x50')],{'$or':_[_0x533c('0x51')](_0x5dfe21,function(_0x4c17b1){if(_0x4c17b1[_0x533c('0x52')][_0x533c('0x53')]!==_0x533c('0x54')){var _0x10e374={};_0x10e374[_0x4c17b1[_0x533c('0x55')]]={'$like':'%'+_0x339621['query'][_0x533c('0x56')]+'%'};return _0x10e374;}})});}_0x160d4b=_[_0x533c('0x57')]({},_0x160d4b,_0x339621[_0x533c('0x58')]);var _0xeca574={'where':_0x160d4b['where']};return db[_0x533c('0x42')][_0x533c('0x34')](_0xeca574)['then'](function(_0x4b74e5){_0x30e5eb[_0x533c('0x34')]=_0x4b74e5;if(_0x339621['query'][_0x533c('0x59')]){_0x160d4b[_0x533c('0x5a')]=[{'all':!![]}];}return db[_0x533c('0x42')][_0x533c('0x5b')](_0x160d4b);})[_0x533c('0x26')](function(_0x2d690f){_0x30e5eb[_0x533c('0x5c')]=_0x2d690f;return _0x30e5eb;})[_0x533c('0x26')](respondWithFilteredResult(_0x55b010,_0x160d4b))['catch'](handleError(_0x55b010,null));};exports[_0x533c('0x5d')]=function(_0x6b16e1,_0xaaf682){var _0x57c6c6={'raw':!![],'where':{'id':_0x6b16e1[_0x533c('0x5e')]['id']}},_0x2f0256={};_0x2f0256['model']=_[_0x533c('0x45')](db['SmsMessage'][_0x533c('0x43')]);_0x2f0256[_0x533c('0x46')]=_[_0x533c('0x45')](_0x6b16e1[_0x533c('0x46')]);_0x2f0256[_0x533c('0x47')]=_[_0x533c('0x48')](_0x2f0256[_0x533c('0x44')],_0x2f0256['query']);_0x57c6c6[_0x533c('0x4a')]=_[_0x533c('0x48')](_0x2f0256[_0x533c('0x44')],qs[_0x533c('0x49')](_0x6b16e1[_0x533c('0x46')][_0x533c('0x49')]));_0x57c6c6[_0x533c('0x4a')]=_0x57c6c6['attributes']['length']?_0x57c6c6['attributes']:_0x2f0256['model'];if(_0x6b16e1[_0x533c('0x46')][_0x533c('0x59')]){_0x57c6c6['include']=[{'all':!![]}];}_0x57c6c6=_[_0x533c('0x57')]({},_0x57c6c6,_0x6b16e1[_0x533c('0x58')]);return db[_0x533c('0x42')]['find'](_0x57c6c6)[_0x533c('0x26')](handleEntityNotFound(_0xaaf682,null))['then'](respondWithResult(_0xaaf682,null))['catch'](handleError(_0xaaf682,null));};exports[_0x533c('0x5f')]=function(_0x15a7d2,_0x37b901){return db[_0x533c('0x42')][_0x533c('0x5f')](_0x15a7d2[_0x533c('0x60')],{})[_0x533c('0x26')](respondWithResult(_0x37b901,0xc9))['catch'](handleError(_0x37b901,null));};exports[_0x533c('0x3c')]=function(_0x4ef71e,_0x5b3fe6){if(_0x4ef71e[_0x533c('0x60')]['id']){delete _0x4ef71e[_0x533c('0x60')]['id'];}return db[_0x533c('0x42')][_0x533c('0x61')]({'where':{'id':_0x4ef71e[_0x533c('0x5e')]['id']}})[_0x533c('0x26')](handleEntityNotFound(_0x5b3fe6,null))[_0x533c('0x26')](saveUpdates(_0x4ef71e['body'],null))[_0x533c('0x26')](respondWithResult(_0x5b3fe6,null))[_0x533c('0x2f')](handleError(_0x5b3fe6,null));};exports[_0x533c('0x3d')]=function(_0x94063c,_0x37ea57){return db[_0x533c('0x42')]['find']({'where':{'id':_0x94063c[_0x533c('0x5e')]['id']}})['then'](handleEntityNotFound(_0x37ea57,null))[_0x533c('0x26')](removeEntity(_0x37ea57,null))[_0x533c('0x2f')](handleError(_0x37ea57,null));};exports[_0x533c('0x62')]=function(_0x9b28b8,_0x302b66){return db[_0x533c('0x42')]['describe']()['then'](respondWithResult(_0x302b66,null))[_0x533c('0x2f')](handleError(_0x302b66,null));};var interaction_log=require(_0x533c('0x63'))(_0x533c('0x64'));exports[_0x533c('0x65')]=function(_0x4bdc46,_0x29c95c,_0x301cba){var _0x8e04c7={'channel':_0x533c('0x66')};if(_0x4bdc46[_0x533c('0x60')]['id']){delete _0x4bdc46[_0x533c('0x60')]['id'];}_0x4bdc46[_0x533c('0x60')][_0x533c('0x67')]=!![];_0x4bdc46[_0x533c('0x60')][_0x533c('0x68')]=moment()[_0x533c('0x69')](_0x533c('0x6a'));_0x4bdc46[_0x533c('0x60')][_0x533c('0x6b')]=_0x4bdc46[_0x533c('0x60')][_0x533c('0x6b')]||_0x4bdc46[_0x533c('0x6c')]['id'];return db['SmsMessage'][_0x533c('0x61')]({'where':{'id':_0x4bdc46['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x533c('0x6d')}]})[_0x533c('0x26')](handleEntityNotFound(_0x29c95c,null))[_0x533c('0x26')](saveUpdates(_0x4bdc46[_0x533c('0x60')],null))[_0x533c('0x26')](function(_0x1eaf34){if(_0x1eaf34){_0x8e04c7[_0x533c('0x2d')]=_0x1eaf34['get']({'plain':!![]});return db[_0x533c('0x6e')][_0x533c('0x61')]({'where':{'id':_0x1eaf34['SmsInteractionId']}});}return null;})[_0x533c('0x26')](handleEntityNotFound(_0x29c95c,null))[_0x533c('0x26')](function(_0x8174d0){if(_0x8174d0){return _0x8174d0[_0x533c('0x3c')]({'UserId':_0x4bdc46['body'][_0x533c('0x6b')],'read1stAt':_[_0x533c('0x6f')](_0x8174d0['read1stAt'])?moment()[_0x533c('0x69')](_0x533c('0x6a')):undefined});}return null;})['then'](function(_0x115c70){if(_0x115c70){_0x8e04c7[_0x533c('0x70')]=_0x115c70['get']({'plain':!![]});interaction_log[_0x533c('0x27')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4bdc46['user']['id'],_0x4bdc46[_0x533c('0x6c')][_0x533c('0x3f')],_0x4bdc46[_0x533c('0x6c')][_0x533c('0x71')],_0x8e04c7['interaction']['id'],_0x4bdc46[_0x533c('0x60')]?JSON[_0x533c('0x72')](_0x4bdc46[_0x533c('0x60')]):_0x533c('0x73'));return respondWithRpcPromise(_0x533c('0x74'),'acceptMessage',_0x8e04c7);}return null;})[_0x533c('0x26')](function(_0x4d5ad1){if(_0x4d5ad1){if(_0x4bdc46[_0x533c('0x60')]['manual']){_0x8e04c7[_0x533c('0x2d')]['interface']=util['format']('SIP/%s',_0x4bdc46[_0x533c('0x6c')][_0x533c('0x3f')]);_0x8e04c7[_0x533c('0x2d')]['channel']=_0x8e04c7[_0x533c('0x75')];_0x8e04c7[_0x533c('0x2d')][_0x533c('0x76')]=_0x533c('0x65');return respondWithRpcPromise(_0x533c('0x77'),'EventManager',{'event':'acceptmessage','message':_0x8e04c7[_0x533c('0x2d')]},client9002)[_0x533c('0x26')](function(){return _0x8e04c7;});}return _0x8e04c7;}return null;})[_0x533c('0x26')](respondWithResult(_0x29c95c,null))[_0x533c('0x2f')](handleError(_0x29c95c,null));};var interaction_log=require(_0x533c('0x63'))(_0x533c('0x64'));exports[_0x533c('0x3a')]=function(_0x45f79a,_0x45c4ca,_0x4f0961){var _0x179985={'agent':{},'channel':_0x533c('0x66')};if(_0x45f79a[_0x533c('0x60')]['id']){delete _0x45f79a[_0x533c('0x60')]['id'];}_0x45f79a[_0x533c('0x60')][_0x533c('0x6b')]=_0x45f79a[_0x533c('0x60')][_0x533c('0x6b')]||_0x45f79a[_0x533c('0x6c')]['id'];_0x179985[_0x533c('0x78')]['id']=_0x45f79a[_0x533c('0x60')][_0x533c('0x6b')];return db[_0x533c('0x42')][_0x533c('0x61')]({'where':{'id':_0x45f79a[_0x533c('0x5e')]['id'],'UserId':null}})[_0x533c('0x26')](handleEntityNotFound(_0x45c4ca,null))[_0x533c('0x26')](function(_0x4b1b98){if(_0x4b1b98){_0x179985[_0x533c('0x2d')]=_0x4b1b98[_0x533c('0x79')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x4b1b98[_0x533c('0x7a')]}});}return null;})['then'](handleEntityNotFound(_0x45c4ca,null))[_0x533c('0x26')](function(_0x307fe5){if(_0x307fe5){_0x179985[_0x533c('0x70')]=_0x307fe5[_0x533c('0x79')]({'plain':!![]});interaction_log[_0x533c('0x27')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x45f79a[_0x533c('0x6c')]['id'],_0x45f79a[_0x533c('0x6c')][_0x533c('0x3f')],_0x45f79a[_0x533c('0x6c')][_0x533c('0x71')],_0x179985[_0x533c('0x70')]['id'],_0x45f79a[_0x533c('0x60')]?JSON[_0x533c('0x72')](_0x45f79a[_0x533c('0x60')]):_0x533c('0x73'));return respondWithRpcPromise(_0x533c('0x7b'),_0x533c('0x7c'),_0x179985);}return null;})[_0x533c('0x26')](function(_0x452759){if(_0x452759){_0x452759[_0x533c('0x2d')][_0x533c('0x7d')]=util[_0x533c('0x69')](_0x533c('0x7e'),_0x45f79a['user'][_0x533c('0x3f')]);_0x452759[_0x533c('0x2d')][_0x533c('0x75')]=_0x179985[_0x533c('0x75')];_0x452759['message'][_0x533c('0x76')]=_0x533c('0x3a');respondWithRpcPromise('EventManager',_0x533c('0x77'),{'event':'rejectmessage','message':_0x452759[_0x533c('0x2d')]},client9002);return _0x179985;}return null;})['then'](respondWithResult(_0x45c4ca,null))[_0x533c('0x2f')](handleError(_0x45c4ca,null));};exports[_0x533c('0x31')]=function(_0x3909d2,_0x5c938c,_0x539285){if(_0x3909d2['body']['id']){delete _0x3909d2[_0x533c('0x60')]['id'];}var _0x513beb;return db[_0x533c('0x42')][_0x533c('0x61')]({'where':{'id':_0x3909d2[_0x533c('0x5e')]['id']}})[_0x533c('0x26')](handleEntityNotFound(_0x5c938c,null))['then'](function(_0x56f92d){if(_0x56f92d){_0x513beb=_0x56f92d;return db[_0x533c('0x7f')]['find']({'where':{'id':_0x56f92d[_0x533c('0x80')]}});}})[_0x533c('0x26')](handleEntityNotFound(_0x5c938c,null))[_0x533c('0x26')](function(_0x4cfd36){if(_0x4cfd36){logger[_0x533c('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x533c('0x31'),_0x533c('0x81'),_0x4cfd36['type'],util[_0x533c('0x82')](_0x3909d2[_0x533c('0x60')],{'showHidden':![],'depth':null}));switch(_0x4cfd36[_0x533c('0x52')]){case _0x533c('0x83'):if(_0x3909d2[_0x533c('0x60')][_0x533c('0x84')]&&_0x3909d2['body'][_0x533c('0x84')]===_0x513beb[_0x533c('0x85')]){return _0x513beb[_0x533c('0x3c')]({'read':!![]});}else{logger['error'](_0x533c('0x86'),'status','twilio',util[_0x533c('0x82')](_0x3909d2[_0x533c('0x60')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x3909d2[_0x533c('0x60')][_0x533c('0x87')]&&_0x3909d2[_0x533c('0x60')][_0x533c('0x87')]===_0x513beb[_0x533c('0x85')]&&_[_0x533c('0x88')]([_0x533c('0x89'),_0x533c('0x8a')],_0x3909d2[_0x533c('0x60')][_0x533c('0x8b')])>=0x0){return _0x513beb[_0x533c('0x3c')]({'read':!![]});}else{logger[_0x533c('0x2c')](_0x533c('0x86'),'status',_0x533c('0x8c'),util[_0x533c('0x82')](_0x3909d2[_0x533c('0x60')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x122e2a=_0x3909d2['body'][_0x533c('0x8d')][0x0];if(_0x122e2a[_0x533c('0x31')][_0x533c('0x8e')]==='DELIVERED'){return _0x513beb[_0x533c('0x3c')]({'read':!![]});}else{logger[_0x533c('0x2c')](_0x533c('0x86'),'status','infobip',util[_0x533c('0x82')](_0x3909d2['body'],{'showHidden':![],'depth':null}));}break;}return _0x513beb;}})[_0x533c('0x26')](respondWithResult(_0x5c938c,null))['catch'](handleError(_0x5c938c,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 1396ee6..bf00f6d 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 _0xf057=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x517e81,_0x59a141){var _0x1eec04=function(_0x1a1c9c){while(--_0x1a1c9c){_0x517e81['push'](_0x517e81['shift']());}};_0x1eec04(++_0x59a141);}(_0xf057,0x127));var _0x7f05=function(_0x271dc8,_0x42b87f){_0x271dc8=_0x271dc8-0x0;var _0x138891=_0xf057[_0x271dc8];return _0x138891;};'use strict';var EventEmitter=require(_0x7f05('0x0'));var SmsMessage=require(_0x7f05('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x7f05('0x2')](0x0);var events={'afterCreate':_0x7f05('0x3'),'afterUpdate':_0x7f05('0x4'),'afterDestroy':_0x7f05('0x5')};function emitEvent(_0x1618b1){return function(_0x158e75,_0x59a674,_0x14e99a){SmsMessageEvents[_0x7f05('0x6')](_0x1618b1+':'+_0x158e75['id'],_0x158e75);SmsMessageEvents[_0x7f05('0x6')](_0x1618b1,_0x158e75);_0x14e99a(null);};}for(var e in events){if(events[_0x7f05('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x7f05('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0x0de2=['update','remove','emit','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save'];(function(_0x5b3319,_0x243f0d){var _0x29b1a5=function(_0x3bc684){while(--_0x3bc684){_0x5b3319['push'](_0x5b3319['shift']());}};_0x29b1a5(++_0x243f0d);}(_0x0de2,0x136));var _0x20de=function(_0x246cbe,_0x19305c){_0x246cbe=_0x246cbe-0x0;var _0x855b0=_0x0de2[_0x246cbe];return _0x855b0;};'use strict';var EventEmitter=require(_0x20de('0x0'));var SmsMessage=require(_0x20de('0x1'))['db'][_0x20de('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x20de('0x3')](0x0);var events={'afterCreate':_0x20de('0x4'),'afterUpdate':_0x20de('0x5'),'afterDestroy':_0x20de('0x6')};function emitEvent(_0xa8edaf){return function(_0x2e0175,_0x4053ed,_0x4d1e1c){SmsMessageEvents[_0x20de('0x7')](_0xa8edaf+':'+_0x2e0175['id'],_0x2e0175);SmsMessageEvents[_0x20de('0x7')](_0xa8edaf,_0x2e0175);_0x4d1e1c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x20de('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index cfd7455..1956f16 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 _0xed11=['Basic\x20%s','toString','base64','http_code','data','queued_count','head','messages','message_id','clickSend','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','sort','length','createHash','md5','digest','hex','signature=','GET','https://sms.csc.lv/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','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','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','then','update','error','find','twilio','accountSid','authToken','phone','create','body','remote','/api/sms/messages/','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','password','split','sms','POST','user_key','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send'];(function(_0x24f507,_0x5dab66){var _0x4dd53f=function(_0x1eb5f1){while(--_0x1eb5f1){_0x24f507['push'](_0x24f507['shift']());}};_0x4dd53f(++_0x5dab66);}(_0xed11,0x196));var _0x1ed1=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xed11[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x1ed1('0x0'));var util=require(_0x1ed1('0x1'));var logger=require(_0x1ed1('0x2'))(_0x1ed1('0x3'));var moment=require(_0x1ed1('0x4'));var BPromise=require(_0x1ed1('0x5'));var rp=require(_0x1ed1('0x6'));var fs=require('fs');var path=require(_0x1ed1('0x7'));var rimraf=require(_0x1ed1('0x8'));var config=require('../../config/environment');var attributes=require(_0x1ed1('0x9'));module[_0x1ed1('0xa')]=function(_0x5e096e,_0xa0b9c3){return _0x5e096e[_0x1ed1('0xb')]('SmsMessage',attributes,{'tableName':_0x1ed1('0xc'),'paranoid':![],'indexes':[{'name':_0x1ed1('0xd'),'fields':[_0x1ed1('0xd')]},{'name':_0x1ed1('0xe'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x369ec7,_0x17b868,_0x3075a3){var _0x2abdb2=_0x5e096e[_0x1ed1('0xf')];var _0x5bd841=_0x369ec7[_0x1ed1('0x10')]({'plain':!![]});if(_0x5bd841[_0x1ed1('0x11')][_0x1ed1('0x12')]()==='in'||_0x5bd841['direction'][_0x1ed1('0x12')]()===_0x1ed1('0x13')&&!_0x5bd841[_0x1ed1('0x14')]&&!_[_0x1ed1('0x15')](_0x5bd841[_0x1ed1('0x16')])){_0x2abdb2[_0x1ed1('0x17')][_0x1ed1('0x18')]({'where':{'id':_0x5bd841['SmsInteractionId']}})[_0x1ed1('0x19')](function(_0x27287f){if(_0x27287f){_0x27287f[_0x1ed1('0x1a')]({'lastMsgAt':_0x5bd841['createdAt'],'lastMsgDirection':_0x5bd841[_0x1ed1('0x11')][_0x1ed1('0x12')]()});}})['catch'](function(_0x3f2566){console[_0x1ed1('0x1b')](_0x3f2566);});}if(_0x5bd841['direction']===_0x1ed1('0x13')&&!_0x5bd841[_0x1ed1('0x14')]){var _0x401407;_0x2abdb2['SmsAccount'][_0x1ed1('0x1c')]({'where':{'id':_0x5bd841['SmsAccountId']},'raw':!![]})[_0x1ed1('0x19')](function(_0x390777){_0x401407=_0x390777;if(_0x401407&&_0x401407['type']){switch(_0x401407['type']){case _0x1ed1('0x1d'):var _0x132f95=require('twilio');if(_0x401407[_0x1ed1('0x1e')]&&_0x401407[_0x1ed1('0x1f')]&&_0x401407[_0x1ed1('0x20')]){var _0x143675=new _0x132f95(_0x401407[_0x1ed1('0x1e')],_0x401407['authToken']);_0x143675['messages'][_0x1ed1('0x21')]({'body':_0x5bd841[_0x1ed1('0x22')],'to':_0x5bd841['phone'],'from':_0x401407[_0x1ed1('0x20')],'statusCallback':_0x401407[_0x1ed1('0x23')]+_0x1ed1('0x24')+_0x5bd841['id']+_0x1ed1('0x25')+_0x401407[_0x1ed1('0x26')]})[_0x1ed1('0x19')](function(_0x4cd5ee){if(_0x4cd5ee[_0x1ed1('0x27')]){return _0x369ec7[_0x1ed1('0x1a')]({'messageId':_0x4cd5ee[_0x1ed1('0x27')]});}})[_0x1ed1('0x28')](function(_0x7e8a43){logger['error'](_0x1ed1('0x29'),'afterCreate','twilio',util[_0x1ed1('0x2a')](_0x7e8a43,{'showHidden':![],'depth':null}));});}else{logger[_0x1ed1('0x1b')](_0x1ed1('0x29'),_0x1ed1('0x2b'),_0x1ed1('0x1d'),_0x1ed1('0x2c'));}break;case _0x1ed1('0x2d'):var _0xc1a753=_0x1ed1('0x2e');if(_0x401407[_0x1ed1('0x2f')]&&_0x401407['password']){var _0x18805b={'recipient':[_0x5bd841[_0x1ed1('0x20')]],'message':_0x5bd841[_0x1ed1('0x22')],'message_type':_0x401407['smsMethod']};if(_0x401407['smsMethod']&&_0x401407[_0x1ed1('0x30')]!=='SI'){_0x18805b[_0x1ed1('0x31')]=_0x401407[_0x1ed1('0x20')];}var _0x2ae3d6={'url':_0xc1a753+_0x1ed1('0x32')+_0x401407[_0x1ed1('0x2f')]+'&password='+_0x401407[_0x1ed1('0x33')],'method':'GET'};rp(_0x2ae3d6)[_0x1ed1('0x19')](function(_0x1ead1a){var _0x1ef934=_0x1ead1a[_0x1ed1('0x34')](';');var _0x462d16={'user_key':_0x1ef934[0x0],'session_key':_0x1ef934[0x1]};_0x2ae3d6={'url':_0xc1a753+_0x1ed1('0x35'),'method':_0x1ed1('0x36'),'headers':{'user_key':_0x462d16[_0x1ed1('0x37')],'Session_key':_0x462d16['session_key']},'json':!![],'body':_0x18805b};return rp(_0x2ae3d6);})[_0x1ed1('0x19')](function(_0x357607){if(_0x357607[_0x1ed1('0x38')]>=0x1){var _0x4163a4={'messageId':_0x357607['internal_order_id']};if(_0x401407[_0x1ed1('0x30')]!=='GP'||!_0x401407[_0x1ed1('0x39')]){_0x4163a4[_0x1ed1('0x3a')]=!![];}return _0x369ec7[_0x1ed1('0x1a')](_0x4163a4);}else{return logger[_0x1ed1('0x1b')](_0x1ed1('0x29'),_0x1ed1('0x2b'),_0x1ed1('0x2d'),util[_0x1ed1('0x2a')](_0x357607,{'showHidden':![],'depth':null}));}})[_0x1ed1('0x28')](function(_0x5aa56d){return logger[_0x1ed1('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1ed1('0x2b'),'skebby',util[_0x1ed1('0x2a')](_0x5aa56d,{'showHidden':![],'depth':null}));});}else{logger[_0x1ed1('0x1b')](_0x1ed1('0x29'),_0x1ed1('0x2b'),_0x1ed1('0x2d'),_0x1ed1('0x3b'));}break;case _0x1ed1('0x3c'):if(_0x401407['authToken']){var _0x4a15c7={'recipient':_0x5bd841[_0x1ed1('0x20')],'message':_0x5bd841[_0x1ed1('0x22')],'sender':_0x401407[_0x1ed1('0x3d')]||_0x401407[_0x1ed1('0x20')],'authorization':_0x401407[_0x1ed1('0x1f')]};var _0x17b868={'method':_0x1ed1('0x36'),'uri':'https://smsapi.connectel.se/api/send/','body':_0x4a15c7,'json':!![]};rp(_0x17b868)[_0x1ed1('0x19')](function(_0x24a3cd){var _0x6ffc46={'messageId':_0x24a3cd['requestid']};if(!_0x401407[_0x1ed1('0x39')]){_0x6ffc46[_0x1ed1('0x3a')]=!![];}return _0x369ec7['update'](_0x6ffc46);})['catch'](function(_0x47592a){logger['error'](_0x1ed1('0x29'),'afterCreate','connectel',util['inspect'](_0x47592a,{'showHidden':![],'depth':null}));});}else{logger[_0x1ed1('0x1b')](_0x1ed1('0x29'),_0x1ed1('0x2b'),_0x1ed1('0x3c'),'Missing\x20parameters:\x20authToken');}break;case _0x1ed1('0x3e'):if(_0x401407[_0x1ed1('0x2f')]&&_0x401407['password']){var _0x4a15c7={'messages':[{'source':_0x1ed1('0x3f'),'to':_0x5bd841['phone'],'body':_0x5bd841['body'],'from':_0x401407[_0x1ed1('0x3d')]||_0x401407['phone']}]};var _0x1ef821=util[_0x1ed1('0x40')]('%s:%s',_0x401407[_0x1ed1('0x2f')],_0x401407[_0x1ed1('0x33')]);var _0x17b868={'method':'POST','uri':_0x1ed1('0x41'),'body':_0x4a15c7,'headers':{'Authorization':util['format'](_0x1ed1('0x42'),new Buffer(_0x1ef821)[_0x1ed1('0x43')](_0x1ed1('0x44')))},'json':!![]};rp(_0x17b868)['then'](function(_0x199535){if(_0x199535[_0x1ed1('0x45')]>=0xc8&&_0x199535[_0x1ed1('0x45')]<=0xce){if(_0x199535[_0x1ed1('0x46')]&&_0x199535['data'][_0x1ed1('0x47')]>0x0){var _0xc94af3=_[_0x1ed1('0x48')](_0x199535['data'][_0x1ed1('0x49')]);var _0x2c0650={'messageId':_0xc94af3[_0x1ed1('0x4a')]};if(!_0x401407[_0x1ed1('0x39')]){_0x2c0650[_0x1ed1('0x3a')]=!![];}return _0x369ec7[_0x1ed1('0x1a')](_0x2c0650);}else{logger[_0x1ed1('0x1b')](_0x1ed1('0x29'),'afterCreate',_0x1ed1('0x4b'),util[_0x1ed1('0x2a')](_0x199535,{'showHidden':![],'depth':null}));}}else{logger[_0x1ed1('0x1b')](_0x1ed1('0x29'),_0x1ed1('0x2b'),_0x1ed1('0x4b'),util[_0x1ed1('0x2a')](_0x199535,{'showHidden':![],'depth':null}));}})[_0x1ed1('0x28')](function(_0x2c0f88){logger[_0x1ed1('0x1b')](_0x1ed1('0x29'),'afterCreate',_0x1ed1('0x4b'),util['inspect'](_0x2c0f88,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x1ed1('0x29'),_0x1ed1('0x2b'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x401407[_0x1ed1('0x4c')]&&_0x401407[_0x1ed1('0x1f')]){var _0x4a15c7={'dst':_0x5bd841[_0x1ed1('0x20')],'text':_0x5bd841[_0x1ed1('0x22')],'src':_0x401407[_0x1ed1('0x3d')]||_0x401407[_0x1ed1('0x20')],'url':_0x401407[_0x1ed1('0x23')]+_0x1ed1('0x24')+_0x5bd841['id']+'/status?token='+_0x401407[_0x1ed1('0x26')]};var _0x1ef821=util[_0x1ed1('0x40')](_0x1ed1('0x4d'),_0x401407['authId'],_0x401407[_0x1ed1('0x1f')]);var _0x17b868={'method':_0x1ed1('0x36'),'uri':util[_0x1ed1('0x40')](_0x1ed1('0x4e'),_0x401407[_0x1ed1('0x4c')]),'body':_0x4a15c7,'headers':{'Authorization':util[_0x1ed1('0x40')](_0x1ed1('0x42'),new Buffer(_0x1ef821)[_0x1ed1('0x43')]('base64'))},'json':!![]};rp(_0x17b868)[_0x1ed1('0x19')](function(_0x113080){var _0x4f9211={'messageId':_0x113080[_0x1ed1('0x4f')][0x0]};return _0x369ec7['update'](_0x4f9211);})[_0x1ed1('0x28')](function(_0x55857a){logger[_0x1ed1('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1ed1('0x2b'),'plivo',util[_0x1ed1('0x2a')](_0x55857a,{'showHidden':![],'depth':null}));});}else{logger[_0x1ed1('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1ed1('0x2b'),_0x1ed1('0x50'),_0x1ed1('0x51'));}break;case _0x1ed1('0x52'):if(_0x401407['username']&&_0x401407[_0x1ed1('0x33')]){if(_0x401407['baseUrl']){var _0x4b7ea2={'method':_0x1ed1('0x36'),'uri':_0x401407[_0x1ed1('0x53')]+'/auth/1/session','body':{'username':_0x401407[_0x1ed1('0x2f')],'password':_0x401407[_0x1ed1('0x33')]},'json':!![]};return rp(_0x4b7ea2)['then'](function(_0xa56f9b){var _0xef86ed={'method':'POST','uri':_0x401407[_0x1ed1('0x53')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x401407['phone'],'destinations':[{'to':_0x5bd841[_0x1ed1('0x20')]}],'text':_0x5bd841[_0x1ed1('0x22')],'notifyUrl':_0x401407[_0x1ed1('0x23')]+'/api/sms/messages/'+_0x5bd841['id']+_0x1ed1('0x25')+_0x401407['token'],'notifyContentType':_0x1ed1('0x54'),'callbackData':_0x401407[_0x1ed1('0x20')]+';'+_0x5bd841[_0x1ed1('0x22')]}]},'headers':{'Authorization':_0x1ed1('0x55')+_0xa56f9b[_0x1ed1('0x26')]},'json':!![]};return rp(_0xef86ed)['then'](function(_0x2808b8){if(_0x2808b8[_0x1ed1('0x49')]){var _0x5a585={'messageId':_0x2808b8['messages'][0x0][_0x1ed1('0xd')]};if(!_0x401407[_0x1ed1('0x39')]){_0x5a585[_0x1ed1('0x3a')]=!![];}return _0x369ec7[_0x1ed1('0x1a')](_0x5a585);}else{return logger[_0x1ed1('0x1b')](_0x1ed1('0x29'),_0x1ed1('0x2b'),'infobip',util[_0x1ed1('0x2a')](_0x2808b8,{'showHidden':![],'depth':null}));}});})[_0x1ed1('0x28')](function(_0x3b6c43){return logger[_0x1ed1('0x1b')](_0x1ed1('0x29'),_0x1ed1('0x2b'),_0x1ed1('0x52'),util[_0x1ed1('0x2a')](_0x3b6c43,{'showHidden':![],'depth':null}));});}else{logger[_0x1ed1('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1ed1('0x2b'),'infobip',_0x1ed1('0x56'));}}else{logger[_0x1ed1('0x1b')](_0x1ed1('0x29'),_0x1ed1('0x2b'),_0x1ed1('0x52'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x1ed1('0x57'):var _0x5ab168=require(_0x1ed1('0x58'));if(_0x401407[_0x1ed1('0x59')]){var _0x106437={};_0x106437['login']=_0x401407[_0x1ed1('0x2f')];_0x106437[_0x1ed1('0x20')]=_0x5bd841[_0x1ed1('0x20')];_0x106437[_0x1ed1('0x31')]=_0x401407['phone'];_0x106437[_0x1ed1('0x5a')]=_0x5bd841[_0x1ed1('0x22')];_0x106437['timestamp']=+new Date();var _0x5f278d='';var _0x37ce1b='';var _0x3a0b2e=Object['keys'](_0x106437);_0x3a0b2e[_0x1ed1('0x5b')]();for(var _0x520830=0x0;_0x520830<_0x3a0b2e[_0x1ed1('0x5c')];_0x520830++){if(_0x5f278d!=''){_0x5f278d+='&';}_0x5f278d+=_0x3a0b2e[_0x520830]+'='+encodeURIComponent(_0x106437[_0x3a0b2e[_0x520830]]);_0x37ce1b+=_0x106437[_0x3a0b2e[_0x520830]];}_0x37ce1b+=_0x401407[_0x1ed1('0x59')];_0x37ce1b=_0x5ab168[_0x1ed1('0x5d')](_0x1ed1('0x5e'))[_0x1ed1('0x1a')](_0x37ce1b)[_0x1ed1('0x5f')](_0x1ed1('0x60'));if(_0x5f278d!==''){_0x5f278d+='&';}_0x5f278d+=_0x1ed1('0x61')+_0x37ce1b;var _0x2ae3d6={'method':_0x1ed1('0x62'),'uri':_0x1ed1('0x63')+_0x5f278d,'json':!![]};return rp(_0x2ae3d6)['then'](function(_0x4126d1){var _0x2017c5=Object['keys'](_0x4126d1);if(_0x4126d1[_0x2017c5[0x0]][_0x1ed1('0x1b')]&&parseInt(_0x4126d1[_0x2017c5[0x0]][_0x1ed1('0x1b')])===0x0){var _0x155e88={'messageId':_0x4126d1[_0x2017c5[0x0]][_0x1ed1('0x64')]};if(!_0x401407[_0x1ed1('0x39')]){_0x155e88[_0x1ed1('0x3a')]=!![];}return _0x369ec7[_0x1ed1('0x1a')](_0x155e88);}else{return logger[_0x1ed1('0x1b')](_0x1ed1('0x29'),_0x1ed1('0x2b'),_0x1ed1('0x57'),util['inspect'](_0x4126d1['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x2cc6dc){return logger[_0x1ed1('0x1b')](_0x1ed1('0x29'),_0x1ed1('0x2b'),'csc',util[_0x1ed1('0x2a')](_0x2cc6dc,{'showHidden':![],'depth':null}));});}else{logger[_0x1ed1('0x1b')](_0x1ed1('0x29'),_0x1ed1('0x2b'),_0x1ed1('0x57'),_0x1ed1('0x65'));}break;case _0x1ed1('0x66'):if(_0x401407[_0x1ed1('0x59')]){var _0x5f9f46={'method':'POST','uri':_0x1ed1('0x67'),'headers':{'Authorization':_0x401407[_0x1ed1('0x59')]},'body':{'content':_0x5bd841[_0x1ed1('0x22')],'to':[_0x5bd841['phone']],'from':_0x401407[_0x1ed1('0x20')],'binary':![],'clientMessageId':_0x1ed1('0x68'),'charset':'UTF-8'},'json':!![]};rp(_0x5f9f46)[_0x1ed1('0x19')](function(_0x116dee){if(!_0x116dee[_0x1ed1('0x1b')]){var _0x15dc72={'messageId':_0x116dee[_0x1ed1('0x49')][0x0][_0x1ed1('0x69')]};if(!_0x401407[_0x1ed1('0x39')]){_0x15dc72[_0x1ed1('0x3a')]=!![];}return _0x369ec7['update'](_0x15dc72);}else{return logger[_0x1ed1('0x1b')](_0x1ed1('0x29'),_0x1ed1('0x2b'),'clickatell',util[_0x1ed1('0x2a')](_0x116dee[_0x1ed1('0x1b')],{'showHidden':![],'depth':null}));}})[_0x1ed1('0x28')](function(_0x2cf39e){return logger[_0x1ed1('0x1b')](_0x1ed1('0x29'),'afterCreate',_0x1ed1('0x66'),util[_0x1ed1('0x2a')](_0x2cf39e,{'showHidden':![],'depth':null}));});}else{logger[_0x1ed1('0x1b')](_0x1ed1('0x29'),'afterCreate',_0x1ed1('0x66'),_0x1ed1('0x65'));}break;case _0x1ed1('0x6a'):if(_0x401407[_0x1ed1('0x59')]){var _0x2186e7={};var _0x2ae3d6={'method':_0x1ed1('0x36'),'uri':_0x1ed1('0x6b'),'headers':{'Authorization':_0x1ed1('0x6c')+_0x401407[_0x1ed1('0x59')],'Content-Type':_0x1ed1('0x54')},'body':{'from':_0x401407[_0x1ed1('0x20')],'to':_0x5bd841['phone'],'text':_0x5bd841[_0x1ed1('0x22')]},'json':!![]};return rp(_0x2ae3d6)[_0x1ed1('0x19')](function(_0x3242c9){if(_0x3242c9[_0x1ed1('0x6d')]==0xca){_0x2186e7[_0x1ed1('0x6e')]=_0x3242c9;var _0x32d78c={'method':_0x1ed1('0x36'),'uri':_0x1ed1('0x6f'),'headers':{'Authorization':_0x1ed1('0x6c')+_0x401407[_0x1ed1('0x59')],'Content-Type':_0x1ed1('0x54')},'body':{'refid':_0x2186e7[_0x1ed1('0x6e')][_0x1ed1('0x70')]},'json':!![]};return rp(_0x32d78c)[_0x1ed1('0x19')](function(_0xffa4fc){_0x2186e7[_0x1ed1('0x71')]=_0xffa4fc;var _0x18ac23={'messageId':_0x2186e7['message'][_0x1ed1('0x70')],'read':!![]};return _0x369ec7[_0x1ed1('0x1a')](_0x18ac23);});}else{return logger[_0x1ed1('0x1b')](_0x1ed1('0x29'),_0x1ed1('0x2b'),_0x1ed1('0x6a'),util[_0x1ed1('0x2a')](_0x3242c9,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2aa7ce){return logger[_0x1ed1('0x1b')](_0x1ed1('0x29'),'afterCreate',_0x1ed1('0x6a'),util['inspect'](_0x2aa7ce,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x1ed1('0x29'),_0x1ed1('0x2b'),_0x1ed1('0x6a'),_0x1ed1('0x72'));}break;}}})[_0x1ed1('0x73')](function(){_0x3075a3();});}else{_0x3075a3();}}},'charset':_0x1ed1('0x74'),'collate':_0x1ed1('0x75')});}; \ No newline at end of file +var _0xbabf=['sort','length','digest','https://sms.csc.lv/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','status','refid','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','SmsMessage','sms_messages','messageId','body','toLowerCase','direction','out','secret','UserId','SmsInteraction','SmsInteractionId','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','authToken','accountSid','messages','phone','remote','/api/sms/messages/','/status?token=','token','then','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','login?username=','&password=','password','GET','POST','user_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/send/','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','http_code','data','queued_count','head','message_id','clickSend','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','csc','crypto','apiKey','sender','text','timestamp'];(function(_0x33145c,_0x194fbc){var _0x5052c5=function(_0x47b7fa){while(--_0x47b7fa){_0x33145c['push'](_0x33145c['shift']());}};_0x5052c5(++_0x194fbc);}(_0xbabf,0x87));var _0xfbab=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xbabf[_0x2f1762];return _0x8ab21;};'use strict';var _=require(_0xfbab('0x0'));var util=require(_0xfbab('0x1'));var logger=require('../../config/logger')(_0xfbab('0x2'));var moment=require(_0xfbab('0x3'));var BPromise=require(_0xfbab('0x4'));var rp=require(_0xfbab('0x5'));var fs=require('fs');var path=require(_0xfbab('0x6'));var rimraf=require(_0xfbab('0x7'));var config=require(_0xfbab('0x8'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x148ca6,_0x246210){return _0x148ca6[_0xfbab('0x9')](_0xfbab('0xa'),attributes,{'tableName':_0xfbab('0xb'),'paranoid':![],'indexes':[{'name':_0xfbab('0xc'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0xfbab('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2db560,_0x5a4fe2,_0x3150c5){var _0x391024=_0x148ca6['models'];var _0x22ff34=_0x2db560['get']({'plain':!![]});if(_0x22ff34['direction'][_0xfbab('0xe')]()==='in'||_0x22ff34[_0xfbab('0xf')][_0xfbab('0xe')]()===_0xfbab('0x10')&&!_0x22ff34[_0xfbab('0x11')]&&!_['isNil'](_0x22ff34[_0xfbab('0x12')])){_0x391024[_0xfbab('0x13')]['findOne']({'where':{'id':_0x22ff34[_0xfbab('0x14')]}})['then'](function(_0x877f29){if(_0x877f29){_0x877f29[_0xfbab('0x15')]({'lastMsgAt':_0x22ff34[_0xfbab('0x16')],'lastMsgDirection':_0x22ff34[_0xfbab('0xf')][_0xfbab('0xe')]()});}})[_0xfbab('0x17')](function(_0x574833){console[_0xfbab('0x18')](_0x574833);});}if(_0x22ff34['direction']==='out'&&!_0x22ff34['secret']){var _0x591dc1;_0x391024[_0xfbab('0x19')][_0xfbab('0x1a')]({'where':{'id':_0x22ff34[_0xfbab('0x1b')]},'raw':!![]})['then'](function(_0x3ed1a7){_0x591dc1=_0x3ed1a7;if(_0x591dc1&&_0x591dc1[_0xfbab('0x1c')]){switch(_0x591dc1[_0xfbab('0x1c')]){case'twilio':var _0x579152=require('twilio');if(_0x591dc1['accountSid']&&_0x591dc1[_0xfbab('0x1d')]&&_0x591dc1['phone']){var _0x527c0e=new _0x579152(_0x591dc1[_0xfbab('0x1e')],_0x591dc1[_0xfbab('0x1d')]);_0x527c0e[_0xfbab('0x1f')]['create']({'body':_0x22ff34['body'],'to':_0x22ff34['phone'],'from':_0x591dc1[_0xfbab('0x20')],'statusCallback':_0x591dc1[_0xfbab('0x21')]+_0xfbab('0x22')+_0x22ff34['id']+_0xfbab('0x23')+_0x591dc1[_0xfbab('0x24')]})[_0xfbab('0x25')](function(_0x17884a){if(_0x17884a['sid']){return _0x2db560[_0xfbab('0x15')]({'messageId':_0x17884a[_0xfbab('0x26')]});}})['catch'](function(_0x42aa18){logger[_0xfbab('0x18')](_0xfbab('0x27'),_0xfbab('0x28'),'twilio',util[_0xfbab('0x29')](_0x42aa18,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfbab('0x27'),_0xfbab('0x28'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xfbab('0x2a'):var _0x202293=_0xfbab('0x2b');if(_0x591dc1[_0xfbab('0x2c')]&&_0x591dc1['password']){var _0x2795a0={'recipient':[_0x22ff34[_0xfbab('0x20')]],'message':_0x22ff34[_0xfbab('0xd')],'message_type':_0x591dc1[_0xfbab('0x2d')]};if(_0x591dc1[_0xfbab('0x2d')]&&_0x591dc1[_0xfbab('0x2d')]!=='SI'){_0x2795a0['sender']=_0x591dc1[_0xfbab('0x20')];}var _0x4f67d8={'url':_0x202293+_0xfbab('0x2e')+_0x591dc1[_0xfbab('0x2c')]+_0xfbab('0x2f')+_0x591dc1[_0xfbab('0x30')],'method':_0xfbab('0x31')};rp(_0x4f67d8)[_0xfbab('0x25')](function(_0x45e83f){var _0x25cb80=_0x45e83f['split'](';');var _0x3249cb={'user_key':_0x25cb80[0x0],'session_key':_0x25cb80[0x1]};_0x4f67d8={'url':_0x202293+'sms','method':_0xfbab('0x32'),'headers':{'user_key':_0x3249cb[_0xfbab('0x33')],'Session_key':_0x3249cb['session_key']},'json':!![],'body':_0x2795a0};return rp(_0x4f67d8);})['then'](function(_0x5df00e){if(_0x5df00e[_0xfbab('0x34')]>=0x1){var _0x5dbeac={'messageId':_0x5df00e[_0xfbab('0x35')]};if(_0x591dc1['smsMethod']!=='GP'||!_0x591dc1[_0xfbab('0x36')]){_0x5dbeac[_0xfbab('0x37')]=!![];}return _0x2db560[_0xfbab('0x15')](_0x5dbeac);}else{return logger['error'](_0xfbab('0x27'),_0xfbab('0x28'),_0xfbab('0x2a'),util['inspect'](_0x5df00e,{'showHidden':![],'depth':null}));}})[_0xfbab('0x17')](function(_0x6a28ff){return logger[_0xfbab('0x18')](_0xfbab('0x27'),_0xfbab('0x28'),_0xfbab('0x2a'),util[_0xfbab('0x29')](_0x6a28ff,{'showHidden':![],'depth':null}));});}else{logger[_0xfbab('0x18')](_0xfbab('0x27'),'afterCreate',_0xfbab('0x2a'),_0xfbab('0x38'));}break;case _0xfbab('0x39'):if(_0x591dc1['authToken']){var _0x2df191={'recipient':_0x22ff34['phone'],'message':_0x22ff34[_0xfbab('0xd')],'sender':_0x591dc1['senderString']||_0x591dc1[_0xfbab('0x20')],'authorization':_0x591dc1[_0xfbab('0x1d')]};var _0x5a4fe2={'method':_0xfbab('0x32'),'uri':_0xfbab('0x3a'),'body':_0x2df191,'json':!![]};rp(_0x5a4fe2)[_0xfbab('0x25')](function(_0x587db0){var _0xe8b8a7={'messageId':_0x587db0[_0xfbab('0x3b')]};if(!_0x591dc1[_0xfbab('0x36')]){_0xe8b8a7[_0xfbab('0x37')]=!![];}return _0x2db560[_0xfbab('0x15')](_0xe8b8a7);})[_0xfbab('0x17')](function(_0x244a7c){logger[_0xfbab('0x18')](_0xfbab('0x27'),_0xfbab('0x28'),'connectel',util[_0xfbab('0x29')](_0x244a7c,{'showHidden':![],'depth':null}));});}else{logger[_0xfbab('0x18')](_0xfbab('0x27'),_0xfbab('0x28'),_0xfbab('0x39'),_0xfbab('0x3c'));}break;case'clicksend':if(_0x591dc1['username']&&_0x591dc1[_0xfbab('0x30')]){var _0x2df191={'messages':[{'source':_0xfbab('0x3d'),'to':_0x22ff34[_0xfbab('0x20')],'body':_0x22ff34[_0xfbab('0xd')],'from':_0x591dc1['senderString']||_0x591dc1[_0xfbab('0x20')]}]};var _0x36d4d7=util[_0xfbab('0x3e')](_0xfbab('0x3f'),_0x591dc1[_0xfbab('0x2c')],_0x591dc1[_0xfbab('0x30')]);var _0x5a4fe2={'method':'POST','uri':_0xfbab('0x40'),'body':_0x2df191,'headers':{'Authorization':util[_0xfbab('0x3e')]('Basic\x20%s',new Buffer(_0x36d4d7)[_0xfbab('0x41')]('base64'))},'json':!![]};rp(_0x5a4fe2)[_0xfbab('0x25')](function(_0x35e81b){if(_0x35e81b['http_code']>=0xc8&&_0x35e81b[_0xfbab('0x42')]<=0xce){if(_0x35e81b[_0xfbab('0x43')]&&_0x35e81b[_0xfbab('0x43')][_0xfbab('0x44')]>0x0){var _0x4c59ad=_[_0xfbab('0x45')](_0x35e81b[_0xfbab('0x43')][_0xfbab('0x1f')]);var _0x1cda59={'messageId':_0x4c59ad[_0xfbab('0x46')]};if(!_0x591dc1[_0xfbab('0x36')]){_0x1cda59[_0xfbab('0x37')]=!![];}return _0x2db560[_0xfbab('0x15')](_0x1cda59);}else{logger[_0xfbab('0x18')](_0xfbab('0x27'),'afterCreate',_0xfbab('0x47'),util[_0xfbab('0x29')](_0x35e81b,{'showHidden':![],'depth':null}));}}else{logger[_0xfbab('0x18')](_0xfbab('0x27'),'afterCreate',_0xfbab('0x47'),util[_0xfbab('0x29')](_0x35e81b,{'showHidden':![],'depth':null}));}})[_0xfbab('0x17')](function(_0x23c207){logger[_0xfbab('0x18')](_0xfbab('0x27'),_0xfbab('0x28'),_0xfbab('0x47'),util['inspect'](_0x23c207,{'showHidden':![],'depth':null}));});}else{logger[_0xfbab('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfbab('0x28'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x591dc1[_0xfbab('0x48')]&&_0x591dc1['authToken']){var _0x2df191={'dst':_0x22ff34[_0xfbab('0x20')],'text':_0x22ff34['body'],'src':_0x591dc1['senderString']||_0x591dc1['phone'],'url':_0x591dc1['remote']+_0xfbab('0x22')+_0x22ff34['id']+_0xfbab('0x23')+_0x591dc1[_0xfbab('0x24')]};var _0x36d4d7=util[_0xfbab('0x3e')]('%s:%s',_0x591dc1[_0xfbab('0x48')],_0x591dc1[_0xfbab('0x1d')]);var _0x5a4fe2={'method':_0xfbab('0x32'),'uri':util[_0xfbab('0x3e')](_0xfbab('0x49'),_0x591dc1[_0xfbab('0x48')]),'body':_0x2df191,'headers':{'Authorization':util[_0xfbab('0x3e')](_0xfbab('0x4a'),new Buffer(_0x36d4d7)[_0xfbab('0x41')]('base64'))},'json':!![]};rp(_0x5a4fe2)[_0xfbab('0x25')](function(_0xa9165c){var _0x5d1eaa={'messageId':_0xa9165c[_0xfbab('0x4b')][0x0]};return _0x2db560['update'](_0x5d1eaa);})[_0xfbab('0x17')](function(_0x372ea4){logger[_0xfbab('0x18')](_0xfbab('0x27'),_0xfbab('0x28'),'plivo',util[_0xfbab('0x29')](_0x372ea4,{'showHidden':![],'depth':null}));});}else{logger[_0xfbab('0x18')](_0xfbab('0x27'),'afterCreate',_0xfbab('0x4c'),_0xfbab('0x4d'));}break;case _0xfbab('0x4e'):if(_0x591dc1[_0xfbab('0x2c')]&&_0x591dc1['password']){if(_0x591dc1[_0xfbab('0x4f')]){var _0x502c9f={'method':'POST','uri':_0x591dc1[_0xfbab('0x4f')]+_0xfbab('0x50'),'body':{'username':_0x591dc1[_0xfbab('0x2c')],'password':_0x591dc1[_0xfbab('0x30')]},'json':!![]};return rp(_0x502c9f)[_0xfbab('0x25')](function(_0x384f23){var _0x45fdcf={'method':_0xfbab('0x32'),'uri':_0x591dc1[_0xfbab('0x4f')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x591dc1['phone'],'destinations':[{'to':_0x22ff34['phone']}],'text':_0x22ff34[_0xfbab('0xd')],'notifyUrl':_0x591dc1[_0xfbab('0x21')]+_0xfbab('0x22')+_0x22ff34['id']+_0xfbab('0x23')+_0x591dc1[_0xfbab('0x24')],'notifyContentType':_0xfbab('0x51'),'callbackData':_0x591dc1[_0xfbab('0x20')]+';'+_0x22ff34[_0xfbab('0xd')]}]},'headers':{'Authorization':_0xfbab('0x52')+_0x384f23['token']},'json':!![]};return rp(_0x45fdcf)[_0xfbab('0x25')](function(_0x208536){if(_0x208536['messages']){var _0x471dda={'messageId':_0x208536[_0xfbab('0x1f')][0x0][_0xfbab('0xc')]};if(!_0x591dc1[_0xfbab('0x36')]){_0x471dda[_0xfbab('0x37')]=!![];}return _0x2db560[_0xfbab('0x15')](_0x471dda);}else{return logger[_0xfbab('0x18')](_0xfbab('0x27'),_0xfbab('0x28'),'infobip',util[_0xfbab('0x29')](_0x208536,{'showHidden':![],'depth':null}));}});})[_0xfbab('0x17')](function(_0x3a616a){return logger[_0xfbab('0x18')](_0xfbab('0x27'),_0xfbab('0x28'),_0xfbab('0x4e'),util['inspect'](_0x3a616a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfbab('0x27'),_0xfbab('0x28'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0xfbab('0x18')](_0xfbab('0x27'),_0xfbab('0x28'),_0xfbab('0x4e'),_0xfbab('0x38'));}break;case _0xfbab('0x53'):var _0x1fe759=require(_0xfbab('0x54'));if(_0x591dc1[_0xfbab('0x55')]){var _0x1d065f={};_0x1d065f['login']=_0x591dc1[_0xfbab('0x2c')];_0x1d065f[_0xfbab('0x20')]=_0x22ff34[_0xfbab('0x20')];_0x1d065f[_0xfbab('0x56')]=_0x591dc1[_0xfbab('0x20')];_0x1d065f[_0xfbab('0x57')]=_0x22ff34[_0xfbab('0xd')];_0x1d065f[_0xfbab('0x58')]=+new Date();var _0x253b81='';var _0x4daeb9='';var _0x142454=Object['keys'](_0x1d065f);_0x142454[_0xfbab('0x59')]();for(var _0x54760b=0x0;_0x54760b<_0x142454[_0xfbab('0x5a')];_0x54760b++){if(_0x253b81!=''){_0x253b81+='&';}_0x253b81+=_0x142454[_0x54760b]+'='+encodeURIComponent(_0x1d065f[_0x142454[_0x54760b]]);_0x4daeb9+=_0x1d065f[_0x142454[_0x54760b]];}_0x4daeb9+=_0x591dc1[_0xfbab('0x55')];_0x4daeb9=_0x1fe759['createHash']('md5')[_0xfbab('0x15')](_0x4daeb9)[_0xfbab('0x5b')]('hex');if(_0x253b81!==''){_0x253b81+='&';}_0x253b81+='signature='+_0x4daeb9;var _0x4f67d8={'method':_0xfbab('0x31'),'uri':_0xfbab('0x5c')+_0x253b81,'json':!![]};return rp(_0x4f67d8)['then'](function(_0xff972e){var _0x270557=Object[_0xfbab('0x5d')](_0xff972e);if(_0xff972e[_0x270557[0x0]]['error']&&parseInt(_0xff972e[_0x270557[0x0]][_0xfbab('0x18')])===0x0){var _0x5df2d9={'messageId':_0xff972e[_0x270557[0x0]][_0xfbab('0x5e')]};if(!_0x591dc1[_0xfbab('0x36')]){_0x5df2d9[_0xfbab('0x37')]=!![];}return _0x2db560[_0xfbab('0x15')](_0x5df2d9);}else{return logger[_0xfbab('0x18')](_0xfbab('0x27'),_0xfbab('0x28'),_0xfbab('0x53'),util['inspect'](_0xff972e['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x18776c){return logger['error'](_0xfbab('0x27'),_0xfbab('0x28'),_0xfbab('0x53'),util['inspect'](_0x18776c,{'showHidden':![],'depth':null}));});}else{logger[_0xfbab('0x18')](_0xfbab('0x27'),_0xfbab('0x28'),_0xfbab('0x53'),_0xfbab('0x5f'));}break;case _0xfbab('0x60'):if(_0x591dc1[_0xfbab('0x55')]){var _0xd59406={'method':'POST','uri':_0xfbab('0x61'),'headers':{'Authorization':_0x591dc1[_0xfbab('0x55')]},'body':{'content':_0x22ff34[_0xfbab('0xd')],'to':[_0x22ff34['phone']],'from':_0x591dc1[_0xfbab('0x20')],'binary':![],'clientMessageId':_0xfbab('0x62'),'charset':_0xfbab('0x63')},'json':!![]};rp(_0xd59406)[_0xfbab('0x25')](function(_0x3c5162){if(!_0x3c5162[_0xfbab('0x18')]){var _0x2d5a58={'messageId':_0x3c5162[_0xfbab('0x1f')][0x0][_0xfbab('0x64')]};if(!_0x591dc1[_0xfbab('0x36')]){_0x2d5a58['read']=!![];}return _0x2db560[_0xfbab('0x15')](_0x2d5a58);}else{return logger[_0xfbab('0x18')](_0xfbab('0x27'),'afterCreate',_0xfbab('0x60'),util[_0xfbab('0x29')](_0x3c5162[_0xfbab('0x18')],{'showHidden':![],'depth':null}));}})[_0xfbab('0x17')](function(_0x1410f5){return logger[_0xfbab('0x18')](_0xfbab('0x27'),_0xfbab('0x28'),_0xfbab('0x60'),util[_0xfbab('0x29')](_0x1410f5,{'showHidden':![],'depth':null}));});}else{logger[_0xfbab('0x18')](_0xfbab('0x27'),_0xfbab('0x28'),_0xfbab('0x60'),'Missing\x20parameters:\x20apiKey');}break;case _0xfbab('0x65'):if(_0x591dc1[_0xfbab('0x55')]){var _0x3bb366={};var _0x4f67d8={'method':'POST','uri':_0xfbab('0x66'),'headers':{'Authorization':_0xfbab('0x67')+_0x591dc1[_0xfbab('0x55')],'Content-Type':'application/json'},'body':{'from':_0x591dc1[_0xfbab('0x20')],'to':_0x22ff34[_0xfbab('0x20')],'text':_0x22ff34['body']},'json':!![]};return rp(_0x4f67d8)[_0xfbab('0x25')](function(_0x162897){if(_0x162897[_0xfbab('0x68')]==0xca){_0x3bb366['message']=_0x162897;var _0x4f4f64={'method':_0xfbab('0x32'),'uri':_0xfbab('0x69'),'headers':{'Authorization':_0xfbab('0x67')+_0x591dc1[_0xfbab('0x55')],'Content-Type':_0xfbab('0x51')},'body':{'refid':_0x3bb366[_0xfbab('0x6a')]['refid']},'json':!![]};return rp(_0x4f4f64)['then'](function(_0x1d5e85){_0x3bb366[_0xfbab('0x6b')]=_0x1d5e85;var _0x24a71e={'messageId':_0x3bb366[_0xfbab('0x6a')][_0xfbab('0x6c')],'read':!![]};return _0x2db560['update'](_0x24a71e);});}else{return logger['error'](_0xfbab('0x27'),_0xfbab('0x28'),_0xfbab('0x65'),util['inspect'](_0x162897,{'showHidden':![],'depth':null}));}})[_0xfbab('0x17')](function(_0x703200){return logger[_0xfbab('0x18')](_0xfbab('0x27'),_0xfbab('0x28'),_0xfbab('0x65'),util[_0xfbab('0x29')](_0x703200,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xfbab('0x27'),_0xfbab('0x28'),_0xfbab('0x65'),'Token\x20not\x20received');}break;}}})[_0xfbab('0x6d')](function(){_0x3150c5();});}else{_0x3150c5();}}},'charset':_0xfbab('0x6e'),'collate':_0xfbab('0x6f')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 07b863b..4efaa39 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 _0x1a85=['info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','options','raw','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','socket.io-emitter','register','request','then'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1a85,0x178));var _0x51a8=function(_0x2dbcc8,_0x5e6b9a){_0x2dbcc8=_0x2dbcc8-0x0;var _0x4e0a07=_0x1a85[_0x2dbcc8];return _0x4e0a07;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});config['redis']=_[_0x51a8('0x8')](config[_0x51a8('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x51a8('0xa'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x51a8('0xb')](socket);function respondWithRpcPromise(_0x2f276b,_0x1a476d,_0x45a3f4){return new BPromise(function(_0x418f06,_0x421fa4){return client[_0x51a8('0xc')](_0x2f276b,_0x45a3f4)[_0x51a8('0xd')](function(_0x34c887){logger[_0x51a8('0xe')](_0x51a8('0xf'),_0x1a476d,_0x51a8('0x10'));logger[_0x51a8('0x11')](_0x51a8('0x12'),_0x1a476d,_0x51a8('0x10'),JSON[_0x51a8('0x13')](_0x34c887));if(_0x34c887[_0x51a8('0x14')]){if(_0x34c887['error'][_0x51a8('0x15')]===0x1f4){logger[_0x51a8('0x14')](_0x51a8('0xf'),_0x1a476d,_0x34c887['error'][_0x51a8('0x16')]);return _0x421fa4(_0x34c887['error'][_0x51a8('0x16')]);}logger[_0x51a8('0x14')](_0x51a8('0xf'),_0x1a476d,_0x34c887[_0x51a8('0x14')][_0x51a8('0x16')]);return _0x418f06(_0x34c887[_0x51a8('0x14')][_0x51a8('0x16')]);}else{logger['info'](_0x51a8('0xf'),_0x1a476d,_0x51a8('0x10'));_0x418f06(_0x34c887[_0x51a8('0x17')][_0x51a8('0x16')]);}})[_0x51a8('0x18')](function(_0x544886){logger['error'](_0x51a8('0xf'),_0x1a476d,_0x544886);_0x421fa4(_0x544886);});});}exports[_0x51a8('0x19')]=function(_0x2217ce){var _0x2f2681=this;return new Promise(function(_0x2a4c4c,_0x3bc044){return db[_0x51a8('0x1a')][_0x51a8('0x1b')](_0x2217ce['body'],{'raw':_0x2217ce[_0x51a8('0x1c')]?_0x2217ce['options'][_0x51a8('0x1d')]===undefined?!![]:![]:!![]})[_0x51a8('0xd')](function(_0x8bda40){logger[_0x51a8('0xe')]('CreateSmsMessage',_0x2217ce);logger[_0x51a8('0x11')]('CreateSmsMessage',_0x2217ce,JSON['stringify'](_0x8bda40));_0x2a4c4c(_0x8bda40);})[_0x51a8('0x18')](function(_0x52e503){logger[_0x51a8('0x14')](_0x51a8('0x19'),_0x52e503[_0x51a8('0x16')],_0x2217ce);_0x3bc044(_0x2f2681[_0x51a8('0x14')](0x1f4,_0x52e503[_0x51a8('0x16')]));});});}; \ No newline at end of file +var _0x8603=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','./smsMessage.socket','register','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','then','util','moment','bluebird'];(function(_0xce6249,_0x3be6ad){var _0x31412b=function(_0x3da288){while(--_0x3da288){_0xce6249['push'](_0xce6249['shift']());}};_0x31412b(++_0x3be6ad);}(_0x8603,0x190));var _0x3860=function(_0x11b3bf,_0xca12c){_0x11b3bf=_0x11b3bf-0x0;var _0x2eeb8b=_0x8603[_0x11b3bf];return _0x2eeb8b;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});config[_0x3860('0x9')]=_[_0x3860('0xa')](config[_0x3860('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3860('0xb'))[_0x3860('0xc')](socket);function respondWithRpcPromise(_0x52c277,_0x2fb169,_0x38737e){return new BPromise(function(_0x5909b8,_0x101263){return client[_0x3860('0xd')](_0x52c277,_0x38737e)['then'](function(_0x365579){logger[_0x3860('0xe')]('SmsMessage,\x20%s,\x20%s',_0x2fb169,_0x3860('0xf'));logger[_0x3860('0x10')](_0x3860('0x11'),_0x2fb169,_0x3860('0xf'),JSON[_0x3860('0x12')](_0x365579));if(_0x365579[_0x3860('0x13')]){if(_0x365579[_0x3860('0x13')][_0x3860('0x14')]===0x1f4){logger[_0x3860('0x13')](_0x3860('0x15'),_0x2fb169,_0x365579['error'][_0x3860('0x16')]);return _0x101263(_0x365579[_0x3860('0x13')][_0x3860('0x16')]);}logger[_0x3860('0x13')](_0x3860('0x15'),_0x2fb169,_0x365579[_0x3860('0x13')][_0x3860('0x16')]);return _0x5909b8(_0x365579[_0x3860('0x13')][_0x3860('0x16')]);}else{logger[_0x3860('0xe')](_0x3860('0x15'),_0x2fb169,_0x3860('0xf'));_0x5909b8(_0x365579['result']['message']);}})[_0x3860('0x17')](function(_0x41ce59){logger[_0x3860('0x13')]('SmsMessage,\x20%s,\x20%s',_0x2fb169,_0x41ce59);_0x101263(_0x41ce59);});});}exports[_0x3860('0x18')]=function(_0x145b26){var _0x22e873=this;return new Promise(function(_0x3af33a,_0x20a5b0){return db[_0x3860('0x19')][_0x3860('0x1a')](_0x145b26[_0x3860('0x1b')],{'raw':_0x145b26[_0x3860('0x1c')]?_0x145b26[_0x3860('0x1c')][_0x3860('0x1d')]===undefined?!![]:![]:!![]})[_0x3860('0x1e')](function(_0x280ea9){logger[_0x3860('0xe')](_0x3860('0x18'),_0x145b26);logger['debug'](_0x3860('0x18'),_0x145b26,JSON[_0x3860('0x12')](_0x280ea9));_0x3af33a(_0x280ea9);})[_0x3860('0x17')](function(_0x301e03){logger[_0x3860('0x13')]('CreateSmsMessage',_0x301e03[_0x3860('0x16')],_0x145b26);_0x20a5b0(_0x22e873['error'](0x1f4,_0x301e03['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 5c81e4b..6dc15b3 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 _0x6e98=['save','remove','update','emit','register','length','smsMessage:'];(function(_0x45de0f,_0x511429){var _0x2da477=function(_0x3eb5f7){while(--_0x3eb5f7){_0x45de0f['push'](_0x45de0f['shift']());}};_0x2da477(++_0x511429);}(_0x6e98,0x18f));var _0x86e9=function(_0x1e381c,_0x47b5b9){_0x1e381c=_0x1e381c-0x0;var _0x9b5ea9=_0x6e98[_0x1e381c];return _0x9b5ea9;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x86e9('0x0'),_0x86e9('0x1'),_0x86e9('0x2')];function createListener(_0x1a815a,_0x277d31){return function(_0x32e425){_0x277d31[_0x86e9('0x3')](_0x1a815a,_0x32e425);};}function removeListener(_0x5406f0,_0x4c5e15){return function(){SmsMessageEvents['removeListener'](_0x5406f0,_0x4c5e15);};}exports[_0x86e9('0x4')]=function(_0x40fb4f){for(var _0x42b5bf=0x0,_0x2e5253=events[_0x86e9('0x5')];_0x42b5bf<_0x2e5253;_0x42b5bf++){var _0x495c0c=events[_0x42b5bf];var _0x5eaf3a=createListener(_0x86e9('0x6')+_0x495c0c,_0x40fb4f);SmsMessageEvents['on'](_0x495c0c,_0x5eaf3a);}}; \ No newline at end of file +var _0x77f5=['removeListener','length','./smsMessage.events','save','remove'];(function(_0x219e10,_0x1202b3){var _0x162e2b=function(_0xc3f164){while(--_0xc3f164){_0x219e10['push'](_0x219e10['shift']());}};_0x162e2b(++_0x1202b3);}(_0x77f5,0x133));var _0x577f=function(_0x3cb788,_0x186eb7){_0x3cb788=_0x3cb788-0x0;var _0x56deab=_0x77f5[_0x3cb788];return _0x56deab;};'use strict';var SmsMessageEvents=require(_0x577f('0x0'));var events=[_0x577f('0x1'),_0x577f('0x2'),'update'];function createListener(_0x3aa569,_0x2f6b47){return function(_0x70fe53){_0x2f6b47['emit'](_0x3aa569,_0x70fe53);};}function removeListener(_0x363edc,_0x5633d4){return function(){SmsMessageEvents[_0x577f('0x3')](_0x363edc,_0x5633d4);};}exports['register']=function(_0xae4dba){for(var _0x3aa52a=0x0,_0x8aa130=events[_0x577f('0x4')];_0x3aa52a<_0x8aa130;_0x3aa52a++){var _0x185938=events[_0x3aa52a];var _0x10231d=createListener('smsMessage:'+_0x185938,_0xae4dba);SmsMessageEvents['on'](_0x185938,_0x10231d);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 1e766c0..ec15a49 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 _0xe928=['put','update','delete','destroy','removeTeams','removeAgents','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','getAgents','post','create','/:id/teams','addTeams','/:id/users'];(function(_0x509c83,_0x511882){var _0x534626=function(_0x9d21cf){while(--_0x9d21cf){_0x509c83['push'](_0x509c83['shift']());}};_0x534626(++_0x511882);}(_0xe928,0x145));var _0x8e92=function(_0x58a6ab,_0x41f602){_0x58a6ab=_0x58a6ab-0x0;var _0x584b85=_0xe928[_0x58a6ab];return _0x584b85;};'use strict';var multer=require(_0x8e92('0x0'));var util=require(_0x8e92('0x1'));var path=require(_0x8e92('0x2'));var timeout=require('connect-timeout');var express=require(_0x8e92('0x3'));var router=express['Router']();var auth=require(_0x8e92('0x4'));var interaction=require(_0x8e92('0x5'));var config=require(_0x8e92('0x6'));var controller=require(_0x8e92('0x7'));router['get']('/',auth[_0x8e92('0x8')](),controller['index']);router[_0x8e92('0x9')](_0x8e92('0xa'),auth[_0x8e92('0x8')](),controller[_0x8e92('0xb')]);router['get'](_0x8e92('0xc'),auth['isAuthenticated'](),controller[_0x8e92('0xd')]);router[_0x8e92('0x9')](_0x8e92('0xe'),auth[_0x8e92('0x8')](),controller[_0x8e92('0xf')]);router[_0x8e92('0x9')]('/:id/teams',auth[_0x8e92('0x8')](),controller[_0x8e92('0x10')]);router[_0x8e92('0x9')]('/:id/users',auth[_0x8e92('0x8')](),controller[_0x8e92('0x11')]);router[_0x8e92('0x12')]('/',auth[_0x8e92('0x8')](),controller[_0x8e92('0x13')]);router[_0x8e92('0x12')](_0x8e92('0x14'),auth['isAuthenticated'](),controller[_0x8e92('0x15')]);router['post'](_0x8e92('0x16'),auth[_0x8e92('0x8')](),controller['addAgents']);router[_0x8e92('0x17')]('/:id',auth[_0x8e92('0x8')](),controller[_0x8e92('0x18')]);router[_0x8e92('0x19')](_0x8e92('0xc'),auth[_0x8e92('0x8')](),controller[_0x8e92('0x1a')]);router[_0x8e92('0x19')](_0x8e92('0x14'),auth['isAuthenticated'](),controller[_0x8e92('0x1b')]);router[_0x8e92('0x19')](_0x8e92('0x16'),auth[_0x8e92('0x8')](),controller[_0x8e92('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x565e=['/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x3b3752,_0x10e078){var _0x894b45=function(_0x33c153){while(--_0x33c153){_0x3b3752['push'](_0x3b3752['shift']());}};_0x894b45(++_0x10e078);}(_0x565e,0x7f));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe565('0x0'));var util=require('util');var path=require(_0xe565('0x1'));var timeout=require(_0xe565('0x2'));var express=require(_0xe565('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe565('0x4'));var config=require(_0xe565('0x5'));var controller=require(_0xe565('0x6'));router[_0xe565('0x7')]('/',auth[_0xe565('0x8')](),controller[_0xe565('0x9')]);router[_0xe565('0x7')](_0xe565('0xa'),auth[_0xe565('0x8')](),controller[_0xe565('0xb')]);router[_0xe565('0x7')](_0xe565('0xc'),auth[_0xe565('0x8')](),controller[_0xe565('0xd')]);router[_0xe565('0x7')](_0xe565('0xe'),auth['isAuthenticated'](),controller[_0xe565('0xf')]);router[_0xe565('0x7')](_0xe565('0x10'),auth['isAuthenticated'](),controller[_0xe565('0x11')]);router[_0xe565('0x7')](_0xe565('0x12'),auth[_0xe565('0x8')](),controller['getAgents']);router[_0xe565('0x13')]('/',auth['isAuthenticated'](),controller[_0xe565('0x14')]);router['post'](_0xe565('0x10'),auth[_0xe565('0x8')](),controller[_0xe565('0x15')]);router['post'](_0xe565('0x12'),auth[_0xe565('0x8')](),controller[_0xe565('0x16')]);router[_0xe565('0x17')]('/:id',auth[_0xe565('0x8')](),controller[_0xe565('0x18')]);router[_0xe565('0x19')](_0xe565('0xc'),auth[_0xe565('0x8')](),controller[_0xe565('0x1a')]);router['delete'](_0xe565('0x10'),auth[_0xe565('0x8')](),controller[_0xe565('0x1b')]);router[_0xe565('0x19')]('/:id/users',auth[_0xe565('0x8')](),controller[_0xe565('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index c053c26..d72f32f 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 _0x339d=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x32e633,_0x38e433){var _0x5dd495=function(_0x228a0a){while(--_0x228a0a){_0x32e633['push'](_0x32e633['shift']());}};_0x5dd495(++_0x38e433);}(_0x339d,0xd1));var _0xd339=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x339d[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require(_0xd339('0x0'));module[_0xd339('0x1')]={'name':{'type':Sequelize[_0xd339('0x2')],'unique':_0xd339('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd339('0x4')](_0xd339('0x5'),_0xd339('0x6'),_0xd339('0x7'))}}; \ No newline at end of file +var _0x79f5=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x4a69fb,_0x885746){var _0xadbd17=function(_0x5c680b){while(--_0x5c680b){_0x4a69fb['push'](_0x4a69fb['shift']());}};_0xadbd17(++_0x885746);}(_0x79f5,0x19a));var _0x579f=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x79f5[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require(_0x579f('0x0'));module[_0x579f('0x1')]={'name':{'type':Sequelize[_0x579f('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x579f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x579f('0x4')](_0x579f('0x5'),_0x579f('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 0a22cb1..71591ed 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 _0x41bb=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','addTeams','teams','Team','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','select','tq.TeamId','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','includes','all','compact','value','transaction','ids','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','isArray','getAgents','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsQueue.socket','register','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','sendStatus','error','name','send','SmsQueue','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body'];(function(_0x1665f2,_0x5abc86){var _0x155966=function(_0x25a5bb){while(--_0x25a5bb){_0x1665f2['push'](_0x1665f2['shift']());}};_0x155966(++_0x5abc86);}(_0x41bb,0xc5));var _0xb41b=function(_0x4b2667,_0x53659c){_0x4b2667=_0x4b2667-0x0;var _0x3ba2f7=_0x41bb[_0x4b2667];return _0x3ba2f7;};'use strict';var pdf=require(_0xb41b('0x0'));var emlformat=require(_0xb41b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb41b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb41b('0x3'));var moment=require(_0xb41b('0x4'));var BPromise=require(_0xb41b('0x5'));var Mustache=require(_0xb41b('0x6'));var util=require('util');var path=require(_0xb41b('0x7'));var sox=require(_0xb41b('0x8'));var csv=require(_0xb41b('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb41b('0xa'));var jsforce=require(_0xb41b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb41b('0x9'));var querystring=require(_0xb41b('0xc'));var Papa=require(_0xb41b('0xd'));var Redis=require(_0xb41b('0xe'));var authService=require(_0xb41b('0xf'));var qs=require(_0xb41b('0x10'));var hardwareService=require(_0xb41b('0x11'));var logger=require('../../config/logger')(_0xb41b('0x12'));var utils=require('../../config/utils');var config=require(_0xb41b('0x13'));var db=require(_0xb41b('0x14'))['db'];config[_0xb41b('0x15')]=_[_0xb41b('0x16')](config[_0xb41b('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xb41b('0x17'))(new Redis(config[_0xb41b('0x15')]));require(_0xb41b('0x18'))[_0xb41b('0x19')](socket);function respondWithStatusCode(_0x3be1ec,_0x4e8603){_0x4e8603=_0x4e8603||0xcc;return function(_0x4e7f11){if(_0x4e7f11){return _0x3be1ec['sendStatus'](_0x4e8603);}return _0x3be1ec[_0xb41b('0x1a')](_0x4e8603)[_0xb41b('0x1b')]();};}function respondWithResult(_0x143a81,_0x338920){_0x338920=_0x338920||0xc8;return function(_0x29ea51){if(_0x29ea51){return _0x143a81['status'](_0x338920)[_0xb41b('0x1c')](_0x29ea51);}};}function respondWithFilteredResult(_0xd0b6b5,_0x401dd9){return function(_0xcf0728){if(_0xcf0728){var _0x43f4ea=_0xcf0728['count'],_0x47154d=_0x401dd9['offset'],_0x198783=_0x401dd9[_0xb41b('0x1d')]+_0x401dd9['limit'],_0x5df8c2;if(_0x198783>=_0x43f4ea){_0x198783=_0x43f4ea;_0x5df8c2=0xc8;}else{_0x5df8c2=0xce;}_0xd0b6b5[_0xb41b('0x1a')](_0x5df8c2);return _0xd0b6b5[_0xb41b('0x1e')](_0xb41b('0x1f'),_0x47154d+'-'+_0x198783+'/'+_0x43f4ea)['json'](_0xcf0728);}return null;};}function patchUpdates(_0x53bc44){return function(_0x1a1386){try{jsonpatch[_0xb41b('0x20')](_0x1a1386,_0x53bc44,!![]);}catch(_0xd1bc61){return BPromise[_0xb41b('0x21')](_0xd1bc61);}return _0x1a1386[_0xb41b('0x22')]();};}function saveUpdates(_0x42dccb,_0x4c73da){return function(_0x58f149){if(_0x58f149){return _0x58f149[_0xb41b('0x23')](_0x42dccb)[_0xb41b('0x24')](function(_0x871b35){return _0x871b35;});}return null;};}function removeEntity(_0x583741,_0x14e9c8){return function(_0x2441d6){if(_0x2441d6){return _0x2441d6['destroy']()[_0xb41b('0x24')](function(){var _0x34f908=_0x2441d6['get']({'plain':!![]});var _0xed3c7e='SmsQueues';return db[_0xb41b('0x25')][_0xb41b('0x26')]({'where':{'type':_0xed3c7e,'resourceId':_0x34f908['id']}})['then'](function(){return _0x2441d6;});})[_0xb41b('0x24')](function(){_0x583741[_0xb41b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c2e41,_0x2a5286){return function(_0x46aecf){if(!_0x46aecf){_0x4c2e41[_0xb41b('0x27')](0x194);}return _0x46aecf;};}function handleError(_0x36dda8,_0x2c7e1f){_0x2c7e1f=_0x2c7e1f||0x1f4;return function(_0x181cbd){logger[_0xb41b('0x28')](_0x181cbd['stack']);if(_0x181cbd[_0xb41b('0x29')]){delete _0x181cbd[_0xb41b('0x29')];}_0x36dda8['status'](_0x2c7e1f)[_0xb41b('0x2a')](_0x181cbd);};}exports['index']=function(_0x38277f,_0x31d4cd){var _0x597a35={},_0x23a6ed={},_0x4a95e7={'count':0x0,'rows':[]};var _0x29da9f=db[_0xb41b('0x2b')]['rawAttributes'];_0x23a6ed[_0xb41b('0x2c')]=_[_0xb41b('0x2d')](_0x29da9f);_0x23a6ed[_0xb41b('0x2e')]=_[_0xb41b('0x2d')](_0x38277f[_0xb41b('0x2e')]);_0x23a6ed[_0xb41b('0x2f')]=_[_0xb41b('0x30')](_0x23a6ed[_0xb41b('0x2c')],_0x23a6ed[_0xb41b('0x2e')]);_0x597a35[_0xb41b('0x31')]=_['intersection'](_0x23a6ed[_0xb41b('0x2c')],qs['fields'](_0x38277f['query'][_0xb41b('0x32')]));_0x597a35[_0xb41b('0x31')]=_0x597a35[_0xb41b('0x31')][_0xb41b('0x33')]?_0x597a35[_0xb41b('0x31')]:_0x23a6ed[_0xb41b('0x2c')];if(!_0x38277f[_0xb41b('0x2e')][_0xb41b('0x34')](_0xb41b('0x35'))){_0x597a35[_0xb41b('0x36')]=qs[_0xb41b('0x36')](_0x38277f['query'][_0xb41b('0x36')]);_0x597a35[_0xb41b('0x1d')]=qs[_0xb41b('0x1d')](_0x38277f[_0xb41b('0x2e')][_0xb41b('0x1d')]);}_0x597a35[_0xb41b('0x37')]=qs['sort'](_0x38277f['query'][_0xb41b('0x38')]);_0x597a35[_0xb41b('0x39')]=qs['filters'](_[_0xb41b('0x3a')](_0x38277f[_0xb41b('0x2e')],_0x23a6ed[_0xb41b('0x2f')]));if(_0x38277f[_0xb41b('0x2e')][_0xb41b('0x3b')]){_0x597a35['where']=_[_0xb41b('0x3c')](_0x597a35['where'],{'$or':_[_0xb41b('0x3d')](_0x29da9f,function(_0x22c741){if(_0x22c741[_0xb41b('0x3e')][_0xb41b('0x3f')]!==_0xb41b('0x40')){var _0x2cb48d={};_0x2cb48d[_0x22c741[_0xb41b('0x41')]]={'$like':'%'+_0x38277f[_0xb41b('0x2e')][_0xb41b('0x3b')]+'%'};return _0x2cb48d;}})});}_0x597a35=_['merge']({},_0x597a35,_0x38277f['options']);var _0x4e0a61={'where':_0x597a35[_0xb41b('0x39')]};return db['SmsQueue']['count'](_0x4e0a61)[_0xb41b('0x24')](function(_0x5ded42){_0x4a95e7[_0xb41b('0x42')]=_0x5ded42;if(_0x38277f[_0xb41b('0x2e')][_0xb41b('0x43')]){_0x597a35[_0xb41b('0x44')]=[{'all':!![]}];}return db[_0xb41b('0x2b')][_0xb41b('0x45')](_0x597a35);})[_0xb41b('0x24')](function(_0x57e043){_0x4a95e7[_0xb41b('0x46')]=_0x57e043;return _0x4a95e7;})[_0xb41b('0x24')](respondWithFilteredResult(_0x31d4cd,_0x597a35))[_0xb41b('0x47')](handleError(_0x31d4cd,null));};exports[_0xb41b('0x48')]=function(_0x47bab5,_0x2f1391){var _0x4be746={'raw':!![],'where':{'id':_0x47bab5[_0xb41b('0x49')]['id']}},_0x1c2c77={};_0x1c2c77[_0xb41b('0x2c')]=_['keys'](db['SmsQueue'][_0xb41b('0x4a')]);_0x1c2c77[_0xb41b('0x2e')]=_[_0xb41b('0x2d')](_0x47bab5[_0xb41b('0x2e')]);_0x1c2c77[_0xb41b('0x2f')]=_[_0xb41b('0x30')](_0x1c2c77[_0xb41b('0x2c')],_0x1c2c77['query']);_0x4be746['attributes']=_[_0xb41b('0x30')](_0x1c2c77['model'],qs[_0xb41b('0x32')](_0x47bab5['query'][_0xb41b('0x32')]));_0x4be746['attributes']=_0x4be746[_0xb41b('0x31')]['length']?_0x4be746[_0xb41b('0x31')]:_0x1c2c77[_0xb41b('0x2c')];if(_0x47bab5[_0xb41b('0x2e')][_0xb41b('0x43')]){_0x4be746['include']=[{'all':!![]}];}_0x4be746=_[_0xb41b('0x3c')]({},_0x4be746,_0x47bab5[_0xb41b('0x4b')]);return db['SmsQueue'][_0xb41b('0x4c')](_0x4be746)['then'](handleEntityNotFound(_0x2f1391,null))['then'](respondWithResult(_0x2f1391,null))['catch'](handleError(_0x2f1391,null));};exports['create']=function(_0x263d8d,_0x23ea63){return db[_0xb41b('0x2b')][_0xb41b('0x4d')](_0x263d8d[_0xb41b('0x4e')],{})[_0xb41b('0x24')](function(_0x34d076){var _0x3852ae=_0x263d8d[_0xb41b('0x4f')][_0xb41b('0x50')]({'plain':!![]});if(!_0x3852ae)throw new Error(_0xb41b('0x51'));if(_0x3852ae[_0xb41b('0x52')]===_0xb41b('0x4f')){var _0x360856=_0x34d076[_0xb41b('0x50')]({'plain':!![]});var _0x19893d='SmsQueues';return db[_0xb41b('0x53')]['find']({'where':{'name':_0x19893d,'userProfileId':_0x3852ae['userProfileId']},'raw':!![]})[_0xb41b('0x24')](function(_0x1ca654){if(_0x1ca654&&_0x1ca654[_0xb41b('0x54')]===0x0){return db[_0xb41b('0x25')][_0xb41b('0x4d')]({'name':_0x360856[_0xb41b('0x29')],'resourceId':_0x360856['id'],'type':_0x1ca654[_0xb41b('0x29')],'sectionId':_0x1ca654['id']},{})[_0xb41b('0x24')](function(){return _0x34d076;});}else{return _0x34d076;}})[_0xb41b('0x47')](function(_0x1977b1){logger[_0xb41b('0x28')](_0xb41b('0x55'),_0x1977b1);throw _0x1977b1;});}return _0x34d076;})[_0xb41b('0x24')](respondWithResult(_0x23ea63,0xc9))[_0xb41b('0x47')](handleError(_0x23ea63,null));};exports[_0xb41b('0x23')]=function(_0x29bd4a,_0x26ce99){if(_0x29bd4a[_0xb41b('0x4e')]['id']){delete _0x29bd4a[_0xb41b('0x4e')]['id'];}return db[_0xb41b('0x2b')][_0xb41b('0x4c')]({'where':{'id':_0x29bd4a['params']['id']}})[_0xb41b('0x24')](handleEntityNotFound(_0x26ce99,null))['then'](saveUpdates(_0x29bd4a[_0xb41b('0x4e')],null))[_0xb41b('0x24')](respondWithResult(_0x26ce99,null))[_0xb41b('0x47')](handleError(_0x26ce99,null));};exports[_0xb41b('0x26')]=function(_0x231042,_0x305f0e){return db[_0xb41b('0x2b')]['find']({'where':{'id':_0x231042[_0xb41b('0x49')]['id']}})[_0xb41b('0x24')](handleEntityNotFound(_0x305f0e,null))[_0xb41b('0x24')](removeEntity(_0x305f0e,null))['catch'](handleError(_0x305f0e,null));};exports[_0xb41b('0x56')]=function(_0x54d27e,_0x380eb0){return db[_0xb41b('0x2b')][_0xb41b('0x56')]()[_0xb41b('0x24')](respondWithResult(_0x380eb0,null))[_0xb41b('0x47')](handleError(_0x380eb0,null));};exports['getMembers']=function(_0x515698,_0xaeb50e,_0x893f6d){var _0x50d28c={'raw':!![],'where':{}},_0x43ad9c={},_0x285099;return db['SmsQueue'][_0xb41b('0x57')]({'where':{'id':_0x515698[_0xb41b('0x49')]['id']}})[_0xb41b('0x24')](handleEntityNotFound(_0xaeb50e,null))[_0xb41b('0x24')](function(_0x3d5b57){if(_0x3d5b57){_0x285099=_0x3d5b57[_0xb41b('0x50')]({'plain':!![]});_0x43ad9c[_0xb41b('0x2c')]=_[_0xb41b('0x2d')](db[_0xb41b('0x58')][_0xb41b('0x4a')]);_0x43ad9c['query']=_[_0xb41b('0x2d')](_0x515698[_0xb41b('0x2e')]);_0x43ad9c['filters']=_['intersection'](_0x43ad9c[_0xb41b('0x2c')],_0x43ad9c[_0xb41b('0x2e')]);_0x50d28c[_0xb41b('0x31')]=_['intersection'](_0x43ad9c[_0xb41b('0x2c')],qs[_0xb41b('0x32')](_0x515698[_0xb41b('0x2e')][_0xb41b('0x32')]));_0x50d28c[_0xb41b('0x31')]=_0x50d28c[_0xb41b('0x31')][_0xb41b('0x33')]?_0x50d28c[_0xb41b('0x31')]:_0x43ad9c[_0xb41b('0x2c')];if(!_0x515698[_0xb41b('0x2e')]['hasOwnProperty'](_0xb41b('0x35'))){_0x50d28c[_0xb41b('0x36')]=qs['limit'](_0x515698[_0xb41b('0x2e')][_0xb41b('0x36')]);_0x50d28c[_0xb41b('0x1d')]=qs['offset'](_0x515698[_0xb41b('0x2e')][_0xb41b('0x1d')]);}_0x50d28c[_0xb41b('0x37')]=qs[_0xb41b('0x38')](_0x515698[_0xb41b('0x2e')][_0xb41b('0x38')]);_0x50d28c[_0xb41b('0x39')]=qs[_0xb41b('0x2f')](_[_0xb41b('0x3a')](_0x515698[_0xb41b('0x2e')],_0x43ad9c['filters']));_0x50d28c['where']['SmsQueueId']=_0x3d5b57['id'];if(_0x515698['query'][_0xb41b('0x3b')]){_0x50d28c[_0xb41b('0x39')]=_[_0xb41b('0x3c')](_0x50d28c[_0xb41b('0x39')],{'$or':_[_0xb41b('0x3d')](_0x50d28c[_0xb41b('0x31')],function(_0x4ab9fa){var _0x36ac48={};_0x36ac48[_0x4ab9fa]={'$like':'%'+_0x515698['query'][_0xb41b('0x3b')]+'%'};return _0x36ac48;})});}_0x50d28c=_['merge']({},_0x50d28c,_0x515698[_0xb41b('0x4b')]);return db['UserSmsQueue'][_0xb41b('0x45')](_0x50d28c);}})[_0xb41b('0x24')](function(_0x497a8b){if(_0x497a8b){return db[_0xb41b('0x59')][_0xb41b('0x5a')]({'where':{'id':_[_0xb41b('0x3d')](_0x497a8b,_0xb41b('0x5b')),'role':_0xb41b('0x5c')},'attributes':['id',_0xb41b('0x29'),_0xb41b('0x5d'),'updatedAt',_0xb41b('0x5e')]});}})['then'](function(_0x451e09){if(_0x451e09){return{'count':_0x451e09[_0xb41b('0x42')],'rows':_[_0xb41b('0x3d')](_0x451e09['rows'],function(_0x53d409){return{'membername':_0x53d409['name'],'UserId':_0x53d409['id'],'queue_name':_0x285099['name'],'SmsQueueId':_0x285099['id'],'interface':util[_0xb41b('0x5f')](_0xb41b('0x60'),_0xb41b('0x61'),_0x53d409['name']),'penalty':0x0,'paused':_0x53d409['smsPause'],'createdAt':_0x53d409[_0xb41b('0x5e')],'updatedAt':_0x53d409[_0xb41b('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb41b('0x24')](respondWithFilteredResult(_0xaeb50e,_0x50d28c))[_0xb41b('0x47')](handleError(_0xaeb50e,null));};exports[_0xb41b('0x63')]=function(_0xd2cec6,_0x244e4d,_0x58fd33){var _0x5a3797={};var _0x303ca3={};var _0x44b0d6;var _0x5913af;return db[_0xb41b('0x2b')]['findOne']({'where':{'id':_0xd2cec6[_0xb41b('0x49')]['id']}})[_0xb41b('0x24')](handleEntityNotFound(_0x244e4d,null))['then'](function(_0xc726bb){if(_0xc726bb){_0x44b0d6=_0xc726bb;_0x303ca3[_0xb41b('0x2c')]=_['keys'](db['Team'][_0xb41b('0x4a')]);_0x303ca3[_0xb41b('0x2e')]=_['keys'](_0xd2cec6[_0xb41b('0x2e')]);_0x303ca3['filters']=_[_0xb41b('0x30')](_0x303ca3[_0xb41b('0x2c')],_0x303ca3['query']);_0x5a3797['attributes']=_[_0xb41b('0x30')](_0x303ca3[_0xb41b('0x2c')],qs['fields'](_0xd2cec6[_0xb41b('0x2e')][_0xb41b('0x32')]));_0x5a3797[_0xb41b('0x31')]=_0x5a3797['attributes'][_0xb41b('0x33')]?_0x5a3797['attributes']:_0x303ca3['model'];_0x5a3797[_0xb41b('0x37')]=qs[_0xb41b('0x38')](_0xd2cec6[_0xb41b('0x2e')][_0xb41b('0x38')]);_0x5a3797[_0xb41b('0x39')]=qs[_0xb41b('0x2f')](_[_0xb41b('0x3a')](_0xd2cec6[_0xb41b('0x2e')],_0x303ca3[_0xb41b('0x2f')]));if(_0xd2cec6[_0xb41b('0x2e')][_0xb41b('0x3b')]){_0x5a3797[_0xb41b('0x39')]=_[_0xb41b('0x3c')](_0x5a3797['where'],{'$or':_[_0xb41b('0x3d')](_0x5a3797[_0xb41b('0x31')],function(_0x3c6e6b){var _0x1dab3e={};_0x1dab3e[_0x3c6e6b]={'$like':'%'+_0xd2cec6[_0xb41b('0x2e')][_0xb41b('0x3b')]+'%'};return _0x1dab3e;})});}_0x5a3797=_[_0xb41b('0x3c')]({},_0x5a3797,_0xd2cec6[_0xb41b('0x4b')]);return _0x44b0d6['getTeams'](_0x5a3797);}})['then'](function(_0xcae259){if(_0xcae259){_0x5913af=_0xcae259[_0xb41b('0x33')];if(!_0xd2cec6[_0xb41b('0x2e')]['hasOwnProperty'](_0xb41b('0x35'))){_0x5a3797[_0xb41b('0x36')]=qs['limit'](_0xd2cec6[_0xb41b('0x2e')][_0xb41b('0x36')]);_0x5a3797['offset']=qs[_0xb41b('0x1d')](_0xd2cec6[_0xb41b('0x2e')][_0xb41b('0x1d')]);}return _0x44b0d6[_0xb41b('0x63')](_0x5a3797);}})[_0xb41b('0x24')](function(_0x2fa95c){if(_0x2fa95c){return _0x2fa95c?{'count':_0x5913af,'rows':_0x2fa95c}:null;}})[_0xb41b('0x24')](respondWithResult(_0x244e4d,null))[_0xb41b('0x47')](handleError(_0x244e4d,null));};exports[_0xb41b('0x64')]=function(_0x5d0535,_0x4b3d88,_0x423b4b){var _0x475eb9=_0x5d0535[_0xb41b('0x4e')][_0xb41b('0x65')];return db[_0xb41b('0x66')][_0xb41b('0x45')]({'where':{'id':_['map'](_0x475eb9,'id')},'attributes':['id'],'include':[{'model':db[_0xb41b('0x59')],'as':_0xb41b('0x67'),'attributes':['id',_0xb41b('0x29'),_0xb41b('0x68'),_0xb41b('0x69'),_0xb41b('0x6a')],'raw':!![]}]})[_0xb41b('0x24')](function(_0x339891){if(_0x339891){var _0x397b80=_[_0xb41b('0x6b')](_0x339891,function(_0xb9019b){var _0x37c0de=_0xb9019b[_0xb41b('0x50')]({'plain':!![]});return _0x37c0de[_0xb41b('0x67')];});return db[_0xb41b('0x2b')][_0xb41b('0x4c')]({'where':{'id':_0x5d0535['params']['id']}})['then'](function(_0x5dba0d){return db[_0xb41b('0x6c')]['transaction'](function(_0xee91a4){return _0x5dba0d[_0xb41b('0x64')](_['map'](_0x475eb9,'id'),{'transaction':_0xee91a4})[_0xb41b('0x24')](function(){return BPromise[_0xb41b('0x6d')](_0x397b80,function(_0x89c4f4){return db[_0xb41b('0x58')][_0xb41b('0x6e')]({'where':{'UserId':_0x89c4f4['id'],'SmsQueueId':_0x5d0535['params']['id']},'transaction':_0xee91a4});});})[_0xb41b('0x24')](function(){_0x397b80[_0xb41b('0x6f')](function(_0x53ba8d){socket['emit'](_0xb41b('0x70'),{'UserId':_0x53ba8d['id'],'SmsQueueId':_0x5dba0d['id']});});});});});}})[_0xb41b('0x24')](respondWithStatusCode(_0x4b3d88,null))['catch'](handleError(_0x4b3d88,null));};exports[_0xb41b('0x71')]=function(_0x1044ae,_0x1959a4,_0x4f8bb3){return db['Team'][_0xb41b('0x45')]({'where':{'id':_0x1044ae[_0xb41b('0x2e')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb41b('0x59')],'as':_0xb41b('0x67'),'attributes':['id'],'raw':!![]}]})[_0xb41b('0x24')](handleEntityNotFound(_0x1959a4,null))['then'](function(_0xb0c791){var _0x205664=_[_0xb41b('0x3d')](_0xb0c791,'id');var _0x23eb41=[];var _0x261ca0=[];var _0x1499d6=squel[_0xb41b('0x72')]();_0x1499d6[_0xb41b('0x41')](_0xb41b('0x73'))['from'](_0xb41b('0x74'),'tq')[_0xb41b('0x75')]('user_has_teams','ut',_0xb41b('0x76'))['where'](_0xb41b('0x77'),_0x1044ae['params']['id']);for(var _0x2e3441=0x0;_0x2e3441<_0xb0c791[_0xb41b('0x33')];_0x2e3441+=0x1){let _0x18a10e=_0xb0c791[_0x2e3441];for(var _0x24d478=0x0;_0x24d478<_0x18a10e[_0xb41b('0x67')][_0xb41b('0x33')];_0x24d478+=0x1){let _0x33a22c=_0x18a10e[_0xb41b('0x67')][_0x24d478];var _0x18de8c=_0x1499d6['clone']();_0x18de8c[_0xb41b('0x39')](_0xb41b('0x78'),_0x33a22c['id']);_0x261ca0[_0xb41b('0x79')](db[_0xb41b('0x6c')]['query'](_0x18de8c[_0xb41b('0x7a')](),{'type':db['sequelize']['QueryTypes'][_0xb41b('0x7b')]})[_0xb41b('0x24')](function(_0x5b2002){if(_0x5b2002[_0xb41b('0x33')]===0x1){return _0x33a22c['id'];}else{var _0x9b677e=_['every'](_[_0xb41b('0x3d')](_0x5b2002,'TeamId'),function(_0x5bab70){return _[_0xb41b('0x7c')](_0x205664,_0x5bab70);});if(_0x9b677e){return _0x33a22c['id'];}}}));}}return BPromise[_0xb41b('0x7d')](_0x261ca0)[_0xb41b('0x24')](function(_0x23de83){_0x23eb41=_(_0x23eb41)['union'](_0x23de83)[_0xb41b('0x7e')]()[_0xb41b('0x7f')]();return db[_0xb41b('0x2b')][_0xb41b('0x4c')]({'where':{'id':_0x1044ae['params']['id']}})[_0xb41b('0x24')](function(_0x36d059){return db[_0xb41b('0x6c')][_0xb41b('0x80')](function(_0x346736){return _0x36d059[_0xb41b('0x71')](_0x1044ae[_0xb41b('0x2e')][_0xb41b('0x81')],{'transaction':_0x346736})['then'](function(){if(!_[_0xb41b('0x82')](_0x23eb41)){return _0x36d059[_0xb41b('0x83')](_0x23eb41,{'transaction':_0x346736});}})[_0xb41b('0x24')](function(){_0x23eb41[_0xb41b('0x6f')](function(_0xf9a803){socket[_0xb41b('0x84')](_0xb41b('0x85'),{'UserId':_0xf9a803,'SmsQueueId':_0x36d059['id']});});});});});});})[_0xb41b('0x24')](respondWithStatusCode(_0x1959a4,null))['catch'](handleError(_0x1959a4,null));};exports[_0xb41b('0x86')]=function(_0x33ccd4,_0x5881cb,_0x426b65){return db[_0xb41b('0x2b')]['find']({'where':{'id':_0x33ccd4[_0xb41b('0x49')]['id']}})[_0xb41b('0x24')](handleEntityNotFound(_0x5881cb,null))[_0xb41b('0x24')](function(_0x34c66c){if(_0x34c66c){return _0x34c66c[_0xb41b('0x86')](_0x33ccd4[_0xb41b('0x4e')][_0xb41b('0x81')],_[_0xb41b('0x87')](_0x33ccd4[_0xb41b('0x4e')],[_0xb41b('0x81'),'id'])||{})['spread'](function(_0x2a7087){for(var _0x289057=0x0;_0x289057<_0x33ccd4[_0xb41b('0x4e')][_0xb41b('0x81')]['length'];_0x289057+=0x1){socket[_0xb41b('0x84')](_0xb41b('0x70'),{'UserId':_0x33ccd4[_0xb41b('0x4e')][_0xb41b('0x81')][_0x289057],'SmsQueueId':_0x33ccd4[_0xb41b('0x49')]['id']});}return _0x2a7087;});}})[_0xb41b('0x24')](respondWithResult(_0x5881cb,null))['catch'](handleError(_0x5881cb,null));};exports[_0xb41b('0x83')]=function(_0x41b0f9,_0x3bd813,_0x59581e){return db[_0xb41b('0x2b')][_0xb41b('0x4c')]({'where':{'id':_0x41b0f9[_0xb41b('0x49')]['id']}})[_0xb41b('0x24')](handleEntityNotFound(_0x3bd813,null))[_0xb41b('0x24')](function(_0x304cfe){if(_0x304cfe){return _0x304cfe[_0xb41b('0x83')](_0x41b0f9[_0xb41b('0x2e')][_0xb41b('0x81')])['then'](function(){if(_[_0xb41b('0x88')](_0x41b0f9['query'][_0xb41b('0x81')])){for(var _0xee5780=0x0;_0xee5780<_0x41b0f9[_0xb41b('0x2e')][_0xb41b('0x81')][_0xb41b('0x33')];_0xee5780+=0x1){socket[_0xb41b('0x84')](_0xb41b('0x85'),{'UserId':Number(_0x41b0f9[_0xb41b('0x2e')]['ids'][_0xee5780]),'SmsQueueId':Number(_0x41b0f9[_0xb41b('0x49')]['id'])});}}else{socket[_0xb41b('0x84')](_0xb41b('0x85'),{'UserId':Number(_0x41b0f9['query']['ids']),'SmsQueueId':Number(_0x41b0f9['params']['id'])});}});}})[_0xb41b('0x24')](respondWithStatusCode(_0x3bd813,null))[_0xb41b('0x47')](handleError(_0x3bd813,null));};exports[_0xb41b('0x89')]=function(_0x1488c8,_0x51a6c0,_0x3f8c95){var _0x29917e={};var _0x471bb0={};var _0xb7e8f4;var _0x448994;return db[_0xb41b('0x2b')][_0xb41b('0x57')]({'where':{'id':_0x1488c8[_0xb41b('0x49')]['id']}})[_0xb41b('0x24')](handleEntityNotFound(_0x51a6c0,null))[_0xb41b('0x24')](function(_0x192b27){if(_0x192b27){_0xb7e8f4=_0x192b27;_0x471bb0['model']=_['keys'](db[_0xb41b('0x59')]['rawAttributes']);_0x471bb0[_0xb41b('0x2e')]=_[_0xb41b('0x2d')](_0x1488c8[_0xb41b('0x2e')]);_0x471bb0[_0xb41b('0x2f')]=_[_0xb41b('0x30')](_0x471bb0[_0xb41b('0x2c')],_0x471bb0['query']);_0x29917e['attributes']=_[_0xb41b('0x30')](_0x471bb0[_0xb41b('0x2c')],qs[_0xb41b('0x32')](_0x1488c8[_0xb41b('0x2e')]['fields']));_0x29917e['attributes']=_0x29917e[_0xb41b('0x31')][_0xb41b('0x33')]?_0x29917e[_0xb41b('0x31')]:_0x471bb0[_0xb41b('0x2c')];_0x29917e[_0xb41b('0x37')]=qs[_0xb41b('0x38')](_0x1488c8[_0xb41b('0x2e')][_0xb41b('0x38')]);_0x29917e[_0xb41b('0x39')]=qs[_0xb41b('0x2f')](_[_0xb41b('0x3a')](_0x1488c8['query'],_0x471bb0[_0xb41b('0x2f')]));if(_0x1488c8[_0xb41b('0x2e')][_0xb41b('0x3b')]){_0x29917e[_0xb41b('0x39')]=_['merge'](_0x29917e['where'],{'$or':_[_0xb41b('0x3d')](_0x29917e['attributes'],function(_0xf95911){var _0x5e7a28={};_0x5e7a28[_0xf95911]={'$like':'%'+_0x1488c8['query'][_0xb41b('0x3b')]+'%'};return _0x5e7a28;})});}_0x29917e=_[_0xb41b('0x3c')]({},_0x29917e,_0x1488c8[_0xb41b('0x4b')]);return _0xb7e8f4[_0xb41b('0x89')](_0x29917e);}})[_0xb41b('0x24')](function(_0x11e424){if(_0x11e424){_0x448994=_0x11e424['length'];if(!_0x1488c8['query'][_0xb41b('0x34')](_0xb41b('0x35'))){_0x29917e[_0xb41b('0x36')]=qs[_0xb41b('0x36')](_0x1488c8['query'][_0xb41b('0x36')]);_0x29917e[_0xb41b('0x1d')]=qs[_0xb41b('0x1d')](_0x1488c8[_0xb41b('0x2e')]['offset']);}return _0xb7e8f4[_0xb41b('0x89')](_0x29917e);}})['then'](function(_0x39cdd0){if(_0x39cdd0){return _0x39cdd0?{'count':_0x448994,'rows':_0x39cdd0}:null;}})['then'](respondWithResult(_0x51a6c0,null))[_0xb41b('0x47')](handleError(_0x51a6c0,null));}; \ No newline at end of file +var _0x3ee7=['from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','forEach','userSmsQueue:remove','omit','spread','removeAgents','isArray','getAgents','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','stack','name','send','index','SmsQueue','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filters','pick','merge','map','VIRTUAL','field','filter','options','include','findAll','rows','params','find','catch','create','body','user','UserProfileSection','userProfileId','autoAssociation','describe','findOne','hasOwnProperty','SmsQueueId','UserSmsQueue','findAndCountAll','UserId','agent','smsPause','createdAt','format','SIP','getTeams','Team','addTeams','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','emit','userSmsQueue:save','removeTeams','ids','User','Agents','select','tq.TeamId'];(function(_0xacc118,_0x3aa0d1){var _0x51c83d=function(_0x2a9e9f){while(--_0x2a9e9f){_0xacc118['push'](_0xacc118['shift']());}};_0x51c83d(++_0x3aa0d1);}(_0x3ee7,0x98));var _0x73ee=function(_0x4ba260,_0x3deaa1){_0x4ba260=_0x4ba260-0x0;var _0x943ccc=_0x3ee7[_0x4ba260];return _0x943ccc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x73ee('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x73ee('0x1'));var rp=require('request-promise');var moment=require(_0x73ee('0x2'));var BPromise=require(_0x73ee('0x3'));var Mustache=require(_0x73ee('0x4'));var util=require(_0x73ee('0x5'));var path=require(_0x73ee('0x6'));var sox=require(_0x73ee('0x7'));var csv=require(_0x73ee('0x8'));var ejs=require(_0x73ee('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x73ee('0xa'));var crypto=require(_0x73ee('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x73ee('0xc'));var toCsv=require('to-csv');var querystring=require(_0x73ee('0xd'));var Papa=require(_0x73ee('0xe'));var Redis=require(_0x73ee('0xf'));var authService=require(_0x73ee('0x10'));var qs=require(_0x73ee('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x73ee('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x73ee('0x13'));var db=require('../../mysqldb')['db'];config[_0x73ee('0x14')]=_[_0x73ee('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x73ee('0x16'))(new Redis(config[_0x73ee('0x14')]));require('./smsQueue.socket')[_0x73ee('0x17')](socket);function respondWithStatusCode(_0x5ddaec,_0x2cff0d){_0x2cff0d=_0x2cff0d||0xcc;return function(_0x4e0ed5){if(_0x4e0ed5){return _0x5ddaec[_0x73ee('0x18')](_0x2cff0d);}return _0x5ddaec[_0x73ee('0x19')](_0x2cff0d)[_0x73ee('0x1a')]();};}function respondWithResult(_0x487d52,_0x56b13a){_0x56b13a=_0x56b13a||0xc8;return function(_0x14899e){if(_0x14899e){return _0x487d52[_0x73ee('0x19')](_0x56b13a)['json'](_0x14899e);}};}function respondWithFilteredResult(_0x4a9850,_0x5cd3c8){return function(_0x4a2458){if(_0x4a2458){var _0x539045=_0x4a2458[_0x73ee('0x1b')],_0x17af51=_0x5cd3c8[_0x73ee('0x1c')],_0x280a37=_0x5cd3c8[_0x73ee('0x1c')]+_0x5cd3c8['limit'],_0x492593;if(_0x280a37>=_0x539045){_0x280a37=_0x539045;_0x492593=0xc8;}else{_0x492593=0xce;}_0x4a9850[_0x73ee('0x19')](_0x492593);return _0x4a9850['set'](_0x73ee('0x1d'),_0x17af51+'-'+_0x280a37+'/'+_0x539045)[_0x73ee('0x1e')](_0x4a2458);}return null;};}function patchUpdates(_0x1b4a19){return function(_0x4a2382){try{jsonpatch[_0x73ee('0x1f')](_0x4a2382,_0x1b4a19,!![]);}catch(_0xbbad3d){return BPromise[_0x73ee('0x20')](_0xbbad3d);}return _0x4a2382[_0x73ee('0x21')]();};}function saveUpdates(_0x1acef1,_0x4a924a){return function(_0x2409ed){if(_0x2409ed){return _0x2409ed[_0x73ee('0x22')](_0x1acef1)[_0x73ee('0x23')](function(_0x4cd55f){return _0x4cd55f;});}return null;};}function removeEntity(_0x538049,_0x1d16b4){return function(_0x183d62){if(_0x183d62){return _0x183d62[_0x73ee('0x24')]()[_0x73ee('0x23')](function(){var _0xa91906=_0x183d62[_0x73ee('0x25')]({'plain':!![]});var _0x572a84=_0x73ee('0x26');return db[_0x73ee('0x27')][_0x73ee('0x24')]({'where':{'type':_0x572a84,'resourceId':_0xa91906['id']}})['then'](function(){return _0x183d62;});})['then'](function(){_0x538049[_0x73ee('0x19')](0xcc)[_0x73ee('0x1a')]();});}};}function handleEntityNotFound(_0x5cd304,_0x4e950a){return function(_0x558551){if(!_0x558551){_0x5cd304[_0x73ee('0x18')](0x194);}return _0x558551;};}function handleError(_0x3b2b9e,_0x2772d5){_0x2772d5=_0x2772d5||0x1f4;return function(_0x2485a1){logger['error'](_0x2485a1[_0x73ee('0x28')]);if(_0x2485a1[_0x73ee('0x29')]){delete _0x2485a1[_0x73ee('0x29')];}_0x3b2b9e[_0x73ee('0x19')](_0x2772d5)[_0x73ee('0x2a')](_0x2485a1);};}exports[_0x73ee('0x2b')]=function(_0x5cb803,_0x2de8a6){var _0x1444d6={},_0x45b9bf={},_0x4ebdc5={'count':0x0,'rows':[]};var _0x52d3f1=db[_0x73ee('0x2c')][_0x73ee('0x2d')];_0x45b9bf[_0x73ee('0x2e')]=_[_0x73ee('0x2f')](_0x52d3f1);_0x45b9bf[_0x73ee('0x30')]=_[_0x73ee('0x2f')](_0x5cb803['query']);_0x45b9bf['filters']=_[_0x73ee('0x31')](_0x45b9bf[_0x73ee('0x2e')],_0x45b9bf[_0x73ee('0x30')]);_0x1444d6['attributes']=_['intersection'](_0x45b9bf['model'],qs[_0x73ee('0x32')](_0x5cb803['query'][_0x73ee('0x32')]));_0x1444d6['attributes']=_0x1444d6[_0x73ee('0x33')][_0x73ee('0x34')]?_0x1444d6[_0x73ee('0x33')]:_0x45b9bf['model'];if(!_0x5cb803[_0x73ee('0x30')]['hasOwnProperty'](_0x73ee('0x35'))){_0x1444d6['limit']=qs[_0x73ee('0x36')](_0x5cb803[_0x73ee('0x30')][_0x73ee('0x36')]);_0x1444d6['offset']=qs[_0x73ee('0x1c')](_0x5cb803[_0x73ee('0x30')][_0x73ee('0x1c')]);}_0x1444d6[_0x73ee('0x37')]=qs['sort'](_0x5cb803[_0x73ee('0x30')][_0x73ee('0x38')]);_0x1444d6[_0x73ee('0x39')]=qs[_0x73ee('0x3a')](_[_0x73ee('0x3b')](_0x5cb803[_0x73ee('0x30')],_0x45b9bf[_0x73ee('0x3a')]));if(_0x5cb803['query']['filter']){_0x1444d6[_0x73ee('0x39')]=_[_0x73ee('0x3c')](_0x1444d6[_0x73ee('0x39')],{'$or':_[_0x73ee('0x3d')](_0x52d3f1,function(_0x22c824){if(_0x22c824['type']['key']!==_0x73ee('0x3e')){var _0x4843b3={};_0x4843b3[_0x22c824[_0x73ee('0x3f')]]={'$like':'%'+_0x5cb803[_0x73ee('0x30')][_0x73ee('0x40')]+'%'};return _0x4843b3;}})});}_0x1444d6=_[_0x73ee('0x3c')]({},_0x1444d6,_0x5cb803[_0x73ee('0x41')]);var _0x22b2a9={'where':_0x1444d6[_0x73ee('0x39')]};return db['SmsQueue'][_0x73ee('0x1b')](_0x22b2a9)[_0x73ee('0x23')](function(_0x317d7b){_0x4ebdc5[_0x73ee('0x1b')]=_0x317d7b;if(_0x5cb803[_0x73ee('0x30')]['includeAll']){_0x1444d6[_0x73ee('0x42')]=[{'all':!![]}];}return db[_0x73ee('0x2c')][_0x73ee('0x43')](_0x1444d6);})[_0x73ee('0x23')](function(_0x2ac387){_0x4ebdc5[_0x73ee('0x44')]=_0x2ac387;return _0x4ebdc5;})[_0x73ee('0x23')](respondWithFilteredResult(_0x2de8a6,_0x1444d6))['catch'](handleError(_0x2de8a6,null));};exports['show']=function(_0x9a7ea5,_0x5cf676){var _0x2a4ace={'raw':!![],'where':{'id':_0x9a7ea5[_0x73ee('0x45')]['id']}},_0x367e69={};_0x367e69['model']=_['keys'](db[_0x73ee('0x2c')]['rawAttributes']);_0x367e69[_0x73ee('0x30')]=_['keys'](_0x9a7ea5['query']);_0x367e69[_0x73ee('0x3a')]=_[_0x73ee('0x31')](_0x367e69[_0x73ee('0x2e')],_0x367e69[_0x73ee('0x30')]);_0x2a4ace['attributes']=_[_0x73ee('0x31')](_0x367e69[_0x73ee('0x2e')],qs[_0x73ee('0x32')](_0x9a7ea5[_0x73ee('0x30')][_0x73ee('0x32')]));_0x2a4ace[_0x73ee('0x33')]=_0x2a4ace[_0x73ee('0x33')][_0x73ee('0x34')]?_0x2a4ace[_0x73ee('0x33')]:_0x367e69[_0x73ee('0x2e')];if(_0x9a7ea5['query']['includeAll']){_0x2a4ace[_0x73ee('0x42')]=[{'all':!![]}];}_0x2a4ace=_[_0x73ee('0x3c')]({},_0x2a4ace,_0x9a7ea5[_0x73ee('0x41')]);return db[_0x73ee('0x2c')][_0x73ee('0x46')](_0x2a4ace)[_0x73ee('0x23')](handleEntityNotFound(_0x5cf676,null))[_0x73ee('0x23')](respondWithResult(_0x5cf676,null))[_0x73ee('0x47')](handleError(_0x5cf676,null));};exports['create']=function(_0x4543dc,_0x42d2f8){return db['SmsQueue'][_0x73ee('0x48')](_0x4543dc[_0x73ee('0x49')],{})[_0x73ee('0x23')](function(_0x2bec9b){var _0x9fa461=_0x4543dc[_0x73ee('0x4a')]['get']({'plain':!![]});if(!_0x9fa461)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9fa461['role']==='user'){var _0x37fc16=_0x2bec9b[_0x73ee('0x25')]({'plain':!![]});var _0x56c798='SmsQueues';return db[_0x73ee('0x4b')]['find']({'where':{'name':_0x56c798,'userProfileId':_0x9fa461[_0x73ee('0x4c')]},'raw':!![]})[_0x73ee('0x23')](function(_0x3b49bb){if(_0x3b49bb&&_0x3b49bb[_0x73ee('0x4d')]===0x0){return db[_0x73ee('0x27')][_0x73ee('0x48')]({'name':_0x37fc16[_0x73ee('0x29')],'resourceId':_0x37fc16['id'],'type':_0x3b49bb[_0x73ee('0x29')],'sectionId':_0x3b49bb['id']},{})['then'](function(){return _0x2bec9b;});}else{return _0x2bec9b;}})[_0x73ee('0x47')](function(_0x44c7c9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44c7c9);throw _0x44c7c9;});}return _0x2bec9b;})[_0x73ee('0x23')](respondWithResult(_0x42d2f8,0xc9))[_0x73ee('0x47')](handleError(_0x42d2f8,null));};exports[_0x73ee('0x22')]=function(_0x5599f7,_0x4e65f4){if(_0x5599f7[_0x73ee('0x49')]['id']){delete _0x5599f7[_0x73ee('0x49')]['id'];}return db[_0x73ee('0x2c')][_0x73ee('0x46')]({'where':{'id':_0x5599f7[_0x73ee('0x45')]['id']}})[_0x73ee('0x23')](handleEntityNotFound(_0x4e65f4,null))[_0x73ee('0x23')](saveUpdates(_0x5599f7[_0x73ee('0x49')],null))[_0x73ee('0x23')](respondWithResult(_0x4e65f4,null))['catch'](handleError(_0x4e65f4,null));};exports[_0x73ee('0x24')]=function(_0x133119,_0x2cb580){return db['SmsQueue'][_0x73ee('0x46')]({'where':{'id':_0x133119[_0x73ee('0x45')]['id']}})[_0x73ee('0x23')](handleEntityNotFound(_0x2cb580,null))['then'](removeEntity(_0x2cb580,null))[_0x73ee('0x47')](handleError(_0x2cb580,null));};exports[_0x73ee('0x4e')]=function(_0x38b11d,_0x55e2c9){return db[_0x73ee('0x2c')][_0x73ee('0x4e')]()[_0x73ee('0x23')](respondWithResult(_0x55e2c9,null))[_0x73ee('0x47')](handleError(_0x55e2c9,null));};exports['getMembers']=function(_0x4aeaf1,_0x2e43c3,_0x671870){var _0x4347ca={'raw':!![],'where':{}},_0x319e10={},_0x4cf30e;return db[_0x73ee('0x2c')][_0x73ee('0x4f')]({'where':{'id':_0x4aeaf1[_0x73ee('0x45')]['id']}})[_0x73ee('0x23')](handleEntityNotFound(_0x2e43c3,null))[_0x73ee('0x23')](function(_0x15ec52){if(_0x15ec52){_0x4cf30e=_0x15ec52[_0x73ee('0x25')]({'plain':!![]});_0x319e10['model']=_[_0x73ee('0x2f')](db['UserSmsQueue'][_0x73ee('0x2d')]);_0x319e10[_0x73ee('0x30')]=_[_0x73ee('0x2f')](_0x4aeaf1[_0x73ee('0x30')]);_0x319e10[_0x73ee('0x3a')]=_['intersection'](_0x319e10[_0x73ee('0x2e')],_0x319e10[_0x73ee('0x30')]);_0x4347ca[_0x73ee('0x33')]=_['intersection'](_0x319e10[_0x73ee('0x2e')],qs[_0x73ee('0x32')](_0x4aeaf1[_0x73ee('0x30')]['fields']));_0x4347ca['attributes']=_0x4347ca['attributes'][_0x73ee('0x34')]?_0x4347ca[_0x73ee('0x33')]:_0x319e10[_0x73ee('0x2e')];if(!_0x4aeaf1[_0x73ee('0x30')][_0x73ee('0x50')](_0x73ee('0x35'))){_0x4347ca['limit']=qs[_0x73ee('0x36')](_0x4aeaf1[_0x73ee('0x30')][_0x73ee('0x36')]);_0x4347ca[_0x73ee('0x1c')]=qs['offset'](_0x4aeaf1[_0x73ee('0x30')][_0x73ee('0x1c')]);}_0x4347ca[_0x73ee('0x37')]=qs[_0x73ee('0x38')](_0x4aeaf1['query'][_0x73ee('0x38')]);_0x4347ca[_0x73ee('0x39')]=qs[_0x73ee('0x3a')](_['pick'](_0x4aeaf1[_0x73ee('0x30')],_0x319e10[_0x73ee('0x3a')]));_0x4347ca[_0x73ee('0x39')][_0x73ee('0x51')]=_0x15ec52['id'];if(_0x4aeaf1[_0x73ee('0x30')][_0x73ee('0x40')]){_0x4347ca[_0x73ee('0x39')]=_[_0x73ee('0x3c')](_0x4347ca[_0x73ee('0x39')],{'$or':_[_0x73ee('0x3d')](_0x4347ca[_0x73ee('0x33')],function(_0x4fbf7f){var _0x4f523a={};_0x4f523a[_0x4fbf7f]={'$like':'%'+_0x4aeaf1[_0x73ee('0x30')][_0x73ee('0x40')]+'%'};return _0x4f523a;})});}_0x4347ca=_[_0x73ee('0x3c')]({},_0x4347ca,_0x4aeaf1[_0x73ee('0x41')]);return db[_0x73ee('0x52')][_0x73ee('0x43')](_0x4347ca);}})[_0x73ee('0x23')](function(_0x3e2dcf){if(_0x3e2dcf){return db['User'][_0x73ee('0x53')]({'where':{'id':_[_0x73ee('0x3d')](_0x3e2dcf,_0x73ee('0x54')),'role':_0x73ee('0x55')},'attributes':['id','name',_0x73ee('0x56'),'updatedAt',_0x73ee('0x57')]});}})[_0x73ee('0x23')](function(_0x5bf5f9){if(_0x5bf5f9){return{'count':_0x5bf5f9[_0x73ee('0x1b')],'rows':_[_0x73ee('0x3d')](_0x5bf5f9[_0x73ee('0x44')],function(_0x55a1e3){return{'membername':_0x55a1e3[_0x73ee('0x29')],'UserId':_0x55a1e3['id'],'queue_name':_0x4cf30e[_0x73ee('0x29')],'SmsQueueId':_0x4cf30e['id'],'interface':util[_0x73ee('0x58')]('%s/%s',_0x73ee('0x59'),_0x55a1e3[_0x73ee('0x29')]),'penalty':0x0,'paused':_0x55a1e3[_0x73ee('0x56')],'createdAt':_0x55a1e3['createdAt'],'updatedAt':_0x55a1e3['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x73ee('0x23')](respondWithFilteredResult(_0x2e43c3,_0x4347ca))['catch'](handleError(_0x2e43c3,null));};exports[_0x73ee('0x5a')]=function(_0x3d260b,_0x57cf71,_0x5b7ab5){var _0x2c3b9b={};var _0x2c080e={};var _0xf834a9;var _0x1939ab;return db[_0x73ee('0x2c')]['findOne']({'where':{'id':_0x3d260b[_0x73ee('0x45')]['id']}})['then'](handleEntityNotFound(_0x57cf71,null))[_0x73ee('0x23')](function(_0x501895){if(_0x501895){_0xf834a9=_0x501895;_0x2c080e['model']=_[_0x73ee('0x2f')](db[_0x73ee('0x5b')][_0x73ee('0x2d')]);_0x2c080e[_0x73ee('0x30')]=_[_0x73ee('0x2f')](_0x3d260b[_0x73ee('0x30')]);_0x2c080e[_0x73ee('0x3a')]=_[_0x73ee('0x31')](_0x2c080e[_0x73ee('0x2e')],_0x2c080e['query']);_0x2c3b9b['attributes']=_[_0x73ee('0x31')](_0x2c080e['model'],qs[_0x73ee('0x32')](_0x3d260b[_0x73ee('0x30')][_0x73ee('0x32')]));_0x2c3b9b[_0x73ee('0x33')]=_0x2c3b9b['attributes']['length']?_0x2c3b9b[_0x73ee('0x33')]:_0x2c080e[_0x73ee('0x2e')];_0x2c3b9b[_0x73ee('0x37')]=qs[_0x73ee('0x38')](_0x3d260b[_0x73ee('0x30')]['sort']);_0x2c3b9b['where']=qs['filters'](_['pick'](_0x3d260b[_0x73ee('0x30')],_0x2c080e['filters']));if(_0x3d260b[_0x73ee('0x30')][_0x73ee('0x40')]){_0x2c3b9b[_0x73ee('0x39')]=_[_0x73ee('0x3c')](_0x2c3b9b['where'],{'$or':_[_0x73ee('0x3d')](_0x2c3b9b['attributes'],function(_0x659999){var _0x1bd24a={};_0x1bd24a[_0x659999]={'$like':'%'+_0x3d260b[_0x73ee('0x30')][_0x73ee('0x40')]+'%'};return _0x1bd24a;})});}_0x2c3b9b=_[_0x73ee('0x3c')]({},_0x2c3b9b,_0x3d260b[_0x73ee('0x41')]);return _0xf834a9[_0x73ee('0x5a')](_0x2c3b9b);}})[_0x73ee('0x23')](function(_0x4d5967){if(_0x4d5967){_0x1939ab=_0x4d5967[_0x73ee('0x34')];if(!_0x3d260b[_0x73ee('0x30')][_0x73ee('0x50')](_0x73ee('0x35'))){_0x2c3b9b[_0x73ee('0x36')]=qs[_0x73ee('0x36')](_0x3d260b[_0x73ee('0x30')]['limit']);_0x2c3b9b[_0x73ee('0x1c')]=qs[_0x73ee('0x1c')](_0x3d260b[_0x73ee('0x30')][_0x73ee('0x1c')]);}return _0xf834a9['getTeams'](_0x2c3b9b);}})[_0x73ee('0x23')](function(_0x474a47){if(_0x474a47){return _0x474a47?{'count':_0x1939ab,'rows':_0x474a47}:null;}})[_0x73ee('0x23')](respondWithResult(_0x57cf71,null))[_0x73ee('0x47')](handleError(_0x57cf71,null));};exports[_0x73ee('0x5c')]=function(_0x3120b0,_0x4bde67,_0x19f4e9){var _0x51c3b2=_0x3120b0[_0x73ee('0x49')]['teams'];return db[_0x73ee('0x5b')][_0x73ee('0x43')]({'where':{'id':_[_0x73ee('0x3d')](_0x51c3b2,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x73ee('0x29'),_0x73ee('0x5d'),_0x73ee('0x5e'),'interface'],'raw':!![]}]})[_0x73ee('0x23')](function(_0xe6e10e){if(_0xe6e10e){var _0x17f3d9=_[_0x73ee('0x5f')](_0xe6e10e,function(_0x4b8120){var _0x422713=_0x4b8120[_0x73ee('0x25')]({'plain':!![]});return _0x422713['Agents'];});return db[_0x73ee('0x2c')][_0x73ee('0x46')]({'where':{'id':_0x3120b0[_0x73ee('0x45')]['id']}})[_0x73ee('0x23')](function(_0x1d6b57){return db[_0x73ee('0x60')][_0x73ee('0x61')](function(_0x5b4ccb){return _0x1d6b57[_0x73ee('0x5c')](_[_0x73ee('0x3d')](_0x51c3b2,'id'),{'transaction':_0x5b4ccb})[_0x73ee('0x23')](function(){return BPromise[_0x73ee('0x62')](_0x17f3d9,function(_0x4c4a87){return db[_0x73ee('0x52')][_0x73ee('0x63')]({'where':{'UserId':_0x4c4a87['id'],'SmsQueueId':_0x3120b0[_0x73ee('0x45')]['id']},'transaction':_0x5b4ccb});});})[_0x73ee('0x23')](function(){_0x17f3d9['forEach'](function(_0x27b28e){socket[_0x73ee('0x64')](_0x73ee('0x65'),{'UserId':_0x27b28e['id'],'SmsQueueId':_0x1d6b57['id']});});});});});}})[_0x73ee('0x23')](respondWithStatusCode(_0x4bde67,null))[_0x73ee('0x47')](handleError(_0x4bde67,null));};exports[_0x73ee('0x66')]=function(_0x52778a,_0x352ac3,_0x3a03af){return db[_0x73ee('0x5b')]['findAll']({'where':{'id':_0x52778a['query'][_0x73ee('0x67')]},'attributes':['id'],'include':[{'model':db[_0x73ee('0x68')],'as':_0x73ee('0x69'),'attributes':['id'],'raw':!![]}]})[_0x73ee('0x23')](handleEntityNotFound(_0x352ac3,null))[_0x73ee('0x23')](function(_0x5eded5){var _0x5e89ac=_[_0x73ee('0x3d')](_0x5eded5,'id');var _0x17edb2=[];var _0x18b9fc=[];var _0x26a344=squel[_0x73ee('0x6a')]();_0x26a344[_0x73ee('0x3f')](_0x73ee('0x6b'))[_0x73ee('0x6c')](_0x73ee('0x6d'),'tq')[_0x73ee('0x6e')]('user_has_teams','ut',_0x73ee('0x6f'))['where'](_0x73ee('0x70'),_0x52778a[_0x73ee('0x45')]['id']);for(var _0x22f44d=0x0;_0x22f44d<_0x5eded5[_0x73ee('0x34')];_0x22f44d+=0x1){let _0xe89bfb=_0x5eded5[_0x22f44d];for(var _0x103f26=0x0;_0x103f26<_0xe89bfb['Agents'][_0x73ee('0x34')];_0x103f26+=0x1){let _0x3bf6e0=_0xe89bfb[_0x73ee('0x69')][_0x103f26];var _0x1630bc=_0x26a344['clone']();_0x1630bc[_0x73ee('0x39')](_0x73ee('0x71'),_0x3bf6e0['id']);_0x18b9fc['push'](db['sequelize'][_0x73ee('0x30')](_0x1630bc['toString'](),{'type':db['sequelize'][_0x73ee('0x72')][_0x73ee('0x73')]})[_0x73ee('0x23')](function(_0x573dd1){if(_0x573dd1['length']===0x1){return _0x3bf6e0['id'];}else{var _0x135796=_[_0x73ee('0x74')](_[_0x73ee('0x3d')](_0x573dd1,_0x73ee('0x75')),function(_0xaa20e7){return _[_0x73ee('0x76')](_0x5e89ac,_0xaa20e7);});if(_0x135796){return _0x3bf6e0['id'];}}}));}}return BPromise[_0x73ee('0x77')](_0x18b9fc)[_0x73ee('0x23')](function(_0x247fc7){_0x17edb2=_(_0x17edb2)['union'](_0x247fc7)[_0x73ee('0x78')]()[_0x73ee('0x79')]();return db[_0x73ee('0x2c')][_0x73ee('0x46')]({'where':{'id':_0x52778a[_0x73ee('0x45')]['id']}})[_0x73ee('0x23')](function(_0x5da936){return db[_0x73ee('0x60')][_0x73ee('0x61')](function(_0x15f427){return _0x5da936['removeTeams'](_0x52778a[_0x73ee('0x30')][_0x73ee('0x67')],{'transaction':_0x15f427})['then'](function(){if(!_[_0x73ee('0x7a')](_0x17edb2)){return _0x5da936['removeAgents'](_0x17edb2,{'transaction':_0x15f427});}})[_0x73ee('0x23')](function(){_0x17edb2[_0x73ee('0x7b')](function(_0xdc049f){socket[_0x73ee('0x64')](_0x73ee('0x7c'),{'UserId':_0xdc049f,'SmsQueueId':_0x5da936['id']});});});});});});})[_0x73ee('0x23')](respondWithStatusCode(_0x352ac3,null))[_0x73ee('0x47')](handleError(_0x352ac3,null));};exports['addAgents']=function(_0x4613d3,_0x3b4cb0,_0x7db9d7){return db[_0x73ee('0x2c')][_0x73ee('0x46')]({'where':{'id':_0x4613d3['params']['id']}})[_0x73ee('0x23')](handleEntityNotFound(_0x3b4cb0,null))[_0x73ee('0x23')](function(_0x20258a){if(_0x20258a){return _0x20258a['addAgents'](_0x4613d3[_0x73ee('0x49')][_0x73ee('0x67')],_[_0x73ee('0x7d')](_0x4613d3['body'],[_0x73ee('0x67'),'id'])||{})[_0x73ee('0x7e')](function(_0xed3899){for(var _0x3a1c25=0x0;_0x3a1c25<_0x4613d3[_0x73ee('0x49')][_0x73ee('0x67')][_0x73ee('0x34')];_0x3a1c25+=0x1){socket[_0x73ee('0x64')](_0x73ee('0x65'),{'UserId':_0x4613d3['body'][_0x73ee('0x67')][_0x3a1c25],'SmsQueueId':_0x4613d3[_0x73ee('0x45')]['id']});}return _0xed3899;});}})[_0x73ee('0x23')](respondWithResult(_0x3b4cb0,null))[_0x73ee('0x47')](handleError(_0x3b4cb0,null));};exports['removeAgents']=function(_0xa522e6,_0x83d8fa,_0xd5ba58){return db['SmsQueue'][_0x73ee('0x46')]({'where':{'id':_0xa522e6[_0x73ee('0x45')]['id']}})[_0x73ee('0x23')](handleEntityNotFound(_0x83d8fa,null))['then'](function(_0x251fe6){if(_0x251fe6){return _0x251fe6[_0x73ee('0x7f')](_0xa522e6[_0x73ee('0x30')]['ids'])['then'](function(){if(_[_0x73ee('0x80')](_0xa522e6[_0x73ee('0x30')]['ids'])){for(var _0x30855e=0x0;_0x30855e<_0xa522e6[_0x73ee('0x30')]['ids'][_0x73ee('0x34')];_0x30855e+=0x1){socket[_0x73ee('0x64')](_0x73ee('0x7c'),{'UserId':Number(_0xa522e6[_0x73ee('0x30')][_0x73ee('0x67')][_0x30855e]),'SmsQueueId':Number(_0xa522e6[_0x73ee('0x45')]['id'])});}}else{socket[_0x73ee('0x64')](_0x73ee('0x7c'),{'UserId':Number(_0xa522e6[_0x73ee('0x30')][_0x73ee('0x67')]),'SmsQueueId':Number(_0xa522e6[_0x73ee('0x45')]['id'])});}});}})[_0x73ee('0x23')](respondWithStatusCode(_0x83d8fa,null))['catch'](handleError(_0x83d8fa,null));};exports[_0x73ee('0x81')]=function(_0x59c73b,_0xb504de,_0x5d2185){var _0x45e598={};var _0x167cea={};var _0x3766bf;var _0x586e1d;return db[_0x73ee('0x2c')][_0x73ee('0x4f')]({'where':{'id':_0x59c73b[_0x73ee('0x45')]['id']}})[_0x73ee('0x23')](handleEntityNotFound(_0xb504de,null))['then'](function(_0x7f3ca0){if(_0x7f3ca0){_0x3766bf=_0x7f3ca0;_0x167cea[_0x73ee('0x2e')]=_[_0x73ee('0x2f')](db['User'][_0x73ee('0x2d')]);_0x167cea[_0x73ee('0x30')]=_['keys'](_0x59c73b['query']);_0x167cea[_0x73ee('0x3a')]=_[_0x73ee('0x31')](_0x167cea[_0x73ee('0x2e')],_0x167cea[_0x73ee('0x30')]);_0x45e598[_0x73ee('0x33')]=_['intersection'](_0x167cea['model'],qs[_0x73ee('0x32')](_0x59c73b['query'][_0x73ee('0x32')]));_0x45e598[_0x73ee('0x33')]=_0x45e598['attributes'][_0x73ee('0x34')]?_0x45e598[_0x73ee('0x33')]:_0x167cea[_0x73ee('0x2e')];_0x45e598[_0x73ee('0x37')]=qs[_0x73ee('0x38')](_0x59c73b[_0x73ee('0x30')][_0x73ee('0x38')]);_0x45e598[_0x73ee('0x39')]=qs['filters'](_[_0x73ee('0x3b')](_0x59c73b['query'],_0x167cea[_0x73ee('0x3a')]));if(_0x59c73b[_0x73ee('0x30')]['filter']){_0x45e598['where']=_[_0x73ee('0x3c')](_0x45e598[_0x73ee('0x39')],{'$or':_[_0x73ee('0x3d')](_0x45e598[_0x73ee('0x33')],function(_0xe53586){var _0x2a0df8={};_0x2a0df8[_0xe53586]={'$like':'%'+_0x59c73b[_0x73ee('0x30')][_0x73ee('0x40')]+'%'};return _0x2a0df8;})});}_0x45e598=_[_0x73ee('0x3c')]({},_0x45e598,_0x59c73b[_0x73ee('0x41')]);return _0x3766bf[_0x73ee('0x81')](_0x45e598);}})[_0x73ee('0x23')](function(_0x494951){if(_0x494951){_0x586e1d=_0x494951[_0x73ee('0x34')];if(!_0x59c73b[_0x73ee('0x30')][_0x73ee('0x50')](_0x73ee('0x35'))){_0x45e598[_0x73ee('0x36')]=qs[_0x73ee('0x36')](_0x59c73b[_0x73ee('0x30')]['limit']);_0x45e598[_0x73ee('0x1c')]=qs['offset'](_0x59c73b[_0x73ee('0x30')][_0x73ee('0x1c')]);}return _0x3766bf[_0x73ee('0x81')](_0x45e598);}})[_0x73ee('0x23')](function(_0x232274){if(_0x232274){return _0x232274?{'count':_0x586e1d,'rows':_0x232274}:null;}})[_0x73ee('0x23')](respondWithResult(_0xb504de,null))[_0x73ee('0x47')](handleError(_0xb504de,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 407b097..cd827b1 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 _0x3639=['exports','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3639,0x1d1));var _0x9363=function(_0x725503,_0x1eeacb){_0x725503=_0x725503-0x0;var _0x552322=_0x3639[_0x725503];return _0x552322;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x9363('0x0')](0x0);var events={'afterCreate':_0x9363('0x1'),'afterUpdate':_0x9363('0x2'),'afterDestroy':_0x9363('0x3')};function emitEvent(_0x4a534e){return function(_0x4df982,_0x469931,_0x34ad5a){SmsQueueEvents[_0x9363('0x4')](_0x4a534e+':'+_0x4df982['id'],_0x4df982);SmsQueueEvents['emit'](_0x4a534e,_0x4df982);_0x34ad5a(null);};}for(var e in events){if(events[_0x9363('0x5')](e)){var event=events[e];SmsQueue[_0x9363('0x6')](e,emitEvent(event));}}module[_0x9363('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0x052f=['hasOwnProperty','hook','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x052f,0x17c));var _0xf052=function(_0x11c130,_0x598099){_0x11c130=_0x11c130-0x0;var _0x3b3028=_0x052f[_0x11c130];return _0x3b3028;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xf052('0x0'))['db'][_0xf052('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xf052('0x2')](0x0);var events={'afterCreate':_0xf052('0x3'),'afterUpdate':_0xf052('0x4'),'afterDestroy':_0xf052('0x5')};function emitEvent(_0x246e9e){return function(_0x5dc103,_0x5e2169,_0xddc11e){SmsQueueEvents[_0xf052('0x6')](_0x246e9e+':'+_0x5dc103['id'],_0x5dc103);SmsQueueEvents['emit'](_0x246e9e,_0x5dc103);_0xddc11e(null);};}for(var e in events){if(events[_0xf052('0x7')](e)){var event=events[e];SmsQueue[_0xf052('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index ef872aa..93d597e 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 _0x0463=['../../config/environment','./smsQueue.attributes','define','sms_queues','lodash','util','../../config/logger','api','path','rimraf'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x0463,0x144));var _0x3046=function(_0x21f47e,_0x25d486){_0x21f47e=_0x21f47e-0x0;var _0x120f9b=_0x0463[_0x21f47e];return _0x120f9b;};'use strict';var _=require(_0x3046('0x0'));var util=require(_0x3046('0x1'));var logger=require(_0x3046('0x2'))(_0x3046('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3046('0x4'));var rimraf=require(_0x3046('0x5'));var config=require(_0x3046('0x6'));var attributes=require(_0x3046('0x7'));module['exports']=function(_0x100831,_0xc46ec9){return _0x100831[_0x3046('0x8')]('SmsQueue',attributes,{'tableName':_0x3046('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f38=['./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x36b444,_0x505b35){var _0x786323=function(_0x146af0){while(--_0x146af0){_0x36b444['push'](_0x36b444['shift']());}};_0x786323(++_0x505b35);}(_0x4f38,0x1b5));var _0x84f3=function(_0x4eec18,_0x374de3){_0x4eec18=_0x4eec18-0x0;var _0x4f8330=_0x4f38[_0x4eec18];return _0x4f8330;};'use strict';var _=require(_0x84f3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x84f3('0x1'));var moment=require(_0x84f3('0x2'));var BPromise=require('bluebird');var rp=require(_0x84f3('0x3'));var fs=require('fs');var path=require(_0x84f3('0x4'));var rimraf=require(_0x84f3('0x5'));var config=require(_0x84f3('0x6'));var attributes=require(_0x84f3('0x7'));module[_0x84f3('0x8')]=function(_0x452f93,_0x15cff6){return _0x452f93[_0x84f3('0x9')](_0x84f3('0xa'),attributes,{'tableName':_0x84f3('0xb'),'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 715ee19..059ed4c 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 _0x8be6=['attributes','limit','include','map','model','debug','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','register','request','then','info','SmsQueue,\x20%s,\x20%s','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where'];(function(_0x3de46d,_0x2eea33){var _0x228887=function(_0x24ca4a){while(--_0x24ca4a){_0x3de46d['push'](_0x3de46d['shift']());}};_0x228887(++_0x2eea33);}(_0x8be6,0x140));var _0x68be=function(_0x222797,_0x2a5e88){_0x222797=_0x222797-0x0;var _0x1afd16=_0x8be6[_0x222797];return _0x1afd16;};'use strict';var _=require(_0x68be('0x0'));var util=require(_0x68be('0x1'));var moment=require(_0x68be('0x2'));var BPromise=require(_0x68be('0x3'));var rs=require(_0x68be('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x68be('0x5'));var logger=require(_0x68be('0x6'))('rpc');var config=require(_0x68be('0x7'));var jayson=require(_0x68be('0x8'));var client=jayson['client'][_0x68be('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x68be('0xa')],{'host':_0x68be('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x68be('0xa')]));require('./smsQueue.socket')[_0x68be('0xc')](socket);function respondWithRpcPromise(_0x2ec17a,_0x5340de,_0x24bfa5){return new BPromise(function(_0x9b7802,_0x778371){return client[_0x68be('0xd')](_0x2ec17a,_0x24bfa5)[_0x68be('0xe')](function(_0x52fe82){logger[_0x68be('0xf')](_0x68be('0x10'),_0x5340de,'request\x20sent');logger['debug'](_0x68be('0x11'),_0x5340de,_0x68be('0x12'),JSON[_0x68be('0x13')](_0x52fe82));if(_0x52fe82['error']){if(_0x52fe82[_0x68be('0x14')][_0x68be('0x15')]===0x1f4){logger[_0x68be('0x14')](_0x68be('0x10'),_0x5340de,_0x52fe82[_0x68be('0x14')][_0x68be('0x16')]);return _0x778371(_0x52fe82[_0x68be('0x14')][_0x68be('0x16')]);}logger[_0x68be('0x14')](_0x68be('0x10'),_0x5340de,_0x52fe82[_0x68be('0x14')][_0x68be('0x16')]);return _0x9b7802(_0x52fe82['error'][_0x68be('0x16')]);}else{logger['info'](_0x68be('0x10'),_0x5340de,'request\x20sent');_0x9b7802(_0x52fe82[_0x68be('0x17')][_0x68be('0x16')]);}})[_0x68be('0x18')](function(_0x1cc8f3){logger[_0x68be('0x14')](_0x68be('0x10'),_0x5340de,_0x1cc8f3);_0x778371(_0x1cc8f3);});});}exports[_0x68be('0x19')]=function(_0x23aad7){var _0x54f4d5=this;return new Promise(function(_0x171519,_0x44188a){return db[_0x68be('0x1a')][_0x68be('0x1b')]({'raw':_0x23aad7[_0x68be('0x1c')]?_0x23aad7[_0x68be('0x1c')][_0x68be('0x1d')]===undefined?!![]:![]:!![],'where':_0x23aad7[_0x68be('0x1c')]?_0x23aad7[_0x68be('0x1c')][_0x68be('0x1e')]||null:null,'attributes':_0x23aad7[_0x68be('0x1c')]?_0x23aad7['options'][_0x68be('0x1f')]||null:null,'limit':_0x23aad7[_0x68be('0x1c')]?_0x23aad7[_0x68be('0x1c')][_0x68be('0x20')]||null:null,'include':_0x23aad7[_0x68be('0x1c')]?_0x23aad7[_0x68be('0x1c')][_0x68be('0x21')]?_[_0x68be('0x22')](_0x23aad7[_0x68be('0x1c')][_0x68be('0x21')],function(_0x44241d){return{'model':db[_0x44241d[_0x68be('0x23')]],'as':_0x44241d['as'],'attributes':_0x44241d['attributes'],'include':_0x44241d[_0x68be('0x21')]?_['map'](_0x44241d[_0x68be('0x21')],function(_0x410ad0){return{'model':db[_0x410ad0[_0x68be('0x23')]],'as':_0x410ad0['as'],'attributes':_0x410ad0[_0x68be('0x1f')],'include':_0x410ad0[_0x68be('0x21')]?_[_0x68be('0x22')](_0x410ad0['include'],function(_0x35ef7e){return{'model':db[_0x35ef7e[_0x68be('0x23')]],'as':_0x35ef7e['as'],'attributes':_0x35ef7e[_0x68be('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x68be('0xe')](function(_0x50dcc3){logger['info']('GetSmsQueue',_0x23aad7);logger[_0x68be('0x24')](_0x68be('0x19'),_0x23aad7,JSON[_0x68be('0x13')](_0x50dcc3));_0x171519(_0x50dcc3);})['catch'](function(_0x245601){logger[_0x68be('0x14')](_0x68be('0x19'),_0x245601[_0x68be('0x16')],_0x23aad7);_0x44188a(_0x54f4d5['error'](0x1f4,_0x245601['message']));});});};exports[_0x68be('0x25')]=function(_0x24f122){var _0x4ee832=this;return new Promise(function(_0x23c5f0,_0x16c484){return db[_0x68be('0x1a')][_0x68be('0x26')]({'raw':_0x24f122[_0x68be('0x1c')]?_0x24f122[_0x68be('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x24f122[_0x68be('0x1c')]?_0x24f122[_0x68be('0x1c')]['where']||null:null,'attributes':_0x24f122[_0x68be('0x1c')]?_0x24f122[_0x68be('0x1c')][_0x68be('0x1f')]||null:null,'include':_0x24f122[_0x68be('0x1c')]?_0x24f122[_0x68be('0x1c')][_0x68be('0x21')]?_[_0x68be('0x22')](_0x24f122[_0x68be('0x1c')][_0x68be('0x21')],function(_0x59db54){return{'model':db[_0x59db54['model']],'as':_0x59db54['as'],'attributes':_0x59db54[_0x68be('0x1f')],'include':_0x59db54[_0x68be('0x21')]?_[_0x68be('0x22')](_0x59db54['include'],function(_0x51ea19){return{'model':db[_0x51ea19['model']],'as':_0x51ea19['as'],'attributes':_0x51ea19[_0x68be('0x1f')],'include':_0x51ea19[_0x68be('0x21')]?_[_0x68be('0x22')](_0x51ea19[_0x68be('0x21')],function(_0x5a1aa1){return{'model':db[_0x5a1aa1[_0x68be('0x23')]],'as':_0x5a1aa1['as'],'attributes':_0x5a1aa1[_0x68be('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x68be('0xe')](function(_0x2a8dc6){logger[_0x68be('0xf')](_0x68be('0x25'),_0x24f122);logger['debug'](_0x68be('0x25'),_0x24f122,JSON[_0x68be('0x13')](_0x2a8dc6));_0x23c5f0(_0x2a8dc6);})[_0x68be('0x18')](function(_0x5d514e){logger[_0x68be('0x14')](_0x68be('0x25'),_0x5d514e['message'],_0x24f122);_0x16c484(_0x4ee832['error'](0x1f4,_0x5d514e[_0x68be('0x16')]));});});}; \ No newline at end of file +var _0x4c5a=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','include','map','model','ShowSmsQueue','raw','lodash','bluebird'];(function(_0x33f057,_0x41104){var _0x4fa0c5=function(_0x14614a){while(--_0x14614a){_0x33f057['push'](_0x33f057['shift']());}};_0x4fa0c5(++_0x41104);}(_0x4c5a,0x1a0));var _0xa4c5=function(_0x1621dd,_0x172229){_0x1621dd=_0x1621dd-0x0;var _0x3b0046=_0x4c5a[_0x1621dd];return _0x3b0046;};'use strict';var _=require(_0xa4c5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa4c5('0x1'));var rs=require(_0xa4c5('0x2'));var fs=require('fs');var Redis=require(_0xa4c5('0x3'));var db=require(_0xa4c5('0x4'))['db'];var utils=require(_0xa4c5('0x5'));var logger=require(_0xa4c5('0x6'))(_0xa4c5('0x7'));var config=require(_0xa4c5('0x8'));var jayson=require(_0xa4c5('0x9'));var client=jayson['client'][_0xa4c5('0xa')]({'port':0x232a});config[_0xa4c5('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa4c5('0xc'))(new Redis(config[_0xa4c5('0xb')]));require('./smsQueue.socket')[_0xa4c5('0xd')](socket);function respondWithRpcPromise(_0x303236,_0x4dc37f,_0x31acb6){return new BPromise(function(_0x583113,_0x331f2a){return client[_0xa4c5('0xe')](_0x303236,_0x31acb6)[_0xa4c5('0xf')](function(_0x3355ca){logger[_0xa4c5('0x10')](_0xa4c5('0x11'),_0x4dc37f,_0xa4c5('0x12'));logger[_0xa4c5('0x13')](_0xa4c5('0x14'),_0x4dc37f,_0xa4c5('0x12'),JSON[_0xa4c5('0x15')](_0x3355ca));if(_0x3355ca[_0xa4c5('0x16')]){if(_0x3355ca[_0xa4c5('0x16')][_0xa4c5('0x17')]===0x1f4){logger[_0xa4c5('0x16')](_0xa4c5('0x11'),_0x4dc37f,_0x3355ca[_0xa4c5('0x16')][_0xa4c5('0x18')]);return _0x331f2a(_0x3355ca[_0xa4c5('0x16')][_0xa4c5('0x18')]);}logger[_0xa4c5('0x16')](_0xa4c5('0x11'),_0x4dc37f,_0x3355ca[_0xa4c5('0x16')][_0xa4c5('0x18')]);return _0x583113(_0x3355ca[_0xa4c5('0x16')][_0xa4c5('0x18')]);}else{logger[_0xa4c5('0x10')](_0xa4c5('0x11'),_0x4dc37f,'request\x20sent');_0x583113(_0x3355ca[_0xa4c5('0x19')][_0xa4c5('0x18')]);}})[_0xa4c5('0x1a')](function(_0x46459d){logger[_0xa4c5('0x16')](_0xa4c5('0x11'),_0x4dc37f,_0x46459d);_0x331f2a(_0x46459d);});});}exports[_0xa4c5('0x1b')]=function(_0x2125ed){var _0x467e19=this;return new Promise(function(_0x12f44f,_0x3ffaa6){return db[_0xa4c5('0x1c')][_0xa4c5('0x1d')]({'raw':_0x2125ed[_0xa4c5('0x1e')]?_0x2125ed[_0xa4c5('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x2125ed[_0xa4c5('0x1e')]?_0x2125ed[_0xa4c5('0x1e')][_0xa4c5('0x1f')]||null:null,'attributes':_0x2125ed[_0xa4c5('0x1e')]?_0x2125ed[_0xa4c5('0x1e')][_0xa4c5('0x20')]||null:null,'limit':_0x2125ed[_0xa4c5('0x1e')]?_0x2125ed[_0xa4c5('0x1e')]['limit']||null:null,'include':_0x2125ed['options']?_0x2125ed[_0xa4c5('0x1e')][_0xa4c5('0x21')]?_[_0xa4c5('0x22')](_0x2125ed[_0xa4c5('0x1e')]['include'],function(_0x4d1b24){return{'model':db[_0x4d1b24[_0xa4c5('0x23')]],'as':_0x4d1b24['as'],'attributes':_0x4d1b24[_0xa4c5('0x20')],'include':_0x4d1b24[_0xa4c5('0x21')]?_[_0xa4c5('0x22')](_0x4d1b24[_0xa4c5('0x21')],function(_0x80c6dd){return{'model':db[_0x80c6dd[_0xa4c5('0x23')]],'as':_0x80c6dd['as'],'attributes':_0x80c6dd[_0xa4c5('0x20')],'include':_0x80c6dd[_0xa4c5('0x21')]?_[_0xa4c5('0x22')](_0x80c6dd[_0xa4c5('0x21')],function(_0x50ace6){return{'model':db[_0x50ace6[_0xa4c5('0x23')]],'as':_0x50ace6['as'],'attributes':_0x50ace6[_0xa4c5('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa4c5('0xf')](function(_0x3ec78a){logger['info']('GetSmsQueue',_0x2125ed);logger[_0xa4c5('0x13')](_0xa4c5('0x1b'),_0x2125ed,JSON['stringify'](_0x3ec78a));_0x12f44f(_0x3ec78a);})[_0xa4c5('0x1a')](function(_0x18898f){logger[_0xa4c5('0x16')](_0xa4c5('0x1b'),_0x18898f[_0xa4c5('0x18')],_0x2125ed);_0x3ffaa6(_0x467e19[_0xa4c5('0x16')](0x1f4,_0x18898f[_0xa4c5('0x18')]));});});};exports[_0xa4c5('0x24')]=function(_0x3a2509){var _0x20820a=this;return new Promise(function(_0x3f2bca,_0x46da61){return db[_0xa4c5('0x1c')]['find']({'raw':_0x3a2509[_0xa4c5('0x1e')]?_0x3a2509[_0xa4c5('0x1e')][_0xa4c5('0x25')]===undefined?!![]:![]:!![],'where':_0x3a2509['options']?_0x3a2509[_0xa4c5('0x1e')][_0xa4c5('0x1f')]||null:null,'attributes':_0x3a2509[_0xa4c5('0x1e')]?_0x3a2509[_0xa4c5('0x1e')]['attributes']||null:null,'include':_0x3a2509['options']?_0x3a2509[_0xa4c5('0x1e')][_0xa4c5('0x21')]?_[_0xa4c5('0x22')](_0x3a2509[_0xa4c5('0x1e')][_0xa4c5('0x21')],function(_0x20d043){return{'model':db[_0x20d043[_0xa4c5('0x23')]],'as':_0x20d043['as'],'attributes':_0x20d043['attributes'],'include':_0x20d043['include']?_['map'](_0x20d043[_0xa4c5('0x21')],function(_0x93b64e){return{'model':db[_0x93b64e[_0xa4c5('0x23')]],'as':_0x93b64e['as'],'attributes':_0x93b64e[_0xa4c5('0x20')],'include':_0x93b64e[_0xa4c5('0x21')]?_[_0xa4c5('0x22')](_0x93b64e[_0xa4c5('0x21')],function(_0xa9e3e){return{'model':db[_0xa9e3e[_0xa4c5('0x23')]],'as':_0xa9e3e['as'],'attributes':_0xa9e3e['attributes']};}):[]};}):[]};}):[]:[]})[_0xa4c5('0xf')](function(_0xe1c97d){logger['info'](_0xa4c5('0x24'),_0x3a2509);logger[_0xa4c5('0x13')](_0xa4c5('0x24'),_0x3a2509,JSON[_0xa4c5('0x15')](_0xe1c97d));_0x3f2bca(_0xe1c97d);})[_0xa4c5('0x1a')](function(_0x1418a6){logger['error'](_0xa4c5('0x24'),_0x1418a6[_0xa4c5('0x18')],_0x3a2509);_0x46da61(_0x20820a[_0xa4c5('0x16')](0x1f4,_0x1418a6[_0xa4c5('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index a2f57cd..11e9103 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 _0xe1a9=['smsQueue:','./smsQueue.events','remove','emit','removeListener','length'];(function(_0x4a68b4,_0x321868){var _0x195b4e=function(_0x61f551){while(--_0x61f551){_0x4a68b4['push'](_0x4a68b4['shift']());}};_0x195b4e(++_0x321868);}(_0xe1a9,0x8b));var _0x9e1a=function(_0x13945b,_0x31941d){_0x13945b=_0x13945b-0x0;var _0x478450=_0xe1a9[_0x13945b];return _0x478450;};'use strict';var SmsQueueEvents=require(_0x9e1a('0x0'));var events=['save',_0x9e1a('0x1'),'update'];function createListener(_0x86ebd1,_0x2d7b74){return function(_0x58732b){_0x2d7b74[_0x9e1a('0x2')](_0x86ebd1,_0x58732b);};}function removeListener(_0x249321,_0x191aa3){return function(){SmsQueueEvents[_0x9e1a('0x3')](_0x249321,_0x191aa3);};}exports['register']=function(_0x5906){for(var _0x59727e=0x0,_0x306a34=events[_0x9e1a('0x4')];_0x59727e<_0x306a34;_0x59727e++){var _0x1df0f1=events[_0x59727e];var _0x13257a=createListener(_0x9e1a('0x5')+_0x1df0f1,_0x5906);SmsQueueEvents['on'](_0x1df0f1,_0x13257a);}}; \ No newline at end of file +var _0x85b9=['register','length','smsQueue:','./smsQueue.events','remove','emit','removeListener'];(function(_0x39746c,_0x26282f){var _0x1fa188=function(_0x193e9d){while(--_0x193e9d){_0x39746c['push'](_0x39746c['shift']());}};_0x1fa188(++_0x26282f);}(_0x85b9,0x8f));var _0x985b=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x85b9[_0x1589dd];return _0x1bddd1;};'use strict';var SmsQueueEvents=require(_0x985b('0x0'));var events=['save',_0x985b('0x1'),'update'];function createListener(_0xb6b4e2,_0x3d582e){return function(_0x2ea547){_0x3d582e[_0x985b('0x2')](_0xb6b4e2,_0x2ea547);};}function removeListener(_0x767838,_0x3d0a18){return function(){SmsQueueEvents[_0x985b('0x3')](_0x767838,_0x3d0a18);};}exports[_0x985b('0x4')]=function(_0x3e8886){for(var _0x3f99c4=0x0,_0x4f7114=events[_0x985b('0x5')];_0x3f99c4<_0x4f7114;_0x3f99c4++){var _0x500e50=events[_0x3f99c4];var _0x1f2925=createListener(_0x985b('0x6')+_0x500e50,_0x3e8886);SmsQueueEvents['on'](_0x500e50,_0x1f2925);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 633aa40..9c54805 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 _0xce3e=['isAuthenticated','/describe','show','post','create','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get'];(function(_0x395f6e,_0x566749){var _0x224071=function(_0xe4225c){while(--_0xe4225c){_0x395f6e['push'](_0x395f6e['shift']());}};_0x224071(++_0x566749);}(_0xce3e,0x13b));var _0xece3=function(_0x506f64,_0x395f5a){_0x506f64=_0x506f64-0x0;var _0x389fdb=_0xce3e[_0x506f64];return _0x389fdb;};'use strict';var multer=require(_0xece3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xece3('0x1'));var express=require(_0xece3('0x2'));var router=express[_0xece3('0x3')]();var auth=require(_0xece3('0x4'));var interaction=require(_0xece3('0x5'));var config=require('../../config/environment');var controller=require(_0xece3('0x6'));router[_0xece3('0x7')]('/',auth[_0xece3('0x8')](),controller['index']);router[_0xece3('0x7')](_0xece3('0x9'),auth[_0xece3('0x8')](),controller['describe']);router['get']('/:id',auth[_0xece3('0x8')](),controller[_0xece3('0xa')]);router[_0xece3('0xb')]('/',auth[_0xece3('0x8')](),controller[_0xece3('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xece3('0xd')]);router[_0xece3('0xe')]('/:id',auth[_0xece3('0x8')](),controller[_0xece3('0xf')]);module[_0xece3('0x10')]=router; \ No newline at end of file +var _0xbec7=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x3647fa,_0x3802bf){var _0x31fc38=function(_0x4a6784){while(--_0x4a6784){_0x3647fa['push'](_0x3647fa['shift']());}};_0x31fc38(++_0x3802bf);}(_0xbec7,0x1d1));var _0x7bec=function(_0x4e27a9,_0x22001b){_0x4e27a9=_0x4e27a9-0x0;var _0x542faa=_0xbec7[_0x4e27a9];return _0x542faa;};'use strict';var multer=require(_0x7bec('0x0'));var util=require(_0x7bec('0x1'));var path=require(_0x7bec('0x2'));var timeout=require(_0x7bec('0x3'));var express=require(_0x7bec('0x4'));var router=express[_0x7bec('0x5')]();var auth=require(_0x7bec('0x6'));var interaction=require(_0x7bec('0x7'));var config=require('../../config/environment');var controller=require(_0x7bec('0x8'));router[_0x7bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x7bec('0xa')]);router[_0x7bec('0x9')](_0x7bec('0xb'),auth[_0x7bec('0xc')](),controller['describe']);router['get'](_0x7bec('0xd'),auth[_0x7bec('0xc')](),controller[_0x7bec('0xe')]);router[_0x7bec('0xf')]('/',auth['isAuthenticated'](),controller[_0x7bec('0x10')]);router[_0x7bec('0x11')](_0x7bec('0xd'),auth['isAuthenticated'](),controller[_0x7bec('0x12')]);router[_0x7bec('0x13')]('/:id',auth[_0x7bec('0xc')](),controller[_0x7bec('0x14')]);module[_0x7bec('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 0168f92..0d581a9 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 _0x8ce3=['STRING','DATE','moment','exports'];(function(_0x261f0a,_0x56c4d6){var _0x16fcc5=function(_0x505b76){while(--_0x505b76){_0x261f0a['push'](_0x261f0a['shift']());}};_0x16fcc5(++_0x56c4d6);}(_0x8ce3,0xee));var _0x38ce=function(_0x4a88ef,_0x47b00b){_0x4a88ef=_0x4a88ef-0x0;var _0x223767=_0x8ce3[_0x4a88ef];return _0x223767;};'use strict';var moment=require(_0x38ce('0x0'));var Sequelize=require('sequelize');module[_0x38ce('0x1')]={'uniqueid':{'type':Sequelize[_0x38ce('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x38ce('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x38ce('0x3')]},'acceptAt':{'type':Sequelize[_0x38ce('0x3')]},'exitAt':{'type':Sequelize[_0x38ce('0x3')]},'reason':{'type':Sequelize[_0x38ce('0x2')]}}; \ No newline at end of file +var _0x65d3=['moment','sequelize','exports','STRING','DATE'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x65d3,0x1ae));var _0x365d=function(_0x40e679,_0x415574){_0x40e679=_0x40e679-0x0;var _0x448d23=_0x65d3[_0x40e679];return _0x448d23;};'use strict';var moment=require(_0x365d('0x0'));var Sequelize=require(_0x365d('0x1'));module[_0x365d('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x365d('0x3')]},'joinAt':{'type':Sequelize[_0x365d('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x365d('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 0dd7764..d13ddfd 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 _0x15cc=['name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','map','type','field','merge','options','includeAll','include','SmsQueueReport','findAll','rows','catch','show','params','create','body','find','describe','html-pdf','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack'];(function(_0x51bd91,_0x404faa){var _0x28c45c=function(_0x3207c8){while(--_0x3207c8){_0x51bd91['push'](_0x51bd91['shift']());}};_0x28c45c(++_0x404faa);}(_0x15cc,0x199));var _0xc15c=function(_0x11f6f2,_0x56d8b6){_0x11f6f2=_0x11f6f2-0x0;var _0x225500=_0x15cc[_0x11f6f2];return _0x225500;};'use strict';var pdf=require(_0xc15c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc15c('0x1'));var jsonpatch=require(_0xc15c('0x2'));var rp=require(_0xc15c('0x3'));var moment=require(_0xc15c('0x4'));var BPromise=require(_0xc15c('0x5'));var Mustache=require(_0xc15c('0x6'));var util=require(_0xc15c('0x7'));var path=require(_0xc15c('0x8'));var sox=require(_0xc15c('0x9'));var csv=require(_0xc15c('0xa'));var ejs=require(_0xc15c('0xb'));var fs=require('fs');var _=require(_0xc15c('0xc'));var squel=require(_0xc15c('0xd'));var crypto=require(_0xc15c('0xe'));var jsforce=require(_0xc15c('0xf'));var deskjs=require(_0xc15c('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc15c('0x11'));var Papa=require(_0xc15c('0x12'));var Redis=require(_0xc15c('0x13'));var authService=require(_0xc15c('0x14'));var qs=require(_0xc15c('0x15'));var hardwareService=require(_0xc15c('0x16'));var logger=require('../../config/logger')(_0xc15c('0x17'));var utils=require(_0xc15c('0x18'));var config=require(_0xc15c('0x19'));var db=require(_0xc15c('0x1a'))['db'];function respondWithStatusCode(_0x5c499e,_0x5111c2){_0x5111c2=_0x5111c2||0xcc;return function(_0x1f8265){if(_0x1f8265){return _0x5c499e[_0xc15c('0x1b')](_0x5111c2);}return _0x5c499e[_0xc15c('0x1c')](_0x5111c2)[_0xc15c('0x1d')]();};}function respondWithResult(_0x2bc9dd,_0x25fb80){_0x25fb80=_0x25fb80||0xc8;return function(_0x2f45bb){if(_0x2f45bb){return _0x2bc9dd['status'](_0x25fb80)['json'](_0x2f45bb);}};}function respondWithFilteredResult(_0xe6a43f,_0x5e5ccf){return function(_0x4ad2ae){if(_0x4ad2ae){var _0x18d239=_0x4ad2ae[_0xc15c('0x1e')],_0x1781d1=_0x5e5ccf['offset'],_0x41fec9=_0x5e5ccf[_0xc15c('0x1f')]+_0x5e5ccf[_0xc15c('0x20')],_0x3c33c4;if(_0x41fec9>=_0x18d239){_0x41fec9=_0x18d239;_0x3c33c4=0xc8;}else{_0x3c33c4=0xce;}_0xe6a43f['status'](_0x3c33c4);return _0xe6a43f[_0xc15c('0x21')](_0xc15c('0x22'),_0x1781d1+'-'+_0x41fec9+'/'+_0x18d239)['json'](_0x4ad2ae);}return null;};}function patchUpdates(_0x455871){return function(_0x3181bd){try{jsonpatch[_0xc15c('0x23')](_0x3181bd,_0x455871,!![]);}catch(_0x3318ec){return BPromise['reject'](_0x3318ec);}return _0x3181bd[_0xc15c('0x24')]();};}function saveUpdates(_0x564fee,_0x272303){return function(_0x54345c){if(_0x54345c){return _0x54345c[_0xc15c('0x25')](_0x564fee)[_0xc15c('0x26')](function(_0x5c1937){return _0x5c1937;});}return null;};}function removeEntity(_0x1a0a01,_0x5ecc6a){return function(_0x31fa01){if(_0x31fa01){return _0x31fa01[_0xc15c('0x27')]()[_0xc15c('0x26')](function(){_0x1a0a01[_0xc15c('0x1c')](0xcc)[_0xc15c('0x1d')]();});}};}function handleEntityNotFound(_0x342912,_0x3574ca){return function(_0x1f2801){if(!_0x1f2801){_0x342912[_0xc15c('0x1b')](0x194);}return _0x1f2801;};}function handleError(_0x4132a7,_0x154db9){_0x154db9=_0x154db9||0x1f4;return function(_0x54829e){logger['error'](_0x54829e[_0xc15c('0x28')]);if(_0x54829e['name']){delete _0x54829e[_0xc15c('0x29')];}_0x4132a7[_0xc15c('0x1c')](_0x154db9)[_0xc15c('0x2a')](_0x54829e);};}exports['index']=function(_0x286c35,_0x49a3da){var _0x3d6357={},_0x497cd3={},_0x436cee={'count':0x0,'rows':[]};var _0x441eb7=db['SmsQueueReport'][_0xc15c('0x2b')];_0x497cd3[_0xc15c('0x2c')]=_[_0xc15c('0x2d')](_0x441eb7);_0x497cd3[_0xc15c('0x2e')]=_[_0xc15c('0x2d')](_0x286c35['query']);_0x497cd3[_0xc15c('0x2f')]=_[_0xc15c('0x30')](_0x497cd3['model'],_0x497cd3['query']);_0x3d6357[_0xc15c('0x31')]=_['intersection'](_0x497cd3['model'],qs[_0xc15c('0x32')](_0x286c35[_0xc15c('0x2e')][_0xc15c('0x32')]));_0x3d6357[_0xc15c('0x31')]=_0x3d6357[_0xc15c('0x31')][_0xc15c('0x33')]?_0x3d6357[_0xc15c('0x31')]:_0x497cd3[_0xc15c('0x2c')];if(!_0x286c35[_0xc15c('0x2e')][_0xc15c('0x34')]('nolimit')){_0x3d6357[_0xc15c('0x20')]=qs['limit'](_0x286c35[_0xc15c('0x2e')][_0xc15c('0x20')]);_0x3d6357[_0xc15c('0x1f')]=qs[_0xc15c('0x1f')](_0x286c35[_0xc15c('0x2e')][_0xc15c('0x1f')]);}_0x3d6357[_0xc15c('0x35')]=qs[_0xc15c('0x36')](_0x286c35[_0xc15c('0x2e')][_0xc15c('0x36')]);_0x3d6357[_0xc15c('0x37')]=qs[_0xc15c('0x2f')](_[_0xc15c('0x38')](_0x286c35[_0xc15c('0x2e')],_0x497cd3['filters']));if(_0x286c35['query'][_0xc15c('0x39')]){_0x3d6357[_0xc15c('0x37')]=_['merge'](_0x3d6357[_0xc15c('0x37')],{'$or':_[_0xc15c('0x3a')](_0x441eb7,function(_0x170fd5){if(_0x170fd5[_0xc15c('0x3b')]['key']!=='VIRTUAL'){var _0x24edde={};_0x24edde[_0x170fd5[_0xc15c('0x3c')]]={'$like':'%'+_0x286c35[_0xc15c('0x2e')]['filter']+'%'};return _0x24edde;}})});}_0x3d6357=_[_0xc15c('0x3d')]({},_0x3d6357,_0x286c35[_0xc15c('0x3e')]);var _0x479ac3={'where':_0x3d6357[_0xc15c('0x37')]};return db['SmsQueueReport'][_0xc15c('0x1e')](_0x479ac3)['then'](function(_0x316610){_0x436cee[_0xc15c('0x1e')]=_0x316610;if(_0x286c35[_0xc15c('0x2e')][_0xc15c('0x3f')]){_0x3d6357[_0xc15c('0x40')]=[{'all':!![]}];}return db[_0xc15c('0x41')][_0xc15c('0x42')](_0x3d6357);})[_0xc15c('0x26')](function(_0xf915cb){_0x436cee[_0xc15c('0x43')]=_0xf915cb;return _0x436cee;})[_0xc15c('0x26')](respondWithFilteredResult(_0x49a3da,_0x3d6357))[_0xc15c('0x44')](handleError(_0x49a3da,null));};exports[_0xc15c('0x45')]=function(_0x16ffea,_0x32e0a8){var _0x19766c={'raw':!![],'where':{'id':_0x16ffea[_0xc15c('0x46')]['id']}},_0x313feb={};_0x313feb[_0xc15c('0x2c')]=_[_0xc15c('0x2d')](db['SmsQueueReport'][_0xc15c('0x2b')]);_0x313feb[_0xc15c('0x2e')]=_[_0xc15c('0x2d')](_0x16ffea[_0xc15c('0x2e')]);_0x313feb[_0xc15c('0x2f')]=_['intersection'](_0x313feb[_0xc15c('0x2c')],_0x313feb[_0xc15c('0x2e')]);_0x19766c[_0xc15c('0x31')]=_['intersection'](_0x313feb[_0xc15c('0x2c')],qs[_0xc15c('0x32')](_0x16ffea[_0xc15c('0x2e')][_0xc15c('0x32')]));_0x19766c[_0xc15c('0x31')]=_0x19766c[_0xc15c('0x31')][_0xc15c('0x33')]?_0x19766c[_0xc15c('0x31')]:_0x313feb[_0xc15c('0x2c')];if(_0x16ffea[_0xc15c('0x2e')][_0xc15c('0x3f')]){_0x19766c[_0xc15c('0x40')]=[{'all':!![]}];}_0x19766c=_[_0xc15c('0x3d')]({},_0x19766c,_0x16ffea[_0xc15c('0x3e')]);return db['SmsQueueReport']['find'](_0x19766c)[_0xc15c('0x26')](handleEntityNotFound(_0x32e0a8,null))[_0xc15c('0x26')](respondWithResult(_0x32e0a8,null))[_0xc15c('0x44')](handleError(_0x32e0a8,null));};exports[_0xc15c('0x47')]=function(_0x7ca1de,_0x1c11c7){return db[_0xc15c('0x41')][_0xc15c('0x47')](_0x7ca1de[_0xc15c('0x48')],{})['then'](respondWithResult(_0x1c11c7,0xc9))['catch'](handleError(_0x1c11c7,null));};exports[_0xc15c('0x25')]=function(_0x35831c,_0x6ec832){if(_0x35831c[_0xc15c('0x48')]['id']){delete _0x35831c[_0xc15c('0x48')]['id'];}return db[_0xc15c('0x41')][_0xc15c('0x49')]({'where':{'id':_0x35831c[_0xc15c('0x46')]['id']}})[_0xc15c('0x26')](handleEntityNotFound(_0x6ec832,null))[_0xc15c('0x26')](saveUpdates(_0x35831c[_0xc15c('0x48')],null))[_0xc15c('0x26')](respondWithResult(_0x6ec832,null))[_0xc15c('0x44')](handleError(_0x6ec832,null));};exports[_0xc15c('0x27')]=function(_0xfed11f,_0x1543b2){return db[_0xc15c('0x41')]['find']({'where':{'id':_0xfed11f[_0xc15c('0x46')]['id']}})['then'](handleEntityNotFound(_0x1543b2,null))[_0xc15c('0x26')](removeEntity(_0x1543b2,null))[_0xc15c('0x44')](handleError(_0x1543b2,null));};exports[_0xc15c('0x4a')]=function(_0x44f9f2,_0x4be900){return db[_0xc15c('0x41')][_0xc15c('0x4a')]()[_0xc15c('0x26')](respondWithResult(_0x4be900,null))[_0xc15c('0x44')](handleError(_0x4be900,null));}; \ No newline at end of file +var _0x89a0=['describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','reject','update','destroy','then','name','send','index','SmsQueueReport','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','options','includeAll','include','rows','catch','show','params','length','find','create','body'];(function(_0x32776a,_0x592b3b){var _0x4e4c3f=function(_0x328a00){while(--_0x328a00){_0x32776a['push'](_0x32776a['shift']());}};_0x4e4c3f(++_0x592b3b);}(_0x89a0,0x1c8));var _0x089a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x89a0[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x089a('0x0'));var rimraf=require(_0x089a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x089a('0x2'));var rp=require(_0x089a('0x3'));var moment=require('moment');var BPromise=require(_0x089a('0x4'));var Mustache=require(_0x089a('0x5'));var util=require(_0x089a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x089a('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x089a('0x8'));var squel=require(_0x089a('0x9'));var crypto=require('crypto');var jsforce=require(_0x089a('0xa'));var deskjs=require(_0x089a('0xb'));var toCsv=require(_0x089a('0x7'));var querystring=require(_0x089a('0xc'));var Papa=require(_0x089a('0xd'));var Redis=require(_0x089a('0xe'));var authService=require(_0x089a('0xf'));var qs=require(_0x089a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x089a('0x11'));var utils=require(_0x089a('0x12'));var config=require('../../config/environment');var db=require(_0x089a('0x13'))['db'];function respondWithStatusCode(_0x25e02f,_0x4009f1){_0x4009f1=_0x4009f1||0xcc;return function(_0x422f17){if(_0x422f17){return _0x25e02f[_0x089a('0x14')](_0x4009f1);}return _0x25e02f[_0x089a('0x15')](_0x4009f1)[_0x089a('0x16')]();};}function respondWithResult(_0x270e12,_0x4d1fee){_0x4d1fee=_0x4d1fee||0xc8;return function(_0x5c9628){if(_0x5c9628){return _0x270e12[_0x089a('0x15')](_0x4d1fee)['json'](_0x5c9628);}};}function respondWithFilteredResult(_0x127220,_0x2641bf){return function(_0x6c1f7b){if(_0x6c1f7b){var _0x1ac01e=_0x6c1f7b[_0x089a('0x17')],_0x5e6915=_0x2641bf[_0x089a('0x18')],_0x224197=_0x2641bf[_0x089a('0x18')]+_0x2641bf['limit'],_0x2f357e;if(_0x224197>=_0x1ac01e){_0x224197=_0x1ac01e;_0x2f357e=0xc8;}else{_0x2f357e=0xce;}_0x127220['status'](_0x2f357e);return _0x127220[_0x089a('0x19')](_0x089a('0x1a'),_0x5e6915+'-'+_0x224197+'/'+_0x1ac01e)[_0x089a('0x1b')](_0x6c1f7b);}return null;};}function patchUpdates(_0x3a176e){return function(_0xea722e){try{jsonpatch['apply'](_0xea722e,_0x3a176e,!![]);}catch(_0x38882a){return BPromise[_0x089a('0x1c')](_0x38882a);}return _0xea722e['save']();};}function saveUpdates(_0x4d61e9,_0x51659e){return function(_0x4ceb00){if(_0x4ceb00){return _0x4ceb00[_0x089a('0x1d')](_0x4d61e9)['then'](function(_0x16e041){return _0x16e041;});}return null;};}function removeEntity(_0x1b09d7,_0x17bc2f){return function(_0x2a89f0){if(_0x2a89f0){return _0x2a89f0[_0x089a('0x1e')]()[_0x089a('0x1f')](function(){_0x1b09d7[_0x089a('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420e1d,_0x466d9b){return function(_0x57f72b){if(!_0x57f72b){_0x420e1d[_0x089a('0x14')](0x194);}return _0x57f72b;};}function handleError(_0x5e47c4,_0x559926){_0x559926=_0x559926||0x1f4;return function(_0x17f805){logger['error'](_0x17f805['stack']);if(_0x17f805[_0x089a('0x20')]){delete _0x17f805['name'];}_0x5e47c4[_0x089a('0x15')](_0x559926)[_0x089a('0x21')](_0x17f805);};}exports[_0x089a('0x22')]=function(_0x19ea78,_0xd31890){var _0x438e05={},_0x1277f9={},_0x57ac89={'count':0x0,'rows':[]};var _0x49ead6=db[_0x089a('0x23')][_0x089a('0x24')];_0x1277f9[_0x089a('0x25')]=_[_0x089a('0x26')](_0x49ead6);_0x1277f9[_0x089a('0x27')]=_[_0x089a('0x26')](_0x19ea78['query']);_0x1277f9['filters']=_[_0x089a('0x28')](_0x1277f9[_0x089a('0x25')],_0x1277f9[_0x089a('0x27')]);_0x438e05[_0x089a('0x29')]=_[_0x089a('0x28')](_0x1277f9[_0x089a('0x25')],qs[_0x089a('0x2a')](_0x19ea78[_0x089a('0x27')][_0x089a('0x2a')]));_0x438e05[_0x089a('0x29')]=_0x438e05[_0x089a('0x29')]['length']?_0x438e05[_0x089a('0x29')]:_0x1277f9['model'];if(!_0x19ea78[_0x089a('0x27')]['hasOwnProperty'](_0x089a('0x2b'))){_0x438e05['limit']=qs[_0x089a('0x2c')](_0x19ea78[_0x089a('0x27')][_0x089a('0x2c')]);_0x438e05['offset']=qs[_0x089a('0x18')](_0x19ea78[_0x089a('0x27')][_0x089a('0x18')]);}_0x438e05[_0x089a('0x2d')]=qs[_0x089a('0x2e')](_0x19ea78[_0x089a('0x27')]['sort']);_0x438e05[_0x089a('0x2f')]=qs[_0x089a('0x30')](_[_0x089a('0x31')](_0x19ea78['query'],_0x1277f9[_0x089a('0x30')]));if(_0x19ea78[_0x089a('0x27')][_0x089a('0x32')]){_0x438e05[_0x089a('0x2f')]=_[_0x089a('0x33')](_0x438e05[_0x089a('0x2f')],{'$or':_[_0x089a('0x34')](_0x49ead6,function(_0x14eba6){if(_0x14eba6['type']['key']!=='VIRTUAL'){var _0x297903={};_0x297903[_0x14eba6['field']]={'$like':'%'+_0x19ea78['query'][_0x089a('0x32')]+'%'};return _0x297903;}})});}_0x438e05=_[_0x089a('0x33')]({},_0x438e05,_0x19ea78[_0x089a('0x35')]);var _0x5dd54b={'where':_0x438e05[_0x089a('0x2f')]};return db[_0x089a('0x23')][_0x089a('0x17')](_0x5dd54b)[_0x089a('0x1f')](function(_0x5caf7e){_0x57ac89['count']=_0x5caf7e;if(_0x19ea78[_0x089a('0x27')][_0x089a('0x36')]){_0x438e05[_0x089a('0x37')]=[{'all':!![]}];}return db[_0x089a('0x23')]['findAll'](_0x438e05);})[_0x089a('0x1f')](function(_0x1ee55b){_0x57ac89[_0x089a('0x38')]=_0x1ee55b;return _0x57ac89;})[_0x089a('0x1f')](respondWithFilteredResult(_0xd31890,_0x438e05))[_0x089a('0x39')](handleError(_0xd31890,null));};exports[_0x089a('0x3a')]=function(_0x28705e,_0x46bf31){var _0x26fdeb={'raw':!![],'where':{'id':_0x28705e[_0x089a('0x3b')]['id']}},_0x566c1c={};_0x566c1c[_0x089a('0x25')]=_[_0x089a('0x26')](db[_0x089a('0x23')][_0x089a('0x24')]);_0x566c1c['query']=_['keys'](_0x28705e[_0x089a('0x27')]);_0x566c1c[_0x089a('0x30')]=_['intersection'](_0x566c1c[_0x089a('0x25')],_0x566c1c[_0x089a('0x27')]);_0x26fdeb[_0x089a('0x29')]=_['intersection'](_0x566c1c[_0x089a('0x25')],qs['fields'](_0x28705e[_0x089a('0x27')][_0x089a('0x2a')]));_0x26fdeb[_0x089a('0x29')]=_0x26fdeb[_0x089a('0x29')][_0x089a('0x3c')]?_0x26fdeb[_0x089a('0x29')]:_0x566c1c[_0x089a('0x25')];if(_0x28705e[_0x089a('0x27')][_0x089a('0x36')]){_0x26fdeb['include']=[{'all':!![]}];}_0x26fdeb=_[_0x089a('0x33')]({},_0x26fdeb,_0x28705e[_0x089a('0x35')]);return db[_0x089a('0x23')][_0x089a('0x3d')](_0x26fdeb)['then'](handleEntityNotFound(_0x46bf31,null))[_0x089a('0x1f')](respondWithResult(_0x46bf31,null))['catch'](handleError(_0x46bf31,null));};exports['create']=function(_0x5265ab,_0x150943){return db['SmsQueueReport'][_0x089a('0x3e')](_0x5265ab['body'],{})[_0x089a('0x1f')](respondWithResult(_0x150943,0xc9))['catch'](handleError(_0x150943,null));};exports[_0x089a('0x1d')]=function(_0x15d866,_0x5a9ff6){if(_0x15d866[_0x089a('0x3f')]['id']){delete _0x15d866[_0x089a('0x3f')]['id'];}return db[_0x089a('0x23')][_0x089a('0x3d')]({'where':{'id':_0x15d866[_0x089a('0x3b')]['id']}})[_0x089a('0x1f')](handleEntityNotFound(_0x5a9ff6,null))[_0x089a('0x1f')](saveUpdates(_0x15d866[_0x089a('0x3f')],null))[_0x089a('0x1f')](respondWithResult(_0x5a9ff6,null))[_0x089a('0x39')](handleError(_0x5a9ff6,null));};exports[_0x089a('0x1e')]=function(_0x246f18,_0x2736be){return db[_0x089a('0x23')]['find']({'where':{'id':_0x246f18[_0x089a('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2736be,null))[_0x089a('0x1f')](removeEntity(_0x2736be,null))[_0x089a('0x39')](handleError(_0x2736be,null));};exports[_0x089a('0x40')]=function(_0x5f4533,_0x17866c){return db[_0x089a('0x23')][_0x089a('0x40')]()[_0x089a('0x1f')](respondWithResult(_0x17866c,null))[_0x089a('0x39')](handleError(_0x17866c,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 547cbf6..8d6027d 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 _0x636f=['report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport'];(function(_0x39175b,_0x245752){var _0x4b2c84=function(_0x562865){while(--_0x562865){_0x39175b['push'](_0x39175b['shift']());}};_0x4b2c84(++_0x245752);}(_0x636f,0x188));var _0xf636=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x636f[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf636('0x0'))(_0xf636('0x1'));var moment=require(_0xf636('0x2'));var BPromise=require(_0xf636('0x3'));var rp=require(_0xf636('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf636('0x5'));var config=require(_0xf636('0x6'));var attributes=require(_0xf636('0x7'));module[_0xf636('0x8')]=function(_0x39c5f1,_0x526990){return _0x39c5f1[_0xf636('0x9')](_0xf636('0xa'),attributes,{'tableName':_0xf636('0xb'),'paranoid':![],'indexes':[{'name':_0xf636('0xc'),'fields':[_0xf636('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x66e2=['path','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','moment','request-promise'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x66e2,0x74));var _0x266e=function(_0x2b3567,_0x4beff3){_0x2b3567=_0x2b3567-0x0;var _0x29f24a=_0x66e2[_0x2b3567];return _0x29f24a;};'use strict';var _=require('lodash');var util=require(_0x266e('0x0'));var logger=require(_0x266e('0x1'))('api');var moment=require(_0x266e('0x2'));var BPromise=require('bluebird');var rp=require(_0x266e('0x3'));var fs=require('fs');var path=require(_0x266e('0x4'));var rimraf=require('rimraf');var config=require(_0x266e('0x5'));var attributes=require(_0x266e('0x6'));module[_0x266e('0x7')]=function(_0x457d38,_0x4ac1fa){return _0x457d38[_0x266e('0x8')](_0x266e('0x9'),attributes,{'tableName':_0x266e('0xa'),'paranoid':![],'indexes':[{'name':_0x266e('0xb'),'fields':[_0x266e('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 f27fe89..011c783 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 _0x1d47=['code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','debug','stringify','UpdateSmsQueueReport','where','attributes','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','http','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','error'];(function(_0x4cefa0,_0x19a8ec){var _0x500a03=function(_0xc43936){while(--_0xc43936){_0x4cefa0['push'](_0x4cefa0['shift']());}};_0x500a03(++_0x19a8ec);}(_0x1d47,0x197));var _0x71d4=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x1d47[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x71d4('0x0'));var util=require(_0x71d4('0x1'));var moment=require(_0x71d4('0x2'));var BPromise=require(_0x71d4('0x3'));var rs=require(_0x71d4('0x4'));var fs=require('fs');var Redis=require(_0x71d4('0x5'));var db=require(_0x71d4('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x71d4('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x71d4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f2c57,_0x4534e3,_0x4943a7){return new BPromise(function(_0x386b14,_0x4a1e96){return client['request'](_0x2f2c57,_0x4943a7)['then'](function(_0x710cea){logger[_0x71d4('0x9')](_0x71d4('0xa'),_0x4534e3,_0x71d4('0xb'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x4534e3,_0x71d4('0xb'),JSON['stringify'](_0x710cea));if(_0x710cea[_0x71d4('0xc')]){if(_0x710cea[_0x71d4('0xc')][_0x71d4('0xd')]===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x4534e3,_0x710cea[_0x71d4('0xc')][_0x71d4('0xe')]);return _0x4a1e96(_0x710cea[_0x71d4('0xc')]['message']);}logger[_0x71d4('0xc')](_0x71d4('0xa'),_0x4534e3,_0x710cea[_0x71d4('0xc')][_0x71d4('0xe')]);return _0x386b14(_0x710cea[_0x71d4('0xc')][_0x71d4('0xe')]);}else{logger[_0x71d4('0x9')](_0x71d4('0xa'),_0x4534e3,'request\x20sent');_0x386b14(_0x710cea[_0x71d4('0xf')][_0x71d4('0xe')]);}})[_0x71d4('0x10')](function(_0x20f784){logger[_0x71d4('0xc')](_0x71d4('0xa'),_0x4534e3,_0x20f784);_0x4a1e96(_0x20f784);});});}exports[_0x71d4('0x11')]=function(_0x2935dd){var _0x432372=this;return new Promise(function(_0x4ef014,_0xaf5156){return db[_0x71d4('0x12')][_0x71d4('0x13')](_0x2935dd[_0x71d4('0x14')],{'raw':_0x2935dd[_0x71d4('0x15')]?_0x2935dd['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x33b0de){logger['info'](_0x71d4('0x11'),_0x2935dd);logger[_0x71d4('0x16')](_0x71d4('0x11'),_0x2935dd,JSON[_0x71d4('0x17')](_0x33b0de));_0x4ef014(_0x33b0de);})['catch'](function(_0x4cc66d){logger['error'](_0x71d4('0x11'),_0x4cc66d[_0x71d4('0xe')],_0x2935dd);_0xaf5156(_0x432372['error'](0x1f4,_0x4cc66d[_0x71d4('0xe')]));});});};exports[_0x71d4('0x18')]=function(_0x18c07e){var _0x42fb9e=this;return new Promise(function(_0x337381,_0x2543bc){return db[_0x71d4('0x12')]['update'](_0x18c07e[_0x71d4('0x14')],{'raw':_0x18c07e[_0x71d4('0x15')]?_0x18c07e[_0x71d4('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18c07e['options']?_0x18c07e[_0x71d4('0x15')][_0x71d4('0x19')]||null:null,'attributes':_0x18c07e['options']?_0x18c07e[_0x71d4('0x15')][_0x71d4('0x1a')]||null:null,'limit':_0x18c07e[_0x71d4('0x15')]?_0x18c07e[_0x71d4('0x15')]['limit']||null:null})[_0x71d4('0x1b')](function(_0x17e1c0){logger[_0x71d4('0x9')](_0x71d4('0x18'),_0x18c07e);logger[_0x71d4('0x16')](_0x71d4('0x18'),_0x18c07e,JSON[_0x71d4('0x17')](_0x17e1c0));_0x337381(_0x17e1c0);})[_0x71d4('0x10')](function(_0x2492ce){logger[_0x71d4('0xc')](_0x71d4('0x18'),_0x2492ce[_0x71d4('0xe')],_0x18c07e);_0x2543bc(_0x42fb9e['error'](0x1f4,_0x2492ce[_0x71d4('0xe')]));});});}; \ No newline at end of file +var _0x1fec=['UpdateSmsQueueReport','attributes','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/environment','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','debug','catch'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x1fec,0x153));var _0xc1fe=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1fec[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xc1fe('0x0'));var util=require(_0xc1fe('0x1'));var moment=require(_0xc1fe('0x2'));var BPromise=require('bluebird');var rs=require(_0xc1fe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc1fe('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc1fe('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xc1fe('0x6')][_0xc1fe('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xc7bd61,_0x22e276,_0x41cb63){return new BPromise(function(_0x17b5d9,_0x329b5c){return client[_0xc1fe('0x8')](_0xc7bd61,_0x41cb63)[_0xc1fe('0x9')](function(_0x3c3093){logger[_0xc1fe('0xa')](_0xc1fe('0xb'),_0x22e276,_0xc1fe('0xc'));logger['debug'](_0xc1fe('0xd'),_0x22e276,_0xc1fe('0xc'),JSON[_0xc1fe('0xe')](_0x3c3093));if(_0x3c3093[_0xc1fe('0xf')]){if(_0x3c3093[_0xc1fe('0xf')]['code']===0x1f4){logger['error'](_0xc1fe('0xb'),_0x22e276,_0x3c3093[_0xc1fe('0xf')][_0xc1fe('0x10')]);return _0x329b5c(_0x3c3093[_0xc1fe('0xf')][_0xc1fe('0x10')]);}logger[_0xc1fe('0xf')](_0xc1fe('0xb'),_0x22e276,_0x3c3093['error'][_0xc1fe('0x10')]);return _0x17b5d9(_0x3c3093['error'][_0xc1fe('0x10')]);}else{logger[_0xc1fe('0xa')](_0xc1fe('0xb'),_0x22e276,_0xc1fe('0xc'));_0x17b5d9(_0x3c3093[_0xc1fe('0x11')]['message']);}})['catch'](function(_0x1e0484){logger[_0xc1fe('0xf')](_0xc1fe('0xb'),_0x22e276,_0x1e0484);_0x329b5c(_0x1e0484);});});}exports[_0xc1fe('0x12')]=function(_0x2f6988){var _0x4ba632=this;return new Promise(function(_0x325a81,_0x40b241){return db[_0xc1fe('0x13')][_0xc1fe('0x14')](_0x2f6988[_0xc1fe('0x15')],{'raw':_0x2f6988[_0xc1fe('0x16')]?_0x2f6988[_0xc1fe('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xc1fe('0x9')](function(_0x4fd1ec){logger[_0xc1fe('0xa')](_0xc1fe('0x12'),_0x2f6988);logger[_0xc1fe('0x17')](_0xc1fe('0x12'),_0x2f6988,JSON[_0xc1fe('0xe')](_0x4fd1ec));_0x325a81(_0x4fd1ec);})[_0xc1fe('0x18')](function(_0x4aeeb8){logger[_0xc1fe('0xf')](_0xc1fe('0x12'),_0x4aeeb8['message'],_0x2f6988);_0x40b241(_0x4ba632[_0xc1fe('0xf')](0x1f4,_0x4aeeb8['message']));});});};exports[_0xc1fe('0x19')]=function(_0x4d5e14){var _0x6e61b=this;return new Promise(function(_0x5b416a,_0xb8bf1a){return db['SmsQueueReport']['update'](_0x4d5e14['body'],{'raw':_0x4d5e14[_0xc1fe('0x16')]?_0x4d5e14[_0xc1fe('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d5e14[_0xc1fe('0x16')]?_0x4d5e14[_0xc1fe('0x16')]['where']||null:null,'attributes':_0x4d5e14[_0xc1fe('0x16')]?_0x4d5e14[_0xc1fe('0x16')][_0xc1fe('0x1a')]||null:null,'limit':_0x4d5e14[_0xc1fe('0x16')]?_0x4d5e14[_0xc1fe('0x16')][_0xc1fe('0x1b')]||null:null})[_0xc1fe('0x9')](function(_0x407685){logger[_0xc1fe('0xa')](_0xc1fe('0x19'),_0x4d5e14);logger[_0xc1fe('0x17')](_0xc1fe('0x19'),_0x4d5e14,JSON[_0xc1fe('0xe')](_0x407685));_0x5b416a(_0x407685);})[_0xc1fe('0x18')](function(_0x33d752){logger[_0xc1fe('0xf')]('UpdateSmsQueueReport',_0x33d752['message'],_0x4d5e14);_0xb8bf1a(_0x6e61b[_0xc1fe('0xf')](0x1f4,_0x33d752[_0xc1fe('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index ef272e1..ef8d534 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 _0x3c81=['put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','./smsTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3c81,0x102));var _0x13c8=function(_0x45f92c,_0x382e64){_0x45f92c=_0x45f92c-0x0;var _0x4684a1=_0x3c81[_0x45f92c];return _0x4684a1;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('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(_0x13c8('0x4'));router[_0x13c8('0x5')]('/',auth[_0x13c8('0x6')](),controller[_0x13c8('0x7')]);router[_0x13c8('0x5')](_0x13c8('0x8'),auth[_0x13c8('0x6')](),controller['describe']);router[_0x13c8('0x5')]('/:id',auth[_0x13c8('0x6')](),controller[_0x13c8('0x9')]);router[_0x13c8('0xa')]('/',auth[_0x13c8('0x6')](),controller[_0x13c8('0xb')]);router[_0x13c8('0xc')](_0x13c8('0xd'),auth[_0x13c8('0x6')](),controller[_0x13c8('0xe')]);router[_0x13c8('0xf')](_0x13c8('0xd'),auth[_0x13c8('0x6')](),controller[_0x13c8('0x10')]);module[_0x13c8('0x11')]=router; \ No newline at end of file +var _0x1eba=['put','delete','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0x1eba[_0x359bbe];return _0x1b3353;};'use strict';var multer=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var path=require(_0xa1eb('0x2'));var timeout=require(_0xa1eb('0x3'));var express=require(_0xa1eb('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa1eb('0x5'));var config=require(_0xa1eb('0x6'));var controller=require(_0xa1eb('0x7'));router[_0xa1eb('0x8')]('/',auth[_0xa1eb('0x9')](),controller[_0xa1eb('0xa')]);router[_0xa1eb('0x8')](_0xa1eb('0xb'),auth[_0xa1eb('0x9')](),controller[_0xa1eb('0xc')]);router[_0xa1eb('0x8')](_0xa1eb('0xd'),auth['isAuthenticated'](),controller[_0xa1eb('0xe')]);router['post']('/',auth[_0xa1eb('0x9')](),controller['create']);router[_0xa1eb('0xf')]('/:id',auth[_0xa1eb('0x9')](),controller['update']);router[_0xa1eb('0x10')](_0xa1eb('0xd'),auth[_0xa1eb('0x9')](),controller['destroy']);module[_0xa1eb('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 fc5a157..e404a6a 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 _0xdf9a=['agent','queue','DATE','NOW','moment','ENUM'];(function(_0x460d17,_0xe789af){var _0x1a7056=function(_0x178c58){while(--_0x178c58){_0x460d17['push'](_0x460d17['shift']());}};_0x1a7056(++_0xe789af);}(_0xdf9a,0xf4));var _0xadf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf9a[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xadf9('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xadf9('0x1')]('account',_0xadf9('0x2'),_0xadf9('0x3')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xadf9('0x4')],'allowNull':![],'defaultValue':Sequelize[_0xadf9('0x5')]}}; \ No newline at end of file +var _0x1e94=['DATE','ENUM','account','agent','queue'];(function(_0x16e8f2,_0x2b2c0a){var _0x4e3d2a=function(_0x145083){while(--_0x145083){_0x16e8f2['push'](_0x16e8f2['shift']());}};_0x4e3d2a(++_0x2b2c0a);}(_0x1e94,0x164));var _0x41e9=function(_0x57a2bf,_0x199985){_0x57a2bf=_0x57a2bf-0x0;var _0x1fc09e=_0x1e94[_0x57a2bf];return _0x1fc09e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x41e9('0x0')](_0x41e9('0x1'),_0x41e9('0x2'),_0x41e9('0x3')),'allowNull':![],'defaultValue':_0x41e9('0x3')},'transferredAt':{'type':Sequelize[_0x41e9('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 4e6c37c..588d0e7 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 _0xda3f=['set','Content-Range','apply','save','then','destroy','error','name','send','index','SmsTransferReport','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','type','key','options','includeAll','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','moment','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status'];(function(_0xff7e3f,_0x48d6d2){var _0xcd7a65=function(_0x1450c7){while(--_0x1450c7){_0xff7e3f['push'](_0xff7e3f['shift']());}};_0xcd7a65(++_0x48d6d2);}(_0xda3f,0xec));var _0xfda3=function(_0x570818,_0x3a0463){_0x570818=_0x570818-0x0;var _0x1a9051=_0xda3f[_0x570818];return _0x1a9051;};'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 hardwareService=require(_0xfda3('0x10'));var logger=require(_0xfda3('0x11'))('api');var utils=require(_0xfda3('0x12'));var config=require(_0xfda3('0x13'));var db=require(_0xfda3('0x14'))['db'];function respondWithStatusCode(_0x11afc1,_0x1443f4){_0x1443f4=_0x1443f4||0xcc;return function(_0x4b77ea){if(_0x4b77ea){return _0x11afc1[_0xfda3('0x15')](_0x1443f4);}return _0x11afc1['status'](_0x1443f4)[_0xfda3('0x16')]();};}function respondWithResult(_0x1e7a55,_0x4929fa){_0x4929fa=_0x4929fa||0xc8;return function(_0x501588){if(_0x501588){return _0x1e7a55['status'](_0x4929fa)[_0xfda3('0x17')](_0x501588);}};}function respondWithFilteredResult(_0x477fc0,_0x5ea793){return function(_0x57a229){if(_0x57a229){var _0x533365=_0x57a229[_0xfda3('0x18')],_0x80ea80=_0x5ea793[_0xfda3('0x19')],_0x474707=_0x5ea793[_0xfda3('0x19')]+_0x5ea793[_0xfda3('0x1a')],_0x249dc6;if(_0x474707>=_0x533365){_0x474707=_0x533365;_0x249dc6=0xc8;}else{_0x249dc6=0xce;}_0x477fc0[_0xfda3('0x1b')](_0x249dc6);return _0x477fc0[_0xfda3('0x1c')](_0xfda3('0x1d'),_0x80ea80+'-'+_0x474707+'/'+_0x533365)['json'](_0x57a229);}return null;};}function patchUpdates(_0x15ddb9){return function(_0x1bbdda){try{jsonpatch[_0xfda3('0x1e')](_0x1bbdda,_0x15ddb9,!![]);}catch(_0x32855a){return BPromise['reject'](_0x32855a);}return _0x1bbdda[_0xfda3('0x1f')]();};}function saveUpdates(_0x43cfac,_0x2ee74c){return function(_0x51e731){if(_0x51e731){return _0x51e731['update'](_0x43cfac)[_0xfda3('0x20')](function(_0x38d428){return _0x38d428;});}return null;};}function removeEntity(_0x4ea9f5,_0x545320){return function(_0x3cf5a9){if(_0x3cf5a9){return _0x3cf5a9[_0xfda3('0x21')]()[_0xfda3('0x20')](function(){_0x4ea9f5[_0xfda3('0x1b')](0xcc)[_0xfda3('0x16')]();});}};}function handleEntityNotFound(_0x2b84b7,_0x2677f6){return function(_0xc6fb9a){if(!_0xc6fb9a){_0x2b84b7[_0xfda3('0x15')](0x194);}return _0xc6fb9a;};}function handleError(_0x5499f5,_0x82341b){_0x82341b=_0x82341b||0x1f4;return function(_0x2d5b44){logger[_0xfda3('0x22')](_0x2d5b44['stack']);if(_0x2d5b44[_0xfda3('0x23')]){delete _0x2d5b44[_0xfda3('0x23')];}_0x5499f5[_0xfda3('0x1b')](_0x82341b)[_0xfda3('0x24')](_0x2d5b44);};}exports[_0xfda3('0x25')]=function(_0xad9f7b,_0x514d2a){var _0x3c6d7d={},_0x1e87fe={},_0x2bef2b={'count':0x0,'rows':[]};var _0x1f2884=db[_0xfda3('0x26')]['rawAttributes'];_0x1e87fe[_0xfda3('0x27')]=_[_0xfda3('0x28')](_0x1f2884);_0x1e87fe[_0xfda3('0x29')]=_[_0xfda3('0x28')](_0xad9f7b[_0xfda3('0x29')]);_0x1e87fe[_0xfda3('0x2a')]=_[_0xfda3('0x2b')](_0x1e87fe['model'],_0x1e87fe['query']);_0x3c6d7d[_0xfda3('0x2c')]=_['intersection'](_0x1e87fe['model'],qs[_0xfda3('0x2d')](_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x2d')]));_0x3c6d7d[_0xfda3('0x2c')]=_0x3c6d7d[_0xfda3('0x2c')][_0xfda3('0x2e')]?_0x3c6d7d[_0xfda3('0x2c')]:_0x1e87fe[_0xfda3('0x27')];if(!_0xad9f7b[_0xfda3('0x29')]['hasOwnProperty'](_0xfda3('0x2f'))){_0x3c6d7d[_0xfda3('0x1a')]=qs[_0xfda3('0x1a')](_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x1a')]);_0x3c6d7d[_0xfda3('0x19')]=qs[_0xfda3('0x19')](_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x19')]);}_0x3c6d7d['order']=qs['sort'](_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x30')]);_0x3c6d7d['where']=qs[_0xfda3('0x2a')](_[_0xfda3('0x31')](_0xad9f7b[_0xfda3('0x29')],_0x1e87fe['filters']));if(_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x32')]){_0x3c6d7d[_0xfda3('0x33')]=_[_0xfda3('0x34')](_0x3c6d7d[_0xfda3('0x33')],{'$or':_['map'](_0x1f2884,function(_0xc6dd4e){if(_0xc6dd4e[_0xfda3('0x35')][_0xfda3('0x36')]!=='VIRTUAL'){var _0x373c96={};_0x373c96[_0xc6dd4e['field']]={'$like':'%'+_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x32')]+'%'};return _0x373c96;}})});}_0x3c6d7d=_[_0xfda3('0x34')]({},_0x3c6d7d,_0xad9f7b[_0xfda3('0x37')]);var _0x21c5cc={'where':_0x3c6d7d[_0xfda3('0x33')]};return db[_0xfda3('0x26')][_0xfda3('0x18')](_0x21c5cc)['then'](function(_0x24c7ad){_0x2bef2b[_0xfda3('0x18')]=_0x24c7ad;if(_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x38')]){_0x3c6d7d['include']=[{'all':!![]}];}return db[_0xfda3('0x26')][_0xfda3('0x39')](_0x3c6d7d);})[_0xfda3('0x20')](function(_0x5bad90){_0x2bef2b['rows']=_0x5bad90;return _0x2bef2b;})[_0xfda3('0x20')](respondWithFilteredResult(_0x514d2a,_0x3c6d7d))[_0xfda3('0x3a')](handleError(_0x514d2a,null));};exports[_0xfda3('0x3b')]=function(_0x1aaa6c,_0x2b415d){var _0x115f20={'raw':!![],'where':{'id':_0x1aaa6c[_0xfda3('0x3c')]['id']}},_0x40b814={};_0x40b814[_0xfda3('0x27')]=_[_0xfda3('0x28')](db['SmsTransferReport'][_0xfda3('0x3d')]);_0x40b814[_0xfda3('0x29')]=_['keys'](_0x1aaa6c[_0xfda3('0x29')]);_0x40b814['filters']=_['intersection'](_0x40b814['model'],_0x40b814[_0xfda3('0x29')]);_0x115f20[_0xfda3('0x2c')]=_[_0xfda3('0x2b')](_0x40b814[_0xfda3('0x27')],qs['fields'](_0x1aaa6c[_0xfda3('0x29')][_0xfda3('0x2d')]));_0x115f20[_0xfda3('0x2c')]=_0x115f20[_0xfda3('0x2c')]['length']?_0x115f20[_0xfda3('0x2c')]:_0x40b814[_0xfda3('0x27')];if(_0x1aaa6c[_0xfda3('0x29')]['includeAll']){_0x115f20['include']=[{'all':!![]}];}_0x115f20=_[_0xfda3('0x34')]({},_0x115f20,_0x1aaa6c[_0xfda3('0x37')]);return db[_0xfda3('0x26')][_0xfda3('0x3e')](_0x115f20)[_0xfda3('0x20')](handleEntityNotFound(_0x2b415d,null))[_0xfda3('0x20')](respondWithResult(_0x2b415d,null))[_0xfda3('0x3a')](handleError(_0x2b415d,null));};exports[_0xfda3('0x3f')]=function(_0x12b533,_0x3ed533){return db[_0xfda3('0x26')][_0xfda3('0x3f')](_0x12b533[_0xfda3('0x40')],{})[_0xfda3('0x20')](respondWithResult(_0x3ed533,0xc9))['catch'](handleError(_0x3ed533,null));};exports['update']=function(_0x52b5c3,_0x2acde1){if(_0x52b5c3[_0xfda3('0x40')]['id']){delete _0x52b5c3[_0xfda3('0x40')]['id'];}return db[_0xfda3('0x26')][_0xfda3('0x3e')]({'where':{'id':_0x52b5c3[_0xfda3('0x3c')]['id']}})[_0xfda3('0x20')](handleEntityNotFound(_0x2acde1,null))[_0xfda3('0x20')](saveUpdates(_0x52b5c3[_0xfda3('0x40')],null))['then'](respondWithResult(_0x2acde1,null))[_0xfda3('0x3a')](handleError(_0x2acde1,null));};exports[_0xfda3('0x21')]=function(_0x481356,_0x36aa3a){return db[_0xfda3('0x26')]['find']({'where':{'id':_0x481356[_0xfda3('0x3c')]['id']}})[_0xfda3('0x20')](handleEntityNotFound(_0x36aa3a,null))[_0xfda3('0x20')](removeEntity(_0x36aa3a,null))['catch'](handleError(_0x36aa3a,null));};exports[_0xfda3('0x41')]=function(_0x39c96f,_0x11addf){return db['SmsTransferReport'][_0xfda3('0x41')]()[_0xfda3('0x20')](respondWithResult(_0x11addf,null))[_0xfda3('0x3a')](handleError(_0x11addf,null));}; \ No newline at end of file +var _0xcb91=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','SmsTransferReport','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','map','type','key','VIRTUAL','filter','includeAll','include','rows','catch','show','fields','options','create','body','find','params','describe','rimraf'];(function(_0x193ddf,_0x6f30bb){var _0x5bc6df=function(_0x70fd9e){while(--_0x70fd9e){_0x193ddf['push'](_0x193ddf['shift']());}};_0x5bc6df(++_0x6f30bb);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0xcb91[_0x1df7b8];return _0x29d911;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1cb9('0x0'));var zipdir=require(_0x1cb9('0x1'));var jsonpatch=require(_0x1cb9('0x2'));var rp=require(_0x1cb9('0x3'));var moment=require('moment');var BPromise=require(_0x1cb9('0x4'));var Mustache=require(_0x1cb9('0x5'));var util=require('util');var path=require(_0x1cb9('0x6'));var sox=require(_0x1cb9('0x7'));var csv=require('to-csv');var ejs=require(_0x1cb9('0x8'));var fs=require('fs');var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xd'));var authService=require(_0x1cb9('0xe'));var qs=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require(_0x1cb9('0x11'))('api');var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var db=require(_0x1cb9('0x14'))['db'];function respondWithStatusCode(_0x3fdd83,_0x46af58){_0x46af58=_0x46af58||0xcc;return function(_0x5445e1){if(_0x5445e1){return _0x3fdd83['sendStatus'](_0x46af58);}return _0x3fdd83['status'](_0x46af58)[_0x1cb9('0x15')]();};}function respondWithResult(_0x282bc6,_0x384496){_0x384496=_0x384496||0xc8;return function(_0x1c714f){if(_0x1c714f){return _0x282bc6['status'](_0x384496)[_0x1cb9('0x16')](_0x1c714f);}};}function respondWithFilteredResult(_0x6ef389,_0x1b3cd7){return function(_0x8dfa55){if(_0x8dfa55){var _0x3e2d11=_0x8dfa55[_0x1cb9('0x17')],_0x5806d8=_0x1b3cd7[_0x1cb9('0x18')],_0x5572cb=_0x1b3cd7[_0x1cb9('0x18')]+_0x1b3cd7[_0x1cb9('0x19')],_0xd446a3;if(_0x5572cb>=_0x3e2d11){_0x5572cb=_0x3e2d11;_0xd446a3=0xc8;}else{_0xd446a3=0xce;}_0x6ef389[_0x1cb9('0x1a')](_0xd446a3);return _0x6ef389[_0x1cb9('0x1b')]('Content-Range',_0x5806d8+'-'+_0x5572cb+'/'+_0x3e2d11)['json'](_0x8dfa55);}return null;};}function patchUpdates(_0x1b2fa6){return function(_0x41ac41){try{jsonpatch[_0x1cb9('0x1c')](_0x41ac41,_0x1b2fa6,!![]);}catch(_0x31481a){return BPromise[_0x1cb9('0x1d')](_0x31481a);}return _0x41ac41[_0x1cb9('0x1e')]();};}function saveUpdates(_0x24fa1f,_0x4ac422){return function(_0x559bcc){if(_0x559bcc){return _0x559bcc[_0x1cb9('0x1f')](_0x24fa1f)['then'](function(_0x4750b1){return _0x4750b1;});}return null;};}function removeEntity(_0x2265ea,_0x523b26){return function(_0x599275){if(_0x599275){return _0x599275[_0x1cb9('0x20')]()[_0x1cb9('0x21')](function(){_0x2265ea[_0x1cb9('0x1a')](0xcc)[_0x1cb9('0x15')]();});}};}function handleEntityNotFound(_0x45b8d3,_0x27db16){return function(_0x59ebea){if(!_0x59ebea){_0x45b8d3['sendStatus'](0x194);}return _0x59ebea;};}function handleError(_0x6c6f61,_0x557199){_0x557199=_0x557199||0x1f4;return function(_0x10a419){logger[_0x1cb9('0x22')](_0x10a419[_0x1cb9('0x23')]);if(_0x10a419[_0x1cb9('0x24')]){delete _0x10a419[_0x1cb9('0x24')];}_0x6c6f61['status'](_0x557199)[_0x1cb9('0x25')](_0x10a419);};}exports[_0x1cb9('0x26')]=function(_0x4c8d76,_0xd6891c){var _0x21effa={},_0x41a9a0={},_0x1804fd={'count':0x0,'rows':[]};var _0x406821=db[_0x1cb9('0x27')][_0x1cb9('0x28')];_0x41a9a0[_0x1cb9('0x29')]=_[_0x1cb9('0x2a')](_0x406821);_0x41a9a0[_0x1cb9('0x2b')]=_['keys'](_0x4c8d76[_0x1cb9('0x2b')]);_0x41a9a0['filters']=_[_0x1cb9('0x2c')](_0x41a9a0['model'],_0x41a9a0[_0x1cb9('0x2b')]);_0x21effa[_0x1cb9('0x2d')]=_[_0x1cb9('0x2c')](_0x41a9a0[_0x1cb9('0x29')],qs['fields'](_0x4c8d76[_0x1cb9('0x2b')]['fields']));_0x21effa[_0x1cb9('0x2d')]=_0x21effa[_0x1cb9('0x2d')][_0x1cb9('0x2e')]?_0x21effa['attributes']:_0x41a9a0[_0x1cb9('0x29')];if(!_0x4c8d76['query'][_0x1cb9('0x2f')]('nolimit')){_0x21effa[_0x1cb9('0x19')]=qs[_0x1cb9('0x19')](_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x19')]);_0x21effa['offset']=qs[_0x1cb9('0x18')](_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x18')]);}_0x21effa[_0x1cb9('0x30')]=qs[_0x1cb9('0x31')](_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x31')]);_0x21effa[_0x1cb9('0x32')]=qs[_0x1cb9('0x33')](_[_0x1cb9('0x34')](_0x4c8d76[_0x1cb9('0x2b')],_0x41a9a0[_0x1cb9('0x33')]));if(_0x4c8d76[_0x1cb9('0x2b')]['filter']){_0x21effa['where']=_[_0x1cb9('0x35')](_0x21effa[_0x1cb9('0x32')],{'$or':_[_0x1cb9('0x36')](_0x406821,function(_0x29f451){if(_0x29f451[_0x1cb9('0x37')][_0x1cb9('0x38')]!==_0x1cb9('0x39')){var _0x3f5637={};_0x3f5637[_0x29f451['field']]={'$like':'%'+_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x3a')]+'%'};return _0x3f5637;}})});}_0x21effa=_[_0x1cb9('0x35')]({},_0x21effa,_0x4c8d76['options']);var _0x2a5aac={'where':_0x21effa['where']};return db[_0x1cb9('0x27')]['count'](_0x2a5aac)[_0x1cb9('0x21')](function(_0x13d4fd){_0x1804fd[_0x1cb9('0x17')]=_0x13d4fd;if(_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x3b')]){_0x21effa[_0x1cb9('0x3c')]=[{'all':!![]}];}return db[_0x1cb9('0x27')]['findAll'](_0x21effa);})['then'](function(_0x4111b8){_0x1804fd[_0x1cb9('0x3d')]=_0x4111b8;return _0x1804fd;})[_0x1cb9('0x21')](respondWithFilteredResult(_0xd6891c,_0x21effa))[_0x1cb9('0x3e')](handleError(_0xd6891c,null));};exports[_0x1cb9('0x3f')]=function(_0x1d7304,_0x32130b){var _0x4a670c={'raw':!![],'where':{'id':_0x1d7304['params']['id']}},_0xbcaa32={};_0xbcaa32['model']=_['keys'](db[_0x1cb9('0x27')][_0x1cb9('0x28')]);_0xbcaa32[_0x1cb9('0x2b')]=_[_0x1cb9('0x2a')](_0x1d7304[_0x1cb9('0x2b')]);_0xbcaa32['filters']=_[_0x1cb9('0x2c')](_0xbcaa32['model'],_0xbcaa32[_0x1cb9('0x2b')]);_0x4a670c[_0x1cb9('0x2d')]=_[_0x1cb9('0x2c')](_0xbcaa32['model'],qs[_0x1cb9('0x40')](_0x1d7304['query'][_0x1cb9('0x40')]));_0x4a670c[_0x1cb9('0x2d')]=_0x4a670c['attributes']['length']?_0x4a670c[_0x1cb9('0x2d')]:_0xbcaa32[_0x1cb9('0x29')];if(_0x1d7304[_0x1cb9('0x2b')][_0x1cb9('0x3b')]){_0x4a670c[_0x1cb9('0x3c')]=[{'all':!![]}];}_0x4a670c=_['merge']({},_0x4a670c,_0x1d7304[_0x1cb9('0x41')]);return db['SmsTransferReport']['find'](_0x4a670c)['then'](handleEntityNotFound(_0x32130b,null))[_0x1cb9('0x21')](respondWithResult(_0x32130b,null))[_0x1cb9('0x3e')](handleError(_0x32130b,null));};exports[_0x1cb9('0x42')]=function(_0x11cea5,_0x116c05){return db[_0x1cb9('0x27')][_0x1cb9('0x42')](_0x11cea5[_0x1cb9('0x43')],{})[_0x1cb9('0x21')](respondWithResult(_0x116c05,0xc9))[_0x1cb9('0x3e')](handleError(_0x116c05,null));};exports[_0x1cb9('0x1f')]=function(_0x4ce899,_0x9d08cb){if(_0x4ce899[_0x1cb9('0x43')]['id']){delete _0x4ce899[_0x1cb9('0x43')]['id'];}return db['SmsTransferReport'][_0x1cb9('0x44')]({'where':{'id':_0x4ce899[_0x1cb9('0x45')]['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0x9d08cb,null))[_0x1cb9('0x21')](saveUpdates(_0x4ce899[_0x1cb9('0x43')],null))['then'](respondWithResult(_0x9d08cb,null))[_0x1cb9('0x3e')](handleError(_0x9d08cb,null));};exports['destroy']=function(_0x2eaa11,_0x4ac483){return db[_0x1cb9('0x27')][_0x1cb9('0x44')]({'where':{'id':_0x2eaa11[_0x1cb9('0x45')]['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0x4ac483,null))['then'](removeEntity(_0x4ac483,null))[_0x1cb9('0x3e')](handleError(_0x4ac483,null));};exports[_0x1cb9('0x46')]=function(_0x1b750d,_0x3561a5){return db[_0x1cb9('0x27')][_0x1cb9('0x46')]()[_0x1cb9('0x21')](respondWithResult(_0x3561a5,null))[_0x1cb9('0x3e')](handleError(_0x3561a5,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 1b74673..5cf8f57 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','uniqueid','lodash','util'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0x814b,0x1a2));var _0xb814=function(_0x170eb7,_0x1ac59b){_0x170eb7=_0x170eb7-0x0;var _0x4dfeac=_0x814b[_0x170eb7];return _0x4dfeac;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7046=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','uniqueid'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x7046,0x144));var _0x6704=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7046[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var logger=require(_0x6704('0x2'))(_0x6704('0x3'));var moment=require('moment');var BPromise=require(_0x6704('0x4'));var rp=require(_0x6704('0x5'));var fs=require('fs');var path=require(_0x6704('0x6'));var rimraf=require('rimraf');var config=require(_0x6704('0x7'));var attributes=require(_0x6704('0x8'));module[_0x6704('0x9')]=function(_0x626a14,_0x2917be){return _0x626a14['define'](_0x6704('0xa'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6704('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index bad6f87..762cab6 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 _0x32fa=['debug','stringify','error','code','message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3bad72,_0xe97a95){var _0x35d4d8=function(_0x7c55ae){while(--_0x7c55ae){_0x3bad72['push'](_0x3bad72['shift']());}};_0x35d4d8(++_0xe97a95);}(_0x32fa,0x197));var _0xa32f=function(_0x53dcfb,_0x114653){_0x53dcfb=_0x53dcfb-0x0;var _0x189500=_0x32fa[_0x53dcfb];return _0x189500;};'use strict';var _=require(_0xa32f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa32f('0x1'));var rs=require(_0xa32f('0x2'));var fs=require('fs');var Redis=require(_0xa32f('0x3'));var db=require(_0xa32f('0x4'))['db'];var utils=require(_0xa32f('0x5'));var logger=require(_0xa32f('0x6'))('rpc');var config=require(_0xa32f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa32f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x159436,_0x315f57,_0x5548fa){return new BPromise(function(_0x17d4af,_0x2ba821){return client[_0xa32f('0x9')](_0x159436,_0x5548fa)[_0xa32f('0xa')](function(_0x2e165a){logger['info'](_0xa32f('0xb'),_0x315f57,_0xa32f('0xc'));logger[_0xa32f('0xd')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x315f57,'request\x20sent',JSON[_0xa32f('0xe')](_0x2e165a));if(_0x2e165a[_0xa32f('0xf')]){if(_0x2e165a[_0xa32f('0xf')][_0xa32f('0x10')]===0x1f4){logger[_0xa32f('0xf')](_0xa32f('0xb'),_0x315f57,_0x2e165a[_0xa32f('0xf')][_0xa32f('0x11')]);return _0x2ba821(_0x2e165a['error']['message']);}logger[_0xa32f('0xf')](_0xa32f('0xb'),_0x315f57,_0x2e165a['error'][_0xa32f('0x11')]);return _0x17d4af(_0x2e165a[_0xa32f('0xf')][_0xa32f('0x11')]);}else{logger[_0xa32f('0x12')](_0xa32f('0xb'),_0x315f57,_0xa32f('0xc'));_0x17d4af(_0x2e165a['result']['message']);}})[_0xa32f('0x13')](function(_0x4d2242){logger[_0xa32f('0xf')](_0xa32f('0xb'),_0x315f57,_0x4d2242);_0x2ba821(_0x4d2242);});});} \ No newline at end of file +var _0xf6be=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x2b34d5,_0x88c404){var _0x5439fc=function(_0x3697ee){while(--_0x3697ee){_0x2b34d5['push'](_0x2b34d5['shift']());}};_0x5439fc(++_0x88c404);}(_0xf6be,0xa5));var _0xef6b=function(_0x1139d0,_0x41e5f8){_0x1139d0=_0x1139d0-0x0;var _0xcc01a6=_0xf6be[_0x1139d0];return _0xcc01a6;};'use strict';var _=require(_0xef6b('0x0'));var util=require(_0xef6b('0x1'));var moment=require(_0xef6b('0x2'));var BPromise=require(_0xef6b('0x3'));var rs=require(_0xef6b('0x4'));var fs=require('fs');var Redis=require(_0xef6b('0x5'));var db=require(_0xef6b('0x6'))['db'];var utils=require(_0xef6b('0x7'));var logger=require(_0xef6b('0x8'))(_0xef6b('0x9'));var config=require(_0xef6b('0xa'));var jayson=require(_0xef6b('0xb'));var client=jayson[_0xef6b('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51127c,_0xf06c26,_0x51c251){return new BPromise(function(_0x222131,_0x2516ef){return client[_0xef6b('0xd')](_0x51127c,_0x51c251)[_0xef6b('0xe')](function(_0x176ae5){logger[_0xef6b('0xf')](_0xef6b('0x10'),_0xf06c26,_0xef6b('0x11'));logger['debug'](_0xef6b('0x12'),_0xf06c26,_0xef6b('0x11'),JSON[_0xef6b('0x13')](_0x176ae5));if(_0x176ae5[_0xef6b('0x14')]){if(_0x176ae5['error'][_0xef6b('0x15')]===0x1f4){logger['error'](_0xef6b('0x10'),_0xf06c26,_0x176ae5[_0xef6b('0x14')]['message']);return _0x2516ef(_0x176ae5[_0xef6b('0x14')][_0xef6b('0x16')]);}logger[_0xef6b('0x14')]('SmsTransferReport,\x20%s,\x20%s',_0xf06c26,_0x176ae5[_0xef6b('0x14')][_0xef6b('0x16')]);return _0x222131(_0x176ae5[_0xef6b('0x14')][_0xef6b('0x16')]);}else{logger[_0xef6b('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0xf06c26,_0xef6b('0x11'));_0x222131(_0x176ae5['result'][_0xef6b('0x16')]);}})[_0xef6b('0x17')](function(_0x2f85d9){logger[_0xef6b('0x14')](_0xef6b('0x10'),_0xf06c26,_0x2f85d9);_0x2516ef(_0x2f85d9);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 8b6e8fd..d08a938 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 _0x9137=['format','%s-%s%s','basename','extname','now','post','single','file','create','put','update','delete','/:id','path','connect-timeout','express','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','show','/:id/download','join','server/files/sounds/original/','originalname','replace'];(function(_0xd8bc47,_0x26aaf8){var _0x8f0945=function(_0x5a0fea){while(--_0x5a0fea){_0xd8bc47['push'](_0xd8bc47['shift']());}};_0x8f0945(++_0x26aaf8);}(_0x9137,0x1bd));var _0x7913=function(_0x2b70df,_0x224881){_0x2b70df=_0x2b70df-0x0;var _0x44b705=_0x9137[_0x2b70df];return _0x44b705;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7913('0x0'));var timeout=require(_0x7913('0x1'));var express=require(_0x7913('0x2'));var router=express['Router']();var auth=require(_0x7913('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7913('0x4'));var controller=require(_0x7913('0x5'));router[_0x7913('0x6')]('/',auth[_0x7913('0x7')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7913('0x8')]);router[_0x7913('0x6')](_0x7913('0x9'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xf38d35,_0x599848,_0x55ea0f){_0x55ea0f(null,path[_0x7913('0xa')](config['root'],_0x7913('0xb')));},'filename':function(_0x1e5222,_0x3a3c43,_0x2f12ef){_0x3a3c43[_0x7913('0xc')]=_0x3a3c43[_0x7913('0xc')][_0x7913('0xd')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2f12ef(null,util[_0x7913('0xe')](_0x7913('0xf'),path[_0x7913('0x10')](_0x3a3c43['originalname'],path[_0x7913('0x11')](_0x3a3c43[_0x7913('0xc')])),Date[_0x7913('0x12')](),path[_0x7913('0x11')](_0x3a3c43[_0x7913('0xc')])));}})});router[_0x7913('0x13')]('/',upload[_0x7913('0x14')](_0x7913('0x15')),controller[_0x7913('0x16')]);router[_0x7913('0x17')]('/:id',auth[_0x7913('0x7')](),controller[_0x7913('0x18')]);router[_0x7913('0x19')](_0x7913('0x1a'),auth[_0x7913('0x7')](),controller[_0x7913('0x19')]);module['exports']=router; \ No newline at end of file +var _0x80c1=['index','show','/:id/download','download','join','root','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','now','post','create','put','update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated'];(function(_0xb766e1,_0x5f3172){var _0xdc6da7=function(_0x3fd4c3){while(--_0x3fd4c3){_0xb766e1['push'](_0xb766e1['shift']());}};_0xdc6da7(++_0x5f3172);}(_0x80c1,0xa3));var _0x180c=function(_0x1747e0,_0x42d2fc){_0x1747e0=_0x1747e0-0x0;var _0x4b163c=_0x80c1[_0x1747e0];return _0x4b163c;};'use strict';var multer=require(_0x180c('0x0'));var util=require(_0x180c('0x1'));var path=require('path');var timeout=require(_0x180c('0x2'));var express=require(_0x180c('0x3'));var router=express[_0x180c('0x4')]();var auth=require(_0x180c('0x5'));var interaction=require(_0x180c('0x6'));var config=require(_0x180c('0x7'));var controller=require(_0x180c('0x8'));router[_0x180c('0x9')]('/',auth[_0x180c('0xa')](),controller[_0x180c('0xb')]);router[_0x180c('0x9')]('/:id',auth[_0x180c('0xa')](),controller[_0x180c('0xc')]);router[_0x180c('0x9')](_0x180c('0xd'),auth[_0x180c('0xa')](),controller[_0x180c('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2cf06e,_0x41bbcf,_0x263c74){_0x263c74(null,path[_0x180c('0xf')](config[_0x180c('0x10')],_0x180c('0x11')));},'filename':function(_0x50c132,_0x562c76,_0x4819d3){_0x562c76[_0x180c('0x12')]=_0x562c76[_0x180c('0x12')][_0x180c('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4819d3(null,util['format'](_0x180c('0x14'),path[_0x180c('0x15')](_0x562c76[_0x180c('0x12')],path[_0x180c('0x16')](_0x562c76[_0x180c('0x12')])),Date[_0x180c('0x17')](),path[_0x180c('0x16')](_0x562c76[_0x180c('0x12')])));}})});router[_0x180c('0x18')]('/',upload['single']('file'),controller[_0x180c('0x19')]);router[_0x180c('0x1a')]('/:id',auth[_0x180c('0xa')](),controller[_0x180c('0x1b')]);router[_0x180c('0x1c')]('/:id',auth[_0x180c('0xa')](),controller[_0x180c('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 2ac142b..d45725a 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 _0xa830=['INTEGER','sequelize','exports','STRING','name','BIGINT'];(function(_0x24873d,_0x315c62){var _0x495492=function(_0x565fdd){while(--_0x565fdd){_0x24873d['push'](_0x24873d['shift']());}};_0x495492(++_0x315c62);}(_0xa830,0x11b));var _0x0a83=function(_0x407b00,_0x3868c1){_0x407b00=_0x407b00-0x0;var _0x2450aa=_0xa830[_0x407b00];return _0x2450aa;};'use strict';var Sequelize=require(_0x0a83('0x0'));module[_0x0a83('0x1')]={'name':{'type':Sequelize[_0x0a83('0x2')],'unique':_0x0a83('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x0a83('0x2')]},'display_name':{'type':Sequelize[_0x0a83('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x0a83('0x2')]},'original_format':{'type':Sequelize[_0x0a83('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x0a83('0x4')]},'original_channelCount':{'type':Sequelize[_0x0a83('0x5')]},'original_bitRate':{'type':Sequelize[_0x0a83('0x4')]},'original_sampleRate':{'type':Sequelize[_0x0a83('0x5')]},'converted_format':{'type':Sequelize[_0x0a83('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x0a83('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x0a83('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x0a83('0x5')]}}; \ No newline at end of file +var _0xced8=['INTEGER','FLOAT','STRING','name','BIGINT'];(function(_0x45569f,_0x25523a){var _0x4b27eb=function(_0x4bccce){while(--_0x4bccce){_0x45569f['push'](_0x45569f['shift']());}};_0x4b27eb(++_0x25523a);}(_0xced8,0xcf));var _0x8ced=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xced8[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8ced('0x0')],'unique':_0x8ced('0x1'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x8ced('0x0')]},'original_format':{'type':Sequelize[_0x8ced('0x0')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x8ced('0x2')]},'original_channelCount':{'type':Sequelize[_0x8ced('0x3')]},'original_bitRate':{'type':Sequelize[_0x8ced('0x2')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x8ced('0x0')]},'converted_duration':{'type':Sequelize[_0x8ced('0x4')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x8ced('0x3')]},'converted_bitRate':{'type':Sequelize[_0x8ced('0x2')]},'converted_sampleRate':{'type':Sequelize[_0x8ced('0x3')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 4a2559c..5cef16e 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 _0xd357=['../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','then','destroy','get','error','stack','name','send','index','Sound','model','query','filters','attributes','intersection','fields','length','nolimit','filter','merge','where','map','VIRTUAL','options','count','include','findAll','rows','catch','show','keys','rawAttributes','includeAll','find','params','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','file','originalname','extname','basename','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','UserProfileSection','Sounds','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','delete','server/files/sounds/converted','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x455ad5,_0x3c217a){var _0x1b861b=function(_0x21f259){while(--_0x21f259){_0x455ad5['push'](_0x455ad5['shift']());}};_0x1b861b(++_0x3c217a);}(_0xd357,0x14e));var _0x7d35=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd357[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0x7d35('0x0'));var emlformat=require(_0x7d35('0x1'));var rimraf=require(_0x7d35('0x2'));var zipdir=require(_0x7d35('0x3'));var jsonpatch=require(_0x7d35('0x4'));var rp=require(_0x7d35('0x5'));var moment=require(_0x7d35('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x7d35('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7d35('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7d35('0x9'));var crypto=require(_0x7d35('0xa'));var jsforce=require(_0x7d35('0xb'));var deskjs=require(_0x7d35('0xc'));var toCsv=require(_0x7d35('0x8'));var querystring=require(_0x7d35('0xd'));var Papa=require(_0x7d35('0xe'));var Redis=require(_0x7d35('0xf'));var authService=require(_0x7d35('0x10'));var qs=require(_0x7d35('0x11'));var hardwareService=require(_0x7d35('0x12'));var logger=require(_0x7d35('0x13'))(_0x7d35('0x14'));var utils=require(_0x7d35('0x15'));var config=require(_0x7d35('0x16'));var db=require(_0x7d35('0x17'))['db'];function respondWithStatusCode(_0x34138e,_0x55603e){_0x55603e=_0x55603e||0xcc;return function(_0x5cce79){if(_0x5cce79){return _0x34138e[_0x7d35('0x18')](_0x55603e);}return _0x34138e[_0x7d35('0x19')](_0x55603e)[_0x7d35('0x1a')]();};}function respondWithResult(_0x3485dd,_0xbc0471){_0xbc0471=_0xbc0471||0xc8;return function(_0x16cc12){if(_0x16cc12){return _0x3485dd[_0x7d35('0x19')](_0xbc0471)[_0x7d35('0x1b')](_0x16cc12);}};}function respondWithFilteredResult(_0x3ecdc8,_0x3d4216){return function(_0x269924){if(_0x269924){var _0xa6e7ab=_0x269924['count'],_0x2324b3=_0x3d4216[_0x7d35('0x1c')],_0x34d114=_0x3d4216[_0x7d35('0x1c')]+_0x3d4216[_0x7d35('0x1d')],_0x3e88e9;if(_0x34d114>=_0xa6e7ab){_0x34d114=_0xa6e7ab;_0x3e88e9=0xc8;}else{_0x3e88e9=0xce;}_0x3ecdc8[_0x7d35('0x19')](_0x3e88e9);return _0x3ecdc8[_0x7d35('0x1e')](_0x7d35('0x1f'),_0x2324b3+'-'+_0x34d114+'/'+_0xa6e7ab)[_0x7d35('0x1b')](_0x269924);}return null;};}function patchUpdates(_0x909491){return function(_0x3fdbc7){try{jsonpatch[_0x7d35('0x20')](_0x3fdbc7,_0x909491,!![]);}catch(_0x2901f4){return BPromise['reject'](_0x2901f4);}return _0x3fdbc7[_0x7d35('0x21')]();};}function saveUpdates(_0xa0f73f,_0x107d2f){return function(_0x3c22d4){if(_0x3c22d4){return _0x3c22d4['update'](_0xa0f73f)[_0x7d35('0x22')](function(_0x55f8c9){return _0x55f8c9;});}return null;};}function removeEntity(_0x328245,_0x57ec7f){return function(_0x6e20ab){if(_0x6e20ab){return _0x6e20ab[_0x7d35('0x23')]()[_0x7d35('0x22')](function(){var _0x451b20=_0x6e20ab[_0x7d35('0x24')]({'plain':!![]});var _0x46fd74='Sounds';return db['UserProfileResource']['destroy']({'where':{'type':_0x46fd74,'resourceId':_0x451b20['id']}})['then'](function(){return _0x6e20ab;});})[_0x7d35('0x22')](function(){_0x328245[_0x7d35('0x19')](0xcc)[_0x7d35('0x1a')]();});}};}function handleEntityNotFound(_0x4c10dc,_0x517078){return function(_0x57d8a1){if(!_0x57d8a1){_0x4c10dc[_0x7d35('0x18')](0x194);}return _0x57d8a1;};}function handleError(_0x259ce3,_0x5a06e6){_0x5a06e6=_0x5a06e6||0x1f4;return function(_0x2acc11){logger[_0x7d35('0x25')](_0x2acc11[_0x7d35('0x26')]);if(_0x2acc11[_0x7d35('0x27')]){delete _0x2acc11[_0x7d35('0x27')];}_0x259ce3['status'](_0x5a06e6)[_0x7d35('0x28')](_0x2acc11);};}exports[_0x7d35('0x29')]=function(_0x35afcb,_0x13a084){var _0x2ac90f={},_0x424c0c={},_0xa589d2={'count':0x0,'rows':[]};var _0x1cbc75=db[_0x7d35('0x2a')]['rawAttributes'];_0x424c0c[_0x7d35('0x2b')]=_['keys'](_0x1cbc75);_0x424c0c[_0x7d35('0x2c')]=_['keys'](_0x35afcb[_0x7d35('0x2c')]);_0x424c0c[_0x7d35('0x2d')]=_['intersection'](_0x424c0c[_0x7d35('0x2b')],_0x424c0c['query']);_0x2ac90f[_0x7d35('0x2e')]=_[_0x7d35('0x2f')](_0x424c0c[_0x7d35('0x2b')],qs[_0x7d35('0x30')](_0x35afcb['query']['fields']));_0x2ac90f[_0x7d35('0x2e')]=_0x2ac90f[_0x7d35('0x2e')][_0x7d35('0x31')]?_0x2ac90f['attributes']:_0x424c0c[_0x7d35('0x2b')];if(!_0x35afcb[_0x7d35('0x2c')]['hasOwnProperty'](_0x7d35('0x32'))){_0x2ac90f[_0x7d35('0x1d')]=qs[_0x7d35('0x1d')](_0x35afcb['query'][_0x7d35('0x1d')]);_0x2ac90f[_0x7d35('0x1c')]=qs[_0x7d35('0x1c')](_0x35afcb['query'][_0x7d35('0x1c')]);}_0x2ac90f['order']=qs['sort'](_0x35afcb[_0x7d35('0x2c')]['sort']);_0x2ac90f['where']=qs[_0x7d35('0x2d')](_['pick'](_0x35afcb[_0x7d35('0x2c')],_0x424c0c['filters']));if(_0x35afcb['query'][_0x7d35('0x33')]){_0x2ac90f['where']=_[_0x7d35('0x34')](_0x2ac90f[_0x7d35('0x35')],{'$or':_[_0x7d35('0x36')](_0x1cbc75,function(_0x41fc94){if(_0x41fc94['type']['key']!==_0x7d35('0x37')){var _0x31b608={};_0x31b608[_0x41fc94['field']]={'$like':'%'+_0x35afcb[_0x7d35('0x2c')][_0x7d35('0x33')]+'%'};return _0x31b608;}})});}_0x2ac90f=_['merge']({},_0x2ac90f,_0x35afcb[_0x7d35('0x38')]);var _0x1df887={'where':_0x2ac90f['where']};return db[_0x7d35('0x2a')][_0x7d35('0x39')](_0x1df887)['then'](function(_0x190606){_0xa589d2[_0x7d35('0x39')]=_0x190606;if(_0x35afcb[_0x7d35('0x2c')]['includeAll']){_0x2ac90f[_0x7d35('0x3a')]=[{'all':!![]}];}return db[_0x7d35('0x2a')][_0x7d35('0x3b')](_0x2ac90f);})[_0x7d35('0x22')](function(_0xbab9d3){_0xa589d2[_0x7d35('0x3c')]=_0xbab9d3;return _0xa589d2;})[_0x7d35('0x22')](respondWithFilteredResult(_0x13a084,_0x2ac90f))[_0x7d35('0x3d')](handleError(_0x13a084,null));};exports[_0x7d35('0x3e')]=function(_0xfa094a,_0x6f1064){var _0x1860b3={'raw':!![],'where':{'id':_0xfa094a['params']['id']}},_0x38d335={};_0x38d335[_0x7d35('0x2b')]=_[_0x7d35('0x3f')](db['Sound'][_0x7d35('0x40')]);_0x38d335['query']=_[_0x7d35('0x3f')](_0xfa094a[_0x7d35('0x2c')]);_0x38d335[_0x7d35('0x2d')]=_[_0x7d35('0x2f')](_0x38d335[_0x7d35('0x2b')],_0x38d335[_0x7d35('0x2c')]);_0x1860b3['attributes']=_[_0x7d35('0x2f')](_0x38d335[_0x7d35('0x2b')],qs['fields'](_0xfa094a[_0x7d35('0x2c')][_0x7d35('0x30')]));_0x1860b3[_0x7d35('0x2e')]=_0x1860b3[_0x7d35('0x2e')][_0x7d35('0x31')]?_0x1860b3[_0x7d35('0x2e')]:_0x38d335['model'];if(_0xfa094a[_0x7d35('0x2c')][_0x7d35('0x41')]){_0x1860b3['include']=[{'all':!![]}];}_0x1860b3=_['merge']({},_0x1860b3,_0xfa094a['options']);return db[_0x7d35('0x2a')][_0x7d35('0x42')](_0x1860b3)['then'](handleEntityNotFound(_0x6f1064,null))['then'](respondWithResult(_0x6f1064,null))[_0x7d35('0x3d')](handleError(_0x6f1064,null));};exports['download']=function(_0x5c22f2,_0x591266,_0x2be1c2){return db[_0x7d35('0x2a')][_0x7d35('0x42')]({'where':{'id':_0x5c22f2[_0x7d35('0x43')]['id']},'attributes':['name',_0x7d35('0x44'),_0x7d35('0x45')],'raw':!![]})['then'](handleEntityNotFound(_0x591266,null))[_0x7d35('0x22')](function(_0x11f022){if(_0x11f022){if(!fs[_0x7d35('0x46')](path[_0x7d35('0x47')](config[_0x7d35('0x48')],'server/files/sounds/converted',_0x11f022[_0x7d35('0x44')]+'.'+_0x11f022['converted_format']))){throw new db[(_0x7d35('0x49'))][(_0x7d35('0x4a'))](_0x7d35('0x4b'));}return _0x591266['download'](path[_0x7d35('0x47')](config[_0x7d35('0x48')],'server/files/sounds/converted',util[_0x7d35('0x4c')](_0x7d35('0x4d'),_0x11f022[_0x7d35('0x44')],_0x11f022['converted_format'])),util[_0x7d35('0x4c')](_0x7d35('0x4d'),_0x11f022[_0x7d35('0x27')],_0x11f022['converted_format']));}return null;})['catch'](handleError(_0x591266,null));};exports[_0x7d35('0x4e')]=function(_0x57b4e9,_0x4ee353,_0x5574a8){var _0x599355={'name':path['basename'](_0x57b4e9[_0x7d35('0x4f')][_0x7d35('0x50')],path[_0x7d35('0x51')](_0x57b4e9['file'][_0x7d35('0x50')])),'save_name':path[_0x7d35('0x52')](_0x57b4e9[_0x7d35('0x4f')]['filename'],path[_0x7d35('0x51')](_0x57b4e9[_0x7d35('0x4f')][_0x7d35('0x53')])),'original_format':path['extname'](_0x57b4e9[_0x7d35('0x4f')][_0x7d35('0x50')])[_0x7d35('0x54')](0x1),'converted_format':_0x7d35('0x55')};var _0x2351e9=path[_0x7d35('0x47')](config['root'],_0x7d35('0x56'),_0x57b4e9[_0x7d35('0x4f')][_0x7d35('0x53')]);var _0x175f4f=path['join'](config[_0x7d35('0x48')],'server/files/sounds/converted',util['format'](_0x7d35('0x4d'),path[_0x7d35('0x52')](_0x57b4e9[_0x7d35('0x4f')][_0x7d35('0x53')],path[_0x7d35('0x51')](_0x57b4e9[_0x7d35('0x4f')][_0x7d35('0x53')])),_0x599355[_0x7d35('0x45')]));logger[_0x7d35('0x57')](_0x7d35('0x58'),_0x2351e9);logger['info'](_0x7d35('0x59'),_0x175f4f);try{fs[_0x7d35('0x5a')](_0x2351e9,parseInt(_0x7d35('0x5b'),0x8));var _0x4d73e3=sox['transcode'](_0x2351e9,_0x175f4f,{'sampleRate':0x1f40,'format':_0x7d35('0x55'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4d73e3['on'](_0x7d35('0x25'),function(_0x145d35){fs['unlinkSync'](_0x2351e9);_0x4ee353[_0x7d35('0x19')](0x1f4)[_0x7d35('0x28')](_0x145d35);});_0x4d73e3['on'](_0x7d35('0x5c'),function(_0x2c1d48){_0x599355[_0x7d35('0x5d')]=isNaN(_0x2c1d48[_0x7d35('0x5e')])?null:_0x2c1d48[_0x7d35('0x5e')]*0x3e8;_0x599355[_0x7d35('0x5f')]=isNaN(_0x2c1d48[_0x7d35('0x60')])?null:_0x2c1d48[_0x7d35('0x60')];_0x599355['original_channelCount']=isNaN(_0x2c1d48[_0x7d35('0x61')])?null:_0x2c1d48[_0x7d35('0x61')];_0x599355[_0x7d35('0x62')]=isNaN(_0x2c1d48['bitRate'])?null:_0x2c1d48[_0x7d35('0x63')];_0x599355[_0x7d35('0x64')]=isNaN(_0x2c1d48[_0x7d35('0x65')])?null:_0x2c1d48['sampleRate'];});_0x4d73e3['on'](_0x7d35('0x66'),function(_0xdadd3a){_0x599355['converted_duration']=isNaN(_0xdadd3a[_0x7d35('0x5e')])?null:_0xdadd3a[_0x7d35('0x5e')]*0x3e8;_0x599355['converted_sampleCount']=isNaN(_0xdadd3a[_0x7d35('0x60')])?null:_0xdadd3a[_0x7d35('0x60')];_0x599355[_0x7d35('0x67')]=isNaN(_0xdadd3a[_0x7d35('0x61')])?null:_0xdadd3a['channelCount'];_0x599355[_0x7d35('0x68')]=isNaN(_0xdadd3a['bitRate'])?null:_0xdadd3a['bitRate'];_0x599355[_0x7d35('0x69')]=isNaN(_0xdadd3a[_0x7d35('0x65')])?null:_0xdadd3a[_0x7d35('0x65')];});_0x4d73e3['on'](_0x7d35('0x1a'),function(){fs[_0x7d35('0x5a')](_0x175f4f,parseInt(_0x7d35('0x5b'),0x8));return db[_0x7d35('0x2a')][_0x7d35('0x4e')](_0x599355)[_0x7d35('0x22')](function(_0x46395b){var _0x2146d7={'role':_0x57b4e9[_0x7d35('0x6a')][_0x7d35('0x6b')],'userProfileId':_0x57b4e9[_0x7d35('0x6a')]['userProfileId']};if(!_0x2146d7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2146d7[_0x7d35('0x6b')]==='user'){var _0x530554=_0x46395b[_0x7d35('0x24')]({'plain':!![]});return db[_0x7d35('0x6c')]['find']({'where':{'name':_0x7d35('0x6d'),'userProfileId':_0x2146d7[_0x7d35('0x6e')]},'raw':!![]})[_0x7d35('0x22')](function(_0x194dd2){if(_0x194dd2&&_0x194dd2[_0x7d35('0x6f')]===0x0){return db[_0x7d35('0x70')][_0x7d35('0x4e')]({'name':_0x530554[_0x7d35('0x27')],'resourceId':_0x530554['id'],'type':_0x194dd2['name'],'sectionId':_0x194dd2['id']},{})[_0x7d35('0x22')](function(){return _0x46395b;});}else{return _0x46395b;}})[_0x7d35('0x3d')](function(_0x5cd6c1){logger[_0x7d35('0x25')](_0x7d35('0x71'),_0x5cd6c1);throw _0x5cd6c1;});}return _0x46395b;})[_0x7d35('0x22')](respondWithResult(_0x4ee353,null))[_0x7d35('0x3d')](handleError(_0x4ee353,null));});_0x4d73e3[_0x7d35('0x72')]();}catch(_0x3d199e){_0x4ee353[_0x7d35('0x19')](0x1f4)[_0x7d35('0x28')](_0x3d199e);}};exports['update']=function(_0x25abf2,_0x1108e1,_0x298828){return db['Sound'][_0x7d35('0x42')]({'where':{'id':_0x25abf2[_0x7d35('0x43')]['id']}})[_0x7d35('0x22')](handleEntityNotFound(_0x1108e1,null))[_0x7d35('0x22')](saveUpdates(_[_0x7d35('0x73')](_0x25abf2[_0x7d35('0x6a')],[_0x7d35('0x27'),'description']),null))['then'](respondWithResult(_0x1108e1,null))[_0x7d35('0x3d')](handleError(_0x1108e1,null));};exports[_0x7d35('0x74')]=function(_0x51e39c,_0x102127,_0x454eb8){return db['Sound']['find']({'where':{'id':_0x51e39c['params']['id']}})['then'](function(_0x451d9a){if(_0x451d9a){return _0x451d9a['destroy']();}})[_0x7d35('0x22')](function(_0x158123){var _0x26c036=path['join'](config[_0x7d35('0x48')],'server/files/sounds/original',util[_0x7d35('0x4c')](_0x7d35('0x4d'),_0x158123['save_name'],_0x158123['original_format']));var _0x5cd7c9=path['join'](config[_0x7d35('0x48')],_0x7d35('0x75'),util[_0x7d35('0x4c')](_0x7d35('0x4d'),_0x158123['save_name'],_0x158123[_0x7d35('0x45')]));fs[_0x7d35('0x76')](_0x26c036);fs[_0x7d35('0x76')](_0x5cd7c9);return _0x158123;})['then'](function(_0x371eae){if(_0x371eae){return _0x102127[_0x7d35('0x19')](0xcc)[_0x7d35('0x1a')]();}})['then'](handleEntityNotFound(_0x102127,null))[_0x7d35('0x3d')](handleError(_0x102127,null));}; \ No newline at end of file +var _0x7d0b=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','limit','set','Content-Range','reject','save','update','then','destroy','get','Sounds','end','sendStatus','error','stack','name','send','index','Sound','rawAttributes','keys','query','filters','attributes','intersection','fields','length','model','nolimit','offset','order','sort','where','pick','merge','map','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','rows','catch','find','download','params','converted_format','join','root','server/files/sounds/converted','save_name','Sequelize','Sound\x20not\x20found','format','%s.%s','create','basename','originalname','extname','file','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','src','original_duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','0777','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','start','description','delete','original_format','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js'];(function(_0xb20dbf,_0x468bcc){var _0xeca225=function(_0x372dac){while(--_0x372dac){_0xb20dbf['push'](_0xb20dbf['shift']());}};_0xeca225(++_0x468bcc);}(_0x7d0b,0x172));var _0xb7d0=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7d0b[_0x8c43de];return _0xa6591b;};'use strict';var pdf=require(_0xb7d0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb7d0('0x1'));var zipdir=require(_0xb7d0('0x2'));var jsonpatch=require(_0xb7d0('0x3'));var rp=require(_0xb7d0('0x4'));var moment=require('moment');var BPromise=require(_0xb7d0('0x5'));var Mustache=require(_0xb7d0('0x6'));var util=require('util');var path=require(_0xb7d0('0x7'));var sox=require(_0xb7d0('0x8'));var csv=require(_0xb7d0('0x9'));var ejs=require(_0xb7d0('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb7d0('0xb'));var crypto=require('crypto');var jsforce=require(_0xb7d0('0xc'));var deskjs=require(_0xb7d0('0xd'));var toCsv=require(_0xb7d0('0x9'));var querystring=require(_0xb7d0('0xe'));var Papa=require(_0xb7d0('0xf'));var Redis=require(_0xb7d0('0x10'));var authService=require(_0xb7d0('0x11'));var qs=require(_0xb7d0('0x12'));var hardwareService=require(_0xb7d0('0x13'));var logger=require(_0xb7d0('0x14'))(_0xb7d0('0x15'));var utils=require(_0xb7d0('0x16'));var config=require(_0xb7d0('0x17'));var db=require(_0xb7d0('0x18'))['db'];function respondWithStatusCode(_0xa55370,_0x32042e){_0x32042e=_0x32042e||0xcc;return function(_0x416495){if(_0x416495){return _0xa55370['sendStatus'](_0x32042e);}return _0xa55370[_0xb7d0('0x19')](_0x32042e)['end']();};}function respondWithResult(_0x2b9f0a,_0x59ae49){_0x59ae49=_0x59ae49||0xc8;return function(_0x5cb9dc){if(_0x5cb9dc){return _0x2b9f0a['status'](_0x59ae49)[_0xb7d0('0x1a')](_0x5cb9dc);}};}function respondWithFilteredResult(_0x2f2096,_0x3c81b1){return function(_0x48748b){if(_0x48748b){var _0x5e6828=_0x48748b['count'],_0x3570bf=_0x3c81b1['offset'],_0x3a3ea3=_0x3c81b1['offset']+_0x3c81b1[_0xb7d0('0x1b')],_0x374fd2;if(_0x3a3ea3>=_0x5e6828){_0x3a3ea3=_0x5e6828;_0x374fd2=0xc8;}else{_0x374fd2=0xce;}_0x2f2096['status'](_0x374fd2);return _0x2f2096[_0xb7d0('0x1c')](_0xb7d0('0x1d'),_0x3570bf+'-'+_0x3a3ea3+'/'+_0x5e6828)[_0xb7d0('0x1a')](_0x48748b);}return null;};}function patchUpdates(_0x211bf0){return function(_0x244a72){try{jsonpatch['apply'](_0x244a72,_0x211bf0,!![]);}catch(_0x3ada00){return BPromise[_0xb7d0('0x1e')](_0x3ada00);}return _0x244a72[_0xb7d0('0x1f')]();};}function saveUpdates(_0x75df9,_0x2765ea){return function(_0x457e97){if(_0x457e97){return _0x457e97[_0xb7d0('0x20')](_0x75df9)[_0xb7d0('0x21')](function(_0x3944d1){return _0x3944d1;});}return null;};}function removeEntity(_0x78b990,_0x257181){return function(_0x1f94b3){if(_0x1f94b3){return _0x1f94b3[_0xb7d0('0x22')]()[_0xb7d0('0x21')](function(){var _0x2795b1=_0x1f94b3[_0xb7d0('0x23')]({'plain':!![]});var _0x1004a1=_0xb7d0('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x1004a1,'resourceId':_0x2795b1['id']}})[_0xb7d0('0x21')](function(){return _0x1f94b3;});})[_0xb7d0('0x21')](function(){_0x78b990[_0xb7d0('0x19')](0xcc)[_0xb7d0('0x25')]();});}};}function handleEntityNotFound(_0xbf0e20,_0x50670b){return function(_0x2eb229){if(!_0x2eb229){_0xbf0e20[_0xb7d0('0x26')](0x194);}return _0x2eb229;};}function handleError(_0x92700c,_0xb984a8){_0xb984a8=_0xb984a8||0x1f4;return function(_0x2f6a78){logger[_0xb7d0('0x27')](_0x2f6a78[_0xb7d0('0x28')]);if(_0x2f6a78[_0xb7d0('0x29')]){delete _0x2f6a78[_0xb7d0('0x29')];}_0x92700c[_0xb7d0('0x19')](_0xb984a8)[_0xb7d0('0x2a')](_0x2f6a78);};}exports[_0xb7d0('0x2b')]=function(_0x13c478,_0x65f0f5){var _0x3c3b1a={},_0x1c6ae4={},_0x24c0b8={'count':0x0,'rows':[]};var _0x5a0fd3=db[_0xb7d0('0x2c')][_0xb7d0('0x2d')];_0x1c6ae4['model']=_[_0xb7d0('0x2e')](_0x5a0fd3);_0x1c6ae4[_0xb7d0('0x2f')]=_['keys'](_0x13c478[_0xb7d0('0x2f')]);_0x1c6ae4[_0xb7d0('0x30')]=_['intersection'](_0x1c6ae4['model'],_0x1c6ae4[_0xb7d0('0x2f')]);_0x3c3b1a[_0xb7d0('0x31')]=_[_0xb7d0('0x32')](_0x1c6ae4['model'],qs['fields'](_0x13c478[_0xb7d0('0x2f')][_0xb7d0('0x33')]));_0x3c3b1a[_0xb7d0('0x31')]=_0x3c3b1a[_0xb7d0('0x31')][_0xb7d0('0x34')]?_0x3c3b1a['attributes']:_0x1c6ae4[_0xb7d0('0x35')];if(!_0x13c478[_0xb7d0('0x2f')]['hasOwnProperty'](_0xb7d0('0x36'))){_0x3c3b1a['limit']=qs['limit'](_0x13c478[_0xb7d0('0x2f')]['limit']);_0x3c3b1a[_0xb7d0('0x37')]=qs[_0xb7d0('0x37')](_0x13c478[_0xb7d0('0x2f')][_0xb7d0('0x37')]);}_0x3c3b1a[_0xb7d0('0x38')]=qs[_0xb7d0('0x39')](_0x13c478[_0xb7d0('0x2f')][_0xb7d0('0x39')]);_0x3c3b1a[_0xb7d0('0x3a')]=qs[_0xb7d0('0x30')](_[_0xb7d0('0x3b')](_0x13c478['query'],_0x1c6ae4[_0xb7d0('0x30')]));if(_0x13c478[_0xb7d0('0x2f')]['filter']){_0x3c3b1a[_0xb7d0('0x3a')]=_[_0xb7d0('0x3c')](_0x3c3b1a['where'],{'$or':_[_0xb7d0('0x3d')](_0x5a0fd3,function(_0x1e032f){if(_0x1e032f['type'][_0xb7d0('0x3e')]!==_0xb7d0('0x3f')){var _0x7211ab={};_0x7211ab[_0x1e032f[_0xb7d0('0x40')]]={'$like':'%'+_0x13c478[_0xb7d0('0x2f')][_0xb7d0('0x41')]+'%'};return _0x7211ab;}})});}_0x3c3b1a=_[_0xb7d0('0x3c')]({},_0x3c3b1a,_0x13c478[_0xb7d0('0x42')]);var _0xdc0133={'where':_0x3c3b1a[_0xb7d0('0x3a')]};return db[_0xb7d0('0x2c')]['count'](_0xdc0133)['then'](function(_0x18b1b2){_0x24c0b8[_0xb7d0('0x43')]=_0x18b1b2;if(_0x13c478[_0xb7d0('0x2f')][_0xb7d0('0x44')]){_0x3c3b1a[_0xb7d0('0x45')]=[{'all':!![]}];}return db['Sound'][_0xb7d0('0x46')](_0x3c3b1a);})[_0xb7d0('0x21')](function(_0x480abf){_0x24c0b8[_0xb7d0('0x47')]=_0x480abf;return _0x24c0b8;})[_0xb7d0('0x21')](respondWithFilteredResult(_0x65f0f5,_0x3c3b1a))[_0xb7d0('0x48')](handleError(_0x65f0f5,null));};exports['show']=function(_0x2be4cd,_0x155ebb){var _0x565b3c={'raw':!![],'where':{'id':_0x2be4cd['params']['id']}},_0x32297c={};_0x32297c[_0xb7d0('0x35')]=_[_0xb7d0('0x2e')](db[_0xb7d0('0x2c')][_0xb7d0('0x2d')]);_0x32297c['query']=_[_0xb7d0('0x2e')](_0x2be4cd['query']);_0x32297c['filters']=_['intersection'](_0x32297c[_0xb7d0('0x35')],_0x32297c[_0xb7d0('0x2f')]);_0x565b3c['attributes']=_[_0xb7d0('0x32')](_0x32297c[_0xb7d0('0x35')],qs[_0xb7d0('0x33')](_0x2be4cd['query'][_0xb7d0('0x33')]));_0x565b3c[_0xb7d0('0x31')]=_0x565b3c['attributes'][_0xb7d0('0x34')]?_0x565b3c['attributes']:_0x32297c['model'];if(_0x2be4cd[_0xb7d0('0x2f')]['includeAll']){_0x565b3c[_0xb7d0('0x45')]=[{'all':!![]}];}_0x565b3c=_[_0xb7d0('0x3c')]({},_0x565b3c,_0x2be4cd[_0xb7d0('0x42')]);return db[_0xb7d0('0x2c')][_0xb7d0('0x49')](_0x565b3c)[_0xb7d0('0x21')](handleEntityNotFound(_0x155ebb,null))[_0xb7d0('0x21')](respondWithResult(_0x155ebb,null))[_0xb7d0('0x48')](handleError(_0x155ebb,null));};exports[_0xb7d0('0x4a')]=function(_0x5e15c3,_0x133d0f,_0x28038a){return db[_0xb7d0('0x2c')][_0xb7d0('0x49')]({'where':{'id':_0x5e15c3[_0xb7d0('0x4b')]['id']},'attributes':[_0xb7d0('0x29'),'save_name',_0xb7d0('0x4c')],'raw':!![]})[_0xb7d0('0x21')](handleEntityNotFound(_0x133d0f,null))[_0xb7d0('0x21')](function(_0x5b77ba){if(_0x5b77ba){if(!fs['existsSync'](path[_0xb7d0('0x4d')](config[_0xb7d0('0x4e')],_0xb7d0('0x4f'),_0x5b77ba[_0xb7d0('0x50')]+'.'+_0x5b77ba[_0xb7d0('0x4c')]))){throw new db[(_0xb7d0('0x51'))]['ValidationError'](_0xb7d0('0x52'));}return _0x133d0f[_0xb7d0('0x4a')](path[_0xb7d0('0x4d')](config['root'],_0xb7d0('0x4f'),util[_0xb7d0('0x53')](_0xb7d0('0x54'),_0x5b77ba['save_name'],_0x5b77ba[_0xb7d0('0x4c')])),util[_0xb7d0('0x53')](_0xb7d0('0x54'),_0x5b77ba[_0xb7d0('0x29')],_0x5b77ba[_0xb7d0('0x4c')]));}return null;})['catch'](handleError(_0x133d0f,null));};exports[_0xb7d0('0x55')]=function(_0x20e715,_0x185be8,_0x3dd0ba){var _0x570093={'name':path[_0xb7d0('0x56')](_0x20e715['file'][_0xb7d0('0x57')],path[_0xb7d0('0x58')](_0x20e715[_0xb7d0('0x59')]['originalname'])),'save_name':path[_0xb7d0('0x56')](_0x20e715['file'][_0xb7d0('0x5a')],path['extname'](_0x20e715[_0xb7d0('0x59')][_0xb7d0('0x5a')])),'original_format':path[_0xb7d0('0x58')](_0x20e715[_0xb7d0('0x59')][_0xb7d0('0x57')])[_0xb7d0('0x5b')](0x1),'converted_format':_0xb7d0('0x5c')};var _0x281850=path['join'](config[_0xb7d0('0x4e')],_0xb7d0('0x5d'),_0x20e715['file']['filename']);var _0x350fbf=path[_0xb7d0('0x4d')](config[_0xb7d0('0x4e')],_0xb7d0('0x4f'),util['format'](_0xb7d0('0x54'),path[_0xb7d0('0x56')](_0x20e715[_0xb7d0('0x59')][_0xb7d0('0x5a')],path['extname'](_0x20e715[_0xb7d0('0x59')][_0xb7d0('0x5a')])),_0x570093[_0xb7d0('0x4c')]));logger[_0xb7d0('0x5e')]('Sound\x20upload\x20filepath:\x20%s',_0x281850);logger['info'](_0xb7d0('0x5f'),_0x350fbf);try{fs[_0xb7d0('0x60')](_0x281850,parseInt('0777',0x8));var _0x2bc93f=sox[_0xb7d0('0x61')](_0x281850,_0x350fbf,{'sampleRate':0x1f40,'format':_0xb7d0('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2bc93f['on'](_0xb7d0('0x27'),function(_0x299683){fs['unlinkSync'](_0x281850);_0x185be8[_0xb7d0('0x19')](0x1f4)['send'](_0x299683);});_0x2bc93f['on'](_0xb7d0('0x62'),function(_0x5b75e6){_0x570093[_0xb7d0('0x63')]=isNaN(_0x5b75e6['duration'])?null:_0x5b75e6['duration']*0x3e8;_0x570093[_0xb7d0('0x64')]=isNaN(_0x5b75e6[_0xb7d0('0x65')])?null:_0x5b75e6['sampleCount'];_0x570093[_0xb7d0('0x66')]=isNaN(_0x5b75e6[_0xb7d0('0x67')])?null:_0x5b75e6['channelCount'];_0x570093[_0xb7d0('0x68')]=isNaN(_0x5b75e6[_0xb7d0('0x69')])?null:_0x5b75e6[_0xb7d0('0x69')];_0x570093[_0xb7d0('0x6a')]=isNaN(_0x5b75e6['sampleRate'])?null:_0x5b75e6[_0xb7d0('0x6b')];});_0x2bc93f['on'](_0xb7d0('0x6c'),function(_0x3564e9){_0x570093[_0xb7d0('0x6d')]=isNaN(_0x3564e9['duration'])?null:_0x3564e9[_0xb7d0('0x6e')]*0x3e8;_0x570093[_0xb7d0('0x6f')]=isNaN(_0x3564e9[_0xb7d0('0x65')])?null:_0x3564e9[_0xb7d0('0x65')];_0x570093[_0xb7d0('0x70')]=isNaN(_0x3564e9[_0xb7d0('0x67')])?null:_0x3564e9[_0xb7d0('0x67')];_0x570093[_0xb7d0('0x71')]=isNaN(_0x3564e9[_0xb7d0('0x69')])?null:_0x3564e9['bitRate'];_0x570093[_0xb7d0('0x72')]=isNaN(_0x3564e9[_0xb7d0('0x6b')])?null:_0x3564e9[_0xb7d0('0x6b')];});_0x2bc93f['on'](_0xb7d0('0x25'),function(){fs[_0xb7d0('0x60')](_0x350fbf,parseInt(_0xb7d0('0x73'),0x8));return db['Sound'][_0xb7d0('0x55')](_0x570093)['then'](function(_0x54ff7e){var _0x570f47={'role':_0x20e715[_0xb7d0('0x74')]['role'],'userProfileId':_0x20e715['body'][_0xb7d0('0x75')]};if(!_0x570f47)throw new Error(_0xb7d0('0x76'));if(_0x570f47['role']===_0xb7d0('0x77')){var _0x304ab4=_0x54ff7e['get']({'plain':!![]});return db[_0xb7d0('0x78')]['find']({'where':{'name':_0xb7d0('0x24'),'userProfileId':_0x570f47[_0xb7d0('0x75')]},'raw':!![]})[_0xb7d0('0x21')](function(_0x446ec1){if(_0x446ec1&&_0x446ec1[_0xb7d0('0x79')]===0x0){return db[_0xb7d0('0x7a')][_0xb7d0('0x55')]({'name':_0x304ab4[_0xb7d0('0x29')],'resourceId':_0x304ab4['id'],'type':_0x446ec1[_0xb7d0('0x29')],'sectionId':_0x446ec1['id']},{})[_0xb7d0('0x21')](function(){return _0x54ff7e;});}else{return _0x54ff7e;}})[_0xb7d0('0x48')](function(_0xce98e9){logger[_0xb7d0('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xce98e9);throw _0xce98e9;});}return _0x54ff7e;})[_0xb7d0('0x21')](respondWithResult(_0x185be8,null))[_0xb7d0('0x48')](handleError(_0x185be8,null));});_0x2bc93f[_0xb7d0('0x7b')]();}catch(_0x1d161a){_0x185be8[_0xb7d0('0x19')](0x1f4)['send'](_0x1d161a);}};exports[_0xb7d0('0x20')]=function(_0x5ed5c1,_0x464acb,_0x292d7f){return db[_0xb7d0('0x2c')]['find']({'where':{'id':_0x5ed5c1[_0xb7d0('0x4b')]['id']}})[_0xb7d0('0x21')](handleEntityNotFound(_0x464acb,null))[_0xb7d0('0x21')](saveUpdates(_['pick'](_0x5ed5c1[_0xb7d0('0x74')],[_0xb7d0('0x29'),_0xb7d0('0x7c')]),null))[_0xb7d0('0x21')](respondWithResult(_0x464acb,null))[_0xb7d0('0x48')](handleError(_0x464acb,null));};exports[_0xb7d0('0x7d')]=function(_0x12cf52,_0x57fb2,_0x12f169){return db[_0xb7d0('0x2c')]['find']({'where':{'id':_0x12cf52[_0xb7d0('0x4b')]['id']}})['then'](function(_0x174ae5){if(_0x174ae5){return _0x174ae5[_0xb7d0('0x22')]();}})[_0xb7d0('0x21')](function(_0x5e3547){var _0x422fdc=path['join'](config[_0xb7d0('0x4e')],_0xb7d0('0x5d'),util[_0xb7d0('0x53')](_0xb7d0('0x54'),_0x5e3547[_0xb7d0('0x50')],_0x5e3547[_0xb7d0('0x7e')]));var _0x21d1d5=path[_0xb7d0('0x4d')](config['root'],_0xb7d0('0x4f'),util[_0xb7d0('0x53')](_0xb7d0('0x54'),_0x5e3547['save_name'],_0x5e3547[_0xb7d0('0x4c')]));fs[_0xb7d0('0x7f')](_0x422fdc);fs[_0xb7d0('0x7f')](_0x21d1d5);return _0x5e3547;})[_0xb7d0('0x21')](function(_0x41a49e){if(_0x41a49e){return _0x57fb2[_0xb7d0('0x19')](0xcc)['end']();}})[_0xb7d0('0x21')](handleEntityNotFound(_0x57fb2,null))[_0xb7d0('0x48')](handleError(_0x57fb2,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 55d9868..66798e0 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 _0xce2f=['tools_sounds','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./sound.attributes','exports','define','Sound'];(function(_0x31c53a,_0x16f8a5){var _0x4f55c1=function(_0x3e9f62){while(--_0x3e9f62){_0x31c53a['push'](_0x31c53a['shift']());}};_0x4f55c1(++_0x16f8a5);}(_0xce2f,0xaa));var _0xfce2=function(_0x12bd66,_0x2fc3ee){_0x12bd66=_0x12bd66-0x0;var _0xf62f3=_0xce2f[_0x12bd66];return _0xf62f3;};'use strict';var _=require(_0xfce2('0x0'));var util=require('util');var logger=require(_0xfce2('0x1'))(_0xfce2('0x2'));var moment=require(_0xfce2('0x3'));var BPromise=require(_0xfce2('0x4'));var rp=require(_0xfce2('0x5'));var fs=require('fs');var path=require(_0xfce2('0x6'));var rimraf=require('rimraf');var config=require(_0xfce2('0x7'));var attributes=require(_0xfce2('0x8'));module[_0xfce2('0x9')]=function(_0x3d9025,_0x53b38b){return _0x3d9025[_0xfce2('0xa')](_0xfce2('0xb'),attributes,{'tableName':_0xfce2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87bb=['rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1fb912,_0x1f1dfd){var _0x458f59=function(_0x25b1ca){while(--_0x25b1ca){_0x1fb912['push'](_0x1fb912['shift']());}};_0x458f59(++_0x1f1dfd);}(_0x87bb,0xf7));var _0xb87b=function(_0x567260,_0x14ca34){_0x567260=_0x567260-0x0;var _0x473a0d=_0x87bb[_0x567260];return _0x473a0d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb87b('0x0'))('api');var moment=require(_0xb87b('0x1'));var BPromise=require(_0xb87b('0x2'));var rp=require(_0xb87b('0x3'));var fs=require('fs');var path=require(_0xb87b('0x4'));var rimraf=require(_0xb87b('0x5'));var config=require(_0xb87b('0x6'));var attributes=require(_0xb87b('0x7'));module[_0xb87b('0x8')]=function(_0x3f5a0e,_0x217c09){return _0x3f5a0e[_0xb87b('0x9')](_0xb87b('0xa'),attributes,{'tableName':_0xb87b('0xb'),'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 ff8fb35..45f38d7 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 _0x6d48=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','Sound','find','options','raw','where','attributes','map','model','include','ShowSound','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x551787,_0x24a8d4){var _0x53991d=function(_0x12c62a){while(--_0x12c62a){_0x551787['push'](_0x551787['shift']());}};_0x53991d(++_0x24a8d4);}(_0x6d48,0x65));var _0x86d4=function(_0x111f48,_0x53819b){_0x111f48=_0x111f48-0x0;var _0x5423bc=_0x6d48[_0x111f48];return _0x5423bc;};'use strict';var _=require(_0x86d4('0x0'));var util=require(_0x86d4('0x1'));var moment=require(_0x86d4('0x2'));var BPromise=require(_0x86d4('0x3'));var rs=require(_0x86d4('0x4'));var fs=require('fs');var Redis=require(_0x86d4('0x5'));var db=require(_0x86d4('0x6'))['db'];var utils=require(_0x86d4('0x7'));var logger=require(_0x86d4('0x8'))(_0x86d4('0x9'));var config=require(_0x86d4('0xa'));var jayson=require(_0x86d4('0xb'));var client=jayson[_0x86d4('0xc')][_0x86d4('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x58e012,_0x7fb30b,_0x7fe468){return new BPromise(function(_0x424eae,_0x158d61){return client[_0x86d4('0xe')](_0x58e012,_0x7fe468)[_0x86d4('0xf')](function(_0x5c5a92){logger[_0x86d4('0x10')](_0x86d4('0x11'),_0x7fb30b,'request\x20sent');logger[_0x86d4('0x12')]('Sound,\x20%s,\x20%s,\x20%s',_0x7fb30b,_0x86d4('0x13'),JSON['stringify'](_0x5c5a92));if(_0x5c5a92['error']){if(_0x5c5a92[_0x86d4('0x14')][_0x86d4('0x15')]===0x1f4){logger[_0x86d4('0x14')](_0x86d4('0x11'),_0x7fb30b,_0x5c5a92[_0x86d4('0x14')]['message']);return _0x158d61(_0x5c5a92[_0x86d4('0x14')][_0x86d4('0x16')]);}logger[_0x86d4('0x14')](_0x86d4('0x11'),_0x7fb30b,_0x5c5a92[_0x86d4('0x14')]['message']);return _0x424eae(_0x5c5a92['error'][_0x86d4('0x16')]);}else{logger[_0x86d4('0x10')](_0x86d4('0x11'),_0x7fb30b,_0x86d4('0x13'));_0x424eae(_0x5c5a92[_0x86d4('0x17')][_0x86d4('0x16')]);}})[_0x86d4('0x18')](function(_0x5a1179){logger[_0x86d4('0x14')](_0x86d4('0x11'),_0x7fb30b,_0x5a1179);_0x158d61(_0x5a1179);});});}exports['ShowSound']=function(_0x565b0e){var _0x72fdaf=this;return new Promise(function(_0x250e60,_0x3adeb1){return db[_0x86d4('0x19')][_0x86d4('0x1a')]({'raw':_0x565b0e[_0x86d4('0x1b')]?_0x565b0e['options'][_0x86d4('0x1c')]===undefined?!![]:![]:!![],'where':_0x565b0e['options']?_0x565b0e[_0x86d4('0x1b')][_0x86d4('0x1d')]||null:null,'attributes':_0x565b0e['options']?_0x565b0e[_0x86d4('0x1b')][_0x86d4('0x1e')]||null:null,'include':_0x565b0e['options']?_0x565b0e['options']['include']?_[_0x86d4('0x1f')](_0x565b0e['options']['include'],function(_0xf27474){return{'model':db[_0xf27474[_0x86d4('0x20')]],'as':_0xf27474['as'],'attributes':_0xf27474[_0x86d4('0x1e')],'include':_0xf27474[_0x86d4('0x21')]?_['map'](_0xf27474[_0x86d4('0x21')],function(_0x485c82){return{'model':db[_0x485c82['model']],'as':_0x485c82['as'],'attributes':_0x485c82['attributes'],'include':_0x485c82['include']?_[_0x86d4('0x1f')](_0x485c82[_0x86d4('0x21')],function(_0x3133a6){return{'model':db[_0x3133a6[_0x86d4('0x20')]],'as':_0x3133a6['as'],'attributes':_0x3133a6[_0x86d4('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24f07c){logger[_0x86d4('0x10')](_0x86d4('0x22'),_0x565b0e);logger[_0x86d4('0x12')](_0x86d4('0x22'),_0x565b0e,JSON[_0x86d4('0x23')](_0x24f07c));_0x250e60(_0x24f07c);})['catch'](function(_0x3c0aca){logger[_0x86d4('0x14')](_0x86d4('0x22'),_0x3c0aca['message'],_0x565b0e);_0x3adeb1(_0x72fdaf[_0x86d4('0x14')](0x1f4,_0x3c0aca[_0x86d4('0x16')]));});});}; \ No newline at end of file +var _0xb6ae=['then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','ShowSound','find','options','raw','where','attributes','include','map','model','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xb6ae,0x103));var _0xeb6a=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0xb6ae[_0x2d982d];return _0x4f36b0;};'use strict';var _=require(_0xeb6a('0x0'));var util=require(_0xeb6a('0x1'));var moment=require(_0xeb6a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb6a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xeb6a('0x4'));var logger=require(_0xeb6a('0x5'))(_0xeb6a('0x6'));var config=require(_0xeb6a('0x7'));var jayson=require(_0xeb6a('0x8'));var client=jayson[_0xeb6a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53e19b,_0x13959b,_0x5b9d93){return new BPromise(function(_0x170f11,_0x543f2f){return client[_0xeb6a('0xa')](_0x53e19b,_0x5b9d93)[_0xeb6a('0xb')](function(_0x7f9b66){logger[_0xeb6a('0xc')](_0xeb6a('0xd'),_0x13959b,'request\x20sent');logger[_0xeb6a('0xe')](_0xeb6a('0xf'),_0x13959b,_0xeb6a('0x10'),JSON[_0xeb6a('0x11')](_0x7f9b66));if(_0x7f9b66[_0xeb6a('0x12')]){if(_0x7f9b66[_0xeb6a('0x12')]['code']===0x1f4){logger['error']('Sound,\x20%s,\x20%s',_0x13959b,_0x7f9b66[_0xeb6a('0x12')][_0xeb6a('0x13')]);return _0x543f2f(_0x7f9b66[_0xeb6a('0x12')][_0xeb6a('0x13')]);}logger[_0xeb6a('0x12')](_0xeb6a('0xd'),_0x13959b,_0x7f9b66['error'][_0xeb6a('0x13')]);return _0x170f11(_0x7f9b66[_0xeb6a('0x12')]['message']);}else{logger[_0xeb6a('0xc')](_0xeb6a('0xd'),_0x13959b,_0xeb6a('0x10'));_0x170f11(_0x7f9b66['result']['message']);}})[_0xeb6a('0x14')](function(_0x106b6b){logger[_0xeb6a('0x12')](_0xeb6a('0xd'),_0x13959b,_0x106b6b);_0x543f2f(_0x106b6b);});});}exports[_0xeb6a('0x15')]=function(_0x592c7f){var _0x70bd21=this;return new Promise(function(_0x1513b1,_0x45fdde){return db['Sound'][_0xeb6a('0x16')]({'raw':_0x592c7f['options']?_0x592c7f[_0xeb6a('0x17')][_0xeb6a('0x18')]===undefined?!![]:![]:!![],'where':_0x592c7f[_0xeb6a('0x17')]?_0x592c7f['options'][_0xeb6a('0x19')]||null:null,'attributes':_0x592c7f[_0xeb6a('0x17')]?_0x592c7f[_0xeb6a('0x17')][_0xeb6a('0x1a')]||null:null,'include':_0x592c7f['options']?_0x592c7f[_0xeb6a('0x17')][_0xeb6a('0x1b')]?_[_0xeb6a('0x1c')](_0x592c7f[_0xeb6a('0x17')][_0xeb6a('0x1b')],function(_0x54c84){return{'model':db[_0x54c84[_0xeb6a('0x1d')]],'as':_0x54c84['as'],'attributes':_0x54c84[_0xeb6a('0x1a')],'include':_0x54c84[_0xeb6a('0x1b')]?_[_0xeb6a('0x1c')](_0x54c84[_0xeb6a('0x1b')],function(_0xd3bf1a){return{'model':db[_0xd3bf1a['model']],'as':_0xd3bf1a['as'],'attributes':_0xd3bf1a[_0xeb6a('0x1a')],'include':_0xd3bf1a['include']?_[_0xeb6a('0x1c')](_0xd3bf1a[_0xeb6a('0x1b')],function(_0x26c910){return{'model':db[_0x26c910[_0xeb6a('0x1d')]],'as':_0x26c910['as'],'attributes':_0x26c910[_0xeb6a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bea59){logger[_0xeb6a('0xc')](_0xeb6a('0x15'),_0x592c7f);logger['debug'](_0xeb6a('0x15'),_0x592c7f,JSON[_0xeb6a('0x11')](_0x5bea59));_0x1513b1(_0x5bea59);})[_0xeb6a('0x14')](function(_0x52132a){logger[_0xeb6a('0x12')](_0xeb6a('0x15'),_0x52132a[_0xeb6a('0x13')],_0x592c7f);_0x45fdde(_0x70bd21[_0xeb6a('0x12')](0x1f4,_0x52132a[_0xeb6a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 32c762b..0777f20 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 _0x80b4=['/:id','show','create','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x80b4,0xa8));var _0x480b=function(_0x208494,_0x47d042){_0x208494=_0x208494-0x0;var _0xfc048d=_0x80b4[_0x208494];return _0xfc048d;};'use strict';var multer=require(_0x480b('0x0'));var util=require(_0x480b('0x1'));var path=require(_0x480b('0x2'));var timeout=require('connect-timeout');var express=require(_0x480b('0x3'));var router=express[_0x480b('0x4')]();var auth=require(_0x480b('0x5'));var interaction=require(_0x480b('0x6'));var config=require(_0x480b('0x7'));var controller=require(_0x480b('0x8'));router[_0x480b('0x9')]('/',auth[_0x480b('0xa')](),controller[_0x480b('0xb')]);router[_0x480b('0x9')](_0x480b('0xc'),auth[_0x480b('0xa')](),controller[_0x480b('0xd')]);router['post']('/',auth[_0x480b('0xa')](),controller[_0x480b('0xe')]);router['put'](_0x480b('0xc'),auth[_0x480b('0xa')](),controller[_0x480b('0xf')]);router[_0x480b('0x10')]('/:id',auth[_0x480b('0xa')](),controller['destroy']);module[_0x480b('0x11')]=router; \ No newline at end of file +var _0x458f=['delete','/:id','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareMessage.controller','get','isAuthenticated','index','show','create','put','update'];(function(_0x496604,_0x1eae4f){var _0x1a8a0e=function(_0x82d4dd){while(--_0x82d4dd){_0x496604['push'](_0x496604['shift']());}};_0x1a8a0e(++_0x1eae4f);}(_0x458f,0x17d));var _0xf458=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x458f[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xf458('0x0'));var util=require('util');var path=require(_0xf458('0x1'));var timeout=require(_0xf458('0x2'));var express=require(_0xf458('0x3'));var router=express[_0xf458('0x4')]();var auth=require(_0xf458('0x5'));var interaction=require(_0xf458('0x6'));var config=require('../../config/environment');var controller=require(_0xf458('0x7'));router[_0xf458('0x8')]('/',auth[_0xf458('0x9')](),controller[_0xf458('0xa')]);router[_0xf458('0x8')]('/:id',auth[_0xf458('0x9')](),controller[_0xf458('0xb')]);router['post']('/',auth[_0xf458('0x9')](),controller[_0xf458('0xc')]);router[_0xf458('0xd')]('/:id',auth[_0xf458('0x9')](),controller[_0xf458('0xe')]);router[_0xf458('0xf')](_0xf458('0x10'),auth[_0xf458('0x9')](),controller['destroy']);module[_0xf458('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index a20e2ea..37270ee 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 _0xe6ee=['sequelize','TEXT','medium','ENUM','out'];(function(_0x341b8d,_0x22047b){var _0x25d680=function(_0x20f6e9){while(--_0x20f6e9){_0x341b8d['push'](_0x341b8d['shift']());}};_0x25d680(++_0x22047b);}(_0xe6ee,0xc8));var _0xee6e=function(_0x59e357,_0xef4119){_0x59e357=_0x59e357-0x0;var _0x1c20c1=_0xe6ee[_0x59e357];return _0x1c20c1;};'use strict';var Sequelize=require(_0xee6e('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xee6e('0x1')](_0xee6e('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xee6e('0x3')]('in',_0xee6e('0x4')),'defaultValue':_0xee6e('0x4'),'allowNull':![]}}; \ No newline at end of file +var _0x5637=['TEXT','medium','ENUM','out','sequelize','exports','STRING'];(function(_0x504f15,_0x23a1ca){var _0x2a92c1=function(_0x298472){while(--_0x298472){_0x504f15['push'](_0x504f15['shift']());}};_0x2a92c1(++_0x23a1ca);}(_0x5637,0xd6));var _0x7563=function(_0x2e1f21,_0x871152){_0x2e1f21=_0x2e1f21-0x0;var _0xe456d2=_0x5637[_0x2e1f21];return _0xe456d2;};'use strict';var Sequelize=require(_0x7563('0x0'));module[_0x7563('0x1')]={'uniqueid':{'type':Sequelize[_0x7563('0x2')]},'body':{'type':Sequelize[_0x7563('0x3')](_0x7563('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x7563('0x5')]('in',_0x7563('0x6')),'defaultValue':_0x7563('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 788f006..4a3bee6 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 _0x1168=['rawAttributes','include','find','body','params','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','update','then','destroy','error','name','send','index','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','options','SquareMessage','includeAll','findAll','catch','show'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x1168,0x15e));var _0x8116=function(_0x115edd,_0x505f03){_0x115edd=_0x115edd-0x0;var _0x255f84=_0x1168[_0x115edd];return _0x255f84;};'use strict';var pdf=require(_0x8116('0x0'));var emlformat=require(_0x8116('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8116('0x2'));var rp=require('request-promise');var moment=require(_0x8116('0x3'));var BPromise=require(_0x8116('0x4'));var Mustache=require(_0x8116('0x5'));var util=require(_0x8116('0x6'));var path=require(_0x8116('0x7'));var sox=require(_0x8116('0x8'));var csv=require(_0x8116('0x9'));var ejs=require(_0x8116('0xa'));var fs=require('fs');var _=require(_0x8116('0xb'));var squel=require(_0x8116('0xc'));var crypto=require('crypto');var jsforce=require(_0x8116('0xd'));var deskjs=require(_0x8116('0xe'));var toCsv=require(_0x8116('0x9'));var querystring=require(_0x8116('0xf'));var Papa=require('papaparse');var Redis=require(_0x8116('0x10'));var authService=require(_0x8116('0x11'));var qs=require(_0x8116('0x12'));var hardwareService=require(_0x8116('0x13'));var logger=require(_0x8116('0x14'))(_0x8116('0x15'));var utils=require('../../config/utils');var config=require(_0x8116('0x16'));var db=require(_0x8116('0x17'))['db'];function respondWithStatusCode(_0x427de7,_0xad830c){_0xad830c=_0xad830c||0xcc;return function(_0x33b782){if(_0x33b782){return _0x427de7[_0x8116('0x18')](_0xad830c);}return _0x427de7[_0x8116('0x19')](_0xad830c)[_0x8116('0x1a')]();};}function respondWithResult(_0x335842,_0x37676f){_0x37676f=_0x37676f||0xc8;return function(_0x3bb692){if(_0x3bb692){return _0x335842[_0x8116('0x19')](_0x37676f)[_0x8116('0x1b')](_0x3bb692);}};}function respondWithFilteredResult(_0x4b8d3f,_0x526d75){return function(_0x4dbce3){if(_0x4dbce3){var _0x41b2e6=_0x4dbce3[_0x8116('0x1c')],_0x343890=_0x526d75[_0x8116('0x1d')],_0x101070=_0x526d75['offset']+_0x526d75[_0x8116('0x1e')],_0x5e4b29;if(_0x101070>=_0x41b2e6){_0x101070=_0x41b2e6;_0x5e4b29=0xc8;}else{_0x5e4b29=0xce;}_0x4b8d3f['status'](_0x5e4b29);return _0x4b8d3f[_0x8116('0x1f')]('Content-Range',_0x343890+'-'+_0x101070+'/'+_0x41b2e6)[_0x8116('0x1b')](_0x4dbce3);}return null;};}function patchUpdates(_0x5bda20){return function(_0x3b4745){try{jsonpatch['apply'](_0x3b4745,_0x5bda20,!![]);}catch(_0x990b3b){return BPromise['reject'](_0x990b3b);}return _0x3b4745['save']();};}function saveUpdates(_0x16bf45,_0x4da476){return function(_0x233a90){if(_0x233a90){return _0x233a90[_0x8116('0x20')](_0x16bf45)[_0x8116('0x21')](function(_0x33fa6b){return _0x33fa6b;});}return null;};}function removeEntity(_0x5d2bb9,_0x4f08fb){return function(_0x468d0d){if(_0x468d0d){return _0x468d0d[_0x8116('0x22')]()[_0x8116('0x21')](function(){_0x5d2bb9[_0x8116('0x19')](0xcc)[_0x8116('0x1a')]();});}};}function handleEntityNotFound(_0x303c01,_0x8abdb3){return function(_0x56a970){if(!_0x56a970){_0x303c01[_0x8116('0x18')](0x194);}return _0x56a970;};}function handleError(_0xed6c3d,_0x5e0ec1){_0x5e0ec1=_0x5e0ec1||0x1f4;return function(_0x2e122d){logger[_0x8116('0x23')](_0x2e122d['stack']);if(_0x2e122d['name']){delete _0x2e122d[_0x8116('0x24')];}_0xed6c3d[_0x8116('0x19')](_0x5e0ec1)[_0x8116('0x25')](_0x2e122d);};}exports[_0x8116('0x26')]=function(_0xa317f9,_0x8609f9){var _0x442b9a={},_0x33dbdf={},_0x1cae7c={'count':0x0,'rows':[]};var _0x38c00b=db['SquareMessage']['rawAttributes'];_0x33dbdf[_0x8116('0x27')]=_[_0x8116('0x28')](_0x38c00b);_0x33dbdf[_0x8116('0x29')]=_['keys'](_0xa317f9[_0x8116('0x29')]);_0x33dbdf['filters']=_[_0x8116('0x2a')](_0x33dbdf['model'],_0x33dbdf['query']);_0x442b9a[_0x8116('0x2b')]=_[_0x8116('0x2a')](_0x33dbdf['model'],qs[_0x8116('0x2c')](_0xa317f9[_0x8116('0x29')][_0x8116('0x2c')]));_0x442b9a[_0x8116('0x2b')]=_0x442b9a[_0x8116('0x2b')][_0x8116('0x2d')]?_0x442b9a[_0x8116('0x2b')]:_0x33dbdf['model'];if(!_0xa317f9[_0x8116('0x29')][_0x8116('0x2e')]('nolimit')){_0x442b9a[_0x8116('0x1e')]=qs['limit'](_0xa317f9[_0x8116('0x29')][_0x8116('0x1e')]);_0x442b9a[_0x8116('0x1d')]=qs[_0x8116('0x1d')](_0xa317f9[_0x8116('0x29')][_0x8116('0x1d')]);}_0x442b9a[_0x8116('0x2f')]=qs[_0x8116('0x30')](_0xa317f9['query'][_0x8116('0x30')]);_0x442b9a[_0x8116('0x31')]=qs[_0x8116('0x32')](_[_0x8116('0x33')](_0xa317f9[_0x8116('0x29')],_0x33dbdf[_0x8116('0x32')]));if(_0xa317f9[_0x8116('0x29')][_0x8116('0x34')]){_0x442b9a['where']=_[_0x8116('0x35')](_0x442b9a[_0x8116('0x31')],{'$or':_['map'](_0x38c00b,function(_0x974ca0){if(_0x974ca0[_0x8116('0x36')][_0x8116('0x37')]!==_0x8116('0x38')){var _0x49dfca={};_0x49dfca[_0x974ca0[_0x8116('0x39')]]={'$like':'%'+_0xa317f9['query'][_0x8116('0x34')]+'%'};return _0x49dfca;}})});}_0x442b9a=_[_0x8116('0x35')]({},_0x442b9a,_0xa317f9[_0x8116('0x3a')]);var _0x33a36b={'where':_0x442b9a[_0x8116('0x31')]};return db[_0x8116('0x3b')][_0x8116('0x1c')](_0x33a36b)[_0x8116('0x21')](function(_0x5523b3){_0x1cae7c[_0x8116('0x1c')]=_0x5523b3;if(_0xa317f9[_0x8116('0x29')][_0x8116('0x3c')]){_0x442b9a['include']=[{'all':!![]}];}return db[_0x8116('0x3b')][_0x8116('0x3d')](_0x442b9a);})[_0x8116('0x21')](function(_0x249000){_0x1cae7c['rows']=_0x249000;return _0x1cae7c;})[_0x8116('0x21')](respondWithFilteredResult(_0x8609f9,_0x442b9a))[_0x8116('0x3e')](handleError(_0x8609f9,null));};exports[_0x8116('0x3f')]=function(_0x227908,_0x29bbda){var _0x4d4070={'raw':!![],'where':{'id':_0x227908['params']['id']}},_0x1a6421={};_0x1a6421[_0x8116('0x27')]=_[_0x8116('0x28')](db[_0x8116('0x3b')][_0x8116('0x40')]);_0x1a6421['query']=_[_0x8116('0x28')](_0x227908[_0x8116('0x29')]);_0x1a6421['filters']=_[_0x8116('0x2a')](_0x1a6421[_0x8116('0x27')],_0x1a6421[_0x8116('0x29')]);_0x4d4070[_0x8116('0x2b')]=_['intersection'](_0x1a6421[_0x8116('0x27')],qs[_0x8116('0x2c')](_0x227908[_0x8116('0x29')][_0x8116('0x2c')]));_0x4d4070[_0x8116('0x2b')]=_0x4d4070['attributes']['length']?_0x4d4070['attributes']:_0x1a6421['model'];if(_0x227908[_0x8116('0x29')][_0x8116('0x3c')]){_0x4d4070[_0x8116('0x41')]=[{'all':!![]}];}_0x4d4070=_['merge']({},_0x4d4070,_0x227908['options']);return db['SquareMessage'][_0x8116('0x42')](_0x4d4070)[_0x8116('0x21')](handleEntityNotFound(_0x29bbda,null))[_0x8116('0x21')](respondWithResult(_0x29bbda,null))[_0x8116('0x3e')](handleError(_0x29bbda,null));};exports['create']=function(_0x4302cd,_0x11cb66){return db[_0x8116('0x3b')]['create'](_0x4302cd[_0x8116('0x43')],{})['then'](respondWithResult(_0x11cb66,0xc9))[_0x8116('0x3e')](handleError(_0x11cb66,null));};exports[_0x8116('0x20')]=function(_0x517815,_0x2fdf4c){if(_0x517815[_0x8116('0x43')]['id']){delete _0x517815[_0x8116('0x43')]['id'];}return db[_0x8116('0x3b')]['find']({'where':{'id':_0x517815[_0x8116('0x44')]['id']}})['then'](handleEntityNotFound(_0x2fdf4c,null))[_0x8116('0x21')](saveUpdates(_0x517815[_0x8116('0x43')],null))[_0x8116('0x21')](respondWithResult(_0x2fdf4c,null))[_0x8116('0x3e')](handleError(_0x2fdf4c,null));};exports['destroy']=function(_0x3211f8,_0x863ac9){return db[_0x8116('0x3b')]['find']({'where':{'id':_0x3211f8['params']['id']}})[_0x8116('0x21')](handleEntityNotFound(_0x863ac9,null))[_0x8116('0x21')](removeEntity(_0x863ac9,null))[_0x8116('0x3e')](handleError(_0x863ac9,null));}; \ No newline at end of file +var _0x1c3b=['util','path','sox','to-csv','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','offset','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','map','type','VIRTUAL','filter','merge','options','SquareMessage','count','includeAll','findAll','rows','show','catch','create','body','find','params','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache'];(function(_0x8afc7,_0x28761d){var _0x2270a8=function(_0x1d984a){while(--_0x1d984a){_0x8afc7['push'](_0x8afc7['shift']());}};_0x2270a8(++_0x28761d);}(_0x1c3b,0x106));var _0xb1c3=function(_0x55612f,_0x436f89){_0x55612f=_0x55612f-0x0;var _0x3efd74=_0x1c3b[_0x55612f];return _0x3efd74;};'use strict';var pdf=require(_0xb1c3('0x0'));var emlformat=require(_0xb1c3('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb1c3('0x2'));var rp=require(_0xb1c3('0x3'));var moment=require(_0xb1c3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb1c3('0x5'));var util=require(_0xb1c3('0x6'));var path=require(_0xb1c3('0x7'));var sox=require(_0xb1c3('0x8'));var csv=require(_0xb1c3('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb1c3('0xa'));var squel=require(_0xb1c3('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb1c3('0x9'));var querystring=require('querystring');var Papa=require(_0xb1c3('0xc'));var Redis=require(_0xb1c3('0xd'));var authService=require(_0xb1c3('0xe'));var qs=require(_0xb1c3('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb1c3('0x10'))(_0xb1c3('0x11'));var utils=require(_0xb1c3('0x12'));var config=require(_0xb1c3('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x525d08,_0x554811){_0x554811=_0x554811||0xcc;return function(_0x1d6837){if(_0x1d6837){return _0x525d08['sendStatus'](_0x554811);}return _0x525d08['status'](_0x554811)[_0xb1c3('0x14')]();};}function respondWithResult(_0x40c3dd,_0x2251f6){_0x2251f6=_0x2251f6||0xc8;return function(_0x32e18c){if(_0x32e18c){return _0x40c3dd[_0xb1c3('0x15')](_0x2251f6)[_0xb1c3('0x16')](_0x32e18c);}};}function respondWithFilteredResult(_0x45f058,_0x27d054){return function(_0x5389aa){if(_0x5389aa){var _0x478579=_0x5389aa['count'],_0x390ac4=_0x27d054['offset'],_0x573cd4=_0x27d054[_0xb1c3('0x17')]+_0x27d054['limit'],_0x2f73b9;if(_0x573cd4>=_0x478579){_0x573cd4=_0x478579;_0x2f73b9=0xc8;}else{_0x2f73b9=0xce;}_0x45f058[_0xb1c3('0x15')](_0x2f73b9);return _0x45f058['set'](_0xb1c3('0x18'),_0x390ac4+'-'+_0x573cd4+'/'+_0x478579)[_0xb1c3('0x16')](_0x5389aa);}return null;};}function patchUpdates(_0x23054a){return function(_0x5164b3){try{jsonpatch['apply'](_0x5164b3,_0x23054a,!![]);}catch(_0x5163de){return BPromise['reject'](_0x5163de);}return _0x5164b3[_0xb1c3('0x19')]();};}function saveUpdates(_0x562cdc,_0x222da9){return function(_0x4bd5e2){if(_0x4bd5e2){return _0x4bd5e2[_0xb1c3('0x1a')](_0x562cdc)[_0xb1c3('0x1b')](function(_0x5cdb87){return _0x5cdb87;});}return null;};}function removeEntity(_0x277b3e,_0x8c82f0){return function(_0x118e86){if(_0x118e86){return _0x118e86[_0xb1c3('0x1c')]()[_0xb1c3('0x1b')](function(){_0x277b3e[_0xb1c3('0x15')](0xcc)[_0xb1c3('0x14')]();});}};}function handleEntityNotFound(_0x4e2337,_0x17ae81){return function(_0x4b43c5){if(!_0x4b43c5){_0x4e2337[_0xb1c3('0x1d')](0x194);}return _0x4b43c5;};}function handleError(_0x1b9edf,_0x224a31){_0x224a31=_0x224a31||0x1f4;return function(_0x414979){logger[_0xb1c3('0x1e')](_0x414979[_0xb1c3('0x1f')]);if(_0x414979[_0xb1c3('0x20')]){delete _0x414979[_0xb1c3('0x20')];}_0x1b9edf['status'](_0x224a31)[_0xb1c3('0x21')](_0x414979);};}exports[_0xb1c3('0x22')]=function(_0x4aa9de,_0xc90ba8){var _0x11073d={},_0x40876b={},_0x11f532={'count':0x0,'rows':[]};var _0x11642e=db['SquareMessage'][_0xb1c3('0x23')];_0x40876b[_0xb1c3('0x24')]=_[_0xb1c3('0x25')](_0x11642e);_0x40876b['query']=_[_0xb1c3('0x25')](_0x4aa9de[_0xb1c3('0x26')]);_0x40876b[_0xb1c3('0x27')]=_[_0xb1c3('0x28')](_0x40876b[_0xb1c3('0x24')],_0x40876b[_0xb1c3('0x26')]);_0x11073d[_0xb1c3('0x29')]=_[_0xb1c3('0x28')](_0x40876b[_0xb1c3('0x24')],qs[_0xb1c3('0x2a')](_0x4aa9de[_0xb1c3('0x26')][_0xb1c3('0x2a')]));_0x11073d[_0xb1c3('0x29')]=_0x11073d[_0xb1c3('0x29')][_0xb1c3('0x2b')]?_0x11073d[_0xb1c3('0x29')]:_0x40876b[_0xb1c3('0x24')];if(!_0x4aa9de[_0xb1c3('0x26')][_0xb1c3('0x2c')](_0xb1c3('0x2d'))){_0x11073d[_0xb1c3('0x2e')]=qs['limit'](_0x4aa9de[_0xb1c3('0x26')][_0xb1c3('0x2e')]);_0x11073d['offset']=qs[_0xb1c3('0x17')](_0x4aa9de['query'][_0xb1c3('0x17')]);}_0x11073d[_0xb1c3('0x2f')]=qs[_0xb1c3('0x30')](_0x4aa9de[_0xb1c3('0x26')][_0xb1c3('0x30')]);_0x11073d[_0xb1c3('0x31')]=qs[_0xb1c3('0x27')](_['pick'](_0x4aa9de['query'],_0x40876b[_0xb1c3('0x27')]));if(_0x4aa9de['query']['filter']){_0x11073d['where']=_['merge'](_0x11073d[_0xb1c3('0x31')],{'$or':_[_0xb1c3('0x32')](_0x11642e,function(_0x1f1533){if(_0x1f1533[_0xb1c3('0x33')]['key']!==_0xb1c3('0x34')){var _0x40e02f={};_0x40e02f[_0x1f1533['field']]={'$like':'%'+_0x4aa9de[_0xb1c3('0x26')][_0xb1c3('0x35')]+'%'};return _0x40e02f;}})});}_0x11073d=_[_0xb1c3('0x36')]({},_0x11073d,_0x4aa9de[_0xb1c3('0x37')]);var _0x4b20b5={'where':_0x11073d[_0xb1c3('0x31')]};return db[_0xb1c3('0x38')][_0xb1c3('0x39')](_0x4b20b5)['then'](function(_0x4dedfa){_0x11f532[_0xb1c3('0x39')]=_0x4dedfa;if(_0x4aa9de['query'][_0xb1c3('0x3a')]){_0x11073d['include']=[{'all':!![]}];}return db[_0xb1c3('0x38')][_0xb1c3('0x3b')](_0x11073d);})[_0xb1c3('0x1b')](function(_0x485468){_0x11f532[_0xb1c3('0x3c')]=_0x485468;return _0x11f532;})['then'](respondWithFilteredResult(_0xc90ba8,_0x11073d))['catch'](handleError(_0xc90ba8,null));};exports[_0xb1c3('0x3d')]=function(_0x362068,_0x366ceb){var _0x777599={'raw':!![],'where':{'id':_0x362068['params']['id']}},_0xeeb202={};_0xeeb202['model']=_[_0xb1c3('0x25')](db[_0xb1c3('0x38')][_0xb1c3('0x23')]);_0xeeb202['query']=_[_0xb1c3('0x25')](_0x362068[_0xb1c3('0x26')]);_0xeeb202[_0xb1c3('0x27')]=_['intersection'](_0xeeb202['model'],_0xeeb202['query']);_0x777599[_0xb1c3('0x29')]=_[_0xb1c3('0x28')](_0xeeb202[_0xb1c3('0x24')],qs[_0xb1c3('0x2a')](_0x362068[_0xb1c3('0x26')][_0xb1c3('0x2a')]));_0x777599['attributes']=_0x777599[_0xb1c3('0x29')][_0xb1c3('0x2b')]?_0x777599[_0xb1c3('0x29')]:_0xeeb202[_0xb1c3('0x24')];if(_0x362068[_0xb1c3('0x26')][_0xb1c3('0x3a')]){_0x777599['include']=[{'all':!![]}];}_0x777599=_['merge']({},_0x777599,_0x362068['options']);return db['SquareMessage']['find'](_0x777599)[_0xb1c3('0x1b')](handleEntityNotFound(_0x366ceb,null))[_0xb1c3('0x1b')](respondWithResult(_0x366ceb,null))[_0xb1c3('0x3e')](handleError(_0x366ceb,null));};exports[_0xb1c3('0x3f')]=function(_0x32657a,_0x91e3a9){return db[_0xb1c3('0x38')]['create'](_0x32657a[_0xb1c3('0x40')],{})['then'](respondWithResult(_0x91e3a9,0xc9))[_0xb1c3('0x3e')](handleError(_0x91e3a9,null));};exports[_0xb1c3('0x1a')]=function(_0x4d5400,_0x26e6dd){if(_0x4d5400[_0xb1c3('0x40')]['id']){delete _0x4d5400[_0xb1c3('0x40')]['id'];}return db[_0xb1c3('0x38')][_0xb1c3('0x41')]({'where':{'id':_0x4d5400['params']['id']}})[_0xb1c3('0x1b')](handleEntityNotFound(_0x26e6dd,null))[_0xb1c3('0x1b')](saveUpdates(_0x4d5400[_0xb1c3('0x40')],null))[_0xb1c3('0x1b')](respondWithResult(_0x26e6dd,null))[_0xb1c3('0x3e')](handleError(_0x26e6dd,null));};exports['destroy']=function(_0x475038,_0x1fada2){return db['SquareMessage'][_0xb1c3('0x41')]({'where':{'id':_0x475038[_0xb1c3('0x42')]['id']}})[_0xb1c3('0x1b')](handleEntityNotFound(_0x1fada2,null))[_0xb1c3('0x1b')](removeEntity(_0x1fada2,null))['catch'](handleError(_0x1fada2,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 52e557d..f663104 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 _0x8913=['../../config/logger','api','rimraf','../../config/environment','SquareMessage','util'];(function(_0x5d7de1,_0x19aa35){var _0x4157c3=function(_0x4c8cb4){while(--_0x4c8cb4){_0x5d7de1['push'](_0x5d7de1['shift']());}};_0x4157c3(++_0x19aa35);}(_0x8913,0x1e5));var _0x3891=function(_0x1316ec,_0xa9e25e){_0x1316ec=_0x1316ec-0x0;var _0x1fedac=_0x8913[_0x1316ec];return _0x1fedac;};'use strict';var _=require('lodash');var util=require(_0x3891('0x0'));var logger=require(_0x3891('0x1'))(_0x3891('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(_0x3891('0x3'));var config=require(_0x3891('0x4'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x1bfc2d,_0x10d55d){return _0x1bfc2d['define'](_0x3891('0x5'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0a1=['bluebird','request-promise','path','rimraf','./squareMessage.attributes','define','square_messages','lodash','../../config/logger','moment'];(function(_0x52a6be,_0x5cafcb){var _0x47b0ad=function(_0x369c39){while(--_0x369c39){_0x52a6be['push'](_0x52a6be['shift']());}};_0x47b0ad(++_0x5cafcb);}(_0xf0a1,0xbb));var _0x1f0a=function(_0xac42fc,_0x2fa24f){_0xac42fc=_0xac42fc-0x0;var _0x17e633=_0xf0a1[_0xac42fc];return _0x17e633;};'use strict';var _=require(_0x1f0a('0x0'));var util=require('util');var logger=require(_0x1f0a('0x1'))('api');var moment=require(_0x1f0a('0x2'));var BPromise=require(_0x1f0a('0x3'));var rp=require(_0x1f0a('0x4'));var fs=require('fs');var path=require(_0x1f0a('0x5'));var rimraf=require(_0x1f0a('0x6'));var config=require('../../config/environment');var attributes=require(_0x1f0a('0x7'));module['exports']=function(_0x3628d7,_0x39ebe0){return _0x3628d7[_0x1f0a('0x8')]('SquareMessage',attributes,{'tableName':_0x1f0a('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 1f3ca6a..a13b181 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 _0x4279=['error','message','info','result','CreateSquareMessage','SquareMessage','create','body','options','raw','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x4279,0x8d));var _0x9427=function(_0x3a4e5e,_0x525b2d){_0x3a4e5e=_0x3a4e5e-0x0;var _0xf605f9=_0x4279[_0x3a4e5e];return _0xf605f9;};'use strict';var _=require('lodash');var util=require(_0x9427('0x0'));var moment=require(_0x9427('0x1'));var BPromise=require('bluebird');var rs=require(_0x9427('0x2'));var fs=require('fs');var Redis=require(_0x9427('0x3'));var db=require(_0x9427('0x4'))['db'];var utils=require(_0x9427('0x5'));var logger=require('../../config/logger')(_0x9427('0x6'));var config=require('../../config/environment');var jayson=require(_0x9427('0x7'));var client=jayson[_0x9427('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7fa417,_0x511208,_0x25ba0b){return new BPromise(function(_0x4d24f2,_0x322f34){return client['request'](_0x7fa417,_0x25ba0b)[_0x9427('0x9')](function(_0x4c729a){logger['info'](_0x9427('0xa'),_0x511208,_0x9427('0xb'));logger[_0x9427('0xc')](_0x9427('0xd'),_0x511208,_0x9427('0xb'),JSON[_0x9427('0xe')](_0x4c729a));if(_0x4c729a[_0x9427('0xf')]){if(_0x4c729a[_0x9427('0xf')]['code']===0x1f4){logger[_0x9427('0xf')](_0x9427('0xa'),_0x511208,_0x4c729a[_0x9427('0xf')][_0x9427('0x10')]);return _0x322f34(_0x4c729a[_0x9427('0xf')][_0x9427('0x10')]);}logger[_0x9427('0xf')](_0x9427('0xa'),_0x511208,_0x4c729a[_0x9427('0xf')][_0x9427('0x10')]);return _0x4d24f2(_0x4c729a[_0x9427('0xf')][_0x9427('0x10')]);}else{logger[_0x9427('0x11')]('SquareMessage,\x20%s,\x20%s',_0x511208,_0x9427('0xb'));_0x4d24f2(_0x4c729a[_0x9427('0x12')][_0x9427('0x10')]);}})['catch'](function(_0x542718){logger[_0x9427('0xf')]('SquareMessage,\x20%s,\x20%s',_0x511208,_0x542718);_0x322f34(_0x542718);});});}exports[_0x9427('0x13')]=function(_0x20de12){var _0x4aaea7=this;return new Promise(function(_0x5177e2,_0x296bd6){return db[_0x9427('0x14')][_0x9427('0x15')](_0x20de12[_0x9427('0x16')],{'raw':_0x20de12[_0x9427('0x17')]?_0x20de12[_0x9427('0x17')][_0x9427('0x18')]===undefined?!![]:![]:!![]})[_0x9427('0x9')](function(_0xa9da31){logger[_0x9427('0x11')](_0x9427('0x13'),_0x20de12);logger[_0x9427('0xc')](_0x9427('0x13'),_0x20de12,JSON[_0x9427('0xe')](_0xa9da31));_0x5177e2(_0xa9da31);})[_0x9427('0x19')](function(_0x3e8743){logger['error']('CreateSquareMessage',_0x3e8743[_0x9427('0x10')],_0x20de12);_0x296bd6(_0x4aaea7[_0x9427('0xf')](0x1f4,_0x3e8743[_0x9427('0x10')]));});});}; \ No newline at end of file +var _0xe451=['client','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateSquareMessage','body','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x303b9d,_0x55f94a){var _0x519f03=function(_0x384d7c){while(--_0x384d7c){_0x303b9d['push'](_0x303b9d['shift']());}};_0x519f03(++_0x55f94a);}(_0xe451,0xec));var _0x1e45=function(_0x479bb8,_0x7dd48e){_0x479bb8=_0x479bb8-0x0;var _0x2be2fd=_0xe451[_0x479bb8];return _0x2be2fd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1e45('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e45('0x1'))['db'];var utils=require(_0x1e45('0x2'));var logger=require(_0x1e45('0x3'))(_0x1e45('0x4'));var config=require('../../config/environment');var jayson=require(_0x1e45('0x5'));var client=jayson[_0x1e45('0x6')][_0x1e45('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x563405,_0xc62c6f,_0x31c118){return new BPromise(function(_0x4dd77f,_0x544710){return client[_0x1e45('0x8')](_0x563405,_0x31c118)[_0x1e45('0x9')](function(_0xde48d9){logger['info'](_0x1e45('0xa'),_0xc62c6f,_0x1e45('0xb'));logger[_0x1e45('0xc')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0xc62c6f,'request\x20sent',JSON[_0x1e45('0xd')](_0xde48d9));if(_0xde48d9[_0x1e45('0xe')]){if(_0xde48d9[_0x1e45('0xe')][_0x1e45('0xf')]===0x1f4){logger['error'](_0x1e45('0xa'),_0xc62c6f,_0xde48d9[_0x1e45('0xe')][_0x1e45('0x10')]);return _0x544710(_0xde48d9['error'][_0x1e45('0x10')]);}logger[_0x1e45('0xe')](_0x1e45('0xa'),_0xc62c6f,_0xde48d9[_0x1e45('0xe')]['message']);return _0x4dd77f(_0xde48d9[_0x1e45('0xe')]['message']);}else{logger[_0x1e45('0x11')](_0x1e45('0xa'),_0xc62c6f,'request\x20sent');_0x4dd77f(_0xde48d9[_0x1e45('0x12')][_0x1e45('0x10')]);}})[_0x1e45('0x13')](function(_0x1e5b73){logger[_0x1e45('0xe')](_0x1e45('0xa'),_0xc62c6f,_0x1e5b73);_0x544710(_0x1e5b73);});});}exports[_0x1e45('0x14')]=function(_0x2a6f47){var _0x2aa114=this;return new Promise(function(_0x5d24a7,_0x359dc6){return db['SquareMessage']['create'](_0x2a6f47[_0x1e45('0x15')],{'raw':_0x2a6f47['options']?_0x2a6f47['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x207335){logger[_0x1e45('0x11')]('CreateSquareMessage',_0x2a6f47);logger[_0x1e45('0xc')]('CreateSquareMessage',_0x2a6f47,JSON['stringify'](_0x207335));_0x5d24a7(_0x207335);})[_0x1e45('0x13')](function(_0x59aaa7){logger['error'](_0x1e45('0x14'),_0x59aaa7[_0x1e45('0x10')],_0x2a6f47);_0x359dc6(_0x2aa114['error'](0x1f4,_0x59aaa7[_0x1e45('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index f38c14f..3be9174 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 _0x1d12=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','post','put','update','destroy'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x1d12,0x79));var _0x21d1=function(_0x487358,_0x1cf22e){_0x487358=_0x487358-0x0;var _0x1af3d9=_0x1d12[_0x487358];return _0x1af3d9;};'use strict';var multer=require(_0x21d1('0x0'));var util=require(_0x21d1('0x1'));var path=require(_0x21d1('0x2'));var timeout=require(_0x21d1('0x3'));var express=require(_0x21d1('0x4'));var router=express['Router']();var auth=require(_0x21d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x21d1('0x6'));var controller=require(_0x21d1('0x7'));router[_0x21d1('0x8')]('/',auth[_0x21d1('0x9')](),controller[_0x21d1('0xa')]);router['get'](_0x21d1('0xb'),auth[_0x21d1('0x9')](),controller[_0x21d1('0xc')]);router[_0x21d1('0x8')](_0x21d1('0xd'),auth['isAuthenticated'](),timeout(_0x21d1('0xe')),controller['test']);router[_0x21d1('0xf')]('/',auth[_0x21d1('0x9')](),controller['create']);router[_0x21d1('0x10')](_0x21d1('0xb'),auth['isAuthenticated'](),controller[_0x21d1('0x11')]);router['delete'](_0x21d1('0xb'),auth[_0x21d1('0x9')](),controller[_0x21d1('0x12')]);module[_0x21d1('0x13')]=router; \ No newline at end of file +var _0x044a=['show','/:id/test','15s','test','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./squareOdbc.controller','get','isAuthenticated','index','/:id'];(function(_0x1e05c1,_0x3cffa3){var _0x15f1ca=function(_0x3a9594){while(--_0x3a9594){_0x1e05c1['push'](_0x1e05c1['shift']());}};_0x15f1ca(++_0x3cffa3);}(_0x044a,0x9c));var _0xa044=function(_0x2b96f3,_0x252b4f){_0x2b96f3=_0x2b96f3-0x0;var _0x7fbf40=_0x044a[_0x2b96f3];return _0x7fbf40;};'use strict';var multer=require(_0xa044('0x0'));var util=require(_0xa044('0x1'));var path=require(_0xa044('0x2'));var timeout=require(_0xa044('0x3'));var express=require(_0xa044('0x4'));var router=express[_0xa044('0x5')]();var auth=require(_0xa044('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa044('0x7'));router[_0xa044('0x8')]('/',auth[_0xa044('0x9')](),controller[_0xa044('0xa')]);router[_0xa044('0x8')](_0xa044('0xb'),auth[_0xa044('0x9')](),controller[_0xa044('0xc')]);router[_0xa044('0x8')](_0xa044('0xd'),auth[_0xa044('0x9')](),timeout(_0xa044('0xe')),controller[_0xa044('0xf')]);router['post']('/',auth[_0xa044('0x9')](),controller[_0xa044('0x10')]);router[_0xa044('0x11')](_0xa044('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xa044('0x12')](_0xa044('0xb'),auth[_0xa044('0x9')](),controller[_0xa044('0x13')]);module[_0xa044('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 97b0e77..c8211b8 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 _0x0e77=['exports','STRING','name'];(function(_0xae1364,_0x44863f){var _0x55104f=function(_0x83d4f1){while(--_0x83d4f1){_0xae1364['push'](_0xae1364['shift']());}};_0x55104f(++_0x44863f);}(_0x0e77,0x1d7));var _0x70e7=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x0e77[_0x599f41];return _0x2e4d58;};'use strict';var Sequelize=require('sequelize');module[_0x70e7('0x0')]={'name':{'type':Sequelize[_0x70e7('0x1')],'unique':_0x70e7('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x70e7('0x1')]},'description':{'type':Sequelize[_0x70e7('0x1')]}}; \ No newline at end of file +var _0xf3da=['exports','STRING','name','sequelize'];(function(_0x101125,_0x2c5953){var _0x40f6b0=function(_0x58a6fc){while(--_0x58a6fc){_0x101125['push'](_0x101125['shift']());}};_0x40f6b0(++_0x2c5953);}(_0xf3da,0x117));var _0xaf3d=function(_0xcec74b,_0x2c5177){_0xcec74b=_0xcec74b-0x0;var _0x15bbe1=_0xf3da[_0xcec74b];return _0x15bbe1;};'use strict';var Sequelize=require(_0xaf3d('0x0'));module[_0xaf3d('0x1')]={'name':{'type':Sequelize[_0xaf3d('0x2')],'unique':_0xaf3d('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xaf3d('0x2')]},'description':{'type':Sequelize[_0xaf3d('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 73debcc..b07b5b1 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 _0x8f59=['SquareOdbc','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','type','VIRTUAL','field','filter','options','count','includeAll','include','rows','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','update','params','dsn','odbc','openSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','offset','Content-Range','json','apply','save','then','destroy','get','ODBC','error','stack','name','send','index'];(function(_0x2bffb4,_0x4a9707){var _0x15cd8d=function(_0x53b1c2){while(--_0x53b1c2){_0x2bffb4['push'](_0x2bffb4['shift']());}};_0x15cd8d(++_0x4a9707);}(_0x8f59,0x11d));var _0x98f5=function(_0x4cce3d,_0x1e84ea){_0x4cce3d=_0x4cce3d-0x0;var _0x39b6df=_0x8f59[_0x4cce3d];return _0x39b6df;};'use strict';var pdf=require(_0x98f5('0x0'));var emlformat=require(_0x98f5('0x1'));var rimraf=require(_0x98f5('0x2'));var zipdir=require(_0x98f5('0x3'));var jsonpatch=require(_0x98f5('0x4'));var rp=require(_0x98f5('0x5'));var moment=require('moment');var BPromise=require(_0x98f5('0x6'));var Mustache=require(_0x98f5('0x7'));var util=require(_0x98f5('0x8'));var path=require(_0x98f5('0x9'));var sox=require('sox');var csv=require(_0x98f5('0xa'));var ejs=require(_0x98f5('0xb'));var fs=require('fs');var _=require(_0x98f5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x98f5('0xd'));var deskjs=require(_0x98f5('0xe'));var toCsv=require(_0x98f5('0xa'));var querystring=require('querystring');var Papa=require(_0x98f5('0xf'));var Redis=require(_0x98f5('0x10'));var authService=require(_0x98f5('0x11'));var qs=require(_0x98f5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x98f5('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x98f5('0x14'));var db=require(_0x98f5('0x15'))['db'];function respondWithStatusCode(_0x576e1e,_0x362b4b){_0x362b4b=_0x362b4b||0xcc;return function(_0x259abe){if(_0x259abe){return _0x576e1e[_0x98f5('0x16')](_0x362b4b);}return _0x576e1e[_0x98f5('0x17')](_0x362b4b)[_0x98f5('0x18')]();};}function respondWithResult(_0x105333,_0x5dcb5e){_0x5dcb5e=_0x5dcb5e||0xc8;return function(_0x24a7a9){if(_0x24a7a9){return _0x105333[_0x98f5('0x17')](_0x5dcb5e)['json'](_0x24a7a9);}};}function respondWithFilteredResult(_0x9df84,_0x3d6b5c){return function(_0xaa951a){if(_0xaa951a){var _0x4ae70d=_0xaa951a['count'],_0x2437e7=_0x3d6b5c[_0x98f5('0x19')],_0xc7a49b=_0x3d6b5c[_0x98f5('0x19')]+_0x3d6b5c['limit'],_0x113545;if(_0xc7a49b>=_0x4ae70d){_0xc7a49b=_0x4ae70d;_0x113545=0xc8;}else{_0x113545=0xce;}_0x9df84[_0x98f5('0x17')](_0x113545);return _0x9df84['set'](_0x98f5('0x1a'),_0x2437e7+'-'+_0xc7a49b+'/'+_0x4ae70d)[_0x98f5('0x1b')](_0xaa951a);}return null;};}function patchUpdates(_0x2291d5){return function(_0x11b6d4){try{jsonpatch[_0x98f5('0x1c')](_0x11b6d4,_0x2291d5,!![]);}catch(_0xa4477c){return BPromise['reject'](_0xa4477c);}return _0x11b6d4[_0x98f5('0x1d')]();};}function saveUpdates(_0x5500a2,_0xd1209d){return function(_0x191f23){if(_0x191f23){return _0x191f23['update'](_0x5500a2)[_0x98f5('0x1e')](function(_0x2933d1){return _0x2933d1;});}return null;};}function removeEntity(_0x331695,_0x10f3d6){return function(_0x3b2d9d){if(_0x3b2d9d){return _0x3b2d9d[_0x98f5('0x1f')]()[_0x98f5('0x1e')](function(){var _0x5ac2b7=_0x3b2d9d[_0x98f5('0x20')]({'plain':!![]});var _0x49ee4e=_0x98f5('0x21');return db['UserProfileResource'][_0x98f5('0x1f')]({'where':{'type':_0x49ee4e,'resourceId':_0x5ac2b7['id']}})[_0x98f5('0x1e')](function(){return _0x3b2d9d;});})[_0x98f5('0x1e')](function(){_0x331695[_0x98f5('0x17')](0xcc)[_0x98f5('0x18')]();});}};}function handleEntityNotFound(_0x18052d,_0x46dbd4){return function(_0x58d506){if(!_0x58d506){_0x18052d[_0x98f5('0x16')](0x194);}return _0x58d506;};}function handleError(_0x2b80a1,_0x5d7423){_0x5d7423=_0x5d7423||0x1f4;return function(_0x1a1c55){logger[_0x98f5('0x22')](_0x1a1c55[_0x98f5('0x23')]);if(_0x1a1c55[_0x98f5('0x24')]){delete _0x1a1c55[_0x98f5('0x24')];}_0x2b80a1[_0x98f5('0x17')](_0x5d7423)[_0x98f5('0x25')](_0x1a1c55);};}exports[_0x98f5('0x26')]=function(_0x576c4b,_0x4c10b8){var _0x428c85={},_0x71661e={},_0x18bb29={'count':0x0,'rows':[]};var _0x209d15=db[_0x98f5('0x27')][_0x98f5('0x28')];_0x71661e['model']=_[_0x98f5('0x29')](_0x209d15);_0x71661e[_0x98f5('0x2a')]=_[_0x98f5('0x29')](_0x576c4b[_0x98f5('0x2a')]);_0x71661e[_0x98f5('0x2b')]=_[_0x98f5('0x2c')](_0x71661e['model'],_0x71661e[_0x98f5('0x2a')]);_0x428c85[_0x98f5('0x2d')]=_[_0x98f5('0x2c')](_0x71661e[_0x98f5('0x2e')],qs['fields'](_0x576c4b[_0x98f5('0x2a')][_0x98f5('0x2f')]));_0x428c85[_0x98f5('0x2d')]=_0x428c85[_0x98f5('0x2d')][_0x98f5('0x30')]?_0x428c85[_0x98f5('0x2d')]:_0x71661e[_0x98f5('0x2e')];if(!_0x576c4b[_0x98f5('0x2a')][_0x98f5('0x31')](_0x98f5('0x32'))){_0x428c85[_0x98f5('0x33')]=qs[_0x98f5('0x33')](_0x576c4b[_0x98f5('0x2a')][_0x98f5('0x33')]);_0x428c85[_0x98f5('0x19')]=qs[_0x98f5('0x19')](_0x576c4b[_0x98f5('0x2a')][_0x98f5('0x19')]);}_0x428c85[_0x98f5('0x34')]=qs[_0x98f5('0x35')](_0x576c4b['query'][_0x98f5('0x35')]);_0x428c85['where']=qs['filters'](_[_0x98f5('0x36')](_0x576c4b[_0x98f5('0x2a')],_0x71661e[_0x98f5('0x2b')]));if(_0x576c4b[_0x98f5('0x2a')]['filter']){_0x428c85[_0x98f5('0x37')]=_[_0x98f5('0x38')](_0x428c85[_0x98f5('0x37')],{'$or':_['map'](_0x209d15,function(_0x17bfe2){if(_0x17bfe2[_0x98f5('0x39')]['key']!==_0x98f5('0x3a')){var _0x444b76={};_0x444b76[_0x17bfe2[_0x98f5('0x3b')]]={'$like':'%'+_0x576c4b['query'][_0x98f5('0x3c')]+'%'};return _0x444b76;}})});}_0x428c85=_[_0x98f5('0x38')]({},_0x428c85,_0x576c4b[_0x98f5('0x3d')]);var _0x544fbf={'where':_0x428c85[_0x98f5('0x37')]};return db['SquareOdbc']['count'](_0x544fbf)[_0x98f5('0x1e')](function(_0x14faf2){_0x18bb29[_0x98f5('0x3e')]=_0x14faf2;if(_0x576c4b[_0x98f5('0x2a')][_0x98f5('0x3f')]){_0x428c85[_0x98f5('0x40')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x428c85);})[_0x98f5('0x1e')](function(_0xd74af2){_0x18bb29[_0x98f5('0x41')]=_0xd74af2;return _0x18bb29;})[_0x98f5('0x1e')](respondWithFilteredResult(_0x4c10b8,_0x428c85))['catch'](handleError(_0x4c10b8,null));};exports['show']=function(_0x2dafcd,_0x469d2c){var _0xb31984={'raw':!![],'where':{'id':_0x2dafcd['params']['id']}},_0x110aa7={};_0x110aa7['model']=_[_0x98f5('0x29')](db[_0x98f5('0x27')][_0x98f5('0x28')]);_0x110aa7['query']=_[_0x98f5('0x29')](_0x2dafcd['query']);_0x110aa7[_0x98f5('0x2b')]=_['intersection'](_0x110aa7[_0x98f5('0x2e')],_0x110aa7[_0x98f5('0x2a')]);_0xb31984[_0x98f5('0x2d')]=_['intersection'](_0x110aa7[_0x98f5('0x2e')],qs[_0x98f5('0x2f')](_0x2dafcd['query'][_0x98f5('0x2f')]));_0xb31984[_0x98f5('0x2d')]=_0xb31984['attributes'][_0x98f5('0x30')]?_0xb31984['attributes']:_0x110aa7[_0x98f5('0x2e')];if(_0x2dafcd[_0x98f5('0x2a')]['includeAll']){_0xb31984['include']=[{'all':!![]}];}_0xb31984=_['merge']({},_0xb31984,_0x2dafcd['options']);return db[_0x98f5('0x27')]['find'](_0xb31984)[_0x98f5('0x1e')](handleEntityNotFound(_0x469d2c,null))[_0x98f5('0x1e')](respondWithResult(_0x469d2c,null))[_0x98f5('0x42')](handleError(_0x469d2c,null));};exports[_0x98f5('0x43')]=function(_0x160896,_0x3ecae9){return db['SquareOdbc'][_0x98f5('0x43')](_0x160896[_0x98f5('0x44')],{})[_0x98f5('0x1e')](function(_0x2c3cef){var _0x178867=_0x160896[_0x98f5('0x45')]['get']({'plain':!![]});if(!_0x178867)throw new Error(_0x98f5('0x46'));if(_0x178867[_0x98f5('0x47')]===_0x98f5('0x45')){var _0x1d4b3b=_0x2c3cef['get']({'plain':!![]});var _0x2c5f96=_0x98f5('0x21');return db[_0x98f5('0x48')][_0x98f5('0x49')]({'where':{'name':_0x2c5f96,'userProfileId':_0x178867[_0x98f5('0x4a')]},'raw':!![]})['then'](function(_0x8d7ebd){if(_0x8d7ebd&&_0x8d7ebd[_0x98f5('0x4b')]===0x0){return db['UserProfileResource'][_0x98f5('0x43')]({'name':_0x1d4b3b['name'],'resourceId':_0x1d4b3b['id'],'type':_0x8d7ebd[_0x98f5('0x24')],'sectionId':_0x8d7ebd['id']},{})['then'](function(){return _0x2c3cef;});}else{return _0x2c3cef;}})[_0x98f5('0x42')](function(_0x3b3c8e){logger[_0x98f5('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b3c8e);throw _0x3b3c8e;});}return _0x2c3cef;})[_0x98f5('0x1e')](respondWithResult(_0x3ecae9,0xc9))[_0x98f5('0x42')](handleError(_0x3ecae9,null));};exports[_0x98f5('0x4c')]=function(_0x2953e3,_0xde3d2d){if(_0x2953e3[_0x98f5('0x44')]['id']){delete _0x2953e3[_0x98f5('0x44')]['id'];}return db[_0x98f5('0x27')][_0x98f5('0x49')]({'where':{'id':_0x2953e3[_0x98f5('0x4d')]['id']}})[_0x98f5('0x1e')](handleEntityNotFound(_0xde3d2d,null))[_0x98f5('0x1e')](saveUpdates(_0x2953e3[_0x98f5('0x44')],null))[_0x98f5('0x1e')](respondWithResult(_0xde3d2d,null))[_0x98f5('0x42')](handleError(_0xde3d2d,null));};exports[_0x98f5('0x1f')]=function(_0x23e955,_0x5c565d){return db[_0x98f5('0x27')][_0x98f5('0x49')]({'where':{'id':_0x23e955[_0x98f5('0x4d')]['id']}})[_0x98f5('0x1e')](handleEntityNotFound(_0x5c565d,null))[_0x98f5('0x1e')](removeEntity(_0x5c565d,null))[_0x98f5('0x42')](handleError(_0x5c565d,null));};exports['test']=function(_0x4f5656,_0x4e4ede,_0xdba74){var _0x465530;return db[_0x98f5('0x27')][_0x98f5('0x49')]({'where':{'id':_0x4f5656['params']['id']},'attributes':['id',_0x98f5('0x4e')]})['then'](handleEntityNotFound(_0x4e4ede,null))[_0x98f5('0x1e')](function(_0x583be6){if(_0x583be6){var _0x485774=require(_0x98f5('0x4f'))();_0x485774[_0x98f5('0x50')](_0x583be6[_0x98f5('0x4e')]);_0x485774['closeSync']();return _0x583be6;}})['then'](respondWithResult(_0x4e4ede,null))[_0x98f5('0x42')](handleError(_0x4e4ede,null));}; \ No newline at end of file +var _0x94df=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','save','then','get','ODBC','destroy','error','stack','name','rawAttributes','keys','query','intersection','model','attributes','nolimit','limit','order','sort','filters','filter','merge','where','map','key','VIRTUAL','field','options','includeAll','include','SquareOdbc','findAll','rows','catch','params','fields','length','create','body','user','find','userProfileId','autoAssociation','UserProfileResource','update','test','dsn','openSync','closeSync','html-pdf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94df,0xa3));var _0xf94d=function(_0x561a41,_0x583188){_0x561a41=_0x561a41-0x0;var _0x3ecc82=_0x94df[_0x561a41];return _0x3ecc82;};'use strict';var pdf=require(_0xf94d('0x0'));var emlformat=require(_0xf94d('0x1'));var rimraf=require(_0xf94d('0x2'));var zipdir=require(_0xf94d('0x3'));var jsonpatch=require(_0xf94d('0x4'));var rp=require(_0xf94d('0x5'));var moment=require('moment');var BPromise=require(_0xf94d('0x6'));var Mustache=require(_0xf94d('0x7'));var util=require(_0xf94d('0x8'));var path=require(_0xf94d('0x9'));var sox=require(_0xf94d('0xa'));var csv=require(_0xf94d('0xb'));var ejs=require(_0xf94d('0xc'));var fs=require('fs');var _=require(_0xf94d('0xd'));var squel=require(_0xf94d('0xe'));var crypto=require(_0xf94d('0xf'));var jsforce=require(_0xf94d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xf94d('0xb'));var querystring=require(_0xf94d('0x11'));var Papa=require(_0xf94d('0x12'));var Redis=require(_0xf94d('0x13'));var authService=require(_0xf94d('0x14'));var qs=require(_0xf94d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf94d('0x16'))(_0xf94d('0x17'));var utils=require(_0xf94d('0x18'));var config=require(_0xf94d('0x19'));var db=require(_0xf94d('0x1a'))['db'];function respondWithStatusCode(_0x509bf2,_0x580644){_0x580644=_0x580644||0xcc;return function(_0x194023){if(_0x194023){return _0x509bf2[_0xf94d('0x1b')](_0x580644);}return _0x509bf2[_0xf94d('0x1c')](_0x580644)[_0xf94d('0x1d')]();};}function respondWithResult(_0x186034,_0x381a5f){_0x381a5f=_0x381a5f||0xc8;return function(_0x509c69){if(_0x509c69){return _0x186034[_0xf94d('0x1c')](_0x381a5f)[_0xf94d('0x1e')](_0x509c69);}};}function respondWithFilteredResult(_0x17234f,_0x305c5f){return function(_0xcc1a3a){if(_0xcc1a3a){var _0x451065=_0xcc1a3a[_0xf94d('0x1f')],_0x14020b=_0x305c5f['offset'],_0x2c557b=_0x305c5f[_0xf94d('0x20')]+_0x305c5f['limit'],_0x4fa8bf;if(_0x2c557b>=_0x451065){_0x2c557b=_0x451065;_0x4fa8bf=0xc8;}else{_0x4fa8bf=0xce;}_0x17234f[_0xf94d('0x1c')](_0x4fa8bf);return _0x17234f['set'](_0xf94d('0x21'),_0x14020b+'-'+_0x2c557b+'/'+_0x451065)[_0xf94d('0x1e')](_0xcc1a3a);}return null;};}function patchUpdates(_0x510eef){return function(_0x349de5){try{jsonpatch['apply'](_0x349de5,_0x510eef,!![]);}catch(_0xfea3ae){return BPromise['reject'](_0xfea3ae);}return _0x349de5[_0xf94d('0x22')]();};}function saveUpdates(_0x3d9c88,_0x45adeb){return function(_0x2ede5b){if(_0x2ede5b){return _0x2ede5b['update'](_0x3d9c88)[_0xf94d('0x23')](function(_0x5f2112){return _0x5f2112;});}return null;};}function removeEntity(_0x39f75d,_0x1fa6bf){return function(_0x418f99){if(_0x418f99){return _0x418f99['destroy']()[_0xf94d('0x23')](function(){var _0x8f50=_0x418f99[_0xf94d('0x24')]({'plain':!![]});var _0x3c2aa=_0xf94d('0x25');return db['UserProfileResource'][_0xf94d('0x26')]({'where':{'type':_0x3c2aa,'resourceId':_0x8f50['id']}})['then'](function(){return _0x418f99;});})[_0xf94d('0x23')](function(){_0x39f75d[_0xf94d('0x1c')](0xcc)[_0xf94d('0x1d')]();});}};}function handleEntityNotFound(_0x6a2879,_0x997b6c){return function(_0x1c4bdf){if(!_0x1c4bdf){_0x6a2879[_0xf94d('0x1b')](0x194);}return _0x1c4bdf;};}function handleError(_0x4152f0,_0x3c9fe3){_0x3c9fe3=_0x3c9fe3||0x1f4;return function(_0x13c229){logger[_0xf94d('0x27')](_0x13c229[_0xf94d('0x28')]);if(_0x13c229[_0xf94d('0x29')]){delete _0x13c229['name'];}_0x4152f0['status'](_0x3c9fe3)['send'](_0x13c229);};}exports['index']=function(_0xbb4a6,_0x1e8242){var _0x56ab8c={},_0x167585={},_0x1c123b={'count':0x0,'rows':[]};var _0x229ff7=db['SquareOdbc'][_0xf94d('0x2a')];_0x167585['model']=_[_0xf94d('0x2b')](_0x229ff7);_0x167585[_0xf94d('0x2c')]=_['keys'](_0xbb4a6[_0xf94d('0x2c')]);_0x167585['filters']=_[_0xf94d('0x2d')](_0x167585['model'],_0x167585['query']);_0x56ab8c['attributes']=_[_0xf94d('0x2d')](_0x167585[_0xf94d('0x2e')],qs['fields'](_0xbb4a6[_0xf94d('0x2c')]['fields']));_0x56ab8c[_0xf94d('0x2f')]=_0x56ab8c[_0xf94d('0x2f')]['length']?_0x56ab8c[_0xf94d('0x2f')]:_0x167585['model'];if(!_0xbb4a6[_0xf94d('0x2c')]['hasOwnProperty'](_0xf94d('0x30'))){_0x56ab8c['limit']=qs[_0xf94d('0x31')](_0xbb4a6[_0xf94d('0x2c')][_0xf94d('0x31')]);_0x56ab8c[_0xf94d('0x20')]=qs['offset'](_0xbb4a6['query']['offset']);}_0x56ab8c[_0xf94d('0x32')]=qs[_0xf94d('0x33')](_0xbb4a6[_0xf94d('0x2c')][_0xf94d('0x33')]);_0x56ab8c['where']=qs['filters'](_['pick'](_0xbb4a6[_0xf94d('0x2c')],_0x167585[_0xf94d('0x34')]));if(_0xbb4a6[_0xf94d('0x2c')][_0xf94d('0x35')]){_0x56ab8c['where']=_[_0xf94d('0x36')](_0x56ab8c[_0xf94d('0x37')],{'$or':_[_0xf94d('0x38')](_0x229ff7,function(_0xea51ad){if(_0xea51ad['type'][_0xf94d('0x39')]!==_0xf94d('0x3a')){var _0x11e155={};_0x11e155[_0xea51ad[_0xf94d('0x3b')]]={'$like':'%'+_0xbb4a6[_0xf94d('0x2c')][_0xf94d('0x35')]+'%'};return _0x11e155;}})});}_0x56ab8c=_[_0xf94d('0x36')]({},_0x56ab8c,_0xbb4a6[_0xf94d('0x3c')]);var _0xe9510e={'where':_0x56ab8c[_0xf94d('0x37')]};return db['SquareOdbc']['count'](_0xe9510e)[_0xf94d('0x23')](function(_0x49d203){_0x1c123b[_0xf94d('0x1f')]=_0x49d203;if(_0xbb4a6['query'][_0xf94d('0x3d')]){_0x56ab8c[_0xf94d('0x3e')]=[{'all':!![]}];}return db[_0xf94d('0x3f')][_0xf94d('0x40')](_0x56ab8c);})[_0xf94d('0x23')](function(_0x5e2a20){_0x1c123b[_0xf94d('0x41')]=_0x5e2a20;return _0x1c123b;})['then'](respondWithFilteredResult(_0x1e8242,_0x56ab8c))[_0xf94d('0x42')](handleError(_0x1e8242,null));};exports['show']=function(_0x41cb3e,_0x40af20){var _0x41db12={'raw':!![],'where':{'id':_0x41cb3e[_0xf94d('0x43')]['id']}},_0x36b24e={};_0x36b24e[_0xf94d('0x2e')]=_[_0xf94d('0x2b')](db['SquareOdbc'][_0xf94d('0x2a')]);_0x36b24e[_0xf94d('0x2c')]=_[_0xf94d('0x2b')](_0x41cb3e['query']);_0x36b24e[_0xf94d('0x34')]=_[_0xf94d('0x2d')](_0x36b24e[_0xf94d('0x2e')],_0x36b24e[_0xf94d('0x2c')]);_0x41db12[_0xf94d('0x2f')]=_[_0xf94d('0x2d')](_0x36b24e[_0xf94d('0x2e')],qs['fields'](_0x41cb3e[_0xf94d('0x2c')][_0xf94d('0x44')]));_0x41db12[_0xf94d('0x2f')]=_0x41db12[_0xf94d('0x2f')][_0xf94d('0x45')]?_0x41db12[_0xf94d('0x2f')]:_0x36b24e['model'];if(_0x41cb3e['query'][_0xf94d('0x3d')]){_0x41db12[_0xf94d('0x3e')]=[{'all':!![]}];}_0x41db12=_[_0xf94d('0x36')]({},_0x41db12,_0x41cb3e[_0xf94d('0x3c')]);return db[_0xf94d('0x3f')]['find'](_0x41db12)[_0xf94d('0x23')](handleEntityNotFound(_0x40af20,null))['then'](respondWithResult(_0x40af20,null))[_0xf94d('0x42')](handleError(_0x40af20,null));};exports[_0xf94d('0x46')]=function(_0x2c8d47,_0x3e6f7a){return db[_0xf94d('0x3f')]['create'](_0x2c8d47[_0xf94d('0x47')],{})[_0xf94d('0x23')](function(_0x676410){var _0x3d0df2=_0x2c8d47['user'][_0xf94d('0x24')]({'plain':!![]});if(!_0x3d0df2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d0df2['role']===_0xf94d('0x48')){var _0x3ee368=_0x676410[_0xf94d('0x24')]({'plain':!![]});var _0x5557ee=_0xf94d('0x25');return db['UserProfileSection'][_0xf94d('0x49')]({'where':{'name':_0x5557ee,'userProfileId':_0x3d0df2[_0xf94d('0x4a')]},'raw':!![]})[_0xf94d('0x23')](function(_0x42ec76){if(_0x42ec76&&_0x42ec76[_0xf94d('0x4b')]===0x0){return db[_0xf94d('0x4c')]['create']({'name':_0x3ee368[_0xf94d('0x29')],'resourceId':_0x3ee368['id'],'type':_0x42ec76[_0xf94d('0x29')],'sectionId':_0x42ec76['id']},{})[_0xf94d('0x23')](function(){return _0x676410;});}else{return _0x676410;}})[_0xf94d('0x42')](function(_0x58e04b){logger[_0xf94d('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58e04b);throw _0x58e04b;});}return _0x676410;})[_0xf94d('0x23')](respondWithResult(_0x3e6f7a,0xc9))['catch'](handleError(_0x3e6f7a,null));};exports[_0xf94d('0x4d')]=function(_0xdcee74,_0x1bfc66){if(_0xdcee74[_0xf94d('0x47')]['id']){delete _0xdcee74[_0xf94d('0x47')]['id'];}return db['SquareOdbc']['find']({'where':{'id':_0xdcee74[_0xf94d('0x43')]['id']}})[_0xf94d('0x23')](handleEntityNotFound(_0x1bfc66,null))[_0xf94d('0x23')](saveUpdates(_0xdcee74[_0xf94d('0x47')],null))[_0xf94d('0x23')](respondWithResult(_0x1bfc66,null))[_0xf94d('0x42')](handleError(_0x1bfc66,null));};exports['destroy']=function(_0x8b9209,_0x17471f){return db[_0xf94d('0x3f')][_0xf94d('0x49')]({'where':{'id':_0x8b9209['params']['id']}})['then'](handleEntityNotFound(_0x17471f,null))[_0xf94d('0x23')](removeEntity(_0x17471f,null))[_0xf94d('0x42')](handleError(_0x17471f,null));};exports[_0xf94d('0x4e')]=function(_0x5ca1c6,_0x33016f,_0x22e0ae){var _0xf716d1;return db[_0xf94d('0x3f')][_0xf94d('0x49')]({'where':{'id':_0x5ca1c6[_0xf94d('0x43')]['id']},'attributes':['id',_0xf94d('0x4f')]})[_0xf94d('0x23')](handleEntityNotFound(_0x33016f,null))[_0xf94d('0x23')](function(_0x4daf70){if(_0x4daf70){var _0x138089=require('odbc')();_0x138089[_0xf94d('0x50')](_0x4daf70['dsn']);_0x138089[_0xf94d('0x51')]();return _0x4daf70;}})[_0xf94d('0x23')](respondWithResult(_0x33016f,null))[_0xf94d('0x42')](handleError(_0x33016f,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 9c2c082..4381c2b 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 _0x92f0=['api','moment','bluebird','request-promise','rimraf','exports','SquareOdbc','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x92f0,0xa0));var _0x092f=function(_0x1bc445,_0x2d6fe0){_0x1bc445=_0x1bc445-0x0;var _0x589e6b=_0x92f0[_0x1bc445];return _0x589e6b;};'use strict';var _=require(_0x092f('0x0'));var util=require(_0x092f('0x1'));var logger=require('../../config/logger')(_0x092f('0x2'));var moment=require(_0x092f('0x3'));var BPromise=require(_0x092f('0x4'));var rp=require(_0x092f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x092f('0x6'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0x092f('0x7')]=function(_0x181a89,_0x39e68d){return _0x181a89['define'](_0x092f('0x8'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xecc8=['square_odbc','moment','request-promise','path','rimraf','./squareOdbc.attributes','exports','define'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xecc8,0x111));var _0x8ecc=function(_0xd6c67d,_0x41e505){_0xd6c67d=_0xd6c67d-0x0;var _0x32af6c=_0xecc8[_0xd6c67d];return _0x32af6c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8ecc('0x0'));var BPromise=require('bluebird');var rp=require(_0x8ecc('0x1'));var fs=require('fs');var path=require(_0x8ecc('0x2'));var rimraf=require(_0x8ecc('0x3'));var config=require('../../config/environment');var attributes=require(_0x8ecc('0x4'));module[_0x8ecc('0x5')]=function(_0x477e22,_0x2ae669){return _0x477e22[_0x8ecc('0x6')]('SquareOdbc',attributes,{'tableName':_0x8ecc('0x7'),'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 ef8b71a..83068a1 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 _0x7217=['where','attributes','map','include','model','ShowSquareOdbc','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareOdbc','find','options','raw'];(function(_0x518fd5,_0x5c7a2b){var _0x392c2d=function(_0x59cbe8){while(--_0x59cbe8){_0x518fd5['push'](_0x518fd5['shift']());}};_0x392c2d(++_0x5c7a2b);}(_0x7217,0x19e));var _0x7721=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x7217[_0x32d457];return _0x338386;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowSquareOdbc']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowSquareOdbc',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file +var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x1298ed,_0x39ba63){var _0x56b532=function(_0x46e1eb){while(--_0x46e1eb){_0x1298ed['push'](_0x1298ed['shift']());}};_0x56b532(++_0x39ba63);}(_0xe14b,0x93));var _0xbe14=function(_0x221f06,_0x59d0ea){_0x221f06=_0x221f06-0x0;var _0x546d4e=_0xe14b[_0x221f06];return _0x546d4e;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index c342225..bdc3f07 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 _0xd4f4=['/:id','isAuthenticated','show','/:id/users','getUsers','post','create','addUsers','put','update','destroy','delete','removeUsers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get'];(function(_0x4d183d,_0x123de0){var _0x431236=function(_0x35642b){while(--_0x35642b){_0x4d183d['push'](_0x4d183d['shift']());}};_0x431236(++_0x123de0);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x191710,_0x381497){_0x191710=_0x191710-0x0;var _0x17ebce=_0xd4f4[_0x191710];return _0x17ebce;};'use strict';var multer=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var path=require(_0x4d4f('0x2'));var timeout=require(_0x4d4f('0x3'));var express=require(_0x4d4f('0x4'));var router=express[_0x4d4f('0x5')]();var auth=require(_0x4d4f('0x6'));var interaction=require(_0x4d4f('0x7'));var config=require(_0x4d4f('0x8'));var controller=require(_0x4d4f('0x9'));router[_0x4d4f('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4d4f('0xb'),auth[_0x4d4f('0xc')](),controller[_0x4d4f('0xd')]);router[_0x4d4f('0xa')](_0x4d4f('0xe'),auth[_0x4d4f('0xc')](),controller[_0x4d4f('0xf')]);router[_0x4d4f('0x10')]('/',auth[_0x4d4f('0xc')](),controller[_0x4d4f('0x11')]);router[_0x4d4f('0x10')](_0x4d4f('0xe'),auth[_0x4d4f('0xc')](),controller[_0x4d4f('0x12')]);router[_0x4d4f('0x13')](_0x4d4f('0xb'),auth[_0x4d4f('0xc')](),controller[_0x4d4f('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4d4f('0x15')]);router[_0x4d4f('0x16')]('/:id/users',auth[_0x4d4f('0xc')](),controller[_0x4d4f('0x17')]);module[_0x4d4f('0x18')]=router; \ No newline at end of file +var _0x13f6=['express','Router','../../components/auth/service','../../config/environment','./squareProject.controller','get','index','/:id/users','isAuthenticated','getUsers','post','create','addUsers','put','/:id','update','delete','removeUsers','exports','multer','util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x13f6,0x124));var _0x613f=function(_0x1236ce,_0x5afdf0){_0x1236ce=_0x1236ce-0x0;var _0xcd493=_0x13f6[_0x1236ce];return _0xcd493;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613f('0x2'));var router=express[_0x613f('0x3')]();var auth=require(_0x613f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x613f('0x5'));var controller=require(_0x613f('0x6'));router[_0x613f('0x7')]('/',auth['isAuthenticated'](),controller[_0x613f('0x8')]);router[_0x613f('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x613f('0x9'),auth[_0x613f('0xa')](),controller[_0x613f('0xb')]);router[_0x613f('0xc')]('/',auth['isAuthenticated'](),controller[_0x613f('0xd')]);router[_0x613f('0xc')](_0x613f('0x9'),auth['isAuthenticated'](),controller[_0x613f('0xe')]);router[_0x613f('0xf')](_0x613f('0x10'),auth['isAuthenticated'](),controller[_0x613f('0x11')]);router[_0x613f('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x613f('0x12')](_0x613f('0x9'),auth[_0x613f('0xa')](),controller[_0x613f('0x13')]);module[_0x613f('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 39a13f1..f4ef6d6 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 _0x7a89=['toString','utf8','production','sequelize','exports','STRING','name','BLOB','long','getDataValue','preproduction'];(function(_0x2591a9,_0x46863a){var _0x2aba17=function(_0xd28b13){while(--_0xd28b13){_0x2591a9['push'](_0x2591a9['shift']());}};_0x2aba17(++_0x46863a);}(_0x7a89,0xa8));var _0x97a8=function(_0x4d84a7,_0x32b3e0){_0x4d84a7=_0x4d84a7-0x0;var _0x1f02a6=_0x7a89[_0x4d84a7];return _0x1f02a6;};'use strict';var Sequelize=require(_0x97a8('0x0'));module[_0x97a8('0x1')]={'name':{'type':Sequelize[_0x97a8('0x2')],'unique':_0x97a8('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x97a8('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x97a8('0x4')](_0x97a8('0x5')),'get':function(){if(this[_0x97a8('0x6')](_0x97a8('0x7'))){return this['getDataValue']('preproduction')[_0x97a8('0x8')](_0x97a8('0x9'));}}},'production':{'type':Sequelize[_0x97a8('0x4')](_0x97a8('0x5')),'get':function(){if(this[_0x97a8('0x6')](_0x97a8('0xa'))){return this[_0x97a8('0x6')](_0x97a8('0xa'))[_0x97a8('0x8')](_0x97a8('0x9'));}}}}; \ No newline at end of file +var _0x1094=['utf8','production','sequelize','exports','name','TEXT','BLOB','long','preproduction','getDataValue','toString'];(function(_0x394123,_0x59311a){var _0x1c50ec=function(_0x475174){while(--_0x475174){_0x394123['push'](_0x394123['shift']());}};_0x1c50ec(++_0x59311a);}(_0x1094,0xa7));var _0x4109=function(_0x113e32,_0x5339f0){_0x113e32=_0x113e32-0x0;var _0x4ff939=_0x1094[_0x113e32];return _0x4ff939;};'use strict';var Sequelize=require(_0x4109('0x0'));module[_0x4109('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4109('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x4109('0x3')]},'preproduction':{'type':Sequelize[_0x4109('0x4')](_0x4109('0x5')),'get':function(){if(this['getDataValue'](_0x4109('0x6'))){return this[_0x4109('0x7')](_0x4109('0x6'))[_0x4109('0x8')](_0x4109('0x9'));}}},'production':{'type':Sequelize['BLOB'](_0x4109('0x5')),'get':function(){if(this['getDataValue'](_0x4109('0xa'))){return this['getDataValue'](_0x4109('0xa'))[_0x4109('0x8')](_0x4109('0x9'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index b8e3eb2..a58a5ae 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 _0xc3a0=['request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','field','SquareProject','count','includeAll','findAll','rows','catch','params','rawAttributes','intersection','include','merge','options','find','create','user','role','SquareProjects','UserProfileSection','autoAssociation','body','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','findOne','order','map','getUsers','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x30099e,_0x1ee4b2){var _0x474f63=function(_0x26f35a){while(--_0x26f35a){_0x30099e['push'](_0x30099e['shift']());}};_0x474f63(++_0x1ee4b2);}(_0xc3a0,0x1d6));var _0x0c3a=function(_0x211632,_0x378e2e){_0x211632=_0x211632-0x0;var _0x5a1da1=_0xc3a0[_0x211632];return _0x5a1da1;};'use strict';var pdf=require(_0x0c3a('0x0'));var emlformat=require(_0x0c3a('0x1'));var rimraf=require(_0x0c3a('0x2'));var zipdir=require(_0x0c3a('0x3'));var jsonpatch=require(_0x0c3a('0x4'));var rp=require(_0x0c3a('0x5'));var moment=require(_0x0c3a('0x6'));var BPromise=require(_0x0c3a('0x7'));var Mustache=require(_0x0c3a('0x8'));var util=require('util');var path=require(_0x0c3a('0x9'));var sox=require(_0x0c3a('0xa'));var csv=require(_0x0c3a('0xb'));var ejs=require(_0x0c3a('0xc'));var fs=require('fs');var _=require(_0x0c3a('0xd'));var squel=require(_0x0c3a('0xe'));var crypto=require(_0x0c3a('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0c3a('0xb'));var querystring=require(_0x0c3a('0x10'));var Papa=require('papaparse');var Redis=require(_0x0c3a('0x11'));var authService=require(_0x0c3a('0x12'));var qs=require(_0x0c3a('0x13'));var hardwareService=require(_0x0c3a('0x14'));var logger=require('../../config/logger')(_0x0c3a('0x15'));var utils=require('../../config/utils');var config=require(_0x0c3a('0x16'));var db=require(_0x0c3a('0x17'))['db'];config['redis']=_['defaults'](config[_0x0c3a('0x18')],{'host':_0x0c3a('0x19'),'port':0x18eb});var socket=require(_0x0c3a('0x1a'))(new Redis(config[_0x0c3a('0x18')]));require(_0x0c3a('0x1b'))[_0x0c3a('0x1c')](socket);function respondWithStatusCode(_0xedf1ed,_0x1836eb){_0x1836eb=_0x1836eb||0xcc;return function(_0x5453c6){if(_0x5453c6){return _0xedf1ed[_0x0c3a('0x1d')](_0x1836eb);}return _0xedf1ed[_0x0c3a('0x1e')](_0x1836eb)[_0x0c3a('0x1f')]();};}function respondWithResult(_0x2624ee,_0x573478){_0x573478=_0x573478||0xc8;return function(_0x21ffb6){if(_0x21ffb6){return _0x2624ee[_0x0c3a('0x1e')](_0x573478)[_0x0c3a('0x20')](_0x21ffb6);}};}function respondWithFilteredResult(_0x24f41b,_0x41d169){return function(_0x4cce4a){if(_0x4cce4a){var _0xd8e5de=_0x4cce4a['count'],_0x56425c=_0x41d169[_0x0c3a('0x21')],_0x1dc647=_0x41d169['offset']+_0x41d169[_0x0c3a('0x22')],_0x1b34c7;if(_0x1dc647>=_0xd8e5de){_0x1dc647=_0xd8e5de;_0x1b34c7=0xc8;}else{_0x1b34c7=0xce;}_0x24f41b[_0x0c3a('0x1e')](_0x1b34c7);return _0x24f41b[_0x0c3a('0x23')](_0x0c3a('0x24'),_0x56425c+'-'+_0x1dc647+'/'+_0xd8e5de)['json'](_0x4cce4a);}return null;};}function patchUpdates(_0x4d32ab){return function(_0x59a642){try{jsonpatch[_0x0c3a('0x25')](_0x59a642,_0x4d32ab,!![]);}catch(_0x5710d9){return BPromise['reject'](_0x5710d9);}return _0x59a642[_0x0c3a('0x26')]();};}function saveUpdates(_0x1c7dfd,_0x5597b1){return function(_0x13b3f7){if(_0x13b3f7){return _0x13b3f7[_0x0c3a('0x27')](_0x1c7dfd)[_0x0c3a('0x28')](function(_0x160720){return _0x160720;});}return null;};}function removeEntity(_0x2c710a,_0x3db46f){return function(_0x54a457){if(_0x54a457){return _0x54a457[_0x0c3a('0x29')]()[_0x0c3a('0x28')](function(){var _0x578265=_0x54a457[_0x0c3a('0x2a')]({'plain':!![]});var _0x129efd='SquareProjects';return db[_0x0c3a('0x2b')][_0x0c3a('0x29')]({'where':{'type':_0x129efd,'resourceId':_0x578265['id']}})['then'](function(){return _0x54a457;});})[_0x0c3a('0x28')](function(){_0x2c710a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x502987,_0x203369){return function(_0x2a5387){if(!_0x2a5387){_0x502987[_0x0c3a('0x1d')](0x194);}return _0x2a5387;};}function handleError(_0x19758e,_0x2065df){_0x2065df=_0x2065df||0x1f4;return function(_0x4c4d7e){logger[_0x0c3a('0x2c')](_0x4c4d7e[_0x0c3a('0x2d')]);if(_0x4c4d7e[_0x0c3a('0x2e')]){delete _0x4c4d7e[_0x0c3a('0x2e')];}_0x19758e[_0x0c3a('0x1e')](_0x2065df)[_0x0c3a('0x2f')](_0x4c4d7e);};}exports[_0x0c3a('0x30')]=function(_0x47fce1,_0x50a1ee){var _0x123420={},_0x13f9a6={},_0x50c1ba={'count':0x0,'rows':[]};var _0x4d8634=db['SquareProject']['rawAttributes'];_0x13f9a6[_0x0c3a('0x31')]=_['keys'](_0x4d8634);_0x13f9a6[_0x0c3a('0x32')]=_[_0x0c3a('0x33')](_0x47fce1[_0x0c3a('0x32')]);_0x13f9a6[_0x0c3a('0x34')]=_['intersection'](_0x13f9a6[_0x0c3a('0x31')],_0x13f9a6[_0x0c3a('0x32')]);_0x123420[_0x0c3a('0x35')]=_['intersection'](_0x13f9a6[_0x0c3a('0x31')],qs[_0x0c3a('0x36')](_0x47fce1[_0x0c3a('0x32')][_0x0c3a('0x36')]));_0x123420[_0x0c3a('0x35')]=_0x123420[_0x0c3a('0x35')][_0x0c3a('0x37')]?_0x123420[_0x0c3a('0x35')]:_0x13f9a6[_0x0c3a('0x31')];if(!_0x47fce1[_0x0c3a('0x32')][_0x0c3a('0x38')](_0x0c3a('0x39'))){_0x123420[_0x0c3a('0x22')]=qs['limit'](_0x47fce1[_0x0c3a('0x32')]['limit']);_0x123420['offset']=qs[_0x0c3a('0x21')](_0x47fce1[_0x0c3a('0x32')][_0x0c3a('0x21')]);}_0x123420['order']=qs[_0x0c3a('0x3a')](_0x47fce1['query'][_0x0c3a('0x3a')]);_0x123420[_0x0c3a('0x3b')]=qs[_0x0c3a('0x34')](_[_0x0c3a('0x3c')](_0x47fce1[_0x0c3a('0x32')],_0x13f9a6['filters']));if(_0x47fce1[_0x0c3a('0x32')][_0x0c3a('0x3d')]){_0x123420[_0x0c3a('0x3b')]=_['merge'](_0x123420[_0x0c3a('0x3b')],{'$or':_['map'](_0x4d8634,function(_0x2b39fe){if(_0x2b39fe['type']['key']!==_0x0c3a('0x3e')){var _0x417a0c={};_0x417a0c[_0x2b39fe[_0x0c3a('0x3f')]]={'$like':'%'+_0x47fce1['query']['filter']+'%'};return _0x417a0c;}})});}_0x123420=_['merge']({},_0x123420,_0x47fce1['options']);var _0x238769={'where':_0x123420[_0x0c3a('0x3b')]};return db[_0x0c3a('0x40')][_0x0c3a('0x41')](_0x238769)['then'](function(_0x1f2010){_0x50c1ba[_0x0c3a('0x41')]=_0x1f2010;if(_0x47fce1[_0x0c3a('0x32')][_0x0c3a('0x42')]){_0x123420['include']=[{'all':!![]}];}return db[_0x0c3a('0x40')][_0x0c3a('0x43')](_0x123420);})[_0x0c3a('0x28')](function(_0x320401){_0x50c1ba[_0x0c3a('0x44')]=_0x320401;return _0x50c1ba;})[_0x0c3a('0x28')](respondWithFilteredResult(_0x50a1ee,_0x123420))[_0x0c3a('0x45')](handleError(_0x50a1ee,null));};exports['show']=function(_0x324315,_0xecd625){var _0x242310={'raw':![],'where':{'id':_0x324315[_0x0c3a('0x46')]['id']}},_0x2c32e1={};_0x2c32e1[_0x0c3a('0x31')]=_[_0x0c3a('0x33')](db['SquareProject'][_0x0c3a('0x47')]);_0x2c32e1[_0x0c3a('0x32')]=_[_0x0c3a('0x33')](_0x324315['query']);_0x2c32e1[_0x0c3a('0x34')]=_[_0x0c3a('0x48')](_0x2c32e1['model'],_0x2c32e1['query']);_0x242310[_0x0c3a('0x35')]=_['intersection'](_0x2c32e1[_0x0c3a('0x31')],qs[_0x0c3a('0x36')](_0x324315['query'][_0x0c3a('0x36')]));_0x242310['attributes']=_0x242310[_0x0c3a('0x35')][_0x0c3a('0x37')]?_0x242310[_0x0c3a('0x35')]:_0x2c32e1[_0x0c3a('0x31')];if(_0x324315[_0x0c3a('0x32')]['includeAll']){_0x242310[_0x0c3a('0x49')]=[{'all':!![]}];}_0x242310=_[_0x0c3a('0x4a')]({},_0x242310,_0x324315[_0x0c3a('0x4b')]);return db[_0x0c3a('0x40')][_0x0c3a('0x4c')](_0x242310)['then'](handleEntityNotFound(_0xecd625,null))[_0x0c3a('0x28')](respondWithResult(_0xecd625,null))[_0x0c3a('0x45')](handleError(_0xecd625,null));};exports[_0x0c3a('0x4d')]=function(_0x1f7f6e,_0x3c11aa){return db['SquareProject'][_0x0c3a('0x4d')](_0x1f7f6e['body'],{})[_0x0c3a('0x28')](function(_0x16bb7e){var _0x392eb4=_0x1f7f6e[_0x0c3a('0x4e')][_0x0c3a('0x2a')]({'plain':!![]});if(!_0x392eb4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x392eb4[_0x0c3a('0x4f')]===_0x0c3a('0x4e')){var _0x51a459=_0x16bb7e['get']({'plain':!![]});var _0x4b2324=_0x0c3a('0x50');return db[_0x0c3a('0x51')][_0x0c3a('0x4c')]({'where':{'name':_0x4b2324,'userProfileId':_0x392eb4['userProfileId']},'raw':!![]})['then'](function(_0x379808){if(_0x379808&&_0x379808[_0x0c3a('0x52')]===0x0){return db[_0x0c3a('0x2b')][_0x0c3a('0x4d')]({'name':_0x51a459[_0x0c3a('0x2e')],'resourceId':_0x51a459['id'],'type':_0x379808[_0x0c3a('0x2e')],'sectionId':_0x379808['id']},{})['then'](function(){return _0x16bb7e;});}else{return _0x16bb7e;}})[_0x0c3a('0x45')](function(_0x3c4196){logger[_0x0c3a('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c4196);throw _0x3c4196;});}return _0x16bb7e;})['then'](respondWithResult(_0x3c11aa,0xc9))[_0x0c3a('0x45')](handleError(_0x3c11aa,null));};exports[_0x0c3a('0x27')]=function(_0x96c398,_0x3f8307){if(_0x96c398[_0x0c3a('0x53')]['id']){delete _0x96c398[_0x0c3a('0x53')]['id'];}return db[_0x0c3a('0x40')]['find']({'where':{'id':_0x96c398[_0x0c3a('0x46')]['id']}})[_0x0c3a('0x28')](handleEntityNotFound(_0x3f8307,null))[_0x0c3a('0x28')](saveUpdates(_0x96c398['body'],null))['then'](respondWithResult(_0x3f8307,null))[_0x0c3a('0x45')](handleError(_0x3f8307,null));};exports[_0x0c3a('0x29')]=function(_0x47d6f5,_0x27678a){return db[_0x0c3a('0x40')][_0x0c3a('0x4c')]({'where':{'id':_0x47d6f5[_0x0c3a('0x46')]['id']}})[_0x0c3a('0x28')](handleEntityNotFound(_0x27678a,null))[_0x0c3a('0x28')](removeEntity(_0x27678a,null))[_0x0c3a('0x45')](handleError(_0x27678a,null));};exports[_0x0c3a('0x54')]=function(_0x2a618a,_0xced0e4,_0x4ba5d0){return db[_0x0c3a('0x40')][_0x0c3a('0x4c')]({'where':{'id':_0x2a618a[_0x0c3a('0x46')]['id']}})[_0x0c3a('0x28')](handleEntityNotFound(_0xced0e4,null))[_0x0c3a('0x28')](function(_0x2a1f48){if(_0x2a1f48){return _0x2a1f48[_0x0c3a('0x54')](_0x2a618a[_0x0c3a('0x53')][_0x0c3a('0x55')],_[_0x0c3a('0x56')](_0x2a618a[_0x0c3a('0x53')],['ids','id'])||{});}})[_0x0c3a('0x28')](respondWithResult(_0xced0e4,null))[_0x0c3a('0x45')](handleError(_0xced0e4,null));};exports[_0x0c3a('0x57')]=function(_0x5ccad2,_0x2340db,_0x5ce46b){return db[_0x0c3a('0x40')][_0x0c3a('0x4c')]({'where':{'id':_0x5ccad2['params']['id']}})[_0x0c3a('0x28')](handleEntityNotFound(_0x2340db,null))[_0x0c3a('0x28')](function(_0x5e91da){if(_0x5e91da){return _0x5e91da['removeUsers'](_0x5ccad2[_0x0c3a('0x32')][_0x0c3a('0x55')])['then'](function(){if(_[_0x0c3a('0x58')](_0x5ccad2[_0x0c3a('0x32')][_0x0c3a('0x55')])){for(var _0x40e494=0x0;_0x40e494<_0x5ccad2[_0x0c3a('0x32')]['ids'][_0x0c3a('0x37')];_0x40e494+=0x1){socket[_0x0c3a('0x59')]('userSquareProject:remove',{'UserId':Number(_0x5ccad2[_0x0c3a('0x32')]['ids'][_0x40e494]),'SquareProjectId':Number(_0x5ccad2['params']['id'])});}}else{socket[_0x0c3a('0x59')](_0x0c3a('0x5a'),{'UserId':Number(_0x5ccad2[_0x0c3a('0x32')][_0x0c3a('0x55')]),'SquareProjectId':Number(_0x5ccad2[_0x0c3a('0x46')]['id'])});}});}})[_0x0c3a('0x28')](respondWithStatusCode(_0x2340db,null))[_0x0c3a('0x45')](handleError(_0x2340db,null));};exports['getUsers']=function(_0x122930,_0x460a66,_0x4d05e9){var _0x2e52de={};var _0x3c55a7={};var _0x42cc33;var _0x52405c;return db[_0x0c3a('0x40')][_0x0c3a('0x5b')]({'where':{'id':_0x122930[_0x0c3a('0x46')]['id']}})['then'](handleEntityNotFound(_0x460a66,null))[_0x0c3a('0x28')](function(_0xd5d90a){if(_0xd5d90a){_0x42cc33=_0xd5d90a;_0x3c55a7['model']=_[_0x0c3a('0x33')](db['User'][_0x0c3a('0x47')]);_0x3c55a7[_0x0c3a('0x32')]=_[_0x0c3a('0x33')](_0x122930[_0x0c3a('0x32')]);_0x3c55a7[_0x0c3a('0x34')]=_[_0x0c3a('0x48')](_0x3c55a7[_0x0c3a('0x31')],_0x3c55a7[_0x0c3a('0x32')]);_0x2e52de[_0x0c3a('0x35')]=_[_0x0c3a('0x48')](_0x3c55a7[_0x0c3a('0x31')],qs[_0x0c3a('0x36')](_0x122930[_0x0c3a('0x32')]['fields']));_0x2e52de[_0x0c3a('0x35')]=_0x2e52de['attributes']['length']?_0x2e52de[_0x0c3a('0x35')]:_0x3c55a7[_0x0c3a('0x31')];_0x2e52de[_0x0c3a('0x5c')]=qs['sort'](_0x122930[_0x0c3a('0x32')]['sort']);_0x2e52de['where']=qs[_0x0c3a('0x34')](_[_0x0c3a('0x3c')](_0x122930[_0x0c3a('0x32')],_0x3c55a7['filters']));if(_0x122930[_0x0c3a('0x32')][_0x0c3a('0x3d')]){_0x2e52de['where']=_['merge'](_0x2e52de[_0x0c3a('0x3b')],{'$or':_[_0x0c3a('0x5d')](_0x2e52de['attributes'],function(_0x1446c3){var _0x238861={};_0x238861[_0x1446c3]={'$like':'%'+_0x122930[_0x0c3a('0x32')][_0x0c3a('0x3d')]+'%'};return _0x238861;})});}_0x2e52de=_[_0x0c3a('0x4a')]({},_0x2e52de,_0x122930[_0x0c3a('0x4b')]);return _0x42cc33[_0x0c3a('0x5e')](_0x2e52de);}})['then'](function(_0x439b57){if(_0x439b57){_0x52405c=_0x439b57[_0x0c3a('0x37')];if(!_0x122930[_0x0c3a('0x32')][_0x0c3a('0x38')](_0x0c3a('0x39'))){_0x2e52de['limit']=qs[_0x0c3a('0x22')](_0x122930[_0x0c3a('0x32')]['limit']);_0x2e52de[_0x0c3a('0x21')]=qs[_0x0c3a('0x21')](_0x122930[_0x0c3a('0x32')][_0x0c3a('0x21')]);}return _0x42cc33[_0x0c3a('0x5e')](_0x2e52de);}})[_0x0c3a('0x28')](function(_0xcbc0fc){if(_0xcbc0fc){return _0xcbc0fc?{'count':_0x52405c,'rows':_0xcbc0fc}:null;}})['then'](respondWithResult(_0x460a66,null))['catch'](handleError(_0x460a66,null));}; \ No newline at end of file +var _0xb22a=['keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','catch','show','params','create','body','get','role','SquareProjects','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','ids','omit','removeUsers','isArray','length','emit','userSquareProject:remove','getUsers','findOne','pick','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','limit','set','apply','then','destroy','UserProfileResource','error','stack','name','send','index','SquareProject','rawAttributes','model'];(function(_0x6793c7,_0x888cba){var _0x57feec=function(_0x45cff3){while(--_0x45cff3){_0x6793c7['push'](_0x6793c7['shift']());}};_0x57feec(++_0x888cba);}(_0xb22a,0x13c));var _0xab22=function(_0x838813,_0x448f0f){_0x838813=_0x838813-0x0;var _0x2bd32d=_0xb22a[_0x838813];return _0x2bd32d;};'use strict';var pdf=require(_0xab22('0x0'));var emlformat=require(_0xab22('0x1'));var rimraf=require(_0xab22('0x2'));var zipdir=require(_0xab22('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xab22('0x4'));var Mustache=require(_0xab22('0x5'));var util=require(_0xab22('0x6'));var path=require('path');var sox=require(_0xab22('0x7'));var csv=require('to-csv');var ejs=require(_0xab22('0x8'));var fs=require('fs');var _=require(_0xab22('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xab22('0xa'));var deskjs=require(_0xab22('0xb'));var toCsv=require(_0xab22('0xc'));var querystring=require(_0xab22('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xab22('0xe'));var qs=require(_0xab22('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xab22('0x10'))(_0xab22('0x11'));var utils=require(_0xab22('0x12'));var config=require(_0xab22('0x13'));var db=require(_0xab22('0x14'))['db'];config['redis']=_['defaults'](config[_0xab22('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xab22('0x16'))(new Redis(config[_0xab22('0x15')]));require(_0xab22('0x17'))[_0xab22('0x18')](socket);function respondWithStatusCode(_0x28df16,_0x3ed8bb){_0x3ed8bb=_0x3ed8bb||0xcc;return function(_0x35157f){if(_0x35157f){return _0x28df16[_0xab22('0x19')](_0x3ed8bb);}return _0x28df16[_0xab22('0x1a')](_0x3ed8bb)[_0xab22('0x1b')]();};}function respondWithResult(_0x1c2c0e,_0x2b9458){_0x2b9458=_0x2b9458||0xc8;return function(_0x47b21d){if(_0x47b21d){return _0x1c2c0e[_0xab22('0x1a')](_0x2b9458)[_0xab22('0x1c')](_0x47b21d);}};}function respondWithFilteredResult(_0x2e7879,_0x441264){return function(_0x2de883){if(_0x2de883){var _0x611dfe=_0x2de883['count'],_0x5d1073=_0x441264[_0xab22('0x1d')],_0x5def02=_0x441264[_0xab22('0x1d')]+_0x441264[_0xab22('0x1e')],_0x544f23;if(_0x5def02>=_0x611dfe){_0x5def02=_0x611dfe;_0x544f23=0xc8;}else{_0x544f23=0xce;}_0x2e7879[_0xab22('0x1a')](_0x544f23);return _0x2e7879[_0xab22('0x1f')]('Content-Range',_0x5d1073+'-'+_0x5def02+'/'+_0x611dfe)[_0xab22('0x1c')](_0x2de883);}return null;};}function patchUpdates(_0x47cf57){return function(_0x2c0883){try{jsonpatch[_0xab22('0x20')](_0x2c0883,_0x47cf57,!![]);}catch(_0x8253e5){return BPromise['reject'](_0x8253e5);}return _0x2c0883['save']();};}function saveUpdates(_0x36ba8c,_0x442b2d){return function(_0x1b2e20){if(_0x1b2e20){return _0x1b2e20['update'](_0x36ba8c)[_0xab22('0x21')](function(_0x2eac95){return _0x2eac95;});}return null;};}function removeEntity(_0x9658dd,_0x1edfc3){return function(_0x236a70){if(_0x236a70){return _0x236a70[_0xab22('0x22')]()[_0xab22('0x21')](function(){var _0x1d2da0=_0x236a70['get']({'plain':!![]});var _0x1b892='SquareProjects';return db[_0xab22('0x23')][_0xab22('0x22')]({'where':{'type':_0x1b892,'resourceId':_0x1d2da0['id']}})['then'](function(){return _0x236a70;});})['then'](function(){_0x9658dd[_0xab22('0x1a')](0xcc)[_0xab22('0x1b')]();});}};}function handleEntityNotFound(_0x475ab,_0x33c425){return function(_0x53acdc){if(!_0x53acdc){_0x475ab[_0xab22('0x19')](0x194);}return _0x53acdc;};}function handleError(_0x52c188,_0x52344f){_0x52344f=_0x52344f||0x1f4;return function(_0x3e760c){logger[_0xab22('0x24')](_0x3e760c[_0xab22('0x25')]);if(_0x3e760c[_0xab22('0x26')]){delete _0x3e760c[_0xab22('0x26')];}_0x52c188[_0xab22('0x1a')](_0x52344f)[_0xab22('0x27')](_0x3e760c);};}exports[_0xab22('0x28')]=function(_0x36fd63,_0x5dc0ba){var _0x286e75={},_0x58e1ca={},_0x5d5c4c={'count':0x0,'rows':[]};var _0x57de4d=db[_0xab22('0x29')][_0xab22('0x2a')];_0x58e1ca[_0xab22('0x2b')]=_[_0xab22('0x2c')](_0x57de4d);_0x58e1ca[_0xab22('0x2d')]=_[_0xab22('0x2c')](_0x36fd63['query']);_0x58e1ca[_0xab22('0x2e')]=_[_0xab22('0x2f')](_0x58e1ca[_0xab22('0x2b')],_0x58e1ca['query']);_0x286e75[_0xab22('0x30')]=_[_0xab22('0x2f')](_0x58e1ca[_0xab22('0x2b')],qs[_0xab22('0x31')](_0x36fd63[_0xab22('0x2d')][_0xab22('0x31')]));_0x286e75[_0xab22('0x30')]=_0x286e75['attributes']['length']?_0x286e75['attributes']:_0x58e1ca[_0xab22('0x2b')];if(!_0x36fd63[_0xab22('0x2d')]['hasOwnProperty'](_0xab22('0x32'))){_0x286e75[_0xab22('0x1e')]=qs['limit'](_0x36fd63[_0xab22('0x2d')][_0xab22('0x1e')]);_0x286e75[_0xab22('0x1d')]=qs[_0xab22('0x1d')](_0x36fd63['query']['offset']);}_0x286e75[_0xab22('0x33')]=qs[_0xab22('0x34')](_0x36fd63['query'][_0xab22('0x34')]);_0x286e75[_0xab22('0x35')]=qs['filters'](_['pick'](_0x36fd63[_0xab22('0x2d')],_0x58e1ca[_0xab22('0x2e')]));if(_0x36fd63[_0xab22('0x2d')][_0xab22('0x36')]){_0x286e75[_0xab22('0x35')]=_[_0xab22('0x37')](_0x286e75[_0xab22('0x35')],{'$or':_[_0xab22('0x38')](_0x57de4d,function(_0x14e057){if(_0x14e057[_0xab22('0x39')][_0xab22('0x3a')]!==_0xab22('0x3b')){var _0x26b5d4={};_0x26b5d4[_0x14e057[_0xab22('0x3c')]]={'$like':'%'+_0x36fd63[_0xab22('0x2d')]['filter']+'%'};return _0x26b5d4;}})});}_0x286e75=_[_0xab22('0x37')]({},_0x286e75,_0x36fd63[_0xab22('0x3d')]);var _0x400900={'where':_0x286e75['where']};return db[_0xab22('0x29')]['count'](_0x400900)[_0xab22('0x21')](function(_0x4a977c){_0x5d5c4c[_0xab22('0x3e')]=_0x4a977c;if(_0x36fd63['query'][_0xab22('0x3f')]){_0x286e75[_0xab22('0x40')]=[{'all':!![]}];}return db['SquareProject'][_0xab22('0x41')](_0x286e75);})['then'](function(_0x5d5c0a){_0x5d5c4c['rows']=_0x5d5c0a;return _0x5d5c4c;})['then'](respondWithFilteredResult(_0x5dc0ba,_0x286e75))[_0xab22('0x42')](handleError(_0x5dc0ba,null));};exports[_0xab22('0x43')]=function(_0x3c6074,_0x22d781){var _0x436fbe={'raw':![],'where':{'id':_0x3c6074[_0xab22('0x44')]['id']}},_0x3c7c53={};_0x3c7c53[_0xab22('0x2b')]=_[_0xab22('0x2c')](db[_0xab22('0x29')]['rawAttributes']);_0x3c7c53['query']=_[_0xab22('0x2c')](_0x3c6074['query']);_0x3c7c53['filters']=_[_0xab22('0x2f')](_0x3c7c53[_0xab22('0x2b')],_0x3c7c53[_0xab22('0x2d')]);_0x436fbe[_0xab22('0x30')]=_['intersection'](_0x3c7c53[_0xab22('0x2b')],qs[_0xab22('0x31')](_0x3c6074[_0xab22('0x2d')][_0xab22('0x31')]));_0x436fbe['attributes']=_0x436fbe['attributes']['length']?_0x436fbe[_0xab22('0x30')]:_0x3c7c53[_0xab22('0x2b')];if(_0x3c6074[_0xab22('0x2d')][_0xab22('0x3f')]){_0x436fbe[_0xab22('0x40')]=[{'all':!![]}];}_0x436fbe=_[_0xab22('0x37')]({},_0x436fbe,_0x3c6074[_0xab22('0x3d')]);return db[_0xab22('0x29')]['find'](_0x436fbe)[_0xab22('0x21')](handleEntityNotFound(_0x22d781,null))[_0xab22('0x21')](respondWithResult(_0x22d781,null))[_0xab22('0x42')](handleError(_0x22d781,null));};exports[_0xab22('0x45')]=function(_0x32c6a6,_0x328fec){return db[_0xab22('0x29')][_0xab22('0x45')](_0x32c6a6[_0xab22('0x46')],{})['then'](function(_0x5316e5){var _0x4b790e=_0x32c6a6['user'][_0xab22('0x47')]({'plain':!![]});if(!_0x4b790e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b790e[_0xab22('0x48')]==='user'){var _0x47d64e=_0x5316e5[_0xab22('0x47')]({'plain':!![]});var _0x2de198=_0xab22('0x49');return db[_0xab22('0x4a')][_0xab22('0x4b')]({'where':{'name':_0x2de198,'userProfileId':_0x4b790e['userProfileId']},'raw':!![]})[_0xab22('0x21')](function(_0x3b198c){if(_0x3b198c&&_0x3b198c['autoAssociation']===0x0){return db['UserProfileResource'][_0xab22('0x45')]({'name':_0x47d64e[_0xab22('0x26')],'resourceId':_0x47d64e['id'],'type':_0x3b198c['name'],'sectionId':_0x3b198c['id']},{})[_0xab22('0x21')](function(){return _0x5316e5;});}else{return _0x5316e5;}})[_0xab22('0x42')](function(_0x4f62dd){logger[_0xab22('0x24')](_0xab22('0x4c'),_0x4f62dd);throw _0x4f62dd;});}return _0x5316e5;})['then'](respondWithResult(_0x328fec,0xc9))[_0xab22('0x42')](handleError(_0x328fec,null));};exports[_0xab22('0x4d')]=function(_0x4e4fa6,_0xa3e103){if(_0x4e4fa6[_0xab22('0x46')]['id']){delete _0x4e4fa6[_0xab22('0x46')]['id'];}return db[_0xab22('0x29')][_0xab22('0x4b')]({'where':{'id':_0x4e4fa6[_0xab22('0x44')]['id']}})[_0xab22('0x21')](handleEntityNotFound(_0xa3e103,null))[_0xab22('0x21')](saveUpdates(_0x4e4fa6['body'],null))['then'](respondWithResult(_0xa3e103,null))[_0xab22('0x42')](handleError(_0xa3e103,null));};exports['destroy']=function(_0x15efa5,_0x26c1fb){return db[_0xab22('0x29')]['find']({'where':{'id':_0x15efa5[_0xab22('0x44')]['id']}})[_0xab22('0x21')](handleEntityNotFound(_0x26c1fb,null))[_0xab22('0x21')](removeEntity(_0x26c1fb,null))[_0xab22('0x42')](handleError(_0x26c1fb,null));};exports[_0xab22('0x4e')]=function(_0xb52055,_0x181319,_0x292cca){return db[_0xab22('0x29')]['find']({'where':{'id':_0xb52055[_0xab22('0x44')]['id']}})[_0xab22('0x21')](handleEntityNotFound(_0x181319,null))[_0xab22('0x21')](function(_0x54918f){if(_0x54918f){return _0x54918f[_0xab22('0x4e')](_0xb52055[_0xab22('0x46')][_0xab22('0x4f')],_[_0xab22('0x50')](_0xb52055[_0xab22('0x46')],[_0xab22('0x4f'),'id'])||{});}})[_0xab22('0x21')](respondWithResult(_0x181319,null))[_0xab22('0x42')](handleError(_0x181319,null));};exports['removeUsers']=function(_0x403f4a,_0x3877f1,_0x45f488){return db[_0xab22('0x29')][_0xab22('0x4b')]({'where':{'id':_0x403f4a['params']['id']}})['then'](handleEntityNotFound(_0x3877f1,null))[_0xab22('0x21')](function(_0x4eee6e){if(_0x4eee6e){return _0x4eee6e[_0xab22('0x51')](_0x403f4a[_0xab22('0x2d')][_0xab22('0x4f')])[_0xab22('0x21')](function(){if(_[_0xab22('0x52')](_0x403f4a[_0xab22('0x2d')][_0xab22('0x4f')])){for(var _0x2bf9c6=0x0;_0x2bf9c6<_0x403f4a[_0xab22('0x2d')][_0xab22('0x4f')][_0xab22('0x53')];_0x2bf9c6+=0x1){socket[_0xab22('0x54')](_0xab22('0x55'),{'UserId':Number(_0x403f4a[_0xab22('0x2d')][_0xab22('0x4f')][_0x2bf9c6]),'SquareProjectId':Number(_0x403f4a[_0xab22('0x44')]['id'])});}}else{socket[_0xab22('0x54')](_0xab22('0x55'),{'UserId':Number(_0x403f4a['query'][_0xab22('0x4f')]),'SquareProjectId':Number(_0x403f4a[_0xab22('0x44')]['id'])});}});}})[_0xab22('0x21')](respondWithStatusCode(_0x3877f1,null))[_0xab22('0x42')](handleError(_0x3877f1,null));};exports[_0xab22('0x56')]=function(_0x1d61e5,_0x1072ab,_0x878e6a){var _0x3ba413={};var _0x5d78b6={};var _0x4e6190;var _0x8dba84;return db[_0xab22('0x29')][_0xab22('0x57')]({'where':{'id':_0x1d61e5['params']['id']}})['then'](handleEntityNotFound(_0x1072ab,null))[_0xab22('0x21')](function(_0x441992){if(_0x441992){_0x4e6190=_0x441992;_0x5d78b6[_0xab22('0x2b')]=_[_0xab22('0x2c')](db['User']['rawAttributes']);_0x5d78b6[_0xab22('0x2d')]=_[_0xab22('0x2c')](_0x1d61e5['query']);_0x5d78b6[_0xab22('0x2e')]=_[_0xab22('0x2f')](_0x5d78b6[_0xab22('0x2b')],_0x5d78b6[_0xab22('0x2d')]);_0x3ba413[_0xab22('0x30')]=_[_0xab22('0x2f')](_0x5d78b6[_0xab22('0x2b')],qs[_0xab22('0x31')](_0x1d61e5[_0xab22('0x2d')][_0xab22('0x31')]));_0x3ba413[_0xab22('0x30')]=_0x3ba413[_0xab22('0x30')][_0xab22('0x53')]?_0x3ba413[_0xab22('0x30')]:_0x5d78b6[_0xab22('0x2b')];_0x3ba413['order']=qs['sort'](_0x1d61e5[_0xab22('0x2d')][_0xab22('0x34')]);_0x3ba413[_0xab22('0x35')]=qs[_0xab22('0x2e')](_[_0xab22('0x58')](_0x1d61e5['query'],_0x5d78b6['filters']));if(_0x1d61e5[_0xab22('0x2d')]['filter']){_0x3ba413[_0xab22('0x35')]=_[_0xab22('0x37')](_0x3ba413['where'],{'$or':_[_0xab22('0x38')](_0x3ba413[_0xab22('0x30')],function(_0x300b19){var _0x3ecb0d={};_0x3ecb0d[_0x300b19]={'$like':'%'+_0x1d61e5[_0xab22('0x2d')]['filter']+'%'};return _0x3ecb0d;})});}_0x3ba413=_['merge']({},_0x3ba413,_0x1d61e5['options']);return _0x4e6190[_0xab22('0x56')](_0x3ba413);}})[_0xab22('0x21')](function(_0x188efb){if(_0x188efb){_0x8dba84=_0x188efb[_0xab22('0x53')];if(!_0x1d61e5[_0xab22('0x2d')][_0xab22('0x59')](_0xab22('0x32'))){_0x3ba413[_0xab22('0x1e')]=qs[_0xab22('0x1e')](_0x1d61e5[_0xab22('0x2d')]['limit']);_0x3ba413[_0xab22('0x1d')]=qs[_0xab22('0x1d')](_0x1d61e5['query'][_0xab22('0x1d')]);}return _0x4e6190['getUsers'](_0x3ba413);}})[_0xab22('0x21')](function(_0x414b3b){if(_0x414b3b){return _0x414b3b?{'count':_0x8dba84,'rows':_0x414b3b}:null;}})[_0xab22('0x21')](respondWithResult(_0x1072ab,null))[_0xab22('0x42')](handleError(_0x1072ab,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 6387a4b..f5449ac 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 _0x10d8=['SquareProject','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xc98644,_0x14c97b){var _0xfa168=function(_0x11efd7){while(--_0x11efd7){_0xc98644['push'](_0xc98644['shift']());}};_0xfa168(++_0x14c97b);}(_0x10d8,0xee));var _0x810d=function(_0x54d77d,_0x100a4d){_0x54d77d=_0x54d77d-0x0;var _0x49006b=_0x10d8[_0x54d77d];return _0x49006b;};'use strict';var EventEmitter=require(_0x810d('0x0'));var SquareProject=require(_0x810d('0x1'))['db'][_0x810d('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x810d('0x3'),'afterUpdate':_0x810d('0x4'),'afterDestroy':_0x810d('0x5')};function emitEvent(_0xcdb8db){return function(_0x32b0cd,_0x5b2ddc,_0x5364b5){SquareProjectEvents[_0x810d('0x6')](_0xcdb8db+':'+_0x32b0cd['id'],_0x32b0cd);SquareProjectEvents[_0x810d('0x6')](_0xcdb8db,_0x32b0cd);_0x5364b5(null);};}for(var e in events){if(events[_0x810d('0x7')](e)){var event=events[e];SquareProject[_0x810d('0x8')](e,emitEvent(event));}}module[_0x810d('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0xcb83=['hasOwnProperty','hook','exports','events','SquareProject','setMaxListeners','save','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb83,0x1c5));var _0x3cb8=function(_0x185168,_0x2177ed){_0x185168=_0x185168-0x0;var _0x5b263b=_0xcb83[_0x185168];return _0x5b263b;};'use strict';var EventEmitter=require(_0x3cb8('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x3cb8('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x3cb8('0x2')](0x0);var events={'afterCreate':_0x3cb8('0x3'),'afterUpdate':_0x3cb8('0x4'),'afterDestroy':_0x3cb8('0x5')};function emitEvent(_0x5f0959){return function(_0x2d656c,_0x3fab12,_0x37959e){SquareProjectEvents[_0x3cb8('0x6')](_0x5f0959+':'+_0x2d656c['id'],_0x2d656c);SquareProjectEvents['emit'](_0x5f0959,_0x2d656c);_0x37959e(null);};}for(var e in events){if(events[_0x3cb8('0x7')](e)){var event=events[e];SquareProject[_0x3cb8('0x8')](e,emitEvent(event));}}module[_0x3cb8('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index a5dc50f..5ba2811 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 _0x942a=['bluebird','path','rimraf','../../config/environment','./squareProject.attributes','define','square_projects','lodash','../../config/logger','api','moment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x942a,0x1ca));var _0xa942=function(_0x175e89,_0x20835f){_0x175e89=_0x175e89-0x0;var _0x2ed996=_0x942a[_0x175e89];return _0x2ed996;};'use strict';var _=require(_0xa942('0x0'));var util=require('util');var logger=require(_0xa942('0x1'))(_0xa942('0x2'));var moment=require(_0xa942('0x3'));var BPromise=require(_0xa942('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa942('0x5'));var rimraf=require(_0xa942('0x6'));var config=require(_0xa942('0x7'));var attributes=require(_0xa942('0x8'));module['exports']=function(_0x56cb69,_0x2372e7){return _0x56cb69[_0xa942('0x9')]('SquareProject',attributes,{'tableName':_0xa942('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e1d=['rimraf','../../config/environment','./squareProject.attributes','define','square_projects','lodash','moment','bluebird','request-promise'];(function(_0x36375a,_0x43ede3){var _0xe646d0=function(_0x4e9ea2){while(--_0x4e9ea2){_0x36375a['push'](_0x36375a['shift']());}};_0xe646d0(++_0x43ede3);}(_0x9e1d,0x11c));var _0xd9e1=function(_0x32085a,_0x3a577e){_0x32085a=_0x32085a-0x0;var _0x154885=_0x9e1d[_0x32085a];return _0x154885;};'use strict';var _=require(_0xd9e1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd9e1('0x1'));var BPromise=require(_0xd9e1('0x2'));var rp=require(_0xd9e1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd9e1('0x4'));var config=require(_0xd9e1('0x5'));var attributes=require(_0xd9e1('0x6'));module['exports']=function(_0x5facff,_0x448691){return _0x5facff[_0xd9e1('0x7')]('SquareProject',attributes,{'tableName':_0xd9e1('0x8'),'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 f92955f..0160031 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 _0x834b=['find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','request','info','request\x20sent','debug','stringify','error','code','SquareProject,\x20%s,\x20%s','message','result','catch','ShowSquareProject','SquareProject'];(function(_0xce8a36,_0x5e347f){var _0x2ee2a2=function(_0x795dcb){while(--_0x795dcb){_0xce8a36['push'](_0xce8a36['shift']());}};_0x2ee2a2(++_0x5e347f);}(_0x834b,0xcc));var _0xb834=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x834b[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xb834('0x0'));var util=require(_0xb834('0x1'));var moment=require(_0xb834('0x2'));var BPromise=require(_0xb834('0x3'));var rs=require(_0xb834('0x4'));var fs=require('fs');var Redis=require(_0xb834('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb834('0x6'));var logger=require(_0xb834('0x7'))('rpc');var config=require(_0xb834('0x8'));var jayson=require(_0xb834('0x9'));var client=jayson['client'][_0xb834('0xa')]({'port':0x232a});config['redis']=_[_0xb834('0xb')](config[_0xb834('0xc')],{'host':_0xb834('0xd'),'port':0x18eb});var socket=require(_0xb834('0xe'))(new Redis(config[_0xb834('0xc')]));require(_0xb834('0xf'))[_0xb834('0x10')](socket);function respondWithRpcPromise(_0x580255,_0x11d79b,_0x2af818){return new BPromise(function(_0x5b62d2,_0x1eb23b){return client[_0xb834('0x11')](_0x580255,_0x2af818)['then'](function(_0x20e1fa){logger[_0xb834('0x12')]('SquareProject,\x20%s,\x20%s',_0x11d79b,_0xb834('0x13'));logger[_0xb834('0x14')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x11d79b,'request\x20sent',JSON[_0xb834('0x15')](_0x20e1fa));if(_0x20e1fa[_0xb834('0x16')]){if(_0x20e1fa[_0xb834('0x16')][_0xb834('0x17')]===0x1f4){logger[_0xb834('0x16')](_0xb834('0x18'),_0x11d79b,_0x20e1fa[_0xb834('0x16')][_0xb834('0x19')]);return _0x1eb23b(_0x20e1fa[_0xb834('0x16')][_0xb834('0x19')]);}logger[_0xb834('0x16')](_0xb834('0x18'),_0x11d79b,_0x20e1fa[_0xb834('0x16')][_0xb834('0x19')]);return _0x5b62d2(_0x20e1fa[_0xb834('0x16')][_0xb834('0x19')]);}else{logger[_0xb834('0x12')](_0xb834('0x18'),_0x11d79b,_0xb834('0x13'));_0x5b62d2(_0x20e1fa[_0xb834('0x1a')][_0xb834('0x19')]);}})[_0xb834('0x1b')](function(_0x9be110){logger[_0xb834('0x16')](_0xb834('0x18'),_0x11d79b,_0x9be110);_0x1eb23b(_0x9be110);});});}exports[_0xb834('0x1c')]=function(_0x25ca48){var _0x42c7bd=this;return new Promise(function(_0x19aba7,_0x198bad){return db[_0xb834('0x1d')][_0xb834('0x1e')]({'raw':_0x25ca48[_0xb834('0x1f')]?_0x25ca48[_0xb834('0x1f')][_0xb834('0x20')]===undefined?!![]:![]:!![],'where':_0x25ca48[_0xb834('0x1f')]?_0x25ca48['options'][_0xb834('0x21')]||null:null,'attributes':_0x25ca48['options']?_0x25ca48[_0xb834('0x1f')][_0xb834('0x22')]||null:null,'include':_0x25ca48[_0xb834('0x1f')]?_0x25ca48['options'][_0xb834('0x23')]?_['map'](_0x25ca48['options'][_0xb834('0x23')],function(_0x5349ab){return{'model':db[_0x5349ab['model']],'as':_0x5349ab['as'],'attributes':_0x5349ab[_0xb834('0x22')],'include':_0x5349ab[_0xb834('0x23')]?_[_0xb834('0x24')](_0x5349ab[_0xb834('0x23')],function(_0x19d89d){return{'model':db[_0x19d89d[_0xb834('0x25')]],'as':_0x19d89d['as'],'attributes':_0x19d89d[_0xb834('0x22')],'include':_0x19d89d[_0xb834('0x23')]?_[_0xb834('0x24')](_0x19d89d[_0xb834('0x23')],function(_0x1278b6){return{'model':db[_0x1278b6[_0xb834('0x25')]],'as':_0x1278b6['as'],'attributes':_0x1278b6['attributes']};}):[]};}):[]};}):[]:[]})[_0xb834('0x26')](function(_0x31e9e7){logger['info'](_0xb834('0x1c'),_0x25ca48);logger[_0xb834('0x14')](_0xb834('0x1c'),_0x25ca48,JSON['stringify'](_0x31e9e7));_0x19aba7(_0x31e9e7);})[_0xb834('0x1b')](function(_0xda78c2){logger[_0xb834('0x16')](_0xb834('0x1c'),_0xda78c2['message'],_0x25ca48);_0x198bad(_0x42c7bd[_0xb834('0x16')](0x1f4,_0xda78c2[_0xb834('0x19')]));});});}; \ No newline at end of file +var _0x07c6=['catch','ShowSquareProject','SquareProject','find','options','where','attributes','include','map','model','then','debug','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','stringify','error','code','SquareProject,\x20%s,\x20%s','message','result'];(function(_0x4cb50b,_0x50311e){var _0x35af31=function(_0x443664){while(--_0x443664){_0x4cb50b['push'](_0x4cb50b['shift']());}};_0x35af31(++_0x50311e);}(_0x07c6,0xe4));var _0x607c=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x07c6[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x607c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x607c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x607c('0x2'))['db'];var utils=require(_0x607c('0x3'));var logger=require(_0x607c('0x4'))(_0x607c('0x5'));var config=require(_0x607c('0x6'));var jayson=require(_0x607c('0x7'));var client=jayson[_0x607c('0x8')][_0x607c('0x9')]({'port':0x232a});config['redis']=_[_0x607c('0xa')](config[_0x607c('0xb')],{'host':_0x607c('0xc'),'port':0x18eb});var socket=require(_0x607c('0xd'))(new Redis(config[_0x607c('0xb')]));require('./squareProject.socket')[_0x607c('0xe')](socket);function respondWithRpcPromise(_0x2199a9,_0x405182,_0x1a4773){return new BPromise(function(_0x3d3c69,_0x1cc4e3){return client[_0x607c('0xf')](_0x2199a9,_0x1a4773)['then'](function(_0x55d76a){logger[_0x607c('0x10')]('SquareProject,\x20%s,\x20%s',_0x405182,_0x607c('0x11'));logger['debug']('SquareProject,\x20%s,\x20%s,\x20%s',_0x405182,_0x607c('0x11'),JSON[_0x607c('0x12')](_0x55d76a));if(_0x55d76a[_0x607c('0x13')]){if(_0x55d76a[_0x607c('0x13')][_0x607c('0x14')]===0x1f4){logger[_0x607c('0x13')](_0x607c('0x15'),_0x405182,_0x55d76a['error'][_0x607c('0x16')]);return _0x1cc4e3(_0x55d76a[_0x607c('0x13')][_0x607c('0x16')]);}logger[_0x607c('0x13')](_0x607c('0x15'),_0x405182,_0x55d76a['error'][_0x607c('0x16')]);return _0x3d3c69(_0x55d76a['error'][_0x607c('0x16')]);}else{logger[_0x607c('0x10')](_0x607c('0x15'),_0x405182,'request\x20sent');_0x3d3c69(_0x55d76a[_0x607c('0x17')][_0x607c('0x16')]);}})[_0x607c('0x18')](function(_0x238743){logger[_0x607c('0x13')]('SquareProject,\x20%s,\x20%s',_0x405182,_0x238743);_0x1cc4e3(_0x238743);});});}exports[_0x607c('0x19')]=function(_0x1eeb0e){var _0x1a3ee6=this;return new Promise(function(_0x1f5c14,_0x35cb14){return db[_0x607c('0x1a')][_0x607c('0x1b')]({'raw':_0x1eeb0e[_0x607c('0x1c')]?_0x1eeb0e[_0x607c('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1eeb0e[_0x607c('0x1c')]?_0x1eeb0e[_0x607c('0x1c')][_0x607c('0x1d')]||null:null,'attributes':_0x1eeb0e[_0x607c('0x1c')]?_0x1eeb0e[_0x607c('0x1c')][_0x607c('0x1e')]||null:null,'include':_0x1eeb0e[_0x607c('0x1c')]?_0x1eeb0e[_0x607c('0x1c')]['include']?_['map'](_0x1eeb0e[_0x607c('0x1c')][_0x607c('0x1f')],function(_0x4a0eef){return{'model':db[_0x4a0eef['model']],'as':_0x4a0eef['as'],'attributes':_0x4a0eef[_0x607c('0x1e')],'include':_0x4a0eef[_0x607c('0x1f')]?_[_0x607c('0x20')](_0x4a0eef[_0x607c('0x1f')],function(_0x595c72){return{'model':db[_0x595c72[_0x607c('0x21')]],'as':_0x595c72['as'],'attributes':_0x595c72['attributes'],'include':_0x595c72[_0x607c('0x1f')]?_[_0x607c('0x20')](_0x595c72[_0x607c('0x1f')],function(_0x5c2a89){return{'model':db[_0x5c2a89[_0x607c('0x21')]],'as':_0x5c2a89['as'],'attributes':_0x5c2a89[_0x607c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x607c('0x22')](function(_0x38a15c){logger[_0x607c('0x10')]('ShowSquareProject',_0x1eeb0e);logger[_0x607c('0x23')]('ShowSquareProject',_0x1eeb0e,JSON[_0x607c('0x12')](_0x38a15c));_0x1f5c14(_0x38a15c);})[_0x607c('0x18')](function(_0x139759){logger['error'](_0x607c('0x19'),_0x139759[_0x607c('0x16')],_0x1eeb0e);_0x35cb14(_0x1a3ee6[_0x607c('0x13')](0x1f4,_0x139759[_0x607c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 413ea95..1bea674 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 _0x6d38=['removeListener','length','squareProject:','save','remove','update'];(function(_0x3a814f,_0x553e5b){var _0x150de1=function(_0x162bed){while(--_0x162bed){_0x3a814f['push'](_0x3a814f['shift']());}};_0x150de1(++_0x553e5b);}(_0x6d38,0x1ef));var _0x86d3=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x6d38[_0x2f5ac5];return _0x37c9a8;};'use strict';var SquareProjectEvents=require('./squareProject.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(){SquareProjectEvents[_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);SquareProjectEvents['on'](_0x47e654,_0x552b07);}}; \ No newline at end of file +var _0xd117=['save','remove','update','emit','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0x223713,_0x5b29be){var _0x5cf99f=function(_0xa06aac){while(--_0xa06aac){_0x223713['push'](_0x223713['shift']());}};_0x5cf99f(++_0x5b29be);}(_0xd117,0x182));var _0x7d11=function(_0x1db831,_0x42b7b5){_0x1db831=_0x1db831-0x0;var _0x39ba56=_0xd117[_0x1db831];return _0x39ba56;};'use strict';var SquareProjectEvents=require(_0x7d11('0x0'));var events=[_0x7d11('0x1'),_0x7d11('0x2'),_0x7d11('0x3')];function createListener(_0x454387,_0x26e0f0){return function(_0x306ae4){_0x26e0f0[_0x7d11('0x4')](_0x454387,_0x306ae4);};}function removeListener(_0x3c07be,_0x31fcb0){return function(){SquareProjectEvents[_0x7d11('0x5')](_0x3c07be,_0x31fcb0);};}exports[_0x7d11('0x6')]=function(_0x27d7e8){for(var _0x40c3c4=0x0,_0x345602=events[_0x7d11('0x7')];_0x40c3c4<_0x345602;_0x40c3c4++){var _0x47b5e6=events[_0x40c3c4];var _0x3803b5=createListener(_0x7d11('0x8')+_0x47b5e6,_0x27d7e8);SquareProjectEvents['on'](_0x47b5e6,_0x3803b5);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index edb5d70..867ea00 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 _0x5f66=['delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','isAuthenticated','index','show','get','/:id/download','download','create','put','/:id'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x5f66,0x1a0));var _0x65f6=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5f66[_0x580576];return _0x3f55a0;};'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']('/:id',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('0xf'),auth[_0x65f6('0x7')](),controller['update']);router[_0x65f6('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x65f6('0x11')]);module['exports']=router; \ No newline at end of file +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(_0x8c6164,_0x1dc7db){var _0x1ca172=function(_0x1c8d48){while(--_0x1c8d48){_0x8c6164['push'](_0x8c6164['shift']());}};_0x1ca172(++_0x1dc7db);}(_0x2ef3,0xba));var _0x32ef=function(_0x1ea796,_0xdeca2){_0x1ea796=_0x1ea796-0x0;var _0x23834e=_0x2ef3[_0x1ea796];return _0x23834e;};'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 diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index d15f16a..cd886b4 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 _0xacd2=['STRING','sequelize'];(function(_0x48baf2,_0x4f3031){var _0x2dd170=function(_0x5a7c9f){while(--_0x5a7c9f){_0x48baf2['push'](_0x48baf2['shift']());}};_0x2dd170(++_0x4f3031);}(_0xacd2,0xc1));var _0x2acd=function(_0x2b3ab0,_0x103ab2){_0x2b3ab0=_0x2b3ab0-0x0;var _0x57733a=_0xacd2[_0x2b3ab0];return _0x57733a;};'use strict';var Sequelize=require(_0x2acd('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2acd('0x1')]},'context':{'type':Sequelize[_0x2acd('0x1')]},'extension':{'type':Sequelize[_0x2acd('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x2acd('0x1')]},'projectName':{'type':Sequelize[_0x2acd('0x1')]},'saveName':{'type':Sequelize[_0x2acd('0x1')]},'filename':{'type':Sequelize[_0x2acd('0x1')]},'savePath':{'type':Sequelize[_0x2acd('0x1')]}}; \ No newline at end of file +var _0x9134=['exports','STRING'];(function(_0x45518f,_0x475a6b){var _0x198175=function(_0x40d333){while(--_0x40d333){_0x45518f['push'](_0x45518f['shift']());}};_0x198175(++_0x475a6b);}(_0x9134,0x1d8));var _0x4913=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9134[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module[_0x4913('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4913('0x1')]},'context':{'type':Sequelize[_0x4913('0x1')]},'extension':{'type':Sequelize[_0x4913('0x1')]},'priority':{'type':Sequelize[_0x4913('0x1')]},'accountcode':{'type':Sequelize[_0x4913('0x1')]},'dnid':{'type':Sequelize[_0x4913('0x1')]},'projectName':{'type':Sequelize[_0x4913('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x4913('0x1')]},'savePath':{'type':Sequelize[_0x4913('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 0004521..e818a76 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 _0xd91e=['../../config/environment','../../mysqldb','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index','SquareRecording','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','map','type','key','field','filter','merge','options','includeAll','rows','catch','params','include','find','create','body','download','../../components/encryptor','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x33a001,_0x1b8605){var _0x30d5a8=function(_0x25dd7c){while(--_0x25dd7c){_0x33a001['push'](_0x33a001['shift']());}};_0x30d5a8(++_0x1b8605);}(_0xd91e,0xf4));var _0xed91=function(_0x4bd476,_0x369f61){_0x4bd476=_0x4bd476-0x0;var _0x1f7561=_0xd91e[_0x4bd476];return _0x1f7561;};'use strict';var pdf=require(_0xed91('0x0'));var emlformat=require(_0xed91('0x1'));var rimraf=require(_0xed91('0x2'));var zipdir=require(_0xed91('0x3'));var jsonpatch=require(_0xed91('0x4'));var rp=require(_0xed91('0x5'));var moment=require(_0xed91('0x6'));var BPromise=require(_0xed91('0x7'));var Mustache=require(_0xed91('0x8'));var util=require(_0xed91('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0xed91('0xa'));var ejs=require(_0xed91('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xed91('0xc'));var crypto=require(_0xed91('0xd'));var jsforce=require(_0xed91('0xe'));var deskjs=require(_0xed91('0xf'));var toCsv=require(_0xed91('0xa'));var querystring=require(_0xed91('0x10'));var Papa=require(_0xed91('0x11'));var Redis=require(_0xed91('0x12'));var authService=require(_0xed91('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xed91('0x14'));var logger=require(_0xed91('0x15'))('api');var utils=require(_0xed91('0x16'));var config=require(_0xed91('0x17'));var db=require(_0xed91('0x18'))['db'];function respondWithStatusCode(_0x71edb8,_0x358680){_0x358680=_0x358680||0xcc;return function(_0x43d8be){if(_0x43d8be){return _0x71edb8['sendStatus'](_0x358680);}return _0x71edb8['status'](_0x358680)[_0xed91('0x19')]();};}function respondWithResult(_0x47c6aa,_0x43a273){_0x43a273=_0x43a273||0xc8;return function(_0x21c6ae){if(_0x21c6ae){return _0x47c6aa[_0xed91('0x1a')](_0x43a273)[_0xed91('0x1b')](_0x21c6ae);}};}function respondWithFilteredResult(_0x5d9d40,_0x195329){return function(_0x377895){if(_0x377895){var _0x461e93=_0x377895[_0xed91('0x1c')],_0x546659=_0x195329[_0xed91('0x1d')],_0x59fc58=_0x195329[_0xed91('0x1d')]+_0x195329['limit'],_0x5be253;if(_0x59fc58>=_0x461e93){_0x59fc58=_0x461e93;_0x5be253=0xc8;}else{_0x5be253=0xce;}_0x5d9d40[_0xed91('0x1a')](_0x5be253);return _0x5d9d40[_0xed91('0x1e')](_0xed91('0x1f'),_0x546659+'-'+_0x59fc58+'/'+_0x461e93)['json'](_0x377895);}return null;};}function patchUpdates(_0x3d6379){return function(_0xd5725e){try{jsonpatch[_0xed91('0x20')](_0xd5725e,_0x3d6379,!![]);}catch(_0x5c394f){return BPromise[_0xed91('0x21')](_0x5c394f);}return _0xd5725e[_0xed91('0x22')]();};}function saveUpdates(_0x71f67d,_0x147fea){return function(_0x988175){if(_0x988175){return _0x988175[_0xed91('0x23')](_0x71f67d)[_0xed91('0x24')](function(_0x32d02c){return _0x32d02c;});}return null;};}function removeEntity(_0x2a8803,_0xb1b11c){return function(_0x3980b1){if(_0x3980b1){return _0x3980b1['destroy']()[_0xed91('0x24')](function(){_0x2a8803[_0xed91('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40585e,_0x599759){return function(_0x3779a2){if(!_0x3779a2){_0x40585e[_0xed91('0x25')](0x194);}return _0x3779a2;};}function handleError(_0x2ca1c2,_0x57716f){_0x57716f=_0x57716f||0x1f4;return function(_0x2f1ace){logger['error'](_0x2f1ace[_0xed91('0x26')]);if(_0x2f1ace[_0xed91('0x27')]){delete _0x2f1ace[_0xed91('0x27')];}_0x2ca1c2['status'](_0x57716f)[_0xed91('0x28')](_0x2f1ace);};}exports[_0xed91('0x29')]=function(_0x35ae3c,_0x181221){var _0x1b4758={},_0x484daf={},_0x10ddf9={'count':0x0,'rows':[]};var _0x2dae8f=db[_0xed91('0x2a')]['rawAttributes'];_0x484daf['model']=_[_0xed91('0x2b')](_0x2dae8f);_0x484daf[_0xed91('0x2c')]=_[_0xed91('0x2b')](_0x35ae3c[_0xed91('0x2c')]);_0x484daf[_0xed91('0x2d')]=_[_0xed91('0x2e')](_0x484daf[_0xed91('0x2f')],_0x484daf[_0xed91('0x2c')]);_0x1b4758[_0xed91('0x30')]=_[_0xed91('0x2e')](_0x484daf[_0xed91('0x2f')],qs[_0xed91('0x31')](_0x35ae3c[_0xed91('0x2c')][_0xed91('0x31')]));_0x1b4758[_0xed91('0x30')]=_0x1b4758[_0xed91('0x30')][_0xed91('0x32')]?_0x1b4758[_0xed91('0x30')]:_0x484daf['model'];if(!_0x35ae3c['query'][_0xed91('0x33')](_0xed91('0x34'))){_0x1b4758[_0xed91('0x35')]=qs[_0xed91('0x35')](_0x35ae3c[_0xed91('0x2c')][_0xed91('0x35')]);_0x1b4758[_0xed91('0x1d')]=qs[_0xed91('0x1d')](_0x35ae3c[_0xed91('0x2c')][_0xed91('0x1d')]);}_0x1b4758[_0xed91('0x36')]=qs[_0xed91('0x37')](_0x35ae3c[_0xed91('0x2c')]['sort']);_0x1b4758[_0xed91('0x38')]=qs[_0xed91('0x2d')](_[_0xed91('0x39')](_0x35ae3c['query'],_0x484daf[_0xed91('0x2d')]));if(_0x35ae3c[_0xed91('0x2c')]['filter']){_0x1b4758['where']=_['merge'](_0x1b4758['where'],{'$or':_[_0xed91('0x3a')](_0x2dae8f,function(_0x504137){if(_0x504137[_0xed91('0x3b')][_0xed91('0x3c')]!=='VIRTUAL'){var _0x218a7d={};_0x218a7d[_0x504137[_0xed91('0x3d')]]={'$like':'%'+_0x35ae3c['query'][_0xed91('0x3e')]+'%'};return _0x218a7d;}})});}_0x1b4758=_[_0xed91('0x3f')]({},_0x1b4758,_0x35ae3c[_0xed91('0x40')]);var _0x13b1a8={'where':_0x1b4758[_0xed91('0x38')]};return db[_0xed91('0x2a')][_0xed91('0x1c')](_0x13b1a8)[_0xed91('0x24')](function(_0x5adbed){_0x10ddf9['count']=_0x5adbed;if(_0x35ae3c[_0xed91('0x2c')][_0xed91('0x41')]){_0x1b4758['include']=[{'all':!![]}];}return db[_0xed91('0x2a')]['findAll'](_0x1b4758);})[_0xed91('0x24')](function(_0x10cd45){_0x10ddf9[_0xed91('0x42')]=_0x10cd45;return _0x10ddf9;})[_0xed91('0x24')](respondWithFilteredResult(_0x181221,_0x1b4758))[_0xed91('0x43')](handleError(_0x181221,null));};exports['show']=function(_0x395f26,_0x416711){var _0x50befa={'raw':!![],'where':{'id':_0x395f26[_0xed91('0x44')]['id']}},_0x20e545={};_0x20e545['model']=_['keys'](db[_0xed91('0x2a')]['rawAttributes']);_0x20e545[_0xed91('0x2c')]=_[_0xed91('0x2b')](_0x395f26[_0xed91('0x2c')]);_0x20e545[_0xed91('0x2d')]=_['intersection'](_0x20e545['model'],_0x20e545['query']);_0x50befa[_0xed91('0x30')]=_[_0xed91('0x2e')](_0x20e545[_0xed91('0x2f')],qs[_0xed91('0x31')](_0x395f26['query']['fields']));_0x50befa['attributes']=_0x50befa[_0xed91('0x30')][_0xed91('0x32')]?_0x50befa[_0xed91('0x30')]:_0x20e545['model'];if(_0x395f26[_0xed91('0x2c')][_0xed91('0x41')]){_0x50befa[_0xed91('0x45')]=[{'all':!![]}];}_0x50befa=_['merge']({},_0x50befa,_0x395f26[_0xed91('0x40')]);return db[_0xed91('0x2a')][_0xed91('0x46')](_0x50befa)[_0xed91('0x24')](handleEntityNotFound(_0x416711,null))[_0xed91('0x24')](respondWithResult(_0x416711,null))['catch'](handleError(_0x416711,null));};exports[_0xed91('0x47')]=function(_0x175bf7,_0x10ee22){return db[_0xed91('0x2a')][_0xed91('0x47')](_0x175bf7['body'],{})[_0xed91('0x24')](respondWithResult(_0x10ee22,0xc9))[_0xed91('0x43')](handleError(_0x10ee22,null));};exports[_0xed91('0x23')]=function(_0x4244a5,_0x28c1d8){if(_0x4244a5[_0xed91('0x48')]['id']){delete _0x4244a5[_0xed91('0x48')]['id'];}return db[_0xed91('0x2a')][_0xed91('0x46')]({'where':{'id':_0x4244a5[_0xed91('0x44')]['id']}})[_0xed91('0x24')](handleEntityNotFound(_0x28c1d8,null))[_0xed91('0x24')](saveUpdates(_0x4244a5[_0xed91('0x48')],null))[_0xed91('0x24')](respondWithResult(_0x28c1d8,null))[_0xed91('0x43')](handleError(_0x28c1d8,null));};exports['destroy']=function(_0x53d552,_0x9bb239){return db['SquareRecording'][_0xed91('0x46')]({'where':{'id':_0x53d552[_0xed91('0x44')]['id']}})[_0xed91('0x24')](handleEntityNotFound(_0x9bb239,null))[_0xed91('0x24')](removeEntity(_0x9bb239,null))[_0xed91('0x43')](handleError(_0x9bb239,null));};exports[_0xed91('0x49')]=function(_0x19fed5,_0x441cee,_0x1ede4f){var _0x261dfb=require(_0xed91('0x4a'));var _0x38f3e0=![];var _0x5c3669={};if(_0x19fed5[_0xed91('0x2c')][_0xed91('0x3b')]&&_0x19fed5[_0xed91('0x2c')][_0xed91('0x3b')]==='uniqueid'){_0x5c3669['uniqueid']=_0x19fed5['params']['id'];}else{_0x5c3669['id']=_0x19fed5[_0xed91('0x44')]['id'];}return db[_0xed91('0x2a')]['find']({'where':_0x5c3669,'attributes':['id',_0xed91('0x4b'),_0xed91('0x4c')],'raw':!![]})[_0xed91('0x24')](handleEntityNotFound(_0x441cee,null))[_0xed91('0x24')](function(_0xed7ae1){if(_0xed7ae1){var _0x507ce8=_0xed7ae1[_0xed91('0x4b')];var _0x96f128=util[_0xed91('0x4d')](_0xed91('0x4e'),_0x507ce8);if(fs[_0xed91('0x4f')](_0x96f128)){_0x38f3e0=!![];return _0x261dfb[_0xed91('0x50')](_0x96f128,_0x507ce8,config[_0xed91('0x51')][_0xed91('0x52')])[_0xed91('0x24')](function(){return _0xed7ae1;});}return _0xed7ae1;}})[_0xed91('0x24')](function(_0x399b55){if(_0x399b55){var _0x4638ba=_0x399b55[_0xed91('0x4b')];if(!fs[_0xed91('0x4f')](_0x4638ba)){throw new db['Sequelize'][(_0xed91('0x53'))](_0xed91('0x54'));}if(_0x399b55[_0xed91('0x4c')]){return _0x441cee['download'](_0x4638ba,_0x399b55[_0xed91('0x4c')]+path[_0xed91('0x55')](_0x4638ba),function(){if(_0x38f3e0){fs['unlink'](_0x4638ba);}});}else{return _0x441cee[_0xed91('0x49')](_0x4638ba,function(_0x61fdef){if(_0x38f3e0){fs[_0xed91('0x56')](_0x4638ba);}});}}})['catch'](function(_0x1d1838){if(_0x1d1838[_0xed91('0x57')]===_0xed91('0x54')){_0x441cee[_0xed91('0x1a')](0x194)['send'](_0xed91('0x58'));}else{return handleError(_0x441cee,null);}});}; \ No newline at end of file +var _0x0fbf=['mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','SquareRecording','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','key','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','download','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x194cc4,_0x2b414f){var _0x2cac22=function(_0xbed810){while(--_0xbed810){_0x194cc4['push'](_0x194cc4['shift']());}};_0x2cac22(++_0x2b414f);}(_0x0fbf,0xf7));var _0xf0fb=function(_0x498961,_0x1cb0d2){_0x498961=_0x498961-0x0;var _0x49a415=_0x0fbf[_0x498961];return _0x49a415;};'use strict';var pdf=require(_0xf0fb('0x0'));var emlformat=require(_0xf0fb('0x1'));var rimraf=require(_0xf0fb('0x2'));var zipdir=require(_0xf0fb('0x3'));var jsonpatch=require(_0xf0fb('0x4'));var rp=require(_0xf0fb('0x5'));var moment=require(_0xf0fb('0x6'));var BPromise=require(_0xf0fb('0x7'));var Mustache=require(_0xf0fb('0x8'));var util=require(_0xf0fb('0x9'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf0fb('0xa'));var fs=require('fs');var _=require(_0xf0fb('0xb'));var squel=require(_0xf0fb('0xc'));var crypto=require(_0xf0fb('0xd'));var jsforce=require(_0xf0fb('0xe'));var deskjs=require(_0xf0fb('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf0fb('0x10'));var authService=require(_0xf0fb('0x11'));var qs=require(_0xf0fb('0x12'));var hardwareService=require(_0xf0fb('0x13'));var logger=require(_0xf0fb('0x14'))('api');var utils=require(_0xf0fb('0x15'));var config=require(_0xf0fb('0x16'));var db=require(_0xf0fb('0x17'))['db'];function respondWithStatusCode(_0x355b5a,_0x176a9d){_0x176a9d=_0x176a9d||0xcc;return function(_0x51803e){if(_0x51803e){return _0x355b5a[_0xf0fb('0x18')](_0x176a9d);}return _0x355b5a[_0xf0fb('0x19')](_0x176a9d)['end']();};}function respondWithResult(_0x19657e,_0x242051){_0x242051=_0x242051||0xc8;return function(_0x2835ba){if(_0x2835ba){return _0x19657e[_0xf0fb('0x19')](_0x242051)[_0xf0fb('0x1a')](_0x2835ba);}};}function respondWithFilteredResult(_0x1f1a6e,_0x3da15b){return function(_0x21c172){if(_0x21c172){var _0x5ce1a1=_0x21c172['count'],_0x205e46=_0x3da15b[_0xf0fb('0x1b')],_0x44c6f8=_0x3da15b[_0xf0fb('0x1b')]+_0x3da15b[_0xf0fb('0x1c')],_0x11662e;if(_0x44c6f8>=_0x5ce1a1){_0x44c6f8=_0x5ce1a1;_0x11662e=0xc8;}else{_0x11662e=0xce;}_0x1f1a6e[_0xf0fb('0x19')](_0x11662e);return _0x1f1a6e[_0xf0fb('0x1d')](_0xf0fb('0x1e'),_0x205e46+'-'+_0x44c6f8+'/'+_0x5ce1a1)['json'](_0x21c172);}return null;};}function patchUpdates(_0x3eede7){return function(_0x41082d){try{jsonpatch[_0xf0fb('0x1f')](_0x41082d,_0x3eede7,!![]);}catch(_0x137937){return BPromise['reject'](_0x137937);}return _0x41082d[_0xf0fb('0x20')]();};}function saveUpdates(_0x27db09,_0x2a403b){return function(_0x50cefa){if(_0x50cefa){return _0x50cefa[_0xf0fb('0x21')](_0x27db09)[_0xf0fb('0x22')](function(_0x1a7548){return _0x1a7548;});}return null;};}function removeEntity(_0x35afb1,_0x201151){return function(_0x3d8a51){if(_0x3d8a51){return _0x3d8a51[_0xf0fb('0x23')]()['then'](function(){_0x35afb1[_0xf0fb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x285957,_0x471c5b){return function(_0x516145){if(!_0x516145){_0x285957[_0xf0fb('0x18')](0x194);}return _0x516145;};}function handleError(_0x25f817,_0x13b1b5){_0x13b1b5=_0x13b1b5||0x1f4;return function(_0xc9dc6d){logger['error'](_0xc9dc6d[_0xf0fb('0x24')]);if(_0xc9dc6d['name']){delete _0xc9dc6d[_0xf0fb('0x25')];}_0x25f817[_0xf0fb('0x19')](_0x13b1b5)[_0xf0fb('0x26')](_0xc9dc6d);};}exports[_0xf0fb('0x27')]=function(_0x2f8f64,_0xff61d9){var _0x45e873={},_0x355ffc={},_0x203510={'count':0x0,'rows':[]};var _0x2c01c0=db[_0xf0fb('0x28')][_0xf0fb('0x29')];_0x355ffc[_0xf0fb('0x2a')]=_[_0xf0fb('0x2b')](_0x2c01c0);_0x355ffc['query']=_[_0xf0fb('0x2b')](_0x2f8f64[_0xf0fb('0x2c')]);_0x355ffc[_0xf0fb('0x2d')]=_[_0xf0fb('0x2e')](_0x355ffc[_0xf0fb('0x2a')],_0x355ffc['query']);_0x45e873[_0xf0fb('0x2f')]=_[_0xf0fb('0x2e')](_0x355ffc[_0xf0fb('0x2a')],qs[_0xf0fb('0x30')](_0x2f8f64[_0xf0fb('0x2c')][_0xf0fb('0x30')]));_0x45e873[_0xf0fb('0x2f')]=_0x45e873[_0xf0fb('0x2f')][_0xf0fb('0x31')]?_0x45e873[_0xf0fb('0x2f')]:_0x355ffc[_0xf0fb('0x2a')];if(!_0x2f8f64[_0xf0fb('0x2c')]['hasOwnProperty'](_0xf0fb('0x32'))){_0x45e873['limit']=qs[_0xf0fb('0x1c')](_0x2f8f64[_0xf0fb('0x2c')]['limit']);_0x45e873[_0xf0fb('0x1b')]=qs[_0xf0fb('0x1b')](_0x2f8f64['query'][_0xf0fb('0x1b')]);}_0x45e873[_0xf0fb('0x33')]=qs[_0xf0fb('0x34')](_0x2f8f64['query'][_0xf0fb('0x34')]);_0x45e873[_0xf0fb('0x35')]=qs[_0xf0fb('0x2d')](_['pick'](_0x2f8f64[_0xf0fb('0x2c')],_0x355ffc[_0xf0fb('0x2d')]));if(_0x2f8f64[_0xf0fb('0x2c')][_0xf0fb('0x36')]){_0x45e873[_0xf0fb('0x35')]=_[_0xf0fb('0x37')](_0x45e873[_0xf0fb('0x35')],{'$or':_[_0xf0fb('0x38')](_0x2c01c0,function(_0x25fa22){if(_0x25fa22['type'][_0xf0fb('0x39')]!=='VIRTUAL'){var _0xe840d7={};_0xe840d7[_0x25fa22['field']]={'$like':'%'+_0x2f8f64['query']['filter']+'%'};return _0xe840d7;}})});}_0x45e873=_[_0xf0fb('0x37')]({},_0x45e873,_0x2f8f64['options']);var _0xfeeac={'where':_0x45e873[_0xf0fb('0x35')]};return db[_0xf0fb('0x28')][_0xf0fb('0x3a')](_0xfeeac)[_0xf0fb('0x22')](function(_0x559cf5){_0x203510[_0xf0fb('0x3a')]=_0x559cf5;if(_0x2f8f64[_0xf0fb('0x2c')][_0xf0fb('0x3b')]){_0x45e873[_0xf0fb('0x3c')]=[{'all':!![]}];}return db['SquareRecording'][_0xf0fb('0x3d')](_0x45e873);})[_0xf0fb('0x22')](function(_0x39cf42){_0x203510[_0xf0fb('0x3e')]=_0x39cf42;return _0x203510;})[_0xf0fb('0x22')](respondWithFilteredResult(_0xff61d9,_0x45e873))[_0xf0fb('0x3f')](handleError(_0xff61d9,null));};exports[_0xf0fb('0x40')]=function(_0x28f95c,_0x19e865){var _0x43dd99={'raw':!![],'where':{'id':_0x28f95c[_0xf0fb('0x41')]['id']}},_0x305161={};_0x305161[_0xf0fb('0x2a')]=_[_0xf0fb('0x2b')](db[_0xf0fb('0x28')][_0xf0fb('0x29')]);_0x305161[_0xf0fb('0x2c')]=_[_0xf0fb('0x2b')](_0x28f95c['query']);_0x305161[_0xf0fb('0x2d')]=_[_0xf0fb('0x2e')](_0x305161['model'],_0x305161[_0xf0fb('0x2c')]);_0x43dd99[_0xf0fb('0x2f')]=_[_0xf0fb('0x2e')](_0x305161['model'],qs[_0xf0fb('0x30')](_0x28f95c['query'][_0xf0fb('0x30')]));_0x43dd99[_0xf0fb('0x2f')]=_0x43dd99[_0xf0fb('0x2f')]['length']?_0x43dd99[_0xf0fb('0x2f')]:_0x305161['model'];if(_0x28f95c[_0xf0fb('0x2c')][_0xf0fb('0x3b')]){_0x43dd99[_0xf0fb('0x3c')]=[{'all':!![]}];}_0x43dd99=_['merge']({},_0x43dd99,_0x28f95c[_0xf0fb('0x42')]);return db[_0xf0fb('0x28')][_0xf0fb('0x43')](_0x43dd99)['then'](handleEntityNotFound(_0x19e865,null))['then'](respondWithResult(_0x19e865,null))[_0xf0fb('0x3f')](handleError(_0x19e865,null));};exports[_0xf0fb('0x44')]=function(_0x5e5b2d,_0x41a84a){return db['SquareRecording'][_0xf0fb('0x44')](_0x5e5b2d['body'],{})['then'](respondWithResult(_0x41a84a,0xc9))[_0xf0fb('0x3f')](handleError(_0x41a84a,null));};exports[_0xf0fb('0x21')]=function(_0x4774b9,_0x1f875d){if(_0x4774b9[_0xf0fb('0x45')]['id']){delete _0x4774b9[_0xf0fb('0x45')]['id'];}return db[_0xf0fb('0x28')][_0xf0fb('0x43')]({'where':{'id':_0x4774b9[_0xf0fb('0x41')]['id']}})[_0xf0fb('0x22')](handleEntityNotFound(_0x1f875d,null))['then'](saveUpdates(_0x4774b9[_0xf0fb('0x45')],null))['then'](respondWithResult(_0x1f875d,null))['catch'](handleError(_0x1f875d,null));};exports[_0xf0fb('0x23')]=function(_0x17fc42,_0x48059c){return db[_0xf0fb('0x28')][_0xf0fb('0x43')]({'where':{'id':_0x17fc42['params']['id']}})[_0xf0fb('0x22')](handleEntityNotFound(_0x48059c,null))[_0xf0fb('0x22')](removeEntity(_0x48059c,null))[_0xf0fb('0x3f')](handleError(_0x48059c,null));};exports[_0xf0fb('0x46')]=function(_0x534ebe,_0x1c69d7,_0x422209){var _0x1a20be=require('../../components/encryptor');var _0x34975f=![];var _0x2caad6={};if(_0x534ebe[_0xf0fb('0x2c')]['type']&&_0x534ebe['query']['type']===_0xf0fb('0x47')){_0x2caad6[_0xf0fb('0x47')]=_0x534ebe['params']['id'];}else{_0x2caad6['id']=_0x534ebe[_0xf0fb('0x41')]['id'];}return db[_0xf0fb('0x28')][_0xf0fb('0x43')]({'where':_0x2caad6,'attributes':['id','savePath',_0xf0fb('0x48')],'raw':!![]})[_0xf0fb('0x22')](handleEntityNotFound(_0x1c69d7,null))[_0xf0fb('0x22')](function(_0x2e84dd){if(_0x2e84dd){var _0x19001c=_0x2e84dd[_0xf0fb('0x49')];var _0x915d23=util[_0xf0fb('0x4a')](_0xf0fb('0x4b'),_0x19001c);if(fs[_0xf0fb('0x4c')](_0x915d23)){_0x34975f=!![];return _0x1a20be[_0xf0fb('0x4d')](_0x915d23,_0x19001c,config[_0xf0fb('0x4e')]['recording'])[_0xf0fb('0x22')](function(){return _0x2e84dd;});}return _0x2e84dd;}})['then'](function(_0x59a10c){if(_0x59a10c){var _0x242ed5=_0x59a10c[_0xf0fb('0x49')];if(!fs[_0xf0fb('0x4c')](_0x242ed5)){throw new db[(_0xf0fb('0x4f'))][(_0xf0fb('0x50'))]('SquareRecording\x20not\x20found');}if(_0x59a10c[_0xf0fb('0x48')]){return _0x1c69d7[_0xf0fb('0x46')](_0x242ed5,_0x59a10c[_0xf0fb('0x48')]+path[_0xf0fb('0x51')](_0x242ed5),function(){if(_0x34975f){fs[_0xf0fb('0x52')](_0x242ed5);}});}else{return _0x1c69d7[_0xf0fb('0x46')](_0x242ed5,function(_0x2e8b61){if(_0x34975f){fs[_0xf0fb('0x52')](_0x242ed5);}});}}})[_0xf0fb('0x3f')](function(_0x38207e){if(_0x38207e[_0xf0fb('0x53')]===_0xf0fb('0x54')){_0x1c69d7[_0xf0fb('0x19')](0x194)[_0xf0fb('0x26')]('Not\x20found');}else{return handleError(_0x1c69d7,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index e96a368..ca03f64 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 _0x7269=['../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util'];(function(_0x58f784,_0x594d3e){var _0x20c67f=function(_0x394cf6){while(--_0x394cf6){_0x58f784['push'](_0x58f784['shift']());}};_0x20c67f(++_0x594d3e);}(_0x7269,0x76));var _0x9726=function(_0x5e8ae6,_0x369ee7){_0x5e8ae6=_0x5e8ae6-0x0;var _0x326fa7=_0x7269[_0x5e8ae6];return _0x326fa7;};'use strict';var _=require(_0x9726('0x0'));var util=require(_0x9726('0x1'));var logger=require(_0x9726('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9726('0x3'));var rp=require(_0x9726('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9726('0x5'));var config=require(_0x9726('0x6'));var attributes=require(_0x9726('0x7'));module[_0x9726('0x8')]=function(_0x795889,_0x832cb){return _0x795889[_0x9726('0x9')](_0x9726('0xa'),attributes,{'tableName':_0x9726('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fad=['request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5a9aa7,_0x55b38f){var _0x298adf=function(_0x2643d4){while(--_0x2643d4){_0x5a9aa7['push'](_0x5a9aa7['shift']());}};_0x298adf(++_0x55b38f);}(_0x4fad,0xcb));var _0xd4fa=function(_0x34047a,_0xa4e9e0){_0x34047a=_0x34047a-0x0;var _0x3b0152=_0x4fad[_0x34047a];return _0x3b0152;};'use strict';var _=require(_0xd4fa('0x0'));var util=require(_0xd4fa('0x1'));var logger=require(_0xd4fa('0x2'))('api');var moment=require(_0xd4fa('0x3'));var BPromise=require(_0xd4fa('0x4'));var rp=require(_0xd4fa('0x5'));var fs=require('fs');var path=require(_0xd4fa('0x6'));var rimraf=require(_0xd4fa('0x7'));var config=require(_0xd4fa('0x8'));var attributes=require(_0xd4fa('0x9'));module[_0xd4fa('0xa')]=function(_0x597fbe,_0x2d4e07){return _0x597fbe['define'](_0xd4fa('0xb'),attributes,{'tableName':_0xd4fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 33d18ab..54a5dd1 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 _0x751e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','error','message','result','CreateSquareRecording','create','options','raw','stringify','catch','moment','bluebird'];(function(_0x24cee5,_0xa584b2){var _0x1139bd=function(_0x4f3f28){while(--_0x4f3f28){_0x24cee5['push'](_0x24cee5['shift']());}};_0x1139bd(++_0xa584b2);}(_0x751e,0xdf));var _0xe751=function(_0x3a5e60,_0x2b8875){_0x3a5e60=_0x3a5e60-0x0;var _0x5a3636=_0x751e[_0x3a5e60];return _0x5a3636;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe751('0x0'));var BPromise=require(_0xe751('0x1'));var rs=require(_0xe751('0x2'));var fs=require('fs');var Redis=require(_0xe751('0x3'));var db=require(_0xe751('0x4'))['db'];var utils=require(_0xe751('0x5'));var logger=require(_0xe751('0x6'))('rpc');var config=require(_0xe751('0x7'));var jayson=require(_0xe751('0x8'));var client=jayson[_0xe751('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4216df,_0x595638,_0x5b418d){return new BPromise(function(_0x3f9395,_0x57ac4f){return client[_0xe751('0xa')](_0x4216df,_0x5b418d)[_0xe751('0xb')](function(_0x38f7b5){logger[_0xe751('0xc')](_0xe751('0xd'),_0x595638,_0xe751('0xe'));logger[_0xe751('0xf')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x595638,_0xe751('0xe'),JSON['stringify'](_0x38f7b5));if(_0x38f7b5[_0xe751('0x10')]){if(_0x38f7b5[_0xe751('0x10')]['code']===0x1f4){logger[_0xe751('0x10')](_0xe751('0xd'),_0x595638,_0x38f7b5[_0xe751('0x10')][_0xe751('0x11')]);return _0x57ac4f(_0x38f7b5[_0xe751('0x10')][_0xe751('0x11')]);}logger[_0xe751('0x10')](_0xe751('0xd'),_0x595638,_0x38f7b5['error'][_0xe751('0x11')]);return _0x3f9395(_0x38f7b5[_0xe751('0x10')][_0xe751('0x11')]);}else{logger[_0xe751('0xc')](_0xe751('0xd'),_0x595638,_0xe751('0xe'));_0x3f9395(_0x38f7b5[_0xe751('0x12')][_0xe751('0x11')]);}})['catch'](function(_0x4c0a7d){logger[_0xe751('0x10')]('SquareRecording,\x20%s,\x20%s',_0x595638,_0x4c0a7d);_0x57ac4f(_0x4c0a7d);});});}exports[_0xe751('0x13')]=function(_0x5b9eee){var _0x507fc7=this;return new Promise(function(_0x3de4a5,_0x399749){return db['SquareRecording'][_0xe751('0x14')](_0x5b9eee['body'],{'raw':_0x5b9eee[_0xe751('0x15')]?_0x5b9eee['options'][_0xe751('0x16')]===undefined?!![]:![]:!![]})[_0xe751('0xb')](function(_0x39960d){logger['info'](_0xe751('0x13'),_0x5b9eee);logger[_0xe751('0xf')]('CreateSquareRecording',_0x5b9eee,JSON[_0xe751('0x17')](_0x39960d));_0x3de4a5(_0x39960d);})[_0xe751('0x18')](function(_0x5c9282){logger[_0xe751('0x10')](_0xe751('0x13'),_0x5c9282[_0xe751('0x11')],_0x5b9eee);_0x399749(_0x507fc7[_0xe751('0x10')](0x1f4,_0x5c9282[_0xe751('0x11')]));});});}; \ No newline at end of file +var _0xc4db=['then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','debug','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x2377a3,_0x7b4522){var _0x538284=function(_0x8c6a36){while(--_0x8c6a36){_0x2377a3['push'](_0x2377a3['shift']());}};_0x538284(++_0x7b4522);}(_0xc4db,0xb3));var _0xbc4d=function(_0x265003,_0xf0f023){_0x265003=_0x265003-0x0;var _0x33c743=_0xc4db[_0x265003];return _0x33c743;};'use strict';var _=require(_0xbc4d('0x0'));var util=require(_0xbc4d('0x1'));var moment=require(_0xbc4d('0x2'));var BPromise=require('bluebird');var rs=require(_0xbc4d('0x3'));var fs=require('fs');var Redis=require(_0xbc4d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbc4d('0x5'))(_0xbc4d('0x6'));var config=require('../../config/environment');var jayson=require(_0xbc4d('0x7'));var client=jayson[_0xbc4d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3193b4,_0x360191,_0x14afa7){return new BPromise(function(_0x2f32f8,_0xd6396c){return client[_0xbc4d('0x9')](_0x3193b4,_0x14afa7)[_0xbc4d('0xa')](function(_0x87c3e1){logger[_0xbc4d('0xb')](_0xbc4d('0xc'),_0x360191,_0xbc4d('0xd'));logger['debug'](_0xbc4d('0xe'),_0x360191,_0xbc4d('0xd'),JSON[_0xbc4d('0xf')](_0x87c3e1));if(_0x87c3e1['error']){if(_0x87c3e1[_0xbc4d('0x10')]['code']===0x1f4){logger[_0xbc4d('0x10')]('SquareRecording,\x20%s,\x20%s',_0x360191,_0x87c3e1['error'][_0xbc4d('0x11')]);return _0xd6396c(_0x87c3e1[_0xbc4d('0x10')]['message']);}logger[_0xbc4d('0x10')](_0xbc4d('0xc'),_0x360191,_0x87c3e1[_0xbc4d('0x10')][_0xbc4d('0x11')]);return _0x2f32f8(_0x87c3e1[_0xbc4d('0x10')][_0xbc4d('0x11')]);}else{logger[_0xbc4d('0xb')](_0xbc4d('0xc'),_0x360191,_0xbc4d('0xd'));_0x2f32f8(_0x87c3e1[_0xbc4d('0x12')][_0xbc4d('0x11')]);}})[_0xbc4d('0x13')](function(_0x13c380){logger[_0xbc4d('0x10')](_0xbc4d('0xc'),_0x360191,_0x13c380);_0xd6396c(_0x13c380);});});}exports[_0xbc4d('0x14')]=function(_0x5579e8){var _0x2d89f7=this;return new Promise(function(_0x434365,_0x144313){return db[_0xbc4d('0x15')][_0xbc4d('0x16')](_0x5579e8[_0xbc4d('0x17')],{'raw':_0x5579e8[_0xbc4d('0x18')]?_0x5579e8[_0xbc4d('0x18')][_0xbc4d('0x19')]===undefined?!![]:![]:!![]})[_0xbc4d('0xa')](function(_0x54e25a){logger[_0xbc4d('0xb')](_0xbc4d('0x14'),_0x5579e8);logger[_0xbc4d('0x1a')](_0xbc4d('0x14'),_0x5579e8,JSON[_0xbc4d('0xf')](_0x54e25a));_0x434365(_0x54e25a);})[_0xbc4d('0x13')](function(_0x190dca){logger[_0xbc4d('0x10')](_0xbc4d('0x14'),_0x190dca[_0xbc4d('0x11')],_0x5579e8);_0x144313(_0x2d89f7[_0xbc4d('0x10')](0x1f4,_0x190dca[_0xbc4d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index b7355db..088a04e 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 _0x06a3=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','describe','create','put','/:id','update','destroy','exports','multer','util'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x06a3,0xa9));var _0x306a=function(_0x4066c2,_0xad48e8){_0x4066c2=_0x4066c2-0x0;var _0x3870a0=_0x06a3[_0x4066c2];return _0x3870a0;};'use strict';var multer=require(_0x306a('0x0'));var util=require(_0x306a('0x1'));var path=require(_0x306a('0x2'));var timeout=require(_0x306a('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x306a('0x4'));var interaction=require(_0x306a('0x5'));var config=require(_0x306a('0x6'));var controller=require(_0x306a('0x7'));router[_0x306a('0x8')]('/',auth[_0x306a('0x9')](),controller[_0x306a('0xa')]);router[_0x306a('0x8')](_0x306a('0xb'),auth['isAuthenticated'](),controller[_0x306a('0xc')]);router[_0x306a('0x8')]('/:id',auth[_0x306a('0x9')](),controller['show']);router['post']('/',auth[_0x306a('0x9')](),controller[_0x306a('0xd')]);router[_0x306a('0xe')](_0x306a('0xf'),auth['isAuthenticated'](),controller[_0x306a('0x10')]);router['delete'](_0x306a('0xf'),auth[_0x306a('0x9')](),controller[_0x306a('0x11')]);module[_0x306a('0x12')]=router; \ No newline at end of file +var _0xcb83=['delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post','isAuthenticated','create','put','/:id','update'];(function(_0x2ee790,_0x5a8661){var _0x5a54a5=function(_0x2713a4){while(--_0x2713a4){_0x2ee790['push'](_0x2ee790['shift']());}};_0x5a54a5(++_0x5a8661);}(_0xcb83,0x17c));var _0x3cb8=function(_0x42ef7d,_0x1058ad){_0x42ef7d=_0x42ef7d-0x0;var _0x767bf7=_0xcb83[_0x42ef7d];return _0x767bf7;};'use strict';var multer=require(_0x3cb8('0x0'));var util=require(_0x3cb8('0x1'));var path=require(_0x3cb8('0x2'));var timeout=require(_0x3cb8('0x3'));var express=require('express');var router=express[_0x3cb8('0x4')]();var auth=require(_0x3cb8('0x5'));var interaction=require(_0x3cb8('0x6'));var config=require(_0x3cb8('0x7'));var controller=require(_0x3cb8('0x8'));router[_0x3cb8('0x9')]('/',auth['isAuthenticated'](),controller[_0x3cb8('0xa')]);router[_0x3cb8('0x9')](_0x3cb8('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x3cb8('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3cb8('0xc')]);router[_0x3cb8('0xd')]('/',auth[_0x3cb8('0xe')](),controller[_0x3cb8('0xf')]);router[_0x3cb8('0x10')](_0x3cb8('0x11'),auth[_0x3cb8('0xe')](),controller[_0x3cb8('0x12')]);router[_0x3cb8('0x13')](_0x3cb8('0x11'),auth['isAuthenticated'](),controller[_0x3cb8('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index f6e8b1f..88b3b9a 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 _0xc426=['exports','STRING','DATE','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc426,0x7b));var _0x6c42=function(_0x23e746,_0x25d80e){_0x23e746=_0x23e746-0x0;var _0x474e90=_0xc426[_0x23e746];return _0x474e90;};'use strict';var Sequelize=require(_0x6c42('0x0'));module[_0x6c42('0x1')]={'network':{'type':Sequelize[_0x6c42('0x2')]},'network_script':{'type':Sequelize[_0x6c42('0x2')]},'request':{'type':Sequelize[_0x6c42('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x6c42('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x6c42('0x2')]},'callerid':{'type':Sequelize[_0x6c42('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x6c42('0x2')]},'callingani2':{'type':Sequelize[_0x6c42('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x6c42('0x2')]},'dnid':{'type':Sequelize[_0x6c42('0x2')]},'rdnis':{'type':Sequelize[_0x6c42('0x2')]},'context':{'type':Sequelize[_0x6c42('0x2')]},'extension':{'type':Sequelize[_0x6c42('0x2')]},'priority':{'type':Sequelize[_0x6c42('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x6c42('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6c42('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xbdfa=['sequelize','STRING','DATE'];(function(_0x4f70ce,_0x115a56){var _0x5a0cc3=function(_0x3533bb){while(--_0x3533bb){_0x4f70ce['push'](_0x4f70ce['shift']());}};_0x5a0cc3(++_0x115a56);}(_0xbdfa,0x108));var _0xabdf=function(_0x576059,_0x1e7d7a){_0x576059=_0x576059-0x0;var _0x5c5530=_0xbdfa[_0x576059];return _0x5c5530;};'use strict';var Sequelize=require(_0xabdf('0x0'));module['exports']={'network':{'type':Sequelize[_0xabdf('0x1')]},'network_script':{'type':Sequelize[_0xabdf('0x1')]},'request':{'type':Sequelize[_0xabdf('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xabdf('0x1')]},'type':{'type':Sequelize[_0xabdf('0x1')]},'uniqueid':{'type':Sequelize[_0xabdf('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xabdf('0x1')]},'calleridname':{'type':Sequelize[_0xabdf('0x1')]},'callingpres':{'type':Sequelize[_0xabdf('0x1')]},'callingani2':{'type':Sequelize[_0xabdf('0x1')]},'callington':{'type':Sequelize[_0xabdf('0x1')]},'callingtns':{'type':Sequelize[_0xabdf('0x1')]},'dnid':{'type':Sequelize[_0xabdf('0x1')]},'rdnis':{'type':Sequelize[_0xabdf('0x1')]},'context':{'type':Sequelize[_0xabdf('0x1')]},'extension':{'type':Sequelize[_0xabdf('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xabdf('0x1')]},'accountcode':{'type':Sequelize[_0xabdf('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xabdf('0x2')]},'leaveAt':{'type':Sequelize[_0xabdf('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 3ca3cb8..da76177 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 _0x90fa=['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','sendStatus','status','end','json','count','offset','apply','reject','save','update','then','destroy','name','send','index','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','SquareReport','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x90fa,0x1aa));var _0xa90f=function(_0x5f29b3,_0x28d66e){_0x5f29b3=_0x5f29b3-0x0;var _0x1f71cd=_0x90fa[_0x5f29b3];return _0x1f71cd;};'use strict';var pdf=require(_0xa90f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa90f('0x1'));var jsonpatch=require(_0xa90f('0x2'));var rp=require(_0xa90f('0x3'));var moment=require(_0xa90f('0x4'));var BPromise=require(_0xa90f('0x5'));var Mustache=require(_0xa90f('0x6'));var util=require(_0xa90f('0x7'));var path=require(_0xa90f('0x8'));var sox=require('sox');var csv=require(_0xa90f('0x9'));var ejs=require(_0xa90f('0xa'));var fs=require('fs');var _=require(_0xa90f('0xb'));var squel=require(_0xa90f('0xc'));var crypto=require(_0xa90f('0xd'));var jsforce=require(_0xa90f('0xe'));var deskjs=require(_0xa90f('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa90f('0x10'));var Redis=require(_0xa90f('0x11'));var authService=require(_0xa90f('0x12'));var qs=require(_0xa90f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa90f('0x14'));var utils=require(_0xa90f('0x15'));var config=require(_0xa90f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d7894,_0x3b2bb2){_0x3b2bb2=_0x3b2bb2||0xcc;return function(_0x42da4e){if(_0x42da4e){return _0x3d7894[_0xa90f('0x17')](_0x3b2bb2);}return _0x3d7894[_0xa90f('0x18')](_0x3b2bb2)[_0xa90f('0x19')]();};}function respondWithResult(_0x27a4f9,_0x3f39b0){_0x3f39b0=_0x3f39b0||0xc8;return function(_0x3c9100){if(_0x3c9100){return _0x27a4f9[_0xa90f('0x18')](_0x3f39b0)[_0xa90f('0x1a')](_0x3c9100);}};}function respondWithFilteredResult(_0x2207db,_0x4b2396){return function(_0x165084){if(_0x165084){var _0x49fb98=_0x165084[_0xa90f('0x1b')],_0x4f5b39=_0x4b2396[_0xa90f('0x1c')],_0x1f318c=_0x4b2396[_0xa90f('0x1c')]+_0x4b2396['limit'],_0x1d0faa;if(_0x1f318c>=_0x49fb98){_0x1f318c=_0x49fb98;_0x1d0faa=0xc8;}else{_0x1d0faa=0xce;}_0x2207db[_0xa90f('0x18')](_0x1d0faa);return _0x2207db['set']('Content-Range',_0x4f5b39+'-'+_0x1f318c+'/'+_0x49fb98)[_0xa90f('0x1a')](_0x165084);}return null;};}function patchUpdates(_0x544eab){return function(_0x289233){try{jsonpatch[_0xa90f('0x1d')](_0x289233,_0x544eab,!![]);}catch(_0x43b5c8){return BPromise[_0xa90f('0x1e')](_0x43b5c8);}return _0x289233[_0xa90f('0x1f')]();};}function saveUpdates(_0x1fc8a9,_0x1449d9){return function(_0x583912){if(_0x583912){return _0x583912[_0xa90f('0x20')](_0x1fc8a9)[_0xa90f('0x21')](function(_0x237f88){return _0x237f88;});}return null;};}function removeEntity(_0x2548fb,_0x4b39c4){return function(_0x30a862){if(_0x30a862){return _0x30a862[_0xa90f('0x22')]()[_0xa90f('0x21')](function(){_0x2548fb[_0xa90f('0x18')](0xcc)[_0xa90f('0x19')]();});}};}function handleEntityNotFound(_0x55fd16,_0x32251f){return function(_0x300b92){if(!_0x300b92){_0x55fd16[_0xa90f('0x17')](0x194);}return _0x300b92;};}function handleError(_0x3a44f3,_0x3b3c10){_0x3b3c10=_0x3b3c10||0x1f4;return function(_0xe5201f){logger['error'](_0xe5201f['stack']);if(_0xe5201f['name']){delete _0xe5201f[_0xa90f('0x23')];}_0x3a44f3[_0xa90f('0x18')](_0x3b3c10)[_0xa90f('0x24')](_0xe5201f);};}exports[_0xa90f('0x25')]=function(_0x3bf2f8,_0x3d323a){var _0x1b9d07={},_0x297f03={},_0x4631bc={'count':0x0,'rows':[]};var _0x17cc82=db['SquareReport']['rawAttributes'];_0x297f03[_0xa90f('0x26')]=_['keys'](_0x17cc82);_0x297f03[_0xa90f('0x27')]=_[_0xa90f('0x28')](_0x3bf2f8['query']);_0x297f03[_0xa90f('0x29')]=_[_0xa90f('0x2a')](_0x297f03[_0xa90f('0x26')],_0x297f03['query']);_0x1b9d07[_0xa90f('0x2b')]=_[_0xa90f('0x2a')](_0x297f03[_0xa90f('0x26')],qs[_0xa90f('0x2c')](_0x3bf2f8[_0xa90f('0x27')][_0xa90f('0x2c')]));_0x1b9d07[_0xa90f('0x2b')]=_0x1b9d07[_0xa90f('0x2b')][_0xa90f('0x2d')]?_0x1b9d07[_0xa90f('0x2b')]:_0x297f03[_0xa90f('0x26')];if(!_0x3bf2f8['query']['hasOwnProperty'](_0xa90f('0x2e'))){_0x1b9d07[_0xa90f('0x2f')]=qs[_0xa90f('0x2f')](_0x3bf2f8['query'][_0xa90f('0x2f')]);_0x1b9d07[_0xa90f('0x1c')]=qs['offset'](_0x3bf2f8[_0xa90f('0x27')][_0xa90f('0x1c')]);}_0x1b9d07[_0xa90f('0x30')]=qs[_0xa90f('0x31')](_0x3bf2f8['query'][_0xa90f('0x31')]);_0x1b9d07[_0xa90f('0x32')]=qs['filters'](_['pick'](_0x3bf2f8[_0xa90f('0x27')],_0x297f03[_0xa90f('0x29')]));if(_0x3bf2f8[_0xa90f('0x27')][_0xa90f('0x33')]){_0x1b9d07[_0xa90f('0x32')]=_[_0xa90f('0x34')](_0x1b9d07[_0xa90f('0x32')],{'$or':_[_0xa90f('0x35')](_0x17cc82,function(_0xe93998){if(_0xe93998[_0xa90f('0x36')][_0xa90f('0x37')]!==_0xa90f('0x38')){var _0x3af9f2={};_0x3af9f2[_0xe93998[_0xa90f('0x39')]]={'$like':'%'+_0x3bf2f8[_0xa90f('0x27')]['filter']+'%'};return _0x3af9f2;}})});}_0x1b9d07=_[_0xa90f('0x34')]({},_0x1b9d07,_0x3bf2f8[_0xa90f('0x3a')]);var _0x4554ac={'where':_0x1b9d07['where']};return db[_0xa90f('0x3b')][_0xa90f('0x1b')](_0x4554ac)[_0xa90f('0x21')](function(_0x3cd824){_0x4631bc[_0xa90f('0x1b')]=_0x3cd824;if(_0x3bf2f8['query'][_0xa90f('0x3c')]){_0x1b9d07[_0xa90f('0x3d')]=[{'all':!![]}];}return db[_0xa90f('0x3b')][_0xa90f('0x3e')](_0x1b9d07);})[_0xa90f('0x21')](function(_0x1bfc51){_0x4631bc[_0xa90f('0x3f')]=_0x1bfc51;return _0x4631bc;})[_0xa90f('0x21')](respondWithFilteredResult(_0x3d323a,_0x1b9d07))[_0xa90f('0x40')](handleError(_0x3d323a,null));};exports[_0xa90f('0x41')]=function(_0x483b8f,_0x39b6a4){var _0x4fa459={'raw':!![],'where':{'id':_0x483b8f['params']['id']}},_0x1a5fa0={};_0x1a5fa0[_0xa90f('0x26')]=_[_0xa90f('0x28')](db[_0xa90f('0x3b')][_0xa90f('0x42')]);_0x1a5fa0[_0xa90f('0x27')]=_['keys'](_0x483b8f[_0xa90f('0x27')]);_0x1a5fa0[_0xa90f('0x29')]=_['intersection'](_0x1a5fa0[_0xa90f('0x26')],_0x1a5fa0[_0xa90f('0x27')]);_0x4fa459['attributes']=_[_0xa90f('0x2a')](_0x1a5fa0[_0xa90f('0x26')],qs['fields'](_0x483b8f[_0xa90f('0x27')][_0xa90f('0x2c')]));_0x4fa459[_0xa90f('0x2b')]=_0x4fa459[_0xa90f('0x2b')][_0xa90f('0x2d')]?_0x4fa459[_0xa90f('0x2b')]:_0x1a5fa0[_0xa90f('0x26')];if(_0x483b8f[_0xa90f('0x27')][_0xa90f('0x3c')]){_0x4fa459[_0xa90f('0x3d')]=[{'all':!![]}];}_0x4fa459=_[_0xa90f('0x34')]({},_0x4fa459,_0x483b8f[_0xa90f('0x3a')]);return db[_0xa90f('0x3b')][_0xa90f('0x43')](_0x4fa459)[_0xa90f('0x21')](handleEntityNotFound(_0x39b6a4,null))[_0xa90f('0x21')](respondWithResult(_0x39b6a4,null))[_0xa90f('0x40')](handleError(_0x39b6a4,null));};exports[_0xa90f('0x44')]=function(_0x7cb3af,_0x451e80){return db[_0xa90f('0x3b')]['create'](_0x7cb3af[_0xa90f('0x45')],{})[_0xa90f('0x21')](respondWithResult(_0x451e80,0xc9))[_0xa90f('0x40')](handleError(_0x451e80,null));};exports[_0xa90f('0x20')]=function(_0x4ecda9,_0x444425){if(_0x4ecda9[_0xa90f('0x45')]['id']){delete _0x4ecda9[_0xa90f('0x45')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x4ecda9[_0xa90f('0x46')]['id']}})[_0xa90f('0x21')](handleEntityNotFound(_0x444425,null))[_0xa90f('0x21')](saveUpdates(_0x4ecda9[_0xa90f('0x45')],null))[_0xa90f('0x21')](respondWithResult(_0x444425,null))[_0xa90f('0x40')](handleError(_0x444425,null));};exports[_0xa90f('0x22')]=function(_0x38f4b2,_0x348e17){return db[_0xa90f('0x3b')][_0xa90f('0x43')]({'where':{'id':_0x38f4b2[_0xa90f('0x46')]['id']}})[_0xa90f('0x21')](handleEntityNotFound(_0x348e17,null))[_0xa90f('0x21')](removeEntity(_0x348e17,null))[_0xa90f('0x40')](handleError(_0x348e17,null));};exports[_0xa90f('0x47')]=function(_0x4622a4,_0x29d72){return db[_0xa90f('0x3b')][_0xa90f('0x47')]()[_0xa90f('0x21')](respondWithResult(_0x29d72,null))[_0xa90f('0x40')](handleError(_0x29d72,null));}; \ No newline at end of file +var _0xedac=['util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','then','destroy','name','send','SquareReport','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','describe','html-pdf','rimraf','zip-dir','request-promise','moment','mustache'];(function(_0x6b203e,_0x2d4ac8){var _0x49228c=function(_0x4d463d){while(--_0x4d463d){_0x6b203e['push'](_0x6b203e['shift']());}};_0x49228c(++_0x2d4ac8);}(_0xedac,0x1b6));var _0xceda=function(_0x5229d4,_0x101cb9){_0x5229d4=_0x5229d4-0x0;var _0x239eb8=_0xedac[_0x5229d4];return _0x239eb8;};'use strict';var pdf=require(_0xceda('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xceda('0x1'));var zipdir=require(_0xceda('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xceda('0x3'));var moment=require(_0xceda('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xceda('0x5'));var util=require(_0xceda('0x6'));var path=require(_0xceda('0x7'));var sox=require(_0xceda('0x8'));var csv=require(_0xceda('0x9'));var ejs=require(_0xceda('0xa'));var fs=require('fs');var _=require(_0xceda('0xb'));var squel=require(_0xceda('0xc'));var crypto=require('crypto');var jsforce=require(_0xceda('0xd'));var deskjs=require(_0xceda('0xe'));var toCsv=require('to-csv');var querystring=require(_0xceda('0xf'));var Papa=require('papaparse');var Redis=require(_0xceda('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xceda('0x11'));var hardwareService=require(_0xceda('0x12'));var logger=require(_0xceda('0x13'))(_0xceda('0x14'));var utils=require(_0xceda('0x15'));var config=require(_0xceda('0x16'));var db=require(_0xceda('0x17'))['db'];function respondWithStatusCode(_0x4cc809,_0x476cb4){_0x476cb4=_0x476cb4||0xcc;return function(_0x2d16fa){if(_0x2d16fa){return _0x4cc809[_0xceda('0x18')](_0x476cb4);}return _0x4cc809[_0xceda('0x19')](_0x476cb4)[_0xceda('0x1a')]();};}function respondWithResult(_0x3bb6e3,_0x48b0c0){_0x48b0c0=_0x48b0c0||0xc8;return function(_0x40fc4b){if(_0x40fc4b){return _0x3bb6e3[_0xceda('0x19')](_0x48b0c0)['json'](_0x40fc4b);}};}function respondWithFilteredResult(_0x1ed5e8,_0x32b2f5){return function(_0x343d59){if(_0x343d59){var _0x5beaf8=_0x343d59['count'],_0xff321a=_0x32b2f5[_0xceda('0x1b')],_0x44a3bf=_0x32b2f5[_0xceda('0x1b')]+_0x32b2f5[_0xceda('0x1c')],_0x521a03;if(_0x44a3bf>=_0x5beaf8){_0x44a3bf=_0x5beaf8;_0x521a03=0xc8;}else{_0x521a03=0xce;}_0x1ed5e8['status'](_0x521a03);return _0x1ed5e8[_0xceda('0x1d')](_0xceda('0x1e'),_0xff321a+'-'+_0x44a3bf+'/'+_0x5beaf8)[_0xceda('0x1f')](_0x343d59);}return null;};}function patchUpdates(_0x38e04b){return function(_0x1e96ba){try{jsonpatch[_0xceda('0x20')](_0x1e96ba,_0x38e04b,!![]);}catch(_0x1080d9){return BPromise[_0xceda('0x21')](_0x1080d9);}return _0x1e96ba['save']();};}function saveUpdates(_0x8430e7,_0x4b6b4a){return function(_0x5cfd3c){if(_0x5cfd3c){return _0x5cfd3c['update'](_0x8430e7)[_0xceda('0x22')](function(_0x330a53){return _0x330a53;});}return null;};}function removeEntity(_0x42c5fb,_0x2a11f2){return function(_0x2ff555){if(_0x2ff555){return _0x2ff555[_0xceda('0x23')]()[_0xceda('0x22')](function(){_0x42c5fb['status'](0xcc)[_0xceda('0x1a')]();});}};}function handleEntityNotFound(_0x46a9ff,_0x7b010d){return function(_0x4aa47f){if(!_0x4aa47f){_0x46a9ff['sendStatus'](0x194);}return _0x4aa47f;};}function handleError(_0x110b5c,_0x1061b9){_0x1061b9=_0x1061b9||0x1f4;return function(_0x38bf08){logger['error'](_0x38bf08['stack']);if(_0x38bf08[_0xceda('0x24')]){delete _0x38bf08['name'];}_0x110b5c[_0xceda('0x19')](_0x1061b9)[_0xceda('0x25')](_0x38bf08);};}exports['index']=function(_0x4846d2,_0x333180){var _0x35854c={},_0x36500e={},_0x22f3a7={'count':0x0,'rows':[]};var _0x3fb8c9=db[_0xceda('0x26')]['rawAttributes'];_0x36500e[_0xceda('0x27')]=_[_0xceda('0x28')](_0x3fb8c9);_0x36500e[_0xceda('0x29')]=_[_0xceda('0x28')](_0x4846d2[_0xceda('0x29')]);_0x36500e[_0xceda('0x2a')]=_[_0xceda('0x2b')](_0x36500e[_0xceda('0x27')],_0x36500e[_0xceda('0x29')]);_0x35854c[_0xceda('0x2c')]=_[_0xceda('0x2b')](_0x36500e[_0xceda('0x27')],qs['fields'](_0x4846d2['query'][_0xceda('0x2d')]));_0x35854c[_0xceda('0x2c')]=_0x35854c['attributes'][_0xceda('0x2e')]?_0x35854c[_0xceda('0x2c')]:_0x36500e[_0xceda('0x27')];if(!_0x4846d2[_0xceda('0x29')][_0xceda('0x2f')](_0xceda('0x30'))){_0x35854c[_0xceda('0x1c')]=qs[_0xceda('0x1c')](_0x4846d2['query']['limit']);_0x35854c[_0xceda('0x1b')]=qs[_0xceda('0x1b')](_0x4846d2[_0xceda('0x29')][_0xceda('0x1b')]);}_0x35854c[_0xceda('0x31')]=qs[_0xceda('0x32')](_0x4846d2[_0xceda('0x29')][_0xceda('0x32')]);_0x35854c[_0xceda('0x33')]=qs[_0xceda('0x2a')](_[_0xceda('0x34')](_0x4846d2[_0xceda('0x29')],_0x36500e[_0xceda('0x2a')]));if(_0x4846d2[_0xceda('0x29')][_0xceda('0x35')]){_0x35854c['where']=_[_0xceda('0x36')](_0x35854c[_0xceda('0x33')],{'$or':_[_0xceda('0x37')](_0x3fb8c9,function(_0xc73a99){if(_0xc73a99[_0xceda('0x38')][_0xceda('0x39')]!==_0xceda('0x3a')){var _0x32fffb={};_0x32fffb[_0xc73a99[_0xceda('0x3b')]]={'$like':'%'+_0x4846d2[_0xceda('0x29')][_0xceda('0x35')]+'%'};return _0x32fffb;}})});}_0x35854c=_['merge']({},_0x35854c,_0x4846d2[_0xceda('0x3c')]);var _0x443640={'where':_0x35854c['where']};return db[_0xceda('0x26')][_0xceda('0x3d')](_0x443640)[_0xceda('0x22')](function(_0x8cc115){_0x22f3a7[_0xceda('0x3d')]=_0x8cc115;if(_0x4846d2[_0xceda('0x29')]['includeAll']){_0x35854c[_0xceda('0x3e')]=[{'all':!![]}];}return db['SquareReport'][_0xceda('0x3f')](_0x35854c);})[_0xceda('0x22')](function(_0x19b930){_0x22f3a7[_0xceda('0x40')]=_0x19b930;return _0x22f3a7;})['then'](respondWithFilteredResult(_0x333180,_0x35854c))[_0xceda('0x41')](handleError(_0x333180,null));};exports[_0xceda('0x42')]=function(_0x343261,_0x8c016b){var _0x4cee91={'raw':!![],'where':{'id':_0x343261[_0xceda('0x43')]['id']}},_0xb92084={};_0xb92084['model']=_[_0xceda('0x28')](db[_0xceda('0x26')][_0xceda('0x44')]);_0xb92084[_0xceda('0x29')]=_[_0xceda('0x28')](_0x343261['query']);_0xb92084[_0xceda('0x2a')]=_[_0xceda('0x2b')](_0xb92084[_0xceda('0x27')],_0xb92084[_0xceda('0x29')]);_0x4cee91[_0xceda('0x2c')]=_[_0xceda('0x2b')](_0xb92084['model'],qs[_0xceda('0x2d')](_0x343261['query']['fields']));_0x4cee91[_0xceda('0x2c')]=_0x4cee91[_0xceda('0x2c')]['length']?_0x4cee91[_0xceda('0x2c')]:_0xb92084['model'];if(_0x343261['query']['includeAll']){_0x4cee91['include']=[{'all':!![]}];}_0x4cee91=_[_0xceda('0x36')]({},_0x4cee91,_0x343261[_0xceda('0x3c')]);return db[_0xceda('0x26')][_0xceda('0x45')](_0x4cee91)[_0xceda('0x22')](handleEntityNotFound(_0x8c016b,null))[_0xceda('0x22')](respondWithResult(_0x8c016b,null))[_0xceda('0x41')](handleError(_0x8c016b,null));};exports['create']=function(_0x41eff9,_0xec9839){return db[_0xceda('0x26')][_0xceda('0x46')](_0x41eff9[_0xceda('0x47')],{})[_0xceda('0x22')](respondWithResult(_0xec9839,0xc9))[_0xceda('0x41')](handleError(_0xec9839,null));};exports[_0xceda('0x48')]=function(_0x6302bf,_0x4ff8a1){if(_0x6302bf[_0xceda('0x47')]['id']){delete _0x6302bf[_0xceda('0x47')]['id'];}return db[_0xceda('0x26')]['find']({'where':{'id':_0x6302bf['params']['id']}})[_0xceda('0x22')](handleEntityNotFound(_0x4ff8a1,null))[_0xceda('0x22')](saveUpdates(_0x6302bf[_0xceda('0x47')],null))[_0xceda('0x22')](respondWithResult(_0x4ff8a1,null))['catch'](handleError(_0x4ff8a1,null));};exports[_0xceda('0x23')]=function(_0x341458,_0x4c9125){return db[_0xceda('0x26')][_0xceda('0x45')]({'where':{'id':_0x341458['params']['id']}})[_0xceda('0x22')](handleEntityNotFound(_0x4c9125,null))['then'](removeEntity(_0x4c9125,null))['catch'](handleError(_0x4c9125,null));};exports[_0xceda('0x49')]=function(_0x187629,_0x3d607e){return db[_0xceda('0x26')][_0xceda('0x49')]()[_0xceda('0x22')](respondWithResult(_0x3d607e,null))['catch'](handleError(_0x3d607e,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index e8cfa92..4a973bc 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 _0xd1ea=['bluebird','request-promise','path','exports','define','SquareReport','uid_pname','uniqueid','leaveAt','lodash','../../config/logger','api'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0xd1ea,0xb1));var _0xad1e=function(_0x459d30,_0x4e010e){_0x459d30=_0x459d30-0x0;var _0x49526c=_0xd1ea[_0x459d30];return _0x49526c;};'use strict';var _=require(_0xad1e('0x0'));var util=require('util');var logger=require(_0xad1e('0x1'))(_0xad1e('0x2'));var moment=require('moment');var BPromise=require(_0xad1e('0x3'));var rp=require(_0xad1e('0x4'));var fs=require('fs');var path=require(_0xad1e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0xad1e('0x6')]=function(_0x8fb50f,_0x1e5e39){return _0x8fb50f[_0xad1e('0x7')](_0xad1e('0x8'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xad1e('0x9'),'fields':[_0xad1e('0xa'),'project_name']},{'name':_0xad1e('0xb'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbca5=['request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','bluebird'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xbca5,0x1f3));var _0x5bca=function(_0x179038,_0x5cdc63){_0x179038=_0x179038-0x0;var _0x437bbb=_0xbca5[_0x179038];return _0x437bbb;};'use strict';var _=require(_0x5bca('0x0'));var util=require(_0x5bca('0x1'));var logger=require(_0x5bca('0x2'))(_0x5bca('0x3'));var moment=require('moment');var BPromise=require(_0x5bca('0x4'));var rp=require(_0x5bca('0x5'));var fs=require('fs');var path=require(_0x5bca('0x6'));var rimraf=require(_0x5bca('0x7'));var config=require(_0x5bca('0x8'));var attributes=require(_0x5bca('0x9'));module[_0x5bca('0xa')]=function(_0x456b2a,_0x407200){return _0x456b2a[_0x5bca('0xb')](_0x5bca('0xc'),attributes,{'tableName':_0x5bca('0xd'),'paranoid':![],'indexes':[{'name':_0x5bca('0xe'),'fields':[_0x5bca('0xf'),_0x5bca('0x10')]},{'name':_0x5bca('0x11'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index faef329..59ce91e 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 _0x3b2b=['../../config/logger','rpc','jayson/promise','client','http','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareReport','SquareReport','options','then','catch','UpdateSquareReport','update','body','raw','where','attributes','limit','lodash','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2e2cd7,_0x9a3d16){var _0x397801=function(_0x1e15e0){while(--_0x1e15e0){_0x2e2cd7['push'](_0x2e2cd7['shift']());}};_0x397801(++_0x9a3d16);}(_0x3b2b,0x1a8));var _0xb3b2=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x3b2b[_0xbe200f];return _0x192597;};'use strict';var _=require(_0xb3b2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb3b2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb3b2('0x2'));var db=require(_0xb3b2('0x3'))['db'];var utils=require(_0xb3b2('0x4'));var logger=require(_0xb3b2('0x5'))(_0xb3b2('0x6'));var config=require('../../config/environment');var jayson=require(_0xb3b2('0x7'));var client=jayson[_0xb3b2('0x8')][_0xb3b2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503e9d,_0x3a099a,_0x618b87){return new BPromise(function(_0x394687,_0x4d97b3){return client[_0xb3b2('0xa')](_0x503e9d,_0x618b87)['then'](function(_0x45f364){logger[_0xb3b2('0xb')](_0xb3b2('0xc'),_0x3a099a,_0xb3b2('0xd'));logger[_0xb3b2('0xe')](_0xb3b2('0xf'),_0x3a099a,'request\x20sent',JSON[_0xb3b2('0x10')](_0x45f364));if(_0x45f364[_0xb3b2('0x11')]){if(_0x45f364[_0xb3b2('0x11')][_0xb3b2('0x12')]===0x1f4){logger[_0xb3b2('0x11')](_0xb3b2('0xc'),_0x3a099a,_0x45f364[_0xb3b2('0x11')][_0xb3b2('0x13')]);return _0x4d97b3(_0x45f364[_0xb3b2('0x11')][_0xb3b2('0x13')]);}logger['error'](_0xb3b2('0xc'),_0x3a099a,_0x45f364[_0xb3b2('0x11')][_0xb3b2('0x13')]);return _0x394687(_0x45f364['error'][_0xb3b2('0x13')]);}else{logger[_0xb3b2('0xb')](_0xb3b2('0xc'),_0x3a099a,'request\x20sent');_0x394687(_0x45f364[_0xb3b2('0x14')][_0xb3b2('0x13')]);}})['catch'](function(_0x2777d5){logger[_0xb3b2('0x11')](_0xb3b2('0xc'),_0x3a099a,_0x2777d5);_0x4d97b3(_0x2777d5);});});}exports[_0xb3b2('0x15')]=function(_0x51905a){var _0xfc2bf3=this;return new Promise(function(_0x51e187,_0x459718){return db[_0xb3b2('0x16')]['create'](_0x51905a['body'],{'raw':_0x51905a[_0xb3b2('0x17')]?_0x51905a[_0xb3b2('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xb3b2('0x18')](function(_0x143695){logger['info'](_0xb3b2('0x15'),_0x51905a);logger[_0xb3b2('0xe')]('CreateSquareReport',_0x51905a,JSON[_0xb3b2('0x10')](_0x143695));_0x51e187(_0x143695);})[_0xb3b2('0x19')](function(_0x189e72){logger[_0xb3b2('0x11')]('CreateSquareReport',_0x189e72['message'],_0x51905a);_0x459718(_0xfc2bf3['error'](0x1f4,_0x189e72['message']));});});};exports[_0xb3b2('0x1a')]=function(_0x2ad22a){var _0x3a1a97=this;return new Promise(function(_0x1c9021,_0x5b9df1){return db['SquareReport'][_0xb3b2('0x1b')](_0x2ad22a[_0xb3b2('0x1c')],{'raw':_0x2ad22a[_0xb3b2('0x17')]?_0x2ad22a[_0xb3b2('0x17')][_0xb3b2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ad22a[_0xb3b2('0x17')]?_0x2ad22a[_0xb3b2('0x17')][_0xb3b2('0x1e')]||null:null,'attributes':_0x2ad22a[_0xb3b2('0x17')]?_0x2ad22a[_0xb3b2('0x17')][_0xb3b2('0x1f')]||null:null,'limit':_0x2ad22a['options']?_0x2ad22a[_0xb3b2('0x17')][_0xb3b2('0x20')]||null:null})[_0xb3b2('0x18')](function(_0x2edfd2){logger[_0xb3b2('0xb')](_0xb3b2('0x1a'),_0x2ad22a);logger['debug'](_0xb3b2('0x1a'),_0x2ad22a,JSON[_0xb3b2('0x10')](_0x2edfd2));_0x1c9021(_0x2edfd2);})[_0xb3b2('0x19')](function(_0x3419ae){logger[_0xb3b2('0x11')](_0xb3b2('0x1a'),_0x3419ae[_0xb3b2('0x13')],_0x2ad22a);_0x5b9df1(_0x3a1a97[_0xb3b2('0x11')](0x1f4,_0x3419ae['message']));});});}; \ No newline at end of file +var _0x11bd=['raw','UpdateSquareReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareReport','SquareReport','create','body','options'];(function(_0x8b631b,_0x386724){var _0x3e6832=function(_0x17a132){while(--_0x17a132){_0x8b631b['push'](_0x8b631b['shift']());}};_0x3e6832(++_0x386724);}(_0x11bd,0x8e));var _0xd11b=function(_0x418265,_0x21c8c2){_0x418265=_0x418265-0x0;var _0x5af35b=_0x11bd[_0x418265];return _0x5af35b;};'use strict';var _=require(_0xd11b('0x0'));var util=require(_0xd11b('0x1'));var moment=require('moment');var BPromise=require(_0xd11b('0x2'));var rs=require(_0xd11b('0x3'));var fs=require('fs');var Redis=require(_0xd11b('0x4'));var db=require(_0xd11b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd11b('0x6'))(_0xd11b('0x7'));var config=require(_0xd11b('0x8'));var jayson=require(_0xd11b('0x9'));var client=jayson[_0xd11b('0xa')][_0xd11b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x368b73,_0x20f65e,_0x24411a){return new BPromise(function(_0x197ff6,_0x35ecb9){return client[_0xd11b('0xc')](_0x368b73,_0x24411a)[_0xd11b('0xd')](function(_0x18e1f8){logger[_0xd11b('0xe')](_0xd11b('0xf'),_0x20f65e,'request\x20sent');logger[_0xd11b('0x10')](_0xd11b('0x11'),_0x20f65e,'request\x20sent',JSON[_0xd11b('0x12')](_0x18e1f8));if(_0x18e1f8[_0xd11b('0x13')]){if(_0x18e1f8[_0xd11b('0x13')][_0xd11b('0x14')]===0x1f4){logger['error'](_0xd11b('0xf'),_0x20f65e,_0x18e1f8[_0xd11b('0x13')][_0xd11b('0x15')]);return _0x35ecb9(_0x18e1f8[_0xd11b('0x13')]['message']);}logger[_0xd11b('0x13')](_0xd11b('0xf'),_0x20f65e,_0x18e1f8[_0xd11b('0x13')]['message']);return _0x197ff6(_0x18e1f8[_0xd11b('0x13')][_0xd11b('0x15')]);}else{logger['info'](_0xd11b('0xf'),_0x20f65e,'request\x20sent');_0x197ff6(_0x18e1f8['result'][_0xd11b('0x15')]);}})[_0xd11b('0x16')](function(_0x2ff2f7){logger[_0xd11b('0x13')](_0xd11b('0xf'),_0x20f65e,_0x2ff2f7);_0x35ecb9(_0x2ff2f7);});});}exports[_0xd11b('0x17')]=function(_0x141ace){var _0x22c3e7=this;return new Promise(function(_0x26eaba,_0x4ad920){return db[_0xd11b('0x18')][_0xd11b('0x19')](_0x141ace[_0xd11b('0x1a')],{'raw':_0x141ace['options']?_0x141ace[_0xd11b('0x1b')][_0xd11b('0x1c')]===undefined?!![]:![]:!![]})[_0xd11b('0xd')](function(_0x31eb7e){logger['info'](_0xd11b('0x17'),_0x141ace);logger[_0xd11b('0x10')](_0xd11b('0x17'),_0x141ace,JSON['stringify'](_0x31eb7e));_0x26eaba(_0x31eb7e);})[_0xd11b('0x16')](function(_0x17c9e0){logger[_0xd11b('0x13')](_0xd11b('0x17'),_0x17c9e0[_0xd11b('0x15')],_0x141ace);_0x4ad920(_0x22c3e7['error'](0x1f4,_0x17c9e0[_0xd11b('0x15')]));});});};exports[_0xd11b('0x1d')]=function(_0x5a0786){var _0xeccd9d=this;return new Promise(function(_0x4f5662,_0x1d0d14){return db['SquareReport'][_0xd11b('0x1e')](_0x5a0786[_0xd11b('0x1a')],{'raw':_0x5a0786[_0xd11b('0x1b')]?_0x5a0786[_0xd11b('0x1b')][_0xd11b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a0786[_0xd11b('0x1b')]?_0x5a0786['options'][_0xd11b('0x1f')]||null:null,'attributes':_0x5a0786[_0xd11b('0x1b')]?_0x5a0786['options'][_0xd11b('0x20')]||null:null,'limit':_0x5a0786[_0xd11b('0x1b')]?_0x5a0786['options'][_0xd11b('0x21')]||null:null})['then'](function(_0x16ac51){logger[_0xd11b('0xe')]('UpdateSquareReport',_0x5a0786);logger[_0xd11b('0x10')](_0xd11b('0x1d'),_0x5a0786,JSON['stringify'](_0x16ac51));_0x4f5662(_0x16ac51);})['catch'](function(_0xeff451){logger['error'](_0xd11b('0x1d'),_0xeff451[_0xd11b('0x15')],_0x5a0786);_0x1d0d14(_0xeccd9d[_0xd11b('0x13')](0x1f4,_0xeff451[_0xd11b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index bfaff2b..c2f78b4 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(_0x46d9bd,_0xf91f44){var _0x421db6=function(_0x2e4f41){while(--_0x2e4f41){_0x46d9bd['push'](_0x46d9bd['shift']());}};_0x421db6(++_0xf91f44);}(_0x7a54,0x106));var _0x47a5=function(_0x46dac5,_0x5e06ad){_0x46dac5=_0x46dac5-0x0;var _0x368681=_0x7a54[_0x46dac5];return _0x368681;};'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 _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0xaccafc,_0x19f983){var _0x2c027b=function(_0x35eb4c){while(--_0x35eb4c){_0xaccafc['push'](_0xaccafc['shift']());}};_0x2c027b(++_0x19f983);}(_0x7a54,0x106));var _0x47a5=function(_0x47b3de,_0x5ddc89){_0x47b3de=_0x47b3de-0x0;var _0x1a8ab5=_0x7a54[_0x47b3de];return _0x1a8ab5;};'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 diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index e9c70ab..c72e759 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 _0xd941=['TEXT','exports'];(function(_0x5215f1,_0xc496d1){var _0x3d0781=function(_0x44d527){while(--_0x44d527){_0x5215f1['push'](_0x5215f1['shift']());}};_0x3d0781(++_0xc496d1);}(_0xd941,0x1eb));var _0x1d94=function(_0x2998db,_0x3424f1){_0x2998db=_0x2998db-0x0;var _0x115fea=_0xd941[_0x2998db];return _0x115fea;};'use strict';var Sequelize=require('sequelize');module[_0x1d94('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x1d94('0x1')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xafe2=['TEXT','sequelize','STRING'];(function(_0x3a62cc,_0x314012){var _0x1be6f2=function(_0x349b6e){while(--_0x349b6e){_0x3a62cc['push'](_0x3a62cc['shift']());}};_0x1be6f2(++_0x314012);}(_0xafe2,0x9a));var _0x2afe=function(_0x35e215,_0x5639de){_0x35e215=_0x35e215-0x0;var _0x3ce2f0=_0xafe2[_0x35e215];return _0x3ce2f0;};'use strict';var Sequelize=require(_0x2afe('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x2afe('0x1')]},'node':{'type':Sequelize[_0x2afe('0x1')]},'application':{'type':Sequelize[_0x2afe('0x1')]},'data':{'type':Sequelize[_0x2afe('0x2')]},'project_name':{'type':Sequelize[_0x2afe('0x1')]},'callerid':{'type':Sequelize[_0x2afe('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 3c0d9e8..dde16dc 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 _0xf48a=['set','Content-Range','apply','reject','save','update','destroy','then','status','sendStatus','error','stack','name','send','index','SquareDetailsReport','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','type','key','VIRTUAL','field','merge','options','count','include','findAll','rows','catch','show','rawAttributes','includeAll','create','body','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','offset','limit'];(function(_0x478219,_0x28aa3d){var _0x4ff324=function(_0x226fb8){while(--_0x226fb8){_0x478219['push'](_0x478219['shift']());}};_0x4ff324(++_0x28aa3d);}(_0xf48a,0x11a));var _0xaf48=function(_0x464251,_0x41951f){_0x464251=_0x464251-0x0;var _0x47b041=_0xf48a[_0x464251];return _0x47b041;};'use strict';var pdf=require(_0xaf48('0x0'));var emlformat=require(_0xaf48('0x1'));var rimraf=require(_0xaf48('0x2'));var zipdir=require(_0xaf48('0x3'));var jsonpatch=require(_0xaf48('0x4'));var rp=require(_0xaf48('0x5'));var moment=require(_0xaf48('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xaf48('0x7'));var util=require(_0xaf48('0x8'));var path=require(_0xaf48('0x9'));var sox=require('sox');var csv=require(_0xaf48('0xa'));var ejs=require(_0xaf48('0xb'));var fs=require('fs');var _=require(_0xaf48('0xc'));var squel=require('squel');var crypto=require(_0xaf48('0xd'));var jsforce=require(_0xaf48('0xe'));var deskjs=require(_0xaf48('0xf'));var toCsv=require(_0xaf48('0xa'));var querystring=require('querystring');var Papa=require(_0xaf48('0x10'));var Redis=require(_0xaf48('0x11'));var authService=require(_0xaf48('0x12'));var qs=require(_0xaf48('0x13'));var hardwareService=require(_0xaf48('0x14'));var logger=require(_0xaf48('0x15'))(_0xaf48('0x16'));var utils=require(_0xaf48('0x17'));var config=require(_0xaf48('0x18'));var db=require(_0xaf48('0x19'))['db'];function respondWithStatusCode(_0x22519c,_0x1cf4e5){_0x1cf4e5=_0x1cf4e5||0xcc;return function(_0x38ece0){if(_0x38ece0){return _0x22519c['sendStatus'](_0x1cf4e5);}return _0x22519c['status'](_0x1cf4e5)[_0xaf48('0x1a')]();};}function respondWithResult(_0x695ea1,_0xef986e){_0xef986e=_0xef986e||0xc8;return function(_0x488270){if(_0x488270){return _0x695ea1['status'](_0xef986e)[_0xaf48('0x1b')](_0x488270);}};}function respondWithFilteredResult(_0x32f1ce,_0x31927b){return function(_0x4d6ec2){if(_0x4d6ec2){var _0xdc9078=_0x4d6ec2['count'],_0x3dc302=_0x31927b[_0xaf48('0x1c')],_0xeedf34=_0x31927b['offset']+_0x31927b[_0xaf48('0x1d')],_0x52da96;if(_0xeedf34>=_0xdc9078){_0xeedf34=_0xdc9078;_0x52da96=0xc8;}else{_0x52da96=0xce;}_0x32f1ce['status'](_0x52da96);return _0x32f1ce[_0xaf48('0x1e')](_0xaf48('0x1f'),_0x3dc302+'-'+_0xeedf34+'/'+_0xdc9078)['json'](_0x4d6ec2);}return null;};}function patchUpdates(_0x499b8c){return function(_0x3c84b0){try{jsonpatch[_0xaf48('0x20')](_0x3c84b0,_0x499b8c,!![]);}catch(_0x839fa9){return BPromise[_0xaf48('0x21')](_0x839fa9);}return _0x3c84b0[_0xaf48('0x22')]();};}function saveUpdates(_0x148821,_0x552aff){return function(_0x1d0e58){if(_0x1d0e58){return _0x1d0e58[_0xaf48('0x23')](_0x148821)['then'](function(_0x311b4a){return _0x311b4a;});}return null;};}function removeEntity(_0x5c3caa,_0x14c690){return function(_0x5ce0e6){if(_0x5ce0e6){return _0x5ce0e6[_0xaf48('0x24')]()[_0xaf48('0x25')](function(){_0x5c3caa[_0xaf48('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x382776,_0x4abe2d){return function(_0x125f78){if(!_0x125f78){_0x382776[_0xaf48('0x27')](0x194);}return _0x125f78;};}function handleError(_0x36a339,_0x362623){_0x362623=_0x362623||0x1f4;return function(_0x1792df){logger[_0xaf48('0x28')](_0x1792df[_0xaf48('0x29')]);if(_0x1792df[_0xaf48('0x2a')]){delete _0x1792df[_0xaf48('0x2a')];}_0x36a339[_0xaf48('0x26')](_0x362623)[_0xaf48('0x2b')](_0x1792df);};}exports[_0xaf48('0x2c')]=function(_0x2875bc,_0x435185){var _0x2c5aae={},_0x57a45a={},_0x175587={'count':0x0,'rows':[]};var _0x4ddfc8=db[_0xaf48('0x2d')]['rawAttributes'];_0x57a45a[_0xaf48('0x2e')]=_[_0xaf48('0x2f')](_0x4ddfc8);_0x57a45a['query']=_['keys'](_0x2875bc[_0xaf48('0x30')]);_0x57a45a[_0xaf48('0x31')]=_[_0xaf48('0x32')](_0x57a45a[_0xaf48('0x2e')],_0x57a45a[_0xaf48('0x30')]);_0x2c5aae[_0xaf48('0x33')]=_[_0xaf48('0x32')](_0x57a45a[_0xaf48('0x2e')],qs[_0xaf48('0x34')](_0x2875bc[_0xaf48('0x30')][_0xaf48('0x34')]));_0x2c5aae[_0xaf48('0x33')]=_0x2c5aae['attributes'][_0xaf48('0x35')]?_0x2c5aae[_0xaf48('0x33')]:_0x57a45a[_0xaf48('0x2e')];if(!_0x2875bc['query']['hasOwnProperty'](_0xaf48('0x36'))){_0x2c5aae['limit']=qs['limit'](_0x2875bc['query'][_0xaf48('0x1d')]);_0x2c5aae[_0xaf48('0x1c')]=qs[_0xaf48('0x1c')](_0x2875bc[_0xaf48('0x30')][_0xaf48('0x1c')]);}_0x2c5aae['order']=qs[_0xaf48('0x37')](_0x2875bc[_0xaf48('0x30')][_0xaf48('0x37')]);_0x2c5aae[_0xaf48('0x38')]=qs['filters'](_[_0xaf48('0x39')](_0x2875bc[_0xaf48('0x30')],_0x57a45a[_0xaf48('0x31')]));if(_0x2875bc[_0xaf48('0x30')][_0xaf48('0x3a')]){_0x2c5aae[_0xaf48('0x38')]=_['merge'](_0x2c5aae[_0xaf48('0x38')],{'$or':_['map'](_0x4ddfc8,function(_0x2cc28b){if(_0x2cc28b[_0xaf48('0x3b')][_0xaf48('0x3c')]!==_0xaf48('0x3d')){var _0xc0dd4={};_0xc0dd4[_0x2cc28b[_0xaf48('0x3e')]]={'$like':'%'+_0x2875bc[_0xaf48('0x30')][_0xaf48('0x3a')]+'%'};return _0xc0dd4;}})});}_0x2c5aae=_[_0xaf48('0x3f')]({},_0x2c5aae,_0x2875bc[_0xaf48('0x40')]);var _0x29a3df={'where':_0x2c5aae['where']};return db[_0xaf48('0x2d')][_0xaf48('0x41')](_0x29a3df)['then'](function(_0x293dd2){_0x175587['count']=_0x293dd2;if(_0x2875bc[_0xaf48('0x30')]['includeAll']){_0x2c5aae[_0xaf48('0x42')]=[{'all':!![]}];}return db[_0xaf48('0x2d')][_0xaf48('0x43')](_0x2c5aae);})['then'](function(_0x479d81){_0x175587[_0xaf48('0x44')]=_0x479d81;return _0x175587;})[_0xaf48('0x25')](respondWithFilteredResult(_0x435185,_0x2c5aae))[_0xaf48('0x45')](handleError(_0x435185,null));};exports[_0xaf48('0x46')]=function(_0x15d12a,_0x14df7c){var _0x42032f={'raw':!![],'where':{'id':_0x15d12a['params']['id']}},_0x3f3fb8={};_0x3f3fb8[_0xaf48('0x2e')]=_[_0xaf48('0x2f')](db[_0xaf48('0x2d')][_0xaf48('0x47')]);_0x3f3fb8['query']=_[_0xaf48('0x2f')](_0x15d12a[_0xaf48('0x30')]);_0x3f3fb8[_0xaf48('0x31')]=_[_0xaf48('0x32')](_0x3f3fb8[_0xaf48('0x2e')],_0x3f3fb8[_0xaf48('0x30')]);_0x42032f['attributes']=_['intersection'](_0x3f3fb8[_0xaf48('0x2e')],qs[_0xaf48('0x34')](_0x15d12a[_0xaf48('0x30')][_0xaf48('0x34')]));_0x42032f[_0xaf48('0x33')]=_0x42032f[_0xaf48('0x33')][_0xaf48('0x35')]?_0x42032f['attributes']:_0x3f3fb8[_0xaf48('0x2e')];if(_0x15d12a['query'][_0xaf48('0x48')]){_0x42032f[_0xaf48('0x42')]=[{'all':!![]}];}_0x42032f=_['merge']({},_0x42032f,_0x15d12a[_0xaf48('0x40')]);return db[_0xaf48('0x2d')]['find'](_0x42032f)[_0xaf48('0x25')](handleEntityNotFound(_0x14df7c,null))[_0xaf48('0x25')](respondWithResult(_0x14df7c,null))['catch'](handleError(_0x14df7c,null));};exports[_0xaf48('0x49')]=function(_0x4807fa,_0xe3b58e){return db[_0xaf48('0x2d')][_0xaf48('0x49')](_0x4807fa[_0xaf48('0x4a')],{})[_0xaf48('0x25')](respondWithResult(_0xe3b58e,0xc9))[_0xaf48('0x45')](handleError(_0xe3b58e,null));};exports[_0xaf48('0x23')]=function(_0x1f8cc6,_0x67342){if(_0x1f8cc6[_0xaf48('0x4a')]['id']){delete _0x1f8cc6[_0xaf48('0x4a')]['id'];}return db['SquareDetailsReport'][_0xaf48('0x4b')]({'where':{'id':_0x1f8cc6[_0xaf48('0x4c')]['id']}})[_0xaf48('0x25')](handleEntityNotFound(_0x67342,null))[_0xaf48('0x25')](saveUpdates(_0x1f8cc6[_0xaf48('0x4a')],null))[_0xaf48('0x25')](respondWithResult(_0x67342,null))[_0xaf48('0x45')](handleError(_0x67342,null));};exports['destroy']=function(_0x449fb7,_0x4187b5){return db['SquareDetailsReport'][_0xaf48('0x4b')]({'where':{'id':_0x449fb7['params']['id']}})[_0xaf48('0x25')](handleEntityNotFound(_0x4187b5,null))[_0xaf48('0x25')](removeEntity(_0x4187b5,null))[_0xaf48('0x45')](handleError(_0x4187b5,null));};exports['describe']=function(_0x89db15,_0x3abbaa){return db['SquareDetailsReport'][_0xaf48('0x4d')]()['then'](respondWithResult(_0x3abbaa,null))['catch'](handleError(_0x3abbaa,null));}; \ No newline at end of file +var _0xb7a7=['show','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','type','key','VIRTUAL','field','options','SquareDetailsReport','count','then','includeAll','include','findAll','catch'];(function(_0x402139,_0xd90d9b){var _0x3e044f=function(_0x33a06b){while(--_0x33a06b){_0x402139['push'](_0x402139['shift']());}};_0x3e044f(++_0xd90d9b);}(_0xb7a7,0x9a));var _0x7b7a=function(_0x44f7bc,_0x5084ae){_0x44f7bc=_0x44f7bc-0x0;var _0xf95fca=_0xb7a7[_0x44f7bc];return _0xf95fca;};'use strict';var pdf=require(_0x7b7a('0x0'));var emlformat=require(_0x7b7a('0x1'));var rimraf=require(_0x7b7a('0x2'));var zipdir=require(_0x7b7a('0x3'));var jsonpatch=require(_0x7b7a('0x4'));var rp=require(_0x7b7a('0x5'));var moment=require(_0x7b7a('0x6'));var BPromise=require(_0x7b7a('0x7'));var Mustache=require(_0x7b7a('0x8'));var util=require('util');var path=require(_0x7b7a('0x9'));var sox=require(_0x7b7a('0xa'));var csv=require(_0x7b7a('0xb'));var ejs=require(_0x7b7a('0xc'));var fs=require('fs');var _=require(_0x7b7a('0xd'));var squel=require('squel');var crypto=require(_0x7b7a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7b7a('0xf'));var toCsv=require(_0x7b7a('0xb'));var querystring=require('querystring');var Papa=require(_0x7b7a('0x10'));var Redis=require(_0x7b7a('0x11'));var authService=require(_0x7b7a('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7b7a('0x13'));var logger=require(_0x7b7a('0x14'))(_0x7b7a('0x15'));var utils=require(_0x7b7a('0x16'));var config=require(_0x7b7a('0x17'));var db=require(_0x7b7a('0x18'))['db'];function respondWithStatusCode(_0x468835,_0x4a02a0){_0x4a02a0=_0x4a02a0||0xcc;return function(_0x34f03c){if(_0x34f03c){return _0x468835[_0x7b7a('0x19')](_0x4a02a0);}return _0x468835[_0x7b7a('0x1a')](_0x4a02a0)[_0x7b7a('0x1b')]();};}function respondWithResult(_0x2bf32a,_0x417777){_0x417777=_0x417777||0xc8;return function(_0x4b6950){if(_0x4b6950){return _0x2bf32a[_0x7b7a('0x1a')](_0x417777)[_0x7b7a('0x1c')](_0x4b6950);}};}function respondWithFilteredResult(_0x4e1a86,_0x43c4c1){return function(_0x3c976a){if(_0x3c976a){var _0x1ceb69=_0x3c976a['count'],_0x183e14=_0x43c4c1[_0x7b7a('0x1d')],_0x3856e2=_0x43c4c1['offset']+_0x43c4c1['limit'],_0x22c0fd;if(_0x3856e2>=_0x1ceb69){_0x3856e2=_0x1ceb69;_0x22c0fd=0xc8;}else{_0x22c0fd=0xce;}_0x4e1a86['status'](_0x22c0fd);return _0x4e1a86[_0x7b7a('0x1e')](_0x7b7a('0x1f'),_0x183e14+'-'+_0x3856e2+'/'+_0x1ceb69)['json'](_0x3c976a);}return null;};}function patchUpdates(_0x55c830){return function(_0x3dc4e8){try{jsonpatch[_0x7b7a('0x20')](_0x3dc4e8,_0x55c830,!![]);}catch(_0x523fb9){return BPromise[_0x7b7a('0x21')](_0x523fb9);}return _0x3dc4e8[_0x7b7a('0x22')]();};}function saveUpdates(_0x5541ac,_0x33417b){return function(_0x48696b){if(_0x48696b){return _0x48696b[_0x7b7a('0x23')](_0x5541ac)['then'](function(_0x5c9a38){return _0x5c9a38;});}return null;};}function removeEntity(_0x261c65,_0x2956f3){return function(_0x22d232){if(_0x22d232){return _0x22d232[_0x7b7a('0x24')]()['then'](function(){_0x261c65[_0x7b7a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f1a83,_0x5532bf){return function(_0x54951b){if(!_0x54951b){_0x3f1a83['sendStatus'](0x194);}return _0x54951b;};}function handleError(_0x4ca667,_0x921d6d){_0x921d6d=_0x921d6d||0x1f4;return function(_0x562dcd){logger['error'](_0x562dcd[_0x7b7a('0x25')]);if(_0x562dcd['name']){delete _0x562dcd[_0x7b7a('0x26')];}_0x4ca667[_0x7b7a('0x1a')](_0x921d6d)['send'](_0x562dcd);};}exports[_0x7b7a('0x27')]=function(_0x128b7e,_0x484b43){var _0x3c30fa={},_0x122321={},_0x47f84c={'count':0x0,'rows':[]};var _0xb4c540=db['SquareDetailsReport'][_0x7b7a('0x28')];_0x122321[_0x7b7a('0x29')]=_['keys'](_0xb4c540);_0x122321[_0x7b7a('0x2a')]=_[_0x7b7a('0x2b')](_0x128b7e[_0x7b7a('0x2a')]);_0x122321[_0x7b7a('0x2c')]=_[_0x7b7a('0x2d')](_0x122321[_0x7b7a('0x29')],_0x122321[_0x7b7a('0x2a')]);_0x3c30fa[_0x7b7a('0x2e')]=_['intersection'](_0x122321[_0x7b7a('0x29')],qs[_0x7b7a('0x2f')](_0x128b7e['query'][_0x7b7a('0x2f')]));_0x3c30fa[_0x7b7a('0x2e')]=_0x3c30fa[_0x7b7a('0x2e')][_0x7b7a('0x30')]?_0x3c30fa[_0x7b7a('0x2e')]:_0x122321[_0x7b7a('0x29')];if(!_0x128b7e['query']['hasOwnProperty'](_0x7b7a('0x31'))){_0x3c30fa[_0x7b7a('0x32')]=qs[_0x7b7a('0x32')](_0x128b7e['query']['limit']);_0x3c30fa[_0x7b7a('0x1d')]=qs[_0x7b7a('0x1d')](_0x128b7e[_0x7b7a('0x2a')]['offset']);}_0x3c30fa[_0x7b7a('0x33')]=qs[_0x7b7a('0x34')](_0x128b7e['query'][_0x7b7a('0x34')]);_0x3c30fa[_0x7b7a('0x35')]=qs['filters'](_['pick'](_0x128b7e[_0x7b7a('0x2a')],_0x122321[_0x7b7a('0x2c')]));if(_0x128b7e[_0x7b7a('0x2a')][_0x7b7a('0x36')]){_0x3c30fa[_0x7b7a('0x35')]=_[_0x7b7a('0x37')](_0x3c30fa[_0x7b7a('0x35')],{'$or':_['map'](_0xb4c540,function(_0x507c5c){if(_0x507c5c[_0x7b7a('0x38')][_0x7b7a('0x39')]!==_0x7b7a('0x3a')){var _0x54ba62={};_0x54ba62[_0x507c5c[_0x7b7a('0x3b')]]={'$like':'%'+_0x128b7e['query'][_0x7b7a('0x36')]+'%'};return _0x54ba62;}})});}_0x3c30fa=_[_0x7b7a('0x37')]({},_0x3c30fa,_0x128b7e[_0x7b7a('0x3c')]);var _0x4ccd94={'where':_0x3c30fa[_0x7b7a('0x35')]};return db[_0x7b7a('0x3d')][_0x7b7a('0x3e')](_0x4ccd94)[_0x7b7a('0x3f')](function(_0xb95727){_0x47f84c['count']=_0xb95727;if(_0x128b7e[_0x7b7a('0x2a')][_0x7b7a('0x40')]){_0x3c30fa[_0x7b7a('0x41')]=[{'all':!![]}];}return db[_0x7b7a('0x3d')][_0x7b7a('0x42')](_0x3c30fa);})[_0x7b7a('0x3f')](function(_0x4e5d48){_0x47f84c['rows']=_0x4e5d48;return _0x47f84c;})[_0x7b7a('0x3f')](respondWithFilteredResult(_0x484b43,_0x3c30fa))[_0x7b7a('0x43')](handleError(_0x484b43,null));};exports[_0x7b7a('0x44')]=function(_0x136570,_0x47286a){var _0x30e798={'raw':!![],'where':{'id':_0x136570['params']['id']}},_0x3aa48e={};_0x3aa48e[_0x7b7a('0x29')]=_[_0x7b7a('0x2b')](db['SquareDetailsReport'][_0x7b7a('0x28')]);_0x3aa48e[_0x7b7a('0x2a')]=_['keys'](_0x136570['query']);_0x3aa48e[_0x7b7a('0x2c')]=_[_0x7b7a('0x2d')](_0x3aa48e[_0x7b7a('0x29')],_0x3aa48e[_0x7b7a('0x2a')]);_0x30e798[_0x7b7a('0x2e')]=_[_0x7b7a('0x2d')](_0x3aa48e[_0x7b7a('0x29')],qs['fields'](_0x136570[_0x7b7a('0x2a')][_0x7b7a('0x2f')]));_0x30e798[_0x7b7a('0x2e')]=_0x30e798[_0x7b7a('0x2e')]['length']?_0x30e798[_0x7b7a('0x2e')]:_0x3aa48e['model'];if(_0x136570[_0x7b7a('0x2a')][_0x7b7a('0x40')]){_0x30e798[_0x7b7a('0x41')]=[{'all':!![]}];}_0x30e798=_[_0x7b7a('0x37')]({},_0x30e798,_0x136570[_0x7b7a('0x3c')]);return db[_0x7b7a('0x3d')][_0x7b7a('0x45')](_0x30e798)[_0x7b7a('0x3f')](handleEntityNotFound(_0x47286a,null))[_0x7b7a('0x3f')](respondWithResult(_0x47286a,null))[_0x7b7a('0x43')](handleError(_0x47286a,null));};exports[_0x7b7a('0x46')]=function(_0x2982a3,_0x559cf5){return db[_0x7b7a('0x3d')]['create'](_0x2982a3[_0x7b7a('0x47')],{})[_0x7b7a('0x3f')](respondWithResult(_0x559cf5,0xc9))[_0x7b7a('0x43')](handleError(_0x559cf5,null));};exports[_0x7b7a('0x23')]=function(_0x8fb2ba,_0x42bd4d){if(_0x8fb2ba[_0x7b7a('0x47')]['id']){delete _0x8fb2ba[_0x7b7a('0x47')]['id'];}return db['SquareDetailsReport'][_0x7b7a('0x45')]({'where':{'id':_0x8fb2ba[_0x7b7a('0x48')]['id']}})['then'](handleEntityNotFound(_0x42bd4d,null))[_0x7b7a('0x3f')](saveUpdates(_0x8fb2ba[_0x7b7a('0x47')],null))['then'](respondWithResult(_0x42bd4d,null))[_0x7b7a('0x43')](handleError(_0x42bd4d,null));};exports['destroy']=function(_0x3a0490,_0x2a8a87){return db[_0x7b7a('0x3d')][_0x7b7a('0x45')]({'where':{'id':_0x3a0490[_0x7b7a('0x48')]['id']}})[_0x7b7a('0x3f')](handleEntityNotFound(_0x2a8a87,null))[_0x7b7a('0x3f')](removeEntity(_0x2a8a87,null))['catch'](handleError(_0x2a8a87,null));};exports[_0x7b7a('0x49')]=function(_0x123292,_0x150d89){return db[_0x7b7a('0x3d')][_0x7b7a('0x49')]()['then'](respondWithResult(_0x150d89,null))['catch'](handleError(_0x150d89,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 267595f..98180e5 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 _0xc12c=['lodash','util','api','moment','request-promise','path','exports','define','SquareDetailsReport','report_square_details'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xc12c,0x1ae));var _0xcc12=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xc12c[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0xcc12('0x0'));var util=require(_0xcc12('0x1'));var logger=require('../../config/logger')(_0xcc12('0x2'));var moment=require(_0xcc12('0x3'));var BPromise=require('bluebird');var rp=require(_0xcc12('0x4'));var fs=require('fs');var path=require(_0xcc12('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0xcc12('0x6')]=function(_0x4d5b14,_0x2be28e){return _0x4d5b14[_0xcc12('0x7')](_0xcc12('0x8'),attributes,{'tableName':_0xcc12('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68f8=['rimraf','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','lodash','../../config/logger','bluebird','path'];(function(_0x47abb1,_0x3f5545){var _0x26ef7c=function(_0x1f7d42){while(--_0x1f7d42){_0x47abb1['push'](_0x47abb1['shift']());}};_0x26ef7c(++_0x3f5545);}(_0x68f8,0xf6));var _0x868f=function(_0xeabb69,_0x5b19e0){_0xeabb69=_0xeabb69-0x0;var _0x5ab35f=_0x68f8[_0xeabb69];return _0x5ab35f;};'use strict';var _=require(_0x868f('0x0'));var util=require('util');var logger=require(_0x868f('0x1'))('api');var moment=require('moment');var BPromise=require(_0x868f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x868f('0x3'));var rimraf=require(_0x868f('0x4'));var config=require(_0x868f('0x5'));var attributes=require(_0x868f('0x6'));module[_0x868f('0x7')]=function(_0x379633,_0x1ff3f0){return _0x379633['define'](_0x868f('0x8'),attributes,{'tableName':_0x868f('0x9'),'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 78c2474..9d6d8a3 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 _0xc417=['info','result','CreateSquareDetailsReport','body','options','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xa5b19d,_0x4b4750){var _0x28049e=function(_0x27169){while(--_0x27169){_0xa5b19d['push'](_0xa5b19d['shift']());}};_0x28049e(++_0x4b4750);}(_0xc417,0x13e));var _0x7c41=function(_0x2ebc93,_0x45af8f){_0x2ebc93=_0x2ebc93-0x0;var _0x357ac9=_0xc417[_0x2ebc93];return _0x357ac9;};'use strict';var _=require(_0x7c41('0x0'));var util=require('util');var moment=require(_0x7c41('0x1'));var BPromise=require(_0x7c41('0x2'));var rs=require(_0x7c41('0x3'));var fs=require('fs');var Redis=require(_0x7c41('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7c41('0x5'))(_0x7c41('0x6'));var config=require('../../config/environment');var jayson=require(_0x7c41('0x7'));var client=jayson['client'][_0x7c41('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23fb04,_0x5cae4b,_0x3d0feb){return new BPromise(function(_0x5adeb0,_0xe305d1){return client['request'](_0x23fb04,_0x3d0feb)[_0x7c41('0x9')](function(_0x65f6c6){logger['info'](_0x7c41('0xa'),_0x5cae4b,_0x7c41('0xb'));logger[_0x7c41('0xc')](_0x7c41('0xd'),_0x5cae4b,'request\x20sent',JSON[_0x7c41('0xe')](_0x65f6c6));if(_0x65f6c6[_0x7c41('0xf')]){if(_0x65f6c6[_0x7c41('0xf')][_0x7c41('0x10')]===0x1f4){logger[_0x7c41('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x5cae4b,_0x65f6c6[_0x7c41('0xf')]['message']);return _0xe305d1(_0x65f6c6[_0x7c41('0xf')][_0x7c41('0x11')]);}logger['error'](_0x7c41('0xa'),_0x5cae4b,_0x65f6c6['error'][_0x7c41('0x11')]);return _0x5adeb0(_0x65f6c6[_0x7c41('0xf')][_0x7c41('0x11')]);}else{logger[_0x7c41('0x12')](_0x7c41('0xa'),_0x5cae4b,_0x7c41('0xb'));_0x5adeb0(_0x65f6c6[_0x7c41('0x13')]['message']);}})['catch'](function(_0x3bd56c){logger['error'](_0x7c41('0xa'),_0x5cae4b,_0x3bd56c);_0xe305d1(_0x3bd56c);});});}exports[_0x7c41('0x14')]=function(_0x48b532){var _0x560e79=this;return new Promise(function(_0x1eaa77,_0x2cd0f5){return db['SquareDetailsReport']['create'](_0x48b532[_0x7c41('0x15')],{'raw':_0x48b532['options']?_0x48b532[_0x7c41('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x7c41('0x9')](function(_0x5dfcaf){logger[_0x7c41('0x12')]('CreateSquareDetailsReport',_0x48b532);logger[_0x7c41('0xc')](_0x7c41('0x14'),_0x48b532,JSON['stringify'](_0x5dfcaf));_0x1eaa77(_0x5dfcaf);})[_0x7c41('0x17')](function(_0x4def77){logger[_0x7c41('0xf')](_0x7c41('0x14'),_0x4def77[_0x7c41('0x11')],_0x48b532);_0x2cd0f5(_0x560e79[_0x7c41('0xf')](0x1f4,_0x4def77[_0x7c41('0x11')]));});});}; \ No newline at end of file +var _0xb6a6=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareDetailsReport','create','body','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x566861,_0x24fffa){var _0x439d39=function(_0x41ae34){while(--_0x41ae34){_0x566861['push'](_0x566861['shift']());}};_0x439d39(++_0x24fffa);}(_0xb6a6,0x107));var _0x6b6a=function(_0x1ad2c5,_0x4a9fe1){_0x1ad2c5=_0x1ad2c5-0x0;var _0x3e5f5f=_0xb6a6[_0x1ad2c5];return _0x3e5f5f;};'use strict';var _=require(_0x6b6a('0x0'));var util=require(_0x6b6a('0x1'));var moment=require(_0x6b6a('0x2'));var BPromise=require(_0x6b6a('0x3'));var rs=require(_0x6b6a('0x4'));var fs=require('fs');var Redis=require(_0x6b6a('0x5'));var db=require(_0x6b6a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b6a('0x7'))('rpc');var config=require(_0x6b6a('0x8'));var jayson=require(_0x6b6a('0x9'));var client=jayson[_0x6b6a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f8fa7,_0x881863,_0x208a47){return new BPromise(function(_0x239097,_0x4da69c){return client[_0x6b6a('0xb')](_0x3f8fa7,_0x208a47)[_0x6b6a('0xc')](function(_0x41aa09){logger[_0x6b6a('0xd')](_0x6b6a('0xe'),_0x881863,'request\x20sent');logger[_0x6b6a('0xf')](_0x6b6a('0x10'),_0x881863,_0x6b6a('0x11'),JSON[_0x6b6a('0x12')](_0x41aa09));if(_0x41aa09[_0x6b6a('0x13')]){if(_0x41aa09[_0x6b6a('0x13')][_0x6b6a('0x14')]===0x1f4){logger[_0x6b6a('0x13')](_0x6b6a('0xe'),_0x881863,_0x41aa09[_0x6b6a('0x13')][_0x6b6a('0x15')]);return _0x4da69c(_0x41aa09[_0x6b6a('0x13')][_0x6b6a('0x15')]);}logger[_0x6b6a('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0x881863,_0x41aa09[_0x6b6a('0x13')][_0x6b6a('0x15')]);return _0x239097(_0x41aa09['error'][_0x6b6a('0x15')]);}else{logger['info'](_0x6b6a('0xe'),_0x881863,_0x6b6a('0x11'));_0x239097(_0x41aa09[_0x6b6a('0x16')][_0x6b6a('0x15')]);}})[_0x6b6a('0x17')](function(_0x200235){logger[_0x6b6a('0x13')](_0x6b6a('0xe'),_0x881863,_0x200235);_0x4da69c(_0x200235);});});}exports[_0x6b6a('0x18')]=function(_0xd3af09){var _0x2dc3f1=this;return new Promise(function(_0x532842,_0x3ee1bc){return db['SquareDetailsReport'][_0x6b6a('0x19')](_0xd3af09[_0x6b6a('0x1a')],{'raw':_0xd3af09['options']?_0xd3af09['options']['raw']===undefined?!![]:![]:!![]})[_0x6b6a('0xc')](function(_0x49fc13){logger[_0x6b6a('0xd')](_0x6b6a('0x18'),_0xd3af09);logger[_0x6b6a('0xf')]('CreateSquareDetailsReport',_0xd3af09,JSON[_0x6b6a('0x12')](_0x49fc13));_0x532842(_0x49fc13);})[_0x6b6a('0x17')](function(_0x513b32){logger[_0x6b6a('0x13')](_0x6b6a('0x18'),_0x513b32['message'],_0xd3af09);_0x3ee1bc(_0x2dc3f1[_0x6b6a('0x13')](0x1f4,_0x513b32['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index b0016c9..e4c5041 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 _0x79e2=['exports','express','../../components/auth/service','./system.controller','get','index','/process/:pid/kill','isAuthenticated','killProcess'];(function(_0x460919,_0x1391eb){var _0x8f5776=function(_0x27ce4a){while(--_0x27ce4a){_0x460919['push'](_0x460919['shift']());}};_0x8f5776(++_0x1391eb);}(_0x79e2,0x1c3));var _0x279e=function(_0x347c57,_0xe9c217){_0x347c57=_0x347c57-0x0;var _0x421c62=_0x79e2[_0x347c57];return _0x421c62;};'use strict';var express=require(_0x279e('0x0'));var router=express['Router']();var auth=require(_0x279e('0x1'));var controller=require(_0x279e('0x2'));router[_0x279e('0x3')]('/',auth['isAuthenticated'](),controller[_0x279e('0x4')]);router['get'](_0x279e('0x5'),auth[_0x279e('0x6')](),controller[_0x279e('0x7')]);module[_0x279e('0x8')]=router; \ No newline at end of file +var _0xee14=['index','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','./system.controller','get','isAuthenticated'];(function(_0x123076,_0x11538e){var _0x1fa77c=function(_0x24fc47){while(--_0x24fc47){_0x123076['push'](_0x123076['shift']());}};_0x1fa77c(++_0x11538e);}(_0xee14,0x14e));var _0x4ee1=function(_0x53baf7,_0x2c8d54){_0x53baf7=_0x53baf7-0x0;var _0x96485e=_0xee14[_0x53baf7];return _0x96485e;};'use strict';var express=require(_0x4ee1('0x0'));var router=express[_0x4ee1('0x1')]();var auth=require(_0x4ee1('0x2'));var controller=require(_0x4ee1('0x3'));router[_0x4ee1('0x4')]('/',auth[_0x4ee1('0x5')](),controller[_0x4ee1('0x6')]);router['get'](_0x4ee1('0x7'),auth[_0x4ee1('0x5')](),controller[_0x4ee1('0x8')]);module[_0x4ee1('0x9')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 912d9fc..3807f6b 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 _0xcd7a=['send','index','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','../../config/logger','api','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xcd7a,0x115));var _0xacd7=function(_0x5d90d1,_0x11f657){_0x5d90d1=_0x5d90d1-0x0;var _0x3f5d03=_0xcd7a[_0x5d90d1];return _0x3f5d03;};'use strict';var info=require(_0xacd7('0x0'));var exec=require('child_process')['exec'];var logger=require(_0xacd7('0x1'))(_0xacd7('0x2'));var util=require('util');var BPromise=require('bluebird');var _=require(_0xacd7('0x3'));function handleError(_0x1d8ac6,_0x2c3746,_0x382905){_0x2c3746=_0x2c3746||0x1f4;return function(_0x425fd6){logger[_0xacd7('0x4')](_0xacd7('0x5'),_0x382905,_0x2c3746,util[_0xacd7('0x6')](_0x425fd6,{'showHidden':![],'depth':null}));delete _0x425fd6[_0xacd7('0x7')];_0x1d8ac6[_0xacd7('0x8')](_0x2c3746)[_0xacd7('0x9')](_0x425fd6);};}exports[_0xacd7('0xa')]=function(_0x236bd6,_0x356c49){return info['getAllData']()[_0xacd7('0xb')](function(_0x11a8cc){return _0x356c49[_0xacd7('0x8')](0xc8)[_0xacd7('0xc')](_0x11a8cc);})[_0xacd7('0xd')](function(_0x2e740d){return _0x356c49['status'](0x1f4)[_0xacd7('0xc')](_0x2e740d);});};exports[_0xacd7('0xe')]=function(_0x5b5181,_0x1e533){var _0x120eb4=[_0xacd7('0xf')];return new BPromise(function(_0x5c3671,_0x560e23){return exec(util[_0xacd7('0x10')](_0xacd7('0x11'),_0x5b5181[_0xacd7('0x12')]['pid']),function(_0x52e6f3,_0xe31ed,_0x426b0d){if(_0x52e6f3){return _0x560e23(_0x52e6f3);}return _0x5c3671(_0xe31ed);});})[_0xacd7('0xb')](function(_0x100153){var _0x39ac19=![];var _0x133548=_0x100153[_0xacd7('0x13')](/\n/);for(var _0x3ae5d3=0x0,_0x37a6c7=_0x120eb4[_0xacd7('0x14')];_0x3ae5d3<_0x37a6c7,_0x39ac19===![];_0x3ae5d3+=0x1){if(_0x100153[_0xacd7('0x15')](_0x120eb4[_0x3ae5d3])>=0x0){_0x39ac19=!![];}}if(!_0x39ac19){throw new Error(util[_0xacd7('0x10')](_0xacd7('0x16'),_0x5b5181[_0xacd7('0x12')][_0xacd7('0x17')]));}process[_0xacd7('0x18')](_0x5b5181[_0xacd7('0x12')]['pid'],'SIGINT');return _0x1e533['status'](0xc8)[_0xacd7('0xc')]({'message':util[_0xacd7('0x10')](_0xacd7('0x19'),_0x5b5181[_0xacd7('0x12')][_0xacd7('0x17')])});})['catch'](handleError(_0x1e533,null,_0xacd7('0xe')));}; \ No newline at end of file +var _0xf0cc=['systeminformation','child_process','exec','../../config/logger','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','getAllData','then','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','params','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0x2f257e,_0x49af2c){var _0x16293c=function(_0x59f6d9){while(--_0x59f6d9){_0x2f257e['push'](_0x2f257e['shift']());}};_0x16293c(++_0x49af2c);}(_0xf0cc,0xf3));var _0xcf0c=function(_0xf6ebcc,_0x593a35){_0xf6ebcc=_0xf6ebcc-0x0;var _0x30cab6=_0xf0cc[_0xf6ebcc];return _0x30cab6;};'use strict';var info=require(_0xcf0c('0x0'));var exec=require(_0xcf0c('0x1'))[_0xcf0c('0x2')];var logger=require(_0xcf0c('0x3'))('api');var util=require(_0xcf0c('0x4'));var BPromise=require(_0xcf0c('0x5'));var _=require(_0xcf0c('0x6'));function handleError(_0x4f7b54,_0x1bfa54,_0x6beb95){_0x1bfa54=_0x1bfa54||0x1f4;return function(_0x11e077){logger[_0xcf0c('0x7')](_0xcf0c('0x8'),_0x6beb95,_0x1bfa54,util['inspect'](_0x11e077,{'showHidden':![],'depth':null}));delete _0x11e077[_0xcf0c('0x9')];_0x4f7b54[_0xcf0c('0xa')](_0x1bfa54)[_0xcf0c('0xb')](_0x11e077);};}exports['index']=function(_0x171fae,_0x6ad0ce){return info[_0xcf0c('0xc')]()[_0xcf0c('0xd')](function(_0x2632d2){return _0x6ad0ce[_0xcf0c('0xa')](0xc8)[_0xcf0c('0xe')](_0x2632d2);})[_0xcf0c('0xf')](function(_0x56d33d){return _0x6ad0ce[_0xcf0c('0xa')](0x1f4)[_0xcf0c('0xe')](_0x56d33d);});};exports['killProcess']=function(_0x168b25,_0x27b26e){var _0x3ba8fc=[_0xcf0c('0x10')];return new BPromise(function(_0x378252,_0x5c3011){return exec(util[_0xcf0c('0x11')](_0xcf0c('0x12'),_0x168b25['params'][_0xcf0c('0x13')]),function(_0x2e6694,_0x511db3,_0x5e9ac3){if(_0x2e6694){return _0x5c3011(_0x2e6694);}return _0x378252(_0x511db3);});})[_0xcf0c('0xd')](function(_0x3d9ffb){var _0xa095fa=![];var _0x2a5099=_0x3d9ffb[_0xcf0c('0x14')](/\n/);for(var _0x10fc22=0x0,_0x528461=_0x3ba8fc[_0xcf0c('0x15')];_0x10fc22<_0x528461,_0xa095fa===![];_0x10fc22+=0x1){if(_0x3d9ffb[_0xcf0c('0x16')](_0x3ba8fc[_0x10fc22])>=0x0){_0xa095fa=!![];}}if(!_0xa095fa){throw new Error(util[_0xcf0c('0x11')](_0xcf0c('0x17'),_0x168b25['params'][_0xcf0c('0x13')]));}process[_0xcf0c('0x18')](_0x168b25[_0xcf0c('0x19')][_0xcf0c('0x13')],'SIGINT');return _0x27b26e[_0xcf0c('0xa')](0xc8)[_0xcf0c('0xe')]({'message':util[_0xcf0c('0x11')](_0xcf0c('0x1a'),_0x168b25[_0xcf0c('0x19')][_0xcf0c('0x13')])});})['catch'](handleError(_0x27b26e,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index e0436ad..325fddb 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 _0x9bde=['util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','create','put','destroy'];(function(_0x4b0018,_0x27546f){var _0x4e7656=function(_0x19ba00){while(--_0x19ba00){_0x4b0018['push'](_0x4b0018['shift']());}};_0x4e7656(++_0x27546f);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2fb143,_0x21eed3){_0x2fb143=_0x2fb143-0x0;var _0x5df2b6=_0x9bde[_0x2fb143];return _0x5df2b6;};'use strict';var multer=require('multer');var util=require(_0xe9bd('0x0'));var path=require('path');var timeout=require(_0xe9bd('0x1'));var express=require('express');var router=express[_0xe9bd('0x2')]();var auth=require(_0xe9bd('0x3'));var interaction=require(_0xe9bd('0x4'));var config=require(_0xe9bd('0x5'));var controller=require(_0xe9bd('0x6'));router[_0xe9bd('0x7')]('/',auth[_0xe9bd('0x8')](),controller['index']);router[_0xe9bd('0x7')](_0xe9bd('0x9'),auth[_0xe9bd('0x8')](),controller[_0xe9bd('0xa')]);router[_0xe9bd('0xb')]('/',auth[_0xe9bd('0x8')](),controller[_0xe9bd('0xc')]);router[_0xe9bd('0xd')](_0xe9bd('0x9'),auth[_0xe9bd('0x8')](),controller['update']);router['delete'](_0xe9bd('0x9'),auth[_0xe9bd('0x8')](),controller[_0xe9bd('0xe')]);module['exports']=router; \ No newline at end of file +var _0x22fb=['delete','destroy','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0xbb51f3,_0x50f4aa){var _0x4261ef=function(_0x3eec19){while(--_0x3eec19){_0xbb51f3['push'](_0xbb51f3['shift']());}};_0x4261ef(++_0x50f4aa);}(_0x22fb,0x192));var _0xb22f=function(_0x179e46,_0x1017ac){_0x179e46=_0x179e46-0x0;var _0x232b99=_0x22fb[_0x179e46];return _0x232b99;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb22f('0x0'));var timeout=require('connect-timeout');var express=require(_0xb22f('0x1'));var router=express[_0xb22f('0x2')]();var auth=require(_0xb22f('0x3'));var interaction=require(_0xb22f('0x4'));var config=require(_0xb22f('0x5'));var controller=require('./tag.controller');router[_0xb22f('0x6')]('/',auth[_0xb22f('0x7')](),controller[_0xb22f('0x8')]);router[_0xb22f('0x6')](_0xb22f('0x9'),auth[_0xb22f('0x7')](),controller['show']);router[_0xb22f('0xa')]('/',auth[_0xb22f('0x7')](),controller[_0xb22f('0xb')]);router[_0xb22f('0xc')](_0xb22f('0x9'),auth[_0xb22f('0x7')](),controller[_0xb22f('0xd')]);router[_0xb22f('0xe')](_0xb22f('0x9'),auth[_0xb22f('0x7')](),controller[_0xb22f('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index e0d1dea..b2701b3 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 _0x36ee=['STRING','#0091EA'];(function(_0x4edae2,_0x3afbba){var _0x36913f=function(_0x466e9a){while(--_0x466e9a){_0x4edae2['push'](_0x4edae2['shift']());}};_0x36913f(++_0x3afbba);}(_0x36ee,0xe8));var _0xe36e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x36ee[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe36e('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xe36e('0x0')],'defaultValue':_0xe36e('0x1')},'description':{'type':Sequelize[_0xe36e('0x0')]}}; \ No newline at end of file +var _0x4483=['exports','STRING','#0091EA','sequelize'];(function(_0x1777c4,_0xc5eee5){var _0x3e2d1a=function(_0x5909e0){while(--_0x5909e0){_0x1777c4['push'](_0x1777c4['shift']());}};_0x3e2d1a(++_0xc5eee5);}(_0x4483,0x1a3));var _0x3448=function(_0x57fc8f,_0x35fb1e){_0x57fc8f=_0x57fc8f-0x0;var _0xcf58f7=_0x4483[_0x57fc8f];return _0xcf58f7;};'use strict';var Sequelize=require(_0x3448('0x0'));module[_0x3448('0x1')]={'name':{'type':Sequelize[_0x3448('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3448('0x2')],'defaultValue':_0x3448('0x3')},'description':{'type':Sequelize[_0x3448('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index a4f4df0..4fc2186 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 _0x9e5e=['keys','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','Tags','error','stack','name','send','Tag','rawAttributes'];(function(_0x4eee6b,_0x36fe2b){var _0x32b0be=function(_0x3a068f){while(--_0x3a068f){_0x4eee6b['push'](_0x4eee6b['shift']());}};_0x32b0be(++_0x36fe2b);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x9e5e[_0x4fbfd9];return _0x31dc94;};'use strict';var pdf=require(_0xe9e5('0x0'));var emlformat=require(_0xe9e5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe9e5('0x2'));var jsonpatch=require(_0xe9e5('0x3'));var rp=require(_0xe9e5('0x4'));var moment=require('moment');var BPromise=require(_0xe9e5('0x5'));var Mustache=require('mustache');var util=require(_0xe9e5('0x6'));var path=require(_0xe9e5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe9e5('0x8'));var fs=require('fs');var _=require(_0xe9e5('0x9'));var squel=require('squel');var crypto=require(_0xe9e5('0xa'));var jsforce=require(_0xe9e5('0xb'));var deskjs=require(_0xe9e5('0xc'));var toCsv=require(_0xe9e5('0xd'));var querystring=require(_0xe9e5('0xe'));var Papa=require(_0xe9e5('0xf'));var Redis=require(_0xe9e5('0x10'));var authService=require(_0xe9e5('0x11'));var qs=require(_0xe9e5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9e5('0x13'))(_0xe9e5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x517c91,_0x439466){_0x439466=_0x439466||0xcc;return function(_0x145c5f){if(_0x145c5f){return _0x517c91[_0xe9e5('0x15')](_0x439466);}return _0x517c91[_0xe9e5('0x16')](_0x439466)[_0xe9e5('0x17')]();};}function respondWithResult(_0x4aab69,_0xd2e5a4){_0xd2e5a4=_0xd2e5a4||0xc8;return function(_0x3bfbab){if(_0x3bfbab){return _0x4aab69[_0xe9e5('0x16')](_0xd2e5a4)[_0xe9e5('0x18')](_0x3bfbab);}};}function respondWithFilteredResult(_0x5c901a,_0x2787c3){return function(_0xd07ceb){if(_0xd07ceb){var _0x35c830=_0xd07ceb[_0xe9e5('0x19')],_0x3f0990=_0x2787c3[_0xe9e5('0x1a')],_0x17990d=_0x2787c3[_0xe9e5('0x1a')]+_0x2787c3[_0xe9e5('0x1b')],_0x695c52;if(_0x17990d>=_0x35c830){_0x17990d=_0x35c830;_0x695c52=0xc8;}else{_0x695c52=0xce;}_0x5c901a['status'](_0x695c52);return _0x5c901a[_0xe9e5('0x1c')](_0xe9e5('0x1d'),_0x3f0990+'-'+_0x17990d+'/'+_0x35c830)[_0xe9e5('0x18')](_0xd07ceb);}return null;};}function patchUpdates(_0x3ad9f9){return function(_0x28dfbe){try{jsonpatch[_0xe9e5('0x1e')](_0x28dfbe,_0x3ad9f9,!![]);}catch(_0x3855d9){return BPromise[_0xe9e5('0x1f')](_0x3855d9);}return _0x28dfbe[_0xe9e5('0x20')]();};}function saveUpdates(_0x3ba6f5,_0x5621f9){return function(_0x55a056){if(_0x55a056){return _0x55a056['update'](_0x3ba6f5)[_0xe9e5('0x21')](function(_0x445a81){return _0x445a81;});}return null;};}function removeEntity(_0x2935a4,_0x401f18){return function(_0x4143dc){if(_0x4143dc){return _0x4143dc[_0xe9e5('0x22')]()[_0xe9e5('0x21')](function(){var _0x15db4b=_0x4143dc[_0xe9e5('0x23')]({'plain':!![]});var _0x43c0e4=_0xe9e5('0x24');return db['UserProfileResource'][_0xe9e5('0x22')]({'where':{'type':_0x43c0e4,'resourceId':_0x15db4b['id']}})['then'](function(){return _0x4143dc;});})[_0xe9e5('0x21')](function(){_0x2935a4['status'](0xcc)[_0xe9e5('0x17')]();});}};}function handleEntityNotFound(_0x5804da,_0x5ac8fc){return function(_0x5e84dc){if(!_0x5e84dc){_0x5804da[_0xe9e5('0x15')](0x194);}return _0x5e84dc;};}function handleError(_0x7e62c7,_0x338076){_0x338076=_0x338076||0x1f4;return function(_0x327cb2){logger[_0xe9e5('0x25')](_0x327cb2[_0xe9e5('0x26')]);if(_0x327cb2[_0xe9e5('0x27')]){delete _0x327cb2[_0xe9e5('0x27')];}_0x7e62c7[_0xe9e5('0x16')](_0x338076)[_0xe9e5('0x28')](_0x327cb2);};}exports['index']=function(_0x3814f4,_0x56f728){var _0xe7d11e={},_0x18969d={},_0x554bcb={'count':0x0,'rows':[]};var _0x4161e9=db[_0xe9e5('0x29')][_0xe9e5('0x2a')];_0x18969d['model']=_[_0xe9e5('0x2b')](_0x4161e9);_0x18969d['query']=_[_0xe9e5('0x2b')](_0x3814f4[_0xe9e5('0x2c')]);_0x18969d['filters']=_[_0xe9e5('0x2d')](_0x18969d[_0xe9e5('0x2e')],_0x18969d['query']);_0xe7d11e[_0xe9e5('0x2f')]=_[_0xe9e5('0x2d')](_0x18969d[_0xe9e5('0x2e')],qs[_0xe9e5('0x30')](_0x3814f4[_0xe9e5('0x2c')][_0xe9e5('0x30')]));_0xe7d11e['attributes']=_0xe7d11e['attributes'][_0xe9e5('0x31')]?_0xe7d11e[_0xe9e5('0x2f')]:_0x18969d['model'];if(!_0x3814f4[_0xe9e5('0x2c')][_0xe9e5('0x32')]('nolimit')){_0xe7d11e['limit']=qs[_0xe9e5('0x1b')](_0x3814f4['query']['limit']);_0xe7d11e[_0xe9e5('0x1a')]=qs[_0xe9e5('0x1a')](_0x3814f4[_0xe9e5('0x2c')][_0xe9e5('0x1a')]);}_0xe7d11e[_0xe9e5('0x33')]=qs[_0xe9e5('0x34')](_0x3814f4[_0xe9e5('0x2c')][_0xe9e5('0x34')]);_0xe7d11e[_0xe9e5('0x35')]=qs[_0xe9e5('0x36')](_[_0xe9e5('0x37')](_0x3814f4[_0xe9e5('0x2c')],_0x18969d[_0xe9e5('0x36')]));if(_0x3814f4['query'][_0xe9e5('0x38')]){_0xe7d11e[_0xe9e5('0x35')]=_[_0xe9e5('0x39')](_0xe7d11e[_0xe9e5('0x35')],{'$or':_[_0xe9e5('0x3a')](_0x4161e9,function(_0x23994c){if(_0x23994c['type'][_0xe9e5('0x3b')]!==_0xe9e5('0x3c')){var _0x2afe8c={};_0x2afe8c[_0x23994c['field']]={'$like':'%'+_0x3814f4[_0xe9e5('0x2c')][_0xe9e5('0x38')]+'%'};return _0x2afe8c;}})});}_0xe7d11e=_[_0xe9e5('0x39')]({},_0xe7d11e,_0x3814f4[_0xe9e5('0x3d')]);var _0x3353d6={'where':_0xe7d11e[_0xe9e5('0x35')]};return db[_0xe9e5('0x29')]['count'](_0x3353d6)['then'](function(_0x18e8e1){_0x554bcb[_0xe9e5('0x19')]=_0x18e8e1;if(_0x3814f4[_0xe9e5('0x2c')][_0xe9e5('0x3e')]){_0xe7d11e[_0xe9e5('0x3f')]=[{'all':!![]}];}return db['Tag'][_0xe9e5('0x40')](_0xe7d11e);})['then'](function(_0x1c8e1f){_0x554bcb['rows']=_0x1c8e1f;return _0x554bcb;})[_0xe9e5('0x21')](respondWithFilteredResult(_0x56f728,_0xe7d11e))[_0xe9e5('0x41')](handleError(_0x56f728,null));};exports['show']=function(_0x1abb5d,_0x47c5ea){var _0x142687={'raw':!![],'where':{'id':_0x1abb5d[_0xe9e5('0x42')]['id']}},_0x2ff35a={};_0x2ff35a[_0xe9e5('0x2e')]=_[_0xe9e5('0x2b')](db[_0xe9e5('0x29')][_0xe9e5('0x2a')]);_0x2ff35a[_0xe9e5('0x2c')]=_[_0xe9e5('0x2b')](_0x1abb5d[_0xe9e5('0x2c')]);_0x2ff35a[_0xe9e5('0x36')]=_['intersection'](_0x2ff35a[_0xe9e5('0x2e')],_0x2ff35a[_0xe9e5('0x2c')]);_0x142687[_0xe9e5('0x2f')]=_[_0xe9e5('0x2d')](_0x2ff35a['model'],qs['fields'](_0x1abb5d[_0xe9e5('0x2c')]['fields']));_0x142687[_0xe9e5('0x2f')]=_0x142687[_0xe9e5('0x2f')][_0xe9e5('0x31')]?_0x142687[_0xe9e5('0x2f')]:_0x2ff35a[_0xe9e5('0x2e')];if(_0x1abb5d['query'][_0xe9e5('0x3e')]){_0x142687['include']=[{'all':!![]}];}_0x142687=_['merge']({},_0x142687,_0x1abb5d['options']);return db[_0xe9e5('0x29')][_0xe9e5('0x43')](_0x142687)[_0xe9e5('0x21')](handleEntityNotFound(_0x47c5ea,null))[_0xe9e5('0x21')](respondWithResult(_0x47c5ea,null))[_0xe9e5('0x41')](handleError(_0x47c5ea,null));};exports[_0xe9e5('0x44')]=function(_0x27494c,_0x205b1c){return db['Tag'][_0xe9e5('0x44')](_0x27494c[_0xe9e5('0x45')],{})[_0xe9e5('0x21')](function(_0x441839){var _0x2b785e=_0x27494c[_0xe9e5('0x46')][_0xe9e5('0x23')]({'plain':!![]});if(!_0x2b785e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b785e['role']===_0xe9e5('0x46')){var _0x4e8b56=_0x441839[_0xe9e5('0x23')]({'plain':!![]});var _0x20be8f=_0xe9e5('0x24');return db['UserProfileSection'][_0xe9e5('0x43')]({'where':{'name':_0x20be8f,'userProfileId':_0x2b785e[_0xe9e5('0x47')]},'raw':!![]})[_0xe9e5('0x21')](function(_0x32c589){if(_0x32c589&&_0x32c589['autoAssociation']===0x0){return db[_0xe9e5('0x48')][_0xe9e5('0x44')]({'name':_0x4e8b56[_0xe9e5('0x27')],'resourceId':_0x4e8b56['id'],'type':_0x32c589[_0xe9e5('0x27')],'sectionId':_0x32c589['id']},{})[_0xe9e5('0x21')](function(){return _0x441839;});}else{return _0x441839;}})[_0xe9e5('0x41')](function(_0x3f1443){logger[_0xe9e5('0x25')](_0xe9e5('0x49'),_0x3f1443);throw _0x3f1443;});}return _0x441839;})['then'](respondWithResult(_0x205b1c,0xc9))['catch'](handleError(_0x205b1c,null));};exports[_0xe9e5('0x4a')]=function(_0x341853,_0x275022){if(_0x341853[_0xe9e5('0x45')]['id']){delete _0x341853[_0xe9e5('0x45')]['id'];}return db[_0xe9e5('0x29')][_0xe9e5('0x43')]({'where':{'id':_0x341853[_0xe9e5('0x42')]['id']}})['then'](handleEntityNotFound(_0x275022,null))['then'](saveUpdates(_0x341853['body'],null))[_0xe9e5('0x21')](respondWithResult(_0x275022,null))[_0xe9e5('0x41')](handleError(_0x275022,null));};exports[_0xe9e5('0x22')]=function(_0x198ce0,_0x43b399){return db[_0xe9e5('0x29')][_0xe9e5('0x43')]({'where':{'id':_0x198ce0['params']['id']}})[_0xe9e5('0x21')](handleEntityNotFound(_0x43b399,null))['then'](removeEntity(_0x43b399,null))[_0xe9e5('0x41')](handleError(_0x43b399,null));}; \ No newline at end of file +var _0x2ec8=['merge','map','field','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','update','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','json','reject','then','destroy','get','Tags','UserProfileResource','stack','name','send','index','Tag','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x21b6c3,_0x539e3d){var _0xc6d101=function(_0x1bdaea){while(--_0x1bdaea){_0x21b6c3['push'](_0x21b6c3['shift']());}};_0xc6d101(++_0x539e3d);}(_0x2ec8,0x188));var _0x82ec=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2ec8[_0x3947c9];return _0x2e7871;};'use strict';var pdf=require(_0x82ec('0x0'));var emlformat=require(_0x82ec('0x1'));var rimraf=require(_0x82ec('0x2'));var zipdir=require(_0x82ec('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x82ec('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x82ec('0x5'));var util=require('util');var path=require(_0x82ec('0x6'));var sox=require(_0x82ec('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x82ec('0x8'));var jsforce=require(_0x82ec('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x82ec('0xa'));var Papa=require(_0x82ec('0xb'));var Redis=require('ioredis');var authService=require(_0x82ec('0xc'));var qs=require(_0x82ec('0xd'));var hardwareService=require(_0x82ec('0xe'));var logger=require(_0x82ec('0xf'))(_0x82ec('0x10'));var utils=require('../../config/utils');var config=require(_0x82ec('0x11'));var db=require(_0x82ec('0x12'))['db'];function respondWithStatusCode(_0x445d3f,_0x55717e){_0x55717e=_0x55717e||0xcc;return function(_0x317339){if(_0x317339){return _0x445d3f[_0x82ec('0x13')](_0x55717e);}return _0x445d3f['status'](_0x55717e)[_0x82ec('0x14')]();};}function respondWithResult(_0x52f476,_0x2a57c2){_0x2a57c2=_0x2a57c2||0xc8;return function(_0x43ec87){if(_0x43ec87){return _0x52f476[_0x82ec('0x15')](_0x2a57c2)['json'](_0x43ec87);}};}function respondWithFilteredResult(_0x39cdfe,_0x58c4d5){return function(_0x1f0b2c){if(_0x1f0b2c){var _0x4ce834=_0x1f0b2c[_0x82ec('0x16')],_0x5dd9d9=_0x58c4d5[_0x82ec('0x17')],_0x57a4f3=_0x58c4d5[_0x82ec('0x17')]+_0x58c4d5[_0x82ec('0x18')],_0x2355ad;if(_0x57a4f3>=_0x4ce834){_0x57a4f3=_0x4ce834;_0x2355ad=0xc8;}else{_0x2355ad=0xce;}_0x39cdfe[_0x82ec('0x15')](_0x2355ad);return _0x39cdfe[_0x82ec('0x19')]('Content-Range',_0x5dd9d9+'-'+_0x57a4f3+'/'+_0x4ce834)[_0x82ec('0x1a')](_0x1f0b2c);}return null;};}function patchUpdates(_0x2d9aa7){return function(_0x5430a9){try{jsonpatch['apply'](_0x5430a9,_0x2d9aa7,!![]);}catch(_0x430443){return BPromise[_0x82ec('0x1b')](_0x430443);}return _0x5430a9['save']();};}function saveUpdates(_0x16394c,_0x58ec7c){return function(_0x2e687e){if(_0x2e687e){return _0x2e687e['update'](_0x16394c)[_0x82ec('0x1c')](function(_0x29ba81){return _0x29ba81;});}return null;};}function removeEntity(_0x1f2e72,_0x2c54ce){return function(_0x161cb4){if(_0x161cb4){return _0x161cb4[_0x82ec('0x1d')]()[_0x82ec('0x1c')](function(){var _0x550290=_0x161cb4[_0x82ec('0x1e')]({'plain':!![]});var _0x5e8abb=_0x82ec('0x1f');return db[_0x82ec('0x20')][_0x82ec('0x1d')]({'where':{'type':_0x5e8abb,'resourceId':_0x550290['id']}})[_0x82ec('0x1c')](function(){return _0x161cb4;});})[_0x82ec('0x1c')](function(){_0x1f2e72['status'](0xcc)[_0x82ec('0x14')]();});}};}function handleEntityNotFound(_0x14ddcf,_0x3b66d5){return function(_0x22f671){if(!_0x22f671){_0x14ddcf['sendStatus'](0x194);}return _0x22f671;};}function handleError(_0x24ce5f,_0x533a2e){_0x533a2e=_0x533a2e||0x1f4;return function(_0x397abc){logger['error'](_0x397abc[_0x82ec('0x21')]);if(_0x397abc[_0x82ec('0x22')]){delete _0x397abc[_0x82ec('0x22')];}_0x24ce5f[_0x82ec('0x15')](_0x533a2e)[_0x82ec('0x23')](_0x397abc);};}exports[_0x82ec('0x24')]=function(_0xaa0f81,_0x21e69d){var _0x4b94d1={},_0x12cb9e={},_0x309b2c={'count':0x0,'rows':[]};var _0xe8c4a2=db[_0x82ec('0x25')]['rawAttributes'];_0x12cb9e[_0x82ec('0x26')]=_[_0x82ec('0x27')](_0xe8c4a2);_0x12cb9e['query']=_[_0x82ec('0x27')](_0xaa0f81[_0x82ec('0x28')]);_0x12cb9e[_0x82ec('0x29')]=_[_0x82ec('0x2a')](_0x12cb9e[_0x82ec('0x26')],_0x12cb9e['query']);_0x4b94d1[_0x82ec('0x2b')]=_[_0x82ec('0x2a')](_0x12cb9e['model'],qs[_0x82ec('0x2c')](_0xaa0f81[_0x82ec('0x28')][_0x82ec('0x2c')]));_0x4b94d1['attributes']=_0x4b94d1[_0x82ec('0x2b')][_0x82ec('0x2d')]?_0x4b94d1['attributes']:_0x12cb9e[_0x82ec('0x26')];if(!_0xaa0f81[_0x82ec('0x28')][_0x82ec('0x2e')]('nolimit')){_0x4b94d1[_0x82ec('0x18')]=qs[_0x82ec('0x18')](_0xaa0f81[_0x82ec('0x28')][_0x82ec('0x18')]);_0x4b94d1[_0x82ec('0x17')]=qs['offset'](_0xaa0f81[_0x82ec('0x28')][_0x82ec('0x17')]);}_0x4b94d1[_0x82ec('0x2f')]=qs[_0x82ec('0x30')](_0xaa0f81[_0x82ec('0x28')][_0x82ec('0x30')]);_0x4b94d1[_0x82ec('0x31')]=qs['filters'](_[_0x82ec('0x32')](_0xaa0f81[_0x82ec('0x28')],_0x12cb9e[_0x82ec('0x29')]));if(_0xaa0f81[_0x82ec('0x28')][_0x82ec('0x33')]){_0x4b94d1[_0x82ec('0x31')]=_[_0x82ec('0x34')](_0x4b94d1[_0x82ec('0x31')],{'$or':_[_0x82ec('0x35')](_0xe8c4a2,function(_0xe5c27a){if(_0xe5c27a['type']['key']!=='VIRTUAL'){var _0x1300f2={};_0x1300f2[_0xe5c27a[_0x82ec('0x36')]]={'$like':'%'+_0xaa0f81['query'][_0x82ec('0x33')]+'%'};return _0x1300f2;}})});}_0x4b94d1=_[_0x82ec('0x34')]({},_0x4b94d1,_0xaa0f81[_0x82ec('0x37')]);var _0x80a185={'where':_0x4b94d1['where']};return db[_0x82ec('0x25')][_0x82ec('0x16')](_0x80a185)[_0x82ec('0x1c')](function(_0x1ba462){_0x309b2c[_0x82ec('0x16')]=_0x1ba462;if(_0xaa0f81[_0x82ec('0x28')][_0x82ec('0x38')]){_0x4b94d1[_0x82ec('0x39')]=[{'all':!![]}];}return db[_0x82ec('0x25')][_0x82ec('0x3a')](_0x4b94d1);})[_0x82ec('0x1c')](function(_0x1b9a71){_0x309b2c[_0x82ec('0x3b')]=_0x1b9a71;return _0x309b2c;})[_0x82ec('0x1c')](respondWithFilteredResult(_0x21e69d,_0x4b94d1))['catch'](handleError(_0x21e69d,null));};exports[_0x82ec('0x3c')]=function(_0x189028,_0x5a0c52){var _0x5cc8c3={'raw':!![],'where':{'id':_0x189028[_0x82ec('0x3d')]['id']}},_0x4b9eaf={};_0x4b9eaf['model']=_[_0x82ec('0x27')](db[_0x82ec('0x25')][_0x82ec('0x3e')]);_0x4b9eaf['query']=_[_0x82ec('0x27')](_0x189028[_0x82ec('0x28')]);_0x4b9eaf[_0x82ec('0x29')]=_[_0x82ec('0x2a')](_0x4b9eaf[_0x82ec('0x26')],_0x4b9eaf[_0x82ec('0x28')]);_0x5cc8c3[_0x82ec('0x2b')]=_[_0x82ec('0x2a')](_0x4b9eaf['model'],qs['fields'](_0x189028['query'][_0x82ec('0x2c')]));_0x5cc8c3[_0x82ec('0x2b')]=_0x5cc8c3[_0x82ec('0x2b')][_0x82ec('0x2d')]?_0x5cc8c3[_0x82ec('0x2b')]:_0x4b9eaf[_0x82ec('0x26')];if(_0x189028['query'][_0x82ec('0x38')]){_0x5cc8c3[_0x82ec('0x39')]=[{'all':!![]}];}_0x5cc8c3=_[_0x82ec('0x34')]({},_0x5cc8c3,_0x189028[_0x82ec('0x37')]);return db[_0x82ec('0x25')][_0x82ec('0x3f')](_0x5cc8c3)[_0x82ec('0x1c')](handleEntityNotFound(_0x5a0c52,null))['then'](respondWithResult(_0x5a0c52,null))[_0x82ec('0x40')](handleError(_0x5a0c52,null));};exports[_0x82ec('0x41')]=function(_0x13e638,_0x201713){return db[_0x82ec('0x25')][_0x82ec('0x41')](_0x13e638[_0x82ec('0x42')],{})['then'](function(_0x2d86b1){var _0x3044e8=_0x13e638[_0x82ec('0x43')][_0x82ec('0x1e')]({'plain':!![]});if(!_0x3044e8)throw new Error(_0x82ec('0x44'));if(_0x3044e8[_0x82ec('0x45')]==='user'){var _0x34b20b=_0x2d86b1[_0x82ec('0x1e')]({'plain':!![]});var _0x3ac2d3=_0x82ec('0x1f');return db[_0x82ec('0x46')][_0x82ec('0x3f')]({'where':{'name':_0x3ac2d3,'userProfileId':_0x3044e8[_0x82ec('0x47')]},'raw':!![]})['then'](function(_0x5733c3){if(_0x5733c3&&_0x5733c3['autoAssociation']===0x0){return db[_0x82ec('0x20')][_0x82ec('0x41')]({'name':_0x34b20b['name'],'resourceId':_0x34b20b['id'],'type':_0x5733c3['name'],'sectionId':_0x5733c3['id']},{})[_0x82ec('0x1c')](function(){return _0x2d86b1;});}else{return _0x2d86b1;}})[_0x82ec('0x40')](function(_0x34a74b){logger[_0x82ec('0x48')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34a74b);throw _0x34a74b;});}return _0x2d86b1;})[_0x82ec('0x1c')](respondWithResult(_0x201713,0xc9))[_0x82ec('0x40')](handleError(_0x201713,null));};exports[_0x82ec('0x49')]=function(_0x202350,_0x4ffd79){if(_0x202350[_0x82ec('0x42')]['id']){delete _0x202350[_0x82ec('0x42')]['id'];}return db['Tag'][_0x82ec('0x3f')]({'where':{'id':_0x202350['params']['id']}})['then'](handleEntityNotFound(_0x4ffd79,null))['then'](saveUpdates(_0x202350[_0x82ec('0x42')],null))[_0x82ec('0x1c')](respondWithResult(_0x4ffd79,null))[_0x82ec('0x40')](handleError(_0x4ffd79,null));};exports[_0x82ec('0x1d')]=function(_0x11e4f1,_0x28b37f){return db[_0x82ec('0x25')][_0x82ec('0x3f')]({'where':{'id':_0x11e4f1[_0x82ec('0x3d')]['id']}})[_0x82ec('0x1c')](handleEntityNotFound(_0x28b37f,null))[_0x82ec('0x1c')](removeEntity(_0x28b37f,null))['catch'](handleError(_0x28b37f,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 7d39628..df5ebff 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 _0xca52=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util'];(function(_0x2e2db4,_0x2ec766){var _0x1054f4=function(_0x1fe512){while(--_0x1fe512){_0x2e2db4['push'](_0x2e2db4['shift']());}};_0x1054f4(++_0x2ec766);}(_0xca52,0xdb));var _0x2ca5=function(_0x4f9f9a,_0xdb18a5){_0x4f9f9a=_0x4f9f9a-0x0;var _0x44233a=_0xca52[_0x4f9f9a];return _0x44233a;};'use strict';var _=require(_0x2ca5('0x0'));var util=require(_0x2ca5('0x1'));var logger=require(_0x2ca5('0x2'))(_0x2ca5('0x3'));var moment=require(_0x2ca5('0x4'));var BPromise=require(_0x2ca5('0x5'));var rp=require(_0x2ca5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2ca5('0x7'));var attributes=require(_0x2ca5('0x8'));module[_0x2ca5('0x9')]=function(_0x3bac76,_0x49330e){return _0x3bac76[_0x2ca5('0xa')](_0x2ca5('0xb'),attributes,{'tableName':_0x2ca5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf75d=['define','Tag','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./tag.attributes','exports'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0xf75d,0xa7));var _0xdf75=function(_0x545e86,_0x46a2ed){_0x545e86=_0x545e86-0x0;var _0xa98055=_0xf75d[_0x545e86];return _0xa98055;};'use strict';var _=require(_0xdf75('0x0'));var util=require(_0xdf75('0x1'));var logger=require(_0xdf75('0x2'))(_0xdf75('0x3'));var moment=require(_0xdf75('0x4'));var BPromise=require(_0xdf75('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdf75('0x6'));var config=require('../../config/environment');var attributes=require(_0xdf75('0x7'));module[_0xdf75('0x8')]=function(_0x5a9bb1,_0x292eb6){return _0x5a9bb1[_0xdf75('0x9')](_0xdf75('0xa'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 0c8e824..b80e769 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 _0x76dc=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','info','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x66d290,_0xfbba05){var _0x2f83e3=function(_0x284e37){while(--_0x284e37){_0x66d290['push'](_0x66d290['shift']());}};_0x2f83e3(++_0xfbba05);}(_0x76dc,0x1f2));var _0xc76d=function(_0x45f7a7,_0x207d90){_0x45f7a7=_0x45f7a7-0x0;var _0x88507e=_0x76dc[_0x45f7a7];return _0x88507e;};'use strict';var _=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var moment=require(_0xc76d('0x2'));var BPromise=require(_0xc76d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc76d('0x4'));var db=require(_0xc76d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc76d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc76d('0x7'));var client=jayson[_0xc76d('0x8')][_0xc76d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4832bd,_0x4ce0bd,_0x119f38){return new BPromise(function(_0x114572,_0x18574f){return client['request'](_0x4832bd,_0x119f38)['then'](function(_0x1dc996){logger[_0xc76d('0xa')]('Tag,\x20%s,\x20%s',_0x4ce0bd,_0xc76d('0xb'));logger['debug'](_0xc76d('0xc'),_0x4ce0bd,_0xc76d('0xb'),JSON[_0xc76d('0xd')](_0x1dc996));if(_0x1dc996[_0xc76d('0xe')]){if(_0x1dc996[_0xc76d('0xe')][_0xc76d('0xf')]===0x1f4){logger[_0xc76d('0xe')](_0xc76d('0x10'),_0x4ce0bd,_0x1dc996[_0xc76d('0xe')][_0xc76d('0x11')]);return _0x18574f(_0x1dc996[_0xc76d('0xe')][_0xc76d('0x11')]);}logger[_0xc76d('0xe')](_0xc76d('0x10'),_0x4ce0bd,_0x1dc996['error'][_0xc76d('0x11')]);return _0x114572(_0x1dc996[_0xc76d('0xe')]['message']);}else{logger[_0xc76d('0xa')](_0xc76d('0x10'),_0x4ce0bd,_0xc76d('0xb'));_0x114572(_0x1dc996[_0xc76d('0x12')]['message']);}})[_0xc76d('0x13')](function(_0x5d881c){logger['error'](_0xc76d('0x10'),_0x4ce0bd,_0x5d881c);_0x18574f(_0x5d881c);});});} \ No newline at end of file +var _0x9bde=['code','message','Tag,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x42e18a,_0x1adf3f){var _0xda4302=function(_0x271f95){while(--_0x271f95){_0x42e18a['push'](_0x42e18a['shift']());}};_0xda4302(++_0x1adf3f);}(_0x9bde,0xe1));var _0xe9bd=function(_0x19cabe,_0x308044){_0x19cabe=_0x19cabe-0x0;var _0x2d8bbf=_0x9bde[_0x19cabe];return _0x2d8bbf;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('Tag,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('Tag,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('Tag,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('Tag,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 1fcfeec..a8c7e52 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 _0x04a3=['post','addQueues','addAgents','put','update','delete','destroy','removeQueues','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./team.controller','get','isAuthenticated','index','/:id','show','/:id/queues','getQueues','/:id/users','getAgents'];(function(_0x5b8ca5,_0x322ab2){var _0x107bc7=function(_0x17274a){while(--_0x17274a){_0x5b8ca5['push'](_0x5b8ca5['shift']());}};_0x107bc7(++_0x322ab2);}(_0x04a3,0x133));var _0x304a=function(_0x4318c2,_0x2ab0bb){_0x4318c2=_0x4318c2-0x0;var _0x14e077=_0x04a3[_0x4318c2];return _0x14e077;};'use strict';var multer=require(_0x304a('0x0'));var util=require(_0x304a('0x1'));var path=require(_0x304a('0x2'));var timeout=require('connect-timeout');var express=require(_0x304a('0x3'));var router=express[_0x304a('0x4')]();var auth=require(_0x304a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x304a('0x6'));var controller=require(_0x304a('0x7'));router[_0x304a('0x8')]('/',auth[_0x304a('0x9')](),controller[_0x304a('0xa')]);router[_0x304a('0x8')](_0x304a('0xb'),auth[_0x304a('0x9')](),controller[_0x304a('0xc')]);router[_0x304a('0x8')](_0x304a('0xd'),auth[_0x304a('0x9')](),controller[_0x304a('0xe')]);router[_0x304a('0x8')](_0x304a('0xf'),auth[_0x304a('0x9')](),controller[_0x304a('0x10')]);router[_0x304a('0x11')]('/',auth[_0x304a('0x9')](),controller['create']);router[_0x304a('0x11')](_0x304a('0xd'),auth[_0x304a('0x9')](),controller[_0x304a('0x12')]);router['post']('/:id/users',auth[_0x304a('0x9')](),controller[_0x304a('0x13')]);router[_0x304a('0x14')](_0x304a('0xb'),auth['isAuthenticated'](),controller[_0x304a('0x15')]);router[_0x304a('0x16')](_0x304a('0xb'),auth[_0x304a('0x9')](),controller[_0x304a('0x17')]);router[_0x304a('0x16')](_0x304a('0xd'),auth[_0x304a('0x9')](),controller[_0x304a('0x18')]);router[_0x304a('0x16')](_0x304a('0xf'),auth[_0x304a('0x9')](),controller[_0x304a('0x19')]);module[_0x304a('0x1a')]=router; \ No newline at end of file +var _0xffc2=['express','Router','../../components/auth/service','../../config/environment','./team.controller','get','isAuthenticated','index','/:id','/:id/queues','getQueues','/:id/users','getAgents','post','addQueues','addAgents','destroy','removeQueues','delete','removeAgents','exports','multer','util','path'];(function(_0x1d1963,_0x32cc0e){var _0x3f58bb=function(_0x514823){while(--_0x514823){_0x1d1963['push'](_0x1d1963['shift']());}};_0x3f58bb(++_0x32cc0e);}(_0xffc2,0x17d));var _0x2ffc=function(_0x127187,_0x4f7f5c){_0x127187=_0x127187-0x0;var _0xcb9e8e=_0xffc2[_0x127187];return _0xcb9e8e;};'use strict';var multer=require(_0x2ffc('0x0'));var util=require(_0x2ffc('0x1'));var path=require(_0x2ffc('0x2'));var timeout=require('connect-timeout');var express=require(_0x2ffc('0x3'));var router=express[_0x2ffc('0x4')]();var auth=require(_0x2ffc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2ffc('0x6'));var controller=require(_0x2ffc('0x7'));router[_0x2ffc('0x8')]('/',auth[_0x2ffc('0x9')](),controller[_0x2ffc('0xa')]);router['get'](_0x2ffc('0xb'),auth[_0x2ffc('0x9')](),controller['show']);router['get'](_0x2ffc('0xc'),auth[_0x2ffc('0x9')](),controller[_0x2ffc('0xd')]);router[_0x2ffc('0x8')](_0x2ffc('0xe'),auth[_0x2ffc('0x9')](),controller[_0x2ffc('0xf')]);router[_0x2ffc('0x10')]('/',auth[_0x2ffc('0x9')](),controller['create']);router['post'](_0x2ffc('0xc'),auth[_0x2ffc('0x9')](),controller[_0x2ffc('0x11')]);router['post'](_0x2ffc('0xe'),auth['isAuthenticated'](),controller[_0x2ffc('0x12')]);router['put'](_0x2ffc('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2ffc('0xb'),auth[_0x2ffc('0x9')](),controller[_0x2ffc('0x13')]);router['delete']('/:id/queues',auth['isAuthenticated'](),controller[_0x2ffc('0x14')]);router[_0x2ffc('0x15')]('/:id/users',auth[_0x2ffc('0x9')](),controller[_0x2ffc('0x16')]);module[_0x2ffc('0x17')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 0d62485..7e6d989 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 _0x265a=['sequelize','exports','STRING'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x265a,0x117));var _0xa265=function(_0x2fe214,_0x1a5924){_0x2fe214=_0x2fe214-0x0;var _0x558748=_0x265a[_0x2fe214];return _0x558748;};'use strict';var Sequelize=require(_0xa265('0x0'));module[_0xa265('0x1')]={'name':{'type':Sequelize[_0xa265('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0xa265('0x2')]}}; \ No newline at end of file +var _0x411c=['exports','STRING','name'];(function(_0x4cbcbb,_0x299453){var _0x4c4dfe=function(_0x2d0537){while(--_0x2d0537){_0x4cbcbb['push'](_0x4cbcbb['shift']());}};_0x4c4dfe(++_0x299453);}(_0x411c,0x1ec));var _0xc411=function(_0x4a701e,_0x20c034){_0x4a701e=_0x4a701e-0x0;var _0x1938ca=_0x411c[_0x4a701e];return _0x1938ca;};'use strict';var Sequelize=require('sequelize');module[_0xc411('0x0')]={'name':{'type':Sequelize[_0xc411('0x1')],'allowNull':![],'unique':_0xc411('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 274f222..4c72e4a 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 _0x55e0=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','status','json','count','offset','limit','Content-Range','apply','save','update','then','get','Teams','UserProfileResource','error','stack','name','index','Team','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','params','fields','include','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','add','ids','removeQueues','Chat','Mail','Sms','Fax','each','Voice','User','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','spread','userTeam:save','removeAgents','voice','mail','openchannel','isArray','emit','userTeam:remove','getAgents','map','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service'];(function(_0x252709,_0x4dbf80){var _0xe3ea9e=function(_0x5da78b){while(--_0x5da78b){_0x252709['push'](_0x252709['shift']());}};_0xe3ea9e(++_0x4dbf80);}(_0x55e0,0xdc));var _0x055e=function(_0x4bd730,_0x311824){_0x4bd730=_0x4bd730-0x0;var _0x7979a4=_0x55e0[_0x4bd730];return _0x7979a4;};'use strict';var pdf=require(_0x055e('0x0'));var emlformat=require(_0x055e('0x1'));var rimraf=require(_0x055e('0x2'));var zipdir=require(_0x055e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x055e('0x4'));var BPromise=require(_0x055e('0x5'));var Mustache=require(_0x055e('0x6'));var util=require(_0x055e('0x7'));var path=require(_0x055e('0x8'));var sox=require(_0x055e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x055e('0xa'));var squel=require('squel');var crypto=require(_0x055e('0xb'));var jsforce=require(_0x055e('0xc'));var deskjs=require(_0x055e('0xd'));var toCsv=require(_0x055e('0xe'));var querystring=require(_0x055e('0xf'));var Papa=require('papaparse');var Redis=require(_0x055e('0x10'));var authService=require(_0x055e('0x11'));var qs=require(_0x055e('0x12'));var hardwareService=require(_0x055e('0x13'));var logger=require(_0x055e('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x055e('0x15'));var db=require('../../mysqldb')['db'];config[_0x055e('0x16')]=_[_0x055e('0x17')](config[_0x055e('0x16')],{'host':_0x055e('0x18'),'port':0x18eb});var socket=require(_0x055e('0x19'))(new Redis(config[_0x055e('0x16')]));require(_0x055e('0x1a'))['register'](socket);function respondWithStatusCode(_0x14064d,_0xb80d83){_0xb80d83=_0xb80d83||0xcc;return function(_0x3cfd14){if(_0x3cfd14){return _0x14064d[_0x055e('0x1b')](_0xb80d83);}return _0x14064d[_0x055e('0x1c')](_0xb80d83)['end']();};}function respondWithResult(_0x230674,_0x2fe55f){_0x2fe55f=_0x2fe55f||0xc8;return function(_0x111cdb){if(_0x111cdb){return _0x230674['status'](_0x2fe55f)[_0x055e('0x1d')](_0x111cdb);}};}function respondWithFilteredResult(_0x2c377c,_0xb4e6ca){return function(_0x2bad86){if(_0x2bad86){var _0x2cc84e=_0x2bad86[_0x055e('0x1e')],_0x4c85dd=_0xb4e6ca[_0x055e('0x1f')],_0x36ef10=_0xb4e6ca['offset']+_0xb4e6ca[_0x055e('0x20')],_0x2cf3de;if(_0x36ef10>=_0x2cc84e){_0x36ef10=_0x2cc84e;_0x2cf3de=0xc8;}else{_0x2cf3de=0xce;}_0x2c377c[_0x055e('0x1c')](_0x2cf3de);return _0x2c377c['set'](_0x055e('0x21'),_0x4c85dd+'-'+_0x36ef10+'/'+_0x2cc84e)[_0x055e('0x1d')](_0x2bad86);}return null;};}function patchUpdates(_0x10258f){return function(_0x124d86){try{jsonpatch[_0x055e('0x22')](_0x124d86,_0x10258f,!![]);}catch(_0x4675ff){return BPromise['reject'](_0x4675ff);}return _0x124d86[_0x055e('0x23')]();};}function saveUpdates(_0x2f0346,_0x211594){return function(_0x5930ff){if(_0x5930ff){return _0x5930ff[_0x055e('0x24')](_0x2f0346)[_0x055e('0x25')](function(_0x32c64e){return _0x32c64e;});}return null;};}function removeEntity(_0x37243b,_0x51df23){return function(_0x71a6e1){if(_0x71a6e1){return _0x71a6e1['destroy']()[_0x055e('0x25')](function(){var _0x42a6aa=_0x71a6e1[_0x055e('0x26')]({'plain':!![]});var _0x1a76c6=_0x055e('0x27');return db[_0x055e('0x28')]['destroy']({'where':{'type':_0x1a76c6,'resourceId':_0x42a6aa['id']}})[_0x055e('0x25')](function(){return _0x71a6e1;});})[_0x055e('0x25')](function(){_0x37243b[_0x055e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x408e38,_0x29078a){return function(_0x42f2df){if(!_0x42f2df){_0x408e38[_0x055e('0x1b')](0x194);}return _0x42f2df;};}function handleError(_0x59539d,_0x27f81a){_0x27f81a=_0x27f81a||0x1f4;return function(_0x5958ef){logger[_0x055e('0x29')](_0x5958ef[_0x055e('0x2a')]);if(_0x5958ef[_0x055e('0x2b')]){delete _0x5958ef[_0x055e('0x2b')];}_0x59539d[_0x055e('0x1c')](_0x27f81a)['send'](_0x5958ef);};}exports[_0x055e('0x2c')]=function(_0x453e5e,_0x293062){var _0x1499e1={},_0x36abb2={},_0x225c88={'count':0x0,'rows':[]};var _0x59f8c4=db[_0x055e('0x2d')]['rawAttributes'];_0x36abb2[_0x055e('0x2e')]=_[_0x055e('0x2f')](_0x59f8c4);_0x36abb2['query']=_[_0x055e('0x2f')](_0x453e5e[_0x055e('0x30')]);_0x36abb2[_0x055e('0x31')]=_[_0x055e('0x32')](_0x36abb2[_0x055e('0x2e')],_0x36abb2[_0x055e('0x30')]);_0x1499e1['attributes']=_['intersection'](_0x36abb2[_0x055e('0x2e')],qs['fields'](_0x453e5e['query']['fields']));_0x1499e1[_0x055e('0x33')]=_0x1499e1[_0x055e('0x33')][_0x055e('0x34')]?_0x1499e1[_0x055e('0x33')]:_0x36abb2[_0x055e('0x2e')];if(!_0x453e5e[_0x055e('0x30')][_0x055e('0x35')](_0x055e('0x36'))){_0x1499e1[_0x055e('0x20')]=qs[_0x055e('0x20')](_0x453e5e[_0x055e('0x30')][_0x055e('0x20')]);_0x1499e1['offset']=qs['offset'](_0x453e5e[_0x055e('0x30')][_0x055e('0x1f')]);}_0x1499e1[_0x055e('0x37')]=qs[_0x055e('0x38')](_0x453e5e[_0x055e('0x30')][_0x055e('0x38')]);_0x1499e1[_0x055e('0x39')]=qs['filters'](_[_0x055e('0x3a')](_0x453e5e[_0x055e('0x30')],_0x36abb2[_0x055e('0x31')]));if(_0x453e5e[_0x055e('0x30')][_0x055e('0x3b')]){_0x1499e1['where']=_[_0x055e('0x3c')](_0x1499e1[_0x055e('0x39')],{'$or':_['map'](_0x59f8c4,function(_0x39ecd7){if(_0x39ecd7[_0x055e('0x3d')]['key']!==_0x055e('0x3e')){var _0x2d7815={};_0x2d7815[_0x39ecd7['field']]={'$like':'%'+_0x453e5e[_0x055e('0x30')][_0x055e('0x3b')]+'%'};return _0x2d7815;}})});}_0x1499e1=_['merge']({},_0x1499e1,_0x453e5e[_0x055e('0x3f')]);var _0x12699a={'where':_0x1499e1[_0x055e('0x39')]};return db['Team'][_0x055e('0x1e')](_0x12699a)[_0x055e('0x25')](function(_0x574ea0){_0x225c88[_0x055e('0x1e')]=_0x574ea0;if(_0x453e5e[_0x055e('0x30')][_0x055e('0x40')]){_0x1499e1['include']=[{'all':!![]}];}return db[_0x055e('0x2d')][_0x055e('0x41')](_0x1499e1);})[_0x055e('0x25')](function(_0x4fa534){_0x225c88['rows']=_0x4fa534;return _0x225c88;})[_0x055e('0x25')](respondWithFilteredResult(_0x293062,_0x1499e1))[_0x055e('0x42')](handleError(_0x293062,null));};exports['show']=function(_0x3a5bc5,_0x544bf1){var _0x320426={'raw':![],'where':{'id':_0x3a5bc5[_0x055e('0x43')]['id']}},_0x537bc7={};_0x537bc7[_0x055e('0x2e')]=_[_0x055e('0x2f')](db['Team']['rawAttributes']);_0x537bc7[_0x055e('0x30')]=_[_0x055e('0x2f')](_0x3a5bc5[_0x055e('0x30')]);_0x537bc7[_0x055e('0x31')]=_['intersection'](_0x537bc7['model'],_0x537bc7[_0x055e('0x30')]);_0x320426[_0x055e('0x33')]=_['intersection'](_0x537bc7[_0x055e('0x2e')],qs[_0x055e('0x44')](_0x3a5bc5[_0x055e('0x30')][_0x055e('0x44')]));_0x320426[_0x055e('0x33')]=_0x320426[_0x055e('0x33')]['length']?_0x320426[_0x055e('0x33')]:_0x537bc7[_0x055e('0x2e')];if(_0x3a5bc5['query'][_0x055e('0x40')]){_0x320426[_0x055e('0x45')]=[{'all':!![]}];}_0x320426=_[_0x055e('0x3c')]({},_0x320426,_0x3a5bc5[_0x055e('0x3f')]);return db[_0x055e('0x2d')][_0x055e('0x46')](_0x320426)[_0x055e('0x25')](handleEntityNotFound(_0x544bf1,null))['then'](respondWithResult(_0x544bf1,null))[_0x055e('0x42')](handleError(_0x544bf1,null));};exports['create']=function(_0xc08c9b,_0xed7611){return db[_0x055e('0x2d')]['create'](_0xc08c9b['body'],{})[_0x055e('0x25')](function(_0x20114c){var _0x25110f=_0xc08c9b[_0x055e('0x47')][_0x055e('0x26')]({'plain':!![]});if(!_0x25110f)throw new Error(_0x055e('0x48'));if(_0x25110f[_0x055e('0x49')]===_0x055e('0x47')){var _0x2741ac=_0x20114c['get']({'plain':!![]});var _0x5a49ca=_0x055e('0x27');return db[_0x055e('0x4a')][_0x055e('0x46')]({'where':{'name':_0x5a49ca,'userProfileId':_0x25110f[_0x055e('0x4b')]},'raw':!![]})['then'](function(_0x17a837){if(_0x17a837&&_0x17a837[_0x055e('0x4c')]===0x0){return db[_0x055e('0x28')]['create']({'name':_0x2741ac[_0x055e('0x2b')],'resourceId':_0x2741ac['id'],'type':_0x17a837['name'],'sectionId':_0x17a837['id']},{})[_0x055e('0x25')](function(){return _0x20114c;});}else{return _0x20114c;}})[_0x055e('0x42')](function(_0x49129a){logger[_0x055e('0x29')](_0x055e('0x4d'),_0x49129a);throw _0x49129a;});}return _0x20114c;})[_0x055e('0x25')](respondWithResult(_0xed7611,0xc9))['catch'](handleError(_0xed7611,null));};exports['update']=function(_0x4437fd,_0x413778){if(_0x4437fd[_0x055e('0x4e')]['id']){delete _0x4437fd[_0x055e('0x4e')]['id'];}return db[_0x055e('0x2d')][_0x055e('0x46')]({'where':{'id':_0x4437fd[_0x055e('0x43')]['id']}})[_0x055e('0x25')](handleEntityNotFound(_0x413778,null))[_0x055e('0x25')](saveUpdates(_0x4437fd[_0x055e('0x4e')],null))['then'](respondWithResult(_0x413778,null))[_0x055e('0x42')](handleError(_0x413778,null));};exports[_0x055e('0x4f')]=function(_0x28fc18,_0x200b53){return db['Team'][_0x055e('0x46')]({'where':{'id':_0x28fc18[_0x055e('0x43')]['id']}})[_0x055e('0x25')](handleEntityNotFound(_0x200b53,null))[_0x055e('0x25')](removeEntity(_0x200b53,null))['catch'](handleError(_0x200b53,null));};exports['getQueues']=function(_0x22bf74,_0xd3a451,_0x7fba31){return db[_0x055e('0x2d')][_0x055e('0x50')]({'where':{'id':_0x22bf74[_0x055e('0x43')]['id']}})[_0x055e('0x25')](handleEntityNotFound(_0xd3a451,null))[_0x055e('0x25')](function(_0x56db9c){if(!_0x22bf74['query'][_0x055e('0x51')]||!utils[_0x055e('0x52')](_0x22bf74['query'][_0x055e('0x51')])){throw new db[(_0x055e('0x53'))][(_0x055e('0x54'))](_0x055e('0x55'));}var _0x50aa1f={};var _0x1602dc={};_0x1602dc[_0x055e('0x2e')]=_[_0x055e('0x2f')](db[_[_0x055e('0x56')](_0x22bf74[_0x055e('0x30')][_0x055e('0x51')][_0x055e('0x57')]())+_0x055e('0x58')]['rawAttributes']);_0x1602dc[_0x055e('0x30')]=_[_0x055e('0x2f')](_0x22bf74['query']);_0x1602dc[_0x055e('0x31')]=_[_0x055e('0x32')](_0x1602dc[_0x055e('0x2e')],_0x1602dc[_0x055e('0x30')]);_0x50aa1f['attributes']=_[_0x055e('0x32')](_0x1602dc[_0x055e('0x2e')],qs[_0x055e('0x44')](_0x22bf74['query'][_0x055e('0x44')]));_0x50aa1f[_0x055e('0x33')]=_0x50aa1f[_0x055e('0x33')][_0x055e('0x34')]?_0x50aa1f[_0x055e('0x33')]:_0x1602dc['model'];_0x50aa1f[_0x055e('0x20')]=qs[_0x055e('0x20')](_0x22bf74[_0x055e('0x30')][_0x055e('0x20')]);_0x50aa1f[_0x055e('0x1f')]=qs['offset'](_0x22bf74[_0x055e('0x30')][_0x055e('0x1f')]);_0x50aa1f[_0x055e('0x37')]=qs['sort'](_0x22bf74[_0x055e('0x30')][_0x055e('0x38')]);_0x50aa1f[_0x055e('0x39')]=qs[_0x055e('0x31')](_[_0x055e('0x3a')](_0x22bf74['query'],_0x1602dc[_0x055e('0x31')]));_0x50aa1f=_['merge']({},_0x50aa1f,_0x22bf74[_0x055e('0x3f')]);return _0x56db9c[_0x055e('0x26')+_['capitalize'](_0x22bf74[_0x055e('0x30')][_0x055e('0x51')][_0x055e('0x57')]())+_0x055e('0x59')](_0x50aa1f);})['then'](respondWithResult(_0xd3a451,null))['catch'](handleError(_0xd3a451,null));};exports[_0x055e('0x5a')]=function(_0x5e4f42,_0x2593e6,_0x16fed1){return db[_0x055e('0x2d')][_0x055e('0x50')]({'where':{'id':_0x5e4f42[_0x055e('0x43')]['id']}})[_0x055e('0x25')](function(_0x2fd857){if(_0x2fd857){if(!_0x5e4f42[_0x055e('0x4e')][_0x055e('0x51')]||!utils[_0x055e('0x52')](_0x5e4f42['body']['channel'])){throw new db[(_0x055e('0x53'))][(_0x055e('0x54'))]('Unknown\x20channel');}return _0x2fd857[_0x055e('0x5b')+_['capitalize'](_0x5e4f42[_0x055e('0x4e')][_0x055e('0x51')][_0x055e('0x57')]())+_0x055e('0x59')](_0x5e4f42[_0x055e('0x4e')][_0x055e('0x5c')]);}return null;})[_0x055e('0x25')](handleEntityNotFound(_0x2593e6,null))[_0x055e('0x25')](respondWithStatusCode(_0x2593e6,null))['catch'](handleError(_0x2593e6,null));};exports[_0x055e('0x5d')]=function(_0x4c64a9,_0x471e26,_0x1ff1fa){return db[_0x055e('0x2d')][_0x055e('0x50')]({'where':{'id':_0x4c64a9[_0x055e('0x43')]['id']}})[_0x055e('0x25')](function(_0x2f4e71){if(_0x2f4e71){if(!_0x4c64a9['query'][_0x055e('0x51')]||!utils[_0x055e('0x52')](_0x4c64a9['query'][_0x055e('0x51')])){throw new db[(_0x055e('0x53'))][(_0x055e('0x54'))](_0x055e('0x55'));}return _0x2f4e71['remove'+_[_0x055e('0x56')](_0x4c64a9[_0x055e('0x30')][_0x055e('0x51')][_0x055e('0x57')]())+_0x055e('0x59')](_0x4c64a9['query'][_0x055e('0x5c')]);}return null;})[_0x055e('0x25')](handleEntityNotFound(_0x471e26,null))[_0x055e('0x25')](respondWithStatusCode(_0x471e26,null))[_0x055e('0x42')](handleError(_0x471e26,null));};exports['addAgents']=function(_0xb8d1b7,_0x3101e3,_0x2e7b2e){return db[_0x055e('0x2d')][_0x055e('0x46')]({'where':{'id':_0xb8d1b7['params']['id']}})[_0x055e('0x25')](handleEntityNotFound(_0x3101e3,null))[_0x055e('0x25')](function(_0x16835c){if(_0x16835c){var _0x1f3ba4=['Voice',_0x055e('0x5e'),_0x055e('0x5f'),_0x055e('0x60'),_0x055e('0x61'),'Openchannel'];return BPromise[_0x055e('0x62')](_0x1f3ba4,function(_0x8e77e0){return _0x16835c[_0x055e('0x26')+_0x8e77e0+_0x055e('0x59')]({'attributes':['id',_0x055e('0x2b')]})['then'](function(_0x26da8f){return BPromise[_0x055e('0x62')](_0x26da8f,function(_0x2e5122){return _0x2e5122['addAgents'](_0xb8d1b7['body'][_0x055e('0x5c')])['then'](function(){if(_0x8e77e0===_0x055e('0x63')){return db[_0x055e('0x64')]['findAll']({'where':{'id':_0xb8d1b7[_0x055e('0x4e')][_0x055e('0x5c')]},'attributes':['id',_0x055e('0x2b'),_0x055e('0x65'),_0x055e('0x66'),_0x055e('0x67')],'raw':!![]})[_0x055e('0x25')](function(_0x2b670c){return BPromise[_0x055e('0x62')](_[_0x055e('0x3b')](_0x2b670c,{'online':0x1}),function(_0x184a00){return db[_0x055e('0x68')][_0x055e('0x69')]({'membername':_0x184a00[_0x055e('0x2b')],'UserId':_0x184a00['id'],'queue_name':_0x2e5122[_0x055e('0x2b')],'VoiceQueueId':_0x2e5122['id'],'interface':_[_0x055e('0x6a')](_0x184a00['interface'])?util[_0x055e('0x6b')]('SIP/%s',_0x184a00['name']):_0x184a00[_0x055e('0x67')],'paused':_0x184a00[_0x055e('0x66')]||![],'penalty':0x0});});});}});});})[_0x055e('0x25')](function(){return _0x16835c;});})['then'](function(){return _0x16835c;});}})[_0x055e('0x25')](function(_0x265b94){if(_0x265b94){return _0x265b94['addAgents'](_0xb8d1b7[_0x055e('0x4e')][_0x055e('0x5c')],_['omit'](_0xb8d1b7[_0x055e('0x4e')],['ids','id'])||{})[_0x055e('0x6c')](function(_0x40dc75){for(var _0x2f70d5=0x0;_0x2f70d5<_0xb8d1b7[_0x055e('0x4e')]['ids']['length'];_0x2f70d5+=0x1){socket['emit'](_0x055e('0x6d'),{'UserId':_0xb8d1b7['body']['ids'][_0x2f70d5],'TeamId':_0xb8d1b7[_0x055e('0x43')]['id']});}return _0x40dc75;});}})['then'](respondWithResult(_0x3101e3,null))[_0x055e('0x42')](handleError(_0x3101e3,null));};exports[_0x055e('0x6e')]=function(_0x15a107,_0x1c3a1a,_0x4ffb38){return db['Team'][_0x055e('0x46')]({'where':{'id':_0x15a107[_0x055e('0x43')]['id']}})[_0x055e('0x25')](handleEntityNotFound(_0x1c3a1a,null))[_0x055e('0x25')](function(_0x422f6f){if(_0x422f6f){return BPromise[_0x055e('0x62')]([_0x055e('0x6f'),'chat',_0x055e('0x70'),'sms','fax',_0x055e('0x71')],function(_0x40fabb){return _0x422f6f[_0x055e('0x26')+_['capitalize'](_0x40fabb)+_0x055e('0x59')]({'attributes':['id',_0x055e('0x2b')]})[_0x055e('0x25')](function(_0x4b289a){return BPromise[_0x055e('0x62')](_0x4b289a,function(_0xf3135e){return _0xf3135e[_0x055e('0x6e')](_0x15a107[_0x055e('0x30')][_0x055e('0x5c')])[_0x055e('0x25')](function(){if(_0x40fabb===_0x055e('0x6f')){return db[_0x055e('0x68')][_0x055e('0x4f')]({'where':{'VoiceQueueId':_0xf3135e['id'],'UserId':_0x15a107[_0x055e('0x30')][_0x055e('0x5c')]}});}});});})[_0x055e('0x25')](function(){return _0x422f6f;});})[_0x055e('0x25')](function(){return _0x422f6f;});}})[_0x055e('0x25')](function(_0xd6807d){if(_0xd6807d){return _0xd6807d[_0x055e('0x6e')](_0x15a107['query'][_0x055e('0x5c')])[_0x055e('0x25')](function(){if(_[_0x055e('0x72')](_0x15a107['query']['ids'])){for(var _0x4fd7e2=0x0;_0x4fd7e2<_0x15a107[_0x055e('0x30')][_0x055e('0x5c')][_0x055e('0x34')];_0x4fd7e2+=0x1){socket[_0x055e('0x73')](_0x055e('0x74'),{'UserId':Number(_0x15a107[_0x055e('0x30')][_0x055e('0x5c')][_0x4fd7e2]),'TeamId':Number(_0x15a107[_0x055e('0x43')]['id'])});}}else{socket['emit'](_0x055e('0x74'),{'UserId':Number(_0x15a107[_0x055e('0x30')][_0x055e('0x5c')]),'TeamId':Number(_0x15a107[_0x055e('0x43')]['id'])});}});}})[_0x055e('0x25')](respondWithStatusCode(_0x1c3a1a,null))[_0x055e('0x42')](handleError(_0x1c3a1a,null));};exports[_0x055e('0x75')]=function(_0x1e5ab2,_0x1720e2,_0x13ea8f){var _0x3d02cb={};var _0x37147f={};var _0x561830;var _0x5ee6de;return db[_0x055e('0x2d')][_0x055e('0x50')]({'where':{'id':_0x1e5ab2[_0x055e('0x43')]['id']}})['then'](handleEntityNotFound(_0x1720e2,null))[_0x055e('0x25')](function(_0x38d8e3){if(_0x38d8e3){_0x561830=_0x38d8e3;_0x37147f[_0x055e('0x2e')]=_['keys'](db[_0x055e('0x64')]['rawAttributes']);_0x37147f[_0x055e('0x30')]=_['keys'](_0x1e5ab2[_0x055e('0x30')]);_0x37147f[_0x055e('0x31')]=_['intersection'](_0x37147f['model'],_0x37147f[_0x055e('0x30')]);_0x3d02cb['attributes']=_['intersection'](_0x37147f[_0x055e('0x2e')],qs[_0x055e('0x44')](_0x1e5ab2[_0x055e('0x30')][_0x055e('0x44')]));_0x3d02cb[_0x055e('0x33')]=_0x3d02cb['attributes'][_0x055e('0x34')]?_0x3d02cb[_0x055e('0x33')]:_0x37147f['model'];_0x3d02cb[_0x055e('0x37')]=qs[_0x055e('0x38')](_0x1e5ab2[_0x055e('0x30')][_0x055e('0x38')]);_0x3d02cb[_0x055e('0x39')]=qs[_0x055e('0x31')](_[_0x055e('0x3a')](_0x1e5ab2[_0x055e('0x30')],_0x37147f['filters']));if(_0x1e5ab2[_0x055e('0x30')][_0x055e('0x3b')]){_0x3d02cb[_0x055e('0x39')]=_[_0x055e('0x3c')](_0x3d02cb[_0x055e('0x39')],{'$or':_[_0x055e('0x76')](_0x3d02cb[_0x055e('0x33')],function(_0xbedc91){var _0x21ae7c={};_0x21ae7c[_0xbedc91]={'$like':'%'+_0x1e5ab2[_0x055e('0x30')][_0x055e('0x3b')]+'%'};return _0x21ae7c;})});}_0x3d02cb=_['merge']({},_0x3d02cb,_0x1e5ab2[_0x055e('0x3f')]);return _0x561830[_0x055e('0x75')](_0x3d02cb);}})[_0x055e('0x25')](function(_0x555839){if(_0x555839){_0x5ee6de=_0x555839['length'];if(!_0x1e5ab2[_0x055e('0x30')][_0x055e('0x35')](_0x055e('0x36'))){_0x3d02cb[_0x055e('0x20')]=qs[_0x055e('0x20')](_0x1e5ab2[_0x055e('0x30')]['limit']);_0x3d02cb[_0x055e('0x1f')]=qs[_0x055e('0x1f')](_0x1e5ab2[_0x055e('0x30')][_0x055e('0x1f')]);}return _0x561830[_0x055e('0x75')](_0x3d02cb);}})[_0x055e('0x25')](function(_0x2a3236){if(_0x2a3236){return _0x2a3236?{'count':_0x5ee6de,'rows':_0x2a3236}:null;}})[_0x055e('0x25')](respondWithResult(_0x1720e2,null))[_0x055e('0x42')](handleError(_0x1720e2,null));}; \ No newline at end of file +var _0x0e85=['emit','getAgents','hasOwnProperty','html-pdf','eml-format','zip-dir','fast-json-patch','mustache','path','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','../../config/environment','defaults','redis','./team.socket','register','sendStatus','status','json','count','offset','limit','set','apply','save','update','then','get','Teams','UserProfileResource','end','error','stack','name','send','index','model','keys','query','filters','intersection','attributes','length','nolimit','sort','filter','where','merge','map','type','VIRTUAL','field','options','Team','includeAll','include','findAll','rows','show','params','fields','find','catch','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','channel','isValidChannel','Sequelize','ValidationError','toLowerCase','Queue','rawAttributes','order','pick','Queues','findOne','Unknown\x20channel','add','capitalize','ids','removeQueues','addAgents','Voice','Mail','Fax','Openchannel','each','voicePause','interface','UserVoiceQueueRt','upsert','omit','spread','removeAgents','voice','chat','fax','openchannel','destroy','isArray','userTeam:remove'];(function(_0xc441b5,_0xa58567){var _0x4f5e7c=function(_0x4ea6ea){while(--_0x4ea6ea){_0xc441b5['push'](_0xc441b5['shift']());}};_0x4f5e7c(++_0xa58567);}(_0x0e85,0x7c));var _0x50e8=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x0e85[_0x243b59];return _0x3e1676;};'use strict';var pdf=require(_0x50e8('0x0'));var emlformat=require(_0x50e8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x50e8('0x2'));var jsonpatch=require(_0x50e8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x50e8('0x4'));var util=require('util');var path=require(_0x50e8('0x5'));var sox=require(_0x50e8('0x6'));var csv=require(_0x50e8('0x7'));var ejs=require(_0x50e8('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x50e8('0x9'));var crypto=require(_0x50e8('0xa'));var jsforce=require(_0x50e8('0xb'));var deskjs=require(_0x50e8('0xc'));var toCsv=require(_0x50e8('0x7'));var querystring=require(_0x50e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x50e8('0xe'));var authService=require(_0x50e8('0xf'));var qs=require(_0x50e8('0x10'));var hardwareService=require(_0x50e8('0x11'));var logger=require(_0x50e8('0x12'))(_0x50e8('0x13'));var utils=require(_0x50e8('0x14'));var config=require(_0x50e8('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x50e8('0x16')](config[_0x50e8('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x50e8('0x17')]));require(_0x50e8('0x18'))[_0x50e8('0x19')](socket);function respondWithStatusCode(_0x473aa7,_0x54efd3){_0x54efd3=_0x54efd3||0xcc;return function(_0x18596f){if(_0x18596f){return _0x473aa7[_0x50e8('0x1a')](_0x54efd3);}return _0x473aa7[_0x50e8('0x1b')](_0x54efd3)['end']();};}function respondWithResult(_0x5524a3,_0x30a872){_0x30a872=_0x30a872||0xc8;return function(_0xf02b48){if(_0xf02b48){return _0x5524a3[_0x50e8('0x1b')](_0x30a872)[_0x50e8('0x1c')](_0xf02b48);}};}function respondWithFilteredResult(_0x211731,_0x1f0338){return function(_0x5642bf){if(_0x5642bf){var _0x5a5ef2=_0x5642bf[_0x50e8('0x1d')],_0x441f25=_0x1f0338[_0x50e8('0x1e')],_0xc97063=_0x1f0338[_0x50e8('0x1e')]+_0x1f0338[_0x50e8('0x1f')],_0x40d060;if(_0xc97063>=_0x5a5ef2){_0xc97063=_0x5a5ef2;_0x40d060=0xc8;}else{_0x40d060=0xce;}_0x211731['status'](_0x40d060);return _0x211731[_0x50e8('0x20')]('Content-Range',_0x441f25+'-'+_0xc97063+'/'+_0x5a5ef2)[_0x50e8('0x1c')](_0x5642bf);}return null;};}function patchUpdates(_0xe04a5c){return function(_0xd263d){try{jsonpatch[_0x50e8('0x21')](_0xd263d,_0xe04a5c,!![]);}catch(_0x46af8e){return BPromise['reject'](_0x46af8e);}return _0xd263d[_0x50e8('0x22')]();};}function saveUpdates(_0x1e4e0d,_0x58110d){return function(_0x31d23c){if(_0x31d23c){return _0x31d23c[_0x50e8('0x23')](_0x1e4e0d)['then'](function(_0x1ce7fc){return _0x1ce7fc;});}return null;};}function removeEntity(_0xe7e56c,_0x4f56b7){return function(_0x47a3d8){if(_0x47a3d8){return _0x47a3d8['destroy']()[_0x50e8('0x24')](function(){var _0x160372=_0x47a3d8[_0x50e8('0x25')]({'plain':!![]});var _0x371a1f=_0x50e8('0x26');return db[_0x50e8('0x27')]['destroy']({'where':{'type':_0x371a1f,'resourceId':_0x160372['id']}})[_0x50e8('0x24')](function(){return _0x47a3d8;});})[_0x50e8('0x24')](function(){_0xe7e56c['status'](0xcc)[_0x50e8('0x28')]();});}};}function handleEntityNotFound(_0x2bc8d8,_0x3a14ca){return function(_0x2af330){if(!_0x2af330){_0x2bc8d8['sendStatus'](0x194);}return _0x2af330;};}function handleError(_0x1f5a6c,_0x5b0723){_0x5b0723=_0x5b0723||0x1f4;return function(_0x30fedf){logger[_0x50e8('0x29')](_0x30fedf[_0x50e8('0x2a')]);if(_0x30fedf['name']){delete _0x30fedf[_0x50e8('0x2b')];}_0x1f5a6c[_0x50e8('0x1b')](_0x5b0723)[_0x50e8('0x2c')](_0x30fedf);};}exports[_0x50e8('0x2d')]=function(_0x1d77d0,_0x18aa31){var _0x2c6fb3={},_0x54d81d={},_0x290fd2={'count':0x0,'rows':[]};var _0x123be9=db['Team']['rawAttributes'];_0x54d81d[_0x50e8('0x2e')]=_[_0x50e8('0x2f')](_0x123be9);_0x54d81d[_0x50e8('0x30')]=_['keys'](_0x1d77d0['query']);_0x54d81d[_0x50e8('0x31')]=_[_0x50e8('0x32')](_0x54d81d['model'],_0x54d81d[_0x50e8('0x30')]);_0x2c6fb3[_0x50e8('0x33')]=_[_0x50e8('0x32')](_0x54d81d[_0x50e8('0x2e')],qs['fields'](_0x1d77d0[_0x50e8('0x30')]['fields']));_0x2c6fb3[_0x50e8('0x33')]=_0x2c6fb3[_0x50e8('0x33')][_0x50e8('0x34')]?_0x2c6fb3['attributes']:_0x54d81d[_0x50e8('0x2e')];if(!_0x1d77d0[_0x50e8('0x30')]['hasOwnProperty'](_0x50e8('0x35'))){_0x2c6fb3[_0x50e8('0x1f')]=qs[_0x50e8('0x1f')](_0x1d77d0[_0x50e8('0x30')]['limit']);_0x2c6fb3[_0x50e8('0x1e')]=qs[_0x50e8('0x1e')](_0x1d77d0[_0x50e8('0x30')][_0x50e8('0x1e')]);}_0x2c6fb3['order']=qs[_0x50e8('0x36')](_0x1d77d0[_0x50e8('0x30')][_0x50e8('0x36')]);_0x2c6fb3['where']=qs['filters'](_['pick'](_0x1d77d0[_0x50e8('0x30')],_0x54d81d[_0x50e8('0x31')]));if(_0x1d77d0[_0x50e8('0x30')][_0x50e8('0x37')]){_0x2c6fb3[_0x50e8('0x38')]=_[_0x50e8('0x39')](_0x2c6fb3[_0x50e8('0x38')],{'$or':_[_0x50e8('0x3a')](_0x123be9,function(_0x35f802){if(_0x35f802[_0x50e8('0x3b')]['key']!==_0x50e8('0x3c')){var _0x40214f={};_0x40214f[_0x35f802[_0x50e8('0x3d')]]={'$like':'%'+_0x1d77d0[_0x50e8('0x30')]['filter']+'%'};return _0x40214f;}})});}_0x2c6fb3=_[_0x50e8('0x39')]({},_0x2c6fb3,_0x1d77d0[_0x50e8('0x3e')]);var _0x3fa815={'where':_0x2c6fb3[_0x50e8('0x38')]};return db[_0x50e8('0x3f')]['count'](_0x3fa815)['then'](function(_0x81e6f3){_0x290fd2[_0x50e8('0x1d')]=_0x81e6f3;if(_0x1d77d0['query'][_0x50e8('0x40')]){_0x2c6fb3[_0x50e8('0x41')]=[{'all':!![]}];}return db[_0x50e8('0x3f')][_0x50e8('0x42')](_0x2c6fb3);})[_0x50e8('0x24')](function(_0x313e7b){_0x290fd2[_0x50e8('0x43')]=_0x313e7b;return _0x290fd2;})[_0x50e8('0x24')](respondWithFilteredResult(_0x18aa31,_0x2c6fb3))['catch'](handleError(_0x18aa31,null));};exports[_0x50e8('0x44')]=function(_0x44e0ca,_0x3ea251){var _0x2adae0={'raw':![],'where':{'id':_0x44e0ca[_0x50e8('0x45')]['id']}},_0x5d0173={};_0x5d0173[_0x50e8('0x2e')]=_[_0x50e8('0x2f')](db[_0x50e8('0x3f')]['rawAttributes']);_0x5d0173[_0x50e8('0x30')]=_['keys'](_0x44e0ca['query']);_0x5d0173['filters']=_[_0x50e8('0x32')](_0x5d0173[_0x50e8('0x2e')],_0x5d0173['query']);_0x2adae0[_0x50e8('0x33')]=_[_0x50e8('0x32')](_0x5d0173[_0x50e8('0x2e')],qs[_0x50e8('0x46')](_0x44e0ca[_0x50e8('0x30')][_0x50e8('0x46')]));_0x2adae0['attributes']=_0x2adae0[_0x50e8('0x33')]['length']?_0x2adae0[_0x50e8('0x33')]:_0x5d0173[_0x50e8('0x2e')];if(_0x44e0ca['query'][_0x50e8('0x40')]){_0x2adae0['include']=[{'all':!![]}];}_0x2adae0=_[_0x50e8('0x39')]({},_0x2adae0,_0x44e0ca[_0x50e8('0x3e')]);return db[_0x50e8('0x3f')][_0x50e8('0x47')](_0x2adae0)[_0x50e8('0x24')](handleEntityNotFound(_0x3ea251,null))[_0x50e8('0x24')](respondWithResult(_0x3ea251,null))[_0x50e8('0x48')](handleError(_0x3ea251,null));};exports[_0x50e8('0x49')]=function(_0x141bd4,_0x4207a6){return db[_0x50e8('0x3f')]['create'](_0x141bd4[_0x50e8('0x4a')],{})[_0x50e8('0x24')](function(_0x479431){var _0x3692ba=_0x141bd4['user'][_0x50e8('0x25')]({'plain':!![]});if(!_0x3692ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3692ba[_0x50e8('0x4b')]===_0x50e8('0x4c')){var _0x6a25dc=_0x479431[_0x50e8('0x25')]({'plain':!![]});var _0x10b229=_0x50e8('0x26');return db[_0x50e8('0x4d')]['find']({'where':{'name':_0x10b229,'userProfileId':_0x3692ba[_0x50e8('0x4e')]},'raw':!![]})[_0x50e8('0x24')](function(_0x25b7b6){if(_0x25b7b6&&_0x25b7b6[_0x50e8('0x4f')]===0x0){return db[_0x50e8('0x27')][_0x50e8('0x49')]({'name':_0x6a25dc['name'],'resourceId':_0x6a25dc['id'],'type':_0x25b7b6[_0x50e8('0x2b')],'sectionId':_0x25b7b6['id']},{})[_0x50e8('0x24')](function(){return _0x479431;});}else{return _0x479431;}})[_0x50e8('0x48')](function(_0x27c80a){logger['error'](_0x50e8('0x50'),_0x27c80a);throw _0x27c80a;});}return _0x479431;})[_0x50e8('0x24')](respondWithResult(_0x4207a6,0xc9))[_0x50e8('0x48')](handleError(_0x4207a6,null));};exports[_0x50e8('0x23')]=function(_0x207f06,_0x1372e3){if(_0x207f06[_0x50e8('0x4a')]['id']){delete _0x207f06['body']['id'];}return db['Team']['find']({'where':{'id':_0x207f06[_0x50e8('0x45')]['id']}})[_0x50e8('0x24')](handleEntityNotFound(_0x1372e3,null))[_0x50e8('0x24')](saveUpdates(_0x207f06[_0x50e8('0x4a')],null))[_0x50e8('0x24')](respondWithResult(_0x1372e3,null))[_0x50e8('0x48')](handleError(_0x1372e3,null));};exports['destroy']=function(_0x2f2154,_0x3706b6){return db[_0x50e8('0x3f')][_0x50e8('0x47')]({'where':{'id':_0x2f2154['params']['id']}})[_0x50e8('0x24')](handleEntityNotFound(_0x3706b6,null))[_0x50e8('0x24')](removeEntity(_0x3706b6,null))[_0x50e8('0x48')](handleError(_0x3706b6,null));};exports[_0x50e8('0x51')]=function(_0x22e2f8,_0x454268,_0x57a73a){return db[_0x50e8('0x3f')]['findOne']({'where':{'id':_0x22e2f8['params']['id']}})['then'](handleEntityNotFound(_0x454268,null))[_0x50e8('0x24')](function(_0x49e96f){if(!_0x22e2f8[_0x50e8('0x30')][_0x50e8('0x52')]||!utils[_0x50e8('0x53')](_0x22e2f8[_0x50e8('0x30')][_0x50e8('0x52')])){throw new db[(_0x50e8('0x54'))][(_0x50e8('0x55'))]('Unknown\x20channel');}var _0x26ab46={};var _0x42f1ed={};_0x42f1ed[_0x50e8('0x2e')]=_['keys'](db[_['capitalize'](_0x22e2f8['query'][_0x50e8('0x52')][_0x50e8('0x56')]())+_0x50e8('0x57')][_0x50e8('0x58')]);_0x42f1ed[_0x50e8('0x30')]=_[_0x50e8('0x2f')](_0x22e2f8['query']);_0x42f1ed[_0x50e8('0x31')]=_['intersection'](_0x42f1ed[_0x50e8('0x2e')],_0x42f1ed[_0x50e8('0x30')]);_0x26ab46['attributes']=_['intersection'](_0x42f1ed['model'],qs[_0x50e8('0x46')](_0x22e2f8[_0x50e8('0x30')]['fields']));_0x26ab46[_0x50e8('0x33')]=_0x26ab46[_0x50e8('0x33')][_0x50e8('0x34')]?_0x26ab46[_0x50e8('0x33')]:_0x42f1ed[_0x50e8('0x2e')];_0x26ab46['limit']=qs[_0x50e8('0x1f')](_0x22e2f8[_0x50e8('0x30')][_0x50e8('0x1f')]);_0x26ab46['offset']=qs['offset'](_0x22e2f8[_0x50e8('0x30')][_0x50e8('0x1e')]);_0x26ab46[_0x50e8('0x59')]=qs[_0x50e8('0x36')](_0x22e2f8[_0x50e8('0x30')][_0x50e8('0x36')]);_0x26ab46['where']=qs['filters'](_[_0x50e8('0x5a')](_0x22e2f8['query'],_0x42f1ed[_0x50e8('0x31')]));_0x26ab46=_[_0x50e8('0x39')]({},_0x26ab46,_0x22e2f8['options']);return _0x49e96f[_0x50e8('0x25')+_['capitalize'](_0x22e2f8['query']['channel'][_0x50e8('0x56')]())+_0x50e8('0x5b')](_0x26ab46);})[_0x50e8('0x24')](respondWithResult(_0x454268,null))[_0x50e8('0x48')](handleError(_0x454268,null));};exports['addQueues']=function(_0x480362,_0x25d89e,_0x55edcd){return db[_0x50e8('0x3f')][_0x50e8('0x5c')]({'where':{'id':_0x480362[_0x50e8('0x45')]['id']}})[_0x50e8('0x24')](function(_0x42e1dd){if(_0x42e1dd){if(!_0x480362[_0x50e8('0x4a')][_0x50e8('0x52')]||!utils[_0x50e8('0x53')](_0x480362[_0x50e8('0x4a')][_0x50e8('0x52')])){throw new db[(_0x50e8('0x54'))][(_0x50e8('0x55'))](_0x50e8('0x5d'));}return _0x42e1dd[_0x50e8('0x5e')+_[_0x50e8('0x5f')](_0x480362[_0x50e8('0x4a')]['channel'][_0x50e8('0x56')]())+_0x50e8('0x5b')](_0x480362[_0x50e8('0x4a')][_0x50e8('0x60')]);}return null;})['then'](handleEntityNotFound(_0x25d89e,null))[_0x50e8('0x24')](respondWithStatusCode(_0x25d89e,null))[_0x50e8('0x48')](handleError(_0x25d89e,null));};exports[_0x50e8('0x61')]=function(_0x161a07,_0x76d18a,_0x9319f0){return db['Team'][_0x50e8('0x5c')]({'where':{'id':_0x161a07[_0x50e8('0x45')]['id']}})[_0x50e8('0x24')](function(_0x13667e){if(_0x13667e){if(!_0x161a07['query'][_0x50e8('0x52')]||!utils['isValidChannel'](_0x161a07[_0x50e8('0x30')][_0x50e8('0x52')])){throw new db[(_0x50e8('0x54'))][(_0x50e8('0x55'))](_0x50e8('0x5d'));}return _0x13667e['remove'+_[_0x50e8('0x5f')](_0x161a07[_0x50e8('0x30')][_0x50e8('0x52')][_0x50e8('0x56')]())+_0x50e8('0x5b')](_0x161a07[_0x50e8('0x30')]['ids']);}return null;})[_0x50e8('0x24')](handleEntityNotFound(_0x76d18a,null))[_0x50e8('0x24')](respondWithStatusCode(_0x76d18a,null))['catch'](handleError(_0x76d18a,null));};exports[_0x50e8('0x62')]=function(_0x2fc1b6,_0x4f72e7,_0x3d56e7){return db['Team'][_0x50e8('0x47')]({'where':{'id':_0x2fc1b6[_0x50e8('0x45')]['id']}})['then'](handleEntityNotFound(_0x4f72e7,null))[_0x50e8('0x24')](function(_0x1733f5){if(_0x1733f5){var _0x25868f=[_0x50e8('0x63'),'Chat',_0x50e8('0x64'),'Sms',_0x50e8('0x65'),_0x50e8('0x66')];return BPromise['each'](_0x25868f,function(_0x68342){return _0x1733f5[_0x50e8('0x25')+_0x68342+_0x50e8('0x5b')]({'attributes':['id',_0x50e8('0x2b')]})[_0x50e8('0x24')](function(_0x3a4db0){return BPromise[_0x50e8('0x67')](_0x3a4db0,function(_0x410e7b){return _0x410e7b[_0x50e8('0x62')](_0x2fc1b6['body'][_0x50e8('0x60')])[_0x50e8('0x24')](function(){if(_0x68342===_0x50e8('0x63')){return db['User'][_0x50e8('0x42')]({'where':{'id':_0x2fc1b6[_0x50e8('0x4a')][_0x50e8('0x60')]},'attributes':['id','name','online',_0x50e8('0x68'),_0x50e8('0x69')],'raw':!![]})['then'](function(_0xa27033){return BPromise['each'](_[_0x50e8('0x37')](_0xa27033,{'online':0x1}),function(_0x21bff2){return db[_0x50e8('0x6a')][_0x50e8('0x6b')]({'membername':_0x21bff2['name'],'UserId':_0x21bff2['id'],'queue_name':_0x410e7b[_0x50e8('0x2b')],'VoiceQueueId':_0x410e7b['id'],'interface':_['isNil'](_0x21bff2[_0x50e8('0x69')])?util['format']('SIP/%s',_0x21bff2[_0x50e8('0x2b')]):_0x21bff2[_0x50e8('0x69')],'paused':_0x21bff2['voicePause']||![],'penalty':0x0});});});}});});})[_0x50e8('0x24')](function(){return _0x1733f5;});})['then'](function(){return _0x1733f5;});}})[_0x50e8('0x24')](function(_0x585a79){if(_0x585a79){return _0x585a79['addAgents'](_0x2fc1b6[_0x50e8('0x4a')][_0x50e8('0x60')],_[_0x50e8('0x6c')](_0x2fc1b6[_0x50e8('0x4a')],['ids','id'])||{})[_0x50e8('0x6d')](function(_0x4ecec9){for(var _0x4a6075=0x0;_0x4a6075<_0x2fc1b6[_0x50e8('0x4a')][_0x50e8('0x60')][_0x50e8('0x34')];_0x4a6075+=0x1){socket['emit']('userTeam:save',{'UserId':_0x2fc1b6['body'][_0x50e8('0x60')][_0x4a6075],'TeamId':_0x2fc1b6[_0x50e8('0x45')]['id']});}return _0x4ecec9;});}})[_0x50e8('0x24')](respondWithResult(_0x4f72e7,null))[_0x50e8('0x48')](handleError(_0x4f72e7,null));};exports[_0x50e8('0x6e')]=function(_0x1869e9,_0x500cdd,_0x5a7248){return db[_0x50e8('0x3f')][_0x50e8('0x47')]({'where':{'id':_0x1869e9[_0x50e8('0x45')]['id']}})[_0x50e8('0x24')](handleEntityNotFound(_0x500cdd,null))[_0x50e8('0x24')](function(_0x53e09a){if(_0x53e09a){return BPromise[_0x50e8('0x67')]([_0x50e8('0x6f'),_0x50e8('0x70'),'mail','sms',_0x50e8('0x71'),_0x50e8('0x72')],function(_0x474dc){return _0x53e09a['get'+_[_0x50e8('0x5f')](_0x474dc)+_0x50e8('0x5b')]({'attributes':['id','name']})[_0x50e8('0x24')](function(_0x52929f){return BPromise[_0x50e8('0x67')](_0x52929f,function(_0x1e38ea){return _0x1e38ea[_0x50e8('0x6e')](_0x1869e9[_0x50e8('0x30')][_0x50e8('0x60')])[_0x50e8('0x24')](function(){if(_0x474dc===_0x50e8('0x6f')){return db[_0x50e8('0x6a')][_0x50e8('0x73')]({'where':{'VoiceQueueId':_0x1e38ea['id'],'UserId':_0x1869e9['query'][_0x50e8('0x60')]}});}});});})['then'](function(){return _0x53e09a;});})[_0x50e8('0x24')](function(){return _0x53e09a;});}})[_0x50e8('0x24')](function(_0x26c77b){if(_0x26c77b){return _0x26c77b[_0x50e8('0x6e')](_0x1869e9[_0x50e8('0x30')][_0x50e8('0x60')])['then'](function(){if(_[_0x50e8('0x74')](_0x1869e9[_0x50e8('0x30')][_0x50e8('0x60')])){for(var _0x10b0cd=0x0;_0x10b0cd<_0x1869e9[_0x50e8('0x30')][_0x50e8('0x60')][_0x50e8('0x34')];_0x10b0cd+=0x1){socket['emit'](_0x50e8('0x75'),{'UserId':Number(_0x1869e9[_0x50e8('0x30')][_0x50e8('0x60')][_0x10b0cd]),'TeamId':Number(_0x1869e9[_0x50e8('0x45')]['id'])});}}else{socket[_0x50e8('0x76')](_0x50e8('0x75'),{'UserId':Number(_0x1869e9[_0x50e8('0x30')][_0x50e8('0x60')]),'TeamId':Number(_0x1869e9['params']['id'])});}});}})['then'](respondWithStatusCode(_0x500cdd,null))['catch'](handleError(_0x500cdd,null));};exports[_0x50e8('0x77')]=function(_0x4d055e,_0x2501af,_0x367f58){var _0x419b1d={};var _0x33332c={};var _0xbe8721;var _0x33a621;return db[_0x50e8('0x3f')][_0x50e8('0x5c')]({'where':{'id':_0x4d055e[_0x50e8('0x45')]['id']}})[_0x50e8('0x24')](handleEntityNotFound(_0x2501af,null))[_0x50e8('0x24')](function(_0x5a1afd){if(_0x5a1afd){_0xbe8721=_0x5a1afd;_0x33332c[_0x50e8('0x2e')]=_[_0x50e8('0x2f')](db['User'][_0x50e8('0x58')]);_0x33332c[_0x50e8('0x30')]=_[_0x50e8('0x2f')](_0x4d055e[_0x50e8('0x30')]);_0x33332c['filters']=_[_0x50e8('0x32')](_0x33332c[_0x50e8('0x2e')],_0x33332c['query']);_0x419b1d[_0x50e8('0x33')]=_['intersection'](_0x33332c[_0x50e8('0x2e')],qs[_0x50e8('0x46')](_0x4d055e[_0x50e8('0x30')][_0x50e8('0x46')]));_0x419b1d[_0x50e8('0x33')]=_0x419b1d[_0x50e8('0x33')][_0x50e8('0x34')]?_0x419b1d[_0x50e8('0x33')]:_0x33332c[_0x50e8('0x2e')];_0x419b1d['order']=qs[_0x50e8('0x36')](_0x4d055e[_0x50e8('0x30')][_0x50e8('0x36')]);_0x419b1d['where']=qs[_0x50e8('0x31')](_[_0x50e8('0x5a')](_0x4d055e[_0x50e8('0x30')],_0x33332c[_0x50e8('0x31')]));if(_0x4d055e['query']['filter']){_0x419b1d[_0x50e8('0x38')]=_[_0x50e8('0x39')](_0x419b1d[_0x50e8('0x38')],{'$or':_[_0x50e8('0x3a')](_0x419b1d[_0x50e8('0x33')],function(_0x5914f8){var _0x3b85a9={};_0x3b85a9[_0x5914f8]={'$like':'%'+_0x4d055e[_0x50e8('0x30')]['filter']+'%'};return _0x3b85a9;})});}_0x419b1d=_['merge']({},_0x419b1d,_0x4d055e[_0x50e8('0x3e')]);return _0xbe8721[_0x50e8('0x77')](_0x419b1d);}})['then'](function(_0x2dcd4b){if(_0x2dcd4b){_0x33a621=_0x2dcd4b['length'];if(!_0x4d055e[_0x50e8('0x30')][_0x50e8('0x78')](_0x50e8('0x35'))){_0x419b1d[_0x50e8('0x1f')]=qs[_0x50e8('0x1f')](_0x4d055e[_0x50e8('0x30')]['limit']);_0x419b1d['offset']=qs[_0x50e8('0x1e')](_0x4d055e[_0x50e8('0x30')]['offset']);}return _0xbe8721['getAgents'](_0x419b1d);}})[_0x50e8('0x24')](function(_0x4f062e){if(_0x4f062e){return _0x4f062e?{'count':_0x33a621,'rows':_0x4f062e}:null;}})[_0x50e8('0x24')](respondWithResult(_0x2501af,null))[_0x50e8('0x48')](handleError(_0x2501af,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 7685315..b8403e2 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 _0x87bc=['emit','hasOwnProperty','hook','exports','../../mysqldb','Team','setMaxListeners','save','update','remove'];(function(_0x32387b,_0x4782a6){var _0x4fc924=function(_0x531278){while(--_0x531278){_0x32387b['push'](_0x32387b['shift']());}};_0x4fc924(++_0x4782a6);}(_0x87bc,0x16c));var _0xc87b=function(_0x5b10d5,_0x2d40c9){_0x5b10d5=_0x5b10d5-0x0;var _0x178260=_0x87bc[_0x5b10d5];return _0x178260;};'use strict';var EventEmitter=require('events');var Team=require(_0xc87b('0x0'))['db'][_0xc87b('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xc87b('0x2')](0x0);var events={'afterCreate':_0xc87b('0x3'),'afterUpdate':_0xc87b('0x4'),'afterDestroy':_0xc87b('0x5')};function emitEvent(_0x3b9de4){return function(_0x124b23,_0x583d02,_0x2c3d35){TeamEvents[_0xc87b('0x6')](_0x3b9de4+':'+_0x124b23['id'],_0x124b23);TeamEvents['emit'](_0x3b9de4,_0x124b23);_0x2c3d35(null);};}for(var e in events){if(events[_0xc87b('0x7')](e)){var event=events[e];Team[_0xc87b('0x8')](e,emitEvent(event));}}module[_0xc87b('0x9')]=TeamEvents; \ No newline at end of file +var _0xe3bd=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','update','remove'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe3bd,0x11c));var _0xde3b=function(_0x5d07ff,_0x1f976f){_0x5d07ff=_0x5d07ff-0x0;var _0x5226ad=_0xe3bd[_0x5d07ff];return _0x5226ad;};'use strict';var EventEmitter=require(_0xde3b('0x0'));var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xde3b('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xde3b('0x2'),'afterDestroy':_0xde3b('0x3')};function emitEvent(_0x36a135){return function(_0x4f649c,_0x5e490a,_0x473885){TeamEvents[_0xde3b('0x4')](_0x36a135+':'+_0x4f649c['id'],_0x4f649c);TeamEvents[_0xde3b('0x4')](_0x36a135,_0x4f649c);_0x473885(null);};}for(var e in events){if(events[_0xde3b('0x5')](e)){var event=events[e];Team[_0xde3b('0x6')](e,emitEvent(event));}}module[_0xde3b('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 5dfc025..47ff91a 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 _0x22e8=['Team','teams','util','../../config/logger','api','moment','bluebird','../../config/environment','./team.attributes','exports','define'];(function(_0xc655e7,_0x362196){var _0x21d271=function(_0x2d3871){while(--_0x2d3871){_0xc655e7['push'](_0xc655e7['shift']());}};_0x21d271(++_0x362196);}(_0x22e8,0x70));var _0x822e=function(_0x2f977f,_0x4c38de){_0x2f977f=_0x2f977f-0x0;var _0x20baeb=_0x22e8[_0x2f977f];return _0x20baeb;};'use strict';var _=require('lodash');var util=require(_0x822e('0x0'));var logger=require(_0x822e('0x1'))(_0x822e('0x2'));var moment=require(_0x822e('0x3'));var BPromise=require(_0x822e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x822e('0x5'));var attributes=require(_0x822e('0x6'));module[_0x822e('0x7')]=function(_0x29fd28,_0x12f31e){return _0x29fd28[_0x822e('0x8')](_0x822e('0x9'),attributes,{'tableName':_0x822e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4dc=['Team','lodash','util','../../config/logger','api','path','../../config/environment','./team.attributes','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf4dc,0x1a8));var _0xcf4d=function(_0x329b72,_0x49b99e){_0x329b72=_0x329b72-0x0;var _0x11c1b7=_0xf4dc[_0x329b72];return _0x11c1b7;};'use strict';var _=require(_0xcf4d('0x0'));var util=require(_0xcf4d('0x1'));var logger=require(_0xcf4d('0x2'))(_0xcf4d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf4d('0x4'));var rimraf=require('rimraf');var config=require(_0xcf4d('0x5'));var attributes=require(_0xcf4d('0x6'));module[_0xcf4d('0x7')]=function(_0x3353e1,_0x10392f){return _0x3353e1['define'](_0xcf4d('0x8'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 512cc9e..b108ee7 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 _0x307c=['localhost','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','defaults'];(function(_0x4a24c2,_0x9907b5){var _0x5b3cb6=function(_0x5b1f56){while(--_0x5b1f56){_0x4a24c2['push'](_0x4a24c2['shift']());}};_0x5b3cb6(++_0x9907b5);}(_0x307c,0x147));var _0xc307=function(_0xd5e67,_0x5b0b2d){_0xd5e67=_0xd5e67-0x0;var _0x8945b3=_0x307c[_0xd5e67];return _0x8945b3;};'use strict';var _=require(_0xc307('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc307('0x1'));var fs=require('fs');var Redis=require(_0xc307('0x2'));var db=require(_0xc307('0x3'))['db'];var utils=require(_0xc307('0x4'));var logger=require('../../config/logger')(_0xc307('0x5'));var config=require(_0xc307('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xc307('0x7')]=_[_0xc307('0x8')](config[_0xc307('0x7')],{'host':_0xc307('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc307('0xa'))[_0xc307('0xb')](socket);function respondWithRpcPromise(_0x4cd48e,_0x1e3853,_0xa02361){return new BPromise(function(_0x56283e,_0x3ecff1){return client[_0xc307('0xc')](_0x4cd48e,_0xa02361)[_0xc307('0xd')](function(_0x4a72df){logger[_0xc307('0xe')](_0xc307('0xf'),_0x1e3853,_0xc307('0x10'));logger[_0xc307('0x11')]('Team,\x20%s,\x20%s,\x20%s',_0x1e3853,_0xc307('0x10'),JSON[_0xc307('0x12')](_0x4a72df));if(_0x4a72df[_0xc307('0x13')]){if(_0x4a72df['error'][_0xc307('0x14')]===0x1f4){logger['error'](_0xc307('0xf'),_0x1e3853,_0x4a72df[_0xc307('0x13')][_0xc307('0x15')]);return _0x3ecff1(_0x4a72df[_0xc307('0x13')]['message']);}logger[_0xc307('0x13')](_0xc307('0xf'),_0x1e3853,_0x4a72df[_0xc307('0x13')][_0xc307('0x15')]);return _0x56283e(_0x4a72df[_0xc307('0x13')]['message']);}else{logger['info'](_0xc307('0xf'),_0x1e3853,_0xc307('0x10'));_0x56283e(_0x4a72df[_0xc307('0x16')]['message']);}})[_0xc307('0x17')](function(_0x267a29){logger[_0xc307('0x13')](_0xc307('0xf'),_0x1e3853,_0x267a29);_0x3ecff1(_0x267a29);});});} \ No newline at end of file +var _0x27f6=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./team.socket','register','request','then','Team,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','util','moment','bluebird'];(function(_0x258919,_0x1754e6){var _0xfbd68b=function(_0x3bc3e9){while(--_0x3bc3e9){_0x258919['push'](_0x258919['shift']());}};_0xfbd68b(++_0x1754e6);}(_0x27f6,0xa5));var _0x627f=function(_0x54f9ec,_0x5e0cdd){_0x54f9ec=_0x54f9ec-0x0;var _0x4ced52=_0x27f6[_0x54f9ec];return _0x4ced52;};'use strict';var _=require('lodash');var util=require(_0x627f('0x0'));var moment=require(_0x627f('0x1'));var BPromise=require(_0x627f('0x2'));var rs=require(_0x627f('0x3'));var fs=require('fs');var Redis=require(_0x627f('0x4'));var db=require(_0x627f('0x5'))['db'];var utils=require(_0x627f('0x6'));var logger=require(_0x627f('0x7'))(_0x627f('0x8'));var config=require(_0x627f('0x9'));var jayson=require(_0x627f('0xa'));var client=jayson[_0x627f('0xb')][_0x627f('0xc')]({'port':0x232a});config[_0x627f('0xd')]=_[_0x627f('0xe')](config[_0x627f('0xd')],{'host':_0x627f('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x627f('0xd')]));require(_0x627f('0x10'))[_0x627f('0x11')](socket);function respondWithRpcPromise(_0x1cbf86,_0x228219,_0x32baf2){return new BPromise(function(_0x3ad218,_0x4ca54f){return client[_0x627f('0x12')](_0x1cbf86,_0x32baf2)[_0x627f('0x13')](function(_0x3e1570){logger['info'](_0x627f('0x14'),_0x228219,'request\x20sent');logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x228219,'request\x20sent',JSON[_0x627f('0x15')](_0x3e1570));if(_0x3e1570['error']){if(_0x3e1570['error'][_0x627f('0x16')]===0x1f4){logger[_0x627f('0x17')]('Team,\x20%s,\x20%s',_0x228219,_0x3e1570['error'][_0x627f('0x18')]);return _0x4ca54f(_0x3e1570[_0x627f('0x17')][_0x627f('0x18')]);}logger[_0x627f('0x17')](_0x627f('0x14'),_0x228219,_0x3e1570['error'][_0x627f('0x18')]);return _0x3ad218(_0x3e1570[_0x627f('0x17')][_0x627f('0x18')]);}else{logger['info'](_0x627f('0x14'),_0x228219,_0x627f('0x19'));_0x3ad218(_0x3e1570[_0x627f('0x1a')][_0x627f('0x18')]);}})[_0x627f('0x1b')](function(_0x45ae50){logger[_0x627f('0x17')]('Team,\x20%s,\x20%s',_0x228219,_0x45ae50);_0x4ca54f(_0x45ae50);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index ad072a6..d90ab9a 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 _0x7ebb=['removeListener','register','length','./team.events','save','remove','update'];(function(_0x1b8549,_0xc0df4e){var _0x41e843=function(_0x381e45){while(--_0x381e45){_0x1b8549['push'](_0x1b8549['shift']());}};_0x41e843(++_0xc0df4e);}(_0x7ebb,0x161));var _0xb7eb=function(_0x2e030a,_0x8e4c48){_0x2e030a=_0x2e030a-0x0;var _0x597df6=_0x7ebb[_0x2e030a];return _0x597df6;};'use strict';var TeamEvents=require(_0xb7eb('0x0'));var events=[_0xb7eb('0x1'),_0xb7eb('0x2'),_0xb7eb('0x3')];function createListener(_0x394365,_0x253435){return function(_0x25880b){_0x253435['emit'](_0x394365,_0x25880b);};}function removeListener(_0x2d63cf,_0x2b664d){return function(){TeamEvents[_0xb7eb('0x4')](_0x2d63cf,_0x2b664d);};}exports[_0xb7eb('0x5')]=function(_0x415157){for(var _0x3982d7=0x0,_0x2b53b1=events[_0xb7eb('0x6')];_0x3982d7<_0x2b53b1;_0x3982d7++){var _0x282eb0=events[_0x3982d7];var _0x3abb1f=createListener('team:'+_0x282eb0,_0x415157);TeamEvents['on'](_0x282eb0,_0x3abb1f);}}; \ No newline at end of file +var _0x3831=['removeListener','team:','./team.events','remove','update'];(function(_0xf1896b,_0x485e38){var _0x50aa6c=function(_0x4f397a){while(--_0x4f397a){_0xf1896b['push'](_0xf1896b['shift']());}};_0x50aa6c(++_0x485e38);}(_0x3831,0x14c));var _0x1383=function(_0x594867,_0x2ee5d3){_0x594867=_0x594867-0x0;var _0x9ac5b1=_0x3831[_0x594867];return _0x9ac5b1;};'use strict';var TeamEvents=require(_0x1383('0x0'));var events=['save',_0x1383('0x1'),_0x1383('0x2')];function createListener(_0x3a25fd,_0x15e6b5){return function(_0x391bef){_0x15e6b5['emit'](_0x3a25fd,_0x391bef);};}function removeListener(_0x2fdf72,_0x573874){return function(){TeamEvents[_0x1383('0x3')](_0x2fdf72,_0x573874);};}exports['register']=function(_0x5b64b1){for(var _0x5eb4d8=0x0,_0x45a030=events['length'];_0x5eb4d8<_0x45a030;_0x5eb4d8++){var _0x187027=events[_0x5eb4d8];var _0x1ddd4c=createListener(_0x1383('0x4')+_0x187027,_0x5b64b1);TeamEvents['on'](_0x187027,_0x1ddd4c);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index c381c17..1307cf2 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 _0x834f=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','index','get','isAuthenticated','show','post','create','/:id','update','delete','destroy'];(function(_0x4468e4,_0x1a6f41){var _0x198f0c=function(_0x147fa8){while(--_0x147fa8){_0x4468e4['push'](_0x4468e4['shift']());}};_0x198f0c(++_0x1a6f41);}(_0x834f,0xd2));var _0xf834=function(_0x3ed357,_0x5db971){_0x3ed357=_0x3ed357-0x0;var _0x5ece20=_0x834f[_0x3ed357];return _0x5ece20;};'use strict';var multer=require('multer');var util=require(_0xf834('0x0'));var path=require(_0xf834('0x1'));var timeout=require(_0xf834('0x2'));var express=require('express');var router=express[_0xf834('0x3')]();var auth=require(_0xf834('0x4'));var interaction=require(_0xf834('0x5'));var config=require(_0xf834('0x6'));var controller=require(_0xf834('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf834('0x8')]);router[_0xf834('0x9')]('/:id',auth[_0xf834('0xa')](),controller[_0xf834('0xb')]);router[_0xf834('0xc')]('/',auth[_0xf834('0xa')](),controller[_0xf834('0xd')]);router['put'](_0xf834('0xe'),auth['isAuthenticated'](),controller[_0xf834('0xf')]);router[_0xf834('0x10')](_0xf834('0xe'),auth[_0xf834('0xa')](),controller[_0xf834('0x11')]);module[_0xf834('0x12')]=router; \ No newline at end of file +var _0x6875=['index','/:id','show','post','put','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x6875,0x1ab));var _0x5687=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x6875[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x5687('0x0'));var util=require(_0x5687('0x1'));var path=require(_0x5687('0x2'));var timeout=require(_0x5687('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x5687('0x4'));var interaction=require(_0x5687('0x5'));var config=require('../../config/environment');var controller=require('./template.controller');router[_0x5687('0x6')]('/',auth[_0x5687('0x7')](),controller[_0x5687('0x8')]);router[_0x5687('0x6')](_0x5687('0x9'),auth[_0x5687('0x7')](),controller[_0x5687('0xa')]);router[_0x5687('0xb')]('/',auth[_0x5687('0x7')](),controller['create']);router[_0x5687('0xc')]('/:id',auth[_0x5687('0x7')](),controller['update']);router[_0x5687('0xd')](_0x5687('0x9'),auth[_0x5687('0x7')](),controller[_0x5687('0xe')]);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 df6391e..b4ecc73 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 _0x6903=['sequelize','exports','STRING','TEXT'];(function(_0x3b50da,_0x1c7ad3){var _0x350f79=function(_0x2fd583){while(--_0x2fd583){_0x3b50da['push'](_0x3b50da['shift']());}};_0x350f79(++_0x1c7ad3);}(_0x6903,0x104));var _0x3690=function(_0x1e8e3c,_0x41e786){_0x1e8e3c=_0x1e8e3c-0x0;var _0x36fcc5=_0x6903[_0x1e8e3c];return _0x36fcc5;};'use strict';var Sequelize=require(_0x3690('0x0'));module[_0x3690('0x1')]={'name':{'type':Sequelize[_0x3690('0x2')]},'description':{'type':Sequelize[_0x3690('0x2')]},'html':{'type':Sequelize[_0x3690('0x3')]}}; \ No newline at end of file +var _0x5123=['TEXT','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5123,0xb9));var _0x3512=function(_0x459fc0,_0x599abe){_0x459fc0=_0x459fc0-0x0;var _0x7b7e14=_0x5123[_0x459fc0];return _0x7b7e14;};'use strict';var Sequelize=require(_0x3512('0x0'));module[_0x3512('0x1')]={'name':{'type':Sequelize[_0x3512('0x2')]},'description':{'type':Sequelize[_0x3512('0x2')]},'html':{'type':Sequelize[_0x3512('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 1f313bc..75ec45f 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 _0x3e74=['sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','get','Templates','end','name','send','index','Template','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','where','pick','filter','merge','type','key','VIRTUAL','field','includeAll','include','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path'];(function(_0xeeb3e5,_0x103ee7){var _0x15609f=function(_0x2fb041){while(--_0x2fb041){_0xeeb3e5['push'](_0xeeb3e5['shift']());}};_0x15609f(++_0x103ee7);}(_0x3e74,0x175));var _0x43e7=function(_0x298f9d,_0x3dc087){_0x298f9d=_0x298f9d-0x0;var _0x5eca6f=_0x3e74[_0x298f9d];return _0x5eca6f;};'use strict';var pdf=require(_0x43e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x43e7('0x1'));var zipdir=require(_0x43e7('0x2'));var jsonpatch=require(_0x43e7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x43e7('0x4'));var Mustache=require('mustache');var util=require(_0x43e7('0x5'));var path=require(_0x43e7('0x6'));var sox=require(_0x43e7('0x7'));var csv=require(_0x43e7('0x8'));var ejs=require(_0x43e7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x8'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var hardwareService=require(_0x43e7('0x10'));var logger=require('../../config/logger')(_0x43e7('0x11'));var utils=require('../../config/utils');var config=require(_0x43e7('0x12'));var db=require(_0x43e7('0x13'))['db'];function respondWithStatusCode(_0x4ebc8e,_0x3eb206){_0x3eb206=_0x3eb206||0xcc;return function(_0xc960ea){if(_0xc960ea){return _0x4ebc8e[_0x43e7('0x14')](_0x3eb206);}return _0x4ebc8e[_0x43e7('0x15')](_0x3eb206)['end']();};}function respondWithResult(_0x583d85,_0x2fcb36){_0x2fcb36=_0x2fcb36||0xc8;return function(_0x21fdd3){if(_0x21fdd3){return _0x583d85[_0x43e7('0x15')](_0x2fcb36)['json'](_0x21fdd3);}};}function respondWithFilteredResult(_0x5e641c,_0x16849c){return function(_0x14c146){if(_0x14c146){var _0x203378=_0x14c146[_0x43e7('0x16')],_0x328445=_0x16849c[_0x43e7('0x17')],_0x4de324=_0x16849c[_0x43e7('0x17')]+_0x16849c['limit'],_0x5c4eaa;if(_0x4de324>=_0x203378){_0x4de324=_0x203378;_0x5c4eaa=0xc8;}else{_0x5c4eaa=0xce;}_0x5e641c['status'](_0x5c4eaa);return _0x5e641c[_0x43e7('0x18')](_0x43e7('0x19'),_0x328445+'-'+_0x4de324+'/'+_0x203378)[_0x43e7('0x1a')](_0x14c146);}return null;};}function patchUpdates(_0x140657){return function(_0x3776f5){try{jsonpatch[_0x43e7('0x1b')](_0x3776f5,_0x140657,!![]);}catch(_0x619236){return BPromise[_0x43e7('0x1c')](_0x619236);}return _0x3776f5[_0x43e7('0x1d')]();};}function saveUpdates(_0xab63cf,_0x191dd5){return function(_0x177ee1){if(_0x177ee1){return _0x177ee1['update'](_0xab63cf)[_0x43e7('0x1e')](function(_0x3c6625){return _0x3c6625;});}return null;};}function removeEntity(_0x4b386b,_0x2898b5){return function(_0x3e281e){if(_0x3e281e){return _0x3e281e[_0x43e7('0x1f')]()[_0x43e7('0x1e')](function(){var _0x4077fb=_0x3e281e[_0x43e7('0x20')]({'plain':!![]});var _0x54a9e7=_0x43e7('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0x54a9e7,'resourceId':_0x4077fb['id']}})[_0x43e7('0x1e')](function(){return _0x3e281e;});})[_0x43e7('0x1e')](function(){_0x4b386b['status'](0xcc)[_0x43e7('0x22')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x14')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x23')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x15')](_0x20888b)[_0x43e7('0x24')](_0x405f85);};}exports[_0x43e7('0x25')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=db[_0x43e7('0x26')][_0x43e7('0x27')];_0x4690a6[_0x43e7('0x28')]=_[_0x43e7('0x29')](_0x50f9f5);_0x4690a6[_0x43e7('0x2a')]=_[_0x43e7('0x29')](_0xb1fc63[_0x43e7('0x2a')]);_0x4690a6[_0x43e7('0x2b')]=_[_0x43e7('0x2c')](_0x4690a6[_0x43e7('0x28')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x2d')]=_[_0x43e7('0x2c')](_0x4690a6[_0x43e7('0x28')],qs[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2a')]['fields']));_0x33a1a5[_0x43e7('0x2d')]=_0x33a1a5[_0x43e7('0x2d')][_0x43e7('0x2f')]?_0x33a1a5[_0x43e7('0x2d')]:_0x4690a6['model'];if(!_0xb1fc63['query']['hasOwnProperty'](_0x43e7('0x30'))){_0x33a1a5[_0x43e7('0x31')]=qs[_0x43e7('0x31')](_0xb1fc63[_0x43e7('0x2a')][_0x43e7('0x31')]);_0x33a1a5[_0x43e7('0x17')]=qs['offset'](_0xb1fc63['query']['offset']);}_0x33a1a5['order']=qs['sort'](_0xb1fc63['query']['sort']);_0x33a1a5[_0x43e7('0x32')]=qs['filters'](_[_0x43e7('0x33')](_0xb1fc63[_0x43e7('0x2a')],_0x4690a6[_0x43e7('0x2b')]));if(_0xb1fc63[_0x43e7('0x2a')][_0x43e7('0x34')]){_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x35')](_0x33a1a5['where'],{'$or':_['map'](_0x50f9f5,function(_0x5d84f4){if(_0x5d84f4[_0x43e7('0x36')][_0x43e7('0x37')]!==_0x43e7('0x38')){var _0x16cdba={};_0x16cdba[_0x5d84f4[_0x43e7('0x39')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2a')][_0x43e7('0x34')]+'%'};return _0x16cdba;}})});}_0x33a1a5=_[_0x43e7('0x35')]({},_0x33a1a5,_0xb1fc63['options']);var _0x61ed8e={'where':_0x33a1a5[_0x43e7('0x32')]};return db['Template'][_0x43e7('0x16')](_0x61ed8e)['then'](function(_0x44d8e4){_0x45b675[_0x43e7('0x16')]=_0x44d8e4;if(_0xb1fc63[_0x43e7('0x2a')][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x3b')]=[{'all':!![]}];}return db[_0x43e7('0x26')]['findAll'](_0x33a1a5);})['then'](function(_0x30dfa9){_0x45b675[_0x43e7('0x3c')]=_0x30dfa9;return _0x45b675;})[_0x43e7('0x1e')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))[_0x43e7('0x3d')](handleError(_0x5087d7,null));};exports[_0x43e7('0x3e')]=function(_0x4a4a85,_0x32a451){var _0x4227c4={'raw':!![],'where':{'id':_0x4a4a85[_0x43e7('0x3f')]['id']}},_0x575439={};_0x575439['model']=_[_0x43e7('0x29')](db['Template'][_0x43e7('0x27')]);_0x575439[_0x43e7('0x2a')]=_[_0x43e7('0x29')](_0x4a4a85[_0x43e7('0x2a')]);_0x575439['filters']=_['intersection'](_0x575439[_0x43e7('0x28')],_0x575439[_0x43e7('0x2a')]);_0x4227c4[_0x43e7('0x2d')]=_[_0x43e7('0x2c')](_0x575439['model'],qs['fields'](_0x4a4a85['query'][_0x43e7('0x2e')]));_0x4227c4['attributes']=_0x4227c4[_0x43e7('0x2d')]['length']?_0x4227c4['attributes']:_0x575439[_0x43e7('0x28')];if(_0x4a4a85['query'][_0x43e7('0x3a')]){_0x4227c4[_0x43e7('0x3b')]=[{'all':!![]}];}_0x4227c4=_[_0x43e7('0x35')]({},_0x4227c4,_0x4a4a85[_0x43e7('0x40')]);return db['Template'][_0x43e7('0x41')](_0x4227c4)[_0x43e7('0x1e')](handleEntityNotFound(_0x32a451,null))[_0x43e7('0x1e')](respondWithResult(_0x32a451,null))[_0x43e7('0x3d')](handleError(_0x32a451,null));};exports[_0x43e7('0x42')]=function(_0x1efe59,_0x51eef4){return db['Template'][_0x43e7('0x42')](_0x1efe59[_0x43e7('0x43')],{})[_0x43e7('0x1e')](function(_0x4c00a8){var _0x5c1c18=_0x1efe59['user'][_0x43e7('0x20')]({'plain':!![]});if(!_0x5c1c18)throw new Error(_0x43e7('0x44'));if(_0x5c1c18['role']===_0x43e7('0x45')){var _0x47686e=_0x4c00a8[_0x43e7('0x20')]({'plain':!![]});var _0x560329='Templates';return db['UserProfileSection']['find']({'where':{'name':_0x560329,'userProfileId':_0x5c1c18[_0x43e7('0x46')]},'raw':!![]})[_0x43e7('0x1e')](function(_0x52fea5){if(_0x52fea5&&_0x52fea5[_0x43e7('0x47')]===0x0){return db[_0x43e7('0x48')][_0x43e7('0x42')]({'name':_0x47686e[_0x43e7('0x23')],'resourceId':_0x47686e['id'],'type':_0x52fea5['name'],'sectionId':_0x52fea5['id']},{})[_0x43e7('0x1e')](function(){return _0x4c00a8;});}else{return _0x4c00a8;}})['catch'](function(_0x4bebd4){logger[_0x43e7('0x49')](_0x43e7('0x4a'),_0x4bebd4);throw _0x4bebd4;});}return _0x4c00a8;})[_0x43e7('0x1e')](respondWithResult(_0x51eef4,0xc9))[_0x43e7('0x3d')](handleError(_0x51eef4,null));};exports[_0x43e7('0x4b')]=function(_0x2351cf,_0x1cd87c){if(_0x2351cf[_0x43e7('0x43')]['id']){delete _0x2351cf[_0x43e7('0x43')]['id'];}return db[_0x43e7('0x26')]['find']({'where':{'id':_0x2351cf[_0x43e7('0x3f')]['id']}})[_0x43e7('0x1e')](handleEntityNotFound(_0x1cd87c,null))['then'](saveUpdates(_0x2351cf[_0x43e7('0x43')],null))['then'](respondWithResult(_0x1cd87c,null))[_0x43e7('0x3d')](handleError(_0x1cd87c,null));};exports[_0x43e7('0x1f')]=function(_0x34e2ec,_0x1f561f){return db[_0x43e7('0x26')]['find']({'where':{'id':_0x34e2ec['params']['id']}})[_0x43e7('0x1e')](handleEntityNotFound(_0x1f561f,null))[_0x43e7('0x1e')](removeEntity(_0x1f561f,null))[_0x43e7('0x3d')](handleError(_0x1f561f,null));}; \ No newline at end of file +var _0x9c44=['sendStatus','status','json','count','offset','limit','save','update','then','Templates','UserProfileResource','destroy','end','stack','name','send','index','Template','rawAttributes','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','length','find','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','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0xe2b965,_0x55ae69){var _0x340dad=function(_0x29a9d5){while(--_0x29a9d5){_0xe2b965['push'](_0xe2b965['shift']());}};_0x340dad(++_0x55ae69);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x49c4('0x0'));var zipdir=require(_0x49c4('0x1'));var jsonpatch=require(_0x49c4('0x2'));var rp=require(_0x49c4('0x3'));var moment=require(_0x49c4('0x4'));var BPromise=require(_0x49c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49c4('0x6'));var sox=require('sox');var csv=require(_0x49c4('0x7'));var ejs=require(_0x49c4('0x8'));var fs=require('fs');var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0x7'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0xf'));var hardwareService=require(_0x49c4('0x10'));var logger=require('../../config/logger')(_0x49c4('0x11'));var utils=require(_0x49c4('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d19bf,_0x6d1b08){_0x6d1b08=_0x6d1b08||0xcc;return function(_0x5487cd){if(_0x5487cd){return _0x1d19bf[_0x49c4('0x13')](_0x6d1b08);}return _0x1d19bf[_0x49c4('0x14')](_0x6d1b08)['end']();};}function respondWithResult(_0x1909fe,_0x280996){_0x280996=_0x280996||0xc8;return function(_0x21f15a){if(_0x21f15a){return _0x1909fe[_0x49c4('0x14')](_0x280996)[_0x49c4('0x15')](_0x21f15a);}};}function respondWithFilteredResult(_0x18211c,_0x75ea8){return function(_0x3de397){if(_0x3de397){var _0x58d177=_0x3de397[_0x49c4('0x16')],_0x3acd06=_0x75ea8[_0x49c4('0x17')],_0x141003=_0x75ea8['offset']+_0x75ea8[_0x49c4('0x18')],_0x13a2db;if(_0x141003>=_0x58d177){_0x141003=_0x58d177;_0x13a2db=0xc8;}else{_0x13a2db=0xce;}_0x18211c[_0x49c4('0x14')](_0x13a2db);return _0x18211c['set']('Content-Range',_0x3acd06+'-'+_0x141003+'/'+_0x58d177)[_0x49c4('0x15')](_0x3de397);}return null;};}function patchUpdates(_0x2f82d5){return function(_0x3addb2){try{jsonpatch['apply'](_0x3addb2,_0x2f82d5,!![]);}catch(_0x24856d){return BPromise['reject'](_0x24856d);}return _0x3addb2[_0x49c4('0x19')]();};}function saveUpdates(_0x1806c2,_0xe31fcc){return function(_0x291526){if(_0x291526){return _0x291526[_0x49c4('0x1a')](_0x1806c2)[_0x49c4('0x1b')](function(_0x280893){return _0x280893;});}return null;};}function removeEntity(_0x46e475,_0x2197d2){return function(_0x578447){if(_0x578447){return _0x578447['destroy']()['then'](function(){var _0x1c99b1=_0x578447['get']({'plain':!![]});var _0x592bb8=_0x49c4('0x1c');return db[_0x49c4('0x1d')][_0x49c4('0x1e')]({'where':{'type':_0x592bb8,'resourceId':_0x1c99b1['id']}})[_0x49c4('0x1b')](function(){return _0x578447;});})['then'](function(){_0x46e475['status'](0xcc)[_0x49c4('0x1f')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x13')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x20')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x21')];}_0x210159[_0x49c4('0x14')](_0xa7a826)[_0x49c4('0x22')](_0x531d92);};}exports[_0x49c4('0x23')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=db[_0x49c4('0x24')][_0x49c4('0x25')];_0x46e04d[_0x49c4('0x26')]=_[_0x49c4('0x27')](_0x6329b3);_0x46e04d[_0x49c4('0x28')]=_[_0x49c4('0x27')](_0x5987ae['query']);_0x46e04d['filters']=_['intersection'](_0x46e04d[_0x49c4('0x26')],_0x46e04d[_0x49c4('0x28')]);_0x2b2793[_0x49c4('0x29')]=_[_0x49c4('0x2a')](_0x46e04d[_0x49c4('0x26')],qs['fields'](_0x5987ae[_0x49c4('0x28')][_0x49c4('0x2b')]));_0x2b2793[_0x49c4('0x29')]=_0x2b2793[_0x49c4('0x29')]['length']?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x26')];if(!_0x5987ae[_0x49c4('0x28')][_0x49c4('0x2c')](_0x49c4('0x2d'))){_0x2b2793[_0x49c4('0x18')]=qs['limit'](_0x5987ae[_0x49c4('0x28')][_0x49c4('0x18')]);_0x2b2793[_0x49c4('0x17')]=qs['offset'](_0x5987ae['query'][_0x49c4('0x17')]);}_0x2b2793[_0x49c4('0x2e')]=qs[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x28')][_0x49c4('0x2f')]);_0x2b2793[_0x49c4('0x30')]=qs[_0x49c4('0x31')](_[_0x49c4('0x32')](_0x5987ae[_0x49c4('0x28')],_0x46e04d['filters']));if(_0x5987ae[_0x49c4('0x28')]['filter']){_0x2b2793[_0x49c4('0x30')]=_[_0x49c4('0x33')](_0x2b2793[_0x49c4('0x30')],{'$or':_[_0x49c4('0x34')](_0x6329b3,function(_0x4ed4f8){if(_0x4ed4f8[_0x49c4('0x35')][_0x49c4('0x36')]!==_0x49c4('0x37')){var _0x4e913a={};_0x4e913a[_0x4ed4f8[_0x49c4('0x38')]]={'$like':'%'+_0x5987ae[_0x49c4('0x28')][_0x49c4('0x39')]+'%'};return _0x4e913a;}})});}_0x2b2793=_[_0x49c4('0x33')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3a')]);var _0x24c177={'where':_0x2b2793[_0x49c4('0x30')]};return db[_0x49c4('0x24')][_0x49c4('0x16')](_0x24c177)[_0x49c4('0x1b')](function(_0x1e506a){_0x4f28a2['count']=_0x1e506a;if(_0x5987ae[_0x49c4('0x28')][_0x49c4('0x3b')]){_0x2b2793[_0x49c4('0x3c')]=[{'all':!![]}];}return db[_0x49c4('0x24')][_0x49c4('0x3d')](_0x2b2793);})[_0x49c4('0x1b')](function(_0x1be62d){_0x4f28a2[_0x49c4('0x3e')]=_0x1be62d;return _0x4f28a2;})[_0x49c4('0x1b')](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x3f')](handleError(_0x889909,null));};exports[_0x49c4('0x40')]=function(_0xa3d59e,_0x326142){var _0x4e38bc={'raw':!![],'where':{'id':_0xa3d59e['params']['id']}},_0x212366={};_0x212366[_0x49c4('0x26')]=_[_0x49c4('0x27')](db[_0x49c4('0x24')][_0x49c4('0x25')]);_0x212366[_0x49c4('0x28')]=_[_0x49c4('0x27')](_0xa3d59e['query']);_0x212366['filters']=_[_0x49c4('0x2a')](_0x212366[_0x49c4('0x26')],_0x212366[_0x49c4('0x28')]);_0x4e38bc[_0x49c4('0x29')]=_['intersection'](_0x212366[_0x49c4('0x26')],qs[_0x49c4('0x2b')](_0xa3d59e[_0x49c4('0x28')][_0x49c4('0x2b')]));_0x4e38bc[_0x49c4('0x29')]=_0x4e38bc[_0x49c4('0x29')][_0x49c4('0x41')]?_0x4e38bc[_0x49c4('0x29')]:_0x212366[_0x49c4('0x26')];if(_0xa3d59e['query'][_0x49c4('0x3b')]){_0x4e38bc['include']=[{'all':!![]}];}_0x4e38bc=_[_0x49c4('0x33')]({},_0x4e38bc,_0xa3d59e[_0x49c4('0x3a')]);return db[_0x49c4('0x24')][_0x49c4('0x42')](_0x4e38bc)[_0x49c4('0x1b')](handleEntityNotFound(_0x326142,null))['then'](respondWithResult(_0x326142,null))[_0x49c4('0x3f')](handleError(_0x326142,null));};exports[_0x49c4('0x43')]=function(_0x384862,_0x254d07){return db[_0x49c4('0x24')][_0x49c4('0x43')](_0x384862[_0x49c4('0x44')],{})['then'](function(_0x3bac1b){var _0x5cfff9=_0x384862[_0x49c4('0x45')][_0x49c4('0x46')]({'plain':!![]});if(!_0x5cfff9)throw new Error(_0x49c4('0x47'));if(_0x5cfff9[_0x49c4('0x48')]===_0x49c4('0x45')){var _0x30bea5=_0x3bac1b[_0x49c4('0x46')]({'plain':!![]});var _0x506c71=_0x49c4('0x1c');return db[_0x49c4('0x49')]['find']({'where':{'name':_0x506c71,'userProfileId':_0x5cfff9[_0x49c4('0x4a')]},'raw':!![]})[_0x49c4('0x1b')](function(_0xfbe179){if(_0xfbe179&&_0xfbe179[_0x49c4('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x30bea5[_0x49c4('0x21')],'resourceId':_0x30bea5['id'],'type':_0xfbe179['name'],'sectionId':_0xfbe179['id']},{})[_0x49c4('0x1b')](function(){return _0x3bac1b;});}else{return _0x3bac1b;}})[_0x49c4('0x3f')](function(_0x3811b2){logger[_0x49c4('0x4c')](_0x49c4('0x4d'),_0x3811b2);throw _0x3811b2;});}return _0x3bac1b;})[_0x49c4('0x1b')](respondWithResult(_0x254d07,0xc9))[_0x49c4('0x3f')](handleError(_0x254d07,null));};exports['update']=function(_0x1f26c2,_0x1550ce){if(_0x1f26c2[_0x49c4('0x44')]['id']){delete _0x1f26c2[_0x49c4('0x44')]['id'];}return db[_0x49c4('0x24')][_0x49c4('0x42')]({'where':{'id':_0x1f26c2[_0x49c4('0x4e')]['id']}})[_0x49c4('0x1b')](handleEntityNotFound(_0x1550ce,null))[_0x49c4('0x1b')](saveUpdates(_0x1f26c2[_0x49c4('0x44')],null))['then'](respondWithResult(_0x1550ce,null))['catch'](handleError(_0x1550ce,null));};exports[_0x49c4('0x1e')]=function(_0x3f9a9d,_0x527e74){return db['Template'][_0x49c4('0x42')]({'where':{'id':_0x3f9a9d['params']['id']}})['then'](handleEntityNotFound(_0x527e74,null))[_0x49c4('0x1b')](removeEntity(_0x527e74,null))[_0x49c4('0x3f')](handleError(_0x527e74,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index f96be39..54b4ede 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 _0xa560=['../../config/environment','./template.attributes','exports','define','Template','tools_templates','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x33db3a,_0x203d7a){var _0x1f2d3f=function(_0x402010){while(--_0x402010){_0x33db3a['push'](_0x33db3a['shift']());}};_0x1f2d3f(++_0x203d7a);}(_0xa560,0x18c));var _0x0a56=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xa560[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x0a56('0x0'));var logger=require(_0x0a56('0x1'))(_0x0a56('0x2'));var moment=require('moment');var BPromise=require(_0x0a56('0x3'));var rp=require(_0x0a56('0x4'));var fs=require('fs');var path=require(_0x0a56('0x5'));var rimraf=require(_0x0a56('0x6'));var config=require(_0x0a56('0x7'));var attributes=require(_0x0a56('0x8'));module[_0x0a56('0x9')]=function(_0x490801,_0x44ef63){return _0x490801[_0x0a56('0xa')](_0x0a56('0xb'),attributes,{'tableName':_0x0a56('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7cb2=['request-promise','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','util','../../config/logger','api','bluebird'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x7cb2,0x167));var _0x27cb=function(_0xd853d9,_0x357ea0){_0xd853d9=_0xd853d9-0x0;var _0x21a348=_0x7cb2[_0xd853d9];return _0x21a348;};'use strict';var _=require(_0x27cb('0x0'));var util=require(_0x27cb('0x1'));var logger=require(_0x27cb('0x2'))(_0x27cb('0x3'));var moment=require('moment');var BPromise=require(_0x27cb('0x4'));var rp=require(_0x27cb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x27cb('0x6'));var config=require(_0x27cb('0x7'));var attributes=require(_0x27cb('0x8'));module[_0x27cb('0x9')]=function(_0x3f7379,_0x43ef2b){return _0x3f7379[_0x27cb('0xa')](_0x27cb('0xb'),attributes,{'tableName':_0x27cb('0xc'),'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 bb2241d..98160fb 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 _0x9e42=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetTemplate','findAll','options','raw','where','attributes','limit','include','map','model','catch'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x9e42,0x1f0));var _0x29e4=function(_0x2f8530,_0x5cbd67){_0x2f8530=_0x2f8530-0x0;var _0x5e814e=_0x9e42[_0x2f8530];return _0x5e814e;};'use strict';var _=require('lodash');var util=require(_0x29e4('0x0'));var moment=require(_0x29e4('0x1'));var BPromise=require('bluebird');var rs=require(_0x29e4('0x2'));var fs=require('fs');var Redis=require(_0x29e4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x29e4('0x4'));var logger=require(_0x29e4('0x5'))('rpc');var config=require(_0x29e4('0x6'));var jayson=require(_0x29e4('0x7'));var client=jayson[_0x29e4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fc04f,_0x51dcc3,_0x23dbbd){return new BPromise(function(_0xfe3334,_0x694d3d){return client[_0x29e4('0x9')](_0x4fc04f,_0x23dbbd)[_0x29e4('0xa')](function(_0x5c16d6){logger[_0x29e4('0xb')](_0x29e4('0xc'),_0x51dcc3,_0x29e4('0xd'));logger[_0x29e4('0xe')](_0x29e4('0xf'),_0x51dcc3,_0x29e4('0xd'),JSON[_0x29e4('0x10')](_0x5c16d6));if(_0x5c16d6[_0x29e4('0x11')]){if(_0x5c16d6[_0x29e4('0x11')][_0x29e4('0x12')]===0x1f4){logger[_0x29e4('0x11')](_0x29e4('0xc'),_0x51dcc3,_0x5c16d6[_0x29e4('0x11')][_0x29e4('0x13')]);return _0x694d3d(_0x5c16d6[_0x29e4('0x11')][_0x29e4('0x13')]);}logger['error'](_0x29e4('0xc'),_0x51dcc3,_0x5c16d6[_0x29e4('0x11')][_0x29e4('0x13')]);return _0xfe3334(_0x5c16d6['error'][_0x29e4('0x13')]);}else{logger[_0x29e4('0xb')](_0x29e4('0xc'),_0x51dcc3,_0x29e4('0xd'));_0xfe3334(_0x5c16d6['result'][_0x29e4('0x13')]);}})['catch'](function(_0x3e2403){logger[_0x29e4('0x11')](_0x29e4('0xc'),_0x51dcc3,_0x3e2403);_0x694d3d(_0x3e2403);});});}exports[_0x29e4('0x14')]=function(_0x380189){var _0x2ae369=this;return new Promise(function(_0x425c8d,_0x312efd){return db['Template'][_0x29e4('0x15')]({'raw':_0x380189[_0x29e4('0x16')]?_0x380189['options'][_0x29e4('0x17')]===undefined?!![]:![]:!![],'where':_0x380189['options']?_0x380189[_0x29e4('0x16')][_0x29e4('0x18')]||null:null,'attributes':_0x380189['options']?_0x380189[_0x29e4('0x16')][_0x29e4('0x19')]||null:null,'limit':_0x380189[_0x29e4('0x16')]?_0x380189[_0x29e4('0x16')][_0x29e4('0x1a')]||null:null,'include':_0x380189['options']?_0x380189[_0x29e4('0x16')][_0x29e4('0x1b')]?_[_0x29e4('0x1c')](_0x380189[_0x29e4('0x16')][_0x29e4('0x1b')],function(_0x3b1636){return{'model':db[_0x3b1636[_0x29e4('0x1d')]],'as':_0x3b1636['as'],'attributes':_0x3b1636[_0x29e4('0x19')],'include':_0x3b1636['include']?_[_0x29e4('0x1c')](_0x3b1636['include'],function(_0xbe593d){return{'model':db[_0xbe593d[_0x29e4('0x1d')]],'as':_0xbe593d['as'],'attributes':_0xbe593d[_0x29e4('0x19')],'include':_0xbe593d['include']?_[_0x29e4('0x1c')](_0xbe593d['include'],function(_0x1775f4){return{'model':db[_0x1775f4[_0x29e4('0x1d')]],'as':_0x1775f4['as'],'attributes':_0x1775f4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dea64){logger[_0x29e4('0xb')](_0x29e4('0x14'),_0x380189);logger['debug'](_0x29e4('0x14'),_0x380189,JSON['stringify'](_0x2dea64));_0x425c8d(_0x2dea64);})[_0x29e4('0x1e')](function(_0x31bd9f){logger[_0x29e4('0x11')](_0x29e4('0x14'),_0x31bd9f[_0x29e4('0x13')],_0x380189);_0x312efd(_0x2ae369['error'](0x1f4,_0x31bd9f[_0x29e4('0x13')]));});});}; \ No newline at end of file +var _0x5d1d=['http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Template','options','raw','limit','include','map','attributes','model','GetTemplate','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x29352e,_0x2df02e){var _0x333208=function(_0x252ed4){while(--_0x252ed4){_0x29352e['push'](_0x29352e['shift']());}};_0x333208(++_0x2df02e);}(_0x5d1d,0xf0));var _0xd5d1=function(_0x327cc1,_0xd33f7c){_0x327cc1=_0x327cc1-0x0;var _0x1144dc=_0x5d1d[_0x327cc1];return _0x1144dc;};'use strict';var _=require('lodash');var util=require(_0xd5d1('0x0'));var moment=require(_0xd5d1('0x1'));var BPromise=require(_0xd5d1('0x2'));var rs=require(_0xd5d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd5d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd5d1('0x5'))(_0xd5d1('0x6'));var config=require(_0xd5d1('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd5d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x28eb7c,_0x350fe3,_0x2f5d62){return new BPromise(function(_0x5021d5,_0xf22acc){return client[_0xd5d1('0x9')](_0x28eb7c,_0x2f5d62)[_0xd5d1('0xa')](function(_0x4340a1){logger[_0xd5d1('0xb')](_0xd5d1('0xc'),_0x350fe3,_0xd5d1('0xd'));logger[_0xd5d1('0xe')](_0xd5d1('0xf'),_0x350fe3,'request\x20sent',JSON[_0xd5d1('0x10')](_0x4340a1));if(_0x4340a1[_0xd5d1('0x11')]){if(_0x4340a1['error'][_0xd5d1('0x12')]===0x1f4){logger[_0xd5d1('0x11')](_0xd5d1('0xc'),_0x350fe3,_0x4340a1[_0xd5d1('0x11')][_0xd5d1('0x13')]);return _0xf22acc(_0x4340a1[_0xd5d1('0x11')][_0xd5d1('0x13')]);}logger[_0xd5d1('0x11')](_0xd5d1('0xc'),_0x350fe3,_0x4340a1[_0xd5d1('0x11')][_0xd5d1('0x13')]);return _0x5021d5(_0x4340a1[_0xd5d1('0x11')][_0xd5d1('0x13')]);}else{logger['info']('Template,\x20%s,\x20%s',_0x350fe3,_0xd5d1('0xd'));_0x5021d5(_0x4340a1[_0xd5d1('0x14')][_0xd5d1('0x13')]);}})[_0xd5d1('0x15')](function(_0x24e7e8){logger[_0xd5d1('0x11')](_0xd5d1('0xc'),_0x350fe3,_0x24e7e8);_0xf22acc(_0x24e7e8);});});}exports['GetTemplate']=function(_0x20d5b5){var _0x108e62=this;return new Promise(function(_0x14c850,_0x39efd8){return db[_0xd5d1('0x16')]['findAll']({'raw':_0x20d5b5[_0xd5d1('0x17')]?_0x20d5b5[_0xd5d1('0x17')][_0xd5d1('0x18')]===undefined?!![]:![]:!![],'where':_0x20d5b5[_0xd5d1('0x17')]?_0x20d5b5[_0xd5d1('0x17')]['where']||null:null,'attributes':_0x20d5b5['options']?_0x20d5b5[_0xd5d1('0x17')]['attributes']||null:null,'limit':_0x20d5b5[_0xd5d1('0x17')]?_0x20d5b5[_0xd5d1('0x17')][_0xd5d1('0x19')]||null:null,'include':_0x20d5b5[_0xd5d1('0x17')]?_0x20d5b5[_0xd5d1('0x17')][_0xd5d1('0x1a')]?_[_0xd5d1('0x1b')](_0x20d5b5['options']['include'],function(_0x530a27){return{'model':db[_0x530a27['model']],'as':_0x530a27['as'],'attributes':_0x530a27[_0xd5d1('0x1c')],'include':_0x530a27['include']?_[_0xd5d1('0x1b')](_0x530a27[_0xd5d1('0x1a')],function(_0x59b44e){return{'model':db[_0x59b44e[_0xd5d1('0x1d')]],'as':_0x59b44e['as'],'attributes':_0x59b44e['attributes'],'include':_0x59b44e[_0xd5d1('0x1a')]?_[_0xd5d1('0x1b')](_0x59b44e[_0xd5d1('0x1a')],function(_0x52198d){return{'model':db[_0x52198d['model']],'as':_0x52198d['as'],'attributes':_0x52198d[_0xd5d1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d37cc){logger[_0xd5d1('0xb')](_0xd5d1('0x1e'),_0x20d5b5);logger[_0xd5d1('0xe')]('GetTemplate',_0x20d5b5,JSON[_0xd5d1('0x10')](_0x1d37cc));_0x14c850(_0x1d37cc);})[_0xd5d1('0x15')](function(_0x23bffd){logger['error']('GetTemplate',_0x23bffd[_0xd5d1('0x13')],_0x20d5b5);_0x39efd8(_0x108e62[_0xd5d1('0x11')](0x1f4,_0x23bffd['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index f9f5270..d4d2c57 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 _0x17cb=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','post','create','addAllCondition','addAnyCondition','/:id/actions','addAction'];(function(_0x3e2ee4,_0x201d6e){var _0x5f2d4d=function(_0x538f0d){while(--_0x538f0d){_0x3e2ee4['push'](_0x3e2ee4['shift']());}};_0x5f2d4d(++_0x201d6e);}(_0x17cb,0x1c4));var _0xb17c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x17cb[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xb17c('0x0'));var util=require(_0xb17c('0x1'));var path=require(_0xb17c('0x2'));var timeout=require(_0xb17c('0x3'));var express=require(_0xb17c('0x4'));var router=express[_0xb17c('0x5')]();var auth=require(_0xb17c('0x6'));var interaction=require(_0xb17c('0x7'));var config=require(_0xb17c('0x8'));var controller=require(_0xb17c('0x9'));router[_0xb17c('0xa')]('/',auth[_0xb17c('0xb')](),controller['index']);router[_0xb17c('0xa')](_0xb17c('0xc'),auth[_0xb17c('0xb')](),controller[_0xb17c('0xd')]);router[_0xb17c('0xa')](_0xb17c('0xe'),auth[_0xb17c('0xb')](),controller[_0xb17c('0xf')]);router[_0xb17c('0xa')](_0xb17c('0x10'),auth[_0xb17c('0xb')](),controller[_0xb17c('0x11')]);router[_0xb17c('0xa')]('/:id/actions',auth[_0xb17c('0xb')](),controller['getActions']);router[_0xb17c('0x12')]('/',auth[_0xb17c('0xb')](),controller[_0xb17c('0x13')]);router['post'](_0xb17c('0xe'),auth[_0xb17c('0xb')](),controller[_0xb17c('0x14')]);router['post']('/:id/any_conditions',auth['isAuthenticated'](),controller[_0xb17c('0x15')]);router[_0xb17c('0x12')](_0xb17c('0x16'),auth[_0xb17c('0xb')](),controller[_0xb17c('0x17')]);router[_0xb17c('0x18')](_0xb17c('0xc'),auth[_0xb17c('0xb')](),controller[_0xb17c('0x19')]);router['delete'](_0xb17c('0xc'),auth[_0xb17c('0xb')](),controller[_0xb17c('0x1a')]);module[_0xb17c('0x1b')]=router; \ No newline at end of file +var _0x2f40=['/:id/actions','getActions','post','addAnyCondition','update','delete','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','/:id/all_conditions','isAuthenticated','getAllConditions','/:id/any_conditions','getAnyConditions'];(function(_0xd1f854,_0x532346){var _0x548294=function(_0x4be823){while(--_0x4be823){_0xd1f854['push'](_0xd1f854['shift']());}};_0x548294(++_0x532346);}(_0x2f40,0xf9));var _0x02f4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x2f40[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require('multer');var util=require(_0x02f4('0x0'));var path=require('path');var timeout=require(_0x02f4('0x1'));var express=require(_0x02f4('0x2'));var router=express[_0x02f4('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x02f4('0x4'));var config=require(_0x02f4('0x5'));var controller=require(_0x02f4('0x6'));router[_0x02f4('0x7')]('/',auth['isAuthenticated'](),controller[_0x02f4('0x8')]);router['get'](_0x02f4('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x02f4('0x7')](_0x02f4('0xa'),auth[_0x02f4('0xb')](),controller[_0x02f4('0xc')]);router['get'](_0x02f4('0xd'),auth[_0x02f4('0xb')](),controller[_0x02f4('0xe')]);router[_0x02f4('0x7')](_0x02f4('0xf'),auth[_0x02f4('0xb')](),controller[_0x02f4('0x10')]);router[_0x02f4('0x11')]('/',auth[_0x02f4('0xb')](),controller['create']);router[_0x02f4('0x11')](_0x02f4('0xa'),auth[_0x02f4('0xb')](),controller['addAllCondition']);router[_0x02f4('0x11')](_0x02f4('0xd'),auth['isAuthenticated'](),controller[_0x02f4('0x12')]);router['post'](_0x02f4('0xf'),auth[_0x02f4('0xb')](),controller['addAction']);router['put'](_0x02f4('0x9'),auth[_0x02f4('0xb')](),controller[_0x02f4('0x13')]);router[_0x02f4('0x14')]('/:id',auth[_0x02f4('0xb')](),controller['destroy']);module[_0x02f4('0x15')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 1222a7d..7209510 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 _0x366b=['STRING','BOOLEAN','sequelize'];(function(_0x292046,_0x16ecc2){var _0x57dd25=function(_0x5cec28){while(--_0x5cec28){_0x292046['push'](_0x292046['shift']());}};_0x57dd25(++_0x16ecc2);}(_0x366b,0x6b));var _0xb366=function(_0x4143ce,_0x1d0ef8){_0x4143ce=_0x4143ce-0x0;var _0x43d305=_0x366b[_0x4143ce];return _0x43d305;};'use strict';var Sequelize=require(_0xb366('0x0'));module['exports']={'name':{'type':Sequelize[_0xb366('0x1')]},'channel':{'type':Sequelize[_0xb366('0x1')]},'description':{'type':Sequelize[_0xb366('0x1')]},'status':{'type':Sequelize[_0xb366('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xeed4=['sequelize','exports','STRING'];(function(_0x2abffd,_0x760487){var _0xe147d4=function(_0x39fa89){while(--_0x39fa89){_0x2abffd['push'](_0x2abffd['shift']());}};_0xe147d4(++_0x760487);}(_0xeed4,0x1a4));var _0x4eed=function(_0x1b95a1,_0x529852){_0x1b95a1=_0x1b95a1-0x0;var _0x57aef1=_0xeed4[_0x1b95a1];return _0x57aef1;};'use strict';var Sequelize=require(_0x4eed('0x0'));module[_0x4eed('0x1')]={'name':{'type':Sequelize[_0x4eed('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'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 5951d0f..76aba18 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 _0xcaf2=['name','send','index','Trigger','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','count','includeAll','findAll','rows','catch','params','include','find','create','body','user','Triggers','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Condition','addAnyCondition','pick','getAllConditions','getAnyConditions','TriggerId','getActions','findOne','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','stack'];(function(_0x1337a2,_0x15022f){var _0x37622a=function(_0x387fef){while(--_0x387fef){_0x1337a2['push'](_0x1337a2['shift']());}};_0x37622a(++_0x15022f);}(_0xcaf2,0x8a));var _0x2caf=function(_0x340aa5,_0x2d5553){_0x340aa5=_0x340aa5-0x0;var _0x3a5b7f=_0xcaf2[_0x340aa5];return _0x3a5b7f;};'use strict';var pdf=require(_0x2caf('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2caf('0x1'));var zipdir=require(_0x2caf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2caf('0x3'));var moment=require(_0x2caf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2caf('0x5'));var util=require('util');var path=require(_0x2caf('0x6'));var sox=require(_0x2caf('0x7'));var csv=require(_0x2caf('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2caf('0x9'));var squel=require(_0x2caf('0xa'));var crypto=require(_0x2caf('0xb'));var jsforce=require(_0x2caf('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2caf('0x8'));var querystring=require(_0x2caf('0xd'));var Papa=require(_0x2caf('0xe'));var Redis=require(_0x2caf('0xf'));var authService=require(_0x2caf('0x10'));var qs=require(_0x2caf('0x11'));var hardwareService=require(_0x2caf('0x12'));var logger=require(_0x2caf('0x13'))(_0x2caf('0x14'));var utils=require('../../config/utils');var config=require(_0x2caf('0x15'));var db=require(_0x2caf('0x16'))['db'];function respondWithStatusCode(_0x237c3d,_0x414f6b){_0x414f6b=_0x414f6b||0xcc;return function(_0x1dda08){if(_0x1dda08){return _0x237c3d[_0x2caf('0x17')](_0x414f6b);}return _0x237c3d[_0x2caf('0x18')](_0x414f6b)[_0x2caf('0x19')]();};}function respondWithResult(_0x5106fd,_0x7258b1){_0x7258b1=_0x7258b1||0xc8;return function(_0xec8192){if(_0xec8192){return _0x5106fd['status'](_0x7258b1)['json'](_0xec8192);}};}function respondWithFilteredResult(_0x5f1e93,_0x27bca8){return function(_0x4da5ba){if(_0x4da5ba){var _0x388e05=_0x4da5ba['count'],_0xa75896=_0x27bca8[_0x2caf('0x1a')],_0x3b8b67=_0x27bca8['offset']+_0x27bca8[_0x2caf('0x1b')],_0x32ff41;if(_0x3b8b67>=_0x388e05){_0x3b8b67=_0x388e05;_0x32ff41=0xc8;}else{_0x32ff41=0xce;}_0x5f1e93['status'](_0x32ff41);return _0x5f1e93['set'](_0x2caf('0x1c'),_0xa75896+'-'+_0x3b8b67+'/'+_0x388e05)['json'](_0x4da5ba);}return null;};}function patchUpdates(_0xe72440){return function(_0x9c7302){try{jsonpatch['apply'](_0x9c7302,_0xe72440,!![]);}catch(_0x12624b){return BPromise[_0x2caf('0x1d')](_0x12624b);}return _0x9c7302[_0x2caf('0x1e')]();};}function saveUpdates(_0x255c08,_0x20f7d3){return function(_0x595f2f){if(_0x595f2f){return _0x595f2f[_0x2caf('0x1f')](_0x255c08)[_0x2caf('0x20')](function(_0x2b4d16){return _0x2b4d16;});}return null;};}function removeEntity(_0x358445,_0x424d42){return function(_0x9d6bae){if(_0x9d6bae){return _0x9d6bae[_0x2caf('0x21')]()[_0x2caf('0x20')](function(){var _0x3332b1=_0x9d6bae[_0x2caf('0x22')]({'plain':!![]});var _0x6814bc='Triggers';return db[_0x2caf('0x23')][_0x2caf('0x21')]({'where':{'type':_0x6814bc,'resourceId':_0x3332b1['id']}})[_0x2caf('0x20')](function(){return _0x9d6bae;});})[_0x2caf('0x20')](function(){_0x358445[_0x2caf('0x18')](0xcc)[_0x2caf('0x19')]();});}};}function handleEntityNotFound(_0x392196,_0x164da){return function(_0x2e0a75){if(!_0x2e0a75){_0x392196[_0x2caf('0x17')](0x194);}return _0x2e0a75;};}function handleError(_0x5ad211,_0x6a32ac){_0x6a32ac=_0x6a32ac||0x1f4;return function(_0x325eda){logger[_0x2caf('0x24')](_0x325eda[_0x2caf('0x25')]);if(_0x325eda[_0x2caf('0x26')]){delete _0x325eda[_0x2caf('0x26')];}_0x5ad211[_0x2caf('0x18')](_0x6a32ac)[_0x2caf('0x27')](_0x325eda);};}exports[_0x2caf('0x28')]=function(_0x2304f1,_0x30da75){var _0x1f477={},_0x158d60={},_0x48b5f7={'count':0x0,'rows':[]};var _0xb944cc=db[_0x2caf('0x29')][_0x2caf('0x2a')];_0x158d60[_0x2caf('0x2b')]=_[_0x2caf('0x2c')](_0xb944cc);_0x158d60[_0x2caf('0x2d')]=_[_0x2caf('0x2c')](_0x2304f1['query']);_0x158d60[_0x2caf('0x2e')]=_[_0x2caf('0x2f')](_0x158d60['model'],_0x158d60[_0x2caf('0x2d')]);_0x1f477[_0x2caf('0x30')]=_[_0x2caf('0x2f')](_0x158d60['model'],qs[_0x2caf('0x31')](_0x2304f1['query']['fields']));_0x1f477[_0x2caf('0x30')]=_0x1f477[_0x2caf('0x30')][_0x2caf('0x32')]?_0x1f477[_0x2caf('0x30')]:_0x158d60[_0x2caf('0x2b')];if(!_0x2304f1[_0x2caf('0x2d')][_0x2caf('0x33')](_0x2caf('0x34'))){_0x1f477[_0x2caf('0x1b')]=qs['limit'](_0x2304f1[_0x2caf('0x2d')][_0x2caf('0x1b')]);_0x1f477[_0x2caf('0x1a')]=qs[_0x2caf('0x1a')](_0x2304f1[_0x2caf('0x2d')][_0x2caf('0x1a')]);}_0x1f477[_0x2caf('0x35')]=qs[_0x2caf('0x36')](_0x2304f1[_0x2caf('0x2d')][_0x2caf('0x36')]);_0x1f477[_0x2caf('0x37')]=qs[_0x2caf('0x2e')](_['pick'](_0x2304f1['query'],_0x158d60[_0x2caf('0x2e')]));if(_0x2304f1[_0x2caf('0x2d')][_0x2caf('0x38')]){_0x1f477[_0x2caf('0x37')]=_['merge'](_0x1f477[_0x2caf('0x37')],{'$or':_[_0x2caf('0x39')](_0xb944cc,function(_0x4568f9){if(_0x4568f9[_0x2caf('0x3a')][_0x2caf('0x3b')]!==_0x2caf('0x3c')){var _0x2ac0b2={};_0x2ac0b2[_0x4568f9[_0x2caf('0x3d')]]={'$like':'%'+_0x2304f1['query']['filter']+'%'};return _0x2ac0b2;}})});}_0x1f477=_[_0x2caf('0x3e')]({},_0x1f477,_0x2304f1[_0x2caf('0x3f')]);var _0x177254={'where':_0x1f477[_0x2caf('0x37')]};return db[_0x2caf('0x29')][_0x2caf('0x40')](_0x177254)[_0x2caf('0x20')](function(_0xf93228){_0x48b5f7[_0x2caf('0x40')]=_0xf93228;if(_0x2304f1[_0x2caf('0x2d')][_0x2caf('0x41')]){_0x1f477['include']=[{'all':!![]}];}return db[_0x2caf('0x29')][_0x2caf('0x42')](_0x1f477);})[_0x2caf('0x20')](function(_0x53c836){_0x48b5f7[_0x2caf('0x43')]=_0x53c836;return _0x48b5f7;})[_0x2caf('0x20')](respondWithFilteredResult(_0x30da75,_0x1f477))[_0x2caf('0x44')](handleError(_0x30da75,null));};exports['show']=function(_0x40cb18,_0xdb89bb){var _0x595651={'raw':![],'where':{'id':_0x40cb18[_0x2caf('0x45')]['id']}},_0x38ae68={};_0x38ae68['model']=_[_0x2caf('0x2c')](db[_0x2caf('0x29')][_0x2caf('0x2a')]);_0x38ae68[_0x2caf('0x2d')]=_[_0x2caf('0x2c')](_0x40cb18[_0x2caf('0x2d')]);_0x38ae68[_0x2caf('0x2e')]=_[_0x2caf('0x2f')](_0x38ae68['model'],_0x38ae68[_0x2caf('0x2d')]);_0x595651['attributes']=_[_0x2caf('0x2f')](_0x38ae68[_0x2caf('0x2b')],qs[_0x2caf('0x31')](_0x40cb18['query']['fields']));_0x595651[_0x2caf('0x30')]=_0x595651['attributes'][_0x2caf('0x32')]?_0x595651[_0x2caf('0x30')]:_0x38ae68[_0x2caf('0x2b')];if(_0x40cb18[_0x2caf('0x2d')][_0x2caf('0x41')]){_0x595651[_0x2caf('0x46')]=[{'all':!![]}];}_0x595651=_[_0x2caf('0x3e')]({},_0x595651,_0x40cb18[_0x2caf('0x3f')]);return db[_0x2caf('0x29')][_0x2caf('0x47')](_0x595651)[_0x2caf('0x20')](handleEntityNotFound(_0xdb89bb,null))[_0x2caf('0x20')](respondWithResult(_0xdb89bb,null))[_0x2caf('0x44')](handleError(_0xdb89bb,null));};exports[_0x2caf('0x48')]=function(_0x14950b,_0x25cd5f){return db[_0x2caf('0x29')][_0x2caf('0x48')](_0x14950b[_0x2caf('0x49')],{})[_0x2caf('0x20')](function(_0x136dc9){var _0x5e56d9=_0x14950b[_0x2caf('0x4a')][_0x2caf('0x22')]({'plain':!![]});if(!_0x5e56d9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e56d9['role']===_0x2caf('0x4a')){var _0x6f0a2a=_0x136dc9['get']({'plain':!![]});var _0x35f96b=_0x2caf('0x4b');return db[_0x2caf('0x4c')][_0x2caf('0x47')]({'where':{'name':_0x35f96b,'userProfileId':_0x5e56d9[_0x2caf('0x4d')]},'raw':!![]})[_0x2caf('0x20')](function(_0x3c5c7b){if(_0x3c5c7b&&_0x3c5c7b[_0x2caf('0x4e')]===0x0){return db[_0x2caf('0x23')][_0x2caf('0x48')]({'name':_0x6f0a2a[_0x2caf('0x26')],'resourceId':_0x6f0a2a['id'],'type':_0x3c5c7b[_0x2caf('0x26')],'sectionId':_0x3c5c7b['id']},{})[_0x2caf('0x20')](function(){return _0x136dc9;});}else{return _0x136dc9;}})['catch'](function(_0x27e6d1){logger[_0x2caf('0x24')](_0x2caf('0x4f'),_0x27e6d1);throw _0x27e6d1;});}return _0x136dc9;})['then'](respondWithResult(_0x25cd5f,0xc9))[_0x2caf('0x44')](handleError(_0x25cd5f,null));};exports[_0x2caf('0x1f')]=function(_0x28d8bd,_0x20bf52){if(_0x28d8bd[_0x2caf('0x49')]['id']){delete _0x28d8bd[_0x2caf('0x49')]['id'];}return db[_0x2caf('0x29')][_0x2caf('0x47')]({'where':{'id':_0x28d8bd[_0x2caf('0x45')]['id']}})[_0x2caf('0x20')](handleEntityNotFound(_0x20bf52,null))['then'](saveUpdates(_0x28d8bd[_0x2caf('0x49')],null))[_0x2caf('0x20')](respondWithResult(_0x20bf52,null))[_0x2caf('0x44')](handleError(_0x20bf52,null));};exports['destroy']=function(_0x2055b6,_0x4110ee){return db[_0x2caf('0x29')]['find']({'where':{'id':_0x2055b6[_0x2caf('0x45')]['id']}})[_0x2caf('0x20')](handleEntityNotFound(_0x4110ee,null))[_0x2caf('0x20')](removeEntity(_0x4110ee,null))[_0x2caf('0x44')](handleError(_0x4110ee,null));};exports['addAllCondition']=function(_0x1ffb4a,_0x7e9d86,_0x3822a6){if(_0x1ffb4a['body']['id']){delete _0x1ffb4a[_0x2caf('0x49')]['id'];}return db[_0x2caf('0x29')]['find']({'where':{'id':_0x1ffb4a[_0x2caf('0x45')]['id']}})[_0x2caf('0x20')](handleEntityNotFound(_0x7e9d86,null))[_0x2caf('0x20')](function(_0x593593){if(_0x593593){_0x1ffb4a[_0x2caf('0x49')]['TriggerAllId']=_0x593593['id'];return db[_0x2caf('0x50')][_0x2caf('0x48')](_0x1ffb4a['body']);}})['then'](respondWithResult(_0x7e9d86,null))[_0x2caf('0x44')](handleError(_0x7e9d86,null));};exports[_0x2caf('0x51')]=function(_0x13287e,_0x446be6,_0xb3d0c){if(_0x13287e['body']['id']){delete _0x13287e[_0x2caf('0x49')]['id'];}return db[_0x2caf('0x29')]['find']({'where':{'id':_0x13287e[_0x2caf('0x45')]['id']}})[_0x2caf('0x20')](handleEntityNotFound(_0x446be6,null))['then'](function(_0x5efa97){if(_0x5efa97){_0x13287e[_0x2caf('0x49')]['TriggerAnyId']=_0x5efa97['id'];return db[_0x2caf('0x50')][_0x2caf('0x48')](_0x13287e[_0x2caf('0x49')]);}})[_0x2caf('0x20')](respondWithResult(_0x446be6,null))[_0x2caf('0x44')](handleError(_0x446be6,null));};exports['getAllConditions']=function(_0x6f6fe7,_0x575714,_0x21a167){var _0x4eb8f2={};var _0x4241cd={};var _0x48910d;var _0x571852;return db[_0x2caf('0x29')]['findOne']({'where':{'id':_0x6f6fe7[_0x2caf('0x45')]['id']}})['then'](handleEntityNotFound(_0x575714,null))['then'](function(_0x44ad75){if(_0x44ad75){_0x48910d=_0x44ad75;_0x4241cd[_0x2caf('0x2b')]=_[_0x2caf('0x2c')](db[_0x2caf('0x50')][_0x2caf('0x2a')]);_0x4241cd['query']=_[_0x2caf('0x2c')](_0x6f6fe7[_0x2caf('0x2d')]);_0x4241cd['filters']=_[_0x2caf('0x2f')](_0x4241cd['model'],_0x4241cd[_0x2caf('0x2d')]);_0x4eb8f2[_0x2caf('0x30')]=_[_0x2caf('0x2f')](_0x4241cd[_0x2caf('0x2b')],qs[_0x2caf('0x31')](_0x6f6fe7['query']['fields']));_0x4eb8f2[_0x2caf('0x30')]=_0x4eb8f2[_0x2caf('0x30')][_0x2caf('0x32')]?_0x4eb8f2[_0x2caf('0x30')]:_0x4241cd[_0x2caf('0x2b')];_0x4eb8f2[_0x2caf('0x35')]=qs[_0x2caf('0x36')](_0x6f6fe7['query'][_0x2caf('0x36')]);_0x4eb8f2[_0x2caf('0x37')]=qs[_0x2caf('0x2e')](_[_0x2caf('0x52')](_0x6f6fe7[_0x2caf('0x2d')],_0x4241cd['filters']));if(_0x6f6fe7[_0x2caf('0x2d')]['filter']){_0x4eb8f2[_0x2caf('0x37')]=_[_0x2caf('0x3e')](_0x4eb8f2[_0x2caf('0x37')],{'$or':_[_0x2caf('0x39')](_0x4eb8f2[_0x2caf('0x30')],function(_0x4ebedc){var _0x70bcec={};_0x70bcec[_0x4ebedc]={'$like':'%'+_0x6f6fe7['query'][_0x2caf('0x38')]+'%'};return _0x70bcec;})});}_0x4eb8f2=_[_0x2caf('0x3e')]({},_0x4eb8f2,_0x6f6fe7['options']);return _0x48910d[_0x2caf('0x53')](_0x4eb8f2);}})[_0x2caf('0x20')](function(_0x131b1c){if(_0x131b1c){_0x571852=_0x131b1c[_0x2caf('0x32')];if(!_0x6f6fe7[_0x2caf('0x2d')][_0x2caf('0x33')]('nolimit')){_0x4eb8f2[_0x2caf('0x1b')]=qs['limit'](_0x6f6fe7[_0x2caf('0x2d')]['limit']);_0x4eb8f2[_0x2caf('0x1a')]=qs[_0x2caf('0x1a')](_0x6f6fe7[_0x2caf('0x2d')]['offset']);}return _0x48910d[_0x2caf('0x53')](_0x4eb8f2);}})[_0x2caf('0x20')](function(_0x238bf1){if(_0x238bf1){return _0x238bf1?{'count':_0x571852,'rows':_0x238bf1}:null;}})[_0x2caf('0x20')](respondWithResult(_0x575714,null))[_0x2caf('0x44')](handleError(_0x575714,null));};exports['getAnyConditions']=function(_0x366c5d,_0x16b044,_0x6ac497){var _0x20177f={};var _0x38fca5={};var _0x2bd882;var _0x5ae8de;return db[_0x2caf('0x29')]['findOne']({'where':{'id':_0x366c5d[_0x2caf('0x45')]['id']}})[_0x2caf('0x20')](handleEntityNotFound(_0x16b044,null))[_0x2caf('0x20')](function(_0x2d81e1){if(_0x2d81e1){_0x2bd882=_0x2d81e1;_0x38fca5[_0x2caf('0x2b')]=_[_0x2caf('0x2c')](db[_0x2caf('0x50')][_0x2caf('0x2a')]);_0x38fca5['query']=_[_0x2caf('0x2c')](_0x366c5d[_0x2caf('0x2d')]);_0x38fca5[_0x2caf('0x2e')]=_['intersection'](_0x38fca5[_0x2caf('0x2b')],_0x38fca5[_0x2caf('0x2d')]);_0x20177f[_0x2caf('0x30')]=_['intersection'](_0x38fca5[_0x2caf('0x2b')],qs[_0x2caf('0x31')](_0x366c5d[_0x2caf('0x2d')][_0x2caf('0x31')]));_0x20177f['attributes']=_0x20177f['attributes'][_0x2caf('0x32')]?_0x20177f[_0x2caf('0x30')]:_0x38fca5[_0x2caf('0x2b')];_0x20177f[_0x2caf('0x35')]=qs[_0x2caf('0x36')](_0x366c5d[_0x2caf('0x2d')][_0x2caf('0x36')]);_0x20177f[_0x2caf('0x37')]=qs[_0x2caf('0x2e')](_[_0x2caf('0x52')](_0x366c5d[_0x2caf('0x2d')],_0x38fca5[_0x2caf('0x2e')]));if(_0x366c5d[_0x2caf('0x2d')][_0x2caf('0x38')]){_0x20177f['where']=_[_0x2caf('0x3e')](_0x20177f[_0x2caf('0x37')],{'$or':_['map'](_0x20177f[_0x2caf('0x30')],function(_0x265068){var _0x34dc9c={};_0x34dc9c[_0x265068]={'$like':'%'+_0x366c5d['query']['filter']+'%'};return _0x34dc9c;})});}_0x20177f=_['merge']({},_0x20177f,_0x366c5d[_0x2caf('0x3f')]);return _0x2bd882[_0x2caf('0x54')](_0x20177f);}})[_0x2caf('0x20')](function(_0x5e0e3c){if(_0x5e0e3c){_0x5ae8de=_0x5e0e3c[_0x2caf('0x32')];if(!_0x366c5d[_0x2caf('0x2d')][_0x2caf('0x33')]('nolimit')){_0x20177f[_0x2caf('0x1b')]=qs[_0x2caf('0x1b')](_0x366c5d['query'][_0x2caf('0x1b')]);_0x20177f[_0x2caf('0x1a')]=qs[_0x2caf('0x1a')](_0x366c5d['query'][_0x2caf('0x1a')]);}return _0x2bd882[_0x2caf('0x54')](_0x20177f);}})[_0x2caf('0x20')](function(_0x414fe1){if(_0x414fe1){return _0x414fe1?{'count':_0x5ae8de,'rows':_0x414fe1}:null;}})[_0x2caf('0x20')](respondWithResult(_0x16b044,null))[_0x2caf('0x44')](handleError(_0x16b044,null));};exports['addAction']=function(_0x567541,_0x2137b7,_0x9fc00f){if(_0x567541[_0x2caf('0x49')]['id']){delete _0x567541[_0x2caf('0x49')]['id'];}return db[_0x2caf('0x29')][_0x2caf('0x47')]({'where':{'id':_0x567541[_0x2caf('0x45')]['id']}})[_0x2caf('0x20')](handleEntityNotFound(_0x2137b7,null))[_0x2caf('0x20')](function(_0x3c7ae6){if(_0x3c7ae6){_0x567541[_0x2caf('0x49')][_0x2caf('0x55')]=_0x3c7ae6['id'];return db['Action'][_0x2caf('0x48')](_0x567541[_0x2caf('0x49')]);}})[_0x2caf('0x20')](respondWithResult(_0x2137b7,null))['catch'](handleError(_0x2137b7,null));};exports[_0x2caf('0x56')]=function(_0x5cc902,_0x5b7455,_0x597157){var _0x2cc9fc={};var _0x509ff1={};var _0xc9ee15;var _0x2069f0;return db['Trigger'][_0x2caf('0x57')]({'where':{'id':_0x5cc902[_0x2caf('0x45')]['id']}})['then'](handleEntityNotFound(_0x5b7455,null))[_0x2caf('0x20')](function(_0x22cd27){if(_0x22cd27){_0xc9ee15=_0x22cd27;_0x509ff1[_0x2caf('0x2b')]=_[_0x2caf('0x2c')](db['Action']['rawAttributes']);_0x509ff1[_0x2caf('0x2d')]=_['keys'](_0x5cc902[_0x2caf('0x2d')]);_0x509ff1['filters']=_[_0x2caf('0x2f')](_0x509ff1['model'],_0x509ff1['query']);_0x2cc9fc[_0x2caf('0x30')]=_['intersection'](_0x509ff1['model'],qs[_0x2caf('0x31')](_0x5cc902[_0x2caf('0x2d')][_0x2caf('0x31')]));_0x2cc9fc[_0x2caf('0x30')]=_0x2cc9fc[_0x2caf('0x30')]['length']?_0x2cc9fc[_0x2caf('0x30')]:_0x509ff1['model'];_0x2cc9fc['order']=qs[_0x2caf('0x36')](_0x5cc902['query']['sort']);_0x2cc9fc[_0x2caf('0x37')]=qs[_0x2caf('0x2e')](_[_0x2caf('0x52')](_0x5cc902['query'],_0x509ff1[_0x2caf('0x2e')]));if(_0x5cc902[_0x2caf('0x2d')]['filter']){_0x2cc9fc[_0x2caf('0x37')]=_[_0x2caf('0x3e')](_0x2cc9fc[_0x2caf('0x37')],{'$or':_[_0x2caf('0x39')](_0x2cc9fc[_0x2caf('0x30')],function(_0x88978d){var _0x5c47a2={};_0x5c47a2[_0x88978d]={'$like':'%'+_0x5cc902['query'][_0x2caf('0x38')]+'%'};return _0x5c47a2;})});}_0x2cc9fc=_['merge']({},_0x2cc9fc,_0x5cc902[_0x2caf('0x3f')]);return _0xc9ee15['getActions'](_0x2cc9fc);}})['then'](function(_0x598610){if(_0x598610){_0x2069f0=_0x598610['length'];if(!_0x5cc902[_0x2caf('0x2d')][_0x2caf('0x33')](_0x2caf('0x34'))){_0x2cc9fc[_0x2caf('0x1b')]=qs[_0x2caf('0x1b')](_0x5cc902[_0x2caf('0x2d')][_0x2caf('0x1b')]);_0x2cc9fc[_0x2caf('0x1a')]=qs[_0x2caf('0x1a')](_0x5cc902['query'][_0x2caf('0x1a')]);}return _0xc9ee15[_0x2caf('0x56')](_0x2cc9fc);}})['then'](function(_0x49b03e){if(_0x49b03e){return _0x49b03e?{'count':_0x2069f0,'rows':_0x49b03e}:null;}})[_0x2caf('0x20')](respondWithResult(_0x5b7455,null))[_0x2caf('0x44')](handleError(_0x5b7455,null));}; \ No newline at end of file +var _0xff1d=['key','field','count','includeAll','include','findAll','catch','show','params','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','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','map','options','nolimit','getAnyConditions','order','addAction','findOne','Action','getActions','eml-format','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','set','json','save','update','then','destroy','get','Triggers','UserProfileResource','end','error','stack','name','index','Trigger','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge'];(function(_0x57fa33,_0x2b8222){var _0x12e724=function(_0x481a33){while(--_0x481a33){_0x57fa33['push'](_0x57fa33['shift']());}};_0x12e724(++_0x2b8222);}(_0xff1d,0x192));var _0xdff1=function(_0x6c39d7,_0x52bda7){_0x6c39d7=_0x6c39d7-0x0;var _0x8501=_0xff1d[_0x6c39d7];return _0x8501;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdff1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdff1('0x1'));var jsonpatch=require(_0xdff1('0x2'));var rp=require(_0xdff1('0x3'));var moment=require(_0xdff1('0x4'));var BPromise=require(_0xdff1('0x5'));var Mustache=require(_0xdff1('0x6'));var util=require(_0xdff1('0x7'));var path=require(_0xdff1('0x8'));var sox=require('sox');var csv=require(_0xdff1('0x9'));var ejs=require(_0xdff1('0xa'));var fs=require('fs');var _=require(_0xdff1('0xb'));var squel=require('squel');var crypto=require(_0xdff1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdff1('0x9'));var querystring=require(_0xdff1('0xd'));var Papa=require(_0xdff1('0xe'));var Redis=require(_0xdff1('0xf'));var authService=require(_0xdff1('0x10'));var qs=require(_0xdff1('0x11'));var hardwareService=require(_0xdff1('0x12'));var logger=require(_0xdff1('0x13'))(_0xdff1('0x14'));var utils=require(_0xdff1('0x15'));var config=require(_0xdff1('0x16'));var db=require(_0xdff1('0x17'))['db'];function respondWithStatusCode(_0x59e29c,_0x5eebf5){_0x5eebf5=_0x5eebf5||0xcc;return function(_0x1ef5e2){if(_0x1ef5e2){return _0x59e29c[_0xdff1('0x18')](_0x5eebf5);}return _0x59e29c[_0xdff1('0x19')](_0x5eebf5)['end']();};}function respondWithResult(_0x1a53dd,_0x350bf0){_0x350bf0=_0x350bf0||0xc8;return function(_0x30412d){if(_0x30412d){return _0x1a53dd['status'](_0x350bf0)['json'](_0x30412d);}};}function respondWithFilteredResult(_0x34d1ca,_0x4d41a8){return function(_0x299ecc){if(_0x299ecc){var _0x42bff3=_0x299ecc['count'],_0x3ad40b=_0x4d41a8['offset'],_0x390c4c=_0x4d41a8[_0xdff1('0x1a')]+_0x4d41a8[_0xdff1('0x1b')],_0x3cbca0;if(_0x390c4c>=_0x42bff3){_0x390c4c=_0x42bff3;_0x3cbca0=0xc8;}else{_0x3cbca0=0xce;}_0x34d1ca[_0xdff1('0x19')](_0x3cbca0);return _0x34d1ca[_0xdff1('0x1c')]('Content-Range',_0x3ad40b+'-'+_0x390c4c+'/'+_0x42bff3)[_0xdff1('0x1d')](_0x299ecc);}return null;};}function patchUpdates(_0x3ee9ec){return function(_0x4b4e2d){try{jsonpatch['apply'](_0x4b4e2d,_0x3ee9ec,!![]);}catch(_0x518834){return BPromise['reject'](_0x518834);}return _0x4b4e2d[_0xdff1('0x1e')]();};}function saveUpdates(_0x309fa5,_0x30b173){return function(_0x5f4eb1){if(_0x5f4eb1){return _0x5f4eb1[_0xdff1('0x1f')](_0x309fa5)[_0xdff1('0x20')](function(_0x188084){return _0x188084;});}return null;};}function removeEntity(_0x3b0fa2,_0x118ac1){return function(_0x4d900c){if(_0x4d900c){return _0x4d900c[_0xdff1('0x21')]()['then'](function(){var _0x23bfc1=_0x4d900c[_0xdff1('0x22')]({'plain':!![]});var _0x200da4=_0xdff1('0x23');return db[_0xdff1('0x24')]['destroy']({'where':{'type':_0x200da4,'resourceId':_0x23bfc1['id']}})[_0xdff1('0x20')](function(){return _0x4d900c;});})[_0xdff1('0x20')](function(){_0x3b0fa2[_0xdff1('0x19')](0xcc)[_0xdff1('0x25')]();});}};}function handleEntityNotFound(_0x4ccb89,_0x1330f4){return function(_0x1866e5){if(!_0x1866e5){_0x4ccb89[_0xdff1('0x18')](0x194);}return _0x1866e5;};}function handleError(_0x59925b,_0x132365){_0x132365=_0x132365||0x1f4;return function(_0x445c1a){logger[_0xdff1('0x26')](_0x445c1a[_0xdff1('0x27')]);if(_0x445c1a[_0xdff1('0x28')]){delete _0x445c1a[_0xdff1('0x28')];}_0x59925b[_0xdff1('0x19')](_0x132365)['send'](_0x445c1a);};}exports[_0xdff1('0x29')]=function(_0x3ca727,_0x545f99){var _0x3a0aca={},_0x19404e={},_0x4db039={'count':0x0,'rows':[]};var _0x19d821=db[_0xdff1('0x2a')][_0xdff1('0x2b')];_0x19404e[_0xdff1('0x2c')]=_[_0xdff1('0x2d')](_0x19d821);_0x19404e[_0xdff1('0x2e')]=_[_0xdff1('0x2d')](_0x3ca727[_0xdff1('0x2e')]);_0x19404e[_0xdff1('0x2f')]=_['intersection'](_0x19404e[_0xdff1('0x2c')],_0x19404e[_0xdff1('0x2e')]);_0x3a0aca[_0xdff1('0x30')]=_[_0xdff1('0x31')](_0x19404e[_0xdff1('0x2c')],qs[_0xdff1('0x32')](_0x3ca727[_0xdff1('0x2e')][_0xdff1('0x32')]));_0x3a0aca['attributes']=_0x3a0aca[_0xdff1('0x30')][_0xdff1('0x33')]?_0x3a0aca['attributes']:_0x19404e[_0xdff1('0x2c')];if(!_0x3ca727[_0xdff1('0x2e')][_0xdff1('0x34')]('nolimit')){_0x3a0aca[_0xdff1('0x1b')]=qs['limit'](_0x3ca727[_0xdff1('0x2e')][_0xdff1('0x1b')]);_0x3a0aca['offset']=qs[_0xdff1('0x1a')](_0x3ca727[_0xdff1('0x2e')][_0xdff1('0x1a')]);}_0x3a0aca['order']=qs[_0xdff1('0x35')](_0x3ca727[_0xdff1('0x2e')]['sort']);_0x3a0aca[_0xdff1('0x36')]=qs[_0xdff1('0x2f')](_[_0xdff1('0x37')](_0x3ca727['query'],_0x19404e[_0xdff1('0x2f')]));if(_0x3ca727[_0xdff1('0x2e')][_0xdff1('0x38')]){_0x3a0aca[_0xdff1('0x36')]=_[_0xdff1('0x39')](_0x3a0aca[_0xdff1('0x36')],{'$or':_['map'](_0x19d821,function(_0x403b1d){if(_0x403b1d['type'][_0xdff1('0x3a')]!=='VIRTUAL'){var _0x58220d={};_0x58220d[_0x403b1d[_0xdff1('0x3b')]]={'$like':'%'+_0x3ca727[_0xdff1('0x2e')][_0xdff1('0x38')]+'%'};return _0x58220d;}})});}_0x3a0aca=_['merge']({},_0x3a0aca,_0x3ca727['options']);var _0x29c684={'where':_0x3a0aca[_0xdff1('0x36')]};return db[_0xdff1('0x2a')][_0xdff1('0x3c')](_0x29c684)[_0xdff1('0x20')](function(_0x57e796){_0x4db039[_0xdff1('0x3c')]=_0x57e796;if(_0x3ca727[_0xdff1('0x2e')][_0xdff1('0x3d')]){_0x3a0aca[_0xdff1('0x3e')]=[{'all':!![]}];}return db['Trigger'][_0xdff1('0x3f')](_0x3a0aca);})[_0xdff1('0x20')](function(_0xb73668){_0x4db039['rows']=_0xb73668;return _0x4db039;})['then'](respondWithFilteredResult(_0x545f99,_0x3a0aca))[_0xdff1('0x40')](handleError(_0x545f99,null));};exports[_0xdff1('0x41')]=function(_0x2a1e06,_0x55622e){var _0x512d3e={'raw':![],'where':{'id':_0x2a1e06[_0xdff1('0x42')]['id']}},_0x4eac7d={};_0x4eac7d['model']=_[_0xdff1('0x2d')](db[_0xdff1('0x2a')][_0xdff1('0x2b')]);_0x4eac7d['query']=_['keys'](_0x2a1e06[_0xdff1('0x2e')]);_0x4eac7d[_0xdff1('0x2f')]=_[_0xdff1('0x31')](_0x4eac7d[_0xdff1('0x2c')],_0x4eac7d[_0xdff1('0x2e')]);_0x512d3e[_0xdff1('0x30')]=_['intersection'](_0x4eac7d[_0xdff1('0x2c')],qs['fields'](_0x2a1e06[_0xdff1('0x2e')]['fields']));_0x512d3e[_0xdff1('0x30')]=_0x512d3e[_0xdff1('0x30')][_0xdff1('0x33')]?_0x512d3e['attributes']:_0x4eac7d[_0xdff1('0x2c')];if(_0x2a1e06['query'][_0xdff1('0x3d')]){_0x512d3e['include']=[{'all':!![]}];}_0x512d3e=_[_0xdff1('0x39')]({},_0x512d3e,_0x2a1e06['options']);return db[_0xdff1('0x2a')][_0xdff1('0x43')](_0x512d3e)[_0xdff1('0x20')](handleEntityNotFound(_0x55622e,null))['then'](respondWithResult(_0x55622e,null))['catch'](handleError(_0x55622e,null));};exports[_0xdff1('0x44')]=function(_0x3d794b,_0x3cd396){return db['Trigger'][_0xdff1('0x44')](_0x3d794b[_0xdff1('0x45')],{})[_0xdff1('0x20')](function(_0x5b3745){var _0x9e51f1=_0x3d794b['user'][_0xdff1('0x22')]({'plain':!![]});if(!_0x9e51f1)throw new Error(_0xdff1('0x46'));if(_0x9e51f1[_0xdff1('0x47')]===_0xdff1('0x48')){var _0x23bab3=_0x5b3745[_0xdff1('0x22')]({'plain':!![]});var _0x16a3e0=_0xdff1('0x23');return db[_0xdff1('0x49')][_0xdff1('0x43')]({'where':{'name':_0x16a3e0,'userProfileId':_0x9e51f1[_0xdff1('0x4a')]},'raw':!![]})[_0xdff1('0x20')](function(_0x18c884){if(_0x18c884&&_0x18c884[_0xdff1('0x4b')]===0x0){return db[_0xdff1('0x24')][_0xdff1('0x44')]({'name':_0x23bab3[_0xdff1('0x28')],'resourceId':_0x23bab3['id'],'type':_0x18c884[_0xdff1('0x28')],'sectionId':_0x18c884['id']},{})['then'](function(){return _0x5b3745;});}else{return _0x5b3745;}})[_0xdff1('0x40')](function(_0x543546){logger['error'](_0xdff1('0x4c'),_0x543546);throw _0x543546;});}return _0x5b3745;})['then'](respondWithResult(_0x3cd396,0xc9))[_0xdff1('0x40')](handleError(_0x3cd396,null));};exports[_0xdff1('0x1f')]=function(_0x36d765,_0x3cec8a){if(_0x36d765[_0xdff1('0x45')]['id']){delete _0x36d765[_0xdff1('0x45')]['id'];}return db[_0xdff1('0x2a')][_0xdff1('0x43')]({'where':{'id':_0x36d765['params']['id']}})[_0xdff1('0x20')](handleEntityNotFound(_0x3cec8a,null))[_0xdff1('0x20')](saveUpdates(_0x36d765['body'],null))[_0xdff1('0x20')](respondWithResult(_0x3cec8a,null))[_0xdff1('0x40')](handleError(_0x3cec8a,null));};exports[_0xdff1('0x21')]=function(_0xbd18a8,_0x2bbfd0){return db[_0xdff1('0x2a')][_0xdff1('0x43')]({'where':{'id':_0xbd18a8[_0xdff1('0x42')]['id']}})[_0xdff1('0x20')](handleEntityNotFound(_0x2bbfd0,null))[_0xdff1('0x20')](removeEntity(_0x2bbfd0,null))[_0xdff1('0x40')](handleError(_0x2bbfd0,null));};exports[_0xdff1('0x4d')]=function(_0xa0e315,_0x220981,_0x4ed741){if(_0xa0e315['body']['id']){delete _0xa0e315[_0xdff1('0x45')]['id'];}return db['Trigger'][_0xdff1('0x43')]({'where':{'id':_0xa0e315['params']['id']}})['then'](handleEntityNotFound(_0x220981,null))[_0xdff1('0x20')](function(_0xc63e04){if(_0xc63e04){_0xa0e315[_0xdff1('0x45')][_0xdff1('0x4e')]=_0xc63e04['id'];return db[_0xdff1('0x4f')][_0xdff1('0x44')](_0xa0e315[_0xdff1('0x45')]);}})[_0xdff1('0x20')](respondWithResult(_0x220981,null))[_0xdff1('0x40')](handleError(_0x220981,null));};exports[_0xdff1('0x50')]=function(_0x3e9bfe,_0x5e0efc,_0x17ddc9){if(_0x3e9bfe[_0xdff1('0x45')]['id']){delete _0x3e9bfe[_0xdff1('0x45')]['id'];}return db[_0xdff1('0x2a')][_0xdff1('0x43')]({'where':{'id':_0x3e9bfe[_0xdff1('0x42')]['id']}})[_0xdff1('0x20')](handleEntityNotFound(_0x5e0efc,null))['then'](function(_0x31beae){if(_0x31beae){_0x3e9bfe[_0xdff1('0x45')][_0xdff1('0x51')]=_0x31beae['id'];return db['Condition'][_0xdff1('0x44')](_0x3e9bfe['body']);}})[_0xdff1('0x20')](respondWithResult(_0x5e0efc,null))[_0xdff1('0x40')](handleError(_0x5e0efc,null));};exports[_0xdff1('0x52')]=function(_0x46402e,_0x3f9b0a,_0x3b417b){var _0x1135f7={};var _0x1c7916={};var _0x86f95a;var _0x51a0a0;return db['Trigger']['findOne']({'where':{'id':_0x46402e[_0xdff1('0x42')]['id']}})[_0xdff1('0x20')](handleEntityNotFound(_0x3f9b0a,null))[_0xdff1('0x20')](function(_0xca4ef8){if(_0xca4ef8){_0x86f95a=_0xca4ef8;_0x1c7916['model']=_[_0xdff1('0x2d')](db['Condition'][_0xdff1('0x2b')]);_0x1c7916[_0xdff1('0x2e')]=_[_0xdff1('0x2d')](_0x46402e[_0xdff1('0x2e')]);_0x1c7916[_0xdff1('0x2f')]=_['intersection'](_0x1c7916['model'],_0x1c7916[_0xdff1('0x2e')]);_0x1135f7[_0xdff1('0x30')]=_[_0xdff1('0x31')](_0x1c7916['model'],qs[_0xdff1('0x32')](_0x46402e[_0xdff1('0x2e')][_0xdff1('0x32')]));_0x1135f7['attributes']=_0x1135f7['attributes']['length']?_0x1135f7[_0xdff1('0x30')]:_0x1c7916[_0xdff1('0x2c')];_0x1135f7['order']=qs[_0xdff1('0x35')](_0x46402e['query']['sort']);_0x1135f7['where']=qs[_0xdff1('0x2f')](_['pick'](_0x46402e[_0xdff1('0x2e')],_0x1c7916[_0xdff1('0x2f')]));if(_0x46402e[_0xdff1('0x2e')][_0xdff1('0x38')]){_0x1135f7[_0xdff1('0x36')]=_[_0xdff1('0x39')](_0x1135f7[_0xdff1('0x36')],{'$or':_[_0xdff1('0x53')](_0x1135f7[_0xdff1('0x30')],function(_0x29b111){var _0x49871b={};_0x49871b[_0x29b111]={'$like':'%'+_0x46402e[_0xdff1('0x2e')][_0xdff1('0x38')]+'%'};return _0x49871b;})});}_0x1135f7=_['merge']({},_0x1135f7,_0x46402e[_0xdff1('0x54')]);return _0x86f95a[_0xdff1('0x52')](_0x1135f7);}})[_0xdff1('0x20')](function(_0x16e73c){if(_0x16e73c){_0x51a0a0=_0x16e73c['length'];if(!_0x46402e[_0xdff1('0x2e')][_0xdff1('0x34')](_0xdff1('0x55'))){_0x1135f7[_0xdff1('0x1b')]=qs[_0xdff1('0x1b')](_0x46402e[_0xdff1('0x2e')][_0xdff1('0x1b')]);_0x1135f7[_0xdff1('0x1a')]=qs[_0xdff1('0x1a')](_0x46402e[_0xdff1('0x2e')][_0xdff1('0x1a')]);}return _0x86f95a[_0xdff1('0x52')](_0x1135f7);}})[_0xdff1('0x20')](function(_0x4d404f){if(_0x4d404f){return _0x4d404f?{'count':_0x51a0a0,'rows':_0x4d404f}:null;}})[_0xdff1('0x20')](respondWithResult(_0x3f9b0a,null))[_0xdff1('0x40')](handleError(_0x3f9b0a,null));};exports[_0xdff1('0x56')]=function(_0x33936a,_0x127848,_0xcdf247){var _0x538229={};var _0x461919={};var _0x1e5056;var _0x317ec9;return db[_0xdff1('0x2a')]['findOne']({'where':{'id':_0x33936a[_0xdff1('0x42')]['id']}})[_0xdff1('0x20')](handleEntityNotFound(_0x127848,null))[_0xdff1('0x20')](function(_0x4a8dbb){if(_0x4a8dbb){_0x1e5056=_0x4a8dbb;_0x461919[_0xdff1('0x2c')]=_[_0xdff1('0x2d')](db['Condition']['rawAttributes']);_0x461919[_0xdff1('0x2e')]=_['keys'](_0x33936a[_0xdff1('0x2e')]);_0x461919[_0xdff1('0x2f')]=_['intersection'](_0x461919[_0xdff1('0x2c')],_0x461919[_0xdff1('0x2e')]);_0x538229[_0xdff1('0x30')]=_[_0xdff1('0x31')](_0x461919['model'],qs[_0xdff1('0x32')](_0x33936a[_0xdff1('0x2e')][_0xdff1('0x32')]));_0x538229[_0xdff1('0x30')]=_0x538229[_0xdff1('0x30')][_0xdff1('0x33')]?_0x538229[_0xdff1('0x30')]:_0x461919[_0xdff1('0x2c')];_0x538229[_0xdff1('0x57')]=qs[_0xdff1('0x35')](_0x33936a['query'][_0xdff1('0x35')]);_0x538229[_0xdff1('0x36')]=qs['filters'](_[_0xdff1('0x37')](_0x33936a[_0xdff1('0x2e')],_0x461919['filters']));if(_0x33936a['query']['filter']){_0x538229[_0xdff1('0x36')]=_[_0xdff1('0x39')](_0x538229['where'],{'$or':_[_0xdff1('0x53')](_0x538229['attributes'],function(_0x316d20){var _0x522405={};_0x522405[_0x316d20]={'$like':'%'+_0x33936a[_0xdff1('0x2e')][_0xdff1('0x38')]+'%'};return _0x522405;})});}_0x538229=_[_0xdff1('0x39')]({},_0x538229,_0x33936a['options']);return _0x1e5056[_0xdff1('0x56')](_0x538229);}})[_0xdff1('0x20')](function(_0x50a203){if(_0x50a203){_0x317ec9=_0x50a203[_0xdff1('0x33')];if(!_0x33936a['query']['hasOwnProperty'](_0xdff1('0x55'))){_0x538229[_0xdff1('0x1b')]=qs[_0xdff1('0x1b')](_0x33936a[_0xdff1('0x2e')][_0xdff1('0x1b')]);_0x538229['offset']=qs[_0xdff1('0x1a')](_0x33936a[_0xdff1('0x2e')][_0xdff1('0x1a')]);}return _0x1e5056['getAnyConditions'](_0x538229);}})[_0xdff1('0x20')](function(_0x8fd7e6){if(_0x8fd7e6){return _0x8fd7e6?{'count':_0x317ec9,'rows':_0x8fd7e6}:null;}})[_0xdff1('0x20')](respondWithResult(_0x127848,null))[_0xdff1('0x40')](handleError(_0x127848,null));};exports[_0xdff1('0x58')]=function(_0x174032,_0x90b0ee,_0x2e9ca6){if(_0x174032['body']['id']){delete _0x174032[_0xdff1('0x45')]['id'];}return db['Trigger']['find']({'where':{'id':_0x174032[_0xdff1('0x42')]['id']}})[_0xdff1('0x20')](handleEntityNotFound(_0x90b0ee,null))[_0xdff1('0x20')](function(_0x5b5b1c){if(_0x5b5b1c){_0x174032[_0xdff1('0x45')]['TriggerId']=_0x5b5b1c['id'];return db['Action']['create'](_0x174032[_0xdff1('0x45')]);}})['then'](respondWithResult(_0x90b0ee,null))[_0xdff1('0x40')](handleError(_0x90b0ee,null));};exports['getActions']=function(_0x35f419,_0x29580f,_0x1a09e7){var _0x4000cb={};var _0x5c282b={};var _0xc30f74;var _0x3428cd;return db['Trigger'][_0xdff1('0x59')]({'where':{'id':_0x35f419['params']['id']}})['then'](handleEntityNotFound(_0x29580f,null))[_0xdff1('0x20')](function(_0x40f1fe){if(_0x40f1fe){_0xc30f74=_0x40f1fe;_0x5c282b['model']=_[_0xdff1('0x2d')](db[_0xdff1('0x5a')][_0xdff1('0x2b')]);_0x5c282b[_0xdff1('0x2e')]=_[_0xdff1('0x2d')](_0x35f419[_0xdff1('0x2e')]);_0x5c282b[_0xdff1('0x2f')]=_[_0xdff1('0x31')](_0x5c282b[_0xdff1('0x2c')],_0x5c282b['query']);_0x4000cb['attributes']=_[_0xdff1('0x31')](_0x5c282b['model'],qs[_0xdff1('0x32')](_0x35f419[_0xdff1('0x2e')]['fields']));_0x4000cb[_0xdff1('0x30')]=_0x4000cb['attributes'][_0xdff1('0x33')]?_0x4000cb['attributes']:_0x5c282b[_0xdff1('0x2c')];_0x4000cb[_0xdff1('0x57')]=qs[_0xdff1('0x35')](_0x35f419[_0xdff1('0x2e')]['sort']);_0x4000cb['where']=qs[_0xdff1('0x2f')](_[_0xdff1('0x37')](_0x35f419[_0xdff1('0x2e')],_0x5c282b[_0xdff1('0x2f')]));if(_0x35f419[_0xdff1('0x2e')]['filter']){_0x4000cb[_0xdff1('0x36')]=_[_0xdff1('0x39')](_0x4000cb['where'],{'$or':_[_0xdff1('0x53')](_0x4000cb[_0xdff1('0x30')],function(_0x34551a){var _0x33248e={};_0x33248e[_0x34551a]={'$like':'%'+_0x35f419['query'][_0xdff1('0x38')]+'%'};return _0x33248e;})});}_0x4000cb=_[_0xdff1('0x39')]({},_0x4000cb,_0x35f419[_0xdff1('0x54')]);return _0xc30f74['getActions'](_0x4000cb);}})[_0xdff1('0x20')](function(_0x24a843){if(_0x24a843){_0x3428cd=_0x24a843[_0xdff1('0x33')];if(!_0x35f419[_0xdff1('0x2e')][_0xdff1('0x34')](_0xdff1('0x55'))){_0x4000cb[_0xdff1('0x1b')]=qs[_0xdff1('0x1b')](_0x35f419[_0xdff1('0x2e')][_0xdff1('0x1b')]);_0x4000cb['offset']=qs['offset'](_0x35f419[_0xdff1('0x2e')][_0xdff1('0x1a')]);}return _0xc30f74[_0xdff1('0x5b')](_0x4000cb);}})[_0xdff1('0x20')](function(_0x396427){if(_0x396427){return _0x396427?{'count':_0x3428cd,'rows':_0x396427}:null;}})[_0xdff1('0x20')](respondWithResult(_0x29580f,null))[_0xdff1('0x40')](handleError(_0x29580f,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 72445aa..c194816 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 _0x3f20=['bluebird','request-promise','path','rimraf','exports','define','Trigger','tools_triggers','util','../../config/logger','api','moment'];(function(_0x479a09,_0x3d4847){var _0x19a15d=function(_0x4a8ea7){while(--_0x4a8ea7){_0x479a09['push'](_0x479a09['shift']());}};_0x19a15d(++_0x3d4847);}(_0x3f20,0x1b8));var _0x03f2=function(_0x1bad8a,_0x4a160f){_0x1bad8a=_0x1bad8a-0x0;var _0xfa3b6b=_0x3f20[_0x1bad8a];return _0xfa3b6b;};'use strict';var _=require('lodash');var util=require(_0x03f2('0x0'));var logger=require(_0x03f2('0x1'))(_0x03f2('0x2'));var moment=require(_0x03f2('0x3'));var BPromise=require(_0x03f2('0x4'));var rp=require(_0x03f2('0x5'));var fs=require('fs');var path=require(_0x03f2('0x6'));var rimraf=require(_0x03f2('0x7'));var config=require('../../config/environment');var attributes=require('./trigger.attributes');module[_0x03f2('0x8')]=function(_0x435b96,_0x577a3d){return _0x435b96[_0x03f2('0x9')](_0x03f2('0xa'),attributes,{'tableName':_0x03f2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec9b=['tools_triggers','lodash','util','../../config/logger','moment','request-promise','rimraf','./trigger.attributes','exports','define','Trigger'];(function(_0x575a31,_0x56336f){var _0x5d7dad=function(_0x2c8c09){while(--_0x2c8c09){_0x575a31['push'](_0x575a31['shift']());}};_0x5d7dad(++_0x56336f);}(_0xec9b,0xa6));var _0xbec9=function(_0x5bf992,_0x533b26){_0x5bf992=_0x5bf992-0x0;var _0x288176=_0xec9b[_0x5bf992];return _0x288176;};'use strict';var _=require(_0xbec9('0x0'));var util=require(_0xbec9('0x1'));var logger=require(_0xbec9('0x2'))('api');var moment=require(_0xbec9('0x3'));var BPromise=require('bluebird');var rp=require(_0xbec9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbec9('0x5'));var config=require('../../config/environment');var attributes=require(_0xbec9('0x6'));module[_0xbec9('0x7')]=function(_0x18459d,_0x467f89){return _0x18459d[_0xbec9('0x8')](_0xbec9('0x9'),attributes,{'tableName':_0xbec9('0xa'),'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 10cb5cc..01cb7fb 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 _0x97c1=['error','message','result','catch','Trigger','findAll','options','raw','attributes','limit','include','map','model','then','GetTrigger','debug','find','where','ShowTrigger','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x48ca7b,_0x545413){var _0x5a69da=function(_0xa796f2){while(--_0xa796f2){_0x48ca7b['push'](_0x48ca7b['shift']());}};_0x5a69da(++_0x545413);}(_0x97c1,0xdf));var _0x197c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x97c1[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var moment=require('moment');var BPromise=require(_0x197c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x197c('0x3'))['db'];var utils=require(_0x197c('0x4'));var logger=require(_0x197c('0x5'))(_0x197c('0x6'));var config=require(_0x197c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x197c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x437214,_0x60fab2,_0xfcee35){return new BPromise(function(_0x5cf5cb,_0x5d42c5){return client[_0x197c('0x9')](_0x437214,_0xfcee35)['then'](function(_0x339fab){logger[_0x197c('0xa')](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));logger['debug'](_0x197c('0xd'),_0x60fab2,_0x197c('0xc'),JSON[_0x197c('0xe')](_0x339fab));if(_0x339fab[_0x197c('0xf')]){if(_0x339fab[_0x197c('0xf')]['code']===0x1f4){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5d42c5(_0x339fab['error'][_0x197c('0x10')]);}logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5cf5cb(_0x339fab[_0x197c('0xf')]['message']);}else{logger['info'](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));_0x5cf5cb(_0x339fab[_0x197c('0x11')][_0x197c('0x10')]);}})[_0x197c('0x12')](function(_0x7e302f){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x7e302f);_0x5d42c5(_0x7e302f);});});}exports['GetTrigger']=function(_0x372311){var _0x47aaa9=this;return new Promise(function(_0x50ac52,_0x1725d9){return db[_0x197c('0x13')][_0x197c('0x14')]({'raw':_0x372311[_0x197c('0x15')]?_0x372311['options'][_0x197c('0x16')]===undefined?!![]:![]:!![],'where':_0x372311[_0x197c('0x15')]?_0x372311[_0x197c('0x15')]['where']||null:null,'attributes':_0x372311[_0x197c('0x15')]?_0x372311[_0x197c('0x15')][_0x197c('0x17')]||null:null,'limit':_0x372311[_0x197c('0x15')]?_0x372311[_0x197c('0x15')][_0x197c('0x18')]||null:null,'include':_0x372311[_0x197c('0x15')]?_0x372311[_0x197c('0x15')][_0x197c('0x19')]?_[_0x197c('0x1a')](_0x372311[_0x197c('0x15')][_0x197c('0x19')],function(_0x174942){return{'model':db[_0x174942[_0x197c('0x1b')]],'as':_0x174942['as'],'attributes':_0x174942[_0x197c('0x17')],'include':_0x174942[_0x197c('0x19')]?_['map'](_0x174942[_0x197c('0x19')],function(_0x2911dd){return{'model':db[_0x2911dd[_0x197c('0x1b')]],'as':_0x2911dd['as'],'attributes':_0x2911dd['attributes'],'include':_0x2911dd[_0x197c('0x19')]?_[_0x197c('0x1a')](_0x2911dd['include'],function(_0x5e7bc9){return{'model':db[_0x5e7bc9[_0x197c('0x1b')]],'as':_0x5e7bc9['as'],'attributes':_0x5e7bc9['attributes']};}):[]};}):[]};}):[]:[]})[_0x197c('0x1c')](function(_0x14b0aa){logger[_0x197c('0xa')](_0x197c('0x1d'),_0x372311);logger[_0x197c('0x1e')](_0x197c('0x1d'),_0x372311,JSON[_0x197c('0xe')](_0x14b0aa));_0x50ac52(_0x14b0aa);})[_0x197c('0x12')](function(_0x4422d1){logger['error']('GetTrigger',_0x4422d1['message'],_0x372311);_0x1725d9(_0x47aaa9['error'](0x1f4,_0x4422d1[_0x197c('0x10')]));});});};exports['ShowTrigger']=function(_0x252cde){var _0x35dbf3=this;return new Promise(function(_0x58bc60,_0x422ac6){return db['Trigger'][_0x197c('0x1f')]({'raw':_0x252cde[_0x197c('0x15')]?_0x252cde[_0x197c('0x15')][_0x197c('0x16')]===undefined?!![]:![]:!![],'where':_0x252cde[_0x197c('0x15')]?_0x252cde[_0x197c('0x15')][_0x197c('0x20')]||null:null,'attributes':_0x252cde[_0x197c('0x15')]?_0x252cde[_0x197c('0x15')]['attributes']||null:null,'include':_0x252cde['options']?_0x252cde[_0x197c('0x15')][_0x197c('0x19')]?_[_0x197c('0x1a')](_0x252cde[_0x197c('0x15')][_0x197c('0x19')],function(_0x1cb7e8){return{'model':db[_0x1cb7e8[_0x197c('0x1b')]],'as':_0x1cb7e8['as'],'attributes':_0x1cb7e8['attributes'],'include':_0x1cb7e8['include']?_[_0x197c('0x1a')](_0x1cb7e8[_0x197c('0x19')],function(_0x4d085b){return{'model':db[_0x4d085b['model']],'as':_0x4d085b['as'],'attributes':_0x4d085b[_0x197c('0x17')],'include':_0x4d085b[_0x197c('0x19')]?_[_0x197c('0x1a')](_0x4d085b[_0x197c('0x19')],function(_0x45095c){return{'model':db[_0x45095c[_0x197c('0x1b')]],'as':_0x45095c['as'],'attributes':_0x45095c[_0x197c('0x17')]};}):[]};}):[]};}):[]:[]})[_0x197c('0x1c')](function(_0x44ce68){logger['info'](_0x197c('0x21'),_0x252cde);logger[_0x197c('0x1e')](_0x197c('0x21'),_0x252cde,JSON[_0x197c('0xe')](_0x44ce68));_0x58bc60(_0x44ce68);})[_0x197c('0x12')](function(_0x151e2f){logger['error'](_0x197c('0x21'),_0x151e2f[_0x197c('0x10')],_0x252cde);_0x422ac6(_0x35dbf3[_0x197c('0xf')](0x1f4,_0x151e2f['message']));});});}; \ No newline at end of file +var _0xfff0=['model','info','GetTrigger','catch','ShowTrigger','find','where','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Trigger','findAll','options','raw','attributes','include','map'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xfff0,0x139));var _0x0fff=function(_0x12cedb,_0x53763d){_0x12cedb=_0x12cedb-0x0;var _0x1a04bf=_0xfff0[_0x12cedb];return _0x1a04bf;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var moment=require(_0x0fff('0x1'));var BPromise=require(_0x0fff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fff('0x3'));var db=require(_0x0fff('0x4'))['db'];var utils=require(_0x0fff('0x5'));var logger=require('../../config/logger')(_0x0fff('0x6'));var config=require(_0x0fff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0fff('0x8')][_0x0fff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f1d2b,_0x586dc5,_0x24cfb0){return new BPromise(function(_0x5e9672,_0x1f2658){return client['request'](_0x2f1d2b,_0x24cfb0)[_0x0fff('0xa')](function(_0x3db6f6){logger['info'](_0x0fff('0xb'),_0x586dc5,_0x0fff('0xc'));logger[_0x0fff('0xd')](_0x0fff('0xe'),_0x586dc5,_0x0fff('0xc'),JSON[_0x0fff('0xf')](_0x3db6f6));if(_0x3db6f6[_0x0fff('0x10')]){if(_0x3db6f6[_0x0fff('0x10')][_0x0fff('0x11')]===0x1f4){logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6['error'][_0x0fff('0x12')]);return _0x1f2658(_0x3db6f6['error'][_0x0fff('0x12')]);}logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6[_0x0fff('0x10')]['message']);return _0x5e9672(_0x3db6f6['error'][_0x0fff('0x12')]);}else{logger['info']('Trigger,\x20%s,\x20%s',_0x586dc5,'request\x20sent');_0x5e9672(_0x3db6f6[_0x0fff('0x13')][_0x0fff('0x12')]);}})['catch'](function(_0x431b33){logger[_0x0fff('0x10')]('Trigger,\x20%s,\x20%s',_0x586dc5,_0x431b33);_0x1f2658(_0x431b33);});});}exports['GetTrigger']=function(_0x48f36d){var _0x2337f=this;return new Promise(function(_0x606792,_0x46a02d){return db[_0x0fff('0x14')][_0x0fff('0x15')]({'raw':_0x48f36d[_0x0fff('0x16')]?_0x48f36d['options'][_0x0fff('0x17')]===undefined?!![]:![]:!![],'where':_0x48f36d[_0x0fff('0x16')]?_0x48f36d[_0x0fff('0x16')]['where']||null:null,'attributes':_0x48f36d['options']?_0x48f36d[_0x0fff('0x16')][_0x0fff('0x18')]||null:null,'limit':_0x48f36d[_0x0fff('0x16')]?_0x48f36d[_0x0fff('0x16')]['limit']||null:null,'include':_0x48f36d[_0x0fff('0x16')]?_0x48f36d[_0x0fff('0x16')][_0x0fff('0x19')]?_[_0x0fff('0x1a')](_0x48f36d[_0x0fff('0x16')][_0x0fff('0x19')],function(_0x580b8e){return{'model':db[_0x580b8e[_0x0fff('0x1b')]],'as':_0x580b8e['as'],'attributes':_0x580b8e[_0x0fff('0x18')],'include':_0x580b8e[_0x0fff('0x19')]?_[_0x0fff('0x1a')](_0x580b8e[_0x0fff('0x19')],function(_0x23d9f8){return{'model':db[_0x23d9f8['model']],'as':_0x23d9f8['as'],'attributes':_0x23d9f8[_0x0fff('0x18')],'include':_0x23d9f8[_0x0fff('0x19')]?_[_0x0fff('0x1a')](_0x23d9f8[_0x0fff('0x19')],function(_0x36d268){return{'model':db[_0x36d268[_0x0fff('0x1b')]],'as':_0x36d268['as'],'attributes':_0x36d268[_0x0fff('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0fff('0xa')](function(_0x44e54a){logger[_0x0fff('0x1c')](_0x0fff('0x1d'),_0x48f36d);logger[_0x0fff('0xd')]('GetTrigger',_0x48f36d,JSON[_0x0fff('0xf')](_0x44e54a));_0x606792(_0x44e54a);})[_0x0fff('0x1e')](function(_0x17ab6f){logger[_0x0fff('0x10')](_0x0fff('0x1d'),_0x17ab6f[_0x0fff('0x12')],_0x48f36d);_0x46a02d(_0x2337f['error'](0x1f4,_0x17ab6f[_0x0fff('0x12')]));});});};exports[_0x0fff('0x1f')]=function(_0x351102){var _0x48f1d1=this;return new Promise(function(_0x1016fa,_0x3fa6fc){return db['Trigger'][_0x0fff('0x20')]({'raw':_0x351102[_0x0fff('0x16')]?_0x351102[_0x0fff('0x16')][_0x0fff('0x17')]===undefined?!![]:![]:!![],'where':_0x351102[_0x0fff('0x16')]?_0x351102[_0x0fff('0x16')][_0x0fff('0x21')]||null:null,'attributes':_0x351102[_0x0fff('0x16')]?_0x351102[_0x0fff('0x16')][_0x0fff('0x18')]||null:null,'include':_0x351102['options']?_0x351102[_0x0fff('0x16')][_0x0fff('0x19')]?_[_0x0fff('0x1a')](_0x351102[_0x0fff('0x16')][_0x0fff('0x19')],function(_0x5967dc){return{'model':db[_0x5967dc['model']],'as':_0x5967dc['as'],'attributes':_0x5967dc[_0x0fff('0x18')],'include':_0x5967dc[_0x0fff('0x19')]?_[_0x0fff('0x1a')](_0x5967dc[_0x0fff('0x19')],function(_0x5c1797){return{'model':db[_0x5c1797[_0x0fff('0x1b')]],'as':_0x5c1797['as'],'attributes':_0x5c1797[_0x0fff('0x18')],'include':_0x5c1797[_0x0fff('0x19')]?_[_0x0fff('0x1a')](_0x5c1797['include'],function(_0x36a233){return{'model':db[_0x36a233[_0x0fff('0x1b')]],'as':_0x36a233['as'],'attributes':_0x36a233[_0x0fff('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0fff('0xa')](function(_0x191369){logger[_0x0fff('0x1c')](_0x0fff('0x1f'),_0x351102);logger[_0x0fff('0xd')](_0x0fff('0x1f'),_0x351102,JSON[_0x0fff('0xf')](_0x191369));_0x1016fa(_0x191369);})[_0x0fff('0x1e')](function(_0xeea9a7){logger['error'](_0x0fff('0x1f'),_0xeea9a7[_0x0fff('0x12')],_0x351102);_0x3fa6fc(_0x48f1d1[_0x0fff('0x10')](0x1f4,_0xeea9a7[_0x0fff('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 8ae3402..5d9c6d6 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 _0x24ca=['put','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','/:id/clone','clone','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24ca,0x1bc));var _0xa24c=function(_0x160248,_0x2a57e6){_0x160248=_0x160248-0x0;var _0x4e589d=_0x24ca[_0x160248];return _0x4e589d;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var auth=require(_0xa24c('0x4'));var interaction=require(_0xa24c('0x5'));var config=require(_0xa24c('0x6'));var controller=require(_0xa24c('0x7'));router[_0xa24c('0x8')]('/',auth[_0xa24c('0x9')](),controller[_0xa24c('0xa')]);router[_0xa24c('0x8')](_0xa24c('0xb'),auth[_0xa24c('0x9')](),controller[_0xa24c('0xc')]);router['post'](_0xa24c('0xd'),auth[_0xa24c('0x9')](),controller[_0xa24c('0xe')]);router['post']('/',auth[_0xa24c('0x9')](),controller[_0xa24c('0xf')]);router[_0xa24c('0x10')](_0xa24c('0xb'),auth[_0xa24c('0x9')](),controller[_0xa24c('0x11')]);router[_0xa24c('0x12')](_0xa24c('0xb'),auth[_0xa24c('0x9')](),controller['destroy']);module[_0xa24c('0x13')]=router; \ No newline at end of file +var _0xae24=['isAuthenticated','index','/:id','/:id/clone','post','put','update','destroy','multer','path','express','Router','../../config/environment','get'];(function(_0x224f5e,_0x4b1806){var _0x56b456=function(_0xe50d){while(--_0xe50d){_0x224f5e['push'](_0x224f5e['shift']());}};_0x56b456(++_0x4b1806);}(_0xae24,0x182));var _0x4ae2=function(_0x35f934,_0x34451c){_0x35f934=_0x35f934-0x0;var _0x2293c7=_0xae24[_0x35f934];return _0x2293c7;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4ae2('0x4'));var controller=require('./trunk.controller');router[_0x4ae2('0x5')]('/',auth[_0x4ae2('0x6')](),controller[_0x4ae2('0x7')]);router[_0x4ae2('0x5')](_0x4ae2('0x8'),auth[_0x4ae2('0x6')](),controller['show']);router['post'](_0x4ae2('0x9'),auth['isAuthenticated'](),controller['clone']);router[_0x4ae2('0xa')]('/',auth[_0x4ae2('0x6')](),controller['create']);router[_0x4ae2('0xb')](_0x4ae2('0x8'),auth[_0x4ae2('0x6')](),controller[_0x4ae2('0xc')]);router['delete'](_0x4ae2('0x8'),auth[_0x4ae2('0x6')](),controller[_0x4ae2('0xd')]);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 ca3784d..9125c20 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 _0xb3e3=['uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','nonat','update,nonat','BOOLEAN','sequelize','exports','STRING','name','user','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','setDataValue','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','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]','INTEGER','\x22\x22\x20<>','accept','refuse','uac'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb3e3,0x1f1));var _0x3b3e=function(_0x35f31d,_0x4db749){_0x35f31d=_0x35f31d-0x0;var _0x52b841=_0xb3e3[_0x35f31d];return _0x52b841;};'use strict';var Sequelize=require(_0x3b3e('0x0'));module[_0x3b3e('0x1')]={'name':{'type':Sequelize[_0x3b3e('0x2')],'allowNull':![],'unique':_0x3b3e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0x3b3e('0x4'),_0x3b3e('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x3b3e('0x2')],'allowNull':![],'defaultValue':_0x3b3e('0x6')},'callingpres':{'type':Sequelize[_0x3b3e('0x7')](_0x3b3e('0x8'),_0x3b3e('0x9'),'ALLOWED_FAILED_SCREEN',_0x3b3e('0xa'),'PROHIB_NOT_SCREENED',_0x3b3e('0xb'),_0x3b3e('0xc'),_0x3b3e('0xd'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x3b3e('0x2')]},'secret':{'type':Sequelize[_0x3b3e('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x3b3e('0x2')]},'transport':{'type':Sequelize[_0x3b3e('0x2')],'defaultValue':_0x3b3e('0xe'),'set':function(_0x312e26){this['setDataValue'](_0x3b3e('0xf'),_0x312e26?_0x312e26[_0x3b3e('0x10')](','):null);},'get':function(){return this['getDataValue'](_0x3b3e('0xf'))?this[_0x3b3e('0x11')]('transport')['split'](','):null;},'comment':_0x3b3e('0x12')},'dtmfmode':{'type':Sequelize[_0x3b3e('0x7')](_0x3b3e('0x13'),_0x3b3e('0x14'),_0x3b3e('0x15'),_0x3b3e('0x16'),_0x3b3e('0x17')),'defaultValue':_0x3b3e('0x13')},'directmedia':{'type':Sequelize['ENUM'](_0x3b3e('0x18'),'no','nonat',_0x3b3e('0x19'),_0x3b3e('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x3b3e('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x3b3e('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x3b3e('0x1b'),'set':function(_0x1ef162){this[_0x3b3e('0x1c')](_0x3b3e('0x1d'),_0x1ef162?_0x1ef162[_0x3b3e('0x10')](','):null);},'get':function(){return this[_0x3b3e('0x11')](_0x3b3e('0x1d'))?this[_0x3b3e('0x11')](_0x3b3e('0x1d'))[_0x3b3e('0x1e')](','):null;},'comment':_0x3b3e('0x1f')},'callgroup':{'type':Sequelize[_0x3b3e('0x2')]},'namedcallgroup':{'type':Sequelize[_0x3b3e('0x2')]},'pickupgroup':{'type':Sequelize[_0x3b3e('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x3b3e('0x2')]},'language':{'type':Sequelize[_0x3b3e('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3b3e('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x3b3e('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x3b3e('0x2')],'allowNull':![],'defaultValue':_0x3b3e('0x20'),'set':function(_0xf8ac98){this[_0x3b3e('0x1c')](_0x3b3e('0x21'),_0xf8ac98?_0xf8ac98[_0x3b3e('0x10')](';'):_0x3b3e('0x20'));},'get':function(){return this['getDataValue']('allow')?this[_0x3b3e('0x11')]('allow')[_0x3b3e('0x1e')](';'):null;},'comment':_0x3b3e('0x22')},'autoframing':{'type':Sequelize[_0x3b3e('0x7')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x3b3e('0x23'),'set':function(_0xfaf981){this[_0x3b3e('0x1c')]('insecure',_0xfaf981?_0xfaf981[_0x3b3e('0x10')](','):null);},'get':function(){return this['getDataValue'](_0x3b3e('0x24'))?this[_0x3b3e('0x11')](_0x3b3e('0x24'))[_0x3b3e('0x1e')](','):null;},'comment':_0x3b3e('0x25')},'trustrpid':{'type':Sequelize[_0x3b3e('0x7')](_0x3b3e('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3b3e('0x7')](_0x3b3e('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3b3e('0x7')](_0x3b3e('0x18'),'no','never')},'promiscredir':{'type':Sequelize[_0x3b3e('0x7')](_0x3b3e('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x3b3e('0x7')](_0x3b3e('0x18'),'no')},'accountcode':{'type':Sequelize[_0x3b3e('0x26')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x3b3e('0x2')],'defaultValue':_0x3b3e('0x27')},'amaflags':{'type':Sequelize[_0x3b3e('0x2')]},'callcounter':{'type':Sequelize[_0x3b3e('0x7')]('yes','no'),'defaultValue':_0x3b3e('0x18')},'busylevel':{'type':Sequelize[_0x3b3e('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x3b3e('0x7')](_0x3b3e('0x18'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x3b3e('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x3b3e('0x7')](_0x3b3e('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x3b3e('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x3b3e('0x2')]},'template':{'type':Sequelize[_0x3b3e('0x2')]},'videosupport':{'type':Sequelize[_0x3b3e('0x7')](_0x3b3e('0x18'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x3b3e('0x7')]('yes','no')},'mailbox':{'type':Sequelize[_0x3b3e('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x3b3e('0x28'),_0x3b3e('0x29'),'originate')},'session_expires':{'type':Sequelize[_0x3b3e('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x3b3e('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0x3b3e('0x7')](_0x3b3e('0x2a'),'uas'),'defaultValue':_0x3b3e('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x3b3e('0x2')]},'regexten':{'type':Sequelize[_0x3b3e('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3b3e('0x26')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x3b3e('0x18'),'no'),'defaultValue':_0x3b3e('0x18')},'keepalive':{'type':Sequelize[_0x3b3e('0x26')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x3b3e('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x3b3e('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0x3b3e('0x7')](_0x3b3e('0x18'),'no',_0x3b3e('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x3b3e('0x2')]},'callbackextension':{'type':Sequelize[_0x3b3e('0x2')]},'timert1':{'type':Sequelize[_0x3b3e('0x26')](0xb)},'timerb':{'type':Sequelize[_0x3b3e('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0x3b3e('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x3b3e('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x3b3e('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x3b3e('0x2')]},'use_q850_reason':{'type':Sequelize[_0x3b3e('0x2')]},'maxforwards':{'type':Sequelize[_0x3b3e('0x26')](0xb)},'encryption':{'type':Sequelize[_0x3b3e('0x7')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3b3e('0x7')](_0x3b3e('0x18'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x3b3e('0x18'),'no')},'icesupport':{'type':Sequelize[_0x3b3e('0x7')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x3b3e('0x7')](_0x3b3e('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x3b3e('0x7')]('yes','no',_0x3b3e('0x2d'),_0x3b3e('0x2e'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x3b3e('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x3b3e('0x2')]},'dtlscafile':{'type':Sequelize[_0x3b3e('0x2')]},'dtlscapath':{'type':Sequelize[_0x3b3e('0x2')]},'dtlssetup':{'type':Sequelize[_0x3b3e('0x7')](_0x3b3e('0x2f'),_0x3b3e('0x30'),_0x3b3e('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3b3e('0x2')]},'usereqphone':{'type':Sequelize[_0x3b3e('0x7')](_0x3b3e('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x3b3e('0x2')]},'recordofffeature':{'type':Sequelize[_0x3b3e('0x2')]},'call_limit':{'type':Sequelize[_0x3b3e('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x3b3e('0x18'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x3b3e('0x18'),'no')},'vmexten':{'type':Sequelize[_0x3b3e('0x2')]},'mohinterpret':{'type':Sequelize[_0x3b3e('0x2')]},'mohsuggest':{'type':Sequelize[_0x3b3e('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0x3b3e('0x32')},'canreinvite':{'type':Sequelize[_0x3b3e('0x7')](_0x3b3e('0x18'),'no',_0x3b3e('0x33'),_0x3b3e('0x19'),_0x3b3e('0x34')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x3b3e('0x2')]},'otherFields':{'type':Sequelize[_0x3b3e('0x2')]},'active':{'type':Sequelize[_0x3b3e('0x35')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x3b3e('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x9c5d=['join','getDataValue','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','ENUM','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','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','\x22\x22\x20<>','always','refuse','originate','uac','uas','pai','fingerprint','certificate','active','dynamic','sequelize','exports','STRING','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0x9c5d,0xf0));var _0xd9c5=function(_0x591053,_0x523072){_0x591053=_0x591053-0x0;var _0x31ab80=_0x9c5d[_0x591053];return _0x31ab80;};'use strict';var Sequelize=require(_0xd9c5('0x0'));module[_0xd9c5('0x1')]={'name':{'type':Sequelize[_0xd9c5('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xd9c5('0x3'),_0xd9c5('0x4'),_0xd9c5('0x5')),'allowNull':![],'defaultValue':_0xd9c5('0x3')},'context':{'type':Sequelize[_0xd9c5('0x2')],'allowNull':![],'defaultValue':_0xd9c5('0x6')},'callingpres':{'type':Sequelize['ENUM'](_0xd9c5('0x7'),_0xd9c5('0x8'),'ALLOWED_FAILED_SCREEN',_0xd9c5('0x9'),_0xd9c5('0xa'),'PROHIB_PASSED_SCREEN',_0xd9c5('0xb'),_0xd9c5('0xc'))},'deny':{'type':Sequelize[_0xd9c5('0x2')]},'permit':{'type':Sequelize[_0xd9c5('0x2')]},'secret':{'type':Sequelize[_0xd9c5('0x2')]},'md5secret':{'type':Sequelize[_0xd9c5('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xd9c5('0x2')],'defaultValue':_0xd9c5('0xd'),'set':function(_0x186a12){this[_0xd9c5('0xe')]('transport',_0x186a12?_0x186a12[_0xd9c5('0xf')](','):null);},'get':function(){return this[_0xd9c5('0x10')]('transport')?this[_0xd9c5('0x10')](_0xd9c5('0x11'))['split'](','):null;},'comment':_0xd9c5('0x12')},'dtmfmode':{'type':Sequelize['ENUM'](_0xd9c5('0x13'),_0xd9c5('0x14'),_0xd9c5('0x15'),_0xd9c5('0x16'),'auto'),'defaultValue':_0xd9c5('0x13')},'directmedia':{'type':Sequelize['ENUM'](_0xd9c5('0x17'),'no',_0xd9c5('0x18'),_0xd9c5('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd9c5('0x1a')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd9c5('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xd9c5('0x2')],'defaultValue':_0xd9c5('0x1b'),'set':function(_0xf0d067){this[_0xd9c5('0xe')](_0xd9c5('0x1c'),_0xf0d067?_0xf0d067[_0xd9c5('0xf')](','):null);},'get':function(){return this[_0xd9c5('0x10')](_0xd9c5('0x1c'))?this[_0xd9c5('0x10')](_0xd9c5('0x1c'))[_0xd9c5('0x1d')](','):null;},'comment':_0xd9c5('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xd9c5('0x2')]},'language':{'type':Sequelize[_0xd9c5('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd9c5('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xd9c5('0x2')],'defaultValue':_0xd9c5('0x1f')},'allow':{'type':Sequelize[_0xd9c5('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x5a4ba2){this[_0xd9c5('0xe')](_0xd9c5('0x20'),_0x5a4ba2?_0x5a4ba2[_0xd9c5('0xf')](';'):_0xd9c5('0x21'));},'get':function(){return this[_0xd9c5('0x10')](_0xd9c5('0x20'))?this[_0xd9c5('0x10')](_0xd9c5('0x20'))[_0xd9c5('0x1d')](';'):null;},'comment':_0xd9c5('0x22')},'autoframing':{'type':Sequelize[_0xd9c5('0x1a')](_0xd9c5('0x17'),'no')},'insecure':{'type':Sequelize[_0xd9c5('0x2')],'defaultValue':_0xd9c5('0x23'),'set':function(_0x4d61bd){this[_0xd9c5('0xe')](_0xd9c5('0x24'),_0x4d61bd?_0x4d61bd['join'](','):null);},'get':function(){return this[_0xd9c5('0x10')](_0xd9c5('0x24'))?this[_0xd9c5('0x10')]('insecure')['split'](','):null;},'comment':_0xd9c5('0x25')},'trustrpid':{'type':Sequelize[_0xd9c5('0x1a')](_0xd9c5('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd9c5('0x1a')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd9c5('0x1a')](_0xd9c5('0x17'),'no',_0xd9c5('0x26'))},'promiscredir':{'type':Sequelize[_0xd9c5('0x1a')](_0xd9c5('0x17'),'no')},'useclientcode':{'type':Sequelize[_0xd9c5('0x1a')](_0xd9c5('0x17'),'no')},'accountcode':{'type':Sequelize[_0xd9c5('0x27')](0xb)},'setvar':{'type':Sequelize[_0xd9c5('0x2')]},'callerid':{'type':Sequelize[_0xd9c5('0x2')],'defaultValue':_0xd9c5('0x28')},'amaflags':{'type':Sequelize[_0xd9c5('0x2')]},'callcounter':{'type':Sequelize[_0xd9c5('0x1a')]('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xd9c5('0x1a')](_0xd9c5('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0xd9c5('0x1a')](_0xd9c5('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0xd9c5('0x1a')](_0xd9c5('0x17'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize[_0xd9c5('0x2')]},'template':{'type':Sequelize[_0xd9c5('0x2')]},'videosupport':{'type':Sequelize[_0xd9c5('0x1a')](_0xd9c5('0x17'),'no',_0xd9c5('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd9c5('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xd9c5('0x1a')](_0xd9c5('0x17'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM']('accept',_0xd9c5('0x2a'),_0xd9c5('0x2b'))},'session_expires':{'type':Sequelize[_0xd9c5('0x27')](0xb)},'session_minse':{'type':Sequelize[_0xd9c5('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0xd9c5('0x1a')](_0xd9c5('0x2c'),_0xd9c5('0x2d')),'defaultValue':_0xd9c5('0x2d')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xd9c5('0x2')]},'fromdomain':{'type':Sequelize[_0xd9c5('0x2')]},'fromuser':{'type':Sequelize[_0xd9c5('0x2')]},'port':{'type':Sequelize[_0xd9c5('0x27')](0x5)},'qualify':{'type':Sequelize[_0xd9c5('0x1a')](_0xd9c5('0x17'),'no'),'defaultValue':_0xd9c5('0x17')},'keepalive':{'type':Sequelize[_0xd9c5('0x27')](0xb)},'defaultip':{'type':Sequelize[_0xd9c5('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xd9c5('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xd9c5('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xd9c5('0x1a')](_0xd9c5('0x17'),'no',_0xd9c5('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd9c5('0x2')]},'callbackextension':{'type':Sequelize[_0xd9c5('0x2')]},'timert1':{'type':Sequelize[_0xd9c5('0x27')](0xb)},'timerb':{'type':Sequelize[_0xd9c5('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0xd9c5('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0xd9c5('0x2')]},'contactdeny':{'type':Sequelize[_0xd9c5('0x2')]},'contactacl':{'type':Sequelize[_0xd9c5('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xd9c5('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xd9c5('0x1a')](_0xd9c5('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xd9c5('0x17'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xd9c5('0x17'),'no')},'icesupport':{'type':Sequelize[_0xd9c5('0x1a')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xd9c5('0x1a')](_0xd9c5('0x17'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xd9c5('0x17'),'no',_0xd9c5('0x2f'),_0xd9c5('0x30'))},'dtlsrekey':{'type':Sequelize[_0xd9c5('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0xd9c5('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xd9c5('0x2')]},'dtlscipher':{'type':Sequelize[_0xd9c5('0x2')]},'dtlscafile':{'type':Sequelize[_0xd9c5('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xd9c5('0x1a')](_0xd9c5('0x31'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd9c5('0x2')]},'usereqphone':{'type':Sequelize[_0xd9c5('0x1a')](_0xd9c5('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd9c5('0x2')]},'recordofffeature':{'type':Sequelize[_0xd9c5('0x2')]},'call_limit':{'type':Sequelize[_0xd9c5('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xd9c5('0x1a')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xd9c5('0x1a')](_0xd9c5('0x17'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xd9c5('0x2')]},'parkinglot':{'type':Sequelize[_0xd9c5('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xd9c5('0x2')],'defaultValue':_0xd9c5('0x32')},'canreinvite':{'type':Sequelize['ENUM'](_0xd9c5('0x17'),'no','nonat',_0xd9c5('0x19'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xd9c5('0x2')]},'otherFields':{'type':Sequelize[_0xd9c5('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xd9c5('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 aca5eea..bfd0460 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 _0xb50d=['catch','show','params','intersection','clone','find','createdAt','updatedAt','body','create','role','user','autoAssociation','name','findAll','readFileSync','join','utf8','root','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/trunk.ejs','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','apply','save','update','destroy','get','Trunks','UserProfileResource','send','index','Trunk','rawAttributes','model','keys','query','attributes','fields','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows'];(function(_0x266307,_0x467586){var _0x3d9694=function(_0x11f681){while(--_0x11f681){_0x266307['push'](_0x266307['shift']());}};_0x3d9694(++_0x467586);}(_0xb50d,0x8e));var _0xdb50=function(_0x5d7a07,_0x34b7eb){_0x5d7a07=_0x5d7a07-0x0;var _0x542072=_0xb50d[_0x5d7a07];return _0x542072;};'use strict';var pdf=require(_0xdb50('0x0'));var emlformat=require(_0xdb50('0x1'));var rimraf=require(_0xdb50('0x2'));var zipdir=require(_0xdb50('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb50('0x4'));var moment=require(_0xdb50('0x5'));var BPromise=require(_0xdb50('0x6'));var Mustache=require('mustache');var util=require(_0xdb50('0x7'));var path=require(_0xdb50('0x8'));var sox=require(_0xdb50('0x9'));var csv=require(_0xdb50('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdb50('0xb'));var squel=require('squel');var crypto=require(_0xdb50('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdb50('0xa'));var querystring=require(_0xdb50('0xd'));var Papa=require(_0xdb50('0xe'));var Redis=require(_0xdb50('0xf'));var authService=require(_0xdb50('0x10'));var qs=require(_0xdb50('0x11'));var hardwareService=require(_0xdb50('0x12'));var logger=require(_0xdb50('0x13'))(_0xdb50('0x14'));var utils=require(_0xdb50('0x15'));var config=require(_0xdb50('0x16'));var db=require(_0xdb50('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xdb50('0x18')][_0xdb50('0x19')]({'port':0x232a});function checkPasswordPattern(_0xb56478,_0x2a2942,_0x5e94db){if(_0x5e94db){var _0xb1ba4a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xb1ba4a[_0xdb50('0x1a')](_0x2a2942)){return _0xb56478;}else{throw new Error(_0xdb50('0x1b'));}}else{return _0xb56478;}}function respondWithRpcPromise(_0x12dc30,_0x4d496c,_0x3961ae,_0x351fc3){return new BPromise(function(_0x86c793,_0x45162a){var _0x57dc83=_0x351fc3||client;return _0x57dc83[_0xdb50('0x1c')](_0x12dc30,_0x3961ae)[_0xdb50('0x1d')](function(_0x30e89d){logger[_0xdb50('0x1e')](_0xdb50('0x1f'),_0x4d496c,_0xdb50('0x20'));logger[_0xdb50('0x21')](_0xdb50('0x22'),_0x4d496c,'request\x20sent',JSON[_0xdb50('0x23')](_0x30e89d));if(_0x30e89d[_0xdb50('0x24')]){if(_0x30e89d[_0xdb50('0x24')][_0xdb50('0x25')]===0x1f4){logger[_0xdb50('0x24')](_0xdb50('0x1f'),_0x4d496c,_0x30e89d[_0xdb50('0x24')][_0xdb50('0x26')]);return _0x45162a(_0x30e89d[_0xdb50('0x24')][_0xdb50('0x26')]);}logger[_0xdb50('0x24')](_0xdb50('0x1f'),_0x4d496c,_0x30e89d['error'][_0xdb50('0x26')]);return _0x86c793(_0x30e89d['error']['message']);}else{logger[_0xdb50('0x1e')](_0xdb50('0x1f'),_0x4d496c,_0xdb50('0x20'));_0x86c793(_0x30e89d[_0xdb50('0x27')][_0xdb50('0x26')]);}})['catch'](function(_0x494467){logger[_0xdb50('0x24')](_0xdb50('0x1f'),_0x4d496c,_0x494467);_0x45162a(_0x494467);});});}function respondWithStatusCode(_0x1b9301,_0x29949e){_0x29949e=_0x29949e||0xcc;return function(_0x6e8793){if(_0x6e8793){return _0x1b9301[_0xdb50('0x28')](_0x29949e);}return _0x1b9301[_0xdb50('0x29')](_0x29949e)[_0xdb50('0x2a')]();};}function respondWithResult(_0x404cb2,_0x3c5d8e){_0x3c5d8e=_0x3c5d8e||0xc8;return function(_0x2da780){if(_0x2da780){return _0x404cb2['status'](_0x3c5d8e)[_0xdb50('0x2b')](_0x2da780);}};}function respondWithFilteredResult(_0x404a94,_0x290612){return function(_0x5ef71b){if(_0x5ef71b){var _0x52c54c=_0x5ef71b[_0xdb50('0x2c')],_0x5e2869=_0x290612['offset'],_0xc521f7=_0x290612[_0xdb50('0x2d')]+_0x290612['limit'],_0x418e37;if(_0xc521f7>=_0x52c54c){_0xc521f7=_0x52c54c;_0x418e37=0xc8;}else{_0x418e37=0xce;}_0x404a94[_0xdb50('0x29')](_0x418e37);return _0x404a94['set']('Content-Range',_0x5e2869+'-'+_0xc521f7+'/'+_0x52c54c)[_0xdb50('0x2b')](_0x5ef71b);}return null;};}function patchUpdates(_0x25c04b){return function(_0x450b80){try{jsonpatch[_0xdb50('0x2e')](_0x450b80,_0x25c04b,!![]);}catch(_0xb5a9af){return BPromise['reject'](_0xb5a9af);}return _0x450b80[_0xdb50('0x2f')]();};}function saveUpdates(_0x5751a9,_0x55dc82){return function(_0x4b812c){if(_0x4b812c){return _0x4b812c[_0xdb50('0x30')](_0x5751a9)['then'](function(_0x3efd1b){return _0x3efd1b;});}return null;};}function removeEntity(_0x8fd3c7,_0x3bd0b4){return function(_0x2d89ce){if(_0x2d89ce){return _0x2d89ce[_0xdb50('0x31')]()[_0xdb50('0x1d')](function(){var _0x525f61=_0x2d89ce[_0xdb50('0x32')]({'plain':!![]});var _0x41510d=_0xdb50('0x33');return db[_0xdb50('0x34')]['destroy']({'where':{'type':_0x41510d,'resourceId':_0x525f61['id']}})[_0xdb50('0x1d')](function(){return _0x2d89ce;});})[_0xdb50('0x1d')](function(){_0x8fd3c7[_0xdb50('0x29')](0xcc)[_0xdb50('0x2a')]();});}};}function handleEntityNotFound(_0x498a40,_0x4cecda){return function(_0x18f5cd){if(!_0x18f5cd){_0x498a40[_0xdb50('0x28')](0x194);}return _0x18f5cd;};}function handleError(_0x1f6daf,_0x2f1a35){_0x2f1a35=_0x2f1a35||0x1f4;return function(_0x10aae6){logger[_0xdb50('0x24')](_0x10aae6['stack']);if(_0x10aae6['name']){delete _0x10aae6['name'];}_0x1f6daf['status'](_0x2f1a35)[_0xdb50('0x35')](_0x10aae6);};}exports[_0xdb50('0x36')]=function(_0x1717c8,_0x59652f){var _0x111fa5={},_0xfdc5ea={},_0xf41385={'count':0x0,'rows':[]};var _0x3ad5ae=db[_0xdb50('0x37')][_0xdb50('0x38')];_0xfdc5ea[_0xdb50('0x39')]=_[_0xdb50('0x3a')](_0x3ad5ae);_0xfdc5ea[_0xdb50('0x3b')]=_[_0xdb50('0x3a')](_0x1717c8[_0xdb50('0x3b')]);_0xfdc5ea['filters']=_['intersection'](_0xfdc5ea[_0xdb50('0x39')],_0xfdc5ea[_0xdb50('0x3b')]);_0x111fa5[_0xdb50('0x3c')]=_['intersection'](_0xfdc5ea[_0xdb50('0x39')],qs[_0xdb50('0x3d')](_0x1717c8[_0xdb50('0x3b')]['fields']));_0x111fa5['attributes']=_0x111fa5[_0xdb50('0x3c')]['length']?_0x111fa5['attributes']:_0xfdc5ea[_0xdb50('0x39')];if(!_0x1717c8['query'][_0xdb50('0x3e')](_0xdb50('0x3f'))){_0x111fa5[_0xdb50('0x40')]=qs[_0xdb50('0x40')](_0x1717c8['query']['limit']);_0x111fa5[_0xdb50('0x2d')]=qs['offset'](_0x1717c8[_0xdb50('0x3b')][_0xdb50('0x2d')]);}_0x111fa5['order']=qs[_0xdb50('0x41')](_0x1717c8[_0xdb50('0x3b')][_0xdb50('0x41')]);_0x111fa5['where']=qs[_0xdb50('0x42')](_[_0xdb50('0x43')](_0x1717c8[_0xdb50('0x3b')],_0xfdc5ea['filters']));if(_0x1717c8[_0xdb50('0x3b')][_0xdb50('0x44')]){_0x111fa5[_0xdb50('0x45')]=_[_0xdb50('0x46')](_0x111fa5[_0xdb50('0x45')],{'$or':_[_0xdb50('0x47')](_0x3ad5ae,function(_0x544e9b){if(_0x544e9b[_0xdb50('0x48')][_0xdb50('0x49')]!==_0xdb50('0x4a')){var _0x393b93={};_0x393b93[_0x544e9b[_0xdb50('0x4b')]]={'$like':'%'+_0x1717c8[_0xdb50('0x3b')]['filter']+'%'};return _0x393b93;}})});}_0x111fa5=_['merge']({},_0x111fa5,_0x1717c8[_0xdb50('0x4c')]);var _0x279ce2={'where':_0x111fa5[_0xdb50('0x45')]};return db['Trunk']['count'](_0x279ce2)[_0xdb50('0x1d')](function(_0x438555){_0xf41385[_0xdb50('0x2c')]=_0x438555;if(_0x1717c8[_0xdb50('0x3b')][_0xdb50('0x4d')]){_0x111fa5[_0xdb50('0x4e')]=[{'all':!![]}];}return db[_0xdb50('0x37')]['findAll'](_0x111fa5);})[_0xdb50('0x1d')](function(_0x3335c7){_0xf41385[_0xdb50('0x4f')]=_0x3335c7;return _0xf41385;})[_0xdb50('0x1d')](respondWithFilteredResult(_0x59652f,_0x111fa5))[_0xdb50('0x50')](handleError(_0x59652f,null));};exports[_0xdb50('0x51')]=function(_0x188465,_0x3d4318){var _0x5af55c={'raw':![],'where':{'id':_0x188465[_0xdb50('0x52')]['id']}},_0x1a32b2={};_0x1a32b2[_0xdb50('0x39')]=_[_0xdb50('0x3a')](db[_0xdb50('0x37')]['rawAttributes']);_0x1a32b2[_0xdb50('0x3b')]=_[_0xdb50('0x3a')](_0x188465[_0xdb50('0x3b')]);_0x1a32b2['filters']=_['intersection'](_0x1a32b2['model'],_0x1a32b2['query']);_0x5af55c[_0xdb50('0x3c')]=_[_0xdb50('0x53')](_0x1a32b2[_0xdb50('0x39')],qs['fields'](_0x188465['query'][_0xdb50('0x3d')]));_0x5af55c['attributes']=_0x5af55c['attributes']['length']?_0x5af55c[_0xdb50('0x3c')]:_0x1a32b2[_0xdb50('0x39')];if(_0x188465[_0xdb50('0x3b')][_0xdb50('0x4d')]){_0x5af55c[_0xdb50('0x4e')]=[{'all':!![]}];}_0x5af55c=_[_0xdb50('0x46')]({},_0x5af55c,_0x188465[_0xdb50('0x4c')]);return db[_0xdb50('0x37')]['find'](_0x5af55c)['then'](handleEntityNotFound(_0x3d4318,null))[_0xdb50('0x1d')](respondWithResult(_0x3d4318,null))[_0xdb50('0x50')](handleError(_0x3d4318,null));};exports[_0xdb50('0x54')]=function(_0x250a4a,_0x157dc1){var _0x19051d={'raw':![],'where':{'id':_0x250a4a[_0xdb50('0x52')]['id']}},_0xf1dc2e={};_0xf1dc2e[_0xdb50('0x39')]=_['keys'](db[_0xdb50('0x37')][_0xdb50('0x38')]);_0x19051d[_0xdb50('0x3c')]=_['intersection'](_0xf1dc2e['model'],qs[_0xdb50('0x3d')](_0x250a4a[_0xdb50('0x3b')][_0xdb50('0x3d')]));_0x19051d[_0xdb50('0x3c')]=_0x19051d[_0xdb50('0x3c')]['length']?_0x19051d['attributes']:_0xf1dc2e['model'];if(_0x250a4a[_0xdb50('0x3b')]['includeAll']){_0x19051d[_0xdb50('0x4e')]=[{'all':!![]}];}_0x19051d=_['merge']({},_0x19051d,_0x250a4a[_0xdb50('0x4c')]);return db[_0xdb50('0x37')][_0xdb50('0x55')](_0x19051d)[_0xdb50('0x1d')](handleEntityNotFound(_0x157dc1,null))[_0xdb50('0x1d')](function(_0x38aa2f){if(_0x38aa2f){var _0x7265f6=_0x38aa2f[_0xdb50('0x32')]({'plain':!![]});_0x7265f6=qs['omit'](_0x7265f6,['id',_0xdb50('0x56'),_0xdb50('0x57')]);_0x250a4a['body']=_['omit'](_0x250a4a[_0xdb50('0x58')],['id','createdAt',_0xdb50('0x57')]);return db['Trunk'][_0xdb50('0x59')](_[_0xdb50('0x46')](_0x7265f6,_0x250a4a[_0xdb50('0x58')]),{'include':_0x250a4a[_0xdb50('0x3b')][_0xdb50('0x4d')]?[{'all':!![]}]:undefined})[_0xdb50('0x1d')](function(_0x46763e){var _0x219d47=_0x250a4a['user'][_0xdb50('0x32')]({'plain':!![]});if(!_0x219d47)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x219d47[_0xdb50('0x5a')]===_0xdb50('0x5b')){var _0x2a4637=_0x46763e[_0xdb50('0x32')]({'plain':!![]});var _0x1f6476='Trunks';return db['UserProfileSection']['find']({'where':{'name':_0x1f6476,'userProfileId':_0x219d47['userProfileId']},'raw':!![]})[_0xdb50('0x1d')](function(_0x3ae6c1){if(_0x3ae6c1&&_0x3ae6c1[_0xdb50('0x5c')]===0x0){return db[_0xdb50('0x34')][_0xdb50('0x59')]({'name':_0x2a4637['name'],'resourceId':_0x2a4637['id'],'type':_0x3ae6c1[_0xdb50('0x5d')],'sectionId':_0x3ae6c1['id']},{})[_0xdb50('0x1d')](function(){return _0x46763e;});}else{return _0x46763e;}})['catch'](function(_0x31eb44){logger[_0xdb50('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31eb44);throw _0x31eb44;});}return _0x46763e;});}})['then'](respondWithResult(_0x157dc1,0xc9))[_0xdb50('0x50')](handleError(_0x157dc1,null));};exports[_0xdb50('0x59')]=function(_0x214be2,_0x5bc6e6,_0xc2d10d){var _0x4eb384;return db[_0xdb50('0x37')][_0xdb50('0x59')](_0x214be2[_0xdb50('0x58')],{'raw':!![]})[_0xdb50('0x1d')](function(_0x6d356d){_0x4eb384=_0x6d356d;return db[_0xdb50('0x37')][_0xdb50('0x5e')]({'raw':!![]});})[_0xdb50('0x1d')](function(_0x5617db){var _0x2023e8=fs[_0xdb50('0x5f')](path[_0xdb50('0x60')](config['root'],'server/files/templates/trunk.ejs'),_0xdb50('0x61'));var _0x1f17ed=fs[_0xdb50('0x5f')](path[_0xdb50('0x60')](config[_0xdb50('0x62')],_0xdb50('0x63')),_0xdb50('0x61'));var _0x1c204a=ejs[_0xdb50('0x64')](_0x2023e8,{'trunks':_0x5617db||[]});fs['writeFileSync'](_0xdb50('0x65'),_0x1c204a);if(_0x4eb384[_0xdb50('0x66')]){var _0x4ae1dc=ejs['render'](_0x1f17ed,{'trunks':_0x5617db||[]});fs[_0xdb50('0x67')](_0xdb50('0x68'),_0x4ae1dc);}})[_0xdb50('0x1d')](function(){return respondWithRpcPromise(_0xdb50('0x69'),'create',{'module':_0xdb50('0x6a')});})[_0xdb50('0x1d')](function(){var _0x5d53ef=_0x214be2[_0xdb50('0x5b')][_0xdb50('0x32')]({'plain':!![]});if(!_0x5d53ef)throw new Error(_0xdb50('0x6b'));if(_0x5d53ef[_0xdb50('0x5a')]==='user'){var _0x1ee2b6=_0x4eb384[_0xdb50('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xdb50('0x55')]({'where':{'name':_0xdb50('0x33'),'userProfileId':_0x5d53ef[_0xdb50('0x6c')]},'raw':!![]})['then'](function(_0x14aaeb){if(_0x14aaeb&&_0x14aaeb[_0xdb50('0x5c')]===0x0){return db[_0xdb50('0x34')][_0xdb50('0x59')]({'name':_0x1ee2b6[_0xdb50('0x5d')],'resourceId':_0x1ee2b6['id'],'type':_0x14aaeb[_0xdb50('0x5d')],'sectionId':_0x14aaeb['id']},{})[_0xdb50('0x1d')](function(){return _0x4eb384;});}else{return _0x4eb384;}})[_0xdb50('0x50')](function(_0x461448){logger['error'](_0xdb50('0x6d'),_0x461448);throw _0x461448;});}return _0x4eb384;})[_0xdb50('0x1d')](respondWithResult(_0x5bc6e6,0xc9))['catch'](handleError(_0x5bc6e6,null));};exports['update']=function(_0x36570b,_0x565a68,_0x395620){var _0x4e5275;return db[_0xdb50('0x37')][_0xdb50('0x55')]({'where':{'id':_0x36570b[_0xdb50('0x52')]['id']}})[_0xdb50('0x1d')](handleEntityNotFound(_0x565a68,null))[_0xdb50('0x1d')](saveUpdates(_0x36570b[_0xdb50('0x58')],null))[_0xdb50('0x1d')](function(_0x5c53e8){if(_0x5c53e8){_0x4e5275=_0x5c53e8;return db[_0xdb50('0x37')][_0xdb50('0x5e')]({'raw':!![]});}})[_0xdb50('0x1d')](function(_0x51f037){if(_0x51f037){var _0x275f31=fs[_0xdb50('0x5f')](path[_0xdb50('0x60')](config[_0xdb50('0x62')],_0xdb50('0x6e')),_0xdb50('0x61'));var _0x407829=fs[_0xdb50('0x5f')](path['join'](config[_0xdb50('0x62')],'server/files/templates/registry.ejs'),_0xdb50('0x61'));var _0xcbc33f=ejs[_0xdb50('0x64')](_0x275f31,{'trunks':_0x51f037||[]});fs[_0xdb50('0x67')](_0xdb50('0x65'),_0xcbc33f);var _0x5edd50=ejs[_0xdb50('0x64')](_0x407829,{'trunks':_0x51f037||[]});fs[_0xdb50('0x67')](_0xdb50('0x68'),_0x5edd50);return respondWithRpcPromise(_0xdb50('0x69'),_0xdb50('0x30'),{'module':'chan_sip.so'});}return null;})[_0xdb50('0x1d')](function(_0x3c7403){if(_0x3c7403){return _0x4e5275;}})[_0xdb50('0x1d')](respondWithResult(_0x565a68,null))[_0xdb50('0x50')](handleError(_0x565a68,null));};exports['destroy']=function(_0x42db03,_0x5802e5,_0x181a5e){var _0x445202;return db['Trunk'][_0xdb50('0x55')]({'where':{'id':_0x42db03[_0xdb50('0x52')]['id']}})[_0xdb50('0x1d')](handleEntityNotFound(_0x5802e5,null))[_0xdb50('0x1d')](removeEntity(_0x5802e5,null))[_0xdb50('0x1d')](function(){return db[_0xdb50('0x37')][_0xdb50('0x5e')]({'raw':!![]});})[_0xdb50('0x1d')](function(_0x47053e){var _0x1f9fa2=fs[_0xdb50('0x5f')](path[_0xdb50('0x60')](config[_0xdb50('0x62')],'server/files/templates/trunk.ejs'),_0xdb50('0x61'));var _0x26b113=fs[_0xdb50('0x5f')](path[_0xdb50('0x60')](config[_0xdb50('0x62')],_0xdb50('0x63')),'utf8');var _0x99aa0a=ejs[_0xdb50('0x64')](_0x1f9fa2,{'trunks':_0x47053e});var _0x4f9beb=ejs['render'](_0x26b113,{'trunks':_0x47053e});fs[_0xdb50('0x67')](_0xdb50('0x65'),_0x99aa0a);fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x4f9beb);return respondWithRpcPromise('Reload',_0xdb50('0x31'),{'module':_0xdb50('0x6a')});})[_0xdb50('0x50')](handleError(_0x5802e5,null));}; \ No newline at end of file +var _0x5484=['field','options','include','findAll','rows','show','keys','includeAll','find','params','length','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','UserProfileSection','/etc/asterisk/sip_xcally_trunks.conf','Reload','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','Trunks','UserProfileResource','stack','name','send','Trunk','rawAttributes','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','type','key','VIRTUAL'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x5484,0x176));var _0x4548=function(_0x5eb0ba,_0x46c21f){_0x5eb0ba=_0x5eb0ba-0x0;var _0x57c7ed=_0x5484[_0x5eb0ba];return _0x57c7ed;};'use strict';var pdf=require(_0x4548('0x0'));var emlformat=require(_0x4548('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4548('0x2'));var jsonpatch=require(_0x4548('0x3'));var rp=require('request-promise');var moment=require(_0x4548('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4548('0x5'));var util=require(_0x4548('0x6'));var path=require(_0x4548('0x7'));var sox=require('sox');var csv=require(_0x4548('0x8'));var ejs=require(_0x4548('0x9'));var fs=require('fs');var _=require(_0x4548('0xa'));var squel=require(_0x4548('0xb'));var crypto=require(_0x4548('0xc'));var jsforce=require(_0x4548('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4548('0x8'));var querystring=require(_0x4548('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4548('0xf'));var qs=require(_0x4548('0x10'));var hardwareService=require(_0x4548('0x11'));var logger=require('../../config/logger')(_0x4548('0x12'));var utils=require(_0x4548('0x13'));var config=require(_0x4548('0x14'));var db=require(_0x4548('0x15'))['db'];var jayson=require(_0x4548('0x16'));var client=jayson[_0x4548('0x17')][_0x4548('0x18')]({'port':0x232a});function checkPasswordPattern(_0xcf7670,_0x3144e7,_0x13b1b0){if(_0x13b1b0){var _0x283feb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x283feb[_0x4548('0x19')](_0x3144e7)){return _0xcf7670;}else{throw new Error(_0x4548('0x1a'));}}else{return _0xcf7670;}}function respondWithRpcPromise(_0x4971f8,_0x3676ee,_0x2e5c9e,_0x36cdfe){return new BPromise(function(_0x2f8a0a,_0x5bd8a3){var _0x56b6fa=_0x36cdfe||client;return _0x56b6fa['request'](_0x4971f8,_0x2e5c9e)[_0x4548('0x1b')](function(_0x3e2ec5){logger[_0x4548('0x1c')](_0x4548('0x1d'),_0x3676ee,_0x4548('0x1e'));logger[_0x4548('0x1f')](_0x4548('0x20'),_0x3676ee,_0x4548('0x1e'),JSON[_0x4548('0x21')](_0x3e2ec5));if(_0x3e2ec5[_0x4548('0x22')]){if(_0x3e2ec5[_0x4548('0x22')][_0x4548('0x23')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x3676ee,_0x3e2ec5[_0x4548('0x22')][_0x4548('0x24')]);return _0x5bd8a3(_0x3e2ec5[_0x4548('0x22')]['message']);}logger[_0x4548('0x22')]('Trunk,\x20%s,\x20%s',_0x3676ee,_0x3e2ec5[_0x4548('0x22')][_0x4548('0x24')]);return _0x2f8a0a(_0x3e2ec5[_0x4548('0x22')][_0x4548('0x24')]);}else{logger[_0x4548('0x1c')](_0x4548('0x1d'),_0x3676ee,_0x4548('0x1e'));_0x2f8a0a(_0x3e2ec5[_0x4548('0x25')][_0x4548('0x24')]);}})[_0x4548('0x26')](function(_0x5f4a1b){logger[_0x4548('0x22')](_0x4548('0x1d'),_0x3676ee,_0x5f4a1b);_0x5bd8a3(_0x5f4a1b);});});}function respondWithStatusCode(_0x30ac8f,_0x9c1613){_0x9c1613=_0x9c1613||0xcc;return function(_0x40b457){if(_0x40b457){return _0x30ac8f[_0x4548('0x27')](_0x9c1613);}return _0x30ac8f['status'](_0x9c1613)[_0x4548('0x28')]();};}function respondWithResult(_0x176d64,_0x47e0f9){_0x47e0f9=_0x47e0f9||0xc8;return function(_0x1aaee7){if(_0x1aaee7){return _0x176d64[_0x4548('0x29')](_0x47e0f9)[_0x4548('0x2a')](_0x1aaee7);}};}function respondWithFilteredResult(_0x1efc9f,_0x54c8eb){return function(_0x853f88){if(_0x853f88){var _0x43874a=_0x853f88[_0x4548('0x2b')],_0x38b406=_0x54c8eb[_0x4548('0x2c')],_0x262dfe=_0x54c8eb[_0x4548('0x2c')]+_0x54c8eb[_0x4548('0x2d')],_0x3d447e;if(_0x262dfe>=_0x43874a){_0x262dfe=_0x43874a;_0x3d447e=0xc8;}else{_0x3d447e=0xce;}_0x1efc9f[_0x4548('0x29')](_0x3d447e);return _0x1efc9f[_0x4548('0x2e')](_0x4548('0x2f'),_0x38b406+'-'+_0x262dfe+'/'+_0x43874a)[_0x4548('0x2a')](_0x853f88);}return null;};}function patchUpdates(_0x48cac8){return function(_0x266f94){try{jsonpatch[_0x4548('0x30')](_0x266f94,_0x48cac8,!![]);}catch(_0x273c5e){return BPromise[_0x4548('0x31')](_0x273c5e);}return _0x266f94[_0x4548('0x32')]();};}function saveUpdates(_0x42f3ce,_0x1174bf){return function(_0x39ca66){if(_0x39ca66){return _0x39ca66[_0x4548('0x33')](_0x42f3ce)[_0x4548('0x1b')](function(_0x1b332c){return _0x1b332c;});}return null;};}function removeEntity(_0x3a114f,_0x546bf0){return function(_0x1c2d49){if(_0x1c2d49){return _0x1c2d49[_0x4548('0x34')]()[_0x4548('0x1b')](function(){var _0x5efaa5=_0x1c2d49[_0x4548('0x35')]({'plain':!![]});var _0x29e194=_0x4548('0x36');return db[_0x4548('0x37')][_0x4548('0x34')]({'where':{'type':_0x29e194,'resourceId':_0x5efaa5['id']}})[_0x4548('0x1b')](function(){return _0x1c2d49;});})[_0x4548('0x1b')](function(){_0x3a114f['status'](0xcc)[_0x4548('0x28')]();});}};}function handleEntityNotFound(_0x4597a3,_0x3dc8aa){return function(_0x5e145f){if(!_0x5e145f){_0x4597a3[_0x4548('0x27')](0x194);}return _0x5e145f;};}function handleError(_0x325d17,_0x24a352){_0x24a352=_0x24a352||0x1f4;return function(_0x5cc23f){logger[_0x4548('0x22')](_0x5cc23f[_0x4548('0x38')]);if(_0x5cc23f[_0x4548('0x39')]){delete _0x5cc23f[_0x4548('0x39')];}_0x325d17[_0x4548('0x29')](_0x24a352)[_0x4548('0x3a')](_0x5cc23f);};}exports['index']=function(_0x44363d,_0x2b43a4){var _0x3a30e2={},_0x94a78d={},_0x529fba={'count':0x0,'rows':[]};var _0x122eb6=db[_0x4548('0x3b')][_0x4548('0x3c')];_0x94a78d[_0x4548('0x3d')]=_['keys'](_0x122eb6);_0x94a78d[_0x4548('0x3e')]=_['keys'](_0x44363d[_0x4548('0x3e')]);_0x94a78d[_0x4548('0x3f')]=_[_0x4548('0x40')](_0x94a78d[_0x4548('0x3d')],_0x94a78d[_0x4548('0x3e')]);_0x3a30e2[_0x4548('0x41')]=_[_0x4548('0x40')](_0x94a78d[_0x4548('0x3d')],qs[_0x4548('0x42')](_0x44363d[_0x4548('0x3e')][_0x4548('0x42')]));_0x3a30e2[_0x4548('0x41')]=_0x3a30e2[_0x4548('0x41')]['length']?_0x3a30e2[_0x4548('0x41')]:_0x94a78d['model'];if(!_0x44363d[_0x4548('0x3e')][_0x4548('0x43')](_0x4548('0x44'))){_0x3a30e2[_0x4548('0x2d')]=qs[_0x4548('0x2d')](_0x44363d['query'][_0x4548('0x2d')]);_0x3a30e2[_0x4548('0x2c')]=qs[_0x4548('0x2c')](_0x44363d[_0x4548('0x3e')][_0x4548('0x2c')]);}_0x3a30e2[_0x4548('0x45')]=qs[_0x4548('0x46')](_0x44363d[_0x4548('0x3e')]['sort']);_0x3a30e2['where']=qs[_0x4548('0x3f')](_['pick'](_0x44363d[_0x4548('0x3e')],_0x94a78d[_0x4548('0x3f')]));if(_0x44363d[_0x4548('0x3e')][_0x4548('0x47')]){_0x3a30e2[_0x4548('0x48')]=_[_0x4548('0x49')](_0x3a30e2[_0x4548('0x48')],{'$or':_[_0x4548('0x4a')](_0x122eb6,function(_0xe8fab0){if(_0xe8fab0[_0x4548('0x4b')][_0x4548('0x4c')]!==_0x4548('0x4d')){var _0x8a4640={};_0x8a4640[_0xe8fab0[_0x4548('0x4e')]]={'$like':'%'+_0x44363d[_0x4548('0x3e')][_0x4548('0x47')]+'%'};return _0x8a4640;}})});}_0x3a30e2=_['merge']({},_0x3a30e2,_0x44363d[_0x4548('0x4f')]);var _0x54f0bc={'where':_0x3a30e2[_0x4548('0x48')]};return db[_0x4548('0x3b')]['count'](_0x54f0bc)[_0x4548('0x1b')](function(_0x2c5545){_0x529fba['count']=_0x2c5545;if(_0x44363d['query']['includeAll']){_0x3a30e2[_0x4548('0x50')]=[{'all':!![]}];}return db[_0x4548('0x3b')][_0x4548('0x51')](_0x3a30e2);})['then'](function(_0x2c56ac){_0x529fba[_0x4548('0x52')]=_0x2c56ac;return _0x529fba;})[_0x4548('0x1b')](respondWithFilteredResult(_0x2b43a4,_0x3a30e2))[_0x4548('0x26')](handleError(_0x2b43a4,null));};exports[_0x4548('0x53')]=function(_0x3da917,_0x28499b){var _0x31e334={'raw':![],'where':{'id':_0x3da917['params']['id']}},_0x52f4fb={};_0x52f4fb[_0x4548('0x3d')]=_[_0x4548('0x54')](db[_0x4548('0x3b')][_0x4548('0x3c')]);_0x52f4fb[_0x4548('0x3e')]=_[_0x4548('0x54')](_0x3da917[_0x4548('0x3e')]);_0x52f4fb[_0x4548('0x3f')]=_[_0x4548('0x40')](_0x52f4fb[_0x4548('0x3d')],_0x52f4fb[_0x4548('0x3e')]);_0x31e334[_0x4548('0x41')]=_[_0x4548('0x40')](_0x52f4fb[_0x4548('0x3d')],qs['fields'](_0x3da917[_0x4548('0x3e')][_0x4548('0x42')]));_0x31e334['attributes']=_0x31e334[_0x4548('0x41')]['length']?_0x31e334['attributes']:_0x52f4fb[_0x4548('0x3d')];if(_0x3da917['query'][_0x4548('0x55')]){_0x31e334['include']=[{'all':!![]}];}_0x31e334=_[_0x4548('0x49')]({},_0x31e334,_0x3da917[_0x4548('0x4f')]);return db['Trunk'][_0x4548('0x56')](_0x31e334)[_0x4548('0x1b')](handleEntityNotFound(_0x28499b,null))[_0x4548('0x1b')](respondWithResult(_0x28499b,null))[_0x4548('0x26')](handleError(_0x28499b,null));};exports['clone']=function(_0x31229f,_0x2a3bec){var _0x4514b9={'raw':![],'where':{'id':_0x31229f[_0x4548('0x57')]['id']}},_0x2581b3={};_0x2581b3[_0x4548('0x3d')]=_[_0x4548('0x54')](db[_0x4548('0x3b')][_0x4548('0x3c')]);_0x4514b9[_0x4548('0x41')]=_[_0x4548('0x40')](_0x2581b3[_0x4548('0x3d')],qs[_0x4548('0x42')](_0x31229f[_0x4548('0x3e')]['fields']));_0x4514b9[_0x4548('0x41')]=_0x4514b9[_0x4548('0x41')][_0x4548('0x58')]?_0x4514b9[_0x4548('0x41')]:_0x2581b3['model'];if(_0x31229f[_0x4548('0x3e')]['includeAll']){_0x4514b9[_0x4548('0x50')]=[{'all':!![]}];}_0x4514b9=_[_0x4548('0x49')]({},_0x4514b9,_0x31229f[_0x4548('0x4f')]);return db[_0x4548('0x3b')]['find'](_0x4514b9)['then'](handleEntityNotFound(_0x2a3bec,null))['then'](function(_0x14ecd7){if(_0x14ecd7){var _0x54ca64=_0x14ecd7[_0x4548('0x35')]({'plain':!![]});_0x54ca64=qs[_0x4548('0x59')](_0x54ca64,['id',_0x4548('0x5a'),_0x4548('0x5b')]);_0x31229f[_0x4548('0x5c')]=_['omit'](_0x31229f[_0x4548('0x5c')],['id','createdAt','updatedAt']);return db[_0x4548('0x3b')][_0x4548('0x5d')](_[_0x4548('0x49')](_0x54ca64,_0x31229f[_0x4548('0x5c')]),{'include':_0x31229f[_0x4548('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0x4548('0x1b')](function(_0x4058c7){var _0x37c63e=_0x31229f[_0x4548('0x5e')][_0x4548('0x35')]({'plain':!![]});if(!_0x37c63e)throw new Error(_0x4548('0x5f'));if(_0x37c63e[_0x4548('0x60')]===_0x4548('0x5e')){var _0x38fc61=_0x4058c7['get']({'plain':!![]});var _0x2b3e18=_0x4548('0x36');return db['UserProfileSection'][_0x4548('0x56')]({'where':{'name':_0x2b3e18,'userProfileId':_0x37c63e[_0x4548('0x61')]},'raw':!![]})[_0x4548('0x1b')](function(_0x1f3168){if(_0x1f3168&&_0x1f3168[_0x4548('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x38fc61[_0x4548('0x39')],'resourceId':_0x38fc61['id'],'type':_0x1f3168[_0x4548('0x39')],'sectionId':_0x1f3168['id']},{})['then'](function(){return _0x4058c7;});}else{return _0x4058c7;}})[_0x4548('0x26')](function(_0x374b34){logger[_0x4548('0x22')](_0x4548('0x63'),_0x374b34);throw _0x374b34;});}return _0x4058c7;});}})[_0x4548('0x1b')](respondWithResult(_0x2a3bec,0xc9))[_0x4548('0x26')](handleError(_0x2a3bec,null));};exports[_0x4548('0x5d')]=function(_0x69afcb,_0x36d7f5,_0x413089){var _0x32aa10;return db[_0x4548('0x3b')][_0x4548('0x5d')](_0x69afcb[_0x4548('0x5c')],{'raw':!![]})[_0x4548('0x1b')](function(_0x233642){_0x32aa10=_0x233642;return db['Trunk']['findAll']({'raw':!![]});})['then'](function(_0x572552){var _0x5c1a3c=fs[_0x4548('0x64')](path[_0x4548('0x65')](config[_0x4548('0x66')],_0x4548('0x67')),_0x4548('0x68'));var _0x434020=fs[_0x4548('0x64')](path[_0x4548('0x65')](config[_0x4548('0x66')],_0x4548('0x69')),_0x4548('0x68'));var _0x13dcd9=ejs[_0x4548('0x6a')](_0x5c1a3c,{'trunks':_0x572552||[]});fs[_0x4548('0x6b')]('/etc/asterisk/sip_xcally_trunks.conf',_0x13dcd9);if(_0x32aa10['registry']){var _0x718fe7=ejs[_0x4548('0x6a')](_0x434020,{'trunks':_0x572552||[]});fs['writeFileSync'](_0x4548('0x6c'),_0x718fe7);}})[_0x4548('0x1b')](function(){return respondWithRpcPromise('Reload',_0x4548('0x5d'),{'module':_0x4548('0x6d')});})[_0x4548('0x1b')](function(){var _0x3b3fdf=_0x69afcb[_0x4548('0x5e')]['get']({'plain':!![]});if(!_0x3b3fdf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b3fdf['role']===_0x4548('0x5e')){var _0x46b3ca=_0x32aa10[_0x4548('0x35')]({'plain':!![]});return db[_0x4548('0x6e')][_0x4548('0x56')]({'where':{'name':_0x4548('0x36'),'userProfileId':_0x3b3fdf[_0x4548('0x61')]},'raw':!![]})[_0x4548('0x1b')](function(_0x3302fc){if(_0x3302fc&&_0x3302fc[_0x4548('0x62')]===0x0){return db[_0x4548('0x37')]['create']({'name':_0x46b3ca['name'],'resourceId':_0x46b3ca['id'],'type':_0x3302fc[_0x4548('0x39')],'sectionId':_0x3302fc['id']},{})[_0x4548('0x1b')](function(){return _0x32aa10;});}else{return _0x32aa10;}})[_0x4548('0x26')](function(_0x1083ce){logger[_0x4548('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1083ce);throw _0x1083ce;});}return _0x32aa10;})['then'](respondWithResult(_0x36d7f5,0xc9))[_0x4548('0x26')](handleError(_0x36d7f5,null));};exports['update']=function(_0x204b50,_0x13a4a9,_0x4f8c4a){var _0x2fe046;return db['Trunk'][_0x4548('0x56')]({'where':{'id':_0x204b50['params']['id']}})['then'](handleEntityNotFound(_0x13a4a9,null))[_0x4548('0x1b')](saveUpdates(_0x204b50[_0x4548('0x5c')],null))['then'](function(_0x51d1d7){if(_0x51d1d7){_0x2fe046=_0x51d1d7;return db[_0x4548('0x3b')][_0x4548('0x51')]({'raw':!![]});}})[_0x4548('0x1b')](function(_0x219ce0){if(_0x219ce0){var _0x1baabb=fs[_0x4548('0x64')](path[_0x4548('0x65')](config[_0x4548('0x66')],_0x4548('0x67')),'utf8');var _0x4856aa=fs[_0x4548('0x64')](path[_0x4548('0x65')](config[_0x4548('0x66')],_0x4548('0x69')),_0x4548('0x68'));var _0x3f748c=ejs[_0x4548('0x6a')](_0x1baabb,{'trunks':_0x219ce0||[]});fs[_0x4548('0x6b')](_0x4548('0x6f'),_0x3f748c);var _0x20069c=ejs['render'](_0x4856aa,{'trunks':_0x219ce0||[]});fs[_0x4548('0x6b')](_0x4548('0x6c'),_0x20069c);return respondWithRpcPromise('Reload',_0x4548('0x33'),{'module':'chan_sip.so'});}return null;})[_0x4548('0x1b')](function(_0x2c338e){if(_0x2c338e){return _0x2fe046;}})[_0x4548('0x1b')](respondWithResult(_0x13a4a9,null))[_0x4548('0x26')](handleError(_0x13a4a9,null));};exports[_0x4548('0x34')]=function(_0x233e78,_0x167ee5,_0x325ec3){var _0x58180d;return db['Trunk']['find']({'where':{'id':_0x233e78[_0x4548('0x57')]['id']}})[_0x4548('0x1b')](handleEntityNotFound(_0x167ee5,null))[_0x4548('0x1b')](removeEntity(_0x167ee5,null))[_0x4548('0x1b')](function(){return db[_0x4548('0x3b')][_0x4548('0x51')]({'raw':!![]});})[_0x4548('0x1b')](function(_0x596b2d){var _0x10e288=fs['readFileSync'](path[_0x4548('0x65')](config['root'],_0x4548('0x67')),_0x4548('0x68'));var _0x1282fa=fs[_0x4548('0x64')](path[_0x4548('0x65')](config['root'],'server/files/templates/registry.ejs'),_0x4548('0x68'));var _0x323fdf=ejs[_0x4548('0x6a')](_0x10e288,{'trunks':_0x596b2d});var _0x312332=ejs[_0x4548('0x6a')](_0x1282fa,{'trunks':_0x596b2d});fs[_0x4548('0x6b')](_0x4548('0x6f'),_0x323fdf);fs[_0x4548('0x6b')]('/etc/asterisk/sip_xcally_registers.conf',_0x312332);return respondWithRpcPromise(_0x4548('0x70'),_0x4548('0x34'),{'module':_0x4548('0x6d')});})['catch'](handleError(_0x167ee5,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 8138a87..c42d6f8 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 _0xc5c4=['exports','define','Trunk','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./trunk.attributes'];(function(_0x1ddd1f,_0x1e47d6){var _0x4b25da=function(_0x4b150b){while(--_0x4b150b){_0x1ddd1f['push'](_0x1ddd1f['shift']());}};_0x4b25da(++_0x1e47d6);}(_0xc5c4,0x189));var _0x4c5c=function(_0x29fcc,_0x3e23ba){_0x29fcc=_0x29fcc-0x0;var _0x3e6e13=_0xc5c4[_0x29fcc];return _0x3e6e13;};'use strict';var _=require(_0x4c5c('0x0'));var util=require(_0x4c5c('0x1'));var logger=require(_0x4c5c('0x2'))(_0x4c5c('0x3'));var moment=require(_0x4c5c('0x4'));var BPromise=require(_0x4c5c('0x5'));var rp=require(_0x4c5c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4c5c('0x7'));var config=require(_0x4c5c('0x8'));var attributes=require(_0x4c5c('0x9'));module[_0x4c5c('0xa')]=function(_0x3442d2,_0xb4fd63){return _0x3442d2[_0x4c5c('0xb')](_0x4c5c('0xc'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2c1=['rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x4ba5aa,_0x136419){var _0x2bc730=function(_0x65e600){while(--_0x65e600){_0x4ba5aa['push'](_0x4ba5aa['shift']());}};_0x2bc730(++_0x136419);}(_0xb2c1,0x166));var _0x1b2c=function(_0x3efc2b,_0x30e89e){_0x3efc2b=_0x3efc2b-0x0;var _0x143578=_0xb2c1[_0x3efc2b];return _0x143578;};'use strict';var _=require(_0x1b2c('0x0'));var util=require(_0x1b2c('0x1'));var logger=require(_0x1b2c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1b2c('0x3'));var rp=require(_0x1b2c('0x4'));var fs=require('fs');var path=require(_0x1b2c('0x5'));var rimraf=require(_0x1b2c('0x6'));var config=require(_0x1b2c('0x7'));var attributes=require(_0x1b2c('0x8'));module[_0x1b2c('0x9')]=function(_0xcd7b69,_0x5688da){return _0xcd7b69[_0x1b2c('0xa')](_0x1b2c('0xb'),attributes,{'tableName':_0x1b2c('0xc'),'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 9262b08..ad3ea4b 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 _0x8603=['result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowTrunk','debug','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x3ce3ff,_0x3a752c){var _0x34a830=function(_0x52e4d1){while(--_0x52e4d1){_0x3ce3ff['push'](_0x3ce3ff['shift']());}};_0x34a830(++_0x3a752c);}(_0x8603,0x190));var _0x3860=function(_0x2033d9,_0x16483a){_0x2033d9=_0x2033d9-0x0;var _0x304f66=_0x8603[_0x2033d9];return _0x304f66;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1eca44,_0xd3ce26,_0x472bf2){return new BPromise(function(_0x4aba10,_0x5c7350){return client['request'](_0x1eca44,_0x472bf2)[_0x3860('0x9')](function(_0x441dc4){logger['info'](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));logger['debug'](_0x3860('0xc'),_0xd3ce26,_0x3860('0xb'),JSON['stringify'](_0x441dc4));if(_0x441dc4[_0x3860('0xd')]){if(_0x441dc4[_0x3860('0xd')]['code']===0x1f4){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x5c7350(_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);}logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x4aba10(_0x441dc4['error'][_0x3860('0xe')]);}else{logger[_0x3860('0xf')](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));_0x4aba10(_0x441dc4[_0x3860('0x10')][_0x3860('0xe')]);}})[_0x3860('0x11')](function(_0x378305){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x378305);_0x5c7350(_0x378305);});});}exports[_0x3860('0x12')]=function(_0x45b799){var _0x4b6b15=this;return new Promise(function(_0x4863bd,_0x373b06){return db[_0x3860('0x13')][_0x3860('0x14')]({'raw':_0x45b799['options']?_0x45b799[_0x3860('0x15')][_0x3860('0x16')]===undefined?!![]:![]:!![],'where':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x17')]||null:null,'attributes':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x18')]||null:null,'limit':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x19')]||null:null,'include':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x1a')]?_[_0x3860('0x1b')](_0x45b799['options'][_0x3860('0x1a')],function(_0x133093){return{'model':db[_0x133093[_0x3860('0x1c')]],'as':_0x133093['as'],'attributes':_0x133093[_0x3860('0x18')],'include':_0x133093[_0x3860('0x1a')]?_['map'](_0x133093[_0x3860('0x1a')],function(_0x568515){return{'model':db[_0x568515['model']],'as':_0x568515['as'],'attributes':_0x568515[_0x3860('0x18')],'include':_0x568515[_0x3860('0x1a')]?_['map'](_0x568515['include'],function(_0x5f42d5){return{'model':db[_0x5f42d5[_0x3860('0x1c')]],'as':_0x5f42d5['as'],'attributes':_0x5f42d5[_0x3860('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3860('0x9')](function(_0x371f3a){logger[_0x3860('0xf')](_0x3860('0x12'),_0x45b799);logger['debug']('GetTrunk',_0x45b799,JSON[_0x3860('0x1d')](_0x371f3a));_0x4863bd(_0x371f3a);})[_0x3860('0x11')](function(_0x5a9af2){logger[_0x3860('0xd')](_0x3860('0x12'),_0x5a9af2[_0x3860('0xe')],_0x45b799);_0x373b06(_0x4b6b15[_0x3860('0xd')](0x1f4,_0x5a9af2[_0x3860('0xe')]));});});};exports['ShowTrunk']=function(_0x36ae2b){var _0xf624ba=this;return new Promise(function(_0x367b14,_0x4bd90c){return db[_0x3860('0x13')]['find']({'raw':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b['options'][_0x3860('0x16')]===undefined?!![]:![]:!![],'where':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b[_0x3860('0x15')]['where']||null:null,'attributes':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b[_0x3860('0x15')]['attributes']||null:null,'include':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b['options'][_0x3860('0x1a')]?_[_0x3860('0x1b')](_0x36ae2b[_0x3860('0x15')][_0x3860('0x1a')],function(_0x30dc2a){return{'model':db[_0x30dc2a[_0x3860('0x1c')]],'as':_0x30dc2a['as'],'attributes':_0x30dc2a[_0x3860('0x18')],'include':_0x30dc2a['include']?_[_0x3860('0x1b')](_0x30dc2a[_0x3860('0x1a')],function(_0x4d62e9){return{'model':db[_0x4d62e9[_0x3860('0x1c')]],'as':_0x4d62e9['as'],'attributes':_0x4d62e9[_0x3860('0x18')],'include':_0x4d62e9[_0x3860('0x1a')]?_['map'](_0x4d62e9['include'],function(_0x285b1b){return{'model':db[_0x285b1b[_0x3860('0x1c')]],'as':_0x285b1b['as'],'attributes':_0x285b1b[_0x3860('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3860('0x9')](function(_0x59271f){logger['info'](_0x3860('0x1e'),_0x36ae2b);logger[_0x3860('0x1f')](_0x3860('0x1e'),_0x36ae2b,JSON[_0x3860('0x1d')](_0x59271f));_0x367b14(_0x59271f);})[_0x3860('0x11')](function(_0x4df2a9){logger[_0x3860('0xd')](_0x3860('0x1e'),_0x4df2a9['message'],_0x36ae2b);_0x4bd90c(_0xf624ba['error'](0x1f4,_0x4df2a9[_0x3860('0xe')]));});});}; \ No newline at end of file +var _0x9ffd=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Trunk,\x20%s,\x20%s','info','catch','GetTrunk','Trunk','findAll','options','raw','include','map','model','attributes','where','ShowTrunk'];(function(_0x2ac744,_0x501af6){var _0x3c866d=function(_0x336c5e){while(--_0x336c5e){_0x2ac744['push'](_0x2ac744['shift']());}};_0x3c866d(++_0x501af6);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x4dc8e1,_0x36b86d){_0x4dc8e1=_0x4dc8e1-0x0;var _0x71546c=_0x9ffd[_0x4dc8e1];return _0x71546c;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('Trunk,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('Trunk,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('Trunk,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});}exports[_0xd9ff('0x17')]=function(_0x3afd19){var _0x5f45c4=this;return new Promise(function(_0x2d4df1,_0x3ccf15){return db[_0xd9ff('0x18')][_0xd9ff('0x19')]({'raw':_0x3afd19[_0xd9ff('0x1a')]?_0x3afd19[_0xd9ff('0x1a')][_0xd9ff('0x1b')]===undefined?!![]:![]:!![],'where':_0x3afd19[_0xd9ff('0x1a')]?_0x3afd19['options']['where']||null:null,'attributes':_0x3afd19[_0xd9ff('0x1a')]?_0x3afd19[_0xd9ff('0x1a')]['attributes']||null:null,'limit':_0x3afd19['options']?_0x3afd19['options']['limit']||null:null,'include':_0x3afd19[_0xd9ff('0x1a')]?_0x3afd19['options'][_0xd9ff('0x1c')]?_[_0xd9ff('0x1d')](_0x3afd19[_0xd9ff('0x1a')][_0xd9ff('0x1c')],function(_0x278b66){return{'model':db[_0x278b66[_0xd9ff('0x1e')]],'as':_0x278b66['as'],'attributes':_0x278b66['attributes'],'include':_0x278b66['include']?_[_0xd9ff('0x1d')](_0x278b66['include'],function(_0x3ca906){return{'model':db[_0x3ca906['model']],'as':_0x3ca906['as'],'attributes':_0x3ca906[_0xd9ff('0x1f')],'include':_0x3ca906['include']?_[_0xd9ff('0x1d')](_0x3ca906[_0xd9ff('0x1c')],function(_0x2138b4){return{'model':db[_0x2138b4[_0xd9ff('0x1e')]],'as':_0x2138b4['as'],'attributes':_0x2138b4['attributes']};}):[]};}):[]};}):[]:[]})[_0xd9ff('0xc')](function(_0xe11f88){logger[_0xd9ff('0x15')](_0xd9ff('0x17'),_0x3afd19);logger['debug'](_0xd9ff('0x17'),_0x3afd19,JSON[_0xd9ff('0x10')](_0xe11f88));_0x2d4df1(_0xe11f88);})[_0xd9ff('0x16')](function(_0x45fb63){logger[_0xd9ff('0x11')](_0xd9ff('0x17'),_0x45fb63[_0xd9ff('0x13')],_0x3afd19);_0x3ccf15(_0x5f45c4[_0xd9ff('0x11')](0x1f4,_0x45fb63[_0xd9ff('0x13')]));});});};exports['ShowTrunk']=function(_0xcea5db){var _0x4ba2be=this;return new Promise(function(_0x1d55fd,_0x29c532){return db[_0xd9ff('0x18')]['find']({'raw':_0xcea5db[_0xd9ff('0x1a')]?_0xcea5db[_0xd9ff('0x1a')][_0xd9ff('0x1b')]===undefined?!![]:![]:!![],'where':_0xcea5db[_0xd9ff('0x1a')]?_0xcea5db['options'][_0xd9ff('0x20')]||null:null,'attributes':_0xcea5db['options']?_0xcea5db[_0xd9ff('0x1a')][_0xd9ff('0x1f')]||null:null,'include':_0xcea5db[_0xd9ff('0x1a')]?_0xcea5db[_0xd9ff('0x1a')][_0xd9ff('0x1c')]?_[_0xd9ff('0x1d')](_0xcea5db[_0xd9ff('0x1a')][_0xd9ff('0x1c')],function(_0x36749c){return{'model':db[_0x36749c[_0xd9ff('0x1e')]],'as':_0x36749c['as'],'attributes':_0x36749c[_0xd9ff('0x1f')],'include':_0x36749c[_0xd9ff('0x1c')]?_[_0xd9ff('0x1d')](_0x36749c[_0xd9ff('0x1c')],function(_0x498025){return{'model':db[_0x498025[_0xd9ff('0x1e')]],'as':_0x498025['as'],'attributes':_0x498025[_0xd9ff('0x1f')],'include':_0x498025[_0xd9ff('0x1c')]?_['map'](_0x498025[_0xd9ff('0x1c')],function(_0x5e3ff9){return{'model':db[_0x5e3ff9[_0xd9ff('0x1e')]],'as':_0x5e3ff9['as'],'attributes':_0x5e3ff9['attributes']};}):[]};}):[]};}):[]:[]})[_0xd9ff('0xc')](function(_0x5db498){logger[_0xd9ff('0x15')](_0xd9ff('0x21'),_0xcea5db);logger[_0xd9ff('0xd')]('ShowTrunk',_0xcea5db,JSON['stringify'](_0x5db498));_0x1d55fd(_0x5db498);})['catch'](function(_0x7ac3d1){logger[_0xd9ff('0x11')](_0xd9ff('0x21'),_0x7ac3d1[_0xd9ff('0x13')],_0xcea5db);_0x29c532(_0x4ba2be[_0xd9ff('0x11')](0x1f4,_0x7ac3d1[_0xd9ff('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index a333da0..dad189b 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 _0x6f08=['single','file','addAvatar','login','/:id/logout','logout','/:id/pause','pause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addSquareProjects','update','/:id/password','changePassword','delete','removeQueues','removeTeams','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getAvatar','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/teams','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/create_many','bulkCreate','create','addQueues','join','root','server/files/images/','%s-%s','now','originalname','/:id/avatar'];(function(_0x488ca1,_0xf6858e){var _0x4dd0a4=function(_0x40fb65){while(--_0x40fb65){_0x488ca1['push'](_0x488ca1['shift']());}};_0x4dd0a4(++_0xf6858e);}(_0x6f08,0x16b));var _0x86f0=function(_0x5dff25,_0x529b01){_0x5dff25=_0x5dff25-0x0;var _0x139803=_0x6f08[_0x5dff25];return _0x139803;};'use strict';var multer=require('multer');var util=require(_0x86f0('0x0'));var path=require(_0x86f0('0x1'));var timeout=require(_0x86f0('0x2'));var express=require('express');var router=express[_0x86f0('0x3')]();var auth=require(_0x86f0('0x4'));var interaction=require(_0x86f0('0x5'));var config=require(_0x86f0('0x6'));var controller=require(_0x86f0('0x7'));router[_0x86f0('0x8')]('/',auth['isAuthenticated'](),controller[_0x86f0('0x9')]);router['get'](_0x86f0('0xa'),auth[_0x86f0('0xb')](),controller[_0x86f0('0xc')]);router[_0x86f0('0x8')](_0x86f0('0xd'),auth[_0x86f0('0xb')](),controller[_0x86f0('0xe')]);router['get']('/:id/avatar',controller[_0x86f0('0xf')]);router[_0x86f0('0x8')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0x86f0('0x8')](_0x86f0('0x10'),auth['isAuthenticated'](),controller[_0x86f0('0x11')]);router[_0x86f0('0x8')](_0x86f0('0x12'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x13')]);router[_0x86f0('0x8')]('/:id/groups',auth[_0x86f0('0xb')](),controller[_0x86f0('0x14')]);router[_0x86f0('0x8')](_0x86f0('0x15'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x16')]);router[_0x86f0('0x8')](_0x86f0('0x17'),auth['isAuthenticated'](),controller[_0x86f0('0x18')]);router['get'](_0x86f0('0x19'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x1a')]);router[_0x86f0('0x8')](_0x86f0('0x1b'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x1c')]);router[_0x86f0('0x8')](_0x86f0('0x1d'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x1e')]);router[_0x86f0('0x8')](_0x86f0('0x1f'),auth['isAuthenticated'](),controller[_0x86f0('0x20')]);router[_0x86f0('0x8')]('/:id/fax/interactions',auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x86f0('0x8')](_0x86f0('0x21'),auth[_0x86f0('0xb')](),controller['getTeams']);router[_0x86f0('0x8')]('/:id/lists',auth[_0x86f0('0xb')](),controller[_0x86f0('0x22')]);router['get']('/:id/agents',auth[_0x86f0('0xb')](),controller[_0x86f0('0x23')]);router[_0x86f0('0x8')](_0x86f0('0x24'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x25')]);router[_0x86f0('0x8')](_0x86f0('0x26'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x27')]);router['get']('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x86f0('0x28')]);router['get'](_0x86f0('0x29'),auth['isAuthenticated'](),controller[_0x86f0('0x2a')]);router['get'](_0x86f0('0x2b'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x2c')]);router[_0x86f0('0x8')](_0x86f0('0x2d'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x2e')]);router['get'](_0x86f0('0x2f'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x30')]);router[_0x86f0('0x8')](_0x86f0('0x31'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x32')]);router[_0x86f0('0x8')](_0x86f0('0x33'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x34')]);router[_0x86f0('0x35')](_0x86f0('0x36'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x37')]);router[_0x86f0('0x35')]('/:id/contacts',auth[_0x86f0('0xb')](),controller['addContacts']);router[_0x86f0('0x35')]('/',auth[_0x86f0('0xb')](),controller[_0x86f0('0x38')]);router[_0x86f0('0x35')]('/:id/queues',auth['isAuthenticated'](),controller[_0x86f0('0x39')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x377993,_0x2950b2,_0x564654){_0x564654(null,path[_0x86f0('0x3a')](config[_0x86f0('0x3b')],_0x86f0('0x3c')));},'filename':function(_0x149a4d,_0x470f75,_0x379359){_0x379359(null,util['format'](_0x86f0('0x3d'),Date[_0x86f0('0x3e')](),_0x470f75[_0x86f0('0x3f')]));}})});router[_0x86f0('0x35')](_0x86f0('0x40'),upload[_0x86f0('0x41')](_0x86f0('0x42')),controller[_0x86f0('0x43')]);router[_0x86f0('0x35')]('/:id/login',auth[_0x86f0('0xb')](),controller[_0x86f0('0x44')]);router[_0x86f0('0x35')](_0x86f0('0x45'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x46')]);router[_0x86f0('0x35')](_0x86f0('0x47'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x48')]);router[_0x86f0('0x35')]('/:id/unpause',auth[_0x86f0('0xb')](),controller[_0x86f0('0x49')]);router[_0x86f0('0x35')](_0x86f0('0x21'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x4a')]);router[_0x86f0('0x35')](_0x86f0('0x4b'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x4c')]);router[_0x86f0('0x35')](_0x86f0('0x4d'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x4e')]);router[_0x86f0('0x35')](_0x86f0('0x4f'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x50')]);router[_0x86f0('0x35')](_0x86f0('0x51'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x52')]);router[_0x86f0('0x35')](_0x86f0('0x53'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x54')]);router['post'](_0x86f0('0x26'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x55')]);router[_0x86f0('0x35')](_0x86f0('0x56'),auth['isAuthenticated'](),controller[_0x86f0('0x57')]);router['post'](_0x86f0('0x29'),auth['isAuthenticated'](),controller[_0x86f0('0x58')]);router[_0x86f0('0x35')](_0x86f0('0x2b'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x59')]);router[_0x86f0('0x35')]('/:id/chat_websites',auth[_0x86f0('0xb')](),controller['addChatWebsites']);router[_0x86f0('0x35')](_0x86f0('0x2f'),auth['isAuthenticated'](),controller[_0x86f0('0x5a')]);router[_0x86f0('0x35')]('/:id/api_key',auth[_0x86f0('0xb')](),controller['createApiKey']);router['put'](_0x86f0('0xd'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x5b')]);router['put'](_0x86f0('0x5c'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x5d')]);router[_0x86f0('0x5e')](_0x86f0('0x10'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x5f')]);router['delete'](_0x86f0('0x21'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x60')]);router[_0x86f0('0x5e')](_0x86f0('0xd'),auth[_0x86f0('0xb')](),controller['destroy']);router[_0x86f0('0x5e')](_0x86f0('0x4b'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x61')]);router[_0x86f0('0x5e')](_0x86f0('0x4d'),auth[_0x86f0('0xb')](),controller['removeMailInteractions']);router[_0x86f0('0x5e')](_0x86f0('0x4f'),auth['isAuthenticated'](),controller[_0x86f0('0x62')]);router[_0x86f0('0x5e')](_0x86f0('0x51'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x63')]);router['delete']('/:id/openchannel_interactions',auth[_0x86f0('0xb')](),controller['removeOpenchannelInteractions']);router['delete'](_0x86f0('0x26'),auth['isAuthenticated'](),controller[_0x86f0('0x64')]);router[_0x86f0('0x5e')](_0x86f0('0x56'),auth[_0x86f0('0xb')](),controller['removeMailAccounts']);router[_0x86f0('0x5e')](_0x86f0('0x29'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x65')]);router[_0x86f0('0x5e')](_0x86f0('0x2b'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x66')]);router[_0x86f0('0x5e')](_0x86f0('0x2d'),auth['isAuthenticated'](),controller[_0x86f0('0x67')]);router['delete'](_0x86f0('0x2f'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x68')]);router[_0x86f0('0x5e')](_0x86f0('0x33'),auth[_0x86f0('0xb')](),controller[_0x86f0('0x69')]);module[_0x86f0('0x6a')]=router; \ No newline at end of file +var _0x7d22=['removeTeams','destroy','/:id/mail_interactions','removeSmsInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','show','/:id/contacts','getContacts','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','getScheduledCalls','post','bulkCreate','addContacts','create','join','root','format','%s-%s','now','originalname','/:id/avatar','single','addAvatar','login','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addOpenchannelAccounts','/:id/sms_accounts','addChatWebsites','addSquareProjects','/:id/api_key','put','/:id','update','/:id/password','changePassword','delete'];(function(_0x4241d6,_0x551e1e){var _0x5416e6=function(_0x4cb6ba){while(--_0x4cb6ba){_0x4241d6['push'](_0x4241d6['shift']());}};_0x5416e6(++_0x551e1e);}(_0x7d22,0x6f));var _0x27d2=function(_0x3cda07,_0x5ad352){_0x3cda07=_0x3cda07-0x0;var _0x27e549=_0x7d22[_0x3cda07];return _0x27e549;};'use strict';var multer=require(_0x27d2('0x0'));var util=require(_0x27d2('0x1'));var path=require(_0x27d2('0x2'));var timeout=require(_0x27d2('0x3'));var express=require(_0x27d2('0x4'));var router=express[_0x27d2('0x5')]();var auth=require(_0x27d2('0x6'));var interaction=require(_0x27d2('0x7'));var config=require(_0x27d2('0x8'));var controller=require(_0x27d2('0x9'));router['get']('/',auth[_0x27d2('0xa')](),controller[_0x27d2('0xb')]);router[_0x27d2('0xc')](_0x27d2('0xd'),auth[_0x27d2('0xa')](),controller[_0x27d2('0xe')]);router['get']('/:id',auth[_0x27d2('0xa')](),controller[_0x27d2('0xf')]);router[_0x27d2('0xc')]('/:id/avatar',controller['getAvatar']);router['get'](_0x27d2('0x10'),auth['isAuthenticated'](),controller[_0x27d2('0x11')]);router[_0x27d2('0xc')]('/:id/queues',auth[_0x27d2('0xa')](),controller[_0x27d2('0x12')]);router[_0x27d2('0xc')]('/:id/queues_rt',auth[_0x27d2('0xa')](),controller[_0x27d2('0x13')]);router['get'](_0x27d2('0x14'),auth['isAuthenticated'](),controller[_0x27d2('0x15')]);router[_0x27d2('0xc')]('/:id/recordings',auth['isAuthenticated'](),controller[_0x27d2('0x16')]);router[_0x27d2('0xc')](_0x27d2('0x17'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x18')]);router[_0x27d2('0xc')](_0x27d2('0x19'),auth['isAuthenticated'](),controller[_0x27d2('0x1a')]);router[_0x27d2('0xc')](_0x27d2('0x1b'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x1c')]);router[_0x27d2('0xc')](_0x27d2('0x1d'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x1e')]);router[_0x27d2('0xc')](_0x27d2('0x1f'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x20')]);router[_0x27d2('0xc')](_0x27d2('0x21'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x22')]);router[_0x27d2('0xc')](_0x27d2('0x23'),auth['isAuthenticated'](),controller[_0x27d2('0x24')]);router[_0x27d2('0xc')]('/:id/lists',auth[_0x27d2('0xa')](),controller['getLists']);router['get'](_0x27d2('0x25'),auth[_0x27d2('0xa')](),controller['getAgents']);router[_0x27d2('0xc')](_0x27d2('0x26'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x27')]);router['get'](_0x27d2('0x28'),auth['isAuthenticated'](),controller[_0x27d2('0x29')]);router[_0x27d2('0xc')](_0x27d2('0x2a'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x2b')]);router[_0x27d2('0xc')](_0x27d2('0x2c'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x2d')]);router['get']('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x27d2('0x2e')]);router[_0x27d2('0xc')](_0x27d2('0x2f'),auth['isAuthenticated'](),controller[_0x27d2('0x30')]);router[_0x27d2('0xc')](_0x27d2('0x31'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x32')]);router[_0x27d2('0xc')]('/:id/scheduled_calls',auth[_0x27d2('0xa')](),controller[_0x27d2('0x33')]);router['get']('/:id/api_key',auth['isAuthenticated'](),controller['getApiKey']);router[_0x27d2('0x34')]('/create_many',auth[_0x27d2('0xa')](),controller[_0x27d2('0x35')]);router[_0x27d2('0x34')]('/:id/contacts',auth[_0x27d2('0xa')](),controller[_0x27d2('0x36')]);router[_0x27d2('0x34')]('/',auth['isAuthenticated'](),controller[_0x27d2('0x37')]);router[_0x27d2('0x34')]('/:id/queues',auth[_0x27d2('0xa')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3675de,_0x467350,_0x5351f6){_0x5351f6(null,path[_0x27d2('0x38')](config[_0x27d2('0x39')],'server/files/images/'));},'filename':function(_0x4d5431,_0x72312c,_0x438669){_0x438669(null,util[_0x27d2('0x3a')](_0x27d2('0x3b'),Date[_0x27d2('0x3c')](),_0x72312c[_0x27d2('0x3d')]));}})});router[_0x27d2('0x34')](_0x27d2('0x3e'),upload[_0x27d2('0x3f')]('file'),controller[_0x27d2('0x40')]);router[_0x27d2('0x34')]('/:id/login',auth[_0x27d2('0xa')](),controller[_0x27d2('0x41')]);router['post']('/:id/logout',auth[_0x27d2('0xa')](),controller['logout']);router[_0x27d2('0x34')](_0x27d2('0x42'),auth['isAuthenticated'](),controller[_0x27d2('0x43')]);router[_0x27d2('0x34')](_0x27d2('0x44'),auth['isAuthenticated'](),controller['unpause']);router[_0x27d2('0x34')](_0x27d2('0x23'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x45')]);router['post'](_0x27d2('0x46'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x47')]);router[_0x27d2('0x34')]('/:id/mail_interactions',auth[_0x27d2('0xa')](),controller['addMailInteractions']);router[_0x27d2('0x34')](_0x27d2('0x48'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x49')]);router[_0x27d2('0x34')](_0x27d2('0x4a'),auth[_0x27d2('0xa')](),controller['addSmsInteractions']);router[_0x27d2('0x34')](_0x27d2('0x4b'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x4c')]);router[_0x27d2('0x34')](_0x27d2('0x28'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x4d')]);router['post'](_0x27d2('0x2a'),auth['isAuthenticated'](),controller['addMailAccounts']);router['post'](_0x27d2('0x2c'),auth['isAuthenticated'](),controller[_0x27d2('0x4e')]);router[_0x27d2('0x34')](_0x27d2('0x4f'),auth[_0x27d2('0xa')](),controller['addSmsAccounts']);router['post']('/:id/chat_websites',auth[_0x27d2('0xa')](),controller[_0x27d2('0x50')]);router[_0x27d2('0x34')](_0x27d2('0x31'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x51')]);router[_0x27d2('0x34')](_0x27d2('0x52'),auth[_0x27d2('0xa')](),controller['createApiKey']);router[_0x27d2('0x53')](_0x27d2('0x54'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x55')]);router[_0x27d2('0x53')](_0x27d2('0x56'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x57')]);router[_0x27d2('0x58')]('/:id/queues',auth[_0x27d2('0xa')](),controller['removeQueues']);router['delete']('/:id/teams',auth[_0x27d2('0xa')](),controller[_0x27d2('0x59')]);router[_0x27d2('0x58')](_0x27d2('0x54'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x5a')]);router[_0x27d2('0x58')](_0x27d2('0x46'),auth[_0x27d2('0xa')](),controller['removeChatInteractions']);router[_0x27d2('0x58')](_0x27d2('0x5b'),auth['isAuthenticated'](),controller['removeMailInteractions']);router['delete'](_0x27d2('0x48'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router['delete'](_0x27d2('0x4a'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x5c')]);router[_0x27d2('0x58')](_0x27d2('0x4b'),auth[_0x27d2('0xa')](),controller['removeOpenchannelInteractions']);router[_0x27d2('0x58')](_0x27d2('0x28'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x5d')]);router[_0x27d2('0x58')](_0x27d2('0x2a'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x5e')]);router['delete'](_0x27d2('0x2c'),auth[_0x27d2('0xa')](),controller[_0x27d2('0x5f')]);router[_0x27d2('0x58')](_0x27d2('0x4f'),auth['isAuthenticated'](),controller[_0x27d2('0x60')]);router[_0x27d2('0x58')]('/:id/chat_websites',auth[_0x27d2('0xa')](),controller[_0x27d2('0x61')]);router[_0x27d2('0x58')](_0x27d2('0x31'),auth['isAuthenticated'](),controller[_0x27d2('0x62')]);router[_0x27d2('0x58')](_0x27d2('0x52'),auth['isAuthenticated'](),controller['removeApiKey']);module[_0x27d2('0x63')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index c08ebb8..6d58f8b 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(_0x264e69,_0x4270a6){var _0xb00cf6=function(_0x102a91){while(--_0x102a91){_0x264e69['push'](_0x264e69['shift']());}};_0xb00cf6(++_0x4270a6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0x5b4fc0,_0xc317ea){var _0x15e56a=function(_0x1e2d1e){while(--_0x1e2d1e){_0x5b4fc0['push'](_0x5b4fc0['shift']());}};_0x15e56a(++_0xc317ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 6a9729c..d9465ea 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 _0xa23f=['OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','phone','mobile','LOCAL/%s@from-sip/n','intrf','headers','x-forwarded-for','connection','remoteAddress','socket','UserVoiceQueue.penalty','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','device','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','logout','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','QueuePause','manual','mail','fax','sms','openchannel','Pause','all','getTeams','Team','addTeams','removeTeams','getLists','getVoiceQueues','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','Contact','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privelages\x20to\x20access\x20this\x20resource.','generateApiKey','apiKeyNonce','removeApiKey','apiKeyIat','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','test','then','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','save','update','destroy','get','Users','user','Agents','agent','telephone','filter','ignore','includes','role','find','value','UserProfileResource','end','stack','name','send','index','rawAttributes','model','differenceBy','password','salt','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','type','key','VIRTUAL','sequelize','lower','col','options','User','count','include','findAll','rows','show','intersection','includeAll','bulkCreate','body','describe','addContacts','params','ids','omit','admin','../../config/license/util','getLicense','isNil','format','Setting','findById','min_internal','max','internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','SELECT','from','voicemail','mailbox','fullname','email','101','103','110','105','106','108','100','VoiceMail','Unable\x20to\x20retrieve\x20the\x20current\x20user','Telephones','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','newPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','findOne','securePassword','addQueues','channel','loginInPause','voicePause','interface','isValidChannel','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','voice','VoiceQueue','online','push','SIP/%s','each','UserVoiceQueueRt','upsert','removeQueues','Unknown\x20channel','remove','addAvatar','file','join','root','server/files/images/logos/default_profile.png','userpic','download','existsSync','server/files/images/','getContacts','keys','CmContact','CmList','List','Tag','Tags','tag','getQueues','Queue','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','ChatGroup','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0xa23f,0x7c));var _0xfa23=function(_0x26cd8a,_0x3bfc24){_0x26cd8a=_0x26cd8a-0x0;var _0x5627ac=_0xa23f[_0x26cd8a];return _0x5627ac;};'use strict';var pdf=require(_0xfa23('0x0'));var emlformat=require(_0xfa23('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfa23('0x2'));var rp=require(_0xfa23('0x3'));var moment=require(_0xfa23('0x4'));var BPromise=require(_0xfa23('0x5'));var Mustache=require('mustache');var util=require(_0xfa23('0x6'));var path=require('path');var sox=require(_0xfa23('0x7'));var csv=require(_0xfa23('0x8'));var ejs=require(_0xfa23('0x9'));var fs=require('fs');var _=require(_0xfa23('0xa'));var squel=require('squel');var crypto=require(_0xfa23('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfa23('0xc'));var toCsv=require(_0xfa23('0x8'));var querystring=require(_0xfa23('0xd'));var Papa=require(_0xfa23('0xe'));var Redis=require(_0xfa23('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xfa23('0x10'));var logger=require('../../config/logger')(_0xfa23('0x11'));var utils=require('../../config/utils');var config=require(_0xfa23('0x12'));var db=require(_0xfa23('0x13'))['db'];config[_0xfa23('0x14')]=_['defaults'](config[_0xfa23('0x14')],{'host':_0xfa23('0x15'),'port':0x18eb});var socket=require(_0xfa23('0x16'))(new Redis(config['redis']));require('./user.socket')[_0xfa23('0x17')](socket);var jayson=require(_0xfa23('0x18'));var client=jayson[_0xfa23('0x19')][_0xfa23('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5e1a30,_0x14a994,_0xb7d11a){if(_0xb7d11a){var _0x2095a5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2095a5[_0xfa23('0x1b')](_0x14a994)){return _0x5e1a30;}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 _0x5e1a30;}}function respondWithRpcPromise(_0x1c4882,_0x39729e,_0x3ca6be,_0x375f5a){return new BPromise(function(_0x3fa5f6,_0x4e5b77){var _0x59610c=_0x375f5a||client;return _0x59610c['request'](_0x1c4882,_0x3ca6be)[_0xfa23('0x1c')](function(_0xb3ced2){logger['info'](_0xfa23('0x1d'),_0x39729e,_0xfa23('0x1e'));logger[_0xfa23('0x1f')]('User,\x20%s,\x20%s,\x20%s',_0x39729e,_0xfa23('0x1e'),JSON[_0xfa23('0x20')](_0xb3ced2));if(_0xb3ced2['error']){if(_0xb3ced2[_0xfa23('0x21')][_0xfa23('0x22')]===0x1f4){logger[_0xfa23('0x21')](_0xfa23('0x1d'),_0x39729e,_0xb3ced2[_0xfa23('0x21')][_0xfa23('0x23')]);return _0x4e5b77(_0xb3ced2[_0xfa23('0x21')]['message']);}logger[_0xfa23('0x21')](_0xfa23('0x1d'),_0x39729e,_0xb3ced2[_0xfa23('0x21')][_0xfa23('0x23')]);return _0x3fa5f6(_0xb3ced2['error'][_0xfa23('0x23')]);}else{logger['info'](_0xfa23('0x1d'),_0x39729e,_0xfa23('0x1e'));_0x3fa5f6(_0xb3ced2[_0xfa23('0x24')][_0xfa23('0x23')]);}})[_0xfa23('0x25')](function(_0x1340d9){logger[_0xfa23('0x21')](_0xfa23('0x1d'),_0x39729e,_0x1340d9);_0x4e5b77(_0x1340d9);});});}function respondWithStatusCode(_0x5e1780,_0x2ae826){_0x2ae826=_0x2ae826||0xcc;return function(_0x4ab34d){if(_0x4ab34d){return _0x5e1780[_0xfa23('0x26')](_0x2ae826);}return _0x5e1780['status'](_0x2ae826)['end']();};}function respondWithResult(_0x35b493,_0x1a9a90){_0x1a9a90=_0x1a9a90||0xc8;return function(_0xbf9d19){if(_0xbf9d19){return _0x35b493[_0xfa23('0x27')](_0x1a9a90)[_0xfa23('0x28')](_0xbf9d19);}};}function respondWithFilteredResult(_0x24da31,_0x3c9d9d){return function(_0x4c1ab0){if(_0x4c1ab0){var _0x591797=_0x4c1ab0['count'],_0x47ced6=_0x3c9d9d[_0xfa23('0x29')],_0x380d42=_0x3c9d9d[_0xfa23('0x29')]+_0x3c9d9d[_0xfa23('0x2a')],_0x6bf719;if(_0x380d42>=_0x591797){_0x380d42=_0x591797;_0x6bf719=0xc8;}else{_0x6bf719=0xce;}_0x24da31[_0xfa23('0x27')](_0x6bf719);return _0x24da31[_0xfa23('0x2b')](_0xfa23('0x2c'),_0x47ced6+'-'+_0x380d42+'/'+_0x591797)[_0xfa23('0x28')](_0x4c1ab0);}return null;};}function patchUpdates(_0x19c7bc){return function(_0x1617e3){try{jsonpatch['apply'](_0x1617e3,_0x19c7bc,!![]);}catch(_0x2eb32e){return BPromise['reject'](_0x2eb32e);}return _0x1617e3[_0xfa23('0x2d')]();};}function saveUpdates(_0x41d235,_0x451e40){return function(_0xaa1d77){if(_0xaa1d77){return _0xaa1d77[_0xfa23('0x2e')](_0x41d235)[_0xfa23('0x1c')](function(_0x18f549){return _0x18f549;});}return null;};}function removeEntity(_0x33aa43,_0xaa329c){return function(_0x59aa98){if(_0x59aa98){return _0x59aa98[_0xfa23('0x2f')]()['then'](function(){var _0x2709f9=_0x59aa98[_0xfa23('0x30')]({'plain':!![]});var _0x17c407=[{'name':_0xfa23('0x31'),'value':_0xfa23('0x32'),'ignore':!![]},{'name':_0xfa23('0x33'),'value':_0xfa23('0x34'),'ignore':![]},{'name':'Telephones','value':_0xfa23('0x35'),'ignore':![]}];var _0x3c8b90=_(_0x17c407)[_0xfa23('0x36')](_0xfa23('0x37'))['map']('value')['value']();if(_[_0xfa23('0x38')](_0x3c8b90,_0x2709f9[_0xfa23('0x39')])){return;}var _0x584fa2=_[_0xfa23('0x3a')](_0x17c407,[_0xfa23('0x3b'),_0x2709f9[_0xfa23('0x39')]])['name'];return db[_0xfa23('0x3c')]['destroy']({'where':{'type':_0x584fa2,'resourceId':_0x2709f9['id']}})[_0xfa23('0x1c')](function(){return _0x59aa98;});})[_0xfa23('0x1c')](function(){_0x33aa43[_0xfa23('0x27')](0xcc)[_0xfa23('0x3d')]();});}};}function handleEntityNotFound(_0x1bc029,_0x80827f){return function(_0x58fc41){if(!_0x58fc41){_0x1bc029[_0xfa23('0x26')](0x194);}return _0x58fc41;};}function handleError(_0x3c4743,_0x43eb23){_0x43eb23=_0x43eb23||0x1f4;return function(_0x245f49){logger['error'](_0x245f49[_0xfa23('0x3e')]);if(_0x245f49[_0xfa23('0x3f')]){delete _0x245f49[_0xfa23('0x3f')];}_0x3c4743[_0xfa23('0x27')](_0x43eb23)[_0xfa23('0x40')](_0x245f49);};}exports[_0xfa23('0x41')]=function(_0x493d36,_0x93ebd4){var _0x5f3bf7={},_0x5ec65a={},_0x3c5db6={'count':0x0,'rows':[]};var _0x1117ef=db['User'][_0xfa23('0x42')];_0x5ec65a[_0xfa23('0x43')]=_[_0xfa23('0x44')](_['keys'](_0x1117ef),[_0xfa23('0x45'),_0xfa23('0x46')]);_0x5ec65a[_0xfa23('0x47')]=_['keys'](_0x493d36['query']);_0x5ec65a[_0xfa23('0x48')]=_['intersection'](_0x5ec65a[_0xfa23('0x43')],_0x5ec65a[_0xfa23('0x47')]);_0x5f3bf7[_0xfa23('0x49')]=_['intersection'](_0x5ec65a[_0xfa23('0x43')],qs[_0xfa23('0x4a')](_0x493d36[_0xfa23('0x47')][_0xfa23('0x4a')]));_0x5f3bf7['attributes']=_0x5f3bf7[_0xfa23('0x49')][_0xfa23('0x4b')]?_0x5f3bf7[_0xfa23('0x49')]:_0x5ec65a['model'];if(!_0x493d36['query'][_0xfa23('0x4c')]('nolimit')){_0x5f3bf7[_0xfa23('0x2a')]=qs[_0xfa23('0x2a')](_0x493d36[_0xfa23('0x47')][_0xfa23('0x2a')]);_0x5f3bf7[_0xfa23('0x29')]=qs[_0xfa23('0x29')](_0x493d36['query'][_0xfa23('0x29')]);}_0x5f3bf7[_0xfa23('0x4d')]=qs[_0xfa23('0x4e')](_0x493d36[_0xfa23('0x47')][_0xfa23('0x4e')]);_0x5f3bf7[_0xfa23('0x4f')]=qs['filters'](_[_0xfa23('0x50')](_0x493d36[_0xfa23('0x47')],_0x5ec65a[_0xfa23('0x48')]));if(_0x493d36[_0xfa23('0x47')][_0xfa23('0x36')]){_0x5f3bf7['where']=_[_0xfa23('0x51')](_0x5f3bf7[_0xfa23('0x4f')],{'$or':_[_0xfa23('0x52')](_0x1117ef,function(_0x5e4633){if(_0x5e4633[_0xfa23('0x53')][_0xfa23('0x54')]!==_0xfa23('0x55')){return db[_0xfa23('0x56')][_0xfa23('0x4f')](db[_0xfa23('0x56')]['fn'](_0xfa23('0x57'),db['sequelize'][_0xfa23('0x58')](_0x5e4633['field'])),{'$like':db[_0xfa23('0x56')]['fn'](_0xfa23('0x57'),'%'+_0x493d36[_0xfa23('0x47')][_0xfa23('0x36')]+'%')});}})});}_0x5f3bf7=_[_0xfa23('0x51')]({},_0x5f3bf7,_0x493d36[_0xfa23('0x59')]);var _0x4c6962={'where':_0x5f3bf7[_0xfa23('0x4f')]};return db[_0xfa23('0x5a')][_0xfa23('0x5b')](_0x4c6962)[_0xfa23('0x1c')](function(_0x13c37d){_0x3c5db6[_0xfa23('0x5b')]=_0x13c37d;if(_0x493d36[_0xfa23('0x47')]['includeAll']){_0x5f3bf7[_0xfa23('0x5c')]=[{'all':!![]}];}return db[_0xfa23('0x5a')][_0xfa23('0x5d')](_0x5f3bf7);})[_0xfa23('0x1c')](function(_0x48e88d){_0x3c5db6[_0xfa23('0x5e')]=_0x48e88d;return _0x3c5db6;})[_0xfa23('0x1c')](respondWithFilteredResult(_0x93ebd4,_0x5f3bf7))[_0xfa23('0x25')](handleError(_0x93ebd4,null));};exports[_0xfa23('0x5f')]=function(_0x401309,_0x2993a3){var _0x5db2e6={'raw':![],'where':{'id':_0x401309['params']['id']}},_0x29ca4b={};_0x29ca4b[_0xfa23('0x43')]=_[_0xfa23('0x44')](_['keys'](db[_0xfa23('0x5a')][_0xfa23('0x42')]),['password',_0xfa23('0x46')]);_0x29ca4b[_0xfa23('0x47')]=_['keys'](_0x401309[_0xfa23('0x47')]);_0x29ca4b[_0xfa23('0x48')]=_[_0xfa23('0x60')](_0x29ca4b[_0xfa23('0x43')],_0x29ca4b['query']);_0x5db2e6[_0xfa23('0x49')]=_[_0xfa23('0x60')](_0x29ca4b['model'],qs[_0xfa23('0x4a')](_0x401309[_0xfa23('0x47')][_0xfa23('0x4a')]));_0x5db2e6[_0xfa23('0x49')]=_0x5db2e6[_0xfa23('0x49')][_0xfa23('0x4b')]?_0x5db2e6['attributes']:_0x29ca4b[_0xfa23('0x43')];if(_0x401309[_0xfa23('0x47')][_0xfa23('0x61')]){_0x5db2e6['include']=[{'all':!![]}];}_0x5db2e6=_[_0xfa23('0x51')]({},_0x5db2e6,_0x401309[_0xfa23('0x59')]);return db[_0xfa23('0x5a')]['find'](_0x5db2e6)[_0xfa23('0x1c')](handleEntityNotFound(_0x2993a3,null))[_0xfa23('0x1c')](respondWithResult(_0x2993a3,null))[_0xfa23('0x25')](handleError(_0x2993a3,null));};exports[_0xfa23('0x62')]=function(_0x378d29,_0x58224d){return db['User'][_0xfa23('0x62')](_0x378d29[_0xfa23('0x63')],{'raw':![],'individualHooks':!![]})[_0xfa23('0x1c')](respondWithResult(_0x58224d,0xc9))[_0xfa23('0x25')](handleError(_0x58224d,null));};exports['update']=function(_0x5275d6,_0x2493da){if(_0x5275d6[_0xfa23('0x63')]['id']){delete _0x5275d6[_0xfa23('0x63')]['id'];}delete _0x5275d6[_0xfa23('0x63')]['role'];return db[_0xfa23('0x5a')][_0xfa23('0x3a')]({'where':{'id':_0x5275d6['params']['id']}})[_0xfa23('0x1c')](handleEntityNotFound(_0x2493da,null))[_0xfa23('0x1c')](saveUpdates(_0x5275d6['body'],null))[_0xfa23('0x1c')](respondWithResult(_0x2493da,null))[_0xfa23('0x25')](handleError(_0x2493da,null));};exports[_0xfa23('0x64')]=function(_0x3ece28,_0x33470f){return db[_0xfa23('0x5a')]['describe']()[_0xfa23('0x1c')](respondWithResult(_0x33470f,null))['catch'](handleError(_0x33470f,null));};exports[_0xfa23('0x65')]=function(_0x263f8c,_0x192d28,_0x1a8a80){return db[_0xfa23('0x5a')][_0xfa23('0x3a')]({'where':{'id':_0x263f8c[_0xfa23('0x66')]['id']}})[_0xfa23('0x1c')](handleEntityNotFound(_0x192d28,null))[_0xfa23('0x1c')](function(_0x4e05f0){if(_0x4e05f0){return _0x4e05f0[_0xfa23('0x65')](_0x263f8c['body'][_0xfa23('0x67')],_[_0xfa23('0x68')](_0x263f8c['body'],['ids','id'])||{});}})[_0xfa23('0x1c')](respondWithResult(_0x192d28,null))['catch'](handleError(_0x192d28,null));};var getLicense=function(_0x4d6ff0){return new BPromise(function(_0x4fb4b5,_0x268494){var _0x400fc9=0x0;_0x4d6ff0[_0xfa23('0x63')][_0xfa23('0x39')]===_0xfa23('0x34')&&_0x4fb4b5('agent\x20role');return db['User'][_0xfa23('0x5b')]({'where':{'$or':[{'role':_0x4d6ff0[_0xfa23('0x63')][_0xfa23('0x39')]===_0xfa23('0x35')?'telephone':[_0xfa23('0x69'),'user']}]}})[_0xfa23('0x1c')](function(_0xf0b3da){_0x400fc9=_0xf0b3da;return require(_0xfa23('0x6a'))[_0xfa23('0x6b')]();})[_0xfa23('0x1c')](function(_0x3bf459){var _0x19c67f=_0x4d6ff0[_0xfa23('0x63')][_0xfa23('0x39')]===_0xfa23('0x35')?'telephones':'users';if(!_[_0xfa23('0x6c')](_0x3bf459[_0x19c67f])&&_0x400fc9>=_0x3bf459[_0x19c67f]){return _0x268494({'message':'License\x20limit\x20reached'});}return _0x4fb4b5(util[_0xfa23('0x6d')]('count\x20%s:\x20%s',_0x19c67f,_0x400fc9));})[_0xfa23('0x25')](function(_0x430cfd){return _0x268494(_0x430cfd);});});};exports['create']=function(_0xff1abf,_0x49e178){return getLicense(_0xff1abf)['then'](function(_0x222ba1){if(!_0xff1abf[_0xfa23('0x63')]['internal']){var _0xccca4d;return db[_0xfa23('0x6e')][_0xfa23('0x6f')](0x1)[_0xfa23('0x1c')](function(_0x3da38c){return checkPasswordPattern(_0x3da38c,_0xff1abf[_0xfa23('0x63')][_0xfa23('0x45')],_0x3da38c['securePassword']);})[_0xfa23('0x1c')](function(_0x1eafff){_0xccca4d=_0x1eafff[_0xfa23('0x70')];return db[_0xfa23('0x5a')][_0xfa23('0x71')]('internal');})[_0xfa23('0x1c')](function(_0x51b55f){if(_['isNil'](_0x51b55f)){if(_0xccca4d){_0xff1abf['body'][_0xfa23('0x72')]=_0xccca4d;}else{_0xff1abf[_0xfa23('0x63')][_0xfa23('0x72')]=0x1;}}else{if(_['isNil'](_0xccca4d)||_0xccca4d==_0x51b55f){_0xff1abf[_0xfa23('0x63')][_0xfa23('0x72')]=_0x51b55f+0x1;}else if(_0xccca4d>_0x51b55f){_0xff1abf['body'][_0xfa23('0x72')]=_0xccca4d;}else{return db[_0xfa23('0x56')][_0xfa23('0x47')](_0xfa23('0x73'),{'type':db['sequelize']['QueryTypes'][_0xfa23('0x74')]})['then'](function(_0x22f88f){if(_0x22f88f&&_0x22f88f[_0xfa23('0x4b')]){for(var _0x3fb9d3=0x0,_0x4a77e5=_0x22f88f[_0xfa23('0x4b')];_0x3fb9d3<_0x4a77e5&&_[_0xfa23('0x6c')](_0xff1abf[_0xfa23('0x63')][_0xfa23('0x72')]);_0x3fb9d3++){if(_0xccca4d<=_0x22f88f[_0x3fb9d3][_0xfa23('0x75')]){_0xff1abf[_0xfa23('0x63')]['internal']=_0x22f88f[_0x3fb9d3][_0xfa23('0x75')];}else if(_0xccca4d>_0x22f88f[_0x3fb9d3][_0xfa23('0x75')]&&_0xccca4d<=_0x22f88f[_0x3fb9d3]['to']){_0xff1abf[_0xfa23('0x63')][_0xfa23('0x72')]=_0xccca4d;}}}if(_[_0xfa23('0x6c')](_0xff1abf[_0xfa23('0x63')]['internal'])){_0xff1abf[_0xfa23('0x63')][_0xfa23('0x72')]=_0x51b55f+0x1;}});}}});}})['then'](function(){if(_0xff1abf[_0xfa23('0x63')][_0xfa23('0x76')]){_0xff1abf[_0xfa23('0x63')][_0xfa23('0x77')]=_0xff1abf[_0xfa23('0x63')]['internal'];_0xff1abf[_0xfa23('0x63')]['VoiceMail']={'mailbox':_0xff1abf['body']['internal'],'password':_0xff1abf['body'][_0xfa23('0x45')],'fullname':_0xff1abf['body'][_0xfa23('0x78')],'email':_0xff1abf[_0xfa23('0x63')][_0xfa23('0x79')]};}if(_0xff1abf[_0xfa23('0x63')]&&_0xff1abf[_0xfa23('0x63')][_0xfa23('0x39')]===_0xfa23('0x34')){_0xff1abf[_0xfa23('0x63')]['permissions']=[_0xfa23('0x7a'),'102',_0xfa23('0x7b'),_0xfa23('0x7c'),'104',_0xfa23('0x7d'),_0xfa23('0x7e'),'107',_0xfa23('0x7f'),'109',_0xfa23('0x80'),'111'];}return db[_0xfa23('0x5a')]['create'](_0xff1abf[_0xfa23('0x63')],{'include':[{'model':db[_0xfa23('0x81')],'as':'VoiceMail'}]});})[_0xfa23('0x1c')](function(_0x32df5c){if(_0xff1abf[_0xfa23('0x63')]['role']===_0xfa23('0x32'))return _0x32df5c;var _0x518e4d=_0xff1abf[_0xfa23('0x32')][_0xfa23('0x30')]({'plain':!![]});if(!_0x518e4d)throw new Error(_0xfa23('0x82'));if(_0x518e4d[_0xfa23('0x39')]==='user'){var _0x3e0a3e=_0x32df5c['get']({'plain':!![]});var _0x30c836=[{'name':'Agents','value':_0xfa23('0x34')},{'name':_0xfa23('0x83'),'value':_0xfa23('0x35')}];var _0x376b22=_[_0xfa23('0x3a')](_0x30c836,['value',_0x3e0a3e[_0xfa23('0x39')]])['name'];return db['UserProfileSection'][_0xfa23('0x3a')]({'where':{'name':_0x376b22,'userProfileId':_0x518e4d[_0xfa23('0x84')]},'raw':!![]})[_0xfa23('0x1c')](function(_0x355185){if(_0x355185&&_0x355185['autoAssociation']===0x0){return db[_0xfa23('0x3c')][_0xfa23('0x85')]({'name':_0x3e0a3e[_0xfa23('0x3f')],'resourceId':_0x3e0a3e['id'],'type':_0x355185[_0xfa23('0x3f')],'sectionId':_0x355185['id']},{})[_0xfa23('0x1c')](function(){return _0x32df5c;});}else{return _0x32df5c;}})[_0xfa23('0x25')](function(_0x2bdc8e){logger[_0xfa23('0x21')](_0xfa23('0x86'),_0x2bdc8e);throw _0x2bdc8e;});}return _0x32df5c;})[_0xfa23('0x1c')](respondWithResult(_0x49e178,0xc9))[_0xfa23('0x25')](handleError(_0x49e178,null));};exports[_0xfa23('0x87')]=function(_0x561942,_0x267fb4,_0x3cc203){var _0x250869=![];if(_0x561942[_0xfa23('0x63')]['id']){delete _0x561942[_0xfa23('0x63')]['id'];}if(!_[_0xfa23('0x6c')](_0x561942[_0xfa23('0x63')]['oldPassword'])){if(_0x561942[_0xfa23('0x63')]['oldPassword']===_0x561942['body']['newPassword']){throw new Error('New\x20password\x20must\x20be\x20different\x20from\x20old\x20one');}}return db[_0xfa23('0x5a')][_0xfa23('0x3a')]({'where':{'id':_0x561942[_0xfa23('0x66')]['id']}})['then'](function(_0x413eff){if(_0x413eff){if(_0x413eff['id']==_0x561942[_0xfa23('0x32')]['id']){if(!_0x561942[_0xfa23('0x63')][_0xfa23('0x88')]||!_0x561942[_0xfa23('0x63')]['newPassword']){throw new db[(_0xfa23('0x89'))][(_0xfa23('0x8a'))](_0xfa23('0x8b'));}if(!_0x413eff[_0xfa23('0x8c')](_0x561942[_0xfa23('0x63')][_0xfa23('0x88')])){throw new db['Sequelize']['ValidationError']('Wrong\x20credentials');}if(_0x561942['body'][_0xfa23('0x88')]==_0x561942[_0xfa23('0x63')][_0xfa23('0x8d')]){throw new db[(_0xfa23('0x89'))][(_0xfa23('0x8a'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}return _0x413eff;}else if(_0x561942[_0xfa23('0x32')][_0xfa23('0x39')]==_0xfa23('0x69')){if(!_0x561942['body'][_0xfa23('0x8d')]){throw new db['Sequelize']['ValidationError'](_0xfa23('0x8e'));}return _0x413eff;}else if(_0x561942[_0xfa23('0x32')][_0xfa23('0x39')]==_0xfa23('0x32')){if(!_0x561942['body'][_0xfa23('0x8d')]){throw new db[(_0xfa23('0x89'))]['ValidationError'](_0xfa23('0x8e'));}if(_0x413eff[_0xfa23('0x39')]!='agent'){throw new db['Sequelize'][(_0xfa23('0x8a'))]('Unauthorized');}return _0x413eff;}else{throw new db[(_0xfa23('0x89'))][(_0xfa23('0x8a'))](_0xfa23('0x8f'));}}return null;})[_0xfa23('0x1c')](handleEntityNotFound(_0x267fb4,null))[_0xfa23('0x1c')](function(_0x3d566f){return db[_0xfa23('0x6e')][_0xfa23('0x90')]({'attributes':['id',_0xfa23('0x91')]})[_0xfa23('0x1c')](function(_0x11fce6){_0x250869=_0x11fce6['securePassword'];return checkPasswordPattern(_0x3d566f,_0x561942[_0xfa23('0x63')][_0xfa23('0x8d')],_0x250869);});})['then'](saveUpdates({'password':_0x561942[_0xfa23('0x63')][_0xfa23('0x8d')],'passwordResetAt':_0x561942[_0xfa23('0x32')]['id']==_0x561942[_0xfa23('0x66')]['id']?moment():null},null))['then'](respondWithResult(_0x267fb4,null))['catch'](handleError(_0x267fb4,null));};exports[_0xfa23('0x92')]=function(_0xe9c198,_0x289e3b,_0x4124d9){var _0x51dad6=_0xe9c198['body'][_0xfa23('0x93')];return db[_0xfa23('0x5a')][_0xfa23('0x3a')]({'where':{'id':_0xe9c198['params']['id']},'attributes':['id',_0xfa23('0x3f'),_0xfa23('0x39'),'online',_0xfa23('0x94'),_0xfa23('0x95'),_0xfa23('0x96')]})[_0xfa23('0x1c')](handleEntityNotFound(_0x289e3b,null))[_0xfa23('0x1c')](function(_0x456bb3){if(_0x456bb3){if(!utils[_0xfa23('0x97')](_0x51dad6)){throw new db[(_0xfa23('0x89'))][(_0xfa23('0x8a'))]('Unknown\x20channel');}return _0x456bb3['add'+_[_0xfa23('0x98')](_0x51dad6[_0xfa23('0x99')]())+_0xfa23('0x9a')](_0xe9c198['body'][_0xfa23('0x67')],{'penalty':_0xe9c198[_0xfa23('0x63')][_0xfa23('0x9b')]||0x0})[_0xfa23('0x9c')](function(_0x184d1c){for(var _0xb2dc61=0x0;_0xb2dc61<_0xe9c198[_0xfa23('0x63')][_0xfa23('0x67')]['length'];_0xb2dc61+=0x1){var _0x2d17b1={'UserId':_0xe9c198[_0xfa23('0x66')]['id']};_0x2d17b1[_[_0xfa23('0x98')](_0x51dad6[_0xfa23('0x99')]())+_0xfa23('0x9d')]=_0xe9c198[_0xfa23('0x63')]['ids'][_0xb2dc61];socket[_0xfa23('0x9e')](_0xfa23('0x32')+_['capitalize'](_0x51dad6[_0xfa23('0x99')]())+_0xfa23('0x9f'),_0x2d17b1);}return _0x184d1c;})[_0xfa23('0x1c')](function(){if(_0x51dad6===_0xfa23('0xa0')){return db[_0xfa23('0xa1')][_0xfa23('0x5d')]({'where':{'id':_0xe9c198[_0xfa23('0x63')][_0xfa23('0x67')]||[]},'raw':!![],'attributes':['id',_0xfa23('0x3f')]});}})[_0xfa23('0x1c')](function(_0x3c0c1a){var _0xa57d4e=_0x456bb3[_0xfa23('0x30')]({'plain':!![]});var _0x237e1d=[];if(_0x51dad6===_0xfa23('0xa0')&&_0xa57d4e[_0xfa23('0x39')]===_0xfa23('0x34')&&_0xa57d4e[_0xfa23('0xa2')]){for(var _0x1038bc=0x0;_0x1038bc<_0x3c0c1a[_0xfa23('0x4b')];_0x1038bc+=0x1){_0x237e1d[_0xfa23('0xa3')]({'membername':_0xa57d4e['name'],'UserId':_0xa57d4e['id'],'queue_name':_0x3c0c1a[_0x1038bc][_0xfa23('0x3f')],'VoiceQueueId':_0x3c0c1a[_0x1038bc]['id'],'interface':_[_0xfa23('0x6c')](_0xa57d4e[_0xfa23('0x96')])?util[_0xfa23('0x6d')](_0xfa23('0xa4'),_0xa57d4e['name']):_0xa57d4e[_0xfa23('0x96')],'paused':_0xa57d4e[_0xfa23('0x95')]||![],'penalty':_0xe9c198['body'][_0xfa23('0x9b')]||0x0});}return BPromise[_0xfa23('0xa5')](_0x237e1d,function(_0xd1193a){return db[_0xfa23('0xa6')][_0xfa23('0xa7')](_0xd1193a);});}return _0x456bb3;});}})[_0xfa23('0x1c')](respondWithStatusCode(_0x289e3b,null))['catch'](handleError(_0x289e3b,null));};exports[_0xfa23('0xa8')]=function(_0x3ca789,_0x3b6730,_0x1e8c6f){var _0x1be9d4;return db[_0xfa23('0x5a')][_0xfa23('0x3a')]({'where':{'id':_0x3ca789[_0xfa23('0x66')]['id']},'attributes':['id',_0xfa23('0x3f'),'role']})[_0xfa23('0x1c')](handleEntityNotFound(_0x3b6730,null))[_0xfa23('0x1c')](function(_0x208b85){if(_0x208b85){_0x1be9d4=_0x208b85;if(!_0x3ca789['query'][_0xfa23('0x93')]||!utils[_0xfa23('0x97')](_0x3ca789[_0xfa23('0x47')][_0xfa23('0x93')])){throw new db[(_0xfa23('0x89'))][(_0xfa23('0x8a'))](_0xfa23('0xa9'));}return _0x208b85[_0xfa23('0xaa')+_[_0xfa23('0x98')](_0x3ca789[_0xfa23('0x47')]['channel'][_0xfa23('0x99')]())+_0xfa23('0x9a')](_0x3ca789['query']['ids']);}})[_0xfa23('0x1c')](function(_0x30abbe){for(var _0x341071=0x0;_0x341071<_0x3ca789[_0xfa23('0x47')]['ids'][_0xfa23('0x4b')];_0x341071+=0x1){var _0x499443={'UserId':_0x3ca789[_0xfa23('0x66')]['id']};_0x499443[_[_0xfa23('0x98')](_0x3ca789[_0xfa23('0x47')][_0xfa23('0x93')]['toLowerCase']())+_0xfa23('0x9d')]=_0x3ca789[_0xfa23('0x47')][_0xfa23('0x67')][_0x341071];socket[_0xfa23('0x9e')](_0xfa23('0x32')+_[_0xfa23('0x98')](_0x3ca789[_0xfa23('0x47')][_0xfa23('0x93')]['toLowerCase']())+'Queue:remove',_0x499443);}return _0x30abbe;})[_0xfa23('0x1c')](function(){if(_0x3ca789[_0xfa23('0x47')][_0xfa23('0x93')]===_0xfa23('0xa0')){return db[_0xfa23('0xa6')][_0xfa23('0x2f')]({'where':{'UserId':_0x3ca789[_0xfa23('0x66')]['id'],'VoiceQueueId':_0x3ca789[_0xfa23('0x47')][_0xfa23('0x67')]},'individualHooks':!![]})[_0xfa23('0x1c')](function(){return _0x1be9d4;});}return _0x1be9d4;})[_0xfa23('0x1c')](respondWithStatusCode(_0x3b6730,null))[_0xfa23('0x25')](handleError(_0x3b6730,null));};exports[_0xfa23('0xab')]=function(_0x290065,_0x3c0db9,_0x5f0eed){_0x290065['body']['userpic']=_0x290065[_0xfa23('0xac')]['filename'];return db[_0xfa23('0x5a')][_0xfa23('0x3a')]({'where':{'id':_0x290065[_0xfa23('0x66')]['id']}})[_0xfa23('0x1c')](handleEntityNotFound(_0x3c0db9,null))['then'](saveUpdates(_0x290065[_0xfa23('0x63')],null))['then'](respondWithResult(_0x3c0db9,null))[_0xfa23('0x25')](handleError(_0x3c0db9,null));};exports['getAvatar']=function(_0x2fc119,_0x274067,_0x3d7c9b){var _0x2a44ae=path[_0xfa23('0xad')](config[_0xfa23('0xae')],_0xfa23('0xaf'));return db[_0xfa23('0x5a')]['find']({'where':{'id':_0x2fc119[_0xfa23('0x66')]['id']},'attributes':['id',_0xfa23('0xb0')],'raw':!![]})[_0xfa23('0x1c')](handleEntityNotFound(_0x274067,null))[_0xfa23('0x1c')](function(_0x4a8950){if(_0x4a8950){if(_[_0xfa23('0x6c')](_0x4a8950[_0xfa23('0xb0')])){return _0x274067[_0xfa23('0xb1')](_0x2a44ae);}else{if(!fs[_0xfa23('0xb2')](path[_0xfa23('0xad')](config[_0xfa23('0xae')],_0xfa23('0xb3'),_0x4a8950[_0xfa23('0xb0')]))){return _0x274067[_0xfa23('0xb1')](_0x2a44ae);}return _0x274067['download'](path[_0xfa23('0xad')](config[_0xfa23('0xae')],_0xfa23('0xb3'),_0x4a8950['userpic']));}}})['catch'](handleError(_0x274067,null));};exports[_0xfa23('0xb4')]=function(_0x2d0233,_0x3691b6,_0x34e160){var _0x2365eb={};var _0x3e0a20={};var _0x5e753a;var _0x34d995;return db[_0xfa23('0x5a')]['findOne']({'where':{'id':_0x2d0233[_0xfa23('0x66')]['id']}})[_0xfa23('0x1c')](handleEntityNotFound(_0x3691b6,null))[_0xfa23('0x1c')](function(_0x1a6be6){if(_0x1a6be6){_0x5e753a=_0x1a6be6;_0x3e0a20[_0xfa23('0x43')]=_[_0xfa23('0xb5')](db[_0xfa23('0xb6')]['rawAttributes']);_0x3e0a20[_0xfa23('0x47')]=_[_0xfa23('0xb5')](_0x2d0233[_0xfa23('0x47')]);_0x3e0a20['filters']=_[_0xfa23('0x60')](_0x3e0a20['model'],_0x3e0a20[_0xfa23('0x47')]);_0x2365eb[_0xfa23('0x49')]=_[_0xfa23('0x60')](_0x3e0a20[_0xfa23('0x43')],qs[_0xfa23('0x4a')](_0x2d0233['query'][_0xfa23('0x4a')]));_0x2365eb[_0xfa23('0x49')]=_0x2365eb[_0xfa23('0x49')][_0xfa23('0x4b')]?_0x2365eb[_0xfa23('0x49')]:_0x3e0a20[_0xfa23('0x43')];_0x2365eb[_0xfa23('0x4d')]=qs[_0xfa23('0x4e')](_0x2d0233['query'][_0xfa23('0x4e')]);_0x2365eb['where']=qs[_0xfa23('0x48')](_[_0xfa23('0x50')](_0x2d0233[_0xfa23('0x47')],_0x3e0a20[_0xfa23('0x48')]));if(_0x2d0233[_0xfa23('0x47')]['filter']){_0x2365eb[_0xfa23('0x4f')]=_['merge'](_0x2365eb[_0xfa23('0x4f')],{'$or':_[_0xfa23('0x52')](_0x2365eb[_0xfa23('0x49')],function(_0x1c1bf7){var _0x1730c0={};_0x1730c0[_0x1c1bf7]={'$like':'%'+_0x2d0233[_0xfa23('0x47')][_0xfa23('0x36')]+'%'};return _0x1730c0;})});}_0x2365eb=_[_0xfa23('0x51')]({},_0x2365eb,_0x2d0233[_0xfa23('0x59')]);return _0x5e753a[_0xfa23('0xb4')](_0x2365eb);}})['then'](function(_0x3221e7){if(_0x3221e7){_0x34d995=_0x3221e7[_0xfa23('0x4b')];if(_0x2d0233[_0xfa23('0x47')][_0xfa23('0x4c')](_0xfa23('0x61'))){_0x2365eb['include']=[{'model':db[_0xfa23('0xb7')],'as':_0xfa23('0xb8'),'required':![]},{'model':db[_0xfa23('0xb9')],'as':_0xfa23('0xba'),'attributes':['id',_0xfa23('0x3f'),'color'],'where':_0x2d0233[_0xfa23('0x47')][_0xfa23('0xbb')]?{'id':_0x2d0233[_0xfa23('0x47')][_0xfa23('0xbb')]}:undefined,'required':_0x2d0233[_0xfa23('0x47')]['tag']?!![]:![]}];}if(!_0x2d0233[_0xfa23('0x47')]['hasOwnProperty']('nolimit')){_0x2365eb['limit']=qs[_0xfa23('0x2a')](_0x2d0233['query']['limit']);_0x2365eb[_0xfa23('0x29')]=qs[_0xfa23('0x29')](_0x2d0233[_0xfa23('0x47')][_0xfa23('0x29')]);}return _0x5e753a[_0xfa23('0xb4')](_0x2365eb);}})[_0xfa23('0x1c')](function(_0x18eb61){if(_0x18eb61){return _0x18eb61?{'count':_0x34d995,'rows':_0x18eb61}:null;}})[_0xfa23('0x1c')](respondWithResult(_0x3691b6,null))[_0xfa23('0x25')](handleError(_0x3691b6,null));};exports[_0xfa23('0xbc')]=function(_0x1b12fc,_0x50f99e,_0xc55882){var _0x32de79;var _0x34fe20;var _0x4682d5={};var _0x455a62;return db['User'][_0xfa23('0x90')]({'where':{'id':_0x1b12fc['params']['id']},'attributes':['id',_0xfa23('0x3f'),_0xfa23('0x39')]})['then'](handleEntityNotFound(_0x50f99e,null))[_0xfa23('0x1c')](function(_0x19111c){if(!utils[_0xfa23('0x97')](_0x1b12fc[_0xfa23('0x47')][_0xfa23('0x93')])){throw new db[(_0xfa23('0x89'))][(_0xfa23('0x8a'))](_0xfa23('0xa9'));}_0x32de79=_0x19111c;var _0x196a20={};_0x196a20[_0xfa23('0x43')]=_[_0xfa23('0xb5')](db[_[_0xfa23('0x98')](_0x1b12fc[_0xfa23('0x47')]['channel'])+_0xfa23('0xbd')][_0xfa23('0x42')]);_0x196a20[_0xfa23('0x47')]=_[_0xfa23('0xb5')](_0x1b12fc[_0xfa23('0x47')]);_0x196a20[_0xfa23('0x48')]=_[_0xfa23('0x60')](_0x196a20[_0xfa23('0x43')],_0x196a20[_0xfa23('0x47')]);_0x4682d5[_0xfa23('0x49')]=_['intersection'](_0x196a20[_0xfa23('0x43')],qs['fields'](_0x1b12fc[_0xfa23('0x47')][_0xfa23('0x4a')]));_0x4682d5['attributes']=_0x4682d5[_0xfa23('0x49')][_0xfa23('0x4b')]?_0x4682d5[_0xfa23('0x49')]:_0x196a20['model'];_0x4682d5[_0xfa23('0x4d')]=qs['sort'](_0x1b12fc[_0xfa23('0x47')]['sort']);_0x4682d5[_0xfa23('0x4f')]=qs[_0xfa23('0x48')](_[_0xfa23('0x50')](_0x1b12fc[_0xfa23('0x47')],_0x196a20[_0xfa23('0x48')]));if(_0x1b12fc[_0xfa23('0x47')][_0xfa23('0x36')]){_0x4682d5[_0xfa23('0x4f')]=_[_0xfa23('0x51')](_0x4682d5[_0xfa23('0x4f')],{'$or':_[_0xfa23('0x52')](_0x4682d5['attributes'],function(_0x487203){var _0x188ce1={};_0x188ce1[_0x487203]={'$like':'%'+_0x1b12fc['query']['filter']+'%'};return _0x188ce1;})});}_0x4682d5=_[_0xfa23('0x51')]({},_0x4682d5,_0x1b12fc[_0xfa23('0x59')]);switch(_0x32de79[_0xfa23('0x39')]){case _0xfa23('0x69'):return db[_[_0xfa23('0x98')](_0x1b12fc['query']['channel'])+_0xfa23('0xbd')][_0xfa23('0x5d')](_0x4682d5);case _0xfa23('0x32'):case _0xfa23('0x34'):return _0x32de79['get'+_['capitalize'](_0x1b12fc[_0xfa23('0x47')][_0xfa23('0x93')])+'Queues'](_0x4682d5);default:throw new db[(_0xfa23('0x89'))][(_0xfa23('0x8a'))](_0xfa23('0xbe'));}})[_0xfa23('0x1c')](function(_0x30f53e){_0x455a62=_0x30f53e[_0xfa23('0x4b')];if(!_0x1b12fc[_0xfa23('0x47')][_0xfa23('0x4c')](_0xfa23('0xbf'))){_0x4682d5[_0xfa23('0x2a')]=qs[_0xfa23('0x2a')](_0x1b12fc[_0xfa23('0x47')][_0xfa23('0x2a')]);_0x4682d5[_0xfa23('0x29')]=qs['offset'](_0x1b12fc['query'][_0xfa23('0x29')]);}switch(_0x32de79[_0xfa23('0x39')]){case _0xfa23('0x69'):return db[_[_0xfa23('0x98')](_0x1b12fc[_0xfa23('0x47')][_0xfa23('0x93')])+'Queue'][_0xfa23('0x5d')](_0x4682d5);case _0xfa23('0x32'):case _0xfa23('0x34'):return _0x32de79[_0xfa23('0x30')+_[_0xfa23('0x98')](_0x1b12fc[_0xfa23('0x47')][_0xfa23('0x93')])+_0xfa23('0x9a')](_0x4682d5);}})[_0xfa23('0x1c')](function(_0x1a3682){return{'count':_0x455a62,'rows':_0x1a3682};})['then'](respondWithResult(_0x50f99e,null))[_0xfa23('0x25')](handleError(_0x50f99e,null));};exports['getVoiceQueuesRt']=function(_0x1f5f9e,_0x3d4904,_0x40c138){var _0x50acd1={};var _0x462ea8={};var _0x549666;var _0x1038b8;return db['User'][_0xfa23('0x90')]({'where':{'id':_0x1f5f9e[_0xfa23('0x66')]['id']}})[_0xfa23('0x1c')](handleEntityNotFound(_0x3d4904,null))[_0xfa23('0x1c')](function(_0x25b357){if(_0x25b357){_0x549666=_0x25b357;_0x462ea8[_0xfa23('0x43')]=_[_0xfa23('0xb5')](db[_0xfa23('0xa6')][_0xfa23('0x42')]);_0x462ea8[_0xfa23('0x47')]=_[_0xfa23('0xb5')](_0x1f5f9e[_0xfa23('0x47')]);_0x462ea8[_0xfa23('0x48')]=_[_0xfa23('0x60')](_0x462ea8[_0xfa23('0x43')],_0x462ea8['query']);_0x50acd1[_0xfa23('0x49')]=_[_0xfa23('0x60')](_0x462ea8['model'],qs['fields'](_0x1f5f9e[_0xfa23('0x47')][_0xfa23('0x4a')]));_0x50acd1[_0xfa23('0x49')]=_0x50acd1['attributes'][_0xfa23('0x4b')]?_0x50acd1[_0xfa23('0x49')]:_0x462ea8[_0xfa23('0x43')];_0x50acd1[_0xfa23('0x4d')]=qs['sort'](_0x1f5f9e[_0xfa23('0x47')][_0xfa23('0x4e')]);_0x50acd1[_0xfa23('0x4f')]=qs[_0xfa23('0x48')](_[_0xfa23('0x50')](_0x1f5f9e[_0xfa23('0x47')],_0x462ea8[_0xfa23('0x48')]));if(_0x1f5f9e[_0xfa23('0x47')][_0xfa23('0x36')]){_0x50acd1[_0xfa23('0x4f')]=_['merge'](_0x50acd1[_0xfa23('0x4f')],{'$or':_[_0xfa23('0x52')](_0x50acd1[_0xfa23('0x49')],function(_0x4854ef){var _0x68895d={};_0x68895d[_0x4854ef]={'$like':'%'+_0x1f5f9e['query'][_0xfa23('0x36')]+'%'};return _0x68895d;})});}_0x50acd1=_[_0xfa23('0x51')]({},_0x50acd1,_0x1f5f9e[_0xfa23('0x59')]);return _0x549666[_0xfa23('0xc0')](_0x50acd1);}})['then'](function(_0x46d5a3){if(_0x46d5a3){_0x1038b8=_0x46d5a3[_0xfa23('0x4b')];if(!_0x1f5f9e[_0xfa23('0x47')][_0xfa23('0x4c')](_0xfa23('0xbf'))){_0x50acd1[_0xfa23('0x2a')]=qs[_0xfa23('0x2a')](_0x1f5f9e[_0xfa23('0x47')]['limit']);_0x50acd1[_0xfa23('0x29')]=qs[_0xfa23('0x29')](_0x1f5f9e['query']['offset']);}return _0x549666['getVoiceQueuesRt'](_0x50acd1);}})['then'](function(_0x34c412){if(_0x34c412){return _0x34c412?{'count':_0x1038b8,'rows':_0x34c412}:null;}})[_0xfa23('0x1c')](respondWithResult(_0x3d4904,null))[_0xfa23('0x25')](handleError(_0x3d4904,null));};exports[_0xfa23('0xc1')]=function(_0x2908e1,_0xa70876,_0xa1f3e7){var _0x5d2fd3={};var _0x1515ab={};var _0x31d48c;var _0x21248f;return db[_0xfa23('0x5a')][_0xfa23('0x90')]({'where':{'id':_0x2908e1['params']['id']}})[_0xfa23('0x1c')](handleEntityNotFound(_0xa70876,null))[_0xfa23('0x1c')](function(_0x49146f){if(_0x49146f){_0x31d48c=_0x49146f;_0x1515ab[_0xfa23('0x43')]=_[_0xfa23('0xb5')](db[_0xfa23('0xc2')][_0xfa23('0x42')]);_0x1515ab[_0xfa23('0x47')]=_[_0xfa23('0xb5')](_0x2908e1['query']);_0x1515ab[_0xfa23('0x48')]=_['intersection'](_0x1515ab['model'],_0x1515ab[_0xfa23('0x47')]);_0x5d2fd3['attributes']=_['intersection'](_0x1515ab[_0xfa23('0x43')],qs[_0xfa23('0x4a')](_0x2908e1[_0xfa23('0x47')][_0xfa23('0x4a')]));_0x5d2fd3['attributes']=_0x5d2fd3[_0xfa23('0x49')][_0xfa23('0x4b')]?_0x5d2fd3[_0xfa23('0x49')]:_0x1515ab['model'];_0x5d2fd3[_0xfa23('0x4d')]=qs[_0xfa23('0x4e')](_0x2908e1[_0xfa23('0x47')][_0xfa23('0x4e')]);_0x5d2fd3[_0xfa23('0x4f')]=qs[_0xfa23('0x48')](_[_0xfa23('0x50')](_0x2908e1[_0xfa23('0x47')],_0x1515ab[_0xfa23('0x48')]));if(_0x2908e1['query'][_0xfa23('0x36')]){_0x5d2fd3['where']=_[_0xfa23('0x51')](_0x5d2fd3[_0xfa23('0x4f')],{'$or':_[_0xfa23('0x52')](_0x5d2fd3[_0xfa23('0x49')],function(_0x14a1de){var _0xfa092c={};_0xfa092c[_0x14a1de]={'$like':'%'+_0x2908e1['query'][_0xfa23('0x36')]+'%'};return _0xfa092c;})});}_0x5d2fd3=_['merge']({},_0x5d2fd3,_0x2908e1[_0xfa23('0x59')]);return _0x31d48c['getGroups'](_0x5d2fd3);}})[_0xfa23('0x1c')](function(_0x142108){if(_0x142108){_0x21248f=_0x142108[_0xfa23('0x4b')];if(!_0x2908e1[_0xfa23('0x47')][_0xfa23('0x4c')](_0xfa23('0xbf'))){_0x5d2fd3[_0xfa23('0x2a')]=qs[_0xfa23('0x2a')](_0x2908e1[_0xfa23('0x47')][_0xfa23('0x2a')]);_0x5d2fd3[_0xfa23('0x29')]=qs[_0xfa23('0x29')](_0x2908e1['query'][_0xfa23('0x29')]);}return _0x31d48c[_0xfa23('0xc1')](_0x5d2fd3);}})[_0xfa23('0x1c')](function(_0x38ee58){if(_0x38ee58){return _0x38ee58?{'count':_0x21248f,'rows':_0x38ee58}:null;}})[_0xfa23('0x1c')](respondWithResult(_0xa70876,null))[_0xfa23('0x25')](handleError(_0xa70876,null));};exports['getRecordings']=function(_0x3da733,_0xeaddfe,_0x3498b0){var _0x5ee1fb={'raw':!![],'where':{}};var _0xd13789={};var _0x1b2f4d={'count':0x0,'rows':[]};return db[_0xfa23('0x5a')][_0xfa23('0x90')]({'where':{'id':_0x3da733['params']['id']}})[_0xfa23('0x1c')](handleEntityNotFound(_0xeaddfe,null))[_0xfa23('0x1c')](function(_0x4ecd95){if(_0x4ecd95){_0xd13789[_0xfa23('0x43')]=_[_0xfa23('0xb5')](db['VoiceRecording'][_0xfa23('0x42')]);_0xd13789[_0xfa23('0x47')]=_[_0xfa23('0xb5')](_0x3da733[_0xfa23('0x47')]);_0xd13789[_0xfa23('0x48')]=_[_0xfa23('0x60')](_0xd13789[_0xfa23('0x43')],_0xd13789['query']);_0x5ee1fb['attributes']=_['intersection'](_0xd13789[_0xfa23('0x43')],qs[_0xfa23('0x4a')](_0x3da733['query']['fields']));_0x5ee1fb[_0xfa23('0x49')]=_0x5ee1fb[_0xfa23('0x49')][_0xfa23('0x4b')]?_0x5ee1fb[_0xfa23('0x49')]:_0xd13789[_0xfa23('0x43')];if(!_0x3da733[_0xfa23('0x47')]['hasOwnProperty'](_0xfa23('0xbf'))){_0x5ee1fb[_0xfa23('0x2a')]=qs[_0xfa23('0x2a')](_0x3da733[_0xfa23('0x47')][_0xfa23('0x2a')]);_0x5ee1fb[_0xfa23('0x29')]=qs[_0xfa23('0x29')](_0x3da733[_0xfa23('0x47')]['offset']);}_0x5ee1fb[_0xfa23('0x4d')]=qs[_0xfa23('0x4e')](_0x3da733[_0xfa23('0x47')][_0xfa23('0x4e')]);_0x5ee1fb[_0xfa23('0x4f')]=qs[_0xfa23('0x48')](_[_0xfa23('0x50')](_0x3da733[_0xfa23('0x47')],_0xd13789['filters']));_0x5ee1fb[_0xfa23('0x4f')][_0xfa23('0xc3')]=_0x4ecd95['id'];if(_0x3da733[_0xfa23('0x47')][_0xfa23('0x36')]){_0x5ee1fb['where']=_['merge'](_0x5ee1fb[_0xfa23('0x4f')],{'$or':_['map'](_0x5ee1fb[_0xfa23('0x49')],function(_0x4ca1d4){var _0x25181f={};_0x25181f[_0x4ca1d4]={'$like':'%'+_0x3da733[_0xfa23('0x47')][_0xfa23('0x36')]+'%'};return _0x25181f;})});}_0x5ee1fb=_[_0xfa23('0x51')]({},_0x5ee1fb,_0x3da733['options']);return db[_0xfa23('0xc4')]['count']({'where':_0x5ee1fb[_0xfa23('0x4f')]})[_0xfa23('0x1c')](function(_0x279ffd){_0x1b2f4d['count']=_0x279ffd;if(_0x3da733[_0xfa23('0x47')][_0xfa23('0x61')]){_0x5ee1fb[_0xfa23('0x5c')]=[{'all':!![]}];}return db['VoiceRecording'][_0xfa23('0x5d')](_0x5ee1fb);})['then'](function(_0x4944af){_0x1b2f4d[_0xfa23('0x5e')]=_0x4944af;return _0x1b2f4d;});}})[_0xfa23('0x1c')](respondWithFilteredResult(_0xeaddfe,_0x5ee1fb))[_0xfa23('0x25')](handleError(_0xeaddfe,null));};exports[_0xfa23('0xc5')]=function(_0x68e9bf,_0x7f604,_0x7cdca5){var _0x5203ad={'raw':!![],'where':{}};var _0x1818aa={};var _0x259ef1={'count':0x0,'rows':[]};return db[_0xfa23('0x5a')][_0xfa23('0x90')]({'where':{'id':_0x68e9bf[_0xfa23('0x66')]['id']}})[_0xfa23('0x1c')](handleEntityNotFound(_0x7f604,null))[_0xfa23('0x1c')](function(_0x2f5a2c){if(_0x2f5a2c){_0x1818aa[_0xfa23('0x43')]=_[_0xfa23('0xb5')](db[_0xfa23('0xc6')][_0xfa23('0x42')]);_0x1818aa[_0xfa23('0x47')]=_[_0xfa23('0xb5')](_0x68e9bf['query']);_0x1818aa[_0xfa23('0x48')]=_[_0xfa23('0x60')](_0x1818aa[_0xfa23('0x43')],_0x1818aa[_0xfa23('0x47')]);_0x5203ad[_0xfa23('0x49')]=_[_0xfa23('0x60')](_0x1818aa['model'],qs[_0xfa23('0x4a')](_0x68e9bf[_0xfa23('0x47')][_0xfa23('0x4a')]));_0x5203ad[_0xfa23('0x49')]=_0x5203ad['attributes']['length']?_0x5203ad[_0xfa23('0x49')]:_0x1818aa[_0xfa23('0x43')];if(!_0x68e9bf[_0xfa23('0x47')][_0xfa23('0x4c')](_0xfa23('0xbf'))){_0x5203ad[_0xfa23('0x2a')]=qs[_0xfa23('0x2a')](_0x68e9bf[_0xfa23('0x47')][_0xfa23('0x2a')]);_0x5203ad['offset']=qs[_0xfa23('0x29')](_0x68e9bf[_0xfa23('0x47')][_0xfa23('0x29')]);}_0x5203ad[_0xfa23('0x4d')]=qs[_0xfa23('0x4e')](_0x68e9bf[_0xfa23('0x47')][_0xfa23('0x4e')]);_0x5203ad[_0xfa23('0x4f')]=qs['filters'](_[_0xfa23('0x50')](_0x68e9bf[_0xfa23('0x47')],_0x1818aa[_0xfa23('0x48')]));_0x5203ad[_0xfa23('0x4f')][_0xfa23('0xc3')]=_0x2f5a2c['id'];if(_0x68e9bf[_0xfa23('0x47')][_0xfa23('0x36')]){_0x5203ad[_0xfa23('0x4f')]=_[_0xfa23('0x51')](_0x5203ad[_0xfa23('0x4f')],{'$or':_[_0xfa23('0x52')](_0x5203ad[_0xfa23('0x49')],function(_0x1122f0){var _0x5dca58={};_0x5dca58[_0x1122f0]={'$like':'%'+_0x68e9bf['query'][_0xfa23('0x36')]+'%'};return _0x5dca58;})});}_0x5203ad=_['merge']({},_0x5203ad,_0x68e9bf['options']);return db[_0xfa23('0xc6')][_0xfa23('0x5b')]({'where':_0x5203ad[_0xfa23('0x4f')]})[_0xfa23('0x1c')](function(_0x465a6e){_0x259ef1[_0xfa23('0x5b')]=_0x465a6e;if(_0x68e9bf['query'][_0xfa23('0x61')]){_0x5203ad[_0xfa23('0x5c')]=[{'all':!![]}];}return db['ScreenRecording'][_0xfa23('0x5d')](_0x5203ad);})[_0xfa23('0x1c')](function(_0x36875f){_0x259ef1['rows']=_0x36875f;return _0x259ef1;});}})[_0xfa23('0x1c')](respondWithFilteredResult(_0x7f604,_0x5203ad))['catch'](handleError(_0x7f604,null));};exports['getChatInteractions']=function(_0x59dd19,_0x4b3d49,_0x4ba208){var _0x3cc338={};var _0x30dc8a={};var _0x18a474;var _0x2f01d0;return db[_0xfa23('0x5a')][_0xfa23('0x90')]({'where':{'id':_0x59dd19['params']['id']}})[_0xfa23('0x1c')](handleEntityNotFound(_0x4b3d49,null))[_0xfa23('0x1c')](function(_0x34fc24){if(_0x34fc24){_0x18a474=_0x34fc24;_0x30dc8a[_0xfa23('0x43')]=_[_0xfa23('0xb5')](db[_0xfa23('0xc7')][_0xfa23('0x42')]);_0x30dc8a[_0xfa23('0x47')]=_[_0xfa23('0xb5')](_0x59dd19[_0xfa23('0x47')]);_0x30dc8a[_0xfa23('0x48')]=_[_0xfa23('0x60')](_0x30dc8a[_0xfa23('0x43')],_0x30dc8a[_0xfa23('0x47')]);_0x3cc338[_0xfa23('0x49')]=_[_0xfa23('0x60')](_0x30dc8a[_0xfa23('0x43')],qs[_0xfa23('0x4a')](_0x59dd19[_0xfa23('0x47')][_0xfa23('0x4a')]));_0x3cc338[_0xfa23('0x49')]=_0x3cc338[_0xfa23('0x49')][_0xfa23('0x4b')]?_0x3cc338[_0xfa23('0x49')]:_0x30dc8a[_0xfa23('0x43')];_0x3cc338[_0xfa23('0x4d')]=qs[_0xfa23('0x4e')](_0x59dd19[_0xfa23('0x47')]['sort']);_0x3cc338[_0xfa23('0x4f')]=qs['filters'](_[_0xfa23('0x50')](_0x59dd19[_0xfa23('0x47')],_0x30dc8a[_0xfa23('0x48')]));if(_0x59dd19[_0xfa23('0x47')][_0xfa23('0x36')]){_0x3cc338[_0xfa23('0x4f')]=_['merge'](_0x3cc338[_0xfa23('0x4f')],{'$or':_[_0xfa23('0x52')](_0x3cc338[_0xfa23('0x49')],function(_0x20df73){var _0x3ae911={};_0x3ae911[_0x20df73]={'$like':'%'+_0x59dd19[_0xfa23('0x47')][_0xfa23('0x36')]+'%'};return _0x3ae911;})});}_0x3cc338=_[_0xfa23('0x51')]({},_0x3cc338,_0x59dd19[_0xfa23('0x59')]);return _0x18a474[_0xfa23('0xc8')](_0x3cc338);}})[_0xfa23('0x1c')](function(_0x2841ca){if(_0x2841ca){_0x2f01d0=_0x2841ca['length'];if(!_0x59dd19[_0xfa23('0x47')][_0xfa23('0x4c')]('nolimit')){_0x3cc338['limit']=qs[_0xfa23('0x2a')](_0x59dd19[_0xfa23('0x47')][_0xfa23('0x2a')]);_0x3cc338['offset']=qs[_0xfa23('0x29')](_0x59dd19[_0xfa23('0x47')]['offset']);}return _0x18a474[_0xfa23('0xc8')](_0x3cc338);}})[_0xfa23('0x1c')](function(_0x2f7585){if(_0x2f7585){return _0x2f7585?{'count':_0x2f01d0,'rows':_0x2f7585}:null;}})[_0xfa23('0x1c')](respondWithResult(_0x4b3d49,null))['catch'](handleError(_0x4b3d49,null));};exports[_0xfa23('0xc9')]=function(_0x4d5c21,_0x2dedc1,_0x47756d){var _0x17f6b5={};var _0x279e54={};var _0x1f9d09;var _0x3c3c39;return db['User']['findOne']({'where':{'id':_0x4d5c21[_0xfa23('0x66')]['id']}})[_0xfa23('0x1c')](handleEntityNotFound(_0x2dedc1,null))[_0xfa23('0x1c')](function(_0x2e705a){if(_0x2e705a){_0x1f9d09=_0x2e705a;_0x279e54['model']=_[_0xfa23('0xb5')](db[_0xfa23('0xca')][_0xfa23('0x42')]);_0x279e54[_0xfa23('0x47')]=_[_0xfa23('0xb5')](_0x4d5c21['query']);_0x279e54['filters']=_[_0xfa23('0x60')](_0x279e54[_0xfa23('0x43')],_0x279e54[_0xfa23('0x47')]);_0x17f6b5[_0xfa23('0x49')]=_[_0xfa23('0x60')](_0x279e54['model'],qs['fields'](_0x4d5c21[_0xfa23('0x47')][_0xfa23('0x4a')]));_0x17f6b5['attributes']=_0x17f6b5[_0xfa23('0x49')][_0xfa23('0x4b')]?_0x17f6b5[_0xfa23('0x49')]:_0x279e54[_0xfa23('0x43')];_0x17f6b5[_0xfa23('0x4d')]=qs[_0xfa23('0x4e')](_0x4d5c21[_0xfa23('0x47')][_0xfa23('0x4e')]);_0x17f6b5['where']=qs['filters'](_[_0xfa23('0x50')](_0x4d5c21[_0xfa23('0x47')],_0x279e54[_0xfa23('0x48')]));if(_0x4d5c21[_0xfa23('0x47')]['filter']){_0x17f6b5['where']=_[_0xfa23('0x51')](_0x17f6b5[_0xfa23('0x4f')],{'$or':_['map'](_0x17f6b5['attributes'],function(_0x5d6722){var _0x35b31f={};_0x35b31f[_0x5d6722]={'$like':'%'+_0x4d5c21[_0xfa23('0x47')][_0xfa23('0x36')]+'%'};return _0x35b31f;})});}_0x17f6b5=_[_0xfa23('0x51')]({},_0x17f6b5,_0x4d5c21['options']);return _0x1f9d09[_0xfa23('0xc9')](_0x17f6b5);}})[_0xfa23('0x1c')](function(_0x4b649b){if(_0x4b649b){_0x3c3c39=_0x4b649b[_0xfa23('0x4b')];if(!_0x4d5c21['query'][_0xfa23('0x4c')](_0xfa23('0xbf'))){_0x17f6b5[_0xfa23('0x2a')]=qs['limit'](_0x4d5c21[_0xfa23('0x47')][_0xfa23('0x2a')]);_0x17f6b5[_0xfa23('0x29')]=qs[_0xfa23('0x29')](_0x4d5c21['query'][_0xfa23('0x29')]);}return _0x1f9d09[_0xfa23('0xc9')](_0x17f6b5);}})['then'](function(_0x5ea303){if(_0x5ea303){return _0x5ea303?{'count':_0x3c3c39,'rows':_0x5ea303}:null;}})[_0xfa23('0x1c')](respondWithResult(_0x2dedc1,null))[_0xfa23('0x25')](handleError(_0x2dedc1,null));};exports[_0xfa23('0xcb')]=function(_0x294333,_0x4820f0,_0x2d6716){var _0x537cb2={'raw':!![],'where':{}};var _0xb93e1d={};var _0xc60c3f={'count':0x0,'rows':[]};return db[_0xfa23('0x5a')][_0xfa23('0x90')]({'where':{'id':_0x294333[_0xfa23('0x66')]['id']}})[_0xfa23('0x1c')](handleEntityNotFound(_0x4820f0,null))['then'](function(_0x22b854){if(_0x22b854){_0xb93e1d['model']=_[_0xfa23('0xb5')](db['MailInteraction'][_0xfa23('0x42')]);_0xb93e1d[_0xfa23('0x47')]=_[_0xfa23('0xb5')](_0x294333[_0xfa23('0x47')]);_0xb93e1d[_0xfa23('0x48')]=_[_0xfa23('0x60')](_0xb93e1d['model'],_0xb93e1d[_0xfa23('0x47')]);_0x537cb2[_0xfa23('0x49')]=_[_0xfa23('0x60')](_0xb93e1d['model'],qs['fields'](_0x294333[_0xfa23('0x47')][_0xfa23('0x4a')]));_0x537cb2['attributes']=_0x537cb2['attributes']['length']?_0x537cb2[_0xfa23('0x49')]:_0xb93e1d[_0xfa23('0x43')];if(!_0x294333[_0xfa23('0x47')]['hasOwnProperty'](_0xfa23('0xbf'))){_0x537cb2[_0xfa23('0x2a')]=qs['limit'](_0x294333[_0xfa23('0x47')][_0xfa23('0x2a')]);_0x537cb2[_0xfa23('0x29')]=qs[_0xfa23('0x29')](_0x294333[_0xfa23('0x47')][_0xfa23('0x29')]);}_0x537cb2[_0xfa23('0x4d')]=qs[_0xfa23('0x4e')](_0x294333[_0xfa23('0x47')][_0xfa23('0x4e')]);_0x537cb2['where']=qs[_0xfa23('0x48')](_[_0xfa23('0x50')](_0x294333[_0xfa23('0x47')],_0xb93e1d[_0xfa23('0x48')]));_0x537cb2['where'][_0xfa23('0xc3')]=_0x22b854['id'];if(_0x294333['query'][_0xfa23('0x36')]){_0x537cb2[_0xfa23('0x4f')]=_[_0xfa23('0x51')](_0x537cb2['where'],{'$or':_['map'](_0x537cb2[_0xfa23('0x49')],function(_0x47f445){var _0x5cc792={};_0x5cc792[_0x47f445]={'$like':'%'+_0x294333['query'][_0xfa23('0x36')]+'%'};return _0x5cc792;})});}_0x537cb2=_['merge']({},_0x537cb2,_0x294333[_0xfa23('0x59')]);return db[_0xfa23('0xcc')][_0xfa23('0x5b')]({'where':_0x537cb2[_0xfa23('0x4f')]})[_0xfa23('0x1c')](function(_0x49af93){_0xc60c3f[_0xfa23('0x5b')]=_0x49af93;if(_0x294333['query'][_0xfa23('0x61')]){_0x537cb2[_0xfa23('0x5c')]=[{'all':!![]}];}return db[_0xfa23('0xcc')][_0xfa23('0x5d')](_0x537cb2);})['then'](function(_0x2b5b08){_0xc60c3f[_0xfa23('0x5e')]=_0x2b5b08;return _0xc60c3f;});}})[_0xfa23('0x1c')](respondWithFilteredResult(_0x4820f0,_0x537cb2))[_0xfa23('0x25')](handleError(_0x4820f0,null));};exports[_0xfa23('0xcd')]=function(_0xde8421,_0x46bc8d,_0x287d35){var _0x25f86d={};var _0x37d2ee={};var _0x5b8828;var _0x367304;return db[_0xfa23('0x5a')][_0xfa23('0x90')]({'where':{'id':_0xde8421['params']['id']}})[_0xfa23('0x1c')](handleEntityNotFound(_0x46bc8d,null))[_0xfa23('0x1c')](function(_0x212e8d){if(_0x212e8d){_0x5b8828=_0x212e8d;_0x37d2ee[_0xfa23('0x43')]=_['keys'](db['SmsInteraction'][_0xfa23('0x42')]);_0x37d2ee[_0xfa23('0x47')]=_[_0xfa23('0xb5')](_0xde8421[_0xfa23('0x47')]);_0x37d2ee[_0xfa23('0x48')]=_['intersection'](_0x37d2ee['model'],_0x37d2ee[_0xfa23('0x47')]);_0x25f86d['attributes']=_[_0xfa23('0x60')](_0x37d2ee[_0xfa23('0x43')],qs[_0xfa23('0x4a')](_0xde8421[_0xfa23('0x47')]['fields']));_0x25f86d['attributes']=_0x25f86d[_0xfa23('0x49')][_0xfa23('0x4b')]?_0x25f86d['attributes']:_0x37d2ee['model'];_0x25f86d[_0xfa23('0x4d')]=qs['sort'](_0xde8421[_0xfa23('0x47')][_0xfa23('0x4e')]);_0x25f86d[_0xfa23('0x4f')]=qs[_0xfa23('0x48')](_[_0xfa23('0x50')](_0xde8421[_0xfa23('0x47')],_0x37d2ee[_0xfa23('0x48')]));if(_0xde8421['query']['filter']){_0x25f86d[_0xfa23('0x4f')]=_[_0xfa23('0x51')](_0x25f86d[_0xfa23('0x4f')],{'$or':_['map'](_0x25f86d[_0xfa23('0x49')],function(_0x11eb8c){var _0xf1739e={};_0xf1739e[_0x11eb8c]={'$like':'%'+_0xde8421[_0xfa23('0x47')][_0xfa23('0x36')]+'%'};return _0xf1739e;})});}_0x25f86d=_[_0xfa23('0x51')]({},_0x25f86d,_0xde8421[_0xfa23('0x59')]);return _0x5b8828[_0xfa23('0xcd')](_0x25f86d);}})['then'](function(_0x15782f){if(_0x15782f){_0x367304=_0x15782f[_0xfa23('0x4b')];if(!_0xde8421['query']['hasOwnProperty']('nolimit')){_0x25f86d[_0xfa23('0x2a')]=qs[_0xfa23('0x2a')](_0xde8421[_0xfa23('0x47')][_0xfa23('0x2a')]);_0x25f86d[_0xfa23('0x29')]=qs[_0xfa23('0x29')](_0xde8421[_0xfa23('0x47')]['offset']);}return _0x5b8828[_0xfa23('0xcd')](_0x25f86d);}})[_0xfa23('0x1c')](function(_0x476bd9){if(_0x476bd9){return _0x476bd9?{'count':_0x367304,'rows':_0x476bd9}:null;}})[_0xfa23('0x1c')](respondWithResult(_0x46bc8d,null))[_0xfa23('0x25')](handleError(_0x46bc8d,null));};exports[_0xfa23('0xce')]=function(_0x12693b,_0x48a741,_0xeaa08c){var _0x334ea5={};var _0x68b035={};var _0x49407d;var _0x353b3c;return db[_0xfa23('0x5a')][_0xfa23('0x90')]({'where':{'id':_0x12693b[_0xfa23('0x66')]['id']}})[_0xfa23('0x1c')](handleEntityNotFound(_0x48a741,null))[_0xfa23('0x1c')](function(_0x51fb96){if(_0x51fb96){_0x49407d=_0x51fb96;_0x68b035[_0xfa23('0x43')]=_[_0xfa23('0xb5')](db[_0xfa23('0xcf')][_0xfa23('0x42')]);_0x68b035[_0xfa23('0x47')]=_[_0xfa23('0xb5')](_0x12693b[_0xfa23('0x47')]);_0x68b035[_0xfa23('0x48')]=_[_0xfa23('0x60')](_0x68b035['model'],_0x68b035[_0xfa23('0x47')]);_0x334ea5[_0xfa23('0x49')]=_[_0xfa23('0x60')](_0x68b035[_0xfa23('0x43')],qs[_0xfa23('0x4a')](_0x12693b[_0xfa23('0x47')]['fields']));_0x334ea5['attributes']=_0x334ea5[_0xfa23('0x49')][_0xfa23('0x4b')]?_0x334ea5[_0xfa23('0x49')]:_0x68b035[_0xfa23('0x43')];_0x334ea5[_0xfa23('0x4d')]=qs[_0xfa23('0x4e')](_0x12693b['query'][_0xfa23('0x4e')]);_0x334ea5[_0xfa23('0x4f')]=qs[_0xfa23('0x48')](_[_0xfa23('0x50')](_0x12693b[_0xfa23('0x47')],_0x68b035[_0xfa23('0x48')]));if(_0x12693b[_0xfa23('0x47')][_0xfa23('0x36')]){_0x334ea5['where']=_['merge'](_0x334ea5[_0xfa23('0x4f')],{'$or':_[_0xfa23('0x52')](_0x334ea5[_0xfa23('0x49')],function(_0x52382f){var _0x7dd457={};_0x7dd457[_0x52382f]={'$like':'%'+_0x12693b[_0xfa23('0x47')][_0xfa23('0x36')]+'%'};return _0x7dd457;})});}_0x334ea5=_[_0xfa23('0x51')]({},_0x334ea5,_0x12693b['options']);return _0x49407d[_0xfa23('0xce')](_0x334ea5);}})['then'](function(_0x3bd0aa){if(_0x3bd0aa){_0x353b3c=_0x3bd0aa[_0xfa23('0x4b')];if(!_0x12693b['query'][_0xfa23('0x4c')]('nolimit')){_0x334ea5[_0xfa23('0x2a')]=qs[_0xfa23('0x2a')](_0x12693b['query'][_0xfa23('0x2a')]);_0x334ea5['offset']=qs[_0xfa23('0x29')](_0x12693b[_0xfa23('0x47')][_0xfa23('0x29')]);}return _0x49407d['getFaxInteractions'](_0x334ea5);}})[_0xfa23('0x1c')](function(_0x4a48c3){if(_0x4a48c3){return _0x4a48c3?{'count':_0x353b3c,'rows':_0x4a48c3}:null;}})['then'](respondWithResult(_0x48a741,null))[_0xfa23('0x25')](handleError(_0x48a741,null));};exports['login']=function(_0x124dc5,_0x20bb78,_0xa97533){var _0x4af0a6;var _0x5c5f81;var _0x2fe2a3;var _0x400292=!_[_0xfa23('0x6c')](_0x124dc5['params']['id'])?_0x124dc5[_0xfa23('0x66')]['id']:!_[_0xfa23('0x6c')](_0x124dc5[_0xfa23('0x32')]['id'])?_0x124dc5['user']['id']:null;return db[_0xfa23('0x5a')][_0xfa23('0x3a')]({'where':{'id':_0x400292,'role':_0xfa23('0x34')},'attributes':['id',_0xfa23('0x3f'),_0xfa23('0xd0'),_0xfa23('0xd1'),_0xfa23('0x39'),_0xfa23('0x72'),_0xfa23('0x94')]})[_0xfa23('0x1c')](handleEntityNotFound(_0x20bb78,null))[_0xfa23('0x1c')](function(_0x1ed1b6){if(_0x1ed1b6){_0x4af0a6=_0x1ed1b6;if(_0x124dc5['body']['interface']){_0x2fe2a3=util[_0xfa23('0x6d')](_0xfa23('0xd2'),_0x4af0a6[_0x124dc5['body'][_0xfa23('0x96')]]);}else if(_0x124dc5['body']['intrf']){_0x2fe2a3=util['format'](_0xfa23('0xa4'),_0x124dc5[_0xfa23('0x63')][_0xfa23('0xd3')]);}else{_0x2fe2a3=util[_0xfa23('0x6d')](_0xfa23('0xa4'),_0x4af0a6[_0xfa23('0x3f')]);}socket['to'](util['format']('user:%s',_0x4af0a6['name']))[_0xfa23('0x9e')]('user:forcelogout',{'ip':_0x124dc5[_0xfa23('0xd4')][_0xfa23('0xd5')]||_0x124dc5[_0xfa23('0xd6')][_0xfa23('0xd7')]||_0x124dc5[_0xfa23('0xd8')][_0xfa23('0xd7')]||_0x124dc5[_0xfa23('0xd6')]['socket']['remoteAddress']});return db[_0xfa23('0xa6')][_0xfa23('0x2f')]({'where':{'membername':_0x4af0a6[_0xfa23('0x3f')]},'individualHooks':!![]});}})[_0xfa23('0x1c')](function(_0xae3c1a){if(_0x4af0a6){return _0x4af0a6['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x3762f0){var _0x23fa37=[];if(_0x3762f0){_0x5c5f81=_0x3762f0;if(_0x5c5f81[_0xfa23('0x4b')]){for(var _0x581bad=0x0;_0x581bad<_0x5c5f81['length'];_0x581bad++){_0x23fa37[_0xfa23('0xa3')]({'membername':_0x4af0a6[_0xfa23('0x3f')],'UserId':_0x4af0a6['id'],'queue_name':_0x5c5f81[_0x581bad][_0xfa23('0x3f')],'VoiceQueueId':_0x5c5f81[_0x581bad]['id'],'interface':_0x2fe2a3,'paused':_0x4af0a6['loginInPause']||![],'penalty':_0x5c5f81[_0x581bad][_0xfa23('0xd9')]||0x0});}return BPromise[_0xfa23('0xa5')](_0x23fa37,function(_0x284237){return db['UserVoiceQueueRt'][_0xfa23('0xa7')](_0x284237);});}}})['then'](function(){return db[_0xfa23('0xda')][_0xfa23('0x5d')]({'where':{'membername':_0x4af0a6[_0xfa23('0x3f')],'exitAt':null}});})[_0xfa23('0x1c')](function(_0xafcd9c){var _0x3e8b07=[];_0xafcd9c['forEach'](function(_0x209f96){_0x3e8b07[_0xfa23('0xa3')](_0x209f96['update']({'exitAt':moment()[_0xfa23('0x6d')](_0xfa23('0xdb'))}));});return BPromise['all'](_0x3e8b07);})[_0xfa23('0x1c')](function(){var _0x4a002b=[];var _0x3ac6c2=[];var _0x5d9020=utils[_0xfa23('0xdc')]();var _0x3198d5={'membername':_0x4af0a6[_0xfa23('0x3f')],'interface':_0x2fe2a3,'enterAt':moment()[_0xfa23('0x6d')](_0xfa23('0xdb')),'role':_0x4af0a6[_0xfa23('0x39')],'internal':_0x4af0a6['internal']};_0x5d9020[_0xfa23('0xdd')](function(_0x4fa51e){_0x4a002b[_0xfa23('0xa3')](_['merge']({'channel':_0x4fa51e,'type':'LOGIN','data1':_0x124dc5[_0xfa23('0x63')][_0xfa23('0xde')],'data2':_0x2fe2a3},_0x3198d5));if(_0x4af0a6[_0xfa23('0x94')]){_0x3ac6c2['push'](_[_0xfa23('0x51')]({'channel':_0x4fa51e,'type':_0xfa23('0xdf'),'data1':_0xfa23('0xe0')},_0x3198d5));}});return db['MemberReport'][_0xfa23('0x62')](_0x4a002b[_0xfa23('0xe1')](_0x3ac6c2),{'individualHooks':!![]});})['then'](function(){return _0x4af0a6[_0xfa23('0x2e')]({'online':!![],'lastLoginAt':moment()['format'](_0xfa23('0xdb')),'voicePause':_0x4af0a6[_0xfa23('0x94')]||![],'mailPause':_0x4af0a6[_0xfa23('0x94')]||![],'chatPause':_0x4af0a6['loginInPause']||![],'faxPause':_0x4af0a6[_0xfa23('0x94')]||![],'smsPause':_0x4af0a6[_0xfa23('0x94')]||![],'openchannelPause':_0x4af0a6['loginInPause']||![],'pauseType':_0x4af0a6[_0xfa23('0x94')]?'LOGININPAUSE':null,'interface':_0x2fe2a3,'lastPauseAt':moment()[_0xfa23('0x6d')](_0xfa23('0xdb'))});})[_0xfa23('0x1c')](function(_0x347451){if(_0x124dc5[_0xfa23('0xe2')]){return _0xa97533();}else{return BPromise[_0xfa23('0xe3')](_0x347451)[_0xfa23('0x1c')](respondWithResult(_0x20bb78,null));}})['catch'](handleError(_0x20bb78,null));};exports[_0xfa23('0xe4')]=function(_0x20885d,_0x277e77,_0x321903){var _0x9c1b70;return db[_0xfa23('0x5a')]['find']({'where':{'id':_0x20885d[_0xfa23('0x66')]['id'],'role':_0xfa23('0x34')},'attributes':['id','name',_0xfa23('0x39')]})[_0xfa23('0x1c')](handleEntityNotFound(_0x277e77,null))[_0xfa23('0x1c')](function(_0x483a53){if(_0x483a53){_0x9c1b70=_0x483a53;return db[_0xfa23('0xa6')]['destroy']({'where':{'membername':_0x9c1b70['name']},'individualHooks':!![]});}})[_0xfa23('0x1c')](function(){return db[_0xfa23('0xda')][_0xfa23('0x5d')]({'where':{'membername':_0x9c1b70['name'],'exitAt':null}});})['then'](function(_0x1cb2ba){var _0x35c917=[];_0x1cb2ba[_0xfa23('0xdd')](function(_0x114c22){_0x35c917[_0xfa23('0xa3')](_0x114c22[_0xfa23('0x2e')]({'exitAt':moment()['format'](_0xfa23('0xdb'))}));});return BPromise['all'](_0x35c917);})['then'](function(){return _0x9c1b70[_0xfa23('0x2e')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0xfa23('0x1c')](respondWithResult(_0x277e77,null))['catch'](handleError(_0x277e77,null));};exports[_0xfa23('0xe5')]=function(_0x4d0f53,_0x244dc7,_0x5462aa){var _0x91ba2e;return db[_0xfa23('0xa6')]['update']({'paused':0x1},{'where':{'UserId':_0x4d0f53[_0xfa23('0x66')]['id']},'individualHooks':!![]})[_0xfa23('0x1c')](function(){return db[_0xfa23('0x5a')]['find']({'where':{'id':_0x4d0f53[_0xfa23('0x66')]['id'],'role':_0xfa23('0x34')},'attributes':['id','name',_0xfa23('0x39'),_0xfa23('0x72'),_0xfa23('0x96')]});})[_0xfa23('0x1c')](handleEntityNotFound(_0x244dc7,null))[_0xfa23('0x1c')](function(_0x1f9d85){if(_0x1f9d85){_0x91ba2e=_0x1f9d85;return respondWithRpcPromise('QueuePause','pause',{'id':_0x91ba2e['id'],'name':_0x91ba2e[_0xfa23('0x3f')],'pause':!![]});}})[_0xfa23('0x1c')](function(){if(_0x91ba2e){return db[_0xfa23('0xda')][_0xfa23('0x5d')]({'where':{'membername':_0x91ba2e['name'],'type':_0xfa23('0xdf'),'exitAt':null}});}})['then'](function(_0x5a8e64){if(_0x5a8e64['length']){var _0x4f3728=moment()[_0xfa23('0x6d')](_0xfa23('0xdb'));for(var _0x1f6a0a=0x0,_0x5eafd4=_0x5a8e64[_0xfa23('0x4b')];_0x1f6a0a<_0x5eafd4;_0x1f6a0a++){_0x5a8e64[_0x1f6a0a][_0xfa23('0xe6')]({'exitAt':_0x4f3728});}}})[_0xfa23('0x1c')](function(){var _0x28c91b=[];var _0xe1d608=utils[_0xfa23('0xdc')]();_0xe1d608[_0xfa23('0xdd')](function(_0x594d14){_0x28c91b[_0xfa23('0xa3')]({'channel':_0x594d14,'membername':_0x91ba2e[_0xfa23('0x3f')],'interface':_[_0xfa23('0x6c')](_0x91ba2e[_0xfa23('0x96')])?util['format']('SIP/%s',_0x91ba2e[_0xfa23('0x3f')]):_0x91ba2e['interface'],'type':_0xfa23('0xdf'),'enterAt':moment()[_0xfa23('0x6d')](_0xfa23('0xdb')),'data1':_0x4d0f53[_0xfa23('0x63')][_0xfa23('0x53')]||_0xfa23('0xe7'),'role':_0x91ba2e[_0xfa23('0x39')],'internal':_0x91ba2e[_0xfa23('0x72')]});});return db[_0xfa23('0xda')][_0xfa23('0x62')](_0x28c91b,{'individualHooks':!![]});})[_0xfa23('0x1c')](function(){return _0x91ba2e[_0xfa23('0x2e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x4d0f53[_0xfa23('0x63')]['type']||_0xfa23('0xe7'),'lastPauseAt':moment()[_0xfa23('0x6d')](_0xfa23('0xdb'))});})[_0xfa23('0x1c')](respondWithResult(_0x244dc7,null))['catch'](handleError(_0x244dc7,null));};exports[_0xfa23('0xe8')]=function(_0x37b1f1,_0x11c8b3,_0x120d8d){var _0x32cdbf;return db[_0xfa23('0x5a')][_0xfa23('0x3a')]({'where':{'id':_0x37b1f1['params']['id']},'attributes':['id','name','role',_0xfa23('0x95'),_0xfa23('0xe9'),_0xfa23('0xea'),'faxPause','openchannelPause','smsPause','pauseType','lastPauseAt']})[_0xfa23('0x1c')](handleEntityNotFound(_0x11c8b3,null))[_0xfa23('0x1c')](function(_0x52fd4b){if(_0x52fd4b){_0x32cdbf=_0x52fd4b;if(_0x37b1f1[_0xfa23('0x63')][_0xfa23('0x93')]&&!utils[_0xfa23('0x97')](_0x37b1f1['body']['channel'])){throw new db[(_0xfa23('0x89'))][(_0xfa23('0x8a'))]('Unknown\x20channel');}switch(_0x37b1f1[_0xfa23('0x63')][_0xfa23('0x93')]){case _0xfa23('0xa0'):return respondWithRpcPromise(_0xfa23('0xeb'),_0xfa23('0xe8'),{'id':_0x32cdbf['id'],'name':_0x32cdbf[_0xfa23('0x3f')],'pause':![]})[_0xfa23('0x1c')](function(){return db['UserVoiceQueueRt'][_0xfa23('0x2e')]({'paused':0x0},{'where':{'UserId':_0x32cdbf['id']},'individualHooks':!![]});})[_0xfa23('0x1c')](function(){return db[_0xfa23('0xda')]['find']({'where':{'channel':_0x37b1f1[_0xfa23('0x63')]['channel'],'membername':_0x32cdbf[_0xfa23('0x3f')],'type':_0xfa23('0xdf'),'exitAt':null}});})[_0xfa23('0x1c')](function(_0x19fc2b){if(_0x19fc2b){return _0x19fc2b[_0xfa23('0x2e')]({'exitAt':moment()[_0xfa23('0x6d')](_0xfa23('0xdb')),'data2':_0xfa23('0xec')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x32cdbf['update']({'voicePause':![]});});case _0xfa23('0xed'):case'chat':case _0xfa23('0xee'):case _0xfa23('0xef'):case _0xfa23('0xf0'):return db[_0xfa23('0xda')][_0xfa23('0x3a')]({'where':{'channel':_0x37b1f1['body']['channel'],'membername':_0x32cdbf[_0xfa23('0x3f')],'type':'PAUSE','exitAt':null}})[_0xfa23('0x1c')](function(_0x35bd7a){if(_0x35bd7a){return _0x35bd7a[_0xfa23('0x2e')]({'exitAt':moment()[_0xfa23('0x6d')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xfa23('0xec')},{'individualHooks':!![]});}return null;})[_0xfa23('0x1c')](function(){var _0x3560b3={};_['set'](_0x3560b3,util[_0xfa23('0x6d')]('%s%s',_0x37b1f1['body'][_0xfa23('0x93')],_0xfa23('0xf1')),![]);return _0x32cdbf['update'](_0x3560b3);});default:return respondWithRpcPromise(_0xfa23('0xeb'),_0xfa23('0xe8'),{'id':_0x32cdbf['id'],'name':_0x32cdbf[_0xfa23('0x3f')],'pause':![]})['then'](function(){return db[_0xfa23('0xa6')]['update']({'paused':0x0},{'where':{'UserId':_0x32cdbf['id']}});})['then'](function(){return db[_0xfa23('0xda')][_0xfa23('0x5d')]({'where':{'membername':_0x32cdbf[_0xfa23('0x3f')],'type':'PAUSE','exitAt':null}});})[_0xfa23('0x1c')](function(_0x3b7fb0){var _0x1da366=[];_0x3b7fb0[_0xfa23('0xdd')](function(_0x32befb){_0x1da366[_0xfa23('0xa3')](_0x32befb[_0xfa23('0x2e')]({'exitAt':moment()[_0xfa23('0x6d')](_0xfa23('0xdb')),'data2':_0xfa23('0xec')}));});return BPromise[_0xfa23('0xf2')](_0x1da366);})['then'](function(){return _0x32cdbf[_0xfa23('0x2e')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xfa23('0x1c')](respondWithResult(_0x11c8b3,null))[_0xfa23('0x25')](handleError(_0x11c8b3,null));};exports[_0xfa23('0xf3')]=function(_0x5b6151,_0x3979af,_0x51305d){var _0x4d84df={};var _0x43d48a={};var _0x2c9acc;var _0x43893e;return db['User'][_0xfa23('0x90')]({'where':{'id':_0x5b6151[_0xfa23('0x66')]['id']}})[_0xfa23('0x1c')](handleEntityNotFound(_0x3979af,null))['then'](function(_0x1d1b24){if(_0x1d1b24){_0x2c9acc=_0x1d1b24;_0x43d48a[_0xfa23('0x43')]=_['keys'](db[_0xfa23('0xf4')]['rawAttributes']);_0x43d48a[_0xfa23('0x47')]=_['keys'](_0x5b6151[_0xfa23('0x47')]);_0x43d48a[_0xfa23('0x48')]=_[_0xfa23('0x60')](_0x43d48a['model'],_0x43d48a[_0xfa23('0x47')]);_0x4d84df[_0xfa23('0x49')]=_['intersection'](_0x43d48a[_0xfa23('0x43')],qs[_0xfa23('0x4a')](_0x5b6151[_0xfa23('0x47')][_0xfa23('0x4a')]));_0x4d84df[_0xfa23('0x49')]=_0x4d84df[_0xfa23('0x49')][_0xfa23('0x4b')]?_0x4d84df[_0xfa23('0x49')]:_0x43d48a[_0xfa23('0x43')];_0x4d84df[_0xfa23('0x4d')]=qs[_0xfa23('0x4e')](_0x5b6151['query']['sort']);_0x4d84df[_0xfa23('0x4f')]=qs[_0xfa23('0x48')](_[_0xfa23('0x50')](_0x5b6151[_0xfa23('0x47')],_0x43d48a['filters']));if(_0x5b6151[_0xfa23('0x47')][_0xfa23('0x36')]){_0x4d84df['where']=_[_0xfa23('0x51')](_0x4d84df[_0xfa23('0x4f')],{'$or':_['map'](_0x4d84df[_0xfa23('0x49')],function(_0x1c0dc5){var _0x2e4d3a={};_0x2e4d3a[_0x1c0dc5]={'$like':'%'+_0x5b6151[_0xfa23('0x47')][_0xfa23('0x36')]+'%'};return _0x2e4d3a;})});}_0x4d84df=_['merge']({},_0x4d84df,_0x5b6151[_0xfa23('0x59')]);return _0x2c9acc[_0xfa23('0xf3')](_0x4d84df);}})['then'](function(_0x11130c){if(_0x11130c){_0x43893e=_0x11130c[_0xfa23('0x4b')];if(!_0x5b6151[_0xfa23('0x47')][_0xfa23('0x4c')](_0xfa23('0xbf'))){_0x4d84df[_0xfa23('0x2a')]=qs[_0xfa23('0x2a')](_0x5b6151['query'][_0xfa23('0x2a')]);_0x4d84df['offset']=qs['offset'](_0x5b6151['query'][_0xfa23('0x29')]);}return _0x2c9acc[_0xfa23('0xf3')](_0x4d84df);}})[_0xfa23('0x1c')](function(_0x2b0862){if(_0x2b0862){return _0x2b0862?{'count':_0x43893e,'rows':_0x2b0862}:null;}})[_0xfa23('0x1c')](respondWithResult(_0x3979af,null))[_0xfa23('0x25')](handleError(_0x3979af,null));};exports[_0xfa23('0xf5')]=function(_0x26a04d,_0x9723a7,_0x48a9cc){return db['User'][_0xfa23('0x3a')]({'where':{'id':_0x26a04d[_0xfa23('0x66')]['id']}})[_0xfa23('0x1c')](handleEntityNotFound(_0x9723a7,null))[_0xfa23('0x1c')](function(_0x5444ab){if(_0x5444ab){return _0x5444ab[_0xfa23('0xf5')](_0x26a04d[_0xfa23('0x63')][_0xfa23('0x67')],_[_0xfa23('0x68')](_0x26a04d['body'],[_0xfa23('0x67'),'id'])||{});}})[_0xfa23('0x1c')](respondWithResult(_0x9723a7,null))['catch'](handleError(_0x9723a7,null));};exports[_0xfa23('0xf6')]=function(_0x32ba32,_0x47a56f,_0x1758e3){return db[_0xfa23('0x5a')][_0xfa23('0x3a')]({'where':{'id':_0x32ba32[_0xfa23('0x66')]['id']}})[_0xfa23('0x1c')](handleEntityNotFound(_0x47a56f,null))[_0xfa23('0x1c')](function(_0x4932f0){if(_0x4932f0){return _0x4932f0[_0xfa23('0xf6')](_0x32ba32[_0xfa23('0x47')]['ids']);}})[_0xfa23('0x1c')](respondWithStatusCode(_0x47a56f,null))[_0xfa23('0x25')](handleError(_0x47a56f,null));};exports[_0xfa23('0xf7')]=function(_0x2990dd,_0x1306cc,_0x45b995){var _0x4d3947={};var _0x5dc064={};var _0xa73ce1;var _0x4ff0be;return db[_0xfa23('0x5a')]['findOne']({'where':{'id':_0x2990dd[_0xfa23('0x66')]['id']}})[_0xfa23('0x1c')](handleEntityNotFound(_0x1306cc,null))[_0xfa23('0x1c')](function(_0xf9e7b0){if(_0xf9e7b0){_0xa73ce1=_0xf9e7b0;_0x5dc064['model']=_[_0xfa23('0xb5')](db['CmList'][_0xfa23('0x42')]);_0x5dc064[_0xfa23('0x47')]=_[_0xfa23('0xb5')](_0x2990dd[_0xfa23('0x47')]);_0x5dc064[_0xfa23('0x48')]=_[_0xfa23('0x60')](_0x5dc064[_0xfa23('0x43')],_0x5dc064[_0xfa23('0x47')]);_0x4d3947['attributes']=_[_0xfa23('0x60')](_0x5dc064[_0xfa23('0x43')],qs[_0xfa23('0x4a')](_0x2990dd['query'][_0xfa23('0x4a')]));_0x4d3947[_0xfa23('0x49')]=_0x4d3947[_0xfa23('0x49')][_0xfa23('0x4b')]?_0x4d3947[_0xfa23('0x49')]:_0x5dc064[_0xfa23('0x43')];_0x4d3947['order']=qs[_0xfa23('0x4e')](_0x2990dd[_0xfa23('0x47')][_0xfa23('0x4e')]);_0x4d3947[_0xfa23('0x4f')]=qs[_0xfa23('0x48')](_[_0xfa23('0x50')](_0x2990dd['query'],_0x5dc064[_0xfa23('0x48')]));if(_0x2990dd[_0xfa23('0x47')]['filter']){_0x4d3947[_0xfa23('0x4f')]=_[_0xfa23('0x51')](_0x4d3947[_0xfa23('0x4f')],{'$or':_[_0xfa23('0x52')](_0x4d3947[_0xfa23('0x49')],function(_0xee7fe3){var _0x43580c={};_0x43580c[_0xee7fe3]={'$like':'%'+_0x2990dd[_0xfa23('0x47')][_0xfa23('0x36')]+'%'};return _0x43580c;})});}_0x4d3947=_[_0xfa23('0x51')]({},_0x4d3947,_0x2990dd[_0xfa23('0x59')]);return _0xa73ce1['getLists'](_0x4d3947);}})['then'](function(_0xcdd842){if(_0xcdd842){_0x4ff0be=_0xcdd842['length'];if(!_0x2990dd[_0xfa23('0x47')][_0xfa23('0x4c')](_0xfa23('0xbf'))){_0x4d3947[_0xfa23('0x2a')]=qs['limit'](_0x2990dd[_0xfa23('0x47')][_0xfa23('0x2a')]);_0x4d3947[_0xfa23('0x29')]=qs['offset'](_0x2990dd[_0xfa23('0x47')][_0xfa23('0x29')]);}return _0xa73ce1[_0xfa23('0xf7')](_0x4d3947);}})[_0xfa23('0x1c')](function(_0x5bfd08){if(_0x5bfd08){return _0x5bfd08?{'count':_0x4ff0be,'rows':_0x5bfd08}:null;}})[_0xfa23('0x1c')](respondWithResult(_0x1306cc,null))['catch'](handleError(_0x1306cc,null));};exports['getAgents']=function(_0x3f4bef,_0x5ef3a2,_0xf6f16b){var _0x9c5627={};var _0x200bb9={};var _0x4572c0;var _0x39ac72;return db['User'][_0xfa23('0x90')]({'where':{'id':_0x3f4bef[_0xfa23('0x66')]['id']}})[_0xfa23('0x1c')](handleEntityNotFound(_0x5ef3a2,null))[_0xfa23('0x1c')](function(_0x1a1d23){if(_0x1a1d23){_0x4572c0=_0x1a1d23;_0x200bb9[_0xfa23('0x43')]=_['keys'](db[_0xfa23('0x5a')][_0xfa23('0x42')]);_0x200bb9[_0xfa23('0x47')]=_[_0xfa23('0xb5')](_0x3f4bef[_0xfa23('0x47')]);_0x200bb9[_0xfa23('0x48')]=_[_0xfa23('0x60')](_0x200bb9[_0xfa23('0x43')],_0x200bb9[_0xfa23('0x47')]);_0x9c5627[_0xfa23('0x49')]=_[_0xfa23('0x60')](_0x200bb9['model'],qs[_0xfa23('0x4a')](_0x3f4bef['query'][_0xfa23('0x4a')]));_0x9c5627[_0xfa23('0x49')]=_0x9c5627[_0xfa23('0x49')][_0xfa23('0x4b')]?_0x9c5627[_0xfa23('0x49')]:_0x200bb9['model'];_0x9c5627['order']=qs[_0xfa23('0x4e')](_0x3f4bef[_0xfa23('0x47')][_0xfa23('0x4e')]);_0x9c5627[_0xfa23('0x4f')]=qs[_0xfa23('0x48')](_['pick'](_0x3f4bef[_0xfa23('0x47')],_0x200bb9['filters']));if(_0x3f4bef[_0xfa23('0x47')][_0xfa23('0x36')]){_0x9c5627[_0xfa23('0x4f')]=_[_0xfa23('0x51')](_0x9c5627['where'],{'$or':_['map'](_0x9c5627[_0xfa23('0x49')],function(_0x3a96db){var _0x39e1a8={};_0x39e1a8[_0x3a96db]={'$like':'%'+_0x3f4bef[_0xfa23('0x47')][_0xfa23('0x36')]+'%'};return _0x39e1a8;})});}_0x9c5627['model']=db['User'];_0x9c5627['as']=_0xfa23('0x33');_0x9c5627=_['merge']({},_0x9c5627,_0x3f4bef[_0xfa23('0x59')]);return _0x4572c0[_0xfa23('0xf8')]({'include':[_0x9c5627]});}})['then'](function(_0x3ed229){if(_0x3ed229){var _0x5e8bef={},_0x30b3bd=[],_0xf79bef=0x0;for(var _0x4ab80a=0x0;_0x4ab80a<_0x3ed229[_0xfa23('0x4b')];_0x4ab80a+=0x1){for(var _0x471d60=0x0,_0x196eaf;_0x471d60<_0x3ed229[_0x4ab80a][_0xfa23('0x33')][_0xfa23('0x4b')];_0x471d60+=0x1){_0x196eaf=_0x3ed229[_0x4ab80a][_0xfa23('0x33')][_0x471d60][_0xfa23('0x30')]({'plain':!![]});_0x5e8bef[_0x196eaf['id']]=_0x196eaf;}}_0x5e8bef=_['values'](_0x5e8bef);for(var _0x11a268=qs[_0xfa23('0x29')](_0x3f4bef[_0xfa23('0x47')][_0xfa23('0x29')]);_0x11a268<_0x5e8bef[_0xfa23('0x4b')]&&_0x30b3bd['length']=_0x1f555b){_0x3f7ace=_0x1f555b;_0x29d8f5=0xc8;}else{_0x29d8f5=0xce;}_0x288868['status'](_0x29d8f5);return _0x288868[_0x126d('0x30')](_0x126d('0x31'),_0x1d2134+'-'+_0x3f7ace+'/'+_0x1f555b)[_0x126d('0x2c')](_0x4fa327);}return null;};}function patchUpdates(_0x363bcd){return function(_0x38436a){try{jsonpatch[_0x126d('0x32')](_0x38436a,_0x363bcd,!![]);}catch(_0x4c16b3){return BPromise[_0x126d('0x33')](_0x4c16b3);}return _0x38436a[_0x126d('0x34')]();};}function saveUpdates(_0x5c2d3f,_0x96a2a8){return function(_0x1e9117){if(_0x1e9117){return _0x1e9117['update'](_0x5c2d3f)[_0x126d('0x35')](function(_0xed9030){return _0xed9030;});}return null;};}function removeEntity(_0x5c738c,_0x27bdc2){return function(_0xa05e2a){if(_0xa05e2a){return _0xa05e2a[_0x126d('0x36')]()[_0x126d('0x35')](function(){var _0x13d7ae=_0xa05e2a[_0x126d('0x37')]({'plain':!![]});var _0x2cf5e9=[{'name':'Users','value':'user','ignore':!![]},{'name':_0x126d('0x38'),'value':_0x126d('0x39'),'ignore':![]},{'name':_0x126d('0x3a'),'value':_0x126d('0x3b'),'ignore':![]}];var _0x51c61c=_(_0x2cf5e9)[_0x126d('0x3c')](_0x126d('0x3d'))[_0x126d('0x3e')](_0x126d('0x3f'))[_0x126d('0x3f')]();if(_[_0x126d('0x40')](_0x51c61c,_0x13d7ae['role'])){return;}var _0x3eb2c8=_[_0x126d('0x41')](_0x2cf5e9,[_0x126d('0x3f'),_0x13d7ae[_0x126d('0x42')]])[_0x126d('0x43')];return db[_0x126d('0x44')]['destroy']({'where':{'type':_0x3eb2c8,'resourceId':_0x13d7ae['id']}})[_0x126d('0x35')](function(){return _0xa05e2a;});})[_0x126d('0x35')](function(){_0x5c738c[_0x126d('0x2a')](0xcc)[_0x126d('0x2b')]();});}};}function handleEntityNotFound(_0x2b7f16,_0x5e565c){return function(_0x2efee9){if(!_0x2efee9){_0x2b7f16[_0x126d('0x29')](0x194);}return _0x2efee9;};}function handleError(_0x50363d,_0x36c61c){_0x36c61c=_0x36c61c||0x1f4;return function(_0x34a2b4){logger[_0x126d('0x23')](_0x34a2b4[_0x126d('0x45')]);if(_0x34a2b4[_0x126d('0x43')]){delete _0x34a2b4[_0x126d('0x43')];}_0x50363d[_0x126d('0x2a')](_0x36c61c)['send'](_0x34a2b4);};}exports['index']=function(_0x3f7d63,_0x36e6a6){var _0x2f27cf={},_0x26d59f={},_0x24f70e={'count':0x0,'rows':[]};var _0x2a9b02=db[_0x126d('0x46')][_0x126d('0x47')];_0x26d59f[_0x126d('0x48')]=_['differenceBy'](_[_0x126d('0x49')](_0x2a9b02),[_0x126d('0x4a'),_0x126d('0x4b')]);_0x26d59f[_0x126d('0x4c')]=_[_0x126d('0x49')](_0x3f7d63[_0x126d('0x4c')]);_0x26d59f[_0x126d('0x4d')]=_[_0x126d('0x4e')](_0x26d59f[_0x126d('0x48')],_0x26d59f[_0x126d('0x4c')]);_0x2f27cf[_0x126d('0x4f')]=_[_0x126d('0x4e')](_0x26d59f[_0x126d('0x48')],qs[_0x126d('0x50')](_0x3f7d63['query'][_0x126d('0x50')]));_0x2f27cf[_0x126d('0x4f')]=_0x2f27cf['attributes'][_0x126d('0x51')]?_0x2f27cf[_0x126d('0x4f')]:_0x26d59f[_0x126d('0x48')];if(!_0x3f7d63[_0x126d('0x4c')][_0x126d('0x52')]('nolimit')){_0x2f27cf[_0x126d('0x2f')]=qs[_0x126d('0x2f')](_0x3f7d63[_0x126d('0x4c')][_0x126d('0x2f')]);_0x2f27cf[_0x126d('0x2e')]=qs[_0x126d('0x2e')](_0x3f7d63['query'][_0x126d('0x2e')]);}_0x2f27cf['order']=qs[_0x126d('0x53')](_0x3f7d63[_0x126d('0x4c')][_0x126d('0x53')]);_0x2f27cf[_0x126d('0x54')]=qs[_0x126d('0x4d')](_['pick'](_0x3f7d63[_0x126d('0x4c')],_0x26d59f[_0x126d('0x4d')]));if(_0x3f7d63[_0x126d('0x4c')][_0x126d('0x3c')]){_0x2f27cf[_0x126d('0x54')]=_[_0x126d('0x55')](_0x2f27cf[_0x126d('0x54')],{'$or':_['map'](_0x2a9b02,function(_0x2e373e){if(_0x2e373e[_0x126d('0x56')][_0x126d('0x57')]!==_0x126d('0x58')){return db[_0x126d('0x59')][_0x126d('0x54')](db[_0x126d('0x59')]['fn'](_0x126d('0x5a'),db[_0x126d('0x59')][_0x126d('0x5b')](_0x2e373e[_0x126d('0x5c')])),{'$like':db['sequelize']['fn'](_0x126d('0x5a'),'%'+_0x3f7d63['query'][_0x126d('0x3c')]+'%')});}})});}_0x2f27cf=_[_0x126d('0x55')]({},_0x2f27cf,_0x3f7d63[_0x126d('0x5d')]);var _0x2899f5={'where':_0x2f27cf[_0x126d('0x54')]};return db[_0x126d('0x46')][_0x126d('0x2d')](_0x2899f5)[_0x126d('0x35')](function(_0x1ed60a){_0x24f70e[_0x126d('0x2d')]=_0x1ed60a;if(_0x3f7d63[_0x126d('0x4c')]['includeAll']){_0x2f27cf[_0x126d('0x5e')]=[{'all':!![]}];}return db[_0x126d('0x46')][_0x126d('0x5f')](_0x2f27cf);})[_0x126d('0x35')](function(_0x1324be){_0x24f70e[_0x126d('0x60')]=_0x1324be;return _0x24f70e;})['then'](respondWithFilteredResult(_0x36e6a6,_0x2f27cf))[_0x126d('0x61')](handleError(_0x36e6a6,null));};exports[_0x126d('0x62')]=function(_0x23c1b2,_0x59a1e7){var _0x28d9af={'raw':![],'where':{'id':_0x23c1b2[_0x126d('0x63')]['id']}},_0x8e62c5={};_0x8e62c5[_0x126d('0x48')]=_['differenceBy'](_[_0x126d('0x49')](db[_0x126d('0x46')][_0x126d('0x47')]),[_0x126d('0x4a'),_0x126d('0x4b')]);_0x8e62c5[_0x126d('0x4c')]=_[_0x126d('0x49')](_0x23c1b2[_0x126d('0x4c')]);_0x8e62c5[_0x126d('0x4d')]=_['intersection'](_0x8e62c5[_0x126d('0x48')],_0x8e62c5['query']);_0x28d9af['attributes']=_[_0x126d('0x4e')](_0x8e62c5[_0x126d('0x48')],qs['fields'](_0x23c1b2[_0x126d('0x4c')][_0x126d('0x50')]));_0x28d9af[_0x126d('0x4f')]=_0x28d9af[_0x126d('0x4f')][_0x126d('0x51')]?_0x28d9af[_0x126d('0x4f')]:_0x8e62c5[_0x126d('0x48')];if(_0x23c1b2['query']['includeAll']){_0x28d9af[_0x126d('0x5e')]=[{'all':!![]}];}_0x28d9af=_[_0x126d('0x55')]({},_0x28d9af,_0x23c1b2[_0x126d('0x5d')]);return db[_0x126d('0x46')][_0x126d('0x41')](_0x28d9af)[_0x126d('0x35')](handleEntityNotFound(_0x59a1e7,null))[_0x126d('0x35')](respondWithResult(_0x59a1e7,null))['catch'](handleError(_0x59a1e7,null));};exports['bulkCreate']=function(_0x5c9434,_0x5cc15e){return db[_0x126d('0x46')][_0x126d('0x64')](_0x5c9434[_0x126d('0x65')],{'raw':![],'individualHooks':!![]})[_0x126d('0x35')](respondWithResult(_0x5cc15e,0xc9))['catch'](handleError(_0x5cc15e,null));};exports[_0x126d('0x66')]=function(_0x9215c4,_0x3c7d84){if(_0x9215c4[_0x126d('0x65')]['id']){delete _0x9215c4['body']['id'];}delete _0x9215c4['body'][_0x126d('0x42')];return db[_0x126d('0x46')][_0x126d('0x41')]({'where':{'id':_0x9215c4['params']['id']}})[_0x126d('0x35')](handleEntityNotFound(_0x3c7d84,null))[_0x126d('0x35')](saveUpdates(_0x9215c4['body'],null))[_0x126d('0x35')](respondWithResult(_0x3c7d84,null))['catch'](handleError(_0x3c7d84,null));};exports[_0x126d('0x67')]=function(_0x27c1c4,_0x266dd3){return db['User'][_0x126d('0x67')]()[_0x126d('0x35')](respondWithResult(_0x266dd3,null))[_0x126d('0x61')](handleError(_0x266dd3,null));};exports[_0x126d('0x68')]=function(_0x51546d,_0x3f4c52,_0x3bf57a){return db['User']['find']({'where':{'id':_0x51546d[_0x126d('0x63')]['id']}})[_0x126d('0x35')](handleEntityNotFound(_0x3f4c52,null))['then'](function(_0x54f6be){if(_0x54f6be){return _0x54f6be['addContacts'](_0x51546d[_0x126d('0x65')][_0x126d('0x69')],_['omit'](_0x51546d[_0x126d('0x65')],[_0x126d('0x69'),'id'])||{});}})[_0x126d('0x35')](respondWithResult(_0x3f4c52,null))[_0x126d('0x61')](handleError(_0x3f4c52,null));};var getLicense=function(_0x493fb1){return new BPromise(function(_0x4b2f6d,_0x552ac3){var _0x45560c=0x0;_0x493fb1[_0x126d('0x65')][_0x126d('0x42')]==='agent'&&_0x4b2f6d(_0x126d('0x6a'));return db[_0x126d('0x46')][_0x126d('0x2d')]({'where':{'$or':[{'role':_0x493fb1['body']['role']===_0x126d('0x3b')?_0x126d('0x3b'):[_0x126d('0x6b'),'user']}]}})['then'](function(_0x561b12){_0x45560c=_0x561b12;return require(_0x126d('0x6c'))[_0x126d('0x6d')]();})[_0x126d('0x35')](function(_0x5b406e){var _0xbbb69b=_0x493fb1[_0x126d('0x65')][_0x126d('0x42')]===_0x126d('0x3b')?'telephones':'users';if(!_[_0x126d('0x6e')](_0x5b406e[_0xbbb69b])&&_0x45560c>=_0x5b406e[_0xbbb69b]){return _0x552ac3({'message':'License\x20limit\x20reached'});}return _0x4b2f6d(util[_0x126d('0x6f')](_0x126d('0x70'),_0xbbb69b,_0x45560c));})['catch'](function(_0x33e06b){return _0x552ac3(_0x33e06b);});});};exports[_0x126d('0x71')]=function(_0x3a9300,_0x34b8a){return getLicense(_0x3a9300)[_0x126d('0x35')](function(_0x338a10){if(!_0x3a9300[_0x126d('0x65')][_0x126d('0x72')]){var _0x4f9c44;return db['Setting']['findById'](0x1)['then'](function(_0x25eb7b){return checkPasswordPattern(_0x25eb7b,_0x3a9300['body'][_0x126d('0x4a')],_0x25eb7b['securePassword']);})['then'](function(_0x35f23b){_0x4f9c44=_0x35f23b[_0x126d('0x73')];return db[_0x126d('0x46')][_0x126d('0x74')](_0x126d('0x72'));})[_0x126d('0x35')](function(_0x493c68){if(_[_0x126d('0x6e')](_0x493c68)){if(_0x4f9c44){_0x3a9300[_0x126d('0x65')][_0x126d('0x72')]=_0x4f9c44;}else{_0x3a9300[_0x126d('0x65')][_0x126d('0x72')]=0x1;}}else{if(_[_0x126d('0x6e')](_0x4f9c44)||_0x4f9c44==_0x493c68){_0x3a9300[_0x126d('0x65')]['internal']=_0x493c68+0x1;}else if(_0x4f9c44>_0x493c68){_0x3a9300[_0x126d('0x65')][_0x126d('0x72')]=_0x4f9c44;}else{return db[_0x126d('0x59')]['query'](_0x126d('0x75'),{'type':db[_0x126d('0x59')][_0x126d('0x76')][_0x126d('0x77')]})[_0x126d('0x35')](function(_0x56937c){if(_0x56937c&&_0x56937c[_0x126d('0x51')]){for(var _0x55b22d=0x0,_0x58af15=_0x56937c[_0x126d('0x51')];_0x55b22d<_0x58af15&&_[_0x126d('0x6e')](_0x3a9300[_0x126d('0x65')][_0x126d('0x72')]);_0x55b22d++){if(_0x4f9c44<=_0x56937c[_0x55b22d][_0x126d('0x78')]){_0x3a9300[_0x126d('0x65')][_0x126d('0x72')]=_0x56937c[_0x55b22d][_0x126d('0x78')];}else if(_0x4f9c44>_0x56937c[_0x55b22d][_0x126d('0x78')]&&_0x4f9c44<=_0x56937c[_0x55b22d]['to']){_0x3a9300[_0x126d('0x65')][_0x126d('0x72')]=_0x4f9c44;}}}if(_['isNil'](_0x3a9300[_0x126d('0x65')]['internal'])){_0x3a9300[_0x126d('0x65')][_0x126d('0x72')]=_0x493c68+0x1;}});}}});}})[_0x126d('0x35')](function(){if(_0x3a9300[_0x126d('0x65')][_0x126d('0x79')]){_0x3a9300[_0x126d('0x65')][_0x126d('0x7a')]=_0x3a9300[_0x126d('0x65')]['internal'];_0x3a9300[_0x126d('0x65')]['VoiceMail']={'mailbox':_0x3a9300[_0x126d('0x65')][_0x126d('0x72')],'password':_0x3a9300[_0x126d('0x65')][_0x126d('0x4a')],'fullname':_0x3a9300[_0x126d('0x65')]['fullname'],'email':_0x3a9300[_0x126d('0x65')][_0x126d('0x7b')]};}if(_0x3a9300['body']&&_0x3a9300[_0x126d('0x65')][_0x126d('0x42')]===_0x126d('0x39')){_0x3a9300[_0x126d('0x65')][_0x126d('0x7c')]=[_0x126d('0x7d'),_0x126d('0x7e'),_0x126d('0x7f'),_0x126d('0x80'),_0x126d('0x81'),'105','106',_0x126d('0x82'),_0x126d('0x83'),_0x126d('0x84'),_0x126d('0x85'),'111'];}return db[_0x126d('0x46')][_0x126d('0x71')](_0x3a9300['body'],{'include':[{'model':db[_0x126d('0x86')],'as':_0x126d('0x86')}]});})[_0x126d('0x35')](function(_0x58c5ad){if(_0x3a9300[_0x126d('0x65')][_0x126d('0x42')]===_0x126d('0x87'))return _0x58c5ad;var _0x1f9ca7=_0x3a9300[_0x126d('0x87')][_0x126d('0x37')]({'plain':!![]});if(!_0x1f9ca7)throw new Error(_0x126d('0x88'));if(_0x1f9ca7[_0x126d('0x42')]===_0x126d('0x87')){var _0x4743e2=_0x58c5ad[_0x126d('0x37')]({'plain':!![]});var _0x47c92a=[{'name':_0x126d('0x38'),'value':'agent'},{'name':_0x126d('0x3a'),'value':_0x126d('0x3b')}];var _0x3cc696=_['find'](_0x47c92a,[_0x126d('0x3f'),_0x4743e2[_0x126d('0x42')]])[_0x126d('0x43')];return db[_0x126d('0x89')][_0x126d('0x41')]({'where':{'name':_0x3cc696,'userProfileId':_0x1f9ca7[_0x126d('0x8a')]},'raw':!![]})['then'](function(_0x43d6d5){if(_0x43d6d5&&_0x43d6d5[_0x126d('0x8b')]===0x0){return db[_0x126d('0x44')]['create']({'name':_0x4743e2['name'],'resourceId':_0x4743e2['id'],'type':_0x43d6d5[_0x126d('0x43')],'sectionId':_0x43d6d5['id']},{})[_0x126d('0x35')](function(){return _0x58c5ad;});}else{return _0x58c5ad;}})[_0x126d('0x61')](function(_0x3383d1){logger[_0x126d('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3383d1);throw _0x3383d1;});}return _0x58c5ad;})[_0x126d('0x35')](respondWithResult(_0x34b8a,0xc9))[_0x126d('0x61')](handleError(_0x34b8a,null));};exports[_0x126d('0x8c')]=function(_0x514c4a,_0x1f0a47,_0x233cd1){var _0x1dcddf=![];if(_0x514c4a['body']['id']){delete _0x514c4a['body']['id'];}if(!_['isNil'](_0x514c4a['body'][_0x126d('0x8d')])){if(_0x514c4a['body'][_0x126d('0x8d')]===_0x514c4a[_0x126d('0x65')][_0x126d('0x8e')]){throw new Error(_0x126d('0x8f'));}}return db['User'][_0x126d('0x41')]({'where':{'id':_0x514c4a[_0x126d('0x63')]['id']}})['then'](function(_0x1abc5e){if(_0x1abc5e){if(_0x1abc5e['id']==_0x514c4a['user']['id']){if(!_0x514c4a[_0x126d('0x65')]['oldPassword']||!_0x514c4a[_0x126d('0x65')][_0x126d('0x8e')]){throw new db[(_0x126d('0x90'))][(_0x126d('0x91'))]('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x1abc5e['authenticate'](_0x514c4a[_0x126d('0x65')][_0x126d('0x8d')])){throw new db['Sequelize']['ValidationError'](_0x126d('0x92'));}if(_0x514c4a[_0x126d('0x65')][_0x126d('0x8d')]==_0x514c4a[_0x126d('0x65')][_0x126d('0x8e')]){throw new db[(_0x126d('0x90'))][(_0x126d('0x91'))](_0x126d('0x93'));}return _0x1abc5e;}else if(_0x514c4a[_0x126d('0x87')][_0x126d('0x42')]==_0x126d('0x6b')){if(!_0x514c4a['body'][_0x126d('0x8e')]){throw new db[(_0x126d('0x90'))][(_0x126d('0x91'))](_0x126d('0x94'));}return _0x1abc5e;}else if(_0x514c4a[_0x126d('0x87')][_0x126d('0x42')]==_0x126d('0x87')){if(!_0x514c4a[_0x126d('0x65')][_0x126d('0x8e')]){throw new db['Sequelize'][(_0x126d('0x91'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x1abc5e[_0x126d('0x42')]!=_0x126d('0x39')){throw new db[(_0x126d('0x90'))]['ValidationError'](_0x126d('0x95'));}return _0x1abc5e;}else{throw new db[(_0x126d('0x90'))]['ValidationError'](_0x126d('0x95'));}}return null;})[_0x126d('0x35')](handleEntityNotFound(_0x1f0a47,null))[_0x126d('0x35')](function(_0x83b680){return db[_0x126d('0x96')][_0x126d('0x97')]({'attributes':['id',_0x126d('0x98')]})[_0x126d('0x35')](function(_0x375143){_0x1dcddf=_0x375143[_0x126d('0x98')];return checkPasswordPattern(_0x83b680,_0x514c4a['body'][_0x126d('0x8e')],_0x1dcddf);});})[_0x126d('0x35')](saveUpdates({'password':_0x514c4a[_0x126d('0x65')][_0x126d('0x8e')],'passwordResetAt':_0x514c4a['user']['id']==_0x514c4a[_0x126d('0x63')]['id']?moment():null},null))[_0x126d('0x35')](respondWithResult(_0x1f0a47,null))[_0x126d('0x61')](handleError(_0x1f0a47,null));};exports[_0x126d('0x99')]=function(_0x180b3d,_0x4e3c13,_0x4d609f){var _0x4e9385=_0x180b3d[_0x126d('0x65')]['channel'];return db[_0x126d('0x46')][_0x126d('0x41')]({'where':{'id':_0x180b3d[_0x126d('0x63')]['id']},'attributes':['id','name',_0x126d('0x42'),'online','loginInPause','voicePause','interface']})[_0x126d('0x35')](handleEntityNotFound(_0x4e3c13,null))['then'](function(_0x38540a){if(_0x38540a){if(!utils[_0x126d('0x9a')](_0x4e9385)){throw new db[(_0x126d('0x90'))][(_0x126d('0x91'))]('Unknown\x20channel');}return _0x38540a[_0x126d('0x9b')+_[_0x126d('0x9c')](_0x4e9385[_0x126d('0x9d')]())+'Queues'](_0x180b3d[_0x126d('0x65')][_0x126d('0x69')],{'penalty':_0x180b3d['body'][_0x126d('0x9e')]||0x0})[_0x126d('0x9f')](function(_0x401d26){for(var _0x542fc2=0x0;_0x542fc2<_0x180b3d[_0x126d('0x65')][_0x126d('0x69')][_0x126d('0x51')];_0x542fc2+=0x1){var _0x4eca68={'UserId':_0x180b3d[_0x126d('0x63')]['id']};_0x4eca68[_['capitalize'](_0x4e9385[_0x126d('0x9d')]())+_0x126d('0xa0')]=_0x180b3d[_0x126d('0x65')][_0x126d('0x69')][_0x542fc2];socket['emit'](_0x126d('0x87')+_[_0x126d('0x9c')](_0x4e9385[_0x126d('0x9d')]())+_0x126d('0xa1'),_0x4eca68);}return _0x401d26;})[_0x126d('0x35')](function(){if(_0x4e9385==='voice'){return db['VoiceQueue'][_0x126d('0x5f')]({'where':{'id':_0x180b3d[_0x126d('0x65')][_0x126d('0x69')]||[]},'raw':!![],'attributes':['id',_0x126d('0x43')]});}})[_0x126d('0x35')](function(_0x4f7919){var _0x250a4e=_0x38540a[_0x126d('0x37')]({'plain':!![]});var _0x56fd77=[];if(_0x4e9385===_0x126d('0xa2')&&_0x250a4e[_0x126d('0x42')]===_0x126d('0x39')&&_0x250a4e[_0x126d('0xa3')]){for(var _0x777b03=0x0;_0x777b03<_0x4f7919['length'];_0x777b03+=0x1){_0x56fd77[_0x126d('0xa4')]({'membername':_0x250a4e[_0x126d('0x43')],'UserId':_0x250a4e['id'],'queue_name':_0x4f7919[_0x777b03]['name'],'VoiceQueueId':_0x4f7919[_0x777b03]['id'],'interface':_[_0x126d('0x6e')](_0x250a4e[_0x126d('0xa5')])?util[_0x126d('0x6f')](_0x126d('0xa6'),_0x250a4e[_0x126d('0x43')]):_0x250a4e[_0x126d('0xa5')],'paused':_0x250a4e[_0x126d('0xa7')]||![],'penalty':_0x180b3d[_0x126d('0x65')][_0x126d('0x9e')]||0x0});}return BPromise[_0x126d('0xa8')](_0x56fd77,function(_0x45c470){return db[_0x126d('0xa9')][_0x126d('0xaa')](_0x45c470);});}return _0x38540a;});}})['then'](respondWithStatusCode(_0x4e3c13,null))[_0x126d('0x61')](handleError(_0x4e3c13,null));};exports[_0x126d('0xab')]=function(_0x3186e1,_0x23a6c3,_0x5b9657){var _0x1d554b;return db[_0x126d('0x46')][_0x126d('0x41')]({'where':{'id':_0x3186e1[_0x126d('0x63')]['id']},'attributes':['id',_0x126d('0x43'),'role']})['then'](handleEntityNotFound(_0x23a6c3,null))[_0x126d('0x35')](function(_0x5e8b8b){if(_0x5e8b8b){_0x1d554b=_0x5e8b8b;if(!_0x3186e1[_0x126d('0x4c')][_0x126d('0xac')]||!utils[_0x126d('0x9a')](_0x3186e1['query'][_0x126d('0xac')])){throw new db['Sequelize'][(_0x126d('0x91'))](_0x126d('0xad'));}return _0x5e8b8b[_0x126d('0xae')+_[_0x126d('0x9c')](_0x3186e1[_0x126d('0x4c')][_0x126d('0xac')][_0x126d('0x9d')]())+_0x126d('0xaf')](_0x3186e1[_0x126d('0x4c')][_0x126d('0x69')]);}})[_0x126d('0x35')](function(_0x86f0ae){for(var _0x3a9718=0x0;_0x3a9718<_0x3186e1['query']['ids'][_0x126d('0x51')];_0x3a9718+=0x1){var _0x30353e={'UserId':_0x3186e1[_0x126d('0x63')]['id']};_0x30353e[_[_0x126d('0x9c')](_0x3186e1[_0x126d('0x4c')][_0x126d('0xac')][_0x126d('0x9d')]())+_0x126d('0xa0')]=_0x3186e1[_0x126d('0x4c')]['ids'][_0x3a9718];socket[_0x126d('0xb0')](_0x126d('0x87')+_[_0x126d('0x9c')](_0x3186e1['query'][_0x126d('0xac')][_0x126d('0x9d')]())+_0x126d('0xb1'),_0x30353e);}return _0x86f0ae;})[_0x126d('0x35')](function(){if(_0x3186e1['query']['channel']===_0x126d('0xa2')){return db[_0x126d('0xa9')][_0x126d('0x36')]({'where':{'UserId':_0x3186e1[_0x126d('0x63')]['id'],'VoiceQueueId':_0x3186e1['query'][_0x126d('0x69')]},'individualHooks':!![]})[_0x126d('0x35')](function(){return _0x1d554b;});}return _0x1d554b;})[_0x126d('0x35')](respondWithStatusCode(_0x23a6c3,null))[_0x126d('0x61')](handleError(_0x23a6c3,null));};exports[_0x126d('0xb2')]=function(_0x397494,_0xe59148,_0x48f17b){_0x397494[_0x126d('0x65')]['userpic']=_0x397494[_0x126d('0xb3')][_0x126d('0xb4')];return db[_0x126d('0x46')][_0x126d('0x41')]({'where':{'id':_0x397494['params']['id']}})['then'](handleEntityNotFound(_0xe59148,null))[_0x126d('0x35')](saveUpdates(_0x397494['body'],null))['then'](respondWithResult(_0xe59148,null))[_0x126d('0x61')](handleError(_0xe59148,null));};exports[_0x126d('0xb5')]=function(_0x2844be,_0x3d5490,_0x47d29a){var _0xface72=path[_0x126d('0xb6')](config['root'],_0x126d('0xb7'));return db[_0x126d('0x46')]['find']({'where':{'id':_0x2844be['params']['id']},'attributes':['id',_0x126d('0xb8')],'raw':!![]})[_0x126d('0x35')](handleEntityNotFound(_0x3d5490,null))[_0x126d('0x35')](function(_0x477c24){if(_0x477c24){if(_[_0x126d('0x6e')](_0x477c24['userpic'])){return _0x3d5490['download'](_0xface72);}else{if(!fs['existsSync'](path[_0x126d('0xb6')](config['root'],_0x126d('0xb9'),_0x477c24[_0x126d('0xb8')]))){return _0x3d5490[_0x126d('0xba')](_0xface72);}return _0x3d5490[_0x126d('0xba')](path[_0x126d('0xb6')](config['root'],'server/files/images/',_0x477c24[_0x126d('0xb8')]));}}})[_0x126d('0x61')](handleError(_0x3d5490,null));};exports['getContacts']=function(_0x5a650e,_0x122a67,_0xc2866){var _0x43a7e1={};var _0x5ba508={};var _0x4703c1;var _0x4fcc8a;return db[_0x126d('0x46')][_0x126d('0x97')]({'where':{'id':_0x5a650e['params']['id']}})[_0x126d('0x35')](handleEntityNotFound(_0x122a67,null))[_0x126d('0x35')](function(_0x4767cb){if(_0x4767cb){_0x4703c1=_0x4767cb;_0x5ba508[_0x126d('0x48')]=_[_0x126d('0x49')](db[_0x126d('0xbb')][_0x126d('0x47')]);_0x5ba508['query']=_[_0x126d('0x49')](_0x5a650e[_0x126d('0x4c')]);_0x5ba508[_0x126d('0x4d')]=_['intersection'](_0x5ba508[_0x126d('0x48')],_0x5ba508[_0x126d('0x4c')]);_0x43a7e1[_0x126d('0x4f')]=_[_0x126d('0x4e')](_0x5ba508['model'],qs[_0x126d('0x50')](_0x5a650e[_0x126d('0x4c')][_0x126d('0x50')]));_0x43a7e1['attributes']=_0x43a7e1['attributes'][_0x126d('0x51')]?_0x43a7e1[_0x126d('0x4f')]:_0x5ba508['model'];_0x43a7e1['order']=qs[_0x126d('0x53')](_0x5a650e[_0x126d('0x4c')]['sort']);_0x43a7e1[_0x126d('0x54')]=qs[_0x126d('0x4d')](_[_0x126d('0xbc')](_0x5a650e[_0x126d('0x4c')],_0x5ba508[_0x126d('0x4d')]));if(_0x5a650e[_0x126d('0x4c')]['filter']){_0x43a7e1[_0x126d('0x54')]=_[_0x126d('0x55')](_0x43a7e1['where'],{'$or':_[_0x126d('0x3e')](_0x43a7e1['attributes'],function(_0x204920){var _0x40f345={};_0x40f345[_0x204920]={'$like':'%'+_0x5a650e[_0x126d('0x4c')]['filter']+'%'};return _0x40f345;})});}_0x43a7e1=_[_0x126d('0x55')]({},_0x43a7e1,_0x5a650e[_0x126d('0x5d')]);return _0x4703c1['getContacts'](_0x43a7e1);}})[_0x126d('0x35')](function(_0x4b90ed){if(_0x4b90ed){_0x4fcc8a=_0x4b90ed['length'];if(_0x5a650e[_0x126d('0x4c')]['hasOwnProperty'](_0x126d('0xbd'))){_0x43a7e1[_0x126d('0x5e')]=[{'model':db['CmList'],'as':_0x126d('0xbe'),'required':![]},{'model':db[_0x126d('0xbf')],'as':_0x126d('0xc0'),'attributes':['id','name',_0x126d('0xc1')],'where':_0x5a650e[_0x126d('0x4c')][_0x126d('0xc2')]?{'id':_0x5a650e['query'][_0x126d('0xc2')]}:undefined,'required':_0x5a650e[_0x126d('0x4c')]['tag']?!![]:![]}];}if(!_0x5a650e[_0x126d('0x4c')]['hasOwnProperty'](_0x126d('0xc3'))){_0x43a7e1[_0x126d('0x2f')]=qs[_0x126d('0x2f')](_0x5a650e[_0x126d('0x4c')][_0x126d('0x2f')]);_0x43a7e1[_0x126d('0x2e')]=qs['offset'](_0x5a650e[_0x126d('0x4c')]['offset']);}return _0x4703c1[_0x126d('0xc4')](_0x43a7e1);}})[_0x126d('0x35')](function(_0x31084d){if(_0x31084d){return _0x31084d?{'count':_0x4fcc8a,'rows':_0x31084d}:null;}})[_0x126d('0x35')](respondWithResult(_0x122a67,null))[_0x126d('0x61')](handleError(_0x122a67,null));};exports['getQueues']=function(_0x153f40,_0x1e19b3,_0x250f88){var _0x44e52c;var _0x1e254e;var _0x25668b={};var _0xbe9d39;return db[_0x126d('0x46')][_0x126d('0x97')]({'where':{'id':_0x153f40[_0x126d('0x63')]['id']},'attributes':['id',_0x126d('0x43'),_0x126d('0x42')]})['then'](handleEntityNotFound(_0x1e19b3,null))[_0x126d('0x35')](function(_0x52f605){if(!utils[_0x126d('0x9a')](_0x153f40[_0x126d('0x4c')][_0x126d('0xac')])){throw new db['Sequelize'][(_0x126d('0x91'))]('Unknown\x20channel');}_0x44e52c=_0x52f605;var _0x45bb7f={};_0x45bb7f[_0x126d('0x48')]=_[_0x126d('0x49')](db[_[_0x126d('0x9c')](_0x153f40[_0x126d('0x4c')][_0x126d('0xac')])+'Queue']['rawAttributes']);_0x45bb7f[_0x126d('0x4c')]=_['keys'](_0x153f40[_0x126d('0x4c')]);_0x45bb7f[_0x126d('0x4d')]=_['intersection'](_0x45bb7f[_0x126d('0x48')],_0x45bb7f[_0x126d('0x4c')]);_0x25668b[_0x126d('0x4f')]=_[_0x126d('0x4e')](_0x45bb7f['model'],qs[_0x126d('0x50')](_0x153f40['query'][_0x126d('0x50')]));_0x25668b[_0x126d('0x4f')]=_0x25668b[_0x126d('0x4f')][_0x126d('0x51')]?_0x25668b[_0x126d('0x4f')]:_0x45bb7f['model'];_0x25668b[_0x126d('0xc5')]=qs[_0x126d('0x53')](_0x153f40[_0x126d('0x4c')]['sort']);_0x25668b['where']=qs[_0x126d('0x4d')](_['pick'](_0x153f40['query'],_0x45bb7f['filters']));if(_0x153f40['query'][_0x126d('0x3c')]){_0x25668b[_0x126d('0x54')]=_[_0x126d('0x55')](_0x25668b[_0x126d('0x54')],{'$or':_[_0x126d('0x3e')](_0x25668b['attributes'],function(_0x37b890){var _0x304ca3={};_0x304ca3[_0x37b890]={'$like':'%'+_0x153f40[_0x126d('0x4c')][_0x126d('0x3c')]+'%'};return _0x304ca3;})});}_0x25668b=_['merge']({},_0x25668b,_0x153f40[_0x126d('0x5d')]);switch(_0x44e52c[_0x126d('0x42')]){case'admin':return db[_['capitalize'](_0x153f40[_0x126d('0x4c')][_0x126d('0xac')])+_0x126d('0xc6')][_0x126d('0x5f')](_0x25668b);case _0x126d('0x87'):case _0x126d('0x39'):return _0x44e52c['get'+_[_0x126d('0x9c')](_0x153f40['query'][_0x126d('0xac')])+_0x126d('0xaf')](_0x25668b);default:throw new db[(_0x126d('0x90'))][(_0x126d('0x91'))](_0x126d('0xc7'));}})['then'](function(_0x2f1d23){_0xbe9d39=_0x2f1d23[_0x126d('0x51')];if(!_0x153f40[_0x126d('0x4c')][_0x126d('0x52')](_0x126d('0xc3'))){_0x25668b[_0x126d('0x2f')]=qs[_0x126d('0x2f')](_0x153f40[_0x126d('0x4c')][_0x126d('0x2f')]);_0x25668b['offset']=qs[_0x126d('0x2e')](_0x153f40['query'][_0x126d('0x2e')]);}switch(_0x44e52c[_0x126d('0x42')]){case _0x126d('0x6b'):return db[_[_0x126d('0x9c')](_0x153f40[_0x126d('0x4c')][_0x126d('0xac')])+_0x126d('0xc6')]['findAll'](_0x25668b);case _0x126d('0x87'):case _0x126d('0x39'):return _0x44e52c[_0x126d('0x37')+_[_0x126d('0x9c')](_0x153f40['query'][_0x126d('0xac')])+_0x126d('0xaf')](_0x25668b);}})[_0x126d('0x35')](function(_0x198154){return{'count':_0xbe9d39,'rows':_0x198154};})[_0x126d('0x35')](respondWithResult(_0x1e19b3,null))['catch'](handleError(_0x1e19b3,null));};exports['getVoiceQueuesRt']=function(_0x3a305b,_0x29bc05,_0x65ccdd){var _0x239fdd={};var _0x3ef8db={};var _0x4d00d7;var _0x45341;return db[_0x126d('0x46')]['findOne']({'where':{'id':_0x3a305b[_0x126d('0x63')]['id']}})[_0x126d('0x35')](handleEntityNotFound(_0x29bc05,null))[_0x126d('0x35')](function(_0x18f6bd){if(_0x18f6bd){_0x4d00d7=_0x18f6bd;_0x3ef8db[_0x126d('0x48')]=_[_0x126d('0x49')](db['UserVoiceQueueRt']['rawAttributes']);_0x3ef8db[_0x126d('0x4c')]=_[_0x126d('0x49')](_0x3a305b['query']);_0x3ef8db['filters']=_[_0x126d('0x4e')](_0x3ef8db['model'],_0x3ef8db['query']);_0x239fdd[_0x126d('0x4f')]=_[_0x126d('0x4e')](_0x3ef8db[_0x126d('0x48')],qs['fields'](_0x3a305b[_0x126d('0x4c')][_0x126d('0x50')]));_0x239fdd['attributes']=_0x239fdd['attributes'][_0x126d('0x51')]?_0x239fdd[_0x126d('0x4f')]:_0x3ef8db[_0x126d('0x48')];_0x239fdd['order']=qs[_0x126d('0x53')](_0x3a305b[_0x126d('0x4c')][_0x126d('0x53')]);_0x239fdd[_0x126d('0x54')]=qs['filters'](_['pick'](_0x3a305b['query'],_0x3ef8db[_0x126d('0x4d')]));if(_0x3a305b['query'][_0x126d('0x3c')]){_0x239fdd[_0x126d('0x54')]=_[_0x126d('0x55')](_0x239fdd[_0x126d('0x54')],{'$or':_[_0x126d('0x3e')](_0x239fdd[_0x126d('0x4f')],function(_0x54a310){var _0x770bde={};_0x770bde[_0x54a310]={'$like':'%'+_0x3a305b[_0x126d('0x4c')][_0x126d('0x3c')]+'%'};return _0x770bde;})});}_0x239fdd=_[_0x126d('0x55')]({},_0x239fdd,_0x3a305b['options']);return _0x4d00d7[_0x126d('0xc8')](_0x239fdd);}})['then'](function(_0x12c8d7){if(_0x12c8d7){_0x45341=_0x12c8d7[_0x126d('0x51')];if(!_0x3a305b['query']['hasOwnProperty'](_0x126d('0xc3'))){_0x239fdd[_0x126d('0x2f')]=qs[_0x126d('0x2f')](_0x3a305b['query']['limit']);_0x239fdd[_0x126d('0x2e')]=qs[_0x126d('0x2e')](_0x3a305b[_0x126d('0x4c')]['offset']);}return _0x4d00d7[_0x126d('0xc8')](_0x239fdd);}})[_0x126d('0x35')](function(_0x173dc0){if(_0x173dc0){return _0x173dc0?{'count':_0x45341,'rows':_0x173dc0}:null;}})['then'](respondWithResult(_0x29bc05,null))['catch'](handleError(_0x29bc05,null));};exports[_0x126d('0xc9')]=function(_0x1d8377,_0x3e9246,_0x51ef6c){var _0x39ee5d={};var _0x5d8b08={};var _0x213b29;var _0x3b247f;return db[_0x126d('0x46')][_0x126d('0x97')]({'where':{'id':_0x1d8377[_0x126d('0x63')]['id']}})[_0x126d('0x35')](handleEntityNotFound(_0x3e9246,null))['then'](function(_0x376320){if(_0x376320){_0x213b29=_0x376320;_0x5d8b08[_0x126d('0x48')]=_[_0x126d('0x49')](db['ChatGroup'][_0x126d('0x47')]);_0x5d8b08[_0x126d('0x4c')]=_[_0x126d('0x49')](_0x1d8377[_0x126d('0x4c')]);_0x5d8b08[_0x126d('0x4d')]=_[_0x126d('0x4e')](_0x5d8b08['model'],_0x5d8b08[_0x126d('0x4c')]);_0x39ee5d[_0x126d('0x4f')]=_[_0x126d('0x4e')](_0x5d8b08[_0x126d('0x48')],qs[_0x126d('0x50')](_0x1d8377[_0x126d('0x4c')]['fields']));_0x39ee5d['attributes']=_0x39ee5d[_0x126d('0x4f')][_0x126d('0x51')]?_0x39ee5d[_0x126d('0x4f')]:_0x5d8b08[_0x126d('0x48')];_0x39ee5d[_0x126d('0xc5')]=qs[_0x126d('0x53')](_0x1d8377[_0x126d('0x4c')][_0x126d('0x53')]);_0x39ee5d[_0x126d('0x54')]=qs[_0x126d('0x4d')](_[_0x126d('0xbc')](_0x1d8377[_0x126d('0x4c')],_0x5d8b08[_0x126d('0x4d')]));if(_0x1d8377['query'][_0x126d('0x3c')]){_0x39ee5d[_0x126d('0x54')]=_['merge'](_0x39ee5d['where'],{'$or':_[_0x126d('0x3e')](_0x39ee5d['attributes'],function(_0x57e279){var _0x54e2e6={};_0x54e2e6[_0x57e279]={'$like':'%'+_0x1d8377['query'][_0x126d('0x3c')]+'%'};return _0x54e2e6;})});}_0x39ee5d=_[_0x126d('0x55')]({},_0x39ee5d,_0x1d8377[_0x126d('0x5d')]);return _0x213b29[_0x126d('0xc9')](_0x39ee5d);}})[_0x126d('0x35')](function(_0x181bcb){if(_0x181bcb){_0x3b247f=_0x181bcb[_0x126d('0x51')];if(!_0x1d8377['query'][_0x126d('0x52')](_0x126d('0xc3'))){_0x39ee5d[_0x126d('0x2f')]=qs[_0x126d('0x2f')](_0x1d8377[_0x126d('0x4c')][_0x126d('0x2f')]);_0x39ee5d[_0x126d('0x2e')]=qs[_0x126d('0x2e')](_0x1d8377[_0x126d('0x4c')][_0x126d('0x2e')]);}return _0x213b29[_0x126d('0xc9')](_0x39ee5d);}})[_0x126d('0x35')](function(_0xc7bca4){if(_0xc7bca4){return _0xc7bca4?{'count':_0x3b247f,'rows':_0xc7bca4}:null;}})[_0x126d('0x35')](respondWithResult(_0x3e9246,null))[_0x126d('0x61')](handleError(_0x3e9246,null));};exports[_0x126d('0xca')]=function(_0x3eb7b5,_0x463c2a,_0x414661){var _0x3b9d2a={'raw':!![],'where':{}};var _0x22bcb9={};var _0x2b9227={'count':0x0,'rows':[]};return db[_0x126d('0x46')][_0x126d('0x97')]({'where':{'id':_0x3eb7b5['params']['id']}})[_0x126d('0x35')](handleEntityNotFound(_0x463c2a,null))['then'](function(_0x5d9e1f){if(_0x5d9e1f){_0x22bcb9[_0x126d('0x48')]=_['keys'](db['VoiceRecording'][_0x126d('0x47')]);_0x22bcb9['query']=_[_0x126d('0x49')](_0x3eb7b5[_0x126d('0x4c')]);_0x22bcb9[_0x126d('0x4d')]=_[_0x126d('0x4e')](_0x22bcb9[_0x126d('0x48')],_0x22bcb9[_0x126d('0x4c')]);_0x3b9d2a[_0x126d('0x4f')]=_[_0x126d('0x4e')](_0x22bcb9[_0x126d('0x48')],qs[_0x126d('0x50')](_0x3eb7b5[_0x126d('0x4c')]['fields']));_0x3b9d2a[_0x126d('0x4f')]=_0x3b9d2a[_0x126d('0x4f')]['length']?_0x3b9d2a[_0x126d('0x4f')]:_0x22bcb9['model'];if(!_0x3eb7b5[_0x126d('0x4c')]['hasOwnProperty']('nolimit')){_0x3b9d2a['limit']=qs[_0x126d('0x2f')](_0x3eb7b5['query'][_0x126d('0x2f')]);_0x3b9d2a[_0x126d('0x2e')]=qs['offset'](_0x3eb7b5[_0x126d('0x4c')]['offset']);}_0x3b9d2a[_0x126d('0xc5')]=qs['sort'](_0x3eb7b5[_0x126d('0x4c')][_0x126d('0x53')]);_0x3b9d2a['where']=qs['filters'](_[_0x126d('0xbc')](_0x3eb7b5['query'],_0x22bcb9[_0x126d('0x4d')]));_0x3b9d2a[_0x126d('0x54')][_0x126d('0xcb')]=_0x5d9e1f['id'];if(_0x3eb7b5[_0x126d('0x4c')][_0x126d('0x3c')]){_0x3b9d2a['where']=_[_0x126d('0x55')](_0x3b9d2a[_0x126d('0x54')],{'$or':_[_0x126d('0x3e')](_0x3b9d2a[_0x126d('0x4f')],function(_0x13bfe4){var _0x3efa90={};_0x3efa90[_0x13bfe4]={'$like':'%'+_0x3eb7b5[_0x126d('0x4c')][_0x126d('0x3c')]+'%'};return _0x3efa90;})});}_0x3b9d2a=_['merge']({},_0x3b9d2a,_0x3eb7b5[_0x126d('0x5d')]);return db[_0x126d('0xcc')][_0x126d('0x2d')]({'where':_0x3b9d2a[_0x126d('0x54')]})['then'](function(_0x33b911){_0x2b9227[_0x126d('0x2d')]=_0x33b911;if(_0x3eb7b5[_0x126d('0x4c')][_0x126d('0xbd')]){_0x3b9d2a[_0x126d('0x5e')]=[{'all':!![]}];}return db[_0x126d('0xcc')][_0x126d('0x5f')](_0x3b9d2a);})[_0x126d('0x35')](function(_0x380d07){_0x2b9227[_0x126d('0x60')]=_0x380d07;return _0x2b9227;});}})[_0x126d('0x35')](respondWithFilteredResult(_0x463c2a,_0x3b9d2a))['catch'](handleError(_0x463c2a,null));};exports[_0x126d('0xcd')]=function(_0x2f2df8,_0x20dbbe,_0x367d83){var _0x1fa39a={'raw':!![],'where':{}};var _0x92f5e5={};var _0x2f7ded={'count':0x0,'rows':[]};return db[_0x126d('0x46')]['findOne']({'where':{'id':_0x2f2df8[_0x126d('0x63')]['id']}})['then'](handleEntityNotFound(_0x20dbbe,null))[_0x126d('0x35')](function(_0xbc529f){if(_0xbc529f){_0x92f5e5[_0x126d('0x48')]=_[_0x126d('0x49')](db['ScreenRecording'][_0x126d('0x47')]);_0x92f5e5[_0x126d('0x4c')]=_[_0x126d('0x49')](_0x2f2df8[_0x126d('0x4c')]);_0x92f5e5[_0x126d('0x4d')]=_[_0x126d('0x4e')](_0x92f5e5[_0x126d('0x48')],_0x92f5e5[_0x126d('0x4c')]);_0x1fa39a[_0x126d('0x4f')]=_[_0x126d('0x4e')](_0x92f5e5[_0x126d('0x48')],qs[_0x126d('0x50')](_0x2f2df8[_0x126d('0x4c')][_0x126d('0x50')]));_0x1fa39a[_0x126d('0x4f')]=_0x1fa39a[_0x126d('0x4f')][_0x126d('0x51')]?_0x1fa39a[_0x126d('0x4f')]:_0x92f5e5[_0x126d('0x48')];if(!_0x2f2df8['query'][_0x126d('0x52')]('nolimit')){_0x1fa39a[_0x126d('0x2f')]=qs[_0x126d('0x2f')](_0x2f2df8[_0x126d('0x4c')][_0x126d('0x2f')]);_0x1fa39a[_0x126d('0x2e')]=qs[_0x126d('0x2e')](_0x2f2df8[_0x126d('0x4c')][_0x126d('0x2e')]);}_0x1fa39a[_0x126d('0xc5')]=qs[_0x126d('0x53')](_0x2f2df8['query']['sort']);_0x1fa39a[_0x126d('0x54')]=qs[_0x126d('0x4d')](_[_0x126d('0xbc')](_0x2f2df8[_0x126d('0x4c')],_0x92f5e5[_0x126d('0x4d')]));_0x1fa39a[_0x126d('0x54')][_0x126d('0xcb')]=_0xbc529f['id'];if(_0x2f2df8['query'][_0x126d('0x3c')]){_0x1fa39a[_0x126d('0x54')]=_['merge'](_0x1fa39a[_0x126d('0x54')],{'$or':_[_0x126d('0x3e')](_0x1fa39a['attributes'],function(_0x7bf104){var _0x2e3202={};_0x2e3202[_0x7bf104]={'$like':'%'+_0x2f2df8['query'][_0x126d('0x3c')]+'%'};return _0x2e3202;})});}_0x1fa39a=_[_0x126d('0x55')]({},_0x1fa39a,_0x2f2df8[_0x126d('0x5d')]);return db[_0x126d('0xce')][_0x126d('0x2d')]({'where':_0x1fa39a['where']})[_0x126d('0x35')](function(_0x5e2a08){_0x2f7ded['count']=_0x5e2a08;if(_0x2f2df8[_0x126d('0x4c')][_0x126d('0xbd')]){_0x1fa39a[_0x126d('0x5e')]=[{'all':!![]}];}return db['ScreenRecording'][_0x126d('0x5f')](_0x1fa39a);})[_0x126d('0x35')](function(_0x326eb0){_0x2f7ded['rows']=_0x326eb0;return _0x2f7ded;});}})[_0x126d('0x35')](respondWithFilteredResult(_0x20dbbe,_0x1fa39a))[_0x126d('0x61')](handleError(_0x20dbbe,null));};exports['getChatInteractions']=function(_0x40ee25,_0xadb65c,_0x36087d){var _0x38c2a1={};var _0xeac95a={};var _0x25af38;var _0x3c3c42;return db[_0x126d('0x46')][_0x126d('0x97')]({'where':{'id':_0x40ee25['params']['id']}})[_0x126d('0x35')](handleEntityNotFound(_0xadb65c,null))[_0x126d('0x35')](function(_0xedb81b){if(_0xedb81b){_0x25af38=_0xedb81b;_0xeac95a[_0x126d('0x48')]=_[_0x126d('0x49')](db[_0x126d('0xcf')][_0x126d('0x47')]);_0xeac95a[_0x126d('0x4c')]=_['keys'](_0x40ee25[_0x126d('0x4c')]);_0xeac95a[_0x126d('0x4d')]=_[_0x126d('0x4e')](_0xeac95a[_0x126d('0x48')],_0xeac95a[_0x126d('0x4c')]);_0x38c2a1['attributes']=_[_0x126d('0x4e')](_0xeac95a[_0x126d('0x48')],qs[_0x126d('0x50')](_0x40ee25[_0x126d('0x4c')][_0x126d('0x50')]));_0x38c2a1[_0x126d('0x4f')]=_0x38c2a1[_0x126d('0x4f')][_0x126d('0x51')]?_0x38c2a1[_0x126d('0x4f')]:_0xeac95a[_0x126d('0x48')];_0x38c2a1[_0x126d('0xc5')]=qs[_0x126d('0x53')](_0x40ee25[_0x126d('0x4c')][_0x126d('0x53')]);_0x38c2a1[_0x126d('0x54')]=qs[_0x126d('0x4d')](_[_0x126d('0xbc')](_0x40ee25[_0x126d('0x4c')],_0xeac95a['filters']));if(_0x40ee25[_0x126d('0x4c')][_0x126d('0x3c')]){_0x38c2a1[_0x126d('0x54')]=_[_0x126d('0x55')](_0x38c2a1[_0x126d('0x54')],{'$or':_[_0x126d('0x3e')](_0x38c2a1[_0x126d('0x4f')],function(_0x5ed308){var _0x3d5833={};_0x3d5833[_0x5ed308]={'$like':'%'+_0x40ee25[_0x126d('0x4c')]['filter']+'%'};return _0x3d5833;})});}_0x38c2a1=_[_0x126d('0x55')]({},_0x38c2a1,_0x40ee25[_0x126d('0x5d')]);return _0x25af38['getChatInteractions'](_0x38c2a1);}})[_0x126d('0x35')](function(_0x11167e){if(_0x11167e){_0x3c3c42=_0x11167e[_0x126d('0x51')];if(!_0x40ee25['query'][_0x126d('0x52')](_0x126d('0xc3'))){_0x38c2a1[_0x126d('0x2f')]=qs['limit'](_0x40ee25['query'][_0x126d('0x2f')]);_0x38c2a1[_0x126d('0x2e')]=qs[_0x126d('0x2e')](_0x40ee25[_0x126d('0x4c')][_0x126d('0x2e')]);}return _0x25af38[_0x126d('0xd0')](_0x38c2a1);}})[_0x126d('0x35')](function(_0x2e6c1b){if(_0x2e6c1b){return _0x2e6c1b?{'count':_0x3c3c42,'rows':_0x2e6c1b}:null;}})[_0x126d('0x35')](respondWithResult(_0xadb65c,null))['catch'](handleError(_0xadb65c,null));};exports[_0x126d('0xd1')]=function(_0x2e48a3,_0x5d8f61,_0x20b21a){var _0x273952={};var _0x30fee5={};var _0x45e2ef;var _0x40719f;return db[_0x126d('0x46')][_0x126d('0x97')]({'where':{'id':_0x2e48a3[_0x126d('0x63')]['id']}})[_0x126d('0x35')](handleEntityNotFound(_0x5d8f61,null))[_0x126d('0x35')](function(_0x52d199){if(_0x52d199){_0x45e2ef=_0x52d199;_0x30fee5[_0x126d('0x48')]=_[_0x126d('0x49')](db[_0x126d('0xd2')][_0x126d('0x47')]);_0x30fee5[_0x126d('0x4c')]=_[_0x126d('0x49')](_0x2e48a3[_0x126d('0x4c')]);_0x30fee5[_0x126d('0x4d')]=_[_0x126d('0x4e')](_0x30fee5['model'],_0x30fee5['query']);_0x273952[_0x126d('0x4f')]=_[_0x126d('0x4e')](_0x30fee5[_0x126d('0x48')],qs['fields'](_0x2e48a3[_0x126d('0x4c')][_0x126d('0x50')]));_0x273952[_0x126d('0x4f')]=_0x273952[_0x126d('0x4f')][_0x126d('0x51')]?_0x273952[_0x126d('0x4f')]:_0x30fee5[_0x126d('0x48')];_0x273952[_0x126d('0xc5')]=qs[_0x126d('0x53')](_0x2e48a3[_0x126d('0x4c')]['sort']);_0x273952[_0x126d('0x54')]=qs['filters'](_['pick'](_0x2e48a3[_0x126d('0x4c')],_0x30fee5['filters']));if(_0x2e48a3[_0x126d('0x4c')][_0x126d('0x3c')]){_0x273952[_0x126d('0x54')]=_[_0x126d('0x55')](_0x273952[_0x126d('0x54')],{'$or':_[_0x126d('0x3e')](_0x273952['attributes'],function(_0x171b3f){var _0x5d3fe2={};_0x5d3fe2[_0x171b3f]={'$like':'%'+_0x2e48a3[_0x126d('0x4c')][_0x126d('0x3c')]+'%'};return _0x5d3fe2;})});}_0x273952=_[_0x126d('0x55')]({},_0x273952,_0x2e48a3[_0x126d('0x5d')]);return _0x45e2ef[_0x126d('0xd1')](_0x273952);}})[_0x126d('0x35')](function(_0x3d6e08){if(_0x3d6e08){_0x40719f=_0x3d6e08[_0x126d('0x51')];if(!_0x2e48a3['query']['hasOwnProperty'](_0x126d('0xc3'))){_0x273952[_0x126d('0x2f')]=qs['limit'](_0x2e48a3[_0x126d('0x4c')][_0x126d('0x2f')]);_0x273952[_0x126d('0x2e')]=qs['offset'](_0x2e48a3[_0x126d('0x4c')][_0x126d('0x2e')]);}return _0x45e2ef[_0x126d('0xd1')](_0x273952);}})[_0x126d('0x35')](function(_0x759e3){if(_0x759e3){return _0x759e3?{'count':_0x40719f,'rows':_0x759e3}:null;}})['then'](respondWithResult(_0x5d8f61,null))[_0x126d('0x61')](handleError(_0x5d8f61,null));};exports[_0x126d('0xd3')]=function(_0x33913d,_0x374f02,_0x58b9ff){var _0x28ae34={'raw':!![],'where':{}};var _0x2d15e5={};var _0x5219ee={'count':0x0,'rows':[]};return db[_0x126d('0x46')][_0x126d('0x97')]({'where':{'id':_0x33913d[_0x126d('0x63')]['id']}})[_0x126d('0x35')](handleEntityNotFound(_0x374f02,null))['then'](function(_0x20c644){if(_0x20c644){_0x2d15e5['model']=_['keys'](db[_0x126d('0xd4')][_0x126d('0x47')]);_0x2d15e5[_0x126d('0x4c')]=_['keys'](_0x33913d[_0x126d('0x4c')]);_0x2d15e5[_0x126d('0x4d')]=_[_0x126d('0x4e')](_0x2d15e5['model'],_0x2d15e5[_0x126d('0x4c')]);_0x28ae34['attributes']=_[_0x126d('0x4e')](_0x2d15e5[_0x126d('0x48')],qs['fields'](_0x33913d[_0x126d('0x4c')][_0x126d('0x50')]));_0x28ae34['attributes']=_0x28ae34[_0x126d('0x4f')][_0x126d('0x51')]?_0x28ae34['attributes']:_0x2d15e5[_0x126d('0x48')];if(!_0x33913d['query']['hasOwnProperty'](_0x126d('0xc3'))){_0x28ae34['limit']=qs[_0x126d('0x2f')](_0x33913d[_0x126d('0x4c')]['limit']);_0x28ae34[_0x126d('0x2e')]=qs['offset'](_0x33913d[_0x126d('0x4c')][_0x126d('0x2e')]);}_0x28ae34[_0x126d('0xc5')]=qs['sort'](_0x33913d['query'][_0x126d('0x53')]);_0x28ae34[_0x126d('0x54')]=qs[_0x126d('0x4d')](_[_0x126d('0xbc')](_0x33913d[_0x126d('0x4c')],_0x2d15e5[_0x126d('0x4d')]));_0x28ae34[_0x126d('0x54')][_0x126d('0xcb')]=_0x20c644['id'];if(_0x33913d[_0x126d('0x4c')][_0x126d('0x3c')]){_0x28ae34[_0x126d('0x54')]=_[_0x126d('0x55')](_0x28ae34[_0x126d('0x54')],{'$or':_[_0x126d('0x3e')](_0x28ae34[_0x126d('0x4f')],function(_0x2b3dc8){var _0xaad1f5={};_0xaad1f5[_0x2b3dc8]={'$like':'%'+_0x33913d[_0x126d('0x4c')][_0x126d('0x3c')]+'%'};return _0xaad1f5;})});}_0x28ae34=_['merge']({},_0x28ae34,_0x33913d['options']);return db[_0x126d('0xd4')]['count']({'where':_0x28ae34['where']})[_0x126d('0x35')](function(_0x2bbfd1){_0x5219ee[_0x126d('0x2d')]=_0x2bbfd1;if(_0x33913d[_0x126d('0x4c')]['includeAll']){_0x28ae34[_0x126d('0x5e')]=[{'all':!![]}];}return db[_0x126d('0xd4')]['findAll'](_0x28ae34);})['then'](function(_0xc5affb){_0x5219ee['rows']=_0xc5affb;return _0x5219ee;});}})[_0x126d('0x35')](respondWithFilteredResult(_0x374f02,_0x28ae34))[_0x126d('0x61')](handleError(_0x374f02,null));};exports['getSmsInteractions']=function(_0x239d0c,_0x4634f6,_0x43b6d7){var _0x4ace5a={};var _0x100b82={};var _0x38b8e9;var _0x4520de;return db[_0x126d('0x46')][_0x126d('0x97')]({'where':{'id':_0x239d0c['params']['id']}})[_0x126d('0x35')](handleEntityNotFound(_0x4634f6,null))[_0x126d('0x35')](function(_0x51ba3f){if(_0x51ba3f){_0x38b8e9=_0x51ba3f;_0x100b82[_0x126d('0x48')]=_['keys'](db[_0x126d('0xd5')][_0x126d('0x47')]);_0x100b82[_0x126d('0x4c')]=_['keys'](_0x239d0c[_0x126d('0x4c')]);_0x100b82['filters']=_[_0x126d('0x4e')](_0x100b82[_0x126d('0x48')],_0x100b82[_0x126d('0x4c')]);_0x4ace5a['attributes']=_[_0x126d('0x4e')](_0x100b82[_0x126d('0x48')],qs[_0x126d('0x50')](_0x239d0c[_0x126d('0x4c')]['fields']));_0x4ace5a[_0x126d('0x4f')]=_0x4ace5a[_0x126d('0x4f')][_0x126d('0x51')]?_0x4ace5a[_0x126d('0x4f')]:_0x100b82['model'];_0x4ace5a['order']=qs[_0x126d('0x53')](_0x239d0c[_0x126d('0x4c')]['sort']);_0x4ace5a['where']=qs[_0x126d('0x4d')](_[_0x126d('0xbc')](_0x239d0c[_0x126d('0x4c')],_0x100b82['filters']));if(_0x239d0c[_0x126d('0x4c')]['filter']){_0x4ace5a['where']=_[_0x126d('0x55')](_0x4ace5a[_0x126d('0x54')],{'$or':_[_0x126d('0x3e')](_0x4ace5a['attributes'],function(_0x9f9ee1){var _0x4ba7c3={};_0x4ba7c3[_0x9f9ee1]={'$like':'%'+_0x239d0c[_0x126d('0x4c')][_0x126d('0x3c')]+'%'};return _0x4ba7c3;})});}_0x4ace5a=_[_0x126d('0x55')]({},_0x4ace5a,_0x239d0c[_0x126d('0x5d')]);return _0x38b8e9[_0x126d('0xd6')](_0x4ace5a);}})[_0x126d('0x35')](function(_0x208b10){if(_0x208b10){_0x4520de=_0x208b10['length'];if(!_0x239d0c['query']['hasOwnProperty'](_0x126d('0xc3'))){_0x4ace5a[_0x126d('0x2f')]=qs[_0x126d('0x2f')](_0x239d0c[_0x126d('0x4c')][_0x126d('0x2f')]);_0x4ace5a['offset']=qs[_0x126d('0x2e')](_0x239d0c[_0x126d('0x4c')][_0x126d('0x2e')]);}return _0x38b8e9[_0x126d('0xd6')](_0x4ace5a);}})['then'](function(_0x5044f8){if(_0x5044f8){return _0x5044f8?{'count':_0x4520de,'rows':_0x5044f8}:null;}})['then'](respondWithResult(_0x4634f6,null))[_0x126d('0x61')](handleError(_0x4634f6,null));};exports[_0x126d('0xd7')]=function(_0x2abd77,_0x4f1009,_0x69d955){var _0x318657={};var _0x5cfadb={};var _0x1e1133;var _0x56d548;return db[_0x126d('0x46')][_0x126d('0x97')]({'where':{'id':_0x2abd77[_0x126d('0x63')]['id']}})[_0x126d('0x35')](handleEntityNotFound(_0x4f1009,null))[_0x126d('0x35')](function(_0x40b80c){if(_0x40b80c){_0x1e1133=_0x40b80c;_0x5cfadb[_0x126d('0x48')]=_[_0x126d('0x49')](db[_0x126d('0xd8')][_0x126d('0x47')]);_0x5cfadb['query']=_[_0x126d('0x49')](_0x2abd77[_0x126d('0x4c')]);_0x5cfadb[_0x126d('0x4d')]=_[_0x126d('0x4e')](_0x5cfadb[_0x126d('0x48')],_0x5cfadb[_0x126d('0x4c')]);_0x318657[_0x126d('0x4f')]=_[_0x126d('0x4e')](_0x5cfadb[_0x126d('0x48')],qs['fields'](_0x2abd77[_0x126d('0x4c')][_0x126d('0x50')]));_0x318657[_0x126d('0x4f')]=_0x318657[_0x126d('0x4f')]['length']?_0x318657[_0x126d('0x4f')]:_0x5cfadb[_0x126d('0x48')];_0x318657['order']=qs[_0x126d('0x53')](_0x2abd77['query'][_0x126d('0x53')]);_0x318657[_0x126d('0x54')]=qs['filters'](_[_0x126d('0xbc')](_0x2abd77[_0x126d('0x4c')],_0x5cfadb['filters']));if(_0x2abd77['query'][_0x126d('0x3c')]){_0x318657[_0x126d('0x54')]=_[_0x126d('0x55')](_0x318657[_0x126d('0x54')],{'$or':_[_0x126d('0x3e')](_0x318657[_0x126d('0x4f')],function(_0x28beb4){var _0x1f5848={};_0x1f5848[_0x28beb4]={'$like':'%'+_0x2abd77[_0x126d('0x4c')][_0x126d('0x3c')]+'%'};return _0x1f5848;})});}_0x318657=_[_0x126d('0x55')]({},_0x318657,_0x2abd77['options']);return _0x1e1133[_0x126d('0xd7')](_0x318657);}})['then'](function(_0x447625){if(_0x447625){_0x56d548=_0x447625[_0x126d('0x51')];if(!_0x2abd77[_0x126d('0x4c')]['hasOwnProperty'](_0x126d('0xc3'))){_0x318657[_0x126d('0x2f')]=qs[_0x126d('0x2f')](_0x2abd77[_0x126d('0x4c')][_0x126d('0x2f')]);_0x318657[_0x126d('0x2e')]=qs[_0x126d('0x2e')](_0x2abd77[_0x126d('0x4c')]['offset']);}return _0x1e1133[_0x126d('0xd7')](_0x318657);}})[_0x126d('0x35')](function(_0x1bf875){if(_0x1bf875){return _0x1bf875?{'count':_0x56d548,'rows':_0x1bf875}:null;}})[_0x126d('0x35')](respondWithResult(_0x4f1009,null))[_0x126d('0x61')](handleError(_0x4f1009,null));};exports[_0x126d('0xd9')]=function(_0x5a8749,_0x418114,_0x231d0e){var _0x23a4fe;var _0x19e841;var _0x231fde;var _0x2aa967=!_[_0x126d('0x6e')](_0x5a8749[_0x126d('0x63')]['id'])?_0x5a8749[_0x126d('0x63')]['id']:!_[_0x126d('0x6e')](_0x5a8749[_0x126d('0x87')]['id'])?_0x5a8749['user']['id']:null;return db[_0x126d('0x46')][_0x126d('0x41')]({'where':{'id':_0x2aa967,'role':_0x126d('0x39')},'attributes':['id','name','phone','mobile','role','internal',_0x126d('0xda')]})[_0x126d('0x35')](handleEntityNotFound(_0x418114,null))[_0x126d('0x35')](function(_0x130cf6){if(_0x130cf6){_0x23a4fe=_0x130cf6;if(_0x5a8749['body'][_0x126d('0xa5')]){_0x231fde=util[_0x126d('0x6f')](_0x126d('0xdb'),_0x23a4fe[_0x5a8749[_0x126d('0x65')][_0x126d('0xa5')]]);}else if(_0x5a8749['body'][_0x126d('0xdc')]){_0x231fde=util[_0x126d('0x6f')]('SIP/%s',_0x5a8749[_0x126d('0x65')][_0x126d('0xdc')]);}else{_0x231fde=util[_0x126d('0x6f')](_0x126d('0xa6'),_0x23a4fe[_0x126d('0x43')]);}socket['to'](util[_0x126d('0x6f')](_0x126d('0xdd'),_0x23a4fe[_0x126d('0x43')]))[_0x126d('0xb0')](_0x126d('0xde'),{'ip':_0x5a8749['headers'][_0x126d('0xdf')]||_0x5a8749[_0x126d('0xe0')][_0x126d('0xe1')]||_0x5a8749['socket'][_0x126d('0xe1')]||_0x5a8749[_0x126d('0xe0')][_0x126d('0xe2')][_0x126d('0xe1')]});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x23a4fe[_0x126d('0x43')]},'individualHooks':!![]});}})[_0x126d('0x35')](function(_0x450285){if(_0x23a4fe){return _0x23a4fe[_0x126d('0xe3')]({'raw':!![]});}})['then'](function(_0x425a92){var _0xdd04a6=[];if(_0x425a92){_0x19e841=_0x425a92;if(_0x19e841[_0x126d('0x51')]){for(var _0x4b4c58=0x0;_0x4b4c58<_0x19e841['length'];_0x4b4c58++){_0xdd04a6['push']({'membername':_0x23a4fe[_0x126d('0x43')],'UserId':_0x23a4fe['id'],'queue_name':_0x19e841[_0x4b4c58][_0x126d('0x43')],'VoiceQueueId':_0x19e841[_0x4b4c58]['id'],'interface':_0x231fde,'paused':_0x23a4fe[_0x126d('0xda')]||![],'penalty':_0x19e841[_0x4b4c58][_0x126d('0xe4')]||0x0});}return BPromise[_0x126d('0xa8')](_0xdd04a6,function(_0x55434a){return db['UserVoiceQueueRt'][_0x126d('0xaa')](_0x55434a);});}}})[_0x126d('0x35')](function(){return db[_0x126d('0xe5')][_0x126d('0x5f')]({'where':{'membername':_0x23a4fe['name'],'exitAt':null}});})['then'](function(_0x247121){var _0x415ef9=[];_0x247121[_0x126d('0xe6')](function(_0x15f258){_0x415ef9[_0x126d('0xa4')](_0x15f258[_0x126d('0x66')]({'exitAt':moment()['format'](_0x126d('0xe7'))}));});return BPromise[_0x126d('0xe8')](_0x415ef9);})[_0x126d('0x35')](function(){var _0x4a27e6=[];var _0x250b84=[];var _0x4e19e1=utils[_0x126d('0xe9')]();var _0x46251d={'membername':_0x23a4fe['name'],'interface':_0x231fde,'enterAt':moment()[_0x126d('0x6f')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x23a4fe['role'],'internal':_0x23a4fe[_0x126d('0x72')]};_0x4e19e1[_0x126d('0xe6')](function(_0x234f65){_0x4a27e6['push'](_[_0x126d('0x55')]({'channel':_0x234f65,'type':_0x126d('0xea'),'data1':_0x5a8749[_0x126d('0x65')][_0x126d('0xeb')],'data2':_0x231fde},_0x46251d));if(_0x23a4fe[_0x126d('0xda')]){_0x250b84['push'](_['merge']({'channel':_0x234f65,'type':_0x126d('0xec'),'data1':_0x126d('0xed')},_0x46251d));}});return db[_0x126d('0xe5')][_0x126d('0x64')](_0x4a27e6[_0x126d('0xee')](_0x250b84),{'individualHooks':!![]});})['then'](function(){return _0x23a4fe[_0x126d('0x66')]({'online':!![],'lastLoginAt':moment()['format'](_0x126d('0xe7')),'voicePause':_0x23a4fe[_0x126d('0xda')]||![],'mailPause':_0x23a4fe[_0x126d('0xda')]||![],'chatPause':_0x23a4fe[_0x126d('0xda')]||![],'faxPause':_0x23a4fe[_0x126d('0xda')]||![],'smsPause':_0x23a4fe['loginInPause']||![],'openchannelPause':_0x23a4fe[_0x126d('0xda')]||![],'pauseType':_0x23a4fe[_0x126d('0xda')]?_0x126d('0xed'):null,'interface':_0x231fde,'lastPauseAt':moment()[_0x126d('0x6f')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x126d('0x35')](function(_0x5f4d23){if(_0x5a8749['isMiddleware']){return _0x231d0e();}else{return BPromise[_0x126d('0xef')](_0x5f4d23)['then'](respondWithResult(_0x418114,null));}})[_0x126d('0x61')](handleError(_0x418114,null));};exports['logout']=function(_0x1ca15b,_0x18ab56,_0x1282ea){var _0x50e79a;return db['User'][_0x126d('0x41')]({'where':{'id':_0x1ca15b[_0x126d('0x63')]['id'],'role':'agent'},'attributes':['id',_0x126d('0x43'),'role']})[_0x126d('0x35')](handleEntityNotFound(_0x18ab56,null))[_0x126d('0x35')](function(_0x55ec09){if(_0x55ec09){_0x50e79a=_0x55ec09;return db[_0x126d('0xa9')][_0x126d('0x36')]({'where':{'membername':_0x50e79a[_0x126d('0x43')]},'individualHooks':!![]});}})['then'](function(){return db[_0x126d('0xe5')][_0x126d('0x5f')]({'where':{'membername':_0x50e79a[_0x126d('0x43')],'exitAt':null}});})[_0x126d('0x35')](function(_0x26416f){var _0x1eb379=[];_0x26416f[_0x126d('0xe6')](function(_0x326cf2){_0x1eb379[_0x126d('0xa4')](_0x326cf2[_0x126d('0x66')]({'exitAt':moment()[_0x126d('0x6f')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x126d('0xe8')](_0x1eb379);})[_0x126d('0x35')](function(){return _0x50e79a[_0x126d('0x66')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0x18ab56,null))[_0x126d('0x61')](handleError(_0x18ab56,null));};exports[_0x126d('0xf0')]=function(_0x140955,_0xa43da1,_0x596dae){var _0x110a5f;return db[_0x126d('0xa9')][_0x126d('0x66')]({'paused':0x1},{'where':{'UserId':_0x140955[_0x126d('0x63')]['id']},'individualHooks':!![]})[_0x126d('0x35')](function(){return db['User']['find']({'where':{'id':_0x140955['params']['id'],'role':_0x126d('0x39')},'attributes':['id',_0x126d('0x43'),_0x126d('0x42'),'internal','interface']});})['then'](handleEntityNotFound(_0xa43da1,null))[_0x126d('0x35')](function(_0x528633){if(_0x528633){_0x110a5f=_0x528633;return respondWithRpcPromise('QueuePause',_0x126d('0xf0'),{'id':_0x110a5f['id'],'name':_0x110a5f['name'],'pause':!![]});}})[_0x126d('0x35')](function(){if(_0x110a5f){return db[_0x126d('0xe5')][_0x126d('0x5f')]({'where':{'membername':_0x110a5f['name'],'type':_0x126d('0xec'),'exitAt':null}});}})[_0x126d('0x35')](function(_0x2030c3){if(_0x2030c3[_0x126d('0x51')]){var _0x1688de=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x7fcc94=0x0,_0x1706de=_0x2030c3['length'];_0x7fcc94<_0x1706de;_0x7fcc94++){_0x2030c3[_0x7fcc94][_0x126d('0xf1')]({'exitAt':_0x1688de});}}})['then'](function(){var _0x3a5970=[];var _0x393771=utils[_0x126d('0xe9')]();_0x393771[_0x126d('0xe6')](function(_0x552287){_0x3a5970[_0x126d('0xa4')]({'channel':_0x552287,'membername':_0x110a5f[_0x126d('0x43')],'interface':_[_0x126d('0x6e')](_0x110a5f[_0x126d('0xa5')])?util[_0x126d('0x6f')](_0x126d('0xa6'),_0x110a5f['name']):_0x110a5f[_0x126d('0xa5')],'type':'PAUSE','enterAt':moment()[_0x126d('0x6f')](_0x126d('0xe7')),'data1':_0x140955[_0x126d('0x65')][_0x126d('0x56')]||_0x126d('0xf2'),'role':_0x110a5f[_0x126d('0x42')],'internal':_0x110a5f['internal']});});return db[_0x126d('0xe5')][_0x126d('0x64')](_0x3a5970,{'individualHooks':!![]});})['then'](function(){return _0x110a5f[_0x126d('0x66')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x140955[_0x126d('0x65')][_0x126d('0x56')]||_0x126d('0xf2'),'lastPauseAt':moment()['format'](_0x126d('0xe7'))});})[_0x126d('0x35')](respondWithResult(_0xa43da1,null))[_0x126d('0x61')](handleError(_0xa43da1,null));};exports['unpause']=function(_0x11df0c,_0x4a362a,_0x2e914c){var _0x2a09f9;return db[_0x126d('0x46')][_0x126d('0x41')]({'where':{'id':_0x11df0c[_0x126d('0x63')]['id']},'attributes':['id',_0x126d('0x43'),'role','voicePause',_0x126d('0xf3'),'chatPause',_0x126d('0xf4'),_0x126d('0xf5'),'smsPause',_0x126d('0xf6'),_0x126d('0xf7')]})[_0x126d('0x35')](handleEntityNotFound(_0x4a362a,null))[_0x126d('0x35')](function(_0x404ca2){if(_0x404ca2){_0x2a09f9=_0x404ca2;if(_0x11df0c[_0x126d('0x65')][_0x126d('0xac')]&&!utils[_0x126d('0x9a')](_0x11df0c[_0x126d('0x65')][_0x126d('0xac')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}switch(_0x11df0c[_0x126d('0x65')]['channel']){case'voice':return respondWithRpcPromise(_0x126d('0xf8'),_0x126d('0xf9'),{'id':_0x2a09f9['id'],'name':_0x2a09f9[_0x126d('0x43')],'pause':![]})[_0x126d('0x35')](function(){return db[_0x126d('0xa9')]['update']({'paused':0x0},{'where':{'UserId':_0x2a09f9['id']},'individualHooks':!![]});})[_0x126d('0x35')](function(){return db[_0x126d('0xe5')][_0x126d('0x41')]({'where':{'channel':_0x11df0c[_0x126d('0x65')][_0x126d('0xac')],'membername':_0x2a09f9[_0x126d('0x43')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x74ef08){if(_0x74ef08){return _0x74ef08['update']({'exitAt':moment()[_0x126d('0x6f')](_0x126d('0xe7')),'data2':_0x126d('0xfa')},{'individualHooks':!![]});}return null;})[_0x126d('0x35')](function(){return _0x2a09f9[_0x126d('0x66')]({'voicePause':![]});});case _0x126d('0xfb'):case'chat':case'fax':case'sms':case _0x126d('0xfc'):return db['MemberReport'][_0x126d('0x41')]({'where':{'channel':_0x11df0c[_0x126d('0x65')][_0x126d('0xac')],'membername':_0x2a09f9['name'],'type':_0x126d('0xec'),'exitAt':null}})['then'](function(_0x2a984b){if(_0x2a984b){return _0x2a984b[_0x126d('0x66')]({'exitAt':moment()[_0x126d('0x6f')](_0x126d('0xe7')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x126d('0x35')](function(){var _0x1a3a02={};_[_0x126d('0x30')](_0x1a3a02,util['format'](_0x126d('0xfd'),_0x11df0c['body'][_0x126d('0xac')],'Pause'),![]);return _0x2a09f9[_0x126d('0x66')](_0x1a3a02);});default:return respondWithRpcPromise(_0x126d('0xf8'),_0x126d('0xf9'),{'id':_0x2a09f9['id'],'name':_0x2a09f9[_0x126d('0x43')],'pause':![]})[_0x126d('0x35')](function(){return db[_0x126d('0xa9')][_0x126d('0x66')]({'paused':0x0},{'where':{'UserId':_0x2a09f9['id']}});})['then'](function(){return db[_0x126d('0xe5')]['findAll']({'where':{'membername':_0x2a09f9[_0x126d('0x43')],'type':_0x126d('0xec'),'exitAt':null}});})[_0x126d('0x35')](function(_0x2d179c){var _0x2c6958=[];_0x2d179c['forEach'](function(_0x5d17ee){_0x2c6958[_0x126d('0xa4')](_0x5d17ee['update']({'exitAt':moment()[_0x126d('0x6f')](_0x126d('0xe7')),'data2':_0x126d('0xfa')}));});return BPromise[_0x126d('0xe8')](_0x2c6958);})['then'](function(){return _0x2a09f9[_0x126d('0x66')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x126d('0x35')](respondWithResult(_0x4a362a,null))[_0x126d('0x61')](handleError(_0x4a362a,null));};exports['getTeams']=function(_0x350c5c,_0x593846,_0x7e4aa7){var _0x57afe3={};var _0x1174d8={};var _0x586270;var _0x1871fe;return db['User'][_0x126d('0x97')]({'where':{'id':_0x350c5c[_0x126d('0x63')]['id']}})['then'](handleEntityNotFound(_0x593846,null))[_0x126d('0x35')](function(_0x124b60){if(_0x124b60){_0x586270=_0x124b60;_0x1174d8[_0x126d('0x48')]=_[_0x126d('0x49')](db[_0x126d('0xfe')][_0x126d('0x47')]);_0x1174d8[_0x126d('0x4c')]=_[_0x126d('0x49')](_0x350c5c[_0x126d('0x4c')]);_0x1174d8['filters']=_[_0x126d('0x4e')](_0x1174d8[_0x126d('0x48')],_0x1174d8['query']);_0x57afe3[_0x126d('0x4f')]=_[_0x126d('0x4e')](_0x1174d8[_0x126d('0x48')],qs[_0x126d('0x50')](_0x350c5c['query'][_0x126d('0x50')]));_0x57afe3[_0x126d('0x4f')]=_0x57afe3[_0x126d('0x4f')]['length']?_0x57afe3['attributes']:_0x1174d8['model'];_0x57afe3[_0x126d('0xc5')]=qs[_0x126d('0x53')](_0x350c5c['query'][_0x126d('0x53')]);_0x57afe3[_0x126d('0x54')]=qs[_0x126d('0x4d')](_[_0x126d('0xbc')](_0x350c5c[_0x126d('0x4c')],_0x1174d8[_0x126d('0x4d')]));if(_0x350c5c[_0x126d('0x4c')]['filter']){_0x57afe3['where']=_[_0x126d('0x55')](_0x57afe3[_0x126d('0x54')],{'$or':_[_0x126d('0x3e')](_0x57afe3[_0x126d('0x4f')],function(_0x547f19){var _0x21f9a0={};_0x21f9a0[_0x547f19]={'$like':'%'+_0x350c5c['query'][_0x126d('0x3c')]+'%'};return _0x21f9a0;})});}_0x57afe3=_['merge']({},_0x57afe3,_0x350c5c[_0x126d('0x5d')]);return _0x586270[_0x126d('0xff')](_0x57afe3);}})[_0x126d('0x35')](function(_0x3b558e){if(_0x3b558e){_0x1871fe=_0x3b558e[_0x126d('0x51')];if(!_0x350c5c[_0x126d('0x4c')][_0x126d('0x52')](_0x126d('0xc3'))){_0x57afe3[_0x126d('0x2f')]=qs[_0x126d('0x2f')](_0x350c5c[_0x126d('0x4c')][_0x126d('0x2f')]);_0x57afe3[_0x126d('0x2e')]=qs[_0x126d('0x2e')](_0x350c5c[_0x126d('0x4c')][_0x126d('0x2e')]);}return _0x586270[_0x126d('0xff')](_0x57afe3);}})[_0x126d('0x35')](function(_0x3f9d11){if(_0x3f9d11){return _0x3f9d11?{'count':_0x1871fe,'rows':_0x3f9d11}:null;}})[_0x126d('0x35')](respondWithResult(_0x593846,null))[_0x126d('0x61')](handleError(_0x593846,null));};exports[_0x126d('0x100')]=function(_0x4e22bf,_0x2a2e75,_0x28ef90){return db[_0x126d('0x46')][_0x126d('0x41')]({'where':{'id':_0x4e22bf[_0x126d('0x63')]['id']}})[_0x126d('0x35')](handleEntityNotFound(_0x2a2e75,null))['then'](function(_0x2b4ba3){if(_0x2b4ba3){return _0x2b4ba3['addTeams'](_0x4e22bf['body'][_0x126d('0x69')],_['omit'](_0x4e22bf[_0x126d('0x65')],['ids','id'])||{});}})[_0x126d('0x35')](respondWithResult(_0x2a2e75,null))['catch'](handleError(_0x2a2e75,null));};exports['removeTeams']=function(_0x275a4a,_0x3580fd,_0x23ff6a){return db['User'][_0x126d('0x41')]({'where':{'id':_0x275a4a[_0x126d('0x63')]['id']}})[_0x126d('0x35')](handleEntityNotFound(_0x3580fd,null))[_0x126d('0x35')](function(_0x495359){if(_0x495359){return _0x495359['removeTeams'](_0x275a4a[_0x126d('0x4c')][_0x126d('0x69')]);}})[_0x126d('0x35')](respondWithStatusCode(_0x3580fd,null))[_0x126d('0x61')](handleError(_0x3580fd,null));};exports[_0x126d('0x101')]=function(_0x17a2ee,_0x5a0780,_0x20df1e){var _0x34fe8b={};var _0x2d2bce={};var _0x8df0ea;var _0x3053c6;return db[_0x126d('0x46')][_0x126d('0x97')]({'where':{'id':_0x17a2ee[_0x126d('0x63')]['id']}})[_0x126d('0x35')](handleEntityNotFound(_0x5a0780,null))['then'](function(_0x2ef306){if(_0x2ef306){_0x8df0ea=_0x2ef306;_0x2d2bce['model']=_['keys'](db[_0x126d('0x102')][_0x126d('0x47')]);_0x2d2bce['query']=_['keys'](_0x17a2ee[_0x126d('0x4c')]);_0x2d2bce[_0x126d('0x4d')]=_[_0x126d('0x4e')](_0x2d2bce[_0x126d('0x48')],_0x2d2bce[_0x126d('0x4c')]);_0x34fe8b[_0x126d('0x4f')]=_[_0x126d('0x4e')](_0x2d2bce[_0x126d('0x48')],qs['fields'](_0x17a2ee[_0x126d('0x4c')][_0x126d('0x50')]));_0x34fe8b[_0x126d('0x4f')]=_0x34fe8b[_0x126d('0x4f')][_0x126d('0x51')]?_0x34fe8b[_0x126d('0x4f')]:_0x2d2bce[_0x126d('0x48')];_0x34fe8b[_0x126d('0xc5')]=qs[_0x126d('0x53')](_0x17a2ee['query']['sort']);_0x34fe8b[_0x126d('0x54')]=qs['filters'](_[_0x126d('0xbc')](_0x17a2ee[_0x126d('0x4c')],_0x2d2bce[_0x126d('0x4d')]));if(_0x17a2ee[_0x126d('0x4c')]['filter']){_0x34fe8b[_0x126d('0x54')]=_['merge'](_0x34fe8b[_0x126d('0x54')],{'$or':_['map'](_0x34fe8b[_0x126d('0x4f')],function(_0x5ecb6a){var _0x418e77={};_0x418e77[_0x5ecb6a]={'$like':'%'+_0x17a2ee[_0x126d('0x4c')]['filter']+'%'};return _0x418e77;})});}_0x34fe8b=_[_0x126d('0x55')]({},_0x34fe8b,_0x17a2ee[_0x126d('0x5d')]);return _0x8df0ea[_0x126d('0x101')](_0x34fe8b);}})[_0x126d('0x35')](function(_0x57a07b){if(_0x57a07b){_0x3053c6=_0x57a07b[_0x126d('0x51')];if(!_0x17a2ee['query'][_0x126d('0x52')](_0x126d('0xc3'))){_0x34fe8b[_0x126d('0x2f')]=qs['limit'](_0x17a2ee[_0x126d('0x4c')][_0x126d('0x2f')]);_0x34fe8b['offset']=qs[_0x126d('0x2e')](_0x17a2ee[_0x126d('0x4c')][_0x126d('0x2e')]);}return _0x8df0ea[_0x126d('0x101')](_0x34fe8b);}})[_0x126d('0x35')](function(_0x3890ef){if(_0x3890ef){return _0x3890ef?{'count':_0x3053c6,'rows':_0x3890ef}:null;}})['then'](respondWithResult(_0x5a0780,null))[_0x126d('0x61')](handleError(_0x5a0780,null));};exports['getAgents']=function(_0x30e49a,_0xc89901,_0x1d6a4d){var _0x7bc66f={};var _0x2c160b={};var _0x25ffca;var _0x7e50e8;return db['User'][_0x126d('0x97')]({'where':{'id':_0x30e49a[_0x126d('0x63')]['id']}})['then'](handleEntityNotFound(_0xc89901,null))[_0x126d('0x35')](function(_0x385601){if(_0x385601){_0x25ffca=_0x385601;_0x2c160b['model']=_[_0x126d('0x49')](db[_0x126d('0x46')]['rawAttributes']);_0x2c160b[_0x126d('0x4c')]=_[_0x126d('0x49')](_0x30e49a[_0x126d('0x4c')]);_0x2c160b[_0x126d('0x4d')]=_[_0x126d('0x4e')](_0x2c160b[_0x126d('0x48')],_0x2c160b['query']);_0x7bc66f[_0x126d('0x4f')]=_[_0x126d('0x4e')](_0x2c160b[_0x126d('0x48')],qs[_0x126d('0x50')](_0x30e49a[_0x126d('0x4c')][_0x126d('0x50')]));_0x7bc66f[_0x126d('0x4f')]=_0x7bc66f[_0x126d('0x4f')][_0x126d('0x51')]?_0x7bc66f[_0x126d('0x4f')]:_0x2c160b[_0x126d('0x48')];_0x7bc66f[_0x126d('0xc5')]=qs[_0x126d('0x53')](_0x30e49a['query'][_0x126d('0x53')]);_0x7bc66f['where']=qs[_0x126d('0x4d')](_[_0x126d('0xbc')](_0x30e49a[_0x126d('0x4c')],_0x2c160b['filters']));if(_0x30e49a[_0x126d('0x4c')][_0x126d('0x3c')]){_0x7bc66f[_0x126d('0x54')]=_['merge'](_0x7bc66f[_0x126d('0x54')],{'$or':_['map'](_0x7bc66f[_0x126d('0x4f')],function(_0x19183f){var _0x5a8a77={};_0x5a8a77[_0x19183f]={'$like':'%'+_0x30e49a['query'][_0x126d('0x3c')]+'%'};return _0x5a8a77;})});}_0x7bc66f[_0x126d('0x48')]=db[_0x126d('0x46')];_0x7bc66f['as']=_0x126d('0x38');_0x7bc66f=_[_0x126d('0x55')]({},_0x7bc66f,_0x30e49a[_0x126d('0x5d')]);return _0x25ffca['getVoiceQueues']({'include':[_0x7bc66f]});}})['then'](function(_0x47ef9e){if(_0x47ef9e){var _0x5d2315={},_0x2496be=[],_0x455c7f=0x0;for(var _0xf83215=0x0;_0xf83215<_0x47ef9e[_0x126d('0x51')];_0xf83215+=0x1){for(var _0x40e719=0x0,_0x3eb8f6;_0x40e719<_0x47ef9e[_0xf83215][_0x126d('0x38')][_0x126d('0x51')];_0x40e719+=0x1){_0x3eb8f6=_0x47ef9e[_0xf83215][_0x126d('0x38')][_0x40e719][_0x126d('0x37')]({'plain':!![]});_0x5d2315[_0x3eb8f6['id']]=_0x3eb8f6;}}_0x5d2315=_[_0x126d('0x103')](_0x5d2315);for(var _0x4ec988=qs[_0x126d('0x2e')](_0x30e49a[_0x126d('0x4c')]['offset']);_0x4ec988<_0x5d2315['length']&&_0x2496be['length']=_0x13d0e4[_0x69f7('0x54')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x69f7('0x23')](function(){if(_0xd4300b){return db[_0x69f7('0x2c')]['destroy']({'where':{'membername':_0xd4300b[_0x69f7('0x38')]},'individualHooks':!![]});}})[_0x69f7('0x23')](function(){if(_0xd4300b){return _0xd4300b[_0x69f7('0x55')]({'raw':!![]});}})[_0x69f7('0x23')](function(_0x1d8122){if(_0xd4300b){if(_0x1d8122){var _0x4a98bd=[];_0x3c9bf3=_0x1d8122;if(_0x3c9bf3[_0x69f7('0x30')]){for(var _0x1d3064=0x0;_0x1d3064<_0x3c9bf3[_0x69f7('0x30')];_0x1d3064++){_0x4a98bd[_0x69f7('0x36')](db['UserVoiceQueueRt'][_0x69f7('0x56')]({'membername':_0xd4300b['name'],'UserId':_0xd4300b['id'],'queue_name':_0x3c9bf3[_0x1d3064][_0x69f7('0x38')],'VoiceQueueId':_0x3c9bf3[_0x1d3064]['id'],'interface':_0x49f3d9,'paused':_0xd4300b['loginInPause']||![],'penalty':_0x3c9bf3[_0x1d3064]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x69f7('0x4b')](_0x4a98bd);}}}})[_0x69f7('0x23')](function(){if(_0xd4300b){return db[_0x69f7('0x2e')][_0x69f7('0x1b')]({'where':{'membername':_0xd4300b['name'],'exitAt':null}});}})[_0x69f7('0x23')](function(_0x4343c4){if(_0xd4300b){if(_0x4343c4&&_0x4343c4['length']){var _0x12b0e3=[];_0x4343c4[_0x69f7('0x35')](function(_0x3a130f){_0x12b0e3[_0x69f7('0x36')](_0x3a130f['update']({'exitAt':moment()[_0x69f7('0x31')](_0x69f7('0x32'))}));});return BPromise['all'](_0x12b0e3);}}})[_0x69f7('0x23')](function(_0x1acd93){if(_0xd4300b){var _0x1043e4=[];var _0x5c77c3=[];var _0x577d79=utils[_0x69f7('0x34')]();var _0x381813={'membername':_0xd4300b['name'],'interface':_0x49f3d9,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xd4300b[_0x69f7('0x29')],'internal':_0xd4300b[_0x69f7('0x2a')]};_0x577d79[_0x69f7('0x35')](function(_0xc8e43a){_0x1043e4['push'](_[_0x69f7('0x57')]({'channel':_0xc8e43a,'type':'LOGIN','data1':_0x69f7('0x58'),'data2':_0x49f3d9},_0x381813));if(_0xd4300b[_0x69f7('0x51')]){_0x5c77c3[_0x69f7('0x36')](_[_0x69f7('0x57')]({'channel':_0xc8e43a,'type':_0x69f7('0x2f'),'data1':_0x69f7('0x59')},_0x381813));}});return db[_0x69f7('0x2e')][_0x69f7('0x3d')](_0x1043e4[_0x69f7('0x5a')](_0x5c77c3),{'individualHooks':!![]});}})['then'](function(){if(_0xd4300b){return _0xd4300b['update']({'online':!![],'lastLoginAt':moment()[_0x69f7('0x31')](_0x69f7('0x32')),'voicePause':_0xd4300b['loginInPause']||![],'mailPause':_0xd4300b['loginInPause']||![],'chatPause':_0xd4300b[_0x69f7('0x51')]||![],'faxPause':_0xd4300b[_0x69f7('0x51')]||![],'smsPause':_0xd4300b[_0x69f7('0x51')]||![],'openchannelPause':_0xd4300b[_0x69f7('0x51')]||![],'pauseType':_0xd4300b[_0x69f7('0x51')]?_0x69f7('0x59'):null,'lastPauseAt':moment()['format'](_0x69f7('0x32')),'interface':_0x49f3d9});}})[_0x69f7('0x23')](function(_0x2601d7){_0x70f705(_0x2601d7);})['catch'](function(_0x4e5e04){_0x56ab73(_0x42770a['error'](0x1f4,_0x4e5e04[_0x69f7('0x17')]));});});}; \ No newline at end of file +var _0xb257=['LOGININPAUSE','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','then','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetUser','User','options','where','attributes','limit','include','map','model','debug','ShowUser','find','stringify','PauseUser','name','role','internal','interface','update','MemberReport','findAll','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','forEach','push','isNil','SIP/%s','body','DEFAULT\x20PAUSE','bulkCreate','type','channel','isValidChannel','Unknown\x20channel','voice','UserVoiceQueueRt','system','chat','fax','openchannel','set','%s%s','LogoutUser','findOne','destroy','all','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','getVoiceQueues','UserVoiceQueue.penalty','getChannels','LOGIN','callysquare','merge'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb257,0xb5));var _0x7b25=function(_0x4177f9,_0x486f7c){_0x4177f9=_0x4177f9-0x0;var _0x173f76=_0xb257[_0x4177f9];return _0x173f76;};'use strict';var _=require(_0x7b25('0x0'));var util=require(_0x7b25('0x1'));var moment=require(_0x7b25('0x2'));var BPromise=require(_0x7b25('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b25('0x4'));var db=require(_0x7b25('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7b25('0x6'));var config=require(_0x7b25('0x7'));var jayson=require(_0x7b25('0x8'));var client=jayson[_0x7b25('0x9')]['http']({'port':0x232a});config[_0x7b25('0xa')]=_[_0x7b25('0xb')](config['redis'],{'host':_0x7b25('0xc'),'port':0x18eb});var socket=require(_0x7b25('0xd'))(new Redis(config[_0x7b25('0xa')]));require(_0x7b25('0xe'))[_0x7b25('0xf')](socket);function respondWithRpcPromise(_0x25bb66,_0x19fee9,_0x4da230){return new BPromise(function(_0x1df4a0,_0x3e1d44){return client[_0x7b25('0x10')](_0x25bb66,_0x4da230)[_0x7b25('0x11')](function(_0x179a43){logger['info'](_0x7b25('0x12'),_0x19fee9,_0x7b25('0x13'));logger['debug'](_0x7b25('0x14'),_0x19fee9,_0x7b25('0x13'),JSON['stringify'](_0x179a43));if(_0x179a43[_0x7b25('0x15')]){if(_0x179a43['error']['code']===0x1f4){logger[_0x7b25('0x15')](_0x7b25('0x12'),_0x19fee9,_0x179a43[_0x7b25('0x15')][_0x7b25('0x16')]);return _0x3e1d44(_0x179a43[_0x7b25('0x15')][_0x7b25('0x16')]);}logger[_0x7b25('0x15')]('User,\x20%s,\x20%s',_0x19fee9,_0x179a43['error'][_0x7b25('0x16')]);return _0x1df4a0(_0x179a43['error'][_0x7b25('0x16')]);}else{logger[_0x7b25('0x17')]('User,\x20%s,\x20%s',_0x19fee9,_0x7b25('0x13'));_0x1df4a0(_0x179a43[_0x7b25('0x18')]['message']);}})[_0x7b25('0x19')](function(_0x2fd2ae){logger['error']('User,\x20%s,\x20%s',_0x19fee9,_0x2fd2ae);_0x3e1d44(_0x2fd2ae);});});}exports[_0x7b25('0x1a')]=function(_0x3277ed){var _0x3c6051=this;return new Promise(function(_0x575250,_0x59805c){return db[_0x7b25('0x1b')]['findAll']({'raw':_0x3277ed[_0x7b25('0x1c')]?_0x3277ed['options']['raw']===undefined?!![]:![]:!![],'where':_0x3277ed['options']?_0x3277ed[_0x7b25('0x1c')][_0x7b25('0x1d')]||null:null,'attributes':_0x3277ed[_0x7b25('0x1c')]?_0x3277ed[_0x7b25('0x1c')][_0x7b25('0x1e')]||null:null,'limit':_0x3277ed['options']?_0x3277ed[_0x7b25('0x1c')][_0x7b25('0x1f')]||null:null,'include':_0x3277ed[_0x7b25('0x1c')]?_0x3277ed[_0x7b25('0x1c')][_0x7b25('0x20')]?_[_0x7b25('0x21')](_0x3277ed[_0x7b25('0x1c')]['include'],function(_0x336ed6){return{'model':db[_0x336ed6[_0x7b25('0x22')]],'as':_0x336ed6['as'],'attributes':_0x336ed6[_0x7b25('0x1e')],'include':_0x336ed6['include']?_[_0x7b25('0x21')](_0x336ed6[_0x7b25('0x20')],function(_0x32abcc){return{'model':db[_0x32abcc[_0x7b25('0x22')]],'as':_0x32abcc['as'],'attributes':_0x32abcc[_0x7b25('0x1e')],'include':_0x32abcc['include']?_['map'](_0x32abcc[_0x7b25('0x20')],function(_0x5f2fcc){return{'model':db[_0x5f2fcc['model']],'as':_0x5f2fcc['as'],'attributes':_0x5f2fcc[_0x7b25('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b4682){logger[_0x7b25('0x17')](_0x7b25('0x1a'),_0x3277ed);logger[_0x7b25('0x23')]('GetUser',_0x3277ed,JSON['stringify'](_0x2b4682));_0x575250(_0x2b4682);})[_0x7b25('0x19')](function(_0x49d837){logger['error'](_0x7b25('0x1a'),_0x49d837[_0x7b25('0x16')],_0x3277ed);_0x59805c(_0x3c6051[_0x7b25('0x15')](0x1f4,_0x49d837[_0x7b25('0x16')]));});});};exports[_0x7b25('0x24')]=function(_0x5cec6f){var _0x494862=this;return new Promise(function(_0x29cb89,_0x4f2064){return db[_0x7b25('0x1b')][_0x7b25('0x25')]({'raw':_0x5cec6f['options']?_0x5cec6f[_0x7b25('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5cec6f[_0x7b25('0x1c')]?_0x5cec6f[_0x7b25('0x1c')][_0x7b25('0x1d')]||null:null,'attributes':_0x5cec6f[_0x7b25('0x1c')]?_0x5cec6f[_0x7b25('0x1c')][_0x7b25('0x1e')]||null:null,'include':_0x5cec6f[_0x7b25('0x1c')]?_0x5cec6f['options'][_0x7b25('0x20')]?_['map'](_0x5cec6f['options'][_0x7b25('0x20')],function(_0x2f0cc2){return{'model':db[_0x2f0cc2[_0x7b25('0x22')]],'as':_0x2f0cc2['as'],'attributes':_0x2f0cc2[_0x7b25('0x1e')],'include':_0x2f0cc2[_0x7b25('0x20')]?_[_0x7b25('0x21')](_0x2f0cc2[_0x7b25('0x20')],function(_0x105a15){return{'model':db[_0x105a15[_0x7b25('0x22')]],'as':_0x105a15['as'],'attributes':_0x105a15[_0x7b25('0x1e')],'include':_0x105a15['include']?_[_0x7b25('0x21')](_0x105a15['include'],function(_0x267644){return{'model':db[_0x267644[_0x7b25('0x22')]],'as':_0x267644['as'],'attributes':_0x267644[_0x7b25('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7b25('0x11')](function(_0x4e2050){logger['info'](_0x7b25('0x24'),_0x5cec6f);logger[_0x7b25('0x23')](_0x7b25('0x24'),_0x5cec6f,JSON[_0x7b25('0x26')](_0x4e2050));_0x29cb89(_0x4e2050);})['catch'](function(_0x23c1b4){logger[_0x7b25('0x15')]('ShowUser',_0x23c1b4[_0x7b25('0x16')],_0x5cec6f);_0x4f2064(_0x494862[_0x7b25('0x15')](0x1f4,_0x23c1b4[_0x7b25('0x16')]));});});};exports[_0x7b25('0x27')]=function(_0x4ab091){var _0x387c0d=this;return new Promise(function(_0x912d4,_0x1ba364){var _0x3098a1;return db[_0x7b25('0x1b')][_0x7b25('0x25')]({'where':_0x4ab091[_0x7b25('0x1c')]['where']||{},'attributes':['id',_0x7b25('0x28'),_0x7b25('0x29'),_0x7b25('0x2a'),_0x7b25('0x2b')]})[_0x7b25('0x11')](function(_0x68e68f){if(_0x68e68f){_0x3098a1=_0x68e68f;return db['UserVoiceQueueRt'][_0x7b25('0x2c')]({'paused':0x1},{'where':{'UserId':_0x3098a1['id']},'individualHooks':!![]});}})['then'](function(){if(_0x3098a1){return db[_0x7b25('0x2d')][_0x7b25('0x2e')]({'where':{'membername':_0x3098a1[_0x7b25('0x28')],'type':_0x7b25('0x2f'),'exitAt':null}});}})[_0x7b25('0x11')](function(_0x1e89ab){if(_0x3098a1){if(_0x1e89ab&&_0x1e89ab[_0x7b25('0x30')]){var _0x5d5725=moment()[_0x7b25('0x31')](_0x7b25('0x32'));for(var _0x452eff=0x0,_0x494284=_0x1e89ab['length'];_0x452eff<_0x494284;_0x452eff++){_0x1e89ab[_0x452eff][_0x7b25('0x33')]({'exitAt':_0x5d5725});}}}})[_0x7b25('0x11')](function(){if(_0x3098a1){var _0xaef670=[];var _0x16133b=utils['getChannels']();_0x16133b[_0x7b25('0x34')](function(_0x379e7c){_0xaef670[_0x7b25('0x35')]({'channel':_0x379e7c,'membername':_0x3098a1[_0x7b25('0x28')],'interface':_[_0x7b25('0x36')](_0x3098a1['interface'])?util[_0x7b25('0x31')](_0x7b25('0x37'),_0x3098a1['name']):_0x3098a1[_0x7b25('0x2b')],'type':_0x7b25('0x2f'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x4ab091[_0x7b25('0x38')]['type']||_0x7b25('0x39'),'role':_0x3098a1[_0x7b25('0x29')],'internal':_0x3098a1[_0x7b25('0x2a')],'uniqueid':_0x4ab091[_0x7b25('0x38')]['uniqueid']||null});});return db[_0x7b25('0x2d')][_0x7b25('0x3a')](_0xaef670,{'individualHooks':!![]});}})[_0x7b25('0x11')](function(){if(_0x3098a1){return _0x3098a1[_0x7b25('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x4ab091['body'][_0x7b25('0x3b')]||_0x7b25('0x39'),'lastPauseAt':moment()[_0x7b25('0x31')](_0x7b25('0x32'))});}})[_0x7b25('0x11')](function(_0x1a2eaf){_0x912d4(_0x1a2eaf);})['catch'](function(_0x17f34d){_0x1ba364(_0x387c0d[_0x7b25('0x15')](0x1f4,_0x17f34d[_0x7b25('0x16')]));});});};exports['UnpauseUser']=function(_0x280916){var _0x1329a5=this;return new Promise(function(_0x3bc50f,_0x133794){var _0x314379;return db[_0x7b25('0x1b')]['findOne']({'where':_0x280916[_0x7b25('0x1c')][_0x7b25('0x1d')]||{},'attributes':['id',_0x7b25('0x28')]})[_0x7b25('0x11')](function(_0x5a5d60){if(_0x5a5d60){_0x314379=_0x5a5d60;if(_0x280916['body'][_0x7b25('0x3c')]&&!utils[_0x7b25('0x3d')](_0x280916[_0x7b25('0x38')][_0x7b25('0x3c')])){throw new Error(_0x7b25('0x3e'));}switch(_0x280916[_0x7b25('0x38')][_0x7b25('0x3c')]){case _0x7b25('0x3f'):return db[_0x7b25('0x40')]['update']({'paused':0x0},{'where':{'UserId':_0x314379['id']}})[_0x7b25('0x11')](function(){return db[_0x7b25('0x2d')][_0x7b25('0x25')]({'where':{'channel':_0x280916[_0x7b25('0x38')][_0x7b25('0x3c')],'membername':_0x314379[_0x7b25('0x28')],'type':_0x7b25('0x2f'),'exitAt':null}});})[_0x7b25('0x11')](function(_0x44b8c5){if(_0x44b8c5){return _0x44b8c5[_0x7b25('0x2c')]({'exitAt':moment()['format'](_0x7b25('0x32')),'data2':_0x7b25('0x41')},{'individualHooks':!![]});}return null;})[_0x7b25('0x11')](function(){return _0x314379[_0x7b25('0x2c')]({'voicePause':![]});});case'mail':case _0x7b25('0x42'):case _0x7b25('0x43'):case'sms':case _0x7b25('0x44'):return db['MemberReport'][_0x7b25('0x25')]({'where':{'channel':_0x280916[_0x7b25('0x38')]['channel'],'membername':_0x314379['name'],'type':_0x7b25('0x2f'),'exitAt':null}})[_0x7b25('0x11')](function(_0x357bdf){return _0x357bdf[_0x7b25('0x2c')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x7b25('0x41')},{'individualHooks':!![]});})[_0x7b25('0x11')](function(){var _0x6670bd={};_[_0x7b25('0x45')](_0x6670bd,util[_0x7b25('0x31')](_0x7b25('0x46'),_0x280916['body']['channel'],'Pause'),![]);return _0x314379[_0x7b25('0x2c')](_0x6670bd);});default:return db[_0x7b25('0x40')][_0x7b25('0x2c')]({'paused':0x0},{'where':{'UserId':_0x314379['id']}})[_0x7b25('0x11')](function(){return db[_0x7b25('0x2d')][_0x7b25('0x2e')]({'where':{'membername':_0x314379['name'],'type':_0x7b25('0x2f'),'exitAt':null}});})[_0x7b25('0x11')](function(_0x53fc32){var _0x359dc9=[];_0x53fc32[_0x7b25('0x34')](function(_0x2f5529){_0x359dc9['push'](_0x2f5529['update']({'exitAt':moment()[_0x7b25('0x31')](_0x7b25('0x32')),'data2':'system'}));});return BPromise['all'](_0x359dc9);})[_0x7b25('0x11')](function(){return _0x314379[_0x7b25('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](function(_0x215f05){_0x3bc50f(_0x215f05);})['catch'](function(_0x2cbe6c){_0x133794(_0x1329a5[_0x7b25('0x15')](0x1f4,_0x2cbe6c[_0x7b25('0x16')]));});});};exports[_0x7b25('0x47')]=function(_0x26050b){var _0x2944cd=this;return new Promise(function(_0x36cebc,_0xf4435b){var _0x1080d5;return db['User'][_0x7b25('0x48')]({'where':_0x26050b[_0x7b25('0x1c')][_0x7b25('0x1d')]||{},'attributes':['id','name']})[_0x7b25('0x11')](function(_0x129de4){if(_0x129de4){_0x1080d5=_0x129de4;return db[_0x7b25('0x40')][_0x7b25('0x49')]({'where':{'membername':_0x1080d5['name']},'individualHooks':!![]});}})['then'](function(){if(_0x1080d5){return db['MemberReport'][_0x7b25('0x2e')]({'where':{'membername':_0x1080d5['name'],'exitAt':null}});}})['then'](function(_0x89de4c){if(_0x1080d5){if(_0x89de4c&&_0x89de4c[_0x7b25('0x30')]){var _0x357a2b=[];_0x89de4c['forEach'](function(_0x257c6e){_0x357a2b['push'](_0x257c6e[_0x7b25('0x2c')]({'exitAt':moment()['format'](_0x7b25('0x32'))}));});return BPromise[_0x7b25('0x4a')](_0x357a2b);}}})[_0x7b25('0x11')](function(){if(_0x1080d5){return _0x1080d5[_0x7b25('0x2c')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x14ddf1){_0x36cebc(_0x14ddf1);})[_0x7b25('0x19')](function(_0x4f2069){_0xf4435b(_0x2944cd[_0x7b25('0x15')](0x1f4,_0x4f2069[_0x7b25('0x16')]));});});};exports['LoginUser']=function(_0x1a3020){var _0x5ebdce=this;return new Promise(function(_0x2b6dbf,_0x396261){var _0x4e481f;var _0x12ff4c;var _0x41d5ac;var _0x234c4d;return db[_0x7b25('0x1b')]['findOne']({'where':_0x1a3020[_0x7b25('0x1c')]['where']||{},'attributes':['id','name','role',_0x7b25('0x4b'),_0x7b25('0x4c'),_0x7b25('0x2a'),_0x7b25('0x4d'),_0x7b25('0x2b')]})[_0x7b25('0x11')](function(_0x4788d3){if(_0x4788d3){_0x4e481f=_0x4788d3;_0x234c4d=_0x1a3020['body'][_0x7b25('0x2b')]?_0x1a3020[_0x7b25('0x38')][_0x7b25('0x2b')]:util[_0x7b25('0x31')]('SIP/%s',_0x4e481f['name']);return db[_0x7b25('0x1b')][_0x7b25('0x4e')]({'where':{'role':_0x7b25('0x4f'),'online':!![],'id':{'$ne':_0x4e481f['id']}}});}})['then'](function(_0x1b45bc){if(_0x1b45bc){_0x41d5ac=_0x1b45bc;return require(_0x7b25('0x50'))[_0x7b25('0x51')]();}})[_0x7b25('0x11')](function(_0x2545f8){if(_0x2545f8&&_0x2545f8[_0x7b25('0x52')]&&_0x41d5ac>=_0x2545f8[_0x7b25('0x52')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x7b25('0x11')](function(){if(_0x4e481f){return db[_0x7b25('0x40')][_0x7b25('0x49')]({'where':{'membername':_0x4e481f[_0x7b25('0x28')]},'individualHooks':!![]});}})['then'](function(){if(_0x4e481f){return _0x4e481f[_0x7b25('0x53')]({'raw':!![]});}})[_0x7b25('0x11')](function(_0x767e0d){if(_0x4e481f){if(_0x767e0d){var _0x4e1379=[];_0x12ff4c=_0x767e0d;if(_0x12ff4c[_0x7b25('0x30')]){for(var _0x28fd8f=0x0;_0x28fd8f<_0x12ff4c['length'];_0x28fd8f++){_0x4e1379[_0x7b25('0x35')](db[_0x7b25('0x40')]['upsert']({'membername':_0x4e481f[_0x7b25('0x28')],'UserId':_0x4e481f['id'],'queue_name':_0x12ff4c[_0x28fd8f][_0x7b25('0x28')],'VoiceQueueId':_0x12ff4c[_0x28fd8f]['id'],'interface':_0x234c4d,'paused':_0x4e481f['loginInPause']||![],'penalty':_0x12ff4c[_0x28fd8f][_0x7b25('0x54')]||0x0}));}return BPromise[_0x7b25('0x4a')](_0x4e1379);}}}})[_0x7b25('0x11')](function(){if(_0x4e481f){return db[_0x7b25('0x2d')][_0x7b25('0x2e')]({'where':{'membername':_0x4e481f[_0x7b25('0x28')],'exitAt':null}});}})[_0x7b25('0x11')](function(_0x5b06a0){if(_0x4e481f){if(_0x5b06a0&&_0x5b06a0[_0x7b25('0x30')]){var _0x39833f=[];_0x5b06a0['forEach'](function(_0x23ccdf){_0x39833f[_0x7b25('0x35')](_0x23ccdf[_0x7b25('0x2c')]({'exitAt':moment()[_0x7b25('0x31')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x7b25('0x4a')](_0x39833f);}}})[_0x7b25('0x11')](function(_0x3a6301){if(_0x4e481f){var _0x40563d=[];var _0x22e535=[];var _0x4b5e42=utils[_0x7b25('0x55')]();var _0x2c0c52={'membername':_0x4e481f[_0x7b25('0x28')],'interface':_0x234c4d,'enterAt':moment()[_0x7b25('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x4e481f[_0x7b25('0x29')],'internal':_0x4e481f[_0x7b25('0x2a')]};_0x4b5e42[_0x7b25('0x34')](function(_0x29ed22){_0x40563d[_0x7b25('0x35')](_['merge']({'channel':_0x29ed22,'type':_0x7b25('0x56'),'data1':_0x7b25('0x57'),'data2':_0x234c4d},_0x2c0c52));if(_0x4e481f[_0x7b25('0x4d')]){_0x22e535[_0x7b25('0x35')](_[_0x7b25('0x58')]({'channel':_0x29ed22,'type':_0x7b25('0x2f'),'data1':'LOGININPAUSE'},_0x2c0c52));}});return db[_0x7b25('0x2d')]['bulkCreate'](_0x40563d['concat'](_0x22e535),{'individualHooks':!![]});}})['then'](function(){if(_0x4e481f){return _0x4e481f[_0x7b25('0x2c')]({'online':!![],'lastLoginAt':moment()[_0x7b25('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4e481f[_0x7b25('0x4d')]||![],'mailPause':_0x4e481f[_0x7b25('0x4d')]||![],'chatPause':_0x4e481f[_0x7b25('0x4d')]||![],'faxPause':_0x4e481f[_0x7b25('0x4d')]||![],'smsPause':_0x4e481f[_0x7b25('0x4d')]||![],'openchannelPause':_0x4e481f[_0x7b25('0x4d')]||![],'pauseType':_0x4e481f[_0x7b25('0x4d')]?_0x7b25('0x59'):null,'lastPauseAt':moment()[_0x7b25('0x31')](_0x7b25('0x32')),'interface':_0x234c4d});}})[_0x7b25('0x11')](function(_0x2d1074){_0x2b6dbf(_0x2d1074);})[_0x7b25('0x19')](function(_0x4c98d0){_0x396261(_0x5ebdce[_0x7b25('0x15')](0x1f4,_0x4c98d0['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 48f49b2..7b1aefa 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 _0x14bc=['user:','./user.events','remove','update','emit','removeListener'];(function(_0x1ffa98,_0x4f4c56){var _0x1d4ac8=function(_0x4efa44){while(--_0x4efa44){_0x1ffa98['push'](_0x1ffa98['shift']());}};_0x1d4ac8(++_0x4f4c56);}(_0x14bc,0x67));var _0xc14b=function(_0x3d20a7,_0x201a13){_0x3d20a7=_0x3d20a7-0x0;var _0x174e3c=_0x14bc[_0x3d20a7];return _0x174e3c;};'use strict';var UserEvents=require(_0xc14b('0x0'));var events=['save',_0xc14b('0x1'),_0xc14b('0x2')];function createListener(_0x5b62bd,_0x2f8b78){return function(_0x27329d){_0x2f8b78[_0xc14b('0x3')](_0x5b62bd,_0x27329d);};}function removeListener(_0x466b39,_0x2300a4){return function(){UserEvents[_0xc14b('0x4')](_0x466b39,_0x2300a4);};}exports['register']=function(_0xeceaa7){for(var _0x312c68=0x0,_0x58db28=events['length'];_0x312c68<_0x58db28;_0x312c68++){var _0x527055=events[_0x312c68];var _0x2aef35=createListener(_0xc14b('0x5')+_0x527055,_0xeceaa7);UserEvents['on'](_0x527055,_0x2aef35);}}; \ No newline at end of file +var _0x2a19=['./user.events','save','remove','update','emit','length'];(function(_0x2897d8,_0x271da9){var _0x16ffde=function(_0x1c4f80){while(--_0x1c4f80){_0x2897d8['push'](_0x2897d8['shift']());}};_0x16ffde(++_0x271da9);}(_0x2a19,0x198));var _0x92a1=function(_0x291123,_0x555778){_0x291123=_0x291123-0x0;var _0x17ecc3=_0x2a19[_0x291123];return _0x17ecc3;};'use strict';var UserEvents=require(_0x92a1('0x0'));var events=[_0x92a1('0x1'),_0x92a1('0x2'),_0x92a1('0x3')];function createListener(_0x1ced96,_0x2dcd35){return function(_0x45133d){_0x2dcd35[_0x92a1('0x4')](_0x1ced96,_0x45133d);};}function removeListener(_0x36ac5e,_0x1576e5){return function(){UserEvents['removeListener'](_0x36ac5e,_0x1576e5);};}exports['register']=function(_0x703b4d){for(var _0x1b2023=0x0,_0x3057b7=events[_0x92a1('0x5')];_0x1b2023<_0x3057b7;_0x1b2023++){var _0x49b943=events[_0x1b2023];var _0x4e752b=createListener('user:'+_0x49b943,_0x703b4d);UserEvents['on'](_0x49b943,_0x4e752b);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 1138746..2794b0b 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 _0x18a0=['path','connect-timeout','express','Router','../../components/auth/service','multer','util'];(function(_0x39fa19,_0x2ea8c9){var _0x3ba00e=function(_0x35f090){while(--_0x35f090){_0x39fa19['push'](_0x39fa19['shift']());}};_0x3ba00e(++_0x2ea8c9);}(_0x18a0,0xa6));var _0x018a=function(_0x12aaee,_0x5bf50c){_0x12aaee=_0x12aaee-0x0;var _0x37c350=_0x18a0[_0x12aaee];return _0x37c350;};'use strict';var multer=require(_0x018a('0x0'));var util=require(_0x018a('0x1'));var path=require(_0x018a('0x2'));var timeout=require(_0x018a('0x3'));var express=require(_0x018a('0x4'));var router=express[_0x018a('0x5')]();var auth=require(_0x018a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module['exports']=router; \ No newline at end of file +var _0xa020=['../../config/environment','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x46e9f2,_0xb8c5f9){var _0x2ff437=function(_0x231e71){while(--_0x231e71){_0x46e9f2['push'](_0x46e9f2['shift']());}};_0x2ff437(++_0xb8c5f9);}(_0xa020,0x1eb));var _0x0a02=function(_0xda5706,_0x1362c8){_0xda5706=_0xda5706-0x0;var _0x395a12=_0xa020[_0xda5706];return _0x395a12;};'use strict';var multer=require(_0x0a02('0x0'));var util=require(_0x0a02('0x1'));var path=require(_0x0a02('0x2'));var timeout=require(_0x0a02('0x3'));var express=require('express');var router=express[_0x0a02('0x4')]();var auth=require(_0x0a02('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0a02('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 8edbe97..38416d4 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 _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x2159c3,_0x12991d){var _0x52b385=function(_0x546bc0){while(--_0x546bc0){_0x2159c3['push'](_0x2159c3['shift']());}};_0x52b385(++_0x12991d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x28e321,_0x20b926){var _0x3089cf=function(_0x25afc9){while(--_0x25afc9){_0x28e321['push'](_0x28e321['shift']());}};_0x3089cf(++_0x20b926);}(_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/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index e0bd427..35659f5 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 _0x4e2e=['exports','define','UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x354f94,_0x3681c0){_0x354f94=_0x354f94-0x0;var _0x4360f4=_0x4e2e[_0x354f94];return _0x4360f4;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var logger=require(_0xe4e2('0x1'))(_0xe4e2('0x2'));var moment=require(_0xe4e2('0x3'));var BPromise=require(_0xe4e2('0x4'));var rp=require(_0xe4e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe4e2('0x6'));var config=require(_0xe4e2('0x7'));var attributes=require(_0xe4e2('0x8'));module[_0xe4e2('0x9')]=function(_0x48e83d,_0x322295){return _0x48e83d[_0xe4e2('0xa')](_0xe4e2('0xb'),attributes,{'tableName':_0xe4e2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1a5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','user_has_chat_queues','lodash'];(function(_0x543242,_0xeac9fd){var _0x4c99b6=function(_0x47d087){while(--_0x47d087){_0x543242['push'](_0x543242['shift']());}};_0x4c99b6(++_0xeac9fd);}(_0xb1a5,0x1cd));var _0x5b1a=function(_0x2cef95,_0x3a8858){_0x2cef95=_0x2cef95-0x0;var _0x32eb8b=_0xb1a5[_0x2cef95];return _0x32eb8b;};'use strict';var _=require(_0x5b1a('0x0'));var util=require('util');var logger=require(_0x5b1a('0x1'))(_0x5b1a('0x2'));var moment=require(_0x5b1a('0x3'));var BPromise=require(_0x5b1a('0x4'));var rp=require(_0x5b1a('0x5'));var fs=require('fs');var path=require(_0x5b1a('0x6'));var rimraf=require(_0x5b1a('0x7'));var config=require('../../config/environment');var attributes=require('./userChatQueue.attributes');module[_0x5b1a('0x8')]=function(_0x3e5529,_0x2e27ad){return _0x3e5529[_0x5b1a('0x9')]('UserChatQueue',attributes,{'tableName':_0x5b1a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index b3e46de..89fff26 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 _0x235d=['message','UserChatQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','info','debug','request\x20sent','stringify','error','code'];(function(_0x21585f,_0x4f59f9){var _0x2cebf3=function(_0xd7fccb){while(--_0xd7fccb){_0x21585f['push'](_0x21585f['shift']());}};_0x2cebf3(++_0x4f59f9);}(_0x235d,0x194));var _0xd235=function(_0x3f49ae,_0x3373e){_0x3f49ae=_0x3f49ae-0x0;var _0x5a901e=_0x235d[_0x3f49ae];return _0x5a901e;};'use strict';var _=require(_0xd235('0x0'));var util=require(_0xd235('0x1'));var moment=require(_0xd235('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd235('0x3'));var db=require(_0xd235('0x4'))['db'];var utils=require(_0xd235('0x5'));var logger=require('../../config/logger')(_0xd235('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd235('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x218bf7,_0x23428f,_0x47201b){return new BPromise(function(_0x22ba0e,_0x10e719){return client[_0xd235('0x8')](_0x218bf7,_0x47201b)[_0xd235('0x9')](function(_0x51152e){logger[_0xd235('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x23428f,'request\x20sent');logger[_0xd235('0xb')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x23428f,_0xd235('0xc'),JSON[_0xd235('0xd')](_0x51152e));if(_0x51152e[_0xd235('0xe')]){if(_0x51152e[_0xd235('0xe')][_0xd235('0xf')]===0x1f4){logger[_0xd235('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x23428f,_0x51152e[_0xd235('0xe')]['message']);return _0x10e719(_0x51152e[_0xd235('0xe')][_0xd235('0x10')]);}logger[_0xd235('0xe')](_0xd235('0x11'),_0x23428f,_0x51152e[_0xd235('0xe')][_0xd235('0x10')]);return _0x22ba0e(_0x51152e[_0xd235('0xe')]['message']);}else{logger[_0xd235('0xa')](_0xd235('0x11'),_0x23428f,_0xd235('0xc'));_0x22ba0e(_0x51152e[_0xd235('0x12')]['message']);}})[_0xd235('0x13')](function(_0x2a316c){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x23428f,_0x2a316c);_0x10e719(_0x2a316c);});});} \ No newline at end of file +var _0xf935=['error','message','UserChatQueue,\x20%s,\x20%s','info','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf935,0xec));var _0x5f93=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf935[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x5f93('0x0'));var moment=require(_0x5f93('0x1'));var BPromise=require(_0x5f93('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f93('0x3'));var db=require(_0x5f93('0x4'))['db'];var utils=require(_0x5f93('0x5'));var logger=require(_0x5f93('0x6'))(_0x5f93('0x7'));var config=require(_0x5f93('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5f93('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x492116,_0x409097,_0x3a8a0e){return new BPromise(function(_0x5a69be,_0x164f77){return client[_0x5f93('0xa')](_0x492116,_0x3a8a0e)[_0x5f93('0xb')](function(_0x1a292c){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x409097,_0x5f93('0xc'));logger[_0x5f93('0xd')](_0x5f93('0xe'),_0x409097,'request\x20sent',JSON[_0x5f93('0xf')](_0x1a292c));if(_0x1a292c[_0x5f93('0x10')]){if(_0x1a292c[_0x5f93('0x10')]['code']===0x1f4){logger[_0x5f93('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x409097,_0x1a292c[_0x5f93('0x10')][_0x5f93('0x11')]);return _0x164f77(_0x1a292c[_0x5f93('0x10')][_0x5f93('0x11')]);}logger[_0x5f93('0x10')](_0x5f93('0x12'),_0x409097,_0x1a292c['error'][_0x5f93('0x11')]);return _0x5a69be(_0x1a292c[_0x5f93('0x10')][_0x5f93('0x11')]);}else{logger[_0x5f93('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x409097,_0x5f93('0xc'));_0x5a69be(_0x1a292c['result'][_0x5f93('0x11')]);}})[_0x5f93('0x14')](function(_0x196c0c){logger['error'](_0x5f93('0x12'),_0x409097,_0x196c0c);_0x164f77(_0x196c0c);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 892d209..cbd26f3 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 _0x789c=['exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x3a546e,_0x369fd5){var _0x7fc54f=function(_0x5282cc){while(--_0x5282cc){_0x3a546e['push'](_0x3a546e['shift']());}};_0x7fc54f(++_0x369fd5);}(_0x789c,0xd1));var _0xc789=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x789c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc789('0x0'));var util=require(_0xc789('0x1'));var path=require(_0xc789('0x2'));var timeout=require('connect-timeout');var express=require(_0xc789('0x3'));var router=express[_0xc789('0x4')]();var auth=require(_0xc789('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc789('0x6'));module[_0xc789('0x7')]=router; \ No newline at end of file +var _0x1426=['../../components/auth/service','../../config/environment','exports','multer','util','path','express','Router'];(function(_0x2537fd,_0x58465a){var _0x25891e=function(_0x3fdcc8){while(--_0x3fdcc8){_0x2537fd['push'](_0x2537fd['shift']());}};_0x25891e(++_0x58465a);}(_0x1426,0x12b));var _0x6142=function(_0x4d835d,_0x142054){_0x4d835d=_0x4d835d-0x0;var _0x818e2e=_0x1426[_0x4d835d];return _0x818e2e;};'use strict';var multer=require(_0x6142('0x0'));var util=require(_0x6142('0x1'));var path=require(_0x6142('0x2'));var timeout=require('connect-timeout');var express=require(_0x6142('0x3'));var router=express[_0x6142('0x4')]();var auth=require(_0x6142('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6142('0x6'));module[_0x6142('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 c730049..5f75d5a 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 _0xe511=['INTEGER','sequelize','exports'];(function(_0x5a585b,_0x3e0674){var _0x4cd398=function(_0x32fbb5){while(--_0x32fbb5){_0x5a585b['push'](_0x5a585b['shift']());}};_0x4cd398(++_0x3e0674);}(_0xe511,0x16f));var _0x1e51=function(_0x546ac5,_0x59e59b){_0x546ac5=_0x546ac5-0x0;var _0x56a6d8=_0xe511[_0x546ac5];return _0x56a6d8;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1e51('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8f4c=['exports','INTEGER','STRING','sequelize'];(function(_0x1dbdf8,_0x5ddb28){var _0x2b331f=function(_0x2b6dc3){while(--_0x2b6dc3){_0x1dbdf8['push'](_0x1dbdf8['shift']());}};_0x2b331f(++_0x5ddb28);}(_0x8f4c,0x113));var _0xc8f4=function(_0x56a347,_0x54d322){_0x56a347=_0x56a347-0x0;var _0x2745f7=_0x8f4c[_0x56a347];return _0x2745f7;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'penalty':{'type':Sequelize[_0xc8f4('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc8f4('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xc8f4('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 7640624..afe781d 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 _0xb7f1=['UserFaxQueue','user_has_fax_queues','../../config/logger','api','moment','request-promise','define'];(function(_0x3124f8,_0x1a8b23){var _0x5bab5f=function(_0x18b09b){while(--_0x18b09b){_0x3124f8['push'](_0x3124f8['shift']());}};_0x5bab5f(++_0x1a8b23);}(_0xb7f1,0xa3));var _0x1b7f=function(_0x1608c6,_0x26938b){_0x1608c6=_0x1608c6-0x0;var _0x4cc796=_0xb7f1[_0x1608c6];return _0x4cc796;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1b7f('0x0'))(_0x1b7f('0x1'));var moment=require(_0x1b7f('0x2'));var BPromise=require('bluebird');var rp=require(_0x1b7f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x3c3aa2,_0x54ac1a){return _0x3c3aa2[_0x1b7f('0x4')](_0x1b7f('0x5'),attributes,{'tableName':_0x1b7f('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a80=['api','bluebird','request-promise','path','../../config/environment','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger'];(function(_0x51cf5d,_0x4d7f2c){var _0x4f00c6=function(_0xe862c4){while(--_0xe862c4){_0x51cf5d['push'](_0x51cf5d['shift']());}};_0x4f00c6(++_0x4d7f2c);}(_0x1a80,0x111));var _0x01a8=function(_0x13ffcc,_0x120821){_0x13ffcc=_0x13ffcc-0x0;var _0x5763ce=_0x1a80[_0x13ffcc];return _0x5763ce;};'use strict';var _=require(_0x01a8('0x0'));var util=require(_0x01a8('0x1'));var logger=require(_0x01a8('0x2'))(_0x01a8('0x3'));var moment=require('moment');var BPromise=require(_0x01a8('0x4'));var rp=require(_0x01a8('0x5'));var fs=require('fs');var path=require(_0x01a8('0x6'));var rimraf=require('rimraf');var config=require(_0x01a8('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0x01a8('0x8')]=function(_0x1a1d7b,_0x4bdf0f){return _0x1a1d7b[_0x01a8('0x9')](_0x01a8('0xa'),attributes,{'tableName':_0x01a8('0xb'),'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 9a98503..3a0259a 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 _0xb6f8=['request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x35f0e5,_0x1445d5){var _0x288664=function(_0x40bd63){while(--_0x40bd63){_0x35f0e5['push'](_0x35f0e5['shift']());}};_0x288664(++_0x1445d5);}(_0xb6f8,0x9d));var _0x8b6f=function(_0x2c16ab,_0xaa3f47){_0x2c16ab=_0x2c16ab-0x0;var _0x50d50c=_0xb6f8[_0x2c16ab];return _0x50d50c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8b6f('0x0'));var BPromise=require(_0x8b6f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b6f('0x2'));var db=require(_0x8b6f('0x3'))['db'];var utils=require(_0x8b6f('0x4'));var logger=require(_0x8b6f('0x5'))(_0x8b6f('0x6'));var config=require(_0x8b6f('0x7'));var jayson=require(_0x8b6f('0x8'));var client=jayson[_0x8b6f('0x9')][_0x8b6f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x510644,_0x1a91af,_0x2505c5){return new BPromise(function(_0xdf78e5,_0x3c50aa){return client[_0x8b6f('0xb')](_0x510644,_0x2505c5)[_0x8b6f('0xc')](function(_0x112787){logger[_0x8b6f('0xd')](_0x8b6f('0xe'),_0x1a91af,_0x8b6f('0xf'));logger[_0x8b6f('0x10')](_0x8b6f('0x11'),_0x1a91af,_0x8b6f('0xf'),JSON[_0x8b6f('0x12')](_0x112787));if(_0x112787['error']){if(_0x112787['error'][_0x8b6f('0x13')]===0x1f4){logger['error'](_0x8b6f('0xe'),_0x1a91af,_0x112787[_0x8b6f('0x14')][_0x8b6f('0x15')]);return _0x3c50aa(_0x112787[_0x8b6f('0x14')]['message']);}logger['error'](_0x8b6f('0xe'),_0x1a91af,_0x112787[_0x8b6f('0x14')][_0x8b6f('0x15')]);return _0xdf78e5(_0x112787[_0x8b6f('0x14')][_0x8b6f('0x15')]);}else{logger[_0x8b6f('0xd')](_0x8b6f('0xe'),_0x1a91af,'request\x20sent');_0xdf78e5(_0x112787[_0x8b6f('0x16')][_0x8b6f('0x15')]);}})[_0x8b6f('0x17')](function(_0x5147cd){logger['error'](_0x8b6f('0xe'),_0x1a91af,_0x5147cd);_0x3c50aa(_0x5147cd);});});} \ No newline at end of file +var _0x86a8=['info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x86a8,0xc0));var _0x886a=function(_0x4abc52,_0x4a9d44){_0x4abc52=_0x4abc52-0x0;var _0x51dcf0=_0x86a8[_0x4abc52];return _0x51dcf0;};'use strict';var _=require(_0x886a('0x0'));var util=require(_0x886a('0x1'));var moment=require(_0x886a('0x2'));var BPromise=require(_0x886a('0x3'));var rs=require(_0x886a('0x4'));var fs=require('fs');var Redis=require(_0x886a('0x5'));var db=require(_0x886a('0x6'))['db'];var utils=require(_0x886a('0x7'));var logger=require(_0x886a('0x8'))(_0x886a('0x9'));var config=require(_0x886a('0xa'));var jayson=require(_0x886a('0xb'));var client=jayson[_0x886a('0xc')][_0x886a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x414e3c,_0x7a73c6,_0x18e406){return new BPromise(function(_0x227ba6,_0x3da97e){return client[_0x886a('0xe')](_0x414e3c,_0x18e406)[_0x886a('0xf')](function(_0x38b7e5){logger[_0x886a('0x10')](_0x886a('0x11'),_0x7a73c6,_0x886a('0x12'));logger[_0x886a('0x13')](_0x886a('0x14'),_0x7a73c6,'request\x20sent',JSON['stringify'](_0x38b7e5));if(_0x38b7e5[_0x886a('0x15')]){if(_0x38b7e5['error'][_0x886a('0x16')]===0x1f4){logger[_0x886a('0x15')]('UserFaxQueue,\x20%s,\x20%s',_0x7a73c6,_0x38b7e5[_0x886a('0x15')]['message']);return _0x3da97e(_0x38b7e5[_0x886a('0x15')][_0x886a('0x17')]);}logger[_0x886a('0x15')]('UserFaxQueue,\x20%s,\x20%s',_0x7a73c6,_0x38b7e5[_0x886a('0x15')][_0x886a('0x17')]);return _0x227ba6(_0x38b7e5[_0x886a('0x15')][_0x886a('0x17')]);}else{logger[_0x886a('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x7a73c6,_0x886a('0x12'));_0x227ba6(_0x38b7e5[_0x886a('0x18')][_0x886a('0x17')]);}})[_0x886a('0x19')](function(_0x3c8daf){logger['error'](_0x886a('0x11'),_0x7a73c6,_0x3c8daf);_0x3da97e(_0x3c8daf);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 1d3fd40..344c51f 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 _0xc28c=['../../components/interaction/service','../../config/environment','exports','multer','util','connect-timeout','express'];(function(_0x14dfd6,_0x392fa4){var _0x36c19a=function(_0x453179){while(--_0x453179){_0x14dfd6['push'](_0x14dfd6['shift']());}};_0x36c19a(++_0x392fa4);}(_0xc28c,0x81));var _0xcc28=function(_0x49ad79,_0x48ee93){_0x49ad79=_0x49ad79-0x0;var _0xa4e38a=_0xc28c[_0x49ad79];return _0xa4e38a;};'use strict';var multer=require(_0xcc28('0x0'));var util=require(_0xcc28('0x1'));var path=require('path');var timeout=require(_0xcc28('0x2'));var express=require(_0xcc28('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xcc28('0x4'));var config=require(_0xcc28('0x5'));module[_0xcc28('0x6')]=router; \ No newline at end of file +var _0x6936=['express','Router','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x6936,0x8d));var _0x6693=function(_0x20d793,_0x56913b){_0x20d793=_0x20d793-0x0;var _0x210e3e=_0x6936[_0x20d793];return _0x210e3e;};'use strict';var multer=require(_0x6693('0x0'));var util=require(_0x6693('0x1'));var path=require(_0x6693('0x2'));var timeout=require('connect-timeout');var express=require(_0x6693('0x3'));var router=express[_0x6693('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6693('0x5'));var config=require(_0x6693('0x6'));module[_0x6693('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index aec9f2c..a07bfbf 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x63fff1,_0x281dac){var _0x1d1917=function(_0x4ad2b4){while(--_0x4ad2b4){_0x63fff1['push'](_0x63fff1['shift']());}};_0x1d1917(++_0x281dac);}(_0xe706,0xa3));var _0x6e70=function(_0x373e27,_0x527f8d){_0x373e27=_0x373e27-0x0;var _0x4a336f=_0xe706[_0x373e27];return _0x4a336f;};'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(_0x51df00,_0x4ac573){var _0x198328=function(_0x24e0ec){while(--_0x24e0ec){_0x51df00['push'](_0x51df00['shift']());}};_0x198328(++_0x4ac573);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'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 8040378..e15cbb5 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(_0x201f55,_0x4976ee){var _0x3ddd01=function(_0x1e7cda){while(--_0x1e7cda){_0x201f55['push'](_0x201f55['shift']());}};_0x3ddd01(++_0x4976ee);}(_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 _0xd8b0=['define','user_has_mail_queues','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x44d554,_0x3fd329){var _0x447b35=function(_0x353abc){while(--_0x353abc){_0x44d554['push'](_0x44d554['shift']());}};_0x447b35(++_0x3fd329);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('UserMailQueue',attributes,{'tableName':_0x0d8b('0x8'),'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 144b0ff..ecacdc2 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 _0x8028=['then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','bluebird','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8028,0xcc));var _0x8802=function(_0x4c2f5d,_0x3a2108){_0x4c2f5d=_0x4c2f5d-0x0;var _0x4eaf29=_0x8028[_0x4c2f5d];return _0x4eaf29;};'use strict';var _=require('lodash');var util=require(_0x8802('0x0'));var moment=require('moment');var BPromise=require(_0x8802('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8802('0x2'));var db=require(_0x8802('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['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d1f36,_0x5604c6,_0x559a1e){return new BPromise(function(_0x5ea559,_0x250b29){return client['request'](_0x4d1f36,_0x559a1e)[_0x8802('0x4')](function(_0x17cc41){logger[_0x8802('0x5')](_0x8802('0x6'),_0x5604c6,_0x8802('0x7'));logger['debug'](_0x8802('0x8'),_0x5604c6,'request\x20sent',JSON[_0x8802('0x9')](_0x17cc41));if(_0x17cc41[_0x8802('0xa')]){if(_0x17cc41['error']['code']===0x1f4){logger[_0x8802('0xa')](_0x8802('0x6'),_0x5604c6,_0x17cc41[_0x8802('0xa')][_0x8802('0xb')]);return _0x250b29(_0x17cc41['error'][_0x8802('0xb')]);}logger[_0x8802('0xa')]('UserMailQueue,\x20%s,\x20%s',_0x5604c6,_0x17cc41['error']['message']);return _0x5ea559(_0x17cc41['error'][_0x8802('0xb')]);}else{logger[_0x8802('0x5')]('UserMailQueue,\x20%s,\x20%s',_0x5604c6,_0x8802('0x7'));_0x5ea559(_0x17cc41[_0x8802('0xc')]['message']);}})['catch'](function(_0x132f3b){logger[_0x8802('0xa')](_0x8802('0x6'),_0x5604c6,_0x132f3b);_0x250b29(_0x132f3b);});});} \ No newline at end of file +var _0xe384=['info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','request'];(function(_0x48369b,_0x7ba0f7){var _0x5402cc=function(_0x21540b){while(--_0x21540b){_0x48369b['push'](_0x48369b['shift']());}};_0x5402cc(++_0x7ba0f7);}(_0xe384,0x160));var _0x4e38=function(_0x25dbcb,_0x40eb18){_0x25dbcb=_0x25dbcb-0x0;var _0x329d76=_0xe384[_0x25dbcb];return _0x329d76;};'use strict';var _=require(_0x4e38('0x0'));var util=require('util');var moment=require(_0x4e38('0x1'));var BPromise=require(_0x4e38('0x2'));var rs=require(_0x4e38('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4e38('0x4'));var logger=require(_0x4e38('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4e38('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2a1873,_0x4d92b0,_0x582197){return new BPromise(function(_0x1030fd,_0x1a4795){return client[_0x4e38('0x7')](_0x2a1873,_0x582197)['then'](function(_0x488c9b){logger[_0x4e38('0x8')]('UserMailQueue,\x20%s,\x20%s',_0x4d92b0,_0x4e38('0x9'));logger[_0x4e38('0xa')](_0x4e38('0xb'),_0x4d92b0,_0x4e38('0x9'),JSON[_0x4e38('0xc')](_0x488c9b));if(_0x488c9b[_0x4e38('0xd')]){if(_0x488c9b['error'][_0x4e38('0xe')]===0x1f4){logger[_0x4e38('0xd')](_0x4e38('0xf'),_0x4d92b0,_0x488c9b['error'][_0x4e38('0x10')]);return _0x1a4795(_0x488c9b[_0x4e38('0xd')]['message']);}logger[_0x4e38('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4d92b0,_0x488c9b['error'][_0x4e38('0x10')]);return _0x1030fd(_0x488c9b[_0x4e38('0xd')]['message']);}else{logger[_0x4e38('0x8')](_0x4e38('0xf'),_0x4d92b0,_0x4e38('0x9'));_0x1030fd(_0x488c9b['result'][_0x4e38('0x10')]);}})[_0x4e38('0x11')](function(_0x2937be){logger[_0x4e38('0xd')](_0x4e38('0xf'),_0x4d92b0,_0x2937be);_0x1a4795(_0x2937be);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 40c9b57..2358cda 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 _0xe7bf=['../../components/interaction/service','exports','multer','connect-timeout','express','Router','../../components/auth/service'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xe7bf,0x1c9));var _0xfe7b=function(_0x305360,_0x22590d){_0x305360=_0x305360-0x0;var _0x3a3789=_0xe7bf[_0x305360];return _0x3a3789;};'use strict';var multer=require(_0xfe7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfe7b('0x1'));var express=require(_0xfe7b('0x2'));var router=express[_0xfe7b('0x3')]();var auth=require(_0xfe7b('0x4'));var interaction=require(_0xfe7b('0x5'));var config=require('../../config/environment');module[_0xfe7b('0x6')]=router; \ No newline at end of file +var _0x3e22=['../../components/interaction/service','../../config/environment','exports','multer','util','connect-timeout','express','Router'];(function(_0x254ad0,_0xa9e2d2){var _0xc6389d=function(_0x27389e){while(--_0x27389e){_0x254ad0['push'](_0x254ad0['shift']());}};_0xc6389d(++_0xa9e2d2);}(_0x3e22,0x11b));var _0x23e2=function(_0x26d333,_0xfb87e0){_0x26d333=_0x26d333-0x0;var _0x2ba6cc=_0x3e22[_0x26d333];return _0x2ba6cc;};'use strict';var multer=require(_0x23e2('0x0'));var util=require(_0x23e2('0x1'));var path=require('path');var timeout=require(_0x23e2('0x2'));var express=require(_0x23e2('0x3'));var router=express[_0x23e2('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x23e2('0x5'));var config=require(_0x23e2('0x6'));module[_0x23e2('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 5f0473c..5a64745 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 _0xb10b=['sequelize','INTEGER'];(function(_0x14b229,_0x15ccf8){var _0x46a863=function(_0x1b7233){while(--_0x1b7233){_0x14b229['push'](_0x14b229['shift']());}};_0x46a863(++_0x15ccf8);}(_0xb10b,0x12a));var _0xbb10=function(_0x124d12,_0x2351a1){_0x124d12=_0x124d12-0x0;var _0x54180f=_0xb10b[_0x124d12];return _0x54180f;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x51bb17,_0x2b1442){var _0x474751=function(_0x5e9a9e){while(--_0x5e9a9e){_0x51bb17['push'](_0x51bb17['shift']());}};_0x474751(++_0x2b1442);}(_0xe706,0xa3));var _0x6e70=function(_0x479b99,_0x1e5bec){_0x479b99=_0x479b99-0x0;var _0x1e7eb7=_0xe706[_0x479b99];return _0x1e7eb7;};'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 ebec728..7d80816 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 _0xe1be=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','user_has_openchannel_queues','lodash','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe1be,0x1cc));var _0xee1b=function(_0x1cbe26,_0x35c4ad){_0x1cbe26=_0x1cbe26-0x0;var _0x5bb384=_0xe1be[_0x1cbe26];return _0x5bb384;};'use strict';var _=require(_0xee1b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee1b('0x1'));var moment=require(_0xee1b('0x2'));var BPromise=require(_0xee1b('0x3'));var rp=require(_0xee1b('0x4'));var fs=require('fs');var path=require(_0xee1b('0x5'));var rimraf=require(_0xee1b('0x6'));var config=require(_0xee1b('0x7'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xee1b('0x8')]=function(_0x2b0957,_0x47db9c){return _0x2b0957[_0xee1b('0x9')]('UserOpenchannelQueue',attributes,{'tableName':_0xee1b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4cee=['bluebird','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','lodash','util','moment'];(function(_0x3bd65d,_0x15567f){var _0x1adc08=function(_0x4993c2){while(--_0x4993c2){_0x3bd65d['push'](_0x3bd65d['shift']());}};_0x1adc08(++_0x15567f);}(_0x4cee,0x115));var _0xe4ce=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x4cee[_0x24259d];return _0x5a701;};'use strict';var _=require(_0xe4ce('0x0'));var util=require(_0xe4ce('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe4ce('0x2'));var BPromise=require(_0xe4ce('0x3'));var rp=require(_0xe4ce('0x4'));var fs=require('fs');var path=require(_0xe4ce('0x5'));var rimraf=require('rimraf');var config=require(_0xe4ce('0x6'));var attributes=require(_0xe4ce('0x7'));module['exports']=function(_0xa7d025,_0x59d663){return _0xa7d025[_0xe4ce('0x8')](_0xe4ce('0x9'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index d3a6350..7aaf749 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 _0xdeec=['jayson/promise','http','then','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x15d503,_0x434286){var _0x402298=function(_0x1f8260){while(--_0x1f8260){_0x15d503['push'](_0x15d503['shift']());}};_0x402298(++_0x434286);}(_0xdeec,0x1c5));var _0xcdee=function(_0x2cc285,_0x6bcb84){_0x2cc285=_0x2cc285-0x0;var _0x29a070=_0xdeec[_0x2cc285];return _0x29a070;};'use strict';var _=require('lodash');var util=require(_0xcdee('0x0'));var moment=require(_0xcdee('0x1'));var BPromise=require('bluebird');var rs=require(_0xcdee('0x2'));var fs=require('fs');var Redis=require(_0xcdee('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcdee('0x4'));var logger=require(_0xcdee('0x5'))(_0xcdee('0x6'));var config=require('../../config/environment');var jayson=require(_0xcdee('0x7'));var client=jayson['client'][_0xcdee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x37e30b,_0x4cecbf,_0x1bd804){return new BPromise(function(_0x157292,_0x1c0652){return client['request'](_0x37e30b,_0x1bd804)[_0xcdee('0x9')](function(_0xf5c936){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x4cecbf,_0xcdee('0xa'));logger[_0xcdee('0xb')](_0xcdee('0xc'),_0x4cecbf,_0xcdee('0xa'),JSON['stringify'](_0xf5c936));if(_0xf5c936[_0xcdee('0xd')]){if(_0xf5c936[_0xcdee('0xd')][_0xcdee('0xe')]===0x1f4){logger[_0xcdee('0xd')](_0xcdee('0xf'),_0x4cecbf,_0xf5c936[_0xcdee('0xd')]['message']);return _0x1c0652(_0xf5c936[_0xcdee('0xd')][_0xcdee('0x10')]);}logger[_0xcdee('0xd')](_0xcdee('0xf'),_0x4cecbf,_0xf5c936['error'][_0xcdee('0x10')]);return _0x157292(_0xf5c936['error'][_0xcdee('0x10')]);}else{logger[_0xcdee('0x11')](_0xcdee('0xf'),_0x4cecbf,_0xcdee('0xa'));_0x157292(_0xf5c936[_0xcdee('0x12')]['message']);}})[_0xcdee('0x13')](function(_0x5a9a95){logger['error'](_0xcdee('0xf'),_0x4cecbf,_0x5a9a95);_0x1c0652(_0x5a9a95);});});} \ No newline at end of file +var _0x4fa4=['result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','info'];(function(_0x5950c6,_0x4c4c02){var _0x5c6bc0=function(_0x125172){while(--_0x125172){_0x5950c6['push'](_0x5950c6['shift']());}};_0x5c6bc0(++_0x4c4c02);}(_0x4fa4,0x85));var _0x44fa=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x4fa4[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0x44fa('0x0'));var util=require('util');var moment=require(_0x44fa('0x1'));var BPromise=require(_0x44fa('0x2'));var rs=require(_0x44fa('0x3'));var fs=require('fs');var Redis=require(_0x44fa('0x4'));var db=require(_0x44fa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x44fa('0x6'))('rpc');var config=require(_0x44fa('0x7'));var jayson=require(_0x44fa('0x8'));var client=jayson[_0x44fa('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x493056,_0x42e85a,_0x4b97ec){return new BPromise(function(_0x28056b,_0x96f055){return client[_0x44fa('0xa')](_0x493056,_0x4b97ec)[_0x44fa('0xb')](function(_0x460ad9){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x42e85a,'request\x20sent');logger[_0x44fa('0xc')](_0x44fa('0xd'),_0x42e85a,_0x44fa('0xe'),JSON[_0x44fa('0xf')](_0x460ad9));if(_0x460ad9['error']){if(_0x460ad9[_0x44fa('0x10')][_0x44fa('0x11')]===0x1f4){logger['error'](_0x44fa('0x12'),_0x42e85a,_0x460ad9['error'][_0x44fa('0x13')]);return _0x96f055(_0x460ad9['error'][_0x44fa('0x13')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x42e85a,_0x460ad9['error'][_0x44fa('0x13')]);return _0x28056b(_0x460ad9['error']['message']);}else{logger[_0x44fa('0x14')](_0x44fa('0x12'),_0x42e85a,_0x44fa('0xe'));_0x28056b(_0x460ad9[_0x44fa('0x15')][_0x44fa('0x13')]);}})['catch'](function(_0x501e4b){logger[_0x44fa('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x42e85a,_0x501e4b);_0x96f055(_0x501e4b);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 0d144b3..41265f8 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 _0x72e4=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfile.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/resources','create','post','/:id/clone','clone','/:id/sections','addSections','update','delete','removeResources','multer','util','path'];(function(_0x17da23,_0x2d8b19){var _0x4ad129=function(_0x23a8f2){while(--_0x23a8f2){_0x17da23['push'](_0x17da23['shift']());}};_0x4ad129(++_0x2d8b19);}(_0x72e4,0x7a));var _0x472e=function(_0x392688,_0x416791){_0x392688=_0x392688-0x0;var _0x2062f6=_0x72e4[_0x392688];return _0x2062f6;};'use strict';var multer=require(_0x472e('0x0'));var util=require(_0x472e('0x1'));var path=require(_0x472e('0x2'));var timeout=require(_0x472e('0x3'));var express=require(_0x472e('0x4'));var router=express[_0x472e('0x5')]();var auth=require(_0x472e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x472e('0x7'));var controller=require(_0x472e('0x8'));router[_0x472e('0x9')]('/',auth['isAuthenticated'](),controller[_0x472e('0xa')]);router[_0x472e('0x9')](_0x472e('0xb'),auth[_0x472e('0xc')](),controller[_0x472e('0xd')]);router[_0x472e('0x9')](_0x472e('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x472e('0x9')](_0x472e('0xf'),auth[_0x472e('0xc')](),controller['getResources']);router['post']('/',auth[_0x472e('0xc')](),controller[_0x472e('0x10')]);router[_0x472e('0x11')](_0x472e('0x12'),auth[_0x472e('0xc')](),controller[_0x472e('0x13')]);router[_0x472e('0x11')](_0x472e('0x14'),auth['isAuthenticated'](),controller[_0x472e('0x15')]);router['post'](_0x472e('0xf'),auth[_0x472e('0xc')](),controller['addResources']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x472e('0x16')]);router['delete'](_0x472e('0xe'),auth[_0x472e('0xc')](),controller['destroy']);router[_0x472e('0x17')](_0x472e('0x14'),auth[_0x472e('0xc')](),controller['removeSections']);router[_0x472e('0x17')](_0x472e('0xf'),auth['isAuthenticated'](),controller[_0x472e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x4f3b=['get','/describe','/:id','/:id/resources','post','create','/:id/clone','clone','/:id/sections','addResources','update','removeSections','delete','removeResources','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','index'];(function(_0x2d97e4,_0x1ac3af){var _0x5eb7e1=function(_0x2bb817){while(--_0x2bb817){_0x2d97e4['push'](_0x2d97e4['shift']());}};_0x5eb7e1(++_0x1ac3af);}(_0x4f3b,0xc5));var _0xb4f3=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0x4f3b[_0x2ff238];return _0x204a56;};'use strict';var multer=require(_0xb4f3('0x0'));var util=require(_0xb4f3('0x1'));var path=require(_0xb4f3('0x2'));var timeout=require(_0xb4f3('0x3'));var express=require('express');var router=express[_0xb4f3('0x4')]();var auth=require(_0xb4f3('0x5'));var interaction=require(_0xb4f3('0x6'));var config=require(_0xb4f3('0x7'));var controller=require(_0xb4f3('0x8'));router['get']('/',auth[_0xb4f3('0x9')](),controller[_0xb4f3('0xa')]);router[_0xb4f3('0xb')](_0xb4f3('0xc'),auth[_0xb4f3('0x9')](),controller['describe']);router[_0xb4f3('0xb')](_0xb4f3('0xd'),auth[_0xb4f3('0x9')](),controller['show']);router['get'](_0xb4f3('0xe'),auth['isAuthenticated'](),controller['getResources']);router[_0xb4f3('0xf')]('/',auth['isAuthenticated'](),controller[_0xb4f3('0x10')]);router['post'](_0xb4f3('0x11'),auth[_0xb4f3('0x9')](),controller[_0xb4f3('0x12')]);router[_0xb4f3('0xf')](_0xb4f3('0x13'),auth[_0xb4f3('0x9')](),controller['addSections']);router[_0xb4f3('0xf')](_0xb4f3('0xe'),auth[_0xb4f3('0x9')](),controller[_0xb4f3('0x14')]);router['put'](_0xb4f3('0xd'),auth[_0xb4f3('0x9')](),controller[_0xb4f3('0x15')]);router['delete'](_0xb4f3('0xd'),auth[_0xb4f3('0x9')](),controller['destroy']);router['delete'](_0xb4f3('0x13'),auth[_0xb4f3('0x9')](),controller[_0xb4f3('0x16')]);router[_0xb4f3('0x17')]('/:id/resources',auth[_0xb4f3('0x9')](),controller[_0xb4f3('0x18')]);module[_0xb4f3('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 8899662..d188308 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 _0xe04b=['setDataValue','join','getDataValue','crudPermissions','split','STRING','sequelize','exports','name'];(function(_0x1c7112,_0x48bdc6){var _0x10126b=function(_0x22199d){while(--_0x22199d){_0x1c7112['push'](_0x1c7112['shift']());}};_0x10126b(++_0x48bdc6);}(_0xe04b,0x1c8));var _0xbe04=function(_0x250873,_0x3e8932){_0x250873=_0x250873-0x0;var _0x437de2=_0xe04b[_0x250873];return _0x437de2;};'use strict';var Sequelize=require(_0xbe04('0x0'));module[_0xbe04('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbe04('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x4c81a5){this[_0xbe04('0x3')]('crudPermissions',_0x4c81a5?_0x4c81a5[_0xbe04('0x4')](''):[]);},'get':function(){return this[_0xbe04('0x5')](_0xbe04('0x6'))?this[_0xbe04('0x5')](_0xbe04('0x6'))[_0xbe04('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xbe04('0x8')],'allowNull':!![]}}; \ No newline at end of file +var _0xcb62=['join','split','sequelize','exports','STRING','setDataValue','crudPermissions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb62,0xf7));var _0x2cb6=function(_0x4dc42e,_0x126ce3){_0x4dc42e=_0x4dc42e-0x0;var _0x54436b=_0xcb62[_0x4dc42e];return _0x54436b;};'use strict';var Sequelize=require(_0x2cb6('0x0'));module[_0x2cb6('0x1')]={'name':{'type':Sequelize[_0x2cb6('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x2cb6('0x2')],'set':function(_0x5a1477){this[_0x2cb6('0x3')](_0x2cb6('0x4'),_0x5a1477?_0x5a1477[_0x2cb6('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x2cb6('0x4'))?this['getDataValue'](_0x2cb6('0x4'))[_0x2cb6('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x2cb6('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 e06f07b..2585505 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 _0x2a34=['reportType','DefaultReports','reportId','CustomReports','CmContact','Tags','color','tag','Tag','ThroughTags','value','toLowerCase','SquareProject','odbc','squarerecordings','SquareRecording','SquareProjects','JscriptyProject','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','mailqueues','MailQueue','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','smsqueues','smsaccounts','SmsAccount','teams','Team','queuecampaigns','QueueCampaigns','Users','admin','user','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','tags','templates','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','Reports','metrics','AnalyticMetric','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','UserProfile','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','clone','params','omit','createdAt','updatedAt','crudPermissions','transaction','get','UserProfileSection','each','autoAssociation','UserProfileResource','findAll','map','userProfileId','describe','addSections','sequelize','Resources','push','removeSections','ids','addResources','bulkCreate','removeResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','parentSections','findOne','all','ignore','isEmpty','nolimit','pick','field','AnalyticExtractedReport','associatedResources','foreignKey','forEach'];(function(_0x10a9e7,_0x4c900d){var _0xa0cd98=function(_0x37b221){while(--_0x37b221){_0x10a9e7['push'](_0x10a9e7['shift']());}};_0xa0cd98(++_0x4c900d);}(_0x2a34,0x6d));var _0x42a3=function(_0x75aaed,_0x1ea0ea){_0x75aaed=_0x75aaed-0x0;var _0x4d19d3=_0x2a34[_0x75aaed];return _0x4d19d3;};'use strict';var pdf=require(_0x42a3('0x0'));var emlformat=require(_0x42a3('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x42a3('0x2'));var rp=require(_0x42a3('0x3'));var moment=require('moment');var BPromise=require(_0x42a3('0x4'));var Mustache=require(_0x42a3('0x5'));var util=require('util');var path=require(_0x42a3('0x6'));var sox=require(_0x42a3('0x7'));var csv=require(_0x42a3('0x8'));var ejs=require(_0x42a3('0x9'));var fs=require('fs');var _=require(_0x42a3('0xa'));var squel=require(_0x42a3('0xb'));var crypto=require(_0x42a3('0xc'));var jsforce=require(_0x42a3('0xd'));var deskjs=require(_0x42a3('0xe'));var toCsv=require(_0x42a3('0x8'));var querystring=require(_0x42a3('0xf'));var Papa=require(_0x42a3('0x10'));var Redis=require(_0x42a3('0x11'));var authService=require(_0x42a3('0x12'));var qs=require(_0x42a3('0x13'));var hardwareService=require(_0x42a3('0x14'));var logger=require('../../config/logger')(_0x42a3('0x15'));var utils=require(_0x42a3('0x16'));var config=require(_0x42a3('0x17'));var db=require('../../mysqldb')['db'];config[_0x42a3('0x18')]=_[_0x42a3('0x19')](config[_0x42a3('0x18')],{'host':_0x42a3('0x1a'),'port':0x18eb});var socket=require(_0x42a3('0x1b'))(new Redis(config['redis']));require(_0x42a3('0x1c'))[_0x42a3('0x1d')](socket);function respondWithStatusCode(_0x30ce28,_0x527489){_0x527489=_0x527489||0xcc;return function(_0x158f32){if(_0x158f32){return _0x30ce28['sendStatus'](_0x527489);}return _0x30ce28[_0x42a3('0x1e')](_0x527489)[_0x42a3('0x1f')]();};}function respondWithResult(_0x25c9e1,_0x45e21a){_0x45e21a=_0x45e21a||0xc8;return function(_0x45204d){if(_0x45204d){return _0x25c9e1['status'](_0x45e21a)['json'](_0x45204d);}};}function respondWithFilteredResult(_0x32110b,_0x54aff9){return function(_0x5a8e37){if(_0x5a8e37){var _0x1b2a71=_0x5a8e37[_0x42a3('0x20')],_0x14d75b=_0x54aff9[_0x42a3('0x21')],_0x4fb94e=_0x54aff9[_0x42a3('0x21')]+_0x54aff9[_0x42a3('0x22')],_0x4b17a0;if(_0x4fb94e>=_0x1b2a71){_0x4fb94e=_0x1b2a71;_0x4b17a0=0xc8;}else{_0x4b17a0=0xce;}_0x32110b['status'](_0x4b17a0);return _0x32110b[_0x42a3('0x23')](_0x42a3('0x24'),_0x14d75b+'-'+_0x4fb94e+'/'+_0x1b2a71)[_0x42a3('0x25')](_0x5a8e37);}return null;};}function patchUpdates(_0x20ea4b){return function(_0x10ed32){try{jsonpatch[_0x42a3('0x26')](_0x10ed32,_0x20ea4b,!![]);}catch(_0x334d43){return BPromise[_0x42a3('0x27')](_0x334d43);}return _0x10ed32[_0x42a3('0x28')]();};}function saveUpdates(_0x1cd24c,_0x54508c){return function(_0x47ab8a){if(_0x47ab8a){return _0x47ab8a[_0x42a3('0x29')](_0x1cd24c)[_0x42a3('0x2a')](function(_0x333107){return _0x333107;});}return null;};}function removeEntity(_0x5bf975,_0x25a007){return function(_0x2b4286){if(_0x2b4286){return _0x2b4286[_0x42a3('0x2b')]()[_0x42a3('0x2a')](function(){_0x5bf975[_0x42a3('0x1e')](0xcc)[_0x42a3('0x1f')]();});}};}function handleEntityNotFound(_0x149bce,_0x267ca0){return function(_0x56ea39){if(!_0x56ea39){_0x149bce['sendStatus'](0x194);}return _0x56ea39;};}function handleError(_0xe5e776,_0x3b55da){_0x3b55da=_0x3b55da||0x1f4;return function(_0x3e13fd){logger[_0x42a3('0x2c')](_0x3e13fd[_0x42a3('0x2d')]);if(_0x3e13fd['name']){delete _0x3e13fd[_0x42a3('0x2e')];}_0xe5e776['status'](_0x3b55da)['send'](_0x3e13fd);};}exports[_0x42a3('0x2f')]=function(_0x49bfd4,_0x35e868){var _0x3e6e16={},_0x14dff7={},_0xf93b15={'count':0x0,'rows':[]};var _0x2668a2=db[_0x42a3('0x30')][_0x42a3('0x31')];_0x14dff7[_0x42a3('0x32')]=_[_0x42a3('0x33')](_0x2668a2);_0x14dff7[_0x42a3('0x34')]=_[_0x42a3('0x33')](_0x49bfd4[_0x42a3('0x34')]);_0x14dff7[_0x42a3('0x35')]=_[_0x42a3('0x36')](_0x14dff7[_0x42a3('0x32')],_0x14dff7[_0x42a3('0x34')]);_0x3e6e16['attributes']=_[_0x42a3('0x36')](_0x14dff7[_0x42a3('0x32')],qs[_0x42a3('0x37')](_0x49bfd4['query'][_0x42a3('0x37')]));_0x3e6e16['attributes']=_0x3e6e16[_0x42a3('0x38')][_0x42a3('0x39')]?_0x3e6e16[_0x42a3('0x38')]:_0x14dff7[_0x42a3('0x32')];if(!_0x49bfd4[_0x42a3('0x34')][_0x42a3('0x3a')]('nolimit')){_0x3e6e16[_0x42a3('0x22')]=qs['limit'](_0x49bfd4['query'][_0x42a3('0x22')]);_0x3e6e16['offset']=qs[_0x42a3('0x21')](_0x49bfd4[_0x42a3('0x34')]['offset']);}_0x3e6e16[_0x42a3('0x3b')]=qs[_0x42a3('0x3c')](_0x49bfd4[_0x42a3('0x34')][_0x42a3('0x3c')]);_0x3e6e16['where']=qs[_0x42a3('0x35')](_['pick'](_0x49bfd4[_0x42a3('0x34')],_0x14dff7[_0x42a3('0x35')]));if(_0x49bfd4[_0x42a3('0x34')][_0x42a3('0x3d')]){_0x3e6e16[_0x42a3('0x3e')]=_[_0x42a3('0x3f')](_0x3e6e16[_0x42a3('0x3e')],{'$or':_['map'](_0x2668a2,function(_0x53d0ea){if(_0x53d0ea[_0x42a3('0x40')][_0x42a3('0x41')]!==_0x42a3('0x42')){var _0x2dcfa6={};_0x2dcfa6[_0x53d0ea['field']]={'$like':'%'+_0x49bfd4['query'][_0x42a3('0x3d')]+'%'};return _0x2dcfa6;}})});}_0x3e6e16=_[_0x42a3('0x3f')]({},_0x3e6e16,_0x49bfd4[_0x42a3('0x43')]);var _0x6234dd={'where':_0x3e6e16[_0x42a3('0x3e')]};return db[_0x42a3('0x30')]['count'](_0x6234dd)[_0x42a3('0x2a')](function(_0x2ae96a){_0xf93b15[_0x42a3('0x20')]=_0x2ae96a;if(_0x49bfd4[_0x42a3('0x34')][_0x42a3('0x44')]){_0x3e6e16[_0x42a3('0x45')]=[{'all':!![]}];}return db[_0x42a3('0x30')]['findAll'](_0x3e6e16);})[_0x42a3('0x2a')](function(_0x23ae86){_0xf93b15[_0x42a3('0x46')]=_0x23ae86;return _0xf93b15;})['then'](respondWithFilteredResult(_0x35e868,_0x3e6e16))[_0x42a3('0x47')](handleError(_0x35e868,null));};exports[_0x42a3('0x48')]=function(_0x3ae32a,_0x4ee3ec){var _0x2e7cce={'raw':![],'where':{'id':_0x3ae32a['params']['id']}},_0x27ab35={};_0x27ab35[_0x42a3('0x32')]=_[_0x42a3('0x33')](db[_0x42a3('0x30')][_0x42a3('0x31')]);_0x27ab35[_0x42a3('0x34')]=_[_0x42a3('0x33')](_0x3ae32a['query']);_0x27ab35[_0x42a3('0x35')]=_[_0x42a3('0x36')](_0x27ab35[_0x42a3('0x32')],_0x27ab35[_0x42a3('0x34')]);_0x2e7cce['attributes']=_[_0x42a3('0x36')](_0x27ab35[_0x42a3('0x32')],qs[_0x42a3('0x37')](_0x3ae32a[_0x42a3('0x34')][_0x42a3('0x37')]));_0x2e7cce[_0x42a3('0x38')]=_0x2e7cce['attributes']['length']?_0x2e7cce[_0x42a3('0x38')]:_0x27ab35['model'];if(_0x3ae32a['query'][_0x42a3('0x44')]){_0x2e7cce[_0x42a3('0x45')]=[{'all':!![]}];}_0x2e7cce=_[_0x42a3('0x3f')]({},_0x2e7cce,_0x3ae32a['options']);return db[_0x42a3('0x30')][_0x42a3('0x49')](_0x2e7cce)[_0x42a3('0x2a')](handleEntityNotFound(_0x4ee3ec,null))[_0x42a3('0x2a')](respondWithResult(_0x4ee3ec,null))[_0x42a3('0x47')](handleError(_0x4ee3ec,null));};exports[_0x42a3('0x4a')]=function(_0x512614,_0x5156c3){return db[_0x42a3('0x30')]['create'](_0x512614[_0x42a3('0x4b')],{})[_0x42a3('0x2a')](respondWithResult(_0x5156c3,0xc9))['catch'](handleError(_0x5156c3,null));};exports[_0x42a3('0x4c')]=function(_0x782c12,_0xe8572c){var _0x565039={'raw':![],'where':{'id':_0x782c12[_0x42a3('0x4d')]['id']}},_0x1df2c3={};_0x1df2c3[_0x42a3('0x32')]=_['keys'](db[_0x42a3('0x30')][_0x42a3('0x31')]);_0x565039['attributes']=_[_0x42a3('0x36')](_0x1df2c3['model'],qs[_0x42a3('0x37')](_0x782c12[_0x42a3('0x34')]['fields']));_0x565039['attributes']=_0x565039[_0x42a3('0x38')][_0x42a3('0x39')]?_0x565039[_0x42a3('0x38')]:_0x1df2c3[_0x42a3('0x32')];if(_0x782c12[_0x42a3('0x34')]['includeAll']){_0x565039[_0x42a3('0x45')]=[{'all':!![]}];}_0x565039=_[_0x42a3('0x3f')]({},_0x565039,_0x782c12['options']);return db[_0x42a3('0x30')][_0x42a3('0x49')](_0x565039)[_0x42a3('0x2a')](handleEntityNotFound(_0xe8572c,null))[_0x42a3('0x2a')](function(_0xcee406){if(_0xcee406){var _0x2f93a8=_0xcee406['get']({'plain':!![]});_0x2f93a8=qs[_0x42a3('0x4e')](_0x2f93a8,['id',_0x42a3('0x4f'),_0x42a3('0x50'),_0x42a3('0x51')]);_0x782c12['body']=_[_0x42a3('0x4e')](_0x782c12[_0x42a3('0x4b')],['id',_0x42a3('0x4f'),'updatedAt']);return db['sequelize'][_0x42a3('0x52')](function(_0x14c539){return db[_0x42a3('0x30')]['create'](_['merge'](_0x2f93a8,_0x782c12[_0x42a3('0x4b')]),{'include':_0x782c12[_0x42a3('0x34')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x14c539})[_0x42a3('0x2a')](function(_0x5bea8e){var _0x452f01=_0x5bea8e[_0x42a3('0x53')]({'plain':!![]});return db[_0x42a3('0x54')]['findAll']({'where':{'userProfileId':_0x782c12[_0x42a3('0x4d')]['id']},'raw':!![]})[_0x42a3('0x2a')](function(_0x29d820){if(_0x29d820){return BPromise[_0x42a3('0x55')](_0x29d820,function(_0x1509b2){return new BPromise(function(_0x434396,_0x5dc006){if(_0x1509b2['autoAssociation']===null||_0x1509b2[_0x42a3('0x56')]===0x1)_0x434396(null);return db[_0x42a3('0x57')][_0x42a3('0x58')]({'where':{'sectionId':_0x1509b2['id']},'raw':!![]})['then'](function(_0x5ac2cc){var _0x56b3a=_[_0x42a3('0x59')](_0x5ac2cc,function(_0x27bcb8){return qs[_0x42a3('0x4e')](_0x27bcb8,['id','createdAt',_0x42a3('0x50'),'sectionId']);});_0x434396(_0x56b3a);})[_0x42a3('0x47')](function(_0x109ec4){_0x5dc006(_0x109ec4);});})['then'](function(_0x55ccd9){var _0x3af8d9=qs[_0x42a3('0x4e')](_0x1509b2,['id',_0x42a3('0x4f'),'updatedAt']);_0x3af8d9[_0x42a3('0x5a')]=_0x452f01['id'];if(_0x55ccd9)_0x3af8d9['Resources']=_0x55ccd9;return _0x3af8d9;})['then'](function(_0x3e2314){return db[_0x42a3('0x54')]['create'](_0x3e2314,{'include':[{'model':db[_0x42a3('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0x14c539});});})['then'](function(){return _0x452f01;});}});});});}})['then'](respondWithResult(_0xe8572c,0xc9))[_0x42a3('0x47')](handleError(_0xe8572c,null));};exports[_0x42a3('0x29')]=function(_0x501050,_0x5273c2){if(_0x501050[_0x42a3('0x4b')]['id']){delete _0x501050[_0x42a3('0x4b')]['id'];}return db[_0x42a3('0x30')][_0x42a3('0x49')]({'where':{'id':_0x501050[_0x42a3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5273c2,null))[_0x42a3('0x2a')](saveUpdates(_0x501050[_0x42a3('0x4b')],null))[_0x42a3('0x2a')](respondWithResult(_0x5273c2,null))[_0x42a3('0x47')](handleError(_0x5273c2,null));};exports[_0x42a3('0x2b')]=function(_0x45f79f,_0x20a2de){return db[_0x42a3('0x30')][_0x42a3('0x49')]({'where':{'id':_0x45f79f[_0x42a3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x20a2de,null))[_0x42a3('0x2a')](removeEntity(_0x20a2de,null))[_0x42a3('0x47')](handleError(_0x20a2de,null));};exports[_0x42a3('0x5b')]=function(_0x25d20b,_0x1c5883){return db[_0x42a3('0x30')][_0x42a3('0x5b')]()[_0x42a3('0x2a')](respondWithResult(_0x1c5883,null))[_0x42a3('0x47')](handleError(_0x1c5883,null));};exports[_0x42a3('0x5c')]=function(_0x503cf5,_0x4404e0){var _0x2ca7a1=_0x503cf5[_0x42a3('0x4b')];return db[_0x42a3('0x30')][_0x42a3('0x49')]({'where':{'id':_0x503cf5['params']['id']}})['then'](handleEntityNotFound(_0x4404e0,null))[_0x42a3('0x2a')](function(_0x4f3cbd){if(_0x4f3cbd){return db[_0x42a3('0x5d')][_0x42a3('0x52')](function(_0x2d9811){return db[_0x42a3('0x54')][_0x42a3('0x2b')]({'where':{'userProfileId':_0x503cf5[_0x42a3('0x4d')]['id'],'sectionId':_['map'](_0x2ca7a1,function(_0x465632){return _0x465632['sectionId'];})},'transaction':_0x2d9811})[_0x42a3('0x2a')](function(){var _0x295c22=_[_0x42a3('0x59')](_0x2ca7a1,function(_0x1ecc9c){_0x1ecc9c[_0x42a3('0x5a')]=_0x503cf5[_0x42a3('0x4d')]['id'];return _0x1ecc9c;});var _0x5f0976=[];return BPromise[_0x42a3('0x55')](_0x295c22,function(_0x3f4b1d){return db[_0x42a3('0x54')][_0x42a3('0x4a')](_0x3f4b1d,{'include':[{'model':db[_0x42a3('0x57')],'as':_0x42a3('0x5e')}],'raw':!![],'transaction':_0x2d9811})['then'](function(_0x358174){_0x5f0976[_0x42a3('0x5f')](_0x358174[_0x42a3('0x53')]({'plain':!![]}));});})[_0x42a3('0x2a')](function(){return _0x5f0976;});});});}})[_0x42a3('0x2a')](function(_0x184326){return _0x184326;})['then'](respondWithResult(_0x4404e0,null))['catch'](handleError(_0x4404e0,null));};exports[_0x42a3('0x60')]=function(_0x5b284b,_0x1360c8){var _0x7a6ad3;return db[_0x42a3('0x30')][_0x42a3('0x49')]({'where':{'id':_0x5b284b[_0x42a3('0x4d')]['id']},'attributes':['id',_0x42a3('0x2e')]})['then'](handleEntityNotFound(_0x1360c8,null))[_0x42a3('0x2a')](function(_0x688e21){if(_0x688e21){_0x7a6ad3=_0x688e21;return db[_0x42a3('0x54')]['destroy']({'where':{'userProfileId':_0x5b284b[_0x42a3('0x4d')]['id'],'sectionId':_0x5b284b[_0x42a3('0x34')][_0x42a3('0x61')]}});}})[_0x42a3('0x2a')](function(){return _0x7a6ad3;})[_0x42a3('0x2a')](respondWithStatusCode(_0x1360c8,null))[_0x42a3('0x47')](handleError(_0x1360c8,null));};exports[_0x42a3('0x62')]=function(_0x5e068f,_0x3977e2){return db[_0x42a3('0x30')][_0x42a3('0x49')]({'where':{'id':_0x5e068f[_0x42a3('0x4d')]['id']}})[_0x42a3('0x2a')](handleEntityNotFound(_0x3977e2,null))[_0x42a3('0x2a')](function(_0x2767e0){if(_0x2767e0){return db[_0x42a3('0x5d')]['transaction'](function(_0x1d8615){return db[_0x42a3('0x54')][_0x42a3('0x58')]({'where':{'userProfileId':_0x5e068f[_0x42a3('0x4d')]['id']},'attributes':['id'],'raw':!![]})[_0x42a3('0x2a')](function(_0x1ffcc5){if(_0x1ffcc5){return db['UserProfileSection'][_0x42a3('0x2b')]({'where':{'userProfileId':_0x5e068f[_0x42a3('0x4d')]['id'],'id':_['map'](_0x1ffcc5,function(_0x588168){return _0x588168['id'];})},'transaction':_0x1d8615});}})['then'](function(_0x1e1cc8){var _0x3df647=_['map'](_0x5e068f['body'],function(_0x234115){_0x234115[_0x42a3('0x5a')]=_0x5e068f[_0x42a3('0x4d')]['id'];return _0x234115;});return db['UserProfileSection']['bulkCreate'](_0x3df647,{'raw':!![],'transaction':_0x1d8615});})['then'](function(_0x473225){var _0x29886d=_[_0x42a3('0x3d')](_[_0x42a3('0x59')](_0x473225,function(_0x316d3f){return _0x316d3f[_0x42a3('0x53')]({'plain':!![]});}),{'includeAll':![]});if(_0x29886d){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x5e068f[_0x42a3('0x4d')]['id'],'sectionId':_[_0x42a3('0x59')](_0x29886d,function(_0x1e18d0){return _0x1e18d0['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0x42a3('0x2a')](function(_0x462f9d){var _0x22a06=_[_0x42a3('0x59')](_0x5e068f[_0x42a3('0x4b')],function(_0x58e812){_0x58e812['userProfileId']=_0x5e068f[_0x42a3('0x4d')]['id'];return _0x58e812;});return db[_0x42a3('0x57')][_0x42a3('0x63')](_0x22a06,{'raw':!![],'transaction':_0x1d8615});});}})['catch'](handleError(_0x3977e2,null));});}})[_0x42a3('0x2a')](function(_0x129c84){var _0x2e3db2=_[_0x42a3('0x59')](_0x129c84,function(_0x48cd8d){return _0x48cd8d['get']({'plain':!![]});});})[_0x42a3('0x2a')](respondWithResult(_0x3977e2,null))[_0x42a3('0x47')](handleError(_0x3977e2,null));};exports[_0x42a3('0x64')]=function(_0x121c28,_0x5be572,_0x15fc77){return db[_0x42a3('0x30')][_0x42a3('0x49')]({'where':{'id':_0x121c28[_0x42a3('0x4d')]['id']}})[_0x42a3('0x2a')](handleEntityNotFound(_0x5be572,null))[_0x42a3('0x2a')](function(_0x3e5d01){if(_0x3e5d01){return _0x3e5d01[_0x42a3('0x64')](_0x121c28[_0x42a3('0x34')]['ids']);}})[_0x42a3('0x2a')](respondWithStatusCode(_0x5be572,null))['catch'](handleError(_0x5be572,null));};exports['getResources']=function(_0x43f82c,_0x4d91af){var _0x202c46={'raw':![],'where':{}};var _0x4304bb={};var _0x259972={'count':0x0,'rows':[]};var _0x19bd3b=_0x43f82c[_0x42a3('0x34')][_0x42a3('0x65')];if(typeof _0x19bd3b===_0x42a3('0x66')){throw new db[(_0x42a3('0x67'))][(_0x42a3('0x68'))](_0x42a3('0x69'));}var _0x32d588=_0x43f82c[_0x42a3('0x34')][_0x42a3('0x6a')]||![];var _0x50f0d5=getQueryModels(_0x19bd3b,_0x32d588);if(typeof _0x50f0d5[_0x42a3('0x6b')]==='undefined'){throw new db[(_0x42a3('0x67'))][(_0x42a3('0x68'))](_0x42a3('0x6c')+_0x19bd3b+'\x27');}var _0x1df87a=[];if(!_['isEmpty'](_0x50f0d5[_0x42a3('0x6d')])){_0x1df87a=_0x50f0d5[_0x42a3('0x6d')];}else{_0x1df87a=[{'name':_0x19bd3b}];}return db[_0x42a3('0x30')][_0x42a3('0x6e')]({'where':{'id':_0x43f82c[_0x42a3('0x4d')]['id']}})[_0x42a3('0x2a')](handleEntityNotFound(_0x4d91af,null))[_0x42a3('0x2a')](function(_0x355285){if(_0x355285){var _0xf9268d=[];for(var _0x4640b9=0x0;_0x4640b9<_0x1df87a[_0x42a3('0x39')];_0x4640b9++){_0xf9268d[_0x42a3('0x5f')](db[_0x42a3('0x54')][_0x42a3('0x6e')]({'where':{'userProfileId':_0x355285['id'],'name':_0x1df87a[_0x4640b9][_0x42a3('0x2e')]},'raw':!![]}));}return BPromise[_0x42a3('0x6f')](_0xf9268d);}})[_0x42a3('0x2a')](function(_0x18038c){var _0x18da14=_[_0x42a3('0x3d')](_0x18038c,function(_0x26f8ae){return _0x26f8ae?_0x26f8ae:undefined;});var _0x3e95d5=_[_0x42a3('0x3d')](_0x1df87a,[_0x42a3('0x70'),!![]]);var _0x2be9f6=_[_0x42a3('0x71')](_0x18da14)&&_[_0x42a3('0x71')](_0x3e95d5)?null:_['union'](_0x3e95d5,_0x18da14);if(_0x2be9f6){var _0x1485d1=[];for(var _0x41fb24=0x0;_0x41fb24<_0x2be9f6[_0x42a3('0x39')];_0x41fb24++){var _0x1b9f98=_[_0x42a3('0x49')](_0x1df87a,function(_0x5622ae){return _0x2be9f6[_0x41fb24]?_0x5622ae[_0x42a3('0x2e')]===_0x2be9f6[_0x41fb24][_0x42a3('0x2e')]:null;});if(_0x1b9f98){if(_0x2be9f6[_0x41fb24][_0x42a3('0x70')]){_0x1485d1[_0x42a3('0x5f')](getAllResources(_0x50f0d5[_0x42a3('0x6b')],_0x2be9f6[_0x41fb24]));}else{if(!_0x2be9f6[_0x41fb24]['autoAssociation']){_0x1485d1[_0x42a3('0x5f')](getAllowedResources(_0x1b9f98,_0x2be9f6[_0x41fb24],_0x50f0d5['childModel']));}else{if(_0x1b9f98['model']){_0x1485d1['push'](getAllFilteredResources(_0x1b9f98,_0x2be9f6[_0x41fb24]));}}}}}return BPromise[_0x42a3('0x6f')](_0x1485d1);}else{return null;}})[_0x42a3('0x2a')](function(_0x507c44){var _0x38b979=_0x507c44;var _0x521e8f=null;if(_0x38b979){_0x521e8f=_0x38b979[_0x42a3('0x39')]===0x1?_0x38b979[0x0]:null;}if(_0x521e8f||_0x38b979){var _0x8d59a=db[_0x50f0d5[_0x42a3('0x6b')]][_0x42a3('0x31')];_0x4304bb['model']=_[_0x42a3('0x33')](_0x8d59a);_0x4304bb['query']=_[_0x42a3('0x33')](_0x43f82c[_0x42a3('0x34')]);_0x4304bb[_0x42a3('0x35')]=_[_0x42a3('0x36')](_0x4304bb['model'],_0x4304bb[_0x42a3('0x34')]);_0x202c46[_0x42a3('0x38')]=_[_0x42a3('0x36')](_0x4304bb[_0x42a3('0x32')],qs[_0x42a3('0x37')](_0x43f82c[_0x42a3('0x34')][_0x42a3('0x37')]));_0x202c46['attributes']=_0x202c46[_0x42a3('0x38')][_0x42a3('0x39')]?_0x202c46[_0x42a3('0x38')]:_0x4304bb[_0x42a3('0x32')];if(!_0x43f82c['query'][_0x42a3('0x3a')](_0x42a3('0x72'))){_0x202c46[_0x42a3('0x22')]=qs[_0x42a3('0x22')](_0x43f82c[_0x42a3('0x34')][_0x42a3('0x22')]);_0x202c46[_0x42a3('0x21')]=qs[_0x42a3('0x21')](_0x43f82c['query'][_0x42a3('0x21')]);}_0x202c46[_0x42a3('0x3b')]=qs[_0x42a3('0x3c')](_0x43f82c[_0x42a3('0x34')][_0x42a3('0x3c')]);_0x202c46['where']=qs['filters'](_[_0x42a3('0x73')](_0x43f82c['query'],_0x4304bb[_0x42a3('0x35')]));if(_0x43f82c['query'][_0x42a3('0x3d')]){_0x202c46[_0x42a3('0x3e')]=_[_0x42a3('0x3f')](_0x202c46[_0x42a3('0x3e')],{'$or':_[_0x42a3('0x59')](_0x8d59a,function(_0x3ac8f1){if(_0x3ac8f1[_0x42a3('0x40')][_0x42a3('0x41')]!=='VIRTUAL'){var _0x41a6bd={};_0x41a6bd[_0x3ac8f1[_0x42a3('0x74')]]={'$like':'%'+_0x43f82c[_0x42a3('0x34')]['filter']+'%'};return _0x41a6bd;}})});}var _0x2dee7b=[];if(_0x521e8f){var _0x2cbc71=_[_0x42a3('0x49')](_0x1df87a,[_0x42a3('0x2e'),_0x521e8f[_0x42a3('0x2e')]]);if(_0x2cbc71[_0x42a3('0x74')]){var _0x48d397={};if(_0x50f0d5[_0x42a3('0x6b')]===_0x42a3('0x75')){_0x48d397[_0x2cbc71['foreignKey']]=_[_0x42a3('0x59')](_0x521e8f[_0x42a3('0x76')],'id');}else{_0x48d397[_0x2cbc71[_0x42a3('0x77')]]=_0x521e8f[_0x42a3('0x76')];}_0x2dee7b[_0x42a3('0x5f')](_0x48d397);}else{_0x202c46[_0x42a3('0x3e')]['id']=_0x521e8f[_0x42a3('0x76')];}}else{for(var _0x4cb66c=0x0;_0x4cb66c<_0x38b979[_0x42a3('0x39')];_0x4cb66c++){var _0x2cbc71=_[_0x42a3('0x49')](_0x1df87a,[_0x42a3('0x2e'),_0x38b979[_0x4cb66c][_0x42a3('0x2e')]]);if(_0x2cbc71[_0x42a3('0x74')]){var _0x48d397={};_0x48d397[_0x2cbc71['foreignKey']]=_0x38b979[_0x4cb66c]['associatedResources'];_0x2dee7b[_0x42a3('0x5f')](_0x48d397);}else{if(!_0x202c46['where']['id'])_0x202c46[_0x42a3('0x3e')]['id']=[];_0x38b979[_0x4cb66c][_0x42a3('0x76')][_0x42a3('0x78')](function(_0x4a9d7e){_0x202c46[_0x42a3('0x3e')]['id']['push'](_0x4a9d7e);});}}}if(!_[_0x42a3('0x71')](_0x2dee7b)){_0x202c46['where']=_[_0x42a3('0x3f')](_0x202c46[_0x42a3('0x3e')],{'$and':{'$or':_0x2dee7b}});}_0x202c46=_[_0x42a3('0x3f')]({},_0x202c46,_0x43f82c[_0x42a3('0x43')]);if(_0x521e8f&&!_0x521e8f[_0x42a3('0x56')]&&_0x50f0d5['childModel']===_0x42a3('0x75')){if(_0x43f82c[_0x42a3('0x34')]['includeAll']){_0x202c46[_0x42a3('0x45')]=[{'all':!![]}];}return db[_0x50f0d5[_0x42a3('0x6b')]]['findAll'](_0x202c46)[_0x42a3('0x2a')](function(_0x38bf8a){var _0x398606=[];_0x38bf8a[_0x42a3('0x78')](function(_0x4453aa){var _0x5c54f7;switch(_0x4453aa[_0x42a3('0x79')]){case'default':_0x5c54f7=_[_0x42a3('0x49')](_0x521e8f['associatedResources'],function(_0x9c944e){return _0x9c944e['id']===_0x4453aa['reportId']&&_0x9c944e[_0x42a3('0x40')]===_0x42a3('0x7a');});break;case'custom':_0x5c54f7=_[_0x42a3('0x49')](_0x521e8f[_0x42a3('0x76')],function(_0x37284e){return _0x37284e['id']===_0x4453aa[_0x42a3('0x7b')]&&_0x37284e[_0x42a3('0x40')]===_0x42a3('0x7c');});break;}if(_0x5c54f7)_0x398606[_0x42a3('0x5f')](_0x4453aa);});_0x259972[_0x42a3('0x20')]=_0x398606['length'];_0x259972['rows']=_0x398606;return _0x259972;});}else{return db[_0x50f0d5[_0x42a3('0x6b')]][_0x42a3('0x20')]({'where':_0x202c46[_0x42a3('0x3e')]})[_0x42a3('0x2a')](function(_0x209f79){_0x259972[_0x42a3('0x20')]=_0x209f79;if(_0x43f82c['query'][_0x42a3('0x44')]){if(_0x50f0d5['childModel']===_0x42a3('0x7d')){_0x202c46['include']=[{'model':db['Tag'],'as':_0x42a3('0x7e'),'attributes':['id',_0x42a3('0x2e'),_0x42a3('0x7f')],'required':_0x43f82c['query'][_0x42a3('0x80')]?!![]:![]},{'model':db[_0x42a3('0x81')],'as':_0x42a3('0x82'),'attributes':['id',_0x42a3('0x2e'),_0x42a3('0x7f')],'through':_0x43f82c['query']['tag']?{'attributes':[],'where':{'TagId':_0x43f82c['query'][_0x42a3('0x80')]||undefined}}:{},'required':_0x43f82c[_0x42a3('0x34')][_0x42a3('0x80')]?!![]:![]}];}else{_0x202c46[_0x42a3('0x45')]=[{'all':!![]}];}}return db[_0x50f0d5[_0x42a3('0x6b')]][_0x42a3('0x58')](_0x202c46);})['then'](function(_0x45fcf9){_0x259972[_0x42a3('0x46')]=_0x45fcf9;return _0x259972;});}}else{return _0x259972;}})[_0x42a3('0x2a')](respondWithFilteredResult(_0x4d91af,_0x202c46))[_0x42a3('0x47')](handleError(_0x4d91af,null));};function getAllResources(_0x3acfb6,_0x5d28e1){return new BPromise(function(_0x37f531,_0x437cad){if(_0x5d28e1){var _0x5f2afb=_0x5d28e1[_0x42a3('0x3d')]?{[_0x5d28e1[_0x42a3('0x3d')][_0x42a3('0x74')]]:_0x5d28e1['filter'][_0x42a3('0x83')]}:undefined;return db[_0x3acfb6][_0x42a3('0x58')]({'where':_0x5f2afb,'raw':!![]})['then'](function(_0x1adfc8){_0x5d28e1[_0x42a3('0x76')]=_[_0x42a3('0x59')](_0x1adfc8,'id');_0x37f531(_0x5d28e1);})['catch'](function(_0x1b8420){_0x437cad(_0x1b8420);});}else{_0x37f531(null);}});}function getAllFilteredResources(_0x5da2f9,_0x58a7ae){return new BPromise(function(_0x48814e,_0x12370c){var _0x2ab81c=_0x5da2f9[_0x42a3('0x3d')]?{[_0x5da2f9[_0x42a3('0x3d')][_0x42a3('0x74')]]:_0x5da2f9[_0x42a3('0x3d')]['value']}:undefined;return db[_0x5da2f9[_0x42a3('0x32')]]['findAll']({'where':_0x2ab81c,'raw':!![]})[_0x42a3('0x2a')](function(_0x5c1be2){_0x58a7ae['associatedResources']=_[_0x42a3('0x59')](_0x5c1be2,function(_0x720a1f){return _0x720a1f[_0x42a3('0x2e')];});_0x48814e(_0x58a7ae);})[_0x42a3('0x47')](function(_0x16a6e0){_0x12370c(_0x16a6e0);});});}function getAllowedResources(_0x1ed757,_0x85d625,_0x4fe2b9){return new BPromise(function(_0x17f629,_0x5830e1){if(_0x85d625){return db[_0x42a3('0x57')][_0x42a3('0x58')]({'where':{'sectionId':_0x85d625['id']},'raw':!![]})[_0x42a3('0x2a')](function(_0xaa5ec2){if(_0x1ed757[_0x42a3('0x74')]&&_0x1ed757['field']!=='id'){_0x85d625[_0x42a3('0x76')]=_['map'](_0xaa5ec2,function(_0x42c07c){return _0x42c07c[_0x1ed757['field']];});}else{if(_0x4fe2b9===_0x42a3('0x75')){_0x85d625[_0x42a3('0x76')]=_['map'](_0xaa5ec2,function(_0x33c0c9){return{'id':_0x33c0c9['resourceId'],'type':_0x33c0c9[_0x42a3('0x40')]};});}else{_0x85d625['associatedResources']=_['map'](_0xaa5ec2,function(_0x36e0fe){return _0x36e0fe['resourceId'];});}}_0x17f629(_0x85d625);})[_0x42a3('0x47')](function(_0x79ef00){_0x5830e1(_0x79ef00);});}else{_0x17f629(null);}});}function getQueryModels(_0x18134a,_0x1f3b78){var _0x45d4d6=_0x18134a[_0x42a3('0x84')]();var _0x47afb0={'childModel':undefined,'parentSections':[]};switch(_0x45d4d6){case'squareprojects':_0x47afb0['childModel']=_0x42a3('0x85');break;case _0x42a3('0x86'):_0x47afb0[_0x42a3('0x6b')]='SquareOdbc';break;case _0x42a3('0x87'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0x88');_0x47afb0['parentSections']=[{'name':_0x42a3('0x89'),'field':_0x42a3('0x2e'),'foreignKey':'projectName'}];break;case'projects':_0x47afb0['childModel']=_0x42a3('0x8a');break;case'contacts':_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0x7d');_0x47afb0[_0x42a3('0x6d')]=[{'name':_0x42a3('0x8b'),'field':'id','foreignKey':_0x42a3('0x8c')}];break;case _0x42a3('0x8d'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0x8e');break;case _0x42a3('0x8f'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0x90');break;case _0x42a3('0x91'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0x92');break;case _0x42a3('0x93'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0x94');break;case _0x42a3('0x95'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0x96');break;case _0x42a3('0x97'):_0x47afb0['childModel']=_0x42a3('0x98');break;case _0x42a3('0x99'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0x9a');break;case _0x42a3('0x9b'):case _0x42a3('0x9c'):case _0x42a3('0x9d'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0x9e');break;case _0x42a3('0x9f'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0xa0');break;case _0x42a3('0xa1'):_0x47afb0['childModel']=_0x42a3('0xa2');break;case'voicerecordings':_0x47afb0[_0x42a3('0x6b')]='VoiceRecording';_0x47afb0['parentSections']=[{'name':_0x42a3('0xa3'),'field':_0x42a3('0x2e'),'foreignKey':_0x42a3('0xa4'),'model':_0x42a3('0xa5'),'filter':{'field':_0x42a3('0xa6'),'value':[_0x42a3('0xa7')]}},{'name':_0x42a3('0xa8'),'field':_0x42a3('0x2e'),'foreignKey':_0x42a3('0xa4'),'model':_0x42a3('0xa5'),'filter':{'field':_0x42a3('0xa6'),'value':[_0x42a3('0xa9')]}},{'name':_0x42a3('0xaa'),'field':_0x42a3('0x2e'),'foreignKey':_0x42a3('0xab'),'model':_0x42a3('0xac'),'filter':{'field':_0x42a3('0x40'),'value':['inbound']}},{'name':'QueueCampaigns','field':_0x42a3('0x2e'),'foreignKey':_0x42a3('0xab'),'model':'VoiceQueue','filter':{'field':_0x42a3('0x40'),'value':[_0x42a3('0xad')]}}];break;case _0x42a3('0xae'):_0x47afb0['childModel']=_0x42a3('0xaf');break;case _0x42a3('0xb0'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0xb1');break;case _0x42a3('0xb2'):_0x47afb0[_0x42a3('0x6b')]='VoicePrefix';break;case _0x42a3('0xb3'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0xb4');break;case _0x42a3('0xb5'):_0x47afb0['childModel']=_0x42a3('0xb6');break;case'mailaccounts':_0x47afb0[_0x42a3('0x6b')]='MailAccount';break;case _0x42a3('0xb7'):_0x47afb0['childModel']=_0x42a3('0xb8');break;case _0x42a3('0xb9'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0xba');break;case'openchannelaccounts':_0x47afb0[_0x42a3('0x6b')]='OpenchannelAccount';break;case _0x42a3('0xbb'):_0x47afb0[_0x42a3('0x6b')]='SmsQueue';break;case _0x42a3('0xbc'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0xbd');break;case _0x42a3('0xbe'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0xbf');break;case'voicequeues':case _0x42a3('0xc0'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0xac');if(_0x1f3b78){_0x47afb0[_0x42a3('0x6d')]=[{'name':'VoiceQueues'},{'name':_0x42a3('0xc1')}];}break;case'users':case'agents':case'telephones':_0x47afb0['childModel']=_0x42a3('0xa5');if(_0x1f3b78){_0x47afb0['parentSections']=[{'name':_0x42a3('0xc2'),'filter':{'field':_0x42a3('0xa6'),'value':[_0x42a3('0xc3'),_0x42a3('0xc4')]},'ignore':!![]},{'name':_0x42a3('0xa3')},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x47afb0['childModel']=_0x42a3('0xc5');break;case'salesforceaccounts':_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0xc6');break;case _0x42a3('0xc7'):_0x47afb0['childModel']=_0x42a3('0xc8');break;case'sugarcrmaccounts':_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0xc9');break;case'deskaccounts':_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0xca');break;case _0x42a3('0xcb'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0xcc');break;case _0x42a3('0xcd'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0xa5');break;case _0x42a3('0xce'):_0x47afb0['childModel']=_0x42a3('0xcf');break;case _0x42a3('0xd0'):_0x47afb0[_0x42a3('0x6b')]='Disposition';break;case _0x42a3('0xd1'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0xd2');break;case _0x42a3('0xd3'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0xd4');break;case'pauses':_0x47afb0['childModel']=_0x42a3('0xd5');break;case _0x42a3('0xd6'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0xd7');break;case _0x42a3('0xd8'):_0x47afb0['childModel']='Sound';break;case _0x42a3('0xd9'):_0x47afb0[_0x42a3('0x6b')]='Tag';break;case _0x42a3('0xda'):_0x47afb0[_0x42a3('0x6b')]='Template';break;case _0x42a3('0xdb'):_0x47afb0['childModel']=_0x42a3('0xdc');break;case _0x42a3('0xdd'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0xde');break;case _0x42a3('0xdf'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0xe0');break;case _0x42a3('0xe1'):_0x47afb0[_0x42a3('0x6b')]='Plugin';break;case _0x42a3('0xe2'):_0x47afb0['childModel']=_0x42a3('0x75');_0x47afb0['parentSections']=[{'name':_0x42a3('0xe3'),'field':'id','foreignKey':_0x42a3('0x7b')}];break;case _0x42a3('0xe4'):_0x47afb0[_0x42a3('0x6b')]=_0x42a3('0xe5');break;default:return _0x47afb0;}return _0x47afb0;} \ No newline at end of file +var _0x9b4e=['voicequeues','queuecampaigns','VoiceQueues','users','Users','admin','user','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','Disposition','customdashboards','intervals','Interval','pauses','Pause','sounds','Sound','tags','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','Plugin','extractedreports','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./userProfile.socket','register','status','end','json','count','limit','set','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','UserProfile','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','fields','find','catch','create','body','clone','params','get','createdAt','updatedAt','crudPermissions','omit','sequelize','transaction','autoAssociation','UserProfileResource','sectionId','Resources','UserProfileSection','describe','addSections','each','push','removeSections','addResources','userProfileId','bulkCreate','removeResources','ids','getResources','section','ValidationError','Unknown\x20section','mergeResources','childModel','undefined','Sequelize','Invalid\x20section\x20\x27','parentSections','findOne','ignore','isEmpty','union','all','AnalyticExtractedReport','foreignKey','associatedResources','forEach','reportType','default','reportId','DefaultReports','custom','CustomReports','rows','Tags','tag','Tag','ThroughTags','color','value','resourceId','toLowerCase','squareprojects','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','contacts','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','VoiceQueue','inbound','QueueCampaigns','queue','outbound','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','teams','Team'];(function(_0x126f47,_0x2199e9){var _0x49508a=function(_0x20ba36){while(--_0x20ba36){_0x126f47['push'](_0x126f47['shift']());}};_0x49508a(++_0x2199e9);}(_0x9b4e,0x1e7));var _0xe9b4=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9b4e[_0x397e5f];return _0x5302b8;};'use strict';var pdf=require(_0xe9b4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe9b4('0x1'));var zipdir=require(_0xe9b4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe9b4('0x3'));var moment=require(_0xe9b4('0x4'));var BPromise=require(_0xe9b4('0x5'));var Mustache=require(_0xe9b4('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe9b4('0x7'));var csv=require('to-csv');var ejs=require(_0xe9b4('0x8'));var fs=require('fs');var _=require(_0xe9b4('0x9'));var squel=require(_0xe9b4('0xa'));var crypto=require('crypto');var jsforce=require(_0xe9b4('0xb'));var deskjs=require(_0xe9b4('0xc'));var toCsv=require(_0xe9b4('0xd'));var querystring=require(_0xe9b4('0xe'));var Papa=require(_0xe9b4('0xf'));var Redis=require('ioredis');var authService=require(_0xe9b4('0x10'));var qs=require(_0xe9b4('0x11'));var hardwareService=require(_0xe9b4('0x12'));var logger=require(_0xe9b4('0x13'))('api');var utils=require(_0xe9b4('0x14'));var config=require(_0xe9b4('0x15'));var db=require(_0xe9b4('0x16'))['db'];config[_0xe9b4('0x17')]=_['defaults'](config[_0xe9b4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xe9b4('0x18'))(new Redis(config[_0xe9b4('0x17')]));require(_0xe9b4('0x19'))[_0xe9b4('0x1a')](socket);function respondWithStatusCode(_0x148d3f,_0xd428a8){_0xd428a8=_0xd428a8||0xcc;return function(_0x2e8e85){if(_0x2e8e85){return _0x148d3f['sendStatus'](_0xd428a8);}return _0x148d3f[_0xe9b4('0x1b')](_0xd428a8)[_0xe9b4('0x1c')]();};}function respondWithResult(_0x390120,_0x13db94){_0x13db94=_0x13db94||0xc8;return function(_0x230229){if(_0x230229){return _0x390120[_0xe9b4('0x1b')](_0x13db94)[_0xe9b4('0x1d')](_0x230229);}};}function respondWithFilteredResult(_0xb2027,_0x544abc){return function(_0x460e97){if(_0x460e97){var _0x35968d=_0x460e97[_0xe9b4('0x1e')],_0x1598f6=_0x544abc['offset'],_0x3445be=_0x544abc['offset']+_0x544abc[_0xe9b4('0x1f')],_0x4be11e;if(_0x3445be>=_0x35968d){_0x3445be=_0x35968d;_0x4be11e=0xc8;}else{_0x4be11e=0xce;}_0xb2027[_0xe9b4('0x1b')](_0x4be11e);return _0xb2027[_0xe9b4('0x20')]('Content-Range',_0x1598f6+'-'+_0x3445be+'/'+_0x35968d)[_0xe9b4('0x1d')](_0x460e97);}return null;};}function patchUpdates(_0x193cb3){return function(_0x5273d8){try{jsonpatch[_0xe9b4('0x21')](_0x5273d8,_0x193cb3,!![]);}catch(_0x25fe07){return BPromise[_0xe9b4('0x22')](_0x25fe07);}return _0x5273d8[_0xe9b4('0x23')]();};}function saveUpdates(_0x49d4c9,_0x49c52e){return function(_0x2120c4){if(_0x2120c4){return _0x2120c4[_0xe9b4('0x24')](_0x49d4c9)['then'](function(_0x2286e4){return _0x2286e4;});}return null;};}function removeEntity(_0x41d6b6,_0x2c9b9f){return function(_0x396095){if(_0x396095){return _0x396095[_0xe9b4('0x25')]()[_0xe9b4('0x26')](function(){_0x41d6b6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269a0e,_0x9d1d91){return function(_0x3f0dc0){if(!_0x3f0dc0){_0x269a0e[_0xe9b4('0x27')](0x194);}return _0x3f0dc0;};}function handleError(_0x2259af,_0x44367d){_0x44367d=_0x44367d||0x1f4;return function(_0x597fab){logger[_0xe9b4('0x28')](_0x597fab[_0xe9b4('0x29')]);if(_0x597fab[_0xe9b4('0x2a')]){delete _0x597fab[_0xe9b4('0x2a')];}_0x2259af[_0xe9b4('0x1b')](_0x44367d)[_0xe9b4('0x2b')](_0x597fab);};}exports[_0xe9b4('0x2c')]=function(_0x1a68ce,_0x808b58){var _0x1bce4d={},_0x3b174c={},_0x40f7e4={'count':0x0,'rows':[]};var _0x15379d=db[_0xe9b4('0x2d')][_0xe9b4('0x2e')];_0x3b174c[_0xe9b4('0x2f')]=_[_0xe9b4('0x30')](_0x15379d);_0x3b174c[_0xe9b4('0x31')]=_[_0xe9b4('0x30')](_0x1a68ce['query']);_0x3b174c[_0xe9b4('0x32')]=_[_0xe9b4('0x33')](_0x3b174c[_0xe9b4('0x2f')],_0x3b174c[_0xe9b4('0x31')]);_0x1bce4d[_0xe9b4('0x34')]=_[_0xe9b4('0x33')](_0x3b174c[_0xe9b4('0x2f')],qs['fields'](_0x1a68ce[_0xe9b4('0x31')]['fields']));_0x1bce4d['attributes']=_0x1bce4d['attributes'][_0xe9b4('0x35')]?_0x1bce4d[_0xe9b4('0x34')]:_0x3b174c[_0xe9b4('0x2f')];if(!_0x1a68ce[_0xe9b4('0x31')][_0xe9b4('0x36')](_0xe9b4('0x37'))){_0x1bce4d[_0xe9b4('0x1f')]=qs[_0xe9b4('0x1f')](_0x1a68ce['query']['limit']);_0x1bce4d[_0xe9b4('0x38')]=qs[_0xe9b4('0x38')](_0x1a68ce[_0xe9b4('0x31')][_0xe9b4('0x38')]);}_0x1bce4d['order']=qs[_0xe9b4('0x39')](_0x1a68ce[_0xe9b4('0x31')][_0xe9b4('0x39')]);_0x1bce4d[_0xe9b4('0x3a')]=qs[_0xe9b4('0x32')](_[_0xe9b4('0x3b')](_0x1a68ce[_0xe9b4('0x31')],_0x3b174c[_0xe9b4('0x32')]));if(_0x1a68ce[_0xe9b4('0x31')][_0xe9b4('0x3c')]){_0x1bce4d[_0xe9b4('0x3a')]=_[_0xe9b4('0x3d')](_0x1bce4d[_0xe9b4('0x3a')],{'$or':_[_0xe9b4('0x3e')](_0x15379d,function(_0x4b84a4){if(_0x4b84a4[_0xe9b4('0x3f')][_0xe9b4('0x40')]!==_0xe9b4('0x41')){var _0x7b17b5={};_0x7b17b5[_0x4b84a4[_0xe9b4('0x42')]]={'$like':'%'+_0x1a68ce[_0xe9b4('0x31')][_0xe9b4('0x3c')]+'%'};return _0x7b17b5;}})});}_0x1bce4d=_[_0xe9b4('0x3d')]({},_0x1bce4d,_0x1a68ce[_0xe9b4('0x43')]);var _0x48e39a={'where':_0x1bce4d[_0xe9b4('0x3a')]};return db[_0xe9b4('0x2d')][_0xe9b4('0x1e')](_0x48e39a)['then'](function(_0x45fa28){_0x40f7e4[_0xe9b4('0x1e')]=_0x45fa28;if(_0x1a68ce[_0xe9b4('0x31')][_0xe9b4('0x44')]){_0x1bce4d[_0xe9b4('0x45')]=[{'all':!![]}];}return db['UserProfile'][_0xe9b4('0x46')](_0x1bce4d);})[_0xe9b4('0x26')](function(_0x3a00a2){_0x40f7e4['rows']=_0x3a00a2;return _0x40f7e4;})[_0xe9b4('0x26')](respondWithFilteredResult(_0x808b58,_0x1bce4d))['catch'](handleError(_0x808b58,null));};exports['show']=function(_0x48e8cc,_0x54c3ad){var _0x138150={'raw':![],'where':{'id':_0x48e8cc['params']['id']}},_0x13e64d={};_0x13e64d[_0xe9b4('0x2f')]=_[_0xe9b4('0x30')](db[_0xe9b4('0x2d')][_0xe9b4('0x2e')]);_0x13e64d[_0xe9b4('0x31')]=_[_0xe9b4('0x30')](_0x48e8cc['query']);_0x13e64d[_0xe9b4('0x32')]=_[_0xe9b4('0x33')](_0x13e64d[_0xe9b4('0x2f')],_0x13e64d[_0xe9b4('0x31')]);_0x138150[_0xe9b4('0x34')]=_[_0xe9b4('0x33')](_0x13e64d['model'],qs[_0xe9b4('0x47')](_0x48e8cc[_0xe9b4('0x31')]['fields']));_0x138150[_0xe9b4('0x34')]=_0x138150[_0xe9b4('0x34')][_0xe9b4('0x35')]?_0x138150['attributes']:_0x13e64d[_0xe9b4('0x2f')];if(_0x48e8cc['query'][_0xe9b4('0x44')]){_0x138150[_0xe9b4('0x45')]=[{'all':!![]}];}_0x138150=_[_0xe9b4('0x3d')]({},_0x138150,_0x48e8cc[_0xe9b4('0x43')]);return db[_0xe9b4('0x2d')][_0xe9b4('0x48')](_0x138150)[_0xe9b4('0x26')](handleEntityNotFound(_0x54c3ad,null))['then'](respondWithResult(_0x54c3ad,null))[_0xe9b4('0x49')](handleError(_0x54c3ad,null));};exports[_0xe9b4('0x4a')]=function(_0x2bff33,_0x26f5a6){return db[_0xe9b4('0x2d')]['create'](_0x2bff33[_0xe9b4('0x4b')],{})['then'](respondWithResult(_0x26f5a6,0xc9))[_0xe9b4('0x49')](handleError(_0x26f5a6,null));};exports[_0xe9b4('0x4c')]=function(_0x2bc986,_0x11c646){var _0x313cce={'raw':![],'where':{'id':_0x2bc986[_0xe9b4('0x4d')]['id']}},_0x184bdb={};_0x184bdb[_0xe9b4('0x2f')]=_[_0xe9b4('0x30')](db[_0xe9b4('0x2d')][_0xe9b4('0x2e')]);_0x313cce[_0xe9b4('0x34')]=_[_0xe9b4('0x33')](_0x184bdb[_0xe9b4('0x2f')],qs[_0xe9b4('0x47')](_0x2bc986['query'][_0xe9b4('0x47')]));_0x313cce[_0xe9b4('0x34')]=_0x313cce['attributes'][_0xe9b4('0x35')]?_0x313cce[_0xe9b4('0x34')]:_0x184bdb[_0xe9b4('0x2f')];if(_0x2bc986['query'][_0xe9b4('0x44')]){_0x313cce[_0xe9b4('0x45')]=[{'all':!![]}];}_0x313cce=_[_0xe9b4('0x3d')]({},_0x313cce,_0x2bc986[_0xe9b4('0x43')]);return db[_0xe9b4('0x2d')][_0xe9b4('0x48')](_0x313cce)[_0xe9b4('0x26')](handleEntityNotFound(_0x11c646,null))['then'](function(_0x59c983){if(_0x59c983){var _0x23ce9a=_0x59c983[_0xe9b4('0x4e')]({'plain':!![]});_0x23ce9a=qs['omit'](_0x23ce9a,['id',_0xe9b4('0x4f'),_0xe9b4('0x50'),_0xe9b4('0x51')]);_0x2bc986['body']=_[_0xe9b4('0x52')](_0x2bc986[_0xe9b4('0x4b')],['id',_0xe9b4('0x4f'),_0xe9b4('0x50')]);return db[_0xe9b4('0x53')][_0xe9b4('0x54')](function(_0xedea2f){return db[_0xe9b4('0x2d')]['create'](_[_0xe9b4('0x3d')](_0x23ce9a,_0x2bc986[_0xe9b4('0x4b')]),{'include':_0x2bc986['query'][_0xe9b4('0x44')]?[{'all':!![]}]:undefined,'transaction':_0xedea2f})[_0xe9b4('0x26')](function(_0x31e079){var _0x4c924a=_0x31e079['get']({'plain':!![]});return db['UserProfileSection'][_0xe9b4('0x46')]({'where':{'userProfileId':_0x2bc986['params']['id']},'raw':!![]})[_0xe9b4('0x26')](function(_0x284f03){if(_0x284f03){return BPromise['each'](_0x284f03,function(_0x5491fa){return new BPromise(function(_0x59bd64,_0x52e08c){if(_0x5491fa[_0xe9b4('0x55')]===null||_0x5491fa[_0xe9b4('0x55')]===0x1)_0x59bd64(null);return db[_0xe9b4('0x56')][_0xe9b4('0x46')]({'where':{'sectionId':_0x5491fa['id']},'raw':!![]})['then'](function(_0x5315e4){var _0x4af73e=_[_0xe9b4('0x3e')](_0x5315e4,function(_0x5e5205){return qs['omit'](_0x5e5205,['id',_0xe9b4('0x4f'),_0xe9b4('0x50'),_0xe9b4('0x57')]);});_0x59bd64(_0x4af73e);})['catch'](function(_0x2cc1f1){_0x52e08c(_0x2cc1f1);});})[_0xe9b4('0x26')](function(_0x2bf7e9){var _0x37fa32=qs['omit'](_0x5491fa,['id',_0xe9b4('0x4f'),_0xe9b4('0x50')]);_0x37fa32['userProfileId']=_0x4c924a['id'];if(_0x2bf7e9)_0x37fa32[_0xe9b4('0x58')]=_0x2bf7e9;return _0x37fa32;})[_0xe9b4('0x26')](function(_0x4f42e4){return db[_0xe9b4('0x59')][_0xe9b4('0x4a')](_0x4f42e4,{'include':[{'model':db[_0xe9b4('0x56')],'as':_0xe9b4('0x58')}],'raw':!![],'transaction':_0xedea2f});});})[_0xe9b4('0x26')](function(){return _0x4c924a;});}});});});}})[_0xe9b4('0x26')](respondWithResult(_0x11c646,0xc9))[_0xe9b4('0x49')](handleError(_0x11c646,null));};exports['update']=function(_0xc05b5f,_0x36b2f6){if(_0xc05b5f[_0xe9b4('0x4b')]['id']){delete _0xc05b5f[_0xe9b4('0x4b')]['id'];}return db['UserProfile']['find']({'where':{'id':_0xc05b5f[_0xe9b4('0x4d')]['id']}})[_0xe9b4('0x26')](handleEntityNotFound(_0x36b2f6,null))[_0xe9b4('0x26')](saveUpdates(_0xc05b5f[_0xe9b4('0x4b')],null))[_0xe9b4('0x26')](respondWithResult(_0x36b2f6,null))['catch'](handleError(_0x36b2f6,null));};exports[_0xe9b4('0x25')]=function(_0x5aeba9,_0x3c448b){return db[_0xe9b4('0x2d')][_0xe9b4('0x48')]({'where':{'id':_0x5aeba9[_0xe9b4('0x4d')]['id']}})[_0xe9b4('0x26')](handleEntityNotFound(_0x3c448b,null))[_0xe9b4('0x26')](removeEntity(_0x3c448b,null))['catch'](handleError(_0x3c448b,null));};exports[_0xe9b4('0x5a')]=function(_0xfa83b,_0x23050f){return db[_0xe9b4('0x2d')][_0xe9b4('0x5a')]()[_0xe9b4('0x26')](respondWithResult(_0x23050f,null))[_0xe9b4('0x49')](handleError(_0x23050f,null));};exports[_0xe9b4('0x5b')]=function(_0x1918d2,_0x5b7742){var _0x552f47=_0x1918d2[_0xe9b4('0x4b')];return db[_0xe9b4('0x2d')]['find']({'where':{'id':_0x1918d2[_0xe9b4('0x4d')]['id']}})[_0xe9b4('0x26')](handleEntityNotFound(_0x5b7742,null))[_0xe9b4('0x26')](function(_0x492769){if(_0x492769){return db[_0xe9b4('0x53')]['transaction'](function(_0x326751){return db[_0xe9b4('0x59')][_0xe9b4('0x25')]({'where':{'userProfileId':_0x1918d2[_0xe9b4('0x4d')]['id'],'sectionId':_[_0xe9b4('0x3e')](_0x552f47,function(_0x41f031){return _0x41f031[_0xe9b4('0x57')];})},'transaction':_0x326751})[_0xe9b4('0x26')](function(){var _0x88be37=_[_0xe9b4('0x3e')](_0x552f47,function(_0x51dc87){_0x51dc87['userProfileId']=_0x1918d2['params']['id'];return _0x51dc87;});var _0x4fcdc3=[];return BPromise[_0xe9b4('0x5c')](_0x88be37,function(_0x598092){return db[_0xe9b4('0x59')][_0xe9b4('0x4a')](_0x598092,{'include':[{'model':db[_0xe9b4('0x56')],'as':_0xe9b4('0x58')}],'raw':!![],'transaction':_0x326751})['then'](function(_0xefa34e){_0x4fcdc3[_0xe9b4('0x5d')](_0xefa34e[_0xe9b4('0x4e')]({'plain':!![]}));});})[_0xe9b4('0x26')](function(){return _0x4fcdc3;});});});}})[_0xe9b4('0x26')](function(_0x30bfc5){return _0x30bfc5;})[_0xe9b4('0x26')](respondWithResult(_0x5b7742,null))['catch'](handleError(_0x5b7742,null));};exports[_0xe9b4('0x5e')]=function(_0x1729ea,_0x49f895){var _0x232d98;return db[_0xe9b4('0x2d')]['find']({'where':{'id':_0x1729ea[_0xe9b4('0x4d')]['id']},'attributes':['id','name']})[_0xe9b4('0x26')](handleEntityNotFound(_0x49f895,null))['then'](function(_0x5632a0){if(_0x5632a0){_0x232d98=_0x5632a0;return db[_0xe9b4('0x59')][_0xe9b4('0x25')]({'where':{'userProfileId':_0x1729ea['params']['id'],'sectionId':_0x1729ea[_0xe9b4('0x31')]['ids']}});}})[_0xe9b4('0x26')](function(){return _0x232d98;})[_0xe9b4('0x26')](respondWithStatusCode(_0x49f895,null))['catch'](handleError(_0x49f895,null));};exports[_0xe9b4('0x5f')]=function(_0x4e3d54,_0x2046f0){return db[_0xe9b4('0x2d')][_0xe9b4('0x48')]({'where':{'id':_0x4e3d54[_0xe9b4('0x4d')]['id']}})[_0xe9b4('0x26')](handleEntityNotFound(_0x2046f0,null))[_0xe9b4('0x26')](function(_0xaa6bbe){if(_0xaa6bbe){return db[_0xe9b4('0x53')][_0xe9b4('0x54')](function(_0x535f83){return db[_0xe9b4('0x59')][_0xe9b4('0x46')]({'where':{'userProfileId':_0x4e3d54[_0xe9b4('0x4d')]['id']},'attributes':['id'],'raw':!![]})[_0xe9b4('0x26')](function(_0x57fe45){if(_0x57fe45){return db[_0xe9b4('0x59')][_0xe9b4('0x25')]({'where':{'userProfileId':_0x4e3d54[_0xe9b4('0x4d')]['id'],'id':_[_0xe9b4('0x3e')](_0x57fe45,function(_0x298401){return _0x298401['id'];})},'transaction':_0x535f83});}})['then'](function(_0x2d4584){var _0x5a4f6a=_[_0xe9b4('0x3e')](_0x4e3d54[_0xe9b4('0x4b')],function(_0x24ad92){_0x24ad92[_0xe9b4('0x60')]=_0x4e3d54['params']['id'];return _0x24ad92;});return db[_0xe9b4('0x59')][_0xe9b4('0x61')](_0x5a4f6a,{'raw':!![],'transaction':_0x535f83});})[_0xe9b4('0x26')](function(_0x4ec714){var _0xcbd67=_[_0xe9b4('0x3c')](_['map'](_0x4ec714,function(_0x22b65e){return _0x22b65e[_0xe9b4('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0xcbd67){return db[_0xe9b4('0x59')][_0xe9b4('0x46')]({'where':{'userProfileId':_0x4e3d54[_0xe9b4('0x4d')]['id'],'sectionId':_[_0xe9b4('0x3e')](_0xcbd67,function(_0xb3d030){return _0xb3d030[_0xe9b4('0x57')];})},'attributes':['id',_0xe9b4('0x57')],'raw':!![]})[_0xe9b4('0x26')](function(_0x33c609){var _0x151106=_[_0xe9b4('0x3e')](_0x4e3d54[_0xe9b4('0x4b')],function(_0x524348){_0x524348[_0xe9b4('0x60')]=_0x4e3d54[_0xe9b4('0x4d')]['id'];return _0x524348;});return db[_0xe9b4('0x56')][_0xe9b4('0x61')](_0x151106,{'raw':!![],'transaction':_0x535f83});});}})[_0xe9b4('0x49')](handleError(_0x2046f0,null));});}})['then'](function(_0x5ea56d){var _0x5820ea=_[_0xe9b4('0x3e')](_0x5ea56d,function(_0x1fdd53){return _0x1fdd53['get']({'plain':!![]});});})[_0xe9b4('0x26')](respondWithResult(_0x2046f0,null))[_0xe9b4('0x49')](handleError(_0x2046f0,null));};exports[_0xe9b4('0x62')]=function(_0x5bb7b6,_0x400021,_0x2d3ed8){return db[_0xe9b4('0x2d')]['find']({'where':{'id':_0x5bb7b6[_0xe9b4('0x4d')]['id']}})[_0xe9b4('0x26')](handleEntityNotFound(_0x400021,null))[_0xe9b4('0x26')](function(_0x4cbfa0){if(_0x4cbfa0){return _0x4cbfa0[_0xe9b4('0x62')](_0x5bb7b6[_0xe9b4('0x31')][_0xe9b4('0x63')]);}})[_0xe9b4('0x26')](respondWithStatusCode(_0x400021,null))[_0xe9b4('0x49')](handleError(_0x400021,null));};exports[_0xe9b4('0x64')]=function(_0x2ba66d,_0x5cbe36){var _0x52c3b7={'raw':![],'where':{}};var _0x3f25be={};var _0x2c9ac8={'count':0x0,'rows':[]};var _0x1ec634=_0x2ba66d[_0xe9b4('0x31')][_0xe9b4('0x65')];if(typeof _0x1ec634==='undefined'){throw new db['Sequelize'][(_0xe9b4('0x66'))](_0xe9b4('0x67'));}var _0x26d379=_0x2ba66d[_0xe9b4('0x31')][_0xe9b4('0x68')]||![];var _0x5e8f08=getQueryModels(_0x1ec634,_0x26d379);if(typeof _0x5e8f08[_0xe9b4('0x69')]===_0xe9b4('0x6a')){throw new db[(_0xe9b4('0x6b'))][(_0xe9b4('0x66'))](_0xe9b4('0x6c')+_0x1ec634+'\x27');}var _0x503fe1=[];if(!_['isEmpty'](_0x5e8f08[_0xe9b4('0x6d')])){_0x503fe1=_0x5e8f08[_0xe9b4('0x6d')];}else{_0x503fe1=[{'name':_0x1ec634}];}return db[_0xe9b4('0x2d')][_0xe9b4('0x6e')]({'where':{'id':_0x2ba66d[_0xe9b4('0x4d')]['id']}})[_0xe9b4('0x26')](handleEntityNotFound(_0x5cbe36,null))[_0xe9b4('0x26')](function(_0x2fea15){if(_0x2fea15){var _0x390d50=[];for(var _0x54abf5=0x0;_0x54abf5<_0x503fe1['length'];_0x54abf5++){_0x390d50[_0xe9b4('0x5d')](db['UserProfileSection'][_0xe9b4('0x6e')]({'where':{'userProfileId':_0x2fea15['id'],'name':_0x503fe1[_0x54abf5][_0xe9b4('0x2a')]},'raw':!![]}));}return BPromise['all'](_0x390d50);}})[_0xe9b4('0x26')](function(_0x35b68e){var _0x295191=_[_0xe9b4('0x3c')](_0x35b68e,function(_0x488e30){return _0x488e30?_0x488e30:undefined;});var _0x32f9db=_['filter'](_0x503fe1,[_0xe9b4('0x6f'),!![]]);var _0x205bd8=_[_0xe9b4('0x70')](_0x295191)&&_[_0xe9b4('0x70')](_0x32f9db)?null:_[_0xe9b4('0x71')](_0x32f9db,_0x295191);if(_0x205bd8){var _0x2d47ce=[];for(var _0x27b4d3=0x0;_0x27b4d3<_0x205bd8[_0xe9b4('0x35')];_0x27b4d3++){var _0x433726=_['find'](_0x503fe1,function(_0x57a0c6){return _0x205bd8[_0x27b4d3]?_0x57a0c6[_0xe9b4('0x2a')]===_0x205bd8[_0x27b4d3]['name']:null;});if(_0x433726){if(_0x205bd8[_0x27b4d3]['ignore']){_0x2d47ce['push'](getAllResources(_0x5e8f08[_0xe9b4('0x69')],_0x205bd8[_0x27b4d3]));}else{if(!_0x205bd8[_0x27b4d3][_0xe9b4('0x55')]){_0x2d47ce[_0xe9b4('0x5d')](getAllowedResources(_0x433726,_0x205bd8[_0x27b4d3],_0x5e8f08[_0xe9b4('0x69')]));}else{if(_0x433726[_0xe9b4('0x2f')]){_0x2d47ce['push'](getAllFilteredResources(_0x433726,_0x205bd8[_0x27b4d3]));}}}}}return BPromise[_0xe9b4('0x72')](_0x2d47ce);}else{return null;}})['then'](function(_0x1e63cd){var _0x26db21=_0x1e63cd;var _0x12beb0=null;if(_0x26db21){_0x12beb0=_0x26db21[_0xe9b4('0x35')]===0x1?_0x26db21[0x0]:null;}if(_0x12beb0||_0x26db21){var _0x110988=db[_0x5e8f08[_0xe9b4('0x69')]]['rawAttributes'];_0x3f25be[_0xe9b4('0x2f')]=_['keys'](_0x110988);_0x3f25be['query']=_[_0xe9b4('0x30')](_0x2ba66d[_0xe9b4('0x31')]);_0x3f25be[_0xe9b4('0x32')]=_[_0xe9b4('0x33')](_0x3f25be[_0xe9b4('0x2f')],_0x3f25be['query']);_0x52c3b7[_0xe9b4('0x34')]=_[_0xe9b4('0x33')](_0x3f25be[_0xe9b4('0x2f')],qs[_0xe9b4('0x47')](_0x2ba66d[_0xe9b4('0x31')][_0xe9b4('0x47')]));_0x52c3b7[_0xe9b4('0x34')]=_0x52c3b7['attributes'][_0xe9b4('0x35')]?_0x52c3b7[_0xe9b4('0x34')]:_0x3f25be[_0xe9b4('0x2f')];if(!_0x2ba66d[_0xe9b4('0x31')][_0xe9b4('0x36')](_0xe9b4('0x37'))){_0x52c3b7[_0xe9b4('0x1f')]=qs['limit'](_0x2ba66d[_0xe9b4('0x31')]['limit']);_0x52c3b7[_0xe9b4('0x38')]=qs[_0xe9b4('0x38')](_0x2ba66d['query'][_0xe9b4('0x38')]);}_0x52c3b7['order']=qs[_0xe9b4('0x39')](_0x2ba66d[_0xe9b4('0x31')][_0xe9b4('0x39')]);_0x52c3b7['where']=qs[_0xe9b4('0x32')](_[_0xe9b4('0x3b')](_0x2ba66d[_0xe9b4('0x31')],_0x3f25be[_0xe9b4('0x32')]));if(_0x2ba66d[_0xe9b4('0x31')][_0xe9b4('0x3c')]){_0x52c3b7[_0xe9b4('0x3a')]=_[_0xe9b4('0x3d')](_0x52c3b7[_0xe9b4('0x3a')],{'$or':_['map'](_0x110988,function(_0x149cf3){if(_0x149cf3[_0xe9b4('0x3f')]['key']!==_0xe9b4('0x41')){var _0x5ae01d={};_0x5ae01d[_0x149cf3[_0xe9b4('0x42')]]={'$like':'%'+_0x2ba66d['query'][_0xe9b4('0x3c')]+'%'};return _0x5ae01d;}})});}var _0x4f7c89=[];if(_0x12beb0){var _0x2362fe=_['find'](_0x503fe1,[_0xe9b4('0x2a'),_0x12beb0[_0xe9b4('0x2a')]]);if(_0x2362fe['field']){var _0x118b41={};if(_0x5e8f08[_0xe9b4('0x69')]===_0xe9b4('0x73')){_0x118b41[_0x2362fe[_0xe9b4('0x74')]]=_[_0xe9b4('0x3e')](_0x12beb0[_0xe9b4('0x75')],'id');}else{_0x118b41[_0x2362fe['foreignKey']]=_0x12beb0[_0xe9b4('0x75')];}_0x4f7c89[_0xe9b4('0x5d')](_0x118b41);}else{_0x52c3b7[_0xe9b4('0x3a')]['id']=_0x12beb0[_0xe9b4('0x75')];}}else{for(var _0x4463b1=0x0;_0x4463b1<_0x26db21['length'];_0x4463b1++){var _0x2362fe=_['find'](_0x503fe1,[_0xe9b4('0x2a'),_0x26db21[_0x4463b1][_0xe9b4('0x2a')]]);if(_0x2362fe[_0xe9b4('0x42')]){var _0x118b41={};_0x118b41[_0x2362fe[_0xe9b4('0x74')]]=_0x26db21[_0x4463b1][_0xe9b4('0x75')];_0x4f7c89[_0xe9b4('0x5d')](_0x118b41);}else{if(!_0x52c3b7[_0xe9b4('0x3a')]['id'])_0x52c3b7['where']['id']=[];_0x26db21[_0x4463b1][_0xe9b4('0x75')][_0xe9b4('0x76')](function(_0x2add19){_0x52c3b7['where']['id'][_0xe9b4('0x5d')](_0x2add19);});}}}if(!_[_0xe9b4('0x70')](_0x4f7c89)){_0x52c3b7[_0xe9b4('0x3a')]=_[_0xe9b4('0x3d')](_0x52c3b7[_0xe9b4('0x3a')],{'$and':{'$or':_0x4f7c89}});}_0x52c3b7=_[_0xe9b4('0x3d')]({},_0x52c3b7,_0x2ba66d['options']);if(_0x12beb0&&!_0x12beb0[_0xe9b4('0x55')]&&_0x5e8f08[_0xe9b4('0x69')]===_0xe9b4('0x73')){if(_0x2ba66d[_0xe9b4('0x31')]['includeAll']){_0x52c3b7[_0xe9b4('0x45')]=[{'all':!![]}];}return db[_0x5e8f08[_0xe9b4('0x69')]][_0xe9b4('0x46')](_0x52c3b7)[_0xe9b4('0x26')](function(_0x4eb0d4){var _0x1c4ec5=[];_0x4eb0d4[_0xe9b4('0x76')](function(_0x2ad090){var _0x1dc749;switch(_0x2ad090[_0xe9b4('0x77')]){case _0xe9b4('0x78'):_0x1dc749=_[_0xe9b4('0x48')](_0x12beb0['associatedResources'],function(_0x1a7f50){return _0x1a7f50['id']===_0x2ad090[_0xe9b4('0x79')]&&_0x1a7f50[_0xe9b4('0x3f')]===_0xe9b4('0x7a');});break;case _0xe9b4('0x7b'):_0x1dc749=_[_0xe9b4('0x48')](_0x12beb0[_0xe9b4('0x75')],function(_0x32f066){return _0x32f066['id']===_0x2ad090[_0xe9b4('0x79')]&&_0x32f066[_0xe9b4('0x3f')]===_0xe9b4('0x7c');});break;}if(_0x1dc749)_0x1c4ec5['push'](_0x2ad090);});_0x2c9ac8[_0xe9b4('0x1e')]=_0x1c4ec5[_0xe9b4('0x35')];_0x2c9ac8[_0xe9b4('0x7d')]=_0x1c4ec5;return _0x2c9ac8;});}else{return db[_0x5e8f08[_0xe9b4('0x69')]][_0xe9b4('0x1e')]({'where':_0x52c3b7[_0xe9b4('0x3a')]})['then'](function(_0x315daa){_0x2c9ac8[_0xe9b4('0x1e')]=_0x315daa;if(_0x2ba66d[_0xe9b4('0x31')][_0xe9b4('0x44')]){if(_0x5e8f08['childModel']==='CmContact'){_0x52c3b7[_0xe9b4('0x45')]=[{'model':db['Tag'],'as':_0xe9b4('0x7e'),'attributes':['id',_0xe9b4('0x2a'),'color'],'required':_0x2ba66d[_0xe9b4('0x31')][_0xe9b4('0x7f')]?!![]:![]},{'model':db[_0xe9b4('0x80')],'as':_0xe9b4('0x81'),'attributes':['id',_0xe9b4('0x2a'),_0xe9b4('0x82')],'through':_0x2ba66d['query'][_0xe9b4('0x7f')]?{'attributes':[],'where':{'TagId':_0x2ba66d[_0xe9b4('0x31')][_0xe9b4('0x7f')]||undefined}}:{},'required':_0x2ba66d[_0xe9b4('0x31')][_0xe9b4('0x7f')]?!![]:![]}];}else{_0x52c3b7[_0xe9b4('0x45')]=[{'all':!![]}];}}return db[_0x5e8f08[_0xe9b4('0x69')]]['findAll'](_0x52c3b7);})[_0xe9b4('0x26')](function(_0x3bbf57){_0x2c9ac8[_0xe9b4('0x7d')]=_0x3bbf57;return _0x2c9ac8;});}}else{return _0x2c9ac8;}})['then'](respondWithFilteredResult(_0x5cbe36,_0x52c3b7))[_0xe9b4('0x49')](handleError(_0x5cbe36,null));};function getAllResources(_0xdd73ea,_0x5879b3){return new BPromise(function(_0xe732b1,_0x511224){if(_0x5879b3){var _0x438c35=_0x5879b3[_0xe9b4('0x3c')]?{[_0x5879b3[_0xe9b4('0x3c')][_0xe9b4('0x42')]]:_0x5879b3['filter'][_0xe9b4('0x83')]}:undefined;return db[_0xdd73ea][_0xe9b4('0x46')]({'where':_0x438c35,'raw':!![]})[_0xe9b4('0x26')](function(_0x26168c){_0x5879b3[_0xe9b4('0x75')]=_[_0xe9b4('0x3e')](_0x26168c,'id');_0xe732b1(_0x5879b3);})['catch'](function(_0x3370bc){_0x511224(_0x3370bc);});}else{_0xe732b1(null);}});}function getAllFilteredResources(_0x2b6d77,_0x5b458b){return new BPromise(function(_0x3d2692,_0x1f56f9){var _0xe9df6=_0x2b6d77['filter']?{[_0x2b6d77[_0xe9b4('0x3c')][_0xe9b4('0x42')]]:_0x2b6d77[_0xe9b4('0x3c')]['value']}:undefined;return db[_0x2b6d77[_0xe9b4('0x2f')]]['findAll']({'where':_0xe9df6,'raw':!![]})[_0xe9b4('0x26')](function(_0x4aa56d){_0x5b458b[_0xe9b4('0x75')]=_['map'](_0x4aa56d,function(_0x4e947d){return _0x4e947d[_0xe9b4('0x2a')];});_0x3d2692(_0x5b458b);})['catch'](function(_0x124554){_0x1f56f9(_0x124554);});});}function getAllowedResources(_0x388631,_0x4808e0,_0x3e2500){return new BPromise(function(_0x1a4218,_0x4f04a1){if(_0x4808e0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x4808e0['id']},'raw':!![]})[_0xe9b4('0x26')](function(_0xd7b23a){if(_0x388631['field']&&_0x388631[_0xe9b4('0x42')]!=='id'){_0x4808e0[_0xe9b4('0x75')]=_[_0xe9b4('0x3e')](_0xd7b23a,function(_0xd2306d){return _0xd2306d[_0x388631[_0xe9b4('0x42')]];});}else{if(_0x3e2500===_0xe9b4('0x73')){_0x4808e0[_0xe9b4('0x75')]=_['map'](_0xd7b23a,function(_0x403fc7){return{'id':_0x403fc7['resourceId'],'type':_0x403fc7['type']};});}else{_0x4808e0['associatedResources']=_[_0xe9b4('0x3e')](_0xd7b23a,function(_0x12c674){return _0x12c674[_0xe9b4('0x84')];});}}_0x1a4218(_0x4808e0);})[_0xe9b4('0x49')](function(_0xa075bf){_0x4f04a1(_0xa075bf);});}else{_0x1a4218(null);}});}function getQueryModels(_0x46c5a5,_0x333c15){var _0x30b1a6=_0x46c5a5[_0xe9b4('0x85')]();var _0x42054c={'childModel':undefined,'parentSections':[]};switch(_0x30b1a6){case _0xe9b4('0x86'):_0x42054c[_0xe9b4('0x69')]='SquareProject';break;case'odbc':_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0x87');break;case _0xe9b4('0x88'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0x89');_0x42054c[_0xe9b4('0x6d')]=[{'name':_0xe9b4('0x8a'),'field':_0xe9b4('0x2a'),'foreignKey':_0xe9b4('0x8b')}];break;case _0xe9b4('0x8c'):_0x42054c['childModel']='JscriptyProject';break;case _0xe9b4('0x8d'):_0x42054c[_0xe9b4('0x69')]='CmContact';_0x42054c[_0xe9b4('0x6d')]=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0xe9b4('0x8e'):_0x42054c['childModel']=_0xe9b4('0x8f');break;case _0xe9b4('0x90'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0x91');break;case _0xe9b4('0x92'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0x93');break;case _0xe9b4('0x94'):_0x42054c[_0xe9b4('0x69')]='ChatQueue';break;case'chatwebsites':_0x42054c['childModel']='ChatWebsite';break;case'faxqueues':_0x42054c[_0xe9b4('0x69')]='FaxQueue';break;case _0xe9b4('0x95'):_0x42054c['childModel']=_0xe9b4('0x96');break;case _0xe9b4('0x97'):case _0xe9b4('0x98'):case _0xe9b4('0x99'):_0x42054c[_0xe9b4('0x69')]='VoiceExtension';break;case'contexts':_0x42054c['childModel']='VoiceContext';break;case _0xe9b4('0x9a'):_0x42054c['childModel']=_0xe9b4('0x9b');break;case _0xe9b4('0x9c'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0x9d');_0x42054c['parentSections']=[{'name':_0xe9b4('0x9e'),'field':_0xe9b4('0x2a'),'foreignKey':_0xe9b4('0x9f'),'model':'User','filter':{'field':_0xe9b4('0xa0'),'value':[_0xe9b4('0xa1')]}},{'name':_0xe9b4('0xa2'),'field':_0xe9b4('0x2a'),'foreignKey':'membername','model':_0xe9b4('0xa3'),'filter':{'field':_0xe9b4('0xa0'),'value':[_0xe9b4('0xa4')]}},{'name':'VoiceQueues','field':'name','foreignKey':'queue','model':_0xe9b4('0xa5'),'filter':{'field':_0xe9b4('0x3f'),'value':[_0xe9b4('0xa6')]}},{'name':_0xe9b4('0xa7'),'field':_0xe9b4('0x2a'),'foreignKey':_0xe9b4('0xa8'),'model':_0xe9b4('0xa5'),'filter':{'field':_0xe9b4('0x3f'),'value':[_0xe9b4('0xa9')]}}];break;case'musiconholds':_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xaa');break;case _0xe9b4('0xab'):_0x42054c[_0xe9b4('0x69')]='VoiceChanSpy';break;case _0xe9b4('0xac'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xad');break;case _0xe9b4('0xae'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xaf');break;case _0xe9b4('0xb0'):_0x42054c['childModel']=_0xe9b4('0xb1');break;case'mailaccounts':_0x42054c[_0xe9b4('0x69')]='MailAccount';break;case _0xe9b4('0xb2'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xb3');break;case _0xe9b4('0xb4'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xb5');break;case'openchannelaccounts':_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xb6');break;case _0xe9b4('0xb7'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xb8');break;case'smsaccounts':_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xb9');break;case _0xe9b4('0xba'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xbb');break;case _0xe9b4('0xbc'):case _0xe9b4('0xbd'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xa5');if(_0x333c15){_0x42054c[_0xe9b4('0x6d')]=[{'name':_0xe9b4('0xbe')},{'name':_0xe9b4('0xa7')}];}break;case _0xe9b4('0xbf'):case'agents':case'telephones':_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xa3');if(_0x333c15){_0x42054c[_0xe9b4('0x6d')]=[{'name':_0xe9b4('0xc0'),'filter':{'field':'role','value':[_0xe9b4('0xc1'),_0xe9b4('0xc2')]},'ignore':!![]},{'name':_0xe9b4('0x9e')},{'name':_0xe9b4('0xa2')}];}break;case _0xe9b4('0xc3'):_0x42054c[_0xe9b4('0x69')]='ZendeskAccount';break;case'salesforceaccounts':_0x42054c['childModel']=_0xe9b4('0xc4');break;case _0xe9b4('0xc5'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xc6');break;case _0xe9b4('0xc7'):_0x42054c['childModel']=_0xe9b4('0xc8');break;case _0xe9b4('0xc9'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xca');break;case _0xe9b4('0xcb'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xcc');break;case'vtigeraccounts':_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xa3');break;case _0xe9b4('0xcd'):_0x42054c['childModel']='CannedAnswer';break;case'dispositions':_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xce');break;case _0xe9b4('0xcf'):_0x42054c[_0xe9b4('0x69')]='Dashboard';break;case _0xe9b4('0xd0'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xd1');break;case _0xe9b4('0xd2'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xd3');break;case'scheduler':_0x42054c['childModel']='Schedule';break;case _0xe9b4('0xd4'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xd5');break;case _0xe9b4('0xd6'):_0x42054c['childModel']='Tag';break;case _0xe9b4('0xd7'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xd8');break;case _0xe9b4('0xd9'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xda');break;case _0xe9b4('0xdb'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0xdc');break;case _0xe9b4('0xdd'):_0x42054c['childModel']=_0xe9b4('0xde');break;case'plugins':_0x42054c['childModel']=_0xe9b4('0xdf');break;case _0xe9b4('0xe0'):_0x42054c[_0xe9b4('0x69')]=_0xe9b4('0x73');_0x42054c[_0xe9b4('0x6d')]=[{'name':'Reports','field':'id','foreignKey':_0xe9b4('0x79')}];break;case'metrics':_0x42054c['childModel']='AnalyticMetric';break;default:return _0x42054c;}return _0x42054c;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 0c9b5c7..0d82d83 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 _0xd5e9=['emit','hasOwnProperty','exports','events','UserProfile','save'];(function(_0x176084,_0x3b8911){var _0x1e9bab=function(_0x11f5fd){while(--_0x11f5fd){_0x176084['push'](_0x176084['shift']());}};_0x1e9bab(++_0x3b8911);}(_0xd5e9,0x1c5));var _0x9d5e=function(_0x3fb6b3,_0x32f93e){_0x3fb6b3=_0x3fb6b3-0x0;var _0x4c93e6=_0xd5e9[_0x3fb6b3];return _0x4c93e6;};'use strict';var EventEmitter=require(_0x9d5e('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x9d5e('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9d5e('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x216368){return function(_0x3c1f36,_0xf2a54c,_0x1c002e){UserProfileEvents[_0x9d5e('0x3')](_0x216368+':'+_0x3c1f36['id'],_0x3c1f36);UserProfileEvents['emit'](_0x216368,_0x3c1f36);_0x1c002e(null);};}for(var e in events){if(events[_0x9d5e('0x4')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x9d5e('0x5')]=UserProfileEvents; \ No newline at end of file +var _0xa457=['remove','emit','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x14b62c,_0x23d29f){var _0x36f174=function(_0x32e66d){while(--_0x32e66d){_0x14b62c['push'](_0x14b62c['shift']());}};_0x36f174(++_0x23d29f);}(_0xa457,0x10b));var _0x7a45=function(_0x4fedec,_0x2120ec){_0x4fedec=_0x4fedec-0x0;var _0x4c57df=_0xa457[_0x4fedec];return _0x4c57df;};'use strict';var EventEmitter=require(_0x7a45('0x0'));var UserProfile=require(_0x7a45('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x7a45('0x2')](0x0);var events={'afterCreate':_0x7a45('0x3'),'afterUpdate':_0x7a45('0x4'),'afterDestroy':_0x7a45('0x5')};function emitEvent(_0x2038ed){return function(_0xb26aa8,_0x53f8b5,_0x4e1d1b){UserProfileEvents[_0x7a45('0x6')](_0x2038ed+':'+_0xb26aa8['id'],_0xb26aa8);UserProfileEvents['emit'](_0x2038ed,_0xb26aa8);_0x4e1d1b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x7a45('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 a84ba8a..507c8a5 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 _0x2854=['moment','bluebird','request-promise','rimraf','../../config/environment','./userProfile.attributes','exports','define','UserProfile','user_profiles','lodash','util','../../config/logger','api'];(function(_0x262323,_0x4a81f1){var _0xa963c3=function(_0x5c715e){while(--_0x5c715e){_0x262323['push'](_0x262323['shift']());}};_0xa963c3(++_0x4a81f1);}(_0x2854,0x1e6));var _0x4285=function(_0x35c581,_0x450aed){_0x35c581=_0x35c581-0x0;var _0x318645=_0x2854[_0x35c581];return _0x318645;};'use strict';var _=require(_0x4285('0x0'));var util=require(_0x4285('0x1'));var logger=require(_0x4285('0x2'))(_0x4285('0x3'));var moment=require(_0x4285('0x4'));var BPromise=require(_0x4285('0x5'));var rp=require(_0x4285('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4285('0x7'));var config=require(_0x4285('0x8'));var attributes=require(_0x4285('0x9'));module[_0x4285('0xa')]=function(_0x13f78f,_0x547b0d){return _0x13f78f[_0x4285('0xb')](_0x4285('0xc'),attributes,{'tableName':_0x4285('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f3b=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserProfile','user_profiles','lodash'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x6f3b,0x14f));var _0xb6f3=function(_0x264ca3,_0x65b645){_0x264ca3=_0x264ca3-0x0;var _0x156d1e=_0x6f3b[_0x264ca3];return _0x156d1e;};'use strict';var _=require(_0xb6f3('0x0'));var util=require(_0xb6f3('0x1'));var logger=require('../../config/logger')(_0xb6f3('0x2'));var moment=require('moment');var BPromise=require(_0xb6f3('0x3'));var rp=require(_0xb6f3('0x4'));var fs=require('fs');var path=require(_0xb6f3('0x5'));var rimraf=require(_0xb6f3('0x6'));var config=require(_0xb6f3('0x7'));var attributes=require('./userProfile.attributes');module[_0xb6f3('0x8')]=function(_0x561476,_0x316c4c){return _0x561476[_0xb6f3('0x9')](_0xb6f3('0xa'),attributes,{'tableName':_0xb6f3('0xb'),'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 8adbe99..aefb684 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 _0x33c5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment'];(function(_0x333921,_0x5876e6){var _0x143130=function(_0x5d1e73){while(--_0x5d1e73){_0x333921['push'](_0x333921['shift']());}};_0x143130(++_0x5876e6);}(_0x33c5,0xe6));var _0x533c=function(_0x582274,_0x2cbd9c){_0x582274=_0x582274-0x0;var _0x8f14d3=_0x33c5[_0x582274];return _0x8f14d3;};'use strict';var _=require('lodash');var util=require(_0x533c('0x0'));var moment=require(_0x533c('0x1'));var BPromise=require('bluebird');var rs=require(_0x533c('0x2'));var fs=require('fs');var Redis=require(_0x533c('0x3'));var db=require(_0x533c('0x4'))['db'];var utils=require(_0x533c('0x5'));var logger=require(_0x533c('0x6'))('rpc');var config=require(_0x533c('0x7'));var jayson=require(_0x533c('0x8'));var client=jayson[_0x533c('0x9')][_0x533c('0xa')]({'port':0x232a});config[_0x533c('0xb')]=_[_0x533c('0xc')](config[_0x533c('0xb')],{'host':_0x533c('0xd'),'port':0x18eb});var socket=require(_0x533c('0xe'))(new Redis(config[_0x533c('0xb')]));require(_0x533c('0xf'))[_0x533c('0x10')](socket);function respondWithRpcPromise(_0x2c0214,_0x249f1a,_0x430c51){return new BPromise(function(_0x1b312e,_0x5a150f){return client[_0x533c('0x11')](_0x2c0214,_0x430c51)[_0x533c('0x12')](function(_0x272a11){logger[_0x533c('0x13')](_0x533c('0x14'),_0x249f1a,_0x533c('0x15'));logger['debug'](_0x533c('0x16'),_0x249f1a,_0x533c('0x15'),JSON[_0x533c('0x17')](_0x272a11));if(_0x272a11[_0x533c('0x18')]){if(_0x272a11[_0x533c('0x18')][_0x533c('0x19')]===0x1f4){logger[_0x533c('0x18')](_0x533c('0x14'),_0x249f1a,_0x272a11['error'][_0x533c('0x1a')]);return _0x5a150f(_0x272a11[_0x533c('0x18')][_0x533c('0x1a')]);}logger[_0x533c('0x18')]('UserProfile,\x20%s,\x20%s',_0x249f1a,_0x272a11[_0x533c('0x18')][_0x533c('0x1a')]);return _0x1b312e(_0x272a11[_0x533c('0x18')][_0x533c('0x1a')]);}else{logger[_0x533c('0x13')](_0x533c('0x14'),_0x249f1a,_0x533c('0x15'));_0x1b312e(_0x272a11[_0x533c('0x1b')][_0x533c('0x1a')]);}})[_0x533c('0x1c')](function(_0x287b9e){logger[_0x533c('0x18')](_0x533c('0x14'),_0x249f1a,_0x287b9e);_0x5a150f(_0x287b9e);});});} \ No newline at end of file +var _0xdc97=['redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserProfile,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x12428f,_0xed4e38){var _0x4595ae=function(_0x463b9a){while(--_0x463b9a){_0x12428f['push'](_0x12428f['shift']());}};_0x4595ae(++_0xed4e38);}(_0xdc97,0x13b));var _0x7dc9=function(_0x4ce7dc,_0xe76d1b){_0x4ce7dc=_0x4ce7dc-0x0;var _0x2bd044=_0xdc97[_0x4ce7dc];return _0x2bd044;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var moment=require(_0x7dc9('0x2'));var BPromise=require('bluebird');var rs=require(_0x7dc9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7dc9('0x4'))['db'];var utils=require(_0x7dc9('0x5'));var logger=require('../../config/logger')(_0x7dc9('0x6'));var config=require(_0x7dc9('0x7'));var jayson=require(_0x7dc9('0x8'));var client=jayson[_0x7dc9('0x9')]['http']({'port':0x232a});config[_0x7dc9('0xa')]=_['defaults'](config['redis'],{'host':_0x7dc9('0xb'),'port':0x18eb});var socket=require(_0x7dc9('0xc'))(new Redis(config[_0x7dc9('0xa')]));require(_0x7dc9('0xd'))[_0x7dc9('0xe')](socket);function respondWithRpcPromise(_0x5ca05b,_0xb2fa2a,_0x44fe24){return new BPromise(function(_0x37dfc,_0x1dc3f7){return client[_0x7dc9('0xf')](_0x5ca05b,_0x44fe24)[_0x7dc9('0x10')](function(_0x1e336a){logger['info']('UserProfile,\x20%s,\x20%s',_0xb2fa2a,'request\x20sent');logger['debug'](_0x7dc9('0x11'),_0xb2fa2a,_0x7dc9('0x12'),JSON['stringify'](_0x1e336a));if(_0x1e336a[_0x7dc9('0x13')]){if(_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x14')]===0x1f4){logger[_0x7dc9('0x13')](_0x7dc9('0x15'),_0xb2fa2a,_0x1e336a[_0x7dc9('0x13')]['message']);return _0x1dc3f7(_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x16')]);}logger[_0x7dc9('0x13')](_0x7dc9('0x15'),_0xb2fa2a,_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x16')]);return _0x37dfc(_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x16')]);}else{logger[_0x7dc9('0x17')]('UserProfile,\x20%s,\x20%s',_0xb2fa2a,_0x7dc9('0x12'));_0x37dfc(_0x1e336a['result'][_0x7dc9('0x16')]);}})[_0x7dc9('0x18')](function(_0x5d61d7){logger[_0x7dc9('0x13')](_0x7dc9('0x15'),_0xb2fa2a,_0x5d61d7);_0x1dc3f7(_0x5d61d7);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index a880f32..c5bcfde 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 _0x4413=['emit','removeListener','register','userProfile:','./userProfile.events','save','remove'];(function(_0x558ba0,_0x23e64c){var _0x2d05f6=function(_0x5ed979){while(--_0x5ed979){_0x558ba0['push'](_0x558ba0['shift']());}};_0x2d05f6(++_0x23e64c);}(_0x4413,0x1e7));var _0x3441=function(_0x4bf8c3,_0x53e4ef){_0x4bf8c3=_0x4bf8c3-0x0;var _0x4fbc7f=_0x4413[_0x4bf8c3];return _0x4fbc7f;};'use strict';var UserProfileEvents=require(_0x3441('0x0'));var events=[_0x3441('0x1'),_0x3441('0x2'),'update'];function createListener(_0xdb249e,_0x2c5bb5){return function(_0x21e668){_0x2c5bb5[_0x3441('0x3')](_0xdb249e,_0x21e668);};}function removeListener(_0x12009a,_0x442a27){return function(){UserProfileEvents[_0x3441('0x4')](_0x12009a,_0x442a27);};}exports[_0x3441('0x5')]=function(_0x1517f5){for(var _0x3c7391=0x0,_0x5214f2=events['length'];_0x3c7391<_0x5214f2;_0x3c7391++){var _0x39bbed=events[_0x3c7391];var _0x272f7d=createListener(_0x3441('0x6')+_0x39bbed,_0x1517f5);UserProfileEvents['on'](_0x39bbed,_0x272f7d);}}; \ No newline at end of file +var _0x95ee=['length','userProfile:','./userProfile.events','save','remove','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x95ee,0xec));var _0xe95e=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x95ee[_0x263a74];return _0x2aa86c;};'use strict';var UserProfileEvents=require(_0xe95e('0x0'));var events=[_0xe95e('0x1'),_0xe95e('0x2'),'update'];function createListener(_0x33abea,_0x2a0a89){return function(_0x4adfd4){_0x2a0a89[_0xe95e('0x3')](_0x33abea,_0x4adfd4);};}function removeListener(_0x46c6c7,_0x1e6137){return function(){UserProfileEvents['removeListener'](_0x46c6c7,_0x1e6137);};}exports['register']=function(_0x1002dc){for(var _0x255877=0x0,_0x1277f4=events[_0xe95e('0x4')];_0x255877<_0x1277f4;_0x255877++){var _0x477315=events[_0x255877];var _0x465bf6=createListener(_0xe95e('0x5')+_0x477315,_0x1002dc);UserProfileEvents['on'](_0x477315,_0x465bf6);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index ba13742..23c20c7 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 _0xdae4=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','index','/describe','isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy','multer'];(function(_0x1e9788,_0xf13df){var _0x143796=function(_0x178484){while(--_0x178484){_0x1e9788['push'](_0x1e9788['shift']());}};_0x143796(++_0xf13df);}(_0xdae4,0xdb));var _0x4dae=function(_0x45bab9,_0x49c3df){_0x45bab9=_0x45bab9-0x0;var _0x3b1fa9=_0xdae4[_0x45bab9];return _0x3b1fa9;};'use strict';var multer=require(_0x4dae('0x0'));var util=require('util');var path=require(_0x4dae('0x1'));var timeout=require(_0x4dae('0x2'));var express=require(_0x4dae('0x3'));var router=express[_0x4dae('0x4')]();var auth=require(_0x4dae('0x5'));var interaction=require(_0x4dae('0x6'));var config=require('../../config/environment');var controller=require(_0x4dae('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x4dae('0x8')]);router['get'](_0x4dae('0x9'),auth[_0x4dae('0xa')](),controller['describe']);router[_0x4dae('0xb')](_0x4dae('0xc'),auth[_0x4dae('0xa')](),controller[_0x4dae('0xd')]);router[_0x4dae('0xe')]('/',auth[_0x4dae('0xa')](),controller[_0x4dae('0xf')]);router[_0x4dae('0x10')](_0x4dae('0xc'),auth[_0x4dae('0xa')](),controller[_0x4dae('0x11')]);router[_0x4dae('0x12')](_0x4dae('0xc'),auth[_0x4dae('0xa')](),controller[_0x4dae('0x13')]);module['exports']=router; \ No newline at end of file +var _0x8abb=['express','Router','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','exports','util','path','connect-timeout'];(function(_0x459a0a,_0x25c46f){var _0x4ab46c=function(_0x451a6a){while(--_0x451a6a){_0x459a0a['push'](_0x459a0a['shift']());}};_0x4ab46c(++_0x25c46f);}(_0x8abb,0x195));var _0xb8ab=function(_0x7c31e7,_0xb820ad){_0x7c31e7=_0x7c31e7-0x0;var _0x352f8a=_0x8abb[_0x7c31e7];return _0x352f8a;};'use strict';var multer=require('multer');var util=require(_0xb8ab('0x0'));var path=require(_0xb8ab('0x1'));var timeout=require(_0xb8ab('0x2'));var express=require(_0xb8ab('0x3'));var router=express[_0xb8ab('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb8ab('0x5'));router[_0xb8ab('0x6')]('/',auth[_0xb8ab('0x7')](),controller[_0xb8ab('0x8')]);router[_0xb8ab('0x6')](_0xb8ab('0x9'),auth['isAuthenticated'](),controller[_0xb8ab('0xa')]);router['get'](_0xb8ab('0xb'),auth[_0xb8ab('0x7')](),controller[_0xb8ab('0xc')]);router['post']('/',auth[_0xb8ab('0x7')](),controller['create']);router[_0xb8ab('0xd')](_0xb8ab('0xb'),auth[_0xb8ab('0x7')](),controller[_0xb8ab('0xe')]);router[_0xb8ab('0xf')](_0xb8ab('0xb'),auth[_0xb8ab('0x7')](),controller['destroy']);module[_0xb8ab('0x10')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 455f066..c23373a 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 _0xf1b4=['INTEGER','sequelize','exports','STRING'];(function(_0x47e92b,_0x29e3b5){var _0x2da694=function(_0x312ce0){while(--_0x312ce0){_0x47e92b['push'](_0x47e92b['shift']());}};_0x2da694(++_0x29e3b5);}(_0xf1b4,0xe5));var _0x4f1b=function(_0x4e08c6,_0x6e0fbc){_0x4e08c6=_0x4e08c6-0x0;var _0x479911=_0xf1b4[_0x4e08c6];return _0x479911;};'use strict';var Sequelize=require(_0x4f1b('0x0'));module[_0x4f1b('0x1')]={'name':{'type':Sequelize[_0x4f1b('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x4f1b('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xa0a4=['INTEGER','sequelize','exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa0a4,0x131));var _0x4a0a=function(_0x55a61d,_0x1ad9ef){_0x55a61d=_0x55a61d-0x0;var _0x3b463c=_0xa0a4[_0x55a61d];return _0x3b463c;};'use strict';var Sequelize=require(_0x4a0a('0x0'));module[_0x4a0a('0x1')]={'name':{'type':Sequelize[_0x4a0a('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x4a0a('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4a0a('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 4357549..2d1e9bb 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 _0x4b8a=['ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','key','VIRTUAL','field','options','UserProfileResource','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x340310,_0x182f70){var _0x1c2e68=function(_0x291303){while(--_0x291303){_0x340310['push'](_0x340310['shift']());}};_0x1c2e68(++_0x182f70);}(_0x4b8a,0xd3));var _0xa4b8=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4b8a[_0x3b380d];return _0x54502b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa4b8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa4b8('0x1'));var jsonpatch=require(_0xa4b8('0x2'));var rp=require(_0xa4b8('0x3'));var moment=require(_0xa4b8('0x4'));var BPromise=require(_0xa4b8('0x5'));var Mustache=require(_0xa4b8('0x6'));var util=require(_0xa4b8('0x7'));var path=require(_0xa4b8('0x8'));var sox=require(_0xa4b8('0x9'));var csv=require(_0xa4b8('0xa'));var ejs=require(_0xa4b8('0xb'));var fs=require('fs');var _=require(_0xa4b8('0xc'));var squel=require(_0xa4b8('0xd'));var crypto=require(_0xa4b8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa4b8('0xf'));var toCsv=require(_0xa4b8('0xa'));var querystring=require(_0xa4b8('0x10'));var Papa=require(_0xa4b8('0x11'));var Redis=require(_0xa4b8('0x12'));var authService=require(_0xa4b8('0x13'));var qs=require(_0xa4b8('0x14'));var hardwareService=require(_0xa4b8('0x15'));var logger=require(_0xa4b8('0x16'))(_0xa4b8('0x17'));var utils=require(_0xa4b8('0x18'));var config=require(_0xa4b8('0x19'));var db=require(_0xa4b8('0x1a'))['db'];function respondWithStatusCode(_0x29156c,_0x4e06d4){_0x4e06d4=_0x4e06d4||0xcc;return function(_0x4c2d6b){if(_0x4c2d6b){return _0x29156c[_0xa4b8('0x1b')](_0x4e06d4);}return _0x29156c['status'](_0x4e06d4)[_0xa4b8('0x1c')]();};}function respondWithResult(_0x43481b,_0x5ab232){_0x5ab232=_0x5ab232||0xc8;return function(_0x2f3199){if(_0x2f3199){return _0x43481b[_0xa4b8('0x1d')](_0x5ab232)[_0xa4b8('0x1e')](_0x2f3199);}};}function respondWithFilteredResult(_0x17c3be,_0x28bcdd){return function(_0x3bba1b){if(_0x3bba1b){var _0x238cac=_0x3bba1b[_0xa4b8('0x1f')],_0x443d7f=_0x28bcdd[_0xa4b8('0x20')],_0x2fd884=_0x28bcdd['offset']+_0x28bcdd[_0xa4b8('0x21')],_0x48fda9;if(_0x2fd884>=_0x238cac){_0x2fd884=_0x238cac;_0x48fda9=0xc8;}else{_0x48fda9=0xce;}_0x17c3be[_0xa4b8('0x1d')](_0x48fda9);return _0x17c3be[_0xa4b8('0x22')](_0xa4b8('0x23'),_0x443d7f+'-'+_0x2fd884+'/'+_0x238cac)[_0xa4b8('0x1e')](_0x3bba1b);}return null;};}function patchUpdates(_0x4c6341){return function(_0x47aa17){try{jsonpatch['apply'](_0x47aa17,_0x4c6341,!![]);}catch(_0x518134){return BPromise[_0xa4b8('0x24')](_0x518134);}return _0x47aa17[_0xa4b8('0x25')]();};}function saveUpdates(_0x1e52bc,_0x3e728c){return function(_0x39676c){if(_0x39676c){return _0x39676c[_0xa4b8('0x26')](_0x1e52bc)[_0xa4b8('0x27')](function(_0x10534b){return _0x10534b;});}return null;};}function removeEntity(_0x3717ef,_0x44886a){return function(_0xbdc088){if(_0xbdc088){return _0xbdc088[_0xa4b8('0x28')]()[_0xa4b8('0x27')](function(){_0x3717ef[_0xa4b8('0x1d')](0xcc)[_0xa4b8('0x1c')]();});}};}function handleEntityNotFound(_0xeb5ae1,_0x34f5d2){return function(_0x4b28ae){if(!_0x4b28ae){_0xeb5ae1[_0xa4b8('0x1b')](0x194);}return _0x4b28ae;};}function handleError(_0x1f3c4b,_0x5e2f85){_0x5e2f85=_0x5e2f85||0x1f4;return function(_0xf5638b){logger[_0xa4b8('0x29')](_0xf5638b['stack']);if(_0xf5638b['name']){delete _0xf5638b['name'];}_0x1f3c4b[_0xa4b8('0x1d')](_0x5e2f85)[_0xa4b8('0x2a')](_0xf5638b);};}exports[_0xa4b8('0x2b')]=function(_0xa11b76,_0x5242ec){var _0x3ff3de={},_0x1508fe={},_0x175c5d={'count':0x0,'rows':[]};var _0xf5cd27=db['UserProfileResource'][_0xa4b8('0x2c')];_0x1508fe[_0xa4b8('0x2d')]=_[_0xa4b8('0x2e')](_0xf5cd27);_0x1508fe[_0xa4b8('0x2f')]=_[_0xa4b8('0x2e')](_0xa11b76[_0xa4b8('0x2f')]);_0x1508fe[_0xa4b8('0x30')]=_[_0xa4b8('0x31')](_0x1508fe[_0xa4b8('0x2d')],_0x1508fe[_0xa4b8('0x2f')]);_0x3ff3de[_0xa4b8('0x32')]=_[_0xa4b8('0x31')](_0x1508fe['model'],qs[_0xa4b8('0x33')](_0xa11b76[_0xa4b8('0x2f')][_0xa4b8('0x33')]));_0x3ff3de['attributes']=_0x3ff3de[_0xa4b8('0x32')][_0xa4b8('0x34')]?_0x3ff3de['attributes']:_0x1508fe['model'];if(!_0xa11b76['query']['hasOwnProperty'](_0xa4b8('0x35'))){_0x3ff3de['limit']=qs[_0xa4b8('0x21')](_0xa11b76[_0xa4b8('0x2f')][_0xa4b8('0x21')]);_0x3ff3de['offset']=qs[_0xa4b8('0x20')](_0xa11b76[_0xa4b8('0x2f')][_0xa4b8('0x20')]);}_0x3ff3de[_0xa4b8('0x36')]=qs[_0xa4b8('0x37')](_0xa11b76['query'][_0xa4b8('0x37')]);_0x3ff3de[_0xa4b8('0x38')]=qs[_0xa4b8('0x30')](_[_0xa4b8('0x39')](_0xa11b76[_0xa4b8('0x2f')],_0x1508fe[_0xa4b8('0x30')]));if(_0xa11b76[_0xa4b8('0x2f')]['filter']){_0x3ff3de[_0xa4b8('0x38')]=_[_0xa4b8('0x3a')](_0x3ff3de[_0xa4b8('0x38')],{'$or':_[_0xa4b8('0x3b')](_0xf5cd27,function(_0x29f28b){if(_0x29f28b['type'][_0xa4b8('0x3c')]!==_0xa4b8('0x3d')){var _0x2c64a6={};_0x2c64a6[_0x29f28b[_0xa4b8('0x3e')]]={'$like':'%'+_0xa11b76['query']['filter']+'%'};return _0x2c64a6;}})});}_0x3ff3de=_[_0xa4b8('0x3a')]({},_0x3ff3de,_0xa11b76[_0xa4b8('0x3f')]);var _0x28810b={'where':_0x3ff3de[_0xa4b8('0x38')]};return db[_0xa4b8('0x40')][_0xa4b8('0x1f')](_0x28810b)[_0xa4b8('0x27')](function(_0xf656b5){_0x175c5d[_0xa4b8('0x1f')]=_0xf656b5;if(_0xa11b76[_0xa4b8('0x2f')][_0xa4b8('0x41')]){_0x3ff3de[_0xa4b8('0x42')]=[{'all':!![]}];}return db[_0xa4b8('0x40')][_0xa4b8('0x43')](_0x3ff3de);})['then'](function(_0x35d62c){_0x175c5d['rows']=_0x35d62c;return _0x175c5d;})[_0xa4b8('0x27')](respondWithFilteredResult(_0x5242ec,_0x3ff3de))[_0xa4b8('0x44')](handleError(_0x5242ec,null));};exports['show']=function(_0x5b9529,_0x3d4f02){var _0x845059={'raw':![],'where':{'id':_0x5b9529[_0xa4b8('0x45')]['id']}},_0x3f6f2a={};_0x3f6f2a[_0xa4b8('0x2d')]=_[_0xa4b8('0x2e')](db['UserProfileResource'][_0xa4b8('0x2c')]);_0x3f6f2a[_0xa4b8('0x2f')]=_[_0xa4b8('0x2e')](_0x5b9529['query']);_0x3f6f2a[_0xa4b8('0x30')]=_[_0xa4b8('0x31')](_0x3f6f2a[_0xa4b8('0x2d')],_0x3f6f2a[_0xa4b8('0x2f')]);_0x845059[_0xa4b8('0x32')]=_[_0xa4b8('0x31')](_0x3f6f2a[_0xa4b8('0x2d')],qs[_0xa4b8('0x33')](_0x5b9529[_0xa4b8('0x2f')]['fields']));_0x845059[_0xa4b8('0x32')]=_0x845059[_0xa4b8('0x32')][_0xa4b8('0x34')]?_0x845059[_0xa4b8('0x32')]:_0x3f6f2a[_0xa4b8('0x2d')];if(_0x5b9529[_0xa4b8('0x2f')][_0xa4b8('0x41')]){_0x845059['include']=[{'all':!![]}];}_0x845059=_[_0xa4b8('0x3a')]({},_0x845059,_0x5b9529['options']);return db[_0xa4b8('0x40')][_0xa4b8('0x46')](_0x845059)['then'](handleEntityNotFound(_0x3d4f02,null))[_0xa4b8('0x27')](respondWithResult(_0x3d4f02,null))['catch'](handleError(_0x3d4f02,null));};exports[_0xa4b8('0x47')]=function(_0x3d515c,_0x34836d){return db[_0xa4b8('0x40')][_0xa4b8('0x47')](_0x3d515c[_0xa4b8('0x48')],{})[_0xa4b8('0x27')](respondWithResult(_0x34836d,0xc9))[_0xa4b8('0x44')](handleError(_0x34836d,null));};exports[_0xa4b8('0x26')]=function(_0x5c86d6,_0xae0c15){if(_0x5c86d6['body']['id']){delete _0x5c86d6[_0xa4b8('0x48')]['id'];}return db[_0xa4b8('0x40')][_0xa4b8('0x46')]({'where':{'id':_0x5c86d6['params']['id']}})['then'](handleEntityNotFound(_0xae0c15,null))[_0xa4b8('0x27')](saveUpdates(_0x5c86d6[_0xa4b8('0x48')],null))['then'](respondWithResult(_0xae0c15,null))[_0xa4b8('0x44')](handleError(_0xae0c15,null));};exports['destroy']=function(_0x1b8a91,_0x6b9b99){return db[_0xa4b8('0x40')]['find']({'where':{'id':_0x1b8a91[_0xa4b8('0x45')]['id']}})[_0xa4b8('0x27')](handleEntityNotFound(_0x6b9b99,null))[_0xa4b8('0x27')](removeEntity(_0x6b9b99,null))['catch'](handleError(_0x6b9b99,null));};exports['describe']=function(_0x36a0d2,_0x24e88e){return db[_0xa4b8('0x40')][_0xa4b8('0x49')]()[_0xa4b8('0x27')](respondWithResult(_0x24e88e,null))['catch'](handleError(_0x24e88e,null));}; \ No newline at end of file +var _0x5a8c=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','save','then','error','stack','name','send','index','UserProfileResource','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','key','field','options','includeAll','findAll','show','params','find','catch','create','body','update','destroy','describe','html-pdf','eml-format'];(function(_0x435c27,_0x4b8aee){var _0xb57abe=function(_0x386a23){while(--_0x386a23){_0x435c27['push'](_0x435c27['shift']());}};_0xb57abe(++_0x4b8aee);}(_0x5a8c,0x1da));var _0xc5a8=function(_0x5b34ef,_0x454975){_0x5b34ef=_0x5b34ef-0x0;var _0x3563b0=_0x5a8c[_0x5b34ef];return _0x3563b0;};'use strict';var pdf=require(_0xc5a8('0x0'));var emlformat=require(_0xc5a8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc5a8('0x2'));var jsonpatch=require(_0xc5a8('0x3'));var rp=require(_0xc5a8('0x4'));var moment=require(_0xc5a8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc5a8('0x6'));var util=require(_0xc5a8('0x7'));var path=require('path');var sox=require(_0xc5a8('0x8'));var csv=require(_0xc5a8('0x9'));var ejs=require(_0xc5a8('0xa'));var fs=require('fs');var _=require(_0xc5a8('0xb'));var squel=require(_0xc5a8('0xc'));var crypto=require(_0xc5a8('0xd'));var jsforce=require(_0xc5a8('0xe'));var deskjs=require(_0xc5a8('0xf'));var toCsv=require(_0xc5a8('0x9'));var querystring=require(_0xc5a8('0x10'));var Papa=require(_0xc5a8('0x11'));var Redis=require('ioredis');var authService=require(_0xc5a8('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xc5a8('0x13'));var logger=require(_0xc5a8('0x14'))(_0xc5a8('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc5a8('0x16'))['db'];function respondWithStatusCode(_0xc34098,_0x383f5c){_0x383f5c=_0x383f5c||0xcc;return function(_0x2c4875){if(_0x2c4875){return _0xc34098[_0xc5a8('0x17')](_0x383f5c);}return _0xc34098['status'](_0x383f5c)[_0xc5a8('0x18')]();};}function respondWithResult(_0x25eb93,_0x3a8296){_0x3a8296=_0x3a8296||0xc8;return function(_0x3a820f){if(_0x3a820f){return _0x25eb93[_0xc5a8('0x19')](_0x3a8296)[_0xc5a8('0x1a')](_0x3a820f);}};}function respondWithFilteredResult(_0x365df5,_0x26d87c){return function(_0x168e76){if(_0x168e76){var _0x9a94e3=_0x168e76[_0xc5a8('0x1b')],_0x26177f=_0x26d87c[_0xc5a8('0x1c')],_0x443376=_0x26d87c[_0xc5a8('0x1c')]+_0x26d87c[_0xc5a8('0x1d')],_0x393e1c;if(_0x443376>=_0x9a94e3){_0x443376=_0x9a94e3;_0x393e1c=0xc8;}else{_0x393e1c=0xce;}_0x365df5[_0xc5a8('0x19')](_0x393e1c);return _0x365df5['set'](_0xc5a8('0x1e'),_0x26177f+'-'+_0x443376+'/'+_0x9a94e3)[_0xc5a8('0x1a')](_0x168e76);}return null;};}function patchUpdates(_0x3439dc){return function(_0x1c2967){try{jsonpatch['apply'](_0x1c2967,_0x3439dc,!![]);}catch(_0x326baf){return BPromise['reject'](_0x326baf);}return _0x1c2967[_0xc5a8('0x1f')]();};}function saveUpdates(_0x178912,_0x35ac5a){return function(_0x52ca0a){if(_0x52ca0a){return _0x52ca0a['update'](_0x178912)['then'](function(_0x332ee2){return _0x332ee2;});}return null;};}function removeEntity(_0x1150b4,_0x230494){return function(_0x403b80){if(_0x403b80){return _0x403b80['destroy']()[_0xc5a8('0x20')](function(){_0x1150b4[_0xc5a8('0x19')](0xcc)[_0xc5a8('0x18')]();});}};}function handleEntityNotFound(_0x36d2c6,_0x5d8e5e){return function(_0x411470){if(!_0x411470){_0x36d2c6['sendStatus'](0x194);}return _0x411470;};}function handleError(_0x25e56d,_0x4616ec){_0x4616ec=_0x4616ec||0x1f4;return function(_0x2b8a67){logger[_0xc5a8('0x21')](_0x2b8a67[_0xc5a8('0x22')]);if(_0x2b8a67[_0xc5a8('0x23')]){delete _0x2b8a67[_0xc5a8('0x23')];}_0x25e56d[_0xc5a8('0x19')](_0x4616ec)[_0xc5a8('0x24')](_0x2b8a67);};}exports[_0xc5a8('0x25')]=function(_0x1a49ad,_0x4294c0){var _0x165ee0={},_0x4ebb64={},_0x75a5e5={'count':0x0,'rows':[]};var _0x4f6120=db[_0xc5a8('0x26')]['rawAttributes'];_0x4ebb64[_0xc5a8('0x27')]=_[_0xc5a8('0x28')](_0x4f6120);_0x4ebb64['query']=_[_0xc5a8('0x28')](_0x1a49ad[_0xc5a8('0x29')]);_0x4ebb64[_0xc5a8('0x2a')]=_[_0xc5a8('0x2b')](_0x4ebb64[_0xc5a8('0x27')],_0x4ebb64[_0xc5a8('0x29')]);_0x165ee0[_0xc5a8('0x2c')]=_[_0xc5a8('0x2b')](_0x4ebb64[_0xc5a8('0x27')],qs[_0xc5a8('0x2d')](_0x1a49ad[_0xc5a8('0x29')][_0xc5a8('0x2d')]));_0x165ee0[_0xc5a8('0x2c')]=_0x165ee0[_0xc5a8('0x2c')][_0xc5a8('0x2e')]?_0x165ee0[_0xc5a8('0x2c')]:_0x4ebb64[_0xc5a8('0x27')];if(!_0x1a49ad[_0xc5a8('0x29')][_0xc5a8('0x2f')](_0xc5a8('0x30'))){_0x165ee0[_0xc5a8('0x1d')]=qs[_0xc5a8('0x1d')](_0x1a49ad[_0xc5a8('0x29')]['limit']);_0x165ee0['offset']=qs[_0xc5a8('0x1c')](_0x1a49ad[_0xc5a8('0x29')][_0xc5a8('0x1c')]);}_0x165ee0['order']=qs[_0xc5a8('0x31')](_0x1a49ad[_0xc5a8('0x29')][_0xc5a8('0x31')]);_0x165ee0[_0xc5a8('0x32')]=qs['filters'](_['pick'](_0x1a49ad['query'],_0x4ebb64[_0xc5a8('0x2a')]));if(_0x1a49ad[_0xc5a8('0x29')][_0xc5a8('0x33')]){_0x165ee0[_0xc5a8('0x32')]=_[_0xc5a8('0x34')](_0x165ee0['where'],{'$or':_[_0xc5a8('0x35')](_0x4f6120,function(_0x1d90f3){if(_0x1d90f3['type'][_0xc5a8('0x36')]!=='VIRTUAL'){var _0xfaab96={};_0xfaab96[_0x1d90f3[_0xc5a8('0x37')]]={'$like':'%'+_0x1a49ad[_0xc5a8('0x29')][_0xc5a8('0x33')]+'%'};return _0xfaab96;}})});}_0x165ee0=_[_0xc5a8('0x34')]({},_0x165ee0,_0x1a49ad[_0xc5a8('0x38')]);var _0x525066={'where':_0x165ee0[_0xc5a8('0x32')]};return db[_0xc5a8('0x26')][_0xc5a8('0x1b')](_0x525066)[_0xc5a8('0x20')](function(_0x457a4c){_0x75a5e5[_0xc5a8('0x1b')]=_0x457a4c;if(_0x1a49ad[_0xc5a8('0x29')][_0xc5a8('0x39')]){_0x165ee0['include']=[{'all':!![]}];}return db[_0xc5a8('0x26')][_0xc5a8('0x3a')](_0x165ee0);})[_0xc5a8('0x20')](function(_0x424904){_0x75a5e5['rows']=_0x424904;return _0x75a5e5;})[_0xc5a8('0x20')](respondWithFilteredResult(_0x4294c0,_0x165ee0))['catch'](handleError(_0x4294c0,null));};exports[_0xc5a8('0x3b')]=function(_0x2679f0,_0x3207dd){var _0x521f76={'raw':![],'where':{'id':_0x2679f0[_0xc5a8('0x3c')]['id']}},_0x351d49={};_0x351d49[_0xc5a8('0x27')]=_['keys'](db['UserProfileResource']['rawAttributes']);_0x351d49[_0xc5a8('0x29')]=_[_0xc5a8('0x28')](_0x2679f0[_0xc5a8('0x29')]);_0x351d49['filters']=_[_0xc5a8('0x2b')](_0x351d49['model'],_0x351d49['query']);_0x521f76['attributes']=_['intersection'](_0x351d49['model'],qs['fields'](_0x2679f0[_0xc5a8('0x29')][_0xc5a8('0x2d')]));_0x521f76[_0xc5a8('0x2c')]=_0x521f76[_0xc5a8('0x2c')][_0xc5a8('0x2e')]?_0x521f76[_0xc5a8('0x2c')]:_0x351d49[_0xc5a8('0x27')];if(_0x2679f0[_0xc5a8('0x29')][_0xc5a8('0x39')]){_0x521f76['include']=[{'all':!![]}];}_0x521f76=_[_0xc5a8('0x34')]({},_0x521f76,_0x2679f0[_0xc5a8('0x38')]);return db[_0xc5a8('0x26')][_0xc5a8('0x3d')](_0x521f76)['then'](handleEntityNotFound(_0x3207dd,null))[_0xc5a8('0x20')](respondWithResult(_0x3207dd,null))[_0xc5a8('0x3e')](handleError(_0x3207dd,null));};exports[_0xc5a8('0x3f')]=function(_0x44186d,_0x5bc42f){return db['UserProfileResource'][_0xc5a8('0x3f')](_0x44186d[_0xc5a8('0x40')],{})[_0xc5a8('0x20')](respondWithResult(_0x5bc42f,0xc9))['catch'](handleError(_0x5bc42f,null));};exports[_0xc5a8('0x41')]=function(_0xe0f0eb,_0x2a11c4){if(_0xe0f0eb[_0xc5a8('0x40')]['id']){delete _0xe0f0eb[_0xc5a8('0x40')]['id'];}return db['UserProfileResource'][_0xc5a8('0x3d')]({'where':{'id':_0xe0f0eb['params']['id']}})[_0xc5a8('0x20')](handleEntityNotFound(_0x2a11c4,null))[_0xc5a8('0x20')](saveUpdates(_0xe0f0eb['body'],null))['then'](respondWithResult(_0x2a11c4,null))[_0xc5a8('0x3e')](handleError(_0x2a11c4,null));};exports[_0xc5a8('0x42')]=function(_0x4929b5,_0x526d11){return db[_0xc5a8('0x26')][_0xc5a8('0x3d')]({'where':{'id':_0x4929b5[_0xc5a8('0x3c')]['id']}})[_0xc5a8('0x20')](handleEntityNotFound(_0x526d11,null))[_0xc5a8('0x20')](removeEntity(_0x526d11,null))[_0xc5a8('0x3e')](handleError(_0x526d11,null));};exports['describe']=function(_0x534136,_0x5b6d88){return db['UserProfileResource'][_0xc5a8('0x43')]()[_0xc5a8('0x20')](respondWithResult(_0x5b6d88,null))[_0xc5a8('0x3e')](handleError(_0x5b6d88,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index b5ab701..772a840 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 _0xfdf1=['exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','moment','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xfdf1,0x1d5));var _0x1fdf=function(_0x52ec92,_0xc7c5a0){_0x52ec92=_0x52ec92-0x0;var _0x1fc7e2=_0xfdf1[_0x52ec92];return _0x1fc7e2;};'use strict';var _=require('lodash');var util=require(_0x1fdf('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x1fdf('0x1'));var BPromise=require('bluebird');var rp=require(_0x1fdf('0x2'));var fs=require('fs');var path=require(_0x1fdf('0x3'));var rimraf=require(_0x1fdf('0x4'));var config=require(_0x1fdf('0x5'));var attributes=require(_0x1fdf('0x6'));module[_0x1fdf('0x7')]=function(_0xbdbe8c,_0x160a76){return _0xbdbe8c[_0x1fdf('0x8')](_0x1fdf('0x9'),attributes,{'tableName':_0x1fdf('0xa'),'paranoid':![],'indexes':[{'name':_0x1fdf('0xb'),'fields':[_0x1fdf('0xc'),_0x1fdf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe300=['resourceId','sectionId','lodash','util','../../config/logger','bluebird','path','../../config/environment','exports','define','user_profile_has_resources','compositeIndex'];(function(_0x3624b4,_0x2c54ba){var _0x48e49a=function(_0x286fee){while(--_0x286fee){_0x3624b4['push'](_0x3624b4['shift']());}};_0x48e49a(++_0x2c54ba);}(_0xe300,0x86));var _0x0e30=function(_0x2e9dc1,_0x5a7823){_0x2e9dc1=_0x2e9dc1-0x0;var _0x14c45c=_0xe300[_0x2e9dc1];return _0x14c45c;};'use strict';var _=require(_0x0e30('0x0'));var util=require(_0x0e30('0x1'));var logger=require(_0x0e30('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0e30('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e30('0x4'));var rimraf=require('rimraf');var config=require(_0x0e30('0x5'));var attributes=require('./userProfileResource.attributes');module[_0x0e30('0x6')]=function(_0x1c62f2,_0x44acce){return _0x1c62f2[_0x0e30('0x7')]('UserProfileResource',attributes,{'tableName':_0x0e30('0x8'),'paranoid':![],'indexes':[{'name':_0x0e30('0x9'),'fields':[_0x0e30('0xa'),_0x0e30('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 8135590..1c311ee 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 _0x3cb5=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','UserProfileResource,\x20%s,\x20%s','message','catch','lodash'];(function(_0x3d30dd,_0x1cb1ad){var _0x385405=function(_0x5921ed){while(--_0x5921ed){_0x3d30dd['push'](_0x3d30dd['shift']());}};_0x385405(++_0x1cb1ad);}(_0x3cb5,0x7d));var _0x53cb=function(_0x14a658,_0x3e3114){_0x14a658=_0x14a658-0x0;var _0x5425c0=_0x3cb5[_0x14a658];return _0x5425c0;};'use strict';var _=require(_0x53cb('0x0'));var util=require(_0x53cb('0x1'));var moment=require(_0x53cb('0x2'));var BPromise=require(_0x53cb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x53cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x53cb('0x5'));var logger=require(_0x53cb('0x6'))(_0x53cb('0x7'));var config=require('../../config/environment');var jayson=require(_0x53cb('0x8'));var client=jayson[_0x53cb('0x9')][_0x53cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e14ec,_0x675e2,_0x4a67a8){return new BPromise(function(_0x1649f6,_0x53b013){return client[_0x53cb('0xb')](_0x3e14ec,_0x4a67a8)['then'](function(_0xb45533){logger[_0x53cb('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x675e2,_0x53cb('0xd'));logger[_0x53cb('0xe')](_0x53cb('0xf'),_0x675e2,_0x53cb('0xd'),JSON[_0x53cb('0x10')](_0xb45533));if(_0xb45533[_0x53cb('0x11')]){if(_0xb45533['error']['code']===0x1f4){logger['error'](_0x53cb('0x12'),_0x675e2,_0xb45533[_0x53cb('0x11')]['message']);return _0x53b013(_0xb45533[_0x53cb('0x11')]['message']);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x675e2,_0xb45533[_0x53cb('0x11')][_0x53cb('0x13')]);return _0x1649f6(_0xb45533[_0x53cb('0x11')]['message']);}else{logger[_0x53cb('0xc')](_0x53cb('0x12'),_0x675e2,_0x53cb('0xd'));_0x1649f6(_0xb45533['result'][_0x53cb('0x13')]);}})[_0x53cb('0x14')](function(_0x384f73){logger[_0x53cb('0x11')](_0x53cb('0x12'),_0x675e2,_0x384f73);_0x53b013(_0x384f73);});});} \ No newline at end of file +var _0x829f=['rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5a5dc2,_0x37d996){var _0x4f3036=function(_0x31485){while(--_0x31485){_0x5a5dc2['push'](_0x5a5dc2['shift']());}};_0x4f3036(++_0x37d996);}(_0x829f,0x134));var _0xf829=function(_0x40a755,_0x5ccfd0){_0x40a755=_0x40a755-0x0;var _0xe4e8bc=_0x829f[_0x40a755];return _0xe4e8bc;};'use strict';var _=require('lodash');var util=require(_0xf829('0x0'));var moment=require('moment');var BPromise=require(_0xf829('0x1'));var rs=require(_0xf829('0x2'));var fs=require('fs');var Redis=require(_0xf829('0x3'));var db=require(_0xf829('0x4'))['db'];var utils=require(_0xf829('0x5'));var logger=require(_0xf829('0x6'))(_0xf829('0x7'));var config=require(_0xf829('0x8'));var jayson=require(_0xf829('0x9'));var client=jayson[_0xf829('0xa')][_0xf829('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb62fe2,_0x31bca4,_0x1cff81){return new BPromise(function(_0x47e6c7,_0x267e97){return client['request'](_0xb62fe2,_0x1cff81)[_0xf829('0xc')](function(_0x5ce344){logger[_0xf829('0xd')](_0xf829('0xe'),_0x31bca4,_0xf829('0xf'));logger[_0xf829('0x10')](_0xf829('0x11'),_0x31bca4,_0xf829('0xf'),JSON['stringify'](_0x5ce344));if(_0x5ce344['error']){if(_0x5ce344[_0xf829('0x12')]['code']===0x1f4){logger[_0xf829('0x12')](_0xf829('0xe'),_0x31bca4,_0x5ce344['error'][_0xf829('0x13')]);return _0x267e97(_0x5ce344[_0xf829('0x12')][_0xf829('0x13')]);}logger[_0xf829('0x12')](_0xf829('0xe'),_0x31bca4,_0x5ce344[_0xf829('0x12')][_0xf829('0x13')]);return _0x47e6c7(_0x5ce344['error']['message']);}else{logger['info'](_0xf829('0xe'),_0x31bca4,'request\x20sent');_0x47e6c7(_0x5ce344['result'][_0xf829('0x13')]);}})[_0xf829('0x14')](function(_0xf3b93){logger[_0xf829('0x12')](_0xf829('0xe'),_0x31bca4,_0xf3b93);_0x267e97(_0xf3b93);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 7873786..0724d14 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 _0x5d01=['/describe','describe','/:id','post','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','./userProfileSection.controller','get','isAuthenticated','index'];(function(_0x40911a,_0x55ec99){var _0x27e8e3=function(_0x2ba910){while(--_0x2ba910){_0x40911a['push'](_0x40911a['shift']());}};_0x27e8e3(++_0x55ec99);}(_0x5d01,0xe5));var _0x15d0=function(_0x2064e7,_0x5edb67){_0x2064e7=_0x2064e7-0x0;var _0x35b7d4=_0x5d01[_0x2064e7];return _0x35b7d4;};'use strict';var multer=require(_0x15d0('0x0'));var util=require('util');var path=require(_0x15d0('0x1'));var timeout=require(_0x15d0('0x2'));var express=require('express');var router=express[_0x15d0('0x3')]();var auth=require(_0x15d0('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x15d0('0x5'));router[_0x15d0('0x6')]('/',auth[_0x15d0('0x7')](),controller[_0x15d0('0x8')]);router[_0x15d0('0x6')](_0x15d0('0x9'),auth[_0x15d0('0x7')](),controller[_0x15d0('0xa')]);router['get'](_0x15d0('0xb'),auth[_0x15d0('0x7')](),controller['show']);router[_0x15d0('0xc')]('/',auth[_0x15d0('0x7')](),controller['create']);router['put']('/:id',auth[_0x15d0('0x7')](),controller[_0x15d0('0xd')]);router[_0x15d0('0xe')](_0x15d0('0xb'),auth['isAuthenticated'](),controller[_0x15d0('0xf')]);module[_0x15d0('0x10')]=router; \ No newline at end of file +var _0x2544=['create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post'];(function(_0x177653,_0x2bf8fd){var _0x46093d=function(_0x40827c){while(--_0x40827c){_0x177653['push'](_0x177653['shift']());}};_0x46093d(++_0x2bf8fd);}(_0x2544,0x8b));var _0x4254=function(_0x5958da,_0x1b1f59){_0x5958da=_0x5958da-0x0;var _0x692fc7=_0x2544[_0x5958da];return _0x692fc7;};'use strict';var multer=require(_0x4254('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4254('0x1'));var express=require(_0x4254('0x2'));var router=express[_0x4254('0x3')]();var auth=require(_0x4254('0x4'));var interaction=require(_0x4254('0x5'));var config=require(_0x4254('0x6'));var controller=require('./userProfileSection.controller');router[_0x4254('0x7')]('/',auth[_0x4254('0x8')](),controller['index']);router[_0x4254('0x7')](_0x4254('0x9'),auth[_0x4254('0x8')](),controller['describe']);router['get'](_0x4254('0xa'),auth[_0x4254('0x8')](),controller[_0x4254('0xb')]);router[_0x4254('0xc')]('/',auth['isAuthenticated'](),controller[_0x4254('0xd')]);router[_0x4254('0xe')]('/:id',auth[_0x4254('0x8')](),controller[_0x4254('0xf')]);router[_0x4254('0x10')]('/:id',auth[_0x4254('0x8')](),controller[_0x4254('0x11')]);module[_0x4254('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 3c32226..ce86a85 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 _0x7531=['split','sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue'];(function(_0x27080c,_0x594531){var _0x487539=function(_0x467524){while(--_0x467524){_0x27080c['push'](_0x27080c['shift']());}};_0x487539(++_0x594531);}(_0x7531,0x69));var _0x1753=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7531[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x1753('0x0'));module[_0x1753('0x1')]={'name':{'type':Sequelize[_0x1753('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x1753('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x1753('0x2')],'set':function(_0x5595df){this[_0x1753('0x4')](_0x1753('0x5'),_0x5595df?_0x5595df['join'](''):[]);},'get':function(){return this[_0x1753('0x6')](_0x1753('0x5'))?this[_0x1753('0x6')](_0x1753('0x5'))[_0x1753('0x7')](''):[];}}}; \ No newline at end of file +var _0xab55=['STRING','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports'];(function(_0x364c4b,_0xbd0313){var _0x630f99=function(_0x288784){while(--_0x288784){_0x364c4b['push'](_0x364c4b['shift']());}};_0x630f99(++_0xbd0313);}(_0xab55,0x139));var _0x5ab5=function(_0x341ac8,_0x3cbbe2){_0x341ac8=_0x341ac8-0x0;var _0x55bf7b=_0xab55[_0x341ac8];return _0x55bf7b;};'use strict';var Sequelize=require(_0x5ab5('0x0'));module[_0x5ab5('0x1')]={'name':{'type':Sequelize[_0x5ab5('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x5ab5('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x5ab5('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x5ab5('0x2')],'set':function(_0x10001e){this[_0x5ab5('0x4')](_0x5ab5('0x5'),_0x10001e?_0x10001e[_0x5ab5('0x6')](''):[]);},'get':function(){return this[_0x5ab5('0x7')](_0x5ab5('0x5'))?this[_0x5ab5('0x7')](_0x5ab5('0x5'))[_0x5ab5('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index ecaca39..27eef3c 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 _0x7217=['query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','type','key','VIRTUAL','field','includeAll','findAll','rows','catch','show','params','include','merge','options','find','create','body','update','describe','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','apply','reject','save','then','destroy','end','error','stack','name','send','index','UserProfileSection','rawAttributes','model','keys'];(function(_0x43254,_0x2f3639){var _0x4f3510=function(_0x21dcfc){while(--_0x21dcfc){_0x43254['push'](_0x43254['shift']());}};_0x4f3510(++_0x2f3639);}(_0x7217,0x19e));var _0x7721=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x7217[_0x4dbaad];return _0x226c72;};'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 hardwareService=require(_0x7721('0x14'));var logger=require(_0x7721('0x15'))(_0x7721('0x16'));var utils=require(_0x7721('0x17'));var config=require(_0x7721('0x18'));var db=require(_0x7721('0x19'))['db'];function respondWithStatusCode(_0x1e7fd7,_0x27b36b){_0x27b36b=_0x27b36b||0xcc;return function(_0x55b4ca){if(_0x55b4ca){return _0x1e7fd7[_0x7721('0x1a')](_0x27b36b);}return _0x1e7fd7[_0x7721('0x1b')](_0x27b36b)['end']();};}function respondWithResult(_0x109900,_0x30da54){_0x30da54=_0x30da54||0xc8;return function(_0x3f01c5){if(_0x3f01c5){return _0x109900[_0x7721('0x1b')](_0x30da54)['json'](_0x3f01c5);}};}function respondWithFilteredResult(_0x3cbce8,_0x25b1c0){return function(_0x534f1b){if(_0x534f1b){var _0x4e199a=_0x534f1b[_0x7721('0x1c')],_0x4b183e=_0x25b1c0[_0x7721('0x1d')],_0x5ed54=_0x25b1c0['offset']+_0x25b1c0[_0x7721('0x1e')],_0x25a628;if(_0x5ed54>=_0x4e199a){_0x5ed54=_0x4e199a;_0x25a628=0xc8;}else{_0x25a628=0xce;}_0x3cbce8['status'](_0x25a628);return _0x3cbce8[_0x7721('0x1f')]('Content-Range',_0x4b183e+'-'+_0x5ed54+'/'+_0x4e199a)[_0x7721('0x20')](_0x534f1b);}return null;};}function patchUpdates(_0x4e96fb){return function(_0x3ab5a5){try{jsonpatch[_0x7721('0x21')](_0x3ab5a5,_0x4e96fb,!![]);}catch(_0x2286e5){return BPromise[_0x7721('0x22')](_0x2286e5);}return _0x3ab5a5[_0x7721('0x23')]();};}function saveUpdates(_0x413263,_0x3b29ac){return function(_0xaeccc4){if(_0xaeccc4){return _0xaeccc4['update'](_0x413263)[_0x7721('0x24')](function(_0x2c1583){return _0x2c1583;});}return null;};}function removeEntity(_0x3a053f,_0xd8ad3c){return function(_0x57140c){if(_0x57140c){return _0x57140c[_0x7721('0x25')]()['then'](function(){_0x3a053f[_0x7721('0x1b')](0xcc)[_0x7721('0x26')]();});}};}function handleEntityNotFound(_0x3e8a4e,_0x1caad8){return function(_0x121cc4){if(!_0x121cc4){_0x3e8a4e[_0x7721('0x1a')](0x194);}return _0x121cc4;};}function handleError(_0x2c6b7b,_0x5b4d74){_0x5b4d74=_0x5b4d74||0x1f4;return function(_0x216f20){logger[_0x7721('0x27')](_0x216f20[_0x7721('0x28')]);if(_0x216f20[_0x7721('0x29')]){delete _0x216f20[_0x7721('0x29')];}_0x2c6b7b[_0x7721('0x1b')](_0x5b4d74)[_0x7721('0x2a')](_0x216f20);};}exports[_0x7721('0x2b')]=function(_0x40f367,_0x52316e){var _0x258ddf={},_0x5b0551={},_0x499b87={'count':0x0,'rows':[]};var _0x315202=db[_0x7721('0x2c')][_0x7721('0x2d')];_0x5b0551[_0x7721('0x2e')]=_[_0x7721('0x2f')](_0x315202);_0x5b0551[_0x7721('0x30')]=_[_0x7721('0x2f')](_0x40f367[_0x7721('0x30')]);_0x5b0551['filters']=_[_0x7721('0x31')](_0x5b0551[_0x7721('0x2e')],_0x5b0551['query']);_0x258ddf['attributes']=_[_0x7721('0x31')](_0x5b0551[_0x7721('0x2e')],qs['fields'](_0x40f367[_0x7721('0x30')][_0x7721('0x32')]));_0x258ddf[_0x7721('0x33')]=_0x258ddf['attributes'][_0x7721('0x34')]?_0x258ddf[_0x7721('0x33')]:_0x5b0551[_0x7721('0x2e')];if(!_0x40f367[_0x7721('0x30')][_0x7721('0x35')]('nolimit')){_0x258ddf[_0x7721('0x1e')]=qs[_0x7721('0x1e')](_0x40f367[_0x7721('0x30')]['limit']);_0x258ddf[_0x7721('0x1d')]=qs[_0x7721('0x1d')](_0x40f367['query'][_0x7721('0x1d')]);}_0x258ddf['order']=qs[_0x7721('0x36')](_0x40f367[_0x7721('0x30')][_0x7721('0x36')]);_0x258ddf[_0x7721('0x37')]=qs[_0x7721('0x38')](_[_0x7721('0x39')](_0x40f367[_0x7721('0x30')],_0x5b0551[_0x7721('0x38')]));if(_0x40f367[_0x7721('0x30')][_0x7721('0x3a')]){_0x258ddf[_0x7721('0x37')]=_['merge'](_0x258ddf[_0x7721('0x37')],{'$or':_['map'](_0x315202,function(_0x212384){if(_0x212384[_0x7721('0x3b')][_0x7721('0x3c')]!==_0x7721('0x3d')){var _0x3968f3={};_0x3968f3[_0x212384[_0x7721('0x3e')]]={'$like':'%'+_0x40f367['query']['filter']+'%'};return _0x3968f3;}})});}_0x258ddf=_['merge']({},_0x258ddf,_0x40f367['options']);var _0x18001c={'where':_0x258ddf[_0x7721('0x37')]};return db[_0x7721('0x2c')][_0x7721('0x1c')](_0x18001c)['then'](function(_0xa389fa){_0x499b87['count']=_0xa389fa;if(_0x40f367[_0x7721('0x30')][_0x7721('0x3f')]){_0x258ddf['include']=[{'all':!![]}];}return db[_0x7721('0x2c')][_0x7721('0x40')](_0x258ddf);})['then'](function(_0x4d0111){_0x499b87[_0x7721('0x41')]=_0x4d0111;return _0x499b87;})[_0x7721('0x24')](respondWithFilteredResult(_0x52316e,_0x258ddf))[_0x7721('0x42')](handleError(_0x52316e,null));};exports[_0x7721('0x43')]=function(_0x577af9,_0x2db173){var _0x120de9={'raw':![],'where':{'id':_0x577af9[_0x7721('0x44')]['id']}},_0x40ce8c={};_0x40ce8c[_0x7721('0x2e')]=_['keys'](db[_0x7721('0x2c')]['rawAttributes']);_0x40ce8c[_0x7721('0x30')]=_['keys'](_0x577af9[_0x7721('0x30')]);_0x40ce8c[_0x7721('0x38')]=_[_0x7721('0x31')](_0x40ce8c['model'],_0x40ce8c[_0x7721('0x30')]);_0x120de9[_0x7721('0x33')]=_[_0x7721('0x31')](_0x40ce8c['model'],qs[_0x7721('0x32')](_0x577af9[_0x7721('0x30')][_0x7721('0x32')]));_0x120de9[_0x7721('0x33')]=_0x120de9[_0x7721('0x33')][_0x7721('0x34')]?_0x120de9[_0x7721('0x33')]:_0x40ce8c['model'];if(_0x577af9['query'][_0x7721('0x3f')]){_0x120de9[_0x7721('0x45')]=[{'all':!![]}];}_0x120de9=_[_0x7721('0x46')]({},_0x120de9,_0x577af9[_0x7721('0x47')]);return db[_0x7721('0x2c')][_0x7721('0x48')](_0x120de9)[_0x7721('0x24')](handleEntityNotFound(_0x2db173,null))[_0x7721('0x24')](respondWithResult(_0x2db173,null))[_0x7721('0x42')](handleError(_0x2db173,null));};exports[_0x7721('0x49')]=function(_0x5460cd,_0x578867){return db[_0x7721('0x2c')][_0x7721('0x49')](_0x5460cd[_0x7721('0x4a')],{})[_0x7721('0x24')](respondWithResult(_0x578867,0xc9))['catch'](handleError(_0x578867,null));};exports[_0x7721('0x4b')]=function(_0x2d5a88,_0x56c3d9){if(_0x2d5a88[_0x7721('0x4a')]['id']){delete _0x2d5a88['body']['id'];}return db[_0x7721('0x2c')]['find']({'where':{'id':_0x2d5a88[_0x7721('0x44')]['id']}})[_0x7721('0x24')](handleEntityNotFound(_0x56c3d9,null))[_0x7721('0x24')](saveUpdates(_0x2d5a88['body'],null))[_0x7721('0x24')](respondWithResult(_0x56c3d9,null))[_0x7721('0x42')](handleError(_0x56c3d9,null));};exports['destroy']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x2c')]['find']({'where':{'id':_0x223d93[_0x7721('0x44')]['id']}})['then'](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x24')](removeEntity(_0x1196c2,null))[_0x7721('0x42')](handleError(_0x1196c2,null));};exports[_0x7721('0x4c')]=function(_0x443503,_0x1c95d8){return db[_0x7721('0x2c')][_0x7721('0x4c')]()[_0x7721('0x24')](respondWithResult(_0x1c95d8,null))[_0x7721('0x42')](handleError(_0x1c95d8,null));}; \ No newline at end of file +var _0x7217=['query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','type','key','VIRTUAL','field','includeAll','findAll','rows','catch','show','params','include','merge','options','find','create','body','update','describe','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','apply','reject','save','then','destroy','end','error','stack','name','send','index','UserProfileSection','rawAttributes','model','keys'];(function(_0x304f9e,_0x68653){var _0x4d98d3=function(_0x282657){while(--_0x282657){_0x304f9e['push'](_0x304f9e['shift']());}};_0x4d98d3(++_0x68653);}(_0x7217,0x19e));var _0x7721=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x7217[_0x5b78e8];return _0xf2c321;};'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 hardwareService=require(_0x7721('0x14'));var logger=require(_0x7721('0x15'))(_0x7721('0x16'));var utils=require(_0x7721('0x17'));var config=require(_0x7721('0x18'));var db=require(_0x7721('0x19'))['db'];function respondWithStatusCode(_0x1e7fd7,_0x27b36b){_0x27b36b=_0x27b36b||0xcc;return function(_0x55b4ca){if(_0x55b4ca){return _0x1e7fd7[_0x7721('0x1a')](_0x27b36b);}return _0x1e7fd7[_0x7721('0x1b')](_0x27b36b)['end']();};}function respondWithResult(_0x109900,_0x30da54){_0x30da54=_0x30da54||0xc8;return function(_0x3f01c5){if(_0x3f01c5){return _0x109900[_0x7721('0x1b')](_0x30da54)['json'](_0x3f01c5);}};}function respondWithFilteredResult(_0x3cbce8,_0x25b1c0){return function(_0x534f1b){if(_0x534f1b){var _0x4e199a=_0x534f1b[_0x7721('0x1c')],_0x4b183e=_0x25b1c0[_0x7721('0x1d')],_0x5ed54=_0x25b1c0['offset']+_0x25b1c0[_0x7721('0x1e')],_0x25a628;if(_0x5ed54>=_0x4e199a){_0x5ed54=_0x4e199a;_0x25a628=0xc8;}else{_0x25a628=0xce;}_0x3cbce8['status'](_0x25a628);return _0x3cbce8[_0x7721('0x1f')]('Content-Range',_0x4b183e+'-'+_0x5ed54+'/'+_0x4e199a)[_0x7721('0x20')](_0x534f1b);}return null;};}function patchUpdates(_0x4e96fb){return function(_0x3ab5a5){try{jsonpatch[_0x7721('0x21')](_0x3ab5a5,_0x4e96fb,!![]);}catch(_0x2286e5){return BPromise[_0x7721('0x22')](_0x2286e5);}return _0x3ab5a5[_0x7721('0x23')]();};}function saveUpdates(_0x413263,_0x3b29ac){return function(_0xaeccc4){if(_0xaeccc4){return _0xaeccc4['update'](_0x413263)[_0x7721('0x24')](function(_0x2c1583){return _0x2c1583;});}return null;};}function removeEntity(_0x3a053f,_0xd8ad3c){return function(_0x57140c){if(_0x57140c){return _0x57140c[_0x7721('0x25')]()['then'](function(){_0x3a053f[_0x7721('0x1b')](0xcc)[_0x7721('0x26')]();});}};}function handleEntityNotFound(_0x3e8a4e,_0x1caad8){return function(_0x121cc4){if(!_0x121cc4){_0x3e8a4e[_0x7721('0x1a')](0x194);}return _0x121cc4;};}function handleError(_0x2c6b7b,_0x5b4d74){_0x5b4d74=_0x5b4d74||0x1f4;return function(_0x216f20){logger[_0x7721('0x27')](_0x216f20[_0x7721('0x28')]);if(_0x216f20[_0x7721('0x29')]){delete _0x216f20[_0x7721('0x29')];}_0x2c6b7b[_0x7721('0x1b')](_0x5b4d74)[_0x7721('0x2a')](_0x216f20);};}exports[_0x7721('0x2b')]=function(_0x40f367,_0x52316e){var _0x258ddf={},_0x5b0551={},_0x499b87={'count':0x0,'rows':[]};var _0x315202=db[_0x7721('0x2c')][_0x7721('0x2d')];_0x5b0551[_0x7721('0x2e')]=_[_0x7721('0x2f')](_0x315202);_0x5b0551[_0x7721('0x30')]=_[_0x7721('0x2f')](_0x40f367[_0x7721('0x30')]);_0x5b0551['filters']=_[_0x7721('0x31')](_0x5b0551[_0x7721('0x2e')],_0x5b0551['query']);_0x258ddf['attributes']=_[_0x7721('0x31')](_0x5b0551[_0x7721('0x2e')],qs['fields'](_0x40f367[_0x7721('0x30')][_0x7721('0x32')]));_0x258ddf[_0x7721('0x33')]=_0x258ddf['attributes'][_0x7721('0x34')]?_0x258ddf[_0x7721('0x33')]:_0x5b0551[_0x7721('0x2e')];if(!_0x40f367[_0x7721('0x30')][_0x7721('0x35')]('nolimit')){_0x258ddf[_0x7721('0x1e')]=qs[_0x7721('0x1e')](_0x40f367[_0x7721('0x30')]['limit']);_0x258ddf[_0x7721('0x1d')]=qs[_0x7721('0x1d')](_0x40f367['query'][_0x7721('0x1d')]);}_0x258ddf['order']=qs[_0x7721('0x36')](_0x40f367[_0x7721('0x30')][_0x7721('0x36')]);_0x258ddf[_0x7721('0x37')]=qs[_0x7721('0x38')](_[_0x7721('0x39')](_0x40f367[_0x7721('0x30')],_0x5b0551[_0x7721('0x38')]));if(_0x40f367[_0x7721('0x30')][_0x7721('0x3a')]){_0x258ddf[_0x7721('0x37')]=_['merge'](_0x258ddf[_0x7721('0x37')],{'$or':_['map'](_0x315202,function(_0x212384){if(_0x212384[_0x7721('0x3b')][_0x7721('0x3c')]!==_0x7721('0x3d')){var _0x3968f3={};_0x3968f3[_0x212384[_0x7721('0x3e')]]={'$like':'%'+_0x40f367['query']['filter']+'%'};return _0x3968f3;}})});}_0x258ddf=_['merge']({},_0x258ddf,_0x40f367['options']);var _0x18001c={'where':_0x258ddf[_0x7721('0x37')]};return db[_0x7721('0x2c')][_0x7721('0x1c')](_0x18001c)['then'](function(_0xa389fa){_0x499b87['count']=_0xa389fa;if(_0x40f367[_0x7721('0x30')][_0x7721('0x3f')]){_0x258ddf['include']=[{'all':!![]}];}return db[_0x7721('0x2c')][_0x7721('0x40')](_0x258ddf);})['then'](function(_0x4d0111){_0x499b87[_0x7721('0x41')]=_0x4d0111;return _0x499b87;})[_0x7721('0x24')](respondWithFilteredResult(_0x52316e,_0x258ddf))[_0x7721('0x42')](handleError(_0x52316e,null));};exports[_0x7721('0x43')]=function(_0x577af9,_0x2db173){var _0x120de9={'raw':![],'where':{'id':_0x577af9[_0x7721('0x44')]['id']}},_0x40ce8c={};_0x40ce8c[_0x7721('0x2e')]=_['keys'](db[_0x7721('0x2c')]['rawAttributes']);_0x40ce8c[_0x7721('0x30')]=_['keys'](_0x577af9[_0x7721('0x30')]);_0x40ce8c[_0x7721('0x38')]=_[_0x7721('0x31')](_0x40ce8c['model'],_0x40ce8c[_0x7721('0x30')]);_0x120de9[_0x7721('0x33')]=_[_0x7721('0x31')](_0x40ce8c['model'],qs[_0x7721('0x32')](_0x577af9[_0x7721('0x30')][_0x7721('0x32')]));_0x120de9[_0x7721('0x33')]=_0x120de9[_0x7721('0x33')][_0x7721('0x34')]?_0x120de9[_0x7721('0x33')]:_0x40ce8c['model'];if(_0x577af9['query'][_0x7721('0x3f')]){_0x120de9[_0x7721('0x45')]=[{'all':!![]}];}_0x120de9=_[_0x7721('0x46')]({},_0x120de9,_0x577af9[_0x7721('0x47')]);return db[_0x7721('0x2c')][_0x7721('0x48')](_0x120de9)[_0x7721('0x24')](handleEntityNotFound(_0x2db173,null))[_0x7721('0x24')](respondWithResult(_0x2db173,null))[_0x7721('0x42')](handleError(_0x2db173,null));};exports[_0x7721('0x49')]=function(_0x5460cd,_0x578867){return db[_0x7721('0x2c')][_0x7721('0x49')](_0x5460cd[_0x7721('0x4a')],{})[_0x7721('0x24')](respondWithResult(_0x578867,0xc9))['catch'](handleError(_0x578867,null));};exports[_0x7721('0x4b')]=function(_0x2d5a88,_0x56c3d9){if(_0x2d5a88[_0x7721('0x4a')]['id']){delete _0x2d5a88['body']['id'];}return db[_0x7721('0x2c')]['find']({'where':{'id':_0x2d5a88[_0x7721('0x44')]['id']}})[_0x7721('0x24')](handleEntityNotFound(_0x56c3d9,null))[_0x7721('0x24')](saveUpdates(_0x2d5a88['body'],null))[_0x7721('0x24')](respondWithResult(_0x56c3d9,null))[_0x7721('0x42')](handleError(_0x56c3d9,null));};exports['destroy']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x2c')]['find']({'where':{'id':_0x223d93[_0x7721('0x44')]['id']}})['then'](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x24')](removeEntity(_0x1196c2,null))[_0x7721('0x42')](handleError(_0x1196c2,null));};exports[_0x7721('0x4c')]=function(_0x443503,_0x1c95d8){return db[_0x7721('0x2c')][_0x7721('0x4c')]()[_0x7721('0x24')](respondWithResult(_0x1c95d8,null))[_0x7721('0x42')](handleError(_0x1c95d8,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index f289e67..ae01fec 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 _0xcee5=['compositeIndex','sectionId','userProfileId','lodash','util','api','request-promise','path','rimraf','./userProfileSection.attributes','exports','define','user_profile_has_sections'];(function(_0x211fef,_0x4ab716){var _0x5447bf=function(_0x306ea3){while(--_0x306ea3){_0x211fef['push'](_0x211fef['shift']());}};_0x5447bf(++_0x4ab716);}(_0xcee5,0xd3));var _0x5cee=function(_0x419e70,_0x1b773c){_0x419e70=_0x419e70-0x0;var _0x3c891a=_0xcee5[_0x419e70];return _0x3c891a;};'use strict';var _=require(_0x5cee('0x0'));var util=require(_0x5cee('0x1'));var logger=require('../../config/logger')(_0x5cee('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5cee('0x3'));var fs=require('fs');var path=require(_0x5cee('0x4'));var rimraf=require(_0x5cee('0x5'));var config=require('../../config/environment');var attributes=require(_0x5cee('0x6'));module[_0x5cee('0x7')]=function(_0x16a627,_0xaf9e07){return _0x16a627[_0x5cee('0x8')]('UserProfileSection',attributes,{'tableName':_0x5cee('0x9'),'paranoid':![],'indexes':[{'name':_0x5cee('0xa'),'fields':[_0x5cee('0xb'),_0x5cee('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3d76=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','util','../../config/logger','api'];(function(_0x5cd40f,_0x5c24ca){var _0x461761=function(_0x4166a0){while(--_0x4166a0){_0x5cd40f['push'](_0x5cd40f['shift']());}};_0x461761(++_0x5c24ca);}(_0x3d76,0x13c));var _0x63d7=function(_0x58cbde,_0x4b0f62){_0x58cbde=_0x58cbde-0x0;var _0x5799f3=_0x3d76[_0x58cbde];return _0x5799f3;};'use strict';var _=require(_0x63d7('0x0'));var util=require(_0x63d7('0x1'));var logger=require(_0x63d7('0x2'))(_0x63d7('0x3'));var moment=require(_0x63d7('0x4'));var BPromise=require(_0x63d7('0x5'));var rp=require(_0x63d7('0x6'));var fs=require('fs');var path=require(_0x63d7('0x7'));var rimraf=require(_0x63d7('0x8'));var config=require(_0x63d7('0x9'));var attributes=require('./userProfileSection.attributes');module[_0x63d7('0xa')]=function(_0x339be4,_0x3a1069){return _0x339be4[_0x63d7('0xb')](_0x63d7('0xc'),attributes,{'tableName':_0x63d7('0xd'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x63d7('0xe'),_0x63d7('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 7a95ba7..54cddb2 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 _0x2bd1=['request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x2f6361,_0x1c46e1){var _0x5866b9=function(_0x2fb713){while(--_0x2fb713){_0x2f6361['push'](_0x2f6361['shift']());}};_0x5866b9(++_0x1c46e1);}(_0x2bd1,0x192));var _0x12bd=function(_0x28153b,_0x4ba330){_0x28153b=_0x28153b-0x0;var _0x2030b0=_0x2bd1[_0x28153b];return _0x2030b0;};'use strict';var _=require(_0x12bd('0x0'));var util=require(_0x12bd('0x1'));var moment=require(_0x12bd('0x2'));var BPromise=require(_0x12bd('0x3'));var rs=require(_0x12bd('0x4'));var fs=require('fs');var Redis=require(_0x12bd('0x5'));var db=require(_0x12bd('0x6'))['db'];var utils=require(_0x12bd('0x7'));var logger=require(_0x12bd('0x8'))(_0x12bd('0x9'));var config=require(_0x12bd('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x12bd('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x141c01,_0x5786cf,_0x45925c){return new BPromise(function(_0x5dd4e4,_0x109695){return client[_0x12bd('0xc')](_0x141c01,_0x45925c)['then'](function(_0x34c795){logger[_0x12bd('0xd')](_0x12bd('0xe'),_0x5786cf,_0x12bd('0xf'));logger[_0x12bd('0x10')](_0x12bd('0x11'),_0x5786cf,_0x12bd('0xf'),JSON[_0x12bd('0x12')](_0x34c795));if(_0x34c795[_0x12bd('0x13')]){if(_0x34c795[_0x12bd('0x13')][_0x12bd('0x14')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x5786cf,_0x34c795[_0x12bd('0x13')][_0x12bd('0x15')]);return _0x109695(_0x34c795[_0x12bd('0x13')][_0x12bd('0x15')]);}logger[_0x12bd('0x13')](_0x12bd('0xe'),_0x5786cf,_0x34c795[_0x12bd('0x13')][_0x12bd('0x15')]);return _0x5dd4e4(_0x34c795[_0x12bd('0x13')]['message']);}else{logger[_0x12bd('0xd')](_0x12bd('0xe'),_0x5786cf,'request\x20sent');_0x5dd4e4(_0x34c795[_0x12bd('0x16')][_0x12bd('0x15')]);}})['catch'](function(_0x36974e){logger[_0x12bd('0x13')](_0x12bd('0xe'),_0x5786cf,_0x36974e);_0x109695(_0x36974e);});});} \ No newline at end of file +var _0xbe3b=['request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x4ab36a,_0x1377c9){var _0xcca942=function(_0x3add62){while(--_0x3add62){_0x4ab36a['push'](_0x4ab36a['shift']());}};_0xcca942(++_0x1377c9);}(_0xbe3b,0x19c));var _0xbbe3=function(_0x1de1c9,_0x179709){_0x1de1c9=_0x1de1c9-0x0;var _0x41618e=_0xbe3b[_0x1de1c9];return _0x41618e;};'use strict';var _=require('lodash');var util=require(_0xbbe3('0x0'));var moment=require(_0xbbe3('0x1'));var BPromise=require('bluebird');var rs=require(_0xbbe3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbbe3('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xbbe3('0x4'));var jayson=require(_0xbbe3('0x5'));var client=jayson[_0xbbe3('0x6')][_0xbbe3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4c6976,_0x9bd4a9,_0x748756){return new BPromise(function(_0x40199b,_0x3c0c43){return client[_0xbbe3('0x8')](_0x4c6976,_0x748756)['then'](function(_0x1ff205){logger[_0xbbe3('0x9')](_0xbbe3('0xa'),_0x9bd4a9,_0xbbe3('0xb'));logger[_0xbbe3('0xc')](_0xbbe3('0xd'),_0x9bd4a9,_0xbbe3('0xb'),JSON[_0xbbe3('0xe')](_0x1ff205));if(_0x1ff205['error']){if(_0x1ff205[_0xbbe3('0xf')][_0xbbe3('0x10')]===0x1f4){logger[_0xbbe3('0xf')](_0xbbe3('0xa'),_0x9bd4a9,_0x1ff205['error']['message']);return _0x3c0c43(_0x1ff205[_0xbbe3('0xf')][_0xbbe3('0x11')]);}logger[_0xbbe3('0xf')](_0xbbe3('0xa'),_0x9bd4a9,_0x1ff205[_0xbbe3('0xf')][_0xbbe3('0x11')]);return _0x40199b(_0x1ff205['error'][_0xbbe3('0x11')]);}else{logger['info'](_0xbbe3('0xa'),_0x9bd4a9,_0xbbe3('0xb'));_0x40199b(_0x1ff205[_0xbbe3('0x12')][_0xbbe3('0x11')]);}})[_0xbbe3('0x13')](function(_0x2af60d){logger[_0xbbe3('0xf')](_0xbbe3('0xa'),_0x9bd4a9,_0x2af60d);_0x3c0c43(_0x2af60d);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 26d47ea..0afc5e2 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 _0x58b7=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x13c644,_0x12989d){var _0x2d56dd=function(_0x77007b){while(--_0x77007b){_0x13c644['push'](_0x13c644['shift']());}};_0x2d56dd(++_0x12989d);}(_0x58b7,0x1e4));var _0x758b=function(_0x633333,_0x343ea4){_0x633333=_0x633333-0x0;var _0x341f83=_0x58b7[_0x633333];return _0x341f83;};'use strict';var multer=require(_0x758b('0x0'));var util=require(_0x758b('0x1'));var path=require(_0x758b('0x2'));var timeout=require(_0x758b('0x3'));var express=require(_0x758b('0x4'));var router=express[_0x758b('0x5')]();var auth=require(_0x758b('0x6'));var interaction=require(_0x758b('0x7'));var config=require(_0x758b('0x8'));module[_0x758b('0x9')]=router; \ No newline at end of file +var _0x5872=['../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util','path','connect-timeout','express'];(function(_0x1da289,_0x417651){var _0x41c889=function(_0x2cea8c){while(--_0x2cea8c){_0x1da289['push'](_0x1da289['shift']());}};_0x41c889(++_0x417651);}(_0x5872,0x18b));var _0x2587=function(_0x4429e0,_0xee6f1f){_0x4429e0=_0x4429e0-0x0;var _0x51a5b3=_0x5872[_0x4429e0];return _0x51a5b3;};'use strict';var multer=require(_0x2587('0x0'));var util=require(_0x2587('0x1'));var path=require(_0x2587('0x2'));var timeout=require(_0x2587('0x3'));var express=require(_0x2587('0x4'));var router=express['Router']();var auth=require(_0x2587('0x5'));var interaction=require(_0x2587('0x6'));var config=require(_0x2587('0x7'));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 1e9fa8f..d9fe7c8 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 _0xbaf0=['exports','INTEGER'];(function(_0x13b7fd,_0x4eaf7f){var _0x32a74a=function(_0x2c5d80){while(--_0x2c5d80){_0x13b7fd['push'](_0x13b7fd['shift']());}};_0x32a74a(++_0x4eaf7f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x4668a6,_0x4e8a1f){var _0x23215d=function(_0x4f4cfc){while(--_0x4f4cfc){_0x4668a6['push'](_0x4668a6['shift']());}};_0x23215d(++_0x4e8a1f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'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 cff40fa..52172da 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 _0x1c86=['moment','bluebird','request-promise','path','rimraf','./userSmsQueue.attributes','exports','define','user_has_sms_queues','lodash','util','../../config/logger','api'];(function(_0x30bed2,_0x2be3ef){var _0x3a8b13=function(_0x33ef38){while(--_0x33ef38){_0x30bed2['push'](_0x30bed2['shift']());}};_0x3a8b13(++_0x2be3ef);}(_0x1c86,0xb2));var _0x61c8=function(_0x29e6cb,_0x146b2f){_0x29e6cb=_0x29e6cb-0x0;var _0x26da01=_0x1c86[_0x29e6cb];return _0x26da01;};'use strict';var _=require(_0x61c8('0x0'));var util=require(_0x61c8('0x1'));var logger=require(_0x61c8('0x2'))(_0x61c8('0x3'));var moment=require(_0x61c8('0x4'));var BPromise=require(_0x61c8('0x5'));var rp=require(_0x61c8('0x6'));var fs=require('fs');var path=require(_0x61c8('0x7'));var rimraf=require(_0x61c8('0x8'));var config=require('../../config/environment');var attributes=require(_0x61c8('0x9'));module[_0x61c8('0xa')]=function(_0x2f9a05,_0x3718ce){return _0x2f9a05[_0x61c8('0xb')]('UserSmsQueue',attributes,{'tableName':_0x61c8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5991=['user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue'];(function(_0x2a876f,_0x5d551e){var _0x5ad1a7=function(_0x13f285){while(--_0x13f285){_0x2a876f['push'](_0x2a876f['shift']());}};_0x5ad1a7(++_0x5d551e);}(_0x5991,0xaa));var _0x1599=function(_0x43ed16,_0x45408b){_0x43ed16=_0x43ed16-0x0;var _0x25afba=_0x5991[_0x43ed16];return _0x25afba;};'use strict';var _=require(_0x1599('0x0'));var util=require(_0x1599('0x1'));var logger=require(_0x1599('0x2'))(_0x1599('0x3'));var moment=require(_0x1599('0x4'));var BPromise=require(_0x1599('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1599('0x6'));var rimraf=require('rimraf');var config=require(_0x1599('0x7'));var attributes=require(_0x1599('0x8'));module[_0x1599('0x9')]=function(_0x4d1f74,_0x5465ce){return _0x4d1f74[_0x1599('0xa')](_0x1599('0xb'),attributes,{'tableName':_0x1599('0xc'),'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 49ba61b..234b1db 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 _0x6758=['../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','UserSmsQueue,\x20%s,\x20%s','message','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x1ace6c,_0x2fc69d){var _0x36db31=function(_0x2e4a48){while(--_0x2e4a48){_0x1ace6c['push'](_0x1ace6c['shift']());}};_0x36db31(++_0x2fc69d);}(_0x6758,0x192));var _0x8675=function(_0x21a7c0,_0xd68d96){_0x21a7c0=_0x21a7c0-0x0;var _0x5c5af2=_0x6758[_0x21a7c0];return _0x5c5af2;};'use strict';var _=require('lodash');var util=require(_0x8675('0x0'));var moment=require('moment');var BPromise=require(_0x8675('0x1'));var rs=require(_0x8675('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8675('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8675('0x4'))(_0x8675('0x5'));var config=require(_0x8675('0x6'));var jayson=require(_0x8675('0x7'));var client=jayson[_0x8675('0x8')][_0x8675('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34d5f5,_0x282439,_0x3fc8cd){return new BPromise(function(_0x365105,_0x2f4332){return client[_0x8675('0xa')](_0x34d5f5,_0x3fc8cd)['then'](function(_0x3597dd){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x282439,_0x8675('0xb'));logger[_0x8675('0xc')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x282439,_0x8675('0xb'),JSON[_0x8675('0xd')](_0x3597dd));if(_0x3597dd[_0x8675('0xe')]){if(_0x3597dd[_0x8675('0xe')]['code']===0x1f4){logger[_0x8675('0xe')](_0x8675('0xf'),_0x282439,_0x3597dd['error'][_0x8675('0x10')]);return _0x2f4332(_0x3597dd[_0x8675('0xe')][_0x8675('0x10')]);}logger[_0x8675('0xe')](_0x8675('0xf'),_0x282439,_0x3597dd['error']['message']);return _0x365105(_0x3597dd[_0x8675('0xe')][_0x8675('0x10')]);}else{logger['info'](_0x8675('0xf'),_0x282439,_0x8675('0xb'));_0x365105(_0x3597dd['result']['message']);}})['catch'](function(_0xb9bbbb){logger[_0x8675('0xe')](_0x8675('0xf'),_0x282439,_0xb9bbbb);_0x2f4332(_0xb9bbbb);});});} \ No newline at end of file +var _0xe5ba=['error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','lodash','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0xe5ba,0xcc));var _0xae5b=function(_0x3d9f94,_0x41b706){_0x3d9f94=_0x3d9f94-0x0;var _0xaac592=_0xe5ba[_0x3d9f94];return _0xaac592;};'use strict';var _=require(_0xae5b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae5b('0x1'));var db=require(_0xae5b('0x2'))['db'];var utils=require(_0xae5b('0x3'));var logger=require('../../config/logger')(_0xae5b('0x4'));var config=require('../../config/environment');var jayson=require(_0xae5b('0x5'));var client=jayson['client'][_0xae5b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5ece9e,_0x556962,_0x26d534){return new BPromise(function(_0x3c9062,_0x4f672f){return client['request'](_0x5ece9e,_0x26d534)['then'](function(_0x37c255){logger[_0xae5b('0x7')]('UserSmsQueue,\x20%s,\x20%s',_0x556962,_0xae5b('0x8'));logger[_0xae5b('0x9')](_0xae5b('0xa'),_0x556962,_0xae5b('0x8'),JSON[_0xae5b('0xb')](_0x37c255));if(_0x37c255[_0xae5b('0xc')]){if(_0x37c255['error'][_0xae5b('0xd')]===0x1f4){logger['error'](_0xae5b('0xe'),_0x556962,_0x37c255['error']['message']);return _0x4f672f(_0x37c255[_0xae5b('0xc')][_0xae5b('0xf')]);}logger[_0xae5b('0xc')](_0xae5b('0xe'),_0x556962,_0x37c255[_0xae5b('0xc')]['message']);return _0x3c9062(_0x37c255[_0xae5b('0xc')]['message']);}else{logger['info'](_0xae5b('0xe'),_0x556962,_0xae5b('0x8'));_0x3c9062(_0x37c255[_0xae5b('0x10')][_0xae5b('0xf')]);}})[_0xae5b('0x11')](function(_0x403f10){logger['error'](_0xae5b('0xe'),_0x556962,_0x403f10);_0x4f672f(_0x403f10);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 8fa1082..54314a8 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 _0x33f5=['util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x38e3fc,_0x470cfa){var _0xade509=function(_0xc7a2e8){while(--_0xc7a2e8){_0x38e3fc['push'](_0x38e3fc['shift']());}};_0xade509(++_0x470cfa);}(_0x33f5,0xd7));var _0x533f=function(_0x52d01d,_0xd0fbe0){_0x52d01d=_0x52d01d-0x0;var _0x2fe916=_0x33f5[_0x52d01d];return _0x2fe916;};'use strict';var multer=require(_0x533f('0x0'));var util=require(_0x533f('0x1'));var path=require('path');var timeout=require(_0x533f('0x2'));var express=require('express');var router=express[_0x533f('0x3')]();var auth=require(_0x533f('0x4'));var interaction=require(_0x533f('0x5'));var config=require(_0x533f('0x6'));module[_0x533f('0x7')]=router; \ No newline at end of file +var _0x2367=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0x296864,_0x263a00){var _0x380007=function(_0x501063){while(--_0x501063){_0x296864['push'](_0x296864['shift']());}};_0x380007(++_0x263a00);}(_0x2367,0x1b6));var _0x7236=function(_0x7b48a5,_0x3bbc0a){_0x7b48a5=_0x7b48a5-0x0;var _0x117e38=_0x2367[_0x7b48a5];return _0x117e38;};'use strict';var multer=require(_0x7236('0x0'));var util=require(_0x7236('0x1'));var path=require(_0x7236('0x2'));var timeout=require(_0x7236('0x3'));var express=require(_0x7236('0x4'));var router=express['Router']();var auth=require(_0x7236('0x5'));var interaction=require(_0x7236('0x6'));var config=require(_0x7236('0x7'));module[_0x7236('0x8')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index cd219a2..68b9556 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 _0xbaf0=['exports','INTEGER'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_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 _0xbaf0=['exports','INTEGER'];(function(_0x44c8cb,_0x2e28c7){var _0x3bf406=function(_0x2dbe74){while(--_0x2dbe74){_0x44c8cb['push'](_0x44c8cb['shift']());}};_0x3bf406(++_0x2e28c7);}(_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/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 28e30fa..2248d89 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 _0xb458=['path','rimraf','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x83502a,_0x31925d){var _0x4468d5=function(_0x5295fb){while(--_0x5295fb){_0x83502a['push'](_0x83502a['shift']());}};_0x4468d5(++_0x31925d);}(_0xb458,0x103));var _0x8b45=function(_0x493836,_0x5af577){_0x493836=_0x493836-0x0;var _0x57b579=_0xb458[_0x493836];return _0x57b579;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var logger=require(_0x8b45('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8b45('0x3'));var rp=require(_0x8b45('0x4'));var fs=require('fs');var path=require(_0x8b45('0x5'));var rimraf=require(_0x8b45('0x6'));var config=require('../../config/environment');var attributes=require(_0x8b45('0x7'));module['exports']=function(_0x5cc2d5,_0xe8d774){return _0x5cc2d5[_0x8b45('0x8')](_0x8b45('0x9'),attributes,{'tableName':_0x8b45('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68fc=['bluebird','path','./userVoiceQueue.attributes','exports','user_has_voice_queues','lodash','util','../../config/logger'];(function(_0x432c08,_0x3f20c7){var _0x479dff=function(_0x58138b){while(--_0x58138b){_0x432c08['push'](_0x432c08['shift']());}};_0x479dff(++_0x3f20c7);}(_0x68fc,0xa5));var _0xc68f=function(_0x2447c0,_0x58b8c8){_0x2447c0=_0x2447c0-0x0;var _0x1ae728=_0x68fc[_0x2447c0];return _0x1ae728;};'use strict';var _=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var logger=require(_0xc68f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc68f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc68f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc68f('0x5'));module[_0xc68f('0x6')]=function(_0x1c6df9,_0x363cdf){return _0x1c6df9['define']('UserVoiceQueue',attributes,{'tableName':_0xc68f('0x7'),'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 c9205d4..3b5e291 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 _0x64f0=['info','result','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x46bb87,_0x5a88fa){var _0x304cdc=function(_0x277021){while(--_0x277021){_0x46bb87['push'](_0x46bb87['shift']());}};_0x304cdc(++_0x5a88fa);}(_0x64f0,0x192));var _0x064f=function(_0x308213,_0x224541){_0x308213=_0x308213-0x0;var _0x2e1619=_0x64f0[_0x308213];return _0x2e1619;};'use strict';var _=require('lodash');var util=require(_0x064f('0x0'));var moment=require(_0x064f('0x1'));var BPromise=require(_0x064f('0x2'));var rs=require(_0x064f('0x3'));var fs=require('fs');var Redis=require(_0x064f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x064f('0x5'))(_0x064f('0x6'));var config=require(_0x064f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x064f('0x8')][_0x064f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x191707,_0x2ab853,_0x4989b9){return new BPromise(function(_0x2054f8,_0x20bd48){return client[_0x064f('0xa')](_0x191707,_0x4989b9)[_0x064f('0xb')](function(_0x5e59a9){logger['info'](_0x064f('0xc'),_0x2ab853,_0x064f('0xd'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2ab853,_0x064f('0xd'),JSON[_0x064f('0xe')](_0x5e59a9));if(_0x5e59a9[_0x064f('0xf')]){if(_0x5e59a9['error'][_0x064f('0x10')]===0x1f4){logger[_0x064f('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x2ab853,_0x5e59a9[_0x064f('0xf')][_0x064f('0x11')]);return _0x20bd48(_0x5e59a9[_0x064f('0xf')][_0x064f('0x11')]);}logger[_0x064f('0xf')](_0x064f('0xc'),_0x2ab853,_0x5e59a9['error'][_0x064f('0x11')]);return _0x2054f8(_0x5e59a9['error'][_0x064f('0x11')]);}else{logger[_0x064f('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x2ab853,_0x064f('0xd'));_0x2054f8(_0x5e59a9[_0x064f('0x13')]['message']);}})['catch'](function(_0x441311){logger[_0x064f('0xf')](_0x064f('0xc'),_0x2ab853,_0x441311);_0x20bd48(_0x441311);});});} \ No newline at end of file +var _0x1d59=['error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x46421a,_0x38c146){var _0x24174a=function(_0x2f2e37){while(--_0x2f2e37){_0x46421a['push'](_0x46421a['shift']());}};_0x24174a(++_0x38c146);}(_0x1d59,0xa6));var _0x91d5=function(_0x47c6ed,_0xb18e13){_0x47c6ed=_0x47c6ed-0x0;var _0x2c4f31=_0x1d59[_0x47c6ed];return _0x2c4f31;};'use strict';var _=require(_0x91d5('0x0'));var util=require('util');var moment=require(_0x91d5('0x1'));var BPromise=require('bluebird');var rs=require(_0x91d5('0x2'));var fs=require('fs');var Redis=require(_0x91d5('0x3'));var db=require(_0x91d5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x91d5('0x5'))(_0x91d5('0x6'));var config=require(_0x91d5('0x7'));var jayson=require(_0x91d5('0x8'));var client=jayson[_0x91d5('0x9')][_0x91d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59ad0c,_0x36b2ba,_0x3da8b1){return new BPromise(function(_0xf1293d,_0x10b3d1){return client[_0x91d5('0xb')](_0x59ad0c,_0x3da8b1)['then'](function(_0x117459){logger[_0x91d5('0xc')](_0x91d5('0xd'),_0x36b2ba,_0x91d5('0xe'));logger[_0x91d5('0xf')](_0x91d5('0x10'),_0x36b2ba,_0x91d5('0xe'),JSON[_0x91d5('0x11')](_0x117459));if(_0x117459['error']){if(_0x117459[_0x91d5('0x12')][_0x91d5('0x13')]===0x1f4){logger[_0x91d5('0x12')](_0x91d5('0xd'),_0x36b2ba,_0x117459[_0x91d5('0x12')][_0x91d5('0x14')]);return _0x10b3d1(_0x117459[_0x91d5('0x12')][_0x91d5('0x14')]);}logger[_0x91d5('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x36b2ba,_0x117459['error']['message']);return _0xf1293d(_0x117459[_0x91d5('0x12')][_0x91d5('0x14')]);}else{logger[_0x91d5('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x36b2ba,'request\x20sent');_0xf1293d(_0x117459[_0x91d5('0x15')][_0x91d5('0x14')]);}})[_0x91d5('0x16')](function(_0x5a4a8b){logger[_0x91d5('0x12')](_0x91d5('0xd'),_0x36b2ba,_0x5a4a8b);_0x10b3d1(_0x5a4a8b);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index ce2decd..de5d919 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 _0x841e=['util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x841e,0xf7));var _0xe841=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x841e[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xe841('0x0'));var util=require(_0xe841('0x1'));var path=require(_0xe841('0x2'));var timeout=require(_0xe841('0x3'));var express=require(_0xe841('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe841('0x5'));var config=require(_0xe841('0x6'));module[_0xe841('0x7')]=router; \ No newline at end of file +var _0x93fb=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x416dde,_0x474424){var _0x5f0e33=function(_0x2aedb1){while(--_0x2aedb1){_0x416dde['push'](_0x416dde['shift']());}};_0x5f0e33(++_0x474424);}(_0x93fb,0x68));var _0xb93f=function(_0x19e347,_0x260db2){_0x19e347=_0x19e347-0x0;var _0x4e00b3=_0x93fb[_0x19e347];return _0x4e00b3;};'use strict';var multer=require(_0xb93f('0x0'));var util=require(_0xb93f('0x1'));var path=require(_0xb93f('0x2'));var timeout=require(_0xb93f('0x3'));var express=require(_0xb93f('0x4'));var router=express[_0xb93f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb93f('0x6'));var config=require(_0xb93f('0x7'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index e7a7481..15b170b 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 _0x3c86=['queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x40fa15,_0x17fb1f){var _0xca751f=function(_0x597c84){while(--_0x597c84){_0x40fa15['push'](_0x40fa15['shift']());}};_0xca751f(++_0x17fb1f);}(_0x3c86,0x1b7));var _0x63c8=function(_0x406e06,_0x377c20){_0x406e06=_0x406e06-0x0;var _0x397944=_0x3c86[_0x406e06];return _0x397944;};'use strict';var Sequelize=require(_0x63c8('0x0'));module[_0x63c8('0x1')]={'uniqueid':{'type':Sequelize[_0x63c8('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x63c8('0x3')},'membername':{'type':Sequelize[_0x63c8('0x4')],'allowNull':![],'comment':_0x63c8('0x3')},'UserId':{'type':Sequelize[_0x63c8('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x63c8('0x5'),'comment':_0x63c8('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x63c8('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x63c8('0x3')},'penalty':{'type':Sequelize[_0x63c8('0x2')](0xb),'defaultValue':0x0,'comment':_0x63c8('0x3')},'paused':{'type':Sequelize[_0x63c8('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x14e7=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','queue_interface'];(function(_0x43b59c,_0x35ac85){var _0x3050d0=function(_0x218330){while(--_0x218330){_0x43b59c['push'](_0x43b59c['shift']());}};_0x3050d0(++_0x35ac85);}(_0x14e7,0x127));var _0x714e=function(_0x443db5,_0x35956f){_0x443db5=_0x443db5-0x0;var _0x3b25fb=_0x14e7[_0x443db5];return _0x3b25fb;};'use strict';var Sequelize=require(_0x714e('0x0'));module[_0x714e('0x1')]={'uniqueid':{'type':Sequelize[_0x714e('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x714e('0x3')},'VoiceQueueId':{'type':Sequelize[_0x714e('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x714e('0x4'),'comment':_0x714e('0x3')},'penalty':{'type':Sequelize[_0x714e('0x2')](0xb),'defaultValue':0x0,'comment':_0x714e('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x714e('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 2df304d..80d7bec 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 _0x67b2=['hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update'];(function(_0x1275fe,_0xee2c86){var _0x57db9d=function(_0xb2f944){while(--_0xb2f944){_0x1275fe['push'](_0x1275fe['shift']());}};_0x57db9d(++_0xee2c86);}(_0x67b2,0x111));var _0x267b=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0x67b2[_0x2a0738];return _0x159679;};'use strict';var EventEmitter=require(_0x267b('0x0'));var UserVoiceQueueRt=require(_0x267b('0x1'))['db'][_0x267b('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x267b('0x3')](0x0);var events={'afterCreate':_0x267b('0x4'),'afterUpdate':_0x267b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4f7ee9){return function(_0x584517,_0x695f27,_0x318b1c){UserVoiceQueueRtEvents['emit'](_0x4f7ee9+':'+_0x584517['id'],_0x584517);UserVoiceQueueRtEvents['emit'](_0x4f7ee9,_0x584517);_0x318b1c(null);};}for(var e in events){if(events[_0x267b('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x267b('0x7')](e,emitEvent(event));}}module[_0x267b('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x5f55=['events','UserVoiceQueueRt','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x14476b,_0xd1a7a4){var _0x24e2e8=function(_0x52ed26){while(--_0x52ed26){_0x14476b['push'](_0x14476b['shift']());}};_0x24e2e8(++_0xd1a7a4);}(_0x5f55,0x90));var _0x55f5=function(_0x35a1cb,_0x5985c3){_0x35a1cb=_0x35a1cb-0x0;var _0x2cd095=_0x5f55[_0x35a1cb];return _0x2cd095;};'use strict';var EventEmitter=require(_0x55f5('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x55f5('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x55f5('0x2'),'afterUpdate':_0x55f5('0x3'),'afterDestroy':_0x55f5('0x4')};function emitEvent(_0x19c137){return function(_0x173cf7,_0x1ff478,_0x9b12d4){UserVoiceQueueRtEvents[_0x55f5('0x5')](_0x19c137+':'+_0x173cf7['id'],_0x173cf7);UserVoiceQueueRtEvents['emit'](_0x19c137,_0x173cf7);_0x9b12d4(null);};}for(var e in events){if(events[_0x55f5('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x55f5('0x7')](e,emitEvent(event));}}module[_0x55f5('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 bfc8c2f..d21e8d1 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 _0x7567=['bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','api','moment'];(function(_0x4a9dcf,_0x39378f){var _0x2cb986=function(_0x15e2f7){while(--_0x15e2f7){_0x4a9dcf['push'](_0x4a9dcf['shift']());}};_0x2cb986(++_0x39378f);}(_0x7567,0x1d8));var _0x7756=function(_0x16a659,_0x45e50d){_0x16a659=_0x16a659-0x0;var _0x247259=_0x7567[_0x16a659];return _0x247259;};'use strict';var _=require(_0x7756('0x0'));var util=require(_0x7756('0x1'));var logger=require('../../config/logger')(_0x7756('0x2'));var moment=require(_0x7756('0x3'));var BPromise=require(_0x7756('0x4'));var rp=require(_0x7756('0x5'));var fs=require('fs');var path=require(_0x7756('0x6'));var rimraf=require(_0x7756('0x7'));var config=require(_0x7756('0x8'));var attributes=require(_0x7756('0x9'));module[_0x7756('0xa')]=function(_0x4923bc,_0xd05d7f){return _0x4923bc[_0x7756('0xb')](_0x7756('0xc'),attributes,{'tableName':_0x7756('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f82=['path','rimraf','define','UserVoiceQueueRt','lodash','util','../../config/logger','moment'];(function(_0x11f7a6,_0x2ef575){var _0x540ad8=function(_0xb1f00){while(--_0xb1f00){_0x11f7a6['push'](_0x11f7a6['shift']());}};_0x540ad8(++_0x2ef575);}(_0x6f82,0x104));var _0x26f8=function(_0x1a21ff,_0x4a7550){_0x1a21ff=_0x1a21ff-0x0;var _0x25afc1=_0x6f82[_0x1a21ff];return _0x25afc1;};'use strict';var _=require(_0x26f8('0x0'));var util=require(_0x26f8('0x1'));var logger=require(_0x26f8('0x2'))('api');var moment=require(_0x26f8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x26f8('0x4'));var rimraf=require(_0x26f8('0x5'));var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0xa228e4,_0x57b79e){return _0xa228e4[_0x26f8('0x6')](_0x26f8('0x7'),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 719b7a4..4df6eaf 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 _0xe594=['COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','util','moment','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','sequelize'];(function(_0x126031,_0x487c5d){var _0x4a58eb=function(_0x3107a8){while(--_0x3107a8){_0x126031['push'](_0x126031['shift']());}};_0x4a58eb(++_0x487c5d);}(_0xe594,0x143));var _0x4e59=function(_0x5f2f11,_0x166b2d){_0x5f2f11=_0x5f2f11-0x0;var _0x2e448a=_0xe594[_0x5f2f11];return _0x2e448a;};'use strict';var _=require('lodash');var util=require(_0x4e59('0x0'));var moment=require(_0x4e59('0x1'));var BPromise=require(_0x4e59('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e59('0x3'))['db'];var utils=require(_0x4e59('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4e59('0x5'));var client=jayson[_0x4e59('0x6')]['http']({'port':0x232a});config[_0x4e59('0x7')]=_['defaults'](config[_0x4e59('0x7')],{'host':_0x4e59('0x8'),'port':0x18eb});var socket=require(_0x4e59('0x9'))(new Redis(config[_0x4e59('0x7')]));require('./userVoiceQueueRt.socket')[_0x4e59('0xa')](socket);function respondWithRpcPromise(_0x340f5a,_0x258f2a,_0x3ec553){return new BPromise(function(_0x1993f4,_0x5888b5){return client[_0x4e59('0xb')](_0x340f5a,_0x3ec553)[_0x4e59('0xc')](function(_0x353cf8){logger['info'](_0x4e59('0xd'),_0x258f2a,'request\x20sent');logger[_0x4e59('0xe')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x258f2a,_0x4e59('0xf'),JSON[_0x4e59('0x10')](_0x353cf8));if(_0x353cf8[_0x4e59('0x11')]){if(_0x353cf8[_0x4e59('0x11')]['code']===0x1f4){logger['error'](_0x4e59('0xd'),_0x258f2a,_0x353cf8[_0x4e59('0x11')][_0x4e59('0x12')]);return _0x5888b5(_0x353cf8[_0x4e59('0x11')]['message']);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x258f2a,_0x353cf8[_0x4e59('0x11')]['message']);return _0x1993f4(_0x353cf8[_0x4e59('0x11')][_0x4e59('0x12')]);}else{logger[_0x4e59('0x13')](_0x4e59('0xd'),_0x258f2a,_0x4e59('0xf'));_0x1993f4(_0x353cf8[_0x4e59('0x14')][_0x4e59('0x12')]);}})['catch'](function(_0x572d02){logger[_0x4e59('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x258f2a,_0x572d02);_0x5888b5(_0x572d02);});});}exports[_0x4e59('0x15')]=function(_0x3b6e81){var _0x31955d=this;return new Promise(function(_0x15e06f,_0x436163){return db[_0x4e59('0x16')]['findAll']({'raw':_0x3b6e81[_0x4e59('0x17')]?_0x3b6e81[_0x4e59('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3b6e81[_0x4e59('0x17')]?_0x3b6e81[_0x4e59('0x17')]['where']||null:null,'attributes':[[db[_0x4e59('0x18')]['fn'](_0x4e59('0x19'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x4e59('0x1a')))),_0x4e59('0x1b')]]})[_0x4e59('0xc')](function(_0x260dd6){logger[_0x4e59('0x13')](_0x4e59('0x15'),_0x3b6e81);logger['debug']('GetVoiceQueueRtPauses',_0x3b6e81,JSON[_0x4e59('0x10')](_0x260dd6));_0x15e06f(_0x260dd6);})[_0x4e59('0x1c')](function(_0x1698c3){logger[_0x4e59('0x11')](_0x4e59('0x15'),_0x1698c3[_0x4e59('0x12')],_0x3b6e81);_0x436163(_0x31955d[_0x4e59('0x11')](0x1f4,_0x1698c3['message']));});});}; \ No newline at end of file +var _0xbdc0=['redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','stringify','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xb2f15c,_0x6cb224){var _0x591117=function(_0x2ef684){while(--_0x2ef684){_0xb2f15c['push'](_0xb2f15c['shift']());}};_0x591117(++_0x6cb224);}(_0xbdc0,0xfe));var _0x0bdc=function(_0x1b5c02,_0x147edc){_0x1b5c02=_0x1b5c02-0x0;var _0x2174fa=_0xbdc0[_0x1b5c02];return _0x2174fa;};'use strict';var _=require(_0x0bdc('0x0'));var util=require(_0x0bdc('0x1'));var moment=require(_0x0bdc('0x2'));var BPromise=require(_0x0bdc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0bdc('0x4'))['db'];var utils=require(_0x0bdc('0x5'));var logger=require(_0x0bdc('0x6'))(_0x0bdc('0x7'));var config=require(_0x0bdc('0x8'));var jayson=require(_0x0bdc('0x9'));var client=jayson[_0x0bdc('0xa')][_0x0bdc('0xb')]({'port':0x232a});config[_0x0bdc('0xc')]=_['defaults'](config['redis'],{'host':_0x0bdc('0xd'),'port':0x18eb});var socket=require(_0x0bdc('0xe'))(new Redis(config[_0x0bdc('0xc')]));require('./userVoiceQueueRt.socket')[_0x0bdc('0xf')](socket);function respondWithRpcPromise(_0xe51246,_0x258a59,_0x3d93c1){return new BPromise(function(_0x1edeb1,_0x33bbf5){return client[_0x0bdc('0x10')](_0xe51246,_0x3d93c1)[_0x0bdc('0x11')](function(_0x112164){logger[_0x0bdc('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x258a59,_0x0bdc('0x13'));logger[_0x0bdc('0x14')](_0x0bdc('0x15'),_0x258a59,_0x0bdc('0x13'),JSON['stringify'](_0x112164));if(_0x112164['error']){if(_0x112164[_0x0bdc('0x16')][_0x0bdc('0x17')]===0x1f4){logger['error'](_0x0bdc('0x18'),_0x258a59,_0x112164[_0x0bdc('0x16')]['message']);return _0x33bbf5(_0x112164[_0x0bdc('0x16')][_0x0bdc('0x19')]);}logger[_0x0bdc('0x16')](_0x0bdc('0x18'),_0x258a59,_0x112164[_0x0bdc('0x16')][_0x0bdc('0x19')]);return _0x1edeb1(_0x112164['error'][_0x0bdc('0x19')]);}else{logger['info'](_0x0bdc('0x18'),_0x258a59,_0x0bdc('0x13'));_0x1edeb1(_0x112164[_0x0bdc('0x1a')][_0x0bdc('0x19')]);}})['catch'](function(_0x3198fe){logger[_0x0bdc('0x16')](_0x0bdc('0x18'),_0x258a59,_0x3198fe);_0x33bbf5(_0x3198fe);});});}exports[_0x0bdc('0x1b')]=function(_0x11980a){var _0x3137f1=this;return new Promise(function(_0x5396ae,_0x1ca4c9){return db[_0x0bdc('0x1c')][_0x0bdc('0x1d')]({'raw':_0x11980a[_0x0bdc('0x1e')]?_0x11980a[_0x0bdc('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x11980a['options']?_0x11980a[_0x0bdc('0x1e')][_0x0bdc('0x1f')]||null:null,'attributes':[[db[_0x0bdc('0x20')]['fn'](_0x0bdc('0x21'),db[_0x0bdc('0x20')]['fn']('IF',db[_0x0bdc('0x20')][_0x0bdc('0x22')](_0x0bdc('0x23')))),'outboundQueuePauses']]})[_0x0bdc('0x11')](function(_0x19157b){logger[_0x0bdc('0x12')](_0x0bdc('0x1b'),_0x11980a);logger['debug'](_0x0bdc('0x1b'),_0x11980a,JSON[_0x0bdc('0x24')](_0x19157b));_0x5396ae(_0x19157b);})[_0x0bdc('0x25')](function(_0x4794c8){logger[_0x0bdc('0x16')](_0x0bdc('0x1b'),_0x4794c8[_0x0bdc('0x19')],_0x11980a);_0x1ca4c9(_0x3137f1[_0x0bdc('0x16')](0x1f4,_0x4794c8['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 7de3e1c..c2a3754 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 _0xafb0=['register','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit','removeListener'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xafb0,0x102));var _0x0afb=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xafb0[_0x255d5b];return _0x3e141a;};'use strict';var UserVoiceQueueRtEvents=require(_0x0afb('0x0'));var events=[_0x0afb('0x1'),_0x0afb('0x2'),_0x0afb('0x3')];function createListener(_0x3dba20,_0x480536){return function(_0x3e4150){_0x480536[_0x0afb('0x4')](_0x3dba20,_0x3e4150);};}function removeListener(_0x35e503,_0x4448c1){return function(){UserVoiceQueueRtEvents[_0x0afb('0x5')](_0x35e503,_0x4448c1);};}exports[_0x0afb('0x6')]=function(_0x807a6a){for(var _0x5a11d5=0x0,_0x298287=events['length'];_0x5a11d5<_0x298287;_0x5a11d5++){var _0x2228c8=events[_0x5a11d5];var _0x565e12=createListener(_0x0afb('0x7')+_0x2228c8,_0x807a6a);UserVoiceQueueRtEvents['on'](_0x2228c8,_0x565e12);}}; \ No newline at end of file +var _0x111c=['emit','removeListener','length','./userVoiceQueueRt.events','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x111c,0x14c));var _0xc111=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x111c[_0x397e5f];return _0x5302b8;};'use strict';var UserVoiceQueueRtEvents=require(_0xc111('0x0'));var events=[_0xc111('0x1'),_0xc111('0x2'),_0xc111('0x3')];function createListener(_0x17547f,_0x3bc42b){return function(_0x31df46){_0x3bc42b[_0xc111('0x4')](_0x17547f,_0x31df46);};}function removeListener(_0x4d4864,_0x548b19){return function(){UserVoiceQueueRtEvents[_0xc111('0x5')](_0x4d4864,_0x548b19);};}exports['register']=function(_0x3ec0c1){for(var _0x43b486=0x0,_0x293844=events[_0xc111('0x6')];_0x43b486<_0x293844;_0x43b486++){var _0x543b66=events[_0x43b486];var _0x1007ea=createListener('userVoiceQueueRt:'+_0x543b66,_0x3ec0c1);UserVoiceQueueRtEvents['on'](_0x543b66,_0x1007ea);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 1926f72..ae787a7 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 _0x58fe=['exports','multer','util','path','express','Router','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete'];(function(_0x198c14,_0x59d983){var _0x59e324=function(_0x3dd496){while(--_0x3dd496){_0x198c14['push'](_0x198c14['shift']());}};_0x59e324(++_0x59d983);}(_0x58fe,0x67));var _0xe58f=function(_0x590b63,_0x14debb){_0x590b63=_0x590b63-0x0;var _0x3c9380=_0x58fe[_0x590b63];return _0x3c9380;};'use strict';var multer=require(_0xe58f('0x0'));var util=require(_0xe58f('0x1'));var path=require(_0xe58f('0x2'));var timeout=require('connect-timeout');var express=require(_0xe58f('0x3'));var router=express[_0xe58f('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe58f('0x5'));var controller=require(_0xe58f('0x6'));router[_0xe58f('0x7')]('/',auth[_0xe58f('0x8')](),controller[_0xe58f('0x9')]);router[_0xe58f('0x7')](_0xe58f('0xa'),auth[_0xe58f('0x8')](),controller[_0xe58f('0xb')]);router['post']('/',auth[_0xe58f('0x8')](),controller[_0xe58f('0xc')]);router[_0xe58f('0xd')](_0xe58f('0xa'),auth[_0xe58f('0x8')](),controller[_0xe58f('0xe')]);router[_0xe58f('0xf')]('/:id',auth[_0xe58f('0x8')](),controller['destroy']);module[_0xe58f('0x10')]=router; \ No newline at end of file +var _0xc31e=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xc31e,0xa2));var _0xec31=function(_0x38b107,_0x449c1b){_0x38b107=_0x38b107-0x0;var _0x46feb0=_0xc31e[_0x38b107];return _0x46feb0;};'use strict';var multer=require(_0xec31('0x0'));var util=require(_0xec31('0x1'));var path=require(_0xec31('0x2'));var timeout=require(_0xec31('0x3'));var express=require(_0xec31('0x4'));var router=express['Router']();var auth=require(_0xec31('0x5'));var interaction=require(_0xec31('0x6'));var config=require('../../config/environment');var controller=require(_0xec31('0x7'));router[_0xec31('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xec31('0x9')](),controller[_0xec31('0xa')]);router[_0xec31('0xb')]('/',auth[_0xec31('0x9')](),controller[_0xec31('0xc')]);router[_0xec31('0xd')](_0xec31('0xe'),auth[_0xec31('0x9')](),controller[_0xec31('0xf')]);router[_0xec31('0x10')](_0xec31('0xe'),auth[_0xec31('0x9')](),controller[_0xec31('0x11')]);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 f47d833..26a1d27 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 _0x39a2=['name','sequelize','STRING'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x39a2,0x1e1));var _0x239a=function(_0x581e01,_0x241cbd){_0x581e01=_0x581e01-0x0;var _0x558b54=_0x39a2[_0x581e01];return _0x558b54;};'use strict';var Sequelize=require(_0x239a('0x0'));module['exports']={'name':{'type':Sequelize[_0x239a('0x1')],'unique':_0x239a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb33a=['STRING','sequelize','name'];(function(_0x3a3b3f,_0x367b13){var _0x2294e0=function(_0x4161e5){while(--_0x4161e5){_0x3a3b3f['push'](_0x3a3b3f['shift']());}};_0x2294e0(++_0x367b13);}(_0xb33a,0x6a));var _0xab33=function(_0x22bfa2,_0x1f1fbd){_0x22bfa2=_0x22bfa2-0x0;var _0x1d70f8=_0xb33a[_0x22bfa2];return _0x1d70f8;};'use strict';var Sequelize=require(_0xab33('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xab33('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xab33('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index abb6540..330c8ed 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 _0x25b4=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','Variable','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Variables','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js'];(function(_0x1b3224,_0x3351d9){var _0x5dae4f=function(_0x22894a){while(--_0x22894a){_0x1b3224['push'](_0x1b3224['shift']());}};_0x5dae4f(++_0x3351d9);}(_0x25b4,0xe0));var _0x425b=function(_0x151381,_0x97b314){_0x151381=_0x151381-0x0;var _0x2afab6=_0x25b4[_0x151381];return _0x2afab6;};'use strict';var pdf=require(_0x425b('0x0'));var emlformat=require(_0x425b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x425b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x425b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x425b('0x4'));var util=require('util');var path=require(_0x425b('0x5'));var sox=require(_0x425b('0x6'));var csv=require(_0x425b('0x7'));var ejs=require(_0x425b('0x8'));var fs=require('fs');var _=require(_0x425b('0x9'));var squel=require('squel');var crypto=require(_0x425b('0xa'));var jsforce=require(_0x425b('0xb'));var deskjs=require(_0x425b('0xc'));var toCsv=require(_0x425b('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x425b('0xd'));var authService=require(_0x425b('0xe'));var qs=require(_0x425b('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x425b('0x10'));var config=require(_0x425b('0x11'));var db=require(_0x425b('0x12'))['db'];function respondWithStatusCode(_0x3923bc,_0x104934){_0x104934=_0x104934||0xcc;return function(_0x4c30fc){if(_0x4c30fc){return _0x3923bc[_0x425b('0x13')](_0x104934);}return _0x3923bc[_0x425b('0x14')](_0x104934)[_0x425b('0x15')]();};}function respondWithResult(_0x32bd51,_0x329a57){_0x329a57=_0x329a57||0xc8;return function(_0x3c1343){if(_0x3c1343){return _0x32bd51[_0x425b('0x14')](_0x329a57)[_0x425b('0x16')](_0x3c1343);}};}function respondWithFilteredResult(_0x34f875,_0x5b2638){return function(_0x403178){if(_0x403178){var _0x3a33c6=_0x403178[_0x425b('0x17')],_0x177b00=_0x5b2638[_0x425b('0x18')],_0x2a0ead=_0x5b2638[_0x425b('0x18')]+_0x5b2638[_0x425b('0x19')],_0x5d731d;if(_0x2a0ead>=_0x3a33c6){_0x2a0ead=_0x3a33c6;_0x5d731d=0xc8;}else{_0x5d731d=0xce;}_0x34f875['status'](_0x5d731d);return _0x34f875['set'](_0x425b('0x1a'),_0x177b00+'-'+_0x2a0ead+'/'+_0x3a33c6)[_0x425b('0x16')](_0x403178);}return null;};}function patchUpdates(_0x4a3855){return function(_0x335664){try{jsonpatch[_0x425b('0x1b')](_0x335664,_0x4a3855,!![]);}catch(_0x3ba9f2){return BPromise[_0x425b('0x1c')](_0x3ba9f2);}return _0x335664[_0x425b('0x1d')]();};}function saveUpdates(_0x4c5c95,_0x40506b){return function(_0x3a3c11){if(_0x3a3c11){return _0x3a3c11[_0x425b('0x1e')](_0x4c5c95)[_0x425b('0x1f')](function(_0x5646ab){return _0x5646ab;});}return null;};}function removeEntity(_0x514fa4,_0x1518e8){return function(_0xb40fd8){if(_0xb40fd8){return _0xb40fd8[_0x425b('0x20')]()[_0x425b('0x1f')](function(){var _0x148104=_0xb40fd8[_0x425b('0x21')]({'plain':!![]});var _0x4106fc='Variables';return db[_0x425b('0x22')][_0x425b('0x20')]({'where':{'type':_0x4106fc,'resourceId':_0x148104['id']}})[_0x425b('0x1f')](function(){return _0xb40fd8;});})[_0x425b('0x1f')](function(){_0x514fa4[_0x425b('0x14')](0xcc)[_0x425b('0x15')]();});}};}function handleEntityNotFound(_0x3a36c7,_0x31d406){return function(_0x787c51){if(!_0x787c51){_0x3a36c7['sendStatus'](0x194);}return _0x787c51;};}function handleError(_0x21a8ca,_0x1ec84b){_0x1ec84b=_0x1ec84b||0x1f4;return function(_0xb03eef){logger[_0x425b('0x23')](_0xb03eef[_0x425b('0x24')]);if(_0xb03eef[_0x425b('0x25')]){delete _0xb03eef[_0x425b('0x25')];}_0x21a8ca[_0x425b('0x14')](_0x1ec84b)[_0x425b('0x26')](_0xb03eef);};}exports[_0x425b('0x27')]=function(_0x1bbe12,_0x4c79e8){var _0x112221={},_0x390236={},_0x4b13e0={'count':0x0,'rows':[]};var _0x3f169d=db[_0x425b('0x28')]['rawAttributes'];_0x390236[_0x425b('0x29')]=_[_0x425b('0x2a')](_0x3f169d);_0x390236[_0x425b('0x2b')]=_['keys'](_0x1bbe12[_0x425b('0x2b')]);_0x390236['filters']=_[_0x425b('0x2c')](_0x390236[_0x425b('0x29')],_0x390236[_0x425b('0x2b')]);_0x112221[_0x425b('0x2d')]=_[_0x425b('0x2c')](_0x390236[_0x425b('0x29')],qs[_0x425b('0x2e')](_0x1bbe12[_0x425b('0x2b')][_0x425b('0x2e')]));_0x112221[_0x425b('0x2d')]=_0x112221[_0x425b('0x2d')]['length']?_0x112221[_0x425b('0x2d')]:_0x390236['model'];if(!_0x1bbe12['query'][_0x425b('0x2f')](_0x425b('0x30'))){_0x112221[_0x425b('0x19')]=qs['limit'](_0x1bbe12[_0x425b('0x2b')][_0x425b('0x19')]);_0x112221['offset']=qs['offset'](_0x1bbe12[_0x425b('0x2b')][_0x425b('0x18')]);}_0x112221['order']=qs[_0x425b('0x31')](_0x1bbe12[_0x425b('0x2b')]['sort']);_0x112221[_0x425b('0x32')]=qs[_0x425b('0x33')](_[_0x425b('0x34')](_0x1bbe12[_0x425b('0x2b')],_0x390236['filters']));if(_0x1bbe12[_0x425b('0x2b')][_0x425b('0x35')]){_0x112221['where']=_[_0x425b('0x36')](_0x112221[_0x425b('0x32')],{'$or':_['map'](_0x3f169d,function(_0xc4a1e8){if(_0xc4a1e8[_0x425b('0x37')][_0x425b('0x38')]!==_0x425b('0x39')){var _0x1aaf1c={};_0x1aaf1c[_0xc4a1e8[_0x425b('0x3a')]]={'$like':'%'+_0x1bbe12['query'][_0x425b('0x35')]+'%'};return _0x1aaf1c;}})});}_0x112221=_['merge']({},_0x112221,_0x1bbe12[_0x425b('0x3b')]);var _0x3d8f2a={'where':_0x112221['where']};return db[_0x425b('0x28')]['count'](_0x3d8f2a)[_0x425b('0x1f')](function(_0xb9f62f){_0x4b13e0['count']=_0xb9f62f;if(_0x1bbe12[_0x425b('0x2b')][_0x425b('0x3c')]){_0x112221['include']=[{'all':!![]}];}return db[_0x425b('0x28')][_0x425b('0x3d')](_0x112221);})[_0x425b('0x1f')](function(_0x38a4af){_0x4b13e0[_0x425b('0x3e')]=_0x38a4af;return _0x4b13e0;})[_0x425b('0x1f')](respondWithFilteredResult(_0x4c79e8,_0x112221))[_0x425b('0x3f')](handleError(_0x4c79e8,null));};exports[_0x425b('0x40')]=function(_0x5d89a3,_0x5de424){var _0x24aafc={'raw':!![],'where':{'id':_0x5d89a3[_0x425b('0x41')]['id']}},_0x4e9cfb={};_0x4e9cfb[_0x425b('0x29')]=_[_0x425b('0x2a')](db[_0x425b('0x28')][_0x425b('0x42')]);_0x4e9cfb['query']=_[_0x425b('0x2a')](_0x5d89a3['query']);_0x4e9cfb[_0x425b('0x33')]=_[_0x425b('0x2c')](_0x4e9cfb[_0x425b('0x29')],_0x4e9cfb[_0x425b('0x2b')]);_0x24aafc[_0x425b('0x2d')]=_['intersection'](_0x4e9cfb[_0x425b('0x29')],qs[_0x425b('0x2e')](_0x5d89a3[_0x425b('0x2b')]['fields']));_0x24aafc['attributes']=_0x24aafc['attributes'][_0x425b('0x43')]?_0x24aafc[_0x425b('0x2d')]:_0x4e9cfb[_0x425b('0x29')];if(_0x5d89a3[_0x425b('0x2b')]['includeAll']){_0x24aafc[_0x425b('0x44')]=[{'all':!![]}];}_0x24aafc=_[_0x425b('0x36')]({},_0x24aafc,_0x5d89a3[_0x425b('0x3b')]);return db[_0x425b('0x28')][_0x425b('0x45')](_0x24aafc)[_0x425b('0x1f')](handleEntityNotFound(_0x5de424,null))['then'](respondWithResult(_0x5de424,null))[_0x425b('0x3f')](handleError(_0x5de424,null));};exports[_0x425b('0x46')]=function(_0x474ed8,_0x53a3d0){return db[_0x425b('0x28')][_0x425b('0x46')](_0x474ed8['body'],{})[_0x425b('0x1f')](function(_0x120706){var _0x117833=_0x474ed8['user'][_0x425b('0x21')]({'plain':!![]});if(!_0x117833)throw new Error(_0x425b('0x47'));if(_0x117833[_0x425b('0x48')]===_0x425b('0x49')){var _0x188c76=_0x120706['get']({'plain':!![]});var _0x24194b=_0x425b('0x4a');return db[_0x425b('0x4b')][_0x425b('0x45')]({'where':{'name':_0x24194b,'userProfileId':_0x117833[_0x425b('0x4c')]},'raw':!![]})[_0x425b('0x1f')](function(_0x2526ea){if(_0x2526ea&&_0x2526ea['autoAssociation']===0x0){return db[_0x425b('0x22')][_0x425b('0x46')]({'name':_0x188c76[_0x425b('0x25')],'resourceId':_0x188c76['id'],'type':_0x2526ea[_0x425b('0x25')],'sectionId':_0x2526ea['id']},{})['then'](function(){return _0x120706;});}else{return _0x120706;}})['catch'](function(_0x15afd1){logger[_0x425b('0x23')](_0x425b('0x4d'),_0x15afd1);throw _0x15afd1;});}return _0x120706;})[_0x425b('0x1f')](respondWithResult(_0x53a3d0,0xc9))[_0x425b('0x3f')](handleError(_0x53a3d0,null));};exports[_0x425b('0x1e')]=function(_0x3f64c2,_0x5c90e7){if(_0x3f64c2[_0x425b('0x4e')]['id']){delete _0x3f64c2['body']['id'];}return db[_0x425b('0x28')][_0x425b('0x45')]({'where':{'id':_0x3f64c2[_0x425b('0x41')]['id']}})[_0x425b('0x1f')](handleEntityNotFound(_0x5c90e7,null))['then'](saveUpdates(_0x3f64c2[_0x425b('0x4e')],null))['then'](respondWithResult(_0x5c90e7,null))[_0x425b('0x3f')](handleError(_0x5c90e7,null));};exports[_0x425b('0x20')]=function(_0x4f2b54,_0x1c20f2){return db[_0x425b('0x28')]['find']({'where':{'id':_0x4f2b54[_0x425b('0x41')]['id']}})[_0x425b('0x1f')](handleEntityNotFound(_0x1c20f2,null))[_0x425b('0x1f')](removeEntity(_0x1c20f2,null))[_0x425b('0x3f')](handleError(_0x1c20f2,null));}; \ No newline at end of file +var _0x1b37=['fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','set','save','update','destroy','then','get','end','error','stack','name','send','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','map','type','key','field','options','Variable','count','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf'];(function(_0x249749,_0x72bc17){var _0x41fa48=function(_0x89f925){while(--_0x89f925){_0x249749['push'](_0x249749['shift']());}};_0x41fa48(++_0x72bc17);}(_0x1b37,0x139));var _0x71b3=function(_0x4044a0,_0x41590d){_0x4044a0=_0x4044a0-0x0;var _0x2f3031=_0x1b37[_0x4044a0];return _0x2f3031;};'use strict';var pdf=require(_0x71b3('0x0'));var emlformat=require(_0x71b3('0x1'));var rimraf=require(_0x71b3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x71b3('0x3'));var rp=require(_0x71b3('0x4'));var moment=require(_0x71b3('0x5'));var BPromise=require(_0x71b3('0x6'));var Mustache=require(_0x71b3('0x7'));var util=require(_0x71b3('0x8'));var path=require('path');var sox=require(_0x71b3('0x9'));var csv=require(_0x71b3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x71b3('0xb'));var squel=require('squel');var crypto=require(_0x71b3('0xc'));var jsforce=require(_0x71b3('0xd'));var deskjs=require(_0x71b3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x71b3('0xf'));var Papa=require(_0x71b3('0x10'));var Redis=require('ioredis');var authService=require(_0x71b3('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x71b3('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x71b3('0x13'));var config=require(_0x71b3('0x14'));var db=require(_0x71b3('0x15'))['db'];function respondWithStatusCode(_0x15a0a0,_0x584b3b){_0x584b3b=_0x584b3b||0xcc;return function(_0x117355){if(_0x117355){return _0x15a0a0[_0x71b3('0x16')](_0x584b3b);}return _0x15a0a0[_0x71b3('0x17')](_0x584b3b)['end']();};}function respondWithResult(_0x349cb5,_0x3916b6){_0x3916b6=_0x3916b6||0xc8;return function(_0x32ddc6){if(_0x32ddc6){return _0x349cb5[_0x71b3('0x17')](_0x3916b6)[_0x71b3('0x18')](_0x32ddc6);}};}function respondWithFilteredResult(_0x36bb40,_0x4223b9){return function(_0x1a8074){if(_0x1a8074){var _0x50b2ba=_0x1a8074['count'],_0x1dd216=_0x4223b9['offset'],_0x49ba95=_0x4223b9['offset']+_0x4223b9[_0x71b3('0x19')],_0x3fce5e;if(_0x49ba95>=_0x50b2ba){_0x49ba95=_0x50b2ba;_0x3fce5e=0xc8;}else{_0x3fce5e=0xce;}_0x36bb40[_0x71b3('0x17')](_0x3fce5e);return _0x36bb40[_0x71b3('0x1a')]('Content-Range',_0x1dd216+'-'+_0x49ba95+'/'+_0x50b2ba)[_0x71b3('0x18')](_0x1a8074);}return null;};}function patchUpdates(_0x2eef9e){return function(_0x59b043){try{jsonpatch['apply'](_0x59b043,_0x2eef9e,!![]);}catch(_0x428edb){return BPromise['reject'](_0x428edb);}return _0x59b043[_0x71b3('0x1b')]();};}function saveUpdates(_0x330fed,_0x516b96){return function(_0x28f38e){if(_0x28f38e){return _0x28f38e[_0x71b3('0x1c')](_0x330fed)['then'](function(_0x45b38a){return _0x45b38a;});}return null;};}function removeEntity(_0x5a0914,_0x539af5){return function(_0x3434ff){if(_0x3434ff){return _0x3434ff[_0x71b3('0x1d')]()[_0x71b3('0x1e')](function(){var _0x2469be=_0x3434ff[_0x71b3('0x1f')]({'plain':!![]});var _0x123e7e='Variables';return db['UserProfileResource'][_0x71b3('0x1d')]({'where':{'type':_0x123e7e,'resourceId':_0x2469be['id']}})[_0x71b3('0x1e')](function(){return _0x3434ff;});})[_0x71b3('0x1e')](function(){_0x5a0914[_0x71b3('0x17')](0xcc)[_0x71b3('0x20')]();});}};}function handleEntityNotFound(_0x4dbedd,_0x255d5c){return function(_0x11a700){if(!_0x11a700){_0x4dbedd[_0x71b3('0x16')](0x194);}return _0x11a700;};}function handleError(_0xd41f38,_0xc7331e){_0xc7331e=_0xc7331e||0x1f4;return function(_0x410b60){logger[_0x71b3('0x21')](_0x410b60[_0x71b3('0x22')]);if(_0x410b60[_0x71b3('0x23')]){delete _0x410b60[_0x71b3('0x23')];}_0xd41f38['status'](_0xc7331e)[_0x71b3('0x24')](_0x410b60);};}exports[_0x71b3('0x25')]=function(_0x403a58,_0x975cd4){var _0x1f4f6c={},_0x4b0963={},_0x42a587={'count':0x0,'rows':[]};var _0x234970=db['Variable']['rawAttributes'];_0x4b0963[_0x71b3('0x26')]=_[_0x71b3('0x27')](_0x234970);_0x4b0963[_0x71b3('0x28')]=_[_0x71b3('0x27')](_0x403a58[_0x71b3('0x28')]);_0x4b0963[_0x71b3('0x29')]=_[_0x71b3('0x2a')](_0x4b0963[_0x71b3('0x26')],_0x4b0963[_0x71b3('0x28')]);_0x1f4f6c[_0x71b3('0x2b')]=_['intersection'](_0x4b0963[_0x71b3('0x26')],qs[_0x71b3('0x2c')](_0x403a58[_0x71b3('0x28')][_0x71b3('0x2c')]));_0x1f4f6c[_0x71b3('0x2b')]=_0x1f4f6c[_0x71b3('0x2b')][_0x71b3('0x2d')]?_0x1f4f6c[_0x71b3('0x2b')]:_0x4b0963[_0x71b3('0x26')];if(!_0x403a58['query'][_0x71b3('0x2e')]('nolimit')){_0x1f4f6c[_0x71b3('0x19')]=qs[_0x71b3('0x19')](_0x403a58[_0x71b3('0x28')][_0x71b3('0x19')]);_0x1f4f6c[_0x71b3('0x2f')]=qs['offset'](_0x403a58[_0x71b3('0x28')][_0x71b3('0x2f')]);}_0x1f4f6c[_0x71b3('0x30')]=qs[_0x71b3('0x31')](_0x403a58['query'][_0x71b3('0x31')]);_0x1f4f6c[_0x71b3('0x32')]=qs[_0x71b3('0x29')](_[_0x71b3('0x33')](_0x403a58[_0x71b3('0x28')],_0x4b0963[_0x71b3('0x29')]));if(_0x403a58[_0x71b3('0x28')][_0x71b3('0x34')]){_0x1f4f6c[_0x71b3('0x32')]=_[_0x71b3('0x35')](_0x1f4f6c[_0x71b3('0x32')],{'$or':_[_0x71b3('0x36')](_0x234970,function(_0x349bca){if(_0x349bca[_0x71b3('0x37')][_0x71b3('0x38')]!=='VIRTUAL'){var _0x568acc={};_0x568acc[_0x349bca[_0x71b3('0x39')]]={'$like':'%'+_0x403a58[_0x71b3('0x28')][_0x71b3('0x34')]+'%'};return _0x568acc;}})});}_0x1f4f6c=_[_0x71b3('0x35')]({},_0x1f4f6c,_0x403a58[_0x71b3('0x3a')]);var _0x61fb49={'where':_0x1f4f6c['where']};return db[_0x71b3('0x3b')][_0x71b3('0x3c')](_0x61fb49)[_0x71b3('0x1e')](function(_0x3838ca){_0x42a587['count']=_0x3838ca;if(_0x403a58[_0x71b3('0x28')][_0x71b3('0x3d')]){_0x1f4f6c['include']=[{'all':!![]}];}return db[_0x71b3('0x3b')][_0x71b3('0x3e')](_0x1f4f6c);})['then'](function(_0x1dcfad){_0x42a587[_0x71b3('0x3f')]=_0x1dcfad;return _0x42a587;})[_0x71b3('0x1e')](respondWithFilteredResult(_0x975cd4,_0x1f4f6c))[_0x71b3('0x40')](handleError(_0x975cd4,null));};exports[_0x71b3('0x41')]=function(_0x41c0f5,_0x27afad){var _0x4d2f3c={'raw':!![],'where':{'id':_0x41c0f5[_0x71b3('0x42')]['id']}},_0x1b0253={};_0x1b0253[_0x71b3('0x26')]=_[_0x71b3('0x27')](db[_0x71b3('0x3b')][_0x71b3('0x43')]);_0x1b0253[_0x71b3('0x28')]=_[_0x71b3('0x27')](_0x41c0f5[_0x71b3('0x28')]);_0x1b0253['filters']=_[_0x71b3('0x2a')](_0x1b0253['model'],_0x1b0253[_0x71b3('0x28')]);_0x4d2f3c[_0x71b3('0x2b')]=_[_0x71b3('0x2a')](_0x1b0253['model'],qs[_0x71b3('0x2c')](_0x41c0f5[_0x71b3('0x28')][_0x71b3('0x2c')]));_0x4d2f3c[_0x71b3('0x2b')]=_0x4d2f3c[_0x71b3('0x2b')][_0x71b3('0x2d')]?_0x4d2f3c[_0x71b3('0x2b')]:_0x1b0253['model'];if(_0x41c0f5[_0x71b3('0x28')]['includeAll']){_0x4d2f3c[_0x71b3('0x44')]=[{'all':!![]}];}_0x4d2f3c=_[_0x71b3('0x35')]({},_0x4d2f3c,_0x41c0f5['options']);return db[_0x71b3('0x3b')]['find'](_0x4d2f3c)[_0x71b3('0x1e')](handleEntityNotFound(_0x27afad,null))[_0x71b3('0x1e')](respondWithResult(_0x27afad,null))[_0x71b3('0x40')](handleError(_0x27afad,null));};exports['create']=function(_0x536c0f,_0x4d22b4){return db[_0x71b3('0x3b')][_0x71b3('0x45')](_0x536c0f[_0x71b3('0x46')],{})[_0x71b3('0x1e')](function(_0x59c9a6){var _0x19d781=_0x536c0f[_0x71b3('0x47')][_0x71b3('0x1f')]({'plain':!![]});if(!_0x19d781)throw new Error(_0x71b3('0x48'));if(_0x19d781[_0x71b3('0x49')]===_0x71b3('0x47')){var _0x5ab2e6=_0x59c9a6[_0x71b3('0x1f')]({'plain':!![]});var _0x5e8981='Variables';return db[_0x71b3('0x4a')][_0x71b3('0x4b')]({'where':{'name':_0x5e8981,'userProfileId':_0x19d781['userProfileId']},'raw':!![]})[_0x71b3('0x1e')](function(_0x4c53d1){if(_0x4c53d1&&_0x4c53d1[_0x71b3('0x4c')]===0x0){return db[_0x71b3('0x4d')]['create']({'name':_0x5ab2e6['name'],'resourceId':_0x5ab2e6['id'],'type':_0x4c53d1['name'],'sectionId':_0x4c53d1['id']},{})[_0x71b3('0x1e')](function(){return _0x59c9a6;});}else{return _0x59c9a6;}})['catch'](function(_0x46b2d8){logger[_0x71b3('0x21')](_0x71b3('0x4e'),_0x46b2d8);throw _0x46b2d8;});}return _0x59c9a6;})['then'](respondWithResult(_0x4d22b4,0xc9))[_0x71b3('0x40')](handleError(_0x4d22b4,null));};exports['update']=function(_0x59aa95,_0x1faab){if(_0x59aa95[_0x71b3('0x46')]['id']){delete _0x59aa95[_0x71b3('0x46')]['id'];}return db[_0x71b3('0x3b')][_0x71b3('0x4b')]({'where':{'id':_0x59aa95['params']['id']}})[_0x71b3('0x1e')](handleEntityNotFound(_0x1faab,null))[_0x71b3('0x1e')](saveUpdates(_0x59aa95[_0x71b3('0x46')],null))[_0x71b3('0x1e')](respondWithResult(_0x1faab,null))['catch'](handleError(_0x1faab,null));};exports[_0x71b3('0x1d')]=function(_0x44c78a,_0x5db6bc){return db[_0x71b3('0x3b')][_0x71b3('0x4b')]({'where':{'id':_0x44c78a[_0x71b3('0x42')]['id']}})[_0x71b3('0x1e')](handleEntityNotFound(_0x5db6bc,null))[_0x71b3('0x1e')](removeEntity(_0x5db6bc,null))['catch'](handleError(_0x5db6bc,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index c3b6452..476ba16 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 _0x2750=['rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1130b6,_0xb58cb8){var _0x1da4ff=function(_0x1b563a){while(--_0x1b563a){_0x1130b6['push'](_0x1130b6['shift']());}};_0x1da4ff(++_0xb58cb8);}(_0x2750,0x13b));var _0x0275=function(_0x5c8bb7,_0x2962a3){_0x5c8bb7=_0x5c8bb7-0x0;var _0x2e55aa=_0x2750[_0x5c8bb7];return _0x2e55aa;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var moment=require(_0x0275('0x3'));var BPromise=require(_0x0275('0x4'));var rp=require(_0x0275('0x5'));var fs=require('fs');var path=require(_0x0275('0x6'));var rimraf=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var attributes=require(_0x0275('0x9'));module[_0x0275('0xa')]=function(_0x5953f9,_0x3f645f){return _0x5953f9[_0x0275('0xb')](_0x0275('0xc'),attributes,{'tableName':_0x0275('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae79=['../../config/environment','./variable.attributes','exports','define','tools_variables','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x166b39,_0x29c1cd){var _0x16a5ca=function(_0x372de4){while(--_0x372de4){_0x166b39['push'](_0x166b39['shift']());}};_0x16a5ca(++_0x29c1cd);}(_0xae79,0x1d3));var _0x9ae7=function(_0x1f1ca3,_0x25afd6){_0x1f1ca3=_0x1f1ca3-0x0;var _0x1a1c21=_0xae79[_0x1f1ca3];return _0x1a1c21;};'use strict';var _=require(_0x9ae7('0x0'));var util=require(_0x9ae7('0x1'));var logger=require(_0x9ae7('0x2'))(_0x9ae7('0x3'));var moment=require(_0x9ae7('0x4'));var BPromise=require(_0x9ae7('0x5'));var rp=require(_0x9ae7('0x6'));var fs=require('fs');var path=require(_0x9ae7('0x7'));var rimraf=require(_0x9ae7('0x8'));var config=require(_0x9ae7('0x9'));var attributes=require(_0x9ae7('0xa'));module[_0x9ae7('0xb')]=function(_0x3e98cf,_0x396863){return _0x3e98cf[_0x9ae7('0xc')]('Variable',attributes,{'tableName':_0x9ae7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 7f7fb36..4a2d6db 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 _0xd272=['model','attributes','map','then','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowVariable','Variable','options','raw','where','include'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd272,0xe5));var _0x2d27=function(_0x932336,_0x353736){_0x932336=_0x932336-0x0;var _0x3602e9=_0xd272[_0x932336];return _0x3602e9;};'use strict';var _=require(_0x2d27('0x0'));var util=require(_0x2d27('0x1'));var moment=require(_0x2d27('0x2'));var BPromise=require(_0x2d27('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d27('0x4'));var db=require(_0x2d27('0x5'))['db'];var utils=require(_0x2d27('0x6'));var logger=require('../../config/logger')(_0x2d27('0x7'));var config=require(_0x2d27('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2d27('0x9')][_0x2d27('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58ea8a,_0x277c59,_0x3a2282){return new BPromise(function(_0x26edd8,_0x5b4f2a){return client[_0x2d27('0xb')](_0x58ea8a,_0x3a2282)['then'](function(_0x47e0f2){logger[_0x2d27('0xc')](_0x2d27('0xd'),_0x277c59,_0x2d27('0xe'));logger[_0x2d27('0xf')](_0x2d27('0x10'),_0x277c59,'request\x20sent',JSON['stringify'](_0x47e0f2));if(_0x47e0f2[_0x2d27('0x11')]){if(_0x47e0f2[_0x2d27('0x11')][_0x2d27('0x12')]===0x1f4){logger['error'](_0x2d27('0xd'),_0x277c59,_0x47e0f2[_0x2d27('0x11')][_0x2d27('0x13')]);return _0x5b4f2a(_0x47e0f2[_0x2d27('0x11')]['message']);}logger[_0x2d27('0x11')](_0x2d27('0xd'),_0x277c59,_0x47e0f2['error'][_0x2d27('0x13')]);return _0x26edd8(_0x47e0f2['error'][_0x2d27('0x13')]);}else{logger[_0x2d27('0xc')]('Variable,\x20%s,\x20%s',_0x277c59,'request\x20sent');_0x26edd8(_0x47e0f2['result'][_0x2d27('0x13')]);}})[_0x2d27('0x14')](function(_0x2d56c7){logger[_0x2d27('0x11')]('Variable,\x20%s,\x20%s',_0x277c59,_0x2d56c7);_0x5b4f2a(_0x2d56c7);});});}exports[_0x2d27('0x15')]=function(_0x1276f6){var _0x5e683e=this;return new Promise(function(_0x896ab2,_0x48b7bb){return db[_0x2d27('0x16')]['find']({'raw':_0x1276f6['options']?_0x1276f6[_0x2d27('0x17')][_0x2d27('0x18')]===undefined?!![]:![]:!![],'where':_0x1276f6[_0x2d27('0x17')]?_0x1276f6[_0x2d27('0x17')][_0x2d27('0x19')]||null:null,'attributes':_0x1276f6['options']?_0x1276f6[_0x2d27('0x17')]['attributes']||null:null,'include':_0x1276f6[_0x2d27('0x17')]?_0x1276f6[_0x2d27('0x17')][_0x2d27('0x1a')]?_['map'](_0x1276f6['options'][_0x2d27('0x1a')],function(_0x75aa44){return{'model':db[_0x75aa44[_0x2d27('0x1b')]],'as':_0x75aa44['as'],'attributes':_0x75aa44[_0x2d27('0x1c')],'include':_0x75aa44['include']?_[_0x2d27('0x1d')](_0x75aa44[_0x2d27('0x1a')],function(_0x3085e9){return{'model':db[_0x3085e9[_0x2d27('0x1b')]],'as':_0x3085e9['as'],'attributes':_0x3085e9[_0x2d27('0x1c')],'include':_0x3085e9[_0x2d27('0x1a')]?_[_0x2d27('0x1d')](_0x3085e9[_0x2d27('0x1a')],function(_0x254293){return{'model':db[_0x254293[_0x2d27('0x1b')]],'as':_0x254293['as'],'attributes':_0x254293[_0x2d27('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2d27('0x1e')](function(_0x94df16){logger[_0x2d27('0xc')](_0x2d27('0x15'),_0x1276f6);logger[_0x2d27('0xf')](_0x2d27('0x15'),_0x1276f6,JSON[_0x2d27('0x1f')](_0x94df16));_0x896ab2(_0x94df16);})[_0x2d27('0x14')](function(_0x505bb1){logger[_0x2d27('0x11')]('ShowVariable',_0x505bb1[_0x2d27('0x13')],_0x1276f6);_0x48b7bb(_0x5e683e[_0x2d27('0x11')](0x1f4,_0x505bb1[_0x2d27('0x13')]));});});}; \ No newline at end of file +var _0xcebf=['../../config/logger','../../config/environment','client','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','moment','bluebird','randomstring','../../mysqldb'];(function(_0x42ca15,_0x193ccb){var _0x1c6ded=function(_0x40989a){while(--_0x40989a){_0x42ca15['push'](_0x42ca15['shift']());}};_0x1c6ded(++_0x193ccb);}(_0xcebf,0xa4));var _0xfceb=function(_0xf0bbde,_0x1e8776){_0xf0bbde=_0xf0bbde-0x0;var _0x450001=_0xcebf[_0xf0bbde];return _0x450001;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfceb('0x0'));var BPromise=require(_0xfceb('0x1'));var rs=require(_0xfceb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfceb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfceb('0x4'))('rpc');var config=require(_0xfceb('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xfceb('0x6')][_0xfceb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x553722,_0x479c96,_0x66813){return new BPromise(function(_0xef3bc4,_0x84c546){return client['request'](_0x553722,_0x66813)[_0xfceb('0x8')](function(_0x3f8b90){logger[_0xfceb('0x9')](_0xfceb('0xa'),_0x479c96,_0xfceb('0xb'));logger[_0xfceb('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x479c96,_0xfceb('0xb'),JSON[_0xfceb('0xd')](_0x3f8b90));if(_0x3f8b90[_0xfceb('0xe')]){if(_0x3f8b90[_0xfceb('0xe')]['code']===0x1f4){logger[_0xfceb('0xe')](_0xfceb('0xa'),_0x479c96,_0x3f8b90['error']['message']);return _0x84c546(_0x3f8b90[_0xfceb('0xe')][_0xfceb('0xf')]);}logger['error'](_0xfceb('0xa'),_0x479c96,_0x3f8b90[_0xfceb('0xe')][_0xfceb('0xf')]);return _0xef3bc4(_0x3f8b90[_0xfceb('0xe')][_0xfceb('0xf')]);}else{logger['info'](_0xfceb('0xa'),_0x479c96,_0xfceb('0xb'));_0xef3bc4(_0x3f8b90[_0xfceb('0x10')][_0xfceb('0xf')]);}})[_0xfceb('0x11')](function(_0x40ada1){logger['error'](_0xfceb('0xa'),_0x479c96,_0x40ada1);_0x84c546(_0x40ada1);});});}exports[_0xfceb('0x12')]=function(_0x440029){var _0x5a7de2=this;return new Promise(function(_0xf84e58,_0x3792d2){return db[_0xfceb('0x13')][_0xfceb('0x14')]({'raw':_0x440029[_0xfceb('0x15')]?_0x440029[_0xfceb('0x15')][_0xfceb('0x16')]===undefined?!![]:![]:!![],'where':_0x440029['options']?_0x440029[_0xfceb('0x15')][_0xfceb('0x17')]||null:null,'attributes':_0x440029['options']?_0x440029[_0xfceb('0x15')][_0xfceb('0x18')]||null:null,'include':_0x440029['options']?_0x440029[_0xfceb('0x15')]['include']?_[_0xfceb('0x19')](_0x440029[_0xfceb('0x15')][_0xfceb('0x1a')],function(_0xd58b56){return{'model':db[_0xd58b56[_0xfceb('0x1b')]],'as':_0xd58b56['as'],'attributes':_0xd58b56[_0xfceb('0x18')],'include':_0xd58b56[_0xfceb('0x1a')]?_[_0xfceb('0x19')](_0xd58b56[_0xfceb('0x1a')],function(_0x2936e6){return{'model':db[_0x2936e6[_0xfceb('0x1b')]],'as':_0x2936e6['as'],'attributes':_0x2936e6['attributes'],'include':_0x2936e6[_0xfceb('0x1a')]?_[_0xfceb('0x19')](_0x2936e6[_0xfceb('0x1a')],function(_0x10dc29){return{'model':db[_0x10dc29[_0xfceb('0x1b')]],'as':_0x10dc29['as'],'attributes':_0x10dc29[_0xfceb('0x18')]};}):[]};}):[]};}):[]:[]})[_0xfceb('0x8')](function(_0xede673){logger['info'](_0xfceb('0x12'),_0x440029);logger[_0xfceb('0xc')](_0xfceb('0x12'),_0x440029,JSON[_0xfceb('0xd')](_0xede673));_0xf84e58(_0xede673);})[_0xfceb('0x11')](function(_0x26faf0){logger['error'](_0xfceb('0x12'),_0x26faf0[_0xfceb('0xf')],_0x440029);_0x3792d2(_0x5a7de2[_0xfceb('0xe')](0x1f4,_0x26faf0[_0xfceb('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 414c1dd..da824dc 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 _0xf6b6=['/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/migrations','exports','Router','../../components/auth/service','get','index'];(function(_0x1607b8,_0x19529a){var _0x2f5d8f=function(_0x4ebf10){while(--_0x4ebf10){_0x1607b8['push'](_0x1607b8['shift']());}};_0x2f5d8f(++_0x19529a);}(_0xf6b6,0x1e6));var _0x6f6b=function(_0x1bad94,_0x39c032){_0x1bad94=_0x1bad94-0x0;var _0xc9b061=_0xf6b6[_0x1bad94];return _0xc9b061;};'use strict';var express=require('express');var router=express[_0x6f6b('0x0')]();var auth=require(_0x6f6b('0x1'));var controller=require('./version.controller');router[_0x6f6b('0x2')]('/',controller[_0x6f6b('0x3')]);router[_0x6f6b('0x2')](_0x6f6b('0x4'),auth[_0x6f6b('0x5')](),auth[_0x6f6b('0x6')](),controller[_0x6f6b('0x7')]);router[_0x6f6b('0x2')](_0x6f6b('0x8'),auth[_0x6f6b('0x5')](),auth[_0x6f6b('0x6')](),controller[_0x6f6b('0x9')]);router['get'](_0x6f6b('0xa'),auth[_0x6f6b('0x5')](),auth[_0x6f6b('0x6')](),controller[_0x6f6b('0xb')]);router[_0x6f6b('0x2')]('/restart',auth[_0x6f6b('0x5')](),controller['restart']);router[_0x6f6b('0x2')](_0x6f6b('0xc'),controller['migrations']);module[_0x6f6b('0xd')]=router; \ No newline at end of file +var _0x1833=['./version.controller','index','/fetch','isAuthenticated','canUpdate','get','/reset','reset','/restart','restart','/migrations','migrations','exports','express','Router','../../components/auth/service'];(function(_0x24392f,_0x15a3e5){var _0x591e33=function(_0xe0ccea){while(--_0xe0ccea){_0x24392f['push'](_0x24392f['shift']());}};_0x591e33(++_0x15a3e5);}(_0x1833,0xed));var _0x3183=function(_0xe99c61,_0x2be484){_0xe99c61=_0xe99c61-0x0;var _0x22eb35=_0x1833[_0xe99c61];return _0x22eb35;};'use strict';var express=require(_0x3183('0x0'));var router=express[_0x3183('0x1')]();var auth=require(_0x3183('0x2'));var controller=require(_0x3183('0x3'));router['get']('/',controller[_0x3183('0x4')]);router['get'](_0x3183('0x5'),auth[_0x3183('0x6')](),auth[_0x3183('0x7')](),controller['fetch']);router[_0x3183('0x8')](_0x3183('0x9'),auth[_0x3183('0x6')](),auth[_0x3183('0x7')](),controller[_0x3183('0xa')]);router[_0x3183('0x8')]('/pull',auth[_0x3183('0x6')](),auth['canUpdate'](),controller['pull']);router['get'](_0x3183('0xb'),auth[_0x3183('0x6')](),controller[_0x3183('0xc')]);router['get'](_0x3183('0xd'),controller[_0x3183('0xe')]);module[_0x3183('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 9fa6831..8484dc2 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 _0x3f35=['Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','exports','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/pm2','update','simple-git','root','index','query','latest','fetch','json','origin','error','status','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard','pull','restart','pm2\x20restart\x20motion\x20%s','migrations','readdirSync','join','server','replace','.js','push','sort','sequelize','Migration','constructor'];(function(_0x527a53,_0x3265d6){var _0x2332f5=function(_0x3b2d90){while(--_0x3b2d90){_0x527a53['push'](_0x527a53['shift']());}};_0x2332f5(++_0x3265d6);}(_0x3f35,0x1ae));var _0x53f3=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x3f35[_0x29b609];return _0x54c952;};'use strict';var Umzug=require(_0x53f3('0x0'));var path=require(_0x53f3('0x1'));var fs=require('fs');var _=require(_0x53f3('0x2'));var pkginfo=require(_0x53f3('0x3'))(module,_0x53f3('0x4'));var compareVersions=require(_0x53f3('0x5'));var exec=require(_0x53f3('0x6'))['exec'];var db=require(_0x53f3('0x7'))['db'];var config=require('../../config/environment');var pm2=require(_0x53f3('0x8'));var logger=require('../../config/logger')(_0x53f3('0x9'));var git=require(_0x53f3('0xa'))(config[_0x53f3('0xb')]);exports[_0x53f3('0xc')]=function(_0x5f0369,_0x152cb4){var _0x5d91ba={'current':module['exports']['version'],'phonebar':0x2};if(_0x5f0369[_0x53f3('0xd')]&&_0x5f0369[_0x53f3('0xd')][_0x53f3('0xe')]){return git[_0x53f3('0xf')]()['tags'](function(_0x5d5c51,_0x26ba59){_0x5d91ba[_0x53f3('0xe')]=(_0x5d5c51?module['exports']['version']:_0x26ba59[_0x53f3('0xe')])||'2.0.0';return _0x152cb4['status'](0xc8)[_0x53f3('0x10')](_0x5d91ba);});}else{return _0x152cb4['status'](0xc8)['json'](_0x5d91ba);}};exports[_0x53f3('0xf')]=function(_0x120f4a,_0x59e7c5){return git['fetch']([_0x53f3('0x11'),'master'],function(_0x170927){if(_0x170927){logger[_0x53f3('0x12')](_0x170927);return _0x59e7c5[_0x53f3('0x13')](0x1f4)[_0x53f3('0x10')](_0x170927);}logger[_0x53f3('0x14')](_0x53f3('0x15'));return _0x59e7c5[_0x53f3('0x13')](0xc8)['json']({'output':_0x53f3('0x16')});});};exports[_0x53f3('0x17')]=function(_0x1cb1bd,_0x5ae118){return git['reset']([_0x53f3('0x18'),'FETCH_HEAD'],function(_0x35e4a5){if(_0x35e4a5){logger[_0x53f3('0x12')](_0x35e4a5);return _0x5ae118['status'](0x1f4)[_0x53f3('0x10')](_0x35e4a5);}logger[_0x53f3('0x14')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x5ae118[_0x53f3('0x13')](0xc8)[_0x53f3('0x10')]({'output':_0x53f3('0x19')});});};exports[_0x53f3('0x1a')]=function(_0x36e191,_0x33c9a8){exec('npm\x20install\x20--production',function(_0xef4593,_0x268a0a,_0x2ba5db){logger[_0x53f3('0x14')](_0x268a0a);logger[_0x53f3('0x14')](_0x2ba5db);if(_0xef4593){logger['error'](_0xef4593);return _0x33c9a8[_0x53f3('0x13')](0x1f4)[_0x53f3('0x10')](_0xef4593);}return _0x33c9a8[_0x53f3('0x13')](0xc8)[_0x53f3('0x10')]({'output':_0x268a0a});});};exports[_0x53f3('0x1b')]=function(_0x8a8807,_0x59bc9b){return pm2[_0x53f3('0x1b')]('motion2')['then'](function(_0x3b0512){logger['info'](_0x53f3('0x1c'),_0x3b0512);return _0x59bc9b[_0x53f3('0x13')](0xc8)[_0x53f3('0x10')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x1dcd1d){logger[_0x53f3('0x12')](_0x1dcd1d);return _0x59bc9b[_0x53f3('0x13')](0x1f4)[_0x53f3('0x10')](_0x1dcd1d);});};exports[_0x53f3('0x1d')]=function(_0x5a4b2f,_0x1b172b){var _0x1ccd36=fs[_0x53f3('0x1e')](path[_0x53f3('0x1f')](config['root'],_0x53f3('0x20'),_0x53f3('0x1d')));var _0x5afd83=[];for(var _0x2ebf51=0x0;_0x2ebf51<_0x1ccd36['length'];_0x2ebf51++){var _0x48f365=_0x1ccd36[_0x2ebf51][_0x53f3('0x21')](_0x53f3('0x22'),'');if(compareVersions(module['exports']['version'],_0x48f365)===-0x1){_0x5afd83[_0x53f3('0x23')](_0x48f365);}}if(_0x5afd83['length']){var _0x5073d7=_0x5afd83[_0x53f3('0x24')](compareVersions);var _0x326a61=new Umzug({'storage':_0x53f3('0x25'),'storageOptions':{'model':db[_0x53f3('0x26')],'modelName':_0x53f3('0x26'),'columnName':'version'},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db[_0x53f3('0x25')][_0x53f3('0x27')],function(){throw new Error(_0x53f3('0x28'));}],'path':path[_0x53f3('0x1f')](config['root'],_0x53f3('0x20'),'migrations'),'pattern':/\.js$/}});_0x326a61['up']({'migrations':_[_0x53f3('0x29')](_0x5073d7,function(_0x38976e){return _0x38976e+_0x53f3('0x22');})})[_0x53f3('0x2a')](function(){return _0x1b172b['status'](0xc8)[_0x53f3('0x10')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x53f3('0x2b')]['version']+'\x20to\x20'+_['last'](_0x5073d7),'migrations':_[_0x53f3('0x1f')](_0x5073d7)});})[_0x53f3('0x2c')](function(_0x490d4c){if(_0x490d4c instanceof db['sequelize'][_0x53f3('0x2d')]){return _0x1b172b['status'](0xc8)[_0x53f3('0x10')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x1b172b['status'](0x1f4)[_0x53f3('0x10')](_0x490d4c);}});}else{return _0x1b172b['status'](0xc8)[_0x53f3('0x10')]({'output':_0x53f3('0x2e')});}}; \ No newline at end of file +var _0x7753=['restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','readdirSync','join','server','migrations','replace','.js','push','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','simple-git','root','exports','query','latest','fetch','tags','2.0.0','status','origin','error','json','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production'];(function(_0x495f8b,_0x2222d9){var _0x150567=function(_0x37631b){while(--_0x37631b){_0x495f8b['push'](_0x495f8b['shift']());}};_0x150567(++_0x2222d9);}(_0x7753,0xfd));var _0x3775=function(_0x193ddf,_0x6f30bb){_0x193ddf=_0x193ddf-0x0;var _0x5bc6df=_0x7753[_0x193ddf];return _0x5bc6df;};'use strict';var Umzug=require(_0x3775('0x0'));var path=require(_0x3775('0x1'));var fs=require('fs');var _=require(_0x3775('0x2'));var pkginfo=require(_0x3775('0x3'))(module,_0x3775('0x4'));var compareVersions=require('compare-versions');var exec=require(_0x3775('0x5'))[_0x3775('0x6')];var db=require(_0x3775('0x7'))['db'];var config=require('../../config/environment');var pm2=require(_0x3775('0x8'));var logger=require(_0x3775('0x9'))('update');var git=require(_0x3775('0xa'))(config[_0x3775('0xb')]);exports['index']=function(_0x55077d,_0x3b6f9a){var _0x1a90fe={'current':module[_0x3775('0xc')][_0x3775('0x4')],'phonebar':0x2};if(_0x55077d[_0x3775('0xd')]&&_0x55077d['query'][_0x3775('0xe')]){return git[_0x3775('0xf')]()[_0x3775('0x10')](function(_0x19155a,_0x311c0c){_0x1a90fe[_0x3775('0xe')]=(_0x19155a?module['exports'][_0x3775('0x4')]:_0x311c0c[_0x3775('0xe')])||_0x3775('0x11');return _0x3b6f9a[_0x3775('0x12')](0xc8)['json'](_0x1a90fe);});}else{return _0x3b6f9a[_0x3775('0x12')](0xc8)['json'](_0x1a90fe);}};exports[_0x3775('0xf')]=function(_0x277115,_0x14a183){return git['fetch']([_0x3775('0x13'),'master'],function(_0x5df8ec){if(_0x5df8ec){logger[_0x3775('0x14')](_0x5df8ec);return _0x14a183[_0x3775('0x12')](0x1f4)[_0x3775('0x15')](_0x5df8ec);}logger[_0x3775('0x16')](_0x3775('0x17'));return _0x14a183[_0x3775('0x12')](0xc8)[_0x3775('0x15')]({'output':_0x3775('0x18')});});};exports['reset']=function(_0x1b2ef5,_0x4a149d){return git[_0x3775('0x19')]([_0x3775('0x1a'),_0x3775('0x1b')],function(_0x4eb999){if(_0x4eb999){logger[_0x3775('0x14')](_0x4eb999);return _0x4a149d[_0x3775('0x12')](0x1f4)[_0x3775('0x15')](_0x4eb999);}logger[_0x3775('0x16')](_0x3775('0x1c'));return _0x4a149d[_0x3775('0x12')](0xc8)[_0x3775('0x15')]({'output':_0x3775('0x1d')});});};exports[_0x3775('0x1e')]=function(_0x58263a,_0x44d371){exec(_0x3775('0x1f'),function(_0x176adb,_0x326ab9,_0x58affa){logger['info'](_0x326ab9);logger[_0x3775('0x16')](_0x58affa);if(_0x176adb){logger[_0x3775('0x14')](_0x176adb);return _0x44d371[_0x3775('0x12')](0x1f4)['json'](_0x176adb);}return _0x44d371['status'](0xc8)[_0x3775('0x15')]({'output':_0x326ab9});});};exports[_0x3775('0x20')]=function(_0x215193,_0x5cb1b0){return pm2[_0x3775('0x20')](_0x3775('0x21'))[_0x3775('0x22')](function(_0x4b0147){logger[_0x3775('0x16')]('pm2\x20restart\x20motion\x20%s',_0x4b0147);return _0x5cb1b0[_0x3775('0x12')](0xc8)['json']({'output':_0x3775('0x23')});})['catch'](function(_0x431629){logger[_0x3775('0x14')](_0x431629);return _0x5cb1b0[_0x3775('0x12')](0x1f4)[_0x3775('0x15')](_0x431629);});};exports['migrations']=function(_0xa102fa,_0x351d2d){var _0x1361b0=fs[_0x3775('0x24')](path[_0x3775('0x25')](config[_0x3775('0xb')],_0x3775('0x26'),_0x3775('0x27')));var _0xa508b2=[];for(var _0x53b002=0x0;_0x53b002<_0x1361b0['length'];_0x53b002++){var _0x3f39d2=_0x1361b0[_0x53b002][_0x3775('0x28')](_0x3775('0x29'),'');if(compareVersions(module[_0x3775('0xc')][_0x3775('0x4')],_0x3f39d2)===-0x1){_0xa508b2[_0x3775('0x2a')](_0x3f39d2);}}if(_0xa508b2[_0x3775('0x2b')]){var _0x528c89=_0xa508b2[_0x3775('0x2c')](compareVersions);var _0x51f3dd=new Umzug({'storage':_0x3775('0x2d'),'storageOptions':{'model':db[_0x3775('0x2e')],'modelName':_0x3775('0x2e'),'columnName':_0x3775('0x4')},'migrations':{'params':[db['sequelize'][_0x3775('0x2f')](),db[_0x3775('0x2d')][_0x3775('0x30')],function(){throw new Error(_0x3775('0x31'));}],'path':path['join'](config[_0x3775('0xb')],_0x3775('0x26'),_0x3775('0x27')),'pattern':/\.js$/}});_0x51f3dd['up']({'migrations':_[_0x3775('0x32')](_0x528c89,function(_0x56a5a8){return _0x56a5a8+_0x3775('0x29');})})[_0x3775('0x22')](function(){return _0x351d2d[_0x3775('0x12')](0xc8)['json']({'output':_0x3775('0x33')+module[_0x3775('0xc')]['version']+_0x3775('0x34')+_[_0x3775('0x35')](_0x528c89),'migrations':_[_0x3775('0x25')](_0x528c89)});})[_0x3775('0x36')](function(_0x418802){if(_0x418802 instanceof db[_0x3775('0x2d')][_0x3775('0x37')]){return _0x351d2d[_0x3775('0x12')](0xc8)[_0x3775('0x15')]({'output':_0x3775('0x38')});}else{return _0x351d2d['status'](0x1f4)[_0x3775('0x15')](_0x418802);}});}else{return _0x351d2d[_0x3775('0x12')](0xc8)[_0x3775('0x15')]({'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 855f3ba..663791b 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 _0x2a61=['exports','multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','put','delete','destroy'];(function(_0x1fbcdc,_0x536ca5){var _0x492b93=function(_0x46236b){while(--_0x46236b){_0x1fbcdc['push'](_0x1fbcdc['shift']());}};_0x492b93(++_0x536ca5);}(_0x2a61,0xa6));var _0x12a6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x2a61[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0x12a6('0x0'));var util=require(_0x12a6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x12a6('0x2'));var interaction=require(_0x12a6('0x3'));var config=require(_0x12a6('0x4'));var controller=require('./voiceAgentReport.controller');router[_0x12a6('0x5')]('/',auth[_0x12a6('0x6')](),controller[_0x12a6('0x7')]);router[_0x12a6('0x5')](_0x12a6('0x8'),auth[_0x12a6('0x6')](),controller[_0x12a6('0x9')]);router[_0x12a6('0x5')](_0x12a6('0xa'),auth[_0x12a6('0x6')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x12a6('0xb')](_0x12a6('0xa'),auth[_0x12a6('0x6')](),controller['update']);router[_0x12a6('0xc')](_0x12a6('0xa'),auth['isAuthenticated'](),controller[_0x12a6('0xd')]);module[_0x12a6('0xe')]=router; \ No newline at end of file +var _0xef12=['delete','exports','multer','util','path','express','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update'];(function(_0xfc7568,_0x250f88){var _0x10e894=function(_0x1a109d){while(--_0x1a109d){_0xfc7568['push'](_0xfc7568['shift']());}};_0x10e894(++_0x250f88);}(_0xef12,0x1d6));var _0x2ef1=function(_0x43b4d1,_0x1384d7){_0x43b4d1=_0x43b4d1-0x0;var _0x10bf7b=_0xef12[_0x43b4d1];return _0x10bf7b;};'use strict';var multer=require(_0x2ef1('0x0'));var util=require(_0x2ef1('0x1'));var path=require(_0x2ef1('0x2'));var timeout=require('connect-timeout');var express=require(_0x2ef1('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x2ef1('0x4'));var config=require('../../config/environment');var controller=require(_0x2ef1('0x5'));router[_0x2ef1('0x6')]('/',auth[_0x2ef1('0x7')](),controller[_0x2ef1('0x8')]);router[_0x2ef1('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x2ef1('0x9')]);router[_0x2ef1('0x6')](_0x2ef1('0xa'),auth[_0x2ef1('0x7')](),controller[_0x2ef1('0xb')]);router[_0x2ef1('0xc')]('/',auth['isAuthenticated'](),controller[_0x2ef1('0xd')]);router[_0x2ef1('0xe')](_0x2ef1('0xa'),auth[_0x2ef1('0x7')](),controller[_0x2ef1('0xf')]);router[_0x2ef1('0x10')](_0x2ef1('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x2ef1('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index dba34e0..7855b78 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 _0x2d17=['STRING','DATE','INTEGER','BOOLEAN','sequelize','exports'];(function(_0xa8592d,_0x2303b0){var _0x448f16=function(_0x3b7cd9){while(--_0x3b7cd9){_0xa8592d['push'](_0xa8592d['shift']());}};_0x448f16(++_0x2303b0);}(_0x2d17,0x17e));var _0x72d1=function(_0x4bb4c4,_0x58efdc){_0x4bb4c4=_0x4bb4c4-0x0;var _0x3de71f=_0x2d17[_0x4bb4c4];return _0x3de71f;};'use strict';var Sequelize=require(_0x72d1('0x0'));module[_0x72d1('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x72d1('0x2')]},'calleridnum':{'type':Sequelize[_0x72d1('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x72d1('0x2')]},'interface':{'type':Sequelize[_0x72d1('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x72d1('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x72d1('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x72d1('0x3')]},'holdtime':{'type':Sequelize[_0x72d1('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x72d1('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x72d1('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x72d1('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x72d1('0x4')]},'reason':{'type':Sequelize[_0x72d1('0x2')]},'lastevent':{'type':Sequelize[_0x72d1('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x72d1('0x4')]},'channelstatedesc':{'type':Sequelize[_0x72d1('0x2')]},'connectedlinenum':{'type':Sequelize[_0x72d1('0x2')]},'connectedlinename':{'type':Sequelize[_0x72d1('0x2')]},'language':{'type':Sequelize[_0x72d1('0x2')]},'accountcode':{'type':Sequelize[_0x72d1('0x2')]},'context':{'type':Sequelize[_0x72d1('0x2')]},'exten':{'type':Sequelize[_0x72d1('0x2')]},'priority':{'type':Sequelize[_0x72d1('0x2')]},'destchannel':{'type':Sequelize[_0x72d1('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x72d1('0x2')]},'destcalleridnum':{'type':Sequelize[_0x72d1('0x2')]},'destcalleridname':{'type':Sequelize[_0x72d1('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x72d1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x72d1('0x2')]},'destlanguage':{'type':Sequelize[_0x72d1('0x2')]},'destaccountcode':{'type':Sequelize[_0x72d1('0x2')]},'destcontext':{'type':Sequelize[_0x72d1('0x2')]},'destexten':{'type':Sequelize[_0x72d1('0x2')]},'destpriority':{'type':Sequelize[_0x72d1('0x2')]},'destuniqueid':{'type':Sequelize[_0x72d1('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x72d1('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x72d1('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x72d1('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x72d1('0x2')]},'transferuniqueid':{'type':Sequelize[_0x72d1('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8d0e=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x282402,_0x5bba28){var _0x240991=function(_0xae6df5){while(--_0xae6df5){_0x282402['push'](_0x282402['shift']());}};_0x240991(++_0x5bba28);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x271fbf,_0x350467){_0x271fbf=_0x271fbf-0x0;var _0x2725ce=_0x8d0e[_0x271fbf];return _0x2725ce;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'type':{'type':Sequelize[_0xe8d0('0x2')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'queue':{'type':Sequelize[_0xe8d0('0x2')]},'interface':{'type':Sequelize[_0xe8d0('0x2')]},'membername':{'type':Sequelize[_0xe8d0('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xe8d0('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xe8d0('0x3')]},'holdtime':{'type':Sequelize[_0xe8d0('0x4')]},'agentcomplete':{'type':Sequelize[_0xe8d0('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xe8d0('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xe8d0('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xe8d0('0x4')]},'agentacw':{'type':Sequelize[_0xe8d0('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe8d0('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize[_0xe8d0('0x2')]},'context':{'type':Sequelize[_0xe8d0('0x2')]},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xe8d0('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize[_0xe8d0('0x2')]},'destcontext':{'type':Sequelize[_0xe8d0('0x2')]},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x2')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xe8d0('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe8d0('0x2')],'comment':_0xe8d0('0x6')},'transferexten':{'type':Sequelize[_0xe8d0('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 931e2a9..bb9b3a9 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 _0x0958=['create','body','update','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','to-csv','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','set','json','save','end','error','stack','name','send','index','VoiceAgentReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','then','includeAll','include','findAll','rows','catch','show','params','find'];(function(_0x3997be,_0x3e8a1d){var _0x1c4093=function(_0x1c50a5){while(--_0x1c50a5){_0x3997be['push'](_0x3997be['shift']());}};_0x1c4093(++_0x3e8a1d);}(_0x0958,0x1e8));var _0x8095=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0958[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8095('0x0'));var rimraf=require(_0x8095('0x1'));var zipdir=require(_0x8095('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8095('0x3'));var moment=require(_0x8095('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8095('0x5'));var util=require(_0x8095('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8095('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8095('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8095('0x7'));var querystring=require(_0x8095('0x9'));var Papa=require(_0x8095('0xa'));var Redis=require(_0x8095('0xb'));var authService=require(_0x8095('0xc'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8095('0xd'));var logger=require(_0x8095('0xe'))(_0x8095('0xf'));var utils=require(_0x8095('0x10'));var config=require(_0x8095('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb3952d,_0x16ffc3){_0x16ffc3=_0x16ffc3||0xcc;return function(_0x961c0f){if(_0x961c0f){return _0xb3952d[_0x8095('0x12')](_0x16ffc3);}return _0xb3952d[_0x8095('0x13')](_0x16ffc3)['end']();};}function respondWithResult(_0x520814,_0x599603){_0x599603=_0x599603||0xc8;return function(_0x501eab){if(_0x501eab){return _0x520814[_0x8095('0x13')](_0x599603)['json'](_0x501eab);}};}function respondWithFilteredResult(_0x375974,_0x50a93d){return function(_0x52ef36){if(_0x52ef36){var _0x38b46d=_0x52ef36[_0x8095('0x14')],_0xc17685=_0x50a93d[_0x8095('0x15')],_0x579bf4=_0x50a93d[_0x8095('0x15')]+_0x50a93d['limit'],_0x1f7df1;if(_0x579bf4>=_0x38b46d){_0x579bf4=_0x38b46d;_0x1f7df1=0xc8;}else{_0x1f7df1=0xce;}_0x375974['status'](_0x1f7df1);return _0x375974[_0x8095('0x16')]('Content-Range',_0xc17685+'-'+_0x579bf4+'/'+_0x38b46d)[_0x8095('0x17')](_0x52ef36);}return null;};}function patchUpdates(_0xcf3fda){return function(_0x310067){try{jsonpatch['apply'](_0x310067,_0xcf3fda,!![]);}catch(_0x5623cf){return BPromise['reject'](_0x5623cf);}return _0x310067[_0x8095('0x18')]();};}function saveUpdates(_0x2566d0,_0x2f8d4e){return function(_0x20efff){if(_0x20efff){return _0x20efff['update'](_0x2566d0)['then'](function(_0x5406b4){return _0x5406b4;});}return null;};}function removeEntity(_0x3e43d5,_0x170c02){return function(_0x570932){if(_0x570932){return _0x570932['destroy']()['then'](function(){_0x3e43d5[_0x8095('0x13')](0xcc)[_0x8095('0x19')]();});}};}function handleEntityNotFound(_0x200480,_0x108f8d){return function(_0x44c1f5){if(!_0x44c1f5){_0x200480['sendStatus'](0x194);}return _0x44c1f5;};}function handleError(_0x5d1279,_0x1b8ec6){_0x1b8ec6=_0x1b8ec6||0x1f4;return function(_0x5e4fa0){logger[_0x8095('0x1a')](_0x5e4fa0[_0x8095('0x1b')]);if(_0x5e4fa0[_0x8095('0x1c')]){delete _0x5e4fa0[_0x8095('0x1c')];}_0x5d1279['status'](_0x1b8ec6)[_0x8095('0x1d')](_0x5e4fa0);};}exports[_0x8095('0x1e')]=function(_0x1ff40b,_0x579ee2){var _0x30f1be={},_0x5dbd31={},_0x1ae5e8={'count':0x0,'rows':[]};var _0x414650=db[_0x8095('0x1f')][_0x8095('0x20')];_0x5dbd31[_0x8095('0x21')]=_[_0x8095('0x22')](_0x414650);_0x5dbd31['query']=_['keys'](_0x1ff40b[_0x8095('0x23')]);_0x5dbd31[_0x8095('0x24')]=_[_0x8095('0x25')](_0x5dbd31[_0x8095('0x21')],_0x5dbd31[_0x8095('0x23')]);_0x30f1be[_0x8095('0x26')]=_[_0x8095('0x25')](_0x5dbd31['model'],qs[_0x8095('0x27')](_0x1ff40b[_0x8095('0x23')][_0x8095('0x27')]));_0x30f1be[_0x8095('0x26')]=_0x30f1be[_0x8095('0x26')][_0x8095('0x28')]?_0x30f1be['attributes']:_0x5dbd31[_0x8095('0x21')];if(!_0x1ff40b[_0x8095('0x23')][_0x8095('0x29')](_0x8095('0x2a'))){_0x30f1be[_0x8095('0x2b')]=qs['limit'](_0x1ff40b[_0x8095('0x23')]['limit']);_0x30f1be[_0x8095('0x15')]=qs[_0x8095('0x15')](_0x1ff40b[_0x8095('0x23')][_0x8095('0x15')]);}_0x30f1be[_0x8095('0x2c')]=qs[_0x8095('0x2d')](_0x1ff40b[_0x8095('0x23')][_0x8095('0x2d')]);_0x30f1be[_0x8095('0x2e')]=qs[_0x8095('0x24')](_['pick'](_0x1ff40b[_0x8095('0x23')],_0x5dbd31['filters']));if(_0x1ff40b[_0x8095('0x23')][_0x8095('0x2f')]){_0x30f1be['where']=_[_0x8095('0x30')](_0x30f1be[_0x8095('0x2e')],{'$or':_[_0x8095('0x31')](_0x414650,function(_0x4322a1){if(_0x4322a1[_0x8095('0x32')][_0x8095('0x33')]!==_0x8095('0x34')){var _0x28e169={};_0x28e169[_0x4322a1[_0x8095('0x35')]]={'$like':'%'+_0x1ff40b[_0x8095('0x23')]['filter']+'%'};return _0x28e169;}})});}_0x30f1be=_[_0x8095('0x30')]({},_0x30f1be,_0x1ff40b[_0x8095('0x36')]);var _0x39094c={'where':_0x30f1be['where']};return db['VoiceAgentReport']['count'](_0x39094c)[_0x8095('0x37')](function(_0x45cef3){_0x1ae5e8[_0x8095('0x14')]=_0x45cef3;if(_0x1ff40b['query'][_0x8095('0x38')]){_0x30f1be[_0x8095('0x39')]=[{'all':!![]}];}return db[_0x8095('0x1f')][_0x8095('0x3a')](_0x30f1be);})[_0x8095('0x37')](function(_0xbf8e45){_0x1ae5e8[_0x8095('0x3b')]=_0xbf8e45;return _0x1ae5e8;})['then'](respondWithFilteredResult(_0x579ee2,_0x30f1be))[_0x8095('0x3c')](handleError(_0x579ee2,null));};exports[_0x8095('0x3d')]=function(_0xbb1556,_0x107ec4){var _0x4551d3={'raw':![],'where':{'id':_0xbb1556[_0x8095('0x3e')]['id']}},_0x543b27={};_0x543b27[_0x8095('0x21')]=_[_0x8095('0x22')](db['VoiceAgentReport'][_0x8095('0x20')]);_0x543b27['query']=_[_0x8095('0x22')](_0xbb1556[_0x8095('0x23')]);_0x543b27[_0x8095('0x24')]=_['intersection'](_0x543b27[_0x8095('0x21')],_0x543b27[_0x8095('0x23')]);_0x4551d3[_0x8095('0x26')]=_[_0x8095('0x25')](_0x543b27[_0x8095('0x21')],qs[_0x8095('0x27')](_0xbb1556[_0x8095('0x23')]['fields']));_0x4551d3['attributes']=_0x4551d3[_0x8095('0x26')][_0x8095('0x28')]?_0x4551d3[_0x8095('0x26')]:_0x543b27[_0x8095('0x21')];if(_0xbb1556[_0x8095('0x23')][_0x8095('0x38')]){_0x4551d3[_0x8095('0x39')]=[{'all':!![]}];}_0x4551d3=_[_0x8095('0x30')]({},_0x4551d3,_0xbb1556[_0x8095('0x36')]);return db[_0x8095('0x1f')][_0x8095('0x3f')](_0x4551d3)[_0x8095('0x37')](handleEntityNotFound(_0x107ec4,null))['then'](respondWithResult(_0x107ec4,null))[_0x8095('0x3c')](handleError(_0x107ec4,null));};exports[_0x8095('0x40')]=function(_0x685543,_0x467c1d){return db[_0x8095('0x1f')]['create'](_0x685543[_0x8095('0x41')],{})['then'](respondWithResult(_0x467c1d,0xc9))[_0x8095('0x3c')](handleError(_0x467c1d,null));};exports[_0x8095('0x42')]=function(_0x3438ef,_0x2cec10){if(_0x3438ef[_0x8095('0x41')]['id']){delete _0x3438ef[_0x8095('0x41')]['id'];}return db[_0x8095('0x1f')][_0x8095('0x3f')]({'where':{'id':_0x3438ef['params']['id']}})[_0x8095('0x37')](handleEntityNotFound(_0x2cec10,null))[_0x8095('0x37')](saveUpdates(_0x3438ef[_0x8095('0x41')],null))[_0x8095('0x37')](respondWithResult(_0x2cec10,null))[_0x8095('0x3c')](handleError(_0x2cec10,null));};exports[_0x8095('0x43')]=function(_0x3588da,_0x37242d){return db['VoiceAgentReport'][_0x8095('0x3f')]({'where':{'id':_0x3588da[_0x8095('0x3e')]['id']}})['then'](handleEntityNotFound(_0x37242d,null))[_0x8095('0x37')](removeEntity(_0x37242d,null))[_0x8095('0x3c')](handleError(_0x37242d,null));};exports[_0x8095('0x44')]=function(_0x59709a,_0x3b449c){return db['VoiceAgentReport']['describe']()[_0x8095('0x37')](respondWithResult(_0x3b449c,null))[_0x8095('0x3c')](handleError(_0x3b449c,null));}; \ No newline at end of file +var _0x9c41=['destroy','sendStatus','error','stack','name','VoiceAgentReport','rawAttributes','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','key','field','options','includeAll','rows','show','model','keys','include','catch','create','body','update','params','find','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','squel','jsforce','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then'];(function(_0x33e4a7,_0x2e80a2){var _0x598620=function(_0x65d618){while(--_0x65d618){_0x33e4a7['push'](_0x33e4a7['shift']());}};_0x598620(++_0x2e80a2);}(_0x9c41,0x17f));var _0x19c4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9c41[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x19c4('0x0'));var emlformat=require(_0x19c4('0x1'));var rimraf=require(_0x19c4('0x2'));var zipdir=require(_0x19c4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x19c4('0x4'));var moment=require(_0x19c4('0x5'));var BPromise=require(_0x19c4('0x6'));var Mustache=require(_0x19c4('0x7'));var util=require('util');var path=require('path');var sox=require(_0x19c4('0x8'));var csv=require(_0x19c4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x19c4('0xa'));var crypto=require('crypto');var jsforce=require(_0x19c4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x19c4('0x9'));var querystring=require('querystring');var Papa=require(_0x19c4('0xc'));var Redis=require(_0x19c4('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x19c4('0xe'));var logger=require('../../config/logger')(_0x19c4('0xf'));var utils=require(_0x19c4('0x10'));var config=require(_0x19c4('0x11'));var db=require(_0x19c4('0x12'))['db'];function respondWithStatusCode(_0x5c2dbf,_0x296139){_0x296139=_0x296139||0xcc;return function(_0xaa00d2){if(_0xaa00d2){return _0x5c2dbf['sendStatus'](_0x296139);}return _0x5c2dbf['status'](_0x296139)[_0x19c4('0x13')]();};}function respondWithResult(_0x468fff,_0x292c00){_0x292c00=_0x292c00||0xc8;return function(_0x4c0fdd){if(_0x4c0fdd){return _0x468fff[_0x19c4('0x14')](_0x292c00)[_0x19c4('0x15')](_0x4c0fdd);}};}function respondWithFilteredResult(_0x367b53,_0x97ec3b){return function(_0x2677f9){if(_0x2677f9){var _0x167f88=_0x2677f9[_0x19c4('0x16')],_0x9f0eb9=_0x97ec3b['offset'],_0x2ac884=_0x97ec3b[_0x19c4('0x17')]+_0x97ec3b[_0x19c4('0x18')],_0x27ebe2;if(_0x2ac884>=_0x167f88){_0x2ac884=_0x167f88;_0x27ebe2=0xc8;}else{_0x27ebe2=0xce;}_0x367b53['status'](_0x27ebe2);return _0x367b53[_0x19c4('0x19')](_0x19c4('0x1a'),_0x9f0eb9+'-'+_0x2ac884+'/'+_0x167f88)[_0x19c4('0x15')](_0x2677f9);}return null;};}function patchUpdates(_0x3df7b3){return function(_0x5df5a1){try{jsonpatch[_0x19c4('0x1b')](_0x5df5a1,_0x3df7b3,!![]);}catch(_0x42849e){return BPromise[_0x19c4('0x1c')](_0x42849e);}return _0x5df5a1[_0x19c4('0x1d')]();};}function saveUpdates(_0x494c9f,_0x1e9d30){return function(_0x5f3f04){if(_0x5f3f04){return _0x5f3f04['update'](_0x494c9f)[_0x19c4('0x1e')](function(_0xd2b7c6){return _0xd2b7c6;});}return null;};}function removeEntity(_0x586ce8,_0x3826f1){return function(_0x401d7c){if(_0x401d7c){return _0x401d7c[_0x19c4('0x1f')]()[_0x19c4('0x1e')](function(){_0x586ce8[_0x19c4('0x14')](0xcc)[_0x19c4('0x13')]();});}};}function handleEntityNotFound(_0x53a9b2,_0x363c0e){return function(_0x256621){if(!_0x256621){_0x53a9b2[_0x19c4('0x20')](0x194);}return _0x256621;};}function handleError(_0x27dd0b,_0x1b1045){_0x1b1045=_0x1b1045||0x1f4;return function(_0x2d68c4){logger[_0x19c4('0x21')](_0x2d68c4[_0x19c4('0x22')]);if(_0x2d68c4[_0x19c4('0x23')]){delete _0x2d68c4[_0x19c4('0x23')];}_0x27dd0b[_0x19c4('0x14')](_0x1b1045)['send'](_0x2d68c4);};}exports['index']=function(_0x4ac965,_0x12366f){var _0x1e94b8={},_0x3897ab={},_0x3af732={'count':0x0,'rows':[]};var _0x44a780=db[_0x19c4('0x24')][_0x19c4('0x25')];_0x3897ab['model']=_['keys'](_0x44a780);_0x3897ab[_0x19c4('0x26')]=_['keys'](_0x4ac965[_0x19c4('0x26')]);_0x3897ab[_0x19c4('0x27')]=_['intersection'](_0x3897ab['model'],_0x3897ab['query']);_0x1e94b8[_0x19c4('0x28')]=_[_0x19c4('0x29')](_0x3897ab['model'],qs[_0x19c4('0x2a')](_0x4ac965[_0x19c4('0x26')][_0x19c4('0x2a')]));_0x1e94b8['attributes']=_0x1e94b8[_0x19c4('0x28')][_0x19c4('0x2b')]?_0x1e94b8[_0x19c4('0x28')]:_0x3897ab['model'];if(!_0x4ac965[_0x19c4('0x26')][_0x19c4('0x2c')](_0x19c4('0x2d'))){_0x1e94b8['limit']=qs[_0x19c4('0x18')](_0x4ac965[_0x19c4('0x26')]['limit']);_0x1e94b8[_0x19c4('0x17')]=qs[_0x19c4('0x17')](_0x4ac965[_0x19c4('0x26')][_0x19c4('0x17')]);}_0x1e94b8[_0x19c4('0x2e')]=qs[_0x19c4('0x2f')](_0x4ac965[_0x19c4('0x26')][_0x19c4('0x2f')]);_0x1e94b8['where']=qs[_0x19c4('0x27')](_[_0x19c4('0x30')](_0x4ac965['query'],_0x3897ab[_0x19c4('0x27')]));if(_0x4ac965[_0x19c4('0x26')][_0x19c4('0x31')]){_0x1e94b8[_0x19c4('0x32')]=_[_0x19c4('0x33')](_0x1e94b8[_0x19c4('0x32')],{'$or':_[_0x19c4('0x34')](_0x44a780,function(_0x1f9559){if(_0x1f9559['type'][_0x19c4('0x35')]!=='VIRTUAL'){var _0x34e581={};_0x34e581[_0x1f9559[_0x19c4('0x36')]]={'$like':'%'+_0x4ac965[_0x19c4('0x26')][_0x19c4('0x31')]+'%'};return _0x34e581;}})});}_0x1e94b8=_['merge']({},_0x1e94b8,_0x4ac965[_0x19c4('0x37')]);var _0x445f6c={'where':_0x1e94b8[_0x19c4('0x32')]};return db['VoiceAgentReport'][_0x19c4('0x16')](_0x445f6c)[_0x19c4('0x1e')](function(_0x42a18d){_0x3af732['count']=_0x42a18d;if(_0x4ac965['query'][_0x19c4('0x38')]){_0x1e94b8['include']=[{'all':!![]}];}return db[_0x19c4('0x24')]['findAll'](_0x1e94b8);})[_0x19c4('0x1e')](function(_0x49dd30){_0x3af732[_0x19c4('0x39')]=_0x49dd30;return _0x3af732;})[_0x19c4('0x1e')](respondWithFilteredResult(_0x12366f,_0x1e94b8))['catch'](handleError(_0x12366f,null));};exports[_0x19c4('0x3a')]=function(_0x5625b3,_0x450c45){var _0x274ee4={'raw':![],'where':{'id':_0x5625b3['params']['id']}},_0x36eab8={};_0x36eab8[_0x19c4('0x3b')]=_[_0x19c4('0x3c')](db[_0x19c4('0x24')][_0x19c4('0x25')]);_0x36eab8[_0x19c4('0x26')]=_[_0x19c4('0x3c')](_0x5625b3[_0x19c4('0x26')]);_0x36eab8[_0x19c4('0x27')]=_[_0x19c4('0x29')](_0x36eab8[_0x19c4('0x3b')],_0x36eab8['query']);_0x274ee4['attributes']=_['intersection'](_0x36eab8[_0x19c4('0x3b')],qs[_0x19c4('0x2a')](_0x5625b3['query'][_0x19c4('0x2a')]));_0x274ee4[_0x19c4('0x28')]=_0x274ee4[_0x19c4('0x28')][_0x19c4('0x2b')]?_0x274ee4[_0x19c4('0x28')]:_0x36eab8['model'];if(_0x5625b3[_0x19c4('0x26')][_0x19c4('0x38')]){_0x274ee4[_0x19c4('0x3d')]=[{'all':!![]}];}_0x274ee4=_[_0x19c4('0x33')]({},_0x274ee4,_0x5625b3[_0x19c4('0x37')]);return db[_0x19c4('0x24')]['find'](_0x274ee4)[_0x19c4('0x1e')](handleEntityNotFound(_0x450c45,null))[_0x19c4('0x1e')](respondWithResult(_0x450c45,null))[_0x19c4('0x3e')](handleError(_0x450c45,null));};exports[_0x19c4('0x3f')]=function(_0x1c71c6,_0x2f7143){return db[_0x19c4('0x24')]['create'](_0x1c71c6[_0x19c4('0x40')],{})[_0x19c4('0x1e')](respondWithResult(_0x2f7143,0xc9))['catch'](handleError(_0x2f7143,null));};exports[_0x19c4('0x41')]=function(_0x2fd524,_0x1348d6){if(_0x2fd524[_0x19c4('0x40')]['id']){delete _0x2fd524[_0x19c4('0x40')]['id'];}return db[_0x19c4('0x24')]['find']({'where':{'id':_0x2fd524[_0x19c4('0x42')]['id']}})['then'](handleEntityNotFound(_0x1348d6,null))['then'](saveUpdates(_0x2fd524['body'],null))[_0x19c4('0x1e')](respondWithResult(_0x1348d6,null))[_0x19c4('0x3e')](handleError(_0x1348d6,null));};exports[_0x19c4('0x1f')]=function(_0x3d97ab,_0x968e53){return db[_0x19c4('0x24')][_0x19c4('0x43')]({'where':{'id':_0x3d97ab[_0x19c4('0x42')]['id']}})[_0x19c4('0x1e')](handleEntityNotFound(_0x968e53,null))[_0x19c4('0x1e')](removeEntity(_0x968e53,null))[_0x19c4('0x3e')](handleError(_0x968e53,null));};exports[_0x19c4('0x44')]=function(_0x44c32d,_0x1a1a5d){return db[_0x19c4('0x24')][_0x19c4('0x44')]()['then'](respondWithResult(_0x1a1a5d,null))['catch'](handleError(_0x1a1a5d,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 93ffb14..c520fdf 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 _0x4032=['report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','request-promise','./voiceAgentReport.attributes','exports','define','VoiceAgentReport'];(function(_0x4358c0,_0x43b53c){var _0x19c958=function(_0x4820c1){while(--_0x4820c1){_0x4358c0['push'](_0x4358c0['shift']());}};_0x19c958(++_0x43b53c);}(_0x4032,0x6b));var _0x2403=function(_0x52c3a4,_0x2c58db){_0x52c3a4=_0x52c3a4-0x0;var _0x48e943=_0x4032[_0x52c3a4];return _0x48e943;};'use strict';var _=require(_0x2403('0x0'));var util=require(_0x2403('0x1'));var logger=require(_0x2403('0x2'))(_0x2403('0x3'));var moment=require(_0x2403('0x4'));var BPromise=require('bluebird');var rp=require(_0x2403('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2403('0x6'));module[_0x2403('0x7')]=function(_0x4bdb08,_0x17584f){return _0x4bdb08[_0x2403('0x8')](_0x2403('0x9'),attributes,{'tableName':_0x2403('0xa'),'paranoid':![],'indexes':[{'fields':[_0x2403('0xb'),_0x2403('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x697f=['lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','exports','define','VoiceAgentReport','report_agent','destuniqueid'];(function(_0xd9e88a,_0x106841){var _0x3e5ad8=function(_0x8944c9){while(--_0x8944c9){_0xd9e88a['push'](_0xd9e88a['shift']());}};_0x3e5ad8(++_0x106841);}(_0x697f,0x1a2));var _0xf697=function(_0x2fe9d5,_0x1904fb){_0x2fe9d5=_0x2fe9d5-0x0;var _0x12d71d=_0x697f[_0x2fe9d5];return _0x12d71d;};'use strict';var _=require(_0xf697('0x0'));var util=require('util');var logger=require(_0xf697('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf697('0x2'));var rp=require(_0xf697('0x3'));var fs=require('fs');var path=require(_0xf697('0x4'));var rimraf=require('rimraf');var config=require(_0xf697('0x5'));var attributes=require('./voiceAgentReport.attributes');module[_0xf697('0x6')]=function(_0x50ef98,_0x1c3774){return _0x50ef98[_0xf697('0x7')](_0xf697('0x8'),attributes,{'tableName':_0xf697('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xf697('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 1045831..f1f0adc 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 _0xd62a=['stringify','error','code','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s'];(function(_0x3adde2,_0x3062c3){var _0xd3726d=function(_0x42bbe6){while(--_0x42bbe6){_0x3adde2['push'](_0x3adde2['shift']());}};_0xd3726d(++_0x3062c3);}(_0xd62a,0x1d8));var _0xad62=function(_0x4a8536,_0x4f5c6d){_0x4a8536=_0x4a8536-0x0;var _0x216342=_0xd62a[_0x4a8536];return _0x216342;};'use strict';var _=require(_0xad62('0x0'));var util=require('util');var moment=require(_0xad62('0x1'));var BPromise=require(_0xad62('0x2'));var rs=require(_0xad62('0x3'));var fs=require('fs');var Redis=require(_0xad62('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xad62('0x5'));var logger=require(_0xad62('0x6'))(_0xad62('0x7'));var config=require(_0xad62('0x8'));var jayson=require(_0xad62('0x9'));var client=jayson[_0xad62('0xa')][_0xad62('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ee60d,_0x21cb17,_0x258ea6){return new BPromise(function(_0x1919e8,_0x382d90){return client[_0xad62('0xc')](_0x2ee60d,_0x258ea6)[_0xad62('0xd')](function(_0x569191){logger['info'](_0xad62('0xe'),_0x21cb17,_0xad62('0xf'));logger[_0xad62('0x10')](_0xad62('0x11'),_0x21cb17,_0xad62('0xf'),JSON[_0xad62('0x12')](_0x569191));if(_0x569191[_0xad62('0x13')]){if(_0x569191[_0xad62('0x13')][_0xad62('0x14')]===0x1f4){logger[_0xad62('0x13')](_0xad62('0xe'),_0x21cb17,_0x569191['error']['message']);return _0x382d90(_0x569191['error'][_0xad62('0x15')]);}logger[_0xad62('0x13')](_0xad62('0xe'),_0x21cb17,_0x569191[_0xad62('0x13')][_0xad62('0x15')]);return _0x1919e8(_0x569191[_0xad62('0x13')][_0xad62('0x15')]);}else{logger[_0xad62('0x16')](_0xad62('0xe'),_0x21cb17,_0xad62('0xf'));_0x1919e8(_0x569191[_0xad62('0x17')]['message']);}})[_0xad62('0x18')](function(_0x3de35b){logger[_0xad62('0x13')](_0xad62('0xe'),_0x21cb17,_0x3de35b);_0x382d90(_0x3de35b);});});}exports[_0xad62('0x19')]=function(_0xe624ad){var _0x4cb917=this;return new Promise(function(_0x239118,_0x3eca66){return db[_0xad62('0x1a')][_0xad62('0x1b')](_0xe624ad[_0xad62('0x1c')],{'raw':_0xe624ad['options']?_0xe624ad[_0xad62('0x1d')][_0xad62('0x1e')]===undefined?!![]:![]:!![]})[_0xad62('0xd')](function(_0x41633e){logger['info'](_0xad62('0x19'),_0xe624ad);logger[_0xad62('0x10')](_0xad62('0x19'),_0xe624ad,JSON['stringify'](_0x41633e));_0x239118(_0x41633e);})['catch'](function(_0x2bc6d2){logger[_0xad62('0x13')]('CreateVoiceAgentReport',_0x2bc6d2['message'],_0xe624ad);_0x3eca66(_0x4cb917[_0xad62('0x13')](0x1f4,_0x2bc6d2['message']));});});};exports[_0xad62('0x1f')]=function(_0x27cd99){var _0x2da829=this;return new Promise(function(_0x4e4257,_0x2cebd6){return db[_0xad62('0x1a')][_0xad62('0x20')](_0x27cd99[_0xad62('0x1c')],{'raw':_0x27cd99['options']?_0x27cd99[_0xad62('0x1d')][_0xad62('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27cd99[_0xad62('0x1d')]?_0x27cd99[_0xad62('0x1d')][_0xad62('0x21')]||null:null,'attributes':_0x27cd99['options']?_0x27cd99['options']['attributes']||null:null,'limit':_0x27cd99[_0xad62('0x1d')]?_0x27cd99[_0xad62('0x1d')][_0xad62('0x22')]||null:null})[_0xad62('0xd')](function(_0x236470){logger[_0xad62('0x16')](_0xad62('0x1f'),_0x27cd99);logger[_0xad62('0x10')](_0xad62('0x1f'),_0x27cd99,JSON[_0xad62('0x12')](_0x236470));_0x4e4257(_0x236470);})[_0xad62('0x18')](function(_0xf0cfea){logger[_0xad62('0x13')](_0xad62('0x1f'),_0xf0cfea[_0xad62('0x15')],_0x27cd99);_0x2cebd6(_0x2da829[_0xad62('0x13')](0x1f4,_0xf0cfea[_0xad62('0x15')]));});});}; \ No newline at end of file +var _0x8d59=['options','raw','stringify','catch','UpdateVoiceAgentReport','VoiceAgentReport','update','where','attributes','debug','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','CreateVoiceAgentReport','create','body'];(function(_0x3c5070,_0x4d8d43){var _0x590e29=function(_0xd69b48){while(--_0xd69b48){_0x3c5070['push'](_0x3c5070['shift']());}};_0x590e29(++_0x4d8d43);}(_0x8d59,0xa5));var _0x98d5=function(_0x159cd1,_0x5a2dfe){_0x159cd1=_0x159cd1-0x0;var _0x414a84=_0x8d59[_0x159cd1];return _0x414a84;};'use strict';var _=require('lodash');var util=require(_0x98d5('0x0'));var moment=require(_0x98d5('0x1'));var BPromise=require(_0x98d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98d5('0x3'));var db=require(_0x98d5('0x4'))['db'];var utils=require(_0x98d5('0x5'));var logger=require('../../config/logger')(_0x98d5('0x6'));var config=require(_0x98d5('0x7'));var jayson=require(_0x98d5('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x72678c,_0x3bae2f,_0x1206ad){return new BPromise(function(_0x4889ee,_0x9317b2){return client[_0x98d5('0x9')](_0x72678c,_0x1206ad)[_0x98d5('0xa')](function(_0x3e540c){logger[_0x98d5('0xb')](_0x98d5('0xc'),_0x3bae2f,'request\x20sent');logger['debug'](_0x98d5('0xd'),_0x3bae2f,_0x98d5('0xe'),JSON['stringify'](_0x3e540c));if(_0x3e540c[_0x98d5('0xf')]){if(_0x3e540c[_0x98d5('0xf')][_0x98d5('0x10')]===0x1f4){logger[_0x98d5('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x3bae2f,_0x3e540c['error'][_0x98d5('0x11')]);return _0x9317b2(_0x3e540c['error'][_0x98d5('0x11')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x3bae2f,_0x3e540c[_0x98d5('0xf')]['message']);return _0x4889ee(_0x3e540c['error'][_0x98d5('0x11')]);}else{logger[_0x98d5('0xb')](_0x98d5('0xc'),_0x3bae2f,_0x98d5('0xe'));_0x4889ee(_0x3e540c['result']['message']);}})['catch'](function(_0x331e54){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x3bae2f,_0x331e54);_0x9317b2(_0x331e54);});});}exports[_0x98d5('0x12')]=function(_0x3bb2e1){var _0x43426f=this;return new Promise(function(_0x42074d,_0x14ed3a){return db['VoiceAgentReport'][_0x98d5('0x13')](_0x3bb2e1[_0x98d5('0x14')],{'raw':_0x3bb2e1['options']?_0x3bb2e1[_0x98d5('0x15')][_0x98d5('0x16')]===undefined?!![]:![]:!![]})[_0x98d5('0xa')](function(_0x54df61){logger[_0x98d5('0xb')](_0x98d5('0x12'),_0x3bb2e1);logger['debug'](_0x98d5('0x12'),_0x3bb2e1,JSON[_0x98d5('0x17')](_0x54df61));_0x42074d(_0x54df61);})[_0x98d5('0x18')](function(_0x294300){logger[_0x98d5('0xf')]('CreateVoiceAgentReport',_0x294300['message'],_0x3bb2e1);_0x14ed3a(_0x43426f[_0x98d5('0xf')](0x1f4,_0x294300[_0x98d5('0x11')]));});});};exports[_0x98d5('0x19')]=function(_0x19912e){var _0xd829d3=this;return new Promise(function(_0x1bd0ef,_0x2bb517){return db[_0x98d5('0x1a')][_0x98d5('0x1b')](_0x19912e[_0x98d5('0x14')],{'raw':_0x19912e[_0x98d5('0x15')]?_0x19912e[_0x98d5('0x15')][_0x98d5('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19912e['options']?_0x19912e[_0x98d5('0x15')][_0x98d5('0x1c')]||null:null,'attributes':_0x19912e['options']?_0x19912e[_0x98d5('0x15')][_0x98d5('0x1d')]||null:null,'limit':_0x19912e[_0x98d5('0x15')]?_0x19912e['options']['limit']||null:null})['then'](function(_0x3a3d81){logger[_0x98d5('0xb')]('UpdateVoiceAgentReport',_0x19912e);logger[_0x98d5('0x1e')](_0x98d5('0x19'),_0x19912e,JSON[_0x98d5('0x17')](_0x3a3d81));_0x1bd0ef(_0x3a3d81);})['catch'](function(_0x361cb1){logger[_0x98d5('0xf')](_0x98d5('0x19'),_0x361cb1[_0x98d5('0x11')],_0x19912e);_0x2bb517(_0xd829d3[_0x98d5('0xf')](0x1f4,_0x361cb1[_0x98d5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 2b61849..b05869c 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 _0x08be=['../../components/auth/service','./voiceCallReport.controller','isAuthenticated','get','/describe','describe','/:id','show','put','delete','destroy','multer','util','connect-timeout','Router'];(function(_0x590d44,_0x41c01f){var _0x2a17e5=function(_0x4b0cdd){while(--_0x4b0cdd){_0x590d44['push'](_0x590d44['shift']());}};_0x2a17e5(++_0x41c01f);}(_0x08be,0x1cd));var _0xe08b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x08be[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xe08b('0x0'));var util=require(_0xe08b('0x1'));var path=require('path');var timeout=require(_0xe08b('0x2'));var express=require('express');var router=express[_0xe08b('0x3')]();var auth=require(_0xe08b('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe08b('0x5'));router['get']('/',auth[_0xe08b('0x6')](),controller['index']);router[_0xe08b('0x7')](_0xe08b('0x8'),auth[_0xe08b('0x6')](),controller[_0xe08b('0x9')]);router['get'](_0xe08b('0xa'),auth[_0xe08b('0x6')](),controller[_0xe08b('0xb')]);router['post']('/',auth[_0xe08b('0x6')](),controller['create']);router[_0xe08b('0xc')](_0xe08b('0xa'),auth[_0xe08b('0x6')](),controller['update']);router[_0xe08b('0xd')](_0xe08b('0xa'),auth[_0xe08b('0x6')](),controller[_0xe08b('0xe')]);module['exports']=router; \ No newline at end of file +var _0xcdd8=['path','express','Router','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','multer','util'];(function(_0x401fdf,_0x1a3185){var _0x2198a6=function(_0x3fe20b){while(--_0x3fe20b){_0x401fdf['push'](_0x401fdf['shift']());}};_0x2198a6(++_0x1a3185);}(_0xcdd8,0x167));var _0x8cdd=function(_0x1cb6a0,_0x39ee62){_0x1cb6a0=_0x1cb6a0-0x0;var _0x13af33=_0xcdd8[_0x1cb6a0];return _0x13af33;};'use strict';var multer=require(_0x8cdd('0x0'));var util=require(_0x8cdd('0x1'));var path=require(_0x8cdd('0x2'));var timeout=require('connect-timeout');var express=require(_0x8cdd('0x3'));var router=express[_0x8cdd('0x4')]();var auth=require(_0x8cdd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8cdd('0x6'));var controller=require(_0x8cdd('0x7'));router[_0x8cdd('0x8')]('/',auth[_0x8cdd('0x9')](),controller[_0x8cdd('0xa')]);router[_0x8cdd('0x8')](_0x8cdd('0xb'),auth[_0x8cdd('0x9')](),controller[_0x8cdd('0xc')]);router[_0x8cdd('0x8')](_0x8cdd('0xd'),auth[_0x8cdd('0x9')](),controller[_0x8cdd('0xe')]);router[_0x8cdd('0xf')]('/',auth[_0x8cdd('0x9')](),controller[_0x8cdd('0x10')]);router['put']('/:id',auth[_0x8cdd('0x9')](),controller[_0x8cdd('0x11')]);router['delete'](_0x8cdd('0xd'),auth[_0x8cdd('0x9')](),controller[_0x8cdd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index e8c8868..ee40285 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(_0x1dcf77,_0x2aa255){var _0x557096=function(_0x2fc5d1){while(--_0x2fc5d1){_0x1dcf77['push'](_0x1dcf77['shift']());}};_0x557096(++_0x2aa255);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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(_0x930ee6,_0x30c4c7){var _0x5d77ff=function(_0x5cd34a){while(--_0x5cd34a){_0x930ee6['push'](_0x930ee6['shift']());}};_0x5d77ff(++_0x30c4c7);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 d995833..f674e64 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 _0x96cc=['count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','VoiceCallReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','fullname','alias','User','findAll','rows','catch','params','includeAll','find','create','body','describe','uniqueid','user','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','status','end','json'];(function(_0x3163d6,_0x18a1ab){var _0x143ea5=function(_0x4ad4cc){while(--_0x4ad4cc){_0x3163d6['push'](_0x3163d6['shift']());}};_0x143ea5(++_0x18a1ab);}(_0x96cc,0x16c));var _0xc96c=function(_0x466701,_0x39a5d4){_0x466701=_0x466701-0x0;var _0x1e0e89=_0x96cc[_0x466701];return _0x1e0e89;};'use strict';var pdf=require(_0xc96c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc96c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc96c('0x2'));var rp=require(_0xc96c('0x3'));var moment=require(_0xc96c('0x4'));var BPromise=require(_0xc96c('0x5'));var Mustache=require(_0xc96c('0x6'));var util=require(_0xc96c('0x7'));var path=require(_0xc96c('0x8'));var sox=require(_0xc96c('0x9'));var csv=require(_0xc96c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc96c('0xb'));var squel=require(_0xc96c('0xc'));var crypto=require(_0xc96c('0xd'));var jsforce=require(_0xc96c('0xe'));var deskjs=require(_0xc96c('0xf'));var toCsv=require(_0xc96c('0xa'));var querystring=require(_0xc96c('0x10'));var Papa=require('papaparse');var Redis=require(_0xc96c('0x11'));var authService=require(_0xc96c('0x12'));var qs=require(_0xc96c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc96c('0x14'))('api');var utils=require(_0xc96c('0x15'));var config=require('../../config/environment');var db=require(_0xc96c('0x16'))['db'];function respondWithStatusCode(_0x32f682,_0x3ef47a){_0x3ef47a=_0x3ef47a||0xcc;return function(_0x246a95){if(_0x246a95){return _0x32f682['sendStatus'](_0x3ef47a);}return _0x32f682[_0xc96c('0x17')](_0x3ef47a)[_0xc96c('0x18')]();};}function respondWithResult(_0x1e7742,_0x3f65fd){_0x3f65fd=_0x3f65fd||0xc8;return function(_0x48de8d){if(_0x48de8d){return _0x1e7742[_0xc96c('0x17')](_0x3f65fd)[_0xc96c('0x19')](_0x48de8d);}};}function respondWithFilteredResult(_0x399267,_0x32e640){return function(_0x377dbc){if(_0x377dbc){var _0x46455a=_0x377dbc[_0xc96c('0x1a')],_0x1765d9=_0x32e640[_0xc96c('0x1b')],_0x23e357=_0x32e640['offset']+_0x32e640['limit'],_0x174852;if(_0x23e357>=_0x46455a){_0x23e357=_0x46455a;_0x174852=0xc8;}else{_0x174852=0xce;}_0x399267[_0xc96c('0x17')](_0x174852);return _0x399267[_0xc96c('0x1c')](_0xc96c('0x1d'),_0x1765d9+'-'+_0x23e357+'/'+_0x46455a)[_0xc96c('0x19')](_0x377dbc);}return null;};}function patchUpdates(_0x4aa6a3){return function(_0x2c4c83){try{jsonpatch[_0xc96c('0x1e')](_0x2c4c83,_0x4aa6a3,!![]);}catch(_0x2a361c){return BPromise[_0xc96c('0x1f')](_0x2a361c);}return _0x2c4c83[_0xc96c('0x20')]();};}function saveUpdates(_0x335910,_0x43cc22){return function(_0x41daba){if(_0x41daba){return _0x41daba[_0xc96c('0x21')](_0x335910)[_0xc96c('0x22')](function(_0x2bb397){return _0x2bb397;});}return null;};}function removeEntity(_0x1203a1,_0x3f9603){return function(_0x45edee){if(_0x45edee){return _0x45edee[_0xc96c('0x23')]()[_0xc96c('0x22')](function(){_0x1203a1[_0xc96c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd63951,_0x4be783){return function(_0x4456bf){if(!_0x4456bf){_0xd63951[_0xc96c('0x24')](0x194);}return _0x4456bf;};}function handleError(_0x2b1df9,_0x35f480){_0x35f480=_0x35f480||0x1f4;return function(_0x40f23d){logger[_0xc96c('0x25')](_0x40f23d[_0xc96c('0x26')]);if(_0x40f23d[_0xc96c('0x27')]){delete _0x40f23d['name'];}_0x2b1df9[_0xc96c('0x17')](_0x35f480)[_0xc96c('0x28')](_0x40f23d);};}exports[_0xc96c('0x29')]=function(_0x294fee,_0x58fab3){var _0x5c00b6={},_0x39c191={},_0x12c293={'count':0x0,'rows':[]};var _0x3ef02c=db[_0xc96c('0x2a')][_0xc96c('0x2b')];_0x39c191[_0xc96c('0x2c')]=_[_0xc96c('0x2d')](_0x3ef02c);_0x39c191[_0xc96c('0x2e')]=_[_0xc96c('0x2d')](_0x294fee[_0xc96c('0x2e')]);_0x39c191[_0xc96c('0x2f')]=_[_0xc96c('0x30')](_0x39c191[_0xc96c('0x2c')],_0x39c191[_0xc96c('0x2e')]);_0x5c00b6['attributes']=_[_0xc96c('0x30')](_0x39c191['model'],qs[_0xc96c('0x31')](_0x294fee[_0xc96c('0x2e')][_0xc96c('0x31')]));_0x5c00b6['attributes']=_0x5c00b6[_0xc96c('0x32')][_0xc96c('0x33')]?_0x5c00b6[_0xc96c('0x32')]:_0x39c191[_0xc96c('0x2c')];if(!_0x294fee['query']['hasOwnProperty'](_0xc96c('0x34'))){_0x5c00b6[_0xc96c('0x35')]=qs[_0xc96c('0x35')](_0x294fee['query'][_0xc96c('0x35')]);_0x5c00b6[_0xc96c('0x1b')]=qs[_0xc96c('0x1b')](_0x294fee[_0xc96c('0x2e')]['offset']);}_0x5c00b6[_0xc96c('0x36')]=qs[_0xc96c('0x37')](_0x294fee['query'][_0xc96c('0x37')]);_0x5c00b6[_0xc96c('0x38')]=qs[_0xc96c('0x2f')](_[_0xc96c('0x39')](_0x294fee[_0xc96c('0x2e')],_0x39c191[_0xc96c('0x2f')]));if(_0x294fee['query'][_0xc96c('0x3a')]){_0x5c00b6[_0xc96c('0x38')]=_[_0xc96c('0x3b')](_0x5c00b6[_0xc96c('0x38')],{'$or':_[_0xc96c('0x3c')](_0x3ef02c,function(_0x332f55){if(_0x332f55['type']['key']!==_0xc96c('0x3d')){var _0x156d0f={};_0x156d0f[_0x332f55['field']]={'$like':'%'+_0x294fee['query'][_0xc96c('0x3a')]+'%'};return _0x156d0f;}})});}_0x5c00b6=_[_0xc96c('0x3b')]({},_0x5c00b6,_0x294fee[_0xc96c('0x3e')]);var _0x1d6054={'where':_0x5c00b6[_0xc96c('0x38')]};return db[_0xc96c('0x2a')][_0xc96c('0x1a')](_0x1d6054)[_0xc96c('0x22')](function(_0x3fc40d){_0x12c293[_0xc96c('0x1a')]=_0x3fc40d;if(_0x294fee[_0xc96c('0x2e')]['includeAll']){_0x5c00b6[_0xc96c('0x3f')]=[{'attributes':['id',_0xc96c('0x27'),_0xc96c('0x40'),_0xc96c('0x41')],'model':db['User'],'as':_0xc96c('0x42')}];}return db[_0xc96c('0x2a')][_0xc96c('0x43')](_0x5c00b6);})['then'](function(_0x510252){_0x12c293[_0xc96c('0x44')]=_0x510252;return _0x12c293;})[_0xc96c('0x22')](respondWithFilteredResult(_0x58fab3,_0x5c00b6))[_0xc96c('0x45')](handleError(_0x58fab3,null));};exports['show']=function(_0x315914,_0x17bd24){var _0x2f301a={'raw':!![],'where':{'id':_0x315914[_0xc96c('0x46')]['id']}},_0x2a8ea7={};_0x2a8ea7[_0xc96c('0x2c')]=_[_0xc96c('0x2d')](db[_0xc96c('0x2a')][_0xc96c('0x2b')]);_0x2a8ea7['query']=_['keys'](_0x315914[_0xc96c('0x2e')]);_0x2a8ea7[_0xc96c('0x2f')]=_[_0xc96c('0x30')](_0x2a8ea7[_0xc96c('0x2c')],_0x2a8ea7['query']);_0x2f301a['attributes']=_[_0xc96c('0x30')](_0x2a8ea7[_0xc96c('0x2c')],qs[_0xc96c('0x31')](_0x315914[_0xc96c('0x2e')][_0xc96c('0x31')]));_0x2f301a[_0xc96c('0x32')]=_0x2f301a[_0xc96c('0x32')]['length']?_0x2f301a[_0xc96c('0x32')]:_0x2a8ea7[_0xc96c('0x2c')];if(_0x315914[_0xc96c('0x2e')][_0xc96c('0x47')]){_0x2f301a['include']=[{'all':!![]}];}_0x2f301a=_['merge']({},_0x2f301a,_0x315914[_0xc96c('0x3e')]);return db[_0xc96c('0x2a')][_0xc96c('0x48')](_0x2f301a)[_0xc96c('0x22')](handleEntityNotFound(_0x17bd24,null))[_0xc96c('0x22')](respondWithResult(_0x17bd24,null))[_0xc96c('0x45')](handleError(_0x17bd24,null));};exports[_0xc96c('0x49')]=function(_0x2bc530,_0xc9f94d){return db[_0xc96c('0x2a')][_0xc96c('0x49')](_0x2bc530[_0xc96c('0x4a')],{})[_0xc96c('0x22')](respondWithResult(_0xc9f94d,0xc9))['catch'](handleError(_0xc9f94d,null));};exports[_0xc96c('0x23')]=function(_0x2e5045,_0x307d58){return db[_0xc96c('0x2a')]['find']({'where':{'id':_0x2e5045[_0xc96c('0x46')]['id']}})['then'](handleEntityNotFound(_0x307d58,null))[_0xc96c('0x22')](removeEntity(_0x307d58,null))[_0xc96c('0x45')](handleError(_0x307d58,null));};exports['describe']=function(_0x2581ae,_0x400fe6){return db[_0xc96c('0x2a')][_0xc96c('0x4b')]()[_0xc96c('0x22')](respondWithResult(_0x400fe6,null))[_0xc96c('0x45')](handleError(_0x400fe6,null));};exports['update']=function(_0x5a1989,_0x557511){if(_0x5a1989[_0xc96c('0x4a')]['uniqueid']){delete _0x5a1989[_0xc96c('0x4a')][_0xc96c('0x4c')];}return db[_0xc96c('0x2a')][_0xc96c('0x48')]({'where':{'uniqueid':_0x5a1989[_0xc96c('0x46')]['id'],'UserId':{'$or':[null,_0x5a1989[_0xc96c('0x4d')]['id']]}}})[_0xc96c('0x22')](handleEntityNotFound(_0x557511,null))[_0xc96c('0x22')](saveUpdates(_0x5a1989[_0xc96c('0x4a')],null))[_0xc96c('0x22')](respondWithResult(_0x557511,null))['catch'](handleError(_0x557511,null));}; \ No newline at end of file +var _0x4024=['find','create','body','describe','user','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','crypto','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','reject','update','then','sendStatus','error','name','send','VoiceCallReport','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','key','field','options','includeAll','fullname','alias','User','findAll','rows','catch','show','params','include'];(function(_0x9f8671,_0x434bbc){var _0x4208fa=function(_0x3c31ef){while(--_0x3c31ef){_0x9f8671['push'](_0x9f8671['shift']());}};_0x4208fa(++_0x434bbc);}(_0x4024,0x89));var _0x4402=function(_0x2c8c4b,_0x249735){_0x2c8c4b=_0x2c8c4b-0x0;var _0x25962b=_0x4024[_0x2c8c4b];return _0x25962b;};'use strict';var pdf=require(_0x4402('0x0'));var emlformat=require(_0x4402('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4402('0x2'));var jsonpatch=require(_0x4402('0x3'));var rp=require('request-promise');var moment=require(_0x4402('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4402('0x5'));var util=require(_0x4402('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4402('0x7'));var ejs=require(_0x4402('0x8'));var fs=require('fs');var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4402('0xd'))('api');var utils=require(_0x4402('0xe'));var config=require(_0x4402('0xf'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x949ab7,_0x302c4d){_0x302c4d=_0x302c4d||0xcc;return function(_0xa819e9){if(_0xa819e9){return _0x949ab7['sendStatus'](_0x302c4d);}return _0x949ab7[_0x4402('0x10')](_0x302c4d)[_0x4402('0x11')]();};}function respondWithResult(_0x42f1b0,_0x19d2f4){_0x19d2f4=_0x19d2f4||0xc8;return function(_0x248ad9){if(_0x248ad9){return _0x42f1b0[_0x4402('0x10')](_0x19d2f4)[_0x4402('0x12')](_0x248ad9);}};}function respondWithFilteredResult(_0x3c7dd2,_0x295ac5){return function(_0x263a57){if(_0x263a57){var _0x375166=_0x263a57[_0x4402('0x13')],_0xc03f65=_0x295ac5[_0x4402('0x14')],_0x2a2ce8=_0x295ac5[_0x4402('0x14')]+_0x295ac5[_0x4402('0x15')],_0x19fe7b;if(_0x2a2ce8>=_0x375166){_0x2a2ce8=_0x375166;_0x19fe7b=0xc8;}else{_0x19fe7b=0xce;}_0x3c7dd2[_0x4402('0x10')](_0x19fe7b);return _0x3c7dd2[_0x4402('0x16')]('Content-Range',_0xc03f65+'-'+_0x2a2ce8+'/'+_0x375166)['json'](_0x263a57);}return null;};}function patchUpdates(_0x663ab7){return function(_0x2a7afc){try{jsonpatch['apply'](_0x2a7afc,_0x663ab7,!![]);}catch(_0x756962){return BPromise[_0x4402('0x17')](_0x756962);}return _0x2a7afc['save']();};}function saveUpdates(_0x38b459,_0x4e0340){return function(_0x55cc8c){if(_0x55cc8c){return _0x55cc8c[_0x4402('0x18')](_0x38b459)[_0x4402('0x19')](function(_0x28f44b){return _0x28f44b;});}return null;};}function removeEntity(_0x49bc21,_0x42509b){return function(_0x57a25e){if(_0x57a25e){return _0x57a25e['destroy']()[_0x4402('0x19')](function(){_0x49bc21[_0x4402('0x10')](0xcc)[_0x4402('0x11')]();});}};}function handleEntityNotFound(_0xc583b,_0x258d10){return function(_0x2e6fee){if(!_0x2e6fee){_0xc583b[_0x4402('0x1a')](0x194);}return _0x2e6fee;};}function handleError(_0x6b1fc5,_0x24a9b8){_0x24a9b8=_0x24a9b8||0x1f4;return function(_0x4d6846){logger[_0x4402('0x1b')](_0x4d6846['stack']);if(_0x4d6846[_0x4402('0x1c')]){delete _0x4d6846[_0x4402('0x1c')];}_0x6b1fc5[_0x4402('0x10')](_0x24a9b8)[_0x4402('0x1d')](_0x4d6846);};}exports['index']=function(_0x15c19f,_0x4e9cb5){var _0x59d52f={},_0x1be54d={},_0x395e49={'count':0x0,'rows':[]};var _0x327d60=db[_0x4402('0x1e')][_0x4402('0x1f')];_0x1be54d['model']=_[_0x4402('0x20')](_0x327d60);_0x1be54d['query']=_[_0x4402('0x20')](_0x15c19f[_0x4402('0x21')]);_0x1be54d[_0x4402('0x22')]=_['intersection'](_0x1be54d[_0x4402('0x23')],_0x1be54d[_0x4402('0x21')]);_0x59d52f[_0x4402('0x24')]=_[_0x4402('0x25')](_0x1be54d[_0x4402('0x23')],qs[_0x4402('0x26')](_0x15c19f[_0x4402('0x21')][_0x4402('0x26')]));_0x59d52f[_0x4402('0x24')]=_0x59d52f[_0x4402('0x24')][_0x4402('0x27')]?_0x59d52f['attributes']:_0x1be54d[_0x4402('0x23')];if(!_0x15c19f['query'][_0x4402('0x28')]('nolimit')){_0x59d52f[_0x4402('0x15')]=qs[_0x4402('0x15')](_0x15c19f[_0x4402('0x21')][_0x4402('0x15')]);_0x59d52f[_0x4402('0x14')]=qs['offset'](_0x15c19f[_0x4402('0x21')][_0x4402('0x14')]);}_0x59d52f[_0x4402('0x29')]=qs['sort'](_0x15c19f[_0x4402('0x21')][_0x4402('0x2a')]);_0x59d52f['where']=qs[_0x4402('0x22')](_[_0x4402('0x2b')](_0x15c19f[_0x4402('0x21')],_0x1be54d[_0x4402('0x22')]));if(_0x15c19f[_0x4402('0x21')][_0x4402('0x2c')]){_0x59d52f[_0x4402('0x2d')]=_[_0x4402('0x2e')](_0x59d52f[_0x4402('0x2d')],{'$or':_['map'](_0x327d60,function(_0x2995b6){if(_0x2995b6[_0x4402('0x2f')][_0x4402('0x30')]!=='VIRTUAL'){var _0x34e4ae={};_0x34e4ae[_0x2995b6[_0x4402('0x31')]]={'$like':'%'+_0x15c19f['query']['filter']+'%'};return _0x34e4ae;}})});}_0x59d52f=_[_0x4402('0x2e')]({},_0x59d52f,_0x15c19f[_0x4402('0x32')]);var _0x433c1e={'where':_0x59d52f[_0x4402('0x2d')]};return db['VoiceCallReport']['count'](_0x433c1e)['then'](function(_0x3a5e62){_0x395e49[_0x4402('0x13')]=_0x3a5e62;if(_0x15c19f[_0x4402('0x21')][_0x4402('0x33')]){_0x59d52f['include']=[{'attributes':['id',_0x4402('0x1c'),_0x4402('0x34'),_0x4402('0x35')],'model':db['User'],'as':_0x4402('0x36')}];}return db['VoiceCallReport'][_0x4402('0x37')](_0x59d52f);})[_0x4402('0x19')](function(_0x5c74b1){_0x395e49[_0x4402('0x38')]=_0x5c74b1;return _0x395e49;})['then'](respondWithFilteredResult(_0x4e9cb5,_0x59d52f))[_0x4402('0x39')](handleError(_0x4e9cb5,null));};exports[_0x4402('0x3a')]=function(_0x5a4e88,_0xa1a812){var _0x2ca650={'raw':!![],'where':{'id':_0x5a4e88[_0x4402('0x3b')]['id']}},_0x250f09={};_0x250f09['model']=_['keys'](db[_0x4402('0x1e')]['rawAttributes']);_0x250f09[_0x4402('0x21')]=_[_0x4402('0x20')](_0x5a4e88[_0x4402('0x21')]);_0x250f09[_0x4402('0x22')]=_[_0x4402('0x25')](_0x250f09[_0x4402('0x23')],_0x250f09[_0x4402('0x21')]);_0x2ca650[_0x4402('0x24')]=_[_0x4402('0x25')](_0x250f09[_0x4402('0x23')],qs['fields'](_0x5a4e88[_0x4402('0x21')][_0x4402('0x26')]));_0x2ca650['attributes']=_0x2ca650[_0x4402('0x24')][_0x4402('0x27')]?_0x2ca650['attributes']:_0x250f09[_0x4402('0x23')];if(_0x5a4e88[_0x4402('0x21')][_0x4402('0x33')]){_0x2ca650[_0x4402('0x3c')]=[{'all':!![]}];}_0x2ca650=_[_0x4402('0x2e')]({},_0x2ca650,_0x5a4e88['options']);return db[_0x4402('0x1e')][_0x4402('0x3d')](_0x2ca650)[_0x4402('0x19')](handleEntityNotFound(_0xa1a812,null))[_0x4402('0x19')](respondWithResult(_0xa1a812,null))[_0x4402('0x39')](handleError(_0xa1a812,null));};exports[_0x4402('0x3e')]=function(_0x390682,_0x136c9c){return db[_0x4402('0x1e')][_0x4402('0x3e')](_0x390682[_0x4402('0x3f')],{})['then'](respondWithResult(_0x136c9c,0xc9))[_0x4402('0x39')](handleError(_0x136c9c,null));};exports['destroy']=function(_0xc45af6,_0x34ce00){return db['VoiceCallReport'][_0x4402('0x3d')]({'where':{'id':_0xc45af6[_0x4402('0x3b')]['id']}})[_0x4402('0x19')](handleEntityNotFound(_0x34ce00,null))[_0x4402('0x19')](removeEntity(_0x34ce00,null))[_0x4402('0x39')](handleError(_0x34ce00,null));};exports[_0x4402('0x40')]=function(_0x5b094b,_0xd0c9a5){return db[_0x4402('0x1e')][_0x4402('0x40')]()[_0x4402('0x19')](respondWithResult(_0xd0c9a5,null))[_0x4402('0x39')](handleError(_0xd0c9a5,null));};exports[_0x4402('0x18')]=function(_0x43cfbd,_0x2e3934){if(_0x43cfbd[_0x4402('0x3f')]['uniqueid']){delete _0x43cfbd['body']['uniqueid'];}return db['VoiceCallReport'][_0x4402('0x3d')]({'where':{'uniqueid':_0x43cfbd[_0x4402('0x3b')]['id'],'UserId':{'$or':[null,_0x43cfbd[_0x4402('0x41')]['id']]}}})[_0x4402('0x19')](handleEntityNotFound(_0x2e3934,null))['then'](saveUpdates(_0x43cfbd[_0x4402('0x3f')],null))[_0x4402('0x19')](respondWithResult(_0x2e3934,null))[_0x4402('0x39')](handleError(_0x2e3934,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index c408b94..2239dc8 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 _0xbe6f=['report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceCallReport.attributes','exports','define'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0xbe6f,0x128));var _0xfbe6=function(_0x3f59b1,_0x25cdbe){_0x3f59b1=_0x3f59b1-0x0;var _0x11d2e8=_0xbe6f[_0x3f59b1];return _0x11d2e8;};'use strict';var _=require(_0xfbe6('0x0'));var util=require(_0xfbe6('0x1'));var logger=require(_0xfbe6('0x2'))(_0xfbe6('0x3'));var moment=require(_0xfbe6('0x4'));var BPromise=require(_0xfbe6('0x5'));var rp=require(_0xfbe6('0x6'));var fs=require('fs');var path=require(_0xfbe6('0x7'));var rimraf=require(_0xfbe6('0x8'));var config=require('../../config/environment');var attributes=require(_0xfbe6('0x9'));module[_0xfbe6('0xa')]=function(_0x30408c,_0x21fa54){return _0x30408c[_0xfbe6('0xb')]('VoiceCallReport',attributes,{'tableName':_0xfbe6('0xc'),'paranoid':![],'indexes':[{'fields':[_0xfbe6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4cac=['lodash','moment','request-promise','path','rimraf','../../config/environment','exports','define','VoiceCallReport','report_call','uniqueid'];(function(_0xb74ced,_0x851b48){var _0x9cbeac=function(_0x5b36e9){while(--_0x5b36e9){_0xb74ced['push'](_0xb74ced['shift']());}};_0x9cbeac(++_0x851b48);}(_0x4cac,0x134));var _0xc4ca=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4cac[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc4ca('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc4ca('0x1'));var BPromise=require('bluebird');var rp=require(_0xc4ca('0x2'));var fs=require('fs');var path=require(_0xc4ca('0x3'));var rimraf=require(_0xc4ca('0x4'));var config=require(_0xc4ca('0x5'));var attributes=require('./voiceCallReport.attributes');module[_0xc4ca('0x6')]=function(_0x4440d0,_0x40ed3d){return _0x4440d0[_0xc4ca('0x7')](_0xc4ca('0x8'),attributes,{'tableName':_0xc4ca('0x9'),'paranoid':![],'indexes':[{'fields':[_0xc4ca('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index ee54b40..e717622 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 _0x0671=['ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','model','map','CreateVoiceCallReport','create','body','catch','UpdateVoiceCallReport','update','lodash','moment','bluebird','randomstring'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x0671,0xba));var _0x1067=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x0671[_0x47e549];return _0x251374;};'use strict';var _=require(_0x1067('0x0'));var util=require('util');var moment=require(_0x1067('0x1'));var BPromise=require(_0x1067('0x2'));var rs=require(_0x1067('0x3'));var fs=require('fs');var Redis=require(_0x1067('0x4'));var db=require(_0x1067('0x5'))['db'];var utils=require(_0x1067('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1067('0x7'));var client=jayson[_0x1067('0x8')][_0x1067('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f5565,_0x3d01ab,_0x1f0aab){return new BPromise(function(_0x441308,_0x4676c7){return client['request'](_0x2f5565,_0x1f0aab)[_0x1067('0xa')](function(_0xeb0c7c){logger[_0x1067('0xb')](_0x1067('0xc'),_0x3d01ab,_0x1067('0xd'));logger[_0x1067('0xe')](_0x1067('0xf'),_0x3d01ab,_0x1067('0xd'),JSON[_0x1067('0x10')](_0xeb0c7c));if(_0xeb0c7c['error']){if(_0xeb0c7c['error'][_0x1067('0x11')]===0x1f4){logger['error'](_0x1067('0xc'),_0x3d01ab,_0xeb0c7c[_0x1067('0x12')][_0x1067('0x13')]);return _0x4676c7(_0xeb0c7c[_0x1067('0x12')][_0x1067('0x13')]);}logger[_0x1067('0x12')](_0x1067('0xc'),_0x3d01ab,_0xeb0c7c['error']['message']);return _0x441308(_0xeb0c7c[_0x1067('0x12')][_0x1067('0x13')]);}else{logger[_0x1067('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x3d01ab,'request\x20sent');_0x441308(_0xeb0c7c[_0x1067('0x14')][_0x1067('0x13')]);}})['catch'](function(_0x50d757){logger[_0x1067('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x3d01ab,_0x50d757);_0x4676c7(_0x50d757);});});}exports[_0x1067('0x15')]=function(_0x8f3254){var _0x4bf4fb=this;return new Promise(function(_0x96bb62,_0x1f5c57){return db[_0x1067('0x16')][_0x1067('0x17')]({'raw':_0x8f3254[_0x1067('0x18')]?_0x8f3254[_0x1067('0x18')][_0x1067('0x19')]===undefined?!![]:![]:!![],'where':_0x8f3254['options']?_0x8f3254[_0x1067('0x18')][_0x1067('0x1a')]||null:null,'attributes':_0x8f3254[_0x1067('0x18')]?_0x8f3254[_0x1067('0x18')][_0x1067('0x1b')]||null:null,'limit':_0x8f3254[_0x1067('0x18')]?_0x8f3254[_0x1067('0x18')][_0x1067('0x1c')]||null:null,'include':_0x8f3254['options']?_0x8f3254['options']['include']?_['map'](_0x8f3254[_0x1067('0x18')]['include'],function(_0x662fd6){return{'model':db[_0x662fd6['model']],'as':_0x662fd6['as'],'attributes':_0x662fd6[_0x1067('0x1b')],'include':_0x662fd6[_0x1067('0x1d')]?_['map'](_0x662fd6[_0x1067('0x1d')],function(_0x3d0f4f){return{'model':db[_0x3d0f4f[_0x1067('0x1e')]],'as':_0x3d0f4f['as'],'attributes':_0x3d0f4f[_0x1067('0x1b')],'include':_0x3d0f4f['include']?_[_0x1067('0x1f')](_0x3d0f4f[_0x1067('0x1d')],function(_0x2baddc){return{'model':db[_0x2baddc['model']],'as':_0x2baddc['as'],'attributes':_0x2baddc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xe1cf2b){logger[_0x1067('0xb')]('GetVoiceCallReport',_0x8f3254);logger[_0x1067('0xe')](_0x1067('0x15'),_0x8f3254,JSON[_0x1067('0x10')](_0xe1cf2b));_0x96bb62(_0xe1cf2b);})['catch'](function(_0x1ea45d){logger['error'](_0x1067('0x15'),_0x1ea45d[_0x1067('0x13')],_0x8f3254);_0x1f5c57(_0x4bf4fb[_0x1067('0x12')](0x1f4,_0x1ea45d[_0x1067('0x13')]));});});};exports[_0x1067('0x20')]=function(_0x3acd78){var _0x10023e=this;return new Promise(function(_0x363683,_0x1dd297){return db[_0x1067('0x16')][_0x1067('0x21')](_0x3acd78[_0x1067('0x22')],{'raw':_0x3acd78['options']?_0x3acd78[_0x1067('0x18')][_0x1067('0x19')]===undefined?!![]:![]:!![]})[_0x1067('0xa')](function(_0x5c4d06){logger[_0x1067('0xb')](_0x1067('0x20'),_0x3acd78);logger[_0x1067('0xe')](_0x1067('0x20'),_0x3acd78,JSON['stringify'](_0x5c4d06));_0x363683(_0x5c4d06);})[_0x1067('0x23')](function(_0x903911){logger[_0x1067('0x12')](_0x1067('0x20'),_0x903911['message'],_0x3acd78);_0x1dd297(_0x10023e['error'](0x1f4,_0x903911[_0x1067('0x13')]));});});};exports[_0x1067('0x24')]=function(_0x5cb0af){var _0x450c0d=this;return new Promise(function(_0x5d7759,_0x349b70){return db[_0x1067('0x16')][_0x1067('0x25')](_0x5cb0af[_0x1067('0x22')],{'raw':_0x5cb0af[_0x1067('0x18')]?_0x5cb0af[_0x1067('0x18')][_0x1067('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cb0af[_0x1067('0x18')]?_0x5cb0af[_0x1067('0x18')][_0x1067('0x1a')]||null:null,'attributes':_0x5cb0af[_0x1067('0x18')]?_0x5cb0af[_0x1067('0x18')][_0x1067('0x1b')]||null:null,'limit':_0x5cb0af[_0x1067('0x18')]?_0x5cb0af['options'][_0x1067('0x1c')]||null:null})[_0x1067('0xa')](function(_0x316d52){logger['info']('UpdateVoiceCallReport',_0x5cb0af);logger['debug'](_0x1067('0x24'),_0x5cb0af,JSON[_0x1067('0x10')](_0x316d52));_0x5d7759(_0x316d52);})[_0x1067('0x23')](function(_0x3e2ddd){logger[_0x1067('0x12')](_0x1067('0x24'),_0x3e2ddd[_0x1067('0x13')],_0x5cb0af);_0x349b70(_0x450c0d[_0x1067('0x12')](0x1f4,_0x3e2ddd['message']));});});}; \ No newline at end of file +var _0xa27c=['../../config/utils','../../config/logger','rpc','client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','include','model','map','then','catch','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','limit','lodash','util','moment','../../mysqldb'];(function(_0x5623cb,_0x20b099){var _0x368ce6=function(_0x3439ad){while(--_0x3439ad){_0x5623cb['push'](_0x5623cb['shift']());}};_0x368ce6(++_0x20b099);}(_0xa27c,0x1dd));var _0xca27=function(_0x4a05ae,_0x1404cb){_0x4a05ae=_0x4a05ae-0x0;var _0x32300e=_0xa27c[_0x4a05ae];return _0x32300e;};'use strict';var _=require(_0xca27('0x0'));var util=require(_0xca27('0x1'));var moment=require(_0xca27('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca27('0x3'))['db'];var utils=require(_0xca27('0x4'));var logger=require(_0xca27('0x5'))(_0xca27('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xca27('0x7')][_0xca27('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x193200,_0x304465,_0x473936){return new BPromise(function(_0x36256b,_0xcb41b2){return client[_0xca27('0x9')](_0x193200,_0x473936)['then'](function(_0x17333b){logger[_0xca27('0xa')](_0xca27('0xb'),_0x304465,_0xca27('0xc'));logger[_0xca27('0xd')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x304465,'request\x20sent',JSON[_0xca27('0xe')](_0x17333b));if(_0x17333b[_0xca27('0xf')]){if(_0x17333b[_0xca27('0xf')][_0xca27('0x10')]===0x1f4){logger[_0xca27('0xf')](_0xca27('0xb'),_0x304465,_0x17333b[_0xca27('0xf')][_0xca27('0x11')]);return _0xcb41b2(_0x17333b[_0xca27('0xf')][_0xca27('0x11')]);}logger[_0xca27('0xf')](_0xca27('0xb'),_0x304465,_0x17333b['error'][_0xca27('0x11')]);return _0x36256b(_0x17333b[_0xca27('0xf')]['message']);}else{logger[_0xca27('0xa')]('VoiceCallReport,\x20%s,\x20%s',_0x304465,_0xca27('0xc'));_0x36256b(_0x17333b[_0xca27('0x12')][_0xca27('0x11')]);}})['catch'](function(_0x582e30){logger[_0xca27('0xf')](_0xca27('0xb'),_0x304465,_0x582e30);_0xcb41b2(_0x582e30);});});}exports[_0xca27('0x13')]=function(_0x59544d){var _0x42c232=this;return new Promise(function(_0x57c439,_0x3d4f17){return db[_0xca27('0x14')][_0xca27('0x15')]({'raw':_0x59544d[_0xca27('0x16')]?_0x59544d[_0xca27('0x16')][_0xca27('0x17')]===undefined?!![]:![]:!![],'where':_0x59544d['options']?_0x59544d['options'][_0xca27('0x18')]||null:null,'attributes':_0x59544d[_0xca27('0x16')]?_0x59544d[_0xca27('0x16')][_0xca27('0x19')]||null:null,'limit':_0x59544d['options']?_0x59544d[_0xca27('0x16')]['limit']||null:null,'include':_0x59544d[_0xca27('0x16')]?_0x59544d['options'][_0xca27('0x1a')]?_['map'](_0x59544d[_0xca27('0x16')][_0xca27('0x1a')],function(_0x355d25){return{'model':db[_0x355d25[_0xca27('0x1b')]],'as':_0x355d25['as'],'attributes':_0x355d25[_0xca27('0x19')],'include':_0x355d25[_0xca27('0x1a')]?_[_0xca27('0x1c')](_0x355d25[_0xca27('0x1a')],function(_0xfabf77){return{'model':db[_0xfabf77[_0xca27('0x1b')]],'as':_0xfabf77['as'],'attributes':_0xfabf77['attributes'],'include':_0xfabf77['include']?_[_0xca27('0x1c')](_0xfabf77[_0xca27('0x1a')],function(_0xa723a4){return{'model':db[_0xa723a4[_0xca27('0x1b')]],'as':_0xa723a4['as'],'attributes':_0xa723a4[_0xca27('0x19')]};}):[]};}):[]};}):[]:[]})[_0xca27('0x1d')](function(_0x4a7ae4){logger[_0xca27('0xa')](_0xca27('0x13'),_0x59544d);logger[_0xca27('0xd')]('GetVoiceCallReport',_0x59544d,JSON[_0xca27('0xe')](_0x4a7ae4));_0x57c439(_0x4a7ae4);})[_0xca27('0x1e')](function(_0x4005ae){logger[_0xca27('0xf')](_0xca27('0x13'),_0x4005ae[_0xca27('0x11')],_0x59544d);_0x3d4f17(_0x42c232['error'](0x1f4,_0x4005ae[_0xca27('0x11')]));});});};exports[_0xca27('0x1f')]=function(_0x24e0c2){var _0x536af0=this;return new Promise(function(_0x40bf23,_0x296183){return db[_0xca27('0x14')][_0xca27('0x20')](_0x24e0c2[_0xca27('0x21')],{'raw':_0x24e0c2[_0xca27('0x16')]?_0x24e0c2[_0xca27('0x16')][_0xca27('0x17')]===undefined?!![]:![]:!![]})[_0xca27('0x1d')](function(_0x1d3a27){logger[_0xca27('0xa')](_0xca27('0x1f'),_0x24e0c2);logger['debug'](_0xca27('0x1f'),_0x24e0c2,JSON[_0xca27('0xe')](_0x1d3a27));_0x40bf23(_0x1d3a27);})['catch'](function(_0x408431){logger[_0xca27('0xf')](_0xca27('0x1f'),_0x408431[_0xca27('0x11')],_0x24e0c2);_0x296183(_0x536af0[_0xca27('0xf')](0x1f4,_0x408431[_0xca27('0x11')]));});});};exports[_0xca27('0x22')]=function(_0x2ac72b){var _0x2f21ad=this;return new Promise(function(_0x452957,_0x12511e){return db['VoiceCallReport'][_0xca27('0x23')](_0x2ac72b[_0xca27('0x21')],{'raw':_0x2ac72b[_0xca27('0x16')]?_0x2ac72b[_0xca27('0x16')][_0xca27('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ac72b['options']?_0x2ac72b['options'][_0xca27('0x18')]||null:null,'attributes':_0x2ac72b['options']?_0x2ac72b[_0xca27('0x16')][_0xca27('0x19')]||null:null,'limit':_0x2ac72b[_0xca27('0x16')]?_0x2ac72b['options'][_0xca27('0x24')]||null:null})[_0xca27('0x1d')](function(_0x2186dd){logger[_0xca27('0xa')](_0xca27('0x22'),_0x2ac72b);logger[_0xca27('0xd')]('UpdateVoiceCallReport',_0x2ac72b,JSON[_0xca27('0xe')](_0x2186dd));_0x452957(_0x2186dd);})[_0xca27('0x1e')](function(_0x4001f8){logger[_0xca27('0xf')]('UpdateVoiceCallReport',_0x4001f8[_0xca27('0x11')],_0x2ac72b);_0x12511e(_0x2f21ad[_0xca27('0xf')](0x1f4,_0x4001f8[_0xca27('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index fa078c0..edbb10b 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 _0xcca7=['/:id','show','create','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','index','get'];(function(_0x1bafd9,_0x4bb440){var _0x338c85=function(_0x40306b){while(--_0x40306b){_0x1bafd9['push'](_0x1bafd9['shift']());}};_0x338c85(++_0x4bb440);}(_0xcca7,0x15b));var _0x7cca=function(_0x2f41dd,_0x5bd3a1){_0x2f41dd=_0x2f41dd-0x0;var _0x3b377d=_0xcca7[_0x2f41dd];return _0x3b377d;};'use strict';var multer=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var path=require('path');var timeout=require(_0x7cca('0x2'));var express=require(_0x7cca('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7cca('0x4'));var config=require(_0x7cca('0x5'));var controller=require(_0x7cca('0x6'));router['get']('/',auth[_0x7cca('0x7')](),controller[_0x7cca('0x8')]);router[_0x7cca('0x9')](_0x7cca('0xa'),auth[_0x7cca('0x7')](),controller[_0x7cca('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7cca('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x7cca('0xd')]);router[_0x7cca('0xe')](_0x7cca('0xa'),auth[_0x7cca('0x7')](),controller[_0x7cca('0xf')]);module[_0x7cca('0x10')]=router; \ No newline at end of file +var _0xb9e3=['update','delete','/:id','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','index','get','isAuthenticated','show','post','create','put'];(function(_0x4db141,_0x74de9b){var _0x4e8b56=function(_0x2dc06f){while(--_0x2dc06f){_0x4db141['push'](_0x4db141['shift']());}};_0x4e8b56(++_0x74de9b);}(_0xb9e3,0xdc));var _0x3b9e=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0xb9e3[_0x28aea5];return _0x6a55f9;};'use strict';var multer=require(_0x3b9e('0x0'));var util=require(_0x3b9e('0x1'));var path=require(_0x3b9e('0x2'));var timeout=require(_0x3b9e('0x3'));var express=require(_0x3b9e('0x4'));var router=express['Router']();var auth=require(_0x3b9e('0x5'));var interaction=require(_0x3b9e('0x6'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x3b9e('0x7')]);router[_0x3b9e('0x8')]('/:id',auth[_0x3b9e('0x9')](),controller[_0x3b9e('0xa')]);router[_0x3b9e('0xb')]('/',auth[_0x3b9e('0x9')](),controller[_0x3b9e('0xc')]);router[_0x3b9e('0xd')]('/:id',auth[_0x3b9e('0x9')](),controller[_0x3b9e('0xe')]);router[_0x3b9e('0xf')](_0x3b9e('0x10'),auth[_0x3b9e('0x9')](),controller['destroy']);module[_0x3b9e('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 17bff36..69e2500 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 _0x4eda=['split','BOOLEAN','exports','STRING','name','setDataValue','options','join','getDataValue'];(function(_0xa2d67a,_0x2e3c53){var _0x1e5baf=function(_0x572b29){while(--_0x572b29){_0xa2d67a['push'](_0xa2d67a['shift']());}};_0x1e5baf(++_0x2e3c53);}(_0x4eda,0xa4));var _0xa4ed=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4eda[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0xa4ed('0x0')]={'name':{'type':Sequelize[_0xa4ed('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xa4ed('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xa4ed('0x1')],'set':function(_0x400ab0){this[_0xa4ed('0x3')](_0xa4ed('0x4'),_0x400ab0?_0x400ab0[_0xa4ed('0x5')](''):[]);},'get':function(){return this[_0xa4ed('0x6')]('options')?this[_0xa4ed('0x6')](_0xa4ed('0x4'))[_0xa4ed('0x7')](''):[];}},'auth':{'type':Sequelize[_0xa4ed('0x8')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xa4ed('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xa4ed('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2509=['name','setDataValue','join','getDataValue','options','BOOLEAN','sequelize','exports','STRING'];(function(_0x4896a6,_0x528629){var _0x15ac0c=function(_0x436184){while(--_0x436184){_0x4896a6['push'](_0x4896a6['shift']());}};_0x15ac0c(++_0x528629);}(_0x2509,0x7b));var _0x9250=function(_0x3eefc4,_0x13da29){_0x3eefc4=_0x3eefc4-0x0;var _0x390870=_0x2509[_0x3eefc4];return _0x390870;};'use strict';var Sequelize=require(_0x9250('0x0'));module[_0x9250('0x1')]={'name':{'type':Sequelize[_0x9250('0x2')]},'prefix':{'type':Sequelize[_0x9250('0x2')],'unique':_0x9250('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x5267ab){this[_0x9250('0x4')]('options',_0x5267ab?_0x5267ab[_0x9250('0x5')](''):[]);},'get':function(){return this[_0x9250('0x6')](_0x9250('0x7'))?this[_0x9250('0x6')]('options')['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x9250('0x2')]},'record':{'type':Sequelize[_0x9250('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x9250('0x2')]},'description':{'type':Sequelize[_0x9250('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 503e1ad..a9932ba 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 _0x9084=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','ChanSpies','UserProfileResource','destroy','error','stack','name','send','VoiceChanSpy','rawAttributes','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','count','includeAll','findAll','show','params','fields','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x9084,0xde));var _0x4908=function(_0x41783d,_0x5b4fe8){_0x41783d=_0x41783d-0x0;var _0x44029c=_0x9084[_0x41783d];return _0x44029c;};'use strict';var pdf=require(_0x4908('0x0'));var emlformat=require(_0x4908('0x1'));var rimraf=require(_0x4908('0x2'));var zipdir=require(_0x4908('0x3'));var jsonpatch=require(_0x4908('0x4'));var rp=require(_0x4908('0x5'));var moment=require(_0x4908('0x6'));var BPromise=require(_0x4908('0x7'));var Mustache=require(_0x4908('0x8'));var util=require('util');var path=require(_0x4908('0x9'));var sox=require('sox');var csv=require(_0x4908('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4908('0xb'));var squel=require(_0x4908('0xc'));var crypto=require(_0x4908('0xd'));var jsforce=require(_0x4908('0xe'));var deskjs=require(_0x4908('0xf'));var toCsv=require(_0x4908('0xa'));var querystring=require(_0x4908('0x10'));var Papa=require('papaparse');var Redis=require(_0x4908('0x11'));var authService=require(_0x4908('0x12'));var qs=require(_0x4908('0x13'));var hardwareService=require(_0x4908('0x14'));var logger=require(_0x4908('0x15'))(_0x4908('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bb6e3,_0x3b9408){_0x3b9408=_0x3b9408||0xcc;return function(_0x56cfa8){if(_0x56cfa8){return _0x5bb6e3[_0x4908('0x17')](_0x3b9408);}return _0x5bb6e3[_0x4908('0x18')](_0x3b9408)[_0x4908('0x19')]();};}function respondWithResult(_0x32676a,_0x333f32){_0x333f32=_0x333f32||0xc8;return function(_0x4d54f7){if(_0x4d54f7){return _0x32676a[_0x4908('0x18')](_0x333f32)[_0x4908('0x1a')](_0x4d54f7);}};}function respondWithFilteredResult(_0x4acdd7,_0x325989){return function(_0x4c5207){if(_0x4c5207){var _0x154809=_0x4c5207['count'],_0x4a5552=_0x325989[_0x4908('0x1b')],_0x333675=_0x325989['offset']+_0x325989[_0x4908('0x1c')],_0x1e7e07;if(_0x333675>=_0x154809){_0x333675=_0x154809;_0x1e7e07=0xc8;}else{_0x1e7e07=0xce;}_0x4acdd7[_0x4908('0x18')](_0x1e7e07);return _0x4acdd7[_0x4908('0x1d')](_0x4908('0x1e'),_0x4a5552+'-'+_0x333675+'/'+_0x154809)[_0x4908('0x1a')](_0x4c5207);}return null;};}function patchUpdates(_0x1102ce){return function(_0x638f73){try{jsonpatch['apply'](_0x638f73,_0x1102ce,!![]);}catch(_0x20cc2d){return BPromise[_0x4908('0x1f')](_0x20cc2d);}return _0x638f73[_0x4908('0x20')]();};}function saveUpdates(_0x2b83ab,_0x1dc744){return function(_0x7f6f6a){if(_0x7f6f6a){return _0x7f6f6a[_0x4908('0x21')](_0x2b83ab)['then'](function(_0x38be5b){return _0x38be5b;});}return null;};}function removeEntity(_0x3446b4,_0x9073d5){return function(_0x3258ab){if(_0x3258ab){return _0x3258ab['destroy']()[_0x4908('0x22')](function(){var _0x475a87=_0x3258ab['get']({'plain':!![]});var _0x3a3639=_0x4908('0x23');return db[_0x4908('0x24')][_0x4908('0x25')]({'where':{'type':_0x3a3639,'resourceId':_0x475a87['id']}})[_0x4908('0x22')](function(){return _0x3258ab;});})[_0x4908('0x22')](function(){_0x3446b4[_0x4908('0x18')](0xcc)[_0x4908('0x19')]();});}};}function handleEntityNotFound(_0x3ede10,_0x2dd40b){return function(_0x132ea7){if(!_0x132ea7){_0x3ede10[_0x4908('0x17')](0x194);}return _0x132ea7;};}function handleError(_0x126bb7,_0x143215){_0x143215=_0x143215||0x1f4;return function(_0x319828){logger[_0x4908('0x26')](_0x319828[_0x4908('0x27')]);if(_0x319828['name']){delete _0x319828[_0x4908('0x28')];}_0x126bb7[_0x4908('0x18')](_0x143215)[_0x4908('0x29')](_0x319828);};}exports['index']=function(_0x2734e2,_0x1c8808){var _0x384acd={},_0x1d13a5={},_0x3f9b95={'count':0x0,'rows':[]};var _0x1a77ff=db[_0x4908('0x2a')][_0x4908('0x2b')];_0x1d13a5['model']=_['keys'](_0x1a77ff);_0x1d13a5[_0x4908('0x2c')]=_[_0x4908('0x2d')](_0x2734e2['query']);_0x1d13a5[_0x4908('0x2e')]=_['intersection'](_0x1d13a5[_0x4908('0x2f')],_0x1d13a5[_0x4908('0x2c')]);_0x384acd[_0x4908('0x30')]=_[_0x4908('0x31')](_0x1d13a5[_0x4908('0x2f')],qs['fields'](_0x2734e2['query']['fields']));_0x384acd['attributes']=_0x384acd[_0x4908('0x30')][_0x4908('0x32')]?_0x384acd['attributes']:_0x1d13a5[_0x4908('0x2f')];if(!_0x2734e2[_0x4908('0x2c')][_0x4908('0x33')]('nolimit')){_0x384acd['limit']=qs['limit'](_0x2734e2[_0x4908('0x2c')][_0x4908('0x1c')]);_0x384acd['offset']=qs[_0x4908('0x1b')](_0x2734e2['query']['offset']);}_0x384acd[_0x4908('0x34')]=qs[_0x4908('0x35')](_0x2734e2[_0x4908('0x2c')][_0x4908('0x35')]);_0x384acd[_0x4908('0x36')]=qs['filters'](_[_0x4908('0x37')](_0x2734e2[_0x4908('0x2c')],_0x1d13a5[_0x4908('0x2e')]));if(_0x2734e2['query'][_0x4908('0x38')]){_0x384acd[_0x4908('0x36')]=_[_0x4908('0x39')](_0x384acd[_0x4908('0x36')],{'$or':_['map'](_0x1a77ff,function(_0x105b8c){if(_0x105b8c['type'][_0x4908('0x3a')]!==_0x4908('0x3b')){var _0x1bfdc0={};_0x1bfdc0[_0x105b8c[_0x4908('0x3c')]]={'$like':'%'+_0x2734e2['query']['filter']+'%'};return _0x1bfdc0;}})});}_0x384acd=_['merge']({},_0x384acd,_0x2734e2[_0x4908('0x3d')]);var _0x16a832={'where':_0x384acd[_0x4908('0x36')]};return db[_0x4908('0x2a')][_0x4908('0x3e')](_0x16a832)[_0x4908('0x22')](function(_0x142749){_0x3f9b95[_0x4908('0x3e')]=_0x142749;if(_0x2734e2['query'][_0x4908('0x3f')]){_0x384acd['include']=[{'all':!![]}];}return db[_0x4908('0x2a')][_0x4908('0x40')](_0x384acd);})[_0x4908('0x22')](function(_0x1814c2){_0x3f9b95['rows']=_0x1814c2;return _0x3f9b95;})[_0x4908('0x22')](respondWithFilteredResult(_0x1c8808,_0x384acd))['catch'](handleError(_0x1c8808,null));};exports[_0x4908('0x41')]=function(_0xb68276,_0x5a422b){var _0x694fb9={'raw':![],'where':{'id':_0xb68276[_0x4908('0x42')]['id']}},_0x16f335={};_0x16f335[_0x4908('0x2f')]=_['keys'](db[_0x4908('0x2a')][_0x4908('0x2b')]);_0x16f335[_0x4908('0x2c')]=_[_0x4908('0x2d')](_0xb68276['query']);_0x16f335[_0x4908('0x2e')]=_['intersection'](_0x16f335[_0x4908('0x2f')],_0x16f335[_0x4908('0x2c')]);_0x694fb9[_0x4908('0x30')]=_[_0x4908('0x31')](_0x16f335[_0x4908('0x2f')],qs[_0x4908('0x43')](_0xb68276[_0x4908('0x2c')][_0x4908('0x43')]));_0x694fb9[_0x4908('0x30')]=_0x694fb9[_0x4908('0x30')][_0x4908('0x32')]?_0x694fb9[_0x4908('0x30')]:_0x16f335[_0x4908('0x2f')];if(_0xb68276[_0x4908('0x2c')][_0x4908('0x3f')]){_0x694fb9[_0x4908('0x44')]=[{'all':!![]}];}_0x694fb9=_[_0x4908('0x39')]({},_0x694fb9,_0xb68276[_0x4908('0x3d')]);return db['VoiceChanSpy'][_0x4908('0x45')](_0x694fb9)[_0x4908('0x22')](handleEntityNotFound(_0x5a422b,null))[_0x4908('0x22')](respondWithResult(_0x5a422b,null))['catch'](handleError(_0x5a422b,null));};exports[_0x4908('0x46')]=function(_0x5effe6,_0x4b7ba2){return db[_0x4908('0x2a')][_0x4908('0x46')](_0x5effe6[_0x4908('0x47')],{})[_0x4908('0x22')](function(_0x2d72c3){var _0x142b62=_0x5effe6[_0x4908('0x48')]['get']({'plain':!![]});if(!_0x142b62)throw new Error(_0x4908('0x49'));if(_0x142b62[_0x4908('0x4a')]===_0x4908('0x48')){var _0x4e41cd=_0x2d72c3[_0x4908('0x4b')]({'plain':!![]});var _0xe754f5='ChanSpies';return db['UserProfileSection'][_0x4908('0x45')]({'where':{'name':_0xe754f5,'userProfileId':_0x142b62['userProfileId']},'raw':!![]})[_0x4908('0x22')](function(_0x43d119){if(_0x43d119&&_0x43d119[_0x4908('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x4e41cd[_0x4908('0x28')],'resourceId':_0x4e41cd['id'],'type':_0x43d119[_0x4908('0x28')],'sectionId':_0x43d119['id']},{})[_0x4908('0x22')](function(){return _0x2d72c3;});}else{return _0x2d72c3;}})[_0x4908('0x4d')](function(_0x3d1a4d){logger[_0x4908('0x26')](_0x4908('0x4e'),_0x3d1a4d);throw _0x3d1a4d;});}return _0x2d72c3;})[_0x4908('0x22')](respondWithResult(_0x4b7ba2,0xc9))[_0x4908('0x4d')](handleError(_0x4b7ba2,null));};exports[_0x4908('0x21')]=function(_0x39d596,_0x881fd4){if(_0x39d596['body']['id']){delete _0x39d596[_0x4908('0x47')]['id'];}return db[_0x4908('0x2a')][_0x4908('0x45')]({'where':{'id':_0x39d596[_0x4908('0x42')]['id']}})[_0x4908('0x22')](handleEntityNotFound(_0x881fd4,null))[_0x4908('0x22')](saveUpdates(_0x39d596[_0x4908('0x47')],null))[_0x4908('0x22')](respondWithResult(_0x881fd4,null))['catch'](handleError(_0x881fd4,null));};exports[_0x4908('0x25')]=function(_0x5ca108,_0x30d51c){return db[_0x4908('0x2a')][_0x4908('0x45')]({'where':{'id':_0x5ca108[_0x4908('0x42')]['id']}})['then'](handleEntityNotFound(_0x30d51c,null))[_0x4908('0x22')](removeEntity(_0x30d51c,null))['catch'](handleError(_0x30d51c,null));}; \ No newline at end of file +var _0xcb70=['options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','end','stack','name','send','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','map','key','VIRTUAL','field','VoiceChanSpy','includeAll','include','findAll','rows','show'];(function(_0x415e8e,_0x21a4e6){var _0x10c648=function(_0x150690){while(--_0x150690){_0x415e8e['push'](_0x415e8e['shift']());}};_0x10c648(++_0x21a4e6);}(_0xcb70,0x100));var _0x0cb7=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xcb70[_0x5cb1af];return _0x8d7940;};'use strict';var pdf=require(_0x0cb7('0x0'));var emlformat=require(_0x0cb7('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0cb7('0x2'));var moment=require(_0x0cb7('0x3'));var BPromise=require(_0x0cb7('0x4'));var Mustache=require('mustache');var util=require(_0x0cb7('0x5'));var path=require(_0x0cb7('0x6'));var sox=require('sox');var csv=require(_0x0cb7('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0cb7('0x8'));var squel=require(_0x0cb7('0x9'));var crypto=require(_0x0cb7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0cb7('0xb'));var toCsv=require(_0x0cb7('0x7'));var querystring=require('querystring');var Papa=require(_0x0cb7('0xc'));var Redis=require(_0x0cb7('0xd'));var authService=require(_0x0cb7('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0cb7('0xf'));var logger=require(_0x0cb7('0x10'))(_0x0cb7('0x11'));var utils=require(_0x0cb7('0x12'));var config=require(_0x0cb7('0x13'));var db=require(_0x0cb7('0x14'))['db'];function respondWithStatusCode(_0x27fdd5,_0x1eaebb){_0x1eaebb=_0x1eaebb||0xcc;return function(_0x18680d){if(_0x18680d){return _0x27fdd5[_0x0cb7('0x15')](_0x1eaebb);}return _0x27fdd5[_0x0cb7('0x16')](_0x1eaebb)['end']();};}function respondWithResult(_0x4029d2,_0x2e2d77){_0x2e2d77=_0x2e2d77||0xc8;return function(_0x4f578f){if(_0x4f578f){return _0x4029d2[_0x0cb7('0x16')](_0x2e2d77)[_0x0cb7('0x17')](_0x4f578f);}};}function respondWithFilteredResult(_0xd24f5f,_0x32a290){return function(_0x1c4ab1){if(_0x1c4ab1){var _0x4cf6cb=_0x1c4ab1[_0x0cb7('0x18')],_0x39ed85=_0x32a290[_0x0cb7('0x19')],_0x863d7b=_0x32a290[_0x0cb7('0x19')]+_0x32a290['limit'],_0x1ea894;if(_0x863d7b>=_0x4cf6cb){_0x863d7b=_0x4cf6cb;_0x1ea894=0xc8;}else{_0x1ea894=0xce;}_0xd24f5f[_0x0cb7('0x16')](_0x1ea894);return _0xd24f5f[_0x0cb7('0x1a')](_0x0cb7('0x1b'),_0x39ed85+'-'+_0x863d7b+'/'+_0x4cf6cb)[_0x0cb7('0x17')](_0x1c4ab1);}return null;};}function patchUpdates(_0x56d843){return function(_0x5bb768){try{jsonpatch[_0x0cb7('0x1c')](_0x5bb768,_0x56d843,!![]);}catch(_0x1ca75d){return BPromise[_0x0cb7('0x1d')](_0x1ca75d);}return _0x5bb768[_0x0cb7('0x1e')]();};}function saveUpdates(_0x263ef4,_0x43a476){return function(_0x27c166){if(_0x27c166){return _0x27c166[_0x0cb7('0x1f')](_0x263ef4)[_0x0cb7('0x20')](function(_0x3240bf){return _0x3240bf;});}return null;};}function removeEntity(_0x201538,_0x5024e5){return function(_0x251067){if(_0x251067){return _0x251067[_0x0cb7('0x21')]()['then'](function(){var _0x237672=_0x251067[_0x0cb7('0x22')]({'plain':!![]});var _0x731491=_0x0cb7('0x23');return db[_0x0cb7('0x24')]['destroy']({'where':{'type':_0x731491,'resourceId':_0x237672['id']}})[_0x0cb7('0x20')](function(){return _0x251067;});})[_0x0cb7('0x20')](function(){_0x201538['status'](0xcc)[_0x0cb7('0x25')]();});}};}function handleEntityNotFound(_0x244b5f,_0x248774){return function(_0x1caf8d){if(!_0x1caf8d){_0x244b5f[_0x0cb7('0x15')](0x194);}return _0x1caf8d;};}function handleError(_0x2c4b61,_0x4921d0){_0x4921d0=_0x4921d0||0x1f4;return function(_0x476cff){logger['error'](_0x476cff[_0x0cb7('0x26')]);if(_0x476cff[_0x0cb7('0x27')]){delete _0x476cff[_0x0cb7('0x27')];}_0x2c4b61[_0x0cb7('0x16')](_0x4921d0)[_0x0cb7('0x28')](_0x476cff);};}exports['index']=function(_0x51fbea,_0x59beab){var _0x3a0a83={},_0x20c064={},_0x258274={'count':0x0,'rows':[]};var _0x4675bf=db['VoiceChanSpy'][_0x0cb7('0x29')];_0x20c064['model']=_[_0x0cb7('0x2a')](_0x4675bf);_0x20c064['query']=_[_0x0cb7('0x2a')](_0x51fbea[_0x0cb7('0x2b')]);_0x20c064[_0x0cb7('0x2c')]=_[_0x0cb7('0x2d')](_0x20c064[_0x0cb7('0x2e')],_0x20c064['query']);_0x3a0a83[_0x0cb7('0x2f')]=_[_0x0cb7('0x2d')](_0x20c064['model'],qs[_0x0cb7('0x30')](_0x51fbea[_0x0cb7('0x2b')][_0x0cb7('0x30')]));_0x3a0a83[_0x0cb7('0x2f')]=_0x3a0a83[_0x0cb7('0x2f')][_0x0cb7('0x31')]?_0x3a0a83[_0x0cb7('0x2f')]:_0x20c064[_0x0cb7('0x2e')];if(!_0x51fbea[_0x0cb7('0x2b')][_0x0cb7('0x32')](_0x0cb7('0x33'))){_0x3a0a83[_0x0cb7('0x34')]=qs[_0x0cb7('0x34')](_0x51fbea[_0x0cb7('0x2b')][_0x0cb7('0x34')]);_0x3a0a83[_0x0cb7('0x19')]=qs[_0x0cb7('0x19')](_0x51fbea['query'][_0x0cb7('0x19')]);}_0x3a0a83[_0x0cb7('0x35')]=qs['sort'](_0x51fbea['query'][_0x0cb7('0x36')]);_0x3a0a83['where']=qs[_0x0cb7('0x2c')](_['pick'](_0x51fbea['query'],_0x20c064[_0x0cb7('0x2c')]));if(_0x51fbea['query'][_0x0cb7('0x37')]){_0x3a0a83[_0x0cb7('0x38')]=_[_0x0cb7('0x39')](_0x3a0a83[_0x0cb7('0x38')],{'$or':_[_0x0cb7('0x3a')](_0x4675bf,function(_0x314d37){if(_0x314d37['type'][_0x0cb7('0x3b')]!==_0x0cb7('0x3c')){var _0x46fb43={};_0x46fb43[_0x314d37[_0x0cb7('0x3d')]]={'$like':'%'+_0x51fbea[_0x0cb7('0x2b')][_0x0cb7('0x37')]+'%'};return _0x46fb43;}})});}_0x3a0a83=_['merge']({},_0x3a0a83,_0x51fbea['options']);var _0x5658a7={'where':_0x3a0a83[_0x0cb7('0x38')]};return db[_0x0cb7('0x3e')][_0x0cb7('0x18')](_0x5658a7)[_0x0cb7('0x20')](function(_0xd4bf25){_0x258274[_0x0cb7('0x18')]=_0xd4bf25;if(_0x51fbea[_0x0cb7('0x2b')][_0x0cb7('0x3f')]){_0x3a0a83[_0x0cb7('0x40')]=[{'all':!![]}];}return db[_0x0cb7('0x3e')][_0x0cb7('0x41')](_0x3a0a83);})[_0x0cb7('0x20')](function(_0xb2acb9){_0x258274[_0x0cb7('0x42')]=_0xb2acb9;return _0x258274;})[_0x0cb7('0x20')](respondWithFilteredResult(_0x59beab,_0x3a0a83))['catch'](handleError(_0x59beab,null));};exports[_0x0cb7('0x43')]=function(_0x8fff7d,_0x1daf2f){var _0x20b522={'raw':![],'where':{'id':_0x8fff7d['params']['id']}},_0x355eb2={};_0x355eb2['model']=_[_0x0cb7('0x2a')](db[_0x0cb7('0x3e')]['rawAttributes']);_0x355eb2[_0x0cb7('0x2b')]=_[_0x0cb7('0x2a')](_0x8fff7d['query']);_0x355eb2[_0x0cb7('0x2c')]=_['intersection'](_0x355eb2['model'],_0x355eb2[_0x0cb7('0x2b')]);_0x20b522[_0x0cb7('0x2f')]=_['intersection'](_0x355eb2[_0x0cb7('0x2e')],qs[_0x0cb7('0x30')](_0x8fff7d[_0x0cb7('0x2b')][_0x0cb7('0x30')]));_0x20b522[_0x0cb7('0x2f')]=_0x20b522[_0x0cb7('0x2f')]['length']?_0x20b522['attributes']:_0x355eb2[_0x0cb7('0x2e')];if(_0x8fff7d[_0x0cb7('0x2b')][_0x0cb7('0x3f')]){_0x20b522[_0x0cb7('0x40')]=[{'all':!![]}];}_0x20b522=_['merge']({},_0x20b522,_0x8fff7d[_0x0cb7('0x44')]);return db[_0x0cb7('0x3e')][_0x0cb7('0x45')](_0x20b522)[_0x0cb7('0x20')](handleEntityNotFound(_0x1daf2f,null))[_0x0cb7('0x20')](respondWithResult(_0x1daf2f,null))[_0x0cb7('0x46')](handleError(_0x1daf2f,null));};exports[_0x0cb7('0x47')]=function(_0x3ae98f,_0x57a638){return db[_0x0cb7('0x3e')][_0x0cb7('0x47')](_0x3ae98f[_0x0cb7('0x48')],{})[_0x0cb7('0x20')](function(_0x19a5fe){var _0x17b5f7=_0x3ae98f[_0x0cb7('0x49')][_0x0cb7('0x22')]({'plain':!![]});if(!_0x17b5f7)throw new Error(_0x0cb7('0x4a'));if(_0x17b5f7[_0x0cb7('0x4b')]==='user'){var _0x236ba9=_0x19a5fe['get']({'plain':!![]});var _0x56f44e='ChanSpies';return db[_0x0cb7('0x4c')][_0x0cb7('0x45')]({'where':{'name':_0x56f44e,'userProfileId':_0x17b5f7[_0x0cb7('0x4d')]},'raw':!![]})['then'](function(_0x561bf5){if(_0x561bf5&&_0x561bf5[_0x0cb7('0x4e')]===0x0){return db[_0x0cb7('0x24')][_0x0cb7('0x47')]({'name':_0x236ba9[_0x0cb7('0x27')],'resourceId':_0x236ba9['id'],'type':_0x561bf5[_0x0cb7('0x27')],'sectionId':_0x561bf5['id']},{})[_0x0cb7('0x20')](function(){return _0x19a5fe;});}else{return _0x19a5fe;}})[_0x0cb7('0x46')](function(_0x4b0b7f){logger['error'](_0x0cb7('0x4f'),_0x4b0b7f);throw _0x4b0b7f;});}return _0x19a5fe;})[_0x0cb7('0x20')](respondWithResult(_0x57a638,0xc9))[_0x0cb7('0x46')](handleError(_0x57a638,null));};exports[_0x0cb7('0x1f')]=function(_0x197d1b,_0x452444){if(_0x197d1b[_0x0cb7('0x48')]['id']){delete _0x197d1b['body']['id'];}return db[_0x0cb7('0x3e')][_0x0cb7('0x45')]({'where':{'id':_0x197d1b['params']['id']}})[_0x0cb7('0x20')](handleEntityNotFound(_0x452444,null))['then'](saveUpdates(_0x197d1b[_0x0cb7('0x48')],null))[_0x0cb7('0x20')](respondWithResult(_0x452444,null))['catch'](handleError(_0x452444,null));};exports[_0x0cb7('0x21')]=function(_0x539b9d,_0x414267){return db[_0x0cb7('0x3e')][_0x0cb7('0x45')]({'where':{'id':_0x539b9d[_0x0cb7('0x50')]['id']}})['then'](handleEntityNotFound(_0x414267,null))[_0x0cb7('0x20')](removeEntity(_0x414267,null))[_0x0cb7('0x46')](handleError(_0x414267,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 8d43191..93b98c4 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 _0x3ce8=['record','MixMonitor','recordingFormat','auth','Authenticate','password','SIP/%s,%s','options','join','StopMixMonitor','length','concat','internal','name','User','then','catch','exports','models','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','push','merge','Set','CDR(type)=%s','chanspy'];(function(_0x27511c,_0x7c49e3){var _0x3ec6ef=function(_0x507d8e){while(--_0x507d8e){_0x27511c['push'](_0x27511c['shift']());}};_0x3ec6ef(++_0x7c49e3);}(_0x3ce8,0x122));var _0x83ce=function(_0x3d94e6,_0x3112a7){_0x3d94e6=_0x3d94e6-0x0;var _0x203689=_0x3ce8[_0x3d94e6];return _0x203689;};'use strict';var _=require(_0x83ce('0x0'));var util=require(_0x83ce('0x1'));var BPromise=require(_0x83ce('0x2'));var attributes=require(_0x83ce('0x3'));var getUserApplications=function(_0x396ca8,_0x1fd59f,_0x295238){var _0x4b6093=0x1;var _0x670da1=[];var _0x2f813b={'context':_0x1fd59f[_0x83ce('0x4')]||_0x83ce('0x5'),'exten':util[_0x83ce('0x6')](_0x83ce('0x7'),_0x396ca8[_0x83ce('0x8')],_0x295238),'type':'system','isApp':![],'ChanSpyId':_0x396ca8['id'],'UserId':_0x1fd59f['id']};_0x670da1[_0x83ce('0x9')](_[_0x83ce('0xa')]({'app':_0x83ce('0xb'),'appdata':util[_0x83ce('0x6')](_0x83ce('0xc'),_0x83ce('0xd')),'priority':_0x4b6093++},_0x2f813b));if(_0x396ca8[_0x83ce('0xe')]){_0x670da1[_0x83ce('0x9')](_[_0x83ce('0xa')]({'app':_0x83ce('0xf'),'appdata':util[_0x83ce('0x6')]('${UNIQUEID}.%s,ab',_0x396ca8[_0x83ce('0x10')]),'priority':_0x4b6093++},_0x2f813b));}if(_0x396ca8[_0x83ce('0x11')]){_0x670da1[_0x83ce('0x9')](_[_0x83ce('0xa')]({'app':_0x83ce('0x12'),'appdata':_0x396ca8[_0x83ce('0x13')],'priority':_0x4b6093++},_0x2f813b));}_0x670da1[_0x83ce('0x9')](_[_0x83ce('0xa')]({'app':'ChanSpy','appdata':util[_0x83ce('0x6')](_0x83ce('0x14'),_0x1fd59f['name'],_0x396ca8[_0x83ce('0x15')]?_0x396ca8[_0x83ce('0x15')][_0x83ce('0x16')](''):''),'priority':_0x4b6093++},_0x2f813b));if(_0x396ca8['record']){_0x670da1[_0x83ce('0x9')](_[_0x83ce('0xa')]({'app':_0x83ce('0x17'),'priority':_0x4b6093++},_0x2f813b));}return _0x670da1;};var getChanSpyApplications=function(_0x54366d,_0x309e59){var _0x65ed=[];for(var _0x1be0af=0x0,_0x435e59=0x1;_0x1be0af<_0x309e59[_0x83ce('0x18')];_0x1be0af++,_0x435e59=0x1){_0x65ed=_0x65ed[_0x83ce('0x19')](getUserApplications(_0x54366d,_0x309e59[_0x1be0af],_0x309e59[_0x1be0af][_0x83ce('0x1a')]));if(_0x309e59[_0x1be0af][_0x83ce('0x1a')]!=_0x309e59[_0x1be0af][_0x83ce('0x1b')]){_0x65ed=_0x65ed['concat'](getUserApplications(_0x54366d,_0x309e59[_0x1be0af],_0x309e59[_0x1be0af][_0x83ce('0x1b')]));}}return _0x65ed;};var getChanSpyPromise=function(_0x52fd03,_0x3aa298){return new BPromise(function(_0x19e4c8,_0x203144){return _0x52fd03[_0x83ce('0x1c')]['findAll']({'attributes':['id',_0x83ce('0x1b'),_0x83ce('0x1a')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x83ce('0x1d')](function(_0x5b433a){if(_0x5b433a){return _0x19e4c8(getChanSpyApplications(_0x3aa298,_0x5b433a));}return _0x19e4c8([]);})[_0x83ce('0x1e')](function(_0xdfd397){_0x203144(_0xdfd397);});});};module[_0x83ce('0x1f')]=function(_0x2a363d,_0x5de869){var _0x2c16c5=_0x2a363d[_0x83ce('0x20')];return _0x2a363d['define'](_0x83ce('0x21'),attributes,{'tableName':_0x83ce('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x214ad5,_0x1055ca,_0x686bb1){return getChanSpyPromise(_0x2c16c5,_0x214ad5)[_0x83ce('0x1d')](function(_0x62baee){if(_0x62baee&&_0x62baee[_0x83ce('0x18')]){return _0x2c16c5[_0x83ce('0x23')][_0x83ce('0x24')](_0x62baee);}})[_0x83ce('0x1d')](function(){_0x686bb1();})[_0x83ce('0x1e')](function(_0x147487){_0x686bb1(_0x147487);});},'afterUpdate':function(_0x8f70c9,_0x3a8e11,_0x297426){return _0x2c16c5[_0x83ce('0x23')][_0x83ce('0x25')]({'where':{'ChanSpyId':_0x8f70c9['id']}})['then'](function(){return getChanSpyPromise(_0x2c16c5,_0x8f70c9);})['then'](function(_0x452831){if(_0x452831&&_0x452831[_0x83ce('0x18')]){return _0x2c16c5[_0x83ce('0x23')][_0x83ce('0x24')](_0x452831);}})[_0x83ce('0x1d')](function(){_0x297426();})[_0x83ce('0x1e')](function(_0x154e1a){_0x297426(_0x154e1a);});},'afterDestroy':function(_0x214bb9,_0x3e41dc,_0x40e80c){return _0x2c16c5['VoiceExtension'][_0x83ce('0x25')]({'where':{'ChanSpyId':_0x214bb9['id']}})[_0x83ce('0x1d')](function(){_0x40e80c();})[_0x83ce('0x1e')](function(_0x45a0a4){_0x40e80c(_0x45a0a4);});}}});}; \ No newline at end of file +var _0xaf45=['recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','record','length','concat','internal','findAll','agent','then','catch','exports','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','bluebird','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','push','merge','Set','chanspy','MixMonitor','${UNIQUEID}.%s,ab'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xaf45,0x164));var _0x5af4=function(_0x39509b,_0xb0cb44){_0x39509b=_0x39509b-0x0;var _0x3f97ec=_0xaf45[_0x39509b];return _0x3f97ec;};'use strict';var _=require(_0x5af4('0x0'));var util=require('util');var BPromise=require(_0x5af4('0x1'));var attributes=require(_0x5af4('0x2'));var getUserApplications=function(_0x154a3c,_0x54d9b8,_0x2fca11){var _0x4723a9=0x1;var _0x1818b0=[];var _0x28a9e4={'context':_0x54d9b8[_0x5af4('0x3')]||'from-sip','exten':util[_0x5af4('0x4')](_0x5af4('0x5'),_0x154a3c[_0x5af4('0x6')],_0x2fca11),'type':_0x5af4('0x7'),'isApp':![],'ChanSpyId':_0x154a3c['id'],'UserId':_0x54d9b8['id']};_0x1818b0[_0x5af4('0x8')](_[_0x5af4('0x9')]({'app':_0x5af4('0xa'),'appdata':util[_0x5af4('0x4')]('CDR(type)=%s',_0x5af4('0xb')),'priority':_0x4723a9++},_0x28a9e4));if(_0x154a3c['record']){_0x1818b0['push'](_['merge']({'app':_0x5af4('0xc'),'appdata':util[_0x5af4('0x4')](_0x5af4('0xd'),_0x154a3c[_0x5af4('0xe')]),'priority':_0x4723a9++},_0x28a9e4));}if(_0x154a3c[_0x5af4('0xf')]){_0x1818b0['push'](_['merge']({'app':_0x5af4('0x10'),'appdata':_0x154a3c['password'],'priority':_0x4723a9++},_0x28a9e4));}_0x1818b0[_0x5af4('0x8')](_[_0x5af4('0x9')]({'app':_0x5af4('0x11'),'appdata':util[_0x5af4('0x4')](_0x5af4('0x12'),_0x54d9b8[_0x5af4('0x13')],_0x154a3c[_0x5af4('0x14')]?_0x154a3c['options'][_0x5af4('0x15')](''):''),'priority':_0x4723a9++},_0x28a9e4));if(_0x154a3c[_0x5af4('0x16')]){_0x1818b0[_0x5af4('0x8')](_[_0x5af4('0x9')]({'app':'StopMixMonitor','priority':_0x4723a9++},_0x28a9e4));}return _0x1818b0;};var getChanSpyApplications=function(_0x4355cf,_0x4fc727){var _0x1fd770=[];for(var _0x77545f=0x0,_0x28ef23=0x1;_0x77545f<_0x4fc727[_0x5af4('0x17')];_0x77545f++,_0x28ef23=0x1){_0x1fd770=_0x1fd770[_0x5af4('0x18')](getUserApplications(_0x4355cf,_0x4fc727[_0x77545f],_0x4fc727[_0x77545f][_0x5af4('0x19')]));if(_0x4fc727[_0x77545f][_0x5af4('0x19')]!=_0x4fc727[_0x77545f][_0x5af4('0x13')]){_0x1fd770=_0x1fd770['concat'](getUserApplications(_0x4355cf,_0x4fc727[_0x77545f],_0x4fc727[_0x77545f][_0x5af4('0x13')]));}}return _0x1fd770;};var getChanSpyPromise=function(_0x3b6b7b,_0x318fb8){return new BPromise(function(_0x314c29,_0x47e7c4){return _0x3b6b7b['User'][_0x5af4('0x1a')]({'attributes':['id','name',_0x5af4('0x19')],'where':{'role':_0x5af4('0x1b'),'chanspy':!![]},'raw':!![]})[_0x5af4('0x1c')](function(_0x3caa40){if(_0x3caa40){return _0x314c29(getChanSpyApplications(_0x318fb8,_0x3caa40));}return _0x314c29([]);})[_0x5af4('0x1d')](function(_0x25a5f1){_0x47e7c4(_0x25a5f1);});});};module[_0x5af4('0x1e')]=function(_0x420233,_0x14b37c){var _0xaaf9bc=_0x420233['models'];return _0x420233[_0x5af4('0x1f')](_0x5af4('0x20'),attributes,{'tableName':_0x5af4('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x304628,_0x2709f8,_0x1c11d5){return getChanSpyPromise(_0xaaf9bc,_0x304628)['then'](function(_0x49b4fe){if(_0x49b4fe&&_0x49b4fe[_0x5af4('0x17')]){return _0xaaf9bc[_0x5af4('0x22')][_0x5af4('0x23')](_0x49b4fe);}})[_0x5af4('0x1c')](function(){_0x1c11d5();})[_0x5af4('0x1d')](function(_0x1dd8ce){_0x1c11d5(_0x1dd8ce);});},'afterUpdate':function(_0x388974,_0x33809e,_0x1e0152){return _0xaaf9bc[_0x5af4('0x22')][_0x5af4('0x24')]({'where':{'ChanSpyId':_0x388974['id']}})['then'](function(){return getChanSpyPromise(_0xaaf9bc,_0x388974);})[_0x5af4('0x1c')](function(_0x441509){if(_0x441509&&_0x441509[_0x5af4('0x17')]){return _0xaaf9bc[_0x5af4('0x22')][_0x5af4('0x23')](_0x441509);}})[_0x5af4('0x1c')](function(){_0x1e0152();})[_0x5af4('0x1d')](function(_0x23f2a8){_0x1e0152(_0x23f2a8);});},'afterDestroy':function(_0x1937a8,_0xd74455,_0x27906a){return _0xaaf9bc[_0x5af4('0x22')][_0x5af4('0x24')]({'where':{'ChanSpyId':_0x1937a8['id']}})[_0x5af4('0x1c')](function(){_0x27906a();})['catch'](function(_0x148e81){_0x27906a(_0x148e81);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 1db61f8..01f8742 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 _0x66aa=['lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch'];(function(_0x52e68e,_0x309912){var _0x3211a4=function(_0x467c01){while(--_0x467c01){_0x52e68e['push'](_0x52e68e['shift']());}};_0x3211a4(++_0x309912);}(_0x66aa,0xa8));var _0xa66a=function(_0x51f1af,_0x55a1a4){_0x51f1af=_0x51f1af-0x0;var _0x3ae83d=_0x66aa[_0x51f1af];return _0x3ae83d;};'use strict';var _=require(_0xa66a('0x0'));var util=require(_0xa66a('0x1'));var moment=require(_0xa66a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa66a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa66a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa66a('0x5'));var jayson=require(_0xa66a('0x6'));var client=jayson[_0xa66a('0x7')][_0xa66a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x86de7e,_0x155ea7,_0x343266){return new BPromise(function(_0x571db0,_0xaafcf7){return client[_0xa66a('0x9')](_0x86de7e,_0x343266)[_0xa66a('0xa')](function(_0x3cc534){logger['info'](_0xa66a('0xb'),_0x155ea7,_0xa66a('0xc'));logger[_0xa66a('0xd')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x155ea7,_0xa66a('0xc'),JSON[_0xa66a('0xe')](_0x3cc534));if(_0x3cc534[_0xa66a('0xf')]){if(_0x3cc534['error'][_0xa66a('0x10')]===0x1f4){logger[_0xa66a('0xf')](_0xa66a('0xb'),_0x155ea7,_0x3cc534[_0xa66a('0xf')][_0xa66a('0x11')]);return _0xaafcf7(_0x3cc534[_0xa66a('0xf')][_0xa66a('0x11')]);}logger['error'](_0xa66a('0xb'),_0x155ea7,_0x3cc534[_0xa66a('0xf')][_0xa66a('0x11')]);return _0x571db0(_0x3cc534[_0xa66a('0xf')][_0xa66a('0x11')]);}else{logger[_0xa66a('0x12')](_0xa66a('0xb'),_0x155ea7,_0xa66a('0xc'));_0x571db0(_0x3cc534[_0xa66a('0x13')][_0xa66a('0x11')]);}})[_0xa66a('0x14')](function(_0x5a6cc3){logger[_0xa66a('0xf')](_0xa66a('0xb'),_0x155ea7,_0x5a6cc3);_0xaafcf7(_0x5a6cc3);});});} \ No newline at end of file +var _0x9db6=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','bluebird','randomstring'];(function(_0x34f273,_0x37a8c3){var _0x1f2544=function(_0x1b9a6b){while(--_0x1b9a6b){_0x34f273['push'](_0x34f273['shift']());}};_0x1f2544(++_0x37a8c3);}(_0x9db6,0x166));var _0x69db=function(_0x421c56,_0x4efd00){_0x421c56=_0x421c56-0x0;var _0x49b244=_0x9db6[_0x421c56];return _0x49b244;};'use strict';var _=require(_0x69db('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x69db('0x1'));var rs=require(_0x69db('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69db('0x3'))['db'];var utils=require(_0x69db('0x4'));var logger=require(_0x69db('0x5'))(_0x69db('0x6'));var config=require(_0x69db('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x69db('0x8')][_0x69db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x244a89,_0x3c3372,_0x49f5fa){return new BPromise(function(_0x39d741,_0x2b32d4){return client['request'](_0x244a89,_0x49f5fa)['then'](function(_0x3fa424){logger[_0x69db('0xa')](_0x69db('0xb'),_0x3c3372,_0x69db('0xc'));logger[_0x69db('0xd')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x3c3372,_0x69db('0xc'),JSON[_0x69db('0xe')](_0x3fa424));if(_0x3fa424[_0x69db('0xf')]){if(_0x3fa424[_0x69db('0xf')]['code']===0x1f4){logger[_0x69db('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x3c3372,_0x3fa424[_0x69db('0xf')]['message']);return _0x2b32d4(_0x3fa424[_0x69db('0xf')]['message']);}logger[_0x69db('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x3c3372,_0x3fa424[_0x69db('0xf')][_0x69db('0x10')]);return _0x39d741(_0x3fa424['error'][_0x69db('0x10')]);}else{logger[_0x69db('0xa')](_0x69db('0xb'),_0x3c3372,_0x69db('0xc'));_0x39d741(_0x3fa424[_0x69db('0x11')][_0x69db('0x10')]);}})[_0x69db('0x12')](function(_0x490690){logger[_0x69db('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x3c3372,_0x490690);_0x2b32d4(_0x490690);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 63b48af..6a18eef 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 _0x330f=['./voiceContext.controller','isAuthenticated','index','get','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x330f,0x10a));var _0xf330=function(_0x5751e6,_0x125e5e){_0x5751e6=_0x5751e6-0x0;var _0x4199e4=_0x330f[_0x5751e6];return _0x4199e4;};'use strict';var multer=require(_0xf330('0x0'));var util=require(_0xf330('0x1'));var path=require(_0xf330('0x2'));var timeout=require(_0xf330('0x3'));var express=require(_0xf330('0x4'));var router=express[_0xf330('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf330('0x6'));router['get']('/',auth[_0xf330('0x7')](),controller[_0xf330('0x8')]);router[_0xf330('0x9')]('/:id',auth[_0xf330('0x7')](),controller[_0xf330('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf330('0xb')]);router[_0xf330('0xc')]('/:id',auth[_0xf330('0x7')](),controller['update']);router[_0xf330('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xf330('0xe')]);module[_0xf330('0xf')]=router; \ No newline at end of file +var _0xefec=['create','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x515e8d,_0x316a53){var _0x20b2ee=function(_0x49122e){while(--_0x49122e){_0x515e8d['push'](_0x515e8d['shift']());}};_0x20b2ee(++_0x316a53);}(_0xefec,0x15f));var _0xcefe=function(_0x4d68b6,_0x4864de){_0x4d68b6=_0x4d68b6-0x0;var _0x498fa9=_0xefec[_0x4d68b6];return _0x498fa9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcefe('0x0'));var timeout=require(_0xcefe('0x1'));var express=require(_0xcefe('0x2'));var router=express[_0xcefe('0x3')]();var auth=require(_0xcefe('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcefe('0x5'));var controller=require(_0xcefe('0x6'));router[_0xcefe('0x7')]('/',auth[_0xcefe('0x8')](),controller[_0xcefe('0x9')]);router['get'](_0xcefe('0xa'),auth['isAuthenticated'](),controller[_0xcefe('0xb')]);router[_0xcefe('0xc')]('/',auth[_0xcefe('0x8')](),controller[_0xcefe('0xd')]);router['put'](_0xcefe('0xa'),auth[_0xcefe('0x8')](),controller['update']);router['delete']('/:id',auth[_0xcefe('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 5d72c39..d459cc7 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 _0xe14b=['exports','STRING','BOOLEAN','sequelize'];(function(_0x4ed00d,_0x4c5b11){var _0x3ff369=function(_0x5e6f77){while(--_0x5e6f77){_0x4ed00d['push'](_0x4ed00d['shift']());}};_0x3ff369(++_0x4c5b11);}(_0xe14b,0x93));var _0xbe14=function(_0x503790,_0x525c78){_0x503790=_0x503790-0x0;var _0x388092=_0xe14b[_0x503790];return _0x388092;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xbe14('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xbe14('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x34e8=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x16e59a,_0x5f4f6b){var _0x5dee55=function(_0x670f70){while(--_0x670f70){_0x16e59a['push'](_0x16e59a['shift']());}};_0x5dee55(++_0x5f4f6b);}(_0x34e8,0x12c));var _0x834e=function(_0x5c127e,_0x46a3d7){_0x5c127e=_0x5c127e-0x0;var _0xac76af=_0x34e8[_0x5c127e];return _0xac76af;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')],'unique':_0x834e('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x834e('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 c7526cc..a78ca26 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 _0xecf6=['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','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','end','status','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Contexts','UserProfileResource','sendStatus','stack','name','send','index','rawAttributes','model','keys','filters','attributes','intersection','fields','query','hasOwnProperty','nolimit','limit','sort','where','pick','filter','map','key','VIRTUAL','field','merge','options','VoiceContext','include','findAll','rows','show','length','includeAll','find','create','body','readFileSync','root','server/files/templates/context.ejs','render','writeFileSync','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','Reload','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test'];(function(_0x394296,_0x338163){var _0xb8356d=function(_0x6c673){while(--_0x6c673){_0x394296['push'](_0x394296['shift']());}};_0xb8356d(++_0x338163);}(_0xecf6,0x11b));var _0x6ecf=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xecf6[_0x1beef3];return _0x5af964;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6ecf('0x0'));var zipdir=require(_0x6ecf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6ecf('0x2'));var moment=require(_0x6ecf('0x3'));var BPromise=require(_0x6ecf('0x4'));var Mustache=require(_0x6ecf('0x5'));var util=require(_0x6ecf('0x6'));var path=require(_0x6ecf('0x7'));var sox=require(_0x6ecf('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6ecf('0x9'));var squel=require(_0x6ecf('0xa'));var crypto=require('crypto');var jsforce=require(_0x6ecf('0xb'));var deskjs=require(_0x6ecf('0xc'));var toCsv=require(_0x6ecf('0xd'));var querystring=require(_0x6ecf('0xe'));var Papa=require(_0x6ecf('0xf'));var Redis=require('ioredis');var authService=require(_0x6ecf('0x10'));var qs=require(_0x6ecf('0x11'));var hardwareService=require(_0x6ecf('0x12'));var logger=require(_0x6ecf('0x13'))('api');var utils=require(_0x6ecf('0x14'));var config=require(_0x6ecf('0x15'));var db=require(_0x6ecf('0x16'))['db'];var jayson=require(_0x6ecf('0x17'));var client=jayson['client'][_0x6ecf('0x18')]({'port':0x232a});function checkPasswordPattern(_0x1072d5,_0x3c95d1,_0x1c4f84){if(_0x1c4f84){var _0x1662f3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1662f3[_0x6ecf('0x19')](_0x3c95d1)){return _0x1072d5;}else{throw new Error(_0x6ecf('0x1a'));}}else{return _0x1072d5;}}function respondWithRpcPromise(_0x2218e6,_0x559892,_0x7eaa0e,_0x3c8bab){return new BPromise(function(_0x396dcf,_0x46b4f7){var _0x29ba9e=_0x3c8bab||client;return _0x29ba9e['request'](_0x2218e6,_0x7eaa0e)['then'](function(_0xcbded1){logger[_0x6ecf('0x1b')](_0x6ecf('0x1c'),_0x559892,_0x6ecf('0x1d'));logger['debug'](_0x6ecf('0x1e'),_0x559892,_0x6ecf('0x1d'),JSON['stringify'](_0xcbded1));if(_0xcbded1['error']){if(_0xcbded1['error'][_0x6ecf('0x1f')]===0x1f4){logger[_0x6ecf('0x20')](_0x6ecf('0x1c'),_0x559892,_0xcbded1[_0x6ecf('0x20')][_0x6ecf('0x21')]);return _0x46b4f7(_0xcbded1[_0x6ecf('0x20')]['message']);}logger[_0x6ecf('0x20')](_0x6ecf('0x1c'),_0x559892,_0xcbded1[_0x6ecf('0x20')]['message']);return _0x396dcf(_0xcbded1['error'][_0x6ecf('0x21')]);}else{logger[_0x6ecf('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x559892,_0x6ecf('0x1d'));_0x396dcf(_0xcbded1[_0x6ecf('0x22')][_0x6ecf('0x21')]);}})[_0x6ecf('0x23')](function(_0x56bcaa){logger[_0x6ecf('0x20')]('VoiceContext,\x20%s,\x20%s',_0x559892,_0x56bcaa);_0x46b4f7(_0x56bcaa);});});}function respondWithStatusCode(_0x454d55,_0x3665ba){_0x3665ba=_0x3665ba||0xcc;return function(_0x2c6a84){if(_0x2c6a84){return _0x454d55['sendStatus'](_0x3665ba);}return _0x454d55['status'](_0x3665ba)[_0x6ecf('0x24')]();};}function respondWithResult(_0x268ef5,_0x18217f){_0x18217f=_0x18217f||0xc8;return function(_0x2cec09){if(_0x2cec09){return _0x268ef5[_0x6ecf('0x25')](_0x18217f)[_0x6ecf('0x26')](_0x2cec09);}};}function respondWithFilteredResult(_0x111e36,_0x4152c5){return function(_0x4b2453){if(_0x4b2453){var _0x18d3dd=_0x4b2453[_0x6ecf('0x27')],_0x367169=_0x4152c5['offset'],_0x5d0f32=_0x4152c5[_0x6ecf('0x28')]+_0x4152c5['limit'],_0x31e45e;if(_0x5d0f32>=_0x18d3dd){_0x5d0f32=_0x18d3dd;_0x31e45e=0xc8;}else{_0x31e45e=0xce;}_0x111e36[_0x6ecf('0x25')](_0x31e45e);return _0x111e36[_0x6ecf('0x29')](_0x6ecf('0x2a'),_0x367169+'-'+_0x5d0f32+'/'+_0x18d3dd)[_0x6ecf('0x26')](_0x4b2453);}return null;};}function patchUpdates(_0x23a5c3){return function(_0x23de22){try{jsonpatch[_0x6ecf('0x2b')](_0x23de22,_0x23a5c3,!![]);}catch(_0x22512a){return BPromise[_0x6ecf('0x2c')](_0x22512a);}return _0x23de22['save']();};}function saveUpdates(_0xea7055,_0x57f966){return function(_0xc6eb3d){if(_0xc6eb3d){return _0xc6eb3d[_0x6ecf('0x2d')](_0xea7055)[_0x6ecf('0x2e')](function(_0x255226){return _0x255226;});}return null;};}function removeEntity(_0x24ad21,_0x27ffff){return function(_0xa95f59){if(_0xa95f59){return _0xa95f59[_0x6ecf('0x2f')]()[_0x6ecf('0x2e')](function(){var _0x2b1a5c=_0xa95f59[_0x6ecf('0x30')]({'plain':!![]});var _0x9e3a23=_0x6ecf('0x31');return db[_0x6ecf('0x32')][_0x6ecf('0x2f')]({'where':{'type':_0x9e3a23,'resourceId':_0x2b1a5c['id']}})['then'](function(){return _0xa95f59;});})[_0x6ecf('0x2e')](function(){_0x24ad21[_0x6ecf('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x291039,_0x3ffb29){return function(_0x56499d){if(!_0x56499d){_0x291039[_0x6ecf('0x33')](0x194);}return _0x56499d;};}function handleError(_0x5aaad4,_0x3d09b5){_0x3d09b5=_0x3d09b5||0x1f4;return function(_0x5407fb){logger['error'](_0x5407fb[_0x6ecf('0x34')]);if(_0x5407fb[_0x6ecf('0x35')]){delete _0x5407fb[_0x6ecf('0x35')];}_0x5aaad4['status'](_0x3d09b5)[_0x6ecf('0x36')](_0x5407fb);};}exports[_0x6ecf('0x37')]=function(_0x4d8804,_0x5cb2de){var _0x4a448a={},_0x59f17b={},_0x5820a3={'count':0x0,'rows':[]};var _0x29cf43=db['VoiceContext'][_0x6ecf('0x38')];_0x59f17b[_0x6ecf('0x39')]=_[_0x6ecf('0x3a')](_0x29cf43);_0x59f17b['query']=_[_0x6ecf('0x3a')](_0x4d8804['query']);_0x59f17b[_0x6ecf('0x3b')]=_['intersection'](_0x59f17b[_0x6ecf('0x39')],_0x59f17b['query']);_0x4a448a[_0x6ecf('0x3c')]=_[_0x6ecf('0x3d')](_0x59f17b[_0x6ecf('0x39')],qs[_0x6ecf('0x3e')](_0x4d8804[_0x6ecf('0x3f')][_0x6ecf('0x3e')]));_0x4a448a[_0x6ecf('0x3c')]=_0x4a448a['attributes']['length']?_0x4a448a[_0x6ecf('0x3c')]:_0x59f17b[_0x6ecf('0x39')];if(!_0x4d8804[_0x6ecf('0x3f')][_0x6ecf('0x40')](_0x6ecf('0x41'))){_0x4a448a[_0x6ecf('0x42')]=qs['limit'](_0x4d8804[_0x6ecf('0x3f')][_0x6ecf('0x42')]);_0x4a448a['offset']=qs[_0x6ecf('0x28')](_0x4d8804[_0x6ecf('0x3f')][_0x6ecf('0x28')]);}_0x4a448a['order']=qs[_0x6ecf('0x43')](_0x4d8804['query']['sort']);_0x4a448a[_0x6ecf('0x44')]=qs[_0x6ecf('0x3b')](_[_0x6ecf('0x45')](_0x4d8804[_0x6ecf('0x3f')],_0x59f17b[_0x6ecf('0x3b')]));if(_0x4d8804[_0x6ecf('0x3f')][_0x6ecf('0x46')]){_0x4a448a[_0x6ecf('0x44')]=_['merge'](_0x4a448a['where'],{'$or':_[_0x6ecf('0x47')](_0x29cf43,function(_0x34b310){if(_0x34b310['type'][_0x6ecf('0x48')]!==_0x6ecf('0x49')){var _0x183a00={};_0x183a00[_0x34b310[_0x6ecf('0x4a')]]={'$like':'%'+_0x4d8804[_0x6ecf('0x3f')][_0x6ecf('0x46')]+'%'};return _0x183a00;}})});}_0x4a448a=_[_0x6ecf('0x4b')]({},_0x4a448a,_0x4d8804[_0x6ecf('0x4c')]);var _0x10b113={'where':_0x4a448a[_0x6ecf('0x44')]};return db[_0x6ecf('0x4d')][_0x6ecf('0x27')](_0x10b113)['then'](function(_0x2d699e){_0x5820a3['count']=_0x2d699e;if(_0x4d8804[_0x6ecf('0x3f')]['includeAll']){_0x4a448a[_0x6ecf('0x4e')]=[{'all':!![]}];}return db[_0x6ecf('0x4d')][_0x6ecf('0x4f')](_0x4a448a);})[_0x6ecf('0x2e')](function(_0x3dd12e){_0x5820a3[_0x6ecf('0x50')]=_0x3dd12e;return _0x5820a3;})[_0x6ecf('0x2e')](respondWithFilteredResult(_0x5cb2de,_0x4a448a))['catch'](handleError(_0x5cb2de,null));};exports[_0x6ecf('0x51')]=function(_0xdb99af,_0x56a279){var _0x26558b={'raw':![],'where':{'id':_0xdb99af['params']['id']}},_0x3fd7ce={};_0x3fd7ce[_0x6ecf('0x39')]=_['keys'](db[_0x6ecf('0x4d')][_0x6ecf('0x38')]);_0x3fd7ce[_0x6ecf('0x3f')]=_[_0x6ecf('0x3a')](_0xdb99af[_0x6ecf('0x3f')]);_0x3fd7ce[_0x6ecf('0x3b')]=_['intersection'](_0x3fd7ce[_0x6ecf('0x39')],_0x3fd7ce[_0x6ecf('0x3f')]);_0x26558b[_0x6ecf('0x3c')]=_[_0x6ecf('0x3d')](_0x3fd7ce['model'],qs[_0x6ecf('0x3e')](_0xdb99af[_0x6ecf('0x3f')][_0x6ecf('0x3e')]));_0x26558b['attributes']=_0x26558b[_0x6ecf('0x3c')][_0x6ecf('0x52')]?_0x26558b['attributes']:_0x3fd7ce[_0x6ecf('0x39')];if(_0xdb99af[_0x6ecf('0x3f')][_0x6ecf('0x53')]){_0x26558b[_0x6ecf('0x4e')]=[{'all':!![]}];}_0x26558b=_['merge']({},_0x26558b,_0xdb99af[_0x6ecf('0x4c')]);return db[_0x6ecf('0x4d')][_0x6ecf('0x54')](_0x26558b)[_0x6ecf('0x2e')](handleEntityNotFound(_0x56a279,null))['then'](respondWithResult(_0x56a279,null))[_0x6ecf('0x23')](handleError(_0x56a279,null));};exports[_0x6ecf('0x55')]=function(_0x1fd769,_0x30942c,_0x1b65ae){var _0x2f48f1;return db[_0x6ecf('0x4d')][_0x6ecf('0x55')](_0x1fd769[_0x6ecf('0x56')],{'raw':!![]})[_0x6ecf('0x2e')](function(_0x119cfc){_0x2f48f1=_0x119cfc;return db[_0x6ecf('0x4d')][_0x6ecf('0x4f')]({'raw':!![]});})['then'](function(_0x58e861){var _0x2bafd2=fs[_0x6ecf('0x57')](path['join'](config[_0x6ecf('0x58')],_0x6ecf('0x59')),'utf8');var _0x3e8c02=ejs[_0x6ecf('0x5a')](_0x2bafd2,{'contexts':_0x58e861||[]});fs[_0x6ecf('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3e8c02);})['then'](function(){return respondWithRpcPromise('Reload',_0x6ecf('0x55'),{'module':_0x6ecf('0x5c')});})[_0x6ecf('0x2e')](function(){var _0x4b37fe=_0x1fd769[_0x6ecf('0x5d')]['get']({'plain':!![]});if(!_0x4b37fe)throw new Error(_0x6ecf('0x5e'));if(_0x4b37fe[_0x6ecf('0x5f')]===_0x6ecf('0x5d')){var _0x5ebe01=_0x2f48f1[_0x6ecf('0x30')]({'plain':!![]});return db[_0x6ecf('0x60')]['find']({'where':{'name':_0x6ecf('0x31'),'userProfileId':_0x4b37fe[_0x6ecf('0x61')]},'raw':!![]})[_0x6ecf('0x2e')](function(_0x1d6022){if(_0x1d6022&&_0x1d6022[_0x6ecf('0x62')]===0x0){return db[_0x6ecf('0x32')][_0x6ecf('0x55')]({'name':_0x5ebe01['name'],'resourceId':_0x5ebe01['id'],'type':_0x1d6022[_0x6ecf('0x35')],'sectionId':_0x1d6022['id']},{})[_0x6ecf('0x2e')](function(){return _0x2f48f1;});}else{return _0x2f48f1;}})[_0x6ecf('0x23')](function(_0x23b481){logger['error'](_0x6ecf('0x63'),_0x23b481);throw _0x23b481;});}return _0x2f48f1;})[_0x6ecf('0x2e')](respondWithResult(_0x30942c,0xc9))[_0x6ecf('0x23')](handleError(_0x30942c,null));};exports[_0x6ecf('0x2d')]=function(_0x1a703d,_0x1c8050,_0x2f401b){var _0x11dd58;return db[_0x6ecf('0x4d')][_0x6ecf('0x54')]({'where':{'id':_0x1a703d[_0x6ecf('0x64')]['id']}})[_0x6ecf('0x2e')](handleEntityNotFound(_0x1c8050,null))[_0x6ecf('0x2e')](saveUpdates(_0x1a703d['body'],null))[_0x6ecf('0x2e')](function(_0x3c1d8b){if(_0x3c1d8b){_0x11dd58=_0x3c1d8b;return db[_0x6ecf('0x4d')][_0x6ecf('0x4f')]({'raw':!![]});}})[_0x6ecf('0x2e')](function(_0x12d0c2){var _0x5cf770=fs[_0x6ecf('0x57')](path[_0x6ecf('0x65')](config[_0x6ecf('0x58')],_0x6ecf('0x59')),'utf8');var _0x4d4e8c=ejs[_0x6ecf('0x5a')](_0x5cf770,{'contexts':_0x12d0c2||[]});fs[_0x6ecf('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4d4e8c);})[_0x6ecf('0x2e')](function(){return respondWithRpcPromise(_0x6ecf('0x66'),_0x6ecf('0x2d'),{'module':_0x6ecf('0x5c')});})[_0x6ecf('0x2e')](function(){return _0x11dd58;})[_0x6ecf('0x2e')](respondWithResult(_0x1c8050,null))[_0x6ecf('0x23')](handleError(_0x1c8050,null));};exports[_0x6ecf('0x2f')]=function(_0x24abe7,_0x36db29,_0x59bea8){var _0x2078fc;return db[_0x6ecf('0x4d')]['find']({'where':{'id':_0x24abe7['params']['id']}})[_0x6ecf('0x2e')](handleEntityNotFound(_0x36db29,null))['then'](removeEntity(_0x36db29,null))[_0x6ecf('0x2e')](function(){return db[_0x6ecf('0x4d')]['findAll']({'raw':!![]});})[_0x6ecf('0x2e')](function(_0x635b70){var _0x29d763=fs[_0x6ecf('0x57')](path[_0x6ecf('0x65')](config[_0x6ecf('0x58')],_0x6ecf('0x59')),'utf8');var _0x266ef5=ejs[_0x6ecf('0x5a')](_0x29d763,{'contexts':_0x635b70});fs[_0x6ecf('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x266ef5);return respondWithRpcPromise('Reload',_0x6ecf('0x2f'),{'module':_0x6ecf('0x5c')});})[_0x6ecf('0x23')](handleError(_0x36db29,null));}; \ No newline at end of file +var _0x15a8=['reject','update','destroy','get','Contexts','UserProfileResource','stack','name','index','VoiceContext','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','show','params','length','find','catch','body','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','create','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','readFileSync','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','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','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','end','status','json','count','offset','Content-Range','apply'];(function(_0x44e214,_0x4490c8){var _0x46d286=function(_0x5f489d){while(--_0x5f489d){_0x44e214['push'](_0x44e214['shift']());}};_0x46d286(++_0x4490c8);}(_0x15a8,0xa4));var _0x815a=function(_0x563b00,_0x513622){_0x563b00=_0x563b00-0x0;var _0x510029=_0x15a8[_0x563b00];return _0x510029;};'use strict';var pdf=require(_0x815a('0x0'));var emlformat=require(_0x815a('0x1'));var rimraf=require(_0x815a('0x2'));var zipdir=require(_0x815a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x815a('0x4'));var BPromise=require(_0x815a('0x5'));var Mustache=require(_0x815a('0x6'));var util=require('util');var path=require(_0x815a('0x7'));var sox=require(_0x815a('0x8'));var csv=require('to-csv');var ejs=require(_0x815a('0x9'));var fs=require('fs');var _=require(_0x815a('0xa'));var squel=require(_0x815a('0xb'));var crypto=require(_0x815a('0xc'));var jsforce=require(_0x815a('0xd'));var deskjs=require(_0x815a('0xe'));var toCsv=require(_0x815a('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x815a('0x10'));var authService=require(_0x815a('0x11'));var qs=require(_0x815a('0x12'));var hardwareService=require(_0x815a('0x13'));var logger=require(_0x815a('0x14'))(_0x815a('0x15'));var utils=require(_0x815a('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x815a('0x17'));var client=jayson[_0x815a('0x18')][_0x815a('0x19')]({'port':0x232a});function checkPasswordPattern(_0x17bd9c,_0xec327e,_0x366894){if(_0x366894){var _0x4b68cd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4b68cd[_0x815a('0x1a')](_0xec327e)){return _0x17bd9c;}else{throw new Error(_0x815a('0x1b'));}}else{return _0x17bd9c;}}function respondWithRpcPromise(_0x385fdb,_0x36dc48,_0x2e1d35,_0x3af140){return new BPromise(function(_0x30fb2a,_0x51dd3f){var _0x2ba2bd=_0x3af140||client;return _0x2ba2bd[_0x815a('0x1c')](_0x385fdb,_0x2e1d35)[_0x815a('0x1d')](function(_0x2d2d37){logger['info'](_0x815a('0x1e'),_0x36dc48,_0x815a('0x1f'));logger[_0x815a('0x20')](_0x815a('0x21'),_0x36dc48,_0x815a('0x1f'),JSON[_0x815a('0x22')](_0x2d2d37));if(_0x2d2d37[_0x815a('0x23')]){if(_0x2d2d37[_0x815a('0x23')][_0x815a('0x24')]===0x1f4){logger[_0x815a('0x23')]('VoiceContext,\x20%s,\x20%s',_0x36dc48,_0x2d2d37[_0x815a('0x23')][_0x815a('0x25')]);return _0x51dd3f(_0x2d2d37['error'][_0x815a('0x25')]);}logger[_0x815a('0x23')](_0x815a('0x1e'),_0x36dc48,_0x2d2d37[_0x815a('0x23')]['message']);return _0x30fb2a(_0x2d2d37[_0x815a('0x23')][_0x815a('0x25')]);}else{logger[_0x815a('0x26')](_0x815a('0x1e'),_0x36dc48,_0x815a('0x1f'));_0x30fb2a(_0x2d2d37[_0x815a('0x27')]['message']);}})['catch'](function(_0xc1927c){logger[_0x815a('0x23')]('VoiceContext,\x20%s,\x20%s',_0x36dc48,_0xc1927c);_0x51dd3f(_0xc1927c);});});}function respondWithStatusCode(_0x37aab9,_0x471484){_0x471484=_0x471484||0xcc;return function(_0x43fe13){if(_0x43fe13){return _0x37aab9[_0x815a('0x28')](_0x471484);}return _0x37aab9['status'](_0x471484)[_0x815a('0x29')]();};}function respondWithResult(_0x59da7d,_0x511816){_0x511816=_0x511816||0xc8;return function(_0x151505){if(_0x151505){return _0x59da7d[_0x815a('0x2a')](_0x511816)[_0x815a('0x2b')](_0x151505);}};}function respondWithFilteredResult(_0x13730a,_0x1e9d69){return function(_0x4967f8){if(_0x4967f8){var _0x33e8b1=_0x4967f8[_0x815a('0x2c')],_0x3c0e8f=_0x1e9d69[_0x815a('0x2d')],_0x17f2fb=_0x1e9d69['offset']+_0x1e9d69['limit'],_0x657950;if(_0x17f2fb>=_0x33e8b1){_0x17f2fb=_0x33e8b1;_0x657950=0xc8;}else{_0x657950=0xce;}_0x13730a[_0x815a('0x2a')](_0x657950);return _0x13730a['set'](_0x815a('0x2e'),_0x3c0e8f+'-'+_0x17f2fb+'/'+_0x33e8b1)[_0x815a('0x2b')](_0x4967f8);}return null;};}function patchUpdates(_0x155def){return function(_0x2ab181){try{jsonpatch[_0x815a('0x2f')](_0x2ab181,_0x155def,!![]);}catch(_0x1902f6){return BPromise[_0x815a('0x30')](_0x1902f6);}return _0x2ab181['save']();};}function saveUpdates(_0x48457e,_0x55247d){return function(_0x1ceb38){if(_0x1ceb38){return _0x1ceb38[_0x815a('0x31')](_0x48457e)['then'](function(_0x32490a){return _0x32490a;});}return null;};}function removeEntity(_0x26f1d0,_0xe21bca){return function(_0x24acb9){if(_0x24acb9){return _0x24acb9[_0x815a('0x32')]()[_0x815a('0x1d')](function(){var _0x3067c0=_0x24acb9[_0x815a('0x33')]({'plain':!![]});var _0x440bf6=_0x815a('0x34');return db[_0x815a('0x35')]['destroy']({'where':{'type':_0x440bf6,'resourceId':_0x3067c0['id']}})[_0x815a('0x1d')](function(){return _0x24acb9;});})[_0x815a('0x1d')](function(){_0x26f1d0[_0x815a('0x2a')](0xcc)[_0x815a('0x29')]();});}};}function handleEntityNotFound(_0x53b843,_0x4034bf){return function(_0x6221ec){if(!_0x6221ec){_0x53b843['sendStatus'](0x194);}return _0x6221ec;};}function handleError(_0x15ef4f,_0x4dd207){_0x4dd207=_0x4dd207||0x1f4;return function(_0x2a03ae){logger['error'](_0x2a03ae[_0x815a('0x36')]);if(_0x2a03ae[_0x815a('0x37')]){delete _0x2a03ae[_0x815a('0x37')];}_0x15ef4f[_0x815a('0x2a')](_0x4dd207)['send'](_0x2a03ae);};}exports[_0x815a('0x38')]=function(_0x4e5581,_0x8b43bf){var _0x40de1b={},_0x5c6b6a={},_0xcd4145={'count':0x0,'rows':[]};var _0x274c7b=db[_0x815a('0x39')][_0x815a('0x3a')];_0x5c6b6a[_0x815a('0x3b')]=_[_0x815a('0x3c')](_0x274c7b);_0x5c6b6a['query']=_[_0x815a('0x3c')](_0x4e5581[_0x815a('0x3d')]);_0x5c6b6a[_0x815a('0x3e')]=_[_0x815a('0x3f')](_0x5c6b6a[_0x815a('0x3b')],_0x5c6b6a[_0x815a('0x3d')]);_0x40de1b['attributes']=_[_0x815a('0x3f')](_0x5c6b6a['model'],qs['fields'](_0x4e5581[_0x815a('0x3d')][_0x815a('0x40')]));_0x40de1b[_0x815a('0x41')]=_0x40de1b[_0x815a('0x41')]['length']?_0x40de1b[_0x815a('0x41')]:_0x5c6b6a[_0x815a('0x3b')];if(!_0x4e5581[_0x815a('0x3d')][_0x815a('0x42')](_0x815a('0x43'))){_0x40de1b['limit']=qs['limit'](_0x4e5581['query'][_0x815a('0x44')]);_0x40de1b[_0x815a('0x2d')]=qs['offset'](_0x4e5581[_0x815a('0x3d')][_0x815a('0x2d')]);}_0x40de1b[_0x815a('0x45')]=qs[_0x815a('0x46')](_0x4e5581[_0x815a('0x3d')][_0x815a('0x46')]);_0x40de1b[_0x815a('0x47')]=qs[_0x815a('0x3e')](_[_0x815a('0x48')](_0x4e5581[_0x815a('0x3d')],_0x5c6b6a[_0x815a('0x3e')]));if(_0x4e5581[_0x815a('0x3d')]['filter']){_0x40de1b[_0x815a('0x47')]=_[_0x815a('0x49')](_0x40de1b[_0x815a('0x47')],{'$or':_['map'](_0x274c7b,function(_0x19f8d9){if(_0x19f8d9[_0x815a('0x4a')][_0x815a('0x4b')]!==_0x815a('0x4c')){var _0x4c3d93={};_0x4c3d93[_0x19f8d9[_0x815a('0x4d')]]={'$like':'%'+_0x4e5581[_0x815a('0x3d')][_0x815a('0x4e')]+'%'};return _0x4c3d93;}})});}_0x40de1b=_[_0x815a('0x49')]({},_0x40de1b,_0x4e5581[_0x815a('0x4f')]);var _0x15188c={'where':_0x40de1b[_0x815a('0x47')]};return db[_0x815a('0x39')]['count'](_0x15188c)['then'](function(_0x80fe69){_0xcd4145['count']=_0x80fe69;if(_0x4e5581[_0x815a('0x3d')][_0x815a('0x50')]){_0x40de1b[_0x815a('0x51')]=[{'all':!![]}];}return db[_0x815a('0x39')][_0x815a('0x52')](_0x40de1b);})[_0x815a('0x1d')](function(_0x429684){_0xcd4145[_0x815a('0x53')]=_0x429684;return _0xcd4145;})[_0x815a('0x1d')](respondWithFilteredResult(_0x8b43bf,_0x40de1b))['catch'](handleError(_0x8b43bf,null));};exports[_0x815a('0x54')]=function(_0x438ee1,_0x2ce1cf){var _0x2b0d31={'raw':![],'where':{'id':_0x438ee1[_0x815a('0x55')]['id']}},_0x1f0c95={};_0x1f0c95[_0x815a('0x3b')]=_[_0x815a('0x3c')](db[_0x815a('0x39')][_0x815a('0x3a')]);_0x1f0c95[_0x815a('0x3d')]=_[_0x815a('0x3c')](_0x438ee1['query']);_0x1f0c95[_0x815a('0x3e')]=_[_0x815a('0x3f')](_0x1f0c95[_0x815a('0x3b')],_0x1f0c95[_0x815a('0x3d')]);_0x2b0d31['attributes']=_[_0x815a('0x3f')](_0x1f0c95[_0x815a('0x3b')],qs[_0x815a('0x40')](_0x438ee1[_0x815a('0x3d')][_0x815a('0x40')]));_0x2b0d31[_0x815a('0x41')]=_0x2b0d31['attributes'][_0x815a('0x56')]?_0x2b0d31[_0x815a('0x41')]:_0x1f0c95[_0x815a('0x3b')];if(_0x438ee1['query'][_0x815a('0x50')]){_0x2b0d31[_0x815a('0x51')]=[{'all':!![]}];}_0x2b0d31=_[_0x815a('0x49')]({},_0x2b0d31,_0x438ee1[_0x815a('0x4f')]);return db[_0x815a('0x39')][_0x815a('0x57')](_0x2b0d31)[_0x815a('0x1d')](handleEntityNotFound(_0x2ce1cf,null))[_0x815a('0x1d')](respondWithResult(_0x2ce1cf,null))[_0x815a('0x58')](handleError(_0x2ce1cf,null));};exports['create']=function(_0x29217d,_0x1170bf,_0x268a49){var _0x43fc87;return db[_0x815a('0x39')]['create'](_0x29217d[_0x815a('0x59')],{'raw':!![]})[_0x815a('0x1d')](function(_0x34cf90){_0x43fc87=_0x34cf90;return db[_0x815a('0x39')][_0x815a('0x52')]({'raw':!![]});})[_0x815a('0x1d')](function(_0x3230e9){var _0x461064=fs['readFileSync'](path[_0x815a('0x5a')](config[_0x815a('0x5b')],_0x815a('0x5c')),_0x815a('0x5d'));var _0x55457d=ejs[_0x815a('0x5e')](_0x461064,{'contexts':_0x3230e9||[]});fs[_0x815a('0x5f')](_0x815a('0x60'),_0x55457d);})[_0x815a('0x1d')](function(){return respondWithRpcPromise(_0x815a('0x61'),_0x815a('0x62'),{'module':_0x815a('0x63')});})[_0x815a('0x1d')](function(){var _0x320704=_0x29217d[_0x815a('0x64')][_0x815a('0x33')]({'plain':!![]});if(!_0x320704)throw new Error(_0x815a('0x65'));if(_0x320704[_0x815a('0x66')]===_0x815a('0x64')){var _0x465c9b=_0x43fc87[_0x815a('0x33')]({'plain':!![]});return db[_0x815a('0x67')][_0x815a('0x57')]({'where':{'name':_0x815a('0x34'),'userProfileId':_0x320704['userProfileId']},'raw':!![]})['then'](function(_0x5e36bb){if(_0x5e36bb&&_0x5e36bb[_0x815a('0x68')]===0x0){return db[_0x815a('0x35')][_0x815a('0x62')]({'name':_0x465c9b['name'],'resourceId':_0x465c9b['id'],'type':_0x5e36bb[_0x815a('0x37')],'sectionId':_0x5e36bb['id']},{})['then'](function(){return _0x43fc87;});}else{return _0x43fc87;}})[_0x815a('0x58')](function(_0x2d6264){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d6264);throw _0x2d6264;});}return _0x43fc87;})[_0x815a('0x1d')](respondWithResult(_0x1170bf,0xc9))[_0x815a('0x58')](handleError(_0x1170bf,null));};exports['update']=function(_0x454e8c,_0x48c71e,_0x1797c1){var _0x268bab;return db[_0x815a('0x39')][_0x815a('0x57')]({'where':{'id':_0x454e8c[_0x815a('0x55')]['id']}})[_0x815a('0x1d')](handleEntityNotFound(_0x48c71e,null))[_0x815a('0x1d')](saveUpdates(_0x454e8c[_0x815a('0x59')],null))[_0x815a('0x1d')](function(_0x464750){if(_0x464750){_0x268bab=_0x464750;return db['VoiceContext'][_0x815a('0x52')]({'raw':!![]});}})['then'](function(_0x33971b){var _0x70c589=fs[_0x815a('0x69')](path[_0x815a('0x5a')](config['root'],'server/files/templates/context.ejs'),_0x815a('0x5d'));var _0x5dadce=ejs[_0x815a('0x5e')](_0x70c589,{'contexts':_0x33971b||[]});fs[_0x815a('0x5f')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x5dadce);})[_0x815a('0x1d')](function(){return respondWithRpcPromise('Reload',_0x815a('0x31'),{'module':'chan_sip.so'});})[_0x815a('0x1d')](function(){return _0x268bab;})[_0x815a('0x1d')](respondWithResult(_0x48c71e,null))[_0x815a('0x58')](handleError(_0x48c71e,null));};exports[_0x815a('0x32')]=function(_0x2d5e9c,_0x450deb,_0x1141d9){var _0x2b9f0d;return db[_0x815a('0x39')][_0x815a('0x57')]({'where':{'id':_0x2d5e9c['params']['id']}})[_0x815a('0x1d')](handleEntityNotFound(_0x450deb,null))[_0x815a('0x1d')](removeEntity(_0x450deb,null))[_0x815a('0x1d')](function(){return db[_0x815a('0x39')][_0x815a('0x52')]({'raw':!![]});})[_0x815a('0x1d')](function(_0x4a9703){var _0x4bb5e4=fs[_0x815a('0x69')](path[_0x815a('0x5a')](config[_0x815a('0x5b')],'server/files/templates/context.ejs'),'utf8');var _0x9c397a=ejs[_0x815a('0x5e')](_0x4bb5e4,{'contexts':_0x4a9703});fs[_0x815a('0x5f')](_0x815a('0x60'),_0x9c397a);return respondWithRpcPromise('Reload',_0x815a('0x32'),{'module':_0x815a('0x63')});})[_0x815a('0x58')](handleError(_0x450deb,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 9f97a09..483dda1 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 _0x9127=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','VoiceContext','voice_contexts','lodash','../../config/logger'];(function(_0x25f38d,_0x49b63b){var _0x3686c2=function(_0x2bf1ff){while(--_0x2bf1ff){_0x25f38d['push'](_0x25f38d['shift']());}};_0x3686c2(++_0x49b63b);}(_0x9127,0x15d));var _0x7912=function(_0x4aac5a,_0x15b04c){_0x4aac5a=_0x4aac5a-0x0;var _0x42e7bc=_0x9127[_0x4aac5a];return _0x42e7bc;};'use strict';var _=require(_0x7912('0x0'));var util=require('util');var logger=require(_0x7912('0x1'))(_0x7912('0x2'));var moment=require(_0x7912('0x3'));var BPromise=require(_0x7912('0x4'));var rp=require(_0x7912('0x5'));var fs=require('fs');var path=require(_0x7912('0x6'));var rimraf=require(_0x7912('0x7'));var config=require(_0x7912('0x8'));var attributes=require(_0x7912('0x9'));module[_0x7912('0xa')]=function(_0xac638b,_0x343b26){return _0xac638b['define'](_0x7912('0xb'),attributes,{'tableName':_0x7912('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75c0=['../../config/environment','./voiceContext.attributes','define','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x22d7e6,_0xa620e7){var _0x72bc58=function(_0x2c75f6){while(--_0x2c75f6){_0x22d7e6['push'](_0x22d7e6['shift']());}};_0x72bc58(++_0xa620e7);}(_0x75c0,0x1cf));var _0x075c=function(_0x49f1b4,_0x4dbe76){_0x49f1b4=_0x49f1b4-0x0;var _0xf341d9=_0x75c0[_0x49f1b4];return _0xf341d9;};'use strict';var _=require(_0x075c('0x0'));var util=require(_0x075c('0x1'));var logger=require(_0x075c('0x2'))('api');var moment=require(_0x075c('0x3'));var BPromise=require(_0x075c('0x4'));var rp=require(_0x075c('0x5'));var fs=require('fs');var path=require(_0x075c('0x6'));var rimraf=require('rimraf');var config=require(_0x075c('0x7'));var attributes=require(_0x075c('0x8'));module['exports']=function(_0x370920,_0x5f4ce9){return _0x370920[_0x075c('0x9')]('VoiceContext',attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 81e6a3f..274dbee 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 _0x46fa=['result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x46fa,0xde));var _0xa46f=function(_0x2a35e5,_0x2ac062){_0x2a35e5=_0x2a35e5-0x0;var _0x3ddfc0=_0x46fa[_0x2a35e5];return _0x3ddfc0;};'use strict';var _=require(_0xa46f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa46f('0x1'));var fs=require('fs');var Redis=require(_0xa46f('0x2'));var db=require(_0xa46f('0x3'))['db'];var utils=require(_0xa46f('0x4'));var logger=require('../../config/logger')(_0xa46f('0x5'));var config=require(_0xa46f('0x6'));var jayson=require(_0xa46f('0x7'));var client=jayson['client'][_0xa46f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb732a4,_0x52d8b1,_0x148720){return new BPromise(function(_0x379752,_0x593249){return client[_0xa46f('0x9')](_0xb732a4,_0x148720)[_0xa46f('0xa')](function(_0x5b5f37){logger[_0xa46f('0xb')](_0xa46f('0xc'),_0x52d8b1,_0xa46f('0xd'));logger[_0xa46f('0xe')](_0xa46f('0xf'),_0x52d8b1,'request\x20sent',JSON['stringify'](_0x5b5f37));if(_0x5b5f37[_0xa46f('0x10')]){if(_0x5b5f37[_0xa46f('0x10')]['code']===0x1f4){logger[_0xa46f('0x10')]('VoiceContext,\x20%s,\x20%s',_0x52d8b1,_0x5b5f37['error']['message']);return _0x593249(_0x5b5f37[_0xa46f('0x10')][_0xa46f('0x11')]);}logger[_0xa46f('0x10')](_0xa46f('0xc'),_0x52d8b1,_0x5b5f37[_0xa46f('0x10')][_0xa46f('0x11')]);return _0x379752(_0x5b5f37[_0xa46f('0x10')][_0xa46f('0x11')]);}else{logger[_0xa46f('0xb')](_0xa46f('0xc'),_0x52d8b1,_0xa46f('0xd'));_0x379752(_0x5b5f37[_0xa46f('0x12')][_0xa46f('0x11')]);}})[_0xa46f('0x13')](function(_0x576e25){logger[_0xa46f('0x10')](_0xa46f('0xc'),_0x52d8b1,_0x576e25);_0x593249(_0x576e25);});});} \ No newline at end of file +var _0xdbad=['message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s'];(function(_0x45d240,_0x34912f){var _0x2562ff=function(_0x263eca){while(--_0x263eca){_0x45d240['push'](_0x45d240['shift']());}};_0x2562ff(++_0x34912f);}(_0xdbad,0x87));var _0xddba=function(_0x5c7b08,_0x4a1dbc){_0x5c7b08=_0x5c7b08-0x0;var _0x2fecb0=_0xdbad[_0x5c7b08];return _0x2fecb0;};'use strict';var _=require(_0xddba('0x0'));var util=require(_0xddba('0x1'));var moment=require('moment');var BPromise=require(_0xddba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddba('0x3'));var db=require(_0xddba('0x4'))['db'];var utils=require(_0xddba('0x5'));var logger=require(_0xddba('0x6'))(_0xddba('0x7'));var config=require(_0xddba('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xddba('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568093,_0x152216,_0x592007){return new BPromise(function(_0x2a5340,_0x30ad61){return client['request'](_0x568093,_0x592007)[_0xddba('0xa')](function(_0x5017e9){logger[_0xddba('0xb')]('VoiceContext,\x20%s,\x20%s',_0x152216,_0xddba('0xc'));logger[_0xddba('0xd')](_0xddba('0xe'),_0x152216,'request\x20sent',JSON[_0xddba('0xf')](_0x5017e9));if(_0x5017e9[_0xddba('0x10')]){if(_0x5017e9[_0xddba('0x10')][_0xddba('0x11')]===0x1f4){logger[_0xddba('0x10')](_0xddba('0x12'),_0x152216,_0x5017e9[_0xddba('0x10')][_0xddba('0x13')]);return _0x30ad61(_0x5017e9[_0xddba('0x10')][_0xddba('0x13')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x152216,_0x5017e9[_0xddba('0x10')][_0xddba('0x13')]);return _0x2a5340(_0x5017e9[_0xddba('0x10')][_0xddba('0x13')]);}else{logger[_0xddba('0xb')](_0xddba('0x12'),_0x152216,_0xddba('0xc'));_0x2a5340(_0x5017e9[_0xddba('0x14')][_0xddba('0x13')]);}})[_0xddba('0x15')](function(_0x5369b5){logger['error'](_0xddba('0x12'),_0x152216,_0x5369b5);_0x30ad61(_0x5369b5);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 1f01648..734496d 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 _0x2291=['delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','update'];(function(_0x308de4,_0x55b6e2){var _0x5e569f=function(_0x4eb8c1){while(--_0x4eb8c1){_0x308de4['push'](_0x308de4['shift']());}};_0x5e569f(++_0x55b6e2);}(_0x2291,0xad));var _0x1229=function(_0xe8100,_0x39d230){_0xe8100=_0xe8100-0x0;var _0x281e34=_0x2291[_0xe8100];return _0x281e34;};'use strict';var multer=require(_0x1229('0x0'));var util=require(_0x1229('0x1'));var path=require(_0x1229('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1229('0x3')]();var auth=require(_0x1229('0x4'));var interaction=require(_0x1229('0x5'));var config=require(_0x1229('0x6'));var controller=require('./voiceDialReport.controller');router[_0x1229('0x7')]('/',auth['isAuthenticated'](),controller[_0x1229('0x8')]);router['get'](_0x1229('0x9'),auth['isAuthenticated'](),controller[_0x1229('0xa')]);router[_0x1229('0x7')](_0x1229('0xb'),auth[_0x1229('0xc')](),controller[_0x1229('0xd')]);router[_0x1229('0xe')]('/',auth[_0x1229('0xc')](),controller[_0x1229('0xf')]);router['put'](_0x1229('0xb'),auth['isAuthenticated'](),controller[_0x1229('0x10')]);router[_0x1229('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x1229('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0941=['create','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0941,0x1d7));var _0x1094=function(_0x3a15f5,_0x4b9a59){_0x3a15f5=_0x3a15f5-0x0;var _0x5007f0=_0x0941[_0x3a15f5];return _0x5007f0;};'use strict';var multer=require(_0x1094('0x0'));var util=require(_0x1094('0x1'));var path=require(_0x1094('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1094('0x3')]();var auth=require(_0x1094('0x4'));var interaction=require(_0x1094('0x5'));var config=require(_0x1094('0x6'));var controller=require(_0x1094('0x7'));router[_0x1094('0x8')]('/',auth[_0x1094('0x9')](),controller[_0x1094('0xa')]);router['get'](_0x1094('0xb'),auth[_0x1094('0x9')](),controller['describe']);router[_0x1094('0x8')](_0x1094('0xc'),auth[_0x1094('0x9')](),controller[_0x1094('0xd')]);router[_0x1094('0xe')]('/',auth['isAuthenticated'](),controller[_0x1094('0xf')]);router['put'](_0x1094('0xc'),auth[_0x1094('0x9')](),controller['update']);router['delete'](_0x1094('0xc'),auth[_0x1094('0x9')](),controller[_0x1094('0x10')]);module[_0x1094('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 65b45df..0b7c03a 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 _0xc6d5=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x4f09a4,_0x2bef4f){var _0x3a415e=function(_0x1492dd){while(--_0x1492dd){_0x4f09a4['push'](_0x4f09a4['shift']());}};_0x3a415e(++_0x2bef4f);}(_0xc6d5,0x94));var _0x5c6d=function(_0xe74679,_0x3ae67b){_0xe74679=_0xe74679-0x0;var _0x3feb71=_0xc6d5[_0xe74679];return _0x3feb71;};'use strict';var Sequelize=require(_0x5c6d('0x0'));module[_0x5c6d('0x1')]={'privilege':{'type':Sequelize[_0x5c6d('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x5c6d('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x5c6d('0x2')]},'calleridname':{'type':Sequelize[_0x5c6d('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x5c6d('0x2')]},'language':{'type':Sequelize[_0x5c6d('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x5c6d('0x2')]},'exten':{'type':Sequelize[_0x5c6d('0x2')]},'priority':{'type':Sequelize[_0x5c6d('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x5c6d('0x2')]},'destchannel':{'type':Sequelize[_0x5c6d('0x2')]},'destchannelstate':{'type':Sequelize[_0x5c6d('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x5c6d('0x2')]},'destcalleridname':{'type':Sequelize[_0x5c6d('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x5c6d('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x5c6d('0x2')]},'destcontext':{'type':Sequelize[_0x5c6d('0x2')]},'destexten':{'type':Sequelize[_0x5c6d('0x2')]},'destpriority':{'type':Sequelize[_0x5c6d('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x5c6d('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x5c6d('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING'],'comment':_0x5c6d('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x5c6d('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x5c6d('0x3')]}}; \ No newline at end of file +var _0x584a=['INTEGER','DATE','called,connect,complete','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x584a,0x157));var _0xa584=function(_0x3d9312,_0x3363fc){_0x3d9312=_0x3d9312-0x0;var _0x3a0a42=_0x584a[_0x3d9312];return _0x3a0a42;};'use strict';var Sequelize=require(_0xa584('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xa584('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xa584('0x2')]},'channelstatedesc':{'type':Sequelize[_0xa584('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa584('0x1')]},'connectedlinenum':{'type':Sequelize[_0xa584('0x1')]},'connectedlinename':{'type':Sequelize[_0xa584('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa584('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xa584('0x1')]},'linkedid':{'type':Sequelize[_0xa584('0x1')]},'destchannel':{'type':Sequelize[_0xa584('0x1')]},'destchannelstate':{'type':Sequelize[_0xa584('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xa584('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xa584('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xa584('0x1')]},'destexten':{'type':Sequelize[_0xa584('0x1')]},'destpriority':{'type':Sequelize[_0xa584('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0xa584('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa584('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xa584('0x4')},'routeId':{'type':Sequelize[_0xa584('0x2')]},'duration':{'type':Sequelize[_0xa584('0x2')]},'holdtime':{'type':Sequelize[_0xa584('0x2')]},'billableseconds':{'type':Sequelize[_0xa584('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index fff72a1..315b1e4 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 _0x26d0=['field','options','includeAll','include','findAll','catch','show','params','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','stack','name','send','VoiceDialReport','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL'];(function(_0x1bda24,_0x1fed72){var _0xa6e918=function(_0x18d6ab){while(--_0x18d6ab){_0x1bda24['push'](_0x1bda24['shift']());}};_0xa6e918(++_0x1fed72);}(_0x26d0,0x169));var _0x026d=function(_0x248b03,_0x34fdd9){_0x248b03=_0x248b03-0x0;var _0x48f071=_0x26d0[_0x248b03];return _0x48f071;};'use strict';var pdf=require(_0x026d('0x0'));var emlformat=require(_0x026d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x026d('0x2'));var jsonpatch=require(_0x026d('0x3'));var rp=require(_0x026d('0x4'));var moment=require(_0x026d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x026d('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x026d('0x7'));var ejs=require(_0x026d('0x8'));var fs=require('fs');var _=require(_0x026d('0x9'));var squel=require(_0x026d('0xa'));var crypto=require(_0x026d('0xb'));var jsforce=require(_0x026d('0xc'));var deskjs=require(_0x026d('0xd'));var toCsv=require(_0x026d('0x7'));var querystring=require(_0x026d('0xe'));var Papa=require(_0x026d('0xf'));var Redis=require(_0x026d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x026d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x026d('0x12'));var utils=require(_0x026d('0x13'));var config=require(_0x026d('0x14'));var db=require(_0x026d('0x15'))['db'];function respondWithStatusCode(_0x39f0ff,_0x541a6b){_0x541a6b=_0x541a6b||0xcc;return function(_0x10734b){if(_0x10734b){return _0x39f0ff[_0x026d('0x16')](_0x541a6b);}return _0x39f0ff[_0x026d('0x17')](_0x541a6b)['end']();};}function respondWithResult(_0x2c9c6a,_0x572f4a){_0x572f4a=_0x572f4a||0xc8;return function(_0x51a6a0){if(_0x51a6a0){return _0x2c9c6a[_0x026d('0x17')](_0x572f4a)[_0x026d('0x18')](_0x51a6a0);}};}function respondWithFilteredResult(_0x5a83c0,_0x240025){return function(_0x3733de){if(_0x3733de){var _0xd590f1=_0x3733de[_0x026d('0x19')],_0x2b0124=_0x240025[_0x026d('0x1a')],_0x222091=_0x240025['offset']+_0x240025[_0x026d('0x1b')],_0x5ef800;if(_0x222091>=_0xd590f1){_0x222091=_0xd590f1;_0x5ef800=0xc8;}else{_0x5ef800=0xce;}_0x5a83c0[_0x026d('0x17')](_0x5ef800);return _0x5a83c0['set'](_0x026d('0x1c'),_0x2b0124+'-'+_0x222091+'/'+_0xd590f1)[_0x026d('0x18')](_0x3733de);}return null;};}function patchUpdates(_0x525626){return function(_0x249a5a){try{jsonpatch[_0x026d('0x1d')](_0x249a5a,_0x525626,!![]);}catch(_0x119271){return BPromise[_0x026d('0x1e')](_0x119271);}return _0x249a5a['save']();};}function saveUpdates(_0x3512c8,_0x5bb6dc){return function(_0x18f744){if(_0x18f744){return _0x18f744[_0x026d('0x1f')](_0x3512c8)[_0x026d('0x20')](function(_0x313db6){return _0x313db6;});}return null;};}function removeEntity(_0x152f1c,_0x442fb1){return function(_0xd9dbd6){if(_0xd9dbd6){return _0xd9dbd6[_0x026d('0x21')]()[_0x026d('0x20')](function(){_0x152f1c[_0x026d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ad391,_0x1ac10c){return function(_0x31125c){if(!_0x31125c){_0x2ad391[_0x026d('0x16')](0x194);}return _0x31125c;};}function handleError(_0x4ffb69,_0x3ececa){_0x3ececa=_0x3ececa||0x1f4;return function(_0x50f0fc){logger['error'](_0x50f0fc[_0x026d('0x22')]);if(_0x50f0fc['name']){delete _0x50f0fc[_0x026d('0x23')];}_0x4ffb69['status'](_0x3ececa)[_0x026d('0x24')](_0x50f0fc);};}exports['index']=function(_0xef2381,_0x37cbb6){var _0x14af3d={},_0x51a6ce={},_0x15263a={'count':0x0,'rows':[]};var _0x5b279f=db[_0x026d('0x25')][_0x026d('0x26')];_0x51a6ce[_0x026d('0x27')]=_['keys'](_0x5b279f);_0x51a6ce[_0x026d('0x28')]=_[_0x026d('0x29')](_0xef2381['query']);_0x51a6ce[_0x026d('0x2a')]=_['intersection'](_0x51a6ce[_0x026d('0x27')],_0x51a6ce[_0x026d('0x28')]);_0x14af3d[_0x026d('0x2b')]=_[_0x026d('0x2c')](_0x51a6ce[_0x026d('0x27')],qs[_0x026d('0x2d')](_0xef2381[_0x026d('0x28')]['fields']));_0x14af3d[_0x026d('0x2b')]=_0x14af3d[_0x026d('0x2b')][_0x026d('0x2e')]?_0x14af3d[_0x026d('0x2b')]:_0x51a6ce['model'];if(!_0xef2381[_0x026d('0x28')][_0x026d('0x2f')](_0x026d('0x30'))){_0x14af3d[_0x026d('0x1b')]=qs[_0x026d('0x1b')](_0xef2381[_0x026d('0x28')]['limit']);_0x14af3d[_0x026d('0x1a')]=qs[_0x026d('0x1a')](_0xef2381[_0x026d('0x28')]['offset']);}_0x14af3d[_0x026d('0x31')]=qs[_0x026d('0x32')](_0xef2381[_0x026d('0x28')]['sort']);_0x14af3d['where']=qs[_0x026d('0x2a')](_[_0x026d('0x33')](_0xef2381[_0x026d('0x28')],_0x51a6ce[_0x026d('0x2a')]));if(_0xef2381[_0x026d('0x28')][_0x026d('0x34')]){_0x14af3d[_0x026d('0x35')]=_[_0x026d('0x36')](_0x14af3d[_0x026d('0x35')],{'$or':_[_0x026d('0x37')](_0x5b279f,function(_0xe363ef){if(_0xe363ef[_0x026d('0x38')][_0x026d('0x39')]!==_0x026d('0x3a')){var _0x2b1dc7={};_0x2b1dc7[_0xe363ef[_0x026d('0x3b')]]={'$like':'%'+_0xef2381[_0x026d('0x28')][_0x026d('0x34')]+'%'};return _0x2b1dc7;}})});}_0x14af3d=_[_0x026d('0x36')]({},_0x14af3d,_0xef2381[_0x026d('0x3c')]);var _0x1025c5={'where':_0x14af3d[_0x026d('0x35')]};return db['VoiceDialReport'][_0x026d('0x19')](_0x1025c5)['then'](function(_0x384e52){_0x15263a[_0x026d('0x19')]=_0x384e52;if(_0xef2381[_0x026d('0x28')][_0x026d('0x3d')]){_0x14af3d[_0x026d('0x3e')]=[{'all':!![]}];}return db[_0x026d('0x25')][_0x026d('0x3f')](_0x14af3d);})[_0x026d('0x20')](function(_0x30059b){_0x15263a['rows']=_0x30059b;return _0x15263a;})[_0x026d('0x20')](respondWithFilteredResult(_0x37cbb6,_0x14af3d))[_0x026d('0x40')](handleError(_0x37cbb6,null));};exports[_0x026d('0x41')]=function(_0x3a94a0,_0x5562f2){var _0x36dbae={'raw':!![],'where':{'id':_0x3a94a0[_0x026d('0x42')]['id']}},_0x546fa8={};_0x546fa8[_0x026d('0x27')]=_[_0x026d('0x29')](db[_0x026d('0x25')]['rawAttributes']);_0x546fa8['query']=_[_0x026d('0x29')](_0x3a94a0['query']);_0x546fa8[_0x026d('0x2a')]=_[_0x026d('0x2c')](_0x546fa8['model'],_0x546fa8[_0x026d('0x28')]);_0x36dbae['attributes']=_[_0x026d('0x2c')](_0x546fa8['model'],qs[_0x026d('0x2d')](_0x3a94a0[_0x026d('0x28')][_0x026d('0x2d')]));_0x36dbae['attributes']=_0x36dbae[_0x026d('0x2b')][_0x026d('0x2e')]?_0x36dbae[_0x026d('0x2b')]:_0x546fa8['model'];if(_0x3a94a0[_0x026d('0x28')][_0x026d('0x3d')]){_0x36dbae[_0x026d('0x3e')]=[{'all':!![]}];}_0x36dbae=_[_0x026d('0x36')]({},_0x36dbae,_0x3a94a0['options']);return db[_0x026d('0x25')][_0x026d('0x43')](_0x36dbae)[_0x026d('0x20')](handleEntityNotFound(_0x5562f2,null))['then'](respondWithResult(_0x5562f2,null))[_0x026d('0x40')](handleError(_0x5562f2,null));};exports[_0x026d('0x44')]=function(_0x267a5a,_0x26b196){return db[_0x026d('0x25')][_0x026d('0x44')](_0x267a5a[_0x026d('0x45')],{})[_0x026d('0x20')](respondWithResult(_0x26b196,0xc9))['catch'](handleError(_0x26b196,null));};exports[_0x026d('0x1f')]=function(_0x44a2c5,_0x252618){if(_0x44a2c5[_0x026d('0x45')]['id']){delete _0x44a2c5[_0x026d('0x45')]['id'];}return db[_0x026d('0x25')][_0x026d('0x43')]({'where':{'id':_0x44a2c5[_0x026d('0x42')]['id']}})[_0x026d('0x20')](handleEntityNotFound(_0x252618,null))[_0x026d('0x20')](saveUpdates(_0x44a2c5[_0x026d('0x45')],null))[_0x026d('0x20')](respondWithResult(_0x252618,null))[_0x026d('0x40')](handleError(_0x252618,null));};exports['destroy']=function(_0x5b13aa,_0x4d79a7){return db[_0x026d('0x25')][_0x026d('0x43')]({'where':{'id':_0x5b13aa[_0x026d('0x42')]['id']}})['then'](handleEntityNotFound(_0x4d79a7,null))[_0x026d('0x20')](removeEntity(_0x4d79a7,null))[_0x026d('0x40')](handleError(_0x4d79a7,null));};exports['describe']=function(_0x177e75,_0x1d3a55){return db[_0x026d('0x25')]['describe']()[_0x026d('0x20')](respondWithResult(_0x1d3a55,null))[_0x026d('0x40')](handleError(_0x1d3a55,null));}; \ No newline at end of file +var _0x9298=['pick','filter','where','merge','map','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','then','error','stack','send','index','VoiceDialReport','rawAttributes','model','query','keys','attributes','intersection','fields','length','order','sort','filters'];(function(_0x38abab,_0xf92530){var _0x19ce0e=function(_0x273642){while(--_0x273642){_0x38abab['push'](_0x38abab['shift']());}};_0x19ce0e(++_0xf92530);}(_0x9298,0x1ca));var _0x8929=function(_0x4e5ea2,_0x1cc33c){_0x4e5ea2=_0x4e5ea2-0x0;var _0x347faa=_0x9298[_0x4e5ea2];return _0x347faa;};'use strict';var pdf=require(_0x8929('0x0'));var emlformat=require(_0x8929('0x1'));var rimraf=require(_0x8929('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8929('0x3'));var rp=require(_0x8929('0x4'));var moment=require(_0x8929('0x5'));var BPromise=require(_0x8929('0x6'));var Mustache=require(_0x8929('0x7'));var util=require(_0x8929('0x8'));var path=require('path');var sox=require(_0x8929('0x9'));var csv=require(_0x8929('0xa'));var ejs=require(_0x8929('0xb'));var fs=require('fs');var _=require(_0x8929('0xc'));var squel=require(_0x8929('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8929('0xe'));var Papa=require(_0x8929('0xf'));var Redis=require(_0x8929('0x10'));var authService=require(_0x8929('0x11'));var qs=require(_0x8929('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8929('0x13'))(_0x8929('0x14'));var utils=require(_0x8929('0x15'));var config=require(_0x8929('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x593265,_0xbc4381){_0xbc4381=_0xbc4381||0xcc;return function(_0x5e7fd7){if(_0x5e7fd7){return _0x593265[_0x8929('0x17')](_0xbc4381);}return _0x593265[_0x8929('0x18')](_0xbc4381)[_0x8929('0x19')]();};}function respondWithResult(_0x51a02a,_0x5ea98f){_0x5ea98f=_0x5ea98f||0xc8;return function(_0x1eceec){if(_0x1eceec){return _0x51a02a[_0x8929('0x18')](_0x5ea98f)['json'](_0x1eceec);}};}function respondWithFilteredResult(_0x111791,_0x4d3456){return function(_0x59fbcb){if(_0x59fbcb){var _0x3a3ce7=_0x59fbcb[_0x8929('0x1a')],_0x130853=_0x4d3456[_0x8929('0x1b')],_0xc54b25=_0x4d3456[_0x8929('0x1b')]+_0x4d3456[_0x8929('0x1c')],_0x3506eb;if(_0xc54b25>=_0x3a3ce7){_0xc54b25=_0x3a3ce7;_0x3506eb=0xc8;}else{_0x3506eb=0xce;}_0x111791[_0x8929('0x18')](_0x3506eb);return _0x111791[_0x8929('0x1d')](_0x8929('0x1e'),_0x130853+'-'+_0xc54b25+'/'+_0x3a3ce7)[_0x8929('0x1f')](_0x59fbcb);}return null;};}function patchUpdates(_0x3a67bd){return function(_0x8a315e){try{jsonpatch['apply'](_0x8a315e,_0x3a67bd,!![]);}catch(_0x1c2313){return BPromise[_0x8929('0x20')](_0x1c2313);}return _0x8a315e[_0x8929('0x21')]();};}function saveUpdates(_0x588cc5,_0x15608c){return function(_0x4914d6){if(_0x4914d6){return _0x4914d6[_0x8929('0x22')](_0x588cc5)['then'](function(_0x4f0a82){return _0x4f0a82;});}return null;};}function removeEntity(_0x23e63a,_0x34e4ad){return function(_0x2c023f){if(_0x2c023f){return _0x2c023f[_0x8929('0x23')]()[_0x8929('0x24')](function(){_0x23e63a['status'](0xcc)[_0x8929('0x19')]();});}};}function handleEntityNotFound(_0x4fae90,_0x49c883){return function(_0x3c6c39){if(!_0x3c6c39){_0x4fae90[_0x8929('0x17')](0x194);}return _0x3c6c39;};}function handleError(_0x5e3d08,_0x13e83c){_0x13e83c=_0x13e83c||0x1f4;return function(_0x4ee323){logger[_0x8929('0x25')](_0x4ee323[_0x8929('0x26')]);if(_0x4ee323['name']){delete _0x4ee323['name'];}_0x5e3d08['status'](_0x13e83c)[_0x8929('0x27')](_0x4ee323);};}exports[_0x8929('0x28')]=function(_0x30e07f,_0xba0077){var _0x989ea9={},_0x405d7f={},_0xc021a0={'count':0x0,'rows':[]};var _0x5ddd18=db[_0x8929('0x29')][_0x8929('0x2a')];_0x405d7f[_0x8929('0x2b')]=_['keys'](_0x5ddd18);_0x405d7f[_0x8929('0x2c')]=_[_0x8929('0x2d')](_0x30e07f[_0x8929('0x2c')]);_0x405d7f['filters']=_['intersection'](_0x405d7f['model'],_0x405d7f[_0x8929('0x2c')]);_0x989ea9[_0x8929('0x2e')]=_[_0x8929('0x2f')](_0x405d7f[_0x8929('0x2b')],qs[_0x8929('0x30')](_0x30e07f['query'][_0x8929('0x30')]));_0x989ea9[_0x8929('0x2e')]=_0x989ea9[_0x8929('0x2e')][_0x8929('0x31')]?_0x989ea9[_0x8929('0x2e')]:_0x405d7f[_0x8929('0x2b')];if(!_0x30e07f[_0x8929('0x2c')]['hasOwnProperty']('nolimit')){_0x989ea9['limit']=qs[_0x8929('0x1c')](_0x30e07f[_0x8929('0x2c')][_0x8929('0x1c')]);_0x989ea9[_0x8929('0x1b')]=qs[_0x8929('0x1b')](_0x30e07f[_0x8929('0x2c')][_0x8929('0x1b')]);}_0x989ea9[_0x8929('0x32')]=qs['sort'](_0x30e07f[_0x8929('0x2c')][_0x8929('0x33')]);_0x989ea9['where']=qs[_0x8929('0x34')](_[_0x8929('0x35')](_0x30e07f[_0x8929('0x2c')],_0x405d7f[_0x8929('0x34')]));if(_0x30e07f['query'][_0x8929('0x36')]){_0x989ea9[_0x8929('0x37')]=_[_0x8929('0x38')](_0x989ea9[_0x8929('0x37')],{'$or':_[_0x8929('0x39')](_0x5ddd18,function(_0x47a4cf){if(_0x47a4cf['type'][_0x8929('0x3a')]!==_0x8929('0x3b')){var _0x46e173={};_0x46e173[_0x47a4cf[_0x8929('0x3c')]]={'$like':'%'+_0x30e07f['query'][_0x8929('0x36')]+'%'};return _0x46e173;}})});}_0x989ea9=_[_0x8929('0x38')]({},_0x989ea9,_0x30e07f[_0x8929('0x3d')]);var _0xa33b6d={'where':_0x989ea9['where']};return db[_0x8929('0x29')]['count'](_0xa33b6d)[_0x8929('0x24')](function(_0x426801){_0xc021a0['count']=_0x426801;if(_0x30e07f['query'][_0x8929('0x3e')]){_0x989ea9['include']=[{'all':!![]}];}return db[_0x8929('0x29')][_0x8929('0x3f')](_0x989ea9);})['then'](function(_0x1dcca1){_0xc021a0[_0x8929('0x40')]=_0x1dcca1;return _0xc021a0;})[_0x8929('0x24')](respondWithFilteredResult(_0xba0077,_0x989ea9))[_0x8929('0x41')](handleError(_0xba0077,null));};exports[_0x8929('0x42')]=function(_0xba5588,_0x1e6f40){var _0x47b5de={'raw':!![],'where':{'id':_0xba5588[_0x8929('0x43')]['id']}},_0x31c272={};_0x31c272[_0x8929('0x2b')]=_['keys'](db[_0x8929('0x29')][_0x8929('0x2a')]);_0x31c272[_0x8929('0x2c')]=_[_0x8929('0x2d')](_0xba5588['query']);_0x31c272[_0x8929('0x34')]=_['intersection'](_0x31c272[_0x8929('0x2b')],_0x31c272[_0x8929('0x2c')]);_0x47b5de[_0x8929('0x2e')]=_[_0x8929('0x2f')](_0x31c272['model'],qs['fields'](_0xba5588['query'][_0x8929('0x30')]));_0x47b5de['attributes']=_0x47b5de[_0x8929('0x2e')][_0x8929('0x31')]?_0x47b5de[_0x8929('0x2e')]:_0x31c272[_0x8929('0x2b')];if(_0xba5588[_0x8929('0x2c')]['includeAll']){_0x47b5de[_0x8929('0x44')]=[{'all':!![]}];}_0x47b5de=_[_0x8929('0x38')]({},_0x47b5de,_0xba5588[_0x8929('0x3d')]);return db[_0x8929('0x29')][_0x8929('0x45')](_0x47b5de)['then'](handleEntityNotFound(_0x1e6f40,null))['then'](respondWithResult(_0x1e6f40,null))[_0x8929('0x41')](handleError(_0x1e6f40,null));};exports['create']=function(_0x30c926,_0x1ffbc4){return db[_0x8929('0x29')][_0x8929('0x46')](_0x30c926[_0x8929('0x47')],{})[_0x8929('0x24')](respondWithResult(_0x1ffbc4,0xc9))[_0x8929('0x41')](handleError(_0x1ffbc4,null));};exports[_0x8929('0x22')]=function(_0x591398,_0x5bdc6a){if(_0x591398[_0x8929('0x47')]['id']){delete _0x591398[_0x8929('0x47')]['id'];}return db[_0x8929('0x29')]['find']({'where':{'id':_0x591398['params']['id']}})[_0x8929('0x24')](handleEntityNotFound(_0x5bdc6a,null))[_0x8929('0x24')](saveUpdates(_0x591398['body'],null))[_0x8929('0x24')](respondWithResult(_0x5bdc6a,null))[_0x8929('0x41')](handleError(_0x5bdc6a,null));};exports[_0x8929('0x23')]=function(_0x29445b,_0x1fa0c7){return db[_0x8929('0x29')][_0x8929('0x45')]({'where':{'id':_0x29445b[_0x8929('0x43')]['id']}})[_0x8929('0x24')](handleEntityNotFound(_0x1fa0c7,null))[_0x8929('0x24')](removeEntity(_0x1fa0c7,null))['catch'](handleError(_0x1fa0c7,null));};exports[_0x8929('0x48')]=function(_0x44d671,_0x3f66d6){return db[_0x8929('0x29')][_0x8929('0x48')]()[_0x8929('0x24')](respondWithResult(_0x3f66d6,null))[_0x8929('0x41')](handleError(_0x3f66d6,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 247625b..62316ee 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 _0x7caa=['lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','uniqueid'];(function(_0x5f4897,_0x3c7d44){var _0x51b12d=function(_0x3ba4e3){while(--_0x3ba4e3){_0x5f4897['push'](_0x5f4897['shift']());}};_0x51b12d(++_0x3c7d44);}(_0x7caa,0xbb));var _0xa7ca=function(_0x30250d,_0x384f12){_0x30250d=_0x30250d-0x0;var _0x297a40=_0x7caa[_0x30250d];return _0x297a40;};'use strict';var _=require(_0xa7ca('0x0'));var util=require(_0xa7ca('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa7ca('0x2'));var rp=require(_0xa7ca('0x3'));var fs=require('fs');var path=require(_0xa7ca('0x4'));var rimraf=require(_0xa7ca('0x5'));var config=require(_0xa7ca('0x6'));var attributes=require(_0xa7ca('0x7'));module[_0xa7ca('0x8')]=function(_0xafbafb,_0x4c602f){return _0xafbafb[_0xa7ca('0x9')]('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xa7ca('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5212=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','uniqueid','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5212,0x1e3));var _0x2521=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x5212[_0x2f9467];return _0x39894c;};'use strict';var _=require(_0x2521('0x0'));var util=require(_0x2521('0x1'));var logger=require('../../config/logger')(_0x2521('0x2'));var moment=require(_0x2521('0x3'));var BPromise=require(_0x2521('0x4'));var rp=require(_0x2521('0x5'));var fs=require('fs');var path=require(_0x2521('0x6'));var rimraf=require(_0x2521('0x7'));var config=require(_0x2521('0x8'));var attributes=require(_0x2521('0x9'));module[_0x2521('0xa')]=function(_0x4d2aa9,_0xb1b3ae){return _0x4d2aa9['define'](_0x2521('0xb'),attributes,{'tableName':_0x2521('0xc'),'paranoid':![],'indexes':[{'fields':[_0x2521('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 ddcdfa9..1618585 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 _0x16e4=['message','VoiceDialReport,\x20%s,\x20%s','result','CreateVoiceDialReport','create','body','options','raw','catch','UpdateVoiceDialReport','VoiceDialReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4c28fa,_0x5313ef){var _0x5e2bbf=function(_0x432bd5){while(--_0x432bd5){_0x4c28fa['push'](_0x4c28fa['shift']());}};_0x5e2bbf(++_0x5313ef);}(_0x16e4,0x97));var _0x416e=function(_0x24be46,_0x50f55d){_0x24be46=_0x24be46-0x0;var _0x4a1d32=_0x16e4[_0x24be46];return _0x4a1d32;};'use strict';var _=require(_0x416e('0x0'));var util=require(_0x416e('0x1'));var moment=require(_0x416e('0x2'));var BPromise=require(_0x416e('0x3'));var rs=require(_0x416e('0x4'));var fs=require('fs');var Redis=require(_0x416e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x416e('0x6'));var logger=require('../../config/logger')(_0x416e('0x7'));var config=require(_0x416e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x416e('0x9')][_0x416e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3431c4,_0x40b8be,_0x1eb20f){return new BPromise(function(_0x962b38,_0x12d57c){return client[_0x416e('0xb')](_0x3431c4,_0x1eb20f)[_0x416e('0xc')](function(_0x47bd90){logger[_0x416e('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x40b8be,_0x416e('0xe'));logger[_0x416e('0xf')](_0x416e('0x10'),_0x40b8be,'request\x20sent',JSON[_0x416e('0x11')](_0x47bd90));if(_0x47bd90[_0x416e('0x12')]){if(_0x47bd90[_0x416e('0x12')]['code']===0x1f4){logger[_0x416e('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x40b8be,_0x47bd90[_0x416e('0x12')][_0x416e('0x13')]);return _0x12d57c(_0x47bd90[_0x416e('0x12')][_0x416e('0x13')]);}logger['error'](_0x416e('0x14'),_0x40b8be,_0x47bd90[_0x416e('0x12')][_0x416e('0x13')]);return _0x962b38(_0x47bd90[_0x416e('0x12')][_0x416e('0x13')]);}else{logger[_0x416e('0xd')](_0x416e('0x14'),_0x40b8be,_0x416e('0xe'));_0x962b38(_0x47bd90[_0x416e('0x15')]['message']);}})['catch'](function(_0x5d8852){logger[_0x416e('0x12')](_0x416e('0x14'),_0x40b8be,_0x5d8852);_0x12d57c(_0x5d8852);});});}exports[_0x416e('0x16')]=function(_0x467e88){var _0x4ed9fc=this;return new Promise(function(_0x1d7931,_0x27d249){return db['VoiceDialReport'][_0x416e('0x17')](_0x467e88[_0x416e('0x18')],{'raw':_0x467e88[_0x416e('0x19')]?_0x467e88[_0x416e('0x19')][_0x416e('0x1a')]===undefined?!![]:![]:!![]})[_0x416e('0xc')](function(_0x2adc62){logger[_0x416e('0xd')](_0x416e('0x16'),_0x467e88);logger[_0x416e('0xf')](_0x416e('0x16'),_0x467e88,JSON['stringify'](_0x2adc62));_0x1d7931(_0x2adc62);})[_0x416e('0x1b')](function(_0x1f062f){logger[_0x416e('0x12')](_0x416e('0x16'),_0x1f062f[_0x416e('0x13')],_0x467e88);_0x27d249(_0x4ed9fc[_0x416e('0x12')](0x1f4,_0x1f062f['message']));});});};exports[_0x416e('0x1c')]=function(_0x3bbbad){var _0x196c11=this;return new Promise(function(_0x5cade9,_0x635540){return db[_0x416e('0x1d')][_0x416e('0x1e')](_0x3bbbad[_0x416e('0x18')],{'raw':_0x3bbbad['options']?_0x3bbbad[_0x416e('0x19')][_0x416e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bbbad[_0x416e('0x19')]?_0x3bbbad[_0x416e('0x19')][_0x416e('0x1f')]||null:null,'attributes':_0x3bbbad[_0x416e('0x19')]?_0x3bbbad[_0x416e('0x19')][_0x416e('0x20')]||null:null,'limit':_0x3bbbad[_0x416e('0x19')]?_0x3bbbad['options'][_0x416e('0x21')]||null:null})[_0x416e('0xc')](function(_0x39b4d9){logger[_0x416e('0xd')](_0x416e('0x1c'),_0x3bbbad);logger[_0x416e('0xf')](_0x416e('0x1c'),_0x3bbbad,JSON['stringify'](_0x39b4d9));_0x5cade9(_0x39b4d9);})[_0x416e('0x1b')](function(_0x1e3422){logger[_0x416e('0x12')]('UpdateVoiceDialReport',_0x1e3422[_0x416e('0x13')],_0x3bbbad);_0x635540(_0x196c11[_0x416e('0x12')](0x1f4,_0x1e3422[_0x416e('0x13')]));});});}; \ No newline at end of file +var _0x38c3=['info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x565b7f,_0x41b5f1){var _0x496ca5=function(_0x1345c7){while(--_0x1345c7){_0x565b7f['push'](_0x565b7f['shift']());}};_0x496ca5(++_0x41b5f1);}(_0x38c3,0x13d));var _0x338c=function(_0x25678f,_0x5958d5){_0x25678f=_0x25678f-0x0;var _0x1961b5=_0x38c3[_0x25678f];return _0x1961b5;};'use strict';var _=require(_0x338c('0x0'));var util=require(_0x338c('0x1'));var moment=require('moment');var BPromise=require(_0x338c('0x2'));var rs=require(_0x338c('0x3'));var fs=require('fs');var Redis=require(_0x338c('0x4'));var db=require(_0x338c('0x5'))['db'];var utils=require(_0x338c('0x6'));var logger=require(_0x338c('0x7'))('rpc');var config=require(_0x338c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x338c('0x9')][_0x338c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c021d,_0x39dacd,_0x2864c3){return new BPromise(function(_0x46286d,_0x5f285b){return client[_0x338c('0xb')](_0x4c021d,_0x2864c3)[_0x338c('0xc')](function(_0x212690){logger[_0x338c('0xd')](_0x338c('0xe'),_0x39dacd,_0x338c('0xf'));logger[_0x338c('0x10')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x39dacd,_0x338c('0xf'),JSON[_0x338c('0x11')](_0x212690));if(_0x212690['error']){if(_0x212690[_0x338c('0x12')]['code']===0x1f4){logger[_0x338c('0x12')](_0x338c('0xe'),_0x39dacd,_0x212690['error'][_0x338c('0x13')]);return _0x5f285b(_0x212690[_0x338c('0x12')][_0x338c('0x13')]);}logger[_0x338c('0x12')](_0x338c('0xe'),_0x39dacd,_0x212690[_0x338c('0x12')][_0x338c('0x13')]);return _0x46286d(_0x212690[_0x338c('0x12')][_0x338c('0x13')]);}else{logger[_0x338c('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x39dacd,'request\x20sent');_0x46286d(_0x212690[_0x338c('0x14')][_0x338c('0x13')]);}})[_0x338c('0x15')](function(_0x21cbd4){logger['error'](_0x338c('0xe'),_0x39dacd,_0x21cbd4);_0x5f285b(_0x21cbd4);});});}exports[_0x338c('0x16')]=function(_0x3a0784){var _0x307f7b=this;return new Promise(function(_0x190919,_0x3c988a){return db[_0x338c('0x17')][_0x338c('0x18')](_0x3a0784[_0x338c('0x19')],{'raw':_0x3a0784[_0x338c('0x1a')]?_0x3a0784[_0x338c('0x1a')][_0x338c('0x1b')]===undefined?!![]:![]:!![]})[_0x338c('0xc')](function(_0x5eccab){logger['info'](_0x338c('0x16'),_0x3a0784);logger[_0x338c('0x10')](_0x338c('0x16'),_0x3a0784,JSON[_0x338c('0x11')](_0x5eccab));_0x190919(_0x5eccab);})['catch'](function(_0x79a67f){logger['error'](_0x338c('0x16'),_0x79a67f[_0x338c('0x13')],_0x3a0784);_0x3c988a(_0x307f7b['error'](0x1f4,_0x79a67f[_0x338c('0x13')]));});});};exports[_0x338c('0x1c')]=function(_0x5bb7bf){var _0x2b8744=this;return new Promise(function(_0x2136e2,_0x4e56cf){return db[_0x338c('0x17')][_0x338c('0x1d')](_0x5bb7bf[_0x338c('0x19')],{'raw':_0x5bb7bf[_0x338c('0x1a')]?_0x5bb7bf[_0x338c('0x1a')][_0x338c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bb7bf['options']?_0x5bb7bf[_0x338c('0x1a')][_0x338c('0x1e')]||null:null,'attributes':_0x5bb7bf[_0x338c('0x1a')]?_0x5bb7bf['options'][_0x338c('0x1f')]||null:null,'limit':_0x5bb7bf[_0x338c('0x1a')]?_0x5bb7bf['options'][_0x338c('0x20')]||null:null})[_0x338c('0xc')](function(_0x1cb5d9){logger[_0x338c('0xd')](_0x338c('0x1c'),_0x5bb7bf);logger[_0x338c('0x10')]('UpdateVoiceDialReport',_0x5bb7bf,JSON['stringify'](_0x1cb5d9));_0x2136e2(_0x1cb5d9);})[_0x338c('0x15')](function(_0x35e84a){logger[_0x338c('0x12')](_0x338c('0x1c'),_0x35e84a[_0x338c('0x13')],_0x5bb7bf);_0x4e56cf(_0x2b8744['error'](0x1f4,_0x35e84a['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index bfc312f..b102e86 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 _0xcdac=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','./voiceExtension.controller','isAuthenticated','index','get','/:id','show','create','post','/:id/applications','addApplications','update','delete'];(function(_0x57c2a8,_0x3c5977){var _0x351b91=function(_0x17b862){while(--_0x17b862){_0x57c2a8['push'](_0x57c2a8['shift']());}};_0x351b91(++_0x3c5977);}(_0xcdac,0xb6));var _0xccda=function(_0x391410,_0x167c3b){_0x391410=_0x391410-0x0;var _0x5ad835=_0xcdac[_0x391410];return _0x5ad835;};'use strict';var multer=require(_0xccda('0x0'));var util=require(_0xccda('0x1'));var path=require(_0xccda('0x2'));var timeout=require('connect-timeout');var express=require(_0xccda('0x3'));var router=express[_0xccda('0x4')]();var auth=require(_0xccda('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xccda('0x6'));router['get']('/',auth[_0xccda('0x7')](),controller[_0xccda('0x8')]);router[_0xccda('0x9')](_0xccda('0xa'),auth[_0xccda('0x7')](),controller[_0xccda('0xb')]);router['post']('/',auth[_0xccda('0x7')](),controller[_0xccda('0xc')]);router[_0xccda('0xd')](_0xccda('0xe'),auth[_0xccda('0x7')](),controller[_0xccda('0xf')]);router['put'](_0xccda('0xa'),auth[_0xccda('0x7')](),controller[_0xccda('0x10')]);router[_0xccda('0x11')](_0xccda('0xa'),auth['isAuthenticated'](),controller[_0xccda('0x12')]);module[_0xccda('0x13')]=router; \ No newline at end of file +var _0x39bd=['update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','/:id','isAuthenticated','show','post','create','/:id/applications','addApplications','put'];(function(_0xafe7,_0x14bc7b){var _0x392838=function(_0x52c117){while(--_0x52c117){_0xafe7['push'](_0xafe7['shift']());}};_0x392838(++_0x14bc7b);}(_0x39bd,0x7c));var _0xd39b=function(_0xf78ad3,_0x17f1f3){_0xf78ad3=_0xf78ad3-0x0;var _0x24f765=_0x39bd[_0xf78ad3];return _0x24f765;};'use strict';var multer=require(_0xd39b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd39b('0x1'));var express=require('express');var router=express[_0xd39b('0x2')]();var auth=require(_0xd39b('0x3'));var interaction=require(_0xd39b('0x4'));var config=require(_0xd39b('0x5'));var controller=require(_0xd39b('0x6'));router[_0xd39b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd39b('0x7')](_0xd39b('0x8'),auth[_0xd39b('0x9')](),controller[_0xd39b('0xa')]);router[_0xd39b('0xb')]('/',auth[_0xd39b('0x9')](),controller[_0xd39b('0xc')]);router['post'](_0xd39b('0xd'),auth[_0xd39b('0x9')](),controller[_0xd39b('0xe')]);router[_0xd39b('0xf')](_0xd39b('0x8'),auth['isAuthenticated'](),controller[_0xd39b('0x10')]);router[_0xd39b('0x11')](_0xd39b('0x8'),auth[_0xd39b('0x9')](),controller[_0xd39b('0x12')]);module[_0xd39b('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 5bbbc06..b43f370 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(_0x222213,_0x2ea4de){var _0x5abf2f=function(_0x55d40c){while(--_0x55d40c){_0x222213['push'](_0x222213['shift']());}};_0x5abf2f(++_0x2ea4de);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x4be1d6,_0xbd73fa){var _0x3eba32=function(_0xd75bbe){while(--_0xd75bbe){_0x4be1d6['push'](_0x4be1d6['shift']());}};_0x3eba32(++_0xbd73fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 d8094bc..787367b 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 _0xa9e0=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','includes','type','find','name','error','stack','send','index','VoiceExtension','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','key','field','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis'];(function(_0x2696ec,_0x11a87f){var _0x1af23a=function(_0x3983bc){while(--_0x3983bc){_0x2696ec['push'](_0x2696ec['shift']());}};_0x1af23a(++_0x11a87f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./voiceExtension.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0x0a9e('0x26'),'value':_0x0a9e('0x27'),'ignore':![]},{'name':_0x0a9e('0x28'),'value':_0x0a9e('0x29'),'ignore':![]}];var _0x526cf3=_(_0x16b1ca)[_0x0a9e('0x2a')]('ignore')[_0x0a9e('0x2b')]('value')[_0x0a9e('0x2c')]();if(_[_0x0a9e('0x2d')](_0x526cf3,_0x370d86[_0x0a9e('0x2e')])){return;}var _0x14433c=_[_0x0a9e('0x2f')](_0x16b1ca,[_0x0a9e('0x2c'),_0x370d86[_0x0a9e('0x2e')]])[_0x0a9e('0x30')];return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x14433c,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15b200,_0x40e7a3){return function(_0x1843b2){if(!_0x1843b2){_0x15b200[_0x0a9e('0x18')](0x194);}return _0x1843b2;};}function handleError(_0x58b06f,_0x563b45){_0x563b45=_0x563b45||0x1f4;return function(_0x296f41){logger[_0x0a9e('0x31')](_0x296f41[_0x0a9e('0x32')]);if(_0x296f41['name']){delete _0x296f41[_0x0a9e('0x30')];}_0x58b06f['status'](_0x563b45)[_0x0a9e('0x33')](_0x296f41);};}exports[_0x0a9e('0x34')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a={},_0x5180f1={},_0x66c1d2={'count':0x0,'rows':[]};var _0x46f0a5=db[_0x0a9e('0x35')][_0x0a9e('0x36')];_0x5180f1[_0x0a9e('0x37')]=_[_0x0a9e('0x38')](_0x46f0a5);_0x5180f1[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x1122db['query']);_0x5180f1[_0x0a9e('0x3a')]=_['intersection'](_0x5180f1[_0x0a9e('0x37')],_0x5180f1[_0x0a9e('0x39')]);_0x25ce3a[_0x0a9e('0x3b')]=_[_0x0a9e('0x3c')](_0x5180f1['model'],qs[_0x0a9e('0x3d')](_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x25ce3a[_0x0a9e('0x3b')]=_0x25ce3a['attributes']['length']?_0x25ce3a[_0x0a9e('0x3b')]:_0x5180f1['model'];if(!_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x3e')](_0x0a9e('0x3f'))){_0x25ce3a[_0x0a9e('0x1d')]=qs['limit'](_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x25ce3a[_0x0a9e('0x1c')]=qs['offset'](_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x1c')]);}_0x25ce3a[_0x0a9e('0x40')]=qs['sort'](_0x1122db['query'][_0x0a9e('0x41')]);_0x25ce3a[_0x0a9e('0x42')]=qs['filters'](_[_0x0a9e('0x43')](_0x1122db[_0x0a9e('0x39')],_0x5180f1[_0x0a9e('0x3a')]));if(_0x1122db[_0x0a9e('0x39')]['filter']){_0x25ce3a['where']=_[_0x0a9e('0x44')](_0x25ce3a[_0x0a9e('0x42')],{'$or':_['map'](_0x46f0a5,function(_0x183991){if(_0x183991[_0x0a9e('0x2e')][_0x0a9e('0x45')]!=='VIRTUAL'){var _0x316c8f={};_0x316c8f[_0x183991[_0x0a9e('0x46')]]={'$like':'%'+_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x2a')]+'%'};return _0x316c8f;}})});}_0x25ce3a=_[_0x0a9e('0x44')]({},_0x25ce3a,_0x1122db[_0x0a9e('0x47')]);var _0x2881b3={'where':_0x25ce3a[_0x0a9e('0x42')]};return db[_0x0a9e('0x35')][_0x0a9e('0x1b')](_0x2881b3)[_0x0a9e('0x23')](function(_0x148007){_0x66c1d2[_0x0a9e('0x1b')]=_0x148007;if(_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x48')]){_0x25ce3a['include']=[{'all':!![]}];}return db['VoiceExtension'][_0x0a9e('0x49')](_0x25ce3a);})[_0x0a9e('0x23')](function(_0x405c8f){_0x66c1d2[_0x0a9e('0x4a')]=_0x405c8f;return _0x66c1d2;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x33bdb7,_0x25ce3a))[_0x0a9e('0x4b')](handleError(_0x33bdb7,null));};exports[_0x0a9e('0x4c')]=function(_0x445e25,_0x432fcc){var _0x25c6e6={'raw':![],'where':{'id':_0x445e25[_0x0a9e('0x4d')]['id']}},_0x2c2cb0={};_0x2c2cb0['model']=_[_0x0a9e('0x38')](db[_0x0a9e('0x35')][_0x0a9e('0x36')]);_0x2c2cb0[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x445e25[_0x0a9e('0x39')]);_0x2c2cb0[_0x0a9e('0x3a')]=_[_0x0a9e('0x3c')](_0x2c2cb0['model'],_0x2c2cb0[_0x0a9e('0x39')]);_0x25c6e6['attributes']=_[_0x0a9e('0x3c')](_0x2c2cb0[_0x0a9e('0x37')],qs[_0x0a9e('0x3d')](_0x445e25['query'][_0x0a9e('0x3d')]));_0x25c6e6[_0x0a9e('0x3b')]=_0x25c6e6[_0x0a9e('0x3b')][_0x0a9e('0x4e')]?_0x25c6e6[_0x0a9e('0x3b')]:_0x2c2cb0[_0x0a9e('0x37')];if(_0x445e25[_0x0a9e('0x39')]['includeAll']){_0x25c6e6[_0x0a9e('0x4f')]=[{'all':!![]}];}_0x25c6e6=_[_0x0a9e('0x44')]({},_0x25c6e6,_0x445e25[_0x0a9e('0x47')]);return db[_0x0a9e('0x35')][_0x0a9e('0x2f')](_0x25c6e6)[_0x0a9e('0x23')](handleEntityNotFound(_0x432fcc,null))[_0x0a9e('0x23')](respondWithResult(_0x432fcc,null))[_0x0a9e('0x4b')](handleError(_0x432fcc,null));};exports[_0x0a9e('0x24')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x35')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x23')](removeEntity(_0xe401a,null))[_0x0a9e('0x4b')](handleError(_0xe401a,null));};exports[_0x0a9e('0x50')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x51')][_0x0a9e('0x2e')]===_0x0a9e('0x27')&&!_['startsWith'](_0x11545a['body']['exten'],'_')){_0x11545a[_0x0a9e('0x51')][_0x0a9e('0x52')]='_'[_0x0a9e('0x53')](_0x11545a['body'][_0x0a9e('0x52')]);}return db[_0x0a9e('0x35')]['create'](_0x11545a['body'],{'raw':![]})[_0x0a9e('0x23')](function(_0x59c6ff){var _0x443e72=_0x11545a['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x443e72)throw new Error(_0x0a9e('0x54'));if(_0x443e72[_0x0a9e('0x55')]==='user'){var _0x2f82da=_0x59c6ff[_0x0a9e('0x25')]({'plain':!![]});var _0x508b47=[{'name':'InboundRoutes','value':_0x0a9e('0x56')},{'name':_0x0a9e('0x26'),'value':'outbound'},{'name':_0x0a9e('0x28'),'value':'internal'}];var _0x211ef9=_['find'](_0x508b47,[_0x0a9e('0x2c'),_0x2f82da['type']])['name'];return db['UserProfileSection'][_0x0a9e('0x2f')]({'where':{'name':_0x211ef9,'userProfileId':_0x443e72['userProfileId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x65432){if(_0x65432&&_0x65432[_0x0a9e('0x57')]===0x0){return db[_0x0a9e('0x58')][_0x0a9e('0x50')]({'name':_0x2f82da[_0x0a9e('0x30')],'resourceId':_0x2f82da['id'],'type':_0x65432[_0x0a9e('0x30')],'sectionId':_0x65432['id']},{})[_0x0a9e('0x23')](function(){return _0x59c6ff;});}else{return _0x59c6ff;}})['catch'](function(_0x1c693e){logger[_0x0a9e('0x31')](_0x0a9e('0x59'),_0x1c693e);throw _0x1c693e;});}return _0x59c6ff;})[_0x0a9e('0x23')](respondWithResult(_0x61bb17,0xc9))[_0x0a9e('0x4b')](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x5d86e9,_0x956fbe){if(_0x5d86e9[_0x0a9e('0x51')]['id']){delete _0x5d86e9['body']['id'];}return db[_0x0a9e('0x35')]['find']({'where':{'id':_0x5d86e9[_0x0a9e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x956fbe,null))['then'](function(_0x5674ee){if(_0x5674ee){return db[_0x0a9e('0x35')]['update'](_[_0x0a9e('0x43')](_0x5d86e9[_0x0a9e('0x51')],[_0x0a9e('0x52'),_0x0a9e('0x5a'),_0x0a9e('0x5b'),_0x0a9e('0x5c'),'cutdigits',_0x0a9e('0x5d')]),{'where':{'context':_0x5674ee['context'],'exten':_0x5674ee[_0x0a9e('0x52')]},'individualHooks':!![]})[_0x0a9e('0x23')](function(_0x51aaf7){return _0x51aaf7;});}return null;})['then'](respondWithStatusCode(_0x956fbe,null))[_0x0a9e('0x4b')](handleError(_0x956fbe,null));};exports[_0x0a9e('0x5e')]=function(_0x119677,_0x32e134,_0x497d91){return db[_0x0a9e('0x35')][_0x0a9e('0x5f')]({'where':{'id':_0x119677['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x32e134,null))[_0x0a9e('0x23')](function(_0x88dcbf){if(_0x88dcbf){return db[_0x0a9e('0x60')][_0x0a9e('0x61')](function(_0x4d4a35){return db[_0x0a9e('0x35')][_0x0a9e('0x24')]({'where':{'VoiceExtensionId':_0x119677[_0x0a9e('0x4d')]['id']},'transaction':_0x4d4a35})['then'](function(_0x3528b7){var _0x4f1e60=_['map'](_0x119677[_0x0a9e('0x51')],function(_0x4556c5){_0x4556c5[_0x0a9e('0x62')]=_0x119677[_0x0a9e('0x4d')]['id'];return _0x4556c5;});return db[_0x0a9e('0x35')][_0x0a9e('0x63')](_0x4f1e60,{'transaction':_0x4d4a35});});})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x35')][_0x0a9e('0x64')]({'where':{'isApp':!![],'VoiceExtensionId':_0x119677[_0x0a9e('0x4d')]['id']},'order':_0x0a9e('0x65')});});}})[_0x0a9e('0x23')](respondWithResult(_0x32e134,null))[_0x0a9e('0x4b')](handleError(_0x32e134,null));}; \ No newline at end of file +var _0xa9e0=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','includes','type','find','name','error','stack','send','index','VoiceExtension','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','key','field','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis'];(function(_0x41b16f,_0x4afe01){var _0xb84a94=function(_0x43f03a){while(--_0x43f03a){_0x41b16f['push'](_0x41b16f['shift']());}};_0xb84a94(++_0x4afe01);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./voiceExtension.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0x0a9e('0x26'),'value':_0x0a9e('0x27'),'ignore':![]},{'name':_0x0a9e('0x28'),'value':_0x0a9e('0x29'),'ignore':![]}];var _0x526cf3=_(_0x16b1ca)[_0x0a9e('0x2a')]('ignore')[_0x0a9e('0x2b')]('value')[_0x0a9e('0x2c')]();if(_[_0x0a9e('0x2d')](_0x526cf3,_0x370d86[_0x0a9e('0x2e')])){return;}var _0x14433c=_[_0x0a9e('0x2f')](_0x16b1ca,[_0x0a9e('0x2c'),_0x370d86[_0x0a9e('0x2e')]])[_0x0a9e('0x30')];return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x14433c,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15b200,_0x40e7a3){return function(_0x1843b2){if(!_0x1843b2){_0x15b200[_0x0a9e('0x18')](0x194);}return _0x1843b2;};}function handleError(_0x58b06f,_0x563b45){_0x563b45=_0x563b45||0x1f4;return function(_0x296f41){logger[_0x0a9e('0x31')](_0x296f41[_0x0a9e('0x32')]);if(_0x296f41['name']){delete _0x296f41[_0x0a9e('0x30')];}_0x58b06f['status'](_0x563b45)[_0x0a9e('0x33')](_0x296f41);};}exports[_0x0a9e('0x34')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a={},_0x5180f1={},_0x66c1d2={'count':0x0,'rows':[]};var _0x46f0a5=db[_0x0a9e('0x35')][_0x0a9e('0x36')];_0x5180f1[_0x0a9e('0x37')]=_[_0x0a9e('0x38')](_0x46f0a5);_0x5180f1[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x1122db['query']);_0x5180f1[_0x0a9e('0x3a')]=_['intersection'](_0x5180f1[_0x0a9e('0x37')],_0x5180f1[_0x0a9e('0x39')]);_0x25ce3a[_0x0a9e('0x3b')]=_[_0x0a9e('0x3c')](_0x5180f1['model'],qs[_0x0a9e('0x3d')](_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x25ce3a[_0x0a9e('0x3b')]=_0x25ce3a['attributes']['length']?_0x25ce3a[_0x0a9e('0x3b')]:_0x5180f1['model'];if(!_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x3e')](_0x0a9e('0x3f'))){_0x25ce3a[_0x0a9e('0x1d')]=qs['limit'](_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x25ce3a[_0x0a9e('0x1c')]=qs['offset'](_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x1c')]);}_0x25ce3a[_0x0a9e('0x40')]=qs['sort'](_0x1122db['query'][_0x0a9e('0x41')]);_0x25ce3a[_0x0a9e('0x42')]=qs['filters'](_[_0x0a9e('0x43')](_0x1122db[_0x0a9e('0x39')],_0x5180f1[_0x0a9e('0x3a')]));if(_0x1122db[_0x0a9e('0x39')]['filter']){_0x25ce3a['where']=_[_0x0a9e('0x44')](_0x25ce3a[_0x0a9e('0x42')],{'$or':_['map'](_0x46f0a5,function(_0x183991){if(_0x183991[_0x0a9e('0x2e')][_0x0a9e('0x45')]!=='VIRTUAL'){var _0x316c8f={};_0x316c8f[_0x183991[_0x0a9e('0x46')]]={'$like':'%'+_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x2a')]+'%'};return _0x316c8f;}})});}_0x25ce3a=_[_0x0a9e('0x44')]({},_0x25ce3a,_0x1122db[_0x0a9e('0x47')]);var _0x2881b3={'where':_0x25ce3a[_0x0a9e('0x42')]};return db[_0x0a9e('0x35')][_0x0a9e('0x1b')](_0x2881b3)[_0x0a9e('0x23')](function(_0x148007){_0x66c1d2[_0x0a9e('0x1b')]=_0x148007;if(_0x1122db[_0x0a9e('0x39')][_0x0a9e('0x48')]){_0x25ce3a['include']=[{'all':!![]}];}return db['VoiceExtension'][_0x0a9e('0x49')](_0x25ce3a);})[_0x0a9e('0x23')](function(_0x405c8f){_0x66c1d2[_0x0a9e('0x4a')]=_0x405c8f;return _0x66c1d2;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x33bdb7,_0x25ce3a))[_0x0a9e('0x4b')](handleError(_0x33bdb7,null));};exports[_0x0a9e('0x4c')]=function(_0x445e25,_0x432fcc){var _0x25c6e6={'raw':![],'where':{'id':_0x445e25[_0x0a9e('0x4d')]['id']}},_0x2c2cb0={};_0x2c2cb0['model']=_[_0x0a9e('0x38')](db[_0x0a9e('0x35')][_0x0a9e('0x36')]);_0x2c2cb0[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x445e25[_0x0a9e('0x39')]);_0x2c2cb0[_0x0a9e('0x3a')]=_[_0x0a9e('0x3c')](_0x2c2cb0['model'],_0x2c2cb0[_0x0a9e('0x39')]);_0x25c6e6['attributes']=_[_0x0a9e('0x3c')](_0x2c2cb0[_0x0a9e('0x37')],qs[_0x0a9e('0x3d')](_0x445e25['query'][_0x0a9e('0x3d')]));_0x25c6e6[_0x0a9e('0x3b')]=_0x25c6e6[_0x0a9e('0x3b')][_0x0a9e('0x4e')]?_0x25c6e6[_0x0a9e('0x3b')]:_0x2c2cb0[_0x0a9e('0x37')];if(_0x445e25[_0x0a9e('0x39')]['includeAll']){_0x25c6e6[_0x0a9e('0x4f')]=[{'all':!![]}];}_0x25c6e6=_[_0x0a9e('0x44')]({},_0x25c6e6,_0x445e25[_0x0a9e('0x47')]);return db[_0x0a9e('0x35')][_0x0a9e('0x2f')](_0x25c6e6)[_0x0a9e('0x23')](handleEntityNotFound(_0x432fcc,null))[_0x0a9e('0x23')](respondWithResult(_0x432fcc,null))[_0x0a9e('0x4b')](handleError(_0x432fcc,null));};exports[_0x0a9e('0x24')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x35')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x23')](removeEntity(_0xe401a,null))[_0x0a9e('0x4b')](handleError(_0xe401a,null));};exports[_0x0a9e('0x50')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x51')][_0x0a9e('0x2e')]===_0x0a9e('0x27')&&!_['startsWith'](_0x11545a['body']['exten'],'_')){_0x11545a[_0x0a9e('0x51')][_0x0a9e('0x52')]='_'[_0x0a9e('0x53')](_0x11545a['body'][_0x0a9e('0x52')]);}return db[_0x0a9e('0x35')]['create'](_0x11545a['body'],{'raw':![]})[_0x0a9e('0x23')](function(_0x59c6ff){var _0x443e72=_0x11545a['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x443e72)throw new Error(_0x0a9e('0x54'));if(_0x443e72[_0x0a9e('0x55')]==='user'){var _0x2f82da=_0x59c6ff[_0x0a9e('0x25')]({'plain':!![]});var _0x508b47=[{'name':'InboundRoutes','value':_0x0a9e('0x56')},{'name':_0x0a9e('0x26'),'value':'outbound'},{'name':_0x0a9e('0x28'),'value':'internal'}];var _0x211ef9=_['find'](_0x508b47,[_0x0a9e('0x2c'),_0x2f82da['type']])['name'];return db['UserProfileSection'][_0x0a9e('0x2f')]({'where':{'name':_0x211ef9,'userProfileId':_0x443e72['userProfileId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x65432){if(_0x65432&&_0x65432[_0x0a9e('0x57')]===0x0){return db[_0x0a9e('0x58')][_0x0a9e('0x50')]({'name':_0x2f82da[_0x0a9e('0x30')],'resourceId':_0x2f82da['id'],'type':_0x65432[_0x0a9e('0x30')],'sectionId':_0x65432['id']},{})[_0x0a9e('0x23')](function(){return _0x59c6ff;});}else{return _0x59c6ff;}})['catch'](function(_0x1c693e){logger[_0x0a9e('0x31')](_0x0a9e('0x59'),_0x1c693e);throw _0x1c693e;});}return _0x59c6ff;})[_0x0a9e('0x23')](respondWithResult(_0x61bb17,0xc9))[_0x0a9e('0x4b')](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x5d86e9,_0x956fbe){if(_0x5d86e9[_0x0a9e('0x51')]['id']){delete _0x5d86e9['body']['id'];}return db[_0x0a9e('0x35')]['find']({'where':{'id':_0x5d86e9[_0x0a9e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x956fbe,null))['then'](function(_0x5674ee){if(_0x5674ee){return db[_0x0a9e('0x35')]['update'](_[_0x0a9e('0x43')](_0x5d86e9[_0x0a9e('0x51')],[_0x0a9e('0x52'),_0x0a9e('0x5a'),_0x0a9e('0x5b'),_0x0a9e('0x5c'),'cutdigits',_0x0a9e('0x5d')]),{'where':{'context':_0x5674ee['context'],'exten':_0x5674ee[_0x0a9e('0x52')]},'individualHooks':!![]})[_0x0a9e('0x23')](function(_0x51aaf7){return _0x51aaf7;});}return null;})['then'](respondWithStatusCode(_0x956fbe,null))[_0x0a9e('0x4b')](handleError(_0x956fbe,null));};exports[_0x0a9e('0x5e')]=function(_0x119677,_0x32e134,_0x497d91){return db[_0x0a9e('0x35')][_0x0a9e('0x5f')]({'where':{'id':_0x119677['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x32e134,null))[_0x0a9e('0x23')](function(_0x88dcbf){if(_0x88dcbf){return db[_0x0a9e('0x60')][_0x0a9e('0x61')](function(_0x4d4a35){return db[_0x0a9e('0x35')][_0x0a9e('0x24')]({'where':{'VoiceExtensionId':_0x119677[_0x0a9e('0x4d')]['id']},'transaction':_0x4d4a35})['then'](function(_0x3528b7){var _0x4f1e60=_['map'](_0x119677[_0x0a9e('0x51')],function(_0x4556c5){_0x4556c5[_0x0a9e('0x62')]=_0x119677[_0x0a9e('0x4d')]['id'];return _0x4556c5;});return db[_0x0a9e('0x35')][_0x0a9e('0x63')](_0x4f1e60,{'transaction':_0x4d4a35});});})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x35')][_0x0a9e('0x64')]({'where':{'isApp':!![],'VoiceExtensionId':_0x119677[_0x0a9e('0x4d')]['id']},'order':_0x0a9e('0x65')});});}})[_0x0a9e('0x23')](respondWithResult(_0x32e134,null))[_0x0a9e('0x4b')](handleError(_0x32e134,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 93cf98a..bdf2ab3 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 _0x1775=['save','emit','hasOwnProperty','hook','exports','events','VoiceExtension'];(function(_0x145b25,_0xe23854){var _0x38ca16=function(_0x277fab){while(--_0x277fab){_0x145b25['push'](_0x145b25['shift']());}};_0x38ca16(++_0xe23854);}(_0x1775,0xfa));var _0x5177=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1775[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x5177('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x5177('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5177('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x27f792){return function(_0x226977,_0x2bfa0b,_0x1df851){VoiceExtensionEvents['emit'](_0x27f792+':'+_0x226977['id'],_0x226977);VoiceExtensionEvents[_0x5177('0x3')](_0x27f792,_0x226977);_0x1df851(null);};}for(var e in events){if(events[_0x5177('0x4')](e)){var event=events[e];VoiceExtension[_0x5177('0x5')](e,emitEvent(event));}}module[_0x5177('0x6')]=VoiceExtensionEvents; \ No newline at end of file +var _0x99de=['emit','hasOwnProperty','hook','exports','events','VoiceExtension','setMaxListeners','remove'];(function(_0x599a6d,_0x160954){var _0x309ad2=function(_0x3e1acf){while(--_0x3e1acf){_0x599a6d['push'](_0x599a6d['shift']());}};_0x309ad2(++_0x160954);}(_0x99de,0x194));var _0xe99d=function(_0x1e06f1,_0x59d7e1){_0x1e06f1=_0x1e06f1-0x0;var _0x34f77e=_0x99de[_0x1e06f1];return _0x34f77e;};'use strict';var EventEmitter=require(_0xe99d('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xe99d('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe99d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe99d('0x3')};function emitEvent(_0x1c0801){return function(_0x17ff58,_0x1aca35,_0x1f1a2d){VoiceExtensionEvents[_0xe99d('0x4')](_0x1c0801+':'+_0x17ff58['id'],_0x17ff58);VoiceExtensionEvents['emit'](_0x1c0801,_0x17ff58);_0x1f1a2d(null);};}for(var e in events){if(events[_0xe99d('0x5')](e)){var event=events[e];VoiceExtension[_0xe99d('0x6')](e,emitEvent(event));}}module[_0xe99d('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 56579ca..9737d4a 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 _0x514f=['lodash','util','bluebird','request-promise','path','rimraf','./voiceExtension.attributes','exports','VoiceExtension','voice_extensions'];(function(_0xd299bc,_0x202eab){var _0x47b86a=function(_0x479930){while(--_0x479930){_0xd299bc['push'](_0xd299bc['shift']());}};_0x47b86a(++_0x202eab);}(_0x514f,0x1e0));var _0xf514=function(_0x455ccf,_0x2d4d07){_0x455ccf=_0x455ccf-0x0;var _0x557ec9=_0x514f[_0x455ccf];return _0x557ec9;};'use strict';var _=require(_0xf514('0x0'));var util=require(_0xf514('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf514('0x2'));var rp=require(_0xf514('0x3'));var fs=require('fs');var path=require(_0xf514('0x4'));var rimraf=require(_0xf514('0x5'));var config=require('../../config/environment');var attributes=require(_0xf514('0x6'));module[_0xf514('0x7')]=function(_0x1864e1,_0x5c483f){return _0x1864e1['define'](_0xf514('0x8'),attributes,{'tableName':_0xf514('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87df=['bluebird','request-promise','path','../../config/environment','./voiceExtension.attributes','define','VoiceExtension','voice_extensions','lodash','util','../../config/logger','moment'];(function(_0x4d4188,_0x23e126){var _0x3f9c84=function(_0x216d1e){while(--_0x216d1e){_0x4d4188['push'](_0x4d4188['shift']());}};_0x3f9c84(++_0x23e126);}(_0x87df,0x80));var _0xf87d=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0x87df[_0x4c260a];return _0x17bbdd;};'use strict';var _=require(_0xf87d('0x0'));var util=require(_0xf87d('0x1'));var logger=require(_0xf87d('0x2'))('api');var moment=require(_0xf87d('0x3'));var BPromise=require(_0xf87d('0x4'));var rp=require(_0xf87d('0x5'));var fs=require('fs');var path=require(_0xf87d('0x6'));var rimraf=require('rimraf');var config=require(_0xf87d('0x7'));var attributes=require(_0xf87d('0x8'));module['exports']=function(_0x49664f,_0x55b223){return _0x49664f[_0xf87d('0x9')](_0xf87d('0xa'),attributes,{'tableName':_0xf87d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index a641358..307bba0 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 _0xfda4=['defaults','localhost','./voiceExtension.socket','then','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','include','model','map','info','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','redis'];(function(_0x4bed75,_0x211cc7){var _0x2dd8e8=function(_0x6369c7){while(--_0x6369c7){_0x4bed75['push'](_0x4bed75['shift']());}};_0x2dd8e8(++_0x211cc7);}(_0xfda4,0x139));var _0x4fda=function(_0x4a7b46,_0x5e916c){_0x4a7b46=_0x4a7b46-0x0;var _0x436bee=_0xfda4[_0x4a7b46];return _0x436bee;};'use strict';var _=require(_0x4fda('0x0'));var util=require(_0x4fda('0x1'));var moment=require(_0x4fda('0x2'));var BPromise=require(_0x4fda('0x3'));var rs=require(_0x4fda('0x4'));var fs=require('fs');var Redis=require(_0x4fda('0x5'));var db=require(_0x4fda('0x6'))['db'];var utils=require(_0x4fda('0x7'));var logger=require(_0x4fda('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4fda('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x4fda('0xa')]=_[_0x4fda('0xb')](config[_0x4fda('0xa')],{'host':_0x4fda('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4fda('0xa')]));require(_0x4fda('0xd'))['register'](socket);function respondWithRpcPromise(_0x1c21ea,_0x5be2a9,_0xd2afd){return new BPromise(function(_0x21d844,_0x4c5a07){return client['request'](_0x1c21ea,_0xd2afd)[_0x4fda('0xe')](function(_0x242467){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x5be2a9,_0x4fda('0xf'));logger['debug'](_0x4fda('0x10'),_0x5be2a9,_0x4fda('0xf'),JSON['stringify'](_0x242467));if(_0x242467[_0x4fda('0x11')]){if(_0x242467['error'][_0x4fda('0x12')]===0x1f4){logger[_0x4fda('0x11')](_0x4fda('0x13'),_0x5be2a9,_0x242467['error'][_0x4fda('0x14')]);return _0x4c5a07(_0x242467[_0x4fda('0x11')][_0x4fda('0x14')]);}logger[_0x4fda('0x11')](_0x4fda('0x13'),_0x5be2a9,_0x242467[_0x4fda('0x11')]['message']);return _0x21d844(_0x242467[_0x4fda('0x11')][_0x4fda('0x14')]);}else{logger['info'](_0x4fda('0x13'),_0x5be2a9,_0x4fda('0xf'));_0x21d844(_0x242467[_0x4fda('0x15')][_0x4fda('0x14')]);}})[_0x4fda('0x16')](function(_0x5401c8){logger[_0x4fda('0x11')](_0x4fda('0x13'),_0x5be2a9,_0x5401c8);_0x4c5a07(_0x5401c8);});});}exports[_0x4fda('0x17')]=function(_0x20fc9a){var _0x5130e2=this;return new Promise(function(_0x15ecc7,_0x48959a){return db[_0x4fda('0x18')][_0x4fda('0x19')]({'raw':_0x20fc9a[_0x4fda('0x1a')]?_0x20fc9a[_0x4fda('0x1a')][_0x4fda('0x1b')]===undefined?!![]:![]:!![],'where':_0x20fc9a[_0x4fda('0x1a')]?_0x20fc9a[_0x4fda('0x1a')][_0x4fda('0x1c')]||null:null,'attributes':_0x20fc9a[_0x4fda('0x1a')]?_0x20fc9a[_0x4fda('0x1a')][_0x4fda('0x1d')]||null:null,'limit':_0x20fc9a[_0x4fda('0x1a')]?_0x20fc9a[_0x4fda('0x1a')]['limit']||null:null,'include':_0x20fc9a[_0x4fda('0x1a')]?_0x20fc9a[_0x4fda('0x1a')][_0x4fda('0x1e')]?_['map'](_0x20fc9a[_0x4fda('0x1a')][_0x4fda('0x1e')],function(_0x564d93){return{'model':db[_0x564d93[_0x4fda('0x1f')]],'as':_0x564d93['as'],'attributes':_0x564d93[_0x4fda('0x1d')],'include':_0x564d93[_0x4fda('0x1e')]?_[_0x4fda('0x20')](_0x564d93[_0x4fda('0x1e')],function(_0x3b5e20){return{'model':db[_0x3b5e20[_0x4fda('0x1f')]],'as':_0x3b5e20['as'],'attributes':_0x3b5e20[_0x4fda('0x1d')],'include':_0x3b5e20[_0x4fda('0x1e')]?_[_0x4fda('0x20')](_0x3b5e20[_0x4fda('0x1e')],function(_0x101c24){return{'model':db[_0x101c24[_0x4fda('0x1f')]],'as':_0x101c24['as'],'attributes':_0x101c24['attributes']};}):[]};}):[]};}):[]:[]})[_0x4fda('0xe')](function(_0x592de7){logger[_0x4fda('0x21')](_0x4fda('0x17'),_0x20fc9a);logger[_0x4fda('0x22')]('GetVoiceExtension',_0x20fc9a,JSON[_0x4fda('0x23')](_0x592de7));_0x15ecc7(_0x592de7);})[_0x4fda('0x16')](function(_0x192d0b){logger[_0x4fda('0x11')]('GetVoiceExtension',_0x192d0b[_0x4fda('0x14')],_0x20fc9a);_0x48959a(_0x5130e2['error'](0x1f4,_0x192d0b['message']));});});}; \ No newline at end of file +var _0xdb7a=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','register','request','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','VoiceExtension,\x20%s,\x20%s','message','result','catch','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','then','GetVoiceExtension','lodash','util','moment','bluebird'];(function(_0x6d09e9,_0x4a0041){var _0x35c600=function(_0x5d2344){while(--_0x5d2344){_0x6d09e9['push'](_0x6d09e9['shift']());}};_0x35c600(++_0x4a0041);}(_0xdb7a,0x152));var _0xadb7=function(_0x2d6ade,_0x4d7588){_0x2d6ade=_0x2d6ade-0x0;var _0x24774f=_0xdb7a[_0x2d6ade];return _0x24774f;};'use strict';var _=require(_0xadb7('0x0'));var util=require(_0xadb7('0x1'));var moment=require(_0xadb7('0x2'));var BPromise=require(_0xadb7('0x3'));var rs=require(_0xadb7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xadb7('0x5'))['db'];var utils=require(_0xadb7('0x6'));var logger=require(_0xadb7('0x7'))(_0xadb7('0x8'));var config=require(_0xadb7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xadb7('0xa')][_0xadb7('0xb')]({'port':0x232a});config[_0xadb7('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xadb7('0xd'))(new Redis(config[_0xadb7('0xc')]));require('./voiceExtension.socket')[_0xadb7('0xe')](socket);function respondWithRpcPromise(_0x354dcf,_0xfdf5c9,_0x48a12d){return new BPromise(function(_0x20e0e8,_0x598660){return client[_0xadb7('0xf')](_0x354dcf,_0x48a12d)['then'](function(_0x677b36){logger[_0xadb7('0x10')]('VoiceExtension,\x20%s,\x20%s',_0xfdf5c9,_0xadb7('0x11'));logger[_0xadb7('0x12')](_0xadb7('0x13'),_0xfdf5c9,_0xadb7('0x11'),JSON[_0xadb7('0x14')](_0x677b36));if(_0x677b36['error']){if(_0x677b36['error']['code']===0x1f4){logger[_0xadb7('0x15')]('VoiceExtension,\x20%s,\x20%s',_0xfdf5c9,_0x677b36[_0xadb7('0x15')]['message']);return _0x598660(_0x677b36['error']['message']);}logger[_0xadb7('0x15')](_0xadb7('0x16'),_0xfdf5c9,_0x677b36[_0xadb7('0x15')][_0xadb7('0x17')]);return _0x20e0e8(_0x677b36[_0xadb7('0x15')][_0xadb7('0x17')]);}else{logger['info'](_0xadb7('0x16'),_0xfdf5c9,_0xadb7('0x11'));_0x20e0e8(_0x677b36[_0xadb7('0x18')]['message']);}})[_0xadb7('0x19')](function(_0x299457){logger['error'](_0xadb7('0x16'),_0xfdf5c9,_0x299457);_0x598660(_0x299457);});});}exports['GetVoiceExtension']=function(_0x4fde39){var _0x29c4c2=this;return new Promise(function(_0x509a85,_0x93c33e){return db[_0xadb7('0x1a')][_0xadb7('0x1b')]({'raw':_0x4fde39[_0xadb7('0x1c')]?_0x4fde39['options'][_0xadb7('0x1d')]===undefined?!![]:![]:!![],'where':_0x4fde39[_0xadb7('0x1c')]?_0x4fde39[_0xadb7('0x1c')][_0xadb7('0x1e')]||null:null,'attributes':_0x4fde39[_0xadb7('0x1c')]?_0x4fde39[_0xadb7('0x1c')][_0xadb7('0x1f')]||null:null,'limit':_0x4fde39[_0xadb7('0x1c')]?_0x4fde39['options'][_0xadb7('0x20')]||null:null,'include':_0x4fde39[_0xadb7('0x1c')]?_0x4fde39['options'][_0xadb7('0x21')]?_[_0xadb7('0x22')](_0x4fde39['options'][_0xadb7('0x21')],function(_0x1303fa){return{'model':db[_0x1303fa['model']],'as':_0x1303fa['as'],'attributes':_0x1303fa[_0xadb7('0x1f')],'include':_0x1303fa[_0xadb7('0x21')]?_[_0xadb7('0x22')](_0x1303fa[_0xadb7('0x21')],function(_0x4a388a){return{'model':db[_0x4a388a[_0xadb7('0x23')]],'as':_0x4a388a['as'],'attributes':_0x4a388a[_0xadb7('0x1f')],'include':_0x4a388a[_0xadb7('0x21')]?_[_0xadb7('0x22')](_0x4a388a['include'],function(_0x3c613d){return{'model':db[_0x3c613d[_0xadb7('0x23')]],'as':_0x3c613d['as'],'attributes':_0x3c613d[_0xadb7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xadb7('0x24')](function(_0x3519e0){logger[_0xadb7('0x10')](_0xadb7('0x25'),_0x4fde39);logger['debug'](_0xadb7('0x25'),_0x4fde39,JSON[_0xadb7('0x14')](_0x3519e0));_0x509a85(_0x3519e0);})[_0xadb7('0x19')](function(_0x1f6fe8){logger[_0xadb7('0x15')](_0xadb7('0x25'),_0x1f6fe8[_0xadb7('0x17')],_0x4fde39);_0x93c33e(_0x29c4c2[_0xadb7('0x15')](0x1f4,_0x1f6fe8[_0xadb7('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index a7029be..562c675 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 _0x8c75=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x204e52,_0x1d553a){var _0xe5dd25=function(_0x39302b){while(--_0x39302b){_0x204e52['push'](_0x204e52['shift']());}};_0xe5dd25(++_0x1d553a);}(_0x8c75,0x124));var _0x58c7=function(_0x1909d0,_0x176f54){_0x1909d0=_0x1909d0-0x0;var _0x230e7c=_0x8c75[_0x1909d0];return _0x230e7c;};'use strict';var VoiceExtensionEvents=require(_0x58c7('0x0'));var events=[_0x58c7('0x1'),_0x58c7('0x2'),_0x58c7('0x3')];function createListener(_0x577113,_0x535044){return function(_0x304f94){_0x535044[_0x58c7('0x4')](_0x577113,_0x304f94);};}function removeListener(_0x1f0852,_0x57c2fb){return function(){VoiceExtensionEvents[_0x58c7('0x5')](_0x1f0852,_0x57c2fb);};}exports[_0x58c7('0x6')]=function(_0x1be1b0){for(var _0x4d6f56=0x0,_0x11daa6=events[_0x58c7('0x7')];_0x4d6f56<_0x11daa6;_0x4d6f56++){var _0x29d25b=events[_0x4d6f56];var _0x486817=createListener(_0x58c7('0x8')+_0x29d25b,_0x1be1b0);VoiceExtensionEvents['on'](_0x29d25b,_0x486817);}}; \ No newline at end of file +var _0x825b=['save','update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0x825b,0x179));var _0xb825=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x825b[_0x50a0c2];return _0x5ebadd;};'use strict';var VoiceExtensionEvents=require(_0xb825('0x0'));var events=[_0xb825('0x1'),'remove',_0xb825('0x2')];function createListener(_0x22a1df,_0x5a10ee){return function(_0x730dc0){_0x5a10ee[_0xb825('0x3')](_0x22a1df,_0x730dc0);};}function removeListener(_0x41c8b7,_0x169bdc){return function(){VoiceExtensionEvents[_0xb825('0x4')](_0x41c8b7,_0x169bdc);};}exports[_0xb825('0x5')]=function(_0x59c696){for(var _0x129281=0x0,_0x667bd2=events[_0xb825('0x6')];_0x129281<_0x667bd2;_0x129281++){var _0xc6182e=events[_0x129281];var _0x133c30=createListener('voiceExtension:'+_0xc6182e,_0x59c696);VoiceExtensionEvents['on'](_0xc6182e,_0x133c30);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index a68974c..1910b43 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 _0xc7bd=['../../components/auth/service','./voiceMail.controller','index','get','/:id','show','isAuthenticated','getMessages','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xc7bd,0xeb));var _0xdc7b=function(_0x103ea4,_0x1809e1){_0x103ea4=_0x103ea4-0x0;var _0x513db2=_0xc7bd[_0x103ea4];return _0x513db2;};'use strict';var multer=require(_0xdc7b('0x0'));var util=require(_0xdc7b('0x1'));var path=require(_0xdc7b('0x2'));var timeout=require(_0xdc7b('0x3'));var express=require(_0xdc7b('0x4'));var router=express['Router']();var auth=require(_0xdc7b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdc7b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xdc7b('0x7')]);router[_0xdc7b('0x8')](_0xdc7b('0x9'),auth['isAuthenticated'](),controller[_0xdc7b('0xa')]);router['get']('/:id/messages',auth[_0xdc7b('0xb')](),controller[_0xdc7b('0xc')]);router[_0xdc7b('0xd')]('/',auth[_0xdc7b('0xb')](),controller[_0xdc7b('0xe')]);router[_0xdc7b('0xf')](_0xdc7b('0x9'),auth[_0xdc7b('0xb')](),controller[_0xdc7b('0x10')]);router[_0xdc7b('0x11')]('/:id',auth[_0xdc7b('0xb')](),controller[_0xdc7b('0x12')]);module[_0xdc7b('0x13')]=router; \ No newline at end of file +var _0x372b=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','put','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x50b5e4,_0x472538){var _0x287fdc=function(_0x123552){while(--_0x123552){_0x50b5e4['push'](_0x50b5e4['shift']());}};_0x287fdc(++_0x472538);}(_0x372b,0x18a));var _0xb372=function(_0x50a4ca,_0x53ceb6){_0x50a4ca=_0x50a4ca-0x0;var _0xb9905a=_0x372b[_0x50a4ca];return _0xb9905a;};'use strict';var multer=require(_0xb372('0x0'));var util=require(_0xb372('0x1'));var path=require('path');var timeout=require(_0xb372('0x2'));var express=require(_0xb372('0x3'));var router=express[_0xb372('0x4')]();var auth=require(_0xb372('0x5'));var interaction=require(_0xb372('0x6'));var config=require(_0xb372('0x7'));var controller=require('./voiceMail.controller');router[_0xb372('0x8')]('/',auth[_0xb372('0x9')](),controller[_0xb372('0xa')]);router[_0xb372('0x8')](_0xb372('0xb'),auth[_0xb372('0x9')](),controller[_0xb372('0xc')]);router[_0xb372('0x8')](_0xb372('0xd'),auth[_0xb372('0x9')](),controller[_0xb372('0xe')]);router[_0xb372('0xf')]('/',auth['isAuthenticated'](),controller[_0xb372('0x10')]);router[_0xb372('0x11')]('/:id',auth[_0xb372('0x9')](),controller[_0xb372('0x12')]);router['delete'](_0xb372('0xb'),auth[_0xb372('0x9')](),controller[_0xb372('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 9171317..823e90b 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 _0x878f=['contest_mailbox','string','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','from-voicemail'];(function(_0xbca8a0,_0x2cf3df){var _0x4fe302=function(_0x507af8){while(--_0x507af8){_0xbca8a0['push'](_0xbca8a0['shift']());}};_0x4fe302(++_0x2cf3df);}(_0x878f,0x173));var _0xf878=function(_0x44bf98,_0x5d896a){_0x44bf98=_0x44bf98-0x0;var _0xfe11f6=_0x878f[_0x44bf98];return _0xfe11f6;};'use strict';var Sequelize=require('sequelize');module[_0xf878('0x0')]={'customer_id':{'type':Sequelize[_0xf878('0x1')]},'context':{'type':Sequelize[_0xf878('0x1')],'defaultValue':_0xf878('0x2'),'unique':_0xf878('0x3')},'mailbox':{'type':Sequelize[_0xf878('0x1')],'defaultValue':'','allowNull':![],'unique':_0xf878('0x3')},'password':{'type':Sequelize[_0xf878('0x1')]},'fullname':{'type':Sequelize[_0xf878('0x1')]},'email':{'type':Sequelize[_0xf878('0x1')],'validate':{'isEmail':!![]},'set':function(_0x27ae4d){this['setDataValue']('email',typeof _0x27ae4d===_0xf878('0x4')&&_0x27ae4d[_0xf878('0x5')]()?_0x27ae4d['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xf878('0x6')},'attach':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xf878('0x7'),'allowNull':![]},'saycid':{'type':Sequelize[_0xf878('0x8')](_0xf878('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xf878('0x1')]},'callback':{'type':Sequelize[_0xf878('0x1')]},'review':{'type':Sequelize['ENUM'](_0xf878('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xf878('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xf878('0x8')](_0xf878('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0xf878('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xf878('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xf878('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xf878('0x8')](_0xf878('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xf878('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xf878('0x8')](_0xf878('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xf878('0x8')](_0xf878('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xf878('0x8')](_0xf878('0x7'),'no'),'defaultValue':_0xf878('0x7'),'allowNull':![]},'stamp':{'type':_0xf878('0xa')},'emailsubject':{'type':Sequelize[_0xf878('0x1')]},'emailbody':{'type':Sequelize[_0xf878('0x1')]},'maxsecs':{'type':Sequelize[_0xf878('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xf878('0xc')],'get':function(){return this[_0xf878('0xd')](_0xf878('0xe'))+_0xf878('0xf')+this[_0xf878('0xd')](_0xf878('0x10'));}}}; \ No newline at end of file +var _0x3423=['email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','STRING','from-voicemail','contest_mailbox','setDataValue'];(function(_0x460666,_0x598c15){var _0x13ec96=function(_0x144752){while(--_0x144752){_0x460666['push'](_0x460666['shift']());}};_0x13ec96(++_0x598c15);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x3342('0x0')]},'context':{'type':Sequelize[_0x3342('0x0')],'defaultValue':_0x3342('0x1'),'unique':_0x3342('0x2')},'mailbox':{'type':Sequelize[_0x3342('0x0')],'defaultValue':'','allowNull':![],'unique':_0x3342('0x2')},'password':{'type':Sequelize[_0x3342('0x0')]},'fullname':{'type':Sequelize[_0x3342('0x0')]},'email':{'type':Sequelize[_0x3342('0x0')],'validate':{'isEmail':!![]},'set':function(_0x19206f){this[_0x3342('0x3')](_0x3342('0x4'),typeof _0x19206f===_0x3342('0x5')&&_0x19206f[_0x3342('0x6')]()?_0x19206f[_0x3342('0x6')]():null);}},'pager':{'type':Sequelize[_0x3342('0x0')]},'tz':{'type':Sequelize[_0x3342('0x0')],'defaultValue':_0x3342('0x7')},'attach':{'type':Sequelize[_0x3342('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x3342('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x3342('0x8')](_0x3342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x3342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x3342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3342('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3342('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3342('0x8')](_0x3342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3342('0x8')](_0x3342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3342('0x8')](_0x3342('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x3342('0x8')](_0x3342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x3342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3342('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x3342('0xb')},'emailsubject':{'type':Sequelize[_0x3342('0x0')]},'emailbody':{'type':Sequelize[_0x3342('0x0')]},'maxsecs':{'type':Sequelize[_0x3342('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3342('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x3342('0xd')],'get':function(){return this[_0x3342('0xe')](_0x3342('0xf'))+_0x3342('0x10')+this['getDataValue'](_0x3342('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 093386a..1d8aa1d 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 _0xf797=['name','VoiceMail','model','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','VIRTUAL','field','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','findOne','VoiceMailMessage','length','order','mailbox','findAndCountAll','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','update','then','destroy','get','Voicemails','UserProfileResource'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf797,0x81));var _0x7f79=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0xf797[_0x119d5a];return _0x15bff4;};'use strict';var pdf=require(_0x7f79('0x0'));var emlformat=require(_0x7f79('0x1'));var rimraf=require(_0x7f79('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7f79('0x3'));var rp=require(_0x7f79('0x4'));var moment=require(_0x7f79('0x5'));var BPromise=require(_0x7f79('0x6'));var Mustache=require(_0x7f79('0x7'));var util=require('util');var path=require(_0x7f79('0x8'));var sox=require('sox');var csv=require(_0x7f79('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7f79('0xa'));var crypto=require(_0x7f79('0xb'));var jsforce=require(_0x7f79('0xc'));var deskjs=require(_0x7f79('0xd'));var toCsv=require(_0x7f79('0x9'));var querystring=require(_0x7f79('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7f79('0xf'));var qs=require(_0x7f79('0x10'));var hardwareService=require(_0x7f79('0x11'));var logger=require(_0x7f79('0x12'))(_0x7f79('0x13'));var utils=require(_0x7f79('0x14'));var config=require(_0x7f79('0x15'));var db=require(_0x7f79('0x16'))['db'];function respondWithStatusCode(_0x16396d,_0x29e461){_0x29e461=_0x29e461||0xcc;return function(_0x46f1f9){if(_0x46f1f9){return _0x16396d[_0x7f79('0x17')](_0x29e461);}return _0x16396d['status'](_0x29e461)[_0x7f79('0x18')]();};}function respondWithResult(_0x17b922,_0x584729){_0x584729=_0x584729||0xc8;return function(_0x18b31c){if(_0x18b31c){return _0x17b922[_0x7f79('0x19')](_0x584729)['json'](_0x18b31c);}};}function respondWithFilteredResult(_0x59b48a,_0x1a17eb){return function(_0x1607cf){if(_0x1607cf){var _0x33f053=_0x1607cf[_0x7f79('0x1a')],_0x3ad175=_0x1a17eb[_0x7f79('0x1b')],_0x2c6508=_0x1a17eb[_0x7f79('0x1b')]+_0x1a17eb[_0x7f79('0x1c')],_0x229098;if(_0x2c6508>=_0x33f053){_0x2c6508=_0x33f053;_0x229098=0xc8;}else{_0x229098=0xce;}_0x59b48a['status'](_0x229098);return _0x59b48a[_0x7f79('0x1d')](_0x7f79('0x1e'),_0x3ad175+'-'+_0x2c6508+'/'+_0x33f053)[_0x7f79('0x1f')](_0x1607cf);}return null;};}function patchUpdates(_0x4583fb){return function(_0x226759){try{jsonpatch[_0x7f79('0x20')](_0x226759,_0x4583fb,!![]);}catch(_0x13028e){return BPromise['reject'](_0x13028e);}return _0x226759['save']();};}function saveUpdates(_0x5f06ba,_0x2b958c){return function(_0x459161){if(_0x459161){return _0x459161[_0x7f79('0x21')](_0x5f06ba)[_0x7f79('0x22')](function(_0x4153ce){return _0x4153ce;});}return null;};}function removeEntity(_0x450b87,_0x152e69){return function(_0x5a5e00){if(_0x5a5e00){return _0x5a5e00[_0x7f79('0x23')]()[_0x7f79('0x22')](function(){var _0x57c686=_0x5a5e00[_0x7f79('0x24')]({'plain':!![]});var _0x4031d5=_0x7f79('0x25');return db[_0x7f79('0x26')][_0x7f79('0x23')]({'where':{'type':_0x4031d5,'resourceId':_0x57c686['id']}})['then'](function(){return _0x5a5e00;});})[_0x7f79('0x22')](function(){_0x450b87['status'](0xcc)[_0x7f79('0x18')]();});}};}function handleEntityNotFound(_0x519f53,_0x59861c){return function(_0x1d0d7b){if(!_0x1d0d7b){_0x519f53[_0x7f79('0x17')](0x194);}return _0x1d0d7b;};}function handleError(_0x279850,_0x1f3a06){_0x1f3a06=_0x1f3a06||0x1f4;return function(_0x18c700){logger['error'](_0x18c700['stack']);if(_0x18c700[_0x7f79('0x27')]){delete _0x18c700[_0x7f79('0x27')];}_0x279850[_0x7f79('0x19')](_0x1f3a06)['send'](_0x18c700);};}exports['index']=function(_0x37cb39,_0x379725){var _0x372935={},_0x473cd2={},_0x35b2ee={'count':0x0,'rows':[]};var _0x401955=db[_0x7f79('0x28')]['rawAttributes'];_0x473cd2[_0x7f79('0x29')]=_['keys'](_0x401955);_0x473cd2['query']=_[_0x7f79('0x2a')](_0x37cb39['query']);_0x473cd2['filters']=_[_0x7f79('0x2b')](_0x473cd2[_0x7f79('0x29')],_0x473cd2[_0x7f79('0x2c')]);_0x372935[_0x7f79('0x2d')]=_[_0x7f79('0x2b')](_0x473cd2[_0x7f79('0x29')],qs[_0x7f79('0x2e')](_0x37cb39['query'][_0x7f79('0x2e')]));_0x372935[_0x7f79('0x2d')]=_0x372935['attributes']['length']?_0x372935[_0x7f79('0x2d')]:_0x473cd2['model'];if(!_0x37cb39['query'][_0x7f79('0x2f')](_0x7f79('0x30'))){_0x372935[_0x7f79('0x1c')]=qs[_0x7f79('0x1c')](_0x37cb39[_0x7f79('0x2c')][_0x7f79('0x1c')]);_0x372935[_0x7f79('0x1b')]=qs[_0x7f79('0x1b')](_0x37cb39['query'][_0x7f79('0x1b')]);}_0x372935['order']=qs[_0x7f79('0x31')](_0x37cb39['query'][_0x7f79('0x31')]);_0x372935[_0x7f79('0x32')]=qs[_0x7f79('0x33')](_[_0x7f79('0x34')](_0x37cb39[_0x7f79('0x2c')],_0x473cd2[_0x7f79('0x33')]));if(_0x37cb39[_0x7f79('0x2c')][_0x7f79('0x35')]){_0x372935[_0x7f79('0x32')]=_[_0x7f79('0x36')](_0x372935['where'],{'$or':_[_0x7f79('0x37')](_0x401955,function(_0x2df204){if(_0x2df204['type']['key']!==_0x7f79('0x38')){var _0x14bcfa={};_0x14bcfa[_0x2df204[_0x7f79('0x39')]]={'$like':'%'+_0x37cb39[_0x7f79('0x2c')][_0x7f79('0x35')]+'%'};return _0x14bcfa;}})});}_0x372935=_['merge']({},_0x372935,_0x37cb39['options']);var _0x55a819={'where':_0x372935['where']};return db[_0x7f79('0x28')][_0x7f79('0x1a')](_0x55a819)[_0x7f79('0x22')](function(_0x28616e){_0x35b2ee[_0x7f79('0x1a')]=_0x28616e;if(_0x37cb39[_0x7f79('0x2c')][_0x7f79('0x3a')]){_0x372935[_0x7f79('0x3b')]=[{'all':!![]}];}return db[_0x7f79('0x28')][_0x7f79('0x3c')](_0x372935);})[_0x7f79('0x22')](function(_0x2b6b25){_0x35b2ee[_0x7f79('0x3d')]=_0x2b6b25;return _0x35b2ee;})['then'](respondWithFilteredResult(_0x379725,_0x372935))['catch'](handleError(_0x379725,null));};exports[_0x7f79('0x3e')]=function(_0x42f3b5,_0x18c565){var _0x173143={'raw':!![],'where':{'id':_0x42f3b5[_0x7f79('0x3f')]['id']}},_0x2179be={};_0x2179be[_0x7f79('0x29')]=_[_0x7f79('0x2a')](db[_0x7f79('0x28')][_0x7f79('0x40')]);_0x2179be[_0x7f79('0x2c')]=_[_0x7f79('0x2a')](_0x42f3b5[_0x7f79('0x2c')]);_0x2179be['filters']=_[_0x7f79('0x2b')](_0x2179be[_0x7f79('0x29')],_0x2179be[_0x7f79('0x2c')]);_0x173143['attributes']=_[_0x7f79('0x2b')](_0x2179be['model'],qs['fields'](_0x42f3b5['query'][_0x7f79('0x2e')]));_0x173143[_0x7f79('0x2d')]=_0x173143[_0x7f79('0x2d')]['length']?_0x173143[_0x7f79('0x2d')]:_0x2179be['model'];if(_0x42f3b5[_0x7f79('0x2c')]['includeAll']){_0x173143[_0x7f79('0x3b')]=[{'all':!![]}];}_0x173143=_[_0x7f79('0x36')]({},_0x173143,_0x42f3b5[_0x7f79('0x41')]);return db[_0x7f79('0x28')][_0x7f79('0x42')](_0x173143)['then'](handleEntityNotFound(_0x18c565,null))[_0x7f79('0x22')](respondWithResult(_0x18c565,null))[_0x7f79('0x43')](handleError(_0x18c565,null));};exports[_0x7f79('0x44')]=function(_0x424d85,_0x3472b2){return db['VoiceMail'][_0x7f79('0x44')](_0x424d85['body'],{})[_0x7f79('0x22')](function(_0x5dc2c2){var _0x32e92f=_0x424d85['user'][_0x7f79('0x24')]({'plain':!![]});if(!_0x32e92f)throw new Error(_0x7f79('0x45'));if(_0x32e92f[_0x7f79('0x46')]===_0x7f79('0x47')){var _0x274db7=_0x5dc2c2[_0x7f79('0x24')]({'plain':!![]});var _0xbc52fe=_0x7f79('0x25');return db[_0x7f79('0x48')][_0x7f79('0x42')]({'where':{'name':_0xbc52fe,'userProfileId':_0x32e92f[_0x7f79('0x49')]},'raw':!![]})[_0x7f79('0x22')](function(_0x446cd0){if(_0x446cd0&&_0x446cd0['autoAssociation']===0x0){return db[_0x7f79('0x26')][_0x7f79('0x44')]({'name':_0x274db7[_0x7f79('0x27')],'resourceId':_0x274db7['id'],'type':_0x446cd0['name'],'sectionId':_0x446cd0['id']},{})[_0x7f79('0x22')](function(){return _0x5dc2c2;});}else{return _0x5dc2c2;}})[_0x7f79('0x43')](function(_0x2f2354){logger[_0x7f79('0x4a')](_0x7f79('0x4b'),_0x2f2354);throw _0x2f2354;});}return _0x5dc2c2;})[_0x7f79('0x22')](respondWithResult(_0x3472b2,0xc9))[_0x7f79('0x43')](handleError(_0x3472b2,null));};exports[_0x7f79('0x21')]=function(_0x36e04f,_0x466abf){if(_0x36e04f['body']['id']){delete _0x36e04f[_0x7f79('0x4c')]['id'];}return db[_0x7f79('0x28')][_0x7f79('0x42')]({'where':{'id':_0x36e04f[_0x7f79('0x3f')]['id']}})[_0x7f79('0x22')](handleEntityNotFound(_0x466abf,null))[_0x7f79('0x22')](saveUpdates(_0x36e04f[_0x7f79('0x4c')],null))['then'](respondWithResult(_0x466abf,null))[_0x7f79('0x43')](handleError(_0x466abf,null));};exports['destroy']=function(_0x36ccff,_0x6040c1){return db['VoiceMail'][_0x7f79('0x42')]({'where':{'id':_0x36ccff[_0x7f79('0x3f')]['id']}})[_0x7f79('0x22')](handleEntityNotFound(_0x6040c1,null))[_0x7f79('0x22')](removeEntity(_0x6040c1,null))[_0x7f79('0x43')](handleError(_0x6040c1,null));};exports[_0x7f79('0x4d')]=function(_0x131355,_0x14c860,_0x211d47){return db[_0x7f79('0x28')][_0x7f79('0x4e')]({'where':{'id':_0x131355[_0x7f79('0x3f')]['id']}})[_0x7f79('0x22')](handleEntityNotFound(_0x14c860,null))[_0x7f79('0x22')](function(_0x3e4029){var _0x1029f8;var _0x5bab5c={},_0xcfafcb={};_0xcfafcb[_0x7f79('0x29')]=_['keys'](db[_0x7f79('0x4f')][_0x7f79('0x40')]);_0xcfafcb['query']=_[_0x7f79('0x2a')](_0x131355[_0x7f79('0x2c')]);_0xcfafcb[_0x7f79('0x33')]=_[_0x7f79('0x2b')](_0xcfafcb[_0x7f79('0x29')],_0xcfafcb[_0x7f79('0x2c')]);_0x5bab5c[_0x7f79('0x2d')]=_['intersection'](_0xcfafcb[_0x7f79('0x29')],qs[_0x7f79('0x2e')](_0x131355[_0x7f79('0x2c')]['fields']));_0x5bab5c[_0x7f79('0x2d')]=_0x5bab5c['attributes'][_0x7f79('0x50')]?_0x5bab5c[_0x7f79('0x2d')]:_0xcfafcb['model'];if(!_0x131355[_0x7f79('0x2c')]['hasOwnProperty'](_0x7f79('0x30'))){_0x5bab5c[_0x7f79('0x1c')]=qs['limit'](_0x131355[_0x7f79('0x2c')][_0x7f79('0x1c')]);_0x5bab5c[_0x7f79('0x1b')]=qs[_0x7f79('0x1b')](_0x131355[_0x7f79('0x2c')][_0x7f79('0x1b')]);}_0x5bab5c[_0x7f79('0x51')]=qs[_0x7f79('0x31')](_0x131355[_0x7f79('0x2c')][_0x7f79('0x31')]);_0x5bab5c[_0x7f79('0x32')]=qs[_0x7f79('0x33')](_['pick'](_0x131355[_0x7f79('0x2c')],_0xcfafcb[_0x7f79('0x33')]));if(_0x131355['query'][_0x7f79('0x35')]){_0x5bab5c[_0x7f79('0x32')]=_['merge'](_0x5bab5c['where'],{'$or':_['map'](_0x5bab5c[_0x7f79('0x2d')],function(_0x59cef6){var _0x5c9af3={};_0x5c9af3[_0x59cef6]={'$like':'%'+_0x131355['query'][_0x7f79('0x35')]+'%'};return _0x5c9af3;})});}_0x5bab5c[_0x7f79('0x32')]=_[_0x7f79('0x36')](_0x5bab5c[_0x7f79('0x32')],{'mailboxuser':_0x3e4029[_0x7f79('0x52')]});_0x5bab5c=_[_0x7f79('0x36')]({},_0x5bab5c,_0x131355[_0x7f79('0x41')]);return db['VoiceMailMessage'][_0x7f79('0x53')](_0x5bab5c)[_0x7f79('0x22')](respondWithFilteredResult(_0x14c860,_0x5bab5c));})[_0x7f79('0x43')](handleError(_0x14c860,null));}; \ No newline at end of file +var _0x82c3=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','limit','set','reject','save','update','destroy','then','get','Voicemails','sendStatus','name','send','index','VoiceMail','rawAttributes','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','offset','order','sort','where','pick','merge','type','VIRTUAL','field','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','getMessages','findOne','nolimit','map','VoiceMailMessage','findAndCountAll'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x82c3,0x1a4));var _0x382c=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x82c3[_0x411add];return _0x238242;};'use strict';var pdf=require(_0x382c('0x0'));var emlformat=require(_0x382c('0x1'));var rimraf=require(_0x382c('0x2'));var zipdir=require(_0x382c('0x3'));var jsonpatch=require(_0x382c('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x382c('0x5'));var Mustache=require('mustache');var util=require(_0x382c('0x6'));var path=require(_0x382c('0x7'));var sox=require(_0x382c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x382c('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x382c('0xa'));var deskjs=require(_0x382c('0xb'));var toCsv=require(_0x382c('0xc'));var querystring=require('querystring');var Papa=require(_0x382c('0xd'));var Redis=require(_0x382c('0xe'));var authService=require(_0x382c('0xf'));var qs=require(_0x382c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x382c('0x11'))(_0x382c('0x12'));var utils=require(_0x382c('0x13'));var config=require(_0x382c('0x14'));var db=require(_0x382c('0x15'))['db'];function respondWithStatusCode(_0x1a3af5,_0xfc445){_0xfc445=_0xfc445||0xcc;return function(_0x4c280a){if(_0x4c280a){return _0x1a3af5['sendStatus'](_0xfc445);}return _0x1a3af5['status'](_0xfc445)[_0x382c('0x16')]();};}function respondWithResult(_0x3bd791,_0x3d5906){_0x3d5906=_0x3d5906||0xc8;return function(_0x247635){if(_0x247635){return _0x3bd791[_0x382c('0x17')](_0x3d5906)[_0x382c('0x18')](_0x247635);}};}function respondWithFilteredResult(_0x57d044,_0x1e5107){return function(_0x4f8b06){if(_0x4f8b06){var _0x46a405=_0x4f8b06[_0x382c('0x19')],_0x8af8a4=_0x1e5107['offset'],_0x2fdb72=_0x1e5107['offset']+_0x1e5107[_0x382c('0x1a')],_0xb72557;if(_0x2fdb72>=_0x46a405){_0x2fdb72=_0x46a405;_0xb72557=0xc8;}else{_0xb72557=0xce;}_0x57d044[_0x382c('0x17')](_0xb72557);return _0x57d044[_0x382c('0x1b')]('Content-Range',_0x8af8a4+'-'+_0x2fdb72+'/'+_0x46a405)[_0x382c('0x18')](_0x4f8b06);}return null;};}function patchUpdates(_0x259050){return function(_0x116cb6){try{jsonpatch['apply'](_0x116cb6,_0x259050,!![]);}catch(_0x770b44){return BPromise[_0x382c('0x1c')](_0x770b44);}return _0x116cb6[_0x382c('0x1d')]();};}function saveUpdates(_0x5d11e1,_0x164c7e){return function(_0x41d478){if(_0x41d478){return _0x41d478[_0x382c('0x1e')](_0x5d11e1)['then'](function(_0x3ba80c){return _0x3ba80c;});}return null;};}function removeEntity(_0x4323ad,_0x53b4d2){return function(_0x3e1439){if(_0x3e1439){return _0x3e1439[_0x382c('0x1f')]()[_0x382c('0x20')](function(){var _0xf6f0c8=_0x3e1439[_0x382c('0x21')]({'plain':!![]});var _0x54728b=_0x382c('0x22');return db['UserProfileResource'][_0x382c('0x1f')]({'where':{'type':_0x54728b,'resourceId':_0xf6f0c8['id']}})['then'](function(){return _0x3e1439;});})[_0x382c('0x20')](function(){_0x4323ad['status'](0xcc)[_0x382c('0x16')]();});}};}function handleEntityNotFound(_0x2c9390,_0xecb375){return function(_0x3773fa){if(!_0x3773fa){_0x2c9390[_0x382c('0x23')](0x194);}return _0x3773fa;};}function handleError(_0x250afb,_0x5bb4a4){_0x5bb4a4=_0x5bb4a4||0x1f4;return function(_0x192dbf){logger['error'](_0x192dbf['stack']);if(_0x192dbf['name']){delete _0x192dbf[_0x382c('0x24')];}_0x250afb[_0x382c('0x17')](_0x5bb4a4)[_0x382c('0x25')](_0x192dbf);};}exports[_0x382c('0x26')]=function(_0x41a0b2,_0x1daf2b){var _0x2b527b={},_0x390dcd={},_0xef71d3={'count':0x0,'rows':[]};var _0x2e3799=db[_0x382c('0x27')][_0x382c('0x28')];_0x390dcd['model']=_[_0x382c('0x29')](_0x2e3799);_0x390dcd[_0x382c('0x2a')]=_[_0x382c('0x29')](_0x41a0b2[_0x382c('0x2a')]);_0x390dcd[_0x382c('0x2b')]=_[_0x382c('0x2c')](_0x390dcd['model'],_0x390dcd[_0x382c('0x2a')]);_0x2b527b[_0x382c('0x2d')]=_[_0x382c('0x2c')](_0x390dcd['model'],qs[_0x382c('0x2e')](_0x41a0b2['query'][_0x382c('0x2e')]));_0x2b527b['attributes']=_0x2b527b['attributes'][_0x382c('0x2f')]?_0x2b527b['attributes']:_0x390dcd[_0x382c('0x30')];if(!_0x41a0b2['query'][_0x382c('0x31')]('nolimit')){_0x2b527b[_0x382c('0x1a')]=qs[_0x382c('0x1a')](_0x41a0b2['query']['limit']);_0x2b527b['offset']=qs['offset'](_0x41a0b2[_0x382c('0x2a')][_0x382c('0x32')]);}_0x2b527b[_0x382c('0x33')]=qs[_0x382c('0x34')](_0x41a0b2['query']['sort']);_0x2b527b[_0x382c('0x35')]=qs[_0x382c('0x2b')](_[_0x382c('0x36')](_0x41a0b2[_0x382c('0x2a')],_0x390dcd[_0x382c('0x2b')]));if(_0x41a0b2[_0x382c('0x2a')]['filter']){_0x2b527b['where']=_[_0x382c('0x37')](_0x2b527b[_0x382c('0x35')],{'$or':_['map'](_0x2e3799,function(_0xf15615){if(_0xf15615[_0x382c('0x38')]['key']!==_0x382c('0x39')){var _0x53de22={};_0x53de22[_0xf15615[_0x382c('0x3a')]]={'$like':'%'+_0x41a0b2[_0x382c('0x2a')][_0x382c('0x3b')]+'%'};return _0x53de22;}})});}_0x2b527b=_[_0x382c('0x37')]({},_0x2b527b,_0x41a0b2[_0x382c('0x3c')]);var _0x247a14={'where':_0x2b527b['where']};return db['VoiceMail'][_0x382c('0x19')](_0x247a14)[_0x382c('0x20')](function(_0x206c11){_0xef71d3[_0x382c('0x19')]=_0x206c11;if(_0x41a0b2[_0x382c('0x2a')][_0x382c('0x3d')]){_0x2b527b[_0x382c('0x3e')]=[{'all':!![]}];}return db[_0x382c('0x27')][_0x382c('0x3f')](_0x2b527b);})['then'](function(_0x420c18){_0xef71d3['rows']=_0x420c18;return _0xef71d3;})[_0x382c('0x20')](respondWithFilteredResult(_0x1daf2b,_0x2b527b))[_0x382c('0x40')](handleError(_0x1daf2b,null));};exports[_0x382c('0x41')]=function(_0x4ac571,_0x555323){var _0x17a76a={'raw':!![],'where':{'id':_0x4ac571[_0x382c('0x42')]['id']}},_0x4365ab={};_0x4365ab[_0x382c('0x30')]=_[_0x382c('0x29')](db[_0x382c('0x27')][_0x382c('0x28')]);_0x4365ab[_0x382c('0x2a')]=_[_0x382c('0x29')](_0x4ac571[_0x382c('0x2a')]);_0x4365ab[_0x382c('0x2b')]=_[_0x382c('0x2c')](_0x4365ab[_0x382c('0x30')],_0x4365ab[_0x382c('0x2a')]);_0x17a76a[_0x382c('0x2d')]=_['intersection'](_0x4365ab['model'],qs[_0x382c('0x2e')](_0x4ac571[_0x382c('0x2a')][_0x382c('0x2e')]));_0x17a76a['attributes']=_0x17a76a['attributes']['length']?_0x17a76a[_0x382c('0x2d')]:_0x4365ab[_0x382c('0x30')];if(_0x4ac571['query'][_0x382c('0x3d')]){_0x17a76a['include']=[{'all':!![]}];}_0x17a76a=_[_0x382c('0x37')]({},_0x17a76a,_0x4ac571[_0x382c('0x3c')]);return db['VoiceMail'][_0x382c('0x43')](_0x17a76a)[_0x382c('0x20')](handleEntityNotFound(_0x555323,null))['then'](respondWithResult(_0x555323,null))[_0x382c('0x40')](handleError(_0x555323,null));};exports[_0x382c('0x44')]=function(_0x1ae521,_0x19f991){return db['VoiceMail'][_0x382c('0x44')](_0x1ae521[_0x382c('0x45')],{})['then'](function(_0x29970f){var _0x5f3586=_0x1ae521[_0x382c('0x46')][_0x382c('0x21')]({'plain':!![]});if(!_0x5f3586)throw new Error(_0x382c('0x47'));if(_0x5f3586[_0x382c('0x48')]===_0x382c('0x46')){var _0xaaba90=_0x29970f[_0x382c('0x21')]({'plain':!![]});var _0x1875cb='Voicemails';return db[_0x382c('0x49')][_0x382c('0x43')]({'where':{'name':_0x1875cb,'userProfileId':_0x5f3586[_0x382c('0x4a')]},'raw':!![]})['then'](function(_0x3d6f41){if(_0x3d6f41&&_0x3d6f41[_0x382c('0x4b')]===0x0){return db[_0x382c('0x4c')][_0x382c('0x44')]({'name':_0xaaba90[_0x382c('0x24')],'resourceId':_0xaaba90['id'],'type':_0x3d6f41[_0x382c('0x24')],'sectionId':_0x3d6f41['id']},{})['then'](function(){return _0x29970f;});}else{return _0x29970f;}})[_0x382c('0x40')](function(_0x587eca){logger[_0x382c('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x587eca);throw _0x587eca;});}return _0x29970f;})[_0x382c('0x20')](respondWithResult(_0x19f991,0xc9))[_0x382c('0x40')](handleError(_0x19f991,null));};exports['update']=function(_0x150a4b,_0x111d63){if(_0x150a4b[_0x382c('0x45')]['id']){delete _0x150a4b[_0x382c('0x45')]['id'];}return db['VoiceMail'][_0x382c('0x43')]({'where':{'id':_0x150a4b[_0x382c('0x42')]['id']}})[_0x382c('0x20')](handleEntityNotFound(_0x111d63,null))['then'](saveUpdates(_0x150a4b[_0x382c('0x45')],null))[_0x382c('0x20')](respondWithResult(_0x111d63,null))['catch'](handleError(_0x111d63,null));};exports[_0x382c('0x1f')]=function(_0x549b58,_0x349b0d){return db['VoiceMail'][_0x382c('0x43')]({'where':{'id':_0x549b58[_0x382c('0x42')]['id']}})['then'](handleEntityNotFound(_0x349b0d,null))[_0x382c('0x20')](removeEntity(_0x349b0d,null))['catch'](handleError(_0x349b0d,null));};exports[_0x382c('0x4e')]=function(_0x25a8a1,_0x4bbc48,_0x4454d6){return db['VoiceMail'][_0x382c('0x4f')]({'where':{'id':_0x25a8a1[_0x382c('0x42')]['id']}})[_0x382c('0x20')](handleEntityNotFound(_0x4bbc48,null))['then'](function(_0x50353a){var _0x229c79;var _0x11f4dd={},_0xeecf99={};_0xeecf99['model']=_[_0x382c('0x29')](db['VoiceMailMessage'][_0x382c('0x28')]);_0xeecf99[_0x382c('0x2a')]=_[_0x382c('0x29')](_0x25a8a1[_0x382c('0x2a')]);_0xeecf99['filters']=_['intersection'](_0xeecf99[_0x382c('0x30')],_0xeecf99[_0x382c('0x2a')]);_0x11f4dd[_0x382c('0x2d')]=_[_0x382c('0x2c')](_0xeecf99[_0x382c('0x30')],qs['fields'](_0x25a8a1[_0x382c('0x2a')][_0x382c('0x2e')]));_0x11f4dd[_0x382c('0x2d')]=_0x11f4dd[_0x382c('0x2d')][_0x382c('0x2f')]?_0x11f4dd[_0x382c('0x2d')]:_0xeecf99[_0x382c('0x30')];if(!_0x25a8a1[_0x382c('0x2a')][_0x382c('0x31')](_0x382c('0x50'))){_0x11f4dd[_0x382c('0x1a')]=qs['limit'](_0x25a8a1[_0x382c('0x2a')][_0x382c('0x1a')]);_0x11f4dd['offset']=qs[_0x382c('0x32')](_0x25a8a1[_0x382c('0x2a')][_0x382c('0x32')]);}_0x11f4dd[_0x382c('0x33')]=qs['sort'](_0x25a8a1[_0x382c('0x2a')][_0x382c('0x34')]);_0x11f4dd[_0x382c('0x35')]=qs[_0x382c('0x2b')](_[_0x382c('0x36')](_0x25a8a1[_0x382c('0x2a')],_0xeecf99[_0x382c('0x2b')]));if(_0x25a8a1[_0x382c('0x2a')][_0x382c('0x3b')]){_0x11f4dd[_0x382c('0x35')]=_[_0x382c('0x37')](_0x11f4dd['where'],{'$or':_[_0x382c('0x51')](_0x11f4dd[_0x382c('0x2d')],function(_0x1be626){var _0x3e42ad={};_0x3e42ad[_0x1be626]={'$like':'%'+_0x25a8a1[_0x382c('0x2a')]['filter']+'%'};return _0x3e42ad;})});}_0x11f4dd[_0x382c('0x35')]=_[_0x382c('0x37')](_0x11f4dd[_0x382c('0x35')],{'mailboxuser':_0x50353a['mailbox']});_0x11f4dd=_['merge']({},_0x11f4dd,_0x25a8a1[_0x382c('0x3c')]);return db[_0x382c('0x52')][_0x382c('0x53')](_0x11f4dd)[_0x382c('0x20')](respondWithFilteredResult(_0x4bbc48,_0x11f4dd));})[_0x382c('0x40')](handleError(_0x4bbc48,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index fe5be68..20034fc 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 _0x0058=['moment','request-promise','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox','context','lodash','../../config/logger'];(function(_0x87bff3,_0x1dc9d8){var _0x1334e9=function(_0x3119d1){while(--_0x3119d1){_0x87bff3['push'](_0x87bff3['shift']());}};_0x1334e9(++_0x1dc9d8);}(_0x0058,0x1ae));var _0x8005=function(_0x40bbcd,_0x5ae20c){_0x40bbcd=_0x40bbcd-0x0;var _0x94f223=_0x0058[_0x40bbcd];return _0x94f223;};'use strict';var _=require(_0x8005('0x0'));var util=require('util');var logger=require(_0x8005('0x1'))('api');var moment=require(_0x8005('0x2'));var BPromise=require('bluebird');var rp=require(_0x8005('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8005('0x4'));var attributes=require(_0x8005('0x5'));module[_0x8005('0x6')]=function(_0x42eaa8,_0x311eea){return _0x42eaa8[_0x8005('0x7')](_0x8005('0x8'),attributes,{'tableName':_0x8005('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x8005('0xa'),_0x8005('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6038=['exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes'];(function(_0x368cd6,_0x275b63){var _0x16161d=function(_0x360aec){while(--_0x360aec){_0x368cd6['push'](_0x368cd6['shift']());}};_0x16161d(++_0x275b63);}(_0x6038,0x1f4));var _0x8603=function(_0x4e9acb,_0x594777){_0x4e9acb=_0x4e9acb-0x0;var _0xbbff5a=_0x6038[_0x4e9acb];return _0xbbff5a;};'use strict';var _=require(_0x8603('0x0'));var util=require(_0x8603('0x1'));var logger=require(_0x8603('0x2'))(_0x8603('0x3'));var moment=require(_0x8603('0x4'));var BPromise=require('bluebird');var rp=require(_0x8603('0x5'));var fs=require('fs');var path=require(_0x8603('0x6'));var rimraf=require(_0x8603('0x7'));var config=require(_0x8603('0x8'));var attributes=require(_0x8603('0x9'));module[_0x8603('0xa')]=function(_0x10c107,_0x2b4f22){return _0x10c107[_0x8603('0xb')](_0x8603('0xc'),attributes,{'tableName':_0x8603('0xd'),'paranoid':![],'indexes':[{'name':_0x8603('0xe'),'fields':[_0x8603('0xf'),_0x8603('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 22cebe7..65ee108 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 _0xa515=['message','request\x20sent','catch','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','error','code','VoiceMail,\x20%s,\x20%s'];(function(_0x512f81,_0x4a7986){var _0xa15099=function(_0x1f7371){while(--_0x1f7371){_0x512f81['push'](_0x512f81['shift']());}};_0xa15099(++_0x4a7986);}(_0xa515,0x120));var _0x5a51=function(_0x150d4e,_0x25fb92){_0x150d4e=_0x150d4e-0x0;var _0x599a3e=_0xa515[_0x150d4e];return _0x599a3e;};'use strict';var _=require('lodash');var util=require(_0x5a51('0x0'));var moment=require(_0x5a51('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a51('0x2'))['db'];var utils=require(_0x5a51('0x3'));var logger=require('../../config/logger')(_0x5a51('0x4'));var config=require(_0x5a51('0x5'));var jayson=require(_0x5a51('0x6'));var client=jayson[_0x5a51('0x7')][_0x5a51('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x380fe9,_0x390ef6,_0x5632b1){return new BPromise(function(_0x259810,_0x5d98c9){return client[_0x5a51('0x9')](_0x380fe9,_0x5632b1)[_0x5a51('0xa')](function(_0x4e6307){logger[_0x5a51('0xb')]('VoiceMail,\x20%s,\x20%s',_0x390ef6,'request\x20sent');logger[_0x5a51('0xc')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x390ef6,'request\x20sent',JSON['stringify'](_0x4e6307));if(_0x4e6307[_0x5a51('0xd')]){if(_0x4e6307['error'][_0x5a51('0xe')]===0x1f4){logger['error'](_0x5a51('0xf'),_0x390ef6,_0x4e6307[_0x5a51('0xd')][_0x5a51('0x10')]);return _0x5d98c9(_0x4e6307['error'][_0x5a51('0x10')]);}logger[_0x5a51('0xd')](_0x5a51('0xf'),_0x390ef6,_0x4e6307[_0x5a51('0xd')]['message']);return _0x259810(_0x4e6307[_0x5a51('0xd')][_0x5a51('0x10')]);}else{logger[_0x5a51('0xb')](_0x5a51('0xf'),_0x390ef6,_0x5a51('0x11'));_0x259810(_0x4e6307['result'][_0x5a51('0x10')]);}})[_0x5a51('0x12')](function(_0x4845aa){logger[_0x5a51('0xd')](_0x5a51('0xf'),_0x390ef6,_0x4845aa);_0x5d98c9(_0x4845aa);});});} \ No newline at end of file +var _0x54f0=['message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x58ecd0,_0x100785){var _0x4cd009=function(_0x208c37){while(--_0x208c37){_0x58ecd0['push'](_0x58ecd0['shift']());}};_0x4cd009(++_0x100785);}(_0x54f0,0x1e5));var _0x054f=function(_0x40bb22,_0x1528ab){_0x40bb22=_0x40bb22-0x0;var _0x4179d5=_0x54f0[_0x40bb22];return _0x4179d5;};'use strict';var _=require(_0x054f('0x0'));var util=require(_0x054f('0x1'));var moment=require(_0x054f('0x2'));var BPromise=require(_0x054f('0x3'));var rs=require(_0x054f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x054f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x054f('0x6'));var jayson=require(_0x054f('0x7'));var client=jayson[_0x054f('0x8')][_0x054f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28f5ca,_0xb07aa8,_0x1541a7){return new BPromise(function(_0x11c8c4,_0x2b4ba9){return client[_0x054f('0xa')](_0x28f5ca,_0x1541a7)[_0x054f('0xb')](function(_0x37bf1d){logger[_0x054f('0xc')](_0x054f('0xd'),_0xb07aa8,_0x054f('0xe'));logger[_0x054f('0xf')](_0x054f('0x10'),_0xb07aa8,_0x054f('0xe'),JSON[_0x054f('0x11')](_0x37bf1d));if(_0x37bf1d['error']){if(_0x37bf1d[_0x054f('0x12')]['code']===0x1f4){logger[_0x054f('0x12')](_0x054f('0xd'),_0xb07aa8,_0x37bf1d[_0x054f('0x12')][_0x054f('0x13')]);return _0x2b4ba9(_0x37bf1d[_0x054f('0x12')][_0x054f('0x13')]);}logger['error'](_0x054f('0xd'),_0xb07aa8,_0x37bf1d[_0x054f('0x12')]['message']);return _0x11c8c4(_0x37bf1d['error'][_0x054f('0x13')]);}else{logger[_0x054f('0xc')](_0x054f('0xd'),_0xb07aa8,_0x054f('0xe'));_0x11c8c4(_0x37bf1d[_0x054f('0x14')][_0x054f('0x13')]);}})['catch'](function(_0x3b8548){logger['error'](_0x054f('0xd'),_0xb07aa8,_0x3b8548);_0x2b4ba9(_0x3b8548);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 7b9bac7..64c8219 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 _0x3f8a=['download','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x997fc0,_0x4e2661){var _0x6ac639=function(_0x5c1597){while(--_0x5c1597){_0x997fc0['push'](_0x997fc0['shift']());}};_0x6ac639(++_0x4e2661);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x25156f,_0x23c28b){_0x25156f=_0x25156f-0x0;var _0x37e691=_0x3f8a[_0x25156f];return _0x37e691;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var auth=require(_0xa3f8('0x5'));var interaction=require(_0xa3f8('0x6'));var config=require(_0xa3f8('0x7'));var controller=require(_0xa3f8('0x8'));router[_0xa3f8('0x9')]('/',auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xb')]);router[_0xa3f8('0x9')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xd')]);router[_0xa3f8('0x9')](_0xa3f8('0xe'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xf')]);router[_0xa3f8('0x10')]('/',auth['isAuthenticated'](),controller[_0xa3f8('0x11')]);router[_0xa3f8('0x12')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller['update']);router[_0xa3f8('0x13')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0x14')]);module[_0xa3f8('0x15')]=router; \ No newline at end of file +var _0x4819=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','index','isAuthenticated','show','/:id/download','post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x372f27,_0x1395fc){var _0x12b5f4=function(_0x461c8f){while(--_0x461c8f){_0x372f27['push'](_0x372f27['shift']());}};_0x12b5f4(++_0x1395fc);}(_0x4819,0xcd));var _0x9481=function(_0x2dd9b3,_0x1a705a){_0x2dd9b3=_0x2dd9b3-0x0;var _0x16db12=_0x4819[_0x2dd9b3];return _0x16db12;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var auth=require(_0x9481('0x5'));var interaction=require(_0x9481('0x6'));var config=require(_0x9481('0x7'));var controller=require(_0x9481('0x8'));router[_0x9481('0x9')]('/',auth['isAuthenticated'](),controller[_0x9481('0xa')]);router['get']('/:id',auth[_0x9481('0xb')](),controller[_0x9481('0xc')]);router[_0x9481('0x9')](_0x9481('0xd'),auth[_0x9481('0xb')](),controller['download']);router[_0x9481('0xe')]('/',auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['put'](_0x9481('0x10'),auth[_0x9481('0xb')](),controller[_0x9481('0x11')]);router[_0x9481('0x12')](_0x9481('0x10'),auth[_0x9481('0xb')](),controller[_0x9481('0x13')]);module[_0x9481('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 3d9c0cb..082e8ec 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 _0xaa1e=['TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0x37c10e,_0x2d34ba){var _0x254c62=function(_0x112fcc){while(--_0x112fcc){_0x37c10e['push'](_0x37c10e['shift']());}};_0x254c62(++_0x2d34ba);}(_0xaa1e,0x145));var _0xeaa1=function(_0x1b95a1,_0x529852){_0x1b95a1=_0x1b95a1-0x0;var _0x57aef1=_0xaa1e[_0x1b95a1];return _0x57aef1;};'use strict';var Sequelize=require(_0xeaa1('0x0'));module[_0xeaa1('0x1')]={'name':{'type':Sequelize[_0xeaa1('0x2')],'get':function(_0x207f4b){return this[_0xeaa1('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xeaa1('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xeaa1('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0xeaa1('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xeaa1('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xeaa1('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0xeaa1('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xeaa1('0x6')](_0xeaa1('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0xeaa1('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xeaa1('0x5')],'defaultValue':''},'stamp':{'type':_0xeaa1('0x8'),'allowNull':![]}}; \ No newline at end of file +var _0xd9c4=['sequelize','exports','getDataValue','STRING','BLOB','long','TIMESTAMP'];(function(_0x55c908,_0xc1dde3){var _0x5178fd=function(_0x1774d7){while(--_0x1774d7){_0x55c908['push'](_0x55c908['shift']());}};_0x5178fd(++_0xc1dde3);}(_0xd9c4,0x16c));var _0x4d9c=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0xd9c4[_0x311909];return _0x8d3163;};'use strict';var Sequelize=require(_0x4d9c('0x0'));module[_0x4d9c('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4988d2){return this[_0x4d9c('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x4d9c('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x4d9c('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x4d9c('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x4d9c('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x4d9c('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x4d9c('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x4d9c('0x4')](_0x4d9c('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x4d9c('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x4d9c('0x3')],'defaultValue':''},'stamp':{'type':_0x4d9c('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 6fc5f2c..2ded28f 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 _0x832b=['query','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','type','key','VIRTUAL','field','filter','options','VoiceMailMessage','includeAll','findAll','show','params','length','include','find','create','body','catch','download','msg_id','recording','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','model','keys'];(function(_0x500785,_0x15e5ff){var _0x1f8bcc=function(_0x406983){while(--_0x406983){_0x500785['push'](_0x500785['shift']());}};_0x1f8bcc(++_0x15e5ff);}(_0x832b,0x14a));var _0xb832=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x832b[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xb832('0x0'));var emlformat=require(_0xb832('0x1'));var rimraf=require(_0xb832('0x2'));var zipdir=require(_0xb832('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb832('0x4'));var BPromise=require(_0xb832('0x5'));var Mustache=require(_0xb832('0x6'));var util=require(_0xb832('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb832('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb832('0x9'));var jsforce=require(_0xb832('0xa'));var deskjs=require(_0xb832('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb832('0xc'));var Papa=require(_0xb832('0xd'));var Redis=require(_0xb832('0xe'));var authService=require(_0xb832('0xf'));var qs=require(_0xb832('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb832('0x11'));var utils=require(_0xb832('0x12'));var config=require('../../config/environment');var db=require(_0xb832('0x13'))['db'];function respondWithStatusCode(_0x5018a5,_0x1a1b0c){_0x1a1b0c=_0x1a1b0c||0xcc;return function(_0x44ac32){if(_0x44ac32){return _0x5018a5['sendStatus'](_0x1a1b0c);}return _0x5018a5['status'](_0x1a1b0c)[_0xb832('0x14')]();};}function respondWithResult(_0x439878,_0x50033d){_0x50033d=_0x50033d||0xc8;return function(_0x35a8d){if(_0x35a8d){return _0x439878[_0xb832('0x15')](_0x50033d)[_0xb832('0x16')](_0x35a8d);}};}function respondWithFilteredResult(_0xab0640,_0x465294){return function(_0x108f0b){if(_0x108f0b){var _0x55e8f8=_0x108f0b[_0xb832('0x17')],_0x27bab4=_0x465294[_0xb832('0x18')],_0x3dd762=_0x465294['offset']+_0x465294[_0xb832('0x19')],_0x433b8c;if(_0x3dd762>=_0x55e8f8){_0x3dd762=_0x55e8f8;_0x433b8c=0xc8;}else{_0x433b8c=0xce;}_0xab0640[_0xb832('0x15')](_0x433b8c);return _0xab0640[_0xb832('0x1a')]('Content-Range',_0x27bab4+'-'+_0x3dd762+'/'+_0x55e8f8)[_0xb832('0x16')](_0x108f0b);}return null;};}function patchUpdates(_0x13bef3){return function(_0x19198e){try{jsonpatch[_0xb832('0x1b')](_0x19198e,_0x13bef3,!![]);}catch(_0x330096){return BPromise[_0xb832('0x1c')](_0x330096);}return _0x19198e[_0xb832('0x1d')]();};}function saveUpdates(_0x55746c,_0x5a1684){return function(_0x2129c2){if(_0x2129c2){return _0x2129c2[_0xb832('0x1e')](_0x55746c)[_0xb832('0x1f')](function(_0x32bca9){return _0x32bca9;});}return null;};}function removeEntity(_0x2fc21a,_0xe984a2){return function(_0x31a1e5){if(_0x31a1e5){return _0x31a1e5[_0xb832('0x20')]()[_0xb832('0x1f')](function(){_0x2fc21a[_0xb832('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d841f,_0x58519c){return function(_0xfd1a83){if(!_0xfd1a83){_0x3d841f['sendStatus'](0x194);}return _0xfd1a83;};}function handleError(_0x753341,_0x141e6c){_0x141e6c=_0x141e6c||0x1f4;return function(_0x369dce){logger[_0xb832('0x21')](_0x369dce[_0xb832('0x22')]);if(_0x369dce['name']){delete _0x369dce[_0xb832('0x23')];}_0x753341['status'](_0x141e6c)[_0xb832('0x24')](_0x369dce);};}exports['index']=function(_0x1b114e,_0x1615b5){var _0x5b205d={},_0xccccf6={},_0x532bdc={'count':0x0,'rows':[]};var _0x34cdfd=db['VoiceMailMessage'][_0xb832('0x25')];_0xccccf6[_0xb832('0x26')]=_['differenceBy'](_[_0xb832('0x27')](_0x34cdfd),[_0xb832('0x23')]);_0xccccf6[_0xb832('0x28')]=_[_0xb832('0x27')](_0x1b114e[_0xb832('0x28')]);_0xccccf6[_0xb832('0x29')]=_[_0xb832('0x2a')](_0xccccf6[_0xb832('0x26')],_0xccccf6[_0xb832('0x28')]);_0x5b205d[_0xb832('0x2b')]=_['intersection'](_0xccccf6['model'],qs[_0xb832('0x2c')](_0x1b114e[_0xb832('0x28')][_0xb832('0x2c')]));_0x5b205d[_0xb832('0x2b')]=_0x5b205d['attributes']['length']?_0x5b205d[_0xb832('0x2b')]:_0xccccf6[_0xb832('0x26')];if(!_0x1b114e[_0xb832('0x28')]['hasOwnProperty'](_0xb832('0x2d'))){_0x5b205d['limit']=qs[_0xb832('0x19')](_0x1b114e['query'][_0xb832('0x19')]);_0x5b205d[_0xb832('0x18')]=qs[_0xb832('0x18')](_0x1b114e[_0xb832('0x28')][_0xb832('0x18')]);}_0x5b205d['order']=qs[_0xb832('0x2e')](_0x1b114e[_0xb832('0x28')][_0xb832('0x2e')]);_0x5b205d[_0xb832('0x2f')]=qs['filters'](_[_0xb832('0x30')](_0x1b114e[_0xb832('0x28')],_0xccccf6[_0xb832('0x29')]));if(_0x1b114e[_0xb832('0x28')]['filter']){_0x5b205d[_0xb832('0x2f')]=_[_0xb832('0x31')](_0x5b205d['where'],{'$or':_['map'](_0x34cdfd,function(_0x54d22b){if(_0x54d22b[_0xb832('0x32')][_0xb832('0x33')]!==_0xb832('0x34')){var _0x3c98de={};_0x3c98de[_0x54d22b[_0xb832('0x35')]]={'$like':'%'+_0x1b114e[_0xb832('0x28')][_0xb832('0x36')]+'%'};return _0x3c98de;}})});}_0x5b205d=_[_0xb832('0x31')]({},_0x5b205d,_0x1b114e[_0xb832('0x37')]);var _0x4be1b9={'where':_0x5b205d['where']};return db[_0xb832('0x38')][_0xb832('0x17')](_0x4be1b9)[_0xb832('0x1f')](function(_0x3b3041){_0x532bdc[_0xb832('0x17')]=_0x3b3041;if(_0x1b114e[_0xb832('0x28')][_0xb832('0x39')]){_0x5b205d['include']=[{'all':!![]}];}return db[_0xb832('0x38')][_0xb832('0x3a')](_0x5b205d);})['then'](function(_0x2c6f32){_0x532bdc['rows']=_0x2c6f32;return _0x532bdc;})[_0xb832('0x1f')](respondWithFilteredResult(_0x1615b5,_0x5b205d))['catch'](handleError(_0x1615b5,null));};exports[_0xb832('0x3b')]=function(_0x534d94,_0x251f1b){var _0x1c79da={'raw':!![],'where':{'id':_0x534d94[_0xb832('0x3c')]['id']}},_0x38a23c={};_0x38a23c['model']=_['keys'](db['VoiceMailMessage'][_0xb832('0x25')]);_0x38a23c[_0xb832('0x28')]=_[_0xb832('0x27')](_0x534d94[_0xb832('0x28')]);_0x38a23c[_0xb832('0x29')]=_[_0xb832('0x2a')](_0x38a23c[_0xb832('0x26')],_0x38a23c[_0xb832('0x28')]);_0x1c79da[_0xb832('0x2b')]=_['intersection'](_0x38a23c[_0xb832('0x26')],qs[_0xb832('0x2c')](_0x534d94[_0xb832('0x28')]['fields']));_0x1c79da['attributes']=_0x1c79da[_0xb832('0x2b')][_0xb832('0x3d')]?_0x1c79da['attributes']:_0x38a23c[_0xb832('0x26')];if(_0x534d94[_0xb832('0x28')]['includeAll']){_0x1c79da[_0xb832('0x3e')]=[{'all':!![]}];}_0x1c79da=_['merge']({},_0x1c79da,_0x534d94['options']);return db[_0xb832('0x38')][_0xb832('0x3f')](_0x1c79da)[_0xb832('0x1f')](handleEntityNotFound(_0x251f1b,null))[_0xb832('0x1f')](respondWithResult(_0x251f1b,null))['catch'](handleError(_0x251f1b,null));};exports[_0xb832('0x40')]=function(_0x165def,_0x36522f){return db[_0xb832('0x38')][_0xb832('0x40')](_0x165def[_0xb832('0x41')],{})['then'](respondWithResult(_0x36522f,0xc9))[_0xb832('0x42')](handleError(_0x36522f,null));};exports[_0xb832('0x1e')]=function(_0xabf9f,_0x55f487){if(_0xabf9f[_0xb832('0x41')]['id']){delete _0xabf9f['body']['id'];}return db[_0xb832('0x38')][_0xb832('0x3f')]({'where':{'id':_0xabf9f[_0xb832('0x3c')]['id']}})[_0xb832('0x1f')](handleEntityNotFound(_0x55f487,null))['then'](saveUpdates(_0xabf9f['body'],null))[_0xb832('0x1f')](respondWithResult(_0x55f487,null))[_0xb832('0x42')](handleError(_0x55f487,null));};exports[_0xb832('0x20')]=function(_0x30e6b4,_0x253006){return db[_0xb832('0x38')][_0xb832('0x3f')]({'where':{'id':_0x30e6b4[_0xb832('0x3c')]['id']}})['then'](handleEntityNotFound(_0x253006,null))[_0xb832('0x1f')](removeEntity(_0x253006,null))['catch'](handleError(_0x253006,null));};exports[_0xb832('0x43')]=function(_0x8b92e6,_0x48f584,_0xecc269){return db['VoiceMailMessage']['find']({'where':{'id':_0x8b92e6[_0xb832('0x3c')]['id']},'attributes':['id','recording',_0xb832('0x44')]})[_0xb832('0x1f')](handleEntityNotFound(_0x48f584,null))[_0xb832('0x1f')](function(_0x1ef6df){if(_0x1ef6df){if(!_0x1ef6df[_0xb832('0x45')]){throw new db['Sequelize']['ValidationError'](_0xb832('0x46'));}var _0x59cae0={'Content-Type':_0xb832('0x47'),'Content-Disposition':'attachment'};if(_0x1ef6df['msg_id']){_0x59cae0[_0xb832('0x48')]=_0xb832('0x49')+_0x1ef6df[_0xb832('0x44')]+'.wav\x22';}_0x48f584[_0xb832('0x1a')](_0x59cae0);return _0x48f584['send'](new Buffer(_0x1ef6df[_0xb832('0x45')]));}})[_0xb832('0x42')](handleError(_0x48f584,null));}; \ No newline at end of file +var _0x8b0c=['type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','merge','find','create','body','update','params','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','error','name','send','index','VoiceMailMessage','model','differenceBy','query','keys','intersection','attributes','fields','length','sort','where','filters','pick','filter','map'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x8b0c,0x1e7));var _0xc8b0=function(_0x1bf255,_0xab9e00){_0x1bf255=_0x1bf255-0x0;var _0x678697=_0x8b0c[_0x1bf255];return _0x678697;};'use strict';var pdf=require(_0xc8b0('0x0'));var emlformat=require(_0xc8b0('0x1'));var rimraf=require(_0xc8b0('0x2'));var zipdir=require(_0xc8b0('0x3'));var jsonpatch=require(_0xc8b0('0x4'));var rp=require('request-promise');var moment=require(_0xc8b0('0x5'));var BPromise=require(_0xc8b0('0x6'));var Mustache=require(_0xc8b0('0x7'));var util=require('util');var path=require(_0xc8b0('0x8'));var sox=require('sox');var csv=require(_0xc8b0('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc8b0('0xa'));var squel=require(_0xc8b0('0xb'));var crypto=require(_0xc8b0('0xc'));var jsforce=require(_0xc8b0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc8b0('0x9'));var querystring=require('querystring');var Papa=require(_0xc8b0('0xe'));var Redis=require(_0xc8b0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc8b0('0x10'));var hardwareService=require(_0xc8b0('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xc8b0('0x12'));var config=require('../../config/environment');var db=require(_0xc8b0('0x13'))['db'];function respondWithStatusCode(_0x40fb7f,_0x349169){_0x349169=_0x349169||0xcc;return function(_0x2593ba){if(_0x2593ba){return _0x40fb7f[_0xc8b0('0x14')](_0x349169);}return _0x40fb7f[_0xc8b0('0x15')](_0x349169)[_0xc8b0('0x16')]();};}function respondWithResult(_0x79cd2b,_0x4e1228){_0x4e1228=_0x4e1228||0xc8;return function(_0x12bdf0){if(_0x12bdf0){return _0x79cd2b[_0xc8b0('0x15')](_0x4e1228)[_0xc8b0('0x17')](_0x12bdf0);}};}function respondWithFilteredResult(_0x1f2569,_0x113928){return function(_0x29499d){if(_0x29499d){var _0x40ff42=_0x29499d[_0xc8b0('0x18')],_0x766601=_0x113928[_0xc8b0('0x19')],_0x1805d5=_0x113928['offset']+_0x113928[_0xc8b0('0x1a')],_0x75fd22;if(_0x1805d5>=_0x40ff42){_0x1805d5=_0x40ff42;_0x75fd22=0xc8;}else{_0x75fd22=0xce;}_0x1f2569['status'](_0x75fd22);return _0x1f2569[_0xc8b0('0x1b')](_0xc8b0('0x1c'),_0x766601+'-'+_0x1805d5+'/'+_0x40ff42)[_0xc8b0('0x17')](_0x29499d);}return null;};}function patchUpdates(_0x133ea7){return function(_0x8e5439){try{jsonpatch[_0xc8b0('0x1d')](_0x8e5439,_0x133ea7,!![]);}catch(_0x4c35da){return BPromise['reject'](_0x4c35da);}return _0x8e5439[_0xc8b0('0x1e')]();};}function saveUpdates(_0x538f99,_0x5f48fc){return function(_0x2dd10d){if(_0x2dd10d){return _0x2dd10d['update'](_0x538f99)[_0xc8b0('0x1f')](function(_0xaff199){return _0xaff199;});}return null;};}function removeEntity(_0x5b9506,_0x3d6181){return function(_0x107479){if(_0x107479){return _0x107479[_0xc8b0('0x20')]()['then'](function(){_0x5b9506[_0xc8b0('0x15')](0xcc)[_0xc8b0('0x16')]();});}};}function handleEntityNotFound(_0x41f389,_0x397979){return function(_0x5ad392){if(!_0x5ad392){_0x41f389[_0xc8b0('0x14')](0x194);}return _0x5ad392;};}function handleError(_0x228947,_0x3e9618){_0x3e9618=_0x3e9618||0x1f4;return function(_0x5cc58b){logger[_0xc8b0('0x21')](_0x5cc58b['stack']);if(_0x5cc58b[_0xc8b0('0x22')]){delete _0x5cc58b[_0xc8b0('0x22')];}_0x228947['status'](_0x3e9618)[_0xc8b0('0x23')](_0x5cc58b);};}exports[_0xc8b0('0x24')]=function(_0x17075,_0x2fb6ca){var _0x25089d={},_0x35a4eb={},_0x20da02={'count':0x0,'rows':[]};var _0x4ee043=db[_0xc8b0('0x25')]['rawAttributes'];_0x35a4eb[_0xc8b0('0x26')]=_[_0xc8b0('0x27')](_['keys'](_0x4ee043),[_0xc8b0('0x22')]);_0x35a4eb[_0xc8b0('0x28')]=_[_0xc8b0('0x29')](_0x17075['query']);_0x35a4eb['filters']=_[_0xc8b0('0x2a')](_0x35a4eb[_0xc8b0('0x26')],_0x35a4eb[_0xc8b0('0x28')]);_0x25089d[_0xc8b0('0x2b')]=_[_0xc8b0('0x2a')](_0x35a4eb[_0xc8b0('0x26')],qs[_0xc8b0('0x2c')](_0x17075['query'][_0xc8b0('0x2c')]));_0x25089d[_0xc8b0('0x2b')]=_0x25089d[_0xc8b0('0x2b')][_0xc8b0('0x2d')]?_0x25089d[_0xc8b0('0x2b')]:_0x35a4eb[_0xc8b0('0x26')];if(!_0x17075[_0xc8b0('0x28')]['hasOwnProperty']('nolimit')){_0x25089d['limit']=qs[_0xc8b0('0x1a')](_0x17075[_0xc8b0('0x28')][_0xc8b0('0x1a')]);_0x25089d[_0xc8b0('0x19')]=qs[_0xc8b0('0x19')](_0x17075[_0xc8b0('0x28')][_0xc8b0('0x19')]);}_0x25089d['order']=qs[_0xc8b0('0x2e')](_0x17075[_0xc8b0('0x28')][_0xc8b0('0x2e')]);_0x25089d[_0xc8b0('0x2f')]=qs[_0xc8b0('0x30')](_[_0xc8b0('0x31')](_0x17075[_0xc8b0('0x28')],_0x35a4eb[_0xc8b0('0x30')]));if(_0x17075['query'][_0xc8b0('0x32')]){_0x25089d[_0xc8b0('0x2f')]=_['merge'](_0x25089d[_0xc8b0('0x2f')],{'$or':_[_0xc8b0('0x33')](_0x4ee043,function(_0x3b286f){if(_0x3b286f[_0xc8b0('0x34')][_0xc8b0('0x35')]!==_0xc8b0('0x36')){var _0x5a19a8={};_0x5a19a8[_0x3b286f['field']]={'$like':'%'+_0x17075[_0xc8b0('0x28')][_0xc8b0('0x32')]+'%'};return _0x5a19a8;}})});}_0x25089d=_['merge']({},_0x25089d,_0x17075[_0xc8b0('0x37')]);var _0x40298f={'where':_0x25089d[_0xc8b0('0x2f')]};return db[_0xc8b0('0x25')][_0xc8b0('0x18')](_0x40298f)[_0xc8b0('0x1f')](function(_0x16bbad){_0x20da02[_0xc8b0('0x18')]=_0x16bbad;if(_0x17075['query'][_0xc8b0('0x38')]){_0x25089d[_0xc8b0('0x39')]=[{'all':!![]}];}return db[_0xc8b0('0x25')][_0xc8b0('0x3a')](_0x25089d);})[_0xc8b0('0x1f')](function(_0x3c0b06){_0x20da02[_0xc8b0('0x3b')]=_0x3c0b06;return _0x20da02;})[_0xc8b0('0x1f')](respondWithFilteredResult(_0x2fb6ca,_0x25089d))[_0xc8b0('0x3c')](handleError(_0x2fb6ca,null));};exports[_0xc8b0('0x3d')]=function(_0x1bcf43,_0x4f0c9e){var _0x42edcb={'raw':!![],'where':{'id':_0x1bcf43['params']['id']}},_0x40ad61={};_0x40ad61[_0xc8b0('0x26')]=_[_0xc8b0('0x29')](db[_0xc8b0('0x25')][_0xc8b0('0x3e')]);_0x40ad61[_0xc8b0('0x28')]=_[_0xc8b0('0x29')](_0x1bcf43['query']);_0x40ad61[_0xc8b0('0x30')]=_[_0xc8b0('0x2a')](_0x40ad61[_0xc8b0('0x26')],_0x40ad61[_0xc8b0('0x28')]);_0x42edcb['attributes']=_[_0xc8b0('0x2a')](_0x40ad61[_0xc8b0('0x26')],qs[_0xc8b0('0x2c')](_0x1bcf43[_0xc8b0('0x28')][_0xc8b0('0x2c')]));_0x42edcb[_0xc8b0('0x2b')]=_0x42edcb[_0xc8b0('0x2b')][_0xc8b0('0x2d')]?_0x42edcb[_0xc8b0('0x2b')]:_0x40ad61[_0xc8b0('0x26')];if(_0x1bcf43[_0xc8b0('0x28')][_0xc8b0('0x38')]){_0x42edcb[_0xc8b0('0x39')]=[{'all':!![]}];}_0x42edcb=_[_0xc8b0('0x3f')]({},_0x42edcb,_0x1bcf43[_0xc8b0('0x37')]);return db['VoiceMailMessage'][_0xc8b0('0x40')](_0x42edcb)[_0xc8b0('0x1f')](handleEntityNotFound(_0x4f0c9e,null))[_0xc8b0('0x1f')](respondWithResult(_0x4f0c9e,null))[_0xc8b0('0x3c')](handleError(_0x4f0c9e,null));};exports[_0xc8b0('0x41')]=function(_0x4b4270,_0x7a6259){return db[_0xc8b0('0x25')]['create'](_0x4b4270[_0xc8b0('0x42')],{})[_0xc8b0('0x1f')](respondWithResult(_0x7a6259,0xc9))[_0xc8b0('0x3c')](handleError(_0x7a6259,null));};exports[_0xc8b0('0x43')]=function(_0x105f1c,_0x4d059c){if(_0x105f1c['body']['id']){delete _0x105f1c[_0xc8b0('0x42')]['id'];}return db[_0xc8b0('0x25')][_0xc8b0('0x40')]({'where':{'id':_0x105f1c[_0xc8b0('0x44')]['id']}})[_0xc8b0('0x1f')](handleEntityNotFound(_0x4d059c,null))[_0xc8b0('0x1f')](saveUpdates(_0x105f1c[_0xc8b0('0x42')],null))['then'](respondWithResult(_0x4d059c,null))[_0xc8b0('0x3c')](handleError(_0x4d059c,null));};exports[_0xc8b0('0x20')]=function(_0x126b36,_0x4fcd7d){return db[_0xc8b0('0x25')][_0xc8b0('0x40')]({'where':{'id':_0x126b36[_0xc8b0('0x44')]['id']}})[_0xc8b0('0x1f')](handleEntityNotFound(_0x4fcd7d,null))['then'](removeEntity(_0x4fcd7d,null))['catch'](handleError(_0x4fcd7d,null));};exports['download']=function(_0x2e56cb,_0x22a85d,_0x419312){return db[_0xc8b0('0x25')]['find']({'where':{'id':_0x2e56cb['params']['id']},'attributes':['id',_0xc8b0('0x45'),'msg_id']})[_0xc8b0('0x1f')](handleEntityNotFound(_0x22a85d,null))[_0xc8b0('0x1f')](function(_0xe0b165){if(_0xe0b165){if(!_0xe0b165[_0xc8b0('0x45')]){throw new db[(_0xc8b0('0x46'))]['ValidationError'](_0xc8b0('0x47'));}var _0x16837a={'Content-Type':_0xc8b0('0x48'),'Content-Disposition':_0xc8b0('0x49')};if(_0xe0b165[_0xc8b0('0x4a')]){_0x16837a[_0xc8b0('0x4b')]=_0xc8b0('0x4c')+_0xe0b165[_0xc8b0('0x4a')]+'.wav\x22';}_0x22a85d['set'](_0x16837a);return _0x22a85d[_0xc8b0('0x23')](new Buffer(_0xe0b165['recording']));}})[_0xc8b0('0x3c')](handleError(_0x22a85d,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 8becb68..a725d99 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 _0xc533=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xc533,0x103));var _0x3c53=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0xc533[_0x3d4876];return _0x58ca9d;};'use strict';var _=require(_0x3c53('0x0'));var util=require(_0x3c53('0x1'));var logger=require(_0x3c53('0x2'))('api');var moment=require(_0x3c53('0x3'));var BPromise=require('bluebird');var rp=require(_0x3c53('0x4'));var fs=require('fs');var path=require(_0x3c53('0x5'));var rimraf=require(_0x3c53('0x6'));var config=require(_0x3c53('0x7'));var attributes=require('./voiceMailMessage.attributes');module[_0x3c53('0x8')]=function(_0xdc3b45,_0x1addb7){return _0xdc3b45[_0x3c53('0x9')](_0x3c53('0xa'),attributes,{'tableName':_0x3c53('0xb'),'paranoid':![],'indexes':[{'name':_0x3c53('0xc'),'fields':[_0x3c53('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x8609=['bluebird','rimraf','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','api','moment'];(function(_0x3a4aee,_0x23153c){var _0x77e109=function(_0x39c23b){while(--_0x39c23b){_0x3a4aee['push'](_0x3a4aee['shift']());}};_0x77e109(++_0x23153c);}(_0x8609,0x80));var _0x9860=function(_0x3d9af7,_0x490308){_0x3d9af7=_0x3d9af7-0x0;var _0x54e7=_0x8609[_0x3d9af7];return _0x54e7;};'use strict';var _=require(_0x9860('0x0'));var util=require('util');var logger=require(_0x9860('0x1'))(_0x9860('0x2'));var moment=require(_0x9860('0x3'));var BPromise=require(_0x9860('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9860('0x5'));var config=require('../../config/environment');var attributes=require(_0x9860('0x6'));module[_0x9860('0x7')]=function(_0x1f5534,_0x87bb50){return _0x1f5534[_0x9860('0x8')](_0x9860('0x9'),attributes,{'tableName':_0x9860('0xa'),'paranoid':![],'indexes':[{'name':_0x9860('0xb'),'fields':[_0x9860('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index d4baa32..a169749 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 _0x14a0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x4fe063,_0x132895){var _0x410f96=function(_0x58c139){while(--_0x58c139){_0x4fe063['push'](_0x4fe063['shift']());}};_0x410f96(++_0x132895);}(_0x14a0,0x8e));var _0x014a=function(_0x1f5763,_0x3ed2c8){_0x1f5763=_0x1f5763-0x0;var _0x221aa4=_0x14a0[_0x1f5763];return _0x221aa4;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});} \ No newline at end of file +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(_0x266bc4,_0x1a6d2f){var _0x2ac4c6=function(_0x3678c9){while(--_0x3678c9){_0x266bc4['push'](_0x266bc4['shift']());}};_0x2ac4c6(++_0x1a6d2f);}(_0x57ca,0x108));var _0xa57c=function(_0x570844,_0x1f4bef){_0x570844=_0x570844-0x0;var _0x3c69f0=_0x57ca[_0x570844];return _0x3c69f0;};'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 diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 8f626c8..99bf4c5 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 _0x1024=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/sounds','getSounds','post','create','addSound','put','update','delete','destroy','/:id/sounds/:id2'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x1024,0x140));var _0x4102=function(_0x1e5e1f,_0x2b5e99){_0x1e5e1f=_0x1e5e1f-0x0;var _0x3782bd=_0x1024[_0x1e5e1f];return _0x3782bd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4102('0x0'));var timeout=require('connect-timeout');var express=require(_0x4102('0x1'));var router=express[_0x4102('0x2')]();var auth=require(_0x4102('0x3'));var interaction=require(_0x4102('0x4'));var config=require(_0x4102('0x5'));var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth[_0x4102('0x6')](),controller['index']);router[_0x4102('0x7')](_0x4102('0x8'),auth['isAuthenticated'](),controller[_0x4102('0x9')]);router['get'](_0x4102('0xa'),auth[_0x4102('0x6')](),controller[_0x4102('0xb')]);router[_0x4102('0xc')]('/',auth[_0x4102('0x6')](),controller[_0x4102('0xd')]);router[_0x4102('0xc')]('/:id/sounds',auth[_0x4102('0x6')](),controller[_0x4102('0xe')]);router[_0x4102('0xf')](_0x4102('0x8'),auth[_0x4102('0x6')](),controller[_0x4102('0x10')]);router[_0x4102('0x11')](_0x4102('0x8'),auth[_0x4102('0x6')](),controller[_0x4102('0x12')]);router[_0x4102('0x11')](_0x4102('0x13'),auth[_0x4102('0x6')](),controller['removeSound']);module['exports']=router; \ No newline at end of file +var _0x6e09=['isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','create','put','update','delete','destroy','removeSound','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get'];(function(_0x1eb6e6,_0x3a4687){var _0x33c9b1=function(_0x114c04){while(--_0x114c04){_0x1eb6e6['push'](_0x1eb6e6['shift']());}};_0x33c9b1(++_0x3a4687);}(_0x6e09,0x122));var _0x96e0=function(_0x5be652,_0x129d44){_0x5be652=_0x5be652-0x0;var _0x3c89da=_0x6e09[_0x5be652];return _0x3c89da;};'use strict';var multer=require(_0x96e0('0x0'));var util=require(_0x96e0('0x1'));var path=require(_0x96e0('0x2'));var timeout=require(_0x96e0('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x96e0('0x4'));var interaction=require(_0x96e0('0x5'));var config=require(_0x96e0('0x6'));var controller=require(_0x96e0('0x7'));router[_0x96e0('0x8')]('/',auth[_0x96e0('0x9')](),controller[_0x96e0('0xa')]);router['get'](_0x96e0('0xb'),auth[_0x96e0('0x9')](),controller[_0x96e0('0xc')]);router[_0x96e0('0x8')](_0x96e0('0xd'),auth[_0x96e0('0x9')](),controller[_0x96e0('0xe')]);router[_0x96e0('0xf')]('/',auth[_0x96e0('0x9')](),controller[_0x96e0('0x10')]);router[_0x96e0('0xf')](_0x96e0('0xd'),auth[_0x96e0('0x9')](),controller['addSound']);router[_0x96e0('0x11')]('/:id',auth[_0x96e0('0x9')](),controller[_0x96e0('0x12')]);router[_0x96e0('0x13')](_0x96e0('0xb'),auth[_0x96e0('0x9')](),controller[_0x96e0('0x14')]);router[_0x96e0('0x13')]('/:id/sounds/:id2',auth[_0x96e0('0x9')](),controller[_0x96e0('0x15')]);module[_0x96e0('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 3436709..1f0f692 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 _0xd1c8=['exports','STRING','name','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x5add7b,_0x29ccbe){var _0x216aa9=function(_0x2acce3){while(--_0x2acce3){_0x5add7b['push'](_0x5add7b['shift']());}};_0x216aa9(++_0x29ccbe);}(_0xd1c8,0x12b));var _0x8d1c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd1c8[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x8d1c('0x0'));module[_0x8d1c('0x1')]={'name':{'type':Sequelize[_0x8d1c('0x2')],'allowNull':![],'unique':_0x8d1c('0x3')},'mode':{'type':Sequelize['ENUM']('custom',_0x8d1c('0x4'),_0x8d1c('0x5'),_0x8d1c('0x6'),_0x8d1c('0x7'),_0x8d1c('0x8')),'allowNull':!![],'defaultValue':_0x8d1c('0x4')},'directory':{'type':Sequelize[_0x8d1c('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x8d1c('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x8d1c('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8d1c('0x9')},'format':{'type':Sequelize[_0x8d1c('0x2')],'allowNull':!![]},'stamp':{'type':_0x8d1c('0xa')},'defaultEntry':{'type':Sequelize[_0x8d1c('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xef64=['name','ENUM','custom','files','mp3nb','quietmp3','mp3','STRING','alpha','TIMESTAMP','BOOLEAN','exports'];(function(_0x391e86,_0x125cbe){var _0x53f888=function(_0x63ef1a){while(--_0x63ef1a){_0x391e86['push'](_0x391e86['shift']());}};_0x53f888(++_0x125cbe);}(_0xef64,0x137));var _0x4ef6=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xef64[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require('sequelize');module[_0x4ef6('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4ef6('0x1')},'mode':{'type':Sequelize[_0x4ef6('0x2')](_0x4ef6('0x3'),_0x4ef6('0x4'),_0x4ef6('0x5'),'quietmp3nb',_0x4ef6('0x6'),_0x4ef6('0x7')),'allowNull':!![],'defaultValue':_0x4ef6('0x4')},'directory':{'type':Sequelize[_0x4ef6('0x8')],'allowNull':!![]},'application':{'type':Sequelize[_0x4ef6('0x8')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x4ef6('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x4ef6('0xa')},'defaultEntry':{'type':Sequelize[_0x4ef6('0xb')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 5c68b6c..5611317 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 _0x33ff=['basename','extname','server/files/moh','symlinkSync','removeSound','id2','format','%s.%s','getSounds','html-pdf','eml-format','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/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','apply','save','then','destroy','MusicOnHolds','UserProfileResource','error','name','send','index','VoiceMusicOnHold','model','keys','filters','intersection','fields','length','attributes','query','hasOwnProperty','order','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','includeAll','include','rows','catch','rawAttributes','find','update','params','body','create','transaction','files','directory','join','root','mode','mkdirSync','0777','user','get','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33ff,0xe1));var _0xf33f=function(_0x14405c,_0x12b9b9){_0x14405c=_0x14405c-0x0;var _0x5d54ba=_0x33ff[_0x14405c];return _0x5d54ba;};'use strict';var pdf=require(_0xf33f('0x0'));var emlformat=require(_0xf33f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf33f('0x2'));var jsonpatch=require(_0xf33f('0x3'));var rp=require(_0xf33f('0x4'));var moment=require('moment');var BPromise=require(_0xf33f('0x5'));var Mustache=require(_0xf33f('0x6'));var util=require('util');var path=require(_0xf33f('0x7'));var sox=require(_0xf33f('0x8'));var csv=require(_0xf33f('0x9'));var ejs=require(_0xf33f('0xa'));var fs=require('fs');var _=require(_0xf33f('0xb'));var squel=require(_0xf33f('0xc'));var crypto=require('crypto');var jsforce=require(_0xf33f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf33f('0x9'));var querystring=require(_0xf33f('0xe'));var Papa=require(_0xf33f('0xf'));var Redis=require(_0xf33f('0x10'));var authService=require(_0xf33f('0x11'));var qs=require(_0xf33f('0x12'));var hardwareService=require(_0xf33f('0x13'));var logger=require(_0xf33f('0x14'))(_0xf33f('0x15'));var utils=require(_0xf33f('0x16'));var config=require(_0xf33f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x462548,_0x1a8eda){_0x1a8eda=_0x1a8eda||0xcc;return function(_0x3a5d05){if(_0x3a5d05){return _0x462548[_0xf33f('0x18')](_0x1a8eda);}return _0x462548[_0xf33f('0x19')](_0x1a8eda)[_0xf33f('0x1a')]();};}function respondWithResult(_0x38dcea,_0x47d586){_0x47d586=_0x47d586||0xc8;return function(_0x5749d7){if(_0x5749d7){return _0x38dcea[_0xf33f('0x19')](_0x47d586)[_0xf33f('0x1b')](_0x5749d7);}};}function respondWithFilteredResult(_0x29e7aa,_0xb44070){return function(_0x3bee42){if(_0x3bee42){var _0x4bf71b=_0x3bee42[_0xf33f('0x1c')],_0x1c28b5=_0xb44070['offset'],_0x26fe50=_0xb44070[_0xf33f('0x1d')]+_0xb44070[_0xf33f('0x1e')],_0xb6eabd;if(_0x26fe50>=_0x4bf71b){_0x26fe50=_0x4bf71b;_0xb6eabd=0xc8;}else{_0xb6eabd=0xce;}_0x29e7aa[_0xf33f('0x19')](_0xb6eabd);return _0x29e7aa['set']('Content-Range',_0x1c28b5+'-'+_0x26fe50+'/'+_0x4bf71b)['json'](_0x3bee42);}return null;};}function patchUpdates(_0x395e70){return function(_0x1865df){try{jsonpatch[_0xf33f('0x1f')](_0x1865df,_0x395e70,!![]);}catch(_0x5d07be){return BPromise['reject'](_0x5d07be);}return _0x1865df[_0xf33f('0x20')]();};}function saveUpdates(_0x2c1b2b,_0x3d98b3){return function(_0x4a6e46){if(_0x4a6e46){return _0x4a6e46['update'](_0x2c1b2b)[_0xf33f('0x21')](function(_0x2ecea5){return _0x2ecea5;});}return null;};}function removeEntity(_0x432a9f,_0x1fdcbc){return function(_0x1eea17){if(_0x1eea17){return _0x1eea17[_0xf33f('0x22')]()[_0xf33f('0x21')](function(){var _0x44292b=_0x1eea17['get']({'plain':!![]});var _0x4629fd=_0xf33f('0x23');return db[_0xf33f('0x24')]['destroy']({'where':{'type':_0x4629fd,'resourceId':_0x44292b['id']}})[_0xf33f('0x21')](function(){return _0x1eea17;});})[_0xf33f('0x21')](function(){_0x432a9f[_0xf33f('0x19')](0xcc)[_0xf33f('0x1a')]();});}};}function handleEntityNotFound(_0x5725ca,_0x5690a8){return function(_0x143a8f){if(!_0x143a8f){_0x5725ca[_0xf33f('0x18')](0x194);}return _0x143a8f;};}function handleError(_0x5cff98,_0x596774){_0x596774=_0x596774||0x1f4;return function(_0x4f7bc5){logger[_0xf33f('0x25')](_0x4f7bc5['stack']);if(_0x4f7bc5[_0xf33f('0x26')]){delete _0x4f7bc5[_0xf33f('0x26')];}_0x5cff98[_0xf33f('0x19')](_0x596774)[_0xf33f('0x27')](_0x4f7bc5);};}exports[_0xf33f('0x28')]=function(_0x4fac5b,_0x1ed3ad){var _0x24cc6d={},_0x36a9fb={},_0x207961={'count':0x0,'rows':[]};var _0x531f8b=db[_0xf33f('0x29')]['rawAttributes'];_0x36a9fb[_0xf33f('0x2a')]=_[_0xf33f('0x2b')](_0x531f8b);_0x36a9fb['query']=_[_0xf33f('0x2b')](_0x4fac5b['query']);_0x36a9fb[_0xf33f('0x2c')]=_[_0xf33f('0x2d')](_0x36a9fb['model'],_0x36a9fb['query']);_0x24cc6d['attributes']=_[_0xf33f('0x2d')](_0x36a9fb[_0xf33f('0x2a')],qs[_0xf33f('0x2e')](_0x4fac5b['query'][_0xf33f('0x2e')]));_0x24cc6d['attributes']=_0x24cc6d['attributes'][_0xf33f('0x2f')]?_0x24cc6d[_0xf33f('0x30')]:_0x36a9fb[_0xf33f('0x2a')];if(!_0x4fac5b[_0xf33f('0x31')][_0xf33f('0x32')]('nolimit')){_0x24cc6d[_0xf33f('0x1e')]=qs[_0xf33f('0x1e')](_0x4fac5b['query'][_0xf33f('0x1e')]);_0x24cc6d['offset']=qs[_0xf33f('0x1d')](_0x4fac5b[_0xf33f('0x31')]['offset']);}_0x24cc6d[_0xf33f('0x33')]=qs[_0xf33f('0x34')](_0x4fac5b[_0xf33f('0x31')][_0xf33f('0x34')]);_0x24cc6d[_0xf33f('0x35')]=qs['filters'](_[_0xf33f('0x36')](_0x4fac5b['query'],_0x36a9fb['filters']));if(_0x4fac5b[_0xf33f('0x31')]['filter']){_0x24cc6d[_0xf33f('0x35')]=_[_0xf33f('0x37')](_0x24cc6d[_0xf33f('0x35')],{'$or':_[_0xf33f('0x38')](_0x531f8b,function(_0x145299){if(_0x145299[_0xf33f('0x39')][_0xf33f('0x3a')]!==_0xf33f('0x3b')){var _0x23d559={};_0x23d559[_0x145299['field']]={'$like':'%'+_0x4fac5b[_0xf33f('0x31')][_0xf33f('0x3c')]+'%'};return _0x23d559;}})});}_0x24cc6d=_['merge']({},_0x24cc6d,_0x4fac5b[_0xf33f('0x3d')]);var _0x22f45d={'where':_0x24cc6d['where']};return db[_0xf33f('0x29')][_0xf33f('0x1c')](_0x22f45d)[_0xf33f('0x21')](function(_0x5ec869){_0x207961['count']=_0x5ec869;if(_0x4fac5b['query'][_0xf33f('0x3e')]){_0x24cc6d[_0xf33f('0x3f')]=[{'all':!![]}];}return db[_0xf33f('0x29')]['findAll'](_0x24cc6d);})[_0xf33f('0x21')](function(_0x324e23){_0x207961[_0xf33f('0x40')]=_0x324e23;return _0x207961;})[_0xf33f('0x21')](respondWithFilteredResult(_0x1ed3ad,_0x24cc6d))[_0xf33f('0x41')](handleError(_0x1ed3ad,null));};exports['show']=function(_0x32e1c3,_0x11fdb1){var _0x121e46={'raw':![],'where':{'id':_0x32e1c3['params']['id']}},_0x6b86b4={};_0x6b86b4[_0xf33f('0x2a')]=_['keys'](db[_0xf33f('0x29')][_0xf33f('0x42')]);_0x6b86b4['query']=_['keys'](_0x32e1c3[_0xf33f('0x31')]);_0x6b86b4[_0xf33f('0x2c')]=_[_0xf33f('0x2d')](_0x6b86b4[_0xf33f('0x2a')],_0x6b86b4[_0xf33f('0x31')]);_0x121e46[_0xf33f('0x30')]=_['intersection'](_0x6b86b4[_0xf33f('0x2a')],qs[_0xf33f('0x2e')](_0x32e1c3[_0xf33f('0x31')][_0xf33f('0x2e')]));_0x121e46[_0xf33f('0x30')]=_0x121e46[_0xf33f('0x30')][_0xf33f('0x2f')]?_0x121e46['attributes']:_0x6b86b4[_0xf33f('0x2a')];if(_0x32e1c3[_0xf33f('0x31')][_0xf33f('0x3e')]){_0x121e46[_0xf33f('0x3f')]=[{'all':!![]}];}_0x121e46=_['merge']({},_0x121e46,_0x32e1c3[_0xf33f('0x3d')]);return db[_0xf33f('0x29')][_0xf33f('0x43')](_0x121e46)[_0xf33f('0x21')](handleEntityNotFound(_0x11fdb1,null))[_0xf33f('0x21')](respondWithResult(_0x11fdb1,null))[_0xf33f('0x41')](handleError(_0x11fdb1,null));};exports[_0xf33f('0x44')]=function(_0x3ac966,_0x516d82){if(_0x3ac966['body']['id']){delete _0x3ac966['body']['id'];}return db['VoiceMusicOnHold'][_0xf33f('0x43')]({'where':{'id':_0x3ac966[_0xf33f('0x45')]['id']}})['then'](handleEntityNotFound(_0x516d82,null))[_0xf33f('0x21')](saveUpdates(_0x3ac966[_0xf33f('0x46')],null))[_0xf33f('0x21')](respondWithResult(_0x516d82,null))[_0xf33f('0x41')](handleError(_0x516d82,null));};exports[_0xf33f('0x47')]=function(_0x5b73a0,_0x13dbba,_0x4431d8){return db['sequelize'][_0xf33f('0x48')](function(_0x528556){if(_0x5b73a0[_0xf33f('0x46')]['mode']===_0xf33f('0x49')){_0x5b73a0[_0xf33f('0x46')][_0xf33f('0x4a')]=path[_0xf33f('0x4b')](config[_0xf33f('0x4c')],'server/files/moh',_0x5b73a0['body'][_0xf33f('0x26')]);}return db[_0xf33f('0x29')][_0xf33f('0x47')](_0x5b73a0[_0xf33f('0x46')],{'transaction':_0x528556})[_0xf33f('0x21')](function(_0x4ce052){if(_0x5b73a0[_0xf33f('0x46')][_0xf33f('0x4d')]===_0xf33f('0x49')){fs[_0xf33f('0x4e')](_0x4ce052[_0xf33f('0x4a')],parseInt(_0xf33f('0x4f'),0x8));}var _0x31bd2b=_0x5b73a0[_0xf33f('0x50')][_0xf33f('0x51')]({'plain':!![]});if(!_0x31bd2b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31bd2b[_0xf33f('0x52')]===_0xf33f('0x50')){var _0x4442a6=_0x4ce052[_0xf33f('0x51')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x31bd2b[_0xf33f('0x53')]},'raw':!![]})[_0xf33f('0x21')](function(_0x425e6f){if(_0x425e6f&&_0x425e6f['autoAssociation']===0x0){return db[_0xf33f('0x24')]['create']({'name':_0x4442a6[_0xf33f('0x26')],'resourceId':_0x4442a6['id'],'type':_0x425e6f[_0xf33f('0x26')],'sectionId':_0x425e6f['id']},{})[_0xf33f('0x21')](function(){return _0x4ce052;});}else{return _0x4ce052;}})[_0xf33f('0x41')](function(_0x36b38d){logger[_0xf33f('0x25')](_0xf33f('0x54'),_0x36b38d);});}return _0x4ce052;});})['then'](respondWithResult(_0x13dbba,0xc9))[_0xf33f('0x41')](handleError(_0x13dbba,null));};exports['destroy']=function(_0x131b7b,_0x5883bb,_0x4a8c60){var _0x311ec9;return db[_0xf33f('0x29')][_0xf33f('0x43')]({'where':{'id':_0x131b7b[_0xf33f('0x45')]['id']}})['then'](function(_0x3ec9fc){if(_0x3ec9fc){return db[_0xf33f('0x55')][_0xf33f('0x48')](function(_0x196f92){return _0x3ec9fc[_0xf33f('0x22')]({'transaction':_0x196f92,'raw':!![]})[_0xf33f('0x21')](function(_0x7982d9){if(_0x7982d9[_0xf33f('0x4a')]){fs['readdirSync'](_0x7982d9['directory'])[_0xf33f('0x56')](function(_0xbe22fd){fs[_0xf33f('0x57')](path[_0xf33f('0x4b')](_0x7982d9[_0xf33f('0x4a')],_0xbe22fd));});fs[_0xf33f('0x58')](_0x7982d9['directory']);}return _0x7982d9;});})[_0xf33f('0x41')](function(_0x331fb7){throw new db[(_0xf33f('0x59'))][(_0xf33f('0x5a'))](_0x331fb7[_0xf33f('0x5b')]);});}})[_0xf33f('0x21')](handleEntityNotFound(_0x5883bb,null))[_0xf33f('0x21')](removeEntity(_0x5883bb,null))[_0xf33f('0x41')](handleError(_0x5883bb,null));};exports['addSound']=function(_0x2e6979,_0x130ec1,_0x53cf31){return db[_0xf33f('0x55')]['transaction'](function(_0x4b5e81){var _0x4d7f68;return db['VoiceMusicOnHold'][_0xf33f('0x43')]({'where':{'id':_0x2e6979['params']['id']}})['then'](function(_0x3aa124){if(_0x3aa124){_0x4d7f68=_0x3aa124;return _0x3aa124[_0xf33f('0x5c')](_0x2e6979[_0xf33f('0x46')]['id'],{'transaction':_0x4b5e81});}})[_0xf33f('0x21')](function(_0x34eea5){if(_0x34eea5){return db[_0xf33f('0x5d')][_0xf33f('0x5e')]({'where':{'id':_0x2e6979[_0xf33f('0x46')]['id']},'attributes':['id','name',_0xf33f('0x5f'),_0xf33f('0x60'),_0xf33f('0x61')],'raw':!![]});}})[_0xf33f('0x21')](function(_0x28cff8){if(_0x28cff8){var _0x4bcab4=path[_0xf33f('0x4b')](config['root'],_0xf33f('0x62'),util['format']('%s.%s',path[_0xf33f('0x63')](_0x28cff8[_0xf33f('0x5f')],path[_0xf33f('0x64')](_0x28cff8['save_name'])),_0x28cff8[_0xf33f('0x60')]));var _0x3507f1=path[_0xf33f('0x4b')](config[_0xf33f('0x4c')],_0xf33f('0x65'),_0x4d7f68[_0xf33f('0x26')],util['format']('%s.%s',_0x28cff8['name'],_0x28cff8['converted_format']));fs[_0xf33f('0x66')](_0x4bcab4,_0x3507f1);return _0x28cff8;}})['catch'](function(_0x46c3ce){throw new db[(_0xf33f('0x59'))]['ValidationError'](_0x46c3ce[_0xf33f('0x5b')]);});})['then'](handleEntityNotFound(_0x130ec1,null))['then'](respondWithResult(_0x130ec1,0xc9))[_0xf33f('0x41')](handleError(_0x130ec1,null));};exports[_0xf33f('0x67')]=function(_0x328362,_0x389336,_0x372256){return db[_0xf33f('0x55')]['transaction'](function(_0x21a2ff){var _0x4e2439;return db[_0xf33f('0x29')][_0xf33f('0x5e')]({'where':{'id':_0x328362[_0xf33f('0x45')]['id']}})['then'](handleEntityNotFound(_0x389336,null))['then'](function(_0xe48e39){if(_0xe48e39){_0x4e2439=_0xe48e39;return _0xe48e39[_0xf33f('0x67')](_0x328362[_0xf33f('0x45')][_0xf33f('0x68')]);}})[_0xf33f('0x21')](function(_0x1d0c6a){if(_0x1d0c6a){return db['Sound'][_0xf33f('0x5e')]({'where':{'id':_0x328362[_0xf33f('0x45')][_0xf33f('0x68')]},'attributes':['id','name','save_name',_0xf33f('0x60'),_0xf33f('0x61')],'raw':!![]});}})[_0xf33f('0x21')](function(_0x306a0f){if(_0x306a0f){fs[_0xf33f('0x57')](path[_0xf33f('0x4b')](_0x4e2439[_0xf33f('0x4a')],util[_0xf33f('0x69')](_0xf33f('0x6a'),_0x306a0f[_0xf33f('0x26')],_0x306a0f[_0xf33f('0x60')])));return _0x306a0f;}})[_0xf33f('0x41')](function(_0x5703fc){throw new db['Sequelize'][(_0xf33f('0x5a'))](_0x5703fc[_0xf33f('0x5b')]);});})[_0xf33f('0x21')](handleEntityNotFound(_0x389336,null))['then'](respondWithStatusCode(_0x389336,0xcc))['catch'](handleError(_0x389336,null));};exports[_0xf33f('0x6b')]=function(_0x410529,_0x454ff3,_0x5b917b){var _0xad5f74={};var _0x28b83c={};var _0x48f161;var _0x2ee72b;return db[_0xf33f('0x29')][_0xf33f('0x5e')]({'where':{'id':_0x410529[_0xf33f('0x45')]['id']}})[_0xf33f('0x21')](handleEntityNotFound(_0x454ff3,null))[_0xf33f('0x21')](function(_0x3ab1c7){if(_0x3ab1c7){_0x48f161=_0x3ab1c7;_0x28b83c[_0xf33f('0x2a')]=_[_0xf33f('0x2b')](db[_0xf33f('0x5d')][_0xf33f('0x42')]);_0x28b83c['query']=_['keys'](_0x410529[_0xf33f('0x31')]);_0x28b83c[_0xf33f('0x2c')]=_[_0xf33f('0x2d')](_0x28b83c[_0xf33f('0x2a')],_0x28b83c[_0xf33f('0x31')]);_0xad5f74[_0xf33f('0x30')]=_[_0xf33f('0x2d')](_0x28b83c[_0xf33f('0x2a')],qs[_0xf33f('0x2e')](_0x410529['query'][_0xf33f('0x2e')]));_0xad5f74[_0xf33f('0x30')]=_0xad5f74['attributes']['length']?_0xad5f74['attributes']:_0x28b83c['model'];_0xad5f74[_0xf33f('0x33')]=qs[_0xf33f('0x34')](_0x410529[_0xf33f('0x31')][_0xf33f('0x34')]);_0xad5f74[_0xf33f('0x35')]=qs[_0xf33f('0x2c')](_[_0xf33f('0x36')](_0x410529[_0xf33f('0x31')],_0x28b83c[_0xf33f('0x2c')]));if(_0x410529['query'][_0xf33f('0x3c')]){_0xad5f74[_0xf33f('0x35')]=_[_0xf33f('0x37')](_0xad5f74[_0xf33f('0x35')],{'$or':_[_0xf33f('0x38')](_0xad5f74[_0xf33f('0x30')],function(_0x541858){var _0x161b82={};_0x161b82[_0x541858]={'$like':'%'+_0x410529[_0xf33f('0x31')]['filter']+'%'};return _0x161b82;})});}_0xad5f74=_[_0xf33f('0x37')]({},_0xad5f74,_0x410529[_0xf33f('0x3d')]);return _0x48f161['getSounds'](_0xad5f74);}})['then'](function(_0x1edbf3){if(_0x1edbf3){_0x2ee72b=_0x1edbf3['length'];if(!_0x410529[_0xf33f('0x31')]['hasOwnProperty']('nolimit')){_0xad5f74['limit']=qs[_0xf33f('0x1e')](_0x410529['query'][_0xf33f('0x1e')]);_0xad5f74[_0xf33f('0x1d')]=qs['offset'](_0x410529[_0xf33f('0x31')]['offset']);}return _0x48f161[_0xf33f('0x6b')](_0xad5f74);}})['then'](function(_0x4ce8d6){if(_0x4ce8d6){return _0x4ce8d6?{'count':_0x2ee72b,'rows':_0x4ce8d6}:null;}})[_0xf33f('0x21')](respondWithResult(_0x454ff3,null))[_0xf33f('0x41')](handleError(_0x454ff3,null));}; \ No newline at end of file +var _0x9b37=['UserProfileSection','userProfileId','autoAssociation','destroy','transaction','readdirSync','unlinkSync','rmdirSync','Sequelize','message','Sound','findOne','save_name','converted_format','createdAt','root','server/files/sounds/converted','format','%s.%s','basename','extname','server/files/moh','symlinkSync','ValidationError','removeSound','id2','order','getSounds','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','get','MusicOnHolds','UserProfileResource','error','name','send','index','VoiceMusicOnHold','rawAttributes','model','keys','query','attributes','intersection','fields','length','nolimit','sort','filters','pick','where','merge','map','type','key','VIRTUAL','field','filter','options','include','findAll','show','params','includeAll','find','catch','body','sequelize','mode','directory','join','create','files','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x225c8a,_0x1cb290){var _0x3a3d09=function(_0x12482a){while(--_0x12482a){_0x225c8a['push'](_0x225c8a['shift']());}};_0x3a3d09(++_0x1cb290);}(_0x9b37,0x170));var _0x79b3=function(_0x22868f,_0x450f48){_0x22868f=_0x22868f-0x0;var _0x97bc75=_0x9b37[_0x22868f];return _0x97bc75;};'use strict';var pdf=require(_0x79b3('0x0'));var emlformat=require(_0x79b3('0x1'));var rimraf=require(_0x79b3('0x2'));var zipdir=require(_0x79b3('0x3'));var jsonpatch=require(_0x79b3('0x4'));var rp=require(_0x79b3('0x5'));var moment=require(_0x79b3('0x6'));var BPromise=require(_0x79b3('0x7'));var Mustache=require(_0x79b3('0x8'));var util=require(_0x79b3('0x9'));var path=require(_0x79b3('0xa'));var sox=require(_0x79b3('0xb'));var csv=require(_0x79b3('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x79b3('0xd'));var crypto=require(_0x79b3('0xe'));var jsforce=require(_0x79b3('0xf'));var deskjs=require(_0x79b3('0x10'));var toCsv=require(_0x79b3('0xc'));var querystring=require(_0x79b3('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x79b3('0x12'));var qs=require(_0x79b3('0x13'));var hardwareService=require(_0x79b3('0x14'));var logger=require(_0x79b3('0x15'))(_0x79b3('0x16'));var utils=require(_0x79b3('0x17'));var config=require(_0x79b3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfdb53d,_0x2a08f5){_0x2a08f5=_0x2a08f5||0xcc;return function(_0x28683f){if(_0x28683f){return _0xfdb53d[_0x79b3('0x19')](_0x2a08f5);}return _0xfdb53d[_0x79b3('0x1a')](_0x2a08f5)[_0x79b3('0x1b')]();};}function respondWithResult(_0xe8744,_0x2f688d){_0x2f688d=_0x2f688d||0xc8;return function(_0x4fc434){if(_0x4fc434){return _0xe8744[_0x79b3('0x1a')](_0x2f688d)[_0x79b3('0x1c')](_0x4fc434);}};}function respondWithFilteredResult(_0x5afaa0,_0x462422){return function(_0x561ecb){if(_0x561ecb){var _0x33b35f=_0x561ecb[_0x79b3('0x1d')],_0x1e1c01=_0x462422[_0x79b3('0x1e')],_0x194b50=_0x462422[_0x79b3('0x1e')]+_0x462422[_0x79b3('0x1f')],_0x3695e9;if(_0x194b50>=_0x33b35f){_0x194b50=_0x33b35f;_0x3695e9=0xc8;}else{_0x3695e9=0xce;}_0x5afaa0['status'](_0x3695e9);return _0x5afaa0['set'](_0x79b3('0x20'),_0x1e1c01+'-'+_0x194b50+'/'+_0x33b35f)[_0x79b3('0x1c')](_0x561ecb);}return null;};}function patchUpdates(_0x553691){return function(_0x81f68){try{jsonpatch[_0x79b3('0x21')](_0x81f68,_0x553691,!![]);}catch(_0x27a5ec){return BPromise['reject'](_0x27a5ec);}return _0x81f68[_0x79b3('0x22')]();};}function saveUpdates(_0x256648,_0x5e7b28){return function(_0x34f893){if(_0x34f893){return _0x34f893[_0x79b3('0x23')](_0x256648)[_0x79b3('0x24')](function(_0x28766d){return _0x28766d;});}return null;};}function removeEntity(_0x45ea83,_0x4ddea5){return function(_0x5e7534){if(_0x5e7534){return _0x5e7534['destroy']()['then'](function(){var _0x11cdd6=_0x5e7534[_0x79b3('0x25')]({'plain':!![]});var _0x2f27fa=_0x79b3('0x26');return db[_0x79b3('0x27')]['destroy']({'where':{'type':_0x2f27fa,'resourceId':_0x11cdd6['id']}})[_0x79b3('0x24')](function(){return _0x5e7534;});})[_0x79b3('0x24')](function(){_0x45ea83[_0x79b3('0x1a')](0xcc)[_0x79b3('0x1b')]();});}};}function handleEntityNotFound(_0x2e0a50,_0x2851a0){return function(_0x3abdca){if(!_0x3abdca){_0x2e0a50[_0x79b3('0x19')](0x194);}return _0x3abdca;};}function handleError(_0x465ea3,_0x5ec654){_0x5ec654=_0x5ec654||0x1f4;return function(_0x28b637){logger[_0x79b3('0x28')](_0x28b637['stack']);if(_0x28b637[_0x79b3('0x29')]){delete _0x28b637[_0x79b3('0x29')];}_0x465ea3['status'](_0x5ec654)[_0x79b3('0x2a')](_0x28b637);};}exports[_0x79b3('0x2b')]=function(_0x5ea530,_0x4e2589){var _0x36068a={},_0x50bea8={},_0x1ad4dc={'count':0x0,'rows':[]};var _0x2f00df=db[_0x79b3('0x2c')][_0x79b3('0x2d')];_0x50bea8[_0x79b3('0x2e')]=_['keys'](_0x2f00df);_0x50bea8['query']=_[_0x79b3('0x2f')](_0x5ea530['query']);_0x50bea8['filters']=_['intersection'](_0x50bea8['model'],_0x50bea8[_0x79b3('0x30')]);_0x36068a[_0x79b3('0x31')]=_[_0x79b3('0x32')](_0x50bea8['model'],qs[_0x79b3('0x33')](_0x5ea530[_0x79b3('0x30')][_0x79b3('0x33')]));_0x36068a[_0x79b3('0x31')]=_0x36068a[_0x79b3('0x31')][_0x79b3('0x34')]?_0x36068a[_0x79b3('0x31')]:_0x50bea8[_0x79b3('0x2e')];if(!_0x5ea530[_0x79b3('0x30')]['hasOwnProperty'](_0x79b3('0x35'))){_0x36068a[_0x79b3('0x1f')]=qs[_0x79b3('0x1f')](_0x5ea530[_0x79b3('0x30')][_0x79b3('0x1f')]);_0x36068a[_0x79b3('0x1e')]=qs['offset'](_0x5ea530[_0x79b3('0x30')][_0x79b3('0x1e')]);}_0x36068a['order']=qs['sort'](_0x5ea530[_0x79b3('0x30')][_0x79b3('0x36')]);_0x36068a['where']=qs[_0x79b3('0x37')](_[_0x79b3('0x38')](_0x5ea530[_0x79b3('0x30')],_0x50bea8[_0x79b3('0x37')]));if(_0x5ea530[_0x79b3('0x30')]['filter']){_0x36068a[_0x79b3('0x39')]=_[_0x79b3('0x3a')](_0x36068a[_0x79b3('0x39')],{'$or':_[_0x79b3('0x3b')](_0x2f00df,function(_0x3f6c83){if(_0x3f6c83[_0x79b3('0x3c')][_0x79b3('0x3d')]!==_0x79b3('0x3e')){var _0x62af89={};_0x62af89[_0x3f6c83[_0x79b3('0x3f')]]={'$like':'%'+_0x5ea530[_0x79b3('0x30')][_0x79b3('0x40')]+'%'};return _0x62af89;}})});}_0x36068a=_[_0x79b3('0x3a')]({},_0x36068a,_0x5ea530[_0x79b3('0x41')]);var _0x10cc15={'where':_0x36068a[_0x79b3('0x39')]};return db[_0x79b3('0x2c')]['count'](_0x10cc15)[_0x79b3('0x24')](function(_0x1cb2b5){_0x1ad4dc['count']=_0x1cb2b5;if(_0x5ea530[_0x79b3('0x30')]['includeAll']){_0x36068a[_0x79b3('0x42')]=[{'all':!![]}];}return db[_0x79b3('0x2c')][_0x79b3('0x43')](_0x36068a);})[_0x79b3('0x24')](function(_0x445429){_0x1ad4dc['rows']=_0x445429;return _0x1ad4dc;})[_0x79b3('0x24')](respondWithFilteredResult(_0x4e2589,_0x36068a))['catch'](handleError(_0x4e2589,null));};exports[_0x79b3('0x44')]=function(_0x46b584,_0x412983){var _0x5e845f={'raw':![],'where':{'id':_0x46b584[_0x79b3('0x45')]['id']}},_0x35a88b={};_0x35a88b[_0x79b3('0x2e')]=_[_0x79b3('0x2f')](db[_0x79b3('0x2c')][_0x79b3('0x2d')]);_0x35a88b[_0x79b3('0x30')]=_[_0x79b3('0x2f')](_0x46b584['query']);_0x35a88b[_0x79b3('0x37')]=_['intersection'](_0x35a88b[_0x79b3('0x2e')],_0x35a88b[_0x79b3('0x30')]);_0x5e845f[_0x79b3('0x31')]=_[_0x79b3('0x32')](_0x35a88b[_0x79b3('0x2e')],qs[_0x79b3('0x33')](_0x46b584['query'][_0x79b3('0x33')]));_0x5e845f[_0x79b3('0x31')]=_0x5e845f['attributes']['length']?_0x5e845f['attributes']:_0x35a88b[_0x79b3('0x2e')];if(_0x46b584[_0x79b3('0x30')][_0x79b3('0x46')]){_0x5e845f[_0x79b3('0x42')]=[{'all':!![]}];}_0x5e845f=_['merge']({},_0x5e845f,_0x46b584[_0x79b3('0x41')]);return db[_0x79b3('0x2c')][_0x79b3('0x47')](_0x5e845f)[_0x79b3('0x24')](handleEntityNotFound(_0x412983,null))['then'](respondWithResult(_0x412983,null))[_0x79b3('0x48')](handleError(_0x412983,null));};exports[_0x79b3('0x23')]=function(_0x36c104,_0x2f7209){if(_0x36c104[_0x79b3('0x49')]['id']){delete _0x36c104[_0x79b3('0x49')]['id'];}return db[_0x79b3('0x2c')][_0x79b3('0x47')]({'where':{'id':_0x36c104[_0x79b3('0x45')]['id']}})['then'](handleEntityNotFound(_0x2f7209,null))[_0x79b3('0x24')](saveUpdates(_0x36c104['body'],null))['then'](respondWithResult(_0x2f7209,null))['catch'](handleError(_0x2f7209,null));};exports['create']=function(_0x55a857,_0x5d2c59,_0x535fb2){return db[_0x79b3('0x4a')]['transaction'](function(_0x404f06){if(_0x55a857[_0x79b3('0x49')][_0x79b3('0x4b')]==='files'){_0x55a857[_0x79b3('0x49')][_0x79b3('0x4c')]=path[_0x79b3('0x4d')](config['root'],'server/files/moh',_0x55a857[_0x79b3('0x49')]['name']);}return db['VoiceMusicOnHold'][_0x79b3('0x4e')](_0x55a857[_0x79b3('0x49')],{'transaction':_0x404f06})[_0x79b3('0x24')](function(_0x295fa4){if(_0x55a857[_0x79b3('0x49')][_0x79b3('0x4b')]===_0x79b3('0x4f')){fs[_0x79b3('0x50')](_0x295fa4[_0x79b3('0x4c')],parseInt('0777',0x8));}var _0x492360=_0x55a857[_0x79b3('0x51')][_0x79b3('0x25')]({'plain':!![]});if(!_0x492360)throw new Error(_0x79b3('0x52'));if(_0x492360[_0x79b3('0x53')]==='user'){var _0x30f98b=_0x295fa4[_0x79b3('0x25')]({'plain':!![]});return db[_0x79b3('0x54')][_0x79b3('0x47')]({'where':{'name':_0x79b3('0x26'),'userProfileId':_0x492360[_0x79b3('0x55')]},'raw':!![]})[_0x79b3('0x24')](function(_0x350cbe){if(_0x350cbe&&_0x350cbe[_0x79b3('0x56')]===0x0){return db[_0x79b3('0x27')]['create']({'name':_0x30f98b['name'],'resourceId':_0x30f98b['id'],'type':_0x350cbe[_0x79b3('0x29')],'sectionId':_0x350cbe['id']},{})[_0x79b3('0x24')](function(){return _0x295fa4;});}else{return _0x295fa4;}})['catch'](function(_0x8d8f46){logger[_0x79b3('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8d8f46);});}return _0x295fa4;});})['then'](respondWithResult(_0x5d2c59,0xc9))[_0x79b3('0x48')](handleError(_0x5d2c59,null));};exports[_0x79b3('0x57')]=function(_0x14c2e7,_0x5e1b6a,_0x26832a){var _0x1ffb98;return db['VoiceMusicOnHold'][_0x79b3('0x47')]({'where':{'id':_0x14c2e7['params']['id']}})[_0x79b3('0x24')](function(_0x9eed25){if(_0x9eed25){return db['sequelize'][_0x79b3('0x58')](function(_0x42d017){return _0x9eed25[_0x79b3('0x57')]({'transaction':_0x42d017,'raw':!![]})['then'](function(_0x42a109){if(_0x42a109['directory']){fs[_0x79b3('0x59')](_0x42a109['directory'])['forEach'](function(_0x50067a){fs[_0x79b3('0x5a')](path[_0x79b3('0x4d')](_0x42a109['directory'],_0x50067a));});fs[_0x79b3('0x5b')](_0x42a109[_0x79b3('0x4c')]);}return _0x42a109;});})[_0x79b3('0x48')](function(_0x106705){throw new db[(_0x79b3('0x5c'))]['ValidationError'](_0x106705[_0x79b3('0x5d')]);});}})['then'](handleEntityNotFound(_0x5e1b6a,null))[_0x79b3('0x24')](removeEntity(_0x5e1b6a,null))['catch'](handleError(_0x5e1b6a,null));};exports['addSound']=function(_0x19178e,_0x57a3db,_0x1da3c3){return db[_0x79b3('0x4a')][_0x79b3('0x58')](function(_0x239260){var _0x5805c7;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x19178e['params']['id']}})['then'](function(_0x3a8823){if(_0x3a8823){_0x5805c7=_0x3a8823;return _0x3a8823['addSound'](_0x19178e[_0x79b3('0x49')]['id'],{'transaction':_0x239260});}})[_0x79b3('0x24')](function(_0x599615){if(_0x599615){return db[_0x79b3('0x5e')][_0x79b3('0x5f')]({'where':{'id':_0x19178e[_0x79b3('0x49')]['id']},'attributes':['id','name',_0x79b3('0x60'),_0x79b3('0x61'),_0x79b3('0x62')],'raw':!![]});}})[_0x79b3('0x24')](function(_0x419d76){if(_0x419d76){var _0x522503=path['join'](config[_0x79b3('0x63')],_0x79b3('0x64'),util[_0x79b3('0x65')](_0x79b3('0x66'),path[_0x79b3('0x67')](_0x419d76[_0x79b3('0x60')],path[_0x79b3('0x68')](_0x419d76[_0x79b3('0x60')])),_0x419d76[_0x79b3('0x61')]));var _0x1d47b2=path[_0x79b3('0x4d')](config[_0x79b3('0x63')],_0x79b3('0x69'),_0x5805c7[_0x79b3('0x29')],util[_0x79b3('0x65')]('%s.%s',_0x419d76[_0x79b3('0x29')],_0x419d76[_0x79b3('0x61')]));fs[_0x79b3('0x6a')](_0x522503,_0x1d47b2);return _0x419d76;}})[_0x79b3('0x48')](function(_0x16cb19){throw new db[(_0x79b3('0x5c'))][(_0x79b3('0x6b'))](_0x16cb19[_0x79b3('0x5d')]);});})[_0x79b3('0x24')](handleEntityNotFound(_0x57a3db,null))[_0x79b3('0x24')](respondWithResult(_0x57a3db,0xc9))[_0x79b3('0x48')](handleError(_0x57a3db,null));};exports[_0x79b3('0x6c')]=function(_0x4a0987,_0xb6ff07,_0x97a76c){return db[_0x79b3('0x4a')][_0x79b3('0x58')](function(_0x47be7e){var _0x5e764e;return db[_0x79b3('0x2c')][_0x79b3('0x5f')]({'where':{'id':_0x4a0987[_0x79b3('0x45')]['id']}})[_0x79b3('0x24')](handleEntityNotFound(_0xb6ff07,null))[_0x79b3('0x24')](function(_0x45bc61){if(_0x45bc61){_0x5e764e=_0x45bc61;return _0x45bc61['removeSound'](_0x4a0987[_0x79b3('0x45')][_0x79b3('0x6d')]);}})[_0x79b3('0x24')](function(_0x12b12c){if(_0x12b12c){return db[_0x79b3('0x5e')][_0x79b3('0x5f')]({'where':{'id':_0x4a0987['params'][_0x79b3('0x6d')]},'attributes':['id',_0x79b3('0x29'),'save_name',_0x79b3('0x61'),_0x79b3('0x62')],'raw':!![]});}})['then'](function(_0x4ae795){if(_0x4ae795){fs['unlinkSync'](path[_0x79b3('0x4d')](_0x5e764e[_0x79b3('0x4c')],util[_0x79b3('0x65')](_0x79b3('0x66'),_0x4ae795[_0x79b3('0x29')],_0x4ae795['converted_format'])));return _0x4ae795;}})[_0x79b3('0x48')](function(_0x460ef2){throw new db[(_0x79b3('0x5c'))][(_0x79b3('0x6b'))](_0x460ef2[_0x79b3('0x5d')]);});})['then'](handleEntityNotFound(_0xb6ff07,null))['then'](respondWithStatusCode(_0xb6ff07,0xcc))[_0x79b3('0x48')](handleError(_0xb6ff07,null));};exports['getSounds']=function(_0xfdcee7,_0x330342,_0x1820f0){var _0x5bda31={};var _0x32d280={};var _0x49ebac;var _0x2c767d;return db['VoiceMusicOnHold'][_0x79b3('0x5f')]({'where':{'id':_0xfdcee7['params']['id']}})[_0x79b3('0x24')](handleEntityNotFound(_0x330342,null))['then'](function(_0x341408){if(_0x341408){_0x49ebac=_0x341408;_0x32d280[_0x79b3('0x2e')]=_['keys'](db[_0x79b3('0x5e')]['rawAttributes']);_0x32d280[_0x79b3('0x30')]=_[_0x79b3('0x2f')](_0xfdcee7[_0x79b3('0x30')]);_0x32d280[_0x79b3('0x37')]=_[_0x79b3('0x32')](_0x32d280[_0x79b3('0x2e')],_0x32d280[_0x79b3('0x30')]);_0x5bda31[_0x79b3('0x31')]=_[_0x79b3('0x32')](_0x32d280[_0x79b3('0x2e')],qs['fields'](_0xfdcee7['query'][_0x79b3('0x33')]));_0x5bda31[_0x79b3('0x31')]=_0x5bda31[_0x79b3('0x31')][_0x79b3('0x34')]?_0x5bda31[_0x79b3('0x31')]:_0x32d280[_0x79b3('0x2e')];_0x5bda31[_0x79b3('0x6e')]=qs['sort'](_0xfdcee7[_0x79b3('0x30')][_0x79b3('0x36')]);_0x5bda31[_0x79b3('0x39')]=qs[_0x79b3('0x37')](_['pick'](_0xfdcee7[_0x79b3('0x30')],_0x32d280['filters']));if(_0xfdcee7[_0x79b3('0x30')][_0x79b3('0x40')]){_0x5bda31[_0x79b3('0x39')]=_['merge'](_0x5bda31[_0x79b3('0x39')],{'$or':_[_0x79b3('0x3b')](_0x5bda31[_0x79b3('0x31')],function(_0x2cbc76){var _0x105de6={};_0x105de6[_0x2cbc76]={'$like':'%'+_0xfdcee7[_0x79b3('0x30')][_0x79b3('0x40')]+'%'};return _0x105de6;})});}_0x5bda31=_[_0x79b3('0x3a')]({},_0x5bda31,_0xfdcee7['options']);return _0x49ebac[_0x79b3('0x6f')](_0x5bda31);}})[_0x79b3('0x24')](function(_0x202fe7){if(_0x202fe7){_0x2c767d=_0x202fe7[_0x79b3('0x34')];if(!_0xfdcee7[_0x79b3('0x30')][_0x79b3('0x70')](_0x79b3('0x35'))){_0x5bda31[_0x79b3('0x1f')]=qs[_0x79b3('0x1f')](_0xfdcee7[_0x79b3('0x30')][_0x79b3('0x1f')]);_0x5bda31['offset']=qs[_0x79b3('0x1e')](_0xfdcee7[_0x79b3('0x30')][_0x79b3('0x1e')]);}return _0x49ebac['getSounds'](_0x5bda31);}})[_0x79b3('0x24')](function(_0xc41098){if(_0xc41098){return _0xc41098?{'count':_0x2c767d,'rows':_0xc41098}:null;}})['then'](respondWithResult(_0x330342,null))[_0x79b3('0x48')](handleError(_0x330342,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 4ad11fd..da54577 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 _0x4890=['voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold'];(function(_0x14c1ed,_0x2b8281){var _0x459931=function(_0x3d19b1){while(--_0x3d19b1){_0x14c1ed['push'](_0x14c1ed['shift']());}};_0x459931(++_0x2b8281);}(_0x4890,0x10b));var _0x0489=function(_0x582d0b,_0x28f609){_0x582d0b=_0x582d0b-0x0;var _0x2e93e1=_0x4890[_0x582d0b];return _0x2e93e1;};'use strict';var _=require(_0x0489('0x0'));var util=require(_0x0489('0x1'));var logger=require(_0x0489('0x2'))(_0x0489('0x3'));var moment=require(_0x0489('0x4'));var BPromise=require(_0x0489('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0489('0x6'));var rimraf=require(_0x0489('0x7'));var config=require(_0x0489('0x8'));var attributes=require(_0x0489('0x9'));module[_0x0489('0xa')]=function(_0xb97011,_0x48780c){return _0xb97011[_0x0489('0xb')](_0x0489('0xc'),attributes,{'tableName':_0x0489('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1e6=['VoiceMusicOnHold','voice_musiconhold','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0xa9eaa0,_0x4ba2b4){var _0x30897a=function(_0x2caa01){while(--_0x2caa01){_0xa9eaa0['push'](_0xa9eaa0['shift']());}};_0x30897a(++_0x4ba2b4);}(_0xf1e6,0x1b2));var _0x6f1e=function(_0x35c97a,_0x513aba){_0x35c97a=_0x35c97a-0x0;var _0x388917=_0xf1e6[_0x35c97a];return _0x388917;};'use strict';var _=require(_0x6f1e('0x0'));var util=require('util');var logger=require(_0x6f1e('0x1'))('api');var moment=require(_0x6f1e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f1e('0x3'));var rimraf=require(_0x6f1e('0x4'));var config=require(_0x6f1e('0x5'));var attributes=require(_0x6f1e('0x6'));module['exports']=function(_0x5a92b5,_0x6685df){return _0x5a92b5['define'](_0x6f1e('0x7'),attributes,{'tableName':_0x6f1e('0x8'),'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 443abf6..3f8c8d5 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 _0x0575=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis'];(function(_0x4b8ab7,_0x37c8bd){var _0x3f6c00=function(_0x56a19e){while(--_0x56a19e){_0x4b8ab7['push'](_0x4b8ab7['shift']());}};_0x3f6c00(++_0x37c8bd);}(_0x0575,0x96));var _0x5057=function(_0x287896,_0xcd590c){_0x287896=_0x287896-0x0;var _0x56d6d6=_0x0575[_0x287896];return _0x56d6d6;};'use strict';var _=require(_0x5057('0x0'));var util=require('util');var moment=require(_0x5057('0x1'));var BPromise=require('bluebird');var rs=require(_0x5057('0x2'));var fs=require('fs');var Redis=require(_0x5057('0x3'));var db=require(_0x5057('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5057('0x5'))(_0x5057('0x6'));var config=require(_0x5057('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5057('0x8')][_0x5057('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdf20d4,_0x544bb3,_0x2544c1){return new BPromise(function(_0x5e9bce,_0x7a9e16){return client['request'](_0xdf20d4,_0x2544c1)[_0x5057('0xa')](function(_0x5c3595){logger[_0x5057('0xb')](_0x5057('0xc'),_0x544bb3,_0x5057('0xd'));logger[_0x5057('0xe')](_0x5057('0xf'),_0x544bb3,_0x5057('0xd'),JSON[_0x5057('0x10')](_0x5c3595));if(_0x5c3595[_0x5057('0x11')]){if(_0x5c3595[_0x5057('0x11')][_0x5057('0x12')]===0x1f4){logger[_0x5057('0x11')](_0x5057('0xc'),_0x544bb3,_0x5c3595[_0x5057('0x11')]['message']);return _0x7a9e16(_0x5c3595[_0x5057('0x11')]['message']);}logger[_0x5057('0x11')](_0x5057('0xc'),_0x544bb3,_0x5c3595[_0x5057('0x11')]['message']);return _0x5e9bce(_0x5c3595[_0x5057('0x11')][_0x5057('0x13')]);}else{logger['info'](_0x5057('0xc'),_0x544bb3,'request\x20sent');_0x5e9bce(_0x5c3595[_0x5057('0x14')][_0x5057('0x13')]);}})[_0x5057('0x15')](function(_0x528edc){logger[_0x5057('0x11')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x544bb3,_0x528edc);_0x7a9e16(_0x528edc);});});} \ No newline at end of file +var _0xd80a=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','message','catch','lodash'];(function(_0x522f69,_0x5b0c30){var _0x2d7258=function(_0x20ca7b){while(--_0x20ca7b){_0x522f69['push'](_0x522f69['shift']());}};_0x2d7258(++_0x5b0c30);}(_0xd80a,0xfb));var _0xad80=function(_0x392025,_0x4ded8a){_0x392025=_0x392025-0x0;var _0x3d6428=_0xd80a[_0x392025];return _0x3d6428;};'use strict';var _=require(_0xad80('0x0'));var util=require(_0xad80('0x1'));var moment=require('moment');var BPromise=require(_0xad80('0x2'));var rs=require(_0xad80('0x3'));var fs=require('fs');var Redis=require(_0xad80('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xad80('0x5'));var logger=require(_0xad80('0x6'))(_0xad80('0x7'));var config=require('../../config/environment');var jayson=require(_0xad80('0x8'));var client=jayson['client'][_0xad80('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x489c1a,_0x271da9,_0xe17a16){return new BPromise(function(_0x10e3cd,_0xbf372c){return client[_0xad80('0xa')](_0x489c1a,_0xe17a16)['then'](function(_0x53a0c2){logger['info'](_0xad80('0xb'),_0x271da9,_0xad80('0xc'));logger[_0xad80('0xd')](_0xad80('0xe'),_0x271da9,'request\x20sent',JSON['stringify'](_0x53a0c2));if(_0x53a0c2[_0xad80('0xf')]){if(_0x53a0c2[_0xad80('0xf')]['code']===0x1f4){logger[_0xad80('0xf')](_0xad80('0xb'),_0x271da9,_0x53a0c2[_0xad80('0xf')][_0xad80('0x10')]);return _0xbf372c(_0x53a0c2[_0xad80('0xf')][_0xad80('0x10')]);}logger[_0xad80('0xf')](_0xad80('0xb'),_0x271da9,_0x53a0c2[_0xad80('0xf')][_0xad80('0x10')]);return _0x10e3cd(_0x53a0c2[_0xad80('0xf')][_0xad80('0x10')]);}else{logger['info'](_0xad80('0xb'),_0x271da9,_0xad80('0xc'));_0x10e3cd(_0x53a0c2['result']['message']);}})[_0xad80('0x11')](function(_0x4a02c6){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x271da9,_0x4a02c6);_0xbf372c(_0x4a02c6);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index a6fc8a4..4c5f974 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 _0xcb97=['multer','util','path','connect-timeout','Router','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','post','create','put','update','delete','destroy','exports'];(function(_0x1ab8c2,_0x4aa1bd){var _0x51a663=function(_0x80d380){while(--_0x80d380){_0x1ab8c2['push'](_0x1ab8c2['shift']());}};_0x51a663(++_0x4aa1bd);}(_0xcb97,0x1ce));var _0x7cb9=function(_0x238e59,_0x3d5bd8){_0x238e59=_0x238e59-0x0;var _0x2cdb69=_0xcb97[_0x238e59];return _0x2cdb69;};'use strict';var multer=require(_0x7cb9('0x0'));var util=require(_0x7cb9('0x1'));var path=require(_0x7cb9('0x2'));var timeout=require(_0x7cb9('0x3'));var express=require('express');var router=express[_0x7cb9('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7cb9('0x5'));var controller=require(_0x7cb9('0x6'));router[_0x7cb9('0x7')]('/',auth[_0x7cb9('0x8')](),controller[_0x7cb9('0x9')]);router['get'](_0x7cb9('0xa'),auth[_0x7cb9('0x8')](),controller[_0x7cb9('0xb')]);router[_0x7cb9('0x7')](_0x7cb9('0xc'),auth['isAuthenticated'](),controller[_0x7cb9('0xd')]);router[_0x7cb9('0x7')](_0x7cb9('0xe'),auth[_0x7cb9('0x8')](),controller['getAgents']);router[_0x7cb9('0xf')]('/',auth['isAuthenticated'](),controller[_0x7cb9('0x10')]);router['post']('/:id/users',auth[_0x7cb9('0x8')](),controller['addAgents']);router[_0x7cb9('0x11')](_0x7cb9('0xc'),auth[_0x7cb9('0x8')](),controller[_0x7cb9('0x12')]);router[_0x7cb9('0x13')]('/:id',auth[_0x7cb9('0x8')](),controller[_0x7cb9('0x14')]);router['delete']('/:id/users',auth[_0x7cb9('0x8')](),controller['removeAgents']);module[_0x7cb9('0x15')]=router; \ No newline at end of file +var _0xc57e=['express','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','show','/:id/users','getAgents','post','create','put','/:id','delete','destroy','removeAgents','exports','multer','util','path'];(function(_0x4aa4af,_0x210cde){var _0x3bf44a=function(_0x4a8126){while(--_0x4a8126){_0x4aa4af['push'](_0x4aa4af['shift']());}};_0x3bf44a(++_0x210cde);}(_0xc57e,0x66));var _0xec57=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc57e[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xec57('0x0'));var util=require(_0xec57('0x1'));var path=require(_0xec57('0x2'));var timeout=require('connect-timeout');var express=require(_0xec57('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xec57('0x4'));var config=require(_0xec57('0x5'));var controller=require(_0xec57('0x6'));router['get']('/',auth[_0xec57('0x7')](),controller[_0xec57('0x8')]);router[_0xec57('0x9')]('/describe',auth[_0xec57('0x7')](),controller['describe']);router[_0xec57('0x9')]('/:id',auth[_0xec57('0x7')](),controller[_0xec57('0xa')]);router[_0xec57('0x9')](_0xec57('0xb'),auth[_0xec57('0x7')](),controller[_0xec57('0xc')]);router[_0xec57('0xd')]('/',auth[_0xec57('0x7')](),controller[_0xec57('0xe')]);router['post'](_0xec57('0xb'),auth[_0xec57('0x7')](),controller['addAgents']);router[_0xec57('0xf')](_0xec57('0x10'),auth[_0xec57('0x7')](),controller['update']);router[_0xec57('0x11')](_0xec57('0x10'),auth[_0xec57('0x7')](),controller[_0xec57('0x12')]);router[_0xec57('0x11')](_0xec57('0xb'),auth[_0xec57('0x7')](),controller[_0xec57('0x13')]);module[_0xec57('0x14')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index d4e5c87..91ec191 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 _0xd5fe=['exports','name','STRING','sequelize'];(function(_0x29a685,_0x30ef9e){var _0x4324e8=function(_0x2e1d8c){while(--_0x2e1d8c){_0x29a685['push'](_0x29a685['shift']());}};_0x4324e8(++_0x30ef9e);}(_0xd5fe,0x1ab));var _0xed5f=function(_0x350aeb,_0x3d265a){_0x350aeb=_0x350aeb-0x0;var _0x3c5273=_0xd5fe[_0x350aeb];return _0x3c5273;};'use strict';var Sequelize=require(_0xed5f('0x0'));module[_0xed5f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xed5f('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x1d5b5b){return'system-'+this['getDataValue'](_0xed5f('0x2'))+'-';}},'description':{'type':Sequelize[_0xed5f('0x3')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x5216=['INTEGER','exports','STRING','name'];(function(_0xa5240b,_0x500699){var _0x41fef0=function(_0x3b0d26){while(--_0x3b0d26){_0xa5240b['push'](_0xa5240b['shift']());}};_0x41fef0(++_0x500699);}(_0x5216,0x165));var _0x6521=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5216[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');module[_0x6521('0x0')]={'name':{'type':Sequelize[_0x6521('0x1')],'allowNull':![],'unique':_0x6521('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x3cef9d){return'system-'+this['getDataValue'](_0x6521('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x6521('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x6521('0x3')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index fef8d73..7103621 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 _0xb10b=['find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','push','${EXTEN:','charAt','findById','params','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','map','hasOwnProperty','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','count','offset','set','Content-Range','json','reject','update','then','destroy','get','error','stack','name','send','VoicePrefix','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','type','key','field','filter','options','include','findAll','rows','catch','show','rawAttributes','includeAll'];(function(_0x40f217,_0x5e7e5f){var _0x19a5fa=function(_0x42f71b){while(--_0x42f71b){_0x40f217['push'](_0x40f217['shift']());}};_0x19a5fa(++_0x5e7e5f);}(_0xb10b,0x12a));var _0xbb10=function(_0x21f7c2,_0x1b2426){_0x21f7c2=_0x21f7c2-0x0;var _0x3f3279=_0xb10b[_0x21f7c2];return _0x3f3279;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var db=require(_0xbb10('0x17'))['db'];config['redis']=_[_0xbb10('0x18')](config[_0xbb10('0x19')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x19')]));require(_0xbb10('0x1c'))['register'](socket);function respondWithStatusCode(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xcc;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x1d')](_0x42d7e4);}return _0x26e021[_0xbb10('0x1e')](_0x42d7e4)[_0xbb10('0x1f')]();};}function respondWithResult(_0x24a57b,_0x36b5e8){_0x36b5e8=_0x36b5e8||0xc8;return function(_0x3e26f4){if(_0x3e26f4){return _0x24a57b[_0xbb10('0x1e')](_0x36b5e8)['json'](_0x3e26f4);}};}function respondWithFilteredResult(_0x2eca0f,_0x1145f1){return function(_0x133ac2){if(_0x133ac2){var _0x42db98=_0x133ac2[_0xbb10('0x20')],_0x378da8=_0x1145f1[_0xbb10('0x21')],_0x1682a4=_0x1145f1[_0xbb10('0x21')]+_0x1145f1['limit'],_0x575cca;if(_0x1682a4>=_0x42db98){_0x1682a4=_0x42db98;_0x575cca=0xc8;}else{_0x575cca=0xce;}_0x2eca0f[_0xbb10('0x1e')](_0x575cca);return _0x2eca0f[_0xbb10('0x22')](_0xbb10('0x23'),_0x378da8+'-'+_0x1682a4+'/'+_0x42db98)[_0xbb10('0x24')](_0x133ac2);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x25')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x26')](_0x4c4b0d)[_0xbb10('0x27')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x28')]()[_0xbb10('0x27')](function(){var _0x3ba6cd=_0x436104[_0xbb10('0x29')]({'plain':!![]});var _0x537898='VoicePrefixes';return db['UserProfileResource'][_0xbb10('0x28')]({'where':{'type':_0x537898,'resourceId':_0x3ba6cd['id']}})[_0xbb10('0x27')](function(){return _0x436104;});})[_0xbb10('0x27')](function(){_0x1824b7['status'](0xcc)[_0xbb10('0x1f')]();});}};}function handleEntityNotFound(_0x24d586,_0x6ed43b){return function(_0x1d5e95){if(!_0x1d5e95){_0x24d586[_0xbb10('0x1d')](0x194);}return _0x1d5e95;};}function handleError(_0x20d946,_0x2a0e8b){_0x2a0e8b=_0x2a0e8b||0x1f4;return function(_0x4aabb9){logger[_0xbb10('0x2a')](_0x4aabb9[_0xbb10('0x2b')]);if(_0x4aabb9[_0xbb10('0x2c')]){delete _0x4aabb9[_0xbb10('0x2c')];}_0x20d946[_0xbb10('0x1e')](_0x2a0e8b)[_0xbb10('0x2d')](_0x4aabb9);};}exports['index']=function(_0x221624,_0x4ee02e){var _0x448d5c={},_0x56f2da={},_0x16ad2a={'count':0x0,'rows':[]};var _0x1dcc9c=db[_0xbb10('0x2e')]['rawAttributes'];_0x56f2da['model']=_[_0xbb10('0x2f')](_0x1dcc9c);_0x56f2da[_0xbb10('0x30')]=_['keys'](_0x221624[_0xbb10('0x30')]);_0x56f2da[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0x56f2da[_0xbb10('0x33')],_0x56f2da[_0xbb10('0x30')]);_0x448d5c[_0xbb10('0x34')]=_[_0xbb10('0x32')](_0x56f2da['model'],qs[_0xbb10('0x35')](_0x221624[_0xbb10('0x30')][_0xbb10('0x35')]));_0x448d5c[_0xbb10('0x34')]=_0x448d5c[_0xbb10('0x34')][_0xbb10('0x36')]?_0x448d5c[_0xbb10('0x34')]:_0x56f2da[_0xbb10('0x33')];if(!_0x221624[_0xbb10('0x30')]['hasOwnProperty'](_0xbb10('0x37'))){_0x448d5c[_0xbb10('0x38')]=qs[_0xbb10('0x38')](_0x221624[_0xbb10('0x30')]['limit']);_0x448d5c[_0xbb10('0x21')]=qs['offset'](_0x221624['query'][_0xbb10('0x21')]);}_0x448d5c[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_0x221624[_0xbb10('0x30')][_0xbb10('0x3a')]);_0x448d5c[_0xbb10('0x3b')]=qs['filters'](_[_0xbb10('0x3c')](_0x221624[_0xbb10('0x30')],_0x56f2da['filters']));if(_0x221624['query']['filter']){_0x448d5c[_0xbb10('0x3b')]=_[_0xbb10('0x3d')](_0x448d5c[_0xbb10('0x3b')],{'$or':_['map'](_0x1dcc9c,function(_0x3c0cd7){if(_0x3c0cd7[_0xbb10('0x3e')][_0xbb10('0x3f')]!=='VIRTUAL'){var _0x17b6c5={};_0x17b6c5[_0x3c0cd7[_0xbb10('0x40')]]={'$like':'%'+_0x221624[_0xbb10('0x30')][_0xbb10('0x41')]+'%'};return _0x17b6c5;}})});}_0x448d5c=_['merge']({},_0x448d5c,_0x221624[_0xbb10('0x42')]);var _0x110eb5={'where':_0x448d5c['where']};return db[_0xbb10('0x2e')][_0xbb10('0x20')](_0x110eb5)[_0xbb10('0x27')](function(_0x3a9934){_0x16ad2a[_0xbb10('0x20')]=_0x3a9934;if(_0x221624[_0xbb10('0x30')]['includeAll']){_0x448d5c[_0xbb10('0x43')]=[{'all':!![]}];}return db[_0xbb10('0x2e')][_0xbb10('0x44')](_0x448d5c);})[_0xbb10('0x27')](function(_0x4943d9){_0x16ad2a[_0xbb10('0x45')]=_0x4943d9;return _0x16ad2a;})[_0xbb10('0x27')](respondWithFilteredResult(_0x4ee02e,_0x448d5c))[_0xbb10('0x46')](handleError(_0x4ee02e,null));};exports[_0xbb10('0x47')]=function(_0x5e2cfa,_0x351484){var _0x202c60={'raw':![],'where':{'id':_0x5e2cfa['params']['id']}},_0x54ac18={};_0x54ac18[_0xbb10('0x33')]=_['keys'](db[_0xbb10('0x2e')][_0xbb10('0x48')]);_0x54ac18['query']=_[_0xbb10('0x2f')](_0x5e2cfa[_0xbb10('0x30')]);_0x54ac18[_0xbb10('0x31')]=_['intersection'](_0x54ac18[_0xbb10('0x33')],_0x54ac18[_0xbb10('0x30')]);_0x202c60[_0xbb10('0x34')]=_[_0xbb10('0x32')](_0x54ac18[_0xbb10('0x33')],qs[_0xbb10('0x35')](_0x5e2cfa[_0xbb10('0x30')][_0xbb10('0x35')]));_0x202c60[_0xbb10('0x34')]=_0x202c60[_0xbb10('0x34')][_0xbb10('0x36')]?_0x202c60[_0xbb10('0x34')]:_0x54ac18['model'];if(_0x5e2cfa[_0xbb10('0x30')][_0xbb10('0x49')]){_0x202c60['include']=[{'all':!![]}];}_0x202c60=_[_0xbb10('0x3d')]({},_0x202c60,_0x5e2cfa[_0xbb10('0x42')]);return db[_0xbb10('0x2e')][_0xbb10('0x4a')](_0x202c60)[_0xbb10('0x27')](handleEntityNotFound(_0x351484,null))[_0xbb10('0x27')](respondWithResult(_0x351484,null))[_0xbb10('0x46')](handleError(_0x351484,null));};exports['destroy']=function(_0x4a9793,_0xcb3354){return db[_0xbb10('0x2e')][_0xbb10('0x4a')]({'where':{'id':_0x4a9793['params']['id']}})['then'](handleEntityNotFound(_0xcb3354,null))[_0xbb10('0x27')](removeEntity(_0xcb3354,null))[_0xbb10('0x46')](handleError(_0xcb3354,null));};exports[_0xbb10('0x4b')]=function(_0xf820fe,_0x10159b){return db[_0xbb10('0x2e')][_0xbb10('0x4b')]()[_0xbb10('0x27')](respondWithResult(_0x10159b,null))[_0xbb10('0x46')](handleError(_0x10159b,null));};exports[_0xbb10('0x4c')]=function(_0x550111,_0x5eafac){var _0x412e13;return db[_0xbb10('0x4d')][_0xbb10('0x4e')](function(_0xb014b0){return db[_0xbb10('0x2e')][_0xbb10('0x4c')](_0x550111[_0xbb10('0x4f')],{'transaction':_0xb014b0})[_0xbb10('0x27')](function(_0x1c0d8f){_0x412e13=_0x1c0d8f[_0xbb10('0x29')]({'plain':!![]});return db[_0xbb10('0x50')][_0xbb10('0x4a')]({'where':{'id':_0x412e13[_0xbb10('0x51')]},'raw':!![]})[_0xbb10('0x27')](function(_0x1d15f4){return createVoicePrefixExtensions(_0x412e13,_0x1d15f4,_0xb014b0);});});})['then'](function(){var _0x124052=_0x550111['user'][_0xbb10('0x29')]({'plain':!![]});if(!_0x124052)throw new Error(_0xbb10('0x52'));if(_0x124052[_0xbb10('0x53')]===_0xbb10('0x54')){var _0x26e66e=_0x412e13;return db[_0xbb10('0x55')][_0xbb10('0x4a')]({'where':{'name':_0xbb10('0x56'),'userProfileId':_0x124052[_0xbb10('0x57')]},'raw':!![]})[_0xbb10('0x27')](function(_0x44a056){if(_0x44a056&&_0x44a056[_0xbb10('0x58')]===0x0){return db[_0xbb10('0x59')][_0xbb10('0x4c')]({'name':_0x26e66e[_0xbb10('0x2c')],'resourceId':_0x26e66e['id'],'type':_0x44a056['name'],'sectionId':_0x44a056['id']},{})[_0xbb10('0x27')](function(){return _0x412e13;});}else{return _0x412e13;}})[_0xbb10('0x46')](function(_0x1b83a9){logger[_0xbb10('0x2a')](_0xbb10('0x5a'),_0x1b83a9);throw _0x1b83a9;});}return _0x412e13;})[_0xbb10('0x27')](respondWithResult(_0x5eafac,null))['catch'](handleError(_0x5eafac,null));};function Extension(_0x120bda,_0x4731ce,_0x2909a1,_0x14fed3){this[_0xbb10('0x5b')]=_0xbb10('0x5c');this[_0xbb10('0x5d')]=_0x120bda;this[_0xbb10('0x5e')]=_0x2909a1;this[_0xbb10('0x3e')]=_0xbb10('0x5f');this[_0xbb10('0x60')]=_0xbb10('0x61');this[_0xbb10('0x62')]=_0x4731ce;this['appdata']=_0x14fed3;}function createVoicePrefixExtensions(_0x4ea1a6,_0x16272d,_0x3e6338){return new BPromise(function(_0x3d0cb7,_0x8b0a7d){var _0x5573bb=new Extension(formatPrefixName(_0x4ea1a6['prefix']),0x1,_0xbb10('0x63'),_0xbb10('0x64'));_0x5573bb[_0xbb10('0x65')]=_0x4ea1a6['id'];return db[_0xbb10('0x50')][_0xbb10('0x4c')](_0x5573bb,{'transaction':_0x3e6338})[_0xbb10('0x27')](function(_0x45c0dc){var _0x4a5fb9=_0x45c0dc[_0xbb10('0x29')]({'plain':!![]});var _0x216cff=_['map'](addVoicePrefixExtensions(_0x4ea1a6,_0x16272d),function(_0x5e03cb){_0x5e03cb['VoiceExtensionId']=_0x4a5fb9['id'];_0x5e03cb[_0xbb10('0x65')]=_0x4ea1a6['id'];return _0x5e03cb;});return db[_0xbb10('0x50')][_0xbb10('0x66')](_0x216cff,{'transaction':_0x3e6338})['then'](function(_0x4e6e7c){if(!_0x4e6e7c){return _0x8b0a7d('Extensions\x20creation\x20failed');}else{return _0x3d0cb7(_0x4e6e7c);}})[_0xbb10('0x46')](function(_0x249b33){return _0x8b0a7d(_0x249b33);});});;});};function addVoicePrefixExtensions(_0x45167a,_0x4e9fbd){var _0xa1bbd9=[];var _0x13131c=formatPrefixName(_0x45167a['prefix']);_0xa1bbd9['push'](new Extension(_0x13131c,0x2,_0xbb10('0x67'),_0xbb10('0x68')+_0x45167a[_0xbb10('0x2c')]));if(_0x45167a[_0xbb10('0x69')]){_0xa1bbd9['push'](new Extension(_0x13131c,0x3,_0xbb10('0x67'),_0xbb10('0x6a')+_0x45167a[_0xbb10('0x69')]));}else{_0xa1bbd9['push'](new Extension(_0x13131c,0x3,_0xbb10('0x63'),_0xbb10('0x6b')));}_0xa1bbd9[_0xbb10('0x6c')](new Extension(_0x13131c,0x4,'goto',_0x4e9fbd[_0xbb10('0x5b')]+','+_0xbb10('0x6d')+(0x8+_0x45167a[_0xbb10('0x2c')][_0xbb10('0x36')])+'}'+','+0x1));return _0xa1bbd9;}function formatPrefixName(_0x5e4a6e){var _0x251417='_';for(var _0x258e55=0x0;_0x258e55<_0x5e4a6e[_0xbb10('0x36')];_0x258e55++){if(_0x5e4a6e[_0xbb10('0x6e')](_0x258e55)=='-'){_0x251417+=_0x5e4a6e['charAt'](_0x258e55);}else{_0x251417+='['+_0x5e4a6e[_0xbb10('0x6e')](_0x258e55)+']';}}_0x251417+='.';return _0x251417;}exports[_0xbb10('0x26')]=function(_0x2a166e,_0x2ceb3e,_0x12f750){var _0x17807e=_0x2a166e[_0xbb10('0x4f')];_0x17807e['prefix']='system-'+_0x17807e['name']+'-';return db[_0xbb10('0x4d')][_0xbb10('0x4e')](function(_0x3eda96){return db['VoicePrefix']['update'](_0x17807e,{'where':{'id':_0x17807e['id']},'transaction':_0x3eda96})[_0xbb10('0x27')](function(){return db[_0xbb10('0x50')][_0xbb10('0x28')]({'where':{'VoicePrefixId':_0x17807e['id']},'transaction':_0x3eda96})[_0xbb10('0x27')](function(){return db[_0xbb10('0x50')][_0xbb10('0x4a')]({'where':{'id':_0x17807e['VoiceExtensionId']},'raw':!![]})[_0xbb10('0x27')](function(_0x15fae2){return createVoicePrefixExtensions(_0x17807e,_0x15fae2,_0x3eda96);});});});})[_0xbb10('0x27')](function(){return db[_0xbb10('0x2e')][_0xbb10('0x6f')](_0x17807e['id']);})['then'](respondWithResult(_0x2ceb3e,null))['catch'](handleError(_0x2ceb3e,null));};exports['addAgents']=function(_0x329da7,_0x1e0569,_0x36917f){return db[_0xbb10('0x2e')][_0xbb10('0x4a')]({'where':{'id':_0x329da7[_0xbb10('0x70')]['id']}})['then'](handleEntityNotFound(_0x1e0569,null))[_0xbb10('0x27')](function(_0x4bc316){if(_0x4bc316){return _0x4bc316['addAgents'](_0x329da7['body'][_0xbb10('0x71')],_[_0xbb10('0x72')](_0x329da7[_0xbb10('0x4f')],[_0xbb10('0x71'),'id'])||{})['spread'](function(_0x122d38){for(var _0x5c583b=0x0;_0x5c583b<_0x329da7['body'][_0xbb10('0x71')][_0xbb10('0x36')];_0x5c583b+=0x1){socket[_0xbb10('0x73')](_0xbb10('0x74'),{'UserId':_0x329da7[_0xbb10('0x4f')]['ids'][_0x5c583b],'VoicePrefixId':_0x329da7[_0xbb10('0x70')]['id']});}return _0x122d38;});}})[_0xbb10('0x27')](respondWithResult(_0x1e0569,null))[_0xbb10('0x46')](handleError(_0x1e0569,null));};exports[_0xbb10('0x75')]=function(_0x43cdb7,_0x27f42f,_0x174395){return db['VoicePrefix'][_0xbb10('0x4a')]({'where':{'id':_0x43cdb7[_0xbb10('0x70')]['id']}})[_0xbb10('0x27')](handleEntityNotFound(_0x27f42f,null))[_0xbb10('0x27')](function(_0x37b20e){if(_0x37b20e){return _0x37b20e[_0xbb10('0x75')](_0x43cdb7[_0xbb10('0x30')][_0xbb10('0x71')])['then'](function(){if(_[_0xbb10('0x76')](_0x43cdb7[_0xbb10('0x30')][_0xbb10('0x71')])){for(var _0x56416a=0x0;_0x56416a<_0x43cdb7['query']['ids'][_0xbb10('0x36')];_0x56416a+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x43cdb7[_0xbb10('0x30')][_0xbb10('0x71')][_0x56416a]),'VoicePrefixId':Number(_0x43cdb7[_0xbb10('0x70')]['id'])});}}else{socket[_0xbb10('0x73')](_0xbb10('0x77'),{'UserId':Number(_0x43cdb7[_0xbb10('0x30')][_0xbb10('0x71')]),'VoicePrefixId':Number(_0x43cdb7[_0xbb10('0x70')]['id'])});}});}})[_0xbb10('0x27')](respondWithStatusCode(_0x27f42f,null))['catch'](handleError(_0x27f42f,null));};exports[_0xbb10('0x78')]=function(_0x1351eb,_0x46b6d2,_0x35b811){var _0x5c8eb8={};var _0x4c0795={};var _0x3547a3;var _0x2280bd;return db[_0xbb10('0x2e')][_0xbb10('0x79')]({'where':{'id':_0x1351eb['params']['id']}})[_0xbb10('0x27')](handleEntityNotFound(_0x46b6d2,null))[_0xbb10('0x27')](function(_0x3f0d74){if(_0x3f0d74){_0x3547a3=_0x3f0d74;_0x4c0795[_0xbb10('0x33')]=_[_0xbb10('0x2f')](db['User']['rawAttributes']);_0x4c0795[_0xbb10('0x30')]=_[_0xbb10('0x2f')](_0x1351eb[_0xbb10('0x30')]);_0x4c0795['filters']=_[_0xbb10('0x32')](_0x4c0795[_0xbb10('0x33')],_0x4c0795['query']);_0x5c8eb8['attributes']=_[_0xbb10('0x32')](_0x4c0795[_0xbb10('0x33')],qs[_0xbb10('0x35')](_0x1351eb['query'][_0xbb10('0x35')]));_0x5c8eb8[_0xbb10('0x34')]=_0x5c8eb8[_0xbb10('0x34')][_0xbb10('0x36')]?_0x5c8eb8[_0xbb10('0x34')]:_0x4c0795[_0xbb10('0x33')];_0x5c8eb8[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_0x1351eb[_0xbb10('0x30')]['sort']);_0x5c8eb8[_0xbb10('0x3b')]=qs[_0xbb10('0x31')](_[_0xbb10('0x3c')](_0x1351eb[_0xbb10('0x30')],_0x4c0795[_0xbb10('0x31')]));if(_0x1351eb[_0xbb10('0x30')][_0xbb10('0x41')]){_0x5c8eb8[_0xbb10('0x3b')]=_[_0xbb10('0x3d')](_0x5c8eb8[_0xbb10('0x3b')],{'$or':_[_0xbb10('0x7a')](_0x5c8eb8[_0xbb10('0x34')],function(_0x59e985){var _0x51f106={};_0x51f106[_0x59e985]={'$like':'%'+_0x1351eb[_0xbb10('0x30')][_0xbb10('0x41')]+'%'};return _0x51f106;})});}_0x5c8eb8=_[_0xbb10('0x3d')]({},_0x5c8eb8,_0x1351eb[_0xbb10('0x42')]);return _0x3547a3[_0xbb10('0x78')](_0x5c8eb8);}})['then'](function(_0x2749a7){if(_0x2749a7){_0x2280bd=_0x2749a7[_0xbb10('0x36')];if(!_0x1351eb[_0xbb10('0x30')][_0xbb10('0x7b')](_0xbb10('0x37'))){_0x5c8eb8[_0xbb10('0x38')]=qs['limit'](_0x1351eb[_0xbb10('0x30')][_0xbb10('0x38')]);_0x5c8eb8['offset']=qs[_0xbb10('0x21')](_0x1351eb['query'][_0xbb10('0x21')]);}return _0x3547a3[_0xbb10('0x78')](_0x5c8eb8);}})[_0xbb10('0x27')](function(_0xa99bf5){if(_0xa99bf5){return _0xa99bf5?{'count':_0x2280bd,'rows':_0xa99bf5}:null;}})[_0xbb10('0x27')](respondWithResult(_0x46b6d2,null))['catch'](handleError(_0x46b6d2,null));}; \ No newline at end of file +var _0xbaf0=['rows','catch','show','params','fields','find','destroy','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','goto','context','${EXTEN:','charAt','system-','ids','spread','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','order','pick','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','get','VoicePrefixes','UserProfileResource','then','error','name','send','index','VoicePrefix','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','sort','where','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll'];(function(_0x5ad820,_0x955136){var _0x1969d3=function(_0x156309){while(--_0x156309){_0x5ad820['push'](_0x5ad820['shift']());}};_0x1969d3(++_0x955136);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0baf('0x0'));var rimraf=require(_0x0baf('0x1'));var zipdir=require(_0x0baf('0x2'));var jsonpatch=require(_0x0baf('0x3'));var rp=require(_0x0baf('0x4'));var moment=require(_0x0baf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0baf('0x6'));var util=require(_0x0baf('0x7'));var path=require(_0x0baf('0x8'));var sox=require(_0x0baf('0x9'));var csv=require(_0x0baf('0xa'));var ejs=require(_0x0baf('0xb'));var fs=require('fs');var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var hardwareService=require(_0x0baf('0x15'));var logger=require(_0x0baf('0x16'))(_0x0baf('0x17'));var utils=require(_0x0baf('0x18'));var config=require(_0x0baf('0x19'));var db=require(_0x0baf('0x1a'))['db'];config['redis']=_['defaults'](config[_0x0baf('0x1b')],{'host':_0x0baf('0x1c'),'port':0x18eb});var socket=require(_0x0baf('0x1d'))(new Redis(config[_0x0baf('0x1b')]));require('./voicePrefix.socket')[_0x0baf('0x1e')](socket);function respondWithStatusCode(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0xcc;return function(_0x1f50c3){if(_0x1f50c3){return _0x49e44b[_0x0baf('0x1f')](_0x1c76a8);}return _0x49e44b[_0x0baf('0x20')](_0x1c76a8)[_0x0baf('0x21')]();};}function respondWithResult(_0x469599,_0x4f80a8){_0x4f80a8=_0x4f80a8||0xc8;return function(_0x4cd79d){if(_0x4cd79d){return _0x469599[_0x0baf('0x20')](_0x4f80a8)[_0x0baf('0x22')](_0x4cd79d);}};}function respondWithFilteredResult(_0x283408,_0x3d83a3){return function(_0x2cf7da){if(_0x2cf7da){var _0x288a98=_0x2cf7da[_0x0baf('0x23')],_0x53c338=_0x3d83a3[_0x0baf('0x24')],_0x63c820=_0x3d83a3[_0x0baf('0x24')]+_0x3d83a3[_0x0baf('0x25')],_0xfbecec;if(_0x63c820>=_0x288a98){_0x63c820=_0x288a98;_0xfbecec=0xc8;}else{_0xfbecec=0xce;}_0x283408['status'](_0xfbecec);return _0x283408['set'](_0x0baf('0x26'),_0x53c338+'-'+_0x63c820+'/'+_0x288a98)[_0x0baf('0x22')](_0x2cf7da);}return null;};}function patchUpdates(_0x32e839){return function(_0x1848e8){try{jsonpatch[_0x0baf('0x27')](_0x1848e8,_0x32e839,!![]);}catch(_0x3e3e20){return BPromise[_0x0baf('0x28')](_0x3e3e20);}return _0x1848e8[_0x0baf('0x29')]();};}function saveUpdates(_0x2c42e2,_0x15a2c3){return function(_0x54f2fa){if(_0x54f2fa){return _0x54f2fa[_0x0baf('0x2a')](_0x2c42e2)['then'](function(_0xf6c158){return _0xf6c158;});}return null;};}function removeEntity(_0x5dbf00,_0x4de74c){return function(_0x2ef0aa){if(_0x2ef0aa){return _0x2ef0aa['destroy']()['then'](function(){var _0x47c4b=_0x2ef0aa[_0x0baf('0x2b')]({'plain':!![]});var _0x34e264=_0x0baf('0x2c');return db[_0x0baf('0x2d')]['destroy']({'where':{'type':_0x34e264,'resourceId':_0x47c4b['id']}})[_0x0baf('0x2e')](function(){return _0x2ef0aa;});})[_0x0baf('0x2e')](function(){_0x5dbf00[_0x0baf('0x20')](0xcc)[_0x0baf('0x21')]();});}};}function handleEntityNotFound(_0x3843b8,_0x3b9b31){return function(_0x453525){if(!_0x453525){_0x3843b8['sendStatus'](0x194);}return _0x453525;};}function handleError(_0x1590b4,_0x393a5a){_0x393a5a=_0x393a5a||0x1f4;return function(_0xcaf13d){logger[_0x0baf('0x2f')](_0xcaf13d['stack']);if(_0xcaf13d[_0x0baf('0x30')]){delete _0xcaf13d[_0x0baf('0x30')];}_0x1590b4['status'](_0x393a5a)[_0x0baf('0x31')](_0xcaf13d);};}exports[_0x0baf('0x32')]=function(_0x478ce8,_0xb4dbb1){var _0xd14f0f={},_0x366924={},_0x213a6a={'count':0x0,'rows':[]};var _0x57476f=db[_0x0baf('0x33')][_0x0baf('0x34')];_0x366924[_0x0baf('0x35')]=_[_0x0baf('0x36')](_0x57476f);_0x366924[_0x0baf('0x37')]=_[_0x0baf('0x36')](_0x478ce8[_0x0baf('0x37')]);_0x366924[_0x0baf('0x38')]=_[_0x0baf('0x39')](_0x366924[_0x0baf('0x35')],_0x366924[_0x0baf('0x37')]);_0xd14f0f[_0x0baf('0x3a')]=_[_0x0baf('0x39')](_0x366924[_0x0baf('0x35')],qs['fields'](_0x478ce8[_0x0baf('0x37')]['fields']));_0xd14f0f[_0x0baf('0x3a')]=_0xd14f0f[_0x0baf('0x3a')][_0x0baf('0x3b')]?_0xd14f0f[_0x0baf('0x3a')]:_0x366924['model'];if(!_0x478ce8[_0x0baf('0x37')][_0x0baf('0x3c')]('nolimit')){_0xd14f0f[_0x0baf('0x25')]=qs[_0x0baf('0x25')](_0x478ce8[_0x0baf('0x37')][_0x0baf('0x25')]);_0xd14f0f[_0x0baf('0x24')]=qs[_0x0baf('0x24')](_0x478ce8[_0x0baf('0x37')][_0x0baf('0x24')]);}_0xd14f0f['order']=qs[_0x0baf('0x3d')](_0x478ce8[_0x0baf('0x37')]['sort']);_0xd14f0f[_0x0baf('0x3e')]=qs['filters'](_['pick'](_0x478ce8[_0x0baf('0x37')],_0x366924[_0x0baf('0x38')]));if(_0x478ce8['query']['filter']){_0xd14f0f[_0x0baf('0x3e')]=_[_0x0baf('0x3f')](_0xd14f0f[_0x0baf('0x3e')],{'$or':_[_0x0baf('0x40')](_0x57476f,function(_0x15eb5c){if(_0x15eb5c[_0x0baf('0x41')][_0x0baf('0x42')]!==_0x0baf('0x43')){var _0x631f74={};_0x631f74[_0x15eb5c[_0x0baf('0x44')]]={'$like':'%'+_0x478ce8[_0x0baf('0x37')][_0x0baf('0x45')]+'%'};return _0x631f74;}})});}_0xd14f0f=_[_0x0baf('0x3f')]({},_0xd14f0f,_0x478ce8[_0x0baf('0x46')]);var _0x53d6b7={'where':_0xd14f0f[_0x0baf('0x3e')]};return db[_0x0baf('0x33')]['count'](_0x53d6b7)[_0x0baf('0x2e')](function(_0x324369){_0x213a6a[_0x0baf('0x23')]=_0x324369;if(_0x478ce8[_0x0baf('0x37')][_0x0baf('0x47')]){_0xd14f0f[_0x0baf('0x48')]=[{'all':!![]}];}return db['VoicePrefix'][_0x0baf('0x49')](_0xd14f0f);})[_0x0baf('0x2e')](function(_0x540c41){_0x213a6a[_0x0baf('0x4a')]=_0x540c41;return _0x213a6a;})[_0x0baf('0x2e')](respondWithFilteredResult(_0xb4dbb1,_0xd14f0f))[_0x0baf('0x4b')](handleError(_0xb4dbb1,null));};exports[_0x0baf('0x4c')]=function(_0x504031,_0x193fd3){var _0x43919e={'raw':![],'where':{'id':_0x504031[_0x0baf('0x4d')]['id']}},_0x301412={};_0x301412[_0x0baf('0x35')]=_[_0x0baf('0x36')](db[_0x0baf('0x33')][_0x0baf('0x34')]);_0x301412[_0x0baf('0x37')]=_[_0x0baf('0x36')](_0x504031['query']);_0x301412[_0x0baf('0x38')]=_[_0x0baf('0x39')](_0x301412[_0x0baf('0x35')],_0x301412[_0x0baf('0x37')]);_0x43919e[_0x0baf('0x3a')]=_['intersection'](_0x301412[_0x0baf('0x35')],qs[_0x0baf('0x4e')](_0x504031[_0x0baf('0x37')][_0x0baf('0x4e')]));_0x43919e[_0x0baf('0x3a')]=_0x43919e['attributes'][_0x0baf('0x3b')]?_0x43919e[_0x0baf('0x3a')]:_0x301412[_0x0baf('0x35')];if(_0x504031[_0x0baf('0x37')][_0x0baf('0x47')]){_0x43919e[_0x0baf('0x48')]=[{'all':!![]}];}_0x43919e=_[_0x0baf('0x3f')]({},_0x43919e,_0x504031['options']);return db[_0x0baf('0x33')][_0x0baf('0x4f')](_0x43919e)[_0x0baf('0x2e')](handleEntityNotFound(_0x193fd3,null))['then'](respondWithResult(_0x193fd3,null))[_0x0baf('0x4b')](handleError(_0x193fd3,null));};exports[_0x0baf('0x50')]=function(_0x10fa62,_0x3fabec){return db[_0x0baf('0x33')][_0x0baf('0x4f')]({'where':{'id':_0x10fa62[_0x0baf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3fabec,null))[_0x0baf('0x2e')](removeEntity(_0x3fabec,null))[_0x0baf('0x4b')](handleError(_0x3fabec,null));};exports[_0x0baf('0x51')]=function(_0x2676eb,_0x293bd5){return db[_0x0baf('0x33')][_0x0baf('0x51')]()[_0x0baf('0x2e')](respondWithResult(_0x293bd5,null))[_0x0baf('0x4b')](handleError(_0x293bd5,null));};exports[_0x0baf('0x52')]=function(_0x2c6cdf,_0x58c33f){var _0x528ff6;return db[_0x0baf('0x53')][_0x0baf('0x54')](function(_0x1cd114){return db[_0x0baf('0x33')][_0x0baf('0x52')](_0x2c6cdf[_0x0baf('0x55')],{'transaction':_0x1cd114})[_0x0baf('0x2e')](function(_0x4b492c){_0x528ff6=_0x4b492c[_0x0baf('0x2b')]({'plain':!![]});return db[_0x0baf('0x56')][_0x0baf('0x4f')]({'where':{'id':_0x528ff6[_0x0baf('0x57')]},'raw':!![]})[_0x0baf('0x2e')](function(_0x1e2671){return createVoicePrefixExtensions(_0x528ff6,_0x1e2671,_0x1cd114);});});})['then'](function(){var _0x3eebe5=_0x2c6cdf['user'][_0x0baf('0x2b')]({'plain':!![]});if(!_0x3eebe5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3eebe5[_0x0baf('0x58')]==='user'){var _0x35b1a5=_0x528ff6;return db['UserProfileSection'][_0x0baf('0x4f')]({'where':{'name':_0x0baf('0x2c'),'userProfileId':_0x3eebe5[_0x0baf('0x59')]},'raw':!![]})[_0x0baf('0x2e')](function(_0x42a68b){if(_0x42a68b&&_0x42a68b['autoAssociation']===0x0){return db[_0x0baf('0x2d')][_0x0baf('0x52')]({'name':_0x35b1a5[_0x0baf('0x30')],'resourceId':_0x35b1a5['id'],'type':_0x42a68b[_0x0baf('0x30')],'sectionId':_0x42a68b['id']},{})[_0x0baf('0x2e')](function(){return _0x528ff6;});}else{return _0x528ff6;}})[_0x0baf('0x4b')](function(_0x480834){logger[_0x0baf('0x2f')](_0x0baf('0x5a'),_0x480834);throw _0x480834;});}return _0x528ff6;})[_0x0baf('0x2e')](respondWithResult(_0x58c33f,null))[_0x0baf('0x4b')](handleError(_0x58c33f,null));};function Extension(_0xbc7cc2,_0x1a7ffb,_0x3834a2,_0x565292){this['context']=_0x0baf('0x5b');this[_0x0baf('0x5c')]=_0xbc7cc2;this[_0x0baf('0x5d')]=_0x3834a2;this[_0x0baf('0x41')]=_0x0baf('0x5e');this[_0x0baf('0x5f')]=_0x0baf('0x60');this[_0x0baf('0x61')]=_0x1a7ffb;this[_0x0baf('0x62')]=_0x565292;}function createVoicePrefixExtensions(_0x585969,_0x3238f9,_0x268be8){return new BPromise(function(_0x3c2d03,_0x1245de){var _0x2024e2=new Extension(formatPrefixName(_0x585969[_0x0baf('0x63')]),0x1,_0x0baf('0x64'),'Voice\x20Prefix');_0x2024e2[_0x0baf('0x65')]=_0x585969['id'];return db[_0x0baf('0x56')][_0x0baf('0x52')](_0x2024e2,{'transaction':_0x268be8})[_0x0baf('0x2e')](function(_0x1c7d88){var _0x1a6d22=_0x1c7d88[_0x0baf('0x2b')]({'plain':!![]});var _0x12543e=_['map'](addVoicePrefixExtensions(_0x585969,_0x3238f9),function(_0x178495){_0x178495['VoiceExtensionId']=_0x1a6d22['id'];_0x178495[_0x0baf('0x65')]=_0x585969['id'];return _0x178495;});return db['VoiceExtension']['bulkCreate'](_0x12543e,{'transaction':_0x268be8})[_0x0baf('0x2e')](function(_0x4a2cb0){if(!_0x4a2cb0){return _0x1245de(_0x0baf('0x66'));}else{return _0x3c2d03(_0x4a2cb0);}})[_0x0baf('0x4b')](function(_0x49d713){return _0x1245de(_0x49d713);});});;});};function addVoicePrefixExtensions(_0x7fc9ae,_0xfb6708){var _0x156572=[];var _0x5b3c1d=formatPrefixName(_0x7fc9ae['prefix']);_0x156572[_0x0baf('0x67')](new Extension(_0x5b3c1d,0x2,_0x0baf('0x68'),_0x0baf('0x69')+_0x7fc9ae[_0x0baf('0x30')]));if(_0x7fc9ae[_0x0baf('0x6a')]){_0x156572['push'](new Extension(_0x5b3c1d,0x3,_0x0baf('0x68'),'PREFIX-CALLERIDALL='+_0x7fc9ae['callerIdAll']));}else{_0x156572['push'](new Extension(_0x5b3c1d,0x3,_0x0baf('0x64'),'No\x20callerid\x20available'));}_0x156572['push'](new Extension(_0x5b3c1d,0x4,_0x0baf('0x6b'),_0xfb6708[_0x0baf('0x6c')]+','+_0x0baf('0x6d')+(0x8+_0x7fc9ae[_0x0baf('0x30')][_0x0baf('0x3b')])+'}'+','+0x1));return _0x156572;}function formatPrefixName(_0x27ddc7){var _0x4c05d6='_';for(var _0xec3b32=0x0;_0xec3b32<_0x27ddc7[_0x0baf('0x3b')];_0xec3b32++){if(_0x27ddc7[_0x0baf('0x6e')](_0xec3b32)=='-'){_0x4c05d6+=_0x27ddc7[_0x0baf('0x6e')](_0xec3b32);}else{_0x4c05d6+='['+_0x27ddc7[_0x0baf('0x6e')](_0xec3b32)+']';}}_0x4c05d6+='.';return _0x4c05d6;}exports[_0x0baf('0x2a')]=function(_0x5cf3d3,_0x42e8ad,_0x468363){var _0x29fd46=_0x5cf3d3['body'];_0x29fd46[_0x0baf('0x63')]=_0x0baf('0x6f')+_0x29fd46[_0x0baf('0x30')]+'-';return db[_0x0baf('0x53')][_0x0baf('0x54')](function(_0x27a959){return db[_0x0baf('0x33')]['update'](_0x29fd46,{'where':{'id':_0x29fd46['id']},'transaction':_0x27a959})['then'](function(){return db['VoiceExtension'][_0x0baf('0x50')]({'where':{'VoicePrefixId':_0x29fd46['id']},'transaction':_0x27a959})[_0x0baf('0x2e')](function(){return db[_0x0baf('0x56')][_0x0baf('0x4f')]({'where':{'id':_0x29fd46[_0x0baf('0x57')]},'raw':!![]})[_0x0baf('0x2e')](function(_0x506110){return createVoicePrefixExtensions(_0x29fd46,_0x506110,_0x27a959);});});});})['then'](function(){return db[_0x0baf('0x33')]['findById'](_0x29fd46['id']);})[_0x0baf('0x2e')](respondWithResult(_0x42e8ad,null))[_0x0baf('0x4b')](handleError(_0x42e8ad,null));};exports['addAgents']=function(_0xf45ec3,_0x44dfe2,_0x147f98){return db[_0x0baf('0x33')][_0x0baf('0x4f')]({'where':{'id':_0xf45ec3[_0x0baf('0x4d')]['id']}})[_0x0baf('0x2e')](handleEntityNotFound(_0x44dfe2,null))[_0x0baf('0x2e')](function(_0xfcc697){if(_0xfcc697){return _0xfcc697['addAgents'](_0xf45ec3['body']['ids'],_['omit'](_0xf45ec3['body'],[_0x0baf('0x70'),'id'])||{})[_0x0baf('0x71')](function(_0x333b07){for(var _0x20a514=0x0;_0x20a514<_0xf45ec3['body'][_0x0baf('0x70')][_0x0baf('0x3b')];_0x20a514+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':_0xf45ec3[_0x0baf('0x55')][_0x0baf('0x70')][_0x20a514],'VoicePrefixId':_0xf45ec3[_0x0baf('0x4d')]['id']});}return _0x333b07;});}})[_0x0baf('0x2e')](respondWithResult(_0x44dfe2,null))[_0x0baf('0x4b')](handleError(_0x44dfe2,null));};exports[_0x0baf('0x72')]=function(_0x3ce111,_0x399f40,_0x5e0c1b){return db[_0x0baf('0x33')][_0x0baf('0x4f')]({'where':{'id':_0x3ce111['params']['id']}})[_0x0baf('0x2e')](handleEntityNotFound(_0x399f40,null))[_0x0baf('0x2e')](function(_0x538f24){if(_0x538f24){return _0x538f24[_0x0baf('0x72')](_0x3ce111[_0x0baf('0x37')][_0x0baf('0x70')])[_0x0baf('0x2e')](function(){if(_[_0x0baf('0x73')](_0x3ce111['query']['ids'])){for(var _0x1dab50=0x0;_0x1dab50<_0x3ce111[_0x0baf('0x37')]['ids'][_0x0baf('0x3b')];_0x1dab50+=0x1){socket[_0x0baf('0x74')](_0x0baf('0x75'),{'UserId':Number(_0x3ce111['query'][_0x0baf('0x70')][_0x1dab50]),'VoicePrefixId':Number(_0x3ce111[_0x0baf('0x4d')]['id'])});}}else{socket[_0x0baf('0x74')]('userVoicePrefix:remove',{'UserId':Number(_0x3ce111[_0x0baf('0x37')]['ids']),'VoicePrefixId':Number(_0x3ce111[_0x0baf('0x4d')]['id'])});}});}})[_0x0baf('0x2e')](respondWithStatusCode(_0x399f40,null))[_0x0baf('0x4b')](handleError(_0x399f40,null));};exports[_0x0baf('0x76')]=function(_0xc09ac3,_0x52e845,_0x866e6e){var _0x57f33c={};var _0x5c8805={};var _0xc895a6;var _0x205c3d;return db[_0x0baf('0x33')][_0x0baf('0x77')]({'where':{'id':_0xc09ac3[_0x0baf('0x4d')]['id']}})[_0x0baf('0x2e')](handleEntityNotFound(_0x52e845,null))[_0x0baf('0x2e')](function(_0x1cda78){if(_0x1cda78){_0xc895a6=_0x1cda78;_0x5c8805[_0x0baf('0x35')]=_[_0x0baf('0x36')](db[_0x0baf('0x78')][_0x0baf('0x34')]);_0x5c8805['query']=_['keys'](_0xc09ac3[_0x0baf('0x37')]);_0x5c8805[_0x0baf('0x38')]=_[_0x0baf('0x39')](_0x5c8805['model'],_0x5c8805['query']);_0x57f33c[_0x0baf('0x3a')]=_[_0x0baf('0x39')](_0x5c8805[_0x0baf('0x35')],qs[_0x0baf('0x4e')](_0xc09ac3[_0x0baf('0x37')][_0x0baf('0x4e')]));_0x57f33c[_0x0baf('0x3a')]=_0x57f33c[_0x0baf('0x3a')][_0x0baf('0x3b')]?_0x57f33c['attributes']:_0x5c8805[_0x0baf('0x35')];_0x57f33c[_0x0baf('0x79')]=qs[_0x0baf('0x3d')](_0xc09ac3[_0x0baf('0x37')]['sort']);_0x57f33c['where']=qs['filters'](_[_0x0baf('0x7a')](_0xc09ac3[_0x0baf('0x37')],_0x5c8805['filters']));if(_0xc09ac3['query'][_0x0baf('0x45')]){_0x57f33c[_0x0baf('0x3e')]=_['merge'](_0x57f33c[_0x0baf('0x3e')],{'$or':_[_0x0baf('0x40')](_0x57f33c[_0x0baf('0x3a')],function(_0x4082ce){var _0x46c95f={};_0x46c95f[_0x4082ce]={'$like':'%'+_0xc09ac3[_0x0baf('0x37')][_0x0baf('0x45')]+'%'};return _0x46c95f;})});}_0x57f33c=_[_0x0baf('0x3f')]({},_0x57f33c,_0xc09ac3[_0x0baf('0x46')]);return _0xc895a6[_0x0baf('0x76')](_0x57f33c);}})[_0x0baf('0x2e')](function(_0x33124d){if(_0x33124d){_0x205c3d=_0x33124d['length'];if(!_0xc09ac3[_0x0baf('0x37')][_0x0baf('0x3c')](_0x0baf('0x7b'))){_0x57f33c[_0x0baf('0x25')]=qs[_0x0baf('0x25')](_0xc09ac3[_0x0baf('0x37')]['limit']);_0x57f33c[_0x0baf('0x24')]=qs[_0x0baf('0x24')](_0xc09ac3[_0x0baf('0x37')][_0x0baf('0x24')]);}return _0xc895a6[_0x0baf('0x76')](_0x57f33c);}})['then'](function(_0x3761b5){if(_0x3761b5){return _0x3761b5?{'count':_0x205c3d,'rows':_0x3761b5}:null;}})[_0x0baf('0x2e')](respondWithResult(_0x52e845,null))[_0x0baf('0x4b')](handleError(_0x52e845,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index f6abc5b..da68d4b 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 _0x34e8=['emit','hasOwnProperty','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update','remove'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x34e8,0x12c));var _0x834e=function(_0x2fbdf6,_0x3eba1f){_0x2fbdf6=_0x2fbdf6-0x0;var _0x518135=_0x34e8[_0x2fbdf6];return _0x518135;};'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 +var _0x70e0=['emit','events','../../mysqldb','VoicePrefix','update','remove'];(function(_0x55b92a,_0x57244f){var _0x233a0e=function(_0x133749){while(--_0x133749){_0x55b92a['push'](_0x55b92a['shift']());}};_0x233a0e(++_0x57244f);}(_0x70e0,0x17b));var _0x070e=function(_0x14682c,_0x1fc052){_0x14682c=_0x14682c-0x0;var _0x5a0db8=_0x70e0[_0x14682c];return _0x5a0db8;};'use strict';var EventEmitter=require(_0x070e('0x0'));var VoicePrefix=require(_0x070e('0x1'))['db'][_0x070e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x070e('0x3'),'afterDestroy':_0x070e('0x4')};function emitEvent(_0x277d32){return function(_0x2593e5,_0x5c90fc,_0x7bce9b){VoicePrefixEvents['emit'](_0x277d32+':'+_0x2593e5['id'],_0x2593e5);VoicePrefixEvents[_0x070e('0x5')](_0x277d32,_0x2593e5);_0x7bce9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 7e6c9e3..6876db3 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 _0xa39e=['exports','voice_prefixes','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./voicePrefix.attributes'];(function(_0x6243a6,_0x39cbea){var _0x111335=function(_0x289a06){while(--_0x289a06){_0x6243a6['push'](_0x6243a6['shift']());}};_0x111335(++_0x39cbea);}(_0xa39e,0x1db));var _0xea39=function(_0x6287b6,_0x5682e7){_0x6287b6=_0x6287b6-0x0;var _0x5d6be4=_0xa39e[_0x6287b6];return _0x5d6be4;};'use strict';var _=require(_0xea39('0x0'));var util=require(_0xea39('0x1'));var logger=require(_0xea39('0x2'))('api');var moment=require(_0xea39('0x3'));var BPromise=require(_0xea39('0x4'));var rp=require(_0xea39('0x5'));var fs=require('fs');var path=require(_0xea39('0x6'));var rimraf=require('rimraf');var config=require(_0xea39('0x7'));var attributes=require(_0xea39('0x8'));module[_0xea39('0x9')]=function(_0x40ffb7,_0x2e76be){return _0x40ffb7['define']('VoicePrefix',attributes,{'tableName':_0xea39('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2f1=['api','moment','bluebird','request-promise','rimraf','./voicePrefix.attributes','voice_prefixes','../../config/logger'];(function(_0x3b53b0,_0x23dc58){var _0x4eddc6=function(_0x46254f){while(--_0x46254f){_0x3b53b0['push'](_0x3b53b0['shift']());}};_0x4eddc6(++_0x23dc58);}(_0xc2f1,0xb7));var _0x1c2f=function(_0x503388,_0x252db0){_0x503388=_0x503388-0x0;var _0x479fca=_0xc2f1[_0x503388];return _0x479fca;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1c2f('0x0'))(_0x1c2f('0x1'));var moment=require(_0x1c2f('0x2'));var BPromise=require(_0x1c2f('0x3'));var rp=require(_0x1c2f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1c2f('0x5'));var config=require('../../config/environment');var attributes=require(_0x1c2f('0x6'));module['exports']=function(_0x53cdc5,_0x1403e8){return _0x53cdc5['define']('VoicePrefix',attributes,{'tableName':_0x1c2f('0x7'),'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 07a6702..03ae983 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 _0x04ee=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x04ee,0x13f));var _0xe04e=function(_0x324ded,_0x5e0e7b){_0x324ded=_0x324ded-0x0;var _0x3d8379=_0x04ee[_0x324ded];return _0x3d8379;};'use strict';var _=require(_0xe04e('0x0'));var util=require(_0xe04e('0x1'));var moment=require(_0xe04e('0x2'));var BPromise=require(_0xe04e('0x3'));var rs=require(_0xe04e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe04e('0x5'));var logger=require(_0xe04e('0x6'))('rpc');var config=require(_0xe04e('0x7'));var jayson=require(_0xe04e('0x8'));var client=jayson[_0xe04e('0x9')][_0xe04e('0xa')]({'port':0x232a});config[_0xe04e('0xb')]=_[_0xe04e('0xc')](config[_0xe04e('0xb')],{'host':_0xe04e('0xd'),'port':0x18eb});var socket=require(_0xe04e('0xe'))(new Redis(config[_0xe04e('0xb')]));require(_0xe04e('0xf'))['register'](socket);function respondWithRpcPromise(_0x57a3a3,_0x3eeaca,_0x5cc242){return new BPromise(function(_0x20a712,_0x36e572){return client[_0xe04e('0x10')](_0x57a3a3,_0x5cc242)[_0xe04e('0x11')](function(_0x5964bf){logger[_0xe04e('0x12')](_0xe04e('0x13'),_0x3eeaca,_0xe04e('0x14'));logger[_0xe04e('0x15')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x3eeaca,'request\x20sent',JSON[_0xe04e('0x16')](_0x5964bf));if(_0x5964bf[_0xe04e('0x17')]){if(_0x5964bf[_0xe04e('0x17')][_0xe04e('0x18')]===0x1f4){logger[_0xe04e('0x17')](_0xe04e('0x13'),_0x3eeaca,_0x5964bf[_0xe04e('0x17')][_0xe04e('0x19')]);return _0x36e572(_0x5964bf[_0xe04e('0x17')][_0xe04e('0x19')]);}logger[_0xe04e('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x3eeaca,_0x5964bf[_0xe04e('0x17')][_0xe04e('0x19')]);return _0x20a712(_0x5964bf['error']['message']);}else{logger[_0xe04e('0x12')](_0xe04e('0x13'),_0x3eeaca,_0xe04e('0x14'));_0x20a712(_0x5964bf[_0xe04e('0x1a')][_0xe04e('0x19')]);}})['catch'](function(_0x42f538){logger[_0xe04e('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x3eeaca,_0x42f538);_0x36e572(_0x42f538);});});} \ No newline at end of file +var _0x520f=['localhost','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x1798df,_0x5f8cdc){var _0x8b5988=function(_0x1287cf){while(--_0x1287cf){_0x1798df['push'](_0x1798df['shift']());}};_0x8b5988(++_0x5f8cdc);}(_0x520f,0xde));var _0xf520=function(_0x400b6c,_0x4a6139){_0x400b6c=_0x400b6c-0x0;var _0x4c4e3e=_0x520f[_0x400b6c];return _0x4c4e3e;};'use strict';var _=require(_0xf520('0x0'));var util=require(_0xf520('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf520('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf520('0x3'));var logger=require(_0xf520('0x4'))(_0xf520('0x5'));var config=require(_0xf520('0x6'));var jayson=require(_0xf520('0x7'));var client=jayson[_0xf520('0x8')][_0xf520('0x9')]({'port':0x232a});config[_0xf520('0xa')]=_[_0xf520('0xb')](config[_0xf520('0xa')],{'host':_0xf520('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf520('0xa')]));require(_0xf520('0xd'))[_0xf520('0xe')](socket);function respondWithRpcPromise(_0x1a23ad,_0x2ffc91,_0x11dc6e){return new BPromise(function(_0x1222a4,_0x2ec6c0){return client[_0xf520('0xf')](_0x1a23ad,_0x11dc6e)[_0xf520('0x10')](function(_0x5cb5d3){logger['info'](_0xf520('0x11'),_0x2ffc91,_0xf520('0x12'));logger[_0xf520('0x13')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x2ffc91,_0xf520('0x12'),JSON[_0xf520('0x14')](_0x5cb5d3));if(_0x5cb5d3[_0xf520('0x15')]){if(_0x5cb5d3['error'][_0xf520('0x16')]===0x1f4){logger[_0xf520('0x15')](_0xf520('0x11'),_0x2ffc91,_0x5cb5d3[_0xf520('0x15')][_0xf520('0x17')]);return _0x2ec6c0(_0x5cb5d3[_0xf520('0x15')][_0xf520('0x17')]);}logger[_0xf520('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x2ffc91,_0x5cb5d3[_0xf520('0x15')][_0xf520('0x17')]);return _0x1222a4(_0x5cb5d3[_0xf520('0x15')]['message']);}else{logger[_0xf520('0x18')](_0xf520('0x11'),_0x2ffc91,_0xf520('0x12'));_0x1222a4(_0x5cb5d3['result'][_0xf520('0x17')]);}})[_0xf520('0x19')](function(_0xbe9760){logger[_0xf520('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x2ffc91,_0xbe9760);_0x2ec6c0(_0xbe9760);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index de27d8f..dc5ab96 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 _0x0e29=['voicePrefix:','remove','update','emit','register'];(function(_0xe5eb4f,_0x419bc8){var _0x46df62=function(_0x5f2b3e){while(--_0x5f2b3e){_0xe5eb4f['push'](_0xe5eb4f['shift']());}};_0x46df62(++_0x419bc8);}(_0x0e29,0xe2));var _0x90e2=function(_0x42076d,_0x35b3f1){_0x42076d=_0x42076d-0x0;var _0x2e7790=_0x0e29[_0x42076d];return _0x2e7790;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0x90e2('0x0'),_0x90e2('0x1')];function createListener(_0xdd8cef,_0x576e5a){return function(_0x21399b){_0x576e5a[_0x90e2('0x2')](_0xdd8cef,_0x21399b);};}function removeListener(_0x332ab5,_0x41e4c5){return function(){VoicePrefixEvents['removeListener'](_0x332ab5,_0x41e4c5);};}exports[_0x90e2('0x3')]=function(_0x287c3a){for(var _0x53ccc7=0x0,_0x12f2d6=events['length'];_0x53ccc7<_0x12f2d6;_0x53ccc7++){var _0x3c7b3a=events[_0x53ccc7];var _0x421732=createListener(_0x90e2('0x4')+_0x3c7b3a,_0x287c3a);VoicePrefixEvents['on'](_0x3c7b3a,_0x421732);}}; \ No newline at end of file +var _0x2856=['register','voicePrefix:','./voicePrefix.events','save','remove','emit','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2856,0xe2));var _0x6285=function(_0x375efe,_0x27df2d){_0x375efe=_0x375efe-0x0;var _0x1d5db6=_0x2856[_0x375efe];return _0x1d5db6;};'use strict';var VoicePrefixEvents=require(_0x6285('0x0'));var events=[_0x6285('0x1'),_0x6285('0x2'),'update'];function createListener(_0x42ba37,_0x32fe96){return function(_0x5573ab){_0x32fe96[_0x6285('0x3')](_0x42ba37,_0x5573ab);};}function removeListener(_0x638847,_0x57cb2a){return function(){VoicePrefixEvents[_0x6285('0x4')](_0x638847,_0x57cb2a);};}exports[_0x6285('0x5')]=function(_0x41c618){for(var _0x1d9ec8=0x0,_0x4f896a=events['length'];_0x1d9ec8<_0x4f896a;_0x1d9ec8++){var _0xc3153a=events[_0x1d9ec8];var _0x272b0b=createListener(_0x6285('0x6')+_0xc3153a,_0x41c618);VoicePrefixEvents['on'](_0xc3153a,_0x272b0b);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 95b01a8..7dac89c 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 _0xdd7f=['addLists','addBlackLists','put','update','delete','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','/:id','show','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/teams','getTeams','getAgents','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addTeams','/:id/users'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdd7f,0xd6));var _0xfdd7=function(_0x19689e,_0x2cff4d){_0x19689e=_0x19689e-0x0;var _0x57559b=_0xdd7f[_0x19689e];return _0x57559b;};'use strict';var multer=require(_0xfdd7('0x0'));var util=require('util');var path=require(_0xfdd7('0x1'));var timeout=require(_0xfdd7('0x2'));var express=require(_0xfdd7('0x3'));var router=express[_0xfdd7('0x4')]();var auth=require(_0xfdd7('0x5'));var interaction=require(_0xfdd7('0x6'));var config=require(_0xfdd7('0x7'));var controller=require(_0xfdd7('0x8'));router[_0xfdd7('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfdd7('0x9')](_0xfdd7('0xa'),auth['isAuthenticated'](),controller[_0xfdd7('0xb')]);router['get'](_0xfdd7('0xc'),auth[_0xfdd7('0xd')](),controller[_0xfdd7('0xe')]);router['get'](_0xfdd7('0xf'),auth[_0xfdd7('0xd')](),controller[_0xfdd7('0x10')]);router['get'](_0xfdd7('0x11'),auth['isAuthenticated'](),controller[_0xfdd7('0x12')]);router[_0xfdd7('0x9')](_0xfdd7('0x13'),auth[_0xfdd7('0xd')](),controller['getHopperBlacks']);router[_0xfdd7('0x9')](_0xfdd7('0x14'),auth[_0xfdd7('0xd')](),controller[_0xfdd7('0x15')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xfdd7('0x16')]);router['get']('/:id/members',auth[_0xfdd7('0xd')](),controller['getMembers']);router[_0xfdd7('0x9')](_0xfdd7('0x17'),auth[_0xfdd7('0xd')](),controller[_0xfdd7('0x18')]);router['get'](_0xfdd7('0x19'),auth[_0xfdd7('0xd')](),controller['getBlackLists']);router[_0xfdd7('0x1a')]('/',auth['isAuthenticated'](),controller[_0xfdd7('0x1b')]);router[_0xfdd7('0x1a')](_0xfdd7('0x1c'),auth[_0xfdd7('0xd')](),controller[_0xfdd7('0x1d')]);router[_0xfdd7('0x1a')]('/:id/teams',auth[_0xfdd7('0xd')](),controller[_0xfdd7('0x1e')]);router['post'](_0xfdd7('0x1f'),auth[_0xfdd7('0xd')](),controller['addAgents']);router['post'](_0xfdd7('0x17'),auth[_0xfdd7('0xd')](),controller[_0xfdd7('0x20')]);router[_0xfdd7('0x1a')](_0xfdd7('0x19'),auth[_0xfdd7('0xd')](),controller[_0xfdd7('0x21')]);router[_0xfdd7('0x22')](_0xfdd7('0xa'),auth['isAuthenticated'](),controller[_0xfdd7('0x23')]);router[_0xfdd7('0x24')](_0xfdd7('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0xfdd7('0x24')](_0xfdd7('0x14'),auth[_0xfdd7('0xd')](),controller['removeTeams']);router['delete'](_0xfdd7('0x1f'),auth[_0xfdd7('0xd')](),controller[_0xfdd7('0x25')]);router[_0xfdd7('0x24')](_0xfdd7('0x17'),auth[_0xfdd7('0xd')](),controller[_0xfdd7('0x26')]);router[_0xfdd7('0x24')]('/:id/blacklists',auth[_0xfdd7('0xd')](),controller[_0xfdd7('0x27')]);module[_0xfdd7('0x28')]=router; \ No newline at end of file +var _0x333c=['delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getTeams','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','/:id/teams','addTeams','/:id/users','addAgents','addLists','addBlackLists','put','/:id','update'];(function(_0x17617a,_0x13963e){var _0xf9cf38=function(_0x4e9430){while(--_0x4e9430){_0x17617a['push'](_0x17617a['shift']());}};_0xf9cf38(++_0x13963e);}(_0x333c,0x193));var _0xc333=function(_0x512177,_0x3bc57e){_0x512177=_0x512177-0x0;var _0x1f0d7c=_0x333c[_0x512177];return _0x1f0d7c;};'use strict';var multer=require(_0xc333('0x0'));var util=require(_0xc333('0x1'));var path=require(_0xc333('0x2'));var timeout=require('connect-timeout');var express=require(_0xc333('0x3'));var router=express[_0xc333('0x4')]();var auth=require(_0xc333('0x5'));var interaction=require(_0xc333('0x6'));var config=require(_0xc333('0x7'));var controller=require(_0xc333('0x8'));router[_0xc333('0x9')]('/',auth[_0xc333('0xa')](),controller['index']);router['get']('/:id',auth[_0xc333('0xa')](),controller[_0xc333('0xb')]);router[_0xc333('0x9')](_0xc333('0xc'),auth[_0xc333('0xa')](),controller[_0xc333('0xd')]);router['get'](_0xc333('0xe'),auth[_0xc333('0xa')](),controller['getHopperHistories']);router[_0xc333('0x9')](_0xc333('0xf'),auth['isAuthenticated'](),controller[_0xc333('0x10')]);router[_0xc333('0x9')]('/:id/hopper_black',auth[_0xc333('0xa')](),controller[_0xc333('0x11')]);router['get']('/:id/teams',auth[_0xc333('0xa')](),controller[_0xc333('0x12')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['get'](_0xc333('0x13'),auth['isAuthenticated'](),controller[_0xc333('0x14')]);router[_0xc333('0x9')](_0xc333('0x15'),auth[_0xc333('0xa')](),controller[_0xc333('0x16')]);router[_0xc333('0x9')](_0xc333('0x17'),auth[_0xc333('0xa')](),controller['getBlackLists']);router[_0xc333('0x18')]('/',auth[_0xc333('0xa')](),controller[_0xc333('0x19')]);router[_0xc333('0x18')](_0xc333('0x1a'),auth['isAuthenticated'](),controller[_0xc333('0x1b')]);router['post'](_0xc333('0x1c'),auth[_0xc333('0xa')](),controller[_0xc333('0x1d')]);router[_0xc333('0x18')](_0xc333('0x1e'),auth[_0xc333('0xa')](),controller[_0xc333('0x1f')]);router[_0xc333('0x18')](_0xc333('0x15'),auth[_0xc333('0xa')](),controller[_0xc333('0x20')]);router[_0xc333('0x18')](_0xc333('0x17'),auth[_0xc333('0xa')](),controller[_0xc333('0x21')]);router[_0xc333('0x22')](_0xc333('0x23'),auth[_0xc333('0xa')](),controller[_0xc333('0x24')]);router[_0xc333('0x25')](_0xc333('0x23'),auth['isAuthenticated'](),controller[_0xc333('0x26')]);router[_0xc333('0x25')](_0xc333('0x1c'),auth[_0xc333('0xa')](),controller[_0xc333('0x27')]);router['delete']('/:id/users',auth[_0xc333('0xa')](),controller[_0xc333('0x28')]);router[_0xc333('0x25')](_0xc333('0x15'),auth[_0xc333('0xa')](),controller[_0xc333('0x29')]);router[_0xc333('0x25')](_0xc333('0x17'),auth[_0xc333('0xa')](),controller[_0xc333('0x2a')]);module[_0xc333('0x2b')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 17be820..5fdcb6a 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 _0x8377=['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)','#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)','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','ringall','leastrecent','fewestcalls','random','linear','wrandom','rrordered','setDataValue','strategy','rrmemory','getDataValue','dialMethod','booked','progressive','power','INTEGER','yes','all','once','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','predictive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8377,0xac));var _0x7837=function(_0x53f1c1,_0x6f6512){_0x53f1c1=_0x53f1c1-0x0;var _0x464d14=_0x8377[_0x53f1c1];return _0x464d14;};'use strict';var Sequelize=require(_0x7837('0x0'));module[_0x7837('0x1')]={'name':{'type':Sequelize[_0x7837('0x2')],'allowNull':![],'unique':_0x7837('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x7837('0x4')](_0x7837('0x5'),'outbound'),'allowNull':![],'defaultValue':_0x7837('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0x7837('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x7837('0x4')]('rr',_0x7837('0x6'),_0x7837('0x7'),_0x7837('0x8'),_0x7837('0x9'),'rrmemory',_0x7837('0xa'),_0x7837('0xb'),_0x7837('0xc')),'allowNull':![],'defaultValue':_0x7837('0x6'),'set':function(_0x2ea20e){this[_0x7837('0xd')](_0x7837('0xe'),_0x2ea20e?_0x2ea20e:_0x7837('0xf'));},'get':function(){var _0xdead29=this[_0x7837('0x10')]('type');var _0x329464=this[_0x7837('0x10')](_0x7837('0x11'));var _0x38fb19=this['getDataValue']('strategy');if(_0xdead29==='inbound'){return _0x38fb19;}if(_0x329464===_0x7837('0x12')&&_0x38fb19==='rrmemory'||_0x329464===_0x7837('0x12')&&_0x38fb19==='roundrobin'){return _0x38fb19;}if(_0x329464===_0x7837('0x13')||_0x329464==='predictive'||_0x329464===_0x7837('0x14')){return _0x38fb19;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x7837('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x7837('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x7837('0x2')]},'weight':{'type':Sequelize[_0x7837('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x7837('0x4')](_0x7837('0x16'),'no'),'defaultValue':_0x7837('0x16')},'autopause':{'type':Sequelize[_0x7837('0x4')](_0x7837('0x16'),'no',_0x7837('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x7837('0x15')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x7837('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x7837('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x7837('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x7837('0x4')](_0x7837('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x7837('0x4')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x7837('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x7837('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x7837('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x7837('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x7837('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x7837('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x7837('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x7837('0x4')]('yes','no'),'defaultValue':_0x7837('0x16')},'announce_holdtime':{'type':Sequelize[_0x7837('0x4')]('yes','no',_0x7837('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x7837('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x7837('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x7837('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x7837('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x7837('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x7837('0x2')]},'queue_youarenext':{'type':Sequelize[_0x7837('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x7837('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x7837('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x7837('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x7837('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x7837('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x7837('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x7837('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x7837('0x2')]},'queue_quantity1':{'type':Sequelize[_0x7837('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x7837('0x2')]},'queue_less_than':{'type':Sequelize[_0x7837('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x41bd0a){this[_0x7837('0xd')](_0x7837('0x19'),_0x41bd0a?_0x41bd0a[_0x7837('0x1a')](','):[]);},'get':function(){return this[_0x7837('0x10')]('periodic_announce')?this['getDataValue']('periodic_announce')[_0x7837('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x7837('0x2')],'defaultValue':'yes','set':function(_0x167f77){this['setDataValue'](_0x7837('0x1c'),_0x167f77?_0x167f77[_0x7837('0x1a')](','):[]);},'get':function(){return this['getDataValue'](_0x7837('0x1c'))?this['getDataValue'](_0x7837('0x1c'))[_0x7837('0x1b')](','):[];}},'leavewhenempty':{'type':Sequelize[_0x7837('0x2')],'defaultValue':'no','set':function(_0x418d5b){this[_0x7837('0xd')]('leavewhenempty',_0x418d5b?_0x418d5b[_0x7837('0x1a')](','):[]);},'get':function(){return this[_0x7837('0x10')]('leavewhenempty')?this[_0x7837('0x10')](_0x7837('0x1d'))[_0x7837('0x1b')](','):[];}},'reportholdtime':{'type':Sequelize[_0x7837('0x4')](_0x7837('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x7837('0x4')](_0x7837('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x7837('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x7837('0x4')](_0x7837('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x7837('0x2')]},'description':{'type':Sequelize[_0x7837('0x2')]},'acw':{'type':Sequelize[_0x7837('0x1e')],'defaultValue':0x0,'set':function(_0x30b090){this[_0x7837('0xd')]('acw',_0x30b090);if(_0x30b090){if(this[_0x7837('0x10')]('wrapuptime')<0x2){this[_0x7837('0xd')](_0x7837('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x7837('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x7837('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x7837('0x4')]('preview',_0x7837('0x13'),_0x7837('0x14'),_0x7837('0x20'),_0x7837('0x12')),'defaultValue':_0x7837('0x13'),'comment':_0x7837('0x21')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x7837('0x22')},'dialLimitQueue':{'type':Sequelize[_0x7837('0x15')](0x4)[_0x7837('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x7837('0x24')},'dialPredictiveOptimization':{'type':Sequelize[_0x7837('0x4')](_0x7837('0x25'),'dropRate'),'defaultValue':'dropRate','comment':_0x7837('0x26')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x7837('0x27')](0x2)[_0x7837('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x7837('0x28')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x7837('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x7837('0x29')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7837('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x7837('0x15')](0x3)[_0x7837('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7837('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x7837('0x2')],'defaultValue':_0x7837('0x2b'),'comment':_0x7837('0x2c')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x7837('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7837('0x2d')},'dialQueueProject':{'type':Sequelize[_0x7837('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x7837('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7837('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x7837('0x15')](0x3)[_0x7837('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7837('0x2e')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7837('0x15')](0x5)[_0x7837('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7837('0x2f')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7837('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x7837('0x30')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7837('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7837('0x31')},'dialGlobalMaxRetry':{'type':Sequelize[_0x7837('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7837('0x32')},'dialTimezone':{'type':Sequelize[_0x7837('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x7837('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x7837('0x4')]('always',_0x7837('0x33'),_0x7837('0x34')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x7837('0x1e')],'defaultValue':0x0,'comment':_0x7837('0x35')},'dialAMDInitialSilence':{'type':Sequelize[_0x7837('0x15')](0x9)[_0x7837('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7837('0x36')},'dialAMDGreeting':{'type':Sequelize[_0x7837('0x15')](0x9)[_0x7837('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7837('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7837('0x15')](0x9)[_0x7837('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7837('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x7837('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7837('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0x7837('0x15')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7837('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7837('0x15')](0x9)[_0x7837('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7837('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x7837('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7837('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7837('0x15')](0x5)[_0x7837('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7837('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7837('0x3d')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x7837('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x7837('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0x7837('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x7837('0x4')](_0x7837('0x3f'),_0x7837('0x40')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x7837('0x41')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x7837('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7837('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7837('0x42')},'dialCutDigit':{'type':Sequelize[_0x7837('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7837('0x43')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7837('0x15')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x7837('0x1e')],'defaultValue':![],'comment':_0x7837('0x44'),'set':function(_0x6de42c){if(!_0x6de42c)this[_0x7837('0xd')](_0x7837('0x45'),null);this[_0x7837('0xd')](_0x7837('0x46'),_0x6de42c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x7837('0x15')](0x3)[_0x7837('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x7837('0x15')](0x3)[_0x7837('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x7c8f=['agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','ENUM','inbound','STRING','ringall','leastrecent','fewestcalls','linear','wrandom','rrordered','strategy','rrmemory','getDataValue','type','dialMethod','booked','roundrobin','INTEGER','yes','all','once','TEXT','join','periodic_announce','split','setDataValue','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','progressive','power','predictive','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x7c8f,0x14f));var _0xf7c8=function(_0x3e1e83,_0x3c0ca0){_0x3e1e83=_0x3e1e83-0x0;var _0x105d87=_0x7c8f[_0x3e1e83];return _0x105d87;};'use strict';var Sequelize=require(_0xf7c8('0x0'));module[_0xf7c8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xf7c8('0x2')](_0xf7c8('0x3'),'outbound'),'allowNull':![],'defaultValue':_0xf7c8('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0xf7c8('0x4')],'defaultValue':''},'strategy':{'type':Sequelize[_0xf7c8('0x2')]('rr',_0xf7c8('0x5'),_0xf7c8('0x6'),_0xf7c8('0x7'),'random','rrmemory',_0xf7c8('0x8'),_0xf7c8('0x9'),_0xf7c8('0xa')),'allowNull':![],'defaultValue':_0xf7c8('0x5'),'set':function(_0x2fe355){this['setDataValue'](_0xf7c8('0xb'),_0x2fe355?_0x2fe355:_0xf7c8('0xc'));},'get':function(){var _0x82dae6=this[_0xf7c8('0xd')](_0xf7c8('0xe'));var _0x55c0eb=this[_0xf7c8('0xd')](_0xf7c8('0xf'));var _0x1e9385=this[_0xf7c8('0xd')]('strategy');if(_0x82dae6===_0xf7c8('0x3')){return _0x1e9385;}if(_0x55c0eb===_0xf7c8('0x10')&&_0x1e9385===_0xf7c8('0xc')||_0x55c0eb===_0xf7c8('0x10')&&_0x1e9385===_0xf7c8('0x11')){return _0x1e9385;}if(_0x55c0eb==='progressive'||_0x55c0eb==='predictive'||_0x55c0eb==='power'){return _0x1e9385;}return null;}},'servicelevel':{'type':Sequelize[_0xf7c8('0x12')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xf7c8('0x4')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xf7c8('0x12')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xf7c8('0x12')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xf7c8('0x4')]},'weight':{'type':Sequelize[_0xf7c8('0x12')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xf7c8('0x12')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xf7c8('0x13'),'no'),'defaultValue':_0xf7c8('0x13')},'autopause':{'type':Sequelize[_0xf7c8('0x2')]('yes','no',_0xf7c8('0x14')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xf7c8('0x12')](0xb)},'autopausebusy':{'type':Sequelize[_0xf7c8('0x2')](_0xf7c8('0x13'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xf7c8('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xf7c8('0x2')](_0xf7c8('0x13'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xf7c8('0x2')](_0xf7c8('0x13'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xf7c8('0x2')](_0xf7c8('0x13'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xf7c8('0x13'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xf7c8('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xf7c8('0x12')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xf7c8('0x12')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xf7c8('0x12')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xf7c8('0x13'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xf7c8('0x2')]('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM'](_0xf7c8('0x13'),'no',_0xf7c8('0x15')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xf7c8('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xf7c8('0x2')](_0xf7c8('0x13'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xf7c8('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xf7c8('0x4')]},'queue_youarenext':{'type':Sequelize[_0xf7c8('0x4')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xf7c8('0x4')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xf7c8('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xf7c8('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xf7c8('0x4')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xf7c8('0x4')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xf7c8('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xf7c8('0x4')]},'queue_quantity1':{'type':Sequelize[_0xf7c8('0x4')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xf7c8('0x4')]},'queue_less_than':{'type':Sequelize[_0xf7c8('0x4')]},'periodic_announce':{'type':Sequelize[_0xf7c8('0x16')],'set':function(_0x4b0a0c){this['setDataValue']('periodic_announce',_0x4b0a0c?_0x4b0a0c[_0xf7c8('0x17')](','):[]);},'get':function(){return this[_0xf7c8('0xd')](_0xf7c8('0x18'))?this['getDataValue'](_0xf7c8('0x18'))[_0xf7c8('0x19')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xf7c8('0x13'),'set':function(_0x4ee5ca){this[_0xf7c8('0x1a')]('joinempty',_0x4ee5ca?_0x4ee5ca[_0xf7c8('0x17')](','):[]);},'get':function(){return this[_0xf7c8('0xd')]('joinempty')?this[_0xf7c8('0xd')]('joinempty')['split'](','):[];}},'leavewhenempty':{'type':Sequelize[_0xf7c8('0x4')],'defaultValue':'no','set':function(_0x52aa46){this[_0xf7c8('0x1a')](_0xf7c8('0x1b'),_0x52aa46?_0x52aa46[_0xf7c8('0x17')](','):[]);},'get':function(){return this['getDataValue'](_0xf7c8('0x1b'))?this[_0xf7c8('0xd')](_0xf7c8('0x1b'))['split'](','):[];}},'reportholdtime':{'type':Sequelize[_0xf7c8('0x2')](_0xf7c8('0x13'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xf7c8('0x2')](_0xf7c8('0x13'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xf7c8('0x12')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xf7c8('0x13'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xf7c8('0x4')]},'description':{'type':Sequelize[_0xf7c8('0x4')]},'acw':{'type':Sequelize[_0xf7c8('0x1c')],'defaultValue':0x0,'set':function(_0x2870c2){this[_0xf7c8('0x1a')](_0xf7c8('0x1d'),_0x2870c2);if(_0x2870c2){if(this['getDataValue'](_0xf7c8('0x1e'))<0x2){this[_0xf7c8('0x1a')](_0xf7c8('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xf7c8('0x12')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xf7c8('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xf7c8('0x2')](_0xf7c8('0x1f'),_0xf7c8('0x20'),_0xf7c8('0x21'),_0xf7c8('0x22'),'booked'),'defaultValue':_0xf7c8('0x20'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xf7c8('0x12')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf7c8('0x23')},'dialLimitQueue':{'type':Sequelize[_0xf7c8('0x12')](0x4)[_0xf7c8('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf7c8('0x25')},'dialPowerLevel':{'type':Sequelize[_0xf7c8('0x26')](0x2)[_0xf7c8('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xf7c8('0x27')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xf7c8('0x28'),'dropRate'),'defaultValue':_0xf7c8('0x29'),'comment':_0xf7c8('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xf7c8('0x26')](0x2)[_0xf7c8('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xf7c8('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0xf7c8('0x12')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xf7c8('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf7c8('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf7c8('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0xf7c8('0x12')](0x3)[_0xf7c8('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xf7c8('0x4')],'defaultValue':_0xf7c8('0x2d'),'comment':_0xf7c8('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0xf7c8('0x12')](0x3)[_0xf7c8('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf7c8('0x2f')},'dialQueueProject':{'type':Sequelize[_0xf7c8('0x4')],'comment':_0xf7c8('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf7c8('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf7c8('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf7c8('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf7c8('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0xf7c8('0x12')](0x3)[_0xf7c8('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xf7c8('0x12')](0x5)[_0xf7c8('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf7c8('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf7c8('0x12')](0x3)[_0xf7c8('0x24')],'defaultValue':0x3,'comment':_0xf7c8('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf7c8('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf7c8('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf7c8('0x12')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf7c8('0x36')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf7c8('0x4')],'defaultValue':_0xf7c8('0x37')},'dialPrefix':{'type':Sequelize[_0xf7c8('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0xf7c8('0x38'),_0xf7c8('0x39')),'defaultValue':_0xf7c8('0x3a')},'dialAMDActive':{'type':Sequelize[_0xf7c8('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xf7c8('0x12')](0x9)[_0xf7c8('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf7c8('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0xf7c8('0x12')](0x9)[_0xf7c8('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf7c8('0x12')](0x9)[_0xf7c8('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf7c8('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf7c8('0x12')](0x9)[_0xf7c8('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf7c8('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0xf7c8('0x12')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf7c8('0x12')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf7c8('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf7c8('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf7c8('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xf7c8('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf7c8('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0xf7c8('0x12')](0x5)[_0xf7c8('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xf7c8('0x42')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xf7c8('0x43')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf7c8('0x2')](_0xf7c8('0x44'),'ASC'),'defaultValue':_0xf7c8('0x44')},'dialQueueProject2':{'type':Sequelize[_0xf7c8('0x4')],'comment':_0xf7c8('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xf7c8('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xf7c8('0x1c')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf7c8('0x12')](0x3)[_0xf7c8('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf7c8('0x45')},'dialCutDigit':{'type':Sequelize[_0xf7c8('0x12')](0x3)[_0xf7c8('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf7c8('0x46')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf7c8('0x12')],'allowNull':!![],'comment':_0xf7c8('0x47')},'mandatoryDisposition':{'type':Sequelize[_0xf7c8('0x1c')],'defaultValue':![],'comment':_0xf7c8('0x48'),'set':function(_0x3202cf){if(!_0x3202cf)this[_0xf7c8('0x1a')](_0xf7c8('0x49'),null);this[_0xf7c8('0x1a')](_0xf7c8('0x4a'),_0x3202cf);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xf7c8('0x12')](0x3)[_0xf7c8('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xf7c8('0x24')],'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 36da22f..b1898e8 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 _0xfe9e=['where','pick','key','VIRTUAL','field','options','includeAll','catch','show','params','rawAttributes','include','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','QueueCampaigns','outbound','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','createdAt','role','UserProfileSection','findOne','CmHopper','VoiceQueueId','findAll','rows','getHopperHistories','CmHopperHistory','hasOwnProperty','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','Agents','penalty','transaction','each','findOrCreate','UserVoiceQueueRt','upsert','format','SIP/%s','forEach','emit','userVoiceQueue:save','ids','select','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','all','union','compact','sequelize','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isNil','isArray','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','VoiceQueueId\x20=\x20?','onlyIfOpen','insert','into','cm_contacts','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','count','offset','Content-Range','apply','save','then','get','VoiceQueues','filter','ignore','map','value','includes','type','UserProfileResource','destroy','error','name','VoiceQueue','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort'];(function(_0x48d01f,_0x27b58d){var _0x4a09d7=function(_0x3333a4){while(--_0x3333a4){_0x48d01f['push'](_0x48d01f['shift']());}};_0x4a09d7(++_0x27b58d);}(_0xfe9e,0x1d7));var _0xefe9=function(_0x3e4a0c,_0x49faa6){_0x3e4a0c=_0x3e4a0c-0x0;var _0x5dbebf=_0xfe9e[_0x3e4a0c];return _0x5dbebf;};'use strict';var pdf=require(_0xefe9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xefe9('0x1'));var zipdir=require(_0xefe9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xefe9('0x3'));var moment=require('moment');var BPromise=require(_0xefe9('0x4'));var Mustache=require(_0xefe9('0x5'));var util=require(_0xefe9('0x6'));var path=require('path');var sox=require(_0xefe9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xefe9('0x8'));var squel=require(_0xefe9('0x9'));var crypto=require(_0xefe9('0xa'));var jsforce=require(_0xefe9('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xefe9('0xc'));var Papa=require(_0xefe9('0xd'));var Redis=require('ioredis');var authService=require(_0xefe9('0xe'));var qs=require(_0xefe9('0xf'));var hardwareService=require(_0xefe9('0x10'));var logger=require(_0xefe9('0x11'))(_0xefe9('0x12'));var utils=require(_0xefe9('0x13'));var config=require('../../config/environment');var db=require(_0xefe9('0x14'))['db'];config[_0xefe9('0x15')]=_['defaults'](config['redis'],{'host':_0xefe9('0x16'),'port':0x18eb});var socket=require(_0xefe9('0x17'))(new Redis(config['redis']));require(_0xefe9('0x18'))[_0xefe9('0x19')](socket);function respondWithStatusCode(_0x14446e,_0x2f6d31){_0x2f6d31=_0x2f6d31||0xcc;return function(_0x3ca99f){if(_0x3ca99f){return _0x14446e[_0xefe9('0x1a')](_0x2f6d31);}return _0x14446e[_0xefe9('0x1b')](_0x2f6d31)['end']();};}function respondWithResult(_0x3a6969,_0x129c75){_0x129c75=_0x129c75||0xc8;return function(_0x5cefd7){if(_0x5cefd7){return _0x3a6969['status'](_0x129c75)[_0xefe9('0x1c')](_0x5cefd7);}};}function respondWithFilteredResult(_0x1f34d9,_0x3bff36){return function(_0x1e2418){if(_0x1e2418){var _0x5e7d56=_0x1e2418[_0xefe9('0x1d')],_0x23241c=_0x3bff36['offset'],_0x49ef95=_0x3bff36[_0xefe9('0x1e')]+_0x3bff36['limit'],_0x5ac726;if(_0x49ef95>=_0x5e7d56){_0x49ef95=_0x5e7d56;_0x5ac726=0xc8;}else{_0x5ac726=0xce;}_0x1f34d9[_0xefe9('0x1b')](_0x5ac726);return _0x1f34d9['set'](_0xefe9('0x1f'),_0x23241c+'-'+_0x49ef95+'/'+_0x5e7d56)[_0xefe9('0x1c')](_0x1e2418);}return null;};}function patchUpdates(_0x4ab366){return function(_0x2b88c6){try{jsonpatch[_0xefe9('0x20')](_0x2b88c6,_0x4ab366,!![]);}catch(_0x308624){return BPromise['reject'](_0x308624);}return _0x2b88c6[_0xefe9('0x21')]();};}function saveUpdates(_0x374411,_0x481453){return function(_0xb4cd25){if(_0xb4cd25){return _0xb4cd25['update'](_0x374411)[_0xefe9('0x22')](function(_0x227229){return _0x227229;});}return null;};}function removeEntity(_0x5cd712,_0x535819){return function(_0x45957c){if(_0x45957c){return _0x45957c['destroy']()['then'](function(){var _0x316c25=_0x45957c[_0xefe9('0x23')]({'plain':!![]});var _0x240e3f=[{'name':_0xefe9('0x24'),'value':'inbound','ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x26048a=_(_0x240e3f)[_0xefe9('0x25')](_0xefe9('0x26'))[_0xefe9('0x27')](_0xefe9('0x28'))[_0xefe9('0x28')]();if(_[_0xefe9('0x29')](_0x26048a,_0x316c25[_0xefe9('0x2a')])){return;}var _0x3389c0=_['find'](_0x240e3f,['value',_0x316c25['type']])['name'];return db[_0xefe9('0x2b')][_0xefe9('0x2c')]({'where':{'type':_0x3389c0,'resourceId':_0x316c25['id']}})[_0xefe9('0x22')](function(){return _0x45957c;});})[_0xefe9('0x22')](function(){_0x5cd712['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x145e9f,_0x5d973d){return function(_0x2b90f9){if(!_0x2b90f9){_0x145e9f['sendStatus'](0x194);}return _0x2b90f9;};}function handleError(_0x2a591b,_0x29ad73){_0x29ad73=_0x29ad73||0x1f4;return function(_0x4d112c){logger[_0xefe9('0x2d')](_0x4d112c['stack']);if(_0x4d112c['name']){delete _0x4d112c[_0xefe9('0x2e')];}_0x2a591b[_0xefe9('0x1b')](_0x29ad73)['send'](_0x4d112c);};}exports['index']=function(_0x2f48b2,_0x58c655){var _0x5e0835={},_0x185df5={},_0x319fc0={'count':0x0,'rows':[]};var _0x42575c=db[_0xefe9('0x2f')]['rawAttributes'];_0x185df5[_0xefe9('0x30')]=_['keys'](_0x42575c);_0x185df5[_0xefe9('0x31')]=_[_0xefe9('0x32')](_0x2f48b2['query']);_0x185df5[_0xefe9('0x33')]=_[_0xefe9('0x34')](_0x185df5['model'],_0x185df5[_0xefe9('0x31')]);_0x5e0835[_0xefe9('0x35')]=_['intersection'](_0x185df5['model'],qs[_0xefe9('0x36')](_0x2f48b2[_0xefe9('0x31')][_0xefe9('0x36')]));_0x5e0835[_0xefe9('0x35')]=_0x5e0835['attributes'][_0xefe9('0x37')]?_0x5e0835[_0xefe9('0x35')]:_0x185df5[_0xefe9('0x30')];if(!_0x2f48b2[_0xefe9('0x31')]['hasOwnProperty'](_0xefe9('0x38'))){_0x5e0835[_0xefe9('0x39')]=qs[_0xefe9('0x39')](_0x2f48b2[_0xefe9('0x31')]['limit']);_0x5e0835[_0xefe9('0x1e')]=qs[_0xefe9('0x1e')](_0x2f48b2[_0xefe9('0x31')]['offset']);}_0x5e0835[_0xefe9('0x3a')]=qs['sort'](_0x2f48b2[_0xefe9('0x31')][_0xefe9('0x3b')]);_0x5e0835[_0xefe9('0x3c')]=qs[_0xefe9('0x33')](_[_0xefe9('0x3d')](_0x2f48b2[_0xefe9('0x31')],_0x185df5[_0xefe9('0x33')]));if(_0x2f48b2['query'][_0xefe9('0x25')]){_0x5e0835[_0xefe9('0x3c')]=_['merge'](_0x5e0835[_0xefe9('0x3c')],{'$or':_[_0xefe9('0x27')](_0x42575c,function(_0x16b3db){if(_0x16b3db[_0xefe9('0x2a')][_0xefe9('0x3e')]!==_0xefe9('0x3f')){var _0x3d9cb0={};_0x3d9cb0[_0x16b3db[_0xefe9('0x40')]]={'$like':'%'+_0x2f48b2[_0xefe9('0x31')][_0xefe9('0x25')]+'%'};return _0x3d9cb0;}})});}_0x5e0835=_['merge']({},_0x5e0835,_0x2f48b2[_0xefe9('0x41')]);var _0x5989b0={'where':_0x5e0835['where']};return db[_0xefe9('0x2f')][_0xefe9('0x1d')](_0x5989b0)[_0xefe9('0x22')](function(_0xff0d4c){_0x319fc0[_0xefe9('0x1d')]=_0xff0d4c;if(_0x2f48b2[_0xefe9('0x31')][_0xefe9('0x42')]){_0x5e0835['include']=[{'all':!![]}];}return db[_0xefe9('0x2f')]['findAll'](_0x5e0835);})[_0xefe9('0x22')](function(_0x49955e){_0x319fc0['rows']=_0x49955e;return _0x319fc0;})[_0xefe9('0x22')](respondWithFilteredResult(_0x58c655,_0x5e0835))[_0xefe9('0x43')](handleError(_0x58c655,null));};exports[_0xefe9('0x44')]=function(_0x2e43fb,_0x5d2661){var _0x4fdca2={'raw':![],'where':{'id':_0x2e43fb[_0xefe9('0x45')]['id']}},_0x80799c={};_0x80799c[_0xefe9('0x30')]=_[_0xefe9('0x32')](db['VoiceQueue'][_0xefe9('0x46')]);_0x80799c[_0xefe9('0x31')]=_[_0xefe9('0x32')](_0x2e43fb[_0xefe9('0x31')]);_0x80799c[_0xefe9('0x33')]=_[_0xefe9('0x34')](_0x80799c[_0xefe9('0x30')],_0x80799c[_0xefe9('0x31')]);_0x4fdca2[_0xefe9('0x35')]=_['intersection'](_0x80799c['model'],qs[_0xefe9('0x36')](_0x2e43fb[_0xefe9('0x31')][_0xefe9('0x36')]));_0x4fdca2[_0xefe9('0x35')]=_0x4fdca2[_0xefe9('0x35')]['length']?_0x4fdca2[_0xefe9('0x35')]:_0x80799c[_0xefe9('0x30')];if(_0x2e43fb['query'][_0xefe9('0x42')]){_0x4fdca2[_0xefe9('0x47')]=[{'all':!![]}];}_0x4fdca2=_[_0xefe9('0x48')]({},_0x4fdca2,_0x2e43fb[_0xefe9('0x41')]);return db[_0xefe9('0x2f')]['find'](_0x4fdca2)[_0xefe9('0x22')](handleEntityNotFound(_0x5d2661,null))[_0xefe9('0x22')](respondWithResult(_0x5d2661,null))[_0xefe9('0x43')](handleError(_0x5d2661,null));};exports[_0xefe9('0x49')]=function(_0x3252d3,_0x2c4b16){return db[_0xefe9('0x2f')][_0xefe9('0x49')](_0x3252d3[_0xefe9('0x4a')],{})['then'](function(_0x3c5706){var _0x3a989f=_0x3252d3[_0xefe9('0x4b')][_0xefe9('0x23')]({'plain':!![]});if(!_0x3a989f)throw new Error(_0xefe9('0x4c'));if(_0x3a989f['role']===_0xefe9('0x4b')){var _0x5cab6b=_0x3c5706[_0xefe9('0x23')]({'plain':!![]});var _0x290980=[{'name':_0xefe9('0x24'),'value':_0xefe9('0x4d')},{'name':_0xefe9('0x4e'),'value':_0xefe9('0x4f')}];var _0x257c6b=_[_0xefe9('0x50')](_0x290980,[_0xefe9('0x28'),_0x5cab6b['type']])[_0xefe9('0x2e')];return db['UserProfileSection'][_0xefe9('0x50')]({'where':{'name':_0x257c6b,'userProfileId':_0x3a989f[_0xefe9('0x51')]},'raw':!![]})['then'](function(_0x286756){if(_0x286756&&_0x286756[_0xefe9('0x52')]===0x0){return db[_0xefe9('0x2b')][_0xefe9('0x49')]({'name':_0x5cab6b[_0xefe9('0x2e')],'resourceId':_0x5cab6b['id'],'type':_0x286756[_0xefe9('0x2e')],'sectionId':_0x286756['id']},{})[_0xefe9('0x22')](function(){return _0x3c5706;});}else{return _0x3c5706;}})['catch'](function(_0x305288){logger[_0xefe9('0x2d')](_0xefe9('0x53'),_0x305288);throw _0x305288;});}return _0x3c5706;})[_0xefe9('0x22')](respondWithResult(_0x2c4b16,0xc9))[_0xefe9('0x43')](handleError(_0x2c4b16,null));};exports[_0xefe9('0x54')]=function(_0x5d3159,_0x24c98e){var _0x505aff={'raw':![],'where':{'id':_0x5d3159[_0xefe9('0x45')]['id']}},_0x368fea={};_0x368fea[_0xefe9('0x30')]=_[_0xefe9('0x32')](db[_0xefe9('0x2f')][_0xefe9('0x46')]);_0x505aff['attributes']=_[_0xefe9('0x34')](_0x368fea[_0xefe9('0x30')],qs[_0xefe9('0x36')](_0x5d3159[_0xefe9('0x31')]['fields']));_0x505aff[_0xefe9('0x35')]=_0x505aff['attributes'][_0xefe9('0x37')]?_0x505aff['attributes']:_0x368fea[_0xefe9('0x30')];if(_0x5d3159[_0xefe9('0x31')][_0xefe9('0x42')]){_0x505aff[_0xefe9('0x47')]=[{'all':!![]}];}_0x505aff=_[_0xefe9('0x48')]({},_0x505aff,_0x5d3159[_0xefe9('0x41')]);return db['VoiceQueue'][_0xefe9('0x50')](_0x505aff)[_0xefe9('0x22')](handleEntityNotFound(_0x24c98e,null))[_0xefe9('0x22')](function(_0x59a08e){if(_0x59a08e){var _0x474429=_0x59a08e['get']({'plain':!![]});_0x474429=qs['omit'](_0x474429,['id','createdAt',_0xefe9('0x55')]);_0x5d3159[_0xefe9('0x4a')]=_[_0xefe9('0x56')](_0x5d3159['body'],['id',_0xefe9('0x57'),_0xefe9('0x55')]);return db[_0xefe9('0x2f')][_0xefe9('0x49')](_[_0xefe9('0x48')](_0x474429,_0x5d3159[_0xefe9('0x4a')]),{'include':_0x5d3159[_0xefe9('0x31')][_0xefe9('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x5b2d22){var _0x111210=_0x5d3159['user'][_0xefe9('0x23')]({'plain':!![]});if(!_0x111210)throw new Error(_0xefe9('0x4c'));if(_0x111210[_0xefe9('0x58')]===_0xefe9('0x4b')){var _0x7985d9=_0x5b2d22[_0xefe9('0x23')]({'plain':!![]});var _0x3cf9b2=[{'name':_0xefe9('0x24'),'value':'inbound'},{'name':_0xefe9('0x4e'),'value':_0xefe9('0x4f')}];var _0x3eb0a1=_[_0xefe9('0x50')](_0x3cf9b2,['value',_0x7985d9[_0xefe9('0x2a')]])[_0xefe9('0x2e')];return db[_0xefe9('0x59')][_0xefe9('0x50')]({'where':{'name':_0x3eb0a1,'userProfileId':_0x111210[_0xefe9('0x51')]},'raw':!![]})[_0xefe9('0x22')](function(_0x3e286a){if(_0x3e286a&&_0x3e286a['autoAssociation']===0x0){return db[_0xefe9('0x2b')][_0xefe9('0x49')]({'name':_0x7985d9[_0xefe9('0x2e')],'resourceId':_0x7985d9['id'],'type':_0x3e286a['name'],'sectionId':_0x3e286a['id']},{})[_0xefe9('0x22')](function(){return _0x5b2d22;});}else{return _0x5b2d22;}})[_0xefe9('0x43')](function(_0x13338d){logger[_0xefe9('0x2d')](_0xefe9('0x53'),_0x13338d);throw _0x13338d;});}return _0x5b2d22;});}})[_0xefe9('0x22')](respondWithResult(_0x24c98e,0xc9))[_0xefe9('0x43')](handleError(_0x24c98e,null));};exports['update']=function(_0x488db1,_0x4f2176){if(_0x488db1[_0xefe9('0x4a')]['id']){delete _0x488db1[_0xefe9('0x4a')]['id'];}return db[_0xefe9('0x2f')][_0xefe9('0x50')]({'where':{'id':_0x488db1['params']['id']}})[_0xefe9('0x22')](handleEntityNotFound(_0x4f2176,null))[_0xefe9('0x22')](saveUpdates(_0x488db1[_0xefe9('0x4a')],null))[_0xefe9('0x22')](respondWithResult(_0x4f2176,null))['catch'](handleError(_0x4f2176,null));};exports[_0xefe9('0x2c')]=function(_0x4a5381,_0x499013){return db[_0xefe9('0x2f')][_0xefe9('0x50')]({'where':{'id':_0x4a5381[_0xefe9('0x45')]['id']}})[_0xefe9('0x22')](handleEntityNotFound(_0x499013,null))[_0xefe9('0x22')](removeEntity(_0x499013,null))[_0xefe9('0x43')](handleError(_0x499013,null));};exports['getHoppers']=function(_0x567b81,_0x25b3f4,_0x4b7749){var _0x2bc966={'raw':![],'where':{}};var _0xfccf1b={};var _0x116afd={'count':0x0,'rows':[]};return db[_0xefe9('0x2f')][_0xefe9('0x5a')]({'where':{'id':_0x567b81[_0xefe9('0x45')]['id']}})['then'](handleEntityNotFound(_0x25b3f4,null))[_0xefe9('0x22')](function(_0x1be11d){if(_0x1be11d){_0xfccf1b[_0xefe9('0x30')]=_['keys'](db[_0xefe9('0x5b')]['rawAttributes']);_0xfccf1b[_0xefe9('0x31')]=_['keys'](_0x567b81[_0xefe9('0x31')]);_0xfccf1b[_0xefe9('0x33')]=_['intersection'](_0xfccf1b[_0xefe9('0x30')],_0xfccf1b[_0xefe9('0x31')]);_0x2bc966[_0xefe9('0x35')]=_[_0xefe9('0x34')](_0xfccf1b['model'],qs[_0xefe9('0x36')](_0x567b81['query']['fields']));_0x2bc966[_0xefe9('0x35')]=_0x2bc966['attributes'][_0xefe9('0x37')]?_0x2bc966['attributes']:_0xfccf1b['model'];if(!_0x567b81[_0xefe9('0x31')]['hasOwnProperty'](_0xefe9('0x38'))){_0x2bc966[_0xefe9('0x39')]=qs[_0xefe9('0x39')](_0x567b81[_0xefe9('0x31')]['limit']);_0x2bc966[_0xefe9('0x1e')]=qs[_0xefe9('0x1e')](_0x567b81[_0xefe9('0x31')][_0xefe9('0x1e')]);}_0x2bc966[_0xefe9('0x3a')]=qs['sort'](_0x567b81[_0xefe9('0x31')][_0xefe9('0x3b')]);_0x2bc966['where']=qs[_0xefe9('0x33')](_[_0xefe9('0x3d')](_0x567b81[_0xefe9('0x31')],_0xfccf1b[_0xefe9('0x33')]));_0x2bc966[_0xefe9('0x3c')][_0xefe9('0x5c')]=_0x1be11d['id'];if(_0x567b81[_0xefe9('0x31')][_0xefe9('0x25')]){_0x2bc966[_0xefe9('0x3c')]=_['merge'](_0x2bc966[_0xefe9('0x3c')],{'$or':_[_0xefe9('0x27')](_0x2bc966[_0xefe9('0x35')],function(_0x531186){var _0x594045={};_0x594045[_0x531186]={'$like':'%'+_0x567b81[_0xefe9('0x31')][_0xefe9('0x25')]+'%'};return _0x594045;})});}_0x2bc966=_[_0xefe9('0x48')]({},_0x2bc966,_0x567b81[_0xefe9('0x41')]);return db['CmHopper'][_0xefe9('0x1d')]({'where':_0x2bc966[_0xefe9('0x3c')]})[_0xefe9('0x22')](function(_0x205f33){_0x116afd[_0xefe9('0x1d')]=_0x205f33;if(_0x567b81['query']['includeAll']){_0x2bc966[_0xefe9('0x47')]=[{'all':!![]}];}return db[_0xefe9('0x5b')][_0xefe9('0x5d')](_0x2bc966);})[_0xefe9('0x22')](function(_0x5d73e0){_0x116afd[_0xefe9('0x5e')]=_0x5d73e0;return _0x116afd;});}})[_0xefe9('0x22')](respondWithFilteredResult(_0x25b3f4,_0x2bc966))[_0xefe9('0x43')](handleError(_0x25b3f4,null));};exports[_0xefe9('0x5f')]=function(_0x133e3b,_0x5f5081,_0x4f026c){var _0x354b37={'raw':!![],'where':{}};var _0x882720={};var _0x5b9aea={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xefe9('0x5a')]({'where':{'id':_0x133e3b[_0xefe9('0x45')]['id']}})['then'](handleEntityNotFound(_0x5f5081,null))[_0xefe9('0x22')](function(_0x118740){if(_0x118740){_0x882720[_0xefe9('0x30')]=_[_0xefe9('0x32')](db[_0xefe9('0x60')][_0xefe9('0x46')]);_0x882720[_0xefe9('0x31')]=_[_0xefe9('0x32')](_0x133e3b[_0xefe9('0x31')]);_0x882720[_0xefe9('0x33')]=_['intersection'](_0x882720[_0xefe9('0x30')],_0x882720[_0xefe9('0x31')]);_0x354b37['attributes']=_[_0xefe9('0x34')](_0x882720['model'],qs[_0xefe9('0x36')](_0x133e3b[_0xefe9('0x31')][_0xefe9('0x36')]));_0x354b37['attributes']=_0x354b37[_0xefe9('0x35')][_0xefe9('0x37')]?_0x354b37['attributes']:_0x882720[_0xefe9('0x30')];if(!_0x133e3b[_0xefe9('0x31')][_0xefe9('0x61')](_0xefe9('0x38'))){_0x354b37[_0xefe9('0x39')]=qs[_0xefe9('0x39')](_0x133e3b[_0xefe9('0x31')][_0xefe9('0x39')]);_0x354b37[_0xefe9('0x1e')]=qs[_0xefe9('0x1e')](_0x133e3b[_0xefe9('0x31')]['offset']);}_0x354b37[_0xefe9('0x3a')]=qs['sort'](_0x133e3b[_0xefe9('0x31')]['sort']);_0x354b37[_0xefe9('0x3c')]=qs[_0xefe9('0x33')](_[_0xefe9('0x3d')](_0x133e3b[_0xefe9('0x31')],_0x882720[_0xefe9('0x33')]));_0x354b37[_0xefe9('0x3c')][_0xefe9('0x5c')]=_0x118740['id'];if(_0x133e3b['query']['filter']){_0x354b37[_0xefe9('0x3c')]=_['merge'](_0x354b37[_0xefe9('0x3c')],{'$or':_[_0xefe9('0x27')](_0x354b37[_0xefe9('0x35')],function(_0x30827b){var _0x3f0976={};_0x3f0976[_0x30827b]={'$like':'%'+_0x133e3b['query'][_0xefe9('0x25')]+'%'};return _0x3f0976;})});}_0x354b37=_[_0xefe9('0x48')]({},_0x354b37,_0x133e3b[_0xefe9('0x41')]);return db[_0xefe9('0x60')][_0xefe9('0x1d')]({'where':_0x354b37[_0xefe9('0x3c')]})[_0xefe9('0x22')](function(_0x1c5651){_0x5b9aea[_0xefe9('0x1d')]=_0x1c5651;if(_0x133e3b['query']['includeAll']){_0x354b37[_0xefe9('0x47')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xefe9('0x5d')](_0x354b37);})[_0xefe9('0x22')](function(_0x57f32e){_0x5b9aea[_0xefe9('0x5e')]=_0x57f32e;return _0x5b9aea;});}})[_0xefe9('0x22')](respondWithFilteredResult(_0x5f5081,_0x354b37))['catch'](handleError(_0x5f5081,null));};exports['getHopperFinals']=function(_0x59ad67,_0x3d3e02,_0x2d0702){var _0x7f762f={'raw':!![],'where':{}};var _0x2bad8f={};var _0x21e9d5={'count':0x0,'rows':[]};return db[_0xefe9('0x2f')][_0xefe9('0x5a')]({'where':{'id':_0x59ad67['params']['id']}})[_0xefe9('0x22')](handleEntityNotFound(_0x3d3e02,null))['then'](function(_0xcaddfc){if(_0xcaddfc){_0x2bad8f[_0xefe9('0x30')]=_[_0xefe9('0x32')](db[_0xefe9('0x62')][_0xefe9('0x46')]);_0x2bad8f[_0xefe9('0x31')]=_[_0xefe9('0x32')](_0x59ad67[_0xefe9('0x31')]);_0x2bad8f[_0xefe9('0x33')]=_['intersection'](_0x2bad8f[_0xefe9('0x30')],_0x2bad8f[_0xefe9('0x31')]);_0x7f762f[_0xefe9('0x35')]=_['intersection'](_0x2bad8f[_0xefe9('0x30')],qs['fields'](_0x59ad67[_0xefe9('0x31')]['fields']));_0x7f762f['attributes']=_0x7f762f['attributes'][_0xefe9('0x37')]?_0x7f762f[_0xefe9('0x35')]:_0x2bad8f[_0xefe9('0x30')];if(!_0x59ad67[_0xefe9('0x31')][_0xefe9('0x61')](_0xefe9('0x38'))){_0x7f762f['limit']=qs[_0xefe9('0x39')](_0x59ad67['query']['limit']);_0x7f762f['offset']=qs[_0xefe9('0x1e')](_0x59ad67[_0xefe9('0x31')][_0xefe9('0x1e')]);}_0x7f762f[_0xefe9('0x3a')]=qs[_0xefe9('0x3b')](_0x59ad67[_0xefe9('0x31')]['sort']);_0x7f762f[_0xefe9('0x3c')]=qs['filters'](_[_0xefe9('0x3d')](_0x59ad67['query'],_0x2bad8f['filters']));_0x7f762f['where']['VoiceQueueId']=_0xcaddfc['id'];if(_0x59ad67['query'][_0xefe9('0x25')]){_0x7f762f['where']=_[_0xefe9('0x48')](_0x7f762f[_0xefe9('0x3c')],{'$or':_[_0xefe9('0x27')](_0x7f762f[_0xefe9('0x35')],function(_0x1d8819){var _0x32a2d2={};_0x32a2d2[_0x1d8819]={'$like':'%'+_0x59ad67[_0xefe9('0x31')][_0xefe9('0x25')]+'%'};return _0x32a2d2;})});}_0x7f762f=_[_0xefe9('0x48')]({},_0x7f762f,_0x59ad67['options']);return db[_0xefe9('0x62')][_0xefe9('0x1d')]({'where':_0x7f762f['where']})[_0xefe9('0x22')](function(_0x427602){_0x21e9d5['count']=_0x427602;if(_0x59ad67[_0xefe9('0x31')][_0xefe9('0x42')]){_0x7f762f['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xefe9('0x5d')](_0x7f762f);})[_0xefe9('0x22')](function(_0xcfefcf){_0x21e9d5['rows']=_0xcfefcf;return _0x21e9d5;});}})[_0xefe9('0x22')](respondWithFilteredResult(_0x3d3e02,_0x7f762f))[_0xefe9('0x43')](handleError(_0x3d3e02,null));};exports['getHopperBlacks']=function(_0x3d714d,_0x4b2a2d,_0x31faea){var _0x440223={'raw':!![],'where':{}};var _0x4ad775={};var _0x547e6a={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x3d714d[_0xefe9('0x45')]['id']}})[_0xefe9('0x22')](handleEntityNotFound(_0x4b2a2d,null))[_0xefe9('0x22')](function(_0x5b6428){if(_0x5b6428){_0x4ad775[_0xefe9('0x30')]=_[_0xefe9('0x32')](db[_0xefe9('0x63')]['rawAttributes']);_0x4ad775[_0xefe9('0x31')]=_[_0xefe9('0x32')](_0x3d714d['query']);_0x4ad775[_0xefe9('0x33')]=_[_0xefe9('0x34')](_0x4ad775['model'],_0x4ad775[_0xefe9('0x31')]);_0x440223['attributes']=_['intersection'](_0x4ad775[_0xefe9('0x30')],qs['fields'](_0x3d714d[_0xefe9('0x31')][_0xefe9('0x36')]));_0x440223['attributes']=_0x440223[_0xefe9('0x35')][_0xefe9('0x37')]?_0x440223[_0xefe9('0x35')]:_0x4ad775['model'];if(!_0x3d714d[_0xefe9('0x31')][_0xefe9('0x61')](_0xefe9('0x38'))){_0x440223['limit']=qs['limit'](_0x3d714d[_0xefe9('0x31')]['limit']);_0x440223['offset']=qs[_0xefe9('0x1e')](_0x3d714d['query']['offset']);}_0x440223[_0xefe9('0x3a')]=qs[_0xefe9('0x3b')](_0x3d714d[_0xefe9('0x31')]['sort']);_0x440223[_0xefe9('0x3c')]=qs['filters'](_[_0xefe9('0x3d')](_0x3d714d[_0xefe9('0x31')],_0x4ad775[_0xefe9('0x33')]));_0x440223[_0xefe9('0x3c')][_0xefe9('0x5c')]=_0x5b6428['id'];if(_0x3d714d['query'][_0xefe9('0x25')]){_0x440223[_0xefe9('0x3c')]=_[_0xefe9('0x48')](_0x440223[_0xefe9('0x3c')],{'$or':_[_0xefe9('0x27')](_0x440223['attributes'],function(_0x57d091){var _0x544c15={};_0x544c15[_0x57d091]={'$like':'%'+_0x3d714d[_0xefe9('0x31')]['filter']+'%'};return _0x544c15;})});}_0x440223=_['merge']({},_0x440223,_0x3d714d[_0xefe9('0x41')]);return db[_0xefe9('0x63')][_0xefe9('0x1d')]({'where':_0x440223[_0xefe9('0x3c')]})[_0xefe9('0x22')](function(_0x154229){_0x547e6a[_0xefe9('0x1d')]=_0x154229;if(_0x3d714d[_0xefe9('0x31')][_0xefe9('0x42')]){_0x440223[_0xefe9('0x47')]=[{'all':!![]}];}return db[_0xefe9('0x63')]['findAll'](_0x440223);})['then'](function(_0x258e60){_0x547e6a[_0xefe9('0x5e')]=_0x258e60;return _0x547e6a;});}})[_0xefe9('0x22')](respondWithFilteredResult(_0x4b2a2d,_0x440223))[_0xefe9('0x43')](handleError(_0x4b2a2d,null));};exports[_0xefe9('0x64')]=function(_0x4a8000,_0x19469a,_0x445dc6){var _0x21b634={};var _0x21789f={};var _0x4e012c;var _0x439982;return db[_0xefe9('0x2f')][_0xefe9('0x5a')]({'where':{'id':_0x4a8000[_0xefe9('0x45')]['id']}})['then'](handleEntityNotFound(_0x19469a,null))[_0xefe9('0x22')](function(_0x46d872){if(_0x46d872){_0x4e012c=_0x46d872;_0x21789f[_0xefe9('0x30')]=_[_0xefe9('0x32')](db[_0xefe9('0x65')]['rawAttributes']);_0x21789f['query']=_[_0xefe9('0x32')](_0x4a8000[_0xefe9('0x31')]);_0x21789f[_0xefe9('0x33')]=_['intersection'](_0x21789f[_0xefe9('0x30')],_0x21789f[_0xefe9('0x31')]);_0x21b634[_0xefe9('0x35')]=_[_0xefe9('0x34')](_0x21789f[_0xefe9('0x30')],qs[_0xefe9('0x36')](_0x4a8000[_0xefe9('0x31')][_0xefe9('0x36')]));_0x21b634[_0xefe9('0x35')]=_0x21b634['attributes'][_0xefe9('0x37')]?_0x21b634[_0xefe9('0x35')]:_0x21789f['model'];_0x21b634[_0xefe9('0x3a')]=qs[_0xefe9('0x3b')](_0x4a8000[_0xefe9('0x31')][_0xefe9('0x3b')]);_0x21b634[_0xefe9('0x3c')]=qs['filters'](_[_0xefe9('0x3d')](_0x4a8000[_0xefe9('0x31')],_0x21789f[_0xefe9('0x33')]));if(_0x4a8000[_0xefe9('0x31')]['filter']){_0x21b634[_0xefe9('0x3c')]=_[_0xefe9('0x48')](_0x21b634['where'],{'$or':_[_0xefe9('0x27')](_0x21b634[_0xefe9('0x35')],function(_0x3e6752){var _0x58cc89={};_0x58cc89[_0x3e6752]={'$like':'%'+_0x4a8000[_0xefe9('0x31')][_0xefe9('0x25')]+'%'};return _0x58cc89;})});}_0x21b634=_[_0xefe9('0x48')]({},_0x21b634,_0x4a8000[_0xefe9('0x41')]);return _0x4e012c[_0xefe9('0x64')](_0x21b634);}})['then'](function(_0x3ca3b9){if(_0x3ca3b9){_0x439982=_0x3ca3b9['length'];if(!_0x4a8000['query']['hasOwnProperty']('nolimit')){_0x21b634[_0xefe9('0x39')]=qs[_0xefe9('0x39')](_0x4a8000[_0xefe9('0x31')][_0xefe9('0x39')]);_0x21b634[_0xefe9('0x1e')]=qs[_0xefe9('0x1e')](_0x4a8000[_0xefe9('0x31')][_0xefe9('0x1e')]);}return _0x4e012c['getTeams'](_0x21b634);}})['then'](function(_0x517987){if(_0x517987){return _0x517987?{'count':_0x439982,'rows':_0x517987}:null;}})[_0xefe9('0x22')](respondWithResult(_0x19469a,null))['catch'](handleError(_0x19469a,null));};exports[_0xefe9('0x66')]=function(_0x4c39f8,_0x15252d,_0x474d48){var _0x44cf19=_0x4c39f8['body'][_0xefe9('0x67')];return db[_0xefe9('0x65')]['findAll']({'where':{'id':_[_0xefe9('0x27')](_0x44cf19,'id')},'attributes':['id'],'include':[{'model':db[_0xefe9('0x68')],'as':'Agents','attributes':['id',_0xefe9('0x2e'),_0xefe9('0x69'),_0xefe9('0x6a'),_0xefe9('0x6b')],'raw':!![]}]})[_0xefe9('0x22')](function(_0x50d0d1){if(_0x50d0d1){var _0x338a01=_[_0xefe9('0x6c')](_0x50d0d1,function(_0x551b2f){var _0x3108c3=_0x551b2f[_0xefe9('0x23')]({'plain':!![]});_0x3108c3[_0xefe9('0x6d')]['forEach'](function(_0x35acd5){_0x35acd5[_0xefe9('0x6e')]=_[_0xefe9('0x50')](_0x44cf19,{'id':_0x3108c3['id']})['penalty'];});return _0x3108c3[_0xefe9('0x6d')];});return db[_0xefe9('0x2f')][_0xefe9('0x50')]({'where':{'id':_0x4c39f8['params']['id']}})[_0xefe9('0x22')](function(_0x15e8e2){return db['sequelize'][_0xefe9('0x6f')](function(_0x4656f7){return _0x15e8e2[_0xefe9('0x66')](_[_0xefe9('0x27')](_0x44cf19,'id'),{'transaction':_0x4656f7})[_0xefe9('0x22')](function(){return BPromise[_0xefe9('0x70')](_0x338a01,function(_0x9dcca){return db['UserVoiceQueue'][_0xefe9('0x71')]({'where':{'UserId':_0x9dcca['id'],'VoiceQueueId':_0x4c39f8[_0xefe9('0x45')]['id']},'defaults':{'penalty':_0x9dcca[_0xefe9('0x6e')]},'transaction':_0x4656f7});});})[_0xefe9('0x22')](function(){return BPromise[_0xefe9('0x70')](_[_0xefe9('0x25')](_0x338a01,{'online':!![]}),function(_0x31cf02){return db[_0xefe9('0x72')][_0xefe9('0x73')]({'membername':_0x31cf02['name'],'UserId':_0x31cf02['id'],'queue_name':_0x15e8e2[_0xefe9('0x2e')],'VoiceQueueId':_0x15e8e2['id'],'interface':_['isNil'](_0x31cf02[_0xefe9('0x6b')])?util[_0xefe9('0x74')](_0xefe9('0x75'),_0x31cf02[_0xefe9('0x2e')]):_0x31cf02['interface'],'paused':_0x31cf02[_0xefe9('0x6a')]||![],'penalty':_0x31cf02[_0xefe9('0x6e')]},{'transaction':_0x4656f7});});})[_0xefe9('0x22')](function(){_0x338a01[_0xefe9('0x76')](function(_0x13035e){socket[_0xefe9('0x77')](_0xefe9('0x78'),{'UserId':_0x13035e['id'],'VoiceQueueId':_0x15e8e2['id']});});});});});}})[_0xefe9('0x22')](respondWithStatusCode(_0x15252d,null))['catch'](handleError(_0x15252d,null));};exports['removeTeams']=function(_0x23ec8c,_0x2d53a6,_0x58a9ac){return db['Team'][_0xefe9('0x5d')]({'where':{'id':_0x23ec8c['query'][_0xefe9('0x79')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xefe9('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xefe9('0x22')](handleEntityNotFound(_0x2d53a6,null))[_0xefe9('0x22')](function(_0xe47b52){var _0x2b6ef7=_[_0xefe9('0x27')](_0xe47b52,'id');var _0x329c70=[];var _0x121fde=[];var _0x2835b4=squel[_0xefe9('0x7a')]();_0x2835b4[_0xefe9('0x40')](_0xefe9('0x7b'))[_0xefe9('0x7c')](_0xefe9('0x7d'),'tq')[_0xefe9('0x7e')](_0xefe9('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xefe9('0x3c')]('VoiceQueueId\x20=\x20?',_0x23ec8c['params']['id']);for(var _0x40d18b=0x0;_0x40d18b<_0xe47b52[_0xefe9('0x37')];_0x40d18b+=0x1){let _0x1d1d33=_0xe47b52[_0x40d18b];for(var _0xef1bb0=0x0;_0xef1bb0<_0x1d1d33['Agents']['length'];_0xef1bb0+=0x1){let _0x1146bd=_0x1d1d33[_0xefe9('0x6d')][_0xef1bb0];var _0x571b89=_0x2835b4[_0xefe9('0x54')]();_0x571b89[_0xefe9('0x3c')](_0xefe9('0x80'),_0x1146bd['id']);_0x121fde[_0xefe9('0x81')](db['sequelize'][_0xefe9('0x31')](_0x571b89[_0xefe9('0x82')](),{'type':db['sequelize'][_0xefe9('0x83')][_0xefe9('0x84')]})[_0xefe9('0x22')](function(_0x593242){if(_0x593242['length']===0x1){return _0x1146bd['id'];}else{var _0x2a0d59=_['every'](_['map'](_0x593242,'TeamId'),function(_0x4315c2){return _['includes'](_0x2b6ef7,_0x4315c2);});if(_0x2a0d59){return _0x1146bd['id'];}}}));}}return BPromise[_0xefe9('0x85')](_0x121fde)[_0xefe9('0x22')](function(_0x52a2d2){_0x329c70=_(_0x329c70)[_0xefe9('0x86')](_0x52a2d2)[_0xefe9('0x87')]()[_0xefe9('0x28')]();return db[_0xefe9('0x2f')]['find']({'where':{'id':_0x23ec8c['params']['id']}})[_0xefe9('0x22')](function(_0x437440){return db[_0xefe9('0x88')]['transaction'](function(_0x3e0311){return _0x437440[_0xefe9('0x89')](_0x23ec8c[_0xefe9('0x31')][_0xefe9('0x79')],{'transaction':_0x3e0311})[_0xefe9('0x22')](function(){if(!_[_0xefe9('0x8a')](_0x329c70)){return _0x437440[_0xefe9('0x8b')](_0x329c70,{'transaction':_0x3e0311})['then'](function(){return db[_0xefe9('0x72')]['destroy']({'where':{'VoiceQueueId':_0x23ec8c[_0xefe9('0x45')]['id'],'UserId':_0x329c70},'transaction':_0x3e0311});});}})[_0xefe9('0x22')](function(){_0x329c70['forEach'](function(_0x3317d8){socket[_0xefe9('0x77')](_0xefe9('0x8c'),{'UserId':_0x3317d8,'VoiceQueueId':_0x437440['id']});});});});});});})[_0xefe9('0x22')](respondWithStatusCode(_0x2d53a6,null))[_0xefe9('0x43')](handleError(_0x2d53a6,null));};exports[_0xefe9('0x8d')]=function(_0xd79912,_0x1d17f3,_0x262dfb){var _0x4769c9,_0x1c7067;return db[_0xefe9('0x2f')][_0xefe9('0x50')]({'where':{'id':_0xd79912['params']['id']}})[_0xefe9('0x22')](handleEntityNotFound(_0x1d17f3,null))[_0xefe9('0x22')](function(_0x480cc1){if(_0x480cc1){_0x1c7067=_0x480cc1;return _0x480cc1[_0xefe9('0x8d')](_0xd79912['body']['ids'],_[_0xefe9('0x56')](_0xd79912['body'],[_0xefe9('0x79'),'id'])||{})[_0xefe9('0x8e')](function(_0x2416e5){for(var _0x380ae6=0x0;_0x380ae6<_0xd79912[_0xefe9('0x4a')][_0xefe9('0x79')][_0xefe9('0x37')];_0x380ae6+=0x1){socket['emit'](_0xefe9('0x78'),{'UserId':_0xd79912[_0xefe9('0x4a')][_0xefe9('0x79')][_0x380ae6],'VoiceQueueId':_0xd79912[_0xefe9('0x45')]['id']});}return _0x2416e5;});}})[_0xefe9('0x22')](function(_0x5a99ee){_0x4769c9=_0x5a99ee||[];if(_0x1c7067){return db[_0xefe9('0x68')]['findAll']({'where':{'id':_0xd79912[_0xefe9('0x4a')][_0xefe9('0x79')]},'attributes':['id',_0xefe9('0x2e'),_0xefe9('0x69'),_0xefe9('0x6a'),_0xefe9('0x6b')],'raw':!![]});}})[_0xefe9('0x22')](function(_0x350ac9){if(!_[_0xefe9('0x8a')](_0x350ac9)){var _0x256a12=[];for(var _0x5da38f=0x0;_0x5da38f<_0x350ac9[_0xefe9('0x37')];_0x5da38f++){if(_0x350ac9[_0x5da38f][_0xefe9('0x69')]){_0x256a12['push'](db['UserVoiceQueueRt'][_0xefe9('0x73')]({'membername':_0x350ac9[_0x5da38f][_0xefe9('0x2e')],'UserId':_0x350ac9[_0x5da38f]['id'],'queue_name':_0x1c7067[_0xefe9('0x2e')],'VoiceQueueId':_0x1c7067['id'],'interface':_[_0xefe9('0x8f')](_0x350ac9[_0x5da38f][_0xefe9('0x6b')])?util[_0xefe9('0x74')](_0xefe9('0x75'),_0x350ac9[_0x5da38f][_0xefe9('0x2e')]):_0x350ac9[_0x5da38f][_0xefe9('0x6b')],'paused':_0x350ac9[_0x5da38f]['voicePause']||![],'penalty':_0xd79912[_0xefe9('0x4a')]['penalty']||0x0}));}}return BPromise[_0xefe9('0x85')](_0x256a12);}})[_0xefe9('0x22')](function(){return _0x4769c9;})[_0xefe9('0x22')](respondWithResult(_0x1d17f3,null))[_0xefe9('0x43')](handleError(_0x1d17f3,null));};exports[_0xefe9('0x8b')]=function(_0x3eea90,_0x4971c8,_0x309629){return db[_0xefe9('0x2f')]['find']({'where':{'id':_0x3eea90['params']['id']}})[_0xefe9('0x22')](handleEntityNotFound(_0x4971c8,null))[_0xefe9('0x22')](function(_0x2c2550){if(_0x2c2550){return _0x2c2550[_0xefe9('0x8b')](_0x3eea90[_0xefe9('0x31')][_0xefe9('0x79')])[_0xefe9('0x22')](function(){if(_[_0xefe9('0x90')](_0x3eea90[_0xefe9('0x31')][_0xefe9('0x79')])){for(var _0x5d71f9=0x0;_0x5d71f9<_0x3eea90[_0xefe9('0x31')][_0xefe9('0x79')][_0xefe9('0x37')];_0x5d71f9+=0x1){socket[_0xefe9('0x77')](_0xefe9('0x8c'),{'UserId':Number(_0x3eea90[_0xefe9('0x31')][_0xefe9('0x79')][_0x5d71f9]),'VoiceQueueId':Number(_0x3eea90[_0xefe9('0x45')]['id'])});}}else{socket['emit'](_0xefe9('0x8c'),{'UserId':Number(_0x3eea90[_0xefe9('0x31')][_0xefe9('0x79')]),'VoiceQueueId':Number(_0x3eea90[_0xefe9('0x45')]['id'])});}});}})[_0xefe9('0x22')](function(_0x921d88){return db[_0xefe9('0x72')][_0xefe9('0x2c')]({'where':{'VoiceQueueId':_0x3eea90['params']['id'],'UserId':_0x3eea90[_0xefe9('0x31')]['ids']}})[_0xefe9('0x22')](function(){return _0x921d88;});})['then'](respondWithStatusCode(_0x4971c8,null))[_0xefe9('0x43')](handleError(_0x4971c8,null));};exports['getAgents']=function(_0x5b19aa,_0x1e3f8b,_0x5e1367){var _0x5e990e={};var _0x25b2f6={};var _0x16bf4a;var _0x4fc34c;return db[_0xefe9('0x2f')][_0xefe9('0x5a')]({'where':{'id':_0x5b19aa[_0xefe9('0x45')]['id']}})[_0xefe9('0x22')](handleEntityNotFound(_0x1e3f8b,null))['then'](function(_0x4621f9){if(_0x4621f9){_0x16bf4a=_0x4621f9;_0x25b2f6[_0xefe9('0x30')]=_[_0xefe9('0x32')](db[_0xefe9('0x68')][_0xefe9('0x46')]);_0x25b2f6['query']=_[_0xefe9('0x32')](_0x5b19aa[_0xefe9('0x31')]);_0x25b2f6['filters']=_[_0xefe9('0x34')](_0x25b2f6[_0xefe9('0x30')],_0x25b2f6['query']);_0x5e990e[_0xefe9('0x35')]=_[_0xefe9('0x34')](_0x25b2f6[_0xefe9('0x30')],qs[_0xefe9('0x36')](_0x5b19aa['query']['fields']));_0x5e990e[_0xefe9('0x35')]=_0x5e990e[_0xefe9('0x35')]['length']?_0x5e990e['attributes']:_0x25b2f6[_0xefe9('0x30')];_0x5e990e[_0xefe9('0x3a')]=qs[_0xefe9('0x3b')](_0x5b19aa[_0xefe9('0x31')][_0xefe9('0x3b')]);_0x5e990e[_0xefe9('0x3c')]=qs[_0xefe9('0x33')](_[_0xefe9('0x3d')](_0x5b19aa['query'],_0x25b2f6[_0xefe9('0x33')]));if(_0x5b19aa['query'][_0xefe9('0x25')]){_0x5e990e[_0xefe9('0x3c')]=_[_0xefe9('0x48')](_0x5e990e['where'],{'$or':_[_0xefe9('0x27')](_0x5e990e[_0xefe9('0x35')],function(_0x47a884){var _0x53aed0={};_0x53aed0[_0x47a884]={'$like':'%'+_0x5b19aa[_0xefe9('0x31')][_0xefe9('0x25')]+'%'};return _0x53aed0;})});}_0x5e990e=_[_0xefe9('0x48')]({},_0x5e990e,_0x5b19aa[_0xefe9('0x41')]);return _0x16bf4a['getAgents'](_0x5e990e);}})[_0xefe9('0x22')](function(_0x1f71ce){if(_0x1f71ce){_0x4fc34c=_0x1f71ce[_0xefe9('0x37')];if(!_0x5b19aa[_0xefe9('0x31')]['hasOwnProperty'](_0xefe9('0x38'))){_0x5e990e[_0xefe9('0x39')]=qs[_0xefe9('0x39')](_0x5b19aa['query']['limit']);_0x5e990e[_0xefe9('0x1e')]=qs[_0xefe9('0x1e')](_0x5b19aa['query']['offset']);}return _0x16bf4a[_0xefe9('0x91')](_0x5e990e);}})['then'](function(_0x2b5918){if(_0x2b5918){return _0x2b5918?{'count':_0x4fc34c,'rows':_0x2b5918}:null;}})[_0xefe9('0x22')](respondWithResult(_0x1e3f8b,null))[_0xefe9('0x43')](handleError(_0x1e3f8b,null));};exports[_0xefe9('0x92')]=function(_0x2be148,_0x4ada36,_0x138a38){var _0x3cdc02={};var _0x293b93={};var _0x32ed50;var _0x4e4dc3;return db['VoiceQueue']['findOne']({'where':{'id':_0x2be148[_0xefe9('0x45')]['id']}})[_0xefe9('0x22')](handleEntityNotFound(_0x4ada36,null))[_0xefe9('0x22')](function(_0x2f5e02){if(_0x2f5e02){_0x32ed50=_0x2f5e02;_0x293b93[_0xefe9('0x30')]=_[_0xefe9('0x32')](db[_0xefe9('0x72')][_0xefe9('0x46')]);_0x293b93[_0xefe9('0x31')]=_[_0xefe9('0x32')](_0x2be148[_0xefe9('0x31')]);_0x293b93[_0xefe9('0x33')]=_[_0xefe9('0x34')](_0x293b93[_0xefe9('0x30')],_0x293b93[_0xefe9('0x31')]);_0x3cdc02[_0xefe9('0x35')]=_['intersection'](_0x293b93[_0xefe9('0x30')],qs[_0xefe9('0x36')](_0x2be148[_0xefe9('0x31')][_0xefe9('0x36')]));_0x3cdc02[_0xefe9('0x35')]=_0x3cdc02[_0xefe9('0x35')][_0xefe9('0x37')]?_0x3cdc02['attributes']:_0x293b93['model'];_0x3cdc02[_0xefe9('0x3a')]=qs[_0xefe9('0x3b')](_0x2be148['query'][_0xefe9('0x3b')]);_0x3cdc02[_0xefe9('0x3c')]=qs['filters'](_['pick'](_0x2be148['query'],_0x293b93[_0xefe9('0x33')]));if(_0x2be148[_0xefe9('0x31')]['filter']){_0x3cdc02['where']=_['merge'](_0x3cdc02[_0xefe9('0x3c')],{'$or':_[_0xefe9('0x27')](_0x3cdc02['attributes'],function(_0x4c0a95){var _0x2264b0={};_0x2264b0[_0x4c0a95]={'$like':'%'+_0x2be148['query'][_0xefe9('0x25')]+'%'};return _0x2264b0;})});}_0x3cdc02=_[_0xefe9('0x48')]({},_0x3cdc02,_0x2be148['options']);return _0x32ed50['getMembers'](_0x3cdc02);}})['then'](function(_0x2a084c){if(_0x2a084c){_0x4e4dc3=_0x2a084c[_0xefe9('0x37')];if(!_0x2be148[_0xefe9('0x31')][_0xefe9('0x61')](_0xefe9('0x38'))){_0x3cdc02[_0xefe9('0x39')]=qs[_0xefe9('0x39')](_0x2be148[_0xefe9('0x31')][_0xefe9('0x39')]);_0x3cdc02[_0xefe9('0x1e')]=qs[_0xefe9('0x1e')](_0x2be148[_0xefe9('0x31')][_0xefe9('0x1e')]);}return _0x32ed50[_0xefe9('0x92')](_0x3cdc02);}})['then'](function(_0x315f69){return _0x315f69?{'count':_0x4e4dc3,'rows':_0x315f69}:null;})[_0xefe9('0x22')](respondWithResult(_0x4ada36,null))[_0xefe9('0x43')](handleError(_0x4ada36,null));};exports[_0xefe9('0x93')]=function(_0x3ec567,_0x5cbfc2,_0x1eb652){var _0x31f934={};var _0x5aaeb6={};var _0x3d59df;var _0xd4ea0b;return db[_0xefe9('0x2f')][_0xefe9('0x5a')]({'where':{'id':_0x3ec567[_0xefe9('0x45')]['id']}})['then'](handleEntityNotFound(_0x5cbfc2,null))[_0xefe9('0x22')](function(_0x57f2cb){if(_0x57f2cb){_0x3d59df=_0x57f2cb;_0x5aaeb6[_0xefe9('0x30')]=_[_0xefe9('0x32')](db['CmList']['rawAttributes']);_0x5aaeb6['query']=_[_0xefe9('0x32')](_0x3ec567[_0xefe9('0x31')]);_0x5aaeb6['filters']=_[_0xefe9('0x34')](_0x5aaeb6[_0xefe9('0x30')],_0x5aaeb6[_0xefe9('0x31')]);_0x31f934['attributes']=_[_0xefe9('0x34')](_0x5aaeb6['model'],qs[_0xefe9('0x36')](_0x3ec567[_0xefe9('0x31')][_0xefe9('0x36')]));_0x31f934[_0xefe9('0x35')]=_0x31f934['attributes'][_0xefe9('0x37')]?_0x31f934[_0xefe9('0x35')]:_0x5aaeb6[_0xefe9('0x30')];_0x31f934[_0xefe9('0x3a')]=qs[_0xefe9('0x3b')](_0x3ec567['query']['sort']);_0x31f934[_0xefe9('0x3c')]=qs[_0xefe9('0x33')](_[_0xefe9('0x3d')](_0x3ec567[_0xefe9('0x31')],_0x5aaeb6[_0xefe9('0x33')]));if(_0x3ec567[_0xefe9('0x31')]['filter']){_0x31f934[_0xefe9('0x3c')]=_[_0xefe9('0x48')](_0x31f934[_0xefe9('0x3c')],{'$or':_[_0xefe9('0x27')](_0x31f934[_0xefe9('0x35')],function(_0xe08326){var _0x4b07b1={};_0x4b07b1[_0xe08326]={'$like':'%'+_0x3ec567[_0xefe9('0x31')]['filter']+'%'};return _0x4b07b1;})});}_0x31f934=_[_0xefe9('0x48')]({},_0x31f934,_0x3ec567[_0xefe9('0x41')]);return _0x3d59df[_0xefe9('0x93')](_0x31f934);}})[_0xefe9('0x22')](function(_0x1b708d){if(_0x1b708d){_0xd4ea0b=_0x1b708d['length'];if(!_0x3ec567[_0xefe9('0x31')][_0xefe9('0x61')]('nolimit')){_0x31f934['limit']=qs[_0xefe9('0x39')](_0x3ec567[_0xefe9('0x31')][_0xefe9('0x39')]);_0x31f934[_0xefe9('0x1e')]=qs[_0xefe9('0x1e')](_0x3ec567[_0xefe9('0x31')][_0xefe9('0x1e')]);}return _0x3d59df[_0xefe9('0x93')](_0x31f934);}})[_0xefe9('0x22')](function(_0x578711){if(_0x578711){return _0x578711?{'count':_0xd4ea0b,'rows':_0x578711}:null;}})['then'](respondWithResult(_0x5cbfc2,null))[_0xefe9('0x43')](handleError(_0x5cbfc2,null));};exports[_0xefe9('0x94')]=function(_0x11424c,_0x3f5e2d,_0x4920eb){var _0x2368a9,_0x5dd189;return db['VoiceQueue'][_0xefe9('0x50')]({'where':{'id':_0x11424c[_0xefe9('0x45')]['id']}})['then'](handleEntityNotFound(_0x3f5e2d,null))[_0xefe9('0x22')](function(_0xbc02a7){if(_0xbc02a7){_0x5dd189=_0xbc02a7;return _0xbc02a7[_0xefe9('0x94')](_0x11424c['body'][_0xefe9('0x79')],_[_0xefe9('0x56')](_0x11424c[_0xefe9('0x4a')],[_0xefe9('0x79'),'id'])||{});}return null;})[_0xefe9('0x8e')](function(_0x1f7216){var _0x3ddf10;_0x2368a9=_0x1f7216||[];var _0x19d3b6=[];if(_0x1f7216){for(var _0x8b7870=0x0;_0x8b7870<_0x1f7216[_0xefe9('0x37')];_0x8b7870+=0x1){var _0x28748=_0x1f7216[_0x8b7870][_0xefe9('0x23')]({'plain':!![]});_0x5dd189['dialCheckDuplicateType']=_0x11424c[_0xefe9('0x4a')][_0xefe9('0x95')]?_0x11424c['body'][_0xefe9('0x95')]:_0x5dd189[_0xefe9('0x95')];switch(_0x5dd189[_0xefe9('0x95')]){case _0xefe9('0x96'):_0x3ddf10=squel['insert']()['into'](_0xefe9('0x97'))[_0xefe9('0x98')]([_0xefe9('0x99'),_0xefe9('0x9a'),_0xefe9('0x9b'),_0xefe9('0x9c'),_0xefe9('0x5c'),_0xefe9('0x57'),'updatedAt'],squel[_0xefe9('0x7a')]()['field'](_0xefe9('0x99'),_0xefe9('0x99'))[_0xefe9('0x40')](_0xefe9('0x9d'),_0xefe9('0x9a'))[_0xefe9('0x40')]('id',_0xefe9('0x9b'))['field'](_0x28748['CmListId'][_0xefe9('0x82')](),_0xefe9('0x9c'))['field'](_0x11424c[_0xefe9('0x45')]['id'][_0xefe9('0x82')](),_0xefe9('0x5c'))['field']('NOW()',_0xefe9('0x57'))[_0xefe9('0x40')](_0xefe9('0x9d'),_0xefe9('0x55'))[_0xefe9('0x7c')]('cm_contacts')[_0xefe9('0x3c')](_0xefe9('0x9e'))[_0xefe9('0x3c')](_0xefe9('0x9f'),_0x28748[_0xefe9('0xa0')]['toString']())[_0xefe9('0x3c')](_0xefe9('0xa1'))['where'](_0xefe9('0xa2'),squel[_0xefe9('0x7a')]()['field'](_0xefe9('0xa3'))['from'](_0xefe9('0xa4'))[_0xefe9('0x3c')]('VoiceQueueId\x20=\x20?',_0x11424c['params']['id'][_0xefe9('0x82')]()))[_0xefe9('0x3c')](_0xefe9('0xa2'),squel['select']()['field'](_0xefe9('0xa5'))[_0xefe9('0x7c')](_0xefe9('0x97'))[_0xefe9('0x3c')](_0xefe9('0xa6'),_0x11424c[_0xefe9('0x45')]['id'][_0xefe9('0x82')]())))[_0xefe9('0x82')]();break;case _0xefe9('0xa7'):_0x3ddf10=squel[_0xefe9('0xa8')]()[_0xefe9('0xa9')](_0xefe9('0x97'))[_0xefe9('0x98')]([_0xefe9('0x99'),_0xefe9('0x9a'),_0xefe9('0x9b'),_0xefe9('0x9c'),_0xefe9('0x5c'),'createdAt',_0xefe9('0x55')],squel[_0xefe9('0x7a')]()['field'](_0xefe9('0x99'),_0xefe9('0x99'))[_0xefe9('0x40')](_0xefe9('0x9d'),_0xefe9('0x9a'))['field']('id',_0xefe9('0x9b'))[_0xefe9('0x40')](_0x28748[_0xefe9('0xa0')][_0xefe9('0x82')](),_0xefe9('0x9c'))[_0xefe9('0x40')](_0x11424c[_0xefe9('0x45')]['id']['toString'](),_0xefe9('0x5c'))[_0xefe9('0x40')]('NOW()',_0xefe9('0x57'))[_0xefe9('0x40')]('NOW()','updatedAt')[_0xefe9('0x7c')](_0xefe9('0xaa'))[_0xefe9('0x3c')](_0xefe9('0x9e'))['where'](_0xefe9('0x9f'),_0x28748[_0xefe9('0xa0')][_0xefe9('0x82')]())['where'](_0xefe9('0xa1'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xefe9('0x7a')]()[_0xefe9('0x40')](_0xefe9('0xa5'))[_0xefe9('0x7c')]('cm_hopper')[_0xefe9('0x3c')](_0xefe9('0xa6'),_0x11424c[_0xefe9('0x45')]['id'][_0xefe9('0x82')]())))[_0xefe9('0x82')]();break;default:_0x3ddf10=squel[_0xefe9('0xa8')]()[_0xefe9('0xa9')](_0xefe9('0x97'))[_0xefe9('0x98')](['phone',_0xefe9('0x9a'),'ContactId',_0xefe9('0x9c'),_0xefe9('0x5c'),_0xefe9('0x57'),_0xefe9('0x55')],squel[_0xefe9('0x7a')]()['field'](_0xefe9('0x99'),_0xefe9('0x99'))[_0xefe9('0x40')](_0xefe9('0x9d'),'scheduledAt')[_0xefe9('0x40')]('id',_0xefe9('0x9b'))[_0xefe9('0x40')](_0x28748[_0xefe9('0xa0')]['toString'](),_0xefe9('0x9c'))['field'](_0x11424c[_0xefe9('0x45')]['id'][_0xefe9('0x82')](),_0xefe9('0x5c'))[_0xefe9('0x40')](_0xefe9('0x9d'),_0xefe9('0x57'))['field'](_0xefe9('0x9d'),_0xefe9('0x55'))['from']('cm_contacts')[_0xefe9('0x3c')](_0xefe9('0x9e'))[_0xefe9('0x3c')]('ListId\x20=\x20?',_0x28748['CmListId']['toString']())[_0xefe9('0x3c')](_0xefe9('0xa1')))[_0xefe9('0x82')]();}_0x19d3b6['push'](db['sequelize']['query'](_0x3ddf10));}return BPromise[_0xefe9('0x85')](_0x19d3b6);}})[_0xefe9('0x22')](function(){return _0x2368a9;})[_0xefe9('0x22')](respondWithResult(_0x3f5e2d,null))['catch'](handleError(_0x3f5e2d,null));};exports[_0xefe9('0xab')]=function(_0x3459c9,_0x429953,_0x48a399){return db[_0xefe9('0x2f')][_0xefe9('0x50')]({'where':{'id':_0x3459c9[_0xefe9('0x45')]['id']}})[_0xefe9('0x22')](handleEntityNotFound(_0x429953,null))[_0xefe9('0x22')](function(_0x15ca28){if(_0x15ca28){return _0x15ca28[_0xefe9('0xab')](_0x3459c9[_0xefe9('0x31')]['ids']);}})[_0xefe9('0x22')](function(_0x474e86){if(_0x474e86){return db[_0xefe9('0x5b')][_0xefe9('0x2c')]({'where':{'ListId':_0x3459c9[_0xefe9('0x31')]['ids'],'VoiceQueueId':_0x3459c9[_0xefe9('0x45')]['id']}})['then'](function(){return _0x474e86;});}})[_0xefe9('0x22')](respondWithStatusCode(_0x429953,null))['catch'](handleError(_0x429953,null));};exports[_0xefe9('0xac')]=function(_0x9c1122,_0x46b106,_0x115672){var _0x5b3413={};var _0x2412c7={};var _0x3d5ff7;var _0x4373ed;return db[_0xefe9('0x2f')][_0xefe9('0x5a')]({'where':{'id':_0x9c1122['params']['id']}})[_0xefe9('0x22')](handleEntityNotFound(_0x46b106,null))[_0xefe9('0x22')](function(_0x9cca30){if(_0x9cca30){_0x3d5ff7=_0x9cca30;_0x2412c7[_0xefe9('0x30')]=_[_0xefe9('0x32')](db[_0xefe9('0xad')][_0xefe9('0x46')]);_0x2412c7[_0xefe9('0x31')]=_[_0xefe9('0x32')](_0x9c1122[_0xefe9('0x31')]);_0x2412c7['filters']=_['intersection'](_0x2412c7[_0xefe9('0x30')],_0x2412c7['query']);_0x5b3413[_0xefe9('0x35')]=_['intersection'](_0x2412c7['model'],qs['fields'](_0x9c1122[_0xefe9('0x31')][_0xefe9('0x36')]));_0x5b3413['attributes']=_0x5b3413['attributes']['length']?_0x5b3413[_0xefe9('0x35')]:_0x2412c7[_0xefe9('0x30')];_0x5b3413[_0xefe9('0x3a')]=qs[_0xefe9('0x3b')](_0x9c1122['query'][_0xefe9('0x3b')]);_0x5b3413[_0xefe9('0x3c')]=qs[_0xefe9('0x33')](_[_0xefe9('0x3d')](_0x9c1122['query'],_0x2412c7[_0xefe9('0x33')]));if(_0x9c1122[_0xefe9('0x31')][_0xefe9('0x25')]){_0x5b3413['where']=_[_0xefe9('0x48')](_0x5b3413['where'],{'$or':_[_0xefe9('0x27')](_0x5b3413[_0xefe9('0x35')],function(_0x278942){var _0x12c333={};_0x12c333[_0x278942]={'$like':'%'+_0x9c1122['query'][_0xefe9('0x25')]+'%'};return _0x12c333;})});}_0x5b3413=_[_0xefe9('0x48')]({},_0x5b3413,_0x9c1122['options']);return _0x3d5ff7[_0xefe9('0xac')](_0x5b3413);}})[_0xefe9('0x22')](function(_0xa71af2){if(_0xa71af2){_0x4373ed=_0xa71af2['length'];if(!_0x9c1122[_0xefe9('0x31')][_0xefe9('0x61')]('nolimit')){_0x5b3413[_0xefe9('0x39')]=qs['limit'](_0x9c1122[_0xefe9('0x31')][_0xefe9('0x39')]);_0x5b3413[_0xefe9('0x1e')]=qs[_0xefe9('0x1e')](_0x9c1122['query']['offset']);}return _0x3d5ff7[_0xefe9('0xac')](_0x5b3413);}})[_0xefe9('0x22')](function(_0x59d4b9){if(_0x59d4b9){return _0x59d4b9?{'count':_0x4373ed,'rows':_0x59d4b9}:null;}})[_0xefe9('0x22')](respondWithResult(_0x46b106,null))[_0xefe9('0x43')](handleError(_0x46b106,null));};exports[_0xefe9('0xae')]=function(_0x2e1515,_0x1c5ff0,_0x2d358d){var _0x22f978,_0x396711;return db[_0xefe9('0x2f')][_0xefe9('0x50')]({'where':{'id':_0x2e1515[_0xefe9('0x45')]['id']}})[_0xefe9('0x22')](handleEntityNotFound(_0x1c5ff0,null))[_0xefe9('0x22')](function(_0x5180cb){if(_0x5180cb){_0x396711=_0x5180cb;return _0x5180cb['addBlackLists'](_0x2e1515[_0xefe9('0x4a')][_0xefe9('0x79')],_['omit'](_0x2e1515['body'],[_0xefe9('0x79'),'id'])||{});}return null;})['spread'](function(_0x15d841){var _0x4b7e8e;_0x22f978=_0x15d841||[];var _0x590035=[];if(_0x15d841){for(var _0x428801=0x0;_0x428801<_0x15d841[_0xefe9('0x37')];_0x428801+=0x1){var _0x17a5a7=_0x15d841[_0x428801][_0xefe9('0x23')]({'plain':!![]});_0x4b7e8e=squel[_0xefe9('0xa8')]()['into'](_0xefe9('0xaf'))[_0xefe9('0x98')](['phone','ContactId',_0xefe9('0x9c'),_0xefe9('0x5c'),_0xefe9('0x57'),_0xefe9('0x55')],squel['select']()[_0xefe9('0x40')]('phone',_0xefe9('0x99'))['field']('id',_0xefe9('0x9b'))['field'](_0x17a5a7[_0xefe9('0xa0')][_0xefe9('0x82')](),'ListId')[_0xefe9('0x40')](_0x2e1515[_0xefe9('0x45')]['id'][_0xefe9('0x82')](),_0xefe9('0x5c'))[_0xefe9('0x40')](_0xefe9('0x9d'),_0xefe9('0x57'))[_0xefe9('0x40')](_0xefe9('0x9d'),_0xefe9('0x55'))[_0xefe9('0x7c')](_0xefe9('0xaa'))[_0xefe9('0x3c')](_0xefe9('0x9e'))[_0xefe9('0x3c')](_0xefe9('0x9f'),_0x17a5a7[_0xefe9('0xa0')][_0xefe9('0x82')]())['where'](_0xefe9('0xa1')))[_0xefe9('0x82')]();_0x590035[_0xefe9('0x81')](db[_0xefe9('0x88')][_0xefe9('0x31')](_0x4b7e8e));}return BPromise[_0xefe9('0x85')](_0x590035);}})[_0xefe9('0x22')](function(){return _0x22f978;})[_0xefe9('0x22')](respondWithResult(_0x1c5ff0,null))['catch'](handleError(_0x1c5ff0,null));};exports[_0xefe9('0xb0')]=function(_0x2a7d09,_0xcf550e,_0x419908){return db[_0xefe9('0x2f')][_0xefe9('0x50')]({'where':{'id':_0x2a7d09[_0xefe9('0x45')]['id']}})[_0xefe9('0x22')](handleEntityNotFound(_0xcf550e,null))['then'](function(_0x344719){if(_0x344719){return _0x344719[_0xefe9('0xb0')](_0x2a7d09[_0xefe9('0x31')][_0xefe9('0x79')]);}})['then'](function(_0x2b9995){if(_0x2b9995){return db[_0xefe9('0x63')]['destroy']({'where':{'ListId':_0x2a7d09[_0xefe9('0x31')][_0xefe9('0x79')],'VoiceQueueId':_0x2a7d09['params']['id']}})[_0xefe9('0x22')](function(){return _0x2b9995;});}})[_0xefe9('0x22')](respondWithStatusCode(_0xcf550e,null))['catch'](handleError(_0xcf550e,null));}; \ No newline at end of file +var _0x54ad=['union','compact','isEmpty','removeAgents','forEach','addAgents','spread','all','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','scheduledAt','ListId','updatedAt','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','phone','ContactId','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','status','end','count','offset','limit','set','json','apply','save','update','then','destroy','get','VoiceQueues','QueueCampaigns','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','index','VoiceQueue','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','options','create','body','role','user','inbound','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','CmHopper','getHopperHistories','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','penalty','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','Team','ids','select','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','TeamId'];(function(_0x1f7839,_0x2a26e6){var _0x36b42e=function(_0x553222){while(--_0x553222){_0x1f7839['push'](_0x1f7839['shift']());}};_0x36b42e(++_0x2a26e6);}(_0x54ad,0xdd));var _0xd54a=function(_0x7014f0,_0x4b7079){_0x7014f0=_0x7014f0-0x0;var _0x6b2b7d=_0x54ad[_0x7014f0];return _0x6b2b7d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd54a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd54a('0x1'));var rp=require(_0xd54a('0x2'));var moment=require(_0xd54a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd54a('0x4'));var util=require(_0xd54a('0x5'));var path=require(_0xd54a('0x6'));var sox=require('sox');var csv=require(_0xd54a('0x7'));var ejs=require(_0xd54a('0x8'));var fs=require('fs');var _=require(_0xd54a('0x9'));var squel=require(_0xd54a('0xa'));var crypto=require('crypto');var jsforce=require(_0xd54a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd54a('0x7'));var querystring=require(_0xd54a('0xc'));var Papa=require(_0xd54a('0xd'));var Redis=require(_0xd54a('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd54a('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xd54a('0x10'));var config=require(_0xd54a('0x11'));var db=require('../../mysqldb')['db'];config[_0xd54a('0x12')]=_[_0xd54a('0x13')](config[_0xd54a('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0xd54a('0x14'))(new Redis(config[_0xd54a('0x12')]));require(_0xd54a('0x15'))[_0xd54a('0x16')](socket);function respondWithStatusCode(_0x4e57f6,_0xd7ca2d){_0xd7ca2d=_0xd7ca2d||0xcc;return function(_0x2d9dea){if(_0x2d9dea){return _0x4e57f6['sendStatus'](_0xd7ca2d);}return _0x4e57f6[_0xd54a('0x17')](_0xd7ca2d)[_0xd54a('0x18')]();};}function respondWithResult(_0x1b6602,_0xdf4987){_0xdf4987=_0xdf4987||0xc8;return function(_0x691875){if(_0x691875){return _0x1b6602[_0xd54a('0x17')](_0xdf4987)['json'](_0x691875);}};}function respondWithFilteredResult(_0x2d5840,_0x13a25b){return function(_0x1a0bc7){if(_0x1a0bc7){var _0x131a62=_0x1a0bc7[_0xd54a('0x19')],_0x1030a2=_0x13a25b['offset'],_0x327fd0=_0x13a25b[_0xd54a('0x1a')]+_0x13a25b[_0xd54a('0x1b')],_0x26e5d8;if(_0x327fd0>=_0x131a62){_0x327fd0=_0x131a62;_0x26e5d8=0xc8;}else{_0x26e5d8=0xce;}_0x2d5840[_0xd54a('0x17')](_0x26e5d8);return _0x2d5840[_0xd54a('0x1c')]('Content-Range',_0x1030a2+'-'+_0x327fd0+'/'+_0x131a62)[_0xd54a('0x1d')](_0x1a0bc7);}return null;};}function patchUpdates(_0x3c0241){return function(_0x272dc6){try{jsonpatch[_0xd54a('0x1e')](_0x272dc6,_0x3c0241,!![]);}catch(_0x29e50a){return BPromise['reject'](_0x29e50a);}return _0x272dc6[_0xd54a('0x1f')]();};}function saveUpdates(_0x393b10,_0x15b4a1){return function(_0x328efb){if(_0x328efb){return _0x328efb[_0xd54a('0x20')](_0x393b10)[_0xd54a('0x21')](function(_0x492296){return _0x492296;});}return null;};}function removeEntity(_0x72ce90,_0x2a06c2){return function(_0x1ca171){if(_0x1ca171){return _0x1ca171[_0xd54a('0x22')]()[_0xd54a('0x21')](function(){var _0x12544f=_0x1ca171[_0xd54a('0x23')]({'plain':!![]});var _0x8b40f5=[{'name':_0xd54a('0x24'),'value':'inbound','ignore':![]},{'name':_0xd54a('0x25'),'value':_0xd54a('0x26'),'ignore':![]}];var _0xa70167=_(_0x8b40f5)['filter'](_0xd54a('0x27'))[_0xd54a('0x28')](_0xd54a('0x29'))[_0xd54a('0x29')]();if(_[_0xd54a('0x2a')](_0xa70167,_0x12544f[_0xd54a('0x2b')])){return;}var _0x468b10=_[_0xd54a('0x2c')](_0x8b40f5,['value',_0x12544f[_0xd54a('0x2b')]])[_0xd54a('0x2d')];return db[_0xd54a('0x2e')][_0xd54a('0x22')]({'where':{'type':_0x468b10,'resourceId':_0x12544f['id']}})[_0xd54a('0x21')](function(){return _0x1ca171;});})[_0xd54a('0x21')](function(){_0x72ce90[_0xd54a('0x17')](0xcc)[_0xd54a('0x18')]();});}};}function handleEntityNotFound(_0x2b581b,_0x97fcb6){return function(_0x393cd5){if(!_0x393cd5){_0x2b581b['sendStatus'](0x194);}return _0x393cd5;};}function handleError(_0xe5428c,_0x342bb6){_0x342bb6=_0x342bb6||0x1f4;return function(_0x4398e4){logger['error'](_0x4398e4['stack']);if(_0x4398e4[_0xd54a('0x2d')]){delete _0x4398e4[_0xd54a('0x2d')];}_0xe5428c['status'](_0x342bb6)['send'](_0x4398e4);};}exports[_0xd54a('0x2f')]=function(_0x4f5fc8,_0x18d32e){var _0x461c64={},_0x4e7616={},_0x478d9c={'count':0x0,'rows':[]};var _0x515309=db[_0xd54a('0x30')][_0xd54a('0x31')];_0x4e7616['model']=_['keys'](_0x515309);_0x4e7616[_0xd54a('0x32')]=_[_0xd54a('0x33')](_0x4f5fc8[_0xd54a('0x32')]);_0x4e7616[_0xd54a('0x34')]=_[_0xd54a('0x35')](_0x4e7616[_0xd54a('0x36')],_0x4e7616[_0xd54a('0x32')]);_0x461c64['attributes']=_['intersection'](_0x4e7616[_0xd54a('0x36')],qs[_0xd54a('0x37')](_0x4f5fc8[_0xd54a('0x32')][_0xd54a('0x37')]));_0x461c64['attributes']=_0x461c64[_0xd54a('0x38')][_0xd54a('0x39')]?_0x461c64['attributes']:_0x4e7616['model'];if(!_0x4f5fc8['query'][_0xd54a('0x3a')](_0xd54a('0x3b'))){_0x461c64[_0xd54a('0x1b')]=qs['limit'](_0x4f5fc8[_0xd54a('0x32')][_0xd54a('0x1b')]);_0x461c64[_0xd54a('0x1a')]=qs[_0xd54a('0x1a')](_0x4f5fc8['query'][_0xd54a('0x1a')]);}_0x461c64[_0xd54a('0x3c')]=qs[_0xd54a('0x3d')](_0x4f5fc8[_0xd54a('0x32')]['sort']);_0x461c64[_0xd54a('0x3e')]=qs['filters'](_[_0xd54a('0x3f')](_0x4f5fc8[_0xd54a('0x32')],_0x4e7616[_0xd54a('0x34')]));if(_0x4f5fc8[_0xd54a('0x32')][_0xd54a('0x40')]){_0x461c64[_0xd54a('0x3e')]=_[_0xd54a('0x41')](_0x461c64['where'],{'$or':_[_0xd54a('0x28')](_0x515309,function(_0x262bc7){if(_0x262bc7['type'][_0xd54a('0x42')]!==_0xd54a('0x43')){var _0x377cbf={};_0x377cbf[_0x262bc7[_0xd54a('0x44')]]={'$like':'%'+_0x4f5fc8['query'][_0xd54a('0x40')]+'%'};return _0x377cbf;}})});}_0x461c64=_[_0xd54a('0x41')]({},_0x461c64,_0x4f5fc8['options']);var _0x57fa56={'where':_0x461c64[_0xd54a('0x3e')]};return db['VoiceQueue'][_0xd54a('0x19')](_0x57fa56)[_0xd54a('0x21')](function(_0x444c2c){_0x478d9c[_0xd54a('0x19')]=_0x444c2c;if(_0x4f5fc8[_0xd54a('0x32')][_0xd54a('0x45')]){_0x461c64[_0xd54a('0x46')]=[{'all':!![]}];}return db['VoiceQueue'][_0xd54a('0x47')](_0x461c64);})['then'](function(_0x4603a6){_0x478d9c[_0xd54a('0x48')]=_0x4603a6;return _0x478d9c;})[_0xd54a('0x21')](respondWithFilteredResult(_0x18d32e,_0x461c64))[_0xd54a('0x49')](handleError(_0x18d32e,null));};exports[_0xd54a('0x4a')]=function(_0x2df8e2,_0x59a222){var _0x293619={'raw':![],'where':{'id':_0x2df8e2[_0xd54a('0x4b')]['id']}},_0x2fcb13={};_0x2fcb13[_0xd54a('0x36')]=_['keys'](db[_0xd54a('0x30')][_0xd54a('0x31')]);_0x2fcb13[_0xd54a('0x32')]=_['keys'](_0x2df8e2[_0xd54a('0x32')]);_0x2fcb13[_0xd54a('0x34')]=_[_0xd54a('0x35')](_0x2fcb13['model'],_0x2fcb13['query']);_0x293619[_0xd54a('0x38')]=_[_0xd54a('0x35')](_0x2fcb13[_0xd54a('0x36')],qs['fields'](_0x2df8e2['query'][_0xd54a('0x37')]));_0x293619[_0xd54a('0x38')]=_0x293619[_0xd54a('0x38')][_0xd54a('0x39')]?_0x293619['attributes']:_0x2fcb13[_0xd54a('0x36')];if(_0x2df8e2[_0xd54a('0x32')][_0xd54a('0x45')]){_0x293619[_0xd54a('0x46')]=[{'all':!![]}];}_0x293619=_['merge']({},_0x293619,_0x2df8e2[_0xd54a('0x4c')]);return db[_0xd54a('0x30')][_0xd54a('0x2c')](_0x293619)[_0xd54a('0x21')](handleEntityNotFound(_0x59a222,null))[_0xd54a('0x21')](respondWithResult(_0x59a222,null))[_0xd54a('0x49')](handleError(_0x59a222,null));};exports[_0xd54a('0x4d')]=function(_0x5d7ab0,_0x3c057b){return db[_0xd54a('0x30')][_0xd54a('0x4d')](_0x5d7ab0[_0xd54a('0x4e')],{})[_0xd54a('0x21')](function(_0x5753ac){var _0x1ccd53=_0x5d7ab0['user']['get']({'plain':!![]});if(!_0x1ccd53)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ccd53[_0xd54a('0x4f')]===_0xd54a('0x50')){var _0x1e8176=_0x5753ac[_0xd54a('0x23')]({'plain':!![]});var _0x57abdd=[{'name':_0xd54a('0x24'),'value':_0xd54a('0x51')},{'name':_0xd54a('0x25'),'value':_0xd54a('0x26')}];var _0x59029f=_[_0xd54a('0x2c')](_0x57abdd,[_0xd54a('0x29'),_0x1e8176['type']])[_0xd54a('0x2d')];return db[_0xd54a('0x52')][_0xd54a('0x2c')]({'where':{'name':_0x59029f,'userProfileId':_0x1ccd53[_0xd54a('0x53')]},'raw':!![]})[_0xd54a('0x21')](function(_0x19e5d1){if(_0x19e5d1&&_0x19e5d1[_0xd54a('0x54')]===0x0){return db[_0xd54a('0x2e')]['create']({'name':_0x1e8176[_0xd54a('0x2d')],'resourceId':_0x1e8176['id'],'type':_0x19e5d1['name'],'sectionId':_0x19e5d1['id']},{})[_0xd54a('0x21')](function(){return _0x5753ac;});}else{return _0x5753ac;}})[_0xd54a('0x49')](function(_0x2ca1ba){logger[_0xd54a('0x55')](_0xd54a('0x56'),_0x2ca1ba);throw _0x2ca1ba;});}return _0x5753ac;})[_0xd54a('0x21')](respondWithResult(_0x3c057b,0xc9))['catch'](handleError(_0x3c057b,null));};exports['clone']=function(_0x1eb37e,_0x2d7d31){var _0x4952ad={'raw':![],'where':{'id':_0x1eb37e[_0xd54a('0x4b')]['id']}},_0x3ed7c9={};_0x3ed7c9[_0xd54a('0x36')]=_[_0xd54a('0x33')](db['VoiceQueue'][_0xd54a('0x31')]);_0x4952ad['attributes']=_[_0xd54a('0x35')](_0x3ed7c9[_0xd54a('0x36')],qs[_0xd54a('0x37')](_0x1eb37e[_0xd54a('0x32')][_0xd54a('0x37')]));_0x4952ad[_0xd54a('0x38')]=_0x4952ad[_0xd54a('0x38')][_0xd54a('0x39')]?_0x4952ad['attributes']:_0x3ed7c9[_0xd54a('0x36')];if(_0x1eb37e['query']['includeAll']){_0x4952ad[_0xd54a('0x46')]=[{'all':!![]}];}_0x4952ad=_[_0xd54a('0x41')]({},_0x4952ad,_0x1eb37e[_0xd54a('0x4c')]);return db[_0xd54a('0x30')][_0xd54a('0x2c')](_0x4952ad)[_0xd54a('0x21')](handleEntityNotFound(_0x2d7d31,null))[_0xd54a('0x21')](function(_0x520363){if(_0x520363){var _0x440423=_0x520363['get']({'plain':!![]});_0x440423=qs[_0xd54a('0x57')](_0x440423,['id',_0xd54a('0x58'),'updatedAt']);_0x1eb37e['body']=_[_0xd54a('0x57')](_0x1eb37e['body'],['id','createdAt','updatedAt']);return db[_0xd54a('0x30')][_0xd54a('0x4d')](_[_0xd54a('0x41')](_0x440423,_0x1eb37e[_0xd54a('0x4e')]),{'include':_0x1eb37e[_0xd54a('0x32')][_0xd54a('0x45')]?[{'all':!![]}]:undefined})[_0xd54a('0x21')](function(_0x1fc6c2){var _0x5e4c2f=_0x1eb37e[_0xd54a('0x50')][_0xd54a('0x23')]({'plain':!![]});if(!_0x5e4c2f)throw new Error(_0xd54a('0x59'));if(_0x5e4c2f[_0xd54a('0x4f')]===_0xd54a('0x50')){var _0x6b2033=_0x1fc6c2[_0xd54a('0x23')]({'plain':!![]});var _0x444888=[{'name':_0xd54a('0x24'),'value':'inbound'},{'name':_0xd54a('0x25'),'value':_0xd54a('0x26')}];var _0x2b9aeb=_[_0xd54a('0x2c')](_0x444888,['value',_0x6b2033[_0xd54a('0x2b')]])[_0xd54a('0x2d')];return db[_0xd54a('0x52')][_0xd54a('0x2c')]({'where':{'name':_0x2b9aeb,'userProfileId':_0x5e4c2f[_0xd54a('0x53')]},'raw':!![]})[_0xd54a('0x21')](function(_0x2bf4e0){if(_0x2bf4e0&&_0x2bf4e0['autoAssociation']===0x0){return db[_0xd54a('0x2e')]['create']({'name':_0x6b2033[_0xd54a('0x2d')],'resourceId':_0x6b2033['id'],'type':_0x2bf4e0[_0xd54a('0x2d')],'sectionId':_0x2bf4e0['id']},{})['then'](function(){return _0x1fc6c2;});}else{return _0x1fc6c2;}})[_0xd54a('0x49')](function(_0x5da170){logger[_0xd54a('0x55')](_0xd54a('0x56'),_0x5da170);throw _0x5da170;});}return _0x1fc6c2;});}})[_0xd54a('0x21')](respondWithResult(_0x2d7d31,0xc9))[_0xd54a('0x49')](handleError(_0x2d7d31,null));};exports[_0xd54a('0x20')]=function(_0x2f9b8c,_0x437a18){if(_0x2f9b8c[_0xd54a('0x4e')]['id']){delete _0x2f9b8c[_0xd54a('0x4e')]['id'];}return db[_0xd54a('0x30')][_0xd54a('0x2c')]({'where':{'id':_0x2f9b8c[_0xd54a('0x4b')]['id']}})[_0xd54a('0x21')](handleEntityNotFound(_0x437a18,null))[_0xd54a('0x21')](saveUpdates(_0x2f9b8c[_0xd54a('0x4e')],null))['then'](respondWithResult(_0x437a18,null))['catch'](handleError(_0x437a18,null));};exports['destroy']=function(_0x57fb0b,_0x21d112){return db[_0xd54a('0x30')][_0xd54a('0x2c')]({'where':{'id':_0x57fb0b[_0xd54a('0x4b')]['id']}})[_0xd54a('0x21')](handleEntityNotFound(_0x21d112,null))['then'](removeEntity(_0x21d112,null))[_0xd54a('0x49')](handleError(_0x21d112,null));};exports[_0xd54a('0x5a')]=function(_0x3586f3,_0x12d9f5,_0x558bad){var _0x45f662={'raw':![],'where':{}};var _0x1db954={};var _0x3b1562={'count':0x0,'rows':[]};return db[_0xd54a('0x30')][_0xd54a('0x5b')]({'where':{'id':_0x3586f3[_0xd54a('0x4b')]['id']}})[_0xd54a('0x21')](handleEntityNotFound(_0x12d9f5,null))[_0xd54a('0x21')](function(_0x10091d){if(_0x10091d){_0x1db954[_0xd54a('0x36')]=_[_0xd54a('0x33')](db['CmHopper'][_0xd54a('0x31')]);_0x1db954[_0xd54a('0x32')]=_[_0xd54a('0x33')](_0x3586f3['query']);_0x1db954[_0xd54a('0x34')]=_[_0xd54a('0x35')](_0x1db954[_0xd54a('0x36')],_0x1db954[_0xd54a('0x32')]);_0x45f662[_0xd54a('0x38')]=_['intersection'](_0x1db954[_0xd54a('0x36')],qs['fields'](_0x3586f3[_0xd54a('0x32')][_0xd54a('0x37')]));_0x45f662[_0xd54a('0x38')]=_0x45f662[_0xd54a('0x38')][_0xd54a('0x39')]?_0x45f662[_0xd54a('0x38')]:_0x1db954['model'];if(!_0x3586f3['query'][_0xd54a('0x3a')](_0xd54a('0x3b'))){_0x45f662[_0xd54a('0x1b')]=qs[_0xd54a('0x1b')](_0x3586f3[_0xd54a('0x32')][_0xd54a('0x1b')]);_0x45f662[_0xd54a('0x1a')]=qs[_0xd54a('0x1a')](_0x3586f3[_0xd54a('0x32')][_0xd54a('0x1a')]);}_0x45f662[_0xd54a('0x3c')]=qs[_0xd54a('0x3d')](_0x3586f3[_0xd54a('0x32')]['sort']);_0x45f662['where']=qs[_0xd54a('0x34')](_[_0xd54a('0x3f')](_0x3586f3['query'],_0x1db954[_0xd54a('0x34')]));_0x45f662[_0xd54a('0x3e')]['VoiceQueueId']=_0x10091d['id'];if(_0x3586f3[_0xd54a('0x32')][_0xd54a('0x40')]){_0x45f662[_0xd54a('0x3e')]=_[_0xd54a('0x41')](_0x45f662[_0xd54a('0x3e')],{'$or':_[_0xd54a('0x28')](_0x45f662[_0xd54a('0x38')],function(_0x3ff9ac){var _0x5182f7={};_0x5182f7[_0x3ff9ac]={'$like':'%'+_0x3586f3[_0xd54a('0x32')]['filter']+'%'};return _0x5182f7;})});}_0x45f662=_['merge']({},_0x45f662,_0x3586f3[_0xd54a('0x4c')]);return db[_0xd54a('0x5c')][_0xd54a('0x19')]({'where':_0x45f662['where']})['then'](function(_0x4fad73){_0x3b1562['count']=_0x4fad73;if(_0x3586f3[_0xd54a('0x32')][_0xd54a('0x45')]){_0x45f662[_0xd54a('0x46')]=[{'all':!![]}];}return db[_0xd54a('0x5c')][_0xd54a('0x47')](_0x45f662);})[_0xd54a('0x21')](function(_0xbc8e54){_0x3b1562[_0xd54a('0x48')]=_0xbc8e54;return _0x3b1562;});}})[_0xd54a('0x21')](respondWithFilteredResult(_0x12d9f5,_0x45f662))[_0xd54a('0x49')](handleError(_0x12d9f5,null));};exports[_0xd54a('0x5d')]=function(_0x153d5b,_0x31c13e,_0x24b468){var _0x565b72={'raw':!![],'where':{}};var _0x43f58b={};var _0x563326={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xd54a('0x5b')]({'where':{'id':_0x153d5b['params']['id']}})[_0xd54a('0x21')](handleEntityNotFound(_0x31c13e,null))[_0xd54a('0x21')](function(_0x1ab718){if(_0x1ab718){_0x43f58b[_0xd54a('0x36')]=_[_0xd54a('0x33')](db[_0xd54a('0x5e')][_0xd54a('0x31')]);_0x43f58b['query']=_[_0xd54a('0x33')](_0x153d5b[_0xd54a('0x32')]);_0x43f58b[_0xd54a('0x34')]=_[_0xd54a('0x35')](_0x43f58b[_0xd54a('0x36')],_0x43f58b[_0xd54a('0x32')]);_0x565b72[_0xd54a('0x38')]=_[_0xd54a('0x35')](_0x43f58b[_0xd54a('0x36')],qs[_0xd54a('0x37')](_0x153d5b[_0xd54a('0x32')][_0xd54a('0x37')]));_0x565b72[_0xd54a('0x38')]=_0x565b72['attributes'][_0xd54a('0x39')]?_0x565b72[_0xd54a('0x38')]:_0x43f58b[_0xd54a('0x36')];if(!_0x153d5b[_0xd54a('0x32')][_0xd54a('0x3a')](_0xd54a('0x3b'))){_0x565b72[_0xd54a('0x1b')]=qs[_0xd54a('0x1b')](_0x153d5b[_0xd54a('0x32')][_0xd54a('0x1b')]);_0x565b72[_0xd54a('0x1a')]=qs['offset'](_0x153d5b[_0xd54a('0x32')][_0xd54a('0x1a')]);}_0x565b72['order']=qs[_0xd54a('0x3d')](_0x153d5b[_0xd54a('0x32')]['sort']);_0x565b72[_0xd54a('0x3e')]=qs[_0xd54a('0x34')](_['pick'](_0x153d5b['query'],_0x43f58b[_0xd54a('0x34')]));_0x565b72[_0xd54a('0x3e')][_0xd54a('0x5f')]=_0x1ab718['id'];if(_0x153d5b[_0xd54a('0x32')][_0xd54a('0x40')]){_0x565b72[_0xd54a('0x3e')]=_[_0xd54a('0x41')](_0x565b72[_0xd54a('0x3e')],{'$or':_[_0xd54a('0x28')](_0x565b72[_0xd54a('0x38')],function(_0x1073d5){var _0x3949f0={};_0x3949f0[_0x1073d5]={'$like':'%'+_0x153d5b[_0xd54a('0x32')][_0xd54a('0x40')]+'%'};return _0x3949f0;})});}_0x565b72=_[_0xd54a('0x41')]({},_0x565b72,_0x153d5b[_0xd54a('0x4c')]);return db[_0xd54a('0x5e')][_0xd54a('0x19')]({'where':_0x565b72['where']})[_0xd54a('0x21')](function(_0x45f663){_0x563326[_0xd54a('0x19')]=_0x45f663;if(_0x153d5b[_0xd54a('0x32')][_0xd54a('0x45')]){_0x565b72[_0xd54a('0x46')]=[{'all':!![]}];}return db[_0xd54a('0x5e')][_0xd54a('0x47')](_0x565b72);})[_0xd54a('0x21')](function(_0x50c0fe){_0x563326[_0xd54a('0x48')]=_0x50c0fe;return _0x563326;});}})[_0xd54a('0x21')](respondWithFilteredResult(_0x31c13e,_0x565b72))[_0xd54a('0x49')](handleError(_0x31c13e,null));};exports[_0xd54a('0x60')]=function(_0x36d703,_0x244870,_0x517908){var _0x4344fe={'raw':!![],'where':{}};var _0x1b33b3={};var _0x41fd30={'count':0x0,'rows':[]};return db[_0xd54a('0x30')][_0xd54a('0x5b')]({'where':{'id':_0x36d703['params']['id']}})[_0xd54a('0x21')](handleEntityNotFound(_0x244870,null))['then'](function(_0x4f351a){if(_0x4f351a){_0x1b33b3[_0xd54a('0x36')]=_[_0xd54a('0x33')](db['CmHopperFinal'][_0xd54a('0x31')]);_0x1b33b3['query']=_[_0xd54a('0x33')](_0x36d703['query']);_0x1b33b3[_0xd54a('0x34')]=_[_0xd54a('0x35')](_0x1b33b3[_0xd54a('0x36')],_0x1b33b3[_0xd54a('0x32')]);_0x4344fe[_0xd54a('0x38')]=_[_0xd54a('0x35')](_0x1b33b3[_0xd54a('0x36')],qs[_0xd54a('0x37')](_0x36d703[_0xd54a('0x32')][_0xd54a('0x37')]));_0x4344fe['attributes']=_0x4344fe[_0xd54a('0x38')]['length']?_0x4344fe['attributes']:_0x1b33b3[_0xd54a('0x36')];if(!_0x36d703['query'][_0xd54a('0x3a')](_0xd54a('0x3b'))){_0x4344fe[_0xd54a('0x1b')]=qs[_0xd54a('0x1b')](_0x36d703['query']['limit']);_0x4344fe['offset']=qs[_0xd54a('0x1a')](_0x36d703[_0xd54a('0x32')][_0xd54a('0x1a')]);}_0x4344fe[_0xd54a('0x3c')]=qs['sort'](_0x36d703[_0xd54a('0x32')][_0xd54a('0x3d')]);_0x4344fe[_0xd54a('0x3e')]=qs[_0xd54a('0x34')](_[_0xd54a('0x3f')](_0x36d703[_0xd54a('0x32')],_0x1b33b3[_0xd54a('0x34')]));_0x4344fe[_0xd54a('0x3e')][_0xd54a('0x5f')]=_0x4f351a['id'];if(_0x36d703['query'][_0xd54a('0x40')]){_0x4344fe['where']=_[_0xd54a('0x41')](_0x4344fe['where'],{'$or':_[_0xd54a('0x28')](_0x4344fe[_0xd54a('0x38')],function(_0x32d3f6){var _0x454ff4={};_0x454ff4[_0x32d3f6]={'$like':'%'+_0x36d703[_0xd54a('0x32')][_0xd54a('0x40')]+'%'};return _0x454ff4;})});}_0x4344fe=_[_0xd54a('0x41')]({},_0x4344fe,_0x36d703[_0xd54a('0x4c')]);return db[_0xd54a('0x61')][_0xd54a('0x19')]({'where':_0x4344fe[_0xd54a('0x3e')]})[_0xd54a('0x21')](function(_0x32ffea){_0x41fd30['count']=_0x32ffea;if(_0x36d703[_0xd54a('0x32')][_0xd54a('0x45')]){_0x4344fe['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xd54a('0x47')](_0x4344fe);})[_0xd54a('0x21')](function(_0x938d8f){_0x41fd30[_0xd54a('0x48')]=_0x938d8f;return _0x41fd30;});}})['then'](respondWithFilteredResult(_0x244870,_0x4344fe))[_0xd54a('0x49')](handleError(_0x244870,null));};exports[_0xd54a('0x62')]=function(_0x2ce0c8,_0x3ad08c,_0x335c08){var _0x38cedf={'raw':!![],'where':{}};var _0x433334={};var _0x17b12a={'count':0x0,'rows':[]};return db[_0xd54a('0x30')][_0xd54a('0x5b')]({'where':{'id':_0x2ce0c8[_0xd54a('0x4b')]['id']}})[_0xd54a('0x21')](handleEntityNotFound(_0x3ad08c,null))[_0xd54a('0x21')](function(_0x55f532){if(_0x55f532){_0x433334[_0xd54a('0x36')]=_[_0xd54a('0x33')](db[_0xd54a('0x63')][_0xd54a('0x31')]);_0x433334[_0xd54a('0x32')]=_[_0xd54a('0x33')](_0x2ce0c8[_0xd54a('0x32')]);_0x433334[_0xd54a('0x34')]=_[_0xd54a('0x35')](_0x433334[_0xd54a('0x36')],_0x433334[_0xd54a('0x32')]);_0x38cedf[_0xd54a('0x38')]=_[_0xd54a('0x35')](_0x433334[_0xd54a('0x36')],qs[_0xd54a('0x37')](_0x2ce0c8['query'][_0xd54a('0x37')]));_0x38cedf[_0xd54a('0x38')]=_0x38cedf[_0xd54a('0x38')][_0xd54a('0x39')]?_0x38cedf[_0xd54a('0x38')]:_0x433334[_0xd54a('0x36')];if(!_0x2ce0c8[_0xd54a('0x32')]['hasOwnProperty']('nolimit')){_0x38cedf[_0xd54a('0x1b')]=qs['limit'](_0x2ce0c8['query'][_0xd54a('0x1b')]);_0x38cedf['offset']=qs['offset'](_0x2ce0c8[_0xd54a('0x32')]['offset']);}_0x38cedf[_0xd54a('0x3c')]=qs[_0xd54a('0x3d')](_0x2ce0c8['query'][_0xd54a('0x3d')]);_0x38cedf[_0xd54a('0x3e')]=qs['filters'](_[_0xd54a('0x3f')](_0x2ce0c8[_0xd54a('0x32')],_0x433334[_0xd54a('0x34')]));_0x38cedf[_0xd54a('0x3e')]['VoiceQueueId']=_0x55f532['id'];if(_0x2ce0c8[_0xd54a('0x32')][_0xd54a('0x40')]){_0x38cedf['where']=_[_0xd54a('0x41')](_0x38cedf[_0xd54a('0x3e')],{'$or':_[_0xd54a('0x28')](_0x38cedf[_0xd54a('0x38')],function(_0x340aa8){var _0x414d3c={};_0x414d3c[_0x340aa8]={'$like':'%'+_0x2ce0c8['query'][_0xd54a('0x40')]+'%'};return _0x414d3c;})});}_0x38cedf=_['merge']({},_0x38cedf,_0x2ce0c8[_0xd54a('0x4c')]);return db['CmHopperBlack'][_0xd54a('0x19')]({'where':_0x38cedf[_0xd54a('0x3e')]})[_0xd54a('0x21')](function(_0x5437e9){_0x17b12a[_0xd54a('0x19')]=_0x5437e9;if(_0x2ce0c8[_0xd54a('0x32')]['includeAll']){_0x38cedf[_0xd54a('0x46')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x38cedf);})[_0xd54a('0x21')](function(_0x151b3c){_0x17b12a['rows']=_0x151b3c;return _0x17b12a;});}})[_0xd54a('0x21')](respondWithFilteredResult(_0x3ad08c,_0x38cedf))[_0xd54a('0x49')](handleError(_0x3ad08c,null));};exports[_0xd54a('0x64')]=function(_0x47be71,_0x45af00,_0x2082bf){var _0xd59466={};var _0x3fe52c={};var _0x15e63c;var _0xe6c862;return db[_0xd54a('0x30')]['findOne']({'where':{'id':_0x47be71['params']['id']}})[_0xd54a('0x21')](handleEntityNotFound(_0x45af00,null))[_0xd54a('0x21')](function(_0x5cc9f5){if(_0x5cc9f5){_0x15e63c=_0x5cc9f5;_0x3fe52c[_0xd54a('0x36')]=_['keys'](db['Team'][_0xd54a('0x31')]);_0x3fe52c[_0xd54a('0x32')]=_[_0xd54a('0x33')](_0x47be71[_0xd54a('0x32')]);_0x3fe52c['filters']=_[_0xd54a('0x35')](_0x3fe52c[_0xd54a('0x36')],_0x3fe52c[_0xd54a('0x32')]);_0xd59466[_0xd54a('0x38')]=_[_0xd54a('0x35')](_0x3fe52c['model'],qs[_0xd54a('0x37')](_0x47be71[_0xd54a('0x32')][_0xd54a('0x37')]));_0xd59466[_0xd54a('0x38')]=_0xd59466['attributes'][_0xd54a('0x39')]?_0xd59466[_0xd54a('0x38')]:_0x3fe52c['model'];_0xd59466['order']=qs[_0xd54a('0x3d')](_0x47be71[_0xd54a('0x32')][_0xd54a('0x3d')]);_0xd59466['where']=qs[_0xd54a('0x34')](_[_0xd54a('0x3f')](_0x47be71['query'],_0x3fe52c[_0xd54a('0x34')]));if(_0x47be71[_0xd54a('0x32')][_0xd54a('0x40')]){_0xd59466[_0xd54a('0x3e')]=_[_0xd54a('0x41')](_0xd59466['where'],{'$or':_[_0xd54a('0x28')](_0xd59466['attributes'],function(_0x52e5e9){var _0x46d42e={};_0x46d42e[_0x52e5e9]={'$like':'%'+_0x47be71[_0xd54a('0x32')][_0xd54a('0x40')]+'%'};return _0x46d42e;})});}_0xd59466=_[_0xd54a('0x41')]({},_0xd59466,_0x47be71['options']);return _0x15e63c[_0xd54a('0x64')](_0xd59466);}})[_0xd54a('0x21')](function(_0x45bae7){if(_0x45bae7){_0xe6c862=_0x45bae7[_0xd54a('0x39')];if(!_0x47be71[_0xd54a('0x32')][_0xd54a('0x3a')](_0xd54a('0x3b'))){_0xd59466[_0xd54a('0x1b')]=qs[_0xd54a('0x1b')](_0x47be71[_0xd54a('0x32')][_0xd54a('0x1b')]);_0xd59466[_0xd54a('0x1a')]=qs[_0xd54a('0x1a')](_0x47be71[_0xd54a('0x32')][_0xd54a('0x1a')]);}return _0x15e63c[_0xd54a('0x64')](_0xd59466);}})['then'](function(_0x58bb50){if(_0x58bb50){return _0x58bb50?{'count':_0xe6c862,'rows':_0x58bb50}:null;}})[_0xd54a('0x21')](respondWithResult(_0x45af00,null))[_0xd54a('0x49')](handleError(_0x45af00,null));};exports[_0xd54a('0x65')]=function(_0x49a447,_0x5a28d2,_0x1ba688){var _0x40917e=_0x49a447[_0xd54a('0x4e')][_0xd54a('0x66')];return db['Team'][_0xd54a('0x47')]({'where':{'id':_[_0xd54a('0x28')](_0x40917e,'id')},'attributes':['id'],'include':[{'model':db[_0xd54a('0x67')],'as':_0xd54a('0x68'),'attributes':['id','name',_0xd54a('0x69'),_0xd54a('0x6a'),_0xd54a('0x6b')],'raw':!![]}]})[_0xd54a('0x21')](function(_0x5c21cf){if(_0x5c21cf){var _0x130f5e=_[_0xd54a('0x6c')](_0x5c21cf,function(_0x22e554){var _0x2c8853=_0x22e554[_0xd54a('0x23')]({'plain':!![]});_0x2c8853['Agents']['forEach'](function(_0x13534b){_0x13534b[_0xd54a('0x6d')]=_[_0xd54a('0x2c')](_0x40917e,{'id':_0x2c8853['id']})['penalty'];});return _0x2c8853[_0xd54a('0x68')];});return db[_0xd54a('0x30')]['find']({'where':{'id':_0x49a447['params']['id']}})['then'](function(_0x14b671){return db['sequelize'][_0xd54a('0x6e')](function(_0x16a80f){return _0x14b671['addTeams'](_[_0xd54a('0x28')](_0x40917e,'id'),{'transaction':_0x16a80f})[_0xd54a('0x21')](function(){return BPromise[_0xd54a('0x6f')](_0x130f5e,function(_0x57e16c){return db[_0xd54a('0x70')][_0xd54a('0x71')]({'where':{'UserId':_0x57e16c['id'],'VoiceQueueId':_0x49a447['params']['id']},'defaults':{'penalty':_0x57e16c['penalty']},'transaction':_0x16a80f});});})[_0xd54a('0x21')](function(){return BPromise[_0xd54a('0x6f')](_[_0xd54a('0x40')](_0x130f5e,{'online':!![]}),function(_0x38c66f){return db[_0xd54a('0x72')][_0xd54a('0x73')]({'membername':_0x38c66f[_0xd54a('0x2d')],'UserId':_0x38c66f['id'],'queue_name':_0x14b671[_0xd54a('0x2d')],'VoiceQueueId':_0x14b671['id'],'interface':_[_0xd54a('0x74')](_0x38c66f[_0xd54a('0x6b')])?util[_0xd54a('0x75')](_0xd54a('0x76'),_0x38c66f[_0xd54a('0x2d')]):_0x38c66f[_0xd54a('0x6b')],'paused':_0x38c66f[_0xd54a('0x6a')]||![],'penalty':_0x38c66f[_0xd54a('0x6d')]},{'transaction':_0x16a80f});});})[_0xd54a('0x21')](function(){_0x130f5e['forEach'](function(_0x3e9af){socket[_0xd54a('0x77')](_0xd54a('0x78'),{'UserId':_0x3e9af['id'],'VoiceQueueId':_0x14b671['id']});});});});});}})[_0xd54a('0x21')](respondWithStatusCode(_0x5a28d2,null))['catch'](handleError(_0x5a28d2,null));};exports[_0xd54a('0x79')]=function(_0x5113f6,_0x438258,_0x533e43){return db[_0xd54a('0x7a')][_0xd54a('0x47')]({'where':{'id':_0x5113f6[_0xd54a('0x32')][_0xd54a('0x7b')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd54a('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x438258,null))[_0xd54a('0x21')](function(_0x3ddb4b){var _0x124cc6=_[_0xd54a('0x28')](_0x3ddb4b,'id');var _0x4c0401=[];var _0x32dac2=[];var _0x554d3c=squel[_0xd54a('0x7c')]();_0x554d3c[_0xd54a('0x44')]('tq.TeamId')[_0xd54a('0x7d')](_0xd54a('0x7e'),'tq')[_0xd54a('0x7f')](_0xd54a('0x80'),'ut',_0xd54a('0x81'))['where'](_0xd54a('0x82'),_0x5113f6[_0xd54a('0x4b')]['id']);for(var _0xc46449=0x0;_0xc46449<_0x3ddb4b[_0xd54a('0x39')];_0xc46449+=0x1){let _0x2278ba=_0x3ddb4b[_0xc46449];for(var _0x5360ee=0x0;_0x5360ee<_0x2278ba[_0xd54a('0x68')]['length'];_0x5360ee+=0x1){let _0xeec048=_0x2278ba[_0xd54a('0x68')][_0x5360ee];var _0x1f437a=_0x554d3c['clone']();_0x1f437a[_0xd54a('0x3e')](_0xd54a('0x83'),_0xeec048['id']);_0x32dac2[_0xd54a('0x84')](db[_0xd54a('0x85')][_0xd54a('0x32')](_0x1f437a['toString'](),{'type':db[_0xd54a('0x85')][_0xd54a('0x86')][_0xd54a('0x87')]})['then'](function(_0x29b85c){if(_0x29b85c[_0xd54a('0x39')]===0x1){return _0xeec048['id'];}else{var _0x24ec2e=_['every'](_[_0xd54a('0x28')](_0x29b85c,_0xd54a('0x88')),function(_0x2526b6){return _[_0xd54a('0x2a')](_0x124cc6,_0x2526b6);});if(_0x24ec2e){return _0xeec048['id'];}}}));}}return BPromise['all'](_0x32dac2)[_0xd54a('0x21')](function(_0x1b6ad3){_0x4c0401=_(_0x4c0401)[_0xd54a('0x89')](_0x1b6ad3)[_0xd54a('0x8a')]()[_0xd54a('0x29')]();return db['VoiceQueue'][_0xd54a('0x2c')]({'where':{'id':_0x5113f6[_0xd54a('0x4b')]['id']}})['then'](function(_0x17a106){return db[_0xd54a('0x85')]['transaction'](function(_0x14ca0f){return _0x17a106[_0xd54a('0x79')](_0x5113f6[_0xd54a('0x32')]['ids'],{'transaction':_0x14ca0f})[_0xd54a('0x21')](function(){if(!_[_0xd54a('0x8b')](_0x4c0401)){return _0x17a106[_0xd54a('0x8c')](_0x4c0401,{'transaction':_0x14ca0f})[_0xd54a('0x21')](function(){return db[_0xd54a('0x72')][_0xd54a('0x22')]({'where':{'VoiceQueueId':_0x5113f6[_0xd54a('0x4b')]['id'],'UserId':_0x4c0401},'transaction':_0x14ca0f});});}})[_0xd54a('0x21')](function(){_0x4c0401[_0xd54a('0x8d')](function(_0x42f0c2){socket[_0xd54a('0x77')]('userVoiceQueue:remove',{'UserId':_0x42f0c2,'VoiceQueueId':_0x17a106['id']});});});});});});})[_0xd54a('0x21')](respondWithStatusCode(_0x438258,null))[_0xd54a('0x49')](handleError(_0x438258,null));};exports[_0xd54a('0x8e')]=function(_0x227a3f,_0x46e57d,_0x11ae21){var _0x398fff,_0x19b0bb;return db[_0xd54a('0x30')][_0xd54a('0x2c')]({'where':{'id':_0x227a3f[_0xd54a('0x4b')]['id']}})[_0xd54a('0x21')](handleEntityNotFound(_0x46e57d,null))[_0xd54a('0x21')](function(_0x10209b){if(_0x10209b){_0x19b0bb=_0x10209b;return _0x10209b['addAgents'](_0x227a3f[_0xd54a('0x4e')][_0xd54a('0x7b')],_[_0xd54a('0x57')](_0x227a3f[_0xd54a('0x4e')],[_0xd54a('0x7b'),'id'])||{})[_0xd54a('0x8f')](function(_0x2c747b){for(var _0x4ad421=0x0;_0x4ad421<_0x227a3f[_0xd54a('0x4e')][_0xd54a('0x7b')][_0xd54a('0x39')];_0x4ad421+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':_0x227a3f['body'][_0xd54a('0x7b')][_0x4ad421],'VoiceQueueId':_0x227a3f['params']['id']});}return _0x2c747b;});}})['then'](function(_0x322024){_0x398fff=_0x322024||[];if(_0x19b0bb){return db[_0xd54a('0x67')][_0xd54a('0x47')]({'where':{'id':_0x227a3f['body'][_0xd54a('0x7b')]},'attributes':['id',_0xd54a('0x2d'),'online','voicePause',_0xd54a('0x6b')],'raw':!![]});}})[_0xd54a('0x21')](function(_0x1f45d6){if(!_[_0xd54a('0x8b')](_0x1f45d6)){var _0x4e5054=[];for(var _0x5d8a23=0x0;_0x5d8a23<_0x1f45d6['length'];_0x5d8a23++){if(_0x1f45d6[_0x5d8a23][_0xd54a('0x69')]){_0x4e5054['push'](db['UserVoiceQueueRt'][_0xd54a('0x73')]({'membername':_0x1f45d6[_0x5d8a23][_0xd54a('0x2d')],'UserId':_0x1f45d6[_0x5d8a23]['id'],'queue_name':_0x19b0bb['name'],'VoiceQueueId':_0x19b0bb['id'],'interface':_[_0xd54a('0x74')](_0x1f45d6[_0x5d8a23]['interface'])?util[_0xd54a('0x75')](_0xd54a('0x76'),_0x1f45d6[_0x5d8a23][_0xd54a('0x2d')]):_0x1f45d6[_0x5d8a23][_0xd54a('0x6b')],'paused':_0x1f45d6[_0x5d8a23][_0xd54a('0x6a')]||![],'penalty':_0x227a3f[_0xd54a('0x4e')][_0xd54a('0x6d')]||0x0}));}}return BPromise[_0xd54a('0x90')](_0x4e5054);}})[_0xd54a('0x21')](function(){return _0x398fff;})[_0xd54a('0x21')](respondWithResult(_0x46e57d,null))[_0xd54a('0x49')](handleError(_0x46e57d,null));};exports[_0xd54a('0x8c')]=function(_0x3a0269,_0x5e8b77,_0x4d2069){return db[_0xd54a('0x30')][_0xd54a('0x2c')]({'where':{'id':_0x3a0269[_0xd54a('0x4b')]['id']}})[_0xd54a('0x21')](handleEntityNotFound(_0x5e8b77,null))[_0xd54a('0x21')](function(_0x357555){if(_0x357555){return _0x357555[_0xd54a('0x8c')](_0x3a0269[_0xd54a('0x32')]['ids'])[_0xd54a('0x21')](function(){if(_[_0xd54a('0x91')](_0x3a0269[_0xd54a('0x32')][_0xd54a('0x7b')])){for(var _0x484630=0x0;_0x484630<_0x3a0269['query'][_0xd54a('0x7b')][_0xd54a('0x39')];_0x484630+=0x1){socket[_0xd54a('0x77')](_0xd54a('0x92'),{'UserId':Number(_0x3a0269[_0xd54a('0x32')][_0xd54a('0x7b')][_0x484630]),'VoiceQueueId':Number(_0x3a0269['params']['id'])});}}else{socket[_0xd54a('0x77')]('userVoiceQueue:remove',{'UserId':Number(_0x3a0269[_0xd54a('0x32')][_0xd54a('0x7b')]),'VoiceQueueId':Number(_0x3a0269[_0xd54a('0x4b')]['id'])});}});}})[_0xd54a('0x21')](function(_0x2b7aaf){return db[_0xd54a('0x72')][_0xd54a('0x22')]({'where':{'VoiceQueueId':_0x3a0269[_0xd54a('0x4b')]['id'],'UserId':_0x3a0269[_0xd54a('0x32')]['ids']}})['then'](function(){return _0x2b7aaf;});})[_0xd54a('0x21')](respondWithStatusCode(_0x5e8b77,null))[_0xd54a('0x49')](handleError(_0x5e8b77,null));};exports[_0xd54a('0x93')]=function(_0x10f112,_0x77587c,_0x27eaf4){var _0x3e0eca={};var _0x81c095={};var _0x55869c;var _0xd29cd8;return db[_0xd54a('0x30')][_0xd54a('0x5b')]({'where':{'id':_0x10f112[_0xd54a('0x4b')]['id']}})[_0xd54a('0x21')](handleEntityNotFound(_0x77587c,null))[_0xd54a('0x21')](function(_0x32dbb2){if(_0x32dbb2){_0x55869c=_0x32dbb2;_0x81c095[_0xd54a('0x36')]=_[_0xd54a('0x33')](db['User'][_0xd54a('0x31')]);_0x81c095[_0xd54a('0x32')]=_['keys'](_0x10f112[_0xd54a('0x32')]);_0x81c095[_0xd54a('0x34')]=_[_0xd54a('0x35')](_0x81c095[_0xd54a('0x36')],_0x81c095['query']);_0x3e0eca['attributes']=_[_0xd54a('0x35')](_0x81c095[_0xd54a('0x36')],qs[_0xd54a('0x37')](_0x10f112[_0xd54a('0x32')][_0xd54a('0x37')]));_0x3e0eca[_0xd54a('0x38')]=_0x3e0eca[_0xd54a('0x38')][_0xd54a('0x39')]?_0x3e0eca[_0xd54a('0x38')]:_0x81c095['model'];_0x3e0eca[_0xd54a('0x3c')]=qs[_0xd54a('0x3d')](_0x10f112['query'][_0xd54a('0x3d')]);_0x3e0eca[_0xd54a('0x3e')]=qs['filters'](_['pick'](_0x10f112[_0xd54a('0x32')],_0x81c095[_0xd54a('0x34')]));if(_0x10f112['query']['filter']){_0x3e0eca[_0xd54a('0x3e')]=_[_0xd54a('0x41')](_0x3e0eca[_0xd54a('0x3e')],{'$or':_['map'](_0x3e0eca[_0xd54a('0x38')],function(_0x1eeb0e){var _0x46314c={};_0x46314c[_0x1eeb0e]={'$like':'%'+_0x10f112['query']['filter']+'%'};return _0x46314c;})});}_0x3e0eca=_[_0xd54a('0x41')]({},_0x3e0eca,_0x10f112[_0xd54a('0x4c')]);return _0x55869c[_0xd54a('0x93')](_0x3e0eca);}})[_0xd54a('0x21')](function(_0x2884ab){if(_0x2884ab){_0xd29cd8=_0x2884ab[_0xd54a('0x39')];if(!_0x10f112[_0xd54a('0x32')]['hasOwnProperty'](_0xd54a('0x3b'))){_0x3e0eca[_0xd54a('0x1b')]=qs[_0xd54a('0x1b')](_0x10f112[_0xd54a('0x32')][_0xd54a('0x1b')]);_0x3e0eca[_0xd54a('0x1a')]=qs['offset'](_0x10f112[_0xd54a('0x32')][_0xd54a('0x1a')]);}return _0x55869c[_0xd54a('0x93')](_0x3e0eca);}})[_0xd54a('0x21')](function(_0x3bff24){if(_0x3bff24){return _0x3bff24?{'count':_0xd29cd8,'rows':_0x3bff24}:null;}})[_0xd54a('0x21')](respondWithResult(_0x77587c,null))['catch'](handleError(_0x77587c,null));};exports[_0xd54a('0x94')]=function(_0x310e27,_0x26f0da,_0x19eaef){var _0x3465b6={};var _0x533e87={};var _0x28a025;var _0x2d4b79;return db[_0xd54a('0x30')][_0xd54a('0x5b')]({'where':{'id':_0x310e27[_0xd54a('0x4b')]['id']}})[_0xd54a('0x21')](handleEntityNotFound(_0x26f0da,null))[_0xd54a('0x21')](function(_0x465f5d){if(_0x465f5d){_0x28a025=_0x465f5d;_0x533e87[_0xd54a('0x36')]=_[_0xd54a('0x33')](db[_0xd54a('0x72')][_0xd54a('0x31')]);_0x533e87[_0xd54a('0x32')]=_['keys'](_0x310e27[_0xd54a('0x32')]);_0x533e87[_0xd54a('0x34')]=_[_0xd54a('0x35')](_0x533e87[_0xd54a('0x36')],_0x533e87[_0xd54a('0x32')]);_0x3465b6[_0xd54a('0x38')]=_[_0xd54a('0x35')](_0x533e87[_0xd54a('0x36')],qs[_0xd54a('0x37')](_0x310e27[_0xd54a('0x32')][_0xd54a('0x37')]));_0x3465b6['attributes']=_0x3465b6[_0xd54a('0x38')][_0xd54a('0x39')]?_0x3465b6['attributes']:_0x533e87[_0xd54a('0x36')];_0x3465b6[_0xd54a('0x3c')]=qs['sort'](_0x310e27[_0xd54a('0x32')][_0xd54a('0x3d')]);_0x3465b6['where']=qs['filters'](_['pick'](_0x310e27[_0xd54a('0x32')],_0x533e87[_0xd54a('0x34')]));if(_0x310e27[_0xd54a('0x32')][_0xd54a('0x40')]){_0x3465b6[_0xd54a('0x3e')]=_['merge'](_0x3465b6['where'],{'$or':_[_0xd54a('0x28')](_0x3465b6[_0xd54a('0x38')],function(_0x3c39cb){var _0x5245b8={};_0x5245b8[_0x3c39cb]={'$like':'%'+_0x310e27[_0xd54a('0x32')][_0xd54a('0x40')]+'%'};return _0x5245b8;})});}_0x3465b6=_[_0xd54a('0x41')]({},_0x3465b6,_0x310e27['options']);return _0x28a025['getMembers'](_0x3465b6);}})['then'](function(_0x59a5b3){if(_0x59a5b3){_0x2d4b79=_0x59a5b3['length'];if(!_0x310e27[_0xd54a('0x32')][_0xd54a('0x3a')](_0xd54a('0x3b'))){_0x3465b6[_0xd54a('0x1b')]=qs[_0xd54a('0x1b')](_0x310e27[_0xd54a('0x32')][_0xd54a('0x1b')]);_0x3465b6[_0xd54a('0x1a')]=qs[_0xd54a('0x1a')](_0x310e27[_0xd54a('0x32')][_0xd54a('0x1a')]);}return _0x28a025[_0xd54a('0x94')](_0x3465b6);}})[_0xd54a('0x21')](function(_0x34d37d){return _0x34d37d?{'count':_0x2d4b79,'rows':_0x34d37d}:null;})['then'](respondWithResult(_0x26f0da,null))[_0xd54a('0x49')](handleError(_0x26f0da,null));};exports[_0xd54a('0x95')]=function(_0x3e3616,_0x5a6d9d,_0xf9ce8c){var _0x3e79de={};var _0xbb29ce={};var _0x5e4cb7;var _0x4c88ea;return db['VoiceQueue'][_0xd54a('0x5b')]({'where':{'id':_0x3e3616[_0xd54a('0x4b')]['id']}})[_0xd54a('0x21')](handleEntityNotFound(_0x5a6d9d,null))[_0xd54a('0x21')](function(_0x4ab022){if(_0x4ab022){_0x5e4cb7=_0x4ab022;_0xbb29ce['model']=_[_0xd54a('0x33')](db[_0xd54a('0x96')][_0xd54a('0x31')]);_0xbb29ce[_0xd54a('0x32')]=_[_0xd54a('0x33')](_0x3e3616[_0xd54a('0x32')]);_0xbb29ce['filters']=_[_0xd54a('0x35')](_0xbb29ce['model'],_0xbb29ce[_0xd54a('0x32')]);_0x3e79de[_0xd54a('0x38')]=_['intersection'](_0xbb29ce[_0xd54a('0x36')],qs[_0xd54a('0x37')](_0x3e3616[_0xd54a('0x32')][_0xd54a('0x37')]));_0x3e79de['attributes']=_0x3e79de['attributes']['length']?_0x3e79de[_0xd54a('0x38')]:_0xbb29ce[_0xd54a('0x36')];_0x3e79de['order']=qs[_0xd54a('0x3d')](_0x3e3616[_0xd54a('0x32')][_0xd54a('0x3d')]);_0x3e79de[_0xd54a('0x3e')]=qs[_0xd54a('0x34')](_['pick'](_0x3e3616['query'],_0xbb29ce[_0xd54a('0x34')]));if(_0x3e3616[_0xd54a('0x32')][_0xd54a('0x40')]){_0x3e79de[_0xd54a('0x3e')]=_['merge'](_0x3e79de[_0xd54a('0x3e')],{'$or':_['map'](_0x3e79de[_0xd54a('0x38')],function(_0x43e446){var _0x1278d3={};_0x1278d3[_0x43e446]={'$like':'%'+_0x3e3616[_0xd54a('0x32')][_0xd54a('0x40')]+'%'};return _0x1278d3;})});}_0x3e79de=_[_0xd54a('0x41')]({},_0x3e79de,_0x3e3616[_0xd54a('0x4c')]);return _0x5e4cb7['getLists'](_0x3e79de);}})['then'](function(_0x5073b3){if(_0x5073b3){_0x4c88ea=_0x5073b3[_0xd54a('0x39')];if(!_0x3e3616[_0xd54a('0x32')][_0xd54a('0x3a')](_0xd54a('0x3b'))){_0x3e79de['limit']=qs[_0xd54a('0x1b')](_0x3e3616['query'][_0xd54a('0x1b')]);_0x3e79de[_0xd54a('0x1a')]=qs[_0xd54a('0x1a')](_0x3e3616['query'][_0xd54a('0x1a')]);}return _0x5e4cb7[_0xd54a('0x95')](_0x3e79de);}})['then'](function(_0x2a8e56){if(_0x2a8e56){return _0x2a8e56?{'count':_0x4c88ea,'rows':_0x2a8e56}:null;}})[_0xd54a('0x21')](respondWithResult(_0x5a6d9d,null))[_0xd54a('0x49')](handleError(_0x5a6d9d,null));};exports[_0xd54a('0x97')]=function(_0x59be28,_0x263c36,_0x18b906){var _0x5ce945,_0x546b9e;return db[_0xd54a('0x30')][_0xd54a('0x2c')]({'where':{'id':_0x59be28[_0xd54a('0x4b')]['id']}})[_0xd54a('0x21')](handleEntityNotFound(_0x263c36,null))['then'](function(_0x4acdaf){if(_0x4acdaf){_0x546b9e=_0x4acdaf;return _0x4acdaf[_0xd54a('0x97')](_0x59be28['body'][_0xd54a('0x7b')],_[_0xd54a('0x57')](_0x59be28[_0xd54a('0x4e')],[_0xd54a('0x7b'),'id'])||{});}return null;})['spread'](function(_0x5341a4){var _0x4f8f4b;_0x5ce945=_0x5341a4||[];var _0x10e368=[];if(_0x5341a4){for(var _0x389e5c=0x0;_0x389e5c<_0x5341a4[_0xd54a('0x39')];_0x389e5c+=0x1){var _0x44d5d4=_0x5341a4[_0x389e5c]['get']({'plain':!![]});_0x546b9e[_0xd54a('0x98')]=_0x59be28[_0xd54a('0x4e')]['dialCheckDuplicateType']?_0x59be28[_0xd54a('0x4e')][_0xd54a('0x98')]:_0x546b9e[_0xd54a('0x98')];switch(_0x546b9e[_0xd54a('0x98')]){case _0xd54a('0x99'):_0x4f8f4b=squel[_0xd54a('0x9a')]()[_0xd54a('0x9b')](_0xd54a('0x9c'))['fromQuery'](['phone',_0xd54a('0x9d'),'ContactId',_0xd54a('0x9e'),_0xd54a('0x5f'),'createdAt',_0xd54a('0x9f')],squel[_0xd54a('0x7c')]()[_0xd54a('0x44')]('phone','phone')[_0xd54a('0x44')](_0xd54a('0xa0'),_0xd54a('0x9d'))[_0xd54a('0x44')]('id','ContactId')[_0xd54a('0x44')](_0x44d5d4[_0xd54a('0xa1')][_0xd54a('0xa2')](),_0xd54a('0x9e'))[_0xd54a('0x44')](_0x59be28['params']['id'][_0xd54a('0xa2')](),_0xd54a('0x5f'))[_0xd54a('0x44')]('NOW()',_0xd54a('0x58'))['field'](_0xd54a('0xa0'),'updatedAt')[_0xd54a('0x7d')](_0xd54a('0xa3'))['where'](_0xd54a('0xa4'))['where']('ListId\x20=\x20?',_0x44d5d4[_0xd54a('0xa1')][_0xd54a('0xa2')]())[_0xd54a('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0xd54a('0x3e')](_0xd54a('0xa5'),squel[_0xd54a('0x7c')]()[_0xd54a('0x44')](_0xd54a('0xa6'))[_0xd54a('0x7d')]('cm_hopper_final')[_0xd54a('0x3e')](_0xd54a('0x82'),_0x59be28[_0xd54a('0x4b')]['id'][_0xd54a('0xa2')]()))[_0xd54a('0x3e')](_0xd54a('0xa5'),squel[_0xd54a('0x7c')]()[_0xd54a('0x44')](_0xd54a('0xa7'))['from'](_0xd54a('0x9c'))[_0xd54a('0x3e')](_0xd54a('0x82'),_0x59be28[_0xd54a('0x4b')]['id'][_0xd54a('0xa2')]())))[_0xd54a('0xa2')]();break;case _0xd54a('0xa8'):_0x4f8f4b=squel[_0xd54a('0x9a')]()[_0xd54a('0x9b')](_0xd54a('0x9c'))[_0xd54a('0xa9')]([_0xd54a('0xaa'),'scheduledAt',_0xd54a('0xab'),_0xd54a('0x9e'),_0xd54a('0x5f'),_0xd54a('0x58'),_0xd54a('0x9f')],squel[_0xd54a('0x7c')]()[_0xd54a('0x44')](_0xd54a('0xaa'),_0xd54a('0xaa'))['field']('NOW()',_0xd54a('0x9d'))[_0xd54a('0x44')]('id',_0xd54a('0xab'))[_0xd54a('0x44')](_0x44d5d4[_0xd54a('0xa1')][_0xd54a('0xa2')](),_0xd54a('0x9e'))[_0xd54a('0x44')](_0x59be28[_0xd54a('0x4b')]['id'][_0xd54a('0xa2')](),_0xd54a('0x5f'))[_0xd54a('0x44')](_0xd54a('0xa0'),_0xd54a('0x58'))['field'](_0xd54a('0xa0'),_0xd54a('0x9f'))[_0xd54a('0x7d')](_0xd54a('0xa3'))[_0xd54a('0x3e')](_0xd54a('0xa4'))['where'](_0xd54a('0xac'),_0x44d5d4['CmListId'][_0xd54a('0xa2')]())[_0xd54a('0x3e')](_0xd54a('0xad'))[_0xd54a('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0xd54a('0x7c')]()[_0xd54a('0x44')]('COALESCE(phone,\x27\x27)')['from'](_0xd54a('0x9c'))[_0xd54a('0x3e')]('VoiceQueueId\x20=\x20?',_0x59be28['params']['id']['toString']())))[_0xd54a('0xa2')]();break;default:_0x4f8f4b=squel[_0xd54a('0x9a')]()[_0xd54a('0x9b')]('cm_hopper')[_0xd54a('0xa9')]([_0xd54a('0xaa'),_0xd54a('0x9d'),_0xd54a('0xab'),'ListId',_0xd54a('0x5f'),'createdAt',_0xd54a('0x9f')],squel[_0xd54a('0x7c')]()[_0xd54a('0x44')]('phone',_0xd54a('0xaa'))['field'](_0xd54a('0xa0'),_0xd54a('0x9d'))[_0xd54a('0x44')]('id','ContactId')[_0xd54a('0x44')](_0x44d5d4[_0xd54a('0xa1')][_0xd54a('0xa2')](),'ListId')[_0xd54a('0x44')](_0x59be28['params']['id'][_0xd54a('0xa2')](),_0xd54a('0x5f'))[_0xd54a('0x44')](_0xd54a('0xa0'),_0xd54a('0x58'))[_0xd54a('0x44')](_0xd54a('0xa0'),'updatedAt')[_0xd54a('0x7d')](_0xd54a('0xa3'))['where'](_0xd54a('0xa4'))['where']('ListId\x20=\x20?',_0x44d5d4[_0xd54a('0xa1')][_0xd54a('0xa2')]())[_0xd54a('0x3e')](_0xd54a('0xad')))['toString']();}_0x10e368[_0xd54a('0x84')](db[_0xd54a('0x85')][_0xd54a('0x32')](_0x4f8f4b));}return BPromise['all'](_0x10e368);}})['then'](function(){return _0x5ce945;})[_0xd54a('0x21')](respondWithResult(_0x263c36,null))[_0xd54a('0x49')](handleError(_0x263c36,null));};exports[_0xd54a('0xae')]=function(_0x5e2bb2,_0x46386b,_0x2abe14){return db[_0xd54a('0x30')][_0xd54a('0x2c')]({'where':{'id':_0x5e2bb2['params']['id']}})[_0xd54a('0x21')](handleEntityNotFound(_0x46386b,null))[_0xd54a('0x21')](function(_0x37cc33){if(_0x37cc33){return _0x37cc33[_0xd54a('0xae')](_0x5e2bb2[_0xd54a('0x32')][_0xd54a('0x7b')]);}})[_0xd54a('0x21')](function(_0x77df71){if(_0x77df71){return db[_0xd54a('0x5c')][_0xd54a('0x22')]({'where':{'ListId':_0x5e2bb2[_0xd54a('0x32')][_0xd54a('0x7b')],'VoiceQueueId':_0x5e2bb2['params']['id']}})[_0xd54a('0x21')](function(){return _0x77df71;});}})[_0xd54a('0x21')](respondWithStatusCode(_0x46386b,null))[_0xd54a('0x49')](handleError(_0x46386b,null));};exports['getBlackLists']=function(_0x13f588,_0x271cc3,_0x32ac9a){var _0x3deff3={};var _0x54731e={};var _0x52d0bd;var _0x1f7f03;return db[_0xd54a('0x30')]['findOne']({'where':{'id':_0x13f588[_0xd54a('0x4b')]['id']}})[_0xd54a('0x21')](handleEntityNotFound(_0x271cc3,null))[_0xd54a('0x21')](function(_0x23ad88){if(_0x23ad88){_0x52d0bd=_0x23ad88;_0x54731e[_0xd54a('0x36')]=_['keys'](db[_0xd54a('0x96')][_0xd54a('0x31')]);_0x54731e[_0xd54a('0x32')]=_[_0xd54a('0x33')](_0x13f588['query']);_0x54731e[_0xd54a('0x34')]=_[_0xd54a('0x35')](_0x54731e['model'],_0x54731e['query']);_0x3deff3[_0xd54a('0x38')]=_[_0xd54a('0x35')](_0x54731e[_0xd54a('0x36')],qs[_0xd54a('0x37')](_0x13f588['query'][_0xd54a('0x37')]));_0x3deff3['attributes']=_0x3deff3[_0xd54a('0x38')][_0xd54a('0x39')]?_0x3deff3[_0xd54a('0x38')]:_0x54731e[_0xd54a('0x36')];_0x3deff3[_0xd54a('0x3c')]=qs[_0xd54a('0x3d')](_0x13f588[_0xd54a('0x32')][_0xd54a('0x3d')]);_0x3deff3[_0xd54a('0x3e')]=qs['filters'](_['pick'](_0x13f588['query'],_0x54731e[_0xd54a('0x34')]));if(_0x13f588[_0xd54a('0x32')][_0xd54a('0x40')]){_0x3deff3[_0xd54a('0x3e')]=_[_0xd54a('0x41')](_0x3deff3['where'],{'$or':_[_0xd54a('0x28')](_0x3deff3[_0xd54a('0x38')],function(_0x5a8556){var _0xe08c9={};_0xe08c9[_0x5a8556]={'$like':'%'+_0x13f588[_0xd54a('0x32')][_0xd54a('0x40')]+'%'};return _0xe08c9;})});}_0x3deff3=_['merge']({},_0x3deff3,_0x13f588[_0xd54a('0x4c')]);return _0x52d0bd[_0xd54a('0xaf')](_0x3deff3);}})[_0xd54a('0x21')](function(_0x1202ce){if(_0x1202ce){_0x1f7f03=_0x1202ce['length'];if(!_0x13f588[_0xd54a('0x32')][_0xd54a('0x3a')](_0xd54a('0x3b'))){_0x3deff3[_0xd54a('0x1b')]=qs[_0xd54a('0x1b')](_0x13f588['query'][_0xd54a('0x1b')]);_0x3deff3['offset']=qs[_0xd54a('0x1a')](_0x13f588[_0xd54a('0x32')][_0xd54a('0x1a')]);}return _0x52d0bd[_0xd54a('0xaf')](_0x3deff3);}})[_0xd54a('0x21')](function(_0x381337){if(_0x381337){return _0x381337?{'count':_0x1f7f03,'rows':_0x381337}:null;}})['then'](respondWithResult(_0x271cc3,null))[_0xd54a('0x49')](handleError(_0x271cc3,null));};exports[_0xd54a('0xb0')]=function(_0x304a83,_0xa9127b,_0x515588){var _0x3249d6,_0x366405;return db[_0xd54a('0x30')][_0xd54a('0x2c')]({'where':{'id':_0x304a83[_0xd54a('0x4b')]['id']}})['then'](handleEntityNotFound(_0xa9127b,null))[_0xd54a('0x21')](function(_0x30526b){if(_0x30526b){_0x366405=_0x30526b;return _0x30526b[_0xd54a('0xb0')](_0x304a83[_0xd54a('0x4e')][_0xd54a('0x7b')],_['omit'](_0x304a83[_0xd54a('0x4e')],[_0xd54a('0x7b'),'id'])||{});}return null;})[_0xd54a('0x8f')](function(_0x51965e){var _0x362cbc;_0x3249d6=_0x51965e||[];var _0x201544=[];if(_0x51965e){for(var _0x5f7fa0=0x0;_0x5f7fa0<_0x51965e[_0xd54a('0x39')];_0x5f7fa0+=0x1){var _0x9bc3e7=_0x51965e[_0x5f7fa0][_0xd54a('0x23')]({'plain':!![]});_0x362cbc=squel[_0xd54a('0x9a')]()['into'](_0xd54a('0xb1'))[_0xd54a('0xa9')]([_0xd54a('0xaa'),_0xd54a('0xab'),_0xd54a('0x9e'),_0xd54a('0x5f'),_0xd54a('0x58'),_0xd54a('0x9f')],squel['select']()[_0xd54a('0x44')](_0xd54a('0xaa'),_0xd54a('0xaa'))['field']('id','ContactId')['field'](_0x9bc3e7[_0xd54a('0xa1')]['toString'](),_0xd54a('0x9e'))[_0xd54a('0x44')](_0x304a83[_0xd54a('0x4b')]['id'][_0xd54a('0xa2')](),_0xd54a('0x5f'))[_0xd54a('0x44')](_0xd54a('0xa0'),'createdAt')[_0xd54a('0x44')]('NOW()',_0xd54a('0x9f'))[_0xd54a('0x7d')](_0xd54a('0xa3'))[_0xd54a('0x3e')](_0xd54a('0xa4'))[_0xd54a('0x3e')](_0xd54a('0xac'),_0x9bc3e7['CmListId'][_0xd54a('0xa2')]())[_0xd54a('0x3e')](_0xd54a('0xad')))[_0xd54a('0xa2')]();_0x201544[_0xd54a('0x84')](db[_0xd54a('0x85')][_0xd54a('0x32')](_0x362cbc));}return BPromise[_0xd54a('0x90')](_0x201544);}})['then'](function(){return _0x3249d6;})[_0xd54a('0x21')](respondWithResult(_0xa9127b,null))[_0xd54a('0x49')](handleError(_0xa9127b,null));};exports[_0xd54a('0xb2')]=function(_0xd3bb48,_0x20fb19,_0x2e1448){return db[_0xd54a('0x30')][_0xd54a('0x2c')]({'where':{'id':_0xd3bb48['params']['id']}})[_0xd54a('0x21')](handleEntityNotFound(_0x20fb19,null))['then'](function(_0x15a0c4){if(_0x15a0c4){return _0x15a0c4[_0xd54a('0xb2')](_0xd3bb48[_0xd54a('0x32')][_0xd54a('0x7b')]);}})[_0xd54a('0x21')](function(_0x1d7a41){if(_0x1d7a41){return db[_0xd54a('0x63')]['destroy']({'where':{'ListId':_0xd3bb48[_0xd54a('0x32')]['ids'],'VoiceQueueId':_0xd3bb48[_0xd54a('0x4b')]['id']}})['then'](function(){return _0x1d7a41;});}})[_0xd54a('0x21')](respondWithStatusCode(_0x20fb19,null))['catch'](handleError(_0x20fb19,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 4f09c57..279951d 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 _0x6087=['update','emit','hasOwnProperty','hook','exports','events','VoiceQueue','setMaxListeners','save'];(function(_0x5e335a,_0x3de525){var _0x5a6224=function(_0xdf9b0d){while(--_0xdf9b0d){_0x5e335a['push'](_0x5e335a['shift']());}};_0x5a6224(++_0x3de525);}(_0x6087,0x1e2));var _0x7608=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x6087[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0x7608('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x7608('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x7608('0x2')](0x0);var events={'afterCreate':_0x7608('0x3'),'afterUpdate':_0x7608('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2f268b){return function(_0x1b0d55,_0x2eeea4,_0x2e61a2){VoiceQueueEvents[_0x7608('0x5')](_0x2f268b+':'+_0x1b0d55['id'],_0x1b0d55);VoiceQueueEvents[_0x7608('0x5')](_0x2f268b,_0x1b0d55);_0x2e61a2(null);};}for(var e in events){if(events[_0x7608('0x6')](e)){var event=events[e];VoiceQueue[_0x7608('0x7')](e,emitEvent(event));}}module[_0x7608('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x5ac6=['setMaxListeners','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5ac6,0x14e));var _0x65ac=function(_0x17d65b,_0x286c1d){_0x17d65b=_0x17d65b-0x0;var _0x35c9fa=_0x5ac6[_0x17d65b];return _0x35c9fa;};'use strict';var EventEmitter=require(_0x65ac('0x0'));var VoiceQueue=require(_0x65ac('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x65ac('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x65ac('0x3')};function emitEvent(_0x1b1492){return function(_0x1cbc16,_0xa3f3fe,_0xee4e28){VoiceQueueEvents[_0x65ac('0x4')](_0x1b1492+':'+_0x1cbc16['id'],_0x1cbc16);VoiceQueueEvents[_0x65ac('0x4')](_0x1b1492,_0x1cbc16);_0xee4e28(null);};}for(var e in events){if(events[_0x65ac('0x5')](e)){var event=events[e];VoiceQueue[_0x65ac('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index af3a192..565f059 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 _0xabe9=['moment','bluebird','path','rimraf','../../config/environment','./voiceQueue.attributes','define','VoiceQueue','voice_queues','util','../../config/logger'];(function(_0x1a7b26,_0x46d640){var _0x18a3d8=function(_0x3faaea){while(--_0x3faaea){_0x1a7b26['push'](_0x1a7b26['shift']());}};_0x18a3d8(++_0x46d640);}(_0xabe9,0x18a));var _0x9abe=function(_0x5d44b9,_0x2283a0){_0x5d44b9=_0x5d44b9-0x0;var _0x484f48=_0xabe9[_0x5d44b9];return _0x484f48;};'use strict';var _=require('lodash');var util=require(_0x9abe('0x0'));var logger=require(_0x9abe('0x1'))('api');var moment=require(_0x9abe('0x2'));var BPromise=require(_0x9abe('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9abe('0x4'));var rimraf=require(_0x9abe('0x5'));var config=require(_0x9abe('0x6'));var attributes=require(_0x9abe('0x7'));module['exports']=function(_0x4a663a,_0x525402){return _0x4a663a[_0x9abe('0x8')](_0x9abe('0x9'),attributes,{'tableName':_0x9abe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc21b=['VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc21b,0x1b2));var _0xbc21=function(_0x19f5fc,_0x4c658a){_0x19f5fc=_0x19f5fc-0x0;var _0x315fa3=_0xc21b[_0x19f5fc];return _0x315fa3;};'use strict';var _=require(_0xbc21('0x0'));var util=require('util');var logger=require(_0xbc21('0x1'))(_0xbc21('0x2'));var moment=require(_0xbc21('0x3'));var BPromise=require('bluebird');var rp=require(_0xbc21('0x4'));var fs=require('fs');var path=require(_0xbc21('0x5'));var rimraf=require(_0xbc21('0x6'));var config=require(_0xbc21('0x7'));var attributes=require(_0xbc21('0x8'));module[_0xbc21('0x9')]=function(_0x401648,_0x3e63d9){return _0x401648['define'](_0xbc21('0xa'),attributes,{'tableName':_0xbc21('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 2985dbb..273804a 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 _0x3a85=['redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','limit','map','include','model','attributes','ShowVoiceQueue','find','catch','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3a85,0xc3));var _0x53a8=function(_0x1e2472,_0x73625b){_0x1e2472=_0x1e2472-0x0;var _0x4d0c89=_0x3a85[_0x1e2472];return _0x4d0c89;};'use strict';var _=require(_0x53a8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x53a8('0x1'));var rs=require(_0x53a8('0x2'));var fs=require('fs');var Redis=require(_0x53a8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x53a8('0x4'))(_0x53a8('0x5'));var config=require(_0x53a8('0x6'));var jayson=require(_0x53a8('0x7'));var client=jayson[_0x53a8('0x8')][_0x53a8('0x9')]({'port':0x232a});config[_0x53a8('0xa')]=_[_0x53a8('0xb')](config[_0x53a8('0xa')],{'host':_0x53a8('0xc'),'port':0x18eb});var socket=require(_0x53a8('0xd'))(new Redis(config[_0x53a8('0xa')]));require(_0x53a8('0xe'))[_0x53a8('0xf')](socket);function respondWithRpcPromise(_0xbc5077,_0x59cf86,_0x5c9cac){return new BPromise(function(_0x382f2a,_0x566ed0){return client[_0x53a8('0x10')](_0xbc5077,_0x5c9cac)['then'](function(_0x5c2f49){logger[_0x53a8('0x11')](_0x53a8('0x12'),_0x59cf86,_0x53a8('0x13'));logger[_0x53a8('0x14')](_0x53a8('0x15'),_0x59cf86,_0x53a8('0x13'),JSON[_0x53a8('0x16')](_0x5c2f49));if(_0x5c2f49[_0x53a8('0x17')]){if(_0x5c2f49[_0x53a8('0x17')][_0x53a8('0x18')]===0x1f4){logger[_0x53a8('0x17')](_0x53a8('0x12'),_0x59cf86,_0x5c2f49[_0x53a8('0x17')]['message']);return _0x566ed0(_0x5c2f49['error']['message']);}logger[_0x53a8('0x17')](_0x53a8('0x12'),_0x59cf86,_0x5c2f49['error'][_0x53a8('0x19')]);return _0x382f2a(_0x5c2f49[_0x53a8('0x17')][_0x53a8('0x19')]);}else{logger[_0x53a8('0x11')](_0x53a8('0x12'),_0x59cf86,_0x53a8('0x13'));_0x382f2a(_0x5c2f49[_0x53a8('0x1a')][_0x53a8('0x19')]);}})['catch'](function(_0x193788){logger[_0x53a8('0x17')](_0x53a8('0x12'),_0x59cf86,_0x193788);_0x566ed0(_0x193788);});});}exports[_0x53a8('0x1b')]=function(_0x15e934){var _0x387cad=this;return new Promise(function(_0x39677a,_0x29769b){return db[_0x53a8('0x1c')][_0x53a8('0x1d')]({'raw':_0x15e934[_0x53a8('0x1e')]?_0x15e934[_0x53a8('0x1e')][_0x53a8('0x1f')]===undefined?!![]:![]:!![],'where':_0x15e934['options']?_0x15e934['options'][_0x53a8('0x20')]||null:null,'attributes':_0x15e934[_0x53a8('0x1e')]?_0x15e934[_0x53a8('0x1e')]['attributes']||null:null,'limit':_0x15e934[_0x53a8('0x1e')]?_0x15e934[_0x53a8('0x1e')][_0x53a8('0x21')]||null:null,'include':_0x15e934['options']?_0x15e934[_0x53a8('0x1e')]['include']?_[_0x53a8('0x22')](_0x15e934[_0x53a8('0x1e')][_0x53a8('0x23')],function(_0x42e849){return{'model':db[_0x42e849[_0x53a8('0x24')]],'as':_0x42e849['as'],'attributes':_0x42e849[_0x53a8('0x25')],'include':_0x42e849['include']?_[_0x53a8('0x22')](_0x42e849['include'],function(_0x20af74){return{'model':db[_0x20af74[_0x53a8('0x24')]],'as':_0x20af74['as'],'attributes':_0x20af74[_0x53a8('0x25')],'include':_0x20af74[_0x53a8('0x23')]?_[_0x53a8('0x22')](_0x20af74['include'],function(_0x39bab6){return{'model':db[_0x39bab6[_0x53a8('0x24')]],'as':_0x39bab6['as'],'attributes':_0x39bab6[_0x53a8('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1455b0){logger['info'](_0x53a8('0x1b'),_0x15e934);logger[_0x53a8('0x14')](_0x53a8('0x1b'),_0x15e934,JSON[_0x53a8('0x16')](_0x1455b0));_0x39677a(_0x1455b0);})['catch'](function(_0x341b29){logger[_0x53a8('0x17')](_0x53a8('0x1b'),_0x341b29['message'],_0x15e934);_0x29769b(_0x387cad['error'](0x1f4,_0x341b29['message']));});});};exports[_0x53a8('0x26')]=function(_0x55d393){var _0x21a544=this;return new Promise(function(_0x5e5e44,_0x1eb519){return db['VoiceQueue'][_0x53a8('0x27')]({'raw':_0x55d393['options']?_0x55d393['options'][_0x53a8('0x1f')]===undefined?!![]:![]:!![],'where':_0x55d393[_0x53a8('0x1e')]?_0x55d393[_0x53a8('0x1e')][_0x53a8('0x20')]||null:null,'attributes':_0x55d393[_0x53a8('0x1e')]?_0x55d393['options'][_0x53a8('0x25')]||null:null,'include':_0x55d393[_0x53a8('0x1e')]?_0x55d393[_0x53a8('0x1e')][_0x53a8('0x23')]?_[_0x53a8('0x22')](_0x55d393[_0x53a8('0x1e')][_0x53a8('0x23')],function(_0x4ffd05){return{'model':db[_0x4ffd05[_0x53a8('0x24')]],'as':_0x4ffd05['as'],'attributes':_0x4ffd05[_0x53a8('0x25')],'include':_0x4ffd05[_0x53a8('0x23')]?_[_0x53a8('0x22')](_0x4ffd05['include'],function(_0x3bdee7){return{'model':db[_0x3bdee7[_0x53a8('0x24')]],'as':_0x3bdee7['as'],'attributes':_0x3bdee7[_0x53a8('0x25')],'include':_0x3bdee7[_0x53a8('0x23')]?_[_0x53a8('0x22')](_0x3bdee7[_0x53a8('0x23')],function(_0x29589f){return{'model':db[_0x29589f[_0x53a8('0x24')]],'as':_0x29589f['as'],'attributes':_0x29589f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x46a432){logger[_0x53a8('0x11')](_0x53a8('0x26'),_0x55d393);logger[_0x53a8('0x14')](_0x53a8('0x26'),_0x55d393,JSON[_0x53a8('0x16')](_0x46a432));_0x5e5e44(_0x46a432);})[_0x53a8('0x28')](function(_0x252a9e){logger[_0x53a8('0x17')](_0x53a8('0x26'),_0x252a9e[_0x53a8('0x19')],_0x55d393);_0x1eb519(_0x21a544[_0x53a8('0x17')](0x1f4,_0x252a9e[_0x53a8('0x19')]));});});}; \ No newline at end of file +var _0x95f9=['localhost','socket.io-emitter','./voiceQueue.socket','request','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','limit','include','model','map','attributes','then','ShowVoiceQueue','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults'];(function(_0x436b46,_0x44638e){var _0x237cfb=function(_0x15335d){while(--_0x15335d){_0x436b46['push'](_0x436b46['shift']());}};_0x237cfb(++_0x44638e);}(_0x95f9,0x1b7));var _0x995f=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x95f9[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require('lodash');var util=require(_0x995f('0x0'));var moment=require('moment');var BPromise=require(_0x995f('0x1'));var rs=require(_0x995f('0x2'));var fs=require('fs');var Redis=require(_0x995f('0x3'));var db=require(_0x995f('0x4'))['db'];var utils=require(_0x995f('0x5'));var logger=require(_0x995f('0x6'))(_0x995f('0x7'));var config=require('../../config/environment');var jayson=require(_0x995f('0x8'));var client=jayson[_0x995f('0x9')]['http']({'port':0x232a});config[_0x995f('0xa')]=_[_0x995f('0xb')](config[_0x995f('0xa')],{'host':_0x995f('0xc'),'port':0x18eb});var socket=require(_0x995f('0xd'))(new Redis(config[_0x995f('0xa')]));require(_0x995f('0xe'))['register'](socket);function respondWithRpcPromise(_0x1b6b5e,_0x3cba90,_0x11603f){return new BPromise(function(_0x17e626,_0x25b3f9){return client[_0x995f('0xf')](_0x1b6b5e,_0x11603f)['then'](function(_0x3fed68){logger[_0x995f('0x10')](_0x995f('0x11'),_0x3cba90,'request\x20sent');logger[_0x995f('0x12')](_0x995f('0x13'),_0x3cba90,'request\x20sent',JSON[_0x995f('0x14')](_0x3fed68));if(_0x3fed68['error']){if(_0x3fed68[_0x995f('0x15')][_0x995f('0x16')]===0x1f4){logger[_0x995f('0x15')](_0x995f('0x11'),_0x3cba90,_0x3fed68[_0x995f('0x15')]['message']);return _0x25b3f9(_0x3fed68[_0x995f('0x15')]['message']);}logger[_0x995f('0x15')](_0x995f('0x11'),_0x3cba90,_0x3fed68['error'][_0x995f('0x17')]);return _0x17e626(_0x3fed68[_0x995f('0x15')][_0x995f('0x17')]);}else{logger[_0x995f('0x10')](_0x995f('0x11'),_0x3cba90,_0x995f('0x18'));_0x17e626(_0x3fed68[_0x995f('0x19')][_0x995f('0x17')]);}})[_0x995f('0x1a')](function(_0x142eae){logger[_0x995f('0x15')](_0x995f('0x11'),_0x3cba90,_0x142eae);_0x25b3f9(_0x142eae);});});}exports[_0x995f('0x1b')]=function(_0x183a69){var _0x57338b=this;return new Promise(function(_0x4d644e,_0x41b19b){return db[_0x995f('0x1c')][_0x995f('0x1d')]({'raw':_0x183a69[_0x995f('0x1e')]?_0x183a69['options'][_0x995f('0x1f')]===undefined?!![]:![]:!![],'where':_0x183a69[_0x995f('0x1e')]?_0x183a69[_0x995f('0x1e')][_0x995f('0x20')]||null:null,'attributes':_0x183a69[_0x995f('0x1e')]?_0x183a69[_0x995f('0x1e')]['attributes']||null:null,'limit':_0x183a69['options']?_0x183a69[_0x995f('0x1e')][_0x995f('0x21')]||null:null,'include':_0x183a69[_0x995f('0x1e')]?_0x183a69[_0x995f('0x1e')][_0x995f('0x22')]?_['map'](_0x183a69['options'][_0x995f('0x22')],function(_0x8a3d60){return{'model':db[_0x8a3d60[_0x995f('0x23')]],'as':_0x8a3d60['as'],'attributes':_0x8a3d60['attributes'],'include':_0x8a3d60[_0x995f('0x22')]?_[_0x995f('0x24')](_0x8a3d60[_0x995f('0x22')],function(_0x1ffcb3){return{'model':db[_0x1ffcb3[_0x995f('0x23')]],'as':_0x1ffcb3['as'],'attributes':_0x1ffcb3[_0x995f('0x25')],'include':_0x1ffcb3[_0x995f('0x22')]?_[_0x995f('0x24')](_0x1ffcb3[_0x995f('0x22')],function(_0x10245b){return{'model':db[_0x10245b['model']],'as':_0x10245b['as'],'attributes':_0x10245b[_0x995f('0x25')]};}):[]};}):[]};}):[]:[]})[_0x995f('0x26')](function(_0x352df5){logger[_0x995f('0x10')]('GetVoiceQueue',_0x183a69);logger[_0x995f('0x12')](_0x995f('0x1b'),_0x183a69,JSON[_0x995f('0x14')](_0x352df5));_0x4d644e(_0x352df5);})[_0x995f('0x1a')](function(_0x3d6173){logger[_0x995f('0x15')]('GetVoiceQueue',_0x3d6173[_0x995f('0x17')],_0x183a69);_0x41b19b(_0x57338b[_0x995f('0x15')](0x1f4,_0x3d6173[_0x995f('0x17')]));});});};exports[_0x995f('0x27')]=function(_0x8103c2){var _0x16903e=this;return new Promise(function(_0x4e2824,_0x4e17a1){return db['VoiceQueue'][_0x995f('0x28')]({'raw':_0x8103c2['options']?_0x8103c2[_0x995f('0x1e')][_0x995f('0x1f')]===undefined?!![]:![]:!![],'where':_0x8103c2[_0x995f('0x1e')]?_0x8103c2[_0x995f('0x1e')][_0x995f('0x20')]||null:null,'attributes':_0x8103c2['options']?_0x8103c2['options'][_0x995f('0x25')]||null:null,'include':_0x8103c2['options']?_0x8103c2['options'][_0x995f('0x22')]?_[_0x995f('0x24')](_0x8103c2['options'][_0x995f('0x22')],function(_0x5feefc){return{'model':db[_0x5feefc[_0x995f('0x23')]],'as':_0x5feefc['as'],'attributes':_0x5feefc[_0x995f('0x25')],'include':_0x5feefc[_0x995f('0x22')]?_['map'](_0x5feefc[_0x995f('0x22')],function(_0x42b115){return{'model':db[_0x42b115[_0x995f('0x23')]],'as':_0x42b115['as'],'attributes':_0x42b115[_0x995f('0x25')],'include':_0x42b115['include']?_[_0x995f('0x24')](_0x42b115[_0x995f('0x22')],function(_0x532b0b){return{'model':db[_0x532b0b[_0x995f('0x23')]],'as':_0x532b0b['as'],'attributes':_0x532b0b[_0x995f('0x25')]};}):[]};}):[]};}):[]:[]})[_0x995f('0x26')](function(_0x133ee0){logger[_0x995f('0x10')](_0x995f('0x27'),_0x8103c2);logger[_0x995f('0x12')](_0x995f('0x27'),_0x8103c2,JSON[_0x995f('0x14')](_0x133ee0));_0x4e2824(_0x133ee0);})[_0x995f('0x1a')](function(_0x179e83){logger['error'](_0x995f('0x27'),_0x179e83[_0x995f('0x17')],_0x8103c2);_0x4e17a1(_0x16903e['error'](0x1f4,_0x179e83['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 78774d2..429b66b 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 _0x662c=['update','removeListener','length','voiceQueue:','save','remove'];(function(_0x4bae60,_0x2b8f9e){var _0x47ff31=function(_0x1bdf48){while(--_0x1bdf48){_0x4bae60['push'](_0x4bae60['shift']());}};_0x47ff31(++_0x2b8f9e);}(_0x662c,0x1e4));var _0xc662=function(_0x4b5928,_0x312f66){_0x4b5928=_0x4b5928-0x0;var _0xbff9c2=_0x662c[_0x4b5928];return _0xbff9c2;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xc662('0x0'),_0xc662('0x1'),_0xc662('0x2')];function createListener(_0x168165,_0x39effa){return function(_0xa1387d){_0x39effa['emit'](_0x168165,_0xa1387d);};}function removeListener(_0x4b60d5,_0x13760c){return function(){VoiceQueueEvents[_0xc662('0x3')](_0x4b60d5,_0x13760c);};}exports['register']=function(_0x922191){for(var _0x215f1b=0x0,_0x54f2c2=events[_0xc662('0x4')];_0x215f1b<_0x54f2c2;_0x215f1b++){var _0x17e7c3=events[_0x215f1b];var _0x210d44=createListener(_0xc662('0x5')+_0x17e7c3,_0x922191);VoiceQueueEvents['on'](_0x17e7c3,_0x210d44);}}; \ No newline at end of file +var _0x4c76=['removeListener','length','save','update','emit'];(function(_0xf92b15,_0x1bce36){var _0x5b3f3c=function(_0x33c4ae){while(--_0x33c4ae){_0xf92b15['push'](_0xf92b15['shift']());}};_0x5b3f3c(++_0x1bce36);}(_0x4c76,0x84));var _0x64c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c76[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x64c7('0x0'),'remove',_0x64c7('0x1')];function createListener(_0x20e2fc,_0xf41c5f){return function(_0x4bcf14){_0xf41c5f[_0x64c7('0x2')](_0x20e2fc,_0x4bcf14);};}function removeListener(_0x41f0a2,_0x40054e){return function(){VoiceQueueEvents[_0x64c7('0x3')](_0x41f0a2,_0x40054e);};}exports['register']=function(_0x27054b){for(var _0x5e04c9=0x0,_0x377eab=events[_0x64c7('0x4')];_0x5e04c9<_0x377eab;_0x5e04c9++){var _0x5b12dc=events[_0x5e04c9];var _0x4a3f45=createListener('voiceQueue:'+_0x5b12dc,_0x27054b);VoiceQueueEvents['on'](_0x5b12dc,_0x4a3f45);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 3f969c8..6051230 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 _0xbd10=['./voiceQueueReport.controller','get','isAuthenticated','index','/index','getVoiceQueuesReport','/:id','show','post','create','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xbd10,0x85));var _0x0bd1=function(_0x11c628,_0x414c81){_0x11c628=_0x11c628-0x0;var _0x5d4139=_0xbd10[_0x11c628];return _0x5d4139;};'use strict';var multer=require(_0x0bd1('0x0'));var util=require(_0x0bd1('0x1'));var path=require(_0x0bd1('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bd1('0x3'));var router=express[_0x0bd1('0x4')]();var auth=require(_0x0bd1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0bd1('0x6'));var controller=require(_0x0bd1('0x7'));router[_0x0bd1('0x8')]('/',auth[_0x0bd1('0x9')](),controller[_0x0bd1('0xa')]);router[_0x0bd1('0x8')]('/describe',auth[_0x0bd1('0x9')](),controller['describe']);router[_0x0bd1('0x8')](_0x0bd1('0xb'),auth[_0x0bd1('0x9')](),controller[_0x0bd1('0xc')]);router['get'](_0x0bd1('0xd'),auth[_0x0bd1('0x9')](),controller[_0x0bd1('0xe')]);router[_0x0bd1('0xf')]('/',auth[_0x0bd1('0x9')](),controller[_0x0bd1('0x10')]);router['put'](_0x0bd1('0xd'),auth[_0x0bd1('0x9')](),controller[_0x0bd1('0x11')]);router[_0x0bd1('0x12')](_0x0bd1('0xd'),auth[_0x0bd1('0x9')](),controller['destroy']);module[_0x0bd1('0x13')]=router; \ No newline at end of file +var _0x81c6=['destroy','util','Router','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/index','getVoiceQueuesReport','post','create','put','update','delete','/:id'];(function(_0x20f504,_0x2583b3){var _0x27715b=function(_0x1647c1){while(--_0x1647c1){_0x20f504['push'](_0x20f504['shift']());}};_0x27715b(++_0x2583b3);}(_0x81c6,0x1d5));var _0x681c=function(_0xfb65aa,_0x1651a6){_0xfb65aa=_0xfb65aa-0x0;var _0x2aee31=_0x81c6[_0xfb65aa];return _0x2aee31;};'use strict';var multer=require('multer');var util=require(_0x681c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x681c('0x1')]();var auth=require(_0x681c('0x2'));var interaction=require(_0x681c('0x3'));var config=require('../../config/environment');var controller=require(_0x681c('0x4'));router[_0x681c('0x5')]('/',auth[_0x681c('0x6')](),controller[_0x681c('0x7')]);router['get'](_0x681c('0x8'),auth[_0x681c('0x6')](),controller['describe']);router['get'](_0x681c('0x9'),auth[_0x681c('0x6')](),controller[_0x681c('0xa')]);router['get']('/:id',auth[_0x681c('0x6')](),controller['show']);router[_0x681c('0xb')]('/',auth[_0x681c('0x6')](),controller[_0x681c('0xc')]);router[_0x681c('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x681c('0xe')]);router[_0x681c('0xf')](_0x681c('0x10'),auth['isAuthenticated'](),controller[_0x681c('0x11')]);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 e2644d3..80c9f77 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 _0xda48=['exports','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x2b3bf7,_0x4a92e8){var _0x570474=function(_0x1c8cf7){while(--_0x1c8cf7){_0x2b3bf7['push'](_0x2b3bf7['shift']());}};_0x570474(++_0x4a92e8);}(_0xda48,0xc2));var _0x8da4=function(_0x3c0b82,_0x1b7930){_0x3c0b82=_0x3c0b82-0x0;var _0x460af3=_0xda48[_0x3c0b82];return _0x460af3;};'use strict';var Sequelize=require(_0x8da4('0x0'));var moment=require('moment');module[_0x8da4('0x1')]={'type':{'type':Sequelize[_0x8da4('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x8da4('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x8da4('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x8da4('0x3')],'set':function(_0xc03319){var _0x26ecc6=moment(_0xc03319);var _0x44d3ae=moment(this['getDataValue'](_0x8da4('0x4')))[_0x8da4('0x5')](_0x8da4('0x6'));var _0x1e9e57=_0x26ecc6['diff'](_0x44d3ae,_0x8da4('0x7'));this[_0x8da4('0x8')](_0x8da4('0x9'),_0xc03319);this['setDataValue'](_0x8da4('0xa'),_0x1e9e57||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x8da4('0xb')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x8da4('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x8da4('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x8da4('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x8da4('0x2')],'comment':_0x8da4('0xd')},'originalposition':{'type':Sequelize[_0x8da4('0xb')]},'channel':{'type':Sequelize[_0x8da4('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x8da4('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8da4('0x2')]},'exten':{'type':Sequelize[_0x8da4('0x2')]},'priority':{'type':Sequelize[_0x8da4('0x2')]},'holdtime':{'type':Sequelize[_0x8da4('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x8da4('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8da4('0x2')],'comment':_0x8da4('0xe')},'transferexten':{'type':Sequelize[_0x8da4('0x2')]},'transferuniqueid':{'type':Sequelize[_0x8da4('0x2')]},'disposition':{'type':Sequelize[_0x8da4('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x8da4('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x47bf=['seconds','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue','format'];(function(_0xfc26e7,_0x4aa4f5){var _0x3dde66=function(_0x14b277){while(--_0x14b277){_0xfc26e7['push'](_0xfc26e7['shift']());}};_0x3dde66(++_0x4aa4f5);}(_0x47bf,0x1bd));var _0xf47b=function(_0x1c4ceb,_0x479f48){_0x1c4ceb=_0x1c4ceb-0x0;var _0x4d9130=_0x47bf[_0x1c4ceb];return _0x4d9130;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf47b('0x0'));module[_0xf47b('0x1')]={'type':{'type':Sequelize[_0xf47b('0x2')]},'uniqueid':{'type':Sequelize[_0xf47b('0x2')]},'calleridnum':{'type':Sequelize[_0xf47b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xf47b('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xf47b('0x3')],'set':function(_0x333ff1){var _0x4abd00=moment(_0x333ff1);var _0x5d2efd=moment(this[_0xf47b('0x4')]('queuecallerjoinAt'))[_0xf47b('0x5')]('YYYY-MM-DD\x20HH:mm:ss');var _0x522616=_0x4abd00['diff'](_0x5d2efd,_0xf47b('0x6'));this['setDataValue']('queuecallerleaveAt',_0x333ff1);this['setDataValue']('holdtime',_0x522616||null);}},'position':{'type':Sequelize[_0xf47b('0x7')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xf47b('0x3')]},'queuecallerexit':{'type':Sequelize[_0xf47b('0x8')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xf47b('0x2')],'comment':_0xf47b('0x9')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xf47b('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf47b('0x2')]},'connectedlinename':{'type':Sequelize[_0xf47b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xf47b('0x2')]},'exten':{'type':Sequelize[_0xf47b('0x2')]},'priority':{'type':Sequelize[_0xf47b('0x2')]},'holdtime':{'type':Sequelize[_0xf47b('0x7')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf47b('0x8')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xf47b('0x2')]},'transfer':{'type':Sequelize[_0xf47b('0x8')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf47b('0x2')],'comment':_0xf47b('0xa')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xf47b('0x2')]},'disposition':{'type':Sequelize[_0xf47b('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xf47b('0x7')],'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 b40f494..a9f2b18 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 _0x34e8=['then','destroy','error','stack','name','VoiceQueueReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','key','VIRTUAL','field','includeAll','include','show','params','options','catch','create','body','find','describe','getVoiceQueuesReport','pick','map','findAll','rows','html-pdf','eml-format','rimraf','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./voiceQueueReport.socket','register','sendStatus','end','json','count','offset','status','set','Content-Range','apply','reject','save','update'];(function(_0x3dfeb9,_0x1cc6e4){var _0x412314=function(_0x321253){while(--_0x321253){_0x3dfeb9['push'](_0x3dfeb9['shift']());}};_0x412314(++_0x1cc6e4);}(_0x34e8,0x12c));var _0x834e=function(_0x35ef3e,_0x2db25f){_0x35ef3e=_0x35ef3e-0x0;var _0x5241dc=_0x34e8[_0x35ef3e];return _0x5241dc;};'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 hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var db=require(_0x834e('0x1b'))['db'];config[_0x834e('0x1c')]=_['defaults'](config[_0x834e('0x1c')],{'host':_0x834e('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x834e('0x1c')]));require(_0x834e('0x1e'))[_0x834e('0x1f')](socket);function respondWithStatusCode(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xcc;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x20')](_0x50e860);}return _0x21cc0a['status'](_0x50e860)[_0x834e('0x21')]();};}function respondWithResult(_0x4a9cdc,_0x38a8cd){_0x38a8cd=_0x38a8cd||0xc8;return function(_0x36d443){if(_0x36d443){return _0x4a9cdc['status'](_0x38a8cd)[_0x834e('0x22')](_0x36d443);}};}function respondWithFilteredResult(_0x22106e,_0x370fb5){return function(_0x50b3f6){if(_0x50b3f6){var _0x283e56=_0x50b3f6[_0x834e('0x23')],_0x211e9a=_0x370fb5[_0x834e('0x24')],_0x34e41a=_0x370fb5[_0x834e('0x24')]+_0x370fb5['limit'],_0xb993a1;if(_0x34e41a>=_0x283e56){_0x34e41a=_0x283e56;_0xb993a1=0xc8;}else{_0xb993a1=0xce;}_0x22106e[_0x834e('0x25')](_0xb993a1);return _0x22106e[_0x834e('0x26')](_0x834e('0x27'),_0x211e9a+'-'+_0x34e41a+'/'+_0x283e56)[_0x834e('0x22')](_0x50b3f6);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x28')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x29')](_0x5a05c0);}return _0x45a630[_0x834e('0x2a')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x2b')](_0x8d406e)[_0x834e('0x2c')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2d')]()[_0x834e('0x2c')](function(){_0x25ee1d[_0x834e('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2e')](_0x2826ec[_0x834e('0x2f')]);if(_0x2826ec[_0x834e('0x30')]){delete _0x2826ec[_0x834e('0x30')];}_0x1e713a[_0x834e('0x25')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=db[_0x834e('0x31')][_0x834e('0x32')];_0x567cea[_0x834e('0x33')]=_[_0x834e('0x34')](_0x5dacc1);_0x567cea[_0x834e('0x35')]=_[_0x834e('0x34')](_0x4dc64a[_0x834e('0x35')]);_0x567cea[_0x834e('0x36')]=_[_0x834e('0x37')](_0x567cea['model'],_0x567cea[_0x834e('0x35')]);_0x2c7a8d['attributes']=_[_0x834e('0x37')](_0x567cea[_0x834e('0x33')],qs[_0x834e('0x38')](_0x4dc64a[_0x834e('0x35')][_0x834e('0x38')]));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3a')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea[_0x834e('0x33')];if(!_0x4dc64a['query'][_0x834e('0x3b')](_0x834e('0x3c'))){_0x2c7a8d[_0x834e('0x3d')]=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x24')]=qs['offset'](_0x4dc64a['query']['offset']);}_0x2c7a8d[_0x834e('0x3e')]=qs[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x35')][_0x834e('0x3f')]);_0x2c7a8d[_0x834e('0x40')]=qs[_0x834e('0x36')](_['pick'](_0x4dc64a[_0x834e('0x35')],_0x567cea['filters']));if(_0x4dc64a[_0x834e('0x35')][_0x834e('0x41')]){_0x2c7a8d['where']=_[_0x834e('0x42')](_0x2c7a8d[_0x834e('0x40')],{'$or':_['map'](_0x5dacc1,function(_0x481f70){if(_0x481f70[_0x834e('0x43')][_0x834e('0x44')]!==_0x834e('0x45')){var _0x130c23={};_0x130c23[_0x481f70[_0x834e('0x46')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x41')]+'%'};return _0x130c23;}})});}_0x2c7a8d=_['merge']({},_0x2c7a8d,_0x4dc64a['options']);var _0x1b2edf={'where':_0x2c7a8d['where']};return db[_0x834e('0x31')][_0x834e('0x23')](_0x1b2edf)[_0x834e('0x2c')](function(_0x3c59af){_0x106d6a[_0x834e('0x23')]=_0x3c59af;if(_0x4dc64a['query'][_0x834e('0x47')]){_0x2c7a8d[_0x834e('0x48')]=[{'all':!![]}];}return db[_0x834e('0x31')]['findAll'](_0x2c7a8d);})[_0x834e('0x2c')](function(_0x16ac45){_0x106d6a['rows']=_0x16ac45;return _0x106d6a;})[_0x834e('0x2c')](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))['catch'](handleError(_0x58c1d7,null));};exports[_0x834e('0x49')]=function(_0x585335,_0x4a18bb){var _0x4a6942={'raw':![],'where':{'id':_0x585335[_0x834e('0x4a')]['id']}},_0x22ea21={};_0x22ea21[_0x834e('0x33')]=_[_0x834e('0x34')](db[_0x834e('0x31')][_0x834e('0x32')]);_0x22ea21[_0x834e('0x35')]=_['keys'](_0x585335[_0x834e('0x35')]);_0x22ea21['filters']=_[_0x834e('0x37')](_0x22ea21['model'],_0x22ea21[_0x834e('0x35')]);_0x4a6942['attributes']=_[_0x834e('0x37')](_0x22ea21[_0x834e('0x33')],qs['fields'](_0x585335[_0x834e('0x35')][_0x834e('0x38')]));_0x4a6942[_0x834e('0x39')]=_0x4a6942[_0x834e('0x39')][_0x834e('0x3a')]?_0x4a6942[_0x834e('0x39')]:_0x22ea21[_0x834e('0x33')];if(_0x585335[_0x834e('0x35')][_0x834e('0x47')]){_0x4a6942[_0x834e('0x48')]=[{'all':!![]}];}_0x4a6942=_['merge']({},_0x4a6942,_0x585335[_0x834e('0x4b')]);return db[_0x834e('0x31')]['find'](_0x4a6942)[_0x834e('0x2c')](handleEntityNotFound(_0x4a18bb,null))[_0x834e('0x2c')](respondWithResult(_0x4a18bb,null))[_0x834e('0x4c')](handleError(_0x4a18bb,null));};exports[_0x834e('0x4d')]=function(_0x19b5ef,_0x4264b8){return db['VoiceQueueReport']['create'](_0x19b5ef[_0x834e('0x4e')],{})[_0x834e('0x2c')](respondWithResult(_0x4264b8,0xc9))[_0x834e('0x4c')](handleError(_0x4264b8,null));};exports[_0x834e('0x2b')]=function(_0x3da408,_0xd1d83b){if(_0x3da408[_0x834e('0x4e')]['id']){delete _0x3da408[_0x834e('0x4e')]['id'];}return db[_0x834e('0x31')][_0x834e('0x4f')]({'where':{'id':_0x3da408[_0x834e('0x4a')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0xd1d83b,null))[_0x834e('0x2c')](saveUpdates(_0x3da408[_0x834e('0x4e')],null))[_0x834e('0x2c')](respondWithResult(_0xd1d83b,null))[_0x834e('0x4c')](handleError(_0xd1d83b,null));};exports[_0x834e('0x2d')]=function(_0x32b8f7,_0x420841){return db[_0x834e('0x31')]['find']({'where':{'id':_0x32b8f7[_0x834e('0x4a')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x420841,null))['then'](removeEntity(_0x420841,null))[_0x834e('0x4c')](handleError(_0x420841,null));};exports[_0x834e('0x50')]=function(_0x55d491,_0x3dcca3){return db[_0x834e('0x31')][_0x834e('0x50')]()[_0x834e('0x2c')](respondWithResult(_0x3dcca3,null))[_0x834e('0x4c')](handleError(_0x3dcca3,null));};exports[_0x834e('0x51')]=function(_0x4549ba,_0x4a8b32){var _0x1ad7fe={},_0x8bc6c6={},_0x3e0550={'count':0x0,'rows':[]};_0x8bc6c6[_0x834e('0x33')]=_[_0x834e('0x34')](db[_0x834e('0x31')][_0x834e('0x32')]);_0x8bc6c6[_0x834e('0x35')]=_['keys'](_0x4549ba[_0x834e('0x35')]);_0x8bc6c6['filters']=_[_0x834e('0x37')](_0x8bc6c6['model'],_0x8bc6c6[_0x834e('0x35')]);_0x1ad7fe['attributes']=_['intersection'](_0x8bc6c6[_0x834e('0x33')],qs[_0x834e('0x38')](_0x4549ba['query']['fields']));_0x1ad7fe[_0x834e('0x39')]=_0x1ad7fe[_0x834e('0x39')][_0x834e('0x3a')]?_0x1ad7fe[_0x834e('0x39')]:_0x8bc6c6[_0x834e('0x33')];if(!_0x4549ba[_0x834e('0x35')][_0x834e('0x3b')](_0x834e('0x3c'))){_0x1ad7fe['limit']=qs[_0x834e('0x3d')](_0x4549ba[_0x834e('0x35')]['limit']);_0x1ad7fe[_0x834e('0x24')]=qs['offset'](_0x4549ba[_0x834e('0x35')][_0x834e('0x24')]);}_0x1ad7fe['order']=qs[_0x834e('0x3f')](_0x4549ba[_0x834e('0x35')][_0x834e('0x3f')]);_0x1ad7fe[_0x834e('0x40')]=qs['filters'](_[_0x834e('0x52')](_0x4549ba[_0x834e('0x35')],_0x8bc6c6[_0x834e('0x36')]));if(_0x4549ba['query'][_0x834e('0x41')]){_0x1ad7fe[_0x834e('0x40')]=_[_0x834e('0x42')](_0x1ad7fe[_0x834e('0x40')],{'$or':_[_0x834e('0x53')](_0x1ad7fe[_0x834e('0x39')],function(_0x3a1426){var _0x1def00={};_0x1def00[_0x3a1426]={'$like':'%'+_0x4549ba[_0x834e('0x35')][_0x834e('0x41')]+'%'};return _0x1def00;})});}_0x1ad7fe=_[_0x834e('0x42')]({},_0x1ad7fe,_0x4549ba[_0x834e('0x4b')]);var _0x1b7045={'where':_0x1ad7fe[_0x834e('0x40')]};return db[_0x834e('0x31')][_0x834e('0x23')](_0x1b7045)[_0x834e('0x2c')](function(_0x14ed83){_0x3e0550[_0x834e('0x23')]=_0x14ed83;if(_0x4549ba[_0x834e('0x35')][_0x834e('0x47')]){_0x1ad7fe[_0x834e('0x48')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x834e('0x54')](_0x1ad7fe);})[_0x834e('0x2c')](function(_0x45bcc2){_0x3e0550[_0x834e('0x55')]=_0x45bcc2;return _0x3e0550;})['then'](respondWithFilteredResult(_0x4a8b32,_0x1ad7fe,_0x834e('0x51')))['catch'](handleError(_0x4a8b32,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x008c=['update','then','destroy','send','index','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','merge','options','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getVoiceQueuesReport','pick','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','save'];(function(_0x5c5190,_0x32ed54){var _0x2c1774=function(_0x4c40ae){while(--_0x4c40ae){_0x5c5190['push'](_0x5c5190['shift']());}};_0x2c1774(++_0x32ed54);}(_0x008c,0x188));var _0xc008=function(_0x3b58c9,_0x1f46c3){_0x3b58c9=_0x3b58c9-0x0;var _0x5b653a=_0x008c[_0x3b58c9];return _0x5b653a;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc008('0x12'))(_0xc008('0x13'));var utils=require('../../config/utils');var config=require(_0xc008('0x14'));var db=require(_0xc008('0x15'))['db'];config[_0xc008('0x16')]=_[_0xc008('0x17')](config[_0xc008('0x16')],{'host':_0xc008('0x18'),'port':0x18eb});var socket=require(_0xc008('0x19'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0xc008('0x1a')](socket);function respondWithStatusCode(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xcc;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x1b')](_0x25e13f);}return _0x50c1ab[_0xc008('0x1c')](_0x25e13f)[_0xc008('0x1d')]();};}function respondWithResult(_0x5ee00b,_0x5e894e){_0x5e894e=_0x5e894e||0xc8;return function(_0x4bd0f4){if(_0x4bd0f4){return _0x5ee00b[_0xc008('0x1c')](_0x5e894e)[_0xc008('0x1e')](_0x4bd0f4);}};}function respondWithFilteredResult(_0x3cafe3,_0x3eb12a){return function(_0x4fe771){if(_0x4fe771){var _0x53b06e=_0x4fe771[_0xc008('0x1f')],_0x540e45=_0x3eb12a['offset'],_0x5c2668=_0x3eb12a[_0xc008('0x20')]+_0x3eb12a['limit'],_0x46042b;if(_0x5c2668>=_0x53b06e){_0x5c2668=_0x53b06e;_0x46042b=0xc8;}else{_0x46042b=0xce;}_0x3cafe3['status'](_0x46042b);return _0x3cafe3['set']('Content-Range',_0x540e45+'-'+_0x5c2668+'/'+_0x53b06e)[_0xc008('0x1e')](_0x4fe771);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x21')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x22')](_0x4777a6)[_0xc008('0x23')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x24')]()[_0xc008('0x23')](function(){_0x459fd9[_0xc008('0x1c')](0xcc)[_0xc008('0x1d')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x1b')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x25')](_0x2e31c2);};}exports[_0xc008('0x26')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=db['VoiceQueueReport'][_0xc008('0x27')];_0x32390d[_0xc008('0x28')]=_['keys'](_0x2a7d4f);_0x32390d['query']=_['keys'](_0x25eae4[_0xc008('0x29')]);_0x32390d[_0xc008('0x2a')]=_[_0xc008('0x2b')](_0x32390d[_0xc008('0x28')],_0x32390d[_0xc008('0x29')]);_0x24c14c[_0xc008('0x2c')]=_[_0xc008('0x2b')](_0x32390d[_0xc008('0x28')],qs[_0xc008('0x2d')](_0x25eae4[_0xc008('0x29')][_0xc008('0x2d')]));_0x24c14c[_0xc008('0x2c')]=_0x24c14c['attributes'][_0xc008('0x2e')]?_0x24c14c[_0xc008('0x2c')]:_0x32390d['model'];if(!_0x25eae4[_0xc008('0x29')][_0xc008('0x2f')](_0xc008('0x30'))){_0x24c14c[_0xc008('0x31')]=qs[_0xc008('0x31')](_0x25eae4[_0xc008('0x29')][_0xc008('0x31')]);_0x24c14c[_0xc008('0x20')]=qs[_0xc008('0x20')](_0x25eae4['query'][_0xc008('0x20')]);}_0x24c14c[_0xc008('0x32')]=qs[_0xc008('0x33')](_0x25eae4[_0xc008('0x29')][_0xc008('0x33')]);_0x24c14c[_0xc008('0x34')]=qs[_0xc008('0x2a')](_['pick'](_0x25eae4[_0xc008('0x29')],_0x32390d[_0xc008('0x2a')]));if(_0x25eae4['query'][_0xc008('0x35')]){_0x24c14c[_0xc008('0x34')]=_['merge'](_0x24c14c[_0xc008('0x34')],{'$or':_[_0xc008('0x36')](_0x2a7d4f,function(_0x280e9b){if(_0x280e9b['type']['key']!=='VIRTUAL'){var _0x234f2a={};_0x234f2a[_0x280e9b['field']]={'$like':'%'+_0x25eae4[_0xc008('0x29')][_0xc008('0x35')]+'%'};return _0x234f2a;}})});}_0x24c14c=_[_0xc008('0x37')]({},_0x24c14c,_0x25eae4[_0xc008('0x38')]);var _0x3148e1={'where':_0x24c14c[_0xc008('0x34')]};return db[_0xc008('0x39')][_0xc008('0x1f')](_0x3148e1)[_0xc008('0x23')](function(_0x387dfd){_0x209591[_0xc008('0x1f')]=_0x387dfd;if(_0x25eae4[_0xc008('0x29')][_0xc008('0x3a')]){_0x24c14c[_0xc008('0x3b')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xc008('0x3c')](_0x24c14c);})[_0xc008('0x23')](function(_0x30b7df){_0x209591[_0xc008('0x3d')]=_0x30b7df;return _0x209591;})['then'](respondWithFilteredResult(_0x529961,_0x24c14c))[_0xc008('0x3e')](handleError(_0x529961,null));};exports[_0xc008('0x3f')]=function(_0xc8cb91,_0x36e7ae){var _0x2d142d={'raw':![],'where':{'id':_0xc8cb91[_0xc008('0x40')]['id']}},_0x5706bb={};_0x5706bb[_0xc008('0x28')]=_[_0xc008('0x41')](db[_0xc008('0x39')][_0xc008('0x27')]);_0x5706bb['query']=_[_0xc008('0x41')](_0xc8cb91[_0xc008('0x29')]);_0x5706bb[_0xc008('0x2a')]=_[_0xc008('0x2b')](_0x5706bb['model'],_0x5706bb[_0xc008('0x29')]);_0x2d142d[_0xc008('0x2c')]=_[_0xc008('0x2b')](_0x5706bb['model'],qs[_0xc008('0x2d')](_0xc8cb91['query'][_0xc008('0x2d')]));_0x2d142d['attributes']=_0x2d142d[_0xc008('0x2c')][_0xc008('0x2e')]?_0x2d142d['attributes']:_0x5706bb[_0xc008('0x28')];if(_0xc8cb91[_0xc008('0x29')][_0xc008('0x3a')]){_0x2d142d['include']=[{'all':!![]}];}_0x2d142d=_[_0xc008('0x37')]({},_0x2d142d,_0xc8cb91[_0xc008('0x38')]);return db[_0xc008('0x39')][_0xc008('0x42')](_0x2d142d)[_0xc008('0x23')](handleEntityNotFound(_0x36e7ae,null))[_0xc008('0x23')](respondWithResult(_0x36e7ae,null))['catch'](handleError(_0x36e7ae,null));};exports['create']=function(_0x5283a8,_0x4552ed){return db[_0xc008('0x39')][_0xc008('0x43')](_0x5283a8[_0xc008('0x44')],{})[_0xc008('0x23')](respondWithResult(_0x4552ed,0xc9))[_0xc008('0x3e')](handleError(_0x4552ed,null));};exports[_0xc008('0x22')]=function(_0x33be4f,_0x572593){if(_0x33be4f['body']['id']){delete _0x33be4f['body']['id'];}return db[_0xc008('0x39')][_0xc008('0x42')]({'where':{'id':_0x33be4f[_0xc008('0x40')]['id']}})['then'](handleEntityNotFound(_0x572593,null))[_0xc008('0x23')](saveUpdates(_0x33be4f[_0xc008('0x44')],null))[_0xc008('0x23')](respondWithResult(_0x572593,null))[_0xc008('0x3e')](handleError(_0x572593,null));};exports[_0xc008('0x24')]=function(_0x56e4ac,_0x17ec90){return db[_0xc008('0x39')][_0xc008('0x42')]({'where':{'id':_0x56e4ac[_0xc008('0x40')]['id']}})['then'](handleEntityNotFound(_0x17ec90,null))['then'](removeEntity(_0x17ec90,null))[_0xc008('0x3e')](handleError(_0x17ec90,null));};exports['describe']=function(_0x437fef,_0x36e6f8){return db[_0xc008('0x39')]['describe']()[_0xc008('0x23')](respondWithResult(_0x36e6f8,null))[_0xc008('0x3e')](handleError(_0x36e6f8,null));};exports[_0xc008('0x45')]=function(_0x8b9775,_0x750cc9){var _0x51105f={},_0x3a7b3b={},_0x27b022={'count':0x0,'rows':[]};_0x3a7b3b['model']=_[_0xc008('0x41')](db[_0xc008('0x39')]['rawAttributes']);_0x3a7b3b['query']=_[_0xc008('0x41')](_0x8b9775[_0xc008('0x29')]);_0x3a7b3b[_0xc008('0x2a')]=_[_0xc008('0x2b')](_0x3a7b3b[_0xc008('0x28')],_0x3a7b3b['query']);_0x51105f['attributes']=_[_0xc008('0x2b')](_0x3a7b3b['model'],qs[_0xc008('0x2d')](_0x8b9775[_0xc008('0x29')][_0xc008('0x2d')]));_0x51105f[_0xc008('0x2c')]=_0x51105f[_0xc008('0x2c')][_0xc008('0x2e')]?_0x51105f['attributes']:_0x3a7b3b[_0xc008('0x28')];if(!_0x8b9775[_0xc008('0x29')][_0xc008('0x2f')](_0xc008('0x30'))){_0x51105f[_0xc008('0x31')]=qs['limit'](_0x8b9775[_0xc008('0x29')]['limit']);_0x51105f['offset']=qs['offset'](_0x8b9775[_0xc008('0x29')][_0xc008('0x20')]);}_0x51105f[_0xc008('0x32')]=qs['sort'](_0x8b9775[_0xc008('0x29')][_0xc008('0x33')]);_0x51105f[_0xc008('0x34')]=qs['filters'](_[_0xc008('0x46')](_0x8b9775[_0xc008('0x29')],_0x3a7b3b[_0xc008('0x2a')]));if(_0x8b9775[_0xc008('0x29')]['filter']){_0x51105f[_0xc008('0x34')]=_['merge'](_0x51105f[_0xc008('0x34')],{'$or':_[_0xc008('0x36')](_0x51105f[_0xc008('0x2c')],function(_0x943c91){var _0x192c87={};_0x192c87[_0x943c91]={'$like':'%'+_0x8b9775[_0xc008('0x29')]['filter']+'%'};return _0x192c87;})});}_0x51105f=_[_0xc008('0x37')]({},_0x51105f,_0x8b9775['options']);var _0x5bf4a9={'where':_0x51105f[_0xc008('0x34')]};return db[_0xc008('0x39')]['count'](_0x5bf4a9)[_0xc008('0x23')](function(_0xb8ba7){_0x27b022[_0xc008('0x1f')]=_0xb8ba7;if(_0x8b9775[_0xc008('0x29')][_0xc008('0x3a')]){_0x51105f[_0xc008('0x3b')]=[{'all':!![]}];}return db[_0xc008('0x39')]['findAll'](_0x51105f);})[_0xc008('0x23')](function(_0x462e1e){_0x27b022[_0xc008('0x3d')]=_0x462e1e;return _0x27b022;})[_0xc008('0x23')](respondWithFilteredResult(_0x750cc9,_0x51105f,_0xc008('0x45')))[_0xc008('0x3e')](handleError(_0x750cc9,null,_0xc008('0x45')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 4970383..16bba4c 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 _0x2cec=['hook','exports','setMaxListeners','save','update','remove'];(function(_0x5eaf71,_0x5c7d1c){var _0x17a58a=function(_0x122f1c){while(--_0x122f1c){_0x5eaf71['push'](_0x5eaf71['shift']());}};_0x17a58a(++_0x5c7d1c);}(_0x2cec,0x158));var _0xc2ce=function(_0xca95f3,_0x3618e7){_0xca95f3=_0xca95f3-0x0;var _0x3e8a26=_0x2cec[_0xca95f3];return _0x3e8a26;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xc2ce('0x0')](0x0);var events={'afterCreate':_0xc2ce('0x1'),'afterUpdate':_0xc2ce('0x2'),'afterDestroy':_0xc2ce('0x3')};function emitEvent(_0x15a741){return function(_0x1e0224,_0x17aeb1,_0x3c8c9b){VoiceQueueReportEvents['emit'](_0x15a741+':'+_0x1e0224['id'],_0x1e0224);VoiceQueueReportEvents['emit'](_0x15a741,_0x1e0224);_0x3c8c9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xc2ce('0x4')](e,emitEvent(event));}}module[_0xc2ce('0x5')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x6462=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueueReport'];(function(_0x34bd34,_0x1444f7){var _0x4e36d6=function(_0x20ed8e){while(--_0x20ed8e){_0x34bd34['push'](_0x34bd34['shift']());}};_0x4e36d6(++_0x1444f7);}(_0x6462,0x65));var _0x2646=function(_0x937ba2,_0x13032a){_0x937ba2=_0x937ba2-0x0;var _0x3b6e7e=_0x6462[_0x937ba2];return _0x3b6e7e;};'use strict';var EventEmitter=require(_0x2646('0x0'));var VoiceQueueReport=require(_0x2646('0x1'))['db'][_0x2646('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2646('0x3'),'afterDestroy':_0x2646('0x4')};function emitEvent(_0x543e78){return function(_0x149875,_0x1ca4e0,_0x2b28a6){VoiceQueueReportEvents[_0x2646('0x5')](_0x543e78+':'+_0x149875['id'],_0x149875);VoiceQueueReportEvents['emit'](_0x543e78,_0x149875);_0x2b28a6(null);};}for(var e in events){if(events[_0x2646('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x2646('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index a558c44..34b2cba 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 _0xb10b=['define','report_queue','uniqueid','calleridnum','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x3f8720,_0x1c812c){var _0x197a82=function(_0x4966a4){while(--_0x4966a4){_0x3f8720['push'](_0x3f8720['shift']());}};_0x197a82(++_0x1c812c);}(_0xb10b,0x12a));var _0xbb10=function(_0x386078,_0x49ad4f){_0x386078=_0x386078-0x0;var _0xd6675c=_0xb10b[_0x386078];return _0xd6675c;};'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 +var _0x757a=['./voiceQueueReport.attributes','exports','define','report_queue','uniqueid','calleridnum','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x3cabac,_0x2c94ff){var _0x2983ee=function(_0x54e999){while(--_0x54e999){_0x3cabac['push'](_0x3cabac['shift']());}};_0x2983ee(++_0x2c94ff);}(_0x757a,0xde));var _0xa757=function(_0xd484f6,_0x574a1f){_0xd484f6=_0xd484f6-0x0;var _0x4015fb=_0x757a[_0xd484f6];return _0x4015fb;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('VoiceQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa757('0xa')]},{'fields':[_0xa757('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index ebb443a..e4c7a18 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 _0xf9e9=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceQueueReport','findAll','options','raw','where','map','model','include','attributes','catch','VoiceQueueReport','body','CreateVoiceQueueReport','update','UpdateVoiceQueueReport','lodash','util'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xf9e9,0xd5));var _0x9f9e=function(_0x378b4,_0x5ca7fa){_0x378b4=_0x378b4-0x0;var _0x11d07b=_0xf9e9[_0x378b4];return _0x11d07b;};'use strict';var _=require(_0x9f9e('0x0'));var util=require(_0x9f9e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9f9e('0x2'));var fs=require('fs');var Redis=require(_0x9f9e('0x3'));var db=require(_0x9f9e('0x4'))['db'];var utils=require(_0x9f9e('0x5'));var logger=require(_0x9f9e('0x6'))(_0x9f9e('0x7'));var config=require(_0x9f9e('0x8'));var jayson=require(_0x9f9e('0x9'));var client=jayson[_0x9f9e('0xa')][_0x9f9e('0xb')]({'port':0x232a});config[_0x9f9e('0xc')]=_['defaults'](config[_0x9f9e('0xc')],{'host':_0x9f9e('0xd'),'port':0x18eb});var socket=require(_0x9f9e('0xe'))(new Redis(config[_0x9f9e('0xc')]));require(_0x9f9e('0xf'))[_0x9f9e('0x10')](socket);function respondWithRpcPromise(_0x14c11d,_0x63bb82,_0x34c23f){return new BPromise(function(_0xf16aab,_0x41a940){return client[_0x9f9e('0x11')](_0x14c11d,_0x34c23f)[_0x9f9e('0x12')](function(_0x3b12d4){logger[_0x9f9e('0x13')](_0x9f9e('0x14'),_0x63bb82,_0x9f9e('0x15'));logger[_0x9f9e('0x16')](_0x9f9e('0x17'),_0x63bb82,'request\x20sent',JSON[_0x9f9e('0x18')](_0x3b12d4));if(_0x3b12d4[_0x9f9e('0x19')]){if(_0x3b12d4[_0x9f9e('0x19')]['code']===0x1f4){logger[_0x9f9e('0x19')](_0x9f9e('0x14'),_0x63bb82,_0x3b12d4['error'][_0x9f9e('0x1a')]);return _0x41a940(_0x3b12d4['error'][_0x9f9e('0x1a')]);}logger[_0x9f9e('0x19')](_0x9f9e('0x14'),_0x63bb82,_0x3b12d4[_0x9f9e('0x19')][_0x9f9e('0x1a')]);return _0xf16aab(_0x3b12d4[_0x9f9e('0x19')][_0x9f9e('0x1a')]);}else{logger[_0x9f9e('0x13')](_0x9f9e('0x14'),_0x63bb82,_0x9f9e('0x15'));_0xf16aab(_0x3b12d4[_0x9f9e('0x1b')][_0x9f9e('0x1a')]);}})['catch'](function(_0x4f2848){logger[_0x9f9e('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0x63bb82,_0x4f2848);_0x41a940(_0x4f2848);});});}exports[_0x9f9e('0x1c')]=function(_0x3fe2ab){var _0x1de700=this;return new Promise(function(_0x5b9f5f,_0xe076c2){return db['VoiceQueueReport'][_0x9f9e('0x1d')]({'raw':_0x3fe2ab[_0x9f9e('0x1e')]?_0x3fe2ab[_0x9f9e('0x1e')][_0x9f9e('0x1f')]===undefined?!![]:![]:!![],'where':_0x3fe2ab[_0x9f9e('0x1e')]?_0x3fe2ab[_0x9f9e('0x1e')][_0x9f9e('0x20')]||null:null,'attributes':_0x3fe2ab[_0x9f9e('0x1e')]?_0x3fe2ab[_0x9f9e('0x1e')]['attributes']||null:null,'limit':_0x3fe2ab[_0x9f9e('0x1e')]?_0x3fe2ab['options']['limit']||null:null,'include':_0x3fe2ab[_0x9f9e('0x1e')]?_0x3fe2ab[_0x9f9e('0x1e')]['include']?_[_0x9f9e('0x21')](_0x3fe2ab[_0x9f9e('0x1e')]['include'],function(_0x595180){return{'model':db[_0x595180[_0x9f9e('0x22')]],'as':_0x595180['as'],'attributes':_0x595180['attributes'],'include':_0x595180[_0x9f9e('0x23')]?_[_0x9f9e('0x21')](_0x595180[_0x9f9e('0x23')],function(_0x4cdacb){return{'model':db[_0x4cdacb['model']],'as':_0x4cdacb['as'],'attributes':_0x4cdacb[_0x9f9e('0x24')],'include':_0x4cdacb['include']?_[_0x9f9e('0x21')](_0x4cdacb[_0x9f9e('0x23')],function(_0x395aed){return{'model':db[_0x395aed['model']],'as':_0x395aed['as'],'attributes':_0x395aed[_0x9f9e('0x24')]};}):[]};}):[]};}):[]:[]})[_0x9f9e('0x12')](function(_0x1c2a31){logger['info']('GetVoiceQueueReport',_0x3fe2ab);logger['debug'](_0x9f9e('0x1c'),_0x3fe2ab,JSON[_0x9f9e('0x18')](_0x1c2a31));_0x5b9f5f(_0x1c2a31);})[_0x9f9e('0x25')](function(_0x236f5b){logger[_0x9f9e('0x19')](_0x9f9e('0x1c'),_0x236f5b[_0x9f9e('0x1a')],_0x3fe2ab);_0xe076c2(_0x1de700[_0x9f9e('0x19')](0x1f4,_0x236f5b[_0x9f9e('0x1a')]));});});};exports['CreateVoiceQueueReport']=function(_0x30eb54){var _0x4418fe=this;return new Promise(function(_0x4ce4b7,_0x248e02){return db[_0x9f9e('0x26')]['create'](_0x30eb54[_0x9f9e('0x27')],{'raw':_0x30eb54['options']?_0x30eb54[_0x9f9e('0x1e')][_0x9f9e('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0xa0d860){logger[_0x9f9e('0x13')](_0x9f9e('0x28'),_0x30eb54);logger[_0x9f9e('0x16')](_0x9f9e('0x28'),_0x30eb54,JSON['stringify'](_0xa0d860));_0x4ce4b7(_0xa0d860);})[_0x9f9e('0x25')](function(_0x2aa440){logger['error'](_0x9f9e('0x28'),_0x2aa440[_0x9f9e('0x1a')],_0x30eb54);_0x248e02(_0x4418fe[_0x9f9e('0x19')](0x1f4,_0x2aa440[_0x9f9e('0x1a')]));});});};exports['UpdateVoiceQueueReport']=function(_0x1b7e48){var _0x2b8030=this;return new Promise(function(_0x2e0ede,_0x941a8a){return db[_0x9f9e('0x26')][_0x9f9e('0x29')](_0x1b7e48[_0x9f9e('0x27')],{'raw':_0x1b7e48[_0x9f9e('0x1e')]?_0x1b7e48[_0x9f9e('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7e48['options']?_0x1b7e48[_0x9f9e('0x1e')][_0x9f9e('0x20')]||null:null,'attributes':_0x1b7e48[_0x9f9e('0x1e')]?_0x1b7e48[_0x9f9e('0x1e')][_0x9f9e('0x24')]||null:null,'limit':_0x1b7e48[_0x9f9e('0x1e')]?_0x1b7e48['options']['limit']||null:null})[_0x9f9e('0x12')](function(_0x4cafd9){logger[_0x9f9e('0x13')](_0x9f9e('0x2a'),_0x1b7e48);logger[_0x9f9e('0x16')](_0x9f9e('0x2a'),_0x1b7e48,JSON[_0x9f9e('0x18')](_0x4cafd9));_0x2e0ede(_0x4cafd9);})[_0x9f9e('0x25')](function(_0xa9c71){logger[_0x9f9e('0x19')]('UpdateVoiceQueueReport',_0xa9c71[_0x9f9e('0x1a')],_0x1b7e48);_0x941a8a(_0x2b8030[_0x9f9e('0x19')](0x1f4,_0xa9c71[_0x9f9e('0x1a')]));});});}; \ No newline at end of file +var _0xc063=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','include','map','model','attributes','stringify','CreateVoiceQueueReport','create','body','raw','UpdateVoiceQueueReport','update','limit','lodash','util'];(function(_0x503fd4,_0x12c099){var _0x40ae05=function(_0x352637){while(--_0x352637){_0x503fd4['push'](_0x503fd4['shift']());}};_0x40ae05(++_0x12c099);}(_0xc063,0x1d7));var _0x3c06=function(_0x444716,_0x1fd1ef){_0x444716=_0x444716-0x0;var _0x9e6df5=_0xc063[_0x444716];return _0x9e6df5;};'use strict';var _=require(_0x3c06('0x0'));var util=require(_0x3c06('0x1'));var moment=require(_0x3c06('0x2'));var BPromise=require(_0x3c06('0x3'));var rs=require(_0x3c06('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c06('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3c06('0x6'))('rpc');var config=require(_0x3c06('0x7'));var jayson=require(_0x3c06('0x8'));var client=jayson[_0x3c06('0x9')][_0x3c06('0xa')]({'port':0x232a});config[_0x3c06('0xb')]=_['defaults'](config['redis'],{'host':_0x3c06('0xc'),'port':0x18eb});var socket=require(_0x3c06('0xd'))(new Redis(config['redis']));require(_0x3c06('0xe'))[_0x3c06('0xf')](socket);function respondWithRpcPromise(_0x41e580,_0x3a6848,_0x3e9fd1){return new BPromise(function(_0x493f83,_0x3a8472){return client['request'](_0x41e580,_0x3e9fd1)[_0x3c06('0x10')](function(_0x25de96){logger[_0x3c06('0x11')](_0x3c06('0x12'),_0x3a6848,_0x3c06('0x13'));logger[_0x3c06('0x14')](_0x3c06('0x15'),_0x3a6848,_0x3c06('0x13'),JSON['stringify'](_0x25de96));if(_0x25de96[_0x3c06('0x16')]){if(_0x25de96[_0x3c06('0x16')][_0x3c06('0x17')]===0x1f4){logger[_0x3c06('0x16')](_0x3c06('0x12'),_0x3a6848,_0x25de96[_0x3c06('0x16')]['message']);return _0x3a8472(_0x25de96['error']['message']);}logger[_0x3c06('0x16')](_0x3c06('0x12'),_0x3a6848,_0x25de96[_0x3c06('0x16')][_0x3c06('0x18')]);return _0x493f83(_0x25de96['error'][_0x3c06('0x18')]);}else{logger['info'](_0x3c06('0x12'),_0x3a6848,_0x3c06('0x13'));_0x493f83(_0x25de96['result'][_0x3c06('0x18')]);}})[_0x3c06('0x19')](function(_0x2fcca8){logger[_0x3c06('0x16')](_0x3c06('0x12'),_0x3a6848,_0x2fcca8);_0x3a8472(_0x2fcca8);});});}exports[_0x3c06('0x1a')]=function(_0x52ee49){var _0x1f69ac=this;return new Promise(function(_0x11dd9,_0x1650f6){return db[_0x3c06('0x1b')][_0x3c06('0x1c')]({'raw':_0x52ee49[_0x3c06('0x1d')]?_0x52ee49[_0x3c06('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x52ee49[_0x3c06('0x1d')]?_0x52ee49['options'][_0x3c06('0x1e')]||null:null,'attributes':_0x52ee49[_0x3c06('0x1d')]?_0x52ee49['options']['attributes']||null:null,'limit':_0x52ee49[_0x3c06('0x1d')]?_0x52ee49[_0x3c06('0x1d')]['limit']||null:null,'include':_0x52ee49[_0x3c06('0x1d')]?_0x52ee49['options'][_0x3c06('0x1f')]?_[_0x3c06('0x20')](_0x52ee49[_0x3c06('0x1d')][_0x3c06('0x1f')],function(_0x256559){return{'model':db[_0x256559[_0x3c06('0x21')]],'as':_0x256559['as'],'attributes':_0x256559[_0x3c06('0x22')],'include':_0x256559[_0x3c06('0x1f')]?_[_0x3c06('0x20')](_0x256559[_0x3c06('0x1f')],function(_0x3d4f05){return{'model':db[_0x3d4f05[_0x3c06('0x21')]],'as':_0x3d4f05['as'],'attributes':_0x3d4f05[_0x3c06('0x22')],'include':_0x3d4f05[_0x3c06('0x1f')]?_[_0x3c06('0x20')](_0x3d4f05[_0x3c06('0x1f')],function(_0x2b9f0c){return{'model':db[_0x2b9f0c['model']],'as':_0x2b9f0c['as'],'attributes':_0x2b9f0c['attributes']};}):[]};}):[]};}):[]:[]})[_0x3c06('0x10')](function(_0x1b8bd4){logger[_0x3c06('0x11')](_0x3c06('0x1a'),_0x52ee49);logger[_0x3c06('0x14')](_0x3c06('0x1a'),_0x52ee49,JSON[_0x3c06('0x23')](_0x1b8bd4));_0x11dd9(_0x1b8bd4);})[_0x3c06('0x19')](function(_0x1f5b38){logger[_0x3c06('0x16')](_0x3c06('0x1a'),_0x1f5b38['message'],_0x52ee49);_0x1650f6(_0x1f69ac['error'](0x1f4,_0x1f5b38[_0x3c06('0x18')]));});});};exports[_0x3c06('0x24')]=function(_0x53272f){var _0x422ace=this;return new Promise(function(_0x128600,_0x12640b){return db[_0x3c06('0x1b')][_0x3c06('0x25')](_0x53272f[_0x3c06('0x26')],{'raw':_0x53272f[_0x3c06('0x1d')]?_0x53272f[_0x3c06('0x1d')][_0x3c06('0x27')]===undefined?!![]:![]:!![]})[_0x3c06('0x10')](function(_0x5d996e){logger['info'](_0x3c06('0x24'),_0x53272f);logger['debug'](_0x3c06('0x24'),_0x53272f,JSON[_0x3c06('0x23')](_0x5d996e));_0x128600(_0x5d996e);})[_0x3c06('0x19')](function(_0x14dc3f){logger[_0x3c06('0x16')]('CreateVoiceQueueReport',_0x14dc3f['message'],_0x53272f);_0x12640b(_0x422ace[_0x3c06('0x16')](0x1f4,_0x14dc3f['message']));});});};exports[_0x3c06('0x28')]=function(_0x3e2738){var _0x103bf0=this;return new Promise(function(_0x246f5a,_0x5861dd){return db[_0x3c06('0x1b')][_0x3c06('0x29')](_0x3e2738['body'],{'raw':_0x3e2738['options']?_0x3e2738[_0x3c06('0x1d')][_0x3c06('0x27')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e2738[_0x3c06('0x1d')]?_0x3e2738[_0x3c06('0x1d')][_0x3c06('0x1e')]||null:null,'attributes':_0x3e2738[_0x3c06('0x1d')]?_0x3e2738[_0x3c06('0x1d')][_0x3c06('0x22')]||null:null,'limit':_0x3e2738[_0x3c06('0x1d')]?_0x3e2738[_0x3c06('0x1d')][_0x3c06('0x2a')]||null:null})['then'](function(_0x27e068){logger[_0x3c06('0x11')](_0x3c06('0x28'),_0x3e2738);logger[_0x3c06('0x14')](_0x3c06('0x28'),_0x3e2738,JSON['stringify'](_0x27e068));_0x246f5a(_0x27e068);})[_0x3c06('0x19')](function(_0x5e79f4){logger['error']('UpdateVoiceQueueReport',_0x5e79f4['message'],_0x3e2738);_0x5861dd(_0x103bf0[_0x3c06('0x16')](0x1f4,_0x5e79f4[_0x3c06('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 8b5332f..c94f723 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 _0x28fc=['emit','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update'];(function(_0xe3b7bb,_0x263836){var _0x2df486=function(_0x527828){while(--_0x527828){_0xe3b7bb['push'](_0xe3b7bb['shift']());}};_0x2df486(++_0x263836);}(_0x28fc,0xa4));var _0xc28f=function(_0xf2662b,_0x4d8f41){_0xf2662b=_0xf2662b-0x0;var _0x257dc7=_0x28fc[_0xf2662b];return _0x257dc7;};'use strict';var VoiceQueueReportEvents=require(_0xc28f('0x0'));var events=[_0xc28f('0x1'),_0xc28f('0x2'),_0xc28f('0x3')];function createListener(_0x386165,_0x231443){return function(_0x2c71f6){_0x231443[_0xc28f('0x4')](_0x386165,_0x2c71f6);};}function removeListener(_0x432e82,_0x3eeaa5){return function(){VoiceQueueReportEvents['removeListener'](_0x432e82,_0x3eeaa5);};}exports[_0xc28f('0x5')]=function(_0xcf987a){for(var _0x2e16c4=0x0,_0xbe4eb7=events[_0xc28f('0x6')];_0x2e16c4<_0xbe4eb7;_0x2e16c4++){var _0x59b4fc=events[_0x2e16c4];var _0x8c33b0=createListener(_0xc28f('0x7')+_0x59b4fc,_0xcf987a);VoiceQueueReportEvents['on'](_0x59b4fc,_0x8c33b0);}}; \ No newline at end of file +var _0xd2ae=['update','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove'];(function(_0x2d64ea,_0x237463){var _0x2be05c=function(_0x117d1c){while(--_0x117d1c){_0x2d64ea['push'](_0x2d64ea['shift']());}};_0x2be05c(++_0x237463);}(_0xd2ae,0x12f));var _0xed2a=function(_0x17af5f,_0x50fc70){_0x17af5f=_0x17af5f-0x0;var _0x159e42=_0xd2ae[_0x17af5f];return _0x159e42;};'use strict';var VoiceQueueReportEvents=require(_0xed2a('0x0'));var events=[_0xed2a('0x1'),_0xed2a('0x2'),_0xed2a('0x3')];function createListener(_0x393364,_0x591166){return function(_0x4fc60d){_0x591166[_0xed2a('0x4')](_0x393364,_0x4fc60d);};}function removeListener(_0x28ba9f,_0x31bc90){return function(){VoiceQueueReportEvents[_0xed2a('0x5')](_0x28ba9f,_0x31bc90);};}exports[_0xed2a('0x6')]=function(_0x633a24){for(var _0x44e63e=0x0,_0xa62571=events[_0xed2a('0x7')];_0x44e63e<_0xa62571;_0x44e63e++){var _0x192630=events[_0x44e63e];var _0x37d0ea=createListener(_0xed2a('0x8')+_0x192630,_0x633a24);VoiceQueueReportEvents['on'](_0x192630,_0x37d0ea);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index c266cad..9bc1512 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 _0xc69e=['/:id','post','create','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index'];(function(_0x300bf6,_0x50a167){var _0x196f23=function(_0x5e36a2){while(--_0x5e36a2){_0x300bf6['push'](_0x300bf6['shift']());}};_0x196f23(++_0x50a167);}(_0xc69e,0x1d6));var _0xec69=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xc69e[_0x1cc8fe];return _0x230054;};'use strict';var multer=require('multer');var util=require(_0xec69('0x0'));var path=require(_0xec69('0x1'));var timeout=require(_0xec69('0x2'));var express=require(_0xec69('0x3'));var router=express[_0xec69('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xec69('0x5'));var config=require(_0xec69('0x6'));var controller=require(_0xec69('0x7'));router['get']('/',auth[_0xec69('0x8')](),controller[_0xec69('0x9')]);router['get'](_0xec69('0xa'),auth[_0xec69('0x8')](),controller['show']);router[_0xec69('0xb')]('/',auth[_0xec69('0x8')](),controller[_0xec69('0xc')]);router['put'](_0xec69('0xa'),auth['isAuthenticated'](),controller[_0xec69('0xd')]);router[_0xec69('0xe')](_0xec69('0xa'),auth['isAuthenticated'](),controller[_0xec69('0xf')]);module['exports']=router; \ No newline at end of file +var _0x77e5=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3b42f0,_0x4d5a02){var _0x72bc80=function(_0x1bbbd9){while(--_0x1bbbd9){_0x3b42f0['push'](_0x3b42f0['shift']());}};_0x72bc80(++_0x4d5a02);}(_0x77e5,0xc8));var _0x577e=function(_0x4520bc,_0x91574e){_0x4520bc=_0x4520bc-0x0;var _0x302a85=_0x77e5[_0x4520bc];return _0x302a85;};'use strict';var multer=require(_0x577e('0x0'));var util=require(_0x577e('0x1'));var path=require(_0x577e('0x2'));var timeout=require(_0x577e('0x3'));var express=require(_0x577e('0x4'));var router=express['Router']();var auth=require(_0x577e('0x5'));var interaction=require(_0x577e('0x6'));var config=require(_0x577e('0x7'));var controller=require(_0x577e('0x8'));router[_0x577e('0x9')]('/',auth[_0x577e('0xa')](),controller[_0x577e('0xb')]);router[_0x577e('0x9')](_0x577e('0xc'),auth[_0x577e('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x577e('0xd')](_0x577e('0xc'),auth[_0x577e('0xa')](),controller['update']);router[_0x577e('0xe')](_0x577e('0xc'),auth[_0x577e('0xa')](),controller[_0x577e('0xf')]);module[_0x577e('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index feb5b12..ad052f7 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 _0x85a2=['YYYY-MM-DD\x20HH:mm:ss','moment','exports','STRING','DATE','format'];(function(_0x36c5a6,_0x2aee61){var _0x2f597e=function(_0x700a5){while(--_0x700a5){_0x36c5a6['push'](_0x36c5a6['shift']());}};_0x2f597e(++_0x2aee61);}(_0x85a2,0x11b));var _0x285a=function(_0x3c2e25,_0x47d20e){_0x3c2e25=_0x3c2e25-0x0;var _0x3bb63d=_0x85a2[_0x3c2e25];return _0x3bb63d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x285a('0x0'));module[_0x285a('0x1')]={'time':{'type':Sequelize[_0x285a('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x285a('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x285a('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x285a('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x285a('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x285a('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x285a('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x285a('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x285a('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x285a('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x285a('0x3')],'allowNull':![],'defaultValue':moment()[_0x285a('0x4')](_0x285a('0x5'))}}; \ No newline at end of file +var _0x7b1c=['sequelize','moment','exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x33e556,_0xea4668){var _0x4a12d7=function(_0x2ffef0){while(--_0x2ffef0){_0x33e556['push'](_0x33e556['shift']());}};_0x4a12d7(++_0xea4668);}(_0x7b1c,0x78));var _0xc7b1=function(_0x5c677b,_0x4b7105){_0x5c677b=_0x5c677b-0x0;var _0x3e1988=_0x7b1c[_0x5c677b];return _0x3e1988;};'use strict';var Sequelize=require(_0xc7b1('0x0'));var moment=require(_0xc7b1('0x1'));module[_0xc7b1('0x2')]={'time':{'type':Sequelize[_0xc7b1('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xc7b1('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xc7b1('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xc7b1('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xc7b1('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xc7b1('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xc7b1('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xc7b1('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xc7b1('0x4')],'allowNull':![],'defaultValue':moment()['format'](_0xc7b1('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 030ca35..78a74ba 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 _0x0137=['model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','key','field','options','include','rows','catch','show','params','find','create','body','destroy','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','sendStatus','name','send','index','VoiceQueuesLog','rawAttributes'];(function(_0x49d0f6,_0x48fa26){var _0x52d657=function(_0x4a0b34){while(--_0x4a0b34){_0x49d0f6['push'](_0x49d0f6['shift']());}};_0x52d657(++_0x48fa26);}(_0x0137,0xa4));var _0x7013=function(_0x3f787e,_0x951303){_0x3f787e=_0x3f787e-0x0;var _0x26242d=_0x0137[_0x3f787e];return _0x26242d;};'use strict';var pdf=require(_0x7013('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7013('0x1'));var zipdir=require(_0x7013('0x2'));var jsonpatch=require(_0x7013('0x3'));var rp=require(_0x7013('0x4'));var moment=require(_0x7013('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7013('0x6'));var path=require(_0x7013('0x7'));var sox=require(_0x7013('0x8'));var csv=require(_0x7013('0x9'));var ejs=require(_0x7013('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7013('0xb'));var deskjs=require(_0x7013('0xc'));var toCsv=require(_0x7013('0x9'));var querystring=require('querystring');var Papa=require(_0x7013('0xd'));var Redis=require(_0x7013('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7013('0xf'));var hardwareService=require(_0x7013('0x10'));var logger=require(_0x7013('0x11'))(_0x7013('0x12'));var utils=require(_0x7013('0x13'));var config=require(_0x7013('0x14'));var db=require(_0x7013('0x15'))['db'];function respondWithStatusCode(_0x53656f,_0x3c54b2){_0x3c54b2=_0x3c54b2||0xcc;return function(_0x4c2016){if(_0x4c2016){return _0x53656f['sendStatus'](_0x3c54b2);}return _0x53656f[_0x7013('0x16')](_0x3c54b2)[_0x7013('0x17')]();};}function respondWithResult(_0x3f0aec,_0x1fab2a){_0x1fab2a=_0x1fab2a||0xc8;return function(_0x1a49d7){if(_0x1a49d7){return _0x3f0aec[_0x7013('0x16')](_0x1fab2a)[_0x7013('0x18')](_0x1a49d7);}};}function respondWithFilteredResult(_0x5afd38,_0x17227e){return function(_0x3b039a){if(_0x3b039a){var _0x2e6bcd=_0x3b039a[_0x7013('0x19')],_0x435743=_0x17227e[_0x7013('0x1a')],_0x3663d7=_0x17227e['offset']+_0x17227e[_0x7013('0x1b')],_0xd726de;if(_0x3663d7>=_0x2e6bcd){_0x3663d7=_0x2e6bcd;_0xd726de=0xc8;}else{_0xd726de=0xce;}_0x5afd38['status'](_0xd726de);return _0x5afd38['set'](_0x7013('0x1c'),_0x435743+'-'+_0x3663d7+'/'+_0x2e6bcd)[_0x7013('0x18')](_0x3b039a);}return null;};}function patchUpdates(_0x2cbc45){return function(_0x49961f){try{jsonpatch[_0x7013('0x1d')](_0x49961f,_0x2cbc45,!![]);}catch(_0x4fb6fa){return BPromise[_0x7013('0x1e')](_0x4fb6fa);}return _0x49961f[_0x7013('0x1f')]();};}function saveUpdates(_0x34f09f,_0x55026b){return function(_0x5ef82d){if(_0x5ef82d){return _0x5ef82d[_0x7013('0x20')](_0x34f09f)[_0x7013('0x21')](function(_0x17d696){return _0x17d696;});}return null;};}function removeEntity(_0x376ca1,_0x4cd7da){return function(_0x3136ae){if(_0x3136ae){return _0x3136ae['destroy']()['then'](function(){_0x376ca1[_0x7013('0x16')](0xcc)[_0x7013('0x17')]();});}};}function handleEntityNotFound(_0x5c88e5,_0x534be8){return function(_0x243f04){if(!_0x243f04){_0x5c88e5[_0x7013('0x22')](0x194);}return _0x243f04;};}function handleError(_0x1615d,_0x5dbed8){_0x5dbed8=_0x5dbed8||0x1f4;return function(_0x2578ef){logger['error'](_0x2578ef['stack']);if(_0x2578ef[_0x7013('0x23')]){delete _0x2578ef[_0x7013('0x23')];}_0x1615d[_0x7013('0x16')](_0x5dbed8)[_0x7013('0x24')](_0x2578ef);};}exports[_0x7013('0x25')]=function(_0x16ca2a,_0x4b1295){var _0x3b5b68={},_0x564f9a={},_0x187035={'count':0x0,'rows':[]};var _0x108f6b=db[_0x7013('0x26')][_0x7013('0x27')];_0x564f9a[_0x7013('0x28')]=_['keys'](_0x108f6b);_0x564f9a[_0x7013('0x29')]=_[_0x7013('0x2a')](_0x16ca2a[_0x7013('0x29')]);_0x564f9a['filters']=_['intersection'](_0x564f9a[_0x7013('0x28')],_0x564f9a[_0x7013('0x29')]);_0x3b5b68[_0x7013('0x2b')]=_[_0x7013('0x2c')](_0x564f9a[_0x7013('0x28')],qs[_0x7013('0x2d')](_0x16ca2a[_0x7013('0x29')][_0x7013('0x2d')]));_0x3b5b68[_0x7013('0x2b')]=_0x3b5b68[_0x7013('0x2b')][_0x7013('0x2e')]?_0x3b5b68[_0x7013('0x2b')]:_0x564f9a['model'];if(!_0x16ca2a[_0x7013('0x29')][_0x7013('0x2f')]('nolimit')){_0x3b5b68[_0x7013('0x1b')]=qs['limit'](_0x16ca2a['query']['limit']);_0x3b5b68[_0x7013('0x1a')]=qs[_0x7013('0x1a')](_0x16ca2a[_0x7013('0x29')][_0x7013('0x1a')]);}_0x3b5b68[_0x7013('0x30')]=qs[_0x7013('0x31')](_0x16ca2a[_0x7013('0x29')]['sort']);_0x3b5b68[_0x7013('0x32')]=qs[_0x7013('0x33')](_[_0x7013('0x34')](_0x16ca2a[_0x7013('0x29')],_0x564f9a[_0x7013('0x33')]));if(_0x16ca2a[_0x7013('0x29')][_0x7013('0x35')]){_0x3b5b68['where']=_[_0x7013('0x36')](_0x3b5b68[_0x7013('0x32')],{'$or':_['map'](_0x108f6b,function(_0x2d92af){if(_0x2d92af[_0x7013('0x37')][_0x7013('0x38')]!=='VIRTUAL'){var _0x59cf42={};_0x59cf42[_0x2d92af[_0x7013('0x39')]]={'$like':'%'+_0x16ca2a[_0x7013('0x29')]['filter']+'%'};return _0x59cf42;}})});}_0x3b5b68=_[_0x7013('0x36')]({},_0x3b5b68,_0x16ca2a[_0x7013('0x3a')]);var _0x2fefe7={'where':_0x3b5b68[_0x7013('0x32')]};return db[_0x7013('0x26')][_0x7013('0x19')](_0x2fefe7)[_0x7013('0x21')](function(_0x48b395){_0x187035[_0x7013('0x19')]=_0x48b395;if(_0x16ca2a[_0x7013('0x29')]['includeAll']){_0x3b5b68[_0x7013('0x3b')]=[{'all':!![]}];}return db[_0x7013('0x26')]['findAll'](_0x3b5b68);})[_0x7013('0x21')](function(_0xcbda92){_0x187035[_0x7013('0x3c')]=_0xcbda92;return _0x187035;})[_0x7013('0x21')](respondWithFilteredResult(_0x4b1295,_0x3b5b68))[_0x7013('0x3d')](handleError(_0x4b1295,null));};exports[_0x7013('0x3e')]=function(_0x1e3492,_0x3ae386){var _0x13fc85={'raw':!![],'where':{'id':_0x1e3492[_0x7013('0x3f')]['id']}},_0x26ca9d={};_0x26ca9d[_0x7013('0x28')]=_[_0x7013('0x2a')](db[_0x7013('0x26')][_0x7013('0x27')]);_0x26ca9d[_0x7013('0x29')]=_['keys'](_0x1e3492[_0x7013('0x29')]);_0x26ca9d['filters']=_['intersection'](_0x26ca9d[_0x7013('0x28')],_0x26ca9d['query']);_0x13fc85['attributes']=_[_0x7013('0x2c')](_0x26ca9d[_0x7013('0x28')],qs[_0x7013('0x2d')](_0x1e3492[_0x7013('0x29')]['fields']));_0x13fc85[_0x7013('0x2b')]=_0x13fc85['attributes']['length']?_0x13fc85['attributes']:_0x26ca9d[_0x7013('0x28')];if(_0x1e3492[_0x7013('0x29')]['includeAll']){_0x13fc85['include']=[{'all':!![]}];}_0x13fc85=_[_0x7013('0x36')]({},_0x13fc85,_0x1e3492[_0x7013('0x3a')]);return db[_0x7013('0x26')][_0x7013('0x40')](_0x13fc85)['then'](handleEntityNotFound(_0x3ae386,null))[_0x7013('0x21')](respondWithResult(_0x3ae386,null))['catch'](handleError(_0x3ae386,null));};exports['create']=function(_0x22f92c,_0x208c5f){return db[_0x7013('0x26')][_0x7013('0x41')](_0x22f92c[_0x7013('0x42')],{})[_0x7013('0x21')](respondWithResult(_0x208c5f,0xc9))[_0x7013('0x3d')](handleError(_0x208c5f,null));};exports[_0x7013('0x20')]=function(_0x48c7cc,_0x1a40ef){if(_0x48c7cc[_0x7013('0x42')]['id']){delete _0x48c7cc[_0x7013('0x42')]['id'];}return db[_0x7013('0x26')][_0x7013('0x40')]({'where':{'id':_0x48c7cc[_0x7013('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1a40ef,null))[_0x7013('0x21')](saveUpdates(_0x48c7cc[_0x7013('0x42')],null))['then'](respondWithResult(_0x1a40ef,null))[_0x7013('0x3d')](handleError(_0x1a40ef,null));};exports[_0x7013('0x43')]=function(_0x2b626c,_0x33185d){return db[_0x7013('0x26')][_0x7013('0x40')]({'where':{'id':_0x2b626c[_0x7013('0x3f')]['id']}})[_0x7013('0x21')](handleEntityNotFound(_0x33185d,null))[_0x7013('0x21')](removeEntity(_0x33185d,null))[_0x7013('0x3d')](handleError(_0x33185d,null));}; \ No newline at end of file +var _0x0da2=['moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','VoiceQueuesLog','catch','show','params','includeAll','include','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x573836,_0x599996){var _0x3d9709=function(_0x5b9e90){while(--_0x5b9e90){_0x573836['push'](_0x573836['shift']());}};_0x3d9709(++_0x599996);}(_0x0da2,0x85));var _0x20da=function(_0xe87fcb,_0x290f06){_0xe87fcb=_0xe87fcb-0x0;var _0x38f676=_0x0da2[_0xe87fcb];return _0x38f676;};'use strict';var pdf=require(_0x20da('0x0'));var emlformat=require(_0x20da('0x1'));var rimraf=require(_0x20da('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x20da('0x3'));var rp=require(_0x20da('0x4'));var moment=require(_0x20da('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x20da('0x6'));var util=require(_0x20da('0x7'));var path=require('path');var sox=require(_0x20da('0x8'));var csv=require(_0x20da('0x9'));var ejs=require(_0x20da('0xa'));var fs=require('fs');var _=require(_0x20da('0xb'));var squel=require(_0x20da('0xc'));var crypto=require(_0x20da('0xd'));var jsforce=require(_0x20da('0xe'));var deskjs=require(_0x20da('0xf'));var toCsv=require(_0x20da('0x9'));var querystring=require('querystring');var Papa=require(_0x20da('0x10'));var Redis=require(_0x20da('0x11'));var authService=require(_0x20da('0x12'));var qs=require(_0x20da('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x20da('0x14'))('api');var utils=require(_0x20da('0x15'));var config=require('../../config/environment');var db=require(_0x20da('0x16'))['db'];function respondWithStatusCode(_0x27c9cb,_0x5ef898){_0x5ef898=_0x5ef898||0xcc;return function(_0x1e2bd9){if(_0x1e2bd9){return _0x27c9cb[_0x20da('0x17')](_0x5ef898);}return _0x27c9cb[_0x20da('0x18')](_0x5ef898)['end']();};}function respondWithResult(_0x4ac3b0,_0x497fed){_0x497fed=_0x497fed||0xc8;return function(_0x48bd99){if(_0x48bd99){return _0x4ac3b0[_0x20da('0x18')](_0x497fed)[_0x20da('0x19')](_0x48bd99);}};}function respondWithFilteredResult(_0x4b27e7,_0x519d3f){return function(_0x318a32){if(_0x318a32){var _0x42e4ff=_0x318a32[_0x20da('0x1a')],_0x244d34=_0x519d3f['offset'],_0x3a8744=_0x519d3f[_0x20da('0x1b')]+_0x519d3f[_0x20da('0x1c')],_0x3275e5;if(_0x3a8744>=_0x42e4ff){_0x3a8744=_0x42e4ff;_0x3275e5=0xc8;}else{_0x3275e5=0xce;}_0x4b27e7['status'](_0x3275e5);return _0x4b27e7['set'](_0x20da('0x1d'),_0x244d34+'-'+_0x3a8744+'/'+_0x42e4ff)[_0x20da('0x19')](_0x318a32);}return null;};}function patchUpdates(_0xfd9aba){return function(_0x109930){try{jsonpatch[_0x20da('0x1e')](_0x109930,_0xfd9aba,!![]);}catch(_0x8fe65a){return BPromise[_0x20da('0x1f')](_0x8fe65a);}return _0x109930['save']();};}function saveUpdates(_0x5b869d,_0x2977fd){return function(_0x932c70){if(_0x932c70){return _0x932c70[_0x20da('0x20')](_0x5b869d)[_0x20da('0x21')](function(_0x1cdf79){return _0x1cdf79;});}return null;};}function removeEntity(_0x5bbce3,_0x149f01){return function(_0x158535){if(_0x158535){return _0x158535[_0x20da('0x22')]()[_0x20da('0x21')](function(){_0x5bbce3[_0x20da('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18fcee,_0xa44796){return function(_0x466d84){if(!_0x466d84){_0x18fcee[_0x20da('0x17')](0x194);}return _0x466d84;};}function handleError(_0x32490e,_0x119ede){_0x119ede=_0x119ede||0x1f4;return function(_0x217a9f){logger[_0x20da('0x23')](_0x217a9f[_0x20da('0x24')]);if(_0x217a9f[_0x20da('0x25')]){delete _0x217a9f['name'];}_0x32490e[_0x20da('0x18')](_0x119ede)[_0x20da('0x26')](_0x217a9f);};}exports['index']=function(_0x5e306f,_0x1ce72d){var _0x19c209={},_0x1a8c66={},_0x4f50c8={'count':0x0,'rows':[]};var _0x46cdb9=db['VoiceQueuesLog'][_0x20da('0x27')];_0x1a8c66[_0x20da('0x28')]=_[_0x20da('0x29')](_0x46cdb9);_0x1a8c66[_0x20da('0x2a')]=_[_0x20da('0x29')](_0x5e306f[_0x20da('0x2a')]);_0x1a8c66[_0x20da('0x2b')]=_[_0x20da('0x2c')](_0x1a8c66['model'],_0x1a8c66[_0x20da('0x2a')]);_0x19c209[_0x20da('0x2d')]=_[_0x20da('0x2c')](_0x1a8c66['model'],qs[_0x20da('0x2e')](_0x5e306f[_0x20da('0x2a')][_0x20da('0x2e')]));_0x19c209['attributes']=_0x19c209[_0x20da('0x2d')][_0x20da('0x2f')]?_0x19c209[_0x20da('0x2d')]:_0x1a8c66[_0x20da('0x28')];if(!_0x5e306f['query'][_0x20da('0x30')]('nolimit')){_0x19c209['limit']=qs[_0x20da('0x1c')](_0x5e306f['query']['limit']);_0x19c209[_0x20da('0x1b')]=qs[_0x20da('0x1b')](_0x5e306f['query']['offset']);}_0x19c209['order']=qs['sort'](_0x5e306f[_0x20da('0x2a')][_0x20da('0x31')]);_0x19c209[_0x20da('0x32')]=qs[_0x20da('0x2b')](_[_0x20da('0x33')](_0x5e306f['query'],_0x1a8c66['filters']));if(_0x5e306f[_0x20da('0x2a')][_0x20da('0x34')]){_0x19c209[_0x20da('0x32')]=_[_0x20da('0x35')](_0x19c209[_0x20da('0x32')],{'$or':_[_0x20da('0x36')](_0x46cdb9,function(_0x4f8588){if(_0x4f8588[_0x20da('0x37')][_0x20da('0x38')]!==_0x20da('0x39')){var _0x2c8bc0={};_0x2c8bc0[_0x4f8588[_0x20da('0x3a')]]={'$like':'%'+_0x5e306f[_0x20da('0x2a')][_0x20da('0x34')]+'%'};return _0x2c8bc0;}})});}_0x19c209=_['merge']({},_0x19c209,_0x5e306f[_0x20da('0x3b')]);var _0x1171c0={'where':_0x19c209[_0x20da('0x32')]};return db[_0x20da('0x3c')][_0x20da('0x1a')](_0x1171c0)[_0x20da('0x21')](function(_0xef8ad8){_0x4f50c8[_0x20da('0x1a')]=_0xef8ad8;if(_0x5e306f['query']['includeAll']){_0x19c209['include']=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x19c209);})[_0x20da('0x21')](function(_0x56647d){_0x4f50c8['rows']=_0x56647d;return _0x4f50c8;})['then'](respondWithFilteredResult(_0x1ce72d,_0x19c209))[_0x20da('0x3d')](handleError(_0x1ce72d,null));};exports[_0x20da('0x3e')]=function(_0x35d5f0,_0xf0d62e){var _0x32d92f={'raw':!![],'where':{'id':_0x35d5f0[_0x20da('0x3f')]['id']}},_0x4dcc96={};_0x4dcc96[_0x20da('0x28')]=_[_0x20da('0x29')](db['VoiceQueuesLog'][_0x20da('0x27')]);_0x4dcc96['query']=_[_0x20da('0x29')](_0x35d5f0[_0x20da('0x2a')]);_0x4dcc96[_0x20da('0x2b')]=_[_0x20da('0x2c')](_0x4dcc96[_0x20da('0x28')],_0x4dcc96[_0x20da('0x2a')]);_0x32d92f[_0x20da('0x2d')]=_[_0x20da('0x2c')](_0x4dcc96['model'],qs[_0x20da('0x2e')](_0x35d5f0[_0x20da('0x2a')][_0x20da('0x2e')]));_0x32d92f[_0x20da('0x2d')]=_0x32d92f['attributes']['length']?_0x32d92f['attributes']:_0x4dcc96[_0x20da('0x28')];if(_0x35d5f0[_0x20da('0x2a')][_0x20da('0x40')]){_0x32d92f[_0x20da('0x41')]=[{'all':!![]}];}_0x32d92f=_[_0x20da('0x35')]({},_0x32d92f,_0x35d5f0['options']);return db[_0x20da('0x3c')][_0x20da('0x42')](_0x32d92f)[_0x20da('0x21')](handleEntityNotFound(_0xf0d62e,null))[_0x20da('0x21')](respondWithResult(_0xf0d62e,null))[_0x20da('0x3d')](handleError(_0xf0d62e,null));};exports[_0x20da('0x43')]=function(_0x14f36c,_0x2fb7d5){return db[_0x20da('0x3c')][_0x20da('0x43')](_0x14f36c[_0x20da('0x44')],{})[_0x20da('0x21')](respondWithResult(_0x2fb7d5,0xc9))[_0x20da('0x3d')](handleError(_0x2fb7d5,null));};exports['update']=function(_0x313d51,_0xfb009b){if(_0x313d51[_0x20da('0x44')]['id']){delete _0x313d51[_0x20da('0x44')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x313d51[_0x20da('0x3f')]['id']}})[_0x20da('0x21')](handleEntityNotFound(_0xfb009b,null))[_0x20da('0x21')](saveUpdates(_0x313d51['body'],null))[_0x20da('0x21')](respondWithResult(_0xfb009b,null))[_0x20da('0x3d')](handleError(_0xfb009b,null));};exports[_0x20da('0x22')]=function(_0x28b63d,_0x567e30){return db[_0x20da('0x3c')][_0x20da('0x42')]({'where':{'id':_0x28b63d[_0x20da('0x3f')]['id']}})[_0x20da('0x21')](handleEntityNotFound(_0x567e30,null))[_0x20da('0x21')](removeEntity(_0x567e30,null))[_0x20da('0x3d')](handleError(_0x567e30,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 5875d64..cdee984 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 _0x52a8=['exports','event_dtm','event','dtm','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes'];(function(_0x2555c3,_0x2c6cc2){var _0x10d0aa=function(_0x58dbf9){while(--_0x58dbf9){_0x2555c3['push'](_0x2555c3['shift']());}};_0x10d0aa(++_0x2c6cc2);}(_0x52a8,0x11c));var _0x852a=function(_0x481e43,_0x345e68){_0x481e43=_0x481e43-0x0;var _0x4ecd68=_0x52a8[_0x481e43];return _0x4ecd68;};'use strict';var _=require(_0x852a('0x0'));var util=require(_0x852a('0x1'));var logger=require('../../config/logger')(_0x852a('0x2'));var moment=require(_0x852a('0x3'));var BPromise=require(_0x852a('0x4'));var rp=require(_0x852a('0x5'));var fs=require('fs');var path=require(_0x852a('0x6'));var rimraf=require(_0x852a('0x7'));var config=require(_0x852a('0x8'));var attributes=require(_0x852a('0x9'));module[_0x852a('0xa')]=function(_0x2eafae,_0x26a59c){return _0x2eafae['define']('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x852a('0xb'),'fields':[_0x852a('0xc'),_0x852a('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7dc8=['VoiceQueuesLog','event_dtm','event','dtm','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7dc8,0x1ee));var _0x87dc=function(_0x203cfc,_0x282c37){_0x203cfc=_0x203cfc-0x0;var _0x53a5d7=_0x7dc8[_0x203cfc];return _0x53a5d7;};'use strict';var _=require('lodash');var util=require(_0x87dc('0x0'));var logger=require(_0x87dc('0x1'))(_0x87dc('0x2'));var moment=require(_0x87dc('0x3'));var BPromise=require(_0x87dc('0x4'));var rp=require(_0x87dc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x87dc('0x6'));var config=require(_0x87dc('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0x87dc('0x8')]=function(_0xa708a5,_0x94efef){return _0xa708a5[_0x87dc('0x9')](_0x87dc('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x87dc('0xb'),'fields':[_0x87dc('0xc'),_0x87dc('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index c3e5de0..d3f1790 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 _0x4fc2=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x351509,_0x54725c){var _0x4e9861=function(_0x54f92c){while(--_0x54f92c){_0x351509['push'](_0x351509['shift']());}};_0x4e9861(++_0x54725c);}(_0x4fc2,0x111));var _0x24fc=function(_0x3f7e37,_0x32f790){_0x3f7e37=_0x3f7e37-0x0;var _0x2a3ec7=_0x4fc2[_0x3f7e37];return _0x2a3ec7;};'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')]('VoiceQueuesLog,\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')]('VoiceQueuesLog,\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 +var _0x2bb0=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','randomstring'];(function(_0x47d507,_0x730115){var _0x4212b=function(_0x172ebe){while(--_0x172ebe){_0x47d507['push'](_0x47d507['shift']());}};_0x4212b(++_0x730115);}(_0x2bb0,0xf3));var _0x02bb=function(_0x25c6ce,_0xad2570){_0x25c6ce=_0x25c6ce-0x0;var _0x4a9506=_0x2bb0[_0x25c6ce];return _0x4a9506;};'use strict';var _=require(_0x02bb('0x0'));var util=require(_0x02bb('0x1'));var moment=require(_0x02bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x02bb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x02bb('0x4'));var logger=require('../../config/logger')(_0x02bb('0x5'));var config=require(_0x02bb('0x6'));var jayson=require(_0x02bb('0x7'));var client=jayson[_0x02bb('0x8')][_0x02bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16bb7c,_0x440f9c,_0x47d7ae){return new BPromise(function(_0x6d064a,_0x15e425){return client[_0x02bb('0xa')](_0x16bb7c,_0x47d7ae)['then'](function(_0x3d28d5){logger['info'](_0x02bb('0xb'),_0x440f9c,_0x02bb('0xc'));logger['debug'](_0x02bb('0xd'),_0x440f9c,_0x02bb('0xc'),JSON[_0x02bb('0xe')](_0x3d28d5));if(_0x3d28d5['error']){if(_0x3d28d5[_0x02bb('0xf')]['code']===0x1f4){logger[_0x02bb('0xf')](_0x02bb('0xb'),_0x440f9c,_0x3d28d5[_0x02bb('0xf')]['message']);return _0x15e425(_0x3d28d5[_0x02bb('0xf')][_0x02bb('0x10')]);}logger[_0x02bb('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x440f9c,_0x3d28d5[_0x02bb('0xf')]['message']);return _0x6d064a(_0x3d28d5[_0x02bb('0xf')][_0x02bb('0x10')]);}else{logger[_0x02bb('0x11')](_0x02bb('0xb'),_0x440f9c,_0x02bb('0xc'));_0x6d064a(_0x3d28d5[_0x02bb('0x12')]['message']);}})['catch'](function(_0x4711fb){logger[_0x02bb('0xf')](_0x02bb('0xb'),_0x440f9c,_0x4711fb);_0x15e425(_0x4711fb);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index d21a1e9..3ed0dc6 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 _0x61aa=['/:id/downloads','downloads','post','put','update','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','/describe','describe','/:id','show','download'];(function(_0x41d9e4,_0xc27b71){var _0x5443e2=function(_0x385ff1){while(--_0x385ff1){_0x41d9e4['push'](_0x41d9e4['shift']());}};_0x5443e2(++_0xc27b71);}(_0x61aa,0xe3));var _0xa61a=function(_0x30955e,_0x1b06fc){_0x30955e=_0x30955e-0x0;var _0x174081=_0x61aa[_0x30955e];return _0x174081;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa61a('0x0'));var timeout=require(_0xa61a('0x1'));var express=require(_0xa61a('0x2'));var router=express[_0xa61a('0x3')]();var auth=require(_0xa61a('0x4'));var interaction=require(_0xa61a('0x5'));var config=require(_0xa61a('0x6'));var controller=require(_0xa61a('0x7'));router[_0xa61a('0x8')]('/',auth[_0xa61a('0x9')](),controller['index']);router['get'](_0xa61a('0xa'),auth[_0xa61a('0x9')](),controller[_0xa61a('0xb')]);router[_0xa61a('0x8')](_0xa61a('0xc'),auth[_0xa61a('0x9')](),controller[_0xa61a('0xd')]);router[_0xa61a('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xa61a('0xe')]);router[_0xa61a('0x8')](_0xa61a('0xf'),controller[_0xa61a('0x10')]);router[_0xa61a('0x11')]('/',auth[_0xa61a('0x9')](),controller['create']);router[_0xa61a('0x12')](_0xa61a('0xc'),auth[_0xa61a('0x9')](),controller[_0xa61a('0x13')]);router['delete']('/:id',auth[_0xa61a('0x9')](),controller[_0xa61a('0x14')]);module[_0xa61a('0x15')]=router; \ No newline at end of file +var _0x0563=['post','create','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceRecording.controller','isAuthenticated','describe','get','download'];(function(_0x13187a,_0x2fcec4){var _0x65b85f=function(_0x33bf1f){while(--_0x33bf1f){_0x13187a['push'](_0x13187a['shift']());}};_0x65b85f(++_0x2fcec4);}(_0x0563,0x138));var _0x3056=function(_0x135c77,_0x220855){_0x135c77=_0x135c77-0x0;var _0x1ca1e8=_0x0563[_0x135c77];return _0x1ca1e8;};'use strict';var multer=require(_0x3056('0x0'));var util=require(_0x3056('0x1'));var path=require(_0x3056('0x2'));var timeout=require(_0x3056('0x3'));var express=require('express');var router=express[_0x3056('0x4')]();var auth=require(_0x3056('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3056('0x6'));var controller=require(_0x3056('0x7'));router['get']('/',auth[_0x3056('0x8')](),controller['index']);router['get']('/describe',auth[_0x3056('0x8')](),controller[_0x3056('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3056('0xa')]('/:id/download',auth[_0x3056('0x8')](),controller[_0x3056('0xb')]);router[_0x3056('0xa')]('/:id/downloads',controller['downloads']);router[_0x3056('0xc')]('/',auth[_0x3056('0x8')](),controller[_0x3056('0xd')]);router['put'](_0x3056('0xe'),auth['isAuthenticated'](),controller[_0x3056('0xf')]);router[_0x3056('0x10')](_0x3056('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x3056('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index ae1da33..24db87f 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 _0x15f5=['sequelize','moment','path','exports','VIRTUAL','getDataValue','value','channel','setDataValue','membername','split','STRING','DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','toString'];(function(_0xe79b64,_0x3572fa){var _0x14b0b8=function(_0x2a2f99){while(--_0x2a2f99){_0xe79b64['push'](_0xe79b64['shift']());}};_0x14b0b8(++_0x3572fa);}(_0x15f5,0x77));var _0x515f=function(_0x2b03f2,_0xa9d5b){_0x2b03f2=_0x2b03f2-0x0;var _0xa83277=_0x15f5[_0x2b03f2];return _0xa83277;};'use strict';var Sequelize=require(_0x515f('0x0'));var moment=require(_0x515f('0x1'));var path=require(_0x515f('0x2'));module[_0x515f('0x3')]={'format':{'type':Sequelize[_0x515f('0x4')],'get':function(){return this['getDataValue']('value')?path['extname'](this[_0x515f('0x5')](_0x515f('0x6'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING'],'set':function(_0x20a043){if(_0x20a043){this['setDataValue'](_0x515f('0x7'),_0x20a043);this[_0x515f('0x8')](_0x515f('0x9'),_0x20a043[_0x515f('0xa')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x515f('0xb')]},'calleridnum':{'type':Sequelize[_0x515f('0xb')]},'calleridname':{'type':Sequelize[_0x515f('0xb')]},'connectedlinenum':{'type':Sequelize[_0x515f('0xb')]},'connectedlinename':{'type':Sequelize[_0x515f('0xb')]},'accountcode':{'type':Sequelize[_0x515f('0xb')]},'context':{'type':Sequelize[_0x515f('0xb')]},'exten':{'type':Sequelize[_0x515f('0xb')]},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x515f('0xb')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x515f('0xb')]},'userDisposition':{'type':Sequelize[_0x515f('0xb')]},'createdAt':{'type':Sequelize[_0x515f('0xc')],'get':function(){return moment(this[_0x515f('0x5')](_0x515f('0xd')))[_0x515f('0xe')](_0x515f('0xf'))[_0x515f('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0x515f('0xe')](_0x515f('0xf'))[_0x515f('0x10')]();}}}; \ No newline at end of file +var _0x57ce=['getDataValue','extname','value','STRING','setDataValue','channel','membername','INTEGER','DATE','createdAt','format','toString','updatedAt','sequelize','moment','path','VIRTUAL'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x57ce,0x1e9));var _0xe57c=function(_0x5c4069,_0xcbec0f){_0x5c4069=_0x5c4069-0x0;var _0x2a8fdf=_0x57ce[_0x5c4069];return _0x2a8fdf;};'use strict';var Sequelize=require(_0xe57c('0x0'));var moment=require(_0xe57c('0x1'));var path=require(_0xe57c('0x2'));module['exports']={'format':{'type':Sequelize[_0xe57c('0x3')],'get':function(){return this[_0xe57c('0x4')]('value')?path[_0xe57c('0x5')](this['getDataValue'](_0xe57c('0x6'))):undefined;}},'uniqueid':{'type':Sequelize[_0xe57c('0x7')]},'channel':{'type':Sequelize[_0xe57c('0x7')],'set':function(_0x437cbb){if(_0x437cbb){this[_0xe57c('0x8')](_0xe57c('0x9'),_0x437cbb);this['setDataValue'](_0xe57c('0xa'),_0x437cbb['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xe57c('0x7')]},'connectedlinenum':{'type':Sequelize[_0xe57c('0x7')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xe57c('0x7')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe57c('0x7')]},'value':{'type':Sequelize[_0xe57c('0x7')]},'type':{'type':Sequelize[_0xe57c('0x7')]},'rating':{'type':Sequelize[_0xe57c('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xe57c('0x7')]},'userDisposition':{'type':Sequelize['STRING']},'createdAt':{'type':Sequelize[_0xe57c('0xc')],'get':function(){return moment(this['getDataValue'](_0xe57c('0xd')))[_0xe57c('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xe57c('0xf')]();}},'updatedAt':{'type':Sequelize[_0xe57c('0xc')],'get':function(){return moment(this['getDataValue'](_0xe57c('0x10')))[_0xe57c('0xe')]('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 73451a5..c365d26 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 _0x88eb=['params','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','Sequelize','ValidationError','filename','download','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','$and','push','VoiceRecording\x20not\x20found','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','send','index','VoiceRecording','rawAttributes','model','differenceBy','keys','format','query','filters','intersection','attributes','fields','limit','offset','sort','where','pick','filter','merge','type','key','field','options','includeAll','include','findAll','rows','show','length','find','catch','create','body'];(function(_0x31768a,_0x1ecfe6){var _0x4b5f5e=function(_0x276bac){while(--_0x276bac){_0x31768a['push'](_0x31768a['shift']());}};_0x4b5f5e(++_0x1ecfe6);}(_0x88eb,0x129));var _0xb88e=function(_0x3a2e76,_0x45e819){_0x3a2e76=_0x3a2e76-0x0;var _0x21ad01=_0x88eb[_0x3a2e76];return _0x21ad01;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb88e('0x0'));var rimraf=require(_0xb88e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb88e('0x2'));var rp=require(_0xb88e('0x3'));var moment=require('moment');var BPromise=require(_0xb88e('0x4'));var Mustache=require('mustache');var util=require(_0xb88e('0x5'));var path=require(_0xb88e('0x6'));var sox=require('sox');var csv=require(_0xb88e('0x7'));var ejs=require(_0xb88e('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb88e('0x9'));var crypto=require(_0xb88e('0xa'));var jsforce=require(_0xb88e('0xb'));var deskjs=require(_0xb88e('0xc'));var toCsv=require(_0xb88e('0x7'));var querystring=require(_0xb88e('0xd'));var Papa=require(_0xb88e('0xe'));var Redis=require(_0xb88e('0xf'));var authService=require(_0xb88e('0x10'));var qs=require(_0xb88e('0x11'));var hardwareService=require(_0xb88e('0x12'));var logger=require(_0xb88e('0x13'))('api');var utils=require(_0xb88e('0x14'));var config=require(_0xb88e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bc99a,_0x2eaf05){_0x2eaf05=_0x2eaf05||0xcc;return function(_0x15d7d0){if(_0x15d7d0){return _0x3bc99a[_0xb88e('0x16')](_0x2eaf05);}return _0x3bc99a['status'](_0x2eaf05)['end']();};}function respondWithResult(_0x406304,_0x1b95c3){_0x1b95c3=_0x1b95c3||0xc8;return function(_0xd7b323){if(_0xd7b323){return _0x406304[_0xb88e('0x17')](_0x1b95c3)['json'](_0xd7b323);}};}function respondWithFilteredResult(_0x1298d8,_0x4d1706){return function(_0x59de3a){if(_0x59de3a){var _0x3834d1=_0x59de3a[_0xb88e('0x18')],_0x5745f9=_0x4d1706['offset'],_0x3a336b=_0x4d1706['offset']+_0x4d1706['limit'],_0x41d003;if(_0x3a336b>=_0x3834d1){_0x3a336b=_0x3834d1;_0x41d003=0xc8;}else{_0x41d003=0xce;}_0x1298d8[_0xb88e('0x17')](_0x41d003);return _0x1298d8[_0xb88e('0x19')](_0xb88e('0x1a'),_0x5745f9+'-'+_0x3a336b+'/'+_0x3834d1)[_0xb88e('0x1b')](_0x59de3a);}return null;};}function patchUpdates(_0x10a57a){return function(_0x3d1b15){try{jsonpatch[_0xb88e('0x1c')](_0x3d1b15,_0x10a57a,!![]);}catch(_0x3a568d){return BPromise[_0xb88e('0x1d')](_0x3a568d);}return _0x3d1b15[_0xb88e('0x1e')]();};}function saveUpdates(_0x52a8da,_0x3715cd){return function(_0x5d892b){if(_0x5d892b){return _0x5d892b[_0xb88e('0x1f')](_0x52a8da)[_0xb88e('0x20')](function(_0x302e21){return _0x302e21;});}return null;};}function removeEntity(_0xcf8e0a,_0x1b4ad5){return function(_0x1dc4ec){if(_0x1dc4ec){return _0x1dc4ec[_0xb88e('0x21')]()[_0xb88e('0x20')](function(){_0xcf8e0a[_0xb88e('0x17')](0xcc)[_0xb88e('0x22')]();});}};}function handleEntityNotFound(_0x5e46a1,_0x3e529a){return function(_0xdaff9d){if(!_0xdaff9d){_0x5e46a1['sendStatus'](0x194);}return _0xdaff9d;};}function handleError(_0x25989d,_0x16f046){_0x16f046=_0x16f046||0x1f4;return function(_0x499717){logger[_0xb88e('0x23')](_0x499717['stack']);if(_0x499717[_0xb88e('0x24')]){delete _0x499717[_0xb88e('0x24')];}_0x25989d['status'](_0x16f046)[_0xb88e('0x25')](_0x499717);};}exports[_0xb88e('0x26')]=function(_0x369d09,_0x3f6ec0){var _0x3cf528={},_0x6521d9={},_0x3dc3c6={'count':0x0,'rows':[]};var _0x1d4f32=db[_0xb88e('0x27')][_0xb88e('0x28')];_0x6521d9[_0xb88e('0x29')]=_[_0xb88e('0x2a')](_[_0xb88e('0x2b')](_0x1d4f32),[_0xb88e('0x2c')]);_0x6521d9['query']=_[_0xb88e('0x2b')](_0x369d09[_0xb88e('0x2d')]);_0x6521d9[_0xb88e('0x2e')]=_[_0xb88e('0x2f')](_0x6521d9['model'],_0x6521d9[_0xb88e('0x2d')]);_0x3cf528[_0xb88e('0x30')]=_['intersection'](_0x6521d9[_0xb88e('0x29')],qs['fields'](_0x369d09[_0xb88e('0x2d')][_0xb88e('0x31')]));_0x3cf528[_0xb88e('0x30')]=_0x3cf528[_0xb88e('0x30')]['length']?_0x3cf528[_0xb88e('0x30')]:_0x6521d9[_0xb88e('0x29')];if(!_0x369d09[_0xb88e('0x2d')]['hasOwnProperty']('nolimit')){_0x3cf528[_0xb88e('0x32')]=qs[_0xb88e('0x32')](_0x369d09[_0xb88e('0x2d')][_0xb88e('0x32')]);_0x3cf528['offset']=qs['offset'](_0x369d09[_0xb88e('0x2d')][_0xb88e('0x33')]);}_0x3cf528['order']=qs[_0xb88e('0x34')](_0x369d09[_0xb88e('0x2d')][_0xb88e('0x34')]);_0x3cf528[_0xb88e('0x35')]=qs[_0xb88e('0x2e')](_[_0xb88e('0x36')](_0x369d09['query'],_0x6521d9[_0xb88e('0x2e')]));if(_0x369d09['query'][_0xb88e('0x37')]){_0x3cf528[_0xb88e('0x35')]=_[_0xb88e('0x38')](_0x3cf528[_0xb88e('0x35')],{'$or':_['map'](_0x1d4f32,function(_0x2900fa){if(_0x2900fa[_0xb88e('0x39')][_0xb88e('0x3a')]!=='VIRTUAL'){var _0x2eb50b={};_0x2eb50b[_0x2900fa[_0xb88e('0x3b')]]={'$like':'%'+_0x369d09['query'][_0xb88e('0x37')]+'%'};return _0x2eb50b;}})});}_0x3cf528=_[_0xb88e('0x38')]({},_0x3cf528,_0x369d09[_0xb88e('0x3c')]);var _0x3a223a={'where':_0x3cf528[_0xb88e('0x35')]};return db[_0xb88e('0x27')]['count'](_0x3a223a)['then'](function(_0x20c424){_0x3dc3c6[_0xb88e('0x18')]=_0x20c424;if(_0x369d09[_0xb88e('0x2d')][_0xb88e('0x3d')]){_0x3cf528[_0xb88e('0x3e')]=[{'all':!![]}];}return db[_0xb88e('0x27')][_0xb88e('0x3f')](_0x3cf528);})[_0xb88e('0x20')](function(_0x16879b){_0x3dc3c6[_0xb88e('0x40')]=_0x16879b;return _0x3dc3c6;})['then'](respondWithFilteredResult(_0x3f6ec0,_0x3cf528))['catch'](handleError(_0x3f6ec0,null));};exports[_0xb88e('0x41')]=function(_0x11a5fd,_0x1d799c){var _0x171063={'raw':![],'where':{'id':_0x11a5fd['params']['id']}},_0x20d071={};_0x20d071[_0xb88e('0x29')]=_[_0xb88e('0x2b')](db['VoiceRecording']['rawAttributes']);_0x20d071[_0xb88e('0x2d')]=_[_0xb88e('0x2b')](_0x11a5fd[_0xb88e('0x2d')]);_0x20d071[_0xb88e('0x2e')]=_[_0xb88e('0x2f')](_0x20d071['model'],_0x20d071[_0xb88e('0x2d')]);_0x171063[_0xb88e('0x30')]=_[_0xb88e('0x2f')](_0x20d071['model'],qs[_0xb88e('0x31')](_0x11a5fd[_0xb88e('0x2d')]['fields']));_0x171063[_0xb88e('0x30')]=_0x171063[_0xb88e('0x30')][_0xb88e('0x42')]?_0x171063['attributes']:_0x20d071[_0xb88e('0x29')];if(_0x11a5fd[_0xb88e('0x2d')][_0xb88e('0x3d')]){_0x171063['include']=[{'all':!![]}];}_0x171063=_[_0xb88e('0x38')]({},_0x171063,_0x11a5fd[_0xb88e('0x3c')]);return db[_0xb88e('0x27')][_0xb88e('0x43')](_0x171063)[_0xb88e('0x20')](handleEntityNotFound(_0x1d799c,null))[_0xb88e('0x20')](respondWithResult(_0x1d799c,null))[_0xb88e('0x44')](handleError(_0x1d799c,null));};exports[_0xb88e('0x45')]=function(_0x5e0408,_0x5ae5d8){return db[_0xb88e('0x27')][_0xb88e('0x45')](_0x5e0408['body'],{})[_0xb88e('0x20')](respondWithResult(_0x5ae5d8,0xc9))[_0xb88e('0x44')](handleError(_0x5ae5d8,null));};exports[_0xb88e('0x1f')]=function(_0x152cce,_0xc872d3){if(_0x152cce[_0xb88e('0x46')]['id']){delete _0x152cce['body']['id'];}return db[_0xb88e('0x27')][_0xb88e('0x43')]({'where':{'id':_0x152cce[_0xb88e('0x47')]['id']}})[_0xb88e('0x20')](handleEntityNotFound(_0xc872d3,null))[_0xb88e('0x20')](saveUpdates(_0x152cce[_0xb88e('0x46')],null))[_0xb88e('0x20')](respondWithResult(_0xc872d3,null))[_0xb88e('0x44')](handleError(_0xc872d3,null));};exports[_0xb88e('0x21')]=function(_0x4bb52c,_0x1fdc14){return db[_0xb88e('0x27')][_0xb88e('0x43')]({'where':{'id':_0x4bb52c[_0xb88e('0x47')]['id']}})[_0xb88e('0x20')](handleEntityNotFound(_0x1fdc14,null))['then'](removeEntity(_0x1fdc14,null))[_0xb88e('0x44')](handleError(_0x1fdc14,null));};exports['describe']=function(_0x436194,_0x41f6f7){return db['VoiceRecording']['describe']()[_0xb88e('0x20')](respondWithResult(_0x41f6f7,null))[_0xb88e('0x44')](handleError(_0x41f6f7,null));};exports['download']=function(_0x3e45b0,_0x1783c7,_0x37ff13){var _0x4701b3=require(_0xb88e('0x48'));var _0x4844c5=![];var _0x326766={};if(_0x3e45b0[_0xb88e('0x2d')][_0xb88e('0x39')]&&_0x3e45b0[_0xb88e('0x2d')][_0xb88e('0x39')]===_0xb88e('0x49')){_0x326766[_0xb88e('0x49')]=_0x3e45b0[_0xb88e('0x47')]['id'];}else{_0x326766['id']=_0x3e45b0[_0xb88e('0x47')]['id'];}return db[_0xb88e('0x27')][_0xb88e('0x43')]({'where':_0x326766,'attributes':['id',_0xb88e('0x4a')],'raw':!![]})[_0xb88e('0x20')](handleEntityNotFound(_0x1783c7,null))[_0xb88e('0x20')](function(_0x3862bf){if(_0x3862bf){var _0x10fcf3=_0x3862bf[_0xb88e('0x4a')];var _0xfcb663=util['format'](_0xb88e('0x4b'),_0x10fcf3);if(fs[_0xb88e('0x4c')](_0xfcb663)){_0x4844c5=!![];return _0x4701b3['decryptFile'](_0xfcb663,_0x10fcf3,config['secrets']['recording'])[_0xb88e('0x20')](function(){return _0x3862bf;});}return _0x3862bf;}})[_0xb88e('0x20')](function(_0x5df62e){if(_0x5df62e){var _0x2bed51=_0x5df62e[_0xb88e('0x4a')];if(!fs[_0xb88e('0x4c')](_0x2bed51)){throw new db[(_0xb88e('0x4d'))][(_0xb88e('0x4e'))]('VoiceRecording\x20not\x20found');}if(_0x5df62e[_0xb88e('0x4f')]){return _0x1783c7[_0xb88e('0x50')](_0x2bed51,_0x5df62e[_0xb88e('0x4f')]+path[_0xb88e('0x51')](_0x2bed51),function(){if(_0x4844c5){fs[_0xb88e('0x52')](_0x2bed51);}});}else{return _0x1783c7[_0xb88e('0x50')](_0x2bed51,function(_0x48b59e){if(_0x4844c5){fs[_0xb88e('0x52')](_0x2bed51);}});}}})[_0xb88e('0x44')](function(_0x57fe99){if(_0x57fe99[_0xb88e('0x53')]==='VoiceRecording\x20not\x20found'){_0x1783c7['status'](0x194)[_0xb88e('0x25')](_0xb88e('0x54'));}else{return handleError(_0x1783c7,null);}});};exports[_0xb88e('0x55')]=function(_0x2f5582,_0x181026,_0x4498a3){var _0x1941b8=require('../../components/encryptor');var _0x236240=![];var _0x2396b5={'$and':[db[_0xb88e('0x56')]['where'](db['sequelize']['fn'](_0xb88e('0x57'),db['sequelize'][_0xb88e('0x58')](_0xb88e('0x49'))),_0x2f5582[_0xb88e('0x2d')]['token'])]};if(_0x2f5582[_0xb88e('0x2d')][_0xb88e('0x39')]&&_0x2f5582['query']['type']===_0xb88e('0x49')){_0x2396b5[_0xb88e('0x59')][_0xb88e('0x5a')]({'uniqueid':_0x2f5582['params']['id']});}else{_0x2396b5[_0xb88e('0x59')][_0xb88e('0x5a')]({'id':_0x2f5582[_0xb88e('0x47')]['id']});}return db[_0xb88e('0x27')]['find']({'where':_0x2396b5,'attributes':['id','value'],'raw':!![]})[_0xb88e('0x20')](handleEntityNotFound(_0x181026,null))['then'](function(_0x2595ea){if(_0x2595ea){var _0x508fd1=util[_0xb88e('0x2c')](_0xb88e('0x4b'),_0x2595ea[_0xb88e('0x4a')]);if(fs[_0xb88e('0x4c')](_0x508fd1)){_0x236240=!![];return _0x1941b8['decryptFile'](_0x508fd1,_0x2595ea['value'],config['secrets']['recording'])[_0xb88e('0x20')](function(){return _0x2595ea;});}return _0x2595ea;}})[_0xb88e('0x20')](function(_0x171354){if(_0x171354){if(!fs['existsSync'](_0x171354[_0xb88e('0x4a')])){throw new db[(_0xb88e('0x4d'))][(_0xb88e('0x4e'))](_0xb88e('0x5b'));}if(_0x171354[_0xb88e('0x4f')]){return _0x181026[_0xb88e('0x50')](_0x171354[_0xb88e('0x4a')],_0x171354['filename']+path[_0xb88e('0x51')](_0x171354['value']),function(){if(_0x236240){fs[_0xb88e('0x52')](_0x171354[_0xb88e('0x4a')]);}});}else{return _0x181026[_0xb88e('0x50')](_0x171354['value'],function(_0x5eadc5){if(_0x236240){fs['unlink'](_0x171354[_0xb88e('0x4a')]);}});}}})[_0xb88e('0x44')](handleError(_0x181026,null));}; \ No newline at end of file +var _0xc71d=['../../components/encryptor','type','uniqueid','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','download','filename','extname','unlink','message','Not\x20found','sequelize','MD5','col','token','$and','push','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','count','offset','apply','save','update','then','destroy','sendStatus','error','name','send','index','VoiceRecording','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','key','VIRTUAL','field','merge','options','includeAll','include','rows','catch','show','find','create','body','params','describe'];(function(_0x4b92f4,_0x32a49a){var _0x4b2ca2=function(_0x5df795){while(--_0x5df795){_0x4b92f4['push'](_0x4b92f4['shift']());}};_0x4b2ca2(++_0x32a49a);}(_0xc71d,0x133));var _0xdc71=function(_0x3a1ea5,_0x349f01){_0x3a1ea5=_0x3a1ea5-0x0;var _0xfac9b2=_0xc71d[_0x3a1ea5];return _0xfac9b2;};'use strict';var pdf=require(_0xdc71('0x0'));var emlformat=require(_0xdc71('0x1'));var rimraf=require(_0xdc71('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdc71('0x3'));var rp=require(_0xdc71('0x4'));var moment=require(_0xdc71('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdc71('0x6'));var util=require(_0xdc71('0x7'));var path=require('path');var sox=require(_0xdc71('0x8'));var csv=require(_0xdc71('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdc71('0xa'));var squel=require(_0xdc71('0xb'));var crypto=require(_0xdc71('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdc71('0xd'));var toCsv=require(_0xdc71('0x9'));var querystring=require('querystring');var Papa=require(_0xdc71('0xe'));var Redis=require(_0xdc71('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdc71('0x10'));var hardwareService=require(_0xdc71('0x11'));var logger=require(_0xdc71('0x12'))('api');var utils=require(_0xdc71('0x13'));var config=require('../../config/environment');var db=require(_0xdc71('0x14'))['db'];function respondWithStatusCode(_0x343f49,_0xa96997){_0xa96997=_0xa96997||0xcc;return function(_0x5a6a3f){if(_0x5a6a3f){return _0x343f49['sendStatus'](_0xa96997);}return _0x343f49[_0xdc71('0x15')](_0xa96997)[_0xdc71('0x16')]();};}function respondWithResult(_0x221bca,_0xedc1ec){_0xedc1ec=_0xedc1ec||0xc8;return function(_0x271f76){if(_0x271f76){return _0x221bca[_0xdc71('0x15')](_0xedc1ec)[_0xdc71('0x17')](_0x271f76);}};}function respondWithFilteredResult(_0x69042,_0x3ddf64){return function(_0x5c4290){if(_0x5c4290){var _0x201011=_0x5c4290[_0xdc71('0x18')],_0x2c2e35=_0x3ddf64[_0xdc71('0x19')],_0x47c82e=_0x3ddf64[_0xdc71('0x19')]+_0x3ddf64['limit'],_0x1068f3;if(_0x47c82e>=_0x201011){_0x47c82e=_0x201011;_0x1068f3=0xc8;}else{_0x1068f3=0xce;}_0x69042[_0xdc71('0x15')](_0x1068f3);return _0x69042['set']('Content-Range',_0x2c2e35+'-'+_0x47c82e+'/'+_0x201011)[_0xdc71('0x17')](_0x5c4290);}return null;};}function patchUpdates(_0xc86336){return function(_0x57a538){try{jsonpatch[_0xdc71('0x1a')](_0x57a538,_0xc86336,!![]);}catch(_0x30b13b){return BPromise['reject'](_0x30b13b);}return _0x57a538[_0xdc71('0x1b')]();};}function saveUpdates(_0x52c353,_0x58b4cd){return function(_0x1197cf){if(_0x1197cf){return _0x1197cf[_0xdc71('0x1c')](_0x52c353)[_0xdc71('0x1d')](function(_0x2ff920){return _0x2ff920;});}return null;};}function removeEntity(_0x1d687e,_0x3b94a3){return function(_0xcefbdc){if(_0xcefbdc){return _0xcefbdc[_0xdc71('0x1e')]()[_0xdc71('0x1d')](function(){_0x1d687e[_0xdc71('0x15')](0xcc)[_0xdc71('0x16')]();});}};}function handleEntityNotFound(_0x11f2e3,_0x27bd6b){return function(_0x27aa69){if(!_0x27aa69){_0x11f2e3[_0xdc71('0x1f')](0x194);}return _0x27aa69;};}function handleError(_0x492abd,_0x456902){_0x456902=_0x456902||0x1f4;return function(_0x42665d){logger[_0xdc71('0x20')](_0x42665d['stack']);if(_0x42665d[_0xdc71('0x21')]){delete _0x42665d[_0xdc71('0x21')];}_0x492abd['status'](_0x456902)[_0xdc71('0x22')](_0x42665d);};}exports[_0xdc71('0x23')]=function(_0x19549d,_0x1f6598){var _0x2b2b60={},_0x189818={},_0x284dd2={'count':0x0,'rows':[]};var _0x43cd5d=db[_0xdc71('0x24')][_0xdc71('0x25')];_0x189818['model']=_['differenceBy'](_[_0xdc71('0x26')](_0x43cd5d),['format']);_0x189818[_0xdc71('0x27')]=_[_0xdc71('0x26')](_0x19549d[_0xdc71('0x27')]);_0x189818[_0xdc71('0x28')]=_[_0xdc71('0x29')](_0x189818[_0xdc71('0x2a')],_0x189818[_0xdc71('0x27')]);_0x2b2b60[_0xdc71('0x2b')]=_[_0xdc71('0x29')](_0x189818[_0xdc71('0x2a')],qs['fields'](_0x19549d['query'][_0xdc71('0x2c')]));_0x2b2b60[_0xdc71('0x2b')]=_0x2b2b60[_0xdc71('0x2b')][_0xdc71('0x2d')]?_0x2b2b60[_0xdc71('0x2b')]:_0x189818[_0xdc71('0x2a')];if(!_0x19549d['query'][_0xdc71('0x2e')](_0xdc71('0x2f'))){_0x2b2b60[_0xdc71('0x30')]=qs[_0xdc71('0x30')](_0x19549d[_0xdc71('0x27')][_0xdc71('0x30')]);_0x2b2b60[_0xdc71('0x19')]=qs['offset'](_0x19549d[_0xdc71('0x27')][_0xdc71('0x19')]);}_0x2b2b60[_0xdc71('0x31')]=qs[_0xdc71('0x32')](_0x19549d['query'][_0xdc71('0x32')]);_0x2b2b60[_0xdc71('0x33')]=qs[_0xdc71('0x28')](_['pick'](_0x19549d[_0xdc71('0x27')],_0x189818[_0xdc71('0x28')]));if(_0x19549d['query'][_0xdc71('0x34')]){_0x2b2b60[_0xdc71('0x33')]=_['merge'](_0x2b2b60[_0xdc71('0x33')],{'$or':_[_0xdc71('0x35')](_0x43cd5d,function(_0x1e3145){if(_0x1e3145['type'][_0xdc71('0x36')]!==_0xdc71('0x37')){var _0x1c5921={};_0x1c5921[_0x1e3145[_0xdc71('0x38')]]={'$like':'%'+_0x19549d[_0xdc71('0x27')][_0xdc71('0x34')]+'%'};return _0x1c5921;}})});}_0x2b2b60=_[_0xdc71('0x39')]({},_0x2b2b60,_0x19549d[_0xdc71('0x3a')]);var _0x5c18f1={'where':_0x2b2b60[_0xdc71('0x33')]};return db[_0xdc71('0x24')]['count'](_0x5c18f1)[_0xdc71('0x1d')](function(_0x531203){_0x284dd2[_0xdc71('0x18')]=_0x531203;if(_0x19549d[_0xdc71('0x27')][_0xdc71('0x3b')]){_0x2b2b60[_0xdc71('0x3c')]=[{'all':!![]}];}return db[_0xdc71('0x24')]['findAll'](_0x2b2b60);})[_0xdc71('0x1d')](function(_0x33f4a3){_0x284dd2[_0xdc71('0x3d')]=_0x33f4a3;return _0x284dd2;})['then'](respondWithFilteredResult(_0x1f6598,_0x2b2b60))[_0xdc71('0x3e')](handleError(_0x1f6598,null));};exports[_0xdc71('0x3f')]=function(_0x4e153b,_0x3d506e){var _0x28e738={'raw':![],'where':{'id':_0x4e153b['params']['id']}},_0x11a243={};_0x11a243[_0xdc71('0x2a')]=_[_0xdc71('0x26')](db[_0xdc71('0x24')][_0xdc71('0x25')]);_0x11a243[_0xdc71('0x27')]=_['keys'](_0x4e153b[_0xdc71('0x27')]);_0x11a243[_0xdc71('0x28')]=_[_0xdc71('0x29')](_0x11a243['model'],_0x11a243['query']);_0x28e738[_0xdc71('0x2b')]=_['intersection'](_0x11a243['model'],qs['fields'](_0x4e153b[_0xdc71('0x27')][_0xdc71('0x2c')]));_0x28e738[_0xdc71('0x2b')]=_0x28e738[_0xdc71('0x2b')][_0xdc71('0x2d')]?_0x28e738[_0xdc71('0x2b')]:_0x11a243[_0xdc71('0x2a')];if(_0x4e153b['query'][_0xdc71('0x3b')]){_0x28e738[_0xdc71('0x3c')]=[{'all':!![]}];}_0x28e738=_[_0xdc71('0x39')]({},_0x28e738,_0x4e153b[_0xdc71('0x3a')]);return db[_0xdc71('0x24')][_0xdc71('0x40')](_0x28e738)[_0xdc71('0x1d')](handleEntityNotFound(_0x3d506e,null))['then'](respondWithResult(_0x3d506e,null))[_0xdc71('0x3e')](handleError(_0x3d506e,null));};exports[_0xdc71('0x41')]=function(_0x1aa1aa,_0x4fd919){return db[_0xdc71('0x24')][_0xdc71('0x41')](_0x1aa1aa['body'],{})[_0xdc71('0x1d')](respondWithResult(_0x4fd919,0xc9))[_0xdc71('0x3e')](handleError(_0x4fd919,null));};exports[_0xdc71('0x1c')]=function(_0x129f7b,_0x1d8a0b){if(_0x129f7b[_0xdc71('0x42')]['id']){delete _0x129f7b[_0xdc71('0x42')]['id'];}return db['VoiceRecording'][_0xdc71('0x40')]({'where':{'id':_0x129f7b[_0xdc71('0x43')]['id']}})['then'](handleEntityNotFound(_0x1d8a0b,null))[_0xdc71('0x1d')](saveUpdates(_0x129f7b[_0xdc71('0x42')],null))['then'](respondWithResult(_0x1d8a0b,null))[_0xdc71('0x3e')](handleError(_0x1d8a0b,null));};exports[_0xdc71('0x1e')]=function(_0x5b9373,_0xd70816){return db['VoiceRecording']['find']({'where':{'id':_0x5b9373[_0xdc71('0x43')]['id']}})[_0xdc71('0x1d')](handleEntityNotFound(_0xd70816,null))[_0xdc71('0x1d')](removeEntity(_0xd70816,null))[_0xdc71('0x3e')](handleError(_0xd70816,null));};exports[_0xdc71('0x44')]=function(_0x2a1ec0,_0x5b7178){return db[_0xdc71('0x24')][_0xdc71('0x44')]()[_0xdc71('0x1d')](respondWithResult(_0x5b7178,null))[_0xdc71('0x3e')](handleError(_0x5b7178,null));};exports['download']=function(_0x37270a,_0x431b81,_0x137a70){var _0x3dc46d=require(_0xdc71('0x45'));var _0x5ee4fc=![];var _0x135466={};if(_0x37270a[_0xdc71('0x27')]['type']&&_0x37270a[_0xdc71('0x27')][_0xdc71('0x46')]===_0xdc71('0x47')){_0x135466[_0xdc71('0x47')]=_0x37270a[_0xdc71('0x43')]['id'];}else{_0x135466['id']=_0x37270a['params']['id'];}return db[_0xdc71('0x24')][_0xdc71('0x40')]({'where':_0x135466,'attributes':['id',_0xdc71('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x431b81,null))[_0xdc71('0x1d')](function(_0x37e052){if(_0x37e052){var _0x45ad3f=_0x37e052['value'];var _0x41e7a8=util[_0xdc71('0x49')](_0xdc71('0x4a'),_0x45ad3f);if(fs[_0xdc71('0x4b')](_0x41e7a8)){_0x5ee4fc=!![];return _0x3dc46d[_0xdc71('0x4c')](_0x41e7a8,_0x45ad3f,config[_0xdc71('0x4d')][_0xdc71('0x4e')])['then'](function(){return _0x37e052;});}return _0x37e052;}})[_0xdc71('0x1d')](function(_0x1a0677){if(_0x1a0677){var _0x1216be=_0x1a0677[_0xdc71('0x48')];if(!fs[_0xdc71('0x4b')](_0x1216be)){throw new db[(_0xdc71('0x4f'))][(_0xdc71('0x50'))](_0xdc71('0x51'));}if(_0x1a0677['filename']){return _0x431b81[_0xdc71('0x52')](_0x1216be,_0x1a0677[_0xdc71('0x53')]+path[_0xdc71('0x54')](_0x1216be),function(){if(_0x5ee4fc){fs[_0xdc71('0x55')](_0x1216be);}});}else{return _0x431b81[_0xdc71('0x52')](_0x1216be,function(_0x41b537){if(_0x5ee4fc){fs[_0xdc71('0x55')](_0x1216be);}});}}})[_0xdc71('0x3e')](function(_0x3be316){if(_0x3be316[_0xdc71('0x56')]==='VoiceRecording\x20not\x20found'){_0x431b81[_0xdc71('0x15')](0x194)['send'](_0xdc71('0x57'));}else{return handleError(_0x431b81,null);}});};exports['downloads']=function(_0xb1372e,_0x5d225e,_0x3c71e0){var _0x589d6d=require('../../components/encryptor');var _0x1a15c4=![];var _0x1ffc2e={'$and':[db[_0xdc71('0x58')]['where'](db[_0xdc71('0x58')]['fn'](_0xdc71('0x59'),db[_0xdc71('0x58')][_0xdc71('0x5a')](_0xdc71('0x47'))),_0xb1372e['query'][_0xdc71('0x5b')])]};if(_0xb1372e[_0xdc71('0x27')][_0xdc71('0x46')]&&_0xb1372e[_0xdc71('0x27')][_0xdc71('0x46')]==='uniqueid'){_0x1ffc2e[_0xdc71('0x5c')][_0xdc71('0x5d')]({'uniqueid':_0xb1372e[_0xdc71('0x43')]['id']});}else{_0x1ffc2e[_0xdc71('0x5c')][_0xdc71('0x5d')]({'id':_0xb1372e[_0xdc71('0x43')]['id']});}return db[_0xdc71('0x24')][_0xdc71('0x40')]({'where':_0x1ffc2e,'attributes':['id','value'],'raw':!![]})[_0xdc71('0x1d')](handleEntityNotFound(_0x5d225e,null))[_0xdc71('0x1d')](function(_0x32cee2){if(_0x32cee2){var _0xc72dfe=util[_0xdc71('0x49')](_0xdc71('0x4a'),_0x32cee2[_0xdc71('0x48')]);if(fs[_0xdc71('0x4b')](_0xc72dfe)){_0x1a15c4=!![];return _0x589d6d[_0xdc71('0x4c')](_0xc72dfe,_0x32cee2[_0xdc71('0x48')],config[_0xdc71('0x4d')][_0xdc71('0x4e')])['then'](function(){return _0x32cee2;});}return _0x32cee2;}})[_0xdc71('0x1d')](function(_0x333c93){if(_0x333c93){if(!fs[_0xdc71('0x4b')](_0x333c93[_0xdc71('0x48')])){throw new db[(_0xdc71('0x4f'))]['ValidationError'](_0xdc71('0x51'));}if(_0x333c93['filename']){return _0x5d225e['download'](_0x333c93[_0xdc71('0x48')],_0x333c93[_0xdc71('0x53')]+path[_0xdc71('0x54')](_0x333c93[_0xdc71('0x48')]),function(){if(_0x1a15c4){fs[_0xdc71('0x55')](_0x333c93['value']);}});}else{return _0x5d225e[_0xdc71('0x52')](_0x333c93['value'],function(_0x536a97){if(_0x1a15c4){fs[_0xdc71('0x55')](_0x333c93[_0xdc71('0x48')]);}});}}})[_0xdc71('0x3e')](handleError(_0x5d225e,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index d76ebd1..743004f 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 _0xb7dc=['path','rimraf','../../config/environment','./voiceRecording.attributes','exports','voice_recordings','uniqueid','util','../../config/logger','moment'];(function(_0x5ab94d,_0x54d31a){var _0x167f0a=function(_0x4b0513){while(--_0x4b0513){_0x5ab94d['push'](_0x5ab94d['shift']());}};_0x167f0a(++_0x54d31a);}(_0xb7dc,0xd9));var _0xcb7d=function(_0x497ef9,_0x1b62bd){_0x497ef9=_0x497ef9-0x0;var _0x5bba86=_0xb7dc[_0x497ef9];return _0x5bba86;};'use strict';var _=require('lodash');var util=require(_0xcb7d('0x0'));var logger=require(_0xcb7d('0x1'))('api');var moment=require(_0xcb7d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb7d('0x3'));var rimraf=require(_0xcb7d('0x4'));var config=require(_0xcb7d('0x5'));var attributes=require(_0xcb7d('0x6'));module[_0xcb7d('0x7')]=function(_0xbd7f51,_0x520a4c){return _0xbd7f51['define']('VoiceRecording',attributes,{'tableName':_0xcb7d('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xcb7d('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdce5=['../../config/environment','./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x36527c,_0x1718ae){var _0x22bf8b=function(_0x3f9d05){while(--_0x3f9d05){_0x36527c['push'](_0x36527c['shift']());}};_0x22bf8b(++_0x1718ae);}(_0xdce5,0xd6));var _0x5dce=function(_0x582348,_0x1652f4){_0x582348=_0x582348-0x0;var _0x6db418=_0xdce5[_0x582348];return _0x6db418;};'use strict';var _=require(_0x5dce('0x0'));var util=require(_0x5dce('0x1'));var logger=require('../../config/logger')(_0x5dce('0x2'));var moment=require('moment');var BPromise=require(_0x5dce('0x3'));var rp=require(_0x5dce('0x4'));var fs=require('fs');var path=require(_0x5dce('0x5'));var rimraf=require(_0x5dce('0x6'));var config=require(_0x5dce('0x7'));var attributes=require(_0x5dce('0x8'));module['exports']=function(_0x161257,_0xc3b0b){return _0x161257[_0x5dce('0x9')](_0x5dce('0xa'),attributes,{'tableName':_0x5dce('0xb'),'paranoid':![],'indexes':[{'name':_0x5dce('0xc'),'fields':[_0x5dce('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 09b8aca..4efe8cd 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(_0xfd49ed,_0x1272e1){var _0x355f54=function(_0x3fc70f){while(--_0x3fc70f){_0xfd49ed['push'](_0xfd49ed['shift']());}};_0x355f54(++_0x1272e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x45f4ba,_0x5498c8){var _0x44db14=function(_0x381dec){while(--_0x381dec){_0x45f4ba['push'](_0x45f4ba['shift']());}};_0x44db14(++_0x5498c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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 8704d28..18ef948 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 _0xb4c7=['create','put','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','/:id','show','post'];(function(_0x36e8ce,_0x5936c1){var _0x1994d9=function(_0x1fdfc0){while(--_0x1fdfc0){_0x36e8ce['push'](_0x36e8ce['shift']());}};_0x1994d9(++_0x5936c1);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x156da5,_0x177ac0){_0x156da5=_0x156da5-0x0;var _0x3de768=_0xb4c7[_0x156da5];return _0x3de768;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var auth=require(_0x7b4c('0x5'));var interaction=require(_0x7b4c('0x6'));var config=require(_0x7b4c('0x7'));var controller=require(_0x7b4c('0x8'));router[_0x7b4c('0x9')]('/',auth['isAuthenticated'](),controller[_0x7b4c('0xa')]);router[_0x7b4c('0x9')](_0x7b4c('0xb'),auth['isAuthenticated'](),controller[_0x7b4c('0xc')]);router[_0x7b4c('0xd')]('/',auth['isAuthenticated'](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xb'),auth[_0x7b4c('0x10')](),controller[_0x7b4c('0x11')]);router[_0x7b4c('0x12')](_0x7b4c('0xb'),auth[_0x7b4c('0x10')](),controller[_0x7b4c('0x13')]);module[_0x7b4c('0x14')]=router; \ No newline at end of file +var _0x1967=['get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller'];(function(_0x4100d4,_0x45ba23){var _0x179c5c=function(_0x36bfca){while(--_0x36bfca){_0x4100d4['push'](_0x4100d4['shift']());}};_0x179c5c(++_0x45ba23);}(_0x1967,0x173));var _0x7196=function(_0x2b8643,_0x433de3){_0x2b8643=_0x2b8643-0x0;var _0x4dcfef=_0x1967[_0x2b8643];return _0x4dcfef;};'use strict';var multer=require('multer');var util=require(_0x7196('0x0'));var path=require(_0x7196('0x1'));var timeout=require(_0x7196('0x2'));var express=require(_0x7196('0x3'));var router=express[_0x7196('0x4')]();var auth=require(_0x7196('0x5'));var interaction=require(_0x7196('0x6'));var config=require(_0x7196('0x7'));var controller=require(_0x7196('0x8'));router[_0x7196('0x9')]('/',auth['isAuthenticated'](),controller[_0x7196('0xa')]);router[_0x7196('0x9')](_0x7196('0xb'),auth[_0x7196('0xc')](),controller[_0x7196('0xd')]);router[_0x7196('0xe')]('/',auth['isAuthenticated'](),controller[_0x7196('0xf')]);router[_0x7196('0x10')](_0x7196('0xb'),auth[_0x7196('0xc')](),controller[_0x7196('0x11')]);router['delete']('/:id',auth[_0x7196('0xc')](),controller[_0x7196('0x12')]);module[_0x7196('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 5dfe808..23dc49f 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 _0x553e=['Yes','sequelize','exports','ENUM','attended','STRING'];(function(_0x14806a,_0x14d122){var _0x12e125=function(_0x7e370e){while(--_0x7e370e){_0x14806a['push'](_0x14806a['shift']());}};_0x12e125(++_0x14d122);}(_0x553e,0x127));var _0xe553=function(_0x248a2a,_0x34bdb4){_0x248a2a=_0x248a2a-0x0;var _0x4b025f=_0x553e[_0x248a2a];return _0x4b025f;};'use strict';var Sequelize=require(_0xe553('0x0'));var moment=require('moment');module[_0xe553('0x1')]={'type':{'type':Sequelize[_0xe553('0x2')]('blind',_0xe553('0x3'))},'result':{'type':Sequelize[_0xe553('0x4')]},'transfererchannel':{'type':Sequelize[_0xe553('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xe553('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xe553('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xe553('0x4')]},'transferercontext':{'type':Sequelize[_0xe553('0x4')]},'transfererexten':{'type':Sequelize[_0xe553('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xe553('0x4')]},'transfereechannel':{'type':Sequelize[_0xe553('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xe553('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xe553('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xe553('0x4')]},'transfereeexten':{'type':Sequelize[_0xe553('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xe553('0x4')]},'isexternal':{'type':Sequelize[_0xe553('0x2')](_0xe553('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xe553('0x4')]}}; \ No newline at end of file +var _0x353c=['Yes','moment','exports','attended','STRING','ENUM'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x353c,0xd3));var _0xc353=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x353c[_0x1a9204];return _0x17ca68;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc353('0x0'));module[_0xc353('0x1')]={'type':{'type':Sequelize['ENUM']('blind',_0xc353('0x2'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xc353('0x3')]},'transferercalleridnum':{'type':Sequelize[_0xc353('0x3')]},'transferercalleridname':{'type':Sequelize[_0xc353('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0xc353('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0xc353('0x3')]},'transfereraccountcode':{'type':Sequelize[_0xc353('0x3')]},'transferercontext':{'type':Sequelize[_0xc353('0x3')]},'transfererexten':{'type':Sequelize[_0xc353('0x3')]},'transfererlinkedid':{'type':Sequelize[_0xc353('0x3')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xc353('0x3')]},'transfereecalleridname':{'type':Sequelize[_0xc353('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xc353('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0xc353('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0xc353('0x3')]},'transfereecontext':{'type':Sequelize[_0xc353('0x3')]},'transfereeexten':{'type':Sequelize[_0xc353('0x3')]},'transfereelinkedid':{'type':Sequelize[_0xc353('0x3')]},'isexternal':{'type':Sequelize[_0xc353('0x4')](_0xc353('0x5'),'No')},'context':{'type':Sequelize[_0xc353('0x3')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index f031fd8..9b50732 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 _0x8542=['params','create','body','catch','find','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','VoiceTransferReport','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','pick','where','map','type','VIRTUAL','field','filter','merge','options','count','includeAll','include','rows'];(function(_0x148166,_0x44e7dc){var _0x52e6fc=function(_0x5bc025){while(--_0x5bc025){_0x148166['push'](_0x148166['shift']());}};_0x52e6fc(++_0x44e7dc);}(_0x8542,0x10d));var _0x2854=function(_0x5e87ec,_0x4cac63){_0x5e87ec=_0x5e87ec-0x0;var _0x558e80=_0x8542[_0x5e87ec];return _0x558e80;};'use strict';var pdf=require(_0x2854('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2854('0x1'));var zipdir=require(_0x2854('0x2'));var jsonpatch=require(_0x2854('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2854('0x4'));var Mustache=require(_0x2854('0x5'));var util=require(_0x2854('0x6'));var path=require(_0x2854('0x7'));var sox=require(_0x2854('0x8'));var csv=require(_0x2854('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2854('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2854('0x9'));var querystring=require(_0x2854('0xb'));var Papa=require(_0x2854('0xc'));var Redis=require(_0x2854('0xd'));var authService=require(_0x2854('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2854('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x2854('0x10'));var db=require(_0x2854('0x11'))['db'];function respondWithStatusCode(_0x1e9f5c,_0x407b17){_0x407b17=_0x407b17||0xcc;return function(_0x294a5d){if(_0x294a5d){return _0x1e9f5c[_0x2854('0x12')](_0x407b17);}return _0x1e9f5c[_0x2854('0x13')](_0x407b17)[_0x2854('0x14')]();};}function respondWithResult(_0x503df7,_0x5bc7a7){_0x5bc7a7=_0x5bc7a7||0xc8;return function(_0x3ab4ac){if(_0x3ab4ac){return _0x503df7[_0x2854('0x13')](_0x5bc7a7)[_0x2854('0x15')](_0x3ab4ac);}};}function respondWithFilteredResult(_0x2e5818,_0x469c0c){return function(_0x15473a){if(_0x15473a){var _0x2c45e8=_0x15473a['count'],_0x5ac324=_0x469c0c[_0x2854('0x16')],_0x3b3dd4=_0x469c0c[_0x2854('0x16')]+_0x469c0c[_0x2854('0x17')],_0xa35314;if(_0x3b3dd4>=_0x2c45e8){_0x3b3dd4=_0x2c45e8;_0xa35314=0xc8;}else{_0xa35314=0xce;}_0x2e5818[_0x2854('0x13')](_0xa35314);return _0x2e5818[_0x2854('0x18')]('Content-Range',_0x5ac324+'-'+_0x3b3dd4+'/'+_0x2c45e8)[_0x2854('0x15')](_0x15473a);}return null;};}function patchUpdates(_0x41696e){return function(_0x148303){try{jsonpatch[_0x2854('0x19')](_0x148303,_0x41696e,!![]);}catch(_0x3af825){return BPromise[_0x2854('0x1a')](_0x3af825);}return _0x148303[_0x2854('0x1b')]();};}function saveUpdates(_0x2dcf77,_0xa7ef46){return function(_0x1dd16c){if(_0x1dd16c){return _0x1dd16c[_0x2854('0x1c')](_0x2dcf77)[_0x2854('0x1d')](function(_0x50eb23){return _0x50eb23;});}return null;};}function removeEntity(_0x2dcced,_0x19cde1){return function(_0x442ca8){if(_0x442ca8){return _0x442ca8[_0x2854('0x1e')]()['then'](function(){_0x2dcced[_0x2854('0x13')](0xcc)[_0x2854('0x14')]();});}};}function handleEntityNotFound(_0x299cf4,_0x1839b5){return function(_0x46708c){if(!_0x46708c){_0x299cf4['sendStatus'](0x194);}return _0x46708c;};}function handleError(_0x37c07f,_0x4f250c){_0x4f250c=_0x4f250c||0x1f4;return function(_0x52d5b6){logger[_0x2854('0x1f')](_0x52d5b6[_0x2854('0x20')]);if(_0x52d5b6[_0x2854('0x21')]){delete _0x52d5b6['name'];}_0x37c07f['status'](_0x4f250c)[_0x2854('0x22')](_0x52d5b6);};}exports['index']=function(_0x1e1219,_0x519163){var _0x31274a={},_0x1335d7={},_0x566ec7={'count':0x0,'rows':[]};var _0x407bd5=db[_0x2854('0x23')][_0x2854('0x24')];_0x1335d7[_0x2854('0x25')]=_[_0x2854('0x26')](_0x407bd5);_0x1335d7['query']=_[_0x2854('0x26')](_0x1e1219['query']);_0x1335d7[_0x2854('0x27')]=_[_0x2854('0x28')](_0x1335d7[_0x2854('0x25')],_0x1335d7[_0x2854('0x29')]);_0x31274a[_0x2854('0x2a')]=_['intersection'](_0x1335d7[_0x2854('0x25')],qs[_0x2854('0x2b')](_0x1e1219[_0x2854('0x29')]['fields']));_0x31274a['attributes']=_0x31274a[_0x2854('0x2a')][_0x2854('0x2c')]?_0x31274a['attributes']:_0x1335d7[_0x2854('0x25')];if(!_0x1e1219['query'][_0x2854('0x2d')]('nolimit')){_0x31274a[_0x2854('0x17')]=qs['limit'](_0x1e1219['query'][_0x2854('0x17')]);_0x31274a[_0x2854('0x16')]=qs[_0x2854('0x16')](_0x1e1219[_0x2854('0x29')][_0x2854('0x16')]);}_0x31274a[_0x2854('0x2e')]=qs[_0x2854('0x2f')](_0x1e1219[_0x2854('0x29')][_0x2854('0x2f')]);_0x31274a['where']=qs[_0x2854('0x27')](_[_0x2854('0x30')](_0x1e1219['query'],_0x1335d7[_0x2854('0x27')]));if(_0x1e1219[_0x2854('0x29')]['filter']){_0x31274a[_0x2854('0x31')]=_['merge'](_0x31274a[_0x2854('0x31')],{'$or':_[_0x2854('0x32')](_0x407bd5,function(_0x2c06b5){if(_0x2c06b5[_0x2854('0x33')]['key']!==_0x2854('0x34')){var _0x51749e={};_0x51749e[_0x2c06b5[_0x2854('0x35')]]={'$like':'%'+_0x1e1219['query'][_0x2854('0x36')]+'%'};return _0x51749e;}})});}_0x31274a=_[_0x2854('0x37')]({},_0x31274a,_0x1e1219[_0x2854('0x38')]);var _0x1f48d0={'where':_0x31274a['where']};return db[_0x2854('0x23')][_0x2854('0x39')](_0x1f48d0)['then'](function(_0xdf2812){_0x566ec7['count']=_0xdf2812;if(_0x1e1219[_0x2854('0x29')][_0x2854('0x3a')]){_0x31274a[_0x2854('0x3b')]=[{'all':!![]}];}return db[_0x2854('0x23')]['findAll'](_0x31274a);})[_0x2854('0x1d')](function(_0x1126f1){_0x566ec7[_0x2854('0x3c')]=_0x1126f1;return _0x566ec7;})[_0x2854('0x1d')](respondWithFilteredResult(_0x519163,_0x31274a))['catch'](handleError(_0x519163,null));};exports['show']=function(_0x4f1560,_0x1acc8c){var _0x20bad4={'raw':!![],'where':{'id':_0x4f1560[_0x2854('0x3d')]['id']}},_0x1a2c05={};_0x1a2c05[_0x2854('0x25')]=_[_0x2854('0x26')](db[_0x2854('0x23')][_0x2854('0x24')]);_0x1a2c05[_0x2854('0x29')]=_['keys'](_0x4f1560[_0x2854('0x29')]);_0x1a2c05[_0x2854('0x27')]=_[_0x2854('0x28')](_0x1a2c05[_0x2854('0x25')],_0x1a2c05[_0x2854('0x29')]);_0x20bad4[_0x2854('0x2a')]=_['intersection'](_0x1a2c05[_0x2854('0x25')],qs[_0x2854('0x2b')](_0x4f1560['query'][_0x2854('0x2b')]));_0x20bad4[_0x2854('0x2a')]=_0x20bad4[_0x2854('0x2a')][_0x2854('0x2c')]?_0x20bad4[_0x2854('0x2a')]:_0x1a2c05[_0x2854('0x25')];if(_0x4f1560['query'][_0x2854('0x3a')]){_0x20bad4[_0x2854('0x3b')]=[{'all':!![]}];}_0x20bad4=_[_0x2854('0x37')]({},_0x20bad4,_0x4f1560['options']);return db[_0x2854('0x23')]['find'](_0x20bad4)[_0x2854('0x1d')](handleEntityNotFound(_0x1acc8c,null))[_0x2854('0x1d')](respondWithResult(_0x1acc8c,null))['catch'](handleError(_0x1acc8c,null));};exports[_0x2854('0x3e')]=function(_0x204d23,_0x4e4966){return db['VoiceTransferReport']['create'](_0x204d23[_0x2854('0x3f')],{})[_0x2854('0x1d')](respondWithResult(_0x4e4966,0xc9))[_0x2854('0x40')](handleError(_0x4e4966,null));};exports[_0x2854('0x1c')]=function(_0xf74ca8,_0x24cb8d){if(_0xf74ca8['body']['id']){delete _0xf74ca8[_0x2854('0x3f')]['id'];}return db[_0x2854('0x23')]['find']({'where':{'id':_0xf74ca8[_0x2854('0x3d')]['id']}})[_0x2854('0x1d')](handleEntityNotFound(_0x24cb8d,null))[_0x2854('0x1d')](saveUpdates(_0xf74ca8['body'],null))['then'](respondWithResult(_0x24cb8d,null))[_0x2854('0x40')](handleError(_0x24cb8d,null));};exports['destroy']=function(_0x250b5b,_0x297f72){return db[_0x2854('0x23')][_0x2854('0x41')]({'where':{'id':_0x250b5b[_0x2854('0x3d')]['id']}})['then'](handleEntityNotFound(_0x297f72,null))['then'](removeEntity(_0x297f72,null))[_0x2854('0x40')](handleError(_0x297f72,null));}; \ No newline at end of file +var _0x436e=['../../mysqldb','sendStatus','end','status','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','name','send','rawAttributes','keys','filters','query','intersection','model','fields','length','attributes','hasOwnProperty','sort','where','pick','filter','merge','map','type','field','VoiceTransferReport','count','findAll','rows','catch','show','params','includeAll','find','create','body','update','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x1fec1e,_0xce18d2){var _0x31f9ec=function(_0x347a9a){while(--_0x347a9a){_0x1fec1e['push'](_0x1fec1e['shift']());}};_0x31f9ec(++_0xce18d2);}(_0x436e,0x13e));var _0xe436=function(_0x4104c0,_0xf421cd){_0x4104c0=_0x4104c0-0x0;var _0x2b3dc0=_0x436e[_0x4104c0];return _0x2b3dc0;};'use strict';var pdf=require(_0xe436('0x0'));var emlformat=require(_0xe436('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe436('0x2'));var jsonpatch=require(_0xe436('0x3'));var rp=require('request-promise');var moment=require(_0xe436('0x4'));var BPromise=require(_0xe436('0x5'));var Mustache=require(_0xe436('0x6'));var util=require(_0xe436('0x7'));var path=require('path');var sox=require(_0xe436('0x8'));var csv=require(_0xe436('0x9'));var ejs=require(_0xe436('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe436('0xb'));var crypto=require(_0xe436('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe436('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe436('0xe'));var Papa=require('papaparse');var Redis=require(_0xe436('0xf'));var authService=require(_0xe436('0x10'));var qs=require(_0xe436('0x11'));var hardwareService=require(_0xe436('0x12'));var logger=require(_0xe436('0x13'))(_0xe436('0x14'));var utils=require(_0xe436('0x15'));var config=require('../../config/environment');var db=require(_0xe436('0x16'))['db'];function respondWithStatusCode(_0x51e93e,_0xd3d295){_0xd3d295=_0xd3d295||0xcc;return function(_0x56c7b5){if(_0x56c7b5){return _0x51e93e[_0xe436('0x17')](_0xd3d295);}return _0x51e93e['status'](_0xd3d295)[_0xe436('0x18')]();};}function respondWithResult(_0x5519ca,_0x5a0c02){_0x5a0c02=_0x5a0c02||0xc8;return function(_0x2920ab){if(_0x2920ab){return _0x5519ca[_0xe436('0x19')](_0x5a0c02)['json'](_0x2920ab);}};}function respondWithFilteredResult(_0x99d5cf,_0x25d020){return function(_0x38c37a){if(_0x38c37a){var _0x4f9977=_0x38c37a['count'],_0x13503e=_0x25d020[_0xe436('0x1a')],_0x23ca42=_0x25d020['offset']+_0x25d020[_0xe436('0x1b')],_0x3487dd;if(_0x23ca42>=_0x4f9977){_0x23ca42=_0x4f9977;_0x3487dd=0xc8;}else{_0x3487dd=0xce;}_0x99d5cf[_0xe436('0x19')](_0x3487dd);return _0x99d5cf[_0xe436('0x1c')](_0xe436('0x1d'),_0x13503e+'-'+_0x23ca42+'/'+_0x4f9977)[_0xe436('0x1e')](_0x38c37a);}return null;};}function patchUpdates(_0x5a25b1){return function(_0x3d475f){try{jsonpatch[_0xe436('0x1f')](_0x3d475f,_0x5a25b1,!![]);}catch(_0xba7ad3){return BPromise[_0xe436('0x20')](_0xba7ad3);}return _0x3d475f[_0xe436('0x21')]();};}function saveUpdates(_0x5952fa,_0x3fb626){return function(_0x298ae2){if(_0x298ae2){return _0x298ae2['update'](_0x5952fa)[_0xe436('0x22')](function(_0x571838){return _0x571838;});}return null;};}function removeEntity(_0x11199c,_0x328e62){return function(_0x2c8465){if(_0x2c8465){return _0x2c8465[_0xe436('0x23')]()[_0xe436('0x22')](function(){_0x11199c[_0xe436('0x19')](0xcc)[_0xe436('0x18')]();});}};}function handleEntityNotFound(_0x21bdf4,_0x35de0f){return function(_0x505ef8){if(!_0x505ef8){_0x21bdf4[_0xe436('0x17')](0x194);}return _0x505ef8;};}function handleError(_0x597d84,_0x35f386){_0x35f386=_0x35f386||0x1f4;return function(_0x4d4083){logger['error'](_0x4d4083['stack']);if(_0x4d4083[_0xe436('0x24')]){delete _0x4d4083[_0xe436('0x24')];}_0x597d84[_0xe436('0x19')](_0x35f386)[_0xe436('0x25')](_0x4d4083);};}exports['index']=function(_0x5c847d,_0x18e6ef){var _0x320244={},_0x530cfb={},_0x5985b2={'count':0x0,'rows':[]};var _0x399fac=db['VoiceTransferReport'][_0xe436('0x26')];_0x530cfb['model']=_[_0xe436('0x27')](_0x399fac);_0x530cfb['query']=_[_0xe436('0x27')](_0x5c847d['query']);_0x530cfb[_0xe436('0x28')]=_['intersection'](_0x530cfb['model'],_0x530cfb[_0xe436('0x29')]);_0x320244['attributes']=_[_0xe436('0x2a')](_0x530cfb[_0xe436('0x2b')],qs['fields'](_0x5c847d[_0xe436('0x29')][_0xe436('0x2c')]));_0x320244['attributes']=_0x320244['attributes'][_0xe436('0x2d')]?_0x320244[_0xe436('0x2e')]:_0x530cfb['model'];if(!_0x5c847d['query'][_0xe436('0x2f')]('nolimit')){_0x320244[_0xe436('0x1b')]=qs[_0xe436('0x1b')](_0x5c847d[_0xe436('0x29')][_0xe436('0x1b')]);_0x320244[_0xe436('0x1a')]=qs[_0xe436('0x1a')](_0x5c847d[_0xe436('0x29')][_0xe436('0x1a')]);}_0x320244['order']=qs[_0xe436('0x30')](_0x5c847d[_0xe436('0x29')][_0xe436('0x30')]);_0x320244[_0xe436('0x31')]=qs[_0xe436('0x28')](_[_0xe436('0x32')](_0x5c847d[_0xe436('0x29')],_0x530cfb[_0xe436('0x28')]));if(_0x5c847d[_0xe436('0x29')][_0xe436('0x33')]){_0x320244[_0xe436('0x31')]=_[_0xe436('0x34')](_0x320244[_0xe436('0x31')],{'$or':_[_0xe436('0x35')](_0x399fac,function(_0x4227ce){if(_0x4227ce[_0xe436('0x36')]['key']!=='VIRTUAL'){var _0xb26c72={};_0xb26c72[_0x4227ce[_0xe436('0x37')]]={'$like':'%'+_0x5c847d[_0xe436('0x29')]['filter']+'%'};return _0xb26c72;}})});}_0x320244=_['merge']({},_0x320244,_0x5c847d['options']);var _0x43bf49={'where':_0x320244[_0xe436('0x31')]};return db[_0xe436('0x38')][_0xe436('0x39')](_0x43bf49)[_0xe436('0x22')](function(_0x902845){_0x5985b2[_0xe436('0x39')]=_0x902845;if(_0x5c847d[_0xe436('0x29')]['includeAll']){_0x320244['include']=[{'all':!![]}];}return db[_0xe436('0x38')][_0xe436('0x3a')](_0x320244);})[_0xe436('0x22')](function(_0x14d39d){_0x5985b2[_0xe436('0x3b')]=_0x14d39d;return _0x5985b2;})['then'](respondWithFilteredResult(_0x18e6ef,_0x320244))[_0xe436('0x3c')](handleError(_0x18e6ef,null));};exports[_0xe436('0x3d')]=function(_0x1114db,_0x3a97be){var _0x41d83f={'raw':!![],'where':{'id':_0x1114db[_0xe436('0x3e')]['id']}},_0x205ae7={};_0x205ae7[_0xe436('0x2b')]=_[_0xe436('0x27')](db['VoiceTransferReport'][_0xe436('0x26')]);_0x205ae7['query']=_[_0xe436('0x27')](_0x1114db['query']);_0x205ae7[_0xe436('0x28')]=_[_0xe436('0x2a')](_0x205ae7[_0xe436('0x2b')],_0x205ae7[_0xe436('0x29')]);_0x41d83f[_0xe436('0x2e')]=_[_0xe436('0x2a')](_0x205ae7[_0xe436('0x2b')],qs[_0xe436('0x2c')](_0x1114db[_0xe436('0x29')][_0xe436('0x2c')]));_0x41d83f[_0xe436('0x2e')]=_0x41d83f[_0xe436('0x2e')][_0xe436('0x2d')]?_0x41d83f[_0xe436('0x2e')]:_0x205ae7[_0xe436('0x2b')];if(_0x1114db[_0xe436('0x29')][_0xe436('0x3f')]){_0x41d83f['include']=[{'all':!![]}];}_0x41d83f=_[_0xe436('0x34')]({},_0x41d83f,_0x1114db['options']);return db[_0xe436('0x38')][_0xe436('0x40')](_0x41d83f)[_0xe436('0x22')](handleEntityNotFound(_0x3a97be,null))[_0xe436('0x22')](respondWithResult(_0x3a97be,null))[_0xe436('0x3c')](handleError(_0x3a97be,null));};exports['create']=function(_0x1bec99,_0x1f0e35){return db[_0xe436('0x38')][_0xe436('0x41')](_0x1bec99[_0xe436('0x42')],{})[_0xe436('0x22')](respondWithResult(_0x1f0e35,0xc9))[_0xe436('0x3c')](handleError(_0x1f0e35,null));};exports[_0xe436('0x43')]=function(_0x5c3e2c,_0x3d9305){if(_0x5c3e2c[_0xe436('0x42')]['id']){delete _0x5c3e2c['body']['id'];}return db[_0xe436('0x38')][_0xe436('0x40')]({'where':{'id':_0x5c3e2c[_0xe436('0x3e')]['id']}})[_0xe436('0x22')](handleEntityNotFound(_0x3d9305,null))[_0xe436('0x22')](saveUpdates(_0x5c3e2c[_0xe436('0x42')],null))[_0xe436('0x22')](respondWithResult(_0x3d9305,null))[_0xe436('0x3c')](handleError(_0x3d9305,null));};exports[_0xe436('0x23')]=function(_0x20b436,_0x31f384){return db[_0xe436('0x38')][_0xe436('0x40')]({'where':{'id':_0x20b436[_0xe436('0x3e')]['id']}})[_0xe436('0x22')](handleEntityNotFound(_0x31f384,null))[_0xe436('0x22')](removeEntity(_0x31f384,null))[_0xe436('0x3c')](handleError(_0x31f384,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 116599f..b5fcd86 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 _0x539f=['rimraf','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x539f,0xa2));var _0xf539=function(_0x371ac8,_0x752f0d){_0x371ac8=_0x371ac8-0x0;var _0x56a814=_0x539f[_0x371ac8];return _0x56a814;};'use strict';var _=require(_0xf539('0x0'));var util=require(_0xf539('0x1'));var logger=require(_0xf539('0x2'))(_0xf539('0x3'));var moment=require('moment');var BPromise=require(_0xf539('0x4'));var rp=require(_0xf539('0x5'));var fs=require('fs');var path=require(_0xf539('0x6'));var rimraf=require(_0xf539('0x7'));var config=require(_0xf539('0x8'));var attributes=require(_0xf539('0x9'));module[_0xf539('0xa')]=function(_0x21c503,_0x2156a9){return _0x21c503['define'](_0xf539('0xb'),attributes,{'tableName':_0xf539('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2af=['util','../../config/logger','api','moment','request-promise','path','rimraf','./voiceTransferReport.attributes','define','lodash'];(function(_0x26fab9,_0x2fbba2){var _0x223036=function(_0x34a52f){while(--_0x34a52f){_0x26fab9['push'](_0x26fab9['shift']());}};_0x223036(++_0x2fbba2);}(_0xe2af,0x167));var _0xfe2a=function(_0x30e868,_0x38b5cb){_0x30e868=_0x30e868-0x0;var _0x53a3d7=_0xe2af[_0x30e868];return _0x53a3d7;};'use strict';var _=require(_0xfe2a('0x0'));var util=require(_0xfe2a('0x1'));var logger=require(_0xfe2a('0x2'))(_0xfe2a('0x3'));var moment=require(_0xfe2a('0x4'));var BPromise=require('bluebird');var rp=require(_0xfe2a('0x5'));var fs=require('fs');var path=require(_0xfe2a('0x6'));var rimraf=require(_0xfe2a('0x7'));var config=require('../../config/environment');var attributes=require(_0xfe2a('0x8'));module['exports']=function(_0x2ad74d,_0x468385){return _0x2ad74d[_0xfe2a('0x9')]('VoiceTransferReport',attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 6f7c21e..d276e80 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 _0x5d98=['debug','stringify','error','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','info','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2d98a3,_0x5697b2){var _0x57265f=function(_0x20518d){while(--_0x20518d){_0x2d98a3['push'](_0x2d98a3['shift']());}};_0x57265f(++_0x5697b2);}(_0x5d98,0x141));var _0x85d9=function(_0x198772,_0x1ee96){_0x198772=_0x198772-0x0;var _0x309d0d=_0x5d98[_0x198772];return _0x309d0d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85d9('0x0'));var BPromise=require(_0x85d9('0x1'));var rs=require(_0x85d9('0x2'));var fs=require('fs');var Redis=require(_0x85d9('0x3'));var db=require(_0x85d9('0x4'))['db'];var utils=require(_0x85d9('0x5'));var logger=require(_0x85d9('0x6'))(_0x85d9('0x7'));var config=require(_0x85d9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x85d9('0x9')][_0x85d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2da9fd,_0x3683d7,_0x2d0721){return new BPromise(function(_0x2bc25d,_0x48d007){return client[_0x85d9('0xb')](_0x2da9fd,_0x2d0721)[_0x85d9('0xc')](function(_0x5ee342){logger['info'](_0x85d9('0xd'),_0x3683d7,_0x85d9('0xe'));logger[_0x85d9('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x3683d7,_0x85d9('0xe'),JSON[_0x85d9('0x10')](_0x5ee342));if(_0x5ee342[_0x85d9('0x11')]){if(_0x5ee342[_0x85d9('0x11')]['code']===0x1f4){logger['error'](_0x85d9('0xd'),_0x3683d7,_0x5ee342['error'][_0x85d9('0x12')]);return _0x48d007(_0x5ee342[_0x85d9('0x11')][_0x85d9('0x12')]);}logger['error'](_0x85d9('0xd'),_0x3683d7,_0x5ee342[_0x85d9('0x11')]['message']);return _0x2bc25d(_0x5ee342[_0x85d9('0x11')]['message']);}else{logger['info'](_0x85d9('0xd'),_0x3683d7,_0x85d9('0xe'));_0x2bc25d(_0x5ee342[_0x85d9('0x13')]['message']);}})[_0x85d9('0x14')](function(_0x1e7bdc){logger[_0x85d9('0x11')](_0x85d9('0xd'),_0x3683d7,_0x1e7bdc);_0x48d007(_0x1e7bdc);});});}exports[_0x85d9('0x15')]=function(_0x1fe219){var _0x5a6ad3=this;return new Promise(function(_0x10e6ba,_0x91c479){return db[_0x85d9('0x16')][_0x85d9('0x17')](_0x1fe219[_0x85d9('0x18')],{'raw':_0x1fe219[_0x85d9('0x19')]?_0x1fe219[_0x85d9('0x19')][_0x85d9('0x1a')]===undefined?!![]:![]:!![]})[_0x85d9('0xc')](function(_0x8671b1){logger[_0x85d9('0x1b')](_0x85d9('0x15'),_0x1fe219);logger[_0x85d9('0xf')]('CreateVoiceTransferReport',_0x1fe219,JSON[_0x85d9('0x10')](_0x8671b1));_0x10e6ba(_0x8671b1);})[_0x85d9('0x14')](function(_0x37592b){logger['error'](_0x85d9('0x15'),_0x37592b[_0x85d9('0x12')],_0x1fe219);_0x91c479(_0x5a6ad3[_0x85d9('0x11')](0x1f4,_0x37592b[_0x85d9('0x12')]));});});}; \ No newline at end of file +var _0x8cc2=['catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','raw','debug','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','VoiceTransferReport,\x20%s,\x20%s','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result'];(function(_0x3b2244,_0x54873f){var _0x2dcc14=function(_0x53d73f){while(--_0x53d73f){_0x3b2244['push'](_0x3b2244['shift']());}};_0x2dcc14(++_0x54873f);}(_0x8cc2,0x1db));var _0x28cc=function(_0x5b49ab,_0xe9c5b6){_0x5b49ab=_0x5b49ab-0x0;var _0x168165=_0x8cc2[_0x5b49ab];return _0x168165;};'use strict';var _=require('lodash');var util=require(_0x28cc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28cc('0x1'));var db=require(_0x28cc('0x2'))['db'];var utils=require(_0x28cc('0x3'));var logger=require(_0x28cc('0x4'))('rpc');var config=require(_0x28cc('0x5'));var jayson=require(_0x28cc('0x6'));var client=jayson[_0x28cc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9b8adb,_0x328a82,_0x2ce3e5){return new BPromise(function(_0x4b0f1c,_0x5ea34d){return client[_0x28cc('0x8')](_0x9b8adb,_0x2ce3e5)[_0x28cc('0x9')](function(_0x48d12e){logger['info'](_0x28cc('0xa'),_0x328a82,'request\x20sent');logger['debug'](_0x28cc('0xb'),_0x328a82,'request\x20sent',JSON[_0x28cc('0xc')](_0x48d12e));if(_0x48d12e[_0x28cc('0xd')]){if(_0x48d12e[_0x28cc('0xd')][_0x28cc('0xe')]===0x1f4){logger['error'](_0x28cc('0xa'),_0x328a82,_0x48d12e[_0x28cc('0xd')][_0x28cc('0xf')]);return _0x5ea34d(_0x48d12e['error']['message']);}logger['error'](_0x28cc('0xa'),_0x328a82,_0x48d12e[_0x28cc('0xd')]['message']);return _0x4b0f1c(_0x48d12e[_0x28cc('0xd')][_0x28cc('0xf')]);}else{logger[_0x28cc('0x10')](_0x28cc('0xa'),_0x328a82,_0x28cc('0x11'));_0x4b0f1c(_0x48d12e[_0x28cc('0x12')]['message']);}})[_0x28cc('0x13')](function(_0x5a440a){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x328a82,_0x5a440a);_0x5ea34d(_0x5a440a);});});}exports[_0x28cc('0x14')]=function(_0x1713a1){var _0x92174b=this;return new Promise(function(_0x8ce9e4,_0x4b0bfd){return db[_0x28cc('0x15')]['create'](_0x1713a1[_0x28cc('0x16')],{'raw':_0x1713a1[_0x28cc('0x17')]?_0x1713a1[_0x28cc('0x17')][_0x28cc('0x18')]===undefined?!![]:![]:!![]})[_0x28cc('0x9')](function(_0x4b8f1d){logger['info'](_0x28cc('0x14'),_0x1713a1);logger[_0x28cc('0x19')](_0x28cc('0x14'),_0x1713a1,JSON[_0x28cc('0xc')](_0x4b8f1d));_0x8ce9e4(_0x4b8f1d);})[_0x28cc('0x13')](function(_0x451804){logger[_0x28cc('0xd')](_0x28cc('0x14'),_0x451804[_0x28cc('0xf')],_0x1713a1);_0x4b0bfd(_0x92174b[_0x28cc('0xd')](0x1f4,_0x451804[_0x28cc('0xf')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 8a65da9..70ae3ad 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc93f=['./config/pm2/config','./config/schedule','sync','then','listen','info','start','Online\x20apps:','map','filter','online','name','Offline\x20apps:','status','join','None','seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/environment','./config/logger','./config/pm2'];(function(_0x19dd7a,_0x51de21){var _0x3feb6a=function(_0x4a3c84){while(--_0x4a3c84){_0x19dd7a['push'](_0x19dd7a['shift']());}};_0x3feb6a(++_0x51de21);}(_0xc93f,0x109));var _0xfc93=function(_0x37df95,_0x447a45){_0x37df95=_0x37df95-0x0;var _0x532d1e=_0xc93f[_0x37df95];return _0x532d1e;};'use strict';var _=require(_0xfc93('0x0'));var mysqldb=require(_0xfc93('0x1'));var rpc=require('./rpc');var config=require(_0xfc93('0x2'));var logger=require(_0xfc93('0x3'))('app');var pm2=require(_0xfc93('0x4'));var pm2Config=require(_0xfc93('0x5'));var schedule=require(_0xfc93('0x6'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db']['sequelize'][_0xfc93('0x7')]()[_0xfc93('0x8')](function(){return rpc[_0xfc93('0x9')]();})[_0xfc93('0x8')](function(_0x12a12d){logger[_0xfc93('0xa')](_0x12a12d);return chat['start']();})['then'](function(){return schedule['start']();})[_0xfc93('0x8')](function(_0x24932c){logger['info'](_0x24932c);return pm2[_0xfc93('0xb')](pm2Config);})[_0xfc93('0x8')](function(_0x42b2b0){logger[_0xfc93('0xa')](_0xfc93('0xc'),_[_0xfc93('0xd')](_[_0xfc93('0xe')](_0x42b2b0,{'status':_0xfc93('0xf')}),_0xfc93('0x10'))['join']());logger[_0xfc93('0xa')](_0xfc93('0x11'),_[_0xfc93('0xd')](_[_0xfc93('0xe')](_0x42b2b0,function(_0x4d4c11){return _0x4d4c11[_0xfc93('0x12')]!==_0xfc93('0xf');}),_0xfc93('0x10'))[_0xfc93('0x13')]()||_0xfc93('0x14'));config[_0xfc93('0x15')]&&require('./config/seedDB')[_0xfc93('0x16')]();require('./config/license')['default']();})[_0xfc93('0x17')](function(_0xcd0432){logger[_0xfc93('0x18')](_0xfc93('0x19'),_0xcd0432);process[_0xfc93('0x1a')](0x1);});}main(); \ No newline at end of file +var _0xcde0=['./config/logger','app','./config/pm2','./config/schedule','sequelize','then','listen','info','start','map','filter','online','name','Offline\x20apps:','join','None','seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment'];(function(_0x2d66ab,_0x3c594c){var _0x277f0c=function(_0x11de96){while(--_0x11de96){_0x2d66ab['push'](_0x2d66ab['shift']());}};_0x277f0c(++_0x3c594c);}(_0xcde0,0x191));var _0x0cde=function(_0xa333df,_0x24161e){_0xa333df=_0xa333df-0x0;var _0x95ffec=_0xcde0[_0xa333df];return _0x95ffec;};'use strict';var _=require(_0x0cde('0x0'));var mysqldb=require(_0x0cde('0x1'));var rpc=require(_0x0cde('0x2'));var config=require(_0x0cde('0x3'));var logger=require(_0x0cde('0x4'))(_0x0cde('0x5'));var pm2=require(_0x0cde('0x6'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x0cde('0x7'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db'][_0x0cde('0x8')]['sync']()[_0x0cde('0x9')](function(){return rpc[_0x0cde('0xa')]();})[_0x0cde('0x9')](function(_0x541977){logger[_0x0cde('0xb')](_0x541977);return chat['start']();})[_0x0cde('0x9')](function(){return schedule[_0x0cde('0xc')]();})[_0x0cde('0x9')](function(_0x3280a4){logger['info'](_0x3280a4);return pm2[_0x0cde('0xc')](pm2Config);})[_0x0cde('0x9')](function(_0x396aa4){logger[_0x0cde('0xb')]('Online\x20apps:',_[_0x0cde('0xd')](_[_0x0cde('0xe')](_0x396aa4,{'status':_0x0cde('0xf')}),_0x0cde('0x10'))['join']());logger[_0x0cde('0xb')](_0x0cde('0x11'),_[_0x0cde('0xd')](_[_0x0cde('0xe')](_0x396aa4,function(_0x3be99f){return _0x3be99f['status']!=='online';}),_0x0cde('0x10'))[_0x0cde('0x12')]()||_0x0cde('0x13'));config[_0x0cde('0x14')]&&require('./config/seedDB')[_0x0cde('0x15')]();require(_0x0cde('0x16'))[_0x0cde('0x15')]();})[_0x0cde('0x17')](function(_0x32b7d1){logger[_0x0cde('0x18')](_0x0cde('0x19'),_0x32b7d1);process[_0x0cde('0x1a')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index bb5601a..66ddc2b 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 _0x955f=['showWebBar','phoneBarRemoteControl','interface','userProfileId','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','Unmanaged.','Forbidden.','headers','authorization','startsWith','Basic','User','name','authenticate','pass','json','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','verify','secrets','getUuid','find','apiKeyNonce','nonce','log','Unrecognized\x20API\x20access\x20key','User\x20object\x20not\x20found.','../../config/license/util','update','Forbidden','canUpdate','sign','signToken','hasRole','userRoles','indexOf','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','motion.user','pick','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','randomBytes','toString','hex','floor','now','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','composable-middleware','ipaddr.js','session','role','fullname','internal','email','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause'];(function(_0x3b811f,_0x1653be){var _0x1b7314=function(_0x37d7af){while(--_0x37d7af){_0x3b811f['push'](_0x3b811f['shift']());}};_0x1b7314(++_0x1653be);}(_0x955f,0x1eb));var _0xf955=function(_0x484e0f,_0x26c8de){_0x484e0f=_0x484e0f-0x0;var _0xc4538b=_0x955f[_0x484e0f];return _0xc4538b;};'use strict';var db=require(_0xf955('0x0'))['db'];var config=require(_0xf955('0x1'));var hardwareConf=require(_0xf955('0x2'));var _=require(_0xf955('0x3'));var jwt=require(_0xf955('0x4'));var expressJwt=require('express-jwt');var compose=require(_0xf955('0x5'));var basicAuth=require('basic-auth');var crypto=require('crypto');var ipaddr=require(_0xf955('0x6'));var validateJwt=expressJwt({'secret':config['secrets'][_0xf955('0x7')]});var userAttributes=['id',_0xf955('0x8'),_0xf955('0x9'),'name',_0xf955('0xa'),_0xf955('0xb'),'userpic',_0xf955('0xc'),_0xf955('0xd'),_0xf955('0xe'),_0xf955('0xf'),_0xf955('0x10'),_0xf955('0x11'),_0xf955('0x12'),'pauseType',_0xf955('0x13'),'phoneBarRemoteControlPort',_0xf955('0x14'),_0xf955('0x15'),_0xf955('0x16')];exports['isChatInteractionAuthorized']=function(){return isAuthenticated(!![])[_0xf955('0x17')](function(_0x542347,_0x23e0c6,_0x50d9a9){if(_0x542347[_0xf955('0x18')]){_0x50d9a9();}else{return db[_0xf955('0x19')][_0xf955('0x1a')]({'where':{'id':_0x542347[_0xf955('0x1b')]['id']},'attributes':['id',_0xf955('0x1c'),_0xf955('0x1d')],'raw':!![]})[_0xf955('0x1e')](function(_0x2783f2){if(_0x2783f2&&_0x2783f2[_0xf955('0x1c')]){return _0x23e0c6[_0xf955('0x1f')](_0x2783f2['disposition']===_0xf955('0x20')?0x195:0x193)['json']({'message':_0x2783f2[_0xf955('0x1d')]===_0xf955('0x20')?_0xf955('0x21'):_0xf955('0x22')});}else{_0x50d9a9();}})['catch'](function(_0x5ac6cb){_0x50d9a9(_0x5ac6cb);});}});};function isAuthenticated(_0x1e20d1){return compose()[_0xf955('0x17')](function(_0x3c49c0,_0x4d7b5b,_0xb71daf){if(_0x3c49c0[_0xf955('0x23')][_0xf955('0x24')]){if(_[_0xf955('0x25')](_0x3c49c0[_0xf955('0x23')]['authorization'],_0xf955('0x26'))){var _0x3dbbe8=basicAuth(_0x3c49c0);db[_0xf955('0x27')]['find']({'where':{'name':_0x3dbbe8[_0xf955('0x28')]}})['then'](function(_0x21ae24){if(!_0x21ae24||!_0x21ae24[_0xf955('0x29')](_0x3dbbe8[_0xf955('0x2a')])){return _0x4d7b5b[_0xf955('0x1f')](0x191)[_0xf955('0x2b')]({'message':'Wrong\x20credentials.'});}_0x3c49c0[_0xf955('0x18')]={'id':_0x21ae24['id']};_0xb71daf();})[_0xf955('0x2c')](function(_0x3585c7){_0xb71daf(_0x3585c7);});}else if(_[_0xf955('0x25')](_0x3c49c0[_0xf955('0x23')][_0xf955('0x24')],_0xf955('0x2d'))){validateJwt(_0x3c49c0,_0x4d7b5b,_0xb71daf);}else{if(_0x1e20d1){_0xb71daf();}else{return _0x4d7b5b['status'](0x193)[_0xf955('0x2b')]({'message':_0xf955('0x2e')});}}}else if(_0x3c49c0[_0xf955('0x2f')][_0xf955('0x30')]){try{var _0x2dcd55=jwt[_0xf955('0x31')](_0x3c49c0[_0xf955('0x2f')]['apikey'],config[_0xf955('0x32')][_0xf955('0x7')],{'audience':hardwareConf[_0xf955('0x33')](),'issuer':hardwareConf[_0xf955('0x33')]()});db[_0xf955('0x27')][_0xf955('0x34')]({'where':{'id':_0x2dcd55['sub']}})[_0xf955('0x1e')](function(_0x1e5d37){if(!_0x1e5d37||!_['isEqual'](_0x1e5d37[_0xf955('0x35')],_0x2dcd55[_0xf955('0x36')])){return _0x4d7b5b[_0xf955('0x1f')](0x193)[_0xf955('0x2b')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}_0x3c49c0[_0xf955('0x18')]={'id':_0x1e5d37['id']};_0xb71daf();})['catch'](function(_0x227104){_0xb71daf(_0x227104);});}catch(_0x2c222a){console[_0xf955('0x37')](_0x2c222a);return _0x4d7b5b[_0xf955('0x1f')](0x193)[_0xf955('0x2b')]({'message':_0xf955('0x38')});}}else if(_0x1e20d1){_0xb71daf();}else{return _0x4d7b5b[_0xf955('0x1f')](0x193)[_0xf955('0x2b')]({'message':'Unknown\x20authorization\x20format'});}})[_0xf955('0x17')](function(_0x165cc4,_0x3964d3,_0x2046c8){if(_0x165cc4['user']){db[_0xf955('0x27')][_0xf955('0x34')]({'where':{'id':_0x165cc4[_0xf955('0x18')]['id']},'attributes':userAttributes})[_0xf955('0x1e')](function(_0xdbc53e){if(!_0xdbc53e){return _0x3964d3['status'](0x194)['json']({'message':'User\x20not\x20found.'});}_0x165cc4[_0xf955('0x18')]=_0xdbc53e;_0x2046c8();})[_0xf955('0x2c')](function(_0x374e95){_0x2046c8(_0x374e95);});}else if(_0x1e20d1){_0x2046c8();}else{return _0x3964d3[_0xf955('0x1f')](0x194)[_0xf955('0x2b')]({'message':_0xf955('0x39')});}});}exports['isAuthenticated']=isAuthenticated;function canUpdate(){return compose()[_0xf955('0x17')](function(_0x515dc6,_0x8f842f,_0x2371e4){return require(_0xf955('0x3a'))['getLicense']()[_0xf955('0x1e')](function(_0x4bef80){if(_0x4bef80[_0xf955('0x3b')]){_0x2371e4();}else{return _0x8f842f[_0xf955('0x1f')](0x193)[_0xf955('0x2b')]({'message':_0xf955('0x3c')});}})['catch'](function(_0xf35170){_0x2371e4(_0xf35170);});});}exports[_0xf955('0x3d')]=canUpdate;function signToken(_0x5a48be,_0x430e12){return jwt[_0xf955('0x3e')]({'id':_0x5a48be,'role':_0x430e12},config[_0xf955('0x32')]['session'],{'expiresIn':0x15180});}exports[_0xf955('0x3f')]=signToken;exports[_0xf955('0x40')]=function(_0x11b7e2){if(!_0x11b7e2){throw new Error('Required\x20role\x20needs\x20to\x20be\x20set');}return compose()[_0xf955('0x17')](isAuthenticated())[_0xf955('0x17')](function meetsRequirements(_0x21e4a6,_0x2069f3,_0x2bfbe4){if(config[_0xf955('0x41')][_0xf955('0x42')](_0x21e4a6[_0xf955('0x18')]['role'])>=config[_0xf955('0x41')][_0xf955('0x42')](_0x11b7e2)){return _0x2bfbe4();}else{return _0x2069f3[_0xf955('0x1f')](0x193)[_0xf955('0x2b')]({'message':_0xf955('0x3c')});}});};exports[_0xf955('0x43')]=function(_0x43ab74,_0x206651,_0x47651b){_0x43ab74[_0xf955('0x43')]=!![];return _0x47651b();};exports[_0xf955('0x44')]=function(_0x1c72b8,_0x40d7e9){if(!_0x1c72b8[_0xf955('0x18')]){return _0x40d7e9[_0xf955('0x1f')](0x194)[_0xf955('0x2b')]({'message':_0xf955('0x45')});}var _0x34f0f1=signToken(_0x1c72b8[_0xf955('0x18')]['id'],_0x1c72b8['user'][_0xf955('0x8')]);_0x40d7e9[_0xf955('0x46')](_0xf955('0x47'),_0x34f0f1);_0x40d7e9['cookie'](_0xf955('0x48'),JSON['stringify'](_[_0xf955('0x49')](_0x1c72b8['user'],userAttributes)));_0x40d7e9[_0xf955('0x4a')](_0xf955('0x4b'));};exports[_0xf955('0x4c')]=function(_0x21ddf0){if(_['isNil'](_0x21ddf0[_0xf955('0x35')])||_[_0xf955('0x4d')](_0x21ddf0[_0xf955('0x4e')]))return null;else return createJwt(_0x21ddf0);};exports['generateApiKey']=function(_0x5e98ae){_0x5e98ae[_0xf955('0x35')]=crypto[_0xf955('0x4f')](0x10)[_0xf955('0x50')](_0xf955('0x51'));_0x5e98ae['apiKeyIat']=Math[_0xf955('0x52')](Date[_0xf955('0x53')]()/0x3e8)[_0xf955('0x50')]();return createJwt(_0x5e98ae);};exports['regenerateApiKey']=function(_0x388e59,_0x5ba567){if(_0x388e59[_0xf955('0x2f')][_0xf955('0x30')]){jwt[_0xf955('0x31')](_0x388e59['query'][_0xf955('0x30')],config[_0xf955('0x32')][_0xf955('0x7')],{'nonce':_0x5ba567[_0xf955('0x35')],'iat':_0x5ba567['apiKeyIat'],'audience':hardwareConf[_0xf955('0x33')](),'issuer':hardwareConf[_0xf955('0x33')]()});return generateApiKey(_0x5ba567);}else{throw{'message':_0xf955('0x54')};}};function createJwt(_0x17e687){return jwt[_0xf955('0x3e')]({'iat':_0x17e687['apiKeyIat'],'nonce':_0x17e687[_0xf955('0x35')]},config['secrets'][_0xf955('0x7')],{'algorithm':'HS512','subject':_0x17e687['id'][_0xf955('0x50')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()});} \ No newline at end of file +var _0x57ca=['cookie','motion.user','stringify','pick','/dashboards/general','retrieveApiKey','isNil','generateApiKey','randomBytes','toString','apiKeyIat','floor','now','regenerateApiKey','HS512','../../config/environment','../../config/license/hardware','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','secrets','session','role','fullname','name','internal','email','userpic','voicePause','mailPause','faxPause','openchannelPause','showWebBar','phoneBarRemoteControlPort','interface','isChatInteractionAuthorized','use','ChatInteraction','params','closed','disposition','then','status','unmanaged','json','Unmanaged.','catch','headers','startsWith','Basic','User','find','authenticate','pass','Wrong\x20credentials.','user','authorization','Bearer','Unknown\x20authorization\x20format','query','apikey','verify','getUuid','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Unrecognized\x20API\x20access\x20key','User\x20not\x20found.','isAuthenticated','../../config/license/util','getLicense','update','Forbidden','sign','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token'];(function(_0x21255a,_0x3035ed){var _0x4c74eb=function(_0x12d66a){while(--_0x12d66a){_0x21255a['push'](_0x21255a['shift']());}};_0x4c74eb(++_0x3035ed);}(_0x57ca,0x108));var _0xa57c=function(_0x3e1fd2,_0x5d2829){_0x3e1fd2=_0x3e1fd2-0x0;var _0x14a61f=_0x57ca[_0x3e1fd2];return _0x14a61f;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xa57c('0x0'));var hardwareConf=require(_0xa57c('0x1'));var _=require('lodash');var jwt=require(_0xa57c('0x2'));var expressJwt=require(_0xa57c('0x3'));var compose=require(_0xa57c('0x4'));var basicAuth=require(_0xa57c('0x5'));var crypto=require(_0xa57c('0x6'));var ipaddr=require('ipaddr.js');var validateJwt=expressJwt({'secret':config[_0xa57c('0x7')][_0xa57c('0x8')]});var userAttributes=['id',_0xa57c('0x9'),_0xa57c('0xa'),_0xa57c('0xb'),_0xa57c('0xc'),_0xa57c('0xd'),_0xa57c('0xe'),'permissions',_0xa57c('0xf'),'chatPause',_0xa57c('0x10'),_0xa57c('0x11'),'smsPause',_0xa57c('0x12'),'pauseType',_0xa57c('0x13'),_0xa57c('0x14'),'phoneBarRemoteControl',_0xa57c('0x15'),'userProfileId'];exports[_0xa57c('0x16')]=function(){return isAuthenticated(!![])[_0xa57c('0x17')](function(_0x1f2bb5,_0x9e25bf,_0x205e72){if(_0x1f2bb5['user']){_0x205e72();}else{return db[_0xa57c('0x18')]['findOne']({'where':{'id':_0x1f2bb5[_0xa57c('0x19')]['id']},'attributes':['id',_0xa57c('0x1a'),_0xa57c('0x1b')],'raw':!![]})[_0xa57c('0x1c')](function(_0x3238ff){if(_0x3238ff&&_0x3238ff[_0xa57c('0x1a')]){return _0x9e25bf[_0xa57c('0x1d')](_0x3238ff['disposition']===_0xa57c('0x1e')?0x195:0x193)[_0xa57c('0x1f')]({'message':_0x3238ff[_0xa57c('0x1b')]==='unmanaged'?_0xa57c('0x20'):'Forbidden.'});}else{_0x205e72();}})[_0xa57c('0x21')](function(_0x3d781d){_0x205e72(_0x3d781d);});}});};function isAuthenticated(_0x93462c){return compose()[_0xa57c('0x17')](function(_0x1fd0d8,_0x4728f9,_0x6f3f89){if(_0x1fd0d8[_0xa57c('0x22')]['authorization']){if(_[_0xa57c('0x23')](_0x1fd0d8['headers']['authorization'],_0xa57c('0x24'))){var _0xa5b314=basicAuth(_0x1fd0d8);db[_0xa57c('0x25')][_0xa57c('0x26')]({'where':{'name':_0xa5b314['name']}})[_0xa57c('0x1c')](function(_0x25715f){if(!_0x25715f||!_0x25715f[_0xa57c('0x27')](_0xa5b314[_0xa57c('0x28')])){return _0x4728f9[_0xa57c('0x1d')](0x191)[_0xa57c('0x1f')]({'message':_0xa57c('0x29')});}_0x1fd0d8[_0xa57c('0x2a')]={'id':_0x25715f['id']};_0x6f3f89();})[_0xa57c('0x21')](function(_0xdf65dd){_0x6f3f89(_0xdf65dd);});}else if(_[_0xa57c('0x23')](_0x1fd0d8[_0xa57c('0x22')][_0xa57c('0x2b')],_0xa57c('0x2c'))){validateJwt(_0x1fd0d8,_0x4728f9,_0x6f3f89);}else{if(_0x93462c){_0x6f3f89();}else{return _0x4728f9[_0xa57c('0x1d')](0x193)['json']({'message':_0xa57c('0x2d')});}}}else if(_0x1fd0d8[_0xa57c('0x2e')][_0xa57c('0x2f')]){try{var _0x5228b9=jwt[_0xa57c('0x30')](_0x1fd0d8[_0xa57c('0x2e')][_0xa57c('0x2f')],config[_0xa57c('0x7')][_0xa57c('0x8')],{'audience':hardwareConf[_0xa57c('0x31')](),'issuer':hardwareConf['getUuid']()});db[_0xa57c('0x25')]['find']({'where':{'id':_0x5228b9['sub']}})[_0xa57c('0x1c')](function(_0x7d10ec){if(!_0x7d10ec||!_['isEqual'](_0x7d10ec[_0xa57c('0x32')],_0x5228b9[_0xa57c('0x33')])){return _0x4728f9[_0xa57c('0x1d')](0x193)['json']({'message':_0xa57c('0x34')});}_0x1fd0d8['user']={'id':_0x7d10ec['id']};_0x6f3f89();})[_0xa57c('0x21')](function(_0x5464f2){_0x6f3f89(_0x5464f2);});}catch(_0x2a3bbe){console['log'](_0x2a3bbe);return _0x4728f9[_0xa57c('0x1d')](0x193)['json']({'message':_0xa57c('0x35')});}}else if(_0x93462c){_0x6f3f89();}else{return _0x4728f9[_0xa57c('0x1d')](0x193)[_0xa57c('0x1f')]({'message':_0xa57c('0x2d')});}})[_0xa57c('0x17')](function(_0x4016dd,_0x4f45c7,_0x5aa91e){if(_0x4016dd[_0xa57c('0x2a')]){db['User'][_0xa57c('0x26')]({'where':{'id':_0x4016dd[_0xa57c('0x2a')]['id']},'attributes':userAttributes})[_0xa57c('0x1c')](function(_0x587ce1){if(!_0x587ce1){return _0x4f45c7[_0xa57c('0x1d')](0x194)['json']({'message':_0xa57c('0x36')});}_0x4016dd['user']=_0x587ce1;_0x5aa91e();})[_0xa57c('0x21')](function(_0x494b8a){_0x5aa91e(_0x494b8a);});}else if(_0x93462c){_0x5aa91e();}else{return _0x4f45c7[_0xa57c('0x1d')](0x194)[_0xa57c('0x1f')]({'message':'User\x20object\x20not\x20found.'});}});}exports[_0xa57c('0x37')]=isAuthenticated;function canUpdate(){return compose()['use'](function(_0x1eeeb8,_0x5c56d3,_0x189d9b){return require(_0xa57c('0x38'))[_0xa57c('0x39')]()[_0xa57c('0x1c')](function(_0x2c224c){if(_0x2c224c[_0xa57c('0x3a')]){_0x189d9b();}else{return _0x5c56d3['status'](0x193)['json']({'message':_0xa57c('0x3b')});}})[_0xa57c('0x21')](function(_0x2c70d6){_0x189d9b(_0x2c70d6);});});}exports['canUpdate']=canUpdate;function signToken(_0x12b644,_0x5308d5){return jwt[_0xa57c('0x3c')]({'id':_0x12b644,'role':_0x5308d5},config[_0xa57c('0x7')]['session'],{'expiresIn':0x15180});}exports['signToken']=signToken;exports['hasRole']=function(_0x3be888){if(!_0x3be888){throw new Error(_0xa57c('0x3d'));}return compose()[_0xa57c('0x17')](isAuthenticated())[_0xa57c('0x17')](function meetsRequirements(_0x10c7ab,_0x1b98a0,_0x5a444a){if(config[_0xa57c('0x3e')][_0xa57c('0x3f')](_0x10c7ab['user']['role'])>=config[_0xa57c('0x3e')][_0xa57c('0x3f')](_0x3be888)){return _0x5a444a();}else{return _0x1b98a0['status'](0x193)[_0xa57c('0x1f')]({'message':_0xa57c('0x3b')});}});};exports[_0xa57c('0x40')]=function(_0x2206a3,_0x103ecd,_0x43c1d7){_0x2206a3['isMiddleware']=!![];return _0x43c1d7();};exports[_0xa57c('0x41')]=function(_0x527c0f,_0x4e3936){if(!_0x527c0f['user']){return _0x4e3936['status'](0x194)['json']({'message':_0xa57c('0x42')});}var _0x32ed25=signToken(_0x527c0f[_0xa57c('0x2a')]['id'],_0x527c0f['user']['role']);_0x4e3936['cookie'](_0xa57c('0x43'),_0x32ed25);_0x4e3936[_0xa57c('0x44')](_0xa57c('0x45'),JSON[_0xa57c('0x46')](_[_0xa57c('0x47')](_0x527c0f[_0xa57c('0x2a')],userAttributes)));_0x4e3936['redirect'](_0xa57c('0x48'));};exports[_0xa57c('0x49')]=function(_0x34e8f2){if(_[_0xa57c('0x4a')](_0x34e8f2[_0xa57c('0x32')])||_[_0xa57c('0x4a')](_0x34e8f2['apiKeyIat']))return null;else return createJwt(_0x34e8f2);};exports[_0xa57c('0x4b')]=function(_0xcf1c29){_0xcf1c29[_0xa57c('0x32')]=crypto[_0xa57c('0x4c')](0x10)[_0xa57c('0x4d')]('hex');_0xcf1c29[_0xa57c('0x4e')]=Math[_0xa57c('0x4f')](Date[_0xa57c('0x50')]()/0x3e8)[_0xa57c('0x4d')]();return createJwt(_0xcf1c29);};exports[_0xa57c('0x51')]=function(_0x11fccc,_0x5e155a){if(_0x11fccc[_0xa57c('0x2e')][_0xa57c('0x2f')]){jwt[_0xa57c('0x30')](_0x11fccc[_0xa57c('0x2e')][_0xa57c('0x2f')],config[_0xa57c('0x7')]['session'],{'nonce':_0x5e155a['apiKeyNonce'],'iat':_0x5e155a['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xa57c('0x31')]()});return generateApiKey(_0x5e155a);}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function createJwt(_0x273a17){return jwt[_0xa57c('0x3c')]({'iat':_0x273a17['apiKeyIat'],'nonce':_0x273a17[_0xa57c('0x32')]},config[_0xa57c('0x7')][_0xa57c('0x8')],{'algorithm':_0xa57c('0x52'),'subject':_0x273a17['id'][_0xa57c('0x4d')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xa57c('0x31')]()});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 054189d..6e04e43 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 _0xbaf0=['data','update','binary','write','end','decryptFile','createDecipher','final','close','unlink','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x0baf('0x0'));var defaultOptions={'algorithm':_0x0baf('0x1')};function combineOptions(_0x1e212d){var _0x263f79={};for(var _0x1688bc in defaultOptions){if(defaultOptions[_0x0baf('0x2')](_0x1688bc)){_0x263f79[_0x1688bc]=defaultOptions[_0x1688bc];}}if(_0x1e212d){for(var _0x5a3e42 in _0x1e212d){if(_0x1e212d[_0x0baf('0x2')](_0x5a3e42)){_0x263f79[_0x5a3e42]=_0x1e212d[_0x5a3e42];}}}return _0x263f79;}exports[_0x0baf('0x3')]=function(_0x2d3fa5,_0x39b8f3,_0xe4c3c4,_0x335e24){return new BPromise(function(_0x1a10b1,_0x2dcaac){_0x335e24=combineOptions(_0x335e24);var _0x1d0a0d=new Buffer(_0xe4c3c4);var _0x5f5030=fs[_0x0baf('0x4')](_0x2d3fa5);var _0x5f20aa=fs[_0x0baf('0x5')](_0x39b8f3);var _0x2c7442=crypto[_0x0baf('0x6')](_0x335e24[_0x0baf('0x7')],_0x1d0a0d);_0x5f5030['on'](_0x0baf('0x8'),function(_0xf4c8ac){var _0x41cead=new Buffer(_0x2c7442[_0x0baf('0x9')](_0xf4c8ac),_0x0baf('0xa'));_0x5f20aa[_0x0baf('0xb')](_0x41cead);});_0x5f5030['on'](_0x0baf('0xc'),function(){try{var _0x51d93c=new Buffer(_0x2c7442['final'](_0x0baf('0xa')),_0x0baf('0xa'));_0x5f20aa[_0x0baf('0xb')](_0x51d93c);_0x5f20aa[_0x0baf('0xc')]();_0x5f20aa['on']('close',function(){return _0x1a10b1(_0x39b8f3);});}catch(_0x2ab33e){fs['unlink'](_0x39b8f3);return _0x2dcaac(_0x2ab33e);}});});};exports[_0x0baf('0xd')]=function(_0x1f50c3,_0x7fbf67,_0x2bc381,_0xb8339e){return new BPromise(function(_0x469599,_0x4f80a8){_0xb8339e=combineOptions(_0xb8339e);var _0x4cd79d=new Buffer(_0x2bc381);var _0x2312c7=fs[_0x0baf('0x4')](_0x1f50c3);var _0x283408=fs[_0x0baf('0x5')](_0x7fbf67);var _0x2cf7da=crypto[_0x0baf('0xe')](_0xb8339e['algorithm'],_0x4cd79d);_0x2312c7['on'](_0x0baf('0x8'),function(_0xfbecec){var _0x1ef0e5=new Buffer(_0x2cf7da[_0x0baf('0x9')](_0xfbecec),_0x0baf('0xa'));_0x283408[_0x0baf('0xb')](_0x1ef0e5);});_0x2312c7['on']('end',function(){try{var _0x5cff5d=new Buffer(_0x2cf7da[_0x0baf('0xf')](_0x0baf('0xa')),_0x0baf('0xa'));_0x283408[_0x0baf('0xb')](_0x5cff5d);_0x283408[_0x0baf('0xc')]();_0x283408['on'](_0x0baf('0x10'),function(){return _0x469599(_0x7fbf67);});}catch(_0x210cd8){fs[_0x0baf('0x11')](_0x7fbf67);return _0x4f80a8(_0x210cd8);}});});}; \ No newline at end of file +var _0x70e0=['createDecipher','algorithm','data','close','unlink','crypto','bluebird','aes192','hasOwnProperty','createReadStream','createWriteStream','createCipher','update','binary','write','end','final'];(function(_0x4264af,_0x3f12ef){var _0x39a56d=function(_0xe4f43b){while(--_0xe4f43b){_0x4264af['push'](_0x4264af['shift']());}};_0x39a56d(++_0x3f12ef);}(_0x70e0,0x17b));var _0x070e=function(_0x28ed93,_0x1467b0){_0x28ed93=_0x28ed93-0x0;var _0x3fd00c=_0x70e0[_0x28ed93];return _0x3fd00c;};'use strict';var crypto=require(_0x070e('0x0'));var fs=require('fs');var BPromise=require(_0x070e('0x1'));var defaultOptions={'algorithm':_0x070e('0x2')};function combineOptions(_0x4d95bb){var _0x579b83={};for(var _0x16e651 in defaultOptions){if(defaultOptions[_0x070e('0x3')](_0x16e651)){_0x579b83[_0x16e651]=defaultOptions[_0x16e651];}}if(_0x4d95bb){for(var _0x277d32 in _0x4d95bb){if(_0x4d95bb[_0x070e('0x3')](_0x277d32)){_0x579b83[_0x277d32]=_0x4d95bb[_0x277d32];}}}return _0x579b83;}exports['encryptFile']=function(_0x7bce9b,_0x579a6b,_0x46fe68,_0x4b041d){return new BPromise(function(_0x56e420,_0x5032e5){_0x4b041d=combineOptions(_0x4b041d);var _0x35ab0c=new Buffer(_0x46fe68);var _0x1e11f0=fs[_0x070e('0x4')](_0x7bce9b);var _0x2611e6=fs[_0x070e('0x5')](_0x579a6b);var _0x68a09e=crypto[_0x070e('0x6')](_0x4b041d['algorithm'],_0x35ab0c);_0x1e11f0['on']('data',function(_0x50f4eb){var _0x2e3e5e=new Buffer(_0x68a09e[_0x070e('0x7')](_0x50f4eb),_0x070e('0x8'));_0x2611e6[_0x070e('0x9')](_0x2e3e5e);});_0x1e11f0['on'](_0x070e('0xa'),function(){try{var _0x25cfe1=new Buffer(_0x68a09e[_0x070e('0xb')](_0x070e('0x8')),_0x070e('0x8'));_0x2611e6[_0x070e('0x9')](_0x25cfe1);_0x2611e6['end']();_0x2611e6['on']('close',function(){return _0x56e420(_0x579a6b);});}catch(_0x24baba){fs['unlink'](_0x579a6b);return _0x5032e5(_0x24baba);}});});};exports['decryptFile']=function(_0x5bae0f,_0x11d2ce,_0x14c3fd,_0x51d14d){return new BPromise(function(_0x5d3a38,_0x373d86){_0x51d14d=combineOptions(_0x51d14d);var _0xeae1a5=new Buffer(_0x14c3fd);var _0x180897=fs[_0x070e('0x4')](_0x5bae0f);var _0x5bc71e=fs['createWriteStream'](_0x11d2ce);var _0x17e2e4=crypto[_0x070e('0xc')](_0x51d14d[_0x070e('0xd')],_0xeae1a5);_0x180897['on'](_0x070e('0xe'),function(_0x364b3f){var _0x5037eb=new Buffer(_0x17e2e4[_0x070e('0x7')](_0x364b3f),_0x070e('0x8'));_0x5bc71e[_0x070e('0x9')](_0x5037eb);});_0x180897['on'](_0x070e('0xa'),function(){try{var _0x259893=new Buffer(_0x17e2e4['final']('binary'),'binary');_0x5bc71e[_0x070e('0x9')](_0x259893);_0x5bc71e[_0x070e('0xa')]();_0x5bc71e['on'](_0x070e('0xf'),function(){return _0x5d3a38(_0x11d2ce);});}catch(_0x4be0d7){fs[_0x070e('0x10')](_0x11d2ce);return _0x373d86(_0x4be0d7);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index a574fef..453f6c1 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 _0x00bb=['path','lodash','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','then','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','Empty','length','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','split','existsSync','join','each','%s%d.%s','csv','%s.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','zip','catch','inspect','Failed','util'];(function(_0x3800d3,_0x428dfd){var _0x491c71=function(_0x55a174){while(--_0x55a174){_0x3800d3['push'](_0x3800d3['shift']());}};_0x491c71(++_0x428dfd);}(_0x00bb,0x1d8));var _0xb00b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x00bb[_0x501510];return _0x1e6ee5;};'use strict';var util=require(_0xb00b('0x0'));var path=require(_0xb00b('0x1'));var _=require(_0xb00b('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xb00b('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xb00b('0x4'));var db=require(_0xb00b('0x5'))['db'];var dbH=require('../../mysqldb')[_0xb00b('0x6')];var logger=require(_0xb00b('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xb00b('0x8')][0x4];function analyticExtractedReport(_0xf737d0,_0x41dfc9){var _0x37f07d={'status':_0xf737d0};var _0xfa4181={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x41dfc9){_0x37f07d[_0xb00b('0x9')]=_0x41dfc9;}return db['AnalyticExtractedReport']['update'](_0x37f07d,_0xfa4181);}function main(){var _0x5154d9=0x1388;var _0x1e9b7b;logger[_0xb00b('0xa')](util[_0xb00b('0xb')](_0xb00b('0xc'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xb00b('0xd')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})[_0xb00b('0xe')](function(_0x2d8ddf){if(_0x2d8ddf){_0x1e9b7b=_0x2d8ddf;_0x5154d9=_0x1e9b7b[_0xb00b('0xf')]||0x1388;}})[_0xb00b('0xe')](function(){return dbH[_0xb00b('0x10')][_0xb00b('0x11')](util['format'](_0xb00b('0x12'),QUERY),{'type':dbH[_0xb00b('0x10')]['QueryTypes'][_0xb00b('0x13')]});})[_0xb00b('0xe')](function(_0x540b79){if(!_0x540b79[0x0]['num']){return analyticExtractedReport(_0xb00b('0x14'));}var _0x4dcd45=[];var _0x51d136=0x0;var _0x1f9c78=!![];if(_0x540b79&&_0x540b79[_0xb00b('0x15')]){var _0x387d97=_0x540b79[0x0][_0xb00b('0x16')]%(_0x51d136+_0x5154d9);if(_0x1e9b7b['split']){for(;_0x1f9c78;_0x51d136+=_0x5154d9,_0x387d97=_0x540b79[0x0][_0xb00b('0x16')]%(_0x51d136+_0x5154d9)){if(_0x387d97==0x0||_0x387d97==_0x540b79[0x0]['num']){_0x1f9c78=![];}_0x4dcd45[_0xb00b('0x17')](dbH['sequelize'][_0xb00b('0x11')](util['format'](_0xb00b('0x18'),QUERY,_0x5154d9,_0x51d136),{'type':dbH[_0xb00b('0x10')]['QueryTypes']['SELECT']}));}}else{_0x4dcd45[_0xb00b('0x17')](dbH['sequelize'][_0xb00b('0x11')](QUERY,{'type':dbH[_0xb00b('0x10')][_0xb00b('0x19')][_0xb00b('0x13')]}));}}var _0x56c189=path[_0xb00b('0x1a')](PATH);var _0x4df284=path[_0xb00b('0x1b')](PATH,_0xb00b('0x1c'));var _0x51b841=_0x1e9b7b[_0xb00b('0x1d')]&&_0x4dcd45[_0xb00b('0x15')]>0x1;var _0x520444=[];if(!fs[_0xb00b('0x1e')](path[_0xb00b('0x1f')](_0x56c189,_0x4df284))&&_0x51b841){fs['mkdirSync'](path[_0xb00b('0x1f')](_0x56c189,_0x4df284));}return BPromise[_0xb00b('0x20')](_0x4dcd45,function(_0x3c9500){_0x520444[_0xb00b('0x17')](_0x3c9500);})['then'](function(){for(var _0x50be6c=0x0;_0x50be6c<_0x520444[_0xb00b('0x15')];_0x50be6c+=0x1){var _0x490380;var _0x550587=_0x520444[_0x50be6c];if(_0x51b841){_0x490380=path['join'](_0x56c189,_0x4df284,util[_0xb00b('0xb')](_0xb00b('0x21'),_0x4df284,_0x50be6c,_0xb00b('0x22')));}else{_0x490380=path[_0xb00b('0x1f')](_0x56c189,util[_0xb00b('0xb')](_0xb00b('0x23'),_0x4df284,_0xb00b('0x22')));}fs['writeFileSync'](_0x490380,csv(_0x550587));}})[_0xb00b('0xe')](function(){if(_0x51b841){zipdir(path['join'](_0x56c189,_0x4df284),{'saveTo':path[_0xb00b('0x1f')](_0x56c189,util[_0xb00b('0xb')](_0xb00b('0x23'),_0x4df284,'zip'))},function(_0x2fc11a,_0x280ed3){});rimraf(path[_0xb00b('0x1f')](_0x56c189,_0x4df284),function(){});}})[_0xb00b('0xe')](function(){logger[_0xb00b('0xa')](util[_0xb00b('0xb')](_0xb00b('0x24'),EXTRACTED_REPORT_ID,_0xb00b('0x25')));return analyticExtractedReport(_0xb00b('0x26'),_0x51b841?util['format'](_0xb00b('0x23'),_0x4df284,_0x51b841?_0xb00b('0x27'):'csv'):null);});})[_0xb00b('0x28')](function(_0x2f3b37){logger['info'](util[_0xb00b('0xb')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xb00b('0x25')),util[_0xb00b('0x29')](_0x2f3b37,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xb00b('0x2a'));});}main(); \ No newline at end of file +var _0xaa88=['join','each','csv','writeFileSync','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','then','splitSizeCsv','sequelize','query','num','Empty','length','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','dirname','basename','existsSync','mkdirSync'];(function(_0x1235d5,_0x66de6d){var _0x21d24e=function(_0x184928){while(--_0x184928){_0x1235d5['push'](_0x1235d5['shift']());}};_0x21d24e(++_0x66de6d);}(_0xaa88,0x137));var _0x8aa8=function(_0x25cd2c,_0x57498e){_0x25cd2c=_0x25cd2c-0x0;var _0x1e364c=_0xaa88[_0x25cd2c];return _0x1e364c;};'use strict';var util=require(_0x8aa8('0x0'));var path=require(_0x8aa8('0x1'));var _=require(_0x8aa8('0x2'));var csv=require(_0x8aa8('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x8aa8('0x4'));var rimraf=require(_0x8aa8('0x5'));var db=require(_0x8aa8('0x6'))['db'];var dbH=require(_0x8aa8('0x6'))[_0x8aa8('0x7')];var logger=require(_0x8aa8('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x8aa8('0x9')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x449d2d,_0x1ed84d){var _0x27c08d={'status':_0x449d2d};var _0x40826f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1ed84d){_0x27c08d['savename']=_0x1ed84d;}return db[_0x8aa8('0xa')][_0x8aa8('0xb')](_0x27c08d,_0x40826f);}function main(){var _0x224f25=0x1388;var _0x5c94d4;logger[_0x8aa8('0xc')](util[_0x8aa8('0xd')](_0x8aa8('0xe'),EXTRACTED_REPORT_ID,_0x8aa8('0xf')));return db['Setting'][_0x8aa8('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8aa8('0x11'),'splitSizeCsv']})[_0x8aa8('0x12')](function(_0xa691d6){if(_0xa691d6){_0x5c94d4=_0xa691d6;_0x224f25=_0x5c94d4[_0x8aa8('0x13')]||0x1388;}})['then'](function(){return dbH[_0x8aa8('0x14')][_0x8aa8('0x15')](util[_0x8aa8('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x8aa8('0x14')]['QueryTypes']['SELECT']});})[_0x8aa8('0x12')](function(_0x200662){if(!_0x200662[0x0][_0x8aa8('0x16')]){return analyticExtractedReport(_0x8aa8('0x17'));}var _0x42a6a4=[];var _0x3778f4=0x0;var _0x1bdd39=!![];if(_0x200662&&_0x200662[_0x8aa8('0x18')]){var _0x20d303=_0x200662[0x0]['num']%(_0x3778f4+_0x224f25);if(_0x5c94d4['split']){for(;_0x1bdd39;_0x3778f4+=_0x224f25,_0x20d303=_0x200662[0x0][_0x8aa8('0x16')]%(_0x3778f4+_0x224f25)){if(_0x20d303==0x0||_0x20d303==_0x200662[0x0]['num']){_0x1bdd39=![];}_0x42a6a4['push'](dbH[_0x8aa8('0x14')]['query'](util[_0x8aa8('0xd')](_0x8aa8('0x19'),QUERY,_0x224f25,_0x3778f4),{'type':dbH[_0x8aa8('0x14')][_0x8aa8('0x1a')]['SELECT']}));}}else{_0x42a6a4[_0x8aa8('0x1b')](dbH[_0x8aa8('0x14')][_0x8aa8('0x15')](QUERY,{'type':dbH[_0x8aa8('0x14')][_0x8aa8('0x1a')][_0x8aa8('0x1c')]}));}}var _0x5d9b62=path[_0x8aa8('0x1d')](PATH);var _0x4cc455=path[_0x8aa8('0x1e')](PATH,'.csv');var _0x2c1828=_0x5c94d4['split']&&_0x42a6a4[_0x8aa8('0x18')]>0x1;var _0x40adb5=[];if(!fs[_0x8aa8('0x1f')](path['join'](_0x5d9b62,_0x4cc455))&&_0x2c1828){fs[_0x8aa8('0x20')](path[_0x8aa8('0x21')](_0x5d9b62,_0x4cc455));}return BPromise[_0x8aa8('0x22')](_0x42a6a4,function(_0x547a7b){_0x40adb5['push'](_0x547a7b);})[_0x8aa8('0x12')](function(){for(var _0x44e2d8=0x0;_0x44e2d8<_0x40adb5[_0x8aa8('0x18')];_0x44e2d8+=0x1){var _0x3a3c7a;var _0x24143e=_0x40adb5[_0x44e2d8];if(_0x2c1828){_0x3a3c7a=path['join'](_0x5d9b62,_0x4cc455,util[_0x8aa8('0xd')]('%s%d.%s',_0x4cc455,_0x44e2d8,_0x8aa8('0x23')));}else{_0x3a3c7a=path[_0x8aa8('0x21')](_0x5d9b62,util[_0x8aa8('0xd')]('%s.%s',_0x4cc455,'csv'));}fs[_0x8aa8('0x24')](_0x3a3c7a,csv(_0x24143e));}})['then'](function(){if(_0x2c1828){zipdir(path[_0x8aa8('0x21')](_0x5d9b62,_0x4cc455),{'saveTo':path[_0x8aa8('0x21')](_0x5d9b62,util[_0x8aa8('0xd')](_0x8aa8('0x25'),_0x4cc455,_0x8aa8('0x26')))},function(_0x4d5c2e,_0x267f4c){});rimraf(path[_0x8aa8('0x21')](_0x5d9b62,_0x4cc455),function(){});}})['then'](function(){logger[_0x8aa8('0xc')](util[_0x8aa8('0xd')](_0x8aa8('0x27'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x8aa8('0x28'),_0x2c1828?util[_0x8aa8('0xd')](_0x8aa8('0x25'),_0x4cc455,_0x2c1828?_0x8aa8('0x26'):_0x8aa8('0x23')):null);});})[_0x8aa8('0x29')](function(_0x370401){logger[_0x8aa8('0xc')](util[_0x8aa8('0xd')](_0x8aa8('0x2a'),EXTRACTED_REPORT_ID,_0x8aa8('0xf')),util['inspect'](_0x370401,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index c9c4b8c..c15d7e2 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 _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(_0x18d753,_0x358f42){var _0x165506=function(_0x8cc6e7){while(--_0x8cc6e7){_0x18d753['push'](_0x18d753['shift']());}};_0x165506(++_0x358f42);}(_0xb10b,0x12a));var _0xbb10=function(_0x32b30c,_0x2d5ec8){_0x32b30c=_0x32b30c-0x0;var _0xcfc212=_0xb10b[_0x32b30c];return _0xcfc212;};'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 +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(_0x36325a,_0x5ca4df){var _0x500eec=function(_0x2048b6){while(--_0x2048b6){_0x36325a['push'](_0x36325a['shift']());}};_0x500eec(++_0x5ca4df);}(_0xb10b,0x12a));var _0xbb10=function(_0x50a448,_0x3d1a4d){_0x50a448=_0x50a448-0x0;var _0x5da8c6=_0xb10b[_0x50a448];return _0x5da8c6;};'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 3f3d85b..7561c92 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 _0xa3db=['%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','XLSX','Setting','find','split','splitSizeXlsx','then','query','sequelize','QueryTypes','SELECT','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','existsSync','join','mkdirSync','each'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa3db,0x183));var _0xba3d=function(_0x5d70dc,_0x3a1fbe){_0x5d70dc=_0x5d70dc-0x0;var _0x3004be=_0xa3db[_0x5d70dc];return _0x3004be;};'use strict';var util=require(_0xba3d('0x0'));var path=require(_0xba3d('0x1'));var _=require(_0xba3d('0x2'));var fs=require('fs');var json2xls=require(_0xba3d('0x3'));var BPromise=require(_0xba3d('0x4'));var zipdir=require(_0xba3d('0x5'));var rimraf=require(_0xba3d('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0xba3d('0x7'))[_0xba3d('0x8')];var logger=require(_0xba3d('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xba3d('0xa')][0x2]);var QUERY=process[_0xba3d('0xa')][0x3];var PATH=process[_0xba3d('0xa')][0x4];function analyticExtractedReport(_0x34abfe,_0x499042){var _0x2d5d04={'status':_0x34abfe};var _0x29be11={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x499042){_0x2d5d04[_0xba3d('0xb')]=_0x499042;}return db[_0xba3d('0xc')][_0xba3d('0xd')](_0x2d5d04,_0x29be11);}function main(){var _0x3a2d6d=0x1388;var _0xe0b2de;logger[_0xba3d('0xe')](util[_0xba3d('0xf')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xba3d('0x10')));return db[_0xba3d('0x11')][_0xba3d('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xba3d('0x13'),_0xba3d('0x14')]})[_0xba3d('0x15')](function(_0x4a6954){if(_0x4a6954){_0xe0b2de=_0x4a6954;_0x3a2d6d=_0xe0b2de[_0xba3d('0x14')]||0x1388;}})[_0xba3d('0x15')](function(){return dbH['sequelize'][_0xba3d('0x16')](util[_0xba3d('0xf')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xba3d('0x17')][_0xba3d('0x18')][_0xba3d('0x19')]});})[_0xba3d('0x15')](function(_0x529b4e){if(!_0x529b4e[0x0][_0xba3d('0x1a')]){return analyticExtractedReport(_0xba3d('0x1b'));}var _0x2ad69c=[];var _0x3d7265=0x0;var _0x5ae8c1=!![];if(_0xe0b2de[_0xba3d('0x13')]){if(_0x529b4e&&_0x529b4e[_0xba3d('0x1c')]){var _0x4e6911=_0x529b4e[0x0][_0xba3d('0x1a')]%(_0x3d7265+_0x3a2d6d);for(;_0x5ae8c1;_0x3d7265+=_0x3a2d6d,_0x4e6911=_0x529b4e[0x0]['num']%(_0x3d7265+_0x3a2d6d)){if(_0x4e6911==0x0||_0x4e6911==_0x529b4e[0x0][_0xba3d('0x1a')]){_0x5ae8c1=![];}_0x2ad69c[_0xba3d('0x1d')](dbH['sequelize']['query'](util[_0xba3d('0xf')](_0xba3d('0x1e'),QUERY,_0x3a2d6d,_0x3d7265),{'type':dbH[_0xba3d('0x17')]['QueryTypes'][_0xba3d('0x19')]}));}}}else{_0x2ad69c[_0xba3d('0x1d')](dbH[_0xba3d('0x17')][_0xba3d('0x16')](QUERY,{'type':dbH[_0xba3d('0x17')][_0xba3d('0x18')][_0xba3d('0x19')]}));}var _0x59e78b=path[_0xba3d('0x1f')](PATH);var _0x1bebe4=path['basename'](PATH,'.xlsx');var _0x3aba5c=_0xe0b2de[_0xba3d('0x13')]&&_0x2ad69c[_0xba3d('0x1c')]>0x1;var _0x15fbf6=[];if(!fs[_0xba3d('0x20')](path[_0xba3d('0x21')](_0x59e78b,_0x1bebe4))&&_0x3aba5c){fs[_0xba3d('0x22')](path[_0xba3d('0x21')](_0x59e78b,_0x1bebe4));}return BPromise[_0xba3d('0x23')](_0x2ad69c,function(_0x457cd8){_0x15fbf6['push'](_0x457cd8);})[_0xba3d('0x15')](function(){for(var _0x551b87=0x0;_0x551b87<_0x15fbf6[_0xba3d('0x1c')];_0x551b87+=0x1){var _0x3a96ad;var _0x790de1=_0x15fbf6[_0x551b87];if(_0x3aba5c){_0x3a96ad=path[_0xba3d('0x21')](_0x59e78b,_0x1bebe4,util[_0xba3d('0xf')](_0xba3d('0x24'),_0x1bebe4,_0x551b87,'xlsx'));}else{_0x3a96ad=path['join'](_0x59e78b,util['format'](_0xba3d('0x25'),_0x1bebe4,_0xba3d('0x26')));}fs[_0xba3d('0x27')](_0x3a96ad,json2xls(_0x790de1),_0xba3d('0x28'));}})['then'](function(){if(_0x3aba5c){zipdir(path['join'](_0x59e78b,_0x1bebe4),{'saveTo':path[_0xba3d('0x21')](_0x59e78b,util[_0xba3d('0xf')]('%s.%s',_0x1bebe4,_0xba3d('0x29')))},function(_0x1c623a,_0x413318){});rimraf(path[_0xba3d('0x21')](_0x59e78b,_0x1bebe4),function(){});}})[_0xba3d('0x15')](function(){logger[_0xba3d('0xe')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xba3d('0x2a'),_0x3aba5c?util[_0xba3d('0xf')](_0xba3d('0x25'),_0x1bebe4,_0x3aba5c?_0xba3d('0x29'):_0xba3d('0x26')):null);});})[_0xba3d('0x2b')](function(_0x4168c2){logger['info'](util[_0xba3d('0xf')](_0xba3d('0x2c'),EXTRACTED_REPORT_ID,_0xba3d('0x10')),util[_0xba3d('0x2d')](_0x4168c2,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xba3d('0x2e'));});}main(); \ No newline at end of file +var _0xeb37=['binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Failed','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','num','Empty','length','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync'];(function(_0x293801,_0x3c9b4c){var _0x1c2587=function(_0x49424e){while(--_0x49424e){_0x293801['push'](_0x293801['shift']());}};_0x1c2587(++_0x3c9b4c);}(_0xeb37,0x1ad));var _0x7eb3=function(_0x4584cb,_0x2fe90d){_0x4584cb=_0x4584cb-0x0;var _0x598458=_0xeb37[_0x4584cb];return _0x598458;};'use strict';var util=require(_0x7eb3('0x0'));var path=require(_0x7eb3('0x1'));var _=require(_0x7eb3('0x2'));var fs=require('fs');var json2xls=require(_0x7eb3('0x3'));var BPromise=require(_0x7eb3('0x4'));var zipdir=require(_0x7eb3('0x5'));var rimraf=require(_0x7eb3('0x6'));var db=require(_0x7eb3('0x7'))['db'];var dbH=require(_0x7eb3('0x7'))[_0x7eb3('0x8')];var logger=require(_0x7eb3('0x9'))(_0x7eb3('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x7eb3('0xb')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x828ac9,_0x44e829){var _0x382098={'status':_0x828ac9};var _0x3e37ff={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x44e829){_0x382098[_0x7eb3('0xc')]=_0x44e829;}return db['AnalyticExtractedReport'][_0x7eb3('0xd')](_0x382098,_0x3e37ff);}function main(){var _0x3133c3=0x1388;var _0x7dc04;logger[_0x7eb3('0xe')](util[_0x7eb3('0xf')](_0x7eb3('0x10'),EXTRACTED_REPORT_ID,_0x7eb3('0x11')));return db[_0x7eb3('0x12')][_0x7eb3('0x13')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7eb3('0x14'),_0x7eb3('0x15')]})[_0x7eb3('0x16')](function(_0x374e0a){if(_0x374e0a){_0x7dc04=_0x374e0a;_0x3133c3=_0x7dc04['splitSizeXlsx']||0x1388;}})[_0x7eb3('0x16')](function(){return dbH['sequelize'][_0x7eb3('0x17')](util[_0x7eb3('0xf')](_0x7eb3('0x18'),QUERY),{'type':dbH[_0x7eb3('0x19')]['QueryTypes'][_0x7eb3('0x1a')]});})[_0x7eb3('0x16')](function(_0x3ce7f4){if(!_0x3ce7f4[0x0][_0x7eb3('0x1b')]){return analyticExtractedReport(_0x7eb3('0x1c'));}var _0x37bbbf=[];var _0x482f29=0x0;var _0x57037c=!![];if(_0x7dc04[_0x7eb3('0x14')]){if(_0x3ce7f4&&_0x3ce7f4[_0x7eb3('0x1d')]){var _0x1433fd=_0x3ce7f4[0x0]['num']%(_0x482f29+_0x3133c3);for(;_0x57037c;_0x482f29+=_0x3133c3,_0x1433fd=_0x3ce7f4[0x0][_0x7eb3('0x1b')]%(_0x482f29+_0x3133c3)){if(_0x1433fd==0x0||_0x1433fd==_0x3ce7f4[0x0][_0x7eb3('0x1b')]){_0x57037c=![];}_0x37bbbf['push'](dbH['sequelize']['query'](util[_0x7eb3('0xf')](_0x7eb3('0x1e'),QUERY,_0x3133c3,_0x482f29),{'type':dbH[_0x7eb3('0x19')][_0x7eb3('0x1f')][_0x7eb3('0x1a')]}));}}}else{_0x37bbbf['push'](dbH[_0x7eb3('0x19')][_0x7eb3('0x17')](QUERY,{'type':dbH['sequelize'][_0x7eb3('0x1f')][_0x7eb3('0x1a')]}));}var _0x3a81ee=path['dirname'](PATH);var _0x318855=path['basename'](PATH,_0x7eb3('0x20'));var _0x322c82=_0x7dc04[_0x7eb3('0x14')]&&_0x37bbbf[_0x7eb3('0x1d')]>0x1;var _0x1d2055=[];if(!fs[_0x7eb3('0x21')](path[_0x7eb3('0x22')](_0x3a81ee,_0x318855))&&_0x322c82){fs[_0x7eb3('0x23')](path[_0x7eb3('0x22')](_0x3a81ee,_0x318855));}return BPromise[_0x7eb3('0x24')](_0x37bbbf,function(_0x32a4f9){_0x1d2055['push'](_0x32a4f9);})[_0x7eb3('0x16')](function(){for(var _0x35211b=0x0;_0x35211b<_0x1d2055[_0x7eb3('0x1d')];_0x35211b+=0x1){var _0x71d67;var _0x48614d=_0x1d2055[_0x35211b];if(_0x322c82){_0x71d67=path[_0x7eb3('0x22')](_0x3a81ee,_0x318855,util[_0x7eb3('0xf')](_0x7eb3('0x25'),_0x318855,_0x35211b,_0x7eb3('0x26')));}else{_0x71d67=path[_0x7eb3('0x22')](_0x3a81ee,util[_0x7eb3('0xf')](_0x7eb3('0x27'),_0x318855,_0x7eb3('0x26')));}fs[_0x7eb3('0x28')](_0x71d67,json2xls(_0x48614d),_0x7eb3('0x29'));}})[_0x7eb3('0x16')](function(){if(_0x322c82){zipdir(path['join'](_0x3a81ee,_0x318855),{'saveTo':path['join'](_0x3a81ee,util[_0x7eb3('0xf')](_0x7eb3('0x27'),_0x318855,_0x7eb3('0x2a')))},function(_0x44430b,_0x204e4a){});rimraf(path[_0x7eb3('0x22')](_0x3a81ee,_0x318855),function(){});}})[_0x7eb3('0x16')](function(){logger[_0x7eb3('0xe')](util[_0x7eb3('0xf')](_0x7eb3('0x2b'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x7eb3('0x2c'),_0x322c82?util[_0x7eb3('0xf')](_0x7eb3('0x27'),_0x318855,_0x322c82?_0x7eb3('0x2a'):_0x7eb3('0x26')):null);});})[_0x7eb3('0x2d')](function(_0x15da53){logger['info'](util[_0x7eb3('0xf')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x7eb3('0x11')),util['inspect'](_0x15da53,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x7eb3('0x2e'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index e2fbdc0..3e950de 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 _0x4c29=['error','rewrite','lodash','util','Interval','findAll','intervals','VoiceExtension','IntervalId','then','models','uniq','map','exten','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','outbound','push','CDR(destination)=','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','answer','indexOf','app','custom','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch'];(function(_0x5ea331,_0x5c3b46){var _0x1155ab=function(_0x4157ae){while(--_0x4157ae){_0x5ea331['push'](_0x5ea331['shift']());}};_0x1155ab(++_0x5c3b46);}(_0x4c29,0x16a));var _0x94c2=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4c29[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x94c2('0x0'));var util=require(_0x94c2('0x1'));function rewrite(_0x5a0b5a,_0x47bafc){var _0x21cf86=this;return _0x5a0b5a['models'][_0x94c2('0x2')][_0x94c2('0x3')]({'raw':!![]})['then'](function(_0x26ac95){_0x21cf86[_0x94c2('0x4')]=_0x26ac95;return _0x5a0b5a['models'][_0x94c2('0x5')]['findAll']({'where':{'IntervalId':_0x47bafc[_0x94c2('0x6')]},'raw':!![]});})[_0x94c2('0x7')](function(_0x47f9c6){return _0x5a0b5a[_0x94c2('0x8')][_0x94c2('0x5')][_0x94c2('0x3')]({'where':{'exten':{'$in':_[_0x94c2('0x9')](_[_0x94c2('0xa')](_0x47f9c6,_0x94c2('0xb')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x94c2('0x7')](function(_0x47f4ee){var _0x1e85c1=_[_0x94c2('0xc')](_0x47f4ee,{'priority':'1'});var _0x3d28f7=_[_0x94c2('0xc')](_0x47f4ee,{'isApp':0x1});var _0x350b1a=_[_0x94c2('0xd')](_0x3d28f7,_0x94c2('0xb'));var _0xeb99ad=[_0x94c2('0xe'),_0x94c2('0xf')];var _0x549d94=[];var _0x20f0a2=[];for(var _0x3f3917 in _0x350b1a){if(_0x350b1a[_0x94c2('0x10')](_0x3f3917)){_0x21cf86[_0x94c2('0x11')]=0x2;_0x21cf86[_0x94c2('0x12')]=[];_0x21cf86[_0x94c2('0x13')]=_[_0x94c2('0x14')](_0x1e85c1,{'exten':_0x350b1a[_0x3f3917][0x0]['exten']});_0x21cf86['extensions']['push']({'type':_0x350b1a[_0x3f3917][0x0]['type'],'app':_0x94c2('0x15'),'appdata':util[_0x94c2('0x16')](_0x94c2('0x17'),_0x350b1a[_0x3f3917][0x0][_0x94c2('0x18')]),'context':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x19')],'exten':_0x350b1a[_0x3f3917][0x0]['exten'],'priority':_0x21cf86['priority']++,'VoiceExtensionId':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x1a')]});if(_0x350b1a[_0x3f3917][0x0][_0x94c2('0x18')]===_0x94c2('0x1b')){if(_0x21cf86[_0x94c2('0x13')]){_0x21cf86[_0x94c2('0x12')][_0x94c2('0x1c')]({'type':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x18')],'app':_0x94c2('0x15'),'appdata':_0x94c2('0x1d')+(_0x21cf86[_0x94c2('0x13')]['cutdigits']?_0x94c2('0x1e')+_0x21cf86[_0x94c2('0x13')]['cutdigits']+'}':_0x94c2('0x1f')),'context':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x19')],'exten':_0x350b1a[_0x3f3917][0x0][_0x94c2('0xb')],'priority':_0x21cf86[_0x94c2('0x11')]++,'VoiceExtensionId':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x1a')]});}_0x21cf86['extensions'][_0x94c2('0x1c')]({'type':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x18')],'app':_0x94c2('0x15'),'appdata':_0x94c2('0x20')+_0x350b1a[_0x3f3917][0x0][_0x94c2('0x1a')],'context':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x19')],'exten':_0x350b1a[_0x3f3917][0x0][_0x94c2('0xb')],'priority':_0x21cf86[_0x94c2('0x11')]++,'VoiceExtensionId':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x1a')]});var _0xa33ea5=_0x21cf86['priority']++;_0x21cf86[_0x94c2('0x12')][_0x94c2('0x1c')]({'type':_0x350b1a[_0x3f3917][0x0]['type'],'app':_0x94c2('0x21'),'appdata':_0x94c2('0x22')+(_0xa33ea5+0x2)+_0x94c2('0x23')+(_0xa33ea5+0x1)+')','context':_0x350b1a[_0x3f3917][0x0]['context'],'exten':_0x350b1a[_0x3f3917][0x0]['exten'],'priority':_0xa33ea5,'VoiceExtensionId':_0x350b1a[_0x3f3917][0x0]['VoiceExtensionId']});if(_0x21cf86['extension']){_0x21cf86['extensions'][_0x94c2('0x1c')]({'type':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x18')],'app':_0x94c2('0x15'),'appdata':_0x21cf86['extension'][_0x94c2('0x24')]?'CDR(prefix)=${EXTEN:0:'+_0x21cf86['extension'][_0x94c2('0x24')]+'}':_0x94c2('0x25'),'context':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x19')],'exten':_0x350b1a[_0x3f3917][0x0][_0x94c2('0xb')],'priority':_0x21cf86[_0x94c2('0x11')]++,'VoiceExtensionId':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x1a')]});}_0x21cf86['extensions']['push']({'type':_0x350b1a[_0x3f3917][0x0]['type'],'app':'Set','appdata':'outboundrouteid='+_0x350b1a[_0x3f3917][0x0][_0x94c2('0x1a')],'context':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x19')],'exten':_0x350b1a[_0x3f3917][0x0][_0x94c2('0xb')],'priority':_0x21cf86['priority']++,'VoiceExtensionId':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x1a')]});if(_0x21cf86['extension']&&_0x21cf86[_0x94c2('0x13')]['hasOwnProperty']('recordingFormat')&&_0x21cf86['extension'][_0x94c2('0x26')]!==_0x94c2('0x27')){_0x21cf86[_0x94c2('0x12')][_0x94c2('0x1c')]({'type':_0x350b1a[_0x3f3917][0x0]['type'],'app':_0x94c2('0x15'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x19')],'exten':_0x350b1a[_0x3f3917][0x0][_0x94c2('0xb')],'priority':_0x21cf86[_0x94c2('0x11')]++,'VoiceExtensionId':_0x350b1a[_0x3f3917][0x0]['VoiceExtensionId']});_0x21cf86['extensions'][_0x94c2('0x1c')]({'type':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x18')],'app':'Set','appdata':_0x94c2('0x28')+_0x21cf86[_0x94c2('0x13')]['recordingFormat']||'wav','context':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x19')],'exten':_0x350b1a[_0x3f3917][0x0][_0x94c2('0xb')],'priority':_0x21cf86[_0x94c2('0x11')]++,'VoiceExtensionId':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x1a')]});}}_0x21cf86[_0x94c2('0x12')][_0x94c2('0x1c')]({'type':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x18')],'app':_0x94c2('0x15'),'appdata':_0x94c2('0x29'),'context':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x19')],'exten':_0x350b1a[_0x3f3917][0x0][_0x94c2('0xb')],'priority':_0x21cf86[_0x94c2('0x11')]++,'VoiceExtensionId':_0x350b1a[_0x3f3917][0x0]['VoiceExtensionId']});_0x21cf86[_0x94c2('0x12')][_0x94c2('0x1c')]({'type':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x18')],'app':_0x94c2('0x15'),'appdata':_0x94c2('0x2a'),'context':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x19')],'exten':_0x350b1a[_0x3f3917][0x0][_0x94c2('0xb')],'priority':_0x21cf86[_0x94c2('0x11')]++,'VoiceExtensionId':_0x350b1a[_0x3f3917][0x0]['VoiceExtensionId']});_0x21cf86[_0x94c2('0x12')][_0x94c2('0x1c')]({'type':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x18')],'app':'Set','appdata':_0x94c2('0x2b'),'context':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x19')],'exten':_0x350b1a[_0x3f3917][0x0][_0x94c2('0xb')],'priority':_0x21cf86[_0x94c2('0x11')]++,'VoiceExtensionId':_0x350b1a[_0x3f3917][0x0]['VoiceExtensionId']});for(var _0x1cda81=0x0,_0x86cba9=0x0;_0x1cda81<_0x350b1a[_0x3f3917][_0x94c2('0x2c')];_0x1cda81+=0x1,_0x86cba9=0x0){var _0x5b0d65=_0x350b1a[_0x3f3917][_0x1cda81];if(_0x5b0d65[_0x94c2('0x18')]){_0x5b0d65[_0x94c2('0x18')]=_0x5b0d65[_0x94c2('0x18')][_0x94c2('0x2d')]();}var _0x1f7ac8=[];var _0x581afc=[];delete _0x5b0d65['id'];delete _0x5b0d65[_0x94c2('0x2e')];delete _0x5b0d65[_0x94c2('0x2f')];var _0x13def7=_0x5b0d65[_0x94c2('0x30')]!==_0x94c2('0x31')?[_0x5b0d65[_0x94c2('0x30')]]:_0x5b0d65['IntervalId']?_['map'](_[_0x94c2('0xc')](_0x21cf86[_0x94c2('0x4')],{'IntervalId':_0x5b0d65[_0x94c2('0x6')]}),'interval'):[];if(_0x5b0d65[_0x94c2('0x10')](_0x94c2('0x32'))){if(_0x5b0d65[_0x94c2('0x32')]&&_0x5b0d65['tag']!=='--'){_0x1f7ac8['push']({'type':_0x5b0d65[_0x94c2('0x18')],'app':_0x94c2('0x15'),'appdata':_0x94c2('0x33')+_0x5b0d65[_0x94c2('0x32')],'context':_0x5b0d65['context'],'exten':_0x5b0d65[_0x94c2('0xb')],'priority':_0x13def7[_0x94c2('0x2c')]+_0x21cf86['priority']+_0x86cba9++,'VoiceExtensionId':_0x5b0d65['VoiceExtensionId']});}}if(_0x5b0d65['type']==='outbound'&&_0x5b0d65['hasOwnProperty'](_0x94c2('0x34'))){if(_0x5b0d65[_0x94c2('0x34')]){_0x1f7ac8[_0x94c2('0x1c')]({'type':_0x5b0d65[_0x94c2('0x18')],'app':_0x94c2('0x21'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x5b0d65[_0x94c2('0x34')]+')','context':_0x5b0d65[_0x94c2('0x19')],'exten':_0x5b0d65[_0x94c2('0xb')],'priority':_0x13def7['length']+_0x21cf86[_0x94c2('0x11')]+_0x86cba9++,'VoiceExtensionId':_0x5b0d65[_0x94c2('0x1a')]});}else{_0x1f7ac8[_0x94c2('0x1c')]({'type':_0x5b0d65['type'],'app':_0x94c2('0x21'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x5b0d65[_0x94c2('0x19')],'exten':_0x5b0d65[_0x94c2('0xb')],'priority':_0x13def7['length']+_0x21cf86[_0x94c2('0x11')]+_0x86cba9++,'VoiceExtensionId':_0x5b0d65['VoiceExtensionId']});}}if(_0x5b0d65[_0x94c2('0x10')](_0x94c2('0x35'))){if(_0xeb99ad[_0x94c2('0x36')](_0x5b0d65[_0x94c2('0x37')][_0x94c2('0x2d')]())>=0x0&&_0x5b0d65['appType']!==_0x94c2('0x38')){if(_0x5b0d65['answer']){_0x1f7ac8['push']({'type':_0x5b0d65[_0x94c2('0x18')],'app':_0x94c2('0x21'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x5b0d65[_0x94c2('0x19')],'exten':_0x5b0d65[_0x94c2('0xb')],'priority':_0x13def7[_0x94c2('0x2c')]+_0x21cf86[_0x94c2('0x11')]+_0x86cba9++,'VoiceExtensionId':_0x5b0d65[_0x94c2('0x1a')]});_0x1f7ac8[_0x94c2('0x1c')]({'type':_0x5b0d65[_0x94c2('0x18')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x5b0d65['context'],'exten':_0x5b0d65['exten'],'priority':_0x13def7[_0x94c2('0x2c')]+_0x21cf86[_0x94c2('0x11')]+_0x86cba9++,'VoiceExtensionId':_0x5b0d65[_0x94c2('0x1a')]});}else{_0x1f7ac8[_0x94c2('0x1c')]({'type':_0x5b0d65[_0x94c2('0x18')],'app':_0x94c2('0x21'),'appdata':_0x94c2('0x39'),'context':_0x5b0d65[_0x94c2('0x19')],'exten':_0x5b0d65['exten'],'priority':_0x13def7['length']+_0x21cf86[_0x94c2('0x11')]+_0x86cba9++,'VoiceExtensionId':_0x5b0d65['VoiceExtensionId']});_0x1f7ac8['push']({'type':_0x5b0d65[_0x94c2('0x18')],'app':_0x94c2('0x15'),'appdata':_0x94c2('0x3a'),'context':_0x5b0d65[_0x94c2('0x19')],'exten':_0x5b0d65[_0x94c2('0xb')],'priority':_0x13def7[_0x94c2('0x2c')]+_0x21cf86['priority']+_0x86cba9++,'VoiceExtensionId':_0x5b0d65[_0x94c2('0x1a')]});}}}for(var _0x384068=0x0;_0x384068<_0x13def7['length'];_0x384068+=0x1){var _0x13b441=_0x21cf86[_0x94c2('0x11')]+_0x13def7[_0x94c2('0x2c')];var _0x7fbee=_0x384068===_0x13def7[_0x94c2('0x2c')]-0x1?_0x21cf86['priority']+_0x1f7ac8[_0x94c2('0x2c')]+_0x581afc[_0x94c2('0x2c')]+0x2:_0x21cf86[_0x94c2('0x11')]+_0x384068+0x1;_0x1f7ac8[_0x94c2('0x3b')](_0x384068,0x0,{'type':_0x5b0d65[_0x94c2('0x18')],'app':_0x94c2('0x3c'),'appdata':_0x13def7[_0x384068]+'?'+_0x5b0d65[_0x94c2('0x19')]+_0x94c2('0x3d')+_0x13b441+':'+_0x5b0d65['context']+_0x94c2('0x3d')+_0x7fbee,'exten':_0x5b0d65[_0x94c2('0xb')],'context':_0x5b0d65[_0x94c2('0x19')],'priority':_0x21cf86[_0x94c2('0x11')]+_0x384068,'VoiceExtensionId':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x1a')]});}_0x5b0d65[_0x94c2('0x11')]=_0x1f7ac8[_0x94c2('0x2c')]?_[_0x94c2('0x3e')](_0x1f7ac8)[_0x94c2('0x11')]+0x1:_0x21cf86[_0x94c2('0x11')];_0x21cf86['priority']=(_0x581afc[_0x94c2('0x2c')]?_[_0x94c2('0x3e')](_0x581afc)[_0x94c2('0x11')]:_0x5b0d65['priority'])+0x1;_0x21cf86[_0x94c2('0x12')]=_[_0x94c2('0x3f')](_0x21cf86[_0x94c2('0x12')],_0x1f7ac8,[_0x5b0d65],_0x581afc);}_0x21cf86[_0x94c2('0x12')]['push']({'type':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x18')],'app':_0x94c2('0x40'),'exten':_0x350b1a[_0x3f3917][0x0][_0x94c2('0xb')],'context':_0x350b1a[_0x3f3917][0x0]['context'],'priority':_0x21cf86[_0x94c2('0x11')],'VoiceExtensionId':_0x350b1a[_0x3f3917][0x0][_0x94c2('0x1a')]});_0x549d94[_0x94c2('0x1c')](_0x350b1a[_0x3f3917][0x0]['VoiceExtensionId']);_0x20f0a2=_[_0x94c2('0x3f')](_0x20f0a2,_0x21cf86[_0x94c2('0x12')]);}}return _0x5a0b5a[_0x94c2('0x41')](function(_0x202e14){return _0x5a0b5a[_0x94c2('0x8')][_0x94c2('0x5')][_0x94c2('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x549d94}},'transaction':_0x202e14})[_0x94c2('0x7')](function(_0x5aeae3){return _0x5a0b5a['models'][_0x94c2('0x5')][_0x94c2('0x43')](_[_0x94c2('0x44')](_0x20f0a2,_0x94c2('0x11')),{'transaction':_0x202e14});});});})[_0x94c2('0x45')](function(_0x281152){console[_0x94c2('0x46')](_0x281152);});}exports[_0x94c2('0x47')]=rewrite; \ No newline at end of file +var _0xc719=['priority','extensions','format','type','context','VoiceExtensionId','outbound','extension','push','Set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','CDR(prefix)=${EXTEN:0:','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','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','custom','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','Interval','then','intervals','models','VoiceExtension','findAll','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','hasOwnProperty'];(function(_0x220b6a,_0xc303d1){var _0x9a768b=function(_0x151c65){while(--_0x151c65){_0x220b6a['push'](_0x220b6a['shift']());}};_0x9a768b(++_0xc303d1);}(_0xc719,0x1d2));var _0x9c71=function(_0x22ccc0,_0x914457){_0x22ccc0=_0x22ccc0-0x0;var _0xe2af6a=_0xc719[_0x22ccc0];return _0xe2af6a;};'use strict';var _=require(_0x9c71('0x0'));var util=require(_0x9c71('0x1'));function rewrite(_0x140e5e,_0x260352){var _0x11dba0=this;return _0x140e5e['models'][_0x9c71('0x2')]['findAll']({'raw':!![]})[_0x9c71('0x3')](function(_0x1ecca1){_0x11dba0[_0x9c71('0x4')]=_0x1ecca1;return _0x140e5e[_0x9c71('0x5')][_0x9c71('0x6')][_0x9c71('0x7')]({'where':{'IntervalId':_0x260352[_0x9c71('0x8')]},'raw':!![]});})[_0x9c71('0x3')](function(_0x55a82e){return _0x140e5e[_0x9c71('0x5')][_0x9c71('0x6')][_0x9c71('0x7')]({'where':{'exten':{'$in':_[_0x9c71('0x9')](_[_0x9c71('0xa')](_0x55a82e,_0x9c71('0xb')))}},'order':[{'raw':_0x9c71('0xc')}],'raw':!![]});})[_0x9c71('0x3')](function(_0x4494c8){var _0x4599e6=_[_0x9c71('0xd')](_0x4494c8,{'priority':'1'});var _0x372dff=_['filter'](_0x4494c8,{'isApp':0x1});var _0x569071=_[_0x9c71('0xe')](_0x372dff,'exten');var _0x3ed326=['queue',_0x9c71('0xf')];var _0x2d99ab=[];var _0x412655=[];for(var _0x5f116c in _0x569071){if(_0x569071[_0x9c71('0x10')](_0x5f116c)){_0x11dba0[_0x9c71('0x11')]=0x2;_0x11dba0[_0x9c71('0x12')]=[];_0x11dba0['extension']=_['find'](_0x4599e6,{'exten':_0x569071[_0x5f116c][0x0][_0x9c71('0xb')]});_0x11dba0[_0x9c71('0x12')]['push']({'type':_0x569071[_0x5f116c][0x0]['type'],'app':'Set','appdata':util[_0x9c71('0x13')]('CDR(type)=%s',_0x569071[_0x5f116c][0x0][_0x9c71('0x14')]),'context':_0x569071[_0x5f116c][0x0][_0x9c71('0x15')],'exten':_0x569071[_0x5f116c][0x0]['exten'],'priority':_0x11dba0[_0x9c71('0x11')]++,'VoiceExtensionId':_0x569071[_0x5f116c][0x0][_0x9c71('0x16')]});if(_0x569071[_0x5f116c][0x0][_0x9c71('0x14')]===_0x9c71('0x17')){if(_0x11dba0[_0x9c71('0x18')]){_0x11dba0[_0x9c71('0x12')][_0x9c71('0x19')]({'type':_0x569071[_0x5f116c][0x0][_0x9c71('0x14')],'app':_0x9c71('0x1a'),'appdata':_0x9c71('0x1b')+(_0x11dba0[_0x9c71('0x18')][_0x9c71('0x1c')]?_0x9c71('0x1d')+_0x11dba0[_0x9c71('0x18')][_0x9c71('0x1c')]+'}':_0x9c71('0x1e')),'context':_0x569071[_0x5f116c][0x0][_0x9c71('0x15')],'exten':_0x569071[_0x5f116c][0x0]['exten'],'priority':_0x11dba0['priority']++,'VoiceExtensionId':_0x569071[_0x5f116c][0x0][_0x9c71('0x16')]});}_0x11dba0['extensions'][_0x9c71('0x19')]({'type':_0x569071[_0x5f116c][0x0][_0x9c71('0x14')],'app':'Set','appdata':_0x9c71('0x1f')+_0x569071[_0x5f116c][0x0][_0x9c71('0x16')],'context':_0x569071[_0x5f116c][0x0][_0x9c71('0x15')],'exten':_0x569071[_0x5f116c][0x0][_0x9c71('0xb')],'priority':_0x11dba0[_0x9c71('0x11')]++,'VoiceExtensionId':_0x569071[_0x5f116c][0x0][_0x9c71('0x16')]});var _0x5aa446=_0x11dba0[_0x9c71('0x11')]++;_0x11dba0[_0x9c71('0x12')][_0x9c71('0x19')]({'type':_0x569071[_0x5f116c][0x0][_0x9c71('0x14')],'app':_0x9c71('0x20'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x5aa446+0x2)+'):Goto('+(_0x5aa446+0x1)+')','context':_0x569071[_0x5f116c][0x0][_0x9c71('0x15')],'exten':_0x569071[_0x5f116c][0x0][_0x9c71('0xb')],'priority':_0x5aa446,'VoiceExtensionId':_0x569071[_0x5f116c][0x0][_0x9c71('0x16')]});if(_0x11dba0[_0x9c71('0x18')]){_0x11dba0[_0x9c71('0x12')]['push']({'type':_0x569071[_0x5f116c][0x0][_0x9c71('0x14')],'app':_0x9c71('0x1a'),'appdata':_0x11dba0[_0x9c71('0x18')][_0x9c71('0x1c')]?_0x9c71('0x21')+_0x11dba0[_0x9c71('0x18')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x569071[_0x5f116c][0x0][_0x9c71('0x15')],'exten':_0x569071[_0x5f116c][0x0][_0x9c71('0xb')],'priority':_0x11dba0[_0x9c71('0x11')]++,'VoiceExtensionId':_0x569071[_0x5f116c][0x0][_0x9c71('0x16')]});}_0x11dba0['extensions'][_0x9c71('0x19')]({'type':_0x569071[_0x5f116c][0x0][_0x9c71('0x14')],'app':_0x9c71('0x1a'),'appdata':'outboundrouteid='+_0x569071[_0x5f116c][0x0][_0x9c71('0x16')],'context':_0x569071[_0x5f116c][0x0]['context'],'exten':_0x569071[_0x5f116c][0x0][_0x9c71('0xb')],'priority':_0x11dba0[_0x9c71('0x11')]++,'VoiceExtensionId':_0x569071[_0x5f116c][0x0][_0x9c71('0x16')]});if(_0x11dba0[_0x9c71('0x18')]&&_0x11dba0[_0x9c71('0x18')][_0x9c71('0x10')](_0x9c71('0x22'))&&_0x11dba0['extension'][_0x9c71('0x22')]!=='none'){_0x11dba0[_0x9c71('0x12')][_0x9c71('0x19')]({'type':_0x569071[_0x5f116c][0x0]['type'],'app':'Set','appdata':_0x9c71('0x23'),'context':_0x569071[_0x5f116c][0x0]['context'],'exten':_0x569071[_0x5f116c][0x0][_0x9c71('0xb')],'priority':_0x11dba0[_0x9c71('0x11')]++,'VoiceExtensionId':_0x569071[_0x5f116c][0x0]['VoiceExtensionId']});_0x11dba0[_0x9c71('0x12')][_0x9c71('0x19')]({'type':_0x569071[_0x5f116c][0x0]['type'],'app':'Set','appdata':_0x9c71('0x24')+_0x11dba0['extension']['recordingFormat']||_0x9c71('0x25'),'context':_0x569071[_0x5f116c][0x0]['context'],'exten':_0x569071[_0x5f116c][0x0]['exten'],'priority':_0x11dba0[_0x9c71('0x11')]++,'VoiceExtensionId':_0x569071[_0x5f116c][0x0][_0x9c71('0x16')]});}}_0x11dba0[_0x9c71('0x12')]['push']({'type':_0x569071[_0x5f116c][0x0]['type'],'app':_0x9c71('0x1a'),'appdata':_0x9c71('0x26'),'context':_0x569071[_0x5f116c][0x0]['context'],'exten':_0x569071[_0x5f116c][0x0][_0x9c71('0xb')],'priority':_0x11dba0[_0x9c71('0x11')]++,'VoiceExtensionId':_0x569071[_0x5f116c][0x0]['VoiceExtensionId']});_0x11dba0[_0x9c71('0x12')][_0x9c71('0x19')]({'type':_0x569071[_0x5f116c][0x0][_0x9c71('0x14')],'app':_0x9c71('0x1a'),'appdata':_0x9c71('0x27'),'context':_0x569071[_0x5f116c][0x0][_0x9c71('0x15')],'exten':_0x569071[_0x5f116c][0x0][_0x9c71('0xb')],'priority':_0x11dba0['priority']++,'VoiceExtensionId':_0x569071[_0x5f116c][0x0]['VoiceExtensionId']});_0x11dba0['extensions'][_0x9c71('0x19')]({'type':_0x569071[_0x5f116c][0x0]['type'],'app':_0x9c71('0x1a'),'appdata':_0x9c71('0x28'),'context':_0x569071[_0x5f116c][0x0][_0x9c71('0x15')],'exten':_0x569071[_0x5f116c][0x0][_0x9c71('0xb')],'priority':_0x11dba0[_0x9c71('0x11')]++,'VoiceExtensionId':_0x569071[_0x5f116c][0x0][_0x9c71('0x16')]});for(var _0x2eadc8=0x0,_0x4b28e4=0x0;_0x2eadc8<_0x569071[_0x5f116c][_0x9c71('0x29')];_0x2eadc8+=0x1,_0x4b28e4=0x0){var _0x267add=_0x569071[_0x5f116c][_0x2eadc8];if(_0x267add['type']){_0x267add[_0x9c71('0x14')]=_0x267add[_0x9c71('0x14')][_0x9c71('0x2a')]();}var _0x4bd939=[];var _0x2035b8=[];delete _0x267add['id'];delete _0x267add[_0x9c71('0x2b')];delete _0x267add[_0x9c71('0x2c')];var _0x4aebda=_0x267add[_0x9c71('0x2d')]!==_0x9c71('0x2e')?[_0x267add[_0x9c71('0x2d')]]:_0x267add[_0x9c71('0x8')]?_[_0x9c71('0xa')](_[_0x9c71('0xd')](_0x11dba0[_0x9c71('0x4')],{'IntervalId':_0x267add[_0x9c71('0x8')]}),_0x9c71('0x2d')):[];if(_0x267add[_0x9c71('0x10')](_0x9c71('0x2f'))){if(_0x267add[_0x9c71('0x2f')]&&_0x267add['tag']!=='--'){_0x4bd939[_0x9c71('0x19')]({'type':_0x267add[_0x9c71('0x14')],'app':_0x9c71('0x1a'),'appdata':_0x9c71('0x30')+_0x267add['tag'],'context':_0x267add[_0x9c71('0x15')],'exten':_0x267add['exten'],'priority':_0x4aebda[_0x9c71('0x29')]+_0x11dba0[_0x9c71('0x11')]+_0x4b28e4++,'VoiceExtensionId':_0x267add[_0x9c71('0x16')]});}}if(_0x267add[_0x9c71('0x14')]==='outbound'&&_0x267add[_0x9c71('0x10')](_0x9c71('0x31'))){if(_0x267add[_0x9c71('0x31')]){_0x4bd939['push']({'type':_0x267add['type'],'app':_0x9c71('0x20'),'appdata':_0x9c71('0x32')+_0x267add['callerID']+')','context':_0x267add[_0x9c71('0x15')],'exten':_0x267add['exten'],'priority':_0x4aebda[_0x9c71('0x29')]+_0x11dba0[_0x9c71('0x11')]+_0x4b28e4++,'VoiceExtensionId':_0x267add['VoiceExtensionId']});}else{_0x4bd939[_0x9c71('0x19')]({'type':_0x267add[_0x9c71('0x14')],'app':_0x9c71('0x20'),'appdata':_0x9c71('0x33'),'context':_0x267add[_0x9c71('0x15')],'exten':_0x267add[_0x9c71('0xb')],'priority':_0x4aebda[_0x9c71('0x29')]+_0x11dba0[_0x9c71('0x11')]+_0x4b28e4++,'VoiceExtensionId':_0x267add[_0x9c71('0x16')]});}}if(_0x267add[_0x9c71('0x10')](_0x9c71('0x34'))){if(_0x3ed326[_0x9c71('0x35')](_0x267add[_0x9c71('0x36')][_0x9c71('0x2a')]())>=0x0&&_0x267add['appType']!==_0x9c71('0x37')){if(_0x267add[_0x9c71('0x34')]){_0x4bd939[_0x9c71('0x19')]({'type':_0x267add['type'],'app':_0x9c71('0x20'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x267add[_0x9c71('0x15')],'exten':_0x267add['exten'],'priority':_0x4aebda[_0x9c71('0x29')]+_0x11dba0['priority']+_0x4b28e4++,'VoiceExtensionId':_0x267add['VoiceExtensionId']});_0x4bd939[_0x9c71('0x19')]({'type':_0x267add[_0x9c71('0x14')],'app':_0x9c71('0x1a'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x267add[_0x9c71('0x15')],'exten':_0x267add['exten'],'priority':_0x4aebda['length']+_0x11dba0[_0x9c71('0x11')]+_0x4b28e4++,'VoiceExtensionId':_0x267add[_0x9c71('0x16')]});}else{_0x4bd939[_0x9c71('0x19')]({'type':_0x267add[_0x9c71('0x14')],'app':_0x9c71('0x20'),'appdata':_0x9c71('0x38'),'context':_0x267add[_0x9c71('0x15')],'exten':_0x267add[_0x9c71('0xb')],'priority':_0x4aebda[_0x9c71('0x29')]+_0x11dba0[_0x9c71('0x11')]+_0x4b28e4++,'VoiceExtensionId':_0x267add[_0x9c71('0x16')]});_0x4bd939['push']({'type':_0x267add['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x267add['context'],'exten':_0x267add[_0x9c71('0xb')],'priority':_0x4aebda[_0x9c71('0x29')]+_0x11dba0[_0x9c71('0x11')]+_0x4b28e4++,'VoiceExtensionId':_0x267add[_0x9c71('0x16')]});}}}for(var _0x56c6cb=0x0;_0x56c6cb<_0x4aebda[_0x9c71('0x29')];_0x56c6cb+=0x1){var _0x4469b1=_0x11dba0[_0x9c71('0x11')]+_0x4aebda[_0x9c71('0x29')];var _0x497a59=_0x56c6cb===_0x4aebda[_0x9c71('0x29')]-0x1?_0x11dba0[_0x9c71('0x11')]+_0x4bd939['length']+_0x2035b8[_0x9c71('0x29')]+0x2:_0x11dba0[_0x9c71('0x11')]+_0x56c6cb+0x1;_0x4bd939[_0x9c71('0x39')](_0x56c6cb,0x0,{'type':_0x267add['type'],'app':_0x9c71('0x3a'),'appdata':_0x4aebda[_0x56c6cb]+'?'+_0x267add[_0x9c71('0x15')]+',${EXTEN},'+_0x4469b1+':'+_0x267add[_0x9c71('0x15')]+_0x9c71('0x3b')+_0x497a59,'exten':_0x267add[_0x9c71('0xb')],'context':_0x267add[_0x9c71('0x15')],'priority':_0x11dba0[_0x9c71('0x11')]+_0x56c6cb,'VoiceExtensionId':_0x569071[_0x5f116c][0x0][_0x9c71('0x16')]});}_0x267add[_0x9c71('0x11')]=_0x4bd939[_0x9c71('0x29')]?_['last'](_0x4bd939)['priority']+0x1:_0x11dba0[_0x9c71('0x11')];_0x11dba0[_0x9c71('0x11')]=(_0x2035b8[_0x9c71('0x29')]?_[_0x9c71('0x3c')](_0x2035b8)[_0x9c71('0x11')]:_0x267add[_0x9c71('0x11')])+0x1;_0x11dba0[_0x9c71('0x12')]=_[_0x9c71('0x3d')](_0x11dba0[_0x9c71('0x12')],_0x4bd939,[_0x267add],_0x2035b8);}_0x11dba0[_0x9c71('0x12')][_0x9c71('0x19')]({'type':_0x569071[_0x5f116c][0x0][_0x9c71('0x14')],'app':_0x9c71('0x3e'),'exten':_0x569071[_0x5f116c][0x0][_0x9c71('0xb')],'context':_0x569071[_0x5f116c][0x0]['context'],'priority':_0x11dba0[_0x9c71('0x11')],'VoiceExtensionId':_0x569071[_0x5f116c][0x0][_0x9c71('0x16')]});_0x2d99ab[_0x9c71('0x19')](_0x569071[_0x5f116c][0x0][_0x9c71('0x16')]);_0x412655=_[_0x9c71('0x3d')](_0x412655,_0x11dba0['extensions']);}}return _0x140e5e['transaction'](function(_0xff61a){return _0x140e5e[_0x9c71('0x5')]['VoiceExtension'][_0x9c71('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x2d99ab}},'transaction':_0xff61a})['then'](function(_0x25094b){return _0x140e5e['models']['VoiceExtension'][_0x9c71('0x40')](_[_0x9c71('0x41')](_0x412655,_0x9c71('0x11')),{'transaction':_0xff61a});});});})[_0x9c71('0x42')](function(_0x1a1dfa){console[_0x9c71('0x43')](_0x1a1dfa);});}exports[_0x9c71('0x44')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 45746b0..3d12667 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 _0x70e0=['insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','updatedAt','select','field','toString','NOW()','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','from','createdAt','ListId\x20=\x20?','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','get','dialCheckDuplicateType','always','sequelize','VoiceQueueId','catch','query','BlackLists','all','Campaign','Lists','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','CmContact','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','errors','message','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','duplicate','Duplicate\x20Contact','keys','then','push','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect'];(function(_0x150a4a,_0x12df66){var _0x4116f6=function(_0x26e2ff){while(--_0x26e2ff){_0x150a4a['push'](_0x150a4a['shift']());}};_0x4116f6(++_0x12df66);}(_0x70e0,0x17b));var _0x070e=function(_0x2d1a3c,_0x2bcd95){_0x2d1a3c=_0x2d1a3c-0x0;var _0x42c59a=_0x70e0[_0x2d1a3c];return _0x42c59a;};'use strict';var BPromise=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var _=require(_0x070e('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var config=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('api');config[_0x070e('0x7')]=_['defaults'](config[_0x070e('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x070e('0x8'))[_0x070e('0x9')](socket);try{if(!process[_0x070e('0xa')][0x2]||process[_0x070e('0xa')][0x2]===_0x070e('0xb')||process[_0x070e('0xa')][0x2]===_0x070e('0xc')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0x070e('0xa')][0x3]||process[_0x070e('0xa')][0x3]===_0x070e('0xb')||process[_0x070e('0xa')][0x3]===_0x070e('0xc')||!process[_0x070e('0xa')][0x4]||process[_0x070e('0xa')][0x4]===_0x070e('0xb')||process[_0x070e('0xa')][0x4]===_0x070e('0xc')){throw new Error(_0x070e('0xd'));}var FIELDS=_['zipObject'](process['argv'][0x3][_0x070e('0xe')](','),process['argv'][0x4]['split'](','));if(!process['argv'][0x5]||process[_0x070e('0xa')][0x5]===_0x070e('0xb')||process['argv'][0x5]==='null'){throw new Error(_0x070e('0xf'));}var LISTID=process[_0x070e('0xa')][0x5];var COMPANYID=process[_0x070e('0xa')][0x6]&&process[_0x070e('0xa')][0x6]!=='undefined'&&process['argv'][0x6]!==_0x070e('0xc')?process[_0x070e('0xa')][0x6]:null;var DUPLICATES=process[_0x070e('0xa')][0x7]&&process[_0x070e('0xa')][0x7]!==_0x070e('0xb')&&process['argv'][0x7]!==_0x070e('0xc')?process[_0x070e('0xa')][0x7]:null;if(!process[_0x070e('0xa')][0x8]||process[_0x070e('0xa')][0x8]===_0x070e('0xb')||process['argv'][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x070e('0xa')][0x8];}catch(_0x3004f0){logger[_0x070e('0x10')](_0x3004f0);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(_0x4be0d7,_0x5b184,_0x5dc5d2,_0xf8dd5d){var _0x3f6985={'message':_0x5b184};_0x3f6985[_0x4be0d7]=!![];if(_0x5dc5d2){_0x3f6985[_0x070e('0x11')]=_0x5dc5d2;}if(_0xf8dd5d){_0x3f6985[_0x070e('0x12')]=_0xf8dd5d;}return _0x3f6985;}function isEmail(_0x28a1c3){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))*$/[_0x070e('0x13')](_0x28a1c3);}function checkRow(_0xe405e,_0x164cdf,_0x595c7e){return new BPromise(function(_0x2f8055,_0x270061){if(_[_0x070e('0x14')](_0xe405e)){return _0x270061(handleCheckRowError('error',_0x070e('0x15'),null,_0x595c7e));}if(_0xe405e['errors']&&_0xe405e['errors'][_0x070e('0x16')]){var _0x25f6e=_[_0x070e('0x17')](_0xe405e[_0x070e('0x18')],_0x070e('0x19'))['join'](';');return _0x270061(handleCheckRowError(_0x070e('0x10'),_0x25f6e,null,_0x595c7e));}var _0x219e48={};for(var _0x1d72d6 in FIELDS){if(FIELDS[_0x070e('0x1a')](_0x1d72d6)&&FIELDS[_0x1d72d6]){_0x219e48[_0x1d72d6]=_0xe405e[_0x070e('0x1b')][0x0][FIELDS[_0x1d72d6]]||_0xe405e[_0x070e('0x1b')][0x0]['\ufeff'+FIELDS[_0x1d72d6]];}}if(!_0x219e48[_0x070e('0x1c')]){return _0x270061(handleCheckRowError(_0x070e('0x10'),'firstName\x20not\x20specified!',null,_0x595c7e));}if(!_0x219e48[_0x070e('0x1d')]){return _0x270061(handleCheckRowError(_0x070e('0x10'),_0x070e('0x1e'),null,_0x595c7e));}if(_0x219e48['birthDate']){var _0x5c5f0d=moment(_0x219e48[_0x070e('0x1f')],_0x070e('0x20'));if(!_0x5c5f0d[_0x070e('0x21')]()){return _0x270061(handleCheckRowError('error',_0x070e('0x22'),null,_0x595c7e));}}if(_0x219e48[_0x070e('0x23')]){if(!isEmail(_0x219e48[_0x070e('0x23')])){return _0x270061(handleCheckRowError(_0x070e('0x10'),'email\x20format\x20is\x20not\x20valid!',null,_0x595c7e));}}_0x219e48['ListId']=LISTID;_0x219e48['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x164cdf){var _0xdf8945={};for(var _0x4e0a7d=0x0,_0x1dff97=DUPLICATES[_0x070e('0x16')];_0x4e0a7d<_0x1dff97;_0x4e0a7d+=0x1){_0xdf8945[DUPLICATES[_0x4e0a7d]]=_0x219e48[DUPLICATES[_0x4e0a7d]];}var _0x4f8130=_['find'](_0x164cdf,_0xdf8945);if(_0x4f8130){return _0x270061(handleCheckRowError(_0x070e('0x24'),_0x070e('0x25'),_0x4f8130,_0x595c7e));}}return db['CmContact']['create'](_0x219e48,{'raw':!![],'hooks':![],'fields':_[_0x070e('0x26')](_0x219e48)})[_0x070e('0x27')](function(_0x444d02){if(DUPLICATES&&DUPLICATES[_0x070e('0x16')]&&_0x164cdf){_0x164cdf[_0x070e('0x28')](_['pick'](_0x219e48,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x444d02['id'];return _0x2f8055();})['catch'](function(_0x24d17d){return _0x270061(handleCheckRowError(_0x070e('0x10'),_0x070e('0x29')+(_0x24d17d[_0x070e('0x19')]||JSON[_0x070e('0x2a')](_0x24d17d)),null,_0x595c7e));});});}function checkHopper(){function _0x4deaf8(){return function(_0x22f3a9){logger[_0x070e('0x10')]('cmContact',_0x070e('0x2b'),util[_0x070e('0x2c')](_0x22f3a9,{'showHidden':![],'depth':null}));};}var _0x4ba6f0=function(_0x4d4ee8,_0x5ddbe9){var _0x363bff=squel[_0x070e('0x2d')]()[_0x070e('0x2e')](_0x070e('0x2f'))[_0x070e('0x30')](['phone',_0x070e('0x31'),_0x070e('0x32'),_0x070e('0x33'),_0x5ddbe9,'createdAt',_0x070e('0x34')],squel[_0x070e('0x35')]()[_0x070e('0x36')]('phone',_0x070e('0x1d'))[_0x070e('0x36')]('NOW()',_0x070e('0x31'))['field']('id',_0x070e('0x32'))[_0x070e('0x36')](LISTID[_0x070e('0x37')](),_0x070e('0x33'))[_0x070e('0x36')](_0x4d4ee8['id']['toString'](),_0x5ddbe9)[_0x070e('0x36')]('NOW()','createdAt')[_0x070e('0x36')](_0x070e('0x38'),_0x070e('0x34'))['from'](_0x070e('0x39'))[_0x070e('0x3a')](_0x070e('0x3b'))[_0x070e('0x3a')]('ListId\x20=\x20?',LISTID[_0x070e('0x37')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x070e('0x3c'),squel[_0x070e('0x35')]()[_0x070e('0x36')](_0x070e('0x1d'))[_0x070e('0x3d')]('cm_hopper')[_0x070e('0x3a')](_0x5ddbe9+'\x20=\x20?',_0x4d4ee8['id'][_0x070e('0x37')]())))[_0x070e('0x37')]();return _0x363bff;};var _0xff760c=function(_0x52fcea,_0x54285a){var _0x261a27=squel['insert']()[_0x070e('0x2e')](_0x070e('0x2f'))[_0x070e('0x30')](['phone',_0x070e('0x31'),_0x070e('0x32'),'ListId',_0x54285a,'createdAt',_0x070e('0x34')],squel[_0x070e('0x35')]()[_0x070e('0x36')](_0x070e('0x1d'),_0x070e('0x1d'))['field'](_0x070e('0x38'),_0x070e('0x31'))[_0x070e('0x36')]('id',_0x070e('0x32'))[_0x070e('0x36')](LISTID[_0x070e('0x37')](),_0x070e('0x33'))[_0x070e('0x36')](_0x52fcea['id'][_0x070e('0x37')](),_0x54285a)[_0x070e('0x36')](_0x070e('0x38'),_0x070e('0x3e'))[_0x070e('0x36')](_0x070e('0x38'),_0x070e('0x34'))['from'](_0x070e('0x39'))[_0x070e('0x3a')](_0x070e('0x3b'))[_0x070e('0x3a')](_0x070e('0x3f'),LISTID[_0x070e('0x37')]())[_0x070e('0x3a')](_0x070e('0x40'),squel[_0x070e('0x41')](hopperContacts))['where'](_0x070e('0x42'))['where'](_0x070e('0x3c'),squel[_0x070e('0x35')]()['field'](_0x070e('0x43'))[_0x070e('0x3d')](_0x070e('0x44'))[_0x070e('0x3a')](_0x54285a+_0x070e('0x45'),_0x52fcea['id'][_0x070e('0x37')]()))[_0x070e('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x070e('0x35')]()['field']('phone')[_0x070e('0x3d')](_0x070e('0x2f'))[_0x070e('0x3a')](_0x54285a+_0x070e('0x45'),_0x52fcea['id'][_0x070e('0x37')]())))[_0x070e('0x37')]();return _0x261a27;};function _0x440fa1(_0x343785,_0x53bea1){var _0x477e69=squel['insert']()['into'](_0x070e('0x2f'))[_0x070e('0x30')](['phone',_0x070e('0x31'),_0x070e('0x32'),_0x070e('0x33'),_0x53bea1,_0x070e('0x3e'),_0x070e('0x34')],squel[_0x070e('0x35')]()[_0x070e('0x36')]('phone','phone')['field'](_0x070e('0x38'),_0x070e('0x31'))[_0x070e('0x36')]('id',_0x070e('0x32'))['field'](LISTID[_0x070e('0x37')](),'ListId')[_0x070e('0x36')](_0x343785['id'][_0x070e('0x37')](),_0x53bea1)[_0x070e('0x36')](_0x070e('0x38'),_0x070e('0x3e'))[_0x070e('0x36')]('NOW()',_0x070e('0x34'))[_0x070e('0x3d')](_0x070e('0x39'))['where'](_0x070e('0x3b'))[_0x070e('0x3a')]('ListId\x20=\x20?',LISTID[_0x070e('0x37')]())['where'](_0x070e('0x40'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x070e('0x37')]();return _0x477e69;}function _0x1ae5cb(_0x1100d8,_0x122198){var _0x3cb9ee=squel[_0x070e('0x2d')]()['into'](_0x070e('0x46'))['fromQuery']([_0x070e('0x1d'),'ContactId',_0x070e('0x33'),_0x122198,_0x070e('0x3e'),'updatedAt'],squel[_0x070e('0x35')]()['field'](_0x070e('0x1d'),_0x070e('0x1d'))[_0x070e('0x36')]('id',_0x070e('0x32'))[_0x070e('0x36')](LISTID[_0x070e('0x37')](),_0x070e('0x33'))[_0x070e('0x36')](_0x1100d8['id'][_0x070e('0x37')](),_0x122198)[_0x070e('0x36')](_0x070e('0x38'),_0x070e('0x3e'))[_0x070e('0x36')](_0x070e('0x38'),'updatedAt')[_0x070e('0x3d')](_0x070e('0x39'))[_0x070e('0x3a')](_0x070e('0x3b'))['where'](_0x070e('0x3f'),LISTID[_0x070e('0x37')]())[_0x070e('0x3a')](_0x070e('0x40'),squel[_0x070e('0x41')](hopperContacts))[_0x070e('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x070e('0x37')]();return _0x3cb9ee;}return db[_0x070e('0x47')][_0x070e('0x48')]({'where':{'type':_0x070e('0x49')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x070e('0x4a')],'as':'Lists','where':{'id':LISTID}}]})[_0x070e('0x27')](function(_0x36373d){var _0x3a1ad2=[];if(_0x36373d){var _0x150bf6;for(var _0x2a20d4=0x0,_0x50ef9f;_0x2a20d4<_0x36373d[_0x070e('0x16')];_0x2a20d4+=0x1){_0x50ef9f=_0x36373d[_0x2a20d4][_0x070e('0x4b')]({'plain':!![]});switch(_0x50ef9f[_0x070e('0x4c')]){case _0x070e('0x4d'):_0x3a1ad2['push'](db[_0x070e('0x4e')]['query'](_0xff760c(_0x50ef9f,_0x070e('0x4f')))[_0x070e('0x27')](function(){})[_0x070e('0x50')](_0x4deaf8()));break;case'onlyIfOpen':_0x3a1ad2[_0x070e('0x28')](db['sequelize'][_0x070e('0x51')](_0x4ba6f0(_0x50ef9f,'VoiceQueueId'))[_0x070e('0x27')](function(){})[_0x070e('0x50')](_0x4deaf8()));break;default:_0x3a1ad2['push'](db[_0x070e('0x4e')]['query'](_0x440fa1(_0x50ef9f,_0x070e('0x4f')))[_0x070e('0x27')](function(){})['catch'](_0x4deaf8()));}}}return _0x3a1ad2;})['all']()[_0x070e('0x27')](function(){return db[_0x070e('0x47')][_0x070e('0x48')]({'where':{'type':_0x070e('0x49')},'attributes':['id'],'include':[{'model':db[_0x070e('0x4a')],'as':_0x070e('0x52'),'where':{'id':LISTID}}]})[_0x070e('0x27')](function(_0x332c8a){var _0x25b599=[];if(_0x332c8a){var _0x1d1f44;for(var _0x72077d=0x0,_0x25670e;_0x72077d<_0x332c8a[_0x070e('0x16')];_0x72077d+=0x1){_0x25670e=_0x332c8a[_0x72077d]['get']({'plain':!![]});_0x25b599[_0x070e('0x28')](db[_0x070e('0x4e')]['query'](_0x1ae5cb(_0x25670e,'VoiceQueueId'))[_0x070e('0x27')](function(){})[_0x070e('0x50')](_0x4deaf8()));}}return _0x25b599;})[_0x070e('0x53')]();})[_0x070e('0x27')](function(){return db[_0x070e('0x54')][_0x070e('0x48')]({'attributes':['id',_0x070e('0x4c')],'include':[{'model':db[_0x070e('0x4a')],'as':_0x070e('0x55'),'where':{'id':LISTID}}]})[_0x070e('0x27')](function(_0x62800d){var _0x2084a1=[];if(_0x62800d){for(var _0x46ec49=0x0,_0x595e2e;_0x46ec49<_0x62800d['length'];_0x46ec49+=0x1){_0x595e2e=_0x62800d[_0x46ec49]['get']({'plain':!![]});switch(_0x595e2e[_0x070e('0x4c')]){case _0x070e('0x4d'):_0x2084a1[_0x070e('0x28')](db[_0x070e('0x4e')]['query'](_0xff760c(_0x595e2e,_0x070e('0x56')))[_0x070e('0x27')](function(){})[_0x070e('0x50')](_0x4deaf8()));break;case _0x070e('0x57'):_0x2084a1[_0x070e('0x28')](db[_0x070e('0x4e')]['query'](_0x4ba6f0(_0x595e2e,_0x070e('0x56')))['then'](function(){})[_0x070e('0x50')](_0x4deaf8()));break;default:_0x2084a1[_0x070e('0x28')](db[_0x070e('0x4e')][_0x070e('0x51')](_0x440fa1(_0x595e2e,_0x070e('0x56')))['then'](function(){})[_0x070e('0x50')](_0x4deaf8()));}}}return _0x2084a1;})[_0x070e('0x53')]();})['then'](function(){return db[_0x070e('0x54')][_0x070e('0x48')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x070e('0x52'),'where':{'id':LISTID}}]})[_0x070e('0x27')](function(_0xf0aef8){var _0x4da906=[];if(_0xf0aef8){for(var _0x40d7e6=0x0,_0xe8c476;_0x40d7e6<_0xf0aef8[_0x070e('0x16')];_0x40d7e6+=0x1){_0xe8c476=_0xf0aef8[_0x40d7e6][_0x070e('0x4b')]({'plain':!![]});_0x4da906[_0x070e('0x28')](db[_0x070e('0x4e')][_0x070e('0x51')](_0x1ae5cb(_0xe8c476,_0x070e('0x56')))[_0x070e('0x27')](function(){})[_0x070e('0x50')](_0x4deaf8()));}}return _0x4da906;})[_0x070e('0x53')]();})[_0x070e('0x50')](function(_0x18c27a){logger['error'](_0x070e('0x58'),_0x070e('0x59'),_0x18c27a[_0x070e('0x19')]);});}var processPromises=function(_0x1b71dd){return BPromise[_0x070e('0x53')](promises)[_0x070e('0x27')](function(_0x5c4352){})['catch'](function(_0x4a8563){logger[_0x070e('0x10')](_0x070e('0x5a'),JSON[_0x070e('0x2a')](_0x4a8563));})[_0x070e('0x5b')](function(){socket['emit'](_0x070e('0x5c')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1b71dd){return _0x1b71dd[_0x070e('0x5d')]();}});};var endCsv=function(){return BPromise[_0x070e('0x5e')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x070e('0x27')](function(){socket['emit'](_0x070e('0x5c')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x070e('0x5f')](FILEPATH);}catch(_0x59e6e5){logger['error'](_0x070e('0x60'),JSON[_0x070e('0x2a')](_0x59e6e5));}finally{process['exit'](0x0);}});};process['on'](_0x070e('0x61'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()[_0x070e('0x27')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x070e('0xe')](',');return db[_0x070e('0x62')][_0x070e('0x48')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x070e('0x27')](function(_0x341756){var _0x2a12a1=fs[_0x070e('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x070e('0x64')](_0x2a12a1,{'header':!![],'skipEmptyLines':!![],'step':function(_0xdcc60a,_0x4e0f6e){total+=0x1;var _0x1306e6=total;promises[_0x070e('0x28')](checkRow(_0xdcc60a,_0x341756,_0x1306e6)[_0x070e('0x27')](function(){success+=0x1;})[_0x070e('0x50')](function(_0x3f2bb5){if(_0x3f2bb5[_0x070e('0x10')]){errors+=0x1;delete _0x3f2bb5[_0x070e('0x10')];}else if(_0x3f2bb5[_0x070e('0x24')]){duplicates+=0x1;delete _0x3f2bb5[_0x070e('0x24')];}rows[_0x070e('0x28')](_0x3f2bb5);}));if(total%0xc8===0x0){_0x4e0f6e[_0x070e('0x65')]();return processPromises(_0x4e0f6e);}},'complete':function(){return processPromises()['then'](function(){logger[_0x070e('0x66')](_0x070e('0x67'));endCsv();});},'error':function(_0x449337,_0xe50b1b){logger['info'](_0x070e('0x68'),JSON[_0x070e('0x2a')](_0x449337));endCsv();}});})[_0x070e('0x50')](function(_0x2bad43){logger[_0x070e('0x10')](_0x070e('0x69'),JSON['stringify'](_0x2bad43));});}main(); \ No newline at end of file +var _0xa9e0=['CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','str','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','VoiceQueueId','onlyIfOpen','query','catch','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','contact:csv_','emit','unlinkSync','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','errors','length','map','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate'];(function(_0x7f36d4,_0x4528ad){var _0x3a2251=function(_0x3acc39){while(--_0x3acc39){_0x7f36d4['push'](_0x7f36d4['shift']());}};_0x3a2251(++_0x4528ad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x0a9e('0x3'));var db=require('../../../mysqldb')['db'];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 socket=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0x0a9e('0xb')][0x2]||process['argv'][0x2]==='undefined'||process[_0x0a9e('0xb')][0x2]===_0x0a9e('0xc')){throw new Error(_0x0a9e('0xd'));}var FILEPATH=process[_0x0a9e('0xb')][0x2];if(!process[_0x0a9e('0xb')][0x3]||process[_0x0a9e('0xb')][0x3]==='undefined'||process['argv'][0x3]==='null'||!process['argv'][0x4]||process[_0x0a9e('0xb')][0x4]===_0x0a9e('0xe')||process[_0x0a9e('0xb')][0x4]===_0x0a9e('0xc')){throw new Error(_0x0a9e('0xf'));}var FIELDS=_[_0x0a9e('0x10')](process['argv'][0x3][_0x0a9e('0x11')](','),process[_0x0a9e('0xb')][0x4][_0x0a9e('0x11')](','));if(!process[_0x0a9e('0xb')][0x5]||process[_0x0a9e('0xb')][0x5]===_0x0a9e('0xe')||process['argv'][0x5]===_0x0a9e('0xc')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x0a9e('0xb')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x0a9e('0xb')][0x6]!==_0x0a9e('0xe')&&process['argv'][0x6]!==_0x0a9e('0xc')?process['argv'][0x6]:null;var DUPLICATES=process[_0x0a9e('0xb')][0x7]&&process[_0x0a9e('0xb')][0x7]!==_0x0a9e('0xe')&&process[_0x0a9e('0xb')][0x7]!==_0x0a9e('0xc')?process[_0x0a9e('0xb')][0x7]:null;if(!process[_0x0a9e('0xb')][0x8]||process[_0x0a9e('0xb')][0x8]===_0x0a9e('0xe')||process[_0x0a9e('0xb')][0x8]===_0x0a9e('0xc')){throw new Error(_0x0a9e('0x12'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x2c3407){logger[_0x0a9e('0x13')](_0x2c3407);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(_0x53682f,_0x20f109,_0x5a09ef,_0x588269){var _0x3a02e1={'message':_0x20f109};_0x3a02e1[_0x53682f]=!![];if(_0x5a09ef){_0x3a02e1[_0x0a9e('0x14')]=_0x5a09ef;}if(_0x588269){_0x3a02e1[_0x0a9e('0x15')]=_0x588269;}return _0x3a02e1;}function isEmail(_0x30bae6){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'](_0x30bae6);}function checkRow(_0xfb6e48,_0x2fb0e4,_0x3b45bc){return new BPromise(function(_0x4d00e6,_0x370d86){if(_[_0x0a9e('0x16')](_0xfb6e48)){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x3b45bc));}if(_0xfb6e48['errors']&&_0xfb6e48[_0x0a9e('0x17')][_0x0a9e('0x18')]){var _0x40c424=_[_0x0a9e('0x19')](_0xfb6e48['errors'],_0x0a9e('0x1a'))['join'](';');return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x40c424,null,_0x3b45bc));}var _0x5bfb33={};for(var _0x1dc186 in FIELDS){if(FIELDS[_0x0a9e('0x1b')](_0x1dc186)&&FIELDS[_0x1dc186]){_0x5bfb33[_0x1dc186]=_0xfb6e48[_0x0a9e('0x1c')][0x0][FIELDS[_0x1dc186]]||_0xfb6e48[_0x0a9e('0x1c')][0x0]['\ufeff'+FIELDS[_0x1dc186]];}}if(!_0x5bfb33[_0x0a9e('0x1d')]){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x0a9e('0x1e'),null,_0x3b45bc));}if(!_0x5bfb33[_0x0a9e('0x1f')]){return _0x370d86(handleCheckRowError('error',_0x0a9e('0x20'),null,_0x3b45bc));}if(_0x5bfb33[_0x0a9e('0x21')]){var _0x2b1f27=moment(_0x5bfb33[_0x0a9e('0x21')],'YYYY-MM-DD');if(!_0x2b1f27[_0x0a9e('0x22')]()){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x0a9e('0x23'),null,_0x3b45bc));}}if(_0x5bfb33[_0x0a9e('0x24')]){if(!isEmail(_0x5bfb33[_0x0a9e('0x24')])){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x0a9e('0x25'),null,_0x3b45bc));}}_0x5bfb33[_0x0a9e('0x26')]=LISTID;_0x5bfb33[_0x0a9e('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x2fb0e4){var _0x426950={};for(var _0x5d1e0e=0x0,_0x2407f9=DUPLICATES[_0x0a9e('0x18')];_0x5d1e0e<_0x2407f9;_0x5d1e0e+=0x1){_0x426950[DUPLICATES[_0x5d1e0e]]=_0x5bfb33[DUPLICATES[_0x5d1e0e]];}var _0x1122db=_[_0x0a9e('0x28')](_0x2fb0e4,_0x426950);if(_0x1122db){return _0x370d86(handleCheckRowError(_0x0a9e('0x29'),'Duplicate\x20Contact',_0x1122db,_0x3b45bc));}}return db[_0x0a9e('0x2a')][_0x0a9e('0x2b')](_0x5bfb33,{'raw':!![],'hooks':![],'fields':_[_0x0a9e('0x2c')](_0x5bfb33)})[_0x0a9e('0x2d')](function(_0x2b45ea){if(DUPLICATES&&DUPLICATES[_0x0a9e('0x18')]&&_0x2fb0e4){_0x2fb0e4[_0x0a9e('0x2e')](_[_0x0a9e('0x2f')](_0x5bfb33,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2b45ea['id'];return _0x4d00e6();})['catch'](function(_0x44295a){return _0x370d86(handleCheckRowError('error',_0x0a9e('0x30')+(_0x44295a[_0x0a9e('0x1a')]||JSON[_0x0a9e('0x31')](_0x44295a)),null,_0x3b45bc));});});}function checkHopper(){function _0x3f3d41(){return function(_0x567193){logger[_0x0a9e('0x13')](_0x0a9e('0x32'),_0x0a9e('0x33'),util[_0x0a9e('0x34')](_0x567193,{'showHidden':![],'depth':null}));};}var _0x4853b1=function(_0x54135e,_0x1e8694){var _0x5640eb=squel[_0x0a9e('0x35')]()[_0x0a9e('0x36')](_0x0a9e('0x37'))[_0x0a9e('0x38')](['phone',_0x0a9e('0x39'),_0x0a9e('0x3a'),_0x0a9e('0x26'),_0x1e8694,'createdAt',_0x0a9e('0x3b')],squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')]('phone','phone')[_0x0a9e('0x3d')](_0x0a9e('0x3e'),'scheduledAt')[_0x0a9e('0x3d')]('id',_0x0a9e('0x3a'))[_0x0a9e('0x3d')](LISTID[_0x0a9e('0x3f')](),'ListId')['field'](_0x54135e['id'][_0x0a9e('0x3f')](),_0x1e8694)[_0x0a9e('0x3d')]('NOW()',_0x0a9e('0x40'))[_0x0a9e('0x3d')](_0x0a9e('0x3e'),'updatedAt')[_0x0a9e('0x41')](_0x0a9e('0x42'))[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')](_0x0a9e('0x45'),LISTID[_0x0a9e('0x3f')]())[_0x0a9e('0x43')](_0x0a9e('0x46'))[_0x0a9e('0x43')](_0x0a9e('0x47'),squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')](_0x0a9e('0x1f'))[_0x0a9e('0x41')]('cm_hopper')['where'](_0x1e8694+_0x0a9e('0x48'),_0x54135e['id'][_0x0a9e('0x3f')]())))[_0x0a9e('0x3f')]();return _0x5640eb;};var _0x315881=function(_0x1a69dd,_0xc9a702){var _0x10b040=squel[_0x0a9e('0x35')]()[_0x0a9e('0x36')](_0x0a9e('0x37'))[_0x0a9e('0x38')]([_0x0a9e('0x1f'),'scheduledAt',_0x0a9e('0x3a'),_0x0a9e('0x26'),_0xc9a702,_0x0a9e('0x40'),_0x0a9e('0x3b')],squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')](_0x0a9e('0x1f'),_0x0a9e('0x1f'))['field'](_0x0a9e('0x3e'),'scheduledAt')[_0x0a9e('0x3d')]('id',_0x0a9e('0x3a'))[_0x0a9e('0x3d')](LISTID['toString'](),_0x0a9e('0x26'))[_0x0a9e('0x3d')](_0x1a69dd['id'][_0x0a9e('0x3f')](),_0xc9a702)[_0x0a9e('0x3d')](_0x0a9e('0x3e'),_0x0a9e('0x40'))[_0x0a9e('0x3d')]('NOW()',_0x0a9e('0x3b'))[_0x0a9e('0x41')](_0x0a9e('0x42'))[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')](_0x0a9e('0x45'),LISTID[_0x0a9e('0x3f')]())[_0x0a9e('0x43')]('id\x20IN\x20?',squel[_0x0a9e('0x49')](hopperContacts))[_0x0a9e('0x43')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')](_0x0a9e('0x4a'))[_0x0a9e('0x41')](_0x0a9e('0x4b'))[_0x0a9e('0x43')](_0xc9a702+_0x0a9e('0x48'),_0x1a69dd['id'][_0x0a9e('0x3f')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x0a9e('0x3d')](_0x0a9e('0x1f'))[_0x0a9e('0x41')]('cm_hopper')[_0x0a9e('0x43')](_0xc9a702+_0x0a9e('0x48'),_0x1a69dd['id']['toString']())))['toString']();return _0x10b040;};function _0x2ef381(_0x59c6ff,_0x443e72){var _0x4c3845=squel[_0x0a9e('0x35')]()[_0x0a9e('0x36')](_0x0a9e('0x37'))['fromQuery']([_0x0a9e('0x1f'),_0x0a9e('0x39'),'ContactId','ListId',_0x443e72,_0x0a9e('0x40'),_0x0a9e('0x3b')],squel['select']()[_0x0a9e('0x3d')]('phone',_0x0a9e('0x1f'))['field'](_0x0a9e('0x3e'),'scheduledAt')['field']('id','ContactId')[_0x0a9e('0x3d')](LISTID['toString'](),_0x0a9e('0x26'))[_0x0a9e('0x3d')](_0x59c6ff['id'][_0x0a9e('0x3f')](),_0x443e72)[_0x0a9e('0x3d')](_0x0a9e('0x3e'),_0x0a9e('0x40'))[_0x0a9e('0x3d')](_0x0a9e('0x3e'),'updatedAt')[_0x0a9e('0x41')](_0x0a9e('0x42'))[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')](_0x0a9e('0x45'),LISTID['toString']())[_0x0a9e('0x43')](_0x0a9e('0x4c'),squel['str'](hopperContacts))[_0x0a9e('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0x0a9e('0x3f')]();return _0x4c3845;}function _0x5ba1f9(_0x4b3c1a,_0x5674ee){var _0x273cb5=squel['insert']()[_0x0a9e('0x36')](_0x0a9e('0x4d'))[_0x0a9e('0x38')]([_0x0a9e('0x1f'),_0x0a9e('0x3a'),_0x0a9e('0x26'),_0x5674ee,'createdAt',_0x0a9e('0x3b')],squel['select']()[_0x0a9e('0x3d')](_0x0a9e('0x1f'),_0x0a9e('0x1f'))['field']('id',_0x0a9e('0x3a'))[_0x0a9e('0x3d')](LISTID[_0x0a9e('0x3f')](),_0x0a9e('0x26'))['field'](_0x4b3c1a['id'][_0x0a9e('0x3f')](),_0x5674ee)[_0x0a9e('0x3d')]('NOW()',_0x0a9e('0x40'))[_0x0a9e('0x3d')](_0x0a9e('0x3e'),_0x0a9e('0x3b'))[_0x0a9e('0x41')]('cm_contacts')[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')]('ListId\x20=\x20?',LISTID[_0x0a9e('0x3f')]())['where']('id\x20IN\x20?',squel[_0x0a9e('0x49')](hopperContacts))[_0x0a9e('0x43')](_0x0a9e('0x46')))[_0x0a9e('0x3f')]();return _0x273cb5;}return db[_0x0a9e('0x4e')][_0x0a9e('0x4f')]({'where':{'type':_0x0a9e('0x50')},'attributes':['id',_0x0a9e('0x51')],'include':[{'model':db[_0x0a9e('0x52')],'as':_0x0a9e('0x53'),'where':{'id':LISTID}}]})[_0x0a9e('0x2d')](function(_0x19012b){var _0x2bbb86=[];if(_0x19012b){var _0x2b8192;for(var _0x320898=0x0,_0x412a72;_0x320898<_0x19012b[_0x0a9e('0x18')];_0x320898+=0x1){_0x412a72=_0x19012b[_0x320898][_0x0a9e('0x54')]({'plain':!![]});switch(_0x412a72['dialCheckDuplicateType']){case _0x0a9e('0x55'):_0x2bbb86[_0x0a9e('0x2e')](db[_0x0a9e('0x56')]['query'](_0x315881(_0x412a72,_0x0a9e('0x57')))[_0x0a9e('0x2d')](function(){})['catch'](_0x3f3d41()));break;case _0x0a9e('0x58'):_0x2bbb86[_0x0a9e('0x2e')](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x4853b1(_0x412a72,_0x0a9e('0x57')))['then'](function(){})['catch'](_0x3f3d41()));break;default:_0x2bbb86['push'](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x2ef381(_0x412a72,_0x0a9e('0x57')))[_0x0a9e('0x2d')](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));}}}return _0x2bbb86;})[_0x0a9e('0x5b')]()[_0x0a9e('0x2d')](function(){return db[_0x0a9e('0x4e')]['findAll']({'where':{'type':_0x0a9e('0x50')},'attributes':['id'],'include':[{'model':db[_0x0a9e('0x52')],'as':_0x0a9e('0x5c'),'where':{'id':LISTID}}]})['then'](function(_0x2bdc44){var _0x583b2e=[];if(_0x2bdc44){var _0x4437ff;for(var _0x44351d=0x0,_0x4c46c1;_0x44351d<_0x2bdc44[_0x0a9e('0x18')];_0x44351d+=0x1){_0x4c46c1=_0x2bdc44[_0x44351d][_0x0a9e('0x54')]({'plain':!![]});_0x583b2e[_0x0a9e('0x2e')](db[_0x0a9e('0x56')]['query'](_0x5ba1f9(_0x4c46c1,_0x0a9e('0x57')))[_0x0a9e('0x2d')](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));}}return _0x583b2e;})[_0x0a9e('0x5b')]();})['then'](function(){return db[_0x0a9e('0x5d')][_0x0a9e('0x4f')]({'attributes':['id',_0x0a9e('0x51')],'include':[{'model':db[_0x0a9e('0x52')],'as':'Lists','where':{'id':LISTID}}]})[_0x0a9e('0x2d')](function(_0x3511c9){var _0x30a4c7=[];if(_0x3511c9){for(var _0xf410e5=0x0,_0x332367;_0xf410e5<_0x3511c9[_0x0a9e('0x18')];_0xf410e5+=0x1){_0x332367=_0x3511c9[_0xf410e5][_0x0a9e('0x54')]({'plain':!![]});switch(_0x332367[_0x0a9e('0x51')]){case _0x0a9e('0x55'):_0x30a4c7[_0x0a9e('0x2e')](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x315881(_0x332367,_0x0a9e('0x5e')))[_0x0a9e('0x2d')](function(){})['catch'](_0x3f3d41()));break;case _0x0a9e('0x58'):_0x30a4c7[_0x0a9e('0x2e')](db[_0x0a9e('0x56')]['query'](_0x4853b1(_0x332367,_0x0a9e('0x5e')))[_0x0a9e('0x2d')](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));break;default:_0x30a4c7[_0x0a9e('0x2e')](db['sequelize']['query'](_0x2ef381(_0x332367,_0x0a9e('0x5e')))[_0x0a9e('0x2d')](function(){})['catch'](_0x3f3d41()));}}}return _0x30a4c7;})[_0x0a9e('0x5b')]();})['then'](function(){return db[_0x0a9e('0x5d')][_0x0a9e('0x4f')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x0a9e('0x5c'),'where':{'id':LISTID}}]})[_0x0a9e('0x2d')](function(_0x2d2286){var _0x42b959=[];if(_0x2d2286){for(var _0x3755fe=0x0,_0x1f42a0;_0x3755fe<_0x2d2286[_0x0a9e('0x18')];_0x3755fe+=0x1){_0x1f42a0=_0x2d2286[_0x3755fe]['get']({'plain':!![]});_0x42b959[_0x0a9e('0x2e')](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x5ba1f9(_0x1f42a0,_0x0a9e('0x5e')))['then'](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));}}return _0x42b959;})[_0x0a9e('0x5b')]();})['catch'](function(_0x1d6834){logger['error'](_0x0a9e('0x5f'),_0x0a9e('0x60'),_0x1d6834[_0x0a9e('0x1a')]);});}var processPromises=function(_0x385d52){return BPromise['all'](promises)['then'](function(_0x353384){})[_0x0a9e('0x5a')](function(_0x94dcf5){logger['error'](_0x0a9e('0x61'),JSON[_0x0a9e('0x31')](_0x94dcf5));})['finally'](function(){socket['emit'](_0x0a9e('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x385d52){return _0x385d52['resume']();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x0a9e('0x2d')](function(){socket[_0x0a9e('0x63')](_0x0a9e('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0a9e('0x64')](FILEPATH);}catch(_0x3c6dd6){logger[_0x0a9e('0x13')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x0a9e('0x31')](_0x3c6dd6));}finally{process['exit'](0x0);}});};process['on'](_0x0a9e('0x65'),function(){logger[_0x0a9e('0x66')](_0x0a9e('0x67'));endCsv();});function main(){return BPromise[_0x0a9e('0x68')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0a9e('0x11')](',');return db[_0x0a9e('0x2a')][_0x0a9e('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0xb6e411){var _0x21e592=fs[_0x0a9e('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0a9e('0x6a')](_0x21e592,{'header':!![],'skipEmptyLines':!![],'step':function(_0x255e49,_0x1910bf){total+=0x1;var _0x32b9bd=total;promises[_0x0a9e('0x2e')](checkRow(_0x255e49,_0xb6e411,_0x32b9bd)['then'](function(){success+=0x1;})[_0x0a9e('0x5a')](function(_0x3325c5){if(_0x3325c5['error']){errors+=0x1;delete _0x3325c5[_0x0a9e('0x13')];}else if(_0x3325c5[_0x0a9e('0x29')]){duplicates+=0x1;delete _0x3325c5[_0x0a9e('0x29')];}rows['push'](_0x3325c5);}));if(total%0xc8===0x0){_0x1910bf[_0x0a9e('0x6b')]();return processPromises(_0x1910bf);}},'complete':function(){return processPromises()['then'](function(){logger[_0x0a9e('0x66')](_0x0a9e('0x6c'));endCsv();});},'error':function(_0x558a87,_0x1f29bd){logger[_0x0a9e('0x66')](_0x0a9e('0x6d'),JSON[_0x0a9e('0x31')](_0x558a87));endCsv();}});})[_0x0a9e('0x5a')](function(_0x501050){logger[_0x0a9e('0x13')](_0x0a9e('0x6e'),JSON[_0x0a9e('0x31')](_0x501050));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 3351472..cf3fde3 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 _0x8fcf=['rows','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','includes','agent\x20not\x20exists','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','length','SystemRow','appendFileSync','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','VoiceQueueId','voice_queues','campaigns_has_cm_lists','campaigns','each','finish','affectedRows','emit','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','path','lodash','papaparse','util','bluebird','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','insert','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','recallme','fields','cm_contacts','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.createdAt','cm_hopper_black','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','into',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','code','push','catch','main','stringify','send','binding','server/files/tmp','.csv','header','parse','createReadStream','data'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0x8fcf,0x135));var _0xf8fc=function(_0x47fc12,_0x57835c){_0x47fc12=_0x47fc12-0x0;var _0x1b29f7=_0x8fcf[_0x47fc12];return _0x1b29f7;};'use strict';var fs=require('fs');var path=require(_0xf8fc('0x0'));var _=require(_0xf8fc('0x1'));var Papa=require(_0xf8fc('0x2'));var util=require(_0xf8fc('0x3'));var BPromise=require(_0xf8fc('0x4'));var moment=require('moment');var squel=require('squel');var Redis=require('ioredis');var db=require(_0xf8fc('0x5'))['db'];var config=require(_0xf8fc('0x6'));var logger=require(_0xf8fc('0x7'))(_0xf8fc('0x8'));config[_0xf8fc('0x9')]=_[_0xf8fc('0xa')](config[_0xf8fc('0x9')],{'host':_0xf8fc('0xb'),'port':0x18eb});var socket=require(_0xf8fc('0xc'))(new Redis(config[_0xf8fc('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0xf8fc('0xd'));function isEmail(_0x4816df){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))*$/[_0xf8fc('0xe')](_0x4816df);}function selectNotIn(_0x4de83c,_0x27de54,_0x5a5396,_0x2e2e2d,_0x543561){return squel[_0xf8fc('0xf')]()[_0xf8fc('0x10')](_0xf8fc('0x11'))[_0xf8fc('0x12')](_0x2e2e2d)[_0xf8fc('0x13')](_0x27de54,null,_0x27de54+'.id\x20=\x20'+_0x2e2e2d+'.'+_0x5a5396)['where'](_0x2e2e2d+'.'+_0x5a5396+_0xf8fc('0x14')+_0x4de83c+'.'+_0x5a5396)[_0xf8fc('0x15')](_0x27de54+_0xf8fc('0x16')+_0x543561[_0xf8fc('0x13')]()+')');}function insertCmHopper(_0x56b888,_0x2bb84d,_0x5731e2,_0x45247b,_0x13c033){var _0x210195=[_0xf8fc('0x17'),_0xf8fc('0x18'),_0xf8fc('0x19'),_0xf8fc('0x1a'),_0x2bb84d+'.'+_0x45247b,'cm_contacts.createdAt',_0xf8fc('0x1b'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x13c033+'\x22'];return squel[_0xf8fc('0x1c')]()['into'](_0xf8fc('0x1d'))[_0xf8fc('0x1e')]([_0xf8fc('0x11'),_0xf8fc('0x1f'),_0xf8fc('0x20'),_0xf8fc('0x21'),_0x45247b,_0xf8fc('0x22'),_0xf8fc('0x23'),'priority',_0xf8fc('0x24'),_0xf8fc('0x25')],squel[_0xf8fc('0xf')]()[_0xf8fc('0x26')](_0x210195)['from'](_0x2bb84d)['join'](_0xf8fc('0x27'),null,'cm_contacts.ListId\x20=\x20'+_0x2bb84d+_0xf8fc('0x28'))[_0xf8fc('0x13')](_0x5731e2,null,_0x5731e2+_0xf8fc('0x29')+_0x2bb84d+'.'+_0x45247b)[_0xf8fc('0x15')](_0x2bb84d+_0xf8fc('0x2a'),_0x56b888)[_0xf8fc('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xf8fc('0x2b'),selectNotIn(_0x2bb84d,_0x5731e2,_0x45247b,_0xf8fc('0x1d'),[_0xf8fc('0x2c'),_0xf8fc('0x2d')]))[_0xf8fc('0x15')](_0xf8fc('0x2b'),selectNotIn(_0x2bb84d,_0x5731e2,_0x45247b,_0xf8fc('0x1d'),[_0xf8fc('0x2c')])))[_0xf8fc('0x2e')]();}function insertCmHopperBlack(_0x39c771,_0x48ce27,_0x51a48e,_0x1a0d3a){var _0x35b276=[_0xf8fc('0x17'),'cm_contacts.id',_0xf8fc('0x1a'),_0x48ce27+'.'+_0x1a0d3a,_0xf8fc('0x2f'),_0xf8fc('0x1b')];return squel[_0xf8fc('0x1c')]()['into'](_0xf8fc('0x30'))[_0xf8fc('0x1e')](['phone',_0xf8fc('0x20'),_0xf8fc('0x21'),_0x1a0d3a,'createdAt','updatedAt'],squel['select']()[_0xf8fc('0x26')](_0x35b276)[_0xf8fc('0x12')](_0x48ce27)[_0xf8fc('0x13')](_0xf8fc('0x27'),null,_0xf8fc('0x31')+_0x48ce27+_0xf8fc('0x28'))['join'](_0x51a48e,null,_0x51a48e+_0xf8fc('0x29')+_0x48ce27+'.'+_0x1a0d3a)[_0xf8fc('0x15')](_0x48ce27+'.CmListId\x20=\x20?',_0x39c771)[_0xf8fc('0x15')](_0xf8fc('0x32'),NOW)[_0xf8fc('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xf8fc('0xf')]()[_0xf8fc('0x10')](_0xf8fc('0x11'))[_0xf8fc('0x12')](_0xf8fc('0x30'))['where']('ListId\x20=\x20?',_0x39c771)[_0xf8fc('0x15')](_0x1a0d3a+_0xf8fc('0x33'),_0x48ce27+'.'+_0x1a0d3a)))['toString']();}function insertCmContact(_0x225708,_0x5e21b7,_0x44b31d,_0x525368){var _0x5607e4=_[_0xf8fc('0x34')](_[_0xf8fc('0x35')](_0x525368),[_0xf8fc('0x21'),_0xf8fc('0x36'),'createdAt','updatedAt']);return squel[_0xf8fc('0x1c')]()[_0xf8fc('0x37')](_0xf8fc('0x27'))[_0xf8fc('0x1e')](_0x5607e4,squel['select']()[_0xf8fc('0x26')](_0x5607e4)['from'](_0x5e21b7)[_0xf8fc('0x15')]('('+_0x44b31d['join'](',')+_0xf8fc('0x38'),squel[_0xf8fc('0xf')]()[_0xf8fc('0x26')](_0x44b31d)[_0xf8fc('0x12')](_0xf8fc('0x27'))[_0xf8fc('0x15')](_0xf8fc('0x39'),_0x225708))[_0xf8fc('0x15')](_0xf8fc('0x3a'),squel[_0xf8fc('0xf')]()[_0xf8fc('0x10')](_0xf8fc('0x3b'),_0xf8fc('0x3c'))[_0xf8fc('0x12')](_0x5e21b7)[_0xf8fc('0x3d')](_0x44b31d['join'](','))))[_0xf8fc('0x2e')]();}function handleStop(){logger[_0xf8fc('0x3e')](_0xf8fc('0x3f'));stopped=!![];}function handleUncaughtException(_0x23589f){logger[_0xf8fc('0x40')](_0x23589f[_0xf8fc('0x41')]);process[_0xf8fc('0x42')](0x1);}function handleError(_0x3f3b43,_0x28e98d){stats[_0xf8fc('0x43')]['push']({'name':_0x28e98d[_0xf8fc('0x44')],'message':_0x28e98d[_0xf8fc('0x41')],'row':_0x3f3b43});}function handleQuery(_0x413c7e){logger[_0xf8fc('0x3e')](_0x413c7e);return db['sequelize']['query'](_0x413c7e)['spread'](function(_0x2a6613){results[_0xf8fc('0x45')](_0x2a6613);})[_0xf8fc('0x46')](function(_0x3ead5f){logger['error'](_0x3ead5f[_0xf8fc('0x41')]);});}function main(_0x48916a,_0x4ea7bc,_0x4c833b,_0x2ee0bf){logger[_0xf8fc('0x3e')](_0xf8fc('0x47'),_0x48916a,JSON[_0xf8fc('0x48')](_0x4ea7bc));process[_0xf8fc('0x49')]('start');var _0x1a7952=_0x4ea7bc[_0xf8fc('0x4a')];var _0x18ebf6=_0x4ea7bc['socket_timestamp'];var _0x423f0c=path['join'](config['root'],_0xf8fc('0x4b'),_0x18ebf6+_0xf8fc('0x4c'));var _0x445733=_[_0xf8fc('0x35')](_0x1a7952)[_0xf8fc('0x13')]();logger[_0xf8fc('0x3e')](_0xf8fc('0x4d'),_0x445733);fs['writeFileSync'](_0x423f0c,_0x445733+'\x0a');Papa[_0xf8fc('0x4e')](fs[_0xf8fc('0x4f')](_0x48916a),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1f2ec5,_0x5d48ea){try{for(var _0xb0953b=0x0,_0x55bcc8=[];_0xb0953b<_0x1f2ec5[_0xf8fc('0x50')]['length'];_0xb0953b++){stats[_0xf8fc('0x51')]+=0x1;if(_0x1f2ec5[_0xf8fc('0x43')][_0xb0953b]){handleError(_0x1f2ec5[_0xf8fc('0x50')][_0xb0953b],_0x1f2ec5[_0xf8fc('0x43')][_0xb0953b]);}else{var _0x3838d3=[];for(var _0xc8ea3a in _0x1a7952){if(_0x1a7952[_0xf8fc('0x52')](_0xc8ea3a)){if(_0x1f2ec5[_0xf8fc('0x50')][_0xb0953b][_0x1a7952[_0xc8ea3a]]){var _0x4d4bb7=_[_0xf8fc('0x53')](_0x1f2ec5[_0xf8fc('0x50')][_0xb0953b][_0x1a7952[_0xc8ea3a]][_0xf8fc('0x54')](/"/g,'\x27'));switch(_0xc8ea3a){case'scheduledat':var _0x4b8ae1=moment(_0x4d4bb7,_0xf8fc('0xd'),!![]);if(_0x4b8ae1[_0xf8fc('0x55')]()){_0x55bcc8[_0xf8fc('0x45')]('\x22'+_0x4d4bb7+'\x22');}else{_0x3838d3[_0xf8fc('0x45')](_0xf8fc('0x56'));}break;case _0xf8fc('0x57'):var _0x47981f=parseInt(_0x4d4bb7);_0x4d4bb7=_[_0xf8fc('0x58')](_0x47981f)||_0x47981f<0x0||_0x47981f>0x4?_0x2ee0bf?0x3:0x2:_0x47981f;_0x55bcc8[_0xf8fc('0x45')]('\x22'+_0x4d4bb7+'\x22');break;case'UserId':var _0x52733f=parseInt(_0x4d4bb7);if(_['isNumber'](_0x52733f)&&_[_0xf8fc('0x59')](_0x4c833b,_0x52733f)){_0x55bcc8[_0xf8fc('0x45')]('\x22'+_0x52733f+'\x22');}else{_0x3838d3[_0xf8fc('0x45')](_0xf8fc('0x5a'));}break;case'email':if(isEmail(_0x4d4bb7)){_0x55bcc8['push']('\x22'+_0x4d4bb7+'\x22');}else{_0x3838d3[_0xf8fc('0x45')]('email\x20wrong\x20format');}break;case _0xf8fc('0x5b'):var _0x13b02c=moment(_0x4d4bb7,_0xf8fc('0x5c'),!![]);if(_0x13b02c['isValid']()){_0x55bcc8[_0xf8fc('0x45')]('\x22'+_0x4d4bb7+'\x22');}else{_0x3838d3[_0xf8fc('0x45')](_0xf8fc('0x5d'));}break;default:_0x55bcc8['push']('\x22'+_0x4d4bb7+'\x22');}}else{switch(_0xc8ea3a){case'firstName':case'phone':_0x3838d3[_0xf8fc('0x45')](_0xc8ea3a+'\x20not\x20specified');break;default:_0x55bcc8[_0xf8fc('0x45')]('\x22\x22');}}}}if(_0x3838d3[_0xf8fc('0x5e')]){handleError(_0x1f2ec5['data'][_0xb0953b],{'code':_0xf8fc('0x5f'),'message':_0x3838d3[_0xf8fc('0x13')]()});}else{fs[_0xf8fc('0x60')](_0x423f0c,_0x55bcc8[_0xf8fc('0x13')]()+'\x0a');}_0x55bcc8=[];}if(!(stats[_0xf8fc('0x51')]%0xc8)){socket['emit'](_0xf8fc('0x61')+_0x18ebf6,stats);stats[_0xf8fc('0x43')]=[];}}if(stopped){logger[_0xf8fc('0x3e')](_0xf8fc('0x62'));_0x5d48ea[_0xf8fc('0x63')]();}}catch(_0x470fbf){handleError(_0x1f2ec5[_0xf8fc('0x50')][_0xb0953b],{'code':_0xf8fc('0x64'),'message':_0x470fbf[_0xf8fc('0x41')]});logger[_0xf8fc('0x40')](_0xf8fc('0x65'),_0x470fbf[_0xf8fc('0x41')]);}},'complete':function(){try{var _0x1151fe=[];var _0x35c034=_0xf8fc('0x27');if(_0x4ea7bc[_0xf8fc('0x66')]&&_0x4ea7bc[_0xf8fc('0x66')][_0xf8fc('0x5e')]){_0x35c034=_0xf8fc('0x67')+_0x18ebf6;_0x1151fe['push'](_0xf8fc('0x68')+_0x35c034+'\x20LIKE\x20cm_contacts;');}var _0x52576d=util[_0xf8fc('0x69')](_0xf8fc('0x6a'),_0x423f0c,_0x35c034,_0x445733,_0x4ea7bc[_0xf8fc('0x21')],_0x4ea7bc[_0xf8fc('0x36')]||null,NOW,NOW);if(_[_0xf8fc('0x6b')](_0x1a7952['scheduledat'])){_0x52576d+=_0xf8fc('0x6c');}_0x1151fe[_0xf8fc('0x45')](_0x52576d);if(_0x4ea7bc[_0xf8fc('0x66')]&&_0x4ea7bc[_0xf8fc('0x66')][_0xf8fc('0x5e')]){_0x1151fe[_0xf8fc('0x45')](insertCmContact(_0x4ea7bc[_0xf8fc('0x21')],_0x35c034,_0x4ea7bc[_0xf8fc('0x66')],_0x1a7952));_0x1151fe[_0xf8fc('0x45')]('DROP\x20TABLE\x20'+_0x35c034+';');}_0x1151fe[_0xf8fc('0x45')](insertCmHopper(_0x4ea7bc[_0xf8fc('0x21')],_0xf8fc('0x6d'),'voice_queues',_0xf8fc('0x6e'),_0x2ee0bf));_0x1151fe['push'](insertCmHopperBlack(_0x4ea7bc[_0xf8fc('0x21')],'voice_queues_has_cm_blacklists',_0xf8fc('0x6f'),_0xf8fc('0x6e')));_0x1151fe[_0xf8fc('0x45')](insertCmHopper(_0x4ea7bc[_0xf8fc('0x21')],_0xf8fc('0x70'),_0xf8fc('0x71'),'CampaignId',_0x2ee0bf));_0x1151fe[_0xf8fc('0x45')](insertCmHopperBlack(_0x4ea7bc[_0xf8fc('0x21')],'campaigns_has_cm_blacklists',_0xf8fc('0x71'),'CampaignId'));BPromise[_0xf8fc('0x72')](_0x1151fe,handleQuery)['then'](function(_0x1c309c){stats[_0xf8fc('0x73')]=!![];stats[_0xf8fc('0x74')]=_0x4ea7bc[_0xf8fc('0x66')]&&_0x4ea7bc[_0xf8fc('0x66')][_0xf8fc('0x5e')]?results[0x2][_0xf8fc('0x74')]:results[0x0]['affectedRows'];socket[_0xf8fc('0x75')](_0xf8fc('0x61')+_0x18ebf6,stats);fs['unlink'](_0x48916a);fs[_0xf8fc('0x76')](_0x423f0c);process[_0xf8fc('0x42')](0x0);})[_0xf8fc('0x46')](function(_0x3f7670){logger['error'](_0x3f7670[_0xf8fc('0x41')]);process[_0xf8fc('0x42')](0x1);});}catch(_0x83cbe6){logger[_0xf8fc('0x40')](_0xf8fc('0x77'),_0x83cbe6['message']);process[_0xf8fc('0x42')](0x1);}},'error':function(_0x48f266,_0x3e4378,_0x241d5a,_0x28836c){throw new Error(_0x28836c);}});}function validate(){if(process[_0xf8fc('0x78')]&&process[_0xf8fc('0x78')][_0xf8fc('0x5e')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x115a64=path[_0xf8fc('0x13')](config['root'],'server/files/tmp',process[_0xf8fc('0x78')][0x2]);if(!fs[_0xf8fc('0x79')](_0x115a64)){throw new Error(_0xf8fc('0x7a'));}var _0x4e0411={};try{_0x4e0411=JSON[_0xf8fc('0x4e')](process[_0xf8fc('0x78')][0x3]);if(!_0x4e0411['binding']){throw new Error(_0xf8fc('0x7b'));}if(!_0x4e0411[_0xf8fc('0x4a')][_0xf8fc('0x11')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x4e0411['binding'][_0xf8fc('0x7c')]){throw new Error(_0xf8fc('0x7d'));}var _0x562422=0x0;if(_0x4e0411[_0xf8fc('0x4a')][_0xf8fc('0x24')]){_0x562422=0x1;}if(!_0x4e0411[_0xf8fc('0x21')]){throw new Error(_0xf8fc('0x7e'));}}catch(_0x482294){throw new Error(_0xf8fc('0x7f'));}var _0x456912=[];try{_0x456912=_[_0xf8fc('0x80')](JSON[_0xf8fc('0x4e')](process[_0xf8fc('0x78')][0x4]),'id');}catch(_0x5624ac){logger[_0xf8fc('0x3e')](_0xf8fc('0x81'));}main(_0x115a64,_0x4e0411,_0x456912,_0x562422);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0xa2c6=['cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','insert','into','phone','scheduledat','ContactId','createdAt','priority','UserId','select','fields','cm_contacts','join','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_hopper_black','fromQuery','ListId','updatedAt','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','toString','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','MIN(id)','min_id','error','exit','errors','push','code','message','info','sequelize','spread','catch','main','stringify','send','start','binding','root','server/files/tmp','header','writeFileSync','parse','createReadStream','data','length','hasOwnProperty','trim','replace','isValid','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)','firstName','\x20not\x20specified','SystemRow','appendFileSync','rows','Abort\x20parser','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','each','then','finish','affectedRows','emit','contact:import:','unlink','complete','argv','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa2c6,0xf7));var _0x6a2c=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0xa2c6[_0x44a64f];return _0x52024b;};'use strict';var fs=require('fs');var path=require(_0x6a2c('0x0'));var _=require(_0x6a2c('0x1'));var Papa=require(_0x6a2c('0x2'));var util=require(_0x6a2c('0x3'));var BPromise=require(_0x6a2c('0x4'));var moment=require(_0x6a2c('0x5'));var squel=require('squel');var Redis=require('ioredis');var db=require(_0x6a2c('0x6'))['db'];var config=require(_0x6a2c('0x7'));var logger=require(_0x6a2c('0x8'))(_0x6a2c('0x9'));config[_0x6a2c('0xa')]=_[_0x6a2c('0xb')](config[_0x6a2c('0xa')],{'host':_0x6a2c('0xc'),'port':0x18eb});var socket=require(_0x6a2c('0xd'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x6a2c('0xe')](_0x6a2c('0xf'));function isEmail(_0x335fe3){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))*$/[_0x6a2c('0x10')](_0x335fe3);}function selectNotIn(_0x1e8295,_0x53e4d2,_0x18196c,_0x8164a0,_0x3eda45){return squel['select']()[_0x6a2c('0x11')]('phone')[_0x6a2c('0x12')](_0x8164a0)['join'](_0x53e4d2,null,_0x53e4d2+_0x6a2c('0x13')+_0x8164a0+'.'+_0x18196c)[_0x6a2c('0x14')](_0x8164a0+'.'+_0x18196c+_0x6a2c('0x15')+_0x1e8295+'.'+_0x18196c)['where'](_0x53e4d2+_0x6a2c('0x16')+_0x3eda45['join']()+')');}function insertCmHopper(_0xa36cf7,_0xe9a894,_0x5297cb,_0x24e1f7,_0x2533bc){var _0x4e8336=[_0x6a2c('0x17'),'cm_contacts.scheduledat',_0x6a2c('0x18'),_0x6a2c('0x19'),_0xe9a894+'.'+_0x24e1f7,_0x6a2c('0x1a'),_0x6a2c('0x1b'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x2533bc+'\x22'];return squel[_0x6a2c('0x1c')]()[_0x6a2c('0x1d')]('cm_hopper')['fromQuery']([_0x6a2c('0x1e'),_0x6a2c('0x1f'),_0x6a2c('0x20'),'ListId',_0x24e1f7,_0x6a2c('0x21'),'updatedAt',_0x6a2c('0x22'),_0x6a2c('0x23'),'recallme'],squel[_0x6a2c('0x24')]()[_0x6a2c('0x25')](_0x4e8336)[_0x6a2c('0x12')](_0xe9a894)['join'](_0x6a2c('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0xe9a894+'.CmListId')[_0x6a2c('0x27')](_0x5297cb,null,_0x5297cb+'.id\x20=\x20'+_0xe9a894+'.'+_0x24e1f7)[_0x6a2c('0x14')](_0xe9a894+_0x6a2c('0x28'),_0xa36cf7)[_0x6a2c('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x6a2c('0x29'),selectNotIn(_0xe9a894,_0x5297cb,_0x24e1f7,'cm_hopper',[_0x6a2c('0x2a'),'\x22onlyIfOpen\x22']))[_0x6a2c('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xe9a894,_0x5297cb,_0x24e1f7,'cm_hopper',[_0x6a2c('0x2a')])))['toString']();}function insertCmHopperBlack(_0x195c16,_0x5b4621,_0x2abe04,_0x508e5b){var _0x254936=[_0x6a2c('0x17'),_0x6a2c('0x18'),'cm_contacts.ListId',_0x5b4621+'.'+_0x508e5b,_0x6a2c('0x1a'),_0x6a2c('0x1b')];return squel[_0x6a2c('0x1c')]()[_0x6a2c('0x1d')](_0x6a2c('0x2b'))[_0x6a2c('0x2c')](['phone',_0x6a2c('0x20'),_0x6a2c('0x2d'),_0x508e5b,_0x6a2c('0x21'),_0x6a2c('0x2e')],squel[_0x6a2c('0x24')]()[_0x6a2c('0x25')](_0x254936)[_0x6a2c('0x12')](_0x5b4621)[_0x6a2c('0x27')](_0x6a2c('0x26'),null,_0x6a2c('0x2f')+_0x5b4621+'.CmListId')[_0x6a2c('0x27')](_0x2abe04,null,_0x2abe04+_0x6a2c('0x13')+_0x5b4621+'.'+_0x508e5b)[_0x6a2c('0x14')](_0x5b4621+_0x6a2c('0x28'),_0x195c16)['where'](_0x6a2c('0x30'),NOW)[_0x6a2c('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x6a2c('0x11')]('phone')['from'](_0x6a2c('0x2b'))[_0x6a2c('0x14')](_0x6a2c('0x31'),_0x195c16)[_0x6a2c('0x14')](_0x508e5b+_0x6a2c('0x32'),_0x5b4621+'.'+_0x508e5b)))[_0x6a2c('0x33')]();}function insertCmContact(_0x5b7074,_0xab4fd2,_0xdd65de,_0x26c68e){var _0x140fa7=_[_0x6a2c('0x34')](_[_0x6a2c('0x35')](_0x26c68e),[_0x6a2c('0x2d'),_0x6a2c('0x36'),_0x6a2c('0x21'),'updatedAt']);return squel[_0x6a2c('0x1c')]()[_0x6a2c('0x1d')](_0x6a2c('0x26'))['fromQuery'](_0x140fa7,squel[_0x6a2c('0x24')]()[_0x6a2c('0x25')](_0x140fa7)['from'](_0xab4fd2)[_0x6a2c('0x14')]('('+_0xdd65de[_0x6a2c('0x27')](',')+_0x6a2c('0x37'),squel[_0x6a2c('0x24')]()[_0x6a2c('0x25')](_0xdd65de)[_0x6a2c('0x12')](_0x6a2c('0x26'))[_0x6a2c('0x14')](_0x6a2c('0x31'),_0x5b7074))[_0x6a2c('0x14')]('id\x20IN\x20?',squel[_0x6a2c('0x24')]()['field'](_0x6a2c('0x38'),_0x6a2c('0x39'))['from'](_0xab4fd2)['group'](_0xdd65de[_0x6a2c('0x27')](','))))[_0x6a2c('0x33')]();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0xdb15a0){logger[_0x6a2c('0x3a')](_0xdb15a0['message']);process[_0x6a2c('0x3b')](0x1);}function handleError(_0x7fab0f,_0x4996c5){stats[_0x6a2c('0x3c')][_0x6a2c('0x3d')]({'name':_0x4996c5[_0x6a2c('0x3e')],'message':_0x4996c5[_0x6a2c('0x3f')],'row':_0x7fab0f});}function handleQuery(_0x13dae5){logger[_0x6a2c('0x40')](_0x13dae5);return db[_0x6a2c('0x41')]['query'](_0x13dae5)[_0x6a2c('0x42')](function(_0x469c2e){results[_0x6a2c('0x3d')](_0x469c2e);})[_0x6a2c('0x43')](function(_0x3aab6a){logger[_0x6a2c('0x3a')](_0x3aab6a[_0x6a2c('0x3f')]);});}function main(_0x364f1c,_0x14cf57,_0x1e0190,_0x310d99){logger['info'](_0x6a2c('0x44'),_0x364f1c,JSON[_0x6a2c('0x45')](_0x14cf57));process[_0x6a2c('0x46')](_0x6a2c('0x47'));var _0x549c85=_0x14cf57[_0x6a2c('0x48')];var _0x5b9505=_0x14cf57['socket_timestamp'];var _0x4cd846=path[_0x6a2c('0x27')](config[_0x6a2c('0x49')],_0x6a2c('0x4a'),_0x5b9505+'.csv');var _0x4af8d4=_[_0x6a2c('0x35')](_0x549c85)[_0x6a2c('0x27')]();logger[_0x6a2c('0x40')](_0x6a2c('0x4b'),_0x4af8d4);fs[_0x6a2c('0x4c')](_0x4cd846,_0x4af8d4+'\x0a');Papa[_0x6a2c('0x4d')](fs[_0x6a2c('0x4e')](_0x364f1c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x502c5e,_0x4012f0){try{for(var _0x4969b8=0x0,_0xaa71c8=[];_0x4969b8<_0x502c5e[_0x6a2c('0x4f')][_0x6a2c('0x50')];_0x4969b8++){stats['rows']+=0x1;if(_0x502c5e[_0x6a2c('0x3c')][_0x4969b8]){handleError(_0x502c5e[_0x6a2c('0x4f')][_0x4969b8],_0x502c5e['errors'][_0x4969b8]);}else{var _0x19d6f6=[];for(var _0x186ec2 in _0x549c85){if(_0x549c85[_0x6a2c('0x51')](_0x186ec2)){if(_0x502c5e[_0x6a2c('0x4f')][_0x4969b8][_0x549c85[_0x186ec2]]){var _0x1729e2=_[_0x6a2c('0x52')](_0x502c5e[_0x6a2c('0x4f')][_0x4969b8][_0x549c85[_0x186ec2]][_0x6a2c('0x53')](/"/g,'\x27'));switch(_0x186ec2){case _0x6a2c('0x1f'):var _0x35e6af=moment(_0x1729e2,_0x6a2c('0xf'),!![]);if(_0x35e6af[_0x6a2c('0x54')]()){_0xaa71c8[_0x6a2c('0x3d')]('\x22'+_0x1729e2+'\x22');}else{_0x19d6f6[_0x6a2c('0x3d')](_0x6a2c('0x55'));}break;case _0x6a2c('0x22'):var _0x517a85=parseInt(_0x1729e2);_0x1729e2=_[_0x6a2c('0x56')](_0x517a85)||_0x517a85<0x0||_0x517a85>0x4?_0x310d99?0x3:0x2:_0x517a85;_0xaa71c8[_0x6a2c('0x3d')]('\x22'+_0x1729e2+'\x22');break;case _0x6a2c('0x23'):var _0x3df08f=parseInt(_0x1729e2);if(_[_0x6a2c('0x57')](_0x3df08f)&&_[_0x6a2c('0x58')](_0x1e0190,_0x3df08f)){_0xaa71c8[_0x6a2c('0x3d')]('\x22'+_0x3df08f+'\x22');}else{_0x19d6f6[_0x6a2c('0x3d')](_0x6a2c('0x59'));}break;case _0x6a2c('0x5a'):if(isEmail(_0x1729e2)){_0xaa71c8[_0x6a2c('0x3d')]('\x22'+_0x1729e2+'\x22');}else{_0x19d6f6[_0x6a2c('0x3d')](_0x6a2c('0x5b'));}break;case _0x6a2c('0x5c'):var _0x1a97cc=moment(_0x1729e2,_0x6a2c('0x5d'),!![]);if(_0x1a97cc['isValid']()){_0xaa71c8[_0x6a2c('0x3d')]('\x22'+_0x1729e2+'\x22');}else{_0x19d6f6[_0x6a2c('0x3d')](_0x6a2c('0x5e'));}break;default:_0xaa71c8['push']('\x22'+_0x1729e2+'\x22');}}else{switch(_0x186ec2){case _0x6a2c('0x5f'):case _0x6a2c('0x1e'):_0x19d6f6[_0x6a2c('0x3d')](_0x186ec2+_0x6a2c('0x60'));break;default:_0xaa71c8[_0x6a2c('0x3d')]('\x22\x22');}}}}if(_0x19d6f6[_0x6a2c('0x50')]){handleError(_0x502c5e[_0x6a2c('0x4f')][_0x4969b8],{'code':_0x6a2c('0x61'),'message':_0x19d6f6[_0x6a2c('0x27')]()});}else{fs[_0x6a2c('0x62')](_0x4cd846,_0xaa71c8[_0x6a2c('0x27')]()+'\x0a');}_0xaa71c8=[];}if(!(stats[_0x6a2c('0x63')]%0xc8)){socket['emit']('contact:import:'+_0x5b9505,stats);stats[_0x6a2c('0x3c')]=[];}}if(stopped){logger[_0x6a2c('0x40')](_0x6a2c('0x64'));_0x4012f0[_0x6a2c('0x65')]();}}catch(_0x38cb7f){handleError(_0x502c5e['data'][_0x4969b8],{'code':'SystemError','message':_0x38cb7f[_0x6a2c('0x3f')]});logger[_0x6a2c('0x3a')](_0x6a2c('0x66'),_0x38cb7f[_0x6a2c('0x3f')]);}},'complete':function(){try{var _0x25eb93=[];var _0x5cd68c=_0x6a2c('0x26');if(_0x14cf57[_0x6a2c('0x67')]&&_0x14cf57['duplicates'][_0x6a2c('0x50')]){_0x5cd68c=_0x6a2c('0x68')+_0x5b9505;_0x25eb93[_0x6a2c('0x3d')](_0x6a2c('0x69')+_0x5cd68c+_0x6a2c('0x6a'));}var _0x416d2b=util['format'](_0x6a2c('0x6b'),_0x4cd846,_0x5cd68c,_0x4af8d4,_0x14cf57[_0x6a2c('0x2d')],_0x14cf57['CompanyId']||null,NOW,NOW);if(_[_0x6a2c('0x6c')](_0x549c85[_0x6a2c('0x1f')])){_0x416d2b+=_0x6a2c('0x6d');}_0x25eb93[_0x6a2c('0x3d')](_0x416d2b);if(_0x14cf57[_0x6a2c('0x67')]&&_0x14cf57[_0x6a2c('0x67')][_0x6a2c('0x50')]){_0x25eb93[_0x6a2c('0x3d')](insertCmContact(_0x14cf57[_0x6a2c('0x2d')],_0x5cd68c,_0x14cf57[_0x6a2c('0x67')],_0x549c85));_0x25eb93[_0x6a2c('0x3d')](_0x6a2c('0x6e')+_0x5cd68c+';');}_0x25eb93[_0x6a2c('0x3d')](insertCmHopper(_0x14cf57[_0x6a2c('0x2d')],_0x6a2c('0x6f'),_0x6a2c('0x70'),_0x6a2c('0x71'),_0x310d99));_0x25eb93[_0x6a2c('0x3d')](insertCmHopperBlack(_0x14cf57[_0x6a2c('0x2d')],'voice_queues_has_cm_blacklists',_0x6a2c('0x70'),_0x6a2c('0x71')));_0x25eb93['push'](insertCmHopper(_0x14cf57[_0x6a2c('0x2d')],_0x6a2c('0x72'),_0x6a2c('0x73'),'CampaignId',_0x310d99));_0x25eb93[_0x6a2c('0x3d')](insertCmHopperBlack(_0x14cf57['ListId'],'campaigns_has_cm_blacklists','campaigns',_0x6a2c('0x74')));BPromise[_0x6a2c('0x75')](_0x25eb93,handleQuery)[_0x6a2c('0x76')](function(_0x212945){stats[_0x6a2c('0x77')]=!![];stats[_0x6a2c('0x78')]=_0x14cf57['duplicates']&&_0x14cf57[_0x6a2c('0x67')][_0x6a2c('0x50')]?results[0x2][_0x6a2c('0x78')]:results[0x0][_0x6a2c('0x78')];socket[_0x6a2c('0x79')](_0x6a2c('0x7a')+_0x5b9505,stats);fs[_0x6a2c('0x7b')](_0x364f1c);fs[_0x6a2c('0x7b')](_0x4cd846);process[_0x6a2c('0x3b')](0x0);})['catch'](function(_0x526751){logger[_0x6a2c('0x3a')](_0x526751[_0x6a2c('0x3f')]);process[_0x6a2c('0x3b')](0x1);});}catch(_0x351557){logger['error'](_0x6a2c('0x7c'),_0x351557[_0x6a2c('0x3f')]);process['exit'](0x1);}},'error':function(_0x3ae63b,_0xa6b40a,_0x36d5ce,_0xedd98d){throw new Error(_0xedd98d);}});}function validate(){if(process['argv']&&process[_0x6a2c('0x7d')][_0x6a2c('0x50')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0xf1f06e=path[_0x6a2c('0x27')](config[_0x6a2c('0x49')],'server/files/tmp',process['argv'][0x2]);if(!fs['existsSync'](_0xf1f06e)){throw new Error(_0x6a2c('0x7e'));}var _0x2dbdcb={};try{_0x2dbdcb=JSON[_0x6a2c('0x4d')](process[_0x6a2c('0x7d')][0x3]);if(!_0x2dbdcb['binding']){throw new Error(_0x6a2c('0x7f'));}if(!_0x2dbdcb['binding'][_0x6a2c('0x1e')]){throw new Error(_0x6a2c('0x80'));}if(!_0x2dbdcb['binding'][_0x6a2c('0x5f')]){throw new Error(_0x6a2c('0x81'));}var _0x2835eb=0x0;if(_0x2dbdcb[_0x6a2c('0x48')]['UserId']){_0x2835eb=0x1;}if(!_0x2dbdcb[_0x6a2c('0x2d')]){throw new Error(_0x6a2c('0x82'));}}catch(_0x2e5bf6){throw new Error(_0x6a2c('0x83'));}var _0x202591=[];try{_0x202591=_[_0x6a2c('0x84')](JSON[_0x6a2c('0x4d')](process[_0x6a2c('0x7d')][0x4]),'id');}catch(_0x96980d){logger['info'](_0x6a2c('0x85'));}main(_0xf1f06e,_0x2dbdcb,_0x202591,_0x2835eb);}validate();process['on'](_0x6a2c('0x86'),handleStop);process['on'](_0x6a2c('0x87'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 2713a2b..9b46876 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 _0x09df=['destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','Date','Answer\x20Time','answertime','Complete\x20Time','Duration','billableseconds','getSubjects','toLowerCase','inbound','push','variable','outbound','string','Outbound\x20Call','destcalleridnum','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','calleridname','destexten','Queue','queue','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name'];(function(_0x1a6aec,_0x35567b){var _0x52420d=function(_0x214652){while(--_0x214652){_0x1a6aec['push'](_0x1a6aec['shift']());}};_0x52420d(++_0x35567b);}(_0x09df,0x164));var _0xf09d=function(_0x22ffbf,_0x16f31e){_0x22ffbf=_0x22ffbf-0x0;var _0x360c17=_0x09df[_0x22ffbf];return _0x360c17;};'use strict';exports[_0xf09d('0x0')]=function(_0x28fd89,_0x4f828c){var _0x401dac=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x28fd89[_0xf09d('0x1')]()){case'voice':switch(_0x4f828c['toLowerCase']()){case _0xf09d('0x2'):_0x401dac[_0xf09d('0x3')]({'type':'variable','content':'','variableName':'queue'});_0x401dac['push']({'type':_0xf09d('0x4'),'content':'','variableName':'calleridnum'});break;case _0xf09d('0x5'):_0x401dac[_0xf09d('0x3')]({'type':_0xf09d('0x6'),'content':_0xf09d('0x7'),'variableName':null});_0x401dac[_0xf09d('0x3')]({'type':_0xf09d('0x4'),'content':'','variableName':_0xf09d('0x8')});break;}}return _0x401dac;};exports['getDescriptions']=function(_0x404322,_0x227a55){var _0x56a961=[];switch(_0x404322[_0xf09d('0x1')]()){case'voice':switch(_0x227a55[_0xf09d('0x1')]()){case _0xf09d('0x2'):_0x56a961=[{'type':_0xf09d('0x6'),'content':_0xf09d('0x9'),'key':null,'keyType':null,'variableName':null},{'type':_0xf09d('0xa'),'content':'','key':_0xf09d('0xb'),'keyType':_0xf09d('0x4'),'variableName':_0xf09d('0xc')},{'type':_0xf09d('0xa'),'content':'','key':'Caller\x20Name','keyType':_0xf09d('0x4'),'variableName':_0xf09d('0xd')},{'type':_0xf09d('0xa'),'content':'','key':'Call\x20To','keyType':'variable','variableName':_0xf09d('0xe')},{'type':_0xf09d('0xa'),'content':'','key':_0xf09d('0xf'),'keyType':'variable','variableName':_0xf09d('0x10')},{'type':'keyValue','content':'','key':_0xf09d('0x11'),'keyType':_0xf09d('0x4'),'variableName':_0xf09d('0x12')},{'type':_0xf09d('0xa'),'content':'','key':'Date','keyType':_0xf09d('0x4'),'variableName':_0xf09d('0x13')},{'type':_0xf09d('0x6'),'content':_0xf09d('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0xf09d('0xa'),'content':'','key':_0xf09d('0x15'),'keyType':'variable','variableName':_0xf09d('0x16')},{'type':'keyValue','content':'','key':_0xf09d('0x17'),'keyType':_0xf09d('0x4'),'variableName':_0xf09d('0x8')},{'type':_0xf09d('0x6'),'content':_0xf09d('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xf09d('0xa'),'content':'','key':'Agent\x20Ring','keyType':_0xf09d('0x4'),'variableName':_0xf09d('0x13')},{'type':_0xf09d('0xa'),'content':'','key':_0xf09d('0x19'),'keyType':_0xf09d('0x4'),'variableName':_0xf09d('0x1a')},{'type':_0xf09d('0xa'),'content':'','key':_0xf09d('0x1b'),'keyType':'variable','variableName':_0xf09d('0x1c')},{'type':'keyValue','content':'','key':_0xf09d('0x1d'),'keyType':'variable','variableName':_0xf09d('0x1e')},{'type':_0xf09d('0xa'),'content':'','key':_0xf09d('0x1f'),'keyType':_0xf09d('0x4'),'variableName':_0xf09d('0x20')}];break;case _0xf09d('0x5'):_0x56a961=[{'type':'string','content':_0xf09d('0x9'),'variableName':null},{'type':_0xf09d('0xa'),'content':'','key':_0xf09d('0x21'),'keyType':'variable','keyContent':'','variableName':'destcalleridnum'},{'type':'keyValue','content':'','key':_0xf09d('0x22'),'keyType':_0xf09d('0x4'),'keyContent':'','variableName':_0xf09d('0x23')},{'type':_0xf09d('0xa'),'content':'','key':_0xf09d('0x11'),'keyType':_0xf09d('0x4'),'keyContent':'','variableName':_0xf09d('0x12')},{'type':'keyValue','content':'','key':_0xf09d('0x24'),'keyType':'variable','keyContent':'','variableName':'starttime'},{'type':_0xf09d('0x6'),'content':_0xf09d('0x18')},{'type':'keyValue','content':'','key':_0xf09d('0x25'),'keyType':_0xf09d('0x4'),'keyContent':'','variableName':_0xf09d('0x26')},{'type':'keyValue','content':'','key':_0xf09d('0x27'),'keyType':_0xf09d('0x4'),'keyContent':'','variableName':'endtime'},{'type':_0xf09d('0xa'),'content':'','key':_0xf09d('0x28'),'keyType':'variable','keyContent':'','variableName':'duration'},{'type':_0xf09d('0xa'),'content':'','key':'Billable\x20Time','keyType':'variable','keyContent':'','variableName':_0xf09d('0x29')}];break;}}return _0x56a961;}; \ No newline at end of file +var _0xd757=['billableseconds','getSubjects','toLowerCase','voice','inbound','push','variable','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','getDescriptions','keyValue','Caller\x20Number','Caller\x20Name','calleridname','destexten','Queue','queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','membername','starttime','endtime','Duration','Billable\x20Time'];(function(_0x3bd2ee,_0x191017){var _0x5b8b20=function(_0x5dadbc){while(--_0x5dadbc){_0x3bd2ee['push'](_0x3bd2ee['shift']());}};_0x5b8b20(++_0x191017);}(_0xd757,0x1e5));var _0x7d75=function(_0x4da5c5,_0x2af705){_0x4da5c5=_0x4da5c5-0x0;var _0x2a1b43=_0xd757[_0x4da5c5];return _0x2a1b43;};'use strict';exports[_0x7d75('0x0')]=function(_0x1e83a6,_0xe5c184){var _0x6dc326=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x1e83a6[_0x7d75('0x1')]()){case _0x7d75('0x2'):switch(_0xe5c184['toLowerCase']()){case _0x7d75('0x3'):_0x6dc326[_0x7d75('0x4')]({'type':_0x7d75('0x5'),'content':'','variableName':'queue'});_0x6dc326['push']({'type':_0x7d75('0x5'),'content':'','variableName':_0x7d75('0x6')});break;case _0x7d75('0x7'):_0x6dc326[_0x7d75('0x4')]({'type':_0x7d75('0x8'),'content':_0x7d75('0x9'),'variableName':null});_0x6dc326[_0x7d75('0x4')]({'type':_0x7d75('0x5'),'content':'','variableName':_0x7d75('0xa')});break;}}return _0x6dc326;};exports[_0x7d75('0xb')]=function(_0x1222b3,_0x3043fc){var _0x2ac971=[];switch(_0x1222b3['toLowerCase']()){case'voice':switch(_0x3043fc[_0x7d75('0x1')]()){case _0x7d75('0x3'):_0x2ac971=[{'type':_0x7d75('0x8'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x7d75('0xc'),'content':'','key':_0x7d75('0xd'),'keyType':'variable','variableName':_0x7d75('0x6')},{'type':_0x7d75('0xc'),'content':'','key':_0x7d75('0xe'),'keyType':_0x7d75('0x5'),'variableName':_0x7d75('0xf')},{'type':_0x7d75('0xc'),'content':'','key':'Call\x20To','keyType':_0x7d75('0x5'),'variableName':_0x7d75('0x10')},{'type':_0x7d75('0xc'),'content':'','key':_0x7d75('0x11'),'keyType':_0x7d75('0x5'),'variableName':_0x7d75('0x12')},{'type':'keyValue','content':'','key':_0x7d75('0x13'),'keyType':'variable','variableName':_0x7d75('0x14')},{'type':_0x7d75('0xc'),'content':'','key':_0x7d75('0x15'),'keyType':_0x7d75('0x5'),'variableName':_0x7d75('0x16')},{'type':_0x7d75('0x8'),'content':_0x7d75('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x7d75('0xc'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':_0x7d75('0x18')},{'type':_0x7d75('0xc'),'content':'','key':_0x7d75('0x19'),'keyType':_0x7d75('0x5'),'variableName':'destcalleridnum'},{'type':_0x7d75('0x8'),'content':_0x7d75('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x7d75('0xc'),'content':'','key':_0x7d75('0x1b'),'keyType':_0x7d75('0x5'),'variableName':_0x7d75('0x16')},{'type':_0x7d75('0xc'),'content':'','key':_0x7d75('0x1c'),'keyType':_0x7d75('0x5'),'variableName':_0x7d75('0x1d')},{'type':_0x7d75('0xc'),'content':'','key':_0x7d75('0x1e'),'keyType':_0x7d75('0x5'),'variableName':_0x7d75('0x1f')},{'type':_0x7d75('0xc'),'content':'','key':_0x7d75('0x20'),'keyType':_0x7d75('0x5'),'variableName':_0x7d75('0x21')},{'type':'keyValue','content':'','key':_0x7d75('0x22'),'keyType':_0x7d75('0x5'),'variableName':'talktime'}];break;case _0x7d75('0x7'):_0x2ac971=[{'type':'string','content':_0x7d75('0x23'),'variableName':null},{'type':_0x7d75('0xc'),'content':'','key':_0x7d75('0x24'),'keyType':_0x7d75('0x5'),'keyContent':'','variableName':_0x7d75('0xa')},{'type':'keyValue','content':'','key':_0x7d75('0x25'),'keyType':_0x7d75('0x5'),'keyContent':'','variableName':_0x7d75('0x26')},{'type':_0x7d75('0xc'),'content':'','key':_0x7d75('0x13'),'keyType':_0x7d75('0x5'),'keyContent':'','variableName':'uniqueid'},{'type':_0x7d75('0xc'),'content':'','key':_0x7d75('0x15'),'keyType':_0x7d75('0x5'),'keyContent':'','variableName':_0x7d75('0x27')},{'type':_0x7d75('0x8'),'content':_0x7d75('0x1a')},{'type':_0x7d75('0xc'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':'answertime'},{'type':_0x7d75('0xc'),'content':'','key':'Complete\x20Time','keyType':_0x7d75('0x5'),'keyContent':'','variableName':_0x7d75('0x28')},{'type':_0x7d75('0xc'),'content':'','key':_0x7d75('0x29'),'keyType':_0x7d75('0x5'),'keyContent':'','variableName':'duration'},{'type':_0x7d75('0xc'),'content':'','key':_0x7d75('0x2a'),'keyType':_0x7d75('0x5'),'keyContent':'','variableName':_0x7d75('0x2b')}];break;}}return _0x2ac971;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index b8cd291..96f3a4d 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 _0x19ca=['omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','Interaction','findOne','then','update','info','catch','error','tracked','user','query','body'];(function(_0x794754,_0x49f3eb){var _0xdbcfe=function(_0x3ba8b9){while(--_0x3ba8b9){_0x794754['push'](_0x794754['shift']());}};_0xdbcfe(++_0x49f3eb);}(_0x19ca,0x17e));var _0xa19c=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x19ca[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xa19c('0x0'));var db=require(_0xa19c('0x1'))['db'];var loggers={'openchannel':require(_0xa19c('0x2'))(_0xa19c('0x3')),'mail':require(_0xa19c('0x2'))('mail-interactions'),'fax':require('../../config/logger')(_0xa19c('0x4')),'sms':require(_0xa19c('0x2'))(_0xa19c('0x5')),'chat':require(_0xa19c('0x2'))(_0xa19c('0x6'))};function getInteractionId(_0xc36218,_0x103bdd,_0xa4da3c){if(_0xc36218&&_0xc36218[_['upperFirst'](_0xa4da3c)+'InteractionId']){return _0xc36218[_['upperFirst'](_0xa4da3c)+_0xa19c('0x7')];}else if(_0xc36218&&_0xc36218['id']){return _0xc36218['id'];}else if(_0x103bdd&&_0x103bdd['id']){return _0x103bdd['id'];}else{return _0xa19c('0x8');}}function log(_0x365d70,_0xe3fbbf,_0x14d072,_0x531018,_0x30cced,_0x173aa4){loggers[_0x30cced['toLowerCase']()][_0x365d70](_0xa19c('0x9'),_0x173aa4[_0xa19c('0xa')](),_0xe3fbbf?_0xe3fbbf['id']:null,_0xe3fbbf?_0xe3fbbf['name']:null,_0xe3fbbf?_0xe3fbbf[_0xa19c('0xb')]:null,getInteractionId(_0x14d072,_0x531018,_0x30cced),_0x14d072?JSON[_0xa19c('0xc')](_0x14d072):'null');}function updateUser(_0x398287,_0x534a68,_0x3e0eb6,_0x3fae46,_0x1d79a5){db[_['upperFirst'](_0x3fae46)+_0xa19c('0xd')][_0xa19c('0xe')]({'where':{'id':getInteractionId(_0x534a68,_0x3e0eb6,_0x3fae46)}})[_0xa19c('0xf')](function(_0x8d7d9b){if(_0x8d7d9b){return _0x8d7d9b[_0xa19c('0x10')]({'UserId':_0x398287?_0x398287['id']:null});}})[_0xa19c('0xf')](function(_0x3534d4){if(_0x3534d4){log(_0xa19c('0x11'),_0x398287,_0x534a68,_0x3e0eb6,_0x3fae46,_0x1d79a5);}})[_0xa19c('0x12')](function(){log(_0xa19c('0x13'),_0x398287,_0x534a68,_0x3e0eb6,_0x3fae46,_0x1d79a5);});}exports[_0xa19c('0x14')]=function(_0x10784a,_0xba6f20){return function(_0x6c3020,_0x2e007b,_0x3cbbc7){var _0x1d0145=_0x6c3020[_0xa19c('0x15')];var _0x4ccbe0={};var _0xc4e613=_0x6c3020[_0xa19c('0x16')];if(_0x4ccbe0){_0x4ccbe0=_['clone'](_0x6c3020[_0xa19c('0x17')]);_0x4ccbe0=_[_0xa19c('0x18')](_0x4ccbe0,[_0xa19c('0x17'),_0xa19c('0x19'),_0xa19c('0x1a'),_0xa19c('0x1b'),_0xa19c('0x1c')]);}updateUser(_0x1d0145,_0x4ccbe0,_0xc4e613,_0x10784a,_0xba6f20);_0x3cbbc7(null);};}; \ No newline at end of file +var _0x8d91=['name','role','null','Interaction','then','update','info','catch','user','clone','body','omit','html','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase'];(function(_0x27f659,_0x310468){var _0x44e556=function(_0x169603){while(--_0x169603){_0x27f659['push'](_0x27f659['shift']());}};_0x44e556(++_0x310468);}(_0x8d91,0xd3));var _0x18d9=function(_0x21dd1a,_0x599d4e){_0x21dd1a=_0x21dd1a-0x0;var _0x3b452e=_0x8d91[_0x21dd1a];return _0x3b452e;};'use strict';var _=require(_0x18d9('0x0'));var db=require(_0x18d9('0x1'))['db'];var loggers={'openchannel':require(_0x18d9('0x2'))(_0x18d9('0x3')),'mail':require(_0x18d9('0x2'))(_0x18d9('0x4')),'fax':require(_0x18d9('0x2'))(_0x18d9('0x5')),'sms':require(_0x18d9('0x2'))('sms-interactions'),'chat':require(_0x18d9('0x2'))(_0x18d9('0x6'))};function getInteractionId(_0x53cbbb,_0x2c0e87,_0x4c4516){if(_0x53cbbb&&_0x53cbbb[_[_0x18d9('0x7')](_0x4c4516)+_0x18d9('0x8')]){return _0x53cbbb[_[_0x18d9('0x7')](_0x4c4516)+_0x18d9('0x8')];}else if(_0x53cbbb&&_0x53cbbb['id']){return _0x53cbbb['id'];}else if(_0x2c0e87&&_0x2c0e87['id']){return _0x2c0e87['id'];}else{return _0x18d9('0x9');}}function log(_0x2fa657,_0x1f98a0,_0xa85755,_0x3a190b,_0x30a6d4,_0x207245){loggers[_0x30a6d4[_0x18d9('0xa')]()][_0x2fa657](_0x18d9('0xb'),_0x207245[_0x18d9('0xc')](),_0x1f98a0?_0x1f98a0['id']:null,_0x1f98a0?_0x1f98a0[_0x18d9('0xd')]:null,_0x1f98a0?_0x1f98a0[_0x18d9('0xe')]:null,getInteractionId(_0xa85755,_0x3a190b,_0x30a6d4),_0xa85755?JSON['stringify'](_0xa85755):_0x18d9('0xf'));}function updateUser(_0x14ecee,_0x234000,_0x42ebeb,_0x56b6e3,_0x201cab){db[_[_0x18d9('0x7')](_0x56b6e3)+_0x18d9('0x10')]['findOne']({'where':{'id':getInteractionId(_0x234000,_0x42ebeb,_0x56b6e3)}})[_0x18d9('0x11')](function(_0x21347b){if(_0x21347b){return _0x21347b[_0x18d9('0x12')]({'UserId':_0x14ecee?_0x14ecee['id']:null});}})['then'](function(_0x501a7e){if(_0x501a7e){log(_0x18d9('0x13'),_0x14ecee,_0x234000,_0x42ebeb,_0x56b6e3,_0x201cab);}})[_0x18d9('0x14')](function(){log('error',_0x14ecee,_0x234000,_0x42ebeb,_0x56b6e3,_0x201cab);});}exports['tracked']=function(_0xa5f5f7,_0x42d6a7){return function(_0xf87f0d,_0xc9c81e,_0x5b1702){var _0x4fde4e=_0xf87f0d[_0x18d9('0x15')];var _0x1aa30d={};var _0x3e643d=_0xf87f0d['query'];if(_0x1aa30d){_0x1aa30d=_[_0x18d9('0x16')](_0xf87f0d[_0x18d9('0x17')]);_0x1aa30d=_[_0x18d9('0x18')](_0x1aa30d,['body',_0x18d9('0x19'),'phone',_0x18d9('0x1a'),_0x18d9('0x1b')]);}updateUser(_0x4fde4e,_0x1aa30d,_0x3e643d,_0xa5f5f7,_0x42d6a7);_0x5b1702(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 3f8ffc8..2a4acc9 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 _0x7e75=['split','createDecipher','%s:%s:%s','update','base64','utf8','final','hasOwnProperty','use','License','then','status','json','format','catch','users','admin','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license'];(function(_0xe8415e,_0x58d22f){var _0x31cc36=function(_0x248073){while(--_0x248073){_0xe8415e['push'](_0xe8415e['shift']());}};_0x31cc36(++_0x58d22f);}(_0x7e75,0x171));var _0x57e7=function(_0x487693,_0x5f1edd){_0x487693=_0x487693-0x0;var _0x33c2cb=_0x7e75[_0x487693];return _0x33c2cb;};'use strict';var crypto=require(_0x57e7('0x0'));var util=require(_0x57e7('0x1'));var compose=require('composable-middleware');var db=require(_0x57e7('0x2'))['db'];var config=require(_0x57e7('0x3'));function getValueFromLicense(_0x4e1365,_0x328c31){if(_0x4e1365&&_0x328c31){if(_0x328c31[_0x57e7('0x4')]&&_0x328c31[_0x57e7('0x5')]){var _0x18eb0e=_0x328c31[_0x57e7('0x4')];var _0x4e363f=_0x328c31[_0x57e7('0x5')];var _0x28034b=_0x18eb0e[_0x57e7('0x6')]('-')[0x4];var _0x5e3ffc=_0x18eb0e[_0x57e7('0x6')]('-')[0x0];var _0x543d56=crypto[_0x57e7('0x7')]('aes-256-ctr',util['format'](_0x57e7('0x8'),_0x28034b,_0x18eb0e,_0x5e3ffc));var _0x709982=_0x543d56[_0x57e7('0x9')](_0x4e363f,_0x57e7('0xa'),_0x57e7('0xb'));_0x709982+=_0x543d56[_0x57e7('0xc')]('utf8');var _0x4c2827=JSON['parse'](_0x709982);return _0x4c2827[_0x57e7('0xd')](_0x4e1365)?_0x4c2827[_0x4e1365]:null;}}return null;}function isLimit(_0x4e7c5a,_0x29c3c5,_0x3e342b,_0x4e14){var _0x43ff77=_0x29c3c5;return compose()[_0x57e7('0xe')](function(_0x4f7f44,_0x5e5d20,_0x4f93e5){return db[_0x57e7('0xf')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x57e7('0x10')](function(_0x54c9c1){var _0x176e80=getValueFromLicense(_0x4e7c5a,_0x54c9c1);return _0x176e80?_0x176e80:_0x43ff77;})[_0x57e7('0x10')](function(_0x1a541e){_0x43ff77=_0x1a541e;return _0x3e342b['count'](_0x4e14);})['then'](function(_0x79c078){if(_0x79c078>=_0x43ff77){return _0x5e5d20[_0x57e7('0x11')](0x193)[_0x57e7('0x12')]({'message':util[_0x57e7('0x13')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x4e7c5a)});}_0x4f93e5();})[_0x57e7('0x14')](function(_0x217980){_0x4f93e5(_0x217980);});});}function isUserLimit(){return isLimit(_0x57e7('0x15'),0x1,db['User'],{'where':{'$or':[{'role':_0x57e7('0x16')},{'role':_0x57e7('0x17')}]}});}exports[_0x57e7('0x18')]=isUserLimit; \ No newline at end of file +var _0x7ffa=['admin','isUserLimit','crypto','util','composable-middleware','../../mysqldb','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','catch','users','User'];(function(_0x48accc,_0x3142e9){var _0x460cc4=function(_0x4af897){while(--_0x4af897){_0x48accc['push'](_0x48accc['shift']());}};_0x460cc4(++_0x3142e9);}(_0x7ffa,0xc6));var _0xa7ff=function(_0x5b6995,_0x1d47a0){_0x5b6995=_0x5b6995-0x0;var _0x455d14=_0x7ffa[_0x5b6995];return _0x455d14;};'use strict';var crypto=require(_0xa7ff('0x0'));var util=require(_0xa7ff('0x1'));var compose=require(_0xa7ff('0x2'));var db=require(_0xa7ff('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x40029b,_0x314c4c){if(_0x40029b&&_0x314c4c){if(_0x314c4c[_0xa7ff('0x4')]&&_0x314c4c[_0xa7ff('0x5')]){var _0xf5cac8=_0x314c4c['data1'];var _0x1593da=_0x314c4c[_0xa7ff('0x5')];var _0x1bfdb7=_0xf5cac8[_0xa7ff('0x6')]('-')[0x4];var _0x5d999f=_0xf5cac8['split']('-')[0x0];var _0x2150d2=crypto[_0xa7ff('0x7')]('aes-256-ctr',util[_0xa7ff('0x8')](_0xa7ff('0x9'),_0x1bfdb7,_0xf5cac8,_0x5d999f));var _0x110514=_0x2150d2[_0xa7ff('0xa')](_0x1593da,_0xa7ff('0xb'),_0xa7ff('0xc'));_0x110514+=_0x2150d2[_0xa7ff('0xd')](_0xa7ff('0xc'));var _0x59d2c1=JSON[_0xa7ff('0xe')](_0x110514);return _0x59d2c1[_0xa7ff('0xf')](_0x40029b)?_0x59d2c1[_0x40029b]:null;}}return null;}function isLimit(_0x3352d2,_0x1c668f,_0x59ce7c,_0x52fbc2){var _0x2395e7=_0x1c668f;return compose()[_0xa7ff('0x10')](function(_0x30b6a8,_0x9b049b,_0x35034c){return db[_0xa7ff('0x11')][_0xa7ff('0x12')]({'where':{'id':0x1},'raw':!![]})[_0xa7ff('0x13')](function(_0x158798){var _0xb46198=getValueFromLicense(_0x3352d2,_0x158798);return _0xb46198?_0xb46198:_0x2395e7;})[_0xa7ff('0x13')](function(_0x19b38f){_0x2395e7=_0x19b38f;return _0x59ce7c[_0xa7ff('0x14')](_0x52fbc2);})[_0xa7ff('0x13')](function(_0x1202ea){if(_0x1202ea>=_0x2395e7){return _0x9b049b[_0xa7ff('0x15')](0x193)[_0xa7ff('0x16')]({'message':util[_0xa7ff('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x3352d2)});}_0x35034c();})[_0xa7ff('0x17')](function(_0x2b1a96){_0x35034c(_0x2b1a96);});});}function isUserLimit(){return isLimit(_0xa7ff('0x18'),0x1,db[_0xa7ff('0x19')],{'where':{'$or':[{'role':_0xa7ff('0x1a')},{'role':'user'}]}});}exports[_0xa7ff('0x1b')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 7381086..589a066 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 _0x4913=['length','omit','isObject','isString','unset','hasOwnProperty','isNumeric','^[0-9]*$','moment','sequelize','isEmpty','isArray','parse','split','limit','offset','sort','indexOf','priority','cast','unsigned','substr','DESC','ASC'];(function(_0x326a69,_0x2d8749){var _0x37d9e9=function(_0x3a88c2){while(--_0x3a88c2){_0x326a69['push'](_0x326a69['shift']());}};_0x37d9e9(++_0x2d8749);}(_0x4913,0x170));var _0x3491=function(_0xd094b1,_0x195363){_0xd094b1=_0xd094b1-0x0;var _0x1d661d=_0x4913[_0xd094b1];return _0x1d661d;};'use strict';var _=require('lodash');var moment=require(_0x3491('0x0'));var sequelize=require(_0x3491('0x1'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x34a2ea){var _0x238d98=null;if(_0x34a2ea){_0x238d98=_0x34a2ea['split'](',');}return _0x238d98;};exports['filters']=function(_0x31afeb){var _0x32e6c5={};if(!_[_0x3491('0x2')](_0x31afeb)){_0x32e6c5={};_['forOwn'](_0x31afeb,function(_0x4dc4ad,_0x58d6ae){try{_0x32e6c5[_0x58d6ae]=_[_0x3491('0x3')](_0x4dc4ad)?_0x4dc4ad:JSON[_0x3491('0x4')](_0x4dc4ad);}catch(_0x3ce5dd){_0x32e6c5[_0x58d6ae]=_0x4dc4ad[_0x3491('0x5')](',');}});}return _0x32e6c5;};exports[_0x3491('0x6')]=function(_0x2383be){_0x2383be=parseInt(_0x2383be,0xa);if(!_0x2383be||_0x2383be<0x0){_0x2383be=LIMIT_VALUE;}return _0x2383be;};exports[_0x3491('0x7')]=function(_0x145037){_0x145037=parseInt(_0x145037,0xa);if(!_0x145037||_0x145037<0x0){_0x145037=0x0;}return _0x145037;};exports[_0x3491('0x8')]=function(_0x145768){var _0x33d016,_0x1fe1eb=null;if(_0x145768){_0x33d016=_0x145768[_0x3491('0x5')](',');_0x1fe1eb=_['map'](_0x33d016,function(_0x2b62f2){if(_0x2b62f2[_0x3491('0x9')]('-')===0x0){return[_0x2b62f2===_0x3491('0xa')?sequelize[_0x3491('0xb')](sequelize['col'](_0x3491('0xa')),_0x3491('0xc')):_0x2b62f2[_0x3491('0xd')](0x1),_0x3491('0xe')];}else{return[_0x2b62f2===_0x3491('0xa')?sequelize['cast'](sequelize['col'](_0x3491('0xa')),_0x3491('0xc')):_0x2b62f2,_0x3491('0xf')];}});}return _0x1fe1eb;};exports['omit']=function(_0x14934c,_0x50ed1a){if(_[_0x3491('0x2')](_0x14934c)){return _0x14934c;}if(_[_0x3491('0x3')](_0x14934c)){for(var _0x52834e=0x0;_0x52834e<_0x14934c[_0x3491('0x10')];_0x52834e+=0x1){_0x14934c[_0x52834e]=this[_0x3491('0x11')](_0x14934c[_0x52834e],_0x50ed1a);}return _0x14934c;}if(!_[_0x3491('0x12')](_0x14934c)){return _0x14934c;}if(_[_0x3491('0x13')](_0x50ed1a)){_0x50ed1a=[_0x50ed1a];}if(!_['isArray'](_0x50ed1a)){return _0x14934c;}for(var _0x133fd4=0x0;_0x133fd4<_0x50ed1a[_0x3491('0x10')];_0x133fd4+=0x1){_[_0x3491('0x14')](_0x14934c,_0x50ed1a[_0x133fd4]);}for(var _0x4f44cd in _0x14934c){if(_0x14934c[_0x3491('0x15')](_0x4f44cd)){_0x14934c[_0x4f44cd]=this[_0x3491('0x11')](_0x14934c[_0x4f44cd],_0x50ed1a);}}return _0x14934c;};exports[_0x3491('0x16')]=function(_0x120c88){return _0x120c88['match'](RegExp(_0x3491('0x17')))?!![]:![];};exports['isEmail']=function(_0x3ba130){return _0x3ba130['match'](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file +var _0x11f6=['parse','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','length','isObject','isString','unset','isNumeric','match','^[0-9]*$','isEmail','lodash','moment','sequelize','fields','split','filters','isEmpty','forOwn','isArray'];(function(_0x3d7a9f,_0x24e0f1){var _0x13f5f1=function(_0x1fbbda){while(--_0x1fbbda){_0x3d7a9f['push'](_0x3d7a9f['shift']());}};_0x13f5f1(++_0x24e0f1);}(_0x11f6,0x105));var _0x611f=function(_0x210fae,_0xa38d90){_0x210fae=_0x210fae-0x0;var _0x14a749=_0x11f6[_0x210fae];return _0x14a749;};'use strict';var _=require(_0x611f('0x0'));var moment=require(_0x611f('0x1'));var sequelize=require(_0x611f('0x2'));var LIMIT_VALUE=0xfa;exports[_0x611f('0x3')]=function(_0x5befc3){var _0x38ba71=null;if(_0x5befc3){_0x38ba71=_0x5befc3[_0x611f('0x4')](',');}return _0x38ba71;};exports[_0x611f('0x5')]=function(_0x3336e4){var _0x503f60={};if(!_[_0x611f('0x6')](_0x3336e4)){_0x503f60={};_[_0x611f('0x7')](_0x3336e4,function(_0xf177b9,_0x2ba9cc){try{_0x503f60[_0x2ba9cc]=_[_0x611f('0x8')](_0xf177b9)?_0xf177b9:JSON[_0x611f('0x9')](_0xf177b9);}catch(_0x5c76a7){_0x503f60[_0x2ba9cc]=_0xf177b9[_0x611f('0x4')](',');}});}return _0x503f60;};exports['limit']=function(_0x4f3a60){_0x4f3a60=parseInt(_0x4f3a60,0xa);if(!_0x4f3a60||_0x4f3a60<0x0){_0x4f3a60=LIMIT_VALUE;}return _0x4f3a60;};exports[_0x611f('0xa')]=function(_0x5a22fb){_0x5a22fb=parseInt(_0x5a22fb,0xa);if(!_0x5a22fb||_0x5a22fb<0x0){_0x5a22fb=0x0;}return _0x5a22fb;};exports[_0x611f('0xb')]=function(_0x481b0e){var _0x4691a4,_0x3efedd=null;if(_0x481b0e){_0x4691a4=_0x481b0e[_0x611f('0x4')](',');_0x3efedd=_[_0x611f('0xc')](_0x4691a4,function(_0x3ec337){if(_0x3ec337[_0x611f('0xd')]('-')===0x0){return[_0x3ec337===_0x611f('0xe')?sequelize[_0x611f('0xf')](sequelize[_0x611f('0x10')](_0x611f('0xe')),_0x611f('0x11')):_0x3ec337[_0x611f('0x12')](0x1),_0x611f('0x13')];}else{return[_0x3ec337===_0x611f('0xe')?sequelize[_0x611f('0xf')](sequelize[_0x611f('0x10')](_0x611f('0xe')),'unsigned'):_0x3ec337,_0x611f('0x14')];}});}return _0x3efedd;};exports[_0x611f('0x15')]=function(_0xca007e,_0x198d0a){if(_[_0x611f('0x6')](_0xca007e)){return _0xca007e;}if(_[_0x611f('0x8')](_0xca007e)){for(var _0x597e7d=0x0;_0x597e7d<_0xca007e[_0x611f('0x16')];_0x597e7d+=0x1){_0xca007e[_0x597e7d]=this['omit'](_0xca007e[_0x597e7d],_0x198d0a);}return _0xca007e;}if(!_[_0x611f('0x17')](_0xca007e)){return _0xca007e;}if(_[_0x611f('0x18')](_0x198d0a)){_0x198d0a=[_0x198d0a];}if(!_['isArray'](_0x198d0a)){return _0xca007e;}for(var _0x225f76=0x0;_0x225f76<_0x198d0a[_0x611f('0x16')];_0x225f76+=0x1){_[_0x611f('0x19')](_0xca007e,_0x198d0a[_0x225f76]);}for(var _0x560df8 in _0xca007e){if(_0xca007e['hasOwnProperty'](_0x560df8)){_0xca007e[_0x560df8]=this['omit'](_0xca007e[_0x560df8],_0x198d0a);}}return _0xca007e;};exports[_0x611f('0x1a')]=function(_0x9471f5){return _0x9471f5[_0x611f('0x1b')](RegExp(_0x611f('0x1c')))?!![]:![];};exports[_0x611f('0x1d')]=function(_0x34f56c){return _0x34f56c[_0x611f('0x1b')](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index a1af67b..d66f9ec 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['toISOString','engine','html','view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','use','join','root','public','favicon.ico','set','appPath','client'];(function(_0xe5874a,_0x309ebb){var _0x27ae36=function(_0x1f9d7f){while(--_0x1f9d7f){_0xe5874a['push'](_0xe5874a['shift']());}};_0x27ae36(++_0x309ebb);}(_0xe706,0xa3));var _0x6e70=function(_0x44b346,_0xeb097d){_0x44b346=_0x44b346-0x0;var _0x1c2f2b=_0xe706[_0x44b346];return _0x1c2f2b;};'use strict';var express=require(_0x6e70('0x0'));var favicon=require(_0x6e70('0x1'));var bodyParser=require(_0x6e70('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x6e70('0x3'));var errorHandler=require(_0x6e70('0x4'));var path=require(_0x6e70('0x5'));var passport=require(_0x6e70('0x6'));var cors=require(_0x6e70('0x7'));var moment=require(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var db=require(_0x6e70('0xa'))['db'];exports[_0x6e70('0xb')]=function(_0x4381d1){var _0x36357b=_0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'));if(_0x36357b===_0x6e70('0xe')){_0x4381d1[_0x6e70('0xf')](favicon(path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x12'),_0x6e70('0x13'))));_0x4381d1[_0x6e70('0x14')](_0x6e70('0x15'),path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x12')));}if(_0x36357b==='development'||_0x36357b==='test'){_0x4381d1[_0x6e70('0xf')](favicon(path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x16'),_0x6e70('0x13'))));_0x4381d1[_0x6e70('0x14')](_0x6e70('0x15'),path[_0x6e70('0x10')](config['root'],'client'));_0x4381d1['use'](errorHandler());}_0x4381d1[_0x6e70('0x14')]('json\x20replacer',function(_0x53aed0,_0x304716){if(this[_0x53aed0]instanceof Date){_0x304716=this[_0x53aed0][_0x6e70('0x17')]()['split']('.')[0x0]+'Z';}return _0x304716;});_0x4381d1[_0x6e70('0xf')](express['static'](_0x4381d1[_0x6e70('0xc')](_0x6e70('0x15'))));_0x4381d1['set']('views',config[_0x6e70('0x11')]+'/server/views');_0x4381d1[_0x6e70('0x18')](_0x6e70('0x19'),require('ejs')['renderFile']);_0x4381d1[_0x6e70('0x14')](_0x6e70('0x1a'),_0x6e70('0x19'));_0x4381d1[_0x6e70('0xf')](bodyParser[_0x6e70('0x1b')]({'limit':_0x6e70('0x1c'),'extended':!![]}));_0x4381d1[_0x6e70('0xf')](bodyParser[_0x6e70('0x1d')]({'limit':_0x6e70('0x1c')}));_0x4381d1[_0x6e70('0xf')](cors());_0x4381d1['use'](methodOverride());_0x4381d1[_0x6e70('0xf')](cookieParser());_0x4381d1[_0x6e70('0xf')](passport[_0x6e70('0x1e')]());}; \ No newline at end of file +var _0xe706=['toISOString','engine','html','view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','use','join','root','public','favicon.ico','set','appPath','client'];(function(_0x2913ca,_0x4a3200){var _0x5ed4c3=function(_0x1bbe91){while(--_0x1bbe91){_0x2913ca['push'](_0x2913ca['shift']());}};_0x5ed4c3(++_0x4a3200);}(_0xe706,0xa3));var _0x6e70=function(_0xe16fcf,_0x2b5918){_0xe16fcf=_0xe16fcf-0x0;var _0x5981e9=_0xe706[_0xe16fcf];return _0x5981e9;};'use strict';var express=require(_0x6e70('0x0'));var favicon=require(_0x6e70('0x1'));var bodyParser=require(_0x6e70('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x6e70('0x3'));var errorHandler=require(_0x6e70('0x4'));var path=require(_0x6e70('0x5'));var passport=require(_0x6e70('0x6'));var cors=require(_0x6e70('0x7'));var moment=require(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var db=require(_0x6e70('0xa'))['db'];exports[_0x6e70('0xb')]=function(_0x4381d1){var _0x36357b=_0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'));if(_0x36357b===_0x6e70('0xe')){_0x4381d1[_0x6e70('0xf')](favicon(path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x12'),_0x6e70('0x13'))));_0x4381d1[_0x6e70('0x14')](_0x6e70('0x15'),path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x12')));}if(_0x36357b==='development'||_0x36357b==='test'){_0x4381d1[_0x6e70('0xf')](favicon(path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x16'),_0x6e70('0x13'))));_0x4381d1[_0x6e70('0x14')](_0x6e70('0x15'),path[_0x6e70('0x10')](config['root'],'client'));_0x4381d1['use'](errorHandler());}_0x4381d1[_0x6e70('0x14')]('json\x20replacer',function(_0x53aed0,_0x304716){if(this[_0x53aed0]instanceof Date){_0x304716=this[_0x53aed0][_0x6e70('0x17')]()['split']('.')[0x0]+'Z';}return _0x304716;});_0x4381d1[_0x6e70('0xf')](express['static'](_0x4381d1[_0x6e70('0xc')](_0x6e70('0x15'))));_0x4381d1['set']('views',config[_0x6e70('0x11')]+'/server/views');_0x4381d1[_0x6e70('0x18')](_0x6e70('0x19'),require('ejs')['renderFile']);_0x4381d1[_0x6e70('0x14')](_0x6e70('0x1a'),_0x6e70('0x19'));_0x4381d1[_0x6e70('0xf')](bodyParser[_0x6e70('0x1b')]({'limit':_0x6e70('0x1c'),'extended':!![]}));_0x4381d1[_0x6e70('0xf')](bodyParser[_0x6e70('0x1d')]({'limit':_0x6e70('0x1c')}));_0x4381d1[_0x6e70('0xf')](cors());_0x4381d1['use'](methodOverride());_0x4381d1[_0x6e70('0xf')](cookieParser());_0x4381d1[_0x6e70('0xf')](passport[_0x6e70('0x1e')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 36bcc61..17f4196 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 _0x432b=['family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','orderBy','map','model','createHash','md5','digest','hex','getUuid','platform','win32','replace','hostname','macAddress','ipAddress','substring','lodash','bimedia-machine-uuid','child_process','execSync','keys','length','filter'];(function(_0x20097d,_0x22c6e7){var _0x290d45=function(_0x39a077){while(--_0x39a077){_0x20097d['push'](_0x20097d['shift']());}};_0x290d45(++_0x22c6e7);}(_0x432b,0x161));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb432('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xb432('0x1'));var exec=require(_0xb432('0x2'))[_0xb432('0x3')];function getInterfaces(){var _0xee80f1=[];var _0x5173f6=os['networkInterfaces']();var _0x93e722=_['orderBy'](_[_0xb432('0x4')](_0x5173f6));for(var _0x5cb510=0x0;_0x5cb510<_0x93e722[_0xb432('0x5')];_0x5cb510++){var _0x3f1a78=_0x5173f6[_0x93e722[_0x5cb510]][_0xb432('0x6')](function(_0x45f857){return _0x45f857[_0xb432('0x7')]===_0xb432('0x8')&&_0x45f857[_0xb432('0x9')]===![];});_0xee80f1=_0xee80f1[_0xb432('0xa')](_0x3f1a78);}return _0xee80f1;}function getFirstInterface(){var _0x4e4302=_[_0xb432('0xb')](getInterfaces());return{'macAddress':_0x4e4302&&_0x4e4302[_0xb432('0xc')]?_0x4e4302[_0xb432('0xc')]:_0xb432('0xd'),'ipAddress':_0x4e4302&&_0x4e4302[_0xb432('0xe')]?_0x4e4302[_0xb432('0xe')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x3c1a43=_[_0xb432('0xf')](os['cpus']()[_0xb432('0x10')](function(_0x323ae9){return _0x323ae9[_0xb432('0x11')];}))['join'](':');return crypto[_0xb432('0x12')](_0xb432('0x13'))['update'](_0x3c1a43)[_0xb432('0x14')](_0xb432('0x15'));}exports[_0xb432('0x16')]=function(){switch(os[_0xb432('0x17')]()){case _0xb432('0x18'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0xb432('0x19')]('\x0d\x0a','');default:var _0x15bff1=getFirstInterface();var _0x2a1dd7=getCPUhash();var _0x26068a=_0x2a1dd7+'|'+os[_0xb432('0x1a')]()+'|'+_0x15bff1[_0xb432('0x1b')]+'|'+_0x15bff1[_0xb432('0x1c')];var _0x1686a1=crypto[_0xb432('0x12')](_0xb432('0x13'))['update'](_0x26068a)['digest'](_0xb432('0x15'));return _0x1686a1[_0xb432('0x1d')](0x0,0x8)+'-'+_0x1686a1[_0xb432('0x1d')](0x8,0xc)+'-'+_0x1686a1[_0xb432('0x1d')](0xc,0x10)+'-'+_0x1686a1['substring'](0x10,0x14)+'-'+_0x1686a1[_0xb432('0x1d')](0x14);}}; \ No newline at end of file +var _0xa93e=['child_process','networkInterfaces','keys','length','filter','IPv4','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','md5','update','digest','hex','getUuid','platform','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','createHash','substring','bimedia-machine-uuid'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xa93e,0x1df));var _0xea93=function(_0x348b96,_0x343026){_0x348b96=_0x348b96-0x0;var _0x2c37d2=_0xa93e[_0x348b96];return _0x2c37d2;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0xea93('0x0'));var exec=require(_0xea93('0x1'))['execSync'];function getInterfaces(){var _0xd64380=[];var _0x50af65=os[_0xea93('0x2')]();var _0x5b5341=_['orderBy'](_[_0xea93('0x3')](_0x50af65));for(var _0x17d49b=0x0;_0x17d49b<_0x5b5341[_0xea93('0x4')];_0x17d49b++){var _0x26def3=_0x50af65[_0x5b5341[_0x17d49b]][_0xea93('0x5')](function(_0x3d53bd){return _0x3d53bd['family']===_0xea93('0x6')&&_0x3d53bd['internal']===![];});_0xd64380=_0xd64380['concat'](_0x26def3);}return _0xd64380;}function getFirstInterface(){var _0x5ae34b=_[_0xea93('0x7')](getInterfaces());return{'macAddress':_0x5ae34b&&_0x5ae34b[_0xea93('0x8')]?_0x5ae34b['mac']:_0xea93('0x9'),'ipAddress':_0x5ae34b&&_0x5ae34b[_0xea93('0xa')]?_0x5ae34b['address']:_0xea93('0xb')};}exports[_0xea93('0xc')]=getFirstInterface;function getCPUhash(){var _0xa45e13=_[_0xea93('0xd')](os[_0xea93('0xe')]()[_0xea93('0xf')](function(_0x515cb9){return _0x515cb9[_0xea93('0x10')];}))['join'](':');return crypto['createHash'](_0xea93('0x11'))[_0xea93('0x12')](_0xa45e13)[_0xea93('0x13')](_0xea93('0x14'));}exports[_0xea93('0x15')]=function(){switch(os[_0xea93('0x16')]()){case'win32':return exec(_0xea93('0x17'),{'encoding':'utf8'})[_0xea93('0x18')]('\x0d\x0a','');default:var _0x30ee47=getFirstInterface();var _0x10e447=getCPUhash();var _0x3e912c=_0x10e447+'|'+os[_0xea93('0x19')]()+'|'+_0x30ee47[_0xea93('0x1a')]+'|'+_0x30ee47[_0xea93('0x1b')];var _0x29a548=crypto[_0xea93('0x1c')](_0xea93('0x11'))[_0xea93('0x12')](_0x3e912c)[_0xea93('0x13')](_0xea93('0x14'));return _0x29a548['substring'](0x0,0x8)+'-'+_0x29a548[_0xea93('0x1d')](0x8,0xc)+'-'+_0x29a548['substring'](0xc,0x10)+'-'+_0x29a548[_0xea93('0x1d')](0x10,0x14)+'-'+_0x29a548[_0xea93('0x1d')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index f56e97c..a14b95b 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 _0xc14a=['moment','request-promise','bluebird','version','../../mysqldb','./hardware','license','../../api/jira/jira.controller','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','GET','catch','createCipher','secrets','update','utf8','base64','aes-256-ctr','session','final','User','findOne','admin','fullname','email','|reason|','|uuid|','|name|','then','getFirstInterface','ipAddress','openIssue','Motion\x20License\x20Alert','get','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','data1','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','DEMO\x20START\x20AT\x20%s','error','message','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','crypto'];(function(_0x154584,_0x421e12){var _0x969074=function(_0x17303b){while(--_0x17303b){_0x154584['push'](_0x154584['shift']());}};_0x969074(++_0x421e12);}(_0xc14a,0xa9));var _0xac14=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xc14a[_0x1facfa];return _0x9ec701;};'use strict';var util=require(_0xac14('0x0'));var crypto=require(_0xac14('0x1'));var moment=require(_0xac14('0x2'));var rp=require(_0xac14('0x3'));var BPromise=require(_0xac14('0x4'));var pkginfo=require('pkginfo')(module,_0xac14('0x5'));var db=require(_0xac14('0x6'))['db'];var config=require('../environment');var hardware=require(_0xac14('0x7'));var logger=require('../logger')(_0xac14('0x8'));var jira=require(_0xac14('0x9'));var HOST=_0xac14('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x59a627){return new BPromise(function(_0x1fff1f,_0x1783be){var _0x257a68=util['format'](_0xac14('0xb'),HOST,_0x59a627,module[_0xac14('0xc')][_0xac14('0x5')]);if(oldToken){_0x257a68=util[_0xac14('0xd')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x59a627,module[_0xac14('0xc')]['version'],oldToken);}var _0x85ed98={'uri':_0x257a68,'method':_0xac14('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x85ed98)['then'](function(_0x517651){_0x1fff1f(_0x517651);})[_0xac14('0xf')](function(_0x463462){_0x1783be(_0x463462);});});}function encryptDate(_0x52096b){var _0x11d522=crypto[_0xac14('0x10')]('aes-256-ctr',config[_0xac14('0x11')]['session']);var _0x3562c8=_0x11d522[_0xac14('0x12')](_0x52096b,_0xac14('0x13'),'base64');_0x3562c8+=_0x11d522['final'](_0xac14('0x14'));return _0x3562c8;}function decryptDate(_0x5c00df){var _0xe50537=crypto['createDecipher'](_0xac14('0x15'),config[_0xac14('0x11')][_0xac14('0x16')]);var _0x22cb60=_0xe50537[_0xac14('0x12')](_0x5c00df,'base64',_0xac14('0x13'));_0x22cb60+=_0xe50537[_0xac14('0x17')](_0xac14('0x13'));return _0x22cb60;}function sendJiraAlert(_0x1682b1,_0x28d0d0,_0x15fc09){var _0x159e85='||FIELD||VALUE||\x0a';return db[_0xac14('0x18')][_0xac14('0x19')]({'where':{'role':_0xac14('0x1a')},'attributes':[_0xac14('0x1b'),_0xac14('0x1c')],'raw':!![]})['then'](function(_0x4daacc){ADMIN=_0x4daacc;_0x159e85+=_0xac14('0x1d')+_0x15fc09+'|\x0a';_0x159e85+=_0xac14('0x1e')+_0x1682b1+'|\x0a';_0x159e85+='|machineUuid|'+_0x28d0d0+'|\x0a';_0x159e85+=_0xac14('0x1f')+ADMIN['fullname']+'|\x0a';_0x159e85+='|email|'+ADMIN['email']+'|\x0a';return _0x159e85;})[_0xac14('0x20')](function(_0x4c6580){var _0x1b863e=hardware[_0xac14('0x21')]()[_0xac14('0x22')];return jira[_0xac14('0x23')]({'key':'MOTLICENSE','summary':_0xac14('0x24'),'description':_0x4c6580,'issuetype':'Alert','oldToken':_0x1682b1,'newToken':_0x28d0d0,'email':ADMIN[_0xac14('0x1c')],'name':ADMIN[_0xac14('0x1b')],'reason':GRAY_PERIOD_REASON,'ip':_0x1b863e});});}function manageLicense(_0x536eb3,_0xeb26c2){var _0x34f641=_0xeb26c2[_0xac14('0x25')]({'plain':!![]});httpRequest(_0x536eb3)[_0xac14('0x20')](function(_0x3b2d2c){if(oldToken){oldToken=undefined;}if(_0x3b2d2c[_0xac14('0x26')]){if(!_0x34f641['license']&&_0x34f641[_0xac14('0x8')]!=_0x3b2d2c['license']||_0x34f641['license']&&_0x34f641['data2']){logger[_0xac14('0x27')](_0xac14('0x28'));}if(_0x34f641[_0xac14('0x8')]&&!_0x34f641['data2']&&_0x34f641['license']!=_0x3b2d2c['license']){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x34f641[_0xac14('0x8')]&&!_0x34f641[_0xac14('0x29')]&&_0x34f641[_0xac14('0x8')]==_0x3b2d2c[_0xac14('0x8')]){return _0xeb26c2;}return _0xeb26c2[_0xac14('0x12')]({'data1':_0x536eb3,'data2':null,'license':_0x3b2d2c['license']});}else{if(_0x3b2d2c[_0xac14('0x8')]||_0x34f641['license']){if(!_0x34f641[_0xac14('0x29')]){if(_0x34f641[_0xac14('0x2a')]==_0x536eb3){GRAY_PERIOD_REASON=_0xac14('0x2b');logger[_0xac14('0x27')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xac14('0x2c');oldToken=_0x34f641[_0xac14('0x2a')];logger[_0xac14('0x27')](_0xac14('0x2d'),_0x34f641[_0xac14('0x2a')],_0x536eb3);}sendJiraAlert(_0x34f641[_0xac14('0x2a')],_0x3b2d2c['uuid'],GRAY_PERIOD_REASON);logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xac14('0x2e')](),moment()[_0xac14('0xd')](_0xac14('0x2f')));return _0xeb26c2[_0xac14('0x12')]({'data2':encryptDate(moment()['format'](_0xac14('0x2f')))});}else{if(moment()[_0xac14('0x30')](decryptDate(_0x34f641[_0xac14('0x29')]),'days')>DAYS){logger[_0xac14('0x27')](_0xac14('0x31'),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0xeb26c2['update']({'data1':_0x536eb3,'data2':null,'license':null});}}}else{if(_0x34f641[_0xac14('0x2a')]!=_0x536eb3){logger[_0xac14('0x27')](_0xac14('0x2d'),_0x34f641[_0xac14('0x2a')],_0x536eb3);return _0xeb26c2[_0xac14('0x12')]({'data1':_0x536eb3,'data2':null,'license':null});}}}return _0xeb26c2;})[_0xac14('0x20')](function(_0xc99555){_0xeb26c2=_0xc99555;})[_0xac14('0xf')](function(_0x4ce01e){logger[_0xac14('0x32')](_0x4ce01e[_0xac14('0x33')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xac14('0x34')](),_0xeb26c2);},TIME);});}function defaultLicense(){var _0x321b20=hardware[_0xac14('0x34')]();if(_0x321b20){return db[_0xac14('0x35')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x321b20}})[_0xac14('0x36')](function(_0x33b5bf,_0x296644){logger[_0xac14('0x27')](_0xac14('0x37'),_0x321b20);manageLicense(_0x321b20,_0x33b5bf);})['catch'](function(_0x397329){logger[_0xac14('0x32')](_0x397329[_0xac14('0x33')]);});}}exports[_0xac14('0x38')]=defaultLicense; \ No newline at end of file +var _0x676c=['version','../../mysqldb','../environment','./hardware','license','../../api/jira/jira.controller','https://www.xcallymotion.com','exports','catch','createCipher','aes-256-ctr','secrets','session','update','utf8','final','base64','User','findOne','admin','fullname','email','then','|reason|','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','YYYY-MM-DD\x20HH:mm','format','days','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','crypto','moment','bluebird','pkginfo'];(function(_0x665870,_0x42ab57){var _0x317721=function(_0x1f3792){while(--_0x1f3792){_0x665870['push'](_0x665870['shift']());}};_0x317721(++_0x42ab57);}(_0x676c,0x198));var _0xc676=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x676c[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xc676('0x0'));var crypto=require(_0xc676('0x1'));var moment=require(_0xc676('0x2'));var rp=require('request-promise');var BPromise=require(_0xc676('0x3'));var pkginfo=require(_0xc676('0x4'))(module,_0xc676('0x5'));var db=require(_0xc676('0x6'))['db'];var config=require(_0xc676('0x7'));var hardware=require(_0xc676('0x8'));var logger=require('../logger')(_0xc676('0x9'));var jira=require(_0xc676('0xa'));var HOST=_0xc676('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x2c7510){return new BPromise(function(_0x36fa26,_0x4a71a8){var _0x26ad9c=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x2c7510,module[_0xc676('0xc')][_0xc676('0x5')]);if(oldToken){_0x26ad9c=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x2c7510,module[_0xc676('0xc')][_0xc676('0x5')],oldToken);}var _0x16a4d4={'uri':_0x26ad9c,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x16a4d4)['then'](function(_0xee69aa){_0x36fa26(_0xee69aa);})[_0xc676('0xd')](function(_0x318cfd){_0x4a71a8(_0x318cfd);});});}function encryptDate(_0x1e06ec){var _0x5e8565=crypto[_0xc676('0xe')](_0xc676('0xf'),config[_0xc676('0x10')][_0xc676('0x11')]);var _0x47adff=_0x5e8565[_0xc676('0x12')](_0x1e06ec,_0xc676('0x13'),'base64');_0x47adff+=_0x5e8565[_0xc676('0x14')]('base64');return _0x47adff;}function decryptDate(_0x59deda){var _0x2ea1e0=crypto['createDecipher']('aes-256-ctr',config['secrets'][_0xc676('0x11')]);var _0x4ee99d=_0x2ea1e0[_0xc676('0x12')](_0x59deda,_0xc676('0x15'),_0xc676('0x13'));_0x4ee99d+=_0x2ea1e0[_0xc676('0x14')](_0xc676('0x13'));return _0x4ee99d;}function sendJiraAlert(_0x215ea6,_0x4f0269,_0x24e92b){var _0x289ed9='||FIELD||VALUE||\x0a';return db[_0xc676('0x16')][_0xc676('0x17')]({'where':{'role':_0xc676('0x18')},'attributes':[_0xc676('0x19'),_0xc676('0x1a')],'raw':!![]})[_0xc676('0x1b')](function(_0x474ad2){ADMIN=_0x474ad2;_0x289ed9+=_0xc676('0x1c')+_0x24e92b+'|\x0a';_0x289ed9+='|uuid|'+_0x215ea6+'|\x0a';_0x289ed9+='|machineUuid|'+_0x4f0269+'|\x0a';_0x289ed9+='|name|'+ADMIN[_0xc676('0x19')]+'|\x0a';_0x289ed9+='|email|'+ADMIN[_0xc676('0x1a')]+'|\x0a';return _0x289ed9;})['then'](function(_0x54389a){var _0x3b55c5=hardware['getFirstInterface']()[_0xc676('0x1d')];return jira[_0xc676('0x1e')]({'key':_0xc676('0x1f'),'summary':_0xc676('0x20'),'description':_0x54389a,'issuetype':_0xc676('0x21'),'oldToken':_0x215ea6,'newToken':_0x4f0269,'email':ADMIN['email'],'name':ADMIN[_0xc676('0x19')],'reason':GRAY_PERIOD_REASON,'ip':_0x3b55c5});});}function manageLicense(_0x24f330,_0x2f474a){var _0x56215c=_0x2f474a[_0xc676('0x22')]({'plain':!![]});httpRequest(_0x24f330)['then'](function(_0x260d98){if(oldToken){oldToken=undefined;}if(_0x260d98[_0xc676('0x23')]){if(!_0x56215c['license']&&_0x56215c[_0xc676('0x9')]!=_0x260d98[_0xc676('0x9')]||_0x56215c['license']&&_0x56215c[_0xc676('0x24')]){logger[_0xc676('0x25')](_0xc676('0x26'));}if(_0x56215c['license']&&!_0x56215c[_0xc676('0x24')]&&_0x56215c[_0xc676('0x9')]!=_0x260d98[_0xc676('0x9')]){logger[_0xc676('0x25')](_0xc676('0x27'));}if(_0x56215c['license']&&!_0x56215c[_0xc676('0x24')]&&_0x56215c[_0xc676('0x9')]==_0x260d98[_0xc676('0x9')]){return _0x2f474a;}return _0x2f474a[_0xc676('0x12')]({'data1':_0x24f330,'data2':null,'license':_0x260d98[_0xc676('0x9')]});}else{if(_0x260d98['license']||_0x56215c[_0xc676('0x9')]){if(!_0x56215c[_0xc676('0x24')]){if(_0x56215c[_0xc676('0x28')]==_0x24f330){GRAY_PERIOD_REASON=_0xc676('0x29');logger['info'](_0xc676('0x2a'));}else{GRAY_PERIOD_REASON=_0xc676('0x2b');oldToken=_0x56215c[_0xc676('0x28')];logger[_0xc676('0x25')](_0xc676('0x2c'),_0x56215c[_0xc676('0x28')],_0x24f330);}sendJiraAlert(_0x56215c[_0xc676('0x28')],_0x260d98[_0xc676('0x2d')],GRAY_PERIOD_REASON);logger[_0xc676('0x25')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0xc676('0x2e')));return _0x2f474a[_0xc676('0x12')]({'data2':encryptDate(moment()[_0xc676('0x2f')](_0xc676('0x2e')))});}else{if(moment()['diff'](decryptDate(_0x56215c[_0xc676('0x24')]),_0xc676('0x30'))>DAYS){logger[_0xc676('0x25')](_0xc676('0x31'),moment()[_0xc676('0x2f')](_0xc676('0x2e')));return _0x2f474a['update']({'data1':_0x24f330,'data2':null,'license':null});}}}else{if(_0x56215c['data1']!=_0x24f330){logger[_0xc676('0x25')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x56215c[_0xc676('0x28')],_0x24f330);return _0x2f474a[_0xc676('0x12')]({'data1':_0x24f330,'data2':null,'license':null});}}}return _0x2f474a;})[_0xc676('0x1b')](function(_0x2bb9c3){_0x2f474a=_0x2bb9c3;})['catch'](function(_0x4e80dc){logger['error'](_0x4e80dc[_0xc676('0x32')]);})[_0xc676('0x33')](function(){setTimeout(function(){manageLicense(hardware[_0xc676('0x34')](),_0x2f474a);},TIME);});}function defaultLicense(){var _0x2704b1=hardware[_0xc676('0x34')]();if(_0x2704b1){return db[_0xc676('0x35')][_0xc676('0x36')]({'where':{'id':0x1},'defaults':{'data1':_0x2704b1}})[_0xc676('0x37')](function(_0x112996,_0x45fad7){logger[_0xc676('0x25')](_0xc676('0x38'),_0x2704b1);manageLicense(_0x2704b1,_0x112996);})[_0xc676('0xd')](function(_0x2dcd89){logger[_0xc676('0x39')](_0x2dcd89[_0xc676('0x32')]);});}}exports[_0xc676('0x3a')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index a69f034..fc88736 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 _0x324f=['utf8','final','parse','demo','uuid','getUuid','aes-256-ctr','gray','deadline','add','grayReason','changed','disabled','Breaking\x20license','message','2027-01-01T00:00:00.000Z','Demo\x20license','getLicense','find','checkLicense','crypto','util','lodash','./hardware','../environment','../../mysqldb','License\x20key\x20value\x20not\x20found','data1','split','createDecipher','format','update','base64'];(function(_0x2adfbb,_0x4babd1){var _0x59499e=function(_0x396e26){while(--_0x396e26){_0x2adfbb['push'](_0x2adfbb['shift']());}};_0x59499e(++_0x4babd1);}(_0x324f,0xb9));var _0xf324=function(_0x11345e,_0x4e243a){_0x11345e=_0x11345e-0x0;var _0x40ac8c=_0x324f[_0x11345e];return _0x40ac8c;};'use strict';var crypto=require(_0xf324('0x0'));var util=require(_0xf324('0x1'));var _=require(_0xf324('0x2'));var moment=require('moment');var hardware=require(_0xf324('0x3'));var config=require(_0xf324('0x4'));var db=require(_0xf324('0x5'))['db'];function checkLicense(_0xeae908,_0x151f1c){if(_0xeae908){try{var _0x5c3454=_0x151f1c||_0xeae908['license'];if(_['isEmpty'](_0x5c3454)){throw new Error(_0xf324('0x6'));}var _0x336b58=_0xeae908[_0xf324('0x7')];var _0x2d8a78=_0xeae908['data2'];var _0x2b633f=_0x336b58[_0xf324('0x8')]('-')[0x4];var _0x465a26=_0x336b58[_0xf324('0x8')]('-')[0x0];var _0x8b54a1=crypto[_0xf324('0x9')]('aes-256-ctr',util[_0xf324('0xa')]('%s:%s:%s',_0x2b633f,_0x336b58,_0x465a26));var _0xaf9d1a=_0x8b54a1[_0xf324('0xb')](_0x5c3454,_0xf324('0xc'),_0xf324('0xd'));_0xaf9d1a+=_0x8b54a1[_0xf324('0xe')](_0xf324('0xd'));var _0x1454fd=JSON[_0xf324('0xf')](_0xaf9d1a);_0x1454fd[_0xf324('0x10')]=![];_0x1454fd[_0xf324('0x11')]=_0x336b58;_0x1454fd['machineUuid']=hardware[_0xf324('0x12')]();if(_0x2d8a78){var _0x355a82=crypto[_0xf324('0x9')](_0xf324('0x13'),config['secrets']['session']);var _0x89a1b9=_0x355a82[_0xf324('0xb')](_0x2d8a78,_0xf324('0xc'),_0xf324('0xd'));_0x89a1b9+=_0x355a82['final'](_0xf324('0xd'));_0x1454fd[_0xf324('0x14')]=_0x89a1b9;_0x1454fd[_0xf324('0x15')]=moment(_0x89a1b9)[_0xf324('0x16')](0x7,'days')['format']();_0x1454fd[_0xf324('0x17')]=_0x1454fd[_0xf324('0x11')]!=_0x1454fd['machineUuid']?_0xf324('0x18'):_0xf324('0x19');}return _0x1454fd;}catch(_0x353e0d){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':_0xf324('0x1a'),'uuid':_0xeae908['data1'],'machineUuid':hardware[_0xf324('0x12')](),'message':_0x353e0d[_0xf324('0x1b')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xf324('0x1c'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xf324('0x1d'),'uuid':_0xeae908['data1'],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0xf324('0x1e')]=function(_0x4a427c){return db['License'][_0xf324('0x1f')](_['defaults'](_0x4a427c,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0xed1ad2){return checkLicense(_0xed1ad2,null);});};exports[_0xf324('0x20')]=checkLicense; \ No newline at end of file +var _0xb660=['lodash','moment','../environment','../../mysqldb','License\x20key\x20value\x20not\x20found','data1','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','uuid','getUuid','secrets','final','gray','deadline','machineUuid','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','Demo\x20license','License','find','defaults','then','checkLicense','crypto'];(function(_0x12f7f7,_0x39895e){var _0xdc54b6=function(_0x4ad778){while(--_0x4ad778){_0x12f7f7['push'](_0x12f7f7['shift']());}};_0xdc54b6(++_0x39895e);}(_0xb660,0x83));var _0x0b66=function(_0x1a1b6e,_0x3a07a9){_0x1a1b6e=_0x1a1b6e-0x0;var _0x571e2c=_0xb660[_0x1a1b6e];return _0x571e2c;};'use strict';var crypto=require(_0x0b66('0x0'));var util=require('util');var _=require(_0x0b66('0x1'));var moment=require(_0x0b66('0x2'));var hardware=require('./hardware');var config=require(_0x0b66('0x3'));var db=require(_0x0b66('0x4'))['db'];function checkLicense(_0x2850db,_0x6e2710){if(_0x2850db){try{var _0x9d44f1=_0x6e2710||_0x2850db['license'];if(_['isEmpty'](_0x9d44f1)){throw new Error(_0x0b66('0x5'));}var _0x3a34d6=_0x2850db[_0x0b66('0x6')];var _0x3fd250=_0x2850db['data2'];var _0x35cf1b=_0x3a34d6[_0x0b66('0x7')]('-')[0x4];var _0x1a0512=_0x3a34d6[_0x0b66('0x7')]('-')[0x0];var _0x2cd6d3=crypto['createDecipher'](_0x0b66('0x8'),util[_0x0b66('0x9')](_0x0b66('0xa'),_0x35cf1b,_0x3a34d6,_0x1a0512));var _0x219092=_0x2cd6d3[_0x0b66('0xb')](_0x9d44f1,_0x0b66('0xc'),_0x0b66('0xd'));_0x219092+=_0x2cd6d3['final'](_0x0b66('0xd'));var _0x10e2cf=JSON[_0x0b66('0xe')](_0x219092);_0x10e2cf['demo']=![];_0x10e2cf[_0x0b66('0xf')]=_0x3a34d6;_0x10e2cf['machineUuid']=hardware[_0x0b66('0x10')]();if(_0x3fd250){var _0x1597d1=crypto['createDecipher'](_0x0b66('0x8'),config[_0x0b66('0x11')]['session']);var _0x15a740=_0x1597d1['update'](_0x3fd250,_0x0b66('0xc'),_0x0b66('0xd'));_0x15a740+=_0x1597d1[_0x0b66('0x12')](_0x0b66('0xd'));_0x10e2cf[_0x0b66('0x13')]=_0x15a740;_0x10e2cf[_0x0b66('0x14')]=moment(_0x15a740)['add'](0x7,'days')[_0x0b66('0x9')]();_0x10e2cf['grayReason']=_0x10e2cf[_0x0b66('0xf')]!=_0x10e2cf[_0x0b66('0x15')]?_0x0b66('0x16'):_0x0b66('0x17');}return _0x10e2cf;}catch(_0x3a4a5c){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0b66('0x18'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x0b66('0x19'),'uuid':_0x2850db['data1'],'machineUuid':hardware[_0x0b66('0x10')](),'message':_0x3a4a5c[_0x0b66('0x1a')],'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':_0x0b66('0x1b'),'uuid':_0x2850db[_0x0b66('0x6')],'machineUuid':hardware[_0x0b66('0x10')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports['getLicense']=function(_0x190f63){return db[_0x0b66('0x1c')][_0x0b66('0x1d')](_[_0x0b66('0x1e')](_0x190f63,{'raw':!![],'where':{'id':0x1}}))[_0x0b66('0x1f')](function(_0x3c8440){return checkLicense(_0x3c8440,null);});};exports[_0x0b66('0x20')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 237c5eb..8abbf62 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 _0x4ef4=['myappanuglar-secret','app-id','exports','http://localhost:9000'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4ef4,0x1ce));var _0x44ef=function(_0x55193b,_0x204da0){_0x55193b=_0x55193b-0x0;var _0x295171=_0x4ef4[_0x55193b];return _0x295171;};'use strict';module[_0x44ef('0x0')]={'DOMAIN':_0x44ef('0x1'),'SESSION_SECRET':_0x44ef('0x2'),'GOOGLE_ID':_0x44ef('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0xe5fb=['app-id','secret','exports','http://localhost:9000'];(function(_0x3ea70c,_0x3c97a2){var _0x164ae2=function(_0x4d8bbf){while(--_0x4d8bbf){_0x3ea70c['push'](_0x3ea70c['shift']());}};_0x164ae2(++_0x3c97a2);}(_0xe5fb,0xce));var _0xbe5f=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0xe5fb[_0x5f5cce];return _0x705ecf;};'use strict';module[_0xbe5f('0x0')]={'DOMAIN':_0xbe5f('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xbe5f('0x2'),'GOOGLE_SECRET':_0xbe5f('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 9bc5999..e46f024 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f81=['toUpperCase','message','exports','Logger','transports','File','error','%s-%s','info','Console','debugLevel','moment','winston','util','INFO','join','/var','log','xcally','format','[%s]\x20[%s]\x20%s\x20-\x20%s','level'];(function(_0x2bd941,_0x28204b){var _0x2ea4bb=function(_0x22e4f6){while(--_0x22e4f6){_0x2bd941['push'](_0x2bd941['shift']());}};_0x2ea4bb(++_0x28204b);}(_0x9f81,0x1d9));var _0x19f8=function(_0x5b841b,_0x28b317){_0x5b841b=_0x5b841b-0x0;var _0x22ab3a=_0x9f81[_0x5b841b];return _0x22ab3a;};'use strict';var moment=require(_0x19f8('0x0'));var winston=require(_0x19f8('0x1'));var util=require(_0x19f8('0x2'));var path=require('path');var debugLevel=_0x19f8('0x3');function filename(_0x12b258,_0x19dc43){return path[_0x19f8('0x4')](_0x19f8('0x5'),_0x19f8('0x6'),_0x19f8('0x7'),util[_0x19f8('0x8')]('%s-%s.log',_0x12b258,_0x19dc43));}function formatter(_0x35be07,_0x325282){return util[_0x19f8('0x8')](_0x19f8('0x9'),moment()[_0x19f8('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),_0x325282[_0x19f8('0xa')][_0x19f8('0xb')](),_0x35be07,_0x325282[_0x19f8('0xc')]);}module[_0x19f8('0xd')]=function(_0x503e02){return new winston[(_0x19f8('0xe'))]({'transports':[new winston[(_0x19f8('0xf'))][(_0x19f8('0x10'))]({'name':util[_0x19f8('0x8')]('%s-%s',_0x503e02,_0x19f8('0x11')),'filename':filename(_0x503e02,_0x19f8('0x11')),'level':_0x19f8('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x185780){return formatter(_0x503e02,_0x185780);}}),new winston[(_0x19f8('0xf'))]['File']({'name':util['format'](_0x19f8('0x12'),_0x503e02,_0x19f8('0x13')),'filename':filename(_0x503e02,_0x19f8('0x13')),'level':_0x19f8('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5dc002){return formatter(_0x503e02,_0x5dc002);}}),new winston[(_0x19f8('0xf'))][(_0x19f8('0x14'))]({'level':process['env'][_0x19f8('0x15')]||debugLevel,'json':![],'formatter':function(_0x34c6be){return formatter(_0x503e02,_0x34c6be);}})]});}; \ No newline at end of file +var _0x143c=['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','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel'];(function(_0x3ec3a3,_0x52ccea){var _0x1cbde3=function(_0x1030f5){while(--_0x1030f5){_0x3ec3a3['push'](_0x3ec3a3['shift']());}};_0x1cbde3(++_0x52ccea);}(_0x143c,0xf0));var _0xc143=function(_0x254761,_0x550307){_0x254761=_0x254761-0x0;var _0x4236de=_0x143c[_0x254761];return _0x4236de;};'use strict';var moment=require(_0xc143('0x0'));var winston=require(_0xc143('0x1'));var util=require(_0xc143('0x2'));var path=require(_0xc143('0x3'));var debugLevel=_0xc143('0x4');function filename(_0x59964f,_0x54a975){return path[_0xc143('0x5')](_0xc143('0x6'),_0xc143('0x7'),_0xc143('0x8'),util[_0xc143('0x9')]('%s-%s.log',_0x59964f,_0x54a975));}function formatter(_0x16eae5,_0x21a616){return util[_0xc143('0x9')](_0xc143('0xa'),moment()['format'](_0xc143('0xb')),_0x21a616[_0xc143('0xc')][_0xc143('0xd')](),_0x16eae5,_0x21a616[_0xc143('0xe')]);}module['exports']=function(_0x510230){return new winston[(_0xc143('0xf'))]({'transports':[new winston[(_0xc143('0x10'))][(_0xc143('0x11'))]({'name':util[_0xc143('0x9')](_0xc143('0x12'),_0x510230,_0xc143('0x13')),'filename':filename(_0x510230,_0xc143('0x13')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x11c496){return formatter(_0x510230,_0x11c496);}}),new winston[(_0xc143('0x10'))]['File']({'name':util[_0xc143('0x9')](_0xc143('0x12'),_0x510230,'info'),'filename':filename(_0x510230,_0xc143('0x14')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3c54f3){return formatter(_0x510230,_0x3c54f3);}}),new winston[(_0xc143('0x10'))][(_0xc143('0x15'))]({'level':process[_0xc143('0x16')][_0xc143('0x17')]||debugLevel,'json':![],'formatter':function(_0x54449b){return formatter(_0x510230,_0x54449b);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index cf48e72..0d838d0 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 _0x914c=['ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js'];(function(_0x237845,_0x49efa5){var _0x1bd715=function(_0x274368){while(--_0x274368){_0x237845['push'](_0x237845['shift']());}};_0x1bd715(++_0x49efa5);}(_0x914c,0x122));var _0xc914=function(_0x70504d,_0x34e810){_0x70504d=_0x70504d-0x0;var _0x47e29b=_0x914c[_0x70504d];return _0x47e29b;};'use strict';var path=require(_0xc914('0x0'));var os=require('os');var config={'apps':[{'name':_0xc914('0x1'),'script':path[_0xc914('0x2')](__dirname,_0xc914('0x3'))},{'name':_0xc914('0x4'),'script':path[_0xc914('0x2')](__dirname,_0xc914('0x5'))},{'name':_0xc914('0x6'),'script':path[_0xc914('0x2')](__dirname,_0xc914('0x7'))},{'name':_0xc914('0x8'),'script':path['join'](__dirname,_0xc914('0x9'))},{'name':_0xc914('0xa'),'script':path['join'](__dirname,_0xc914('0xb'))},{'name':'xdr','script':path[_0xc914('0x2')](__dirname,_0xc914('0xc'))}]};module[_0xc914('0xd')]=config; \ No newline at end of file +var _0x3d42=['ami','join','../../services/ami/index.js','agi','email','routing','xdr','../../services/xdr/index.js','path','express','../../services/express/index.js'];(function(_0x334fea,_0x1f1e18){var _0x3c5829=function(_0x4fd6ac){while(--_0x4fd6ac){_0x334fea['push'](_0x334fea['shift']());}};_0x3c5829(++_0x1f1e18);}(_0x3d42,0xb8));var _0x23d4=function(_0x5a4f65,_0x28cece){_0x5a4f65=_0x5a4f65-0x0;var _0x32ab22=_0x3d42[_0x5a4f65];return _0x32ab22;};'use strict';var path=require(_0x23d4('0x0'));var os=require('os');var config={'apps':[{'name':_0x23d4('0x1'),'script':path['join'](__dirname,_0x23d4('0x2'))},{'name':_0x23d4('0x3'),'script':path[_0x23d4('0x4')](__dirname,_0x23d4('0x5'))},{'name':_0x23d4('0x6'),'script':path[_0x23d4('0x4')](__dirname,'../../services/agi/index.js')},{'name':_0x23d4('0x7'),'script':path[_0x23d4('0x4')](__dirname,'../../services/email/index.js')},{'name':_0x23d4('0x8'),'script':path['join'](__dirname,'../../services/routing/index.js')},{'name':_0x23d4('0x9'),'script':path[_0x23d4('0x4')](__dirname,_0x23d4('0xa'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 1b6a3c8..cd4d091 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 _0xedbf=['disconnect','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connected','start','then','stop'];(function(_0x28b224,_0x2482f3){var _0x27fcb6=function(_0x3ede90){while(--_0x3ede90){_0x28b224['push'](_0x28b224['shift']());}};_0x27fcb6(++_0x2482f3);}(_0xedbf,0x103));var _0xfedb=function(_0x35d06a,_0x81abc0){_0x35d06a=_0x35d06a-0x0;var _0x3cf8a5=_0xedbf[_0x35d06a];return _0x3cf8a5;};'use strict';var pm2=require(_0xfedb('0x0'));var BPromise=require(_0xfedb('0x1'));var config=require(_0xfedb('0x2'));function connect(){return new BPromise(function(_0x5bf615,_0x1e3977){return pm2['connect'](function(_0x1622ec){if(_0x1622ec){return _0x1e3977(_0x1622ec);}return _0x5bf615(_0xfedb('0x3'));});});};exports[_0xfedb('0x4')]=function(_0x4ad967){return connect()['then'](function(){return new BPromise(function(_0x2478a5,_0x4ae9d0){return pm2[_0xfedb('0x4')](_0x4ad967,function(_0x5c5d0c,_0x5074bb){if(_0x5c5d0c){return _0x4ae9d0(_0x5c5d0c);}pm2['disconnect']();return _0x2478a5(_0x5074bb);});});});};exports['stop']=function(_0xb81105){return connect()[_0xfedb('0x5')](function(){return new BPromise(function(_0x2156d8,_0x415b70){return pm2[_0xfedb('0x6')](_0xb81105,function(_0x128d4f,_0x516f07){if(_0x128d4f){return _0x415b70(_0x128d4f);}pm2[_0xfedb('0x7')]();return _0x2156d8(_0x516f07);});});});};exports[_0xfedb('0x8')]=function(_0x3c1a0d){return connect()[_0xfedb('0x5')](function(){return new BPromise(function(_0x5df0d0,_0xb90fdb){return pm2[_0xfedb('0x8')](_0x3c1a0d,function(_0x161286,_0x3cedb5){if(_0x161286){return _0xb90fdb(_0x161286);}pm2[_0xfedb('0x7')]();return _0x5df0d0(_0x3cedb5);});});});};exports[_0xfedb('0x9')]=function(){return connect()[_0xfedb('0x5')](function(){return new BPromise(function(_0x49b398,_0x1eb8b6){return pm2[_0xfedb('0x9')](function(_0x3b7f83,_0x1a85f6){if(_0x3b7f83){return _0x1eb8b6(_0x3b7f83);}pm2[_0xfedb('0x7')]();return _0x49b398(_0x1a85f6);});});});};exports[_0xfedb('0xa')]=function(_0x382f28){return connect()[_0xfedb('0x5')](function(){return new BPromise(function(_0x5d7934,_0x22f0d1){return pm2[_0xfedb('0xa')](_0x382f28,function(_0x4a3643,_0x1e523c){if(_0x4a3643){return _0x22f0d1(_0x4a3643);}pm2['disconnect']();return _0x5d7934(_0x1e523c);});});});};exports[_0xfedb('0xb')]=function(_0x22bf6e){return connect()['then'](function(){return new BPromise(function(_0x1f286e,_0x148435){return pm2[_0xfedb('0xb')](_0x22bf6e,function(_0x3cef4b,_0xe2a159){if(_0x3cef4b){return _0x148435(_0x3cef4b);}pm2[_0xfedb('0x7')]();return _0x1f286e(_0xe2a159);});});});};exports[_0xfedb('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x58f578,_0xd7a240){return pm2[_0xfedb('0xc')](function(_0x23415a){if(_0x23415a){return _0xd7a240(_0x23415a);}return _0x58f578(_0xfedb('0xd'));});});});}; \ No newline at end of file +var _0x5af9=['bluebird','./config','connected','start','stop','then','disconnect','restart','list','describe','delete','saved','pm2'];(function(_0x912d27,_0x28e0e3){var _0x31b918=function(_0x1882f7){while(--_0x1882f7){_0x912d27['push'](_0x912d27['shift']());}};_0x31b918(++_0x28e0e3);}(_0x5af9,0xdc));var _0x95af=function(_0x1bd323,_0x1c16ab){_0x1bd323=_0x1bd323-0x0;var _0x13097b=_0x5af9[_0x1bd323];return _0x13097b;};'use strict';var pm2=require(_0x95af('0x0'));var BPromise=require(_0x95af('0x1'));var config=require(_0x95af('0x2'));function connect(){return new BPromise(function(_0x5675a5,_0x2c588a){return pm2['connect'](function(_0x5add9f){if(_0x5add9f){return _0x2c588a(_0x5add9f);}return _0x5675a5(_0x95af('0x3'));});});};exports[_0x95af('0x4')]=function(_0x44f419){return connect()['then'](function(){return new BPromise(function(_0x39c91b,_0xf2e7d9){return pm2[_0x95af('0x4')](_0x44f419,function(_0x15005f,_0x73307d){if(_0x15005f){return _0xf2e7d9(_0x15005f);}pm2['disconnect']();return _0x39c91b(_0x73307d);});});});};exports[_0x95af('0x5')]=function(_0x3fdf1b){return connect()[_0x95af('0x6')](function(){return new BPromise(function(_0xd1486c,_0x4dc1de){return pm2[_0x95af('0x5')](_0x3fdf1b,function(_0x4ec552,_0x35346e){if(_0x4ec552){return _0x4dc1de(_0x4ec552);}pm2[_0x95af('0x7')]();return _0xd1486c(_0x35346e);});});});};exports[_0x95af('0x8')]=function(_0x365d28){return connect()[_0x95af('0x6')](function(){return new BPromise(function(_0x3dec35,_0x464bcf){return pm2[_0x95af('0x8')](_0x365d28,function(_0x5739c7,_0x33074c){if(_0x5739c7){return _0x464bcf(_0x5739c7);}pm2[_0x95af('0x7')]();return _0x3dec35(_0x33074c);});});});};exports[_0x95af('0x9')]=function(){return connect()[_0x95af('0x6')](function(){return new BPromise(function(_0x22b431,_0x324933){return pm2['list'](function(_0x110041,_0x147957){if(_0x110041){return _0x324933(_0x110041);}pm2[_0x95af('0x7')]();return _0x22b431(_0x147957);});});});};exports[_0x95af('0xa')]=function(_0xb7e6a){return connect()[_0x95af('0x6')](function(){return new BPromise(function(_0x31431f,_0x506fa7){return pm2[_0x95af('0xa')](_0xb7e6a,function(_0x10a324,_0x1dee5e){if(_0x10a324){return _0x506fa7(_0x10a324);}pm2[_0x95af('0x7')]();return _0x31431f(_0x1dee5e);});});});};exports[_0x95af('0xb')]=function(_0x1034ec){return connect()[_0x95af('0x6')](function(){return new BPromise(function(_0x5797b7,_0x25ce3e){return pm2['delete'](_0x1034ec,function(_0x4bfecc,_0xd949ca){if(_0x4bfecc){return _0x25ce3e(_0x4bfecc);}pm2[_0x95af('0x7')]();return _0x5797b7(_0xd949ca);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x74d7bd,_0x4d3c96){return pm2['dump'](function(_0xab48e1){if(_0xab48e1){return _0x4d3c96(_0xab48e1);}return _0x74d7bd(_0x95af('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index ad2c351..91bf2f8 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 _0xb82f=['defaults','localhost','socket.io-emitter','Setting','chatTimeout','then','findAll','lastMsgAt','subtract','ChatInteraction','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','catch','start','lodash','moment','ioredis','../../mysqldb','redis'];(function(_0x3e67ee,_0x52fc96){var _0x562d8b=function(_0x524bb6){while(--_0x524bb6){_0x3e67ee['push'](_0x3e67ee['shift']());}};_0x562d8b(++_0x52fc96);}(_0xb82f,0x1f3));var _0xfb82=function(_0x1c1a30,_0xace083){_0x1c1a30=_0x1c1a30-0x0;var _0xdab453=_0xb82f[_0x1c1a30];return _0xdab453;};'use strict';var _=require(_0xfb82('0x0'));var moment=require(_0xfb82('0x1'));var Redis=require(_0xfb82('0x2'));var db=require(_0xfb82('0x3'))['db'];var config=require('../../config/environment');config[_0xfb82('0x4')]=_[_0xfb82('0x5')](config[_0xfb82('0x4')],{'host':_0xfb82('0x6'),'port':0x18eb});var io=require(_0xfb82('0x7'))(new Redis(config[_0xfb82('0x4')]));function closeInteractions(){var _0x3d0e0b=0x0;var _0x1dca8a=[];return db[_0xfb82('0x8')]['find']({'raw':!![],'attributes':['id',_0xfb82('0x9')],'where':{'id':0x1}})[_0xfb82('0xa')](function(_0x1eaa27){_0x3d0e0b=_0x1eaa27[_0xfb82('0x9')];if(_0x3d0e0b){return db['ChatInteraction'][_0xfb82('0xb')]({'raw':!![],'attributes':['id',_0xfb82('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xfb82('0xd')](_0x1eaa27[_0xfb82('0x9')],'minutes')}}});}else{return[];}})[_0xfb82('0xa')](function(_0x32b697){_0x1dca8a=_0x32b697;if(_0x3d0e0b){return db[_0xfb82('0xe')][_0xfb82('0xf')]({'closeReason':_0xfb82('0x10'),'disposition':_0xfb82('0x11'),'closed':!![],'closedAt':moment()['format'](_0xfb82('0x12'))},{'where':{'id':_[_0xfb82('0x13')](_0x1dca8a||[],'id')}});}})[_0xfb82('0xa')](function(_0x1757db){for(var _0x50c090=0x0;_0x50c090<_0x1dca8a[_0xfb82('0x14')];_0x50c090++){io[_0xfb82('0x15')]('chatInteraction:update',{'id':_0x1dca8a[_0x50c090]['id'],'closed':!![]});}})[_0xfb82('0x16')](function(_0x30ed09){console['error'](_0x30ed09);});}exports[_0xfb82('0x17')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xfd0c=['format','YYYY-MM-DD\x20HH:mm:ss','length','emit','chatInteraction:update','catch','error','start','lodash','moment','ioredis','redis','defaults','socket.io-emitter','Setting','chatTimeout','findAll','lastMsgAt','minutes','then','system'];(function(_0x1416d1,_0x1dfa44){var _0x2e0fd6=function(_0x3843c4){while(--_0x3843c4){_0x1416d1['push'](_0x1416d1['shift']());}};_0x2e0fd6(++_0x1dfa44);}(_0xfd0c,0x86));var _0xcfd0=function(_0x41e8c4,_0x30d9ff){_0x41e8c4=_0x41e8c4-0x0;var _0x54ffbe=_0xfd0c[_0x41e8c4];return _0x54ffbe;};'use strict';var _=require(_0xcfd0('0x0'));var moment=require(_0xcfd0('0x1'));var Redis=require(_0xcfd0('0x2'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');config[_0xcfd0('0x3')]=_[_0xcfd0('0x4')](config[_0xcfd0('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xcfd0('0x5'))(new Redis(config[_0xcfd0('0x3')]));function closeInteractions(){var _0x53823e=0x0;var _0x1f88d3=[];return db[_0xcfd0('0x6')]['find']({'raw':!![],'attributes':['id',_0xcfd0('0x7')],'where':{'id':0x1}})['then'](function(_0xd1f5b3){_0x53823e=_0xd1f5b3[_0xcfd0('0x7')];if(_0x53823e){return db['ChatInteraction'][_0xcfd0('0x8')]({'raw':!![],'attributes':['id',_0xcfd0('0x9')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0xd1f5b3[_0xcfd0('0x7')],_0xcfd0('0xa'))}}});}else{return[];}})[_0xcfd0('0xb')](function(_0x3469fd){_0x1f88d3=_0x3469fd;if(_0x53823e){return db['ChatInteraction']['update']({'closeReason':_0xcfd0('0xc'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xcfd0('0xd')](_0xcfd0('0xe'))},{'where':{'id':_['map'](_0x1f88d3||[],'id')}});}})[_0xcfd0('0xb')](function(_0x3495b2){for(var _0x5b8c06=0x0;_0x5b8c06<_0x1f88d3[_0xcfd0('0xf')];_0x5b8c06++){io[_0xcfd0('0x10')](_0xcfd0('0x11'),{'id':_0x1f88d3[_0x5b8c06]['id'],'closed':!![]});}})[_0xcfd0('0x12')](function(_0x465939){console[_0xcfd0('0x13')](_0x465939);});}exports[_0xcfd0('0x14')]=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 29e0cda..a345a4f 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 _0x429c=['Schedule','MailServerOut','keys','jobs','map','keyBy','toString','difference','intersection','length','exists','stop','run\x20job','cron','active','isBetween','add','start','add\x20cron','deleteJob','stop\x20cron','startAt','update','run','util','path','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','MailAccount','service','Smtp','host','port','secure','authentication','auth','user','pass','\x22%s\x22\x20<%s>','name','format','subtractNumber','subtractUnit','join','../../files/reports','%s.%s','basename','savename','extname','zip','status','Sent','message','attachments','existsSync','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','error\x20mail','stringify','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id'];(function(_0x5e52f6,_0x1eaeed){var _0x5623b9=function(_0x3c678b){while(--_0x3c678b){_0x5e52f6['push'](_0x5e52f6['shift']());}};_0x5623b9(++_0x1eaeed);}(_0x429c,0x70));var _0xc429=function(_0x50b200,_0x5744f9){_0x50b200=_0x50b200-0x0;var _0x575909=_0x429c[_0x50b200];return _0x575909;};'use strict';var fs=require('fs');var util=require(_0xc429('0x0'));var path=require(_0xc429('0x1'));var _=require('lodash');var moment=require('moment');var CronJobManager=require(_0xc429('0x2'));var jayson=require(_0xc429('0x3'));var BPromise=require(_0xc429('0x4'));var logger=require(_0xc429('0x5'))(_0xc429('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xc429('0x7'));var analyticDefaultReportController=require(_0xc429('0x8'));var client=jayson[_0xc429('0x9')][_0xc429('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x26d52f,_0x35ae60){return function(){logger[_0xc429('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x26d52f[_0xc429('0xc')]);var _0x33ed0f=!![];var _0x750861={'tls':{'rejectUnauthorized':![]}};if(_0x26d52f[_0xc429('0xd')]['Smtp']['service']){_0x750861[_0xc429('0xe')]=_0x26d52f[_0xc429('0xd')][_0xc429('0xf')][_0xc429('0xe')];}else{_0x750861[_0xc429('0x10')]=_0x26d52f[_0xc429('0xd')]['Smtp']['host'];_0x750861[_0xc429('0x11')]=_0x26d52f['MailAccount']['Smtp']['port'];_0x750861[_0xc429('0x12')]=_0x26d52f[_0xc429('0xd')]['Smtp'][_0xc429('0x12')];}if(_0x26d52f[_0xc429('0xd')][_0xc429('0xf')][_0xc429('0x13')]){_0x750861[_0xc429('0x14')]={'user':_0x26d52f[_0xc429('0xd')][_0xc429('0xf')][_0xc429('0x15')],'pass':_0x26d52f[_0xc429('0xd')]['Smtp'][_0xc429('0x16')]};}var _0x37ec44={'account':_0x750861,'message':{'from':util['format'](_0xc429('0x17'),_0x26d52f[_0xc429('0xd')][_0xc429('0x18')],_0x26d52f[_0xc429('0xd')][_0xc429('0xc')]||_0x26d52f[_0xc429('0xd')][_0xc429('0xf')]['user']),'to':_0x26d52f['email'],'cc':_0x26d52f['cc'],'bcc':_0x26d52f['bcc'],'subject':util[_0xc429('0x19')]('Report\x20%s\x20last\x20%s\x20%s',_0x35ae60[_0xc429('0x18')],_0x26d52f[_0xc429('0x1a')],_0x26d52f[_0xc429('0x1b')])}};var _0x18b631=path[_0xc429('0x1c')](__dirname,_0xc429('0x1d'));var _0x133338=_0x35ae60['savename'];var _0x2f6f66=util['format'](_0xc429('0x1e'),path[_0xc429('0x1f')](_0x35ae60[_0xc429('0x20')],path[_0xc429('0x21')](_0x35ae60[_0xc429('0x20')])),_0xc429('0x22'));var _0x569f6d=path[_0xc429('0x1c')](_0x18b631,_0x133338);var _0x1e2782=path['join'](_0x18b631,_0x2f6f66);if(fs['existsSync'](_0x569f6d)){_0x35ae60[_0xc429('0x23')]=_0xc429('0x24');_0x37ec44[_0xc429('0x25')][_0xc429('0x26')]=[{'filename':_0x133338,'path':_0x569f6d}];_0x37ec44['message']['text']=util['format']('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x35ae60,null,0x2));}else if(fs[_0xc429('0x27')](_0x1e2782)){_0x35ae60[_0xc429('0x23')]='Sent';_0x37ec44['message'][_0xc429('0x26')]=[{'filename':_0x2f6f66,'path':_0x1e2782}];}else{_0x37ec44['message'][_0xc429('0x28')]=_0xc429('0x29');if(!_0x26d52f[_0xc429('0x2a')]){_0x33ed0f=![];logger[_0xc429('0xb')](_0xc429('0x2b'));}}if(_0x33ed0f){return client['request'](_0xc429('0x2c'),_0x37ec44)[_0xc429('0x2d')](function(_0x127438){if(_0x127438[_0xc429('0x2e')]){return logger[_0xc429('0x2e')](_0xc429('0x2f'),JSON[_0xc429('0x30')](_0x127438));}return logger['info'](_0xc429('0x31'));})[_0xc429('0x32')](function(_0x29905a){return logger['error'](_0xc429('0x2f'),JSON[_0xc429('0x30')](_0x29905a));});}};}function handleError(){return function(_0x162021){return logger['error'](JSON[_0xc429('0x30')](_0x162021));};}function handleResult(_0x4df8e3){return function(_0x3a1b7a){logger[_0xc429('0xb')](_0xc429('0x33'),JSON[_0xc429('0x30')](_0x3a1b7a));if(_0x4df8e3[_0xc429('0xd')]&&_0x4df8e3['MailAccount']['Smtp']&&!_['isNil'](_0x4df8e3['email'])){setTimeout(handleSendEmail(_0x4df8e3,_0x3a1b7a),0x3c*0x3e8);}};}function handleJob(_0x47e6ee){return function(){try{if(_[_0xc429('0x34')](_0x47e6ee['subtractNumber'])){return logger['info'](_0xc429('0x35'));}if(_[_0xc429('0x34')](_0x47e6ee[_0xc429('0x1b')])){return logger[_0xc429('0xb')](_0xc429('0x36'));}var _0x1c6243={'startDate':moment()[_0xc429('0x37')](_0x47e6ee['subtractNumber'],_0x47e6ee[_0xc429('0x1b')])['format'](_0xc429('0x38')),'endDate':moment()['format'](_0xc429('0x38')),'type':_0xc429('0x39'),'output':_0x47e6ee[_0xc429('0x3a')],'name':_0x47e6ee['name']};if(!_[_0xc429('0x34')](_0x47e6ee[_0xc429('0x3b')])){logger[_0xc429('0xb')](_0xc429('0x3c'),_0x47e6ee[_0xc429('0x3b')]);return analyticDefaultReportController[_0xc429('0x3d')]({'id':_0x47e6ee[_0xc429('0x3b')]},_0x1c6243)[_0xc429('0x2d')](handleResult(_0x47e6ee))[_0xc429('0x32')](handleError());}if(!_[_0xc429('0x34')](_0x47e6ee[_0xc429('0x3e')])){logger[_0xc429('0xb')]('exec\x20custom\x20report\x20id:%s',_0x47e6ee[_0xc429('0x3e')]);return analyticCustomReportController[_0xc429('0x3d')]({'id':_0x47e6ee[_0xc429('0x3e')]},_0x1c6243)[_0xc429('0x2d')](handleResult(_0x47e6ee))[_0xc429('0x32')](handleError());}}catch(_0xf17338){logger[_0xc429('0x2e')](JSON[_0xc429('0x30')](_0xf17338));}return logger['info'](_0xc429('0x3f'));};}function getJobs(_0x43b82b){var _0x5812c2={};if(_0x43b82b){_0x5812c2['id']=_0x43b82b;}return db[_0xc429('0x40')]['findAll']({'where':_0x5812c2,'include':[{'model':db[_0xc429('0xd')],'attributes':['id',_0xc429('0x18'),_0xc429('0xc')],'include':[{'model':db[_0xc429('0x41')],'as':_0xc429('0xf')}]}]})[_0xc429('0x2d')](function(_0x324807){var _0x559603=_[_0xc429('0x42')](manager[_0xc429('0x43')]);var _0x262826=_[_0xc429('0x44')](_0x324807,function(_0x27c056){return _0x27c056['id']['toString']();});var _0x124057=_[_0xc429('0x45')](_0x324807,function(_0x36fd30){return _0x36fd30['id'][_0xc429('0x46')]();});var _0x2c36d4=_0x43b82b?_0x262826:_[_0xc429('0x47')](_0x262826,_0x559603);var _0xd4610f=_[_0xc429('0x48')](_0x262826,_0x559603);var _0x3fcc82=_[_0xc429('0x47')](_0x559603,_0x262826);var _0x20414b;var _0x522326;for(_0x20414b=0x0;_0x20414b<_0x3fcc82[_0xc429('0x49')]&&!_0x43b82b;_0x20414b+=0x1){_0x522326=_0x3fcc82[_0x20414b]['toString']();if(manager[_0xc429('0x4a')](_0x522326)){manager[_0xc429('0x4b')](_0x522326);manager['deleteJob'](_0x522326);logger[_0xc429('0xb')]('delete\x20cron',_0x522326);}}logger[_0xc429('0xb')]('toRun',JSON[_0xc429('0x30')](_0x2c36d4));for(_0x20414b=0x0;_0x20414b<_0x2c36d4[_0xc429('0x49')];_0x20414b+=0x1){_0x522326=_0x2c36d4[_0x20414b][_0xc429('0x46')]();logger[_0xc429('0xb')]('index',_0x522326);if(_0x43b82b){logger[_0xc429('0xb')]('my\x20id',_0x43b82b);logger[_0xc429('0xb')](JSON[_0xc429('0x30')](_0x124057[_0x522326]));BPromise['resolve']()[_0xc429('0x2d')](handleJob(_0x124057[_0x522326]));logger['info'](_0xc429('0x4c'),_0x124057[_0x522326][_0xc429('0x18')],_0x124057[_0x522326][_0xc429('0x4d')]);}else if(_0x124057[_0x522326]['cron']&&_0x124057[_0x522326][_0xc429('0x4e')]&&moment()[_0xc429('0x4f')](_0x124057[_0x522326]['startAt'],_0x124057[_0x522326]['endAt'])){manager[_0xc429('0x50')](_0x522326,_0x124057[_0x522326]['cron'],handleJob(_0x124057[_0x522326]));manager[_0xc429('0x51')](_0x522326);logger[_0xc429('0xb')](_0xc429('0x52'),_0x124057[_0x522326][_0xc429('0x18')],_0x124057[_0x522326][_0xc429('0x4d')]);}else if(manager[_0xc429('0x4a')](_0x522326)){manager[_0xc429('0x4b')](_0x522326);manager[_0xc429('0x53')](_0x522326);logger[_0xc429('0xb')](_0xc429('0x54'),_0x124057[_0x522326][_0xc429('0x18')],_0x124057[_0x522326][_0xc429('0x4d')]);}}for(_0x20414b=0x0,_0x522326;_0x20414b<_0xd4610f['length']&&!_0x43b82b;_0x20414b+=0x1){_0x522326=_0xd4610f[_0x20414b][_0xc429('0x46')]();if(manager[_0xc429('0x4a')](_0x522326)){if(_0x124057[_0x522326][_0xc429('0x4d')]&&_0x124057[_0x522326][_0xc429('0x4e')]&&moment()[_0xc429('0x4f')](_0x124057[_0x522326][_0xc429('0x55')],_0x124057[_0x522326]['endAt'])){manager[_0xc429('0x56')](_0x522326,_0x124057[_0x522326][_0xc429('0x4d')],handleJob(_0x124057[_0x522326]));logger['info']('update\x20cron',_0x124057[_0x522326]['name'],_0x124057[_0x522326][_0xc429('0x4d')]);}else{manager[_0xc429('0x4b')](_0x522326);manager['deleteJob'](_0x522326);logger[_0xc429('0xb')]('stop\x20cron',_0x124057[_0x522326][_0xc429('0x18')],_0x124057[_0x522326]['cron']);}}}})[_0xc429('0x32')](function(_0x5795cd){logger[_0xc429('0x2e')](JSON[_0xc429('0x30')](_0x5795cd));});}exports[_0xc429('0x57')]=function(_0x43b399){return getJobs(_0x43b399);};exports[_0xc429('0x51')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x9cd4=['attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','request','SendMail','then','error','error\x20mail','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','catch','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','intersection','difference','length','stop','deleteJob','delete\x20cron','toRun','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','start','add\x20cron','exists','stop\x20cron','update','update\x20cron','util','path','lodash','moment','cron-job-manager','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','authentication','user','pass','format','\x22%s\x22\x20<%s>','name','subtractNumber','join','../../files/reports','savename','%s.%s','status','Sent','message'];(function(_0x3732c6,_0x373ce7){var _0x7dfd8=function(_0x4190bb){while(--_0x4190bb){_0x3732c6['push'](_0x3732c6['shift']());}};_0x7dfd8(++_0x373ce7);}(_0x9cd4,0x197));var _0x49cd=function(_0x45b1ba,_0x5a6a21){_0x45b1ba=_0x45b1ba-0x0;var _0x145ddb=_0x9cd4[_0x45b1ba];return _0x145ddb;};'use strict';var fs=require('fs');var util=require(_0x49cd('0x0'));var path=require(_0x49cd('0x1'));var _=require(_0x49cd('0x2'));var moment=require(_0x49cd('0x3'));var CronJobManager=require(_0x49cd('0x4'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x49cd('0x5'))(_0x49cd('0x6'));var db=require(_0x49cd('0x7'))['db'];var analyticCustomReportController=require(_0x49cd('0x8'));var analyticDefaultReportController=require(_0x49cd('0x9'));var client=jayson[_0x49cd('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3f5b82,_0x514aa9){return function(){logger[_0x49cd('0xb')](_0x49cd('0xc'),_0x3f5b82[_0x49cd('0xd')]);var _0x6a9c34=!![];var _0xcf6837={'tls':{'rejectUnauthorized':![]}};if(_0x3f5b82[_0x49cd('0xe')][_0x49cd('0xf')][_0x49cd('0x10')]){_0xcf6837['service']=_0x3f5b82['MailAccount'][_0x49cd('0xf')]['service'];}else{_0xcf6837['host']=_0x3f5b82[_0x49cd('0xe')][_0x49cd('0xf')][_0x49cd('0x11')];_0xcf6837[_0x49cd('0x12')]=_0x3f5b82[_0x49cd('0xe')][_0x49cd('0xf')][_0x49cd('0x12')];_0xcf6837['secure']=_0x3f5b82[_0x49cd('0xe')]['Smtp']['secure'];}if(_0x3f5b82[_0x49cd('0xe')][_0x49cd('0xf')][_0x49cd('0x13')]){_0xcf6837['auth']={'user':_0x3f5b82[_0x49cd('0xe')]['Smtp'][_0x49cd('0x14')],'pass':_0x3f5b82[_0x49cd('0xe')][_0x49cd('0xf')][_0x49cd('0x15')]};}var _0x3e7f00={'account':_0xcf6837,'message':{'from':util[_0x49cd('0x16')](_0x49cd('0x17'),_0x3f5b82[_0x49cd('0xe')][_0x49cd('0x18')],_0x3f5b82[_0x49cd('0xe')][_0x49cd('0xd')]||_0x3f5b82[_0x49cd('0xe')][_0x49cd('0xf')][_0x49cd('0x14')]),'to':_0x3f5b82['email'],'cc':_0x3f5b82['cc'],'bcc':_0x3f5b82['bcc'],'subject':util[_0x49cd('0x16')]('Report\x20%s\x20last\x20%s\x20%s',_0x514aa9[_0x49cd('0x18')],_0x3f5b82[_0x49cd('0x19')],_0x3f5b82['subtractUnit'])}};var _0x4e5fce=path[_0x49cd('0x1a')](__dirname,_0x49cd('0x1b'));var _0x222257=_0x514aa9[_0x49cd('0x1c')];var _0x3b72ca=util['format'](_0x49cd('0x1d'),path['basename'](_0x514aa9[_0x49cd('0x1c')],path['extname'](_0x514aa9[_0x49cd('0x1c')])),'zip');var _0x38739e=path['join'](_0x4e5fce,_0x222257);var _0x561385=path[_0x49cd('0x1a')](_0x4e5fce,_0x3b72ca);if(fs['existsSync'](_0x38739e)){_0x514aa9[_0x49cd('0x1e')]=_0x49cd('0x1f');_0x3e7f00[_0x49cd('0x20')][_0x49cd('0x21')]=[{'filename':_0x222257,'path':_0x38739e}];_0x3e7f00[_0x49cd('0x20')][_0x49cd('0x22')]=util[_0x49cd('0x16')](_0x49cd('0x23'),JSON[_0x49cd('0x24')](_0x514aa9,null,0x2));}else if(fs[_0x49cd('0x25')](_0x561385)){_0x514aa9['status']=_0x49cd('0x1f');_0x3e7f00[_0x49cd('0x20')][_0x49cd('0x21')]=[{'filename':_0x3b72ca,'path':_0x561385}];}else{_0x3e7f00[_0x49cd('0x20')][_0x49cd('0x22')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x3f5b82['sendIfEmpty']){_0x6a9c34=![];logger[_0x49cd('0xb')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x6a9c34){return client[_0x49cd('0x26')](_0x49cd('0x27'),_0x3e7f00)[_0x49cd('0x28')](function(_0x285a01){if(_0x285a01[_0x49cd('0x29')]){return logger[_0x49cd('0x29')](_0x49cd('0x2a'),JSON['stringify'](_0x285a01));}return logger[_0x49cd('0xb')](_0x49cd('0x2b'));})['catch'](function(_0x399883){return logger[_0x49cd('0x29')](_0x49cd('0x2a'),JSON[_0x49cd('0x24')](_0x399883));});}};}function handleError(){return function(_0x57e41f){return logger[_0x49cd('0x29')](JSON['stringify'](_0x57e41f));};}function handleResult(_0x4247d0){return function(_0x2fbd08){logger['info'](_0x49cd('0x2c'),JSON['stringify'](_0x2fbd08));if(_0x4247d0[_0x49cd('0xe')]&&_0x4247d0[_0x49cd('0xe')][_0x49cd('0xf')]&&!_['isNil'](_0x4247d0['email'])){setTimeout(handleSendEmail(_0x4247d0,_0x2fbd08),0x3c*0x3e8);}};}function handleJob(_0x26be04){return function(){try{if(_[_0x49cd('0x2d')](_0x26be04[_0x49cd('0x19')])){return logger['info'](_0x49cd('0x2e'));}if(_[_0x49cd('0x2d')](_0x26be04['subtractUnit'])){return logger[_0x49cd('0xb')](_0x49cd('0x2f'));}var _0x9c2533={'startDate':moment()['subtract'](_0x26be04[_0x49cd('0x19')],_0x26be04[_0x49cd('0x30')])[_0x49cd('0x16')](_0x49cd('0x31')),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x49cd('0x32'),'output':_0x26be04[_0x49cd('0x33')],'name':_0x26be04[_0x49cd('0x18')]};if(!_[_0x49cd('0x2d')](_0x26be04['DefaultReportId'])){logger[_0x49cd('0xb')](_0x49cd('0x34'),_0x26be04[_0x49cd('0x35')]);return analyticDefaultReportController[_0x49cd('0x36')]({'id':_0x26be04['DefaultReportId']},_0x9c2533)[_0x49cd('0x28')](handleResult(_0x26be04))[_0x49cd('0x37')](handleError());}if(!_[_0x49cd('0x2d')](_0x26be04['CustomReportId'])){logger[_0x49cd('0xb')](_0x49cd('0x38'),_0x26be04['CustomReportId']);return analyticCustomReportController[_0x49cd('0x36')]({'id':_0x26be04[_0x49cd('0x39')]},_0x9c2533)['then'](handleResult(_0x26be04))[_0x49cd('0x37')](handleError());}}catch(_0x41e07a){logger[_0x49cd('0x29')](JSON['stringify'](_0x41e07a));}return logger[_0x49cd('0xb')](_0x49cd('0x3a'));};}function getJobs(_0xbbbe98){var _0x55a7ec={};if(_0xbbbe98){_0x55a7ec['id']=_0xbbbe98;}return db[_0x49cd('0x3b')][_0x49cd('0x3c')]({'where':_0x55a7ec,'include':[{'model':db[_0x49cd('0xe')],'attributes':['id',_0x49cd('0x18'),'email'],'include':[{'model':db[_0x49cd('0x3d')],'as':_0x49cd('0xf')}]}]})[_0x49cd('0x28')](function(_0x4a8cac){var _0xb77305=_[_0x49cd('0x3e')](manager[_0x49cd('0x3f')]);var _0x1d57dd=_[_0x49cd('0x40')](_0x4a8cac,function(_0x42320a){return _0x42320a['id'][_0x49cd('0x41')]();});var _0x3bd899=_[_0x49cd('0x42')](_0x4a8cac,function(_0x16a631){return _0x16a631['id'][_0x49cd('0x41')]();});var _0x57c5ad=_0xbbbe98?_0x1d57dd:_['difference'](_0x1d57dd,_0xb77305);var _0x38d832=_[_0x49cd('0x43')](_0x1d57dd,_0xb77305);var _0x1baf7c=_[_0x49cd('0x44')](_0xb77305,_0x1d57dd);var _0x27b46f;var _0x394cab;for(_0x27b46f=0x0;_0x27b46f<_0x1baf7c[_0x49cd('0x45')]&&!_0xbbbe98;_0x27b46f+=0x1){_0x394cab=_0x1baf7c[_0x27b46f][_0x49cd('0x41')]();if(manager['exists'](_0x394cab)){manager[_0x49cd('0x46')](_0x394cab);manager[_0x49cd('0x47')](_0x394cab);logger[_0x49cd('0xb')](_0x49cd('0x48'),_0x394cab);}}logger[_0x49cd('0xb')](_0x49cd('0x49'),JSON[_0x49cd('0x24')](_0x57c5ad));for(_0x27b46f=0x0;_0x27b46f<_0x57c5ad[_0x49cd('0x45')];_0x27b46f+=0x1){_0x394cab=_0x57c5ad[_0x27b46f][_0x49cd('0x41')]();logger[_0x49cd('0xb')]('index',_0x394cab);if(_0xbbbe98){logger[_0x49cd('0xb')](_0x49cd('0x4a'),_0xbbbe98);logger['info'](JSON[_0x49cd('0x24')](_0x3bd899[_0x394cab]));BPromise[_0x49cd('0x4b')]()['then'](handleJob(_0x3bd899[_0x394cab]));logger['info'](_0x49cd('0x4c'),_0x3bd899[_0x394cab][_0x49cd('0x18')],_0x3bd899[_0x394cab][_0x49cd('0x4d')]);}else if(_0x3bd899[_0x394cab][_0x49cd('0x4d')]&&_0x3bd899[_0x394cab][_0x49cd('0x4e')]&&moment()[_0x49cd('0x4f')](_0x3bd899[_0x394cab][_0x49cd('0x50')],_0x3bd899[_0x394cab][_0x49cd('0x51')])){manager['add'](_0x394cab,_0x3bd899[_0x394cab][_0x49cd('0x4d')],handleJob(_0x3bd899[_0x394cab]));manager[_0x49cd('0x52')](_0x394cab);logger[_0x49cd('0xb')](_0x49cd('0x53'),_0x3bd899[_0x394cab][_0x49cd('0x18')],_0x3bd899[_0x394cab]['cron']);}else if(manager[_0x49cd('0x54')](_0x394cab)){manager[_0x49cd('0x46')](_0x394cab);manager[_0x49cd('0x47')](_0x394cab);logger[_0x49cd('0xb')](_0x49cd('0x55'),_0x3bd899[_0x394cab]['name'],_0x3bd899[_0x394cab][_0x49cd('0x4d')]);}}for(_0x27b46f=0x0,_0x394cab;_0x27b46f<_0x38d832['length']&&!_0xbbbe98;_0x27b46f+=0x1){_0x394cab=_0x38d832[_0x27b46f][_0x49cd('0x41')]();if(manager[_0x49cd('0x54')](_0x394cab)){if(_0x3bd899[_0x394cab][_0x49cd('0x4d')]&&_0x3bd899[_0x394cab][_0x49cd('0x4e')]&&moment()[_0x49cd('0x4f')](_0x3bd899[_0x394cab][_0x49cd('0x50')],_0x3bd899[_0x394cab][_0x49cd('0x51')])){manager[_0x49cd('0x56')](_0x394cab,_0x3bd899[_0x394cab][_0x49cd('0x4d')],handleJob(_0x3bd899[_0x394cab]));logger[_0x49cd('0xb')](_0x49cd('0x57'),_0x3bd899[_0x394cab][_0x49cd('0x18')],_0x3bd899[_0x394cab][_0x49cd('0x4d')]);}else{manager[_0x49cd('0x46')](_0x394cab);manager[_0x49cd('0x47')](_0x394cab);logger[_0x49cd('0xb')](_0x49cd('0x55'),_0x3bd899[_0x394cab]['name'],_0x3bd899[_0x394cab][_0x49cd('0x4d')]);}}}})[_0x49cd('0x37')](function(_0x3a226e){logger[_0x49cd('0x29')](JSON[_0x49cd('0x24')](_0x3a226e));});}exports['run']=function(_0x5d4d30){return getJobs(_0x5d4d30);};exports[_0x49cd('0x52')]=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 1697d2d..d0728a0 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ae2=['../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','CmContact','catch','util'];(function(_0x35672e,_0x559c47){var _0x4db448=function(_0x37afa9){while(--_0x37afa9){_0x35672e['push'](_0x35672e['shift']());}};_0x4db448(++_0x559c47);}(_0x0ae2,0x87));var _0x20ae=function(_0x2e249d,_0x41b7e7){_0x2e249d=_0x2e249d-0x0;var _0x1faa37=_0x0ae2[_0x2e249d];return _0x1faa37;};'use strict';var util=require(_0x20ae('0x0'));var db=require(_0x20ae('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x20ae('0x2')]({'id':i,'firstName':_0x20ae('0x3')+i,'lastName':_0x20ae('0x4')+i,'phone':0xf879fb460+i,'email':_0x20ae('0x5')+i+_0x20ae('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x20ae('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x20ae('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x20ae('0x7')](),'updatedAt':Date[_0x20ae('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x20ae('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x20ae('0x4')+i,'phone':0xf879fb460+i,'email':_0x20ae('0x5')+i+_0x20ae('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x20ae('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x20ae('0x7')]()});}db['CmContact'][_0x20ae('0x8')]({'where':{}})[_0x20ae('0x9')](function(){return db['CmContact'][_0x20ae('0xa')](contacts);})[_0x20ae('0x9')](function(){console[_0x20ae('0xb')](_0x20ae('0xc'),_0x20ae('0xd'));return db[_0x20ae('0xe')][_0x20ae('0x8')]({'where':{}});})['then'](function(){return db[_0x20ae('0xe')][_0x20ae('0xa')](hopper);})[_0x20ae('0x9')](function(){console[_0x20ae('0xb')](_0x20ae('0xc'),'hopper1');return db[_0x20ae('0xf')][_0x20ae('0xa')](contacts2);})['then'](function(){console['log'](_0x20ae('0xc'),'contacts2');return db[_0x20ae('0xe')][_0x20ae('0xa')](hopper2);})['then'](function(){console['log'](_0x20ae('0xc'),'hopper2');})[_0x20ae('0x10')](function(_0x3e4015){console[_0x20ae('0xb')](_0x3e4015);}); \ No newline at end of file +var _0xaa8f=['then','log','finished\x20populating','CmHopper','bulkCreate','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','CmContact','destroy'];(function(_0x16309d,_0x1bccdc){var _0x813e0=function(_0x5b9917){while(--_0x5b9917){_0x16309d['push'](_0x16309d['shift']());}};_0x813e0(++_0x1bccdc);}(_0xaa8f,0x139));var _0xfaa8=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0xaa8f[_0x1df7b8];return _0x29d911;};'use strict';var util=require(_0xfaa8('0x0'));var db=require(_0xfaa8('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xfaa8('0x2')]({'id':i,'firstName':_0xfaa8('0x3')+i,'lastName':_0xfaa8('0x4')+i,'phone':0xf879fb460+i,'email':_0xfaa8('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xfaa8('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xfaa8('0x6')](),'updatedAt':Date[_0xfaa8('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xfaa8('0x2')]({'id':i,'firstName':_0xfaa8('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xfaa8('0x5')+i+_0xfaa8('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xfaa8('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xfaa8('0x6')](),'updatedAt':Date['now']()});}db[_0xfaa8('0x8')][_0xfaa8('0x9')]({'where':{}})[_0xfaa8('0xa')](function(){return db[_0xfaa8('0x8')]['bulkCreate'](contacts);})[_0xfaa8('0xa')](function(){console[_0xfaa8('0xb')](_0xfaa8('0xc'),'contacts1');return db['CmHopper'][_0xfaa8('0x9')]({'where':{}});})[_0xfaa8('0xa')](function(){return db[_0xfaa8('0xd')][_0xfaa8('0xe')](hopper);})[_0xfaa8('0xa')](function(){console[_0xfaa8('0xb')](_0xfaa8('0xc'),_0xfaa8('0xf'));return db[_0xfaa8('0x8')][_0xfaa8('0xe')](contacts2);})[_0xfaa8('0xa')](function(){console[_0xfaa8('0xb')](_0xfaa8('0xc'),_0xfaa8('0x10'));return db[_0xfaa8('0xd')][_0xfaa8('0xe')](hopper2);})[_0xfaa8('0xa')](function(){console[_0xfaa8('0xb')]('finished\x20populating',_0xfaa8('0x11'));})[_0xfaa8('0x12')](function(_0x37cf43){console[_0xfaa8('0xb')](_0x37cf43);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 28c281f..83ca584 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb11b=['push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','bulkCreate','log','add\x20user'];(function(_0x5794a2,_0x34b1d8){var _0x3516ca=function(_0x571575){while(--_0x571575){_0x5794a2['push'](_0x5794a2['shift']());}};_0x3516ca(++_0x34b1d8);}(_0xb11b,0x18c));var _0xbb11=function(_0x57e532,_0x543b48){_0x57e532=_0x57e532-0x0;var _0x1c0518=_0xb11b[_0x57e532];return _0x1c0518;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xbb11('0x0')]({'name':util[_0xbb11('0x1')](_0xbb11('0x2'),_0xbb11('0x3'),i),'fullname':util[_0xbb11('0x1')](_0xbb11('0x2'),_0xbb11('0x3'),i),'email':util[_0xbb11('0x1')](_0xbb11('0x4'),_0xbb11('0x3'),i),'role':_0xbb11('0x3'),'password':_0xbb11('0x5'),'internal':0xfa0+i,'type':_0xbb11('0x6'),'transport':[_0xbb11('0x7'),'ws',_0xbb11('0x8')],'disallow':[_0xbb11('0x9')],'allow':[_0xbb11('0xa')],'defaultuser':util['format'](_0xbb11('0x2'),_0xbb11('0x3'),i),'encryption':_0xbb11('0xb'),'avpf':'yes','force_avp':_0xbb11('0xb'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xbb11('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xbb11('0xd'),'callerid':util[_0xbb11('0x1')](_0xbb11('0xe'),util[_0xbb11('0x1')](_0xbb11('0x2'),_0xbb11('0x3'),i),0xfa0+i)});}db['User'][_0xbb11('0xf')](users)['then'](function(){console[_0xbb11('0x10')](_0xbb11('0x11'));})['catch'](function(_0x50c3f3){console[_0xbb11('0x10')](_0x50c3f3);}); \ No newline at end of file +var _0x960c=['then','log','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate'];(function(_0x5da27f,_0x504b76){var _0x54a3fb=function(_0x3b65a8){while(--_0x3b65a8){_0x5da27f['push'](_0x5da27f['shift']());}};_0x54a3fb(++_0x504b76);}(_0x960c,0x1ba));var _0xc960=function(_0x4a29e2,_0x53236b){_0x4a29e2=_0x4a29e2-0x0;var _0x1c9376=_0x960c[_0x4a29e2];return _0x1c9376;};'use strict';var util=require(_0xc960('0x0'));var db=require(_0xc960('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xc960('0x2')]({'name':util[_0xc960('0x3')](_0xc960('0x4'),_0xc960('0x5'),i),'fullname':util[_0xc960('0x3')](_0xc960('0x4'),_0xc960('0x5'),i),'email':util[_0xc960('0x3')](_0xc960('0x6'),_0xc960('0x5'),i),'role':_0xc960('0x5'),'password':'password','internal':0xfa0+i,'type':_0xc960('0x7'),'transport':[_0xc960('0x8'),'ws',_0xc960('0x9')],'disallow':[_0xc960('0xa')],'allow':[_0xc960('0xb')],'defaultuser':util['format'](_0xc960('0x4'),'agent',i),'encryption':_0xc960('0xc'),'avpf':'yes','force_avp':_0xc960('0xc'),'icesupport':_0xc960('0xc'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xc960('0xd'),'dtlsprivatekey':_0xc960('0xe'),'dtlssetup':_0xc960('0xf'),'callerid':util[_0xc960('0x3')]('\x22%s\x22\x20<%s>',util[_0xc960('0x3')](_0xc960('0x4'),_0xc960('0x5'),i),0xfa0+i)});}db[_0xc960('0x10')][_0xc960('0x11')](users)[_0xc960('0x12')](function(){console[_0xc960('0x13')]('add\x20user');})['catch'](function(_0x54cd53){console[_0xc960('0x13')](_0x54cd53);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index da0f1e3..bc3bdda 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x30c6=['OpenchannelQueue','Trunk','user','VoiceQueue','ChatQueues','FaxQueues','SmsQueue','MailQueues','Telephones','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','chat','fax','sms','mail','openchannel','trunk:%s','campaign:%s:%s','leave','map','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','connection','setMaxListeners','address','request','remoteAddress','connectedAt','log','disconnect','CONNECTED','lodash','util','../mysqldb','./environment','name','role','agent','type','ivr','findOne','autoAssociation','VoiceQueues','OpenchannelQueues','findAll','Trunks','UserProfileResource','resourceId','then','where','telephone','Campaign','format','%s:queue:%s','Agents','length','user:%s','handshake','query','User','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','admin','voice:inbound','voice:outbound','include','push','FaxQueue'];(function(_0x8af54b,_0x280be5){var _0x27d8f0=function(_0x559734){while(--_0x559734){_0x8af54b['push'](_0x8af54b['shift']());}};_0x27d8f0(++_0x280be5);}(_0x30c6,0x19a));var _0x630c=function(_0x75158c,_0x2557d5){_0x75158c=_0x75158c-0x0;var _0x185cde=_0x30c6[_0x75158c];return _0x185cde;};'use strict';var _=require(_0x630c('0x0'));var util=require(_0x630c('0x1'));var BPromise=require('bluebird');var db=require(_0x630c('0x2'))['db'];var config=require(_0x630c('0x3'));var queryQueues={'attributes':['id',_0x630c('0x4')],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0x630c('0x4'),_0x630c('0x5')],'raw':!![],'where':{'role':_0x630c('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x630c('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x630c('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x630c('0x4'),_0x630c('0x7')],'where':{'type':_0x630c('0x8')}};function getAssociatedResources(_0x496a7e,_0xf4b8b3,_0x5ac8cd){return db['UserProfileSection'][_0x630c('0x9')]({'where':{'name':_0x496a7e,'userProfileId':_0xf4b8b3},'raw':!![]})['then'](function(_0x39643e){if(_0x39643e){if(_0x39643e[_0x630c('0xa')]){switch(_0x496a7e){case _0x630c('0xb'):case'ChatQueues':case'FaxQueues':case'SmsQueues':case'MailQueues':case _0x630c('0xc'):return db[_0x5ac8cd][_0x630c('0xd')](queryQueues);case'Telephones':return db[_0x5ac8cd][_0x630c('0xd')](queryTelephones);case _0x630c('0xe'):return db[_0x5ac8cd][_0x630c('0xd')](queryTrunks);case'IvrCampaigns':return db[_0x5ac8cd]['findAll'](queryCampaigns);}}else{return db[_0x630c('0xf')][_0x630c('0xd')]({'attributes':[_0x630c('0x10')],'where':{'sectionId':_0x39643e['id']},'raw':!![]})[_0x630c('0x11')](function(_0x4b37ae){if(_0x4b37ae){var _0x337fb1={'where':{'id':_['map'](_0x4b37ae,'resourceId')},'raw':!![]};switch(_0x5ac8cd){case'User':_0x337fb1[_0x630c('0x12')][_0x630c('0x5')]=_0x630c('0x13');break;case _0x630c('0x14'):_0x337fb1[_0x630c('0x12')][_0x630c('0x7')]='ivr';break;}return db[_0x5ac8cd][_0x630c('0xd')](_0x337fb1);}else{return[];}});}}else{return[];}})[_0x630c('0x11')](function(_0x3f3a70){return _0x3f3a70;});}function joinOrLeaveQueues(_0x7f442a,_0x47ed5c,_0x3895af,_0x5268c6){_0x7f442a[_0x47ed5c](util[_0x630c('0x15')](_0x630c('0x16'),_0x3895af,_0x5268c6[_0x630c('0x4')]));if(_0x5268c6[_0x630c('0x17')]){for(var _0x37605d=0x0;_0x37605d<_0x5268c6[_0x630c('0x17')][_0x630c('0x18')];_0x37605d+=0x1){_0x7f442a[_0x47ed5c](util[_0x630c('0x15')](_0x630c('0x19'),_0x5268c6[_0x630c('0x17')][_0x37605d][_0x630c('0x4')]));}}}function joinOrLeave(_0x350dfe,_0xcc7e18,_0xa48269){var _0x245080;if(_0x350dfe[_0x630c('0x1a')][_0x630c('0x1b')]['id']){db[_0x630c('0x1c')][_0x630c('0x1d')]({'attributes':['id',_0x630c('0x4'),_0x630c('0x5'),_0x630c('0x1e')],'where':{'id':_0x350dfe[_0x630c('0x1a')][_0x630c('0x1b')]['id']},'include':[{'model':db[_0x630c('0x1f')],'as':_0x630c('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x630c('0x21')],'as':_0x630c('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x630c('0x23')],'as':_0x630c('0x24'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x630c('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x630c('0x26')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})[_0x630c('0x11')](function(_0x5df3af){if(_0x5df3af){_0x245080=_0x5df3af;_0x350dfe[_0xcc7e18](util[_0x630c('0x15')](_0x630c('0x19'),_0x5df3af['name']));var _0x297c10=[];switch(_0x5df3af['role']){case _0x630c('0x27'):_0x350dfe[_0xcc7e18](_0x630c('0x28'));_0x350dfe[_0xcc7e18](_0x630c('0x29'));if(queryQueues['hasOwnProperty'](_0x630c('0x2a'))){delete queryQueues['include'];}_0x297c10[_0x630c('0x2b')](db['VoiceQueue'][_0x630c('0xd')](queryQueues));_0x297c10[_0x630c('0x2b')](db['ChatQueue'][_0x630c('0xd')](queryQueues));_0x297c10[_0x630c('0x2b')](db[_0x630c('0x2c')][_0x630c('0xd')](queryQueues));_0x297c10['push'](db['SmsQueue'][_0x630c('0xd')](queryQueues));_0x297c10[_0x630c('0x2b')](db['MailQueue'][_0x630c('0xd')](queryQueues));_0x297c10[_0x630c('0x2b')](db[_0x630c('0x2d')][_0x630c('0xd')](queryQueues));_0x297c10[_0x630c('0x2b')](db[_0x630c('0x1c')]['findAll'](queryTelephones));_0x297c10['push'](db[_0x630c('0x2e')]['findAll'](queryTrunks));_0x297c10[_0x630c('0x2b')](db[_0x630c('0x14')][_0x630c('0xd')](queryCampaigns));_0x297c10[_0x630c('0x2b')](db[_0x630c('0x1c')][_0x630c('0xd')](queryAgents));break;case _0x630c('0x2f'):_0x350dfe[_0xcc7e18](_0x630c('0x28'));_0x350dfe[_0xcc7e18](_0x630c('0x29'));_0x297c10[_0x630c('0x2b')](getAssociatedResources(_0x630c('0xb'),_0x5df3af[_0x630c('0x1e')],_0x630c('0x30')));_0x297c10[_0x630c('0x2b')](getAssociatedResources(_0x630c('0x31'),_0x5df3af['userProfileId'],'ChatQueue'));_0x297c10[_0x630c('0x2b')](getAssociatedResources(_0x630c('0x32'),_0x5df3af[_0x630c('0x1e')],_0x630c('0x2c')));_0x297c10[_0x630c('0x2b')](getAssociatedResources('SmsQueues',_0x5df3af[_0x630c('0x1e')],_0x630c('0x33')));_0x297c10[_0x630c('0x2b')](getAssociatedResources(_0x630c('0x34'),_0x5df3af[_0x630c('0x1e')],'MailQueue'));_0x297c10['push'](getAssociatedResources(_0x630c('0xc'),_0x5df3af[_0x630c('0x1e')],_0x630c('0x2d')));_0x297c10['push'](getAssociatedResources(_0x630c('0x35'),_0x5df3af[_0x630c('0x1e')],_0x630c('0x1c')));_0x297c10[_0x630c('0x2b')](getAssociatedResources(_0x630c('0xe'),_0x5df3af[_0x630c('0x1e')],_0x630c('0x2e')));_0x297c10['push'](getAssociatedResources(_0x630c('0x36'),_0x5df3af[_0x630c('0x1e')],_0x630c('0x14')));_0x297c10['push'](db[_0x630c('0x1c')][_0x630c('0xd')](queryAgents));break;case _0x630c('0x6'):_0x350dfe[_0xcc7e18](_0x630c('0x28'));_0x350dfe[_0xcc7e18](_0x630c('0x29'));_0x297c10[_0x630c('0x2b')](_0x5df3af[_0x630c('0x37')]({'attributes':['id','name']}));_0x297c10['push'](_0x5df3af[_0x630c('0x38')]({'attributes':['id',_0x630c('0x4')]}));_0x297c10['push'](_0x5df3af[_0x630c('0x39')]({'attributes':['id',_0x630c('0x4')]}));_0x297c10[_0x630c('0x2b')](_0x5df3af[_0x630c('0x3a')]({'attributes':['id',_0x630c('0x4')]}));_0x297c10[_0x630c('0x2b')](_0x5df3af[_0x630c('0x3b')]({'attributes':['id',_0x630c('0x4')]}));_0x297c10[_0x630c('0x2b')](_0x5df3af[_0x630c('0x3c')]({'attributes':['id','name']}));break;}return BPromise[_0x630c('0x3d')](_0x297c10);}})[_0x630c('0x11')](function(_0x1e313e){if(_0x1e313e&&_0x1e313e[_0x630c('0x18')]){for(var _0x13188d=0x0;_0x13188d<_0x1e313e[_0x630c('0x18')];_0x13188d+=0x1){for(var _0xf19e5f=0x0;_0xf19e5f<_0x1e313e[_0x13188d][_0x630c('0x18')];_0xf19e5f+=0x1){switch(_0x13188d){case 0x0:joinOrLeaveQueues(_0x350dfe,_0xcc7e18,'voice',_0x1e313e[_0x13188d][_0xf19e5f]);break;case 0x1:joinOrLeaveQueues(_0x350dfe,_0xcc7e18,_0x630c('0x3e'),_0x1e313e[_0x13188d][_0xf19e5f]);break;case 0x2:joinOrLeaveQueues(_0x350dfe,_0xcc7e18,_0x630c('0x3f'),_0x1e313e[_0x13188d][_0xf19e5f]);break;case 0x3:joinOrLeaveQueues(_0x350dfe,_0xcc7e18,_0x630c('0x40'),_0x1e313e[_0x13188d][_0xf19e5f]);break;case 0x4:joinOrLeaveQueues(_0x350dfe,_0xcc7e18,_0x630c('0x41'),_0x1e313e[_0x13188d][_0xf19e5f]);break;case 0x5:joinOrLeaveQueues(_0x350dfe,_0xcc7e18,_0x630c('0x42'),_0x1e313e[_0x13188d][_0xf19e5f]);break;case 0x6:_0x350dfe[_0xcc7e18](util[_0x630c('0x15')]('telephone:%s',_0x1e313e[_0x13188d][_0xf19e5f][_0x630c('0x4')]));break;case 0x7:_0x350dfe[_0xcc7e18](util[_0x630c('0x15')](_0x630c('0x43'),_0x1e313e[_0x13188d][_0xf19e5f][_0x630c('0x4')]));break;case 0x8:_0x350dfe[_0xcc7e18](util['format'](_0x630c('0x44'),_0x1e313e[_0x13188d][_0xf19e5f][_0x630c('0x7')],_0x1e313e[_0x13188d][_0xf19e5f]['name']));break;case 0x9:_0x350dfe[_0xcc7e18](util[_0x630c('0x15')](_0x630c('0x19'),_0x1e313e[_0x13188d][_0xf19e5f][_0x630c('0x4')]));break;}}}}})[_0x630c('0x11')](function(){if(_0xcc7e18===_0x630c('0x45')){var _0x50a90=_[_0x630c('0x46')](_0x245080[_0x630c('0x20')],'id');return _0x245080[_0x630c('0x47')](_0x50a90)['then'](function(){for(var _0x560b28=0x0;_0x560b28<_0x50a90[_0x630c('0x18')];_0x560b28+=0x1){_0xa48269[_0x630c('0x48')](_0x630c('0x49'),{'ChatInteractionId':Number(_0x50a90[_0x560b28]),'UserId':Number(_0x245080['id'])});}});}})[_0x630c('0x11')](function(){if(_0xcc7e18===_0x630c('0x45')){var _0x424907=_['map'](_0x245080['MailInteractions'],'id');return _0x245080[_0x630c('0x4a')](_0x424907)['then'](function(){for(var _0x576fad=0x0;_0x576fad<_0x424907[_0x630c('0x18')];_0x576fad+=0x1){_0xa48269['emit'](_0x630c('0x4b'),{'MailInteractionId':Number(_0x424907[_0x576fad]),'UserId':Number(_0x245080['id'])});}});}})['then'](function(){if(_0xcc7e18===_0x630c('0x45')){var _0x15d301=_[_0x630c('0x46')](_0x245080[_0x630c('0x24')],'id');return _0x245080[_0x630c('0x4c')](_0x15d301)[_0x630c('0x11')](function(){for(var _0x1cb0e3=0x0;_0x1cb0e3<_0x15d301['length'];_0x1cb0e3+=0x1){_0xa48269[_0x630c('0x48')](_0x630c('0x4d'),{'FaxInteractionId':Number(_0x15d301[_0x1cb0e3]),'UserId':Number(_0x245080['id'])});}});}})[_0x630c('0x11')](function(){if(_0xcc7e18==='leave'){var _0x466bc3=_[_0x630c('0x46')](_0x245080[_0x630c('0x25')],'id');return _0x245080['removeSmsInteractions'](_0x466bc3)['then'](function(){for(var _0x39c0ab=0x0;_0x39c0ab<_0x466bc3[_0x630c('0x18')];_0x39c0ab+=0x1){_0xa48269[_0x630c('0x48')](_0x630c('0x4e'),{'SmsInteractionId':Number(_0x466bc3[_0x39c0ab]),'UserId':Number(_0x245080['id'])});}});}})[_0x630c('0x11')](function(){if(_0xcc7e18===_0x630c('0x45')){var _0x3c08bd=_[_0x630c('0x46')](_0x245080['OpenchannelInteractions'],'id');return _0x245080[_0x630c('0x4f')](_0x3c08bd)[_0x630c('0x11')](function(){for(var _0x26a55f=0x0;_0x26a55f<_0x3c08bd['length'];_0x26a55f+=0x1){_0xa48269['emit'](_0x630c('0x50'),{'OpenchannelInteractionId':Number(_0x3c08bd[_0x26a55f]),'UserId':Number(_0x245080['id'])});}});}})[_0x630c('0x51')](function(_0x46e234){_0x350dfe['log'](_0x46e234);});}}function onDisconnect(_0x228453,_0x361d94){joinOrLeave(_0x228453,_0x630c('0x45'),_0x361d94);}function onConnect(_0x3294eb){joinOrLeave(_0x3294eb,'join');}exports['default']=function(_0x58b805){_0x58b805['on'](_0x630c('0x52'),function(_0x2478c0){_0x2478c0[_0x630c('0x53')](0x0);_0x2478c0[_0x630c('0x54')]=_0x2478c0[_0x630c('0x55')]['connection'][_0x630c('0x56')]+':'+_0x2478c0['request']['connection']['remotePort'];_0x2478c0[_0x630c('0x57')]=new Date();_0x2478c0['log']=function(_0x1b5149){console[_0x630c('0x58')]('SocketIO\x20'+_0x2478c0['nsp']['name']+'['+_0x2478c0[_0x630c('0x54')]+']',_0x1b5149);};_0x2478c0['on'](_0x630c('0x59'),function(){onDisconnect(_0x2478c0,_0x58b805);_0x2478c0[_0x630c('0x58')]('DISCONNECTED');});onConnect(_0x2478c0);_0x2478c0['log'](_0x630c('0x5a'));});}; \ No newline at end of file +var _0x80e0=['ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','SmsQueue','MailQueue','Trunk','VoiceQueues','ChatQueues','ChatQueue','FaxQueue','SmsQueues','MailQueues','OpenchannelQueue','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','all','chat','mail','openchannel','campaign:%s:%s','type','leave','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','join','default','setMaxListeners','address','request','connection','remoteAddress','remotePort','connectedAt','log','nsp','disconnect','DISCONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','User','role','agent','findOne','then','autoAssociation','FaxQueues','OpenchannelQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','telephone','Campaign','format','%s:queue:%s','Agents','length','handshake','find','userProfileId'];(function(_0x398107,_0x78b0d2){var _0x31604a=function(_0x6314d2){while(--_0x6314d2){_0x398107['push'](_0x398107['shift']());}};_0x31604a(++_0x78b0d2);}(_0x80e0,0x151));var _0x080e=function(_0x163998,_0x5a8c89){_0x163998=_0x163998-0x0;var _0x4bcfc3=_0x80e0[_0x163998];return _0x4bcfc3;};'use strict';var _=require(_0x080e('0x0'));var util=require(_0x080e('0x1'));var BPromise=require(_0x080e('0x2'));var db=require(_0x080e('0x3'))['db'];var config=require(_0x080e('0x4'));var queryQueues={'attributes':['id',_0x080e('0x5')],'include':[{'as':'Agents','model':db[_0x080e('0x6')],'attributes':['id',_0x080e('0x5'),_0x080e('0x7')],'raw':!![],'where':{'role':_0x080e('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x080e('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x080e('0x5')],'where':{'role':_0x080e('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x080e('0x5'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0x27a3e0,_0x4738bd,_0x4fe6ed){return db['UserProfileSection'][_0x080e('0x9')]({'where':{'name':_0x27a3e0,'userProfileId':_0x4738bd},'raw':!![]})[_0x080e('0xa')](function(_0x1e0b10){if(_0x1e0b10){if(_0x1e0b10[_0x080e('0xb')]){switch(_0x27a3e0){case'VoiceQueues':case'ChatQueues':case _0x080e('0xc'):case'SmsQueues':case'MailQueues':case _0x080e('0xd'):return db[_0x4fe6ed]['findAll'](queryQueues);case _0x080e('0xe'):return db[_0x4fe6ed][_0x080e('0xf')](queryTelephones);case _0x080e('0x10'):return db[_0x4fe6ed][_0x080e('0xf')](queryTrunks);case _0x080e('0x11'):return db[_0x4fe6ed][_0x080e('0xf')](queryCampaigns);}}else{return db[_0x080e('0x12')][_0x080e('0xf')]({'attributes':[_0x080e('0x13')],'where':{'sectionId':_0x1e0b10['id']},'raw':!![]})[_0x080e('0xa')](function(_0x1224a6){if(_0x1224a6){var _0x51978e={'where':{'id':_[_0x080e('0x14')](_0x1224a6,'resourceId')},'raw':!![]};switch(_0x4fe6ed){case _0x080e('0x6'):_0x51978e[_0x080e('0x15')][_0x080e('0x7')]=_0x080e('0x16');break;case _0x080e('0x17'):_0x51978e[_0x080e('0x15')]['type']='ivr';break;}return db[_0x4fe6ed]['findAll'](_0x51978e);}else{return[];}});}}else{return[];}})[_0x080e('0xa')](function(_0x31b4f6){return _0x31b4f6;});}function joinOrLeaveQueues(_0x4d1dd8,_0x54bce0,_0x596843,_0x8a65cb){_0x4d1dd8[_0x54bce0](util[_0x080e('0x18')](_0x080e('0x19'),_0x596843,_0x8a65cb['name']));if(_0x8a65cb[_0x080e('0x1a')]){for(var _0x206047=0x0;_0x206047<_0x8a65cb[_0x080e('0x1a')][_0x080e('0x1b')];_0x206047+=0x1){_0x4d1dd8[_0x54bce0](util[_0x080e('0x18')]('user:%s',_0x8a65cb[_0x080e('0x1a')][_0x206047]['name']));}}}function joinOrLeave(_0x2ae0c9,_0x9bc22c,_0x4f6507){var _0x33ecf5;if(_0x2ae0c9[_0x080e('0x1c')]['query']['id']){db[_0x080e('0x6')][_0x080e('0x1d')]({'attributes':['id',_0x080e('0x5'),_0x080e('0x7'),_0x080e('0x1e')],'where':{'id':_0x2ae0c9[_0x080e('0x1c')]['query']['id']},'include':[{'model':db[_0x080e('0x1f')],'as':_0x080e('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x080e('0x21')],'as':_0x080e('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x080e('0x23')],'as':_0x080e('0x24'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x080e('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x080e('0x26')],'as':_0x080e('0x27'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x17e240){if(_0x17e240){_0x33ecf5=_0x17e240;_0x2ae0c9[_0x9bc22c](util[_0x080e('0x18')](_0x080e('0x28'),_0x17e240[_0x080e('0x5')]));var _0x326e20=[];switch(_0x17e240['role']){case _0x080e('0x29'):_0x2ae0c9[_0x9bc22c](_0x080e('0x2a'));_0x2ae0c9[_0x9bc22c](_0x080e('0x2b'));if(queryQueues[_0x080e('0x2c')](_0x080e('0x2d'))){delete queryQueues[_0x080e('0x2d')];}_0x326e20[_0x080e('0x2e')](db[_0x080e('0x2f')][_0x080e('0xf')](queryQueues));_0x326e20[_0x080e('0x2e')](db['ChatQueue'][_0x080e('0xf')](queryQueues));_0x326e20['push'](db['FaxQueue'][_0x080e('0xf')](queryQueues));_0x326e20[_0x080e('0x2e')](db[_0x080e('0x30')]['findAll'](queryQueues));_0x326e20[_0x080e('0x2e')](db[_0x080e('0x31')][_0x080e('0xf')](queryQueues));_0x326e20[_0x080e('0x2e')](db['OpenchannelQueue'][_0x080e('0xf')](queryQueues));_0x326e20['push'](db[_0x080e('0x6')]['findAll'](queryTelephones));_0x326e20['push'](db[_0x080e('0x32')][_0x080e('0xf')](queryTrunks));_0x326e20[_0x080e('0x2e')](db[_0x080e('0x17')][_0x080e('0xf')](queryCampaigns));_0x326e20[_0x080e('0x2e')](db[_0x080e('0x6')][_0x080e('0xf')](queryAgents));break;case'user':_0x2ae0c9[_0x9bc22c](_0x080e('0x2a'));_0x2ae0c9[_0x9bc22c]('voice:outbound');_0x326e20[_0x080e('0x2e')](getAssociatedResources(_0x080e('0x33'),_0x17e240[_0x080e('0x1e')],_0x080e('0x2f')));_0x326e20[_0x080e('0x2e')](getAssociatedResources(_0x080e('0x34'),_0x17e240[_0x080e('0x1e')],_0x080e('0x35')));_0x326e20[_0x080e('0x2e')](getAssociatedResources(_0x080e('0xc'),_0x17e240[_0x080e('0x1e')],_0x080e('0x36')));_0x326e20[_0x080e('0x2e')](getAssociatedResources(_0x080e('0x37'),_0x17e240[_0x080e('0x1e')],'SmsQueue'));_0x326e20[_0x080e('0x2e')](getAssociatedResources(_0x080e('0x38'),_0x17e240['userProfileId'],_0x080e('0x31')));_0x326e20[_0x080e('0x2e')](getAssociatedResources('OpenchannelQueues',_0x17e240[_0x080e('0x1e')],_0x080e('0x39')));_0x326e20['push'](getAssociatedResources(_0x080e('0xe'),_0x17e240[_0x080e('0x1e')],_0x080e('0x6')));_0x326e20[_0x080e('0x2e')](getAssociatedResources(_0x080e('0x10'),_0x17e240[_0x080e('0x1e')],'Trunk'));_0x326e20[_0x080e('0x2e')](getAssociatedResources(_0x080e('0x11'),_0x17e240[_0x080e('0x1e')],_0x080e('0x17')));_0x326e20[_0x080e('0x2e')](db['User'][_0x080e('0xf')](queryAgents));break;case'agent':_0x2ae0c9[_0x9bc22c]('voice:inbound');_0x2ae0c9[_0x9bc22c]('voice:outbound');_0x326e20[_0x080e('0x2e')](_0x17e240[_0x080e('0x3a')]({'attributes':['id',_0x080e('0x5')]}));_0x326e20[_0x080e('0x2e')](_0x17e240['getChatQueues']({'attributes':['id',_0x080e('0x5')]}));_0x326e20[_0x080e('0x2e')](_0x17e240[_0x080e('0x3b')]({'attributes':['id',_0x080e('0x5')]}));_0x326e20[_0x080e('0x2e')](_0x17e240[_0x080e('0x3c')]({'attributes':['id',_0x080e('0x5')]}));_0x326e20[_0x080e('0x2e')](_0x17e240[_0x080e('0x3d')]({'attributes':['id',_0x080e('0x5')]}));_0x326e20[_0x080e('0x2e')](_0x17e240['getOpenchannelQueues']({'attributes':['id',_0x080e('0x5')]}));break;}return BPromise[_0x080e('0x3e')](_0x326e20);}})[_0x080e('0xa')](function(_0x48cf35){if(_0x48cf35&&_0x48cf35['length']){for(var _0xeae735=0x0;_0xeae735<_0x48cf35['length'];_0xeae735+=0x1){for(var _0x2b77c5=0x0;_0x2b77c5<_0x48cf35[_0xeae735]['length'];_0x2b77c5+=0x1){switch(_0xeae735){case 0x0:joinOrLeaveQueues(_0x2ae0c9,_0x9bc22c,'voice',_0x48cf35[_0xeae735][_0x2b77c5]);break;case 0x1:joinOrLeaveQueues(_0x2ae0c9,_0x9bc22c,_0x080e('0x3f'),_0x48cf35[_0xeae735][_0x2b77c5]);break;case 0x2:joinOrLeaveQueues(_0x2ae0c9,_0x9bc22c,'fax',_0x48cf35[_0xeae735][_0x2b77c5]);break;case 0x3:joinOrLeaveQueues(_0x2ae0c9,_0x9bc22c,'sms',_0x48cf35[_0xeae735][_0x2b77c5]);break;case 0x4:joinOrLeaveQueues(_0x2ae0c9,_0x9bc22c,_0x080e('0x40'),_0x48cf35[_0xeae735][_0x2b77c5]);break;case 0x5:joinOrLeaveQueues(_0x2ae0c9,_0x9bc22c,_0x080e('0x41'),_0x48cf35[_0xeae735][_0x2b77c5]);break;case 0x6:_0x2ae0c9[_0x9bc22c](util[_0x080e('0x18')]('telephone:%s',_0x48cf35[_0xeae735][_0x2b77c5][_0x080e('0x5')]));break;case 0x7:_0x2ae0c9[_0x9bc22c](util[_0x080e('0x18')]('trunk:%s',_0x48cf35[_0xeae735][_0x2b77c5][_0x080e('0x5')]));break;case 0x8:_0x2ae0c9[_0x9bc22c](util[_0x080e('0x18')](_0x080e('0x42'),_0x48cf35[_0xeae735][_0x2b77c5][_0x080e('0x43')],_0x48cf35[_0xeae735][_0x2b77c5]['name']));break;case 0x9:_0x2ae0c9[_0x9bc22c](util[_0x080e('0x18')](_0x080e('0x28'),_0x48cf35[_0xeae735][_0x2b77c5][_0x080e('0x5')]));break;}}}}})[_0x080e('0xa')](function(){if(_0x9bc22c===_0x080e('0x44')){var _0x13e6ca=_['map'](_0x33ecf5['ChatInteractions'],'id');return _0x33ecf5['removeChatInteractions'](_0x13e6ca)[_0x080e('0xa')](function(){for(var _0x39325f=0x0;_0x39325f<_0x13e6ca[_0x080e('0x1b')];_0x39325f+=0x1){_0x4f6507['emit'](_0x080e('0x45'),{'ChatInteractionId':Number(_0x13e6ca[_0x39325f]),'UserId':Number(_0x33ecf5['id'])});}});}})[_0x080e('0xa')](function(){if(_0x9bc22c===_0x080e('0x44')){var _0x28876d=_[_0x080e('0x14')](_0x33ecf5[_0x080e('0x22')],'id');return _0x33ecf5[_0x080e('0x46')](_0x28876d)['then'](function(){for(var _0x469bcd=0x0;_0x469bcd<_0x28876d[_0x080e('0x1b')];_0x469bcd+=0x1){_0x4f6507[_0x080e('0x47')](_0x080e('0x48'),{'MailInteractionId':Number(_0x28876d[_0x469bcd]),'UserId':Number(_0x33ecf5['id'])});}});}})[_0x080e('0xa')](function(){if(_0x9bc22c==='leave'){var _0x19687c=_[_0x080e('0x14')](_0x33ecf5[_0x080e('0x24')],'id');return _0x33ecf5[_0x080e('0x49')](_0x19687c)[_0x080e('0xa')](function(){for(var _0x26f356=0x0;_0x26f356<_0x19687c[_0x080e('0x1b')];_0x26f356+=0x1){_0x4f6507[_0x080e('0x47')](_0x080e('0x4a'),{'FaxInteractionId':Number(_0x19687c[_0x26f356]),'UserId':Number(_0x33ecf5['id'])});}});}})[_0x080e('0xa')](function(){if(_0x9bc22c==='leave'){var _0x59d470=_[_0x080e('0x14')](_0x33ecf5[_0x080e('0x25')],'id');return _0x33ecf5['removeSmsInteractions'](_0x59d470)[_0x080e('0xa')](function(){for(var _0x5a0280=0x0;_0x5a0280<_0x59d470['length'];_0x5a0280+=0x1){_0x4f6507[_0x080e('0x47')](_0x080e('0x4b'),{'SmsInteractionId':Number(_0x59d470[_0x5a0280]),'UserId':Number(_0x33ecf5['id'])});}});}})['then'](function(){if(_0x9bc22c===_0x080e('0x44')){var _0x41dc61=_[_0x080e('0x14')](_0x33ecf5[_0x080e('0x27')],'id');return _0x33ecf5[_0x080e('0x4c')](_0x41dc61)[_0x080e('0xa')](function(){for(var _0x2b6168=0x0;_0x2b6168<_0x41dc61[_0x080e('0x1b')];_0x2b6168+=0x1){_0x4f6507[_0x080e('0x47')](_0x080e('0x4d'),{'OpenchannelInteractionId':Number(_0x41dc61[_0x2b6168]),'UserId':Number(_0x33ecf5['id'])});}});}})[_0x080e('0x4e')](function(_0x5d3409){_0x2ae0c9['log'](_0x5d3409);});}}function onDisconnect(_0x5b5b0c,_0x628089){joinOrLeave(_0x5b5b0c,_0x080e('0x44'),_0x628089);}function onConnect(_0x2145b3){joinOrLeave(_0x2145b3,_0x080e('0x4f'));}exports[_0x080e('0x50')]=function(_0x4442ac){_0x4442ac['on']('connection',function(_0x3577ff){_0x3577ff[_0x080e('0x51')](0x0);_0x3577ff[_0x080e('0x52')]=_0x3577ff[_0x080e('0x53')][_0x080e('0x54')][_0x080e('0x55')]+':'+_0x3577ff['request'][_0x080e('0x54')][_0x080e('0x56')];_0x3577ff[_0x080e('0x57')]=new Date();_0x3577ff[_0x080e('0x58')]=function(_0x18ba13){console[_0x080e('0x58')]('SocketIO\x20'+_0x3577ff[_0x080e('0x59')][_0x080e('0x5')]+'['+_0x3577ff['address']+']',_0x18ba13);};_0x3577ff['on'](_0x080e('0x5a'),function(){onDisconnect(_0x3577ff,_0x4442ac);_0x3577ff[_0x080e('0x58')](_0x080e('0x5b'));});onConnect(_0x3577ff);_0x3577ff[_0x080e('0x58')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 32f085a..7d4b9ab 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 _0x5d7b=['then','SIP/%s','channel','incomingmessage','outgoingmessage','event','opened','changed','closed','format','length','hasOwnProperty','model','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','Chat','ChatInteraction','afterCreate','newinteraction','closedinteraction','ChatMessage','newmessage','Sms','FaxInteraction','Fax','afterUpdate','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','info','error','catch','Trigger,\x20%s','UserId','find','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5d7b,0xfb));var _0xb5d7=function(_0x513254,_0x1305ca){_0x513254=_0x513254-0x0;var _0x384c92=_0x5d7b[_0x513254];return _0x384c92;};'use strict';var util=require(_0xb5d7('0x0'));var db=require(_0xb5d7('0x1'))['db'];var jayson=require(_0xb5d7('0x2'));var logger=require(_0xb5d7('0x3'))(_0xb5d7('0x4'));var client=jayson[_0xb5d7('0x5')]['http']({'port':0x232a});var triggers=[{'channel':_0xb5d7('0x6'),'model':_0xb5d7('0x7'),'event':_0xb5d7('0x8'),'condition':_0xb5d7('0x9'),'callback':afterCreate},{'channel':_0xb5d7('0x6'),'model':_0xb5d7('0x7'),'event':'afterUpdate','condition':_0xb5d7('0xa'),'callback':afterUpdate},{'channel':'Chat','model':_0xb5d7('0xb'),'event':_0xb5d7('0x8'),'condition':_0xb5d7('0xc'),'callback':afterCreateMessage},{'channel':_0xb5d7('0xd'),'model':'SmsInteraction','event':'afterCreate','condition':_0xb5d7('0x9'),'callback':afterCreate},{'channel':'Sms','model':'SmsInteraction','event':'afterUpdate','condition':_0xb5d7('0xa'),'callback':afterUpdate},{'channel':_0xb5d7('0xd'),'model':'SmsMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Fax','model':_0xb5d7('0xe'),'event':_0xb5d7('0x8'),'condition':_0xb5d7('0x9'),'callback':afterCreate},{'channel':_0xb5d7('0xf'),'model':'FaxInteraction','event':_0xb5d7('0x10'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xb5d7('0xf'),'model':'FaxMessage','event':_0xb5d7('0x8'),'condition':_0xb5d7('0xc'),'callback':afterCreateMessage},{'channel':_0xb5d7('0x11'),'model':_0xb5d7('0x12'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xb5d7('0x11'),'model':_0xb5d7('0x12'),'event':'afterUpdate','condition':_0xb5d7('0xa'),'callback':afterUpdate},{'channel':_0xb5d7('0x11'),'model':_0xb5d7('0x13'),'event':_0xb5d7('0x8'),'condition':_0xb5d7('0xc'),'callback':afterCreateMessage},{'channel':_0xb5d7('0x14'),'model':_0xb5d7('0x15'),'event':_0xb5d7('0x8'),'condition':_0xb5d7('0x9'),'callback':afterCreate},{'channel':_0xb5d7('0x14'),'model':_0xb5d7('0x15'),'event':_0xb5d7('0x10'),'condition':_0xb5d7('0xa'),'callback':afterUpdate},{'channel':_0xb5d7('0x14'),'model':_0xb5d7('0x16'),'event':_0xb5d7('0x8'),'condition':_0xb5d7('0xc'),'callback':afterCreateMessage}];function request(_0x224452){return client['request'](_0xb5d7('0x17'),_0x224452)['then'](function(_0x219fdd){logger[_0xb5d7('0x18')]('Trigger,\x20%s',_0xb5d7('0x17'),_0x219fdd);if(_0x219fdd['error']){if(_0x219fdd[_0xb5d7('0x19')]['code']===0x1f4){logger[_0xb5d7('0x19')]('Trigger,\x20%s',_0xb5d7('0x17'),_0x219fdd[_0xb5d7('0x19')]);}}})[_0xb5d7('0x1a')](function(_0x393c1c){logger['error'](_0xb5d7('0x1b'),_0xb5d7('0x17'),_0x393c1c);});}function afterCreateMessage(_0x2c5134,_0x36e137){return function(_0x356ee6,_0x2bbf8e){_0x356ee6=_0x356ee6['get']({'plain':!![]});_0x356ee6['channel']=_0x2c5134;_0x356ee6['event']=_0x356ee6['direction'];if(_0x356ee6[_0xb5d7('0x1c')]){return db['User'][_0xb5d7('0x1d')]({'where':{'id':_0x356ee6[_0xb5d7('0x1c')]},'attributes':['id',_0xb5d7('0x1e')],'raw':!![]})[_0xb5d7('0x1f')](function(_0x3d184a){_0x356ee6['interface']=util['format'](_0xb5d7('0x20'),_0x3d184a[_0xb5d7('0x1e')]);_0x356ee6[_0xb5d7('0x21')]=_0x2c5134;return request({'event':_0xb5d7('0x22'),'message':_0x356ee6});})[_0xb5d7('0x1a')](function(_0x38bba8){console['error'](_0x38bba8);});}else{return request({'event':_0xb5d7('0x23'),'message':_0x356ee6});}};}function afterCreate(_0x3c80b2,_0x8327c3){return function(_0x429856,_0x3927db){_0x429856=_0x429856['get']({'plain':!![]});_0x429856[_0xb5d7('0x21')]=_0x3c80b2;_0x429856[_0xb5d7('0x24')]=_0xb5d7('0x25');return request({'event':_0x8327c3,'message':_0x429856});};}function afterUpdate(_0x339ef8,_0x3e4bec){return function(_0x234ec5,_0x37420e){if(_0x234ec5[_0xb5d7('0x26')](_0xb5d7('0x27'))&&_0x234ec5['closed']){_0x234ec5=_0x234ec5['get']({'plain':!![]});_0x234ec5['channel']=_0x339ef8;_0x234ec5[_0xb5d7('0x24')]=_0xb5d7('0x27');if(_0x234ec5[_0xb5d7('0x1c')]){return db['User'][_0xb5d7('0x1d')]({'where':{'id':_0x234ec5[_0xb5d7('0x1c')]},'attributes':['id',_0xb5d7('0x1e')],'raw':!![]})[_0xb5d7('0x1f')](function(_0x59b469){_0x234ec5['interface']=util[_0xb5d7('0x28')](_0xb5d7('0x20'),_0x59b469[_0xb5d7('0x1e')]);return request({'event':_0x3e4bec,'message':_0x234ec5});})[_0xb5d7('0x1a')](function(_0x1eadd3){console[_0xb5d7('0x19')](_0x1eadd3);});}else{return request({'event':_0x3e4bec,'message':_0x234ec5});}}};}exports['default']=function(){for(var _0x15e673=0x0;_0x15e673=_0x58f7f8[_0x8646('0x14')]){throw Error(_0x8646('0x15'));}_0x14b21d(_0x1392b7);})['catch'](function(_0x3a1925){_0x45dfcf(_0x3a1925);});});}; \ No newline at end of file +var _0x22cd=['getLicense','User','count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','fax','sms','getChannels','isValidChannel','clearBlockUser','isUndefined','blockedAt','updateAttributes'];(function(_0x3a1972,_0x194511){var _0xc7e0b5=function(_0x465312){while(--_0x465312){_0x3a1972['push'](_0x3a1972['shift']());}};_0xc7e0b5(++_0x194511);}(_0x22cd,0xec));var _0xd22c=function(_0x1d7791,_0x2a291f){_0x1d7791=_0x1d7791-0x0;var _0x2293f8=_0x22cd[_0x1d7791];return _0x2293f8;};'use strict';var _=require(_0xd22c('0x0'));var BPromise=require(_0xd22c('0x1'));var db=require(_0xd22c('0x2'))['db'];var util=require('./license/util');var channels=['voice','mail','chat',_0xd22c('0x3'),_0xd22c('0x4'),'openchannel'];exports[_0xd22c('0x5')]=function(){return channels;};exports[_0xd22c('0x6')]=function(_0x4a5b8c){_0x4a5b8c=_0x4a5b8c['toLowerCase']();return _['includes'](channels,_0x4a5b8c);};exports[_0xd22c('0x7')]=function(_0x4fd678,_0x1b7d07,_0x11f098,_0x48c832){var _0x5ef2d9={'loginAttempts':_0x1b7d07,'blocked':_0x11f098};if(!_[_0xd22c('0x8')](_0x48c832)){_0x5ef2d9[_0xd22c('0x9')]=_0x48c832;}return _0x4fd678[_0xd22c('0xa')](_0x5ef2d9);};exports[_0xd22c('0xb')]=function(_0x5ba498){return new BPromise(function(_0x172a9b,_0x5db9f0){var _0x221044=0x0;if(_0x5ba498['role']!=='agent'){_0x172a9b(_0x5ba498);}db[_0xd22c('0xc')][_0xd22c('0xd')]({'where':{'role':_0xd22c('0xe'),'online':!![],'id':{'$ne':_0x5ba498['id']}}})[_0xd22c('0xf')](function(_0x3630d4){_0x221044=_0x3630d4;return util[_0xd22c('0xb')]();})[_0xd22c('0xf')](function(_0x30abf4){if(_0x30abf4&&_0x30abf4[_0xd22c('0x10')]&&_0x221044>=_0x30abf4[_0xd22c('0x10')]){throw Error(_0xd22c('0x11'));}_0x172a9b(_0x5ba498);})[_0xd22c('0x12')](function(_0x47390e){_0x5db9f0(_0x47390e);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 992c226..4df7e62 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc42c=['render','json','exports','404','status'];(function(_0x19454e,_0x436336){var _0x11e26e=function(_0x27b585){while(--_0x27b585){_0x19454e['push'](_0x19454e['shift']());}};_0x11e26e(++_0x436336);}(_0xc42c,0xed));var _0xcc42=function(_0x544877,_0x1a9bcd){_0x544877=_0x544877-0x0;var _0x43d994=_0xc42c[_0x544877];return _0x43d994;};'use strict';module[_0xcc42('0x0')][0x194]=function pageNotFound(_0x2916a5,_0x4ce277){var _0x11bcc1=_0xcc42('0x1');var _0x3c4850=0x194;var _0x923ea7={'status':_0x3c4850};_0x4ce277[_0xcc42('0x2')](_0x923ea7[_0xcc42('0x2')]);_0x4ce277[_0xcc42('0x3')](_0x11bcc1,{},function(_0x4ff502,_0x2bfe5d){if(_0x4ff502){return _0x4ce277[_0xcc42('0x2')](_0x923ea7[_0xcc42('0x2')])[_0xcc42('0x4')](_0x923ea7);}_0x4ce277['send'](_0x2bfe5d);});}; \ No newline at end of file +var _0xb91d=['404','status','render','json','exports'];(function(_0x1ee73f,_0x3b0729){var _0x5954f9=function(_0x2cf6b5){while(--_0x2cf6b5){_0x1ee73f['push'](_0x1ee73f['shift']());}};_0x5954f9(++_0x3b0729);}(_0xb91d,0xc2));var _0xdb91=function(_0xc87d08,_0x59c9be){_0xc87d08=_0xc87d08-0x0;var _0x30a714=_0xb91d[_0xc87d08];return _0x30a714;};'use strict';module[_0xdb91('0x0')][0x194]=function pageNotFound(_0x343d74,_0x17d505){var _0x3da6e2=_0xdb91('0x1');var _0x322c0c=0x194;var _0x2404dc={'status':_0x322c0c};_0x17d505[_0xdb91('0x2')](_0x2404dc[_0xdb91('0x2')]);_0x17d505[_0xdb91('0x3')](_0x3da6e2,{},function(_0xb060f6,_0x3806b9){if(_0xb060f6){return _0x17d505[_0xdb91('0x2')](_0x2404dc[_0xdb91('0x2')])[_0xdb91('0x4')](_0x2404dc);}_0x17d505['send'](_0x3806b9);});}; \ No newline at end of file diff --git a/server/files/chat/iframe.js b/server/files/chat/iframe.js index 4525f8a..bab14c7 100644 --- a/server/files/chat/iframe.js +++ b/server/files/chat/iframe.js @@ -3,13 +3,13 @@ var iframe = document.createElement('iframe'); // Attributes iframe['id'] = 'motion-chat-iframe'; - iframe['src'] = '{{{remote}}}/snippet?location=' + btoa(window.location.host) + '&version=1.0.14&{{{query}}}'; + iframe['src'] = '{{{remote}}}/snippet?location=' + btoa(window.location.host) + '&version=1.0.15&{{{query}}}'; var alignment="<%=alignment%>"; var verticalAlignment="<%=verticalAlignment%>"; var link_mobile = document.createElement('link'); - link_mobile.href = '{{{remote}}}/snippet/styles/mobile.css?version=1.0.14'; + link_mobile.href = '{{{remote}}}/snippet/styles/mobile.css?version=1.0.15'; link_mobile.rel='stylesheet'; link_mobile.type = "text/css"; diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index a26c553..de798ae 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa2d9=['FromId','SessionId','ProjectId','team_has_fax_queues','FaxQueues','Hoppers','CampaignId','TrunkId','TrunkBackup','SquareProjectId','Lists','MailTransferReport','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToAccount','ChatTransferReport','ToChatQueueId','ToQueue','ToFaxQueueId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','CustomFields','UserProfileSections','UserProfileResource','sectionId','exports','path','../config/environment','sequelize','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','sequelizeHistory','utf8_general_ci','database','password','options','username','import','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','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','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','CmCustomField','Action','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','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','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','Integration','Network','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','JscriptyProject','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileResource/userProfileResource.model','hasOne','UserId','hasMany','Recordings','User','VoiceQueuesRt','Extensions','cascade','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','MailInteractions','belongsTo','UserProfile','userProfileId','belongsToMany','ChatGroup','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','Team','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','SmsInteraction','user_has_openchannel_interactions','MailQueue','MailQueues','ChatQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','SquareProjects','user_has_square_projects','SpiedAgents','Members','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkBackupId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','VoiceQueueReport','uniqueid','CmContact','Contact','ContactId','MailAccountId','Smtp','Answers','Interactions','Applications','List','ListId','Template','team_has_mail_queues','Account','Owner','mail_interaction_has_tags','Tags','user_has_mail_interactions','MailMessage','Attachments','Interaction','restrict','IntervalId','TagId','Items','FaxAccountId','Exntensions','FaxMessage','user_has_fax_accounts','FaxApplication','FaxInteractionId','fax_interaction_has_tags','Users','AttachmentId','SmsAccountId','SmsMessage','user_has_sms_accounts','sms_interaction_has_tags','ThroughTags','SmsInteractionId','SmsQueueId','team_has_sms_queues','Dispositions','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ChatMessage','OpenchannelQueueReport','Queue','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','ChatOfflineMessage','team_has_chat_queues','ChatGroupId','CompanyId','Company','cm_contact_has_tags','OwnerId','All','OneAny','AutomationAnyId','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Mohs','moh_has_sounds','AllConditions','TriggerAllId','AnyConditions','TriggerAnyId','Actions','TriggerId','Fields','CustomReportId','MetricId','Configurations','AccountId','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Field','VariableId','SugarcrmAccount','SugarcrmConfiguration','Subjects','Description','DeskAccount','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','int_vtiger_configuration_has_tags','ServicenowConfiguration','ChatQueueReport'];(function(_0x542498,_0x5b0a9a){var _0x59db78=function(_0x4493f8){while(--_0x4493f8){_0x542498['push'](_0x542498['shift']());}};_0x59db78(++_0x5b0a9a);}(_0xa2d9,0x1d7));var _0x9a2d=function(_0x570e95,_0x31ecaa){_0x570e95=_0x570e95-0x0;var _0x69d4fe=_0xa2d9[_0x570e95];return _0x69d4fe;};'use strict';var path=require(_0x9a2d('0x0'));var config=require(_0x9a2d('0x1'));var Sequelize=require(_0x9a2d('0x2'));var _=require('lodash');var jstz=require(_0x9a2d('0x3'));var timezone=jstz[_0x9a2d('0x4')]();config[_0x9a2d('0x2')]=_[_0x9a2d('0x5')](config[_0x9a2d('0x2')],{'database':_0x9a2d('0x6'),'username':_0x9a2d('0x7'),'password':_0x9a2d('0x8'),'options':{'host':_0x9a2d('0x9'),'port':0xcea,'dialect':_0x9a2d('0xa'),'dialectOptions':{'charset':_0x9a2d('0xb')},'logging':![],'timezone':timezone[_0x9a2d('0xc')](),'define':{'charset':_0x9a2d('0xd'),'collate':'utf8_general_ci'}}});config[_0x9a2d('0xe')]=_[_0x9a2d('0x5')](config[_0x9a2d('0xe')],{'database':'motion2','username':_0x9a2d('0x7'),'password':'xC@LL1234','options':{'host':_0x9a2d('0x9'),'port':0xcea,'dialect':_0x9a2d('0xa'),'dialectOptions':{'charset':_0x9a2d('0xb')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x9a2d('0xd'),'collate':_0x9a2d('0xf')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x9a2d('0x10')],config['sequelize']['username'],config[_0x9a2d('0x2')][_0x9a2d('0x11')],config[_0x9a2d('0x2')][_0x9a2d('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9a2d('0xe')][_0x9a2d('0x10')],config[_0x9a2d('0xe')][_0x9a2d('0x13')],config[_0x9a2d('0xe')]['password'],config[_0x9a2d('0xe')][_0x9a2d('0x12')])};db['User']=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/user/user.model');db[_0x9a2d('0x15')]=db['sequelize'][_0x9a2d('0x14')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x9a2d('0x16')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x17'));db[_0x9a2d('0x18')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x19'));db[_0x9a2d('0x1a')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x1b'));db[_0x9a2d('0x1c')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x1d'));db[_0x9a2d('0x1e')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x1f'));db['ScreenRecording']=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x20'));db[_0x9a2d('0x21')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x22'));db['VoiceMailMessage']=db['sequelize']['import'](_0x9a2d('0x23'));db[_0x9a2d('0x24')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x25'));db['VoiceAgentReport']=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x26'));db['VoiceQueueReport']=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x27'));db[_0x9a2d('0x28')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/memberReport/memberReport.model');db[_0x9a2d('0x29')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x2a'));db['VoiceTransferReport']=db['sequelize'][_0x9a2d('0x14')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x9a2d('0x2b')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x2c'));db[_0x9a2d('0x2d')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x9a2d('0x2e')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x2f'));db[_0x9a2d('0x30')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x31'));db['UserFaxQueue']=db['sequelize']['import']('../api/userFaxQueue/userFaxQueue.model');db[_0x9a2d('0x32')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x33'));db['UserOpenchannelQueue']=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x34'));db[_0x9a2d('0x35')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0x9a2d('0x36')]=db['sequelize'][_0x9a2d('0x14')](_0x9a2d('0x37'));db[_0x9a2d('0x38')]=db['sequelize']['import'](_0x9a2d('0x39'));db['MailQueue']=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x3a'));db[_0x9a2d('0x3b')]=db['sequelize'][_0x9a2d('0x14')]('../api/mailSubstatus/mailSubstatus.model');db[_0x9a2d('0x3c')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x3d'));db['MailMessage']=db['sequelize'][_0x9a2d('0x14')]('../api/mailMessage/mailMessage.model');db[_0x9a2d('0x3e')]=db['sequelize'][_0x9a2d('0x14')]('../api/mailApplication/mailApplication.model');db[_0x9a2d('0x3f')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x40'));db[_0x9a2d('0x41')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x42'));db[_0x9a2d('0x43')]=db['sequelize'][_0x9a2d('0x14')]('../api/dashboardItem/dashboardItem.model');db[_0x9a2d('0x44')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x45'));db['FaxApplication']=db['sequelize'][_0x9a2d('0x14')](_0x9a2d('0x46'));db[_0x9a2d('0x47')]=db['sequelize'][_0x9a2d('0x14')](_0x9a2d('0x48'));db['FaxMessage']=db['sequelize']['import'](_0x9a2d('0x49'));db[_0x9a2d('0x4a')]=db['sequelize'][_0x9a2d('0x14')](_0x9a2d('0x4b'));db[_0x9a2d('0x4c')]=db['sequelize'][_0x9a2d('0x14')](_0x9a2d('0x4d'));db['SmsAccount']=db['sequelize'][_0x9a2d('0x14')](_0x9a2d('0x4e'));db[_0x9a2d('0x4f')]=db['sequelize'][_0x9a2d('0x14')](_0x9a2d('0x50'));db['SmsInteraction']=db['sequelize']['import'](_0x9a2d('0x51'));db['SmsMessage']=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x52'));db[_0x9a2d('0x53')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x54'));db[_0x9a2d('0x55')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x56'));db['OpenchannelApplication']=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x57'));db[_0x9a2d('0x58')]=db[_0x9a2d('0x2')]['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0x9a2d('0x59')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x5a'));db[_0x9a2d('0x5b')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/openchannelQueue/openchannelQueue.model');db[_0x9a2d('0x5c')]=db[_0x9a2d('0x2')]['import']('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x5d'));db[_0x9a2d('0x5e')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x5f'));db[_0x9a2d('0x60')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x61'));db['ChatMessage']=db['sequelize'][_0x9a2d('0x14')]('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x62'));db[_0x9a2d('0x63')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x64'));db['ChatGroup']=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x65'));db[_0x9a2d('0x66')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x67'));db[_0x9a2d('0x68')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x69'));db['CmContact']=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x6a'));db[_0x9a2d('0x6b')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x6c'));db[_0x9a2d('0x6d')]=db['sequelize'][_0x9a2d('0x14')](_0x9a2d('0x6e'));db[_0x9a2d('0x6f')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x70'));db[_0x9a2d('0x71')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db[_0x9a2d('0x2')]['import']('../api/reportAgentPreview/reportAgentPreview.model');db[_0x9a2d('0x72')]=db['sequelize'][_0x9a2d('0x14')]('../api/cmCustomField/cmCustomField.model');db[_0x9a2d('0x73')]=db[_0x9a2d('0x2')]['import']('../api/action/action.model');db[_0x9a2d('0x74')]=db['sequelize'][_0x9a2d('0x14')]('../api/automation/automation.model');db[_0x9a2d('0x75')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x76'));db[_0x9a2d('0x77')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x78'));db[_0x9a2d('0x79')]=db['sequelize'][_0x9a2d('0x14')](_0x9a2d('0x7a'));db[_0x9a2d('0x7b')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x7c'));db['Pause']=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x7d'));db[_0x9a2d('0x7e')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x7f'));db[_0x9a2d('0x80')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x81'));db[_0x9a2d('0x82')]=db['sequelize']['import'](_0x9a2d('0x83'));db[_0x9a2d('0x84')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/sound/sound.model');db[_0x9a2d('0x85')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x86'));db['Template']=db['sequelize'][_0x9a2d('0x14')](_0x9a2d('0x87'));db[_0x9a2d('0x88')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/trigger/trigger.model');db[_0x9a2d('0x89')]=db['sequelize'][_0x9a2d('0x14')](_0x9a2d('0x8a'));db['Integration']=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x8b'));db[_0x9a2d('0x8c')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x8d'));db[_0x9a2d('0x8e')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x8f'));db[_0x9a2d('0x90')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x91'));db[_0x9a2d('0x92')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x9a2d('0x93')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x94'));db[_0x9a2d('0x95')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x96'));db['AnalyticTreeReport']=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x97'));db[_0x9a2d('0x98')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x99'));db[_0x9a2d('0x9a')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0x9b'));db[_0x9a2d('0x9c')]=db['sequelize'][_0x9a2d('0x14')]('../api/intSalesforceField/intSalesforceField.model');db['SugarcrmAccount']=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x9d'));db['SugarcrmConfiguration']=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x9a2d('0x9e')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x9f'));db['DeskAccount']=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0xa0'));db[_0x9a2d('0xa1')]=db['sequelize'][_0x9a2d('0x14')](_0x9a2d('0xa2'));db[_0x9a2d('0xa3')]=db['sequelize']['import']('../api/intDeskField/intDeskField.model');db[_0x9a2d('0xa4')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/intZohoAccount/intZohoAccount.model');db[_0x9a2d('0xa5')]=db[_0x9a2d('0x2')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x9a2d('0xa6')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0xa7'));db[_0x9a2d('0xa8')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0xa9'));db[_0x9a2d('0xaa')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0xab'));db[_0x9a2d('0xac')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/intZendeskField/intZendeskField.model');db[_0x9a2d('0xad')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0xae'));db[_0x9a2d('0xaf')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0xb0'));db[_0x9a2d('0xb1')]=db['sequelize'][_0x9a2d('0x14')](_0x9a2d('0xb2'));db[_0x9a2d('0xb3')]=db['sequelize']['import'](_0x9a2d('0xb4'));db[_0x9a2d('0xb5')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0xb6'));db[_0x9a2d('0xb7')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0xb8'));db[_0x9a2d('0xb9')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0xba'));db['ServicenowConfiguration']=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0xbb'));db[_0x9a2d('0xbc')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/intServicenowField/intServicenowField.model');db[_0x9a2d('0xbd')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0xbe'));db[_0x9a2d('0xbf')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x9a2d('0xc0')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0xc1'));db[_0x9a2d('0xc2')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0x8b'));db[_0x9a2d('0xc3')]=db['sequelize'][_0x9a2d('0x14')]('../api/network/network.model');db['ChatQueueReport']=db['sequelize']['import'](_0x9a2d('0xc4'));db[_0x9a2d('0xc5')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x9a2d('0xc6')]=db['sequelize'][_0x9a2d('0x14')](_0x9a2d('0xc7'));db[_0x9a2d('0xc8')]=db['sequelize'][_0x9a2d('0x14')](_0x9a2d('0xc9'));db[_0x9a2d('0xca')]=db['sequelize'][_0x9a2d('0x14')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x9a2d('0xcb')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0xcc'));db['SquareReport']=db['sequelize'][_0x9a2d('0x14')]('../api/squareReport/squareReport.model');db['SquareDetailsReport']=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/squareReportDetail/squareReportDetail.model');db[_0x9a2d('0xcd')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/jscriptyProject/jscriptyProject.model');db[_0x9a2d('0xce')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/setting/setting.model');db[_0x9a2d('0xcf')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0xd0'));db[_0x9a2d('0xd1')]=db[_0x9a2d('0x2')]['import']('../api/squareProject/squareProject.model');db[_0x9a2d('0xd2')]=db['sequelize'][_0x9a2d('0x14')](_0x9a2d('0xd3'));db[_0x9a2d('0xd4')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/squareMessage/squareMessage.model');db['Team']=db[_0x9a2d('0x2')]['import']('../api/team/team.model');db[_0x9a2d('0xd5')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0xd6'));db[_0x9a2d('0xd7')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0xd8'));db['Migration']=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/migration/migration.model');db[_0x9a2d('0xd9')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0xda'));db[_0x9a2d('0xdb')]=db[_0x9a2d('0x2')]['import'](_0x9a2d('0xdc'));db['MailTransferReport']=db['sequelize'][_0x9a2d('0x14')](_0x9a2d('0xdd'));db['ChatTransferReport']=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0xde'));db[_0x9a2d('0xdf')]=db['sequelize'][_0x9a2d('0x14')](_0x9a2d('0xe0'));db[_0x9a2d('0xe1')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x9a2d('0xe2')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0xe3'));db[_0x9a2d('0xe4')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0xe5'));db[_0x9a2d('0xe6')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0xe7'));db['UserProfile']=db[_0x9a2d('0x2')]['import'](_0x9a2d('0xe8'));db[_0x9a2d('0xe9')]=db[_0x9a2d('0x2')][_0x9a2d('0x14')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0x9a2d('0x2')][_0x9a2d('0x14')](_0x9a2d('0xea'));db['User'][_0x9a2d('0xeb')](db[_0x9a2d('0x21')],{'as':_0x9a2d('0x21'),'onDelete':'cascade','foreignKey':_0x9a2d('0xec')});db['User'][_0x9a2d('0xed')](db[_0x9a2d('0x1e')],{'as':_0x9a2d('0xee'),'foreignKey':_0x9a2d('0xec')});db[_0x9a2d('0xef')][_0x9a2d('0xed')](db['UserVoiceQueueRt'],{'as':_0x9a2d('0xf0'),'foreignKey':_0x9a2d('0xec')});db[_0x9a2d('0xef')]['hasMany'](db[_0x9a2d('0x18')],{'as':_0x9a2d('0xf1'),'onDelete':_0x9a2d('0xf2'),'hooks':!![]});db[_0x9a2d('0xef')][_0x9a2d('0xed')](db['CmHopperFinal'],{'as':_0x9a2d('0xf3'),'foreignKey':_0x9a2d('0xec')});db[_0x9a2d('0xef')]['hasMany'](db[_0x9a2d('0x71')],{'as':_0x9a2d('0xf4'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0x9a2d('0xf5')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db['User'][_0x9a2d('0xed')](db['OpenchannelInteraction'],{'as':_0x9a2d('0xf6'),'foreignKey':_0x9a2d('0xec')});db['User']['hasMany'](db[_0x9a2d('0x60')],{'as':_0x9a2d('0xf7'),'foreignKey':'UserId'});db['User'][_0x9a2d('0xed')](db['SmsInteraction'],{'as':_0x9a2d('0xf8'),'foreignKey':'UserId'});db[_0x9a2d('0xef')][_0x9a2d('0xed')](db[_0x9a2d('0x47')],{'as':'FaxInteractions','foreignKey':_0x9a2d('0xec')});db[_0x9a2d('0xef')][_0x9a2d('0xed')](db['MailInteraction'],{'as':_0x9a2d('0xf9'),'foreignKey':'UserId'});db[_0x9a2d('0xef')][_0x9a2d('0xfa')](db[_0x9a2d('0xfb')],{'as':_0x9a2d('0xfb'),'foreignKey':_0x9a2d('0xfc')});db[_0x9a2d('0xef')][_0x9a2d('0xfd')](db[_0x9a2d('0xfe')],{'as':_0x9a2d('0xff'),'through':_0x9a2d('0x100')});db[_0x9a2d('0xef')]['belongsToMany'](db['CmContact'],{'as':_0x9a2d('0x101'),'through':_0x9a2d('0x102')});db[_0x9a2d('0xef')][_0x9a2d('0xfd')](db[_0x9a2d('0xe4')],{'as':'Lists','through':_0x9a2d('0x103')});db['User']['belongsToMany'](db[_0x9a2d('0x104')],{'through':'user_has_teams'});db[_0x9a2d('0xef')][_0x9a2d('0xfd')](db[_0x9a2d('0x3c')],{'as':_0x9a2d('0xf9'),'through':'user_has_mail_interactions'});db['User']['belongsToMany'](db[_0x9a2d('0x60')],{'as':_0x9a2d('0xf7'),'through':_0x9a2d('0x105')});db[_0x9a2d('0xef')]['belongsToMany'](db[_0x9a2d('0x47')],{'as':_0x9a2d('0x106'),'through':_0x9a2d('0x107')});db['User']['belongsToMany'](db[_0x9a2d('0x108')],{'as':'SmsInteractions','through':'user_has_sms_interactions'});db['User'][_0x9a2d('0xfd')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':_0x9a2d('0x109')});db[_0x9a2d('0xef')][_0x9a2d('0xfd')](db[_0x9a2d('0x1c')],{'as':'VoiceQueues','through':_0x9a2d('0x2d'),'required':![]});db[_0x9a2d('0xef')][_0x9a2d('0xfd')](db[_0x9a2d('0x10a')],{'as':_0x9a2d('0x10b'),'through':_0x9a2d('0x30'),'required':![]});db[_0x9a2d('0xef')][_0x9a2d('0xfd')](db[_0x9a2d('0x63')],{'as':_0x9a2d('0x10c'),'through':_0x9a2d('0x2e'),'required':![],'hooks':!![]});db['User'][_0x9a2d('0xfd')](db[_0x9a2d('0x4a')],{'as':'FaxQueues','through':_0x9a2d('0x10d'),'required':![]});db[_0x9a2d('0xef')][_0x9a2d('0xfd')](db['SmsQueue'],{'as':_0x9a2d('0x10e'),'through':_0x9a2d('0x32'),'required':![]});db[_0x9a2d('0xef')][_0x9a2d('0xfd')](db[_0x9a2d('0x5b')],{'as':_0x9a2d('0x10f'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0x9a2d('0xfd')](db[_0x9a2d('0xe4')],{'through':'cm_user_has_lists'});db[_0x9a2d('0xef')][_0x9a2d('0xfd')](db[_0x9a2d('0xe6')],{'as':'VoicePrefixes','through':_0x9a2d('0x110'),'required':![]});db[_0x9a2d('0xef')][_0x9a2d('0xfd')](db['ChatWebsite'],{'as':_0x9a2d('0x111'),'through':_0x9a2d('0x112')});db[_0x9a2d('0xef')]['belongsToMany'](db[_0x9a2d('0x44')],{'as':_0x9a2d('0x113'),'through':'user_has_fax_accounts'});db[_0x9a2d('0xef')][_0x9a2d('0xfd')](db[_0x9a2d('0x38')],{'as':_0x9a2d('0x114'),'through':_0x9a2d('0x115')});db[_0x9a2d('0xef')][_0x9a2d('0xfd')](db['OpenchannelAccount'],{'as':_0x9a2d('0x116'),'through':_0x9a2d('0x117')});db[_0x9a2d('0xef')][_0x9a2d('0xfd')](db[_0x9a2d('0x118')],{'as':_0x9a2d('0x119'),'through':'user_has_sms_accounts'});db[_0x9a2d('0xef')][_0x9a2d('0xfd')](db[_0x9a2d('0xd1')],{'as':_0x9a2d('0x11a'),'through':_0x9a2d('0x11b')});db[_0x9a2d('0x15')][_0x9a2d('0xed')](db[_0x9a2d('0x18')],{'as':_0x9a2d('0x11c'),'onDelete':_0x9a2d('0xf2'),'foreignKey':'ChanSpyId'});db[_0x9a2d('0x16')][_0x9a2d('0xed')](db[_0x9a2d('0x18')],{'onDelete':_0x9a2d('0xf2')});db['VoiceExtension'][_0x9a2d('0xed')](db[_0x9a2d('0x18')],{'as':'Applications','onDelete':_0x9a2d('0xf2')});db[_0x9a2d('0x1a')][_0x9a2d('0xfd')](db[_0x9a2d('0x84')],{'as':'Sounds','through':'moh_has_sounds'});db[_0x9a2d('0x1c')][_0x9a2d('0xed')](db[_0x9a2d('0x2b')],{'as':_0x9a2d('0x11d'),'foreignKey':_0x9a2d('0x11e')});db[_0x9a2d('0x1c')]['hasMany'](db[_0x9a2d('0x6b')],{'as':'Hoppers','foreignKey':_0x9a2d('0x11e')});db['VoiceQueue']['hasMany'](db[_0x9a2d('0x6f')],{'as':'HopperFinals','foreignKey':_0x9a2d('0x11e')});db[_0x9a2d('0x1c')][_0x9a2d('0xed')](db[_0x9a2d('0x71')],{'as':_0x9a2d('0x11f'),'foreignKey':'VoiceQueueId'});db[_0x9a2d('0x1c')][_0x9a2d('0xed')](db[_0x9a2d('0xf5')],{'as':_0x9a2d('0xf5'),'foreignKey':_0x9a2d('0x11e')});db[_0x9a2d('0x1c')][_0x9a2d('0xed')](db['CmHopperBlack'],{'as':_0x9a2d('0x120'),'foreignKey':_0x9a2d('0x11e')});db[_0x9a2d('0x1c')][_0x9a2d('0xed')](db[_0x9a2d('0xca')],{'as':_0x9a2d('0x121'),'foreignKey':'VoiceQueueId'});db[_0x9a2d('0x1c')][_0x9a2d('0xfa')](db['Trunk'],{'as':'Trunk','foreignKey':'TrunkId'});db['VoiceQueue']['belongsTo'](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0x9a2d('0x122')});db[_0x9a2d('0x1c')][_0x9a2d('0xfa')](db[_0x9a2d('0x7b')],{'as':_0x9a2d('0x7b'),'foreignKey':'IntervalId'});db[_0x9a2d('0x1c')][_0x9a2d('0xfa')](db[_0x9a2d('0x123')],{'as':_0x9a2d('0x124'),'foreignKey':_0x9a2d('0x125')});db['VoiceQueue'][_0x9a2d('0xfd')](db[_0x9a2d('0xe4')],{'as':'Lists','through':_0x9a2d('0x126')});db[_0x9a2d('0x1c')][_0x9a2d('0xfd')](db['User'],{'as':_0x9a2d('0x127'),'through':_0x9a2d('0x2d')});db[_0x9a2d('0x1c')]['belongsToMany'](db[_0x9a2d('0x104')],{'as':_0x9a2d('0x128'),'through':_0x9a2d('0x129')});db[_0x9a2d('0x1c')][_0x9a2d('0xfd')](db['CmList'],{'as':_0x9a2d('0x12a'),'through':_0x9a2d('0x12b')});db[_0x9a2d('0x1e')][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'as':_0x9a2d('0xef'),'foreignKey':_0x9a2d('0xec')});db['ScreenRecording'][_0x9a2d('0xfa')](db['User'],{'as':_0x9a2d('0xef'),'foreignKey':'UserId'});db[_0x9a2d('0x21')]['hasMany'](db[_0x9a2d('0x12c')],{'as':_0x9a2d('0x12d'),'onDelete':'cascade','foreignKey':_0x9a2d('0x12e'),'sourceKey':_0x9a2d('0x12f')});db['VoiceMailMessage'][_0x9a2d('0xfa')](db['VoiceMail'],{'foreignKey':_0x9a2d('0x12e'),'targetKey':'mailbox'});db[_0x9a2d('0x24')]['hasMany'](db[_0x9a2d('0x130')],{'as':'QueueCalls','foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0x9a2d('0xed')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':_0x9a2d('0x131'),'constraints':![]});db['VoiceCallReport'][_0x9a2d('0xfa')](db['User'],{'as':_0x9a2d('0xef'),'foreignKey':'UserId'});db['VoiceCallReport'][_0x9a2d('0xfa')](db[_0x9a2d('0x132')],{'as':_0x9a2d('0x133'),'foreignKey':_0x9a2d('0x134')});db['MailServerIn'][_0x9a2d('0xfa')](db['MailAccount'],{'as':_0x9a2d('0x38'),'foreignKey':'MailAccountId'});db[_0x9a2d('0x36')][_0x9a2d('0xfa')](db['MailAccount'],{'as':_0x9a2d('0x38'),'foreignKey':_0x9a2d('0x135')});db[_0x9a2d('0x38')][_0x9a2d('0xeb')](db[_0x9a2d('0x35')],{'as':'Imap','onDelete':'cascade'});db[_0x9a2d('0x38')][_0x9a2d('0xeb')](db[_0x9a2d('0x36')],{'as':_0x9a2d('0x136'),'onDelete':_0x9a2d('0xf2')});db[_0x9a2d('0x38')][_0x9a2d('0xed')](db[_0x9a2d('0x77')],{'as':'Dispositions','foreignKey':'MailAccountId'});db[_0x9a2d('0x38')][_0x9a2d('0xed')](db[_0x9a2d('0x75')],{'as':_0x9a2d('0x137'),'foreignKey':_0x9a2d('0x135')});db[_0x9a2d('0x38')][_0x9a2d('0xed')](db['MailMessage'],{'as':_0x9a2d('0x12d'),'foreignKey':_0x9a2d('0x135')});db[_0x9a2d('0x38')][_0x9a2d('0xed')](db['MailInteraction'],{'as':_0x9a2d('0x138')});db[_0x9a2d('0x38')][_0x9a2d('0xed')](db[_0x9a2d('0x3e')],{'as':_0x9a2d('0x139')});db[_0x9a2d('0x38')][_0x9a2d('0xfa')](db[_0x9a2d('0xe4')],{'as':_0x9a2d('0x13a'),'foreignKey':_0x9a2d('0x13b')});db['MailAccount'][_0x9a2d('0xfa')](db[_0x9a2d('0x13c')],{'as':_0x9a2d('0x13c'),'foreignKey':'TemplateId'});db[_0x9a2d('0x38')][_0x9a2d('0xfa')](db[_0x9a2d('0x123')],{'as':_0x9a2d('0x124'),'foreignKey':_0x9a2d('0x125')});db['MailAccount'][_0x9a2d('0xfd')](db[_0x9a2d('0xef')],{'as':'Agents','through':_0x9a2d('0x115')});db[_0x9a2d('0x10a')][_0x9a2d('0xfd')](db[_0x9a2d('0xef')],{'as':_0x9a2d('0x127'),'through':'UserMailQueue'});db[_0x9a2d('0x10a')][_0x9a2d('0xfd')](db['Team'],{'through':_0x9a2d('0x13d'),'as':_0x9a2d('0x128')});db[_0x9a2d('0x3c')][_0x9a2d('0xed')](db['MailMessage'],{'as':_0x9a2d('0x12d'),'onDelete':_0x9a2d('0xf2'),'foreignKey':'MailInteractionId'});db[_0x9a2d('0x3c')][_0x9a2d('0xfa')](db[_0x9a2d('0x38')],{'as':_0x9a2d('0x13e'),'foreignKey':'MailAccountId'});db[_0x9a2d('0x3c')][_0x9a2d('0xfa')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['MailInteraction'][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'as':_0x9a2d('0x13f'),'foreignKey':_0x9a2d('0xec')});db[_0x9a2d('0x3c')][_0x9a2d('0xfd')](db[_0x9a2d('0x85')],{'through':_0x9a2d('0x140'),'as':_0x9a2d('0x141')});db[_0x9a2d('0x3c')][_0x9a2d('0xfd')](db[_0x9a2d('0x85')],{'through':_0x9a2d('0x140'),'as':'ThroughTags'});db[_0x9a2d('0x3c')]['belongsToMany'](db['User'],{'as':'Users','through':_0x9a2d('0x142'),'foreignKey':'MailInteractionId'});db[_0x9a2d('0x143')][_0x9a2d('0xed')](db[_0x9a2d('0xd9')],{'as':_0x9a2d('0x144'),'onDelete':'cascade'});db[_0x9a2d('0x143')][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'as':_0x9a2d('0xef')});db[_0x9a2d('0x143')]['belongsTo'](db['CmContact'],{'onDelete':_0x9a2d('0xf2'),'as':_0x9a2d('0x133')});db['MailMessage'][_0x9a2d('0xfa')](db[_0x9a2d('0x3c')],{'as':_0x9a2d('0x145'),'foreignKey':'MailInteractionId'});db[_0x9a2d('0x143')][_0x9a2d('0xfa')](db[_0x9a2d('0x38')],{'as':_0x9a2d('0x13e'),'foreignKey':_0x9a2d('0x135')});db[_0x9a2d('0x3e')][_0x9a2d('0xfa')](db['User'],{'onDelete':_0x9a2d('0x146')});db['MailApplication'][_0x9a2d('0xfa')](db['MailQueue'],{'onDelete':'restrict'});db[_0x9a2d('0x3e')][_0x9a2d('0xfa')](db[_0x9a2d('0x38')],{'onDelete':_0x9a2d('0x146')});db[_0x9a2d('0x3e')][_0x9a2d('0xfa')](db[_0x9a2d('0x7b')],{'onDelete':_0x9a2d('0x146'),'foreignKey':_0x9a2d('0x147')});db[_0x9a2d('0x3e')][_0x9a2d('0xfa')](db[_0x9a2d('0x85')],{'onDelete':'restrict','foreignKey':_0x9a2d('0x148')});db['MailQueueReport']['belongsTo'](db[_0x9a2d('0x38')],{});db[_0x9a2d('0x3f')][_0x9a2d('0xfa')](db[_0x9a2d('0xe4')],{'as':'List','foreignKey':_0x9a2d('0x13b')});db[_0x9a2d('0x3f')][_0x9a2d('0xfa')](db['CmContact'],{'as':_0x9a2d('0x133'),'foreignKey':'ContactId'});db[_0x9a2d('0x3f')][_0x9a2d('0xfa')](db[_0x9a2d('0x3c')],{});db[_0x9a2d('0x3f')][_0x9a2d('0xfa')](db[_0x9a2d('0x143')],{});db['MailQueueReport'][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{});db['MailQueueReport'][_0x9a2d('0xfa')](db[_0x9a2d('0x10a')],{});db['Dashboard']['hasMany'](db[_0x9a2d('0x43')],{'as':_0x9a2d('0x149'),'onDelete':'cascade'});db[_0x9a2d('0x44')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0x9a2d('0x14a')});db[_0x9a2d('0x44')][_0x9a2d('0xed')](db[_0x9a2d('0x75')],{'as':_0x9a2d('0x137'),'foreignKey':_0x9a2d('0x14a')});db['FaxAccount'][_0x9a2d('0xed')](db[_0x9a2d('0x47')],{'as':_0x9a2d('0x138')});db[_0x9a2d('0x44')][_0x9a2d('0xed')](db['FaxApplication'],{'as':_0x9a2d('0x139')});db[_0x9a2d('0x44')][_0x9a2d('0xed')](db['VoiceExtension'],{'as':_0x9a2d('0x14b'),'onDelete':_0x9a2d('0xf2')});db[_0x9a2d('0x44')][_0x9a2d('0xed')](db[_0x9a2d('0x14c')],{'as':'Messages'});db[_0x9a2d('0x44')][_0x9a2d('0xfa')](db[_0x9a2d('0x29')],{'as':_0x9a2d('0x29')});db['FaxAccount'][_0x9a2d('0xfa')](db[_0x9a2d('0xe4')],{'as':_0x9a2d('0x13a'),'foreignKey':_0x9a2d('0x13b')});db['FaxAccount'][_0x9a2d('0xfa')](db[_0x9a2d('0x123')],{'as':_0x9a2d('0x124'),'foreignKey':_0x9a2d('0x125')});db[_0x9a2d('0x44')][_0x9a2d('0xfd')](db[_0x9a2d('0xef')],{'as':_0x9a2d('0x127'),'through':_0x9a2d('0x14d')});db[_0x9a2d('0x14e')]['belongsTo'](db[_0x9a2d('0xef')],{'onDelete':_0x9a2d('0x146')});db[_0x9a2d('0x14e')]['belongsTo'](db[_0x9a2d('0x4a')],{'onDelete':_0x9a2d('0x146')});db[_0x9a2d('0x14e')][_0x9a2d('0xfa')](db[_0x9a2d('0x44')],{'onDelete':_0x9a2d('0x146')});db[_0x9a2d('0x14e')][_0x9a2d('0xfa')](db[_0x9a2d('0x85')],{'onDelete':'restrict','foreignKey':_0x9a2d('0x148')});db['FaxInteraction']['hasMany'](db[_0x9a2d('0x14c')],{'as':_0x9a2d('0x12d'),'onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x14f')});db[_0x9a2d('0x47')][_0x9a2d('0xfa')](db[_0x9a2d('0x44')],{'as':_0x9a2d('0x13e'),'foreignKey':_0x9a2d('0x14a')});db[_0x9a2d('0x47')]['belongsTo'](db[_0x9a2d('0x132')],{'as':'Contact','foreignKey':_0x9a2d('0x134')});db[_0x9a2d('0x47')][_0x9a2d('0xfa')](db['User'],{'as':'Owner','foreignKey':_0x9a2d('0xec')});db[_0x9a2d('0x47')][_0x9a2d('0xfd')](db[_0x9a2d('0x85')],{'through':_0x9a2d('0x150'),'as':_0x9a2d('0x141')});db[_0x9a2d('0x47')][_0x9a2d('0xfd')](db['Tag'],{'through':_0x9a2d('0x150'),'as':'ThroughTags'});db[_0x9a2d('0x47')]['belongsToMany'](db['User'],{'as':_0x9a2d('0x151'),'through':_0x9a2d('0x107'),'foreignKey':_0x9a2d('0x14f')});db[_0x9a2d('0x14c')][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'onDelete':'cascade','as':'User'});db[_0x9a2d('0x14c')]['belongsTo'](db[_0x9a2d('0x47')],{'as':_0x9a2d('0x145'),'foreignKey':'FaxInteractionId'});db[_0x9a2d('0x14c')][_0x9a2d('0xfa')](db[_0x9a2d('0x132')],{'onDelete':_0x9a2d('0xf2'),'as':_0x9a2d('0x133')});db['FaxMessage'][_0x9a2d('0xfa')](db[_0x9a2d('0xd9')],{'as':_0x9a2d('0xd9'),'foreignKey':_0x9a2d('0x152')});db[_0x9a2d('0x14c')][_0x9a2d('0xfa')](db['FaxAccount'],{'as':_0x9a2d('0x13e'),'foreignKey':_0x9a2d('0x14a')});db[_0x9a2d('0x4a')][_0x9a2d('0xfd')](db[_0x9a2d('0xef')],{'as':_0x9a2d('0x127'),'through':'UserFaxQueue'});db['FaxQueue'][_0x9a2d('0xfd')](db[_0x9a2d('0x104')],{'through':'team_has_fax_queues','as':'Teams'});db[_0x9a2d('0x4c')][_0x9a2d('0xfa')](db[_0x9a2d('0x44')],{});db['FaxQueueReport'][_0x9a2d('0xfa')](db[_0x9a2d('0xe4')],{'as':_0x9a2d('0x13a'),'foreignKey':_0x9a2d('0x13b')});db[_0x9a2d('0x4c')][_0x9a2d('0xfa')](db[_0x9a2d('0x132')],{'as':_0x9a2d('0x133'),'foreignKey':'ContactId'});db[_0x9a2d('0x4c')][_0x9a2d('0xfa')](db['FaxInteraction'],{});db[_0x9a2d('0x4c')][_0x9a2d('0xfa')](db[_0x9a2d('0x14c')],{});db[_0x9a2d('0x4c')][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{});db[_0x9a2d('0x4c')][_0x9a2d('0xfa')](db[_0x9a2d('0x4a')],{});db['SmsAccount'][_0x9a2d('0xed')](db[_0x9a2d('0x77')],{'as':'Dispositions','foreignKey':_0x9a2d('0x153')});db[_0x9a2d('0x118')][_0x9a2d('0xed')](db['CannedAnswer'],{'as':_0x9a2d('0x137'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0x9a2d('0xed')](db[_0x9a2d('0x154')],{'as':'Messages','foreignKey':_0x9a2d('0x153')});db[_0x9a2d('0x118')][_0x9a2d('0xed')](db[_0x9a2d('0x108')],{'as':_0x9a2d('0x138')});db['SmsAccount'][_0x9a2d('0xed')](db[_0x9a2d('0x4f')],{'as':_0x9a2d('0x139')});db['SmsAccount'][_0x9a2d('0xfa')](db[_0x9a2d('0xe4')],{'as':_0x9a2d('0x13a'),'foreignKey':_0x9a2d('0x13b')});db[_0x9a2d('0x118')][_0x9a2d('0xfa')](db[_0x9a2d('0x123')],{'as':_0x9a2d('0x124'),'foreignKey':_0x9a2d('0x125')});db['SmsAccount'][_0x9a2d('0xfd')](db['User'],{'as':_0x9a2d('0x127'),'through':_0x9a2d('0x155')});db[_0x9a2d('0x4f')][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'onDelete':_0x9a2d('0x146')});db[_0x9a2d('0x4f')][_0x9a2d('0xfa')](db[_0x9a2d('0x53')],{'onDelete':_0x9a2d('0x146')});db[_0x9a2d('0x4f')][_0x9a2d('0xfa')](db['SmsAccount'],{'onDelete':_0x9a2d('0x146')});db[_0x9a2d('0x4f')][_0x9a2d('0xfa')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x9a2d('0x147')});db[_0x9a2d('0x4f')][_0x9a2d('0xfa')](db[_0x9a2d('0x85')],{'onDelete':_0x9a2d('0x146'),'foreignKey':_0x9a2d('0x148')});db[_0x9a2d('0x108')][_0x9a2d('0xed')](db[_0x9a2d('0x154')],{'as':'Messages','onDelete':_0x9a2d('0xf2'),'foreignKey':'SmsInteractionId'});db['SmsInteraction'][_0x9a2d('0xfa')](db[_0x9a2d('0x118')],{'as':_0x9a2d('0x13e'),'foreignKey':'SmsAccountId'});db['SmsInteraction'][_0x9a2d('0xfa')](db['CmContact'],{'as':_0x9a2d('0x133'),'foreignKey':_0x9a2d('0x134')});db['SmsInteraction'][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'as':_0x9a2d('0x13f'),'foreignKey':_0x9a2d('0xec')});db[_0x9a2d('0x108')][_0x9a2d('0xfd')](db['Tag'],{'through':_0x9a2d('0x156'),'as':'Tags'});db[_0x9a2d('0x108')][_0x9a2d('0xfd')](db[_0x9a2d('0x85')],{'through':_0x9a2d('0x156'),'as':_0x9a2d('0x157')});db[_0x9a2d('0x108')][_0x9a2d('0xfd')](db['User'],{'as':'Users','through':'user_has_sms_interactions','foreignKey':_0x9a2d('0x158')});db[_0x9a2d('0x154')][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'as':_0x9a2d('0xef')});db['SmsMessage'][_0x9a2d('0xfa')](db[_0x9a2d('0x132')],{'onDelete':_0x9a2d('0xf2'),'as':'Contact'});db['SmsMessage'][_0x9a2d('0xfa')](db[_0x9a2d('0x108')],{'onDelete':_0x9a2d('0xf2'),'as':_0x9a2d('0x145'),'foreignKey':'SmsInteractionId'});db[_0x9a2d('0x154')]['belongsTo'](db['SmsAccount'],{'as':_0x9a2d('0x13e'),'foreignKey':'SmsAccountId'});db[_0x9a2d('0x53')]['belongsToMany'](db['User'],{'as':'Agents','through':'UserSmsQueue','foreignKey':_0x9a2d('0x159')});db[_0x9a2d('0x53')]['belongsToMany'](db[_0x9a2d('0x104')],{'through':_0x9a2d('0x15a'),'as':_0x9a2d('0x128')});db[_0x9a2d('0x55')][_0x9a2d('0xed')](db[_0x9a2d('0x77')],{'as':_0x9a2d('0x15b'),'foreignKey':_0x9a2d('0x15c')});db[_0x9a2d('0x55')][_0x9a2d('0xed')](db[_0x9a2d('0x75')],{'as':_0x9a2d('0x137'),'foreignKey':_0x9a2d('0x15c')});db['OpenchannelAccount'][_0x9a2d('0xed')](db[_0x9a2d('0x58')],{'as':_0x9a2d('0x138'),'foreignKey':_0x9a2d('0x15c')});db['OpenchannelAccount']['hasMany'](db['OpenchannelMessage'],{'as':_0x9a2d('0x12d'),'foreignKey':_0x9a2d('0x15c')});db['OpenchannelAccount']['hasMany'](db[_0x9a2d('0x15d')],{'as':'Applications','foreignKey':_0x9a2d('0x15c')});db[_0x9a2d('0x55')]['belongsTo'](db[_0x9a2d('0xe4')],{'as':_0x9a2d('0x13a'),'foreignKey':'ListId'});db[_0x9a2d('0x55')]['belongsTo'](db[_0x9a2d('0x123')],{'as':_0x9a2d('0x124'),'foreignKey':_0x9a2d('0x125')});db[_0x9a2d('0x55')]['belongsToMany'](db[_0x9a2d('0xef')],{'as':_0x9a2d('0x127'),'through':_0x9a2d('0x117')});db[_0x9a2d('0x15d')][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'onDelete':_0x9a2d('0x146')});db['OpenchannelApplication'][_0x9a2d('0xfa')](db[_0x9a2d('0x5b')],{'onDelete':_0x9a2d('0x146'),'foreignKey':_0x9a2d('0x15e')});db['OpenchannelApplication'][_0x9a2d('0xfa')](db[_0x9a2d('0x55')],{'onDelete':_0x9a2d('0x146'),'foreignKey':'OpenchannelAccountId'});db[_0x9a2d('0x15d')][_0x9a2d('0xfa')](db[_0x9a2d('0x7b')],{'onDelete':_0x9a2d('0x146'),'foreignKey':_0x9a2d('0x147')});db[_0x9a2d('0x15d')][_0x9a2d('0xfa')](db['Tag'],{'onDelete':_0x9a2d('0x146'),'foreignKey':_0x9a2d('0x148')});db[_0x9a2d('0x58')]['hasMany'](db[_0x9a2d('0x59')],{'as':_0x9a2d('0x12d'),'onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x15f')});db[_0x9a2d('0x58')][_0x9a2d('0xfa')](db[_0x9a2d('0x55')],{'as':'Account','foreignKey':_0x9a2d('0x15c')});db[_0x9a2d('0x58')][_0x9a2d('0xfa')](db[_0x9a2d('0x132')],{'as':_0x9a2d('0x133'),'foreignKey':_0x9a2d('0x134')});db[_0x9a2d('0x58')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':'UserId'});db['OpenchannelInteraction']['belongsToMany'](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x9a2d('0x141')});db[_0x9a2d('0x58')][_0x9a2d('0xfd')](db[_0x9a2d('0x85')],{'through':_0x9a2d('0x160'),'as':_0x9a2d('0x157')});db[_0x9a2d('0x58')]['belongsToMany'](db[_0x9a2d('0xef')],{'as':'Users','through':_0x9a2d('0x109'),'foreignKey':_0x9a2d('0x15f')});db[_0x9a2d('0x59')]['belongsTo'](db['User'],{'onDelete':_0x9a2d('0xf2'),'as':_0x9a2d('0xef')});db[_0x9a2d('0x59')][_0x9a2d('0xfa')](db[_0x9a2d('0x132')],{'onDelete':_0x9a2d('0xf2'),'as':_0x9a2d('0x133')});db[_0x9a2d('0x59')][_0x9a2d('0xfa')](db[_0x9a2d('0x58')],{'onDelete':_0x9a2d('0xf2'),'as':_0x9a2d('0x145'),'foreignKey':_0x9a2d('0x15f')});db[_0x9a2d('0x59')]['belongsTo'](db['Attachment'],{'as':_0x9a2d('0xd9'),'foreignKey':_0x9a2d('0x152')});db[_0x9a2d('0x59')][_0x9a2d('0xfa')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0x9a2d('0x15c')});db[_0x9a2d('0x5b')][_0x9a2d('0xfd')](db[_0x9a2d('0xef')],{'as':_0x9a2d('0x127'),'through':'UserOpenchannelQueue','foreignKey':_0x9a2d('0x15e')});db[_0x9a2d('0x5b')][_0x9a2d('0xfd')](db['Team'],{'through':_0x9a2d('0x161'),'as':_0x9a2d('0x128')});db[_0x9a2d('0x5c')][_0x9a2d('0xed')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x9a2d('0x162')});db[_0x9a2d('0x5c')][_0x9a2d('0xed')](db[_0x9a2d('0x75')],{'as':_0x9a2d('0x137'),'foreignKey':'ChatWebsiteId'});db[_0x9a2d('0x5c')][_0x9a2d('0xed')](db[_0x9a2d('0x66')],{'as':'ProactiveActions'});db[_0x9a2d('0x5c')][_0x9a2d('0xed')](db[_0x9a2d('0x60')],{'as':_0x9a2d('0x138')});db['ChatWebsite']['hasMany'](db[_0x9a2d('0x5e')],{'as':_0x9a2d('0x139')});db[_0x9a2d('0x5c')][_0x9a2d('0xed')](db[_0x9a2d('0x163')],{'as':_0x9a2d('0x12d')});db[_0x9a2d('0x5c')][_0x9a2d('0xfa')](db[_0x9a2d('0xe4')],{'as':_0x9a2d('0x13a'),'foreignKey':_0x9a2d('0x13b')});db['ChatWebsite'][_0x9a2d('0xfa')](db[_0x9a2d('0x7b')],{'as':'Interval','foreignKey':_0x9a2d('0x147')});db['ChatWebsite'][_0x9a2d('0xfa')](db[_0x9a2d('0x123')],{'as':_0x9a2d('0x124'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x9a2d('0x5c')]['belongsToMany'](db[_0x9a2d('0xef')],{'as':_0x9a2d('0x127'),'through':_0x9a2d('0x112')});db[_0x9a2d('0x164')]['belongsTo'](db[_0x9a2d('0x55')],{});db[_0x9a2d('0x164')][_0x9a2d('0xfa')](db[_0x9a2d('0xe4')],{'as':_0x9a2d('0x13a'),'foreignKey':_0x9a2d('0x13b')});db[_0x9a2d('0x164')][_0x9a2d('0xfa')](db[_0x9a2d('0x132')],{'as':_0x9a2d('0x133'),'foreignKey':_0x9a2d('0x134')});db['OpenchannelQueueReport'][_0x9a2d('0xfa')](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0x9a2d('0xfa')](db[_0x9a2d('0x59')],{});db[_0x9a2d('0x164')][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{});db[_0x9a2d('0x164')][_0x9a2d('0xfa')](db[_0x9a2d('0x5b')],{});db['ChatApplication'][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'as':'Agent','foreignKey':'UserId','onDelete':_0x9a2d('0x146')});db['ChatApplication'][_0x9a2d('0xfa')](db[_0x9a2d('0x63')],{'as':_0x9a2d('0x165'),'foreignKey':_0x9a2d('0x166'),'onDelete':_0x9a2d('0x146')});db[_0x9a2d('0x5e')]['belongsTo'](db[_0x9a2d('0x5c')],{'as':_0x9a2d('0x167'),'foreignKey':'ChatWebsiteId','onDelete':_0x9a2d('0x146')});db[_0x9a2d('0x5e')]['belongsTo'](db[_0x9a2d('0x85')],{'onDelete':_0x9a2d('0x146'),'foreignKey':_0x9a2d('0x148')});db['ChatInteraction'][_0x9a2d('0xed')](db['ChatMessage'],{'as':'Messages','onDelete':_0x9a2d('0xf2'),'foreignKey':'ChatInteractionId'});db[_0x9a2d('0x60')]['belongsTo'](db[_0x9a2d('0x5c')],{'as':_0x9a2d('0x13e'),'foreignKey':_0x9a2d('0x162')});db[_0x9a2d('0x60')][_0x9a2d('0xfa')](db[_0x9a2d('0x132')],{'as':_0x9a2d('0x133'),'foreignKey':_0x9a2d('0x134')});db[_0x9a2d('0x60')][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'as':_0x9a2d('0x13f'),'foreignKey':'UserId'});db['ChatInteraction'][_0x9a2d('0xfd')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x9a2d('0x141')});db[_0x9a2d('0x60')][_0x9a2d('0xfd')](db[_0x9a2d('0x85')],{'through':_0x9a2d('0x168'),'as':_0x9a2d('0x157')});db[_0x9a2d('0x60')][_0x9a2d('0xfd')](db[_0x9a2d('0xef')],{'as':_0x9a2d('0x151'),'through':_0x9a2d('0x105'),'foreignKey':_0x9a2d('0x169')});db[_0x9a2d('0x163')][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'onDelete':_0x9a2d('0xf2'),'as':_0x9a2d('0xef')});db[_0x9a2d('0x163')][_0x9a2d('0xfa')](db[_0x9a2d('0x132')],{'onDelete':'cascade','as':_0x9a2d('0x133'),'foreignKey':'ContactId'});db[_0x9a2d('0x163')][_0x9a2d('0xfa')](db[_0x9a2d('0x60')],{'onDelete':_0x9a2d('0xf2'),'as':_0x9a2d('0x145'),'foreignKey':_0x9a2d('0x169')});db[_0x9a2d('0x163')][_0x9a2d('0xfa')](db[_0x9a2d('0xd9')],{'as':'Attachment','foreignKey':_0x9a2d('0x152')});db[_0x9a2d('0x163')][_0x9a2d('0xfa')](db['ChatWebsite'],{'as':_0x9a2d('0x13e'),'foreignKey':_0x9a2d('0x162')});db['ChatOfflineMessage']['belongsTo'](db[_0x9a2d('0x132')],{'onDelete':_0x9a2d('0xf2'),'as':_0x9a2d('0x133'),'foreignKey':_0x9a2d('0x134')});db[_0x9a2d('0x16a')]['belongsTo'](db[_0x9a2d('0x5c')],{'as':_0x9a2d('0x13e'),'foreignKey':_0x9a2d('0x162')});db[_0x9a2d('0x63')]['belongsToMany'](db[_0x9a2d('0xef')],{'as':_0x9a2d('0x127'),'through':_0x9a2d('0x2e'),'hooks':!![]});db[_0x9a2d('0x63')]['belongsToMany'](db[_0x9a2d('0x104')],{'through':_0x9a2d('0x16b'),'as':_0x9a2d('0x128')});db[_0x9a2d('0xfe')][_0x9a2d('0xed')](db[_0x9a2d('0xc5')],{'as':'Messages','foreignKey':_0x9a2d('0x16c'),'onDelete':'cascade'});db['ChatGroup']['belongsToMany'](db[_0x9a2d('0xef')],{'as':'Members','through':_0x9a2d('0x100')});db[_0x9a2d('0x66')]['belongsTo'](db['ChatWebsite'],{'as':_0x9a2d('0x167'),'foreignKey':_0x9a2d('0x162')});db['CmCompany']['hasMany'](db[_0x9a2d('0x132')],{'as':_0x9a2d('0x101'),'foreignKey':_0x9a2d('0x16d')});db[_0x9a2d('0x132')][_0x9a2d('0xed')](db[_0x9a2d('0x6b')],{'as':'Hoppers','foreignKey':'ContactId'});db['CmContact'][_0x9a2d('0xed')](db[_0x9a2d('0x6f')],{'as':_0x9a2d('0xf3'),'foreignKey':_0x9a2d('0x134')});db['CmContact'][_0x9a2d('0xed')](db[_0x9a2d('0x71')],{'as':_0x9a2d('0x11f'),'foreignKey':_0x9a2d('0x134')});db[_0x9a2d('0x132')][_0x9a2d('0xed')](db[_0x9a2d('0xf5')],{'as':_0x9a2d('0xf5'),'foreignKey':_0x9a2d('0x134')});db['CmContact'][_0x9a2d('0xed')](db[_0x9a2d('0xca')],{'as':_0x9a2d('0x121'),'foreignKey':_0x9a2d('0x134')});db['CmContact']['hasMany'](db[_0x9a2d('0x58')],{'as':_0x9a2d('0xf6'),'foreignKey':_0x9a2d('0x134'),'onDelete':_0x9a2d('0x146')});db[_0x9a2d('0x132')][_0x9a2d('0xed')](db[_0x9a2d('0x60')],{'as':_0x9a2d('0xf7'),'foreignKey':_0x9a2d('0x134'),'onDelete':'restrict'});db[_0x9a2d('0x132')][_0x9a2d('0xed')](db[_0x9a2d('0x108')],{'as':_0x9a2d('0xf8'),'foreignKey':_0x9a2d('0x134'),'onDelete':_0x9a2d('0x146')});db[_0x9a2d('0x132')]['hasMany'](db[_0x9a2d('0x47')],{'as':'FaxInteractions','foreignKey':_0x9a2d('0x134'),'onDelete':'restrict'});db[_0x9a2d('0x132')][_0x9a2d('0xed')](db[_0x9a2d('0x3c')],{'as':'MailInteractions','foreignKey':_0x9a2d('0x134'),'onDelete':'restrict'});db[_0x9a2d('0x132')][_0x9a2d('0xfa')](db['CmCompany'],{'as':_0x9a2d('0x16e'),'foreignKey':_0x9a2d('0x16d')});db[_0x9a2d('0x132')][_0x9a2d('0xfa')](db[_0x9a2d('0xe4')],{'as':_0x9a2d('0x13a'),'foreignKey':_0x9a2d('0x13b'),'onDelete':'cascade'});db[_0x9a2d('0x132')][_0x9a2d('0xfd')](db[_0x9a2d('0xef')],{'as':_0x9a2d('0x151'),'through':'cm_user_has_contacts'});db['CmContact']['belongsToMany'](db[_0x9a2d('0x85')],{'as':_0x9a2d('0x141'),'through':'cm_contact_has_tags'});db[_0x9a2d('0x132')][_0x9a2d('0xfd')](db[_0x9a2d('0x85')],{'through':_0x9a2d('0x16f'),'as':_0x9a2d('0x157')});db[_0x9a2d('0x6b')][_0x9a2d('0xfa')](db[_0x9a2d('0x132')],{'as':_0x9a2d('0x133'),'foreignKey':_0x9a2d('0x134'),'onDelete':_0x9a2d('0xf2')});db[_0x9a2d('0x6b')][_0x9a2d('0xfa')](db[_0x9a2d('0xe4')],{'as':'List','foreignKey':'ListId','onDelete':_0x9a2d('0xf2')});db[_0x9a2d('0x6b')]['belongsTo'](db[_0x9a2d('0xef')],{'as':'Agent','foreignKey':_0x9a2d('0xec')});db[_0x9a2d('0x6b')]['belongsTo'](db[_0x9a2d('0x1c')],{'as':_0x9a2d('0x165'),'foreignKey':_0x9a2d('0x11e'),'onDelete':_0x9a2d('0xf2')});db['CmHopper'][_0x9a2d('0xfa')](db[_0x9a2d('0xd7')],{'as':_0x9a2d('0xd7'),'foreignKey':'CampaignId','onDelete':_0x9a2d('0xf2')});db[_0x9a2d('0x6b')][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'as':_0x9a2d('0x13f'),'foreignKey':_0x9a2d('0x170')});db[_0x9a2d('0x6d')][_0x9a2d('0xfa')](db[_0x9a2d('0x132')],{'as':'Contact','foreignKey':_0x9a2d('0x134'),'onDelete':_0x9a2d('0xf2')});db[_0x9a2d('0x6d')][_0x9a2d('0xfa')](db[_0x9a2d('0xe4')],{'as':_0x9a2d('0x13a'),'foreignKey':_0x9a2d('0x13b'),'onDelete':'cascade'});db['CmHopperBlack'][_0x9a2d('0xfa')](db[_0x9a2d('0x1c')],{'as':_0x9a2d('0x165'),'foreignKey':_0x9a2d('0x11e'),'onDelete':_0x9a2d('0xf2')});db[_0x9a2d('0x6d')]['belongsTo'](db['Campaign'],{'as':_0x9a2d('0xd7'),'foreignKey':'CampaignId','onDelete':_0x9a2d('0xf2')});db[_0x9a2d('0x74')][_0x9a2d('0xed')](db['Condition'],{'as':{'plural':_0x9a2d('0x171'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':_0x9a2d('0xf2'),'hooks':!![]});db[_0x9a2d('0x74')][_0x9a2d('0xed')](db['Condition'],{'as':{'plural':'Any','singular':_0x9a2d('0x172')},'foreignKey':_0x9a2d('0x173'),'onDelete':_0x9a2d('0xf2'),'hooks':!![]});db[_0x9a2d('0x74')][_0x9a2d('0xed')](db[_0x9a2d('0x73')],{'as':'Actions','foreignKey':_0x9a2d('0x174'),'onDelete':_0x9a2d('0xf2'),'hooks':!![]});db[_0x9a2d('0x7b')][_0x9a2d('0xed')](db[_0x9a2d('0x7b')],{'as':_0x9a2d('0x175'),'foreignKey':'IntervalId','onDelete':_0x9a2d('0xf2'),'hooks':!![],'required':![]});db[_0x9a2d('0x7b')][_0x9a2d('0xed')](db[_0x9a2d('0x18')],{'as':_0x9a2d('0xf1'),'foreignKey':_0x9a2d('0x147'),'onDelete':_0x9a2d('0x146')});db[_0x9a2d('0x7b')][_0x9a2d('0xed')](db[_0x9a2d('0x3e')],{'as':_0x9a2d('0x176'),'foreignKey':_0x9a2d('0x147')});db[_0x9a2d('0x7b')]['hasMany'](db[_0x9a2d('0x5e')],{'as':_0x9a2d('0x177'),'foreignKey':'IntervalId'});db[_0x9a2d('0x7b')][_0x9a2d('0xed')](db[_0x9a2d('0x14e')],{'as':_0x9a2d('0x178'),'foreignKey':'IntervalId'});db[_0x9a2d('0x7b')][_0x9a2d('0xed')](db[_0x9a2d('0x4f')],{'as':_0x9a2d('0x179'),'foreignKey':_0x9a2d('0x147')});db['Schedule']['belongsTo'](db[_0x9a2d('0x38')],{});db[_0x9a2d('0x82')][_0x9a2d('0xfa')](db[_0x9a2d('0x90')],{'foreignKey':_0x9a2d('0x17a')});db[_0x9a2d('0x82')][_0x9a2d('0xfa')](db[_0x9a2d('0x8e')],{'foreignKey':'CustomReportId'});db['Sound'][_0x9a2d('0xfd')](db[_0x9a2d('0x1a')],{'as':_0x9a2d('0x17b'),'through':_0x9a2d('0x17c'),'onDelete':_0x9a2d('0x146')});db['Tag'][_0x9a2d('0xfd')](db[_0x9a2d('0x132')],{'through':'cm_contact_has_tags'});db[_0x9a2d('0x85')]['belongsToMany'](db[_0x9a2d('0x60')],{'through':_0x9a2d('0x168')});db[_0x9a2d('0x85')][_0x9a2d('0xfd')](db[_0x9a2d('0x3c')],{'through':_0x9a2d('0x140')});db[_0x9a2d('0x85')][_0x9a2d('0xfd')](db[_0x9a2d('0x108')],{'through':_0x9a2d('0x156')});db[_0x9a2d('0x85')][_0x9a2d('0xfd')](db[_0x9a2d('0x47')],{'through':_0x9a2d('0x150')});db[_0x9a2d('0x85')][_0x9a2d('0xfd')](db['OpenchannelInteraction'],{'through':_0x9a2d('0x160')});db[_0x9a2d('0x88')][_0x9a2d('0xed')](db[_0x9a2d('0x79')],{'as':{'plural':_0x9a2d('0x17d'),'singular':'AllCondition'},'foreignKey':_0x9a2d('0x17e'),'onDelete':_0x9a2d('0xf2'),'hooks':!![]});db[_0x9a2d('0x88')][_0x9a2d('0xed')](db['Condition'],{'as':{'plural':_0x9a2d('0x17f'),'singular':'AnyCondition'},'foreignKey':_0x9a2d('0x180'),'onDelete':_0x9a2d('0xf2'),'hooks':!![]});db['Trigger']['hasMany'](db[_0x9a2d('0x73')],{'as':_0x9a2d('0x181'),'foreignKey':_0x9a2d('0x182'),'onDelete':_0x9a2d('0xf2'),'hooks':!![]});db['AnalyticCustomReport'][_0x9a2d('0xed')](db[_0x9a2d('0x95')],{'as':_0x9a2d('0x183'),'onDelete':'cascade','foreignKey':_0x9a2d('0x184'),'hooks':!![]});db['AnalyticDefaultReport'][_0x9a2d('0xed')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x17a')});db[_0x9a2d('0x93')][_0x9a2d('0xed')](db[_0x9a2d('0x95')],{'as':_0x9a2d('0x183'),'onDelete':'cascade','foreignKey':'MetricId'});db[_0x9a2d('0x95')]['belongsTo'](db[_0x9a2d('0x93')],{'foreignKey':_0x9a2d('0x185')});db[_0x9a2d('0x98')]['hasMany'](db['SalesforceConfiguration'],{'as':_0x9a2d('0x186'),'onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x187')});db[_0x9a2d('0x9a')][_0x9a2d('0xed')](db[_0x9a2d('0x9c')],{'as':'Subjects','onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x188')});db[_0x9a2d('0x9a')][_0x9a2d('0xed')](db[_0x9a2d('0x9c')],{'as':_0x9a2d('0x189'),'onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x18a')});db['SalesforceConfiguration'][_0x9a2d('0xed')](db[_0x9a2d('0x9c')],{'as':_0x9a2d('0x183'),'onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x18b')});db[_0x9a2d('0x9a')][_0x9a2d('0xfa')](db[_0x9a2d('0x98')],{'as':_0x9a2d('0x13e'),'foreignKey':_0x9a2d('0x187')});db['SalesforceField']['hasMany'](db['SalesforceField'],{'as':_0x9a2d('0x18c'),'foreignKey':_0x9a2d('0x188')});db[_0x9a2d('0x9c')][_0x9a2d('0xed')](db[_0x9a2d('0x9c')],{'as':'Description','foreignKey':_0x9a2d('0x18a')});db[_0x9a2d('0x9c')][_0x9a2d('0xed')](db[_0x9a2d('0x9c')],{'as':_0x9a2d('0x18d'),'foreignKey':_0x9a2d('0x18b')});db[_0x9a2d('0x9c')]['belongsTo'](db[_0x9a2d('0x89')],{'as':_0x9a2d('0x89'),'foreignKey':_0x9a2d('0x18e')});db[_0x9a2d('0x18f')][_0x9a2d('0xed')](db[_0x9a2d('0x190')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x9a2d('0x187')});db[_0x9a2d('0x190')][_0x9a2d('0xed')](db['SugarcrmField'],{'as':_0x9a2d('0x191'),'onDelete':_0x9a2d('0xf2'),'foreignKey':'SubjectId'});db['SugarcrmConfiguration'][_0x9a2d('0xed')](db[_0x9a2d('0x9e')],{'as':_0x9a2d('0x189'),'onDelete':_0x9a2d('0xf2'),'foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0x9a2d('0xed')](db['SugarcrmField'],{'as':_0x9a2d('0x183'),'onDelete':_0x9a2d('0xf2'),'foreignKey':'FieldId'});db[_0x9a2d('0x190')]['belongsTo'](db[_0x9a2d('0x18f')],{'as':_0x9a2d('0x13e'),'foreignKey':_0x9a2d('0x187')});db[_0x9a2d('0x9e')][_0x9a2d('0xed')](db[_0x9a2d('0x9e')],{'as':'Subject','foreignKey':_0x9a2d('0x188')});db['SugarcrmField']['hasMany'](db[_0x9a2d('0x9e')],{'as':_0x9a2d('0x192'),'foreignKey':_0x9a2d('0x18a')});db['SugarcrmField'][_0x9a2d('0xed')](db[_0x9a2d('0x9e')],{'as':_0x9a2d('0x18d'),'foreignKey':_0x9a2d('0x18b')});db[_0x9a2d('0x9e')][_0x9a2d('0xfa')](db[_0x9a2d('0x89')],{'as':_0x9a2d('0x89'),'foreignKey':_0x9a2d('0x18e')});db[_0x9a2d('0x193')][_0x9a2d('0xed')](db[_0x9a2d('0xa1')],{'as':_0x9a2d('0x186'),'onDelete':'cascade','foreignKey':_0x9a2d('0x187')});db[_0x9a2d('0xa1')][_0x9a2d('0xed')](db['DeskField'],{'as':'Subjects','onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x188')});db['DeskConfiguration'][_0x9a2d('0xed')](db[_0x9a2d('0xa3')],{'as':_0x9a2d('0x189'),'onDelete':_0x9a2d('0xf2'),'foreignKey':'DescriptionId'});db[_0x9a2d('0xa1')][_0x9a2d('0xed')](db['DeskField'],{'as':_0x9a2d('0x183'),'onDelete':'cascade','foreignKey':_0x9a2d('0x18b')});db['DeskConfiguration'][_0x9a2d('0xfa')](db[_0x9a2d('0x193')],{'as':_0x9a2d('0x13e'),'foreignKey':_0x9a2d('0x187')});db[_0x9a2d('0xa1')][_0x9a2d('0xfd')](db[_0x9a2d('0x85')],{'through':_0x9a2d('0x194')});db[_0x9a2d('0xa3')][_0x9a2d('0xed')](db[_0x9a2d('0xa3')],{'as':_0x9a2d('0x18c'),'foreignKey':_0x9a2d('0x188')});db[_0x9a2d('0xa3')][_0x9a2d('0xed')](db[_0x9a2d('0xa3')],{'as':_0x9a2d('0x192'),'foreignKey':_0x9a2d('0x18a')});db['DeskField'][_0x9a2d('0xed')](db[_0x9a2d('0xa3')],{'as':'Field','foreignKey':_0x9a2d('0x18b')});db[_0x9a2d('0xa3')][_0x9a2d('0xfa')](db[_0x9a2d('0x89')],{'as':'Variable','foreignKey':_0x9a2d('0x18e')});db[_0x9a2d('0xa4')][_0x9a2d('0xed')](db[_0x9a2d('0xa5')],{'as':_0x9a2d('0x186'),'onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x187')});db['ZohoConfiguration'][_0x9a2d('0xed')](db[_0x9a2d('0xa6')],{'as':_0x9a2d('0x191'),'onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x188')});db['ZohoConfiguration'][_0x9a2d('0xed')](db[_0x9a2d('0xa6')],{'as':_0x9a2d('0x189'),'onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x18a')});db[_0x9a2d('0xa5')]['hasMany'](db[_0x9a2d('0xa6')],{'as':_0x9a2d('0x183'),'onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x18b')});db[_0x9a2d('0xa5')]['belongsTo'](db[_0x9a2d('0xa4')],{'as':_0x9a2d('0x13e'),'foreignKey':'AccountId'});db[_0x9a2d('0xa6')][_0x9a2d('0xed')](db[_0x9a2d('0xa6')],{'as':_0x9a2d('0x18c'),'foreignKey':_0x9a2d('0x188')});db['ZohoField'][_0x9a2d('0xed')](db[_0x9a2d('0xa6')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x9a2d('0xa6')]['hasMany'](db[_0x9a2d('0xa6')],{'as':_0x9a2d('0x18d'),'foreignKey':_0x9a2d('0x18b')});db['ZohoField'][_0x9a2d('0xfa')](db['Variable'],{'as':_0x9a2d('0x89'),'foreignKey':'VariableId'});db[_0x9a2d('0xa8')][_0x9a2d('0xed')](db[_0x9a2d('0xaa')],{'as':_0x9a2d('0x186'),'onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x187')});db['ZendeskConfiguration']['hasMany'](db['ZendeskField'],{'as':_0x9a2d('0x191'),'foreignKey':_0x9a2d('0x188')});db[_0x9a2d('0xaa')][_0x9a2d('0xed')](db[_0x9a2d('0xac')],{'as':_0x9a2d('0x189'),'foreignKey':'DescriptionId'});db[_0x9a2d('0xaa')][_0x9a2d('0xed')](db[_0x9a2d('0xac')],{'as':'Fields','foreignKey':_0x9a2d('0x18b')});db[_0x9a2d('0xaa')]['belongsTo'](db[_0x9a2d('0xa8')],{'as':'Account','foreignKey':_0x9a2d('0x187')});db[_0x9a2d('0xaa')][_0x9a2d('0xfd')](db['Tag'],{'through':_0x9a2d('0x195')});db[_0x9a2d('0xac')][_0x9a2d('0xed')](db['ZendeskField'],{'as':_0x9a2d('0x18c'),'foreignKey':_0x9a2d('0x188')});db[_0x9a2d('0xac')][_0x9a2d('0xed')](db[_0x9a2d('0xac')],{'as':'Description','foreignKey':_0x9a2d('0x18a')});db[_0x9a2d('0xac')][_0x9a2d('0xed')](db[_0x9a2d('0xac')],{'as':_0x9a2d('0x18d'),'foreignKey':_0x9a2d('0x18b')});db[_0x9a2d('0xac')][_0x9a2d('0xfa')](db[_0x9a2d('0x89')],{'as':_0x9a2d('0x89'),'foreignKey':'VariableId'});db[_0x9a2d('0xad')][_0x9a2d('0xed')](db[_0x9a2d('0xaf')],{'as':_0x9a2d('0x186'),'onDelete':_0x9a2d('0xf2'),'foreignKey':'AccountId'});db[_0x9a2d('0xaf')]['hasMany'](db[_0x9a2d('0xb1')],{'as':_0x9a2d('0x191'),'onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x188')});db[_0x9a2d('0xaf')]['hasMany'](db[_0x9a2d('0xb1')],{'as':'Descriptions','onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x18a')});db['FreshdeskConfiguration'][_0x9a2d('0xed')](db[_0x9a2d('0xb1')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x9a2d('0x18b')});db[_0x9a2d('0xaf')][_0x9a2d('0xfa')](db[_0x9a2d('0xad')],{'as':_0x9a2d('0x13e'),'foreignKey':_0x9a2d('0x187')});db['FreshdeskConfiguration'][_0x9a2d('0xfd')](db[_0x9a2d('0x85')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x9a2d('0xb1')][_0x9a2d('0xed')](db[_0x9a2d('0xb1')],{'as':_0x9a2d('0x18c'),'foreignKey':_0x9a2d('0x188')});db['FreshdeskField'][_0x9a2d('0xed')](db[_0x9a2d('0xb1')],{'as':'Description','foreignKey':_0x9a2d('0x18a')});db['FreshdeskField'][_0x9a2d('0xed')](db['FreshdeskField'],{'as':_0x9a2d('0x18d'),'foreignKey':_0x9a2d('0x18b')});db[_0x9a2d('0xb1')]['belongsTo'](db['Variable'],{'as':_0x9a2d('0x89'),'foreignKey':_0x9a2d('0x18e')});db[_0x9a2d('0xb3')][_0x9a2d('0xed')](db[_0x9a2d('0xb5')],{'as':_0x9a2d('0x186'),'onDelete':'cascade','foreignKey':_0x9a2d('0x187')});db[_0x9a2d('0xb5')][_0x9a2d('0xed')](db[_0x9a2d('0xb7')],{'as':_0x9a2d('0x191'),'foreignKey':'SubjectId'});db[_0x9a2d('0xb5')][_0x9a2d('0xed')](db['VtigerField'],{'as':_0x9a2d('0x189'),'foreignKey':'DescriptionId'});db['VtigerConfiguration']['hasMany'](db[_0x9a2d('0xb7')],{'as':_0x9a2d('0x183'),'foreignKey':_0x9a2d('0x18b')});db[_0x9a2d('0xb5')]['belongsTo'](db[_0x9a2d('0xb3')],{'as':_0x9a2d('0x13e'),'foreignKey':_0x9a2d('0x187')});db[_0x9a2d('0xb5')]['belongsToMany'](db[_0x9a2d('0x85')],{'through':_0x9a2d('0x196')});db[_0x9a2d('0xb7')][_0x9a2d('0xed')](db[_0x9a2d('0xb7')],{'as':_0x9a2d('0x18c'),'foreignKey':_0x9a2d('0x188')});db[_0x9a2d('0xb7')][_0x9a2d('0xed')](db[_0x9a2d('0xb7')],{'as':_0x9a2d('0x192'),'foreignKey':'DescriptionId'});db[_0x9a2d('0xb7')]['hasMany'](db[_0x9a2d('0xb7')],{'as':_0x9a2d('0x18d'),'foreignKey':_0x9a2d('0x18b')});db[_0x9a2d('0xb7')][_0x9a2d('0xfa')](db[_0x9a2d('0x89')],{'as':_0x9a2d('0x89'),'foreignKey':'VariableId'});db['ServicenowAccount'][_0x9a2d('0xed')](db[_0x9a2d('0x197')],{'as':_0x9a2d('0x186'),'onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x187')});db[_0x9a2d('0x197')]['hasMany'](db['ServicenowField'],{'as':_0x9a2d('0x191'),'foreignKey':_0x9a2d('0x188')});db['ServicenowConfiguration'][_0x9a2d('0xed')](db['ServicenowField'],{'as':_0x9a2d('0x189'),'foreignKey':_0x9a2d('0x18a')});db[_0x9a2d('0x197')][_0x9a2d('0xed')](db[_0x9a2d('0xbc')],{'as':'Fields','foreignKey':'FieldId'});db[_0x9a2d('0x197')]['belongsTo'](db[_0x9a2d('0xb9')],{'as':'Account','foreignKey':_0x9a2d('0x187')});db['ServicenowField']['hasMany'](db[_0x9a2d('0xbc')],{'as':_0x9a2d('0x18c'),'foreignKey':_0x9a2d('0x188')});db['ServicenowField'][_0x9a2d('0xed')](db[_0x9a2d('0xbc')],{'as':_0x9a2d('0x192'),'foreignKey':_0x9a2d('0x18a')});db[_0x9a2d('0xbc')][_0x9a2d('0xed')](db[_0x9a2d('0xbc')],{'as':_0x9a2d('0x18d'),'foreignKey':_0x9a2d('0x18b')});db[_0x9a2d('0xbc')][_0x9a2d('0xfa')](db['Variable'],{'as':_0x9a2d('0x89'),'foreignKey':_0x9a2d('0x18e')});db[_0x9a2d('0xbd')][_0x9a2d('0xed')](db[_0x9a2d('0xbf')],{'as':'Configurations','onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x187')});db[_0x9a2d('0xbf')][_0x9a2d('0xed')](db[_0x9a2d('0xc0')],{'as':_0x9a2d('0x191'),'onDelete':'cascade','foreignKey':_0x9a2d('0x188')});db[_0x9a2d('0xbf')]['hasMany'](db[_0x9a2d('0xc0')],{'as':_0x9a2d('0x189'),'onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x18a')});db[_0x9a2d('0xbf')][_0x9a2d('0xed')](db[_0x9a2d('0xc0')],{'as':_0x9a2d('0x183'),'onDelete':_0x9a2d('0xf2'),'foreignKey':'FieldId'});db[_0x9a2d('0xbf')][_0x9a2d('0xfa')](db[_0x9a2d('0xbd')],{'as':_0x9a2d('0x13e'),'foreignKey':'AccountId'});db[_0x9a2d('0xc0')][_0x9a2d('0xed')](db[_0x9a2d('0xc0')],{'as':_0x9a2d('0x18c'),'foreignKey':_0x9a2d('0x188')});db['Dynamics365Field'][_0x9a2d('0xed')](db[_0x9a2d('0xc0')],{'as':_0x9a2d('0x192'),'foreignKey':'DescriptionId'});db['Dynamics365Field'][_0x9a2d('0xed')](db[_0x9a2d('0xc0')],{'as':_0x9a2d('0x18d'),'foreignKey':_0x9a2d('0x18b')});db[_0x9a2d('0xc0')]['belongsTo'](db[_0x9a2d('0x89')],{'as':_0x9a2d('0x89'),'foreignKey':_0x9a2d('0x18e')});db[_0x9a2d('0x198')][_0x9a2d('0xfa')](db[_0x9a2d('0x5c')],{});db[_0x9a2d('0x198')][_0x9a2d('0xfa')](db[_0x9a2d('0xe4')],{'as':_0x9a2d('0x13a'),'foreignKey':_0x9a2d('0x13b')});db['ChatQueueReport'][_0x9a2d('0xfa')](db[_0x9a2d('0x132')],{'as':_0x9a2d('0x133'),'foreignKey':_0x9a2d('0x134')});db['ChatQueueReport']['belongsTo'](db[_0x9a2d('0x60')],{});db[_0x9a2d('0x198')][_0x9a2d('0xfa')](db[_0x9a2d('0x163')],{});db[_0x9a2d('0x198')][_0x9a2d('0xfa')](db['User'],{});db[_0x9a2d('0x198')][_0x9a2d('0xfa')](db['ChatQueue'],{});db[_0x9a2d('0xc5')][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'onDelete':'cascade','foreignKey':_0x9a2d('0x199')});db['ChatInternalMessage'][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'onDelete':_0x9a2d('0xf2'),'foreignKey':'ToId'});db['JscriptySessionReport']['hasMany'](db[_0x9a2d('0xc8')],{'foreignKey':_0x9a2d('0x19a'),'onDelete':_0x9a2d('0xf2')});db['JscriptySessionReport'][_0x9a2d('0xed')](db[_0x9a2d('0xc6')],{'foreignKey':_0x9a2d('0x19a'),'onDelete':_0x9a2d('0xf2')});db['SmsQueueReport'][_0x9a2d('0xfa')](db[_0x9a2d('0x118')],{});db[_0x9a2d('0xcb')][_0x9a2d('0xfa')](db[_0x9a2d('0xe4')],{'as':_0x9a2d('0x13a'),'foreignKey':_0x9a2d('0x13b')});db['SmsQueueReport'][_0x9a2d('0xfa')](db[_0x9a2d('0x132')],{'as':'Contact','foreignKey':_0x9a2d('0x134')});db[_0x9a2d('0xcb')][_0x9a2d('0xfa')](db[_0x9a2d('0x108')],{});db['SmsQueueReport'][_0x9a2d('0xfa')](db[_0x9a2d('0x154')],{});db[_0x9a2d('0xcb')][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{});db[_0x9a2d('0xcb')][_0x9a2d('0xfa')](db[_0x9a2d('0x53')],{});db[_0x9a2d('0xcd')][_0x9a2d('0xed')](db[_0x9a2d('0xca')],{'foreignKey':_0x9a2d('0x19b')});db['JscriptyProject'][_0x9a2d('0xed')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0x9a2d('0xcd')][_0x9a2d('0xed')](db[_0x9a2d('0xc6')],{'foreignKey':'ProjectId'});db[_0x9a2d('0xd1')][_0x9a2d('0xfd')](db[_0x9a2d('0xef')],{'as':_0x9a2d('0x151'),'through':'user_has_square_projects'});db['Team']['belongsToMany'](db['User'],{'as':_0x9a2d('0x127'),'through':'user_has_teams'});db[_0x9a2d('0x104')][_0x9a2d('0xfd')](db[_0x9a2d('0x1c')],{'through':'team_has_voice_queues','as':'VoiceQueues'});db[_0x9a2d('0x104')][_0x9a2d('0xfd')](db[_0x9a2d('0x10a')],{'through':_0x9a2d('0x13d'),'as':_0x9a2d('0x10b')});db[_0x9a2d('0x104')][_0x9a2d('0xfd')](db['ChatQueue'],{'through':_0x9a2d('0x16b'),'as':_0x9a2d('0x10c')});db[_0x9a2d('0x104')][_0x9a2d('0xfd')](db[_0x9a2d('0x4a')],{'through':_0x9a2d('0x19c'),'as':_0x9a2d('0x19d')});db[_0x9a2d('0x104')]['belongsToMany'](db[_0x9a2d('0x53')],{'through':_0x9a2d('0x15a'),'as':'SmsQueues'});db[_0x9a2d('0x104')][_0x9a2d('0xfd')](db['OpenchannelQueue'],{'through':_0x9a2d('0x161'),'as':_0x9a2d('0x10f')});db[_0x9a2d('0xd7')][_0x9a2d('0xed')](db[_0x9a2d('0x6b')],{'as':_0x9a2d('0x19e'),'foreignKey':_0x9a2d('0x19f')});db[_0x9a2d('0xd7')]['hasMany'](db[_0x9a2d('0x6f')],{'as':_0x9a2d('0xf3'),'foreignKey':_0x9a2d('0x19f')});db[_0x9a2d('0xd7')][_0x9a2d('0xed')](db[_0x9a2d('0x71')],{'as':'HopperHistories','foreignKey':_0x9a2d('0x19f')});db['Campaign'][_0x9a2d('0xed')](db[_0x9a2d('0x6d')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x9a2d('0xd7')][_0x9a2d('0xfa')](db[_0x9a2d('0x29')],{'as':'Trunk','foreignKey':_0x9a2d('0x1a0')});db[_0x9a2d('0xd7')][_0x9a2d('0xfa')](db[_0x9a2d('0x29')],{'as':_0x9a2d('0x1a1'),'foreignKey':_0x9a2d('0x122')});db[_0x9a2d('0xd7')]['belongsTo'](db[_0x9a2d('0x7b')],{'as':_0x9a2d('0x7b'),'foreignKey':_0x9a2d('0x147')});db[_0x9a2d('0xd7')]['belongsTo'](db['SquareProject'],{'as':_0x9a2d('0xd1'),'foreignKey':_0x9a2d('0x1a2')});db['Campaign'][_0x9a2d('0xfd')](db['CmList'],{'as':_0x9a2d('0x1a3'),'through':'campaigns_has_cm_lists'});db['Campaign'][_0x9a2d('0xfd')](db['CmList'],{'as':_0x9a2d('0x12a'),'through':'campaigns_has_cm_blacklists'});db['MailTransferReport']['belongsTo'](db[_0x9a2d('0x143')],{});db[_0x9a2d('0x1a4')]['belongsTo'](db[_0x9a2d('0x3c')],{});db[_0x9a2d('0x1a4')]['belongsTo'](db[_0x9a2d('0x38')],{'foreignKey':'FromMailAccountId','as':_0x9a2d('0x1a5')});db[_0x9a2d('0x1a4')]['belongsTo'](db['User'],{'foreignKey':_0x9a2d('0x1a6'),'as':_0x9a2d('0x1a7')});db[_0x9a2d('0x1a4')][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'foreignKey':_0x9a2d('0x1a8'),'as':_0x9a2d('0x1a9')});db['MailTransferReport']['belongsTo'](db[_0x9a2d('0x10a')],{'foreignKey':_0x9a2d('0x1aa'),'as':'ToQueue'});db[_0x9a2d('0x1a4')][_0x9a2d('0xfa')](db[_0x9a2d('0x38')],{'foreignKey':'ToMailAccountId','as':_0x9a2d('0x1ab')});db[_0x9a2d('0x1ac')][_0x9a2d('0xfa')](db[_0x9a2d('0x163')],{});db[_0x9a2d('0x1ac')]['belongsTo'](db[_0x9a2d('0x60')],{});db[_0x9a2d('0x1ac')][_0x9a2d('0xfa')](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0x9a2d('0x1a5')});db[_0x9a2d('0x1ac')][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'foreignKey':_0x9a2d('0x1a6'),'as':_0x9a2d('0x1a7')});db[_0x9a2d('0x1ac')][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'foreignKey':'ToUserId','as':_0x9a2d('0x1a9')});db[_0x9a2d('0x1ac')][_0x9a2d('0xfa')](db['ChatQueue'],{'foreignKey':_0x9a2d('0x1ad'),'as':_0x9a2d('0x1ae')});db['ChatTransferReport'][_0x9a2d('0xfa')](db[_0x9a2d('0x5c')],{'foreignKey':'ToChatWebsiteId','as':_0x9a2d('0x1ab')});db[_0x9a2d('0xdf')]['belongsTo'](db['FaxMessage'],{});db[_0x9a2d('0xdf')]['belongsTo'](db[_0x9a2d('0x47')],{});db[_0x9a2d('0xdf')]['belongsTo'](db[_0x9a2d('0x44')],{'foreignKey':'FromFaxAccountId','as':_0x9a2d('0x1a5')});db[_0x9a2d('0xdf')][_0x9a2d('0xfa')](db['User'],{'foreignKey':_0x9a2d('0x1a6'),'as':'FromAgent'});db[_0x9a2d('0xdf')][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'foreignKey':_0x9a2d('0x1a8'),'as':_0x9a2d('0x1a9')});db[_0x9a2d('0xdf')][_0x9a2d('0xfa')](db[_0x9a2d('0x4a')],{'foreignKey':_0x9a2d('0x1af'),'as':_0x9a2d('0x1ae')});db[_0x9a2d('0xdf')][_0x9a2d('0xfa')](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':_0x9a2d('0x1ab')});db[_0x9a2d('0xe1')][_0x9a2d('0xfa')](db[_0x9a2d('0x59')],{});db[_0x9a2d('0xe1')][_0x9a2d('0xfa')](db[_0x9a2d('0x58')],{});db[_0x9a2d('0xe1')][_0x9a2d('0xfa')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x9a2d('0x1a5')});db[_0x9a2d('0xe1')][_0x9a2d('0xfa')](db[_0x9a2d('0xef')],{'foreignKey':_0x9a2d('0x1a6'),'as':_0x9a2d('0x1a7')});db[_0x9a2d('0xe1')][_0x9a2d('0xfa')](db['User'],{'foreignKey':'ToUserId','as':_0x9a2d('0x1a9')});db[_0x9a2d('0xe1')]['belongsTo'](db['OpenchannelQueue'],{'foreignKey':_0x9a2d('0x1b0'),'as':_0x9a2d('0x1ae')});db[_0x9a2d('0xe1')][_0x9a2d('0xfa')](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':_0x9a2d('0x1ab')});db[_0x9a2d('0xe2')][_0x9a2d('0xfa')](db['SmsMessage'],{});db[_0x9a2d('0xe2')][_0x9a2d('0xfa')](db['SmsInteraction'],{});db['SmsTransferReport'][_0x9a2d('0xfa')](db[_0x9a2d('0x118')],{'foreignKey':_0x9a2d('0x1b1'),'as':_0x9a2d('0x1a5')});db[_0x9a2d('0xe2')]['belongsTo'](db[_0x9a2d('0xef')],{'foreignKey':_0x9a2d('0x1a6'),'as':'FromAgent'});db['SmsTransferReport'][_0x9a2d('0xfa')](db['User'],{'foreignKey':_0x9a2d('0x1a8'),'as':'ToAgent'});db[_0x9a2d('0xe2')]['belongsTo'](db[_0x9a2d('0x53')],{'foreignKey':_0x9a2d('0x1b2'),'as':_0x9a2d('0x1ae')});db['SmsTransferReport'][_0x9a2d('0xfa')](db[_0x9a2d('0x118')],{'foreignKey':'ToSmsAccountId','as':_0x9a2d('0x1ab')});db[_0x9a2d('0xe4')][_0x9a2d('0xed')](db[_0x9a2d('0x77')],{'as':_0x9a2d('0x15b'),'foreignKey':_0x9a2d('0x13b')});db[_0x9a2d('0xe4')]['hasMany'](db['CmCustomField'],{'as':_0x9a2d('0x1b3'),'foreignKey':_0x9a2d('0x13b')});db[_0x9a2d('0xe4')]['hasMany'](db['CmContact'],{'as':_0x9a2d('0x101'),'onDelete':_0x9a2d('0xf2'),'foreignKey':_0x9a2d('0x13b')});db[_0x9a2d('0xe4')]['hasMany'](db[_0x9a2d('0x6f')],{'as':_0x9a2d('0xf3'),'foreignKey':_0x9a2d('0x13b')});db[_0x9a2d('0xe4')]['hasMany'](db[_0x9a2d('0x71')],{'as':_0x9a2d('0xf4'),'foreignKey':'ListId'});db[_0x9a2d('0xe4')][_0x9a2d('0xed')](db['ReportAgentPreview'],{'as':_0x9a2d('0xf5'),'foreignKey':_0x9a2d('0x13b')});db[_0x9a2d('0xe4')]['belongsToMany'](db[_0x9a2d('0x1c')],{'as':'Queues','through':'voice_queues_has_cm_lists'});db['CmList'][_0x9a2d('0xfd')](db['User'],{'as':_0x9a2d('0x127'),'through':_0x9a2d('0x103')});db['VoicePrefix'][_0x9a2d('0xed')](db[_0x9a2d('0x18')],{'as':_0x9a2d('0xf1'),'onDelete':_0x9a2d('0x146')});db['VoicePrefix'][_0x9a2d('0xfd')](db[_0x9a2d('0xef')],{'as':_0x9a2d('0x127'),'through':_0x9a2d('0x110')});db['UserProfile'][_0x9a2d('0xed')](db['User'],{'as':'Users','foreignKey':_0x9a2d('0xfc')});db[_0x9a2d('0xfb')][_0x9a2d('0xed')](db['UserProfileSection'],{'as':_0x9a2d('0x1b4'),'foreignKey':_0x9a2d('0xfc'),'onDelete':_0x9a2d('0xf2')});db['UserProfileSection']['hasMany'](db[_0x9a2d('0x1b5')],{'as':'Resources','foreignKey':_0x9a2d('0x1b6'),'onDelete':_0x9a2d('0xf2')});module[_0x9a2d('0x1b7')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x2924=['user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccount','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','VoiceMusicOnHold','Sounds','Members','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','team_has_voice_queues','voice_queues_has_cm_blacklists','mailboxuser','mailbox','uniqueid','ContactId','MailAccountId','hasOne','Imap','Smtp','CannedAnswer','Messages','Interactions','Applications','List','Template','TemplateId','team_has_mail_queues','Teams','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','ThroughTags','Users','Attachments','Contact','Interaction','restrict','ListId','Items','Dispositions','Answers','FaxAccountId','FaxMessage','TagId','FaxInteractionId','fax_interaction_has_tags','Tags','AttachmentId','SmsAccountId','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatApplication','OpenchannelQueueReport','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessage','ChatGroupId','CmCompany','Contacts','Hoppers','Company','CompanyId','cm_contact_has_tags','OwnerId','Campaign','CampaignId','Automation','All','OneAll','AutomationAllId','Any','AutomationAnyId','Actions','AutomationId','Intervals','Extensions','MailApplications','ChatApplications','FaxApplications','SmsApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','MetricId','Configurations','AccountId','Subjects','Descriptions','DescriptionId','FieldId','Subject','Description','VariableId','SubjectId','int_desk_configuration_has_tags','Field','ZohoConfiguration','ZohoField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerField','int_vtiger_configuration_has_tags','ServicenowConfiguration','Dynamics365Field','ChatQueueReport','ToId','SessionId','ProjectId','JscriptyProject','VoiceQueues','team_has_chat_queues','team_has_fax_queues','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','userProfileId','exports','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','xC@LL1234','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','127.0.0.1','mysql','database','username','options','password','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','../api/integration/integration.model','Network','../api/network/network.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/campaign/campaign.model','Migration','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','VoiceMail','cascade','UserId','Recordings','hasMany','VoiceQueuesRt','HopperFinals','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteractions','MailInteractions','belongsTo','belongsToMany','Groups','chat_group_has_users','CmContact','cm_user_has_contacts','cm_user_has_lists','user_has_teams','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','MailQueues','ChatQueue','ChatQueues','FaxQueues','OpenchannelQueues','UserOpenchannelQueue','VoicePrefix','VoicePrefixes'];(function(_0xf4d64c,_0x1ab0e8){var _0x7accb2=function(_0x376546){while(--_0x376546){_0xf4d64c['push'](_0xf4d64c['shift']());}};_0x7accb2(++_0x1ab0e8);}(_0x2924,0xbc));var _0x4292=function(_0x81fe53,_0x5b8f05){_0x81fe53=_0x81fe53-0x0;var _0x56f7a7=_0x2924[_0x81fe53];return _0x56f7a7;};'use strict';var path=require('path');var config=require(_0x4292('0x0'));var Sequelize=require(_0x4292('0x1'));var _=require(_0x4292('0x2'));var jstz=require(_0x4292('0x3'));var timezone=jstz['determine']();config[_0x4292('0x1')]=_[_0x4292('0x4')](config['sequelize'],{'database':_0x4292('0x5'),'username':_0x4292('0x6'),'password':_0x4292('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x4292('0x8')},'logging':![],'timezone':timezone[_0x4292('0x9')](),'define':{'charset':_0x4292('0xa'),'collate':_0x4292('0xb')}}});config[_0x4292('0xc')]=_[_0x4292('0x4')](config[_0x4292('0xc')],{'database':_0x4292('0x5'),'username':_0x4292('0x6'),'password':_0x4292('0x7'),'options':{'host':_0x4292('0xd'),'port':0xcea,'dialect':_0x4292('0xe'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x4292('0x9')](),'define':{'charset':_0x4292('0xa'),'collate':_0x4292('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4292('0x1')][_0x4292('0xf')],config['sequelize'][_0x4292('0x10')],config['sequelize']['password'],config[_0x4292('0x1')][_0x4292('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4292('0xc')]['database'],config[_0x4292('0xc')]['username'],config[_0x4292('0xc')][_0x4292('0x12')],config[_0x4292('0xc')][_0x4292('0x11')])};db[_0x4292('0x13')]=db['sequelize'][_0x4292('0x14')](_0x4292('0x15'));db[_0x4292('0x16')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x17'));db['VoiceContext']=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x18'));db[_0x4292('0x19')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x1a'));db['VoiceMusicOnHold']=db[_0x4292('0x1')]['import'](_0x4292('0x1b'));db[_0x4292('0x1c')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x1d'));db[_0x4292('0x1e')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x1f'));db[_0x4292('0x20')]=db[_0x4292('0x1')][_0x4292('0x14')]('../api/screenRecording/screenRecording.model');db['VoiceMail']=db[_0x4292('0x1')][_0x4292('0x14')]('../api/voiceMail/voiceMail.model');db[_0x4292('0x21')]=db['sequelize']['import'](_0x4292('0x22'));db[_0x4292('0x23')]=db['sequelize']['import']('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db['sequelize'][_0x4292('0x14')]('../api/voiceDialReport/voiceDialReport.model');db[_0x4292('0x24')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x25'));db[_0x4292('0x26')]=db['sequelize'][_0x4292('0x14')](_0x4292('0x27'));db['MemberReport']=db['sequelize'][_0x4292('0x14')](_0x4292('0x28'));db[_0x4292('0x29')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x2a'));db[_0x4292('0x2b')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x2c'));db[_0x4292('0x2d')]=db['sequelize'][_0x4292('0x14')](_0x4292('0x2e'));db[_0x4292('0x2f')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x30'));db[_0x4292('0x31')]=db[_0x4292('0x1')]['import'](_0x4292('0x32'));db[_0x4292('0x33')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x34'));db[_0x4292('0x35')]=db[_0x4292('0x1')][_0x4292('0x14')]('../api/userFaxQueue/userFaxQueue.model');db[_0x4292('0x36')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x37'));db['UserOpenchannelQueue']=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x38'));db[_0x4292('0x39')]=db[_0x4292('0x1')]['import'](_0x4292('0x3a'));db[_0x4292('0x3b')]=db[_0x4292('0x1')][_0x4292('0x14')]('../api/mailServerOut/mailServerOut.model');db[_0x4292('0x3c')]=db['sequelize'][_0x4292('0x14')](_0x4292('0x3d'));db[_0x4292('0x3e')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x3f'));db[_0x4292('0x40')]=db[_0x4292('0x1')]['import'](_0x4292('0x41'));db[_0x4292('0x42')]=db['sequelize'][_0x4292('0x14')](_0x4292('0x43'));db[_0x4292('0x44')]=db[_0x4292('0x1')]['import'](_0x4292('0x45'));db[_0x4292('0x46')]=db['sequelize']['import']('../api/mailApplication/mailApplication.model');db[_0x4292('0x47')]=db['sequelize'][_0x4292('0x14')](_0x4292('0x48'));db[_0x4292('0x49')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x4a'));db[_0x4292('0x4b')]=db['sequelize'][_0x4292('0x14')](_0x4292('0x4c'));db['FaxAccount']=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x4d'));db[_0x4292('0x4e')]=db['sequelize'][_0x4292('0x14')](_0x4292('0x4f'));db[_0x4292('0x50')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x51'));db['FaxMessage']=db[_0x4292('0x1')][_0x4292('0x14')]('../api/faxMessage/faxMessage.model');db[_0x4292('0x52')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x53'));db[_0x4292('0x54')]=db['sequelize'][_0x4292('0x14')](_0x4292('0x55'));db[_0x4292('0x56')]=db[_0x4292('0x1')]['import'](_0x4292('0x57'));db[_0x4292('0x58')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x59'));db[_0x4292('0x5a')]=db[_0x4292('0x1')]['import']('../api/smsInteraction/smsInteraction.model');db[_0x4292('0x5b')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x5c'));db[_0x4292('0x5d')]=db[_0x4292('0x1')]['import'](_0x4292('0x5e'));db['OpenchannelAccount']=db['sequelize'][_0x4292('0x14')](_0x4292('0x5f'));db[_0x4292('0x60')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x61'));db[_0x4292('0x62')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x63'));db[_0x4292('0x64')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x65'));db[_0x4292('0x66')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x67'));db[_0x4292('0x68')]=db[_0x4292('0x1')]['import']('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0x4292('0x1')]['import'](_0x4292('0x69'));db['ChatApplication']=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x6a'));db[_0x4292('0x6b')]=db['sequelize'][_0x4292('0x14')](_0x4292('0x6c'));db[_0x4292('0x6d')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x6e'));db['ChatOfflineMessage']=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x6f'));db['ChatQueue']=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x70'));db[_0x4292('0x71')]=db[_0x4292('0x1')]['import'](_0x4292('0x72'));db[_0x4292('0x73')]=db[_0x4292('0x1')][_0x4292('0x14')]('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db['sequelize'][_0x4292('0x14')](_0x4292('0x74'));db['CmContact']=db[_0x4292('0x1')]['import'](_0x4292('0x75'));db[_0x4292('0x76')]=db[_0x4292('0x1')][_0x4292('0x14')]('../api/cmHopper/cmHopper.model');db[_0x4292('0x77')]=db[_0x4292('0x1')][_0x4292('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x4292('0x78')]=db['sequelize'][_0x4292('0x14')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x4292('0x79')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x7a'));db[_0x4292('0x7b')]=db['sequelize']['import'](_0x4292('0x7c'));db[_0x4292('0x7d')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x7e'));db[_0x4292('0x7f')]=db[_0x4292('0x1')]['import'](_0x4292('0x80'));db['Automation']=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x81'));db['CannedAnswer']=db[_0x4292('0x1')]['import'](_0x4292('0x82'));db[_0x4292('0x83')]=db[_0x4292('0x1')]['import'](_0x4292('0x84'));db[_0x4292('0x85')]=db[_0x4292('0x1')]['import'](_0x4292('0x86'));db[_0x4292('0x87')]=db['sequelize'][_0x4292('0x14')]('../api/interval/interval.model');db[_0x4292('0x88')]=db['sequelize'][_0x4292('0x14')](_0x4292('0x89'));db['Cdr']=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x8a'));db[_0x4292('0x8b')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x8c'));db[_0x4292('0x8d')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x8e'));db[_0x4292('0x8f')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x90'));db['Tag']=db[_0x4292('0x1')][_0x4292('0x14')]('../api/tag/tag.model');db['Template']=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x91'));db[_0x4292('0x92')]=db['sequelize'][_0x4292('0x14')](_0x4292('0x93'));db[_0x4292('0x94')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x95'));db[_0x4292('0x96')]=db[_0x4292('0x1')][_0x4292('0x14')]('../api/integration/integration.model');db[_0x4292('0x97')]=db['sequelize'][_0x4292('0x14')](_0x4292('0x98'));db[_0x4292('0x99')]=db['sequelize'][_0x4292('0x14')]('../api/analyticCustomReport/analyticCustomReport.model');db['AnalyticDefaultReport']=db['sequelize'][_0x4292('0x14')](_0x4292('0x9a'));db[_0x4292('0x9b')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x9c'));db[_0x4292('0x9d')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0x9e'));db['AnalyticFieldReport']=db['sequelize'][_0x4292('0x14')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x4292('0x9f')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xa0'));db[_0x4292('0xa1')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xa2'));db[_0x4292('0xa3')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xa4'));db[_0x4292('0xa5')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xa6'));db[_0x4292('0xa7')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xa8'));db[_0x4292('0xa9')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xaa'));db[_0x4292('0xab')]=db[_0x4292('0x1')][_0x4292('0x14')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x4292('0xac')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xad'));db[_0x4292('0xae')]=db['sequelize'][_0x4292('0x14')](_0x4292('0xaf'));db[_0x4292('0xb0')]=db['sequelize'][_0x4292('0x14')](_0x4292('0xb1'));db[_0x4292('0xb2')]=db[_0x4292('0x1')]['import'](_0x4292('0xb3'));db['ZohoConfiguration']=db[_0x4292('0x1')]['import'](_0x4292('0xb4'));db['ZohoField']=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xb5'));db[_0x4292('0xb6')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xb7'));db[_0x4292('0xb8')]=db['sequelize'][_0x4292('0x14')](_0x4292('0xb9'));db[_0x4292('0xba')]=db['sequelize']['import']('../api/intZendeskField/intZendeskField.model');db[_0x4292('0xbb')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xbc'));db[_0x4292('0xbd')]=db['sequelize']['import'](_0x4292('0xbe'));db[_0x4292('0xbf')]=db[_0x4292('0x1')][_0x4292('0x14')]('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xc0'));db[_0x4292('0xc1')]=db[_0x4292('0x1')]['import']('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xc2'));db[_0x4292('0xc3')]=db[_0x4292('0x1')]['import'](_0x4292('0xc4'));db['ServicenowConfiguration']=db[_0x4292('0x1')]['import']('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x4292('0xc5')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xc6'));db[_0x4292('0xc7')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xc8'));db[_0x4292('0xc9')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xca'));db['Dynamics365Field']=db['sequelize'][_0x4292('0x14')](_0x4292('0xcb'));db[_0x4292('0x96')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xcc'));db[_0x4292('0xcd')]=db['sequelize'][_0x4292('0x14')](_0x4292('0xce'));db['ChatQueueReport']=db[_0x4292('0x1')][_0x4292('0x14')]('../api/chatQueueReport/chatQueueReport.model');db[_0x4292('0xcf')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xd0'));db[_0x4292('0xd1')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xd2'));db[_0x4292('0xd3')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xd4'));db[_0x4292('0xd5')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xd6'));db[_0x4292('0xd7')]=db[_0x4292('0x1')][_0x4292('0x14')]('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0x4292('0x1')]['import'](_0x4292('0xd8'));db['SquareDetailsReport']=db['sequelize'][_0x4292('0x14')](_0x4292('0xd9'));db['JscriptyProject']=db[_0x4292('0x1')]['import']('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0x4292('0x1')]['import'](_0x4292('0xda'));db[_0x4292('0xdb')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xdc'));db[_0x4292('0xdd')]=db[_0x4292('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x4292('0xde')]=db['sequelize']['import'](_0x4292('0xdf'));db[_0x4292('0xe0')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xe1'));db[_0x4292('0xe2')]=db['sequelize'][_0x4292('0x14')](_0x4292('0xe3'));db[_0x4292('0xe4')]=db[_0x4292('0x1')][_0x4292('0x14')]('../api/license/license.model');db['Campaign']=db[_0x4292('0x1')]['import'](_0x4292('0xe5'));db[_0x4292('0xe6')]=db['sequelize']['import']('../api/migration/migration.model');db[_0x4292('0xe7')]=db['sequelize']['import']('../api/attachment/attachment.model');db[_0x4292('0xe8')]=db['sequelize'][_0x4292('0x14')](_0x4292('0xe9'));db[_0x4292('0xea')]=db[_0x4292('0x1')]['import']('../api/mailTransferReport/mailTransferReport.model');db[_0x4292('0xeb')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xec'));db[_0x4292('0xed')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xee'));db['OpenchannelTransferReport']=db[_0x4292('0x1')][_0x4292('0x14')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x4292('0xef')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xf0'));db[_0x4292('0xf1')]=db[_0x4292('0x1')]['import'](_0x4292('0xf2'));db['VoicePrefix']=db['sequelize']['import'](_0x4292('0xf3'));db[_0x4292('0xf4')]=db[_0x4292('0x1')][_0x4292('0x14')](_0x4292('0xf5'));db[_0x4292('0xf6')]=db[_0x4292('0x1')][_0x4292('0x14')]('../api/userProfileSection/userProfileSection.model');db[_0x4292('0xf7')]=db[_0x4292('0x1')]['import'](_0x4292('0xf8'));db[_0x4292('0x13')]['hasOne'](db[_0x4292('0xf9')],{'as':_0x4292('0xf9'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0xfb')});db[_0x4292('0x13')]['hasMany'](db['VoiceRecording'],{'as':_0x4292('0xfc'),'foreignKey':_0x4292('0xfb')});db[_0x4292('0x13')][_0x4292('0xfd')](db['UserVoiceQueueRt'],{'as':_0x4292('0xfe'),'foreignKey':_0x4292('0xfb')});db[_0x4292('0x13')]['hasMany'](db['VoiceExtension'],{'as':'Extensions','onDelete':_0x4292('0xfa'),'hooks':!![]});db[_0x4292('0x13')][_0x4292('0xfd')](db[_0x4292('0x78')],{'as':_0x4292('0xff'),'foreignKey':_0x4292('0xfb')});db['User'][_0x4292('0xfd')](db[_0x4292('0x79')],{'as':_0x4292('0x100'),'foreignKey':'UserId'});db[_0x4292('0x13')][_0x4292('0xfd')](db['ReportAgentPreview'],{'as':_0x4292('0x7b'),'foreignKey':_0x4292('0xfb')});db['User'][_0x4292('0xfd')](db[_0x4292('0x62')],{'as':_0x4292('0x101'),'foreignKey':_0x4292('0xfb')});db['User'][_0x4292('0xfd')](db[_0x4292('0x6b')],{'as':'ChatInteractions','foreignKey':_0x4292('0xfb')});db[_0x4292('0x13')][_0x4292('0xfd')](db[_0x4292('0x5a')],{'as':_0x4292('0x102'),'foreignKey':_0x4292('0xfb')});db[_0x4292('0x13')][_0x4292('0xfd')](db[_0x4292('0x50')],{'as':_0x4292('0x103'),'foreignKey':_0x4292('0xfb')});db[_0x4292('0x13')][_0x4292('0xfd')](db[_0x4292('0x42')],{'as':_0x4292('0x104'),'foreignKey':_0x4292('0xfb')});db[_0x4292('0x13')][_0x4292('0x105')](db[_0x4292('0xf4')],{'as':_0x4292('0xf4'),'foreignKey':'userProfileId'});db[_0x4292('0x13')][_0x4292('0x106')](db['ChatGroup'],{'as':_0x4292('0x107'),'through':_0x4292('0x108')});db[_0x4292('0x13')][_0x4292('0x106')](db[_0x4292('0x109')],{'as':'Contacts','through':_0x4292('0x10a')});db[_0x4292('0x13')][_0x4292('0x106')](db['CmList'],{'as':'Lists','through':_0x4292('0x10b')});db[_0x4292('0x13')]['belongsToMany'](db[_0x4292('0xe2')],{'through':_0x4292('0x10c')});db[_0x4292('0x13')][_0x4292('0x106')](db[_0x4292('0x42')],{'as':_0x4292('0x104'),'through':'user_has_mail_interactions'});db['User'][_0x4292('0x106')](db[_0x4292('0x6b')],{'as':_0x4292('0x10d'),'through':_0x4292('0x10e')});db[_0x4292('0x13')][_0x4292('0x106')](db[_0x4292('0x50')],{'as':_0x4292('0x103'),'through':_0x4292('0x10f')});db['User']['belongsToMany'](db[_0x4292('0x5a')],{'as':_0x4292('0x102'),'through':_0x4292('0x110')});db[_0x4292('0x13')][_0x4292('0x106')](db[_0x4292('0x62')],{'as':_0x4292('0x101'),'through':_0x4292('0x111')});db[_0x4292('0x13')][_0x4292('0x106')](db[_0x4292('0x1c')],{'as':'VoiceQueues','through':'UserVoiceQueue','required':![]});db[_0x4292('0x13')][_0x4292('0x106')](db[_0x4292('0x3e')],{'as':_0x4292('0x112'),'through':'UserMailQueue','required':![]});db['User']['belongsToMany'](db[_0x4292('0x113')],{'as':_0x4292('0x114'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x4292('0x13')][_0x4292('0x106')](db[_0x4292('0x52')],{'as':_0x4292('0x115'),'through':_0x4292('0x35'),'required':![]});db['User'][_0x4292('0x106')](db['SmsQueue'],{'as':'SmsQueues','through':_0x4292('0x36'),'required':![]});db['User'][_0x4292('0x106')](db[_0x4292('0x66')],{'as':_0x4292('0x116'),'through':_0x4292('0x117'),'required':![]});db[_0x4292('0x13')]['belongsToMany'](db[_0x4292('0xf1')],{'through':'cm_user_has_lists'});db[_0x4292('0x13')]['belongsToMany'](db[_0x4292('0x118')],{'as':_0x4292('0x119'),'through':_0x4292('0x11a'),'required':![]});db['User'][_0x4292('0x106')](db[_0x4292('0x68')],{'as':_0x4292('0x11b'),'through':_0x4292('0x11c')});db[_0x4292('0x13')]['belongsToMany'](db[_0x4292('0x11d')],{'as':'FaxAccounts','through':_0x4292('0x11e')});db[_0x4292('0x13')][_0x4292('0x106')](db[_0x4292('0x3c')],{'as':_0x4292('0x11f'),'through':_0x4292('0x120')});db['User'][_0x4292('0x106')](db[_0x4292('0x121')],{'as':_0x4292('0x122'),'through':_0x4292('0x123')});db['User'][_0x4292('0x106')](db[_0x4292('0x56')],{'as':_0x4292('0x124'),'through':'user_has_sms_accounts'});db[_0x4292('0x13')][_0x4292('0x106')](db[_0x4292('0xdd')],{'as':'SquareProjects','through':_0x4292('0x125')});db['VoiceChanSpy'][_0x4292('0xfd')](db[_0x4292('0x19')],{'as':_0x4292('0x126'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x127')});db[_0x4292('0x128')][_0x4292('0xfd')](db[_0x4292('0x19')],{'onDelete':_0x4292('0xfa')});db[_0x4292('0x19')][_0x4292('0xfd')](db[_0x4292('0x19')],{'as':'Applications','onDelete':_0x4292('0xfa')});db[_0x4292('0x129')][_0x4292('0x106')](db[_0x4292('0x8f')],{'as':_0x4292('0x12a'),'through':'moh_has_sounds'});db[_0x4292('0x1c')][_0x4292('0xfd')](db[_0x4292('0x2d')],{'as':_0x4292('0x12b'),'foreignKey':_0x4292('0x12c')});db[_0x4292('0x1c')][_0x4292('0xfd')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x4292('0x12c')});db[_0x4292('0x1c')][_0x4292('0xfd')](db[_0x4292('0x78')],{'as':_0x4292('0xff'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x4292('0xfd')](db[_0x4292('0x79')],{'as':_0x4292('0x12d'),'foreignKey':_0x4292('0x12c')});db[_0x4292('0x1c')][_0x4292('0xfd')](db[_0x4292('0x7b')],{'as':_0x4292('0x7b'),'foreignKey':_0x4292('0x12c')});db[_0x4292('0x1c')][_0x4292('0xfd')](db['CmHopperBlack'],{'as':_0x4292('0x12e'),'foreignKey':_0x4292('0x12c')});db['VoiceQueue']['hasMany'](db[_0x4292('0xd5')],{'as':_0x4292('0x12f'),'foreignKey':_0x4292('0x12c')});db[_0x4292('0x1c')][_0x4292('0x105')](db[_0x4292('0x29')],{'as':_0x4292('0x29'),'foreignKey':_0x4292('0x130')});db[_0x4292('0x1c')][_0x4292('0x105')](db[_0x4292('0x29')],{'as':_0x4292('0x131'),'foreignKey':_0x4292('0x132')});db[_0x4292('0x1c')][_0x4292('0x105')](db[_0x4292('0x87')],{'as':_0x4292('0x87'),'foreignKey':_0x4292('0x133')});db[_0x4292('0x1c')][_0x4292('0x105')](db[_0x4292('0x88')],{'as':_0x4292('0x134'),'foreignKey':_0x4292('0x135')});db[_0x4292('0x1c')][_0x4292('0x106')](db[_0x4292('0xf1')],{'as':'Lists','through':_0x4292('0x136')});db[_0x4292('0x1c')][_0x4292('0x106')](db[_0x4292('0x13')],{'as':_0x4292('0x137'),'through':_0x4292('0x2f')});db['VoiceQueue'][_0x4292('0x106')](db['Team'],{'as':'Teams','through':_0x4292('0x138')});db['VoiceQueue'][_0x4292('0x106')](db[_0x4292('0xf1')],{'as':'BlackLists','through':_0x4292('0x139')});db[_0x4292('0x1e')][_0x4292('0x105')](db[_0x4292('0x13')],{'as':_0x4292('0x13'),'foreignKey':'UserId'});db[_0x4292('0x20')][_0x4292('0x105')](db['User'],{'as':_0x4292('0x13'),'foreignKey':_0x4292('0xfb')});db[_0x4292('0xf9')][_0x4292('0xfd')](db['VoiceMailMessage'],{'as':'Messages','onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x13a'),'sourceKey':_0x4292('0x13b')});db[_0x4292('0x21')][_0x4292('0x105')](db[_0x4292('0xf9')],{'foreignKey':_0x4292('0x13a'),'targetKey':_0x4292('0x13b')});db[_0x4292('0x23')]['hasMany'](db[_0x4292('0x26')],{'as':'QueueCalls','foreignKey':_0x4292('0x13c'),'constraints':![]});db['VoiceCallReport'][_0x4292('0xfd')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':_0x4292('0x13c'),'constraints':![]});db[_0x4292('0x23')]['belongsTo'](db[_0x4292('0x13')],{'as':_0x4292('0x13'),'foreignKey':_0x4292('0xfb')});db[_0x4292('0x23')][_0x4292('0x105')](db[_0x4292('0x109')],{'as':'Contact','foreignKey':_0x4292('0x13d')});db[_0x4292('0x39')][_0x4292('0x105')](db[_0x4292('0x3c')],{'as':_0x4292('0x3c'),'foreignKey':_0x4292('0x13e')});db['MailServerOut'][_0x4292('0x105')](db[_0x4292('0x3c')],{'as':'MailAccount','foreignKey':_0x4292('0x13e')});db[_0x4292('0x3c')][_0x4292('0x13f')](db[_0x4292('0x39')],{'as':_0x4292('0x140'),'onDelete':_0x4292('0xfa')});db[_0x4292('0x3c')][_0x4292('0x13f')](db[_0x4292('0x3b')],{'as':_0x4292('0x141'),'onDelete':'cascade'});db[_0x4292('0x3c')][_0x4292('0xfd')](db[_0x4292('0x83')],{'as':'Dispositions','foreignKey':_0x4292('0x13e')});db['MailAccount']['hasMany'](db[_0x4292('0x142')],{'as':'Answers','foreignKey':_0x4292('0x13e')});db[_0x4292('0x3c')][_0x4292('0xfd')](db[_0x4292('0x44')],{'as':_0x4292('0x143'),'foreignKey':_0x4292('0x13e')});db[_0x4292('0x3c')][_0x4292('0xfd')](db[_0x4292('0x42')],{'as':_0x4292('0x144')});db['MailAccount'][_0x4292('0xfd')](db[_0x4292('0x46')],{'as':_0x4292('0x145')});db['MailAccount']['belongsTo'](db['CmList'],{'as':_0x4292('0x146'),'foreignKey':'ListId'});db[_0x4292('0x3c')][_0x4292('0x105')](db[_0x4292('0x147')],{'as':'Template','foreignKey':_0x4292('0x148')});db['MailAccount']['belongsTo'](db[_0x4292('0x88')],{'as':'mandatoryDispositionPause','foreignKey':_0x4292('0x135')});db[_0x4292('0x3c')][_0x4292('0x106')](db[_0x4292('0x13')],{'as':_0x4292('0x137'),'through':_0x4292('0x120')});db[_0x4292('0x3e')]['belongsToMany'](db[_0x4292('0x13')],{'as':_0x4292('0x137'),'through':_0x4292('0x33')});db[_0x4292('0x3e')][_0x4292('0x106')](db[_0x4292('0xe2')],{'through':_0x4292('0x149'),'as':_0x4292('0x14a')});db[_0x4292('0x42')]['hasMany'](db['MailMessage'],{'as':_0x4292('0x143'),'onDelete':'cascade','foreignKey':_0x4292('0x14b')});db['MailInteraction'][_0x4292('0x105')](db[_0x4292('0x3c')],{'as':_0x4292('0x14c'),'foreignKey':'MailAccountId'});db['MailInteraction']['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x4292('0x13d')});db[_0x4292('0x42')][_0x4292('0x105')](db[_0x4292('0x13')],{'as':_0x4292('0x14d'),'foreignKey':_0x4292('0xfb')});db['MailInteraction'][_0x4292('0x106')](db[_0x4292('0x14e')],{'through':'mail_interaction_has_tags','as':'Tags'});db[_0x4292('0x42')]['belongsToMany'](db['Tag'],{'through':_0x4292('0x14f'),'as':_0x4292('0x150')});db[_0x4292('0x42')][_0x4292('0x106')](db['User'],{'as':_0x4292('0x151'),'through':'user_has_mail_interactions','foreignKey':_0x4292('0x14b')});db[_0x4292('0x44')]['hasMany'](db[_0x4292('0xe7')],{'as':_0x4292('0x152'),'onDelete':'cascade'});db[_0x4292('0x44')][_0x4292('0x105')](db[_0x4292('0x13')],{'as':_0x4292('0x13')});db[_0x4292('0x44')][_0x4292('0x105')](db[_0x4292('0x109')],{'onDelete':_0x4292('0xfa'),'as':_0x4292('0x153')});db[_0x4292('0x44')][_0x4292('0x105')](db[_0x4292('0x42')],{'as':_0x4292('0x154'),'foreignKey':_0x4292('0x14b')});db[_0x4292('0x44')][_0x4292('0x105')](db['MailAccount'],{'as':_0x4292('0x14c'),'foreignKey':_0x4292('0x13e')});db[_0x4292('0x46')][_0x4292('0x105')](db[_0x4292('0x13')],{'onDelete':_0x4292('0x155')});db[_0x4292('0x46')][_0x4292('0x105')](db['MailQueue'],{'onDelete':_0x4292('0x155')});db['MailApplication'][_0x4292('0x105')](db[_0x4292('0x3c')],{'onDelete':_0x4292('0x155')});db[_0x4292('0x46')]['belongsTo'](db['Interval'],{'onDelete':_0x4292('0x155'),'foreignKey':_0x4292('0x133')});db[_0x4292('0x46')][_0x4292('0x105')](db[_0x4292('0x14e')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x4292('0x47')][_0x4292('0x105')](db[_0x4292('0x3c')],{});db[_0x4292('0x47')]['belongsTo'](db[_0x4292('0xf1')],{'as':'List','foreignKey':_0x4292('0x156')});db[_0x4292('0x47')][_0x4292('0x105')](db[_0x4292('0x109')],{'as':_0x4292('0x153'),'foreignKey':_0x4292('0x13d')});db[_0x4292('0x47')][_0x4292('0x105')](db['MailInteraction'],{});db['MailQueueReport']['belongsTo'](db[_0x4292('0x44')],{});db[_0x4292('0x47')]['belongsTo'](db[_0x4292('0x13')],{});db[_0x4292('0x47')][_0x4292('0x105')](db[_0x4292('0x3e')],{});db[_0x4292('0x49')][_0x4292('0xfd')](db['DashboardItem'],{'as':_0x4292('0x157'),'onDelete':_0x4292('0xfa')});db['FaxAccount'][_0x4292('0xfd')](db['Disposition'],{'as':_0x4292('0x158'),'foreignKey':'FaxAccountId'});db[_0x4292('0x11d')]['hasMany'](db[_0x4292('0x142')],{'as':_0x4292('0x159'),'foreignKey':_0x4292('0x15a')});db[_0x4292('0x11d')]['hasMany'](db['FaxInteraction'],{'as':_0x4292('0x144')});db['FaxAccount'][_0x4292('0xfd')](db[_0x4292('0x4e')],{'as':'Applications'});db[_0x4292('0x11d')][_0x4292('0xfd')](db[_0x4292('0x19')],{'as':'Exntensions','onDelete':_0x4292('0xfa')});db[_0x4292('0x11d')]['hasMany'](db[_0x4292('0x15b')],{'as':_0x4292('0x143')});db[_0x4292('0x11d')]['belongsTo'](db[_0x4292('0x29')],{'as':_0x4292('0x29')});db[_0x4292('0x11d')][_0x4292('0x105')](db['CmList'],{'as':_0x4292('0x146'),'foreignKey':_0x4292('0x156')});db[_0x4292('0x11d')]['belongsTo'](db[_0x4292('0x88')],{'as':_0x4292('0x134'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4292('0x11d')][_0x4292('0x106')](db[_0x4292('0x13')],{'as':'Agents','through':_0x4292('0x11e')});db[_0x4292('0x4e')][_0x4292('0x105')](db['User'],{'onDelete':'restrict'});db[_0x4292('0x4e')][_0x4292('0x105')](db[_0x4292('0x52')],{'onDelete':_0x4292('0x155')});db[_0x4292('0x4e')][_0x4292('0x105')](db[_0x4292('0x11d')],{'onDelete':_0x4292('0x155')});db[_0x4292('0x4e')][_0x4292('0x105')](db[_0x4292('0x14e')],{'onDelete':'restrict','foreignKey':_0x4292('0x15c')});db[_0x4292('0x50')][_0x4292('0xfd')](db['FaxMessage'],{'as':_0x4292('0x143'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x15d')});db[_0x4292('0x50')][_0x4292('0x105')](db['FaxAccount'],{'as':_0x4292('0x14c'),'foreignKey':_0x4292('0x15a')});db[_0x4292('0x50')][_0x4292('0x105')](db[_0x4292('0x109')],{'as':_0x4292('0x153'),'foreignKey':_0x4292('0x13d')});db['FaxInteraction']['belongsTo'](db[_0x4292('0x13')],{'as':_0x4292('0x14d'),'foreignKey':_0x4292('0xfb')});db[_0x4292('0x50')]['belongsToMany'](db['Tag'],{'through':_0x4292('0x15e'),'as':_0x4292('0x15f')});db[_0x4292('0x50')]['belongsToMany'](db[_0x4292('0x14e')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db[_0x4292('0x50')]['belongsToMany'](db[_0x4292('0x13')],{'as':_0x4292('0x151'),'through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db[_0x4292('0x15b')]['belongsTo'](db['User'],{'onDelete':_0x4292('0xfa'),'as':_0x4292('0x13')});db[_0x4292('0x15b')][_0x4292('0x105')](db[_0x4292('0x50')],{'as':_0x4292('0x154'),'foreignKey':_0x4292('0x15d')});db['FaxMessage'][_0x4292('0x105')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0x4292('0x15b')][_0x4292('0x105')](db[_0x4292('0xe7')],{'as':'Attachment','foreignKey':_0x4292('0x160')});db['FaxMessage']['belongsTo'](db[_0x4292('0x11d')],{'as':_0x4292('0x14c'),'foreignKey':_0x4292('0x15a')});db[_0x4292('0x52')][_0x4292('0x106')](db[_0x4292('0x13')],{'as':'Agents','through':'UserFaxQueue'});db[_0x4292('0x52')][_0x4292('0x106')](db['Team'],{'through':'team_has_fax_queues','as':'Teams'});db['FaxQueueReport'][_0x4292('0x105')](db[_0x4292('0x11d')],{});db[_0x4292('0x54')][_0x4292('0x105')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x4292('0x54')][_0x4292('0x105')](db[_0x4292('0x109')],{'as':'Contact','foreignKey':_0x4292('0x13d')});db[_0x4292('0x54')][_0x4292('0x105')](db['FaxInteraction'],{});db[_0x4292('0x54')][_0x4292('0x105')](db['FaxMessage'],{});db['FaxQueueReport']['belongsTo'](db['User'],{});db[_0x4292('0x54')]['belongsTo'](db[_0x4292('0x52')],{});db[_0x4292('0x56')][_0x4292('0xfd')](db[_0x4292('0x83')],{'as':'Dispositions','foreignKey':_0x4292('0x161')});db[_0x4292('0x56')][_0x4292('0xfd')](db[_0x4292('0x142')],{'as':_0x4292('0x159'),'foreignKey':_0x4292('0x161')});db['SmsAccount'][_0x4292('0xfd')](db[_0x4292('0x5b')],{'as':_0x4292('0x143'),'foreignKey':_0x4292('0x161')});db[_0x4292('0x56')]['hasMany'](db[_0x4292('0x5a')],{'as':_0x4292('0x144')});db[_0x4292('0x56')][_0x4292('0xfd')](db['SmsApplication'],{'as':_0x4292('0x145')});db[_0x4292('0x56')][_0x4292('0x105')](db[_0x4292('0xf1')],{'as':_0x4292('0x146'),'foreignKey':_0x4292('0x156')});db['SmsAccount'][_0x4292('0x105')](db['Pause'],{'as':_0x4292('0x134'),'foreignKey':_0x4292('0x135')});db[_0x4292('0x56')][_0x4292('0x106')](db[_0x4292('0x13')],{'as':_0x4292('0x137'),'through':_0x4292('0x162')});db[_0x4292('0x58')][_0x4292('0x105')](db[_0x4292('0x13')],{'onDelete':'restrict'});db[_0x4292('0x58')][_0x4292('0x105')](db[_0x4292('0x5d')],{'onDelete':'restrict'});db['SmsApplication']['belongsTo'](db[_0x4292('0x56')],{'onDelete':'restrict'});db[_0x4292('0x58')]['belongsTo'](db['Interval'],{'onDelete':_0x4292('0x155'),'foreignKey':'IntervalId'});db[_0x4292('0x58')][_0x4292('0x105')](db[_0x4292('0x14e')],{'onDelete':'restrict','foreignKey':_0x4292('0x15c')});db[_0x4292('0x5a')][_0x4292('0xfd')](db[_0x4292('0x5b')],{'as':_0x4292('0x143'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x163')});db[_0x4292('0x5a')][_0x4292('0x105')](db[_0x4292('0x56')],{'as':'Account','foreignKey':_0x4292('0x161')});db[_0x4292('0x5a')][_0x4292('0x105')](db['CmContact'],{'as':'Contact','foreignKey':_0x4292('0x13d')});db[_0x4292('0x5a')]['belongsTo'](db[_0x4292('0x13')],{'as':'Owner','foreignKey':_0x4292('0xfb')});db['SmsInteraction'][_0x4292('0x106')](db[_0x4292('0x14e')],{'through':_0x4292('0x164'),'as':_0x4292('0x15f')});db[_0x4292('0x5a')]['belongsToMany'](db['Tag'],{'through':_0x4292('0x164'),'as':_0x4292('0x150')});db['SmsInteraction'][_0x4292('0x106')](db[_0x4292('0x13')],{'as':'Users','through':'user_has_sms_interactions','foreignKey':_0x4292('0x163')});db[_0x4292('0x5b')][_0x4292('0x105')](db[_0x4292('0x13')],{'as':'User'});db[_0x4292('0x5b')][_0x4292('0x105')](db[_0x4292('0x109')],{'onDelete':_0x4292('0xfa'),'as':_0x4292('0x153')});db[_0x4292('0x5b')][_0x4292('0x105')](db[_0x4292('0x5a')],{'onDelete':_0x4292('0xfa'),'as':_0x4292('0x154'),'foreignKey':'SmsInteractionId'});db[_0x4292('0x5b')][_0x4292('0x105')](db[_0x4292('0x56')],{'as':_0x4292('0x14c'),'foreignKey':_0x4292('0x161')});db['SmsQueue'][_0x4292('0x106')](db[_0x4292('0x13')],{'as':_0x4292('0x137'),'through':_0x4292('0x36'),'foreignKey':_0x4292('0x165')});db[_0x4292('0x5d')][_0x4292('0x106')](db[_0x4292('0xe2')],{'through':_0x4292('0x166'),'as':_0x4292('0x14a')});db['OpenchannelAccount'][_0x4292('0xfd')](db[_0x4292('0x83')],{'as':_0x4292('0x158'),'foreignKey':_0x4292('0x167')});db[_0x4292('0x121')]['hasMany'](db[_0x4292('0x142')],{'as':_0x4292('0x159'),'foreignKey':_0x4292('0x167')});db[_0x4292('0x121')]['hasMany'](db[_0x4292('0x62')],{'as':_0x4292('0x144'),'foreignKey':'OpenchannelAccountId'});db[_0x4292('0x121')][_0x4292('0xfd')](db[_0x4292('0x64')],{'as':_0x4292('0x143'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x4292('0xfd')](db[_0x4292('0x60')],{'as':_0x4292('0x145'),'foreignKey':_0x4292('0x167')});db[_0x4292('0x121')][_0x4292('0x105')](db[_0x4292('0xf1')],{'as':_0x4292('0x146'),'foreignKey':_0x4292('0x156')});db[_0x4292('0x121')][_0x4292('0x105')](db[_0x4292('0x88')],{'as':_0x4292('0x134'),'foreignKey':_0x4292('0x135')});db[_0x4292('0x121')][_0x4292('0x106')](db['User'],{'as':_0x4292('0x137'),'through':_0x4292('0x123')});db[_0x4292('0x60')]['belongsTo'](db[_0x4292('0x13')],{'onDelete':'restrict'});db['OpenchannelApplication'][_0x4292('0x105')](db[_0x4292('0x66')],{'onDelete':'restrict','foreignKey':_0x4292('0x168')});db[_0x4292('0x60')][_0x4292('0x105')](db[_0x4292('0x121')],{'onDelete':'restrict','foreignKey':_0x4292('0x167')});db[_0x4292('0x60')][_0x4292('0x105')](db['Interval'],{'onDelete':_0x4292('0x155'),'foreignKey':_0x4292('0x133')});db[_0x4292('0x60')]['belongsTo'](db[_0x4292('0x14e')],{'onDelete':_0x4292('0x155'),'foreignKey':_0x4292('0x15c')});db[_0x4292('0x62')][_0x4292('0xfd')](db[_0x4292('0x64')],{'as':_0x4292('0x143'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x169')});db[_0x4292('0x62')][_0x4292('0x105')](db[_0x4292('0x121')],{'as':_0x4292('0x14c'),'foreignKey':_0x4292('0x167')});db['OpenchannelInteraction'][_0x4292('0x105')](db['CmContact'],{'as':_0x4292('0x153'),'foreignKey':_0x4292('0x13d')});db['OpenchannelInteraction'][_0x4292('0x105')](db[_0x4292('0x13')],{'as':_0x4292('0x14d'),'foreignKey':_0x4292('0xfb')});db[_0x4292('0x62')][_0x4292('0x106')](db[_0x4292('0x14e')],{'through':_0x4292('0x16a'),'as':_0x4292('0x15f')});db[_0x4292('0x62')][_0x4292('0x106')](db[_0x4292('0x14e')],{'through':'openchannel_interaction_has_tags','as':_0x4292('0x150')});db['OpenchannelInteraction']['belongsToMany'](db[_0x4292('0x13')],{'as':_0x4292('0x151'),'through':_0x4292('0x111'),'foreignKey':_0x4292('0x169')});db[_0x4292('0x64')][_0x4292('0x105')](db[_0x4292('0x13')],{'onDelete':_0x4292('0xfa'),'as':'User'});db[_0x4292('0x64')][_0x4292('0x105')](db[_0x4292('0x109')],{'onDelete':_0x4292('0xfa'),'as':_0x4292('0x153')});db[_0x4292('0x64')][_0x4292('0x105')](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x4292('0x154'),'foreignKey':'OpenchannelInteractionId'});db[_0x4292('0x64')]['belongsTo'](db[_0x4292('0xe7')],{'as':'Attachment','foreignKey':_0x4292('0x160')});db['OpenchannelMessage'][_0x4292('0x105')](db[_0x4292('0x121')],{'as':_0x4292('0x14c'),'foreignKey':_0x4292('0x167')});db[_0x4292('0x66')][_0x4292('0x106')](db['User'],{'as':_0x4292('0x137'),'through':'UserOpenchannelQueue','foreignKey':_0x4292('0x168')});db['OpenchannelQueue'][_0x4292('0x106')](db[_0x4292('0xe2')],{'through':_0x4292('0x16b'),'as':'Teams'});db[_0x4292('0x68')][_0x4292('0xfd')](db['Disposition'],{'as':_0x4292('0x158'),'foreignKey':'ChatWebsiteId'});db[_0x4292('0x68')][_0x4292('0xfd')](db[_0x4292('0x142')],{'as':_0x4292('0x159'),'foreignKey':_0x4292('0x16c')});db[_0x4292('0x68')][_0x4292('0xfd')](db[_0x4292('0x73')],{'as':_0x4292('0x16d')});db[_0x4292('0x68')][_0x4292('0xfd')](db[_0x4292('0x6b')],{'as':'Interactions'});db['ChatWebsite']['hasMany'](db[_0x4292('0x16e')],{'as':_0x4292('0x145')});db[_0x4292('0x68')]['hasMany'](db[_0x4292('0x6d')],{'as':_0x4292('0x143')});db['ChatWebsite']['belongsTo'](db[_0x4292('0xf1')],{'as':_0x4292('0x146'),'foreignKey':'ListId'});db['ChatWebsite'][_0x4292('0x105')](db[_0x4292('0x87')],{'as':'Interval','foreignKey':_0x4292('0x133')});db[_0x4292('0x68')][_0x4292('0x105')](db[_0x4292('0x88')],{'as':_0x4292('0x134'),'foreignKey':_0x4292('0x135')});db[_0x4292('0x68')][_0x4292('0x106')](db[_0x4292('0x13')],{'as':_0x4292('0x137'),'through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0x4292('0x105')](db[_0x4292('0x121')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x4292('0xf1')],{'as':'List','foreignKey':_0x4292('0x156')});db['OpenchannelQueueReport'][_0x4292('0x105')](db[_0x4292('0x109')],{'as':_0x4292('0x153'),'foreignKey':_0x4292('0x13d')});db[_0x4292('0x16f')][_0x4292('0x105')](db[_0x4292('0x62')],{});db[_0x4292('0x16f')][_0x4292('0x105')](db[_0x4292('0x64')],{});db[_0x4292('0x16f')][_0x4292('0x105')](db[_0x4292('0x13')],{});db[_0x4292('0x16f')][_0x4292('0x105')](db['OpenchannelQueue'],{});db[_0x4292('0x16e')][_0x4292('0x105')](db[_0x4292('0x13')],{'as':_0x4292('0x170'),'foreignKey':_0x4292('0xfb'),'onDelete':_0x4292('0x155')});db['ChatApplication'][_0x4292('0x105')](db[_0x4292('0x113')],{'as':_0x4292('0x171'),'foreignKey':'ChatQueueId','onDelete':_0x4292('0x155')});db[_0x4292('0x16e')][_0x4292('0x105')](db['ChatWebsite'],{'as':_0x4292('0x172'),'foreignKey':'ChatWebsiteId','onDelete':'restrict'});db[_0x4292('0x16e')][_0x4292('0x105')](db['Tag'],{'onDelete':_0x4292('0x155'),'foreignKey':_0x4292('0x15c')});db[_0x4292('0x6b')][_0x4292('0xfd')](db[_0x4292('0x6d')],{'as':'Messages','onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x173')});db[_0x4292('0x6b')][_0x4292('0x105')](db['ChatWebsite'],{'as':_0x4292('0x14c'),'foreignKey':'ChatWebsiteId'});db[_0x4292('0x6b')]['belongsTo'](db['CmContact'],{'as':_0x4292('0x153'),'foreignKey':'ContactId'});db[_0x4292('0x6b')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x4292('0xfb')});db[_0x4292('0x6b')]['belongsToMany'](db[_0x4292('0x14e')],{'through':_0x4292('0x174'),'as':_0x4292('0x15f')});db[_0x4292('0x6b')]['belongsToMany'](db[_0x4292('0x14e')],{'through':_0x4292('0x174'),'as':_0x4292('0x150')});db['ChatInteraction'][_0x4292('0x106')](db[_0x4292('0x13')],{'as':_0x4292('0x151'),'through':_0x4292('0x10e'),'foreignKey':'ChatInteractionId'});db[_0x4292('0x6d')][_0x4292('0x105')](db[_0x4292('0x13')],{'onDelete':'cascade','as':_0x4292('0x13')});db[_0x4292('0x6d')]['belongsTo'](db['CmContact'],{'onDelete':_0x4292('0xfa'),'as':_0x4292('0x153'),'foreignKey':_0x4292('0x13d')});db[_0x4292('0x6d')][_0x4292('0x105')](db[_0x4292('0x6b')],{'onDelete':'cascade','as':_0x4292('0x154'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x4292('0x105')](db['Attachment'],{'as':_0x4292('0xe7'),'foreignKey':_0x4292('0x160')});db[_0x4292('0x6d')]['belongsTo'](db[_0x4292('0x68')],{'as':_0x4292('0x14c'),'foreignKey':_0x4292('0x16c')});db[_0x4292('0x175')][_0x4292('0x105')](db[_0x4292('0x109')],{'onDelete':'cascade','as':_0x4292('0x153'),'foreignKey':_0x4292('0x13d')});db[_0x4292('0x175')][_0x4292('0x105')](db[_0x4292('0x68')],{'as':_0x4292('0x14c'),'foreignKey':_0x4292('0x16c')});db[_0x4292('0x113')][_0x4292('0x106')](db['User'],{'as':_0x4292('0x137'),'through':'UserChatQueue','hooks':!![]});db[_0x4292('0x113')]['belongsToMany'](db[_0x4292('0xe2')],{'through':'team_has_chat_queues','as':_0x4292('0x14a')});db[_0x4292('0x71')][_0x4292('0xfd')](db[_0x4292('0xcf')],{'as':_0x4292('0x143'),'foreignKey':_0x4292('0x176'),'onDelete':_0x4292('0xfa')});db['ChatGroup']['belongsToMany'](db[_0x4292('0x13')],{'as':_0x4292('0x12b'),'through':_0x4292('0x108')});db[_0x4292('0x73')]['belongsTo'](db[_0x4292('0x68')],{'as':_0x4292('0x172'),'foreignKey':_0x4292('0x16c')});db[_0x4292('0x177')]['hasMany'](db[_0x4292('0x109')],{'as':_0x4292('0x178'),'foreignKey':'CompanyId'});db[_0x4292('0x109')][_0x4292('0xfd')](db[_0x4292('0x76')],{'as':_0x4292('0x179'),'foreignKey':_0x4292('0x13d')});db[_0x4292('0x109')][_0x4292('0xfd')](db[_0x4292('0x78')],{'as':'HopperFinals','foreignKey':_0x4292('0x13d')});db[_0x4292('0x109')][_0x4292('0xfd')](db[_0x4292('0x79')],{'as':_0x4292('0x12d'),'foreignKey':'ContactId'});db['CmContact'][_0x4292('0xfd')](db[_0x4292('0x7b')],{'as':_0x4292('0x7b'),'foreignKey':_0x4292('0x13d')});db[_0x4292('0x109')][_0x4292('0xfd')](db[_0x4292('0xd5')],{'as':_0x4292('0x12f'),'foreignKey':_0x4292('0x13d')});db[_0x4292('0x109')][_0x4292('0xfd')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0x4292('0x109')][_0x4292('0xfd')](db[_0x4292('0x6b')],{'as':_0x4292('0x10d'),'foreignKey':_0x4292('0x13d'),'onDelete':_0x4292('0x155')});db[_0x4292('0x109')][_0x4292('0xfd')](db[_0x4292('0x5a')],{'as':_0x4292('0x102'),'foreignKey':_0x4292('0x13d'),'onDelete':_0x4292('0x155')});db['CmContact'][_0x4292('0xfd')](db[_0x4292('0x50')],{'as':_0x4292('0x103'),'foreignKey':_0x4292('0x13d'),'onDelete':'restrict'});db[_0x4292('0x109')]['hasMany'](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x4292('0x13d'),'onDelete':_0x4292('0x155')});db[_0x4292('0x109')][_0x4292('0x105')](db[_0x4292('0x177')],{'as':_0x4292('0x17a'),'foreignKey':_0x4292('0x17b')});db[_0x4292('0x109')][_0x4292('0x105')](db[_0x4292('0xf1')],{'as':_0x4292('0x146'),'foreignKey':_0x4292('0x156'),'onDelete':_0x4292('0xfa')});db['CmContact'][_0x4292('0x106')](db[_0x4292('0x13')],{'as':_0x4292('0x151'),'through':_0x4292('0x10a')});db[_0x4292('0x109')][_0x4292('0x106')](db[_0x4292('0x14e')],{'as':_0x4292('0x15f'),'through':_0x4292('0x17c')});db[_0x4292('0x109')][_0x4292('0x106')](db[_0x4292('0x14e')],{'through':_0x4292('0x17c'),'as':_0x4292('0x150')});db['CmHopper'][_0x4292('0x105')](db[_0x4292('0x109')],{'as':_0x4292('0x153'),'foreignKey':_0x4292('0x13d'),'onDelete':'cascade'});db[_0x4292('0x76')][_0x4292('0x105')](db[_0x4292('0xf1')],{'as':_0x4292('0x146'),'foreignKey':_0x4292('0x156'),'onDelete':'cascade'});db[_0x4292('0x76')][_0x4292('0x105')](db['User'],{'as':_0x4292('0x170'),'foreignKey':_0x4292('0xfb')});db['CmHopper'][_0x4292('0x105')](db[_0x4292('0x1c')],{'as':'Queue','foreignKey':_0x4292('0x12c'),'onDelete':'cascade'});db[_0x4292('0x76')][_0x4292('0x105')](db['Campaign'],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0x4292('0xfa')});db['CmHopper']['belongsTo'](db[_0x4292('0x13')],{'as':'Owner','foreignKey':_0x4292('0x17d')});db[_0x4292('0x77')]['belongsTo'](db[_0x4292('0x109')],{'as':_0x4292('0x153'),'foreignKey':'ContactId','onDelete':_0x4292('0xfa')});db['CmHopperBlack']['belongsTo'](db['CmList'],{'as':_0x4292('0x146'),'foreignKey':_0x4292('0x156'),'onDelete':_0x4292('0xfa')});db[_0x4292('0x77')][_0x4292('0x105')](db[_0x4292('0x1c')],{'as':_0x4292('0x171'),'foreignKey':_0x4292('0x12c'),'onDelete':'cascade'});db[_0x4292('0x77')][_0x4292('0x105')](db['Campaign'],{'as':_0x4292('0x17e'),'foreignKey':_0x4292('0x17f'),'onDelete':'cascade'});db[_0x4292('0x180')][_0x4292('0xfd')](db['Condition'],{'as':{'plural':_0x4292('0x181'),'singular':_0x4292('0x182')},'foreignKey':_0x4292('0x183'),'onDelete':_0x4292('0xfa'),'hooks':!![]});db['Automation'][_0x4292('0xfd')](db[_0x4292('0x85')],{'as':{'plural':_0x4292('0x184'),'singular':'OneAny'},'foreignKey':_0x4292('0x185'),'onDelete':_0x4292('0xfa'),'hooks':!![]});db[_0x4292('0x180')][_0x4292('0xfd')](db['Action'],{'as':_0x4292('0x186'),'foreignKey':_0x4292('0x187'),'onDelete':_0x4292('0xfa'),'hooks':!![]});db[_0x4292('0x87')][_0x4292('0xfd')](db['Interval'],{'as':_0x4292('0x188'),'foreignKey':_0x4292('0x133'),'onDelete':_0x4292('0xfa'),'hooks':!![],'required':![]});db['Interval'][_0x4292('0xfd')](db['VoiceExtension'],{'as':_0x4292('0x189'),'foreignKey':'IntervalId','onDelete':_0x4292('0x155')});db[_0x4292('0x87')][_0x4292('0xfd')](db['MailApplication'],{'as':_0x4292('0x18a'),'foreignKey':_0x4292('0x133')});db[_0x4292('0x87')][_0x4292('0xfd')](db['ChatApplication'],{'as':_0x4292('0x18b'),'foreignKey':_0x4292('0x133')});db[_0x4292('0x87')]['hasMany'](db[_0x4292('0x4e')],{'as':_0x4292('0x18c'),'foreignKey':_0x4292('0x133')});db[_0x4292('0x87')][_0x4292('0xfd')](db[_0x4292('0x58')],{'as':_0x4292('0x18d'),'foreignKey':_0x4292('0x133')});db[_0x4292('0x8d')][_0x4292('0x105')](db[_0x4292('0x3c')],{});db['Schedule'][_0x4292('0x105')](db[_0x4292('0x18e')],{'foreignKey':_0x4292('0x18f')});db[_0x4292('0x8d')][_0x4292('0x105')](db[_0x4292('0x99')],{'foreignKey':_0x4292('0x190')});db[_0x4292('0x8f')]['belongsToMany'](db[_0x4292('0x129')],{'as':_0x4292('0x191'),'through':_0x4292('0x192'),'onDelete':_0x4292('0x155')});db[_0x4292('0x14e')]['belongsToMany'](db[_0x4292('0x109')],{'through':_0x4292('0x17c')});db['Tag'][_0x4292('0x106')](db['ChatInteraction'],{'through':_0x4292('0x174')});db[_0x4292('0x14e')]['belongsToMany'](db[_0x4292('0x42')],{'through':'mail_interaction_has_tags'});db[_0x4292('0x14e')]['belongsToMany'](db['SmsInteraction'],{'through':_0x4292('0x164')});db[_0x4292('0x14e')][_0x4292('0x106')](db['FaxInteraction'],{'through':_0x4292('0x15e')});db[_0x4292('0x14e')][_0x4292('0x106')](db[_0x4292('0x62')],{'through':'openchannel_interaction_has_tags'});db[_0x4292('0x92')][_0x4292('0xfd')](db['Condition'],{'as':{'plural':_0x4292('0x193'),'singular':_0x4292('0x194')},'foreignKey':_0x4292('0x195'),'onDelete':'cascade','hooks':!![]});db[_0x4292('0x92')]['hasMany'](db[_0x4292('0x85')],{'as':{'plural':_0x4292('0x196'),'singular':'AnyCondition'},'foreignKey':_0x4292('0x197'),'onDelete':_0x4292('0xfa'),'hooks':!![]});db[_0x4292('0x92')]['hasMany'](db['Action'],{'as':_0x4292('0x186'),'foreignKey':_0x4292('0x198'),'onDelete':_0x4292('0xfa'),'hooks':!![]});db[_0x4292('0x99')][_0x4292('0xfd')](db[_0x4292('0x199')],{'as':_0x4292('0x19a'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0x4292('0x18e')][_0x4292('0xfd')](db['AnalyticFieldReport'],{'as':_0x4292('0x19a'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x18f')});db[_0x4292('0x9d')][_0x4292('0xfd')](db[_0x4292('0x199')],{'as':'Fields','onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x19b')});db[_0x4292('0x199')][_0x4292('0x105')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0x4292('0xa1')][_0x4292('0xfd')](db[_0x4292('0xa3')],{'as':_0x4292('0x19c'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x19d')});db[_0x4292('0xa3')][_0x4292('0xfd')](db[_0x4292('0xa5')],{'as':_0x4292('0x19e'),'onDelete':_0x4292('0xfa'),'foreignKey':'SubjectId'});db[_0x4292('0xa3')][_0x4292('0xfd')](db['SalesforceField'],{'as':_0x4292('0x19f'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x1a0')});db[_0x4292('0xa3')][_0x4292('0xfd')](db['SalesforceField'],{'as':_0x4292('0x19a'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x1a1')});db['SalesforceConfiguration'][_0x4292('0x105')](db['SalesforceAccount'],{'as':_0x4292('0x14c'),'foreignKey':_0x4292('0x19d')});db['SalesforceField'][_0x4292('0xfd')](db[_0x4292('0xa5')],{'as':_0x4292('0x1a2'),'foreignKey':'SubjectId'});db[_0x4292('0xa5')][_0x4292('0xfd')](db['SalesforceField'],{'as':_0x4292('0x1a3'),'foreignKey':'DescriptionId'});db[_0x4292('0xa5')][_0x4292('0xfd')](db['SalesforceField'],{'as':'Field','foreignKey':_0x4292('0x1a1')});db['SalesforceField'][_0x4292('0x105')](db[_0x4292('0x94')],{'as':_0x4292('0x94'),'foreignKey':_0x4292('0x1a4')});db[_0x4292('0xa7')]['hasMany'](db[_0x4292('0xa9')],{'as':_0x4292('0x19c'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x19d')});db[_0x4292('0xa9')]['hasMany'](db[_0x4292('0xab')],{'as':_0x4292('0x19e'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x1a5')});db[_0x4292('0xa9')]['hasMany'](db[_0x4292('0xab')],{'as':_0x4292('0x19f'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x1a0')});db[_0x4292('0xa9')][_0x4292('0xfd')](db[_0x4292('0xab')],{'as':_0x4292('0x19a'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x1a1')});db[_0x4292('0xa9')][_0x4292('0x105')](db[_0x4292('0xa7')],{'as':_0x4292('0x14c'),'foreignKey':_0x4292('0x19d')});db[_0x4292('0xab')][_0x4292('0xfd')](db[_0x4292('0xab')],{'as':'Subject','foreignKey':_0x4292('0x1a5')});db['SugarcrmField']['hasMany'](db[_0x4292('0xab')],{'as':_0x4292('0x1a3'),'foreignKey':'DescriptionId'});db[_0x4292('0xab')][_0x4292('0xfd')](db[_0x4292('0xab')],{'as':'Field','foreignKey':'FieldId'});db[_0x4292('0xab')][_0x4292('0x105')](db['Variable'],{'as':_0x4292('0x94'),'foreignKey':_0x4292('0x1a4')});db[_0x4292('0xac')][_0x4292('0xfd')](db['DeskConfiguration'],{'as':_0x4292('0x19c'),'onDelete':_0x4292('0xfa'),'foreignKey':'AccountId'});db[_0x4292('0xae')][_0x4292('0xfd')](db[_0x4292('0xb0')],{'as':_0x4292('0x19e'),'onDelete':'cascade','foreignKey':_0x4292('0x1a5')});db[_0x4292('0xae')][_0x4292('0xfd')](db[_0x4292('0xb0')],{'as':'Descriptions','onDelete':_0x4292('0xfa'),'foreignKey':'DescriptionId'});db[_0x4292('0xae')][_0x4292('0xfd')](db[_0x4292('0xb0')],{'as':'Fields','onDelete':_0x4292('0xfa'),'foreignKey':'FieldId'});db[_0x4292('0xae')][_0x4292('0x105')](db['DeskAccount'],{'as':_0x4292('0x14c'),'foreignKey':_0x4292('0x19d')});db[_0x4292('0xae')][_0x4292('0x106')](db[_0x4292('0x14e')],{'through':_0x4292('0x1a6')});db[_0x4292('0xb0')]['hasMany'](db[_0x4292('0xb0')],{'as':'Subject','foreignKey':'SubjectId'});db['DeskField'][_0x4292('0xfd')](db[_0x4292('0xb0')],{'as':'Description','foreignKey':_0x4292('0x1a0')});db['DeskField'][_0x4292('0xfd')](db[_0x4292('0xb0')],{'as':_0x4292('0x1a7'),'foreignKey':'FieldId'});db[_0x4292('0xb0')]['belongsTo'](db[_0x4292('0x94')],{'as':'Variable','foreignKey':'VariableId'});db[_0x4292('0xb2')][_0x4292('0xfd')](db[_0x4292('0x1a8')],{'as':_0x4292('0x19c'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x19d')});db['ZohoConfiguration'][_0x4292('0xfd')](db[_0x4292('0x1a9')],{'as':_0x4292('0x19e'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x1a5')});db[_0x4292('0x1a8')]['hasMany'](db['ZohoField'],{'as':_0x4292('0x19f'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x1a0')});db[_0x4292('0x1a8')][_0x4292('0xfd')](db[_0x4292('0x1a9')],{'as':'Fields','onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x1a1')});db['ZohoConfiguration'][_0x4292('0x105')](db[_0x4292('0xb2')],{'as':_0x4292('0x14c'),'foreignKey':_0x4292('0x19d')});db[_0x4292('0x1a9')]['hasMany'](db[_0x4292('0x1a9')],{'as':_0x4292('0x1a2'),'foreignKey':_0x4292('0x1a5')});db['ZohoField'][_0x4292('0xfd')](db[_0x4292('0x1a9')],{'as':_0x4292('0x1a3'),'foreignKey':_0x4292('0x1a0')});db[_0x4292('0x1a9')][_0x4292('0xfd')](db[_0x4292('0x1a9')],{'as':'Field','foreignKey':_0x4292('0x1a1')});db[_0x4292('0x1a9')][_0x4292('0x105')](db[_0x4292('0x94')],{'as':_0x4292('0x94'),'foreignKey':'VariableId'});db[_0x4292('0xb6')][_0x4292('0xfd')](db[_0x4292('0xb8')],{'as':_0x4292('0x19c'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x19d')});db['ZendeskConfiguration'][_0x4292('0xfd')](db[_0x4292('0xba')],{'as':_0x4292('0x19e'),'foreignKey':_0x4292('0x1a5')});db[_0x4292('0xb8')][_0x4292('0xfd')](db[_0x4292('0xba')],{'as':_0x4292('0x19f'),'foreignKey':'DescriptionId'});db[_0x4292('0xb8')]['hasMany'](db[_0x4292('0xba')],{'as':'Fields','foreignKey':'FieldId'});db['ZendeskConfiguration'][_0x4292('0x105')](db[_0x4292('0xb6')],{'as':_0x4292('0x14c'),'foreignKey':'AccountId'});db[_0x4292('0xb8')]['belongsToMany'](db[_0x4292('0x14e')],{'through':_0x4292('0x1aa')});db[_0x4292('0xba')][_0x4292('0xfd')](db[_0x4292('0xba')],{'as':_0x4292('0x1a2'),'foreignKey':_0x4292('0x1a5')});db[_0x4292('0xba')][_0x4292('0xfd')](db[_0x4292('0xba')],{'as':_0x4292('0x1a3'),'foreignKey':_0x4292('0x1a0')});db[_0x4292('0xba')][_0x4292('0xfd')](db[_0x4292('0xba')],{'as':_0x4292('0x1a7'),'foreignKey':_0x4292('0x1a1')});db[_0x4292('0xba')][_0x4292('0x105')](db[_0x4292('0x94')],{'as':_0x4292('0x94'),'foreignKey':_0x4292('0x1a4')});db[_0x4292('0xbb')][_0x4292('0xfd')](db[_0x4292('0xbd')],{'as':'Configurations','onDelete':_0x4292('0xfa'),'foreignKey':'AccountId'});db[_0x4292('0xbd')]['hasMany'](db[_0x4292('0xbf')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x4292('0x1a5')});db['FreshdeskConfiguration'][_0x4292('0xfd')](db[_0x4292('0xbf')],{'as':_0x4292('0x19f'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x1a0')});db[_0x4292('0xbd')][_0x4292('0xfd')](db[_0x4292('0xbf')],{'as':_0x4292('0x19a'),'onDelete':'cascade','foreignKey':_0x4292('0x1a1')});db[_0x4292('0xbd')][_0x4292('0x105')](db[_0x4292('0xbb')],{'as':_0x4292('0x14c'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x4292('0x106')](db[_0x4292('0x14e')],{'through':_0x4292('0x1ab')});db[_0x4292('0xbf')]['hasMany'](db[_0x4292('0xbf')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x4292('0xbf')]['hasMany'](db['FreshdeskField'],{'as':'Description','foreignKey':_0x4292('0x1a0')});db['FreshdeskField'][_0x4292('0xfd')](db[_0x4292('0xbf')],{'as':_0x4292('0x1a7'),'foreignKey':_0x4292('0x1a1')});db[_0x4292('0xbf')][_0x4292('0x105')](db[_0x4292('0x94')],{'as':'Variable','foreignKey':_0x4292('0x1a4')});db[_0x4292('0x1ac')][_0x4292('0xfd')](db[_0x4292('0xc1')],{'as':'Configurations','onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x19d')});db[_0x4292('0xc1')]['hasMany'](db[_0x4292('0x1ad')],{'as':_0x4292('0x19e'),'foreignKey':_0x4292('0x1a5')});db[_0x4292('0xc1')][_0x4292('0xfd')](db[_0x4292('0x1ad')],{'as':_0x4292('0x19f'),'foreignKey':_0x4292('0x1a0')});db['VtigerConfiguration']['hasMany'](db[_0x4292('0x1ad')],{'as':_0x4292('0x19a'),'foreignKey':_0x4292('0x1a1')});db[_0x4292('0xc1')][_0x4292('0x105')](db['VtigerAccount'],{'as':_0x4292('0x14c'),'foreignKey':_0x4292('0x19d')});db[_0x4292('0xc1')]['belongsToMany'](db[_0x4292('0x14e')],{'through':_0x4292('0x1ae')});db['VtigerField'][_0x4292('0xfd')](db['VtigerField'],{'as':_0x4292('0x1a2'),'foreignKey':'SubjectId'});db['VtigerField']['hasMany'](db[_0x4292('0x1ad')],{'as':_0x4292('0x1a3'),'foreignKey':_0x4292('0x1a0')});db['VtigerField'][_0x4292('0xfd')](db['VtigerField'],{'as':_0x4292('0x1a7'),'foreignKey':_0x4292('0x1a1')});db[_0x4292('0x1ad')][_0x4292('0x105')](db[_0x4292('0x94')],{'as':'Variable','foreignKey':_0x4292('0x1a4')});db[_0x4292('0xc3')]['hasMany'](db[_0x4292('0x1af')],{'as':_0x4292('0x19c'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x19d')});db['ServicenowConfiguration'][_0x4292('0xfd')](db['ServicenowField'],{'as':_0x4292('0x19e'),'foreignKey':'SubjectId'});db['ServicenowConfiguration']['hasMany'](db['ServicenowField'],{'as':_0x4292('0x19f'),'foreignKey':_0x4292('0x1a0')});db[_0x4292('0x1af')][_0x4292('0xfd')](db[_0x4292('0xc5')],{'as':'Fields','foreignKey':'FieldId'});db[_0x4292('0x1af')]['belongsTo'](db[_0x4292('0xc3')],{'as':_0x4292('0x14c'),'foreignKey':_0x4292('0x19d')});db[_0x4292('0xc5')][_0x4292('0xfd')](db['ServicenowField'],{'as':'Subject','foreignKey':_0x4292('0x1a5')});db['ServicenowField'][_0x4292('0xfd')](db[_0x4292('0xc5')],{'as':_0x4292('0x1a3'),'foreignKey':'DescriptionId'});db[_0x4292('0xc5')][_0x4292('0xfd')](db[_0x4292('0xc5')],{'as':_0x4292('0x1a7'),'foreignKey':'FieldId'});db['ServicenowField'][_0x4292('0x105')](db[_0x4292('0x94')],{'as':_0x4292('0x94'),'foreignKey':_0x4292('0x1a4')});db[_0x4292('0xc7')][_0x4292('0xfd')](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x19d')});db[_0x4292('0xc9')][_0x4292('0xfd')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x1a5')});db[_0x4292('0xc9')][_0x4292('0xfd')](db['Dynamics365Field'],{'as':_0x4292('0x19f'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x1a0')});db[_0x4292('0xc9')]['hasMany'](db[_0x4292('0x1b0')],{'as':_0x4292('0x19a'),'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x1a1')});db[_0x4292('0xc9')][_0x4292('0x105')](db[_0x4292('0xc7')],{'as':_0x4292('0x14c'),'foreignKey':_0x4292('0x19d')});db[_0x4292('0x1b0')][_0x4292('0xfd')](db[_0x4292('0x1b0')],{'as':_0x4292('0x1a2'),'foreignKey':'SubjectId'});db[_0x4292('0x1b0')]['hasMany'](db['Dynamics365Field'],{'as':_0x4292('0x1a3'),'foreignKey':_0x4292('0x1a0')});db[_0x4292('0x1b0')][_0x4292('0xfd')](db[_0x4292('0x1b0')],{'as':'Field','foreignKey':_0x4292('0x1a1')});db['Dynamics365Field'][_0x4292('0x105')](db[_0x4292('0x94')],{'as':'Variable','foreignKey':'VariableId'});db[_0x4292('0x1b1')][_0x4292('0x105')](db[_0x4292('0x68')],{});db['ChatQueueReport'][_0x4292('0x105')](db['CmList'],{'as':_0x4292('0x146'),'foreignKey':'ListId'});db['ChatQueueReport'][_0x4292('0x105')](db[_0x4292('0x109')],{'as':_0x4292('0x153'),'foreignKey':'ContactId'});db[_0x4292('0x1b1')]['belongsTo'](db[_0x4292('0x6b')],{});db[_0x4292('0x1b1')][_0x4292('0x105')](db[_0x4292('0x6d')],{});db['ChatQueueReport'][_0x4292('0x105')](db['User'],{});db['ChatQueueReport']['belongsTo'](db[_0x4292('0x113')],{});db[_0x4292('0xcf')][_0x4292('0x105')](db[_0x4292('0x13')],{'onDelete':'cascade','foreignKey':'FromId'});db[_0x4292('0xcf')][_0x4292('0x105')](db[_0x4292('0x13')],{'onDelete':_0x4292('0xfa'),'foreignKey':_0x4292('0x1b2')});db[_0x4292('0xd5')][_0x4292('0xfd')](db[_0x4292('0xd3')],{'foreignKey':'SessionId','onDelete':_0x4292('0xfa')});db[_0x4292('0xd5')][_0x4292('0xfd')](db[_0x4292('0xd1')],{'foreignKey':_0x4292('0x1b3'),'onDelete':_0x4292('0xfa')});db[_0x4292('0xd7')]['belongsTo'](db[_0x4292('0x56')],{});db[_0x4292('0xd7')][_0x4292('0x105')](db[_0x4292('0xf1')],{'as':'List','foreignKey':_0x4292('0x156')});db[_0x4292('0xd7')][_0x4292('0x105')](db[_0x4292('0x109')],{'as':_0x4292('0x153'),'foreignKey':_0x4292('0x13d')});db[_0x4292('0xd7')]['belongsTo'](db['SmsInteraction'],{});db[_0x4292('0xd7')]['belongsTo'](db[_0x4292('0x5b')],{});db['SmsQueueReport']['belongsTo'](db[_0x4292('0x13')],{});db[_0x4292('0xd7')]['belongsTo'](db[_0x4292('0x5d')],{});db['JscriptyProject'][_0x4292('0xfd')](db[_0x4292('0xd5')],{'foreignKey':_0x4292('0x1b4')});db[_0x4292('0x1b5')][_0x4292('0xfd')](db['JscriptyQuestionReport'],{'foreignKey':_0x4292('0x1b4')});db[_0x4292('0x1b5')]['hasMany'](db[_0x4292('0xd1')],{'foreignKey':_0x4292('0x1b4')});db['SquareProject']['belongsToMany'](db[_0x4292('0x13')],{'as':_0x4292('0x151'),'through':_0x4292('0x125')});db[_0x4292('0xe2')][_0x4292('0x106')](db[_0x4292('0x13')],{'as':_0x4292('0x137'),'through':_0x4292('0x10c')});db[_0x4292('0xe2')]['belongsToMany'](db['VoiceQueue'],{'through':_0x4292('0x138'),'as':_0x4292('0x1b6')});db['Team'][_0x4292('0x106')](db[_0x4292('0x3e')],{'through':_0x4292('0x149'),'as':_0x4292('0x112')});db['Team'][_0x4292('0x106')](db[_0x4292('0x113')],{'through':_0x4292('0x1b7'),'as':_0x4292('0x114')});db[_0x4292('0xe2')][_0x4292('0x106')](db[_0x4292('0x52')],{'through':_0x4292('0x1b8'),'as':'FaxQueues'});db[_0x4292('0xe2')][_0x4292('0x106')](db[_0x4292('0x5d')],{'through':'team_has_sms_queues','as':'SmsQueues'});db['Team'][_0x4292('0x106')](db[_0x4292('0x66')],{'through':_0x4292('0x16b'),'as':_0x4292('0x116')});db[_0x4292('0x17e')]['hasMany'](db['CmHopper'],{'as':_0x4292('0x179'),'foreignKey':_0x4292('0x17f')});db['Campaign'][_0x4292('0xfd')](db[_0x4292('0x78')],{'as':_0x4292('0xff'),'foreignKey':_0x4292('0x17f')});db[_0x4292('0x17e')]['hasMany'](db[_0x4292('0x79')],{'as':_0x4292('0x12d'),'foreignKey':'CampaignId'});db[_0x4292('0x17e')]['hasMany'](db[_0x4292('0x77')],{'as':'HopperBlacks','foreignKey':_0x4292('0x17f')});db[_0x4292('0x17e')][_0x4292('0x105')](db['Trunk'],{'as':_0x4292('0x29'),'foreignKey':_0x4292('0x130')});db[_0x4292('0x17e')]['belongsTo'](db[_0x4292('0x29')],{'as':_0x4292('0x131'),'foreignKey':'TrunkBackupId'});db[_0x4292('0x17e')][_0x4292('0x105')](db[_0x4292('0x87')],{'as':_0x4292('0x87'),'foreignKey':_0x4292('0x133')});db[_0x4292('0x17e')][_0x4292('0x105')](db[_0x4292('0xdd')],{'as':_0x4292('0xdd'),'foreignKey':_0x4292('0x1b9')});db[_0x4292('0x17e')][_0x4292('0x106')](db['CmList'],{'as':'Lists','through':_0x4292('0x1ba')});db[_0x4292('0x17e')][_0x4292('0x106')](db[_0x4292('0xf1')],{'as':_0x4292('0x1bb'),'through':_0x4292('0x1bc')});db[_0x4292('0xea')][_0x4292('0x105')](db[_0x4292('0x44')],{});db['MailTransferReport'][_0x4292('0x105')](db[_0x4292('0x42')],{});db[_0x4292('0xea')][_0x4292('0x105')](db[_0x4292('0x3c')],{'foreignKey':_0x4292('0x1bd'),'as':_0x4292('0x1be')});db[_0x4292('0xea')][_0x4292('0x105')](db[_0x4292('0x13')],{'foreignKey':_0x4292('0x1bf'),'as':_0x4292('0x1c0')});db[_0x4292('0xea')][_0x4292('0x105')](db[_0x4292('0x13')],{'foreignKey':_0x4292('0x1c1'),'as':_0x4292('0x1c2')});db[_0x4292('0xea')][_0x4292('0x105')](db[_0x4292('0x3e')],{'foreignKey':_0x4292('0x1c3'),'as':_0x4292('0x1c4')});db[_0x4292('0xea')][_0x4292('0x105')](db['MailAccount'],{'foreignKey':_0x4292('0x1c5'),'as':_0x4292('0x1c6')});db[_0x4292('0xeb')][_0x4292('0x105')](db[_0x4292('0x6d')],{});db[_0x4292('0xeb')][_0x4292('0x105')](db['ChatInteraction'],{});db[_0x4292('0xeb')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x4292('0x1c7'),'as':_0x4292('0x1be')});db[_0x4292('0xeb')][_0x4292('0x105')](db[_0x4292('0x13')],{'foreignKey':_0x4292('0x1bf'),'as':'FromAgent'});db[_0x4292('0xeb')][_0x4292('0x105')](db[_0x4292('0x13')],{'foreignKey':'ToUserId','as':_0x4292('0x1c2')});db['ChatTransferReport'][_0x4292('0x105')](db['ChatQueue'],{'foreignKey':_0x4292('0x1c8'),'as':_0x4292('0x1c4')});db[_0x4292('0xeb')][_0x4292('0x105')](db['ChatWebsite'],{'foreignKey':'ToChatWebsiteId','as':_0x4292('0x1c6')});db[_0x4292('0xed')][_0x4292('0x105')](db[_0x4292('0x15b')],{});db['FaxTransferReport'][_0x4292('0x105')](db[_0x4292('0x50')],{});db[_0x4292('0xed')]['belongsTo'](db[_0x4292('0x11d')],{'foreignKey':_0x4292('0x1c9'),'as':_0x4292('0x1be')});db[_0x4292('0xed')][_0x4292('0x105')](db['User'],{'foreignKey':_0x4292('0x1bf'),'as':_0x4292('0x1c0')});db[_0x4292('0xed')]['belongsTo'](db[_0x4292('0x13')],{'foreignKey':_0x4292('0x1c1'),'as':_0x4292('0x1c2')});db[_0x4292('0xed')][_0x4292('0x105')](db[_0x4292('0x52')],{'foreignKey':_0x4292('0x1ca'),'as':'ToQueue'});db[_0x4292('0xed')][_0x4292('0x105')](db[_0x4292('0x11d')],{'foreignKey':_0x4292('0x1cb'),'as':'ToAccount'});db[_0x4292('0x1cc')][_0x4292('0x105')](db[_0x4292('0x64')],{});db['OpenchannelTransferReport'][_0x4292('0x105')](db['OpenchannelInteraction'],{});db[_0x4292('0x1cc')][_0x4292('0x105')](db[_0x4292('0x121')],{'foreignKey':_0x4292('0x1cd'),'as':_0x4292('0x1be')});db['OpenchannelTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x4292('0x1bf'),'as':_0x4292('0x1c0')});db['OpenchannelTransferReport'][_0x4292('0x105')](db[_0x4292('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x4292('0x1cc')][_0x4292('0x105')](db[_0x4292('0x66')],{'foreignKey':_0x4292('0x1ce'),'as':'ToQueue'});db[_0x4292('0x1cc')][_0x4292('0x105')](db[_0x4292('0x121')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport'][_0x4292('0x105')](db[_0x4292('0x5b')],{});db[_0x4292('0xef')][_0x4292('0x105')](db[_0x4292('0x5a')],{});db['SmsTransferReport']['belongsTo'](db[_0x4292('0x56')],{'foreignKey':_0x4292('0x1cf'),'as':'FromAccount'});db[_0x4292('0xef')][_0x4292('0x105')](db[_0x4292('0x13')],{'foreignKey':_0x4292('0x1bf'),'as':_0x4292('0x1c0')});db[_0x4292('0xef')][_0x4292('0x105')](db[_0x4292('0x13')],{'foreignKey':'ToUserId','as':_0x4292('0x1c2')});db[_0x4292('0xef')]['belongsTo'](db[_0x4292('0x5d')],{'foreignKey':_0x4292('0x1d0'),'as':_0x4292('0x1c4')});db[_0x4292('0xef')][_0x4292('0x105')](db[_0x4292('0x56')],{'foreignKey':_0x4292('0x1d1'),'as':_0x4292('0x1c6')});db[_0x4292('0xf1')][_0x4292('0xfd')](db['Disposition'],{'as':_0x4292('0x158'),'foreignKey':_0x4292('0x156')});db[_0x4292('0xf1')][_0x4292('0xfd')](db[_0x4292('0x7d')],{'as':_0x4292('0x1d2'),'foreignKey':_0x4292('0x156')});db['CmList'][_0x4292('0xfd')](db[_0x4292('0x109')],{'as':_0x4292('0x178'),'onDelete':'cascade','foreignKey':_0x4292('0x156')});db[_0x4292('0xf1')][_0x4292('0xfd')](db['CmHopperFinal'],{'as':_0x4292('0xff'),'foreignKey':'ListId'});db[_0x4292('0xf1')]['hasMany'](db[_0x4292('0x79')],{'as':_0x4292('0x100'),'foreignKey':_0x4292('0x156')});db[_0x4292('0xf1')][_0x4292('0xfd')](db[_0x4292('0x7b')],{'as':_0x4292('0x7b'),'foreignKey':_0x4292('0x156')});db[_0x4292('0xf1')][_0x4292('0x106')](db[_0x4292('0x1c')],{'as':_0x4292('0x1d3'),'through':_0x4292('0x136')});db[_0x4292('0xf1')][_0x4292('0x106')](db['User'],{'as':'Agents','through':_0x4292('0x10b')});db[_0x4292('0x118')][_0x4292('0xfd')](db['VoiceExtension'],{'as':'Extensions','onDelete':'restrict'});db[_0x4292('0x118')][_0x4292('0x106')](db['User'],{'as':_0x4292('0x137'),'through':'user_has_voice_prefixes'});db[_0x4292('0xf4')][_0x4292('0xfd')](db[_0x4292('0x13')],{'as':_0x4292('0x151'),'foreignKey':'userProfileId'});db[_0x4292('0xf4')][_0x4292('0xfd')](db[_0x4292('0xf6')],{'as':'UserProfileSections','foreignKey':_0x4292('0x1d4'),'onDelete':_0x4292('0xfa')});db[_0x4292('0xf6')]['hasMany'](db['UserProfileResource'],{'as':'Resources','foreignKey':'sectionId','onDelete':_0x4292('0xfa')});module[_0x4292('0x1d5')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 4d31baa..417f8b1 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f59=['./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','./api/rpc','/api/version','./api/version','/api/system','/api/pm2','/apidoc','static','join','/www','/demo','root','/snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','path','express','express-winston','util','./errors','./config/environment','api','./config/logger','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','user','name','role','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)','format','url','responseTime','other','agent_name','test','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','./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/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/interactions','./api/faxInteraction','/api/fax/queues','./api/faxQueue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsInteraction','/api/sms/messages','/api/sms/queues','/api/openchannel/accounts','./api/openchannelApplication','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/conditions','./api/condition','/api/intervals','./api/pause','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/analytics/custom_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','/api/sms/reports/queue','/api/square/details/reports','/api/jscripty/projects','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','/api/voice/prefixes','/api/userProfiles'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8f59,0x11d));var _0x98f5=function(_0x213721,_0xc41653){_0x213721=_0x213721-0x0;var _0x6435ee=_0x8f59[_0x213721];return _0x6435ee;};'use strict';var path=require(_0x98f5('0x0'));var express=require(_0x98f5('0x1'));var ewinston=require(_0x98f5('0x2'));var util=require(_0x98f5('0x3'));var errors=require(_0x98f5('0x4'));var config=require(_0x98f5('0x5'));var logger=require('./config/logger')(_0x98f5('0x6'));var authLogger=require(_0x98f5('0x7'))(_0x98f5('0x8'));exports[_0x98f5('0x9')]=function(_0x54c7c2){_0x54c7c2[_0x98f5('0xa')](ewinston[_0x98f5('0xb')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2e2acf,_0x5869ee){return util['format'](_0x98f5('0xc'),_0x2e2acf[_0x98f5('0xd')],_0x2e2acf[_0x98f5('0xe')]['x-forwarded-for']?_0x2e2acf[_0x98f5('0xe')][_0x98f5('0xf')]:_0x2e2acf[_0x98f5('0x10')][_0x98f5('0x11')]||_0x2e2acf['ip'],_0x2e2acf['url'],_0x5869ee[_0x98f5('0x12')],_0x5869ee['responseTime'],_0x2e2acf['user']?_0x2e2acf[_0x98f5('0x13')]['id']:null,_0x2e2acf[_0x98f5('0x13')]?_0x2e2acf['user'][_0x98f5('0x14')]:null,_0x2e2acf[_0x98f5('0x13')]?_0x2e2acf[_0x98f5('0x13')][_0x98f5('0x15')]:null);}}));_0x54c7c2[_0x98f5('0xa')](ewinston[_0x98f5('0xb')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x5dcb5e,_0x24a7a9){var _0xbade31='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x5dcb5e[_0x98f5('0x16')]&&_0x5dcb5e[_0x98f5('0x16')][_0x98f5('0x17')]&&_0x5dcb5e['body'][_0x98f5('0x18')]){_0xbade31=_0x98f5('0x19');}return util[_0x98f5('0x1a')](_0xbade31,_0x5dcb5e['method'],_0x5dcb5e[_0x98f5('0xe')][_0x98f5('0xf')]?_0x5dcb5e['headers'][_0x98f5('0xf')]:_0x5dcb5e['connection'][_0x98f5('0x11')]||_0x5dcb5e['ip'],_0x5dcb5e[_0x98f5('0x1b')],_0x24a7a9[_0x98f5('0x12')],_0x24a7a9[_0x98f5('0x1c')],_0x5dcb5e[_0x98f5('0x13')]?_0x5dcb5e[_0x98f5('0x13')]['id']:null,_0x5dcb5e['user']?_0x5dcb5e[_0x98f5('0x13')]['name']:null,_0x5dcb5e[_0x98f5('0x13')]?_0x5dcb5e[_0x98f5('0x13')]['role']:null,_0x5dcb5e[_0x98f5('0x16')]&&_0x5dcb5e[_0x98f5('0x16')][_0x98f5('0x17')]?_0x5dcb5e[_0x98f5('0x16')][_0x98f5('0x17')]:_0x98f5('0x1d'),_0x5dcb5e[_0x98f5('0x16')]&&_0x5dcb5e['body'][_0x98f5('0x18')]?_0x5dcb5e['body'][_0x98f5('0x18')]:'',_0x5dcb5e['body']&&_0x5dcb5e[_0x98f5('0x16')][_0x98f5('0x1e')]?_0x5dcb5e[_0x98f5('0x16')][_0x98f5('0x1e')]:'');},'ignoreRoute':function(_0x3cc7de){var _0x18052d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x18052d[_0x98f5('0x1f')](_0x3cc7de['url']);}}));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x20'),require('./api/user'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x21'),require(_0x98f5('0x22')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x23'),require(_0x98f5('0x24')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x25'),require('./api/voiceExtension'));_0x54c7c2['use'](_0x98f5('0x26'),require(_0x98f5('0x27')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x28'),require(_0x98f5('0x29')));_0x54c7c2[_0x98f5('0xa')]('/api/voice/recordings',require(_0x98f5('0x2a')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x2b'),require(_0x98f5('0x2c')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x2d'),require('./api/voiceMail'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x2e'),require(_0x98f5('0x2f')));_0x54c7c2[_0x98f5('0xa')]('/api/voice/calls/reports',require(_0x98f5('0x30')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x31'),require(_0x98f5('0x32')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x33'),require(_0x98f5('0x34')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x35'),require(_0x98f5('0x36')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x37'),require(_0x98f5('0x38')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x39'),require(_0x98f5('0x3a')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x3b'),require(_0x98f5('0x3c')));_0x54c7c2[_0x98f5('0xa')]('/api/mail/out_servers',require(_0x98f5('0x3d')));_0x54c7c2['use']('/api/mail/accounts',require(_0x98f5('0x3e')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x3f'),require(_0x98f5('0x40')));_0x54c7c2['use'](_0x98f5('0x41'),require(_0x98f5('0x42')));_0x54c7c2[_0x98f5('0xa')]('/api/mail/interactions',require(_0x98f5('0x43')));_0x54c7c2[_0x98f5('0xa')]('/api/mail/messages',require(_0x98f5('0x44')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x45'),require('./api/mailApplication'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x46'),require(_0x98f5('0x47')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x48'),require('./api/dashboard'));_0x54c7c2['use'](_0x98f5('0x49'),require(_0x98f5('0x4a')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x4b'),require(_0x98f5('0x4c')));_0x54c7c2[_0x98f5('0xa')]('/api/fax/applications',require('./api/faxApplication'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x4d'),require(_0x98f5('0x4e')));_0x54c7c2[_0x98f5('0xa')]('/api/fax/messages',require('./api/faxMessage'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x4f'),require(_0x98f5('0x50')));_0x54c7c2[_0x98f5('0xa')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x51'),require(_0x98f5('0x52')));_0x54c7c2['use'](_0x98f5('0x53'),require('./api/smsApplication'));_0x54c7c2[_0x98f5('0xa')]('/api/sms/interactions',require(_0x98f5('0x54')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x55'),require('./api/smsMessage'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x56'),require('./api/smsQueue'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x57'),require('./api/openchannelAccount'));_0x54c7c2[_0x98f5('0xa')]('/api/openchannel/applications',require(_0x98f5('0x58')));_0x54c7c2[_0x98f5('0xa')]('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x54c7c2['use']('/api/openchannel/messages',require(_0x98f5('0x59')));_0x54c7c2['use'](_0x98f5('0x5a'),require(_0x98f5('0x5b')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x5c'),require(_0x98f5('0x5d')));_0x54c7c2[_0x98f5('0xa')]('/api/openchannel/reports/queue',require(_0x98f5('0x5e')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x5f'),require(_0x98f5('0x60')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x61'),require('./api/chatInteraction'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x62'),require(_0x98f5('0x63')));_0x54c7c2[_0x98f5('0xa')]('/api/chat/offline_messages',require(_0x98f5('0x64')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x65'),require(_0x98f5('0x66')));_0x54c7c2[_0x98f5('0xa')]('/api/chat/groups',require(_0x98f5('0x67')));_0x54c7c2[_0x98f5('0xa')]('/api/chat/proactive_actions',require(_0x98f5('0x68')));_0x54c7c2['use'](_0x98f5('0x69'),require('./api/cmCompany'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x6a'),require(_0x98f5('0x6b')));_0x54c7c2['use'](_0x98f5('0x6c'),require(_0x98f5('0x6d')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x6e'),require(_0x98f5('0x6f')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x70'),require(_0x98f5('0x71')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x72'),require(_0x98f5('0x73')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x74'),require(_0x98f5('0x75')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x76'),require(_0x98f5('0x77')));_0x54c7c2['use'](_0x98f5('0x78'),require(_0x98f5('0x79')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x7a'),require(_0x98f5('0x7b')));_0x54c7c2[_0x98f5('0xa')]('/api/dispositions',require('./api/disposition'));_0x54c7c2['use'](_0x98f5('0x7c'),require(_0x98f5('0x7d')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x7e'),require('./api/interval'));_0x54c7c2[_0x98f5('0xa')]('/api/pauses',require(_0x98f5('0x7f')));_0x54c7c2['use']('/api/cdr',require(_0x98f5('0x80')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x81'),require('./api/voiceQueuesLog'));_0x54c7c2['use'](_0x98f5('0x82'),require(_0x98f5('0x83')));_0x54c7c2['use'](_0x98f5('0x84'),require(_0x98f5('0x85')));_0x54c7c2['use'](_0x98f5('0x86'),require(_0x98f5('0x87')));_0x54c7c2[_0x98f5('0xa')]('/api/templates',require(_0x98f5('0x88')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x89'),require(_0x98f5('0x8a')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x8b'),require(_0x98f5('0x8c')));_0x54c7c2['use'](_0x98f5('0x8d'),require(_0x98f5('0x8e')));_0x54c7c2[_0x98f5('0xa')]('/api/integrations/reports',require('./api/integrationReport'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x8f'),require('./api/analyticCustomReport'));_0x54c7c2['use']('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x54c7c2[_0x98f5('0xa')]('/api/analytics/extracted_reports',require(_0x98f5('0x90')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x91'),require(_0x98f5('0x92')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x93'),require(_0x98f5('0x94')));_0x54c7c2[_0x98f5('0xa')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x54c7c2[_0x98f5('0xa')]('/api/integrations/salesforce/accounts',require(_0x98f5('0x95')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x96'),require('./api/intSalesforceConfiguration'));_0x54c7c2[_0x98f5('0xa')]('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x54c7c2['use'](_0x98f5('0x97'),require('./api/intSugarcrmAccount'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x98'),require(_0x98f5('0x99')));_0x54c7c2['use']('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x9a'),require('./api/intDeskAccount'));_0x54c7c2['use'](_0x98f5('0x9b'),require(_0x98f5('0x9c')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x9d'),require(_0x98f5('0x9e')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0x9f'),require(_0x98f5('0xa0')));_0x54c7c2[_0x98f5('0xa')]('/api/integrations/zoho/configurations',require(_0x98f5('0xa1')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xa2'),require(_0x98f5('0xa3')));_0x54c7c2['use'](_0x98f5('0xa4'),require(_0x98f5('0xa5')));_0x54c7c2[_0x98f5('0xa')]('/api/integrations/zendesk/configurations',require(_0x98f5('0xa6')));_0x54c7c2[_0x98f5('0xa')]('/api/integrations/zendesk/fields',require(_0x98f5('0xa7')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xa8'),require('./api/intFreshdeskAccount'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xa9'),require(_0x98f5('0xaa')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xab'),require(_0x98f5('0xac')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xad'),require(_0x98f5('0xae')));_0x54c7c2['use'](_0x98f5('0xaf'),require('./api/intVtigerConfiguration'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xb0'),require(_0x98f5('0xb1')));_0x54c7c2[_0x98f5('0xa')]('/api/integrations/servicenow/accounts',require(_0x98f5('0xb2')));_0x54c7c2[_0x98f5('0xa')]('/api/integrations/servicenow/configurations',require(_0x98f5('0xb3')));_0x54c7c2['use'](_0x98f5('0xb4'),require(_0x98f5('0xb5')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xb6'),require('./api/intDynamics365Account'));_0x54c7c2['use'](_0x98f5('0xb7'),require(_0x98f5('0xb8')));_0x54c7c2['use'](_0x98f5('0xb9'),require(_0x98f5('0xba')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xbb'),require(_0x98f5('0xbc')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xbd'),require(_0x98f5('0xbe')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xbf'),require(_0x98f5('0xc0')));_0x54c7c2['use']('/api/jscripty/answers/reports',require(_0x98f5('0xc1')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xc2'),require('./api/jscriptyQuestionReport'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xc3'),require('./api/jscriptySessionReport'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xc4'),require('./api/smsQueueReport'));_0x54c7c2['use']('/api/square/reports',require('./api/squareReport'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xc5'),require('./api/squareReportDetail'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xc6'),require('./api/jscriptyProject'));_0x54c7c2[_0x98f5('0xa')]('/api/settings',require('./api/setting'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xc7'),require(_0x98f5('0xc8')));_0x54c7c2[_0x98f5('0xa')]('/api/square/projects',require(_0x98f5('0xc9')));_0x54c7c2['use']('/api/square/recordings',require('./api/squareRecording'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xca'),require(_0x98f5('0xcb')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xcc'),require(_0x98f5('0xcd')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xce'),require(_0x98f5('0xcf')));_0x54c7c2[_0x98f5('0xa')]('/api/campaigns',require(_0x98f5('0xd0')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xd1'),require(_0x98f5('0xd2')));_0x54c7c2['use'](_0x98f5('0xd3'),require(_0x98f5('0xd4')));_0x54c7c2['use'](_0x98f5('0xd5'),require(_0x98f5('0xd6')));_0x54c7c2[_0x98f5('0xa')]('/api/mail/reports/transfer',require(_0x98f5('0xd7')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xd8'),require(_0x98f5('0xd9')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xda'),require('./api/faxTransferReport'));_0x54c7c2['use'](_0x98f5('0xdb'),require(_0x98f5('0xdc')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xdd'),require('./api/smsTransferReport'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xde'),require('./api/cmList'));_0x54c7c2['use'](_0x98f5('0xdf'),require('./api/voicePrefix'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xe0'),require(_0x98f5('0xe1')));_0x54c7c2['use'](_0x98f5('0xe2'),require(_0x98f5('0xe3')));_0x54c7c2['use'](_0x98f5('0xe4'),require(_0x98f5('0xe5')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xe6'),require('./api/authLocal'));_0x54c7c2['use'](_0x98f5('0xe7'),require(_0x98f5('0xe8')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xe9'),require(_0x98f5('0xea')));_0x54c7c2[_0x98f5('0xa')]('/api/rpc',require(_0x98f5('0xeb')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xec'),require(_0x98f5('0xed')));_0x54c7c2['use'](_0x98f5('0xee'),require('./api/system'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xef'),require('./api/pm2'));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xf0'),express[_0x98f5('0xf1')](path[_0x98f5('0xf2')](config['root'],_0x98f5('0xf0'))));_0x54c7c2['use'](_0x98f5('0xf3'),express['static'](path[_0x98f5('0xf2')](config['root'],_0x98f5('0xf3'))));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xf4'),express[_0x98f5('0xf1')](path[_0x98f5('0xf2')](config[_0x98f5('0xf5')],_0x98f5('0xf4'))));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xf6'),express[_0x98f5('0xf1')](path[_0x98f5('0xf2')](config[_0x98f5('0xf5')],'snippet','1.0.14')));_0x54c7c2[_0x98f5('0xa')](_0x98f5('0xf7'),express['static'](path[_0x98f5('0xf2')](config[_0x98f5('0xf5')],_0x98f5('0xf8'))));_0x54c7c2[_0x98f5('0xf9')](_0x98f5('0xfa'))[_0x98f5('0xfb')](errors[0x194]);_0x54c7c2['route']('/*')[_0x98f5('0xfb')](function(_0x3126b9,_0x21f32e){_0x21f32e[_0x98f5('0xfc')](path[_0x98f5('0xfd')](_0x54c7c2[_0x98f5('0xfb')]('appPath')+_0x98f5('0xfe')));});}; \ No newline at end of file +var _0x9e33=['device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','role','other','agent_id','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/fax/accounts','./api/faxAccount','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','/api/openchannel/reports/queue','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./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/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/networks','./api/network','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/license','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/auth/google','/api/rpc','/api/version','./api/version','/api/system','join','root','/www','static','/demo','/snippet','snippet','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','path','express','express-winston','util','./errors','./config/logger','auth','default','use','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','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body'];(function(_0x5b2c30,_0x503d1f){var _0x3bb2c3=function(_0x560b6b){while(--_0x560b6b){_0x5b2c30['push'](_0x5b2c30['shift']());}};_0x3bb2c3(++_0x503d1f);}(_0x9e33,0xf6));var _0x39e3=function(_0x35181c,_0x82694a){_0x35181c=_0x35181c-0x0;var _0xe14bf9=_0x9e33[_0x35181c];return _0xe14bf9;};'use strict';var path=require(_0x39e3('0x0'));var express=require(_0x39e3('0x1'));var ewinston=require(_0x39e3('0x2'));var util=require(_0x39e3('0x3'));var errors=require(_0x39e3('0x4'));var config=require('./config/environment');var logger=require(_0x39e3('0x5'))('api');var authLogger=require('./config/logger')(_0x39e3('0x6'));exports[_0x39e3('0x7')]=function(_0x32432d){_0x32432d[_0x39e3('0x8')](ewinston[_0x39e3('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x1a7553,_0x14a330){return util[_0x39e3('0xa')](_0x39e3('0xb'),_0x1a7553['method'],_0x1a7553[_0x39e3('0xc')][_0x39e3('0xd')]?_0x1a7553[_0x39e3('0xc')]['x-forwarded-for']:_0x1a7553[_0x39e3('0xe')][_0x39e3('0xf')]||_0x1a7553['ip'],_0x1a7553[_0x39e3('0x10')],_0x14a330[_0x39e3('0x11')],_0x14a330['responseTime'],_0x1a7553['user']?_0x1a7553[_0x39e3('0x12')]['id']:null,_0x1a7553[_0x39e3('0x12')]?_0x1a7553['user']['name']:null,_0x1a7553[_0x39e3('0x12')]?_0x1a7553[_0x39e3('0x12')]['role']:null);}}));_0x32432d[_0x39e3('0x8')](ewinston[_0x39e3('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0xce5803,_0x40fab4){var _0x1d7b15=_0x39e3('0x13');if(_0xce5803[_0x39e3('0x14')]&&_0xce5803[_0x39e3('0x14')][_0x39e3('0x15')]&&_0xce5803[_0x39e3('0x14')]['agent_id']){_0x1d7b15=_0x39e3('0x16');}return util[_0x39e3('0xa')](_0x1d7b15,_0xce5803[_0x39e3('0x17')],_0xce5803[_0x39e3('0xc')]['x-forwarded-for']?_0xce5803[_0x39e3('0xc')]['x-forwarded-for']:_0xce5803[_0x39e3('0xe')][_0x39e3('0xf')]||_0xce5803['ip'],_0xce5803[_0x39e3('0x10')],_0x40fab4[_0x39e3('0x11')],_0x40fab4['responseTime'],_0xce5803[_0x39e3('0x12')]?_0xce5803['user']['id']:null,_0xce5803[_0x39e3('0x12')]?_0xce5803[_0x39e3('0x12')]['name']:null,_0xce5803['user']?_0xce5803[_0x39e3('0x12')][_0x39e3('0x18')]:null,_0xce5803[_0x39e3('0x14')]&&_0xce5803['body'][_0x39e3('0x15')]?_0xce5803[_0x39e3('0x14')][_0x39e3('0x15')]:_0x39e3('0x19'),_0xce5803[_0x39e3('0x14')]&&_0xce5803[_0x39e3('0x14')][_0x39e3('0x1a')]?_0xce5803[_0x39e3('0x14')][_0x39e3('0x1a')]:'',_0xce5803['body']&&_0xce5803[_0x39e3('0x14')][_0x39e3('0x1b')]?_0xce5803[_0x39e3('0x14')][_0x39e3('0x1b')]:'');},'ignoreRoute':function(_0x5b450c){var _0x571679=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x571679[_0x39e3('0x1c')](_0x5b450c['url']);}}));_0x32432d[_0x39e3('0x8')](_0x39e3('0x1d'),require(_0x39e3('0x1e')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x1f'),require(_0x39e3('0x20')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x21'),require(_0x39e3('0x22')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x23'),require(_0x39e3('0x24')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x25'),require('./api/voiceMusicOnHold'));_0x32432d[_0x39e3('0x8')](_0x39e3('0x26'),require(_0x39e3('0x27')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x28'),require(_0x39e3('0x29')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x2a'),require(_0x39e3('0x2b')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x2c'),require(_0x39e3('0x2d')));_0x32432d['use'](_0x39e3('0x2e'),require(_0x39e3('0x2f')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x30'),require(_0x39e3('0x31')));_0x32432d['use']('/api/voice/dials/reports',require(_0x39e3('0x32')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x33'),require(_0x39e3('0x34')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x35'),require(_0x39e3('0x36')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x37'),require(_0x39e3('0x38')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x39'),require(_0x39e3('0x3a')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x3b'),require('./api/voiceTransferReport'));_0x32432d[_0x39e3('0x8')]('/api/mail/out_servers',require(_0x39e3('0x3c')));_0x32432d['use'](_0x39e3('0x3d'),require(_0x39e3('0x3e')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x3f'),require(_0x39e3('0x40')));_0x32432d['use'](_0x39e3('0x41'),require(_0x39e3('0x42')));_0x32432d['use']('/api/mail/interactions',require('./api/mailInteraction'));_0x32432d['use'](_0x39e3('0x43'),require(_0x39e3('0x44')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x45'),require(_0x39e3('0x46')));_0x32432d['use'](_0x39e3('0x47'),require(_0x39e3('0x48')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x49'),require(_0x39e3('0x4a')));_0x32432d[_0x39e3('0x8')]('/api/dashboards/items',require('./api/dashboardItem'));_0x32432d[_0x39e3('0x8')](_0x39e3('0x4b'),require(_0x39e3('0x4c')));_0x32432d['use']('/api/fax/applications',require('./api/faxApplication'));_0x32432d[_0x39e3('0x8')](_0x39e3('0x4d'),require(_0x39e3('0x4e')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x4f'),require(_0x39e3('0x50')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x51'),require(_0x39e3('0x52')));_0x32432d['use'](_0x39e3('0x53'),require('./api/faxQueueReport'));_0x32432d[_0x39e3('0x8')](_0x39e3('0x54'),require(_0x39e3('0x55')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x56'),require(_0x39e3('0x57')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x58'),require(_0x39e3('0x59')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x5a'),require('./api/smsMessage'));_0x32432d[_0x39e3('0x8')](_0x39e3('0x5b'),require(_0x39e3('0x5c')));_0x32432d['use']('/api/openchannel/accounts',require(_0x39e3('0x5d')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x5e'),require(_0x39e3('0x5f')));_0x32432d['use']('/api/openchannel/interactions',require(_0x39e3('0x60')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x61'),require(_0x39e3('0x62')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x63'),require('./api/openchannelQueue'));_0x32432d[_0x39e3('0x8')](_0x39e3('0x64'),require('./api/chatWebsite'));_0x32432d[_0x39e3('0x8')](_0x39e3('0x65'),require('./api/openchannelQueueReport'));_0x32432d['use'](_0x39e3('0x66'),require('./api/chatApplication'));_0x32432d['use'](_0x39e3('0x67'),require(_0x39e3('0x68')));_0x32432d['use'](_0x39e3('0x69'),require('./api/chatMessage'));_0x32432d[_0x39e3('0x8')](_0x39e3('0x6a'),require(_0x39e3('0x6b')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x6c'),require(_0x39e3('0x6d')));_0x32432d['use'](_0x39e3('0x6e'),require(_0x39e3('0x6f')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x70'),require(_0x39e3('0x71')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x72'),require('./api/cmCompany'));_0x32432d['use'](_0x39e3('0x73'),require(_0x39e3('0x74')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x75'),require(_0x39e3('0x76')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x77'),require('./api/cmHopperBlack'));_0x32432d[_0x39e3('0x8')](_0x39e3('0x78'),require(_0x39e3('0x79')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x7a'),require(_0x39e3('0x7b')));_0x32432d[_0x39e3('0x8')]('/api/cm/custom_fields',require(_0x39e3('0x7c')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x7d'),require(_0x39e3('0x7e')));_0x32432d['use']('/api/automations',require(_0x39e3('0x7f')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x80'),require(_0x39e3('0x81')));_0x32432d['use'](_0x39e3('0x82'),require(_0x39e3('0x83')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x84'),require(_0x39e3('0x85')));_0x32432d['use'](_0x39e3('0x86'),require(_0x39e3('0x87')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x88'),require(_0x39e3('0x89')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x8a'),require(_0x39e3('0x8b')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x8c'),require(_0x39e3('0x8d')));_0x32432d['use'](_0x39e3('0x8e'),require(_0x39e3('0x8f')));_0x32432d[_0x39e3('0x8')]('/api/sounds',require(_0x39e3('0x90')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x91'),require('./api/tag'));_0x32432d[_0x39e3('0x8')](_0x39e3('0x92'),require(_0x39e3('0x93')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x94'),require(_0x39e3('0x95')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x96'),require(_0x39e3('0x97')));_0x32432d[_0x39e3('0x8')]('/api/integrations',require(_0x39e3('0x98')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x99'),require('./api/integrationReport'));_0x32432d['use']('/api/analytics/custom_reports',require(_0x39e3('0x9a')));_0x32432d[_0x39e3('0x8')]('/api/analytics/default_reports',require(_0x39e3('0x9b')));_0x32432d['use'](_0x39e3('0x9c'),require(_0x39e3('0x9d')));_0x32432d['use'](_0x39e3('0x9e'),require(_0x39e3('0x9f')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xa0'),require(_0x39e3('0xa1')));_0x32432d['use'](_0x39e3('0xa2'),require('./api/analyticTreeReport'));_0x32432d[_0x39e3('0x8')](_0x39e3('0xa3'),require(_0x39e3('0xa4')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xa5'),require(_0x39e3('0xa6')));_0x32432d['use'](_0x39e3('0xa7'),require(_0x39e3('0xa8')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xa9'),require(_0x39e3('0xaa')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xab'),require('./api/intSugarcrmConfiguration'));_0x32432d[_0x39e3('0x8')]('/api/integrations/sugarcrm/fields',require(_0x39e3('0xac')));_0x32432d[_0x39e3('0x8')]('/api/integrations/desk/accounts',require(_0x39e3('0xad')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xae'),require('./api/intDeskConfiguration'));_0x32432d[_0x39e3('0x8')]('/api/integrations/desk/fields',require(_0x39e3('0xaf')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xb0'),require(_0x39e3('0xb1')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xb2'),require(_0x39e3('0xb3')));_0x32432d['use'](_0x39e3('0xb4'),require(_0x39e3('0xb5')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xb6'),require(_0x39e3('0xb7')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xb8'),require(_0x39e3('0xb9')));_0x32432d['use'](_0x39e3('0xba'),require(_0x39e3('0xbb')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xbc'),require(_0x39e3('0xbd')));_0x32432d[_0x39e3('0x8')]('/api/integrations/freshdesk/configurations',require(_0x39e3('0xbe')));_0x32432d['use'](_0x39e3('0xbf'),require(_0x39e3('0xc0')));_0x32432d['use'](_0x39e3('0xc1'),require(_0x39e3('0xc2')));_0x32432d['use']('/api/integrations/vtiger/configurations',require(_0x39e3('0xc3')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xc4'),require(_0x39e3('0xc5')));_0x32432d['use']('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x32432d[_0x39e3('0x8')](_0x39e3('0xc6'),require('./api/intServicenowConfiguration'));_0x32432d[_0x39e3('0x8')](_0x39e3('0xc7'),require('./api/intServicenowField'));_0x32432d['use'](_0x39e3('0xc8'),require(_0x39e3('0xc9')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xca'),require(_0x39e3('0xcb')));_0x32432d[_0x39e3('0x8')]('/api/integrations/dynamics365/fields',require(_0x39e3('0xcc')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xcd'),require(_0x39e3('0xce')));_0x32432d[_0x39e3('0x8')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x32432d[_0x39e3('0x8')]('/api/chat/internal/messages',require(_0x39e3('0xcf')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xd0'),require('./api/jscriptyAnswerReport'));_0x32432d[_0x39e3('0x8')]('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x32432d[_0x39e3('0x8')](_0x39e3('0xd1'),require('./api/jscriptySessionReport'));_0x32432d[_0x39e3('0x8')](_0x39e3('0xd2'),require(_0x39e3('0xd3')));_0x32432d[_0x39e3('0x8')]('/api/square/reports',require(_0x39e3('0xd4')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xd5'),require(_0x39e3('0xd6')));_0x32432d[_0x39e3('0x8')]('/api/jscripty/projects',require(_0x39e3('0xd7')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xd8'),require(_0x39e3('0xd9')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xda'),require('./api/squareOdbc'));_0x32432d[_0x39e3('0x8')](_0x39e3('0xdb'),require(_0x39e3('0xdc')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xdd'),require(_0x39e3('0xde')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xdf'),require('./api/squareMessage'));_0x32432d['use'](_0x39e3('0xe0'),require('./api/team'));_0x32432d[_0x39e3('0x8')]('/api/license',require(_0x39e3('0xe1')));_0x32432d[_0x39e3('0x8')]('/api/campaigns',require(_0x39e3('0xe2')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xe3'),require('./api/migration'));_0x32432d['use'](_0x39e3('0xe4'),require(_0x39e3('0xe5')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xe6'),require(_0x39e3('0xe7')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xe8'),require(_0x39e3('0xe9')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xea'),require(_0x39e3('0xeb')));_0x32432d['use'](_0x39e3('0xec'),require(_0x39e3('0xed')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xee'),require(_0x39e3('0xef')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xf0'),require(_0x39e3('0xf1')));_0x32432d['use']('/api/cm/lists',require('./api/cmList'));_0x32432d[_0x39e3('0x8')](_0x39e3('0xf2'),require(_0x39e3('0xf3')));_0x32432d[_0x39e3('0x8')]('/api/userProfiles',require(_0x39e3('0xf4')));_0x32432d['use'](_0x39e3('0xf5'),require(_0x39e3('0xf6')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xf7'),require(_0x39e3('0xf8')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xf9'),require(_0x39e3('0xfa')));_0x32432d[_0x39e3('0x8')](_0x39e3('0xfb'),require('./api/authGoogle'));_0x32432d[_0x39e3('0x8')]('/api/jira',require('./api/jira'));_0x32432d[_0x39e3('0x8')](_0x39e3('0xfc'),require('./api/rpc'));_0x32432d[_0x39e3('0x8')](_0x39e3('0xfd'),require(_0x39e3('0xfe')));_0x32432d['use'](_0x39e3('0xff'),require('./api/system'));_0x32432d[_0x39e3('0x8')]('/api/pm2',require('./api/pm2'));_0x32432d[_0x39e3('0x8')]('/apidoc',express['static'](path[_0x39e3('0x100')](config[_0x39e3('0x101')],'/apidoc')));_0x32432d[_0x39e3('0x8')](_0x39e3('0x102'),express[_0x39e3('0x103')](path[_0x39e3('0x100')](config[_0x39e3('0x101')],_0x39e3('0x102'))));_0x32432d[_0x39e3('0x8')](_0x39e3('0x104'),express[_0x39e3('0x103')](path[_0x39e3('0x100')](config[_0x39e3('0x101')],_0x39e3('0x104'))));_0x32432d[_0x39e3('0x8')](_0x39e3('0x105'),express['static'](path['join'](config['root'],_0x39e3('0x106'),'1.0.15')));_0x32432d['use'](_0x39e3('0x107'),express[_0x39e3('0x103')](path[_0x39e3('0x100')](config[_0x39e3('0x101')],'/server/files/plugins')));_0x32432d[_0x39e3('0x108')](_0x39e3('0x109'))[_0x39e3('0x10a')](errors[0x194]);_0x32432d['route']('/*')[_0x39e3('0x10a')](function(_0x437ef7,_0x137728){_0x137728['sendFile'](path['resolve'](_0x32432d[_0x39e3('0x10a')]('appPath')+'/index.html'));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 29b2c71..8cb1650 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf646=['../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.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/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.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/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','http','rpc','port','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc'];(function(_0x2c80fa,_0x3d84be){var _0x203450=function(_0x398fa3){while(--_0x398fa3){_0x2c80fa['push'](_0x2c80fa['shift']());}};_0x203450(++_0x3d84be);}(_0xf646,0x191));var _0x6f64=function(_0x5ac82f,_0x26a5bf){_0x5ac82f=_0x5ac82f-0x0;var _0x5df0d7=_0xf646[_0x5ac82f];return _0x5df0d7;};'use strict';var jayson=require(_0x6f64('0x0'));var BPromise=require(_0x6f64('0x1'));var _=require(_0x6f64('0x2'));var config=require(_0x6f64('0x3'));exports['listen']=function(){return new BPromise(function(_0x1b7b40,_0x2cfae4){var _0x2f9f81={};_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x5')));_0x2f9f81=_['merge'](_0x2f9f81,require(_0x6f64('0x6')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x7')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x8')));_0x2f9f81=_['merge'](_0x2f9f81,require(_0x6f64('0x9')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0xa')));_0x2f9f81=_['merge'](_0x2f9f81,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0xb')));_0x2f9f81=_['merge'](_0x2f9f81,require(_0x6f64('0xc')));_0x2f9f81=_['merge'](_0x2f9f81,require(_0x6f64('0xd')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0xe')));_0x2f9f81=_['merge'](_0x2f9f81,require(_0x6f64('0xf')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x10')));_0x2f9f81=_['merge'](_0x2f9f81,require(_0x6f64('0x11')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x12')));_0x2f9f81=_['merge'](_0x2f9f81,require('../api/mailApplication/mailApplication.rpc'));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x13')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x14')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x15')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x16')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x17')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x18')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x19')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x1a')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require('../api/smsInteraction/smsInteraction.rpc'));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require('../api/smsMessage/smsMessage.rpc'));_0x2f9f81=_['merge'](_0x2f9f81,require(_0x6f64('0x1b')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x1c')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x1d')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x1e')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x2f9f81=_['merge'](_0x2f9f81,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require('../api/chatInteraction/chatInteraction.rpc'));_0x2f9f81=_['merge'](_0x2f9f81,require(_0x6f64('0x1f')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x20')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x21')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x22')));_0x2f9f81=_['merge'](_0x2f9f81,require(_0x6f64('0x23')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x24')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x25')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x2f9f81=_['merge'](_0x2f9f81,require(_0x6f64('0x26')));_0x2f9f81=_['merge'](_0x2f9f81,require(_0x6f64('0x27')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x28')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x29')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x2a')));_0x2f9f81=_['merge'](_0x2f9f81,require(_0x6f64('0x2b')));_0x2f9f81=_['merge'](_0x2f9f81,require(_0x6f64('0x2c')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x2d')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x2e')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x2f')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x30')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x31')));_0x2f9f81=_['merge'](_0x2f9f81,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x32')));_0x2f9f81=_['merge'](_0x2f9f81,require(_0x6f64('0x33')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x34')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x35')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x36')));_0x2f9f81=_['merge'](_0x2f9f81,require(_0x6f64('0x37')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x38')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x39')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require('../api/campaign/campaign.rpc'));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x3a')));_0x2f9f81=_[_0x6f64('0x4')](_0x2f9f81,require(_0x6f64('0x3b')));var _0x51820c=jayson['server'](_0x2f9f81)[_0x6f64('0x3c')]();var _0x108a6b=config[_0x6f64('0x3d')][_0x6f64('0x3e')]||config[_0x6f64('0x3e')]+0x1;var _0x17b9c5=config['rpc']['ip']||_0x6f64('0x3f');_0x51820c['on'](_0x6f64('0x40'),function(_0x2d8922){return _0x2cfae4(_0x2d8922);});_0x51820c[_0x6f64('0x41')](_0x108a6b,_0x17b9c5,function(){console[_0x6f64('0x42')](_0x6f64('0x43'),_0x17b9c5,_0x108a6b);require(_0x6f64('0x44'))['default']();return _0x1b7b40(_0x6f64('0x45')+_0x17b9c5+':'+_0x108a6b);});});}; \ No newline at end of file +var _0x9600=['../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','server','http','port','rpc','localhost','error','log','../config/triggers','default','RPC\x20listening\x20on\x20','bluebird','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc'];(function(_0x50435b,_0x563549){var _0x31c6d8=function(_0x53ba8c){while(--_0x53ba8c){_0x50435b['push'](_0x50435b['shift']());}};_0x31c6d8(++_0x563549);}(_0x9600,0x18d));var _0x0960=function(_0x35cf53,_0x9c4940){_0x35cf53=_0x35cf53-0x0;var _0x2fc89f=_0x9600[_0x35cf53];return _0x2fc89f;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x0960('0x0'));var _=require(_0x0960('0x1'));var config=require('../config/environment');exports[_0x0960('0x2')]=function(){return new BPromise(function(_0x45b799,_0x135efd){var _0x83d515={};_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x4')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x5')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x6')));_0x83d515=_['merge'](_0x83d515,require(_0x0960('0x7')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x8')));_0x83d515=_['merge'](_0x83d515,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x9')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0xa')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0xb')));_0x83d515=_['merge'](_0x83d515,require(_0x0960('0xc')));_0x83d515=_['merge'](_0x83d515,require('../api/mailServerIn/mailServerIn.rpc'));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/mailAccount/mailAccount.rpc'));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0xd')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0xe')));_0x83d515=_['merge'](_0x83d515,require(_0x0960('0xf')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x10')));_0x83d515=_['merge'](_0x83d515,require(_0x0960('0x11')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x12')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/faxApplication/faxApplication.rpc'));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x13')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x14')));_0x83d515=_['merge'](_0x83d515,require(_0x0960('0x15')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x16')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/smsAccount/smsAccount.rpc'));_0x83d515=_['merge'](_0x83d515,require(_0x0960('0x17')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/smsMessage/smsMessage.rpc'));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/smsQueue/smsQueue.rpc'));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x18')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x19')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x83d515=_['merge'](_0x83d515,require(_0x0960('0x1a')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x1b')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/chatInteraction/chatInteraction.rpc'));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x1c')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/chatQueue/chatQueue.rpc'));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x1d')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x1e')));_0x83d515=_['merge'](_0x83d515,require(_0x0960('0x1f')));_0x83d515=_['merge'](_0x83d515,require(_0x0960('0x20')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x21')));_0x83d515=_['merge'](_0x83d515,require(_0x0960('0x22')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/pause/pause.rpc'));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x23')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x24')));_0x83d515=_['merge'](_0x83d515,require(_0x0960('0x25')));_0x83d515=_['merge'](_0x83d515,require(_0x0960('0x26')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x27')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x28')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x83d515=_['merge'](_0x83d515,require(_0x0960('0x29')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x2a')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x83d515=_['merge'](_0x83d515,require(_0x0960('0x2b')));_0x83d515=_['merge'](_0x83d515,require(_0x0960('0x2c')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x2d')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x2e')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x2f')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/squareRecording/squareRecording.rpc'));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x30')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require('../api/campaign/campaign.rpc'));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x31')));_0x83d515=_[_0x0960('0x3')](_0x83d515,require(_0x0960('0x32')));var _0x25d183=jayson[_0x0960('0x33')](_0x83d515)[_0x0960('0x34')]();var _0x44d5a1=config['rpc'][_0x0960('0x35')]||config[_0x0960('0x35')]+0x1;var _0x28b1c4=config[_0x0960('0x36')]['ip']||_0x0960('0x37');_0x25d183['on'](_0x0960('0x38'),function(_0x21a189){return _0x135efd(_0x21a189);});_0x25d183[_0x0960('0x2')](_0x44d5a1,_0x28b1c4,function(){console[_0x0960('0x39')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x28b1c4,_0x44d5a1);require(_0x0960('0x3a'))[_0x0960('0x3b')]();return _0x45b799(_0x0960('0x3c')+_0x28b1c4+':'+_0x44d5a1);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index b3d4901..9bb287b 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 _0xa758=['noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','format','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','toString','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','agi','AGI','wait','WAIT','label','exports','util','lodash','events','./reply','./error','setEncoding','utf8','setTimeout','emit','ready','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xa758,0x6a));var _0x8a75=function(_0x388167,_0x1431ba){_0x388167=_0x388167-0x0;var _0x1ea71e=_0xa758[_0x388167];return _0x1ea71e;};'use strict';var util=require(_0x8a75('0x0'));var _=require(_0x8a75('0x1'));var EventEmitter=require(_0x8a75('0x2'))['EventEmitter'];var AGIReply=require(_0x8a75('0x3'));var AGIError=require(_0x8a75('0x4'));function AGIChannel(_0x3fc51d){var _0x233584=this,_0x38a9a6=new AGIReply(),_0x4207bb=![],_0x12e3ec={};EventEmitter['call'](_0x233584);_0x3fc51d[_0x8a75('0x5')](_0x8a75('0x6'));_0x3fc51d[_0x8a75('0x7')](0x8*0x3c*0x3c*0x3e8);_0x38a9a6[_0x8a75('0x5')](_0x8a75('0x6'));_0x38a9a6['on']('headers',function(_0x2a736f){for(var _0x7ef758 in _0x2a736f){_0x233584[_0x7ef758]=_0x2a736f[_0x7ef758];}_0x233584[_0x8a75('0x8')](_0x8a75('0x9'));});_0x38a9a6['on']('line',function(_0x4d93f2){if(_0x4d93f2[_0x8a75('0xa')]()=='hangup'){_0x233584[_0x8a75('0x8')](_0x8a75('0xb'));return;}if(_0x4d93f2[_0x8a75('0xc')](0x0,0xb)==_0x8a75('0xd')){_0x4207bb=!![];}if(_0x4207bb){_0x12e3ec['rx']+=_0x4d93f2+'\x0a';if(_0x4d93f2[_0x8a75('0xe')](_0x8a75('0xf'))!=-0x1){_0x4207bb=![];}}else{_0x12e3ec['rx']=_0x4d93f2;}if(_0x4207bb){return;}if(typeof _0x12e3ec['cb']==_0x8a75('0x10')){var _0x38a29a=_0x12e3ec['rx']['substring'](0x0,0x3),_0x13641c=null,_0x57141f=null;_0x38a29a=parseInt(_0x38a29a);if(isNaN(_0x38a29a)){_0x12e3ec['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x8a75('0x11')});return;}if(_0x38a29a!=0xc8){_0x12e3ec['cb'](null,{'code':_0x38a29a,'result':-0x1,'extra':'KO'});return;}_0x13641c=_0x12e3ec['rx'][_0x8a75('0xc')](0x4)[_0x8a75('0x12')](_0x8a75('0x13'),'');if(_0x13641c[_0x8a75('0x14')]('\x20')!=-0x1){_0x13641c=_0x13641c[_0x8a75('0x15')](0x0,_0x13641c[_0x8a75('0x14')]('\x20'));}if(_[_0x8a75('0x16')](_0x13641c,'-1')){_0x13641c=parseInt(_0x13641c);}_0x57141f=_0x12e3ec['rx'][_0x8a75('0x17')]('\x20');if(_0x57141f['length']==0x3){_0x57141f=_0x57141f[0x2][_0x8a75('0xc')](0x1,_0x57141f[0x2][_0x8a75('0x18')]-0x1);}else if(_0x57141f[_0x8a75('0x18')]>0x3){var _0x49ce2c=/\((.+)\)/;var _0x35fa35=_0x12e3ec['rx'][_0x8a75('0x19')](_0x49ce2c);if(_0x35fa35){_0x57141f=_0x35fa35[0x1];}else{_0x57141f=null;}}else{_0x57141f=null;}_0x12e3ec['cb'](null,{'code':_0x38a29a,'result':_0x13641c,'extra':_0x57141f});}});_0x3fc51d['on'](_0x8a75('0x1a'),function(_0x27127a){_0x233584[_0x8a75('0x8')](_0x8a75('0x1a'),new AGIError(_0x8a75('0x1b'),_0x27127a[_0x8a75('0x1c')]));});_0x3fc51d['on']('close',function(){_0x233584[_0x8a75('0x8')](_0x8a75('0x1d'),new AGIError(_0x8a75('0x1e')));});_0x3fc51d['on'](_0x8a75('0x1f'),function(){_0x233584['emit'](_0x8a75('0x1f'),new AGIError(_0x8a75('0x20')));_0x3fc51d[_0x8a75('0x21')]();});_0x3fc51d[_0x8a75('0x22')](_0x38a9a6);this[_0x8a75('0x23')]=function(_0x44cbed,_0x3ffb3e){var _0x44cbed=_0x44cbed||'',_0x3ffb3e=typeof _0x3ffb3e==_0x8a75('0x10')?_0x3ffb3e:new Function();_0x12e3ec={'tx':_0x44cbed,'rx':'','cb':_0x3ffb3e};_0x3fc51d[_0x8a75('0x24')](_0x44cbed+'\x0a');},this[_0x8a75('0x1d')]=function(){_0x3fc51d[_0x8a75('0x21')]();};}util[_0x8a75('0x25')](AGIChannel,EventEmitter);AGIChannel[_0x8a75('0x26')][_0x8a75('0x27')]=function(_0x4a260c){return this[_0x8a75('0x23')][_0x8a75('0x28')](this,_0x4a260c);};AGIChannel[_0x8a75('0x26')][_0x8a75('0x29')]=function(){return this['sendRequest'](_0x8a75('0x2a'));};AGIChannel['prototype'][_0x8a75('0x2b')]=function(_0x3905e2,_0x4bd9cb,_0x2f5545){_0x3905e2=_0x3905e2===undefined?_0x8a75('0x2c'):_0x3905e2;_0x4bd9cb=_0x4bd9cb===undefined?'5':_0x4bd9cb;_0x2f5545=_0x2f5545===undefined?'1':_0x2f5545;return this[_0x8a75('0x27')](util['format'](_0x8a75('0x2d'),_0x3905e2,_0x4bd9cb*0x3e8,_0x2f5545));};AGIChannel[_0x8a75('0x26')][_0x8a75('0x2e')]=function(_0x13655a){_0x13655a=_0x13655a||_0x8a75('0x2f');return this['sendRequest'](util['format'](_0x8a75('0x30'),_0x13655a));};AGIChannel[_0x8a75('0x26')][_0x8a75('0x31')]=function(_0x1d24e6,_0x28f4b2){if(_[_0x8a75('0x32')](_0x28f4b2)){return this[_0x8a75('0x27')](util[_0x8a75('0x33')](_0x8a75('0x34'),_0x1d24e6,_0x28f4b2[_0x8a75('0x35')](',')));}return this['sendRequest'](util[_0x8a75('0x33')](_0x8a75('0x34'),_0x1d24e6,_0x28f4b2));};AGIChannel[_0x8a75('0x26')][_0x8a75('0x36')]=function(_0x11c08a){return this[_0x8a75('0x27')](util['format'](_0x8a75('0x37'),_0x11c08a));};AGIChannel['prototype'][_0x8a75('0x38')]=function(_0x1654a8){return this[_0x8a75('0x27')](util[_0x8a75('0x33')](_0x8a75('0x39'),_0x1654a8));};AGIChannel[_0x8a75('0x26')]['setPriority']=function(_0x53bbee){return this[_0x8a75('0x27')](util[_0x8a75('0x33')]('SET\x20PRIORITY\x20%s',_0x53bbee));};AGIChannel[_0x8a75('0x26')]['hangup']=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0x8a75('0x26')]['setVariable']=function(_0x4f3ab0,_0x572864){return this[_0x8a75('0x27')](util[_0x8a75('0x33')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x4f3ab0,_0x572864?_0x572864[_0x8a75('0x3a')]()[_0x8a75('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x8a75('0x3b')]=function(_0x1ffd1d,_0x336a3c){return this[_0x8a75('0x27')](util[_0x8a75('0x33')]('SAY\x20NUMBER\x20%s\x20%s',_0x1ffd1d,_0x336a3c));};AGIChannel[_0x8a75('0x26')][_0x8a75('0x3c')]=function(_0x4c831e,_0x5df1bf){return this['sendRequest'](util[_0x8a75('0x33')](_0x8a75('0x3d'),_0x4c831e,_0x5df1bf));};AGIChannel[_0x8a75('0x26')]['sayPhonetic']=function(_0x2bed4e,_0x36eeef){return this[_0x8a75('0x27')](util[_0x8a75('0x33')](_0x8a75('0x3e'),_0x2bed4e,_0x36eeef));};AGIChannel[_0x8a75('0x26')][_0x8a75('0x3f')]=function(_0x33c952,_0x265b2f,_0x895c76){_0x265b2f=_0x265b2f||this[_0x8a75('0x40')];_0x895c76=_0x895c76||0x1;this[_0x8a75('0x36')](_0x33c952);this[_0x8a75('0x38')](_0x265b2f);this['setPriority'](_0x895c76);return this['noop'](util[_0x8a75('0x33')](_0x8a75('0x41'),_0x33c952,_0x265b2f,_0x895c76));};AGIChannel[_0x8a75('0x26')]['getVariable']=function(_0x17f953){return this['sendRequest'](util[_0x8a75('0x33')](_0x8a75('0x42'),_0x17f953));};AGIChannel['prototype'][_0x8a75('0x43')]=function(_0x3c6e75,_0x31177c,_0x3461df,_0x5bb949,_0x1247f8,_0x315a31){_0x31177c=_0x31177c||_0x8a75('0x44');_0x3461df=_0x3461df||'';_0x5bb949=_0x5bb949===undefined?-0x1:_0x5bb949==='-1'?-0x1:_0x5bb949*0x3e8;_0x1247f8=_0x1247f8===undefined?'':'s='+_0x1247f8;_0x315a31=_0x315a31?'BEEP':'';return this[_0x8a75('0x27')](util[_0x8a75('0x33')](_0x8a75('0x45'),_0x3c6e75,_0x31177c,_0x3461df,_0x5bb949,_0x315a31,_0x1247f8));};AGIChannel[_0x8a75('0x26')]['streamFile']=function(_0x374ae3,_0x3d3188){_0x3d3188=_0x3d3188||'';return this[_0x8a75('0x27')](util[_0x8a75('0x33')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x374ae3,_0x3d3188));};AGIChannel[_0x8a75('0x26')][_0x8a75('0x46')]=function(_0x29b54c){return this[_0x8a75('0x31')](_0x8a75('0x47'),_0x29b54c);};AGIChannel['prototype'][_0x8a75('0x48')]=function(_0xfdf35e){return this['exec'](_0x8a75('0x49'),_0xfdf35e);};AGIChannel['prototype'][_0x8a75('0x1a')]=function(_0x4285b,_0x16d22c){this['noop'](util[_0x8a75('0x33')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x4285b['id'],_0x4285b[_0x8a75('0x4a')],_0x16d22c));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x8a75('0x4b')]=AGIChannel; \ No newline at end of file +var _0xc2f9=['call','setEncoding','utf8','setTimeout','headers','ready','line','toLowerCase','hangup','emit','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','result=','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','inherits','prototype','sendRequest','sync','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','events','./reply','./error'];(function(_0x233870,_0x40889b){var _0x196316=function(_0x1e95a1){while(--_0x1e95a1){_0x233870['push'](_0x233870['shift']());}};_0x196316(++_0x40889b);}(_0xc2f9,0x120));var _0x9c2f=function(_0x6bb678,_0x152f69){_0x6bb678=_0x6bb678-0x0;var _0x551d06=_0xc2f9[_0x6bb678];return _0x551d06;};'use strict';var util=require(_0x9c2f('0x0'));var _=require('lodash');var EventEmitter=require(_0x9c2f('0x1'))['EventEmitter'];var AGIReply=require(_0x9c2f('0x2'));var AGIError=require(_0x9c2f('0x3'));function AGIChannel(_0x132547){var _0x3a50dd=this,_0x4ac545=new AGIReply(),_0x3c4244=![],_0xa303fe={};EventEmitter[_0x9c2f('0x4')](_0x3a50dd);_0x132547[_0x9c2f('0x5')](_0x9c2f('0x6'));_0x132547[_0x9c2f('0x7')](0x8*0x3c*0x3c*0x3e8);_0x4ac545[_0x9c2f('0x5')](_0x9c2f('0x6'));_0x4ac545['on'](_0x9c2f('0x8'),function(_0x452f61){for(var _0x1df537 in _0x452f61){_0x3a50dd[_0x1df537]=_0x452f61[_0x1df537];}_0x3a50dd['emit'](_0x9c2f('0x9'));});_0x4ac545['on'](_0x9c2f('0xa'),function(_0x312eb3){if(_0x312eb3[_0x9c2f('0xb')]()==_0x9c2f('0xc')){_0x3a50dd[_0x9c2f('0xd')](_0x9c2f('0xc'));return;}if(_0x312eb3['substring'](0x0,0xb)=='520-Invalid'){_0x3c4244=!![];}if(_0x3c4244){_0xa303fe['rx']+=_0x312eb3+'\x0a';if(_0x312eb3['search'](_0x9c2f('0xe'))!=-0x1){_0x3c4244=![];}}else{_0xa303fe['rx']=_0x312eb3;}if(_0x3c4244){return;}if(typeof _0xa303fe['cb']==_0x9c2f('0xf')){var _0x297e3a=_0xa303fe['rx'][_0x9c2f('0x10')](0x0,0x3),_0x3c3471=null,_0x434648=null;_0x297e3a=parseInt(_0x297e3a);if(isNaN(_0x297e3a)){_0xa303fe['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x9c2f('0x11')});return;}if(_0x297e3a!=0xc8){_0xa303fe['cb'](null,{'code':_0x297e3a,'result':-0x1,'extra':'KO'});return;}_0x3c3471=_0xa303fe['rx'][_0x9c2f('0x10')](0x4)[_0x9c2f('0x12')](_0x9c2f('0x13'),'');if(_0x3c3471[_0x9c2f('0x14')]('\x20')!=-0x1){_0x3c3471=_0x3c3471['substr'](0x0,_0x3c3471[_0x9c2f('0x14')]('\x20'));}if(_[_0x9c2f('0x15')](_0x3c3471,'-1')){_0x3c3471=parseInt(_0x3c3471);}_0x434648=_0xa303fe['rx'][_0x9c2f('0x16')]('\x20');if(_0x434648['length']==0x3){_0x434648=_0x434648[0x2][_0x9c2f('0x10')](0x1,_0x434648[0x2][_0x9c2f('0x17')]-0x1);}else if(_0x434648[_0x9c2f('0x17')]>0x3){var _0x4f69b8=/\((.+)\)/;var _0x526424=_0xa303fe['rx'][_0x9c2f('0x18')](_0x4f69b8);if(_0x526424){_0x434648=_0x526424[0x1];}else{_0x434648=null;}}else{_0x434648=null;}_0xa303fe['cb'](null,{'code':_0x297e3a,'result':_0x3c3471,'extra':_0x434648});}});_0x132547['on']('error',function(_0x3e1429){_0x3a50dd[_0x9c2f('0xd')](_0x9c2f('0x19'),new AGIError(_0x9c2f('0x1a'),_0x3e1429[_0x9c2f('0x1b')]));});_0x132547['on'](_0x9c2f('0x1c'),function(){_0x3a50dd[_0x9c2f('0xd')]('close',new AGIError(_0x9c2f('0x1d')));});_0x132547['on'](_0x9c2f('0x1e'),function(){_0x3a50dd[_0x9c2f('0xd')](_0x9c2f('0x1e'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x132547[_0x9c2f('0x1f')]();});_0x132547[_0x9c2f('0x20')](_0x4ac545);this[_0x9c2f('0x21')]=function(_0x195abf,_0x23fe22){var _0x195abf=_0x195abf||'',_0x23fe22=typeof _0x23fe22==_0x9c2f('0xf')?_0x23fe22:new Function();_0xa303fe={'tx':_0x195abf,'rx':'','cb':_0x23fe22};_0x132547[_0x9c2f('0x22')](_0x195abf+'\x0a');},this[_0x9c2f('0x1c')]=function(){_0x132547[_0x9c2f('0x1f')]();};}util[_0x9c2f('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x9c2f('0x24')][_0x9c2f('0x25')]=function(_0x51d852){return this['command'][_0x9c2f('0x26')](this,_0x51d852);};AGIChannel[_0x9c2f('0x24')]['answer']=function(){return this[_0x9c2f('0x25')](_0x9c2f('0x27'));};AGIChannel[_0x9c2f('0x24')][_0x9c2f('0x28')]=function(_0x26cdda,_0x538945,_0xfdf67e){_0x26cdda=_0x26cdda===undefined?_0x9c2f('0x29'):_0x26cdda;_0x538945=_0x538945===undefined?'5':_0x538945;_0xfdf67e=_0xfdf67e===undefined?'1':_0xfdf67e;return this['sendRequest'](util[_0x9c2f('0x2a')](_0x9c2f('0x2b'),_0x26cdda,_0x538945*0x3e8,_0xfdf67e));};AGIChannel[_0x9c2f('0x24')][_0x9c2f('0x2c')]=function(_0x257024){_0x257024=_0x257024||'NO\x20MESSAGE';return this[_0x9c2f('0x25')](util[_0x9c2f('0x2a')]('VERBOSE\x20\x22%s\x22',_0x257024));};AGIChannel[_0x9c2f('0x24')][_0x9c2f('0x2d')]=function(_0x52da3f,_0x9a9b38){if(_[_0x9c2f('0x2e')](_0x9a9b38)){return this[_0x9c2f('0x25')](util['format'](_0x9c2f('0x2f'),_0x52da3f,_0x9a9b38[_0x9c2f('0x30')](',')));}return this[_0x9c2f('0x25')](util['format'](_0x9c2f('0x2f'),_0x52da3f,_0x9a9b38));};AGIChannel[_0x9c2f('0x24')][_0x9c2f('0x31')]=function(_0x34fee4){return this[_0x9c2f('0x25')](util[_0x9c2f('0x2a')]('SET\x20CONTEXT\x20%s',_0x34fee4));};AGIChannel[_0x9c2f('0x24')]['setExtension']=function(_0x199d73){return this['sendRequest'](util[_0x9c2f('0x2a')](_0x9c2f('0x32'),_0x199d73));};AGIChannel['prototype'][_0x9c2f('0x33')]=function(_0x5ad928){return this['sendRequest'](util[_0x9c2f('0x2a')](_0x9c2f('0x34'),_0x5ad928));};AGIChannel[_0x9c2f('0x24')][_0x9c2f('0xc')]=function(){return this[_0x9c2f('0x25')](_0x9c2f('0x35'));};AGIChannel[_0x9c2f('0x24')]['setVariable']=function(_0x5655b0,_0x13a60b){return this[_0x9c2f('0x25')](util[_0x9c2f('0x2a')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x5655b0,_0x13a60b?_0x13a60b[_0x9c2f('0x36')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x9c2f('0x24')][_0x9c2f('0x37')]=function(_0x53cfee,_0x4e4a30){return this[_0x9c2f('0x25')](util[_0x9c2f('0x2a')](_0x9c2f('0x38'),_0x53cfee,_0x4e4a30));};AGIChannel[_0x9c2f('0x24')]['sayDigits']=function(_0x7d242b,_0x175007){return this[_0x9c2f('0x25')](util[_0x9c2f('0x2a')](_0x9c2f('0x39'),_0x7d242b,_0x175007));};AGIChannel['prototype'][_0x9c2f('0x3a')]=function(_0x1a3f47,_0x3a663c){return this['sendRequest'](util[_0x9c2f('0x2a')](_0x9c2f('0x3b'),_0x1a3f47,_0x3a663c));};AGIChannel[_0x9c2f('0x24')]['continueAt']=function(_0x190ef8,_0x1ee84c,_0x50a9dc){_0x1ee84c=_0x1ee84c||this[_0x9c2f('0x3c')];_0x50a9dc=_0x50a9dc||0x1;this[_0x9c2f('0x31')](_0x190ef8);this[_0x9c2f('0x3d')](_0x1ee84c);this[_0x9c2f('0x33')](_0x50a9dc);return this['noop'](util['format'](_0x9c2f('0x3e'),_0x190ef8,_0x1ee84c,_0x50a9dc));};AGIChannel['prototype'][_0x9c2f('0x3f')]=function(_0x50c780){return this['sendRequest'](util[_0x9c2f('0x2a')]('GET\x20VARIABLE\x20\x22%s\x22',_0x50c780));};AGIChannel[_0x9c2f('0x24')][_0x9c2f('0x40')]=function(_0x1165de,_0x421360,_0x41501c,_0x46119c,_0x4264cd,_0x3740ff){_0x421360=_0x421360||_0x9c2f('0x41');_0x41501c=_0x41501c||'';_0x46119c=_0x46119c===undefined?-0x1:_0x46119c==='-1'?-0x1:_0x46119c*0x3e8;_0x4264cd=_0x4264cd===undefined?'':'s='+_0x4264cd;_0x3740ff=_0x3740ff?_0x9c2f('0x42'):'';return this['sendRequest'](util['format'](_0x9c2f('0x43'),_0x1165de,_0x421360,_0x41501c,_0x46119c,_0x3740ff,_0x4264cd));};AGIChannel[_0x9c2f('0x24')]['streamFile']=function(_0x1f1196,_0x57a2ab){_0x57a2ab=_0x57a2ab||'';return this[_0x9c2f('0x25')](util[_0x9c2f('0x2a')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x1f1196,_0x57a2ab));};AGIChannel['prototype'][_0x9c2f('0x44')]=function(_0x355f8b){return this[_0x9c2f('0x2d')]('AGI',_0x355f8b);};AGIChannel[_0x9c2f('0x24')][_0x9c2f('0x45')]=function(_0x577db1){return this[_0x9c2f('0x2d')](_0x9c2f('0x46'),_0x577db1);};AGIChannel[_0x9c2f('0x24')][_0x9c2f('0x19')]=function(_0x2bc8b6,_0x4c1ffd){this[_0x9c2f('0x2c')](util[_0x9c2f('0x2a')](_0x9c2f('0x47'),_0x2bc8b6['id'],_0x2bc8b6[_0x9c2f('0x48')],_0x4c1ffd));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 f499374..8e187e7 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 _0x323b=['format','apply','message','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x323b,0x1ad));var _0xb323=function(_0x305e42,_0x226427){_0x305e42=_0x305e42-0x0;var _0x55b844=_0x323b[_0x305e42];return _0x55b844;};'use strict';var util=require(_0xb323('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xb323('0x1'),'E_AGI_SERVER_ERROR':_0xb323('0x2'),'E_AGI_SERVER_CLOSE':_0xb323('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xb323('0x4'),'E_AGI_SOCKET_ERROR':_0xb323('0x5'),'E_AGI_SOCKET_CLOSE':_0xb323('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xb323('0x7'),'E_AGI_COMMAND_EMPTY':_0xb323('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xb323('0x9'),'E_AGI_IVR_ENTRY':_0xb323('0xa')};function AGIError(_0x4620a0){var _0x4620a0=_0x4620a0||null,_0x4e620b=_0x4e620b||[],_0x2f0d17=0x1,_0x3508d5='';if(!error[_0x4620a0]){_0x4620a0=_0xb323('0xb');}_0x4e620b[_0xb323('0xc')](error[_0x4620a0]);while(arguments[_0x2f0d17]){_0x4e620b['push'](arguments[_0x2f0d17]);_0x2f0d17++;}_0x3508d5=util[_0xb323('0xd')][_0xb323('0xe')](util,_0x4e620b);this[_0xb323('0xf')]=_0x3508d5;this['name']=_0x4620a0;}module[_0xb323('0x10')]=AGIError; \ No newline at end of file +var _0xf980=['exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','format','message'];(function(_0x148879,_0x5b4c11){var _0x4f7027=function(_0xad056b){while(--_0xad056b){_0x148879['push'](_0x148879['shift']());}};_0x4f7027(++_0x5b4c11);}(_0xf980,0x1cf));var _0x0f98=function(_0x2e6ab8,_0x4ea85c){_0x2e6ab8=_0x2e6ab8-0x0;var _0x16cba0=_0xf980[_0x2e6ab8];return _0x16cba0;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x0f98('0x0'),'E_AGI_ARGUMENT_PORT':_0x0f98('0x1'),'E_AGI_SERVER_ERROR':_0x0f98('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x0f98('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x0f98('0x4'),'E_AGI_SOCKET_ERROR':_0x0f98('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x0f98('0x6'),'E_AGI_COMMAND_EMPTY':_0x0f98('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x0f98('0x8'),'E_AGI_IVR_ENTRY':_0x0f98('0x9')};function AGIError(_0x46f937){var _0x46f937=_0x46f937||null,_0x228042=_0x228042||[],_0x2eef66=0x1,_0x2a76ed='';if(!error[_0x46f937]){_0x46f937=_0x0f98('0xa');}_0x228042['push'](error[_0x46f937]);while(arguments[_0x2eef66]){_0x228042['push'](arguments[_0x2eef66]);_0x2eef66++;}_0x2a76ed=util[_0x0f98('0xb')]['apply'](util,_0x228042);this[_0x0f98('0xc')]=_0x2a76ed;this['name']=_0x46f937;}module[_0x0f98('0xd')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 1578b3b..556735b 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 _0x0833=['numberOfEdges','addVertex','vertices','prototype','addEdge','edges','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','lodash','../../../config/logger','agi','menu','getdigits'];(function(_0x484a09,_0x31b700){var _0x16ea35=function(_0xa39119){while(--_0xa39119){_0x484a09['push'](_0x484a09['shift']());}};_0x16ea35(++_0x31b700);}(_0x0833,0x1bd));var _0x3083=function(_0x5033f4,_0x8c586){_0x5033f4=_0x5033f4-0x0;var _0x3f978c=_0x0833[_0x5033f4];return _0x3f978c;};'use strict';var _=require(_0x3083('0x0'));var logger=require(_0x3083('0x1'))(_0x3083('0x2'));var verticesWithRetry=[_0x3083('0x3'),_0x3083('0x4'),'getsecretdigits'];var Graph=function(){this['vertices']={};this['edges']={};this[_0x3083('0x5')]=0x0;};Graph['prototype'][_0x3083('0x6')]=function(_0x1d8d6e){this[_0x3083('0x7')][_0x1d8d6e['id']]=_0x1d8d6e;this['edges'][_0x1d8d6e['id']]=[];};Graph[_0x3083('0x8')][_0x3083('0x9')]=function(_0x529df1,_0x5591b0,_0x4f51da){this[_0x3083('0xa')][_0x529df1]['push']({'target':_0x5591b0,'condition':_0x4f51da});this['numberOfEdges']+=0x1;};Graph[_0x3083('0x8')][_0x3083('0xb')]=function(){return _[_0x3083('0xb')](this[_0x3083('0x7')]);};Graph[_0x3083('0x8')][_0x3083('0xc')]=function(){return this[_0x3083('0x5')];};Graph[_0x3083('0x8')][_0x3083('0xd')]=function(_0xb16222){return this[_0x3083('0x7')][_0xb16222];};Graph[_0x3083('0x8')][_0x3083('0xe')]=function(_0x2dc6ab,_0x1b33f3){if(!this['vertices'][_0x2dc6ab]){return logger[_0x3083('0xf')](_0x3083('0x10'));}var _0x5f39e3=_0x1b33f3(this[_0x3083('0x7')][_0x2dc6ab]);if(!_0x5f39e3){return logger[_0x3083('0xf')]('stop\x20traverse');}if(this[_0x3083('0xa')][_0x2dc6ab][_0x3083('0x11')]===0x0){return logger[_0x3083('0xf')](_0x3083('0x12'));}for(var _0x3f1f08=0x0,_0x1de928=[],_0xecb368=![];_0x3f1f08\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','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','dnid','evtHangup','toJson','mxGraphModel','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','length','source','target','addEdge','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','start','root','stringify','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','isUndefined','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','lodash','syncho','util','../../config/environment','agi','../../config/license/util'];(function(_0x58176f,_0x55a4e5){var _0x14ccb0=function(_0x3d373b){while(--_0x3d373b){_0x58176f['push'](_0x58176f['shift']());}};_0x14ccb0(++_0x55a4e5);}(_0x038b,0x114));var _0xb038=function(_0xc0acd2,_0x425dbf){_0xc0acd2=_0xc0acd2-0x0;var _0x563f72=_0x038b[_0xc0acd2];return _0x563f72;};'use strict';var parser=require('xml2json');var _=require(_0xb038('0x0'));var syncho=require(_0xb038('0x1'));var util=require(_0xb038('0x2'));var moment=require('moment');var config=require(_0xb038('0x3'));var logger=require('../../config/logger')(_0xb038('0x4'));var utilLicense=require(_0xb038('0x5'));var rpc=require('./rpc');var mailRpc=require(_0xb038('0x6'));var Graph=require(_0xb038('0x7'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0xb038('0x8')](config[_0xb038('0x4')],{'ip':_0xb038('0x9'),'port':0x11dd});function connectionHandler(_0x4b4085){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x4b4085);agiHandler(_0x4b4085);}catch(_0x462e8f){logger[_0xb038('0xa')](_0x462e8f['stack']);}});});}function listeningHandler(){console['log'](_0xb038('0xb'),config[_0xb038('0x4')]['port']);logger[_0xb038('0xc')](util[_0xb038('0xd')](_0xb038('0xe'),config[_0xb038('0x4')]['ip'],config[_0xb038('0x4')][_0xb038('0xf')]));}function errorHandler(_0x1e6474){if(_0x1e6474&&_0x1e6474[_0xb038('0x10')]&&_0x1e6474[_0xb038('0x11')]){logger[_0xb038('0xa')](util[_0xb038('0xd')](_0xb038('0x12'),_0x1e6474[_0xb038('0x10')],_0x1e6474[_0xb038('0x11')]));}else{logger[_0xb038('0xa')](util[_0xb038('0xd')](_0xb038('0x13'),_0x1e6474['stack']));}}function closeHandler(){logger[_0xb038('0xc')](util[_0xb038('0xd')](_0xb038('0x14'),this[_0xb038('0x15')],this[_0xb038('0x16')],this[_0xb038('0x17')],this['dnid'],this[_0xb038('0x18')]));try{createSquareReport(this);}catch(_0x3039b0){logger[_0xb038('0xa')](_0x3039b0[_0xb038('0x19')]);}}function timeoutHandler(){logger['info'](util['format'](_0xb038('0x1a'),this[_0xb038('0x15')],this[_0xb038('0x16')],this[_0xb038('0x17')],this['dnid'],this[_0xb038('0x18')]));}function hangupHandler(){logger[_0xb038('0xc')](util[_0xb038('0xd')](_0xb038('0x1b'),this[_0xb038('0x15')],this['calleridname'],this[_0xb038('0x17')],this[_0xb038('0x1c')],this[_0xb038('0x18')]));this[_0xb038('0x1d')]=!![];}function getRoot(_0x5f123d){return parser[_0xb038('0x1e')](_0x5f123d,{'object':!![]})[_0xb038('0x1f')]['root'];}function addVertex(_0x1eb9cd,_0x43d403,_0x573f93){_0x43d403[_0xb038('0x20')]=_0x573f93;if(_0x43d403['hasOwnProperty'](_0xb038('0x21'))){_0x43d403[_0xb038('0x22')]=parseInt(_0x43d403[_0xb038('0x21')],0xa);}_0x1eb9cd[_0xb038('0x23')](_[_0xb038('0x24')](_0x43d403,_0xb038('0x25')));}function initGraph(_0x3f7cff,_0x576be5){var _0xb6d93f=new Graph();for(var _0x33cf3c in _0x3f7cff){if(_0x3f7cff[_0xb038('0x26')](_0x33cf3c)){if(_['isArray'](_0x3f7cff[_0x33cf3c])){for(var _0xa8fe18=0x0;_0xa8fe18<_0x3f7cff[_0x33cf3c][_0xb038('0x27')];_0xa8fe18+=0x1){addVertex(_0xb6d93f,_0x3f7cff[_0x33cf3c][_0xa8fe18],_0x33cf3c);}}else{addVertex(_0xb6d93f,_0x3f7cff[_0x33cf3c],_0x33cf3c);}}}for(var _0x1fa72d=0x0;_0x1fa72d<_0x576be5['length'];_0x1fa72d+=0x1){if(_0x576be5[_0x1fa72d][_0xb038('0x28')]&&_0x576be5[_0x1fa72d][_0xb038('0x29')]){_0xb6d93f[_0xb038('0x2a')](_0x576be5[_0x1fa72d][_0xb038('0x28')],_0x576be5[_0x1fa72d][_0xb038('0x29')],_0x576be5[_0x1fa72d]['value']);}}return _0xb6d93f;}function getSquareProject(_0x1783d4,_0x1a8aa5){rpc[_0xb038('0x2b')](_0x1783d4)[_0xb038('0x2c')](function(_0x1abe23){_0x1a8aa5(null,_0x1abe23);})[_0xb038('0x2d')](function(_0x29a0d7){_0x1a8aa5(null,_0x29a0d7);});}function createSquareReport(_0x3695aa,_0xe4eb72){rpc[_0xb038('0x2e')](_0x3695aa)[_0xb038('0x2c')](function(_0x1a741f){if(_0xe4eb72){_0xe4eb72(null,_0x1a741f);}})[_0xb038('0x2d')](function(_0x4f6837){if(_0xe4eb72){_0xe4eb72(null,_0x4f6837);}});}function setChannelVariables(_0x1d807a){for(var _0x598554 in _0x1d807a){if(_0x1d807a[_0xb038('0x26')](_0x598554)){if(_0x598554[_0xb038('0x2f')](_0xb038('0x30'))===0x0){_0x1d807a[_0x598554[_0xb038('0x31')](0x4)]=_0x1d807a[_0x598554];delete _0x1d807a[_0x598554];}}}}function getLogFromObject(_0x442663){return util[_0xb038('0x32')](_0x442663,{'showHidden':![],'depth':null});}function agiHandler(_0x3a393d){var _0x3e6373,_0x22fac4,_0x883647,_0x4fedda,_0x2cac56;logger[_0xb038('0x33')](_0xb038('0x34'),JSON['stringify'](_0x3a393d,null,0x2));logger['info'](util['format'](_0xb038('0x35'),_0x3a393d[_0xb038('0x15')],_0x3a393d[_0xb038('0x16')],_0x3a393d[_0xb038('0x17')],_0x3a393d[_0xb038('0x1c')],_0x3a393d[_0xb038('0x18')]));_0x3a393d['on']('error',errorHandler);_0x3a393d['on'](_0xb038('0x36'),closeHandler);_0x3a393d['on'](_0xb038('0x37'),timeoutHandler);_0x3a393d[_0xb038('0x1d')]=![];_0x3a393d['on'](_0xb038('0x38'),hangupHandler);var _0x48e70b=getSquareProject[_0xb038('0x39')](null,_0x3a393d[_0xb038('0x15')]);if(_0x48e70b){if(_0x48e70b['production']){_0x3e6373=getRoot(_0x48e70b['production']);if(_0x3e6373&&_0x3e6373[_0xb038('0x3a')]){logger[_0xb038('0x33')](_0xb038('0x3b'),JSON[_0xb038('0x3c')](_0x3e6373,null,0x2));_0x3a393d[_0xb038('0x3d')]=moment()['format'](_0xb038('0x3e'));_0x22fac4=initGraph(_[_0xb038('0x24')](_0x3e6373,_0xb038('0x25')),_0x3e6373[_0xb038('0x25')]);_0x883647=new Vertices(_0x3a393d,rpc,mailRpc);logger['info'](util[_0xb038('0xd')](_0xb038('0x3f'),_0x3a393d[_0xb038('0x15')],_0x3a393d['calleridname'],_0x3a393d[_0xb038('0x17')],_0x3a393d['dnid'],_0x3a393d[_0xb038('0x18')]));_0x22fac4[_0xb038('0x40')](_0x3e6373[_0xb038('0x3a')]['id'],function(_0x5ce40c){try{_0x5ce40c=_0x883647[_0xb038('0x41')](_0x5ce40c);logger[_0xb038('0x33')](_0xb038('0x42'),JSON['stringify'](_0x5ce40c,null,0x2));if(_0x5ce40c[_0xb038('0x20')]===_0xb038('0x43')){logger[_0xb038('0xc')](_0xb038('0x44'));_0x3a393d['context']=_0x5ce40c[_0xb038('0x45')]||_0x3a393d[_0xb038('0x45')];_0x3a393d[_0xb038('0x46')]=_0x5ce40c[_0xb038('0x46')];_0x3a393d['priority']=_0x5ce40c[_0xb038('0x47')]?_0x5ce40c[_0xb038('0x47')]-0x1:0x1;return null;}else if(_0x5ce40c&&_0x883647[_0x5ce40c['agicommand']]){_0x2cac56=_0x883647[_0x5ce40c[_0xb038('0x20')]](_0x5ce40c);logger[_0xb038('0xc')](_0xb038('0x48'),JSON['stringify'](_0x2cac56,null,0x2));if(_0x2cac56&&_0x2cac56[_0xb038('0x49')]===AGI_CODE_SUCCESS&&_0x2cac56[_0xb038('0x4a')]!==AGI_RESULT_ERROR&&!_0x3a393d['evtHangup']){logger['debug'](_0xb038('0x48'),getLogFromObject(_0x2cac56));return _[_0xb038('0x4b')](_0x2cac56[_0xb038('0x4a')])?null:_0x2cac56[_0xb038('0x4a')][_0xb038('0x4c')]();}else{logger[_0xb038('0xa')](_0xb038('0x48'),getLogFromObject(_0x2cac56));return null;}}else{logger[_0xb038('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x5f0d9d){logger['error'](_0x5f0d9d[_0xb038('0x19')]);return null;}});if(_0x3e6373[_0xb038('0x4d')]){logger['info'](util[_0xb038('0xd')](_0xb038('0x4e'),_0x3a393d[_0xb038('0x15')],_0x3a393d['calleridname'],_0x3a393d[_0xb038('0x17')],_0x3a393d['dnid'],_0x3a393d['uniqueid']));_0x22fac4[_0xb038('0x40')](_0x3e6373[_0xb038('0x4d')]['id'],function(_0x163bb8){try{_0x163bb8=_0x883647[_0xb038('0x41')](_0x163bb8);logger[_0xb038('0x33')](_0xb038('0x42'),JSON[_0xb038('0x3c')](_0x163bb8,null,0x2));if(_0x163bb8&&_0x883647[_0x163bb8[_0xb038('0x20')]]){_0x2cac56=_0x883647[_0x163bb8[_0xb038('0x20')]](_0x163bb8);if(_0x2cac56){logger[_0xb038('0x33')]('response',getLogFromObject(_0x2cac56));return _[_0xb038('0x4b')](_0x2cac56[_0xb038('0x4a')])?null:_0x2cac56['result'][_0xb038('0x4c')]();}else{logger[_0xb038('0xa')]('response',getLogFromObject(_0x2cac56));return null;}}else{logger[_0xb038('0xa')](_0xb038('0x4f'));return null;}}catch(_0x1e7162){logger[_0xb038('0xa')](_0x1e7162[_0xb038('0x19')]);return null;}});}logger[_0xb038('0xc')](util[_0xb038('0xd')](_0xb038('0x50'),_0x3a393d[_0xb038('0x15')],_0x3a393d['calleridname'],_0x3a393d[_0xb038('0x17')],_0x3a393d[_0xb038('0x1c')],_0x3a393d[_0xb038('0x18')]));logger[_0xb038('0xc')](util[_0xb038('0xd')](_0xb038('0x51'),_0x3a393d['context'],_0x3a393d[_0xb038('0x46')],parseInt(_0x3a393d[_0xb038('0x47')],0xa)+0x1));_0x3a393d[_0xb038('0x52')](_0x3a393d[_0xb038('0x45')],_0x3a393d[_0xb038('0x46')],parseInt(_0x3a393d[_0xb038('0x47')],0xa)+0x1);_0x3a393d[_0xb038('0x36')]();}}else{logger['error'](util[_0xb038('0xd')]('Project\x20%s\x20not\x20published',_0x3a393d[_0xb038('0x15')]));_0x3a393d[_0xb038('0x52')](_0x3a393d[_0xb038('0x45')],_0x3a393d[_0xb038('0x46')],parseInt(_0x3a393d[_0xb038('0x47')],0xa)+0x1);_0x3a393d['close']();}}else{logger['error'](util['format'](_0xb038('0x53'),_0x3a393d[_0xb038('0x15')]));_0x3a393d[_0xb038('0x52')](_0x3a393d[_0xb038('0x45')],_0x3a393d[_0xb038('0x46')],parseInt(_0x3a393d[_0xb038('0x47')],0xa)+0x1);_0x3a393d['close']();}}function main(){var _0x27758c;return utilLicense[_0xb038('0x54')]()['then'](function(_0x5b27d3){if(_0x5b27d3){if(_0x5b27d3[_0xb038('0x55')]){if(_0x5b27d3['callysquare']&&_0x5b27d3[_0xb038('0x56')]>0x0){logger['info'](util[_0xb038('0xd')](_0xb038('0x57'),_0x5b27d3[_0xb038('0x56')]));_0x27758c=_0x5b27d3[_0xb038('0x56')];}else{logger['info'](_0xb038('0x58'));}}else{logger[_0xb038('0xc')](_0xb038('0x59'));_0x27758c=-0x1;}}})[_0xb038('0x2d')](function(_0x1c5e1d){logger[_0xb038('0xa')](_0xb038('0x5a'),_0x1c5e1d[_0xb038('0x19')]);})[_0xb038('0x4d')](function(){var _0x1f524e=require(_0xb038('0x5b'))(config[_0xb038('0x4')]['port'],config[_0xb038('0x4')]['ip'],_0x27758c);_0x1f524e['on'](_0xb038('0xa'),errorHandler);_0x1f524e['on'](_0xb038('0x5c'),listeningHandler);_0x1f524e['on'](_0xb038('0x5d'),connectionHandler);_0x1f524e['on'](_0xb038('0x36'),closeHandler);});}main(); \ No newline at end of file +var _0x5fc3=['agi','./rpc','./mailRpc','./graph','defaults','127.0.0.1','nextTick','error','stack','log','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','name','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','info','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','evtHangup','mxGraphModel','root','hasOwnProperty','retry','addVertex','omit','length','target','addEdge','source','value','getSquareProject','catch','createSquareReport','then','indexOf','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','sync','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','debug','vertex','gotoc','context','extension','priority','response','isUndefined','result','toString','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','clear','agicommand','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','listening','connection','xml2json','lodash','util','moment','../../config/environment','../../config/logger'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5c1345,_0x40116e){_0x5c1345=_0x5c1345-0x0;var _0x1c070d=_0x5fc3[_0x5c1345];return _0x1c070d;};'use strict';var parser=require(_0x35fc('0x0'));var _=require(_0x35fc('0x1'));var syncho=require('syncho');var util=require(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var config=require(_0x35fc('0x4'));var logger=require(_0x35fc('0x5'))(_0x35fc('0x6'));var utilLicense=require('../../config/license/util');var rpc=require(_0x35fc('0x7'));var mailRpc=require(_0x35fc('0x8'));var Graph=require(_0x35fc('0x9'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x35fc('0xa')](config['agi'],{'ip':_0x35fc('0xb'),'port':0x11dd});function connectionHandler(_0x27524f){process[_0x35fc('0xc')](function(){syncho(function(){try{setChannelVariables(_0x27524f);agiHandler(_0x27524f);}catch(_0x1e5f90){logger[_0x35fc('0xd')](_0x1e5f90[_0x35fc('0xe')]);}});});}function listeningHandler(){console[_0x35fc('0xf')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x35fc('0x6')][_0x35fc('0x10')]);logger['info'](util[_0x35fc('0x11')](_0x35fc('0x12'),config['agi']['ip'],config[_0x35fc('0x6')][_0x35fc('0x10')]));}function errorHandler(_0x5469f5){if(_0x5469f5&&_0x5469f5['name']&&_0x5469f5[_0x35fc('0x13')]){logger['error'](util[_0x35fc('0x11')](_0x35fc('0x14'),_0x5469f5[_0x35fc('0x15')],_0x5469f5[_0x35fc('0x13')]));}else{logger[_0x35fc('0xd')](util['format']('[ERROR]\x20%s',_0x5469f5['stack']));}}function closeHandler(){logger['info'](util[_0x35fc('0x11')](_0x35fc('0x16'),this[_0x35fc('0x17')],this[_0x35fc('0x18')],this[_0x35fc('0x19')],this[_0x35fc('0x1a')],this['uniqueid']));try{createSquareReport(this);}catch(_0x26ba54){logger[_0x35fc('0xd')](_0x26ba54['stack']);}}function timeoutHandler(){logger[_0x35fc('0x1b')](util[_0x35fc('0x11')](_0x35fc('0x1c'),this['arg_1'],this[_0x35fc('0x18')],this[_0x35fc('0x19')],this[_0x35fc('0x1a')],this['uniqueid']));}function hangupHandler(){logger[_0x35fc('0x1b')](util[_0x35fc('0x11')](_0x35fc('0x1d'),this[_0x35fc('0x17')],this[_0x35fc('0x18')],this[_0x35fc('0x19')],this[_0x35fc('0x1a')],this[_0x35fc('0x1e')]));this[_0x35fc('0x1f')]=!![];}function getRoot(_0x427eae){return parser['toJson'](_0x427eae,{'object':!![]})[_0x35fc('0x20')][_0x35fc('0x21')];}function addVertex(_0x257719,_0x2d8183,_0x3b4743){_0x2d8183['agicommand']=_0x3b4743;if(_0x2d8183[_0x35fc('0x22')](_0x35fc('0x23'))){_0x2d8183['maxRetry']=parseInt(_0x2d8183[_0x35fc('0x23')],0xa);}_0x257719[_0x35fc('0x24')](_[_0x35fc('0x25')](_0x2d8183,'mxCell'));}function initGraph(_0x4086e9,_0x598d7a){var _0x1bf180=new Graph();for(var _0xdfab9f in _0x4086e9){if(_0x4086e9['hasOwnProperty'](_0xdfab9f)){if(_['isArray'](_0x4086e9[_0xdfab9f])){for(var _0x47774c=0x0;_0x47774c<_0x4086e9[_0xdfab9f]['length'];_0x47774c+=0x1){addVertex(_0x1bf180,_0x4086e9[_0xdfab9f][_0x47774c],_0xdfab9f);}}else{addVertex(_0x1bf180,_0x4086e9[_0xdfab9f],_0xdfab9f);}}}for(var _0x274208=0x0;_0x274208<_0x598d7a[_0x35fc('0x26')];_0x274208+=0x1){if(_0x598d7a[_0x274208]['source']&&_0x598d7a[_0x274208][_0x35fc('0x27')]){_0x1bf180[_0x35fc('0x28')](_0x598d7a[_0x274208][_0x35fc('0x29')],_0x598d7a[_0x274208][_0x35fc('0x27')],_0x598d7a[_0x274208][_0x35fc('0x2a')]);}}return _0x1bf180;}function getSquareProject(_0x134dfa,_0x11ccdb){rpc[_0x35fc('0x2b')](_0x134dfa)['then'](function(_0x1cd1ae){_0x11ccdb(null,_0x1cd1ae);})[_0x35fc('0x2c')](function(_0x22af18){_0x11ccdb(null,_0x22af18);});}function createSquareReport(_0x52acc5,_0xe79f52){rpc[_0x35fc('0x2d')](_0x52acc5)[_0x35fc('0x2e')](function(_0xe6e4ba){if(_0xe79f52){_0xe79f52(null,_0xe6e4ba);}})[_0x35fc('0x2c')](function(_0x103181){if(_0xe79f52){_0xe79f52(null,_0x103181);}});}function setChannelVariables(_0x222ddb){for(var _0x37b435 in _0x222ddb){if(_0x222ddb[_0x35fc('0x22')](_0x37b435)){if(_0x37b435[_0x35fc('0x2f')]('agi_')===0x0){_0x222ddb[_0x37b435['substring'](0x4)]=_0x222ddb[_0x37b435];delete _0x222ddb[_0x37b435];}}}}function getLogFromObject(_0x114bc1){return util['inspect'](_0x114bc1,{'showHidden':![],'depth':null});}function agiHandler(_0x37b394){var _0x39454e,_0x1c4b8b,_0x227471,_0x271ba9,_0x12e78f;logger['debug'](_0x35fc('0x30'),JSON[_0x35fc('0x31')](_0x37b394,null,0x2));logger[_0x35fc('0x1b')](util[_0x35fc('0x11')](_0x35fc('0x32'),_0x37b394[_0x35fc('0x17')],_0x37b394['calleridname'],_0x37b394[_0x35fc('0x19')],_0x37b394[_0x35fc('0x1a')],_0x37b394[_0x35fc('0x1e')]));_0x37b394['on']('error',errorHandler);_0x37b394['on'](_0x35fc('0x33'),closeHandler);_0x37b394['on']('timeout',timeoutHandler);_0x37b394[_0x35fc('0x1f')]=![];_0x37b394['on'](_0x35fc('0x34'),hangupHandler);var _0x266a11=getSquareProject[_0x35fc('0x35')](null,_0x37b394['arg_1']);if(_0x266a11){if(_0x266a11['production']){_0x39454e=getRoot(_0x266a11['production']);if(_0x39454e&&_0x39454e[_0x35fc('0x36')]){logger['debug'](_0x35fc('0x21'),JSON['stringify'](_0x39454e,null,0x2));_0x37b394[_0x35fc('0x37')]=moment()[_0x35fc('0x11')](_0x35fc('0x38'));_0x1c4b8b=initGraph(_[_0x35fc('0x25')](_0x39454e,_0x35fc('0x39')),_0x39454e[_0x35fc('0x39')]);_0x227471=new Vertices(_0x37b394,rpc,mailRpc);logger[_0x35fc('0x1b')](util['format'](_0x35fc('0x3a'),_0x37b394[_0x35fc('0x17')],_0x37b394['calleridname'],_0x37b394[_0x35fc('0x19')],_0x37b394[_0x35fc('0x1a')],_0x37b394[_0x35fc('0x1e')]));_0x1c4b8b[_0x35fc('0x3b')](_0x39454e[_0x35fc('0x36')]['id'],function(_0x31d926){try{_0x31d926=_0x227471['clear'](_0x31d926);logger[_0x35fc('0x3c')](_0x35fc('0x3d'),JSON[_0x35fc('0x31')](_0x31d926,null,0x2));if(_0x31d926['agicommand']===_0x35fc('0x3e')){logger[_0x35fc('0x1b')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x37b394[_0x35fc('0x3f')]=_0x31d926[_0x35fc('0x3f')]||_0x37b394[_0x35fc('0x3f')];_0x37b394[_0x35fc('0x40')]=_0x31d926[_0x35fc('0x40')];_0x37b394[_0x35fc('0x41')]=_0x31d926[_0x35fc('0x41')]?_0x31d926[_0x35fc('0x41')]-0x1:0x1;return null;}else if(_0x31d926&&_0x227471[_0x31d926['agicommand']]){_0x12e78f=_0x227471[_0x31d926['agicommand']](_0x31d926);logger[_0x35fc('0x1b')](_0x35fc('0x42'),JSON['stringify'](_0x12e78f,null,0x2));if(_0x12e78f&&_0x12e78f['code']===AGI_CODE_SUCCESS&&_0x12e78f['result']!==AGI_RESULT_ERROR&&!_0x37b394[_0x35fc('0x1f')]){logger[_0x35fc('0x3c')]('response',getLogFromObject(_0x12e78f));return _[_0x35fc('0x43')](_0x12e78f[_0x35fc('0x44')])?null:_0x12e78f[_0x35fc('0x44')][_0x35fc('0x45')]();}else{logger['error']('response',getLogFromObject(_0x12e78f));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x56bdb9){logger[_0x35fc('0xd')](_0x56bdb9[_0x35fc('0xe')]);return null;}});if(_0x39454e['finally']){logger[_0x35fc('0x1b')](util['format'](_0x35fc('0x46'),_0x37b394[_0x35fc('0x17')],_0x37b394[_0x35fc('0x18')],_0x37b394[_0x35fc('0x19')],_0x37b394[_0x35fc('0x1a')],_0x37b394['uniqueid']));_0x1c4b8b[_0x35fc('0x3b')](_0x39454e[_0x35fc('0x47')]['id'],function(_0x4fd3d8){try{_0x4fd3d8=_0x227471[_0x35fc('0x48')](_0x4fd3d8);logger[_0x35fc('0x3c')](_0x35fc('0x3d'),JSON[_0x35fc('0x31')](_0x4fd3d8,null,0x2));if(_0x4fd3d8&&_0x227471[_0x4fd3d8['agicommand']]){_0x12e78f=_0x227471[_0x4fd3d8[_0x35fc('0x49')]](_0x4fd3d8);if(_0x12e78f){logger['debug']('response',getLogFromObject(_0x12e78f));return _[_0x35fc('0x43')](_0x12e78f[_0x35fc('0x44')])?null:_0x12e78f[_0x35fc('0x44')][_0x35fc('0x45')]();}else{logger[_0x35fc('0xd')](_0x35fc('0x42'),getLogFromObject(_0x12e78f));return null;}}else{logger[_0x35fc('0xd')](_0x35fc('0x4a'));return null;}}catch(_0x4f555f){logger[_0x35fc('0xd')](_0x4f555f[_0x35fc('0xe')]);return null;}});}logger[_0x35fc('0x1b')](util[_0x35fc('0x11')](_0x35fc('0x4b'),_0x37b394[_0x35fc('0x17')],_0x37b394[_0x35fc('0x18')],_0x37b394[_0x35fc('0x19')],_0x37b394[_0x35fc('0x1a')],_0x37b394[_0x35fc('0x1e')]));logger[_0x35fc('0x1b')](util[_0x35fc('0x11')](_0x35fc('0x4c'),_0x37b394[_0x35fc('0x3f')],_0x37b394['extension'],parseInt(_0x37b394['priority'],0xa)+0x1));_0x37b394[_0x35fc('0x4d')](_0x37b394[_0x35fc('0x3f')],_0x37b394[_0x35fc('0x40')],parseInt(_0x37b394[_0x35fc('0x41')],0xa)+0x1);_0x37b394[_0x35fc('0x33')]();}}else{logger[_0x35fc('0xd')](util['format']('Project\x20%s\x20not\x20published',_0x37b394[_0x35fc('0x17')]));_0x37b394[_0x35fc('0x4d')](_0x37b394[_0x35fc('0x3f')],_0x37b394[_0x35fc('0x40')],parseInt(_0x37b394['priority'],0xa)+0x1);_0x37b394[_0x35fc('0x33')]();}}else{logger[_0x35fc('0xd')](util['format'](_0x35fc('0x4e'),_0x37b394[_0x35fc('0x17')]));_0x37b394['continueAt'](_0x37b394[_0x35fc('0x3f')],_0x37b394[_0x35fc('0x40')],parseInt(_0x37b394[_0x35fc('0x41')],0xa)+0x1);_0x37b394[_0x35fc('0x33')]();}}function main(){var _0x5e4018;return utilLicense['getLicense']()['then'](function(_0x240338){if(_0x240338){if(_0x240338[_0x35fc('0x4f')]){if(_0x240338['callysquare']&&_0x240338[_0x35fc('0x50')]>0x0){logger[_0x35fc('0x1b')](util[_0x35fc('0x11')](_0x35fc('0x51'),_0x240338[_0x35fc('0x50')]));_0x5e4018=_0x240338['callysquare'];}else{logger[_0x35fc('0x1b')](_0x35fc('0x52'));}}else{logger[_0x35fc('0x1b')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x5e4018=-0x1;}}})[_0x35fc('0x2c')](function(_0x1dbf5a){logger['error'](_0x35fc('0x53'),_0x1dbf5a[_0x35fc('0xe')]);})[_0x35fc('0x47')](function(){var _0x1c4c33=require(_0x35fc('0x54'))(config[_0x35fc('0x6')][_0x35fc('0x10')],config[_0x35fc('0x6')]['ip'],_0x5e4018);_0x1c4c33['on']('error',errorHandler);_0x1c4c33['on'](_0x35fc('0x55'),listeningHandler);_0x1c4c33['on'](_0x35fc('0x56'),connectionHandler);_0x1c4c33['on'](_0x35fc('0x33'),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 e1ef98b..282a751 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 _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x220457,_0x556a88){var _0x4bfa6b=function(_0x4c131a){while(--_0x4c131a){_0x220457['push'](_0x220457['shift']());}};_0x4bfa6b(++_0x556a88);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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(_0xf03bbc,_0x3b1bb0){var _0x3049e0=function(_0x317d2e){while(--_0x317d2e){_0xf03bbc['push'](_0xf03bbc['shift']());}};_0x3049e0(++_0x3b1bb0);}(_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/agi/reply.js b/server/services/agi/reply.js index b996634..5f9e62e 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 _0x7a54=['substring','length','split','indexOf','slice','trim','emit','util','stream','Transform','call','_localBuffer','inherits','prototype','_transform','toString','_inBody'];(function(_0x542a26,_0x4ad587){var _0x19b9fd=function(_0x4ed263){while(--_0x4ed263){_0x542a26['push'](_0x542a26['shift']());}};_0x19b9fd(++_0x4ad587);}(_0x7a54,0x106));var _0x47a5=function(_0x1fd0f8,_0x48d5db){_0x1fd0f8=_0x1fd0f8-0x0;var _0x96fd91=_0x7a54[_0x1fd0f8];return _0x96fd91;};'use strict';var util=require(_0x47a5('0x0'));var Transform=require(_0x47a5('0x1'))[_0x47a5('0x2')];function AGIReply(_0x58157c){Transform[_0x47a5('0x3')](this,_0x58157c);this[_0x47a5('0x4')]='';this['_inBody']=![];}util[_0x47a5('0x5')](AGIReply,Transform);AGIReply[_0x47a5('0x6')][_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){var _0x3d5629='\x0a',_0x59199c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x343372=-0x1,_0x30e405=-0x1,_0x506eda='',_0x194fb0=0x0,_0x5077f3='',_0x5d90b3='';this[_0x47a5('0x4')]+=_0x3717e1[_0x47a5('0x8')]();_0x5077f3=this['_localBuffer'];if(!this[_0x47a5('0x9')]){_0x194fb0=0x0;while(_0x59199c[_0x194fb0]){while((_0x30e405=_0x5077f3['indexOf'](_0x59199c[_0x194fb0]))!=-0x1){_0x506eda=_0x59199c[_0x194fb0];_0x5d90b3=_0x5077f3['substring'](0x0,_0x30e405);_0x5077f3=_0x5077f3[_0x47a5('0xa')](_0x30e405+_0x506eda[_0x47a5('0xb')]);var _0x2f399b=_0x5d90b3[_0x47a5('0xc')](_0x3d5629),_0x250fad=0x0,_0xd612dd={},_0xd308b8='',_0x1eae59='',_0x5beb89=-0x1;while(_0x2f399b[_0x250fad]){_0x5beb89=_0x2f399b[_0x250fad][_0x47a5('0xd')](':');if(_0x5beb89!=-0x1){_0xd308b8=_0x2f399b[_0x250fad][_0x47a5('0xe')](0x0,_0x5beb89)[_0x47a5('0xf')]();_0x1eae59=_0x2f399b[_0x250fad][_0x47a5('0xe')](_0x5beb89+0x1)[_0x47a5('0xf')]();if(_0xd308b8[_0x47a5('0xb')]>0x0){_0xd612dd[_0xd308b8]=_0x1eae59;}}else{}_0x250fad++;}this[_0x47a5('0x10')]('headers',_0xd612dd);this[_0x47a5('0x9')]=!![];}_0x194fb0++;}this[_0x47a5('0x4')]=_0x5077f3;}else{while((_0x343372=_0x5077f3[_0x47a5('0xd')](_0x3d5629))!=-0x1){_0x5d90b3=_0x5077f3[_0x47a5('0xa')](0x0,_0x343372);this[_0x47a5('0x10')]('line',_0x5d90b3);_0x5077f3=_0x5077f3['substring'](_0x343372+_0x3d5629[_0x47a5('0xb')]);}this['_localBuffer']=_0x5077f3;}_0x545a97();};module['exports']=AGIReply; \ No newline at end of file +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(_0x34b87f,_0x28aef2){var _0x449805=function(_0x3735b7){while(--_0x3735b7){_0x34b87f['push'](_0x34b87f['shift']());}};_0x449805(++_0x28aef2);}(_0xb10b,0x12a));var _0xbb10=function(_0x187842,_0x58331c){_0x187842=_0x187842-0x0;var _0x5dbcf3=_0xb10b[_0x187842];return _0x5dbcf3;};'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 diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index d01353f..5015409 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 _0xc674=['then','error','message','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','request'];(function(_0x1f5c6f,_0x53b422){var _0x1d8e5c=function(_0x3f5cbc){while(--_0x3f5cbc){_0x1f5c6f['push'](_0x1f5c6f['shift']());}};_0x1d8e5c(++_0x53b422);}(_0xc674,0xe8));var _0x4c67=function(_0x46cf00,_0x457a43){_0x46cf00=_0x46cf00-0x0;var _0x3974dc=_0xc674[_0x46cf00];return _0x3974dc;};'use strict';var BPromise=require(_0x4c67('0x0'));var moment=require(_0x4c67('0x1'));var _=require(_0x4c67('0x2'));var util=require(_0x4c67('0x3'));var jayson=require(_0x4c67('0x4'));var client=jayson[_0x4c67('0x5')][_0x4c67('0x6')]({'port':0x2329});function request(_0x53dbc5,_0x340ff4){return new BPromise(function(_0x5df6dd,_0xf5a775){return client[_0x4c67('0x7')](_0x53dbc5,_0x340ff4)[_0x4c67('0x8')](function(_0x4ee900){if(_0x4ee900['error']){return _0xf5a775(_0x4ee900[_0x4c67('0x9')][_0x4c67('0xa')]);}else{return _0x5df6dd(_0x4ee900['result']);}})['catch'](function(_0x45dafb){return _0xf5a775(_0x45dafb);});});}exports[_0x4c67('0xb')]=function(_0x495ad2){return request(_0x4c67('0xc'),{'options':{'raw':![],'where':{'name':_0x495ad2},'attributes':['production']}});};exports[_0x4c67('0xd')]=function(_0x4cea99){return request(_0x4c67('0xe'),{'options':{'raw':![],'where':{'id':_0x4cea99},'include':[{'model':_0x4c67('0xf'),'as':_0x4c67('0x10')}],'attributes':['id',_0x4c67('0x11'),_0x4c67('0x12')]}});};exports[_0x4c67('0x13')]=function(_0x59fa4a){return request(_0x4c67('0xc'),{'options':{'where':{'id':_0x59fa4a},'attributes':[_0x4c67('0x11')]}});};exports[_0x4c67('0x14')]=function(_0x5535e5){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x5535e5},'attributes':[_0x4c67('0x11')]}});};exports[_0x4c67('0x15')]=function(_0x4d8e74){return request('ShowVariable',{'options':{'where':{'id':_0x4d8e74},'attributes':[_0x4c67('0x11')]}});};exports[_0x4c67('0x16')]=function(_0x617aaf){return request(_0x4c67('0x17'),{'options':{'where':{'id':_0x617aaf},'attributes':[_0x4c67('0x18')]}});};exports[_0x4c67('0x19')]=function(_0x33c981){return request(_0x4c67('0x1a'),{'options':{'where':{'id':_0x33c981},'attributes':[_0x4c67('0x11')]}});};exports[_0x4c67('0x1b')]=function(_0x5c5d49){return request('ShowTrunk',{'options':{'where':{'id':_0x5c5d49},'attributes':[_0x4c67('0x11')]}});};exports[_0x4c67('0x1c')]=function(_0x5c062c){return request(_0x4c67('0x1d'),{'options':{'where':{'id':_0x5c062c},'attributes':[_0x4c67('0x1e')]}});};exports[_0x4c67('0x1f')]=function(_0x162791){return request(_0x4c67('0x20'),{'options':{'raw':![],'where':{'id':_0x162791},'include':[{'model':_0x4c67('0x21'),'as':_0x4c67('0x22')}]}});};exports[_0x4c67('0x23')]=function(_0x5a96c8){return request(_0x4c67('0x24'),{'options':{'where':{'id':_0x5a96c8},'attributes':['id',_0x4c67('0x11')]}});};exports[_0x4c67('0x25')]=function(_0x2fe2ae){return request('CreateSmsMessage',{'body':_0x2fe2ae});};exports['createSquareDetailsReport']=function(_0x44a0b1){return request(_0x4c67('0x26'),{'body':_0x44a0b1});};exports[_0x4c67('0x27')]=function(_0x3d14a8){return request('CreateSquareReport',{'body':_[_0x4c67('0x28')](_0x3d14a8,{'project_name':_0x3d14a8[_0x4c67('0x29')],'prev_project_name':_0x3d14a8['arg_2']||'','is_subproject':_0x3d14a8[_0x4c67('0x2a')]?!![]:![],'leaveAt':moment()[_0x4c67('0x2b')](_0x4c67('0x2c'))})});};exports[_0x4c67('0x2d')]=function(_0x38f684){return request(_0x4c67('0x2e'),{'body':_0x38f684});};exports['createSquareMessage']=function(_0x43b09d){return request(_0x4c67('0x2f'),{'body':_0x43b09d});};exports[_0x4c67('0x30')]=function(_0x3a5406){return request(_0x4c67('0x31'),{'options':{'raw':![],'where':{'phone':_0x3a5406['phone'],'ListId':_0x3a5406[_0x4c67('0x32')]}}})[_0x4c67('0x8')](function(_0x5e4628){if(_0x5e4628){return _0x5e4628;}return request(_0x4c67('0x33'),{'body':_0x3a5406});});};exports[_0x4c67('0x34')]=function(_0x4b0191){return request(_0x4c67('0x35'),{'options':{'where':{'id':_0x4b0191},'attributes':[_0x4c67('0x11')]}});};exports[_0x4c67('0x36')]=function(_0x54bef8,_0x2a9403){return request(_0x4c67('0x37'),{'body':{'interface':_0x2a9403},'options':{'where':_0x54bef8}});};exports[_0x4c67('0x38')]=function(_0x3d0ac1,_0x349dd6,_0x2d0625){return request(_0x4c67('0x39'),{'body':{'type':_0x349dd6,'uniqueid':_0x2d0625},'options':{'where':_0x3d0ac1}});};exports['agentUnpause']=function(_0x174dc0){return request(_0x4c67('0x3a'),{'body':{},'options':{'where':_0x174dc0}});};exports['agentLogout']=function(_0x16cffb){return request(_0x4c67('0x3b'),{'body':{},'options':{'where':_0x16cffb}});}; \ No newline at end of file +var _0xa515=['ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','phone','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','UnpauseUser','agentLogout','bluebird','moment','lodash','util','client','http','request','error','message','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser'];(function(_0x1997f4,_0x3bd811){var _0x365e73=function(_0x586e1c){while(--_0x586e1c){_0x1997f4['push'](_0x1997f4['shift']());}};_0x365e73(++_0x3bd811);}(_0xa515,0x108));var _0x5a51=function(_0xf611e4,_0x536cfa){_0xf611e4=_0xf611e4-0x0;var _0x35ec84=_0xa515[_0xf611e4];return _0x35ec84;};'use strict';var BPromise=require(_0x5a51('0x0'));var moment=require(_0x5a51('0x1'));var _=require(_0x5a51('0x2'));var util=require(_0x5a51('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x5a51('0x4')][_0x5a51('0x5')]({'port':0x2329});function request(_0x12b249,_0x5cd4f4){return new BPromise(function(_0x2b0a61,_0x4c6322){return client[_0x5a51('0x6')](_0x12b249,_0x5cd4f4)['then'](function(_0x152850){if(_0x152850['error']){return _0x4c6322(_0x152850[_0x5a51('0x7')][_0x5a51('0x8')]);}else{return _0x2b0a61(_0x152850['result']);}})[_0x5a51('0x9')](function(_0x564666){return _0x4c6322(_0x564666);});});}exports[_0x5a51('0xa')]=function(_0x5547ee){return request(_0x5a51('0xb'),{'options':{'raw':![],'where':{'name':_0x5547ee},'attributes':[_0x5a51('0xc')]}});};exports[_0x5a51('0xd')]=function(_0xca6332){return request(_0x5a51('0xe'),{'options':{'raw':![],'where':{'id':_0xca6332},'include':[{'model':_0x5a51('0xf'),'as':_0x5a51('0x10')}],'attributes':['id',_0x5a51('0x11'),'email']}});};exports[_0x5a51('0x12')]=function(_0xa6d7ac){return request(_0x5a51('0xb'),{'options':{'where':{'id':_0xa6d7ac},'attributes':[_0x5a51('0x11')]}});};exports[_0x5a51('0x13')]=function(_0x2301b4){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x2301b4},'attributes':[_0x5a51('0x11')]}});};exports[_0x5a51('0x14')]=function(_0x51b0d5){return request(_0x5a51('0x15'),{'options':{'where':{'id':_0x51b0d5},'attributes':[_0x5a51('0x11')]}});};exports[_0x5a51('0x16')]=function(_0x811489){return request(_0x5a51('0x17'),{'options':{'where':{'id':_0x811489},'attributes':['dsn']}});};exports[_0x5a51('0x18')]=function(_0x5119df){return request(_0x5a51('0x19'),{'options':{'where':{'id':_0x5119df},'attributes':[_0x5a51('0x11')]}});};exports['getTrunkById']=function(_0x2f8760){return request(_0x5a51('0x1a'),{'options':{'where':{'id':_0x2f8760},'attributes':['name']}});};exports[_0x5a51('0x1b')]=function(_0x1df2f3){return request(_0x5a51('0x1c'),{'options':{'where':{'id':_0x1df2f3},'attributes':[_0x5a51('0x1d')]}});};exports[_0x5a51('0x1e')]=function(_0x848dc1){return request(_0x5a51('0x1f'),{'options':{'raw':![],'where':{'id':_0x848dc1},'include':[{'model':_0x5a51('0x20'),'as':_0x5a51('0x21')}]}});};exports[_0x5a51('0x22')]=function(_0x4aeca8){return request(_0x5a51('0x23'),{'options':{'where':{'id':_0x4aeca8},'attributes':['id',_0x5a51('0x11')]}});};exports['createSmsMessage']=function(_0x396298){return request(_0x5a51('0x24'),{'body':_0x396298});};exports['createSquareDetailsReport']=function(_0x5efa19){return request(_0x5a51('0x25'),{'body':_0x5efa19});};exports[_0x5a51('0x26')]=function(_0x39956d){return request(_0x5a51('0x27'),{'body':_[_0x5a51('0x28')](_0x39956d,{'project_name':_0x39956d['arg_1'],'prev_project_name':_0x39956d['arg_2']||'','is_subproject':_0x39956d[_0x5a51('0x29')]?!![]:![],'leaveAt':moment()[_0x5a51('0x2a')](_0x5a51('0x2b'))})});};exports[_0x5a51('0x2c')]=function(_0x30f0eb){return request(_0x5a51('0x2d'),{'body':_0x30f0eb});};exports['createSquareMessage']=function(_0x12a594){return request(_0x5a51('0x2e'),{'body':_0x12a594});};exports[_0x5a51('0x2f')]=function(_0x4374b5){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x4374b5[_0x5a51('0x30')],'ListId':_0x4374b5[_0x5a51('0x31')]}}})[_0x5a51('0x32')](function(_0x4a7fb2){if(_0x4a7fb2){return _0x4a7fb2;}return request(_0x5a51('0x33'),{'body':_0x4374b5});});};exports[_0x5a51('0x34')]=function(_0x229eaf){return request(_0x5a51('0x35'),{'options':{'where':{'id':_0x229eaf},'attributes':[_0x5a51('0x11')]}});};exports[_0x5a51('0x36')]=function(_0x4775f7,_0x14da12){return request('LoginUser',{'body':{'interface':_0x14da12},'options':{'where':_0x4775f7}});};exports[_0x5a51('0x37')]=function(_0x2e36a0,_0x2f00fd,_0x1a0aa7){return request('PauseUser',{'body':{'type':_0x2f00fd,'uniqueid':_0x1a0aa7},'options':{'where':_0x2e36a0}});};exports['agentUnpause']=function(_0x136594){return request(_0x5a51('0x38'),{'body':{},'options':{'where':_0x136594}});};exports[_0x5a51('0x39')]=function(_0x2b8d28){return request('LogoutUser',{'body':{},'options':{'where':_0x2b8d28}});}; \ 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 20191fe..8f06f27 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 _0xbd50=['exports','./polly','./lex'];(function(_0x572da7,_0x240dcb){var _0x13aeec=function(_0x2d03e2){while(--_0x2d03e2){_0x572da7['push'](_0x572da7['shift']());}};_0x13aeec(++_0x240dcb);}(_0xbd50,0x196));var _0x0bd5=function(_0x4d6c87,_0x3ec771){_0x4d6c87=_0x4d6c87-0x0;var _0x2988fb=_0xbd50[_0x4d6c87];return _0x2988fb;};var polly=require(_0x0bd5('0x0'));var lex=require(_0x0bd5('0x1'));module[_0x0bd5('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x57d4=['./polly','./lex'];(function(_0xbd7498,_0x417297){var _0x22920a=function(_0x55f2ea){while(--_0x55f2ea){_0xbd7498['push'](_0xbd7498['shift']());}};_0x22920a(++_0x417297);}(_0x57d4,0x78));var _0x457d=function(_0x144ec5,_0x3d6022){_0x144ec5=_0x144ec5-0x0;var _0x18f948=_0x57d4[_0x144ec5];return _0x18f948;};var polly=require(_0x457d('0x0'));var lex=require(_0x457d('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 217f3f1..1ce50db 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 _0x6953=['exports','./lib/api'];(function(_0x126977,_0x25df7f){var _0x15e83e=function(_0xcaa3b9){while(--_0xcaa3b9){_0x126977['push'](_0x126977['shift']());}};_0x15e83e(++_0x25df7f);}(_0x6953,0x91));var _0x3695=function(_0x1bf6a9,_0x31b0d0){_0x1bf6a9=_0x1bf6a9-0x0;var _0x402296=_0x6953[_0x1bf6a9];return _0x402296;};'use strict';var lex=require(_0x3695('0x0'));module[_0x3695('0x1')]=function(_0x4f40b5,_0x56a828,_0x53e2fa,_0x402642,_0x550d98,_0x275b95){return lex(_0x4f40b5,_0x56a828,_0x53e2fa,_0x402642,_0x550d98,_0x275b95);}; \ No newline at end of file +var _0x063c=['exports'];(function(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0x063c,0xba));var _0xc063=function(_0x3cfcc5,_0x35ebe9){_0x3cfcc5=_0x3cfcc5-0x0;var _0x1d7335=_0x063c[_0x3cfcc5];return _0x1d7335;};'use strict';var lex=require('./lib/api');module[_0xc063('0x0')]=function(_0x3e8b5f,_0x1ca192,_0x25e61c,_0x314f1b,_0x33d075,_0x5aa766){return lex(_0x3e8b5f,_0x1ca192,_0x25e61c,_0x314f1b,_0x33d075,_0x5aa766);}; \ 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 2cb9acf..0d3760e 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 _0xeaf4=['LexRuntime','$LATEST','bluebird','aws-sdk','postText','slots','slot_','exports'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xeaf4,0xfa));var _0x4eaf=function(_0x19bea8,_0x2d82bc){_0x19bea8=_0x19bea8-0x0;var _0x3745a8=_0xeaf4[_0x19bea8];return _0x3745a8;};'use strict';var BPromise=require(_0x4eaf('0x0'));var AWS=require(_0x4eaf('0x1'));function lexResult(_0x283881,_0xec09c9){return new BPromise(function(_0xb790a4,_0x3b67d7){_0x283881[_0x4eaf('0x2')](_0xec09c9,function(_0x14d2e9,_0x39d38b){if(_0x14d2e9){_0x3b67d7(_0x14d2e9);}if(_0x39d38b[_0x4eaf('0x3')]){for(const _0x525e5e in _0x39d38b[_0x4eaf('0x3')]){if(_0x39d38b[_0x4eaf('0x3')]['hasOwnProperty'](_0x525e5e)){var _0x431b72=_0x39d38b['slots'][_0x525e5e];_0x39d38b[_0x4eaf('0x4')+_0x525e5e]=_0x431b72;}}}_0xb790a4(_0x39d38b);});});}module[_0x4eaf('0x5')]=function(_0x38ebcd,_0x319bcf,_0xd75c16,_0x49ec41,_0x5c9624,_0x43c74a){var _0x5f0ae1=new AWS[(_0x4eaf('0x6'))]({'accessKeyId':_0x319bcf,'secretAccessKey':_0xd75c16,'region':_0x49ec41});var _0x4414fc={'botAlias':_0x4eaf('0x7'),'botName':_0x43c74a,'inputText':_0x5c9624,'userId':_0x38ebcd};return lexResult(_0x5f0ae1,_0x4414fc);}; \ No newline at end of file +var _0xea48=['exports','LexRuntime','bluebird','aws-sdk','postText','slots','hasOwnProperty'];(function(_0x42d94a,_0x2c287d){var _0x4a6f15=function(_0x58aa49){while(--_0x58aa49){_0x42d94a['push'](_0x42d94a['shift']());}};_0x4a6f15(++_0x2c287d);}(_0xea48,0x167));var _0x8ea4=function(_0x576e34,_0x7bd36f){_0x576e34=_0x576e34-0x0;var _0x340feb=_0xea48[_0x576e34];return _0x340feb;};'use strict';var BPromise=require(_0x8ea4('0x0'));var AWS=require(_0x8ea4('0x1'));function lexResult(_0x501171,_0x1e1a15){return new BPromise(function(_0x561fe2,_0x35fb1a){_0x501171[_0x8ea4('0x2')](_0x1e1a15,function(_0x16b1a9,_0x2c9bab){if(_0x16b1a9){_0x35fb1a(_0x16b1a9);}if(_0x2c9bab[_0x8ea4('0x3')]){for(const _0x2d3522 in _0x2c9bab['slots']){if(_0x2c9bab[_0x8ea4('0x3')][_0x8ea4('0x4')](_0x2d3522)){var _0x15a6a4=_0x2c9bab['slots'][_0x2d3522];_0x2c9bab['slot_'+_0x2d3522]=_0x15a6a4;}}}_0x561fe2(_0x2c9bab);});});}module[_0x8ea4('0x5')]=function(_0x52b786,_0x596746,_0x230fe0,_0x3974a3,_0x1cf34b,_0x36163c){var _0x5b843c=new AWS[(_0x8ea4('0x6'))]({'accessKeyId':_0x596746,'secretAccessKey':_0x230fe0,'region':_0x3974a3});var _0x1482ba={'botAlias':'$LATEST','botName':_0x36163c,'inputText':_0x1cf34b,'userId':_0x52b786};return lexResult(_0x5b843c,_0x1482ba);}; \ 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 2f81b16..5fa2045 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 _0x90b4=['exports'];(function(_0x94efb8,_0xbf7c68){var _0x533e9c=function(_0xecb617){while(--_0xecb617){_0x94efb8['push'](_0x94efb8['shift']());}};_0x533e9c(++_0xbf7c68);}(_0x90b4,0x192));var _0x490b=function(_0x4971eb,_0x5140ea){_0x4971eb=_0x4971eb-0x0;var _0x2a93e1=_0x90b4[_0x4971eb];return _0x2a93e1;};'use strict';var polly=require('./lib/api');module[_0x490b('0x0')]=function(_0x47640c,_0x3147e8,_0xa89891,_0x41aab9,_0x3bada6,_0x53361d,_0x483daa){return polly(_0x47640c,_0x3147e8,_0xa89891,_0x41aab9,_0x3bada6,_0x53361d,_0x483daa);}; \ No newline at end of file +var _0x48a3=['exports'];(function(_0x53f05d,_0x8b6dca){var _0x39715b=function(_0x5908ee){while(--_0x5908ee){_0x53f05d['push'](_0x53f05d['shift']());}};_0x39715b(++_0x8b6dca);}(_0x48a3,0x198));var _0x348a=function(_0x5eac76,_0x159472){_0x5eac76=_0x5eac76-0x0;var _0x5a151e=_0x48a3[_0x5eac76];return _0x5a151e;};'use strict';var polly=require('./lib/api');module[_0x348a('0x0')]=function(_0x58eba3,_0x2ff618,_0x2e40a2,_0x19205c,_0x81b933,_0x2c9d45,_0x152bb6){return polly(_0x58eba3,_0x2ff618,_0x2e40a2,_0x19205c,_0x81b933,_0x2c9d45,_0x152bb6);}; \ 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 214cd2e..fa44bfd 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 _0xe11a=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','path','randomstring','aws-sdk','synthesizeSpeech','AudioStream'];(function(_0x2634d4,_0x10760f){var _0x223cc1=function(_0x268ecb){while(--_0x268ecb){_0x2634d4['push'](_0x2634d4['shift']());}};_0x223cc1(++_0x10760f);}(_0xe11a,0x1e1));var _0xae11=function(_0x15df4d,_0x467f73){_0x15df4d=_0x15df4d-0x0;var _0x49ddfb=_0xe11a[_0x15df4d];return _0x49ddfb;};'use strict';var fs=require('fs');var path=require(_0xae11('0x0'));var BPromise=require('bluebird');var rs=require(_0xae11('0x1'));var AWS=require(_0xae11('0x2'));function pollyResult(_0xd5f858,_0x338633,_0x934109){return new BPromise(function(_0x2ebbfc,_0x9eb6b6){_0xd5f858[_0xae11('0x3')](_0x338633,function(_0x71a553,_0x14ef5a){if(_0x71a553){_0x9eb6b6(_0x71a553);}else if(_0x14ef5a){if(_0x14ef5a['AudioStream']instanceof Buffer){fs['writeFile'](_0x934109,_0x14ef5a[_0xae11('0x4')],function(_0x520579){if(_0x520579){_0x9eb6b6(_0x520579);}else{_0x2ebbfc();}});}else{_0x9eb6b6(new Error(_0xae11('0x5')));}}else{_0x9eb6b6(new Error(_0xae11('0x6')));}});});}module['exports']=function(_0x26d761,_0x117ec5,_0x5722f8,_0x3411ef,_0x340f0a,_0x4022b9,_0x1a736c){var _0x4707c=new AWS[(_0xae11('0x7'))]({'accessKeyId':_0x26d761,'secretAccessKey':_0x117ec5,'region':_0x5722f8});var _0x2ee42e={'Text':_0x340f0a,'TextType':_0x4022b9||_0xae11('0x8'),'OutputFormat':'mp3','VoiceId':_0x3411ef};return pollyResult(_0x4707c,_0x2ee42e,_0x1a736c);}; \ No newline at end of file +var _0x54c2=['path','randomstring','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3'];(function(_0x55e4fb,_0x4cae1d){var _0x9defb0=function(_0x2f6ab7){while(--_0x2f6ab7){_0x55e4fb['push'](_0x55e4fb['shift']());}};_0x9defb0(++_0x4cae1d);}(_0x54c2,0x118));var _0x254c=function(_0x561049,_0x330926){_0x561049=_0x561049-0x0;var _0x52f109=_0x54c2[_0x561049];return _0x52f109;};'use strict';var fs=require('fs');var path=require(_0x254c('0x0'));var BPromise=require('bluebird');var rs=require(_0x254c('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x25bcff,_0x3e3423,_0x5bdfab){return new BPromise(function(_0x440e84,_0xe940c6){_0x25bcff['synthesizeSpeech'](_0x3e3423,function(_0x349b1,_0x1f1a11){if(_0x349b1){_0xe940c6(_0x349b1);}else if(_0x1f1a11){if(_0x1f1a11[_0x254c('0x2')]instanceof Buffer){fs['writeFile'](_0x5bdfab,_0x1f1a11[_0x254c('0x2')],function(_0x27c057){if(_0x27c057){_0xe940c6(_0x27c057);}else{_0x440e84();}});}else{_0xe940c6(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0xe940c6(new Error(_0x254c('0x3')));}});});}module[_0x254c('0x4')]=function(_0x532607,_0x2c9944,_0x347415,_0x514eba,_0x57d529,_0x1bcc42,_0xa363be){var _0x278f93=new AWS[(_0x254c('0x5'))]({'accessKeyId':_0x532607,'secretAccessKey':_0x2c9944,'region':_0x347415});var _0x3d7f6b={'Text':_0x57d529,'TextType':_0x1bcc42||_0x254c('0x6'),'OutputFormat':_0x254c('0x7'),'VoiceId':_0x514eba};return pollyResult(_0x278f93,_0x3d7f6b,_0xa363be);}; \ 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 231dc96..6f62411 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 _0x4023=['./lib/api','exports'];(function(_0x109a79,_0x2423c1){var _0x820e1a=function(_0x310558){while(--_0x310558){_0x109a79['push'](_0x109a79['shift']());}};_0x820e1a(++_0x2423c1);}(_0x4023,0x9e));var _0x3402=function(_0x4d6c04,_0x525084){_0x4d6c04=_0x4d6c04-0x0;var _0x1a96bd=_0x4023[_0x4d6c04];return _0x1a96bd;};'use strict';var asr=require(_0x3402('0x0'));module[_0x3402('0x1')]=function(_0x110a10,_0x1f9fc7,_0x59b6f9,_0x168e65){return asr(_0x110a10,_0x1f9fc7,_0x59b6f9);}; \ No newline at end of file +var _0x8d20=['exports','./lib/api'];(function(_0x4ea444,_0x56dde4){var _0x52b1e0=function(_0x53c37c){while(--_0x53c37c){_0x4ea444['push'](_0x4ea444['shift']());}};_0x52b1e0(++_0x56dde4);}(_0x8d20,0x18d));var _0x08d2=function(_0x36e246,_0x837017){_0x36e246=_0x36e246-0x0;var _0xbfed99=_0x8d20[_0x36e246];return _0xbfed99;};'use strict';var asr=require(_0x08d2('0x0'));module[_0x08d2('0x1')]=function(_0x3222a4,_0x682ea0,_0x51c044,_0x262af2){return asr(_0x3222a4,_0x682ea0,_0x51c044);}; \ 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 d5374ed..2c75b19 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 _0x3ea2=['base64','POST','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string','filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync'];(function(_0x5690f9,_0x293194){var _0x2ac417=function(_0x1bf40){while(--_0x1bf40){_0x5690f9['push'](_0x5690f9['shift']());}};_0x2ac417(++_0x293194);}(_0x3ea2,0xab));var _0x23ea=function(_0x875110,_0x7873af){_0x875110=_0x875110-0x0;var _0x39758a=_0x3ea2[_0x875110];return _0x39758a;};'use strict';var url=require(_0x23ea('0x0'));var BPromise=require(_0x23ea('0x1'));var fs=require('fs');var host=_0x23ea('0x2');module[_0x23ea('0x3')]=function(_0x1f9431,_0x14879d,_0x1fae24){return new BPromise(function(_0x482369,_0x2cd79b){var _0x526d2a;if(typeof _0x1f9431!==_0x23ea('0x4')||_0x1f9431['length']===0x0){return _0x2cd79b(_0x23ea('0x5'));}if(typeof _0x14879d!==_0x23ea('0x4')||_0x14879d[_0x23ea('0x6')]===0x0){return _0x2cd79b(_0x23ea('0x7'));}if(typeof _0x1fae24!==_0x23ea('0x8')&&(typeof _0x1fae24!==_0x23ea('0x4')||_0x1fae24['length']===0x0)){return _0x2cd79b(_0x23ea('0x9'));}try{_0x526d2a=fs[_0x23ea('0xa')](_0x1f9431)['toString'](_0x23ea('0xb'));}catch(_0x4ecec3){return _0x2cd79b(_0x4ecec3);}return _0x482369({'method':_0x23ea('0xc'),'uri':host+'/v1/speech:recognize?key='+_0x14879d,'body':{'config':{'encoding':_0x23ea('0xd'),'sampleRateHertz':'8000','languageCode':_0x1fae24},'audio':{'content':_0x526d2a}},'json':!![]});});}; \ No newline at end of file +var _0x9fba=['base64','POST','/v1/speech:recognize?key=','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString'];(function(_0x247447,_0x407294){var _0x58463a=function(_0x3c0a53){while(--_0x3c0a53){_0x247447['push'](_0x247447['shift']());}};_0x58463a(++_0x407294);}(_0x9fba,0x78));var _0xa9fb=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x9fba[_0x4ae625];return _0x31accf;};'use strict';var url=require(_0xa9fb('0x0'));var BPromise=require(_0xa9fb('0x1'));var fs=require('fs');var host=_0xa9fb('0x2');module[_0xa9fb('0x3')]=function(_0x4571fd,_0x3dd2ae,_0x4dda2c){return new BPromise(function(_0x456af1,_0x1f6b23){var _0x54cce2;if(typeof _0x4571fd!==_0xa9fb('0x4')||_0x4571fd[_0xa9fb('0x5')]===0x0){return _0x1f6b23(_0xa9fb('0x6'));}if(typeof _0x3dd2ae!=='string'||_0x3dd2ae[_0xa9fb('0x5')]===0x0){return _0x1f6b23('key\x20should\x20be\x20a\x20string');}if(typeof _0x4dda2c!==_0xa9fb('0x7')&&(typeof _0x4dda2c!==_0xa9fb('0x4')||_0x4dda2c[_0xa9fb('0x5')]===0x0)){return _0x1f6b23(_0xa9fb('0x8'));}try{_0x54cce2=fs['readFileSync'](_0x4571fd)[_0xa9fb('0x9')](_0xa9fb('0xa'));}catch(_0x40bf12){return _0x1f6b23(_0x40bf12);}return _0x456af1({'method':_0xa9fb('0xb'),'uri':host+_0xa9fb('0xc')+_0x3dd2ae,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x4dda2c},'audio':{'content':_0x54cce2}},'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 0170b40..7b62253 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 _0x42e1=['exports','./asr'];(function(_0x4a3553,_0x12e68f){var _0x569d42=function(_0x28860d){while(--_0x28860d){_0x4a3553['push'](_0x4a3553['shift']());}};_0x569d42(++_0x12e68f);}(_0x42e1,0xbf));var _0x142e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x42e1[_0x311c35];return _0x5cc50c;};var asr=require(_0x142e('0x0'));module[_0x142e('0x1')]={'asr':asr}; \ No newline at end of file +var _0x1c2f=['exports','./asr'];(function(_0x42a2c3,_0x2faf01){var _0x21af54=function(_0x27c06e){while(--_0x27c06e){_0x42a2c3['push'](_0x42a2c3['shift']());}};_0x21af54(++_0x2faf01);}(_0x1c2f,0x1c3));var _0xf1c2=function(_0x6aaf54,_0x52c37a){_0x6aaf54=_0x6aaf54-0x0;var _0x19baec=_0x1c2f[_0x6aaf54];return _0x19baec;};var asr=require(_0xf1c2('0x0'));module[_0xf1c2('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index f6af0b9..55100bf 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 _0x7db1=['host','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','error','download\x20error','pipe','end','WHAT_EVER','data','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','chmodSync','777','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','text:synthesize','POST','then','.mp3','audioContent','writeFile','googleTTS','unlink','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','action','fulfillment','speech','status','code','metadata','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','awsLex','lex','stringify','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','freeform=3','parse','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','bluebird','sox','request-promise','util','moment','google-tts-api','./aws','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:'];(function(_0x532ce9,_0x7057e1){var _0x2a7c5c=function(_0x399e06){while(--_0x399e06){_0x532ce9['push'](_0x532ce9['shift']());}};_0x2a7c5c(++_0x7057e1);}(_0x7db1,0xc0));var _0x17db=function(_0x400da3,_0x55d4fa){_0x400da3=_0x400da3-0x0;var _0x1c7073=_0x7db1[_0x400da3];return _0x1c7073;};'use strict';var fs=require('fs');var path=require(_0x17db('0x0'));var http=require('http');var https=require('https');var urlParse=require('url')['parse'];var BPromise=require(_0x17db('0x1'));var rs=require('randomstring');var sox=require(_0x17db('0x2'));var rp=require(_0x17db('0x3'));var util=require(_0x17db('0x4'));var querystring=require('querystring');var moment=require(_0x17db('0x5'));var tts=require(_0x17db('0x6'));var apiai=require('apiai-promise');var md5=require('md5');var google=require('./google');var aws=require(_0x17db('0x7'));var tilde=require(_0x17db('0x8'));var sestek=require('./sestek');var logger=require(_0x17db('0x9'))(_0x17db('0xa'));var ISPEECH_API=_0x17db('0xb');function downloadFile(_0x108127,_0x4029bc){return new BPromise(function(_0x4d2c3f,_0x538ecb){var _0x1189af=urlParse(_0x108127);var _0x280e9f=_0x1189af[_0x17db('0xc')]===_0x17db('0xd')?https:http;var _0x3bfe2c={'host':_0x1189af[_0x17db('0xe')],'path':_0x1189af[_0x17db('0x0')],'headers':{'user-agent':'WHAT_EVER'}};_0x280e9f[_0x17db('0xf')](_0x3bfe2c,function(_0x3f8cec){if(_0x3f8cec[_0x17db('0x10')]!==0xc8){logger['error'](_0x17db('0x11')+_0x108127+_0x17db('0x12')+_0x3f8cec[_0x17db('0x10')]+'\x20('+_0x3f8cec['statusMessage']+')');_0x538ecb(new Error(_0x17db('0x11')+_0x108127+_0x17db('0x12')+_0x3f8cec['statusCode']+'\x20('+_0x3f8cec[_0x17db('0x13')]+')'));return;}var _0x1eadce=fs[_0x17db('0x14')](_0x4029bc);_0x1eadce['on'](_0x17db('0x15'),function(){logger[_0x17db('0x16')](_0x17db('0x17'));_0x1eadce[_0x17db('0x18')](_0x4d2c3f);});_0x1eadce['on'](_0x17db('0x19'),function(_0x5bccdd){fs['unlink'](_0x4029bc);logger[_0x17db('0x19')](_0x17db('0x1a'),_0x5bccdd);_0x538ecb(_0x5bccdd);});_0x3f8cec[_0x17db('0x1b')](_0x1eadce);})['on'](_0x17db('0x19'),function(_0x5425ba){logger[_0x17db('0x19')](_0x5425ba);_0x538ecb(_0x5425ba);})[_0x17db('0x1c')]();});}function uploadFile(_0xbafcb2){return new BPromise(function(_0x4362e9,_0x7cdca2){var _0x251886=urlParse(_0xbafcb2);var _0x166962=_0x251886[_0x17db('0xc')]==='https:'?https:http;var _0x4ebe49={'host':_0x251886[_0x17db('0xe')],'path':_0x251886[_0x17db('0x0')],'headers':{'user-agent':_0x17db('0x1d')}};_0x166962[_0x17db('0xf')](_0x4ebe49,function(_0x25f8e0){if(_0x25f8e0[_0x17db('0x10')]!==0xc8){_0x7cdca2(new Error(_0x17db('0x11')+_0xbafcb2+_0x17db('0x12')+_0x25f8e0[_0x17db('0x10')]+'\x20('+_0x25f8e0[_0x17db('0x13')]+')'));return;}var _0xd3b2af='';_0x25f8e0['on'](_0x17db('0x1e'),function(_0x24a170){_0xd3b2af+=_0x24a170;});_0x25f8e0['on'](_0x17db('0x1c'),function(){_0x4362e9(_0xd3b2af);});})['on'](_0x17db('0x19'),function(_0x10797b){_0x7cdca2(_0x10797b);})[_0x17db('0x1c')]();});}function convertFile(_0x37288a,_0x3ecb98){return new BPromise(function(_0x3bca92,_0x4ecb6b){var _0x530e0e=sox['transcode'](_0x37288a,_0x3ecb98,{'sampleRate':0x1f40,'format':_0x17db('0x1f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x530e0e['on'](_0x17db('0x19'),function(_0x41831e){logger['error'](_0x17db('0x20'),_0x41831e);_0x4ecb6b(_0x41831e);});_0x530e0e['on'](_0x17db('0x1c'),function(){logger[_0x17db('0x16')](_0x17db('0x21'));_0x3bca92();});_0x530e0e[_0x17db('0x22')]();});}function base64Decode(_0x57ec3d,_0x1f26ad){var _0x52f02e=path[_0x17db('0x23')](__dirname,_0x17db('0x24'),rs[_0x17db('0x25')](0x4)+_0x17db('0x26'));fs[_0x17db('0x27')](_0x52f02e,_0x57ec3d,_0x17db('0x28'));return convertFile(_0x52f02e,_0x1f26ad)['then'](function(){try{fs['unlink'](_0x52f02e);fs[_0x17db('0x29')](_0x1f26ad,_0x17db('0x2a'));}catch(_0x451f8f){logger[_0x17db('0x19')](_0x451f8f);}return _0x1f26ad[_0x17db('0x2b')]('.')[0x0];});}function base64Encode(_0x5e4472){var _0x54d41f=fs[_0x17db('0x2c')](_0x5e4472);return new Buffer(_0x54d41f)[_0x17db('0x2d')]('base64');}exports['googleCloudTTS']=function(_0x3fe82b,_0x527d7f,_0x4cff95,_0x41e060,_0x244f69){var _0x60f086,_0x875cc8;var _0x69a7c4=_0x17db('0x2e');var _0x33da37=_0x17db('0x2f')+_0x3fe82b;var _0x34b91c={'input':{'text':_0x527d7f},'voice':{'languageCode':_0x4cff95,'ssmlGender':_0x41e060},'audioConfig':{'audioEncoding':'MP3','sampleRateHertz':0x1f40}};var _0x30ce69={'url':_0x69a7c4+_0x17db('0x30')+_0x33da37,'method':_0x17db('0x31'),'json':!![],'body':_0x34b91c};return rp(_0x30ce69)[_0x17db('0x32')](function(_0x1eca28){return new BPromise(function(_0x2fde91,_0x237357){_0x60f086=path[_0x17db('0x23')](__dirname,_0x17db('0x24'),rs[_0x17db('0x25')](0x4)+_0x17db('0x33'));var _0x414341=Buffer['from'](_0x1eca28[_0x17db('0x34')],_0x17db('0x28'));return fs[_0x17db('0x35')](_0x60f086,_0x414341,function(_0x5d0ca0){_0x237357(_0x5d0ca0);},function(_0x64bc88){fs['chmodSync'](_0x60f086,_0x17db('0x2a'));_0x2fde91(_0x64bc88);});});})[_0x17db('0x32')](function(_0x407c22){_0x875cc8=path[_0x17db('0x23')](__dirname,_0x17db('0x24'),rs[_0x17db('0x25')](0x4)+_0x17db('0x26'));return convertFile(_0x60f086,_0x875cc8);})['then'](function(){try{fs['unlink'](_0x60f086);fs[_0x17db('0x29')](_0x875cc8,_0x17db('0x2a'));}catch(_0x5c167b){logger[_0x17db('0x19')](_0x5c167b);}logger[_0x17db('0x16')]('googleCloudTTS\x20path',_0x875cc8[_0x17db('0x2b')]('.')[0x0]);return _0x875cc8[_0x17db('0x2b')]('.')[0x0];});};exports[_0x17db('0x36')]=function(_0x4766bf,_0x1fecec){var _0x341182,_0x5c12d6;return tts(_0x4766bf,_0x1fecec||'en',0x1)[_0x17db('0x32')](function(_0x1f5ef5){logger[_0x17db('0x16')](_0x1f5ef5);_0x341182=path[_0x17db('0x23')](__dirname,_0x17db('0x24'),rs[_0x17db('0x25')](0x4)+_0x17db('0x33'));return downloadFile(_0x1f5ef5,_0x341182);})['then'](function(){_0x5c12d6=path['resolve'](__dirname,_0x17db('0x24'),rs[_0x17db('0x25')](0x4)+_0x17db('0x26'));return convertFile(_0x341182,_0x5c12d6);})['then'](function(){try{fs[_0x17db('0x37')](_0x341182);fs[_0x17db('0x29')](_0x5c12d6,_0x17db('0x2a'));}catch(_0x28baa0){logger[_0x17db('0x19')](_0x28baa0);}logger[_0x17db('0x16')](_0x17db('0x38'),_0x5c12d6[_0x17db('0x2b')]('.')[0x0]);return _0x5c12d6[_0x17db('0x2b')]('.')[0x0];});};exports[_0x17db('0x39')]=function(_0x527bee,_0x3169b9,_0xdee4e5){return google[_0x17db('0x3a')](_0x527bee,_0x3169b9,_0xdee4e5)[_0x17db('0x32')](function(_0x700a64){logger[_0x17db('0x16')](_0x700a64[_0x17db('0x3b')]);return rp(_0x700a64);})['then'](function(_0x13ddd1){var _0x2bdd66='';var _0x2418f8=0x0;try{fs['unlink'](_0x527bee);}catch(_0x256c66){logger['error'](_0x256c66);}if(_0x13ddd1&&_0x13ddd1[_0x17db('0x3c')]){_0x2bdd66=_0x13ddd1[_0x17db('0x3c')][_0x17db('0x3d')](function(_0x678445){return _0x678445&&_0x678445[_0x17db('0x3e')][0x0]&&_0x678445[_0x17db('0x3e')][0x0]['transcript']?_0x678445['alternatives'][0x0][_0x17db('0x3f')]:'';})[_0x17db('0x40')]('\x0a');_0x2418f8=_0x13ddd1['results'][_0x17db('0x3d')](function(_0x49aaed){return _0x49aaed&&_0x49aaed[_0x17db('0x3e')][0x0]&&_0x49aaed[_0x17db('0x3e')][0x0][_0x17db('0x41')]?_0x49aaed[_0x17db('0x3e')][0x0][_0x17db('0x41')]:0x0;})[_0x17db('0x40')]('\x0a');}logger[_0x17db('0x16')](_0x17db('0x42'),_0x2bdd66);logger[_0x17db('0x16')](_0x17db('0x43'),_0x2418f8);return{'transcript':_0x2bdd66,'confidence':_0x2418f8};})[_0x17db('0x44')](function(_0x240d58){logger[_0x17db('0x19')](_0x17db('0x45'),_0x240d58[_0x17db('0x10')],_0x240d58[_0x17db('0x46')],_0x240d58[_0x17db('0x47')]);});};exports[_0x17db('0x48')]=function(_0x2154d7,_0x149dba,_0x539e05,_0x16d622){var _0x1149ce=apiai(_0x149dba,{'language':_0x16d622||'en'});return _0x1149ce[_0x17db('0x49')](_0x539e05,{'sessionId':md5(_0x2154d7)})['then'](function(_0x4595f4){logger['info'](JSON['stringify'](_0x4595f4));return{'source':_0x4595f4[_0x17db('0x4a')]['source'],'resolvedQuery':_0x4595f4['result'][_0x17db('0x4b')],'action':_0x4595f4[_0x17db('0x4a')][_0x17db('0x4c')],'actionIncomplete':_0x4595f4[_0x17db('0x4a')]['actionIncomplete'],'speech':_0x4595f4[_0x17db('0x4a')][_0x17db('0x4d')][_0x17db('0x4e')],'score':_0x4595f4[_0x17db('0x4a')]['score'],'statusCode':_0x4595f4[_0x17db('0x4f')][_0x17db('0x50')],'endConversation':_0x4595f4[_0x17db('0x4a')][_0x17db('0x51')]['endConversation']||![],'isFallbackIntent':_0x4595f4['result']['metadata'][_0x17db('0x52')]};});};exports[_0x17db('0x53')]=function(_0x2339a3,_0x2093d0,_0x4c49df,_0x53a4d0){return tilde[_0x17db('0x3a')](_0x2339a3,_0x2093d0,_0x4c49df,_0x53a4d0)[_0x17db('0x32')](function(_0x57a9f5){try{fs['unlink'](_0x2339a3);}catch(_0x24501a){logger[_0x17db('0x19')](_0x24501a);}logger[_0x17db('0x16')](_0x17db('0x54'),_0x57a9f5['transcript']);logger[_0x17db('0x16')]('Tilde\x20ASR\x20confidence',_0x57a9f5[_0x17db('0x41')]);return _0x57a9f5;});};exports['awsPolly']=function(_0x424fb4,_0x23efa2,_0x32cda8,_0x3d16bc,_0xa589e1,_0x10dd65){var _0x5080ae=path[_0x17db('0x23')](__dirname,_0x17db('0x24'),rs[_0x17db('0x25')](0x4)+_0x17db('0x33'));var _0x43f263;return aws['polly'](_0x424fb4,_0x23efa2,_0x32cda8,_0x3d16bc,_0xa589e1,_0x10dd65,_0x5080ae)[_0x17db('0x32')](function(){_0x43f263=path['resolve'](__dirname,_0x17db('0x24'),rs['generate'](0x4)+_0x17db('0x26'));return convertFile(_0x5080ae,_0x43f263);})[_0x17db('0x32')](function(){try{fs[_0x17db('0x37')](_0x5080ae);fs[_0x17db('0x29')](_0x43f263,'777');}catch(_0x4229c7){logger[_0x17db('0x19')](_0x4229c7);}return _0x43f263[_0x17db('0x2b')]('.')[0x0];});};exports[_0x17db('0x55')]=function(_0x43afbe,_0x3da5d1,_0x1ea9b4,_0x301d6a,_0x323487,_0x19f6f8){return aws[_0x17db('0x56')](_0x43afbe,_0x3da5d1,_0x1ea9b4,_0x301d6a,_0x323487,_0x19f6f8)[_0x17db('0x32')](function(_0x677576){logger[_0x17db('0x16')](JSON[_0x17db('0x57')](_0x677576));return _0x677576;});};exports[_0x17db('0x58')]=function(_0x218bdd,_0x197826,_0x21311d,_0x2a6b61){var _0x403269=util[_0x17db('0x59')](_0x17db('0x5a'),ISPEECH_API,_0x218bdd,encodeURIComponent(_0x197826),_0x21311d,_0x2a6b61);var _0x30a55=path['resolve'](__dirname,_0x17db('0x24'),rs[_0x17db('0x25')](0x4)+_0x17db('0x33'));var _0x13abf3;return downloadFile(_0x403269,_0x30a55)[_0x17db('0x32')](function(){_0x13abf3=path['resolve'](__dirname,_0x17db('0x24'),rs[_0x17db('0x25')](0x4)+_0x17db('0x26'));return convertFile(_0x30a55,_0x13abf3);})[_0x17db('0x32')](function(){try{fs[_0x17db('0x37')](_0x30a55);fs['chmodSync'](_0x13abf3,_0x17db('0x2a'));}catch(_0x7c0aea){logger[_0x17db('0x19')](_0x7c0aea);}return _0x13abf3['split']('.')[0x0];});};exports[_0x17db('0x5b')]=function(_0xe9f81,_0xd5b52c,_0x58f481,_0x55ba6c){var _0x4dc860=util[_0x17db('0x59')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0xd5b52c,_0x58f481,base64Encode(_0xe9f81),_0x55ba6c?util[_0x17db('0x59')]('model=%s',encodeURIComponent(_0x55ba6c)):_0x17db('0x5c'));return uploadFile(_0x4dc860)[_0x17db('0x32')](function(_0x2a6530){return querystring[_0x17db('0x5d')](_0x2a6530);});};exports[_0x17db('0x5e')]=function(_0x3a1b07,_0x366251){return sestek['nda'](_0x3a1b07,_0x366251)[_0x17db('0x32')](function(_0x6be18c){logger[_0x17db('0x16')](JSON[_0x17db('0x57')](_0x6be18c));var _0x472660={'speech':_0x6be18c[_0x17db('0x5f')],'action':_0x6be18c[_0x17db('0x60')]?_0x6be18c[_0x17db('0x60')][_0x17db('0x61')]:undefined,'actiondata':_0x6be18c[_0x17db('0x60')]?_0x6be18c[_0x17db('0x60')][_0x17db('0x62')]:undefined};if(_0x6be18c['channelData']&&_0x6be18c['channelData'][_0x17db('0x63')]){return base64Decode(_0x6be18c[_0x17db('0x60')][_0x17db('0x63')][_0x17db('0x64')],path['resolve'](__dirname,'tmp',rs[_0x17db('0x25')](0x4)+_0x17db('0x26')))['then'](function(_0x394af5){_0x472660[_0x17db('0x65')]=_0x394af5;return _0x472660;});}return _0x472660;});};exports[_0x17db('0x66')]=function(){return __dirname;}; \ No newline at end of file +var _0x2e76=['util','moment','google-tts-api','./google','./aws','./sestek','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','finish\x20download\x20file','close','download\x20error','pipe','end','host','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','generate','.wav','unlink','777','split','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','text:synthesize','POST','then','resolve','tmp','.mp3','writeFile','chmodSync','googleCloudTTS\x20path','googleTTS','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','score','status','code','metadata','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','transcript','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','path','http','https','url','randomstring','sox'];(function(_0x361d2c,_0x1217fa){var _0x353f87=function(_0x23203b){while(--_0x23203b){_0x361d2c['push'](_0x361d2c['shift']());}};_0x353f87(++_0x1217fa);}(_0x2e76,0x1a2));var _0x62e7=function(_0x511434,_0x4cc3ab){_0x511434=_0x511434-0x0;var _0x18caff=_0x2e76[_0x511434];return _0x18caff;};'use strict';var fs=require('fs');var path=require(_0x62e7('0x0'));var http=require(_0x62e7('0x1'));var https=require(_0x62e7('0x2'));var urlParse=require(_0x62e7('0x3'))['parse'];var BPromise=require('bluebird');var rs=require(_0x62e7('0x4'));var sox=require(_0x62e7('0x5'));var rp=require('request-promise');var util=require(_0x62e7('0x6'));var querystring=require('querystring');var moment=require(_0x62e7('0x7'));var tts=require(_0x62e7('0x8'));var apiai=require('apiai-promise');var md5=require('md5');var google=require(_0x62e7('0x9'));var aws=require(_0x62e7('0xa'));var tilde=require('./tilde');var sestek=require(_0x62e7('0xb'));var logger=require(_0x62e7('0xc'))('agi');var ISPEECH_API=_0x62e7('0xd');function downloadFile(_0x1ef382,_0x1a7f0d){return new BPromise(function(_0x38701b,_0xc0eb9c){var _0x5369d9=urlParse(_0x1ef382);var _0x1cc1c5=_0x5369d9[_0x62e7('0xe')]===_0x62e7('0xf')?https:http;var _0x1cb044={'host':_0x5369d9['host'],'path':_0x5369d9[_0x62e7('0x0')],'headers':{'user-agent':_0x62e7('0x10')}};_0x1cc1c5[_0x62e7('0x11')](_0x1cb044,function(_0x5943e9){if(_0x5943e9[_0x62e7('0x12')]!==0xc8){logger[_0x62e7('0x13')](_0x62e7('0x14')+_0x1ef382+_0x62e7('0x15')+_0x5943e9[_0x62e7('0x12')]+'\x20('+_0x5943e9['statusMessage']+')');_0xc0eb9c(new Error(_0x62e7('0x14')+_0x1ef382+_0x62e7('0x15')+_0x5943e9[_0x62e7('0x12')]+'\x20('+_0x5943e9[_0x62e7('0x16')]+')'));return;}var _0x3cc71e=fs[_0x62e7('0x17')](_0x1a7f0d);_0x3cc71e['on'](_0x62e7('0x18'),function(){logger['info'](_0x62e7('0x19'));_0x3cc71e[_0x62e7('0x1a')](_0x38701b);});_0x3cc71e['on'](_0x62e7('0x13'),function(_0x280fae){fs['unlink'](_0x1a7f0d);logger['error'](_0x62e7('0x1b'),_0x280fae);_0xc0eb9c(_0x280fae);});_0x5943e9[_0x62e7('0x1c')](_0x3cc71e);})['on'](_0x62e7('0x13'),function(_0x5cbe9f){logger[_0x62e7('0x13')](_0x5cbe9f);_0xc0eb9c(_0x5cbe9f);})[_0x62e7('0x1d')]();});}function uploadFile(_0x5ad1ef){return new BPromise(function(_0x557228,_0x12ae0b){var _0x3a5d72=urlParse(_0x5ad1ef);var _0x3836ab=_0x3a5d72[_0x62e7('0xe')]===_0x62e7('0xf')?https:http;var _0x54a454={'host':_0x3a5d72[_0x62e7('0x1e')],'path':_0x3a5d72[_0x62e7('0x0')],'headers':{'user-agent':_0x62e7('0x10')}};_0x3836ab[_0x62e7('0x11')](_0x54a454,function(_0x2dd65c){if(_0x2dd65c[_0x62e7('0x12')]!==0xc8){_0x12ae0b(new Error(_0x62e7('0x14')+_0x5ad1ef+'\x20failed,\x20status\x20code\x20=\x20'+_0x2dd65c[_0x62e7('0x12')]+'\x20('+_0x2dd65c[_0x62e7('0x16')]+')'));return;}var _0x4b4e82='';_0x2dd65c['on']('data',function(_0x1acd04){_0x4b4e82+=_0x1acd04;});_0x2dd65c['on'](_0x62e7('0x1d'),function(){_0x557228(_0x4b4e82);});})['on'](_0x62e7('0x13'),function(_0x581491){_0x12ae0b(_0x581491);})[_0x62e7('0x1d')]();});}function convertFile(_0x31fc64,_0x195952){return new BPromise(function(_0x33d1c4,_0x36165f){var _0x459ca1=sox[_0x62e7('0x1f')](_0x31fc64,_0x195952,{'sampleRate':0x1f40,'format':_0x62e7('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x459ca1['on'](_0x62e7('0x13'),function(_0x2ca055){logger['error'](_0x62e7('0x21'),_0x2ca055);_0x36165f(_0x2ca055);});_0x459ca1['on'](_0x62e7('0x1d'),function(){logger[_0x62e7('0x22')](_0x62e7('0x23'));_0x33d1c4();});_0x459ca1[_0x62e7('0x24')]();});}function base64Decode(_0x2104bb,_0x415fbf){var _0x41c0a2=path['resolve'](__dirname,'tmp',rs[_0x62e7('0x25')](0x4)+_0x62e7('0x26'));fs['writeFileSync'](_0x41c0a2,_0x2104bb,'base64');return convertFile(_0x41c0a2,_0x415fbf)['then'](function(){try{fs[_0x62e7('0x27')](_0x41c0a2);fs['chmodSync'](_0x415fbf,_0x62e7('0x28'));}catch(_0x1feb83){logger[_0x62e7('0x13')](_0x1feb83);}return _0x415fbf[_0x62e7('0x29')]('.')[0x0];});}function base64Encode(_0x4625eb){var _0x3e155c=fs[_0x62e7('0x2a')](_0x4625eb);return new Buffer(_0x3e155c)[_0x62e7('0x2b')](_0x62e7('0x2c'));}exports[_0x62e7('0x2d')]=function(_0x50cc24,_0x551e96,_0x392645,_0x587ebf,_0x5bf754){var _0x1e6b56,_0x593a8b;var _0x5b32d1=_0x62e7('0x2e');var _0x577b80='?key='+_0x50cc24;var _0x146d6d={'input':{'text':_0x551e96},'voice':{'languageCode':_0x392645,'ssmlGender':_0x587ebf},'audioConfig':{'audioEncoding':'MP3','sampleRateHertz':0x1f40}};var _0x1663fa={'url':_0x5b32d1+_0x62e7('0x2f')+_0x577b80,'method':_0x62e7('0x30'),'json':!![],'body':_0x146d6d};return rp(_0x1663fa)[_0x62e7('0x31')](function(_0x13f3ee){return new BPromise(function(_0x5835c1,_0x22faaa){_0x1e6b56=path[_0x62e7('0x32')](__dirname,_0x62e7('0x33'),rs[_0x62e7('0x25')](0x4)+_0x62e7('0x34'));var _0x1a58aa=Buffer['from'](_0x13f3ee['audioContent'],'base64');return fs[_0x62e7('0x35')](_0x1e6b56,_0x1a58aa,function(_0x150101){_0x22faaa(_0x150101);},function(_0x178f7e){fs[_0x62e7('0x36')](_0x1e6b56,'777');_0x5835c1(_0x178f7e);});});})[_0x62e7('0x31')](function(_0x524243){_0x593a8b=path[_0x62e7('0x32')](__dirname,_0x62e7('0x33'),rs[_0x62e7('0x25')](0x4)+'.wav');return convertFile(_0x1e6b56,_0x593a8b);})['then'](function(){try{fs['unlink'](_0x1e6b56);fs[_0x62e7('0x36')](_0x593a8b,_0x62e7('0x28'));}catch(_0x3c6307){logger[_0x62e7('0x13')](_0x3c6307);}logger[_0x62e7('0x22')](_0x62e7('0x37'),_0x593a8b['split']('.')[0x0]);return _0x593a8b[_0x62e7('0x29')]('.')[0x0];});};exports[_0x62e7('0x38')]=function(_0x2728c6,_0x25e226){var _0x4e4297,_0x1d1e2b;return tts(_0x2728c6,_0x25e226||'en',0x1)[_0x62e7('0x31')](function(_0x2a22c2){logger[_0x62e7('0x22')](_0x2a22c2);_0x4e4297=path[_0x62e7('0x32')](__dirname,_0x62e7('0x33'),rs['generate'](0x4)+'.mp3');return downloadFile(_0x2a22c2,_0x4e4297);})[_0x62e7('0x31')](function(){_0x1d1e2b=path[_0x62e7('0x32')](__dirname,_0x62e7('0x33'),rs[_0x62e7('0x25')](0x4)+_0x62e7('0x26'));return convertFile(_0x4e4297,_0x1d1e2b);})[_0x62e7('0x31')](function(){try{fs[_0x62e7('0x27')](_0x4e4297);fs[_0x62e7('0x36')](_0x1d1e2b,'777');}catch(_0x552283){logger[_0x62e7('0x13')](_0x552283);}logger['info'](_0x62e7('0x39'),_0x1d1e2b[_0x62e7('0x29')]('.')[0x0]);return _0x1d1e2b[_0x62e7('0x29')]('.')[0x0];});};exports[_0x62e7('0x3a')]=function(_0x4af6cb,_0x163995,_0x1e67c1){return google[_0x62e7('0x3b')](_0x4af6cb,_0x163995,_0x1e67c1)['then'](function(_0x213383){logger[_0x62e7('0x22')](_0x213383[_0x62e7('0x3c')]);return rp(_0x213383);})['then'](function(_0x19066e){var _0x5a3ba7='';var _0x279c01=0x0;try{fs['unlink'](_0x4af6cb);}catch(_0x2b1051){logger[_0x62e7('0x13')](_0x2b1051);}if(_0x19066e&&_0x19066e[_0x62e7('0x3d')]){_0x5a3ba7=_0x19066e[_0x62e7('0x3d')]['map'](function(_0x531e2d){return _0x531e2d&&_0x531e2d['alternatives'][0x0]&&_0x531e2d[_0x62e7('0x3e')][0x0]['transcript']?_0x531e2d['alternatives'][0x0]['transcript']:'';})[_0x62e7('0x3f')]('\x0a');_0x279c01=_0x19066e[_0x62e7('0x3d')][_0x62e7('0x40')](function(_0x51c62f){return _0x51c62f&&_0x51c62f[_0x62e7('0x3e')][0x0]&&_0x51c62f[_0x62e7('0x3e')][0x0][_0x62e7('0x41')]?_0x51c62f[_0x62e7('0x3e')][0x0][_0x62e7('0x41')]:0x0;})[_0x62e7('0x3f')]('\x0a');}logger['info'](_0x62e7('0x42'),_0x5a3ba7);logger['info'](_0x62e7('0x43'),_0x279c01);return{'transcript':_0x5a3ba7,'confidence':_0x279c01};})['catch'](function(_0x5d5e5d){logger[_0x62e7('0x13')](_0x62e7('0x44'),_0x5d5e5d['statusCode'],_0x5d5e5d[_0x62e7('0x45')],_0x5d5e5d['message']);});};exports[_0x62e7('0x46')]=function(_0x5cb6f7,_0x4cf0fe,_0x14101c,_0x4c5f66){var _0x38850f=apiai(_0x4cf0fe,{'language':_0x4c5f66||'en'});return _0x38850f[_0x62e7('0x47')](_0x14101c,{'sessionId':md5(_0x5cb6f7)})[_0x62e7('0x31')](function(_0x24b381){logger['info'](JSON[_0x62e7('0x48')](_0x24b381));return{'source':_0x24b381[_0x62e7('0x49')][_0x62e7('0x4a')],'resolvedQuery':_0x24b381['result'][_0x62e7('0x4b')],'action':_0x24b381[_0x62e7('0x49')][_0x62e7('0x4c')],'actionIncomplete':_0x24b381['result'][_0x62e7('0x4d')],'speech':_0x24b381[_0x62e7('0x49')][_0x62e7('0x4e')]['speech'],'score':_0x24b381[_0x62e7('0x49')][_0x62e7('0x4f')],'statusCode':_0x24b381[_0x62e7('0x50')][_0x62e7('0x51')],'endConversation':_0x24b381[_0x62e7('0x49')][_0x62e7('0x52')]['endConversation']||![],'isFallbackIntent':_0x24b381['result'][_0x62e7('0x52')][_0x62e7('0x53')]};});};exports[_0x62e7('0x54')]=function(_0x335aef,_0x1a09ee,_0x2f4409,_0x5a4578){return tilde[_0x62e7('0x3b')](_0x335aef,_0x1a09ee,_0x2f4409,_0x5a4578)['then'](function(_0xd5d1a5){try{fs['unlink'](_0x335aef);}catch(_0x5d78b4){logger[_0x62e7('0x13')](_0x5d78b4);}logger[_0x62e7('0x22')](_0x62e7('0x55'),_0xd5d1a5[_0x62e7('0x56')]);logger[_0x62e7('0x22')](_0x62e7('0x57'),_0xd5d1a5[_0x62e7('0x41')]);return _0xd5d1a5;});};exports[_0x62e7('0x58')]=function(_0x3bb87b,_0xd64e1c,_0x3795fc,_0x1a3973,_0x3db331,_0x3fe922){var _0x1d7c4d=path[_0x62e7('0x32')](__dirname,_0x62e7('0x33'),rs[_0x62e7('0x25')](0x4)+_0x62e7('0x34'));var _0x571320;return aws[_0x62e7('0x59')](_0x3bb87b,_0xd64e1c,_0x3795fc,_0x1a3973,_0x3db331,_0x3fe922,_0x1d7c4d)[_0x62e7('0x31')](function(){_0x571320=path[_0x62e7('0x32')](__dirname,_0x62e7('0x33'),rs[_0x62e7('0x25')](0x4)+_0x62e7('0x26'));return convertFile(_0x1d7c4d,_0x571320);})[_0x62e7('0x31')](function(){try{fs[_0x62e7('0x27')](_0x1d7c4d);fs[_0x62e7('0x36')](_0x571320,'777');}catch(_0x258884){logger[_0x62e7('0x13')](_0x258884);}return _0x571320['split']('.')[0x0];});};exports[_0x62e7('0x5a')]=function(_0x34845a,_0x7b199e,_0x12a067,_0x45bd12,_0x18e5e3,_0x52f085){return aws['lex'](_0x34845a,_0x7b199e,_0x12a067,_0x45bd12,_0x18e5e3,_0x52f085)['then'](function(_0x522cc9){logger[_0x62e7('0x22')](JSON[_0x62e7('0x48')](_0x522cc9));return _0x522cc9;});};exports['ispeechTTS']=function(_0x4324d9,_0x3ced83,_0x3107e1,_0x3d93fc){var _0x51d6f7=util[_0x62e7('0x5b')](_0x62e7('0x5c'),ISPEECH_API,_0x4324d9,encodeURIComponent(_0x3ced83),_0x3107e1,_0x3d93fc);var _0x39714b=path[_0x62e7('0x32')](__dirname,_0x62e7('0x33'),rs[_0x62e7('0x25')](0x4)+_0x62e7('0x34'));var _0x3ded90;return downloadFile(_0x51d6f7,_0x39714b)[_0x62e7('0x31')](function(){_0x3ded90=path[_0x62e7('0x32')](__dirname,_0x62e7('0x33'),rs[_0x62e7('0x25')](0x4)+_0x62e7('0x26'));return convertFile(_0x39714b,_0x3ded90);})[_0x62e7('0x31')](function(){try{fs['unlink'](_0x39714b);fs[_0x62e7('0x36')](_0x3ded90,_0x62e7('0x28'));}catch(_0x5ba748){logger[_0x62e7('0x13')](_0x5ba748);}return _0x3ded90[_0x62e7('0x29')]('.')[0x0];});};exports[_0x62e7('0x5d')]=function(_0x39f47c,_0x40cb58,_0x1c6fca,_0x4fa18d){var _0x318275=util['format'](_0x62e7('0x5e'),ISPEECH_API,_0x40cb58,_0x1c6fca,base64Encode(_0x39f47c),_0x4fa18d?util['format'](_0x62e7('0x5f'),encodeURIComponent(_0x4fa18d)):_0x62e7('0x60'));return uploadFile(_0x318275)[_0x62e7('0x31')](function(_0x2b4c1b){return querystring[_0x62e7('0x61')](_0x2b4c1b);});};exports['sestekNDA']=function(_0x5db1a2,_0x333fca){return sestek[_0x62e7('0x62')](_0x5db1a2,_0x333fca)['then'](function(_0x42e7fb){logger[_0x62e7('0x22')](JSON[_0x62e7('0x48')](_0x42e7fb));var _0x2b70a7={'speech':_0x42e7fb[_0x62e7('0x63')],'action':_0x42e7fb[_0x62e7('0x64')]?_0x42e7fb[_0x62e7('0x64')][_0x62e7('0x65')]:undefined,'actiondata':_0x42e7fb[_0x62e7('0x64')]?_0x42e7fb[_0x62e7('0x64')][_0x62e7('0x66')]:undefined};if(_0x42e7fb[_0x62e7('0x64')]&&_0x42e7fb[_0x62e7('0x64')][_0x62e7('0x67')]){return base64Decode(_0x42e7fb[_0x62e7('0x64')][_0x62e7('0x67')][_0x62e7('0x68')],path[_0x62e7('0x32')](__dirname,_0x62e7('0x33'),rs['generate'](0x4)+_0x62e7('0x26')))[_0x62e7('0x31')](function(_0xeb83ff){_0x2b70a7['audiofile']=_0xeb83ff;return _0x2b70a7;});}return _0x2b70a7;});};exports[_0x62e7('0x69')]=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 c19cf33..682ec60 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 _0x7b2f=['exports','./nda'];(function(_0x11c8eb,_0x1ddaf6){var _0x1dea92=function(_0x489e92){while(--_0x489e92){_0x11c8eb['push'](_0x11c8eb['shift']());}};_0x1dea92(++_0x1ddaf6);}(_0x7b2f,0x119));var _0xf7b2=function(_0x58423a,_0x3831bb){_0x58423a=_0x58423a-0x0;var _0x461799=_0x7b2f[_0x58423a];return _0x461799;};var nda=require(_0xf7b2('0x0'));module[_0xf7b2('0x1')]={'nda':nda}; \ No newline at end of file +var _0x3db9=['./nda','exports'];(function(_0x130536,_0x543ea0){var _0x31b0cb=function(_0x17c157){while(--_0x17c157){_0x130536['push'](_0x130536['shift']());}};_0x31b0cb(++_0x543ea0);}(_0x3db9,0x1b4));var _0x93db=function(_0x57cfb5,_0x40dd81){_0x57cfb5=_0x57cfb5-0x0;var _0x2c6874=_0x3db9[_0x57cfb5];return _0x2c6874;};var nda=require(_0x93db('0x0'));module[_0x93db('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 d3da20b..548e020 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 _0x4045=['audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','../../../../../config/logger','agi','exports','resolve','ndauth_url','password','username','then','POST','ndassistant_url','ndaactivity_type','uniqueid','callerid','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings'];(function(_0x3dddd3,_0x57d75d){var _0x4c519e=function(_0x1c740f){while(--_0x1c740f){_0x3dddd3['push'](_0x3dddd3['shift']());}};_0x4c519e(++_0x57d75d);}(_0x4045,0xc7));var _0x5404=function(_0x5297a0,_0x1921f6){_0x5297a0=_0x5297a0-0x0;var _0x36a218=_0x4045[_0x5297a0];return _0x36a218;};'use strict';var rp=require(_0x5404('0x0'));var url=require('url');var logger=require(_0x5404('0x1'))(_0x5404('0x2'));module[_0x5404('0x3')]=function(_0x76219b,_0x45b87f){var _0x332d6d={'method':'POST','uri':url[_0x5404('0x4')](_0x45b87f[_0x5404('0x5')],'/token'),'form':{'grant_type':_0x5404('0x6'),'username':_0x45b87f[_0x5404('0x7')],'password':_0x45b87f[_0x5404('0x6')]},'json':!![]};return rp(_0x332d6d)[_0x5404('0x8')](function(_0x319260){var _0x116cd9={'method':_0x5404('0x9'),'uri':url[_0x5404('0x4')](_0x45b87f[_0x5404('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x45b87f[_0x5404('0xb')]||'message','channelId':'Nda','conversation':{'id':_0x76219b[_0x5404('0xc')]},'from':{'id':_0x76219b[_0x5404('0xd')],'name':_0x76219b['calleridname']},'recipient':{'id':_0x76219b[_0x5404('0xe')],'name':_0x76219b[_0x5404('0xf')]},'text':_0x45b87f[_0x5404('0x10')],'channelData':{}},'headers':{'Authorization':_0x5404('0x11')+_0x319260[_0x5404('0x12')]},'json':!![]};if(_0x45b87f[_0x5404('0x13')]){_0x116cd9[_0x5404('0x14')][_0x5404('0x15')][_0x5404('0x16')]=_0x45b87f['project'];}if(_0x45b87f[_0x5404('0x17')]=='1'){_0x116cd9[_0x5404('0x14')]['channelData'][_0x5404('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5404('0x19')};}if(_0x45b87f['custom_action']){_0x116cd9[_0x5404('0x14')]['channelData'][_0x5404('0x1a')]=_0x45b87f[_0x5404('0x1b')];if(_0x45b87f[_0x5404('0x1c')]){_0x116cd9['body'][_0x5404('0x15')][_0x5404('0x1d')]=_0x45b87f[_0x5404('0x1c')];}}logger[_0x5404('0x1e')](JSON[_0x5404('0x1f')](_0x116cd9));return rp(_0x116cd9);});}; \ No newline at end of file +var _0x21d2=['custom_action_data','CustomActionData','info','stringify','url','exports','resolve','ndauth_url','/token','password','username','then','POST','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','extension','text','Bearer\x20','project','channelData','AudioOutputSettings','audio/wav','custom_action','body','CustomAction'];(function(_0x51b0f0,_0x20a90b){var _0xd5439e=function(_0x5459f8){while(--_0x5459f8){_0x51b0f0['push'](_0x51b0f0['shift']());}};_0xd5439e(++_0x20a90b);}(_0x21d2,0xd6));var _0x221d=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x21d2[_0x42bc91];return _0x3f5507;};'use strict';var rp=require('request-promise');var url=require(_0x221d('0x0'));var logger=require('../../../../../config/logger')('agi');module[_0x221d('0x1')]=function(_0xbb794e,_0x38d088){var _0x320fde={'method':'POST','uri':url[_0x221d('0x2')](_0x38d088[_0x221d('0x3')],_0x221d('0x4')),'form':{'grant_type':_0x221d('0x5'),'username':_0x38d088[_0x221d('0x6')],'password':_0x38d088[_0x221d('0x5')]},'json':!![]};return rp(_0x320fde)[_0x221d('0x7')](function(_0x1f1bb3){var _0x48053a={'method':_0x221d('0x8'),'uri':url[_0x221d('0x2')](_0x38d088[_0x221d('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x38d088[_0x221d('0xa')]||_0x221d('0xb'),'channelId':_0x221d('0xc'),'conversation':{'id':_0xbb794e[_0x221d('0xd')]},'from':{'id':_0xbb794e[_0x221d('0xe')],'name':_0xbb794e[_0x221d('0xf')]},'recipient':{'id':_0xbb794e['dnid'],'name':_0xbb794e[_0x221d('0x10')]},'text':_0x38d088[_0x221d('0x11')],'channelData':{}},'headers':{'Authorization':_0x221d('0x12')+_0x1f1bb3['access_token']},'json':!![]};if(_0x38d088[_0x221d('0x13')]){_0x48053a['body'][_0x221d('0x14')]['ProjectName']=_0x38d088[_0x221d('0x13')];}if(_0x38d088['ndagenerate_audio']=='1'){_0x48053a['body'][_0x221d('0x14')][_0x221d('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x221d('0x16')};}if(_0x38d088[_0x221d('0x17')]){_0x48053a[_0x221d('0x18')]['channelData'][_0x221d('0x19')]=_0x38d088[_0x221d('0x17')];if(_0x38d088[_0x221d('0x1a')]){_0x48053a[_0x221d('0x18')]['channelData'][_0x221d('0x1b')]=_0x38d088[_0x221d('0x1a')];}}logger[_0x221d('0x1c')](JSON[_0x221d('0x1d')](_0x48053a));return rp(_0x48053a);});}; \ 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 01222d7..a264a7e 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x22a192,_0x1bb328,_0x1b523e,_0x2e6eb2){return asr(_0x22a192,_0x1bb328,_0x1b523e,_0x2e6eb2);}; \ No newline at end of file +var _0xf656=['./lib/api'];(function(_0x276535,_0x21de57){var _0x2b5123=function(_0x4e2fb6){while(--_0x4e2fb6){_0x276535['push'](_0x276535['shift']());}};_0x2b5123(++_0x21de57);}(_0xf656,0xba));var _0x6f65=function(_0x8b643b,_0x18a771){_0x8b643b=_0x8b643b-0x0;var _0x27f40c=_0xf656[_0x8b643b];return _0x27f40c;};'use strict';var asr=require(_0x6f65('0x0'));module['exports']=function(_0x1ff965,_0x17323e,_0x4791c0,_0x148e56){return asr(_0x1ff965,_0x17323e,_0x4791c0,_0x148e56);}; \ 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 d072015..bd66a6d 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 _0xd763=['transcript','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','close','bluebird','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','EOS','error','terminate','status','result','Tilde\x20ASR\x20hypoteses','hypotheses'];(function(_0x3e7ca6,_0x427765){var _0xdf8559=function(_0x7a47d4){while(--_0x7a47d4){_0x3e7ca6['push'](_0x3e7ca6['shift']());}};_0xdf8559(++_0x427765);}(_0xd763,0x12b));var _0x3d76=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xd763[_0x3070dc];return _0x431489;};'use strict';var BPromise=require(_0x3d76('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x3d76('0x1'));var logger=require(_0x3d76('0x2'))(_0x3d76('0x3'));module[_0x3d76('0x4')]=function(_0x1214b7,_0x753ce8,_0x11cc2f,_0x1b647e){return new BPromise(function(_0x91c170,_0x34206f){logger[_0x3d76('0x5')](_0x3d76('0x6'),_0x1b647e||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x1aa880=new WebSocket(_0x1b647e||_0x3d76('0x7'),{'perMessageDeflate':![]});var _0x4fe8a8='';var _0x4a7d61='0';var _0x163b30='1';var _0x262b1f=_0x3d76('0x8');function _0x2d16e8(_0x257473){var _0x1f76e8=crypto[_0x3d76('0x9')]('sha1');_0x1f76e8[_0x3d76('0xa')](_0x257473);return _0x1f76e8[_0x3d76('0xb')](_0x3d76('0xc'));}function _0x5567c4(){try{logger['info'](_0x3d76('0xd'));var _0x2652fc=moment()['unix']();var _0x2fa8ae=_0x2d16e8(_0x2652fc+_0x753ce8+_0x11cc2f);_0x1aa880[_0x3d76('0xe')](JSON[_0x3d76('0xf')]({'appID':_0x753ce8,'timestamp':_0x2652fc,'appKey':_0x2fa8ae}));var _0x1b7fc2=fs[_0x3d76('0x10')](_0x1214b7);_0x1b7fc2['on'](_0x3d76('0x11'),function(_0x1fadd8){_0x1aa880[_0x3d76('0xe')](_0x1fadd8);});_0x1b7fc2['on']('close',function(){_0x1aa880[_0x3d76('0xe')](_0x3d76('0x12'));});}catch(_0x4265db){logger[_0x3d76('0x13')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x4265db));_0x1aa880[_0x3d76('0x14')]();}}function _0x1be710(_0x47f8ab){try{if(_0x47f8ab){var _0x2b7296=JSON['parse'](_0x47f8ab);switch(_0x2b7296[_0x3d76('0x15')]){case 0x0:if(_0x2b7296['result']){if(_0x2b7296[_0x3d76('0x16')]['final']){logger[_0x3d76('0x5')](_0x3d76('0x17'),JSON['stringify'](_0x2b7296[_0x3d76('0x16')]['hypotheses']));_0x4fe8a8=_0x2b7296['result'][_0x3d76('0x18')][0x0][_0x3d76('0x19')];_0x4a7d61=_0x2b7296[_0x3d76('0x16')][_0x3d76('0x18')][0x0]['likelihood'];_0x163b30='0';_0x262b1f='Success.';_0x1aa880[_0x3d76('0x14')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x163b30='1';_0x262b1f=_0x3d76('0x8');break;case 0x2:logger[_0x3d76('0x5')](_0x3d76('0x1a'));_0x163b30='2';_0x262b1f=_0x3d76('0x1a');break;case 0x9:logger[_0x3d76('0x5')](_0x3d76('0x1b'));_0x163b30='9';_0x262b1f=_0x3d76('0x1b');break;case 0xa:logger['info'](_0x3d76('0x1c'));_0x163b30='10';_0x262b1f='Authentication\x20failed.';break;case 0xb:logger['info'](_0x3d76('0x1d'));_0x163b30='11';_0x262b1f=_0x3d76('0x1d');}}}catch(_0x3886b2){logger[_0x3d76('0x13')](_0x3d76('0x1e'),JSON[_0x3d76('0xf')](_0x3886b2));_0x1aa880[_0x3d76('0x14')]();}}function _0x5256c1(){logger[_0x3d76('0x5')]('Close\x20Tilde\x20ASR\x20socket');_0x91c170({'transcript':_0x4fe8a8,'confidence':_0x4a7d61,'status':_0x163b30,'status_message':_0x262b1f});}function _0x1b9ff4(_0x14337a){logger['error'](_0x3d76('0x1f'));if(!_['isNil'](_0x14337a)){logger[_0x3d76('0x13')](_[_0x3d76('0x20')](_0x14337a)?JSON[_0x3d76('0xf')](_0x14337a):_0x14337a);}}_0x1aa880['on'](_0x3d76('0x21'),_0x5567c4);_0x1aa880['on'](_0x3d76('0x22'),_0x1be710);_0x1aa880['on'](_0x3d76('0x23'),_0x5256c1);_0x1aa880['on'](_0x3d76('0x13'),_0x1b9ff4);});}; \ No newline at end of file +var _0x97fd=['close','lodash','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','unix','send','stringify','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x97fd,0x145));var _0xd97f=function(_0x1190fa,_0x5be95d){_0x1190fa=_0x1190fa-0x0;var _0x1641d3=_0x97fd[_0x1190fa];return _0x1641d3;};'use strict';var BPromise=require('bluebird');var _=require(_0xd97f('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require('../../../../../../config/logger')(_0xd97f('0x1'));module[_0xd97f('0x2')]=function(_0x357b6d,_0x3f22ca,_0x4d2498,_0x45aed2){return new BPromise(function(_0x367f94,_0x5317dc){logger[_0xd97f('0x3')]('Tilde\x20URI',_0x45aed2||_0xd97f('0x4'));var _0x1be672=new WebSocket(_0x45aed2||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x22e209='';var _0x3cc544='0';var _0x2fa902='1';var _0x4c5776=_0xd97f('0x5');function _0x3431e6(_0x48d78d){var _0xc5df11=crypto[_0xd97f('0x6')](_0xd97f('0x7'));_0xc5df11[_0xd97f('0x8')](_0x48d78d);return _0xc5df11[_0xd97f('0x9')]('hex');}function _0x460ce5(){try{logger[_0xd97f('0x3')]('Open\x20Tilde\x20ASR\x20socket');var _0x1ea3bb=moment()[_0xd97f('0xa')]();var _0x131f52=_0x3431e6(_0x1ea3bb+_0x3f22ca+_0x4d2498);_0x1be672[_0xd97f('0xb')](JSON[_0xd97f('0xc')]({'appID':_0x3f22ca,'timestamp':_0x1ea3bb,'appKey':_0x131f52}));var _0x306d3e=fs[_0xd97f('0xd')](_0x357b6d);_0x306d3e['on'](_0xd97f('0xe'),function(_0x2cc2ff){_0x1be672[_0xd97f('0xb')](_0x2cc2ff);});_0x306d3e['on']('close',function(){_0x1be672['send'](_0xd97f('0xf'));});}catch(_0x36fda7){logger[_0xd97f('0x10')](_0xd97f('0x11'),JSON[_0xd97f('0xc')](_0x36fda7));_0x1be672[_0xd97f('0x12')]();}}function _0x240eed(_0x1b2f7a){try{if(_0x1b2f7a){var _0x544531=JSON[_0xd97f('0x13')](_0x1b2f7a);switch(_0x544531[_0xd97f('0x14')]){case 0x0:if(_0x544531['result']){if(_0x544531[_0xd97f('0x15')][_0xd97f('0x16')]){logger['info'](_0xd97f('0x17'),JSON[_0xd97f('0xc')](_0x544531[_0xd97f('0x15')][_0xd97f('0x18')]));_0x22e209=_0x544531['result'][_0xd97f('0x18')][0x0]['transcript'];_0x3cc544=_0x544531[_0xd97f('0x15')]['hypotheses'][0x0][_0xd97f('0x19')];_0x2fa902='0';_0x4c5776='Success.';_0x1be672['terminate']();}}break;case 0x1:logger[_0xd97f('0x3')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x2fa902='1';_0x4c5776=_0xd97f('0x5');break;case 0x2:logger[_0xd97f('0x3')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x2fa902='2';_0x4c5776=_0xd97f('0x1a');break;case 0x9:logger[_0xd97f('0x3')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x2fa902='9';_0x4c5776=_0xd97f('0x1b');break;case 0xa:logger[_0xd97f('0x3')]('Authentication\x20failed.');_0x2fa902='10';_0x4c5776=_0xd97f('0x1c');break;case 0xb:logger['info'](_0xd97f('0x1d'));_0x2fa902='11';_0x4c5776=_0xd97f('0x1d');}}}catch(_0x28a7c4){logger['error'](_0xd97f('0x1e'),JSON[_0xd97f('0xc')](_0x28a7c4));_0x1be672['terminate']();}}function _0x437da9(){logger[_0xd97f('0x3')](_0xd97f('0x1f'));_0x367f94({'transcript':_0x22e209,'confidence':_0x3cc544,'status':_0x2fa902,'status_message':_0x4c5776});}function _0xb90347(_0x35b686){logger[_0xd97f('0x10')](_0xd97f('0x20'));if(!_[_0xd97f('0x21')](_0x35b686)){logger[_0xd97f('0x10')](_['isObject'](_0x35b686)?JSON[_0xd97f('0xc')](_0x35b686):_0x35b686);}}_0x1be672['on']('open',_0x460ce5);_0x1be672['on'](_0xd97f('0x22'),_0x240eed);_0x1be672['on'](_0xd97f('0x23'),_0x437da9);_0x1be672['on'](_0xd97f('0x10'),_0xb90347);});}; \ 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 68b5bc1..ee335f6 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 _0xe930=['./asr','exports'];(function(_0x131ba8,_0x21d08d){var _0x4b8f2a=function(_0x271abc){while(--_0x271abc){_0x131ba8['push'](_0x131ba8['shift']());}};_0x4b8f2a(++_0x21d08d);}(_0xe930,0x1de));var _0x0e93=function(_0x41582d,_0x291b1c){_0x41582d=_0x41582d-0x0;var _0x59c504=_0xe930[_0x41582d];return _0x59c504;};var asr=require(_0x0e93('0x0'));module[_0x0e93('0x1')]={'asr':asr}; \ No newline at end of file +var _0x6755=['exports','./asr'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x6755,0x193));var _0x5675=function(_0xcfa1b8,_0x33430f){_0xcfa1b8=_0xcfa1b8-0x0;var _0x7e0122=_0x6755[_0xcfa1b8];return _0x7e0122;};var asr=require(_0x5675('0x0'));module[_0x5675('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 0d30d4e..98a8745 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 _0xb49a=['getConnections','E_AGI_SERVER_ERROR','emit','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','code','close','nextTick','inherits','exports','util','net','events','EventEmitter','./error','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection'];(function(_0x2edb06,_0x4cfec3){var _0x39f5ab=function(_0x293dee){while(--_0x293dee){_0x2edb06['push'](_0x2edb06['shift']());}};_0x39f5ab(++_0x4cfec3);}(_0xb49a,0xfb));var _0xab49=function(_0x1cdc8d,_0x1e5b71){_0x1cdc8d=_0x1cdc8d-0x0;var _0x267c57=_0xb49a[_0x1cdc8d];return _0x267c57;};'use strict';var util=require(_0xab49('0x0'));var net=require(_0xab49('0x1'));var EventEmitter=require(_0xab49('0x2'))[_0xab49('0x3')];var AGIError=require(_0xab49('0x4'));var AGIChannel=require('./channel');var AGIServer=function(_0x4387a5,_0x1d1789,_0x5554fe){var _0x543eb0=this,_0x4387a5=_0x4387a5||0x11dd,_0x1d1789=_0x1d1789||_0xab49('0x5'),_0x1cae1d=null,_0x3703cb=0x0;EventEmitter[_0xab49('0x6')](_0x543eb0);function _0xd86a5(){if(!_0x4387a5){_0x543eb0['emit'](_0xab49('0x7'),new AGIError(_0xab49('0x8')));return![];}_0x1cae1d=net[_0xab49('0x9')]();_0x1cae1d[_0xab49('0xa')](_0x4387a5,_0x1d1789);_0x1cae1d['on'](_0xab49('0xb'),function(){_0x543eb0['emit']('listening');});_0x1cae1d['on'](_0xab49('0xc'),function(_0x22b68f){_0x1cae1d[_0xab49('0xd')](function(_0x126f00,_0x25fc7d){if(_0x126f00){_0x543eb0['emit'](_0xab49('0x7'),new AGIError(_0xab49('0xe'),_0x126f00));}else if(_0x5554fe&&_0x5554fe<0x0){_0x543eb0[_0xab49('0xf')](_0xab49('0x7'),new AGIError(_0xab49('0x10')));_0x22b68f[_0xab49('0x11')]();}else if(_0x5554fe&&_0x5554fe>0x0&&_0x5554fe<_0x25fc7d){_0x3703cb+=0x1;_0x543eb0[_0xab49('0xf')](_0xab49('0x7'),new AGIError(_0xab49('0x12'),_0x3703cb));_0x22b68f[_0xab49('0x11')]();}else{var _0x40f465=new AGIChannel(_0x22b68f);_0x40f465['on']('ready',function(){_0x543eb0[_0xab49('0xf')](_0xab49('0xc'),_0x40f465);});}});});_0x1cae1d['on'](_0xab49('0x7'),function(_0x9c59e1){_0x543eb0[_0xab49('0xf')]('error',new AGIError(_0xab49('0xe'),_0x9c59e1[_0xab49('0x13')]));});_0x1cae1d['on'](_0xab49('0x14'),function(){_0x543eb0[_0xab49('0xf')](_0xab49('0x14'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xab49('0x15')](function(){_0xd86a5();});};util[_0xab49('0x16')](AGIServer,EventEmitter);module[_0xab49('0x17')]=function(_0x4ff277,_0x4c22cd,_0x31da6b){return new AGIServer(_0x4ff277,_0x4c22cd,_0x31da6b);}; \ No newline at end of file +var _0x0c2b=['util','net','./error','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listening','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits'];(function(_0x3fd80c,_0x327a59){var _0x37a2fd=function(_0x16421a){while(--_0x16421a){_0x3fd80c['push'](_0x3fd80c['shift']());}};_0x37a2fd(++_0x327a59);}(_0x0c2b,0x134));var _0xb0c2=function(_0xa49f94,_0x4505f9){_0xa49f94=_0xa49f94-0x0;var _0xd04087=_0x0c2b[_0xa49f94];return _0xd04087;};'use strict';var util=require(_0xb0c2('0x0'));var net=require(_0xb0c2('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIError=require(_0xb0c2('0x2'));var AGIChannel=require('./channel');var AGIServer=function(_0x359b0e,_0xb31d26,_0x44eec2){var _0x1c2f6f=this,_0x359b0e=_0x359b0e||0x11dd,_0xb31d26=_0xb31d26||_0xb0c2('0x3'),_0x514b10=null,_0x1f0b7e=0x0;EventEmitter[_0xb0c2('0x4')](_0x1c2f6f);function _0x21a929(){if(!_0x359b0e){_0x1c2f6f[_0xb0c2('0x5')](_0xb0c2('0x6'),new AGIError(_0xb0c2('0x7')));return![];}_0x514b10=net[_0xb0c2('0x8')]();_0x514b10['listen'](_0x359b0e,_0xb31d26);_0x514b10['on'](_0xb0c2('0x9'),function(){_0x1c2f6f[_0xb0c2('0x5')]('listening');});_0x514b10['on']('connection',function(_0x4be9db){_0x514b10[_0xb0c2('0xa')](function(_0x4b5f39,_0x580c86){if(_0x4b5f39){_0x1c2f6f[_0xb0c2('0x5')]('error',new AGIError(_0xb0c2('0xb'),_0x4b5f39));}else if(_0x44eec2&&_0x44eec2<0x0){_0x1c2f6f[_0xb0c2('0x5')](_0xb0c2('0x6'),new AGIError(_0xb0c2('0xc')));_0x4be9db[_0xb0c2('0xd')]();}else if(_0x44eec2&&_0x44eec2>0x0&&_0x44eec2<_0x580c86){_0x1f0b7e+=0x1;_0x1c2f6f[_0xb0c2('0x5')](_0xb0c2('0x6'),new AGIError(_0xb0c2('0xe'),_0x1f0b7e));_0x4be9db[_0xb0c2('0xd')]();}else{var _0xd68f9a=new AGIChannel(_0x4be9db);_0xd68f9a['on'](_0xb0c2('0xf'),function(){_0x1c2f6f['emit'](_0xb0c2('0x10'),_0xd68f9a);});}});});_0x514b10['on'](_0xb0c2('0x6'),function(_0x354e7b){_0x1c2f6f['emit']('error',new AGIError(_0xb0c2('0xb'),_0x354e7b[_0xb0c2('0x11')]));});_0x514b10['on']('close',function(){_0x1c2f6f['emit'](_0xb0c2('0x12'),new AGIError(_0xb0c2('0x13')));});}process[_0xb0c2('0x14')](function(){_0x21a929();});};util[_0xb0c2('0x15')](AGIServer,EventEmitter);module['exports']=function(_0x3f1076,_0x1bcc8a,_0x2c177b){return new AGIServer(_0x3f1076,_0x1bcc8a,_0x2c177b);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 1ec5664..cdc11ce 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 _0xeedf=['clear','includes','agicommand','hasOwnProperty','isString','replaceAllVariables','split','length','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','isConfigured','sync','maxRetry','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','timeout','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','delay','minutes','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','options','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','lumenvoxasr','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','SESTEK_ASR_CONFIDENCE','RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','url','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','.wav','SestekNDA\x20is\x20unreachable','end','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','no\x20file\x20audio\x20selected','getSound','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s.%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','stringify','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','NOBEEP','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','streamFile','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogin','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','Enter\x20in\x20MATH\x20(%s)\x20block','math\x20%s','operation','isArray','%s[%s]','menu','Enter\x20in\x20MENU\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','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','yes','Answer','Skipped\x20Answer','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','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','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','util','lodash','odbc','moment','mustache','../../config/logger','agi','./scripts','/var/opt/motion2/server/files','getdigits','prototype','getVariable','getVariableById','then','name','getVoiceQueue','rpc','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','Intervals','format','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','arg_1','callerid','createSquareRecording','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','random','lastName','isNil','phone','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPauseById','agentPause','agentUnpause','agentLogout','agent','%s/%s@from-sip/n','shellCommand','exec','trim','googleCloudTTS','en-US','ssmlGender','MALE','MP3','googleTTS','text','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','speed','ispeechASR','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','googleASR','google_asr_language','tildeASR','appid','appsecret','uri'];(function(_0x5e047b,_0x3d6bdb){var _0x3ac416=function(_0x2237c2){while(--_0x2237c2){_0x5e047b['push'](_0x5e047b['shift']());}};_0x3ac416(++_0x3d6bdb);}(_0xeedf,0x12c));var _0xfeed=function(_0x3de87f,_0x56a36e){_0x3de87f=_0x3de87f-0x0;var _0x49ba3d=_0xeedf[_0x3de87f];return _0x49ba3d;};'use strict';var fs=require('fs');var path=require(_0xfeed('0x0'));var util=require(_0xfeed('0x1'));var _=require(_0xfeed('0x2'));var sh=require('shelljs');var odbc=require(_0xfeed('0x3'))();var rs=require('randomstring');var moment=require(_0xfeed('0x4'));var Mustache=require(_0xfeed('0x5'));var logger=require(_0xfeed('0x6'))(_0xfeed('0x7'));var config=require('../../config/environment');var scripts=require(_0xfeed('0x8'));var FILES_PATH=_0xfeed('0x9');var verticesWithRetry=['menu',_0xfeed('0xa'),'getsecretdigits'];var AGIVertices=function(_0x22fd66,_0x5c147d,_0x124bdf){this['channel']=_0x22fd66;this['rpc']=_0x5c147d;this['mailRpc']=_0x124bdf;};AGIVertices[_0xfeed('0xb')][_0xfeed('0xc')]=function(_0x4222af,_0x467270){this['rpc'][_0xfeed('0xd')](_0x4222af)[_0xfeed('0xe')](function(_0x3531da){_0x467270(null,_0x3531da?_0x3531da[_0xfeed('0xf')]:![]);})['catch'](function(_0x55bc45){_0x467270(_0x55bc45);});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x10')]=function(_0x8b5c3e,_0xd0523b){this[_0xfeed('0x11')][_0xfeed('0x12')](_0x8b5c3e)['then'](function(_0x3b1959){_0xd0523b(null,_0x3b1959?_0x3b1959[_0xfeed('0xf')]:![]);})[_0xfeed('0x13')](function(_0x2d05d4){_0xd0523b(_0x2d05d4);});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x14')]=function(_0x376ee2,_0x3d669f){this[_0xfeed('0x11')][_0xfeed('0x15')](_0x376ee2)[_0xfeed('0xe')](function(_0x3884a1){_0x3d669f(null,_0x3884a1?_0x3884a1[_0xfeed('0xf')]:![]);})[_0xfeed('0x13')](function(_0x55a68d){_0x3d669f(_0x55a68d);});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x16')]=function(_0x1acdd7,_0x2aeb65){this[_0xfeed('0x11')][_0xfeed('0x17')](_0x1acdd7)[_0xfeed('0xe')](function(_0x2e6f00){_0x2aeb65(null,_0x2e6f00?_0x2e6f00[_0xfeed('0x18')]:![]);})[_0xfeed('0x13')](function(_0x4f8e36){_0x2aeb65(_0x4f8e36);});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x19')]=function(_0x298969,_0x5da2da){this[_0xfeed('0x11')][_0xfeed('0x1a')](_0x298969)[_0xfeed('0xe')](function(_0x295f86){_0x5da2da(null,_0x295f86?_0x295f86[_0xfeed('0xf')]:![]);})[_0xfeed('0x13')](function(_0x1ffb14){_0x5da2da(_0x1ffb14);});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x1b')]=function(_0x1b0331,_0x7de39a){this[_0xfeed('0x11')][_0xfeed('0x1c')](_0x1b0331)[_0xfeed('0xe')](function(_0x48b239){_0x7de39a(null,_0x48b239?_0x48b239['name']:![]);})['catch'](function(_0x3f01fc){_0x7de39a(_0x3f01fc);});};AGIVertices[_0xfeed('0xb')]['getSound']=function(_0x126b88,_0x26959e){var _0x11625e=this;this[_0xfeed('0x11')]['getSoundById'](_0x126b88)[_0xfeed('0xe')](function(_0x330942){_0x26959e(null,_0x330942?_0x11625e[_0xfeed('0x1d')](_0x330942['save_name']):![]);})[_0xfeed('0x13')](function(_0x31fbb5){_0x26959e(_0x31fbb5);});};AGIVertices['prototype'][_0xfeed('0x1e')]=function(_0x57c0cd,_0x284abf){this[_0xfeed('0x11')][_0xfeed('0x1f')](_0x57c0cd)[_0xfeed('0xe')](function(_0x1f462c){_0x284abf(null,_0x1f462c?_0x1f462c:![]);})[_0xfeed('0x13')](function(_0x28e687){_0x284abf(_0x28e687);});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x20')]=function(_0x5ec0cd,_0x121820,_0x545b40){this['mailRpc'][_0xfeed('0x20')](_0x5ec0cd,_0x121820)[_0xfeed('0xe')](function(){_0x545b40(null);})[_0xfeed('0x13')](function(_0x3ac09c){_0x545b40(_0x3ac09c);});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x21')]=function(_0x41b686,_0xd6174c){this['rpc'][_0xfeed('0x22')](_0x41b686)['then'](function(_0x9a6e8d){if(_0x9a6e8d){if(_0x9a6e8d[_0xfeed('0x23')]){_0xd6174c(null,[_0x9a6e8d['interval']]);}else{_0xd6174c(null,_[_0xfeed('0x24')](_0x9a6e8d[_0xfeed('0x25')],'interval'));}}else{_0xd6174c(null,![]);}})[_0xfeed('0x13')](function(_0x4dfc72){_0xd6174c(_0x4dfc72);});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x1d')]=function(_0xe8fc2f){return util[_0xfeed('0x26')]('%s/sounds/converted/%s',FILES_PATH,_0xe8fc2f);};AGIVertices[_0xfeed('0xb')]['getQueryOdbc']=function(_0x4b3dd5,_0x27f558,_0x1c8dfe){odbc[_0xfeed('0x27')](_0x4b3dd5,function(_0x1af22e){if(_0x1af22e){logger[_0xfeed('0x28')](_0xfeed('0x29'),_0x1af22e);_0x1c8dfe(_0x1af22e);}else{logger[_0xfeed('0x2a')](_0xfeed('0x2b'));odbc[_0xfeed('0x2c')](_0x27f558,function(_0x4cf7eb,_0x2ee6e5){if(_0x4cf7eb){logger[_0xfeed('0x2a')]('Error\x20executing\x20query\x20%s',_0x27f558);_0x1c8dfe(_0x4cf7eb);}else{logger[_0xfeed('0x2a')](_0xfeed('0x2d'),_0x27f558);odbc['close'](function(_0x27c2f9){if(_0x27c2f9){logger[_0xfeed('0x28')](_0xfeed('0x2e'),_0x27c2f9);}_0x1c8dfe(null,_0x2ee6e5);});}});}});};AGIVertices['prototype'][_0xfeed('0x2f')]=function(_0x54b7dc,_0x5424da){this[_0xfeed('0x11')][_0xfeed('0x30')](_0x54b7dc)['then'](function(_0x1fe7b7){_0x5424da(null,_0x1fe7b7?_0x1fe7b7:![]);})[_0xfeed('0x13')](function(_0xb85631){_0x5424da(_0xb85631);});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x31')]=function(_0x1b569f,_0x5a5164){this[_0xfeed('0x11')][_0xfeed('0x31')](_0x1b569f)[_0xfeed('0xe')](function(_0x5c8fef){_0x5a5164(null,_0x5c8fef);})[_0xfeed('0x13')](function(_0x2d2b8f){_0x5a5164(_0x2d2b8f);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0xc9adce,_0x53f7f0,_0x5ed637){this[_0xfeed('0x11')][_0xfeed('0x32')]({'uniqueid':this[_0xfeed('0x33')][_0xfeed('0x34')],'node':_0xc9adce[_0xfeed('0x35')],'application':_0xc9adce['agicommand'],'data':_0x53f7f0||null,'project_name':this['channel'][_0xfeed('0x36')],'callerid':this[_0xfeed('0x33')][_0xfeed('0x37')]})[_0xfeed('0xe')](function(_0x535834){if(_0x5ed637){_0x5ed637(null,_0x535834);}})[_0xfeed('0x13')](function(_0x5787a1){if(_0x5ed637){_0x5ed637(_0x5787a1);}});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x38')]=function(_0x5a808a,_0x387154,_0x4a712a,_0x3aa814){this[_0xfeed('0x11')][_0xfeed('0x38')]({'uniqueid':this[_0xfeed('0x33')][_0xfeed('0x34')],'callerid':this[_0xfeed('0x33')][_0xfeed('0x37')],'calleridname':this[_0xfeed('0x33')]['calleridname'],'context':this[_0xfeed('0x33')]['context'],'extension':this[_0xfeed('0x33')][_0xfeed('0x39')],'priority':this[_0xfeed('0x33')][_0xfeed('0x3a')],'accountcode':this[_0xfeed('0x33')][_0xfeed('0x3b')],'dnid':this[_0xfeed('0x33')][_0xfeed('0x3c')],'projectName':this[_0xfeed('0x33')][_0xfeed('0x36')],'saveName':_0x387154,'filename':_0x5a808a[_0xfeed('0x3d')]||_0x387154,'savePath':_0x4a712a})[_0xfeed('0xe')](function(_0x5b6eee){_0x3aa814(null,_0x5b6eee);})['catch'](function(_0xeb69cc){_0x3aa814(_0xeb69cc);});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x3e')]=function(_0x44842b,_0x310650,_0x4d12fe){this[_0xfeed('0x11')][_0xfeed('0x3e')]({'uniqueid':this[_0xfeed('0x33')][_0xfeed('0x34')],'body':_0x44842b,'direction':_0x310650})[_0xfeed('0xe')](function(_0x24def9){if(_0x4d12fe){_0x4d12fe(null,_0x24def9);}})[_0xfeed('0x13')](function(_0x132041){if(_0x4d12fe){_0x4d12fe(_0x132041);}});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x3f')]=function(_0x578fa1,_0x1dc5a8){this[_0xfeed('0x11')][_0xfeed('0x3f')]({'firstName':_[_0xfeed('0x40')](_0x578fa1[_0xfeed('0xf')])||_['isNil'](_0x578fa1[_0xfeed('0xf')])?'callback_'+Math[_0xfeed('0x41')]():_0x578fa1[_0xfeed('0xf')],'lastName':_['isEmpty'](_0x578fa1[_0xfeed('0x42')])||_[_0xfeed('0x43')](_0x578fa1['lastName'])?null:_0x578fa1[_0xfeed('0x42')],'phone':_0x578fa1[_0xfeed('0x44')],'ListId':_0x578fa1['list_id'],'scheduledAt':_0x578fa1['scheduledAt'],'callbackUniqueid':this['channel'][_0xfeed('0x34')],'tags':_0xfeed('0x45'),'description':_0xfeed('0x46')+_0x578fa1[_0xfeed('0x47')][_0xfeed('0x48')](),'priority':_0x578fa1[_0xfeed('0x49')]})['then'](function(_0x2c0c65){_0x1dc5a8(null,_0x2c0c65);})[_0xfeed('0x13')](function(_0x206d14){_0x1dc5a8(_0x206d14);});};AGIVertices[_0xfeed('0xb')]['getPause']=function(_0x178f6b,_0x191406){this[_0xfeed('0x11')][_0xfeed('0x4a')](_0x178f6b)[_0xfeed('0xe')](function(_0x241c65){_0x191406(null,_0x241c65?_0x241c65[_0xfeed('0xf')]:![]);})[_0xfeed('0x13')](function(_0x39a9ae){_0x191406(_0x39a9ae);});};AGIVertices['prototype'][_0xfeed('0x4b')]=function(_0x8aaf66,_0x1e4740,_0x24ed96){var _0xa32394={'role':'agent'};_0xa32394[_0x8aaf66]=this[_0xfeed('0x33')][_0xfeed('0x37')];this[_0xfeed('0x11')][_0xfeed('0x4b')](_0xa32394,_0x1e4740,this['channel'][_0xfeed('0x34')])[_0xfeed('0xe')](function(_0x5af099){_0x24ed96(null,_[_0xfeed('0x43')](_0x5af099)?![]:!![]);})[_0xfeed('0x13')](function(_0x3ead36){logger[_0xfeed('0x28')](_0x3ead36);_0x24ed96(null,![]);});};AGIVertices[_0xfeed('0xb')]['agentUnpause']=function(_0x22fa80,_0x39e60b){var _0x312729={'role':'agent'};_0x312729[_0x22fa80]=this['channel']['callerid'];this[_0xfeed('0x11')][_0xfeed('0x4c')](_0x312729)['then'](function(_0x5def19){_0x39e60b(null,_[_0xfeed('0x43')](_0x5def19)?![]:!![]);})[_0xfeed('0x13')](function(_0x24537e){logger[_0xfeed('0x28')](_0x24537e);_0x39e60b(null,![]);});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x4d')]=function(_0xbbfa31,_0x2a6db9){var _0x66cf8={'role':_0xfeed('0x4e')};_0x66cf8[_0xbbfa31]=this['channel'][_0xfeed('0x37')];this[_0xfeed('0x11')]['agentLogout'](_0x66cf8)['then'](function(_0x46f934){_0x2a6db9(null,_[_0xfeed('0x43')](_0x46f934)?![]:!![]);})[_0xfeed('0x13')](function(_0x3494a2){logger[_0xfeed('0x28')](_0x3494a2);_0x2a6db9(null,![]);});};AGIVertices[_0xfeed('0xb')]['agentLogin']=function(_0x4690a2,_0x53f0ad){var _0x356a66={'role':'agent'};_0x356a66[_0x4690a2]=this[_0xfeed('0x33')][_0xfeed('0x37')];var _0x1216aa=_0x4690a2!='internal'?util[_0xfeed('0x26')](_0xfeed('0x4f'),'LOCAL',this[_0xfeed('0x33')]['callerid']):undefined;this['rpc']['agentLogin'](_0x356a66,_0x1216aa)[_0xfeed('0xe')](function(_0x1e301f){_0x53f0ad(null,_[_0xfeed('0x43')](_0x1e301f)?![]:!![]);})['catch'](function(_0xe99f8e){logger[_0xfeed('0x28')](_0xe99f8e);_0x53f0ad(null,![]);});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x50')]=function(_0x5d4b55,_0x53a5e9){sh[_0xfeed('0x51')](_[_0xfeed('0x52')](_0x5d4b55),function(_0x21f49d,_0x1098ce){var _0x169353=_0x1098ce['replace'](/(\r\n|\n|\r)/gm,'');_0x53a5e9(null,_0x169353);});};AGIVertices[_0xfeed('0xb')]['googleCloudTTS']=function(_0xdabafa,_0x399d27){scripts[_0xfeed('0x53')](_0xdabafa['apiKey'],_0xdabafa['text'],_0xdabafa['languageCode']||_0xfeed('0x54'),_0xdabafa[_0xfeed('0x55')]||_0xfeed('0x56'),_0xdabafa['audioEncoding']||_0xfeed('0x57'))[_0xfeed('0xe')](function(_0x57a015){_0x399d27(null,_0x57a015);})[_0xfeed('0x13')](function(_0x242155){_0x399d27(_0x242155);});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x58')]=function(_0x3cc1a7,_0x4c4ac0){scripts[_0xfeed('0x58')](_0x3cc1a7[_0xfeed('0x59')],_0x3cc1a7['google_tts_language']||'en',0x1)['then'](function(_0x15d89e){_0x4c4ac0(null,_0x15d89e);})['catch'](function(_0x5c41b4){_0x4c4ac0(_0x5c41b4);});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x5a')]=function(_0x350652,_0x5d9a81){scripts[_0xfeed('0x5a')](this['channel'][_0xfeed('0x34')],_0x350652[_0xfeed('0x5b')],_0x350652[_0xfeed('0x59')],_0x350652[_0xfeed('0x5c')]||'en')[_0xfeed('0xe')](function(_0x10ddb3){_0x5d9a81(null,_0x10ddb3);})[_0xfeed('0x13')](function(_0x385ce1){_0x5d9a81(_0x385ce1);});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x5d')]=function(_0x472839,_0x5140f8){scripts[_0xfeed('0x5d')](this[_0xfeed('0x33')],_0x472839)[_0xfeed('0xe')](function(_0x72adba){_0x5140f8(null,_0x72adba);})[_0xfeed('0x13')](function(_0x4525e4){_0x5140f8(_0x4525e4);});};AGIVertices['prototype']['ispeechTTS']=function(_0x5cf401,_0x33faf8){scripts[_0xfeed('0x5e')](_0x5cf401[_0xfeed('0x5b')],_0x5cf401[_0xfeed('0x59')],_0x5cf401['ispeech_tts_language']||'en-US',_0x5cf401[_0xfeed('0x5f')])['then'](function(_0x57a7e6){_0x33faf8(null,_0x57a7e6);})[_0xfeed('0x13')](function(_0xa12bff){_0x33faf8(_0xa12bff);});};AGIVertices['prototype'][_0xfeed('0x60')]=function(_0x545510,_0x27ad7c,_0x312977){scripts['ispeechASR'](_0x27ad7c,_0x545510[_0xfeed('0x5b')],_0x545510['ispeech_asr_language']||_0xfeed('0x54'),this['isConfigured'](_0x545510[_0xfeed('0x61')])?_0x545510[_0xfeed('0x61')]:undefined)['then'](function(_0x1088f6){_0x312977(null,_0x1088f6);})['catch'](function(_0x2b2e84){_0x312977(_0x2b2e84);});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x62')]=function(_0x16c93d,_0x3d307a){scripts[_0xfeed('0x62')](_0x16c93d[_0xfeed('0x63')],_0x16c93d[_0xfeed('0x64')],_0x16c93d[_0xfeed('0x65')],_0x16c93d[_0xfeed('0x66')]||_0xfeed('0x67'),_0x16c93d['text'],_0x16c93d[_0xfeed('0x68')]||_0xfeed('0x59'))[_0xfeed('0xe')](function(_0x423545){_0x3d307a(null,_0x423545);})[_0xfeed('0x13')](function(_0x131a45){_0x3d307a(_0x131a45);});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x69')]=function(_0x48c4e4,_0x3a7cdb){scripts[_0xfeed('0x69')](this['channel'][_0xfeed('0x34')],_0x48c4e4[_0xfeed('0x63')],_0x48c4e4['aws_secret_access_key'],_0x48c4e4['aws_lex_region'],_0x48c4e4[_0xfeed('0x59')],_0x48c4e4['aws_bot_name'])['then'](function(_0x18683f){_0x3a7cdb(null,_0x18683f);})[_0xfeed('0x13')](function(_0x7823cf){_0x3a7cdb(_0x7823cf);});};AGIVertices['prototype']['googleASR']=function(_0x3bfb4b,_0x40ea2d,_0x2b653d){scripts[_0xfeed('0x6a')](_0x40ea2d,_0x3bfb4b[_0xfeed('0x5b')],_0x3bfb4b[_0xfeed('0x6b')]||'en-US')[_0xfeed('0xe')](function(_0x16cf02){_0x2b653d(null,_0x16cf02);})['catch'](function(_0x4b9d4e){_0x2b653d(_0x4b9d4e);});};AGIVertices['prototype'][_0xfeed('0x6c')]=function(_0x480e48,_0x2ac09f,_0x4d28d0){scripts[_0xfeed('0x6c')](_0x2ac09f,_0x480e48[_0xfeed('0x6d')],_0x480e48[_0xfeed('0x6e')],_0x480e48[_0xfeed('0x6f')])[_0xfeed('0xe')](function(_0x2b2246){_0x4d28d0(null,_0x2b2246);})['catch'](function(_0x3d8523){_0x4d28d0(_0x3d8523);});};AGIVertices[_0xfeed('0xb')][_0xfeed('0x70')]=function(_0x47a6c0){var _0x289417=_[_0xfeed('0x71')](verticesWithRetry,_0x47a6c0[_0xfeed('0x72')])?_0x47a6c0:_['clone'](_0x47a6c0);for(var _0x531509 in _0x289417){if(_0x289417[_0xfeed('0x73')](_0x531509)){if(_0x289417[_0x531509]&&_[_0xfeed('0x74')](_0x289417[_0x531509])){_0x289417[_0x531509]=this[_0xfeed('0x75')](_0x289417[_0x531509]);}}}return _0x289417;};AGIVertices[_0xfeed('0xb')][_0xfeed('0x75')]=function(_0xdfbe2d){var _0x1b794d=_0xdfbe2d[_0xfeed('0x76')]('{');for(var _0x5d558c=0x1;_0x5d558c<_0x1b794d[_0xfeed('0x77')];_0x5d558c+=0x1){var _0x3aa791=_0x1b794d[_0x5d558c][_0xfeed('0x76')]('}');if(_0x3aa791['length']>0x1){_0xdfbe2d=_0xdfbe2d[_0xfeed('0x78')]('{'+_0x3aa791[0x0]+'}',this[_0xfeed('0x33')]['getVariable'](_0x3aa791[0x0])[_0xfeed('0x79')]||_0x3aa791[0x0]);}}if(_0x1b794d['length']===0x1){return _0xdfbe2d[_0xfeed('0x48')]();}return this[_0xfeed('0x75')](_0xdfbe2d);};AGIVertices[_0xfeed('0xb')][_0xfeed('0x7a')]=function(_0x5c1cfc,_0x24db1a){var _0x6adf65=this[_0xfeed('0x33')][_0xfeed('0xc')](_0x5c1cfc);if(_0x6adf65[_0xfeed('0x7b')]===-0x1){return _0x6adf65;}logger['info'](util[_0xfeed('0x26')](_0xfeed('0x7c'),_0x24db1a,_0x6adf65['extra']));return this[_0xfeed('0x33')][_0xfeed('0x7d')](_0x24db1a,_0x6adf65['extra']);};AGIVertices[_0xfeed('0xb')][_0xfeed('0x7e')]=function(_0x13ee8d){return _0x13ee8d&&_0x13ee8d!=='0'&&_0x13ee8d!=='-1'&&_0x13ee8d!=='';};AGIVertices['prototype']['maxRetry']=function(_0x1d8715){this[_0xfeed('0x32')][_0xfeed('0x7f')](this,_0x1d8715,'-');_0x1d8715['retry']=_0x1d8715[_0xfeed('0x80')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xfeed('0xb')]['agi']=function(_0x1680b2){logger[_0xfeed('0x2a')](util['format'](_0xfeed('0x81'),_0x1680b2['label']));return this[_0xfeed('0x33')][_0xfeed('0x7')]([_0x1680b2['command'],_0x1680b2[_0xfeed('0x82')]]);};AGIVertices['prototype'][_0xfeed('0x83')]=function(_0x1becd5){logger[_0xfeed('0x2a')](util['format'](_0xfeed('0x84'),_0x1becd5[_0xfeed('0x35')]));if(this[_0xfeed('0x7e')](_0x1becd5['timeout'])){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x85'),_0x1becd5[_0xfeed('0x86')]));var _0x18eb47=this[_0xfeed('0x33')][_0xfeed('0x87')](_0x1becd5[_0xfeed('0x86')]);if(_0x18eb47[_0xfeed('0x7b')]===-0x1){return _0x18eb47;}}return this[_0xfeed('0x33')][_0xfeed('0x83')]();};AGIVertices[_0xfeed('0xb')][_0xfeed('0x45')]=function(_0x409bfd){logger['info'](util[_0xfeed('0x26')](_0xfeed('0x88'),_0x409bfd[_0xfeed('0x35')]));if(!this[_0xfeed('0x7e')](_0x409bfd[_0xfeed('0x89')])){return this['channel'][_0xfeed('0x28')](_0x409bfd,'no\x20list\x20selected');}_0x409bfd[_0xfeed('0x47')]=moment();if(this['isConfigured'](_0x409bfd[_0xfeed('0x8a')])){_0x409bfd[_0xfeed('0x47')]=moment()['add'](_0x409bfd[_0xfeed('0x8a')],_0xfeed('0x8b'));}if(!this[_0xfeed('0x7e')](_0x409bfd[_0xfeed('0x49')])){_0x409bfd[_0xfeed('0x49')]=0x2;}this[_0xfeed('0x3f')][_0xfeed('0x7f')](this,_0x409bfd);return this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x8d'),_0x409bfd[_0xfeed('0x44')],_0x409bfd[_0xfeed('0x89')],_0x409bfd[_0xfeed('0x47')]));};AGIVertices[_0xfeed('0xb')]['custom_app']=function(_0x4f9790){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x8e'),_0x4f9790[_0xfeed('0x35')]));var _0x1a38fe=this[_0xfeed('0x33')]['exec'](_0x4f9790[_0xfeed('0x8f')],_0x4f9790[_0xfeed('0x90')]);if(_0x1a38fe['result']===-0x1){return _0x1a38fe;}return this['channel'][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x91'),_0x4f9790[_0xfeed('0x8f')],_0x4f9790[_0xfeed('0x90')]));};AGIVertices[_0xfeed('0xb')]['lumenvoxtts']=function(_0x390cb7){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x92'),_0x390cb7['label']));if(!this[_0xfeed('0x7e')](_0x390cb7['text'])){return this[_0xfeed('0x33')][_0xfeed('0x8c')](_0xfeed('0x93'));}var _0x5f2264='\x22'+_0x390cb7[_0xfeed('0x59')]+'\x22';if(this['isConfigured'](_0x390cb7[_0xfeed('0x90')])){_0x5f2264+=','+_0x390cb7[_0xfeed('0x90')];}var _0x493b56=this[_0xfeed('0x33')]['exec'](_0xfeed('0x94'),_0x5f2264);if(_0x493b56[_0xfeed('0x7b')]===-0x1){return _0x493b56;}return this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x95'),_0x5f2264));};AGIVertices[_0xfeed('0xb')][_0xfeed('0x96')]=function(_0x575d51){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x97'),_0x575d51['label']));if(!this[_0xfeed('0x7e')](_0x575d51[_0xfeed('0x59')])){return this[_0xfeed('0x33')][_0xfeed('0x8c')]('no\x20text\x20configured');}var _0x179dec='\x22'+_0x575d51[_0xfeed('0x59')]+'\x22';if(this[_0xfeed('0x7e')](_0x575d51[_0xfeed('0x90')])){_0x179dec+=','+_0x575d51[_0xfeed('0x90')];}var _0x8b315b=this['channel']['exec'](_0xfeed('0x94'),_0x179dec);if(_0x8b315b[_0xfeed('0x7b')]===-0x1){return _0x8b315b;}return this[_0xfeed('0x33')][_0xfeed('0x8c')](util['format'](_0xfeed('0x95'),_0x179dec));};AGIVertices['prototype'][_0xfeed('0x98')]=function(_0x5d990e){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x5d990e[_0xfeed('0x35')]));if(!this['isConfigured'](_0x5d990e['grammar'])){return this[_0xfeed('0x33')][_0xfeed('0x8c')](_0xfeed('0x99'));}var _0x15ea58=_0x5d990e[_0xfeed('0x9a')];if(this[_0xfeed('0x7e')](_0x5d990e['options'])){_0x15ea58+=','+_0x5d990e['options'];}var _0x46304f=this['channel']['exec'](_0xfeed('0x9b'),_0x15ea58);if(_0x46304f[_0xfeed('0x7b')]===-0x1){return _0x46304f;}var _0x26d1fe=this[_0xfeed('0x7a')](_0xfeed('0x9c'),_0xfeed('0x9d'));if(_0x26d1fe['result']===-0x1){return _0x26d1fe;}var _0x60839=this[_0xfeed('0x7a')]('RECOG_INPUT()',_0xfeed('0x9e'));if(_0x60839[_0xfeed('0x7b')]===-0x1){return _0x60839;}var _0x1e930e=this[_0xfeed('0x7a')](_0xfeed('0x9f'),_0xfeed('0xa0'));if(_0x1e930e[_0xfeed('0x7b')]===-0x1){return _0x1e930e;}return this[_0xfeed('0x33')]['noop'](util[_0xfeed('0x26')]('Executed\x20command\x20MRCPRecog\x20%s',_0x15ea58));};AGIVertices[_0xfeed('0xb')]['sestekasr']=function(_0x14cf36){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x14cf36[_0xfeed('0x35')]));if(!this[_0xfeed('0x7e')](_0x14cf36['grammar'])){return this[_0xfeed('0x33')][_0xfeed('0x8c')](_0xfeed('0x99'));}var _0x31a1e3=_0x14cf36[_0xfeed('0x9a')];if(this[_0xfeed('0x7e')](_0x14cf36['options'])){_0x31a1e3+=','+_0x14cf36[_0xfeed('0x90')];}var _0x416339=this['channel'][_0xfeed('0x51')](_0xfeed('0x9b'),_0x31a1e3);if(_0x416339[_0xfeed('0x7b')]===-0x1){return _0x416339;}var _0x53054b=this[_0xfeed('0x7a')](_0xfeed('0x9c'),_0xfeed('0xa1'));if(_0x53054b[_0xfeed('0x7b')]===-0x1){return _0x53054b;}var _0x57e6af=this['getAndSetVariable'](_0xfeed('0xa2'),_0xfeed('0xa3'));if(_0x57e6af[_0xfeed('0x7b')]===-0x1){return _0x57e6af;}var _0x5bf6c4=this[_0xfeed('0x7a')](_0xfeed('0x9f'),_0xfeed('0xa4'));if(_0x5bf6c4['result']===-0x1){return _0x5bf6c4;}return this[_0xfeed('0x33')][_0xfeed('0x8c')](util['format'](_0xfeed('0xa5'),_0x31a1e3));};AGIVertices[_0xfeed('0xb')][_0xfeed('0xa6')]=function(_0x666670){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0xa7'),_0x666670[_0xfeed('0x35')]));if(!this['isConfigured'](_0x666670[_0xfeed('0xa8')])){return this['channel']['error'](_0x666670,_0xfeed('0xa9'));}var _0x33db82=this['getSquareOdbc'][_0xfeed('0x7f')](this,_0x666670['odbc_id']);if(!_0x33db82){return this['channel'][_0xfeed('0x28')](_0x666670,'no\x20odbc\x20database\x20found');}if(!this[_0xfeed('0x7e')](_0x666670[_0xfeed('0x2c')])){return this['channel']['error'](_0x666670,_0xfeed('0xaa'));}var _0x3cdde2=_0x666670['query'][_0xfeed('0xab')](/(\r\n|\n|\r)/gm,'\x20');this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0xac'),_0x3cdde2));var _0x2d139b=this['getQueryOdbc']['sync'](this,_0x33db82,_0x3cdde2);this[_0xfeed('0x32')][_0xfeed('0x7f')](this,_0x666670,_0x3cdde2);if(!this['isConfigured'](_0x666670[_0xfeed('0xad')])){return this['channel'][_0xfeed('0x8c')](_0xfeed('0xae'));}var _0x495b53=this[_0xfeed('0xc')][_0xfeed('0x7f')](this,_0x666670[_0xfeed('0xad')]);if(!_0x495b53){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x666670,'no\x20variable\x20found');}var _0x2c11cb=this;_0x2d139b[_0xfeed('0xaf')](function(_0x5d7e08,_0x2b85b3){Object[_0xfeed('0xb0')](_0x5d7e08)['forEach'](function(_0x19db51){_0x2c11cb[_0xfeed('0x33')][_0xfeed('0x7d')](util[_0xfeed('0x26')](_0xfeed('0xb1'),_0x495b53,_0x2b85b3,_0x19db51),_0x5d7e08[_0x19db51]);});});this[_0xfeed('0x33')][_0xfeed('0x7d')](util['format'](_0xfeed('0xb2'),_0x495b53),_0x2d139b['length']);return this['channel'][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0xb3'),_0x495b53));};AGIVertices['prototype']['dial']=function(_0x20b671){logger[_0xfeed('0xb4')](util[_0xfeed('0x26')](_0xfeed('0xb5'),_0x20b671[_0xfeed('0x35')]));if(!this['isConfigured'](_0x20b671[_0xfeed('0xb6')])){return this['channel'][_0xfeed('0x28')](_0x20b671,_0xfeed('0xb7'));}var _0x23cccb=this[_0xfeed('0x19')]['sync'](this,_0x20b671[_0xfeed('0xb6')]);if(!_0x23cccb){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x20b671,_0xfeed('0xb8'));}var _0x46671b=this[_0xfeed('0x33')]['exec'](_0xfeed('0xb9'),[util[_0xfeed('0x26')](_0xfeed('0xba'),_0x23cccb),_0x20b671[_0xfeed('0x86')],_0x20b671['opts'],_0x20b671[_0xfeed('0xbb')]]);if(_0x46671b[_0xfeed('0x7b')]===-0x1){return _0x46671b;}return this['channel'][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0xbc'),_0xfeed('0xb9')));};AGIVertices[_0xfeed('0xb')][_0xfeed('0xbd')]=function(_0x50cae7){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x50cae7[_0xfeed('0x35')]));if(!this[_0xfeed('0x7e')](_0x50cae7['key'])){return this['channel'][_0xfeed('0x8c')](_0xfeed('0xbe'));}if(!this[_0xfeed('0x7e')](_0x50cae7[_0xfeed('0x59')])){return this['channel'][_0xfeed('0x8c')](_0xfeed('0x93'));}this['channel'][_0xfeed('0xbf')]=!![];this['createSquareDetailsReport'](_0x50cae7);this['createSquareMessage'](_0x50cae7[_0xfeed('0x59')],'in');this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0xc0'),_0x50cae7[_0xfeed('0x59')]));var _0x3c7f62=this['googleDialogflow'][_0xfeed('0x7f')](this,_0x50cae7);if(_0x3c7f62){for(var _0x346046 in _0x3c7f62){if(_0x3c7f62[_0xfeed('0x73')](_0x346046)){this[_0xfeed('0x33')][_0xfeed('0x7d')](util[_0xfeed('0x26')](_0xfeed('0xc1'),_0x346046[_0xfeed('0xc2')]()),_0x3c7f62[_0x346046]);}}this['createSquareMessage'](_0x3c7f62[_0xfeed('0xc3')],_0xfeed('0xc4'));return this[_0xfeed('0x33')]['noop'](util[_0xfeed('0x26')](_0xfeed('0xc5'),_0x3c7f62['speech']));}return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x50cae7,_0xfeed('0xc6'));};AGIVertices['prototype']['sesteknda']=function(_0x30fc7a){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0xc7'),_0x30fc7a[_0xfeed('0x35')]));if(!this[_0xfeed('0x7e')](_0x30fc7a[_0xfeed('0xc8')])){return this[_0xfeed('0x33')][_0xfeed('0x8c')](_0xfeed('0xc9'));}if(!this[_0xfeed('0x7e')](_0x30fc7a[_0xfeed('0xca')])){return this[_0xfeed('0x33')][_0xfeed('0x8c')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x30fc7a[_0xfeed('0xcb')])){return this['channel']['noop'](_0xfeed('0xcc'));}if(!this['isConfigured'](_0x30fc7a[_0xfeed('0xcd')])){return this[_0xfeed('0x33')][_0xfeed('0x8c')](_0xfeed('0x93'));}this[_0xfeed('0x33')][_0xfeed('0xbf')]=!![];this[_0xfeed('0x32')](_0x30fc7a);this[_0xfeed('0x3e')](_0x30fc7a[_0xfeed('0x59')],'in');this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')]('Trying\x20SestekNDA:\x20%s',_0x30fc7a[_0xfeed('0x59')]));var _0x217cd7=this[_0xfeed('0x5d')][_0xfeed('0x7f')](this,_0x30fc7a);if(_0x217cd7){for(var _0x3a65dc in _0x217cd7){if(_0x217cd7[_0xfeed('0x73')](_0x3a65dc)){this['channel']['setVariable'](util[_0xfeed('0x26')]('SESTEK_NDA_%s',_0x3a65dc[_0xfeed('0xc2')]()),_0x217cd7[_0x3a65dc]);}}this[_0xfeed('0x3e')](_0x217cd7[_0xfeed('0xc3')],_0xfeed('0xc4'));if(_0x217cd7[_0xfeed('0xce')]){this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0xcf'),_0x217cd7[_0xfeed('0xce')]));var _0x155f37=this[_0xfeed('0x33')]['streamFile'](_0x217cd7[_0xfeed('0xce')]);try{fs['unlink'](_0x217cd7['audiofile']+_0xfeed('0xd0'));}catch(_0x3205dd){logger[_0xfeed('0x28')](_0x3205dd);}return _0x155f37;}else{return this['channel']['noop'](util[_0xfeed('0x26')]('SestekNDA\x20Result\x20%s',_0x217cd7[_0xfeed('0xc3')]));}}return this['channel'][_0xfeed('0x28')](_0x30fc7a,_0xfeed('0xd1'));};AGIVertices[_0xfeed('0xb')]['end']=function(_0x5e2497){logger['info'](util[_0xfeed('0x26')]('Enter\x20in\x20END\x20(%s)\x20block',_0x5e2497['label']));return this[_0xfeed('0x33')][_0xfeed('0x8c')](_0xfeed('0xd2'));};AGIVertices[_0xfeed('0xb')]['ext_dial']=function(_0x4c426d){logger[_0xfeed('0x2a')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x4c426d['label']));var _0x12dda9='';if(_0x4c426d['trunk_id']){if(!this[_0xfeed('0x7e')](_0x4c426d[_0xfeed('0xd3')])){return this['channel'][_0xfeed('0x28')](_0x4c426d,_0xfeed('0xd4'));}else{var _0x217d35=parseInt(_0x4c426d[_0xfeed('0xd3')],0xa);if(isNaN(_0x217d35)){_0x12dda9=_0x4c426d['trunk_id'];}else{_0x12dda9=this[_0xfeed('0x1b')][_0xfeed('0x7f')](this,_0x4c426d[_0xfeed('0xd3')]);if(!_0x12dda9){return this[_0xfeed('0x33')]['error'](_0x4c426d,_0xfeed('0xd5'));}}}}else if(_0x4c426d['trunk_name']){_0x12dda9=_0x4c426d[_0xfeed('0xd6')];}else{return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x4c426d,_0xfeed('0xd4'));}var _0x49f1b5=this['channel'][_0xfeed('0x51')](_0xfeed('0xb9'),[util['format'](_0xfeed('0xd7'),_0x12dda9,_0x4c426d['phone']),_0x4c426d[_0xfeed('0x86')],_0x4c426d[_0xfeed('0xd8')],_0x4c426d[_0xfeed('0xbb')]]);if(_0x49f1b5[_0xfeed('0x7b')]===-0x1){return _0x49f1b5;}return this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0xbc'),_0xfeed('0xb9')));};AGIVertices['prototype'][_0xfeed('0xd9')]=function(_0x1497a8){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x1497a8[_0xfeed('0x35')]));return this[_0xfeed('0x33')][_0xfeed('0x8c')](_0xfeed('0xd9'));};AGIVertices['prototype']['getdigits']=function(_0x5e7710){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0xda'),_0x5e7710[_0xfeed('0x35')]));if(_0x5e7710[_0xfeed('0xdb')]===0x0){return this[_0xfeed('0x80')](_0x5e7710);}_0x5e7710[_0xfeed('0xdb')]-=0x1;if(!this['isConfigured'](_0x5e7710['file_id'])){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x5e7710,_0xfeed('0xdc'));}var _0x693012=this[_0xfeed('0xdd')][_0xfeed('0x7f')](this,_0x5e7710[_0xfeed('0xde')]);if(!_0x693012){return this['channel'][_0xfeed('0x28')](_0x5e7710,_0xfeed('0xdf'));}if(!this[_0xfeed('0x7e')](_0x5e7710[_0xfeed('0xad')])){return this[_0xfeed('0x33')]['error'](_0xfeed('0xae'));}var _0x3e6101=this[_0xfeed('0x33')][_0xfeed('0xe0')](_0x693012,_0x5e7710[_0xfeed('0xe1')],_0x5e7710[_0xfeed('0xe2')]);var _0x5ed490=_0x3e6101['result']?_0x3e6101[_0xfeed('0x7b')][_0xfeed('0x48')]():'';logger[_0xfeed('0x2a')](_0xfeed('0xe3'),JSON['stringify'](_0x3e6101));if(_0x3e6101[_0xfeed('0x7b')]===-0x1){this[_0xfeed('0x32')][_0xfeed('0x7f')](this,_0x5e7710,_0x5ed490);return _0x3e6101;}else if(_0x3e6101['extra']===_0xfeed('0x86')){_0x3e6101[_0xfeed('0x7b')]=_0x5ed490[_0xfeed('0x77')]>=parseInt(_0x5e7710[_0xfeed('0xe4')])?'x':'i';}else{_0x3e6101['result']=_0x5ed490[_0xfeed('0x77')]>=parseInt(_0x5e7710['mindigit'])&&_0x5ed490[_0xfeed('0x77')]<=parseInt(_0x5e7710['maxdigit'])?'x':'i';}var _0x1dfbb9=this[_0xfeed('0xc')]['sync'](this,_0x5e7710['variable_id']);if(!_0x1dfbb9){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x5e7710,_0xfeed('0xe5'));}this['channel'][_0xfeed('0x7d')](_0x1dfbb9,_0x5ed490);if(this[_0xfeed('0x7e')](_0x5e7710['hiddendigitsnum'])){var _0xecffd3=parseInt(_0x5e7710[_0xfeed('0xe6')],0xa);var _0x4b151b=rs[_0xfeed('0xe7')]({'charset':'*','length':_0xecffd3});var _0x4c6b02=_0x5ed490[_0xfeed('0x77')];if(_0x4c6b02>0x0){if(_0x4c6b02>_0xecffd3){this[_0xfeed('0x32')][_0xfeed('0x7f')](this,_0x5e7710,_0x5e7710[_0xfeed('0xe8')]===_0xfeed('0xe9')?_0x4b151b+_0x5ed490[_0xfeed('0xea')](_0xecffd3):_0x5ed490[_0xfeed('0xea')](0x0,_0x4c6b02-_0xecffd3)+_0x4b151b);}else{this[_0xfeed('0x32')][_0xfeed('0x7f')](this,_0x5e7710,rs[_0xfeed('0xe7')]({'charset':'*','length':_0x4c6b02}));}}else{this[_0xfeed('0x32')][_0xfeed('0x7f')](this,_0x5e7710,'');}}else{this[_0xfeed('0x32')][_0xfeed('0x7f')](this,_0x5e7710,_0x5ed490);}return _0x3e6101;};AGIVertices['prototype'][_0xfeed('0xeb')]=function(_0x5136d8){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0xec'),_0x5136d8[_0xfeed('0x35')]));return this[_0xfeed('0xa')](_0x5136d8);};AGIVertices['prototype']['goal']=function(_0x2f3743){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0xed'),_0x2f3743[_0xfeed('0x35')]));this[_0xfeed('0x32')][_0xfeed('0x7f')](this,_0x2f3743,_0x2f3743[_0xfeed('0xee')]);return this['channel']['noop'](util[_0xfeed('0x26')](_0xfeed('0xef'),_0x2f3743[_0xfeed('0xee')]));};AGIVertices[_0xfeed('0xb')]['awspolly']=function(_0x9aed3a){logger['info'](util[_0xfeed('0x26')](_0xfeed('0xf0'),_0x9aed3a[_0xfeed('0x35')]));if(!this[_0xfeed('0x7e')](_0x9aed3a[_0xfeed('0x63')])||!this[_0xfeed('0x7e')](_0x9aed3a[_0xfeed('0x64')])){return this['channel']['noop'](_0xfeed('0xf1'));}if(!this[_0xfeed('0x7e')](_0x9aed3a[_0xfeed('0x59')])){return this[_0xfeed('0x33')][_0xfeed('0x8c')](_0xfeed('0x93'));}this[_0xfeed('0x33')][_0xfeed('0x8c')](util['format'](_0xfeed('0xf2'),_0x9aed3a[_0xfeed('0x59')]));var _0x5879ca=this[_0xfeed('0x62')]['sync'](this,_0x9aed3a);if(_0x5879ca){this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0xf3'),_0x5879ca));var _0x4a5b3e=this[_0xfeed('0x33')]['streamFile'](_0x5879ca);try{fs[_0xfeed('0xf4')](_0x5879ca+_0xfeed('0xd0'));}catch(_0x5a2d5f){logger[_0xfeed('0x28')](_0x5a2d5f);}return _0x4a5b3e;}return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x9aed3a,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0xfeed('0xf5')]=function(_0x1896db){logger['info'](util['format'](_0xfeed('0xf6'),_0x1896db[_0xfeed('0x35')]));if(!this['isConfigured'](_0x1896db[_0xfeed('0x63')])||!this[_0xfeed('0x7e')](_0x1896db[_0xfeed('0x64')])){return this[_0xfeed('0x33')]['noop'](_0xfeed('0xf1'));}if(!this['isConfigured'](_0x1896db['aws_bot_name'])){return this[_0xfeed('0x33')][_0xfeed('0x8c')](_0xfeed('0xf7'));}if(!this['isConfigured'](_0x1896db[_0xfeed('0x59')])){return this['channel'][_0xfeed('0x8c')](_0xfeed('0x93'));}this[_0xfeed('0x33')][_0xfeed('0xbf')]=!![];this['createSquareDetailsReport'](_0x1896db);this[_0xfeed('0x3e')](_0x1896db[_0xfeed('0x59')],'in');this['channel'][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0xf8'),_0x1896db['text']));var _0x71cdfc=this['awsLex'][_0xfeed('0x7f')](this,_0x1896db);if(_0x71cdfc){for(var _0x3c5b93 in _0x71cdfc){if(_0x71cdfc[_0xfeed('0x73')](_0x3c5b93)&&_['isString'](_0x71cdfc[_0x3c5b93])){this[_0xfeed('0x33')][_0xfeed('0x7d')](util['format'](_0xfeed('0xf9'),_0x3c5b93[_0xfeed('0xc2')]()),_0x71cdfc[_0x3c5b93]);}}if(_[_0xfeed('0x43')](_0x71cdfc[_0xfeed('0xfa')])){return this['channel'][_0xfeed('0x8c')](_0xfeed('0xfb'));}else{this['createSquareMessage'](_0x71cdfc[_0xfeed('0xfa')],_0xfeed('0xc4'));return this[_0xfeed('0x33')]['noop'](util[_0xfeed('0x26')](_0xfeed('0xfc'),_0x71cdfc[_0xfeed('0xfa')]));}}return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x1896db,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xfeed('0xb')][_0xfeed('0xfd')]=function(_0x5e67ad){logger['info'](util[_0xfeed('0x26')](_0xfeed('0xfe'),_0x5e67ad['label'],_0x5e67ad[_0xfeed('0x86')]));if(!this[_0xfeed('0x7e')](_0x5e67ad[_0xfeed('0x5b')])){return this[_0xfeed('0x33')][_0xfeed('0x8c')](_0xfeed('0xbe'));}var _0x28625e=_0xfeed('0xff');var _0x197e1e=util[_0xfeed('0x26')]('%s/recordings/%s',FILES_PATH,rs[_0xfeed('0xe7')](0x4));var _0x32f92c=util[_0xfeed('0x26')](_0xfeed('0x100'),_0x197e1e,_0x28625e);var _0x5de5a0=!![];if(_0x5e67ad[_0xfeed('0x101')]==='NOBEEP'){_0x5de5a0=![];}var _0xbd3d0d=this[_0xfeed('0x33')][_0xfeed('0x102')](_0x197e1e,_0x28625e,_0x5e67ad[_0xfeed('0x103')],_0x5e67ad[_0xfeed('0x86')],undefined,_0x5de5a0);if(_0xbd3d0d[_0xfeed('0x7b')]!==-0x1){this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x104'),_0x32f92c));var _0x3f9bf0=this[_0xfeed('0x6a')][_0xfeed('0x7f')](this,_0x5e67ad,_0x32f92c);if(_0x3f9bf0){for(var _0x65f5fc in _0x3f9bf0){if(_0x3f9bf0['hasOwnProperty'](_0x65f5fc)){this[_0xfeed('0x33')]['setVariable'](util[_0xfeed('0x26')](_0xfeed('0x105'),_0x65f5fc[_0xfeed('0xc2')]()),_0x3f9bf0[_0x65f5fc]);}}return this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x106'),JSON[_0xfeed('0x107')](_0x3f9bf0)));}}return _0xbd3d0d;};AGIVertices[_0xfeed('0xb')][_0xfeed('0x108')]=function(_0x43ca90){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x109'),_0x43ca90[_0xfeed('0x35')]));if(!this[_0xfeed('0x7e')](_0x43ca90[_0xfeed('0x6d')])){return this[_0xfeed('0x33')]['noop'](_0xfeed('0x10a'));}if(!this[_0xfeed('0x7e')](_0x43ca90[_0xfeed('0x6e')])){return this[_0xfeed('0x33')][_0xfeed('0x8c')](_0xfeed('0x10b'));}var _0x17e83c=_0xfeed('0xff');var _0x9ff583=util[_0xfeed('0x26')](_0xfeed('0x10c'),FILES_PATH,rs['generate'](0x4));var _0x30af0f=util['format'](_0xfeed('0x100'),_0x9ff583,_0x17e83c);var _0x9506f=!![];if(_0x43ca90[_0xfeed('0x101')]===_0xfeed('0x10d')){_0x9506f=![];}var _0x3b9d19=this[_0xfeed('0x33')][_0xfeed('0x102')](_0x9ff583,_0x17e83c,_0x43ca90[_0xfeed('0x103')],_0x43ca90[_0xfeed('0x86')],undefined,_0x9506f);if(_0x3b9d19[_0xfeed('0x7b')]!==-0x1){this['channel'][_0xfeed('0x8c')](util['format'](_0xfeed('0x10e'),_0x30af0f));var _0x2ef547=this[_0xfeed('0x6c')][_0xfeed('0x7f')](this,_0x43ca90,_0x30af0f);if(_0x2ef547){for(var _0x19540d in _0x2ef547){if(_0x2ef547[_0xfeed('0x73')](_0x19540d)){this['channel'][_0xfeed('0x7d')](util[_0xfeed('0x26')]('TILDE_ASR_%s',_0x19540d[_0xfeed('0xc2')]()),_0x2ef547[_0x19540d]);}}return this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x10f'),JSON['stringify'](_0x2ef547)));}}return _0x3b9d19;};AGIVertices[_0xfeed('0xb')][_0xfeed('0x110')]=function(_0x5ba0af){logger['info'](util[_0xfeed('0x26')](_0xfeed('0x111'),_0x5ba0af[_0xfeed('0x35')]));return this[_0xfeed('0x33')][_0xfeed('0x112')](_0x5ba0af[_0xfeed('0x113')],_0x5ba0af[_0xfeed('0x39')],_0x5ba0af['priority']);};AGIVertices['prototype']['gotoif']=function(_0xe544e8){logger[_0xfeed('0x2a')](util['format'](_0xfeed('0x114'),_0xe544e8[_0xfeed('0x35')]));if(!this[_0xfeed('0x7e')](_0xe544e8[_0xfeed('0x115')])){return this[_0xfeed('0x33')]['error'](_0xe544e8,'no\x20condition\x20configured');}try{var _0x2e5fcb=eval(_0xe544e8['condition'])?_0xfeed('0x116'):_0xfeed('0x117');this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x118'),_0xe544e8[_0xfeed('0x115')],_0x2e5fcb));return{'code':0xc8,'result':_0x2e5fcb};}catch(_0xa7f4a){return{'code':0xc8,'result':_0xfeed('0x117')};}};AGIVertices[_0xfeed('0xb')][_0xfeed('0x119')]=function(_0x1f17f7){logger[_0xfeed('0x2a')](util['format'](_0xfeed('0x11a'),_0x1f17f7[_0xfeed('0x35')]));if(!this[_0xfeed('0x7e')](_0x1f17f7[_0xfeed('0x11b')])){return this['channel']['error'](_0x1f17f7,_0xfeed('0x11c'));}var _0x3aa275=this[_0xfeed('0x21')][_0xfeed('0x7f')](this,_0x1f17f7[_0xfeed('0x11b')]);if(!_0x3aa275){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x1f17f7,_0xfeed('0x11d'));}for(var _0x4bbfc=0x0;_0x4bbfc<_0x3aa275['length'];_0x4bbfc+=0x1){var _0x485fcb=this[_0xfeed('0x33')][_0xfeed('0xc')](util[_0xfeed('0x26')](_0xfeed('0x11e'),_0x3aa275[_0x4bbfc]));if(_0x485fcb[_0xfeed('0x7b')]===-0x1){return _0x485fcb;}logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x3aa275[_0x4bbfc],_0x485fcb['extra']));if(_0x485fcb[_0xfeed('0x79')]===_0xfeed('0x116')){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x11f'),_0x3aa275[_0x4bbfc],_0xfeed('0x116')));this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x11f'),_0x3aa275[_0x4bbfc],'true'));return{'code':0xc8,'result':'true'};}else{logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x11f'),_0x3aa275[_0x4bbfc],_0xfeed('0x117')));this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x11f'),_0x3aa275[_0x4bbfc],_0xfeed('0x117')));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0xfeed('0x120')]=function(_0x31cef3){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x121'),_0x31cef3[_0xfeed('0x35')]));return this[_0xfeed('0x33')][_0xfeed('0x120')]();};AGIVertices[_0xfeed('0xb')][_0xfeed('0x122')]=function(_0x1473d2){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x123'),_0x1473d2[_0xfeed('0x35')]));if(!this[_0xfeed('0x7e')](_0x1473d2[_0xfeed('0x5b')])){return this[_0xfeed('0x33')]['noop']('no\x20key\x20configured');}var _0x482cd9=_0xfeed('0xff');var _0x340d0b=util[_0xfeed('0x26')](_0xfeed('0x10c'),FILES_PATH,rs['generate'](0x4));var _0x5a3246=util['format'](_0xfeed('0x100'),_0x340d0b,_0x482cd9);var _0x3786ab=!![];if(_0x1473d2[_0xfeed('0x101')]===_0xfeed('0x10d')){_0x3786ab=![];}var _0x3c3b51=this['channel'][_0xfeed('0x102')](_0x340d0b,_0x482cd9,_0x1473d2[_0xfeed('0x103')],_0x1473d2[_0xfeed('0x86')],undefined,_0x3786ab);if(_0x3c3b51[_0xfeed('0x7b')]!==-0x1){this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x124'),_0x5a3246));var _0x3e177a=this[_0xfeed('0x60')][_0xfeed('0x7f')](this,_0x1473d2,_0x5a3246);if(_0x3e177a){for(var _0x2fea17 in _0x3e177a){if(_0x3e177a[_0xfeed('0x73')](_0x2fea17)){this[_0xfeed('0x33')][_0xfeed('0x7d')](util[_0xfeed('0x26')](_0xfeed('0x125'),_0x2fea17[_0xfeed('0xc2')]()),_0x3e177a[_0x2fea17]);}}return this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x126'),JSON[_0xfeed('0x107')](_0x3e177a)));}}return _0x3c3b51;};AGIVertices[_0xfeed('0xb')][_0xfeed('0x127')]=function(_0x3e7720){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x128'),_0x3e7720[_0xfeed('0x35')]));if(!this['isConfigured'](_0x3e7720[_0xfeed('0x5b')])){return this[_0xfeed('0x33')][_0xfeed('0x8c')]('no\x20key\x20configured');}if(!this[_0xfeed('0x7e')](_0x3e7720['text'])){return this[_0xfeed('0x33')][_0xfeed('0x8c')](_0xfeed('0x93'));}this[_0xfeed('0x33')]['noop'](util['format'](_0xfeed('0x129'),_0x3e7720[_0xfeed('0x59')]));var _0x4a1948=this[_0xfeed('0x5e')]['sync'](this,_0x3e7720);if(_0x4a1948){this[_0xfeed('0x33')][_0xfeed('0x8c')](util['format'](_0xfeed('0x124'),_0x4a1948));var _0x5dff19=this['channel'][_0xfeed('0x12a')](_0x4a1948,_0x3e7720['intKey']);try{fs[_0xfeed('0xf4')](_0x4a1948+_0xfeed('0xd0'));}catch(_0x22104a){logger[_0xfeed('0x28')](_0x22104a);}return _0x5dff19;}return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x3e7720,_0xfeed('0x12b'));};AGIVertices[_0xfeed('0xb')]['login']=function(_0x32bdff){logger[_0xfeed('0x2a')](util['format'](_0xfeed('0x12c'),_0x32bdff[_0xfeed('0x35')]));if(!this[_0xfeed('0x7e')](_0x32bdff[_0xfeed('0x12d')])){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x32bdff,_0xfeed('0x12e'));}logger['info'](util[_0xfeed('0x26')](_0xfeed('0x12f'),this[_0xfeed('0x33')][_0xfeed('0x37')],_0x32bdff[_0xfeed('0x12d')]));var _0x4295ba=this[_0xfeed('0x130')][_0xfeed('0x7f')](this,_0x32bdff[_0xfeed('0x12d')]);if(_0x4295ba){logger['info'](util[_0xfeed('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x32bdff[_0xfeed('0x12d')]));this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x131'),this[_0xfeed('0x33')][_0xfeed('0x37')],_0x32bdff[_0xfeed('0x12d')]));return{'code':0xc8,'result':'success'};}else{logger[_0xfeed('0x2a')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfeed('0x33')][_0xfeed('0x37')],_0x32bdff[_0xfeed('0x12d')]));this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x132'),this[_0xfeed('0x33')][_0xfeed('0x37')],_0x32bdff['findBy']));return{'code':0xc8,'result':_0xfeed('0x133')};}};AGIVertices['prototype']['logout']=function(_0x25202e){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x134'),_0x25202e[_0xfeed('0x35')]));if(!this[_0xfeed('0x7e')](_0x25202e[_0xfeed('0x12d')])){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x25202e,'no\x20find\x20by\x20configured');}logger[_0xfeed('0x2a')](util['format'](_0xfeed('0x12f'),this[_0xfeed('0x33')][_0xfeed('0x37')],_0x25202e[_0xfeed('0x12d')]));var _0xfd8034=this[_0xfeed('0x4d')][_0xfeed('0x7f')](this,_0x25202e[_0xfeed('0x12d')]);if(_0xfd8034){logger[_0xfeed('0x2a')](util['format'](_0xfeed('0x131'),this[_0xfeed('0x33')][_0xfeed('0x37')],_0x25202e['findBy']));this[_0xfeed('0x33')][_0xfeed('0x8c')](util['format'](_0xfeed('0x131'),this[_0xfeed('0x33')]['callerid'],_0x25202e[_0xfeed('0x12d')]));return{'code':0xc8,'result':_0xfeed('0x135')};}else{logger[_0xfeed('0x2a')](util['format'](_0xfeed('0x132'),this[_0xfeed('0x33')][_0xfeed('0x37')],_0x25202e[_0xfeed('0x12d')]));this[_0xfeed('0x33')][_0xfeed('0x8c')](util['format'](_0xfeed('0x132'),this[_0xfeed('0x33')][_0xfeed('0x37')],_0x25202e[_0xfeed('0x12d')]));return{'code':0xc8,'result':_0xfeed('0x133')};}};AGIVertices[_0xfeed('0xb')]['math']=function(_0x541d10){logger[_0xfeed('0x2a')](util['format'](_0xfeed('0x136'),_0x541d10[_0xfeed('0x35')]));if(!this[_0xfeed('0x7e')](_0x541d10['operation'])){return this['channel'][_0xfeed('0x28')](_0x541d10,'no\x20operation\x20configured');}this['channel']['noop'](util[_0xfeed('0x26')](_0xfeed('0x137'),_0x541d10['operation']));var _0x269335=eval(_0x541d10[_0xfeed('0x138')]);if(!this[_0xfeed('0x7e')](_0x541d10[_0xfeed('0xad')])){return this[_0xfeed('0x33')]['noop'](_0xfeed('0xae'));}var _0x20cb56=this['getVariable'][_0xfeed('0x7f')](this,_0x541d10[_0xfeed('0xad')]);if(!_0x20cb56){return this[_0xfeed('0x33')]['error'](_0x541d10,_0xfeed('0xe5'));}if(_[_0xfeed('0x139')](_0x269335)){var _0x125e1f=this;_0x269335[_0xfeed('0xaf')](function(_0x5c09e3,_0x10e63a){_0x125e1f['channel'][_0xfeed('0x7d')](util['format'](_0xfeed('0x13a'),_0x20cb56,_0x10e63a),_0x5c09e3);});return this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')]('variable\x20%s[key]\x20set',_0x20cb56));}else{return this[_0xfeed('0x33')][_0xfeed('0x7d')](_0x20cb56,_0x269335);}};AGIVertices[_0xfeed('0xb')][_0xfeed('0x13b')]=function(_0xeddce6){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x13c'),_0xeddce6['label']));if(_0xeddce6['retry']===0x0){return this[_0xfeed('0x80')](_0xeddce6);}_0xeddce6['retry']-=0x1;if(!this[_0xfeed('0x7e')](_0xeddce6[_0xfeed('0xde')])){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0xeddce6,_0xfeed('0xdc'));}var _0x464699=this[_0xfeed('0xdd')][_0xfeed('0x7f')](this,_0xeddce6[_0xfeed('0xde')]);if(!_0x464699){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0xeddce6,_0xfeed('0xdf'));}var _0xbd2b66=this[_0xfeed('0x33')][_0xfeed('0xe0')](_0x464699,_0xeddce6[_0xfeed('0xe1')],_0xeddce6['digit']);var _0x526080=_0xbd2b66['result'];if(_0xbd2b66[_0xfeed('0x7b')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0xeddce6,'-1');return _0xbd2b66;}else if(_0xbd2b66[_0xfeed('0x79')]===_0xfeed('0x86')){_0xbd2b66[_0xfeed('0x7b')]=_0xbd2b66[_0xfeed('0x7b')][_0xfeed('0x77')]>0x0?_0xbd2b66['result']:'t';}else if(_[_0xfeed('0x40')](_0xbd2b66[_0xfeed('0x7b')])){_0xbd2b66['result']='#';_0x526080='#';}if(!this[_0xfeed('0x7e')](_0xeddce6[_0xfeed('0xad')])){this[_0xfeed('0x33')][_0xfeed('0x8c')](_0xfeed('0xae'));}else{var _0x29ef78=this[_0xfeed('0xc')]['sync'](this,_0xeddce6['variable_id']);if(!_0x29ef78){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0xeddce6,'no\x20variable\x20found');}this[_0xfeed('0x33')][_0xfeed('0x7d')](_0x29ef78,_0x526080);}this[_0xfeed('0x32')][_0xfeed('0x7f')](this,_0xeddce6,_0x526080);return _0xbd2b66;};AGIVertices['prototype'][_0xfeed('0x8c')]=function(_0x3a2eb3){logger[_0xfeed('0x2a')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x3a2eb3['label']));return this[_0xfeed('0x33')][_0xfeed('0x8c')](_0x3a2eb3['output']||_0x3a2eb3[_0xfeed('0x35')]);};AGIVertices[_0xfeed('0xb')][_0xfeed('0x13d')]=function(_0x3b886c){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x13e'),_0x3b886c[_0xfeed('0x35')]));if(!this['isConfigured'](_0x3b886c[_0xfeed('0x12d')])){return this[_0xfeed('0x33')]['error'](_0x3b886c,_0xfeed('0x12e'));}logger['info'](util['format'](_0xfeed('0x12f'),this[_0xfeed('0x33')][_0xfeed('0x37')],_0x3b886c[_0xfeed('0x12d')]));var _0x378054=this[_0xfeed('0x13f')]['sync'](this,_0x3b886c[_0xfeed('0x140')]);var _0x2e1783=this['agentPause'][_0xfeed('0x7f')](this,_0x3b886c[_0xfeed('0x12d')],_0x378054);if(_0x2e1783){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x131'),this['channel']['callerid'],_0x3b886c[_0xfeed('0x12d')]));this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x131'),this['channel'][_0xfeed('0x37')],_0x3b886c[_0xfeed('0x12d')]));return{'code':0xc8,'result':_0xfeed('0x135')};}else{logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x132'),this[_0xfeed('0x33')][_0xfeed('0x37')],_0x3b886c[_0xfeed('0x12d')]));this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x131'),this[_0xfeed('0x33')][_0xfeed('0x37')],_0x3b886c[_0xfeed('0x12d')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xfeed('0xb')][_0xfeed('0x141')]=function(_0x368c7c){logger[_0xfeed('0x2a')](util['format'](_0xfeed('0x142'),_0x368c7c[_0xfeed('0x35')]));if(!this['isConfigured'](_0x368c7c[_0xfeed('0xde')])){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x368c7c,_0xfeed('0xdc'));}var _0x52bbaf=this[_0xfeed('0xdd')][_0xfeed('0x7f')](this,_0x368c7c[_0xfeed('0xde')]);if(!_0x52bbaf){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x368c7c,_0xfeed('0xdf'));}var _0x579692=this[_0xfeed('0x33')][_0xfeed('0x51')](_0xfeed('0x143'),[_0x52bbaf,_0x368c7c[_0xfeed('0xd8')]]);if(_0x579692[_0xfeed('0x7b')]===-0x1){return _0x579692;}return this['channel'][_0xfeed('0x8c')](util['format']('Executed\x20command\x20%s\x20%s',_0xfeed('0x143'),_0x52bbaf));};AGIVertices['prototype'][_0xfeed('0x144')]=function(_0x1f5ede){logger['info'](util['format'](_0xfeed('0x145'),_0x1f5ede[_0xfeed('0x35')]));if(!this[_0xfeed('0x7e')](_0x1f5ede['queue_id'])){return this['channel'][_0xfeed('0x28')](_0x1f5ede,'no\x20queue\x20selected');}var _0x3268db='';var _0x122ee4=parseInt(_0x1f5ede[_0xfeed('0x146')],0xa);if(isNaN(_0x122ee4)){_0x3268db=_0x1f5ede[_0xfeed('0x146')];}else{_0x3268db=this[_0xfeed('0x10')][_0xfeed('0x7f')](this,_0x1f5ede[_0xfeed('0x146')]);if(!_0x3268db){return this['channel'][_0xfeed('0x28')](_0x1f5ede,_0xfeed('0x147'));}}var _0x446fc6='';if(this[_0xfeed('0x7e')](_0x1f5ede['file_id'])){var _0x423dfc=this[_0xfeed('0xdd')][_0xfeed('0x7f')](this,_0x1f5ede[_0xfeed('0xde')]);if(_0x423dfc){_0x446fc6=_0x423dfc;}}this[_0xfeed('0x32')]['sync'](this,_0x1f5ede,_0x3268db);if(_0x1f5ede['opts'][_0xfeed('0x148')]('x')<0x0){_0x1f5ede[_0xfeed('0xd8')]+='x';}if(_0x1f5ede['opts'][_0xfeed('0x148')]('X')<0x0){_0x1f5ede[_0xfeed('0xd8')]+='X';}this[_0xfeed('0x33')]['setVariable'](_0xfeed('0x149'),_0x3268db?_0x3268db[_0xfeed('0x14a')]():'');var _0xb851b1=this['channel'][_0xfeed('0x51')]('QUEUE',[_0x3268db,_0x1f5ede['opts'],_0x1f5ede[_0xfeed('0xbb')],_0x446fc6,_0x1f5ede[_0xfeed('0x86')],_0x1f5ede[_0xfeed('0x7')],_0x1f5ede[_0xfeed('0x14b')],_0x1f5ede[_0xfeed('0x14c')],'',_0x1f5ede[_0xfeed('0x14d')]]);if(_0xb851b1[_0xfeed('0x7b')]===-0x1){return _0xb851b1;}return this[_0xfeed('0x33')][_0xfeed('0x8c')](util['format'](_0xfeed('0x91'),_0xfeed('0x14e'),_0x3268db));};AGIVertices[_0xfeed('0xb')][_0xfeed('0x14f')]=function(_0x41753b){logger[_0xfeed('0x2a')](util['format'](_0xfeed('0x150'),_0x41753b[_0xfeed('0x35')]));var _0x3f212f=_0x41753b['recordingFormat']||_0xfeed('0xff');var _0x2b692e=util['format'](_0xfeed('0x151'),this[_0xfeed('0x33')][_0xfeed('0x34')],rs[_0xfeed('0xe7')](0x5));var _0x589c21=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x2b692e,_0x3f212f);var _0x1e55a7=util['format'](_0xfeed('0x10c'),FILES_PATH,_0x2b692e);this['createSquareRecording'][_0xfeed('0x7f')](this,_0x41753b,_0x2b692e,_0x589c21);this['channel'][_0xfeed('0x7d')](_0xfeed('0x152'),_0x2b692e);logger[_0xfeed('0x2a')](_0xfeed('0x153'),_0x1e55a7,_0x3f212f,_0x41753b[_0xfeed('0x154')],_0x41753b[_0xfeed('0x86')]);return this['channel'][_0xfeed('0x102')](_0x1e55a7,_0x3f212f,_0x41753b[_0xfeed('0x154')],_0x41753b[_0xfeed('0x86')],undefined,!![]);};AGIVertices['prototype'][_0xfeed('0x155')]=function(_0xea2ca1){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x156'),_0xea2ca1['label']));return this['channel'][_0xfeed('0x157')](_0xea2ca1[_0xfeed('0x158')][_0xfeed('0xab')](/\s+/g,''),_0xea2ca1[_0xfeed('0x154')]);};AGIVertices[_0xfeed('0xb')]['saynumber']=function(_0x4e1841){logger[_0xfeed('0x2a')](util['format'](_0xfeed('0x159'),_0x4e1841['label']));return this[_0xfeed('0x33')][_0xfeed('0x15a')](_0x4e1841[_0xfeed('0x15b')][_0xfeed('0xab')](/\s+/g,''),_0x4e1841[_0xfeed('0x154')]);};AGIVertices['prototype'][_0xfeed('0x15c')]=function(_0x510801){logger['info'](util['format'](_0xfeed('0x15d'),_0x510801['label']));return this[_0xfeed('0x33')][_0xfeed('0x15e')](_0x510801[_0xfeed('0x59')],_0x510801['escape_digits']);};AGIVertices[_0xfeed('0xb')]['sendMail']=function(_0x5c0e86){logger['info'](util[_0xfeed('0x26')](_0xfeed('0x15f'),_0x5c0e86[_0xfeed('0x35')]));if(!this['isConfigured'](_0x5c0e86[_0xfeed('0x160')])){return this[_0xfeed('0x33')][_0xfeed('0x8c')](_0xfeed('0x161'));}var _0x39938c=this[_0xfeed('0x1e')]['sync'](this,_0x5c0e86[_0xfeed('0x160')]);if(!_0x39938c||!_0x39938c[_0xfeed('0x162')]){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x5c0e86,_0xfeed('0x163'));}var _0x1cd631={'from':util[_0xfeed('0x26')]('\x22%s\x22\x20<%s>',_0x39938c[_0xfeed('0xf')],_0x39938c['email']||_0x39938c[_0xfeed('0x162')][_0xfeed('0x164')]),'to':_0x5c0e86['to']||'','cc':_0x5c0e86['cc']||'','bcc':_0x5c0e86[_0xfeed('0x165')]||'','subject':_0x5c0e86[_0xfeed('0x166')],'html':_0x5c0e86['text'],'text':_0x5c0e86[_0xfeed('0x59')]};var _0x217245={'tls':{'rejectUnauthorized':![]}};if(_0x39938c[_0xfeed('0x162')][_0xfeed('0x167')]){_0x217245[_0xfeed('0x167')]=_0x39938c['Smtp'][_0xfeed('0x167')];}else{_0x217245[_0xfeed('0x168')]=_0x39938c[_0xfeed('0x162')][_0xfeed('0x168')];_0x217245['port']=_0x39938c[_0xfeed('0x162')][_0xfeed('0x169')];_0x217245[_0xfeed('0x16a')]=_0x39938c[_0xfeed('0x162')]['secure'];}if(_0x39938c['Smtp'][_0xfeed('0x16b')]){_0x217245[_0xfeed('0x16c')]={'user':_0x39938c[_0xfeed('0x162')][_0xfeed('0x164')],'pass':_0x39938c[_0xfeed('0x162')]['pass']};}if(this[_0xfeed('0x7e')](_0x5c0e86[_0xfeed('0x16d')])){}logger[_0xfeed('0xb4')](_0xfeed('0x16e'),JSON['stringify'](_0x1cd631));this[_0xfeed('0x32')]['sync'](this,_0x5c0e86,_0x5c0e86[_0xfeed('0x160')]);this['channel'][_0xfeed('0x8c')](util[_0xfeed('0x26')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x39938c[_0xfeed('0xf')]));this[_0xfeed('0x20')][_0xfeed('0x7f')](this,_0x217245,_0x1cd631);return this['channel'][_0xfeed('0x8c')](_0xfeed('0x16f'));};AGIVertices[_0xfeed('0xb')][_0xfeed('0x170')]=function(_0x385ce0){logger['info'](util[_0xfeed('0x26')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x385ce0['label']));return this[_0xfeed('0x33')][_0xfeed('0x8c')](_0xfeed('0x171'));};AGIVertices[_0xfeed('0xb')][_0xfeed('0x172')]=function(_0x4f0fe0){logger['info'](util[_0xfeed('0x26')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x4f0fe0[_0xfeed('0x35')]));if(!this[_0xfeed('0x7e')](_0x4f0fe0[_0xfeed('0x173')])){return this[_0xfeed('0x33')][_0xfeed('0x8c')]('no\x20sms\x20account\x20configured');}var _0x1fa5ae=this[_0xfeed('0x2f')][_0xfeed('0x7f')](this,_0x4f0fe0[_0xfeed('0x173')]);if(!_0x1fa5ae){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x4f0fe0,_0xfeed('0x174'));}var _0x57dea6={'body':_0x4f0fe0[_0xfeed('0x175')],'phone':_0x4f0fe0['to']||'','SmsAccountId':_0x1fa5ae['id']};logger[_0xfeed('0xb4')](_0xfeed('0x176'),JSON[_0xfeed('0x107')](_0x57dea6));this[_0xfeed('0x32')][_0xfeed('0x7f')](this,_0x4f0fe0,_0x4f0fe0[_0xfeed('0x173')]);this[_0xfeed('0x33')]['noop'](util[_0xfeed('0x26')](_0xfeed('0x177'),_0x1fa5ae[_0xfeed('0xf')]));this[_0xfeed('0x31')][_0xfeed('0x7f')](this,_0x57dea6);return this[_0xfeed('0x33')][_0xfeed('0x8c')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0xfeed('0x178')]=function(_0x2125b6){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x179'),_0x2125b6['label']));if(!this[_0xfeed('0x7e')](_0x2125b6[_0xfeed('0xad')])){return this[_0xfeed('0x33')]['error'](_0x2125b6,_0xfeed('0x17a'));}var _0x48f70b=this[_0xfeed('0xc')][_0xfeed('0x7f')](this,_0x2125b6[_0xfeed('0xad')]);if(!_0x48f70b){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x2125b6,_0xfeed('0xe5'));}return this[_0xfeed('0x33')][_0xfeed('0x7d')](_0x48f70b,_0x2125b6[_0xfeed('0x17b')]);};AGIVertices[_0xfeed('0xb')][_0xfeed('0x17c')]=function(_0x4ce6e0){logger[_0xfeed('0x2a')](util['format'](_0xfeed('0x17d'),_0x4ce6e0[_0xfeed('0x35')]));this[_0xfeed('0x33')]['noop']('START\x20CALLY\x20SQUARE');if(_0x4ce6e0[_0xfeed('0x83')]===_0xfeed('0x17e')){this[_0xfeed('0x33')][_0xfeed('0x8c')](_0xfeed('0x17f'));return this['channel']['answer']();}return this[_0xfeed('0x33')][_0xfeed('0x8c')](_0xfeed('0x180'));};AGIVertices[_0xfeed('0xb')]['subproject']=function(_0x504021){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x504021[_0xfeed('0x35')]));if(!this[_0xfeed('0x7e')](_0x504021[_0xfeed('0x181')])){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x504021,_0xfeed('0x182'));}var _0x58291a=this[_0xfeed('0x14')][_0xfeed('0x7f')](this,_0x504021[_0xfeed('0x181')]);if(!this[_0xfeed('0x7e')](_0x58291a)){return this['channel']['error'](_0x504021,util['format'](_0xfeed('0x183'),_0x504021[_0xfeed('0x181')]));}if(_0x58291a===this[_0xfeed('0x33')][_0xfeed('0x36')]){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x504021,_0xfeed('0x184'));}this['createSquareDetailsReport'][_0xfeed('0x7f')](this,_0x504021,_0x58291a);var _0x4173ca=this[_0xfeed('0x33')][_0xfeed('0x51')](_0xfeed('0x185'),util[_0xfeed('0x26')](_0xfeed('0x186'),config['agi']['host']||_0xfeed('0x187'),_0x58291a,this[_0xfeed('0x33')]['arg_1']));if(_0x4173ca['result']===-0x1){return _0x4173ca;}return this[_0xfeed('0x33')][_0xfeed('0x8c')](util['format']('Executed\x20command\x20%s\x20%s',_0xfeed('0x185'),_0x58291a));};AGIVertices[_0xfeed('0xb')][_0xfeed('0x188')]=function(_0x33aefa){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x33aefa[_0xfeed('0x35')]));var _0xfa4d3c=this[_0xfeed('0x50')][_0xfeed('0x7f')](this,_0x33aefa[_0xfeed('0x189')]);this['createSquareDetailsReport']['sync'](this,_0x33aefa,_0x33aefa['command']);if(this['isConfigured'](_0x33aefa[_0xfeed('0xad')])){var _0x3b6456=this[_0xfeed('0xc')][_0xfeed('0x7f')](this,_0x33aefa['variable_id']);if(_0x3b6456){this[_0xfeed('0x33')][_0xfeed('0x7d')](_0x3b6456,_0xfa4d3c);return this[_0xfeed('0x33')]['noop'](util['format'](_0xfeed('0x18a'),_0x33aefa[_0xfeed('0x189')],_0x3b6456));}}return this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x18b'),_0x33aefa[_0xfeed('0x189')]));};AGIVertices[_0xfeed('0xb')][_0xfeed('0x18c')]=function(_0x418148){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x418148[_0xfeed('0x35')]));if(!this[_0xfeed('0x7e')](_0x418148['apiKey'])){return this[_0xfeed('0x33')][_0xfeed('0x8c')](_0xfeed('0x18d'));}if(!this['isConfigured'](_0x418148[_0xfeed('0x59')])){return this['channel']['noop'](_0xfeed('0x93'));}this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x18e'),_0x418148['text']));var _0x41c8f8=this[_0xfeed('0x53')][_0xfeed('0x7f')](this,_0x418148);if(_0x41c8f8){this['channel'][_0xfeed('0x8c')](util['format'](_0xfeed('0x18f'),_0x41c8f8));var _0x4846cf=this[_0xfeed('0x33')][_0xfeed('0x12a')](_0x41c8f8);try{fs[_0xfeed('0xf4')](_0x41c8f8+_0xfeed('0xd0'));}catch(_0x5d280d){logger[_0xfeed('0x28')](_0x5d280d);}return _0x4846cf;}return this['channel'][_0xfeed('0x28')](_0x418148,_0xfeed('0x190'));};AGIVertices[_0xfeed('0xb')][_0xfeed('0x191')]=function(_0x363852){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x192'),_0x363852[_0xfeed('0x35')]));if(!this[_0xfeed('0x7e')](_0x363852[_0xfeed('0x59')])){return this[_0xfeed('0x33')][_0xfeed('0x8c')]('no\x20text\x20configured');}this[_0xfeed('0x33')][_0xfeed('0x8c')](util['format'](_0xfeed('0x193'),_0x363852[_0xfeed('0x59')]));var _0x1b2d50=this[_0xfeed('0x58')][_0xfeed('0x7f')](this,_0x363852);if(_0x1b2d50){this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')]('Google\x20TTS\x20%s\x20file\x20created',_0x1b2d50));var _0x34efff=this[_0xfeed('0x33')][_0xfeed('0x12a')](_0x1b2d50);try{fs[_0xfeed('0xf4')](_0x1b2d50+'.wav');}catch(_0x473f5f){logger['error'](_0x473f5f);}return _0x34efff;}return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x363852,_0xfeed('0x194'));};AGIVertices[_0xfeed('0xb')][_0xfeed('0x195')]=function(_0x5542c7){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x5542c7[_0xfeed('0x35')]));if(!this[_0xfeed('0x7e')](_0x5542c7[_0xfeed('0x12d')])){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x5542c7,_0xfeed('0x12e'));}logger[_0xfeed('0x2a')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xfeed('0x33')][_0xfeed('0x37')],_0x5542c7[_0xfeed('0x12d')]));var _0x4a52d=this[_0xfeed('0x4c')]['sync'](this,_0x5542c7[_0xfeed('0x12d')]);if(_0x4a52d){logger['info'](util[_0xfeed('0x26')](_0xfeed('0x131'),this[_0xfeed('0x33')][_0xfeed('0x37')],_0x5542c7[_0xfeed('0x12d')]));this['channel'][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x131'),this[_0xfeed('0x33')][_0xfeed('0x37')],_0x5542c7[_0xfeed('0x12d')]));return{'code':0xc8,'result':_0xfeed('0x135')};}else{logger[_0xfeed('0x2a')](util['format'](_0xfeed('0x132'),this['channel'][_0xfeed('0x37')],_0x5542c7[_0xfeed('0x12d')]));this['channel'][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x132'),this[_0xfeed('0x33')]['callerid'],_0x5542c7[_0xfeed('0x12d')]));return{'code':0xc8,'result':_0xfeed('0x133')};}};AGIVertices[_0xfeed('0xb')][_0xfeed('0x196')]=function(_0x4d47d5){logger[_0xfeed('0x2a')](util['format'](_0xfeed('0x197'),_0x4d47d5[_0xfeed('0x35')]));var _0x5f5651=this['channel'][_0xfeed('0x51')]('VOICEMAIL',[_0x4d47d5[_0xfeed('0x198')],_0x4d47d5[_0xfeed('0x90')]]);if(_0x5f5651[_0xfeed('0x7b')]===-0x1){return _0x5f5651;}return this[_0xfeed('0x33')][_0xfeed('0x8c')](util[_0xfeed('0x26')](_0xfeed('0x91'),'VOICEMAIL',_0x4d47d5['mailbox']));};AGIVertices[_0xfeed('0xb')][_0xfeed('0x199')]=function(_0x3dc64f){logger[_0xfeed('0x2a')](util[_0xfeed('0x26')](_0xfeed('0x19a'),_0x3dc64f['label']));if(!this[_0xfeed('0x7e')](_0x3dc64f[_0xfeed('0xad')])){return this['channel'][_0xfeed('0x28')](_0x3dc64f,_0xfeed('0x17a'));}var _0x29f126=this[_0xfeed('0xc')][_0xfeed('0x7f')](this,_0x3dc64f[_0xfeed('0xad')]);if(!_0x29f126){return this[_0xfeed('0x33')][_0xfeed('0x28')](_0x3dc64f,'no\x20variable\x20found');}var _0x1f9589=this[_0xfeed('0x33')][_0xfeed('0xc')](_0x29f126);return{'code':0xc8,'result':_0x1f9589[_0xfeed('0x79')]?_0x1f9589[_0xfeed('0x79')]:'-'};};String[_0xfeed('0xb')][_0xfeed('0x78')]=function(_0x594064,_0x49b579){return this['split'](_0x594064)['join'](_0x49b579);};module[_0xfeed('0x19b')]=AGIVertices; \ No newline at end of file +var _0xcb81=['scheduledAt','callback_priority','getPause','getPauseById','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','shellCommand','exec','trim','googleCloudTTS','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','google_tts_language','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_polly_region','Amy','aws_text_type','awsLex','aws_access_key_id','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','uri','clear','agicommand','isString','replaceAllVariables','split','length','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','createSquareDetailsReport','sync','retry','maxRetry','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','options','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','grammar','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE','RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','setVariable','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','no\x20user\x20selected','sip_id','DIAL','SIP/%s','url','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','hasOwnProperty','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','opts','Executed\x20command\x20%s','finally','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws\x20Polly\x20%s\x20file\x20created','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','%s.%s','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','stringify','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','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','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','success','math','operation','no\x20operation\x20configured','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','getSound','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','agentPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20selected','PLAYBACK','queue','queue_id','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','replace','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','user','bcc','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','debug','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','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','apiKey','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','googleTTS','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','path','util','shelljs','mustache','../../config/logger','agi','../../config/environment','./scripts','menu','getdigits','rpc','getVariable','getVariableById','then','name','prototype','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','getIntervalById','map','Intervals','interval','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','close','getSmsAccountById','createSmsMessage','channel','uniqueid','label','arg_1','callerid','createSquareRecording','context','extension','accountcode','dnid','file','createSquareMessage','isNil','callback_','random','isEmpty','lastName','list_id','callback','Callback\x20scheduled\x20at\x20'];(function(_0x47da8d,_0x517e13){var _0x5aabef=function(_0x2528d7){while(--_0x2528d7){_0x47da8d['push'](_0x47da8d['shift']());}};_0x5aabef(++_0x517e13);}(_0xcb81,0x154));var _0x1cb8=function(_0x119629,_0x246787){_0x119629=_0x119629-0x0;var _0x49a771=_0xcb81[_0x119629];return _0x49a771;};'use strict';var fs=require('fs');var path=require(_0x1cb8('0x0'));var util=require(_0x1cb8('0x1'));var _=require('lodash');var sh=require(_0x1cb8('0x2'));var odbc=require('odbc')();var rs=require('randomstring');var moment=require('moment');var Mustache=require(_0x1cb8('0x3'));var logger=require(_0x1cb8('0x4'))(_0x1cb8('0x5'));var config=require(_0x1cb8('0x6'));var scripts=require(_0x1cb8('0x7'));var FILES_PATH='/var/opt/motion2/server/files';var verticesWithRetry=[_0x1cb8('0x8'),_0x1cb8('0x9'),'getsecretdigits'];var AGIVertices=function(_0x2408c2,_0x39b4ad,_0x282fd8){this['channel']=_0x2408c2;this[_0x1cb8('0xa')]=_0x39b4ad;this['mailRpc']=_0x282fd8;};AGIVertices['prototype'][_0x1cb8('0xb')]=function(_0x2158a9,_0x16600b){this[_0x1cb8('0xa')][_0x1cb8('0xc')](_0x2158a9)[_0x1cb8('0xd')](function(_0xb8048c){_0x16600b(null,_0xb8048c?_0xb8048c[_0x1cb8('0xe')]:![]);})['catch'](function(_0x2fb18e){_0x16600b(_0x2fb18e);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x10')]=function(_0x299eea,_0x1371cb){this['rpc'][_0x1cb8('0x11')](_0x299eea)[_0x1cb8('0xd')](function(_0xcb6ad1){_0x1371cb(null,_0xcb6ad1?_0xcb6ad1[_0x1cb8('0xe')]:![]);})[_0x1cb8('0x12')](function(_0xe5402a){_0x1371cb(_0xe5402a);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x13')]=function(_0x5af4a3,_0x17a95d){this['rpc'][_0x1cb8('0x14')](_0x5af4a3)[_0x1cb8('0xd')](function(_0x2e5009){_0x17a95d(null,_0x2e5009?_0x2e5009[_0x1cb8('0xe')]:![]);})[_0x1cb8('0x12')](function(_0x308088){_0x17a95d(_0x308088);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x15')]=function(_0x2631db,_0x1f9fd7){this[_0x1cb8('0xa')][_0x1cb8('0x16')](_0x2631db)['then'](function(_0x429d10){_0x1f9fd7(null,_0x429d10?_0x429d10[_0x1cb8('0x17')]:![]);})[_0x1cb8('0x12')](function(_0x3d1682){_0x1f9fd7(_0x3d1682);});};AGIVertices['prototype'][_0x1cb8('0x18')]=function(_0x4f9220,_0x436a27){this[_0x1cb8('0xa')][_0x1cb8('0x19')](_0x4f9220)[_0x1cb8('0xd')](function(_0x559916){_0x436a27(null,_0x559916?_0x559916['name']:![]);})[_0x1cb8('0x12')](function(_0x4040be){_0x436a27(_0x4040be);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x1a')]=function(_0x2473b8,_0x30985c){this[_0x1cb8('0xa')]['getTrunkById'](_0x2473b8)[_0x1cb8('0xd')](function(_0x4554d5){_0x30985c(null,_0x4554d5?_0x4554d5[_0x1cb8('0xe')]:![]);})[_0x1cb8('0x12')](function(_0x17f5f8){_0x30985c(_0x17f5f8);});};AGIVertices[_0x1cb8('0xf')]['getSound']=function(_0x1ec995,_0x23ac21){var _0xfdfb31=this;this[_0x1cb8('0xa')][_0x1cb8('0x1b')](_0x1ec995)['then'](function(_0xed576b){_0x23ac21(null,_0xed576b?_0xfdfb31[_0x1cb8('0x1c')](_0xed576b[_0x1cb8('0x1d')]):![]);})[_0x1cb8('0x12')](function(_0x4fda96){_0x23ac21(_0x4fda96);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x1e')]=function(_0x3a6a67,_0x5bf630){this[_0x1cb8('0xa')][_0x1cb8('0x1f')](_0x3a6a67)[_0x1cb8('0xd')](function(_0x5558fe){_0x5bf630(null,_0x5558fe?_0x5558fe:![]);})[_0x1cb8('0x12')](function(_0x3e2af4){_0x5bf630(_0x3e2af4);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x20')]=function(_0x36f63d,_0x54278d,_0x2607f0){this[_0x1cb8('0x21')][_0x1cb8('0x20')](_0x36f63d,_0x54278d)[_0x1cb8('0xd')](function(){_0x2607f0(null);})[_0x1cb8('0x12')](function(_0x287d02){_0x2607f0(_0x287d02);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x22')]=function(_0x1aaae4,_0x562975){this['rpc'][_0x1cb8('0x23')](_0x1aaae4)[_0x1cb8('0xd')](function(_0x18a003){if(_0x18a003){if(_0x18a003['IntervalId']){_0x562975(null,[_0x18a003['interval']]);}else{_0x562975(null,_[_0x1cb8('0x24')](_0x18a003[_0x1cb8('0x25')],_0x1cb8('0x26')));}}else{_0x562975(null,![]);}})[_0x1cb8('0x12')](function(_0x198848){_0x562975(_0x198848);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x1c')]=function(_0x43dce0){return util['format'](_0x1cb8('0x27'),FILES_PATH,_0x43dce0);};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x28')]=function(_0x328b7c,_0x1bf06d,_0x421ce7){odbc[_0x1cb8('0x29')](_0x328b7c,function(_0x2ad7f6){if(_0x2ad7f6){logger[_0x1cb8('0x2a')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x2ad7f6);_0x421ce7(_0x2ad7f6);}else{logger[_0x1cb8('0x2b')](_0x1cb8('0x2c'));odbc['query'](_0x1bf06d,function(_0x1506da,_0x3efb16){if(_0x1506da){logger[_0x1cb8('0x2b')](_0x1cb8('0x2d'),_0x1bf06d);_0x421ce7(_0x1506da);}else{logger[_0x1cb8('0x2b')]('Query\x20executed\x20correctly\x20%s',_0x1bf06d);odbc[_0x1cb8('0x2e')](function(_0x4666bc){if(_0x4666bc){logger[_0x1cb8('0x2a')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x4666bc);}_0x421ce7(null,_0x3efb16);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0xca5f83,_0x35e713){this[_0x1cb8('0xa')][_0x1cb8('0x2f')](_0xca5f83)['then'](function(_0x4c438b){_0x35e713(null,_0x4c438b?_0x4c438b:![]);})[_0x1cb8('0x12')](function(_0x25f0a3){_0x35e713(_0x25f0a3);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x30')]=function(_0x2b45b6,_0x3eb8b5){this[_0x1cb8('0xa')][_0x1cb8('0x30')](_0x2b45b6)['then'](function(_0x2044d1){_0x3eb8b5(null,_0x2044d1);})[_0x1cb8('0x12')](function(_0x3d2963){_0x3eb8b5(_0x3d2963);});};AGIVertices[_0x1cb8('0xf')]['createSquareDetailsReport']=function(_0x156298,_0x47c18a,_0x2060a6){this[_0x1cb8('0xa')]['createSquareDetailsReport']({'uniqueid':this[_0x1cb8('0x31')][_0x1cb8('0x32')],'node':_0x156298[_0x1cb8('0x33')],'application':_0x156298['agicommand'],'data':_0x47c18a||null,'project_name':this['channel'][_0x1cb8('0x34')],'callerid':this['channel'][_0x1cb8('0x35')]})[_0x1cb8('0xd')](function(_0x3edf3e){if(_0x2060a6){_0x2060a6(null,_0x3edf3e);}})[_0x1cb8('0x12')](function(_0x2263fb){if(_0x2060a6){_0x2060a6(_0x2263fb);}});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x36')]=function(_0x5cc9e1,_0x2268d7,_0x1df9cb,_0x1ebce5){this[_0x1cb8('0xa')]['createSquareRecording']({'uniqueid':this[_0x1cb8('0x31')][_0x1cb8('0x32')],'callerid':this[_0x1cb8('0x31')][_0x1cb8('0x35')],'calleridname':this[_0x1cb8('0x31')]['calleridname'],'context':this[_0x1cb8('0x31')][_0x1cb8('0x37')],'extension':this[_0x1cb8('0x31')][_0x1cb8('0x38')],'priority':this[_0x1cb8('0x31')]['priority'],'accountcode':this[_0x1cb8('0x31')][_0x1cb8('0x39')],'dnid':this['channel'][_0x1cb8('0x3a')],'projectName':this[_0x1cb8('0x31')][_0x1cb8('0x34')],'saveName':_0x2268d7,'filename':_0x5cc9e1[_0x1cb8('0x3b')]||_0x2268d7,'savePath':_0x1df9cb})[_0x1cb8('0xd')](function(_0x4564aa){_0x1ebce5(null,_0x4564aa);})[_0x1cb8('0x12')](function(_0x219541){_0x1ebce5(_0x219541);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x3c')]=function(_0x1e78e3,_0x3d596e,_0x3c9076){this[_0x1cb8('0xa')]['createSquareMessage']({'uniqueid':this[_0x1cb8('0x31')][_0x1cb8('0x32')],'body':_0x1e78e3,'direction':_0x3d596e})[_0x1cb8('0xd')](function(_0x41a57e){if(_0x3c9076){_0x3c9076(null,_0x41a57e);}})[_0x1cb8('0x12')](function(_0x15f0ba){if(_0x3c9076){_0x3c9076(_0x15f0ba);}});};AGIVertices[_0x1cb8('0xf')]['createCmContact']=function(_0x21e74f,_0xb7fdaa){this[_0x1cb8('0xa')]['createCmContact']({'firstName':_['isEmpty'](_0x21e74f[_0x1cb8('0xe')])||_[_0x1cb8('0x3d')](_0x21e74f[_0x1cb8('0xe')])?_0x1cb8('0x3e')+Math[_0x1cb8('0x3f')]():_0x21e74f['name'],'lastName':_[_0x1cb8('0x40')](_0x21e74f[_0x1cb8('0x41')])||_[_0x1cb8('0x3d')](_0x21e74f['lastName'])?null:_0x21e74f['lastName'],'phone':_0x21e74f['phone'],'ListId':_0x21e74f[_0x1cb8('0x42')],'scheduledAt':_0x21e74f['scheduledAt'],'callbackUniqueid':this[_0x1cb8('0x31')][_0x1cb8('0x32')],'tags':_0x1cb8('0x43'),'description':_0x1cb8('0x44')+_0x21e74f[_0x1cb8('0x45')]['toString'](),'priority':_0x21e74f[_0x1cb8('0x46')]})[_0x1cb8('0xd')](function(_0x8f6194){_0xb7fdaa(null,_0x8f6194);})[_0x1cb8('0x12')](function(_0x43585c){_0xb7fdaa(_0x43585c);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x47')]=function(_0x53e09e,_0x1f0dea){this[_0x1cb8('0xa')][_0x1cb8('0x48')](_0x53e09e)[_0x1cb8('0xd')](function(_0x2d9995){_0x1f0dea(null,_0x2d9995?_0x2d9995[_0x1cb8('0xe')]:![]);})[_0x1cb8('0x12')](function(_0x56ea4c){_0x1f0dea(_0x56ea4c);});};AGIVertices['prototype']['agentPause']=function(_0x17ade3,_0x555689,_0x2f3daa){var _0x23cea0={'role':_0x1cb8('0x49')};_0x23cea0[_0x17ade3]=this[_0x1cb8('0x31')][_0x1cb8('0x35')];this['rpc']['agentPause'](_0x23cea0,_0x555689,this['channel'][_0x1cb8('0x32')])[_0x1cb8('0xd')](function(_0x482d4f){_0x2f3daa(null,_[_0x1cb8('0x3d')](_0x482d4f)?![]:!![]);})['catch'](function(_0x5f0cd5){logger[_0x1cb8('0x2a')](_0x5f0cd5);_0x2f3daa(null,![]);});};AGIVertices['prototype'][_0x1cb8('0x4a')]=function(_0x19f3f0,_0x19dd85){var _0xdbd5c0={'role':_0x1cb8('0x49')};_0xdbd5c0[_0x19f3f0]=this[_0x1cb8('0x31')][_0x1cb8('0x35')];this[_0x1cb8('0xa')][_0x1cb8('0x4a')](_0xdbd5c0)[_0x1cb8('0xd')](function(_0x2fb1a7){_0x19dd85(null,_[_0x1cb8('0x3d')](_0x2fb1a7)?![]:!![]);})[_0x1cb8('0x12')](function(_0x48fcdc){logger[_0x1cb8('0x2a')](_0x48fcdc);_0x19dd85(null,![]);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x4b')]=function(_0x5aab00,_0x350cb9){var _0x39de0b={'role':_0x1cb8('0x49')};_0x39de0b[_0x5aab00]=this[_0x1cb8('0x31')]['callerid'];this[_0x1cb8('0xa')][_0x1cb8('0x4b')](_0x39de0b)['then'](function(_0xc5e053){_0x350cb9(null,_[_0x1cb8('0x3d')](_0xc5e053)?![]:!![]);})['catch'](function(_0x41a5b2){logger[_0x1cb8('0x2a')](_0x41a5b2);_0x350cb9(null,![]);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x4c')]=function(_0x4bab3e,_0x4d9cf9){var _0x4e6a41={'role':_0x1cb8('0x49')};_0x4e6a41[_0x4bab3e]=this[_0x1cb8('0x31')][_0x1cb8('0x35')];var _0x426939=_0x4bab3e!=_0x1cb8('0x4d')?util[_0x1cb8('0x4e')](_0x1cb8('0x4f'),'LOCAL',this[_0x1cb8('0x31')][_0x1cb8('0x35')]):undefined;this[_0x1cb8('0xa')]['agentLogin'](_0x4e6a41,_0x426939)[_0x1cb8('0xd')](function(_0x17efbc){_0x4d9cf9(null,_[_0x1cb8('0x3d')](_0x17efbc)?![]:!![]);})[_0x1cb8('0x12')](function(_0x2058a1){logger['error'](_0x2058a1);_0x4d9cf9(null,![]);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x50')]=function(_0x269e53,_0x47dc3e){sh[_0x1cb8('0x51')](_[_0x1cb8('0x52')](_0x269e53),function(_0x53e050,_0x39bdf6){var _0x583d40=_0x39bdf6['replace'](/(\r\n|\n|\r)/gm,'');_0x47dc3e(null,_0x583d40);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x53')]=function(_0x1b8b40,_0x4eba1a){scripts['googleCloudTTS'](_0x1b8b40['apiKey'],_0x1b8b40[_0x1cb8('0x54')],_0x1b8b40[_0x1cb8('0x55')]||_0x1cb8('0x56'),_0x1b8b40[_0x1cb8('0x57')]||_0x1cb8('0x58'),_0x1b8b40[_0x1cb8('0x59')]||_0x1cb8('0x5a'))['then'](function(_0x4fc533){_0x4eba1a(null,_0x4fc533);})['catch'](function(_0x5c8df5){_0x4eba1a(_0x5c8df5);});};AGIVertices[_0x1cb8('0xf')]['googleTTS']=function(_0x2610c1,_0x4b8a9e){scripts['googleTTS'](_0x2610c1['text'],_0x2610c1[_0x1cb8('0x5b')]||'en',0x1)[_0x1cb8('0xd')](function(_0x46bd58){_0x4b8a9e(null,_0x46bd58);})[_0x1cb8('0x12')](function(_0x26f661){_0x4b8a9e(_0x26f661);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x5c')]=function(_0x1f1dd8,_0xca505c){scripts[_0x1cb8('0x5c')](this[_0x1cb8('0x31')][_0x1cb8('0x32')],_0x1f1dd8[_0x1cb8('0x5d')],_0x1f1dd8[_0x1cb8('0x54')],_0x1f1dd8[_0x1cb8('0x5e')]||'en')[_0x1cb8('0xd')](function(_0x4d3bbc){_0xca505c(null,_0x4d3bbc);})[_0x1cb8('0x12')](function(_0x113ea7){_0xca505c(_0x113ea7);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x5f')]=function(_0x24a298,_0x284c46){scripts['sestekNDA'](this[_0x1cb8('0x31')],_0x24a298)[_0x1cb8('0xd')](function(_0x19c7ca){_0x284c46(null,_0x19c7ca);})[_0x1cb8('0x12')](function(_0x20cf0f){_0x284c46(_0x20cf0f);});};AGIVertices['prototype'][_0x1cb8('0x60')]=function(_0x34094c,_0x5bfe0c){scripts[_0x1cb8('0x60')](_0x34094c['key'],_0x34094c[_0x1cb8('0x54')],_0x34094c[_0x1cb8('0x61')]||_0x1cb8('0x56'),_0x34094c['speed'])[_0x1cb8('0xd')](function(_0x28b00e){_0x5bfe0c(null,_0x28b00e);})['catch'](function(_0x4b7982){_0x5bfe0c(_0x4b7982);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x62')]=function(_0x5d02e7,_0x39cb4b,_0x257156){scripts[_0x1cb8('0x62')](_0x39cb4b,_0x5d02e7[_0x1cb8('0x5d')],_0x5d02e7[_0x1cb8('0x63')]||_0x1cb8('0x56'),this[_0x1cb8('0x64')](_0x5d02e7['model'])?_0x5d02e7[_0x1cb8('0x65')]:undefined)['then'](function(_0x5334c1){_0x257156(null,_0x5334c1);})['catch'](function(_0x3a7740){_0x257156(_0x3a7740);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x66')]=function(_0x1d30e1,_0xa0b86){scripts[_0x1cb8('0x66')](_0x1d30e1['aws_access_key_id'],_0x1d30e1['aws_secret_access_key'],_0x1d30e1[_0x1cb8('0x67')],_0x1d30e1['aws_polly_voice']||_0x1cb8('0x68'),_0x1d30e1[_0x1cb8('0x54')],_0x1d30e1[_0x1cb8('0x69')]||'text')['then'](function(_0x7afd8f){_0xa0b86(null,_0x7afd8f);})['catch'](function(_0x13b645){_0xa0b86(_0x13b645);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x6a')]=function(_0x1daf8c,_0x226edb){scripts[_0x1cb8('0x6a')](this[_0x1cb8('0x31')][_0x1cb8('0x32')],_0x1daf8c[_0x1cb8('0x6b')],_0x1daf8c[_0x1cb8('0x6c')],_0x1daf8c[_0x1cb8('0x6d')],_0x1daf8c[_0x1cb8('0x54')],_0x1daf8c[_0x1cb8('0x6e')])['then'](function(_0x5f4f24){_0x226edb(null,_0x5f4f24);})[_0x1cb8('0x12')](function(_0xf1a4cc){_0x226edb(_0xf1a4cc);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x6f')]=function(_0x57b3eb,_0x745acb,_0x1e343c){scripts[_0x1cb8('0x6f')](_0x745acb,_0x57b3eb[_0x1cb8('0x5d')],_0x57b3eb[_0x1cb8('0x70')]||'en-US')[_0x1cb8('0xd')](function(_0x1fd828){_0x1e343c(null,_0x1fd828);})[_0x1cb8('0x12')](function(_0x439d51){_0x1e343c(_0x439d51);});};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x71')]=function(_0x432e0f,_0x3fce2e,_0x3c0da5){scripts[_0x1cb8('0x71')](_0x3fce2e,_0x432e0f['appid'],_0x432e0f[_0x1cb8('0x72')],_0x432e0f[_0x1cb8('0x73')])['then'](function(_0x5c5a7d){_0x3c0da5(null,_0x5c5a7d);})[_0x1cb8('0x12')](function(_0x5bbb90){_0x3c0da5(_0x5bbb90);});};AGIVertices['prototype'][_0x1cb8('0x74')]=function(_0x2a375d){var _0x48a925=_['includes'](verticesWithRetry,_0x2a375d[_0x1cb8('0x75')])?_0x2a375d:_['clone'](_0x2a375d);for(var _0x773f1f in _0x48a925){if(_0x48a925['hasOwnProperty'](_0x773f1f)){if(_0x48a925[_0x773f1f]&&_[_0x1cb8('0x76')](_0x48a925[_0x773f1f])){_0x48a925[_0x773f1f]=this[_0x1cb8('0x77')](_0x48a925[_0x773f1f]);}}}return _0x48a925;};AGIVertices['prototype'][_0x1cb8('0x77')]=function(_0x3a80ff){var _0x17615b=_0x3a80ff[_0x1cb8('0x78')]('{');for(var _0x2baafc=0x1;_0x2baafc<_0x17615b[_0x1cb8('0x79')];_0x2baafc+=0x1){var _0xeea4ce=_0x17615b[_0x2baafc][_0x1cb8('0x78')]('}');if(_0xeea4ce['length']>0x1){_0x3a80ff=_0x3a80ff[_0x1cb8('0x7a')]('{'+_0xeea4ce[0x0]+'}',this['channel'][_0x1cb8('0xb')](_0xeea4ce[0x0])[_0x1cb8('0x7b')]||_0xeea4ce[0x0]);}}if(_0x17615b[_0x1cb8('0x79')]===0x1){return _0x3a80ff['toString']();}return this['replaceAllVariables'](_0x3a80ff);};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x7c')]=function(_0x3868f4,_0x5990fd){var _0x4cb97b=this['channel']['getVariable'](_0x3868f4);if(_0x4cb97b[_0x1cb8('0x7d')]===-0x1){return _0x4cb97b;}logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x7e'),_0x5990fd,_0x4cb97b[_0x1cb8('0x7b')]));return this[_0x1cb8('0x31')]['setVariable'](_0x5990fd,_0x4cb97b[_0x1cb8('0x7b')]);};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x64')]=function(_0x134753){return _0x134753&&_0x134753!=='0'&&_0x134753!=='-1'&&_0x134753!=='';};AGIVertices[_0x1cb8('0xf')]['maxRetry']=function(_0x3dadf4){this[_0x1cb8('0x7f')][_0x1cb8('0x80')](this,_0x3dadf4,'-');_0x3dadf4[_0x1cb8('0x81')]=_0x3dadf4[_0x1cb8('0x82')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x5')]=function(_0x489d46){logger['info'](util['format'](_0x1cb8('0x83'),_0x489d46[_0x1cb8('0x33')]));return this[_0x1cb8('0x31')][_0x1cb8('0x5')]([_0x489d46['command'],_0x489d46[_0x1cb8('0x84')]]);};AGIVertices['prototype'][_0x1cb8('0x85')]=function(_0x107833){logger[_0x1cb8('0x2b')](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x107833[_0x1cb8('0x33')]));if(this[_0x1cb8('0x64')](_0x107833[_0x1cb8('0x86')])){logger[_0x1cb8('0x2b')](util['format'](_0x1cb8('0x87'),_0x107833[_0x1cb8('0x86')]));var _0x2fd2b2=this['channel'][_0x1cb8('0x88')](_0x107833[_0x1cb8('0x86')]);if(_0x2fd2b2[_0x1cb8('0x7d')]===-0x1){return _0x2fd2b2;}}return this[_0x1cb8('0x31')][_0x1cb8('0x85')]();};AGIVertices['prototype']['callback']=function(_0x2f6d22){logger['info'](util[_0x1cb8('0x4e')](_0x1cb8('0x89'),_0x2f6d22['label']));if(!this[_0x1cb8('0x64')](_0x2f6d22[_0x1cb8('0x42')])){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x2f6d22,_0x1cb8('0x8a'));}_0x2f6d22['scheduledAt']=moment();if(this[_0x1cb8('0x64')](_0x2f6d22[_0x1cb8('0x8b')])){_0x2f6d22[_0x1cb8('0x45')]=moment()[_0x1cb8('0x8c')](_0x2f6d22['delay'],_0x1cb8('0x8d'));}if(!this[_0x1cb8('0x64')](_0x2f6d22[_0x1cb8('0x46')])){_0x2f6d22[_0x1cb8('0x46')]=0x2;}this['createCmContact']['sync'](this,_0x2f6d22);return this['channel'][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')](_0x1cb8('0x8f'),_0x2f6d22[_0x1cb8('0x90')],_0x2f6d22[_0x1cb8('0x42')],_0x2f6d22[_0x1cb8('0x45')]));};AGIVertices['prototype'][_0x1cb8('0x91')]=function(_0x406131){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x92'),_0x406131[_0x1cb8('0x33')]));var _0x34a7c8=this['channel'][_0x1cb8('0x51')](_0x406131[_0x1cb8('0x93')],_0x406131[_0x1cb8('0x94')]);if(_0x34a7c8[_0x1cb8('0x7d')]===-0x1){return _0x34a7c8;}return this['channel'][_0x1cb8('0x8e')](util['format'](_0x1cb8('0x95'),_0x406131[_0x1cb8('0x93')],_0x406131['options']));};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x96')]=function(_0x27bab1){logger[_0x1cb8('0x2b')](util['format'](_0x1cb8('0x97'),_0x27bab1['label']));if(!this[_0x1cb8('0x64')](_0x27bab1['text'])){return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](_0x1cb8('0x98'));}var _0x317ec0='\x22'+_0x27bab1[_0x1cb8('0x54')]+'\x22';if(this['isConfigured'](_0x27bab1[_0x1cb8('0x94')])){_0x317ec0+=','+_0x27bab1['options'];}var _0x56ff79=this[_0x1cb8('0x31')]['exec'](_0x1cb8('0x99'),_0x317ec0);if(_0x56ff79['result']===-0x1){return _0x56ff79;}return this['channel'][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')](_0x1cb8('0x9a'),_0x317ec0));};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x9b')]=function(_0x18f98b){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x9c'),_0x18f98b[_0x1cb8('0x33')]));if(!this[_0x1cb8('0x64')](_0x18f98b['text'])){return this[_0x1cb8('0x31')][_0x1cb8('0x8e')]('no\x20text\x20configured');}var _0x4dbf00='\x22'+_0x18f98b['text']+'\x22';if(this['isConfigured'](_0x18f98b[_0x1cb8('0x94')])){_0x4dbf00+=','+_0x18f98b[_0x1cb8('0x94')];}var _0x206f28=this[_0x1cb8('0x31')][_0x1cb8('0x51')](_0x1cb8('0x99'),_0x4dbf00);if(_0x206f28[_0x1cb8('0x7d')]===-0x1){return _0x206f28;}return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4dbf00));};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x9d')]=function(_0x2efcd3){logger['info'](util[_0x1cb8('0x4e')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x2efcd3[_0x1cb8('0x33')]));if(!this[_0x1cb8('0x64')](_0x2efcd3[_0x1cb8('0x9e')])){return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](_0x1cb8('0x9f'));}var _0xe63fda=_0x2efcd3[_0x1cb8('0x9e')];if(this[_0x1cb8('0x64')](_0x2efcd3[_0x1cb8('0x94')])){_0xe63fda+=','+_0x2efcd3[_0x1cb8('0x94')];}var _0x1f9d9c=this[_0x1cb8('0x31')]['exec'](_0x1cb8('0xa0'),_0xe63fda);if(_0x1f9d9c['result']===-0x1){return _0x1f9d9c;}var _0x5056d2=this[_0x1cb8('0x7c')]('RECOG_CONFIDENCE()',_0x1cb8('0xa1'));if(_0x5056d2[_0x1cb8('0x7d')]===-0x1){return _0x5056d2;}var _0x546975=this[_0x1cb8('0x7c')]('RECOG_INPUT()',_0x1cb8('0xa2'));if(_0x546975['result']===-0x1){return _0x546975;}var _0x4549e8=this[_0x1cb8('0x7c')](_0x1cb8('0xa3'),_0x1cb8('0xa4'));if(_0x4549e8['result']===-0x1){return _0x4549e8;}return this[_0x1cb8('0x31')]['noop'](util[_0x1cb8('0x4e')](_0x1cb8('0xa5'),_0xe63fda));};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0xa6')]=function(_0x233a8e){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x233a8e[_0x1cb8('0x33')]));if(!this['isConfigured'](_0x233a8e[_0x1cb8('0x9e')])){return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](_0x1cb8('0x9f'));}var _0x37df06=_0x233a8e['grammar'];if(this[_0x1cb8('0x64')](_0x233a8e['options'])){_0x37df06+=','+_0x233a8e[_0x1cb8('0x94')];}var _0x3014d1=this[_0x1cb8('0x31')][_0x1cb8('0x51')](_0x1cb8('0xa0'),_0x37df06);if(_0x3014d1[_0x1cb8('0x7d')]===-0x1){return _0x3014d1;}var _0x1488d2=this[_0x1cb8('0x7c')](_0x1cb8('0xa7'),_0x1cb8('0xa8'));if(_0x1488d2[_0x1cb8('0x7d')]===-0x1){return _0x1488d2;}var _0x3755bf=this[_0x1cb8('0x7c')](_0x1cb8('0xa9'),_0x1cb8('0xaa'));if(_0x3755bf[_0x1cb8('0x7d')]===-0x1){return _0x3755bf;}var _0x4bde90=this[_0x1cb8('0x7c')](_0x1cb8('0xa3'),'SESTEK_ASR_INSTANCE');if(_0x4bde90['result']===-0x1){return _0x4bde90;}return this['channel']['noop'](util[_0x1cb8('0x4e')](_0x1cb8('0xa5'),_0x37df06));};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0xab')]=function(_0x1613c6){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x1613c6[_0x1cb8('0x33')]));if(!this['isConfigured'](_0x1613c6[_0x1cb8('0xac')])){return this[_0x1cb8('0x31')]['error'](_0x1613c6,_0x1cb8('0xad'));}var _0x2acac2=this[_0x1cb8('0x15')][_0x1cb8('0x80')](this,_0x1613c6[_0x1cb8('0xac')]);if(!_0x2acac2){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x1613c6,_0x1cb8('0xae'));}if(!this['isConfigured'](_0x1613c6[_0x1cb8('0xaf')])){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x1613c6,_0x1cb8('0xb0'));}var _0x3f869f=_0x1613c6[_0x1cb8('0xaf')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x1cb8('0x31')]['noop'](util[_0x1cb8('0x4e')](_0x1cb8('0xb1'),_0x3f869f));var _0x2cdb0f=this[_0x1cb8('0x28')]['sync'](this,_0x2acac2,_0x3f869f);this[_0x1cb8('0x7f')][_0x1cb8('0x80')](this,_0x1613c6,_0x3f869f);if(!this['isConfigured'](_0x1613c6['variable_id'])){return this[_0x1cb8('0x31')][_0x1cb8('0x8e')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x357a15=this[_0x1cb8('0xb')]['sync'](this,_0x1613c6[_0x1cb8('0xb2')]);if(!_0x357a15){return this[_0x1cb8('0x31')]['error'](_0x1613c6,_0x1cb8('0xb3'));}var _0x34faff=this;_0x2cdb0f[_0x1cb8('0xb4')](function(_0x52d213,_0x194bcd){Object[_0x1cb8('0xb5')](_0x52d213)[_0x1cb8('0xb4')](function(_0x511a7f){_0x34faff[_0x1cb8('0x31')][_0x1cb8('0xb6')](util['format'](_0x1cb8('0xb7'),_0x357a15,_0x194bcd,_0x511a7f),_0x52d213[_0x511a7f]);});});this[_0x1cb8('0x31')]['setVariable'](util['format'](_0x1cb8('0xb8'),_0x357a15),_0x2cdb0f[_0x1cb8('0x79')]);return this['channel'][_0x1cb8('0x8e')](util['format'](_0x1cb8('0xb9'),_0x357a15));};AGIVertices[_0x1cb8('0xf')]['dial']=function(_0x55e0bc){logger['debug'](util[_0x1cb8('0x4e')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x55e0bc[_0x1cb8('0x33')]));if(!this['isConfigured'](_0x55e0bc['sip_id'])){return this['channel'][_0x1cb8('0x2a')](_0x55e0bc,_0x1cb8('0xba'));}var _0x4c7b19=this[_0x1cb8('0x18')][_0x1cb8('0x80')](this,_0x55e0bc[_0x1cb8('0xbb')]);if(!_0x4c7b19){return this['channel'][_0x1cb8('0x2a')](_0x55e0bc,'no\x20user\x20found');}var _0x1d8e0b=this[_0x1cb8('0x31')]['exec'](_0x1cb8('0xbc'),[util[_0x1cb8('0x4e')](_0x1cb8('0xbd'),_0x4c7b19),_0x55e0bc[_0x1cb8('0x86')],_0x55e0bc['opts'],_0x55e0bc[_0x1cb8('0xbe')]]);if(_0x1d8e0b[_0x1cb8('0x7d')]===-0x1){return _0x1d8e0b;}return this['channel'][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')]('Executed\x20command\x20%s',_0x1cb8('0xbc')));};AGIVertices['prototype'][_0x1cb8('0xbf')]=function(_0x273ef3){logger['info'](util[_0x1cb8('0x4e')](_0x1cb8('0xc0'),_0x273ef3[_0x1cb8('0x33')]));if(!this[_0x1cb8('0x64')](_0x273ef3['key'])){return this[_0x1cb8('0x31')]['noop'](_0x1cb8('0xc1'));}if(!this['isConfigured'](_0x273ef3[_0x1cb8('0x54')])){return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](_0x1cb8('0x98'));}this[_0x1cb8('0x31')][_0x1cb8('0xc2')]=!![];this[_0x1cb8('0x7f')](_0x273ef3);this[_0x1cb8('0x3c')](_0x273ef3[_0x1cb8('0x54')],'in');this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')](_0x1cb8('0xc3'),_0x273ef3['text']));var _0x50ac66=this[_0x1cb8('0x5c')][_0x1cb8('0x80')](this,_0x273ef3);if(_0x50ac66){for(var _0x1d7bee in _0x50ac66){if(_0x50ac66[_0x1cb8('0xc4')](_0x1d7bee)){this[_0x1cb8('0x31')][_0x1cb8('0xb6')](util[_0x1cb8('0x4e')](_0x1cb8('0xc5'),_0x1d7bee[_0x1cb8('0xc6')]()),_0x50ac66[_0x1d7bee]);}}this['createSquareMessage'](_0x50ac66[_0x1cb8('0xc7')],_0x1cb8('0xc8'));return this[_0x1cb8('0x31')]['noop'](util[_0x1cb8('0x4e')](_0x1cb8('0xc9'),_0x50ac66[_0x1cb8('0xc7')]));}return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x273ef3,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x1cb8('0xf')]['sesteknda']=function(_0xe179c8){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0xca'),_0xe179c8[_0x1cb8('0x33')]));if(!this['isConfigured'](_0xe179c8['ndauth_url'])){return this[_0x1cb8('0x31')]['noop'](_0x1cb8('0xcb'));}if(!this[_0x1cb8('0x64')](_0xe179c8['username'])){return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](_0x1cb8('0xcc'));}if(!this['isConfigured'](_0xe179c8['password'])){return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](_0x1cb8('0xcd'));}if(!this[_0x1cb8('0x64')](_0xe179c8[_0x1cb8('0xce')])){return this['channel'][_0x1cb8('0x8e')](_0x1cb8('0x98'));}this[_0x1cb8('0x31')]['bot']=!![];this[_0x1cb8('0x7f')](_0xe179c8);this[_0x1cb8('0x3c')](_0xe179c8[_0x1cb8('0x54')],'in');this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')](_0x1cb8('0xcf'),_0xe179c8[_0x1cb8('0x54')]));var _0x15a729=this[_0x1cb8('0x5f')]['sync'](this,_0xe179c8);if(_0x15a729){for(var _0x399755 in _0x15a729){if(_0x15a729['hasOwnProperty'](_0x399755)){this['channel']['setVariable'](util[_0x1cb8('0x4e')](_0x1cb8('0xd0'),_0x399755[_0x1cb8('0xc6')]()),_0x15a729[_0x399755]);}}this[_0x1cb8('0x3c')](_0x15a729['speech'],'out');if(_0x15a729[_0x1cb8('0xd1')]){this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util['format'](_0x1cb8('0xd2'),_0x15a729[_0x1cb8('0xd1')]));var _0x1d4b03=this[_0x1cb8('0x31')][_0x1cb8('0xd3')](_0x15a729[_0x1cb8('0xd1')]);try{fs[_0x1cb8('0xd4')](_0x15a729[_0x1cb8('0xd1')]+_0x1cb8('0xd5'));}catch(_0x44ac49){logger[_0x1cb8('0x2a')](_0x44ac49);}return _0x1d4b03;}else{return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util['format']('SestekNDA\x20Result\x20%s',_0x15a729[_0x1cb8('0xc7')]));}}return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0xe179c8,_0x1cb8('0xd6'));};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0xd7')]=function(_0x153b2c){logger[_0x1cb8('0x2b')](util['format'](_0x1cb8('0xd8'),_0x153b2c[_0x1cb8('0x33')]));return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](_0x1cb8('0xd7'));};AGIVertices['prototype'][_0x1cb8('0xd9')]=function(_0x2c203f){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0xda'),_0x2c203f[_0x1cb8('0x33')]));var _0x35016e='';if(_0x2c203f[_0x1cb8('0xdb')]){if(!this[_0x1cb8('0x64')](_0x2c203f[_0x1cb8('0xdb')])){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x2c203f,_0x1cb8('0xdc'));}else{var _0x384fc6=parseInt(_0x2c203f[_0x1cb8('0xdb')],0xa);if(isNaN(_0x384fc6)){_0x35016e=_0x2c203f[_0x1cb8('0xdb')];}else{_0x35016e=this[_0x1cb8('0x1a')][_0x1cb8('0x80')](this,_0x2c203f[_0x1cb8('0xdb')]);if(!_0x35016e){return this[_0x1cb8('0x31')]['error'](_0x2c203f,'no\x20trunk\x20found');}}}}else if(_0x2c203f[_0x1cb8('0xdd')]){_0x35016e=_0x2c203f[_0x1cb8('0xdd')];}else{return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x2c203f,'no\x20trunk\x20selected');}var _0x51595c=this[_0x1cb8('0x31')][_0x1cb8('0x51')](_0x1cb8('0xbc'),[util[_0x1cb8('0x4e')]('SIP/%s/%s',_0x35016e,_0x2c203f[_0x1cb8('0x90')]),_0x2c203f[_0x1cb8('0x86')],_0x2c203f[_0x1cb8('0xde')],_0x2c203f[_0x1cb8('0xbe')]]);if(_0x51595c['result']===-0x1){return _0x51595c;}return this[_0x1cb8('0x31')]['noop'](util[_0x1cb8('0x4e')](_0x1cb8('0xdf'),'DIAL'));};AGIVertices['prototype'][_0x1cb8('0xe0')]=function(_0xa464ce){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0xa464ce[_0x1cb8('0x33')]));return this['channel']['noop'](_0x1cb8('0xe0'));};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x9')]=function(_0x3777a1){logger['info'](util['format']('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x3777a1[_0x1cb8('0x33')]));if(_0x3777a1['retry']===0x0){return this[_0x1cb8('0x82')](_0x3777a1);}_0x3777a1[_0x1cb8('0x81')]-=0x1;if(!this['isConfigured'](_0x3777a1['file_id'])){return this[_0x1cb8('0x31')]['error'](_0x3777a1,'no\x20file\x20audio\x20selected');}var _0xe20a9a=this['getSound'][_0x1cb8('0x80')](this,_0x3777a1[_0x1cb8('0xe1')]);if(!_0xe20a9a){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x3777a1,_0x1cb8('0xe2'));}if(!this['isConfigured'](_0x3777a1[_0x1cb8('0xb2')])){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x1cb8('0xe3'));}var _0x50e1ea=this['channel'][_0x1cb8('0xe4')](_0xe20a9a,_0x3777a1['response'],_0x3777a1[_0x1cb8('0xe5')]);var _0x93bfee=_0x50e1ea[_0x1cb8('0x7d')]?_0x50e1ea['result']['toString']():'';logger[_0x1cb8('0x2b')](_0x1cb8('0xe6'),JSON['stringify'](_0x50e1ea));if(_0x50e1ea[_0x1cb8('0x7d')]===-0x1){this['createSquareDetailsReport'][_0x1cb8('0x80')](this,_0x3777a1,_0x93bfee);return _0x50e1ea;}else if(_0x50e1ea['extra']===_0x1cb8('0x86')){_0x50e1ea[_0x1cb8('0x7d')]=_0x93bfee[_0x1cb8('0x79')]>=parseInt(_0x3777a1['mindigit'])?'x':'i';}else{_0x50e1ea[_0x1cb8('0x7d')]=_0x93bfee[_0x1cb8('0x79')]>=parseInt(_0x3777a1[_0x1cb8('0xe7')])&&_0x93bfee[_0x1cb8('0x79')]<=parseInt(_0x3777a1[_0x1cb8('0xe5')])?'x':'i';}var _0x55ffea=this[_0x1cb8('0xb')][_0x1cb8('0x80')](this,_0x3777a1[_0x1cb8('0xb2')]);if(!_0x55ffea){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x3777a1,_0x1cb8('0xb3'));}this[_0x1cb8('0x31')][_0x1cb8('0xb6')](_0x55ffea,_0x93bfee);if(this[_0x1cb8('0x64')](_0x3777a1[_0x1cb8('0xe8')])){var _0x11a6da=parseInt(_0x3777a1['hiddendigitsnum'],0xa);var _0x38e85e=rs[_0x1cb8('0xe9')]({'charset':'*','length':_0x11a6da});var _0x3cc9a4=_0x93bfee[_0x1cb8('0x79')];if(_0x3cc9a4>0x0){if(_0x3cc9a4>_0x11a6da){this[_0x1cb8('0x7f')]['sync'](this,_0x3777a1,_0x3777a1[_0x1cb8('0xea')]===_0x1cb8('0xeb')?_0x38e85e+_0x93bfee['substr'](_0x11a6da):_0x93bfee[_0x1cb8('0xec')](0x0,_0x3cc9a4-_0x11a6da)+_0x38e85e);}else{this[_0x1cb8('0x7f')][_0x1cb8('0x80')](this,_0x3777a1,rs[_0x1cb8('0xe9')]({'charset':'*','length':_0x3cc9a4}));}}else{this[_0x1cb8('0x7f')][_0x1cb8('0x80')](this,_0x3777a1,'');}}else{this['createSquareDetailsReport'][_0x1cb8('0x80')](this,_0x3777a1,_0x93bfee);}return _0x50e1ea;};AGIVertices[_0x1cb8('0xf')]['getsecretdigits']=function(_0x9175ad){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0xed'),_0x9175ad[_0x1cb8('0x33')]));return this['getdigits'](_0x9175ad);};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0xee')]=function(_0x594363){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0xef'),_0x594363[_0x1cb8('0x33')]));this[_0x1cb8('0x7f')]['sync'](this,_0x594363,_0x594363[_0x1cb8('0xf0')]);return this[_0x1cb8('0x31')]['noop'](util[_0x1cb8('0x4e')](_0x1cb8('0xf1'),_0x594363[_0x1cb8('0xf0')]));};AGIVertices[_0x1cb8('0xf')]['awspolly']=function(_0x352581){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0xf2'),_0x352581[_0x1cb8('0x33')]));if(!this[_0x1cb8('0x64')](_0x352581[_0x1cb8('0x6b')])||!this[_0x1cb8('0x64')](_0x352581[_0x1cb8('0x6c')])){return this[_0x1cb8('0x31')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x1cb8('0x64')](_0x352581[_0x1cb8('0x54')])){return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](_0x1cb8('0x98'));}this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')]('Trying\x20aws\x20Polly\x20%s',_0x352581[_0x1cb8('0x54')]));var _0x5a6ead=this[_0x1cb8('0x66')]['sync'](this,_0x352581);if(_0x5a6ead){this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')](_0x1cb8('0xf3'),_0x5a6ead));var _0x122b16=this['channel'][_0x1cb8('0xd3')](_0x5a6ead);try{fs['unlink'](_0x5a6ead+_0x1cb8('0xd5'));}catch(_0x43416f){logger[_0x1cb8('0x2a')](_0x43416f);}return _0x122b16;}return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x352581,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0xf4')]=function(_0x12a26d){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0xf5'),_0x12a26d[_0x1cb8('0x33')]));if(!this[_0x1cb8('0x64')](_0x12a26d[_0x1cb8('0x6b')])||!this[_0x1cb8('0x64')](_0x12a26d[_0x1cb8('0x6c')])){return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](_0x1cb8('0xf6'));}if(!this[_0x1cb8('0x64')](_0x12a26d[_0x1cb8('0x6e')])){return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](_0x1cb8('0xf7'));}if(!this[_0x1cb8('0x64')](_0x12a26d['text'])){return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](_0x1cb8('0x98'));}this[_0x1cb8('0x31')][_0x1cb8('0xc2')]=!![];this[_0x1cb8('0x7f')](_0x12a26d);this[_0x1cb8('0x3c')](_0x12a26d[_0x1cb8('0x54')],'in');this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')](_0x1cb8('0xf8'),_0x12a26d[_0x1cb8('0x54')]));var _0x12e462=this[_0x1cb8('0x6a')]['sync'](this,_0x12a26d);if(_0x12e462){for(var _0x437f93 in _0x12e462){if(_0x12e462[_0x1cb8('0xc4')](_0x437f93)&&_['isString'](_0x12e462[_0x437f93])){this[_0x1cb8('0x31')][_0x1cb8('0xb6')](util[_0x1cb8('0x4e')](_0x1cb8('0xf9'),_0x437f93['toUpperCase']()),_0x12e462[_0x437f93]);}}if(_[_0x1cb8('0x3d')](_0x12e462[_0x1cb8('0xfa')])){return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](_0x1cb8('0xfb'));}else{this[_0x1cb8('0x3c')](_0x12e462['message'],_0x1cb8('0xc8'));return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')](_0x1cb8('0xfc'),_0x12e462[_0x1cb8('0xfa')]));}}return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x12a26d,_0x1cb8('0xfd'));};AGIVertices['prototype'][_0x1cb8('0xfe')]=function(_0x2b1b28){logger[_0x1cb8('0x2b')](util['format'](_0x1cb8('0xff'),_0x2b1b28[_0x1cb8('0x33')],_0x2b1b28[_0x1cb8('0x86')]));if(!this[_0x1cb8('0x64')](_0x2b1b28[_0x1cb8('0x5d')])){return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](_0x1cb8('0xc1'));}var _0x4cf5ba=_0x1cb8('0x100');var _0x54137d=util[_0x1cb8('0x4e')](_0x1cb8('0x101'),FILES_PATH,rs[_0x1cb8('0xe9')](0x4));var _0x132557=util[_0x1cb8('0x4e')]('%s.%s',_0x54137d,_0x4cf5ba);var _0x106be5=!![];if(_0x2b1b28[_0x1cb8('0x102')]==='NOBEEP'){_0x106be5=![];}var _0x5d1f99=this[_0x1cb8('0x31')][_0x1cb8('0x103')](_0x54137d,_0x4cf5ba,_0x2b1b28[_0x1cb8('0x104')],_0x2b1b28[_0x1cb8('0x86')],undefined,_0x106be5);if(_0x5d1f99[_0x1cb8('0x7d')]!==-0x1){this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')](_0x1cb8('0x105'),_0x132557));var _0x2e3765=this[_0x1cb8('0x6f')][_0x1cb8('0x80')](this,_0x2b1b28,_0x132557);if(_0x2e3765){for(var _0x183208 in _0x2e3765){if(_0x2e3765[_0x1cb8('0xc4')](_0x183208)){this[_0x1cb8('0x31')][_0x1cb8('0xb6')](util[_0x1cb8('0x4e')](_0x1cb8('0x106'),_0x183208[_0x1cb8('0xc6')]()),_0x2e3765[_0x183208]);}}return this['channel']['noop'](util[_0x1cb8('0x4e')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x2e3765)));}}return _0x5d1f99;};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x107')]=function(_0x53a92c){logger[_0x1cb8('0x2b')](util['format'](_0x1cb8('0x108'),_0x53a92c[_0x1cb8('0x33')]));if(!this[_0x1cb8('0x64')](_0x53a92c['appid'])){return this['channel'][_0x1cb8('0x8e')]('no\x20appid\x20configured');}if(!this[_0x1cb8('0x64')](_0x53a92c[_0x1cb8('0x72')])){return this[_0x1cb8('0x31')]['noop'](_0x1cb8('0x109'));}var _0x47ec47='wav';var _0x3b501f=util[_0x1cb8('0x4e')](_0x1cb8('0x101'),FILES_PATH,rs['generate'](0x4));var _0x354b08=util[_0x1cb8('0x4e')](_0x1cb8('0x10a'),_0x3b501f,_0x47ec47);var _0xd8a47b=!![];if(_0x53a92c[_0x1cb8('0x102')]===_0x1cb8('0x10b')){_0xd8a47b=![];}var _0x1d7374=this[_0x1cb8('0x31')][_0x1cb8('0x103')](_0x3b501f,_0x47ec47,_0x53a92c[_0x1cb8('0x104')],_0x53a92c[_0x1cb8('0x86')],undefined,_0xd8a47b);if(_0x1d7374[_0x1cb8('0x7d')]!==-0x1){this[_0x1cb8('0x31')]['noop'](util[_0x1cb8('0x4e')](_0x1cb8('0x10c'),_0x354b08));var _0x10ec2a=this['tildeASR'][_0x1cb8('0x80')](this,_0x53a92c,_0x354b08);if(_0x10ec2a){for(var _0x4e2ab5 in _0x10ec2a){if(_0x10ec2a[_0x1cb8('0xc4')](_0x4e2ab5)){this[_0x1cb8('0x31')][_0x1cb8('0xb6')](util[_0x1cb8('0x4e')](_0x1cb8('0x10d'),_0x4e2ab5['toUpperCase']()),_0x10ec2a[_0x4e2ab5]);}}return this[_0x1cb8('0x31')]['noop'](util[_0x1cb8('0x4e')](_0x1cb8('0x10e'),JSON[_0x1cb8('0x10f')](_0x10ec2a)));}}return _0x1d7374;};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x110')]=function(_0x586536){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x111'),_0x586536['label']));return this[_0x1cb8('0x31')][_0x1cb8('0x112')](_0x586536[_0x1cb8('0x37')],_0x586536['extension'],_0x586536['priority']);};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x113')]=function(_0x3e27d0){logger['info'](util[_0x1cb8('0x4e')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x3e27d0[_0x1cb8('0x33')]));if(!this[_0x1cb8('0x64')](_0x3e27d0[_0x1cb8('0x114')])){return this['channel']['error'](_0x3e27d0,_0x1cb8('0x115'));}try{var _0x46684e=eval(_0x3e27d0[_0x1cb8('0x114')])?'true':_0x1cb8('0x116');this['channel'][_0x1cb8('0x8e')](util['format'](_0x1cb8('0x117'),_0x3e27d0[_0x1cb8('0x114')],_0x46684e));return{'code':0xc8,'result':_0x46684e};}catch(_0x582e68){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x118')]=function(_0x2dc40f){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x119'),_0x2dc40f[_0x1cb8('0x33')]));if(!this['isConfigured'](_0x2dc40f[_0x1cb8('0x11a')])){return this[_0x1cb8('0x31')]['error'](_0x2dc40f,_0x1cb8('0x11b'));}var _0x11fb47=this[_0x1cb8('0x22')]['sync'](this,_0x2dc40f['interval_id']);if(!_0x11fb47){return this[_0x1cb8('0x31')]['error'](_0x2dc40f,'no\x20intervals\x20found');}for(var _0x4d8ac1=0x0;_0x4d8ac1<_0x11fb47[_0x1cb8('0x79')];_0x4d8ac1+=0x1){var _0x27032b=this[_0x1cb8('0x31')][_0x1cb8('0xb')](util['format'](_0x1cb8('0x11c'),_0x11fb47[_0x4d8ac1]));if(_0x27032b[_0x1cb8('0x7d')]===-0x1){return _0x27032b;}logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x11d'),_0x11fb47[_0x4d8ac1],_0x27032b[_0x1cb8('0x7b')]));if(_0x27032b[_0x1cb8('0x7b')]===_0x1cb8('0x11e')){logger['info'](util['format'](_0x1cb8('0x11d'),_0x11fb47[_0x4d8ac1],_0x1cb8('0x11e')));this[_0x1cb8('0x31')]['noop'](util['format'](_0x1cb8('0x11d'),_0x11fb47[_0x4d8ac1],_0x1cb8('0x11e')));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x1cb8('0x4e')](_0x1cb8('0x11d'),_0x11fb47[_0x4d8ac1],'false'));this[_0x1cb8('0x31')]['noop'](util[_0x1cb8('0x4e')]('IFTIME\x20%s\x20%s',_0x11fb47[_0x4d8ac1],'false'));}}return{'code':0xc8,'result':_0x1cb8('0x116')};};AGIVertices['prototype'][_0x1cb8('0x11f')]=function(_0x309e32){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x120'),_0x309e32[_0x1cb8('0x33')]));return this[_0x1cb8('0x31')][_0x1cb8('0x11f')]();};AGIVertices[_0x1cb8('0xf')]['ispeechasr']=function(_0x5f2944){logger[_0x1cb8('0x2b')](util['format'](_0x1cb8('0x121'),_0x5f2944[_0x1cb8('0x33')]));if(!this[_0x1cb8('0x64')](_0x5f2944[_0x1cb8('0x5d')])){return this['channel'][_0x1cb8('0x8e')](_0x1cb8('0xc1'));}var _0x1e603f='wav';var _0x11ad33=util[_0x1cb8('0x4e')](_0x1cb8('0x101'),FILES_PATH,rs[_0x1cb8('0xe9')](0x4));var _0x509438=util['format']('%s.%s',_0x11ad33,_0x1e603f);var _0x1a46f0=!![];if(_0x5f2944[_0x1cb8('0x102')]==='NOBEEP'){_0x1a46f0=![];}var _0x3a3676=this['channel']['recordFile'](_0x11ad33,_0x1e603f,_0x5f2944['intKey'],_0x5f2944[_0x1cb8('0x86')],undefined,_0x1a46f0);if(_0x3a3676[_0x1cb8('0x7d')]!==-0x1){this[_0x1cb8('0x31')]['noop'](util[_0x1cb8('0x4e')](_0x1cb8('0x122'),_0x509438));var _0x4a0136=this[_0x1cb8('0x62')]['sync'](this,_0x5f2944,_0x509438);if(_0x4a0136){for(var _0x22b58a in _0x4a0136){if(_0x4a0136['hasOwnProperty'](_0x22b58a)){this[_0x1cb8('0x31')][_0x1cb8('0xb6')](util[_0x1cb8('0x4e')](_0x1cb8('0x123'),_0x22b58a[_0x1cb8('0xc6')]()),_0x4a0136[_0x22b58a]);}}return this[_0x1cb8('0x31')]['noop'](util[_0x1cb8('0x4e')](_0x1cb8('0x124'),JSON['stringify'](_0x4a0136)));}}return _0x3a3676;};AGIVertices['prototype'][_0x1cb8('0x125')]=function(_0x4ca652){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x126'),_0x4ca652[_0x1cb8('0x33')]));if(!this[_0x1cb8('0x64')](_0x4ca652[_0x1cb8('0x5d')])){return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](_0x1cb8('0xc1'));}if(!this['isConfigured'](_0x4ca652[_0x1cb8('0x54')])){return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](_0x1cb8('0x98'));}this[_0x1cb8('0x31')]['noop'](util[_0x1cb8('0x4e')](_0x1cb8('0x127'),_0x4ca652[_0x1cb8('0x54')]));var _0x2fb154=this[_0x1cb8('0x60')][_0x1cb8('0x80')](this,_0x4ca652);if(_0x2fb154){this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')](_0x1cb8('0x122'),_0x2fb154));var _0x361cc0=this[_0x1cb8('0x31')][_0x1cb8('0xd3')](_0x2fb154,_0x4ca652['intKey']);try{fs[_0x1cb8('0xd4')](_0x2fb154+_0x1cb8('0xd5'));}catch(_0x57e144){logger[_0x1cb8('0x2a')](_0x57e144);}return _0x361cc0;}return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x4ca652,_0x1cb8('0x128'));};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x129')]=function(_0x2bacf7){logger[_0x1cb8('0x2b')](util['format'](_0x1cb8('0x12a'),_0x2bacf7[_0x1cb8('0x33')]));if(!this[_0x1cb8('0x64')](_0x2bacf7['findBy'])){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x2bacf7,_0x1cb8('0x12b'));}logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x12c'),this['channel'][_0x1cb8('0x35')],_0x2bacf7[_0x1cb8('0x12d')]));var _0x20b305=this[_0x1cb8('0x4c')][_0x1cb8('0x80')](this,_0x2bacf7[_0x1cb8('0x12d')]);if(_0x20b305){logger['info'](util[_0x1cb8('0x4e')](_0x1cb8('0x12e'),this['channel']['callerid'],_0x2bacf7[_0x1cb8('0x12d')]));this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')](_0x1cb8('0x12e'),this[_0x1cb8('0x31')][_0x1cb8('0x35')],_0x2bacf7[_0x1cb8('0x12d')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format'](_0x1cb8('0x12f'),this['channel'][_0x1cb8('0x35')],_0x2bacf7[_0x1cb8('0x12d')]));this[_0x1cb8('0x31')]['noop'](util[_0x1cb8('0x4e')](_0x1cb8('0x12f'),this[_0x1cb8('0x31')]['callerid'],_0x2bacf7[_0x1cb8('0x12d')]));return{'code':0xc8,'result':_0x1cb8('0x130')};}};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x131')]=function(_0x43a281){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x43a281['label']));if(!this[_0x1cb8('0x64')](_0x43a281['findBy'])){return this[_0x1cb8('0x31')]['error'](_0x43a281,_0x1cb8('0x12b'));}logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x12c'),this[_0x1cb8('0x31')]['callerid'],_0x43a281[_0x1cb8('0x12d')]));var _0x45b23a=this[_0x1cb8('0x4b')][_0x1cb8('0x80')](this,_0x43a281['findBy']);if(_0x45b23a){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x12e'),this[_0x1cb8('0x31')][_0x1cb8('0x35')],_0x43a281['findBy']));this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x1cb8('0x31')][_0x1cb8('0x35')],_0x43a281[_0x1cb8('0x12d')]));return{'code':0xc8,'result':_0x1cb8('0x132')};}else{logger['info'](util[_0x1cb8('0x4e')](_0x1cb8('0x12f'),this[_0x1cb8('0x31')][_0x1cb8('0x35')],_0x43a281[_0x1cb8('0x12d')]));this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')](_0x1cb8('0x12f'),this[_0x1cb8('0x31')]['callerid'],_0x43a281[_0x1cb8('0x12d')]));return{'code':0xc8,'result':_0x1cb8('0x130')};}};AGIVertices['prototype'][_0x1cb8('0x133')]=function(_0x5f10b3){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x5f10b3[_0x1cb8('0x33')]));if(!this[_0x1cb8('0x64')](_0x5f10b3[_0x1cb8('0x134')])){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x5f10b3,_0x1cb8('0x135'));}this['channel'][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')]('math\x20%s',_0x5f10b3['operation']));var _0x3ac39c=eval(_0x5f10b3[_0x1cb8('0x134')]);if(!this[_0x1cb8('0x64')](_0x5f10b3[_0x1cb8('0xb2')])){return this['channel']['noop'](_0x1cb8('0xe3'));}var _0x501456=this[_0x1cb8('0xb')][_0x1cb8('0x80')](this,_0x5f10b3[_0x1cb8('0xb2')]);if(!_0x501456){return this['channel']['error'](_0x5f10b3,_0x1cb8('0xb3'));}if(_[_0x1cb8('0x136')](_0x3ac39c)){var _0x5771c5=this;_0x3ac39c[_0x1cb8('0xb4')](function(_0x1a51f0,_0x57c2cf){_0x5771c5[_0x1cb8('0x31')]['setVariable'](util[_0x1cb8('0x4e')](_0x1cb8('0x137'),_0x501456,_0x57c2cf),_0x1a51f0);});return this[_0x1cb8('0x31')]['noop'](util[_0x1cb8('0x4e')](_0x1cb8('0x138'),_0x501456));}else{return this[_0x1cb8('0x31')]['setVariable'](_0x501456,_0x3ac39c);}};AGIVertices['prototype'][_0x1cb8('0x8')]=function(_0x13cbdb){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x139'),_0x13cbdb[_0x1cb8('0x33')]));if(_0x13cbdb[_0x1cb8('0x81')]===0x0){return this[_0x1cb8('0x82')](_0x13cbdb);}_0x13cbdb[_0x1cb8('0x81')]-=0x1;if(!this[_0x1cb8('0x64')](_0x13cbdb[_0x1cb8('0xe1')])){return this[_0x1cb8('0x31')]['error'](_0x13cbdb,'no\x20file\x20audio\x20selected');}var _0x4b5dec=this[_0x1cb8('0x13a')]['sync'](this,_0x13cbdb[_0x1cb8('0xe1')]);if(!_0x4b5dec){return this['channel'][_0x1cb8('0x2a')](_0x13cbdb,'no\x20file\x20audio\x20found');}var _0x5b9012=this[_0x1cb8('0x31')][_0x1cb8('0xe4')](_0x4b5dec,_0x13cbdb['response'],_0x13cbdb[_0x1cb8('0x13b')]);var _0x51281=_0x5b9012[_0x1cb8('0x7d')];if(_0x5b9012[_0x1cb8('0x7d')]===-0x1){this[_0x1cb8('0x7f')]['sync'](this,_0x13cbdb,'-1');return _0x5b9012;}else if(_0x5b9012[_0x1cb8('0x7b')]===_0x1cb8('0x86')){_0x5b9012[_0x1cb8('0x7d')]=_0x5b9012[_0x1cb8('0x7d')][_0x1cb8('0x79')]>0x0?_0x5b9012['result']:'t';}else if(_[_0x1cb8('0x40')](_0x5b9012[_0x1cb8('0x7d')])){_0x5b9012[_0x1cb8('0x7d')]='#';_0x51281='#';}if(!this[_0x1cb8('0x64')](_0x13cbdb[_0x1cb8('0xb2')])){this['channel'][_0x1cb8('0x8e')](_0x1cb8('0xe3'));}else{var _0x482bdd=this[_0x1cb8('0xb')][_0x1cb8('0x80')](this,_0x13cbdb['variable_id']);if(!_0x482bdd){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x13cbdb,'no\x20variable\x20found');}this['channel'][_0x1cb8('0xb6')](_0x482bdd,_0x51281);}this['createSquareDetailsReport'][_0x1cb8('0x80')](this,_0x13cbdb,_0x51281);return _0x5b9012;};AGIVertices[_0x1cb8('0xf')]['noop']=function(_0xebc79f){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0xebc79f[_0x1cb8('0x33')]));return this['channel'][_0x1cb8('0x8e')](_0xebc79f[_0x1cb8('0x13c')]||_0xebc79f['label']);};AGIVertices['prototype'][_0x1cb8('0x13d')]=function(_0x5eab00){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x13e'),_0x5eab00[_0x1cb8('0x33')]));if(!this['isConfigured'](_0x5eab00[_0x1cb8('0x12d')])){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x5eab00,_0x1cb8('0x12b'));}logger[_0x1cb8('0x2b')](util['format'](_0x1cb8('0x12c'),this[_0x1cb8('0x31')][_0x1cb8('0x35')],_0x5eab00[_0x1cb8('0x12d')]));var _0x6023b0=this[_0x1cb8('0x47')]['sync'](this,_0x5eab00[_0x1cb8('0x13f')]);var _0x3e930e=this[_0x1cb8('0x140')][_0x1cb8('0x80')](this,_0x5eab00[_0x1cb8('0x12d')],_0x6023b0);if(_0x3e930e){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x1cb8('0x31')]['callerid'],_0x5eab00[_0x1cb8('0x12d')]));this['channel'][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')](_0x1cb8('0x12e'),this[_0x1cb8('0x31')][_0x1cb8('0x35')],_0x5eab00[_0x1cb8('0x12d')]));return{'code':0xc8,'result':'success'};}else{logger[_0x1cb8('0x2b')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1cb8('0x31')]['callerid'],_0x5eab00[_0x1cb8('0x12d')]));this['channel']['noop'](util[_0x1cb8('0x4e')](_0x1cb8('0x12e'),this[_0x1cb8('0x31')]['callerid'],_0x5eab00[_0x1cb8('0x12d')]));return{'code':0xc8,'result':_0x1cb8('0x130')};}};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x141')]=function(_0x403c2e){logger[_0x1cb8('0x2b')](util['format'](_0x1cb8('0x142'),_0x403c2e['label']));if(!this[_0x1cb8('0x64')](_0x403c2e['file_id'])){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x403c2e,_0x1cb8('0x143'));}var _0x4460a4=this[_0x1cb8('0x13a')][_0x1cb8('0x80')](this,_0x403c2e['file_id']);if(!_0x4460a4){return this[_0x1cb8('0x31')]['error'](_0x403c2e,'no\x20file\x20audio\x20found');}var _0x413967=this['channel'][_0x1cb8('0x51')]('PLAYBACK',[_0x4460a4,_0x403c2e['opts']]);if(_0x413967[_0x1cb8('0x7d')]===-0x1){return _0x413967;}return this['channel'][_0x1cb8('0x8e')](util['format'](_0x1cb8('0x95'),_0x1cb8('0x144'),_0x4460a4));};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x145')]=function(_0x46059a){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x46059a[_0x1cb8('0x33')]));if(!this['isConfigured'](_0x46059a[_0x1cb8('0x146')])){return this['channel']['error'](_0x46059a,'no\x20queue\x20selected');}var _0x283f8f='';var _0x40235f=parseInt(_0x46059a[_0x1cb8('0x146')],0xa);if(isNaN(_0x40235f)){_0x283f8f=_0x46059a['queue_id'];}else{_0x283f8f=this['getVoiceQueue'][_0x1cb8('0x80')](this,_0x46059a[_0x1cb8('0x146')]);if(!_0x283f8f){return this['channel'][_0x1cb8('0x2a')](_0x46059a,'no\x20queue\x20found');}}var _0x4f64b6='';if(this[_0x1cb8('0x64')](_0x46059a[_0x1cb8('0xe1')])){var _0x393551=this['getSound'][_0x1cb8('0x80')](this,_0x46059a[_0x1cb8('0xe1')]);if(_0x393551){_0x4f64b6=_0x393551;}}this[_0x1cb8('0x7f')][_0x1cb8('0x80')](this,_0x46059a,_0x283f8f);if(_0x46059a[_0x1cb8('0xde')]['indexOf']('x')<0x0){_0x46059a[_0x1cb8('0xde')]+='x';}if(_0x46059a['opts'][_0x1cb8('0x147')]('X')<0x0){_0x46059a['opts']+='X';}this['channel']['setVariable']('XMCS-QUEUE',_0x283f8f?_0x283f8f[_0x1cb8('0x148')]():'');var _0x2f93bc=this[_0x1cb8('0x31')][_0x1cb8('0x51')](_0x1cb8('0x149'),[_0x283f8f,_0x46059a['opts'],_0x46059a[_0x1cb8('0xbe')],_0x4f64b6,_0x46059a['timeout'],_0x46059a[_0x1cb8('0x5')],_0x46059a[_0x1cb8('0x14a')],_0x46059a[_0x1cb8('0x14b')],'',_0x46059a[_0x1cb8('0x14c')]]);if(_0x2f93bc[_0x1cb8('0x7d')]===-0x1){return _0x2f93bc;}return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util['format'](_0x1cb8('0x95'),_0x1cb8('0x149'),_0x283f8f));};AGIVertices['prototype'][_0x1cb8('0x14d')]=function(_0x2cb919){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x14e'),_0x2cb919[_0x1cb8('0x33')]));var _0x209c6d=_0x2cb919[_0x1cb8('0x14f')]||_0x1cb8('0x100');var _0x4566f4=util['format'](_0x1cb8('0x150'),this[_0x1cb8('0x31')][_0x1cb8('0x32')],rs[_0x1cb8('0xe9')](0x5));var _0x10c830=util[_0x1cb8('0x4e')](_0x1cb8('0x151'),FILES_PATH,_0x4566f4,_0x209c6d);var _0x7b05e2=util['format'](_0x1cb8('0x101'),FILES_PATH,_0x4566f4);this[_0x1cb8('0x36')][_0x1cb8('0x80')](this,_0x2cb919,_0x4566f4,_0x10c830);this[_0x1cb8('0x31')]['setVariable']('RECORDING_SAVENAME',_0x4566f4);logger[_0x1cb8('0x2b')](_0x1cb8('0x152'),_0x7b05e2,_0x209c6d,_0x2cb919[_0x1cb8('0x153')],_0x2cb919[_0x1cb8('0x86')]);return this[_0x1cb8('0x31')]['recordFile'](_0x7b05e2,_0x209c6d,_0x2cb919[_0x1cb8('0x153')],_0x2cb919[_0x1cb8('0x86')],undefined,!![]);};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x154')]=function(_0x4b5662){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x155'),_0x4b5662['label']));return this['channel'][_0x1cb8('0x156')](_0x4b5662[_0x1cb8('0x157')]['replace'](/\s+/g,''),_0x4b5662[_0x1cb8('0x153')]);};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x158')]=function(_0xe3ab90){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0xe3ab90[_0x1cb8('0x33')]));return this['channel']['sayNumber'](_0xe3ab90['number'][_0x1cb8('0x159')](/\s+/g,''),_0xe3ab90[_0x1cb8('0x153')]);};AGIVertices[_0x1cb8('0xf')]['sayphonetic']=function(_0x3251d3){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x15a'),_0x3251d3[_0x1cb8('0x33')]));return this['channel'][_0x1cb8('0x15b')](_0x3251d3[_0x1cb8('0x54')],_0x3251d3[_0x1cb8('0x153')]);};AGIVertices[_0x1cb8('0xf')]['sendMail']=function(_0x38f46a){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x38f46a[_0x1cb8('0x33')]));if(!this[_0x1cb8('0x64')](_0x38f46a[_0x1cb8('0x15c')])){return this[_0x1cb8('0x31')]['noop'](_0x1cb8('0x15d'));}var _0x478ef7=this[_0x1cb8('0x1e')][_0x1cb8('0x80')](this,_0x38f46a[_0x1cb8('0x15c')]);if(!_0x478ef7||!_0x478ef7[_0x1cb8('0x15e')]){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x38f46a,_0x1cb8('0x15f'));}var _0x3a3737={'from':util['format']('\x22%s\x22\x20<%s>',_0x478ef7['name'],_0x478ef7['email']||_0x478ef7[_0x1cb8('0x15e')][_0x1cb8('0x160')]),'to':_0x38f46a['to']||'','cc':_0x38f46a['cc']||'','bcc':_0x38f46a[_0x1cb8('0x161')]||'','subject':_0x38f46a['subject'],'html':_0x38f46a[_0x1cb8('0x54')],'text':_0x38f46a[_0x1cb8('0x54')]};var _0x2a6399={'tls':{'rejectUnauthorized':![]}};if(_0x478ef7[_0x1cb8('0x15e')][_0x1cb8('0x162')]){_0x2a6399[_0x1cb8('0x162')]=_0x478ef7[_0x1cb8('0x15e')]['service'];}else{_0x2a6399[_0x1cb8('0x163')]=_0x478ef7['Smtp'][_0x1cb8('0x163')];_0x2a6399[_0x1cb8('0x164')]=_0x478ef7[_0x1cb8('0x15e')][_0x1cb8('0x164')];_0x2a6399[_0x1cb8('0x165')]=_0x478ef7[_0x1cb8('0x15e')]['secure'];}if(_0x478ef7['Smtp'][_0x1cb8('0x166')]){_0x2a6399[_0x1cb8('0x167')]={'user':_0x478ef7[_0x1cb8('0x15e')][_0x1cb8('0x160')],'pass':_0x478ef7['Smtp'][_0x1cb8('0x168')]};}if(this[_0x1cb8('0x64')](_0x38f46a[_0x1cb8('0x169')])){}logger['debug'](_0x1cb8('0x16a'),JSON[_0x1cb8('0x10f')](_0x3a3737));this['createSquareDetailsReport'][_0x1cb8('0x80')](this,_0x38f46a,_0x38f46a['account_id']);this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')](_0x1cb8('0x16b'),_0x478ef7[_0x1cb8('0xe')]));this[_0x1cb8('0x20')]['sync'](this,_0x2a6399,_0x3a3737);return this[_0x1cb8('0x31')][_0x1cb8('0x8e')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x16c')]=function(_0x264120){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x16d'),_0x264120[_0x1cb8('0x33')]));return this[_0x1cb8('0x31')][_0x1cb8('0x8e')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype']['sendSMS']=function(_0x94aeb0){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x94aeb0[_0x1cb8('0x33')]));if(!this[_0x1cb8('0x64')](_0x94aeb0[_0x1cb8('0x16e')])){return this['channel'][_0x1cb8('0x8e')](_0x1cb8('0x16f'));}var _0x3a3145=this[_0x1cb8('0x170')]['sync'](this,_0x94aeb0['sms_account_id']);if(!_0x3a3145){return this['channel'][_0x1cb8('0x2a')](_0x94aeb0,_0x1cb8('0x171'));}var _0x2bc64a={'body':_0x94aeb0['sms_text'],'phone':_0x94aeb0['to']||'','SmsAccountId':_0x3a3145['id']};logger[_0x1cb8('0x172')](_0x1cb8('0x173'),JSON[_0x1cb8('0x10f')](_0x2bc64a));this['createSquareDetailsReport'][_0x1cb8('0x80')](this,_0x94aeb0,_0x94aeb0[_0x1cb8('0x16e')]);this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util['format'](_0x1cb8('0x174'),_0x3a3145[_0x1cb8('0xe')]));this[_0x1cb8('0x30')]['sync'](this,_0x2bc64a);return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](_0x1cb8('0x175'));};AGIVertices[_0x1cb8('0xf')]['set']=function(_0xb2bd17){logger[_0x1cb8('0x2b')](util['format'](_0x1cb8('0x176'),_0xb2bd17[_0x1cb8('0x33')]));if(!this[_0x1cb8('0x64')](_0xb2bd17[_0x1cb8('0xb2')])){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0xb2bd17,_0x1cb8('0x177'));}var _0x1dda93=this[_0x1cb8('0xb')]['sync'](this,_0xb2bd17[_0x1cb8('0xb2')]);if(!_0x1dda93){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0xb2bd17,_0x1cb8('0xb3'));}return this[_0x1cb8('0x31')][_0x1cb8('0xb6')](_0x1dda93,_0xb2bd17[_0x1cb8('0x178')]);};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x179')]=function(_0x2100b4){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x17a'),_0x2100b4[_0x1cb8('0x33')]));this['channel'][_0x1cb8('0x8e')](_0x1cb8('0x17b'));if(_0x2100b4[_0x1cb8('0x85')]===_0x1cb8('0x17c')){this[_0x1cb8('0x31')][_0x1cb8('0x8e')]('Answer');return this['channel'][_0x1cb8('0x85')]();}return this[_0x1cb8('0x31')][_0x1cb8('0x8e')]('Skipped\x20Answer');};AGIVertices['prototype']['subproject']=function(_0x5b8d6f){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x5b8d6f[_0x1cb8('0x33')]));if(!this[_0x1cb8('0x64')](_0x5b8d6f['project_id'])){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x5b8d6f,'no\x20subproject\x20selected');}var _0x180e89=this['getSquareProject'][_0x1cb8('0x80')](this,_0x5b8d6f[_0x1cb8('0x17d')]);if(!this[_0x1cb8('0x64')](_0x180e89)){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x5b8d6f,util[_0x1cb8('0x4e')](_0x1cb8('0x17e'),_0x5b8d6f['project_id']));}if(_0x180e89===this['channel'][_0x1cb8('0x34')]){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x5b8d6f,_0x1cb8('0x17f'));}this[_0x1cb8('0x7f')][_0x1cb8('0x80')](this,_0x5b8d6f,_0x180e89);var _0x1137cb=this[_0x1cb8('0x31')]['exec'](_0x1cb8('0x180'),util['format'](_0x1cb8('0x181'),config['agi'][_0x1cb8('0x163')]||_0x1cb8('0x182'),_0x180e89,this['channel'][_0x1cb8('0x34')]));if(_0x1137cb[_0x1cb8('0x7d')]===-0x1){return _0x1137cb;}return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')](_0x1cb8('0x95'),_0x1cb8('0x180'),_0x180e89));};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x183')]=function(_0x3d7e5d){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x184'),_0x3d7e5d['label']));var _0x4444c7=this['shellCommand'][_0x1cb8('0x80')](this,_0x3d7e5d['command']);this[_0x1cb8('0x7f')][_0x1cb8('0x80')](this,_0x3d7e5d,_0x3d7e5d[_0x1cb8('0x185')]);if(this[_0x1cb8('0x64')](_0x3d7e5d[_0x1cb8('0xb2')])){var _0x4c9299=this[_0x1cb8('0xb')]['sync'](this,_0x3d7e5d[_0x1cb8('0xb2')]);if(_0x4c9299){this[_0x1cb8('0x31')][_0x1cb8('0xb6')](_0x4c9299,_0x4444c7);return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util['format'](_0x1cb8('0x186'),_0x3d7e5d['command'],_0x4c9299));}}return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')](_0x1cb8('0x187'),_0x3d7e5d[_0x1cb8('0x185')]));};AGIVertices['prototype'][_0x1cb8('0x188')]=function(_0x3a4b3c){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x189'),_0x3a4b3c[_0x1cb8('0x33')]));if(!this[_0x1cb8('0x64')](_0x3a4b3c[_0x1cb8('0x18a')])){return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](_0x1cb8('0x18b'));}if(!this[_0x1cb8('0x64')](_0x3a4b3c[_0x1cb8('0x54')])){return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](_0x1cb8('0x98'));}this[_0x1cb8('0x31')]['noop'](util[_0x1cb8('0x4e')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x3a4b3c[_0x1cb8('0x54')]));var _0x14d633=this[_0x1cb8('0x53')]['sync'](this,_0x3a4b3c);if(_0x14d633){this[_0x1cb8('0x31')]['noop'](util[_0x1cb8('0x4e')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x14d633));var _0x24b244=this[_0x1cb8('0x31')]['streamFile'](_0x14d633);try{fs[_0x1cb8('0xd4')](_0x14d633+'.wav');}catch(_0x2bbed8){logger[_0x1cb8('0x2a')](_0x2bbed8);}return _0x24b244;}return this['channel'][_0x1cb8('0x2a')](_0x3a4b3c,_0x1cb8('0x18c'));};AGIVertices[_0x1cb8('0xf')]['tts']=function(_0x2b3150){logger['info'](util['format'](_0x1cb8('0x18d'),_0x2b3150[_0x1cb8('0x33')]));if(!this['isConfigured'](_0x2b3150[_0x1cb8('0x54')])){return this['channel'][_0x1cb8('0x8e')](_0x1cb8('0x98'));}this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')](_0x1cb8('0x18e'),_0x2b3150['text']));var _0x16bfa1=this[_0x1cb8('0x18f')][_0x1cb8('0x80')](this,_0x2b3150);if(_0x16bfa1){this[_0x1cb8('0x31')]['noop'](util[_0x1cb8('0x4e')](_0x1cb8('0x190'),_0x16bfa1));var _0x152a17=this[_0x1cb8('0x31')][_0x1cb8('0xd3')](_0x16bfa1);try{fs[_0x1cb8('0xd4')](_0x16bfa1+_0x1cb8('0xd5'));}catch(_0x5acc66){logger[_0x1cb8('0x2a')](_0x5acc66);}return _0x152a17;}return this['channel'][_0x1cb8('0x2a')](_0x2b3150,_0x1cb8('0x191'));};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x192')]=function(_0xab2a59){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x193'),_0xab2a59['label']));if(!this['isConfigured'](_0xab2a59[_0x1cb8('0x12d')])){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0xab2a59,_0x1cb8('0x12b'));}logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x12c'),this[_0x1cb8('0x31')][_0x1cb8('0x35')],_0xab2a59['findBy']));var _0x3306c0=this[_0x1cb8('0x4a')][_0x1cb8('0x80')](this,_0xab2a59[_0x1cb8('0x12d')]);if(_0x3306c0){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x12e'),this[_0x1cb8('0x31')]['callerid'],_0xab2a59[_0x1cb8('0x12d')]));this['channel']['noop'](util[_0x1cb8('0x4e')](_0x1cb8('0x12e'),this[_0x1cb8('0x31')][_0x1cb8('0x35')],_0xab2a59[_0x1cb8('0x12d')]));return{'code':0xc8,'result':_0x1cb8('0x132')};}else{logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x12f'),this[_0x1cb8('0x31')][_0x1cb8('0x35')],_0xab2a59[_0x1cb8('0x12d')]));this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')](_0x1cb8('0x12f'),this[_0x1cb8('0x31')][_0x1cb8('0x35')],_0xab2a59[_0x1cb8('0x12d')]));return{'code':0xc8,'result':_0x1cb8('0x130')};}};AGIVertices[_0x1cb8('0xf')][_0x1cb8('0x194')]=function(_0xeba99){logger[_0x1cb8('0x2b')](util[_0x1cb8('0x4e')](_0x1cb8('0x195'),_0xeba99[_0x1cb8('0x33')]));var _0x813971=this['channel']['exec']('VOICEMAIL',[_0xeba99[_0x1cb8('0x196')],_0xeba99[_0x1cb8('0x94')]]);if(_0x813971[_0x1cb8('0x7d')]===-0x1){return _0x813971;}return this[_0x1cb8('0x31')][_0x1cb8('0x8e')](util[_0x1cb8('0x4e')](_0x1cb8('0x95'),'VOICEMAIL',_0xeba99['mailbox']));};AGIVertices['prototype']['vswitch']=function(_0x5c836d){logger[_0x1cb8('0x2b')](util['format'](_0x1cb8('0x197'),_0x5c836d[_0x1cb8('0x33')]));if(!this[_0x1cb8('0x64')](_0x5c836d[_0x1cb8('0xb2')])){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x5c836d,_0x1cb8('0x177'));}var _0x42739f=this['getVariable'][_0x1cb8('0x80')](this,_0x5c836d[_0x1cb8('0xb2')]);if(!_0x42739f){return this[_0x1cb8('0x31')][_0x1cb8('0x2a')](_0x5c836d,'no\x20variable\x20found');}var _0x4f5fa3=this[_0x1cb8('0x31')]['getVariable'](_0x42739f);return{'code':0xc8,'result':_0x4f5fa3['extra']?_0x4f5fa3['extra']:'-'};};String[_0x1cb8('0xf')][_0x1cb8('0x7a')]=function(_0x3a26c6,_0x4dfd96){return this[_0x1cb8('0x78')](_0x3a26c6)[_0x1cb8('0x198')](_0x4dfd96);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index fc1d4e7..93c8629 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 _0xa8a8=['blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','interface','ACW','mandatoryDisposition','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','queue','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','uniqueid','[TIMER][STOP][AGENT:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','transfertargetuniqueid','secondtransfereruniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer'];(function(_0x9df78a,_0x193ffc){var _0x32515c=function(_0x1d66fe){while(--_0x1d66fe){_0x9df78a['push'](_0x9df78a['shift']());}};_0x32515c(++_0x193ffc);}(_0xa8a8,0xec));var _0x8a8a=function(_0x3a46d6,_0x2fb610){_0x3a46d6=_0x3a46d6-0x0;var _0x12c0f0=_0xa8a8[_0x3a46d6];return _0x12c0f0;};'use strict';var util=require(_0x8a8a('0x0'));var _=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var ami=require(_0x8a8a('0x3'));var logger=require('../../../config/logger')(_0x8a8a('0x4'));var RpcUser=require(_0x8a8a('0x5'));var RpcVoiceAgentReport=require(_0x8a8a('0x6'));function Acw(_0x3ed1de){this[_0x8a8a('0x7')]=_0x3ed1de[_0x8a8a('0x7')];this[_0x8a8a('0x8')]=_0x3ed1de[_0x8a8a('0x8')];this[_0x8a8a('0x9')]=_0x3ed1de[_0x8a8a('0x9')];this[_0x8a8a('0xa')]={};ami['on'](_0x8a8a('0xb'),this[_0x8a8a('0xc')][_0x8a8a('0xd')](this));ami['on'](_0x8a8a('0xe'),this['syncHangupRequest']['bind'](this));ami['on'](_0x8a8a('0xf'),this['syncHangup'][_0x8a8a('0xd')](this));ami['on'](_0x8a8a('0x10'),this['syncAgentRingNoAnswer'][_0x8a8a('0xd')](this));ami['on'](_0x8a8a('0x11'),this[_0x8a8a('0x12')]['bind'](this));ami['on'](_0x8a8a('0x13'),this[_0x8a8a('0x14')][_0x8a8a('0xd')](this));ami['on'](_0x8a8a('0x15'),this['syncAgentConnectPreview'][_0x8a8a('0xd')](this));}function getDiff(_0x4e5d74){var _0x25e1d5=moment()[_0x8a8a('0x16')](0x0);var _0x787eec=moment(_0x4e5d74)[_0x8a8a('0x16')](0x0);return _0x25e1d5[_0x8a8a('0x17')](_0x787eec,_0x8a8a('0x18'));}Acw[_0x8a8a('0x19')]['startAcw']=function(_0x1ed3be){try{var _0x568b83=this;var _0x1f36b6=this[_0x8a8a('0xa')][_0x1ed3be][_0x8a8a('0x1a')];var _0x4291e9=this[_0x8a8a('0xa')][_0x1ed3be]['queue'];var _0x9d55f9=this[_0x8a8a('0x7')][_0x4291e9];var _0x262ca9=![];var _0x2bce13=_0x8a8a('0x1b');if(_0x9d55f9[_0x8a8a('0x1c')]){if(_0x9d55f9['mandatoryDispositionPause']['name']){_0x262ca9=!![];_0x2bce13=_0x9d55f9['mandatoryDispositionPause']['name'];}}ami['Action']({'action':_0x8a8a('0x1d'),'interface':_0x1f36b6,'paused':!![],'reason':_0x2bce13})[_0x8a8a('0x1e')](function(_0xe0f449){if(_0x568b83[_0x8a8a('0x8')][_0x1f36b6]){return RpcUser[_0x8a8a('0x1f')](_0x568b83[_0x8a8a('0x8')][_0x1f36b6]['id'])[_0x8a8a('0x1e')](function(_0xe0321c){if(_0xe0321c&&!_0xe0321c[_0x8a8a('0x20')]){logger[_0x8a8a('0x21')](_0x8a8a('0x22'),_0x1ed3be,_0x1f36b6,_0x4291e9);var _0x3aa2bb=_0x568b83[_0x8a8a('0xa')][_0x1ed3be][_0x8a8a('0x23')]&&_0x568b83[_0x8a8a('0xa')][_0x1ed3be]['destlinkedid']?_0x568b83[_0x8a8a('0xa')][_0x1ed3be][_0x8a8a('0x24')]:_0x1ed3be;return RpcUser[_0x8a8a('0x25')](_0x568b83[_0x8a8a('0x8')][_0x1f36b6],_0x2bce13,_0x3aa2bb)[_0x8a8a('0x1e')](function(_0x251315){if(!_0x262ca9){_0x568b83[_0x8a8a('0x9')][_0x1f36b6]={};logger['info'](_0x8a8a('0x26'),_0x1ed3be,_0x568b83[_0x8a8a('0x7')][_0x4291e9][_0x8a8a('0x27')],_0x1f36b6,_0x4291e9);_0x568b83['timers'][_0x1f36b6]['timer']=setTimeout(_0x568b83[_0x8a8a('0x28')][_0x8a8a('0xd')](_0x568b83,_0x1f36b6),_0x568b83['voiceQueues'][_0x4291e9]['acwTimeout']*0x3e8);_0x568b83['timers'][_0x1f36b6][_0x8a8a('0x29')]=moment()['format'](_0x8a8a('0x2a'));_0x568b83[_0x8a8a('0x9')][_0x1f36b6]['uniqueid']=_0x1ed3be;_0x568b83[_0x8a8a('0x9')][_0x1f36b6][_0x8a8a('0x2b')]=_0x4291e9;_0x568b83[_0x8a8a('0x9')][_0x1f36b6][_0x8a8a('0x2c')]=function(){var _0x41802e=getDiff(_0x568b83[_0x8a8a('0x9')][_0x1f36b6][_0x8a8a('0x29')]);clearTimeout(_0x568b83[_0x8a8a('0x9')][_0x1f36b6]['timer']);_0x568b83['timers'][_0x1f36b6]['timer']=![];RpcVoiceAgentReport[_0x8a8a('0x2d')]({'acwtime':_0x41802e},_0x568b83[_0x8a8a('0x9')][_0x1f36b6]['uniqueid'],_0x1f36b6)[_0x8a8a('0x1e')](function(_0x304e83){logger['info'](_0x8a8a('0x2e'),_0x1ed3be,_0x41802e,_0x304e83);})[_0x8a8a('0x2f')](function(_0x63b9be){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x1ed3be,_0x63b9be);});delete _0x568b83[_0x8a8a('0x9')][_0x1f36b6];};}});}else{logger['info'](_0x8a8a('0x30'),_0x1ed3be,_0x1f36b6,_0x4291e9);}});}})[_0x8a8a('0x2f')](function(_0x3ecbca){logger[_0x8a8a('0x31')](_0x8a8a('0x26'),_0x1ed3be,_0x568b83[_0x8a8a('0x7')][_0x4291e9][_0x8a8a('0x27')],_0x1f36b6,_0x4291e9);})[_0x8a8a('0x32')](function(){delete _0x568b83[_0x8a8a('0xa')][_0x1ed3be];});}catch(_0xf7d4d7){logger[_0x8a8a('0x31')](_0x8a8a('0x33'),_0xf7d4d7[_0x8a8a('0x34')]);}};Acw[_0x8a8a('0x19')][_0x8a8a('0x28')]=function(_0xac4c53){try{var _0x8e3017=this;if(_0x8e3017[_0x8a8a('0x9')][_0xac4c53]){_0x8e3017['timers'][_0xac4c53]['timer']=![];var _0x53da01=_0x8e3017[_0x8a8a('0x9')][_0xac4c53][_0x8a8a('0x35')];var _0x376de3=_0x8e3017[_0x8a8a('0x9')][_0xac4c53][_0x8a8a('0x2b')];var _0x508e67=_0x8e3017['voiceQueues'][_0x376de3][_0x8a8a('0x27')];logger['info'](_0x8a8a('0x36'),_0xac4c53);RpcUser['saveUnpause'](this['agents'][_0xac4c53]);RpcVoiceAgentReport[_0x8a8a('0x2d')]({'acwtime':_0x508e67,'agentacw':!![]},_0x53da01,_0xac4c53)[_0x8a8a('0x1e')](function(_0x285e2c){logger[_0x8a8a('0x21')](_0x8a8a('0x2e'),_0x53da01,_0x508e67,_0x285e2c);})[_0x8a8a('0x2f')](function(_0x20584a){logger['error'](_0x8a8a('0x37'),_0x53da01,_0x20584a);});}else{logger[_0x8a8a('0x31')](_0x8a8a('0x38'),_0xac4c53);if(_0x8e3017['timers']){logger[_0x8a8a('0x21')](_0x8a8a('0x39'),JSON[_0x8a8a('0x3a')](_0x8e3017['timers']));}}}catch(_0x3fda48){logger[_0x8a8a('0x31')](_0x8a8a('0x3b'),_0x3fda48[_0x8a8a('0x34')]);}};Acw[_0x8a8a('0x19')][_0x8a8a('0xc')]=function(_0x4ffdd9){try{if(this['voiceQueues'][_0x4ffdd9[_0x8a8a('0x2b')]]&&(this['voiceQueues'][_0x4ffdd9[_0x8a8a('0x2b')]][_0x8a8a('0x4')]||this['voiceQueues'][_0x4ffdd9['queue']][_0x8a8a('0x1c')])){if(this[_0x8a8a('0x8')][_0x4ffdd9[_0x8a8a('0x1a')]]){this[_0x8a8a('0xa')][_0x4ffdd9['uniqueid']]={'queue':_0x4ffdd9[_0x8a8a('0x2b')],'interface':_0x4ffdd9['interface'],'destlinkedid':_0x4ffdd9[_0x8a8a('0x24')]};}}}catch(_0x1629dc){logger['error'](_0x8a8a('0x3c'),_0x1629dc[_0x8a8a('0x34')]);}};Acw[_0x8a8a('0x19')]['syncAgentConnectPreview']=function(_0x177f89){try{if(this[_0x8a8a('0x7')][_0x177f89[_0x8a8a('0x2b')]]&&(this['voiceQueues'][_0x177f89['queue']][_0x8a8a('0x4')]||this[_0x8a8a('0x7')][_0x177f89[_0x8a8a('0x2b')]]['mandatoryDisposition'])){if(this[_0x8a8a('0x8')][_0x177f89[_0x8a8a('0x1a')]]){this[_0x8a8a('0xa')][_0x177f89[_0x8a8a('0x35')]]={'queue':_0x177f89[_0x8a8a('0x2b')],'interface':_0x177f89[_0x8a8a('0x1a')]};}}}catch(_0x13c233){logger[_0x8a8a('0x31')](_0x8a8a('0x3d'),_0x13c233[_0x8a8a('0x34')]);}};Acw[_0x8a8a('0x19')]['syncHangupRequest']=function(_0x1ad19b){try{if(this[_0x8a8a('0xa')][_0x1ad19b[_0x8a8a('0x35')]]&&_[_0x8a8a('0x3e')](this[_0x8a8a('0xa')][_0x1ad19b[_0x8a8a('0x35')]]['attended'])){logger[_0x8a8a('0x21')](_0x8a8a('0x3f'),_0x1ad19b[_0x8a8a('0x35')]);this[_0x8a8a('0x40')](_0x1ad19b['uniqueid']);}else if(this[_0x8a8a('0xa')][_0x1ad19b[_0x8a8a('0x41')]]&&_[_0x8a8a('0x3e')](this['channels'][_0x1ad19b['linkedid']][_0x8a8a('0x23')])){logger[_0x8a8a('0x21')](_0x8a8a('0x42'),_0x1ad19b[_0x8a8a('0x41')]);this[_0x8a8a('0x40')](_0x1ad19b[_0x8a8a('0x41')]);}}catch(_0x1d1b5c){logger[_0x8a8a('0x31')](_0x8a8a('0x43'),_0x1d1b5c['message']);}};Acw['prototype'][_0x8a8a('0x44')]=function(_0x10f689){try{if(this['channels'][_0x10f689['uniqueid']]&&this[_0x8a8a('0xa')][_0x10f689['uniqueid']][_0x8a8a('0x23')]){logger['info'](_0x8a8a('0x45'),_0x10f689[_0x8a8a('0x35')]);this[_0x8a8a('0x40')](_0x10f689[_0x8a8a('0x35')]);}else if(this[_0x8a8a('0xa')][_0x10f689[_0x8a8a('0x41')]]&&this[_0x8a8a('0xa')][_0x10f689[_0x8a8a('0x41')]][_0x8a8a('0x23')]){logger[_0x8a8a('0x21')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x10f689[_0x8a8a('0x41')]);this[_0x8a8a('0x40')](_0x10f689[_0x8a8a('0x41')]);}}catch(_0x1e3bf5){logger[_0x8a8a('0x31')]('[ACW][syncHangup]\x20%s',_0x1e3bf5[_0x8a8a('0x34')]);}};Acw[_0x8a8a('0x19')]['syncAttendedTransfer']=function(_0x5c5cb6){try{if(!_[_0x8a8a('0x46')](this[_0x8a8a('0xa')][_0x5c5cb6[_0x8a8a('0x47')]])){this[_0x8a8a('0x40')](_0x5c5cb6[_0x8a8a('0x47')]);if(this[_0x8a8a('0xa')][_0x5c5cb6['secondtransfereruniqueid']]){this['channels'][_0x5c5cb6['secondtransfereruniqueid']][_0x8a8a('0x23')]=!![];this['channels'][_0x5c5cb6[_0x8a8a('0x48')]]=this[_0x8a8a('0xa')][_0x5c5cb6['secondtransfereruniqueid']];delete this[_0x8a8a('0xa')][_0x5c5cb6[_0x8a8a('0x49')]];}}else if(!_[_0x8a8a('0x46')](this[_0x8a8a('0xa')][_0x5c5cb6['transfertargetuniqueid']])){this[_0x8a8a('0x40')](_0x5c5cb6['transfertargetuniqueid']);if(this[_0x8a8a('0xa')][_0x5c5cb6[_0x8a8a('0x4a')]]){this['channels'][_0x5c5cb6[_0x8a8a('0x4a')]][_0x8a8a('0x23')]=!![];this[_0x8a8a('0xa')][_0x5c5cb6[_0x8a8a('0x47')]]=this['channels'][_0x5c5cb6[_0x8a8a('0x4a')]];delete this[_0x8a8a('0xa')][_0x5c5cb6[_0x8a8a('0x4a')]];}}}catch(_0x5b029e){logger['error'](_0x8a8a('0x4b'),_0x5b029e['message']);}};Acw['prototype']['syncBlindTransfer']=function(_0x395564){try{if(this[_0x8a8a('0xa')][_0x395564['transfereruniqueid']]){logger[_0x8a8a('0x21')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x395564[_0x8a8a('0x4c')]));this[_0x8a8a('0x40')](_0x395564['transfereruniqueid']);}else if(this[_0x8a8a('0xa')][_0x395564[_0x8a8a('0x4d')]]){logger[_0x8a8a('0x21')](_0x8a8a('0x4e'),JSON[_0x8a8a('0x3a')](_0x395564[_0x8a8a('0x4d')]));this['startAcw'](_0x395564[_0x8a8a('0x4d')]);}}catch(_0x402b5f){logger['error'](_0x8a8a('0x4f'),_0x402b5f[_0x8a8a('0x34')]);}};Acw[_0x8a8a('0x19')][_0x8a8a('0x50')]=function(_0x3c2f8d){try{if(this[_0x8a8a('0x7')][_0x3c2f8d[_0x8a8a('0x2b')]]&&this[_0x8a8a('0x7')][_0x3c2f8d[_0x8a8a('0x2b')]][_0x8a8a('0x51')]==='all'){if(this[_0x8a8a('0x8')][_0x3c2f8d[_0x8a8a('0x1a')]]){logger['info'](_0x8a8a('0x52'),_0x3c2f8d[_0x8a8a('0x35')],_0x3c2f8d[_0x8a8a('0x1a')],_0x3c2f8d[_0x8a8a('0x2b')]);return RpcUser[_0x8a8a('0x25')](this['agents'][_0x3c2f8d[_0x8a8a('0x1a')]],_0x8a8a('0x53'),_0x3c2f8d[_0x8a8a('0x35')]);}}}catch(_0x2984eb){logger[_0x8a8a('0x31')](_0x8a8a('0x54'),_0x2984eb[_0x8a8a('0x34')]);}};module['exports']=Acw; \ No newline at end of file +var _0x3e74=['acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','message','attended','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','exports','util','moment','../ami','../../../config/logger','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','agentringnoanswer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer'];(function(_0x1b92a6,_0x14444b){var _0x24be5b=function(_0x3a5fb5){while(--_0x3a5fb5){_0x1b92a6['push'](_0x1b92a6['shift']());}};_0x24be5b(++_0x14444b);}(_0x3e74,0x175));var _0x43e7=function(_0x45e8c5,_0x79f783){_0x45e8c5=_0x45e8c5-0x0;var _0x152039=_0x3e74[_0x45e8c5];return _0x152039;};'use strict';var util=require(_0x43e7('0x0'));var _=require('lodash');var moment=require(_0x43e7('0x1'));var ami=require(_0x43e7('0x2'));var logger=require(_0x43e7('0x3'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x43e7('0x4'));function Acw(_0x4f9bbe){this[_0x43e7('0x5')]=_0x4f9bbe[_0x43e7('0x5')];this[_0x43e7('0x6')]=_0x4f9bbe[_0x43e7('0x6')];this[_0x43e7('0x7')]=_0x4f9bbe['timers'];this[_0x43e7('0x8')]={};ami['on'](_0x43e7('0x9'),this[_0x43e7('0xa')][_0x43e7('0xb')](this));ami['on'](_0x43e7('0xc'),this['syncHangupRequest'][_0x43e7('0xb')](this));ami['on']('hangup',this['syncHangup'][_0x43e7('0xb')](this));ami['on'](_0x43e7('0xd'),this['syncAgentRingNoAnswer'][_0x43e7('0xb')](this));ami['on']('attendedtransfer',this[_0x43e7('0xe')][_0x43e7('0xb')](this));ami['on']('blindtransfer',this[_0x43e7('0xf')][_0x43e7('0xb')](this));ami['on'](_0x43e7('0x10'),this[_0x43e7('0x11')]['bind'](this));}function getDiff(_0x583d85){var _0x2fcb36=moment()[_0x43e7('0x12')](0x0);var _0x44b0bd=moment(_0x583d85)['milliseconds'](0x0);return _0x2fcb36['diff'](_0x44b0bd,_0x43e7('0x13'));}Acw[_0x43e7('0x14')][_0x43e7('0x15')]=function(_0x328445){try{var _0x4de324=this;var _0x5c4eaa=this[_0x43e7('0x8')][_0x328445][_0x43e7('0x16')];var _0x273a32=this['channels'][_0x328445]['queue'];var _0x446986=this[_0x43e7('0x5')][_0x273a32];var _0x9037d3=![];var _0x140657=_0x43e7('0x17');if(_0x446986[_0x43e7('0x18')]){if(_0x446986[_0x43e7('0x19')][_0x43e7('0x1a')]){_0x9037d3=!![];_0x140657=_0x446986[_0x43e7('0x19')][_0x43e7('0x1a')];}}ami[_0x43e7('0x1b')]({'action':_0x43e7('0x1c'),'interface':_0x5c4eaa,'paused':!![],'reason':_0x140657})['then'](function(_0xef1a5a){if(_0x4de324[_0x43e7('0x6')][_0x5c4eaa]){return RpcUser['getAgent'](_0x4de324[_0x43e7('0x6')][_0x5c4eaa]['id'])[_0x43e7('0x1d')](function(_0x3945bb){if(_0x3945bb&&!_0x3945bb[_0x43e7('0x1e')]){logger[_0x43e7('0x1f')](_0x43e7('0x20'),_0x328445,_0x5c4eaa,_0x273a32);var _0x54a9e7=_0x4de324[_0x43e7('0x8')][_0x328445]['attended']&&_0x4de324['channels'][_0x328445][_0x43e7('0x21')]?_0x4de324[_0x43e7('0x8')][_0x328445]['destlinkedid']:_0x328445;return RpcUser[_0x43e7('0x22')](_0x4de324['agents'][_0x5c4eaa],_0x140657,_0x54a9e7)[_0x43e7('0x1d')](function(_0x5c5e67){if(!_0x9037d3){_0x4de324[_0x43e7('0x7')][_0x5c4eaa]={};logger[_0x43e7('0x1f')](_0x43e7('0x23'),_0x328445,_0x4de324[_0x43e7('0x5')][_0x273a32]['acwTimeout'],_0x5c4eaa,_0x273a32);_0x4de324['timers'][_0x5c4eaa][_0x43e7('0x24')]=setTimeout(_0x4de324['stopAcw'][_0x43e7('0xb')](_0x4de324,_0x5c4eaa),_0x4de324[_0x43e7('0x5')][_0x273a32][_0x43e7('0x25')]*0x3e8);_0x4de324[_0x43e7('0x7')][_0x5c4eaa]['lastPauseAt']=moment()[_0x43e7('0x26')](_0x43e7('0x27'));_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x28')]=_0x328445;_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x29')]=_0x273a32;_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x2a')]=function(){var _0x3bf475=getDiff(_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x2b')]);clearTimeout(_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x24')]);_0x4de324[_0x43e7('0x7')][_0x5c4eaa]['timer']=![];RpcVoiceAgentReport[_0x43e7('0x2c')]({'acwtime':_0x3bf475},_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x28')],_0x5c4eaa)[_0x43e7('0x1d')](function(_0x4251c8){logger['info'](_0x43e7('0x2d'),_0x328445,_0x3bf475,_0x4251c8);})[_0x43e7('0x2e')](function(_0x30d47e){logger[_0x43e7('0x2f')]('[%s][UPDATE][ERRORS:%s]',_0x328445,_0x30d47e);});delete _0x4de324['timers'][_0x5c4eaa];};}});}else{logger['info'](_0x43e7('0x30'),_0x328445,_0x5c4eaa,_0x273a32);}});}})[_0x43e7('0x2e')](function(_0x117c07){logger[_0x43e7('0x2f')](_0x43e7('0x23'),_0x328445,_0x4de324[_0x43e7('0x5')][_0x273a32]['acwTimeout'],_0x5c4eaa,_0x273a32);})['finally'](function(){delete _0x4de324['channels'][_0x328445];});}catch(_0x59e5b2){logger['error']('[ACW][START]\x20%s',_0x59e5b2['message']);}};Acw[_0x43e7('0x14')]['stopAcw']=function(_0x2b4bfd){try{var _0x8e9f40=this;if(_0x8e9f40[_0x43e7('0x7')][_0x2b4bfd]){_0x8e9f40[_0x43e7('0x7')][_0x2b4bfd][_0x43e7('0x24')]=![];var _0x449803=_0x8e9f40[_0x43e7('0x7')][_0x2b4bfd]['uniqueid'];var _0x5332d9=_0x8e9f40['timers'][_0x2b4bfd][_0x43e7('0x29')];var _0xfe70e9=_0x8e9f40[_0x43e7('0x5')][_0x5332d9][_0x43e7('0x25')];logger[_0x43e7('0x1f')](_0x43e7('0x31'),_0x2b4bfd);RpcUser[_0x43e7('0x32')](this[_0x43e7('0x6')][_0x2b4bfd]);RpcVoiceAgentReport['update']({'acwtime':_0xfe70e9,'agentacw':!![]},_0x449803,_0x2b4bfd)[_0x43e7('0x1d')](function(_0x2b0ffe){logger['info'](_0x43e7('0x2d'),_0x449803,_0xfe70e9,_0x2b0ffe);})['catch'](function(_0x44d8e4){logger[_0x43e7('0x2f')](_0x43e7('0x33'),_0x449803,_0x44d8e4);});}else{logger[_0x43e7('0x2f')](_0x43e7('0x34'),_0x2b4bfd);if(_0x8e9f40[_0x43e7('0x7')]){logger['info']('[ACW][TIMERS]',JSON[_0x43e7('0x35')](_0x8e9f40[_0x43e7('0x7')]));}}}catch(_0x44b6ae){logger[_0x43e7('0x2f')](_0x43e7('0x36'),_0x44b6ae['message']);}};Acw[_0x43e7('0x14')][_0x43e7('0xa')]=function(_0x575439){try{if(this[_0x43e7('0x5')][_0x575439['queue']]&&(this[_0x43e7('0x5')][_0x575439['queue']][_0x43e7('0x37')]||this[_0x43e7('0x5')][_0x575439[_0x43e7('0x29')]][_0x43e7('0x18')])){if(this['agents'][_0x575439['interface']]){this[_0x43e7('0x8')][_0x575439[_0x43e7('0x28')]]={'queue':_0x575439[_0x43e7('0x29')],'interface':_0x575439[_0x43e7('0x16')],'destlinkedid':_0x575439['destlinkedid']};}}}catch(_0x583047){logger['error'](_0x43e7('0x38'),_0x583047['message']);}};Acw[_0x43e7('0x14')]['syncAgentConnectPreview']=function(_0x5b28db){try{if(this[_0x43e7('0x5')][_0x5b28db['queue']]&&(this[_0x43e7('0x5')][_0x5b28db[_0x43e7('0x29')]][_0x43e7('0x37')]||this[_0x43e7('0x5')][_0x5b28db['queue']][_0x43e7('0x18')])){if(this[_0x43e7('0x6')][_0x5b28db[_0x43e7('0x16')]]){this[_0x43e7('0x8')][_0x5b28db[_0x43e7('0x28')]]={'queue':_0x5b28db[_0x43e7('0x29')],'interface':_0x5b28db['interface']};}}}catch(_0x4930a2){logger[_0x43e7('0x2f')](_0x43e7('0x39'),_0x4930a2[_0x43e7('0x3a')]);}};Acw['prototype']['syncHangupRequest']=function(_0x56489b){try{if(this[_0x43e7('0x8')][_0x56489b[_0x43e7('0x28')]]&&_['isUndefined'](this[_0x43e7('0x8')][_0x56489b[_0x43e7('0x28')]][_0x43e7('0x3b')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x56489b['uniqueid']);this['startAcw'](_0x56489b[_0x43e7('0x28')]);}else if(this[_0x43e7('0x8')][_0x56489b['linkedid']]&&_[_0x43e7('0x3c')](this[_0x43e7('0x8')][_0x56489b[_0x43e7('0x3d')]][_0x43e7('0x3b')])){logger['info'](_0x43e7('0x3e'),_0x56489b['linkedid']);this['startAcw'](_0x56489b[_0x43e7('0x3d')]);}}catch(_0x12f9ba){logger[_0x43e7('0x2f')](_0x43e7('0x3f'),_0x12f9ba[_0x43e7('0x3a')]);}};Acw[_0x43e7('0x14')][_0x43e7('0x40')]=function(_0x256ddd){try{if(this[_0x43e7('0x8')][_0x256ddd[_0x43e7('0x28')]]&&this['channels'][_0x256ddd[_0x43e7('0x28')]][_0x43e7('0x3b')]){logger['info'](_0x43e7('0x41'),_0x256ddd['uniqueid']);this[_0x43e7('0x15')](_0x256ddd[_0x43e7('0x28')]);}else if(this[_0x43e7('0x8')][_0x256ddd[_0x43e7('0x3d')]]&&this[_0x43e7('0x8')][_0x256ddd['linkedid']]['attended']){logger[_0x43e7('0x1f')](_0x43e7('0x42'),_0x256ddd[_0x43e7('0x3d')]);this[_0x43e7('0x15')](_0x256ddd[_0x43e7('0x3d')]);}}catch(_0x25bb44){logger[_0x43e7('0x2f')](_0x43e7('0x43'),_0x25bb44[_0x43e7('0x3a')]);}};Acw[_0x43e7('0x14')][_0x43e7('0xe')]=function(_0x4ace49){try{if(!_[_0x43e7('0x44')](this[_0x43e7('0x8')][_0x4ace49['transfereeuniqueid']])){this[_0x43e7('0x15')](_0x4ace49[_0x43e7('0x45')]);if(this[_0x43e7('0x8')][_0x4ace49['secondtransfereruniqueid']]){this['channels'][_0x4ace49[_0x43e7('0x46')]][_0x43e7('0x3b')]=!![];this['channels'][_0x4ace49[_0x43e7('0x47')]]=this['channels'][_0x4ace49['secondtransfereruniqueid']];delete this[_0x43e7('0x8')][_0x4ace49[_0x43e7('0x46')]];}}else if(!_[_0x43e7('0x44')](this[_0x43e7('0x8')][_0x4ace49[_0x43e7('0x47')]])){this['startAcw'](_0x4ace49[_0x43e7('0x47')]);if(this[_0x43e7('0x8')][_0x4ace49['origtransfereruniqueid']]){this[_0x43e7('0x8')][_0x4ace49[_0x43e7('0x48')]][_0x43e7('0x3b')]=!![];this['channels'][_0x4ace49['transfereeuniqueid']]=this['channels'][_0x4ace49[_0x43e7('0x48')]];delete this[_0x43e7('0x8')][_0x4ace49[_0x43e7('0x48')]];}}}catch(_0x3a6404){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x3a6404[_0x43e7('0x3a')]);}};Acw[_0x43e7('0x14')][_0x43e7('0xf')]=function(_0x5dd349){try{if(this['channels'][_0x5dd349[_0x43e7('0x49')]]){logger[_0x43e7('0x1f')](_0x43e7('0x4a'),JSON[_0x43e7('0x35')](_0x5dd349[_0x43e7('0x49')]));this[_0x43e7('0x15')](_0x5dd349[_0x43e7('0x49')]);}else if(this[_0x43e7('0x8')][_0x5dd349[_0x43e7('0x4b')]]){logger[_0x43e7('0x1f')](_0x43e7('0x4c'),JSON['stringify'](_0x5dd349['transfererlinkedid']));this[_0x43e7('0x15')](_0x5dd349['transfererlinkedid']);}}catch(_0x501616){logger['error'](_0x43e7('0x4d'),_0x501616[_0x43e7('0x3a')]);}};Acw['prototype'][_0x43e7('0x4e')]=function(_0x135791){try{if(this[_0x43e7('0x5')][_0x135791['queue']]&&this[_0x43e7('0x5')][_0x135791[_0x43e7('0x29')]][_0x43e7('0x4f')]===_0x43e7('0x50')){if(this[_0x43e7('0x6')][_0x135791[_0x43e7('0x16')]]){logger[_0x43e7('0x1f')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x135791[_0x43e7('0x28')],_0x135791[_0x43e7('0x16')],_0x135791[_0x43e7('0x29')]);return RpcUser['savePause'](this['agents'][_0x135791[_0x43e7('0x16')]],'Auto-Pause',_0x135791['uniqueid']);}}}catch(_0x1b793d){logger[_0x43e7('0x2f')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x1b793d[_0x43e7('0x3a')]);}};module[_0x43e7('0x51')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 9905582..3bdc48b 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 _0x9afa=['lodash','../../config/logger','ami','../../config/environment','asterisk','port','password','keepConnected','Action','promisify','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','error','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','username','once','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','resolve','then','catch','log','exports','asterisk-manager','bluebird','moment'];(function(_0x1ef4c5,_0x720fa9){var _0x253734=function(_0x36c51e){while(--_0x36c51e){_0x1ef4c5['push'](_0x1ef4c5['shift']());}};_0x253734(++_0x720fa9);}(_0x9afa,0x75));var _0xa9af=function(_0x150dd9,_0x2fe9ee){_0x150dd9=_0x150dd9-0x0;var _0x2ec9a1=_0x9afa[_0x150dd9];return _0x2ec9a1;};'use strict';var Manager=require(_0xa9af('0x0'));var BPromise=require(_0xa9af('0x1'));var moment=require(_0xa9af('0x2'));var util=require('util');var _=require(_0xa9af('0x3'));var logger=require(_0xa9af('0x4'))(_0xa9af('0x5'));var config=require(_0xa9af('0x6'));var ami=new Manager(config[_0xa9af('0x7')][_0xa9af('0x8')],config['asterisk']['ip'],config['asterisk']['username'],config[_0xa9af('0x7')][_0xa9af('0x9')],!![]);ami[_0xa9af('0xa')]();ami[_0xa9af('0xb')]=BPromise[_0xa9af('0xc')](ami[_0xa9af('0xd')]);function error(_0xdfe154){logger['error'](util[_0xa9af('0xe')](_0xa9af('0xf'),config[_0xa9af('0x7')]['username'],config[_0xa9af('0x7')]['ip'],config[_0xa9af('0x7')]['port'],util[_0xa9af('0x10')](_0xdfe154,![],null)));}function close(){logger[_0xa9af('0x11')](util[_0xa9af('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xa9af('0x7')]['username'],config[_0xa9af('0x7')]['ip'],config[_0xa9af('0x7')][_0xa9af('0x8')]));}ami[_0xa9af('0x12')]=function(){return function(){return ami[_0xa9af('0xb')]({'action':'sipshowregistry'});};};ami[_0xa9af('0x13')]=function(){return function(){return ami[_0xa9af('0xb')]({'action':'devicestatelist'});};};ami[_0xa9af('0x14')]=function(){return function(){return ami['Action']({'action':_0xa9af('0x15')});};};ami[_0xa9af('0x16')]=function(){return function(){return ami[_0xa9af('0xb')]({'action':_0xa9af('0x17')});};};ami[_0xa9af('0x18')]=function(){return function(){return ami[_0xa9af('0xb')]({'action':_0xa9af('0x19')});};};function connect(_0x3e3301){logger[_0xa9af('0x1a')](util[_0xa9af('0xe')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xa9af('0x7')][_0xa9af('0x1b')],config[_0xa9af('0x7')]['ip'],config[_0xa9af('0x7')][_0xa9af('0x8')]));ami[_0xa9af('0x1c')](_0xa9af('0x11'),error);ami[_0xa9af('0x1c')](_0xa9af('0x1d'),close);}ami['on'](_0xa9af('0x1e'),connect);ami['on'](_0xa9af('0x1f'),function(_0x24d270){logger[_0xa9af('0x1a')](util[_0xa9af('0xe')](_0xa9af('0x20'),config[_0xa9af('0x7')][_0xa9af('0x1b')],config[_0xa9af('0x7')]['ip'],config[_0xa9af('0x7')][_0xa9af('0x8')],util[_0xa9af('0x10')](_0x24d270,![],null)));});ami['on'](_0xa9af('0x21'),function(_0x477753){logger[_0xa9af('0x1a')](util['format'](_0xa9af('0x22'),config[_0xa9af('0x7')]['username'],config[_0xa9af('0x7')]['ip'],config[_0xa9af('0x7')][_0xa9af('0x8')]));return BPromise[_0xa9af('0x23')]()['then'](ami['actionSipShowRegistry']())[_0xa9af('0x24')](ami[_0xa9af('0x13')]())[_0xa9af('0x24')](ami[_0xa9af('0x14')]())[_0xa9af('0x24')](ami['actionQueueSummary']())[_0xa9af('0x24')](ami[_0xa9af('0x18')]())[_0xa9af('0x25')](function(_0x49e0d3){console[_0xa9af('0x26')](_0x49e0d3);});});ami['once'](_0xa9af('0x11'),error);ami[_0xa9af('0x1c')](_0xa9af('0x1d'),close);module[_0xa9af('0x27')]=ami; \ No newline at end of file +var _0x7f76=['inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','asterisk-manager','bluebird','util','lodash','../../config/logger','ami','../../config/environment','asterisk','username','password','Action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s'];(function(_0x47137a,_0x5322a7){var _0x573b0a=function(_0x59b375){while(--_0x59b375){_0x47137a['push'](_0x47137a['shift']());}};_0x573b0a(++_0x5322a7);}(_0x7f76,0x74));var _0x67f7=function(_0x579192,_0x5f3f13){_0x579192=_0x579192-0x0;var _0x2c445e=_0x7f76[_0x579192];return _0x2c445e;};'use strict';var Manager=require(_0x67f7('0x0'));var BPromise=require(_0x67f7('0x1'));var moment=require('moment');var util=require(_0x67f7('0x2'));var _=require(_0x67f7('0x3'));var logger=require(_0x67f7('0x4'))(_0x67f7('0x5'));var config=require(_0x67f7('0x6'));var ami=new Manager(config[_0x67f7('0x7')]['port'],config[_0x67f7('0x7')]['ip'],config[_0x67f7('0x7')][_0x67f7('0x8')],config[_0x67f7('0x7')][_0x67f7('0x9')],!![]);ami['keepConnected']();ami[_0x67f7('0xa')]=BPromise['promisify'](ami['action']);function error(_0x30e92f){logger[_0x67f7('0xb')](util[_0x67f7('0xc')](_0x67f7('0xd'),config[_0x67f7('0x7')][_0x67f7('0x8')],config[_0x67f7('0x7')]['ip'],config[_0x67f7('0x7')]['port'],util['inspect'](_0x30e92f,![],null)));}function close(){logger['error'](util[_0x67f7('0xc')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x67f7('0x7')]['username'],config['asterisk']['ip'],config['asterisk'][_0x67f7('0xe')]));}ami[_0x67f7('0xf')]=function(){return function(){return ami['Action']({'action':_0x67f7('0x10')});};};ami[_0x67f7('0x11')]=function(){return function(){return ami[_0x67f7('0xa')]({'action':_0x67f7('0x12')});};};ami[_0x67f7('0x13')]=function(){return function(){return ami['Action']({'action':_0x67f7('0x14')});};};ami[_0x67f7('0x15')]=function(){return function(){return ami['Action']({'action':_0x67f7('0x16')});};};ami[_0x67f7('0x17')]=function(){return function(){return ami['Action']({'action':_0x67f7('0x18')});};};function connect(_0x5ed9e0){logger[_0x67f7('0x19')](util[_0x67f7('0xc')](_0x67f7('0x1a'),config[_0x67f7('0x7')][_0x67f7('0x8')],config[_0x67f7('0x7')]['ip'],config['asterisk']['port']));ami[_0x67f7('0x1b')](_0x67f7('0xb'),error);ami[_0x67f7('0x1b')](_0x67f7('0x1c'),close);}ami['on'](_0x67f7('0x1d'),connect);ami['on'](_0x67f7('0x1e'),function(_0x9495fe){logger[_0x67f7('0x19')](util[_0x67f7('0xc')](_0x67f7('0x1f'),config[_0x67f7('0x7')]['username'],config[_0x67f7('0x7')]['ip'],config[_0x67f7('0x7')][_0x67f7('0xe')],util[_0x67f7('0x20')](_0x9495fe,![],null)));});ami['on'](_0x67f7('0x21'),function(_0x5d4ebc){logger[_0x67f7('0x19')](util[_0x67f7('0xc')](_0x67f7('0x22'),config[_0x67f7('0x7')]['username'],config[_0x67f7('0x7')]['ip'],config[_0x67f7('0x7')][_0x67f7('0xe')]));return BPromise[_0x67f7('0x23')]()['then'](ami[_0x67f7('0xf')]())[_0x67f7('0x24')](ami[_0x67f7('0x11')]())[_0x67f7('0x24')](ami['actionSipPeerStatus']())[_0x67f7('0x24')](ami[_0x67f7('0x15')]())[_0x67f7('0x24')](ami[_0x67f7('0x17')]())['catch'](function(_0xb56b57){console['log'](_0xb56b57);});});ami[_0x67f7('0x1b')](_0x67f7('0xb'),error);ami[_0x67f7('0x1b')]('close',close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 01c4e85..65a4c62 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 _0x007a=['../../config/logger','ami','client','http','then','debug','memberReport','error','rpc','message','result','catch','exports','jayson/promise'];(function(_0x55164c,_0x45bf65){var _0xf5c283=function(_0x2b9223){while(--_0x2b9223){_0x55164c['push'](_0x55164c['shift']());}};_0xf5c283(++_0x45bf65);}(_0x007a,0x195));var _0xa007=function(_0x1e1f4a,_0x15d8c7){_0x1e1f4a=_0x1e1f4a-0x0;var _0x2221c8=_0x007a[_0x1e1f4a];return _0x2221c8;};'use strict';var jayson=require(_0xa007('0x0'));var BPromise=require('bluebird');var logger=require(_0xa007('0x1'))(_0xa007('0x2'));var client=jayson[_0xa007('0x3')][_0xa007('0x4')]({'port':0x2329});client['Request']=function(_0x2a1b68,_0x432250){return new BPromise(function(_0x4ff8cd,_0x213f26){return client['request'](_0x2a1b68,_0x432250)[_0xa007('0x5')](function(_0x2e1f89){logger[_0xa007('0x6')]('rpc',_0xa007('0x7'),_0x2a1b68,_0x432250,_0x2e1f89);if(_0x2e1f89[_0xa007('0x8')]){logger[_0xa007('0x8')](_0xa007('0x9'),_0xa007('0x7'),_0x2a1b68,_0x2e1f89[_0xa007('0x8')][_0xa007('0xa')],_0x432250);return _0x213f26(_0x2e1f89[_0xa007('0x8')]['message']);}else{return _0x4ff8cd(_0x2e1f89[_0xa007('0xb')]);}})[_0xa007('0xc')](function(_0x56c168){logger[_0xa007('0x8')](_0xa007('0x9'),'memberReport',_0x2a1b68,_0x56c168,_0x432250);return _0x213f26(_0x56c168);});});};module[_0xa007('0xd')]=client; \ No newline at end of file +var _0xbe23=['Request','request','then','debug','rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbe23,0x92));var _0x3be2=function(_0x9c53f4,_0x3057b8){_0x9c53f4=_0x9c53f4-0x0;var _0x3538a7=_0xbe23[_0x9c53f4];return _0x3538a7;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3be2('0x0'))(_0x3be2('0x1'));var client=jayson[_0x3be2('0x2')][_0x3be2('0x3')]({'port':0x2329});client[_0x3be2('0x4')]=function(_0x14f5d2,_0xf42aaa){return new BPromise(function(_0x3e1eb2,_0x49b406){return client[_0x3be2('0x5')](_0x14f5d2,_0xf42aaa)[_0x3be2('0x6')](function(_0x38e8b4){logger[_0x3be2('0x7')](_0x3be2('0x8'),_0x3be2('0x9'),_0x14f5d2,_0xf42aaa,_0x38e8b4);if(_0x38e8b4[_0x3be2('0xa')]){logger['error'](_0x3be2('0x8'),'memberReport',_0x14f5d2,_0x38e8b4[_0x3be2('0xa')][_0x3be2('0xb')],_0xf42aaa);return _0x49b406(_0x38e8b4[_0x3be2('0xa')][_0x3be2('0xb')]);}else{return _0x3e1eb2(_0x38e8b4[_0x3be2('0xc')]);}})[_0x3be2('0xd')](function(_0x3e74b7){logger[_0x3be2('0xa')]('rpc',_0x3be2('0x9'),_0x14f5d2,_0x3e74b7,_0xf42aaa);return _0x49b406(_0x3e74b7);});});};module[_0x3be2('0xe')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 7c3eb87..aa2719a 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 _0xad01=['dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','firstName','lastName','number','queue','active','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xad01,0x1d4));var _0x1ad0=function(_0x4bcd4c,_0x1ed32e){_0x4bcd4c=_0x4bcd4c-0x0;var _0x57ff65=_0xad01[_0x4bcd4c];return _0x57ff65;};'use strict';var util=require(_0x1ad0('0x0'));var _=require(_0x1ad0('0x1'));var moment=require(_0x1ad0('0x2'));function checkNameSurname(_0x31c784,_0x728ea3,_0xb0f4a5){var _0x3527bb='';if(!_[_0x1ad0('0x3')](_0x728ea3)&&_0x1ad0('0x4')===typeof _0x728ea3){_0x3527bb+=_0x728ea3;}if(!_[_0x1ad0('0x3')](_0xb0f4a5)&&_0x1ad0('0x4')===typeof _0xb0f4a5){_0x3527bb+='\x20'+_0xb0f4a5;}if(_0x3527bb!==''){return _0x3527bb;}return _0x31c784;}function Action(_0x27a409,_0x132409,_0xf8911){this[_0x1ad0('0x5')]=_0x27a409;this[_0x1ad0('0x6')]=_0xf8911||undefined;this[_0x1ad0('0x7')]=checkNameSurname(_0x132409['Contact'][_0x1ad0('0x8')],_0x132409[_0x1ad0('0x9')][_0x1ad0('0xa')],_0x132409[_0x1ad0('0x9')][_0x1ad0('0xb')]);this[_0x1ad0('0xc')]=_0x132409[_0x1ad0('0x9')][_0x1ad0('0x8')];this[_0x1ad0('0xd')]=_0x27a409[_0x1ad0('0x7')];this['active']=_0x132409[_0x1ad0('0xe')]||![];this[_0x1ad0('0xf')]=_0x27a409['type'];this[_0x1ad0('0x10')]=_0x27a409[_0x1ad0('0x10')]||0x3;this[_0x1ad0('0x11')]=_0x132409['scheduledat'];this[_0x1ad0('0x12')]=_0x132409[_0x1ad0('0x12')];this[_0x1ad0('0x13')]=_0x132409[_0x1ad0('0x13')];this[_0x1ad0('0x14')]=_0x132409[_0x1ad0('0x14')];this[_0x1ad0('0x15')]=_0x132409[_0x1ad0('0x15')];this['ListId']=_0x132409[_0x1ad0('0x16')];this[_0x1ad0('0x17')]=_0x132409[_0x1ad0('0x17')];this[_0x1ad0('0x18')]=_0x132409[_0x1ad0('0x18')];this[_0x1ad0('0x19')]=_0x132409['CampaignId'];this[_0x1ad0('0x1a')]=_0x132409['id'];this[_0x1ad0('0x1b')]=_0x132409['Contact']['firstName']||'';this[_0x1ad0('0x1c')]=moment()[_0x1ad0('0x1d')](_0x1ad0('0x1e'));this[_0x1ad0('0x1f')]=_0x132409[_0x1ad0('0x1f')];this[_0x1ad0('0x20')]=_0x132409[_0x1ad0('0x20')];this[_0x1ad0('0x21')]=_0x132409[_0x1ad0('0x21')];this[_0x1ad0('0x22')]=_0x132409[_0x1ad0('0x22')];this[_0x1ad0('0x23')]='';this[_0x1ad0('0x24')]='';}Action[_0x1ad0('0x25')][_0x1ad0('0x26')]=function(){return util[_0x1ad0('0x1d')](_0x1ad0('0x27'),this[_0x1ad0('0x7')],this[_0x1ad0('0x5')][_0x1ad0('0x28')]>0x0?this[_0x1ad0('0xc')][_0x1ad0('0x29')](this[_0x1ad0('0x5')][_0x1ad0('0x28')]):this['number']);};Action[_0x1ad0('0x25')][_0x1ad0('0x2a')]=function(){return this[_0x1ad0('0xd')];};module[_0x1ad0('0x2b')]=Action; \ No newline at end of file +var _0xc2e5=['callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','substring','exports','lodash','moment','isNil','string','uniqueid','name','Contact','phone','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','ContactFirstName','format','callback','callbackuniqueid'];(function(_0x272dca,_0x37289b){var _0x2f3583=function(_0x1c1438){while(--_0x1c1438){_0x272dca['push'](_0x272dca['shift']());}};_0x2f3583(++_0x37289b);}(_0xc2e5,0x6f));var _0x5c2e=function(_0x3d34f0,_0x4a5dc0){_0x3d34f0=_0x3d34f0-0x0;var _0x135ecd=_0xc2e5[_0x3d34f0];return _0x135ecd;};'use strict';var util=require('util');var _=require(_0x5c2e('0x0'));var moment=require(_0x5c2e('0x1'));function checkNameSurname(_0x1530c4,_0x4439fa,_0x1ecbf0){var _0x379955='';if(!_[_0x5c2e('0x2')](_0x4439fa)&&'string'===typeof _0x4439fa){_0x379955+=_0x4439fa;}if(!_[_0x5c2e('0x2')](_0x1ecbf0)&&_0x5c2e('0x3')===typeof _0x1ecbf0){_0x379955+='\x20'+_0x1ecbf0;}if(_0x379955!==''){return _0x379955;}return _0x1530c4;}function Action(_0x28598b,_0x599061,_0x42f424){this['voiceQueue']=_0x28598b;this[_0x5c2e('0x4')]=_0x42f424||undefined;this[_0x5c2e('0x5')]=checkNameSurname(_0x599061[_0x5c2e('0x6')][_0x5c2e('0x7')],_0x599061[_0x5c2e('0x6')]['firstName'],_0x599061[_0x5c2e('0x6')][_0x5c2e('0x8')]);this[_0x5c2e('0x9')]=_0x599061[_0x5c2e('0x6')][_0x5c2e('0x7')];this[_0x5c2e('0xa')]=_0x28598b['name'];this[_0x5c2e('0xb')]=_0x599061[_0x5c2e('0xb')]||![];this[_0x5c2e('0xc')]=_0x28598b[_0x5c2e('0xc')];this[_0x5c2e('0xd')]=_0x28598b[_0x5c2e('0xd')]||0x3;this['scheduledat']=_0x599061[_0x5c2e('0xe')];this['countbusyretry']=_0x599061['countbusyretry'];this[_0x5c2e('0xf')]=_0x599061[_0x5c2e('0xf')];this[_0x5c2e('0x10')]=_0x599061[_0x5c2e('0x10')];this[_0x5c2e('0x11')]=_0x599061[_0x5c2e('0x11')];this[_0x5c2e('0x12')]=_0x599061[_0x5c2e('0x12')];this[_0x5c2e('0x13')]=_0x599061[_0x5c2e('0x13')];this[_0x5c2e('0x14')]=_0x599061[_0x5c2e('0x14')];this['CampaignId']=_0x599061['CampaignId'];this['idHopper']=_0x599061['id'];this[_0x5c2e('0x15')]=_0x599061[_0x5c2e('0x6')]['firstName']||'';this['starttime']=moment()[_0x5c2e('0x16')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5c2e('0x17')]=_0x599061['callback'];this[_0x5c2e('0x18')]=_0x599061['callbackuniqueid'];this[_0x5c2e('0x19')]=_0x599061['callbackat'];this[_0x5c2e('0x1a')]=_0x599061[_0x5c2e('0x1a')];this['originatecalleridnum']='';this[_0x5c2e('0x1b')]='';}Action[_0x5c2e('0x1c')][_0x5c2e('0x1d')]=function(){return util[_0x5c2e('0x16')](_0x5c2e('0x1e'),this[_0x5c2e('0x5')],this[_0x5c2e('0x1f')]['dialCutDigit']>0x0?this[_0x5c2e('0x9')][_0x5c2e('0x20')](this[_0x5c2e('0x1f')]['dialCutDigit']):this[_0x5c2e('0x9')]);};Action['prototype']['getQueue']=function(){return this[_0x5c2e('0xa')];};module[_0x5c2e('0x21')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 8b937c0..e9fb4ba 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 _0x86ee=['statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','seconds','state'];(function(_0x12c129,_0x2062e6){var _0x2266f0=function(_0x47eb07){while(--_0x47eb07){_0x12c129['push'](_0x12c129['shift']());}};_0x2266f0(++_0x2062e6);}(_0x86ee,0x19c));var _0xe86e=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0x86ee[_0x4c0622];return _0x1799d8;};'use strict';var util=require(_0xe86e('0x0'));var _=require(_0xe86e('0x1'));var moment=require(_0xe86e('0x2'));function getSeconds(_0x1af8f9,_0x1314a4){var _0x14eb71=moment(_0x1af8f9)[_0xe86e('0x3')](0x0);var _0x5c3560=moment(_0x1314a4)[_0xe86e('0x3')](0x0);return _0x14eb71['diff'](_0x5c3560,_0xe86e('0x4'));}function AgentComplete(_0x48ea1e,_0x4929bb){this[_0xe86e('0x5')]=0x4;this[_0xe86e('0x6')]=_0xe86e('0x7');this['scheduledat']=_0x48ea1e[_0xe86e('0x8')];this[_0xe86e('0x9')]=_0x48ea1e[_0xe86e('0x9')];this[_0xe86e('0xa')]=_0x48ea1e[_0xe86e('0x9')]==='outbound'?_0xe86e('0xb'):_0x48ea1e[_0xe86e('0x9')];this[_0xe86e('0xc')]=_0x48ea1e[_0xe86e('0xc')];this['countcongestionretry']=_0x48ea1e[_0xe86e('0xd')];this[_0xe86e('0xe')]=_0x48ea1e['countnoanswerretry'];this[_0xe86e('0xf')]=_0x48ea1e[_0xe86e('0xc')]+_0x48ea1e[_0xe86e('0xd')]+_0x48ea1e['countnoanswerretry'];this[_0xe86e('0x10')]=_0x4929bb[_0xe86e('0x10')];this[_0xe86e('0x11')]=_0x48ea1e[_0xe86e('0x12')];this['calleridnum']=_0x48ea1e['number'];this[_0xe86e('0x13')]=_0x48ea1e[_0xe86e('0x13')];this[_0xe86e('0x14')]=_0x48ea1e[_0xe86e('0x14')];this['answertime']=_0x48ea1e[_0xe86e('0x15')];this[_0xe86e('0x16')]=moment()['format'](_0xe86e('0x17'));this[_0xe86e('0x18')]=getSeconds(_0x48ea1e['responsetime'],_0x48ea1e['starttime']);this['holdtime']=getSeconds(_0x48ea1e[_0xe86e('0x15')],_0x48ea1e[_0xe86e('0x14')]);this[_0xe86e('0x19')]=getSeconds(this['endtime'],_0x48ea1e['answertime']);this[_0xe86e('0xb')]=_0x4929bb[_0xe86e('0xb')];this[_0xe86e('0x1a')]=_0x4929bb['membername'];this[_0xe86e('0x1b')]=_0x4929bb[_0xe86e('0x1b')];this[_0xe86e('0x1c')]=_0x48ea1e[_0xe86e('0x1c')];this[_0xe86e('0x1d')]=_0x48ea1e[_0xe86e('0x1d')];this['callbackat']=_0x48ea1e['callbackat'];this[_0xe86e('0x1e')]=_0x48ea1e[_0xe86e('0x1e')];this[_0xe86e('0x1f')]=_0x48ea1e[_0xe86e('0x1f')];this[_0xe86e('0x20')]=_0x48ea1e[_0xe86e('0x20')];this['UserId']=_0x48ea1e[_0xe86e('0x21')];this[_0xe86e('0x22')]=_0x48ea1e[_0xe86e('0x22')];this[_0xe86e('0x23')]=_0x48ea1e[_0xe86e('0x23')];this[_0xe86e('0x24')]=_0x48ea1e[_0xe86e('0x24')]||'';this[_0xe86e('0x25')]=_0x48ea1e[_0xe86e('0x25')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0xd8be=['CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','starttime','responsetime','endtime','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId'];(function(_0xe702ef,_0x2fa0a0){var _0xeaf5ef=function(_0x44929d){while(--_0x44929d){_0xe702ef['push'](_0xe702ef['shift']());}};_0xeaf5ef(++_0x2fa0a0);}(_0xd8be,0x114));var _0xed8b=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xd8be[_0x1ae5ab];return _0x1ce001;};'use strict';var util=require(_0xed8b('0x0'));var _=require(_0xed8b('0x1'));var moment=require('moment');function getSeconds(_0x13790b,_0x1acde9){var _0x49c64f=moment(_0x13790b)[_0xed8b('0x2')](0x0);var _0xca142c=moment(_0x1acde9)[_0xed8b('0x2')](0x0);return _0x49c64f[_0xed8b('0x3')](_0xca142c,'seconds');}function AgentComplete(_0x54bb21,_0x4f986b){this[_0xed8b('0x4')]=0x4;this[_0xed8b('0x5')]=_0xed8b('0x6');this['scheduledat']=_0x54bb21[_0xed8b('0x7')];this[_0xed8b('0x8')]=_0x54bb21[_0xed8b('0x8')];this[_0xed8b('0x9')]=_0x54bb21[_0xed8b('0x8')]==='outbound'?'queue':_0x54bb21['type'];this[_0xed8b('0xa')]=_0x54bb21[_0xed8b('0xa')];this[_0xed8b('0xb')]=_0x54bb21['countcongestionretry'];this[_0xed8b('0xc')]=_0x54bb21[_0xed8b('0xc')];this['countglobal']=_0x54bb21[_0xed8b('0xa')]+_0x54bb21[_0xed8b('0xb')]+_0x54bb21[_0xed8b('0xc')];this[_0xed8b('0xd')]=_0x4f986b[_0xed8b('0xd')];this['calleridname']=_0x54bb21['name'];this['calleridnum']=_0x54bb21['number'];this[_0xed8b('0xe')]=_0x54bb21[_0xed8b('0xe')];this[_0xed8b('0xf')]=_0x54bb21[_0xed8b('0xf')];this['answertime']=_0x54bb21['answertime'];this[_0xed8b('0x10')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xed8b('0x11')]=getSeconds(_0x54bb21[_0xed8b('0xf')],_0x54bb21[_0xed8b('0xe')]);this[_0xed8b('0x12')]=getSeconds(_0x54bb21['answertime'],_0x54bb21['responsetime']);this[_0xed8b('0x13')]=getSeconds(this[_0xed8b('0x10')],_0x54bb21['answertime']);this[_0xed8b('0x14')]=_0x4f986b['queue'];this[_0xed8b('0x15')]=_0x4f986b[_0xed8b('0x15')];this['reason']=_0x4f986b[_0xed8b('0x16')];this[_0xed8b('0x17')]=_0x54bb21[_0xed8b('0x17')];this[_0xed8b('0x18')]=_0x54bb21['callbackuniqueid'];this[_0xed8b('0x19')]=_0x54bb21['callbackat'];this[_0xed8b('0x1a')]=_0x54bb21[_0xed8b('0x1a')];this['ContactId']=_0x54bb21['ContactId'];this[_0xed8b('0x1b')]=_0x54bb21['ListId'];this[_0xed8b('0x1c')]=_0x54bb21[_0xed8b('0x1c')];this[_0xed8b('0x1d')]=_0x54bb21[_0xed8b('0x1d')];this[_0xed8b('0x1e')]=_0x54bb21[_0xed8b('0x1e')];this[_0xed8b('0x1f')]=_0x54bb21[_0xed8b('0x1f')]||'';this[_0xed8b('0x20')]=_0x54bb21[_0xed8b('0x20')]||'';}module[_0xed8b('0x21')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 02fbe05..83e03f9 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 _0x00f0=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridnum','starttime','responsetime','ringtime','holdtime'];(function(_0x57069c,_0x5a530b){var _0x3a4467=function(_0x2a59){while(--_0x2a59){_0x57069c['push'](_0x57069c['shift']());}};_0x3a4467(++_0x5a530b);}(_0x00f0,0xec));var _0x000f=function(_0x3a4af1,_0x9ef6e1){_0x3a4af1=_0x3a4af1-0x0;var _0x5d465b=_0x00f0[_0x3a4af1];return _0x5d465b;};'use strict';var util=require(_0x000f('0x0'));var _=require(_0x000f('0x1'));var moment=require(_0x000f('0x2'));function getSeconds(_0x10c121,_0x55b9cf){var _0x4d5c3d=moment(_0x10c121)[_0x000f('0x3')](0x0);var _0x4c8ce1=moment(_0x55b9cf)[_0x000f('0x3')](0x0);return _0x4d5c3d['diff'](_0x4c8ce1,_0x000f('0x4'));}function Final(_0x2db22b){this['uniqueid']=_0x2db22b[_0x000f('0x5')];this[_0x000f('0x6')]=_0x2db22b[_0x000f('0x6')];this[_0x000f('0x7')]=_0x2db22b[_0x000f('0x7')];this[_0x000f('0x8')]=_0x2db22b[_0x000f('0x7')]===_0x000f('0x9')?_0x000f('0xa'):_0x2db22b[_0x000f('0x7')];this[_0x000f('0xb')]=_0x2db22b['countbusyretry'];this['countcongestionretry']=_0x2db22b[_0x000f('0xc')];this[_0x000f('0xd')]=_0x2db22b['countnoanswerretry'];this[_0x000f('0xe')]=_0x2db22b[_0x000f('0xb')]+_0x2db22b['countcongestionretry']+_0x2db22b['countnoanswerretry'];this[_0x000f('0xa')]=_0x2db22b[_0x000f('0xa')];this['calleridname']=_0x2db22b['calleridname'];this[_0x000f('0xf')]=_0x2db22b[_0x000f('0xf')];this[_0x000f('0x10')]=_0x2db22b[_0x000f('0x10')];this['responsetime']=_0x2db22b[_0x000f('0x11')];this['endtime']=_0x2db22b['responsetime'];this[_0x000f('0x12')]=_0x2db22b['ringtime']||0x0;this[_0x000f('0x13')]=_0x2db22b[_0x000f('0x13')]||0x0;this[_0x000f('0x14')]=_0x2db22b[_0x000f('0x14')]||0x0;this[_0x000f('0x15')]=_0x2db22b[_0x000f('0x15')];this[_0x000f('0x16')]=_0x2db22b[_0x000f('0x16')];this[_0x000f('0x17')]=_0x2db22b[_0x000f('0x17')];this[_0x000f('0x18')]=_0x2db22b[_0x000f('0x18')];this[_0x000f('0x19')]=_0x2db22b['ContactId'];this[_0x000f('0x1a')]=_0x2db22b[_0x000f('0x1a')];this['UserId']=_0x2db22b[_0x000f('0x1b')];this['VoiceQueueId']=_0x2db22b['VoiceQueueId'];this[_0x000f('0x1c')]=_0x2db22b[_0x000f('0x1c')];this[_0x000f('0x1d')]=_0x2db22b['originatecalleridnum']||'';this['originatecalleridname']=_0x2db22b[_0x000f('0x1e')]||'';}module[_0x000f('0x1f')]=Final; \ No newline at end of file +var _0x4b11=['lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util'];(function(_0x3b7991,_0x54bd04){var _0x3941c6=function(_0x53bd0a){while(--_0x53bd0a){_0x3b7991['push'](_0x3b7991['shift']());}};_0x3941c6(++_0x54bd04);}(_0x4b11,0xf4));var _0x14b1=function(_0x5cba7d,_0x514066){_0x5cba7d=_0x5cba7d-0x0;var _0x51491e=_0x4b11[_0x5cba7d];return _0x51491e;};'use strict';var util=require(_0x14b1('0x0'));var _=require(_0x14b1('0x1'));var moment=require(_0x14b1('0x2'));function getSeconds(_0x393155,_0x522aac){var _0xcb8aa=moment(_0x393155)[_0x14b1('0x3')](0x0);var _0x13884c=moment(_0x522aac)['milliseconds'](0x0);return _0xcb8aa[_0x14b1('0x4')](_0x13884c,_0x14b1('0x5'));}function Final(_0x58fc37){this[_0x14b1('0x6')]=_0x58fc37[_0x14b1('0x6')];this[_0x14b1('0x7')]=_0x58fc37[_0x14b1('0x7')];this[_0x14b1('0x8')]=_0x58fc37[_0x14b1('0x8')];this[_0x14b1('0x9')]=_0x58fc37[_0x14b1('0x8')]===_0x14b1('0xa')?_0x14b1('0xb'):_0x58fc37[_0x14b1('0x8')];this[_0x14b1('0xc')]=_0x58fc37['countbusyretry'];this[_0x14b1('0xd')]=_0x58fc37[_0x14b1('0xd')];this['countnoanswerretry']=_0x58fc37[_0x14b1('0xe')];this[_0x14b1('0xf')]=_0x58fc37[_0x14b1('0xc')]+_0x58fc37[_0x14b1('0xd')]+_0x58fc37[_0x14b1('0xe')];this[_0x14b1('0xb')]=_0x58fc37['queue'];this[_0x14b1('0x10')]=_0x58fc37['calleridname'];this['calleridnum']=_0x58fc37[_0x14b1('0x11')];this[_0x14b1('0x12')]=_0x58fc37[_0x14b1('0x12')];this[_0x14b1('0x13')]=_0x58fc37[_0x14b1('0x13')];this[_0x14b1('0x14')]=_0x58fc37['responsetime'];this[_0x14b1('0x15')]=_0x58fc37[_0x14b1('0x15')]||0x0;this[_0x14b1('0x16')]=_0x58fc37[_0x14b1('0x16')]||0x0;this[_0x14b1('0x17')]=_0x58fc37[_0x14b1('0x17')]||0x0;this[_0x14b1('0x18')]=_0x58fc37[_0x14b1('0x18')];this['callbackuniqueid']=_0x58fc37['callbackuniqueid'];this['callbackat']=_0x58fc37[_0x14b1('0x19')];this[_0x14b1('0x1a')]=_0x58fc37[_0x14b1('0x1a')];this[_0x14b1('0x1b')]=_0x58fc37[_0x14b1('0x1b')];this[_0x14b1('0x1c')]=_0x58fc37[_0x14b1('0x1c')];this[_0x14b1('0x1d')]=_0x58fc37['UserId'];this[_0x14b1('0x1e')]=_0x58fc37['VoiceQueueId'];this[_0x14b1('0x1f')]=_0x58fc37[_0x14b1('0x1f')];this['originatecalleridnum']=_0x58fc37[_0x14b1('0x20')]||'';this[_0x14b1('0x21')]=_0x58fc37['originatecalleridname']||'';}module[_0x14b1('0x22')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 8674de5..dc84399 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x1f979a,_0x4d5772){var _0x1729de=function(_0x1b20a5){while(--_0x1b20a5){_0x1f979a['push'](_0x1f979a['shift']());}};_0x1729de(++_0x4d5772);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file +var _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(_0x192100,_0x48a4b0){var _0x2f0f58=function(_0x2a452c){while(--_0x2a452c){_0x192100['push'](_0x192100['shift']());}};_0x2f0f58(++_0x48a4b0);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 ad9400f..65a2d10 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 _0x3d4e=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x1a7f9c,_0x465c53){var _0x551e08=function(_0x2a878d){while(--_0x2a878d){_0x1a7f9c['push'](_0x1a7f9c['shift']());}};_0x551e08(++_0x465c53);}(_0x3d4e,0xa5));var _0xe3d4=function(_0x187d28,_0x23e5fb){_0x187d28=_0x187d28-0x0;var _0x39ee98=_0x3d4e[_0x187d28];return _0x39ee98;};'use strict';var util=require(_0xe3d4('0x0'));var _=require(_0xe3d4('0x1'));var moment=require('moment');function getSeconds(_0x12581e,_0x3c42d5){var _0x4c52f0=moment(_0x12581e)[_0xe3d4('0x2')](0x0);var _0x10b81c=moment(_0x3c42d5)[_0xe3d4('0x2')](0x0);return _0x4c52f0['diff'](_0x10b81c,_0xe3d4('0x3'));}function History(_0x565294){this[_0xe3d4('0x4')]=_0x565294[_0xe3d4('0x4')];this[_0xe3d4('0x5')]=_0x565294[_0xe3d4('0x5')]||undefined;this[_0xe3d4('0x6')]=_0x565294[_0xe3d4('0x6')];this[_0xe3d4('0x7')]=_0x565294[_0xe3d4('0x6')]===_0xe3d4('0x8')?_0xe3d4('0x9'):_0x565294['type'];this['countbusyretry']=_0x565294['countbusyretry'];this[_0xe3d4('0xa')]=_0x565294['countcongestionretry'];this['countnoanswerretry']=_0x565294['countnoanswerretry'];this['countglobal']=_0x565294['countbusyretry']+_0x565294[_0xe3d4('0xa')]+_0x565294[_0xe3d4('0xb')];this[_0xe3d4('0x9')]=_0x565294[_0xe3d4('0x9')];this['calleridname']=_0x565294[_0xe3d4('0xc')];this[_0xe3d4('0xd')]=_0x565294[_0xe3d4('0xe')];this[_0xe3d4('0xf')]=_0x565294['starttime'];this['responsetime']=_0x565294[_0xe3d4('0x10')];this[_0xe3d4('0x11')]=_0x565294[_0xe3d4('0x10')];this[_0xe3d4('0x12')]=getSeconds(_0x565294[_0xe3d4('0x10')],_0x565294[_0xe3d4('0xf')]);this[_0xe3d4('0x13')]=0x0;this['talktime']=0x0;this[_0xe3d4('0x14')]=_0x565294['callback'];this[_0xe3d4('0x15')]=_0x565294[_0xe3d4('0x15')];this[_0xe3d4('0x16')]=_0x565294[_0xe3d4('0x16')];this['recallme']=_0x565294[_0xe3d4('0x17')];this[_0xe3d4('0x18')]=_0x565294[_0xe3d4('0x18')];this[_0xe3d4('0x19')]=_0x565294[_0xe3d4('0x19')];this['UserId']=_0x565294[_0xe3d4('0x1a')];this[_0xe3d4('0x1b')]=_0x565294[_0xe3d4('0x1b')];this[_0xe3d4('0x1c')]=_0x565294[_0xe3d4('0x1c')];this[_0xe3d4('0x1d')]=_0x565294['originatecalleridnum']||'';this[_0xe3d4('0x1e')]=_0x565294[_0xe3d4('0x1e')]||'';}module[_0xe3d4('0x1f')]=History; \ No newline at end of file +var _0x6c94=['uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','name','calleridnum','number','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','seconds'];(function(_0x5aad36,_0x42aaec){var _0x35a270=function(_0x972469){while(--_0x972469){_0x5aad36['push'](_0x5aad36['shift']());}};_0x35a270(++_0x42aaec);}(_0x6c94,0x1cd));var _0x46c9=function(_0x6d3f38,_0x1a9713){_0x6d3f38=_0x6d3f38-0x0;var _0x3259f2=_0x6c94[_0x6d3f38];return _0x3259f2;};'use strict';var util=require('util');var _=require(_0x46c9('0x0'));var moment=require(_0x46c9('0x1'));function getSeconds(_0x1f4f3b,_0x5d316b){var _0xc1cd89=moment(_0x1f4f3b)[_0x46c9('0x2')](0x0);var _0x369195=moment(_0x5d316b)[_0x46c9('0x2')](0x0);return _0xc1cd89['diff'](_0x369195,_0x46c9('0x3'));}function History(_0x43b60e){this[_0x46c9('0x4')]=_0x43b60e['uniqueid'];this[_0x46c9('0x5')]=_0x43b60e[_0x46c9('0x5')]||undefined;this[_0x46c9('0x6')]=_0x43b60e[_0x46c9('0x6')];this['campaigntype']=_0x43b60e[_0x46c9('0x6')]==='outbound'?_0x46c9('0x7'):_0x43b60e[_0x46c9('0x6')];this['countbusyretry']=_0x43b60e[_0x46c9('0x8')];this[_0x46c9('0x9')]=_0x43b60e['countcongestionretry'];this[_0x46c9('0xa')]=_0x43b60e['countnoanswerretry'];this[_0x46c9('0xb')]=_0x43b60e[_0x46c9('0x8')]+_0x43b60e[_0x46c9('0x9')]+_0x43b60e[_0x46c9('0xa')];this['queue']=_0x43b60e[_0x46c9('0x7')];this['calleridname']=_0x43b60e[_0x46c9('0xc')];this[_0x46c9('0xd')]=_0x43b60e[_0x46c9('0xe')];this[_0x46c9('0xf')]=_0x43b60e['starttime'];this[_0x46c9('0x10')]=_0x43b60e[_0x46c9('0x10')];this[_0x46c9('0x11')]=_0x43b60e[_0x46c9('0x10')];this['ringtime']=getSeconds(_0x43b60e[_0x46c9('0x10')],_0x43b60e['starttime']);this[_0x46c9('0x12')]=0x0;this[_0x46c9('0x13')]=0x0;this[_0x46c9('0x14')]=_0x43b60e['callback'];this[_0x46c9('0x15')]=_0x43b60e[_0x46c9('0x15')];this[_0x46c9('0x16')]=_0x43b60e[_0x46c9('0x16')];this['recallme']=_0x43b60e['recallme'];this[_0x46c9('0x17')]=_0x43b60e[_0x46c9('0x17')];this['ListId']=_0x43b60e[_0x46c9('0x18')];this[_0x46c9('0x19')]=_0x43b60e[_0x46c9('0x19')];this[_0x46c9('0x1a')]=_0x43b60e[_0x46c9('0x1a')];this[_0x46c9('0x1b')]=_0x43b60e[_0x46c9('0x1b')];this[_0x46c9('0x1c')]=_0x43b60e[_0x46c9('0x1c')]||'';this[_0x46c9('0x1d')]=_0x43b60e[_0x46c9('0x1d')]||'';}module[_0x46c9('0x1e')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 92c3d60..da2fb8f 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 _0xd971=['getContactDialer','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','reachable','unmonitored','moveContactManagedDialer','syncVarSet','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','uniqueid','outboundAnswerAgiCallsDay','HangupInAMD','membername','[syncHangupInAMD]','MACHINE','Machine','AMD','amd','[syncMachine]','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','[syncMachineIvr]','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','outboundDropCallsDayTimeout','Drop','TIMEOUT','queueCallerAbandonCreateState','Abandoned','dropreason','CALLEREXIT','syncNewExten','channel','actionid','locked','paused','stateinterface','rrmemory','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','ContactId','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','iftime\x20%s,%s','interval','indexOf','content','true','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','booked','Queue','dialGlobalInterval','[syncQueueSummary]','dialTimezone','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','%s%s','XMD-','toUpper','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','TrunkBackup','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','trim','substring','from-sip','OriginateError','starttime','endtime','[originate][error]','Error','originate\x20action\x20Error','responsetime','getQueue','response','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countcongestionretry','dialGlobalMaxRetry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','callProgressDetecting','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','countnoanswerretry','reason\x200\x20no\x20such\x20number....','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','createStateFinal','reason\x203\x20ringing\x20no\x20answer','stateGlobal','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','merge','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','handleIvr','limitCalls','temp','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','Amax\x20=\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','md5','ioredis','../../../config/environment/','dialer','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','./hangup','env','127.0.0.1','roundrobin','prototype','enqueue','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','queuecallerabandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncHangup','varset','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','startProgressive','Trunk','voice:queue:%s','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','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','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','error','inspect','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','clearZombieChannels','[uniqueid]','isNil','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0xd971,0x132));var _0x1d97=function(_0xf1499b,_0x4e8f51){_0xf1499b=_0xf1499b-0x0;var _0x2c589c=_0xd971[_0xf1499b];return _0x2c589c;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require('bluebird');var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var md5=require(_0x1d97('0x0'));var Redis=require(_0x1d97('0x1'));var config=require(_0x1d97('0x2'));var logger=require('../../../config/logger')(_0x1d97('0x3'));var loggerBooked=require(_0x1d97('0x4'))('booked');var loggerPredictive=require(_0x1d97('0x4'))(_0x1d97('0x5'));var loggerPredictiveCalls=require(_0x1d97('0x4'))(_0x1d97('0x6'));var loggerSyncQueueSummary=require(_0x1d97('0x4'))(_0x1d97('0x7'));var ami=require(_0x1d97('0x8'));config['redis']=_[_0x1d97('0x9')](config[_0x1d97('0xa')],{'host':_0x1d97('0xb'),'port':0x18eb});var io=require(_0x1d97('0xc'))(new Redis(config[_0x1d97('0xa')]));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x1d97('0xd'));var cmHopperHistory=require(_0x1d97('0xe'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x1d97('0xf'));var Action=require(_0x1d97('0x10'));var History=require(_0x1d97('0x11'));var Final=require(_0x1d97('0x12'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x1d97('0x13'));var Hangup=require(_0x1d97('0x14'));var ipAgi=process[_0x1d97('0x15')]['XCALLY_IP_AGI']||_0x1d97('0x16');var strategy={'rrmemory':'rrmemory','roundrobin':_0x1d97('0x17')};var Sequence=function(){};Sequence[_0x1d97('0x18')][_0x1d97('0x19')]=function(_0x183e37){this['tail']=this['tail']?this['tail'][_0x1d97('0x1a')](_0x183e37):_0x183e37();};function Dialer(_0x1d6b74,_0x1e06a3){this[_0x1d97('0x1b')]=new Sequence();this[_0x1d97('0x1c')]=_0x1e06a3;this['voiceQueues']=_0x1d6b74[_0x1d97('0x1d')];this[_0x1d97('0x1e')]=_0x1d6b74[_0x1d97('0x1e')];this[_0x1d97('0x1f')]=_0x1d6b74[_0x1d97('0x1f')];this[_0x1d97('0x20')]=_0x1d6b74[_0x1d97('0x20')];this[_0x1d97('0x21')]=config['maxNumberOriginate']||0x2;this[_0x1d97('0x22')]={};this[_0x1d97('0x23')]={};this['contactsId']={};this[_0x1d97('0x24')]={};this[_0x1d97('0x25')]={};this[_0x1d97('0x26')]={};this['startProgressive']={};this[_0x1d97('0x27')]={};this[_0x1d97('0x28')]={};this[_0x1d97('0x29')]={};ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on'](_0x1d97('0x2a'),this['syncQueueCallerAbandon'][_0x1d97('0x2b')](this));ami['on'](_0x1d97('0x2c'),this[_0x1d97('0x2d')][_0x1d97('0x2b')](this));ami['on'](_0x1d97('0x2e'),this[_0x1d97('0x2f')]['bind'](this));ami['on'](_0x1d97('0x30'),this[_0x1d97('0x7')][_0x1d97('0x2b')](this));ami['on']('hangup',this[_0x1d97('0x31')][_0x1d97('0x2b')](this));ami['on']('newexten',this['syncNewExten']['bind'](this));ami['on'](_0x1d97('0x32'),this['syncVarSet'][_0x1d97('0x2b')](this));ami['on'](_0x1d97('0x33'),this[_0x1d97('0x34')][_0x1d97('0x2b')](this));ami['on']('queuestatuscomplete',this[_0x1d97('0x35')][_0x1d97('0x2b')](this));this[_0x1d97('0x36')]();this[_0x1d97('0x37')]();}function isNotNull(_0x38c2bf){return _0x38c2bf!==null&&!_[_0x1d97('0x38')](_0x38c2bf);}function checkIsLoggedIn(_0x2bb91a,_0x5b37ea){return function(){if(_0x5b37ea<=0x0){_0x2bb91a[_0x1d97('0x39')]=_0x1d97('0x3a');throw _0x2bb91a[_0x1d97('0x3b')]+_0x1d97('0x3c');}};}function isActive(_0x7a9324){return _0x7a9324;}function checkIsActive(_0xaf880f,_0x32d81d){return function(){if(!isActive(_0x32d81d)){_0xaf880f[_0x1d97('0x39')]=_0x1d97('0x3d');throw _0xaf880f[_0x1d97('0x3b')]+_0x1d97('0x3e');}};}function checkInterval(_0x4b789d){return function(){if(!isNotNull(_0x4b789d[_0x1d97('0x3f')])){_0x4b789d[_0x1d97('0x39')]=_0x1d97('0x40');throw _0x4b789d[_0x1d97('0x3b')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x4b789d[_0x1d97('0x3f')][_0x1d97('0x41')])){_0x4b789d['message']=_0x1d97('0x40');throw _0x4b789d['name']+_0x1d97('0x42');}if(!isNotNull(_[_0x1d97('0x43')](_0x4b789d[_0x1d97('0x3f')]['Intervals']))){_0x4b789d[_0x1d97('0x39')]=_0x1d97('0x40');throw _0x4b789d[_0x1d97('0x3b')]+_0x1d97('0x42');}};}function msgResponse(_0x20b2f1,_0x277438,_0x535b8b){return{'action':_0x20b2f1,'response':_0x277438,'message':_0x535b8b,'stack':_0x535b8b};}function myreject(_0x5b2e26){return function(_0xe9e83e){return _0x5b2e26(msgResponse(_0x1d97('0x44'),'Error',JSON[_0x1d97('0x45')](_0xe9e83e)));};}function getSeconds(_0x1cba55,_0x136c66){var _0x4e8a75=moment(_0x1cba55)[_0x1d97('0x46')](0x0);var _0x3d164b=moment(_0x136c66)[_0x1d97('0x46')](0x0);return _0x4e8a75[_0x1d97('0x47')](_0x3d164b,_0x1d97('0x48'));}function emit(_0x1c0d58,_0x19e567,_0x489c6a){io['to'](_0x1c0d58)[_0x1d97('0x49')](_0x19e567,_0x489c6a);}function emitVoiceQueueSummary(_0x4846e0){if(_0x4846e0[_0x1d97('0x4a')]===_0x1d97('0x4b')){var _0x1b2dd5={'id':_0x4846e0['id'],'name':_0x4846e0[_0x1d97('0x3b')],'strategy':_0x4846e0[_0x1d97('0x4c')],'answered':_0x4846e0[_0x1d97('0x4d')],'available':_0x4846e0[_0x1d97('0x4e')],'loggedIn':_0x4846e0[_0x1d97('0x4f')],'pTalking':_0x4846e0[_0x1d97('0x50')],'sumBillable':_0x4846e0[_0x1d97('0x51')],'sumDuration':_0x4846e0['sumDuration'],'sumHoldTime':_0x4846e0[_0x1d97('0x52')]||0x0,'talking':_0x4846e0[_0x1d97('0x53')],'total':_0x4846e0[_0x1d97('0x54')],'type':_0x4846e0[_0x1d97('0x4a')],'unmanaged':_0x4846e0['unmanaged'],'abandoned':_0x4846e0[_0x1d97('0x55')],'waiting':_0x4846e0[_0x1d97('0x56')],'loggedInDb':_0x4846e0[_0x1d97('0x57')],'dialActive':_0x4846e0[_0x1d97('0x58')],'dialMethod':_0x4846e0[_0x1d97('0x59')],'dialOriginateCallerIdName':_0x4846e0['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x4846e0[_0x1d97('0x5a')],'dialOriginateTimeout':_0x4846e0[_0x1d97('0x5b')],'dialPrefix':_0x4846e0[_0x1d97('0x5c')],'outboundAnswerAgiCallsDay':_0x4846e0['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x4846e0[_0x1d97('0x5d')],'outboundBlacklistCallsDay':_0x4846e0[_0x1d97('0x5e')],'outboundBusyCallsDay':_0x4846e0[_0x1d97('0x5f')],'outboundCongestionCallsDay':_0x4846e0[_0x1d97('0x60')],'outboundDropCallsDayACS':_0x4846e0[_0x1d97('0x61')],'outboundDropCallsDayCallersExit':_0x4846e0[_0x1d97('0x62')],'outboundDropCallsDayTimeout':_0x4846e0['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x4846e0[_0x1d97('0x63')],'outboundNoSuchCallsDay':_0x4846e0[_0x1d97('0x64')],'outboundOriginateFailureCallsDay':_0x4846e0[_0x1d97('0x65')],'outboundReCallsDay':_0x4846e0[_0x1d97('0x66')],'outboundRejectCallsDay':_0x4846e0[_0x1d97('0x67')],'outboundUnknownCallsDay':_0x4846e0[_0x1d97('0x68')],'predictiveIntervalAnsweredCalls':_0x4846e0[_0x1d97('0x69')],'predictiveIntervalAvgHoldtime':_0x4846e0[_0x1d97('0x6a')],'predictiveIntervalAvgTalktime':_0x4846e0[_0x1d97('0x6b')],'predictiveIntervalDroppedCallsCallersExit':_0x4846e0['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x4846e0[_0x1d97('0x6c')],'predictiveIntervalErlangCalls':_0x4846e0[_0x1d97('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x4846e0[_0x1d97('0x6e')],'predictiveIntervalHitRate':_0x4846e0['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x4846e0[_0x1d97('0x6f')],'predictiveIntervalPauses':_0x4846e0[_0x1d97('0x70')],'predictiveIntervalAvailable':_0x4846e0[_0x1d97('0x71')],'predictiveIntervalTotalCalls':_0x4846e0[_0x1d97('0x72')],'message':_0x4846e0[_0x1d97('0x39')],'originated':_0x4846e0[_0x1d97('0x73')],'erlangCalls':_0x4846e0[_0x1d97('0x74')],'erlangCallToSecond':_0x4846e0[_0x1d97('0x75')],'erlangAbandonmentRate':_0x4846e0['erlangAbandonmentRate'],'erlangBusyFactor':_0x4846e0['erlangBusyFactor'],'startPredictive':_0x4846e0['startPredictive'],'startProgressive':_0x4846e0[_0x1d97('0x76')]};if(_0x4846e0[_0x1d97('0x77')]){_0x1b2dd5[_0x1d97('0x77')]={'id':_0x4846e0[_0x1d97('0x77')]['id'],'name':_0x4846e0[_0x1d97('0x77')][_0x1d97('0x3b')],'active':_0x4846e0[_0x1d97('0x77')]['active'],'callerid':_0x4846e0[_0x1d97('0x77')]['callerid']};}if(_0x4846e0[_0x1d97('0x3f')]){_0x1b2dd5[_0x1d97('0x3f')]={'id':_0x4846e0['Interval']['id'],'name':_0x4846e0[_0x1d97('0x3f')][_0x1d97('0x3b')]};}var _0x3133eb=md5(JSON[_0x1d97('0x45')](_0x1b2dd5));if(_0x4846e0[_0x1d97('0x0')]!==_0x3133eb){_0x4846e0['md5']=_0x3133eb;emit(util['format'](_0x1d97('0x78'),_0x1b2dd5[_0x1d97('0x3b')]),_0x1d97('0x79'),_0x1b2dd5);}}}function emitCampaignSummary(_0x3ec1c6){if(_0x3ec1c6[_0x1d97('0x4a')]===_0x1d97('0x7a')){emit(util[_0x1d97('0x7b')](_0x1d97('0x7c'),_0x3ec1c6['name']),_0x1d97('0x7d'),_0x3ec1c6);}}function checkGetDataPredictive(_0x9fc33f){if(isNotNull(_0x9fc33f)){if(!_['isEmpty'](_0x9fc33f)){loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x7f'));loggerPredictive['info'](_0x1d97('0x80'),_0x9fc33f[_0x1d97('0x72')]);loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x81'),_0x9fc33f[_0x1d97('0x69')]);loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x82'),_0x9fc33f['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0x1d97('0x83'),_0x9fc33f[_0x1d97('0x84')]);loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x85'),_0x9fc33f[_0x1d97('0x6a')]);loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x86'),_0x9fc33f[_0x1d97('0x6b')]);loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x87'));if(_0x9fc33f[_0x1d97('0x72')]>0x0){if(!_[_0x1d97('0x38')](_0x9fc33f[_0x1d97('0x6b')])&&_0x9fc33f['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x88'));}if(!_[_0x1d97('0x38')](_0x9fc33f['predictiveIntervalAvgHoldtime'])&&_0x9fc33f[_0x1d97('0x6a')]>0x0){return!![];}else{loggerPredictive[_0x1d97('0x7e')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x89'));}}else{loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x8a'));}}else{loggerPredictive['info'](_0x1d97('0x8a'));}return![];}function mergeDataErlangB(_0x51d713){return function(_0x125a1f){loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x8b'));loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x8c'),_0x125a1f['erlangCalls']);loggerPredictive['info'](_0x1d97('0x8d'),_0x125a1f[_0x1d97('0x75')]);loggerPredictive[_0x1d97('0x7e')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x125a1f[_0x1d97('0x8e')]);loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x8f'),_0x125a1f[_0x1d97('0x90')]);loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x91'),_0x125a1f['erlangAbandonmentRate']);loggerPredictive['info'](_0x1d97('0x87'));_['merge'](_0x51d713,_0x125a1f);};}function getDiff(_0x2dcd87){var _0x10403b=moment()[_0x1d97('0x46')](0x0);var _0x453306=moment(_0x2dcd87)[_0x1d97('0x46')](0x0);return _0x10403b[_0x1d97('0x47')](_0x453306,_0x1d97('0x48'));}function ifInterval(_0x282164,_0x206550){if(_[_0x1d97('0x38')](_0x206550)){return![];}if(getDiff(_0x206550)<_0x282164*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x4f5af9){if(isNotNull(_0x4f5af9)){if(!_[_0x1d97('0x38')](_0x4f5af9[_0x1d97('0x76')])){_0x4f5af9[_0x1d97('0x76')]=undefined;loggerPredictive[_0x1d97('0x7e')](_0x4f5af9['name'],_0x1d97('0x92'));}if(!_['isUndefined'](_0x4f5af9[_0x1d97('0x26')])){_0x4f5af9[_0x1d97('0x26')]=undefined;loggerPredictive[_0x1d97('0x7e')](_0x4f5af9[_0x1d97('0x3b')],_0x1d97('0x93'));}if(!_[_0x1d97('0x38')](_0x4f5af9[_0x1d97('0x94')])){clearInterval(_0x4f5af9[_0x1d97('0x94')]);_0x4f5af9[_0x1d97('0x94')]=undefined;loggerPredictive[_0x1d97('0x7e')](_0x4f5af9[_0x1d97('0x3b')],_0x1d97('0x95'));}}}function erlangb(_0x4f48aa,_0x257730){if(_0x257730===0x0){return 0x0;}var _0x11b8fe=0x1;for(var _0x4ac6ff=0x1;_0x4ac6ff<=_0x257730;_0x4ac6ff+=0x1){_0x11b8fe=0x1+_0x11b8fe*_0x4ac6ff/_0x4f48aa;}return 0x1/_0x11b8fe;}function isVoiceQueueOutbound(_0x239d21){return _0x239d21===_0x1d97('0x4b');}function isNotPreview(_0x221627){return _0x221627!=='preview';}function isCampaignIvr(_0x286ce4){return _0x286ce4===_0x1d97('0x7a');}function getCallerId(_0x50a2cb,_0x1b4b08,_0x49b86a){if(!_[_0x1d97('0x38')](_0x49b86a)&&_0x1d97('0x96')===typeof _0x49b86a&&!_[_0x1d97('0x43')](_0x49b86a)){if(!_[_0x1d97('0x38')](_0x1b4b08)&&_0x1d97('0x96')===typeof _0x1b4b08&&!_[_0x1d97('0x43')](_0x1b4b08)){return util['format'](_0x1d97('0x97'),_0x1b4b08,_0x49b86a);}return util[_0x1d97('0x7b')](_0x1d97('0x97'),_0x49b86a,_0x49b86a);}if(!_[_0x1d97('0x38')](_0x50a2cb)&&_0x1d97('0x96')===typeof _0x50a2cb&&!_[_0x1d97('0x43')](_0x50a2cb)){return _0x50a2cb;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x28ffa1,_0x355bc9){return function(_0x5eb0b7){freeVariablesPredictive(_0x355bc9);emitVoiceQueueSummary(_0x355bc9);emitCampaignSummary(_0x355bc9);loggerSyncQueueSummary[_0x1d97('0x98')](_0x28ffa1,util[_0x1d97('0x99')](_0x5eb0b7,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5e30cb,_0x505fd2){return function(_0x257241){loggerPredictive[_0x1d97('0x98')](_0x505fd2[_0x1d97('0x3b')],_0x5e30cb);loggerPredictive['error'](_0x257241['stack']);freeVariablesPredictive(_0x505fd2);};}function loggerCatch(_0x5dfa55){return function(_0x484dfa){logger[_0x1d97('0x98')](_0x5dfa55,util[_0x1d97('0x99')](_0x484dfa,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3b267f){return _0x3b267f&&!_['isUndefined'](_0x3b267f)&&_0x3b267f[_0x1d97('0x9a')]>0x0;}function decremetOriginate(_0x113454){if(!_[_0x1d97('0x38')](_0x113454)&&_0x113454!==null){if(_0x113454[_0x1d97('0x9b')]('originated')){if(_0x113454['originated']>0x0){_0x113454['originated']-=0x1;}else{logger['error'](_0x1d97('0x9c'));}}}else{logger[_0x1d97('0x98')](_0x1d97('0x9d'));}}function checkContactLowerLimitOriginate(_0x2a6d3b,_0x4ff846,_0x48003a){if(_0x4ff846>_0x48003a){for(var _0xb1a23d=0x0;_0xb1a23d<_0x4ff846-_0x48003a;_0xb1a23d+=0x1){decremetOriginate(_0x2a6d3b);}}}function loggerGetContactDialer(_0x43b45f,_0x274282,_0x2ee65b){return function(_0x11374e){checkContactLowerLimitOriginate(_0x274282,_0x2ee65b,0x0);logger['error'](_0x43b45f,util['inspect'](_0x11374e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x287189){return function(_0x27fc7d){if(isNotNull(_0x27fc7d)&&isNotNull(_0x27fc7d[0x0])){if(_0x27fc7d[0x0]['contactsRescheduled']>0x0){_0x287189['message']=_0x1d97('0x9e');logger[_0x1d97('0x7e')](_0x1d97('0x9f')+_0x287189['name'],_0x27fc7d[0x0][_0x1d97('0xa0')],_0x1d97('0xa1'));}else{_0x287189['message']=_0x1d97('0xa2');logger[_0x1d97('0x7e')]('[getContactDialer2][Empty]'+_0x287189['name']);}}};}function notSendMessagesQueue(_0x5da1a7){if(_0x5da1a7['sendMessageOneNotActive']){freeVariablesPredictive(_0x5da1a7);if(_0x5da1a7[_0x1d97('0x73')]===0x0&&_0x5da1a7[_0x1d97('0x53')]===0x0&&_0x5da1a7['waiting']===0x0&&(_0x5da1a7[_0x1d97('0x50')]||0x0)===0x0){_0x5da1a7[_0x1d97('0xa3')]=![];_0x5da1a7[_0x1d97('0x4e')]=0x0;_0x5da1a7[_0x1d97('0x39')]=_0x1d97('0x3d');loggerSyncQueueSummary[_0x1d97('0x98')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x5da1a7[_0x1d97('0x3b')],_0x1d97('0xa4'));}else{_0x5da1a7[_0x1d97('0x39')]=_0x1d97('0xa5');loggerSyncQueueSummary['error'](_0x1d97('0xa6'),_0x5da1a7['name'],_0x1d97('0xa7'));}emitVoiceQueueSummary(_0x5da1a7);}}function notSendMessagesCampaign(_0x844775){if(_0x844775[_0x1d97('0xa3')]){if(_0x844775[_0x1d97('0x73')]===0x0){_0x844775['sendMessageOneNotActive']=![];_0x844775[_0x1d97('0x39')]=_0x1d97('0x3d');loggerSyncQueueSummary[_0x1d97('0x98')](_0x1d97('0xa8'),_0x844775[_0x1d97('0x3b')],_0x1d97('0xa4'));}else{_0x844775[_0x1d97('0x39')]='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0x1d97('0xa8'),_0x844775[_0x1d97('0x3b')],'is\x20disactive');}emitCampaignSummary(_0x844775);}}function createObjHistory(_0x420719,_0x3b0368,_0x5b66d6,_0x50f220,_0x5bb54f){_0x420719['message']=_0x5b66d6;var _0x382bc4=new Action(_0x420719,_0x3b0368);var _0x41781f=new History(_0x382bc4);_0x41781f[_0x1d97('0xa9')]=_0x50f220;_0x41781f[_0x1d97('0xaa')]=_0x5bb54f;_0x41781f['endtime']=_0x382bc4['starttime'];return _0x41781f;}Dialer['prototype'][_0x1d97('0x37')]=function(){var _0x479e02=this;setInterval(function(){_0x479e02[_0x1d97('0xab')](_0x479e02[_0x1d97('0x24')],_0x1d97('0xac'));_0x479e02[_0x1d97('0xab')](_0x479e02[_0x1d97('0x23')],'[actions]');},0x32c8);};Dialer[_0x1d97('0x18')][_0x1d97('0xab')]=function(_0x145c86,_0x1140e6){var _0x689129=this;for(var _0x2b9056 in _0x145c86){if(_0x145c86['hasOwnProperty'](_0x2b9056)){this['sequence']['enqueue'](function(){if(!_[_0x1d97('0xad')](_0x145c86[_0x2b9056])){return ami[_0x1d97('0xae')]({'action':_0x1d97('0xaf'),'channel':_0x145c86[_0x2b9056]['channel']})[_0x1d97('0xb0')](function(_0x4905a0){if(_0x4905a0['message']===_0x1d97('0xb1')){setTimeout(function(){if(_0x145c86[_0x2b9056]&&_0x145c86[_0x2b9056][_0x1d97('0x4a')]!==_0x1d97('0x7a')){_0x689129[_0x1d97('0xb2')](_0x689129[_0x1d97('0x1d')][_0x145c86[_0x2b9056][_0x1d97('0xb3')]]);logger['error'](_0x1d97('0xb4'),_0x1140e6,_0x2b9056,_0x145c86[_0x2b9056][_0x1d97('0xb3')]);delete _0x145c86[_0x2b9056];}if(_0x145c86[_0x2b9056]&&_0x145c86[_0x2b9056]['type']==='ivr'){_0x689129[_0x1d97('0xb2')](_0x689129[_0x1d97('0x1e')][_0x145c86[_0x2b9056][_0x1d97('0xb3')]]);logger[_0x1d97('0x98')]('[Dialer][checkChannel][ivr]',_0x1140e6,_0x2b9056,_0x145c86[_0x2b9056][_0x1d97('0xb3')]);delete _0x145c86[_0x2b9056];}},0x2328);}});}});}}};Dialer[_0x1d97('0x18')]['countReScheduled']=function(_0x1b55a1){return BPromise[_0x1d97('0xb5')]()[_0x1d97('0xb6')](cmHopper['countReScheduled'](_0x1b55a1))[_0x1d97('0xb0')](loggerCatch(_0x1d97('0xb7')));};Dialer[_0x1d97('0x18')][_0x1d97('0xb8')]=function(_0xaff7f2){return BPromise[_0x1d97('0xb5')]()['then'](cmHopperBlack[_0x1d97('0xb8')](_0xaff7f2))[_0x1d97('0xb0')](loggerCatch(_0x1d97('0xb9')));};Dialer[_0x1d97('0x18')]['checkIsBlackListIvr']=function(_0x1c8e90){return BPromise['resolve']()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x1c8e90))[_0x1d97('0xb0')](loggerCatch(_0x1d97('0xba')));};Dialer[_0x1d97('0x18')][_0x1d97('0xbb')]=function(_0x4d9042){return BPromise['resolve']()['then'](cmHopperHistory[_0x1d97('0xbc')](_0x4d9042))[_0x1d97('0xb0')](loggerCatch(_0x1d97('0xbd')));};Dialer[_0x1d97('0x18')][_0x1d97('0xbe')]=function(_0x40565a){return BPromise['resolve']()['then'](cmHopper[_0x1d97('0xbe')](_0x40565a))['catch'](loggerCatch(_0x1d97('0xbf')));};Dialer[_0x1d97('0x18')][_0x1d97('0xc0')]=function(_0x2c3729,_0x4c3439,_0x5656fc,_0x2bc07e){return BPromise[_0x1d97('0xb5')]()[_0x1d97('0xb6')](cmHopper[_0x1d97('0xc0')](_0x2c3729,_0x4c3439,_0x5656fc,_0x2bc07e))[_0x1d97('0xb0')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x1d97('0x18')][_0x1d97('0xc1')]=function(_0x46cf55,_0x37fafe,_0x30ee69){return BPromise[_0x1d97('0xb5')]()[_0x1d97('0xb6')](cmHopper[_0x1d97('0xc1')](_0x46cf55,_0x37fafe,_0x30ee69))[_0x1d97('0xb0')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x1d97('0x18')][_0x1d97('0xc2')]=function(_0x46004d){return BPromise[_0x1d97('0xb5')]()[_0x1d97('0xb6')](voiceQueueRt[_0x1d97('0xc2')](_0x46004d))[_0x1d97('0xb0')](loggerCatch(_0x1d97('0xc3')));};Dialer[_0x1d97('0x18')]['moveContactManagedDialer']=function(_0x234486){return BPromise[_0x1d97('0xb5')]()[_0x1d97('0xb6')](cmHopper['moveContactManagedDialer'](_0x234486))[_0x1d97('0xb0')](loggerCatch(_0x1d97('0xc4')));};Dialer[_0x1d97('0x18')][_0x1d97('0xc5')]=function(_0x3c7d10){return BPromise[_0x1d97('0xb5')]()[_0x1d97('0xb6')](cmHopperHistory[_0x1d97('0xc5')](_0x3c7d10))['catch'](loggerCatch(_0x1d97('0xc6')));};Dialer['prototype'][_0x1d97('0xb2')]=function(_0x217b56){if(!_[_0x1d97('0x38')](_0x217b56)&&_0x217b56!==null){if(_0x217b56[_0x1d97('0x9b')](_0x1d97('0x73'))){if(_0x217b56[_0x1d97('0x73')]>0x0){_0x217b56[_0x1d97('0x73')]-=0x1;}else{logger[_0x1d97('0x98')](_0x1d97('0xc7'));}}}else{logger[_0x1d97('0x98')](_0x1d97('0xc8'));}};Dialer[_0x1d97('0x18')][_0x1d97('0xc9')]=function(_0x79dc5c,_0x2263bb){var _0x3beccd=this;return function(_0x53d9b0){_0x3beccd[_0x1d97('0xb2')](_0x2263bb);logger['error'](_0x79dc5c,util['inspect'](_0x53d9b0,{'showHidden':![],'depth':null}));};};Dialer[_0x1d97('0x18')][_0x1d97('0xca')]=function(_0x68fa61,_0x2c57bd,_0x4e1e0){var _0x273b9c={'state':0x19,'statedesc':_0x1d97('0xcb')};this[_0x1d97('0xb2')](_0x2c57bd);this[_0x1d97('0xcc')](_['merge'](_0x273b9c,_[_0x1d97('0xcd')](_0x4e1e0,['ContactId',_0x1d97('0xce'),_0x1d97('0xcf'),_0x1d97('0xd0'),_0x1d97('0xd1')])),_0x1d97('0xd2'),_0x1d97('0xd3'));logger[_0x1d97('0x98')](_0x68fa61);};Dialer[_0x1d97('0x18')][_0x1d97('0xd4')]=function(_0x2e1586){return _0x2e1586===_0x1d97('0xd5');};Dialer[_0x1d97('0x18')][_0x1d97('0xd6')]=function(_0x8a7418){return!_['isUndefined'](_0x8a7418)&&_0x8a7418&&!_[_0x1d97('0x38')](_0x8a7418[_0x1d97('0x3b')])&&!_['isUndefined'](_0x8a7418[_0x1d97('0xd7')])&&_0x8a7418[_0x1d97('0xd7')]&&(this[_0x1d97('0x20')][util['format']('SIP/%s',_0x8a7418[_0x1d97('0x3b')])][_0x1d97('0xaf')]===_0x1d97('0xd8')||this[_0x1d97('0x20')][util[_0x1d97('0x7b')]('SIP/%s',_0x8a7418[_0x1d97('0x3b')])]['status']===_0x1d97('0xd9'));};Dialer[_0x1d97('0x18')][_0x1d97('0xcc')]=function(_0xe4f136,_0x4f69e0,_0x621c5f){this['createHistory'](_0xe4f136)['catch'](loggerCatch(_0x4f69e0));this[_0x1d97('0xda')](_0xe4f136)['catch'](loggerCatch(_0x621c5f));};Dialer[_0x1d97('0x18')][_0x1d97('0xdb')]=function(_0x4f7045){var _0x5edd20=this['uniqueId'][_0x4f7045['uniqueid']];var _0x5a94fb;if(!_[_0x1d97('0xad')](_0x4f7045)&&!_[_0x1d97('0xad')](_0x4f7045[_0x1d97('0xdc')])&&!_['isNil'](_0x4f7045['variable'][_0x1d97('0xdd')])&&_0x4f7045[_0x1d97('0xde')]===_0x1d97('0xdf')&&_0x5edd20){if(_0x5edd20[_0x1d97('0x4a')]!==_0x1d97('0x7a')&&this[_0x1d97('0x1d')][_0x5edd20['queue']][_0x1d97('0xe0')]&&_0x4f7045[_0x1d97('0xe1')]===_0x1d97('0xe2')){delete this['uniqueId'][_0x4f7045[_0x1d97('0xe3')]];this[_0x1d97('0xb2')](this['voiceQueues'][_0x5edd20[_0x1d97('0xb3')]]);this['voiceQueues'][_0x5edd20['queue']][_0x1d97('0x5d')]+=0x1;this[_0x1d97('0x1d')][_0x5edd20[_0x1d97('0xb3')]][_0x1d97('0xe4')]+=0x1;_0x5a94fb=new Hangup(_0x5edd20,_0x4f7045);_0x5a94fb[_0x1d97('0xa9')]=0x12;_0x5a94fb[_0x1d97('0xaa')]=_0x1d97('0xe5');_0x5a94fb[_0x1d97('0xe6')]='AMD';this[_0x1d97('0xcc')](_0x5a94fb,'[syncHangupInAMD][createHistory]',_0x1d97('0xe7'));}if(_0x5edd20[_0x1d97('0x4a')]!==_0x1d97('0x7a')&&this['voiceQueues'][_0x5edd20['queue']][_0x1d97('0xe0')]&&_0x4f7045['value']===_0x1d97('0xe8')){delete this[_0x1d97('0x24')][_0x4f7045[_0x1d97('0xe3')]];this[_0x1d97('0xb2')](this[_0x1d97('0x1d')][_0x5edd20[_0x1d97('0xb3')]]);this[_0x1d97('0x1d')][_0x5edd20[_0x1d97('0xb3')]][_0x1d97('0x5d')]+=0x1;this[_0x1d97('0x1d')][_0x5edd20[_0x1d97('0xb3')]]['outboundAnswerAgiCallsDay']+=0x1;_0x5a94fb=new Hangup(_0x5edd20,_0x4f7045);_0x5a94fb['state']=0x13;_0x5a94fb[_0x1d97('0xaa')]=_0x1d97('0xe9');_0x5a94fb[_0x1d97('0xe6')]=_0x1d97('0xea');_0x5a94fb[_0x1d97('0xeb')]=!![];this[_0x1d97('0xcc')](_0x5a94fb,'[syncMachine][createHistory]',_0x1d97('0xec'));}if(_0x5edd20[_0x1d97('0x4a')]===_0x1d97('0x7a')&&this[_0x1d97('0x1e')][_0x5edd20['queue']]['dialAMDActive']&&_0x4f7045[_0x1d97('0xe1')]===_0x1d97('0xe2')){delete this[_0x1d97('0x24')][_0x4f7045[_0x1d97('0xe3')]];this[_0x1d97('0xb2')](this[_0x1d97('0x1e')][_0x5edd20['queue']]);_0x5a94fb=new Hangup(_0x5edd20,_0x4f7045);_0x5a94fb[_0x1d97('0xa9')]=0x12;_0x5a94fb['statedesc']=_0x1d97('0xe5');_0x5a94fb[_0x1d97('0xe6')]=_0x1d97('0xea');this['saveInDb'](_0x5a94fb,'[syncHangupInAMDIvr][createHistory]',_0x1d97('0xed'));}if(_0x5edd20[_0x1d97('0x4a')]===_0x1d97('0x7a')&&this[_0x1d97('0x1e')][_0x5edd20[_0x1d97('0xb3')]][_0x1d97('0xe0')]&&_0x4f7045[_0x1d97('0xe1')]===_0x1d97('0xe8')){delete this[_0x1d97('0x24')][_0x4f7045[_0x1d97('0xe3')]];this[_0x1d97('0xb2')](this[_0x1d97('0x1e')][_0x5edd20[_0x1d97('0xb3')]]);_0x5a94fb=new Hangup(_0x5edd20,_0x4f7045);_0x5a94fb[_0x1d97('0xa9')]=0x13;_0x5a94fb['statedesc']=_0x1d97('0xe9');_0x5a94fb[_0x1d97('0xe6')]=_0x1d97('0xea');_0x5a94fb[_0x1d97('0xeb')]=!![];this[_0x1d97('0xcc')](_0x5a94fb,_0x1d97('0xee'),_0x1d97('0xef'));}}};Dialer['prototype'][_0x1d97('0x31')]=function(_0x4d8021){var _0x56146b=this['uniqueId'][_0x4d8021[_0x1d97('0xe3')]];var _0x1c2a8c=this;var _0x5da880;if(_0x56146b&&_0x56146b[_0x1d97('0x4a')]===_0x1d97('0x7a')){delete this['uniqueId'][_0x4d8021['uniqueid']];this[_0x1d97('0xb2')](this[_0x1d97('0x1e')][_0x56146b[_0x1d97('0xb3')]]);this[_0x1d97('0x1e')][_0x56146b['queue']]['ivrAnswerCallsDay']+=0x1;_0x5da880=new Hangup(_0x56146b,_0x4d8021);this[_0x1d97('0xc5')](_0x5da880)[_0x1d97('0xb0')](loggerCatch(_0x1d97('0xf0')));this[_0x1d97('0xda')](_0x5da880)[_0x1d97('0xb0')](loggerCatch(_0x1d97('0xf1')));}if(_0x56146b&&_0x56146b['type']!==_0x1d97('0x7a')&&isNotNull(this['voiceQueues'][_0x56146b[_0x1d97('0xb3')]][_0x1d97('0xf2')])){delete this[_0x1d97('0x24')][_0x4d8021[_0x1d97('0xe3')]];this['updateOriginated'](this[_0x1d97('0x1d')][_0x56146b['queue']]);this[_0x1d97('0x1d')][_0x56146b[_0x1d97('0xb3')]][_0x1d97('0x5d')]+=0x1;this[_0x1d97('0x1d')][_0x56146b[_0x1d97('0xb3')]]['outboundAnswerAgiCallsDay']+=0x1;_0x5da880=new Hangup(_0x56146b,_0x4d8021);_0x5da880[_0x1d97('0xa9')]=0x10;_0x5da880['statedesc']=_0x1d97('0xf3');_0x5da880[_0x1d97('0xe6')]='AGI';this[_0x1d97('0xc5')](_0x5da880)['catch'](loggerCatch(_0x1d97('0xf0')));this[_0x1d97('0xda')](_0x5da880)[_0x1d97('0xb0')](loggerCatch(_0x1d97('0xf1')));}if(_0x56146b&&_0x56146b[_0x1d97('0x4a')]!==_0x1d97('0x7a')&&!isNotNull(this[_0x1d97('0x1d')][_0x56146b['queue']][_0x1d97('0xf2')])){delete this[_0x1d97('0x24')][_0x4d8021['uniqueid']];this['updateOriginated'](this[_0x1d97('0x1d')][_0x56146b[_0x1d97('0xb3')]]);this['voiceQueues'][_0x56146b[_0x1d97('0xb3')]][_0x1d97('0x68')]+=0x1;_0x5da880=new Hangup(_0x56146b,_0x4d8021);_0x5da880[_0x1d97('0xa9')]=0xc;_0x5da880[_0x1d97('0xaa')]=_0x4d8021[_0x1d97('0xf4')];_0x5da880[_0x1d97('0xe6')]=_0x1d97('0xf5');this[_0x1d97('0xc5')](_0x5da880)[_0x1d97('0xb0')](loggerCatch(_0x1d97('0xf0')));this[_0x1d97('0xda')](_0x5da880)[_0x1d97('0xb0')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype']['syncAgentComplete']=function(_0x330488){var _0x3d2b02=this[_0x1d97('0x24')][_0x330488[_0x1d97('0xe3')]];var _0x5d85be=this;if(this[_0x1d97('0x1d')][_0x330488['queue']]){if(_0x3d2b02&&_0x3d2b02['type']!==_0x1d97('0x7a')){delete this['uniqueId'][_0x330488['uniqueid']];this[_0x1d97('0x1d')][_0x330488[_0x1d97('0xb3')]]['outboundAnswerCallsDay']+=0x1;var _0x3fe5e5=new AgentComplete(_0x3d2b02,_0x330488);if(_0x330488[_0x1d97('0xf6')]===_0x1d97('0xf7')){_0x3fe5e5[_0x1d97('0xf8')]=this[_0x1d97('0x1d')][_0x330488[_0x1d97('0xb3')]][_0x1d97('0xf9')]&&this['voiceQueues'][_0x330488[_0x1d97('0xb3')]]['dialAgiAfterHangupAgent']?moment()[_0x1d97('0x7b')](_0x1d97('0xfa')):undefined;}this[_0x1d97('0xc5')](_0x3fe5e5)['catch'](loggerCatch(_0x1d97('0xfb')));this[_0x1d97('0xda')](_0x3fe5e5)[_0x1d97('0xb0')](loggerCatch(_0x1d97('0xfc')));}}};Dialer[_0x1d97('0x18')][_0x1d97('0xfd')]=function(_0x138311){if(this[_0x1d97('0x1d')][_0x138311[_0x1d97('0xb3')]]){if(this[_0x1d97('0x24')][_0x138311[_0x1d97('0xe3')]]&&this['uniqueId'][_0x138311[_0x1d97('0xe3')]][_0x1d97('0x4a')]!==_0x1d97('0x7a')){this[_0x1d97('0xb2')](this[_0x1d97('0x1d')][_0x138311[_0x1d97('0xb3')]]);this[_0x1d97('0x24')][_0x138311[_0x1d97('0xe3')]][_0x1d97('0xfe')]=moment()[_0x1d97('0x7b')](_0x1d97('0xfa'));}}};Dialer[_0x1d97('0x18')]['queueCallerAbandonCreateState']=function(_0x3eb24d){this[_0x1d97('0xc5')](_0x3eb24d)[_0x1d97('0xb0')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x1d97('0xda')](_0x3eb24d)[_0x1d97('0xb0')](loggerCatch(_0x1d97('0xff')));};Dialer[_0x1d97('0x18')]['syncQueueCallerAbandon']=function(_0x20b08e){var _0xf27173=this[_0x1d97('0x24')][_0x20b08e[_0x1d97('0xe3')]];var _0x3e0084=this;if(this['voiceQueues'][_0x20b08e[_0x1d97('0xb3')]]){if(_0xf27173&&_0xf27173[_0x1d97('0x4a')]!==_0x1d97('0x7a')){delete this[_0x1d97('0x24')][_0x20b08e[_0x1d97('0xe3')]];this['updateOriginated'](this[_0x1d97('0x1d')][_0x20b08e[_0x1d97('0xb3')]]);_0xf27173[_0x1d97('0x100')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x2bd041=new QueueCallerAbandon(_0xf27173,_0x20b08e);if(getSeconds(_0xf27173['droptime'],_0xf27173['responsetime'])>=_0xf27173['dialQueueTimeout']){this[_0x1d97('0x1d')][_0x20b08e[_0x1d97('0xb3')]][_0x1d97('0x6c')]+=0x1;this[_0x1d97('0x1d')][_0x20b08e[_0x1d97('0xb3')]][_0x1d97('0x101')]+=0x1;this['voiceQueues'][_0x20b08e[_0x1d97('0xb3')]][_0x1d97('0x6e')]+=0x1;_0x2bd041['state']=0xa;_0x2bd041[_0x1d97('0xaa')]=_0x1d97('0x102');_0x2bd041['dropreason']=_0x1d97('0x103');_0x2bd041[_0x1d97('0xf8')]=this['voiceQueues'][_0x20b08e[_0x1d97('0xb3')]][_0x1d97('0xf9')]?moment()[_0x1d97('0x7b')](_0x1d97('0xfa')):undefined;this[_0x1d97('0x104')](_0x2bd041);}else{this[_0x1d97('0x1d')][_0x20b08e[_0x1d97('0xb3')]][_0x1d97('0x84')]+=0x1;this[_0x1d97('0x1d')][_0x20b08e['queue']][_0x1d97('0x62')]+=0x1;_0x2bd041[_0x1d97('0xa9')]=0xb;_0x2bd041['statedesc']=_0x1d97('0x105');_0x2bd041[_0x1d97('0x106')]=_0x1d97('0x107');this[_0x1d97('0x104')](_0x2bd041);}}}};Dialer[_0x1d97('0x18')][_0x1d97('0x108')]=function(_0x3c128d){if(this['actions'][_0x3c128d[_0x1d97('0xe3')]]){this[_0x1d97('0x23')][_0x3c128d[_0x1d97('0xe3')]][_0x1d97('0x109')]=_0x3c128d[_0x1d97('0x109')];}if(this[_0x1d97('0x24')][_0x3c128d['uniqueid']]){this[_0x1d97('0x24')][_0x3c128d['uniqueid']]['channel']=_0x3c128d[_0x1d97('0x109')];}};Dialer[_0x1d97('0x18')][_0x1d97('0x34')]=function(_0x3cd441){if(strategy[this[_0x1d97('0x1d')][this[_0x1d97('0x23')][_0x3cd441[_0x1d97('0x10a')]][_0x1d97('0xb3')]][_0x1d97('0x4c')]]==='roundrobin'){if(this[_0x1d97('0x23')][_0x3cd441[_0x1d97('0x10a')]]&&_[_0x1d97('0xad')](this[_0x1d97('0x23')][_0x3cd441[_0x1d97('0x10a')]][_0x1d97('0x10b')])&&_0x3cd441['status']==='1'&&_0x3cd441[_0x1d97('0x10c')]==='0'){if(this[_0x1d97('0x1f')][_0x3cd441[_0x1d97('0x10d')]]){if(!this[_0x1d97('0x1f')][_0x3cd441[_0x1d97('0x10d')]]['locked']){this[_0x1d97('0x1f')][_0x3cd441['stateinterface']]['locked']=!![];this[_0x1d97('0x23')][_0x3cd441['actionid']]['locked']=!![];this['actions'][_0x3cd441['actionid']][_0x1d97('0x10d')]=_0x3cd441[_0x1d97('0x10d')];}}}}else if((strategy[this[_0x1d97('0x1d')][this[_0x1d97('0x23')][_0x3cd441[_0x1d97('0x10a')]]['queue']][_0x1d97('0x4c')]]||_0x1d97('0x10e'))===_0x1d97('0x10e')){if(this[_0x1d97('0x23')][_0x3cd441[_0x1d97('0x10a')]]){if(this['agents'][_0x3cd441[_0x1d97('0x10d')]]){this[_0x1d97('0x23')][_0x3cd441[_0x1d97('0x10a')]][_0x1d97('0x10d')]=_0x3cd441['stateinterface'];if(_[_0x1d97('0xad')](this['queueBooked'][this[_0x1d97('0x23')][_0x3cd441[_0x1d97('0x10a')]][_0x1d97('0xb3')]])){this[_0x1d97('0x28')][this[_0x1d97('0x23')][_0x3cd441[_0x1d97('0x10a')]][_0x1d97('0xb3')]]=[];}this[_0x1d97('0x28')][this[_0x1d97('0x23')][_0x3cd441[_0x1d97('0x10a')]][_0x1d97('0xb3')]][_0x1d97('0x10f')](_['merge'](_[_0x1d97('0xcd')](this['actions'][_0x3cd441['actionid']],[_0x1d97('0x110'),_0x1d97('0x10d')]),{'status':_0x3cd441[_0x1d97('0xaf')],'paused':_0x3cd441[_0x1d97('0x10c')]}));}}}};function unlockQueueStatus(_0xe200e1,_0x2ff59c){setTimeout(function(){if(_['isUndefined'](_0xe200e1[_0x1d97('0x111')])){loggerBooked[_0x1d97('0x98')](_0x1d97('0x112'),_0x2ff59c);}_0xe200e1[_0x1d97('0x111')]=!![];loggerBooked['info'](_0x1d97('0x113'),_0x2ff59c,JSON[_0x1d97('0x45')](_[_0x1d97('0xcd')](_0xe200e1,[_0x1d97('0x3b'),_0x1d97('0x111')])));},0x1f3);}Dialer['prototype'][_0x1d97('0x35')]=function(_0x512f65){var _0x193be4=this;var _0x1d6bf8=_0x193be4[_0x1d97('0x1d')][_0x193be4[_0x1d97('0x23')][_0x512f65[_0x1d97('0x10a')]][_0x1d97('0xb3')]];if(strategy[this[_0x1d97('0x1d')][this[_0x1d97('0x23')][_0x512f65[_0x1d97('0x10a')]][_0x1d97('0xb3')]][_0x1d97('0x4c')]]===_0x1d97('0x17')){if(this[_0x1d97('0x23')][_0x512f65[_0x1d97('0x10a')]]&&this['actions'][_0x512f65[_0x1d97('0x10a')]][_0x1d97('0x10d')]){this[_0x1d97('0x1c')][_0x1d97('0x114')](this['actions'][_0x512f65[_0x1d97('0x10a')]][_0x1d97('0x110')],this[_0x1d97('0x23')][_0x512f65[_0x1d97('0x10a')]][_0x1d97('0x10d')])[_0x1d97('0xb0')](function(_0x29b9ca){logger[_0x1d97('0x98')](_0x1d97('0x115'),util[_0x1d97('0x99')](_0x29b9ca,{'showHidden':![],'depth':null}));})[_0x1d97('0x1a')](function(){_0x193be4[_0x1d97('0xb2')](_0x193be4[_0x1d97('0x1d')][_0x193be4[_0x1d97('0x23')][_0x512f65[_0x1d97('0x10a')]]['queue']]);_0x193be4[_0x1d97('0x1f')][_0x193be4['actions'][_0x512f65[_0x1d97('0x10a')]][_0x1d97('0x10d')]][_0x1d97('0x10b')]=![];delete _0x193be4[_0x1d97('0x23')][_0x512f65[_0x1d97('0x10a')]];unlockQueueStatus(_0x1d6bf8);});}else{this[_0x1d97('0xb2')](this['voiceQueues'][this['actions'][_0x512f65['actionid']]['queue']]);this[_0x1d97('0xbe')]({'active':![],'ContactId':this['actions'][_0x512f65['actionid']][_0x1d97('0x116')],'ListId':this[_0x1d97('0x23')][_0x512f65[_0x1d97('0x10a')]][_0x1d97('0xce')],'VoiceQueueId':this[_0x1d97('0x23')][_0x512f65[_0x1d97('0x10a')]][_0x1d97('0xd0')]||undefined,'CampaignId':this[_0x1d97('0x23')][_0x512f65[_0x1d97('0x10a')]][_0x1d97('0xd1')]||undefined})[_0x1d97('0xb0')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x512f65[_0x1d97('0x10a')]];unlockQueueStatus(_0x1d6bf8);}}else if((strategy[this[_0x1d97('0x1d')][this[_0x1d97('0x23')][_0x512f65['actionid']][_0x1d97('0xb3')]][_0x1d97('0x4c')]]||_0x1d97('0x10e'))==='rrmemory'){var _0x35295e;if(this[_0x1d97('0x23')][_0x512f65[_0x1d97('0x10a')]]&&!_['isEmpty'](this['queueBooked'][this[_0x1d97('0x23')][_0x512f65[_0x1d97('0x10a')]]['queue']])){if(this[_0x1d97('0x29')][_0x193be4['actions'][_0x512f65[_0x1d97('0x10a')]][_0x1d97('0xb3')]]){this[_0x1d97('0x29')][_0x193be4[_0x1d97('0x23')][_0x512f65[_0x1d97('0x10a')]][_0x1d97('0xb3')]]=this['queueBookedRR'][this[_0x1d97('0x23')][_0x512f65['actionid']][_0x1d97('0xb3')]]?this[_0x1d97('0x29')][this[_0x1d97('0x23')][_0x512f65['actionid']][_0x1d97('0xb3')]]:this[_0x1d97('0x28')][this['actions'][_0x512f65['actionid']][_0x1d97('0xb3')]]?this[_0x1d97('0x28')][this[_0x1d97('0x23')][_0x512f65[_0x1d97('0x10a')]][_0x1d97('0xb3')]]['_rr']||0x0:0x0;}this[_0x1d97('0x28')][this[_0x1d97('0x23')][_0x512f65[_0x1d97('0x10a')]][_0x1d97('0xb3')]][_0x1d97('0x117')]=this['queueBookedRR'][this[_0x1d97('0x23')][_0x512f65[_0x1d97('0x10a')]]['queue']];for(var _0x3bb29c=0x0;_0x3bb29c=0x0?!![]:![];})[_0x1d97('0xb0')](myreject(_0x3f6a86)));}}else{_0x43387e[_0x1d97('0x10f')](ami[_0x1d97('0xae')]({'action':'command','command':util[_0x1d97('0x7b')](_0x1d97('0x12c'),_0xf88432,!_['isUndefined'](config[_0x1d97('0x129')][_0x357c4c])?_0x357c4c:'')})['then'](function(_0x3da104){return _0x3da104[_0x1d97('0x12f')][_0x1d97('0x12e')](_0x1d97('0x130'))>=0x0?!![]:![];})[_0x1d97('0xb0')](myreject(_0x3f6a86)));}BPromise[_0x1d97('0x131')](_0x43387e)[_0x1d97('0xb6')](function(_0x1249c8){var _0x49db67=_[_0x1d97('0x132')](_0x1249c8);if(_0x49db67){return _0x11b023(_0x49db67);}else{_0x1a3c20[_0x1d97('0x39')]=_0xe9479b?'GLOBAL_INTERVAL_IS_OVERTIME':_0x1d97('0x133');return _0x3f6a86(msgResponse(_0x1d97('0x134'),'Failure','Global:\x20'+_0xe9479b+'\x20'+_0x5333a4+'\x20Interval\x20is\x20overtime:\x20'+util[_0x1d97('0x99')](_0xf88432,{'showHidden':![],'depth':null})+_0x1d97('0x135')+_0x357c4c));}})[_0x1d97('0xb0')](function(_0x32a26d){return _0x3f6a86(msgResponse(_0x1d97('0x123'),_0x1d97('0x125'),JSON['stringify'](_0x32a26d)));});});};Dialer['prototype'][_0x1d97('0x136')]=function(_0x3788a3){var _0x5d9dc1=this;return function(){switch(_0x3788a3[_0x1d97('0x59')]){case _0x1d97('0x137'):freeVariablesPredictive(_0x3788a3);_0x5d9dc1[_0x1d97('0x138')](_0x3788a3,0x1);break;case _0x1d97('0x139'):freeVariablesPredictive(_0x3788a3);_0x5d9dc1[_0x1d97('0x138')](_0x3788a3,_0x3788a3[_0x1d97('0x13a')]);break;case'predictive':_0x5d9dc1['predictive'](_0x3788a3);break;case _0x1d97('0x13b'):freeVariablesPredictive(_0x3788a3);_0x5d9dc1[_0x1d97('0x138')](_0x3788a3,0x1);break;default:freeVariablesPredictive(_0x3788a3);logger[_0x1d97('0x98')](_0x1d97('0x13c'),_0x3788a3[_0x1d97('0x3b')],'method\x20not\x20recognized');}};};Dialer[_0x1d97('0x18')]['launchHandleIvr']=function(_0x597175){var _0x3ba2d7=this;return function(){_0x3ba2d7['handleIvr'](_0x597175);};};Dialer['prototype']['syncQueueSummary']=function(_0x4302ca){var _0x516628=this;if(isNotPreview(_0x4302ca[_0x1d97('0x59')])){if(isVoiceQueueOutbound(_0x4302ca['type'])&&isActive(_0x4302ca['dialActive'])){_0x4302ca[_0x1d97('0xa3')]=!![];BPromise[_0x1d97('0xb5')]()[_0x1d97('0xb6')](checkIsLoggedIn(_0x4302ca,_0x4302ca[_0x1d97('0x4f')]))[_0x1d97('0xb6')](checkIsActive(_0x4302ca,_0x4302ca['dialActive']))[_0x1d97('0xb6')](checkInterval(_0x4302ca))[_0x1d97('0xb6')](_0x516628[_0x1d97('0x120')](_0x4302ca))[_0x1d97('0xb6')](_0x516628[_0x1d97('0x122')](_0x4302ca[_0x1d97('0x13d')],_0x4302ca['dialTimezone'],_0x4302ca[_0x1d97('0x3b')],_0x4302ca))['then'](_0x516628[_0x1d97('0x124')](_0x4302ca[_0x1d97('0x3f')],_0x4302ca['dialTimezone'],_0x4302ca['name'],_0x4302ca))[_0x1d97('0xb6')](_0x516628[_0x1d97('0x136')](_0x4302ca))[_0x1d97('0xb0')](loggerCatchQueueSummary(_0x1d97('0x13e'),_0x4302ca));}else{notSendMessagesQueue(_0x4302ca);}}else{freeVariablesPredictive(_0x4302ca);}};Dialer[_0x1d97('0x18')]['syncCampaigns']=function(){var _0x1685f0=this;var _0x239c04;for(var _0xdc5ed9 in this[_0x1d97('0x1e')]){if(this[_0x1d97('0x1e')][_0x1d97('0x9b')](_0xdc5ed9)){_0x239c04=this[_0x1d97('0x1e')][_0xdc5ed9];if(isCampaignIvr(_0x239c04[_0x1d97('0x4a')])&&isActive(_0x239c04['active'])){_0x239c04[_0x1d97('0xa3')]=!![];BPromise['resolve']()[_0x1d97('0xb6')](checkIsActive(_0x239c04,_0x239c04[_0x1d97('0xd7')]))[_0x1d97('0xb6')](checkInterval(_0x239c04))[_0x1d97('0xb6')](_0x1685f0['checkIsTrunkReachable'](_0x239c04))['then'](_0x1685f0[_0x1d97('0x122')](_0x239c04[_0x1d97('0x13d')],_0x239c04[_0x1d97('0x13f')],_0x239c04[_0x1d97('0x3b')],_0x239c04))[_0x1d97('0xb6')](_0x1685f0[_0x1d97('0x124')](_0x239c04[_0x1d97('0x3f')],_0x239c04['dialTimezone'],_0x239c04[_0x1d97('0x3b')],_0x239c04))[_0x1d97('0xb6')](_0x1685f0['launchHandleIvr'](_0x239c04))[_0x1d97('0xb0')](loggerCatchQueueSummary(_0x1d97('0x140'),_0x239c04));}else{notSendMessagesCampaign(_0x239c04);}}}};function getCallerIdRandom(_0x557b95,_0x319144){var _0x3efc73,_0x38f2c1,_0x3a4433;if(_0x319144<=0x0){_0x319144=0x1;}_0x3efc73=new RegExp(_0x1d97('0x141')+_0x319144+'}$');_0x38f2c1=Math[_0x1d97('0x142')](0xa,_0x319144-0x1);_0x3a4433=Math[_0x1d97('0x142')](0xa,_0x319144)-0x1;return util[_0x1d97('0x7b')]('%s',_['replace'](_0x557b95,_0x3efc73,_[_0x1d97('0x143')](_0x38f2c1,_0x3a4433)));}function extractCalleridName(_0x282451){var _0x51ce6c=_0x282451[_0x1d97('0x144')](/"(.*?)"/);return _0x51ce6c?_0x51ce6c[0x1]:_0x282451;}function extractCalleridNumber(_0x3801cc){var _0x2cf73c=_0x3801cc[_0x1d97('0x144')](/<(.*?)>/);return _0x2cf73c?_0x2cf73c[0x1]:_0x3801cc;}Dialer[_0x1d97('0x18')][_0x1d97('0x145')]=function(_0x1ca651,_0x5a02fe){var _0x304f38=this;var _0x4758db=uuid['v4']();this[_0x1d97('0x23')][_0x4758db]=new Action(_0x1ca651,_0x5a02fe,_0x4758db);return new BPromise(function(_0x494c7c,_0x549166){if(_[_0x1d97('0x38')](_0x1ca651)&&_0x1d97('0x146')!==typeof _0x1ca651){return _0x549166(msgResponse(_0x1d97('0x147'),_0x1d97('0x125'),_0x1d97('0x148')));}if(_['isUndefined'](_0x5a02fe[_0x1d97('0x149')][_0x1d97('0x14a')])||_0x5a02fe['Contact'][_0x1d97('0x14a')]===null){return _0x549166(msgResponse(_0x1d97('0x147'),_0x1d97('0x125'),_0x1d97('0x14b')));}var _0x44d753={'XMD-CALLERID':_0x304f38[_0x1d97('0x23')][_0x4758db][_0x1d97('0x14c')](),'XMD-AGI':_0x1ca651[_0x1d97('0xf2')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x1ca651[_0x1d97('0xf2')]):_0x1d97('0x14d'),'XMD-AGIAFTER':_0x1ca651[_0x1d97('0xf9')]?util[_0x1d97('0x7b')](_0x1d97('0x14e'),ipAgi,_0x1ca651[_0x1d97('0xf9')]):_0x1d97('0x14d'),'XMD-QUEUE':_0x1ca651[_0x1d97('0x4a')]===_0x1d97('0x4b')?util[_0x1d97('0x7b')]('\x22%s,%s%s,,,%s\x22',_0x1ca651[_0x1d97('0x3b')],_0x1ca651[_0x1d97('0x14f')]||'',_0x1ca651[_0x1d97('0x150')]?'c':'',_0x1ca651[_0x1d97('0x151')]||0x3):_0x1d97('0x14d'),'XMD-CONTACTID':_0x5a02fe[_0x1d97('0x116')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x304f38[_0x1d97('0x23')][_0x4758db]['getCaller'](),'XMD-AMD':_0x1ca651[_0x1d97('0xe0')]?_0x1d97('0x152'):_0x1d97('0x14d'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x1ca651[_0x1d97('0xe0')]){_0x44d753[_0x1d97('0x153')]=_0x1ca651['dialAMDInitialSilence']||0x9c4;_0x44d753['XMD-AMDGREETING']=_0x1ca651['dialAMDGreeting']||0x5dc;_0x44d753[_0x1d97('0x154')]=_0x1ca651[_0x1d97('0x155')]||0x320;_0x44d753['XMD-AMDTOTALANALYSISTIME']=_0x1ca651[_0x1d97('0x156')]||0x1388;_0x44d753[_0x1d97('0x157')]=_0x1ca651[_0x1d97('0x158')]||0x64;_0x44d753[_0x1d97('0x159')]=_0x1ca651['dialAMDBetweenWordsSilence']||0x32;_0x44d753['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x1ca651[_0x1d97('0x15a')]||0x3;_0x44d753['XMD-AMDSILENCETHRESHOLD']=_0x1ca651[_0x1d97('0x15b')]||0x100;_0x44d753[_0x1d97('0x15c')]=_0x1ca651[_0x1d97('0x15d')]||0x1388;}if(_0x1ca651[_0x1d97('0x4a')]===_0x1d97('0x4b')){_0x44d753[_0x1d97('0x15e')]=_0x5a02fe[_0x1d97('0xd0')];}else{_0x44d753[_0x1d97('0x15f')]=_0x5a02fe[_0x1d97('0xd1')];}for(var _0xff0289 in _0x5a02fe[_0x1d97('0x149')]){if(_0x5a02fe['Contact'][_0x1d97('0x9b')](_0xff0289)){if(isNotNull(_0x5a02fe[_0x1d97('0x149')][_0xff0289])&&_0xff0289!=='id'&&_0xff0289!==_0x1d97('0x160')&&_0xff0289!==_0x1d97('0x161')&&_0xff0289!=='updatedAt'){_0x44d753[util[_0x1d97('0x7b')](_0x1d97('0x162'),_0x1d97('0x163'),_[_0x1d97('0x164')](_0xff0289))]=_0x5a02fe['Contact'][_0xff0289];}}}var _0x4bfece=_0x304f38[_0x1d97('0xd6')](_0x1ca651[_0x1d97('0x77')])?getCallerId(_0x1ca651[_0x1d97('0x77')][_0x1d97('0x165')],_0x1ca651[_0x1d97('0x166')],_0x1ca651[_0x1d97('0x167')]>0x0?getCallerIdRandom(_0x1ca651['dialOriginateCallerIdNumber'],_0x1ca651[_0x1d97('0x167')]):_0x1ca651[_0x1d97('0x5a')]):getCallerId(_[_0x1d97('0xad')](_0x1ca651['TrunkBackup'])?_0x1ca651[_0x1d97('0x77')][_0x1d97('0x165')]:_0x1ca651[_0x1d97('0x168')][_0x1d97('0x165')],_0x1ca651['dialOriginateCallerIdName'],_0x1ca651['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x1ca651['dialOriginateCallerIdNumber'],_0x1ca651[_0x1d97('0x167')]):_0x1ca651[_0x1d97('0x5a')]);if(_0x4bfece){_0x44d753['XMD-ORIGINATECALLERIDNAME']=_0x304f38[_0x1d97('0x23')][_0x4758db][_0x1d97('0x169')]=extractCalleridName(_0x4bfece);_0x44d753['XMD-ORIGINATECALLERIDNUM']=_0x304f38[_0x1d97('0x23')][_0x4758db][_0x1d97('0x16a')]=extractCalleridNumber(_0x4bfece);}return ami[_0x1d97('0xae')]({'actionid':_0x4758db,'action':_0x1d97('0x147'),'channel':_0x304f38[_0x1d97('0xd6')](_0x1ca651[_0x1d97('0x77')])?util[_0x1d97('0x7b')](_0x1d97('0x16b'),_0x1ca651[_0x1d97('0x77')]['name'],isNotNull(_0x1ca651[_0x1d97('0x5c')])?_0x1ca651['dialPrefix']['trim']()||'':'',_0x1ca651[_0x1d97('0x16c')]>0x0?_0x5a02fe[_0x1d97('0x149')]['phone']['substring'](_0x1ca651[_0x1d97('0x16c')]):_0x5a02fe[_0x1d97('0x149')]['phone']):util[_0x1d97('0x7b')](_0x1d97('0x16b'),_[_0x1d97('0xad')](_0x1ca651[_0x1d97('0x168')])?_0x1ca651['Trunk'][_0x1d97('0x3b')]:_0x1ca651[_0x1d97('0x168')][_0x1d97('0x3b')],isNotNull(_0x1ca651[_0x1d97('0x5c')])?_0x1ca651['dialPrefix'][_0x1d97('0x16d')]()||'':'',_0x1ca651[_0x1d97('0x16c')]>0x0?_0x5a02fe['Contact'][_0x1d97('0x14a')][_0x1d97('0x16e')](_0x1ca651[_0x1d97('0x16c')]):_0x5a02fe['Contact'][_0x1d97('0x14a')]),'callerid':_0x4bfece,'Exten':_0x1d97('0xdf'),'Context':_0x1d97('0x16f'),'Priority':'1','variable':_0x44d753,'timeout':(_0x1ca651[_0x1d97('0x5b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4758db})[_0x1d97('0xb6')](function(_0x2c53c8){return _0x494c7c(_0x2c53c8);})[_0x1d97('0xb0')](function(_0x38e70d){_0x1ca651[_0x1d97('0x65')]+=0x1;var _0x51d5af=new History(_0x304f38[_0x1d97('0x23')][_0x4758db]);logger['error'](util[_0x1d97('0x7b')]('[originateError]:\x20%s',JSON[_0x1d97('0x45')](_0x38e70d)));_0x51d5af[_0x1d97('0xa9')]=0xe;_0x51d5af[_0x1d97('0xaa')]=_0x1d97('0x170');_0x51d5af[_0x1d97('0x171')]=moment()[_0x1d97('0x7b')](_0x1d97('0xfa'));_0x51d5af[_0x1d97('0x172')]=_0x51d5af[_0x1d97('0x171')];_0x304f38[_0x1d97('0xc5')](_0x51d5af)[_0x1d97('0xb0')](loggerCatch(_0x1d97('0x173')));_0x304f38[_0x1d97('0xda')](_0x51d5af)['catch'](loggerCatch('[originate][error]'))[_0x1d97('0x1a')](function(){delete _0x304f38['actions'][_0x4758db];return _0x549166(msgResponse(_0x1d97('0x147'),_0x1d97('0x174'),_0x1d97('0x175')));});});});};Dialer[_0x1d97('0x18')][_0x1d97('0x2d')]=function(_0x25c2e8){var _0x5313a1=this[_0x1d97('0x23')][_0x25c2e8[_0x1d97('0x10a')]];var _0x15be90=this;if(_0x5313a1){delete this[_0x1d97('0x23')][_0x25c2e8[_0x1d97('0x10a')]];_0x5313a1[_0x1d97('0x176')]=moment()[_0x1d97('0x7b')](_0x1d97('0xfa'));var _0x2443b8=_0x5313a1[_0x1d97('0x4a')]===_0x1d97('0x7a')?this[_0x1d97('0x1e')][_0x5313a1[_0x1d97('0xb3')]]:this[_0x1d97('0x1d')][_0x5313a1[_0x1d97('0x177')]()];if(!this['isSuccess'](_0x25c2e8[_0x1d97('0x178')])){this[_0x1d97('0xb2')](_0x2443b8);return this['callProgressDetecting'](_0x5313a1,_0x2443b8,_0x25c2e8)[_0x1d97('0xb6')](function(_0x77994f){})['catch'](loggerCatch(_0x1d97('0x179')));}else{this[_0x1d97('0x24')][_0x25c2e8[_0x1d97('0xe3')]]=_0x5313a1;}}};Dialer[_0x1d97('0x18')][_0x1d97('0x17a')]=function(_0xa68aae,_0x22b499,_0x1fbc70){var _0x44d9da=new History(_0x22b499);if(_0x44d9da[_0x1d97('0x17b')]+_0x44d9da[_0x1d97('0x17c')]+_0x44d9da['countnoanswerretry']>=_0x1fbc70[_0x1d97('0x17d')]-0x1){return!![];}switch(_0xa68aae){case 0x3:if(_0x44d9da['countnoanswerretry']>=_0x1fbc70['dialNoAnswerMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x44d9da['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x1d97('0x17e')](_0x1fbc70[_0x1d97('0x17f')],_0x1d97('0x180'))['format'](_0x1d97('0xfa')),'ContactId':_0x44d9da[_0x1d97('0x116')],'ListId':_0x44d9da[_0x1d97('0xce')],'VoiceQueueId':_0x44d9da['VoiceQueueId']||undefined,'CampaignId':_0x44d9da[_0x1d97('0xd1')]||undefined})['catch'](loggerCatch(_0x1d97('0x181')));}break;case 0x5:if(_0x44d9da['countbusyretry']>=_0x1fbc70[_0x1d97('0x182')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countbusyretry':_0x44d9da[_0x1d97('0x17b')]+=0x1,'scheduledat':moment()[_0x1d97('0x17e')](_0x1fbc70[_0x1d97('0x183')],_0x1d97('0x180'))[_0x1d97('0x7b')](_0x1d97('0xfa')),'ContactId':_0x44d9da[_0x1d97('0x116')],'ListId':_0x44d9da[_0x1d97('0xce')],'VoiceQueueId':_0x44d9da[_0x1d97('0xd0')]||undefined,'CampaignId':_0x44d9da['CampaignId']||undefined})['catch'](loggerCatch(_0x1d97('0x184')));}break;case 0x8:if(_0x44d9da['countcongestionretry']>=_0x1fbc70['dialCongestionMaxRetry']-0x1){return!![];}else{this[_0x1d97('0xbe')]({'active':![],'countcongestionretry':_0x44d9da[_0x1d97('0x17c')]+=0x1,'scheduledat':moment()[_0x1d97('0x17e')](_0x1fbc70[_0x1d97('0x185')],_0x1d97('0x180'))[_0x1d97('0x7b')](_0x1d97('0xfa')),'ContactId':_0x44d9da[_0x1d97('0x116')],'ListId':_0x44d9da['ListId'],'VoiceQueueId':_0x44d9da[_0x1d97('0xd0')]||undefined,'CampaignId':_0x44d9da['CampaignId']||undefined})[_0x1d97('0xb0')](loggerCatch(_0x1d97('0x186')));}break;default:return!![];}};Dialer[_0x1d97('0x18')][_0x1d97('0x187')]=function(_0xab53c2,_0x21dac4,_0xbf2ea6){var _0xb47cb2=this;var _0x5bc449=new History(_0xab53c2);return new BPromise(function(_0x473c88,_0x4f5213){if(_['isUndefined'](_0x21dac4)&&_0x1d97('0x146')!==typeof _0x21dac4){return _0x4f5213(msgResponse('[callProgressDetecting]',_0x1d97('0x125'),_0x1d97('0x188')));}if(_[_0x1d97('0x38')](_0xbf2ea6)&&_0x1d97('0x146')!==typeof _0xbf2ea6){return _0x4f5213(msgResponse(_0x1d97('0x189'),_0x1d97('0x125'),_0x1d97('0x18a')));}switch(_0xbf2ea6[_0x1d97('0xf6')]){case'0':_0x21dac4['outboundNoSuchCallsDay']+=0x1;_0x5bc449[_0x1d97('0xa9')]=0x0;_0x5bc449[_0x1d97('0xaa')]=_0x1d97('0x18b');_0xb47cb2[_0x1d97('0xc5')](_0x5bc449)[_0x1d97('0xb0')](loggerCatch(_0x1d97('0x18c')));if(_0xb47cb2['checkRetriveMax'](0x0,_0xab53c2,_0x21dac4)){if(_0x5bc449[_0x1d97('0x17b')]+_0x5bc449[_0x1d97('0x17c')]+_0x5bc449[_0x1d97('0x18d')]>=_0x21dac4[_0x1d97('0x17d')]){_0xb47cb2['stateGlobal'](_0x5bc449,_0x473c88,_0x4f5213,'reason\x200\x20no\x20such\x20number....');}else{_0xb47cb2['createStateFinal'](_0x5bc449,_0x473c88,_0x4f5213,_0x1d97('0x18e'));}}break;case'3':_0x21dac4[_0x1d97('0x63')]+=0x1;_0x5bc449[_0x1d97('0xa9')]=0x3;_0x5bc449[_0x1d97('0xaa')]=_0x1d97('0x18f');_0x5bc449[_0x1d97('0x18d')]+=0x1;_0x5bc449[_0x1d97('0x190')]+=0x1;_0xb47cb2[_0x1d97('0xc5')](_0x5bc449)[_0x1d97('0xb0')](loggerCatch(_0x1d97('0x191')));if(_0xb47cb2[_0x1d97('0x17a')](0x3,_0xab53c2,_0x21dac4)){if(_0x5bc449[_0x1d97('0x18d')]>=_0x21dac4['dialNoAnswerMaxRetry']){_0xb47cb2[_0x1d97('0x192')](_0x5bc449,_0x473c88,_0x4f5213,_0x1d97('0x193'));}else{_0xb47cb2[_0x1d97('0x194')](_0x5bc449,_0x473c88,_0x4f5213,_0x1d97('0x193'));}}break;case'5':_0x21dac4[_0x1d97('0x5f')]+=0x1;_0x5bc449['state']=0x5;_0x5bc449[_0x1d97('0xaa')]=_0x1d97('0x195');_0x5bc449['countbusyretry']+=0x1;_0x5bc449[_0x1d97('0x190')]+=0x1;_0xb47cb2[_0x1d97('0xc5')](_0x5bc449)[_0x1d97('0xb0')](loggerCatch(_0x1d97('0x196')));if(_0xb47cb2[_0x1d97('0x17a')](0x5,_0xab53c2,_0x21dac4)){if(_0x5bc449[_0x1d97('0x17b')]>=_0x21dac4['dialBusyMaxRetry']){_0xb47cb2[_0x1d97('0x192')](_0x5bc449,_0x473c88,_0x4f5213,_0x1d97('0x197'));}else{_0xb47cb2['stateGlobal'](_0x5bc449,_0x473c88,_0x4f5213,'reason\x205\x20busy');}}break;case'8':_0x21dac4[_0x1d97('0x60')]+=0x1;_0x5bc449[_0x1d97('0xa9')]=0x8;_0x5bc449[_0x1d97('0xaa')]=_0x1d97('0x198');_0x5bc449['countcongestionretry']+=0x1;_0x5bc449['countglobal']+=0x1;_0xb47cb2['createHistory'](_0x5bc449)[_0x1d97('0xb0')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0xb47cb2[_0x1d97('0x17a')](0x8,_0xab53c2,_0x21dac4)){if(_0x5bc449['countcongestionretry']>=_0x21dac4['dialCongestionMaxRetry']){_0xb47cb2[_0x1d97('0x192')](_0x5bc449,_0x473c88,_0x4f5213,_0x1d97('0x199'));}else{_0xb47cb2[_0x1d97('0x194')](_0x5bc449,_0x473c88,_0x4f5213,_0x1d97('0x199'));}}break;default:_0x21dac4['outboundUnknownCallsDay']+=0x1;_0x5bc449[_0x1d97('0xa9')]=0xc;_0x5bc449[_0x1d97('0xaa')]=_0xbf2ea6[_0x1d97('0xf6')];_0xb47cb2['createHistory'](_0x5bc449)[_0x1d97('0xb0')](loggerCatch(_0x1d97('0x19a')));if(_0xb47cb2[_0x1d97('0x17a')](_0xbf2ea6[_0x1d97('0xf6')],_0xab53c2,_0x21dac4)){if(_0x5bc449[_0x1d97('0x17b')]+_0x5bc449['countcongestionretry']+_0x5bc449['countnoanswerretry']>=_0x21dac4[_0x1d97('0x17d')]){_0xb47cb2[_0x1d97('0x194')](_0x5bc449,_0x473c88,_0x4f5213,_0xbf2ea6[_0x1d97('0xf6')]);}else{_0xb47cb2[_0x1d97('0x192')](_0x5bc449,_0x473c88,_0x4f5213,_0xbf2ea6[_0x1d97('0xf6')]);}}}});};Dialer[_0x1d97('0x18')][_0x1d97('0x194')]=function(_0x1c4b51,_0x2222d5,_0x24d7f8,_0x20098c){var _0x5123c0=new Final(_0x1c4b51);_0x5123c0['state']=0xf;_0x5123c0[_0x1d97('0xaa')]=_0x1d97('0x19b');this[_0x1d97('0x192')](_0x5123c0,_0x2222d5,_0x24d7f8,_0x20098c);};Dialer[_0x1d97('0x18')]['createStateFinal']=function(_0x3ea24e,_0x1d0687,_0x55e277,_0x4a8082){this[_0x1d97('0xda')](_0x3ea24e)[_0x1d97('0xb6')](function(_0x275e14){return _0x1d0687(msgResponse(_0x1d97('0x189'),'Success',_0x4a8082));})[_0x1d97('0xb0')](function(_0x36d44b){return _0x55e277(msgResponse('[moveContactManagedDialer][0]',_0x1d97('0x125'),_0x1d97('0x19c')));});};Dialer['prototype'][_0x1d97('0x5')]=function(_0x4f558c){var _0x4c8a12=this;var _0x3fbfc7=_0x4f558c[_0x1d97('0x19d')]/0x64;var _0x496f2a=_0x4f558c[_0x1d97('0x101')]/(_0x4f558c[_0x1d97('0x101')]+_0x4f558c[_0x1d97('0x5d')]);var _0x565b13=Math[_0x1d97('0x19e')](_0x4f558c[_0x1d97('0x71')]*(_0x4f558c[_0x1d97('0x19f')]/0x64));var _0x2f614e=Math[_0x1d97('0x19e')](_0x4f558c[_0x1d97('0x71')]*(_0x4f558c[_0x1d97('0x1a0')]/0x64));var _0x57ff6c=_0x4f558c['available']+_0x4f558c[_0x1d97('0x53')];var _0x2c6ccb=Math[_0x1d97('0x1a1')](_0x4f558c[_0x1d97('0x74')]*_0x4f558c[_0x1d97('0x8e')]*_0x4f558c[_0x1d97('0x1a2')]*_0x4f558c[_0x1d97('0x6f')]);if(_[_0x1d97('0x38')](_0x4f558c[_0x1d97('0x76')])){if(!_[_0x1d97('0x38')](_0x4f558c[_0x1d97('0x26')])){_0x4f558c[_0x1d97('0x26')]=undefined;loggerPredictive[_0x1d97('0x98')](_0x1d97('0x1a3'),_0x1d97('0x1a4'));}if(!_['isUndefined'](_0x4f558c[_0x1d97('0x94')])){loggerPredictive[_0x1d97('0x98')](_0x1d97('0x1a3'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x4f558c[_0x1d97('0x94')]);_0x4f558c['handlePredictive']=undefined;}_0x4f558c[_0x1d97('0x76')]=moment()['format'](_0x1d97('0xfa'));loggerPredictive[_0x1d97('0x7e')](_0x4f558c[_0x1d97('0x3b')],'collection\x20data\x20in\x20progressive\x20at',_0x4f558c[_0x1d97('0x76')]);this[_0x1d97('0x138')](_0x4f558c,0x1);}else if(ifInterval(_0x4f558c[_0x1d97('0x1a5')],_0x4f558c[_0x1d97('0x76')])){this['handlePower'](_0x4f558c,0x1);loggerPredictiveCalls[_0x1d97('0x7e')](_0x1d97('0x1a6'),_0x4f558c[_0x1d97('0x76')],_0x4f558c['name']);_0x4f558c[_0x1d97('0x74')]=0x0;_0x4f558c[_0x1d97('0x6e')]=0x0;}else if(_0x3fbfc7<_0x496f2a&&_0x4f558c[_0x1d97('0x1a7')]===_0x1d97('0x1a8')){freeVariablesPredictive(_0x4f558c);loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x1a9'),_0x1d97('0x1aa'),_0x496f2a,_0x1d97('0x76'),_0x4f558c[_0x1d97('0x3b')]);}else if(_0x2c6ccb<_0x4f558c[_0x1d97('0x6e')]&&_0x4f558c[_0x1d97('0x1a7')]===_0x1d97('0x1a8')){freeVariablesPredictive(_0x4f558c);loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x1ab'),_0x1d97('0x1ac'),_0x2c6ccb,_0x1d97('0x1ad'),_0x4f558c['predictiveIntervalErlangCallsDroppedCalls'],_0x1d97('0x76'),_0x4f558c['name']);}else if(!ifInterval(_0x4f558c[_0x1d97('0x1a5')],_0x4f558c['startProgressive'])&&_[_0x1d97('0x38')](_0x4f558c[_0x1d97('0x26')])&&!_['isUndefined'](_0x4f558c['startProgressive'])){_0x4f558c[_0x1d97('0x26')]=moment()[_0x1d97('0x7b')](_0x1d97('0xfa'));loggerPredictive['info'](_0x4f558c[_0x1d97('0x3b')],_0x1d97('0x1ae'),_0x4f558c[_0x1d97('0x26')]);this[_0x1d97('0xbb')](_0x4f558c[_0x1d97('0x1a5')])[_0x1d97('0xb6')](this[_0x1d97('0x1af')](_0x4f558c))[_0x1d97('0xb6')](mergeDataErlangB(_0x4f558c))[_0x1d97('0xb6')](this[_0x1d97('0x1b0')](_0x4f558c))[_0x1d97('0xb0')](loggerCatchPredictive(_0x1d97('0x1b1'),_0x4f558c));}else if(!ifInterval(_0x4f558c[_0x1d97('0x1a5')],_0x4f558c['startPredictive'])){_0x4f558c[_0x1d97('0x6e')]=0x0;_0x4f558c[_0x1d97('0x26')]=moment()[_0x1d97('0x7b')](_0x1d97('0xfa'));loggerPredictive[_0x1d97('0x7e')](_0x4f558c[_0x1d97('0x3b')],_0x1d97('0x1b2'),_0x4f558c[_0x1d97('0x26')]);clearInterval(_0x4f558c[_0x1d97('0x94')]);_0x4f558c[_0x1d97('0x94')]=undefined;this[_0x1d97('0xbb')](_0x4f558c[_0x1d97('0x1a5')])[_0x1d97('0xb6')](this[_0x1d97('0x1af')](_0x4f558c))['then'](mergeDataErlangB(_0x4f558c))[_0x1d97('0xb6')](this[_0x1d97('0x1b0')](_0x4f558c))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x4f558c));}else if(_0x4f558c[_0x1d97('0x71')]&&_0x57ff6c<_0x4f558c[_0x1d97('0x71')]-_0x2f614e){freeVariablesPredictive(_0x4f558c);loggerPredictive[_0x1d97('0x7e')](_0x4f558c[_0x1d97('0x3b')],_0x1d97('0x1b3'),_0x57ff6c,_0x1d97('0x1b4'),_0x4f558c[_0x1d97('0x71')],'-',_0x2f614e,'=',_0x4f558c[_0x1d97('0x71')]-_0x2f614e,')');}else if(_0x4f558c[_0x1d97('0x71')]&&_0x57ff6c>_0x4f558c[_0x1d97('0x71')]+_0x565b13){freeVariablesPredictive(_0x4f558c);loggerPredictive[_0x1d97('0x7e')](_0x4f558c[_0x1d97('0x3b')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x57ff6c,_0x1d97('0x1b5'),_0x4f558c[_0x1d97('0x71')],'+',_0x565b13,'=',_0x4f558c['predictiveIntervalAvailable']+_0x565b13,')');}};Dialer[_0x1d97('0x18')][_0x1d97('0x1af')]=function(_0x110015){var _0xfe30c0=this;return function(_0x41845c){return new BPromise(function(_0x42e9d6,_0x58112a){_[_0x1d97('0x1b6')](_0x110015,_0x41845c[0x0]);if(checkGetDataPredictive(_0x41845c[0x0])){var _0x5358b5=_0x110015[_0x1d97('0x71')]=_0x110015[_0x1d97('0x53')]+_0x110015[_0x1d97('0x4e')];var _0x35927a=_0x110015[_0x1d97('0x1a5')]*0x3c;var _0x1490e0=_0x41845c[0x0]['predictiveIntervalAvgTalktime']+_0x41845c[0x0]['predictiveIntervalAvgHoldtime'];var _0x43705f=(_0x41845c[0x0][_0x1d97('0x69')]+_0x41845c[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x41845c[0x0][_0x1d97('0x84')])/_0x41845c[0x0]['predictiveIntervalTotalCalls'];_0x110015[_0x1d97('0x1a2')]=_0x43705f>0x0?_0x43705f:0x1;switch(_0x110015[_0x1d97('0x1a7')]){case'dropRate':var _0x2d4d93=_0x110015[_0x1d97('0x19d')]/0x64;return _0xfe30c0[_0x1d97('0x1b7')](_0x5358b5,_0x35927a,_0x1490e0,_0x43705f,_0x2d4d93)[_0x1d97('0xb6')](function(_0x1f38c5){return _0x42e9d6(_0x1f38c5);});case _0x1d97('0x1b8'):var _0x3c84a7=_0x110015[_0x1d97('0x19d')]/0x64;return _0xfe30c0[_0x1d97('0x1b9')](_0x5358b5,_0x35927a,_0x1490e0,_0x43705f,_0x3c84a7)[_0x1d97('0xb6')](function(_0x3a0e50){return _0x42e9d6(_0x3a0e50);});default:return _0x58112a(msgResponse(_0x1d97('0x1ba'),_0x1d97('0x125'),_0x1d97('0x1bb')));}}else{return _0x58112a(msgResponse('[getDataPredictive]',_0x1d97('0x125'),_0x1d97('0x1bc')));}});};};Dialer[_0x1d97('0x18')][_0x1d97('0x1bd')]=function(_0x28fd77){var _0x3e7bab=this;return function(_0x1927ce){return new BPromise(function(_0x8664f5,_0x2103f8){_['merge'](_0x28fd77,_0x1927ce[0x0]);if(checkGetDataPredictive(_0x1927ce[0x0])){loggerPredictive[_0x1d97('0x7e')](JSON['stringify'](_0x1927ce[0x0]));if(_0x28fd77[_0x1d97('0x1a7')]===_0x1d97('0x1a8')){return _0x3e7bab['getVoiceQueueRtPauses'](_0x28fd77['id'])[_0x1d97('0xb6')](function(_0x768f70){var _0x3dbb0b=_0x28fd77[_0x1d97('0x4f')]-_0x768f70[0x0][_0x1d97('0x1be')];var _0x3aeb10=_0x28fd77[_0x1d97('0x1a5')]*0x3c;var _0x4825b7=_0x1927ce[0x0][_0x1d97('0x6b')]+_0x1927ce[0x0][_0x1d97('0x6a')];var _0x4528d7=(_0x1927ce[0x0][_0x1d97('0x69')]+_0x1927ce[0x0][_0x1d97('0x6c')]+_0x1927ce[0x0][_0x1d97('0x84')])/_0x1927ce[0x0][_0x1d97('0x72')];var _0x22123=_0x28fd77['dialPredictiveOptimizationPercentage']/0x64;_0x28fd77[_0x1d97('0x70')]=_0x768f70[0x0][_0x1d97('0x1be')]||0x0;_0x28fd77[_0x1d97('0x1a2')]=_0x4528d7>0x0?_0x4528d7:0x1;return _0x3e7bab[_0x1d97('0x1b7')](_0x3dbb0b,_0x3aeb10,_0x4825b7,_0x4528d7,_0x22123);})[_0x1d97('0xb6')](function(_0xf81028){return _0x8664f5(_0xf81028);})[_0x1d97('0xb0')](function(_0x2c27cf){return _0x2103f8(msgResponse('[CatchErlangB]',_0x1d97('0x125'),JSON[_0x1d97('0x45')](_0x2c27cf)));});}if(_0x28fd77[_0x1d97('0x1a7')]===_0x1d97('0x1b8')){return _0x3e7bab[_0x1d97('0xc2')](_0x28fd77['id'])[_0x1d97('0xb6')](function(_0x178b1d){var _0x38037c=_0x28fd77[_0x1d97('0x4f')]-_0x178b1d[0x0][_0x1d97('0x1be')];var _0x48421a=_0x28fd77[_0x1d97('0x1a5')]*0x3c;var _0x48cca2=_0x1927ce[0x0][_0x1d97('0x6b')]+_0x1927ce[0x0][_0x1d97('0x6a')];var _0x3b6edc=(_0x1927ce[0x0]['predictiveIntervalAnsweredCalls']+_0x1927ce[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1927ce[0x0][_0x1d97('0x84')])/_0x1927ce[0x0][_0x1d97('0x72')];var _0x42dcec=_0x28fd77[_0x1d97('0x19d')]/0x64;_0x28fd77[_0x1d97('0x70')]=_0x178b1d[0x0][_0x1d97('0x1be')]||0x0;_0x28fd77[_0x1d97('0x1a2')]=_0x3b6edc>0x0?_0x3b6edc:0x1;return _0x3e7bab['busyFactor'](_0x38037c,_0x48421a,_0x48cca2,_0x3b6edc,_0x42dcec);})[_0x1d97('0xb6')](function(_0x1d73f7){return _0x8664f5(_0x1d73f7);})['catch'](function(_0x5e41d6){return _0x2103f8(msgResponse(_0x1d97('0x1bf'),_0x1d97('0x125'),JSON[_0x1d97('0x45')](_0x5e41d6)));});}}else{return _0x2103f8(msgResponse(_0x1d97('0x1ba'),_0x1d97('0x125'),_0x1d97('0x1bc')));}});};};Dialer[_0x1d97('0x18')]['startMethodPredictive']=function(_0xdcee8c){var _0x354703=this;return function(){var _0x3b2215=0x0;var _0x4ded20=Math['floor'](_0xdcee8c[_0x1d97('0x75')]*0x3e8);if(_0x4ded20>0x0){_0x4ded20=_0x4ded20<0x64?0x64:_0x4ded20;loggerPredictive[_0x1d97('0x7e')](_0xdcee8c[_0x1d97('0x3b')],_0x1d97('0x1c0'),_0x4ded20,_0x1d97('0x46'));_0xdcee8c['handlePredictive']=setInterval(function(){_0x354703[_0x1d97('0x94')](_0xdcee8c);loggerPredictiveCalls[_0x1d97('0x7e')](_0x1d97('0x1c1'),_0x3b2215+=0x1);},_0x4ded20);}else{loggerPredictive[_0x1d97('0x7e')](_0xdcee8c[_0x1d97('0x3b')],_0x1d97('0x1c2'));}};};Dialer['prototype'][_0x1d97('0x1c3')]=function(_0x5c2005,_0xba5f87){var _0x770741=this;return function(_0x12e2fb){if(_['isEmpty'](_0x12e2fb)){if(_['isNil'](_0xba5f87[_0x1d97('0xcf')])||!_0xba5f87[_0x1d97('0x1c4')]){if(_0x5c2005[_0x1d97('0x59')]==='booked'){_0x5c2005[_0x1d97('0x111')]=_[_0x1d97('0x38')](_0x5c2005[_0x1d97('0x111')])?!![]:_0x5c2005[_0x1d97('0x111')];var _0x5d6684=uuid['v4']();_0x770741[_0x1d97('0x23')][_0x5d6684]=new Action(_0x5c2005,_0xba5f87,_0x5d6684);loggerBooked[_0x1d97('0x7e')](_0x1d97('0x1c5'),_0x5d6684,'queueStatusComplete:\x20',JSON[_0x1d97('0x45')](_0x5c2005[_0x1d97('0x111')]),_0x1d97('0x1c6'),_0x5c2005['name']);if(_0x5c2005[_0x1d97('0x111')]){_0x5c2005[_0x1d97('0x111')]=![];_0x770741['queueBooked'][_0x770741['actions'][_0x5d6684]['queue']]=[];ami[_0x1d97('0xae')]({'actionid':_0x5d6684,'action':_0x1d97('0x1c7'),'queue':_0x5c2005[_0x1d97('0x3b')]})[_0x1d97('0xb0')](function(_0x2fe07d){_0x770741[_0x1d97('0xb2')](_0x5c2005);_0x770741[_0x1d97('0xbe')]({'active':![],'ContactId':_0x770741[_0x1d97('0x23')][_0x5d6684][_0x1d97('0x116')],'ListId':_0x770741['actions'][_0x5d6684]['ListId'],'VoiceQueueId':_0x770741['actions'][_0x5d6684][_0x1d97('0xd0')]||undefined,'CampaignId':_0x770741[_0x1d97('0x23')][_0x5d6684][_0x1d97('0xd1')]||undefined})[_0x1d97('0xb0')](loggerCatch(_0x1d97('0x1c8')));delete _0x770741[_0x1d97('0x23')][_0x5d6684];});}else{loggerBooked[_0x1d97('0x7e')]('[booked][checkContactBlack][else]',JSON[_0x1d97('0x45')](_0x5c2005[_0x1d97('0x111')]),_0x1d97('0x1c6'),_0x5c2005['name']);_0x770741[_0x1d97('0xb2')](_0x5c2005);_0x770741[_0x1d97('0xbe')]({'active':![],'ContactId':_0x770741[_0x1d97('0x23')][_0x5d6684][_0x1d97('0x116')],'ListId':_0x770741[_0x1d97('0x23')][_0x5d6684][_0x1d97('0xce')],'VoiceQueueId':_0x770741[_0x1d97('0x23')][_0x5d6684][_0x1d97('0xd0')]||undefined,'CampaignId':_0x770741[_0x1d97('0x23')][_0x5d6684]['CampaignId']||undefined})[_0x1d97('0xb0')](loggerCatch(_0x1d97('0x1c8')));delete _0x770741[_0x1d97('0x23')][_0x5d6684];}}else{return _0x770741['actionOriginate'](_0x5c2005,_0xba5f87);}}else{if(getDiff(_0xba5f87[_0x1d97('0x1c9')])<_0x5c2005['dialRecallMeTimeout']*0x3c){_0x770741[_0x1d97('0x1c')][_0x1d97('0x114')](_0xba5f87['id'])['finally'](function(){_0x770741['updateOriginated'](_0x5c2005);});}else{_0x5c2005['outboundReCallsDay']+=0x1;_0x770741[_0x1d97('0xb2')](_0x5c2005);if(_0x5c2005[_0x1d97('0x1ca')]){_0x770741[_0x1d97('0xbe')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xba5f87[_0x1d97('0x116')],'ListId':_0xba5f87[_0x1d97('0xce')],'VoiceQueueId':_0xba5f87[_0x1d97('0xd0')]||undefined,'CampaignId':_0xba5f87[_0x1d97('0xd1')]||undefined})[_0x1d97('0xb0')](loggerCatch(_0x1d97('0x1cb')));_0x770741['createHistory'](createObjHistory(_0x5c2005,_0xba5f87,'RECALLINQUEUE',0x17,_0x1d97('0x1cc')))['catch'](loggerCatch(_0x1d97('0x1cd')));}else{_0x770741['saveInDb'](createObjHistory(_0x5c2005,_0xba5f87,_0x1d97('0x1ce'),0x16,_0x1d97('0x1cf')),_0x1d97('0x1d0'),_0x1d97('0x1d1'));}}}}else{_0x5c2005[_0x1d97('0x5e')]+=0x1;_0x770741[_0x1d97('0xcc')](createObjHistory(_0x5c2005,_0xba5f87,_0x1d97('0x1d2'),0xd,_0x1d97('0x1d3')),_0x1d97('0x1d4'),'[Originate][MoveBlacklist]');throw _0x1d97('0x1d5');}};};Dialer[_0x1d97('0x18')][_0x1d97('0x1d6')]=function(_0x136ba1){var _0xfac901=this;var _0x24c754=[];var _0x39bf43=_0x136ba1[_0x1d97('0x1d7')]-_0x136ba1[_0x1d97('0x73')]-_0x136ba1[_0x1d97('0x1d8')];emitCampaignSummary(_0x136ba1);if(_0x39bf43>0x0){if(_0x39bf43>this[_0x1d97('0x21')]){_0x39bf43=this[_0x1d97('0x21')];}_0x136ba1[_0x1d97('0x1d8')]+=_0x39bf43;this[_0x1d97('0xc1')](_0x136ba1['id'],_0x39bf43,_0x136ba1[_0x1d97('0x1d9')])['then'](function(_0x247ad6){_0x136ba1[_0x1d97('0x1d8')]-=_0x39bf43;_0x136ba1[_0x1d97('0x1d8')]=_0x136ba1[_0x1d97('0x1d8')]>0x0?_0x136ba1['temp']:0x0;if(!checkContactEmpty(_0x247ad6)){_0x136ba1['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0x1d97('0x7e')]('[getContactCampaign2][Empty]'+_0x136ba1[_0x1d97('0x3b')]);}else{_0x136ba1[_0x1d97('0x73')]+=_0x247ad6[_0x1d97('0x9a')];_0x136ba1[_0x1d97('0x39')]=_0x1d97('0x1da');for(var _0xe839bb=0x0;_0xe839bb<_0x247ad6[_0x1d97('0x9a')];_0xe839bb+=0x1){_0x136ba1[_0x1d97('0x1db')]+=0x1;if(_['isNil'](_0x247ad6[_0xe839bb])||_['isNil'](_0x247ad6[_0xe839bb][_0x1d97('0x149')])||_[_0x1d97('0xad')](_0x247ad6[_0xe839bb]['Contact'][_0x1d97('0x14a')])){_0xfac901[_0x1d97('0xca')]('[actionOriginate]\x20',_0x136ba1,_0x247ad6[_0xe839bb]);}else{_0xfac901['checkIsBlackListIvr'](_[_0x1d97('0xcd')](_0x247ad6[_0xe839bb],[_0x1d97('0xd1'),_0x1d97('0x1dc')]))['then'](_0xfac901[_0x1d97('0x1c3')](_0x136ba1,_0x247ad6[_0xe839bb]))[_0x1d97('0xb0')](_0xfac901[_0x1d97('0xc9')](_0x1d97('0x1dd'),_0x136ba1));}}}})[_0x1d97('0xb0')](loggerGetContactDialer(_0x1d97('0x1de'),_0x136ba1,_0x39bf43));}};Dialer[_0x1d97('0x18')]['handlePower']=function(_0xeb899,_0x24cc63){var _0x1e9655=this;var _0x90cc4=[];var _0x5cb6bb=_0x24cc63>=0x1?_0x24cc63:0x1;var _0x2e3b81=[];if(_0xeb899[_0x1d97('0x59')]===_0x1d97('0x13b')){_0x5cb6bb=0x1;}var _0x1dc107=Math['floor'](_0xeb899[_0x1d97('0x4e')]*_0x5cb6bb)-_0xeb899[_0x1d97('0x73')]-_0xeb899['temp'];emitVoiceQueueSummary(_0xeb899);if(_0xeb899[_0x1d97('0x1df')]>0x0){var _0xce5a92=_0xeb899['dialLimitQueue']-_0xeb899['originated']-_0xeb899[_0x1d97('0x53')]-_0xeb899[_0x1d97('0x1d8')]-_0xeb899[_0x1d97('0x50')];if(_0x1dc107>_0xce5a92){_0x1dc107=_0xce5a92;}}if(_0x1dc107>0x0){if(_0xeb899[_0x1d97('0x59')]===_0x1d97('0x13b')){_0x1dc107=0x1;}if(_0x1dc107>this['maxNumberOriginate']){_0x1dc107=this[_0x1d97('0x21')];}_0xeb899[_0x1d97('0x1d8')]+=_0x1dc107;for(var _0x501895 in this[_0x1d97('0x1f')]){if(this[_0x1d97('0x1f')][_0x1d97('0x9b')](_0x501895)){if(this[_0x1d97('0x1f')][_0x501895][_0x1d97('0xa9')]===_0x1d97('0x1e0')&&this['agents'][_0x501895][_0x1d97('0xaf')]===_0x1d97('0xd8')){_0x90cc4['push'](this['agents'][_0x501895]['id']);}}}this[_0x1d97('0xc0')](_0xeb899['id'],_0x90cc4,_0x1dc107,_0xeb899[_0x1d97('0x1d9')])['then'](function(_0x44a78f){_0xeb899[_0x1d97('0x1d8')]-=_0x1dc107;_0xeb899['temp']=_0xeb899[_0x1d97('0x1d8')]>0x0?_0xeb899[_0x1d97('0x1d8')]:0x0;if(!checkContactEmpty(_0x44a78f)){_0x1e9655['countReScheduled'](_0xeb899)[_0x1d97('0xb6')](sendMessageReschedule(_0xeb899))[_0x1d97('0xb0')](loggerCatch(_0x1d97('0xb7')));}else{_0xeb899[_0x1d97('0x73')]+=_0x44a78f[_0x1d97('0x9a')];_0xeb899[_0x1d97('0x39')]=_0xeb899[_0x1d97('0x59')]===_0x1d97('0x13b')?_0x1d97('0x152'):_0x1d97('0x1da');for(var _0x432c87=0x0;_0x432c87<_0x44a78f['length'];_0x432c87+=0x1){if(_[_0x1d97('0xad')](_0x44a78f[_0x432c87])||_[_0x1d97('0xad')](_0x44a78f[_0x432c87][_0x1d97('0x149')])||_[_0x1d97('0xad')](_0x44a78f[_0x432c87][_0x1d97('0x149')][_0x1d97('0x14a')])){_0x1e9655[_0x1d97('0xca')](_0x1d97('0x1e1'),_0xeb899,_0x44a78f[_0x432c87]);}else{_0x1e9655[_0x1d97('0xb8')](_[_0x1d97('0xcd')](_0x44a78f[_0x432c87],[_0x1d97('0xd0'),_0x1d97('0x1dc')]))[_0x1d97('0xb6')](_0x1e9655[_0x1d97('0x1c3')](_0xeb899,_0x44a78f[_0x432c87]))[_0x1d97('0xb0')](_0x1e9655[_0x1d97('0xc9')]('[actionOriginate]\x20',_0xeb899));}}}})[_0x1d97('0xb0')](loggerGetContactDialer(_0x1d97('0x1e2'),_0xeb899,_0x1dc107));}};Dialer[_0x1d97('0x18')]['handlePredictive']=function(_0x235e9a){var _0x3028e6=this;if(_0x235e9a[_0x1d97('0x1df')]>0x0){var _0x5d1074=_0x235e9a[_0x1d97('0x1df')]-_0x235e9a[_0x1d97('0x73')]-_0x235e9a[_0x1d97('0x53')];if(_0x5d1074>0x0){this[_0x1d97('0x1e3')](_0x235e9a);}else{loggerPredictiveCalls['info'](_0x1d97('0x1e4'));}}else{this[_0x1d97('0x1e3')](_0x235e9a);}};Dialer[_0x1d97('0x18')][_0x1d97('0x1e3')]=function(_0x1ca8bc){var _0x155ad6=this;var _0x4f3873=[];_0x1ca8bc['originated']+=0x1;for(var _0x239821 in this['agents']){if(this['agents'][_0x1d97('0x9b')](_0x239821)){if(this[_0x1d97('0x1f')][_0x239821][_0x1d97('0xa9')]===_0x1d97('0x1e0')&&this[_0x1d97('0x1f')][_0x239821][_0x1d97('0xaf')]==='reachable'){_0x4f3873[_0x1d97('0x10f')](this[_0x1d97('0x1f')][_0x239821]['id']);}}}this[_0x1d97('0xc0')](_0x1ca8bc['id'],_0x4f3873,0x1,_0x1ca8bc[_0x1d97('0x1d9')])[_0x1d97('0xb6')](function(_0x46a917){if(!checkContactEmpty(_0x46a917)){checkContactLowerLimitOriginate(_0x1ca8bc,0x1,0x0);_0x155ad6['countReScheduled'](_0x1ca8bc)[_0x1d97('0xb6')](sendMessageReschedule(_0x1ca8bc))['catch'](loggerCatch(_0x1d97('0xb7')));}else{_0x1ca8bc[_0x1d97('0x39')]=_0x1d97('0x1da');if(_[_0x1d97('0xad')](_0x46a917[0x0])||_[_0x1d97('0xad')](_0x46a917[0x0][_0x1d97('0x149')])||_[_0x1d97('0xad')](_0x46a917[0x0][_0x1d97('0x149')][_0x1d97('0x14a')])){_0x155ad6['emptyContact']('[actionOriginate]\x20',_0x1ca8bc,_0x46a917[0x0]);}else{_0x155ad6[_0x1d97('0xb8')](_[_0x1d97('0xcd')](_0x46a917[0x0],[_0x1d97('0xd0'),_0x1d97('0x1dc')]))[_0x1d97('0xb6')](_0x155ad6[_0x1d97('0x1c3')](_0x1ca8bc,_0x46a917[0x0]))['catch'](_0x155ad6[_0x1d97('0xc9')](_0x1d97('0x1e5'),_0x1ca8bc));}}})['catch'](loggerGetContactDialer(_0x1d97('0x1e6'),_0x1ca8bc,0x1));emitVoiceQueueSummary(_0x1ca8bc);};Dialer[_0x1d97('0x18')]['abandonmentRate']=function(_0x1ee2d4,_0xbc77be,_0x5e4ca3,_0x55c7ce,_0x2b0efd,_0x2d0ee7){loggerPredictive[_0x1d97('0x7e')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1ee2d4);loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x1e7'),_0xbc77be);loggerPredictive['info']('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',_0x5e4ca3);loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x1e8'),_0x55c7ce);loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x1e9'),_0x2b0efd);loggerPredictive[_0x1d97('0x7e')]('---------------------------');return new BPromise(function(_0x303f29,_0x3a852e){if(_0x1ee2d4<=0x0||isNaN(_0x1ee2d4)){return _0x3a852e(msgResponse('[abandonmentRate]',_0x1d97('0x174'),_0x1d97('0x1ea')+_0x1ee2d4));}if(_0x5e4ca3<=0x0||isNaN(_0x5e4ca3)){return _0x3a852e(msgResponse(_0x1d97('0x1eb'),_0x1d97('0x174'),_0x1d97('0x1ec')+_0x5e4ca3));}if(_0x55c7ce<=0x0||isNaN(_0x55c7ce)){return _0x3a852e(msgResponse('[abandonmentRate]',_0x1d97('0x174'),'p\x20=\x20'+_0x55c7ce));}if(_0xbc77be<=0x0||isNaN(_0xbc77be)){return _0x3a852e(msgResponse(_0x1d97('0x1eb'),'Error','interval\x20=\x20'+_0xbc77be));}if(_0x2b0efd<=0x0||isNaN(_0x2b0efd)){return _0x3a852e(msgResponse(_0x1d97('0x1eb'),_0x1d97('0x174'),_0x1d97('0x1ed')+_0x2b0efd));}_0x2d0ee7=_0x2d0ee7||0x0;var _0x4a0897=0x1/_0x5e4ca3;var _0xa2e181=0x0;var _0x377409=0x0;var _0x241e8c=0x0;var _0xe312dd=0x0;for(var _0x35d7fa=0x0;_0x241e8c<_0x2b0efd;_0x35d7fa+=0x1){_0x377409=_0x35d7fa/_0xbc77be;_0xa2e181=(_0x55c7ce*_0x377409+_0x2d0ee7)/_0x4a0897;_0x241e8c=erlangb(_0xa2e181,_0x1ee2d4);_0xe312dd=_0xa2e181/_0x1ee2d4*(0x1-erlangb(_0xa2e181,_0x1ee2d4));}return _0x303f29({'erlangCalls':_0x35d7fa,'erlangCallToSecond':_0xbc77be/_0x35d7fa,'erlangAbandonmentRate':_0x241e8c,'erlangBusyFactor':_0xe312dd});});};Dialer['prototype']['busyFactor']=function(_0xd7f3d7,_0x560f6f,_0x4b228d,_0x2e0241,_0x237c48,_0x15cec1){loggerPredictive[_0x1d97('0x7e')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x1ee'),_0xd7f3d7);loggerPredictive[_0x1d97('0x7e')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x560f6f);loggerPredictive[_0x1d97('0x7e')]('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',_0x4b228d);loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x1e8'),_0x2e0241);loggerPredictive[_0x1d97('0x7e')](_0x1d97('0x1ef'),_0x237c48);loggerPredictive[_0x1d97('0x7e')]('---------------------------');return new BPromise(function(_0x41dd3e,_0x3335a8){if(_0xd7f3d7<=0x0||isNaN(_0xd7f3d7)){return _0x3335a8(msgResponse(_0x1d97('0x1f0'),'Error',_0x1d97('0x1ea')+_0xd7f3d7));}if(_0x4b228d<=0x0||isNaN(_0x4b228d)){return _0x3335a8(msgResponse(_0x1d97('0x1f0'),_0x1d97('0x174'),_0x1d97('0x1ec')+_0x4b228d));}if(_0x2e0241<=0x0||isNaN(_0x2e0241)){return _0x3335a8(msgResponse('[busyFactor]',_0x1d97('0x174'),'p\x20=\x20'+_0x2e0241));}if(_0x560f6f<=0x0||isNaN(_0x560f6f)){return _0x3335a8(msgResponse('[busyFactor]',_0x1d97('0x174'),'interval\x20=\x20'+_0x560f6f));}if(_0x237c48<=0x0||isNaN(_0x237c48)){return _0x3335a8(msgResponse(_0x1d97('0x1f0'),_0x1d97('0x174'),_0x1d97('0x1f1')+_0x237c48));}_0x15cec1=_0x15cec1||0x0;var _0x53d37f=0x1/_0x4b228d;var _0x1d2487=0x0;var _0x1c3fe1=0x0;var _0x2925fc=0x0;var _0x27b8b0=0x0;for(var _0x2b0f38=0x0;_0x27b8b0<_0x237c48;_0x2b0f38+=0x1){_0x1c3fe1=_0x2b0f38/_0x560f6f;_0x1d2487=(_0x2e0241*_0x1c3fe1+_0x15cec1)/_0x53d37f;_0x2925fc=erlangb(_0x1d2487,_0xd7f3d7);_0x27b8b0=_0x1d2487/_0xd7f3d7*(0x1-erlangb(_0x1d2487,_0xd7f3d7));}return _0x41dd3e({'erlangCalls':_0x2b0f38,'erlangCallToSecond':_0x560f6f/_0x2b0f38,'erlangAbandonmentRate':_0x2925fc,'erlangBusyFactor':_0x27b8b0});});};module['exports']=Dialer; \ No newline at end of file +var _0x37db=['[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','state','Machine','amd','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','[syncMachineIvr]','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','YYYY-MM-DD\x20HH:mm:ss','queueCallerAbandonCreateState','syncQueueCallerAbandon','droptime','responsetime','TIMEOUT','outboundDropCallsDayCallersExit','Abandoned','syncQueueMember','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncCampaigns','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','content','indexOf','true','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','dialPowerLevel','Queue','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','[syncCampaigns]','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','dialCutDigit','phone','SIP/%s/%s%s','trim','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','endtime','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','countbusyretry','dialBusyMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','createStateFinal','reason\x200\x20no\x20such\x20number....','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','[syncAgentComplete][createHistory][?]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','floor','erlangAbandonmentRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','abandonmentRate','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','[actionOriginate]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','[countReScheduled]\x20','RUNNING','Contact.phone','tryOriginatePredictive','[handlePredictive][limitChannel]','checkContactBlack','--------\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]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','util','uuid','moment','md5','ioredis','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/voiceQueueRt','./action','./queueCallerAbandon','env','rrmemory','roundrobin','prototype','enqueue','tail','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','agentcomplete','custom:queuesummary','hangup','syncHangup','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','type','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','startProgressive','Trunk','active','callerid','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','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','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','starttime','clearZombieChannels','uniqueId','[uniqueid]','[actions]','hasOwnProperty','sequence','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','then','checkIsBlackList','resolve','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory'];(function(_0x143cc6,_0xf94536){var _0x2cedba=function(_0x15a2ad){while(--_0x15a2ad){_0x143cc6['push'](_0x143cc6['shift']());}};_0x2cedba(++_0xf94536);}(_0x37db,0x11f));var _0xb37d=function(_0x41ba56,_0x5444bb){_0x41ba56=_0x41ba56-0x0;var _0x495592=_0x37db[_0x41ba56];return _0x495592;};'use strict';var util=require(_0xb37d('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xb37d('0x1'));var moment=require(_0xb37d('0x2'));var rr=require('rr');var md5=require(_0xb37d('0x3'));var Redis=require(_0xb37d('0x4'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0xb37d('0x5'));var loggerBooked=require(_0xb37d('0x6'))(_0xb37d('0x7'));var loggerPredictive=require(_0xb37d('0x6'))(_0xb37d('0x8'));var loggerPredictiveCalls=require('../../../config/logger')(_0xb37d('0x9'));var loggerSyncQueueSummary=require(_0xb37d('0x6'))(_0xb37d('0xa'));var ami=require(_0xb37d('0xb'));config[_0xb37d('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb37d('0xd'))(new Redis(config['redis']));var cmHopper=require(_0xb37d('0xe'));var cmHopperFinal=require(_0xb37d('0xf'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xb37d('0x10'));var Action=require(_0xb37d('0x11'));var History=require('./history');var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xb37d('0x12'));var Hangup=require('./hangup');var ipAgi=process[_0xb37d('0x13')]['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':_0xb37d('0x14'),'roundrobin':_0xb37d('0x15')};var Sequence=function(){};Sequence[_0xb37d('0x16')][_0xb37d('0x17')]=function(_0x48121f){this[_0xb37d('0x18')]=this[_0xb37d('0x18')]?this[_0xb37d('0x18')]['finally'](_0x48121f):_0x48121f();};function Dialer(_0x33c904,_0x1f2964){this['sequence']=new Sequence();this['preview']=_0x1f2964;this[_0xb37d('0x19')]=_0x33c904[_0xb37d('0x19')];this[_0xb37d('0x1a')]=_0x33c904[_0xb37d('0x1a')];this[_0xb37d('0x1b')]=_0x33c904[_0xb37d('0x1b')];this['trunks']=_0x33c904[_0xb37d('0x1c')];this[_0xb37d('0x1d')]=config[_0xb37d('0x1d')]||0x2;this[_0xb37d('0x1e')]={};this[_0xb37d('0x1f')]={};this[_0xb37d('0x20')]={};this['uniqueId']={};this[_0xb37d('0x21')]={};this[_0xb37d('0x22')]={};this['startProgressive']={};this[_0xb37d('0x23')]={};this[_0xb37d('0x24')]={};this['queueBookedRR']={};ami['on'](_0xb37d('0x25'),this[_0xb37d('0x26')][_0xb37d('0x27')](this));ami['on'](_0xb37d('0x28'),this['syncQueueCallerAbandon'][_0xb37d('0x27')](this));ami['on'](_0xb37d('0x29'),this['syncOriginateResponse']['bind'](this));ami['on'](_0xb37d('0x2a'),this['syncAgentComplete'][_0xb37d('0x27')](this));ami['on'](_0xb37d('0x2b'),this['syncQueueSummary'][_0xb37d('0x27')](this));ami['on'](_0xb37d('0x2c'),this[_0xb37d('0x2d')]['bind'](this));ami['on']('newexten',this[_0xb37d('0x2e')][_0xb37d('0x27')](this));ami['on'](_0xb37d('0x2f'),this[_0xb37d('0x30')][_0xb37d('0x27')](this));ami['on'](_0xb37d('0x31'),this['syncQueueMember'][_0xb37d('0x27')](this));ami['on'](_0xb37d('0x32'),this[_0xb37d('0x33')][_0xb37d('0x27')](this));this[_0xb37d('0x34')]();this[_0xb37d('0x35')]();}function isNotNull(_0x282090){return _0x282090!==null&&!_[_0xb37d('0x36')](_0x282090);}function checkIsLoggedIn(_0x246401,_0x17a2ef){return function(){if(_0x17a2ef<=0x0){_0x246401[_0xb37d('0x37')]=_0xb37d('0x38');throw _0x246401[_0xb37d('0x39')]+_0xb37d('0x3a');}};}function isActive(_0x2de85b){return _0x2de85b;}function checkIsActive(_0x36c1e6,_0x7c4d4b){return function(){if(!isActive(_0x7c4d4b)){_0x36c1e6[_0xb37d('0x37')]=_0xb37d('0x3b');throw _0x36c1e6['name']+_0xb37d('0x3c');}};}function checkInterval(_0x13e85c){return function(){if(!isNotNull(_0x13e85c[_0xb37d('0x3d')])){_0x13e85c[_0xb37d('0x37')]=_0xb37d('0x3e');throw _0x13e85c['name']+_0xb37d('0x3f');}if(!isNotNull(_0x13e85c[_0xb37d('0x3d')][_0xb37d('0x40')])){_0x13e85c[_0xb37d('0x37')]=_0xb37d('0x3e');throw _0x13e85c[_0xb37d('0x39')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xb37d('0x41')](_0x13e85c['Interval'][_0xb37d('0x40')]))){_0x13e85c['message']=_0xb37d('0x3e');throw _0x13e85c['name']+_0xb37d('0x3f');}};}function msgResponse(_0x5707da,_0x24abab,_0x11ea5f){return{'action':_0x5707da,'response':_0x24abab,'message':_0x11ea5f,'stack':_0x11ea5f};}function myreject(_0x514db6){return function(_0x12106e){return _0x514db6(msgResponse(_0xb37d('0x42'),_0xb37d('0x43'),JSON[_0xb37d('0x44')](_0x12106e)));};}function getSeconds(_0x33ecb1,_0x487f3f){var _0x1663ad=moment(_0x33ecb1)[_0xb37d('0x45')](0x0);var _0x33aa8d=moment(_0x487f3f)[_0xb37d('0x45')](0x0);return _0x1663ad[_0xb37d('0x46')](_0x33aa8d,_0xb37d('0x47'));}function emit(_0x4385cb,_0x3afd63,_0x5e468b){io['to'](_0x4385cb)['emit'](_0x3afd63,_0x5e468b);}function emitVoiceQueueSummary(_0x23ea3d){if(_0x23ea3d[_0xb37d('0x48')]==='outbound'){var _0x409ec8={'id':_0x23ea3d['id'],'name':_0x23ea3d['name'],'strategy':_0x23ea3d[_0xb37d('0x49')],'answered':_0x23ea3d[_0xb37d('0x4a')],'available':_0x23ea3d['available'],'loggedIn':_0x23ea3d[_0xb37d('0x4b')],'pTalking':_0x23ea3d[_0xb37d('0x4c')],'sumBillable':_0x23ea3d[_0xb37d('0x4d')],'sumDuration':_0x23ea3d[_0xb37d('0x4e')],'sumHoldTime':_0x23ea3d['sumHoldTime']||0x0,'talking':_0x23ea3d[_0xb37d('0x4f')],'total':_0x23ea3d[_0xb37d('0x50')],'type':_0x23ea3d[_0xb37d('0x48')],'unmanaged':_0x23ea3d[_0xb37d('0x51')],'abandoned':_0x23ea3d[_0xb37d('0x52')],'waiting':_0x23ea3d[_0xb37d('0x53')],'loggedInDb':_0x23ea3d[_0xb37d('0x54')],'dialActive':_0x23ea3d[_0xb37d('0x55')],'dialMethod':_0x23ea3d[_0xb37d('0x56')],'dialOriginateCallerIdName':_0x23ea3d[_0xb37d('0x57')],'dialOriginateCallerIdNumber':_0x23ea3d['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x23ea3d[_0xb37d('0x58')],'dialPrefix':_0x23ea3d[_0xb37d('0x59')],'outboundAnswerAgiCallsDay':_0x23ea3d[_0xb37d('0x5a')],'outboundAnswerCallsDay':_0x23ea3d[_0xb37d('0x5b')],'outboundBlacklistCallsDay':_0x23ea3d[_0xb37d('0x5c')],'outboundBusyCallsDay':_0x23ea3d[_0xb37d('0x5d')],'outboundCongestionCallsDay':_0x23ea3d[_0xb37d('0x5e')],'outboundDropCallsDayACS':_0x23ea3d[_0xb37d('0x5f')],'outboundDropCallsDayCallersExit':_0x23ea3d['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x23ea3d[_0xb37d('0x60')],'outboundNoAnswerCallsDay':_0x23ea3d[_0xb37d('0x61')],'outboundNoSuchCallsDay':_0x23ea3d[_0xb37d('0x62')],'outboundOriginateFailureCallsDay':_0x23ea3d['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x23ea3d[_0xb37d('0x63')],'outboundRejectCallsDay':_0x23ea3d[_0xb37d('0x64')],'outboundUnknownCallsDay':_0x23ea3d[_0xb37d('0x65')],'predictiveIntervalAnsweredCalls':_0x23ea3d['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x23ea3d[_0xb37d('0x66')],'predictiveIntervalAvgTalktime':_0x23ea3d[_0xb37d('0x67')],'predictiveIntervalDroppedCallsCallersExit':_0x23ea3d[_0xb37d('0x68')],'predictiveIntervalDroppedCallsTimeout':_0x23ea3d[_0xb37d('0x69')],'predictiveIntervalErlangCalls':_0x23ea3d[_0xb37d('0x6a')],'predictiveIntervalErlangCallsDroppedCalls':_0x23ea3d[_0xb37d('0x6b')],'predictiveIntervalHitRate':_0x23ea3d[_0xb37d('0x6c')],'predictiveIntervalMultiplicativeFactor':_0x23ea3d['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x23ea3d[_0xb37d('0x6d')],'predictiveIntervalAvailable':_0x23ea3d[_0xb37d('0x6e')],'predictiveIntervalTotalCalls':_0x23ea3d[_0xb37d('0x6f')],'message':_0x23ea3d['message'],'originated':_0x23ea3d['originated'],'erlangCalls':_0x23ea3d[_0xb37d('0x70')],'erlangCallToSecond':_0x23ea3d[_0xb37d('0x71')],'erlangAbandonmentRate':_0x23ea3d['erlangAbandonmentRate'],'erlangBusyFactor':_0x23ea3d['erlangBusyFactor'],'startPredictive':_0x23ea3d[_0xb37d('0x22')],'startProgressive':_0x23ea3d[_0xb37d('0x72')]};if(_0x23ea3d[_0xb37d('0x73')]){_0x409ec8[_0xb37d('0x73')]={'id':_0x23ea3d[_0xb37d('0x73')]['id'],'name':_0x23ea3d[_0xb37d('0x73')][_0xb37d('0x39')],'active':_0x23ea3d[_0xb37d('0x73')][_0xb37d('0x74')],'callerid':_0x23ea3d[_0xb37d('0x73')][_0xb37d('0x75')]};}if(_0x23ea3d[_0xb37d('0x3d')]){_0x409ec8[_0xb37d('0x3d')]={'id':_0x23ea3d[_0xb37d('0x3d')]['id'],'name':_0x23ea3d[_0xb37d('0x3d')][_0xb37d('0x39')]};}var _0x3dbde4=md5(JSON[_0xb37d('0x44')](_0x409ec8));if(_0x23ea3d[_0xb37d('0x3')]!==_0x3dbde4){_0x23ea3d[_0xb37d('0x3')]=_0x3dbde4;emit(util['format']('voice:queue:%s',_0x409ec8[_0xb37d('0x39')]),_0xb37d('0x76'),_0x409ec8);}}}function emitCampaignSummary(_0x394d21){if(_0x394d21['type']===_0xb37d('0x77')){emit(util[_0xb37d('0x78')](_0xb37d('0x79'),_0x394d21[_0xb37d('0x39')]),_0xb37d('0x7a'),_0x394d21);}}function checkGetDataPredictive(_0x22b1ec){if(isNotNull(_0x22b1ec)){if(!_['isEmpty'](_0x22b1ec)){loggerPredictive[_0xb37d('0x7b')](_0xb37d('0x7c'));loggerPredictive[_0xb37d('0x7b')](_0xb37d('0x7d'),_0x22b1ec['predictiveIntervalTotalCalls']);loggerPredictive[_0xb37d('0x7b')](_0xb37d('0x7e'),_0x22b1ec[_0xb37d('0x7f')]);loggerPredictive[_0xb37d('0x7b')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x22b1ec['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xb37d('0x7b')](_0xb37d('0x80'),_0x22b1ec[_0xb37d('0x68')]);loggerPredictive[_0xb37d('0x7b')](_0xb37d('0x81'),_0x22b1ec[_0xb37d('0x66')]);loggerPredictive['info'](_0xb37d('0x82'),_0x22b1ec[_0xb37d('0x67')]);loggerPredictive[_0xb37d('0x7b')](_0xb37d('0x83'));if(_0x22b1ec[_0xb37d('0x6f')]>0x0){if(!_[_0xb37d('0x36')](_0x22b1ec['predictiveIntervalAvgTalktime'])&&_0x22b1ec[_0xb37d('0x67')]>0x0){return!![];}else{loggerPredictive['info'](_0xb37d('0x84'));}if(!_[_0xb37d('0x36')](_0x22b1ec[_0xb37d('0x66')])&&_0x22b1ec[_0xb37d('0x66')]>0x0){return!![];}else{loggerPredictive[_0xb37d('0x7b')](_0xb37d('0x85'));}}else{loggerPredictive[_0xb37d('0x7b')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xb37d('0x7b')](_0xb37d('0x86'));}}else{loggerPredictive[_0xb37d('0x7b')](_0xb37d('0x86'));}return![];}function mergeDataErlangB(_0x3837f5){return function(_0x31c99b){loggerPredictive[_0xb37d('0x7b')]('---------\x20ErlangB\x20---------');loggerPredictive['info'](_0xb37d('0x87'),_0x31c99b[_0xb37d('0x70')]);loggerPredictive[_0xb37d('0x7b')](_0xb37d('0x88'),_0x31c99b[_0xb37d('0x71')]);loggerPredictive[_0xb37d('0x7b')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x31c99b['erlangAbandonmentRate']);loggerPredictive[_0xb37d('0x7b')](_0xb37d('0x89'),_0x31c99b[_0xb37d('0x8a')]);loggerPredictive[_0xb37d('0x7b')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x31c99b['erlangAbandonmentRate']);loggerPredictive[_0xb37d('0x7b')]('---------------------------');_[_0xb37d('0x8b')](_0x3837f5,_0x31c99b);};}function getDiff(_0x5aec62){var _0x52f0a4=moment()['milliseconds'](0x0);var _0x7aca01=moment(_0x5aec62)[_0xb37d('0x45')](0x0);return _0x52f0a4[_0xb37d('0x46')](_0x7aca01,_0xb37d('0x47'));}function ifInterval(_0x8f2201,_0x1bddca){if(_[_0xb37d('0x36')](_0x1bddca)){return![];}if(getDiff(_0x1bddca)<_0x8f2201*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x25202b){if(isNotNull(_0x25202b)){if(!_[_0xb37d('0x36')](_0x25202b[_0xb37d('0x72')])){_0x25202b[_0xb37d('0x72')]=undefined;loggerPredictive[_0xb37d('0x7b')](_0x25202b['name'],_0xb37d('0x8c'));}if(!_['isUndefined'](_0x25202b[_0xb37d('0x22')])){_0x25202b[_0xb37d('0x22')]=undefined;loggerPredictive[_0xb37d('0x7b')](_0x25202b[_0xb37d('0x39')],_0xb37d('0x8d'));}if(!_[_0xb37d('0x36')](_0x25202b[_0xb37d('0x8e')])){clearInterval(_0x25202b[_0xb37d('0x8e')]);_0x25202b[_0xb37d('0x8e')]=undefined;loggerPredictive[_0xb37d('0x7b')](_0x25202b[_0xb37d('0x39')],_0xb37d('0x8f'));}}}function erlangb(_0x3ae0c6,_0x230204){if(_0x230204===0x0){return 0x0;}var _0x5e3eeb=0x1;for(var _0x359ffc=0x1;_0x359ffc<=_0x230204;_0x359ffc+=0x1){_0x5e3eeb=0x1+_0x5e3eeb*_0x359ffc/_0x3ae0c6;}return 0x1/_0x5e3eeb;}function isVoiceQueueOutbound(_0xff41d3){return _0xff41d3===_0xb37d('0x90');}function isNotPreview(_0xcf7e6a){return _0xcf7e6a!==_0xb37d('0x91');}function isCampaignIvr(_0x49602f){return _0x49602f===_0xb37d('0x77');}function getCallerId(_0x4e11b6,_0x167043,_0x4a5dd5){if(!_[_0xb37d('0x36')](_0x4a5dd5)&&_0xb37d('0x92')===typeof _0x4a5dd5&&!_['isEmpty'](_0x4a5dd5)){if(!_[_0xb37d('0x36')](_0x167043)&&_0xb37d('0x92')===typeof _0x167043&&!_[_0xb37d('0x41')](_0x167043)){return util[_0xb37d('0x78')](_0xb37d('0x93'),_0x167043,_0x4a5dd5);}return util[_0xb37d('0x78')]('\x22%s\x22\x20<%s>',_0x4a5dd5,_0x4a5dd5);}if(!_['isUndefined'](_0x4e11b6)&&_0xb37d('0x92')===typeof _0x4e11b6&&!_[_0xb37d('0x41')](_0x4e11b6)){return _0x4e11b6;}return _0xb37d('0x94');}function loggerCatchQueueSummary(_0x1dabad,_0x3cc02e){return function(_0x31a9e8){freeVariablesPredictive(_0x3cc02e);emitVoiceQueueSummary(_0x3cc02e);emitCampaignSummary(_0x3cc02e);loggerSyncQueueSummary[_0xb37d('0x95')](_0x1dabad,util[_0xb37d('0x96')](_0x31a9e8,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0xb26afd,_0x589c12){return function(_0x2f5824){loggerPredictive['error'](_0x589c12[_0xb37d('0x39')],_0xb26afd);loggerPredictive[_0xb37d('0x95')](_0x2f5824[_0xb37d('0x97')]);freeVariablesPredictive(_0x589c12);};}function loggerCatch(_0x24e65c){return function(_0x11147c){logger['error'](_0x24e65c,util['inspect'](_0x11147c,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x45fc64){return _0x45fc64&&!_[_0xb37d('0x36')](_0x45fc64)&&_0x45fc64[_0xb37d('0x98')]>0x0;}function decremetOriginate(_0x27afc8){if(!_[_0xb37d('0x36')](_0x27afc8)&&_0x27afc8!==null){if(_0x27afc8['hasOwnProperty'](_0xb37d('0x99'))){if(_0x27afc8[_0xb37d('0x99')]>0x0){_0x27afc8['originated']-=0x1;}else{logger['error'](_0xb37d('0x9a'));}}}else{logger[_0xb37d('0x95')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x314019,_0x36cd44,_0x3e5ff0){if(_0x36cd44>_0x3e5ff0){for(var _0x41bf92=0x0;_0x41bf92<_0x36cd44-_0x3e5ff0;_0x41bf92+=0x1){decremetOriginate(_0x314019);}}}function loggerGetContactDialer(_0x439120,_0x362e9f,_0x4556bb){return function(_0x140209){checkContactLowerLimitOriginate(_0x362e9f,_0x4556bb,0x0);logger[_0xb37d('0x95')](_0x439120,util[_0xb37d('0x96')](_0x140209,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x49fc0c){return function(_0x2f7b8){if(isNotNull(_0x2f7b8)&&isNotNull(_0x2f7b8[0x0])){if(_0x2f7b8[0x0][_0xb37d('0x9b')]>0x0){_0x49fc0c[_0xb37d('0x37')]='RESCHEDULED_CONTACTS';logger[_0xb37d('0x7b')](_0xb37d('0x9c')+_0x49fc0c[_0xb37d('0x39')],_0x2f7b8[0x0][_0xb37d('0x9b')],_0xb37d('0x9d'));}else{_0x49fc0c[_0xb37d('0x37')]=_0xb37d('0x9e');logger[_0xb37d('0x7b')](_0xb37d('0x9f')+_0x49fc0c[_0xb37d('0x39')]);}}};}function notSendMessagesQueue(_0x1ee180){if(_0x1ee180[_0xb37d('0xa0')]){freeVariablesPredictive(_0x1ee180);if(_0x1ee180['originated']===0x0&&_0x1ee180[_0xb37d('0x4f')]===0x0&&_0x1ee180[_0xb37d('0x53')]===0x0&&(_0x1ee180['pTalking']||0x0)===0x0){_0x1ee180[_0xb37d('0xa0')]=![];_0x1ee180['available']=0x0;_0x1ee180[_0xb37d('0x37')]='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0xb37d('0xa1'),_0x1ee180[_0xb37d('0x39')],_0xb37d('0xa2'));}else{_0x1ee180[_0xb37d('0x37')]=_0xb37d('0xa3');loggerSyncQueueSummary[_0xb37d('0x95')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1ee180[_0xb37d('0x39')],_0xb37d('0xa4'));}emitVoiceQueueSummary(_0x1ee180);}}function notSendMessagesCampaign(_0x58567f){if(_0x58567f[_0xb37d('0xa0')]){if(_0x58567f[_0xb37d('0x99')]===0x0){_0x58567f[_0xb37d('0xa0')]=![];_0x58567f[_0xb37d('0x37')]=_0xb37d('0x3b');loggerSyncQueueSummary['error'](_0xb37d('0xa5'),_0x58567f[_0xb37d('0x39')],_0xb37d('0xa2'));}else{_0x58567f['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0xb37d('0x95')](_0xb37d('0xa5'),_0x58567f['name'],_0xb37d('0xa4'));}emitCampaignSummary(_0x58567f);}}function createObjHistory(_0x465c7f,_0xc25822,_0x2ccdfc,_0x5a6a15,_0x218e80){_0x465c7f[_0xb37d('0x37')]=_0x2ccdfc;var _0x29ff40=new Action(_0x465c7f,_0xc25822);var _0x3aeb63=new History(_0x29ff40);_0x3aeb63['state']=_0x5a6a15;_0x3aeb63[_0xb37d('0xa6')]=_0x218e80;_0x3aeb63['endtime']=_0x29ff40[_0xb37d('0xa7')];return _0x3aeb63;}Dialer[_0xb37d('0x16')]['loopClearZombieChannels']=function(){var _0x474176=this;setInterval(function(){_0x474176[_0xb37d('0xa8')](_0x474176[_0xb37d('0xa9')],_0xb37d('0xaa'));_0x474176['clearZombieChannels'](_0x474176[_0xb37d('0x1f')],_0xb37d('0xab'));},0x32c8);};Dialer['prototype'][_0xb37d('0xa8')]=function(_0x1bcd2b,_0x2b3d38){var _0x194a1d=this;for(var _0x129615 in _0x1bcd2b){if(_0x1bcd2b[_0xb37d('0xac')](_0x129615)){this[_0xb37d('0xad')][_0xb37d('0x17')](function(){if(!_[_0xb37d('0xae')](_0x1bcd2b[_0x129615])){return ami[_0xb37d('0xaf')]({'action':_0xb37d('0xb0'),'channel':_0x1bcd2b[_0x129615][_0xb37d('0xb1')]})[_0xb37d('0xb2')](function(_0x4a5804){if(_0x4a5804[_0xb37d('0x37')]===_0xb37d('0xb3')){setTimeout(function(){if(_0x1bcd2b[_0x129615]&&_0x1bcd2b[_0x129615][_0xb37d('0x48')]!=='ivr'){_0x194a1d[_0xb37d('0xb4')](_0x194a1d[_0xb37d('0x19')][_0x1bcd2b[_0x129615][_0xb37d('0xb5')]]);logger[_0xb37d('0x95')]('[Dialer][checkChannel]',_0x2b3d38,_0x129615,_0x1bcd2b[_0x129615][_0xb37d('0xb5')]);delete _0x1bcd2b[_0x129615];}if(_0x1bcd2b[_0x129615]&&_0x1bcd2b[_0x129615][_0xb37d('0x48')]===_0xb37d('0x77')){_0x194a1d['updateOriginated'](_0x194a1d['campaigns'][_0x1bcd2b[_0x129615][_0xb37d('0xb5')]]);logger[_0xb37d('0x95')](_0xb37d('0xb6'),_0x2b3d38,_0x129615,_0x1bcd2b[_0x129615][_0xb37d('0xb5')]);delete _0x1bcd2b[_0x129615];}},0x2328);}});}});}}};Dialer[_0xb37d('0x16')][_0xb37d('0xb7')]=function(_0x462431){return BPromise['resolve']()[_0xb37d('0xb8')](cmHopper[_0xb37d('0xb7')](_0x462431))[_0xb37d('0xb2')](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype'][_0xb37d('0xb9')]=function(_0x4ca82e){return BPromise[_0xb37d('0xba')]()[_0xb37d('0xb8')](cmHopperBlack[_0xb37d('0xb9')](_0x4ca82e))[_0xb37d('0xb2')](loggerCatch(_0xb37d('0xbb')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x429ec4){return BPromise[_0xb37d('0xba')]()[_0xb37d('0xb8')](cmHopperBlack[_0xb37d('0xbc')](_0x429ec4))[_0xb37d('0xb2')](loggerCatch(_0xb37d('0xbd')));};Dialer[_0xb37d('0x16')][_0xb37d('0xbe')]=function(_0x10e221){return BPromise['resolve']()['then'](cmHopperHistory['avgHandleTime'](_0x10e221))[_0xb37d('0xb2')](loggerCatch(_0xb37d('0xbf')));};Dialer['prototype'][_0xb37d('0xc0')]=function(_0x5cb340){return BPromise[_0xb37d('0xba')]()['then'](cmHopper[_0xb37d('0xc0')](_0x5cb340))[_0xb37d('0xb2')](loggerCatch(_0xb37d('0xc1')));};Dialer[_0xb37d('0x16')][_0xb37d('0xc2')]=function(_0x5d1746,_0xe64cb5,_0x38b7d1,_0x124771){return BPromise[_0xb37d('0xba')]()['then'](cmHopper[_0xb37d('0xc2')](_0x5d1746,_0xe64cb5,_0x38b7d1,_0x124771))[_0xb37d('0xb2')](loggerCatch(_0xb37d('0xc3')));};Dialer[_0xb37d('0x16')][_0xb37d('0xc4')]=function(_0x2d686d,_0x2bb6eb,_0x1dcddc){return BPromise[_0xb37d('0xba')]()[_0xb37d('0xb8')](cmHopper[_0xb37d('0xc4')](_0x2d686d,_0x2bb6eb,_0x1dcddc))[_0xb37d('0xb2')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0xb37d('0x16')]['getVoiceQueueRtPauses']=function(_0x52b3cd){return BPromise[_0xb37d('0xba')]()[_0xb37d('0xb8')](voiceQueueRt[_0xb37d('0xc5')](_0x52b3cd))[_0xb37d('0xb2')](loggerCatch(_0xb37d('0xc6')));};Dialer[_0xb37d('0x16')][_0xb37d('0xc7')]=function(_0x2c714f){return BPromise['resolve']()['then'](cmHopper[_0xb37d('0xc7')](_0x2c714f))[_0xb37d('0xb2')](loggerCatch(_0xb37d('0xc8')));};Dialer[_0xb37d('0x16')]['createHistory']=function(_0x9ef729){return BPromise[_0xb37d('0xba')]()['then'](cmHopperHistory[_0xb37d('0xc9')](_0x9ef729))[_0xb37d('0xb2')](loggerCatch('[createHistory]\x20'));};Dialer[_0xb37d('0x16')][_0xb37d('0xb4')]=function(_0x5f2ab0){if(!_[_0xb37d('0x36')](_0x5f2ab0)&&_0x5f2ab0!==null){if(_0x5f2ab0[_0xb37d('0xac')](_0xb37d('0x99'))){if(_0x5f2ab0[_0xb37d('0x99')]>0x0){_0x5f2ab0['originated']-=0x1;}else{logger[_0xb37d('0x95')](_0xb37d('0xca'));}}}else{logger[_0xb37d('0x95')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0xb37d('0xcb')]=function(_0x526fcc,_0x587a21){var _0xccacec=this;return function(_0x5bf448){_0xccacec['updateOriginated'](_0x587a21);logger[_0xb37d('0x95')](_0x526fcc,util[_0xb37d('0x96')](_0x5bf448,{'showHidden':![],'depth':null}));};};Dialer[_0xb37d('0x16')][_0xb37d('0xcc')]=function(_0x214a75,_0x5ea6b7,_0x5d1a09){var _0x5c6fd8={'state':0x19,'statedesc':_0xb37d('0xcd')};this[_0xb37d('0xb4')](_0x5ea6b7);this[_0xb37d('0xce')](_[_0xb37d('0x8b')](_0x5c6fd8,_[_0xb37d('0xcf')](_0x5d1a09,[_0xb37d('0xd0'),_0xb37d('0xd1'),_0xb37d('0xd2'),_0xb37d('0xd3'),_0xb37d('0xd4')])),_0xb37d('0xd5'),_0xb37d('0xd6'));logger[_0xb37d('0x95')](_0x214a75);};Dialer[_0xb37d('0x16')][_0xb37d('0xd7')]=function(_0x474641){return _0x474641===_0xb37d('0xd8');};Dialer[_0xb37d('0x16')][_0xb37d('0xd9')]=function(_0x371c68){return!_[_0xb37d('0x36')](_0x371c68)&&_0x371c68&&!_[_0xb37d('0x36')](_0x371c68[_0xb37d('0x39')])&&!_[_0xb37d('0x36')](_0x371c68[_0xb37d('0x74')])&&_0x371c68[_0xb37d('0x74')]&&(this['trunks'][util[_0xb37d('0x78')](_0xb37d('0xda'),_0x371c68[_0xb37d('0x39')])][_0xb37d('0xb0')]==='reachable'||this[_0xb37d('0x1c')][util[_0xb37d('0x78')]('SIP/%s',_0x371c68['name'])][_0xb37d('0xb0')]===_0xb37d('0xdb'));};Dialer[_0xb37d('0x16')][_0xb37d('0xce')]=function(_0x5d83dd,_0x1fd6f4,_0x1b6a8d){this[_0xb37d('0xc9')](_0x5d83dd)['catch'](loggerCatch(_0x1fd6f4));this['moveContactManagedDialer'](_0x5d83dd)[_0xb37d('0xb2')](loggerCatch(_0x1b6a8d));};Dialer[_0xb37d('0x16')][_0xb37d('0x30')]=function(_0x252ae8){var _0x6f8a5c=this[_0xb37d('0xa9')][_0x252ae8[_0xb37d('0xdc')]];var _0x55f830;if(!_[_0xb37d('0xae')](_0x252ae8)&&!_[_0xb37d('0xae')](_0x252ae8[_0xb37d('0xdd')])&&!_[_0xb37d('0xae')](_0x252ae8[_0xb37d('0xdd')][_0xb37d('0xde')])&&_0x252ae8[_0xb37d('0xdf')]===_0xb37d('0xe0')&&_0x6f8a5c){if(_0x6f8a5c[_0xb37d('0x48')]!==_0xb37d('0x77')&&this[_0xb37d('0x19')][_0x6f8a5c[_0xb37d('0xb5')]]['dialAMDActive']&&_0x252ae8[_0xb37d('0xe1')]===_0xb37d('0xe2')){delete this[_0xb37d('0xa9')][_0x252ae8[_0xb37d('0xdc')]];this[_0xb37d('0xb4')](this['voiceQueues'][_0x6f8a5c[_0xb37d('0xb5')]]);this[_0xb37d('0x19')][_0x6f8a5c[_0xb37d('0xb5')]][_0xb37d('0x5b')]+=0x1;this[_0xb37d('0x19')][_0x6f8a5c[_0xb37d('0xb5')]][_0xb37d('0x5a')]+=0x1;_0x55f830=new Hangup(_0x6f8a5c,_0x252ae8);_0x55f830['state']=0x12;_0x55f830[_0xb37d('0xa6')]=_0xb37d('0xe3');_0x55f830[_0xb37d('0xe4')]=_0xb37d('0xe5');this[_0xb37d('0xce')](_0x55f830,_0xb37d('0xe6'),_0xb37d('0xe7'));}if(_0x6f8a5c[_0xb37d('0x48')]!=='ivr'&&this[_0xb37d('0x19')][_0x6f8a5c[_0xb37d('0xb5')]][_0xb37d('0xe8')]&&_0x252ae8[_0xb37d('0xe1')]===_0xb37d('0xe9')){delete this[_0xb37d('0xa9')][_0x252ae8[_0xb37d('0xdc')]];this[_0xb37d('0xb4')](this['voiceQueues'][_0x6f8a5c['queue']]);this[_0xb37d('0x19')][_0x6f8a5c[_0xb37d('0xb5')]][_0xb37d('0x5b')]+=0x1;this[_0xb37d('0x19')][_0x6f8a5c[_0xb37d('0xb5')]][_0xb37d('0x5a')]+=0x1;_0x55f830=new Hangup(_0x6f8a5c,_0x252ae8);_0x55f830[_0xb37d('0xea')]=0x13;_0x55f830[_0xb37d('0xa6')]=_0xb37d('0xeb');_0x55f830['membername']=_0xb37d('0xe5');_0x55f830[_0xb37d('0xec')]=!![];this['saveInDb'](_0x55f830,'[syncMachine][createHistory]','[syncMachine]');}if(_0x6f8a5c[_0xb37d('0x48')]===_0xb37d('0x77')&&this[_0xb37d('0x1a')][_0x6f8a5c[_0xb37d('0xb5')]][_0xb37d('0xe8')]&&_0x252ae8[_0xb37d('0xe1')]==='HANGUP'){delete this[_0xb37d('0xa9')][_0x252ae8[_0xb37d('0xdc')]];this['updateOriginated'](this['campaigns'][_0x6f8a5c[_0xb37d('0xb5')]]);_0x55f830=new Hangup(_0x6f8a5c,_0x252ae8);_0x55f830[_0xb37d('0xea')]=0x12;_0x55f830['statedesc']=_0xb37d('0xe3');_0x55f830[_0xb37d('0xe4')]=_0xb37d('0xe5');this[_0xb37d('0xce')](_0x55f830,_0xb37d('0xed'),_0xb37d('0xee'));}if(_0x6f8a5c['type']===_0xb37d('0x77')&&this[_0xb37d('0x1a')][_0x6f8a5c[_0xb37d('0xb5')]]['dialAMDActive']&&_0x252ae8[_0xb37d('0xe1')]===_0xb37d('0xe9')){delete this['uniqueId'][_0x252ae8[_0xb37d('0xdc')]];this['updateOriginated'](this[_0xb37d('0x1a')][_0x6f8a5c[_0xb37d('0xb5')]]);_0x55f830=new Hangup(_0x6f8a5c,_0x252ae8);_0x55f830['state']=0x13;_0x55f830['statedesc']=_0xb37d('0xeb');_0x55f830[_0xb37d('0xe4')]='AMD';_0x55f830['amd']=!![];this['saveInDb'](_0x55f830,_0xb37d('0xef'),_0xb37d('0xf0'));}}};Dialer[_0xb37d('0x16')]['syncHangup']=function(_0x37db5d){var _0x50f963=this[_0xb37d('0xa9')][_0x37db5d[_0xb37d('0xdc')]];var _0x5ab8f0=this;var _0x154b03;if(_0x50f963&&_0x50f963[_0xb37d('0x48')]===_0xb37d('0x77')){delete this[_0xb37d('0xa9')][_0x37db5d[_0xb37d('0xdc')]];this[_0xb37d('0xb4')](this[_0xb37d('0x1a')][_0x50f963[_0xb37d('0xb5')]]);this['campaigns'][_0x50f963[_0xb37d('0xb5')]]['ivrAnswerCallsDay']+=0x1;_0x154b03=new Hangup(_0x50f963,_0x37db5d);this[_0xb37d('0xc9')](_0x154b03)[_0xb37d('0xb2')](loggerCatch(_0xb37d('0xf1')));this['moveContactManagedDialer'](_0x154b03)[_0xb37d('0xb2')](loggerCatch(_0xb37d('0xf2')));}if(_0x50f963&&_0x50f963['type']!==_0xb37d('0x77')&&isNotNull(this[_0xb37d('0x19')][_0x50f963[_0xb37d('0xb5')]]['dialQueueProject'])){delete this[_0xb37d('0xa9')][_0x37db5d[_0xb37d('0xdc')]];this[_0xb37d('0xb4')](this[_0xb37d('0x19')][_0x50f963[_0xb37d('0xb5')]]);this[_0xb37d('0x19')][_0x50f963[_0xb37d('0xb5')]][_0xb37d('0x5b')]+=0x1;this[_0xb37d('0x19')][_0x50f963[_0xb37d('0xb5')]][_0xb37d('0x5a')]+=0x1;_0x154b03=new Hangup(_0x50f963,_0x37db5d);_0x154b03['state']=0x10;_0x154b03['statedesc']=_0xb37d('0xf3');_0x154b03[_0xb37d('0xe4')]=_0xb37d('0xf4');this[_0xb37d('0xc9')](_0x154b03)[_0xb37d('0xb2')](loggerCatch(_0xb37d('0xf1')));this[_0xb37d('0xc7')](_0x154b03)[_0xb37d('0xb2')](loggerCatch('[syncHangupIvr]'));}if(_0x50f963&&_0x50f963[_0xb37d('0x48')]!=='ivr'&&!isNotNull(this['voiceQueues'][_0x50f963['queue']][_0xb37d('0xf5')])){delete this[_0xb37d('0xa9')][_0x37db5d[_0xb37d('0xdc')]];this[_0xb37d('0xb4')](this[_0xb37d('0x19')][_0x50f963[_0xb37d('0xb5')]]);this[_0xb37d('0x19')][_0x50f963[_0xb37d('0xb5')]][_0xb37d('0x65')]+=0x1;_0x154b03=new Hangup(_0x50f963,_0x37db5d);_0x154b03[_0xb37d('0xea')]=0xc;_0x154b03[_0xb37d('0xa6')]=_0x37db5d[_0xb37d('0xf6')];_0x154b03['membername']=_0xb37d('0xf7');this['createHistory'](_0x154b03)[_0xb37d('0xb2')](loggerCatch(_0xb37d('0xf1')));this['moveContactManagedDialer'](_0x154b03)[_0xb37d('0xb2')](loggerCatch(_0xb37d('0xf2')));}};Dialer[_0xb37d('0x16')]['syncAgentComplete']=function(_0x38c311){var _0x3c94bd=this[_0xb37d('0xa9')][_0x38c311[_0xb37d('0xdc')]];var _0xffeb1a=this;if(this[_0xb37d('0x19')][_0x38c311[_0xb37d('0xb5')]]){if(_0x3c94bd&&_0x3c94bd[_0xb37d('0x48')]!==_0xb37d('0x77')){delete this[_0xb37d('0xa9')][_0x38c311['uniqueid']];this[_0xb37d('0x19')][_0x38c311['queue']]['outboundAnswerCallsDay']+=0x1;var _0x207048=new AgentComplete(_0x3c94bd,_0x38c311);if(_0x38c311[_0xb37d('0xf8')]===_0xb37d('0xf9')){_0x207048[_0xb37d('0xfa')]=this[_0xb37d('0x19')][_0x38c311[_0xb37d('0xb5')]][_0xb37d('0xfb')]&&this[_0xb37d('0x19')][_0x38c311[_0xb37d('0xb5')]]['dialAgiAfterHangupAgent']?moment()[_0xb37d('0x78')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this['createHistory'](_0x207048)['catch'](loggerCatch(_0xb37d('0xfc')));this[_0xb37d('0xc7')](_0x207048)[_0xb37d('0xb2')](loggerCatch(_0xb37d('0xfd')));}}};Dialer[_0xb37d('0x16')][_0xb37d('0x26')]=function(_0x3629a1){if(this[_0xb37d('0x19')][_0x3629a1[_0xb37d('0xb5')]]){if(this[_0xb37d('0xa9')][_0x3629a1[_0xb37d('0xdc')]]&&this[_0xb37d('0xa9')][_0x3629a1[_0xb37d('0xdc')]][_0xb37d('0x48')]!==_0xb37d('0x77')){this[_0xb37d('0xb4')](this['voiceQueues'][_0x3629a1['queue']]);this[_0xb37d('0xa9')][_0x3629a1['uniqueid']][_0xb37d('0xfe')]=moment()[_0xb37d('0x78')](_0xb37d('0xff'));}}};Dialer[_0xb37d('0x16')][_0xb37d('0x100')]=function(_0x357b96){this[_0xb37d('0xc9')](_0x357b96)[_0xb37d('0xb2')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xb37d('0xc7')](_0x357b96)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xb37d('0x16')][_0xb37d('0x101')]=function(_0x25d470){var _0x4c3d93=this[_0xb37d('0xa9')][_0x25d470[_0xb37d('0xdc')]];var _0x3a4ee2=this;if(this['voiceQueues'][_0x25d470[_0xb37d('0xb5')]]){if(_0x4c3d93&&_0x4c3d93[_0xb37d('0x48')]!=='ivr'){delete this[_0xb37d('0xa9')][_0x25d470[_0xb37d('0xdc')]];this['updateOriginated'](this[_0xb37d('0x19')][_0x25d470[_0xb37d('0xb5')]]);_0x4c3d93[_0xb37d('0x102')]=moment()[_0xb37d('0x78')](_0xb37d('0xff'));var _0x364c72=new QueueCallerAbandon(_0x4c3d93,_0x25d470);if(getSeconds(_0x4c3d93['droptime'],_0x4c3d93[_0xb37d('0x103')])>=_0x4c3d93['dialQueueTimeout']){this[_0xb37d('0x19')][_0x25d470[_0xb37d('0xb5')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x25d470[_0xb37d('0xb5')]][_0xb37d('0x60')]+=0x1;this[_0xb37d('0x19')][_0x25d470[_0xb37d('0xb5')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x364c72[_0xb37d('0xea')]=0xa;_0x364c72[_0xb37d('0xa6')]='Drop';_0x364c72['dropreason']=_0xb37d('0x104');_0x364c72['agiafterat']=this[_0xb37d('0x19')][_0x25d470[_0xb37d('0xb5')]][_0xb37d('0xfb')]?moment()['format'](_0xb37d('0xff')):undefined;this[_0xb37d('0x100')](_0x364c72);}else{this[_0xb37d('0x19')][_0x25d470[_0xb37d('0xb5')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xb37d('0x19')][_0x25d470[_0xb37d('0xb5')]][_0xb37d('0x105')]+=0x1;_0x364c72['state']=0xb;_0x364c72[_0xb37d('0xa6')]=_0xb37d('0x106');_0x364c72['dropreason']='CALLEREXIT';this[_0xb37d('0x100')](_0x364c72);}}}};Dialer[_0xb37d('0x16')][_0xb37d('0x2e')]=function(_0x2e514c){if(this[_0xb37d('0x1f')][_0x2e514c[_0xb37d('0xdc')]]){this['actions'][_0x2e514c[_0xb37d('0xdc')]][_0xb37d('0xb1')]=_0x2e514c[_0xb37d('0xb1')];}if(this[_0xb37d('0xa9')][_0x2e514c[_0xb37d('0xdc')]]){this['uniqueId'][_0x2e514c['uniqueid']][_0xb37d('0xb1')]=_0x2e514c[_0xb37d('0xb1')];}};Dialer['prototype'][_0xb37d('0x107')]=function(_0x2cc19a){if(strategy[this[_0xb37d('0x19')][this[_0xb37d('0x1f')][_0x2cc19a['actionid']][_0xb37d('0xb5')]][_0xb37d('0x49')]]===_0xb37d('0x15')){if(this[_0xb37d('0x1f')][_0x2cc19a[_0xb37d('0x108')]]&&_[_0xb37d('0xae')](this[_0xb37d('0x1f')][_0x2cc19a['actionid']][_0xb37d('0x109')])&&_0x2cc19a[_0xb37d('0xb0')]==='1'&&_0x2cc19a[_0xb37d('0x10a')]==='0'){if(this['agents'][_0x2cc19a[_0xb37d('0x10b')]]){if(!this[_0xb37d('0x1b')][_0x2cc19a[_0xb37d('0x10b')]]['locked']){this[_0xb37d('0x1b')][_0x2cc19a[_0xb37d('0x10b')]][_0xb37d('0x109')]=!![];this[_0xb37d('0x1f')][_0x2cc19a[_0xb37d('0x108')]][_0xb37d('0x109')]=!![];this[_0xb37d('0x1f')][_0x2cc19a['actionid']][_0xb37d('0x10b')]=_0x2cc19a['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0xb37d('0x1f')][_0x2cc19a[_0xb37d('0x108')]][_0xb37d('0xb5')]][_0xb37d('0x49')]]||_0xb37d('0x14'))===_0xb37d('0x14')){if(this[_0xb37d('0x1f')][_0x2cc19a[_0xb37d('0x108')]]){if(this[_0xb37d('0x1b')][_0x2cc19a[_0xb37d('0x10b')]]){this['actions'][_0x2cc19a['actionid']][_0xb37d('0x10b')]=_0x2cc19a[_0xb37d('0x10b')];if(_['isNil'](this[_0xb37d('0x24')][this[_0xb37d('0x1f')][_0x2cc19a[_0xb37d('0x108')]][_0xb37d('0xb5')]])){this[_0xb37d('0x24')][this[_0xb37d('0x1f')][_0x2cc19a[_0xb37d('0x108')]][_0xb37d('0xb5')]]=[];}this[_0xb37d('0x24')][this['actions'][_0x2cc19a['actionid']][_0xb37d('0xb5')]][_0xb37d('0x10c')](_['merge'](_[_0xb37d('0xcf')](this['actions'][_0x2cc19a[_0xb37d('0x108')]],[_0xb37d('0x10d'),_0xb37d('0x10b')]),{'status':_0x2cc19a[_0xb37d('0xb0')],'paused':_0x2cc19a[_0xb37d('0x10a')]}));}}}};function unlockQueueStatus(_0x31d52a,_0x5a20a0){setTimeout(function(){if(_['isUndefined'](_0x31d52a[_0xb37d('0x10e')])){loggerBooked[_0xb37d('0x95')](_0xb37d('0x10f'),_0x5a20a0);}_0x31d52a[_0xb37d('0x10e')]=!![];loggerBooked[_0xb37d('0x7b')](_0xb37d('0x110'),_0x5a20a0,JSON[_0xb37d('0x44')](_[_0xb37d('0xcf')](_0x31d52a,[_0xb37d('0x39'),_0xb37d('0x10e')])));},0x1f3);}Dialer[_0xb37d('0x16')][_0xb37d('0x33')]=function(_0x51a0fb){var _0x20e2c6=this;var _0x2a626f=_0x20e2c6[_0xb37d('0x19')][_0x20e2c6[_0xb37d('0x1f')][_0x51a0fb[_0xb37d('0x108')]][_0xb37d('0xb5')]];if(strategy[this[_0xb37d('0x19')][this[_0xb37d('0x1f')][_0x51a0fb['actionid']]['queue']][_0xb37d('0x49')]]==='roundrobin'){if(this['actions'][_0x51a0fb[_0xb37d('0x108')]]&&this[_0xb37d('0x1f')][_0x51a0fb[_0xb37d('0x108')]][_0xb37d('0x10b')]){this['preview'][_0xb37d('0x111')](this[_0xb37d('0x1f')][_0x51a0fb[_0xb37d('0x108')]]['idHopper'],this[_0xb37d('0x1f')][_0x51a0fb[_0xb37d('0x108')]][_0xb37d('0x10b')])[_0xb37d('0xb2')](function(_0x5d8f41){logger['error'](_0xb37d('0x112'),util['inspect'](_0x5d8f41,{'showHidden':![],'depth':null}));})[_0xb37d('0x113')](function(){_0x20e2c6['updateOriginated'](_0x20e2c6[_0xb37d('0x19')][_0x20e2c6[_0xb37d('0x1f')][_0x51a0fb['actionid']][_0xb37d('0xb5')]]);_0x20e2c6[_0xb37d('0x1b')][_0x20e2c6['actions'][_0x51a0fb[_0xb37d('0x108')]][_0xb37d('0x10b')]][_0xb37d('0x109')]=![];delete _0x20e2c6[_0xb37d('0x1f')][_0x51a0fb[_0xb37d('0x108')]];unlockQueueStatus(_0x2a626f);});}else{this[_0xb37d('0xb4')](this[_0xb37d('0x19')][this[_0xb37d('0x1f')][_0x51a0fb[_0xb37d('0x108')]]['queue']]);this[_0xb37d('0xc0')]({'active':![],'ContactId':this['actions'][_0x51a0fb[_0xb37d('0x108')]]['ContactId'],'ListId':this[_0xb37d('0x1f')][_0x51a0fb[_0xb37d('0x108')]][_0xb37d('0xd1')],'VoiceQueueId':this[_0xb37d('0x1f')][_0x51a0fb[_0xb37d('0x108')]][_0xb37d('0xd3')]||undefined,'CampaignId':this[_0xb37d('0x1f')][_0x51a0fb[_0xb37d('0x108')]][_0xb37d('0xd4')]||undefined})['catch'](loggerCatch(_0xb37d('0x114')));delete this[_0xb37d('0x1f')][_0x51a0fb[_0xb37d('0x108')]];unlockQueueStatus(_0x2a626f);}}else if((strategy[this[_0xb37d('0x19')][this[_0xb37d('0x1f')][_0x51a0fb['actionid']][_0xb37d('0xb5')]][_0xb37d('0x49')]]||'rrmemory')===_0xb37d('0x14')){var _0x1a3020;if(this['actions'][_0x51a0fb[_0xb37d('0x108')]]&&!_[_0xb37d('0x41')](this['queueBooked'][this['actions'][_0x51a0fb[_0xb37d('0x108')]][_0xb37d('0xb5')]])){if(this[_0xb37d('0x115')][_0x20e2c6['actions'][_0x51a0fb[_0xb37d('0x108')]]['queue']]){this['queueBookedRR'][_0x20e2c6['actions'][_0x51a0fb['actionid']][_0xb37d('0xb5')]]=this[_0xb37d('0x115')][this[_0xb37d('0x1f')][_0x51a0fb[_0xb37d('0x108')]][_0xb37d('0xb5')]]?this[_0xb37d('0x115')][this['actions'][_0x51a0fb['actionid']]['queue']]:this['queueBooked'][this[_0xb37d('0x1f')][_0x51a0fb[_0xb37d('0x108')]]['queue']]?this[_0xb37d('0x24')][this[_0xb37d('0x1f')][_0x51a0fb[_0xb37d('0x108')]][_0xb37d('0xb5')]][_0xb37d('0x116')]||0x0:0x0;}this['queueBooked'][this[_0xb37d('0x1f')][_0x51a0fb['actionid']][_0xb37d('0xb5')]][_0xb37d('0x116')]=this['queueBookedRR'][this[_0xb37d('0x1f')][_0x51a0fb[_0xb37d('0x108')]][_0xb37d('0xb5')]];for(var _0xd06eb3=0x0;_0xd06eb3=0x0?!![]:![];})[_0xb37d('0xb2')](myreject(_0x331b85)));}}else{_0x49cf47['push'](ami['Action']({'action':_0xb37d('0x12a'),'command':util[_0xb37d('0x78')]('iftime\x20%s,%s',_0x58000d,!_['isUndefined'](config[_0xb37d('0x128')][_0x170692])?_0x170692:'')})[_0xb37d('0xb8')](function(_0x4da8b3){return _0x4da8b3[_0xb37d('0x12c')]['indexOf']('true')>=0x0?!![]:![];})['catch'](myreject(_0x331b85)));}BPromise['all'](_0x49cf47)[_0xb37d('0xb8')](function(_0x281b37){var _0x8f7e9=_[_0xb37d('0x12f')](_0x281b37);if(_0x8f7e9){return _0x395ef4(_0x8f7e9);}else{_0x4ccef5[_0xb37d('0x37')]=_0x2fe2ab?_0xb37d('0x130'):_0xb37d('0x131');return _0x331b85(msgResponse(_0xb37d('0x132'),'Failure',_0xb37d('0x133')+_0x2fe2ab+'\x20'+_0x16cf5a+_0xb37d('0x134')+util[_0xb37d('0x96')](_0x58000d,{'showHidden':![],'depth':null})+_0xb37d('0x135')+_0x170692));}})[_0xb37d('0xb2')](function(_0x3e7610){return _0x331b85(msgResponse(_0xb37d('0x124'),_0xb37d('0x125'),JSON[_0xb37d('0x44')](_0x3e7610)));});});};Dialer[_0xb37d('0x16')][_0xb37d('0x136')]=function(_0x4de4d0){var _0x19dbbe=this;return function(){switch(_0x4de4d0['dialMethod']){case'progressive':freeVariablesPredictive(_0x4de4d0);_0x19dbbe[_0xb37d('0x137')](_0x4de4d0,0x1);break;case'power':freeVariablesPredictive(_0x4de4d0);_0x19dbbe['handlePower'](_0x4de4d0,_0x4de4d0[_0xb37d('0x138')]);break;case _0xb37d('0x8'):_0x19dbbe[_0xb37d('0x8')](_0x4de4d0);break;case _0xb37d('0x7'):freeVariablesPredictive(_0x4de4d0);_0x19dbbe[_0xb37d('0x137')](_0x4de4d0,0x1);break;default:freeVariablesPredictive(_0x4de4d0);logger[_0xb37d('0x95')](_0xb37d('0x139'),_0x4de4d0[_0xb37d('0x39')],'method\x20not\x20recognized');}};};Dialer[_0xb37d('0x16')][_0xb37d('0x13a')]=function(_0x583a94){var _0x2a5f02=this;return function(){_0x2a5f02[_0xb37d('0x13b')](_0x583a94);};};Dialer[_0xb37d('0x16')][_0xb37d('0xa')]=function(_0x533120){var _0x21c3e5=this;if(isNotPreview(_0x533120[_0xb37d('0x56')])){if(isVoiceQueueOutbound(_0x533120[_0xb37d('0x48')])&&isActive(_0x533120['dialActive'])){_0x533120[_0xb37d('0xa0')]=!![];BPromise['resolve']()[_0xb37d('0xb8')](checkIsLoggedIn(_0x533120,_0x533120[_0xb37d('0x4b')]))['then'](checkIsActive(_0x533120,_0x533120[_0xb37d('0x55')]))['then'](checkInterval(_0x533120))[_0xb37d('0xb8')](_0x21c3e5[_0xb37d('0x13c')](_0x533120))['then'](_0x21c3e5[_0xb37d('0x123')](_0x533120[_0xb37d('0x13d')],_0x533120[_0xb37d('0x13e')],_0x533120[_0xb37d('0x39')],_0x533120))[_0xb37d('0xb8')](_0x21c3e5[_0xb37d('0x13f')](_0x533120[_0xb37d('0x3d')],_0x533120[_0xb37d('0x13e')],_0x533120[_0xb37d('0x39')],_0x533120))[_0xb37d('0xb8')](_0x21c3e5[_0xb37d('0x136')](_0x533120))[_0xb37d('0xb2')](loggerCatchQueueSummary(_0xb37d('0x140'),_0x533120));}else{notSendMessagesQueue(_0x533120);}}else{freeVariablesPredictive(_0x533120);}};Dialer[_0xb37d('0x16')][_0xb37d('0x120')]=function(){var _0x301652=this;var _0x56d2ef;for(var _0x4bca1f in this[_0xb37d('0x1a')]){if(this['campaigns'][_0xb37d('0xac')](_0x4bca1f)){_0x56d2ef=this['campaigns'][_0x4bca1f];if(isCampaignIvr(_0x56d2ef[_0xb37d('0x48')])&&isActive(_0x56d2ef['active'])){_0x56d2ef[_0xb37d('0xa0')]=!![];BPromise['resolve']()[_0xb37d('0xb8')](checkIsActive(_0x56d2ef,_0x56d2ef[_0xb37d('0x74')]))[_0xb37d('0xb8')](checkInterval(_0x56d2ef))[_0xb37d('0xb8')](_0x301652['checkIsTrunkReachable'](_0x56d2ef))[_0xb37d('0xb8')](_0x301652['checkIfTime'](_0x56d2ef[_0xb37d('0x13d')],_0x56d2ef[_0xb37d('0x13e')],_0x56d2ef[_0xb37d('0x39')],_0x56d2ef))[_0xb37d('0xb8')](_0x301652[_0xb37d('0x13f')](_0x56d2ef['Interval'],_0x56d2ef[_0xb37d('0x13e')],_0x56d2ef[_0xb37d('0x39')],_0x56d2ef))[_0xb37d('0xb8')](_0x301652['launchHandleIvr'](_0x56d2ef))[_0xb37d('0xb2')](loggerCatchQueueSummary(_0xb37d('0x141'),_0x56d2ef));}else{notSendMessagesCampaign(_0x56d2ef);}}}};function getCallerIdRandom(_0xaf38f1,_0x1c27ee){var _0x12b9e0,_0x5a7e01,_0x3beb07;if(_0x1c27ee<=0x0){_0x1c27ee=0x1;}_0x12b9e0=new RegExp('\x5cw{0,'+_0x1c27ee+'}$');_0x5a7e01=Math['pow'](0xa,_0x1c27ee-0x1);_0x3beb07=Math[_0xb37d('0x142')](0xa,_0x1c27ee)-0x1;return util[_0xb37d('0x78')]('%s',_[_0xb37d('0x143')](_0xaf38f1,_0x12b9e0,_[_0xb37d('0x144')](_0x5a7e01,_0x3beb07)));}function extractCalleridName(_0x5f11fd){var _0x187da5=_0x5f11fd[_0xb37d('0x145')](/"(.*?)"/);return _0x187da5?_0x187da5[0x1]:_0x5f11fd;}function extractCalleridNumber(_0x3367f1){var _0x487f41=_0x3367f1[_0xb37d('0x145')](/<(.*?)>/);return _0x487f41?_0x487f41[0x1]:_0x3367f1;}Dialer['prototype'][_0xb37d('0x146')]=function(_0x58bc47,_0x1c1c20){var _0x2cefac=this;var _0xe733fa=uuid['v4']();this['actions'][_0xe733fa]=new Action(_0x58bc47,_0x1c1c20,_0xe733fa);return new BPromise(function(_0x2a4dc2,_0x87ec33){if(_[_0xb37d('0x36')](_0x58bc47)&&_0xb37d('0x147')!==typeof _0x58bc47){return _0x87ec33(msgResponse(_0xb37d('0x148'),_0xb37d('0x125'),_0xb37d('0x149')));}if(_[_0xb37d('0x36')](_0x1c1c20[_0xb37d('0x14a')]['phone'])||_0x1c1c20[_0xb37d('0x14a')]['phone']===null){return _0x87ec33(msgResponse(_0xb37d('0x148'),'Failure','contact\x20is\x20undefine'));}var _0x538820={'XMD-CALLERID':_0x2cefac[_0xb37d('0x1f')][_0xe733fa][_0xb37d('0x14b')](),'XMD-AGI':_0x58bc47[_0xb37d('0xf5')]?util[_0xb37d('0x78')]('\x22agi://%s/square,%s\x22',ipAgi,_0x58bc47[_0xb37d('0xf5')]):_0xb37d('0x14c'),'XMD-AGIAFTER':_0x58bc47[_0xb37d('0xfb')]?util[_0xb37d('0x78')](_0xb37d('0x14d'),ipAgi,_0x58bc47[_0xb37d('0xfb')]):_0xb37d('0x14c'),'XMD-QUEUE':_0x58bc47[_0xb37d('0x48')]===_0xb37d('0x90')?util['format'](_0xb37d('0x14e'),_0x58bc47[_0xb37d('0x39')],_0x58bc47[_0xb37d('0x14f')]||'',_0x58bc47['dialAgiAfterHangupAgent']?'c':'',_0x58bc47[_0xb37d('0x150')]||0x3):_0xb37d('0x14c'),'XMD-CONTACTID':_0x1c1c20[_0xb37d('0xd0')],'XMD-CDRTYPE':_0xb37d('0x5'),'CALLERID(all)':_0x2cefac[_0xb37d('0x1f')][_0xe733fa]['getCaller'](),'XMD-AMD':_0x58bc47[_0xb37d('0xe8')]?_0xb37d('0x151'):'NONE','XMD-DESTINATION':_0xb37d('0xe0')};if(_0x58bc47[_0xb37d('0xe8')]){_0x538820[_0xb37d('0x152')]=_0x58bc47[_0xb37d('0x153')]||0x9c4;_0x538820['XMD-AMDGREETING']=_0x58bc47['dialAMDGreeting']||0x5dc;_0x538820[_0xb37d('0x154')]=_0x58bc47['dialAMDAfterGreetingSilence']||0x320;_0x538820[_0xb37d('0x155')]=_0x58bc47[_0xb37d('0x156')]||0x1388;_0x538820[_0xb37d('0x157')]=_0x58bc47[_0xb37d('0x158')]||0x64;_0x538820[_0xb37d('0x159')]=_0x58bc47['dialAMDBetweenWordsSilence']||0x32;_0x538820[_0xb37d('0x15a')]=_0x58bc47['dialAMDMaximumNumberOfWords']||0x3;_0x538820[_0xb37d('0x15b')]=_0x58bc47[_0xb37d('0x15c')]||0x100;_0x538820['XMD-AMDMAXIMUMWORDLENGTH']=_0x58bc47[_0xb37d('0x15d')]||0x1388;}if(_0x58bc47[_0xb37d('0x48')]==='outbound'){_0x538820['XMD-VOICEQUEUEID']=_0x1c1c20[_0xb37d('0xd3')];}else{_0x538820[_0xb37d('0x15e')]=_0x1c1c20['CampaignId'];}for(var _0x518998 in _0x1c1c20[_0xb37d('0x14a')]){if(_0x1c1c20[_0xb37d('0x14a')]['hasOwnProperty'](_0x518998)){if(isNotNull(_0x1c1c20[_0xb37d('0x14a')][_0x518998])&&_0x518998!=='id'&&_0x518998!==_0xb37d('0x15f')&&_0x518998!=='createdAt'&&_0x518998!==_0xb37d('0x160')){_0x538820[util[_0xb37d('0x78')](_0xb37d('0x161'),_0xb37d('0x162'),_[_0xb37d('0x163')](_0x518998))]=_0x1c1c20[_0xb37d('0x14a')][_0x518998];}}}var _0x33d0d2=_0x2cefac[_0xb37d('0xd9')](_0x58bc47[_0xb37d('0x73')])?getCallerId(_0x58bc47[_0xb37d('0x73')][_0xb37d('0x75')],_0x58bc47['dialOriginateCallerIdName'],_0x58bc47[_0xb37d('0x164')]>0x0?getCallerIdRandom(_0x58bc47[_0xb37d('0x165')],_0x58bc47['dialRandomLastDigitCallerIdNumber']):_0x58bc47[_0xb37d('0x165')]):getCallerId(_[_0xb37d('0xae')](_0x58bc47[_0xb37d('0x121')])?_0x58bc47[_0xb37d('0x73')][_0xb37d('0x75')]:_0x58bc47['TrunkBackup'][_0xb37d('0x75')],_0x58bc47[_0xb37d('0x57')],_0x58bc47[_0xb37d('0x164')]>0x0?getCallerIdRandom(_0x58bc47[_0xb37d('0x165')],_0x58bc47['dialRandomLastDigitCallerIdNumber']):_0x58bc47['dialOriginateCallerIdNumber']);if(_0x33d0d2){_0x538820[_0xb37d('0x166')]=_0x2cefac[_0xb37d('0x1f')][_0xe733fa][_0xb37d('0x167')]=extractCalleridName(_0x33d0d2);_0x538820[_0xb37d('0x168')]=_0x2cefac[_0xb37d('0x1f')][_0xe733fa][_0xb37d('0x169')]=extractCalleridNumber(_0x33d0d2);}return ami['Action']({'actionid':_0xe733fa,'action':'originate','channel':_0x2cefac[_0xb37d('0xd9')](_0x58bc47['Trunk'])?util['format']('SIP/%s/%s%s',_0x58bc47[_0xb37d('0x73')][_0xb37d('0x39')],isNotNull(_0x58bc47[_0xb37d('0x59')])?_0x58bc47[_0xb37d('0x59')]['trim']()||'':'',_0x58bc47[_0xb37d('0x16a')]>0x0?_0x1c1c20[_0xb37d('0x14a')][_0xb37d('0x16b')]['substring'](_0x58bc47[_0xb37d('0x16a')]):_0x1c1c20[_0xb37d('0x14a')][_0xb37d('0x16b')]):util[_0xb37d('0x78')](_0xb37d('0x16c'),_['isNil'](_0x58bc47['TrunkBackup'])?_0x58bc47['Trunk'][_0xb37d('0x39')]:_0x58bc47[_0xb37d('0x121')][_0xb37d('0x39')],isNotNull(_0x58bc47[_0xb37d('0x59')])?_0x58bc47[_0xb37d('0x59')][_0xb37d('0x16d')]()||'':'',_0x58bc47[_0xb37d('0x16a')]>0x0?_0x1c1c20[_0xb37d('0x14a')]['phone']['substring'](_0x58bc47[_0xb37d('0x16a')]):_0x1c1c20['Contact'][_0xb37d('0x16b')]),'callerid':_0x33d0d2,'Exten':_0xb37d('0xe0'),'Context':_0xb37d('0x16e'),'Priority':'1','variable':_0x538820,'timeout':(_0x58bc47[_0xb37d('0x58')]||0x1e)*0x3e8,'async':!![],'channelid':_0xe733fa})[_0xb37d('0xb8')](function(_0x3a5669){return _0x2a4dc2(_0x3a5669);})[_0xb37d('0xb2')](function(_0x5423f2){_0x58bc47[_0xb37d('0x16f')]+=0x1;var _0x12d001=new History(_0x2cefac[_0xb37d('0x1f')][_0xe733fa]);logger[_0xb37d('0x95')](util[_0xb37d('0x78')](_0xb37d('0x170'),JSON[_0xb37d('0x44')](_0x5423f2)));_0x12d001[_0xb37d('0xea')]=0xe;_0x12d001[_0xb37d('0xa6')]=_0xb37d('0x171');_0x12d001[_0xb37d('0xa7')]=moment()[_0xb37d('0x78')]('YYYY-MM-DD\x20HH:mm:ss');_0x12d001[_0xb37d('0x172')]=_0x12d001['starttime'];_0x2cefac[_0xb37d('0xc9')](_0x12d001)['catch'](loggerCatch('[originate][error]'));_0x2cefac[_0xb37d('0xc7')](_0x12d001)[_0xb37d('0xb2')](loggerCatch(_0xb37d('0x173')))['finally'](function(){delete _0x2cefac['actions'][_0xe733fa];return _0x87ec33(msgResponse(_0xb37d('0x148'),'Error',_0xb37d('0x174')));});});});};Dialer['prototype'][_0xb37d('0x175')]=function(_0x4081ce){var _0x31befe=this[_0xb37d('0x1f')][_0x4081ce[_0xb37d('0x108')]];var _0x12486d=this;if(_0x31befe){delete this['actions'][_0x4081ce[_0xb37d('0x108')]];_0x31befe[_0xb37d('0x103')]=moment()[_0xb37d('0x78')](_0xb37d('0xff'));var _0x389ca5=_0x31befe[_0xb37d('0x48')]===_0xb37d('0x77')?this[_0xb37d('0x1a')][_0x31befe[_0xb37d('0xb5')]]:this[_0xb37d('0x19')][_0x31befe['getQueue']()];if(!this[_0xb37d('0xd7')](_0x4081ce[_0xb37d('0x176')])){this[_0xb37d('0xb4')](_0x389ca5);return this[_0xb37d('0x177')](_0x31befe,_0x389ca5,_0x4081ce)['then'](function(_0x230eb6){})[_0xb37d('0xb2')](loggerCatch(_0xb37d('0x178')));}else{this[_0xb37d('0xa9')][_0x4081ce[_0xb37d('0xdc')]]=_0x31befe;}}};Dialer[_0xb37d('0x16')][_0xb37d('0x179')]=function(_0x3eccee,_0x67a868,_0x176736){var _0x46e0ec=new History(_0x67a868);if(_0x46e0ec['countbusyretry']+_0x46e0ec[_0xb37d('0x17a')]+_0x46e0ec[_0xb37d('0x17b')]>=_0x176736[_0xb37d('0x17c')]-0x1){return!![];}switch(_0x3eccee){case 0x3:if(_0x46e0ec['countnoanswerretry']>=_0x176736[_0xb37d('0x17d')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x46e0ec[_0xb37d('0x17b')]+=0x1,'scheduledat':moment()[_0xb37d('0x17e')](_0x176736[_0xb37d('0x17f')],_0xb37d('0x180'))[_0xb37d('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x46e0ec[_0xb37d('0xd0')],'ListId':_0x46e0ec[_0xb37d('0xd1')],'VoiceQueueId':_0x46e0ec[_0xb37d('0xd3')]||undefined,'CampaignId':_0x46e0ec[_0xb37d('0xd4')]||undefined})[_0xb37d('0xb2')](loggerCatch(_0xb37d('0x181')));}break;case 0x5:if(_0x46e0ec[_0xb37d('0x182')]>=_0x176736[_0xb37d('0x183')]-0x1){return!![];}else{this[_0xb37d('0xc0')]({'active':![],'countbusyretry':_0x46e0ec[_0xb37d('0x182')]+=0x1,'scheduledat':moment()[_0xb37d('0x17e')](_0x176736['dialBusyRetryFrequency'],_0xb37d('0x180'))[_0xb37d('0x78')](_0xb37d('0xff')),'ContactId':_0x46e0ec[_0xb37d('0xd0')],'ListId':_0x46e0ec['ListId'],'VoiceQueueId':_0x46e0ec[_0xb37d('0xd3')]||undefined,'CampaignId':_0x46e0ec[_0xb37d('0xd4')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x46e0ec[_0xb37d('0x17a')]>=_0x176736['dialCongestionMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0x46e0ec['countcongestionretry']+=0x1,'scheduledat':moment()[_0xb37d('0x17e')](_0x176736[_0xb37d('0x184')],_0xb37d('0x180'))[_0xb37d('0x78')](_0xb37d('0xff')),'ContactId':_0x46e0ec['ContactId'],'ListId':_0x46e0ec[_0xb37d('0xd1')],'VoiceQueueId':_0x46e0ec['VoiceQueueId']||undefined,'CampaignId':_0x46e0ec['CampaignId']||undefined})['catch'](loggerCatch(_0xb37d('0x185')));}break;default:return!![];}};Dialer[_0xb37d('0x16')]['callProgressDetecting']=function(_0x35aa60,_0x14b8d4,_0x27c414){var _0x4c6864=this;var _0x29e563=new History(_0x35aa60);return new BPromise(function(_0x5bd0a4,_0x115309){if(_[_0xb37d('0x36')](_0x14b8d4)&&_0xb37d('0x147')!==typeof _0x14b8d4){return _0x115309(msgResponse(_0xb37d('0x186'),_0xb37d('0x125'),_0xb37d('0x187')));}if(_[_0xb37d('0x36')](_0x27c414)&&_0xb37d('0x147')!==typeof _0x27c414){return _0x115309(msgResponse('[callProgressDetecting]',_0xb37d('0x125'),'evt\x20is\x20undefine'));}switch(_0x27c414[_0xb37d('0xf8')]){case'0':_0x14b8d4[_0xb37d('0x62')]+=0x1;_0x29e563[_0xb37d('0xea')]=0x0;_0x29e563[_0xb37d('0xa6')]=_0xb37d('0x188');_0x4c6864[_0xb37d('0xc9')](_0x29e563)['catch'](loggerCatch(_0xb37d('0x189')));if(_0x4c6864[_0xb37d('0x179')](0x0,_0x35aa60,_0x14b8d4)){if(_0x29e563['countbusyretry']+_0x29e563[_0xb37d('0x17a')]+_0x29e563[_0xb37d('0x17b')]>=_0x14b8d4[_0xb37d('0x17c')]){_0x4c6864[_0xb37d('0x18a')](_0x29e563,_0x5bd0a4,_0x115309,'reason\x200\x20no\x20such\x20number....');}else{_0x4c6864[_0xb37d('0x18b')](_0x29e563,_0x5bd0a4,_0x115309,_0xb37d('0x18c'));}}break;case'3':_0x14b8d4[_0xb37d('0x61')]+=0x1;_0x29e563[_0xb37d('0xea')]=0x3;_0x29e563['statedesc']=_0xb37d('0x18d');_0x29e563['countnoanswerretry']+=0x1;_0x29e563[_0xb37d('0x18e')]+=0x1;_0x4c6864[_0xb37d('0xc9')](_0x29e563)[_0xb37d('0xb2')](loggerCatch(_0xb37d('0x18f')));if(_0x4c6864[_0xb37d('0x179')](0x3,_0x35aa60,_0x14b8d4)){if(_0x29e563[_0xb37d('0x17b')]>=_0x14b8d4[_0xb37d('0x17d')]){_0x4c6864['createStateFinal'](_0x29e563,_0x5bd0a4,_0x115309,_0xb37d('0x190'));}else{_0x4c6864['stateGlobal'](_0x29e563,_0x5bd0a4,_0x115309,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x14b8d4[_0xb37d('0x5d')]+=0x1;_0x29e563[_0xb37d('0xea')]=0x5;_0x29e563[_0xb37d('0xa6')]='Busy';_0x29e563[_0xb37d('0x182')]+=0x1;_0x29e563[_0xb37d('0x18e')]+=0x1;_0x4c6864[_0xb37d('0xc9')](_0x29e563)[_0xb37d('0xb2')](loggerCatch(_0xb37d('0x191')));if(_0x4c6864[_0xb37d('0x179')](0x5,_0x35aa60,_0x14b8d4)){if(_0x29e563['countbusyretry']>=_0x14b8d4['dialBusyMaxRetry']){_0x4c6864['createStateFinal'](_0x29e563,_0x5bd0a4,_0x115309,_0xb37d('0x192'));}else{_0x4c6864[_0xb37d('0x18a')](_0x29e563,_0x5bd0a4,_0x115309,_0xb37d('0x192'));}}break;case'8':_0x14b8d4[_0xb37d('0x5e')]+=0x1;_0x29e563['state']=0x8;_0x29e563[_0xb37d('0xa6')]=_0xb37d('0x193');_0x29e563['countcongestionretry']+=0x1;_0x29e563['countglobal']+=0x1;_0x4c6864['createHistory'](_0x29e563)[_0xb37d('0xb2')](loggerCatch(_0xb37d('0x194')));if(_0x4c6864[_0xb37d('0x179')](0x8,_0x35aa60,_0x14b8d4)){if(_0x29e563[_0xb37d('0x17a')]>=_0x14b8d4['dialCongestionMaxRetry']){_0x4c6864[_0xb37d('0x18b')](_0x29e563,_0x5bd0a4,_0x115309,'reason\x208\x20congestion');}else{_0x4c6864[_0xb37d('0x18a')](_0x29e563,_0x5bd0a4,_0x115309,'reason\x208\x20congestion');}}break;default:_0x14b8d4[_0xb37d('0x65')]+=0x1;_0x29e563[_0xb37d('0xea')]=0xc;_0x29e563[_0xb37d('0xa6')]=_0x27c414[_0xb37d('0xf8')];_0x4c6864['createHistory'](_0x29e563)[_0xb37d('0xb2')](loggerCatch(_0xb37d('0x195')));if(_0x4c6864[_0xb37d('0x179')](_0x27c414[_0xb37d('0xf8')],_0x35aa60,_0x14b8d4)){if(_0x29e563[_0xb37d('0x182')]+_0x29e563[_0xb37d('0x17a')]+_0x29e563[_0xb37d('0x17b')]>=_0x14b8d4['dialGlobalMaxRetry']){_0x4c6864['stateGlobal'](_0x29e563,_0x5bd0a4,_0x115309,_0x27c414[_0xb37d('0xf8')]);}else{_0x4c6864['createStateFinal'](_0x29e563,_0x5bd0a4,_0x115309,_0x27c414[_0xb37d('0xf8')]);}}}});};Dialer[_0xb37d('0x16')][_0xb37d('0x18a')]=function(_0x5c2459,_0x1984a5,_0x265221,_0x566a31){var _0x28d749=new Final(_0x5c2459);_0x28d749[_0xb37d('0xea')]=0xf;_0x28d749[_0xb37d('0xa6')]='Global';this[_0xb37d('0x18b')](_0x28d749,_0x1984a5,_0x265221,_0x566a31);};Dialer[_0xb37d('0x16')][_0xb37d('0x18b')]=function(_0x5589b6,_0x538eae,_0x23f061,_0x53e9ee){this[_0xb37d('0xc7')](_0x5589b6)['then'](function(_0x410fe6){return _0x538eae(msgResponse(_0xb37d('0x186'),'Success',_0x53e9ee));})[_0xb37d('0xb2')](function(_0x194fb2){return _0x23f061(msgResponse('[moveContactManagedDialer][0]',_0xb37d('0x125'),_0xb37d('0x196')));});};Dialer[_0xb37d('0x16')][_0xb37d('0x8')]=function(_0x2beba7){var _0x5c89cf=this;var _0x320a2a=_0x2beba7[_0xb37d('0x197')]/0x64;var _0x28ffbe=_0x2beba7[_0xb37d('0x60')]/(_0x2beba7['outboundDropCallsDayTimeout']+_0x2beba7[_0xb37d('0x5b')]);var _0x591a1c=Math[_0xb37d('0x198')](_0x2beba7[_0xb37d('0x6e')]*(_0x2beba7[_0xb37d('0x199')]/0x64));var _0xfe527e=Math['round'](_0x2beba7['predictiveIntervalAvailable']*(_0x2beba7[_0xb37d('0x19a')]/0x64));var _0x343155=_0x2beba7[_0xb37d('0x19b')]+_0x2beba7[_0xb37d('0x4f')];var _0x29eda1=Math[_0xb37d('0x19c')](_0x2beba7[_0xb37d('0x70')]*_0x2beba7[_0xb37d('0x19d')]*_0x2beba7[_0xb37d('0x6c')]*_0x2beba7['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x2beba7[_0xb37d('0x72')])){if(!_[_0xb37d('0x36')](_0x2beba7['startPredictive'])){_0x2beba7[_0xb37d('0x22')]=undefined;loggerPredictive[_0xb37d('0x95')](_0xb37d('0x19e'),_0xb37d('0x19f'));}if(!_['isUndefined'](_0x2beba7[_0xb37d('0x8e')])){loggerPredictive['error'](_0xb37d('0x19e'),_0xb37d('0x1a0'));clearInterval(_0x2beba7['handlePredictive']);_0x2beba7[_0xb37d('0x8e')]=undefined;}_0x2beba7[_0xb37d('0x72')]=moment()[_0xb37d('0x78')](_0xb37d('0xff'));loggerPredictive[_0xb37d('0x7b')](_0x2beba7[_0xb37d('0x39')],_0xb37d('0x1a1'),_0x2beba7[_0xb37d('0x72')]);this[_0xb37d('0x137')](_0x2beba7,0x1);}else if(ifInterval(_0x2beba7[_0xb37d('0x1a2')],_0x2beba7['startProgressive'])){this['handlePower'](_0x2beba7,0x1);loggerPredictiveCalls[_0xb37d('0x7b')](_0xb37d('0x1a3'),_0x2beba7[_0xb37d('0x72')],_0x2beba7[_0xb37d('0x39')]);_0x2beba7[_0xb37d('0x70')]=0x0;_0x2beba7['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x320a2a<_0x28ffbe&&_0x2beba7[_0xb37d('0x1a4')]===_0xb37d('0x1a5')){freeVariablesPredictive(_0x2beba7);loggerPredictive[_0xb37d('0x7b')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xb37d('0x1a6'),_0x28ffbe,'startProgressive',_0x2beba7[_0xb37d('0x39')]);}else if(_0x29eda1<_0x2beba7[_0xb37d('0x6b')]&&_0x2beba7[_0xb37d('0x1a4')]===_0xb37d('0x1a5')){freeVariablesPredictive(_0x2beba7);loggerPredictive[_0xb37d('0x7b')](_0xb37d('0x1a7'),'Max\x20Drop\x20',_0x29eda1,_0xb37d('0x1a8'),_0x2beba7[_0xb37d('0x6b')],'startProgressive',_0x2beba7[_0xb37d('0x39')]);}else if(!ifInterval(_0x2beba7[_0xb37d('0x1a2')],_0x2beba7[_0xb37d('0x72')])&&_[_0xb37d('0x36')](_0x2beba7['startPredictive'])&&!_[_0xb37d('0x36')](_0x2beba7['startProgressive'])){_0x2beba7[_0xb37d('0x22')]=moment()['format'](_0xb37d('0xff'));loggerPredictive['info'](_0x2beba7[_0xb37d('0x39')],_0xb37d('0x1a9'),_0x2beba7[_0xb37d('0x22')]);this[_0xb37d('0xbe')](_0x2beba7[_0xb37d('0x1a2')])['then'](this[_0xb37d('0x1aa')](_0x2beba7))[_0xb37d('0xb8')](mergeDataErlangB(_0x2beba7))[_0xb37d('0xb8')](this[_0xb37d('0x1ab')](_0x2beba7))[_0xb37d('0xb2')](loggerCatchPredictive(_0xb37d('0x1ac'),_0x2beba7));}else if(!ifInterval(_0x2beba7[_0xb37d('0x1a2')],_0x2beba7[_0xb37d('0x22')])){_0x2beba7[_0xb37d('0x6b')]=0x0;_0x2beba7[_0xb37d('0x22')]=moment()[_0xb37d('0x78')](_0xb37d('0xff'));loggerPredictive['info'](_0x2beba7[_0xb37d('0x39')],_0xb37d('0x1ad'),_0x2beba7[_0xb37d('0x22')]);clearInterval(_0x2beba7[_0xb37d('0x8e')]);_0x2beba7['handlePredictive']=undefined;this[_0xb37d('0xbe')](_0x2beba7[_0xb37d('0x1a2')])['then'](this['getDataPredictive'](_0x2beba7))['then'](mergeDataErlangB(_0x2beba7))[_0xb37d('0xb8')](this['startMethodPredictive'](_0x2beba7))[_0xb37d('0xb2')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x2beba7));}else if(_0x2beba7[_0xb37d('0x6e')]&&_0x343155<_0x2beba7[_0xb37d('0x6e')]-_0xfe527e){freeVariablesPredictive(_0x2beba7);loggerPredictive[_0xb37d('0x7b')](_0x2beba7[_0xb37d('0x39')],_0xb37d('0x1ae'),_0x343155,')\x20are\x20less\x20than\x20threshold\x20(',_0x2beba7['predictiveIntervalAvailable'],'-',_0xfe527e,'=',_0x2beba7[_0xb37d('0x6e')]-_0xfe527e,')');}else if(_0x2beba7[_0xb37d('0x6e')]&&_0x343155>_0x2beba7['predictiveIntervalAvailable']+_0x591a1c){freeVariablesPredictive(_0x2beba7);loggerPredictive[_0xb37d('0x7b')](_0x2beba7[_0xb37d('0x39')],_0xb37d('0x1ae'),_0x343155,')\x20are\x20more\x20than\x20threshold\x20(',_0x2beba7[_0xb37d('0x6e')],'+',_0x591a1c,'=',_0x2beba7[_0xb37d('0x6e')]+_0x591a1c,')');}};Dialer['prototype'][_0xb37d('0x1aa')]=function(_0x41e8ef){var _0x230257=this;return function(_0x11c9a4){return new BPromise(function(_0x54b884,_0x4dcff5){_['merge'](_0x41e8ef,_0x11c9a4[0x0]);if(checkGetDataPredictive(_0x11c9a4[0x0])){var _0x15e2c2=_0x41e8ef[_0xb37d('0x6e')]=_0x41e8ef[_0xb37d('0x4f')]+_0x41e8ef['available'];var _0x1f06df=_0x41e8ef[_0xb37d('0x1a2')]*0x3c;var _0x2244c1=_0x11c9a4[0x0][_0xb37d('0x67')]+_0x11c9a4[0x0][_0xb37d('0x66')];var _0x2de010=(_0x11c9a4[0x0][_0xb37d('0x7f')]+_0x11c9a4[0x0][_0xb37d('0x69')]+_0x11c9a4[0x0][_0xb37d('0x68')])/_0x11c9a4[0x0][_0xb37d('0x6f')];_0x41e8ef['predictiveIntervalHitRate']=_0x2de010>0x0?_0x2de010:0x1;switch(_0x41e8ef[_0xb37d('0x1a4')]){case _0xb37d('0x1a5'):var _0x5c9486=_0x41e8ef[_0xb37d('0x197')]/0x64;return _0x230257[_0xb37d('0x1af')](_0x15e2c2,_0x1f06df,_0x2244c1,_0x2de010,_0x5c9486)[_0xb37d('0xb8')](function(_0x10e8e4){return _0x54b884(_0x10e8e4);});case'agentBusyFactor':var _0x57f13b=_0x41e8ef[_0xb37d('0x197')]/0x64;return _0x230257[_0xb37d('0x1b0')](_0x15e2c2,_0x1f06df,_0x2244c1,_0x2de010,_0x57f13b)[_0xb37d('0xb8')](function(_0x3c7425){return _0x54b884(_0x3c7425);});default:return _0x4dcff5(msgResponse('[getDataPredictive]','Failure','Unknown\x20Predictive'));}}else{return _0x4dcff5(msgResponse(_0xb37d('0x1b1'),_0xb37d('0x125'),_0xb37d('0x1b2')));}});};};Dialer['prototype'][_0xb37d('0x1b3')]=function(_0x5a324f){var _0x3e2d53=this;return function(_0x390f8e){return new BPromise(function(_0x59e390,_0x3bdf4b){_[_0xb37d('0x8b')](_0x5a324f,_0x390f8e[0x0]);if(checkGetDataPredictive(_0x390f8e[0x0])){loggerPredictive[_0xb37d('0x7b')](JSON[_0xb37d('0x44')](_0x390f8e[0x0]));if(_0x5a324f[_0xb37d('0x1a4')]===_0xb37d('0x1a5')){return _0x3e2d53['getVoiceQueueRtPauses'](_0x5a324f['id'])[_0xb37d('0xb8')](function(_0x164387){var _0x2be547=_0x5a324f['loggedIn']-_0x164387[0x0][_0xb37d('0x1b4')];var _0x356229=_0x5a324f[_0xb37d('0x1a2')]*0x3c;var _0x473bc3=_0x390f8e[0x0][_0xb37d('0x67')]+_0x390f8e[0x0][_0xb37d('0x66')];var _0x36a98d=(_0x390f8e[0x0][_0xb37d('0x7f')]+_0x390f8e[0x0][_0xb37d('0x69')]+_0x390f8e[0x0][_0xb37d('0x68')])/_0x390f8e[0x0][_0xb37d('0x6f')];var _0x4a5643=_0x5a324f['dialPredictiveOptimizationPercentage']/0x64;_0x5a324f[_0xb37d('0x6d')]=_0x164387[0x0]['outboundQueuePauses']||0x0;_0x5a324f[_0xb37d('0x6c')]=_0x36a98d>0x0?_0x36a98d:0x1;return _0x3e2d53[_0xb37d('0x1af')](_0x2be547,_0x356229,_0x473bc3,_0x36a98d,_0x4a5643);})['then'](function(_0x42960b){return _0x59e390(_0x42960b);})[_0xb37d('0xb2')](function(_0x2d1862){return _0x3bdf4b(msgResponse(_0xb37d('0x1b5'),_0xb37d('0x125'),JSON[_0xb37d('0x44')](_0x2d1862)));});}if(_0x5a324f['dialPredictiveOptimization']===_0xb37d('0x1b6')){return _0x3e2d53[_0xb37d('0xc5')](_0x5a324f['id'])[_0xb37d('0xb8')](function(_0x372fce){var _0xf80e6d=_0x5a324f[_0xb37d('0x4b')]-_0x372fce[0x0][_0xb37d('0x1b4')];var _0x5b21cd=_0x5a324f['dialPredictiveInterval']*0x3c;var _0x7a815d=_0x390f8e[0x0][_0xb37d('0x67')]+_0x390f8e[0x0][_0xb37d('0x66')];var _0x4ac0b2=(_0x390f8e[0x0][_0xb37d('0x7f')]+_0x390f8e[0x0][_0xb37d('0x69')]+_0x390f8e[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x390f8e[0x0][_0xb37d('0x6f')];var _0x3dc9bd=_0x5a324f[_0xb37d('0x197')]/0x64;_0x5a324f[_0xb37d('0x6d')]=_0x372fce[0x0]['outboundQueuePauses']||0x0;_0x5a324f[_0xb37d('0x6c')]=_0x4ac0b2>0x0?_0x4ac0b2:0x1;return _0x3e2d53['busyFactor'](_0xf80e6d,_0x5b21cd,_0x7a815d,_0x4ac0b2,_0x3dc9bd);})['then'](function(_0x5aa8be){return _0x59e390(_0x5aa8be);})['catch'](function(_0x5021a1){return _0x3bdf4b(msgResponse(_0xb37d('0x1b5'),_0xb37d('0x125'),JSON[_0xb37d('0x44')](_0x5021a1)));});}}else{return _0x3bdf4b(msgResponse(_0xb37d('0x1b1'),_0xb37d('0x125'),_0xb37d('0x1b2')));}});};};Dialer[_0xb37d('0x16')][_0xb37d('0x1ab')]=function(_0x4c8e40){var _0x47b1e1=this;return function(){var _0x58912a=0x0;var _0x278782=Math['floor'](_0x4c8e40[_0xb37d('0x71')]*0x3e8);if(_0x278782>0x0){_0x278782=_0x278782<0x64?0x64:_0x278782;loggerPredictive[_0xb37d('0x7b')](_0x4c8e40[_0xb37d('0x39')],_0xb37d('0x1b7'),_0x278782,_0xb37d('0x45'));_0x4c8e40[_0xb37d('0x8e')]=setInterval(function(){_0x47b1e1['handlePredictive'](_0x4c8e40);loggerPredictiveCalls[_0xb37d('0x7b')](_0xb37d('0x1b8'),_0x58912a+=0x1);},_0x278782);}else{loggerPredictive[_0xb37d('0x7b')](_0x4c8e40[_0xb37d('0x39')],_0xb37d('0x1b9'));}};};Dialer[_0xb37d('0x16')]['checkContactBlack']=function(_0x4736e3,_0x472c95){var _0x5118a7=this;return function(_0x11bb48){if(_[_0xb37d('0x41')](_0x11bb48)){if(_[_0xb37d('0xae')](_0x472c95[_0xb37d('0xd2')])||!_0x472c95[_0xb37d('0x1ba')]){if(_0x4736e3[_0xb37d('0x56')]===_0xb37d('0x7')){_0x4736e3[_0xb37d('0x10e')]=_[_0xb37d('0x36')](_0x4736e3[_0xb37d('0x10e')])?!![]:_0x4736e3[_0xb37d('0x10e')];var _0x5510a9=uuid['v4']();_0x5118a7[_0xb37d('0x1f')][_0x5510a9]=new Action(_0x4736e3,_0x472c95,_0x5510a9);loggerBooked[_0xb37d('0x7b')](_0xb37d('0x1bb'),_0x5510a9,_0xb37d('0x1bc'),JSON[_0xb37d('0x44')](_0x4736e3[_0xb37d('0x10e')]),_0xb37d('0x1bd'),_0x4736e3[_0xb37d('0x39')]);if(_0x4736e3[_0xb37d('0x10e')]){_0x4736e3[_0xb37d('0x10e')]=![];_0x5118a7[_0xb37d('0x24')][_0x5118a7[_0xb37d('0x1f')][_0x5510a9][_0xb37d('0xb5')]]=[];ami[_0xb37d('0xaf')]({'actionid':_0x5510a9,'action':'queuestatus','queue':_0x4736e3[_0xb37d('0x39')]})['catch'](function(_0x283b22){_0x5118a7[_0xb37d('0xb4')](_0x4736e3);_0x5118a7[_0xb37d('0xc0')]({'active':![],'ContactId':_0x5118a7[_0xb37d('0x1f')][_0x5510a9][_0xb37d('0xd0')],'ListId':_0x5118a7[_0xb37d('0x1f')][_0x5510a9]['ListId'],'VoiceQueueId':_0x5118a7['actions'][_0x5510a9]['VoiceQueueId']||undefined,'CampaignId':_0x5118a7[_0xb37d('0x1f')][_0x5510a9][_0xb37d('0xd4')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5118a7[_0xb37d('0x1f')][_0x5510a9];});}else{loggerBooked['info'](_0xb37d('0x1be'),JSON['stringify'](_0x4736e3['queueStatusComplete']),'Queue:\x20',_0x4736e3[_0xb37d('0x39')]);_0x5118a7[_0xb37d('0xb4')](_0x4736e3);_0x5118a7[_0xb37d('0xc0')]({'active':![],'ContactId':_0x5118a7[_0xb37d('0x1f')][_0x5510a9][_0xb37d('0xd0')],'ListId':_0x5118a7[_0xb37d('0x1f')][_0x5510a9][_0xb37d('0xd1')],'VoiceQueueId':_0x5118a7[_0xb37d('0x1f')][_0x5510a9]['VoiceQueueId']||undefined,'CampaignId':_0x5118a7['actions'][_0x5510a9][_0xb37d('0xd4')]||undefined})[_0xb37d('0xb2')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5118a7[_0xb37d('0x1f')][_0x5510a9];}}else{return _0x5118a7[_0xb37d('0x146')](_0x4736e3,_0x472c95);}}else{if(getDiff(_0x472c95[_0xb37d('0x1bf')])<_0x4736e3[_0xb37d('0x1c0')]*0x3c){_0x5118a7[_0xb37d('0x91')]['run'](_0x472c95['id'])[_0xb37d('0x113')](function(){_0x5118a7[_0xb37d('0xb4')](_0x4736e3);});}else{_0x4736e3[_0xb37d('0x63')]+=0x1;_0x5118a7['updateOriginated'](_0x4736e3);if(_0x4736e3['dialRecallInQueue']){_0x5118a7[_0xb37d('0xc0')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x472c95[_0xb37d('0xd0')],'ListId':_0x472c95['ListId'],'VoiceQueueId':_0x472c95[_0xb37d('0xd3')]||undefined,'CampaignId':_0x472c95['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x5118a7[_0xb37d('0xc9')](createObjHistory(_0x4736e3,_0x472c95,_0xb37d('0x1c1'),0x17,_0xb37d('0x1c2')))['catch'](loggerCatch(_0xb37d('0x1c3')));}else{_0x5118a7[_0xb37d('0xce')](createObjHistory(_0x4736e3,_0x472c95,'RECALLFAILEDTIMEOUT',0x16,_0xb37d('0x1c4')),'[Originate][HistoryRecallClose][historyCatch]',_0xb37d('0x1c5'));}}}}else{_0x4736e3[_0xb37d('0x5c')]+=0x1;_0x5118a7[_0xb37d('0xce')](createObjHistory(_0x4736e3,_0x472c95,_0xb37d('0x1c6'),0xd,_0xb37d('0x1c7')),_0xb37d('0x1c8'),_0xb37d('0x1c9'));throw _0xb37d('0x1ca');}};};Dialer[_0xb37d('0x16')][_0xb37d('0x13b')]=function(_0x3ad80c){var _0x19dca1=this;var _0x17cdff=[];var _0x3c9384=_0x3ad80c['limitCalls']-_0x3ad80c['originated']-_0x3ad80c[_0xb37d('0x1cb')];emitCampaignSummary(_0x3ad80c);if(_0x3c9384>0x0){if(_0x3c9384>this['maxNumberOriginate']){_0x3c9384=this[_0xb37d('0x1d')];}_0x3ad80c[_0xb37d('0x1cb')]+=_0x3c9384;this[_0xb37d('0xc4')](_0x3ad80c['id'],_0x3c9384,_0x3ad80c[_0xb37d('0x1cc')])[_0xb37d('0xb8')](function(_0x246575){_0x3ad80c[_0xb37d('0x1cb')]-=_0x3c9384;_0x3ad80c[_0xb37d('0x1cb')]=_0x3ad80c[_0xb37d('0x1cb')]>0x0?_0x3ad80c[_0xb37d('0x1cb')]:0x0;if(!checkContactEmpty(_0x246575)){_0x3ad80c[_0xb37d('0x37')]=_0xb37d('0x9e');logger['info'](_0xb37d('0x1cd')+_0x3ad80c['name']);}else{_0x3ad80c[_0xb37d('0x99')]+=_0x246575[_0xb37d('0x98')];_0x3ad80c[_0xb37d('0x37')]='RUNNING';for(var _0x313db6=0x0;_0x313db6<_0x246575[_0xb37d('0x98')];_0x313db6+=0x1){_0x3ad80c['ivrTotalCallsDays']+=0x1;if(_[_0xb37d('0xae')](_0x246575[_0x313db6])||_[_0xb37d('0xae')](_0x246575[_0x313db6][_0xb37d('0x14a')])||_[_0xb37d('0xae')](_0x246575[_0x313db6][_0xb37d('0x14a')][_0xb37d('0x16b')])){_0x19dca1[_0xb37d('0xcc')](_0xb37d('0x1ce'),_0x3ad80c,_0x246575[_0x313db6]);}else{_0x19dca1['checkIsBlackListIvr'](_[_0xb37d('0xcf')](_0x246575[_0x313db6],['CampaignId','Contact.phone']))[_0xb37d('0xb8')](_0x19dca1['checkContactBlack'](_0x3ad80c,_0x246575[_0x313db6]))[_0xb37d('0xb2')](_0x19dca1[_0xb37d('0xcb')]('[actionOriginateIvr]\x20',_0x3ad80c));}}}})['catch'](loggerGetContactDialer(_0xb37d('0x1cf'),_0x3ad80c,_0x3c9384));}};Dialer['prototype'][_0xb37d('0x137')]=function(_0x23bc4a,_0x366dbb){var _0x225552=this;var _0x47f7e6=[];var _0x3b364b=_0x366dbb>=0x1?_0x366dbb:0x1;var _0x2214fb=[];if(_0x23bc4a[_0xb37d('0x56')]==='booked'){_0x3b364b=0x1;}var _0x5b8918=Math['floor'](_0x23bc4a['available']*_0x3b364b)-_0x23bc4a[_0xb37d('0x99')]-_0x23bc4a[_0xb37d('0x1cb')];emitVoiceQueueSummary(_0x23bc4a);if(_0x23bc4a[_0xb37d('0x1d0')]>0x0){var _0x2cb44b=_0x23bc4a[_0xb37d('0x1d0')]-_0x23bc4a[_0xb37d('0x99')]-_0x23bc4a[_0xb37d('0x4f')]-_0x23bc4a[_0xb37d('0x1cb')]-_0x23bc4a[_0xb37d('0x4c')];if(_0x5b8918>_0x2cb44b){_0x5b8918=_0x2cb44b;}}if(_0x5b8918>0x0){if(_0x23bc4a[_0xb37d('0x56')]==='booked'){_0x5b8918=0x1;}if(_0x5b8918>this[_0xb37d('0x1d')]){_0x5b8918=this['maxNumberOriginate'];}_0x23bc4a[_0xb37d('0x1cb')]+=_0x5b8918;for(var _0x4b435a in this['agents']){if(this[_0xb37d('0x1b')][_0xb37d('0xac')](_0x4b435a)){if(this[_0xb37d('0x1b')][_0x4b435a][_0xb37d('0xea')]===_0xb37d('0x1d1')&&this[_0xb37d('0x1b')][_0x4b435a][_0xb37d('0xb0')]===_0xb37d('0x1d2')){_0x47f7e6[_0xb37d('0x10c')](this['agents'][_0x4b435a]['id']);}}}this[_0xb37d('0xc2')](_0x23bc4a['id'],_0x47f7e6,_0x5b8918,_0x23bc4a[_0xb37d('0x1cc')])[_0xb37d('0xb8')](function(_0x22c6d4){_0x23bc4a[_0xb37d('0x1cb')]-=_0x5b8918;_0x23bc4a[_0xb37d('0x1cb')]=_0x23bc4a[_0xb37d('0x1cb')]>0x0?_0x23bc4a[_0xb37d('0x1cb')]:0x0;if(!checkContactEmpty(_0x22c6d4)){_0x225552['countReScheduled'](_0x23bc4a)['then'](sendMessageReschedule(_0x23bc4a))[_0xb37d('0xb2')](loggerCatch(_0xb37d('0x1d3')));}else{_0x23bc4a[_0xb37d('0x99')]+=_0x22c6d4[_0xb37d('0x98')];_0x23bc4a[_0xb37d('0x37')]=_0x23bc4a[_0xb37d('0x56')]===_0xb37d('0x7')?_0xb37d('0x151'):_0xb37d('0x1d4');for(var _0xc03c=0x0;_0xc03c<_0x22c6d4['length'];_0xc03c+=0x1){if(_[_0xb37d('0xae')](_0x22c6d4[_0xc03c])||_['isNil'](_0x22c6d4[_0xc03c][_0xb37d('0x14a')])||_[_0xb37d('0xae')](_0x22c6d4[_0xc03c][_0xb37d('0x14a')]['phone'])){_0x225552['emptyContact'](_0xb37d('0x1ce'),_0x23bc4a,_0x22c6d4[_0xc03c]);}else{_0x225552[_0xb37d('0xb9')](_[_0xb37d('0xcf')](_0x22c6d4[_0xc03c],[_0xb37d('0xd3'),_0xb37d('0x1d5')]))[_0xb37d('0xb8')](_0x225552['checkContactBlack'](_0x23bc4a,_0x22c6d4[_0xc03c]))[_0xb37d('0xb2')](_0x225552[_0xb37d('0xcb')](_0xb37d('0x1ce'),_0x23bc4a));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x23bc4a,_0x5b8918));}};Dialer['prototype'][_0xb37d('0x8e')]=function(_0x12f9d8){var _0x2ded97=this;if(_0x12f9d8['dialLimitQueue']>0x0){var _0x2ec489=_0x12f9d8[_0xb37d('0x1d0')]-_0x12f9d8[_0xb37d('0x99')]-_0x12f9d8[_0xb37d('0x4f')];if(_0x2ec489>0x0){this[_0xb37d('0x1d6')](_0x12f9d8);}else{loggerPredictiveCalls[_0xb37d('0x7b')](_0xb37d('0x1d7'));}}else{this['tryOriginatePredictive'](_0x12f9d8);}};Dialer['prototype'][_0xb37d('0x1d6')]=function(_0x102835){var _0x568c5d=this;var _0x44befa=[];_0x102835[_0xb37d('0x99')]+=0x1;for(var _0xa041cb in this[_0xb37d('0x1b')]){if(this[_0xb37d('0x1b')][_0xb37d('0xac')](_0xa041cb)){if(this['agents'][_0xa041cb]['state']===_0xb37d('0x1d1')&&this[_0xb37d('0x1b')][_0xa041cb][_0xb37d('0xb0')]==='reachable'){_0x44befa[_0xb37d('0x10c')](this[_0xb37d('0x1b')][_0xa041cb]['id']);}}}this[_0xb37d('0xc2')](_0x102835['id'],_0x44befa,0x1,_0x102835[_0xb37d('0x1cc')])[_0xb37d('0xb8')](function(_0x59f0ed){if(!checkContactEmpty(_0x59f0ed)){checkContactLowerLimitOriginate(_0x102835,0x1,0x0);_0x568c5d[_0xb37d('0xb7')](_0x102835)[_0xb37d('0xb8')](sendMessageReschedule(_0x102835))[_0xb37d('0xb2')](loggerCatch(_0xb37d('0x1d3')));}else{_0x102835[_0xb37d('0x37')]=_0xb37d('0x1d4');if(_['isNil'](_0x59f0ed[0x0])||_[_0xb37d('0xae')](_0x59f0ed[0x0][_0xb37d('0x14a')])||_[_0xb37d('0xae')](_0x59f0ed[0x0][_0xb37d('0x14a')][_0xb37d('0x16b')])){_0x568c5d['emptyContact'](_0xb37d('0x1ce'),_0x102835,_0x59f0ed[0x0]);}else{_0x568c5d['checkIsBlackList'](_[_0xb37d('0xcf')](_0x59f0ed[0x0],['VoiceQueueId','Contact.phone']))['then'](_0x568c5d[_0xb37d('0x1d8')](_0x102835,_0x59f0ed[0x0]))[_0xb37d('0xb2')](_0x568c5d[_0xb37d('0xcb')]('[actionOriginatePredictive]\x20',_0x102835));}}})[_0xb37d('0xb2')](loggerGetContactDialer('[getContactDialerPredictive]',_0x102835,0x1));emitVoiceQueueSummary(_0x102835);};Dialer['prototype']['abandonmentRate']=function(_0x3dd3aa,_0x22c620,_0x48bfe2,_0x3f39b9,_0x52f4ec,_0x4c407c){loggerPredictive['info'](_0xb37d('0x1d9'));loggerPredictive['info'](_0xb37d('0x1da'),_0x3dd3aa);loggerPredictive[_0xb37d('0x7b')](_0xb37d('0x1db'),_0x22c620);loggerPredictive[_0xb37d('0x7b')](_0xb37d('0x1dc'),_0x48bfe2);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',_0x3f39b9);loggerPredictive[_0xb37d('0x7b')](_0xb37d('0x1dd'),_0x52f4ec);loggerPredictive[_0xb37d('0x7b')]('---------------------------');return new BPromise(function(_0x1219eb,_0x5c9d67){if(_0x3dd3aa<=0x0||isNaN(_0x3dd3aa)){return _0x5c9d67(msgResponse(_0xb37d('0x1de'),_0xb37d('0x43'),_0xb37d('0x1df')+_0x3dd3aa));}if(_0x48bfe2<=0x0||isNaN(_0x48bfe2)){return _0x5c9d67(msgResponse('[abandonmentRate]','Error',_0xb37d('0x1e0')+_0x48bfe2));}if(_0x3f39b9<=0x0||isNaN(_0x3f39b9)){return _0x5c9d67(msgResponse(_0xb37d('0x1de'),_0xb37d('0x43'),_0xb37d('0x1e1')+_0x3f39b9));}if(_0x22c620<=0x0||isNaN(_0x22c620)){return _0x5c9d67(msgResponse('[abandonmentRate]',_0xb37d('0x43'),_0xb37d('0x1e2')+_0x22c620));}if(_0x52f4ec<=0x0||isNaN(_0x52f4ec)){return _0x5c9d67(msgResponse('[abandonmentRate]',_0xb37d('0x43'),_0xb37d('0x1e3')+_0x52f4ec));}_0x4c407c=_0x4c407c||0x0;var _0x746c58=0x1/_0x48bfe2;var _0x176f69=0x0;var _0x545dc7=0x0;var _0x587ccc=0x0;var _0xd8f2f8=0x0;for(var _0x507d48=0x0;_0x587ccc<_0x52f4ec;_0x507d48+=0x1){_0x545dc7=_0x507d48/_0x22c620;_0x176f69=(_0x3f39b9*_0x545dc7+_0x4c407c)/_0x746c58;_0x587ccc=erlangb(_0x176f69,_0x3dd3aa);_0xd8f2f8=_0x176f69/_0x3dd3aa*(0x1-erlangb(_0x176f69,_0x3dd3aa));}return _0x1219eb({'erlangCalls':_0x507d48,'erlangCallToSecond':_0x22c620/_0x507d48,'erlangAbandonmentRate':_0x587ccc,'erlangBusyFactor':_0xd8f2f8});});};Dialer[_0xb37d('0x16')][_0xb37d('0x1b0')]=function(_0x594f8e,_0x448b8e,_0x48df0b,_0x290968,_0x31e7a3,_0xfd8086){loggerPredictive[_0xb37d('0x7b')](_0xb37d('0x1e4'));loggerPredictive[_0xb37d('0x7b')](_0xb37d('0x1da'),_0x594f8e);loggerPredictive[_0xb37d('0x7b')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x448b8e);loggerPredictive['info'](_0xb37d('0x1dc'),_0x48df0b);loggerPredictive['info'](_0xb37d('0x1e5'),_0x290968);loggerPredictive[_0xb37d('0x7b')](_0xb37d('0x1e6'),_0x31e7a3);loggerPredictive[_0xb37d('0x7b')]('---------------------------');return new BPromise(function(_0x195c6e,_0x4abfe4){if(_0x594f8e<=0x0||isNaN(_0x594f8e)){return _0x4abfe4(msgResponse('[busyFactor]',_0xb37d('0x43'),_0xb37d('0x1df')+_0x594f8e));}if(_0x48df0b<=0x0||isNaN(_0x48df0b)){return _0x4abfe4(msgResponse(_0xb37d('0x1e7'),'Error',_0xb37d('0x1e0')+_0x48df0b));}if(_0x290968<=0x0||isNaN(_0x290968)){return _0x4abfe4(msgResponse(_0xb37d('0x1e7'),_0xb37d('0x43'),'p\x20=\x20'+_0x290968));}if(_0x448b8e<=0x0||isNaN(_0x448b8e)){return _0x4abfe4(msgResponse(_0xb37d('0x1e7'),'Error',_0xb37d('0x1e2')+_0x448b8e));}if(_0x31e7a3<=0x0||isNaN(_0x31e7a3)){return _0x4abfe4(msgResponse(_0xb37d('0x1e7'),_0xb37d('0x43'),_0xb37d('0x1e8')+_0x31e7a3));}_0xfd8086=_0xfd8086||0x0;var _0xfbda41=0x1/_0x48df0b;var _0x2b3f92=0x0;var _0x30cba2=0x0;var _0x1a0d68=0x0;var _0x3ee30d=0x0;for(var _0x11fb98=0x0;_0x3ee30d<_0x31e7a3;_0x11fb98+=0x1){_0x30cba2=_0x11fb98/_0x448b8e;_0x2b3f92=(_0x290968*_0x30cba2+_0xfd8086)/_0xfbda41;_0x1a0d68=erlangb(_0x2b3f92,_0x594f8e);_0x3ee30d=_0x2b3f92/_0x594f8e*(0x1-erlangb(_0x2b3f92,_0x594f8e));}return _0x195c6e({'erlangCalls':_0x11fb98,'erlangCallToSecond':_0x448b8e/_0x11fb98,'erlangAbandonmentRate':_0x1a0d68,'erlangBusyFactor':_0x3ee30d});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index e695445..37864ad 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 _0xa123=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','name','number','starttime','responsetime','droptime','endtime','ringtime','talktime','queue','reason','callback','callbackuniqueid'];(function(_0x36fec2,_0x5cc2d2){var _0xc92e11=function(_0x2b5873){while(--_0x2b5873){_0x36fec2['push'](_0x36fec2['shift']());}};_0xc92e11(++_0x5cc2d2);}(_0xa123,0x8a));var _0x3a12=function(_0x597d46,_0x532178){_0x597d46=_0x597d46-0x0;var _0x410b0f=_0xa123[_0x597d46];return _0x410b0f;};'use strict';var util=require(_0x3a12('0x0'));var _=require(_0x3a12('0x1'));var moment=require('moment');function getSeconds(_0x6cda93,_0x277222){var _0x58a565=moment(_0x6cda93)[_0x3a12('0x2')](0x0);var _0x53710d=moment(_0x277222)['milliseconds'](0x0);return _0x58a565['diff'](_0x53710d,_0x3a12('0x3'));}function QueueCallerAbandon(_0x5a8d99,_0x59f76a){this[_0x3a12('0x4')]=_0x5a8d99[_0x3a12('0x4')];this[_0x3a12('0x5')]=_0x5a8d99['type'];this[_0x3a12('0x6')]=_0x5a8d99[_0x3a12('0x5')]==='outbound'?'queue':_0x5a8d99['type'];this[_0x3a12('0x7')]=_0x5a8d99[_0x3a12('0x7')];this[_0x3a12('0x8')]=_0x5a8d99[_0x3a12('0x8')];this[_0x3a12('0x9')]=_0x5a8d99[_0x3a12('0x9')];this['countglobal']=_0x5a8d99[_0x3a12('0x7')]+_0x5a8d99[_0x3a12('0x8')]+_0x5a8d99[_0x3a12('0x9')];this['uniqueid']=_0x59f76a['uniqueid'];this['calleridname']=_0x5a8d99[_0x3a12('0xa')];this['calleridnum']=_0x5a8d99[_0x3a12('0xb')];this[_0x3a12('0xc')]=_0x5a8d99[_0x3a12('0xc')];this[_0x3a12('0xd')]=_0x5a8d99[_0x3a12('0xd')];this[_0x3a12('0xe')]=_0x5a8d99['droptime'];this[_0x3a12('0xf')]=this['droptime'];this[_0x3a12('0x10')]=getSeconds(_0x5a8d99['responsetime'],_0x5a8d99['starttime']);this['holdtime']=getSeconds(this[_0x3a12('0xe')],_0x5a8d99['responsetime']);this[_0x3a12('0x11')]=0x0;this[_0x3a12('0x12')]=_0x59f76a[_0x3a12('0x12')];this['membername']=_0x59f76a['connectedlinename'];this[_0x3a12('0x13')]=_0x59f76a['reason'];this[_0x3a12('0x14')]=_0x5a8d99[_0x3a12('0x14')];this['callbackuniqueid']=_0x5a8d99[_0x3a12('0x15')];this[_0x3a12('0x16')]=_0x5a8d99[_0x3a12('0x16')];this[_0x3a12('0x17')]=_0x5a8d99[_0x3a12('0x17')];this[_0x3a12('0x18')]=_0x5a8d99[_0x3a12('0x18')];this[_0x3a12('0x19')]=_0x5a8d99[_0x3a12('0x19')];this[_0x3a12('0x1a')]=_0x5a8d99[_0x3a12('0x1a')];this[_0x3a12('0x1b')]=_0x5a8d99['VoiceQueueId'];this[_0x3a12('0x1c')]=_0x5a8d99['CampaignId'];this[_0x3a12('0x1d')]=_0x5a8d99['originatecalleridnum']||'';this['originatecalleridname']=_0x5a8d99[_0x3a12('0x1e')]||'';}module[_0x3a12('0x1f')]=QueueCallerAbandon; \ No newline at end of file +var _0xb8ef=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','droptime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat'];(function(_0x1975a1,_0x227b66){var _0x5b372d=function(_0x26d3ea){while(--_0x26d3ea){_0x1975a1['push'](_0x1975a1['shift']());}};_0x5b372d(++_0x227b66);}(_0xb8ef,0x7a));var _0xfb8e=function(_0x5dcfab,_0x168f4f){_0x5dcfab=_0x5dcfab-0x0;var _0x13d8b9=_0xb8ef[_0x5dcfab];return _0x13d8b9;};'use strict';var util=require(_0xfb8e('0x0'));var _=require(_0xfb8e('0x1'));var moment=require(_0xfb8e('0x2'));function getSeconds(_0x1b333f,_0x189bd){var _0x2cac3d=moment(_0x1b333f)[_0xfb8e('0x3')](0x0);var _0x238910=moment(_0x189bd)[_0xfb8e('0x3')](0x0);return _0x2cac3d['diff'](_0x238910,_0xfb8e('0x4'));}function QueueCallerAbandon(_0x4be3a4,_0x58fa19){this[_0xfb8e('0x5')]=_0x4be3a4[_0xfb8e('0x5')];this['type']=_0x4be3a4[_0xfb8e('0x6')];this['campaigntype']=_0x4be3a4[_0xfb8e('0x6')]===_0xfb8e('0x7')?_0xfb8e('0x8'):_0x4be3a4['type'];this['countbusyretry']=_0x4be3a4[_0xfb8e('0x9')];this['countcongestionretry']=_0x4be3a4[_0xfb8e('0xa')];this[_0xfb8e('0xb')]=_0x4be3a4[_0xfb8e('0xb')];this[_0xfb8e('0xc')]=_0x4be3a4[_0xfb8e('0x9')]+_0x4be3a4[_0xfb8e('0xa')]+_0x4be3a4[_0xfb8e('0xb')];this[_0xfb8e('0xd')]=_0x58fa19['uniqueid'];this[_0xfb8e('0xe')]=_0x4be3a4['name'];this[_0xfb8e('0xf')]=_0x4be3a4[_0xfb8e('0x10')];this[_0xfb8e('0x11')]=_0x4be3a4['starttime'];this[_0xfb8e('0x12')]=_0x4be3a4[_0xfb8e('0x12')];this['droptime']=_0x4be3a4['droptime'];this[_0xfb8e('0x13')]=this['droptime'];this[_0xfb8e('0x14')]=getSeconds(_0x4be3a4[_0xfb8e('0x12')],_0x4be3a4[_0xfb8e('0x11')]);this[_0xfb8e('0x15')]=getSeconds(this[_0xfb8e('0x16')],_0x4be3a4['responsetime']);this[_0xfb8e('0x17')]=0x0;this[_0xfb8e('0x8')]=_0x58fa19[_0xfb8e('0x8')];this[_0xfb8e('0x18')]=_0x58fa19[_0xfb8e('0x19')];this[_0xfb8e('0x1a')]=_0x58fa19[_0xfb8e('0x1a')];this[_0xfb8e('0x1b')]=_0x4be3a4[_0xfb8e('0x1b')];this[_0xfb8e('0x1c')]=_0x4be3a4[_0xfb8e('0x1c')];this[_0xfb8e('0x1d')]=_0x4be3a4[_0xfb8e('0x1d')];this['recallme']=_0x4be3a4[_0xfb8e('0x1e')];this[_0xfb8e('0x1f')]=_0x4be3a4[_0xfb8e('0x1f')];this[_0xfb8e('0x20')]=_0x4be3a4['ListId'];this[_0xfb8e('0x21')]=_0x4be3a4[_0xfb8e('0x21')];this[_0xfb8e('0x22')]=_0x4be3a4['VoiceQueueId'];this[_0xfb8e('0x23')]=_0x4be3a4[_0xfb8e('0x23')];this[_0xfb8e('0x24')]=_0x4be3a4[_0xfb8e('0x24')]||'';this[_0xfb8e('0x25')]=_0x4be3a4[_0xfb8e('0x25')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index f80907b..bd03103 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 _0x92d8=['path','AttachmentId','exports','util','channel','format','%s/%s/%s','tech','Trunk','fax','localstationid','headerinfo'];(function(_0x1b2ca6,_0xa59596){var _0x2510e0=function(_0x3d89db){while(--_0x3d89db){_0x1b2ca6['push'](_0x1b2ca6['shift']());}};_0x2510e0(++_0xa59596);}(_0x92d8,0x93));var _0x892d=function(_0x56b4fb,_0x4d75d7){_0x56b4fb=_0x56b4fb-0x0;var _0x50a6ca=_0x92d8[_0x56b4fb];return _0x50a6ca;};'use strict';var util=require(_0x892d('0x0'));var _=require('lodash');var moment=require('moment');function Action(_0x195492,_0x2efa02,_0x16c177){this['uniqueid']=_0x195492||undefined;this[_0x892d('0x1')]=util[_0x892d('0x2')](_0x892d('0x3'),_0x2efa02[_0x892d('0x4')],_0x2efa02[_0x892d('0x5')]['name'],_0x16c177[_0x892d('0x6')]);this[_0x892d('0x7')]=_0x2efa02['localstationid'];this[_0x892d('0x8')]=_0x2efa02[_0x892d('0x8')];this[_0x892d('0x9')]=_0x16c177['path'];this[_0x892d('0xa')]=_0x16c177[_0x892d('0xa')];}module[_0x892d('0xb')]=Action; \ No newline at end of file +var _0xcea8=['localstationid','headerinfo','path','AttachmentId','exports','util','lodash','uniqueid','channel','format','%s/%s/%s','Trunk','name','fax'];(function(_0x3f2110,_0xb4e257){var _0x1931d5=function(_0x336c18){while(--_0x336c18){_0x3f2110['push'](_0x3f2110['shift']());}};_0x1931d5(++_0xb4e257);}(_0xcea8,0x75));var _0x8cea=function(_0x57ee8c,_0xe42849){_0x57ee8c=_0x57ee8c-0x0;var _0x3a2322=_0xcea8[_0x57ee8c];return _0x3a2322;};'use strict';var util=require(_0x8cea('0x0'));var _=require(_0x8cea('0x1'));var moment=require('moment');function Action(_0x15cde1,_0x48805c,_0x4edd0e){this[_0x8cea('0x2')]=_0x15cde1||undefined;this[_0x8cea('0x3')]=util[_0x8cea('0x4')](_0x8cea('0x5'),_0x48805c['tech'],_0x48805c[_0x8cea('0x6')][_0x8cea('0x7')],_0x4edd0e[_0x8cea('0x8')]);this['localstationid']=_0x48805c[_0x8cea('0x9')];this[_0x8cea('0xa')]=_0x48805c[_0x8cea('0xa')];this[_0x8cea('0xb')]=_0x4edd0e[_0x8cea('0xb')];this[_0x8cea('0xc')]=_0x4edd0e[_0x8cea('0xc')];}module[_0x8cea('0xd')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 5b01d6a..dce5c84 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 _0xbe53=['SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','message','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','format','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','path','tiff2pdf','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','varset','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','create','parse','application/pdf','then','notify','fax','.pdf','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','syncOriginateResponse','merge','pick','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20faxRiceive\x20','faxpages'];(function(_0x2c6fd3,_0x4ad940){var _0x57d735=function(_0x33af5b){while(--_0x33af5b){_0x2c6fd3['push'](_0x2c6fd3['shift']());}};_0x57d735(++_0x4ad940);}(_0xbe53,0x112));var _0x3be5=function(_0x1871f8,_0x32ef19){_0x1871f8=_0x1871f8-0x0;var _0x5bd3eb=_0xbe53[_0x1871f8];return _0x5bd3eb;};'use strict';var util=require(_0x3be5('0x0'));var _=require(_0x3be5('0x1'));var BPromise=require(_0x3be5('0x2'));var uuid=require(_0x3be5('0x3'));var moment=require('moment');var path=require(_0x3be5('0x4'));var tiff2pdf=require(_0x3be5('0x5'));var gs=require('./util/gs');var logger=require('../../../config/logger')('fax');var ami=require(_0x3be5('0x6'));var rpcDb=require('./rpcDb');var Channel=require(_0x3be5('0x7'));var ut=require(_0x3be5('0x8'));var Action=require(_0x3be5('0x9'));var faxAccount=require(_0x3be5('0xa'));var attachment=require(_0x3be5('0xb'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x20fc43){this[_0x3be5('0xc')]={};this['faxAccounts']=_0x20fc43[_0x3be5('0xd')];this[_0x3be5('0xe')]=_0x20fc43[_0x3be5('0xe')];this[_0x3be5('0xf')]={};ami['on'](_0x3be5('0x10'),this['syncNewchannel']['bind'](this));ami['on'](_0x3be5('0x11'),this['syncVarSet'][_0x3be5('0x12')](this));ami['on'](_0x3be5('0x13'),this[_0x3be5('0x14')][_0x3be5('0x12')](this));ami['on'](_0x3be5('0x15'),this[_0x3be5('0x16')][_0x3be5('0x12')](this));ami['on'](_0x3be5('0x17'),this[_0x3be5('0x18')][_0x3be5('0x12')](this));ami['on'](_0x3be5('0x19'),this['syncReceiveFax'][_0x3be5('0x12')](this));ami['on'](_0x3be5('0x1a'),this[_0x3be5('0x1b')][_0x3be5('0x12')](this));ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));}Fax[_0x3be5('0x1c')][_0x3be5('0x1d')]=function(_0x2927b4){if(_0x2927b4[_0x3be5('0x1e')]===_0x3be5('0x1f')){for(var _0x34f943 in this[_0x3be5('0xd')]){if(this[_0x3be5('0xd')][_0x3be5('0x20')](_0x34f943)){if(_0x2927b4[_0x3be5('0x21')]===this[_0x3be5('0xd')][_0x34f943][_0x3be5('0x22')]){this[_0x3be5('0xc')][_0x2927b4[_0x3be5('0x23')]]={};this[_0x3be5('0xc')][_0x2927b4[_0x3be5('0x23')]][_0x3be5('0x24')]=_0x2927b4[_0x3be5('0x24')];this[_0x3be5('0xc')][_0x2927b4[_0x3be5('0x23')]]['id']=this[_0x3be5('0xd')][_0x34f943]['id'];this[_0x3be5('0xc')][_0x2927b4[_0x3be5('0x23')]][_0x3be5('0x25')]=this[_0x3be5('0xd')][_0x34f943][_0x3be5('0x25')];logger[_0x3be5('0x26')](_0x2927b4[_0x3be5('0x23')],'\x20syncNewchannel\x20');}}}}if(this[_0x3be5('0xf')][_0x2927b4[_0x3be5('0x23')]]){this['channels'][_0x2927b4['uniqueid']]={};this[_0x3be5('0xc')][_0x2927b4[_0x3be5('0x23')]][_0x3be5('0x24')]=_0x2927b4[_0x3be5('0x24')];logger[_0x3be5('0x26')](_0x2927b4[_0x3be5('0x23')],_0x3be5('0x27'));}};Fax['prototype']['syncVarSet']=function(_0x33e037){if(this[_0x3be5('0xc')][_0x33e037['uniqueid']]){for(var _0x175a0c in _0x33e037[_0x3be5('0x28')]){if(_0x33e037[_0x3be5('0x28')]['hasOwnProperty'](_0x175a0c)){this['channels'][_0x33e037[_0x3be5('0x23')]][_0x175a0c]=_0x33e037[_0x3be5('0x29')];}}}};Fax['prototype'][_0x3be5('0x14')]=function(_0x430c44){if(this[_0x3be5('0xc')][_0x430c44[_0x3be5('0x23')]]){this[_0x3be5('0xc')][_0x430c44['uniqueid']][_0x3be5('0x2a')]=_0x430c44[_0x3be5('0x2a')];this[_0x3be5('0xc')][_0x430c44[_0x3be5('0x23')]][_0x3be5('0x2b')]=_0x430c44[_0x3be5('0x2b')];}};Fax[_0x3be5('0x1c')]['syncNewExten']=function(_0x1539d9){if(this['channels'][_0x1539d9[_0x3be5('0x23')]]){for(var _0x192486 in _0x1539d9[_0x3be5('0x28')]){if(_0x1539d9[_0x3be5('0x28')]['hasOwnProperty'](_0x192486)){this[_0x3be5('0xc')][_0x1539d9[_0x3be5('0x23')]][_0x192486]=_0x1539d9[_0x3be5('0x29')];}}}};Fax[_0x3be5('0x1c')][_0x3be5('0x18')]=function(_0x1dd0fb){if(this['channels'][_0x1dd0fb[_0x3be5('0x23')]]){this[_0x3be5('0xc')][_0x1dd0fb[_0x3be5('0x23')]][_0x3be5('0x2c')]=_0x1dd0fb[_0x3be5('0x2c')];this[_0x3be5('0xc')][_0x1dd0fb[_0x3be5('0x23')]]['status']=_0x1dd0fb[_0x3be5('0x2d')];this[_0x3be5('0xc')][_0x1dd0fb[_0x3be5('0x23')]][_0x3be5('0x22')]=_0x1dd0fb['localstationid'];this['channels'][_0x1dd0fb[_0x3be5('0x23')]][_0x3be5('0x2e')]=_0x1dd0fb[_0x3be5('0x2e')];logger['info'](_0x1dd0fb[_0x3be5('0x23')],_0x3be5('0x2f'));}};Fax[_0x3be5('0x1c')][_0x3be5('0x30')]=function(_0x5f02c0){var _0x17b97b=this;if(this['channels'][_0x5f02c0[_0x3be5('0x23')]]){var _0x3d71f3=this[_0x3be5('0xc')][_0x5f02c0[_0x3be5('0x23')]]['id'];this[_0x3be5('0xc')][_0x5f02c0[_0x3be5('0x23')]][_0x3be5('0x31')]=_0x5f02c0['remotestationid'];this[_0x3be5('0xc')][_0x5f02c0[_0x3be5('0x23')]][_0x3be5('0x32')]=_0x5f02c0[_0x3be5('0x32')];this[_0x3be5('0xc')][_0x5f02c0[_0x3be5('0x23')]][_0x3be5('0x22')]=_0x5f02c0[_0x3be5('0x22')];this['channels'][_0x5f02c0['uniqueid']][_0x3be5('0x33')]=_0x5f02c0['resolution'];this[_0x3be5('0xc')][_0x5f02c0[_0x3be5('0x23')]][_0x3be5('0x34')]=_0x5f02c0['transferrate'];this[_0x3be5('0xc')][_0x5f02c0[_0x3be5('0x23')]][_0x3be5('0x2e')]=_0x5f02c0[_0x3be5('0x2e')];this[_0x3be5('0xc')][_0x5f02c0[_0x3be5('0x23')]][_0x3be5('0x35')]=_0x5f02c0['calleridnum'];if(this[_0x3be5('0xc')][_0x5f02c0['uniqueid']][_0x3be5('0x32')]>0x0){tiff2pdf(_0x5f02c0[_0x3be5('0x2e')],'/var/opt/motion2/server/files/attachments/',function(_0x1766cd){logger[_0x3be5('0x26')](_0x5f02c0[_0x3be5('0x23')],_0x3be5('0x36'),_0x1766cd['message']);attachment[_0x3be5('0x37')]({'name':path[_0x3be5('0x38')](_0x5f02c0[_0x3be5('0x2e')])[_0x3be5('0x25')],'basename':path[_0x3be5('0x38')](_0x5f02c0[_0x3be5('0x2e')])['name']+'.pdf','type':_0x3be5('0x39')})[_0x3be5('0x3a')](function(_0x12d039){faxAccount[_0x3be5('0x3b')](_0x3d71f3,{'from':_0x5f02c0[_0x3be5('0x35')],'mapKey':_0x3be5('0x3c'),'body':path[_0x3be5('0x38')](_0x5f02c0['filename'])[_0x3be5('0x25')]+_0x3be5('0x3d'),'AttachmentId':_0x12d039['id']})[_0x3be5('0x3e')](function(_0x57b2e3){logger['error'](_0x5f02c0['uniqueid'],_0x3be5('0x3f'),JSON[_0x3be5('0x40')](_0x57b2e3));});})[_0x3be5('0x3e')](function(_0x307123){logger[_0x3be5('0x41')](_0x5f02c0['uniqueid'],_0x3be5('0x42'),JSON['stringify'](_0x307123));});});}logger[_0x3be5('0x26')](_0x5f02c0[_0x3be5('0x23')],'\x20receiveFax\x20');}};Fax['prototype'][_0x3be5('0x43')]=function(_0x551b69){if(this[_0x3be5('0xf')][_0x551b69[_0x3be5('0x23')]]){_[_0x3be5('0x44')](this['channels'][_0x551b69[_0x3be5('0x23')]],_[_0x3be5('0x45')](_0x551b69,['response','reason']));}};function updateStatus(_0x31e259){if(_0x31e259[_0x3be5('0x46')]){faxMessage[_0x3be5('0x47')](_0x31e259[_0x3be5('0x46')],{'failMessage':_0x3be5('0x48')})[_0x3be5('0x3a')](function(_0x3c4b82){ut[_0x3be5('0x49')](_0x3be5('0x4a'),_0x3c4b82);})[_0x3be5('0x3e')](function(_0x5f2ba4){ut[_0x3be5('0x49')](_0x3be5('0x4b'),_0x5f2ba4);});}else{ut[_0x3be5('0x49')](_0x3be5('0x4c'));}}Fax[_0x3be5('0x1c')][_0x3be5('0x4d')]=function(_0x915678,_0x106b4e,_0x519f05){var _0x1414ab=this;var _0x482603={};if(_0x106b4e){_0x482603={'read':_0x106b4e};}else{_0x482603={'failMessage':_0x519f05};}if(this['actions'][_0x915678][_0x3be5('0x46')]){faxMessage[_0x3be5('0x47')](this['actions'][_0x915678][_0x3be5('0x46')],_0x482603)[_0x3be5('0x3a')](function(_0x4b3d43){ut[_0x3be5('0x49')](_0x3be5('0x4e'),_0x4b3d43);})[_0x3be5('0x3e')](function(_0x4a53a5){ut[_0x3be5('0x49')](_0x3be5('0x4f'),_0x4a53a5);})[_0x3be5('0x50')](function(){delete _0x1414ab[_0x3be5('0xc')][_0x915678];delete _0x1414ab[_0x3be5('0xf')][_0x915678];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this[_0x3be5('0xc')][_0x915678];delete this[_0x3be5('0xf')][_0x915678];}};Fax[_0x3be5('0x1c')][_0x3be5('0x1b')]=function(_0x110136){var _0x309027=this;if(this['channels'][_0x110136['uniqueid']]){if(this[_0x3be5('0xf')][_0x110136[_0x3be5('0x23')]]){this[_0x3be5('0xc')][_0x110136[_0x3be5('0x23')]]['id']=this[_0x3be5('0xf')][_0x110136[_0x3be5('0x23')]]['id'];this[_0x3be5('0xc')][_0x110136['uniqueid']]['name']=this[_0x3be5('0xf')][_0x110136[_0x3be5('0x23')]][_0x3be5('0x25')];}logger[_0x3be5('0x26')](_0x110136[_0x3be5('0x23')],this[_0x3be5('0xf')][_0x110136[_0x3be5('0x23')]]?'\x20hangup\x20sendFile\x20':_0x3be5('0x51'),JSON[_0x3be5('0x40')](this[_0x3be5('0xc')][_0x110136[_0x3be5('0x23')]]));if(this['actions'][_0x110136['uniqueid']]){if(this[_0x3be5('0xc')][_0x110136['uniqueid']][_0x3be5('0x52')]>0x0&&this['channels'][_0x110136[_0x3be5('0x23')]][_0x3be5('0x17')]===_0x3be5('0x53')){this[_0x3be5('0x4d')](_0x110136[_0x3be5('0x23')],!![]);}else{this[_0x3be5('0x4d')](_0x110136[_0x3be5('0x23')],![],this['channels'][_0x110136[_0x3be5('0x23')]][_0x3be5('0x54')]?_0x3be5('0x55')+this[_0x3be5('0xc')][_0x110136['uniqueid']]['faxstatusstring']:_0x3be5('0x56'));}}}};Fax[_0x3be5('0x1c')][_0x3be5('0x57')]=function(_0x41dd31){var _0x2dc5a7=this;return new BPromise(function(_0x2378d3,_0x10dba5){_0x2dc5a7[_0x3be5('0x58')](_0x41dd31,_0x2dc5a7[_0x3be5('0xd')][_0x41dd31[_0x3be5('0x59')]])[_0x3be5('0x3a')](function(_0x1207a5){ut[_0x3be5('0x49')](_0x3be5('0x5a'),_0x1207a5);_0x2378d3(ut['message'](_0x3be5('0x5b')));})[_0x3be5('0x3e')](function(_0x344796){ut['logger'](_0x3be5('0x5c'),_0x344796);updateStatus(_0x41dd31);_0x10dba5(ut[_0x3be5('0x5d')](_0x3be5('0x5e')));});});};Fax['prototype'][_0x3be5('0x5f')]=function(_0x1044b3){var _0x2ca16b=this;return new BPromise(function(_0x88a6c1,_0x266a26){var _0x3dea20=_0x2ca16b[_0x3be5('0x60')](_0x2ca16b[_0x3be5('0xd')][_0x1044b3[_0x3be5('0x59')]][_0x3be5('0x61')],_0x1044b3);if(_0x3dea20['isValid']){_0x88a6c1(ut['message'](_0x3be5('0x62')));}else{_0x266a26(ut[_0x3be5('0x5d')](_0x3dea20[_0x3be5('0x5d')]));}});};function originate(_0x258fc4,_0x44de5a,_0x236ade){return new BPromise(function(_0x25b560,_0xfd0cd6){if(_0x236ade){var _0xc44f9a=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x3be5('0x38')](_0x258fc4[_0x3be5('0x4')])[_0x3be5('0x25')],_0x258fc4[_0x3be5('0x4')]);gs['execute'](_0xc44f9a)[_0x3be5('0x3a')](function(){_0x258fc4['path']=util[_0x3be5('0x63')]('%s/%s.tif',path[_0x3be5('0x38')](_0x258fc4[_0x3be5('0x4')])[_0x3be5('0x64')],path['parse'](_0x258fc4[_0x3be5('0x4')])[_0x3be5('0x25')]);_0x44de5a[_0x3be5('0x65')]=_0x258fc4[_0x3be5('0x4')];ut[_0x3be5('0x49')](_0x3be5('0x66'),'');ami[_0x3be5('0x67')](ut[_0x3be5('0x68')](_0x258fc4,_0x44de5a))[_0x3be5('0x3a')](function(_0x220e62){_0x25b560(_0x220e62);})[_0x3be5('0x3e')](function(_0x2343f9){_0xfd0cd6(_0x2343f9);});})['catch'](function(_0x399f43){_0xfd0cd6(_0x399f43);});}else{ami[_0x3be5('0x67')](ut[_0x3be5('0x68')](_0x258fc4,_0x44de5a))[_0x3be5('0x3a')](function(_0x428c67){_0x25b560(_0x428c67);})['catch'](function(_0xc68b17){_0xfd0cd6(_0xc68b17);});}});}Fax['prototype'][_0x3be5('0x58')]=function(_0x25243f,_0x5853e9){var _0x5ee6e4=this;return new BPromise(function(_0x274cce,_0x5a969e){var _0x375e83=uuid['v4']();var _0x4a4d87=ut[_0x3be5('0x69')](_0x25243f,_0x5853e9);_0x5ee6e4[_0x3be5('0xf')][_0x375e83]=new Action(_0x375e83,_0x5853e9,_0x25243f);var _0x1f531d=_0x5ee6e4[_0x3be5('0xf')][_0x375e83];if(path['parse'](_0x25243f['path'])[_0x3be5('0x6a')]===_0x3be5('0x3d')){originate(_0x1f531d,_0x4a4d87,!![])[_0x3be5('0x3a')](function(_0x9c5c53){_0x274cce(_0x9c5c53);})[_0x3be5('0x3e')](function(_0x3458fc){_0x5a969e(_0x3458fc);});}else{originate(_0x1f531d,_0x4a4d87,![])['then'](function(_0x1547ee){_0x274cce(_0x1547ee);})['catch'](function(_0x9e8e62){_0x5a969e(_0x9e8e62);});}});};Fax[_0x3be5('0x1c')]['isTrunkReachable']=function(_0x233257){return!_[_0x3be5('0x6b')](_0x233257)&&!_[_0x3be5('0x6b')](_0x233257['name'])&&!_[_0x3be5('0x6b')](_0x233257[_0x3be5('0x6c')])&&_0x233257[_0x3be5('0x6c')]&&!_[_0x3be5('0x6b')](this[_0x3be5('0xe')][util[_0x3be5('0x63')](_0x3be5('0x6d'),_0x233257['name'])])&&!_[_0x3be5('0x6b')](this['trunks'][util[_0x3be5('0x63')](_0x3be5('0x6d'),_0x233257[_0x3be5('0x25')])]['status'])&&(this[_0x3be5('0xe')][util['format']('SIP/%s',_0x233257[_0x3be5('0x25')])]['status']===_0x3be5('0x6e')||this[_0x3be5('0xe')][util[_0x3be5('0x63')](_0x3be5('0x6d'),_0x233257['name'])][_0x3be5('0x2d')]===_0x3be5('0x6f'));};Fax[_0x3be5('0x1c')][_0x3be5('0x60')]=function(_0x46445f,_0x12502b){if(!this['isTrunkReachable'](_0x46445f)){ut[_0x3be5('0x49')](_0x3be5('0x70'),_[_0x3be5('0x6b')](_0x46445f)?'':_0x46445f['name']+_0x3be5('0x71'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x3be5('0x6b')](_0x12502b[_0x3be5('0x3c')])){ut[_0x3be5('0x49')](_0x3be5('0x72'),JSON[_0x3be5('0x40')](_0x12502b));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x3be5('0x6b')](_0x12502b['path'])){ut[_0x3be5('0x49')](_0x3be5('0x73'),JSON[_0x3be5('0x40')](_0x12502b));return{'isValid':![],'message':_0x3be5('0x74')};}return{'isValid':!![],'message':_0x3be5('0x75')};};module[_0x3be5('0x76')]=Fax; \ No newline at end of file +var _0xa126=['isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','localstationid','channels','channel','uniqueid','name','actions','\x20syncNewchannel\x20','value','prototype','channelstate','channelstatedesc','variable','operation','status','filename','info','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','create','parse','.pdf','then','notify','error','stringify','catch','\x20receiveFax\x20','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','message','Fax\x20received','Fax\x20failed','checkTrunk','FaxAccountId','Trunk\x20Reachable','format','execute','%s/%s.tif','dir','Action','variablesAction','execOriginate'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0xa126,0x1d2));var _0x6a12=function(_0x591672,_0x809b11){_0x591672=_0x591672-0x0;var _0x3685ed=_0xa126[_0x591672];return _0x3685ed;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x6a12('0x0'));var uuid=require(_0x6a12('0x1'));var moment=require(_0x6a12('0x2'));var path=require(_0x6a12('0x3'));var tiff2pdf=require(_0x6a12('0x4'));var gs=require(_0x6a12('0x5'));var logger=require(_0x6a12('0x6'))(_0x6a12('0x7'));var ami=require('../ami');var rpcDb=require(_0x6a12('0x8'));var Channel=require(_0x6a12('0x9'));var ut=require('./util/util');var Action=require(_0x6a12('0xa'));var faxAccount=require(_0x6a12('0xb'));var attachment=require(_0x6a12('0xc'));var faxMessage=require(_0x6a12('0xd'));function Fax(_0x127ba9){this['channels']={};this[_0x6a12('0xe')]=_0x127ba9[_0x6a12('0xe')];this[_0x6a12('0xf')]=_0x127ba9[_0x6a12('0xf')];this['actions']={};ami['on'](_0x6a12('0x10'),this[_0x6a12('0x11')][_0x6a12('0x12')](this));ami['on'](_0x6a12('0x13'),this[_0x6a12('0x14')][_0x6a12('0x12')](this));ami['on']('newstate',this[_0x6a12('0x15')][_0x6a12('0x12')](this));ami['on'](_0x6a12('0x16'),this[_0x6a12('0x17')][_0x6a12('0x12')](this));ami['on'](_0x6a12('0x18'),this[_0x6a12('0x19')]['bind'](this));ami['on'](_0x6a12('0x1a'),this[_0x6a12('0x1b')][_0x6a12('0x12')](this));ami['on'](_0x6a12('0x1c'),this[_0x6a12('0x1d')][_0x6a12('0x12')](this));ami['on'](_0x6a12('0x1e'),this[_0x6a12('0x1f')][_0x6a12('0x12')](this));}Fax['prototype'][_0x6a12('0x11')]=function(_0x1b54a5){if(_0x1b54a5[_0x6a12('0x20')]===_0x6a12('0x21')){for(var _0x444d80 in this[_0x6a12('0xe')]){if(this[_0x6a12('0xe')][_0x6a12('0x22')](_0x444d80)){if(_0x1b54a5['exten']===this[_0x6a12('0xe')][_0x444d80][_0x6a12('0x23')]){this[_0x6a12('0x24')][_0x1b54a5['uniqueid']]={};this[_0x6a12('0x24')][_0x1b54a5['uniqueid']][_0x6a12('0x25')]=_0x1b54a5[_0x6a12('0x25')];this[_0x6a12('0x24')][_0x1b54a5[_0x6a12('0x26')]]['id']=this[_0x6a12('0xe')][_0x444d80]['id'];this[_0x6a12('0x24')][_0x1b54a5[_0x6a12('0x26')]][_0x6a12('0x27')]=this[_0x6a12('0xe')][_0x444d80][_0x6a12('0x27')];logger['info'](_0x1b54a5[_0x6a12('0x26')],'\x20syncNewchannel\x20');}}}}if(this[_0x6a12('0x28')][_0x1b54a5[_0x6a12('0x26')]]){this[_0x6a12('0x24')][_0x1b54a5['uniqueid']]={};this[_0x6a12('0x24')][_0x1b54a5[_0x6a12('0x26')]][_0x6a12('0x25')]=_0x1b54a5[_0x6a12('0x25')];logger['info'](_0x1b54a5['uniqueid'],_0x6a12('0x29'));}};Fax['prototype'][_0x6a12('0x14')]=function(_0x2deccb){if(this[_0x6a12('0x24')][_0x2deccb[_0x6a12('0x26')]]){for(var _0x59fbf6 in _0x2deccb['variable']){if(_0x2deccb['variable']['hasOwnProperty'](_0x59fbf6)){this[_0x6a12('0x24')][_0x2deccb[_0x6a12('0x26')]][_0x59fbf6]=_0x2deccb[_0x6a12('0x2a')];}}}};Fax[_0x6a12('0x2b')][_0x6a12('0x15')]=function(_0x5c7428){if(this[_0x6a12('0x24')][_0x5c7428[_0x6a12('0x26')]]){this['channels'][_0x5c7428[_0x6a12('0x26')]][_0x6a12('0x2c')]=_0x5c7428[_0x6a12('0x2c')];this[_0x6a12('0x24')][_0x5c7428['uniqueid']]['channelstatedesc']=_0x5c7428[_0x6a12('0x2d')];}};Fax['prototype'][_0x6a12('0x17')]=function(_0x763579){if(this['channels'][_0x763579[_0x6a12('0x26')]]){for(var _0x2dfbfe in _0x763579['variable']){if(_0x763579[_0x6a12('0x2e')][_0x6a12('0x22')](_0x2dfbfe)){this['channels'][_0x763579['uniqueid']][_0x2dfbfe]=_0x763579['value'];}}}};Fax[_0x6a12('0x2b')]['syncFaxStatus']=function(_0x30833d){if(this[_0x6a12('0x24')][_0x30833d[_0x6a12('0x26')]]){this[_0x6a12('0x24')][_0x30833d['uniqueid']][_0x6a12('0x2f')]=_0x30833d['operation'];this['channels'][_0x30833d[_0x6a12('0x26')]][_0x6a12('0x30')]=_0x30833d[_0x6a12('0x30')];this['channels'][_0x30833d[_0x6a12('0x26')]][_0x6a12('0x23')]=_0x30833d[_0x6a12('0x23')];this['channels'][_0x30833d[_0x6a12('0x26')]]['filename']=_0x30833d[_0x6a12('0x31')];logger[_0x6a12('0x32')](_0x30833d[_0x6a12('0x26')],_0x6a12('0x33'));}};Fax[_0x6a12('0x2b')][_0x6a12('0x1b')]=function(_0x2c1bd7){var _0x2e70b1=this;if(this[_0x6a12('0x24')][_0x2c1bd7[_0x6a12('0x26')]]){var _0x1b7716=this[_0x6a12('0x24')][_0x2c1bd7[_0x6a12('0x26')]]['id'];this[_0x6a12('0x24')][_0x2c1bd7[_0x6a12('0x26')]][_0x6a12('0x34')]=_0x2c1bd7[_0x6a12('0x34')];this[_0x6a12('0x24')][_0x2c1bd7['uniqueid']][_0x6a12('0x35')]=_0x2c1bd7[_0x6a12('0x35')];this[_0x6a12('0x24')][_0x2c1bd7[_0x6a12('0x26')]][_0x6a12('0x23')]=_0x2c1bd7['localstationid'];this[_0x6a12('0x24')][_0x2c1bd7['uniqueid']][_0x6a12('0x36')]=_0x2c1bd7['resolution'];this[_0x6a12('0x24')][_0x2c1bd7['uniqueid']][_0x6a12('0x37')]=_0x2c1bd7['transferrate'];this[_0x6a12('0x24')][_0x2c1bd7['uniqueid']][_0x6a12('0x31')]=_0x2c1bd7['filename'];this['channels'][_0x2c1bd7['uniqueid']]['calleridnum']=_0x2c1bd7[_0x6a12('0x38')];if(this[_0x6a12('0x24')][_0x2c1bd7[_0x6a12('0x26')]][_0x6a12('0x35')]>0x0){tiff2pdf(_0x2c1bd7[_0x6a12('0x31')],_0x6a12('0x39'),function(_0x2e87ad){logger['info'](_0x2c1bd7[_0x6a12('0x26')],'\x20result\x20conversion\x20file\x20',_0x2e87ad['message']);attachment[_0x6a12('0x3a')]({'name':path[_0x6a12('0x3b')](_0x2c1bd7['filename'])[_0x6a12('0x27')],'basename':path['parse'](_0x2c1bd7[_0x6a12('0x31')])[_0x6a12('0x27')]+_0x6a12('0x3c'),'type':'application/pdf'})[_0x6a12('0x3d')](function(_0x5dd955){faxAccount[_0x6a12('0x3e')](_0x1b7716,{'from':_0x2c1bd7['calleridnum'],'mapKey':_0x6a12('0x7'),'body':path['parse'](_0x2c1bd7[_0x6a12('0x31')])['name']+'.pdf','AttachmentId':_0x5dd955['id']})['catch'](function(_0x54bcf4){logger[_0x6a12('0x3f')](_0x2c1bd7['uniqueid'],'\x20notify\x20',JSON[_0x6a12('0x40')](_0x54bcf4));});})[_0x6a12('0x41')](function(_0x213654){logger[_0x6a12('0x3f')](_0x2c1bd7[_0x6a12('0x26')],_0x6a12('0x42'),JSON[_0x6a12('0x40')](_0x213654));});});}logger[_0x6a12('0x32')](_0x2c1bd7['uniqueid'],_0x6a12('0x42'));}};Fax[_0x6a12('0x2b')][_0x6a12('0x1f')]=function(_0x1d7d6a){if(this['actions'][_0x1d7d6a[_0x6a12('0x26')]]){_[_0x6a12('0x43')](this['channels'][_0x1d7d6a[_0x6a12('0x26')]],_[_0x6a12('0x44')](_0x1d7d6a,['response',_0x6a12('0x45')]));}};function updateStatus(_0x50fd66){if(_0x50fd66[_0x6a12('0x46')]){faxMessage[_0x6a12('0x47')](_0x50fd66[_0x6a12('0x46')],{'failMessage':_0x6a12('0x48')})[_0x6a12('0x3d')](function(_0x1181be){ut['logger'](_0x6a12('0x49'),_0x1181be);})[_0x6a12('0x41')](function(_0x3c3346){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x3c3346);});}else{ut[_0x6a12('0x4a')](_0x6a12('0x4b'));}}Fax[_0x6a12('0x2b')][_0x6a12('0x4c')]=function(_0x244a94,_0x6c816e,_0x41d580){var _0x1260ab=this;var _0x140f5c={};if(_0x6c816e){_0x140f5c={'read':_0x6c816e};}else{_0x140f5c={'failMessage':_0x41d580};}if(this[_0x6a12('0x28')][_0x244a94][_0x6a12('0x46')]){faxMessage['update'](this[_0x6a12('0x28')][_0x244a94][_0x6a12('0x46')],_0x140f5c)['then'](function(_0x4c0337){ut['logger'](_0x6a12('0x4d'),_0x4c0337);})['catch'](function(_0x7e72b6){ut[_0x6a12('0x4a')](_0x6a12('0x4e'),_0x7e72b6);})[_0x6a12('0x4f')](function(){delete _0x1260ab[_0x6a12('0x24')][_0x244a94];delete _0x1260ab[_0x6a12('0x28')][_0x244a94];});}else{ut['logger'](_0x6a12('0x50'));delete this[_0x6a12('0x24')][_0x244a94];delete this[_0x6a12('0x28')][_0x244a94];}};Fax['prototype'][_0x6a12('0x1d')]=function(_0x20ef8f){var _0x4de833=this;if(this[_0x6a12('0x24')][_0x20ef8f[_0x6a12('0x26')]]){if(this['actions'][_0x20ef8f[_0x6a12('0x26')]]){this[_0x6a12('0x24')][_0x20ef8f[_0x6a12('0x26')]]['id']=this[_0x6a12('0x28')][_0x20ef8f['uniqueid']]['id'];this[_0x6a12('0x24')][_0x20ef8f['uniqueid']]['name']=this[_0x6a12('0x28')][_0x20ef8f['uniqueid']][_0x6a12('0x27')];}logger[_0x6a12('0x32')](_0x20ef8f['uniqueid'],this[_0x6a12('0x28')][_0x20ef8f['uniqueid']]?_0x6a12('0x51'):'\x20hangup\x20faxRiceive\x20',JSON[_0x6a12('0x40')](this[_0x6a12('0x24')][_0x20ef8f[_0x6a12('0x26')]]));if(this['actions'][_0x20ef8f[_0x6a12('0x26')]]){if(this[_0x6a12('0x24')][_0x20ef8f[_0x6a12('0x26')]][_0x6a12('0x52')]>0x0&&this[_0x6a12('0x24')][_0x20ef8f[_0x6a12('0x26')]][_0x6a12('0x18')]===_0x6a12('0x53')){this[_0x6a12('0x4c')](_0x20ef8f[_0x6a12('0x26')],!![]);}else{this[_0x6a12('0x4c')](_0x20ef8f[_0x6a12('0x26')],![],this[_0x6a12('0x24')][_0x20ef8f[_0x6a12('0x26')]]['faxstatusstring']?_0x6a12('0x54')+this['channels'][_0x20ef8f[_0x6a12('0x26')]][_0x6a12('0x55')]:'SENDING\x20FAILED');}}}};Fax[_0x6a12('0x2b')]['send']=function(_0x5047dc){var _0x534144=this;return new BPromise(function(_0x1ab4b2,_0x24f300){_0x534144['execOriginate'](_0x5047dc,_0x534144[_0x6a12('0xe')][_0x5047dc['FaxAccountId']])[_0x6a12('0x3d')](function(_0x4b49f1){ut[_0x6a12('0x4a')]('[Fax][execOriginate][success]',_0x4b49f1);_0x1ab4b2(ut[_0x6a12('0x56')](_0x6a12('0x57')));})[_0x6a12('0x41')](function(_0x4dde50){ut[_0x6a12('0x4a')]('[Fax][execOriginate][failure]',_0x4dde50);updateStatus(_0x5047dc);_0x24f300(ut[_0x6a12('0x56')](_0x6a12('0x58')));});});};Fax[_0x6a12('0x2b')]['checkAfterSend']=function(_0x71e02a){var _0x58f013=this;return new BPromise(function(_0x15c3bd,_0x44c4e5){var _0x138bbb=_0x58f013[_0x6a12('0x59')](_0x58f013['faxAccounts'][_0x71e02a[_0x6a12('0x5a')]]['Trunk'],_0x71e02a);if(_0x138bbb['isValid']){_0x15c3bd(ut[_0x6a12('0x56')](_0x6a12('0x5b')));}else{_0x44c4e5(ut[_0x6a12('0x56')](_0x138bbb[_0x6a12('0x56')]));}});};function originate(_0x533c85,_0x31bfb3,_0x40220f){return new BPromise(function(_0x3d6c38,_0x36a8f5){if(_0x40220f){var _0x42ed45=util[_0x6a12('0x5c')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x6a12('0x3b')](_0x533c85[_0x6a12('0x3')])[_0x6a12('0x27')],_0x533c85[_0x6a12('0x3')]);gs[_0x6a12('0x5d')](_0x42ed45)[_0x6a12('0x3d')](function(){_0x533c85['path']=util[_0x6a12('0x5c')](_0x6a12('0x5e'),path[_0x6a12('0x3b')](_0x533c85[_0x6a12('0x3')])[_0x6a12('0x5f')],path['parse'](_0x533c85[_0x6a12('0x3')])[_0x6a12('0x27')]);_0x31bfb3['XMF-PATH']=_0x533c85[_0x6a12('0x3')];ut[_0x6a12('0x4a')]('Convert\x20pdf\x20to\x20tif','');ami[_0x6a12('0x60')](ut[_0x6a12('0x61')](_0x533c85,_0x31bfb3))['then'](function(_0x3d6751){_0x3d6c38(_0x3d6751);})[_0x6a12('0x41')](function(_0xe5b113){_0x36a8f5(_0xe5b113);});})[_0x6a12('0x41')](function(_0x3ca800){_0x36a8f5(_0x3ca800);});}else{ami[_0x6a12('0x60')](ut[_0x6a12('0x61')](_0x533c85,_0x31bfb3))['then'](function(_0x4f6fe1){_0x3d6c38(_0x4f6fe1);})['catch'](function(_0x13ff55){_0x36a8f5(_0x13ff55);});}});}Fax[_0x6a12('0x2b')][_0x6a12('0x62')]=function(_0x1fbfd0,_0x56add7){var _0x4db25b=this;return new BPromise(function(_0x1c437d,_0x100e1f){var _0x40182e=uuid['v4']();var _0x275579=ut['addVariables'](_0x1fbfd0,_0x56add7);_0x4db25b[_0x6a12('0x28')][_0x40182e]=new Action(_0x40182e,_0x56add7,_0x1fbfd0);var _0x25f40a=_0x4db25b['actions'][_0x40182e];if(path[_0x6a12('0x3b')](_0x1fbfd0[_0x6a12('0x3')])['ext']===_0x6a12('0x3c')){originate(_0x25f40a,_0x275579,!![])['then'](function(_0x26b342){_0x1c437d(_0x26b342);})['catch'](function(_0x5cd1fa){_0x100e1f(_0x5cd1fa);});}else{originate(_0x25f40a,_0x275579,![])[_0x6a12('0x3d')](function(_0x249e2c){_0x1c437d(_0x249e2c);})['catch'](function(_0x4f27de){_0x100e1f(_0x4f27de);});}});};Fax[_0x6a12('0x2b')][_0x6a12('0x63')]=function(_0x443eaa){return!_['isNil'](_0x443eaa)&&!_[_0x6a12('0x64')](_0x443eaa[_0x6a12('0x27')])&&!_['isNil'](_0x443eaa[_0x6a12('0x65')])&&_0x443eaa[_0x6a12('0x65')]&&!_[_0x6a12('0x64')](this['trunks'][util[_0x6a12('0x5c')]('SIP/%s',_0x443eaa[_0x6a12('0x27')])])&&!_[_0x6a12('0x64')](this[_0x6a12('0xf')][util[_0x6a12('0x5c')](_0x6a12('0x66'),_0x443eaa[_0x6a12('0x27')])][_0x6a12('0x30')])&&(this[_0x6a12('0xf')][util[_0x6a12('0x5c')](_0x6a12('0x66'),_0x443eaa[_0x6a12('0x27')])][_0x6a12('0x30')]===_0x6a12('0x67')||this[_0x6a12('0xf')][util[_0x6a12('0x5c')](_0x6a12('0x66'),_0x443eaa[_0x6a12('0x27')])][_0x6a12('0x30')]===_0x6a12('0x68'));};Fax['prototype'][_0x6a12('0x59')]=function(_0x966e42,_0x2ff944){if(!this['isTrunkReachable'](_0x966e42)){ut[_0x6a12('0x4a')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x6a12('0x64')](_0x966e42)?'':_0x966e42[_0x6a12('0x27')]+_0x6a12('0x69'));return{'isValid':![],'message':_0x6a12('0x6a')};}if(_[_0x6a12('0x64')](_0x2ff944[_0x6a12('0x7')])){ut['logger'](_0x6a12('0x6b'),JSON[_0x6a12('0x40')](_0x2ff944));return{'isValid':![],'message':_0x6a12('0x6c')};}if(_[_0x6a12('0x64')](_0x2ff944[_0x6a12('0x3')])){ut[_0x6a12('0x4a')](_0x6a12('0x6d'),JSON[_0x6a12('0x40')](_0x2ff944));return{'isValid':![],'message':_0x6a12('0x6e')};}return{'isValid':!![],'message':_0x6a12('0x6f')};};module[_0x6a12('0x70')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 04894e6..219c7a0 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 _0xa737=['preview','lodash','../rpc/faxAccount','error','then','notify','catch','[Notify]\x20','util','bluebird','../../../config/logger'];(function(_0x275845,_0x14c7a0){var _0x533a74=function(_0x49234f){while(--_0x49234f){_0x275845['push'](_0x275845['shift']());}};_0x533a74(++_0x14c7a0);}(_0xa737,0x1b5));var _0x7a73=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xa737[_0x9dfc10];return _0x4f938a;};'use strict';var util=require(_0x7a73('0x0'));var BPromise=require(_0x7a73('0x1'));var logger=require(_0x7a73('0x2'))(_0x7a73('0x3'));var _=require(_0x7a73('0x4'));var faxAccount=require(_0x7a73('0x5'));function loggerCatch(_0x5f4704){return function(_0x5a4dbc){logger[_0x7a73('0x6')](_0x5f4704,util['inspect'](_0x5a4dbc,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x33a71a,_0x22d651){return BPromise['resolve']()[_0x7a73('0x7')](faxAccount[_0x7a73('0x8')](_0x33a71a,_0x22d651))[_0x7a73('0x9')](loggerCatch(_0x7a73('0xa')));}; \ No newline at end of file +var _0x1f78=['util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','[Notify]\x20'];(function(_0x2b33dc,_0x9fcec7){var _0xeebc8e=function(_0x4801c8){while(--_0x4801c8){_0x2b33dc['push'](_0x2b33dc['shift']());}};_0xeebc8e(++_0x9fcec7);}(_0x1f78,0x78));var _0x81f7=function(_0x4cc0c3,_0x37b383){_0x4cc0c3=_0x4cc0c3-0x0;var _0xc4cb2e=_0x1f78[_0x4cc0c3];return _0xc4cb2e;};'use strict';var util=require(_0x81f7('0x0'));var BPromise=require(_0x81f7('0x1'));var logger=require(_0x81f7('0x2'))(_0x81f7('0x3'));var _=require(_0x81f7('0x4'));var faxAccount=require(_0x81f7('0x5'));function loggerCatch(_0x3c6b43){return function(_0x3585dc){logger[_0x81f7('0x6')](_0x3c6b43,util[_0x81f7('0x7')](_0x3585dc,{'showHidden':![],'depth':null}));};}exports[_0x81f7('0x8')]=function(_0x1f9f7d,_0x53cad5){return BPromise['resolve']()['then'](faxAccount[_0x81f7('0x8')](_0x1f9f7d,_0x53cad5))['catch'](loggerCatch(_0x81f7('0x9')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 81598ec..b29ac02 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 _0xba60=['inspect','../../../../config/logger','fax','bluebird','info','Exec\x20gs','\x20Error\x20:'];(function(_0x5dbe18,_0x4022a0){var _0x5a4a29=function(_0x30a506){while(--_0x30a506){_0x5dbe18['push'](_0x5dbe18['shift']());}};_0x5a4a29(++_0x4022a0);}(_0xba60,0x13c));var _0x0ba6=function(_0x1c1225,_0x363c59){_0x1c1225=_0x1c1225-0x0;var _0x524247=_0xba60[_0x1c1225];return _0x524247;};'use strict';var util=require('util');var logger=require(_0x0ba6('0x0'))(_0x0ba6('0x1'));var BPromise=require(_0x0ba6('0x2'));var exec=require('child_process')['exec'];exports['execute']=function(_0x3fbf6f){return new BPromise(function(_0x409497,_0x4eb3fe){exec(_0x3fbf6f,function(_0x4ae462,_0x4e696c,_0x3a631a){logger['info']('Exec\x20gs',_0x4e696c);if(_0x4ae462){logger[_0x0ba6('0x3')](_0x0ba6('0x4'),_0x0ba6('0x5'),util[_0x0ba6('0x6')](_0x4ae462,{'showHidden':![],'depth':null}),_0x4e696c,_0x3a631a);_0x4eb3fe(_0x4ae462);}_0x409497(_0x4e696c);});});}; \ No newline at end of file +var _0x7ae5=['fax','bluebird','exec','info','Exec\x20gs','\x20Error\x20:','../../../../config/logger'];(function(_0x2a3367,_0x25913a){var _0x230264=function(_0xffa54a){while(--_0xffa54a){_0x2a3367['push'](_0x2a3367['shift']());}};_0x230264(++_0x25913a);}(_0x7ae5,0x84));var _0x57ae=function(_0x34b624,_0x27cf25){_0x34b624=_0x34b624-0x0;var _0x58fe99=_0x7ae5[_0x34b624];return _0x58fe99;};'use strict';var util=require('util');var logger=require(_0x57ae('0x0'))(_0x57ae('0x1'));var BPromise=require(_0x57ae('0x2'));var exec=require('child_process')[_0x57ae('0x3')];exports['execute']=function(_0x2efc70){return new BPromise(function(_0x40b00b,_0x444bc0){exec(_0x2efc70,function(_0x4af80b,_0x49235e,_0x516864){logger[_0x57ae('0x4')](_0x57ae('0x5'),_0x49235e);if(_0x4af80b){logger[_0x57ae('0x4')](_0x57ae('0x5'),_0x57ae('0x6'),util['inspect'](_0x4af80b,{'showHidden':![],'depth':null}),_0x49235e,_0x516864);_0x444bc0(_0x4af80b);}_0x40b00b(_0x49235e);});});}; \ 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 9505f3f..1a5b79f 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 _0xb4e6=['message','logger','info','inspect','addVariables','headerinfo','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','moment','../../../../config/logger','fax'];(function(_0x3a2118,_0x31fc3c){var _0x1d181d=function(_0x26a734){while(--_0x26a734){_0x3a2118['push'](_0x3a2118['shift']());}};_0x1d181d(++_0x31fc3c);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x5e2152,_0x172f3d){_0x5e2152=_0x5e2152-0x0;var _0x5ddcf6=_0xb4e6[_0x5e2152];return _0x5ddcf6;};'use strict';var util=require(_0x6b4e('0x0'));var _=require('lodash');var moment=require(_0x6b4e('0x1'));var logger=require(_0x6b4e('0x2'))(_0x6b4e('0x3'));exports[_0x6b4e('0x4')]=function(_0x44e781){return{'message':_0x44e781};};exports[_0x6b4e('0x5')]=function(_0x1929b8,_0x52313b){logger[_0x6b4e('0x6')](_0x1929b8,util[_0x6b4e('0x7')](_0x52313b,{'showHidden':![],'depth':null}));};exports[_0x6b4e('0x8')]=function(_0x49de51,_0xd3138f){var _0x570346={'XMF-ECM':_0xd3138f['ecm'],'XMF-HEADERINFO':_0xd3138f[_0x6b4e('0x9')],'XMF-MINRATE':_0xd3138f['minrate'],'XMF-MAXRATE':_0xd3138f['maxrate'],'XMF-MODEM':util[_0x6b4e('0xa')](_0x6b4e('0xb'),_0xd3138f[_0x6b4e('0xc')]),'XMF-GATEWAY':_0xd3138f[_0x6b4e('0xd')],'XMF-FAXDETECT':_0xd3138f[_0x6b4e('0xe')],'XMF-T38TIMEOUT':_0xd3138f[_0x6b4e('0xf')],'XMF-LOCALSTATIONID':_0xd3138f[_0x6b4e('0x10')],'XMF-PATH':_0x49de51['path']};return _0x570346;};exports[_0x6b4e('0x11')]=function(_0x3bba86,_0x58c67d){return{'actionid':_0x3bba86[_0x6b4e('0x12')],'action':_0x6b4e('0x13'),'channel':_0x3bba86[_0x6b4e('0x14')],'Exten':_0x6b4e('0x15'),'Context':_0x6b4e('0x16'),'Priority':'1','callerid':util[_0x6b4e('0xa')](_0x6b4e('0x17'),_0x3bba86['headerinfo']?_0x3bba86[_0x6b4e('0x9')]:'',_0x3bba86[_0x6b4e('0x10')]),'variable':_0x58c67d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3bba86['uniqueid']};}; \ No newline at end of file +var _0xd87e=['modem','gateway','faxdetect','t38timeout','localstationid','variablesAction','uniqueid','originate','from-sip','\x22%s\x22\x20<%s>','util','lodash','../../../../config/logger','fax','message','logger','info','addVariables','ecm','headerinfo','minrate','format','\x22%s\x22'];(function(_0xad86de,_0x3b6f79){var _0x1bdf58=function(_0x344826){while(--_0x344826){_0xad86de['push'](_0xad86de['shift']());}};_0x1bdf58(++_0x3b6f79);}(_0xd87e,0x1bf));var _0xed87=function(_0x2955be,_0x17e9c4){_0x2955be=_0x2955be-0x0;var _0x27604b=_0xd87e[_0x2955be];return _0x27604b;};'use strict';var util=require(_0xed87('0x0'));var _=require(_0xed87('0x1'));var moment=require('moment');var logger=require(_0xed87('0x2'))(_0xed87('0x3'));exports[_0xed87('0x4')]=function(_0x5901be){return{'message':_0x5901be};};exports[_0xed87('0x5')]=function(_0x5e960f,_0x11a5d9){logger[_0xed87('0x6')](_0x5e960f,util['inspect'](_0x11a5d9,{'showHidden':![],'depth':null}));};exports[_0xed87('0x7')]=function(_0x589fb9,_0x5da793){var _0xa33c67={'XMF-ECM':_0x5da793[_0xed87('0x8')],'XMF-HEADERINFO':_0x5da793[_0xed87('0x9')],'XMF-MINRATE':_0x5da793[_0xed87('0xa')],'XMF-MAXRATE':_0x5da793['maxrate'],'XMF-MODEM':util[_0xed87('0xb')](_0xed87('0xc'),_0x5da793[_0xed87('0xd')]),'XMF-GATEWAY':_0x5da793[_0xed87('0xe')],'XMF-FAXDETECT':_0x5da793[_0xed87('0xf')],'XMF-T38TIMEOUT':_0x5da793[_0xed87('0x10')],'XMF-LOCALSTATIONID':_0x5da793[_0xed87('0x11')],'XMF-PATH':_0x589fb9['path']};return _0xa33c67;};exports[_0xed87('0x12')]=function(_0xf104cb,_0x5cf4fe){return{'actionid':_0xf104cb[_0xed87('0x13')],'action':_0xed87('0x14'),'channel':_0xf104cb['channel'],'Exten':'xcally-motion-fax','Context':_0xed87('0x15'),'Priority':'1','callerid':util[_0xed87('0xb')](_0xed87('0x16'),_0xf104cb[_0xed87('0x9')]?_0xf104cb[_0xed87('0x9')]:'',_0xf104cb[_0xed87('0x11')]),'variable':_0x5cf4fe,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xf104cb['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 75b007d..1ffcb8c 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 _0x7d5c=['getTrunks','getVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','log','sync','catch','bluebird','util','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','get','hour','resolve','then','initAgents','getTelephones','initTelephones'];(function(_0x1d637c,_0x53e3b4){var _0x56ed7d=function(_0xfc29f6){while(--_0xfc29f6){_0x1d637c['push'](_0x1d637c['shift']());}};_0x56ed7d(++_0x53e3b4);}(_0x7d5c,0xad));var _0xc7d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d5c[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xc7d5('0x0'));var util=require(_0xc7d5('0x1'));var moment=require('moment');var server=require('./server');var Realtime=require(_0xc7d5('0x2'));var Report=require(_0xc7d5('0x3'));var Acw=require(_0xc7d5('0x4'));var Trigger=require(_0xc7d5('0x5'));var Dialer=require(_0xc7d5('0x6'));var Preview=require(_0xc7d5('0x7'));var Fax=require(_0xc7d5('0x8'));var user=require(_0xc7d5('0x9'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xc7d5('0xa'));var voiceCallReport=require(_0xc7d5('0xb'));var trunk=require(_0xc7d5('0xc'));var trigger=require(_0xc7d5('0xd'));var template=require('./rpc/template');var cmHopperHistory=require(_0xc7d5('0xe'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0xc7d5('0xf'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0xc7d5('0x10'));var salesforce=require(_0xc7d5('0x11'));var sugarcrm=require(_0xc7d5('0x12'));var freshdesk=require(_0xc7d5('0x13'));var desk=require(_0xc7d5('0x14'));var zoho=require(_0xc7d5('0x15'));var vtiger=require(_0xc7d5('0x16'));var servicenow=require(_0xc7d5('0x17'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xc7d5('0x18')](_0xc7d5('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xc7d5('0x18')](_0xc7d5('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xc7d5('0x1a')]()[_0xc7d5('0x1b')](user['getAgents']())[_0xc7d5('0x1b')](realtime[_0xc7d5('0x1c')]())[_0xc7d5('0x1b')](user[_0xc7d5('0x1d')]())[_0xc7d5('0x1b')](realtime[_0xc7d5('0x1e')]())[_0xc7d5('0x1b')](trunk[_0xc7d5('0x1f')]())[_0xc7d5('0x1b')](realtime['initTrunks']())[_0xc7d5('0x1b')](voiceQueue[_0xc7d5('0x20')]())[_0xc7d5('0x1b')](realtime['initVoiceQueues']())['then'](trigger[_0xc7d5('0x21')]())[_0xc7d5('0x1b')](realtime[_0xc7d5('0x22')]())[_0xc7d5('0x1b')](template['getTemplates']())[_0xc7d5('0x1b')](realtime[_0xc7d5('0x23')]())['then'](zendesk[_0xc7d5('0x24')]())['then'](realtime[_0xc7d5('0x25')]())[_0xc7d5('0x1b')](salesforce[_0xc7d5('0x26')]())[_0xc7d5('0x1b')](realtime[_0xc7d5('0x27')]())[_0xc7d5('0x1b')](sugarcrm[_0xc7d5('0x28')]())[_0xc7d5('0x1b')](realtime['initSugarcrmAccounts']())[_0xc7d5('0x1b')](freshdesk[_0xc7d5('0x29')]())[_0xc7d5('0x1b')](realtime[_0xc7d5('0x2a')]())[_0xc7d5('0x1b')](desk[_0xc7d5('0x2b')]())[_0xc7d5('0x1b')](realtime[_0xc7d5('0x2c')]())['then'](zoho[_0xc7d5('0x2d')]())[_0xc7d5('0x1b')](realtime['initZohoAccounts']())[_0xc7d5('0x1b')](vtiger[_0xc7d5('0x2e')]())[_0xc7d5('0x1b')](realtime[_0xc7d5('0x2f')]())[_0xc7d5('0x1b')](servicenow[_0xc7d5('0x30')]())[_0xc7d5('0x1b')](realtime[_0xc7d5('0x31')]())[_0xc7d5('0x1b')](dynamics365[_0xc7d5('0x32')]())[_0xc7d5('0x1b')](realtime[_0xc7d5('0x33')]())['then'](campaign[_0xc7d5('0x34')]())[_0xc7d5('0x1b')](realtime[_0xc7d5('0x35')]())[_0xc7d5('0x1b')](voiceExtension[_0xc7d5('0x36')]())[_0xc7d5('0x1b')](realtime['initVoiceExtensions']())[_0xc7d5('0x1b')](faxAccount[_0xc7d5('0x37')]())['then'](realtime[_0xc7d5('0x38')]())[_0xc7d5('0x1b')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xc7d5('0x1b')](voiceQueueReport[_0xc7d5('0x39')]())['then'](realtime[_0xc7d5('0x3a')]())['then'](cmHopperHistory[_0xc7d5('0x3b')]())['then'](realtime[_0xc7d5('0x3c')]())[_0xc7d5('0x1b')](cmHopperHistory[_0xc7d5('0x3d')]())['then'](realtime[_0xc7d5('0x3e')]())[_0xc7d5('0x1b')](voiceCallReport[_0xc7d5('0x3f')]())['then'](realtime[_0xc7d5('0x40')]())[_0xc7d5('0x1b')](function(_0x2e3e2f){})['catch'](function(_0xf4118d){console[_0xc7d5('0x41')](_0xf4118d);});}function main(){return server['listen'](realtime,preview,fax)[_0xc7d5('0x1b')](function(_0x2d1851){return initRealtime();})[_0xc7d5('0x1b')](function(){return initParams();})[_0xc7d5('0x1b')](function(){report[_0xc7d5('0x42')]();setInterval(initRealtime,0x1388);})[_0xc7d5('0x43')](function(_0x40dbe5){console['log'](_0x40dbe5);});}main(); \ No newline at end of file +var _0x34df=['./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/dynamics365','get','hour','then','getAgents','initAgents','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','catch','log','listen','sync','util','moment','./server','./realtime','./report','./trigger','./dialer','./preview'];(function(_0x5a32fb,_0x2819ba){var _0x108b45=function(_0x54a4de){while(--_0x54a4de){_0x5a32fb['push'](_0x5a32fb['shift']());}};_0x108b45(++_0x2819ba);}(_0x34df,0xfc));var _0xf34d=function(_0x3f6565,_0x12a8bb){_0x3f6565=_0x3f6565-0x0;var _0x4abd23=_0x34df[_0x3f6565];return _0x4abd23;};'use strict';var BPromise=require('bluebird');var util=require(_0xf34d('0x0'));var moment=require(_0xf34d('0x1'));var server=require(_0xf34d('0x2'));var Realtime=require(_0xf34d('0x3'));var Report=require(_0xf34d('0x4'));var Acw=require('./acw');var Trigger=require(_0xf34d('0x5'));var Dialer=require(_0xf34d('0x6'));var Preview=require(_0xf34d('0x7'));var Fax=require(_0xf34d('0x8'));var user=require(_0xf34d('0x9'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xf34d('0xa'));var voiceCallReport=require(_0xf34d('0xb'));var trunk=require(_0xf34d('0xc'));var trigger=require(_0xf34d('0xd'));var template=require('./rpc/template');var cmHopperHistory=require(_0xf34d('0xe'));var campaign=require(_0xf34d('0xf'));var voiceExtension=require(_0xf34d('0x10'));var faxAccount=require(_0xf34d('0x11'));var zendesk=require(_0xf34d('0x12'));var salesforce=require(_0xf34d('0x13'));var sugarcrm=require(_0xf34d('0x14'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0xf34d('0x15'));var vtiger=require(_0xf34d('0x16'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xf34d('0x17'));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()[_0xf34d('0x18')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xf34d('0x18')](_0xf34d('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0xf34d('0x1a')](user[_0xf34d('0x1b')]())[_0xf34d('0x1a')](realtime[_0xf34d('0x1c')]())[_0xf34d('0x1a')](user['getTelephones']())[_0xf34d('0x1a')](realtime['initTelephones']())[_0xf34d('0x1a')](trunk['getTrunks']())[_0xf34d('0x1a')](realtime[_0xf34d('0x1d')]())[_0xf34d('0x1a')](voiceQueue[_0xf34d('0x1e')]())['then'](realtime[_0xf34d('0x1f')]())[_0xf34d('0x1a')](trigger[_0xf34d('0x20')]())['then'](realtime[_0xf34d('0x21')]())['then'](template[_0xf34d('0x22')]())[_0xf34d('0x1a')](realtime['initTemplates']())['then'](zendesk[_0xf34d('0x23')]())[_0xf34d('0x1a')](realtime[_0xf34d('0x24')]())[_0xf34d('0x1a')](salesforce[_0xf34d('0x25')]())[_0xf34d('0x1a')](realtime[_0xf34d('0x26')]())[_0xf34d('0x1a')](sugarcrm[_0xf34d('0x27')]())['then'](realtime[_0xf34d('0x28')]())[_0xf34d('0x1a')](freshdesk[_0xf34d('0x29')]())[_0xf34d('0x1a')](realtime['initFreshdeskAccounts']())[_0xf34d('0x1a')](desk[_0xf34d('0x2a')]())[_0xf34d('0x1a')](realtime[_0xf34d('0x2b')]())['then'](zoho['getZohoAccounts']())['then'](realtime[_0xf34d('0x2c')]())[_0xf34d('0x1a')](vtiger[_0xf34d('0x2d')]())[_0xf34d('0x1a')](realtime['initVtigerAccounts']())[_0xf34d('0x1a')](servicenow[_0xf34d('0x2e')]())[_0xf34d('0x1a')](realtime[_0xf34d('0x2f')]())[_0xf34d('0x1a')](dynamics365[_0xf34d('0x30')]())[_0xf34d('0x1a')](realtime[_0xf34d('0x31')]())[_0xf34d('0x1a')](campaign['getCampaigns']())[_0xf34d('0x1a')](realtime[_0xf34d('0x32')]())[_0xf34d('0x1a')](voiceExtension[_0xf34d('0x33')]())[_0xf34d('0x1a')](realtime['initVoiceExtensions']())['then'](faxAccount[_0xf34d('0x34')]())[_0xf34d('0x1a')](realtime[_0xf34d('0x35')]())[_0xf34d('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0xf34d('0x36')]()[_0xf34d('0x1a')](voiceQueueReport[_0xf34d('0x37')]())[_0xf34d('0x1a')](realtime[_0xf34d('0x38')]())[_0xf34d('0x1a')](cmHopperHistory[_0xf34d('0x39')]())[_0xf34d('0x1a')](realtime[_0xf34d('0x3a')]())[_0xf34d('0x1a')](cmHopperHistory[_0xf34d('0x3b')]())[_0xf34d('0x1a')](realtime[_0xf34d('0x3c')]())[_0xf34d('0x1a')](voiceCallReport['getVoiceCallReports']())[_0xf34d('0x1a')](realtime['initVoiceCallReports']())[_0xf34d('0x1a')](function(_0x498050){})[_0xf34d('0x3d')](function(_0x15cb84){console[_0xf34d('0x3e')](_0x15cb84);});}function main(){return server[_0xf34d('0x3f')](realtime,preview,fax)['then'](function(_0x22e6c9){return initRealtime();})['then'](function(){return initParams();})[_0xf34d('0x1a')](function(){report[_0xf34d('0x40')]();setInterval(initRealtime,0x1388);})[_0xf34d('0x3d')](function(_0x51bc04){console[_0xf34d('0x3e')](_0x51bc04);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index a1b40c1..f9edba6 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 _0xccfa=['localhost','name','email','accountcode','fullname','state','unknown','phone','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','not_inuse','idle','inuse','talking','statePause','toNumber','format','stateTime','status','address','stringify','exports','lodash','md5','ioredis','redis','defaults'];(function(_0x500ae4,_0x383009){var _0x57b905=function(_0x440952){while(--_0x440952){_0x500ae4['push'](_0x500ae4['shift']());}};_0x57b905(++_0x383009);}(_0xccfa,0x1ea));var _0xaccf=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0xccfa[_0x25d386];return _0x857f4a;};'use strict';var _=require(_0xaccf('0x0'));var util=require('util');var moment=require('moment');var md5=require(_0xaccf('0x1'));var Redis=require(_0xaccf('0x2'));var config=require('../../../config/environment');config[_0xaccf('0x3')]=_[_0xaccf('0x4')](config[_0xaccf('0x3')],{'host':_0xaccf('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xaccf('0x3')]));function Agent(_0x4b8f7e){this['id']=_0x4b8f7e['id']||0x0;this[_0xaccf('0x6')]=_0x4b8f7e[_0xaccf('0x6')]||'';this[_0xaccf('0x7')]=_0x4b8f7e[_0xaccf('0x7')]||'';this[_0xaccf('0x8')]=_0x4b8f7e[_0xaccf('0x8')]||'';this[_0xaccf('0x9')]=_0x4b8f7e[_0xaccf('0x9')]||'';this[_0xaccf('0xa')]=_0xaccf('0xb');this['stateTime']=0x0;this['status']=_0xaccf('0xb');this['address']='';this[_0xaccf('0xc')]='';this['mobile']='';this[_0xaccf('0xd')]='';this[_0xaccf('0xe')]=_0x4b8f7e[_0xaccf('0xe')]||![];this[_0xaccf('0xf')]='unknown';this[_0xaccf('0x10')]=0x0;this[_0xaccf('0x11')]='';this['voiceStatusQueue']='';this[_0xaccf('0x12')]=![];this[_0xaccf('0x13')]=![];this[_0xaccf('0x1')]='';}Agent[_0xaccf('0x14')]['updateStatusRealtime']=function(_0x59c5fb){var _0x44f70f;if(_0x59c5fb&&_0x59c5fb[_0xaccf('0xa')]){_0x44f70f=_0x59c5fb[_0xaccf('0xa')]['toLowerCase']();switch(_0x44f70f){case _0xaccf('0x15'):_0x44f70f=_0xaccf('0x16');break;case _0xaccf('0x17'):_0x44f70f=_0xaccf('0x18');break;}}if(_0x44f70f&&this['voiceStatus']!==_0x44f70f||_0x59c5fb[_0xaccf('0x19')]){this['voiceStatusTime']=_[_0xaccf('0x1a')](moment()[_0xaccf('0x1b')]('x'));}if(_0x44f70f){this[_0xaccf('0xf')]=_0x44f70f;}var _0x28a6f0={'id':this['id'],'name':this[_0xaccf('0x6')],'email':this[_0xaccf('0x7')],'accountcode':this[_0xaccf('0x8')],'fullname':this['fullname'],'state':this[_0xaccf('0xa')],'stateTime':this[_0xaccf('0x1c')],'status':this[_0xaccf('0x1d')],'address':this[_0xaccf('0x1e')],'online':this[_0xaccf('0xe')],'voiceStatus':this[_0xaccf('0xf')],'voiceStatusTime':this[_0xaccf('0x10')],'voiceStatusCallerIdNumber':this[_0xaccf('0x11')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0xaccf('0x12')]};var _0x205276=md5(JSON[_0xaccf('0x1f')](_0x28a6f0));if(this['md5']!==_0x205276){this['md5']=_0x205276;io['to'](util[_0xaccf('0x1b')]('user:%s',_0x28a6f0[_0xaccf('0x6')]))['emit']('user:save',_0x28a6f0);}};module[_0xaccf('0x20')]=Agent; \ No newline at end of file +var _0x7347=['voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','state','toLowerCase','not_inuse','idle','inuse','talking','stateTime','exports','util','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status','address','phone','interface','online','voiceStatus'];(function(_0xa91c8b,_0x178735){var _0x16cace=function(_0x3b4edf){while(--_0x3b4edf){_0xa91c8b['push'](_0xa91c8b['shift']());}};_0x16cace(++_0x178735);}(_0x7347,0x72));var _0x7734=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x7347[_0x2112d4];return _0x434972;};'use strict';var _=require('lodash');var util=require(_0x7734('0x0'));var moment=require('moment');var md5=require(_0x7734('0x1'));var Redis=require(_0x7734('0x2'));var config=require(_0x7734('0x3'));config[_0x7734('0x4')]=_[_0x7734('0x5')](config[_0x7734('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x7734('0x6'))(new Redis(config[_0x7734('0x4')]));function Agent(_0x14ae46){this['id']=_0x14ae46['id']||0x0;this['name']=_0x14ae46[_0x7734('0x7')]||'';this[_0x7734('0x8')]=_0x14ae46['email']||'';this[_0x7734('0x9')]=_0x14ae46[_0x7734('0x9')]||'';this[_0x7734('0xa')]=_0x14ae46[_0x7734('0xa')]||'';this['state']=_0x7734('0xb');this['stateTime']=0x0;this[_0x7734('0xc')]=_0x7734('0xb');this[_0x7734('0xd')]='';this[_0x7734('0xe')]='';this['mobile']='';this[_0x7734('0xf')]='';this[_0x7734('0x10')]=_0x14ae46[_0x7734('0x10')]||![];this[_0x7734('0x11')]=_0x7734('0xb');this[_0x7734('0x12')]=0x0;this[_0x7734('0x13')]='';this[_0x7734('0x14')]='';this[_0x7734('0x15')]=![];this[_0x7734('0x16')]=![];this[_0x7734('0x1')]='';}Agent[_0x7734('0x17')][_0x7734('0x18')]=function(_0x19a9f2){var _0xa264bc;if(_0x19a9f2&&_0x19a9f2[_0x7734('0x19')]){_0xa264bc=_0x19a9f2['state'][_0x7734('0x1a')]();switch(_0xa264bc){case _0x7734('0x1b'):_0xa264bc=_0x7734('0x1c');break;case _0x7734('0x1d'):_0xa264bc=_0x7734('0x1e');break;}}if(_0xa264bc&&this[_0x7734('0x11')]!==_0xa264bc||_0x19a9f2['statePause']){this[_0x7734('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0xa264bc){this['voiceStatus']=_0xa264bc;}var _0x1a95e1={'id':this['id'],'name':this[_0x7734('0x7')],'email':this[_0x7734('0x8')],'accountcode':this['accountcode'],'fullname':this[_0x7734('0xa')],'state':this['state'],'stateTime':this[_0x7734('0x1f')],'status':this[_0x7734('0xc')],'address':this[_0x7734('0xd')],'online':this['online'],'voiceStatus':this[_0x7734('0x11')],'voiceStatusTime':this[_0x7734('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x7734('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a5829=md5(JSON['stringify'](_0x1a95e1));if(this['md5']!==_0x3a5829){this['md5']=_0x3a5829;io['to'](util['format']('user:%s',_0x1a95e1[_0x7734('0x7')]))['emit']('user:save',_0x1a95e1);}};module[_0x7734('0x20')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index af1f208..b2192c8 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 _0xb10b=['dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x4265f4,_0x44b225){var _0x4048a4=function(_0x33a761){while(--_0x33a761){_0x4265f4['push'](_0x4265f4['shift']());}};_0x4048a4(++_0x44b225);}(_0xb10b,0x12a));var _0xbb10=function(_0x320f22,_0x488293){_0x320f22=_0x320f22-0x0;var _0x281311=_0xb10b[_0x320f22];return _0x281311;};'use strict';function Campaign(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'campaign';this[_0xbb10('0x2')]=0x0;this[_0xbb10('0x3')]=0x0;this[_0xbb10('0x4')]=0x0;this[_0xbb10('0x5')]=0x0;this[_0xbb10('0x6')]='';this[_0xbb10('0x7')]=!![];this['active']=_0x13ce8d[_0xbb10('0x8')];this[_0xbb10('0x9')]=_0x13ce8d['limitCalls'];this[_0xbb10('0xa')]=_0x13ce8d[_0xbb10('0xa')]||null;this[_0xbb10('0xb')]=_0x13ce8d[_0xbb10('0xb')]?_0x13ce8d[_0xbb10('0xb')]:null;this[_0xbb10('0xc')]=_0x13ce8d[_0xbb10('0xc')];this[_0xbb10('0xd')]=_0x13ce8d['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x13ce8d[_0xbb10('0xe')]||0x1e;this[_0xbb10('0xf')]=_0x13ce8d[_0xbb10('0xf')];this['dialCongestionRetryFrequency']=_0x13ce8d[_0xbb10('0x10')];this['dialBusyMaxRetry']=_0x13ce8d[_0xbb10('0x11')];this[_0xbb10('0x12')]=_0x13ce8d[_0xbb10('0x12')];this[_0xbb10('0x13')]=_0x13ce8d[_0xbb10('0x13')];this[_0xbb10('0x14')]=_0x13ce8d['dialNoAnswerRetryFrequency'];this[_0xbb10('0x15')]=_0x13ce8d[_0xbb10('0x15')];this[_0xbb10('0x16')]=_0x13ce8d[_0xbb10('0x16')]||_0xbb10('0x17');this[_0xbb10('0x18')]=_0x13ce8d[_0xbb10('0x18')]||undefined;this[_0xbb10('0x19')]=_0x13ce8d[_0xbb10('0x19')]||undefined;this[_0xbb10('0x1a')]=_0x13ce8d['dialCutDigit']||undefined;this[_0xbb10('0x1b')]=_0x13ce8d[_0xbb10('0x1b')]?_0x13ce8d[_0xbb10('0x1b')]:undefined;this[_0xbb10('0x1c')]=_0x13ce8d[_0xbb10('0x1c')]?_0x13ce8d[_0xbb10('0x1c')]:undefined;this[_0xbb10('0x1d')]=_0x13ce8d[_0xbb10('0x1d')]?_0x13ce8d[_0xbb10('0x1d')]:undefined;this[_0xbb10('0x1e')]=_0x13ce8d['SquareProject']?_0x13ce8d[_0xbb10('0x1e')]:undefined;this[_0xbb10('0x1f')]=_0x13ce8d[_0xbb10('0x1e')]?_0x13ce8d[_0xbb10('0x1e')][_0xbb10('0x0')]:undefined;this[_0xbb10('0x20')]=_0x13ce8d['dialAMDActive']||![];this[_0xbb10('0x21')]=_0x13ce8d[_0xbb10('0x21')];this['dialAMDGreeting']=_0x13ce8d['dialAMDGreeting'];this[_0xbb10('0x22')]=_0x13ce8d[_0xbb10('0x22')];this[_0xbb10('0x23')]=_0x13ce8d[_0xbb10('0x23')];this[_0xbb10('0x24')]=_0x13ce8d[_0xbb10('0x24')];this[_0xbb10('0x25')]=_0x13ce8d[_0xbb10('0x25')];this[_0xbb10('0x26')]=_0x13ce8d[_0xbb10('0x26')];this[_0xbb10('0x27')]=_0x13ce8d[_0xbb10('0x27')];this['dialAMDMaximumWordLength']=_0x13ce8d['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file +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(_0x436f5f,_0x554f0d){var _0x4a8ddf=function(_0x1fa9ee){while(--_0x1fa9ee){_0x436f5f['push'](_0x436f5f['shift']());}};_0x4a8ddf(++_0x554f0d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3a13cf,_0x478c62){_0x3a13cf=_0x3a13cf-0x0;var _0x4817c=_0x0b0e[_0x3a13cf];return _0x4817c;};'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 diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 9502afa..479457c 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 _0xc224=['channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','tag','disposition','queue','monitors','transfercalleridnum','mohtime','starttime'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0xc224,0x1af));var _0x4c22=function(_0x48b93e,_0x523f9f){_0x48b93e=_0x48b93e-0x0;var _0x51b565=_0xc224[_0x48b93e];return _0x51b565;};'use strict';function Channel(){this[_0x4c22('0x0')]=null;this[_0x4c22('0x1')]='';this[_0x4c22('0x2')]='';this['calleridnum']=0x0;this[_0x4c22('0x3')]='';this[_0x4c22('0x4')]=undefined;this[_0x4c22('0x5')]=undefined;this[_0x4c22('0x6')]=0x0;this[_0x4c22('0x7')]='';this[_0x4c22('0x8')]=0x0;this[_0x4c22('0x9')]=0x0;this[_0x4c22('0xa')]=0x0;this['answered']=![];this['answertime']=null;this['endtime']=null;this[_0x4c22('0xb')]=![];this[_0x4c22('0xc')]=![];this[_0x4c22('0xd')]='';this[_0x4c22('0xe')]='';this[_0x4c22('0xf')]=0x0;this[_0x4c22('0x10')]=0x0;this[_0x4c22('0x11')]=0x0;this['type']=null;this[_0x4c22('0x12')]=null;this[_0x4c22('0x13')]=null;this['monitor']=![];this['monitorFilename']=null;this[_0x4c22('0x14')]=null;this[_0x4c22('0x15')]=[];this[_0x4c22('0x16')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x4c22('0x17')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x2eba=['destinationchannel','calleridnum','calleridname','accountcode','uniqueid','linkedid','exten','answered','abandoned','lastdata','duration','billableseconds','tag','disposition','monitor','queue','monitors','transferconnectedlinenum','exports','channel'];(function(_0x1e6e34,_0x225db9){var _0x4f05b0=function(_0x5d6443){while(--_0x5d6443){_0x1e6e34['push'](_0x1e6e34['shift']());}};_0x4f05b0(++_0x225db9);}(_0x2eba,0xc7));var _0xa2eb=function(_0x4e858e,_0x1dfc4c){_0x4e858e=_0x4e858e-0x0;var _0x38350d=_0x2eba[_0x4e858e];return _0x38350d;};'use strict';function Channel(){this['starttime']=null;this[_0xa2eb('0x0')]='';this[_0xa2eb('0x1')]='';this[_0xa2eb('0x2')]=0x0;this[_0xa2eb('0x3')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0xa2eb('0x4')]=0x0;this['context']='';this[_0xa2eb('0x5')]=0x0;this[_0xa2eb('0x6')]=0x0;this[_0xa2eb('0x7')]=0x0;this[_0xa2eb('0x8')]=![];this['answertime']=null;this['endtime']=null;this['unmanaged']=![];this[_0xa2eb('0x9')]=![];this['lastapplication']='';this[_0xa2eb('0xa')]='';this[_0xa2eb('0xb')]=0x0;this[_0xa2eb('0xc')]=0x0;this['holdtime']=0x0;this['type']=null;this[_0xa2eb('0xd')]=null;this[_0xa2eb('0xe')]=null;this[_0xa2eb('0xf')]=![];this['monitorFilename']=null;this[_0xa2eb('0x10')]=null;this[_0xa2eb('0x11')]=[];this['transfercalleridnum']=undefined;this[_0xa2eb('0x12')]=undefined;this['mohtime']=0x0;}module[_0xa2eb('0x13')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 0851430..1b104d8 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 _0x9879=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType'];(function(_0x2a004e,_0x53d818){var _0x29ebc9=function(_0x38e1b8){while(--_0x38e1b8){_0x2a004e['push'](_0x2a004e['shift']());}};_0x29ebc9(++_0x53d818);}(_0x9879,0x98));var _0x9987=function(_0x5c1b8f,_0x23ba99){_0x5c1b8f=_0x5c1b8f-0x0;var _0x1f0e71=_0x9879[_0x5c1b8f];return _0x1f0e71;};'use strict';function DeskAccount(_0x1f7c5f){this['id']=_0x1f7c5f['id']||0x0;this[_0x9987('0x0')]=_0x1f7c5f[_0x9987('0x0')]||'';this['username']=_0x1f7c5f[_0x9987('0x1')]||'';this['remoteUri']=_0x1f7c5f[_0x9987('0x2')]||'';this[_0x9987('0x3')]=_0x1f7c5f[_0x9987('0x3')]||'';this[_0x9987('0x4')]=_0x1f7c5f[_0x9987('0x4')]||'';this[_0x9987('0x5')]=_0x1f7c5f[_0x9987('0x5')]||'';this['consumerSecret']=_0x1f7c5f[_0x9987('0x6')]||'';this['token']=_0x1f7c5f[_0x9987('0x7')]||'';this[_0x9987('0x8')]=_0x1f7c5f[_0x9987('0x8')]||'';this[_0x9987('0x9')]=_0x1f7c5f[_0x9987('0x9')]||'';this[_0x9987('0xa')]=_0x1f7c5f[_0x9987('0xa')]||'';this[_0x9987('0xb')]=_0x1f7c5f[_0x9987('0xb')]||{};}module[_0x9987('0xc')]=DeskAccount; \ No newline at end of file +var _0xa1a5=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa1a5,0x1b8));var _0x5a1a=function(_0x40967c,_0x39091a){_0x40967c=_0x40967c-0x0;var _0x4b5ad4=_0xa1a5[_0x40967c];return _0x4b5ad4;};'use strict';function DeskAccount(_0x193d84){this['id']=_0x193d84['id']||0x0;this['name']=_0x193d84[_0x5a1a('0x0')]||'';this[_0x5a1a('0x1')]=_0x193d84[_0x5a1a('0x1')]||'';this[_0x5a1a('0x2')]=_0x193d84[_0x5a1a('0x2')]||'';this['authType']=_0x193d84[_0x5a1a('0x3')]||'';this[_0x5a1a('0x4')]=_0x193d84[_0x5a1a('0x4')]||'';this[_0x5a1a('0x5')]=_0x193d84[_0x5a1a('0x5')]||'';this[_0x5a1a('0x6')]=_0x193d84[_0x5a1a('0x6')]||'';this['token']=_0x193d84[_0x5a1a('0x7')]||'';this[_0x5a1a('0x8')]=_0x193d84[_0x5a1a('0x8')]||'';this[_0x5a1a('0x9')]=_0x193d84[_0x5a1a('0x9')]||'';this[_0x5a1a('0xa')]=_0x193d84[_0x5a1a('0xa')]||'';this[_0x5a1a('0xb')]=_0x193d84[_0x5a1a('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index b152e44..82f6b75 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 _0x3949=['name','username','password','remoteUri','tenantId','clientId','clientSecret','Configurations','exports'];(function(_0xe15270,_0x227d06){var _0x1e813b=function(_0x1d590d){while(--_0x1d590d){_0xe15270['push'](_0xe15270['shift']());}};_0x1e813b(++_0x227d06);}(_0x3949,0xa2));var _0x9394=function(_0x325c1d,_0xaac33){_0x325c1d=_0x325c1d-0x0;var _0x41620d=_0x3949[_0x325c1d];return _0x41620d;};'use strict';function Dynamics365Account(_0x4a6044){this['id']=_0x4a6044['id']||0x0;this[_0x9394('0x0')]=_0x4a6044[_0x9394('0x0')]||'';this[_0x9394('0x1')]=_0x4a6044[_0x9394('0x1')]||'';this[_0x9394('0x2')]=_0x4a6044[_0x9394('0x2')]||'';this[_0x9394('0x3')]=_0x4a6044[_0x9394('0x3')]||'';this[_0x9394('0x4')]=_0x4a6044[_0x9394('0x4')]||'';this[_0x9394('0x5')]=_0x4a6044['clientId']||'';this[_0x9394('0x6')]=_0x4a6044[_0x9394('0x6')]||{};this['serverUrl']=_0x4a6044['serverUrl']||'';this[_0x9394('0x7')]=_0x4a6044[_0x9394('0x7')]||{};}module[_0x9394('0x8')]=Dynamics365Account; \ No newline at end of file +var _0x210f=['password','remoteUri','tenantId','clientSecret','serverUrl','Configurations','name','username'];(function(_0x1e5026,_0x1e5b89){var _0x236e12=function(_0x38d642){while(--_0x38d642){_0x1e5026['push'](_0x1e5026['shift']());}};_0x236e12(++_0x1e5b89);}(_0x210f,0x12e));var _0xf210=function(_0x2bb6e4,_0x5138d2){_0x2bb6e4=_0x2bb6e4-0x0;var _0x3c1335=_0x210f[_0x2bb6e4];return _0x3c1335;};'use strict';function Dynamics365Account(_0x574a1b){this['id']=_0x574a1b['id']||0x0;this[_0xf210('0x0')]=_0x574a1b[_0xf210('0x0')]||'';this[_0xf210('0x1')]=_0x574a1b[_0xf210('0x1')]||'';this[_0xf210('0x2')]=_0x574a1b[_0xf210('0x2')]||'';this['remoteUri']=_0x574a1b[_0xf210('0x3')]||'';this[_0xf210('0x4')]=_0x574a1b['tenantId']||'';this['clientId']=_0x574a1b['clientId']||'';this[_0xf210('0x5')]=_0x574a1b['clientSecret']||{};this[_0xf210('0x6')]=_0x574a1b['serverUrl']||'';this[_0xf210('0x7')]=_0x574a1b['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index d7cd17f..c1beb81 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 _0xa9b9=['name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0xa9b9,0x1c2));var _0x9a9b=function(_0x3b8ed6,_0x3b5bb6){_0x3b8ed6=_0x3b8ed6-0x0;var _0x2e6223=_0xa9b9[_0x3b8ed6];return _0x2e6223;};'use strict';function FaxAccount(_0x10885f){this['id']=_0x10885f['id']||0x0;this[_0x9a9b('0x0')]=_0x10885f[_0x9a9b('0x0')]||'';this[_0x9a9b('0x1')]=_0x10885f['description'];this[_0x9a9b('0x2')]=_0x10885f[_0x9a9b('0x2')];this[_0x9a9b('0x3')]=_0x10885f[_0x9a9b('0x3')];this['localstationid']=_0x10885f[_0x9a9b('0x4')];this[_0x9a9b('0x5')]=_0x10885f[_0x9a9b('0x5')]||0x960;this[_0x9a9b('0x6')]=_0x10885f[_0x9a9b('0x6')]||0x3840;this[_0x9a9b('0x7')]=_0x10885f[_0x9a9b('0x7')]||_0x9a9b('0x8');this[_0x9a9b('0x9')]=_0x10885f['gateway']||'no';this[_0x9a9b('0xa')]=_0x10885f[_0x9a9b('0xa')]||'no';this[_0x9a9b('0xb')]=_0x10885f['t38timeout']||0x1388;this[_0x9a9b('0xc')]=_0x10885f[_0x9a9b('0xc')]||_0x9a9b('0xd');this[_0x9a9b('0xe')]=_0x10885f[_0x9a9b('0xe')]?_0x10885f[_0x9a9b('0xe')]:undefined;this[_0x9a9b('0xf')]=_0x10885f['ListId'];this[_0x9a9b('0x10')]=_0x10885f[_0x9a9b('0x10')];}module[_0x9a9b('0x11')]=FaxAccount; \ No newline at end of file +var _0xe824=['key','exports','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','t38timeout','tech','SIP','Trunk','ListId'];(function(_0x2a0d81,_0x50d68d){var _0x239624=function(_0x26ed59){while(--_0x26ed59){_0x2a0d81['push'](_0x2a0d81['shift']());}};_0x239624(++_0x50d68d);}(_0xe824,0x1c2));var _0x4e82=function(_0x28aeb2,_0x319b38){_0x28aeb2=_0x28aeb2-0x0;var _0x1d33e1=_0xe824[_0x28aeb2];return _0x1d33e1;};'use strict';function FaxAccount(_0x5ebea4){this['id']=_0x5ebea4['id']||0x0;this['name']=_0x5ebea4['name']||'';this['description']=_0x5ebea4[_0x4e82('0x0')];this[_0x4e82('0x1')]=_0x5ebea4[_0x4e82('0x1')];this[_0x4e82('0x2')]=_0x5ebea4[_0x4e82('0x2')];this['localstationid']=_0x5ebea4[_0x4e82('0x3')];this[_0x4e82('0x4')]=_0x5ebea4[_0x4e82('0x4')]||0x960;this[_0x4e82('0x5')]=_0x5ebea4['maxrate']||0x3840;this['modem']=_0x5ebea4[_0x4e82('0x6')]||_0x4e82('0x7');this[_0x4e82('0x8')]=_0x5ebea4[_0x4e82('0x8')]||'no';this['faxdetect']=_0x5ebea4['faxdetect']||'no';this['t38timeout']=_0x5ebea4[_0x4e82('0x9')]||0x1388;this[_0x4e82('0xa')]=_0x5ebea4[_0x4e82('0xa')]||_0x4e82('0xb');this[_0x4e82('0xc')]=_0x5ebea4[_0x4e82('0xc')]?_0x5ebea4[_0x4e82('0xc')]:undefined;this[_0x4e82('0xd')]=_0x5ebea4[_0x4e82('0xd')];this[_0x4e82('0xe')]=_0x5ebea4[_0x4e82('0xe')];}module[_0x4e82('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 97ddd95..3e80af1 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 _0x6237=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x6237,0x16d));var _0x7623=function(_0x3174d2,_0x4dbb8a){_0x3174d2=_0x3174d2-0x0;var _0x28519a=_0x6237[_0x3174d2];return _0x28519a;};'use strict';function FreshdeskAccount(_0x8a30b8){this['id']=_0x8a30b8['id']||0x0;this[_0x7623('0x0')]=_0x8a30b8[_0x7623('0x0')]||'';this[_0x7623('0x1')]=_0x8a30b8['username']||'';this[_0x7623('0x2')]=_0x8a30b8[_0x7623('0x3')]||'';this[_0x7623('0x4')]=_0x8a30b8[_0x7623('0x4')]||'';this[_0x7623('0x5')]=_0x8a30b8[_0x7623('0x5')]||'';this[_0x7623('0x6')]=_0x8a30b8['Configurations']||{};}module[_0x7623('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x4308=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x29bfda,_0x30ad24){var _0x3f3db5=function(_0x238405){while(--_0x238405){_0x29bfda['push'](_0x29bfda['shift']());}};_0x3f3db5(++_0x30ad24);}(_0x4308,0x83));var _0x8430=function(_0x570ebb,_0x3933dd){_0x570ebb=_0x570ebb-0x0;var _0x31f937=_0x4308[_0x570ebb];return _0x31f937;};'use strict';function FreshdeskAccount(_0x3f1493){this['id']=_0x3f1493['id']||0x0;this[_0x8430('0x0')]=_0x3f1493[_0x8430('0x0')]||'';this[_0x8430('0x1')]=_0x3f1493[_0x8430('0x1')]||'';this[_0x8430('0x2')]=_0x3f1493[_0x8430('0x3')]||'';this[_0x8430('0x4')]=_0x3f1493[_0x8430('0x4')]||'';this[_0x8430('0x5')]=_0x3f1493[_0x8430('0x5')]||'';this[_0x8430('0x6')]=_0x3f1493['Configurations']||{};}module[_0x8430('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 a9aa228..bee055b 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 _0x5a1b=['channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','queue','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','originalposition'];(function(_0x438912,_0x3f7f74){var _0x18112f=function(_0x1b8ac9){while(--_0x1b8ac9){_0x438912['push'](_0x438912['shift']());}};_0x18112f(++_0x3f7f74);}(_0x5a1b,0x145));var _0xb5a1=function(_0x375516,_0x3ab16b){_0x375516=_0x375516-0x0;var _0x22d52f=_0x5a1b[_0x375516];return _0x22d52f;};'use strict';function QueueReport(){this[_0xb5a1('0x0')]=_0xb5a1('0x1');this[_0xb5a1('0x2')]='';this[_0xb5a1('0x3')]='';this['calleridname']='';this[_0xb5a1('0x4')]='';this['queuecallerjoinAt']=null;this[_0xb5a1('0x5')]=null;this[_0xb5a1('0x6')]=0x1;this['count']=0x1;this[_0xb5a1('0x7')]=![];this[_0xb5a1('0x8')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this['queuecallerexit']=![];this[_0xb5a1('0x9')]=null;this[_0xb5a1('0xa')]=0x1;this[_0xb5a1('0xb')]='';this[_0xb5a1('0xc')]='';this[_0xb5a1('0xd')]='';this[_0xb5a1('0xe')]='';this[_0xb5a1('0xf')]='';this[_0xb5a1('0x10')]='';this[_0xb5a1('0x11')]='';this[_0xb5a1('0x12')]=0x0;this[_0xb5a1('0x13')]=![];this[_0xb5a1('0x14')]='';this[_0xb5a1('0x15')]=0x0;this[_0xb5a1('0x16')]={};}module[_0xb5a1('0x17')]=QueueReport; \ No newline at end of file +var _0x32af=['connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','variables','exports','inbound','uniqueid','calleridnum','calleridname','queue','position','count','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','originalposition','channel','connectedlinenum'];(function(_0x20cf8a,_0x44cd6b){var _0x54e165=function(_0xcce1d0){while(--_0xcce1d0){_0x20cf8a['push'](_0x20cf8a['shift']());}};_0x54e165(++_0x44cd6b);}(_0x32af,0xfb));var _0xf32a=function(_0x398355,_0x102c9d){_0x398355=_0x398355-0x0;var _0x73aed0=_0x32af[_0x398355];return _0x73aed0;};'use strict';function QueueReport(){this['type']=_0xf32a('0x0');this[_0xf32a('0x1')]='';this[_0xf32a('0x2')]='';this[_0xf32a('0x3')]='';this[_0xf32a('0x4')]='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this[_0xf32a('0x5')]=0x1;this[_0xf32a('0x6')]=0x1;this[_0xf32a('0x7')]=![];this[_0xf32a('0x8')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this['queuecallerexit']=![];this[_0xf32a('0x9')]=null;this[_0xf32a('0xa')]=0x1;this[_0xf32a('0xb')]='';this[_0xf32a('0xc')]='';this[_0xf32a('0xd')]='';this[_0xf32a('0xe')]='';this[_0xf32a('0xf')]='';this[_0xf32a('0x10')]='';this[_0xf32a('0x11')]='';this[_0xf32a('0x12')]=0x0;this[_0xf32a('0x13')]=![];this[_0xf32a('0x14')]='';this[_0xf32a('0x15')]=0x0;this[_0xf32a('0x16')]={};}module[_0xf32a('0x17')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 76b1ef2..0f0d26a 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 _0x2f1d=['integrationTab','serverUrl','Configurations','exports','name','username','password','clientId','clientSecret','securityToken'];(function(_0x5a2d9b,_0xe2461a){var _0x2fb63b=function(_0x36f268){while(--_0x36f268){_0x5a2d9b['push'](_0x5a2d9b['shift']());}};_0x2fb63b(++_0xe2461a);}(_0x2f1d,0xfe));var _0xd2f1=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x2f1d[_0x88cd7b];return _0x56fcc8;};'use strict';function SalesforceAccount(_0x36d6e1){this['id']=_0x36d6e1['id']||0x0;this[_0xd2f1('0x0')]=_0x36d6e1['name']||'';this[_0xd2f1('0x1')]=_0x36d6e1[_0xd2f1('0x1')]||'';this['remoteUri']=_0x36d6e1['remoteUri']||'';this[_0xd2f1('0x2')]=_0x36d6e1[_0xd2f1('0x2')]||'';this[_0xd2f1('0x3')]=_0x36d6e1[_0xd2f1('0x3')]||'';this['clientSecret']=_0x36d6e1[_0xd2f1('0x4')]||'';this[_0xd2f1('0x5')]=_0x36d6e1[_0xd2f1('0x5')]||'';this['type']=_0x36d6e1['type']||_0xd2f1('0x6');this[_0xd2f1('0x7')]=_0x36d6e1[_0xd2f1('0x7')]||'';this[_0xd2f1('0x8')]=_0x36d6e1['Configurations']||{};}module[_0xd2f1('0x9')]=SalesforceAccount; \ No newline at end of file +var _0x3312=['username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x1e78a4,_0xf2c40a){var _0x3194a6=function(_0x430a50){while(--_0x430a50){_0x1e78a4['push'](_0x1e78a4['shift']());}};_0x3194a6(++_0xf2c40a);}(_0x3312,0x167));var _0x2331=function(_0xc7bc80,_0x16b896){_0xc7bc80=_0xc7bc80-0x0;var _0x1810aa=_0x3312[_0xc7bc80];return _0x1810aa;};'use strict';function SalesforceAccount(_0x4e1772){this['id']=_0x4e1772['id']||0x0;this['name']=_0x4e1772[_0x2331('0x0')]||'';this['username']=_0x4e1772[_0x2331('0x1')]||'';this[_0x2331('0x2')]=_0x4e1772[_0x2331('0x2')]||'';this['password']=_0x4e1772[_0x2331('0x3')]||'';this[_0x2331('0x4')]=_0x4e1772[_0x2331('0x4')]||'';this[_0x2331('0x5')]=_0x4e1772[_0x2331('0x5')]||'';this['securityToken']=_0x4e1772[_0x2331('0x6')]||'';this[_0x2331('0x7')]=_0x4e1772[_0x2331('0x7')]||_0x2331('0x8');this[_0x2331('0x9')]=_0x4e1772[_0x2331('0x9')]||'';this[_0x2331('0xa')]=_0x4e1772[_0x2331('0xa')]||{};}module[_0x2331('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 643a559..ee27346 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 _0xd4a8=['name','username','password','remoteUri','Configurations','exports'];(function(_0x366ca3,_0x4f6ccb){var _0x5e2d76=function(_0x2da3ff){while(--_0x2da3ff){_0x366ca3['push'](_0x366ca3['shift']());}};_0x5e2d76(++_0x4f6ccb);}(_0xd4a8,0x19e));var _0x8d4a=function(_0x418034,_0x502ddf){_0x418034=_0x418034-0x0;var _0x2cbca1=_0xd4a8[_0x418034];return _0x2cbca1;};'use strict';function ServicenowAccount(_0xc7f9e5){this['id']=_0xc7f9e5['id']||0x0;this[_0x8d4a('0x0')]=_0xc7f9e5[_0x8d4a('0x0')]||'';this[_0x8d4a('0x1')]=_0xc7f9e5[_0x8d4a('0x1')]||'';this[_0x8d4a('0x2')]=_0xc7f9e5['password']||'';this['remoteUri']=_0xc7f9e5[_0x8d4a('0x3')]||'';this['serverUrl']=_0xc7f9e5['serverUrl']||'';this[_0x8d4a('0x4')]=_0xc7f9e5[_0x8d4a('0x4')]||{};}module[_0x8d4a('0x5')]=ServicenowAccount; \ No newline at end of file +var _0xcc3e=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcc3e,0x1d9));var _0xecc3=function(_0x41ff13,_0xa84762){_0x41ff13=_0x41ff13-0x0;var _0x1d00cd=_0xcc3e[_0x41ff13];return _0x1d00cd;};'use strict';function ServicenowAccount(_0x56713a){this['id']=_0x56713a['id']||0x0;this['name']=_0x56713a[_0xecc3('0x0')]||'';this[_0xecc3('0x1')]=_0x56713a[_0xecc3('0x1')]||'';this['password']=_0x56713a[_0xecc3('0x2')]||'';this[_0xecc3('0x3')]=_0x56713a[_0xecc3('0x3')]||'';this['serverUrl']=_0x56713a[_0xecc3('0x4')]||'';this['Configurations']=_0x56713a[_0xecc3('0x5')]||{};}module[_0xecc3('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index e48abef..e189f8d 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 _0xcfa3=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x533528,_0x409d05){var _0x3189f1=function(_0x5e63d2){while(--_0x5e63d2){_0x533528['push'](_0x533528['shift']());}};_0x3189f1(++_0x409d05);}(_0xcfa3,0xed));var _0x3cfa=function(_0x497646,_0x1a9493){_0x497646=_0x497646-0x0;var _0xc2229f=_0xcfa3[_0x497646];return _0xc2229f;};'use strict';function SugarcrmAccount(_0x5585a7){this['id']=_0x5585a7['id']||0x0;this[_0x3cfa('0x0')]=_0x5585a7['name']||'';this[_0x3cfa('0x1')]=_0x5585a7[_0x3cfa('0x1')]||'';this[_0x3cfa('0x2')]=_0x5585a7[_0x3cfa('0x2')]||'';this[_0x3cfa('0x3')]=_0x5585a7[_0x3cfa('0x3')]||'';this[_0x3cfa('0x4')]=_0x5585a7[_0x3cfa('0x4')]||'';this[_0x3cfa('0x5')]=_0x5585a7[_0x3cfa('0x5')]||{};}module[_0x3cfa('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x4ee6=['name','username','password','remoteUri','serverUrl','exports'];(function(_0x590b61,_0x4c4335){var _0x1a14dc=function(_0x2ff4f6){while(--_0x2ff4f6){_0x590b61['push'](_0x590b61['shift']());}};_0x1a14dc(++_0x4c4335);}(_0x4ee6,0x192));var _0x64ee=function(_0x26682d,_0x376b7f){_0x26682d=_0x26682d-0x0;var _0x3e6445=_0x4ee6[_0x26682d];return _0x3e6445;};'use strict';function SugarcrmAccount(_0x532e3f){this['id']=_0x532e3f['id']||0x0;this[_0x64ee('0x0')]=_0x532e3f[_0x64ee('0x0')]||'';this[_0x64ee('0x1')]=_0x532e3f['username']||'';this[_0x64ee('0x2')]=_0x532e3f[_0x64ee('0x2')]||'';this['remoteUri']=_0x532e3f[_0x64ee('0x3')]||'';this[_0x64ee('0x4')]=_0x532e3f['serverUrl']||'';this['Configurations']=_0x532e3f['Configurations']||{};}module[_0x64ee('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 33aaa70..2c918b2 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 _0x6996=['exports','name','accountcode','state','unknown','stateTime','status','address'];(function(_0x37fa2b,_0x3adbf7){var _0x44efee=function(_0x5bf7ce){while(--_0x5bf7ce){_0x37fa2b['push'](_0x37fa2b['shift']());}};_0x44efee(++_0x3adbf7);}(_0x6996,0x111));var _0x6699=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0x6996[_0x245afe];return _0x4eefde;};'use strict';function Telephone(_0x12e760){this['id']=_0x12e760['id']||0x0;this[_0x6699('0x0')]=_0x12e760[_0x6699('0x0')]||'';this['accountcode']=_0x12e760[_0x6699('0x1')]||'';this[_0x6699('0x2')]=_0x6699('0x3');this[_0x6699('0x4')]=0x0;this[_0x6699('0x5')]='unknown';this[_0x6699('0x6')]='';}module[_0x6699('0x7')]=Telephone; \ No newline at end of file +var _0x8831=['name','accountcode','state','stateTime','status','unknown','address','exports'];(function(_0x25add8,_0x211a47){var _0x11865f=function(_0x25f3a8){while(--_0x25f3a8){_0x25add8['push'](_0x25add8['shift']());}};_0x11865f(++_0x211a47);}(_0x8831,0x178));var _0x1883=function(_0x4b8212,_0x37d755){_0x4b8212=_0x4b8212-0x0;var _0x54de6e=_0x8831[_0x4b8212];return _0x54de6e;};'use strict';function Telephone(_0x397eac){this['id']=_0x397eac['id']||0x0;this[_0x1883('0x0')]=_0x397eac[_0x1883('0x0')]||'';this[_0x1883('0x1')]=_0x397eac[_0x1883('0x1')]||'';this[_0x1883('0x2')]='unknown';this[_0x1883('0x3')]=0x0;this[_0x1883('0x4')]=_0x1883('0x5');this[_0x1883('0x6')]='';}module[_0x1883('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 7b9fd2e..46e7646 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 _0x18c9=['name','html','exports'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0x18c9,0x1bf));var _0x918c=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0x18c9[_0x1a7550];return _0x426e22;};'use strict';function template(_0x4963da){this['id']=_0x4963da['id']||0x0;this[_0x918c('0x0')]=_0x4963da[_0x918c('0x0')]||'';this[_0x918c('0x1')]=_0x4963da[_0x918c('0x1')]||'';}module[_0x918c('0x2')]=template; \ No newline at end of file +var _0x61c7=['html','exports','name'];(function(_0x380a3f,_0x2807c7){var _0x1f4b10=function(_0x163f1d){while(--_0x163f1d){_0x380a3f['push'](_0x380a3f['shift']());}};_0x1f4b10(++_0x2807c7);}(_0x61c7,0x176));var _0x761c=function(_0x100916,_0x25270d){_0x100916=_0x100916-0x0;var _0xa31589=_0x61c7[_0x100916];return _0xa31589;};'use strict';function template(_0x53cb68){this['id']=_0x53cb68['id']||0x0;this['name']=_0x53cb68[_0x761c('0x0')]||'';this[_0x761c('0x1')]=_0x53cb68['html']||'';}module[_0x761c('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 7c6585c..c882b3d 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 _0x3e74=['Actions','name','channel','status','AllConditions','AnyConditions'];(function(_0x153823,_0x586b43){var _0x35f08c=function(_0x197a9f){while(--_0x197a9f){_0x153823['push'](_0x153823['shift']());}};_0x35f08c(++_0x586b43);}(_0x3e74,0x175));var _0x43e7=function(_0x14fc0d,_0x2998d0){_0x14fc0d=_0x14fc0d-0x0;var _0x4f0b2f=_0x3e74[_0x14fc0d];return _0x4f0b2f;};'use strict';function Trigger(_0x284ef8){this['id']=_0x284ef8['id']||0x0;this['name']=_0x284ef8[_0x43e7('0x0')]||'';this[_0x43e7('0x1')]=_0x284ef8[_0x43e7('0x1')]||'voice';this['status']=_0x284ef8[_0x43e7('0x2')]||![];this['AllConditions']=_0x284ef8[_0x43e7('0x3')]||[];this[_0x43e7('0x4')]=_0x284ef8[_0x43e7('0x4')]||[];this[_0x43e7('0x5')]=_0x284ef8[_0x43e7('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0xa41a=['AnyConditions','Actions','name','channel','voice','status','AllConditions'];(function(_0x4660b7,_0xae74f0){var _0x4a0951=function(_0x32ad24){while(--_0x32ad24){_0x4660b7['push'](_0x4660b7['shift']());}};_0x4a0951(++_0xae74f0);}(_0xa41a,0x6b));var _0xaa41=function(_0x1b48eb,_0x120627){_0x1b48eb=_0x1b48eb-0x0;var _0x3b7e5c=_0xa41a[_0x1b48eb];return _0x3b7e5c;};'use strict';function Trigger(_0x33e667){this['id']=_0x33e667['id']||0x0;this[_0xaa41('0x0')]=_0x33e667['name']||'';this[_0xaa41('0x1')]=_0x33e667[_0xaa41('0x1')]||_0xaa41('0x2');this[_0xaa41('0x3')]=_0x33e667[_0xaa41('0x3')]||![];this[_0xaa41('0x4')]=_0x33e667[_0xaa41('0x4')]||[];this[_0xaa41('0x5')]=_0x33e667['AnyConditions']||[];this[_0xaa41('0x6')]=_0x33e667[_0xaa41('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 4f5f4df..ea65632 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 _0x5e59=['name','state','unknown','status','registry','indexOf','host','port','domain','domainport','refresh','stateRegistry','active'];(function(_0x89064d,_0x3b096a){var _0x318fc9=function(_0x4dfcd3){while(--_0x4dfcd3){_0x89064d['push'](_0x89064d['shift']());}};_0x318fc9(++_0x3b096a);}(_0x5e59,0x151));var _0x95e5=function(_0x5805d7,_0x3d584a){_0x5805d7=_0x5805d7-0x0;var _0x170fe4=_0x5e59[_0x5805d7];return _0x170fe4;};'use strict';function Trunk(_0x3be3ff){this['id']=_0x3be3ff['id']||0x0;this[_0x95e5('0x0')]=_0x3be3ff['active']||![];this[_0x95e5('0x1')]=_0x3be3ff[_0x95e5('0x1')]||'';this[_0x95e5('0x2')]=_0x95e5('0x3');this['stateTime']=0x0;this[_0x95e5('0x4')]=_0x95e5('0x3');this[_0x95e5('0x5')]=_0x3be3ff[_0x95e5('0x5')]&&_0x3be3ff['registry'][_0x95e5('0x6')](':')?_0x3be3ff['registry']['split'](':')[0x0]:'';this[_0x95e5('0x7')]='';this[_0x95e5('0x8')]='';this[_0x95e5('0x9')]='';this[_0x95e5('0xa')]='';this[_0x95e5('0xb')]='';this[_0x95e5('0xc')]=_0x95e5('0x3');this['registrationtime']='';this['address']='';}module['exports']=Trunk; \ No newline at end of file +var _0xcd74=['status','registry','indexOf','split','host','domain','refresh','stateRegistry','registrationtime','address','exports','active','name','state','unknown','stateTime'];(function(_0x722103,_0x5732f3){var _0x3e2435=function(_0x44c44a){while(--_0x44c44a){_0x722103['push'](_0x722103['shift']());}};_0x3e2435(++_0x5732f3);}(_0xcd74,0x16b));var _0x4cd7=function(_0x2c2277,_0x113f4e){_0x2c2277=_0x2c2277-0x0;var _0x40cf64=_0xcd74[_0x2c2277];return _0x40cf64;};'use strict';function Trunk(_0x2d36ac){this['id']=_0x2d36ac['id']||0x0;this[_0x4cd7('0x0')]=_0x2d36ac['active']||![];this[_0x4cd7('0x1')]=_0x2d36ac['name']||'';this[_0x4cd7('0x2')]=_0x4cd7('0x3');this[_0x4cd7('0x4')]=0x0;this[_0x4cd7('0x5')]='unknown';this['registry']=_0x2d36ac[_0x4cd7('0x6')]&&_0x2d36ac['registry'][_0x4cd7('0x7')](':')?_0x2d36ac[_0x4cd7('0x6')][_0x4cd7('0x8')](':')[0x0]:'';this[_0x4cd7('0x9')]='';this['port']='';this[_0x4cd7('0xa')]='';this['domainport']='';this[_0x4cd7('0xb')]='';this[_0x4cd7('0xc')]=_0x4cd7('0x3');this[_0x4cd7('0xd')]='';this[_0x4cd7('0xe')]='';}module[_0x4cd7('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 36bc5ce..ed673b9 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 _0x7eaf=['recordingFormat','exten'];(function(_0x1d4bc1,_0x4845bc){var _0x38e085=function(_0x339492){while(--_0x339492){_0x1d4bc1['push'](_0x1d4bc1['shift']());}};_0x38e085(++_0x4845bc);}(_0x7eaf,0xb5));var _0xf7ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7eaf[_0x3dd15e];return _0x231fd0;};'use strict';function voiceExtension(_0x5bdccd){this['id']=_0x5bdccd['id']||0x0;this['exten']=_0x5bdccd[_0xf7ea('0x0')]||'';this[_0xf7ea('0x1')]=_0x5bdccd[_0xf7ea('0x1')]||'none';this['mandatoryDisposition']=_0x5bdccd['mandatoryDisposition']||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x1a91=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1a91,0xd5));var _0x11a9=function(_0x2282a8,_0x3cea15){_0x2282a8=_0x2282a8-0x0;var _0xa9acf2=_0x1a91[_0x2282a8];return _0xa9acf2;};'use strict';function voiceExtension(_0x588cdf){this['id']=_0x588cdf['id']||0x0;this['exten']=_0x588cdf[_0x11a9('0x0')]||'';this[_0x11a9('0x1')]=_0x588cdf['recordingFormat']||'none';this[_0x11a9('0x2')]=_0x588cdf[_0x11a9('0x2')]||![];}module[_0x11a9('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index ee4f612..fa60872 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 _0xe144=['type','inbound','waiting','talking','total','sumHoldTime','unmanaged','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','busy','invalid','ringinuse','onhold','wav','wav49','rrmemory','name','monitor_format'];(function(_0x3d462f,_0x4468a2){var _0x2f9c74=function(_0x1f50fa){while(--_0x1f50fa){_0x3d462f['push'](_0x3d462f['shift']());}};_0x2f9c74(++_0x4468a2);}(_0xe144,0xbe));var _0x4e14=function(_0x565c4e,_0x1e77f9){_0x565c4e=_0x565c4e-0x0;var _0x4a167f=_0xe144[_0x565c4e];return _0x4a167f;};'use strict';var statusDesc=[_0x4e14('0x0'),'not_inuse','inuse',_0x4e14('0x1'),_0x4e14('0x2'),'unavailable','ringing',_0x4e14('0x3'),_0x4e14('0x4')];var monitorFormat={'wav':_0x4e14('0x5'),'wav49':_0x4e14('0x6'),'gsm':'gsm'};var strategy={'rrmemory':_0x4e14('0x7'),'roundrobin':'roundrobin'};function VoiceQueue(_0x34fcd7){this['id']=_0x34fcd7['id']||0x0;this[_0x4e14('0x8')]=_0x34fcd7['name']||'';this[_0x4e14('0x9')]=_0x34fcd7[_0x4e14('0x9')]||'';this[_0x4e14('0xa')]=_0x34fcd7[_0x4e14('0xa')]||_0x4e14('0xb');this[_0x4e14('0xc')]=0x0;this[_0x4e14('0xd')]=0x0;this[_0x4e14('0xe')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0x4e14('0xf')]=0x0;this['sumBillable']=0x0;this[_0x4e14('0x10')]=0x0;this[_0x4e14('0x11')]=0x0;this['loggedIn']=0x0;this[_0x4e14('0x12')]=0x0;this[_0x4e14('0x13')]=_0x34fcd7['acw']||![];this['acwTimeout']=_0x34fcd7[_0x4e14('0x14')]||0xa;this[_0x4e14('0x15')]=_0x34fcd7[_0x4e14('0x15')]||'no';this[_0x4e14('0x16')]=!![];this[_0x4e14('0x17')]='';this[_0x4e14('0x18')]=0x0;this['temp']=0x0;this[_0x4e14('0x19')]=_0x34fcd7['dialTimezone']||null;this['dialGlobalInterval']=_0x34fcd7[_0x4e14('0x1a')]?_0x34fcd7[_0x4e14('0x1a')]:null;this[_0x4e14('0x1b')]=_0x34fcd7['dialActive'];this['dialMethod']=_0x34fcd7[_0x4e14('0x1c')]||_0x4e14('0x1d');this[_0x4e14('0x1e')]=_0x34fcd7[_0x4e14('0x1e')]||0x0;this[_0x4e14('0x1f')]=_0x34fcd7[_0x4e14('0x1f')]||0x0;this[_0x4e14('0x20')]=_0x34fcd7[_0x4e14('0x20')]||0x1;this[_0x4e14('0x21')]=_0x34fcd7['dialPredictiveOptimization']||_0x4e14('0x22');this[_0x4e14('0x23')]=_0x34fcd7['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x34fcd7[_0x4e14('0x24')]||0x258;this[_0x4e14('0x25')]=_0x34fcd7[_0x4e14('0x25')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x34fcd7['dialOriginateCallerIdNumber']||_0x4e14('0x26');this[_0x4e14('0x27')]=_0x34fcd7[_0x4e14('0x27')]||0x1e;this[_0x4e14('0x28')]=_0x34fcd7[_0x4e14('0x28')]||_0x4e14('0x29');this[_0x4e14('0x2a')]=_0x34fcd7['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x34fcd7['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x34fcd7['dialCongestionMaxRetry']||0x3;this[_0x4e14('0x2b')]=_0x34fcd7[_0x4e14('0x2b')]||0x96;this[_0x4e14('0x2c')]=_0x34fcd7[_0x4e14('0x2c')]||0x3;this['dialBusyRetryFrequency']=_0x34fcd7['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x34fcd7['dialNoAnswerMaxRetry']||0x3;this[_0x4e14('0x2d')]=_0x34fcd7[_0x4e14('0x2d')]||0x96;this[_0x4e14('0x2e')]=_0x34fcd7[_0x4e14('0x2e')]||0x4;this[_0x4e14('0x2f')]=_0x34fcd7['Trunk']?_0x34fcd7[_0x4e14('0x2f')]:undefined;this['TrunkBackup']=_0x34fcd7[_0x4e14('0x30')]?_0x34fcd7[_0x4e14('0x30')]:undefined;this['dialPrefix']=_0x34fcd7[_0x4e14('0x31')]||undefined;this[_0x4e14('0x32')]=_0x34fcd7[_0x4e14('0x32')]?_0x34fcd7[_0x4e14('0x32')]:undefined;this[_0x4e14('0x33')]=_0x34fcd7[_0x4e14('0x33')]||_0x4e14('0x34');this[_0x4e14('0x35')]=_0x34fcd7[_0x4e14('0x35')]||undefined;this['dialCutDigit']=_0x34fcd7[_0x4e14('0x36')]||undefined;this[_0x4e14('0x37')]=strategy[_0x34fcd7[_0x4e14('0x37')]]||_0x4e14('0x7');this[_0x4e14('0x38')]=!![];this[_0x4e14('0x39')]=_0x34fcd7[_0x4e14('0x39')]||![];this[_0x4e14('0x3a')]=_0x34fcd7['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x34fcd7[_0x4e14('0x3b')];this[_0x4e14('0x3c')]=_0x34fcd7[_0x4e14('0x3c')];this['dialAMDTotalAnalysisTime']=_0x34fcd7[_0x4e14('0x3d')];this['dialAMDMinWordLength']=_0x34fcd7['dialAMDMinWordLength'];this[_0x4e14('0x3e')]=_0x34fcd7[_0x4e14('0x3e')];this[_0x4e14('0x3f')]=_0x34fcd7[_0x4e14('0x3f')];this[_0x4e14('0x40')]=_0x34fcd7[_0x4e14('0x40')];this[_0x4e14('0x41')]=_0x34fcd7[_0x4e14('0x41')];this[_0x4e14('0x42')]=0x0;this[_0x4e14('0x43')]=0x0;this[_0x4e14('0x44')]=_0x34fcd7[_0x4e14('0x44')];this[_0x4e14('0x45')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x4e14('0x46')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x4e14('0x47')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x4e14('0x48')]=0x0;this[_0x4e14('0x49')]=0x0;this[_0x4e14('0x4a')]=0x0;this[_0x4e14('0x4b')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0x4e14('0x4c')]=undefined;this[_0x4e14('0x4d')]=undefined;this[_0x4e14('0x4e')]=undefined;this[_0x4e14('0x4f')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x4e14('0x50')]=0x0;this[_0x4e14('0x51')]=0x0;this[_0x4e14('0x52')]=0x0;this[_0x4e14('0x53')]=0x0;this[_0x4e14('0x54')]=_0x34fcd7['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x4e14('0x55')]=_0x34fcd7['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x4e14('0x56')]=0x0;this[_0x4e14('0x57')]=0x0;this[_0x4e14('0x58')]=0x1;this['erlangCalls']=0x0;this[_0x4e14('0x59')]=0x0;this[_0x4e14('0x5a')]=0x0;this[_0x4e14('0x5b')]=0x0;this[_0x4e14('0x5c')]=_0x34fcd7[_0x4e14('0x5c')]||0x1e;this[_0x4e14('0x5d')]=_0x34fcd7[_0x4e14('0x5d')]||![];this[_0x4e14('0x5e')]=_0x34fcd7[_0x4e14('0x5e')]||undefined;this[_0x4e14('0x5f')]=_0x34fcd7[_0x4e14('0x5f')]||![];this[_0x4e14('0x60')]=_0x34fcd7[_0x4e14('0x60')]||![];this[_0x4e14('0x9')]=monitorFormat[_0x34fcd7['monitor_format']]?monitorFormat[_0x34fcd7[_0x4e14('0x9')]]:undefined;this[_0x4e14('0x61')]=_0x34fcd7[_0x4e14('0x61')]||![];this[_0x4e14('0x62')]=_0x34fcd7['mandatoryDispositionPause']?_0x34fcd7[_0x4e14('0x62')]:undefined;}module[_0x4e14('0x63')]=VoiceQueue; \ No newline at end of file +var _0xaaaa=['dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','wav','wav49','roundrobin','name','monitor_format','type','inbound','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','Trunk','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor'];(function(_0x15a824,_0x1ce5c4){var _0x506b4b=function(_0x278730){while(--_0x278730){_0x15a824['push'](_0x15a824['shift']());}};_0x506b4b(++_0x1ce5c4);}(_0xaaaa,0x143));var _0xaaaa=function(_0x4056e5,_0x248324){_0x4056e5=_0x4056e5-0x0;var _0x59cc94=_0xaaaa[_0x4056e5];return _0x59cc94;};'use strict';var statusDesc=[_0xaaaa('0x0'),_0xaaaa('0x1'),_0xaaaa('0x2'),_0xaaaa('0x3'),_0xaaaa('0x4'),_0xaaaa('0x5'),'ringing','ringinuse','onhold'];var monitorFormat={'wav':_0xaaaa('0x6'),'wav49':_0xaaaa('0x7'),'gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':_0xaaaa('0x8')};function VoiceQueue(_0x4dc9a0){this['id']=_0x4dc9a0['id']||0x0;this[_0xaaaa('0x9')]=_0x4dc9a0[_0xaaaa('0x9')]||'';this[_0xaaaa('0xa')]=_0x4dc9a0[_0xaaaa('0xa')]||'';this[_0xaaaa('0xb')]=_0x4dc9a0[_0xaaaa('0xb')]||_0xaaaa('0xc');this['waiting']=0x0;this['talking']=0x0;this[_0xaaaa('0xd')]=0x0;this[_0xaaaa('0xe')]=0x0;this['sumDuration']=0x0;this[_0xaaaa('0xf')]=0x0;this[_0xaaaa('0x10')]=0x0;this[_0xaaaa('0x11')]=0x0;this[_0xaaaa('0x12')]=0x0;this[_0xaaaa('0x13')]=0x0;this[_0xaaaa('0x14')]=0x0;this['acw']=_0x4dc9a0[_0xaaaa('0x15')]||![];this[_0xaaaa('0x16')]=_0x4dc9a0[_0xaaaa('0x16')]||0xa;this[_0xaaaa('0x17')]=_0x4dc9a0[_0xaaaa('0x17')]||'no';this['sendMessageOneNotActive']=!![];this[_0xaaaa('0x18')]='';this[_0xaaaa('0x19')]=0x0;this[_0xaaaa('0x1a')]=0x0;this[_0xaaaa('0x1b')]=_0x4dc9a0[_0xaaaa('0x1b')]||null;this[_0xaaaa('0x1c')]=_0x4dc9a0['dialGlobalInterval']?_0x4dc9a0[_0xaaaa('0x1c')]:null;this['dialActive']=_0x4dc9a0[_0xaaaa('0x1d')];this[_0xaaaa('0x1e')]=_0x4dc9a0[_0xaaaa('0x1e')]||_0xaaaa('0x1f');this[_0xaaaa('0x20')]=_0x4dc9a0[_0xaaaa('0x20')]||0x0;this['dialLimitQueue']=_0x4dc9a0[_0xaaaa('0x21')]||0x0;this[_0xaaaa('0x22')]=_0x4dc9a0[_0xaaaa('0x22')]||0x1;this[_0xaaaa('0x23')]=_0x4dc9a0['dialPredictiveOptimization']||_0xaaaa('0x24');this[_0xaaaa('0x25')]=_0x4dc9a0['dialPredictiveOptimizationPercentage']||0.03;this[_0xaaaa('0x26')]=_0x4dc9a0[_0xaaaa('0x26')]||0x258;this[_0xaaaa('0x27')]=_0x4dc9a0[_0xaaaa('0x27')]||_0xaaaa('0x28');this[_0xaaaa('0x29')]=_0x4dc9a0[_0xaaaa('0x29')]||'anonymous';this[_0xaaaa('0x2a')]=_0x4dc9a0[_0xaaaa('0x2a')]||0x1e;this[_0xaaaa('0x2b')]=_0x4dc9a0[_0xaaaa('0x2b')]||'tTxX';this[_0xaaaa('0x2c')]=_0x4dc9a0['dialQueueTimeout']||0x3;this[_0xaaaa('0x2d')]=_0x4dc9a0['dialQueueProject']||undefined;this[_0xaaaa('0x2e')]=_0x4dc9a0[_0xaaaa('0x2e')]||0x3;this['dialCongestionRetryFrequency']=_0x4dc9a0[_0xaaaa('0x2f')]||0x96;this[_0xaaaa('0x30')]=_0x4dc9a0['dialBusyMaxRetry']||0x3;this[_0xaaaa('0x31')]=_0x4dc9a0[_0xaaaa('0x31')]||0x96;this['dialNoAnswerMaxRetry']=_0x4dc9a0[_0xaaaa('0x32')]||0x3;this['dialNoAnswerRetryFrequency']=_0x4dc9a0['dialNoAnswerRetryFrequency']||0x96;this[_0xaaaa('0x33')]=_0x4dc9a0[_0xaaaa('0x33')]||0x4;this['Trunk']=_0x4dc9a0[_0xaaaa('0x34')]?_0x4dc9a0['Trunk']:undefined;this['TrunkBackup']=_0x4dc9a0['TrunkBackup']?_0x4dc9a0['TrunkBackup']:undefined;this[_0xaaaa('0x35')]=_0x4dc9a0['dialPrefix']||undefined;this[_0xaaaa('0x36')]=_0x4dc9a0[_0xaaaa('0x36')]?_0x4dc9a0[_0xaaaa('0x36')]:undefined;this[_0xaaaa('0x37')]=_0x4dc9a0[_0xaaaa('0x37')]||'DESC';this[_0xaaaa('0x38')]=_0x4dc9a0[_0xaaaa('0x38')]||undefined;this[_0xaaaa('0x39')]=_0x4dc9a0[_0xaaaa('0x39')]||undefined;this[_0xaaaa('0x3a')]=strategy[_0x4dc9a0[_0xaaaa('0x3a')]]||_0xaaaa('0x3b');this[_0xaaaa('0x3c')]=!![];this['dialAMDActive']=_0x4dc9a0[_0xaaaa('0x3d')]||![];this[_0xaaaa('0x3e')]=_0x4dc9a0[_0xaaaa('0x3e')];this['dialAMDGreeting']=_0x4dc9a0[_0xaaaa('0x3f')];this[_0xaaaa('0x40')]=_0x4dc9a0[_0xaaaa('0x40')];this[_0xaaaa('0x41')]=_0x4dc9a0['dialAMDTotalAnalysisTime'];this[_0xaaaa('0x42')]=_0x4dc9a0[_0xaaaa('0x42')];this['dialAMDBetweenWordsSilence']=_0x4dc9a0[_0xaaaa('0x43')];this[_0xaaaa('0x44')]=_0x4dc9a0[_0xaaaa('0x44')];this[_0xaaaa('0x45')]=_0x4dc9a0['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x4dc9a0[_0xaaaa('0x46')];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this[_0xaaaa('0x47')]=_0x4dc9a0[_0xaaaa('0x47')];this[_0xaaaa('0x48')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xaaaa('0x49')]=0x0;this[_0xaaaa('0x4a')]=0x0;this[_0xaaaa('0x4b')]=0x0;this[_0xaaaa('0x4c')]=0x0;this[_0xaaaa('0x4d')]=0x0;this[_0xaaaa('0x4e')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xaaaa('0x4f')]=0x0;this[_0xaaaa('0x50')]=0x0;this[_0xaaaa('0x51')]=undefined;this['startPredictive']=undefined;this[_0xaaaa('0x52')]=undefined;this[_0xaaaa('0x53')]=1.05;this[_0xaaaa('0x54')]=0x0;this[_0xaaaa('0x55')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xaaaa('0x56')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xaaaa('0x57')]=0x0;this[_0xaaaa('0x58')]=0x0;this['predictiveIntervalMaxThreshold']=_0x4dc9a0['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xaaaa('0x59')]=_0x4dc9a0[_0xaaaa('0x5a')]||0xa;this[_0xaaaa('0x5b')]=0x0;this[_0xaaaa('0x5c')]=0x0;this[_0xaaaa('0x5d')]=0x1;this[_0xaaaa('0x5e')]=0x0;this['erlangCallToSecond']=0x0;this[_0xaaaa('0x5f')]=0x0;this[_0xaaaa('0x60')]=0x0;this['dialRecallMeTimeout']=_0x4dc9a0[_0xaaaa('0x61')]||0x1e;this[_0xaaaa('0x62')]=_0x4dc9a0[_0xaaaa('0x62')]||![];this[_0xaaaa('0x63')]=_0x4dc9a0['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0x4dc9a0[_0xaaaa('0x64')]||![];this[_0xaaaa('0x65')]=_0x4dc9a0[_0xaaaa('0x65')]||![];this[_0xaaaa('0xa')]=monitorFormat[_0x4dc9a0[_0xaaaa('0xa')]]?monitorFormat[_0x4dc9a0['monitor_format']]:undefined;this[_0xaaaa('0x66')]=_0x4dc9a0[_0xaaaa('0x66')]||![];this[_0xaaaa('0x67')]=_0x4dc9a0[_0xaaaa('0x67')]?_0x4dc9a0[_0xaaaa('0x67')]:undefined;}module[_0xaaaa('0x68')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index f2de54c..772e869 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 _0xbdfd=['accessKey','remoteUri','serverUrl','Configurations','username'];(function(_0xa4928c,_0x16b89c){var _0x27cc29=function(_0x14b819){while(--_0x14b819){_0xa4928c['push'](_0xa4928c['shift']());}};_0x27cc29(++_0x16b89c);}(_0xbdfd,0x135));var _0xdbdf=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbdfd[_0x2641f9];return _0x585741;};'use strict';function VtigerAccount(_0x591ccc){this['id']=_0x591ccc['id']||0x0;this['name']=_0x591ccc['name']||'';this[_0xdbdf('0x0')]=_0x591ccc[_0xdbdf('0x0')]||'';this[_0xdbdf('0x1')]=_0x591ccc[_0xdbdf('0x1')]||'';this['remoteUri']=_0x591ccc[_0xdbdf('0x2')]||'';this[_0xdbdf('0x3')]=_0x591ccc['serverUrl']||'';this[_0xdbdf('0x4')]=_0x591ccc[_0xdbdf('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x9758=['exports','name','username','accessKey','serverUrl','Configurations'];(function(_0x5d1044,_0x18f656){var _0x3cd90e=function(_0x3c40be){while(--_0x3c40be){_0x5d1044['push'](_0x5d1044['shift']());}};_0x3cd90e(++_0x18f656);}(_0x9758,0x1cf));var _0x8975=function(_0x1c1a2e,_0x2ac23f){_0x1c1a2e=_0x1c1a2e-0x0;var _0x4fa57c=_0x9758[_0x1c1a2e];return _0x4fa57c;};'use strict';function VtigerAccount(_0x564b16){this['id']=_0x564b16['id']||0x0;this[_0x8975('0x0')]=_0x564b16['name']||'';this[_0x8975('0x1')]=_0x564b16['username']||'';this[_0x8975('0x2')]=_0x564b16[_0x8975('0x2')]||'';this['remoteUri']=_0x564b16['remoteUri']||'';this[_0x8975('0x3')]=_0x564b16[_0x8975('0x3')]||'';this[_0x8975('0x4')]=_0x564b16[_0x8975('0x4')]||{};}module[_0x8975('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 320d3c9..8b501ae 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 _0x7a54=['serverUrl','Configurations','name','username','password','token','remoteUri','authType','type','integrationTab'];(function(_0x513545,_0x158f2e){var _0x18b7c5=function(_0x58514c){while(--_0x58514c){_0x513545['push'](_0x513545['shift']());}};_0x18b7c5(++_0x158f2e);}(_0x7a54,0x106));var _0x47a5=function(_0x64b6d7,_0x3ad15e){_0x64b6d7=_0x64b6d7-0x0;var _0x504a3f=_0x7a54[_0x64b6d7];return _0x504a3f;};'use strict';function ZendeskAccount(_0xe384a5){this['id']=_0xe384a5['id']||0x0;this[_0x47a5('0x0')]=_0xe384a5[_0x47a5('0x0')]||'';this['username']=_0xe384a5[_0x47a5('0x1')]||'';this[_0x47a5('0x2')]=_0xe384a5['password']||'';this[_0x47a5('0x3')]=_0xe384a5[_0x47a5('0x3')]||'';this[_0x47a5('0x4')]=_0xe384a5[_0x47a5('0x4')]||'';this[_0x47a5('0x5')]=_0xe384a5['authType']||'';this[_0x47a5('0x6')]=_0xe384a5['type']||_0x47a5('0x7');this[_0x47a5('0x8')]=_0xe384a5['serverUrl']||'';this[_0x47a5('0x9')]=_0xe384a5['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x5f66=['remoteUri','authType','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x212e19,_0xd8c318){var _0x2644fb=function(_0x38968f){while(--_0x38968f){_0x212e19['push'](_0x212e19['shift']());}};_0x2644fb(++_0xd8c318);}(_0x5f66,0x1a0));var _0x65f6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5f66[_0x138adb];return _0x1b27f2;};'use strict';function ZendeskAccount(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||'';this[_0x65f6('0x2')]=_0x253044[_0x65f6('0x2')]||'';this[_0x65f6('0x3')]=_0x253044['token']||'';this[_0x65f6('0x4')]=_0x253044['remoteUri']||'';this[_0x65f6('0x5')]=_0x253044[_0x65f6('0x5')]||'';this['type']=_0x253044['type']||_0x65f6('0x6');this[_0x65f6('0x7')]=_0x253044[_0x65f6('0x7')]||'';this[_0x65f6('0x8')]=_0x253044[_0x65f6('0x8')]||{};}module[_0x65f6('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 9fc4416..1a55ce6 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 _0xa664=['name','description','host','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x4c253b,_0x2ef014){var _0x582939=function(_0x4dae0d){while(--_0x4dae0d){_0x4c253b['push'](_0x4c253b['shift']());}};_0x582939(++_0x2ef014);}(_0xa664,0x132));var _0x4a66=function(_0x12660e,_0x243ba4){_0x12660e=_0x12660e-0x0;var _0x475b46=_0xa664[_0x12660e];return _0x475b46;};'use strict';function ZohoAccount(_0xa8e91a){this['id']=_0xa8e91a['id']||0x0;this[_0x4a66('0x0')]=_0xa8e91a[_0x4a66('0x0')]||'';this[_0x4a66('0x1')]=_0xa8e91a[_0x4a66('0x1')]||'';this['host']=_0xa8e91a[_0x4a66('0x2')]||'';this['zone']=_0xa8e91a['zone']||'';this[_0x4a66('0x3')]=_0xa8e91a[_0x4a66('0x3')]||'';this[_0x4a66('0x4')]=_0xa8e91a[_0x4a66('0x4')]||'';this[_0x4a66('0x5')]=_0xa8e91a[_0x4a66('0x5')]||'';this[_0x4a66('0x6')]=_0xa8e91a['code']||'';this[_0x4a66('0x7')]=_0xa8e91a[_0x4a66('0x7')]||'';this[_0x4a66('0x8')]=_0xa8e91a[_0x4a66('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x1df7=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x2d0310,_0x1e1587){var _0x38a7cf=function(_0x54fdbc){while(--_0x54fdbc){_0x2d0310['push'](_0x2d0310['shift']());}};_0x38a7cf(++_0x1e1587);}(_0x1df7,0x6e));var _0x71df=function(_0x35b26e,_0x1698f5){_0x35b26e=_0x35b26e-0x0;var _0x469eaf=_0x1df7[_0x35b26e];return _0x469eaf;};'use strict';function ZohoAccount(_0x3123aa){this['id']=_0x3123aa['id']||0x0;this[_0x71df('0x0')]=_0x3123aa[_0x71df('0x0')]||'';this[_0x71df('0x1')]=_0x3123aa[_0x71df('0x1')]||'';this[_0x71df('0x2')]=_0x3123aa[_0x71df('0x2')]||'';this[_0x71df('0x3')]=_0x3123aa[_0x71df('0x3')]||'';this[_0x71df('0x4')]=_0x3123aa[_0x71df('0x4')]||'';this[_0x71df('0x5')]=_0x3123aa[_0x71df('0x5')]||'';this['serverUrl']=_0x3123aa[_0x71df('0x6')]||'';this['code']=_0x3123aa[_0x71df('0x7')]||'';this[_0x71df('0x8')]=_0x3123aa['refreshToken']||'';this[_0x71df('0x9')]=_0x3123aa['Configurations']||{};}module[_0x71df('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 5a2663a..502d0bf 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 _0x1622=['type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','calleridname','exports','util','lodash','isNil','string','uniqueid','idContact','name'];(function(_0xa7c249,_0x599b5e){var _0x1a9b26=function(_0x2b8797){while(--_0x2b8797){_0xa7c249['push'](_0xa7c249['shift']());}};_0x1a9b26(++_0x599b5e);}(_0x1622,0x118));var _0x2162=function(_0x1d6dfb,_0x2d08e5){_0x1d6dfb=_0x1d6dfb-0x0;var _0x1a8fbb=_0x1622[_0x1d6dfb];return _0x1a8fbb;};'use strict';var util=require(_0x2162('0x0'));var _=require(_0x2162('0x1'));var moment=require('moment');function checkNameSurname(_0x3e92dc,_0x51ed94,_0x1dece8){var _0x21f3f0='';if(!_['isNil'](_0x51ed94)&&'string'===typeof _0x51ed94){_0x21f3f0+=_0x51ed94;}if(!_[_0x2162('0x2')](_0x1dece8)&&_0x2162('0x3')===typeof _0x1dece8){_0x21f3f0+='\x20'+_0x1dece8;}if(_0x21f3f0!==''){return _0x21f3f0;}return _0x3e92dc;}function Action(_0x357013,_0x6493da,_0x5c43d4,_0x1a524f,_0x53e067){this[_0x2162('0x4')]=_0x5c43d4||undefined;this[_0x2162('0x5')]=_0x357013['id'];this['queue']=_0x6493da[_0x2162('0x6')];this[_0x2162('0x7')]=_0x6493da[_0x2162('0x7')];this[_0x2162('0x8')]=_0x2162('0x9');this[_0x2162('0xa')]=![];this[_0x2162('0xb')]=_[_0x2162('0x2')](_0x357013[_0x2162('0xc')])?undefined:_0x357013[_0x2162('0xc')][_0x2162('0x6')];this[_0x2162('0xd')]=this[_0x2162('0xb')]?util[_0x2162('0xe')](_0x2162('0xf'),this['membername']):_0x1a524f||undefined;this['calleridname']=checkNameSurname(_0x357013[_0x2162('0x10')][_0x2162('0x11')],_0x357013[_0x2162('0x10')][_0x2162('0x12')],_0x357013[_0x2162('0x10')][_0x2162('0x13')]);this['active']=_0x357013[_0x2162('0x14')]||![];this[_0x2162('0x15')]=_0x357013[_0x2162('0x10')][_0x2162('0x11')];this[_0x2162('0x16')]=_0x357013['scheduledat'];this[_0x2162('0x17')]=_0x357013[_0x2162('0x17')]||0x0;this[_0x2162('0x18')]=_0x357013['countcongestionretry']||0x0;this[_0x2162('0x19')]=_0x357013[_0x2162('0x19')]||0x0;this[_0x2162('0x1a')]=(_0x357013[_0x2162('0x17')]||0x0)+(_0x357013[_0x2162('0x18')]||0x0)+(_0x357013[_0x2162('0x19')]||0x0);this[_0x2162('0x1b')]=_0x357013['callback'];this[_0x2162('0x1c')]=_0x357013['callbackuniqueid'];this[_0x2162('0x1d')]=_0x357013[_0x2162('0x1d')];this[_0x2162('0x1e')]=_0x357013['recallme'];this[_0x2162('0x1f')]=_0x357013[_0x2162('0x1f')];this[_0x2162('0x20')]=_0x357013[_0x2162('0x20')];this[_0x2162('0x21')]=_[_0x2162('0x2')](_0x357013['Agent'])?_0x357013[_0x2162('0x21')]:_0x357013[_0x2162('0xc')]['id'];this[_0x2162('0x22')]=_0x357013[_0x2162('0x22')];this[_0x2162('0x23')]='';this[_0x2162('0x24')]='';}Action[_0x2162('0x25')]['getCaller']=function(){return util[_0x2162('0xe')](_0x2162('0x26'),this[_0x2162('0x27')],this['number']);};module[_0x2162('0x28')]=Action; \ No newline at end of file +var _0x17b9=['lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','Agent','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','channelAgent','membername','format','SIP/%s','calleridname','Contact','phone','firstName'];(function(_0x2e3dfc,_0x454d6c){var _0x4b1245=function(_0x5e9faa){while(--_0x5e9faa){_0x2e3dfc['push'](_0x2e3dfc['shift']());}};_0x4b1245(++_0x454d6c);}(_0x17b9,0xc4));var _0x917b=function(_0x599ef2,_0x52b42d){_0x599ef2=_0x599ef2-0x0;var _0x42acc4=_0x17b9[_0x599ef2];return _0x42acc4;};'use strict';var util=require(_0x917b('0x0'));var _=require(_0x917b('0x1'));var moment=require('moment');function checkNameSurname(_0x1d0ed5,_0x9a5d22,_0x7a0cc9){var _0x4a66eb='';if(!_[_0x917b('0x2')](_0x9a5d22)&&_0x917b('0x3')===typeof _0x9a5d22){_0x4a66eb+=_0x9a5d22;}if(!_[_0x917b('0x2')](_0x7a0cc9)&&_0x917b('0x3')===typeof _0x7a0cc9){_0x4a66eb+='\x20'+_0x7a0cc9;}if(_0x4a66eb!==''){return _0x4a66eb;}return _0x1d0ed5;}function Action(_0x9da9c1,_0x3add31,_0x37ed49,_0x4574a3,_0x51cdf0){this[_0x917b('0x4')]=_0x37ed49||undefined;this[_0x917b('0x5')]=_0x9da9c1['id'];this[_0x917b('0x6')]=_0x3add31[_0x917b('0x7')];this[_0x917b('0x8')]=_0x3add31['type'];this[_0x917b('0x9')]=_0x917b('0x6');this[_0x917b('0xa')]=![];this['membername']=_['isNil'](_0x9da9c1['Agent'])?undefined:_0x9da9c1['Agent'][_0x917b('0x7')];this[_0x917b('0xb')]=this[_0x917b('0xc')]?util[_0x917b('0xd')](_0x917b('0xe'),this['membername']):_0x4574a3||undefined;this[_0x917b('0xf')]=checkNameSurname(_0x9da9c1[_0x917b('0x10')][_0x917b('0x11')],_0x9da9c1[_0x917b('0x10')][_0x917b('0x12')],_0x9da9c1[_0x917b('0x10')][_0x917b('0x13')]);this['active']=_0x9da9c1[_0x917b('0x14')]||![];this[_0x917b('0x15')]=_0x9da9c1[_0x917b('0x10')][_0x917b('0x11')];this[_0x917b('0x16')]=_0x9da9c1[_0x917b('0x16')];this[_0x917b('0x17')]=_0x9da9c1['countbusyretry']||0x0;this[_0x917b('0x18')]=_0x9da9c1[_0x917b('0x18')]||0x0;this[_0x917b('0x19')]=_0x9da9c1[_0x917b('0x19')]||0x0;this[_0x917b('0x1a')]=(_0x9da9c1['countbusyretry']||0x0)+(_0x9da9c1[_0x917b('0x18')]||0x0)+(_0x9da9c1[_0x917b('0x19')]||0x0);this[_0x917b('0x1b')]=_0x9da9c1[_0x917b('0x1b')];this[_0x917b('0x1c')]=_0x9da9c1[_0x917b('0x1c')];this['callbackat']=_0x9da9c1[_0x917b('0x1d')];this[_0x917b('0x1e')]=_0x9da9c1[_0x917b('0x1e')];this['ContactId']=_0x9da9c1[_0x917b('0x1f')];this[_0x917b('0x20')]=_0x9da9c1[_0x917b('0x20')];this[_0x917b('0x21')]=_['isNil'](_0x9da9c1[_0x917b('0x22')])?_0x9da9c1['UserId']:_0x9da9c1['Agent']['id'];this['VoiceQueueId']=_0x9da9c1[_0x917b('0x23')];this[_0x917b('0x24')]='';this[_0x917b('0x25')]='';}Action[_0x917b('0x26')][_0x917b('0x27')]=function(){return util['format'](_0x917b('0x28'),this[_0x917b('0xf')],this[_0x917b('0x29')]);};module[_0x917b('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index c82188f..561b66a 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 _0xde77=['[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','outboundCongestionCallsDay','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[syncHangupRequest][logAgentReject]','unlockContact','disableContact','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','originated:\x20','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','pick','unlock','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','Agent','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','substring','trim','dialCutDigit','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','clone','isFailure','response','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','callProgressDetectingCustomer','statedesc','channelstate','transfer','destuniqueid','addVariable','variables','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','bluebird','uuid','moment','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','redis','defaults','localhost','socket.io-emitter','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','syncVarSet','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','answered','available','pTalking','sumBillable','sumDuration','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','stringify','md5','voice:queue:%s','voice_queue:save','format','voice_queue_channel:remove','sendMessageOneNotActive','originated','paused','NOT_ACTIVE','logger','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','prototype','syncCampaigns','booked','clearZombieChannels','setMessage','recallMe','clearZombieChannel','enqueue','isNil','info','[clearZombieChannels][talking]','queue','pTalking:\x20','dialAnswer','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','size','hasOwnProperty','getContactRecallMe','agentReadyId','then','length','scheduledat','dialRecallMeTimeout','run','logger2','catch','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','ACTIVE','outboundNoSuchCallsDay','countglobal','totalGlobal','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','buildObj','outboundAnswerCallsDay','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','Global','dialBusyMaxRetry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','activeContact','countnoanswerretry','NoAnswer'];(function(_0x5cc6f9,_0x47194d){var _0x814bef=function(_0x4f318e){while(--_0x4f318e){_0x5cc6f9['push'](_0x5cc6f9['shift']());}};_0x814bef(++_0x47194d);}(_0xde77,0x76));var _0x7de7=function(_0x31ae19,_0x20829e){_0x31ae19=_0x31ae19-0x0;var _0x55ca7e=_0xde77[_0x31ae19];return _0x55ca7e;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x7de7('0x0'));var uuid=require(_0x7de7('0x1'));var moment=require(_0x7de7('0x2'));var md5=require('md5');var Redis=require(_0x7de7('0x3'));var config=require(_0x7de7('0x4'));var logger=require(_0x7de7('0x5'))(_0x7de7('0x6'));var loggerAction=require(_0x7de7('0x5'))(_0x7de7('0x7'));var ami=require(_0x7de7('0x8'));var rpcDb=require(_0x7de7('0x9'));var Action=require(_0x7de7('0xa'));var ut=require('./util/util');config[_0x7de7('0xb')]=_[_0x7de7('0xc')](config[_0x7de7('0xb')],{'host':_0x7de7('0xd'),'port':0x18eb});var io=require(_0x7de7('0xe'))(new Redis(config[_0x7de7('0xb')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x46cbbd){this[_0x7de7('0xf')]=this['tail']?this[_0x7de7('0xf')][_0x7de7('0x10')](_0x46cbbd):_0x46cbbd();};function Preview(_0x770532){this[_0x7de7('0x11')]=new Sequence();this[_0x7de7('0x12')]=_0x770532[_0x7de7('0x13')];this['trunks']=_0x770532[_0x7de7('0x14')];this[_0x7de7('0x15')]={};this['agents']=_0x770532[_0x7de7('0x16')];this[_0x7de7('0x17')]=0x0;ami['on']('originateresponse',this[_0x7de7('0x18')]['bind'](this));ami['on'](_0x7de7('0x19'),this[_0x7de7('0x1a')][_0x7de7('0x1b')](this));ami['on'](_0x7de7('0x1c'),this[_0x7de7('0x1d')][_0x7de7('0x1b')](this));ami['on'](_0x7de7('0x1e'),this[_0x7de7('0x1f')]['bind'](this));ami['on'](_0x7de7('0x20'),this[_0x7de7('0x21')]['bind'](this));ami['on']('varset',this[_0x7de7('0x22')][_0x7de7('0x1b')](this));ami['on']('attendedtransfer',this[_0x7de7('0x23')][_0x7de7('0x1b')](this));ami['on']('blindtransfer',this[_0x7de7('0x24')][_0x7de7('0x1b')](this));this[_0x7de7('0x25')](this[_0x7de7('0x12')]);}function emit(_0x45b659,_0x348995,_0x1fbfe8){io['to'](_0x45b659)[_0x7de7('0x26')](_0x348995,_0x1fbfe8);}function emitCampaignPreview(_0x385a48){if(_0x385a48[_0x7de7('0x27')]===_0x7de7('0x28')){var _0x669863={'id':_0x385a48['id'],'name':_0x385a48[_0x7de7('0x29')],'strategy':_0x385a48['strategy'],'answered':_0x385a48[_0x7de7('0x2a')],'available':_0x385a48[_0x7de7('0x2b')],'loggedIn':_0x385a48['loggedIn'],'pTalking':_0x385a48[_0x7de7('0x2c')],'sumBillable':_0x385a48[_0x7de7('0x2d')],'sumDuration':_0x385a48[_0x7de7('0x2e')],'sumHoldTime':_0x385a48['sumHoldTime']||0x0,'talking':_0x385a48[_0x7de7('0x2f')],'total':_0x385a48[_0x7de7('0x30')],'type':_0x385a48[_0x7de7('0x27')],'unmanaged':_0x385a48[_0x7de7('0x31')],'abandoned':_0x385a48[_0x7de7('0x32')],'waiting':_0x385a48[_0x7de7('0x33')],'loggedInDb':_0x385a48[_0x7de7('0x34')],'dialActive':_0x385a48[_0x7de7('0x35')],'dialMethod':_0x385a48[_0x7de7('0x36')],'dialOriginateCallerIdName':_0x385a48[_0x7de7('0x37')],'dialOriginateCallerIdNumber':_0x385a48[_0x7de7('0x38')],'dialOriginateTimeout':_0x385a48[_0x7de7('0x39')],'dialPrefix':_0x385a48[_0x7de7('0x3a')],'outboundAnswerAgiCallsDay':_0x385a48[_0x7de7('0x3b')],'outboundAnswerCallsDay':_0x385a48['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x385a48[_0x7de7('0x3c')],'outboundBusyCallsDay':_0x385a48[_0x7de7('0x3d')],'outboundCongestionCallsDay':_0x385a48['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x385a48[_0x7de7('0x3e')],'outboundDropCallsDayCallersExit':_0x385a48[_0x7de7('0x3f')],'outboundDropCallsDayTimeout':_0x385a48[_0x7de7('0x40')],'outboundNoAnswerCallsDay':_0x385a48[_0x7de7('0x41')],'outboundNoSuchCallsDay':_0x385a48['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x385a48[_0x7de7('0x42')],'outboundReCallsDay':_0x385a48[_0x7de7('0x43')],'outboundRejectCallsDay':_0x385a48[_0x7de7('0x44')],'outboundUnknownCallsDay':_0x385a48[_0x7de7('0x45')],'predictiveIntervalAnsweredCalls':_0x385a48[_0x7de7('0x46')],'predictiveIntervalAvgHoldtime':_0x385a48['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x385a48[_0x7de7('0x47')],'predictiveIntervalDroppedCallsCallersExit':_0x385a48['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x385a48[_0x7de7('0x48')],'predictiveIntervalErlangCalls':_0x385a48[_0x7de7('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x385a48[_0x7de7('0x4a')],'predictiveIntervalHitRate':_0x385a48['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x385a48[_0x7de7('0x4b')],'predictiveIntervalPauses':_0x385a48[_0x7de7('0x4c')],'predictiveIntervalAvailable':_0x385a48['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x385a48[_0x7de7('0x4d')],'message':_0x385a48[_0x7de7('0x4e')],'originated':_0x385a48['originated'],'erlangCalls':_0x385a48[_0x7de7('0x4f')],'erlangCallToSecond':_0x385a48[_0x7de7('0x50')],'erlangAbandonmentRate':_0x385a48[_0x7de7('0x51')],'erlangBusyFactor':_0x385a48[_0x7de7('0x52')],'startPredictive':_0x385a48[_0x7de7('0x53')],'startProgressive':_0x385a48['startProgressive']};if(_0x385a48[_0x7de7('0x54')]){_0x669863[_0x7de7('0x54')]={'id':_0x385a48[_0x7de7('0x54')]['id'],'name':_0x385a48[_0x7de7('0x54')]['name'],'active':_0x385a48[_0x7de7('0x54')][_0x7de7('0x55')],'callerid':_0x385a48['Trunk'][_0x7de7('0x56')]};}if(_0x385a48['Interval']){_0x669863[_0x7de7('0x57')]={'id':_0x385a48[_0x7de7('0x57')]['id'],'name':_0x385a48[_0x7de7('0x57')][_0x7de7('0x29')]};}var _0x523d52=md5(JSON[_0x7de7('0x58')](_0x669863));if(_0x385a48[_0x7de7('0x59')]!==_0x523d52){_0x385a48[_0x7de7('0x59')]=_0x523d52;emit(util['format'](_0x7de7('0x5a'),_0x669863['name']),_0x7de7('0x5b'),_0x669863);}}}function emitVoiceQueueChannelRemove(_0x678ee3){emit(util[_0x7de7('0x5c')](_0x7de7('0x5a'),_0x678ee3[_0x7de7('0x29')]),_0x7de7('0x5d'),_0x678ee3);}function notSendMessagesQueue(_0x3e443d){if(_0x3e443d[_0x7de7('0x5e')]){if(_0x3e443d[_0x7de7('0x5f')]===0x0&&_0x3e443d[_0x7de7('0x2c')]===0x0){_0x3e443d['sendMessageOneNotActive']=![];_0x3e443d[_0x7de7('0x2b')]=0x0;_0x3e443d[_0x7de7('0x60')]=0x0;_0x3e443d[_0x7de7('0x4e')]=_0x7de7('0x61');ut[_0x7de7('0x62')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x3e443d[_0x7de7('0x29')]+'\x20is\x20not\x20active');}else{_0x3e443d[_0x7de7('0x4e')]=_0x7de7('0x63');ut['logger'](_0x7de7('0x64'),_0x3e443d[_0x7de7('0x29')]+_0x7de7('0x65'));}emitCampaignPreview(_0x3e443d);}}Preview[_0x7de7('0x66')][_0x7de7('0x25')]=function(){var _0x4c5dc2=this;setInterval(function(){_0x4c5dc2['syncCampaigns']();},0x7cf);};Preview[_0x7de7('0x66')][_0x7de7('0x67')]=function(){var _0x10fe3d=this['campaignsPreview'];this[_0x7de7('0x17')]+=0x1;for(var _0x47e5b6 in _0x10fe3d){if(_0x10fe3d['hasOwnProperty'](_0x47e5b6)&&(_0x10fe3d[_0x47e5b6]['dialMethod']==='preview'||_0x10fe3d[_0x47e5b6]['dialMethod']===_0x7de7('0x68'))&&_0x10fe3d[_0x47e5b6][_0x7de7('0x27')]===_0x7de7('0x28')){if(this[_0x7de7('0x17')]>0x7){this[_0x7de7('0x17')]=0x0;this[_0x7de7('0x69')]();}}if(_0x10fe3d['hasOwnProperty'](_0x47e5b6)&&_0x10fe3d[_0x47e5b6][_0x7de7('0x36')]===_0x7de7('0x6')&&_0x10fe3d[_0x47e5b6][_0x7de7('0x27')]==='outbound'){if(_0x10fe3d[_0x47e5b6]['dialActive']){this[_0x7de7('0x6a')](_0x10fe3d[_0x47e5b6]);this[_0x7de7('0x6b')](_0x10fe3d[_0x47e5b6]);}else{notSendMessagesQueue(_0x10fe3d[_0x47e5b6]);}}}};Preview[_0x7de7('0x66')][_0x7de7('0x6c')]=function(_0x43a093){var _0x3aec5b=this;this[_0x7de7('0x11')][_0x7de7('0x6d')](function(){if(!_[_0x7de7('0x6e')](_0x3aec5b[_0x7de7('0x15')][_0x43a093])){loggerAction[_0x7de7('0x6f')](_0x7de7('0x70'),_0x43a093,'Queue',_0x3aec5b['actions'][_0x43a093][_0x7de7('0x71')],'originated:\x20',JSON[_0x7de7('0x58')](_0x3aec5b[_0x7de7('0x12')][_0x3aec5b[_0x7de7('0x15')][_0x43a093][_0x7de7('0x71')]][_0x7de7('0x5f')]),_0x7de7('0x72'),JSON[_0x7de7('0x58')](_0x3aec5b[_0x7de7('0x12')][_0x3aec5b[_0x7de7('0x15')][_0x43a093][_0x7de7('0x71')]][_0x7de7('0x2c')]),JSON[_0x7de7('0x58')](_0x3aec5b[_0x7de7('0x15')][_0x43a093][_0x7de7('0x73')]),JSON[_0x7de7('0x58')](_['pick'](_0x3aec5b['actions'][_0x43a093],[_0x7de7('0x74'),_0x7de7('0x75'),_0x7de7('0x76'),_0x7de7('0x77')])));return ami[_0x7de7('0x78')]({'action':_0x7de7('0x79'),'channel':_0x3aec5b[_0x7de7('0x15')][_0x43a093][_0x7de7('0x7a')]})['catch'](function(_0x279c82){if(_0x279c82[_0x7de7('0x4e')]===_0x7de7('0x7b')){setTimeout(function(){if(_0x3aec5b[_0x7de7('0x15')][_0x43a093]){ut[_0x7de7('0x7c')](_0x3aec5b[_0x7de7('0x12')][_0x3aec5b[_0x7de7('0x15')][_0x43a093][_0x7de7('0x71')]],_0x7de7('0x7d'));if(_0x3aec5b['actions'][_0x43a093][_0x7de7('0x73')]===!![]){ut[_0x7de7('0x7e')](_0x3aec5b['campaignsPreview'][_0x3aec5b['actions'][_0x43a093][_0x7de7('0x71')]],_0x7de7('0x7d'));ut[_0x7de7('0x7f')](_0x7de7('0x80')+_0x43a093,_0x3aec5b[_0x7de7('0x15')][_0x43a093]['queue']);}ut[_0x7de7('0x7f')]('[Dialer][checkChannel][Preview]'+_0x43a093,_0x3aec5b['actions'][_0x43a093]['queue']);delete _0x3aec5b[_0x7de7('0x15')][_0x43a093];}},0x2328);}});}});};Preview[_0x7de7('0x66')][_0x7de7('0x69')]=function(){var _0x23e88b=this;loggerAction[_0x7de7('0x6f')](_0x7de7('0x81'),_[_0x7de7('0x82')](this['actions']));for(var _0x1e602f in this['actions']){if(_0x23e88b[_0x7de7('0x15')][_0x7de7('0x83')](_0x1e602f)){_0x23e88b['clearZombieChannel'](_0x1e602f);}}};Preview['prototype'][_0x7de7('0x6b')]=function(_0x461cda){var _0x399d32=this;rpcDb[_0x7de7('0x84')](_0x461cda['id'],ut[_0x7de7('0x85')](this[_0x7de7('0x16')]))[_0x7de7('0x86')](function(_0x3dd321){if(!_['isNil'](_0x3dd321)){for(var _0x1ec972=0x0;_0x1ec972<_0x3dd321[_0x7de7('0x87')];_0x1ec972+=0x1){if(ut['getDiff'](_0x3dd321[_0x1ec972][_0x7de7('0x88')])<_0x461cda[_0x7de7('0x89')]*0x3c){_0x399d32[_0x7de7('0x8a')](_0x3dd321[_0x1ec972]['id'])[_0x7de7('0x86')](ut[_0x7de7('0x8b')]('[RecallMe]'))[_0x7de7('0x8c')](ut[_0x7de7('0x8b')](_0x7de7('0x8d')));}else{var _0x4afb49=new Action(_0x3dd321[_0x1ec972],_0x461cda);_0x4afb49[_0x7de7('0x8e')]=moment()[_0x7de7('0x5c')](_0x7de7('0x8f'));_0x461cda[_0x7de7('0x43')]+=0x1;ut[_0x7de7('0x90')](_0x4afb49,0x17,_0x7de7('0x91'));if(_0x461cda[_0x7de7('0x92')]){rpcDb[_0x7de7('0x93')](ut[_0x7de7('0x94')](_0x3dd321[_0x1ec972]));rpcDb[_0x7de7('0x95')](_0x4afb49,_0x7de7('0x96'));}else{ut[_0x7de7('0x90')](_0x4afb49,0x16,_0x7de7('0x97'));rpcDb['createCustomerHistory'](_0x4afb49,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x4afb49,_0x7de7('0x98'));}}}}})[_0x7de7('0x8c')](ut['logger2']('[getContactRecallMe]'));};Preview['prototype'][_0x7de7('0x6a')]=function(_0x55321b){_0x55321b[_0x7de7('0x5e')]=!![];if(ut[_0x7de7('0x99')](_0x55321b[_0x7de7('0x9a')])){_0x55321b[_0x7de7('0x4e')]=_0x7de7('0x9b');}else if(!ut[_0x7de7('0x9c')](_0x55321b['dialActive'])){_0x55321b[_0x7de7('0x4e')]='NOT_ACTIVE';}else if(!this[_0x7de7('0x9d')](_0x55321b[_0x7de7('0x54')])){if(!this[_0x7de7('0x9d')](_0x55321b['TrunkBackup'])){_0x55321b['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x55321b['message']=_0x7de7('0x9e');}}else{_0x55321b['message']=_0x7de7('0x9e');}emitCampaignPreview(_0x55321b);};Preview[_0x7de7('0x66')]['callProgressDetectingCustomer']=function(_0x45c441,_0x356b61,_0x2f5ad6){var _0x43476d=this;var _0x448e14=this[_0x7de7('0x15')][_0x356b61];var _0x343a71=this[_0x7de7('0x12')][_0x448e14[_0x7de7('0x71')]];var _0x3917e1;if(_0x343a71){switch(_0x2f5ad6){case'1':_0x343a71[_0x7de7('0x9f')]+=0x1;_0x448e14[_0x7de7('0xa0')]=ut[_0x7de7('0xa1')](_0x448e14);ut[_0x7de7('0x90')](_0x448e14,0x0,'NoSuchNumber');rpcDb['createCustomerHistory'](_0x448e14,_0x7de7('0xa2'));if(ut[_0x7de7('0xa1')](_0x448e14)>=_0x343a71[_0x7de7('0xa3')]){_0x3917e1=ut[_0x7de7('0xa4')](_0x448e14,0xf,'Global');rpcDb[_0x7de7('0xa5')](_0x3917e1,_0x7de7('0xa6'));}else{rpcDb[_0x7de7('0xa5')](_0x448e14,'[callProgressDetectingCustomer][logNoSuchGlobal]');}delete this[_0x7de7('0x15')][_0x45c441[_0x7de7('0xa7')]];break;case _0x7de7('0xa8'):var _0x38a1e3=moment()[_0x7de7('0x5c')](_0x7de7('0x8f'));_0x448e14[_0x7de7('0xa9')]=_0x38a1e3;_0x448e14[_0x7de7('0xaa')]=_0x38a1e3;_0x448e14[_0x7de7('0x73')]=!![];_0x343a71['pTalking']+=0x1;logger['info'](_0x7de7('0xab'),_0x448e14[_0x7de7('0xac')],_0x7de7('0xad'),_0x343a71[_0x7de7('0x29')],_0x7de7('0x72'),_0x343a71[_0x7de7('0x2c')]);ami['emit']('custom:agentconnect',ut['buildObj'](_0x448e14,_0x7de7('0xae')));if(_0x343a71['acw']){ami[_0x7de7('0x26')](_0x7de7('0xaf'),ut[_0x7de7('0xb0')](_0x448e14));}break;case'16':ami['emit'](_0x7de7('0xb1'),ut[_0x7de7('0xb2')](_0x448e14,'complete'));emitVoiceQueueChannelRemove(ut['buildObj'](_0x448e14,'complete'));_0x343a71[_0x7de7('0xb3')]+=0x1;_0x343a71[_0x7de7('0x30')]+=0x1;_0x343a71[_0x7de7('0x2a')]+=0x1;ut['decrementTalkink'](_0x343a71,_0x7de7('0xb4'));_0x448e14['countglobal']=ut[_0x7de7('0xa1')](_0x448e14);ut[_0x7de7('0x90')](_0x448e14,0x4,_0x7de7('0xb5'));rpcDb[_0x7de7('0x95')](_0x448e14,_0x7de7('0xb6'));rpcDb[_0x7de7('0xa5')](_0x448e14,_0x7de7('0xb7'));rpcDb['crateCustomerReportQueue'](_0x448e14);_0x343a71[_0x7de7('0x2e')]+=_0x448e14[_0x7de7('0xb8')];_0x343a71[_0x7de7('0x2d')]+=_0x448e14[_0x7de7('0xb8')];logger[_0x7de7('0x6f')](_0x7de7('0xb9'),_0x448e14['uniqueid'],'\x20Queue',_0x343a71[_0x7de7('0x29')],_0x7de7('0x72'),_0x343a71['pTalking']);delete this[_0x7de7('0x15')][_0x45c441[_0x7de7('0xa7')]];break;case _0x7de7('0xba'):_0x343a71['outboundBusyCallsDay']+=0x1;_0x448e14[_0x7de7('0xbb')]+=0x1;_0x448e14[_0x7de7('0xa0')]=ut[_0x7de7('0xa1')](_0x448e14);ut['logCustomer'](_0x448e14,0x5,_0x7de7('0xbc'));rpcDb[_0x7de7('0x95')](_0x448e14,_0x7de7('0xbd'));if(ut[_0x7de7('0xa1')](_0x448e14)>=_0x343a71[_0x7de7('0xa3')]){_0x3917e1=ut[_0x7de7('0xa4')](_0x448e14,0xf,_0x7de7('0xbe'));rpcDb[_0x7de7('0xa5')](_0x3917e1,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x448e14[_0x7de7('0xbb')]>=_0x343a71[_0x7de7('0xbf')]){rpcDb[_0x7de7('0xa5')](_0x448e14,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x7de7('0xc0')](ut[_0x7de7('0xc1')](_0x448e14,_0x7de7('0xbb'),_0x343a71[_0x7de7('0xc2')]),_0x448e14[_0x7de7('0xc3')],_0x448e14[_0x7de7('0xc4')]);}}break;case'NOANSWER':_0x343a71[_0x7de7('0x41')]+=0x1;_0x448e14[_0x7de7('0xc5')]+=0x1;_0x448e14[_0x7de7('0xa0')]=ut['totalGlobal'](_0x448e14);ut['logCustomer'](_0x448e14,0x3,_0x7de7('0xc6'));rpcDb[_0x7de7('0x95')](_0x448e14,_0x7de7('0xc7'));if(ut['totalGlobal'](_0x448e14)>=_0x343a71['dialGlobalMaxRetry']){_0x3917e1=ut[_0x7de7('0xa4')](_0x448e14,0xf,_0x7de7('0xbe'));rpcDb['createCustomerFinal'](_0x3917e1,_0x7de7('0xc8'));}else{if(_0x448e14[_0x7de7('0xc5')]>=_0x343a71[_0x7de7('0xc9')]){rpcDb['createCustomerFinal'](_0x448e14,_0x7de7('0xc7'));}else{rpcDb['rescheduleContact'](ut[_0x7de7('0xc1')](_0x448e14,'countnoanswerretry',_0x343a71[_0x7de7('0xca')]),_0x448e14[_0x7de7('0xc3')],_0x448e14[_0x7de7('0xc4')]);}}break;case'CONGESTION':_0x343a71[_0x7de7('0xcb')]+=0x1;_0x448e14[_0x7de7('0xcc')]+=0x1;_0x448e14[_0x7de7('0xa0')]=ut[_0x7de7('0xa1')](_0x448e14);ut[_0x7de7('0x90')](_0x448e14,0x8,_0x7de7('0xcd'));rpcDb['createCustomerHistory'](_0x448e14,_0x7de7('0xce'));if(ut[_0x7de7('0xa1')](_0x448e14)>=_0x343a71[_0x7de7('0xa3')]){_0x3917e1=ut[_0x7de7('0xa4')](_0x448e14,0xf,'Global');rpcDb[_0x7de7('0xa5')](_0x3917e1,_0x7de7('0xcf'));}else{if(_0x448e14[_0x7de7('0xcc')]>=_0x343a71[_0x7de7('0xd0')]){rpcDb['createCustomerFinal'](_0x448e14,_0x7de7('0xce'));}else{rpcDb['rescheduleContact'](ut[_0x7de7('0xc1')](_0x448e14,'countcongestionretry',_0x343a71[_0x7de7('0xc2')]),_0x448e14[_0x7de7('0xc3')],_0x448e14[_0x7de7('0xc4')]);}}break;case'CANCEL':_0x343a71['outboundRejectCallsDay']+=0x1;_0x448e14[_0x7de7('0xa0')]=ut['totalGlobal'](_0x448e14);ut[_0x7de7('0x90')](_0x448e14,0x14,'AgentReject');rpcDb['createCustomerHistory'](_0x448e14,_0x7de7('0xd1'));if(_0x448e14[_0x7de7('0xc3')]){rpcDb[_0x7de7('0xd2')](_0x448e14['idContact']);}if(_0x448e14[_0x7de7('0xc4')]){rpcDb[_0x7de7('0xd3')](_0x448e14['idContact']);}break;default:if(_0x448e14[_0x7de7('0x73')]){ut[_0x7de7('0x7e')](_0x343a71,'[default]');ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x343a71[_0x7de7('0x29')],_0x45c441);}_0x343a71[_0x7de7('0x45')]+=0x1;_0x448e14[_0x7de7('0xa0')]=ut['totalGlobal'](_0x448e14);ut[_0x7de7('0x90')](_0x448e14,0xc,_0x45c441[_0x7de7('0xd4')]||_0x45c441[_0x7de7('0xd5')]);rpcDb[_0x7de7('0x95')](_0x448e14,_0x7de7('0xd6'));if(ut[_0x7de7('0xa1')](_0x448e14)>=_0x343a71[_0x7de7('0xa3')]){_0x3917e1=ut[_0x7de7('0xa4')](_0x448e14,0xf,_0x7de7('0xbe'));rpcDb[_0x7de7('0xa5')](_0x3917e1,_0x7de7('0xd7'));}else{rpcDb['createCustomerFinal'](_0x448e14,_0x7de7('0xd7'));}delete this[_0x7de7('0x15')][_0x45c441['linkedid']];}if(!(_0x448e14[_0x7de7('0x73')]&&_0x2f5ad6==='16')){ut[_0x7de7('0x7c')](_0x343a71,_0x7de7('0xd8'));logger[_0x7de7('0x6f')]('[originated][decrement][callProgressDetectingCustomer]',_0x448e14[_0x7de7('0xac')],_0x7de7('0xad'),_0x343a71['name'],'originated:\x20',_0x343a71[_0x7de7('0x5f')]);}if(_0x2f5ad6!==_0x7de7('0xa8')){delete this[_0x7de7('0x15')][_0x45c441['linkedid']];delete this['actions'][_0x45c441[_0x7de7('0xd9')]];}}};Preview[_0x7de7('0x66')][_0x7de7('0xda')]=function(_0x59dd3f,_0xd92052,_0x3bbee5){if(_[_0x7de7('0xdb')](_0xd92052)&&'object'!==typeof _0xd92052){return;}if(_[_0x7de7('0xdb')](_0x3bbee5)&&_0x7de7('0xdc')!==typeof _0x3bbee5){return;}switch(_0x3bbee5[_0x7de7('0xdd')]){case'0':ut['logAgent'](_0x59dd3f,0x0,_0x7de7('0xde'));rpcDb[_0x7de7('0xdf')](_0x59dd3f,_0x7de7('0xe0'));break;case'3':ut[_0x7de7('0xe1')](_0x59dd3f,0x3,_0x7de7('0xc6'));rpcDb[_0x7de7('0xdf')](_0x59dd3f,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x7de7('0xe1')](_0x59dd3f,0x5,_0x7de7('0xbc'));rpcDb[_0x7de7('0xdf')](_0x59dd3f,_0x7de7('0xe2'));break;case'8':ut[_0x7de7('0xe1')](_0x59dd3f,0x8,_0x7de7('0xcd'));rpcDb[_0x7de7('0xdf')](_0x59dd3f,_0x7de7('0xe3'));break;case'22':ut[_0x7de7('0xe1')](_0x59dd3f,0x16,_0x7de7('0xe4'));rpcDb[_0x7de7('0xdf')](_0x59dd3f,_0x7de7('0xe5'));break;default:ut[_0x7de7('0xe1')](_0x59dd3f,0xc,_0x3bbee5[_0x7de7('0xdd')]);rpcDb[_0x7de7('0xdf')](_0x59dd3f,_0x7de7('0xe3'));}ut[_0x7de7('0x7c')](_0xd92052,_0x7de7('0xe6'));logger[_0x7de7('0x6f')](_0x7de7('0xe7'),_0x59dd3f[_0x7de7('0xac')],_0x7de7('0xad'),_0xd92052[_0x7de7('0x29')],_0x7de7('0xe8'),_0xd92052[_0x7de7('0x5f')]);delete this[_0x7de7('0x15')][_0x59dd3f[_0x7de7('0xac')]];};Preview[_0x7de7('0x66')]['checkInBlack']=function(_0x48d531,_0x4dd0b0,_0x540a5c,_0x3cbea7,_0x15097f){var _0x284a20=this;return new BPromise(function(_0x1eddad,_0x13df1d){if(_[_0x7de7('0x6e')](_0x4dd0b0)||_[_0x7de7('0x6e')](_0x4dd0b0[_0x7de7('0xe9')])||_[_0x7de7('0x6e')](_0x4dd0b0[_0x7de7('0xe9')][_0x7de7('0xea')])||_[_0x7de7('0x6e')](_0x4dd0b0[_0x7de7('0x76')])){_0x13df1d(ut[_0x7de7('0x4e')](_0x7de7('0xeb'),_0x3cbea7,_0x15097f));return;}var _0x12f197=uuid['v4']();var _0x4c7369=_0x284a20[_0x7de7('0x12')][_0x4dd0b0[_0x7de7('0xec')][_0x7de7('0x29')]];var _0xf75f75=_0x540a5c?_0x284a20['agents'][_0x540a5c]['id']:undefined;_0x284a20['actions'][_0x12f197]=new Action(_0x4dd0b0,_0x4c7369,_0x12f197,_0x540a5c,_0xf75f75);var _0x3a63c3=_0x284a20[_0x7de7('0x15')][_0x12f197];_0x3a63c3[_0x7de7('0xc3')]=_0x3cbea7;_0x3a63c3[_0x7de7('0xc4')]=_0x15097f;_0x3a63c3[_0x7de7('0xed')]=_0x540a5c;if(_[_0x7de7('0xee')](_0x48d531)){_0x284a20[_0x7de7('0xef')](_0x3a63c3,_0x4c7369,_0x4dd0b0,_0x540a5c)[_0x7de7('0x86')](function(_0x52d88e){logger[_0x7de7('0x6f')]('[Preview][execCall][success]',_0x7de7('0xf0')+_0x3a63c3[_0x7de7('0x71')]+_0x7de7('0xf1')+_0x3a63c3[_0x7de7('0xf2')],JSON[_0x7de7('0x58')](_0x52d88e));ami['emit'](_0x7de7('0xf3'),ut['buildObj'](_0x3a63c3,_0x7de7('0xf4')));_0x1eddad(ut[_0x7de7('0x4e')](_0x7de7('0xf5')));})[_0x7de7('0x8c')](function(_0x4aa193){ut[_0x7de7('0x62')](_0x7de7('0xf6'),_0x4aa193);_0x13df1d(ut['message'](_0x7de7('0xf7'),_0x3cbea7,_0x15097f));});}else{_0x4c7369['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x3a63c3);rpcDb[_0x7de7('0xf8')](_0x3a63c3,'[Blacklist][error]');delete _0x284a20['actions'][_0x12f197];_0x13df1d(ut[_0x7de7('0x4e')](_0x7de7('0xf9'),_0x3cbea7,_0x15097f));}});};Preview[_0x7de7('0x66')][_0x7de7('0x9d')]=function(_0x429422){return!_[_0x7de7('0x6e')](_0x429422)&&!_['isNil'](_0x429422[_0x7de7('0x29')])&&!_[_0x7de7('0x6e')](_0x429422['active'])&&_0x429422[_0x7de7('0x55')]&&!_[_0x7de7('0x6e')](this[_0x7de7('0x14')][util[_0x7de7('0x5c')](_0x7de7('0xfa'),_0x429422['name'])])&&!_['isNil'](this['trunks'][util['format'](_0x7de7('0xfa'),_0x429422[_0x7de7('0x29')])][_0x7de7('0x79')])&&(this[_0x7de7('0x14')][util['format']('SIP/%s',_0x429422[_0x7de7('0x29')])]['status']===_0x7de7('0xfb')||this['trunks'][util['format'](_0x7de7('0xfa'),_0x429422[_0x7de7('0x29')])][_0x7de7('0x79')]===_0x7de7('0xfc'));};Preview[_0x7de7('0x66')]['run']=function(_0x67ee62,_0x1ad67a){var _0x5380a2=this;return new BPromise(function(_0x26086b,_0x1d088d){_0x5380a2[_0x7de7('0xfd')](_0x67ee62,_0x1ad67a)['then'](function(_0x2efbc2){_0x26086b(_[_0x7de7('0xfe')](_0x2efbc2,[_0x7de7('0x4e')]));})[_0x7de7('0x8c')](function(_0x171f0e){if(_0x171f0e[_0x7de7('0xff')]){rpcDb[_0x7de7('0xd2')](_0x67ee62);}if(_0x171f0e[_0x7de7('0x55')]){rpcDb[_0x7de7('0xd3')](_0x67ee62);}_0x1d088d(_[_0x7de7('0xfe')](_0x171f0e,[_0x7de7('0x4e')]));});});};Preview[_0x7de7('0x66')][_0x7de7('0xfd')]=function(_0x2d0777,_0x3f6955){var _0x5eed03=this;return new BPromise(function(_0x427702,_0x10fe24){var _0x299d59,_0x469fda;rpcDb['getContactPreview'](_0x2d0777)[_0x7de7('0x86')](function(_0x117b88){if(!_[_0x7de7('0x6e')](_0x117b88[0x0])){_0x469fda=_0x117b88[0x0][_0x7de7('0x100')]?![]:!![];_0x299d59=_0x117b88[0x0][_0x7de7('0x100')]?!![]:![];_0x299d59=_0x3f6955?!![]:_0x299d59;}var _0x33e736=_0x5eed03[_0x7de7('0x101')](_0x117b88);if(_0x33e736[_0x7de7('0x102')]){rpcDb[_0x7de7('0x103')](_['pick'](_0x117b88[0x0],['VoiceQueueId',_0x7de7('0x104')]))[_0x7de7('0x86')](function(_0x189eaa){_0x5eed03[_0x7de7('0x105')](_0x189eaa,_0x117b88[0x0],_0x3f6955,_0x469fda,_0x299d59)[_0x7de7('0x86')](function(_0x31512d){_0x427702(_0x31512d);})[_0x7de7('0x8c')](function(_0x1c0afb){_0x10fe24(_0x1c0afb);});})['catch'](function(_0x1dc745){ut[_0x7de7('0x62')](_0x7de7('0x106'),_0x1dc745);_0x10fe24(ut['message']('Call\x20unsuccessful',_0x469fda,_0x299d59));});}else{_0x10fe24(ut[_0x7de7('0x4e')](_0x33e736['message'],_0x469fda,_0x299d59));}})[_0x7de7('0x8c')](function(_0xff710e){ut[_0x7de7('0x62')](_0x7de7('0x107'),_0xff710e);_0x10fe24(ut[_0x7de7('0x4e')](_0x7de7('0x108'),![],!![]));});});};Preview[_0x7de7('0x66')][_0x7de7('0x101')]=function(_0x344a14){if(_[_0x7de7('0x6e')](_0x344a14)||_[_0x7de7('0xee')](_0x344a14)||!_['isNil'](_0x344a14[0x0]['Agent'])&&_['isNil'](_0x344a14[0x0][_0x7de7('0x109')]['name'])){ut[_0x7de7('0x62')](_0x7de7('0x10a'),_0x344a14);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x43351d=this[_0x7de7('0x12')][_0x344a14[0x0][_0x7de7('0xec')][_0x7de7('0x29')]];_0x43351d['message']=_0x7de7('0x9e');if(_[_0x7de7('0x6e')](_0x43351d)){ut[_0x7de7('0x62')](_0x7de7('0x10b'),_0x43351d);return{'isValid':![],'message':_0x7de7('0x10c')};}if(!this[_0x7de7('0x9d')](_0x43351d[_0x7de7('0x54')])){ut[_0x7de7('0x62')](_0x7de7('0x10d'),_0x7de7('0x10e')+_0x43351d[_0x7de7('0x29')]+_0x7de7('0x10f'));if(!this[_0x7de7('0x9d')](_0x43351d[_0x7de7('0x110')])){ut[_0x7de7('0x62')](_0x7de7('0x10d'),_0x43351d[_0x7de7('0x29')]+_0x7de7('0x111'));return{'isValid':![],'message':_0x7de7('0x112')};}}if(!ut[_0x7de7('0x9c')](_0x43351d[_0x7de7('0x35')])){ut[_0x7de7('0x62')](_0x7de7('0x113'),_0x43351d['name']+'\x20Not\x20Active');return{'isValid':![],'message':_0x7de7('0x10e')+_0x43351d[_0x7de7('0x29')]+_0x7de7('0x114')};}return{'isValid':!![],'message':_0x7de7('0x115')};};Preview[_0x7de7('0x66')][_0x7de7('0xef')]=function(_0x3de12d,_0x305ea9,_0x632d29,_0x527858){var _0x50ef0d=this;return new BPromise(function(_0x372c74,_0x3506cc){var _0x2ecd98=_0x3de12d['uniqueid'];var _0x45dbf1=_0x50ef0d[_0x7de7('0x9d')](_0x305ea9[_0x7de7('0x54')])?util['format'](_0x7de7('0x116'),_0x305ea9['Trunk'][_0x7de7('0x29')],_['isNil'](_0x305ea9[_0x7de7('0x3a')])?'':_0x305ea9['dialPrefix']['trim']()||'',_0x305ea9['dialCutDigit']>0x0?_0x632d29[_0x7de7('0xe9')]['phone'][_0x7de7('0x117')](_0x305ea9['dialCutDigit']):_0x632d29['Contact'][_0x7de7('0xea')]):util[_0x7de7('0x5c')](_0x7de7('0x116'),_[_0x7de7('0x6e')](_0x305ea9['TrunkBackup'])?_0x305ea9[_0x7de7('0x54')][_0x7de7('0x29')]:_0x305ea9[_0x7de7('0x110')][_0x7de7('0x29')],_[_0x7de7('0x6e')](_0x305ea9[_0x7de7('0x3a')])?'':_0x305ea9[_0x7de7('0x3a')][_0x7de7('0x118')]()||'',_0x305ea9[_0x7de7('0x119')]>0x0?_0x632d29[_0x7de7('0xe9')]['phone'][_0x7de7('0x117')](_0x305ea9['dialCutDigit']):_0x632d29['Contact']['phone']);var _0x1e1406=_0x50ef0d[_0x7de7('0x9d')](_0x305ea9['Trunk'])?ut[_0x7de7('0x11a')](_0x305ea9[_0x7de7('0x54')][_0x7de7('0x56')],_0x305ea9['dialOriginateCallerIdName'],_0x305ea9[_0x7de7('0x11b')]>0x0?ut[_0x7de7('0x11c')](_0x305ea9['dialOriginateCallerIdNumber'],_0x305ea9['dialRandomLastDigitCallerIdNumber']):_0x305ea9[_0x7de7('0x38')]):ut[_0x7de7('0x11a')](_[_0x7de7('0x6e')](_0x305ea9[_0x7de7('0x110')])?_0x305ea9['Trunk']['callerid']:_0x305ea9[_0x7de7('0x110')][_0x7de7('0x56')],_0x305ea9[_0x7de7('0x37')],_0x305ea9[_0x7de7('0x11b')]>0x0?ut['getCallerIdRandom'](_0x305ea9['dialOriginateCallerIdNumber'],_0x305ea9[_0x7de7('0x11b')]):_0x305ea9[_0x7de7('0x38')]);if(_0x1e1406){_0x3de12d[_0x7de7('0x11d')]=ut[_0x7de7('0x11e')](_0x1e1406);_0x3de12d['originatecalleridnum']=ut[_0x7de7('0x11f')](_0x1e1406);}var _0x7e3450=ut[_0x7de7('0x120')](_0x305ea9,_0x632d29,_0x45dbf1,_0x1e1406,_0x2ecd98,_0x3de12d);_['merge'](_0x3de12d,ut[_0x7de7('0x121')](_0x7e3450));_0x3de12d['starttime']=moment()[_0x7de7('0x5c')](_0x7de7('0x8f'));ami[_0x7de7('0x78')](ut[_0x7de7('0x122')](_0x3de12d,_0x305ea9,_0x7e3450,_0x3de12d[_0x7de7('0xc4')],_0x527858))[_0x7de7('0x86')](function(_0x11b1b9){_0x305ea9[_0x7de7('0x5f')]+=0x1;logger[_0x7de7('0x6f')](_0x7de7('0x123'),_0x2ecd98,_0x7de7('0xad'),_0x305ea9[_0x7de7('0x29')],_0x7de7('0xe8'),_0x305ea9[_0x7de7('0x5f')]);_0x372c74(_0x11b1b9);})[_0x7de7('0x8c')](function(_0x2a5017){ut[_0x7de7('0xe1')](_0x3de12d,0xe,'OriginateError');rpcDb[_0x7de7('0xdf')](_0x3de12d,_0x7de7('0x124'));_0x3506cc(_0x2a5017);});});};Preview['prototype']['syncNewExten']=function(_0x2449ad){if(this[_0x7de7('0x15')][_0x2449ad['linkedid']]){this[_0x7de7('0x15')][_0x2449ad[_0x7de7('0xa7')]]['channel']=_0x2449ad['channel'];}};Preview['prototype'][_0x7de7('0x18')]=function(_0x5460d6){var _0x146f71=this;var _0x33c2aa=this['actions'][_0x5460d6[_0x7de7('0x125')]];if(_0x33c2aa){if(_0x33c2aa[_0x7de7('0xed')]&&this[_0x7de7('0x16')][_0x33c2aa[_0x7de7('0xed')]]){ut['logLookAgent'](_0x33c2aa,this[_0x7de7('0x16')][_0x33c2aa['lookAgent']][_0x7de7('0x29')],this['agents'][_0x33c2aa[_0x7de7('0xed')]]['id']);}var _0x59c9c0=_[_0x7de7('0x126')](_0x33c2aa);_0x59c9c0[_0x7de7('0xa9')]=moment()['format'](_0x7de7('0x8f'));var _0x52f744=_0x146f71[_0x7de7('0x12')][_0x33c2aa['queue']];if(ut[_0x7de7('0x127')](_0x5460d6[_0x7de7('0x128')])){if(_0x33c2aa[_0x7de7('0xc3')]){rpcDb[_0x7de7('0xd2')](_0x33c2aa[_0x7de7('0xf2')]);}if(_0x33c2aa[_0x7de7('0xc4')]){rpcDb[_0x7de7('0xd3')](_0x33c2aa[_0x7de7('0xf2')]);}ami[_0x7de7('0x26')](_0x7de7('0x129'),ut[_0x7de7('0xb2')](_0x33c2aa,_0x7de7('0x12a')));this[_0x7de7('0xda')](_0x59c9c0,_0x52f744,_0x5460d6);}else{_0x33c2aa[_0x7de7('0x8e')]=moment()[_0x7de7('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x7de7('0xe1')](_0x59c9c0,0x4,'Answer');rpcDb[_0x7de7('0xdf')](_0x59c9c0,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype'][_0x7de7('0x1a')]=function(_0x531974){var _0x215348=this;var _0x227a2e=this[_0x7de7('0x15')][_0x531974[_0x7de7('0xa7')]];var _0x43a65c;if(_0x227a2e){_0x43a65c=this[_0x7de7('0x12')][_0x227a2e['queue']];logger[_0x7de7('0x6f')](_0x7de7('0x12b'),_0x531974['linkedid'],_0x7de7('0xad'),_0x43a65c[_0x7de7('0x29')],_0x7de7('0x72'),_0x43a65c[_0x7de7('0x2c')]);}if(this['actions'][_0x531974[_0x7de7('0xa7')]]&&_0x531974['linkedid']!==_0x531974['uniqueid']){if(_0x531974[_0x7de7('0x12c')]==='16'&&this[_0x7de7('0x15')][_0x531974[_0x7de7('0xa7')]][_0x7de7('0x73')]){this[_0x7de7('0x12d')](_0x531974,_0x531974['linkedid'],_0x531974['cause']);}else if(this[_0x7de7('0x15')][_0x531974[_0x7de7('0xa7')]][_0x7de7('0x73')]){logger[_0x7de7('0x6f')]('[syncHangup][talking][cause]',_0x531974[_0x7de7('0xa7')],_0x531974[_0x7de7('0x12c')],'\x20Queue',_0x43a65c['name'],_0x7de7('0x72'),_0x43a65c[_0x7de7('0x2c')]);this[_0x7de7('0x12d')](_0x531974,_0x531974[_0x7de7('0xa7')],_0x531974[_0x7de7('0x12c')]);}}else if(_0x227a2e&&_['isNil'](_0x227a2e[_0x7de7('0x12e')])&&_0x43a65c['dialQueueProject']&&_0x531974[_0x7de7('0xa7')]===_0x531974['uniqueid']&&_[_0x7de7('0x6e')](_0x531974[_0x7de7('0xdd')])&&_0x531974[_0x7de7('0x12c')]==='16'&&_0x531974[_0x7de7('0x12f')]==='6'&&_[_0x7de7('0xdb')](_0x227a2e['transfer'])){if(_0x227a2e[_0x7de7('0xc3')]){rpcDb[_0x7de7('0xd2')](_0x227a2e['idContact']);}if(_0x227a2e[_0x7de7('0xc4')]){rpcDb[_0x7de7('0xd3')](_0x227a2e[_0x7de7('0xf2')]);}_0x531974[_0x7de7('0xdd')]='22';this['callProgressDetectingAgent'](_0x227a2e,_0x43a65c,_0x531974);}else if(_0x227a2e&&_0x227a2e[_0x7de7('0x130')]){if(_0x531974[_0x7de7('0x12c')]==='16'&&this[_0x7de7('0x15')][_0x531974['linkedid']][_0x7de7('0x73')]){logger[_0x7de7('0x6f')]('[syncHangup][talking][transfer]',_0x531974[_0x7de7('0xa7')],_0x531974[_0x7de7('0x12c')],'\x20Queue',_0x43a65c['name'],_0x7de7('0x72'),_0x43a65c['pTalking']);this[_0x7de7('0x12d')](_0x531974,_0x531974['linkedid'],_0x531974['cause']);}else if(this[_0x7de7('0x15')][_0x531974[_0x7de7('0xa7')]][_0x7de7('0x73')]){logger[_0x7de7('0x6f')]('[syncHangup][talking][cause]',_0x531974[_0x7de7('0xa7')],_0x531974[_0x7de7('0x12c')],'\x20Queue',_0x43a65c[_0x7de7('0x29')],_0x7de7('0x72'),_0x43a65c[_0x7de7('0x2c')]);this['callProgressDetectingCustomer'](_0x531974,_0x531974[_0x7de7('0xa7')],_0x531974[_0x7de7('0x12c')]);}}};Preview[_0x7de7('0x66')]['syncDialEnd']=function(_0x5da4e4){if(this[_0x7de7('0x15')][_0x5da4e4['destlinkedid']]&&_0x5da4e4[_0x7de7('0xd9')]!==_0x5da4e4[_0x7de7('0x131')]){this[_0x7de7('0x12d')](_0x5da4e4,_0x5da4e4[_0x7de7('0xd9')],_0x5da4e4['dialstatus']);}};Preview['prototype']['syncHangupRequest']=function(_0x50358e){if(this['actions'][_0x50358e[_0x7de7('0xa7')]]&&_0x50358e[_0x7de7('0xa7')]!==_0x50358e[_0x7de7('0xac')]&&!this[_0x7de7('0x15')][_0x50358e[_0x7de7('0xa7')]][_0x7de7('0x73')]){if(_0x50358e['cause']==='1'){this[_0x7de7('0x12d')](_0x50358e,_0x50358e[_0x7de7('0xa7')],_0x50358e[_0x7de7('0x12c')]);}}};Preview[_0x7de7('0x66')][_0x7de7('0x132')]=function(_0x5ee5f2,_0x1711a3,_0x6018ca){if(this[_0x7de7('0x15')][_0x5ee5f2]){if(_['isNil'](this['actions'][_0x5ee5f2][_0x7de7('0x133')])){this[_0x7de7('0x15')][_0x5ee5f2][_0x7de7('0x133')]={};}this[_0x7de7('0x15')][_0x5ee5f2][_0x7de7('0x133')][_0x1711a3]=_0x6018ca;}};Preview[_0x7de7('0x66')][_0x7de7('0x22')]=function(_0x27d284){try{if(!_[_0x7de7('0x6e')](_0x27d284)){if(ut['filterKey'](_[_0x7de7('0x134')](_0x27d284[_0x7de7('0x135')])[0x0])){this[_0x7de7('0x132')](_0x27d284['uniqueid'],_[_0x7de7('0x134')](_0x27d284['variable'])[0x0],_0x27d284[_0x7de7('0x136')]);}}}catch(_0x5421a2){logger[_0x7de7('0x137')](_0x7de7('0x138'),util[_0x7de7('0x139')](_0x5421a2,{'showHidden':![],'depth':null}));}};Preview[_0x7de7('0x66')][_0x7de7('0x23')]=function(_0x10e675){if(_0x10e675){if(this[_0x7de7('0x15')][_0x10e675['transfertargetlinkedid']]){this['actions'][_0x10e675[_0x7de7('0x13a')]][_0x7de7('0x130')]=!![];}}};Preview['prototype'][_0x7de7('0x24')]=function(_0x1060bb){if(_0x1060bb){if(this[_0x7de7('0x15')][_0x1060bb[_0x7de7('0x13b')]]){this[_0x7de7('0x15')][_0x1060bb[_0x7de7('0x13b')]]['transfer']=!![];}}};module[_0x7de7('0x13c')]=Preview; \ No newline at end of file +var _0x243a=['[originateFailure][logOriginateFailure]','logLookAgent','responsetime','isFailure','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','reason','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','syncHangupRequest','addVariable','variables','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','preview','../ami','./rpcDb','./action','./util/util','defaults','localhost','socket.io-emitter','redis','enqueue','tail','finally','sequence','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hanguprequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','type','outbound','answered','loggedIn','sumBillable','sumHoldTime','talking','total','unmanaged','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCallToSecond','erlangAbandonmentRate','startProgressive','Trunk','name','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','format','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','paused','message','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','clockClearZombieChannels','clearZombieChannels','setMessage','recallMe','clearZombieChannel','isNil','info','Queue','originated:\x20','pTalking:\x20','queue','pick','contactId','UserId','ListId','Action','channel','catch','No\x20such\x20channel','updateOriginated','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','getContactRecallMe','then','length','getDiff','scheduledat','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','answertime','[syncHangup][talking][increment]','custom:agentconnect','buildObj','acw','custom:agentConnectPreview','buildAcw','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','uniqueid','\x20Queue','BUSY','Busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','rescheduleContact','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswerGlobal]','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','scheduledAt','CANCEL','AgentReject','unlockContact','idContact','disableContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','outboundUnknownCallsDay','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','isUndefined','object','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','logAgent','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','Contact\x20is\x20undefined','lookAgent','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','logger','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','checkInBlack','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','ACTIVE','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','campaign\x20Name:\x20','Is\x20Valid','execCall','SIP/%s/%s%s','trim','substring','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','variablesAction','[originated][increment]','OriginateError'];(function(_0x54c695,_0x5d6677){var _0x3ce06b=function(_0x55bdf1){while(--_0x55bdf1){_0x54c695['push'](_0x54c695['shift']());}};_0x3ce06b(++_0x5d6677);}(_0x243a,0x152));var _0xa243=function(_0x31c817,_0x25d113){_0x31c817=_0x31c817-0x0;var _0x228c58=_0x243a[_0x31c817];return _0x228c58;};'use strict';var util=require(_0xa243('0x0'));var _=require(_0xa243('0x1'));var BPromise=require(_0xa243('0x2'));var uuid=require(_0xa243('0x3'));var moment=require(_0xa243('0x4'));var md5=require(_0xa243('0x5'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xa243('0x6'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0xa243('0x7'));var rpcDb=require(_0xa243('0x8'));var Action=require(_0xa243('0x9'));var ut=require(_0xa243('0xa'));config['redis']=_[_0xa243('0xb')](config['redis'],{'host':_0xa243('0xc'),'port':0x18eb});var io=require(_0xa243('0xd'))(new Redis(config[_0xa243('0xe')]));var Sequence=function(){};Sequence['prototype'][_0xa243('0xf')]=function(_0x45dec8){this[_0xa243('0x10')]=this[_0xa243('0x10')]?this[_0xa243('0x10')][_0xa243('0x11')](_0x45dec8):_0x45dec8();};function Preview(_0x2a1be8){this[_0xa243('0x12')]=new Sequence();this['campaignsPreview']=_0x2a1be8[_0xa243('0x13')];this[_0xa243('0x14')]=_0x2a1be8[_0xa243('0x14')];this[_0xa243('0x15')]={};this[_0xa243('0x16')]=_0x2a1be8[_0xa243('0x16')];this['clockClearZombieChannels']=0x0;ami['on'](_0xa243('0x17'),this[_0xa243('0x18')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0xa243('0x19')](this));ami['on'](_0xa243('0x1a'),this['syncHangupRequest'][_0xa243('0x19')](this));ami['on'](_0xa243('0x1b'),this[_0xa243('0x1c')][_0xa243('0x19')](this));ami['on'](_0xa243('0x1d'),this[_0xa243('0x1e')][_0xa243('0x19')](this));ami['on'](_0xa243('0x1f'),this[_0xa243('0x20')][_0xa243('0x19')](this));ami['on']('attendedtransfer',this[_0xa243('0x21')][_0xa243('0x19')](this));ami['on']('blindtransfer',this[_0xa243('0x22')][_0xa243('0x19')](this));this[_0xa243('0x23')](this[_0xa243('0x24')]);}function emit(_0x303f9a,_0x26ae94,_0x543835){io['to'](_0x303f9a)[_0xa243('0x25')](_0x26ae94,_0x543835);}function emitCampaignPreview(_0x275a9d){if(_0x275a9d[_0xa243('0x26')]===_0xa243('0x27')){var _0x826ba7={'id':_0x275a9d['id'],'name':_0x275a9d['name'],'strategy':_0x275a9d['strategy'],'answered':_0x275a9d[_0xa243('0x28')],'available':_0x275a9d['available'],'loggedIn':_0x275a9d[_0xa243('0x29')],'pTalking':_0x275a9d['pTalking'],'sumBillable':_0x275a9d[_0xa243('0x2a')],'sumDuration':_0x275a9d['sumDuration'],'sumHoldTime':_0x275a9d[_0xa243('0x2b')]||0x0,'talking':_0x275a9d[_0xa243('0x2c')],'total':_0x275a9d[_0xa243('0x2d')],'type':_0x275a9d[_0xa243('0x26')],'unmanaged':_0x275a9d[_0xa243('0x2e')],'abandoned':_0x275a9d['abandoned'],'waiting':_0x275a9d['waiting'],'loggedInDb':_0x275a9d['loggedInDb'],'dialActive':_0x275a9d[_0xa243('0x2f')],'dialMethod':_0x275a9d[_0xa243('0x30')],'dialOriginateCallerIdName':_0x275a9d['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x275a9d['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x275a9d[_0xa243('0x31')],'dialPrefix':_0x275a9d[_0xa243('0x32')],'outboundAnswerAgiCallsDay':_0x275a9d[_0xa243('0x33')],'outboundAnswerCallsDay':_0x275a9d[_0xa243('0x34')],'outboundBlacklistCallsDay':_0x275a9d['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x275a9d['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x275a9d[_0xa243('0x35')],'outboundDropCallsDayACS':_0x275a9d[_0xa243('0x36')],'outboundDropCallsDayCallersExit':_0x275a9d[_0xa243('0x37')],'outboundDropCallsDayTimeout':_0x275a9d['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x275a9d['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x275a9d[_0xa243('0x38')],'outboundOriginateFailureCallsDay':_0x275a9d[_0xa243('0x39')],'outboundReCallsDay':_0x275a9d[_0xa243('0x3a')],'outboundRejectCallsDay':_0x275a9d[_0xa243('0x3b')],'outboundUnknownCallsDay':_0x275a9d['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x275a9d[_0xa243('0x3c')],'predictiveIntervalAvgHoldtime':_0x275a9d[_0xa243('0x3d')],'predictiveIntervalAvgTalktime':_0x275a9d['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x275a9d[_0xa243('0x3e')],'predictiveIntervalDroppedCallsTimeout':_0x275a9d[_0xa243('0x3f')],'predictiveIntervalErlangCalls':_0x275a9d['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x275a9d['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x275a9d[_0xa243('0x40')],'predictiveIntervalMultiplicativeFactor':_0x275a9d['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x275a9d[_0xa243('0x41')],'predictiveIntervalAvailable':_0x275a9d[_0xa243('0x42')],'predictiveIntervalTotalCalls':_0x275a9d['predictiveIntervalTotalCalls'],'message':_0x275a9d['message'],'originated':_0x275a9d[_0xa243('0x43')],'erlangCalls':_0x275a9d['erlangCalls'],'erlangCallToSecond':_0x275a9d[_0xa243('0x44')],'erlangAbandonmentRate':_0x275a9d[_0xa243('0x45')],'erlangBusyFactor':_0x275a9d['erlangBusyFactor'],'startPredictive':_0x275a9d['startPredictive'],'startProgressive':_0x275a9d[_0xa243('0x46')]};if(_0x275a9d[_0xa243('0x47')]){_0x826ba7[_0xa243('0x47')]={'id':_0x275a9d[_0xa243('0x47')]['id'],'name':_0x275a9d['Trunk'][_0xa243('0x48')],'active':_0x275a9d[_0xa243('0x47')][_0xa243('0x49')],'callerid':_0x275a9d[_0xa243('0x47')][_0xa243('0x4a')]};}if(_0x275a9d['Interval']){_0x826ba7[_0xa243('0x4b')]={'id':_0x275a9d['Interval']['id'],'name':_0x275a9d['Interval'][_0xa243('0x48')]};}var _0x31a876=md5(JSON[_0xa243('0x4c')](_0x826ba7));if(_0x275a9d[_0xa243('0x5')]!==_0x31a876){_0x275a9d[_0xa243('0x5')]=_0x31a876;emit(util['format'](_0xa243('0x4d'),_0x826ba7[_0xa243('0x48')]),_0xa243('0x4e'),_0x826ba7);}}}function emitVoiceQueueChannelRemove(_0x5857c5){emit(util[_0xa243('0x4f')]('voice:queue:%s',_0x5857c5['name']),_0xa243('0x50'),_0x5857c5);}function notSendMessagesQueue(_0x3f3d08){if(_0x3f3d08[_0xa243('0x51')]){if(_0x3f3d08['originated']===0x0&&_0x3f3d08[_0xa243('0x52')]===0x0){_0x3f3d08['sendMessageOneNotActive']=![];_0x3f3d08['available']=0x0;_0x3f3d08[_0xa243('0x53')]=0x0;_0x3f3d08[_0xa243('0x54')]=_0xa243('0x55');ut['logger'](_0xa243('0x56'),_0x3f3d08[_0xa243('0x48')]+_0xa243('0x57'));}else{_0x3f3d08[_0xa243('0x54')]=_0xa243('0x58');ut['logger'](_0xa243('0x56'),_0x3f3d08[_0xa243('0x48')]+_0xa243('0x59'));}emitCampaignPreview(_0x3f3d08);}}Preview[_0xa243('0x5a')][_0xa243('0x23')]=function(){var _0x5e1a31=this;setInterval(function(){_0x5e1a31[_0xa243('0x5b')]();},0x7cf);};Preview[_0xa243('0x5a')][_0xa243('0x5b')]=function(){var _0x3317b8=this[_0xa243('0x24')];this['clockClearZombieChannels']+=0x1;for(var _0x266c30 in _0x3317b8){if(_0x3317b8[_0xa243('0x5c')](_0x266c30)&&(_0x3317b8[_0x266c30][_0xa243('0x30')]===_0xa243('0x6')||_0x3317b8[_0x266c30][_0xa243('0x30')]==='booked')&&_0x3317b8[_0x266c30][_0xa243('0x26')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0xa243('0x5d')]=0x0;this[_0xa243('0x5e')]();}}if(_0x3317b8[_0xa243('0x5c')](_0x266c30)&&_0x3317b8[_0x266c30][_0xa243('0x30')]===_0xa243('0x6')&&_0x3317b8[_0x266c30][_0xa243('0x26')]===_0xa243('0x27')){if(_0x3317b8[_0x266c30][_0xa243('0x2f')]){this[_0xa243('0x5f')](_0x3317b8[_0x266c30]);this[_0xa243('0x60')](_0x3317b8[_0x266c30]);}else{notSendMessagesQueue(_0x3317b8[_0x266c30]);}}}};Preview[_0xa243('0x5a')][_0xa243('0x61')]=function(_0x5f283f){var _0x1c5e0a=this;this['sequence'][_0xa243('0xf')](function(){if(!_[_0xa243('0x62')](_0x1c5e0a['actions'][_0x5f283f])){loggerAction[_0xa243('0x63')]('[clearZombieChannels][talking]',_0x5f283f,_0xa243('0x64'),_0x1c5e0a[_0xa243('0x15')][_0x5f283f]['queue'],_0xa243('0x65'),JSON['stringify'](_0x1c5e0a[_0xa243('0x24')][_0x1c5e0a[_0xa243('0x15')][_0x5f283f]['queue']]['originated']),_0xa243('0x66'),JSON[_0xa243('0x4c')](_0x1c5e0a['campaignsPreview'][_0x1c5e0a[_0xa243('0x15')][_0x5f283f][_0xa243('0x67')]]['pTalking']),JSON[_0xa243('0x4c')](_0x1c5e0a['actions'][_0x5f283f]['dialAnswer']),JSON[_0xa243('0x4c')](_[_0xa243('0x68')](_0x1c5e0a[_0xa243('0x15')][_0x5f283f],[_0xa243('0x69'),_0xa243('0x6a'),'VoiceQueueId',_0xa243('0x6b')])));return ami[_0xa243('0x6c')]({'action':'status','channel':_0x1c5e0a[_0xa243('0x15')][_0x5f283f][_0xa243('0x6d')]})[_0xa243('0x6e')](function(_0x1622b1){if(_0x1622b1[_0xa243('0x54')]===_0xa243('0x6f')){setTimeout(function(){if(_0x1c5e0a[_0xa243('0x15')][_0x5f283f]){ut[_0xa243('0x70')](_0x1c5e0a[_0xa243('0x24')][_0x1c5e0a[_0xa243('0x15')][_0x5f283f]['queue']],'[clearZombieChannel]');if(_0x1c5e0a['actions'][_0x5f283f][_0xa243('0x71')]===!![]){ut[_0xa243('0x72')](_0x1c5e0a[_0xa243('0x24')][_0x1c5e0a['actions'][_0x5f283f][_0xa243('0x67')]],_0xa243('0x73'));ut[_0xa243('0x74')](_0xa243('0x75')+_0x5f283f,_0x1c5e0a['actions'][_0x5f283f][_0xa243('0x67')]);}ut['loggerError'](_0xa243('0x76')+_0x5f283f,_0x1c5e0a['actions'][_0x5f283f][_0xa243('0x67')]);delete _0x1c5e0a[_0xa243('0x15')][_0x5f283f];}},0x2328);}});}});};Preview[_0xa243('0x5a')][_0xa243('0x5e')]=function(){var _0x4f02b0=this;loggerAction[_0xa243('0x63')]('[action]',_[_0xa243('0x77')](this['actions']));for(var _0x5e4d37 in this['actions']){if(_0x4f02b0[_0xa243('0x15')][_0xa243('0x5c')](_0x5e4d37)){_0x4f02b0[_0xa243('0x61')](_0x5e4d37);}}};Preview['prototype']['recallMe']=function(_0x5af6fc){var _0x5d8d83=this;rpcDb[_0xa243('0x78')](_0x5af6fc['id'],ut['agentReadyId'](this[_0xa243('0x16')]))[_0xa243('0x79')](function(_0x366e77){if(!_[_0xa243('0x62')](_0x366e77)){for(var _0x2e9c3b=0x0;_0x2e9c3b<_0x366e77[_0xa243('0x7a')];_0x2e9c3b+=0x1){if(ut[_0xa243('0x7b')](_0x366e77[_0x2e9c3b][_0xa243('0x7c')])<_0x5af6fc['dialRecallMeTimeout']*0x3c){_0x5d8d83[_0xa243('0x7d')](_0x366e77[_0x2e9c3b]['id'])[_0xa243('0x79')](ut[_0xa243('0x7e')](_0xa243('0x7f')))['catch'](ut[_0xa243('0x7e')](_0xa243('0x7f')));}else{var _0x4e47ab=new Action(_0x366e77[_0x2e9c3b],_0x5af6fc);_0x4e47ab[_0xa243('0x80')]=moment()[_0xa243('0x4f')](_0xa243('0x81'));_0x5af6fc[_0xa243('0x3a')]+=0x1;ut[_0xa243('0x82')](_0x4e47ab,0x17,_0xa243('0x83'));if(_0x5af6fc['dialRecallInQueue']){rpcDb[_0xa243('0x84')](ut['createBody'](_0x366e77[_0x2e9c3b]));rpcDb[_0xa243('0x85')](_0x4e47ab,_0xa243('0x86'));}else{ut[_0xa243('0x82')](_0x4e47ab,0x16,_0xa243('0x87'));rpcDb['createCustomerHistory'](_0x4e47ab,'[HistoryRecallClose]');rpcDb[_0xa243('0x88')](_0x4e47ab,_0xa243('0x89'));}}}}})[_0xa243('0x6e')](ut['logger2'](_0xa243('0x8a')));};Preview[_0xa243('0x5a')][_0xa243('0x5f')]=function(_0x1fe459){_0x1fe459[_0xa243('0x51')]=!![];if(ut[_0xa243('0x8b')](_0x1fe459['loggedIn'])){_0x1fe459[_0xa243('0x54')]='AGENTS_NOT_LOGGED';}else if(!ut[_0xa243('0x8c')](_0x1fe459[_0xa243('0x2f')])){_0x1fe459[_0xa243('0x54')]=_0xa243('0x55');}else if(!this[_0xa243('0x8d')](_0x1fe459['Trunk'])){if(!this[_0xa243('0x8d')](_0x1fe459[_0xa243('0x8e')])){_0x1fe459[_0xa243('0x54')]='TRUNK_IS_NOT_REACHABLE';}else{_0x1fe459[_0xa243('0x54')]='ACTIVE';}}else{_0x1fe459['message']='ACTIVE';}emitCampaignPreview(_0x1fe459);};Preview[_0xa243('0x5a')][_0xa243('0x8f')]=function(_0x54fa2f,_0x4a7b5e,_0x403605){var _0xcaab19=this;var _0x5680fe=this['actions'][_0x4a7b5e];var _0x1376ce=this['campaignsPreview'][_0x5680fe[_0xa243('0x67')]];var _0x193f8c;if(_0x1376ce){switch(_0x403605){case'1':_0x1376ce['outboundNoSuchCallsDay']+=0x1;_0x5680fe[_0xa243('0x90')]=ut[_0xa243('0x91')](_0x5680fe);ut['logCustomer'](_0x5680fe,0x0,_0xa243('0x92'));rpcDb[_0xa243('0x85')](_0x5680fe,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xa243('0x91')](_0x5680fe)>=_0x1376ce[_0xa243('0x93')]){_0x193f8c=ut['cloneAction'](_0x5680fe,0xf,_0xa243('0x94'));rpcDb[_0xa243('0x88')](_0x193f8c,_0xa243('0x95'));}else{rpcDb['createCustomerFinal'](_0x5680fe,_0xa243('0x95'));}delete this['actions'][_0x54fa2f[_0xa243('0x96')]];break;case'ANSWER':var _0x207544=moment()[_0xa243('0x4f')](_0xa243('0x81'));_0x5680fe['responsetime']=_0x207544;_0x5680fe[_0xa243('0x97')]=_0x207544;_0x5680fe[_0xa243('0x71')]=!![];_0x1376ce[_0xa243('0x52')]+=0x1;logger[_0xa243('0x63')](_0xa243('0x98'),_0x5680fe['uniqueid'],'\x20Queue',_0x1376ce['name'],'pTalking:\x20',_0x1376ce['pTalking']);ami['emit'](_0xa243('0x99'),ut[_0xa243('0x9a')](_0x5680fe,'connect'));if(_0x1376ce[_0xa243('0x9b')]){ami[_0xa243('0x25')](_0xa243('0x9c'),ut[_0xa243('0x9d')](_0x5680fe));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0xa243('0x9a')](_0x5680fe,_0xa243('0x9e')));emitVoiceQueueChannelRemove(ut['buildObj'](_0x5680fe,'complete'));_0x1376ce[_0xa243('0x34')]+=0x1;_0x1376ce[_0xa243('0x2d')]+=0x1;_0x1376ce[_0xa243('0x28')]+=0x1;ut[_0xa243('0x72')](_0x1376ce,_0xa243('0x9f'));_0x5680fe[_0xa243('0x90')]=ut[_0xa243('0x91')](_0x5680fe);ut[_0xa243('0x82')](_0x5680fe,0x4,_0xa243('0xa0'));rpcDb[_0xa243('0x85')](_0x5680fe,_0xa243('0xa1'));rpcDb[_0xa243('0x88')](_0x5680fe,_0xa243('0xa2'));rpcDb[_0xa243('0xa3')](_0x5680fe);_0x1376ce[_0xa243('0xa4')]+=_0x5680fe[_0xa243('0xa5')];_0x1376ce[_0xa243('0x2a')]+=_0x5680fe['talktime'];logger[_0xa243('0x63')](_0xa243('0xa6'),_0x5680fe[_0xa243('0xa7')],_0xa243('0xa8'),_0x1376ce[_0xa243('0x48')],_0xa243('0x66'),_0x1376ce['pTalking']);delete this[_0xa243('0x15')][_0x54fa2f[_0xa243('0x96')]];break;case _0xa243('0xa9'):_0x1376ce['outboundBusyCallsDay']+=0x1;_0x5680fe['countbusyretry']+=0x1;_0x5680fe['countglobal']=ut[_0xa243('0x91')](_0x5680fe);ut['logCustomer'](_0x5680fe,0x5,_0xa243('0xaa'));rpcDb['createCustomerHistory'](_0x5680fe,_0xa243('0xab'));if(ut[_0xa243('0x91')](_0x5680fe)>=_0x1376ce[_0xa243('0x93')]){_0x193f8c=ut[_0xa243('0xac')](_0x5680fe,0xf,'Global');rpcDb['createCustomerFinal'](_0x193f8c,_0xa243('0xad'));}else{if(_0x5680fe[_0xa243('0xae')]>=_0x1376ce['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0x5680fe,_0xa243('0xab'));}else{rpcDb[_0xa243('0xaf')](ut['scheduledAt'](_0x5680fe,_0xa243('0xae'),_0x1376ce[_0xa243('0xb0')]),_0x5680fe[_0xa243('0xb1')],_0x5680fe[_0xa243('0xb2')]);}}break;case _0xa243('0xb3'):_0x1376ce[_0xa243('0xb4')]+=0x1;_0x5680fe[_0xa243('0xb5')]+=0x1;_0x5680fe[_0xa243('0x90')]=ut[_0xa243('0x91')](_0x5680fe);ut[_0xa243('0x82')](_0x5680fe,0x3,'NoAnswer');rpcDb[_0xa243('0x85')](_0x5680fe,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0xa243('0x91')](_0x5680fe)>=_0x1376ce[_0xa243('0x93')]){_0x193f8c=ut[_0xa243('0xac')](_0x5680fe,0xf,'Global');rpcDb[_0xa243('0x88')](_0x193f8c,_0xa243('0xb6'));}else{if(_0x5680fe[_0xa243('0xb5')]>=_0x1376ce['dialNoAnswerMaxRetry']){rpcDb[_0xa243('0x88')](_0x5680fe,_0xa243('0xb7'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x5680fe,_0xa243('0xb5'),_0x1376ce[_0xa243('0xb8')]),_0x5680fe[_0xa243('0xb1')],_0x5680fe[_0xa243('0xb2')]);}}break;case _0xa243('0xb9'):_0x1376ce[_0xa243('0x35')]+=0x1;_0x5680fe[_0xa243('0xba')]+=0x1;_0x5680fe[_0xa243('0x90')]=ut[_0xa243('0x91')](_0x5680fe);ut[_0xa243('0x82')](_0x5680fe,0x8,_0xa243('0xbb'));rpcDb['createCustomerHistory'](_0x5680fe,_0xa243('0xbc'));if(ut['totalGlobal'](_0x5680fe)>=_0x1376ce[_0xa243('0x93')]){_0x193f8c=ut[_0xa243('0xac')](_0x5680fe,0xf,_0xa243('0x94'));rpcDb[_0xa243('0x88')](_0x193f8c,_0xa243('0xbd'));}else{if(_0x5680fe[_0xa243('0xba')]>=_0x1376ce[_0xa243('0xbe')]){rpcDb[_0xa243('0x88')](_0x5680fe,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut[_0xa243('0xbf')](_0x5680fe,_0xa243('0xba'),_0x1376ce[_0xa243('0xb0')]),_0x5680fe['unlockAgent'],_0x5680fe['activeContact']);}}break;case _0xa243('0xc0'):_0x1376ce['outboundRejectCallsDay']+=0x1;_0x5680fe[_0xa243('0x90')]=ut[_0xa243('0x91')](_0x5680fe);ut[_0xa243('0x82')](_0x5680fe,0x14,_0xa243('0xc1'));rpcDb['createCustomerHistory'](_0x5680fe,'[syncHangupRequest][logAgentReject]');if(_0x5680fe[_0xa243('0xb1')]){rpcDb[_0xa243('0xc2')](_0x5680fe[_0xa243('0xc3')]);}if(_0x5680fe[_0xa243('0xb2')]){rpcDb[_0xa243('0xc4')](_0x5680fe[_0xa243('0xc3')]);}break;default:if(_0x5680fe['dialAnswer']){ut[_0xa243('0x72')](_0x1376ce,_0xa243('0xc5'));ut[_0xa243('0x74')](_0xa243('0xc6')+_0x1376ce[_0xa243('0x48')],_0x54fa2f);}_0x1376ce[_0xa243('0xc7')]+=0x1;_0x5680fe[_0xa243('0x90')]=ut[_0xa243('0x91')](_0x5680fe);ut[_0xa243('0x82')](_0x5680fe,0xc,_0x54fa2f[_0xa243('0xc8')]||_0x54fa2f[_0xa243('0xc9')]);rpcDb[_0xa243('0x85')](_0x5680fe,_0xa243('0xca'));if(ut[_0xa243('0x91')](_0x5680fe)>=_0x1376ce['dialGlobalMaxRetry']){_0x193f8c=ut[_0xa243('0xac')](_0x5680fe,0xf,'Global');rpcDb[_0xa243('0x88')](_0x193f8c,_0xa243('0xcb'));}else{rpcDb['createCustomerFinal'](_0x5680fe,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x54fa2f[_0xa243('0x96')]];}if(!(_0x5680fe[_0xa243('0x71')]&&_0x403605==='16')){ut[_0xa243('0x70')](_0x1376ce,'[callProgressDetectingCustomer]');logger['info'](_0xa243('0xcc'),_0x5680fe['uniqueid'],'\x20Queue',_0x1376ce[_0xa243('0x48')],_0xa243('0x65'),_0x1376ce[_0xa243('0x43')]);}if(_0x403605!=='ANSWER'){delete this[_0xa243('0x15')][_0x54fa2f[_0xa243('0x96')]];delete this[_0xa243('0x15')][_0x54fa2f['destlinkedid']];}}};Preview[_0xa243('0x5a')][_0xa243('0xcd')]=function(_0x563a31,_0x58cf78,_0x250745){if(_[_0xa243('0xce')](_0x58cf78)&&_0xa243('0xcf')!==typeof _0x58cf78){return;}if(_[_0xa243('0xce')](_0x250745)&&_0xa243('0xcf')!==typeof _0x250745){return;}switch(_0x250745['reason']){case'0':ut['logAgent'](_0x563a31,0x0,_0xa243('0x92'));rpcDb[_0xa243('0xd0')](_0x563a31,_0xa243('0xd1'));break;case'3':ut['logAgent'](_0x563a31,0x3,_0xa243('0xd2'));rpcDb[_0xa243('0xd0')](_0x563a31,_0xa243('0xd3'));break;case'5':ut[_0xa243('0xd4')](_0x563a31,0x5,'Busy');rpcDb['createAgentHistory'](_0x563a31,_0xa243('0xd5'));break;case'8':ut[_0xa243('0xd4')](_0x563a31,0x8,_0xa243('0xbb'));rpcDb[_0xa243('0xd0')](_0x563a31,_0xa243('0xd6'));break;case'22':ut[_0xa243('0xd4')](_0x563a31,0x16,_0xa243('0xd7'));rpcDb[_0xa243('0xd0')](_0x563a31,_0xa243('0xd8'));break;default:ut[_0xa243('0xd4')](_0x563a31,0xc,_0x250745['reason']);rpcDb['createAgentHistory'](_0x563a31,_0xa243('0xd6'));}ut['updateOriginated'](_0x58cf78,_0xa243('0xd9'));logger[_0xa243('0x63')](_0xa243('0xda'),_0x563a31[_0xa243('0xa7')],_0xa243('0xa8'),_0x58cf78[_0xa243('0x48')],_0xa243('0x65'),_0x58cf78[_0xa243('0x43')]);delete this[_0xa243('0x15')][_0x563a31['uniqueid']];};Preview[_0xa243('0x5a')]['checkInBlack']=function(_0x27a5e3,_0x4b7cf1,_0x474990,_0x2d8f94,_0x313ed7){var _0x3f14bd=this;return new BPromise(function(_0x1f2b21,_0xa0fdac){if(_[_0xa243('0x62')](_0x4b7cf1)||_[_0xa243('0x62')](_0x4b7cf1[_0xa243('0xdb')])||_['isNil'](_0x4b7cf1[_0xa243('0xdb')][_0xa243('0xdc')])||_[_0xa243('0x62')](_0x4b7cf1['VoiceQueueId'])){_0xa0fdac(ut[_0xa243('0x54')](_0xa243('0xdd'),_0x2d8f94,_0x313ed7));return;}var _0x2603f6=uuid['v4']();var _0xbbea50=_0x3f14bd['campaignsPreview'][_0x4b7cf1['Queue']['name']];var _0x149a77=_0x474990?_0x3f14bd[_0xa243('0x16')][_0x474990]['id']:undefined;_0x3f14bd[_0xa243('0x15')][_0x2603f6]=new Action(_0x4b7cf1,_0xbbea50,_0x2603f6,_0x474990,_0x149a77);var _0x25e951=_0x3f14bd[_0xa243('0x15')][_0x2603f6];_0x25e951[_0xa243('0xb1')]=_0x2d8f94;_0x25e951[_0xa243('0xb2')]=_0x313ed7;_0x25e951[_0xa243('0xde')]=_0x474990;if(_['isEmpty'](_0x27a5e3)){_0x3f14bd['execCall'](_0x25e951,_0xbbea50,_0x4b7cf1,_0x474990)['then'](function(_0x3226d9){logger['info'](_0xa243('0xdf'),_0xa243('0xe0')+_0x25e951[_0xa243('0x67')]+_0xa243('0xe1')+_0x25e951[_0xa243('0xc3')],JSON['stringify'](_0x3226d9));ami[_0xa243('0x25')](_0xa243('0xe2'),ut[_0xa243('0x9a')](_0x25e951,_0xa243('0xe3')));_0x1f2b21(ut[_0xa243('0x54')]('Calling'));})[_0xa243('0x6e')](function(_0x1b49b7){ut[_0xa243('0xe4')]('[Preview][execCall][failure]',_0x1b49b7);_0xa0fdac(ut['message'](_0xa243('0xe5'),_0x2d8f94,_0x313ed7));});}else{_0xbbea50[_0xa243('0xe6')]+=0x1;ut[_0xa243('0xe7')](_0x25e951);rpcDb[_0xa243('0xe8')](_0x25e951,_0xa243('0xe9'));delete _0x3f14bd[_0xa243('0x15')][_0x2603f6];_0xa0fdac(ut[_0xa243('0x54')](_0xa243('0xea'),_0x2d8f94,_0x313ed7));}});};Preview[_0xa243('0x5a')]['isTrunkReachable']=function(_0x5ea650){return!_[_0xa243('0x62')](_0x5ea650)&&!_[_0xa243('0x62')](_0x5ea650[_0xa243('0x48')])&&!_[_0xa243('0x62')](_0x5ea650[_0xa243('0x49')])&&_0x5ea650['active']&&!_[_0xa243('0x62')](this[_0xa243('0x14')][util[_0xa243('0x4f')]('SIP/%s',_0x5ea650[_0xa243('0x48')])])&&!_[_0xa243('0x62')](this[_0xa243('0x14')][util[_0xa243('0x4f')](_0xa243('0xeb'),_0x5ea650[_0xa243('0x48')])][_0xa243('0xec')])&&(this[_0xa243('0x14')][util[_0xa243('0x4f')](_0xa243('0xeb'),_0x5ea650['name'])]['status']===_0xa243('0xed')||this[_0xa243('0x14')][util[_0xa243('0x4f')]('SIP/%s',_0x5ea650[_0xa243('0x48')])][_0xa243('0xec')]===_0xa243('0xee'));};Preview['prototype'][_0xa243('0x7d')]=function(_0x4ae157,_0x4a6f19){var _0x3f4358=this;return new BPromise(function(_0x4807f4,_0xbb0599){_0x3f4358[_0xa243('0xef')](_0x4ae157,_0x4a6f19)[_0xa243('0x79')](function(_0x1a0129){_0x4807f4(_[_0xa243('0x68')](_0x1a0129,[_0xa243('0x54')]));})[_0xa243('0x6e')](function(_0x422ba4){if(_0x422ba4[_0xa243('0xf0')]){rpcDb[_0xa243('0xc2')](_0x4ae157);}if(_0x422ba4[_0xa243('0x49')]){rpcDb['disableContact'](_0x4ae157);}_0xbb0599(_[_0xa243('0x68')](_0x422ba4,[_0xa243('0x54')]));});});};Preview[_0xa243('0x5a')][_0xa243('0xef')]=function(_0x3c31c7,_0x54c952){var _0x55975c=this;return new BPromise(function(_0x30e02d,_0x1cd644){var _0x4b2491,_0x19b858;rpcDb[_0xa243('0xf1')](_0x3c31c7)[_0xa243('0x79')](function(_0x56c0a2){if(!_[_0xa243('0x62')](_0x56c0a2[0x0])){_0x19b858=_0x56c0a2[0x0][_0xa243('0xf2')]?![]:!![];_0x4b2491=_0x56c0a2[0x0][_0xa243('0xf2')]?!![]:![];_0x4b2491=_0x54c952?!![]:_0x4b2491;}var _0x3cc537=_0x55975c[_0xa243('0xf3')](_0x56c0a2);if(_0x3cc537[_0xa243('0xf4')]){rpcDb[_0xa243('0xf5')](_[_0xa243('0x68')](_0x56c0a2[0x0],['VoiceQueueId','Contact.phone']))[_0xa243('0x79')](function(_0x465270){_0x55975c[_0xa243('0xf6')](_0x465270,_0x56c0a2[0x0],_0x54c952,_0x19b858,_0x4b2491)[_0xa243('0x79')](function(_0x3ec7d5){_0x30e02d(_0x3ec7d5);})[_0xa243('0x6e')](function(_0x28bcdd){_0x1cd644(_0x28bcdd);});})[_0xa243('0x6e')](function(_0x4a4d62){ut['logger']('[Preview][checkIsBlackList]',_0x4a4d62);_0x1cd644(ut['message'](_0xa243('0xf7'),_0x19b858,_0x4b2491));});}else{_0x1cd644(ut[_0xa243('0x54')](_0x3cc537['message'],_0x19b858,_0x4b2491));}})[_0xa243('0x6e')](function(_0x25ea0f){ut[_0xa243('0xe4')](_0xa243('0xf8'),_0x25ea0f);_0x1cd644(ut[_0xa243('0x54')](_0xa243('0xf7'),![],!![]));});});};Preview[_0xa243('0x5a')]['validateContact']=function(_0x5e33f7){if(_['isNil'](_0x5e33f7)||_[_0xa243('0xf9')](_0x5e33f7)||!_['isNil'](_0x5e33f7[0x0][_0xa243('0xfa')])&&_['isNil'](_0x5e33f7[0x0][_0xa243('0xfa')][_0xa243('0x48')])){ut[_0xa243('0xe4')](_0xa243('0xfb'),_0x5e33f7);return{'isValid':![],'message':_0xa243('0xfc')};}var _0x1f3c96=this[_0xa243('0x24')][_0x5e33f7[0x0][_0xa243('0x64')]['name']];_0x1f3c96[_0xa243('0x54')]=_0xa243('0xfd');if(_['isNil'](_0x1f3c96)){ut[_0xa243('0xe4')](_0xa243('0xfe'),_0x1f3c96);return{'isValid':![],'message':_0xa243('0xff')};}if(!this[_0xa243('0x8d')](_0x1f3c96[_0xa243('0x47')])){ut[_0xa243('0xe4')](_0xa243('0x100'),'campaign\x20Name:\x20'+_0x1f3c96[_0xa243('0x48')]+_0xa243('0x101'));if(!this['isTrunkReachable'](_0x1f3c96[_0xa243('0x8e')])){ut[_0xa243('0xe4')](_0xa243('0x100'),_0x1f3c96[_0xa243('0x48')]+_0xa243('0x102'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut['isActive'](_0x1f3c96['dialActive'])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x1f3c96[_0xa243('0x48')]+'\x20Not\x20Active');return{'isValid':![],'message':_0xa243('0x103')+_0x1f3c96[_0xa243('0x48')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xa243('0x104')};};Preview[_0xa243('0x5a')][_0xa243('0x105')]=function(_0x23cb1d,_0xe7571,_0x462b39,_0x1234e9){var _0x2ecda0=this;return new BPromise(function(_0x3a0d63,_0x5e514e){var _0x4034f1=_0x23cb1d[_0xa243('0xa7')];var _0x14139b=_0x2ecda0[_0xa243('0x8d')](_0xe7571['Trunk'])?util[_0xa243('0x4f')](_0xa243('0x106'),_0xe7571[_0xa243('0x47')][_0xa243('0x48')],_[_0xa243('0x62')](_0xe7571['dialPrefix'])?'':_0xe7571[_0xa243('0x32')][_0xa243('0x107')]()||'',_0xe7571['dialCutDigit']>0x0?_0x462b39[_0xa243('0xdb')][_0xa243('0xdc')][_0xa243('0x108')](_0xe7571['dialCutDigit']):_0x462b39[_0xa243('0xdb')][_0xa243('0xdc')]):util[_0xa243('0x4f')](_0xa243('0x106'),_[_0xa243('0x62')](_0xe7571[_0xa243('0x8e')])?_0xe7571[_0xa243('0x47')]['name']:_0xe7571['TrunkBackup'][_0xa243('0x48')],_[_0xa243('0x62')](_0xe7571['dialPrefix'])?'':_0xe7571['dialPrefix'][_0xa243('0x107')]()||'',_0xe7571['dialCutDigit']>0x0?_0x462b39['Contact'][_0xa243('0xdc')]['substring'](_0xe7571['dialCutDigit']):_0x462b39[_0xa243('0xdb')][_0xa243('0xdc')]);var _0x37e44a=_0x2ecda0[_0xa243('0x8d')](_0xe7571[_0xa243('0x47')])?ut[_0xa243('0x109')](_0xe7571[_0xa243('0x47')][_0xa243('0x4a')],_0xe7571[_0xa243('0x10a')],_0xe7571[_0xa243('0x10b')]>0x0?ut[_0xa243('0x10c')](_0xe7571[_0xa243('0x10d')],_0xe7571['dialRandomLastDigitCallerIdNumber']):_0xe7571[_0xa243('0x10d')]):ut['getCallerId'](_['isNil'](_0xe7571[_0xa243('0x8e')])?_0xe7571[_0xa243('0x47')][_0xa243('0x4a')]:_0xe7571['TrunkBackup'][_0xa243('0x4a')],_0xe7571[_0xa243('0x10a')],_0xe7571[_0xa243('0x10b')]>0x0?ut[_0xa243('0x10c')](_0xe7571[_0xa243('0x10d')],_0xe7571[_0xa243('0x10b')]):_0xe7571[_0xa243('0x10d')]);if(_0x37e44a){_0x23cb1d[_0xa243('0x10e')]=ut[_0xa243('0x10f')](_0x37e44a);_0x23cb1d[_0xa243('0x110')]=ut[_0xa243('0x111')](_0x37e44a);}var _0x5bf92a=ut[_0xa243('0x112')](_0xe7571,_0x462b39,_0x14139b,_0x37e44a,_0x4034f1,_0x23cb1d);_['merge'](_0x23cb1d,ut['toLowerVariables'](_0x5bf92a));_0x23cb1d[_0xa243('0x80')]=moment()[_0xa243('0x4f')](_0xa243('0x81'));ami[_0xa243('0x6c')](ut[_0xa243('0x113')](_0x23cb1d,_0xe7571,_0x5bf92a,_0x23cb1d['activeContact'],_0x1234e9))[_0xa243('0x79')](function(_0x1fb4e5){_0xe7571[_0xa243('0x43')]+=0x1;logger['info'](_0xa243('0x114'),_0x4034f1,'\x20Queue',_0xe7571['name'],_0xa243('0x65'),_0xe7571[_0xa243('0x43')]);_0x3a0d63(_0x1fb4e5);})['catch'](function(_0x388247){ut['logAgent'](_0x23cb1d,0xe,_0xa243('0x115'));rpcDb[_0xa243('0xd0')](_0x23cb1d,_0xa243('0x116'));_0x5e514e(_0x388247);});});};Preview[_0xa243('0x5a')][_0xa243('0x1e')]=function(_0x4f979d){if(this[_0xa243('0x15')][_0x4f979d['linkedid']]){this['actions'][_0x4f979d[_0xa243('0x96')]][_0xa243('0x6d')]=_0x4f979d[_0xa243('0x6d')];}};Preview[_0xa243('0x5a')]['syncOriginateResponse']=function(_0x5aeb60){var _0x148798=this;var _0x3f1966=this[_0xa243('0x15')][_0x5aeb60['actionid']];if(_0x3f1966){if(_0x3f1966['lookAgent']&&this[_0xa243('0x16')][_0x3f1966[_0xa243('0xde')]]){ut[_0xa243('0x117')](_0x3f1966,this['agents'][_0x3f1966[_0xa243('0xde')]]['name'],this[_0xa243('0x16')][_0x3f1966[_0xa243('0xde')]]['id']);}var _0x22322c=_['clone'](_0x3f1966);_0x22322c[_0xa243('0x118')]=moment()[_0xa243('0x4f')](_0xa243('0x81'));var _0x43005b=_0x148798[_0xa243('0x24')][_0x3f1966[_0xa243('0x67')]];if(ut[_0xa243('0x119')](_0x5aeb60['response'])){if(_0x3f1966['unlockAgent']){rpcDb[_0xa243('0xc2')](_0x3f1966[_0xa243('0xc3')]);}if(_0x3f1966[_0xa243('0xb2')]){rpcDb['disableContact'](_0x3f1966[_0xa243('0xc3')]);}ami[_0xa243('0x25')](_0xa243('0x11a'),ut[_0xa243('0x9a')](_0x3f1966,_0xa243('0x11b')));this[_0xa243('0xcd')](_0x22322c,_0x43005b,_0x5aeb60);}else{_0x3f1966['starttime']=moment()['format'](_0xa243('0x81'));ut['logAgent'](_0x22322c,0x4,_0xa243('0xa0'));rpcDb[_0xa243('0xd0')](_0x22322c,_0xa243('0x11c'));}}};Preview[_0xa243('0x5a')][_0xa243('0x11d')]=function(_0x28cb14){var _0x47bc53=this;var _0x5eb56f=this['actions'][_0x28cb14[_0xa243('0x96')]];var _0xd8a13c;if(_0x5eb56f){_0xd8a13c=this[_0xa243('0x24')][_0x5eb56f[_0xa243('0x67')]];logger['info']('[syncHangup][talking]',_0x28cb14[_0xa243('0x96')],_0xa243('0xa8'),_0xd8a13c[_0xa243('0x48')],_0xa243('0x66'),_0xd8a13c[_0xa243('0x52')]);}if(this[_0xa243('0x15')][_0x28cb14[_0xa243('0x96')]]&&_0x28cb14[_0xa243('0x96')]!==_0x28cb14['uniqueid']){if(_0x28cb14[_0xa243('0x11e')]==='16'&&this[_0xa243('0x15')][_0x28cb14[_0xa243('0x96')]][_0xa243('0x71')]){this[_0xa243('0x8f')](_0x28cb14,_0x28cb14[_0xa243('0x96')],_0x28cb14[_0xa243('0x11e')]);}else if(this[_0xa243('0x15')][_0x28cb14[_0xa243('0x96')]]['dialAnswer']){logger[_0xa243('0x63')](_0xa243('0x11f'),_0x28cb14[_0xa243('0x96')],_0x28cb14['cause'],_0xa243('0xa8'),_0xd8a13c[_0xa243('0x48')],_0xa243('0x66'),_0xd8a13c[_0xa243('0x52')]);this[_0xa243('0x8f')](_0x28cb14,_0x28cb14[_0xa243('0x96')],_0x28cb14['cause']);}}else if(_0x5eb56f&&_[_0xa243('0x62')](_0x5eb56f[_0xa243('0x120')])&&_0xd8a13c[_0xa243('0x121')]&&_0x28cb14[_0xa243('0x96')]===_0x28cb14[_0xa243('0xa7')]&&_[_0xa243('0x62')](_0x28cb14[_0xa243('0x122')])&&_0x28cb14[_0xa243('0x11e')]==='16'&&_0x28cb14[_0xa243('0x123')]==='6'&&_[_0xa243('0xce')](_0x5eb56f[_0xa243('0x124')])){if(_0x5eb56f[_0xa243('0xb1')]){rpcDb[_0xa243('0xc2')](_0x5eb56f[_0xa243('0xc3')]);}if(_0x5eb56f[_0xa243('0xb2')]){rpcDb['disableContact'](_0x5eb56f['idContact']);}_0x28cb14[_0xa243('0x122')]='22';this[_0xa243('0xcd')](_0x5eb56f,_0xd8a13c,_0x28cb14);}else if(_0x5eb56f&&_0x5eb56f[_0xa243('0x124')]){if(_0x28cb14[_0xa243('0x11e')]==='16'&&this['actions'][_0x28cb14['linkedid']][_0xa243('0x71')]){logger[_0xa243('0x63')](_0xa243('0x125'),_0x28cb14[_0xa243('0x96')],_0x28cb14[_0xa243('0x11e')],_0xa243('0xa8'),_0xd8a13c[_0xa243('0x48')],_0xa243('0x66'),_0xd8a13c['pTalking']);this['callProgressDetectingCustomer'](_0x28cb14,_0x28cb14['linkedid'],_0x28cb14[_0xa243('0x11e')]);}else if(this['actions'][_0x28cb14[_0xa243('0x96')]][_0xa243('0x71')]){logger[_0xa243('0x63')]('[syncHangup][talking][cause]',_0x28cb14[_0xa243('0x96')],_0x28cb14['cause'],'\x20Queue',_0xd8a13c[_0xa243('0x48')],_0xa243('0x66'),_0xd8a13c[_0xa243('0x52')]);this[_0xa243('0x8f')](_0x28cb14,_0x28cb14[_0xa243('0x96')],_0x28cb14[_0xa243('0x11e')]);}}};Preview[_0xa243('0x5a')]['syncDialEnd']=function(_0x1cfe5d){if(this[_0xa243('0x15')][_0x1cfe5d['destlinkedid']]&&_0x1cfe5d[_0xa243('0x126')]!==_0x1cfe5d[_0xa243('0x127')]){this['callProgressDetectingCustomer'](_0x1cfe5d,_0x1cfe5d['destlinkedid'],_0x1cfe5d[_0xa243('0xc9')]);}};Preview[_0xa243('0x5a')][_0xa243('0x128')]=function(_0x586277){if(this[_0xa243('0x15')][_0x586277[_0xa243('0x96')]]&&_0x586277['linkedid']!==_0x586277[_0xa243('0xa7')]&&!this[_0xa243('0x15')][_0x586277[_0xa243('0x96')]][_0xa243('0x71')]){if(_0x586277[_0xa243('0x11e')]==='1'){this[_0xa243('0x8f')](_0x586277,_0x586277[_0xa243('0x96')],_0x586277[_0xa243('0x11e')]);}}};Preview[_0xa243('0x5a')][_0xa243('0x129')]=function(_0x4263b7,_0x388a8f,_0xab92b8){if(this['actions'][_0x4263b7]){if(_[_0xa243('0x62')](this[_0xa243('0x15')][_0x4263b7]['variables'])){this[_0xa243('0x15')][_0x4263b7][_0xa243('0x12a')]={};}this[_0xa243('0x15')][_0x4263b7][_0xa243('0x12a')][_0x388a8f]=_0xab92b8;}};Preview[_0xa243('0x5a')][_0xa243('0x20')]=function(_0x44dcff){try{if(!_[_0xa243('0x62')](_0x44dcff)){if(ut[_0xa243('0x12b')](_[_0xa243('0x12c')](_0x44dcff['variable'])[0x0])){this[_0xa243('0x129')](_0x44dcff[_0xa243('0xa7')],_[_0xa243('0x12c')](_0x44dcff[_0xa243('0x12d')])[0x0],_0x44dcff['value']);}}}catch(_0x48f867){logger[_0xa243('0x12e')](_0xa243('0x12f'),util[_0xa243('0x130')](_0x48f867,{'showHidden':![],'depth':null}));}};Preview[_0xa243('0x5a')][_0xa243('0x21')]=function(_0x2b011a){if(_0x2b011a){if(this[_0xa243('0x15')][_0x2b011a['transfertargetlinkedid']]){this[_0xa243('0x15')][_0x2b011a[_0xa243('0x131')]]['transfer']=!![];}}};Preview[_0xa243('0x5a')][_0xa243('0x22')]=function(_0x3f19a1){if(_0x3f19a1){if(this[_0xa243('0x15')][_0x3f19a1['transfererlinkedid']]){this['actions'][_0x3f19a1[_0xa243('0x132')]][_0xa243('0x124')]=!![];}}};module[_0xa243('0x133')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 5bc3381..f8221df 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 _0x5fc3=['getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20'];(function(_0x26adc4,_0xb6ab14){var _0xd8c069=function(_0x530937){while(--_0x530937){_0x26adc4['push'](_0x26adc4['shift']());}};_0xd8c069(++_0xb6ab14);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2ec2bf,_0x64e983){_0x2ec2bf=_0x2ec2bf-0x0;var _0x2c279c=_0x5fc3[_0x2ec2bf];return _0x2c279c;};'use strict';var util=require(_0x35fc('0x0'));var BPromise=require(_0x35fc('0x1'));var logger=require('../../../config/logger')(_0x35fc('0x2'));var _=require(_0x35fc('0x3'));var cmHopper=require(_0x35fc('0x4'));var cmHopperFinal=require(_0x35fc('0x5'));var cmHopperHistory=require(_0x35fc('0x6'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x35fc('0x7'));var agentReportPreview=require(_0x35fc('0x8'));var voiceQueueReport=require(_0x35fc('0x9'));function loggerCatch(_0x5b85ad){return function(_0x5754be){logger[_0x35fc('0xa')](_0x5b85ad,util['inspect'](_0x5754be,{'showHidden':![],'depth':null}));};}function create(_0x16e153){return BPromise[_0x35fc('0xb')]()[_0x35fc('0xc')](cmHopperHistory[_0x35fc('0xd')](_0x16e153))[_0x35fc('0xe')](loggerCatch(_0x35fc('0xf')));}function createAgent(_0x2051ab){return BPromise['resolve']()[_0x35fc('0xc')](agentReportPreview[_0x35fc('0xd')](_0x2051ab))['catch'](loggerCatch(_0x35fc('0xf')));}function moveContact(_0x33f491){return BPromise['resolve']()[_0x35fc('0xc')](cmHopper[_0x35fc('0x10')](_0x33f491,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x35fc('0x11')]=function(_0x5d462a){return BPromise[_0x35fc('0xb')]()[_0x35fc('0xc')](cmHopperBlack[_0x35fc('0x11')](_0x5d462a))[_0x35fc('0xe')](loggerCatch(_0x35fc('0x12')));};exports['getContactPreview']=function(_0x59507a){return BPromise['resolve']()['then'](cmHopper[_0x35fc('0x13')](_0x59507a))[_0x35fc('0xe')](loggerCatch(_0x35fc('0x14')));};exports[_0x35fc('0xd')]=function(_0x227a49,_0x1121fa){create(_0x227a49)['catch'](loggerCatch(_0x1121fa));moveContact(_0x227a49)[_0x35fc('0xe')](loggerCatch(_0x1121fa));};exports[_0x35fc('0x15')]=function(_0x553677,_0x41e165){createAgent(_0x553677)[_0x35fc('0xe')](loggerCatch(_0x41e165));};exports[_0x35fc('0x16')]=function(_0x5f56c6,_0x1a86e9){create(_0x5f56c6)[_0x35fc('0xe')](loggerCatch(_0x1a86e9));};exports[_0x35fc('0x17')]=function(_0x488234,_0x402cff){moveContact(_0x488234)[_0x35fc('0xe')](loggerCatch(_0x402cff));};exports[_0x35fc('0x18')]=function(_0x251a1f,_0x20ffde,_0x21f1a9){if(_0x20ffde){_0x251a1f[_0x35fc('0x19')]=null;}if(_0x21f1a9){_0x251a1f[_0x35fc('0x1a')]=![];}return BPromise[_0x35fc('0xb')]()[_0x35fc('0xc')](cmHopper['rescheduleContact'](_0x251a1f))[_0x35fc('0xe')](loggerCatch(_0x35fc('0x1b')));};exports[_0x35fc('0x1c')]=function(_0x2d8183){return BPromise[_0x35fc('0xb')]()['then'](cmHopper[_0x35fc('0x1c')](_0x2d8183))[_0x35fc('0xe')](loggerCatch('[countReScheduled]\x20'));};exports[_0x35fc('0x1d')]=function(_0x5a93df){return BPromise[_0x35fc('0xb')]()['then'](cmHopper[_0x35fc('0x1d')]({'UserId':null},_0x5a93df,0x1))['catch'](loggerCatch(_0x35fc('0x1e')));};exports[_0x35fc('0x1f')]=function(_0x5cb986){return BPromise['resolve']()[_0x35fc('0xc')](cmHopper['unlockContact']({'active':![]},_0x5cb986,0x1))[_0x35fc('0xe')](loggerCatch(_0x35fc('0x20')));};exports['crateCustomerReportQueue']=function(_0x26b7cb){var _0x645eac={};_0x645eac[_0x35fc('0x21')]=_0x26b7cb[_0x35fc('0x21')];_0x645eac[_0x35fc('0x22')]=_0x26b7cb[_0x35fc('0x22')];_0x645eac[_0x35fc('0x23')]=_0x26b7cb[_0x35fc('0x23')];_0x645eac['calleridname']=_0x26b7cb[_0x35fc('0x24')];_0x645eac[_0x35fc('0x25')]=_0x26b7cb[_0x35fc('0x25')];_0x645eac['queuecallerjoinAt']=_0x26b7cb[_0x35fc('0x26')];_0x645eac[_0x35fc('0x27')]=_0x26b7cb[_0x35fc('0x26')];_0x645eac[_0x35fc('0x28')]=0x1;_0x645eac[_0x35fc('0x29')]=_0x26b7cb[_0x35fc('0x2a')];_0x645eac[_0x35fc('0x2b')]=_0x26b7cb[_0x35fc('0x2c')];_0x645eac[_0x35fc('0x2d')]=_0x35fc('0x2e');_0x645eac['exten']='xcally-motion-preview';_0x645eac[_0x35fc('0x2f')]=0x0;_0x645eac['assigned']=0x1;_0x645eac[_0x35fc('0x30')]=_0x26b7cb[_0x35fc('0x2c')];_0x645eac[_0x35fc('0x31')]=_0x35fc('0x32');return BPromise[_0x35fc('0xb')]()[_0x35fc('0xc')](voiceQueueReport['create'](_0x645eac))[_0x35fc('0xe')](loggerCatch(_0x35fc('0x33')));};exports[_0x35fc('0x34')]=function(_0x4441d8,_0x2bbd36){return BPromise[_0x35fc('0xb')]()['then'](cmHopper[_0x35fc('0x34')](_0x4441d8,_0x2bbd36))[_0x35fc('0xe')](loggerCatch(_0x35fc('0x35')));};exports['rescheduleContactInQueue']=function(_0x2c657d){return BPromise['resolve']()[_0x35fc('0xc')](cmHopper[_0x35fc('0x18')](_0x2c657d,!![],!![]))[_0x35fc('0xe')](loggerCatch(_0x35fc('0x36')));}; \ No newline at end of file +var _0x207c=['checkIsBlackList','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','error','inspect','resolve','then','createHistory','[createHistory]\x20','catch','[moveContactManagedDialer]\x20'];(function(_0x3ca40b,_0x10a7ba){var _0x49342c=function(_0xa46e53){while(--_0xa46e53){_0x3ca40b['push'](_0x3ca40b['shift']());}};_0x49342c(++_0x10a7ba);}(_0x207c,0x1e8));var _0xc207=function(_0x4fab1e,_0x34b507){_0x4fab1e=_0x4fab1e-0x0;var _0x59bf51=_0x207c[_0x4fab1e];return _0x59bf51;};'use strict';var util=require('util');var BPromise=require(_0xc207('0x0'));var logger=require(_0xc207('0x1'))(_0xc207('0x2'));var _=require(_0xc207('0x3'));var cmHopper=require(_0xc207('0x4'));var cmHopperFinal=require(_0xc207('0x5'));var cmHopperHistory=require(_0xc207('0x6'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xc207('0x7'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x55023e){return function(_0xc88789){logger[_0xc207('0x8')](_0x55023e,util[_0xc207('0x9')](_0xc88789,{'showHidden':![],'depth':null}));};}function create(_0x59ff6f){return BPromise[_0xc207('0xa')]()[_0xc207('0xb')](cmHopperHistory[_0xc207('0xc')](_0x59ff6f))['catch'](loggerCatch(_0xc207('0xd')));}function createAgent(_0x817576){return BPromise[_0xc207('0xa')]()[_0xc207('0xb')](agentReportPreview[_0xc207('0xc')](_0x817576))[_0xc207('0xe')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x574425){return BPromise['resolve']()[_0xc207('0xb')](cmHopper['moveContactManagedDialer'](_0x574425,!![]))[_0xc207('0xe')](loggerCatch(_0xc207('0xf')));}exports['checkIsBlackList']=function(_0x3e1108){return BPromise[_0xc207('0xa')]()[_0xc207('0xb')](cmHopperBlack[_0xc207('0x10')](_0x3e1108))[_0xc207('0xe')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xc207('0x11')]=function(_0x3c77b7){return BPromise[_0xc207('0xa')]()[_0xc207('0xb')](cmHopper['getContactPreview'](_0x3c77b7))['catch'](loggerCatch('[getContactPreview]\x20'));};exports[_0xc207('0xc')]=function(_0x6e793d,_0x3d9c7b){create(_0x6e793d)[_0xc207('0xe')](loggerCatch(_0x3d9c7b));moveContact(_0x6e793d)['catch'](loggerCatch(_0x3d9c7b));};exports[_0xc207('0x12')]=function(_0x282595,_0x217d5e){createAgent(_0x282595)['catch'](loggerCatch(_0x217d5e));};exports[_0xc207('0x13')]=function(_0x488cc0,_0x42c8ba){create(_0x488cc0)[_0xc207('0xe')](loggerCatch(_0x42c8ba));};exports[_0xc207('0x14')]=function(_0x461f6a,_0xce0770){moveContact(_0x461f6a)[_0xc207('0xe')](loggerCatch(_0xce0770));};exports[_0xc207('0x15')]=function(_0x464dea,_0x212005,_0x2bd2eb){if(_0x212005){_0x464dea[_0xc207('0x16')]=null;}if(_0x2bd2eb){_0x464dea[_0xc207('0x17')]=![];}return BPromise[_0xc207('0xa')]()['then'](cmHopper[_0xc207('0x15')](_0x464dea))['catch'](loggerCatch(_0xc207('0x18')));};exports[_0xc207('0x19')]=function(_0x1eabe8){return BPromise[_0xc207('0xa')]()[_0xc207('0xb')](cmHopper[_0xc207('0x19')](_0x1eabe8))[_0xc207('0xe')](loggerCatch(_0xc207('0x1a')));};exports[_0xc207('0x1b')]=function(_0x2385f7){return BPromise[_0xc207('0xa')]()[_0xc207('0xb')](cmHopper[_0xc207('0x1b')]({'UserId':null},_0x2385f7,0x1))[_0xc207('0xe')](loggerCatch(_0xc207('0x1c')));};exports['disableContact']=function(_0x1e1440){return BPromise['resolve']()['then'](cmHopper[_0xc207('0x1b')]({'active':![]},_0x1e1440,0x1))[_0xc207('0xe')](loggerCatch(_0xc207('0x1d')));};exports[_0xc207('0x1e')]=function(_0x6a653d){var _0x478af7={};_0x478af7[_0xc207('0x1f')]=_0x6a653d[_0xc207('0x1f')];_0x478af7[_0xc207('0x20')]=_0x6a653d[_0xc207('0x20')];_0x478af7[_0xc207('0x21')]=_0x6a653d[_0xc207('0x21')];_0x478af7[_0xc207('0x22')]=_0x6a653d[_0xc207('0x22')];_0x478af7[_0xc207('0x23')]=_0x6a653d[_0xc207('0x23')];_0x478af7[_0xc207('0x24')]=_0x6a653d[_0xc207('0x25')];_0x478af7[_0xc207('0x26')]=_0x6a653d['answertime'];_0x478af7[_0xc207('0x27')]=0x1;_0x478af7[_0xc207('0x28')]=_0x6a653d[_0xc207('0x29')];_0x478af7[_0xc207('0x2a')]=_0x6a653d[_0xc207('0x2b')];_0x478af7[_0xc207('0x2c')]='from-sip';_0x478af7[_0xc207('0x2d')]=_0xc207('0x2e');_0x478af7[_0xc207('0x2f')]=0x0;_0x478af7[_0xc207('0x30')]=0x1;_0x478af7['lastAssignedTo']=_0x6a653d[_0xc207('0x2b')];_0x478af7[_0xc207('0x31')]=_0xc207('0x32');return BPromise[_0xc207('0xa')]()[_0xc207('0xb')](voiceQueueReport[_0xc207('0x33')](_0x478af7))[_0xc207('0xe')](loggerCatch(_0xc207('0x34')));};exports[_0xc207('0x35')]=function(_0x557d5d,_0x48d8a4){return BPromise[_0xc207('0xa')]()[_0xc207('0xb')](cmHopper[_0xc207('0x35')](_0x557d5d,_0x48d8a4))[_0xc207('0xe')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xc207('0x36')]=function(_0x433c0f){return BPromise[_0xc207('0xa')]()[_0xc207('0xb')](cmHopper[_0xc207('0x15')](_0x433c0f,!![],!![]))['catch'](loggerCatch(_0xc207('0x37')));}; \ 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 fe6133c..d142478 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 _0x0a6d=['ringtime','logLookAgent','membername','UserId','logCustomer','talktime','isFailure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','\x22%s\x22\x20<%s>','from-sip','countbusyretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','buildAcw','agentReadyId','status','reachable','push','getDiff','diff','seconds','CampaignId','filterKey','type','campaigntype','dialAnswer','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','extractCalleridName','match','util','lodash','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','loggerCatch','inspect','logger','info','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','createdAt','updatedAt','XMD-','toLowerVariables','toLower','updateOriginated','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','endtime','logAgent','responsetime'];(function(_0x32a81f,_0x4eee66){var _0x5b67a2=function(_0x35d368){while(--_0x35d368){_0x32a81f['push'](_0x32a81f['shift']());}};_0x5b67a2(++_0x4eee66);}(_0x0a6d,0xd1));var _0xd0a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0a6d[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xd0a6('0x0'));var _=require(_0xd0a6('0x1'));var moment=require('moment');var logger=require(_0xd0a6('0x2'))(_0xd0a6('0x3'));var ipAgi=process[_0xd0a6('0x4')][_0xd0a6('0x5')]||'127.0.0.1';function getSeconds(_0x1c609b,_0x41edb2){var _0x2c7b71=moment(_0x1c609b)[_0xd0a6('0x6')](0x0);var _0x1f22f0=moment(_0x41edb2)['milliseconds'](0x0);return _0x2c7b71['diff'](_0x1f22f0,'seconds');}exports[_0xd0a6('0x7')]=function(_0x55b59c){return function(_0x1c9ed4){logger['error'](_0x55b59c,util[_0xd0a6('0x8')](_0x1c9ed4,{'showHidden':![],'depth':null}));};};exports[_0xd0a6('0x9')]=function(_0x281221,_0x3ff58b){logger[_0xd0a6('0xa')](_0x281221,util[_0xd0a6('0x8')](_0x3ff58b,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x155c2e,_0x1c2a5e){logger['error'](_0x155c2e,util[_0xd0a6('0x8')](_0x1c2a5e,{'showHidden':![],'depth':null}));};exports[_0xd0a6('0xb')]=function(_0x41c0c5){return function(_0x20f586){logger[_0xd0a6('0xa')](_0x41c0c5,util[_0xd0a6('0x8')](_0x20f586,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x4c7710,_0x5dccff,_0x364748){return{'message':_0x4c7710,'unlock':_0x5dccff,'active':_0x364748};};exports[_0xd0a6('0xc')]=function(_0x346aee,_0xca6efb,_0x287249){if(!_[_0xd0a6('0xd')](_0x287249)&&_0xd0a6('0xe')===typeof _0x287249&&!_[_0xd0a6('0xf')](_0x287249)){if(!_[_0xd0a6('0xd')](_0xca6efb)&&_0xd0a6('0xe')===typeof _0xca6efb&&!_[_0xd0a6('0xf')](_0xca6efb)){return util[_0xd0a6('0x10')]('\x22%s\x22\x20<%s>',_0xca6efb,_0x287249);}return util['format']('\x22%s\x22\x20<%s>',_0x287249,_0x287249);}if(!_[_0xd0a6('0xd')](_0x346aee)&&_0xd0a6('0xe')===typeof _0x346aee&&!_[_0xd0a6('0xf')](_0x346aee)){return _0x346aee;}return _0xd0a6('0x11');};exports[_0xd0a6('0x12')]=function(_0x151ba6){if(_['isNil'](_0x151ba6)){return![];}return _0x151ba6;};exports[_0xd0a6('0x13')]=function(_0x3668a6,_0x5bfff3,_0xc8b629,_0x1cf96f,_0x134582,_0x5e9111){var _0x393867={'XMD-QUEUE':_0x5bfff3[_0xd0a6('0x14')]?_0x5bfff3['Queue'][_0xd0a6('0x15')]:'','XMD-CALLERID':_0x1cf96f,'XMD-CALLERID-PREVIEW':_0x5e9111?util[_0xd0a6('0x10')]('\x22%s\x22\x20<%s>',_0x5e9111[_0xd0a6('0x16')],_0x5e9111[_0xd0a6('0x17')]):_0x1cf96f,'XMD-DIALID':_0x134582,'XMD-CONTACTID':_0x5bfff3[_0xd0a6('0x18')],'XMD-CDRTYPE':_0xd0a6('0x19'),'CALLERID(all)':_0x1cf96f,'XMD-VOICEQUEUEID':_0x5bfff3[_0xd0a6('0x1a')],'XMD-DIALCHANNEL':_0xc8b629,'XMD-DIALTIMEOUT':_0x3668a6[_0xd0a6('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0xd0a6('0x10')](_0xd0a6('0x1c'),_0x3668a6['dialQueueProject2']?'g':'',_['isEmpty'](_0x3668a6[_0xd0a6('0x1d')])?'':_0xd0a6('0x1e')),'XMD-DIALURL':_0x3668a6['dialPreviewUrl']||'','XMD-AGI':_0x3668a6[_0xd0a6('0x1f')]?util[_0xd0a6('0x10')](_0xd0a6('0x20'),ipAgi,_0x3668a6['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x3668a6[_0xd0a6('0x21')]?util[_0xd0a6('0x10')](_0xd0a6('0x20'),ipAgi,_0x3668a6[_0xd0a6('0x21')]):_0xd0a6('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x5e9111?_0x5e9111[_0xd0a6('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x5e9111?_0x5e9111[_0xd0a6('0x24')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0xd0a6('0xf')](_0x3668a6[_0xd0a6('0x1d')])){_0x393867[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x3668a6[_0xd0a6('0x1d')];_0x393867[util[_0xd0a6('0x10')]('%s',_0xd0a6('0x25'))]=_0x134582;}if(_0x5bfff3&&_0x5bfff3['Contact']){for(var _0x3a4d5f in _0x5bfff3[_0xd0a6('0x26')]){if(_0x5bfff3[_0xd0a6('0x26')][_0xd0a6('0x27')](_0x3a4d5f)){if(!_[_0xd0a6('0x28')](_0x5bfff3[_0xd0a6('0x26')][_0x3a4d5f])&&_0x3a4d5f!=='id'&&_0x3a4d5f!=='tags'&&_0x3a4d5f!==_0xd0a6('0x29')&&_0x3a4d5f!==_0xd0a6('0x2a')){_0x393867[util[_0xd0a6('0x10')]('%s%s',_0xd0a6('0x2b'),_['toUpper'](_0x3a4d5f))]=_0x5bfff3[_0xd0a6('0x26')][_0x3a4d5f];}}}}return _0x393867;};exports[_0xd0a6('0x2c')]=function(_0x2a89e3){var _0x5c332c={};for(var _0x27f90c in _0x2a89e3){if(_0x2a89e3[_0xd0a6('0x27')](_0x27f90c)){_0x5c332c[util[_0xd0a6('0x10')]('%s',_[_0xd0a6('0x2d')](_0x27f90c))]=_0x2a89e3[_0x27f90c];}}return{'variables':_0x5c332c};};exports[_0xd0a6('0x2e')]=function(_0x170a0e,_0x506578){if(!_[_0xd0a6('0x28')](_0x170a0e)){if(_0x170a0e[_0xd0a6('0x27')]('originated')){if(_0x170a0e[_0xd0a6('0x2f')]>0x0){_0x170a0e['originated']-=0x1;}else{logger[_0xd0a6('0x30')](_0xd0a6('0x31'),_0x506578);}}}else{logger[_0xd0a6('0x30')](_0xd0a6('0x32'),_0x506578);}};exports[_0xd0a6('0x33')]=function(_0x500eb9){var _0xc346fb=moment()[_0xd0a6('0x10')](_0xd0a6('0x34'));_0x500eb9[_0xd0a6('0x35')]=0xd;_0x500eb9[_0xd0a6('0x36')]='Blacklist';_0x500eb9[_0xd0a6('0x37')]=_0xc346fb;_0x500eb9['responsetime']=_0xc346fb;_0x500eb9[_0xd0a6('0x38')]=_0xc346fb;};exports[_0xd0a6('0x39')]=function(_0x19e106,_0x555530,_0x550fc5){var _0x104ddf=moment()[_0xd0a6('0x10')](_0xd0a6('0x34'));_0x19e106[_0xd0a6('0x35')]=_0x555530;_0x19e106['statedesc']=_0x550fc5;_0x19e106[_0xd0a6('0x3a')]=_0x104ddf;_0x19e106[_0xd0a6('0x3b')]=getSeconds(_0x19e106[_0xd0a6('0x3a')],_0x19e106[_0xd0a6('0x37')]);};exports[_0xd0a6('0x3c')]=function(_0x5ed7f5,_0x42dc14,_0x322c15){_0x5ed7f5[_0xd0a6('0x3d')]=_0x42dc14;_0x5ed7f5[_0xd0a6('0x3e')]=_0x322c15;};exports[_0xd0a6('0x3f')]=function(_0x1eb1bc,_0x827589,_0x1be1fe){var _0xd4bf20=moment()[_0xd0a6('0x10')](_0xd0a6('0x34'));_0x1eb1bc['state']=_0x827589;_0x1eb1bc[_0xd0a6('0x36')]=_0x1be1fe;_0x1eb1bc[_0xd0a6('0x3a')]=_0x1eb1bc['responsetime']?_0x1eb1bc[_0xd0a6('0x3a')]:_0xd4bf20;_0x1eb1bc['endtime']=_0x1eb1bc['endtime']?_0x1eb1bc[_0xd0a6('0x38')]:_0xd4bf20;_0x1eb1bc[_0xd0a6('0x3b')]=getSeconds(_0x1eb1bc[_0xd0a6('0x3a')]||0x0,_0x1eb1bc[_0xd0a6('0x37')]||0x0);_0x1eb1bc[_0xd0a6('0x40')]=_0x1eb1bc['answertime']?getSeconds(_0x1eb1bc[_0xd0a6('0x38')],_0x1eb1bc['answertime']):0x0;};exports[_0xd0a6('0x41')]=function(_0x21d9f7){return _0x21d9f7==='Failure';};exports[_0xd0a6('0x42')]=function(_0x452e6a,_0x248740,_0x56aa67,_0x3117bf,_0x4f67fb){var _0x481559=_0x3117bf?_0xd0a6('0x43'):_0x452e6a['calleridname'];_0x481559=_0x4f67fb?_0xd0a6('0x44'):_0x481559;return{'actionid':_0x452e6a[_0xd0a6('0x45')],'action':_0xd0a6('0x46'),'channel':_0x452e6a[_0xd0a6('0x47')],'callerid':util[_0xd0a6('0x10')](_0xd0a6('0x48'),_0x481559,_0x452e6a['calleridnum']),'Exten':'xcally-motion-preview','Context':_0xd0a6('0x49'),'Priority':'1','variable':_0x56aa67,'timeout':(_0x248740['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x452e6a[_0xd0a6('0x45')]};};exports['totalGlobal']=function(_0x45fd24){return _0x45fd24[_0xd0a6('0x4a')]+_0x45fd24['countcongestionretry']+_0x45fd24[_0xd0a6('0x4b')];};exports[_0xd0a6('0x4c')]=function(_0x6ba5f3){var _0x429b6f=_[_0xd0a6('0x4d')](_0x6ba5f3);_0x429b6f[_0xd0a6('0x35')]=0xf;_0x429b6f[_0xd0a6('0x36')]=_0xd0a6('0x4e');return _0x429b6f;};exports[_0xd0a6('0x4f')]=function(_0x1d4f7a,_0x4bc168,_0x580085){var _0x444230={};_0x444230[_0x4bc168]=_0x1d4f7a[_0x4bc168];_0x444230[_0xd0a6('0x50')]=![];_0x444230[_0xd0a6('0x51')]=moment()['add'](_0x580085,_0xd0a6('0x52'))[_0xd0a6('0x10')](_0xd0a6('0x34'));_0x444230[_0xd0a6('0x18')]=_0x1d4f7a[_0xd0a6('0x18')];_0x444230[_0xd0a6('0x53')]=_0x1d4f7a[_0xd0a6('0x53')];_0x444230[_0xd0a6('0x1a')]=_0x1d4f7a['VoiceQueueId']||undefined;return _0x444230;};exports[_0xd0a6('0x54')]=function(_0x5bf0a1,_0x1d3f81){if(!_[_0xd0a6('0x28')](_0x5bf0a1)){if(_0x5bf0a1[_0xd0a6('0x55')]>0x0){_0x5bf0a1[_0xd0a6('0x55')]-=0x1;}else{logger[_0xd0a6('0x30')](_0x1d3f81,_0xd0a6('0x56'));}}else{logger[_0xd0a6('0x30')](_0x1d3f81,_0xd0a6('0x57'));}};exports[_0xd0a6('0x58')]=function(_0x191da2){if(_0x191da2<=0x0){return!![];}return![];};exports['buildObj']=function(_0x10767e,_0x11b0a6){_0x10767e[_0xd0a6('0x59')]=_0x11b0a6;_0x10767e['name']=_0x10767e[_0xd0a6('0x5a')];_0x10767e[_0xd0a6('0x5b')]=_0x10767e[_0xd0a6('0x47')];return _0x10767e;};exports[_0xd0a6('0x5c')]=function(_0xfaa5fd){var _0x14a866={};_0x14a866[_0xd0a6('0x5a')]=_0xfaa5fd[_0xd0a6('0x5a')];_0x14a866[_0xd0a6('0x5b')]=_0xfaa5fd[_0xd0a6('0x47')];_0x14a866['uniqueid']=_0xfaa5fd[_0xd0a6('0x45')];return _0x14a866;};exports[_0xd0a6('0x5d')]=function(_0x55e0a8){var _0x4a0008=[];for(var _0x2bfae8 in _0x55e0a8){if(_0x55e0a8[_0xd0a6('0x27')](_0x2bfae8)){if(!_[_0xd0a6('0x28')](_0x55e0a8[_0x2bfae8])&&_0x55e0a8[_0x2bfae8][_0xd0a6('0x35')]==='not_inuse'&&_0x55e0a8[_0x2bfae8][_0xd0a6('0x5e')]===_0xd0a6('0x5f')){_0x4a0008[_0xd0a6('0x60')](_0x55e0a8[_0x2bfae8]['id']);}}}return _0x4a0008;};exports[_0xd0a6('0x61')]=function(_0x9af2a0){var _0x2cd551=moment()[_0xd0a6('0x6')](0x0);var _0x57e22d=moment(_0x9af2a0)['milliseconds'](0x0);return _0x2cd551[_0xd0a6('0x62')](_0x57e22d,_0xd0a6('0x63'));};exports['createBody']=function(_0x58adff){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x58adff['ContactId'],'ListId':_0x58adff[_0xd0a6('0x53')],'VoiceQueueId':_0x58adff[_0xd0a6('0x1a')]||undefined,'CampaignId':_0x58adff[_0xd0a6('0x64')]||undefined};};exports[_0xd0a6('0x65')]=function(_0x2a8bc8){if(_0x2a8bc8===_0xd0a6('0x45')||_0x2a8bc8==='idContact'||_0x2a8bc8===_0xd0a6('0x5a')||_0x2a8bc8===_0xd0a6('0x66')||_0x2a8bc8===_0xd0a6('0x67')||_0x2a8bc8===_0xd0a6('0x68')||_0x2a8bc8===_0xd0a6('0x3d')||_0x2a8bc8===_0xd0a6('0x47')||_0x2a8bc8===_0xd0a6('0x16')||_0x2a8bc8===_0xd0a6('0x50')||_0x2a8bc8==='calleridnum'||_0x2a8bc8===_0xd0a6('0x51')||_0x2a8bc8===_0xd0a6('0x4a')||_0x2a8bc8==='countcongestionretry'||_0x2a8bc8===_0xd0a6('0x4b')||_0x2a8bc8==='countglobal'||_0x2a8bc8===_0xd0a6('0x69')||_0x2a8bc8==='callbackuniqueid'||_0x2a8bc8===_0xd0a6('0x6a')||_0x2a8bc8===_0xd0a6('0x6b')||_0x2a8bc8===_0xd0a6('0x18')||_0x2a8bc8===_0xd0a6('0x53')||_0x2a8bc8===_0xd0a6('0x3e')||_0x2a8bc8==='VoiceQueueId'||_0x2a8bc8===_0xd0a6('0x6c')||_0x2a8bc8===_0xd0a6('0x6d')||_0x2a8bc8===_0xd0a6('0x6e')||_0x2a8bc8===_0xd0a6('0x6f')||_0x2a8bc8===_0xd0a6('0x70')||_0x2a8bc8==='xmd-dialurl'||_0x2a8bc8===_0xd0a6('0x71')||_0x2a8bc8===_0xd0a6('0x72')||_0x2a8bc8===_0xd0a6('0x73')||_0x2a8bc8==='xmd-dialchannel'||_0x2a8bc8===_0xd0a6('0x74')||_0x2a8bc8===_0xd0a6('0x75')||_0x2a8bc8===_0xd0a6('0x76')||_0x2a8bc8===_0xd0a6('0x77')||_0x2a8bc8===_0xd0a6('0x78')||_0x2a8bc8===_0xd0a6('0x79')||_0x2a8bc8==='rtpaudioqosbridged'||_0x2a8bc8===_0xd0a6('0x7a')||_0x2a8bc8==='rtpaudioqosjitterbridged'||_0x2a8bc8===_0xd0a6('0x7b')||_0x2a8bc8==='rtpaudioqoslossbridged'||_0x2a8bc8===_0xd0a6('0x7c')||_0x2a8bc8===_0xd0a6('0x7d')||_0x2a8bc8===_0xd0a6('0x79')||_0x2a8bc8===_0xd0a6('0x7e')||_0x2a8bc8===_0xd0a6('0x7a')||_0x2a8bc8==='rtpaudioqosjitterbridged'||_0x2a8bc8===_0xd0a6('0x7b')||_0x2a8bc8==='rtpaudioqoslossbridged'||_0x2a8bc8==='rtpaudioqosrtt'||_0x2a8bc8===_0xd0a6('0x7d')||_0x2a8bc8===_0xd0a6('0x7f')||_0x2a8bc8===_0xd0a6('0x80')||_0x2a8bc8===_0xd0a6('0x35')||_0x2a8bc8===_0xd0a6('0x36')){return![];}return!![];};exports[_0xd0a6('0x81')]=function(_0x28ee27,_0x14f7f7){var _0x1f9f58,_0x474005,_0x2be2e9;if(_0x14f7f7<=0x0){_0x14f7f7=0x1;}_0x1f9f58=new RegExp(_0xd0a6('0x82')+_0x14f7f7+'}$');_0x474005=Math[_0xd0a6('0x83')](0xa,_0x14f7f7-0x1);_0x2be2e9=Math[_0xd0a6('0x83')](0xa,_0x14f7f7)-0x1;return util['format']('%s',_['replace'](_0x28ee27,_0x1f9f58,_['random'](_0x474005,_0x2be2e9)));};exports[_0xd0a6('0x84')]=function(_0x5885d5){var _0x262325=_0x5885d5[_0xd0a6('0x85')](/"(.*?)"/);return _0x262325?_0x262325[0x1]:_0x5885d5;};exports['extractCalleridNumber']=function(_0x5c73b3){var _0x557e88=_0x5c73b3['match'](/<(.*?)>/);return _0x557e88?_0x557e88[0x1]:_0x5c73b3;}; \ No newline at end of file +var _0x8aaa=['_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','updateOriginated','[updateOriginated]\x20is\x20null\x20or\x20undefined','state','statedesc','Blacklist','responsetime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','logLookAgent','membername','logCustomer','endtime','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','Global','scheduledAt','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','interface','channelAgent','buildAcw','queue','agentReadyId','not_inuse','status','reachable','push','getDiff','diff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','active','countglobal','callback','recallme','UserId','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialoptions','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitter','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','loggerCatch','error','inspect','info','loggerError','message','getCallerId','string','isEmpty','isUndefined','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview'];(function(_0xe7b378,_0x4d8b70){var _0x1fa3fd=function(_0x302f7f){while(--_0x302f7f){_0xe7b378['push'](_0xe7b378['shift']());}};_0x1fa3fd(++_0x4d8b70);}(_0x8aaa,0x64));var _0xa8aa=function(_0x3806e6,_0x2f55d1){_0x3806e6=_0x3806e6-0x0;var _0x43aea8=_0x8aaa[_0x3806e6];return _0x43aea8;};'use strict';var util=require(_0xa8aa('0x0'));var _=require(_0xa8aa('0x1'));var moment=require(_0xa8aa('0x2'));var logger=require('../../../../config/logger')(_0xa8aa('0x3'));var ipAgi=process[_0xa8aa('0x4')][_0xa8aa('0x5')]||_0xa8aa('0x6');function getSeconds(_0x28fa1b,_0x3443c7){var _0x1ae929=moment(_0x28fa1b)[_0xa8aa('0x7')](0x0);var _0x5db8ce=moment(_0x3443c7)[_0xa8aa('0x7')](0x0);return _0x1ae929['diff'](_0x5db8ce,'seconds');}exports[_0xa8aa('0x8')]=function(_0x2339b3){return function(_0x5b180f){logger[_0xa8aa('0x9')](_0x2339b3,util[_0xa8aa('0xa')](_0x5b180f,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x57680d,_0x4dd431){logger[_0xa8aa('0xb')](_0x57680d,util[_0xa8aa('0xa')](_0x4dd431,{'showHidden':![],'depth':null}));};exports[_0xa8aa('0xc')]=function(_0x452020,_0x2df75f){logger[_0xa8aa('0x9')](_0x452020,util[_0xa8aa('0xa')](_0x2df75f,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x44213f){return function(_0x510048){logger[_0xa8aa('0xb')](_0x44213f,util[_0xa8aa('0xa')](_0x510048,{'showHidden':![],'depth':null}));};};exports[_0xa8aa('0xd')]=function(_0x4d6e8e,_0x5de739,_0x3593d3){return{'message':_0x4d6e8e,'unlock':_0x5de739,'active':_0x3593d3};};exports[_0xa8aa('0xe')]=function(_0x4ab18c,_0x45c9b8,_0xccf95f){if(!_['isUndefined'](_0xccf95f)&&_0xa8aa('0xf')===typeof _0xccf95f&&!_[_0xa8aa('0x10')](_0xccf95f)){if(!_[_0xa8aa('0x11')](_0x45c9b8)&&_0xa8aa('0xf')===typeof _0x45c9b8&&!_[_0xa8aa('0x10')](_0x45c9b8)){return util['format'](_0xa8aa('0x12'),_0x45c9b8,_0xccf95f);}return util[_0xa8aa('0x13')]('\x22%s\x22\x20<%s>',_0xccf95f,_0xccf95f);}if(!_[_0xa8aa('0x11')](_0x4ab18c)&&_0xa8aa('0xf')===typeof _0x4ab18c&&!_[_0xa8aa('0x10')](_0x4ab18c)){return _0x4ab18c;}return _0xa8aa('0x14');};exports[_0xa8aa('0x15')]=function(_0x5e4206){if(_[_0xa8aa('0x16')](_0x5e4206)){return![];}return _0x5e4206;};exports[_0xa8aa('0x17')]=function(_0x592755,_0x394a7f,_0x4f15ba,_0x170b86,_0x38f8b5,_0x188492){var _0x5d3d09={'XMD-QUEUE':_0x394a7f[_0xa8aa('0x18')]?_0x394a7f[_0xa8aa('0x18')][_0xa8aa('0x19')]:'','XMD-CALLERID':_0x170b86,'XMD-CALLERID-PREVIEW':_0x188492?util['format'](_0xa8aa('0x12'),_0x188492[_0xa8aa('0x1a')],_0x188492[_0xa8aa('0x1b')]):_0x170b86,'XMD-DIALID':_0x38f8b5,'XMD-CONTACTID':_0x394a7f[_0xa8aa('0x1c')],'XMD-CDRTYPE':_0xa8aa('0x1d'),'CALLERID(all)':_0x170b86,'XMD-VOICEQUEUEID':_0x394a7f[_0xa8aa('0x1e')],'XMD-DIALCHANNEL':_0x4f15ba,'XMD-DIALTIMEOUT':_0x592755[_0xa8aa('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0xa8aa('0x13')](_0xa8aa('0x20'),_0x592755[_0xa8aa('0x21')]?'g':'',_[_0xa8aa('0x10')](_0x592755[_0xa8aa('0x22')])?'':_0xa8aa('0x23')),'XMD-DIALURL':_0x592755[_0xa8aa('0x24')]||'','XMD-AGI':_0x592755[_0xa8aa('0x25')]?util[_0xa8aa('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x592755[_0xa8aa('0x25')]):'NONE','XMD-AGIAFTER':_0x592755[_0xa8aa('0x21')]?util[_0xa8aa('0x13')](_0xa8aa('0x26'),ipAgi,_0x592755['dialQueueProject2']):_0xa8aa('0x27'),'XMD-ORIGINATECALLERIDNUM':_0x188492?_0x188492[_0xa8aa('0x28')]:'','XMD-ORIGINATECALLERIDNAME':_0x188492?_0x188492[_0xa8aa('0x29')]:'','XMD-DESTINATION':_0xa8aa('0x2a')};if(!_['isEmpty'](_0x592755[_0xa8aa('0x22')])){_0x5d3d09[util[_0xa8aa('0x13')]('%s',_0xa8aa('0x2b'))]=_0x592755[_0xa8aa('0x22')];_0x5d3d09[util[_0xa8aa('0x13')]('%s',_0xa8aa('0x2c'))]=_0x38f8b5;}if(_0x394a7f&&_0x394a7f[_0xa8aa('0x2d')]){for(var _0x1c4a10 in _0x394a7f[_0xa8aa('0x2d')]){if(_0x394a7f[_0xa8aa('0x2d')]['hasOwnProperty'](_0x1c4a10)){if(!_['isNil'](_0x394a7f[_0xa8aa('0x2d')][_0x1c4a10])&&_0x1c4a10!=='id'&&_0x1c4a10!==_0xa8aa('0x2e')&&_0x1c4a10!==_0xa8aa('0x2f')&&_0x1c4a10!=='updatedAt'){_0x5d3d09[util['format'](_0xa8aa('0x30'),_0xa8aa('0x31'),_[_0xa8aa('0x32')](_0x1c4a10))]=_0x394a7f[_0xa8aa('0x2d')][_0x1c4a10];}}}}return _0x5d3d09;};exports[_0xa8aa('0x33')]=function(_0x21388d){var _0x465ed1={};for(var _0x35ce58 in _0x21388d){if(_0x21388d[_0xa8aa('0x34')](_0x35ce58)){_0x465ed1[util[_0xa8aa('0x13')]('%s',_[_0xa8aa('0x35')](_0x35ce58))]=_0x21388d[_0x35ce58];}}return{'variables':_0x465ed1};};exports[_0xa8aa('0x36')]=function(_0x18f53e,_0x2a107f){if(!_['isNil'](_0x18f53e)){if(_0x18f53e[_0xa8aa('0x34')]('originated')){if(_0x18f53e['originated']>0x0){_0x18f53e['originated']-=0x1;}else{logger[_0xa8aa('0x9')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x2a107f);}}}else{logger[_0xa8aa('0x9')](_0xa8aa('0x37'),_0x2a107f);}};exports['logBlacklist']=function(_0x2d44e2){var _0x977105=moment()[_0xa8aa('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d44e2[_0xa8aa('0x38')]=0xd;_0x2d44e2[_0xa8aa('0x39')]=_0xa8aa('0x3a');_0x2d44e2['starttime']=_0x977105;_0x2d44e2[_0xa8aa('0x3b')]=_0x977105;_0x2d44e2['endtime']=_0x977105;};exports[_0xa8aa('0x3c')]=function(_0x434514,_0x33dc68,_0x5e28c9){var _0x64c5c2=moment()[_0xa8aa('0x13')](_0xa8aa('0x3d'));_0x434514[_0xa8aa('0x38')]=_0x33dc68;_0x434514['statedesc']=_0x5e28c9;_0x434514['responsetime']=_0x64c5c2;_0x434514[_0xa8aa('0x3e')]=getSeconds(_0x434514['responsetime'],_0x434514[_0xa8aa('0x3f')]);};exports[_0xa8aa('0x40')]=function(_0x16efcc,_0xa3b17b,_0x18c828){_0x16efcc[_0xa8aa('0x41')]=_0xa3b17b;_0x16efcc['UserId']=_0x18c828;};exports[_0xa8aa('0x42')]=function(_0x29e966,_0x4ac16e,_0x308e6b){var _0x514a2e=moment()[_0xa8aa('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x29e966[_0xa8aa('0x38')]=_0x4ac16e;_0x29e966[_0xa8aa('0x39')]=_0x308e6b;_0x29e966[_0xa8aa('0x3b')]=_0x29e966[_0xa8aa('0x3b')]?_0x29e966[_0xa8aa('0x3b')]:_0x514a2e;_0x29e966[_0xa8aa('0x43')]=_0x29e966[_0xa8aa('0x43')]?_0x29e966[_0xa8aa('0x43')]:_0x514a2e;_0x29e966['ringtime']=getSeconds(_0x29e966['responsetime']||0x0,_0x29e966['starttime']||0x0);_0x29e966[_0xa8aa('0x44')]=_0x29e966[_0xa8aa('0x45')]?getSeconds(_0x29e966['endtime'],_0x29e966[_0xa8aa('0x45')]):0x0;};exports[_0xa8aa('0x46')]=function(_0x570a20){return _0x570a20===_0xa8aa('0x47');};exports[_0xa8aa('0x48')]=function(_0x53dc99,_0x283c73,_0x31afab,_0x1d4927,_0xf6f53e){var _0x26cca5=_0x1d4927?'RECALL':_0x53dc99[_0xa8aa('0x1a')];_0x26cca5=_0xf6f53e?_0xa8aa('0x49'):_0x26cca5;return{'actionid':_0x53dc99[_0xa8aa('0x4a')],'action':'originate','channel':_0x53dc99['channelAgent'],'callerid':util[_0xa8aa('0x13')](_0xa8aa('0x12'),_0x26cca5,_0x53dc99[_0xa8aa('0x1b')]),'Exten':_0xa8aa('0x2a'),'Context':_0xa8aa('0x4b'),'Priority':'1','variable':_0x31afab,'timeout':(_0x283c73[_0xa8aa('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x53dc99[_0xa8aa('0x4a')]};};exports[_0xa8aa('0x4d')]=function(_0x1630b6){return _0x1630b6[_0xa8aa('0x4e')]+_0x1630b6[_0xa8aa('0x4f')]+_0x1630b6[_0xa8aa('0x50')];};exports['cloneAction']=function(_0x3db810){var _0x51ed44=_['clone'](_0x3db810);_0x51ed44['state']=0xf;_0x51ed44['statedesc']=_0xa8aa('0x51');return _0x51ed44;};exports[_0xa8aa('0x52')]=function(_0x1e2475,_0x4c8410,_0x1f6ec7){var _0x22f48c={};_0x22f48c[_0x4c8410]=_0x1e2475[_0x4c8410];_0x22f48c['active']=![];_0x22f48c[_0xa8aa('0x53')]=moment()[_0xa8aa('0x54')](_0x1f6ec7,_0xa8aa('0x55'))[_0xa8aa('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x22f48c[_0xa8aa('0x1c')]=_0x1e2475[_0xa8aa('0x1c')];_0x22f48c['ListId']=_0x1e2475[_0xa8aa('0x56')];_0x22f48c[_0xa8aa('0x1e')]=_0x1e2475[_0xa8aa('0x1e')]||undefined;return _0x22f48c;};exports[_0xa8aa('0x57')]=function(_0x404237,_0x1227cc){if(!_[_0xa8aa('0x16')](_0x404237)){if(_0x404237[_0xa8aa('0x58')]>0x0){_0x404237[_0xa8aa('0x58')]-=0x1;}else{logger[_0xa8aa('0x9')](_0x1227cc,_0xa8aa('0x59'));}}else{logger['error'](_0x1227cc,_0xa8aa('0x5a'));}};exports[_0xa8aa('0x5b')]=function(_0xae0d90){if(_0xae0d90<=0x0){return!![];}return![];};exports[_0xa8aa('0x5c')]=function(_0x1db6b8,_0x4867d8){_0x1db6b8[_0xa8aa('0x5d')]=_0x4867d8;_0x1db6b8[_0xa8aa('0x19')]=_0x1db6b8['queue'];_0x1db6b8[_0xa8aa('0x5e')]=_0x1db6b8[_0xa8aa('0x5f')];return _0x1db6b8;};exports[_0xa8aa('0x60')]=function(_0xcf7153){var _0x5a8e39={};_0x5a8e39[_0xa8aa('0x61')]=_0xcf7153['queue'];_0x5a8e39[_0xa8aa('0x5e')]=_0xcf7153[_0xa8aa('0x5f')];_0x5a8e39[_0xa8aa('0x4a')]=_0xcf7153[_0xa8aa('0x4a')];return _0x5a8e39;};exports[_0xa8aa('0x62')]=function(_0x945845){var _0xd5952c=[];for(var _0x400be9 in _0x945845){if(_0x945845[_0xa8aa('0x34')](_0x400be9)){if(!_[_0xa8aa('0x16')](_0x945845[_0x400be9])&&_0x945845[_0x400be9]['state']===_0xa8aa('0x63')&&_0x945845[_0x400be9][_0xa8aa('0x64')]===_0xa8aa('0x65')){_0xd5952c[_0xa8aa('0x66')](_0x945845[_0x400be9]['id']);}}}return _0xd5952c;};exports[_0xa8aa('0x67')]=function(_0x165325){var _0x38509f=moment()['milliseconds'](0x0);var _0x2e7ad9=moment(_0x165325)[_0xa8aa('0x7')](0x0);return _0x38509f[_0xa8aa('0x68')](_0x2e7ad9,_0xa8aa('0x69'));};exports[_0xa8aa('0x6a')]=function(_0x32488b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x32488b[_0xa8aa('0x1c')],'ListId':_0x32488b[_0xa8aa('0x56')],'VoiceQueueId':_0x32488b['VoiceQueueId']||undefined,'CampaignId':_0x32488b[_0xa8aa('0x6b')]||undefined};};exports[_0xa8aa('0x6c')]=function(_0xc7f96b){if(_0xc7f96b==='uniqueid'||_0xc7f96b===_0xa8aa('0x6d')||_0xc7f96b===_0xa8aa('0x61')||_0xc7f96b===_0xa8aa('0x6e')||_0xc7f96b===_0xa8aa('0x6f')||_0xc7f96b===_0xa8aa('0x70')||_0xc7f96b==='membername'||_0xc7f96b===_0xa8aa('0x5f')||_0xc7f96b==='calleridname'||_0xc7f96b===_0xa8aa('0x71')||_0xc7f96b===_0xa8aa('0x1b')||_0xc7f96b===_0xa8aa('0x53')||_0xc7f96b==='countbusyretry'||_0xc7f96b===_0xa8aa('0x4f')||_0xc7f96b==='countnoanswerretry'||_0xc7f96b===_0xa8aa('0x72')||_0xc7f96b===_0xa8aa('0x73')||_0xc7f96b==='callbackuniqueid'||_0xc7f96b==='callbackat'||_0xc7f96b===_0xa8aa('0x74')||_0xc7f96b===_0xa8aa('0x1c')||_0xc7f96b===_0xa8aa('0x56')||_0xc7f96b===_0xa8aa('0x75')||_0xc7f96b===_0xa8aa('0x1e')||_0xc7f96b===_0xa8aa('0x76')||_0xc7f96b==='xmd-voicequeueid'||_0xc7f96b===_0xa8aa('0x77')||_0xc7f96b===_0xa8aa('0x78')||_0xc7f96b===_0xa8aa('0x79')||_0xc7f96b==='xmd-dialurl'||_0xc7f96b==='xmd-dialtimeout'||_0xc7f96b===_0xa8aa('0x7a')||_0xc7f96b==='xmd-dialid'||_0xc7f96b===_0xa8aa('0x7b')||_0xc7f96b==='xmd-contactid'||_0xc7f96b===_0xa8aa('0x7c')||_0xc7f96b===_0xa8aa('0x7d')||_0xc7f96b===_0xa8aa('0x7e')||_0xc7f96b===_0xa8aa('0x7f')||_0xc7f96b==='rtpaudioqos'||_0xc7f96b===_0xa8aa('0x80')||_0xc7f96b==='rtpaudioqosjitter'||_0xc7f96b===_0xa8aa('0x81')||_0xc7f96b==='rtpaudioqosloss'||_0xc7f96b===_0xa8aa('0x82')||_0xc7f96b===_0xa8aa('0x83')||_0xc7f96b===_0xa8aa('0x84')||_0xc7f96b===_0xa8aa('0x85')||_0xc7f96b==='rtpaudioqosbridged'||_0xc7f96b===_0xa8aa('0x86')||_0xc7f96b===_0xa8aa('0x81')||_0xc7f96b==='rtpaudioqosloss'||_0xc7f96b===_0xa8aa('0x82')||_0xc7f96b==='rtpaudioqosrtt'||_0xc7f96b==='rtpaudioqosrttbridged'||_0xc7f96b==='bridgepeer'||_0xc7f96b==='bridgepvtcallid'||_0xc7f96b===_0xa8aa('0x38')||_0xc7f96b===_0xa8aa('0x39')){return![];}return!![];};exports[_0xa8aa('0x87')]=function(_0x3c7607,_0x4797e0){var _0x1eb8b9,_0xf012c4,_0x16b695;if(_0x4797e0<=0x0){_0x4797e0=0x1;}_0x1eb8b9=new RegExp(_0xa8aa('0x88')+_0x4797e0+'}$');_0xf012c4=Math[_0xa8aa('0x89')](0xa,_0x4797e0-0x1);_0x16b695=Math[_0xa8aa('0x89')](0xa,_0x4797e0)-0x1;return util[_0xa8aa('0x13')]('%s',_[_0xa8aa('0x8a')](_0x3c7607,_0x1eb8b9,_[_0xa8aa('0x8b')](_0xf012c4,_0x16b695)));};exports[_0xa8aa('0x8c')]=function(_0x2d640e){var _0x20838b=_0x2d640e[_0xa8aa('0x8d')](/"(.*?)"/);return _0x20838b?_0x20838b[0x1]:_0x2d640e;};exports[_0xa8aa('0x8e')]=function(_0x20774f){var _0x592de0=_0x20774f[_0xa8aa('0x8d')](/<(.*?)>/);return _0x592de0?_0x592de0[0x1]:_0x20774f;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 2b81308..6d48325 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(_0x330acf,_0x3440e2){var _0x2ed3fb=function(_0x4b4b3d){while(--_0x4b4b3d){_0x330acf['push'](_0x330acf['shift']());}};_0x2ed3fb(++_0x3440e2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3c7b91,_0x5b3e20){_0x3c7b91=_0x3c7b91-0x0;var _0x3bc225=_0x5f2f[_0x3c7b91];return _0x3bc225;};'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 _0x7a54=['number','boolean','queuepause','reload','voicequeuechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x38b4f8,_0x2cb0af){var _0x3cb1cb=function(_0xdb962a){while(--_0xdb962a){_0x38b4f8['push'](_0x38b4f8['shift']());}};_0x3cb1cb(++_0x2cb0af);}(_0x7a54,0x106));var _0x47a5=function(_0x291995,_0x2d7418){_0x291995=_0x291995-0x0;var _0x3eb7ba=_0x7a54[_0x291995];return _0x3eb7ba;};'use strict';exports[_0x47a5('0x0')]={'queue':{'type':_0x47a5('0x1'),'required':!![]},'interface':{'type':_0x47a5('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x47a5('0x2'),'required':![]},'paused':{'type':_0x47a5('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x47a5('0x1'),'required':!![]},'interface':{'type':_0x47a5('0x1'),'required':!![]}};exports[_0x47a5('0x4')]={'interface':{'type':_0x47a5('0x1'),'required':!![]},'paused':{'type':_0x47a5('0x3')},'reason':{'type':'string','required':![]}};exports[_0x47a5('0x5')]={'module':{'type':'string','required':![]}};exports[_0x47a5('0x6')]={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0x47a5('0x7')]={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index e9c3e0a..fe29ab3 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 _0x7b1b=['../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','mapKeys','format','name','hasOwnProperty','isNil','interface','SIP/%s','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','initAgents','isUndefined','prototype','initTelephones','length','trunks','initVoiceQueues','initTriggers','triggers','initZendeskAccounts','initSalesforceAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','sumBillable','diff','initVoiceCallReports','total','duration','disposition','billableseconds','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts','exports','util','lodash','moment','../model/agent','../model/trigger'];(function(_0x4adfa4,_0x121c5a){var _0x14cec1=function(_0x4fd975){while(--_0x4fd975){_0x4adfa4['push'](_0x4adfa4['shift']());}};_0x14cec1(++_0x121c5a);}(_0x7b1b,0x19f));var _0xb7b1=function(_0x1e20ef,_0x5d88d6){_0x1e20ef=_0x1e20ef-0x0;var _0x32d86a=_0x7b1b[_0x1e20ef];return _0x32d86a;};'use strict';var BPromise=require('bluebird');var util=require(_0xb7b1('0x0'));var _=require(_0xb7b1('0x1'));var moment=require(_0xb7b1('0x2'));var Agent=require(_0xb7b1('0x3'));var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xb7b1('0x4'));var Template=require(_0xb7b1('0x5'));var Campaign=require(_0xb7b1('0x6'));var VoiceExtension=require(_0xb7b1('0x7'));var ZendeskAccount=require(_0xb7b1('0x8'));var SalesforceAccount=require(_0xb7b1('0x9'));var FreshdeskAccount=require(_0xb7b1('0xa'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xb7b1('0xb'));var VtigerAccount=require(_0xb7b1('0xc'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xb7b1('0xd'));var FaxAccount=require(_0xb7b1('0xe'));var Realtime=function(){this[_0xb7b1('0xf')]={};this[_0xb7b1('0x10')]={};this['trunks']={};this[_0xb7b1('0x11')]={};this['triggers']={};this[_0xb7b1('0x12')]={};this[_0xb7b1('0x13')]={};this[_0xb7b1('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xb7b1('0x15')]={};this[_0xb7b1('0x16')]={};this[_0xb7b1('0x17')]={};this[_0xb7b1('0x18')]={};this[_0xb7b1('0x19')]={};this[_0xb7b1('0x1a')]={};this[_0xb7b1('0x1b')]={};this[_0xb7b1('0x1c')]={};this[_0xb7b1('0x1d')]={};this[_0xb7b1('0x1e')]={};this[_0xb7b1('0x1f')]={};this[_0xb7b1('0x20')]={};this[_0xb7b1('0x21')]={};this[_0xb7b1('0x22')]={};this['faxAccounts']={};};function freeIsNotKey(_0x547985,_0x2e4a84,_0x39c1a8){var _0x332c0a=_[_0xb7b1('0x23')](_0x547985,function(_0xc12cec,_0x52e5ed){return _0xc12cec[_0x39c1a8];});for(var _0x433058 in _0x2e4a84){if(_0x2e4a84['hasOwnProperty'](_0x433058)){if(!_0x332c0a[_0x433058]){delete _0x2e4a84[_0x433058];}}}}function freeIsNotKeySip(_0x3e1ebd,_0x3dee02){var _0x165834=_['mapKeys'](_0x3e1ebd,function(_0x36ce91,_0x57d609){return util[_0xb7b1('0x24')]('SIP/%s',_0x36ce91[_0xb7b1('0x25')]);});for(var _0xaf5df7 in _0x3dee02){if(_0x3dee02[_0xb7b1('0x26')](_0xaf5df7)){if(!_0x165834[_0xaf5df7]){delete _0x3dee02[_0xaf5df7];}}}}function freeIsNotKeyAgent(_0x48cf1e,_0x4594f3){var _0x374e79=_[_0xb7b1('0x23')](_0x48cf1e,function(_0x3cce16,_0x5ba79b){var _0x55e92c=_[_0xb7b1('0x27')](_0x3cce16[_0xb7b1('0x28')])?util[_0xb7b1('0x24')](_0xb7b1('0x29'),_0x3cce16[_0xb7b1('0x25')]):_0x3cce16['interface'];return _0x55e92c;});for(var _0x32690a in _0x4594f3){if(_0x4594f3[_0xb7b1('0x26')](_0x32690a)){if(!_0x374e79[_0x32690a]){delete _0x4594f3[_0x32690a];}}}}function clearVoiceCallReports(_0x449985){_0x449985['total']=0x0;_0x449985[_0xb7b1('0x2a')]=0x0;_0x449985[_0xb7b1('0x2b')]=0x0;_0x449985[_0xb7b1('0x2c')]=0x0;_0x449985['sumBillable']=0x0;}function clearCampaigns(_0x44f1b4){if(!_['isEmpty'](_0x44f1b4)){for(var _0x1063c4 in _0x44f1b4){if(_0x44f1b4['hasOwnProperty'](_0x1063c4)){_0x44f1b4[_0x1063c4][_0xb7b1('0x2d')]=0x0;_0x44f1b4[_0x1063c4]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x5c0d0){if(!_[_0xb7b1('0x2e')](_0x5c0d0)){for(var _0x56816b in _0x5c0d0){if(_0x5c0d0[_0xb7b1('0x26')](_0x56816b)){_0x5c0d0[_0x56816b]['total']=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x2a')]=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x2f')]=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x30')]=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x2b')]=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x2c')]=0x0;_0x5c0d0[_0x56816b]['sumBillable']=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x31')]=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x32')]=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x33')]=0x0;_0x5c0d0[_0x56816b]['outboundCongestionCallsDay']=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x34')]=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x35')]=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x36')]=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x37')]=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x38')]=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x39')]=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x3a')]=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x3b')]=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x31')]=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x3c')]=0x0;_0x5c0d0[_0x56816b][_0xb7b1('0x3d')]=!![];}}}}Realtime['prototype'][_0xb7b1('0x3e')]=function(_0x4456b1,_0x476c3){for(var _0x2e65d0 in _0x476c3){if(_0x4456b1[_0xb7b1('0x26')](_0x2e65d0)){_0x4456b1[_0x2e65d0]=_0x476c3[_0x2e65d0];}}};Realtime['prototype'][_0xb7b1('0x3f')]=function(){var _0x56dc88=this;return function(_0x17d678){if(_0x17d678){freeIsNotKeyAgent(_0x17d678,_0x56dc88['agents']);for(var _0x28f2cc=0x0,_0xf161ec={},_0x3fd8d6={};_0x28f2cc<_0x17d678['length'];_0x28f2cc+=0x1){_0xf161ec=_0x17d678[_0x28f2cc];var _0x411368=_[_0xb7b1('0x27')](_0xf161ec[_0xb7b1('0x28')])?util[_0xb7b1('0x24')]('SIP/%s',_0xf161ec['name']):_0xf161ec['interface'];if(_[_0xb7b1('0x40')](_0x56dc88[_0xb7b1('0xf')][_0x411368])){_0x56dc88[_0xb7b1('0xf')][_0x411368]=new Agent(_0xf161ec);}else{_0x56dc88['mergeFromDatabase'](_0x56dc88[_0xb7b1('0xf')][_0x411368],_0xf161ec);}}}return _0x56dc88[_0xb7b1('0xf')];};};Realtime[_0xb7b1('0x41')][_0xb7b1('0x42')]=function(){var _0x66f7ff=this;return function(_0x11f6dc){if(_0x11f6dc){freeIsNotKeySip(_0x11f6dc,_0x66f7ff['telephones']);for(var _0x138705=0x0,_0x1d4405={},_0x29783f={};_0x138705<_0x11f6dc[_0xb7b1('0x43')];_0x138705+=0x1){_0x1d4405=_0x11f6dc[_0x138705];if(_[_0xb7b1('0x40')](_0x66f7ff[_0xb7b1('0x10')][util[_0xb7b1('0x24')](_0xb7b1('0x29'),_0x1d4405['name'])])){_0x66f7ff['telephones'][util['format']('SIP/%s',_0x1d4405[_0xb7b1('0x25')])]=new Telephone(_0x1d4405);}else{_0x66f7ff['mergeFromDatabase'](_0x66f7ff[_0xb7b1('0x10')][util[_0xb7b1('0x24')](_0xb7b1('0x29'),_0x1d4405['name'])],_0x1d4405);}}}return _0x66f7ff[_0xb7b1('0x10')];};};Realtime[_0xb7b1('0x41')]['initTrunks']=function(){var _0xd754e9=this;return function(_0x12ac7b){if(_0x12ac7b){freeIsNotKeySip(_0x12ac7b,_0xd754e9[_0xb7b1('0x44')]);for(var _0x44b66e=0x0,_0x3ccdad={},_0x5ded54={};_0x44b66e<_0x12ac7b[_0xb7b1('0x43')];_0x44b66e+=0x1){_0x3ccdad=_0x12ac7b[_0x44b66e];if(_[_0xb7b1('0x40')](_0xd754e9['trunks'][util[_0xb7b1('0x24')]('SIP/%s',_0x3ccdad[_0xb7b1('0x25')])])){_0xd754e9[_0xb7b1('0x44')][util['format']('SIP/%s',_0x3ccdad[_0xb7b1('0x25')])]=new Trunk(_0x3ccdad);}else{_0xd754e9[_0xb7b1('0x3e')](_0xd754e9[_0xb7b1('0x44')][util[_0xb7b1('0x24')](_0xb7b1('0x29'),_0x3ccdad[_0xb7b1('0x25')])],_0x3ccdad);}}}return _0xd754e9[_0xb7b1('0x44')];};};Realtime[_0xb7b1('0x41')][_0xb7b1('0x45')]=function(){var _0x447ee7=this;return function(_0xb6b374){if(_0xb6b374){freeIsNotKey(_0xb6b374,_0x447ee7['voiceQueues'],_0xb7b1('0x25'));for(var _0x6fb2ab=0x0,_0x4b45c4={},_0x830dd9={};_0x6fb2ab<_0xb6b374['length'];_0x6fb2ab+=0x1){_0x4b45c4=_0xb6b374[_0x6fb2ab];if(_['isUndefined'](_0x447ee7['voiceQueues'][_0x4b45c4['name']])){_0x447ee7[_0xb7b1('0x11')][_0x4b45c4[_0xb7b1('0x25')]]=new VoiceQueue(_0x4b45c4);}else{_0x447ee7[_0xb7b1('0x3e')](_0x447ee7['voiceQueues'][_0x4b45c4['name']],_0x4b45c4);}}}return _0x447ee7[_0xb7b1('0x11')];};};Realtime[_0xb7b1('0x41')][_0xb7b1('0x46')]=function(){var _0x3a33b1=this;return function(_0x2ceafe){if(_0x2ceafe){freeIsNotKey(_0x2ceafe,_0x3a33b1[_0xb7b1('0x47')],'id');for(var _0x38fa23=0x0,_0x54775c={},_0x3be61f={};_0x38fa23<_0x2ceafe[_0xb7b1('0x43')];_0x38fa23+=0x1){_0x54775c=_0x2ceafe[_0x38fa23];if(_['isUndefined'](_0x3a33b1[_0xb7b1('0x47')][_0x54775c['id']])){_0x3a33b1[_0xb7b1('0x47')][_0x54775c['id']]=new Trigger(_0x54775c);}else{_0x3a33b1[_0xb7b1('0x3e')](_0x3a33b1[_0xb7b1('0x47')][_0x54775c['id']],_0x54775c);}}}return _0x3a33b1[_0xb7b1('0x47')];};};Realtime[_0xb7b1('0x41')]['initTemplates']=function(){var _0xc2227b=this;return function(_0x5bcd8a){if(_0x5bcd8a){freeIsNotKey(_0x5bcd8a,_0xc2227b[_0xb7b1('0x13')],'id');for(var _0x1485f7=0x0,_0x47ff04={},_0x19ba09={};_0x1485f7<_0x5bcd8a[_0xb7b1('0x43')];_0x1485f7+=0x1){_0x47ff04=_0x5bcd8a[_0x1485f7];if(_[_0xb7b1('0x40')](_0xc2227b['templates'][_0x47ff04['id']])){_0xc2227b[_0xb7b1('0x13')][_0x47ff04['id']]=new Template(_0x47ff04);}else{_0xc2227b['mergeFromDatabase'](_0xc2227b[_0xb7b1('0x13')][_0x47ff04['id']],_0x47ff04);}}}return _0xc2227b[_0xb7b1('0x13')];};};Realtime[_0xb7b1('0x41')][_0xb7b1('0x48')]=function(){var _0x231c56=this;return function(_0x58f049){if(_0x58f049){freeIsNotKey(_0x58f049,_0x231c56['zendeskAccounts'],'id');for(var _0xbe7fb0=0x0,_0x240da1={},_0x41b70a={};_0xbe7fb0<_0x58f049['length'];_0xbe7fb0+=0x1){_0x240da1=_0x58f049[_0xbe7fb0];if(_[_0xb7b1('0x40')](_0x231c56[_0xb7b1('0x1a')][_0x240da1['id']])){_0x231c56[_0xb7b1('0x1a')][_0x240da1['id']]=new ZendeskAccount(_0x240da1);}else{_0x231c56[_0xb7b1('0x3e')](_0x231c56[_0xb7b1('0x1a')][_0x240da1['id']],_0x240da1);}}}return _0x231c56[_0xb7b1('0x1a')];};};Realtime['prototype'][_0xb7b1('0x49')]=function(){var _0x40c097=this;return function(_0xec83af){if(_0xec83af){freeIsNotKey(_0xec83af,_0x40c097['salesforceAccounts'],'id');for(var _0xf6a63c=0x0,_0x3157e8={},_0x55a255={};_0xf6a63c<_0xec83af[_0xb7b1('0x43')];_0xf6a63c+=0x1){_0x3157e8=_0xec83af[_0xf6a63c];if(_[_0xb7b1('0x40')](_0x40c097[_0xb7b1('0x1b')][_0x3157e8['id']])){_0x40c097['salesforceAccounts'][_0x3157e8['id']]=new SalesforceAccount(_0x3157e8);}else{_0x40c097[_0xb7b1('0x3e')](_0x40c097[_0xb7b1('0x1b')][_0x3157e8['id']],_0x3157e8);}}}return _0x40c097[_0xb7b1('0x1b')];};};Realtime[_0xb7b1('0x41')]['initFreshdeskAccounts']=function(){var _0x4b6ef9=this;return function(_0x18ff8f){if(_0x18ff8f){freeIsNotKey(_0x18ff8f,_0x4b6ef9['freshdeskAccounts'],'id');for(var _0x954f9b=0x0,_0x2d3d01={},_0x27aa1e={};_0x954f9b<_0x18ff8f['length'];_0x954f9b+=0x1){_0x2d3d01=_0x18ff8f[_0x954f9b];if(_[_0xb7b1('0x40')](_0x4b6ef9['freshdeskAccounts'][_0x2d3d01['id']])){_0x4b6ef9[_0xb7b1('0x1d')][_0x2d3d01['id']]=new FreshdeskAccount(_0x2d3d01);}else{_0x4b6ef9[_0xb7b1('0x3e')](_0x4b6ef9[_0xb7b1('0x1d')][_0x2d3d01['id']],_0x2d3d01);}}}return _0x4b6ef9[_0xb7b1('0x1d')];};};Realtime['prototype']['initZohoAccounts']=function(){var _0x11d4fa=this;return function(_0x1d7e7e){if(_0x1d7e7e){freeIsNotKey(_0x1d7e7e,_0x11d4fa[_0xb7b1('0x1e')],'id');for(var _0xa67764=0x0,_0x34f812={},_0x24580a={};_0xa67764<_0x1d7e7e['length'];_0xa67764+=0x1){_0x34f812=_0x1d7e7e[_0xa67764];if(_[_0xb7b1('0x40')](_0x11d4fa[_0xb7b1('0x1e')][_0x34f812['id']])){_0x11d4fa['zohoAccounts'][_0x34f812['id']]=new ZohoAccount(_0x34f812);}else{_0x11d4fa[_0xb7b1('0x3e')](_0x11d4fa[_0xb7b1('0x1e')][_0x34f812['id']],_0x34f812);}}}return _0x11d4fa['zohoAccounts'];};};Realtime[_0xb7b1('0x41')][_0xb7b1('0x4a')]=function(){var _0x3e73d8=this;return function(_0x102c14){if(_0x102c14){freeIsNotKey(_0x102c14,_0x3e73d8[_0xb7b1('0x1f')],'id');for(var _0x4f1388=0x0,_0x1da1a7={},_0x45d0dd={};_0x4f1388<_0x102c14[_0xb7b1('0x43')];_0x4f1388+=0x1){_0x1da1a7=_0x102c14[_0x4f1388];if(_['isUndefined'](_0x3e73d8[_0xb7b1('0x1f')][_0x1da1a7['id']])){_0x3e73d8['deskAccounts'][_0x1da1a7['id']]=new DeskAccount(_0x1da1a7);}else{_0x3e73d8[_0xb7b1('0x3e')](_0x3e73d8[_0xb7b1('0x1f')][_0x1da1a7['id']],_0x1da1a7);}}}return _0x3e73d8[_0xb7b1('0x1f')];};};Realtime[_0xb7b1('0x41')][_0xb7b1('0x4b')]=function(){var _0x77a8ad=this;return function(_0x12c6b0){if(_0x12c6b0){freeIsNotKey(_0x12c6b0,_0x77a8ad[_0xb7b1('0x1c')],'id');for(var _0x405b4f=0x0,_0x558e14={},_0x49a75a={};_0x405b4f<_0x12c6b0[_0xb7b1('0x43')];_0x405b4f+=0x1){_0x558e14=_0x12c6b0[_0x405b4f];if(_[_0xb7b1('0x40')](_0x77a8ad['sugarcrmAccounts'][_0x558e14['id']])){_0x77a8ad[_0xb7b1('0x1c')][_0x558e14['id']]=new SugarcrmAccount(_0x558e14);}else{_0x77a8ad[_0xb7b1('0x3e')](_0x77a8ad[_0xb7b1('0x1c')][_0x558e14['id']],_0x558e14);}}}return _0x77a8ad[_0xb7b1('0x1c')];};};Realtime[_0xb7b1('0x41')][_0xb7b1('0x4c')]=function(){var _0xec9ec8=this;return function(_0x124f68){if(_0x124f68){freeIsNotKey(_0x124f68,_0xec9ec8[_0xb7b1('0x20')],'id');for(var _0x5bb27c=0x0,_0x58e4a1={},_0x412430={};_0x5bb27c<_0x124f68[_0xb7b1('0x43')];_0x5bb27c+=0x1){_0x58e4a1=_0x124f68[_0x5bb27c];if(_['isUndefined'](_0xec9ec8['vtigerAccounts'][_0x58e4a1['id']])){_0xec9ec8[_0xb7b1('0x20')][_0x58e4a1['id']]=new VtigerAccount(_0x58e4a1);}else{_0xec9ec8[_0xb7b1('0x3e')](_0xec9ec8[_0xb7b1('0x20')][_0x58e4a1['id']],_0x58e4a1);}}}return _0xec9ec8[_0xb7b1('0x20')];};};Realtime[_0xb7b1('0x41')]['initServicenowAccounts']=function(){var _0x15bdeb=this;return function(_0x12b8cc){if(_0x12b8cc){freeIsNotKey(_0x12b8cc,_0x15bdeb[_0xb7b1('0x21')],'id');for(var _0x5eb4a8=0x0,_0x5219c8={},_0x4a9f6a={};_0x5eb4a8<_0x12b8cc[_0xb7b1('0x43')];_0x5eb4a8+=0x1){_0x5219c8=_0x12b8cc[_0x5eb4a8];if(_[_0xb7b1('0x40')](_0x15bdeb['servicenowAccounts'][_0x5219c8['id']])){_0x15bdeb[_0xb7b1('0x21')][_0x5219c8['id']]=new ServicenowAccount(_0x5219c8);}else{_0x15bdeb[_0xb7b1('0x3e')](_0x15bdeb[_0xb7b1('0x21')][_0x5219c8['id']],_0x5219c8);}}}return _0x15bdeb['servicenowAccounts'];};};Realtime[_0xb7b1('0x41')][_0xb7b1('0x4d')]=function(){var _0x29df96=this;return function(_0x5d35ac){if(_0x5d35ac){freeIsNotKey(_0x5d35ac,_0x29df96['dynamics365Accounts'],'id');for(var _0x756a25=0x0,_0x51c362={},_0x1d00ff={};_0x756a25<_0x5d35ac['length'];_0x756a25+=0x1){_0x51c362=_0x5d35ac[_0x756a25];if(_[_0xb7b1('0x40')](_0x29df96[_0xb7b1('0x22')][_0x51c362['id']])){_0x29df96[_0xb7b1('0x22')][_0x51c362['id']]=new Dynamics365Account(_0x51c362);}else{_0x29df96[_0xb7b1('0x3e')](_0x29df96[_0xb7b1('0x22')][_0x51c362['id']],_0x51c362);}}}return _0x29df96['dynamics365Accounts'];};};Realtime[_0xb7b1('0x41')][_0xb7b1('0x4e')]=function(){var _0x576869=this;return function(_0x43384d){for(var _0x3783ce=0x0;_0x3783ce<_0x43384d[_0xb7b1('0x43')];_0x3783ce+=0x1){_[_0xb7b1('0x4f')](_0x576869[_0xb7b1('0x11')][_0x43384d[_0x3783ce][_0xb7b1('0x25')]],_0x43384d[_0x3783ce]);}return _0x576869[_0xb7b1('0x11')];};};Realtime['prototype'][_0xb7b1('0x50')]=function(){var _0x267858=this;return function(_0x580aee){clearVoiceQueues(_0x267858[_0xb7b1('0x11')]);if(_0x580aee){_0x580aee=_[_0xb7b1('0x51')](_0x580aee,_0xb7b1('0x52'));for(var _0x3aea0b in _0x580aee){if(_0x580aee[_0xb7b1('0x26')](_0x3aea0b)){var _0x2c48dd={};for(var _0x2df007=0x0;_0x2df007<_0x580aee[_0x3aea0b][_0xb7b1('0x43')];_0x2df007+=0x1){var _0x2f7400=_0x580aee[_0x3aea0b][_0x2df007][_0xb7b1('0x53')];if(_0x267858[_0xb7b1('0x11')][_0x2f7400]){if(_0x580aee[_0x3aea0b][_0x2df007][_0xb7b1('0x54')]){_0x267858[_0xb7b1('0x11')][_0x2f7400][_0xb7b1('0x2f')]+=0x1;}if(_0x580aee[_0x3aea0b][_0x2df007][_0xb7b1('0x55')]){_0x267858['voiceQueues'][_0x2f7400][_0xb7b1('0x30')]+=0x1;}_0x267858['voiceQueues'][_0x2f7400][_0xb7b1('0x2b')]+=moment(_0x580aee[_0x3aea0b][_0x2df007][_0xb7b1('0x56')])['diff'](moment(_0x580aee[_0x3aea0b][_0x2df007]['queuecallerjoinAt']),_0xb7b1('0x57'))||0x0;if(_0x2df007===_0x580aee[_0x3aea0b][_0xb7b1('0x43')]-0x1){_0x267858['voiceQueues'][_0x2f7400][_0xb7b1('0x2c')]+=moment(_0x580aee[_0x3aea0b][_0x2df007][_0xb7b1('0x58')]||_0x580aee[_0x3aea0b][_0x2df007][_0xb7b1('0x59')]||_0x580aee[_0x3aea0b][_0x2df007][_0xb7b1('0x5a')])['diff'](moment(_0x580aee[_0x3aea0b][_0x2df007][_0xb7b1('0x5b')]),_0xb7b1('0x57'))||0x0;_0x267858[_0xb7b1('0x11')][_0x2f7400]['total']+=0x1;if(_0x580aee[_0x3aea0b][_0x2df007][_0xb7b1('0x5c')]){_0x267858[_0xb7b1('0x11')][_0x2f7400][_0xb7b1('0x2a')]+=0x1;_0x267858[_0xb7b1('0x11')][_0x2f7400][_0xb7b1('0x5d')]+=moment(_0x580aee[_0x3aea0b][_0x2df007]['queuecallercompleteAt'])[_0xb7b1('0x5e')](moment(_0x580aee[_0x3aea0b][_0x2df007][_0xb7b1('0x56')]),_0xb7b1('0x57'))||0x0;}}else{_0x267858[_0xb7b1('0x11')][_0x2f7400]['sumDuration']+=_0x267858[_0xb7b1('0x11')][_0x2f7400][_0xb7b1('0x2b')]||0x0;}}}}}}return _0x267858[_0xb7b1('0x11')];};};Realtime['prototype'][_0xb7b1('0x5f')]=function(){var _0x2d690d=this;return function(_0x2f9ed5){clearVoiceCallReports(_0x2d690d[_0xb7b1('0x14')]);if(_0x2f9ed5){for(var _0x32cf8e=0x0;_0x32cf8e<_0x2f9ed5[_0xb7b1('0x43')];_0x32cf8e+=0x1){_0x2d690d[_0xb7b1('0x14')][_0xb7b1('0x60')]+=0x1;_0x2d690d[_0xb7b1('0x14')][_0xb7b1('0x2c')]+=_0x2f9ed5[_0x32cf8e][_0xb7b1('0x61')];if(_0x2f9ed5[_0x32cf8e][_0xb7b1('0x62')]==='ANSWERED'){_0x2d690d[_0xb7b1('0x14')][_0xb7b1('0x2a')]+=0x1;_0x2d690d[_0xb7b1('0x14')][_0xb7b1('0x2b')]+=_0x2f9ed5[_0x32cf8e]['duration']-_0x2f9ed5[_0x32cf8e]['billableseconds']||0x0;_0x2d690d[_0xb7b1('0x14')][_0xb7b1('0x5d')]+=_0x2f9ed5[_0x32cf8e][_0xb7b1('0x63')];}}}return _0x2d690d['outbound'];};};Realtime[_0xb7b1('0x41')]['initCampaigns']=function(){var _0x55edaf=this;return function(_0x3b3906){if(_0x3b3906){freeIsNotKey(_0x3b3906,_0x55edaf[_0xb7b1('0x12')],_0xb7b1('0x25'));for(var _0x115d61=0x0,_0x39bc4b={};_0x115d61<_0x3b3906[_0xb7b1('0x43')];_0x115d61+=0x1){_0x39bc4b=_0x3b3906[_0x115d61];if(_[_0xb7b1('0x40')](_0x55edaf[_0xb7b1('0x12')][_0x39bc4b[_0xb7b1('0x25')]])){_0x55edaf[_0xb7b1('0x12')][_0x39bc4b[_0xb7b1('0x25')]]=new Campaign(_0x39bc4b);}else{_0x55edaf[_0xb7b1('0x3e')](_0x55edaf[_0xb7b1('0x12')][_0x39bc4b['name']],_0x39bc4b);}}}return _0x55edaf['campaigns'];};};Realtime[_0xb7b1('0x41')][_0xb7b1('0x64')]=function(){var _0x2eb2cd=this;return function(_0x430257){if(_0x430257){freeIsNotKey(_0x430257,_0x2eb2cd[_0xb7b1('0x15')],'id');for(var _0x272801=0x0,_0x28663f={};_0x272801<_0x430257[_0xb7b1('0x43')];_0x272801+=0x1){_0x28663f=_0x430257[_0x272801];if(_['isUndefined'](_0x2eb2cd[_0xb7b1('0x15')][_0x28663f['id']])){_0x2eb2cd[_0xb7b1('0x15')][_0x28663f['id']]=new VoiceExtension(_0x28663f);}else{_0x2eb2cd[_0xb7b1('0x3e')](_0x2eb2cd[_0xb7b1('0x15')][_0x28663f['id']],_0x28663f);}}}return _0x2eb2cd[_0xb7b1('0x15')];};};Realtime[_0xb7b1('0x41')][_0xb7b1('0x65')]=function(){var _0x32b9bc=this;return function(_0x317d34){clearCampaigns(_0x32b9bc[_0xb7b1('0x12')]);for(var _0x4543a7=0x0;_0x4543a7<_0x317d34[_0xb7b1('0x43')];_0x4543a7+=0x1){_[_0xb7b1('0x4f')](_0x32b9bc[_0xb7b1('0x12')][_0x317d34[_0x4543a7][_0xb7b1('0x25')]],_0x317d34[_0x4543a7]);}return _0x32b9bc[_0xb7b1('0x12')];};};Realtime['prototype'][_0xb7b1('0x66')]=function(){var _0x4759a7=this;return function(_0x4d7ca5){if(_0x4d7ca5){freeIsNotKey(_0x4d7ca5,_0x4759a7[_0xb7b1('0x67')],'id');for(var _0x5bb716=0x0,_0x15b0fe={},_0x320ae6={};_0x5bb716<_0x4d7ca5['length'];_0x5bb716+=0x1){_0x15b0fe=_0x4d7ca5[_0x5bb716];if(_[_0xb7b1('0x40')](_0x4759a7[_0xb7b1('0x67')][_0x15b0fe['id']])){_0x4759a7['faxAccounts'][_0x15b0fe['id']]=new FaxAccount(_0x15b0fe);}else{_0x4759a7[_0xb7b1('0x3e')](_0x4759a7['faxAccounts'][_0x15b0fe['id']],_0x15b0fe);}}}return _0x4759a7['faxAccounts'];};};module[_0xb7b1('0x68')]=Realtime; \ No newline at end of file +var _0x7c94=['initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','diff','seconds','queuecallercompleteAt','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/salesforceAccount','../model/freshdeskAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','agents','trunks','triggers','campaigns','voiceExtensions','queueChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','faxAccounts','mapKeys','format','name','hasOwnProperty','interface','SIP/%s','total','answered','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','prototype','mergeFromDatabase','initAgents','isNil','isUndefined','initTelephones','telephones','initTrunks','length','voiceQueues','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts'];(function(_0x135cc2,_0x334bb6){var _0x1eda5f=function(_0x467acc){while(--_0x467acc){_0x135cc2['push'](_0x135cc2['shift']());}};_0x1eda5f(++_0x334bb6);}(_0x7c94,0x7d));var _0x47c9=function(_0x5037ee,_0x180695){_0x5037ee=_0x5037ee-0x0;var _0x5972b2=_0x7c94[_0x5037ee];return _0x5972b2;};'use strict';var BPromise=require(_0x47c9('0x0'));var util=require(_0x47c9('0x1'));var _=require(_0x47c9('0x2'));var moment=require(_0x47c9('0x3'));var Agent=require('../model/agent');var Telephone=require(_0x47c9('0x4'));var Trunk=require(_0x47c9('0x5'));var VoiceQueue=require(_0x47c9('0x6'));var Trigger=require(_0x47c9('0x7'));var Template=require(_0x47c9('0x8'));var Campaign=require('../model/campaign');var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x47c9('0x9'));var FreshdeskAccount=require(_0x47c9('0xa'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x47c9('0xb'));var VtigerAccount=require(_0x47c9('0xc'));var ServicenowAccount=require(_0x47c9('0xd'));var Dynamics365Account=require('../model/dynamics365Account');var FaxAccount=require(_0x47c9('0xe'));var Realtime=function(){this[_0x47c9('0xf')]={};this['telephones']={};this[_0x47c9('0x10')]={};this['voiceQueues']={};this[_0x47c9('0x11')]={};this[_0x47c9('0x12')]={};this['templates']={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x47c9('0x13')]={};this['channels']={};this[_0x47c9('0x14')]={};this['outboundChannels']={};this[_0x47c9('0x15')]={};this[_0x47c9('0x16')]={};this[_0x47c9('0x17')]={};this[_0x47c9('0x18')]={};this[_0x47c9('0x19')]={};this[_0x47c9('0x1a')]={};this[_0x47c9('0x1b')]={};this['vtigerAccounts']={};this[_0x47c9('0x1c')]={};this['dynamics365Accounts']={};this[_0x47c9('0x1d')]={};};function freeIsNotKey(_0x58cd3a,_0xecf27d,_0x521a9f){var _0x55137b=_[_0x47c9('0x1e')](_0x58cd3a,function(_0x26b6d3,_0x584825){return _0x26b6d3[_0x521a9f];});for(var _0x50d24a in _0xecf27d){if(_0xecf27d['hasOwnProperty'](_0x50d24a)){if(!_0x55137b[_0x50d24a]){delete _0xecf27d[_0x50d24a];}}}}function freeIsNotKeySip(_0x4eae87,_0x5cfc9c){var _0x17b944=_['mapKeys'](_0x4eae87,function(_0x52905d,_0xb8f3c8){return util[_0x47c9('0x1f')]('SIP/%s',_0x52905d[_0x47c9('0x20')]);});for(var _0x31269c in _0x5cfc9c){if(_0x5cfc9c[_0x47c9('0x21')](_0x31269c)){if(!_0x17b944[_0x31269c]){delete _0x5cfc9c[_0x31269c];}}}}function freeIsNotKeyAgent(_0x59d1cb,_0x6c6a92){var _0x15d260=_['mapKeys'](_0x59d1cb,function(_0x2a10f2,_0x188b4a){var _0x586bb3=_['isNil'](_0x2a10f2[_0x47c9('0x22')])?util['format'](_0x47c9('0x23'),_0x2a10f2[_0x47c9('0x20')]):_0x2a10f2['interface'];return _0x586bb3;});for(var _0x5e23cb in _0x6c6a92){if(_0x6c6a92[_0x47c9('0x21')](_0x5e23cb)){if(!_0x15d260[_0x5e23cb]){delete _0x6c6a92[_0x5e23cb];}}}}function clearVoiceCallReports(_0xedbfd){_0xedbfd[_0x47c9('0x24')]=0x0;_0xedbfd[_0x47c9('0x25')]=0x0;_0xedbfd[_0x47c9('0x26')]=0x0;_0xedbfd['sumDuration']=0x0;_0xedbfd[_0x47c9('0x27')]=0x0;}function clearCampaigns(_0x1ffa85){if(!_[_0x47c9('0x28')](_0x1ffa85)){for(var _0x44af22 in _0x1ffa85){if(_0x1ffa85[_0x47c9('0x21')](_0x44af22)){_0x1ffa85[_0x44af22][_0x47c9('0x29')]=0x0;_0x1ffa85[_0x44af22][_0x47c9('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x5afa9b){if(!_[_0x47c9('0x28')](_0x5afa9b)){for(var _0x675847 in _0x5afa9b){if(_0x5afa9b[_0x47c9('0x21')](_0x675847)){_0x5afa9b[_0x675847][_0x47c9('0x24')]=0x0;_0x5afa9b[_0x675847][_0x47c9('0x25')]=0x0;_0x5afa9b[_0x675847][_0x47c9('0x2b')]=0x0;_0x5afa9b[_0x675847][_0x47c9('0x2c')]=0x0;_0x5afa9b[_0x675847][_0x47c9('0x26')]=0x0;_0x5afa9b[_0x675847][_0x47c9('0x2d')]=0x0;_0x5afa9b[_0x675847][_0x47c9('0x27')]=0x0;_0x5afa9b[_0x675847][_0x47c9('0x2e')]=0x0;_0x5afa9b[_0x675847][_0x47c9('0x2f')]=0x0;_0x5afa9b[_0x675847][_0x47c9('0x30')]=0x0;_0x5afa9b[_0x675847]['outboundCongestionCallsDay']=0x0;_0x5afa9b[_0x675847][_0x47c9('0x31')]=0x0;_0x5afa9b[_0x675847][_0x47c9('0x32')]=0x0;_0x5afa9b[_0x675847][_0x47c9('0x33')]=0x0;_0x5afa9b[_0x675847][_0x47c9('0x34')]=0x0;_0x5afa9b[_0x675847][_0x47c9('0x35')]=0x0;_0x5afa9b[_0x675847]['outboundOriginateFailureCallsDay']=0x0;_0x5afa9b[_0x675847][_0x47c9('0x36')]=0x0;_0x5afa9b[_0x675847][_0x47c9('0x37')]=0x0;_0x5afa9b[_0x675847][_0x47c9('0x2e')]=0x0;_0x5afa9b[_0x675847]['outboundAnswerCallsDay']=0x0;_0x5afa9b[_0x675847]['queueStatusComplete']=!![];}}}}Realtime[_0x47c9('0x38')][_0x47c9('0x39')]=function(_0x4cce26,_0x245927){for(var _0x530343 in _0x245927){if(_0x4cce26[_0x47c9('0x21')](_0x530343)){_0x4cce26[_0x530343]=_0x245927[_0x530343];}}};Realtime[_0x47c9('0x38')][_0x47c9('0x3a')]=function(){var _0x50a7ca=this;return function(_0x57334e){if(_0x57334e){freeIsNotKeyAgent(_0x57334e,_0x50a7ca[_0x47c9('0xf')]);for(var _0x80cb23=0x0,_0xdeba2d={},_0x5b389c={};_0x80cb23<_0x57334e['length'];_0x80cb23+=0x1){_0xdeba2d=_0x57334e[_0x80cb23];var _0x25ba7e=_[_0x47c9('0x3b')](_0xdeba2d[_0x47c9('0x22')])?util[_0x47c9('0x1f')]('SIP/%s',_0xdeba2d[_0x47c9('0x20')]):_0xdeba2d[_0x47c9('0x22')];if(_[_0x47c9('0x3c')](_0x50a7ca['agents'][_0x25ba7e])){_0x50a7ca['agents'][_0x25ba7e]=new Agent(_0xdeba2d);}else{_0x50a7ca[_0x47c9('0x39')](_0x50a7ca['agents'][_0x25ba7e],_0xdeba2d);}}}return _0x50a7ca[_0x47c9('0xf')];};};Realtime[_0x47c9('0x38')][_0x47c9('0x3d')]=function(){var _0x19a757=this;return function(_0x13c893){if(_0x13c893){freeIsNotKeySip(_0x13c893,_0x19a757['telephones']);for(var _0x47bcfb=0x0,_0x338a09={},_0x19d059={};_0x47bcfb<_0x13c893['length'];_0x47bcfb+=0x1){_0x338a09=_0x13c893[_0x47bcfb];if(_[_0x47c9('0x3c')](_0x19a757[_0x47c9('0x3e')][util[_0x47c9('0x1f')](_0x47c9('0x23'),_0x338a09[_0x47c9('0x20')])])){_0x19a757[_0x47c9('0x3e')][util['format'](_0x47c9('0x23'),_0x338a09[_0x47c9('0x20')])]=new Telephone(_0x338a09);}else{_0x19a757[_0x47c9('0x39')](_0x19a757[_0x47c9('0x3e')][util[_0x47c9('0x1f')](_0x47c9('0x23'),_0x338a09[_0x47c9('0x20')])],_0x338a09);}}}return _0x19a757[_0x47c9('0x3e')];};};Realtime[_0x47c9('0x38')][_0x47c9('0x3f')]=function(){var _0x20c7b2=this;return function(_0x4f2fc2){if(_0x4f2fc2){freeIsNotKeySip(_0x4f2fc2,_0x20c7b2[_0x47c9('0x10')]);for(var _0x5c2fce=0x0,_0x320e34={},_0x3cdbe9={};_0x5c2fce<_0x4f2fc2[_0x47c9('0x40')];_0x5c2fce+=0x1){_0x320e34=_0x4f2fc2[_0x5c2fce];if(_[_0x47c9('0x3c')](_0x20c7b2[_0x47c9('0x10')][util['format'](_0x47c9('0x23'),_0x320e34['name'])])){_0x20c7b2['trunks'][util[_0x47c9('0x1f')]('SIP/%s',_0x320e34['name'])]=new Trunk(_0x320e34);}else{_0x20c7b2[_0x47c9('0x39')](_0x20c7b2[_0x47c9('0x10')][util['format'](_0x47c9('0x23'),_0x320e34[_0x47c9('0x20')])],_0x320e34);}}}return _0x20c7b2[_0x47c9('0x10')];};};Realtime[_0x47c9('0x38')]['initVoiceQueues']=function(){var _0x427f1c=this;return function(_0x17242d){if(_0x17242d){freeIsNotKey(_0x17242d,_0x427f1c[_0x47c9('0x41')],_0x47c9('0x20'));for(var _0x2ed4eb=0x0,_0x2f14b5={},_0x56b29d={};_0x2ed4eb<_0x17242d[_0x47c9('0x40')];_0x2ed4eb+=0x1){_0x2f14b5=_0x17242d[_0x2ed4eb];if(_[_0x47c9('0x3c')](_0x427f1c['voiceQueues'][_0x2f14b5['name']])){_0x427f1c[_0x47c9('0x41')][_0x2f14b5['name']]=new VoiceQueue(_0x2f14b5);}else{_0x427f1c[_0x47c9('0x39')](_0x427f1c[_0x47c9('0x41')][_0x2f14b5['name']],_0x2f14b5);}}}return _0x427f1c[_0x47c9('0x41')];};};Realtime[_0x47c9('0x38')]['initTriggers']=function(){var _0x134acd=this;return function(_0x3dff77){if(_0x3dff77){freeIsNotKey(_0x3dff77,_0x134acd[_0x47c9('0x11')],'id');for(var _0x51a36e=0x0,_0x1a950a={},_0x3e446a={};_0x51a36e<_0x3dff77['length'];_0x51a36e+=0x1){_0x1a950a=_0x3dff77[_0x51a36e];if(_['isUndefined'](_0x134acd[_0x47c9('0x11')][_0x1a950a['id']])){_0x134acd['triggers'][_0x1a950a['id']]=new Trigger(_0x1a950a);}else{_0x134acd[_0x47c9('0x39')](_0x134acd[_0x47c9('0x11')][_0x1a950a['id']],_0x1a950a);}}}return _0x134acd[_0x47c9('0x11')];};};Realtime[_0x47c9('0x38')][_0x47c9('0x42')]=function(){var _0x60c4af=this;return function(_0x560a3e){if(_0x560a3e){freeIsNotKey(_0x560a3e,_0x60c4af[_0x47c9('0x43')],'id');for(var _0x4f6fb4=0x0,_0x37bdc1={},_0x372fb4={};_0x4f6fb4<_0x560a3e['length'];_0x4f6fb4+=0x1){_0x37bdc1=_0x560a3e[_0x4f6fb4];if(_[_0x47c9('0x3c')](_0x60c4af[_0x47c9('0x43')][_0x37bdc1['id']])){_0x60c4af['templates'][_0x37bdc1['id']]=new Template(_0x37bdc1);}else{_0x60c4af[_0x47c9('0x39')](_0x60c4af[_0x47c9('0x43')][_0x37bdc1['id']],_0x37bdc1);}}}return _0x60c4af[_0x47c9('0x43')];};};Realtime['prototype'][_0x47c9('0x44')]=function(){var _0x363020=this;return function(_0x50d92c){if(_0x50d92c){freeIsNotKey(_0x50d92c,_0x363020['zendeskAccounts'],'id');for(var _0x57c079=0x0,_0x4a65e1={},_0xfdbaff={};_0x57c079<_0x50d92c[_0x47c9('0x40')];_0x57c079+=0x1){_0x4a65e1=_0x50d92c[_0x57c079];if(_[_0x47c9('0x3c')](_0x363020[_0x47c9('0x16')][_0x4a65e1['id']])){_0x363020[_0x47c9('0x16')][_0x4a65e1['id']]=new ZendeskAccount(_0x4a65e1);}else{_0x363020['mergeFromDatabase'](_0x363020['zendeskAccounts'][_0x4a65e1['id']],_0x4a65e1);}}}return _0x363020[_0x47c9('0x16')];};};Realtime[_0x47c9('0x38')][_0x47c9('0x45')]=function(){var _0x5063a1=this;return function(_0x185227){if(_0x185227){freeIsNotKey(_0x185227,_0x5063a1['salesforceAccounts'],'id');for(var _0x10f4a2=0x0,_0x43b9cb={},_0x17ae55={};_0x10f4a2<_0x185227[_0x47c9('0x40')];_0x10f4a2+=0x1){_0x43b9cb=_0x185227[_0x10f4a2];if(_['isUndefined'](_0x5063a1[_0x47c9('0x17')][_0x43b9cb['id']])){_0x5063a1[_0x47c9('0x17')][_0x43b9cb['id']]=new SalesforceAccount(_0x43b9cb);}else{_0x5063a1[_0x47c9('0x39')](_0x5063a1[_0x47c9('0x17')][_0x43b9cb['id']],_0x43b9cb);}}}return _0x5063a1[_0x47c9('0x17')];};};Realtime[_0x47c9('0x38')][_0x47c9('0x46')]=function(){var _0x3885ea=this;return function(_0x126ca7){if(_0x126ca7){freeIsNotKey(_0x126ca7,_0x3885ea[_0x47c9('0x19')],'id');for(var _0x55e9f0=0x0,_0x3c6e6c={},_0x4bdd02={};_0x55e9f0<_0x126ca7['length'];_0x55e9f0+=0x1){_0x3c6e6c=_0x126ca7[_0x55e9f0];if(_['isUndefined'](_0x3885ea[_0x47c9('0x19')][_0x3c6e6c['id']])){_0x3885ea[_0x47c9('0x19')][_0x3c6e6c['id']]=new FreshdeskAccount(_0x3c6e6c);}else{_0x3885ea[_0x47c9('0x39')](_0x3885ea['freshdeskAccounts'][_0x3c6e6c['id']],_0x3c6e6c);}}}return _0x3885ea[_0x47c9('0x19')];};};Realtime['prototype'][_0x47c9('0x47')]=function(){var _0x670b62=this;return function(_0x598ca1){if(_0x598ca1){freeIsNotKey(_0x598ca1,_0x670b62[_0x47c9('0x1a')],'id');for(var _0x264b4e=0x0,_0x1b0369={},_0x324d79={};_0x264b4e<_0x598ca1[_0x47c9('0x40')];_0x264b4e+=0x1){_0x1b0369=_0x598ca1[_0x264b4e];if(_[_0x47c9('0x3c')](_0x670b62[_0x47c9('0x1a')][_0x1b0369['id']])){_0x670b62[_0x47c9('0x1a')][_0x1b0369['id']]=new ZohoAccount(_0x1b0369);}else{_0x670b62[_0x47c9('0x39')](_0x670b62['zohoAccounts'][_0x1b0369['id']],_0x1b0369);}}}return _0x670b62['zohoAccounts'];};};Realtime[_0x47c9('0x38')][_0x47c9('0x48')]=function(){var _0x7e9032=this;return function(_0x44a6c0){if(_0x44a6c0){freeIsNotKey(_0x44a6c0,_0x7e9032[_0x47c9('0x1b')],'id');for(var _0x58bff0=0x0,_0x3057a7={},_0x4524a9={};_0x58bff0<_0x44a6c0[_0x47c9('0x40')];_0x58bff0+=0x1){_0x3057a7=_0x44a6c0[_0x58bff0];if(_[_0x47c9('0x3c')](_0x7e9032[_0x47c9('0x1b')][_0x3057a7['id']])){_0x7e9032['deskAccounts'][_0x3057a7['id']]=new DeskAccount(_0x3057a7);}else{_0x7e9032[_0x47c9('0x39')](_0x7e9032[_0x47c9('0x1b')][_0x3057a7['id']],_0x3057a7);}}}return _0x7e9032['deskAccounts'];};};Realtime[_0x47c9('0x38')][_0x47c9('0x49')]=function(){var _0x1f34c4=this;return function(_0x353950){if(_0x353950){freeIsNotKey(_0x353950,_0x1f34c4[_0x47c9('0x18')],'id');for(var _0x3bbc01=0x0,_0x480ac0={},_0x4d7829={};_0x3bbc01<_0x353950[_0x47c9('0x40')];_0x3bbc01+=0x1){_0x480ac0=_0x353950[_0x3bbc01];if(_['isUndefined'](_0x1f34c4['sugarcrmAccounts'][_0x480ac0['id']])){_0x1f34c4[_0x47c9('0x18')][_0x480ac0['id']]=new SugarcrmAccount(_0x480ac0);}else{_0x1f34c4[_0x47c9('0x39')](_0x1f34c4[_0x47c9('0x18')][_0x480ac0['id']],_0x480ac0);}}}return _0x1f34c4['sugarcrmAccounts'];};};Realtime[_0x47c9('0x38')][_0x47c9('0x4a')]=function(){var _0x21e2b1=this;return function(_0x2d9172){if(_0x2d9172){freeIsNotKey(_0x2d9172,_0x21e2b1[_0x47c9('0x4b')],'id');for(var _0x260bce=0x0,_0x2708d2={},_0x160ad1={};_0x260bce<_0x2d9172[_0x47c9('0x40')];_0x260bce+=0x1){_0x2708d2=_0x2d9172[_0x260bce];if(_[_0x47c9('0x3c')](_0x21e2b1[_0x47c9('0x4b')][_0x2708d2['id']])){_0x21e2b1[_0x47c9('0x4b')][_0x2708d2['id']]=new VtigerAccount(_0x2708d2);}else{_0x21e2b1['mergeFromDatabase'](_0x21e2b1['vtigerAccounts'][_0x2708d2['id']],_0x2708d2);}}}return _0x21e2b1[_0x47c9('0x4b')];};};Realtime[_0x47c9('0x38')][_0x47c9('0x4c')]=function(){var _0x105be1=this;return function(_0x49054c){if(_0x49054c){freeIsNotKey(_0x49054c,_0x105be1['servicenowAccounts'],'id');for(var _0x416c81=0x0,_0x5c7120={},_0x89013c={};_0x416c81<_0x49054c[_0x47c9('0x40')];_0x416c81+=0x1){_0x5c7120=_0x49054c[_0x416c81];if(_[_0x47c9('0x3c')](_0x105be1[_0x47c9('0x1c')][_0x5c7120['id']])){_0x105be1[_0x47c9('0x1c')][_0x5c7120['id']]=new ServicenowAccount(_0x5c7120);}else{_0x105be1[_0x47c9('0x39')](_0x105be1[_0x47c9('0x1c')][_0x5c7120['id']],_0x5c7120);}}}return _0x105be1[_0x47c9('0x1c')];};};Realtime[_0x47c9('0x38')][_0x47c9('0x4d')]=function(){var _0x55863d=this;return function(_0x36df6a){if(_0x36df6a){freeIsNotKey(_0x36df6a,_0x55863d[_0x47c9('0x4e')],'id');for(var _0x52cc64=0x0,_0xe9eb22={},_0x1a8719={};_0x52cc64<_0x36df6a['length'];_0x52cc64+=0x1){_0xe9eb22=_0x36df6a[_0x52cc64];if(_[_0x47c9('0x3c')](_0x55863d['dynamics365Accounts'][_0xe9eb22['id']])){_0x55863d[_0x47c9('0x4e')][_0xe9eb22['id']]=new Dynamics365Account(_0xe9eb22);}else{_0x55863d[_0x47c9('0x39')](_0x55863d[_0x47c9('0x4e')][_0xe9eb22['id']],_0xe9eb22);}}}return _0x55863d[_0x47c9('0x4e')];};};Realtime[_0x47c9('0x38')][_0x47c9('0x4f')]=function(){var _0x81f01a=this;return function(_0x36c44e){for(var _0x4d78d5=0x0;_0x4d78d5<_0x36c44e[_0x47c9('0x40')];_0x4d78d5+=0x1){_['merge'](_0x81f01a['voiceQueues'][_0x36c44e[_0x4d78d5][_0x47c9('0x20')]],_0x36c44e[_0x4d78d5]);}return _0x81f01a['voiceQueues'];};};Realtime[_0x47c9('0x38')][_0x47c9('0x50')]=function(){var _0x1d99e6=this;return function(_0x31b3bc){clearVoiceQueues(_0x1d99e6['voiceQueues']);if(_0x31b3bc){_0x31b3bc=_[_0x47c9('0x51')](_0x31b3bc,_0x47c9('0x52'));for(var _0x3b3d89 in _0x31b3bc){if(_0x31b3bc['hasOwnProperty'](_0x3b3d89)){var _0x2a8c54={};for(var _0x3a87c1=0x0;_0x3a87c1<_0x31b3bc[_0x3b3d89][_0x47c9('0x40')];_0x3a87c1+=0x1){var _0x1f1397=_0x31b3bc[_0x3b3d89][_0x3a87c1][_0x47c9('0x53')];if(_0x1d99e6[_0x47c9('0x41')][_0x1f1397]){if(_0x31b3bc[_0x3b3d89][_0x3a87c1][_0x47c9('0x54')]){_0x1d99e6['voiceQueues'][_0x1f1397][_0x47c9('0x2b')]+=0x1;}if(_0x31b3bc[_0x3b3d89][_0x3a87c1][_0x47c9('0x55')]){_0x1d99e6[_0x47c9('0x41')][_0x1f1397][_0x47c9('0x2c')]+=0x1;}_0x1d99e6['voiceQueues'][_0x1f1397][_0x47c9('0x26')]+=moment(_0x31b3bc[_0x3b3d89][_0x3a87c1]['queuecallerleaveAt'])[_0x47c9('0x56')](moment(_0x31b3bc[_0x3b3d89][_0x3a87c1]['queuecallerjoinAt']),_0x47c9('0x57'))||0x0;if(_0x3a87c1===_0x31b3bc[_0x3b3d89][_0x47c9('0x40')]-0x1){_0x1d99e6['voiceQueues'][_0x1f1397][_0x47c9('0x2d')]+=moment(_0x31b3bc[_0x3b3d89][_0x3a87c1][_0x47c9('0x58')]||_0x31b3bc[_0x3b3d89][_0x3a87c1]['queuecallerabandonAt']||_0x31b3bc[_0x3b3d89][_0x3a87c1]['queuecallerexitAt'])[_0x47c9('0x56')](moment(_0x31b3bc[_0x3b3d89][_0x3a87c1]['queuecallerjoinAt']),_0x47c9('0x57'))||0x0;_0x1d99e6[_0x47c9('0x41')][_0x1f1397][_0x47c9('0x24')]+=0x1;if(_0x31b3bc[_0x3b3d89][_0x3a87c1][_0x47c9('0x59')]){_0x1d99e6[_0x47c9('0x41')][_0x1f1397]['answered']+=0x1;_0x1d99e6['voiceQueues'][_0x1f1397][_0x47c9('0x27')]+=moment(_0x31b3bc[_0x3b3d89][_0x3a87c1][_0x47c9('0x58')])[_0x47c9('0x56')](moment(_0x31b3bc[_0x3b3d89][_0x3a87c1][_0x47c9('0x5a')]),'seconds')||0x0;}}else{_0x1d99e6['voiceQueues'][_0x1f1397][_0x47c9('0x2d')]+=_0x1d99e6[_0x47c9('0x41')][_0x1f1397][_0x47c9('0x26')]||0x0;}}}}}}return _0x1d99e6[_0x47c9('0x41')];};};Realtime[_0x47c9('0x38')][_0x47c9('0x5b')]=function(){var _0x27dca9=this;return function(_0x18ecca){clearVoiceCallReports(_0x27dca9['outbound']);if(_0x18ecca){for(var _0x210afd=0x0;_0x210afd<_0x18ecca[_0x47c9('0x40')];_0x210afd+=0x1){_0x27dca9[_0x47c9('0x5c')][_0x47c9('0x24')]+=0x1;_0x27dca9['outbound'][_0x47c9('0x2d')]+=_0x18ecca[_0x210afd][_0x47c9('0x5d')];if(_0x18ecca[_0x210afd][_0x47c9('0x5e')]===_0x47c9('0x5f')){_0x27dca9['outbound'][_0x47c9('0x25')]+=0x1;_0x27dca9[_0x47c9('0x5c')][_0x47c9('0x26')]+=_0x18ecca[_0x210afd][_0x47c9('0x5d')]-_0x18ecca[_0x210afd][_0x47c9('0x60')]||0x0;_0x27dca9[_0x47c9('0x5c')][_0x47c9('0x27')]+=_0x18ecca[_0x210afd][_0x47c9('0x60')];}}}return _0x27dca9[_0x47c9('0x5c')];};};Realtime[_0x47c9('0x38')][_0x47c9('0x61')]=function(){var _0x194ae0=this;return function(_0x2f4d9a){if(_0x2f4d9a){freeIsNotKey(_0x2f4d9a,_0x194ae0[_0x47c9('0x12')],'name');for(var _0x3baf89=0x0,_0x155acc={};_0x3baf89<_0x2f4d9a[_0x47c9('0x40')];_0x3baf89+=0x1){_0x155acc=_0x2f4d9a[_0x3baf89];if(_[_0x47c9('0x3c')](_0x194ae0[_0x47c9('0x12')][_0x155acc[_0x47c9('0x20')]])){_0x194ae0[_0x47c9('0x12')][_0x155acc[_0x47c9('0x20')]]=new Campaign(_0x155acc);}else{_0x194ae0['mergeFromDatabase'](_0x194ae0[_0x47c9('0x12')][_0x155acc['name']],_0x155acc);}}}return _0x194ae0['campaigns'];};};Realtime[_0x47c9('0x38')][_0x47c9('0x62')]=function(){var _0x3eee6b=this;return function(_0x11be50){if(_0x11be50){freeIsNotKey(_0x11be50,_0x3eee6b['voiceExtensions'],'id');for(var _0x3968d8=0x0,_0x16e7b9={};_0x3968d8<_0x11be50[_0x47c9('0x40')];_0x3968d8+=0x1){_0x16e7b9=_0x11be50[_0x3968d8];if(_[_0x47c9('0x3c')](_0x3eee6b['voiceExtensions'][_0x16e7b9['id']])){_0x3eee6b['voiceExtensions'][_0x16e7b9['id']]=new VoiceExtension(_0x16e7b9);}else{_0x3eee6b[_0x47c9('0x39')](_0x3eee6b[_0x47c9('0x13')][_0x16e7b9['id']],_0x16e7b9);}}}return _0x3eee6b[_0x47c9('0x13')];};};Realtime[_0x47c9('0x38')][_0x47c9('0x63')]=function(){var _0x2773fb=this;return function(_0x12d93c){clearCampaigns(_0x2773fb['campaigns']);for(var _0x3cf619=0x0;_0x3cf619<_0x12d93c['length'];_0x3cf619+=0x1){_['merge'](_0x2773fb[_0x47c9('0x12')][_0x12d93c[_0x3cf619][_0x47c9('0x20')]],_0x12d93c[_0x3cf619]);}return _0x2773fb[_0x47c9('0x12')];};};Realtime[_0x47c9('0x38')][_0x47c9('0x64')]=function(){var _0x1cf7a3=this;return function(_0x2f42aa){if(_0x2f42aa){freeIsNotKey(_0x2f42aa,_0x1cf7a3[_0x47c9('0x1d')],'id');for(var _0x439250=0x0,_0x2590c4={},_0x1a00ad={};_0x439250<_0x2f42aa[_0x47c9('0x40')];_0x439250+=0x1){_0x2590c4=_0x2f42aa[_0x439250];if(_[_0x47c9('0x3c')](_0x1cf7a3[_0x47c9('0x1d')][_0x2590c4['id']])){_0x1cf7a3[_0x47c9('0x1d')][_0x2590c4['id']]=new FaxAccount(_0x2590c4);}else{_0x1cf7a3[_0x47c9('0x39')](_0x1cf7a3[_0x47c9('0x1d')][_0x2590c4['id']],_0x2590c4);}}}return _0x1cf7a3['faxAccounts'];};};module[_0x47c9('0x65')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 26360f8..037ebf5 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 _0x2dc7=['connectedlinenum','assigned','format','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','calleridname','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','voiceAgentReport','isArray','forEach','startsWith','Local','indexOf','mobile','phone','lastIndexOf','blindTransfer','exports','bluebird','lodash','moment','util','../../../config/environment','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','find','isNil','accountcode','interface','SIP/%s','name','voiceQueueReport','length','findAgent'];(function(_0x2e913b,_0x4b7071){var _0x173899=function(_0x2a7d22){while(--_0x2a7d22){_0x2e913b['push'](_0x2e913b['shift']());}};_0x173899(++_0x4b7071);}(_0x2dc7,0x13d));var _0x72dc=function(_0x1558ab,_0x39d1de){_0x1558ab=_0x1558ab-0x0;var _0x53b64a=_0x2dc7[_0x1558ab];return _0x53b64a;};'use strict';var BPromise=require(_0x72dc('0x0'));var _=require(_0x72dc('0x1'));var moment=require(_0x72dc('0x2'));var util=require(_0x72dc('0x3'));var config=require(_0x72dc('0x4'));var logger=require('../../../config/logger')(_0x72dc('0x5'));var ami=require(_0x72dc('0x6'));var RpcVoiceAgentReport=require(_0x72dc('0x7'));var RpcVoiceCallReport=require(_0x72dc('0x8'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x72dc('0x9'));var RpcVoiceQueueReport=require(_0x72dc('0xa'));var RpcVoiceRecording=require(_0x72dc('0xb'));var RpcVoiceTransferReport=require(_0x72dc('0xc'));var VoiceQueueReport=require(_0x72dc('0xd'));var VoiceCallReport=require(_0x72dc('0xe'));var VoiceAgentReport=require(_0x72dc('0xf'));var VoiceDialReport=require(_0x72dc('0x10'));var UserReport=require(_0x72dc('0x11'));function Report(_0x4c0c81){this[_0x72dc('0x12')]=_0x4c0c81;this['agents']=_0x4c0c81[_0x72dc('0x13')];this[_0x72dc('0x14')]=_0x4c0c81[_0x72dc('0x14')];}Report[_0x72dc('0x15')][_0x72dc('0x16')]=function(_0x5dedc9){var _0x61984=new VoiceQueueReport(this['realtime']);var _0x26b84=new VoiceAgentReport(this[_0x72dc('0x12')]);var _0x596812=new VoiceDialReport(this['realtime']);var _0x5263ea=new VoiceCallReport(this['realtime']);var _0x30a627=new UserReport(this['realtime']);if(config[_0x72dc('0x17')]&&config[_0x72dc('0x17')][_0x72dc('0x18')]){ami['on'](_0x72dc('0x19'),this['voiceQueueReport'][_0x72dc('0x1a')](this));ami['on'](_0x72dc('0x1b'),this[_0x72dc('0x1c')]['bind'](this));ami['on']('custom:voiceAgentReport',this['voiceAgentReport']['bind'](this));ami['on'](_0x72dc('0x1d'),this[_0x72dc('0x1e')][_0x72dc('0x1a')](this));ami['on'](_0x72dc('0x1f'),this['blindTransfer'][_0x72dc('0x1a')](this));ami['on'](_0x72dc('0x20'),this[_0x72dc('0x21')][_0x72dc('0x1a')](this));}};Report[_0x72dc('0x15')]['findAgent']=function(_0x237a1a){var _0x10b3fa=undefined;_0x10b3fa=_[_0x72dc('0x22')](this[_0x72dc('0x13')],function(_0xda87fe){return _0xda87fe['accountcode']==_0x237a1a||_0xda87fe['name']==_0x237a1a;});if(_[_0x72dc('0x23')](_0x10b3fa)){var _0x2d241e=_[_0x72dc('0x22')](this[_0x72dc('0x14')],function(_0x35d195){return _0x35d195[_0x72dc('0x24')]==_0x237a1a||_0x35d195['name']==_0x237a1a;});if(_0x2d241e){_0x10b3fa=_['find'](this[_0x72dc('0x13')],function(_0x22f72e){return _0x22f72e[_0x72dc('0x25')]==util['format'](_0x72dc('0x26'),_0x2d241e[_0x72dc('0x27')]);});}}return _0x10b3fa;};Report[_0x72dc('0x15')][_0x72dc('0x28')]=function(_0x664719){for(var _0x529c2f=0x0;_0x529c2f<_0x664719[_0x72dc('0x29')];_0x529c2f+=0x1){var _0x4d7881=this[_0x72dc('0x2a')](_0x664719[_0x529c2f][_0x72dc('0x2b')]);if(_0x4d7881){_0x664719[_0x529c2f][_0x72dc('0x24')]=_0x4d7881['accountcode'];_0x664719[_0x529c2f][_0x72dc('0x2c')]=!![];_0x664719[_0x529c2f]['lastAssignedTo']=_0x4d7881[_0x72dc('0x27')];_0x664719[_0x529c2f][_0x72dc('0x25')]=_['isNil'](_0x4d7881[_0x72dc('0x25')])?util[_0x72dc('0x2d')](_0x72dc('0x26'),_0x4d7881['name']):_0x4d7881[_0x72dc('0x25')];if(_0x664719[_0x529c2f][_0x72dc('0x2e')]){_0x664719[_0x529c2f][_0x72dc('0x2f')]=moment()[_0x72dc('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x664719[_0x529c2f][_0x72dc('0x30')]){_0x664719[_0x529c2f][_0x72dc('0x31')]=moment()[_0x72dc('0x2d')](_0x72dc('0x32'));}RpcMemberReport[_0x72dc('0x28')](_0x664719[_0x529c2f]);}RpcVoiceQueueReport[_0x72dc('0x33')](_0x664719[_0x529c2f]);}};function extractCalleridNumber(_0x54308a){var _0xa92261=_0x54308a['match'](/<(.*?)>/);return _0xa92261?_0xa92261[0x1]:_0x54308a;}Report[_0x72dc('0x15')][_0x72dc('0x1c')]=function(_0x152d32){_0x152d32[_0x72dc('0x34')]=_0x152d32[_0x72dc('0x34')]||_0x152d32[_0x72dc('0x35')];if(_0x152d32[_0x72dc('0x36')]==_0x72dc('0x37')){_0x152d32[_0x72dc('0x38')]=_0x72dc('0x39');_0x152d32[_0x72dc('0x3a')]=_0x152d32[_0x72dc('0x39')];if(_0x152d32[_0x72dc('0x3b')]==_0x72dc('0x3c')){_0x152d32[_0x72dc('0x24')]='';_0x152d32[_0x72dc('0x34')]=extractCalleridNumber(_0x152d32[_0x72dc('0x3d')]);}else if(_0x152d32['context']==_0x72dc('0x3e')){if(_0x152d32[_0x72dc('0x34')]==_0x72dc('0x3f')){_0x152d32['destination']=extractCalleridNumber(_0x152d32[_0x72dc('0x40')]);_0x152d32[_0x72dc('0x41')]=_0x152d32[_0x72dc('0x42')];_0x152d32[_0x72dc('0x43')]=[_0x152d32['channel'],_0x152d32[_0x72dc('0x44')]=_0x152d32[_0x72dc('0x43')]][0x0];_0x152d32[_0x72dc('0x3d')]=_0x152d32['calleridpreview'];}else{_0x152d32[_0x72dc('0x34')]=_0x152d32[_0x72dc('0x41')];_0x152d32[_0x72dc('0x41')]=_0x152d32['originatecalleridnum'];if(_0x152d32[_0x72dc('0x45')]==_0x72dc('0x46')){_0x152d32[_0x72dc('0x24')]=_0x152d32[_0x72dc('0x2b')];}else{_0x152d32['accountcode']='';}}}}else{_0x152d32['callerid']=util['format']('\x22%s\x22\x20<%s>',_0x152d32[_0x72dc('0x47')],_0x152d32[_0x72dc('0x41')]);}RpcVoiceCallReport[_0x72dc('0x33')](_0x152d32);if(_0x152d32['monitor']){for(var _0xc4c675=0x0;_0xc4c675<_0x152d32[_0x72dc('0x48')][_0x72dc('0x29')];_0xc4c675+=0x1){_0x152d32[_0x72dc('0x49')]=_0x152d32[_0x72dc('0x48')][_0xc4c675][_0x72dc('0x4a')];_0x152d32[_0x72dc('0x4b')]=_0x152d32[_0x72dc('0x48')][_0xc4c675][_0x72dc('0x4b')];if(_0x152d32['exten']==_0x72dc('0x3f')){_0x152d32[_0x72dc('0x41')]=_0x152d32[_0x72dc('0x2b')];_0x152d32[_0x72dc('0x47')]=_0x152d32[_0x72dc('0x4c')];_0x152d32[_0x72dc('0x2b')]=_0x152d32[_0x72dc('0x24')];_0x152d32[_0x72dc('0x4c')]=_0x152d32[_0x72dc('0x4d')];_0x152d32[_0x72dc('0x35')]=_0x152d32['originatecalleridnum'];}else if(_0x152d32[_0x72dc('0x35')]==_0x72dc('0x4e')){_0x152d32[_0x72dc('0x41')]=_0x152d32['destination'];_0x152d32[_0x72dc('0x35')]=_0x152d32[_0x72dc('0x42')];}RpcVoiceRecording[_0x72dc('0x33')](_0x152d32);}}};Report['prototype'][_0x72dc('0x4f')]=function(_0x373ef3){if(_[_0x72dc('0x50')](_0x373ef3)){_0x373ef3[_0x72dc('0x51')](function(_0x3e6613){RpcVoiceAgentReport['create'](_0x3e6613);});}else{RpcVoiceAgentReport['create'](_0x373ef3);}};Report[_0x72dc('0x15')]['voiceDialReport']=function(_0x54571a){RpcVoiceDialReport[_0x72dc('0x33')](_0x54571a);var _0x8de717=undefined;var _0x178d1f=_0x54571a['channel'];if(_[_0x72dc('0x52')](_0x178d1f,_0x72dc('0x53'))){var _0x479b7c=_0x178d1f['substring'](_0x178d1f[_0x72dc('0x54')]('/')+0x1,_0x178d1f[_0x72dc('0x54')]('@'));_0x8de717=_[_0x72dc('0x22')](this['agents'],function(_0x560771){return _0x560771[_0x72dc('0x55')]==_0x479b7c||_0x560771[_0x72dc('0x56')]==_0x479b7c||_0x560771[_0x72dc('0x24')]==_0x479b7c;});}else{var _0x479b7c=_0x178d1f['substring'](_0x178d1f[_0x72dc('0x54')]('/')+0x1,_0x178d1f[_0x72dc('0x57')]('-'));_0x8de717=this[_0x72dc('0x2a')](_0x479b7c);}if(_0x8de717){_0x54571a[_0x72dc('0x25')]=_['isNil'](_0x8de717[_0x72dc('0x25')])?util[_0x72dc('0x2d')](_0x72dc('0x26'),_0x8de717[_0x72dc('0x27')]):_0x8de717[_0x72dc('0x25')];_0x54571a[_0x72dc('0x4d')]=_0x8de717[_0x72dc('0x27')];_0x54571a[_0x72dc('0x24')]=_0x8de717[_0x72dc('0x24')];RpcMemberReport[_0x72dc('0x1e')](_0x54571a);}};Report[_0x72dc('0x15')]['blindTransfer']=function(_0x489fa4){RpcVoiceTransferReport[_0x72dc('0x58')](_0x489fa4);};Report['prototype'][_0x72dc('0x21')]=function(_0x567c8e){RpcVoiceTransferReport[_0x72dc('0x21')](_0x567c8e);};module[_0x72dc('0x59')]=Report; \ No newline at end of file +var _0x7098=['lodash','moment','util','../ami','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','find','name','accountcode','interface','format','SIP/%s','findAgent','connectedlinenum','assigned','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','callerid','calleridnum','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','create','monitors','length','monitorFilename','filename','createdAt','connectedlinename','membername','forEach','Local','substring','indexOf','phone','lastIndexOf','isNil','exports','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7098,0x14f));var _0x8709=function(_0x96ee81,_0xc97278){_0x96ee81=_0x96ee81-0x0;var _0x31d80c=_0x7098[_0x96ee81];return _0x31d80c;};'use strict';var BPromise=require(_0x8709('0x0'));var _=require(_0x8709('0x1'));var moment=require(_0x8709('0x2'));var util=require(_0x8709('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('ami');var ami=require(_0x8709('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x8709('0x5'));var RpcMemberReport=require(_0x8709('0x6'));var RpcVoiceQueueReport=require(_0x8709('0x7'));var RpcVoiceRecording=require(_0x8709('0x8'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x8709('0x9'));var VoiceCallReport=require(_0x8709('0xa'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x8709('0xb'));var UserReport=require(_0x8709('0xc'));function Report(_0x391c4b){this[_0x8709('0xd')]=_0x391c4b;this[_0x8709('0xe')]=_0x391c4b[_0x8709('0xe')];this[_0x8709('0xf')]=_0x391c4b[_0x8709('0xf')];}Report[_0x8709('0x10')][_0x8709('0x11')]=function(_0xc7476a){var _0x18e260=new VoiceQueueReport(this[_0x8709('0xd')]);var _0x31aec0=new VoiceAgentReport(this[_0x8709('0xd')]);var _0x2ef335=new VoiceDialReport(this[_0x8709('0xd')]);var _0x13e44d=new VoiceCallReport(this[_0x8709('0xd')]);var _0x5348f9=new UserReport(this[_0x8709('0xd')]);if(config[_0x8709('0x12')]&&config[_0x8709('0x12')][_0x8709('0x13')]){ami['on'](_0x8709('0x14'),this[_0x8709('0x15')][_0x8709('0x16')](this));ami['on'](_0x8709('0x17'),this[_0x8709('0x18')][_0x8709('0x16')](this));ami['on'](_0x8709('0x19'),this[_0x8709('0x1a')][_0x8709('0x16')](this));ami['on'](_0x8709('0x1b'),this[_0x8709('0x1c')][_0x8709('0x16')](this));ami['on'](_0x8709('0x1d'),this[_0x8709('0x1e')][_0x8709('0x16')](this));ami['on']('attendedtransfer',this[_0x8709('0x1f')][_0x8709('0x16')](this));}};Report[_0x8709('0x10')]['findAgent']=function(_0xa1e7dc){var _0x48a19f=undefined;_0x48a19f=_[_0x8709('0x20')](this[_0x8709('0xe')],function(_0xe87cec){return _0xe87cec['accountcode']==_0xa1e7dc||_0xe87cec[_0x8709('0x21')]==_0xa1e7dc;});if(_['isNil'](_0x48a19f)){var _0x40db57=_[_0x8709('0x20')](this['telephones'],function(_0x356820){return _0x356820[_0x8709('0x22')]==_0xa1e7dc||_0x356820[_0x8709('0x21')]==_0xa1e7dc;});if(_0x40db57){_0x48a19f=_[_0x8709('0x20')](this[_0x8709('0xe')],function(_0xa9a4ef){return _0xa9a4ef[_0x8709('0x23')]==util[_0x8709('0x24')](_0x8709('0x25'),_0x40db57[_0x8709('0x21')]);});}}return _0x48a19f;};Report[_0x8709('0x10')]['voiceQueueReport']=function(_0x2a4012){for(var _0x2ae17e=0x0;_0x2ae17e<_0x2a4012['length'];_0x2ae17e+=0x1){var _0x6af399=this[_0x8709('0x26')](_0x2a4012[_0x2ae17e][_0x8709('0x27')]);if(_0x6af399){_0x2a4012[_0x2ae17e][_0x8709('0x22')]=_0x6af399[_0x8709('0x22')];_0x2a4012[_0x2ae17e][_0x8709('0x28')]=!![];_0x2a4012[_0x2ae17e][_0x8709('0x29')]=_0x6af399[_0x8709('0x21')];_0x2a4012[_0x2ae17e]['interface']=_['isNil'](_0x6af399[_0x8709('0x23')])?util[_0x8709('0x24')](_0x8709('0x25'),_0x6af399['name']):_0x6af399['interface'];if(_0x2a4012[_0x2ae17e]['queuecallercomplete']){_0x2a4012[_0x2ae17e][_0x8709('0x2a')]=moment()[_0x8709('0x24')](_0x8709('0x2b'));}if(_0x2a4012[_0x2ae17e][_0x8709('0x2c')]){_0x2a4012[_0x2ae17e][_0x8709('0x2d')]=moment()[_0x8709('0x24')](_0x8709('0x2b'));}RpcMemberReport['voiceQueueReport'](_0x2a4012[_0x2ae17e]);}RpcVoiceQueueReport['create'](_0x2a4012[_0x2ae17e]);}};function extractCalleridNumber(_0x416667){var _0x5013c9=_0x416667[_0x8709('0x2e')](/<(.*?)>/);return _0x5013c9?_0x5013c9[0x1]:_0x416667;}Report[_0x8709('0x10')][_0x8709('0x18')]=function(_0x25c95d){_0x25c95d[_0x8709('0x2f')]=_0x25c95d[_0x8709('0x2f')]||_0x25c95d[_0x8709('0x30')];if(_0x25c95d[_0x8709('0x31')]==_0x8709('0x32')){_0x25c95d[_0x8709('0x33')]=_0x8709('0x34');_0x25c95d[_0x8709('0x35')]=_0x25c95d[_0x8709('0x34')];if(_0x25c95d[_0x8709('0x36')]==_0x8709('0x37')){_0x25c95d[_0x8709('0x22')]='';_0x25c95d[_0x8709('0x2f')]=extractCalleridNumber(_0x25c95d['callerid']);}else if(_0x25c95d[_0x8709('0x36')]==_0x8709('0x38')){if(_0x25c95d[_0x8709('0x2f')]==_0x8709('0x39')){_0x25c95d[_0x8709('0x2f')]=extractCalleridNumber(_0x25c95d[_0x8709('0x3a')]);_0x25c95d['calleridnum']=_0x25c95d[_0x8709('0x3b')];_0x25c95d[_0x8709('0x3c')]=[_0x25c95d[_0x8709('0x3d')],_0x25c95d[_0x8709('0x3d')]=_0x25c95d[_0x8709('0x3c')]][0x0];_0x25c95d[_0x8709('0x3e')]=_0x25c95d[_0x8709('0x3a')];}else{_0x25c95d[_0x8709('0x2f')]=_0x25c95d['calleridnum'];_0x25c95d[_0x8709('0x3f')]=_0x25c95d[_0x8709('0x3b')];if(_0x25c95d[_0x8709('0x40')]==_0x8709('0x41')){_0x25c95d[_0x8709('0x22')]=_0x25c95d[_0x8709('0x27')];}else{_0x25c95d[_0x8709('0x22')]='';}}}}else{_0x25c95d[_0x8709('0x3e')]=util[_0x8709('0x24')](_0x8709('0x42'),_0x25c95d[_0x8709('0x43')],_0x25c95d['calleridnum']);}RpcVoiceCallReport[_0x8709('0x44')](_0x25c95d);if(_0x25c95d['monitor']){for(var _0x311167=0x0;_0x311167<_0x25c95d[_0x8709('0x45')][_0x8709('0x46')];_0x311167+=0x1){_0x25c95d[_0x8709('0x47')]=_0x25c95d[_0x8709('0x45')][_0x311167][_0x8709('0x48')];_0x25c95d[_0x8709('0x49')]=_0x25c95d['monitors'][_0x311167][_0x8709('0x49')];if(_0x25c95d[_0x8709('0x30')]==_0x8709('0x39')){_0x25c95d[_0x8709('0x3f')]=_0x25c95d[_0x8709('0x27')];_0x25c95d['calleridname']=_0x25c95d[_0x8709('0x4a')];_0x25c95d['connectedlinenum']=_0x25c95d['accountcode'];_0x25c95d[_0x8709('0x4a')]=_0x25c95d[_0x8709('0x4b')];_0x25c95d[_0x8709('0x30')]=_0x25c95d[_0x8709('0x3b')];}else if(_0x25c95d['exten']=='xcally-motion-dialer'){_0x25c95d[_0x8709('0x3f')]=_0x25c95d['destination'];_0x25c95d[_0x8709('0x30')]=_0x25c95d[_0x8709('0x3b')];}RpcVoiceRecording['create'](_0x25c95d);}}};Report[_0x8709('0x10')][_0x8709('0x1a')]=function(_0x450494){if(_['isArray'](_0x450494)){_0x450494[_0x8709('0x4c')](function(_0x14c41d){RpcVoiceAgentReport['create'](_0x14c41d);});}else{RpcVoiceAgentReport[_0x8709('0x44')](_0x450494);}};Report[_0x8709('0x10')][_0x8709('0x1c')]=function(_0x3d02df){RpcVoiceDialReport[_0x8709('0x44')](_0x3d02df);var _0xb8d207=undefined;var _0x5c08da=_0x3d02df[_0x8709('0x3d')];if(_['startsWith'](_0x5c08da,_0x8709('0x4d'))){var _0x291570=_0x5c08da[_0x8709('0x4e')](_0x5c08da['indexOf']('/')+0x1,_0x5c08da[_0x8709('0x4f')]('@'));_0xb8d207=_[_0x8709('0x20')](this['agents'],function(_0x43b2ae){return _0x43b2ae['mobile']==_0x291570||_0x43b2ae[_0x8709('0x50')]==_0x291570||_0x43b2ae[_0x8709('0x22')]==_0x291570;});}else{var _0x291570=_0x5c08da[_0x8709('0x4e')](_0x5c08da[_0x8709('0x4f')]('/')+0x1,_0x5c08da[_0x8709('0x51')]('-'));_0xb8d207=this[_0x8709('0x26')](_0x291570);}if(_0xb8d207){_0x3d02df['interface']=_[_0x8709('0x52')](_0xb8d207[_0x8709('0x23')])?util['format']('SIP/%s',_0xb8d207[_0x8709('0x21')]):_0xb8d207['interface'];_0x3d02df[_0x8709('0x4b')]=_0xb8d207[_0x8709('0x21')];_0x3d02df[_0x8709('0x22')]=_0xb8d207[_0x8709('0x22')];RpcMemberReport[_0x8709('0x1c')](_0x3d02df);}};Report[_0x8709('0x10')][_0x8709('0x1e')]=function(_0x5e36cf){RpcVoiceTransferReport[_0x8709('0x1e')](_0x5e36cf);};Report[_0x8709('0x10')][_0x8709('0x1f')]=function(_0x361c40){RpcVoiceTransferReport['attendedTransfer'](_0x361c40);};module[_0x8709('0x53')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index f11d447..5392e59 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 _0xebde=['registered','status','address','telephone:%s','error','[syncPeerStatus][UserReport]','exports','moment','bluebird','util','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','loopSyncRealTimeShow','resolve','actionSipShowRegistry','actionDeviceStateList','then','inspect','prototype','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','isNotNull','emit','find','stateRegistry','state','merge','omit','actionid','username','format','trunk:%s','name','trunk:save','device','toLowerCase','inuse','local','toNumber','updateStatusRealtime','stateTime','telephone:save','Queue','startsWith','substring','indexOf','mobile','phone','accountcode','[syncDeviceState][UserReport]','syncPeerStatus','peerstatus','peer'];(function(_0x31e1d4,_0x2687bf){var _0x3cf0cd=function(_0x136bcf){while(--_0x136bcf){_0x31e1d4['push'](_0x31e1d4['shift']());}};_0x3cf0cd(++_0x2687bf);}(_0xebde,0x1ea));var _0xeebd=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0xebde[_0x59d89e];return _0x554e93;};'use strict';var _=require('lodash');var moment=require(_0xeebd('0x0'));var BPromise=require(_0xeebd('0x1'));var util=require(_0xeebd('0x2'));var Redis=require(_0xeebd('0x3'));var config=require(_0xeebd('0x4'));var logger=require('../../../config/logger')(_0xeebd('0x5'));var ami=require(_0xeebd('0x6'));config[_0xeebd('0x7')]=_[_0xeebd('0x8')](config[_0xeebd('0x7')],{'host':_0xeebd('0x9'),'port':0x18eb});var io=require(_0xeebd('0xa'))(new Redis(config[_0xeebd('0x7')]));function UserReport(_0x6e4a2a){this[_0xeebd('0xb')]=_0x6e4a2a[_0xeebd('0xb')];this[_0xeebd('0xc')]=_0x6e4a2a[_0xeebd('0xc')];this[_0xeebd('0xd')]=_0x6e4a2a['telephones'];ami['on'](_0xeebd('0xe'),this[_0xeebd('0xf')][_0xeebd('0x10')](this));ami['on'](_0xeebd('0x11'),this[_0xeebd('0xf')][_0xeebd('0x10')](this));ami['on'](_0xeebd('0x12'),this[_0xeebd('0x13')]['bind'](this));ami['on']('peerstatus',this['syncPeerStatus'][_0xeebd('0x10')](this));this[_0xeebd('0x14')]();return BPromise[_0xeebd('0x15')]()['then'](ami[_0xeebd('0x16')]())['then'](ami[_0xeebd('0x17')]())[_0xeebd('0x18')](ami['actionSipPeerStatus']())['catch'](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x38bc81){return function(_0x149980){logger['error'](_0x38bc81,util[_0xeebd('0x19')](_0x149980,{'showHidden':![],'depth':null}));};}UserReport[_0xeebd('0x1a')][_0xeebd('0x14')]=function(){setInterval(function(){BPromise[_0xeebd('0x15')]()[_0xeebd('0x18')](ami[_0xeebd('0x16')]())[_0xeebd('0x18')](ami['actionDeviceStateList']())[_0xeebd('0x18')](ami[_0xeebd('0x1b')]())[_0xeebd('0x1c')](loggerCatch(_0xeebd('0x1d')));},0x32c8);};UserReport[_0xeebd('0x1a')][_0xeebd('0x1e')]=function(_0x545420){return _0x545420!==null&&!_['isUndefined'](_0x545420);};UserReport[_0xeebd('0x1a')][_0xeebd('0x1f')]=function(_0x3b9473,_0x3992f9,_0x5630fc){io['to'](_0x3b9473)['emit'](_0x3992f9,_0x5630fc);};UserReport['prototype'][_0xeebd('0xf')]=function(_0x328245){try{if(this[_0xeebd('0x1e')](_0x328245)){var _0x1db37=_[_0xeebd('0x20')](this[_0xeebd('0xb')],{'registry':_0x328245['username']});if(_0x1db37){_0x328245[_0xeebd('0x21')]=_0x328245[_0xeebd('0x22')];_[_0xeebd('0x23')](_0x1db37,_[_0xeebd('0x24')](_0x328245,['event',_0xeebd('0x25'),_0xeebd('0x26'),_0xeebd('0x22')]));this[_0xeebd('0x1f')](util[_0xeebd('0x27')](_0xeebd('0x28'),_0x1db37[_0xeebd('0x29')]),_0xeebd('0x2a'),_0x1db37);}}}catch(_0x32393a){logger['error']('[syncRegistry][UserReport]',util[_0xeebd('0x19')](_0x32393a,{'showHidden':![],'depth':null}));}};UserReport[_0xeebd('0x1a')]['syncDeviceState']=function(_0x6fa46d){try{if(this[_0xeebd('0x1e')](_0x6fa46d)){if(this[_0xeebd('0xc')][_0x6fa46d[_0xeebd('0x2b')]]){if(!this[_0xeebd('0xc')][_0x6fa46d[_0xeebd('0x2b')]]['local']||_0x6fa46d[_0xeebd('0x22')][_0xeebd('0x2c')]()==_0xeebd('0x2d')){this[_0xeebd('0xc')][_0x6fa46d[_0xeebd('0x2b')]][_0xeebd('0x2e')]=![];if(this['agents'][_0x6fa46d[_0xeebd('0x2b')]][_0xeebd('0x22')]!==_0x6fa46d[_0xeebd('0x22')][_0xeebd('0x2c')]()){this[_0xeebd('0xc')][_0x6fa46d[_0xeebd('0x2b')]]['stateTime']=_[_0xeebd('0x2f')](moment()['format']('x'));}this['agents'][_0x6fa46d['device']][_0xeebd('0x22')]=_0x6fa46d[_0xeebd('0x22')][_0xeebd('0x2c')]();this['agents'][_0x6fa46d[_0xeebd('0x2b')]][_0xeebd('0x30')](_0x6fa46d);}}else if(this['telephones'][_0x6fa46d[_0xeebd('0x2b')]]){if(this[_0xeebd('0xd')][_0x6fa46d[_0xeebd('0x2b')]][_0xeebd('0x22')]!==_0x6fa46d[_0xeebd('0x22')][_0xeebd('0x2c')]()){this[_0xeebd('0xd')][_0x6fa46d['device']][_0xeebd('0x31')]=_[_0xeebd('0x2f')](moment()[_0xeebd('0x27')]('x'));}this[_0xeebd('0xd')][_0x6fa46d[_0xeebd('0x2b')]]['state']=_0x6fa46d['state'][_0xeebd('0x2c')]();this[_0xeebd('0x1f')](util[_0xeebd('0x27')]('telephone:%s',this[_0xeebd('0xd')][_0x6fa46d[_0xeebd('0x2b')]][_0xeebd('0x29')]),_0xeebd('0x32'),this[_0xeebd('0xd')][_0x6fa46d[_0xeebd('0x2b')]]);}else if(this['trunks'][_0x6fa46d[_0xeebd('0x2b')]]){if(this[_0xeebd('0xb')][_0x6fa46d[_0xeebd('0x2b')]][_0xeebd('0x22')]!==_0x6fa46d[_0xeebd('0x22')]['toLowerCase']()){this[_0xeebd('0xb')][_0x6fa46d[_0xeebd('0x2b')]][_0xeebd('0x31')]=_[_0xeebd('0x2f')](moment()[_0xeebd('0x27')]('x'));}this[_0xeebd('0xb')][_0x6fa46d['device']][_0xeebd('0x22')]=_0x6fa46d[_0xeebd('0x22')]['toLowerCase']();this[_0xeebd('0x1f')](util['format']('trunk:%s',this['trunks'][_0x6fa46d['device']][_0xeebd('0x29')]),_0xeebd('0x2a'),this[_0xeebd('0xb')][_0x6fa46d['device']]);}else if(_['startsWith'](_0x6fa46d['device'],_0xeebd('0x33'))){}else if(_[_0xeebd('0x34')](_0x6fa46d['device'],'Local')){var _0x226fbc=_0x6fa46d[_0xeebd('0x2b')];var _0x375ed1=_0x226fbc[_0xeebd('0x35')](_0x226fbc[_0xeebd('0x36')]('/')+0x1,_0x226fbc[_0xeebd('0x36')]('@'));var _0x342984=_[_0xeebd('0x20')](this[_0xeebd('0xc')],function(_0xb599dc){return _0xb599dc[_0xeebd('0x37')]==_0x375ed1||_0xb599dc[_0xeebd('0x38')]==_0x375ed1||_0xb599dc[_0xeebd('0x39')]==_0x375ed1;});if(_0x342984){if(_0x342984[_0xeebd('0x22')]!==_0x6fa46d[_0xeebd('0x22')][_0xeebd('0x2c')]()){_0x342984[_0xeebd('0x31')]=_[_0xeebd('0x2f')](moment()[_0xeebd('0x27')]('x'));}_0x342984[_0xeebd('0x22')]=_0x6fa46d['state'][_0xeebd('0x2c')]();_0x342984['local']=!![];_0x342984[_0xeebd('0x30')](_0x6fa46d);}}else{}}}catch(_0x2b7919){logger['error'](_0xeebd('0x3a'),util[_0xeebd('0x19')](_0x2b7919,{'showHidden':![],'depth':null}));}};UserReport[_0xeebd('0x1a')][_0xeebd('0x3b')]=function(_0x419264){try{if(this['isNotNull'](_0x419264)&&this[_0xeebd('0x1e')](_0x419264[_0xeebd('0x3c')])){if(this['agents'][_0x419264[_0xeebd('0x3d')]]){if(!this[_0xeebd('0xc')][_0x419264['peer']][_0xeebd('0x2e')]||_0x419264[_0xeebd('0x3c')][_0xeebd('0x2c')]()==_0xeebd('0x3e')){this[_0xeebd('0xc')][_0x419264[_0xeebd('0x3d')]]['local']=![];this[_0xeebd('0xc')][_0x419264['peer']][_0xeebd('0x3f')]=_0x419264[_0xeebd('0x3c')]['toLowerCase']();this['agents'][_0x419264[_0xeebd('0x3d')]][_0xeebd('0x40')]=_0x419264[_0xeebd('0x40')];this[_0xeebd('0xc')][_0x419264['peer']][_0xeebd('0x30')](_0x419264);}}else if(this['telephones'][_0x419264[_0xeebd('0x3d')]]){this[_0xeebd('0xd')][_0x419264[_0xeebd('0x3d')]][_0xeebd('0x3f')]=_0x419264[_0xeebd('0x3c')]['toLowerCase']();this['telephones'][_0x419264['peer']]['address']=_0x419264['address'];this[_0xeebd('0x1f')](util['format'](_0xeebd('0x41'),this[_0xeebd('0xd')][_0x419264[_0xeebd('0x3d')]][_0xeebd('0x29')]),_0xeebd('0x32'),this['telephones'][_0x419264[_0xeebd('0x3d')]]);}else if(this[_0xeebd('0xb')][_0x419264[_0xeebd('0x3d')]]){this[_0xeebd('0xb')][_0x419264['peer']][_0xeebd('0x3f')]=_0x419264[_0xeebd('0x3c')]['toLowerCase']();this['trunks'][_0x419264[_0xeebd('0x3d')]][_0xeebd('0x40')]=_0x419264[_0xeebd('0x40')];this[_0xeebd('0x1f')](util[_0xeebd('0x27')](_0xeebd('0x28'),this[_0xeebd('0xb')][_0x419264[_0xeebd('0x3d')]][_0xeebd('0x29')]),_0xeebd('0x2a'),this[_0xeebd('0xb')][_0x419264[_0xeebd('0x3d')]]);}else{}}}catch(_0x640d79){logger[_0xeebd('0x42')](_0xeebd('0x43'),util[_0xeebd('0x19')](_0x640d79,{'showHidden':![],'depth':null}));}};module[_0xeebd('0x44')]=UserReport; \ No newline at end of file +var _0x490c=['error','inspect','prototype','isNotNull','emit','find','username','stateRegistry','state','actionid','format','trunk:%s','trunk:save','[syncRegistry][UserReport]','device','local','toLowerCase','inuse','stateTime','updateStatusRealtime','telephone:%s','name','telephone:save','toNumber','startsWith','Queue','Local','indexOf','mobile','phone','accountcode','[syncDeviceState][UserReport]','peer','peerstatus','registered','status','address','exports','lodash','moment','util','ioredis','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','[loopSyncRealTimeShow]'];(function(_0x5eeeae,_0x21a5da){var _0x1cb1be=function(_0xc73b70){while(--_0xc73b70){_0x5eeeae['push'](_0x5eeeae['shift']());}};_0x1cb1be(++_0x21a5da);}(_0x490c,0xe9));var _0xc490=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x490c[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xc490('0x0'));var moment=require(_0xc490('0x1'));var BPromise=require('bluebird');var util=require(_0xc490('0x2'));var Redis=require(_0xc490('0x3'));var config=require('../../../config/environment');var logger=require(_0xc490('0x4'))(_0xc490('0x5'));var ami=require(_0xc490('0x6'));config[_0xc490('0x7')]=_['defaults'](config['redis'],{'host':_0xc490('0x8'),'port':0x18eb});var io=require(_0xc490('0x9'))(new Redis(config[_0xc490('0x7')]));function UserReport(_0x5e375c){this[_0xc490('0xa')]=_0x5e375c[_0xc490('0xa')];this[_0xc490('0xb')]=_0x5e375c['agents'];this['telephones']=_0x5e375c[_0xc490('0xc')];ami['on'](_0xc490('0xd'),this[_0xc490('0xe')][_0xc490('0xf')](this));ami['on'](_0xc490('0x10'),this['syncRegistry'][_0xc490('0xf')](this));ami['on'](_0xc490('0x11'),this[_0xc490('0x12')][_0xc490('0xf')](this));ami['on']('peerstatus',this[_0xc490('0x13')][_0xc490('0xf')](this));this[_0xc490('0x14')]();return BPromise[_0xc490('0x15')]()[_0xc490('0x16')](ami[_0xc490('0x17')]())[_0xc490('0x16')](ami[_0xc490('0x18')]())[_0xc490('0x16')](ami['actionSipPeerStatus']())[_0xc490('0x19')](loggerCatch(_0xc490('0x1a')));}function loggerCatch(_0x2a99df){return function(_0x2f7e87){logger[_0xc490('0x1b')](_0x2a99df,util[_0xc490('0x1c')](_0x2f7e87,{'showHidden':![],'depth':null}));};}UserReport['prototype'][_0xc490('0x14')]=function(){setInterval(function(){BPromise['resolve']()[_0xc490('0x16')](ami['actionSipShowRegistry']())[_0xc490('0x16')](ami['actionDeviceStateList']())[_0xc490('0x16')](ami['actionSipPeerStatus']())[_0xc490('0x19')](loggerCatch(_0xc490('0x1a')));},0x32c8);};UserReport[_0xc490('0x1d')][_0xc490('0x1e')]=function(_0x3c5fc8){return _0x3c5fc8!==null&&!_['isUndefined'](_0x3c5fc8);};UserReport['prototype'][_0xc490('0x1f')]=function(_0x557692,_0x37d924,_0x7d54f7){io['to'](_0x557692)['emit'](_0x37d924,_0x7d54f7);};UserReport[_0xc490('0x1d')][_0xc490('0xe')]=function(_0x297539){try{if(this[_0xc490('0x1e')](_0x297539)){var _0x58e107=_[_0xc490('0x20')](this[_0xc490('0xa')],{'registry':_0x297539[_0xc490('0x21')]});if(_0x58e107){_0x297539[_0xc490('0x22')]=_0x297539[_0xc490('0x23')];_['merge'](_0x58e107,_['omit'](_0x297539,['event',_0xc490('0x24'),_0xc490('0x21'),_0xc490('0x23')]));this[_0xc490('0x1f')](util[_0xc490('0x25')](_0xc490('0x26'),_0x58e107['name']),_0xc490('0x27'),_0x58e107);}}}catch(_0x25f93b){logger[_0xc490('0x1b')](_0xc490('0x28'),util[_0xc490('0x1c')](_0x25f93b,{'showHidden':![],'depth':null}));}};UserReport[_0xc490('0x1d')][_0xc490('0x12')]=function(_0x1f1cf5){try{if(this[_0xc490('0x1e')](_0x1f1cf5)){if(this['agents'][_0x1f1cf5[_0xc490('0x29')]]){if(!this[_0xc490('0xb')][_0x1f1cf5[_0xc490('0x29')]][_0xc490('0x2a')]||_0x1f1cf5[_0xc490('0x23')][_0xc490('0x2b')]()==_0xc490('0x2c')){this['agents'][_0x1f1cf5['device']][_0xc490('0x2a')]=![];if(this['agents'][_0x1f1cf5[_0xc490('0x29')]][_0xc490('0x23')]!==_0x1f1cf5[_0xc490('0x23')][_0xc490('0x2b')]()){this[_0xc490('0xb')][_0x1f1cf5['device']][_0xc490('0x2d')]=_['toNumber'](moment()[_0xc490('0x25')]('x'));}this[_0xc490('0xb')][_0x1f1cf5[_0xc490('0x29')]][_0xc490('0x23')]=_0x1f1cf5[_0xc490('0x23')][_0xc490('0x2b')]();this['agents'][_0x1f1cf5[_0xc490('0x29')]][_0xc490('0x2e')](_0x1f1cf5);}}else if(this['telephones'][_0x1f1cf5[_0xc490('0x29')]]){if(this[_0xc490('0xc')][_0x1f1cf5[_0xc490('0x29')]][_0xc490('0x23')]!==_0x1f1cf5[_0xc490('0x23')]['toLowerCase']()){this[_0xc490('0xc')][_0x1f1cf5[_0xc490('0x29')]][_0xc490('0x2d')]=_['toNumber'](moment()[_0xc490('0x25')]('x'));}this[_0xc490('0xc')][_0x1f1cf5['device']][_0xc490('0x23')]=_0x1f1cf5['state'][_0xc490('0x2b')]();this['emit'](util[_0xc490('0x25')](_0xc490('0x2f'),this['telephones'][_0x1f1cf5[_0xc490('0x29')]][_0xc490('0x30')]),_0xc490('0x31'),this[_0xc490('0xc')][_0x1f1cf5['device']]);}else if(this[_0xc490('0xa')][_0x1f1cf5[_0xc490('0x29')]]){if(this[_0xc490('0xa')][_0x1f1cf5[_0xc490('0x29')]][_0xc490('0x23')]!==_0x1f1cf5[_0xc490('0x23')][_0xc490('0x2b')]()){this[_0xc490('0xa')][_0x1f1cf5[_0xc490('0x29')]][_0xc490('0x2d')]=_[_0xc490('0x32')](moment()[_0xc490('0x25')]('x'));}this[_0xc490('0xa')][_0x1f1cf5[_0xc490('0x29')]][_0xc490('0x23')]=_0x1f1cf5[_0xc490('0x23')][_0xc490('0x2b')]();this[_0xc490('0x1f')](util[_0xc490('0x25')]('trunk:%s',this['trunks'][_0x1f1cf5[_0xc490('0x29')]]['name']),_0xc490('0x27'),this['trunks'][_0x1f1cf5['device']]);}else if(_[_0xc490('0x33')](_0x1f1cf5['device'],_0xc490('0x34'))){}else if(_['startsWith'](_0x1f1cf5[_0xc490('0x29')],_0xc490('0x35'))){var _0x480fe3=_0x1f1cf5[_0xc490('0x29')];var _0x562d45=_0x480fe3['substring'](_0x480fe3[_0xc490('0x36')]('/')+0x1,_0x480fe3[_0xc490('0x36')]('@'));var _0x46e028=_[_0xc490('0x20')](this[_0xc490('0xb')],function(_0x3cc7a5){return _0x3cc7a5[_0xc490('0x37')]==_0x562d45||_0x3cc7a5[_0xc490('0x38')]==_0x562d45||_0x3cc7a5[_0xc490('0x39')]==_0x562d45;});if(_0x46e028){if(_0x46e028['state']!==_0x1f1cf5[_0xc490('0x23')][_0xc490('0x2b')]()){_0x46e028[_0xc490('0x2d')]=_[_0xc490('0x32')](moment()[_0xc490('0x25')]('x'));}_0x46e028[_0xc490('0x23')]=_0x1f1cf5[_0xc490('0x23')][_0xc490('0x2b')]();_0x46e028[_0xc490('0x2a')]=!![];_0x46e028[_0xc490('0x2e')](_0x1f1cf5);}}else{}}}catch(_0x59824f){logger[_0xc490('0x1b')](_0xc490('0x3a'),util[_0xc490('0x1c')](_0x59824f,{'showHidden':![],'depth':null}));}};UserReport[_0xc490('0x1d')][_0xc490('0x13')]=function(_0xc5bff1){try{if(this[_0xc490('0x1e')](_0xc5bff1)&&this[_0xc490('0x1e')](_0xc5bff1['peerstatus'])){if(this[_0xc490('0xb')][_0xc5bff1[_0xc490('0x3b')]]){if(!this[_0xc490('0xb')][_0xc5bff1['peer']][_0xc490('0x2a')]||_0xc5bff1[_0xc490('0x3c')]['toLowerCase']()==_0xc490('0x3d')){this[_0xc490('0xb')][_0xc5bff1['peer']]['local']=![];this['agents'][_0xc5bff1[_0xc490('0x3b')]][_0xc490('0x3e')]=_0xc5bff1[_0xc490('0x3c')][_0xc490('0x2b')]();this[_0xc490('0xb')][_0xc5bff1['peer']][_0xc490('0x3f')]=_0xc5bff1[_0xc490('0x3f')];this[_0xc490('0xb')][_0xc5bff1['peer']]['updateStatusRealtime'](_0xc5bff1);}}else if(this[_0xc490('0xc')][_0xc5bff1[_0xc490('0x3b')]]){this[_0xc490('0xc')][_0xc5bff1[_0xc490('0x3b')]][_0xc490('0x3e')]=_0xc5bff1['peerstatus']['toLowerCase']();this[_0xc490('0xc')][_0xc5bff1[_0xc490('0x3b')]][_0xc490('0x3f')]=_0xc5bff1[_0xc490('0x3f')];this[_0xc490('0x1f')](util[_0xc490('0x25')](_0xc490('0x2f'),this[_0xc490('0xc')][_0xc5bff1[_0xc490('0x3b')]][_0xc490('0x30')]),_0xc490('0x31'),this[_0xc490('0xc')][_0xc5bff1[_0xc490('0x3b')]]);}else if(this[_0xc490('0xa')][_0xc5bff1[_0xc490('0x3b')]]){this['trunks'][_0xc5bff1[_0xc490('0x3b')]][_0xc490('0x3e')]=_0xc5bff1[_0xc490('0x3c')][_0xc490('0x2b')]();this[_0xc490('0xa')][_0xc5bff1[_0xc490('0x3b')]]['address']=_0xc5bff1[_0xc490('0x3f')];this['emit'](util['format']('trunk:%s',this[_0xc490('0xa')][_0xc5bff1[_0xc490('0x3b')]][_0xc490('0x30')]),_0xc490('0x27'),this['trunks'][_0xc5bff1[_0xc490('0x3b')]]);}else{}}}catch(_0x114a28){logger['error']('[syncPeerStatus][UserReport]',util['inspect'](_0x114a28,{'showHidden':![],'depth':null}));}};module[_0xc490('0x40')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 20c41b4..97d323c 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 _0xf848=['isNil','includes','custom:voiceAgentReport','values','transfereeuniqueid','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','syncBlindTransfer','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','[syncMusicOnHoldStart][VoiceAgentReport]','onhold','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','util','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','emit','prototype','isNotNull','isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','variables','queue','inbound','omit','event','privilege','custom:agentcalled','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','merge','interface','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','lastevent','answeredelsewheremembername','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','syncQueueCallerAbandon','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','complete','talktime','transfer','acw','agentacw','acwtime','acwTimeout','custom:agentcomplete','addVariable','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime'];(function(_0x476aba,_0x3a96cd){var _0x3291d8=function(_0xed3299){while(--_0xed3299){_0x476aba['push'](_0x476aba['shift']());}};_0x3291d8(++_0x3a96cd);}(_0xf848,0x10a));var _0x8f84=function(_0x45e770,_0x2439d7){_0x45e770=_0x45e770-0x0;var _0x91b73a=_0xf848[_0x45e770];return _0x91b73a;};'use strict';var _=require(_0x8f84('0x0'));var moment=require('moment');var util=require(_0x8f84('0x1'));var Redis=require('ioredis');var config=require(_0x8f84('0x2'));var logger=require(_0x8f84('0x3'))('ami');var ami=require('../ami');config[_0x8f84('0x4')]=_[_0x8f84('0x5')](config[_0x8f84('0x4')],{'host':_0x8f84('0x6'),'port':0x18eb});var io=require(_0x8f84('0x7'))(new Redis(config[_0x8f84('0x4')]));function VoiceAgentReport(_0x21efd3){this[_0x8f84('0x8')]={};this[_0x8f84('0x9')]=_0x21efd3[_0x8f84('0x9')];this[_0x8f84('0xa')]=_0x21efd3[_0x8f84('0xa')];this['variables']={};ami['on']('agentcalled',this['syncAgentCalled'][_0x8f84('0xb')](this));ami['on'](_0x8f84('0xc'),this[_0x8f84('0xd')][_0x8f84('0xb')](this));ami['on'](_0x8f84('0xe'),this[_0x8f84('0xf')][_0x8f84('0xb')](this));ami['on'](_0x8f84('0x10'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x8f84('0x11'),this[_0x8f84('0x12')][_0x8f84('0xb')](this));ami['on'](_0x8f84('0x13'),this[_0x8f84('0x14')]['bind'](this));ami['on'](_0x8f84('0x15'),this[_0x8f84('0x16')]['bind'](this));ami['on'](_0x8f84('0x17'),this[_0x8f84('0x18')][_0x8f84('0xb')](this));ami['on'](_0x8f84('0x19'),this[_0x8f84('0x1a')]['bind'](this));ami['on'](_0x8f84('0x1b'),this[_0x8f84('0x1c')][_0x8f84('0xb')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));}VoiceAgentReport['prototype'][_0x8f84('0x1d')]=function(_0x2c2bdd,_0x1d59c6,_0xc156c2){io['to'](_0x2c2bdd)['emit'](_0x1d59c6,_0xc156c2);};VoiceAgentReport[_0x8f84('0x1e')][_0x8f84('0x1f')]=function(_0x281c63){return _0x281c63!==null&&!_[_0x8f84('0x20')](_0x281c63);};VoiceAgentReport[_0x8f84('0x1e')]['syncAgentCalled']=function(_0x4a3e41){try{if(this['isNotNull'](_0x4a3e41)){if(_[_0x8f84('0x20')](this[_0x8f84('0x8')][_0x4a3e41['uniqueid']])){this[_0x8f84('0x8')][_0x4a3e41[_0x8f84('0x21')]]={};}if(_['isUndefined'](this[_0x8f84('0x8')][_0x4a3e41[_0x8f84('0x21')]][_0x4a3e41['destuniqueid']])){this[_0x8f84('0x8')][_0x4a3e41['uniqueid']][_0x4a3e41[_0x8f84('0x22')]]={'agentcalledAt':moment()[_0x8f84('0x23')](_0x8f84('0x24')),'lastevent':_0x8f84('0x25'),'variables':this[_0x8f84('0x26')][_0x4a3e41[_0x8f84('0x21')]],'type':this['voiceQueues'][_0x4a3e41[_0x8f84('0x27')]]?this[_0x8f84('0x9')][_0x4a3e41['queue']]['type']||_0x8f84('0x28'):_0x8f84('0x28')};}_['merge'](this[_0x8f84('0x8')][_0x4a3e41[_0x8f84('0x21')]][_0x4a3e41['destuniqueid']],_[_0x8f84('0x29')](_0x4a3e41,[_0x8f84('0x2a'),_0x8f84('0x2b')]));ami[_0x8f84('0x1d')](_0x8f84('0x2c'),this[_0x8f84('0x8')][_0x4a3e41[_0x8f84('0x21')]][_0x4a3e41['destuniqueid']]);this['emit'](util[_0x8f84('0x23')](_0x8f84('0x2d'),_0x4a3e41[_0x8f84('0x2e')]),_0x8f84('0x2f'),this[_0x8f84('0x8')][_0x4a3e41['uniqueid']][_0x4a3e41[_0x8f84('0x22')]]);}}catch(_0x4c10ae){logger[_0x8f84('0x30')](_0x8f84('0x31'),util[_0x8f84('0x32')](_0x4c10ae,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8f84('0x1e')][_0x8f84('0xd')]=function(_0x279617){try{if(this['isNotNull'](_0x279617)){if(this['channels'][_0x279617[_0x8f84('0x21')]]){for(var _0x1544d5 in this[_0x8f84('0x8')][_0x279617[_0x8f84('0x21')]]){if(this[_0x8f84('0x8')][_0x279617['uniqueid']][_0x8f84('0x33')](_0x1544d5)){if(_0x279617[_0x8f84('0x22')]===_0x1544d5){this[_0x8f84('0x8')][_0x279617[_0x8f84('0x21')]][_0x1544d5][_0x8f84('0x34')]=moment()[_0x8f84('0x23')](_0x8f84('0x24'));this[_0x8f84('0x8')][_0x279617['uniqueid']][_0x1544d5]['lastevent']=_0x8f84('0x35');this[_0x8f84('0x8')][_0x279617[_0x8f84('0x21')]][_0x1544d5][_0x8f84('0x36')]=_0x279617['holdtime'];this['channels'][_0x279617['uniqueid']][_0x1544d5][_0x8f84('0x37')]=_0x279617[_0x8f84('0x37')];this[_0x8f84('0x8')][_0x279617[_0x8f84('0x21')]][_0x1544d5][_0x8f84('0x38')]=_0x279617['connectedlinename'];this[_0x8f84('0x8')][_0x279617[_0x8f84('0x21')]][_0x1544d5]['destchannelstate']=_0x279617[_0x8f84('0x39')];this[_0x8f84('0x8')][_0x279617[_0x8f84('0x21')]][_0x1544d5][_0x8f84('0x3a')]=_0x279617[_0x8f84('0x3a')];_[_0x8f84('0x3b')](this['agents'][_0x279617[_0x8f84('0x3c')]],_[_0x8f84('0x3d')](_0x279617,[_0x8f84('0x27'),_0x8f84('0x3e')]));this['emit'](util[_0x8f84('0x23')](_0x8f84('0x2d'),_0x279617[_0x8f84('0x2e')]),_0x8f84('0x3f'),this['channels'][_0x279617[_0x8f84('0x21')]][_0x279617[_0x8f84('0x22')]]);ami[_0x8f84('0x1d')](_0x8f84('0x40'),this['channels'][_0x279617[_0x8f84('0x21')]][_0x1544d5]);}else if(!this['channels'][_0x279617[_0x8f84('0x21')]][_0x1544d5][_0x8f84('0xe')]&&!this[_0x8f84('0x8')][_0x279617[_0x8f84('0x21')]][_0x1544d5]['agentcomplete']){this[_0x8f84('0x8')][_0x279617['uniqueid']][_0x1544d5][_0x8f84('0xe')]=!![];this[_0x8f84('0x8')][_0x279617['uniqueid']][_0x1544d5][_0x8f84('0x41')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x8f84('0x8')][_0x279617[_0x8f84('0x21')]][_0x1544d5][_0x8f84('0x42')]=_0x8f84('0x43');this[_0x8f84('0x8')][_0x279617['uniqueid']][_0x1544d5][_0x8f84('0x44')]='answered_elsewhere';this[_0x8f84('0x8')][_0x279617[_0x8f84('0x21')]][_0x1544d5]['answeredelsewheredestinationuniqueid']=_0x279617[_0x8f84('0x22')];this[_0x8f84('0x8')][_0x279617[_0x8f84('0x21')]][_0x1544d5][_0x8f84('0x45')]=_0x279617[_0x8f84('0x2e')];ami[_0x8f84('0x1d')]('custom:agentansweredelsewhere',this[_0x8f84('0x8')][_0x279617['uniqueid']][_0x1544d5]);}}}}}}catch(_0x22a6a9){logger['error'](_0x8f84('0x46'),util[_0x8f84('0x32')](_0x22a6a9,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8f84('0xf')]=function(_0x53330b){try{if(this[_0x8f84('0x1f')](_0x53330b)){if(this[_0x8f84('0x8')][_0x53330b[_0x8f84('0x21')]]&&this[_0x8f84('0x8')][_0x53330b[_0x8f84('0x21')]][_0x53330b[_0x8f84('0x22')]]){this['channels'][_0x53330b[_0x8f84('0x21')]][_0x53330b[_0x8f84('0x22')]]['agentringnoanswer']=!![];this[_0x8f84('0x8')][_0x53330b[_0x8f84('0x21')]][_0x53330b[_0x8f84('0x22')]][_0x8f84('0x41')]=moment()[_0x8f84('0x23')](_0x8f84('0x24'));this[_0x8f84('0x8')][_0x53330b['uniqueid']][_0x53330b[_0x8f84('0x22')]][_0x8f84('0x42')]=_0x8f84('0x47');this[_0x8f84('0x8')][_0x53330b[_0x8f84('0x21')]][_0x53330b[_0x8f84('0x22')]][_0x8f84('0x44')]=_0x8f84('0x47');ami[_0x8f84('0x1d')](_0x8f84('0x48'),this[_0x8f84('0x8')][_0x53330b[_0x8f84('0x21')]][_0x53330b['destuniqueid']]);}}}catch(_0xd7b248){logger[_0x8f84('0x30')](_0x8f84('0x49'),util[_0x8f84('0x32')](_0xd7b248,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8f84('0x1e')][_0x8f84('0x4a')]=function(_0x239baf){try{if(this['isNotNull'](_0x239baf)){if(this[_0x8f84('0x8')][_0x239baf[_0x8f84('0x21')]]){for(var _0x1d3723 in this[_0x8f84('0x8')][_0x239baf[_0x8f84('0x21')]]){if(this['channels'][_0x239baf[_0x8f84('0x21')]]['hasOwnProperty'](_0x1d3723)&&!this[_0x8f84('0x8')][_0x239baf[_0x8f84('0x21')]][_0x1d3723][_0x8f84('0xe')]&&!this[_0x8f84('0x8')][_0x239baf['uniqueid']][_0x1d3723][_0x8f84('0x11')]){this[_0x8f84('0x8')][_0x239baf[_0x8f84('0x21')]][_0x1d3723][_0x8f84('0xe')]=!![];this['channels'][_0x239baf[_0x8f84('0x21')]][_0x1d3723]['agentringnoanswerAt']=moment()[_0x8f84('0x23')](_0x8f84('0x24'));this['channels'][_0x239baf[_0x8f84('0x21')]][_0x1d3723][_0x8f84('0x42')]=_0x8f84('0x4b');this[_0x8f84('0x8')][_0x239baf[_0x8f84('0x21')]][_0x1d3723][_0x8f84('0x44')]=_0x8f84('0x4b');ami[_0x8f84('0x1d')](_0x8f84('0x4c'),this[_0x8f84('0x8')][_0x239baf[_0x8f84('0x21')]][_0x1d3723]);}}}}}catch(_0x37644d){logger['error'](_0x8f84('0x4d'),util[_0x8f84('0x32')](_0x37644d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentComplete']=function(_0x2e5525){try{if(this[_0x8f84('0x1f')](_0x2e5525)){if(this[_0x8f84('0x8')][_0x2e5525[_0x8f84('0x21')]]){for(var _0x176aeb in this[_0x8f84('0x8')][_0x2e5525[_0x8f84('0x21')]]){if(this[_0x8f84('0x8')][_0x2e5525[_0x8f84('0x21')]]['hasOwnProperty'](_0x176aeb)){if(this[_0x8f84('0x8')][_0x2e5525[_0x8f84('0x21')]][_0x176aeb][_0x8f84('0x34')]&&!this[_0x8f84('0x8')][_0x2e5525['uniqueid']][_0x176aeb][_0x8f84('0x11')]){this[_0x8f84('0x8')][_0x2e5525[_0x8f84('0x21')]][_0x176aeb]['agentcomplete']=!![];this[_0x8f84('0x8')][_0x2e5525[_0x8f84('0x21')]][_0x176aeb][_0x8f84('0x4e')]=moment()['format'](_0x8f84('0x24'));this[_0x8f84('0x8')][_0x2e5525[_0x8f84('0x21')]][_0x176aeb][_0x8f84('0x44')]=_0x8f84('0x4f');this[_0x8f84('0x8')][_0x2e5525['uniqueid']][_0x176aeb][_0x8f84('0x50')]=_0x2e5525[_0x8f84('0x50')];this[_0x8f84('0x8')][_0x2e5525[_0x8f84('0x21')]][_0x176aeb][_0x8f84('0x42')]=_0x2e5525[_0x8f84('0x42')]==_0x8f84('0x51')?'agent':_0x2e5525[_0x8f84('0x42')];if(this[_0x8f84('0x9')][_0x2e5525[_0x8f84('0x27')]]&&this[_0x8f84('0x9')][_0x2e5525[_0x8f84('0x27')]][_0x8f84('0x52')]){this[_0x8f84('0x8')][_0x2e5525[_0x8f84('0x21')]][_0x176aeb][_0x8f84('0x53')]=!![];this[_0x8f84('0x8')][_0x2e5525[_0x8f84('0x21')]][_0x176aeb][_0x8f84('0x54')]=this[_0x8f84('0x9')][_0x2e5525[_0x8f84('0x27')]][_0x8f84('0x55')];}this[_0x8f84('0xa')][_0x2e5525[_0x8f84('0x3c')]]=_[_0x8f84('0x29')](this['agents'][_0x2e5525[_0x8f84('0x3c')]],[_0x8f84('0x27'),_0x8f84('0x3e')]);this['emit'](util[_0x8f84('0x23')](_0x8f84('0x2d'),_0x2e5525[_0x8f84('0x2e')]),'user:agentcomplete',this['channels'][_0x2e5525[_0x8f84('0x21')]][_0x176aeb]);ami[_0x8f84('0x1d')](_0x8f84('0x56'),this['channels'][_0x2e5525[_0x8f84('0x21')]][_0x176aeb]);}}}}}}catch(_0x5e7919){logger[_0x8f84('0x30')]('[syncAgentComplete][VoiceAgentReport]',util[_0x8f84('0x32')](_0x5e7919,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8f84('0x1e')][_0x8f84('0x14')]=function(_0x17e816){try{if(this['isNotNull'](_0x17e816)){this[_0x8f84('0x57')](_0x17e816[_0x8f84('0x21')],_['keys'](_0x17e816['variable'])[0x0],_0x17e816['value']);if(this['channels'][_0x17e816[_0x8f84('0x21')]]){for(var _0x228dd1 in this[_0x8f84('0x8')][_0x17e816['uniqueid']]){if(this[_0x8f84('0x8')][_0x17e816[_0x8f84('0x21')]]['hasOwnProperty'](_0x228dd1)){if(_['isUndefined'](this['channels'][_0x17e816[_0x8f84('0x21')]][_0x228dd1][_0x8f84('0x26')])){this[_0x8f84('0x8')][_0x17e816[_0x8f84('0x21')]][_0x228dd1]['variables']={};}this[_0x8f84('0x8')][_0x17e816[_0x8f84('0x21')]][_0x228dd1][_0x8f84('0x26')]=this['variables'][_0x17e816[_0x8f84('0x21')]];}}}}}catch(_0x5047b7){logger['error'](_0x8f84('0x58'),util[_0x8f84('0x32')](_0x5047b7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8f84('0x1e')]['addVariable']=function(_0x1a0784,_0x440f58,_0x9cd684){var _0x73fabe=[_0x8f84('0x59'),'rtpaudioqosbridged',_0x8f84('0x5a'),_0x8f84('0x5b'),_0x8f84('0x5c'),_0x8f84('0x5d'),_0x8f84('0x5e'),_0x8f84('0x5f'),_0x8f84('0x60'),_0x8f84('0x61'),_0x8f84('0x62'),_0x8f84('0x63'),_0x8f84('0x64'),_0x8f84('0x65'),_0x8f84('0x66'),_0x8f84('0x67'),'membername',_0x8f84('0x68'),_0x8f84('0x69')];if(!_[_0x8f84('0x6a')](_0x440f58)&&!_[_0x8f84('0x6b')](_0x73fabe,_0x440f58)){if(_[_0x8f84('0x20')](this[_0x8f84('0x26')][_0x1a0784])){this[_0x8f84('0x26')][_0x1a0784]={};}this[_0x8f84('0x26')][_0x1a0784][_0x440f58]=_0x9cd684;}};VoiceAgentReport[_0x8f84('0x1e')][_0x8f84('0x16')]=function(_0x3e156c){try{if(this[_0x8f84('0x1f')](_0x3e156c)){if(this[_0x8f84('0x8')][_0x3e156c[_0x8f84('0x21')]]){for(var _0x1e8683 in this[_0x8f84('0x8')][_0x3e156c['uniqueid']]){if(this[_0x8f84('0x8')][_0x3e156c['uniqueid']][_0x8f84('0x33')](_0x1e8683)){if(this['channels'][_0x3e156c['uniqueid']][_0x1e8683][_0x8f84('0x42')]==_0x8f84('0x51')&&this[_0x8f84('0x8')][_0x3e156c[_0x8f84('0x21')]][_0x1e8683]['agentcomplete']){this[_0x8f84('0x8')][_0x3e156c[_0x8f84('0x21')]][_0x1e8683][_0x8f84('0x4e')]=moment()[_0x8f84('0x23')](_0x8f84('0x24'));}}}ami[_0x8f84('0x1d')](_0x8f84('0x6c'),_[_0x8f84('0x6d')](this[_0x8f84('0x8')][_0x3e156c[_0x8f84('0x21')]]));delete this[_0x8f84('0x8')][_0x3e156c['uniqueid']];}if(this[_0x8f84('0x26')][_0x3e156c['uniqueid']]){delete this[_0x8f84('0x26')][_0x3e156c[_0x8f84('0x21')]];}}}catch(_0x4ce952){logger[_0x8f84('0x30')]('[syncHangup][VoiceAgentReport]',util['inspect'](_0x4ce952,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8f84('0x1e')][_0x8f84('0x1c')]=function(_0x428ed0){try{if(this['isNotNull'](_0x428ed0)){if(this[_0x8f84('0x8')][_0x428ed0[_0x8f84('0x6e')]]){for(var _0x218e37 in this[_0x8f84('0x8')][_0x428ed0['transfereeuniqueid']]){if(this[_0x8f84('0x8')][_0x428ed0[_0x8f84('0x6e')]][_0x8f84('0x33')](_0x218e37)){if(_0x428ed0['origtransfereruniqueid']===_0x218e37){var _0xbbe6d5=moment();this['channels'][_0x428ed0[_0x8f84('0x6e')]][_0x218e37]['agentcomplete']=!![];this[_0x8f84('0x8')][_0x428ed0['transfereeuniqueid']][_0x218e37][_0x8f84('0x4e')]=moment()[_0x8f84('0x23')](_0x8f84('0x24'));this['channels'][_0x428ed0[_0x8f84('0x6e')]][_0x218e37][_0x8f84('0x42')]=_0x8f84('0x51');this[_0x8f84('0x8')][_0x428ed0['transfereeuniqueid']][_0x218e37]['lastevent']=_0x8f84('0x4f');this[_0x8f84('0x8')][_0x428ed0['transfereeuniqueid']][_0x218e37]['talktime']=_0xbbe6d5[_0x8f84('0x6f')](this[_0x8f84('0x8')][_0x428ed0['transfereeuniqueid']][_0x218e37][_0x8f84('0x34')],_0x8f84('0x70'));}}}}if(this[_0x8f84('0x8')][_0x428ed0[_0x8f84('0x71')]]){var _0x2b8fd1=this[_0x8f84('0x8')][_0x428ed0[_0x8f84('0x71')]];this[_0x8f84('0x8')][_0x428ed0[_0x8f84('0x71')]]=this[_0x8f84('0x8')][_0x428ed0[_0x8f84('0x6e')]];this[_0x8f84('0x8')][_0x428ed0[_0x8f84('0x6e')]]=_0x2b8fd1;}}}catch(_0x3812fc){logger[_0x8f84('0x30')](_0x8f84('0x72'),util[_0x8f84('0x32')](_0x3812fc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8f84('0x1e')][_0x8f84('0x73')]=function(_0x3ee774){try{if(this[_0x8f84('0x1f')](_0x3ee774)){if(this['channels'][_0x3ee774[_0x8f84('0x6e')]]){for(var _0x15fb1a in this[_0x8f84('0x8')][_0x3ee774['transfereeuniqueid']]){if(this[_0x8f84('0x8')][_0x3ee774['transfereeuniqueid']][_0x8f84('0x33')](_0x15fb1a)){if(_0x3ee774['transfereruniqueid']===_0x15fb1a){var _0x4a9933=moment();this[_0x8f84('0x8')][_0x3ee774[_0x8f84('0x6e')]][_0x15fb1a][_0x8f84('0x11')]=!![];this['channels'][_0x3ee774['transfereeuniqueid']][_0x15fb1a][_0x8f84('0x4e')]=_0x4a9933;this['channels'][_0x3ee774[_0x8f84('0x6e')]][_0x15fb1a][_0x8f84('0x42')]=_0x8f84('0x51');this[_0x8f84('0x8')][_0x3ee774[_0x8f84('0x6e')]][_0x15fb1a]['lastevent']=_0x8f84('0x4f');this[_0x8f84('0x8')][_0x3ee774['transfereeuniqueid']][_0x15fb1a][_0x8f84('0x50')]=_0x4a9933[_0x8f84('0x6f')](this[_0x8f84('0x8')][_0x3ee774[_0x8f84('0x6e')]][_0x15fb1a][_0x8f84('0x34')],'seconds');}}}}}}catch(_0x5d791a){logger['error'](_0x8f84('0x74'),util[_0x8f84('0x32')](_0x5d791a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8f84('0x1e')][_0x8f84('0x18')]=function(_0x3f3646){var _0x3102f6='';try{if(this[_0x8f84('0x1f')](_0x3f3646)){if(_0x3f3646[_0x8f84('0x75')]){_0x3102f6=_0x3f3646[_0x8f84('0x75')][_0x8f84('0x76')](0x0,_0x3f3646[_0x8f84('0x75')][_0x8f84('0x77')]('-'));if(this[_0x8f84('0xa')][_0x3102f6]){this['agents'][_0x3102f6]['onhold']=!![];}}}}catch(_0x28a0a3){logger[_0x8f84('0x30')](_0x8f84('0x78'),util[_0x8f84('0x32')](_0x28a0a3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8f84('0x1e')][_0x8f84('0x1a')]=function(_0x2a1213){var _0x5ba73f='';try{if(this[_0x8f84('0x1f')](_0x2a1213)){if(_0x2a1213[_0x8f84('0x75')]){_0x5ba73f=_0x2a1213['channel'][_0x8f84('0x76')](0x0,_0x2a1213[_0x8f84('0x75')][_0x8f84('0x77')]('-'));if(this[_0x8f84('0xa')][_0x5ba73f]){this[_0x8f84('0xa')][_0x5ba73f][_0x8f84('0x79')]=![];}}}}catch(_0x38d078){logger['error'](_0x8f84('0x7a'),util['inspect'](_0x38d078,{'showHidden':![],'depth':null}));}};module[_0x8f84('0x7b')]=VoiceAgentReport; \ No newline at end of file +var _0x9206=['value','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','transfer','values','syncAttendedTransfer','transfereeuniqueid','origtransfereruniqueid','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','diff','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','exports','lodash','moment','util','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','inbound','privilege','custom:agentcalled','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','merge','interface','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','lastevent','answeredelsewheremembername','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','syncAgentComplete','agentcompleteAt','complete','talktime','acw','agentacw','acwTimeout','omit','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable'];(function(_0xf484d3,_0x1bfad6){var _0x4f261a=function(_0x35d7fc){while(--_0x35d7fc){_0xf484d3['push'](_0xf484d3['shift']());}};_0x4f261a(++_0x1bfad6);}(_0x9206,0x199));var _0x6920=function(_0x40cd06,_0x46a664){_0x40cd06=_0x40cd06-0x0;var _0x391041=_0x9206[_0x40cd06];return _0x391041;};'use strict';var _=require(_0x6920('0x0'));var moment=require(_0x6920('0x1'));var util=require(_0x6920('0x2'));var Redis=require(_0x6920('0x3'));var config=require(_0x6920('0x4'));var logger=require('../../../config/logger')(_0x6920('0x5'));var ami=require(_0x6920('0x6'));config[_0x6920('0x7')]=_[_0x6920('0x8')](config[_0x6920('0x7')],{'host':_0x6920('0x9'),'port':0x18eb});var io=require(_0x6920('0xa'))(new Redis(config['redis']));function VoiceAgentReport(_0x230036){this[_0x6920('0xb')]={};this[_0x6920('0xc')]=_0x230036['voiceQueues'];this[_0x6920('0xd')]=_0x230036[_0x6920('0xd')];this[_0x6920('0xe')]={};ami['on'](_0x6920('0xf'),this[_0x6920('0x10')][_0x6920('0x11')](this));ami['on']('agentconnect',this[_0x6920('0x12')][_0x6920('0x11')](this));ami['on'](_0x6920('0x13'),this[_0x6920('0x14')]['bind'](this));ami['on'](_0x6920('0x15'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x6920('0x16'),this['syncAgentComplete']['bind'](this));ami['on'](_0x6920('0x17'),this[_0x6920('0x18')][_0x6920('0x11')](this));ami['on'](_0x6920('0x19'),this[_0x6920('0x1a')][_0x6920('0x11')](this));ami['on'](_0x6920('0x1b'),this[_0x6920('0x1c')][_0x6920('0x11')](this));ami['on']('musiconholdstop',this[_0x6920('0x1d')][_0x6920('0x11')](this));ami['on'](_0x6920('0x1e'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x6920('0x1f'),this[_0x6920('0x20')]['bind'](this));}VoiceAgentReport[_0x6920('0x21')]['emit']=function(_0x11be40,_0x492dd6,_0x48838b){io['to'](_0x11be40)[_0x6920('0x22')](_0x492dd6,_0x48838b);};VoiceAgentReport[_0x6920('0x21')][_0x6920('0x23')]=function(_0x51b2c1){return _0x51b2c1!==null&&!_[_0x6920('0x24')](_0x51b2c1);};VoiceAgentReport[_0x6920('0x21')][_0x6920('0x10')]=function(_0x541269){try{if(this[_0x6920('0x23')](_0x541269)){if(_['isUndefined'](this['channels'][_0x541269[_0x6920('0x25')]])){this['channels'][_0x541269[_0x6920('0x25')]]={};}if(_[_0x6920('0x24')](this['channels'][_0x541269[_0x6920('0x25')]][_0x541269[_0x6920('0x26')]])){this['channels'][_0x541269[_0x6920('0x25')]][_0x541269[_0x6920('0x26')]]={'agentcalledAt':moment()[_0x6920('0x27')](_0x6920('0x28')),'lastevent':_0x6920('0x29'),'variables':this[_0x6920('0xe')][_0x541269['uniqueid']],'type':this[_0x6920('0xc')][_0x541269[_0x6920('0x2a')]]?this[_0x6920('0xc')][_0x541269[_0x6920('0x2a')]]['type']||_0x6920('0x2b'):_0x6920('0x2b')};}_['merge'](this['channels'][_0x541269[_0x6920('0x25')]][_0x541269[_0x6920('0x26')]],_['omit'](_0x541269,['event',_0x6920('0x2c')]));ami[_0x6920('0x22')](_0x6920('0x2d'),this[_0x6920('0xb')][_0x541269[_0x6920('0x25')]][_0x541269[_0x6920('0x26')]]);this[_0x6920('0x22')](util[_0x6920('0x27')](_0x6920('0x2e'),_0x541269[_0x6920('0x2f')]),_0x6920('0x30'),this[_0x6920('0xb')][_0x541269[_0x6920('0x25')]][_0x541269[_0x6920('0x26')]]);}}catch(_0x12dedd){logger[_0x6920('0x31')](_0x6920('0x32'),util[_0x6920('0x33')](_0x12dedd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentConnect']=function(_0x33a254){try{if(this[_0x6920('0x23')](_0x33a254)){if(this['channels'][_0x33a254[_0x6920('0x25')]]){for(var _0x20fddb in this['channels'][_0x33a254['uniqueid']]){if(this[_0x6920('0xb')][_0x33a254[_0x6920('0x25')]][_0x6920('0x34')](_0x20fddb)){if(_0x33a254[_0x6920('0x26')]===_0x20fddb){this['channels'][_0x33a254[_0x6920('0x25')]][_0x20fddb][_0x6920('0x35')]=moment()['format'](_0x6920('0x28'));this['channels'][_0x33a254[_0x6920('0x25')]][_0x20fddb]['lastevent']='connect';this['channels'][_0x33a254[_0x6920('0x25')]][_0x20fddb]['holdtime']=_0x33a254[_0x6920('0x36')];this[_0x6920('0xb')][_0x33a254[_0x6920('0x25')]][_0x20fddb][_0x6920('0x37')]=_0x33a254[_0x6920('0x37')];this[_0x6920('0xb')][_0x33a254[_0x6920('0x25')]][_0x20fddb][_0x6920('0x38')]=_0x33a254[_0x6920('0x38')];this['channels'][_0x33a254[_0x6920('0x25')]][_0x20fddb][_0x6920('0x39')]=_0x33a254[_0x6920('0x39')];this[_0x6920('0xb')][_0x33a254['uniqueid']][_0x20fddb][_0x6920('0x3a')]=_0x33a254['destchannelstatedesc'];_[_0x6920('0x3b')](this[_0x6920('0xd')][_0x33a254[_0x6920('0x3c')]],_[_0x6920('0x3d')](_0x33a254,[_0x6920('0x2a'),_0x6920('0x3e')]));this[_0x6920('0x22')](util[_0x6920('0x27')](_0x6920('0x2e'),_0x33a254[_0x6920('0x2f')]),_0x6920('0x3f'),this[_0x6920('0xb')][_0x33a254['uniqueid']][_0x33a254['destuniqueid']]);ami[_0x6920('0x22')](_0x6920('0x40'),this['channels'][_0x33a254['uniqueid']][_0x20fddb]);}else if(!this[_0x6920('0xb')][_0x33a254[_0x6920('0x25')]][_0x20fddb]['agentringnoanswer']&&!this[_0x6920('0xb')][_0x33a254['uniqueid']][_0x20fddb][_0x6920('0x16')]){this['channels'][_0x33a254['uniqueid']][_0x20fddb]['agentringnoanswer']=!![];this[_0x6920('0xb')][_0x33a254[_0x6920('0x25')]][_0x20fddb][_0x6920('0x41')]=moment()['format'](_0x6920('0x28'));this[_0x6920('0xb')][_0x33a254[_0x6920('0x25')]][_0x20fddb][_0x6920('0x42')]=_0x6920('0x43');this[_0x6920('0xb')][_0x33a254['uniqueid']][_0x20fddb][_0x6920('0x44')]=_0x6920('0x43');this[_0x6920('0xb')][_0x33a254[_0x6920('0x25')]][_0x20fddb]['answeredelsewheredestinationuniqueid']=_0x33a254['destuniqueid'];this[_0x6920('0xb')][_0x33a254[_0x6920('0x25')]][_0x20fddb][_0x6920('0x45')]=_0x33a254[_0x6920('0x2f')];ami[_0x6920('0x22')]('custom:agentansweredelsewhere',this[_0x6920('0xb')][_0x33a254['uniqueid']][_0x20fddb]);}}}}}}catch(_0x5b2279){logger[_0x6920('0x31')](_0x6920('0x46'),util['inspect'](_0x5b2279,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6920('0x21')][_0x6920('0x14')]=function(_0x4bcbd6){try{if(this['isNotNull'](_0x4bcbd6)){if(this[_0x6920('0xb')][_0x4bcbd6[_0x6920('0x25')]]&&this['channels'][_0x4bcbd6[_0x6920('0x25')]][_0x4bcbd6[_0x6920('0x26')]]){this[_0x6920('0xb')][_0x4bcbd6['uniqueid']][_0x4bcbd6[_0x6920('0x26')]][_0x6920('0x13')]=!![];this[_0x6920('0xb')][_0x4bcbd6[_0x6920('0x25')]][_0x4bcbd6[_0x6920('0x26')]][_0x6920('0x41')]=moment()[_0x6920('0x27')](_0x6920('0x28'));this[_0x6920('0xb')][_0x4bcbd6['uniqueid']][_0x4bcbd6[_0x6920('0x26')]][_0x6920('0x42')]=_0x6920('0x47');this[_0x6920('0xb')][_0x4bcbd6[_0x6920('0x25')]][_0x4bcbd6[_0x6920('0x26')]][_0x6920('0x44')]=_0x6920('0x47');ami['emit'](_0x6920('0x48'),this[_0x6920('0xb')][_0x4bcbd6[_0x6920('0x25')]][_0x4bcbd6[_0x6920('0x26')]]);}}}catch(_0x38df3b){logger['error'](_0x6920('0x49'),util['inspect'](_0x38df3b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6920('0x21')]['syncQueueCallerAbandon']=function(_0x1f73eb){try{if(this['isNotNull'](_0x1f73eb)){if(this[_0x6920('0xb')][_0x1f73eb[_0x6920('0x25')]]){for(var _0xb8831e in this[_0x6920('0xb')][_0x1f73eb[_0x6920('0x25')]]){if(this[_0x6920('0xb')][_0x1f73eb['uniqueid']]['hasOwnProperty'](_0xb8831e)&&!this[_0x6920('0xb')][_0x1f73eb[_0x6920('0x25')]][_0xb8831e]['agentringnoanswer']&&!this[_0x6920('0xb')][_0x1f73eb[_0x6920('0x25')]][_0xb8831e]['agentcomplete']){this['channels'][_0x1f73eb[_0x6920('0x25')]][_0xb8831e]['agentringnoanswer']=!![];this[_0x6920('0xb')][_0x1f73eb[_0x6920('0x25')]][_0xb8831e][_0x6920('0x41')]=moment()[_0x6920('0x27')](_0x6920('0x28'));this[_0x6920('0xb')][_0x1f73eb['uniqueid']][_0xb8831e][_0x6920('0x42')]=_0x6920('0x4a');this[_0x6920('0xb')][_0x1f73eb[_0x6920('0x25')]][_0xb8831e][_0x6920('0x44')]=_0x6920('0x4a');ami[_0x6920('0x22')](_0x6920('0x4b'),this[_0x6920('0xb')][_0x1f73eb[_0x6920('0x25')]][_0xb8831e]);}}}}}catch(_0x588efc){logger[_0x6920('0x31')](_0x6920('0x4c'),util[_0x6920('0x33')](_0x588efc,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6920('0x4d')]=function(_0x4fe231){try{if(this['isNotNull'](_0x4fe231)){if(this[_0x6920('0xb')][_0x4fe231[_0x6920('0x25')]]){for(var _0x2d26d7 in this[_0x6920('0xb')][_0x4fe231[_0x6920('0x25')]]){if(this[_0x6920('0xb')][_0x4fe231[_0x6920('0x25')]][_0x6920('0x34')](_0x2d26d7)){if(this['channels'][_0x4fe231[_0x6920('0x25')]][_0x2d26d7][_0x6920('0x35')]&&!this[_0x6920('0xb')][_0x4fe231[_0x6920('0x25')]][_0x2d26d7][_0x6920('0x16')]){this[_0x6920('0xb')][_0x4fe231[_0x6920('0x25')]][_0x2d26d7]['agentcomplete']=!![];this['channels'][_0x4fe231[_0x6920('0x25')]][_0x2d26d7][_0x6920('0x4e')]=moment()[_0x6920('0x27')](_0x6920('0x28'));this[_0x6920('0xb')][_0x4fe231[_0x6920('0x25')]][_0x2d26d7][_0x6920('0x44')]=_0x6920('0x4f');this['channels'][_0x4fe231[_0x6920('0x25')]][_0x2d26d7]['talktime']=_0x4fe231[_0x6920('0x50')];this[_0x6920('0xb')][_0x4fe231[_0x6920('0x25')]][_0x2d26d7]['reason']=_0x4fe231[_0x6920('0x42')]=='transfer'?'agent':_0x4fe231['reason'];if(this[_0x6920('0xc')][_0x4fe231[_0x6920('0x2a')]]&&this['voiceQueues'][_0x4fe231[_0x6920('0x2a')]][_0x6920('0x51')]){this['channels'][_0x4fe231[_0x6920('0x25')]][_0x2d26d7][_0x6920('0x52')]=!![];this[_0x6920('0xb')][_0x4fe231['uniqueid']][_0x2d26d7]['acwtime']=this[_0x6920('0xc')][_0x4fe231['queue']][_0x6920('0x53')];}this[_0x6920('0xd')][_0x4fe231[_0x6920('0x3c')]]=_[_0x6920('0x54')](this['agents'][_0x4fe231[_0x6920('0x3c')]],[_0x6920('0x2a'),'destconnectedlinenum']);this[_0x6920('0x22')](util[_0x6920('0x27')](_0x6920('0x2e'),_0x4fe231[_0x6920('0x2f')]),_0x6920('0x55'),this['channels'][_0x4fe231[_0x6920('0x25')]][_0x2d26d7]);ami['emit'](_0x6920('0x56'),this['channels'][_0x4fe231['uniqueid']][_0x2d26d7]);}}}}}}catch(_0x1246e8){logger['error'](_0x6920('0x57'),util[_0x6920('0x33')](_0x1246e8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6920('0x21')][_0x6920('0x18')]=function(_0x14fdb7){try{if(this[_0x6920('0x23')](_0x14fdb7)){this[_0x6920('0x58')](_0x14fdb7['uniqueid'],_[_0x6920('0x59')](_0x14fdb7[_0x6920('0x5a')])[0x0],_0x14fdb7[_0x6920('0x5b')]);if(this[_0x6920('0xb')][_0x14fdb7['uniqueid']]){for(var _0x48e785 in this['channels'][_0x14fdb7['uniqueid']]){if(this[_0x6920('0xb')][_0x14fdb7[_0x6920('0x25')]][_0x6920('0x34')](_0x48e785)){if(_[_0x6920('0x24')](this['channels'][_0x14fdb7[_0x6920('0x25')]][_0x48e785][_0x6920('0xe')])){this[_0x6920('0xb')][_0x14fdb7[_0x6920('0x25')]][_0x48e785][_0x6920('0xe')]={};}this[_0x6920('0xb')][_0x14fdb7[_0x6920('0x25')]][_0x48e785]['variables']=this[_0x6920('0xe')][_0x14fdb7[_0x6920('0x25')]];}}}}}catch(_0x252049){logger[_0x6920('0x31')]('[syncVarSet][VoiceAgentReport]',util[_0x6920('0x33')](_0x252049,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6920('0x21')]['addVariable']=function(_0x309cb6,_0x3bad0b,_0x49d06f){var _0x22c0a3=[_0x6920('0x5c'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x6920('0x5d'),_0x6920('0x5e'),_0x6920('0x5f'),_0x6920('0x60'),_0x6920('0x61'),_0x6920('0x62'),_0x6920('0x63'),_0x6920('0x64'),_0x6920('0x65'),_0x6920('0x66'),'memberdynamic',_0x6920('0x67'),_0x6920('0x68'),'membername',_0x6920('0x69'),_0x6920('0x6a')];if(!_[_0x6920('0x6b')](_0x3bad0b)&&!_[_0x6920('0x6c')](_0x22c0a3,_0x3bad0b)){if(_['isUndefined'](this['variables'][_0x309cb6])){this[_0x6920('0xe')][_0x309cb6]={};}this[_0x6920('0xe')][_0x309cb6][_0x3bad0b]=_0x49d06f;}};VoiceAgentReport['prototype']['syncHangup']=function(_0x3e7183){try{if(this['isNotNull'](_0x3e7183)){if(this[_0x6920('0xb')][_0x3e7183['uniqueid']]){for(var _0x52eab2 in this[_0x6920('0xb')][_0x3e7183[_0x6920('0x25')]]){if(this['channels'][_0x3e7183[_0x6920('0x25')]][_0x6920('0x34')](_0x52eab2)){if(this[_0x6920('0xb')][_0x3e7183[_0x6920('0x25')]][_0x52eab2][_0x6920('0x42')]==_0x6920('0x6d')&&this[_0x6920('0xb')][_0x3e7183[_0x6920('0x25')]][_0x52eab2][_0x6920('0x16')]){this[_0x6920('0xb')][_0x3e7183[_0x6920('0x25')]][_0x52eab2][_0x6920('0x4e')]=moment()[_0x6920('0x27')](_0x6920('0x28'));}}}ami[_0x6920('0x22')]('custom:voiceAgentReport',_[_0x6920('0x6e')](this[_0x6920('0xb')][_0x3e7183[_0x6920('0x25')]]));delete this['channels'][_0x3e7183[_0x6920('0x25')]];}if(this[_0x6920('0xe')][_0x3e7183['uniqueid']]){delete this[_0x6920('0xe')][_0x3e7183[_0x6920('0x25')]];}}}catch(_0x3d7357){logger[_0x6920('0x31')]('[syncHangup][VoiceAgentReport]',util[_0x6920('0x33')](_0x3d7357,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6920('0x21')][_0x6920('0x6f')]=function(_0x4c15aa){try{if(this[_0x6920('0x23')](_0x4c15aa)){if(this[_0x6920('0xb')][_0x4c15aa['transfereeuniqueid']]){for(var _0x289982 in this[_0x6920('0xb')][_0x4c15aa[_0x6920('0x70')]]){if(this[_0x6920('0xb')][_0x4c15aa['transfereeuniqueid']][_0x6920('0x34')](_0x289982)){if(_0x4c15aa[_0x6920('0x71')]===_0x289982){var _0x3dbfa0=moment();this[_0x6920('0xb')][_0x4c15aa['transfereeuniqueid']][_0x289982][_0x6920('0x16')]=!![];this[_0x6920('0xb')][_0x4c15aa[_0x6920('0x70')]][_0x289982][_0x6920('0x4e')]=moment()[_0x6920('0x27')](_0x6920('0x28'));this[_0x6920('0xb')][_0x4c15aa[_0x6920('0x70')]][_0x289982][_0x6920('0x42')]=_0x6920('0x6d');this[_0x6920('0xb')][_0x4c15aa[_0x6920('0x70')]][_0x289982][_0x6920('0x44')]='complete';this[_0x6920('0xb')][_0x4c15aa[_0x6920('0x70')]][_0x289982][_0x6920('0x50')]=_0x3dbfa0['diff'](this[_0x6920('0xb')][_0x4c15aa[_0x6920('0x70')]][_0x289982]['agentconnectAt'],_0x6920('0x72'));}}}}if(this['channels'][_0x4c15aa['secondtransfereruniqueid']]){var _0x111575=this[_0x6920('0xb')][_0x4c15aa['secondtransfereruniqueid']];this['channels'][_0x4c15aa[_0x6920('0x73')]]=this['channels'][_0x4c15aa[_0x6920('0x70')]];this[_0x6920('0xb')][_0x4c15aa[_0x6920('0x70')]]=_0x111575;}}}catch(_0x18dc68){logger['error'](_0x6920('0x74'),util[_0x6920('0x33')](_0x18dc68,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6920('0x20')]=function(_0xd559bf){try{if(this[_0x6920('0x23')](_0xd559bf)){if(this[_0x6920('0xb')][_0xd559bf['transfereeuniqueid']]){for(var _0x37f22d in this[_0x6920('0xb')][_0xd559bf[_0x6920('0x70')]]){if(this[_0x6920('0xb')][_0xd559bf[_0x6920('0x70')]]['hasOwnProperty'](_0x37f22d)){if(_0xd559bf['transfereruniqueid']===_0x37f22d){var _0x2edaf5=moment();this[_0x6920('0xb')][_0xd559bf[_0x6920('0x70')]][_0x37f22d][_0x6920('0x16')]=!![];this[_0x6920('0xb')][_0xd559bf[_0x6920('0x70')]][_0x37f22d][_0x6920('0x4e')]=_0x2edaf5;this[_0x6920('0xb')][_0xd559bf[_0x6920('0x70')]][_0x37f22d]['reason']=_0x6920('0x6d');this[_0x6920('0xb')][_0xd559bf['transfereeuniqueid']][_0x37f22d][_0x6920('0x44')]=_0x6920('0x4f');this[_0x6920('0xb')][_0xd559bf[_0x6920('0x70')]][_0x37f22d][_0x6920('0x50')]=_0x2edaf5[_0x6920('0x75')](this['channels'][_0xd559bf[_0x6920('0x70')]][_0x37f22d][_0x6920('0x35')],_0x6920('0x72'));}}}}}}catch(_0x355322){logger[_0x6920('0x31')](_0x6920('0x76'),util['inspect'](_0x355322,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6920('0x21')][_0x6920('0x1c')]=function(_0x2a9892){var _0x26f55b='';try{if(this[_0x6920('0x23')](_0x2a9892)){if(_0x2a9892[_0x6920('0x77')]){_0x26f55b=_0x2a9892[_0x6920('0x77')][_0x6920('0x78')](0x0,_0x2a9892[_0x6920('0x77')][_0x6920('0x79')]('-'));if(this[_0x6920('0xd')][_0x26f55b]){this[_0x6920('0xd')][_0x26f55b][_0x6920('0x7a')]=!![];}}}}catch(_0x1041b6){logger[_0x6920('0x31')](_0x6920('0x7b'),util[_0x6920('0x33')](_0x1041b6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6920('0x21')]['syncMusicOnHoldStop']=function(_0x3f9052){var _0x520085='';try{if(this[_0x6920('0x23')](_0x3f9052)){if(_0x3f9052[_0x6920('0x77')]){_0x520085=_0x3f9052[_0x6920('0x77')][_0x6920('0x78')](0x0,_0x3f9052[_0x6920('0x77')]['lastIndexOf']('-'));if(this[_0x6920('0xd')][_0x520085]){this[_0x6920('0xd')][_0x520085][_0x6920('0x7a')]=![];}}}}catch(_0x1a2f5e){logger[_0x6920('0x31')]('[syncMusicOnHoldStop][VoiceAgentReport]',util[_0x6920('0x33')](_0x1a2f5e,{'showHidden':![],'depth':null}));}};module[_0x6920('0x7c')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 7846b83..70a22f0 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 _0x30bc=['mixmonitor_filename','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','syncHangup','billableseconds','omit','user:agentcomplete','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfertargetcalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','lodash','moment','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','inuse','invalid','unavailable','ringing','ringinuse','set','agi','dial','NO\x20ANSWER','FAILED','BUSY','redis','channels','agents','coreshowchannel','bind','newexten','syncNewExten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','syncMusicOnHoldStop','resolve','actionCoreShowChannels','catch','prototype','isNotNull','isUndefined','emit','uniqueid','merge','pick','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','linkedid','channel','starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','context','from-sip','split','destconnectedlinenum','exten','format','user:%s','name','user:agentconnect','accountcode','OutgoingSpoolFailed','application','toLowerCase','applicationdata','appdata','duration','seconds','disposition','lastapplication','startsWith','cdr(','match','queue','answered','answertime','holdtime','diff','xcally-motion-preview','connectedlinenum','calleridnum','connectedlinename','calleridname','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','monitor','endsWith','.wav49','replace','.WAV','monitors','isNil','push','rec','variable','syncMixMonitorFilename','value','xmd-phone','xmd-cdrtype','type','xmd-queue','destination','xmd-callerid-preview','xmcs-queue','sipcallid','sipcalluniqueid'];(function(_0x81d880,_0x268ada){var _0x930bb4=function(_0x4feecc){while(--_0x4feecc){_0x81d880['push'](_0x81d880['shift']());}};_0x930bb4(++_0x268ada);}(_0x30bc,0x149));var _0xc30b=function(_0x5c9499,_0x221b1){_0x5c9499=_0x5c9499-0x0;var _0x1370d4=_0x30bc[_0x5c9499];return _0x1370d4;};'use strict';var BPromise=require(_0xc30b('0x0'));var _=require(_0xc30b('0x1'));var moment=require(_0xc30b('0x2'));var util=require('util');var path=require(_0xc30b('0x3'));var Redis=require(_0xc30b('0x4'));var config=require(_0xc30b('0x5'));var logger=require(_0xc30b('0x6'))(_0xc30b('0x7'));var ami=require(_0xc30b('0x8'));var Channel=require(_0xc30b('0x9'));var statusDesc=[_0xc30b('0xa'),_0xc30b('0xb'),_0xc30b('0xc'),'busy',_0xc30b('0xd'),_0xc30b('0xe'),_0xc30b('0xf'),_0xc30b('0x10'),'onhold'];var applications=[_0xc30b('0x11'),'queue',_0xc30b('0x12'),_0xc30b('0x13'),'playback','voicemail'];var dispositions=[_0xc30b('0x14'),_0xc30b('0x15'),_0xc30b('0x15'),_0xc30b('0x14'),_0xc30b('0x14'),_0xc30b('0x14'),'ANSWERED',_0xc30b('0x16'),_0xc30b('0x15'),'FAILED',_0xc30b('0x15')];var actions={};config[_0xc30b('0x17')]=_['defaults'](config[_0xc30b('0x17')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceCallReport(_0xe74dd5){this['channels']=_0xe74dd5[_0xc30b('0x18')];this[_0xc30b('0x19')]=_0xe74dd5[_0xc30b('0x19')];ami['on'](_0xc30b('0x1a'),this['syncNewExten'][_0xc30b('0x1b')](this));ami['on'](_0xc30b('0x1c'),this[_0xc30b('0x1d')][_0xc30b('0x1b')](this));ami['on'](_0xc30b('0x1e'),this[_0xc30b('0x1f')]['bind'](this));ami['on'](_0xc30b('0x20'),this[_0xc30b('0x21')][_0xc30b('0x1b')](this));ami['on'](_0xc30b('0x22'),this[_0xc30b('0x23')][_0xc30b('0x1b')](this));ami['on'](_0xc30b('0x24'),this['syncHangup'][_0xc30b('0x1b')](this));ami['on']('newcallerid',this[_0xc30b('0x25')][_0xc30b('0x1b')](this));ami['on'](_0xc30b('0x26'),this[_0xc30b('0x27')]['bind'](this));ami['on'](_0xc30b('0x28'),this[_0xc30b('0x29')]['bind'](this));ami['on']('musiconholdstart',this[_0xc30b('0x2a')]['bind'](this));ami['on']('musiconholdstop',this[_0xc30b('0x2b')][_0xc30b('0x1b')](this));return BPromise[_0xc30b('0x2c')]()['then'](ami[_0xc30b('0x2d')]())[_0xc30b('0x2e')](function(_0x1949ed){console['log'](_0x1949ed);});}VoiceCallReport[_0xc30b('0x2f')][_0xc30b('0x30')]=function(_0xa44997){return _0xa44997!==null&&!_[_0xc30b('0x31')](_0xa44997);};VoiceCallReport[_0xc30b('0x2f')][_0xc30b('0x32')]=function(_0x56c8fe,_0x46a2a5,_0x15de71){io['to'](_0x56c8fe)['emit'](_0x46a2a5,_0x15de71);};VoiceCallReport['prototype'][_0xc30b('0x25')]=function(_0x4e018e){try{if(this['isNotNull'](_0x4e018e)){if(_0x4e018e[_0xc30b('0x33')]===_0x4e018e['linkedid']){if(!_[_0xc30b('0x31')](this[_0xc30b('0x18')][_0x4e018e[_0xc30b('0x33')]])){_[_0xc30b('0x34')](this['channels'][_0x4e018e[_0xc30b('0x33')]],_[_0xc30b('0x35')](_0x4e018e,_[_0xc30b('0x36')](this[_0xc30b('0x18')][_0x4e018e[_0xc30b('0x33')]])));}}}}catch(_0x4ec5a0){logger[_0xc30b('0x37')](_0xc30b('0x38'),util[_0xc30b('0x39')](_0x4ec5a0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc30b('0x2f')][_0xc30b('0x1f')]=function(_0x5b4cc6){try{if(this[_0xc30b('0x30')](_0x5b4cc6)){if(_0x5b4cc6[_0xc30b('0x33')]===_0x5b4cc6[_0xc30b('0x3a')]&&_0x5b4cc6[_0xc30b('0x3b')]!='OutgoingSpoolFailed'){if(_[_0xc30b('0x31')](this[_0xc30b('0x18')][_0x5b4cc6[_0xc30b('0x33')]])){this['channels'][_0x5b4cc6[_0xc30b('0x33')]]=new Channel();this[_0xc30b('0x18')][_0x5b4cc6['uniqueid']][_0xc30b('0x3c')]=moment()['format'](_0xc30b('0x3d'));this['channels'][_0x5b4cc6['uniqueid']]['disposition']=dispositions[_[_0xc30b('0x3e')](_0x5b4cc6[_0xc30b('0x3f')])];_['merge'](this[_0xc30b('0x18')][_0x5b4cc6[_0xc30b('0x33')]],_[_0xc30b('0x35')](_0x5b4cc6,_[_0xc30b('0x36')](this[_0xc30b('0x18')][_0x5b4cc6['uniqueid']])));if(_0x5b4cc6[_0xc30b('0x40')]===_0xc30b('0x41')){if(this[_0xc30b('0x19')][_0x5b4cc6[_0xc30b('0x3b')][_0xc30b('0x42')]('-')[0x0]]){this['agents'][_0x5b4cc6[_0xc30b('0x3b')][_0xc30b('0x42')]('-')[0x0]][_0xc30b('0x43')]=_0x5b4cc6[_0xc30b('0x44')];this[_0xc30b('0x32')](util[_0xc30b('0x45')](_0xc30b('0x46'),this['agents'][_0x5b4cc6['channel']['split']('-')[0x0]][_0xc30b('0x47')]),_0xc30b('0x48'),{'destaccountcode':this[_0xc30b('0x19')][_0x5b4cc6[_0xc30b('0x3b')][_0xc30b('0x42')]('-')[0x0]][_0xc30b('0x49')],'destconnectedlinenum':_0x5b4cc6['exten']});}}}}}}catch(_0x2f52b1){logger['error']('[syncNewChannel][VoiceCallReport]',util[_0xc30b('0x39')](_0x2f52b1,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc30b('0x1d')]=function(_0x2d0cf2){try{if(this[_0xc30b('0x30')](_0x2d0cf2)){if(_0x2d0cf2['uniqueid']===_0x2d0cf2[_0xc30b('0x3a')]&&_0x2d0cf2['exten']!='h'&&_0x2d0cf2['channel']!=_0xc30b('0x4a')){_0x2d0cf2[_0xc30b('0x4b')]=_0x2d0cf2[_0xc30b('0x4b')][_0xc30b('0x4c')]();_0x2d0cf2[_0xc30b('0x4d')]=(_0x2d0cf2[_0xc30b('0x4e')]||_0x2d0cf2['applicationdata'])[_0xc30b('0x4c')]();if(_[_0xc30b('0x31')](this[_0xc30b('0x18')][_0x2d0cf2[_0xc30b('0x33')]])){this['channels'][_0x2d0cf2[_0xc30b('0x33')]]=new Channel();this[_0xc30b('0x18')][_0x2d0cf2[_0xc30b('0x33')]][_0xc30b('0x3c')]=_0x2d0cf2[_0xc30b('0x4f')]?moment()['subtract'](moment['duration'](_0x2d0cf2[_0xc30b('0x4f')])[_0xc30b('0x50')](),'seconds')[_0xc30b('0x45')](_0xc30b('0x3d')):moment()['format'](_0xc30b('0x3d'));this[_0xc30b('0x18')][_0x2d0cf2['uniqueid']][_0xc30b('0x51')]=_0xc30b('0x14');}_[_0xc30b('0x34')](this[_0xc30b('0x18')][_0x2d0cf2['uniqueid']],_[_0xc30b('0x35')](_0x2d0cf2,_['keys'](this[_0xc30b('0x18')][_0x2d0cf2['uniqueid']])));if(_['includes'](applications,_0x2d0cf2[_0xc30b('0x4b')])){this[_0xc30b('0x18')][_0x2d0cf2['uniqueid']][_0xc30b('0x52')]=_0x2d0cf2[_0xc30b('0x4b')];this[_0xc30b('0x18')][_0x2d0cf2['uniqueid']]['lastdata']=_0x2d0cf2[_0xc30b('0x4d')];if(_0x2d0cf2['application']===_0xc30b('0x11')&&_[_0xc30b('0x53')](_0x2d0cf2[_0xc30b('0x4d')],_0xc30b('0x54'))){var _0x1ff5ec=_0x2d0cf2['applicationdata'][_0xc30b('0x42')]('=');var _0x1deb0c=_0x1ff5ec[0x0][_0xc30b('0x55')](/cdr\((.*)\)/);if(_0x1deb0c){this['channels'][_0x2d0cf2[_0xc30b('0x33')]][_0x1deb0c[0x1]]=_0x1ff5ec[0x1];}}else if(_0x2d0cf2[_0xc30b('0x4b')]===_0xc30b('0x56')){this[_0xc30b('0x18')][_0x2d0cf2[_0xc30b('0x33')]][_0xc30b('0x56')]=_0x2d0cf2[_0xc30b('0x4d')]['split'](',')[0x0];}}}}}catch(_0x25a56b){logger[_0xc30b('0x37')]('[syncNewExten][VoiceCallReport]',util[_0xc30b('0x39')](_0x25a56b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc30b('0x2f')][_0xc30b('0x21')]=function(_0x4d448b){try{if(this[_0xc30b('0x30')](_0x4d448b)){if(_0x4d448b[_0xc30b('0x33')]!==_0x4d448b[_0xc30b('0x3a')]){if(this['channels'][_0x4d448b[_0xc30b('0x3a')]]){if(_0x4d448b[_0xc30b('0x3f')]==='6'){if(!this['channels'][_0x4d448b['linkedid']][_0xc30b('0x57')]){var _0x38e0fb=moment();this[_0xc30b('0x18')][_0x4d448b[_0xc30b('0x3a')]]['answered']=!![];this[_0xc30b('0x18')][_0x4d448b['linkedid']][_0xc30b('0x58')]=_0x38e0fb['format'](_0xc30b('0x3d'));if(this[_0xc30b('0x18')][_0x4d448b[_0xc30b('0x3a')]][_0xc30b('0x3c')]){this[_0xc30b('0x18')][_0x4d448b['linkedid']][_0xc30b('0x59')]=_0x38e0fb[_0xc30b('0x5a')](this[_0xc30b('0x18')][_0x4d448b['linkedid']][_0xc30b('0x3c')],'seconds');}}this[_0xc30b('0x18')][_0x4d448b[_0xc30b('0x3a')]]['linkedid']=_0x4d448b['uniqueid'];if(_0x4d448b['calleridnum']!==_0xc30b('0x5b')){this['channels'][_0x4d448b[_0xc30b('0x3a')]][_0xc30b('0x5c')]=_0x4d448b[_0xc30b('0x5d')];}this['channels'][_0x4d448b[_0xc30b('0x3a')]][_0xc30b('0x5e')]=_0x4d448b[_0xc30b('0x5f')];this[_0xc30b('0x18')][_0x4d448b[_0xc30b('0x3a')]][_0xc30b('0x60')]=_0x4d448b['channel'];this['channels'][_0x4d448b['linkedid']][_0xc30b('0x51')]=dispositions[_[_0xc30b('0x3e')](_0x4d448b['channelstate'])];if(this['agents'][_0x4d448b[_0xc30b('0x3b')][_0xc30b('0x42')]('-')[0x0]]){this[_0xc30b('0x18')][_0x4d448b['linkedid']][_0xc30b('0x61')]=this[_0xc30b('0x19')][_0x4d448b[_0xc30b('0x3b')]['split']('-')[0x0]]['id'];this[_0xc30b('0x18')][_0x4d448b[_0xc30b('0x3a')]][_0xc30b('0x62')]=this[_0xc30b('0x19')][_0x4d448b['channel'][_0xc30b('0x42')]('-')[0x0]][_0xc30b('0x47')];}}}}else{if(this[_0xc30b('0x18')][_0x4d448b[_0xc30b('0x33')]]){if(_0x4d448b[_0xc30b('0x3f')]==='6'){if(this['agents'][_0x4d448b[_0xc30b('0x3b')]['split']('-')[0x0]]){this['channels'][_0x4d448b['uniqueid']][_0xc30b('0x61')]=this[_0xc30b('0x19')][_0x4d448b[_0xc30b('0x3b')][_0xc30b('0x42')]('-')[0x0]]['id'];this[_0xc30b('0x18')][_0x4d448b[_0xc30b('0x33')]][_0xc30b('0x62')]=this[_0xc30b('0x19')][_0x4d448b[_0xc30b('0x3b')]['split']('-')[0x0]][_0xc30b('0x47')];}}}}}}catch(_0x5c06fb){logger[_0xc30b('0x37')](_0xc30b('0x63'),util['inspect'](_0x5c06fb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc30b('0x2f')]['syncMixMonitorFilename']=function(_0x465341,_0x157a86){if(this[_0xc30b('0x18')][_0x465341]){this['channels'][_0x465341][_0xc30b('0x64')]=!![];if(_[_0xc30b('0x65')](_0x157a86,_0xc30b('0x66'))){_0x157a86=_0x157a86[_0xc30b('0x67')](_0xc30b('0x66'),_0xc30b('0x68'));}this['channels'][_0x465341]['monitorFilename']=_0x157a86;var _0x366986=_['find'](this[_0xc30b('0x18')][_0x465341][_0xc30b('0x69')],{'filename':_0x157a86});if(_[_0xc30b('0x6a')](_0x366986)){this[_0xc30b('0x18')][_0x465341][_0xc30b('0x69')][_0xc30b('0x6b')]({'filename':_0x157a86,'createdAt':moment()[_0xc30b('0x45')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xc30b('0x6c')});}}};VoiceCallReport[_0xc30b('0x2f')][_0xc30b('0x23')]=function(_0x48fdcd){try{if(this[_0xc30b('0x30')](_0x48fdcd)){if(this[_0xc30b('0x18')][_0x48fdcd['uniqueid']]&&_0x48fdcd[_0xc30b('0x3b')]!='OutgoingSpoolFailed'){if(this['isNotNull'](_0x48fdcd[_0xc30b('0x6d')])){if(this[_0xc30b('0x30')](_0x48fdcd[_0xc30b('0x6d')]['mixmonitor_filename'])){this[_0xc30b('0x6e')](_0x48fdcd[_0xc30b('0x33')],_0x48fdcd[_0xc30b('0x6f')]);}else if(this[_0xc30b('0x30')](_0x48fdcd[_0xc30b('0x6d')][_0xc30b('0x70')])){this[_0xc30b('0x18')][_0x48fdcd[_0xc30b('0x33')]][_0xc30b('0x5d')]=_0x48fdcd[_0xc30b('0x6f')];}else if(this[_0xc30b('0x30')](_0x48fdcd['variable']['xmd-callerid'])){this[_0xc30b('0x18')][_0x48fdcd[_0xc30b('0x33')]]['callerid']=_0x48fdcd['value'];}else if(this[_0xc30b('0x30')](_0x48fdcd['variable'][_0xc30b('0x71')])){this[_0xc30b('0x18')][_0x48fdcd[_0xc30b('0x33')]][_0xc30b('0x72')]=_0x48fdcd[_0xc30b('0x6f')];}else if(this[_0xc30b('0x30')](_0x48fdcd[_0xc30b('0x6d')][_0xc30b('0x73')])){this['channels'][_0x48fdcd['uniqueid']][_0xc30b('0x56')]=_0x48fdcd['value'][_0xc30b('0x42')](',')[0x0];}else if(this[_0xc30b('0x30')](_0x48fdcd[_0xc30b('0x6d')]['xmd-originatecalleridnum'])){this['channels'][_0x48fdcd[_0xc30b('0x33')]]['originatecalleridnum']=_0x48fdcd[_0xc30b('0x6f')];}else if(this[_0xc30b('0x30')](_0x48fdcd['variable']['xmd-destination'])){this[_0xc30b('0x18')][_0x48fdcd[_0xc30b('0x33')]][_0xc30b('0x74')]=_0x48fdcd[_0xc30b('0x6f')];}else if(this[_0xc30b('0x30')](_0x48fdcd[_0xc30b('0x6d')][_0xc30b('0x75')])){this[_0xc30b('0x18')][_0x48fdcd['uniqueid']]['calleridpreview']=_0x48fdcd[_0xc30b('0x6f')];}else if(this[_0xc30b('0x30')](_0x48fdcd[_0xc30b('0x6d')][_0xc30b('0x76')])){this[_0xc30b('0x18')][_0x48fdcd[_0xc30b('0x33')]][_0xc30b('0x56')]=_0x48fdcd[_0xc30b('0x6f')];}else if(this[_0xc30b('0x30')](_0x48fdcd[_0xc30b('0x6d')][_0xc30b('0x77')])){this[_0xc30b('0x18')][_0x48fdcd[_0xc30b('0x33')]][_0xc30b('0x78')]=_0x48fdcd[_0xc30b('0x6f')];}}}else if(this[_0xc30b('0x30')](_0x48fdcd[_0xc30b('0x6d')][_0xc30b('0x79')])){if(_0x48fdcd[_0xc30b('0x6f')]){var _0x4ec0a2=path[_0xc30b('0x7a')](_0x48fdcd[_0xc30b('0x6f')])['name'];this[_0xc30b('0x6e')](_0x4ec0a2,_0x48fdcd[_0xc30b('0x6f')]);}}else if(this[_0xc30b('0x18')][_0x48fdcd['linkedid']]){if(this[_0xc30b('0x30')](_0x48fdcd[_0xc30b('0x6d')])){if(this[_0xc30b('0x30')](_0x48fdcd[_0xc30b('0x6d')][_0xc30b('0x77')])){this[_0xc30b('0x18')][_0x48fdcd[_0xc30b('0x3a')]][_0xc30b('0x7b')]=_0x48fdcd['value'];}}}}}catch(_0x4e3c02){logger[_0xc30b('0x37')](_0xc30b('0x7c'),util[_0xc30b('0x39')](_0x4e3c02,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc30b('0x2f')][_0xc30b('0x7d')]=function(_0x1119d5){try{if(this['isNotNull'](_0x1119d5)){if(this[_0xc30b('0x18')][_0x1119d5['uniqueid']]){var _0x552628=moment();this[_0xc30b('0x18')][_0x1119d5[_0xc30b('0x33')]]['endtime']=_0x552628[_0xc30b('0x45')](_0xc30b('0x3d'));this[_0xc30b('0x18')][_0x1119d5[_0xc30b('0x33')]][_0xc30b('0x4f')]=_0x552628[_0xc30b('0x5a')](this[_0xc30b('0x18')][_0x1119d5[_0xc30b('0x33')]][_0xc30b('0x3c')],_0xc30b('0x50'));if(this[_0xc30b('0x18')][_0x1119d5[_0xc30b('0x33')]][_0xc30b('0x57')]){this[_0xc30b('0x18')][_0x1119d5[_0xc30b('0x33')]][_0xc30b('0x7e')]=_0x552628[_0xc30b('0x5a')](this[_0xc30b('0x18')][_0x1119d5[_0xc30b('0x33')]]['answertime'],_0xc30b('0x50'));this[_0xc30b('0x18')][_0x1119d5[_0xc30b('0x33')]][_0xc30b('0x59')]=this[_0xc30b('0x18')][_0x1119d5[_0xc30b('0x33')]]['duration']-this[_0xc30b('0x18')][_0x1119d5[_0xc30b('0x33')]][_0xc30b('0x7e')];}if(_0x1119d5[_0xc30b('0x40')]===_0xc30b('0x41')){if(this['agents'][_0x1119d5[_0xc30b('0x3b')][_0xc30b('0x42')]('-')[0x0]]){this[_0xc30b('0x19')][_0x1119d5['channel']['split']('-')[0x0]]=_[_0xc30b('0x7f')](this[_0xc30b('0x19')][_0x1119d5[_0xc30b('0x3b')][_0xc30b('0x42')]('-')[0x0]],['destconnectedlinenum']);this['emit'](util[_0xc30b('0x45')](_0xc30b('0x46'),this['agents'][_0x1119d5['channel'][_0xc30b('0x42')]('-')[0x0]][_0xc30b('0x47')]),_0xc30b('0x80'),{'destaccountcode':this[_0xc30b('0x19')][_0x1119d5[_0xc30b('0x3b')][_0xc30b('0x42')]('-')[0x0]][_0xc30b('0x49')]});}}ami[_0xc30b('0x32')]('custom:voiceCallReport',this[_0xc30b('0x18')][_0x1119d5[_0xc30b('0x33')]]);delete this['channels'][_0x1119d5[_0xc30b('0x33')]];}}}catch(_0x5b911c){logger[_0xc30b('0x37')](_0xc30b('0x81'),util[_0xc30b('0x39')](_0x5b911c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc30b('0x2f')][_0xc30b('0x27')]=function(_0x25a49e){try{if(this[_0xc30b('0x30')](_0x25a49e)){if(this[_0xc30b('0x18')][_0x25a49e[_0xc30b('0x82')]]){this[_0xc30b('0x18')][_0x25a49e[_0xc30b('0x82')]][_0xc30b('0x83')]=_0x25a49e[_0xc30b('0x84')];this['channels'][_0x25a49e['transfereeuniqueid']][_0xc30b('0x85')]=_0x25a49e['transfertargetcalleridnum'];if(this[_0xc30b('0x18')][_0x25a49e[_0xc30b('0x86')]]){var _0xfca866=this[_0xc30b('0x18')][_0x25a49e['secondtransfereruniqueid']];this[_0xc30b('0x18')][_0x25a49e[_0xc30b('0x86')]]=this[_0xc30b('0x18')][_0x25a49e[_0xc30b('0x82')]];this['channels'][_0x25a49e[_0xc30b('0x82')]]=_0xfca866;}}else if(this['channels'][_0x25a49e['transfertargetuniqueid']]){this['channels'][_0x25a49e[_0xc30b('0x87')]]['transfercalleridnum']=_0x25a49e[_0xc30b('0x84')];this['channels'][_0x25a49e[_0xc30b('0x87')]][_0xc30b('0x85')]=_0x25a49e[_0xc30b('0x88')];if(this[_0xc30b('0x18')][_0x25a49e[_0xc30b('0x89')]]){var _0xfca866=this[_0xc30b('0x18')][_0x25a49e['origtransfereruniqueid']];this[_0xc30b('0x18')][_0x25a49e[_0xc30b('0x89')]]=this[_0xc30b('0x18')][_0x25a49e[_0xc30b('0x87')]];this[_0xc30b('0x18')][_0x25a49e[_0xc30b('0x87')]]=_0xfca866;}}}}catch(_0x551cd1){logger[_0xc30b('0x37')](_0xc30b('0x8a'),util[_0xc30b('0x39')](_0x551cd1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc30b('0x2f')][_0xc30b('0x29')]=function(_0x1d7de6){try{if(this[_0xc30b('0x30')](_0x1d7de6)){if(this[_0xc30b('0x18')][_0x1d7de6[_0xc30b('0x82')]]){this[_0xc30b('0x18')][_0x1d7de6['transfereeuniqueid']][_0xc30b('0x83')]=_0x1d7de6[_0xc30b('0x8b')];this['channels'][_0x1d7de6['transfereeuniqueid']][_0xc30b('0x85')]=_0x1d7de6[_0xc30b('0x8c')];this['syncHangup']({'event':_0xc30b('0x8d'),'uniqueid':_0x1d7de6[_0xc30b('0x82')],'context':_0x1d7de6[_0xc30b('0x40')],'channel':_0x1d7de6[_0xc30b('0x8e')]});}}}catch(_0x4d29bb){logger['error'](_0xc30b('0x8f'),util['inspect'](_0x4d29bb,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStart']=function(_0x385a03){try{if(this[_0xc30b('0x30')](_0x385a03)){if(this['channels'][_0x385a03[_0xc30b('0x33')]]){if(!_['isNil'](this[_0xc30b('0x18')][_0x385a03['uniqueid']][_0xc30b('0x58')])){this['channels'][_0x385a03[_0xc30b('0x33')]][_0xc30b('0x90')]=moment()[_0xc30b('0x45')](_0xc30b('0x3d'));}}}}catch(_0x44f995){logger[_0xc30b('0x37')](_0xc30b('0x91'),util[_0xc30b('0x39')](_0x44f995,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc30b('0x2f')][_0xc30b('0x2b')]=function(_0x97c85){try{if(this[_0xc30b('0x30')](_0x97c85)){if(this[_0xc30b('0x18')][_0x97c85[_0xc30b('0x33')]]){if(!_['isNil'](this[_0xc30b('0x18')][_0x97c85[_0xc30b('0x33')]][_0xc30b('0x90')])){this['channels'][_0x97c85[_0xc30b('0x33')]][_0xc30b('0x92')]+=moment()[_0xc30b('0x93')](0x0)[_0xc30b('0x5a')](this[_0xc30b('0x18')][_0x97c85['uniqueid']][_0xc30b('0x90')],_0xc30b('0x50'));delete this[_0xc30b('0x18')][_0x97c85['uniqueid']][_0xc30b('0x90')];}}}}catch(_0xa89add){logger[_0xc30b('0x37')](_0xc30b('0x94'),util[_0xc30b('0x39')](_0xa89add,{'showHidden':![],'depth':null}));}};module[_0xc30b('0x95')]=VoiceCallReport; \ No newline at end of file +var _0x3351=['busy','invalid','unavailable','ringing','ringinuse','onhold','set','queue','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','defaults','socket.io-emitter','redis','channels','agents','coreshowchannel','syncNewExten','newexten','bind','syncNewChannel','newstate','varset','syncVarSet','syncHangup','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','log','prototype','isNotNull','isUndefined','emit','syncNewCallerId','uniqueid','merge','keys','[syncNewCallerId][VoiceCallReport]','inspect','linkedid','channel','OutgoingSpoolFailed','starttime','format','disposition','toNumber','channelstate','from-sip','destconnectedlinenum','exten','user:%s','name','user:agentconnect','accountcode','error','application','toLowerCase','applicationdata','duration','subtract','seconds','pick','includes','lastapplication','lastdata','startsWith','cdr(','split','match','[syncNewExten][VoiceCallReport]','syncNewState','answered','answertime','YYYY-MM-DD\x20HH:mm:ss','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','.wav49','replace','.WAV','monitorFilename','monitors','push','rec','variable','mixmonitor_filename','xmd-phone','value','xmd-callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','destination','calleridpreview','xmcs-queue','sipcalluniqueid','[syncVarSet][VoiceCallReport]','billableseconds','context','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransferercalleridnum','transferconnectedlinenum','[syncAttendedTransfer][VoiceCallReport]','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','exports','bluebird','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','unknown','not_inuse','inuse'];(function(_0x2d437c,_0x298191){var _0x6db162=function(_0x4faf53){while(--_0x4faf53){_0x2d437c['push'](_0x2d437c['shift']());}};_0x6db162(++_0x298191);}(_0x3351,0x1b4));var _0x1335=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x3351[_0x491a7f];return _0x3d8f44;};'use strict';var BPromise=require(_0x1335('0x0'));var _=require('lodash');var moment=require('moment');var util=require(_0x1335('0x1'));var path=require(_0x1335('0x2'));var Redis=require(_0x1335('0x3'));var config=require(_0x1335('0x4'));var logger=require(_0x1335('0x5'))(_0x1335('0x6'));var ami=require(_0x1335('0x7'));var Channel=require('../model/channel');var statusDesc=[_0x1335('0x8'),_0x1335('0x9'),_0x1335('0xa'),_0x1335('0xb'),_0x1335('0xc'),_0x1335('0xd'),_0x1335('0xe'),_0x1335('0xf'),_0x1335('0x10')];var applications=[_0x1335('0x11'),_0x1335('0x12'),'agi',_0x1335('0x13'),'playback',_0x1335('0x14')];var dispositions=[_0x1335('0x15'),_0x1335('0x16'),_0x1335('0x16'),_0x1335('0x15'),_0x1335('0x15'),'NO\x20ANSWER',_0x1335('0x17'),'BUSY',_0x1335('0x16'),'FAILED',_0x1335('0x16')];var actions={};config['redis']=_[_0x1335('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1335('0x19'))(new Redis(config[_0x1335('0x1a')]));function VoiceCallReport(_0x48b651){this['channels']=_0x48b651[_0x1335('0x1b')];this['agents']=_0x48b651[_0x1335('0x1c')];ami['on'](_0x1335('0x1d'),this[_0x1335('0x1e')]['bind'](this));ami['on'](_0x1335('0x1f'),this['syncNewExten'][_0x1335('0x20')](this));ami['on']('newchannel',this[_0x1335('0x21')][_0x1335('0x20')](this));ami['on'](_0x1335('0x22'),this['syncNewState'][_0x1335('0x20')](this));ami['on'](_0x1335('0x23'),this[_0x1335('0x24')][_0x1335('0x20')](this));ami['on']('hangup',this[_0x1335('0x25')]['bind'](this));ami['on']('newcallerid',this['syncNewCallerId'][_0x1335('0x20')](this));ami['on'](_0x1335('0x26'),this[_0x1335('0x27')]['bind'](this));ami['on']('blindtransfer',this[_0x1335('0x28')]['bind'](this));ami['on'](_0x1335('0x29'),this['syncMusicOnHoldStart'][_0x1335('0x20')](this));ami['on'](_0x1335('0x2a'),this[_0x1335('0x2b')][_0x1335('0x20')](this));return BPromise[_0x1335('0x2c')]()[_0x1335('0x2d')](ami[_0x1335('0x2e')]())['catch'](function(_0x37efee){console[_0x1335('0x2f')](_0x37efee);});}VoiceCallReport[_0x1335('0x30')][_0x1335('0x31')]=function(_0x4cf375){return _0x4cf375!==null&&!_[_0x1335('0x32')](_0x4cf375);};VoiceCallReport[_0x1335('0x30')][_0x1335('0x33')]=function(_0x469bfb,_0x2f5bc3,_0x3fadf1){io['to'](_0x469bfb)[_0x1335('0x33')](_0x2f5bc3,_0x3fadf1);};VoiceCallReport[_0x1335('0x30')][_0x1335('0x34')]=function(_0xdc07ab){try{if(this[_0x1335('0x31')](_0xdc07ab)){if(_0xdc07ab[_0x1335('0x35')]===_0xdc07ab['linkedid']){if(!_[_0x1335('0x32')](this['channels'][_0xdc07ab[_0x1335('0x35')]])){_[_0x1335('0x36')](this[_0x1335('0x1b')][_0xdc07ab[_0x1335('0x35')]],_['pick'](_0xdc07ab,_[_0x1335('0x37')](this[_0x1335('0x1b')][_0xdc07ab[_0x1335('0x35')]])));}}}}catch(_0x36ec2e){logger['error'](_0x1335('0x38'),util[_0x1335('0x39')](_0x36ec2e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1335('0x30')][_0x1335('0x21')]=function(_0x3a4961){try{if(this[_0x1335('0x31')](_0x3a4961)){if(_0x3a4961['uniqueid']===_0x3a4961[_0x1335('0x3a')]&&_0x3a4961[_0x1335('0x3b')]!=_0x1335('0x3c')){if(_[_0x1335('0x32')](this['channels'][_0x3a4961[_0x1335('0x35')]])){this['channels'][_0x3a4961[_0x1335('0x35')]]=new Channel();this['channels'][_0x3a4961[_0x1335('0x35')]][_0x1335('0x3d')]=moment()[_0x1335('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1335('0x1b')][_0x3a4961['uniqueid']][_0x1335('0x3f')]=dispositions[_[_0x1335('0x40')](_0x3a4961[_0x1335('0x41')])];_[_0x1335('0x36')](this[_0x1335('0x1b')][_0x3a4961[_0x1335('0x35')]],_['pick'](_0x3a4961,_[_0x1335('0x37')](this[_0x1335('0x1b')][_0x3a4961[_0x1335('0x35')]])));if(_0x3a4961['context']===_0x1335('0x42')){if(this['agents'][_0x3a4961[_0x1335('0x3b')]['split']('-')[0x0]]){this[_0x1335('0x1c')][_0x3a4961[_0x1335('0x3b')]['split']('-')[0x0]][_0x1335('0x43')]=_0x3a4961[_0x1335('0x44')];this['emit'](util[_0x1335('0x3e')](_0x1335('0x45'),this[_0x1335('0x1c')][_0x3a4961[_0x1335('0x3b')]['split']('-')[0x0]][_0x1335('0x46')]),_0x1335('0x47'),{'destaccountcode':this[_0x1335('0x1c')][_0x3a4961['channel']['split']('-')[0x0]][_0x1335('0x48')],'destconnectedlinenum':_0x3a4961[_0x1335('0x44')]});}}}}}}catch(_0x1cca5c){logger[_0x1335('0x49')]('[syncNewChannel][VoiceCallReport]',util['inspect'](_0x1cca5c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1335('0x30')][_0x1335('0x1e')]=function(_0x251f87){try{if(this[_0x1335('0x31')](_0x251f87)){if(_0x251f87[_0x1335('0x35')]===_0x251f87[_0x1335('0x3a')]&&_0x251f87['exten']!='h'&&_0x251f87[_0x1335('0x3b')]!=_0x1335('0x3c')){_0x251f87[_0x1335('0x4a')]=_0x251f87['application'][_0x1335('0x4b')]();_0x251f87[_0x1335('0x4c')]=(_0x251f87['appdata']||_0x251f87['applicationdata'])['toLowerCase']();if(_[_0x1335('0x32')](this[_0x1335('0x1b')][_0x251f87[_0x1335('0x35')]])){this[_0x1335('0x1b')][_0x251f87[_0x1335('0x35')]]=new Channel();this[_0x1335('0x1b')][_0x251f87[_0x1335('0x35')]][_0x1335('0x3d')]=_0x251f87[_0x1335('0x4d')]?moment()[_0x1335('0x4e')](moment['duration'](_0x251f87['duration'])[_0x1335('0x4f')](),_0x1335('0x4f'))[_0x1335('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'):moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x251f87[_0x1335('0x35')]][_0x1335('0x3f')]=_0x1335('0x15');}_[_0x1335('0x36')](this[_0x1335('0x1b')][_0x251f87[_0x1335('0x35')]],_[_0x1335('0x50')](_0x251f87,_['keys'](this[_0x1335('0x1b')][_0x251f87[_0x1335('0x35')]])));if(_[_0x1335('0x51')](applications,_0x251f87[_0x1335('0x4a')])){this[_0x1335('0x1b')][_0x251f87[_0x1335('0x35')]][_0x1335('0x52')]=_0x251f87[_0x1335('0x4a')];this[_0x1335('0x1b')][_0x251f87[_0x1335('0x35')]][_0x1335('0x53')]=_0x251f87[_0x1335('0x4c')];if(_0x251f87['application']===_0x1335('0x11')&&_[_0x1335('0x54')](_0x251f87['applicationdata'],_0x1335('0x55'))){var _0x3f190d=_0x251f87[_0x1335('0x4c')][_0x1335('0x56')]('=');var _0x57e619=_0x3f190d[0x0][_0x1335('0x57')](/cdr\((.*)\)/);if(_0x57e619){this[_0x1335('0x1b')][_0x251f87[_0x1335('0x35')]][_0x57e619[0x1]]=_0x3f190d[0x1];}}else if(_0x251f87['application']===_0x1335('0x12')){this[_0x1335('0x1b')][_0x251f87[_0x1335('0x35')]]['queue']=_0x251f87[_0x1335('0x4c')][_0x1335('0x56')](',')[0x0];}}}}}catch(_0x15db3d){logger['error'](_0x1335('0x58'),util['inspect'](_0x15db3d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1335('0x30')][_0x1335('0x59')]=function(_0x99a122){try{if(this[_0x1335('0x31')](_0x99a122)){if(_0x99a122[_0x1335('0x35')]!==_0x99a122[_0x1335('0x3a')]){if(this[_0x1335('0x1b')][_0x99a122[_0x1335('0x3a')]]){if(_0x99a122[_0x1335('0x41')]==='6'){if(!this[_0x1335('0x1b')][_0x99a122[_0x1335('0x3a')]][_0x1335('0x5a')]){var _0x599216=moment();this[_0x1335('0x1b')][_0x99a122['linkedid']][_0x1335('0x5a')]=!![];this[_0x1335('0x1b')][_0x99a122[_0x1335('0x3a')]][_0x1335('0x5b')]=_0x599216[_0x1335('0x3e')](_0x1335('0x5c'));if(this[_0x1335('0x1b')][_0x99a122['linkedid']][_0x1335('0x3d')]){this['channels'][_0x99a122['linkedid']][_0x1335('0x5d')]=_0x599216[_0x1335('0x5e')](this['channels'][_0x99a122[_0x1335('0x3a')]]['starttime'],'seconds');}}this['channels'][_0x99a122['linkedid']][_0x1335('0x3a')]=_0x99a122[_0x1335('0x35')];if(_0x99a122[_0x1335('0x5f')]!==_0x1335('0x60')){this[_0x1335('0x1b')][_0x99a122['linkedid']][_0x1335('0x61')]=_0x99a122[_0x1335('0x5f')];}this[_0x1335('0x1b')][_0x99a122['linkedid']][_0x1335('0x62')]=_0x99a122[_0x1335('0x63')];this[_0x1335('0x1b')][_0x99a122['linkedid']][_0x1335('0x64')]=_0x99a122[_0x1335('0x3b')];this[_0x1335('0x1b')][_0x99a122[_0x1335('0x3a')]]['disposition']=dispositions[_['toNumber'](_0x99a122[_0x1335('0x41')])];if(this['agents'][_0x99a122['channel']['split']('-')[0x0]]){this[_0x1335('0x1b')][_0x99a122[_0x1335('0x3a')]][_0x1335('0x65')]=this[_0x1335('0x1c')][_0x99a122[_0x1335('0x3b')][_0x1335('0x56')]('-')[0x0]]['id'];this[_0x1335('0x1b')][_0x99a122[_0x1335('0x3a')]]['membername']=this[_0x1335('0x1c')][_0x99a122[_0x1335('0x3b')][_0x1335('0x56')]('-')[0x0]]['name'];}}}}else{if(this['channels'][_0x99a122[_0x1335('0x35')]]){if(_0x99a122['channelstate']==='6'){if(this[_0x1335('0x1c')][_0x99a122[_0x1335('0x3b')][_0x1335('0x56')]('-')[0x0]]){this[_0x1335('0x1b')][_0x99a122[_0x1335('0x35')]][_0x1335('0x65')]=this['agents'][_0x99a122[_0x1335('0x3b')][_0x1335('0x56')]('-')[0x0]]['id'];this['channels'][_0x99a122['uniqueid']][_0x1335('0x66')]=this[_0x1335('0x1c')][_0x99a122['channel'][_0x1335('0x56')]('-')[0x0]]['name'];}}}}}}catch(_0x245aed){logger[_0x1335('0x49')](_0x1335('0x67'),util['inspect'](_0x245aed,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1335('0x30')][_0x1335('0x68')]=function(_0x3620bd,_0x26c3bb){if(this[_0x1335('0x1b')][_0x3620bd]){this[_0x1335('0x1b')][_0x3620bd][_0x1335('0x69')]=!![];if(_['endsWith'](_0x26c3bb,_0x1335('0x6a'))){_0x26c3bb=_0x26c3bb[_0x1335('0x6b')](_0x1335('0x6a'),_0x1335('0x6c'));}this['channels'][_0x3620bd][_0x1335('0x6d')]=_0x26c3bb;var _0x355500=_['find'](this[_0x1335('0x1b')][_0x3620bd][_0x1335('0x6e')],{'filename':_0x26c3bb});if(_['isNil'](_0x355500)){this[_0x1335('0x1b')][_0x3620bd][_0x1335('0x6e')][_0x1335('0x6f')]({'filename':_0x26c3bb,'createdAt':moment()[_0x1335('0x3e')](_0x1335('0x5c')),'mixmonitorid':'','status':_0x1335('0x70')});}}};VoiceCallReport[_0x1335('0x30')]['syncVarSet']=function(_0x1c028a){try{if(this[_0x1335('0x31')](_0x1c028a)){if(this[_0x1335('0x1b')][_0x1c028a[_0x1335('0x35')]]&&_0x1c028a[_0x1335('0x3b')]!='OutgoingSpoolFailed'){if(this[_0x1335('0x31')](_0x1c028a[_0x1335('0x71')])){if(this[_0x1335('0x31')](_0x1c028a[_0x1335('0x71')][_0x1335('0x72')])){this[_0x1335('0x68')](_0x1c028a['uniqueid'],_0x1c028a['value']);}else if(this[_0x1335('0x31')](_0x1c028a['variable'][_0x1335('0x73')])){this['channels'][_0x1c028a[_0x1335('0x35')]][_0x1335('0x5f')]=_0x1c028a[_0x1335('0x74')];}else if(this[_0x1335('0x31')](_0x1c028a[_0x1335('0x71')][_0x1335('0x75')])){this[_0x1335('0x1b')][_0x1c028a[_0x1335('0x35')]]['callerid']=_0x1c028a[_0x1335('0x74')];}else if(this[_0x1335('0x31')](_0x1c028a[_0x1335('0x71')][_0x1335('0x76')])){this['channels'][_0x1c028a[_0x1335('0x35')]][_0x1335('0x77')]=_0x1c028a[_0x1335('0x74')];}else if(this[_0x1335('0x31')](_0x1c028a[_0x1335('0x71')][_0x1335('0x78')])){this[_0x1335('0x1b')][_0x1c028a[_0x1335('0x35')]]['queue']=_0x1c028a['value'][_0x1335('0x56')](',')[0x0];}else if(this[_0x1335('0x31')](_0x1c028a['variable'][_0x1335('0x79')])){this[_0x1335('0x1b')][_0x1c028a['uniqueid']]['originatecalleridnum']=_0x1c028a['value'];}else if(this[_0x1335('0x31')](_0x1c028a[_0x1335('0x71')]['xmd-destination'])){this[_0x1335('0x1b')][_0x1c028a[_0x1335('0x35')]][_0x1335('0x7a')]=_0x1c028a[_0x1335('0x74')];}else if(this['isNotNull'](_0x1c028a['variable']['xmd-callerid-preview'])){this[_0x1335('0x1b')][_0x1c028a[_0x1335('0x35')]][_0x1335('0x7b')]=_0x1c028a[_0x1335('0x74')];}else if(this[_0x1335('0x31')](_0x1c028a[_0x1335('0x71')][_0x1335('0x7c')])){this[_0x1335('0x1b')][_0x1c028a[_0x1335('0x35')]][_0x1335('0x12')]=_0x1c028a[_0x1335('0x74')];}else if(this[_0x1335('0x31')](_0x1c028a['variable']['sipcallid'])){this[_0x1335('0x1b')][_0x1c028a[_0x1335('0x35')]][_0x1335('0x7d')]=_0x1c028a['value'];}}}else if(this[_0x1335('0x31')](_0x1c028a[_0x1335('0x71')][_0x1335('0x72')])){if(_0x1c028a[_0x1335('0x74')]){var _0x45c29a=path['parse'](_0x1c028a[_0x1335('0x74')])[_0x1335('0x46')];this[_0x1335('0x68')](_0x45c29a,_0x1c028a['value']);}}else if(this[_0x1335('0x1b')][_0x1c028a['linkedid']]){if(this['isNotNull'](_0x1c028a[_0x1335('0x71')])){if(this[_0x1335('0x31')](_0x1c028a['variable']['sipcallid'])){this['channels'][_0x1c028a['linkedid']]['sipcalllinkedid']=_0x1c028a['value'];}}}}}catch(_0x4669f8){logger[_0x1335('0x49')](_0x1335('0x7e'),util[_0x1335('0x39')](_0x4669f8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1335('0x30')][_0x1335('0x25')]=function(_0x4fe069){try{if(this[_0x1335('0x31')](_0x4fe069)){if(this[_0x1335('0x1b')][_0x4fe069[_0x1335('0x35')]]){var _0x37724a=moment();this['channels'][_0x4fe069[_0x1335('0x35')]]['endtime']=_0x37724a[_0x1335('0x3e')](_0x1335('0x5c'));this[_0x1335('0x1b')][_0x4fe069[_0x1335('0x35')]][_0x1335('0x4d')]=_0x37724a[_0x1335('0x5e')](this[_0x1335('0x1b')][_0x4fe069[_0x1335('0x35')]][_0x1335('0x3d')],_0x1335('0x4f'));if(this[_0x1335('0x1b')][_0x4fe069[_0x1335('0x35')]][_0x1335('0x5a')]){this['channels'][_0x4fe069[_0x1335('0x35')]][_0x1335('0x7f')]=_0x37724a[_0x1335('0x5e')](this['channels'][_0x4fe069[_0x1335('0x35')]][_0x1335('0x5b')],_0x1335('0x4f'));this['channels'][_0x4fe069[_0x1335('0x35')]]['holdtime']=this[_0x1335('0x1b')][_0x4fe069[_0x1335('0x35')]][_0x1335('0x4d')]-this[_0x1335('0x1b')][_0x4fe069[_0x1335('0x35')]][_0x1335('0x7f')];}if(_0x4fe069[_0x1335('0x80')]===_0x1335('0x42')){if(this['agents'][_0x4fe069['channel'][_0x1335('0x56')]('-')[0x0]]){this[_0x1335('0x1c')][_0x4fe069[_0x1335('0x3b')][_0x1335('0x56')]('-')[0x0]]=_[_0x1335('0x81')](this['agents'][_0x4fe069[_0x1335('0x3b')][_0x1335('0x56')]('-')[0x0]],[_0x1335('0x43')]);this['emit'](util[_0x1335('0x3e')]('user:%s',this[_0x1335('0x1c')][_0x4fe069[_0x1335('0x3b')][_0x1335('0x56')]('-')[0x0]][_0x1335('0x46')]),_0x1335('0x82'),{'destaccountcode':this[_0x1335('0x1c')][_0x4fe069[_0x1335('0x3b')][_0x1335('0x56')]('-')[0x0]][_0x1335('0x48')]});}}ami['emit'](_0x1335('0x83'),this[_0x1335('0x1b')][_0x4fe069[_0x1335('0x35')]]);delete this[_0x1335('0x1b')][_0x4fe069[_0x1335('0x35')]];}}}catch(_0x437eaa){logger[_0x1335('0x49')](_0x1335('0x84'),util[_0x1335('0x39')](_0x437eaa,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncAttendedTransfer']=function(_0x53b70b){try{if(this[_0x1335('0x31')](_0x53b70b)){if(this['channels'][_0x53b70b[_0x1335('0x85')]]){this['channels'][_0x53b70b['transfereeuniqueid']][_0x1335('0x86')]=_0x53b70b['origtransferercalleridnum'];this[_0x1335('0x1b')][_0x53b70b[_0x1335('0x85')]]['transferconnectedlinenum']=_0x53b70b[_0x1335('0x87')];if(this[_0x1335('0x1b')][_0x53b70b[_0x1335('0x88')]]){var _0x29b23a=this['channels'][_0x53b70b[_0x1335('0x88')]];this[_0x1335('0x1b')][_0x53b70b[_0x1335('0x88')]]=this[_0x1335('0x1b')][_0x53b70b[_0x1335('0x85')]];this[_0x1335('0x1b')][_0x53b70b[_0x1335('0x85')]]=_0x29b23a;}}else if(this['channels'][_0x53b70b[_0x1335('0x89')]]){this[_0x1335('0x1b')][_0x53b70b[_0x1335('0x89')]][_0x1335('0x86')]=_0x53b70b[_0x1335('0x8a')];this['channels'][_0x53b70b[_0x1335('0x89')]][_0x1335('0x8b')]=_0x53b70b[_0x1335('0x87')];if(this[_0x1335('0x1b')][_0x53b70b['origtransfereruniqueid']]){var _0x29b23a=this['channels'][_0x53b70b['origtransfereruniqueid']];this[_0x1335('0x1b')][_0x53b70b['origtransfereruniqueid']]=this[_0x1335('0x1b')][_0x53b70b['transfertargetuniqueid']];this[_0x1335('0x1b')][_0x53b70b[_0x1335('0x89')]]=_0x29b23a;}}}}catch(_0x52a0cb){logger[_0x1335('0x49')](_0x1335('0x8c'),util[_0x1335('0x39')](_0x52a0cb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1335('0x30')][_0x1335('0x28')]=function(_0x807a91){try{if(this[_0x1335('0x31')](_0x807a91)){if(this['channels'][_0x807a91[_0x1335('0x85')]]){this[_0x1335('0x1b')][_0x807a91[_0x1335('0x85')]]['transfercalleridnum']=_0x807a91['transfereecalleridnum'];this['channels'][_0x807a91['transfereeuniqueid']][_0x1335('0x8b')]=_0x807a91[_0x1335('0x8d')];this[_0x1335('0x25')]({'event':_0x1335('0x8e'),'uniqueid':_0x807a91[_0x1335('0x85')],'context':_0x807a91['context'],'channel':_0x807a91[_0x1335('0x8f')]});}}}catch(_0xc783b4){logger[_0x1335('0x49')](_0x1335('0x90'),util[_0x1335('0x39')](_0xc783b4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1335('0x30')]['syncMusicOnHoldStart']=function(_0x424ffb){try{if(this[_0x1335('0x31')](_0x424ffb)){if(this[_0x1335('0x1b')][_0x424ffb['uniqueid']]){if(!_['isNil'](this['channels'][_0x424ffb[_0x1335('0x35')]][_0x1335('0x5b')])){this[_0x1335('0x1b')][_0x424ffb['uniqueid']][_0x1335('0x91')]=moment()[_0x1335('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x3f20c4){logger[_0x1335('0x49')](_0x1335('0x92'),util[_0x1335('0x39')](_0x3f20c4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1335('0x30')][_0x1335('0x2b')]=function(_0x122a59){try{if(this[_0x1335('0x31')](_0x122a59)){if(this[_0x1335('0x1b')][_0x122a59[_0x1335('0x35')]]){if(!_['isNil'](this[_0x1335('0x1b')][_0x122a59['uniqueid']]['mohstarttime'])){this['channels'][_0x122a59[_0x1335('0x35')]][_0x1335('0x93')]+=moment()['milliseconds'](0x0)[_0x1335('0x5e')](this[_0x1335('0x1b')][_0x122a59[_0x1335('0x35')]][_0x1335('0x91')],_0x1335('0x4f'));delete this[_0x1335('0x1b')][_0x122a59['uniqueid']][_0x1335('0x91')];}}}}catch(_0x42536e){logger[_0x1335('0x49')]('[syncMusicOnHoldStop][VoiceCallReport]',util[_0x1335('0x39')](_0x42536e,{'showHidden':![],'depth':null}));}};module[_0x1335('0x94')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 83624de..e4d19c5 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 _0x0565=['format','YYYY-MM-DD\x20HH:mm:ss','called','channel','lastIndexOf','omit','event','privilege','voice:outbound','voice_outbound_channel:save','custom:dialbegin','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','custom:dialconnect','error','addVariable','keys','variable','value','outboundrouteid','[syncVarSet][VoiceDialReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','isNil','includes','syncHangup','endtime','duration','diff','complete','total','answered','holdtime','seconds','sumHoldTime','sumBillable','billableseconds','sumDuration','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','isUndefined','emit','prototype','isNotNull','channels','merge','uniqueid'];(function(_0x4937f9,_0x2b00b9){var _0x1640e0=function(_0x435698){while(--_0x435698){_0x4937f9['push'](_0x4937f9['shift']());}};_0x1640e0(++_0x2b00b9);}(_0x0565,0xf2));var _0x5056=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x0565[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x5056('0x0'));var moment=require(_0x5056('0x1'));var util=require(_0x5056('0x2'));var Redis=require(_0x5056('0x3'));var config=require(_0x5056('0x4'));var logger=require(_0x5056('0x5'))(_0x5056('0x6'));var ami=require(_0x5056('0x7'));config[_0x5056('0x8')]=_[_0x5056('0x9')](config['redis'],{'host':_0x5056('0xa'),'port':0x18eb});var io=require(_0x5056('0xb'))(new Redis(config[_0x5056('0x8')]));function VoiceDialReport(_0x22afb7){this['channels']=_0x22afb7['outboundChannels'];this[_0x5056('0xc')]=_0x22afb7[_0x5056('0xc')];this[_0x5056('0xd')]={};ami['on'](_0x5056('0xe'),this[_0x5056('0xf')][_0x5056('0x10')](this));ami['on'](_0x5056('0x11'),this[_0x5056('0x12')]['bind'](this));ami['on'](_0x5056('0x13'),this[_0x5056('0x14')][_0x5056('0x10')](this));ami['on']('hangup',this['syncHangup'][_0x5056('0x10')](this));}VoiceDialReport['prototype']['isNotNull']=function(_0x53e98a){return _0x53e98a!==null&&!_[_0x5056('0x15')](_0x53e98a);};VoiceDialReport['prototype'][_0x5056('0x16')]=function(_0x26edc1,_0x7af76b,_0x543cee){io['to'](_0x26edc1)[_0x5056('0x16')](_0x7af76b,_0x543cee);};VoiceDialReport[_0x5056('0x17')][_0x5056('0xf')]=function(_0x56c3ef){try{if(this[_0x5056('0x18')](_0x56c3ef)){if(this[_0x5056('0x19')][_0x56c3ef['uniqueid']]){_[_0x5056('0x1a')](this['channels'][_0x56c3ef[_0x5056('0x1b')]],{'starttime':moment()[_0x5056('0x1c')](_0x5056('0x1d')),'lastevent':_0x5056('0x1e'),'interface':_0x56c3ef[_0x5056('0x1f')]['substring'](0x0,_0x56c3ef[_0x5056('0x1f')][_0x5056('0x20')]('-')),'membername':_0x56c3ef['channel']['substring'](_0x56c3ef[_0x5056('0x1f')][_0x5056('0x20')]('/')+0x1,_0x56c3ef[_0x5056('0x1f')][_0x5056('0x20')]('-'))},_[_0x5056('0x21')](_0x56c3ef,[_0x5056('0x22'),_0x5056('0x23')]));this['emit'](_0x5056('0x24'),_0x5056('0x25'),this['channels'][_0x56c3ef[_0x5056('0x1b')]]);ami[_0x5056('0x16')](_0x5056('0x26'),this['channels'][_0x56c3ef[_0x5056('0x1b')]]);}}}catch(_0x26a3c2){logger['error']('[syncDialBegin][VoiceDialReport]',util[_0x5056('0x27')](_0x26a3c2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x5056('0x17')][_0x5056('0x12')]=function(_0x37f7b5){try{if(this['isNotNull'](_0x37f7b5)){if(this[_0x5056('0x19')][_0x37f7b5[_0x5056('0x1b')]]){this['channels'][_0x37f7b5[_0x5056('0x1b')]]['dialstatus']=_0x37f7b5[_0x5056('0x28')];if(_0x37f7b5[_0x5056('0x28')]===_0x5056('0x29')){this[_0x5056('0x19')][_0x37f7b5[_0x5056('0x1b')]]['connectedlinenum']=_0x37f7b5[_0x5056('0x2a')];this[_0x5056('0x19')][_0x37f7b5[_0x5056('0x1b')]][_0x5056('0x2b')]=_0x37f7b5['connectedlinename'];this[_0x5056('0x19')][_0x37f7b5['uniqueid']][_0x5056('0x2c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x37f7b5[_0x5056('0x1b')]][_0x5056('0x2d')]='connect';ami[_0x5056('0x16')](_0x5056('0x2e'),this[_0x5056('0x19')][_0x37f7b5[_0x5056('0x1b')]]);}this[_0x5056('0x16')](_0x5056('0x24'),_0x5056('0x25'),this[_0x5056('0x19')][_0x37f7b5[_0x5056('0x1b')]]);}}}catch(_0x2f66d3){logger[_0x5056('0x2f')]('[syncDialEnd][VoiceDialReport]',util['inspect'](_0x2f66d3,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x5056('0x17')][_0x5056('0x14')]=function(_0x5c2913){try{if(this[_0x5056('0x18')](_0x5c2913)){this[_0x5056('0x30')](_0x5c2913['uniqueid'],_[_0x5056('0x31')](_0x5c2913[_0x5056('0x32')])[0x0],_0x5c2913[_0x5056('0x33')]);if(this[_0x5056('0x18')](_0x5c2913[_0x5056('0x32')])&&this[_0x5056('0x18')](_0x5c2913[_0x5056('0x32')][_0x5056('0x34')])){if(_[_0x5056('0x15')](this[_0x5056('0x19')][_0x5c2913[_0x5056('0x1b')]])){this[_0x5056('0x19')][_0x5c2913[_0x5056('0x1b')]]={'routeId':_0x5c2913[_0x5056('0x33')],'variables':this[_0x5056('0xd')][_0x5c2913['uniqueid']]};this[_0x5056('0x16')]('voice:outbound',_0x5056('0x25'),this[_0x5056('0x19')][_0x5c2913[_0x5056('0x1b')]]);}}}}catch(_0x286d64){logger['error'](_0x5056('0x35'),util[_0x5056('0x27')](_0x286d64,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x5056('0x30')]=function(_0x5dbe6d,_0x3006ca,_0x349318){var _0x3d56cf=['rtpaudioqos',_0x5056('0x36'),_0x5056('0x37'),_0x5056('0x38'),_0x5056('0x39'),_0x5056('0x3a'),_0x5056('0x3b'),_0x5056('0x3c'),_0x5056('0x3d'),_0x5056('0x3e'),_0x5056('0x3f'),_0x5056('0x40'),_0x5056('0x41'),_0x5056('0x42'),_0x5056('0x43'),_0x5056('0x44'),_0x5056('0x45'),'memberpenalty','memberrealtime'];if(!_[_0x5056('0x46')](_0x3006ca)&&!_[_0x5056('0x47')](_0x3d56cf,_0x3006ca)){if(_[_0x5056('0x15')](this[_0x5056('0xd')][_0x5dbe6d])){this[_0x5056('0xd')][_0x5dbe6d]={};}this[_0x5056('0xd')][_0x5dbe6d][_0x3006ca]=_0x349318;}};VoiceDialReport[_0x5056('0x17')][_0x5056('0x48')]=function(_0x48ab5e){try{if(this['isNotNull'](_0x48ab5e)){if(this[_0x5056('0x19')][_0x48ab5e[_0x5056('0x1b')]]){this[_0x5056('0x19')][_0x48ab5e['uniqueid']][_0x5056('0x49')]=moment()['format'](_0x5056('0x1d'));this[_0x5056('0x19')][_0x48ab5e[_0x5056('0x1b')]][_0x5056('0x4a')]=moment(this[_0x5056('0x19')][_0x48ab5e[_0x5056('0x1b')]]['endtime'])[_0x5056('0x4b')](this[_0x5056('0x19')][_0x48ab5e[_0x5056('0x1b')]]['starttime'],'seconds');this['channels'][_0x48ab5e['uniqueid']][_0x5056('0x2d')]=_0x5056('0x4c');this[_0x5056('0xc')][_0x5056('0x4d')]+=0x1;if(this[_0x5056('0x19')][_0x48ab5e['uniqueid']]['answertime']){this[_0x5056('0xc')][_0x5056('0x4e')]+=0x1;this[_0x5056('0x19')][_0x48ab5e[_0x5056('0x1b')]][_0x5056('0x4f')]=moment(this[_0x5056('0x19')][_0x48ab5e[_0x5056('0x1b')]]['answertime'])['diff'](this[_0x5056('0x19')][_0x48ab5e[_0x5056('0x1b')]]['starttime'],_0x5056('0x50'));this[_0x5056('0x19')][_0x48ab5e['uniqueid']]['billableseconds']=moment(this[_0x5056('0x19')][_0x48ab5e[_0x5056('0x1b')]]['endtime'])['diff'](this[_0x5056('0x19')][_0x48ab5e[_0x5056('0x1b')]]['answertime'],'seconds');this[_0x5056('0xc')][_0x5056('0x51')]+=this[_0x5056('0x19')][_0x48ab5e[_0x5056('0x1b')]][_0x5056('0x4f')]||0x0;this[_0x5056('0xc')][_0x5056('0x52')]+=this[_0x5056('0x19')][_0x48ab5e[_0x5056('0x1b')]][_0x5056('0x53')];}this[_0x5056('0xc')][_0x5056('0x54')]+=this[_0x5056('0x19')][_0x48ab5e[_0x5056('0x1b')]][_0x5056('0x4a')];ami['emit']('custom:voiceDialReport',this[_0x5056('0x19')][_0x48ab5e[_0x5056('0x1b')]]);ami[_0x5056('0x16')](_0x5056('0x55'),this[_0x5056('0x19')][_0x48ab5e[_0x5056('0x1b')]]);this['emit'](_0x5056('0x24'),_0x5056('0x56'),this[_0x5056('0xc')]);this[_0x5056('0x16')](_0x5056('0x24'),_0x5056('0x57'),this[_0x5056('0x19')][_0x48ab5e[_0x5056('0x1b')]]);delete this[_0x5056('0x19')][_0x48ab5e[_0x5056('0x1b')]];}if(this[_0x5056('0xd')][_0x48ab5e[_0x5056('0x1b')]]){delete this[_0x5056('0xd')][_0x48ab5e['uniqueid']];}}}catch(_0xf1deff){logger[_0x5056('0x2f')](_0x5056('0x58'),util['inspect'](_0xf1deff,{'showHidden':![],'depth':null}));}};module[_0x5056('0x59')]=VoiceDialReport; \ No newline at end of file +var _0x1339=['dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','isNotNull','emit','prototype','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','privilege','voice:outbound','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','dialstatus','ANSWER','connectedlinenum','answertime','[syncDialEnd][VoiceDialReport]','inspect','addVariable','keys','variable','value','isUndefined','voice_outbound_channel:save','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','membername','memberpenalty','memberrealtime','isNil','endtime','duration','diff','complete','total','answered','holdtime','starttime','seconds','billableseconds','sumHoldTime','sumBillable','sumDuration','custom:voiceDialReport','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind'];(function(_0x2277ef,_0xb678dc){var _0x55111c=function(_0x21d31e){while(--_0x21d31e){_0x2277ef['push'](_0x2277ef['shift']());}};_0x55111c(++_0xb678dc);}(_0x1339,0x1ed));var _0x9133=function(_0xabbc11,_0x258112){_0xabbc11=_0xabbc11-0x0;var _0x149780=_0x1339[_0xabbc11];return _0x149780;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x9133('0x0'));var Redis=require(_0x9133('0x1'));var config=require(_0x9133('0x2'));var logger=require(_0x9133('0x3'))(_0x9133('0x4'));var ami=require(_0x9133('0x5'));config[_0x9133('0x6')]=_[_0x9133('0x7')](config['redis'],{'host':_0x9133('0x8'),'port':0x18eb});var io=require(_0x9133('0x9'))(new Redis(config[_0x9133('0x6')]));function VoiceDialReport(_0x539af6){this[_0x9133('0xa')]=_0x539af6[_0x9133('0xb')];this[_0x9133('0xc')]=_0x539af6[_0x9133('0xc')];this[_0x9133('0xd')]={};ami['on'](_0x9133('0xe'),this[_0x9133('0xf')][_0x9133('0x10')](this));ami['on'](_0x9133('0x11'),this[_0x9133('0x12')]['bind'](this));ami['on'](_0x9133('0x13'),this[_0x9133('0x14')][_0x9133('0x10')](this));ami['on'](_0x9133('0x15'),this[_0x9133('0x16')][_0x9133('0x10')](this));}VoiceDialReport['prototype'][_0x9133('0x17')]=function(_0x7cc59e){return _0x7cc59e!==null&&!_['isUndefined'](_0x7cc59e);};VoiceDialReport['prototype'][_0x9133('0x18')]=function(_0x4bf947,_0x22132a,_0x439e1a){io['to'](_0x4bf947)[_0x9133('0x18')](_0x22132a,_0x439e1a);};VoiceDialReport[_0x9133('0x19')][_0x9133('0xf')]=function(_0x4327b3){try{if(this['isNotNull'](_0x4327b3)){if(this[_0x9133('0xa')][_0x4327b3[_0x9133('0x1a')]]){_['merge'](this[_0x9133('0xa')][_0x4327b3[_0x9133('0x1a')]],{'starttime':moment()[_0x9133('0x1b')](_0x9133('0x1c')),'lastevent':'called','interface':_0x4327b3[_0x9133('0x1d')]['substring'](0x0,_0x4327b3[_0x9133('0x1d')]['lastIndexOf']('-')),'membername':_0x4327b3[_0x9133('0x1d')][_0x9133('0x1e')](_0x4327b3['channel'][_0x9133('0x1f')]('/')+0x1,_0x4327b3['channel'][_0x9133('0x1f')]('-'))},_['omit'](_0x4327b3,['event',_0x9133('0x20')]));this['emit'](_0x9133('0x21'),'voice_outbound_channel:save',this['channels'][_0x4327b3['uniqueid']]);ami[_0x9133('0x18')](_0x9133('0x22'),this['channels'][_0x4327b3[_0x9133('0x1a')]]);}}}catch(_0x3f5d0e){logger[_0x9133('0x23')](_0x9133('0x24'),util['inspect'](_0x3f5d0e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9133('0x19')]['syncDialEnd']=function(_0x187e32){try{if(this[_0x9133('0x17')](_0x187e32)){if(this[_0x9133('0xa')][_0x187e32[_0x9133('0x1a')]]){this[_0x9133('0xa')][_0x187e32[_0x9133('0x1a')]][_0x9133('0x25')]=_0x187e32[_0x9133('0x25')];if(_0x187e32[_0x9133('0x25')]===_0x9133('0x26')){this['channels'][_0x187e32['uniqueid']][_0x9133('0x27')]=_0x187e32[_0x9133('0x27')];this[_0x9133('0xa')][_0x187e32[_0x9133('0x1a')]]['connectedlinename']=_0x187e32['connectedlinename'];this[_0x9133('0xa')][_0x187e32[_0x9133('0x1a')]][_0x9133('0x28')]=moment()[_0x9133('0x1b')](_0x9133('0x1c'));this[_0x9133('0xa')][_0x187e32['uniqueid']]['lastevent']='connect';ami[_0x9133('0x18')]('custom:dialconnect',this[_0x9133('0xa')][_0x187e32[_0x9133('0x1a')]]);}this['emit'](_0x9133('0x21'),'voice_outbound_channel:save',this[_0x9133('0xa')][_0x187e32[_0x9133('0x1a')]]);}}}catch(_0x4020d1){logger['error'](_0x9133('0x29'),util[_0x9133('0x2a')](_0x4020d1,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9133('0x19')]['syncVarSet']=function(_0x10cea6){try{if(this[_0x9133('0x17')](_0x10cea6)){this[_0x9133('0x2b')](_0x10cea6['uniqueid'],_[_0x9133('0x2c')](_0x10cea6[_0x9133('0x2d')])[0x0],_0x10cea6[_0x9133('0x2e')]);if(this[_0x9133('0x17')](_0x10cea6['variable'])&&this[_0x9133('0x17')](_0x10cea6[_0x9133('0x2d')]['outboundrouteid'])){if(_[_0x9133('0x2f')](this[_0x9133('0xa')][_0x10cea6[_0x9133('0x1a')]])){this[_0x9133('0xa')][_0x10cea6[_0x9133('0x1a')]]={'routeId':_0x10cea6[_0x9133('0x2e')],'variables':this[_0x9133('0xd')][_0x10cea6[_0x9133('0x1a')]]};this[_0x9133('0x18')](_0x9133('0x21'),_0x9133('0x30'),this['channels'][_0x10cea6[_0x9133('0x1a')]]);}}}}catch(_0x2c2e16){logger['error'](_0x9133('0x31'),util[_0x9133('0x2a')](_0x2c2e16,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9133('0x19')][_0x9133('0x2b')]=function(_0x255ff9,_0x3d24f4,_0x5d9b15){var _0x4e16d2=[_0x9133('0x32'),_0x9133('0x33'),_0x9133('0x34'),_0x9133('0x35'),_0x9133('0x36'),_0x9133('0x37'),_0x9133('0x38'),_0x9133('0x39'),_0x9133('0x3a'),'sipuri',_0x9133('0x3b'),_0x9133('0x3c'),_0x9133('0x3d'),_0x9133('0x3e'),_0x9133('0x3f'),'memberlastcall',_0x9133('0x40'),_0x9133('0x41'),_0x9133('0x42')];if(!_[_0x9133('0x43')](_0x3d24f4)&&!_['includes'](_0x4e16d2,_0x3d24f4)){if(_[_0x9133('0x2f')](this[_0x9133('0xd')][_0x255ff9])){this[_0x9133('0xd')][_0x255ff9]={};}this[_0x9133('0xd')][_0x255ff9][_0x3d24f4]=_0x5d9b15;}};VoiceDialReport[_0x9133('0x19')][_0x9133('0x16')]=function(_0x3b2287){try{if(this['isNotNull'](_0x3b2287)){if(this[_0x9133('0xa')][_0x3b2287['uniqueid']]){this['channels'][_0x3b2287[_0x9133('0x1a')]][_0x9133('0x44')]=moment()[_0x9133('0x1b')](_0x9133('0x1c'));this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]][_0x9133('0x45')]=moment(this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]]['endtime'])[_0x9133('0x46')](this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]]['starttime'],'seconds');this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]]['lastevent']=_0x9133('0x47');this[_0x9133('0xc')][_0x9133('0x48')]+=0x1;if(this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]]['answertime']){this[_0x9133('0xc')][_0x9133('0x49')]+=0x1;this[_0x9133('0xa')][_0x3b2287['uniqueid']][_0x9133('0x4a')]=moment(this[_0x9133('0xa')][_0x3b2287['uniqueid']]['answertime'])[_0x9133('0x46')](this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]][_0x9133('0x4b')],_0x9133('0x4c'));this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]][_0x9133('0x4d')]=moment(this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]][_0x9133('0x44')])[_0x9133('0x46')](this['channels'][_0x3b2287['uniqueid']][_0x9133('0x28')],'seconds');this[_0x9133('0xc')][_0x9133('0x4e')]+=this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]]['holdtime']||0x0;this[_0x9133('0xc')][_0x9133('0x4f')]+=this[_0x9133('0xa')][_0x3b2287['uniqueid']][_0x9133('0x4d')];}this[_0x9133('0xc')][_0x9133('0x50')]+=this['channels'][_0x3b2287[_0x9133('0x1a')]]['duration'];ami[_0x9133('0x18')](_0x9133('0x51'),this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]]);ami['emit']('custom:dialend',this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]]);this[_0x9133('0x18')](_0x9133('0x21'),_0x9133('0x52'),this['outbound']);this['emit'](_0x9133('0x21'),_0x9133('0x53'),this['channels'][_0x3b2287[_0x9133('0x1a')]]);delete this[_0x9133('0xa')][_0x3b2287['uniqueid']];}if(this['variables'][_0x3b2287['uniqueid']]){delete this[_0x9133('0xd')][_0x3b2287['uniqueid']];}}}catch(_0x12d9e1){logger[_0x9133('0x23')](_0x9133('0x54'),util[_0x9133('0x2a')](_0x12d9e1,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index a326aeb..d72a910 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 _0x1362=['lastevent','custom:queuecallerunmanaged','custom:queuecallerabandon','[syncHangup][VoiceQueueReport]','syncAttendedTransfer','transfereeuniqueid','transferuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','BLIND','context','[syncBlindTransfer][VoiceQueueReport]','syncMusicOnHoldStart','mohstarttime','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','moment','bluebird','util','md5','ioredis','../../../config/environment','../../../config/logger','../ami','../model/queueReport','redis','localhost','socket.io-emitter','prototype','enqueue','tail','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerLeave','agentcomplete','agentconnect','syncAgentConnect','varset','syncVarSet','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','waiting','queueStatusComplete','clearZombieChannels','switch','Action','status','channel','catch','message','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','queueReports','[voiceQueueReport][checkQueueReport]','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','agents','emitVoiceQueueChannelRemove','inspect','emit','voice:queue:%s','name','voice_queue_channel:save','voice_queue_channel:remove','type','inbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','voice_queue:save','isNotNull','isUndefined','queues','then','[queuesummary]','queue','countBy','callers','toNumber','loggedin','emitVoiceQueueSummary','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncNewExten','uniqueid','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','position','count','pick','keys','emitVoiceQueueChannelSave','[syncQueueCallerJoin][VoiceQueueReport]','syncQueueCallerAbandon','queuecallercomplete','holdtime','originalposition','queuecallerexitreason','ABANDONED','[syncQueueCallerAbandon][VoiceQueueReport]','last','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','queuecallerabandonAt','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','COMPLETEDBY','toUpperCase','addVariable','value','variable','queuestatus','queuecallerleaveAt','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepvtcallid','memberdynamic','memberlastcall','memberrealtime','isNil','length','diff','milliseconds','queuecallercompleteAt'];(function(_0x4ac968,_0x109db1){var _0x17ae59=function(_0x16a5cf){while(--_0x16a5cf){_0x4ac968['push'](_0x4ac968['shift']());}};_0x17ae59(++_0x109db1);}(_0x1362,0x193));var _0x2136=function(_0x5f5987,_0x3ffa58){_0x5f5987=_0x5f5987-0x0;var _0x1d2eb2=_0x1362[_0x5f5987];return _0x1d2eb2;};'use strict';var _=require(_0x2136('0x0'));var moment=require(_0x2136('0x1'));var BPromise=require(_0x2136('0x2'));var util=require(_0x2136('0x3'));var md5=require(_0x2136('0x4'));var Redis=require(_0x2136('0x5'));var config=require(_0x2136('0x6'));var logger=require(_0x2136('0x7'))('ami');var ami=require(_0x2136('0x8'));var QueueReport=require(_0x2136('0x9'));config[_0x2136('0xa')]=_['defaults'](config[_0x2136('0xa')],{'host':_0x2136('0xb'),'port':0x18eb});var io=require(_0x2136('0xc'))(new Redis(config[_0x2136('0xa')]));var Sequence=function(){};Sequence[_0x2136('0xd')][_0x2136('0xe')]=function(_0x34864b){this[_0x2136('0xf')]=this[_0x2136('0xf')]?this[_0x2136('0xf')]['finally'](_0x34864b):_0x34864b();};function VoiceQueueReport(_0x509159){this['sequence']=new Sequence();this['queueReports']={};this['agents']=_0x509159['agents'];this[_0x2136('0x10')]=_0x509159[_0x2136('0x11')];this[_0x2136('0x12')]=_0x509159[_0x2136('0x12')];this[_0x2136('0x13')]=!![];this['campaigns']=_0x509159[_0x2136('0x14')];this[_0x2136('0x15')]={};ami['on'](_0x2136('0x16'),this[_0x2136('0x17')][_0x2136('0x18')](this));ami['on'](_0x2136('0x19'),this[_0x2136('0x1a')]['bind'](this));ami['on']('queuecallerjoin',this[_0x2136('0x1b')][_0x2136('0x18')](this));ami['on'](_0x2136('0x1c'),this['syncQueueCallerAbandon'][_0x2136('0x18')](this));ami['on']('queuecallerleave',this[_0x2136('0x1d')]['bind'](this));ami['on'](_0x2136('0x1e'),this['syncAgentComplete'][_0x2136('0x18')](this));ami['on'](_0x2136('0x1f'),this[_0x2136('0x20')][_0x2136('0x18')](this));ami['on'](_0x2136('0x21'),this[_0x2136('0x22')]['bind'](this));ami['on']('hangup',this[_0x2136('0x23')][_0x2136('0x18')](this));ami['on']('fullybooted',this['syncFullyBooted']['bind'](this));ami['on'](_0x2136('0x24'),this['syncMusicOnHoldStart'][_0x2136('0x18')](this));ami['on'](_0x2136('0x25'),this[_0x2136('0x26')][_0x2136('0x18')](this));ami['on'](_0x2136('0x27'),this['syncAttendedTransfer'][_0x2136('0x18')](this));ami['on'](_0x2136('0x28'),this[_0x2136('0x29')]['bind'](this));this[_0x2136('0x2a')]();this[_0x2136('0x2b')]();}function isNotNull(_0x592cfa){return _0x592cfa!==null&&!_['isUndefined'](_0x592cfa);}function clearChannels(_0x970e9d){if(!_[_0x2136('0x2c')](_0x970e9d)){for(var _0x305c20 in _0x970e9d){if(_0x970e9d['hasOwnProperty'](_0x305c20)){delete _0x970e9d[_0x305c20];}}}}function clearCampaigns(_0xe7396c){if(!_[_0x2136('0x2c')](_0xe7396c)){for(var _0x12dd81 in _0xe7396c){if(_0xe7396c[_0x2136('0x2d')](_0x12dd81)){_0xe7396c[_0x12dd81][_0x2136('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x111c48){if(!_[_0x2136('0x2c')](_0x111c48)){for(var _0x10c488 in _0x111c48){if(_0x111c48[_0x2136('0x2d')](_0x10c488)){_0x111c48[_0x10c488][_0x2136('0x2e')]=0x0;_0x111c48[_0x10c488]['talking']=0x0;_0x111c48[_0x10c488]['pTalking']=0x0;_0x111c48[_0x10c488][_0x2136('0x2f')]=0x0;_0x111c48[_0x10c488][_0x2136('0x30')]=!![];}}}}function clearAgentBooked(_0x15b4b3){if(!_[_0x2136('0x2c')](_0x15b4b3)){for(var _0x2537be in _0x15b4b3){if(_0x15b4b3[_0x2136('0x2d')](_0x2537be)){_0x15b4b3[_0x2537be]['unlockRR']=!![];}}}}VoiceQueueReport[_0x2136('0xd')][_0x2136('0x31')]=function(){var _0x8b2b1c=this;for(var _0x248bff in this[_0x2136('0x10')]){if(this[_0x2136('0x10')][_0x2136('0x2d')](_0x248bff)&&!this[_0x2136('0x10')][_0x248bff][_0x2136('0x32')]){this['sequence'][_0x2136('0xe')](function(){if(!_['isNil'](_0x8b2b1c[_0x2136('0x10')][_0x248bff])){return ami[_0x2136('0x33')]({'action':_0x2136('0x34'),'channel':_0x8b2b1c[_0x2136('0x10')][_0x248bff][_0x2136('0x35')]})[_0x2136('0x36')](function(_0x29159c){if(_0x29159c[_0x2136('0x37')]===_0x2136('0x38')){setTimeout(function(){if(_0x8b2b1c[_0x2136('0x10')][_0x248bff]){delete _0x8b2b1c['channels'][_0x248bff];logger[_0x2136('0x39')](_0x2136('0x3a'),_0x248bff);}if(_0x8b2b1c[_0x2136('0x3b')][_0x248bff]){delete _0x8b2b1c[_0x2136('0x3b')][_0x248bff];logger[_0x2136('0x39')](_0x2136('0x3c'),_0x248bff);}if(_0x8b2b1c[_0x2136('0x15')][_0x248bff]){delete _0x8b2b1c['variables'][_0x248bff];logger['error'](_0x2136('0x3d'),_0x248bff);}},0x1f40);}});}});}}};VoiceQueueReport[_0x2136('0xd')]['syncFullyBooted']=function(){logger['error'](_0x2136('0x3e'));clearChannels(this[_0x2136('0x10')]);this[_0x2136('0x3f')](this[_0x2136('0x3b')]);clearAgentBooked(this[_0x2136('0x40')]);clearVoiceQueues(this[_0x2136('0x12')]);clearCampaigns(this[_0x2136('0x14')]);};VoiceQueueReport[_0x2136('0xd')][_0x2136('0x3f')]=function(_0x5df2df){var _0x28edcc=this;if(!_['isEmpty'](_0x5df2df)){for(var _0x28bcf9 in _0x5df2df){if(_0x5df2df[_0x2136('0x2d')](_0x28bcf9)){_0x28edcc[_0x2136('0x41')](_0x5df2df[_0x28bcf9]);delete _0x5df2df[_0x28bcf9];}}}};function loggerCatch(_0x3df6fe){return function(_0x245dca){logger[_0x2136('0x39')](_0x3df6fe,util[_0x2136('0x42')](_0x245dca,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x2136('0xd')][_0x2136('0x43')]=function(_0x1de732,_0x3992ac,_0x5b9fa7){io['to'](_0x1de732)['emit'](_0x3992ac,_0x5b9fa7);};VoiceQueueReport[_0x2136('0xd')]['emitVoiceQueueChannelSave']=function(_0x548b47){this[_0x2136('0x43')](util['format'](_0x2136('0x44'),_0x548b47[_0x2136('0x45')]),_0x2136('0x46'),_0x548b47);};VoiceQueueReport['prototype'][_0x2136('0x41')]=function(_0xcef927){this['emit'](util['format'](_0x2136('0x44'),_0xcef927[_0x2136('0x45')]),_0x2136('0x47'),_0xcef927);};VoiceQueueReport['prototype']['emitVoiceQueueSummary']=function(_0x2dedb6){if(_0x2dedb6[_0x2136('0x48')]===_0x2136('0x49')){var _0x16f142={'id':_0x2dedb6['id'],'name':_0x2dedb6['name'],'strategy':_0x2dedb6[_0x2136('0x4a')],'answered':_0x2dedb6[_0x2136('0x4b')],'available':_0x2dedb6[_0x2136('0x4c')],'loggedIn':_0x2dedb6[_0x2136('0x4d')],'pTalking':_0x2dedb6['pTalking'],'sumBillable':_0x2dedb6[_0x2136('0x4e')],'sumDuration':_0x2dedb6[_0x2136('0x4f')],'sumHoldTime':_0x2dedb6[_0x2136('0x50')]||0x0,'talking':_0x2dedb6[_0x2136('0x51')],'total':_0x2dedb6['total'],'type':_0x2dedb6[_0x2136('0x48')],'unmanaged':_0x2dedb6[_0x2136('0x52')],'abandoned':_0x2dedb6[_0x2136('0x53')],'waiting':_0x2dedb6[_0x2136('0x2f')]};if(_0x2dedb6[_0x2136('0x54')]){_0x16f142['Trunk']={'id':_0x2dedb6[_0x2136('0x54')]['id'],'name':_0x2dedb6[_0x2136('0x54')][_0x2136('0x45')],'active':_0x2dedb6[_0x2136('0x54')][_0x2136('0x55')],'callerid':_0x2dedb6[_0x2136('0x54')][_0x2136('0x56')]};}if(_0x2dedb6['Interval']){_0x16f142[_0x2136('0x57')]={'id':_0x2dedb6['Interval']['id'],'name':_0x2dedb6[_0x2136('0x57')][_0x2136('0x45')]};}var _0x26489c=md5(JSON[_0x2136('0x58')](_0x16f142));if(_0x2dedb6[_0x2136('0x4')]!==_0x26489c){_0x2dedb6[_0x2136('0x4')]=_0x26489c;this[_0x2136('0x43')](util['format']('voice:queue:%s',_0x16f142[_0x2136('0x45')]),_0x2136('0x59'),_0x16f142);}}};VoiceQueueReport[_0x2136('0xd')][_0x2136('0x5a')]=function(_0x330462){return _0x330462!==null&&!_[_0x2136('0x5b')](_0x330462);};VoiceQueueReport[_0x2136('0xd')]['loopQueueShow']=function(){var _0xae703=this;setInterval(function(){_0xae703[_0x2136('0x31')]();ami[_0x2136('0x33')]({'action':_0x2136('0x5c')})[_0x2136('0x36')](loggerCatch('[queues]'));},0x2710);};VoiceQueueReport[_0x2136('0xd')]['loopQueueSummary']=function(){var _0x1a03e3=this;setInterval(function(){if(_0x1a03e3['flagQueueSummary']){return ami['Action']({'action':'queuesummary'})[_0x2136('0x5d')](function(_0xc43bca){_0x1a03e3['flagQueueSummary']=![];})[_0x2136('0x36')](loggerCatch(_0x2136('0x5e')));}},0x3e8);};VoiceQueueReport[_0x2136('0xd')]['syncQueueSummary']=function(_0xa2becd){try{if(this['isNotNull'](_0xa2becd)&&this[_0x2136('0x5a')](_0xa2becd[_0x2136('0x5f')])){if(this['voiceQueues'][_0xa2becd[_0x2136('0x5f')]]){var _0x566d8b=_[_0x2136('0x60')](this[_0x2136('0x10')],'queue')[_0xa2becd['queue']]||0x0;var _0x5321fe=_0x566d8b-_0xa2becd[_0x2136('0x61')];if(this[_0x2136('0x12')][_0xa2becd[_0x2136('0x5f')]][_0x2136('0x2f')]!==_[_0x2136('0x62')](_0xa2becd['callers'])||this[_0x2136('0x12')][_0xa2becd[_0x2136('0x5f')]][_0x2136('0x4d')]!==_[_0x2136('0x62')](_0xa2becd[_0x2136('0x63')])||this[_0x2136('0x12')][_0xa2becd[_0x2136('0x5f')]]['available']!==_[_0x2136('0x62')](_0xa2becd[_0x2136('0x4c')])||this[_0x2136('0x12')][_0xa2becd[_0x2136('0x5f')]][_0x2136('0x51')]!==_0x5321fe){this[_0x2136('0x12')][_0xa2becd[_0x2136('0x5f')]][_0x2136('0x2f')]=_[_0x2136('0x62')](_0xa2becd[_0x2136('0x61')]);this[_0x2136('0x12')][_0xa2becd[_0x2136('0x5f')]]['loggedIn']=_[_0x2136('0x62')](_0xa2becd['loggedin']);this[_0x2136('0x12')][_0xa2becd['queue']][_0x2136('0x4c')]=_['toNumber'](_0xa2becd[_0x2136('0x4c')]);this[_0x2136('0x12')][_0xa2becd[_0x2136('0x5f')]][_0x2136('0x51')]=_0x5321fe>0x0?_0x5321fe:0x0;this[_0x2136('0x12')][_0xa2becd[_0x2136('0x5f')]][_0x2136('0x51')]=this[_0x2136('0x12')][_0xa2becd[_0x2136('0x5f')]]['talking']>_[_0x2136('0x62')](_0xa2becd[_0x2136('0x63')])?_['toNumber'](_0xa2becd[_0x2136('0x63')]):this[_0x2136('0x12')][_0xa2becd[_0x2136('0x5f')]][_0x2136('0x51')];this[_0x2136('0x64')](this[_0x2136('0x12')][_0xa2becd['queue']]);}ami['emit'](_0x2136('0x65'),this[_0x2136('0x12')][_0xa2becd[_0x2136('0x5f')]]);}}}catch(_0x5458a0){logger['error'](_0x2136('0x66'),util[_0x2136('0x42')](_0x5458a0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2136('0xd')]['syncQueueSummaryComplete']=function(_0x2bfea5){this[_0x2136('0x13')]=!![];};VoiceQueueReport[_0x2136('0xd')][_0x2136('0x67')]=function(_0x362942){};VoiceQueueReport[_0x2136('0xd')]['syncQueueCallerJoin']=function(_0x220aa9){try{if(this[_0x2136('0x5a')](_0x220aa9)){if(_[_0x2136('0x5b')](this[_0x2136('0x3b')][_0x220aa9[_0x2136('0x68')]])){this[_0x2136('0x3b')][_0x220aa9[_0x2136('0x68')]]=[];this['channels'][_0x220aa9[_0x2136('0x68')]]={};}var _0x42c17e=new QueueReport();_0x42c17e[_0x2136('0x45')]=_0x220aa9[_0x2136('0x5f')];_0x42c17e[_0x2136('0x48')]=this[_0x2136('0x12')][_0x42c17e[_0x2136('0x45')]]&&this[_0x2136('0x12')][_0x42c17e[_0x2136('0x45')]][_0x2136('0x48')]?this['voiceQueues'][_0x42c17e[_0x2136('0x45')]][_0x2136('0x48')]||'inbound':'inbound';_0x42c17e[_0x2136('0x5f')]=_0x220aa9[_0x2136('0x5f')];_0x42c17e[_0x2136('0x69')]=moment()[_0x2136('0x6a')](_0x2136('0x6b'));_0x42c17e[_0x2136('0x6c')]=_0x220aa9['position'];_0x42c17e['count']=_0x220aa9[_0x2136('0x6d')];_['merge'](_0x42c17e,_[_0x2136('0x6e')](_0x220aa9,_[_0x2136('0x6f')](_0x42c17e)));this[_0x2136('0x3b')][_0x220aa9[_0x2136('0x68')]]['push'](_0x42c17e);this[_0x2136('0x10')][_0x220aa9[_0x2136('0x68')]]=_0x42c17e;this[_0x2136('0x70')](_0x42c17e);}}catch(_0x2b3a28){logger['error'](_0x2136('0x71'),util[_0x2136('0x42')](_0x2b3a28,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2136('0xd')][_0x2136('0x72')]=function(_0x161e5a){try{if(this[_0x2136('0x5a')](_0x161e5a)){if(this[_0x2136('0x3b')][_0x161e5a[_0x2136('0x68')]]){var _0x972729=_['last'](this['queueReports'][_0x161e5a[_0x2136('0x68')]]);_0x972729[_0x2136('0x73')]=![];_0x972729['queuecallercompleteAt']=null;_0x972729[_0x2136('0x74')]=_0x161e5a['holdtime'];_0x972729[_0x2136('0x75')]=_0x161e5a[_0x2136('0x75')];_0x972729[_0x2136('0x1c')]=!![];_0x972729['queuecallerabandonAt']=moment()[_0x2136('0x6a')](_0x2136('0x6b'));_0x972729[_0x2136('0x76')]=_0x2136('0x77');_0x972729['lastAssignedTo']=null;this[_0x2136('0x10')][_0x161e5a['uniqueid']]=_0x972729;this[_0x2136('0x41')](_0x972729);}}}catch(_0x5609f8){logger['error'](_0x2136('0x78'),util['inspect'](_0x5609f8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2136('0xd')][_0x2136('0x1d')]=function(_0x1acb19){try{if(this[_0x2136('0x5a')](_0x1acb19)){if(this['queueReports'][_0x1acb19['uniqueid']]){var _0x21cca9=_[_0x2136('0x79')](this['queueReports'][_0x1acb19[_0x2136('0x68')]]);_0x21cca9['queuecallerleaveAt']=moment()[_0x2136('0x6a')](_0x2136('0x6b'));_0x21cca9['connectedlinenum']=_0x1acb19['connectedlinenum'];_0x21cca9[_0x2136('0x7a')]=_0x1acb19[_0x2136('0x7a')];this[_0x2136('0x10')][_0x1acb19[_0x2136('0x68')]]=_0x21cca9;this[_0x2136('0x70')](_0x21cca9);}}}catch(_0x66c938){logger[_0x2136('0x39')](_0x2136('0x7b'),util[_0x2136('0x42')](_0x66c938,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2136('0xd')][_0x2136('0x20')]=function(_0x1bd0dd){try{if(this['isNotNull'](_0x1bd0dd)){if(this['queueReports'][_0x1bd0dd[_0x2136('0x68')]]){var _0x53966d=_[_0x2136('0x79')](this['queueReports'][_0x1bd0dd[_0x2136('0x68')]]);_0x53966d[_0x2136('0x73')]=!![];_0x53966d['queuecallerexitreason']=_0x2136('0x7c');}}}catch(_0x16917c){logger[_0x2136('0x39')](_0x2136('0x7d'),util['inspect'](_0x16917c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2136('0xd')]['syncAgentComplete']=function(_0x17cce8){try{if(this[_0x2136('0x5a')](_0x17cce8)){if(this[_0x2136('0x3b')][_0x17cce8['uniqueid']]){var _0x38eb3d=_[_0x2136('0x79')](this['queueReports'][_0x17cce8[_0x2136('0x68')]]);_0x38eb3d[_0x2136('0x1c')]=![];_0x38eb3d[_0x2136('0x7e')]=null;_0x38eb3d[_0x2136('0x7f')]=!![];_0x38eb3d['lastAssignedTo']=_0x17cce8[_0x2136('0x80')];_0x38eb3d['holdtime']=_0x17cce8[_0x2136('0x74')];_0x38eb3d[_0x2136('0x73')]=!![];_0x38eb3d[_0x2136('0x81')]=![];_0x38eb3d[_0x2136('0x82')]=null;if(!_0x38eb3d[_0x2136('0x83')]){if(_0x17cce8[_0x2136('0x84')]==_0x2136('0x83')){_0x38eb3d[_0x2136('0x76')]=_0x2136('0x85');}else{if(_[_0x2136('0x86')](_0x17cce8[_0x2136('0x35')][_0x2136('0x87')](),_0x2136('0x88'))){if(this[_0x2136('0x3b')][_0x17cce8['linkedid']]){var _0x5c6d2b=_[_0x2136('0x79')](this['queueReports'][_0x17cce8[_0x2136('0x89')]]);_0x5c6d2b[_0x2136('0x73')]=![];_0x5c6d2b[_0x2136('0x81')]=!![];_0x5c6d2b[_0x2136('0x82')]=moment(_0x38eb3d[_0x2136('0x69')])[_0x2136('0x8a')](_0x17cce8[_0x2136('0x74')],_0x2136('0x8b'))[_0x2136('0x6a')](_0x2136('0x6b'));_0x5c6d2b[_0x2136('0x76')]=_0x2136('0x8c');_0x5c6d2b[_0x2136('0x83')]=!![];_0x5c6d2b[_0x2136('0x8d')]=_0x2136('0x8e');_0x5c6d2b[_0x2136('0x8f')]=_0x17cce8[_0x2136('0x90')];_0x5c6d2b['transferuniqueid']=_0x17cce8[_0x2136('0x68')];var _0x35e02b=this[_0x2136('0x3b')][_0x17cce8[_0x2136('0x89')]];this['queueReports'][_0x17cce8[_0x2136('0x89')]]=this[_0x2136('0x3b')][_0x17cce8[_0x2136('0x68')]];this[_0x2136('0x3b')][_0x17cce8[_0x2136('0x68')]]=_0x35e02b;}}else{_0x38eb3d[_0x2136('0x76')]=_0x2136('0x91')+_0x17cce8[_0x2136('0x84')][_0x2136('0x92')]();}}}this['channels'][_0x17cce8['uniqueid']]=_0x38eb3d;this[_0x2136('0x41')](_0x38eb3d);}}}catch(_0x1e08f5){logger[_0x2136('0x39')]('[syncAgentComplete][VoiceQueueReport]',util['inspect'](_0x1e08f5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2136('0xd')][_0x2136('0x22')]=function(_0x4dbe20){try{if(this[_0x2136('0x5a')](_0x4dbe20)){this[_0x2136('0x93')](_0x4dbe20[_0x2136('0x68')],_['keys'](_0x4dbe20['variable'])[0x0],_0x4dbe20[_0x2136('0x94')]);if(this[_0x2136('0x3b')][_0x4dbe20[_0x2136('0x68')]]){var _0x14eb25=_['last'](this[_0x2136('0x3b')][_0x4dbe20[_0x2136('0x68')]]);if(_0x14eb25){if(this[_0x2136('0x5a')](_0x4dbe20['variable'])&&this[_0x2136('0x5a')](_0x4dbe20[_0x2136('0x95')][_0x2136('0x96')])){switch(_0x4dbe20[_0x2136('0x94')]){case'CONTINUE':_0x14eb25[_0x2136('0x81')]=![];_0x14eb25[_0x2136('0x82')]=null;break;default:_0x14eb25['queuecallerexit']=!![];_0x14eb25[_0x2136('0x82')]=moment()[_0x2136('0x6a')](_0x2136('0x6b'));_0x14eb25[_0x2136('0x97')]=moment()[_0x2136('0x6a')](_0x2136('0x6b'));}_0x14eb25['queuecallerabandon']=![];_0x14eb25[_0x2136('0x7e')]=null;_0x14eb25[_0x2136('0x76')]=_0x4dbe20[_0x2136('0x94')];this[_0x2136('0x10')][_0x4dbe20[_0x2136('0x68')]]=_0x14eb25;this['emitVoiceQueueChannelRemove'](_0x14eb25);}else if(this[_0x2136('0x5a')](_0x4dbe20[_0x2136('0x95')])&&this[_0x2136('0x5a')](_0x4dbe20[_0x2136('0x95')]['queueposition'])){if(!_0x14eb25[_0x2136('0x1c')]){_0x14eb25[_0x2136('0x81')]=!![];_0x14eb25[_0x2136('0x82')]=moment()[_0x2136('0x6a')](_0x2136('0x6b'));_0x14eb25['queuecallerexitreason']=_0x2136('0x98');_0x14eb25[_0x2136('0x97')]=moment()['format'](_0x2136('0x6b'));this[_0x2136('0x10')][_0x4dbe20['uniqueid']]=_0x14eb25;}}_0x14eb25[_0x2136('0x15')]=this[_0x2136('0x15')][_0x4dbe20[_0x2136('0x68')]];}}}}catch(_0x416e29){logger[_0x2136('0x39')](_0x2136('0x99'),util['inspect'](_0x416e29,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2136('0xd')]['addVariable']=function(_0x4770b7,_0x2a862e,_0x102736){var _0x37ef6b=[_0x2136('0x9a'),_0x2136('0x9b'),_0x2136('0x9c'),'rtpaudioqosjitterbridged',_0x2136('0x9d'),_0x2136('0x9e'),'rtpaudioqosrtt',_0x2136('0x9f'),_0x2136('0xa0'),'sipuri','bridgepeer',_0x2136('0xa1'),'membercalls',_0x2136('0xa2'),'memberinterface',_0x2136('0xa3'),_0x2136('0x80'),'memberpenalty',_0x2136('0xa4')];if(!_[_0x2136('0xa5')](_0x2a862e)&&!_['includes'](_0x37ef6b,_0x2a862e)){if(_[_0x2136('0x5b')](this[_0x2136('0x15')][_0x4770b7])){this['variables'][_0x4770b7]={};}this[_0x2136('0x15')][_0x4770b7][_0x2a862e]=_0x102736;}};VoiceQueueReport[_0x2136('0xd')][_0x2136('0x23')]=function(_0x215572){try{if(this[_0x2136('0x5a')](_0x215572)){if(this['queueReports'][_0x215572[_0x2136('0x68')]]){for(var _0x197305=0x0,_0x6696bb={};_0x1973050x0?_0x54600b:0x0;this[_0x3a8e('0xe')][_0x4ddd46[_0x3a8e('0x5b')]][_0x3a8e('0x4e')]=this['voiceQueues'][_0x4ddd46[_0x3a8e('0x5b')]][_0x3a8e('0x4e')]>_[_0x3a8e('0x5e')](_0x4ddd46['loggedin'])?_[_0x3a8e('0x5e')](_0x4ddd46[_0x3a8e('0x5f')]):this['voiceQueues'][_0x4ddd46[_0x3a8e('0x5b')]]['talking'];this[_0x3a8e('0x61')](this['voiceQueues'][_0x4ddd46['queue']]);}ami[_0x3a8e('0x41')](_0x3a8e('0x62'),this['voiceQueues'][_0x4ddd46[_0x3a8e('0x5b')]]);}}}catch(_0x1099b2){logger[_0x3a8e('0x3a')]('[syncQueueSummary][VoiceQueueReport]',util[_0x3a8e('0x40')](_0x1099b2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3a8e('0xa')][_0x3a8e('0x15')]=function(_0x54d432){this[_0x3a8e('0xf')]=!![];};VoiceQueueReport[_0x3a8e('0xa')][_0x3a8e('0x63')]=function(_0x39777a){};VoiceQueueReport[_0x3a8e('0xa')][_0x3a8e('0x17')]=function(_0x3eb5c8){try{if(this[_0x3a8e('0x56')](_0x3eb5c8)){if(_['isUndefined'](this[_0x3a8e('0x64')][_0x3eb5c8['uniqueid']])){this['queueReports'][_0x3eb5c8[_0x3a8e('0x65')]]=[];this['channels'][_0x3eb5c8[_0x3a8e('0x65')]]={};}var _0x6b7f9f=new QueueReport();_0x6b7f9f[_0x3a8e('0x45')]=_0x3eb5c8[_0x3a8e('0x5b')];_0x6b7f9f[_0x3a8e('0x48')]=this['voiceQueues'][_0x6b7f9f[_0x3a8e('0x45')]]&&this[_0x3a8e('0xe')][_0x6b7f9f[_0x3a8e('0x45')]][_0x3a8e('0x48')]?this[_0x3a8e('0xe')][_0x6b7f9f[_0x3a8e('0x45')]][_0x3a8e('0x48')]||_0x3a8e('0x49'):_0x3a8e('0x49');_0x6b7f9f['queue']=_0x3eb5c8[_0x3a8e('0x5b')];_0x6b7f9f[_0x3a8e('0x66')]=moment()[_0x3a8e('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x6b7f9f['position']=_0x3eb5c8[_0x3a8e('0x67')];_0x6b7f9f[_0x3a8e('0x68')]=_0x3eb5c8['count'];_[_0x3a8e('0x69')](_0x6b7f9f,_['pick'](_0x3eb5c8,_['keys'](_0x6b7f9f)));this[_0x3a8e('0x64')][_0x3eb5c8['uniqueid']]['push'](_0x6b7f9f);this['channels'][_0x3eb5c8['uniqueid']]=_0x6b7f9f;this[_0x3a8e('0x42')](_0x6b7f9f);}}catch(_0x5dd811){logger[_0x3a8e('0x3a')](_0x3a8e('0x6a'),util[_0x3a8e('0x40')](_0x5dd811,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3a8e('0xa')]['syncQueueCallerAbandon']=function(_0x311b1d){try{if(this[_0x3a8e('0x56')](_0x311b1d)){if(this[_0x3a8e('0x64')][_0x311b1d[_0x3a8e('0x65')]]){var _0x3339ad=_[_0x3a8e('0x6b')](this[_0x3a8e('0x64')][_0x311b1d[_0x3a8e('0x65')]]);_0x3339ad[_0x3a8e('0x6c')]=![];_0x3339ad[_0x3a8e('0x6d')]=null;_0x3339ad[_0x3a8e('0x6e')]=_0x311b1d[_0x3a8e('0x6e')];_0x3339ad[_0x3a8e('0x6f')]=_0x311b1d[_0x3a8e('0x6f')];_0x3339ad[_0x3a8e('0x18')]=!![];_0x3339ad[_0x3a8e('0x70')]=moment()['format'](_0x3a8e('0x71'));_0x3339ad['queuecallerexitreason']=_0x3a8e('0x72');_0x3339ad[_0x3a8e('0x73')]=null;this[_0x3a8e('0x34')][_0x311b1d[_0x3a8e('0x65')]]=_0x3339ad;this[_0x3a8e('0x3f')](_0x3339ad);}}}catch(_0xf1680d){logger['error']('[syncQueueCallerAbandon][VoiceQueueReport]',util[_0x3a8e('0x40')](_0xf1680d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3a8e('0xa')][_0x3a8e('0x1b')]=function(_0x1f867a){try{if(this[_0x3a8e('0x56')](_0x1f867a)){if(this[_0x3a8e('0x64')][_0x1f867a[_0x3a8e('0x65')]]){var _0x46a15d=_[_0x3a8e('0x6b')](this['queueReports'][_0x1f867a[_0x3a8e('0x65')]]);_0x46a15d[_0x3a8e('0x74')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x46a15d[_0x3a8e('0x75')]=_0x1f867a[_0x3a8e('0x75')];_0x46a15d[_0x3a8e('0x76')]=_0x1f867a[_0x3a8e('0x76')];this[_0x3a8e('0x34')][_0x1f867a['uniqueid']]=_0x46a15d;this[_0x3a8e('0x42')](_0x46a15d);}}}catch(_0x5aef4b){logger['error'](_0x3a8e('0x77'),util[_0x3a8e('0x40')](_0x5aef4b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3a8e('0xa')]['syncAgentConnect']=function(_0x34a720){try{if(this[_0x3a8e('0x56')](_0x34a720)){if(this[_0x3a8e('0x64')][_0x34a720[_0x3a8e('0x65')]]){var _0x1b3b94=_['last'](this['queueReports'][_0x34a720[_0x3a8e('0x65')]]);_0x1b3b94[_0x3a8e('0x6c')]=!![];_0x1b3b94['queuecallerexitreason']=_0x3a8e('0x78');}}}catch(_0x43363d){logger[_0x3a8e('0x3a')]('[syncAgentConnect][VoiceQueueReport]',util['inspect'](_0x43363d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3a8e('0xa')][_0x3a8e('0x1d')]=function(_0x1ee70){try{if(this['isNotNull'](_0x1ee70)){if(this['queueReports'][_0x1ee70[_0x3a8e('0x65')]]){var _0x2cc7fb=_[_0x3a8e('0x6b')](this[_0x3a8e('0x64')][_0x1ee70[_0x3a8e('0x65')]]);_0x2cc7fb[_0x3a8e('0x18')]=![];_0x2cc7fb[_0x3a8e('0x70')]=null;_0x2cc7fb[_0x3a8e('0x79')]=!![];_0x2cc7fb[_0x3a8e('0x73')]=_0x1ee70[_0x3a8e('0x7a')];_0x2cc7fb['holdtime']=_0x1ee70[_0x3a8e('0x6e')];_0x2cc7fb[_0x3a8e('0x6c')]=!![];_0x2cc7fb[_0x3a8e('0x7b')]=![];_0x2cc7fb['queuecallerexitAt']=null;if(!_0x2cc7fb['transfer']){if(_0x1ee70['reason']==_0x3a8e('0x7c')){_0x2cc7fb[_0x3a8e('0x7d')]=_0x3a8e('0x7e');}else{if(_[_0x3a8e('0x7f')](_0x1ee70[_0x3a8e('0x80')][_0x3a8e('0x81')](),_0x3a8e('0x82'))){if(this[_0x3a8e('0x64')][_0x1ee70['linkedid']]){var _0x4ce3d4=_[_0x3a8e('0x6b')](this['queueReports'][_0x1ee70[_0x3a8e('0x83')]]);_0x4ce3d4['queuecallercomplete']=![];_0x4ce3d4[_0x3a8e('0x7b')]=!![];_0x4ce3d4[_0x3a8e('0x84')]=moment(_0x2cc7fb[_0x3a8e('0x66')])[_0x3a8e('0x85')](_0x1ee70[_0x3a8e('0x6e')],_0x3a8e('0x86'))[_0x3a8e('0x43')](_0x3a8e('0x71'));_0x4ce3d4['queuecallerexitreason']=_0x3a8e('0x87');_0x4ce3d4['transfer']=!![];_0x4ce3d4['transfertype']='FORWARD';_0x4ce3d4[_0x3a8e('0x88')]=_0x1ee70[_0x3a8e('0x89')];_0x4ce3d4[_0x3a8e('0x8a')]=_0x1ee70['uniqueid'];var _0x12de43=this[_0x3a8e('0x64')][_0x1ee70['linkedid']];this[_0x3a8e('0x64')][_0x1ee70[_0x3a8e('0x83')]]=this[_0x3a8e('0x64')][_0x1ee70[_0x3a8e('0x65')]];this[_0x3a8e('0x64')][_0x1ee70[_0x3a8e('0x65')]]=_0x12de43;}}else{_0x2cc7fb[_0x3a8e('0x7d')]=_0x3a8e('0x8b')+_0x1ee70[_0x3a8e('0x8c')][_0x3a8e('0x8d')]();}}}this[_0x3a8e('0x34')][_0x1ee70['uniqueid']]=_0x2cc7fb;this[_0x3a8e('0x3f')](_0x2cc7fb);}}}catch(_0x17bfc7){logger[_0x3a8e('0x3a')](_0x3a8e('0x8e'),util[_0x3a8e('0x40')](_0x17bfc7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3a8e('0xa')][_0x3a8e('0x21')]=function(_0x2d5ab4){try{if(this['isNotNull'](_0x2d5ab4)){this[_0x3a8e('0x8f')](_0x2d5ab4[_0x3a8e('0x65')],_[_0x3a8e('0x90')](_0x2d5ab4['variable'])[0x0],_0x2d5ab4[_0x3a8e('0x91')]);if(this['queueReports'][_0x2d5ab4[_0x3a8e('0x65')]]){var _0x3204ca=_['last'](this[_0x3a8e('0x64')][_0x2d5ab4['uniqueid']]);if(_0x3204ca){if(this[_0x3a8e('0x56')](_0x2d5ab4['variable'])&&this[_0x3a8e('0x56')](_0x2d5ab4['variable'][_0x3a8e('0x92')])){switch(_0x2d5ab4[_0x3a8e('0x91')]){case'CONTINUE':_0x3204ca[_0x3a8e('0x7b')]=![];_0x3204ca[_0x3a8e('0x84')]=null;break;default:_0x3204ca[_0x3a8e('0x7b')]=!![];_0x3204ca[_0x3a8e('0x84')]=moment()[_0x3a8e('0x43')](_0x3a8e('0x71'));_0x3204ca['queuecallerleaveAt']=moment()['format'](_0x3a8e('0x71'));}_0x3204ca[_0x3a8e('0x18')]=![];_0x3204ca[_0x3a8e('0x70')]=null;_0x3204ca[_0x3a8e('0x7d')]=_0x2d5ab4['value'];this[_0x3a8e('0x34')][_0x2d5ab4[_0x3a8e('0x65')]]=_0x3204ca;this['emitVoiceQueueChannelRemove'](_0x3204ca);}else if(this['isNotNull'](_0x2d5ab4[_0x3a8e('0x93')])&&this[_0x3a8e('0x56')](_0x2d5ab4[_0x3a8e('0x93')]['queueposition'])){if(!_0x3204ca[_0x3a8e('0x18')]){_0x3204ca[_0x3a8e('0x7b')]=!![];_0x3204ca[_0x3a8e('0x84')]=moment()[_0x3a8e('0x43')](_0x3a8e('0x71'));_0x3204ca[_0x3a8e('0x7d')]=_0x3a8e('0x94');_0x3204ca[_0x3a8e('0x74')]=moment()[_0x3a8e('0x43')](_0x3a8e('0x71'));this[_0x3a8e('0x34')][_0x2d5ab4[_0x3a8e('0x65')]]=_0x3204ca;}}_0x3204ca[_0x3a8e('0x11')]=this[_0x3a8e('0x11')][_0x2d5ab4[_0x3a8e('0x65')]];}}}}catch(_0x57ee67){logger[_0x3a8e('0x3a')](_0x3a8e('0x95'),util[_0x3a8e('0x40')](_0x57ee67,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3a8e('0xa')][_0x3a8e('0x8f')]=function(_0x42c70f,_0xd3fbdd,_0x3d07d9){var _0x37adb3=[_0x3a8e('0x96'),_0x3a8e('0x97'),'rtpaudioqosjitter',_0x3a8e('0x98'),'rtpaudioqosloss',_0x3a8e('0x99'),_0x3a8e('0x9a'),_0x3a8e('0x9b'),_0x3a8e('0x9c'),'sipuri',_0x3a8e('0x9d'),'bridgepvtcallid',_0x3a8e('0x9e'),_0x3a8e('0x9f'),_0x3a8e('0xa0'),_0x3a8e('0xa1'),_0x3a8e('0x7a'),'memberpenalty',_0x3a8e('0xa2')];if(!_[_0x3a8e('0xa3')](_0xd3fbdd)&&!_[_0x3a8e('0xa4')](_0x37adb3,_0xd3fbdd)){if(_[_0x3a8e('0x2b')](this[_0x3a8e('0x11')][_0x42c70f])){this[_0x3a8e('0x11')][_0x42c70f]={};}this[_0x3a8e('0x11')][_0x42c70f][_0xd3fbdd]=_0x3d07d9;}};VoiceQueueReport[_0x3a8e('0xa')][_0x3a8e('0xa5')]=function(_0x34387d){try{if(this['isNotNull'](_0x34387d)){if(this[_0x3a8e('0x64')][_0x34387d[_0x3a8e('0x65')]]){for(var _0x27e365=0x0,_0x49ae31={};_0x27e365=0x0?moment(_0x185f1e['endtime'])[_0x6d21('0x16')](_0x185f1e[_0x6d21('0x14')],_0x6d21('0xc')):null,'data1':'outbound','data2':_0x185f1e['accountcode'],'data3':_0x185f1e[_0x6d21('0x17')],'data4':_0x185f1e['dialstring']||null,'role':_0x6d21('0x10'),'internal':_0x185f1e[_0x6d21('0x11')]?_['toNumber'](_0x185f1e[_0x6d21('0x11')]):undefined,'uniqueid':_0x185f1e[_0x6d21('0x12')]},'log':_0x6d21('0x5')});}; \ No newline at end of file +var _0xd437=['util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','format','SIP/%s','interface','TALKING','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','agent','toNumber','accountcode','uniqueid','voiceDialReport','membername','starttime','endtime','outbound','dialstring','moment','lodash'];(function(_0x5d79e6,_0x3f96eb){var _0x551ab7=function(_0x216ea6){while(--_0x216ea6){_0x5d79e6['push'](_0x5d79e6['shift']());}};_0x551ab7(++_0x3f96eb);}(_0xd437,0x1ee));var _0x7d43=function(_0x261522,_0x1adc1f){_0x261522=_0x261522-0x0;var _0x98a25a=_0xd437[_0x261522];return _0x98a25a;};'use strict';var moment=require(_0x7d43('0x0'));var _=require(_0x7d43('0x1'));var util=require(_0x7d43('0x2'));var client=require(_0x7d43('0x3'));exports[_0x7d43('0x4')]=function(_0xfebbb9){var _0x4f10d0=_0xfebbb9[_0x7d43('0x5')]||_0xfebbb9[_0x7d43('0x6')];return client[_0x7d43('0x7')](_0x7d43('0x8'),{'body':{'channel':_0x7d43('0x9'),'membername':_0xfebbb9['lastAssignedTo'],'interface':_['isNil'](_0xfebbb9['interface'])?util[_0x7d43('0xa')](_0x7d43('0xb'),_0xfebbb9['lastAssignedTo']):_0xfebbb9[_0x7d43('0xc')],'type':_0x7d43('0xd'),'enterAt':_0xfebbb9['queuecallerleaveAt'],'exitAt':_0x4f10d0,'duration':moment(_0x4f10d0)[_0x7d43('0xe')](_0xfebbb9[_0x7d43('0xf')],_0x7d43('0x10')),'data1':_0x7d43('0x11'),'data2':_0xfebbb9[_0x7d43('0x12')],'data3':_0xfebbb9[_0x7d43('0x13')],'data4':null,'data5':_0xfebbb9[_0x7d43('0x14')],'role':_0x7d43('0x15'),'internal':_0xfebbb9['accountcode']?_[_0x7d43('0x16')](_0xfebbb9[_0x7d43('0x17')]):undefined,'uniqueid':_0xfebbb9[_0x7d43('0x18')]},'log':'CreateMemberReport'});};exports[_0x7d43('0x19')]=function(_0x3414ea){return client['Request'](_0x7d43('0x8'),{'body':{'channel':_0x7d43('0x9'),'membername':_0x3414ea[_0x7d43('0x1a')],'interface':_0x3414ea[_0x7d43('0xc')],'type':_0x7d43('0xd'),'enterAt':_0x3414ea[_0x7d43('0x1b')],'exitAt':_0x3414ea[_0x7d43('0x1c')],'duration':moment(_0x3414ea[_0x7d43('0x1c')])[_0x7d43('0xe')](_0x3414ea['starttime'],'seconds')>=0x0?moment(_0x3414ea[_0x7d43('0x1c')])[_0x7d43('0xe')](_0x3414ea[_0x7d43('0x1b')],_0x7d43('0x10')):null,'data1':_0x7d43('0x1d'),'data2':_0x3414ea['accountcode'],'data3':_0x3414ea[_0x7d43('0x13')],'data4':_0x3414ea[_0x7d43('0x1e')]||null,'role':_0x7d43('0x15'),'internal':_0x3414ea[_0x7d43('0x17')]?_[_0x7d43('0x16')](_0x3414ea[_0x7d43('0x17')]):undefined,'uniqueid':_0x3414ea[_0x7d43('0x18')]},'log':_0x7d43('0x8')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 6eda5de..473cbb6 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 _0xd87e=['GetTemplate','html','../client','getTemplates','Request'];(function(_0x1578b2,_0x1cfd9d){var _0x2bcb56=function(_0x226ba9){while(--_0x226ba9){_0x1578b2['push'](_0x1578b2['shift']());}};_0x2bcb56(++_0x1cfd9d);}(_0xd87e,0x1bf));var _0xed87=function(_0x2b68a0,_0x31dd39){_0x2b68a0=_0x2b68a0-0x0;var _0x3da45d=_0xd87e[_0x2b68a0];return _0x3da45d;};'use strict';var client=require(_0xed87('0x0'));exports[_0xed87('0x1')]=function(_0x4a7ab7){return function(_0x334485){return client[_0xed87('0x2')](_0xed87('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0xed87('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x1752=['name','getTemplates','Request','GetTemplate'];(function(_0x296897,_0x4d23ea){var _0x2b44ab=function(_0xdf90d8){while(--_0xdf90d8){_0x296897['push'](_0x296897['shift']());}};_0x2b44ab(++_0x4d23ea);}(_0x1752,0xa5));var _0x2175=function(_0x47ab0f,_0x3c25f5){_0x47ab0f=_0x47ab0f-0x0;var _0x4b33cd=_0x1752[_0x47ab0f];return _0x4b33cd;};'use strict';var client=require('../client');exports[_0x2175('0x0')]=function(_0x1fc292){return function(_0x22d3a7){return client[_0x2175('0x1')](_0x2175('0x2'),{'options':{'raw':!![],'attributes':['id',_0x2175('0x3'),'html']},'log':_0x2175('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 22396bd..2991fe9 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 _0x4147=['GetTrigger','name','Condition','AllConditions','field','operator','AnyConditions','value','Actions','action','data1','data2','data6','data7','../client','getTriggers','Request'];(function(_0x3f90ba,_0xb5670b){var _0x34525d=function(_0x19e7bc){while(--_0x19e7bc){_0x3f90ba['push'](_0x3f90ba['shift']());}};_0x34525d(++_0xb5670b);}(_0x4147,0x85));var _0x7414=function(_0x3231da,_0x3ae101){_0x3231da=_0x3231da-0x0;var _0x256829=_0x4147[_0x3231da];return _0x256829;};'use strict';var client=require(_0x7414('0x0'));exports[_0x7414('0x1')]=function(_0x6d69fb){return function(_0x4723ed){return client[_0x7414('0x2')](_0x7414('0x3'),{'options':{'raw':![],'attributes':['id',_0x7414('0x4'),'channel','status'],'include':[{'model':_0x7414('0x5'),'as':_0x7414('0x6'),'attributes':['id',_0x7414('0x7'),_0x7414('0x8'),'value']},{'model':_0x7414('0x5'),'as':_0x7414('0x9'),'attributes':['id','field','operator',_0x7414('0xa')]},{'model':'Action','as':_0x7414('0xb'),'attributes':['id',_0x7414('0xc'),_0x7414('0xd'),_0x7414('0xe'),'data3','data4','data5',_0x7414('0xf'),_0x7414('0x10')]}]},'log':_0x7414('0x3')});};}; \ No newline at end of file +var _0x79a9=['AllConditions','field','operator','value','Action','Actions','action','data1','data2','data3','data6','../client','getTriggers','Request','name','channel','status','Condition'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x79a9,0x12b));var _0x979a=function(_0xe7c36a,_0x641105){_0xe7c36a=_0xe7c36a-0x0;var _0x8b1186=_0x79a9[_0xe7c36a];return _0x8b1186;};'use strict';var client=require(_0x979a('0x0'));exports[_0x979a('0x1')]=function(_0x48f005){return function(_0x5ec26c){return client[_0x979a('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x979a('0x3'),_0x979a('0x4'),_0x979a('0x5')],'include':[{'model':_0x979a('0x6'),'as':_0x979a('0x7'),'attributes':['id',_0x979a('0x8'),_0x979a('0x9'),_0x979a('0xa')]},{'model':_0x979a('0x6'),'as':'AnyConditions','attributes':['id',_0x979a('0x8'),'operator',_0x979a('0xa')]},{'model':_0x979a('0xb'),'as':_0x979a('0xc'),'attributes':['id',_0x979a('0xd'),_0x979a('0xe'),_0x979a('0xf'),_0x979a('0x10'),'data4','data5',_0x979a('0x11'),'data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 9e9ea47..d5d7fd6 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 _0x2ed1=['Request','GetTrunk','name','registry','getTrunks'];(function(_0x36edf2,_0x29ebd2){var _0x2825bf=function(_0x20235a){while(--_0x20235a){_0x36edf2['push'](_0x36edf2['shift']());}};_0x2825bf(++_0x29ebd2);}(_0x2ed1,0x9a));var _0x12ed=function(_0x127d4f,_0x4a51b2){_0x127d4f=_0x127d4f-0x0;var _0x13e510=_0x2ed1[_0x127d4f];return _0x13e510;};'use strict';var client=require('../client');exports[_0x12ed('0x0')]=function(_0x4daec8){return function(_0x4b174a){return client[_0x12ed('0x1')](_0x12ed('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x12ed('0x3'),_0x12ed('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xbf13=['getTrunks','Request','GetTrunk','name','registry','../client'];(function(_0x58d2c2,_0xa8582d){var _0x20db23=function(_0x13ec56){while(--_0x13ec56){_0x58d2c2['push'](_0x58d2c2['shift']());}};_0x20db23(++_0xa8582d);}(_0xbf13,0x8f));var _0x3bf1=function(_0x158876,_0x1d8a8c){_0x158876=_0x158876-0x0;var _0x176690=_0xbf13[_0x158876];return _0x176690;};'use strict';var client=require(_0x3bf1('0x0'));exports[_0x3bf1('0x1')]=function(_0x3766a8){return function(_0x4905a6){return client[_0x3bf1('0x2')](_0x3bf1('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x3bf1('0x4'),_0x3bf1('0x5')]},'log':_0x3bf1('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 9e47140..be85b09 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 _0x1f70=['online','pauseType','voicePause','phone','interface','getTelephones','telephone','accountcode','internal','savePause','Request','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','lastLoginAt','../client','getAgents','agent','name','email','fullname'];(function(_0x3603bc,_0x37de2a){var _0x173587=function(_0x129834){while(--_0x129834){_0x3603bc['push'](_0x3603bc['shift']());}};_0x173587(++_0x37de2a);}(_0x1f70,0x84));var _0x01f7=function(_0x1b4b64,_0x57de56){_0x1b4b64=_0x1b4b64-0x0;var _0x52a18b=_0x1f70[_0x1b4b64];return _0x52a18b;};'use strict';var client=require(_0x01f7('0x0'));exports[_0x01f7('0x1')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':![],'where':{'role':_0x01f7('0x2')},'attributes':['id',_0x01f7('0x3'),_0x01f7('0x4'),'accountcode',_0x01f7('0x5'),_0x01f7('0x6'),'lastLoginAt',_0x01f7('0x7'),'lastPauseAt',_0x01f7('0x8'),_0x01f7('0x9'),'mobile',_0x01f7('0xa')]},'log':_0x01f7('0x1')});};};exports[_0x01f7('0xb')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x01f7('0xc')},'attributes':['id',_0x01f7('0x3'),_0x01f7('0xd'),_0x01f7('0xe')]},'log':_0x01f7('0xb')});};};exports[_0x01f7('0xf')]=function(_0x2328e1,_0x14818d,_0x446f9c){return client[_0x01f7('0x10')](_0x01f7('0x11'),{'body':{'type':_0x14818d,'uniqueid':_0x446f9c},'options':{'where':{'id':_0x2328e1['id']}},'log':_0x01f7('0xf')});};exports[_0x01f7('0x12')]=function(_0x2b5842){return client['Request'](_0x01f7('0x13'),{'body':{},'options':{'where':{'id':_0x2b5842['id']}},'log':_0x01f7('0xf')});};exports[_0x01f7('0x14')]=function(_0x410483){return client[_0x01f7('0x10')](_0x01f7('0x15'),{'options':{'raw':![],'where':{'role':_0x01f7('0x2'),'id':_0x410483},'attributes':['id',_0x01f7('0x3'),_0x01f7('0x4'),'accountcode','fullname',_0x01f7('0x6'),_0x01f7('0x16'),_0x01f7('0x7'),'lastPauseAt',_0x01f7('0x8'),_0x01f7('0xa')]},'log':'getAgent'});}; \ No newline at end of file +var _0x26dd=['online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','getTelephones','internal','savePause','UnpauseUser','getAgent','ShowUser','fullname','interface','../client','getAgents','Request','GetUser','agent','name','accountcode'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x26dd,0x16f));var _0xd26d=function(_0x6b3125,_0x2191e2){_0x6b3125=_0x6b3125-0x0;var _0x23a29b=_0x26dd[_0x6b3125];return _0x23a29b;};'use strict';var client=require(_0xd26d('0x0'));exports[_0xd26d('0x1')]=function(){return function(){return client[_0xd26d('0x2')](_0xd26d('0x3'),{'options':{'raw':![],'where':{'role':_0xd26d('0x4')},'attributes':['id',_0xd26d('0x5'),'email',_0xd26d('0x6'),'fullname',_0xd26d('0x7'),_0xd26d('0x8'),_0xd26d('0x9'),_0xd26d('0xa'),_0xd26d('0xb'),_0xd26d('0xc'),_0xd26d('0xd'),'interface']},'log':'getAgents'});};};exports[_0xd26d('0xe')]=function(){return function(){return client[_0xd26d('0x2')](_0xd26d('0x3'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0xd26d('0x5'),_0xd26d('0x6'),_0xd26d('0xf')]},'log':_0xd26d('0xe')});};};exports[_0xd26d('0x10')]=function(_0x53171f,_0x8f9e70,_0xbd6fe4){return client[_0xd26d('0x2')]('PauseUser',{'body':{'type':_0x8f9e70,'uniqueid':_0xbd6fe4},'options':{'where':{'id':_0x53171f['id']}},'log':_0xd26d('0x10')});};exports['saveUnpause']=function(_0x26545e){return client[_0xd26d('0x2')](_0xd26d('0x11'),{'body':{},'options':{'where':{'id':_0x26545e['id']}},'log':_0xd26d('0x10')});};exports[_0xd26d('0x12')]=function(_0x29d998){return client[_0xd26d('0x2')](_0xd26d('0x13'),{'options':{'raw':![],'where':{'role':_0xd26d('0x4'),'id':_0x29d998},'attributes':['id',_0xd26d('0x5'),'email',_0xd26d('0x6'),_0xd26d('0x14'),_0xd26d('0x7'),_0xd26d('0x8'),_0xd26d('0x9'),'lastPauseAt','voicePause',_0xd26d('0x15')]},'log':_0xd26d('0x12')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 2ea80b9..c39e791 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 _0x451a=['update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x246f22,_0x9e573b){var _0x40c307=function(_0x1d2337){while(--_0x1d2337){_0x246f22['push'](_0x246f22['shift']());}};_0x40c307(++_0x9e573b);}(_0x451a,0x1d3));var _0xa451=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x451a[_0x1589dd];return _0x1bddd1;};'use strict';var client=require(_0xa451('0x0'));exports[_0xa451('0x1')]=function(_0x5c758f){return client[_0xa451('0x2')]('CreateVoiceAgentReport',{'body':_0x5c758f,'log':'CreateVoiceAgentReport'});};exports[_0xa451('0x3')]=function(_0x5599f0,_0x49a65a,_0x135bba){return client[_0xa451('0x2')]('UpdateVoiceAgentReport',{'body':_0x5599f0,'options':{'where':{'uniqueid':_0x49a65a,'interface':_0x135bba}},'log':_0xa451('0x4')});}; \ No newline at end of file +var _0x80e9=['create','CreateVoiceAgentReport','Request','UpdateVoiceAgentReport','../client'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x80e9,0x72));var _0x980e=function(_0x3e0799,_0x19d736){_0x3e0799=_0x3e0799-0x0;var _0x3c2954=_0x80e9[_0x3e0799];return _0x3c2954;};'use strict';var client=require(_0x980e('0x0'));exports[_0x980e('0x1')]=function(_0xa471ed){return client['Request'](_0x980e('0x2'),{'body':_0xa471ed,'log':_0x980e('0x2')});};exports['update']=function(_0x5670ff,_0xa115f8,_0x5c7cd8){return client[_0x980e('0x3')](_0x980e('0x4'),{'body':_0x5670ff,'options':{'where':{'uniqueid':_0xa115f8,'interface':_0x5c7cd8}},'log':_0x980e('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index c6395d3..bc7f70a 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 _0xd9be=['type','duration','GetVoiceCallReports','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day'];(function(_0x5af59e,_0x3771c1){var _0x4240df=function(_0x2267fd){while(--_0x2267fd){_0x5af59e['push'](_0x5af59e['shift']());}};_0x4240df(++_0x3771c1);}(_0xd9be,0xf3));var _0xed9b=function(_0x212bb1,_0x56bdea){_0x212bb1=_0x212bb1-0x0;var _0x21c5c2=_0xd9be[_0x212bb1];return _0x21c5c2;};'use strict';var moment=require('moment');var util=require(_0xed9b('0x0'));var _=require(_0xed9b('0x1'));var client=require(_0xed9b('0x2'));exports[_0xed9b('0x3')]=function(_0x50b994){return client[_0xed9b('0x4')](_0xed9b('0x5'),{'body':_[_0xed9b('0x6')](_0x50b994,{'source':_0x50b994[_0xed9b('0x7')],'destinationcontext':_0x50b994[_0xed9b('0x8')],'callerid':_0x50b994[_0xed9b('0x9')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0xed9b('0xa')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0xed9b('0xb')],'createdAt':{'$between':[moment()[_0xed9b('0xc')]('day')[_0xed9b('0xd')](_0xed9b('0xe')),moment()[_0xed9b('0xf')](_0xed9b('0x10'))[_0xed9b('0xd')](_0xed9b('0xe'))]}},'attributes':[_0xed9b('0x11'),'disposition',_0xed9b('0x12'),'billableseconds']},'log':_0xed9b('0x13')});};}; \ No newline at end of file +var _0xf64f=['billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xf64f,0xc2));var _0xff64=function(_0x1c98e4,_0x2f8b0c){_0x1c98e4=_0x1c98e4-0x0;var _0x150655=_0xf64f[_0x1c98e4];return _0x150655;};'use strict';var moment=require(_0xff64('0x0'));var util=require(_0xff64('0x1'));var _=require(_0xff64('0x2'));var client=require(_0xff64('0x3'));exports[_0xff64('0x4')]=function(_0x19eb04){return client[_0xff64('0x5')](_0xff64('0x6'),{'body':_[_0xff64('0x7')](_0x19eb04,{'source':_0x19eb04[_0xff64('0x8')],'destinationcontext':_0x19eb04[_0xff64('0x9')],'callerid':_0x19eb04['callerid'],'amaflags':_0xff64('0xa')}),'log':_0xff64('0x6')});};exports[_0xff64('0xb')]=function(){return function(){return client[_0xff64('0x5')](_0xff64('0xc'),{'options':{'where':{'type':[_0xff64('0xd')],'createdAt':{'$between':[moment()[_0xff64('0xe')](_0xff64('0xf'))[_0xff64('0x10')](_0xff64('0x11')),moment()[_0xff64('0x12')](_0xff64('0xf'))['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xff64('0x13'),_0xff64('0x14'),_0xff64('0x15'),_0xff64('0x16')]},'log':_0xff64('0x17')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 1188931..99382fa 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 _0xb946=['../client','create','Request','CreateVoiceDialReport'];(function(_0x2e970d,_0x33eda4){var _0x1177e7=function(_0x2c559d){while(--_0x2c559d){_0x2e970d['push'](_0x2e970d['shift']());}};_0x1177e7(++_0x33eda4);}(_0xb946,0x80));var _0x6b94=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xb946[_0x33032e];return _0x13316b;};'use strict';var client=require(_0x6b94('0x0'));exports[_0x6b94('0x1')]=function(_0x3e4949){return client[_0x6b94('0x2')]('CreateVoiceDialReport',{'body':_0x3e4949,'log':_0x6b94('0x3')});}; \ No newline at end of file +var _0x05d4=['Request','CreateVoiceDialReport','create'];(function(_0x3448de,_0x23b71b){var _0x151791=function(_0x19c0af){while(--_0x19c0af){_0x3448de['push'](_0x3448de['shift']());}};_0x151791(++_0x23b71b);}(_0x05d4,0x146));var _0x405d=function(_0x10170b,_0x67f13c){_0x10170b=_0x10170b-0x0;var _0x13b147=_0x05d4[_0x10170b];return _0x13b147;};'use strict';var client=require('../client');exports[_0x405d('0x0')]=function(_0x1ea6aa){return client[_0x405d('0x1')](_0x405d('0x2'),{'body':_0x1ea6aa,'log':_0x405d('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index f781078..42fd715 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 _0xb264=['../client','getVoiceExtensions','GetVoiceExtension'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb264,0x108));var _0x4b26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb264[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x4b26('0x0'));exports[_0x4b26('0x1')]=function(){return function(){return client['Request'](_0x4b26('0x2'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x4b26('0x1')});};}; \ No newline at end of file +var _0x0268=['recordingFormat','getVoiceExtensions','../client','Request','GetVoiceExtension'];(function(_0x5866c7,_0xf581c1){var _0x551da6=function(_0x5e94d9){while(--_0x5e94d9){_0x5866c7['push'](_0x5866c7['shift']());}};_0x551da6(++_0xf581c1);}(_0x0268,0x17e));var _0x8026=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x0268[_0x110c3d];return _0x226d67;};'use strict';var client=require(_0x8026('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x8026('0x1')](_0x8026('0x2'),{'options':{'raw':!![],'attributes':['id','exten',_0x8026('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x8026('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 5f6d30c..61a50ab 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 _0x5724=['dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval','getVoiceQueues','../client','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type'];(function(_0x376456,_0x4d5870){var _0x18c90f=function(_0x545934){while(--_0x545934){_0x376456['push'](_0x376456['shift']());}};_0x18c90f(++_0x4d5870);}(_0x5724,0x14f));var _0x4572=function(_0x3483df,_0x4dc4af){_0x3483df=_0x3483df-0x0;var _0x573b0b=_0x5724[_0x3483df];return _0x573b0b;};'use strict';var client=require(_0x4572('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x4572('0x1'),{'options':{'raw':![],'attributes':['id',_0x4572('0x2'),_0x4572('0x3'),_0x4572('0x4'),_0x4572('0x5'),_0x4572('0x6'),_0x4572('0x7'),_0x4572('0x8'),_0x4572('0x9'),_0x4572('0xa'),_0x4572('0xb'),'dialPowerLevel',_0x4572('0xc'),_0x4572('0xd'),_0x4572('0xe'),_0x4572('0xf'),_0x4572('0x10'),_0x4572('0x11'),_0x4572('0x12'),'dialQueueTimeout',_0x4572('0x13'),_0x4572('0x14'),'dialCongestionRetryFrequency',_0x4572('0x15'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone',_0x4572('0x16'),_0x4572('0x17'),'dialCheckDuplicateType',_0x4572('0x18'),_0x4572('0x19'),_0x4572('0x1a'),_0x4572('0x1b'),_0x4572('0x1c'),_0x4572('0x1d'),_0x4572('0x1e'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x4572('0x1f'),'timeout','dialRecallMeTimeout','dialRecallInQueue',_0x4572('0x20'),'dialAgiAfterHangupAgent',_0x4572('0x21'),_0x4572('0x22'),_0x4572('0x6'),_0x4572('0x23'),_0x4572('0x24'),'dialCutDigit',_0x4572('0x25'),_0x4572('0x26'),_0x4572('0x27')],'include':[{'model':'Trunk','as':_0x4572('0x28'),'attributes':['id',_0x4572('0x2'),_0x4572('0x29'),_0x4572('0x2a')]},{'model':_0x4572('0x2b'),'as':_0x4572('0x2c'),'attributes':['id',_0x4572('0x2')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0x4572('0x2'),_0x4572('0x29'),_0x4572('0x2a')]},{'model':_0x4572('0x2d'),'as':_0x4572('0x2d'),'attributes':['id','name'],'include':[{'model':_0x4572('0x2d'),'as':_0x4572('0x2e'),'attributes':['id',_0x4572('0x2'),_0x4572('0x2f')]}]}]},'log':_0x4572('0x30')});};}; \ No newline at end of file +var _0x77a4=['TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','type','dialActive','dialMethod','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','name','callerid','active','Pause','mandatoryDispositionPause'];(function(_0x3e13ed,_0x292f81){var _0x469db5=function(_0x367a50){while(--_0x367a50){_0x3e13ed['push'](_0x3e13ed['shift']());}};_0x469db5(++_0x292f81);}(_0x77a4,0xec));var _0x477a=function(_0x2998db,_0x3424f1){_0x2998db=_0x2998db-0x0;var _0x115fea=_0x77a4[_0x2998db];return _0x115fea;};'use strict';var client=require(_0x477a('0x0'));exports[_0x477a('0x1')]=function(){return function(){return client[_0x477a('0x2')](_0x477a('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x477a('0x4'),_0x477a('0x5'),'autopause','monitor_format',_0x477a('0x6'),_0x477a('0x7'),_0x477a('0x8'),'dialLimitChannel',_0x477a('0x9'),'dialPowerLevel',_0x477a('0xa'),_0x477a('0xb'),_0x477a('0xc'),'dialOriginateCallerIdName',_0x477a('0xd'),_0x477a('0xe'),_0x477a('0xf'),_0x477a('0x10'),_0x477a('0x11'),_0x477a('0x12'),_0x477a('0x13'),_0x477a('0x14'),_0x477a('0x15'),_0x477a('0x16'),_0x477a('0x17'),_0x477a('0x18'),_0x477a('0x19'),_0x477a('0x1a'),_0x477a('0x1b'),'dialCheckDuplicateType',_0x477a('0x1c'),_0x477a('0x1d'),_0x477a('0x1e'),_0x477a('0x1f'),_0x477a('0x20'),_0x477a('0x21'),_0x477a('0x22'),_0x477a('0x23'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength',_0x477a('0x24'),'dialRecallMeTimeout',_0x477a('0x25'),_0x477a('0x26'),_0x477a('0x27'),_0x477a('0x28'),_0x477a('0x29'),_0x477a('0x2a'),_0x477a('0x2b'),_0x477a('0x2c'),_0x477a('0x2d'),_0x477a('0x2e'),'dialPredictiveIntervalMaxThreshold',_0x477a('0x2f')],'include':[{'model':_0x477a('0x30'),'as':_0x477a('0x30'),'attributes':['id',_0x477a('0x31'),_0x477a('0x32'),_0x477a('0x33')]},{'model':_0x477a('0x34'),'as':_0x477a('0x35'),'attributes':['id',_0x477a('0x31')]},{'model':'Trunk','as':_0x477a('0x36'),'attributes':['id','name','callerid',_0x477a('0x33')]},{'model':'Interval','as':_0x477a('0x37'),'attributes':['id',_0x477a('0x31')],'include':[{'model':_0x477a('0x37'),'as':_0x477a('0x38'),'attributes':['id',_0x477a('0x31'),_0x477a('0x39')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 5efe983..1ea3fbb 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 _0x52f9=['lodash','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','moment'];(function(_0x4a5f6c,_0x4f532e){var _0x281ffd=function(_0x4c68e3){while(--_0x4c68e3){_0x4a5f6c['push'](_0x4a5f6c['shift']());}};_0x281ffd(++_0x4f532e);}(_0x52f9,0xf6));var _0x952f=function(_0x4c767c,_0x3d4203){_0x4c767c=_0x4c767c-0x0;var _0x5e8bb9=_0x52f9[_0x4c767c];return _0x5e8bb9;};'use strict';var moment=require(_0x952f('0x0'));var _=require(_0x952f('0x1'));var client=require('../client');exports['create']=function(_0x2a01fc){return client[_0x952f('0x2')](_0x952f('0x3'),{'body':_0x2a01fc,'log':_0x952f('0x3')});};exports[_0x952f('0x4')]=function(){return function(){return client[_0x952f('0x2')](_0x952f('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x952f('0x6'))['format'](_0x952f('0x7')),moment()[_0x952f('0x8')]('day')[_0x952f('0x9')](_0x952f('0x7'))]}},'attributes':[_0x952f('0xa'),_0x952f('0xb'),_0x952f('0xc'),_0x952f('0xd'),_0x952f('0xe'),'queuecallercompleteAt',_0x952f('0xf'),_0x952f('0x10'),_0x952f('0x11'),_0x952f('0x12')]},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0x76d0=['queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt'];(function(_0x541537,_0x1a1a1b){var _0x53e0b1=function(_0x3cd6b4){while(--_0x3cd6b4){_0x541537['push'](_0x541537['shift']());}};_0x53e0b1(++_0x1a1a1b);}(_0x76d0,0x132));var _0x076d=function(_0x47e3a0,_0xc79b10){_0x47e3a0=_0x47e3a0-0x0;var _0x10b8c1=_0x76d0[_0x47e3a0];return _0x10b8c1;};'use strict';var moment=require(_0x076d('0x0'));var _=require(_0x076d('0x1'));var client=require(_0x076d('0x2'));exports['create']=function(_0x539da8){return client[_0x076d('0x3')](_0x076d('0x4'),{'body':_0x539da8,'log':_0x076d('0x4')});};exports[_0x076d('0x5')]=function(){return function(){return client[_0x076d('0x3')]('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x076d('0x6'))[_0x076d('0x7')](_0x076d('0x8')),moment()[_0x076d('0x9')](_0x076d('0x6'))[_0x076d('0x7')](_0x076d('0x8'))]}},'attributes':[_0x076d('0xa'),_0x076d('0xb'),_0x076d('0xc'),_0x076d('0xd'),_0x076d('0xe'),_0x076d('0xf'),'queuecallerexit',_0x076d('0x10'),_0x076d('0x11'),_0x076d('0x12')]},'log':_0x076d('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 40f11d1..57b3704 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 _0x1ea4=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x1a8c41,_0xc1691c){var _0x12749d=function(_0x26af5f){while(--_0x26af5f){_0x1a8c41['push'](_0x1a8c41['shift']());}};_0x12749d(++_0xc1691c);}(_0x1ea4,0xa9));var _0x41ea=function(_0x5642f0,_0x540110){_0x5642f0=_0x5642f0-0x0;var _0x275ae0=_0x1ea4[_0x5642f0];return _0x275ae0;};'use strict';var client=require(_0x41ea('0x0'));exports[_0x41ea('0x1')]=function(_0x120546){return function(){return client[_0x41ea('0x2')](_0x41ea('0x3'),{'options':{'where':{'VoiceQueueId':_0x120546,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0xa9f6=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0x1c7137,_0x4c7c26){var _0xeb4432=function(_0x26d850){while(--_0x26d850){_0x1c7137['push'](_0x1c7137['shift']());}};_0xeb4432(++_0x4c7c26);}(_0xa9f6,0x1c7));var _0x6a9f=function(_0x23732e,_0x2a420a){_0x23732e=_0x23732e-0x0;var _0x305ba6=_0xa9f6[_0x23732e];return _0x305ba6;};'use strict';var client=require(_0x6a9f('0x0'));exports[_0x6a9f('0x1')]=function(_0x37b3eb){return function(){return client['Request'](_0x6a9f('0x2'),{'options':{'where':{'VoiceQueueId':_0x37b3eb,'paused':!![]},'raw':!![]},'log':_0x6a9f('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 028ac11..b8cb644 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 _0xed7c=['../client','create','Request','CreateVoiceRecording','lodash'];(function(_0x18f53f,_0x51a5d6){var _0x187a78=function(_0x7dfa97){while(--_0x7dfa97){_0x18f53f['push'](_0x18f53f['shift']());}};_0x187a78(++_0x51a5d6);}(_0xed7c,0xef));var _0xced7=function(_0x196484,_0x374770){_0x196484=_0x196484-0x0;var _0x184703=_0xed7c[_0x196484];return _0x184703;};'use strict';var _=require(_0xced7('0x0'));var client=require(_0xced7('0x1'));exports[_0xced7('0x2')]=function(_0x51edb5){return client[_0xced7('0x3')](_0xced7('0x4'),{'body':_['merge'](_0x51edb5,{'value':_0x51edb5['monitorFilename']}),'log':'CreateVoiceRecording'});}; \ No newline at end of file +var _0x17a4=['Request','merge','CreateVoiceRecording','lodash','../client','create'];(function(_0xaf4ebe,_0x4c6b1e){var _0x4226d3=function(_0x377438){while(--_0x377438){_0xaf4ebe['push'](_0xaf4ebe['shift']());}};_0x4226d3(++_0x4c6b1e);}(_0x17a4,0x111));var _0x417a=function(_0x545a3a,_0x3123aa){_0x545a3a=_0x545a3a-0x0;var _0x5a5493=_0x17a4[_0x545a3a];return _0x5a5493;};'use strict';var _=require(_0x417a('0x0'));var client=require(_0x417a('0x1'));exports[_0x417a('0x2')]=function(_0x46fda2){return client[_0x417a('0x3')]('CreateVoiceRecording',{'body':_[_0x417a('0x4')](_0x46fda2,{'value':_0x46fda2['monitorFilename']}),'log':_0x417a('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 24710bd..4a40122 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 _0x442b=['transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','result','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','../client','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum'];(function(_0xe31165,_0x23cebf){var _0x3cd681=function(_0x5cfe54){while(--_0x5cfe54){_0xe31165['push'](_0xe31165['shift']());}};_0x3cd681(++_0x23cebf);}(_0x442b,0x10f));var _0xb442=function(_0x5bae33,_0x5c0c50){_0x5bae33=_0x5bae33-0x0;var _0x5c06a7=_0x442b[_0x5bae33];return _0x5c06a7;};'use strict';var client=require(_0xb442('0x0'));exports['blindTransfer']=function(_0x3d2e7e){return client[_0xb442('0x1')](_0xb442('0x2'),{'body':{'result':_0x3d2e7e['result'],'transfererchannel':_0x3d2e7e[_0xb442('0x3')],'transferercalleridnum':_0x3d2e7e[_0xb442('0x4')],'transferercalleridname':_0x3d2e7e[_0xb442('0x5')],'transfererconnectedlinenum':_0x3d2e7e[_0xb442('0x6')],'transfererconnectedlinename':_0x3d2e7e[_0xb442('0x7')],'transfereraccountcode':_0x3d2e7e[_0xb442('0x8')],'transferercontext':_0x3d2e7e[_0xb442('0x9')],'transfererexten':_0x3d2e7e[_0xb442('0xa')],'transfererlinkedid':_0x3d2e7e[_0xb442('0xb')],'transfereechannel':_0x3d2e7e[_0xb442('0xc')],'transfereecalleridnum':_0x3d2e7e[_0xb442('0xd')],'transfereecalleridname':_0x3d2e7e[_0xb442('0xe')],'transfereeconnectedlinenum':_0x3d2e7e[_0xb442('0xf')],'transfereeconnectedlinename':_0x3d2e7e[_0xb442('0x10')],'transfereeaccountcode':_0x3d2e7e[_0xb442('0x11')],'transfereecontext':_0x3d2e7e['transfereecontext'],'transfereeexten':_0x3d2e7e[_0xb442('0x12')],'transfereelinkedid':_0x3d2e7e[_0xb442('0x13')],'isexternal':_0x3d2e7e[_0xb442('0x14')],'context':_0x3d2e7e[_0xb442('0x15')],'extension':_0x3d2e7e[_0xb442('0x16')],'type':_0xb442('0x17')},'log':_0xb442('0x2')});};exports[_0xb442('0x18')]=function(_0x3b2df5){return client[_0xb442('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0x3b2df5[_0xb442('0x19')],'transfererchannel':_0x3b2df5['origtransfererchannel'],'transferercalleridnum':_0x3b2df5[_0xb442('0x1a')],'transferercalleridname':_0x3b2df5['origtransferercalleridname'],'transfererconnectedlinenum':_0x3b2df5[_0xb442('0x1b')],'transfererconnectedlinename':_0x3b2df5[_0xb442('0x1c')],'transfereraccountcode':_0x3b2df5[_0xb442('0x1d')],'transferercontext':_0x3b2df5[_0xb442('0x1e')],'transfererexten':_0x3b2df5['secondtransfererexten'],'transfererlinkedid':_0x3b2df5[_0xb442('0x1f')],'transfereechannel':_0x3b2df5[_0xb442('0x20')],'transfereecalleridnum':_0x3b2df5[_0xb442('0x21')],'transfereecalleridname':_0x3b2df5[_0xb442('0x22')],'transfereeconnectedlinenum':_0x3b2df5[_0xb442('0x23')],'transfereeconnectedlinename':_0x3b2df5[_0xb442('0x24')],'transfereeaccountcode':_0x3b2df5['transfertargetaccountcode'],'transfereecontext':_0x3b2df5[_0xb442('0x25')],'transfereeexten':_0x3b2df5[_0xb442('0x26')],'transfereelinkedid':_0x3b2df5[_0xb442('0x27')],'isexternal':_0x3b2df5[_0xb442('0x14')],'context':_0x3b2df5[_0xb442('0x28')],'extension':_0x3b2df5['origtransfererexten'],'type':'attended'},'log':_0xb442('0x2')});}; \ No newline at end of file +var _0x5fbb=['transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','blindTransfer','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten'];(function(_0x248805,_0x4d8c4a){var _0x243b1c=function(_0xaa370e){while(--_0xaa370e){_0x248805['push'](_0x248805['shift']());}};_0x243b1c(++_0x4d8c4a);}(_0x5fbb,0x17c));var _0xb5fb=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5fbb[_0x2c91e9];return _0x13f0ff;};'use strict';var client=require(_0xb5fb('0x0'));exports[_0xb5fb('0x1')]=function(_0x46dfb4){return client['Request'](_0xb5fb('0x2'),{'body':{'result':_0x46dfb4[_0xb5fb('0x3')],'transfererchannel':_0x46dfb4['transfererchannel'],'transferercalleridnum':_0x46dfb4[_0xb5fb('0x4')],'transferercalleridname':_0x46dfb4[_0xb5fb('0x5')],'transfererconnectedlinenum':_0x46dfb4[_0xb5fb('0x6')],'transfererconnectedlinename':_0x46dfb4[_0xb5fb('0x7')],'transfereraccountcode':_0x46dfb4[_0xb5fb('0x8')],'transferercontext':_0x46dfb4['transferercontext'],'transfererexten':_0x46dfb4[_0xb5fb('0x9')],'transfererlinkedid':_0x46dfb4[_0xb5fb('0xa')],'transfereechannel':_0x46dfb4[_0xb5fb('0xb')],'transfereecalleridnum':_0x46dfb4[_0xb5fb('0xc')],'transfereecalleridname':_0x46dfb4[_0xb5fb('0xd')],'transfereeconnectedlinenum':_0x46dfb4[_0xb5fb('0xe')],'transfereeconnectedlinename':_0x46dfb4[_0xb5fb('0xf')],'transfereeaccountcode':_0x46dfb4[_0xb5fb('0x10')],'transfereecontext':_0x46dfb4[_0xb5fb('0x11')],'transfereeexten':_0x46dfb4[_0xb5fb('0x12')],'transfereelinkedid':_0x46dfb4[_0xb5fb('0x13')],'isexternal':_0x46dfb4[_0xb5fb('0x14')],'context':_0x46dfb4['context'],'extension':_0x46dfb4['extension'],'type':_0xb5fb('0x15')},'log':_0xb5fb('0x2')});};exports[_0xb5fb('0x16')]=function(_0x141a76){return client['Request'](_0xb5fb('0x2'),{'body':{'result':_0x141a76[_0xb5fb('0x3')],'transfererchannel':_0x141a76[_0xb5fb('0x17')],'transferercalleridnum':_0x141a76[_0xb5fb('0x18')],'transferercalleridname':_0x141a76[_0xb5fb('0x19')],'transfererconnectedlinenum':_0x141a76[_0xb5fb('0x1a')],'transfererconnectedlinename':_0x141a76[_0xb5fb('0x1b')],'transfereraccountcode':_0x141a76[_0xb5fb('0x1c')],'transferercontext':_0x141a76[_0xb5fb('0x1d')],'transfererexten':_0x141a76[_0xb5fb('0x1e')],'transfererlinkedid':_0x141a76['origtransfererlinkedid'],'transfereechannel':_0x141a76[_0xb5fb('0x1f')],'transfereecalleridnum':_0x141a76[_0xb5fb('0x20')],'transfereecalleridname':_0x141a76['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x141a76['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x141a76['transfertargetconnectedlinename'],'transfereeaccountcode':_0x141a76[_0xb5fb('0x21')],'transfereecontext':_0x141a76[_0xb5fb('0x22')],'transfereeexten':_0x141a76[_0xb5fb('0x23')],'transfereelinkedid':_0x141a76[_0xb5fb('0x24')],'isexternal':_0x141a76['isexternal'],'context':_0x141a76['origtransferercontext'],'extension':_0x141a76[_0xb5fb('0x25')],'type':_0xb5fb('0x26')},'log':_0xb5fb('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index cd2f194..a0fbad3 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 _0x7d6d=['Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','emit','send','checkAfterSend','server','listen','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','validate','bluebird','../properties','../ami','format','%s/%s','SIP','name','timers','timer','agents','pause','QueuePause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','action','Action','then','catch','message','username','Command','voiceQueues','hasOwnProperty','answered','available','loggedIn','pTalking','sumHoldTime','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','Interval','values','channels','length','map','find','channel','%s.%s','filename','uniqueid','wav','MixMonitor','monitors','toLowerCase','isNil','push','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup'];(function(_0x1a649a,_0x17e802){var _0x1eb6ad=function(_0x334d52){while(--_0x334d52){_0x1a649a['push'](_0x1a649a['shift']());}};_0x1eb6ad(++_0x17e802);}(_0x7d6d,0x112));var _0xd7d6=function(_0xa4b885,_0x1e725a){_0xa4b885=_0xa4b885-0x0;var _0x2be448=_0x7d6d[_0xa4b885];return _0x2be448;};'use strict';var _=require('lodash');var util=require(_0xd7d6('0x0'));var jayson=require('jayson/promise');var schema=require(_0xd7d6('0x1'));var BPromise=require(_0xd7d6('0x2'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0xd7d6('0x3'));var ami=require(_0xd7d6('0x4'));exports['listen']=function(_0x1bad98,_0x4a4ca0,_0x41d730){return new BPromise(function(_0x48d2aa,_0x19dde3){var _0x56c5ef={'QueuePause':function(_0x43a185){return new Promise(function(_0x513461,_0x413ba0){var _0x13b1c0=util[_0xd7d6('0x5')](_0xd7d6('0x6'),_0xd7d6('0x7'),_0x43a185[_0xd7d6('0x8')]);if(_0x1bad98['timers']&&_0x1bad98[_0xd7d6('0x9')][_0x13b1c0]&&_0x1bad98[_0xd7d6('0x9')][_0x13b1c0][_0xd7d6('0xa')]){_0x1bad98[_0xd7d6('0x9')][_0x13b1c0]['updateAcw']();}if(_0x1bad98[_0xd7d6('0xb')][_0x13b1c0]){_0x1bad98[_0xd7d6('0xb')][_0x13b1c0]['updateStatusRealtime']({'statePause':_0x43a185[_0xd7d6('0xc')]?!![]:![]});}_0x513461({'code':0xc8,'message':_0xd7d6('0xd')});});},'Reload':function(_0x5e61ee){var _0x10a7d5=this;return new Promise(function(_0x2727ae,_0x12d023){if(ami[_0xd7d6('0xe')]()==![]){return _0x12d023(_0x10a7d5[_0xd7d6('0xf')](0x1f4,[config[_0xd7d6('0x10')]['ip'],config[_0xd7d6('0x10')]['username'],_0xd7d6('0x11')][_0xd7d6('0x12')]('\x20')));}_0x5e61ee=_[_0xd7d6('0x13')](_0x5e61ee,_[_0xd7d6('0x14')](properties['module']));_0x5e61ee[_0xd7d6('0x15')]='Reload';return ami[_0xd7d6('0x16')](_0x5e61ee)[_0xd7d6('0x17')](function(_0x3c485d){_0x2727ae({'code':0xc8,'message':_0x3c485d['message']});})[_0xd7d6('0x18')](function(_0x4ef5fc){_0x12d023(_0x10a7d5[_0xd7d6('0xf')](0x1f5,_0x4ef5fc[_0xd7d6('0x19')]));});});},'Command':function(_0x371076){var _0x32c32a=this;return new Promise(function(_0x487f6c,_0x2bab5a){if(ami[_0xd7d6('0xe')]()==![]){return _0x2bab5a(_0x32c32a[_0xd7d6('0xf')](0x1f4,[config[_0xd7d6('0x10')]['ip'],config[_0xd7d6('0x10')][_0xd7d6('0x1a')],_0xd7d6('0x11')]['join']('\x20')));}_0x371076=_[_0xd7d6('0x13')](_0x371076,'command');_0x371076['action']=_0xd7d6('0x1b');return ami['Action'](_0x371076)['then'](function(_0x4f871f){_0x487f6c({'code':0xc8,'message':_0x4f871f['content']});})[_0xd7d6('0x18')](function(_0x1d06ea){_0x2bab5a(_0x32c32a[_0xd7d6('0xf')](0x1f5,_0x1d06ea['message']));});});},'VoiceQueues':function(_0x3ef068){return new Promise(function(_0x167c79,_0x396337){var _0x59cf4e=[];for(var _0x5ee85d in _0x1bad98[_0xd7d6('0x1c')]){if(_0x1bad98[_0xd7d6('0x1c')][_0xd7d6('0x1d')](_0x5ee85d)){var _0x3bccbc=_0x1bad98[_0xd7d6('0x1c')][_0x5ee85d];var _0xe40b06={'id':_0x3bccbc['id'],'name':_0x3bccbc[_0xd7d6('0x8')],'strategy':_0x3bccbc['strategy'],'answered':_0x3bccbc[_0xd7d6('0x1e')],'available':_0x3bccbc[_0xd7d6('0x1f')],'loggedIn':_0x3bccbc[_0xd7d6('0x20')],'pTalking':_0x3bccbc[_0xd7d6('0x21')],'sumBillable':_0x3bccbc['sumBillable'],'sumDuration':_0x3bccbc['sumDuration'],'sumHoldTime':_0x3bccbc[_0xd7d6('0x22')]||0x0,'talking':_0x3bccbc['talking'],'total':_0x3bccbc[_0xd7d6('0x23')],'type':_0x3bccbc[_0xd7d6('0x24')],'unmanaged':_0x3bccbc[_0xd7d6('0x25')],'abandoned':_0x3bccbc[_0xd7d6('0x26')],'waiting':_0x3bccbc[_0xd7d6('0x27')],'loggedInDb':_0x3bccbc[_0xd7d6('0x28')]};if(_0x3bccbc['type']===_0xd7d6('0x29')){_0xe40b06[_0xd7d6('0x2a')]=_0x3bccbc['dialActive'];_0xe40b06[_0xd7d6('0x2b')]=_0x3bccbc[_0xd7d6('0x2b')];_0xe40b06[_0xd7d6('0x2c')]=_0x3bccbc[_0xd7d6('0x2c')];_0xe40b06[_0xd7d6('0x2d')]=_0x3bccbc[_0xd7d6('0x2d')];_0xe40b06[_0xd7d6('0x2e')]=_0x3bccbc[_0xd7d6('0x2e')];_0xe40b06['dialPrefix']=_0x3bccbc[_0xd7d6('0x2f')];_0xe40b06['outboundAnswerAgiCallsDay']=_0x3bccbc[_0xd7d6('0x30')];_0xe40b06[_0xd7d6('0x31')]=_0x3bccbc[_0xd7d6('0x31')];_0xe40b06['outboundBlacklistCallsDay']=_0x3bccbc['outboundBlacklistCallsDay'];_0xe40b06['outboundBusyCallsDay']=_0x3bccbc['outboundBusyCallsDay'];_0xe40b06['outboundCongestionCallsDay']=_0x3bccbc['outboundCongestionCallsDay'];_0xe40b06[_0xd7d6('0x32')]=_0x3bccbc[_0xd7d6('0x32')];_0xe40b06[_0xd7d6('0x33')]=_0x3bccbc[_0xd7d6('0x33')];_0xe40b06[_0xd7d6('0x34')]=_0x3bccbc['outboundDropCallsDayTimeout'];_0xe40b06[_0xd7d6('0x35')]=_0x3bccbc[_0xd7d6('0x35')];_0xe40b06[_0xd7d6('0x36')]=_0x3bccbc[_0xd7d6('0x36')];_0xe40b06[_0xd7d6('0x37')]=_0x3bccbc[_0xd7d6('0x37')];_0xe40b06['outboundReCallsDay']=_0x3bccbc[_0xd7d6('0x38')];_0xe40b06[_0xd7d6('0x39')]=_0x3bccbc[_0xd7d6('0x39')];_0xe40b06['outboundUnknownCallsDay']=_0x3bccbc[_0xd7d6('0x3a')];_0xe40b06[_0xd7d6('0x3b')]=_0x3bccbc['predictiveIntervalAnsweredCalls'];_0xe40b06[_0xd7d6('0x3c')]=_0x3bccbc['predictiveIntervalAvgHoldtime'];_0xe40b06[_0xd7d6('0x3d')]=_0x3bccbc[_0xd7d6('0x3d')];_0xe40b06[_0xd7d6('0x3e')]=_0x3bccbc[_0xd7d6('0x3e')];_0xe40b06[_0xd7d6('0x3f')]=_0x3bccbc['predictiveIntervalDroppedCallsTimeout'];_0xe40b06[_0xd7d6('0x40')]=_0x3bccbc['predictiveIntervalErlangCalls'];_0xe40b06[_0xd7d6('0x41')]=_0x3bccbc[_0xd7d6('0x41')];_0xe40b06[_0xd7d6('0x42')]=_0x3bccbc[_0xd7d6('0x42')];_0xe40b06[_0xd7d6('0x43')]=_0x3bccbc[_0xd7d6('0x43')];_0xe40b06[_0xd7d6('0x44')]=_0x3bccbc['predictiveIntervalPauses'];_0xe40b06[_0xd7d6('0x45')]=_0x3bccbc[_0xd7d6('0x45')];_0xe40b06[_0xd7d6('0x46')]=_0x3bccbc[_0xd7d6('0x46')];_0xe40b06['message']=_0x3bccbc[_0xd7d6('0x19')];_0xe40b06[_0xd7d6('0x47')]=_0x3bccbc['originated'];_0xe40b06['erlangCalls']=_0x3bccbc[_0xd7d6('0x48')];_0xe40b06[_0xd7d6('0x49')]=_0x3bccbc['erlangCallToSecond'];_0xe40b06[_0xd7d6('0x4a')]=_0x3bccbc['erlangAbandonmentRate'];_0xe40b06[_0xd7d6('0x4b')]=_0x3bccbc[_0xd7d6('0x4b')];_0xe40b06[_0xd7d6('0x4c')]=_0x3bccbc[_0xd7d6('0x4c')];_0xe40b06['startProgressive']=_0x3bccbc[_0xd7d6('0x4d')];}if(_0x3bccbc[_0xd7d6('0x4e')]){_0xe40b06[_0xd7d6('0x4e')]={'id':_0x3bccbc['Trunk']['id'],'name':_0x3bccbc[_0xd7d6('0x4e')][_0xd7d6('0x8')],'active':_0x3bccbc[_0xd7d6('0x4e')]['active'],'callerid':_0x3bccbc[_0xd7d6('0x4e')]['callerid']};}if(_0x3bccbc[_0xd7d6('0x4f')]){_0xe40b06[_0xd7d6('0x4f')]={'id':_0x3bccbc[_0xd7d6('0x4f')]['id'],'name':_0x3bccbc[_0xd7d6('0x4f')][_0xd7d6('0x8')]};}_0x59cf4e['push'](_0xe40b06);}}_0x167c79({'count':_0x59cf4e['length'],'rows':_0x59cf4e});});},'VoiceChannels':function(_0x41ac98){return new Promise(function(_0x5d1093,_0x11359b){var _0x58e2fb=_[_0xd7d6('0x50')](_0x1bad98[_0xd7d6('0x51')]);_0x5d1093({'count':_0x58e2fb[_0xd7d6('0x52')],'rows':_0x58e2fb});});},'VoiceChannelMixMonitor':function(_0x14b7d0){var _0x151651=this;return new Promise(function(_0x45e186,_0x174429){if(ami[_0xd7d6('0xe')]()==![]){return _0x174429(_0x151651[_0xd7d6('0xf')](0x1f4,[config[_0xd7d6('0x10')]['ip'],config[_0xd7d6('0x10')][_0xd7d6('0x1a')],_0xd7d6('0x11')]['join']('\x20')));}var _0x436903=schema(properties['voicechannel'])['validate'](_0x14b7d0);if(_0x436903[_0xd7d6('0x52')]>0x0){return _0x174429(_0x151651[_0xd7d6('0xf')](0x1f4,_[_0xd7d6('0x53')](_0x436903,_0xd7d6('0x19'))[_0xd7d6('0x12')](',\x20')));}var _0x3508da=_[_0xd7d6('0x54')](_0x1bad98['channels'],{'uniqueid':_0x14b7d0['uniqueid']});if(_0x3508da&&_0x3508da[_0xd7d6('0x55')]){var _0x448bbd=util[_0xd7d6('0x5')](_0xd7d6('0x56'),_0x14b7d0[_0xd7d6('0x57')]||_0x14b7d0[_0xd7d6('0x58')],_0x14b7d0['format']||_0xd7d6('0x59'));return ami[_0xd7d6('0x16')]({'action':_0xd7d6('0x5a'),'channel':_0x3508da[_0xd7d6('0x55')],'file':_0x448bbd,'options':'ai(mixmonitorid)'})[_0xd7d6('0x17')](function(_0x49f239){var _0x272e09=_[_0xd7d6('0x54')](_0x3508da[_0xd7d6('0x5b')],{'filename':'/var/spool/asterisk/monitor/'+_0x448bbd[_0xd7d6('0x5c')]()});if(_[_0xd7d6('0x5d')](_0x272e09)){_0x3508da['monitors'][_0xd7d6('0x5e')]({'filename':_0xd7d6('0x5f')+_0x448bbd[_0xd7d6('0x5c')](),'createdAt':moment()[_0xd7d6('0x5')](_0xd7d6('0x60')),'mixmonitorid':_0x49f239[_0xd7d6('0x61')],'status':_0xd7d6('0x62')});}else{_0x272e09[_0xd7d6('0x61')]=_0x49f239[_0xd7d6('0x61')];_0x272e09[_0xd7d6('0x63')]=_0xd7d6('0x62');}_0x45e186({'code':0xc8,'message':[_0x14b7d0['uniqueid'],_0xd7d6('0x64'),_0x49f239[_0xd7d6('0x61')]][_0xd7d6('0x12')]('\x20'),'mixmonitorid':_0x49f239[_0xd7d6('0x61')]});})[_0xd7d6('0x18')](function(_0x22f664){_0x174429(_0x151651[_0xd7d6('0xf')](0x1f5,[_0x14b7d0['uniqueid'],_0x22f664[_0xd7d6('0x19')][_0xd7d6('0x5c')]()][_0xd7d6('0x12')]('\x20')));});}else{return _0x174429(_0x151651[_0xd7d6('0xf')](0x1f5,_0xd7d6('0x65')));}});},'VoiceChannelStopMixMonitor':function(_0x899aec){var _0x2f7193=this;return new Promise(function(_0x1d78b0,_0x189f0f){if(ami['isConnected']()==![]){return _0x189f0f(_0x2f7193[_0xd7d6('0xf')](0x1f4,[config[_0xd7d6('0x10')]['ip'],config['asterisk'][_0xd7d6('0x1a')],_0xd7d6('0x11')][_0xd7d6('0x12')]('\x20')));}var _0x512f65=schema(properties[_0xd7d6('0x66')])[_0xd7d6('0x1')](_0x899aec);if(_0x512f65[_0xd7d6('0x52')]>0x0){return _0x189f0f(_0x2f7193[_0xd7d6('0xf')](0x1f4,_[_0xd7d6('0x53')](_0x512f65,'message')[_0xd7d6('0x12')](',\x20')));}var _0x1c3a8e=_[_0xd7d6('0x54')](_0x1bad98['channels'],{'uniqueid':_0x899aec['uniqueid']});if(_0x1c3a8e){return BPromise[_0xd7d6('0x67')]()[_0xd7d6('0x17')](function(){if(_0x1c3a8e[_0xd7d6('0x55')]){return ami['Action']({'action':_0xd7d6('0x68'),'channel':_0x1c3a8e[_0xd7d6('0x55')],'mixmonitorid':_0x899aec[_0xd7d6('0x61')]})[_0xd7d6('0x18')](function(_0x441e8c){});}})[_0xd7d6('0x17')](function(){if(_0x1c3a8e['destinationchannel']){return ami[_0xd7d6('0x16')]({'action':_0xd7d6('0x68'),'channel':_0x1c3a8e[_0xd7d6('0x69')],'mixmonitorid':_0x899aec[_0xd7d6('0x61')]})[_0xd7d6('0x18')](function(_0x523061){});}})[_0xd7d6('0x17')](function(_0x12dbbe){var _0x295da9=_['find'](_0x1c3a8e[_0xd7d6('0x5b')],{'mixmonitorid':_0x899aec[_0xd7d6('0x61')]});if(_0x295da9){_0x295da9[_0xd7d6('0x63')]=_0xd7d6('0x6a');}})['then'](function(){var _0x597e7f=util[_0xd7d6('0x5')](_0xd7d6('0x56'),_0x899aec[_0xd7d6('0x57')]||_0x899aec['uniqueid'],_0x899aec[_0xd7d6('0x5')]||_0xd7d6('0x59'));var _0x1ce5f5=_[_0xd7d6('0x54')](_0x1c3a8e[_0xd7d6('0x5b')],{'filename':_0xd7d6('0x5f')+_0x597e7f[_0xd7d6('0x5c')]()});if(_0x1ce5f5){_0x1ce5f5['status']=_0xd7d6('0x6a');}})[_0xd7d6('0x17')](function(){_0x1d78b0({'code':0xc8,'message':[_0x899aec[_0xd7d6('0x58')],_0xd7d6('0x6b')]['join']('\x20')});})[_0xd7d6('0x18')](function(_0x4e4125){_0x189f0f(_0x2f7193[_0xd7d6('0xf')](0x1f5,[_0x899aec[_0xd7d6('0x58')],_0x4e4125[_0xd7d6('0x19')][_0xd7d6('0x5c')]()][_0xd7d6('0x12')]('\x20')));});}else{return _0x189f0f(_0x2f7193[_0xd7d6('0xf')](0x1f5,_0xd7d6('0x65')));}});},'VoiceQueuesChannels':function(_0x1e1c9f){return new Promise(function(_0x457594,_0x516424){var _0x235b67=_[_0xd7d6('0x50')](_0x1bad98[_0xd7d6('0x6c')]);_0x457594({'count':_0x235b67[_0xd7d6('0x52')],'rows':_0x235b67});});},'VoiceQueuesChannel':function(_0x28d4a5){var _0x24a146=this;return new Promise(function(_0x501dc4,_0x9d8ea8){var _0xb889bf=schema(properties['voicequeuechannel'])[_0xd7d6('0x1')](_0x28d4a5);if(_0xb889bf[_0xd7d6('0x52')]>0x0){return _0x9d8ea8(_0x24a146[_0xd7d6('0xf')](0x1f4,_['map'](_0xb889bf,_0xd7d6('0x19'))[_0xd7d6('0x12')](',\x20')));}var _0xbd3220=_[_0xd7d6('0x54')](_0x1bad98[_0xd7d6('0x6c')],{'uniqueid':_0x28d4a5[_0xd7d6('0x58')]});if(_0xbd3220){_0x501dc4(_0xbd3220);}else{return _0x9d8ea8(_0x24a146[_0xd7d6('0xf')](0x1f5,_0xd7d6('0x65')));}});},'VoiceQueuesChannelHangup':function(_0xfc22d3){var _0x4edc05=this;return new Promise(function(_0x28cc56,_0x48f11e){if(ami['isConnected']()==![]){return _0x48f11e(_0x4edc05[_0xd7d6('0xf')](0x1f4,[config[_0xd7d6('0x10')]['ip'],config[_0xd7d6('0x10')][_0xd7d6('0x1a')],'ami\x20disconnected'][_0xd7d6('0x12')]('\x20')));}var _0x42c721=schema(properties[_0xd7d6('0x6d')])[_0xd7d6('0x1')](_0xfc22d3);if(_0x42c721[_0xd7d6('0x52')]>0x0){return _0x48f11e(_0x4edc05['error'](0x1f4,_[_0xd7d6('0x53')](_0x42c721,_0xd7d6('0x19'))[_0xd7d6('0x12')](',\x20')));}var _0x7a04f=_[_0xd7d6('0x54')](_0x1bad98[_0xd7d6('0x6c')],{'uniqueid':_0xfc22d3[_0xd7d6('0x58')]});if(_0x7a04f&&_0x7a04f[_0xd7d6('0x55')]){return ami[_0xd7d6('0x16')]({'action':_0xd7d6('0x6e'),'channel':_0x7a04f[_0xd7d6('0x55')]})[_0xd7d6('0x17')](function(_0x2e43c3){_0x28cc56({'code':0xc8,'message':[_0xfc22d3[_0xd7d6('0x58')],_0x2e43c3[_0xd7d6('0x19')][_0xd7d6('0x5c')]()][_0xd7d6('0x12')]('\x20')});})[_0xd7d6('0x18')](function(_0x514d35){_0x48f11e(_0x4edc05['error'](0x1f5,[_0xfc22d3[_0xd7d6('0x58')],_0x514d35[_0xd7d6('0x19')][_0xd7d6('0x5c')]()][_0xd7d6('0x12')]('\x20')));});}else{return _0x48f11e(_0x4edc05['error'](0x1f5,_0xd7d6('0x65')));}});},'VoiceQueuesChannelRedirect':function(_0x16b7aa){var _0x10af5a=this;return new Promise(function(_0x1cf766,_0x142e40){if(ami[_0xd7d6('0xe')]()==![]){return _0x142e40(_0x10af5a[_0xd7d6('0xf')](0x1f4,[config[_0xd7d6('0x10')]['ip'],config[_0xd7d6('0x10')][_0xd7d6('0x1a')],'ami\x20disconnected'][_0xd7d6('0x12')]('\x20')));}var _0x27599e=schema(properties[_0xd7d6('0x6f')])[_0xd7d6('0x1')](_0x16b7aa);if(_0x27599e[_0xd7d6('0x52')]>0x0){return _0x142e40(_0x10af5a['error'](0x1f4,_['map'](_0x27599e,_0xd7d6('0x19'))['join'](',\x20')));}var _0x5d324e=_[_0xd7d6('0x54')](_0x1bad98[_0xd7d6('0x6c')],{'uniqueid':_0x16b7aa[_0xd7d6('0x58')]});if(_0x5d324e&&_0x5d324e[_0xd7d6('0x55')]){return ami[_0xd7d6('0x16')]({'action':_0xd7d6('0x70'),'channel':_0x5d324e[_0xd7d6('0x55')],'exten':_0x16b7aa[_0xd7d6('0x71')],'context':_0x16b7aa[_0xd7d6('0x72')]||_0x5d324e[_0xd7d6('0x72')],'priority':0x1})['then'](function(_0x543fdc){_0x1cf766({'code':0xc8,'message':[_0x16b7aa[_0xd7d6('0x58')],_0x543fdc[_0xd7d6('0x19')][_0xd7d6('0x5c')]()][_0xd7d6('0x12')]('\x20')});})[_0xd7d6('0x18')](function(_0x593080){_0x142e40(_0x10af5a[_0xd7d6('0xf')](0x1f5,[_0x16b7aa[_0xd7d6('0x58')],_0x593080[_0xd7d6('0x19')][_0xd7d6('0x5c')]()][_0xd7d6('0x12')]('\x20')));});}else{return _0x142e40(_0x10af5a[_0xd7d6('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x47bc0e){return new Promise(function(_0x40a785,_0x1909da){var _0x359b0f=_[_0xd7d6('0x50')](_0x1bad98[_0xd7d6('0xb')]);_0x40a785({'count':_0x359b0f[_0xd7d6('0x52')],'rows':_0x359b0f});});},'Telephones':function(_0xcea623){return new Promise(function(_0x5ad43d,_0x13005e){var _0x1686e1=_[_0xd7d6('0x50')](_0x1bad98[_0xd7d6('0x73')]);_0x5ad43d({'count':_0x1686e1[_0xd7d6('0x52')],'rows':_0x1686e1});});},'Trunks':function(_0x297d65){return new Promise(function(_0x26a4ef,_0x4f2a6f){var _0x35edc2=_[_0xd7d6('0x50')](_0x1bad98[_0xd7d6('0x74')]);_0x26a4ef({'count':_0x35edc2[_0xd7d6('0x52')],'rows':_0x35edc2});});},'OutboundChannels':function(_0x8af466){return new Promise(function(_0x413b2f,_0x3057a5){var _0x3d6c17=_[_0xd7d6('0x50')](_0x1bad98[_0xd7d6('0x75')]);_0x413b2f({'count':_0x3d6c17['length'],'rows':_0x3d6c17});});},'Outbound':function(_0x40d994){return new Promise(function(_0x48e92b,_0x2ff5e5){_0x48e92b(_0x1bad98[_0xd7d6('0x29')]);});},'Campaigns':function(_0x56643a){return new Promise(function(_0x56883b,_0x3185e7){var _0x518d0=_[_0xd7d6('0x50')](_0x1bad98[_0xd7d6('0x76')]);_0x56883b({'count':_0x518d0[_0xd7d6('0x52')],'rows':_0x518d0});});},'VoiceQueuesPreview':function(_0x4485c2){var _0x4040ab=this;return new Promise(function(_0x36bdf0,_0x1044dd){_0x4a4ca0['run'](_0x4485c2['id'])[_0xd7d6('0x17')](function(_0x3f63e1){_0x36bdf0({'code':0xc8,'message':_0x3f63e1['message']});})[_0xd7d6('0x18')](function(_0x498742){_0x1044dd(_0x4040ab[_0xd7d6('0xf')](0x1f4,_0x498742[_0xd7d6('0x19')]));});});},'EventManager':function(_0x62f68c){var _0x3795c0=this;return new Promise(function(_0x4ee139,_0xdd7f01){if(!_0x62f68c[_0xd7d6('0x77')]){return _0xdd7f01(_0x3795c0[_0xd7d6('0xf')](0x1f4,_0xd7d6('0x78')));}ami[_0xd7d6('0x79')]('custom:'+_0x62f68c[_0xd7d6('0x77')],_0x62f68c[_0xd7d6('0x19')]);_0x4ee139({'code':0xc8,'message':_0x62f68c});});},'FaxAccounts':function(_0x1db1c9){return new Promise(function(_0x534cb5,_0x379505){var _0x29f070=_[_0xd7d6('0x50')](_0x1bad98['faxAccounts']);_0x534cb5({'count':_0x29f070[_0xd7d6('0x52')],'rows':_0x29f070});});},'SendFax':function(_0x5a3393){var _0x3d7f55=this;return new Promise(function(_0x55a914,_0x2b99cd){_0x41d730[_0xd7d6('0x7a')](_0x5a3393)['then'](function(_0x23287e){_0x55a914({'code':0xc8,'message':_0x23287e[_0xd7d6('0x19')]});})[_0xd7d6('0x18')](function(_0x250a50){_0x2b99cd(_0x3d7f55[_0xd7d6('0xf')](0x1f4,_0x250a50[_0xd7d6('0x19')]));});});},'CheckAfterSend':function(_0x186e5d){var _0x55aead=this;return new Promise(function(_0x162448,_0x5376d8){_0x41d730[_0xd7d6('0x7b')](_0x186e5d)[_0xd7d6('0x17')](function(_0x8e70c5){_0x162448({'code':0xc8,'message':_0x8e70c5[_0xd7d6('0x19')]});})['catch'](function(_0x5659ad){_0x5376d8(_0x55aead[_0xd7d6('0xf')](0x1f4,_0x5659ad[_0xd7d6('0x19')]));});});}};var _0x47469f=jayson[_0xd7d6('0x7c')](_0x56c5ef)['http']();_0x47469f['on'](_0xd7d6('0xf'),function(_0x1a7a5a){return _0x19dde3(_0x1a7a5a);});_0x47469f[_0xd7d6('0x7d')](0x232a,'127.0.0.1',function(){console[_0xd7d6('0x7e')](_0xd7d6('0x7f'),0x232a);return _0x48d2aa('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x63fd=['outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','channels','voicechannel','validate','map','find','uniqueid','channel','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','mixmonitorid','rec','status','StopMixMonitor','destinationchannel','stop','%s.%s','Channel\x20doesn\x27t\x20exist','values','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels','outbound','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','ami\x20disconnected','join','keys','module','Reload','Action','then','catch','isConnected','username','pick','command','action','Command','message','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','talking','total','type','unmanaged','abandoned','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay'];(function(_0x48f827,_0x269e8d){var _0xc763f7=function(_0x19769a){while(--_0x19769a){_0x48f827['push'](_0x48f827['shift']());}};_0xc763f7(++_0x269e8d);}(_0x63fd,0xd0));var _0xd63f=function(_0x1f7000,_0x4767c2){_0x1f7000=_0x1f7000-0x0;var _0x44d3aa=_0x63fd[_0x1f7000];return _0x44d3aa;};'use strict';var _=require(_0xd63f('0x0'));var util=require(_0xd63f('0x1'));var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require(_0xd63f('0x2'));var moment=require(_0xd63f('0x3'));var config=require(_0xd63f('0x4'));var properties=require(_0xd63f('0x5'));var ami=require(_0xd63f('0x6'));exports[_0xd63f('0x7')]=function(_0x4f7baf,_0x1c73bc,_0x2663a2){return new BPromise(function(_0x134211,_0x1bc2b7){var _0x154478={'QueuePause':function(_0x30be74){return new Promise(function(_0xb27de6,_0x3cd121){var _0x21d1d3=util[_0xd63f('0x8')](_0xd63f('0x9'),_0xd63f('0xa'),_0x30be74[_0xd63f('0xb')]);if(_0x4f7baf[_0xd63f('0xc')]&&_0x4f7baf[_0xd63f('0xc')][_0x21d1d3]&&_0x4f7baf['timers'][_0x21d1d3][_0xd63f('0xd')]){_0x4f7baf[_0xd63f('0xc')][_0x21d1d3]['updateAcw']();}if(_0x4f7baf['agents'][_0x21d1d3]){_0x4f7baf[_0xd63f('0xe')][_0x21d1d3][_0xd63f('0xf')]({'statePause':_0x30be74[_0xd63f('0x10')]?!![]:![]});}_0xb27de6({'code':0xc8,'message':_0xd63f('0x11')});});},'Reload':function(_0x528c82){var _0x2707cb=this;return new Promise(function(_0xc2e5a,_0x2b393e){if(ami['isConnected']()==![]){return _0x2b393e(_0x2707cb[_0xd63f('0x12')](0x1f4,[config[_0xd63f('0x13')]['ip'],config[_0xd63f('0x13')]['username'],_0xd63f('0x14')][_0xd63f('0x15')]('\x20')));}_0x528c82=_['pick'](_0x528c82,_[_0xd63f('0x16')](properties[_0xd63f('0x17')]));_0x528c82['action']=_0xd63f('0x18');return ami[_0xd63f('0x19')](_0x528c82)[_0xd63f('0x1a')](function(_0x46b140){_0xc2e5a({'code':0xc8,'message':_0x46b140['message']});})[_0xd63f('0x1b')](function(_0x5c3b07){_0x2b393e(_0x2707cb[_0xd63f('0x12')](0x1f5,_0x5c3b07['message']));});});},'Command':function(_0x3f86c7){var _0x17d523=this;return new Promise(function(_0x27b05b,_0x52eb1f){if(ami[_0xd63f('0x1c')]()==![]){return _0x52eb1f(_0x17d523[_0xd63f('0x12')](0x1f4,[config[_0xd63f('0x13')]['ip'],config[_0xd63f('0x13')][_0xd63f('0x1d')],_0xd63f('0x14')][_0xd63f('0x15')]('\x20')));}_0x3f86c7=_[_0xd63f('0x1e')](_0x3f86c7,_0xd63f('0x1f'));_0x3f86c7[_0xd63f('0x20')]=_0xd63f('0x21');return ami[_0xd63f('0x19')](_0x3f86c7)[_0xd63f('0x1a')](function(_0x3a9a50){_0x27b05b({'code':0xc8,'message':_0x3a9a50['content']});})[_0xd63f('0x1b')](function(_0x112351){_0x52eb1f(_0x17d523[_0xd63f('0x12')](0x1f5,_0x112351[_0xd63f('0x22')]));});});},'VoiceQueues':function(_0x2a073){return new Promise(function(_0x13bc28,_0x5bfa2f){var _0x3562da=[];for(var _0xc321c9 in _0x4f7baf['voiceQueues']){if(_0x4f7baf[_0xd63f('0x23')][_0xd63f('0x24')](_0xc321c9)){var _0x1e5562=_0x4f7baf[_0xd63f('0x23')][_0xc321c9];var _0xa7a080={'id':_0x1e5562['id'],'name':_0x1e5562[_0xd63f('0xb')],'strategy':_0x1e5562[_0xd63f('0x25')],'answered':_0x1e5562[_0xd63f('0x26')],'available':_0x1e5562[_0xd63f('0x27')],'loggedIn':_0x1e5562[_0xd63f('0x28')],'pTalking':_0x1e5562[_0xd63f('0x29')],'sumBillable':_0x1e5562[_0xd63f('0x2a')],'sumDuration':_0x1e5562['sumDuration'],'sumHoldTime':_0x1e5562['sumHoldTime']||0x0,'talking':_0x1e5562[_0xd63f('0x2b')],'total':_0x1e5562[_0xd63f('0x2c')],'type':_0x1e5562[_0xd63f('0x2d')],'unmanaged':_0x1e5562[_0xd63f('0x2e')],'abandoned':_0x1e5562[_0xd63f('0x2f')],'waiting':_0x1e5562['waiting'],'loggedInDb':_0x1e5562['loggedInDb']};if(_0x1e5562['type']==='outbound'){_0xa7a080[_0xd63f('0x30')]=_0x1e5562['dialActive'];_0xa7a080[_0xd63f('0x31')]=_0x1e5562[_0xd63f('0x31')];_0xa7a080['dialOriginateCallerIdName']=_0x1e5562[_0xd63f('0x32')];_0xa7a080[_0xd63f('0x33')]=_0x1e5562[_0xd63f('0x33')];_0xa7a080['dialOriginateTimeout']=_0x1e5562[_0xd63f('0x34')];_0xa7a080['dialPrefix']=_0x1e5562[_0xd63f('0x35')];_0xa7a080[_0xd63f('0x36')]=_0x1e5562['outboundAnswerAgiCallsDay'];_0xa7a080[_0xd63f('0x37')]=_0x1e5562[_0xd63f('0x37')];_0xa7a080[_0xd63f('0x38')]=_0x1e5562['outboundBlacklistCallsDay'];_0xa7a080['outboundBusyCallsDay']=_0x1e5562['outboundBusyCallsDay'];_0xa7a080[_0xd63f('0x39')]=_0x1e5562[_0xd63f('0x39')];_0xa7a080['outboundDropCallsDayACS']=_0x1e5562[_0xd63f('0x3a')];_0xa7a080[_0xd63f('0x3b')]=_0x1e5562[_0xd63f('0x3b')];_0xa7a080[_0xd63f('0x3c')]=_0x1e5562[_0xd63f('0x3c')];_0xa7a080[_0xd63f('0x3d')]=_0x1e5562[_0xd63f('0x3d')];_0xa7a080['outboundNoSuchCallsDay']=_0x1e5562[_0xd63f('0x3e')];_0xa7a080['outboundOriginateFailureCallsDay']=_0x1e5562['outboundOriginateFailureCallsDay'];_0xa7a080['outboundReCallsDay']=_0x1e5562[_0xd63f('0x3f')];_0xa7a080[_0xd63f('0x40')]=_0x1e5562[_0xd63f('0x40')];_0xa7a080[_0xd63f('0x41')]=_0x1e5562['outboundUnknownCallsDay'];_0xa7a080[_0xd63f('0x42')]=_0x1e5562[_0xd63f('0x42')];_0xa7a080[_0xd63f('0x43')]=_0x1e5562[_0xd63f('0x43')];_0xa7a080['predictiveIntervalAvgTalktime']=_0x1e5562[_0xd63f('0x44')];_0xa7a080['predictiveIntervalDroppedCallsCallersExit']=_0x1e5562[_0xd63f('0x45')];_0xa7a080[_0xd63f('0x46')]=_0x1e5562[_0xd63f('0x46')];_0xa7a080['predictiveIntervalErlangCalls']=_0x1e5562[_0xd63f('0x47')];_0xa7a080[_0xd63f('0x48')]=_0x1e5562[_0xd63f('0x48')];_0xa7a080[_0xd63f('0x49')]=_0x1e5562[_0xd63f('0x49')];_0xa7a080[_0xd63f('0x4a')]=_0x1e5562['predictiveIntervalMultiplicativeFactor'];_0xa7a080[_0xd63f('0x4b')]=_0x1e5562[_0xd63f('0x4b')];_0xa7a080['predictiveIntervalAvailable']=_0x1e5562[_0xd63f('0x4c')];_0xa7a080['predictiveIntervalTotalCalls']=_0x1e5562[_0xd63f('0x4d')];_0xa7a080[_0xd63f('0x22')]=_0x1e5562['message'];_0xa7a080[_0xd63f('0x4e')]=_0x1e5562[_0xd63f('0x4e')];_0xa7a080[_0xd63f('0x4f')]=_0x1e5562[_0xd63f('0x4f')];_0xa7a080['erlangCallToSecond']=_0x1e5562[_0xd63f('0x50')];_0xa7a080[_0xd63f('0x51')]=_0x1e5562[_0xd63f('0x51')];_0xa7a080['erlangBusyFactor']=_0x1e5562['erlangBusyFactor'];_0xa7a080[_0xd63f('0x52')]=_0x1e5562['startPredictive'];_0xa7a080[_0xd63f('0x53')]=_0x1e5562['startProgressive'];}if(_0x1e5562[_0xd63f('0x54')]){_0xa7a080[_0xd63f('0x54')]={'id':_0x1e5562[_0xd63f('0x54')]['id'],'name':_0x1e5562[_0xd63f('0x54')][_0xd63f('0xb')],'active':_0x1e5562[_0xd63f('0x54')]['active'],'callerid':_0x1e5562[_0xd63f('0x54')][_0xd63f('0x55')]};}if(_0x1e5562[_0xd63f('0x56')]){_0xa7a080[_0xd63f('0x56')]={'id':_0x1e5562[_0xd63f('0x56')]['id'],'name':_0x1e5562[_0xd63f('0x56')][_0xd63f('0xb')]};}_0x3562da[_0xd63f('0x57')](_0xa7a080);}}_0x13bc28({'count':_0x3562da[_0xd63f('0x58')],'rows':_0x3562da});});},'VoiceChannels':function(_0x593086){return new Promise(function(_0x5c1290,_0x3d72f9){var _0x4367ec=_['values'](_0x4f7baf[_0xd63f('0x59')]);_0x5c1290({'count':_0x4367ec[_0xd63f('0x58')],'rows':_0x4367ec});});},'VoiceChannelMixMonitor':function(_0x21fb83){var _0x2b88f7=this;return new Promise(function(_0x340bc2,_0x291f53){if(ami[_0xd63f('0x1c')]()==![]){return _0x291f53(_0x2b88f7[_0xd63f('0x12')](0x1f4,[config[_0xd63f('0x13')]['ip'],config[_0xd63f('0x13')]['username'],_0xd63f('0x14')][_0xd63f('0x15')]('\x20')));}var _0x4fcfee=schema(properties[_0xd63f('0x5a')])[_0xd63f('0x5b')](_0x21fb83);if(_0x4fcfee[_0xd63f('0x58')]>0x0){return _0x291f53(_0x2b88f7[_0xd63f('0x12')](0x1f4,_[_0xd63f('0x5c')](_0x4fcfee,'message')[_0xd63f('0x15')](',\x20')));}var _0x44d0e2=_[_0xd63f('0x5d')](_0x4f7baf[_0xd63f('0x59')],{'uniqueid':_0x21fb83[_0xd63f('0x5e')]});if(_0x44d0e2&&_0x44d0e2[_0xd63f('0x5f')]){var _0x171f55=util[_0xd63f('0x8')]('%s.%s',_0x21fb83[_0xd63f('0x60')]||_0x21fb83[_0xd63f('0x5e')],_0x21fb83[_0xd63f('0x8')]||_0xd63f('0x61'));return ami[_0xd63f('0x19')]({'action':_0xd63f('0x62'),'channel':_0x44d0e2[_0xd63f('0x5f')],'file':_0x171f55,'options':_0xd63f('0x63')})[_0xd63f('0x1a')](function(_0xc35b8e){var _0x1e6ad4=_['find'](_0x44d0e2[_0xd63f('0x64')],{'filename':_0xd63f('0x65')+_0x171f55[_0xd63f('0x66')]()});if(_[_0xd63f('0x67')](_0x1e6ad4)){_0x44d0e2[_0xd63f('0x64')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0x171f55[_0xd63f('0x66')](),'createdAt':moment()[_0xd63f('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0xc35b8e[_0xd63f('0x68')],'status':_0xd63f('0x69')});}else{_0x1e6ad4['mixmonitorid']=_0xc35b8e['mixmonitorid'];_0x1e6ad4[_0xd63f('0x6a')]='rec';}_0x340bc2({'code':0xc8,'message':[_0x21fb83[_0xd63f('0x5e')],'MixMonitor\x20Success',_0xc35b8e[_0xd63f('0x68')]][_0xd63f('0x15')]('\x20'),'mixmonitorid':_0xc35b8e[_0xd63f('0x68')]});})[_0xd63f('0x1b')](function(_0x1b398f){_0x291f53(_0x2b88f7[_0xd63f('0x12')](0x1f5,[_0x21fb83['uniqueid'],_0x1b398f['message'][_0xd63f('0x66')]()][_0xd63f('0x15')]('\x20')));});}else{return _0x291f53(_0x2b88f7['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x4ff3c6){var _0x37a9c1=this;return new Promise(function(_0x1cbe21,_0x30db45){if(ami[_0xd63f('0x1c')]()==![]){return _0x30db45(_0x37a9c1[_0xd63f('0x12')](0x1f4,[config[_0xd63f('0x13')]['ip'],config[_0xd63f('0x13')]['username'],_0xd63f('0x14')][_0xd63f('0x15')]('\x20')));}var _0x4875de=schema(properties[_0xd63f('0x5a')])[_0xd63f('0x5b')](_0x4ff3c6);if(_0x4875de['length']>0x0){return _0x30db45(_0x37a9c1[_0xd63f('0x12')](0x1f4,_[_0xd63f('0x5c')](_0x4875de,_0xd63f('0x22'))[_0xd63f('0x15')](',\x20')));}var _0x2ac46b=_['find'](_0x4f7baf['channels'],{'uniqueid':_0x4ff3c6[_0xd63f('0x5e')]});if(_0x2ac46b){return BPromise['resolve']()[_0xd63f('0x1a')](function(){if(_0x2ac46b[_0xd63f('0x5f')]){return ami['Action']({'action':_0xd63f('0x6b'),'channel':_0x2ac46b['channel'],'mixmonitorid':_0x4ff3c6[_0xd63f('0x68')]})[_0xd63f('0x1b')](function(_0x379f71){});}})[_0xd63f('0x1a')](function(){if(_0x2ac46b[_0xd63f('0x6c')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x2ac46b['destinationchannel'],'mixmonitorid':_0x4ff3c6[_0xd63f('0x68')]})['catch'](function(_0x115275){});}})[_0xd63f('0x1a')](function(_0x10d3c0){var _0x16d891=_[_0xd63f('0x5d')](_0x2ac46b[_0xd63f('0x64')],{'mixmonitorid':_0x4ff3c6[_0xd63f('0x68')]});if(_0x16d891){_0x16d891[_0xd63f('0x6a')]=_0xd63f('0x6d');}})[_0xd63f('0x1a')](function(){var _0x533b9b=util[_0xd63f('0x8')](_0xd63f('0x6e'),_0x4ff3c6['filename']||_0x4ff3c6[_0xd63f('0x5e')],_0x4ff3c6[_0xd63f('0x8')]||'wav');var _0x5dfeab=_[_0xd63f('0x5d')](_0x2ac46b[_0xd63f('0x64')],{'filename':_0xd63f('0x65')+_0x533b9b[_0xd63f('0x66')]()});if(_0x5dfeab){_0x5dfeab[_0xd63f('0x6a')]='stop';}})[_0xd63f('0x1a')](function(){_0x1cbe21({'code':0xc8,'message':[_0x4ff3c6['uniqueid'],'StopMixMonitor\x20Success'][_0xd63f('0x15')]('\x20')});})['catch'](function(_0x566b03){_0x30db45(_0x37a9c1[_0xd63f('0x12')](0x1f5,[_0x4ff3c6[_0xd63f('0x5e')],_0x566b03[_0xd63f('0x22')]['toLowerCase']()][_0xd63f('0x15')]('\x20')));});}else{return _0x30db45(_0x37a9c1[_0xd63f('0x12')](0x1f5,_0xd63f('0x6f')));}});},'VoiceQueuesChannels':function(_0x58c247){return new Promise(function(_0x4af5e5,_0x48600b){var _0xe59f80=_[_0xd63f('0x70')](_0x4f7baf[_0xd63f('0x71')]);_0x4af5e5({'count':_0xe59f80['length'],'rows':_0xe59f80});});},'VoiceQueuesChannel':function(_0x1395fa){var _0x483638=this;return new Promise(function(_0xf1bb18,_0x2ddf86){var _0x606f1b=schema(properties[_0xd63f('0x72')])[_0xd63f('0x5b')](_0x1395fa);if(_0x606f1b[_0xd63f('0x58')]>0x0){return _0x2ddf86(_0x483638[_0xd63f('0x12')](0x1f4,_[_0xd63f('0x5c')](_0x606f1b,_0xd63f('0x22'))[_0xd63f('0x15')](',\x20')));}var _0x46f057=_[_0xd63f('0x5d')](_0x4f7baf[_0xd63f('0x71')],{'uniqueid':_0x1395fa[_0xd63f('0x5e')]});if(_0x46f057){_0xf1bb18(_0x46f057);}else{return _0x2ddf86(_0x483638[_0xd63f('0x12')](0x1f5,_0xd63f('0x6f')));}});},'VoiceQueuesChannelHangup':function(_0x23e54b){var _0x180d00=this;return new Promise(function(_0x10997e,_0x11d506){if(ami[_0xd63f('0x1c')]()==![]){return _0x11d506(_0x180d00[_0xd63f('0x12')](0x1f4,[config['asterisk']['ip'],config[_0xd63f('0x13')][_0xd63f('0x1d')],'ami\x20disconnected'][_0xd63f('0x15')]('\x20')));}var _0x347f4a=schema(properties[_0xd63f('0x73')])[_0xd63f('0x5b')](_0x23e54b);if(_0x347f4a['length']>0x0){return _0x11d506(_0x180d00['error'](0x1f4,_['map'](_0x347f4a,_0xd63f('0x22'))[_0xd63f('0x15')](',\x20')));}var _0x1a08c8=_[_0xd63f('0x5d')](_0x4f7baf[_0xd63f('0x71')],{'uniqueid':_0x23e54b['uniqueid']});if(_0x1a08c8&&_0x1a08c8[_0xd63f('0x5f')]){return ami[_0xd63f('0x19')]({'action':_0xd63f('0x74'),'channel':_0x1a08c8[_0xd63f('0x5f')]})[_0xd63f('0x1a')](function(_0x2b35f3){_0x10997e({'code':0xc8,'message':[_0x23e54b[_0xd63f('0x5e')],_0x2b35f3[_0xd63f('0x22')][_0xd63f('0x66')]()][_0xd63f('0x15')]('\x20')});})[_0xd63f('0x1b')](function(_0xafcb7){_0x11d506(_0x180d00['error'](0x1f5,[_0x23e54b[_0xd63f('0x5e')],_0xafcb7['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x11d506(_0x180d00[_0xd63f('0x12')](0x1f5,_0xd63f('0x6f')));}});},'VoiceQueuesChannelRedirect':function(_0x14e392){var _0x1c05a7=this;return new Promise(function(_0x4be108,_0x5de8ce){if(ami[_0xd63f('0x1c')]()==![]){return _0x5de8ce(_0x1c05a7[_0xd63f('0x12')](0x1f4,[config['asterisk']['ip'],config[_0xd63f('0x13')][_0xd63f('0x1d')],_0xd63f('0x14')]['join']('\x20')));}var _0x4eb546=schema(properties[_0xd63f('0x75')])[_0xd63f('0x5b')](_0x14e392);if(_0x4eb546[_0xd63f('0x58')]>0x0){return _0x5de8ce(_0x1c05a7[_0xd63f('0x12')](0x1f4,_[_0xd63f('0x5c')](_0x4eb546,_0xd63f('0x22'))['join'](',\x20')));}var _0xfe0b8f=_[_0xd63f('0x5d')](_0x4f7baf['queueChannels'],{'uniqueid':_0x14e392[_0xd63f('0x5e')]});if(_0xfe0b8f&&_0xfe0b8f[_0xd63f('0x5f')]){return ami[_0xd63f('0x19')]({'action':_0xd63f('0x76'),'channel':_0xfe0b8f[_0xd63f('0x5f')],'exten':_0x14e392['exten'],'context':_0x14e392[_0xd63f('0x77')]||_0xfe0b8f[_0xd63f('0x77')],'priority':0x1})[_0xd63f('0x1a')](function(_0x38a44c){_0x4be108({'code':0xc8,'message':[_0x14e392['uniqueid'],_0x38a44c[_0xd63f('0x22')]['toLowerCase']()][_0xd63f('0x15')]('\x20')});})[_0xd63f('0x1b')](function(_0x190d23){_0x5de8ce(_0x1c05a7[_0xd63f('0x12')](0x1f5,[_0x14e392[_0xd63f('0x5e')],_0x190d23['message'][_0xd63f('0x66')]()]['join']('\x20')));});}else{return _0x5de8ce(_0x1c05a7[_0xd63f('0x12')](0x1f5,_0xd63f('0x6f')));}});},'Agents':function(_0x470a5b){return new Promise(function(_0x5d96c2,_0x245b41){var _0x422966=_['values'](_0x4f7baf[_0xd63f('0xe')]);_0x5d96c2({'count':_0x422966['length'],'rows':_0x422966});});},'Telephones':function(_0x2fe8d3){return new Promise(function(_0x3dfced,_0x1f7d1b){var _0x4b57e1=_[_0xd63f('0x70')](_0x4f7baf[_0xd63f('0x78')]);_0x3dfced({'count':_0x4b57e1[_0xd63f('0x58')],'rows':_0x4b57e1});});},'Trunks':function(_0x292d22){return new Promise(function(_0x4d75d6,_0x184e8c){var _0x5de70b=_['values'](_0x4f7baf[_0xd63f('0x79')]);_0x4d75d6({'count':_0x5de70b['length'],'rows':_0x5de70b});});},'OutboundChannels':function(_0x1dc0dc){return new Promise(function(_0x4e1f53,_0x1b97ca){var _0x5a44fe=_['values'](_0x4f7baf[_0xd63f('0x7a')]);_0x4e1f53({'count':_0x5a44fe[_0xd63f('0x58')],'rows':_0x5a44fe});});},'Outbound':function(_0x42bba1){return new Promise(function(_0x12dcbc,_0x2b476b){_0x12dcbc(_0x4f7baf[_0xd63f('0x7b')]);});},'Campaigns':function(_0x5c1121){return new Promise(function(_0x823dff,_0x468f93){var _0x3d69ca=_[_0xd63f('0x70')](_0x4f7baf['campaigns']);_0x823dff({'count':_0x3d69ca[_0xd63f('0x58')],'rows':_0x3d69ca});});},'VoiceQueuesPreview':function(_0x18b760){var _0x47abe7=this;return new Promise(function(_0x4e5208,_0x10999a){_0x1c73bc[_0xd63f('0x7c')](_0x18b760['id'])[_0xd63f('0x1a')](function(_0x34eec4){_0x4e5208({'code':0xc8,'message':_0x34eec4['message']});})[_0xd63f('0x1b')](function(_0x54d67d){_0x10999a(_0x47abe7[_0xd63f('0x12')](0x1f4,_0x54d67d[_0xd63f('0x22')]));});});},'EventManager':function(_0x5a2168){var _0x343d17=this;return new Promise(function(_0x42a43a,_0x11f954){if(!_0x5a2168[_0xd63f('0x7d')]){return _0x11f954(_0x343d17['error'](0x1f4,_0xd63f('0x7e')));}ami[_0xd63f('0x7f')](_0xd63f('0x80')+_0x5a2168[_0xd63f('0x7d')],_0x5a2168[_0xd63f('0x22')]);_0x42a43a({'code':0xc8,'message':_0x5a2168});});},'FaxAccounts':function(_0x262390){return new Promise(function(_0x1fbda9,_0x59f5b2){var _0x1e37a4=_[_0xd63f('0x70')](_0x4f7baf[_0xd63f('0x81')]);_0x1fbda9({'count':_0x1e37a4[_0xd63f('0x58')],'rows':_0x1e37a4});});},'SendFax':function(_0x40bb3b){var _0x189275=this;return new Promise(function(_0x522d72,_0x8994dd){_0x2663a2[_0xd63f('0x82')](_0x40bb3b)[_0xd63f('0x1a')](function(_0x273a23){_0x522d72({'code':0xc8,'message':_0x273a23[_0xd63f('0x22')]});})[_0xd63f('0x1b')](function(_0x3b38ff){_0x8994dd(_0x189275[_0xd63f('0x12')](0x1f4,_0x3b38ff[_0xd63f('0x22')]));});});},'CheckAfterSend':function(_0x2dc18c){var _0x273f38=this;return new Promise(function(_0x46bf40,_0x4193c4){_0x2663a2['checkAfterSend'](_0x2dc18c)[_0xd63f('0x1a')](function(_0x489a2f){_0x46bf40({'code':0xc8,'message':_0x489a2f['message']});})[_0xd63f('0x1b')](function(_0x437886){_0x4193c4(_0x273f38[_0xd63f('0x12')](0x1f4,_0x437886[_0xd63f('0x22')]));});});}};var _0x2afff5=jayson['server'](_0x154478)['http']();_0x2afff5['on'](_0xd63f('0x12'),function(_0x2a5804){return _0x1bc2b7(_0x2a5804);});_0x2afff5['listen'](0x232a,_0xd63f('0x83'),function(){console[_0xd63f('0x84')](_0xd63f('0x85'),0x232a);return _0x134211(_0xd63f('0x86')+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 687156b..5861a68 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 _0xd386=['data2','data1','calleridnum','calleridname','','firstName','destcalleridname','destcalleridnum','uniqueid','resolve','then','omit','xmd-contactid2','format','user:%s','name','trigger:%s','action','createContact','toLowerCase','merge','error','Error\x20creating\x20contact','bluebird','util','lodash','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','emit','autoCreate'];(function(_0x35ce8b,_0x2df0a2){var _0x3ef115=function(_0x483481){while(--_0x483481){_0x35ce8b['push'](_0x35ce8b['shift']());}};_0x3ef115(++_0x2df0a2);}(_0xd386,0x10c));var _0x6d38=function(_0x3a9707,_0x3d19c8){_0x3a9707=_0x3a9707-0x0;var _0x2fb6aa=_0xd386[_0x3a9707];return _0x2fb6aa;};'use strict';var BPromise=require(_0x6d38('0x0'));var util=require(_0x6d38('0x1'));var _=require(_0x6d38('0x2'));var Redis=require('ioredis');var config=require(_0x6d38('0x3'));var logger=require(_0x6d38('0x4'))('trigger');var cmContactRpc=require(_0x6d38('0x5'));config[_0x6d38('0x6')]=_[_0x6d38('0x7')](config[_0x6d38('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x6d38('0x8'))(new Redis(config[_0x6d38('0x6')]));function emit(_0x1b2038,_0x83823e,_0x2b742c){logger[_0x6d38('0x9')](_0x1b2038,_0x83823e,JSON['stringify'](_0x2b742c));io['to'](_0x1b2038)[_0x6d38('0xa')](_0x83823e,_0x2b742c);}exports['exec']=function(_0x274898,_0x4909e0,_0x171f76){_0x171f76[_0x6d38('0xb')]=0x0;if(_0x4909e0[_0x6d38('0xc')]&&parseInt(_0x4909e0['data2'],0xa)){var _0x91b33d={'ListId':parseInt(_0x4909e0[_0x6d38('0xd')],0xa),'phone':_0x171f76[_0x6d38('0xe')]};if(_['isNil'](_0x171f76['routeId'])){_0x91b33d['firstName']=_0x171f76[_0x6d38('0xf')]&&_0x171f76[_0x6d38('0xf')]!==_0x6d38('0x10')?_0x171f76[_0x6d38('0xf')]:_0x171f76[_0x6d38('0xe')]||_0x171f76['uniqueid'];}else{_0x91b33d[_0x6d38('0x11')]=_0x171f76[_0x6d38('0x12')]&&_0x171f76[_0x6d38('0x12')]!==_0x6d38('0x10')?_0x171f76[_0x6d38('0x12')]:_0x171f76[_0x6d38('0x13')]||_0x171f76[_0x6d38('0x14')];_0x91b33d['phone']=_0x171f76['destcalleridname']&&_0x171f76['destcalleridname']!==_0x6d38('0x10')?_0x171f76[_0x6d38('0x12')]:_0x171f76[_0x6d38('0x13')]||_0x171f76[_0x6d38('0x14')];}BPromise[_0x6d38('0x15')]()[_0x6d38('0x16')](cmContactRpc['showContact']({'where':_[_0x6d38('0x17')](_0x91b33d,[_0x6d38('0x11')])}))[_0x6d38('0x16')](function(_0x458a11){if(_0x458a11){_0x171f76[_0x6d38('0x18')]=_0x458a11['id'];emit(util[_0x6d38('0x19')](_0x6d38('0x1a'),_0x274898[_0x6d38('0x1b')]),util['format'](_0x6d38('0x1c'),_0x4909e0[_0x6d38('0x1d')]['toLowerCase']()),_['merge'](_0x171f76,{'ListId':parseInt(_0x4909e0[_0x6d38('0xd')],0xa)}));return;}else{return BPromise[_0x6d38('0x15')]()[_0x6d38('0x16')](cmContactRpc[_0x6d38('0x1e')](_0x91b33d));}})['then'](function(_0x2527d1){if(_0x2527d1){_0x171f76['xmd-contactid2']=_0x2527d1['id'];emit(util[_0x6d38('0x19')]('user:%s',_0x274898[_0x6d38('0x1b')]),util['format'](_0x6d38('0x1c'),_0x4909e0[_0x6d38('0x1d')][_0x6d38('0x1f')]()),_[_0x6d38('0x20')](_0x171f76,{'ListId':parseInt(_0x4909e0[_0x6d38('0xd')],0xa)}));}})['catch'](function(_0x5dfb0c){logger[_0x6d38('0x21')](_0x6d38('0x22'),JSON['stringify'](_0x5dfb0c));});}else{if(_0x274898){emit(util['format'](_0x6d38('0x1a'),_0x274898['name']),util['format'](_0x6d38('0x1c'),_0x4909e0[_0x6d38('0x1d')][_0x6d38('0x1f')]()),_[_0x6d38('0x20')]({'ListId':parseInt(_0x4909e0[_0x6d38('0xd')],0xa)},_0x171f76));}}}; \ No newline at end of file +var _0xe056=['trigger','redis','defaults','info','stringify','emit','exec','autoCreate','data2','data1','isNil','routeId','firstName','calleridname','','calleridnum','uniqueid','destcalleridname','destcalleridnum','phone','then','showContact','omit','xmd-contactid2','name','format','trigger:%s','action','toLowerCase','merge','resolve','createContact','catch','error','lodash','ioredis','../../../../config/environment'];(function(_0x21ae22,_0x54911f){var _0x1e610a=function(_0x1d2cef){while(--_0x1d2cef){_0x21ae22['push'](_0x21ae22['shift']());}};_0x1e610a(++_0x54911f);}(_0xe056,0xdb));var _0x6e05=function(_0x36feb2,_0x53abef){_0x36feb2=_0x36feb2-0x0;var _0x292b43=_0xe056[_0x36feb2];return _0x292b43;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x6e05('0x0'));var Redis=require(_0x6e05('0x1'));var config=require(_0x6e05('0x2'));var logger=require('../../../../config/logger')(_0x6e05('0x3'));var cmContactRpc=require('../../rpc/cmContact');config[_0x6e05('0x4')]=_[_0x6e05('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6e05('0x4')]));function emit(_0x390bb6,_0x1c78eb,_0x5dacb2){logger[_0x6e05('0x6')](_0x390bb6,_0x1c78eb,JSON[_0x6e05('0x7')](_0x5dacb2));io['to'](_0x390bb6)[_0x6e05('0x8')](_0x1c78eb,_0x5dacb2);}exports[_0x6e05('0x9')]=function(_0x13af56,_0x52b72b,_0x330e12){_0x330e12[_0x6e05('0xa')]=0x0;if(_0x52b72b[_0x6e05('0xb')]&&parseInt(_0x52b72b[_0x6e05('0xb')],0xa)){var _0x151dfa={'ListId':parseInt(_0x52b72b[_0x6e05('0xc')],0xa),'phone':_0x330e12['calleridnum']};if(_[_0x6e05('0xd')](_0x330e12[_0x6e05('0xe')])){_0x151dfa[_0x6e05('0xf')]=_0x330e12['calleridname']&&_0x330e12[_0x6e05('0x10')]!==_0x6e05('0x11')?_0x330e12[_0x6e05('0x10')]:_0x330e12[_0x6e05('0x12')]||_0x330e12[_0x6e05('0x13')];}else{_0x151dfa['firstName']=_0x330e12[_0x6e05('0x14')]&&_0x330e12[_0x6e05('0x14')]!==''?_0x330e12['destcalleridname']:_0x330e12[_0x6e05('0x15')]||_0x330e12[_0x6e05('0x13')];_0x151dfa[_0x6e05('0x16')]=_0x330e12['destcalleridname']&&_0x330e12[_0x6e05('0x14')]!==''?_0x330e12[_0x6e05('0x14')]:_0x330e12[_0x6e05('0x15')]||_0x330e12['uniqueid'];}BPromise['resolve']()[_0x6e05('0x17')](cmContactRpc[_0x6e05('0x18')]({'where':_[_0x6e05('0x19')](_0x151dfa,[_0x6e05('0xf')])}))[_0x6e05('0x17')](function(_0x5e2873){if(_0x5e2873){_0x330e12[_0x6e05('0x1a')]=_0x5e2873['id'];emit(util['format']('user:%s',_0x13af56[_0x6e05('0x1b')]),util[_0x6e05('0x1c')](_0x6e05('0x1d'),_0x52b72b[_0x6e05('0x1e')][_0x6e05('0x1f')]()),_[_0x6e05('0x20')](_0x330e12,{'ListId':parseInt(_0x52b72b[_0x6e05('0xc')],0xa)}));return;}else{return BPromise[_0x6e05('0x21')]()['then'](cmContactRpc[_0x6e05('0x22')](_0x151dfa));}})['then'](function(_0x1001ae){if(_0x1001ae){_0x330e12[_0x6e05('0x1a')]=_0x1001ae['id'];emit(util[_0x6e05('0x1c')]('user:%s',_0x13af56['name']),util[_0x6e05('0x1c')]('trigger:%s',_0x52b72b[_0x6e05('0x1e')][_0x6e05('0x1f')]()),_[_0x6e05('0x20')](_0x330e12,{'ListId':parseInt(_0x52b72b[_0x6e05('0xc')],0xa)}));}})[_0x6e05('0x23')](function(_0x19f3a6){logger[_0x6e05('0x24')]('Error\x20creating\x20contact',JSON[_0x6e05('0x7')](_0x19f3a6));});}else{if(_0x13af56){emit(util[_0x6e05('0x1c')]('user:%s',_0x13af56[_0x6e05('0x1b')]),util[_0x6e05('0x1c')]('trigger:%s',_0x52b72b['action'][_0x6e05('0x1f')]()),_['merge']({'ListId':parseInt(_0x52b72b[_0x6e05('0xc')],0xa)},_0x330e12));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 53691ee..772425d 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 _0xbd33=['./script','../rpc/cmContact','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','prototype','info','stringify','emit','clone','checkTriggers','interface','hasOwnProperty','checkTrigger','merge','variables','length','Actions','action','toLowerCase','contactmanager','browser','popup','html','data2','buildUri','data3','isNil','data4','location','data5','800','data6','600','winApplication','render','winArguments','format','user:%s','trigger:%s:%s','data1','jscripty','name','trigger:%s','integration','exec','queue','urlforward','script','parse','query','search','AllConditions','every','AnyConditions','some','checkConditions','channel','field','account','ChatWebsiteId','operator','value','upperFirst','AccountId','message','event','membername','lastevent','routeId','exports','lodash','mustache','ioredis','./integration','./cmContact'];(function(_0x181e57,_0x468816){var _0x29180c=function(_0x138fca){while(--_0x138fca){_0x181e57['push'](_0x181e57['shift']());}};_0x29180c(++_0x468816);}(_0xbd33,0x13f));var _0x3bd3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbd33[_0x20a584];return _0x4b41a8;};'use strict';var util=require('util');var _=require(_0x3bd3('0x0'));var url=require('url');var Mustache=require(_0x3bd3('0x1'));var Redis=require(_0x3bd3('0x2'));var urlforward=require('./urlforward');var integration=require(_0x3bd3('0x3'));var cmContact=require(_0x3bd3('0x4'));var script=require(_0x3bd3('0x5'));var cmContactRpc=require(_0x3bd3('0x6'));var config=require(_0x3bd3('0x7'));var logger=require(_0x3bd3('0x8'))('trigger');var ami=require('../ami');config[_0x3bd3('0x9')]=_[_0x3bd3('0xa')](config[_0x3bd3('0x9')],{'host':_0x3bd3('0xb'),'port':0x18eb});var io=require(_0x3bd3('0xc'))(new Redis(config[_0x3bd3('0x9')]));var operators={'equals':function(_0x111cc2,_0x53b299){return _0x111cc2==_0x53b299;},'not_equals':function(_0x45e83f,_0x55dbd8){return _0x45e83f!=_0x55dbd8;}};var barAndWebActions=['popup',_0x3bd3('0xd'),_0x3bd3('0xe')];function Trigger(_0x4c40b5){this[_0x3bd3('0xf')]=_0x4c40b5[_0x3bd3('0xf')];this[_0x3bd3('0x10')]=_0x4c40b5[_0x3bd3('0x10')];this[_0x3bd3('0x11')]=_0x4c40b5['voiceQueues'];this['templates']=_0x4c40b5[_0x3bd3('0x12')];this[_0x3bd3('0x13')]=_0x4c40b5[_0x3bd3('0x13')];this[_0x3bd3('0x14')]=_0x4c40b5[_0x3bd3('0x14')];this['freshdeskAccounts']=_0x4c40b5[_0x3bd3('0x15')];this[_0x3bd3('0x16')]=_0x4c40b5['salesforceAccounts'];this[_0x3bd3('0x17')]=_0x4c40b5['sugarcrmAccounts'];this[_0x3bd3('0x18')]=_0x4c40b5[_0x3bd3('0x18')];this['deskAccounts']=_0x4c40b5[_0x3bd3('0x19')];this[_0x3bd3('0x1a')]=_0x4c40b5[_0x3bd3('0x1a')];this['servicenowAccounts']=_0x4c40b5[_0x3bd3('0x1b')];this[_0x3bd3('0x1c')]=_0x4c40b5[_0x3bd3('0x1c')];this[_0x3bd3('0x1d')]={'zendesk':this[_0x3bd3('0x14')],'salesforce':this[_0x3bd3('0x16')],'freshdesk':this[_0x3bd3('0x15')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x3bd3('0x18')],'desk':this['deskAccounts'],'vtiger':this[_0x3bd3('0x1a')],'servicenow':this[_0x3bd3('0x1b')],'dynamics365':this['dynamics365Accounts']};ami['on'](_0x3bd3('0x1e'),this[_0x3bd3('0x1f')][_0x3bd3('0x20')](this));ami['on'](_0x3bd3('0x21'),this['syncCustomEvent'][_0x3bd3('0x20')](this));ami['on'](_0x3bd3('0x22'),this['syncCustomEvent'][_0x3bd3('0x20')](this));ami['on'](_0x3bd3('0x23'),this[_0x3bd3('0x1f')][_0x3bd3('0x20')](this));ami['on'](_0x3bd3('0x24'),this[_0x3bd3('0x1f')]['bind'](this));ami['on'](_0x3bd3('0x25'),this[_0x3bd3('0x26')][_0x3bd3('0x20')](this));ami['on'](_0x3bd3('0x27'),this[_0x3bd3('0x26')][_0x3bd3('0x20')](this));ami['on'](_0x3bd3('0x28'),this[_0x3bd3('0x26')][_0x3bd3('0x20')](this));ami['on']('custom:newinteraction',this[_0x3bd3('0x1f')][_0x3bd3('0x20')](this));ami['on'](_0x3bd3('0x29'),this[_0x3bd3('0x1f')][_0x3bd3('0x20')](this));ami['on']('custom:incomingmessage',this[_0x3bd3('0x1f')][_0x3bd3('0x20')](this));ami['on']('custom:outgoingmessage',this[_0x3bd3('0x1f')][_0x3bd3('0x20')](this));ami['on']('custom:acceptmessage',this[_0x3bd3('0x1f')][_0x3bd3('0x20')](this));ami['on']('custom:rejectmessage',this['syncCustomEvent'][_0x3bd3('0x20')](this));}Trigger[_0x3bd3('0x2a')]['emit']=function(_0x23c00c,_0x3b37f4,_0x603e99){logger[_0x3bd3('0x2b')](_0x23c00c,_0x3b37f4,JSON[_0x3bd3('0x2c')](_0x603e99));io['to'](_0x23c00c)[_0x3bd3('0x2d')](_0x3b37f4,_0x603e99);};Trigger['prototype']['syncCustomEvent']=function(_0x49245e){var _0x1c1ef9=_[_0x3bd3('0x2e')](_0x49245e);this[_0x3bd3('0x2f')](_0x1c1ef9);};Trigger[_0x3bd3('0x2a')][_0x3bd3('0x26')]=function(_0x3eb95f){if(this['agents'][_0x3eb95f[_0x3bd3('0x30')]]){this[_0x3bd3('0x1f')](_0x3eb95f);}};Trigger[_0x3bd3('0x2a')][_0x3bd3('0x2f')]=function(_0x460675){var _0x21d9f5;for(var _0x143440 in this[_0x3bd3('0xf')]){if(this[_0x3bd3('0xf')][_0x3bd3('0x31')](_0x143440)){if(this[_0x3bd3('0xf')][_0x143440]['status']){_0x21d9f5=this[_0x3bd3('0x32')](this[_0x3bd3('0xf')][_0x143440],_0x460675);if(_0x21d9f5){_[_0x3bd3('0x33')](_0x460675,_0x460675[_0x3bd3('0x34')]);for(var _0x4f9826=0x0,_0x959750,_0x4e880b,_0x12661a;_0x4f98260x0){_0x2428b2=_[_0x0ae6('0x2f')](_0x2533c2,_0x4df796);}return _0x2428b2;}function getCustomFields(_0x232fbd,_0x14eed5){var _0x257af5=[];var _0x4fc7bd={'custom_fields':{}};if(_0x232fbd['length']>0x0){_[_0x0ae6('0x30')](_0x232fbd,function(_0x419384){if(_0x419384['type']==='string'&&_0x419384[_0x0ae6('0x31')]&&!_0x419384[_0x0ae6('0x32')]){_0x4fc7bd[_0x419384[_0x0ae6('0x31')][_0x0ae6('0x33')]()]=_0x419384['content'][_0x0ae6('0x34')]();}else if(_0x419384[_0x0ae6('0x35')]===_0x0ae6('0x36')&&_0x419384['idField']&&_0x419384[_0x0ae6('0x32')]){_0x4fc7bd[_0x0ae6('0x37')][_0x419384[_0x0ae6('0x38')]]=_0x419384[_0x0ae6('0x39')][_0x0ae6('0x34')]();}else if(_0x419384[_0x0ae6('0x35')]===_0x0ae6('0x3a')&&_0x419384[_0x0ae6('0x3b')]&&_0x419384[_0x0ae6('0x38')]&&_0x419384[_0x0ae6('0x32')]){_0x14eed5[_0x419384['variableName']]&&(_0x4fc7bd[_0x0ae6('0x37')][_0x419384[_0x0ae6('0x38')]]=_0x14eed5[_0x419384['variableName']][_0x0ae6('0x34')]());}else if(_0x419384[_0x0ae6('0x35')]===_0x0ae6('0x3c')&&_0x419384['Variable']&&_0x419384[_0x0ae6('0x3d')]['name']&&_0x419384['idField']&&_0x419384[_0x0ae6('0x32')]){_0x14eed5[_0x419384[_0x0ae6('0x3d')][_0x0ae6('0x3e')][_0x0ae6('0x33')]()]&&(_0x4fc7bd[_0x0ae6('0x37')][_0x419384['idField']]=_0x14eed5[_0x419384['Variable'][_0x0ae6('0x3e')]['toLowerCase']()][_0x0ae6('0x34')]());}});}if(_0x4fc7bd['priority']){_0x4fc7bd[_0x0ae6('0x3f')]=Number(_0x4fc7bd['priority']);}return _0x4fc7bd;}function getTicket(_0x7998e3,_0x1640e4,_0x6b8cf5,_0x2204e5,_0x5be17f){logger['info'](_0x0ae6('0x40'));var _0x34b547=_[_0x0ae6('0x41')]({'subject':intUtil['getString'](_0x2204e5[_0x0ae6('0x42')],_0x5be17f,'\x20'),'type':'phone','status':_0x0ae6('0x43'),'labels':[_0x0ae6('0x44'),_0x0ae6('0x45'),_0x0ae6('0x46')][_0x0ae6('0x47')](getTags(_0x2204e5[_0x0ae6('0x48')],'name')),'description':intUtil[_0x0ae6('0x49')](_0x2204e5[_0x0ae6('0x4a')],_0x5be17f,'\x0a'),'_links':{'assigned_user':{'href':util[_0x0ae6('0xe')](_0x0ae6('0x4b'),_0x1640e4['id']),'class':_0x0ae6('0x4c')}},'message':{'direction':'in','body':intUtil[_0x0ae6('0x49')](_0x2204e5[_0x0ae6('0x4a')],_0x5be17f,'\x0a')}},getCustomFields(_0x2204e5[_0x0ae6('0x4d')],_0x5be17f));return request({'uri':util['format'](_0x0ae6('0x4e'),_0x7998e3[_0x0ae6('0x10')],_0x6b8cf5['id']),'method':_0x0ae6('0x2c'),'body':_0x34b547});}exports[_0x0ae6('0x4f')]=function(_0x41721b,_0x167ed1,_0x24c021,_0x21431e,_0xb38cbb,_0x156841){var _0x3ffeee,_0x1a3327;_0x156841[_0x0ae6('0x10')]=intUtil[_0x0ae6('0x50')](_0x156841[_0x0ae6('0x10')]);_0x156841[_0x0ae6('0x51')]=intUtil[_0x0ae6('0x50')](_0x156841[_0x0ae6('0x51')]);if(_0xb38cbb&&_0xb38cbb['monitor_format']){logger[_0x0ae6('0x16')](_0x0ae6('0x52'),_0x0ae6('0x53'));_0x167ed1[_0x0ae6('0x54')]=util[_0x0ae6('0xe')](_0x0ae6('0x55'),_0x156841['serverUrl'],_0x167ed1[_0x0ae6('0x56')],md5(_0x167ed1[_0x0ae6('0x56')]));}else{_0x167ed1[_0x0ae6('0x54')]='';}headers[_0x0ae6('0x57')]=getAuth(_0x156841);return getUser(_0x156841,_0x21431e['email'])['then'](function(_0x4ed8f1){_0x3ffeee=_0x4ed8f1;logger[_0x0ae6('0x16')](_0x0ae6('0x58'),_0x3ffeee['id']);return getEndUser(_0x156841,_0x167ed1[_0x0ae6('0x59')],_0x167ed1['calleridnum']);})[_0x0ae6('0x11')](function(_0x17a674){_0x1a3327=_0x17a674;logger['info'](_0x0ae6('0x5a'),_0x1a3327['id']);return getTicket(_0x156841,_0x3ffeee,_0x1a3327,_0x24c021,_0x167ed1);})[_0x0ae6('0x11')](function(_0x4f26e0){if(_0x4f26e0){logger[_0x0ae6('0x16')](_0x0ae6('0x5b'));logger['info'](_0x0ae6('0x5c'),_0x4f26e0['id']);switch(_0x156841[_0x0ae6('0x35')]){case _0x0ae6('0x5d'):logger['info'](_0x0ae6('0x52'),_0x0ae6('0x5e'));emit(util[_0x0ae6('0xe')](_0x0ae6('0x5f'),_0x21431e[_0x0ae6('0x3e')]),_0x0ae6('0x60'),{'recordId':_0x4f26e0['id']});break;case _0x0ae6('0x61'):logger['info']('[QUEUE]',_0x0ae6('0x62'));emit(util[_0x0ae6('0xe')](_0x0ae6('0x5f'),_0x21431e['name']),_0x0ae6('0x63'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x4f26e0['id'])});break;default:logger[_0x0ae6('0x64')](_0x0ae6('0x52'),_0x0ae6('0x65'));}}})['catch'](function(_0x3ed447){console[_0x0ae6('0x64')](_0x3ed447);logger[_0x0ae6('0x64')](_0x0ae6('0x52'),JSON[_0x0ae6('0x1d')](_0x3ed447));});};exports[_0x0ae6('0x66')]=function(_0x9a64b8,_0x36be39,_0x102573,_0x117d24,_0x1cc515,_0x64d254,_0x17c71c){var _0x30cd09,_0x101187;_0x64d254['remoteUri']=intUtil['stripTrailingSlash'](_0x64d254[_0x0ae6('0x10')]);_0x64d254[_0x0ae6('0x51')]=intUtil[_0x0ae6('0x50')](_0x64d254[_0x0ae6('0x51')]);if(_0x17c71c&&_0x17c71c[_0x0ae6('0x67')]&&_0x17c71c[_0x0ae6('0x67')]!==_0x0ae6('0x68')){logger[_0x0ae6('0x16')](_0x0ae6('0x69'),_0x0ae6('0x53'));_0x36be39[_0x0ae6('0x54')]=util[_0x0ae6('0xe')](_0x0ae6('0x55'),_0x64d254[_0x0ae6('0x51')],_0x36be39[_0x0ae6('0x56')],md5(_0x36be39[_0x0ae6('0x56')]));}headers[_0x0ae6('0x57')]=getAuth(_0x64d254);return getUser(_0x64d254,_0x117d24[_0x0ae6('0x6a')])['then'](function(_0x26d313){_0x30cd09=_0x26d313;logger[_0x0ae6('0x16')](_0x0ae6('0x58'),_0x30cd09['id']);return getEndUser(_0x64d254,_0x36be39[_0x0ae6('0x6b')],_0x36be39[_0x0ae6('0x6c')]);})[_0x0ae6('0x11')](function(_0x3a8702){_0x101187=_0x3a8702;logger[_0x0ae6('0x16')](_0x0ae6('0x5a'),_0x101187['id']);return getTicket(_0x64d254,_0x30cd09,_0x101187,_0x102573,_0x36be39);})[_0x0ae6('0x11')](function(_0x5ec716){if(_0x5ec716){logger[_0x0ae6('0x16')](_0x0ae6('0x5b'));logger[_0x0ae6('0x16')](_0x0ae6('0x5c'),_0x5ec716['id']);switch(_0x64d254[_0x0ae6('0x35')]){case _0x0ae6('0x5d'):logger[_0x0ae6('0x16')](_0x0ae6('0x52'),_0x0ae6('0x5e'));emit(util['format']('user:%s',_0x117d24[_0x0ae6('0x3e')]),_0x0ae6('0x60'),{'recordId':_0x5ec716['id']});break;case'newTab':logger['info'](_0x0ae6('0x52'),_0x0ae6('0x62'));emit(util[_0x0ae6('0xe')](_0x0ae6('0x5f'),_0x117d24[_0x0ae6('0x3e')]),_0x0ae6('0x63'),{'uri':util[_0x0ae6('0xe')]('%s/agent/tickets/%s',_0x64d254[_0x0ae6('0x10')],_0x5ec716['id'])});break;default:logger['error'](_0x0ae6('0x69'),_0x0ae6('0x65'));}}})['catch'](function(_0x45f83a){logger[_0x0ae6('0x64')](_0x0ae6('0x69'),JSON['stringify'](_0x45f83a));});};exports[_0x0ae6('0x6d')]=function(_0x47ed1e,_0x23914d,_0x2e0a75,_0x19f63f,_0x12c43d,_0x54fff7){var _0x4d74f7,_0x3b8e6c;_0x54fff7[_0x0ae6('0x10')]=intUtil[_0x0ae6('0x50')](_0x54fff7[_0x0ae6('0x10')]);_0x54fff7[_0x0ae6('0x51')]=intUtil[_0x0ae6('0x50')](_0x54fff7['serverUrl']);if(_0x12c43d&&_0x12c43d['monitor_format']){logger[_0x0ae6('0x16')](_0x0ae6('0x6e'),_0x0ae6('0x53'));_0x23914d[_0x0ae6('0x54')]=util[_0x0ae6('0xe')](_0x0ae6('0x55'),_0x54fff7[_0x0ae6('0x51')],_0x23914d[_0x0ae6('0x56')],md5(_0x23914d['uniqueid']));}else{_0x23914d[_0x0ae6('0x54')]='';}headers[_0x0ae6('0x57')]=getAuth(_0x54fff7);return getUser(_0x54fff7)[_0x0ae6('0x11')](function(_0x7e222c){_0x4d74f7=_0x7e222c;logger[_0x0ae6('0x16')](_0x0ae6('0x58'),_0x4d74f7['id']);return getEndUser(_0x54fff7,_0x23914d['calleridname'],_0x23914d['calleridnum']);})[_0x0ae6('0x11')](function(_0x1e71d8){_0x3b8e6c=_0x1e71d8;logger['info'](_0x0ae6('0x5a'),_0x3b8e6c['id']);return getTicket(_0x54fff7,_0x4d74f7,_0x3b8e6c,_0x2e0a75,_0x23914d);})[_0x0ae6('0x11')](function(_0x3de39f){if(_0x3de39f){logger[_0x0ae6('0x16')]('Ticket\x20created!');logger[_0x0ae6('0x16')](_0x0ae6('0x5c'),_0x3de39f['id']);}})[_0x0ae6('0x6f')](function(_0x253c17){logger[_0x0ae6('0x64')](_0x0ae6('0x6e'),JSON[_0x0ae6('0x1d')](_0x253c17));});}; \ No newline at end of file +var _0x1399=['custom_fields','idField','type','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','xCALLY','Motion','CTI','Tags','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','uniqueid','email','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','catch','[OUTBOUND]','stringify','abandoned','[ABANDONED]','lodash','request-promise','util','./util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','socket.io-emitter','application/json','validateEmail','info','%s/users','remoteUri','then','total_entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','format','debug','[HTTP]','GET','basic','username','password','authType','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','map','forEach','nameField','customField','toLowerCase','content','string'];(function(_0x37ded3,_0x42f3f6){var _0x43911e=function(_0x95267f){while(--_0x95267f){_0x37ded3['push'](_0x37ded3['shift']());}};_0x43911e(++_0x42f3f6);}(_0x1399,0x16c));var _0x9139=function(_0x76fea7,_0x164167){_0x76fea7=_0x76fea7-0x0;var _0x3183c0=_0x1399[_0x76fea7];return _0x3183c0;};'use strict';var _=require(_0x9139('0x0'));var rp=require(_0x9139('0x1'));var md5=require('md5');var util=require(_0x9139('0x2'));var Redis=require('ioredis');var intUtil=require(_0x9139('0x3'));var config=require(_0x9139('0x4'));var logger=require(_0x9139('0x5'))(_0x9139('0x6'));config[_0x9139('0x7')]=_[_0x9139('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x9139('0x9'))(new Redis(config[_0x9139('0x7')]));function emit(_0x4d5d1e,_0x51832d,_0x11a03f){io['to'](_0x4d5d1e)['emit'](_0x51832d,_0x11a03f);}var headers={'Content-Type':'application/json','Accept':_0x9139('0xa')};function getUser(_0x385e2c,_0x4830cd){if(intUtil[_0x9139('0xb')](_0x4830cd)===!![]){logger[_0x9139('0xc')]('Getting\x20agent\x20with\x20email',_0x4830cd);return request({'uri':util['format'](_0x9139('0xd'),_0x385e2c[_0x9139('0xe')])})[_0x9139('0xf')](function(_0x27534d){if(_0x27534d[_0x9139('0x10')]){return _['find'](_0x27534d['_embedded']['entries'],{'email':_0x4830cd});}})[_0x9139('0xf')](function(_0x575828){if(_0x575828){logger[_0x9139('0xc')](_0x9139('0x11'));return _0x575828;}else{logger[_0x9139('0xc')](_0x9139('0x12'));return request({'uri':util['format'](_0x9139('0x13'),_0x385e2c['remoteUri'])});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x9139('0x14')](_0x9139('0x13'),_0x385e2c[_0x9139('0xe')])});}}function request(_0x3fadf7){logger[_0x9139('0x15')](_0x9139('0x16'),JSON['stringify'](_0x3fadf7));return rp(_['defaults'](_0x3fadf7,{'method':_0x9139('0x17'),'headers':headers,'json':!![]}));}function getAuth(_0xe39cbc){var _0x5e0a59;if(_0xe39cbc['authType']===_0x9139('0x18')){_0x5e0a59=util[_0x9139('0x14')]('%s:%s',_0xe39cbc[_0x9139('0x19')],_0xe39cbc[_0x9139('0x1a')]);}else if(_0xe39cbc[_0x9139('0x1b')]===_0x9139('0x1c')){_0x5e0a59=util[_0x9139('0x14')](_0x9139('0x1d'),_0xe39cbc[_0x9139('0x19')],_0xe39cbc[_0x9139('0x1c')]);}return util[_0x9139('0x14')](_0x9139('0x1e'),new Buffer(_0x5e0a59)[_0x9139('0x1f')](_0x9139('0x20')));}function getEndUser(_0x5a3e2e,_0x105170,_0x27f3e4){logger[_0x9139('0xc')](_0x9139('0x21'),_0x27f3e4);return request({'uri':util[_0x9139('0x14')](_0x9139('0x22'),_0x5a3e2e['remoteUri']),'qs':{'phone':_0x27f3e4}})[_0x9139('0xf')](function(_0x31c22d){if(_0x31c22d['total_entries']){logger[_0x9139('0xc')](_0x9139('0x23'));return _0x31c22d[_0x9139('0x24')]['entries'][0x0];}else{logger[_0x9139('0xc')](_0x9139('0x25'));return request({'uri':util['format'](_0x9139('0x26'),_0x5a3e2e[_0x9139('0xe')]),'method':_0x9139('0x27'),'body':{'first_name':_0x105170,'title':_0x105170,'phone_numbers':[{'type':'work','value':_0x27f3e4}]}});}});}function getTags(_0x1c4cda,_0x22e11e){var _0x2a35fd=[];if(_0x1c4cda&&_0x1c4cda[_0x9139('0x28')]>0x0){_0x2a35fd=_[_0x9139('0x29')](_0x1c4cda,_0x22e11e);}return _0x2a35fd;}function getCustomFields(_0x16dfb4,_0xfe6854){var _0x573a05=[];var _0x55cc6a={'custom_fields':{}};if(_0x16dfb4[_0x9139('0x28')]>0x0){_[_0x9139('0x2a')](_0x16dfb4,function(_0xd27355){if(_0xd27355['type']==='string'&&_0xd27355[_0x9139('0x2b')]&&!_0xd27355[_0x9139('0x2c')]){_0x55cc6a[_0xd27355[_0x9139('0x2b')][_0x9139('0x2d')]()]=_0xd27355[_0x9139('0x2e')]['toString']();}else if(_0xd27355['type']===_0x9139('0x2f')&&_0xd27355['idField']&&_0xd27355['customField']){_0x55cc6a[_0x9139('0x30')][_0xd27355[_0x9139('0x31')]]=_0xd27355['content'][_0x9139('0x1f')]();}else if(_0xd27355[_0x9139('0x32')]==='variable'&&_0xd27355[_0x9139('0x33')]&&_0xd27355[_0x9139('0x31')]&&_0xd27355[_0x9139('0x2c')]){_0xfe6854[_0xd27355[_0x9139('0x33')]]&&(_0x55cc6a[_0x9139('0x30')][_0xd27355[_0x9139('0x31')]]=_0xfe6854[_0xd27355[_0x9139('0x33')]][_0x9139('0x1f')]());}else if(_0xd27355[_0x9139('0x32')]===_0x9139('0x34')&&_0xd27355[_0x9139('0x35')]&&_0xd27355['Variable'][_0x9139('0x36')]&&_0xd27355[_0x9139('0x31')]&&_0xd27355['customField']){_0xfe6854[_0xd27355[_0x9139('0x35')][_0x9139('0x36')][_0x9139('0x2d')]()]&&(_0x55cc6a['custom_fields'][_0xd27355[_0x9139('0x31')]]=_0xfe6854[_0xd27355[_0x9139('0x35')][_0x9139('0x36')][_0x9139('0x2d')]()][_0x9139('0x1f')]());}});}if(_0x55cc6a[_0x9139('0x37')]){_0x55cc6a[_0x9139('0x37')]=Number(_0x55cc6a[_0x9139('0x37')]);}return _0x55cc6a;}function getTicket(_0x24f7d0,_0x22b074,_0x52c007,_0x2398d7,_0x66193){logger[_0x9139('0xc')](_0x9139('0x38'));var _0x395bc6=_[_0x9139('0x39')]({'subject':intUtil[_0x9139('0x3a')](_0x2398d7['Subjects'],_0x66193,'\x20'),'type':_0x9139('0x3b'),'status':'new','labels':[_0x9139('0x3c'),_0x9139('0x3d'),_0x9139('0x3e')]['concat'](getTags(_0x2398d7[_0x9139('0x3f')],_0x9139('0x36'))),'description':intUtil[_0x9139('0x3a')](_0x2398d7[_0x9139('0x40')],_0x66193,'\x0a'),'_links':{'assigned_user':{'href':util[_0x9139('0x14')](_0x9139('0x41'),_0x22b074['id']),'class':_0x9139('0x42')}},'message':{'direction':'in','body':intUtil[_0x9139('0x3a')](_0x2398d7[_0x9139('0x40')],_0x66193,'\x0a')}},getCustomFields(_0x2398d7[_0x9139('0x43')],_0x66193));return request({'uri':util['format'](_0x9139('0x44'),_0x24f7d0[_0x9139('0xe')],_0x52c007['id']),'method':_0x9139('0x27'),'body':_0x395bc6});}exports['queue']=function(_0x4bec2a,_0x4d9670,_0x465f49,_0x12ba4b,_0x3611b4,_0x3cbd6c){var _0x1ece29,_0x5cbd03;_0x3cbd6c[_0x9139('0xe')]=intUtil[_0x9139('0x45')](_0x3cbd6c[_0x9139('0xe')]);_0x3cbd6c[_0x9139('0x46')]=intUtil[_0x9139('0x45')](_0x3cbd6c['serverUrl']);if(_0x3611b4&&_0x3611b4[_0x9139('0x47')]){logger[_0x9139('0xc')](_0x9139('0x48'),_0x9139('0x49'));_0x4d9670['recordingURL']=util['format'](_0x9139('0x4a'),_0x3cbd6c[_0x9139('0x46')],_0x4d9670['uniqueid'],md5(_0x4d9670['uniqueid']));}else{_0x4d9670[_0x9139('0x4b')]='';}headers[_0x9139('0x4c')]=getAuth(_0x3cbd6c);return getUser(_0x3cbd6c,_0x12ba4b['email'])[_0x9139('0xf')](function(_0x2a0e65){_0x1ece29=_0x2a0e65;logger['info'](_0x9139('0x4d'),_0x1ece29['id']);return getEndUser(_0x3cbd6c,_0x4d9670['calleridname'],_0x4d9670['calleridnum']);})[_0x9139('0xf')](function(_0x125ad1){_0x5cbd03=_0x125ad1;logger[_0x9139('0xc')](_0x9139('0x4e'),_0x5cbd03['id']);return getTicket(_0x3cbd6c,_0x1ece29,_0x5cbd03,_0x465f49,_0x4d9670);})[_0x9139('0xf')](function(_0x52cf68){if(_0x52cf68){logger[_0x9139('0xc')](_0x9139('0x4f'));logger[_0x9139('0xc')]('The\x20Ticket\x20ID\x20is:',_0x52cf68['id']);switch(_0x3cbd6c[_0x9139('0x32')]){case _0x9139('0x50'):logger[_0x9139('0xc')](_0x9139('0x48'),_0x9139('0x51'));emit(util[_0x9139('0x14')](_0x9139('0x52'),_0x12ba4b[_0x9139('0x36')]),_0x9139('0x53'),{'recordId':_0x52cf68['id']});break;case _0x9139('0x54'):logger[_0x9139('0xc')]('[QUEUE]',_0x9139('0x55'));emit(util[_0x9139('0x14')](_0x9139('0x52'),_0x12ba4b['name']),_0x9139('0x56'),{'uri':util[_0x9139('0x14')]('https://xcally.desk.com/web/agent/case/%d',_0x52cf68['id'])});break;default:logger[_0x9139('0x57')](_0x9139('0x48'),_0x9139('0x58'));}}})['catch'](function(_0x8ecdc4){console[_0x9139('0x57')](_0x8ecdc4);logger[_0x9139('0x57')](_0x9139('0x48'),JSON['stringify'](_0x8ecdc4));});};exports[_0x9139('0x59')]=function(_0x1a2a2d,_0x3ba071,_0x502350,_0x3f8b69,_0x146201,_0x2b5977,_0x477d81){var _0x19ef6f,_0x363368;_0x2b5977[_0x9139('0xe')]=intUtil['stripTrailingSlash'](_0x2b5977[_0x9139('0xe')]);_0x2b5977[_0x9139('0x46')]=intUtil['stripTrailingSlash'](_0x2b5977[_0x9139('0x46')]);if(_0x477d81&&_0x477d81[_0x9139('0x5a')]&&_0x477d81[_0x9139('0x5a')]!==_0x9139('0x5b')){logger[_0x9139('0xc')]('[OUTBOUND]',_0x9139('0x49'));_0x3ba071[_0x9139('0x4b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b5977[_0x9139('0x46')],_0x3ba071[_0x9139('0x5c')],md5(_0x3ba071[_0x9139('0x5c')]));}headers['Authorization']=getAuth(_0x2b5977);return getUser(_0x2b5977,_0x3f8b69[_0x9139('0x5d')])['then'](function(_0x59e08d){_0x19ef6f=_0x59e08d;logger[_0x9139('0xc')](_0x9139('0x4d'),_0x19ef6f['id']);return getEndUser(_0x2b5977,_0x3ba071[_0x9139('0x5e')],_0x3ba071[_0x9139('0x5f')]);})['then'](function(_0x45b98d){_0x363368=_0x45b98d;logger[_0x9139('0xc')](_0x9139('0x4e'),_0x363368['id']);return getTicket(_0x2b5977,_0x19ef6f,_0x363368,_0x502350,_0x3ba071);})['then'](function(_0x18421a){if(_0x18421a){logger[_0x9139('0xc')](_0x9139('0x4f'));logger[_0x9139('0xc')](_0x9139('0x60'),_0x18421a['id']);switch(_0x2b5977[_0x9139('0x32')]){case _0x9139('0x50'):logger[_0x9139('0xc')](_0x9139('0x48'),_0x9139('0x51'));emit(util[_0x9139('0x14')](_0x9139('0x52'),_0x3f8b69[_0x9139('0x36')]),_0x9139('0x53'),{'recordId':_0x18421a['id']});break;case'newTab':logger[_0x9139('0xc')](_0x9139('0x48'),_0x9139('0x55'));emit(util[_0x9139('0x14')](_0x9139('0x52'),_0x3f8b69['name']),_0x9139('0x56'),{'uri':util[_0x9139('0x14')](_0x9139('0x61'),_0x2b5977[_0x9139('0xe')],_0x18421a['id'])});break;default:logger[_0x9139('0x57')]('[OUTBOUND]','Desk\x20account\x20type\x20not\x20recognized');}}})[_0x9139('0x62')](function(_0x3a0bc6){logger['error'](_0x9139('0x63'),JSON[_0x9139('0x64')](_0x3a0bc6));});};exports[_0x9139('0x65')]=function(_0x4c125e,_0x3cbf93,_0x302658,_0x92cccb,_0x2fc8d8,_0x8a99f2){var _0x53a27f,_0x59794f;_0x8a99f2[_0x9139('0xe')]=intUtil[_0x9139('0x45')](_0x8a99f2[_0x9139('0xe')]);_0x8a99f2['serverUrl']=intUtil['stripTrailingSlash'](_0x8a99f2[_0x9139('0x46')]);if(_0x2fc8d8&&_0x2fc8d8[_0x9139('0x47')]){logger[_0x9139('0xc')](_0x9139('0x66'),'Recording\x20is\x20enabled!');_0x3cbf93[_0x9139('0x4b')]=util[_0x9139('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x8a99f2[_0x9139('0x46')],_0x3cbf93[_0x9139('0x5c')],md5(_0x3cbf93[_0x9139('0x5c')]));}else{_0x3cbf93[_0x9139('0x4b')]='';}headers[_0x9139('0x4c')]=getAuth(_0x8a99f2);return getUser(_0x8a99f2)[_0x9139('0xf')](function(_0x224e3d){_0x53a27f=_0x224e3d;logger[_0x9139('0xc')]('The\x20User\x20ID\x20is:',_0x53a27f['id']);return getEndUser(_0x8a99f2,_0x3cbf93['calleridname'],_0x3cbf93['calleridnum']);})[_0x9139('0xf')](function(_0x1025d6){_0x59794f=_0x1025d6;logger[_0x9139('0xc')]('The\x20Enduser\x20ID\x20is:',_0x59794f['id']);return getTicket(_0x8a99f2,_0x53a27f,_0x59794f,_0x302658,_0x3cbf93);})[_0x9139('0xf')](function(_0x3f3d58){if(_0x3f3d58){logger[_0x9139('0xc')](_0x9139('0x4f'));logger[_0x9139('0xc')](_0x9139('0x60'),_0x3f3d58['id']);}})['catch'](function(_0x437d18){logger['error'](_0x9139('0x66'),JSON['stringify'](_0x437d18));});}; \ 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 73defbd..1728d73 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 _0x2fde=['redis','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','value','validateEmail','email','userEmail','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','userId','4.0','odata-entityid','substring','lastIndexOf','Bearer\x20','enduserId','contactid',']\x20Enduser\x20Created!','forEach','type','customField','idField','indexOf','content','ticketType','incident','incidents','assign','Subjects','getString','Descriptions','/contacts(','phonecalls','callDirection','queue','Fields','headers','ticketId','message','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','request-promise','util','md5','../../../../config/logger','dynamics365'];(function(_0x1c599a,_0x9f1758){var _0x163e91=function(_0x5c645c){while(--_0x5c645c){_0x1c599a['push'](_0x1c599a['shift']());}};_0x163e91(++_0x9f1758);}(_0x2fde,0x1d4));var _0xe2fd=function(_0x479acc,_0x13fdbd){_0x479acc=_0x479acc-0x0;var _0x1fc86c=_0x2fde[_0x479acc];return _0x1fc86c;};'use strict';var _=require(_0xe2fd('0x0'));var BPromise=require(_0xe2fd('0x1'));var rp=require(_0xe2fd('0x2'));var util=require(_0xe2fd('0x3'));var intUtil=require('./util');var md5=require(_0xe2fd('0x4'));var Redis=require('ioredis');var logger=require(_0xe2fd('0x5'))(_0xe2fd('0x6'));var config=require('../../../../config/environment');config[_0xe2fd('0x7')]=_['defaults'](config[_0xe2fd('0x7')],{'host':_0xe2fd('0x8'),'port':0x18eb});var io=require(_0xe2fd('0x9'))(new Redis(config['redis']));function getAuthToken(_0x5c02c5,_0x4b4929,_0xe7d87c){var _0x3cb65d={'method':_0xe2fd('0xa'),'uri':_0x4b4929,'form':{'client_id':_0x5c02c5[_0xe2fd('0xb')],'resource':_0x5c02c5[_0xe2fd('0xc')],'username':_0x5c02c5[_0xe2fd('0xd')],'password':_0x5c02c5[_0xe2fd('0xe')],'grant_type':_0xe2fd('0xe'),'client_secret':_0x5c02c5[_0xe2fd('0xf')]},'json':!![]};return rp(_0x3cb65d)[_0xe2fd('0x10')](function(_0x34f2c7){return _0x34f2c7[_0xe2fd('0x11')];})[_0xe2fd('0x12')](function(_0x1cebad){logger[_0xe2fd('0x13')]('['+[_0xe7d87c[_0xe2fd('0x14')]()]+_0xe2fd('0x15'));return _0x1cebad['message'];});}function getUser(_0x5a9ce6,_0x490806,_0x17f8ef,_0x1a5527,_0x1a978a,_0x291de5){return new BPromise(function(_0x2b102e,_0x418df5){return getAuthToken(_0x490806,_0x1a5527,_0x291de5)[_0xe2fd('0x10')](function(_0x54bed3){var _0x5dcb6a={'method':_0xe2fd('0x16'),'uri':_0x1a978a+_0xe2fd('0x17'),'headers':{'Authorization':'Bearer\x20'+_0x54bed3,'OData-Version':'4.0'},'json':!![]};return rp(_0x5dcb6a);})[_0xe2fd('0x10')](function(_0x5c1a63){var _0x1a0bda=_0x5c1a63[_0xe2fd('0x18')];var _0x302ff4=![];var _0x34e6d9=null;if(!_['isNil'](_0x17f8ef)){if(intUtil[_0xe2fd('0x19')](_0x17f8ef[_0xe2fd('0x1a')])){_0x5a9ce6[_0xe2fd('0x1b')]=_0x17f8ef[_0xe2fd('0x1a')];for(_0x34e6d9=0x0;_0x34e6d9<_0x1a0bda[_0xe2fd('0x1c')];_0x34e6d9++){if(_0x1a0bda[_0x34e6d9][_0xe2fd('0x1d')]===_0x17f8ef[_0xe2fd('0x1a')]&&!_0x1a0bda[_0x34e6d9][_0xe2fd('0x1e')]){_0x302ff4=!![];logger['info']('['+[_0x291de5[_0xe2fd('0x14')]()]+_0xe2fd('0x1f')+_0x1a0bda[_0x34e6d9]['systemuserid']+'!');_0x5a9ce6['userId']=_0x1a0bda[_0x34e6d9][_0xe2fd('0x20')];}}}}if(!_0x302ff4){logger[_0xe2fd('0x21')]('['+[_0x291de5['toUpperCase']()]+_0xe2fd('0x22'));_0x5a9ce6[_0xe2fd('0x1b')]=_0x490806[_0xe2fd('0xd')];for(_0x34e6d9=0x0;_0x34e6d9<_0x1a0bda['length'];_0x34e6d9++){if(_0x1a0bda[_0x34e6d9][_0xe2fd('0x1d')]===_0x490806['username']){_0x5a9ce6['userId']=_0x1a0bda[_0x34e6d9]['systemuserid'];}}}_0x2b102e(_0x5a9ce6);})[_0xe2fd('0x12')](function(_0x2d7be2){_0x418df5(_0x2d7be2['message']);});});}function createEndUser(_0x127ab2,_0x595a1e,_0x56bd70,_0x5b281e,_0x5729f3,_0x48cba5){return new BPromise(function(_0x3ffa45,_0x3a0914){return getAuthToken(_0x595a1e,_0x56bd70,_0x48cba5)[_0xe2fd('0x10')](function(_0x61ddb1){var _0x4feb89=_0x48cba5[_0xe2fd('0x23')]()===_0xe2fd('0x24')?_0x5729f3[_0xe2fd('0x25')]:_0x5729f3[_0xe2fd('0x26')];var _0x2de3a0={'method':_0xe2fd('0xa'),'uri':_0x5b281e+_0xe2fd('0x27'),'body':{'telephone1':_0x4feb89,'fullname':_0x4feb89,'firstname':_0x4feb89,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xe2fd('0x28')+_0x127ab2[_0xe2fd('0x29')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x61ddb1,'OData-Version':_0xe2fd('0x2a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2de3a0);})[_0xe2fd('0x10')](function(_0x35bdac){var _0x3d076c=_0x35bdac['headers'][_0xe2fd('0x2b')];var _0x2b42ab=_0x3d076c[_0xe2fd('0x2c')](_0x3d076c[_0xe2fd('0x2d')]('(')+0x1,_0x3d076c[_0xe2fd('0x2d')](')'));_0x127ab2['enduserId']=_0x2b42ab;_0x3ffa45(_0x127ab2);})[_0xe2fd('0x12')](function(_0x17b43f){_0x3a0914(_0x17b43f['message']);});});}function getEndUser(_0x19484c,_0x556636,_0xb43ac7,_0x2a2dea,_0x3fbd8a,_0x3ca6da){return new BPromise(function(_0x4dc2f8,_0xc2a49a){return getAuthToken(_0x556636,_0xb43ac7,_0x3ca6da)['then'](function(_0x4ed1da){var _0x4159d2={'method':_0xe2fd('0x16'),'uri':_0x2a2dea+'contacts?$select=telephone1','headers':{'Authorization':_0xe2fd('0x2e')+_0x4ed1da,'If-None-Match':null,'OData-Version':_0xe2fd('0x2a')},'json':!![]};return rp(_0x4159d2);})[_0xe2fd('0x10')](function(_0x2b200b){var _0x397578=null;if(_0x2b200b){var _0xddaced=_0x2b200b[_0xe2fd('0x18')];var _0x26caaf=![];for(_0x397578=0x0;_0x397578<_0xddaced[_0xe2fd('0x1c')];_0x397578++){var _0x3c2bbe=_0x3ca6da[_0xe2fd('0x23')]()===_0xe2fd('0x24')?_0x3fbd8a[_0xe2fd('0x25')]:_0x3fbd8a[_0xe2fd('0x26')];if(_0xddaced[_0x397578]['telephone1']===_0x3c2bbe){_0x26caaf=!![];_0x19484c[_0xe2fd('0x2f')]=_0xddaced[_0x397578][_0xe2fd('0x30')];}}if(_0x26caaf){_0x4dc2f8(_0x19484c);}else{return createEndUser(_0x19484c,_0x556636,_0xb43ac7,_0x2a2dea,_0x3fbd8a,_0x3ca6da)['then'](function(_0x4728dd){logger[_0xe2fd('0x21')]('['+[_0x3ca6da[_0xe2fd('0x14')]()]+']\x20Enduser\x20created!',_0x4728dd[_0xe2fd('0x2f')]);_0x4dc2f8(_0x4728dd);});}}else{return createEndUser(_0x19484c,_0x556636,_0xb43ac7,_0x2a2dea,_0x3fbd8a,_0x3ca6da)[_0xe2fd('0x10')](function(_0x4e1c6e){logger[_0xe2fd('0x21')]('['+[_0x3ca6da['toUpperCase']()]+_0xe2fd('0x31'),_0x4e1c6e[_0xe2fd('0x2f')]);_0x4dc2f8(_0x4e1c6e);});}});});}function getCustomFields(_0x489024,_0x24c652,_0x44f3fa){var _0x569e90={};if(_0x489024[_0xe2fd('0x1c')]>0x0){_[_0xe2fd('0x32')](_0x489024,function(_0x58a801){if(_0x58a801[_0xe2fd('0x33')]==='string'&&_0x58a801['nameField']&&!_0x58a801[_0xe2fd('0x34')]){var _0x4f3c2d=_0x58a801[_0xe2fd('0x35')][_0xe2fd('0x23')]();var _0x3c2e39=_0x4f3c2d[_0xe2fd('0x2c')](0x0,_0x4f3c2d[_0xe2fd('0x36')]('_'));var _0x3980c9=_0x4f3c2d[_0xe2fd('0x2c')](_0x4f3c2d['indexOf']('_')+0x1);if(_0x3c2e39===_0x44f3fa){_0x569e90[_0x3980c9]=_0x58a801[_0xe2fd('0x37')];}}});}return _0x569e90;}function getTicket(_0x27578c,_0x5ea409,_0x571b8e,_0x12b152,_0x2541b8,_0xb9a47,_0x15e743){return new BPromise(function(_0x1cdcc3,_0x30e6f1){var _0x510dec;return getAuthToken(_0x5ea409,_0x571b8e,_0x15e743)['then'](function(_0x3ba255){if(_0xb9a47[_0xe2fd('0x38')]===_0xe2fd('0x39')){_0x510dec={'method':_0xe2fd('0xa'),'uri':_0x12b152+_0xe2fd('0x3a'),'body':Object[_0xe2fd('0x3b')]({},{'title':intUtil['getString'](_0xb9a47[_0xe2fd('0x3c')],_0x2541b8,'\x20'),'description':intUtil[_0xe2fd('0x3d')](_0xb9a47[_0xe2fd('0x3e')],_0x2541b8,'\x0a'),'customerid_contact@odata.bind':_0xe2fd('0x3f')+_0x27578c['enduserId']+')','ownerid@odata.bind':_0xe2fd('0x28')+_0x27578c[_0xe2fd('0x29')]+')','caseorigincode':'1'},getCustomFields(_0xb9a47['Fields'],_0x2541b8,_0xb9a47[_0xe2fd('0x38')])),'headers':{'Authorization':'Bearer\x20'+_0x3ba255,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0xb9a47[_0xe2fd('0x38')]==='phonecall'){_0x510dec={'method':_0xe2fd('0xa'),'uri':_0x12b152+_0xe2fd('0x40'),'body':Object[_0xe2fd('0x3b')]({},{'subject':intUtil[_0xe2fd('0x3d')](_0xb9a47[_0xe2fd('0x3c')],_0x2541b8,'\x20'),'phonenumber':String(_0x2541b8[_0xe2fd('0x26')]),'description':intUtil[_0xe2fd('0x3d')](_0xb9a47[_0xe2fd('0x3e')],_0x2541b8,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x27578c['enduserId']+')','ownerid@odata.bind':_0xe2fd('0x28')+_0x27578c['userId']+')','directioncode':_0x27578c[_0xe2fd('0x41')]===_0xe2fd('0x42')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x27578c[_0xe2fd('0x29')]+')','participationtypemask':_0x27578c[_0xe2fd('0x41')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xe2fd('0x3f')+_0x27578c[_0xe2fd('0x2f')]+')','participationtypemask':_0x27578c[_0xe2fd('0x41')]===_0xe2fd('0x42')?0x1:0x2}]},getCustomFields(_0xb9a47[_0xe2fd('0x43')],_0x2541b8,_0xb9a47[_0xe2fd('0x38')])),'headers':{'Authorization':_0xe2fd('0x2e')+_0x3ba255,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x510dec);})[_0xe2fd('0x10')](function(_0x4eb41a){var _0x5d6be2=_0x4eb41a[_0xe2fd('0x44')][_0xe2fd('0x2b')];var _0x2c2f81=_0x5d6be2['substring'](_0x5d6be2['lastIndexOf']('(')+0x1,_0x5d6be2['lastIndexOf'](')'));_0x27578c[_0xe2fd('0x45')]=_0x2c2f81;_0x1cdcc3(_0x27578c);})[_0xe2fd('0x12')](function(_0x2d13cb){_0x30e6f1(_0x2d13cb[_0xe2fd('0x46')]);});});}function emit(_0x294281,_0x3f8fe1,_0x92693a,_0x3087bd){var _0x185a86={'uri':util[_0xe2fd('0x47')](_0xe2fd('0x48'),_0x294281,_0x92693a,_0x3087bd)};io['to'](util['format'](_0xe2fd('0x49'),_0x3f8fe1))[_0xe2fd('0x4a')](_0xe2fd('0x4b'),_0x185a86);}exports['cs']=function(_0x18074e,_0x424062,_0x179450,_0x560217,_0x516e02,_0x5df90e,_0x1b89f5,_0x56e7be){var _0x2cd929={};_0x5df90e[_0xe2fd('0xc')]=intUtil[_0xe2fd('0x4c')](_0x5df90e[_0xe2fd('0xc')]);_0x5df90e[_0xe2fd('0x4d')]=intUtil[_0xe2fd('0x4c')](_0x5df90e[_0xe2fd('0x4d')]);_0x2cd929[_0xe2fd('0x41')]=_0x56e7be===_0xe2fd('0x42')||_0x56e7be===_0xe2fd('0x4e')?_0xe2fd('0x42'):'outbound';var _0x5a0eda=util[_0xe2fd('0x47')](_0xe2fd('0x4f'),_0x5df90e[_0xe2fd('0xc')]);var _0x589b10=util['format'](_0xe2fd('0x50'),_0x5df90e[_0xe2fd('0x51')]);var _0x337d4b=util[_0xe2fd('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5df90e[_0xe2fd('0x4d')],_0x424062[_0xe2fd('0x52')],md5(_0x424062['uniqueid']));if(_0x516e02&&_0x516e02['monitor_format']){logger[_0xe2fd('0x21')](_0xe2fd('0x53'),_0xe2fd('0x54'));_0x424062['recordingURL']=_0x337d4b;}else if(_0x1b89f5&&_0x1b89f5[_0xe2fd('0x55')]&&_0x1b89f5[_0xe2fd('0x55')]!==_0xe2fd('0x56')){logger[_0xe2fd('0x21')]('[OUTBOUND]',_0xe2fd('0x54'));_0x424062['recordingURL']=_0x337d4b;}else{_0x424062[_0xe2fd('0x57')]='';}return getUser(_0x2cd929,_0x5df90e,_0x560217,_0x589b10,_0x5a0eda,_0x56e7be)[_0xe2fd('0x10')](function(_0x205f50){logger[_0xe2fd('0x21')]('['+_0x56e7be[_0xe2fd('0x14')]()+_0xe2fd('0x58'),_0x205f50[_0xe2fd('0x29')]);logger[_0xe2fd('0x21')]('['+_0x56e7be[_0xe2fd('0x14')]()+_0xe2fd('0x59'),_0x205f50[_0xe2fd('0x1b')]);return getEndUser(_0x205f50,_0x5df90e,_0x589b10,_0x5a0eda,_0x424062,_0x56e7be);})['then'](function(_0x51e4af){logger[_0xe2fd('0x21')]('['+_0x56e7be['toUpperCase']()+_0xe2fd('0x5a'),_0x51e4af['enduserId']);logger['info']('['+_0x56e7be['toUpperCase']()+_0xe2fd('0x5b'),_0x424062[_0xe2fd('0x26')]);return getTicket(_0x51e4af,_0x5df90e,_0x589b10,_0x5a0eda,_0x424062,_0x179450,_0x56e7be);})['then'](function(_0x1916c0){logger['info'](util[_0xe2fd('0x47')]('['+_0x56e7be[_0xe2fd('0x14')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x179450['ticketType'],_0x1916c0[_0xe2fd('0x45')]));logger[_0xe2fd('0x21')](util[_0xe2fd('0x47')]('['+_0x56e7be[_0xe2fd('0x14')]()+_0xe2fd('0x5c'),_0x56e7be));if(_0x56e7be!==_0xe2fd('0x4e')){logger[_0xe2fd('0x21')]('['+_0x56e7be[_0xe2fd('0x14')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x5df90e[_0xe2fd('0xc')],_0x560217[_0xe2fd('0x5d')],_0x179450[_0xe2fd('0x38')],_0x1916c0[_0xe2fd('0x45')]);}})['catch'](function(_0xe29156){logger[_0xe2fd('0x13')]('['+_0x56e7be[_0xe2fd('0x14')]()+_0xe2fd('0x5e'),util['inspect'](_0xe29156,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1c9e=['socket.io-emitter','POST','remoteUri','username','password','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','4.0','value','isNil','validateEmail','email','userEmail','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','destcalleridnum','calleridnum','contacts','/systemusers(','Bearer\x20','headers','odata-entityid','lastIndexOf','enduserId','contacts?$select=telephone1','toLowerCase','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','string','nameField','substring','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','/contacts(','phonecall','phonecalls','callDirection','queue','Fields','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','serverUrl','stripTrailingSlash','outbound','%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:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','abandoned','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost'];(function(_0x161270,_0x202030){var _0x33238a=function(_0x4fccc1){while(--_0x4fccc1){_0x161270['push'](_0x161270['shift']());}};_0x33238a(++_0x202030);}(_0x1c9e,0xbe));var _0xe1c9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1c9e[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xe1c9('0x0'));var BPromise=require(_0xe1c9('0x1'));var rp=require('request-promise');var util=require('util');var intUtil=require(_0xe1c9('0x2'));var md5=require(_0xe1c9('0x3'));var Redis=require(_0xe1c9('0x4'));var logger=require(_0xe1c9('0x5'))(_0xe1c9('0x6'));var config=require(_0xe1c9('0x7'));config[_0xe1c9('0x8')]=_['defaults'](config[_0xe1c9('0x8')],{'host':_0xe1c9('0x9'),'port':0x18eb});var io=require(_0xe1c9('0xa'))(new Redis(config[_0xe1c9('0x8')]));function getAuthToken(_0x46376d,_0x36a0ca,_0xcf400e){var _0x1dee63={'method':_0xe1c9('0xb'),'uri':_0x36a0ca,'form':{'client_id':_0x46376d['clientId'],'resource':_0x46376d[_0xe1c9('0xc')],'username':_0x46376d[_0xe1c9('0xd')],'password':_0x46376d[_0xe1c9('0xe')],'grant_type':'password','client_secret':_0x46376d['clientSecret']},'json':!![]};return rp(_0x1dee63)[_0xe1c9('0xf')](function(_0x586577){return _0x586577[_0xe1c9('0x10')];})[_0xe1c9('0x11')](function(_0x54bf0a){logger[_0xe1c9('0x12')]('['+[_0xcf400e['toUpperCase']()]+_0xe1c9('0x13'));return _0x54bf0a[_0xe1c9('0x14')];});}function getUser(_0x574f23,_0x1c1a1b,_0x2a5d81,_0x596a44,_0x286665,_0x44f7ab){return new BPromise(function(_0x489b7c,_0x49810d){return getAuthToken(_0x1c1a1b,_0x596a44,_0x44f7ab)[_0xe1c9('0xf')](function(_0x304a2e){var _0x5846da={'method':_0xe1c9('0x15'),'uri':_0x286665+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x304a2e,'OData-Version':_0xe1c9('0x16')},'json':!![]};return rp(_0x5846da);})['then'](function(_0x56e432){var _0x2245c8=_0x56e432[_0xe1c9('0x17')];var _0x20e24e=![];var _0x404865=null;if(!_[_0xe1c9('0x18')](_0x2a5d81)){if(intUtil[_0xe1c9('0x19')](_0x2a5d81[_0xe1c9('0x1a')])){_0x574f23[_0xe1c9('0x1b')]=_0x2a5d81[_0xe1c9('0x1a')];for(_0x404865=0x0;_0x404865<_0x2245c8['length'];_0x404865++){if(_0x2245c8[_0x404865][_0xe1c9('0x1c')]===_0x2a5d81['email']&&!_0x2245c8[_0x404865][_0xe1c9('0x1d')]){_0x20e24e=!![];logger[_0xe1c9('0x1e')]('['+[_0x44f7ab[_0xe1c9('0x1f')]()]+_0xe1c9('0x20')+_0x2245c8[_0x404865][_0xe1c9('0x21')]+'!');_0x574f23[_0xe1c9('0x22')]=_0x2245c8[_0x404865][_0xe1c9('0x21')];}}}}if(!_0x20e24e){logger[_0xe1c9('0x1e')]('['+[_0x44f7ab[_0xe1c9('0x1f')]()]+_0xe1c9('0x23'));_0x574f23[_0xe1c9('0x1b')]=_0x1c1a1b[_0xe1c9('0xd')];for(_0x404865=0x0;_0x404865<_0x2245c8[_0xe1c9('0x24')];_0x404865++){if(_0x2245c8[_0x404865][_0xe1c9('0x1c')]===_0x1c1a1b[_0xe1c9('0xd')]){_0x574f23['userId']=_0x2245c8[_0x404865][_0xe1c9('0x21')];}}}_0x489b7c(_0x574f23);})[_0xe1c9('0x11')](function(_0x3bc325){_0x49810d(_0x3bc325[_0xe1c9('0x14')]);});});}function createEndUser(_0x41f76e,_0x51735a,_0x1364bc,_0x3945dd,_0x206890,_0x5e4062){return new BPromise(function(_0x460491,_0xa8a8ba){return getAuthToken(_0x51735a,_0x1364bc,_0x5e4062)[_0xe1c9('0xf')](function(_0x4a78a2){var _0x1c42c5=_0x5e4062['toLowerCase']()==='outbound'?_0x206890[_0xe1c9('0x25')]:_0x206890[_0xe1c9('0x26')];var _0x2c0f68={'method':_0xe1c9('0xb'),'uri':_0x3945dd+_0xe1c9('0x27'),'body':{'telephone1':_0x1c42c5,'fullname':_0x1c42c5,'firstname':_0x1c42c5,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xe1c9('0x28')+_0x41f76e[_0xe1c9('0x22')]+')'},'headers':{'Authorization':_0xe1c9('0x29')+_0x4a78a2,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2c0f68);})[_0xe1c9('0xf')](function(_0x4baa12){var _0x2a7e78=_0x4baa12[_0xe1c9('0x2a')][_0xe1c9('0x2b')];var _0x3df367=_0x2a7e78['substring'](_0x2a7e78['lastIndexOf']('(')+0x1,_0x2a7e78[_0xe1c9('0x2c')](')'));_0x41f76e[_0xe1c9('0x2d')]=_0x3df367;_0x460491(_0x41f76e);})[_0xe1c9('0x11')](function(_0x50a6e0){_0xa8a8ba(_0x50a6e0[_0xe1c9('0x14')]);});});}function getEndUser(_0x49ad43,_0x5947ed,_0x1a1b40,_0x2ceb68,_0x2bce4c,_0x5ac394){return new BPromise(function(_0x269d75,_0x2c1bb9){return getAuthToken(_0x5947ed,_0x1a1b40,_0x5ac394)[_0xe1c9('0xf')](function(_0x2cdf59){var _0x6544b5={'method':_0xe1c9('0x15'),'uri':_0x2ceb68+_0xe1c9('0x2e'),'headers':{'Authorization':_0xe1c9('0x29')+_0x2cdf59,'If-None-Match':null,'OData-Version':_0xe1c9('0x16')},'json':!![]};return rp(_0x6544b5);})[_0xe1c9('0xf')](function(_0x4af828){var _0x3e0e13=null;if(_0x4af828){var _0x24d365=_0x4af828[_0xe1c9('0x17')];var _0x339fc6=![];for(_0x3e0e13=0x0;_0x3e0e13<_0x24d365['length'];_0x3e0e13++){var _0x6945d9=_0x5ac394[_0xe1c9('0x2f')]()==='outbound'?_0x2bce4c[_0xe1c9('0x25')]:_0x2bce4c[_0xe1c9('0x26')];if(_0x24d365[_0x3e0e13][_0xe1c9('0x30')]===_0x6945d9){_0x339fc6=!![];_0x49ad43[_0xe1c9('0x2d')]=_0x24d365[_0x3e0e13][_0xe1c9('0x31')];}}if(_0x339fc6){_0x269d75(_0x49ad43);}else{return createEndUser(_0x49ad43,_0x5947ed,_0x1a1b40,_0x2ceb68,_0x2bce4c,_0x5ac394)[_0xe1c9('0xf')](function(_0x308ed3){logger[_0xe1c9('0x1e')]('['+[_0x5ac394[_0xe1c9('0x1f')]()]+_0xe1c9('0x32'),_0x308ed3[_0xe1c9('0x2d')]);_0x269d75(_0x308ed3);});}}else{return createEndUser(_0x49ad43,_0x5947ed,_0x1a1b40,_0x2ceb68,_0x2bce4c,_0x5ac394)[_0xe1c9('0xf')](function(_0x4d7ee1){logger[_0xe1c9('0x1e')]('['+[_0x5ac394['toUpperCase']()]+_0xe1c9('0x33'),_0x4d7ee1['enduserId']);_0x269d75(_0x4d7ee1);});}});});}function getCustomFields(_0x599787,_0x577b09,_0xf6ae74){var _0xe0fe1d={};if(_0x599787[_0xe1c9('0x24')]>0x0){_[_0xe1c9('0x34')](_0x599787,function(_0x308a8c){if(_0x308a8c['type']===_0xe1c9('0x35')&&_0x308a8c[_0xe1c9('0x36')]&&!_0x308a8c['customField']){var _0x563ef6=_0x308a8c['idField'][_0xe1c9('0x2f')]();var _0x5c2513=_0x563ef6['substring'](0x0,_0x563ef6['indexOf']('_'));var _0x9f4260=_0x563ef6[_0xe1c9('0x37')](_0x563ef6[_0xe1c9('0x38')]('_')+0x1);if(_0x5c2513===_0xf6ae74){_0xe0fe1d[_0x9f4260]=_0x308a8c[_0xe1c9('0x39')];}}});}return _0xe0fe1d;}function getTicket(_0x2469a7,_0x484e0c,_0x3a4796,_0x2683a9,_0x314d00,_0x190520,_0x2a2e4b){return new BPromise(function(_0x3ed373,_0x2e25e9){var _0x12de0a;return getAuthToken(_0x484e0c,_0x3a4796,_0x2a2e4b)[_0xe1c9('0xf')](function(_0x5ea489){if(_0x190520[_0xe1c9('0x3a')]===_0xe1c9('0x3b')){_0x12de0a={'method':_0xe1c9('0xb'),'uri':_0x2683a9+_0xe1c9('0x3c'),'body':Object[_0xe1c9('0x3d')]({},{'title':intUtil[_0xe1c9('0x3e')](_0x190520[_0xe1c9('0x3f')],_0x314d00,'\x20'),'description':intUtil['getString'](_0x190520['Descriptions'],_0x314d00,'\x0a'),'customerid_contact@odata.bind':_0xe1c9('0x40')+_0x2469a7[_0xe1c9('0x2d')]+')','ownerid@odata.bind':_0xe1c9('0x28')+_0x2469a7[_0xe1c9('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x190520['Fields'],_0x314d00,_0x190520[_0xe1c9('0x3a')])),'headers':{'Authorization':_0xe1c9('0x29')+_0x5ea489,'OData-Version':_0xe1c9('0x16')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x190520['ticketType']===_0xe1c9('0x41')){_0x12de0a={'method':_0xe1c9('0xb'),'uri':_0x2683a9+_0xe1c9('0x42'),'body':Object[_0xe1c9('0x3d')]({},{'subject':intUtil['getString'](_0x190520[_0xe1c9('0x3f')],_0x314d00,'\x20'),'phonenumber':String(_0x314d00['calleridnum']),'description':intUtil[_0xe1c9('0x3e')](_0x190520['Descriptions'],_0x314d00,'\x0a'),'regardingobjectid_contact@odata.bind':_0xe1c9('0x40')+_0x2469a7[_0xe1c9('0x2d')]+')','ownerid@odata.bind':_0xe1c9('0x28')+_0x2469a7[_0xe1c9('0x22')]+')','directioncode':_0x2469a7[_0xe1c9('0x43')]===_0xe1c9('0x44')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2469a7[_0xe1c9('0x22')]+')','participationtypemask':_0x2469a7[_0xe1c9('0x43')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xe1c9('0x40')+_0x2469a7[_0xe1c9('0x2d')]+')','participationtypemask':_0x2469a7[_0xe1c9('0x43')]===_0xe1c9('0x44')?0x1:0x2}]},getCustomFields(_0x190520[_0xe1c9('0x45')],_0x314d00,_0x190520[_0xe1c9('0x3a')])),'headers':{'Authorization':_0xe1c9('0x29')+_0x5ea489,'OData-Version':_0xe1c9('0x16')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x12de0a);})[_0xe1c9('0xf')](function(_0x349f78){var _0x5a35f4=_0x349f78['headers']['odata-entityid'];var _0x596c85=_0x5a35f4[_0xe1c9('0x37')](_0x5a35f4['lastIndexOf']('(')+0x1,_0x5a35f4[_0xe1c9('0x2c')](')'));_0x2469a7[_0xe1c9('0x46')]=_0x596c85;_0x3ed373(_0x2469a7);})['catch'](function(_0x4d4aa0){_0x2e25e9(_0x4d4aa0[_0xe1c9('0x14')]);});});}function emit(_0x4044fd,_0x488bcc,_0x41099c,_0x30949c){var _0x47fac4={'uri':util[_0xe1c9('0x47')](_0xe1c9('0x48'),_0x4044fd,_0x41099c,_0x30949c)};io['to'](util[_0xe1c9('0x47')](_0xe1c9('0x49'),_0x488bcc))['emit'](_0xe1c9('0x4a'),_0x47fac4);}exports['cs']=function(_0x1129fc,_0x38a10b,_0x538d8e,_0x5006e4,_0x537170,_0x15d000,_0x1c27ae,_0xc94a98){var _0x54f5ac={};_0x15d000[_0xe1c9('0xc')]=intUtil['stripTrailingSlash'](_0x15d000[_0xe1c9('0xc')]);_0x15d000[_0xe1c9('0x4b')]=intUtil[_0xe1c9('0x4c')](_0x15d000[_0xe1c9('0x4b')]);_0x54f5ac[_0xe1c9('0x43')]=_0xc94a98===_0xe1c9('0x44')||_0xc94a98==='abandoned'?_0xe1c9('0x44'):_0xe1c9('0x4d');var _0xfdd530=util[_0xe1c9('0x47')](_0xe1c9('0x4e'),_0x15d000[_0xe1c9('0xc')]);var _0x4c87a9=util['format'](_0xe1c9('0x4f'),_0x15d000[_0xe1c9('0x50')]);var _0x42d06b=util[_0xe1c9('0x47')](_0xe1c9('0x51'),_0x15d000['serverUrl'],_0x38a10b[_0xe1c9('0x52')],md5(_0x38a10b[_0xe1c9('0x52')]));if(_0x537170&&_0x537170[_0xe1c9('0x53')]){logger['info'](_0xe1c9('0x54'),_0xe1c9('0x55'));_0x38a10b[_0xe1c9('0x56')]=_0x42d06b;}else if(_0x1c27ae&&_0x1c27ae[_0xe1c9('0x57')]&&_0x1c27ae['recordingFormat']!==_0xe1c9('0x58')){logger[_0xe1c9('0x1e')](_0xe1c9('0x59'),_0xe1c9('0x55'));_0x38a10b[_0xe1c9('0x56')]=_0x42d06b;}else{_0x38a10b[_0xe1c9('0x56')]='';}return getUser(_0x54f5ac,_0x15d000,_0x5006e4,_0x4c87a9,_0xfdd530,_0xc94a98)[_0xe1c9('0xf')](function(_0x423adc){logger[_0xe1c9('0x1e')]('['+_0xc94a98[_0xe1c9('0x1f')]()+_0xe1c9('0x5a'),_0x423adc['userId']);logger['info']('['+_0xc94a98[_0xe1c9('0x1f')]()+']\x20The\x20User\x20email\x20is:',_0x423adc[_0xe1c9('0x1b')]);return getEndUser(_0x423adc,_0x15d000,_0x4c87a9,_0xfdd530,_0x38a10b,_0xc94a98);})[_0xe1c9('0xf')](function(_0x2b81d4){logger[_0xe1c9('0x1e')]('['+_0xc94a98[_0xe1c9('0x1f')]()+_0xe1c9('0x5b'),_0x2b81d4[_0xe1c9('0x2d')]);logger['info']('['+_0xc94a98['toUpperCase']()+_0xe1c9('0x5c'),_0x38a10b['calleridnum']);return getTicket(_0x2b81d4,_0x15d000,_0x4c87a9,_0xfdd530,_0x38a10b,_0x538d8e,_0xc94a98);})[_0xe1c9('0xf')](function(_0x1ad96a){logger['info'](util[_0xe1c9('0x47')]('['+_0xc94a98['toUpperCase']()+_0xe1c9('0x5d'),_0x538d8e[_0xe1c9('0x3a')],_0x1ad96a['ticketId']));logger[_0xe1c9('0x1e')](util[_0xe1c9('0x47')]('['+_0xc94a98[_0xe1c9('0x1f')]()+_0xe1c9('0x5e'),_0xc94a98));if(_0xc94a98!==_0xe1c9('0x5f')){logger['info']('['+_0xc94a98[_0xe1c9('0x1f')]()+']',_0xe1c9('0x60'));emit(_0x15d000[_0xe1c9('0xc')],_0x5006e4[_0xe1c9('0x61')],_0x538d8e[_0xe1c9('0x3a')],_0x1ad96a[_0xe1c9('0x46')]);}})[_0xe1c9('0x11')](function(_0x946900){logger[_0xe1c9('0x12')]('['+_0xc94a98[_0xe1c9('0x1f')]()+_0xe1c9('0x62'),util[_0xe1c9('0x63')](_0x946900,{'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 832ffac..34c32f2 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 _0xfc5e=['stringify','GET','map','forEach','type','string','nameField','toLowerCase','idField','customField','content','variable','variableName','customVariable','Variable','name','push','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','abandoned','The\x20Ticket\x20ID\x20is:','[ABANDONED]','lodash','request-promise','md5','ioredis','./util','../../../../config/logger','freshdesk','defaults','redis','application/json','emit','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','custom_fields','mapValues','value','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Basic\x20%s','toString','base64','debug','[HTTP]'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xfc5e,0x83));var _0xefc5=function(_0x91119,_0x1fbbdc){_0x91119=_0x91119-0x0;var _0x424831=_0xfc5e[_0x91119];return _0x424831;};'use strict';var _=require(_0xefc5('0x0'));var rp=require(_0xefc5('0x1'));var md5=require(_0xefc5('0x2'));var util=require('util');var Redis=require(_0xefc5('0x3'));var intUtil=require(_0xefc5('0x4'));var config=require('../../../../config/environment');var logger=require(_0xefc5('0x5'))(_0xefc5('0x6'));config['redis']=_[_0xefc5('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xefc5('0x8')]));var headers={'Content-Type':_0xefc5('0x9'),'Accept':_0xefc5('0x9')};function emit(_0x199765,_0x2c5792,_0x583e50){io['to'](_0x199765)[_0xefc5('0xa')](_0x2c5792,_0x583e50);}function getTicket(_0x27f524,_0x446665,_0x8ab8ab,_0x37f6d7,_0x5c9863){logger[_0xefc5('0xb')](_0xefc5('0xc'));var _0x5d1eb0=_['merge']({'responder_id':_0x446665['id'],'requester_id':_0x8ab8ab['id'],'name':util[_0xefc5('0xd')](_0xefc5('0xe'),_0x5c9863[_0xefc5('0xf')]),'phone':_0x5c9863[_0xefc5('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xefc5('0x11')](_0x37f6d7[_0xefc5('0x12')],_0x5c9863,'\x20'),'description':intUtil['getString'](_0x37f6d7[_0xefc5('0x13')],_0x5c9863,_0xefc5('0x14')),'tags':getTags(_0x37f6d7['Tags'],'name')},getCustomFields(_0x37f6d7['Fields'],_0x5c9863));_0x5d1eb0[_0xefc5('0x15')]=_[_0xefc5('0x16')](_['keyBy'](_0x5d1eb0['custom_fields'],'id'),_0xefc5('0x17'));return request({'uri':util[_0xefc5('0xd')]('%s/api/v2/tickets',_0x27f524['remoteUri']),'method':'POST','body':_0x5d1eb0})[_0xefc5('0x18')](function(_0x47480d){logger[_0xefc5('0xb')](_0xefc5('0x19'));return _0x47480d;});}function getUser(_0x18e6b7,_0xde62ef){if(intUtil[_0xefc5('0x1a')](_0xde62ef)){return request({'uri':util['format'](_0xefc5('0x1b'),_0x18e6b7[_0xefc5('0x1c')]),'qs':{'email':_0xde62ef}})['then'](function(_0x419f0d){if(_0x419f0d[_0xefc5('0x1d')]){logger[_0xefc5('0xb')](_0xefc5('0x1e'));return _[_0xefc5('0x1f')](_0x419f0d,function(_0x43d8dd){return _0x43d8dd[_0xefc5('0x20')][_0xefc5('0x21')]===_0xde62ef;});}else{logger[_0xefc5('0xb')](_0xefc5('0x22'));return request({'uri':util[_0xefc5('0xd')](_0xefc5('0x23'),_0x18e6b7[_0xefc5('0x1c')])})['then'](function(_0x5d6371){logger[_0xefc5('0xb')]('Admin\x20account\x20selected.');return _0x5d6371;});}});}else{logger[_0xefc5('0xb')](_0xefc5('0x24'));return request({'uri':util[_0xefc5('0xd')](_0xefc5('0x23'),_0x18e6b7['remoteUri'])})[_0xefc5('0x18')](function(_0x4bfc65){logger[_0xefc5('0xb')]('Admin\x20account\x20selected.');return _0x4bfc65;});}}function getEndUser(_0x56811f,_0x17cc41,_0x3331af){logger[_0xefc5('0xb')](_0xefc5('0x25'),_0x3331af);return request({'uri':util[_0xefc5('0xd')](_0xefc5('0x26'),_0x56811f['remoteUri']),'qs':{'phone':_0x3331af}})[_0xefc5('0x18')](function(_0x47017e){if(_0x47017e[_0xefc5('0x1d')]){logger[_0xefc5('0xb')](_0xefc5('0x27'));return _['find'](_0x47017e,{'phone':_0x3331af});}else{logger[_0xefc5('0xb')](_0xefc5('0x28'));return request({'uri':util['format'](_0xefc5('0x26'),_0x56811f['remoteUri']),'method':_0xefc5('0x29'),'body':{'name':_0x17cc41,'phone':_0x3331af}})[_0xefc5('0x18')](function(_0x57faf2){logger[_0xefc5('0xb')]('Enduser\x20created.');return _0x57faf2;});}});}function getAuth(_0xe4120d){return util['format'](_0xefc5('0x2a'),new Buffer(_0xe4120d['apiKey']+':X')[_0xefc5('0x2b')](_0xefc5('0x2c')));}function request(_0x3e0606){logger[_0xefc5('0x2d')](_0xefc5('0x2e'),JSON[_0xefc5('0x2f')](_0x3e0606));return rp(_[_0xefc5('0x7')](_0x3e0606,{'method':_0xefc5('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x409a47,_0x8fe870){var _0x3ecb89=[];if(_0x409a47&&_0x409a47['length']>0x0){_0x3ecb89=_[_0xefc5('0x31')](_0x409a47,_0x8fe870);}return _0x3ecb89;}function getCustomFields(_0x4413a3,_0xd4aad2){var _0x331130=[];var _0x5f1bb3={'custom_fields':[]};if(_0x4413a3[_0xefc5('0x1d')]>0x0){_[_0xefc5('0x32')](_0x4413a3,function(_0x2ed8a3){if(_0x2ed8a3[_0xefc5('0x33')]===_0xefc5('0x34')&&_0x2ed8a3['nameField']&&!_0x2ed8a3['customField']){_0x5f1bb3[_0x2ed8a3[_0xefc5('0x35')][_0xefc5('0x36')]()]=_0x2ed8a3['content']['toString']();}else if(_0x2ed8a3[_0xefc5('0x33')]===_0xefc5('0x34')&&_0x2ed8a3[_0xefc5('0x37')]&&_0x2ed8a3[_0xefc5('0x38')]){_0x5f1bb3[_0xefc5('0x15')]['push']({'id':_0x2ed8a3[_0xefc5('0x37')],'value':_0x2ed8a3[_0xefc5('0x39')]['toString']()});}else if(_0x2ed8a3[_0xefc5('0x33')]===_0xefc5('0x3a')&&_0x2ed8a3[_0xefc5('0x3b')]&&_0x2ed8a3[_0xefc5('0x37')]&&_0x2ed8a3[_0xefc5('0x38')]){_0xd4aad2[_0x2ed8a3['variableName']]&&_0x5f1bb3['custom_fields']['push']({'id':_0x2ed8a3[_0xefc5('0x37')],'value':_0xd4aad2[_0x2ed8a3[_0xefc5('0x3b')]]['toString']()});}else if(_0x2ed8a3['type']===_0xefc5('0x3c')&&_0x2ed8a3[_0xefc5('0x3d')]&&_0x2ed8a3[_0xefc5('0x3d')]['name']&&_0x2ed8a3[_0xefc5('0x37')]&&_0x2ed8a3[_0xefc5('0x38')]){_0xd4aad2[_0x2ed8a3[_0xefc5('0x3d')][_0xefc5('0x3e')][_0xefc5('0x36')]()]&&_0x5f1bb3[_0xefc5('0x15')][_0xefc5('0x3f')]({'id':_0x2ed8a3[_0xefc5('0x37')],'value':_0xd4aad2[_0x2ed8a3['Variable'][_0xefc5('0x3e')]['toLowerCase']()][_0xefc5('0x2b')]()});}});}return _0x5f1bb3;}exports['queue']=function(_0x1b7670,_0x4057f1,_0x519c2d,_0x4f5a4e,_0x3e7546,_0x3fee09){var _0x31b1db,_0x236423;_0x3fee09[_0xefc5('0x1c')]=intUtil[_0xefc5('0x40')](_0x3fee09[_0xefc5('0x1c')]);_0x3fee09['serverUrl']=intUtil[_0xefc5('0x40')](_0x3fee09[_0xefc5('0x41')]);if(_0x3e7546&&_0x3e7546[_0xefc5('0x42')]){logger[_0xefc5('0xb')]('[QUEUE]',_0xefc5('0x43'));_0x4057f1['recordingURL']=util[_0xefc5('0xd')](_0xefc5('0x44'),_0x3fee09['serverUrl'],_0x4057f1['uniqueid'],md5(_0x4057f1[_0xefc5('0x45')]));}else{_0x4057f1[_0xefc5('0x46')]='';}headers[_0xefc5('0x47')]=getAuth(_0x3fee09);return getUser(_0x3fee09,_0x4f5a4e[_0xefc5('0x21')])['then'](function(_0x2242a5){_0x31b1db=_0x2242a5;logger[_0xefc5('0xb')](_0xefc5('0x48'),_0x31b1db['id']);return getEndUser(_0x3fee09,_0x4057f1[_0xefc5('0xf')],_0x4057f1['calleridnum']);})['then'](function(_0x25f925){_0x236423=_0x25f925;logger[_0xefc5('0xb')](_0xefc5('0x49'),_0x236423['id']);return getTicket(_0x3fee09,_0x31b1db,_0x236423,_0x519c2d,_0x4057f1);})[_0xefc5('0x18')](function(_0x2012f6){if(_0x2012f6&&_0x2012f6['id']){logger[_0xefc5('0xb')](_0xefc5('0x19'));logger[_0xefc5('0xb')]('The\x20Ticket\x20ID\x20is:',_0x2012f6['id']);logger['info'](_0xefc5('0x4a'),_0xefc5('0x4b'));emit(util[_0xefc5('0xd')](_0xefc5('0x4c'),_0x4f5a4e[_0xefc5('0x3e')]),_0xefc5('0x4d'),{'uri':util[_0xefc5('0xd')](_0xefc5('0x4e'),_0x3fee09[_0xefc5('0x1c')],_0x2012f6['id'])});}})[_0xefc5('0x4f')](function(_0x5ddd5a){logger[_0xefc5('0x50')]('[QUEUE]',JSON['stringify'](_0x5ddd5a));});};exports[_0xefc5('0x51')]=function(_0x125d23,_0x350231,_0x5ce6a5,_0x2e7db4,_0xd5dae7,_0x15c866,_0x61069c){var _0x3d90c2,_0x5dbeb4;_0x15c866[_0xefc5('0x1c')]=intUtil[_0xefc5('0x40')](_0x15c866[_0xefc5('0x1c')]);_0x15c866['serverUrl']=intUtil[_0xefc5('0x40')](_0x15c866[_0xefc5('0x41')]);if(_0x61069c&&_0x61069c[_0xefc5('0x52')]&&_0x61069c[_0xefc5('0x52')]!=='none'){logger['info'](_0xefc5('0x53'),_0xefc5('0x43'));_0x350231[_0xefc5('0x46')]=util[_0xefc5('0xd')](_0xefc5('0x44'),_0x15c866[_0xefc5('0x41')],_0x350231[_0xefc5('0x45')],md5(_0x350231[_0xefc5('0x45')]));}headers[_0xefc5('0x47')]=getAuth(_0x15c866);return getUser(_0x15c866,_0x2e7db4['email'])['then'](function(_0x289ca3){_0x3d90c2=_0x289ca3;logger[_0xefc5('0xb')](_0xefc5('0x48'),_0x3d90c2['id']);return getEndUser(_0x15c866,_0x350231[_0xefc5('0x54')],_0x350231[_0xefc5('0x55')]);})[_0xefc5('0x18')](function(_0x21c02a){_0x5dbeb4=_0x21c02a;logger[_0xefc5('0xb')](_0xefc5('0x49'),_0x5dbeb4['id']);return getTicket(_0x15c866,_0x3d90c2,_0x5dbeb4,_0x5ce6a5,_0x350231);})[_0xefc5('0x18')](function(_0x4e4e01){if(_0x4e4e01&&_0x4e4e01['id']){logger['info'](_0xefc5('0x19'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x4e4e01['id']);logger['info']('[OUTBOUND]',_0xefc5('0x4b'));emit(util['format'](_0xefc5('0x4c'),_0x2e7db4[_0xefc5('0x3e')]),'trigger:browser:url',{'uri':util[_0xefc5('0xd')]('%s/helpdesk/tickets/%d',_0x15c866[_0xefc5('0x1c')],_0x4e4e01['id'])});}})[_0xefc5('0x4f')](function(_0xae5521){logger[_0xefc5('0x50')](_0xefc5('0x53'),JSON[_0xefc5('0x2f')](_0xae5521));});};exports[_0xefc5('0x56')]=function(_0x4c3f96,_0x4b5b49,_0x18a6d3,_0x2ff1af,_0x46f229,_0x6a3d46){var _0x1fce5c,_0x2a2575;_0x6a3d46[_0xefc5('0x1c')]=intUtil[_0xefc5('0x40')](_0x6a3d46[_0xefc5('0x1c')]);_0x6a3d46[_0xefc5('0x41')]=intUtil[_0xefc5('0x40')](_0x6a3d46[_0xefc5('0x41')]);if(_0x46f229&&_0x46f229[_0xefc5('0x42')]){logger['info']('[ABANDONED]',_0xefc5('0x43'));_0x4b5b49['recordingURL']=util['format'](_0xefc5('0x44'),_0x6a3d46['serverUrl'],_0x4b5b49[_0xefc5('0x45')],md5(_0x4b5b49[_0xefc5('0x45')]));}else{_0x4b5b49[_0xefc5('0x46')]='';}headers[_0xefc5('0x47')]=getAuth(_0x6a3d46);return getUser(_0x6a3d46,'')[_0xefc5('0x18')](function(_0x5ef346){_0x1fce5c=_0x5ef346;logger[_0xefc5('0xb')](_0xefc5('0x48'),_0x1fce5c['id']);return getEndUser(_0x6a3d46,_0x4b5b49[_0xefc5('0xf')],_0x4b5b49[_0xefc5('0x10')]);})[_0xefc5('0x18')](function(_0x3e5721){_0x2a2575=_0x3e5721;logger[_0xefc5('0xb')](_0xefc5('0x49'),_0x2a2575['id']);return getTicket(_0x6a3d46,_0x1fce5c,_0x2a2575,_0x18a6d3,_0x4b5b49);})['then'](function(_0x2d1d96){if(_0x2d1d96){logger[_0xefc5('0xb')](_0xefc5('0x19'));logger[_0xefc5('0xb')](_0xefc5('0x57'),_0x2d1d96['id']);}})['catch'](function(_0x3496fd){logger[_0xefc5('0x50')](_0xefc5('0x58'),JSON['stringify'](_0x3496fd));});}; \ No newline at end of file +var _0xf872=['Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','apiKey','toString','base64','debug','[HTTP]','stringify','map','type','string','nameField','customField','toLowerCase','push','content','variable','variableName','Variable','idField','queue','stripTrailingSlash','monitor_format','recordingURL','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','[QUEUE]','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','serverUrl','recordingFormat','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]','abandoned','Recording\x20is\x20enabled!','[ABANDONED]','lodash','md5','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','application/json','info','merge','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','getString','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','format','%s/api/v2/tickets','remoteUri','POST','then','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf872,0x1e3));var _0x2f87=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0xf872[_0x18afca];return _0x11603f;};'use strict';var _=require(_0x2f87('0x0'));var rp=require('request-promise');var md5=require(_0x2f87('0x1'));var util=require('util');var Redis=require(_0x2f87('0x2'));var intUtil=require(_0x2f87('0x3'));var config=require(_0x2f87('0x4'));var logger=require('../../../../config/logger')(_0x2f87('0x5'));config[_0x2f87('0x6')]=_[_0x2f87('0x7')](config[_0x2f87('0x6')],{'host':_0x2f87('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0x2f87('0x9'),'Accept':_0x2f87('0x9')};function emit(_0x29c78b,_0xd28fda,_0x5cb2ea){io['to'](_0x29c78b)['emit'](_0xd28fda,_0x5cb2ea);}function getTicket(_0x258c1e,_0x15cbe3,_0x140782,_0xd03187,_0x491cd3){logger[_0x2f87('0xa')]('Creating\x20new\x20ticket...');var _0x1b09f1=_[_0x2f87('0xb')]({'responder_id':_0x15cbe3['id'],'requester_id':_0x140782['id'],'name':util['format'](_0x2f87('0xc'),_0x491cd3[_0x2f87('0xd')]),'phone':_0x491cd3[_0x2f87('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0xd03187[_0x2f87('0xf')],_0x491cd3,'\x20'),'description':intUtil[_0x2f87('0x10')](_0xd03187[_0x2f87('0x11')],_0x491cd3,_0x2f87('0x12')),'tags':getTags(_0xd03187[_0x2f87('0x13')],_0x2f87('0x14'))},getCustomFields(_0xd03187[_0x2f87('0x15')],_0x491cd3));_0x1b09f1[_0x2f87('0x16')]=_[_0x2f87('0x17')](_[_0x2f87('0x18')](_0x1b09f1[_0x2f87('0x16')],'id'),'value');return request({'uri':util[_0x2f87('0x19')](_0x2f87('0x1a'),_0x258c1e[_0x2f87('0x1b')]),'method':_0x2f87('0x1c'),'body':_0x1b09f1})[_0x2f87('0x1d')](function(_0x4feda1){logger[_0x2f87('0xa')]('Ticket\x20created!');return _0x4feda1;});}function getUser(_0x29fac5,_0x2e031d){if(intUtil[_0x2f87('0x1e')](_0x2e031d)){return request({'uri':util[_0x2f87('0x19')](_0x2f87('0x1f'),_0x29fac5[_0x2f87('0x1b')]),'qs':{'email':_0x2e031d}})[_0x2f87('0x1d')](function(_0xab584d){if(_0xab584d[_0x2f87('0x20')]){logger[_0x2f87('0xa')](_0x2f87('0x21'));return _[_0x2f87('0x22')](_0xab584d,function(_0x4e1e4f){return _0x4e1e4f[_0x2f87('0x23')][_0x2f87('0x24')]===_0x2e031d;});}else{logger[_0x2f87('0xa')](_0x2f87('0x25'));return request({'uri':util[_0x2f87('0x19')](_0x2f87('0x26'),_0x29fac5[_0x2f87('0x1b')])})[_0x2f87('0x1d')](function(_0x4b0147){logger[_0x2f87('0xa')](_0x2f87('0x27'));return _0x4b0147;});}});}else{logger[_0x2f87('0xa')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x2f87('0x19')](_0x2f87('0x26'),_0x29fac5[_0x2f87('0x1b')])})[_0x2f87('0x1d')](function(_0x355b1b){logger['info']('Admin\x20account\x20selected.');return _0x355b1b;});}}function getEndUser(_0x4d6b7e,_0x405215,_0x8163c0){logger[_0x2f87('0xa')](_0x2f87('0x28'),_0x8163c0);return request({'uri':util[_0x2f87('0x19')](_0x2f87('0x29'),_0x4d6b7e['remoteUri']),'qs':{'phone':_0x8163c0}})[_0x2f87('0x1d')](function(_0x4e83e3){if(_0x4e83e3[_0x2f87('0x20')]){logger[_0x2f87('0xa')](_0x2f87('0x2a'));return _['find'](_0x4e83e3,{'phone':_0x8163c0});}else{logger['info'](_0x2f87('0x2b'));return request({'uri':util[_0x2f87('0x19')](_0x2f87('0x29'),_0x4d6b7e['remoteUri']),'method':'POST','body':{'name':_0x405215,'phone':_0x8163c0}})[_0x2f87('0x1d')](function(_0x531d18){logger[_0x2f87('0xa')]('Enduser\x20created.');return _0x531d18;});}});}function getAuth(_0x551c35){return util['format']('Basic\x20%s',new Buffer(_0x551c35[_0x2f87('0x2c')]+':X')[_0x2f87('0x2d')](_0x2f87('0x2e')));}function request(_0x2d245c){logger[_0x2f87('0x2f')](_0x2f87('0x30'),JSON[_0x2f87('0x31')](_0x2d245c));return rp(_[_0x2f87('0x7')](_0x2d245c,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x59901f,_0x3c116d){var _0x1be857=[];if(_0x59901f&&_0x59901f[_0x2f87('0x20')]>0x0){_0x1be857=_[_0x2f87('0x32')](_0x59901f,_0x3c116d);}return _0x1be857;}function getCustomFields(_0x2925ac,_0x24ea17){var _0x2f1b07=[];var _0x272fe8={'custom_fields':[]};if(_0x2925ac[_0x2f87('0x20')]>0x0){_['forEach'](_0x2925ac,function(_0x1b58ef){if(_0x1b58ef[_0x2f87('0x33')]===_0x2f87('0x34')&&_0x1b58ef[_0x2f87('0x35')]&&!_0x1b58ef[_0x2f87('0x36')]){_0x272fe8[_0x1b58ef[_0x2f87('0x35')][_0x2f87('0x37')]()]=_0x1b58ef['content'][_0x2f87('0x2d')]();}else if(_0x1b58ef['type']===_0x2f87('0x34')&&_0x1b58ef['idField']&&_0x1b58ef[_0x2f87('0x36')]){_0x272fe8['custom_fields'][_0x2f87('0x38')]({'id':_0x1b58ef['idField'],'value':_0x1b58ef[_0x2f87('0x39')][_0x2f87('0x2d')]()});}else if(_0x1b58ef[_0x2f87('0x33')]===_0x2f87('0x3a')&&_0x1b58ef[_0x2f87('0x3b')]&&_0x1b58ef['idField']&&_0x1b58ef[_0x2f87('0x36')]){_0x24ea17[_0x1b58ef[_0x2f87('0x3b')]]&&_0x272fe8[_0x2f87('0x16')][_0x2f87('0x38')]({'id':_0x1b58ef['idField'],'value':_0x24ea17[_0x1b58ef['variableName']]['toString']()});}else if(_0x1b58ef[_0x2f87('0x33')]==='customVariable'&&_0x1b58ef[_0x2f87('0x3c')]&&_0x1b58ef['Variable'][_0x2f87('0x14')]&&_0x1b58ef[_0x2f87('0x3d')]&&_0x1b58ef['customField']){_0x24ea17[_0x1b58ef[_0x2f87('0x3c')][_0x2f87('0x14')][_0x2f87('0x37')]()]&&_0x272fe8[_0x2f87('0x16')][_0x2f87('0x38')]({'id':_0x1b58ef[_0x2f87('0x3d')],'value':_0x24ea17[_0x1b58ef['Variable'][_0x2f87('0x14')][_0x2f87('0x37')]()][_0x2f87('0x2d')]()});}});}return _0x272fe8;}exports[_0x2f87('0x3e')]=function(_0x2fd8e1,_0x9e577a,_0x15086a,_0x4cd9d6,_0x2929ff,_0x4feeba){var _0x1b5415,_0x3d1ebb;_0x4feeba[_0x2f87('0x1b')]=intUtil[_0x2f87('0x3f')](_0x4feeba[_0x2f87('0x1b')]);_0x4feeba['serverUrl']=intUtil['stripTrailingSlash'](_0x4feeba['serverUrl']);if(_0x2929ff&&_0x2929ff[_0x2f87('0x40')]){logger[_0x2f87('0xa')]('[QUEUE]','Recording\x20is\x20enabled!');_0x9e577a[_0x2f87('0x41')]=util[_0x2f87('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4feeba['serverUrl'],_0x9e577a[_0x2f87('0x42')],md5(_0x9e577a[_0x2f87('0x42')]));}else{_0x9e577a[_0x2f87('0x41')]='';}headers['Authorization']=getAuth(_0x4feeba);return getUser(_0x4feeba,_0x4cd9d6[_0x2f87('0x24')])[_0x2f87('0x1d')](function(_0x968493){_0x1b5415=_0x968493;logger[_0x2f87('0xa')](_0x2f87('0x43'),_0x1b5415['id']);return getEndUser(_0x4feeba,_0x9e577a['calleridname'],_0x9e577a['calleridnum']);})[_0x2f87('0x1d')](function(_0x7c34c){_0x3d1ebb=_0x7c34c;logger[_0x2f87('0xa')](_0x2f87('0x44'),_0x3d1ebb['id']);return getTicket(_0x4feeba,_0x1b5415,_0x3d1ebb,_0x15086a,_0x9e577a);})[_0x2f87('0x1d')](function(_0xb4df84){if(_0xb4df84&&_0xb4df84['id']){logger[_0x2f87('0xa')](_0x2f87('0x45'));logger[_0x2f87('0xa')](_0x2f87('0x46'),_0xb4df84['id']);logger[_0x2f87('0xa')](_0x2f87('0x47'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2f87('0x19')]('user:%s',_0x4cd9d6[_0x2f87('0x14')]),_0x2f87('0x48'),{'uri':util[_0x2f87('0x19')](_0x2f87('0x49'),_0x4feeba[_0x2f87('0x1b')],_0xb4df84['id'])});}})[_0x2f87('0x4a')](function(_0x1c7b3a){logger[_0x2f87('0x4b')](_0x2f87('0x47'),JSON['stringify'](_0x1c7b3a));});};exports[_0x2f87('0x4c')]=function(_0x2844d6,_0x59f3b3,_0x31f3ac,_0x542eaf,_0x40284e,_0x3c748d,_0x5c1873){var _0x530d19,_0xf617bf;_0x3c748d[_0x2f87('0x1b')]=intUtil[_0x2f87('0x3f')](_0x3c748d['remoteUri']);_0x3c748d['serverUrl']=intUtil[_0x2f87('0x3f')](_0x3c748d[_0x2f87('0x4d')]);if(_0x5c1873&&_0x5c1873[_0x2f87('0x4e')]&&_0x5c1873[_0x2f87('0x4e')]!=='none'){logger[_0x2f87('0xa')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x59f3b3['recordingURL']=util['format'](_0x2f87('0x4f'),_0x3c748d[_0x2f87('0x4d')],_0x59f3b3[_0x2f87('0x42')],md5(_0x59f3b3[_0x2f87('0x42')]));}headers[_0x2f87('0x50')]=getAuth(_0x3c748d);return getUser(_0x3c748d,_0x542eaf[_0x2f87('0x24')])[_0x2f87('0x1d')](function(_0xac69){_0x530d19=_0xac69;logger['info'](_0x2f87('0x43'),_0x530d19['id']);return getEndUser(_0x3c748d,_0x59f3b3[_0x2f87('0x51')],_0x59f3b3['destcalleridnum']);})[_0x2f87('0x1d')](function(_0x3411c5){_0xf617bf=_0x3411c5;logger['info'](_0x2f87('0x44'),_0xf617bf['id']);return getTicket(_0x3c748d,_0x530d19,_0xf617bf,_0x31f3ac,_0x59f3b3);})[_0x2f87('0x1d')](function(_0x451e7b){if(_0x451e7b&&_0x451e7b['id']){logger[_0x2f87('0xa')](_0x2f87('0x45'));logger[_0x2f87('0xa')](_0x2f87('0x46'),_0x451e7b['id']);logger[_0x2f87('0xa')]('[OUTBOUND]',_0x2f87('0x52'));emit(util[_0x2f87('0x19')]('user:%s',_0x542eaf[_0x2f87('0x14')]),'trigger:browser:url',{'uri':util[_0x2f87('0x19')](_0x2f87('0x49'),_0x3c748d[_0x2f87('0x1b')],_0x451e7b['id'])});}})[_0x2f87('0x4a')](function(_0x266b38){logger[_0x2f87('0x4b')](_0x2f87('0x53'),JSON[_0x2f87('0x31')](_0x266b38));});};exports[_0x2f87('0x54')]=function(_0x40d1c7,_0xf4f017,_0x6dcf4d,_0xe067ce,_0x4f3387,_0x446d17){var _0xa01cfd,_0x314aa8;_0x446d17['remoteUri']=intUtil[_0x2f87('0x3f')](_0x446d17[_0x2f87('0x1b')]);_0x446d17[_0x2f87('0x4d')]=intUtil[_0x2f87('0x3f')](_0x446d17[_0x2f87('0x4d')]);if(_0x4f3387&&_0x4f3387[_0x2f87('0x40')]){logger[_0x2f87('0xa')]('[ABANDONED]',_0x2f87('0x55'));_0xf4f017[_0x2f87('0x41')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x446d17[_0x2f87('0x4d')],_0xf4f017[_0x2f87('0x42')],md5(_0xf4f017[_0x2f87('0x42')]));}else{_0xf4f017['recordingURL']='';}headers[_0x2f87('0x50')]=getAuth(_0x446d17);return getUser(_0x446d17,'')['then'](function(_0x19d5ba){_0xa01cfd=_0x19d5ba;logger[_0x2f87('0xa')](_0x2f87('0x43'),_0xa01cfd['id']);return getEndUser(_0x446d17,_0xf4f017[_0x2f87('0xd')],_0xf4f017[_0x2f87('0xe')]);})[_0x2f87('0x1d')](function(_0x1380b0){_0x314aa8=_0x1380b0;logger[_0x2f87('0xa')](_0x2f87('0x44'),_0x314aa8['id']);return getTicket(_0x446d17,_0xa01cfd,_0x314aa8,_0x6dcf4d,_0xf4f017);})[_0x2f87('0x1d')](function(_0x4195a0){if(_0x4195a0){logger[_0x2f87('0xa')](_0x2f87('0x45'));logger[_0x2f87('0xa')]('The\x20Ticket\x20ID\x20is:',_0x4195a0['id']);}})[_0x2f87('0x4a')](function(_0x5e30b){logger[_0x2f87('0x4b')](_0x2f87('0x56'),JSON[_0x2f87('0x31')](_0x5e30b));});}; \ 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 2e6d9ad..028cc91 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 _0x7644=['./sugarcrm','./desk','./vtiger','./servicenow','zendesk','zoho','desk','vtiger','servicenow','includes','toLowerCase','data1','data2','find','Configurations','data3','queue','outbound','EVENT\x20UNKNOWN','abandoned','dynamics365','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','util','./salesforce'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x7644,0x72));var _0x4764=function(_0x425698,_0x18bcfa){_0x425698=_0x425698-0x0;var _0x56d93e=_0x7644[_0x425698];return _0x56d93e;};'use strict';var _=require('lodash');var util=require(_0x4764('0x0'));var zendesk=require('./zendesk');var salesforce=require(_0x4764('0x1'));var sugarcrm=require(_0x4764('0x2'));var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require(_0x4764('0x3'));var vtiger=require(_0x4764('0x4'));var servicenow=require(_0x4764('0x5'));var dynamics365=require('./dynamics365');var integrations=[_0x4764('0x6'),'salesforce','sugarcrm','freshdesk',_0x4764('0x7'),_0x4764('0x8'),_0x4764('0x9'),_0x4764('0xa'),'dynamics365'];exports['exec']=function(_0x47ebc0,_0x4a3820,_0x25103e,_0x2f445a,_0x477f37,_0x13b9cd){if(_0x25103e){if(_[_0x4764('0xb')](integrations,_0x47ebc0['data1'][_0x4764('0xc')]())){try{var _0x3e693d=null;var _0x159b56='';var _0x92f38f=_0x25103e[_0x47ebc0[_0x4764('0xd')]['toLowerCase']()];if(_0x92f38f){var _0x2815f4=_0x92f38f[_0x47ebc0[_0x4764('0xe')]];if(_0x2815f4){var _0x2c5b5a=_[_0x4764('0xf')](_0x2815f4[_0x4764('0x10')],{'id':parseInt(_0x47ebc0[_0x4764('0x11')],0xa)});if(_0x2c5b5a){if(_0x2f445a){if(_0x477f37&&_0x4a3820[_0x4764('0x12')]){_0x159b56=_0x4764('0x12');}else if(_0x4a3820['routeId']){_0x159b56=_0x4764('0x13');}else{console['log'](_0x4764('0x14'),_0x4a3820);}}else{_0x159b56=_0x4764('0x15');}switch(_0x47ebc0[_0x4764('0xd')][_0x4764('0xc')]()){case _0x4764('0x6'):zendesk[_0x159b56](_0x47ebc0,_0x4a3820,_0x2c5b5a,_0x2f445a,_0x477f37,_0x2815f4,_0x13b9cd);break;case'salesforce':salesforce[_0x159b56](_0x47ebc0,_0x4a3820,_0x2c5b5a,_0x2f445a,_0x477f37,_0x2815f4,_0x13b9cd);break;case'sugarcrm':sugarcrm[_0x159b56](_0x47ebc0,_0x4a3820,_0x2c5b5a,_0x2f445a,_0x477f37,_0x2815f4,_0x13b9cd);break;case'freshdesk':freshdesk[_0x159b56](_0x47ebc0,_0x4a3820,_0x2c5b5a,_0x2f445a,_0x477f37,_0x2815f4,_0x13b9cd);break;case _0x4764('0x7'):zoho[_0x159b56](_0x47ebc0,_0x4a3820,_0x2c5b5a,_0x2f445a,_0x477f37,_0x2815f4,_0x13b9cd);break;case _0x4764('0x8'):desk[_0x159b56](_0x47ebc0,_0x4a3820,_0x2c5b5a,_0x2f445a,_0x477f37,_0x2815f4,_0x13b9cd);break;case _0x4764('0x9'):vtiger[_0x159b56](_0x47ebc0,_0x4a3820,_0x2c5b5a,_0x2f445a,_0x477f37,_0x2815f4,_0x13b9cd);break;case _0x4764('0xa'):servicenow['cs'](_0x47ebc0,_0x4a3820,_0x2c5b5a,_0x2f445a,_0x477f37,_0x2815f4,_0x13b9cd,_0x159b56);break;case _0x4764('0x16'):dynamics365['cs'](_0x47ebc0,_0x4a3820,_0x2c5b5a,_0x2f445a,_0x477f37,_0x2815f4,_0x13b9cd,_0x159b56);break;default:console['log']('unknown\x20integration');}}else{_0x3e693d=require('../../../../config/logger')(_0x47ebc0[_0x4764('0xd')][_0x4764('0xc')]());_0x3e693d[_0x4764('0x17')](_0x4764('0x18'),util[_0x4764('0x19')](_0x4764('0x1a'),_0x47ebc0[_0x4764('0xd')]['toLowerCase'](),_0x47ebc0[_0x4764('0x11')]));}}else{_0x3e693d=require(_0x4764('0x1b'))(_0x47ebc0[_0x4764('0xd')]['toLowerCase']());_0x3e693d[_0x4764('0x17')](_0x4764('0x18'),util['format'](_0x4764('0x1c'),_0x47ebc0['data1'][_0x4764('0xc')](),_0x47ebc0[_0x4764('0xe')]));}}else{}}catch(_0x426ef3){console['error'](_0x426ef3);}}}}; \ No newline at end of file +var _0xd81b=['log','EVENT\x20UNKNOWN','abandoned','salesforce','desk','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','lodash','util','./zendesk','./sugarcrm','./freshdesk','./zoho','./desk','./servicenow','./dynamics365','zendesk','sugarcrm','freshdesk','zoho','vtiger','servicenow','dynamics365','exec','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound'];(function(_0x503579,_0x1f62c1){var _0x16bf7c=function(_0x317fa6){while(--_0x317fa6){_0x503579['push'](_0x503579['shift']());}};_0x16bf7c(++_0x1f62c1);}(_0xd81b,0x1ed));var _0xbd81=function(_0x37f5bc,_0x4df659){_0x37f5bc=_0x37f5bc-0x0;var _0x3d1978=_0xd81b[_0x37f5bc];return _0x3d1978;};'use strict';var _=require(_0xbd81('0x0'));var util=require(_0xbd81('0x1'));var zendesk=require(_0xbd81('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0xbd81('0x3'));var freshdesk=require(_0xbd81('0x4'));var zoho=require(_0xbd81('0x5'));var desk=require(_0xbd81('0x6'));var vtiger=require('./vtiger');var servicenow=require(_0xbd81('0x7'));var dynamics365=require(_0xbd81('0x8'));var integrations=[_0xbd81('0x9'),'salesforce',_0xbd81('0xa'),_0xbd81('0xb'),_0xbd81('0xc'),'desk',_0xbd81('0xd'),_0xbd81('0xe'),_0xbd81('0xf')];exports[_0xbd81('0x10')]=function(_0x417619,_0x200e2,_0x2b384a,_0x341e1f,_0x9201cb,_0x4594c6){if(_0x2b384a){if(_['includes'](integrations,_0x417619[_0xbd81('0x11')][_0xbd81('0x12')]())){try{var _0x40eccd=null;var _0x16ba07='';var _0x230762=_0x2b384a[_0x417619[_0xbd81('0x11')][_0xbd81('0x12')]()];if(_0x230762){var _0xf93223=_0x230762[_0x417619[_0xbd81('0x13')]];if(_0xf93223){var _0x5e7e51=_[_0xbd81('0x14')](_0xf93223[_0xbd81('0x15')],{'id':parseInt(_0x417619['data3'],0xa)});if(_0x5e7e51){if(_0x341e1f){if(_0x9201cb&&_0x200e2[_0xbd81('0x16')]){_0x16ba07=_0xbd81('0x16');}else if(_0x200e2[_0xbd81('0x17')]){_0x16ba07=_0xbd81('0x18');}else{console[_0xbd81('0x19')](_0xbd81('0x1a'),_0x200e2);}}else{_0x16ba07=_0xbd81('0x1b');}switch(_0x417619['data1']['toLowerCase']()){case _0xbd81('0x9'):zendesk[_0x16ba07](_0x417619,_0x200e2,_0x5e7e51,_0x341e1f,_0x9201cb,_0xf93223,_0x4594c6);break;case _0xbd81('0x1c'):salesforce[_0x16ba07](_0x417619,_0x200e2,_0x5e7e51,_0x341e1f,_0x9201cb,_0xf93223,_0x4594c6);break;case _0xbd81('0xa'):sugarcrm[_0x16ba07](_0x417619,_0x200e2,_0x5e7e51,_0x341e1f,_0x9201cb,_0xf93223,_0x4594c6);break;case _0xbd81('0xb'):freshdesk[_0x16ba07](_0x417619,_0x200e2,_0x5e7e51,_0x341e1f,_0x9201cb,_0xf93223,_0x4594c6);break;case _0xbd81('0xc'):zoho[_0x16ba07](_0x417619,_0x200e2,_0x5e7e51,_0x341e1f,_0x9201cb,_0xf93223,_0x4594c6);break;case _0xbd81('0x1d'):desk[_0x16ba07](_0x417619,_0x200e2,_0x5e7e51,_0x341e1f,_0x9201cb,_0xf93223,_0x4594c6);break;case _0xbd81('0xd'):vtiger[_0x16ba07](_0x417619,_0x200e2,_0x5e7e51,_0x341e1f,_0x9201cb,_0xf93223,_0x4594c6);break;case _0xbd81('0xe'):servicenow['cs'](_0x417619,_0x200e2,_0x5e7e51,_0x341e1f,_0x9201cb,_0xf93223,_0x4594c6,_0x16ba07);break;case _0xbd81('0xf'):dynamics365['cs'](_0x417619,_0x200e2,_0x5e7e51,_0x341e1f,_0x9201cb,_0xf93223,_0x4594c6,_0x16ba07);break;default:console[_0xbd81('0x19')](_0xbd81('0x1e'));}}else{_0x40eccd=require(_0xbd81('0x1f'))(_0x417619[_0xbd81('0x11')][_0xbd81('0x12')]());_0x40eccd[_0xbd81('0x20')](_0xbd81('0x21'),util[_0xbd81('0x22')](_0xbd81('0x23'),_0x417619[_0xbd81('0x11')][_0xbd81('0x12')](),_0x417619[_0xbd81('0x24')]));}}else{_0x40eccd=require(_0xbd81('0x1f'))(_0x417619[_0xbd81('0x11')]['toLowerCase']());_0x40eccd[_0xbd81('0x20')](_0xbd81('0x21'),util[_0xbd81('0x22')]('%s\x20account\x20#%s\x20not\x20found',_0x417619[_0xbd81('0x11')][_0xbd81('0x12')](),_0x417619['data2']));}}else{}}catch(_0x54f953){console[_0xbd81('0x20')](_0x54f953);}}}}; \ 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 76f7844..d048af0 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 _0x9567=['create','isNil','validateEmail','User','find','execute','length','info','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','Lead','contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','lead','Company','No\x20Company','type','idField','toString','variableName','customVariable','Variable','name','toLowerCase','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stringify','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','abandoned','[ABANDONED]','calleridname','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','jsforce','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','ticketType','Task','assign','Subjects','getString','Descriptions','WhoId','Case','ContactId','sobject'];(function(_0x35c9eb,_0x9d3171){var _0x13b369=function(_0x53b4f8){while(--_0x53b4f8){_0x35c9eb['push'](_0x35c9eb['shift']());}};_0x13b369(++_0x9d3171);}(_0x9567,0x122));var _0x7956=function(_0x3f6e74,_0x353290){_0x3f6e74=_0x3f6e74-0x0;var _0x769411=_0x9567[_0x3f6e74];return _0x769411;};'use strict';var _=require(_0x7956('0x0'));var rp=require(_0x7956('0x1'));var moment=require('moment');var BPromise=require(_0x7956('0x2'));var md5=require('md5');var jsforce=require(_0x7956('0x3'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x7956('0x4'));var config=require(_0x7956('0x5'));var logger=require(_0x7956('0x6'))(_0x7956('0x7'));config[_0x7956('0x8')]=_[_0x7956('0x9')](config[_0x7956('0x8')],{'host':_0x7956('0xa'),'port':0x18eb});var io=require(_0x7956('0xb'))(new Redis(config['redis']));function emit(_0x551fc2,_0x1af246,_0x4881af){io['to'](_0x551fc2)['emit'](_0x1af246,_0x4881af);}function getTicket(_0x18716c,_0x1652d7,_0x593f52,_0x131f6e,_0x45a7c5,_0x59441f,_0x1b3726,_0x4c249a){var _0xe5b1f2={};if(_0x131f6e[_0x7956('0xc')]===_0x7956('0xd')){_0xe5b1f2=Object[_0x7956('0xe')]({},{'OwnerId':_0x1652d7['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x131f6e[_0x7956('0xf')],_0x45a7c5,'\x20'),'Description':intUtil[_0x7956('0x10')](_0x131f6e[_0x7956('0x11')],_0x45a7c5,'\x0a')},getCustomFields(_0x59441f,_0x45a7c5));if(_0x593f52){_0xe5b1f2[_0x7956('0x12')]=_0x593f52['id'];}}else if(_0x131f6e['ticketType']===_0x7956('0x13')){_0xe5b1f2=Object[_0x7956('0xe')]({},{'OwnerId':_0x1652d7['id'],'Subject':intUtil[_0x7956('0x10')](_0x131f6e[_0x7956('0xf')],_0x45a7c5,'\x20'),'Description':intUtil[_0x7956('0x10')](_0x131f6e[_0x7956('0x11')],_0x45a7c5,'\x0a')},getCustomFields(_0x59441f,_0x45a7c5));if(_0x593f52){_0xe5b1f2[_0x7956('0x14')]=_0x593f52['id'];}}return _0x1b3726[_0x7956('0x15')](_0x131f6e[_0x7956('0xc')])[_0x7956('0x16')](_0xe5b1f2);}function getUser(_0x43e1fe,_0x3c73d9,_0x5cd353){if(!_[_0x7956('0x17')](_0x3c73d9)&&intUtil[_0x7956('0x18')](_0x3c73d9)){var _0x1ec907={'Email':_0x3c73d9};var _0x1dd302={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5cd353[_0x7956('0x15')](_0x7956('0x19'))[_0x7956('0x1a')](_0x1ec907,_0x1dd302)[_0x7956('0x1b')]()['then'](function(_0x500a2c){if(_0x500a2c[_0x7956('0x1c')]){var _0x550775=_['find'](_0x500a2c,function(_0x3b22fe){return _0x3b22fe['Email']===_0x3c73d9;});if(_0x550775){logger[_0x7956('0x1d')](_0x7956('0x1e'),_0x3c73d9);return BPromise[_0x7956('0x1f')]({'id':_0x550775['Id'],'name':_0x550775[_0x7956('0x20')]});}}else{logger[_0x7956('0x1d')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3c73d9);return _0x5cd353[_0x7956('0x21')]()['then'](function(_0x3ee97b){return BPromise[_0x7956('0x1f')]({'id':_0x3ee97b[_0x7956('0x22')],'name':_0x3ee97b[_0x7956('0x23')]});});}});}else{logger[_0x7956('0x1d')](_0x7956('0x24'),_0x3c73d9);return _0x5cd353['identity']()[_0x7956('0x25')](function(_0x225956){return BPromise['resolve']({'id':_0x225956[_0x7956('0x22')],'name':_0x225956['display_name']});});}}function getEndUser(_0x43beb4,_0x236b80,_0x45cb8a,_0xcdf609,_0x562d55){var _0x51b8c4={'Phone':_0xcdf609};var _0x26823f={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x7956('0x1f')]()['then'](function(){if(_0x236b80['ticketType']===_0x7956('0xd')){logger['info'](_0x7956('0x26'),_0xcdf609,_0x236b80[_0x7956('0x27')]);switch(_0x236b80[_0x7956('0x27')]){case _0x7956('0x28'):return _0x562d55[_0x7956('0x15')](_0x7956('0x29'))[_0x7956('0x1a')](_0x51b8c4,_0x26823f)[_0x7956('0x1b')]()[_0x7956('0x25')](function(_0xea6967){if(_0xea6967&&_0xea6967[_0x7956('0x1c')]){return _0xea6967;}else{return _0x562d55[_0x7956('0x15')](_0x7956('0x2a'))[_0x7956('0x1a')](_0x51b8c4,_0x26823f);}});case _0x7956('0x2b'):return _0x562d55[_0x7956('0x15')](_0x7956('0x29'))['find'](_0x51b8c4,_0x26823f)['execute']();case'lead':return _0x562d55[_0x7956('0x15')]('Lead')[_0x7956('0x1a')](_0x51b8c4,_0x26823f);default:return null;}}else if(_0x236b80[_0x7956('0xc')]===_0x7956('0x13')){logger[_0x7956('0x1d')](_0x7956('0x26'),_0xcdf609,_0x7956('0x2b'));return _0x562d55[_0x7956('0x15')]('Contact')['find'](_0x51b8c4,_0x26823f)['execute']();}})[_0x7956('0x25')](function(_0x4163bf){if(_0x4163bf&&_0x4163bf[_0x7956('0x1c')]){var _0x39810e=_['find'](_0x4163bf,function(_0x4bcb7a){return _0x4bcb7a[_0x7956('0x2c')]===_0xcdf609;});if(_0x39810e){return BPromise[_0x7956('0x1f')]({'id':_0x39810e['Id'],'name':_0x39810e[_0x7956('0x20')],'phone':_0x39810e[_0x7956('0x2c')]});}}})[_0x7956('0x25')](function(_0x4b8429){if(_0x4b8429){logger[_0x7956('0x1d')](_0x7956('0x2d'),_0xcdf609);return BPromise[_0x7956('0x1f')](_0x4b8429);}else{logger[_0x7956('0x1d')]('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0xcdf609);var _0x93cffb={'LastName':_0x45cb8a!==_0x7956('0x2e')?_0x45cb8a:util['format'](_0x7956('0x2f'),_0xcdf609),'Phone':_0xcdf609};if(_0x236b80[_0x7956('0x30')]){if(_0x236b80[_0x7956('0x30')]===_0x7956('0x2b')){logger[_0x7956('0x1d')](_0x7956('0x31'),_0xcdf609,_0x236b80[_0x7956('0x30')]);}else if(_0x236b80[_0x7956('0x30')]===_0x7956('0x32')&&_0x236b80[_0x7956('0xc')]==='Task'){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0xcdf609,_0x236b80[_0x7956('0x30')]);_0x93cffb[_0x7956('0x33')]=_0x7956('0x34');}else{return null;}}return _0x562d55[_0x7956('0x15')](_['upperFirst'](_0x236b80[_0x7956('0x30')]))[_0x7956('0x16')](_0x93cffb);}});}function getCustomFields(_0x3ca186,_0x1e715b){var _0x3099fe={};if(_0x3ca186['length']>0x0){_['forEach'](_0x3ca186,function(_0x567d16){if(_0x567d16[_0x7956('0x35')]==='string'&&_0x567d16['idField']){_0x3099fe[_0x567d16[_0x7956('0x36')]]=_0x567d16['content'][_0x7956('0x37')]();}else if(_0x567d16['type']==='variable'&&_0x567d16[_0x7956('0x38')]&&_0x567d16[_0x7956('0x36')]){_0x1e715b[_0x567d16[_0x7956('0x38')]]&&(_0x3099fe[_0x567d16[_0x7956('0x36')]]=_0x1e715b[_0x567d16[_0x7956('0x38')]][_0x7956('0x37')]());}else if(_0x567d16[_0x7956('0x35')]===_0x7956('0x39')&&_0x567d16['Variable']&&_0x567d16['Variable']['name']&&_0x567d16[_0x7956('0x36')]){_0x1e715b[_0x567d16[_0x7956('0x3a')][_0x7956('0x3b')][_0x7956('0x3c')]()]&&(_0x3099fe[_0x567d16['idField']]=_0x1e715b[_0x567d16[_0x7956('0x3a')][_0x7956('0x3b')][_0x7956('0x3c')]()]['toString']());}});}return _0x3099fe;}function getConnection(_0x498ded){var _0x39547f=_0x498ded['password'][_0x7956('0x3d')](_0x498ded[_0x7956('0x3e')]);var _0xa402f8=new jsforce[(_0x7956('0x3f'))]({'oauth2':{'loginUrl':_0x498ded[_0x7956('0x40')]||_0x7956('0x41'),'clientId':_0x498ded[_0x7956('0x42')],'clientSecret':_0x498ded[_0x7956('0x43')]}});return _0xa402f8[_0x7956('0x44')](_0x498ded[_0x7956('0x45')],_0x39547f)[_0x7956('0x25')](function(){logger['info'](_0x7956('0x46'));return _0xa402f8;});}exports[_0x7956('0x47')]=function(_0x459f2f,_0x2c388a,_0x203d3b,_0x5e9122,_0x1f6311,_0x19e57a){var _0x42ffe8,_0x59873b,_0x4c1585,_0x219b6e;_0x19e57a[_0x7956('0x48')]=intUtil[_0x7956('0x49')](_0x19e57a[_0x7956('0x48')]);_0x19e57a[_0x7956('0x40')]=intUtil[_0x7956('0x49')](_0x19e57a[_0x7956('0x40')]);if(_0x1f6311&&_0x1f6311[_0x7956('0x4a')]){logger['info']('[QUEUE]',_0x7956('0x4b'));_0x2c388a[_0x7956('0x4c')]=util[_0x7956('0x4d')](_0x7956('0x4e'),_0x19e57a[_0x7956('0x48')],_0x2c388a[_0x7956('0x4f')],md5(_0x2c388a[_0x7956('0x4f')]));}else{_0x2c388a['recordingURL']='';}return getConnection(_0x19e57a)[_0x7956('0x25')](function(_0x386340){_0x219b6e=_0x386340;return getUser(_0x19e57a,_0x5e9122['email'],_0x219b6e);})[_0x7956('0x25')](function(_0x246342){_0x42ffe8=_0x246342;return getEndUser(_0x19e57a,_0x203d3b,_0x2c388a['calleridname'],_0x2c388a[_0x7956('0x50')],_0x219b6e);})[_0x7956('0x25')](function(_0x419731){_0x59873b=_0x419731;return getTicket(_0x19e57a,_0x42ffe8,_0x59873b,_0x203d3b,_0x2c388a,_0x203d3b['Fields'],_0x219b6e,_0x7956('0x47'));})[_0x7956('0x25')](function(_0x1c058d){_0x4c1585=_0x1c058d;logger[_0x7956('0x1d')](_0x7956('0x51'),_0x4c1585['id']);logger[_0x7956('0x1d')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4c1585['id'],_0x5e9122['name'],_0x19e57a[_0x7956('0x35')]);switch(_0x19e57a[_0x7956('0x35')]){case'integrationTab':emit(util[_0x7956('0x4d')](_0x7956('0x52'),_0x5e9122['name']),_0x7956('0x53'),{'recordId':_0x4c1585['id']});break;case _0x7956('0x54'):emit(util[_0x7956('0x4d')](_0x7956('0x52'),_0x5e9122[_0x7956('0x3b')]),_0x7956('0x55'),{'uri':util[_0x7956('0x4d')](_0x7956('0x56'),_0x219b6e[_0x7956('0x57')],_0x4c1585['id'])});break;default:logger[_0x7956('0x58')](_0x7956('0x59'));}})[_0x7956('0x5a')](function(_0x6628c1){logger[_0x7956('0x58')]('[QUEUE]',JSON[_0x7956('0x5b')](_0x6628c1));});};exports[_0x7956('0x5c')]=function(_0x207628,_0x1b5081,_0x253986,_0x33ab5d,_0xf511b0,_0x110ba4,_0x1214cc){var _0x2554fc,_0x38b682,_0x3309ae,_0x178605;_0x110ba4[_0x7956('0x48')]=intUtil[_0x7956('0x49')](_0x110ba4[_0x7956('0x48')]);_0x110ba4[_0x7956('0x40')]=intUtil[_0x7956('0x49')](_0x110ba4['remoteUri']);if(_0x1214cc&&_0x1214cc['recordingFormat']&&_0x1214cc[_0x7956('0x5d')]!=='none'){logger[_0x7956('0x1d')](_0x7956('0x5e'),_0x7956('0x4b'));_0x1b5081[_0x7956('0x4c')]=util['format'](_0x7956('0x4e'),_0x110ba4['serverUrl'],_0x1b5081[_0x7956('0x4f')],md5(_0x1b5081[_0x7956('0x4f')]));}return getConnection(_0x110ba4)['then'](function(_0x3c2838){_0x178605=_0x3c2838;return getUser(_0x110ba4,_0x33ab5d['email'],_0x178605);})[_0x7956('0x25')](function(_0x32098e){_0x2554fc=_0x32098e;return getEndUser(_0x110ba4,_0x253986,_0x1b5081[_0x7956('0x5f')],_0x1b5081[_0x7956('0x60')],_0x178605);})[_0x7956('0x25')](function(_0x5f3093){_0x38b682=_0x5f3093;return getTicket(_0x110ba4,_0x2554fc,_0x38b682,_0x253986,_0x1b5081,_0x253986[_0x7956('0x61')],_0x178605,_0x7956('0x5c'));})['then'](function(_0x5e4e1d){_0x3309ae=_0x5e4e1d;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x3309ae['id']);logger[_0x7956('0x1d')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3309ae['id'],_0x33ab5d[_0x7956('0x3b')],_0x110ba4[_0x7956('0x35')]);switch(_0x110ba4[_0x7956('0x35')]){case _0x7956('0x62'):emit(util['format'](_0x7956('0x52'),_0x33ab5d[_0x7956('0x3b')]),_0x7956('0x53'),{'recordId':_0x3309ae['id']});break;case _0x7956('0x54'):emit(util[_0x7956('0x4d')](_0x7956('0x52'),_0x33ab5d[_0x7956('0x3b')]),'trigger:browser:url',{'uri':util['format'](_0x7956('0x56'),_0x178605[_0x7956('0x57')],_0x3309ae['id'])});break;default:logger[_0x7956('0x58')](_0x7956('0x5e'),_0x7956('0x63'));}})[_0x7956('0x5a')](function(_0x5de066){logger[_0x7956('0x58')](_0x7956('0x5e'),JSON['stringify'](_0x5de066));});};exports[_0x7956('0x64')]=function(_0x4751a0,_0x2df500,_0x120cf4,_0x365394,_0x41b839,_0x17568d){var _0x5691a8,_0x2d0e6f,_0x23a2ec,_0x573466;_0x17568d['serverUrl']=intUtil[_0x7956('0x49')](_0x17568d[_0x7956('0x48')]);_0x17568d[_0x7956('0x40')]=intUtil[_0x7956('0x49')](_0x17568d[_0x7956('0x40')]);if(_0x41b839&&_0x41b839[_0x7956('0x4a')]){logger[_0x7956('0x1d')](_0x7956('0x65'),_0x7956('0x4b'));_0x2df500[_0x7956('0x4c')]=util[_0x7956('0x4d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x17568d[_0x7956('0x48')],_0x2df500[_0x7956('0x4f')],md5(_0x2df500[_0x7956('0x4f')]));}else{_0x2df500['recordingURL']='';}return getConnection(_0x17568d)[_0x7956('0x25')](function(_0x15f292){_0x573466=_0x15f292;if(!_[_0x7956('0x17')](_0x365394)){return getUser(_0x17568d,_0x365394[_0x7956('0x3b')],_0x573466);}else{return getUser(_0x17568d,null,_0x573466);}})[_0x7956('0x25')](function(_0x1e03c0){_0x5691a8=_0x1e03c0;return getEndUser(_0x17568d,_0x120cf4,_0x2df500[_0x7956('0x66')],_0x2df500['calleridnum'],_0x573466);})['then'](function(_0x282703){_0x2d0e6f=_0x282703;return getTicket(_0x17568d,_0x5691a8,_0x2d0e6f,_0x120cf4,_0x2df500,_0x120cf4[_0x7956('0x61')],_0x573466);})['then'](function(_0x351c4b){_0x23a2ec=_0x351c4b;logger[_0x7956('0x1d')]('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x23a2ec['id']);logger[_0x7956('0x1d')](_0x7956('0x67'),_0x17568d[_0x7956('0x35')]);})['catch'](function(_0x3aed47){logger[_0x7956('0x58')](_0x7956('0x65'),JSON[_0x7956('0x5b')](_0x3aed47));});}; \ No newline at end of file +var _0xd001=['Variable','name','toLowerCase','password','concat','remoteUri','https://login.salesforce.com','clientId','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Fields','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','newTab','%s/%s/e','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','stringify','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','abandoned','calleridname','calleridnum','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','[ABANDONED]','lodash','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','salesforce','redis','localhost','socket.io-emitter','emit','ticketType','Task','utc','Subjects','getString','Descriptions','Case','assign','sobject','create','isNil','validateEmail','User','execute','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','find','Lead','contact','Contact','lead','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','format','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','forEach','type','string','idField','content','toString','variable','variableName','customVariable'];(function(_0xb0fe92,_0x147e42){var _0x41787f=function(_0x42ae35){while(--_0x42ae35){_0xb0fe92['push'](_0xb0fe92['shift']());}};_0x41787f(++_0x147e42);}(_0xd001,0x97));var _0x1d00=function(_0x37799e,_0x4cc93d){_0x37799e=_0x37799e-0x0;var _0x3b1eba=_0xd001[_0x37799e];return _0x3b1eba;};'use strict';var _=require(_0x1d00('0x0'));var rp=require('request-promise');var moment=require(_0x1d00('0x1'));var BPromise=require(_0x1d00('0x2'));var md5=require(_0x1d00('0x3'));var jsforce=require(_0x1d00('0x4'));var util=require(_0x1d00('0x5'));var Redis=require(_0x1d00('0x6'));var intUtil=require(_0x1d00('0x7'));var config=require(_0x1d00('0x8'));var logger=require('../../../../config/logger')(_0x1d00('0x9'));config[_0x1d00('0xa')]=_['defaults'](config['redis'],{'host':_0x1d00('0xb'),'port':0x18eb});var io=require(_0x1d00('0xc'))(new Redis(config['redis']));function emit(_0x20f3a9,_0x362c02,_0x2115e7){io['to'](_0x20f3a9)[_0x1d00('0xd')](_0x362c02,_0x2115e7);}function getTicket(_0x4fa57a,_0x49a125,_0x39680b,_0x6770e5,_0x17391d,_0x36dda6,_0x453e00,_0x75a41e){var _0x41348f={};if(_0x6770e5[_0x1d00('0xe')]===_0x1d00('0xf')){_0x41348f=Object['assign']({},{'OwnerId':_0x49a125['id'],'ActivityDate':moment[_0x1d00('0x10')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x6770e5[_0x1d00('0x11')],_0x17391d,'\x20'),'Description':intUtil[_0x1d00('0x12')](_0x6770e5[_0x1d00('0x13')],_0x17391d,'\x0a')},getCustomFields(_0x36dda6,_0x17391d));if(_0x39680b){_0x41348f['WhoId']=_0x39680b['id'];}}else if(_0x6770e5[_0x1d00('0xe')]===_0x1d00('0x14')){_0x41348f=Object[_0x1d00('0x15')]({},{'OwnerId':_0x49a125['id'],'Subject':intUtil['getString'](_0x6770e5['Subjects'],_0x17391d,'\x20'),'Description':intUtil['getString'](_0x6770e5['Descriptions'],_0x17391d,'\x0a')},getCustomFields(_0x36dda6,_0x17391d));if(_0x39680b){_0x41348f['ContactId']=_0x39680b['id'];}}return _0x453e00[_0x1d00('0x16')](_0x6770e5[_0x1d00('0xe')])[_0x1d00('0x17')](_0x41348f);}function getUser(_0x2ea464,_0x56aed6,_0x52dc7b){if(!_[_0x1d00('0x18')](_0x56aed6)&&intUtil[_0x1d00('0x19')](_0x56aed6)){var _0x32c4e5={'Email':_0x56aed6};var _0x15ff35={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x52dc7b[_0x1d00('0x16')](_0x1d00('0x1a'))['find'](_0x32c4e5,_0x15ff35)[_0x1d00('0x1b')]()[_0x1d00('0x1c')](function(_0x31fcdc){if(_0x31fcdc[_0x1d00('0x1d')]){var _0x2d1d3f=_['find'](_0x31fcdc,function(_0x20f91c){return _0x20f91c[_0x1d00('0x1e')]===_0x56aed6;});if(_0x2d1d3f){logger[_0x1d00('0x1f')](_0x1d00('0x20'),_0x56aed6);return BPromise[_0x1d00('0x21')]({'id':_0x2d1d3f['Id'],'name':_0x2d1d3f[_0x1d00('0x22')]});}}else{logger[_0x1d00('0x1f')](_0x1d00('0x23'),_0x56aed6);return _0x52dc7b[_0x1d00('0x24')]()[_0x1d00('0x1c')](function(_0x1f5de8){return BPromise[_0x1d00('0x21')]({'id':_0x1f5de8['user_id'],'name':_0x1f5de8[_0x1d00('0x25')]});});}});}else{logger[_0x1d00('0x1f')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x56aed6);return _0x52dc7b[_0x1d00('0x24')]()['then'](function(_0x35e856){return BPromise[_0x1d00('0x21')]({'id':_0x35e856['user_id'],'name':_0x35e856[_0x1d00('0x25')]});});}}function getEndUser(_0x3de0e4,_0x165167,_0x3160c8,_0x3e9ee3,_0x1def82){var _0x1970e2={'Phone':_0x3e9ee3};var _0x2d103b={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x1d00('0x21')]()[_0x1d00('0x1c')](function(){if(_0x165167[_0x1d00('0xe')]===_0x1d00('0xf')){logger[_0x1d00('0x1f')](_0x1d00('0x26'),_0x3e9ee3,_0x165167['moduleSearch']);switch(_0x165167[_0x1d00('0x27')]){case'contact_lead':return _0x1def82[_0x1d00('0x16')]('Contact')[_0x1d00('0x28')](_0x1970e2,_0x2d103b)[_0x1d00('0x1b')]()[_0x1d00('0x1c')](function(_0x4f7cb8){if(_0x4f7cb8&&_0x4f7cb8[_0x1d00('0x1d')]){return _0x4f7cb8;}else{return _0x1def82[_0x1d00('0x16')](_0x1d00('0x29'))[_0x1d00('0x28')](_0x1970e2,_0x2d103b);}});case _0x1d00('0x2a'):return _0x1def82[_0x1d00('0x16')](_0x1d00('0x2b'))[_0x1d00('0x28')](_0x1970e2,_0x2d103b)[_0x1d00('0x1b')]();case _0x1d00('0x2c'):return _0x1def82[_0x1d00('0x16')](_0x1d00('0x29'))[_0x1d00('0x28')](_0x1970e2,_0x2d103b);default:return null;}}else if(_0x165167[_0x1d00('0xe')]==='Case'){logger['info'](_0x1d00('0x26'),_0x3e9ee3,'contact');return _0x1def82[_0x1d00('0x16')](_0x1d00('0x2b'))[_0x1d00('0x28')](_0x1970e2,_0x2d103b)[_0x1d00('0x1b')]();}})['then'](function(_0x3f2537){if(_0x3f2537&&_0x3f2537[_0x1d00('0x1d')]){var _0x5ef4a6=_[_0x1d00('0x28')](_0x3f2537,function(_0x1c9e8f){return _0x1c9e8f['Phone']===_0x3e9ee3;});if(_0x5ef4a6){return BPromise['resolve']({'id':_0x5ef4a6['Id'],'name':_0x5ef4a6['Name'],'phone':_0x5ef4a6['Phone']});}}})[_0x1d00('0x1c')](function(_0x286c3f){if(_0x286c3f){logger[_0x1d00('0x1f')](_0x1d00('0x2d'),_0x3e9ee3);return BPromise[_0x1d00('0x21')](_0x286c3f);}else{logger[_0x1d00('0x1f')](_0x1d00('0x2e'),_0x3e9ee3);var _0x5f1ca5={'LastName':_0x3160c8!==''?_0x3160c8:util[_0x1d00('0x2f')]('Caller\x20-\x20%s',_0x3e9ee3),'Phone':_0x3e9ee3};if(_0x165167['moduleCreate']){if(_0x165167[_0x1d00('0x30')]===_0x1d00('0x2a')){logger[_0x1d00('0x1f')](_0x1d00('0x31'),_0x3e9ee3,_0x165167[_0x1d00('0x30')]);}else if(_0x165167[_0x1d00('0x30')]===_0x1d00('0x2c')&&_0x165167[_0x1d00('0xe')]===_0x1d00('0xf')){logger[_0x1d00('0x1f')](_0x1d00('0x31'),_0x3e9ee3,_0x165167[_0x1d00('0x30')]);_0x5f1ca5[_0x1d00('0x32')]=_0x1d00('0x33');}else{return null;}}return _0x1def82[_0x1d00('0x16')](_['upperFirst'](_0x165167[_0x1d00('0x30')]))[_0x1d00('0x17')](_0x5f1ca5);}});}function getCustomFields(_0x155410,_0x396d08){var _0x30789e={};if(_0x155410[_0x1d00('0x1d')]>0x0){_[_0x1d00('0x34')](_0x155410,function(_0x38f2a8){if(_0x38f2a8[_0x1d00('0x35')]===_0x1d00('0x36')&&_0x38f2a8[_0x1d00('0x37')]){_0x30789e[_0x38f2a8[_0x1d00('0x37')]]=_0x38f2a8[_0x1d00('0x38')][_0x1d00('0x39')]();}else if(_0x38f2a8['type']===_0x1d00('0x3a')&&_0x38f2a8[_0x1d00('0x3b')]&&_0x38f2a8[_0x1d00('0x37')]){_0x396d08[_0x38f2a8[_0x1d00('0x3b')]]&&(_0x30789e[_0x38f2a8[_0x1d00('0x37')]]=_0x396d08[_0x38f2a8[_0x1d00('0x3b')]][_0x1d00('0x39')]());}else if(_0x38f2a8[_0x1d00('0x35')]===_0x1d00('0x3c')&&_0x38f2a8[_0x1d00('0x3d')]&&_0x38f2a8[_0x1d00('0x3d')][_0x1d00('0x3e')]&&_0x38f2a8[_0x1d00('0x37')]){_0x396d08[_0x38f2a8['Variable'][_0x1d00('0x3e')][_0x1d00('0x3f')]()]&&(_0x30789e[_0x38f2a8['idField']]=_0x396d08[_0x38f2a8[_0x1d00('0x3d')][_0x1d00('0x3e')][_0x1d00('0x3f')]()][_0x1d00('0x39')]());}});}return _0x30789e;}function getConnection(_0x4f3b6e){var _0x195dbb=_0x4f3b6e[_0x1d00('0x40')][_0x1d00('0x41')](_0x4f3b6e['securityToken']);var _0x253ce4=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4f3b6e[_0x1d00('0x42')]||_0x1d00('0x43'),'clientId':_0x4f3b6e[_0x1d00('0x44')],'clientSecret':_0x4f3b6e['clientSecret']}});return _0x253ce4['login'](_0x4f3b6e['username'],_0x195dbb)[_0x1d00('0x1c')](function(){logger[_0x1d00('0x1f')]('Connection\x20established.');return _0x253ce4;});}exports[_0x1d00('0x45')]=function(_0x31a0fd,_0x19c370,_0x448b92,_0x374dc8,_0x36130e,_0x392522){var _0x2379e2,_0xa82524,_0x3e830c,_0x1f2d2;_0x392522['serverUrl']=intUtil['stripTrailingSlash'](_0x392522[_0x1d00('0x46')]);_0x392522['remoteUri']=intUtil[_0x1d00('0x47')](_0x392522[_0x1d00('0x42')]);if(_0x36130e&&_0x36130e[_0x1d00('0x48')]){logger[_0x1d00('0x1f')](_0x1d00('0x49'),_0x1d00('0x4a'));_0x19c370['recordingURL']=util[_0x1d00('0x2f')](_0x1d00('0x4b'),_0x392522['serverUrl'],_0x19c370[_0x1d00('0x4c')],md5(_0x19c370['uniqueid']));}else{_0x19c370[_0x1d00('0x4d')]='';}return getConnection(_0x392522)[_0x1d00('0x1c')](function(_0x424f9a){_0x1f2d2=_0x424f9a;return getUser(_0x392522,_0x374dc8['email'],_0x1f2d2);})[_0x1d00('0x1c')](function(_0x1b5a40){_0x2379e2=_0x1b5a40;return getEndUser(_0x392522,_0x448b92,_0x19c370['calleridname'],_0x19c370['calleridnum'],_0x1f2d2);})[_0x1d00('0x1c')](function(_0x89caa9){_0xa82524=_0x89caa9;return getTicket(_0x392522,_0x2379e2,_0xa82524,_0x448b92,_0x19c370,_0x448b92[_0x1d00('0x4e')],_0x1f2d2,_0x1d00('0x45'));})[_0x1d00('0x1c')](function(_0x13912e){_0x3e830c=_0x13912e;logger[_0x1d00('0x1f')](_0x1d00('0x4f'),_0x3e830c['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3e830c['id'],_0x374dc8[_0x1d00('0x3e')],_0x392522[_0x1d00('0x35')]);switch(_0x392522[_0x1d00('0x35')]){case _0x1d00('0x50'):emit(util['format'](_0x1d00('0x51'),_0x374dc8[_0x1d00('0x3e')]),_0x1d00('0x52'),{'recordId':_0x3e830c['id']});break;case _0x1d00('0x53'):emit(util['format']('user:%s',_0x374dc8[_0x1d00('0x3e')]),'trigger:browser:url',{'uri':util[_0x1d00('0x2f')](_0x1d00('0x54'),_0x1f2d2['instanceUrl'],_0x3e830c['id'])});break;default:logger['error'](_0x1d00('0x55'));}})[_0x1d00('0x56')](function(_0x3650bb){logger[_0x1d00('0x57')]('[QUEUE]',JSON[_0x1d00('0x58')](_0x3650bb));});};exports['outbound']=function(_0x46e4ea,_0x442db6,_0x51706e,_0xfadc02,_0x1b6277,_0x2f22fe,_0x1aab88){var _0x569270,_0xddf263,_0x15fa24,_0x34050b;_0x2f22fe[_0x1d00('0x46')]=intUtil[_0x1d00('0x47')](_0x2f22fe[_0x1d00('0x46')]);_0x2f22fe['remoteUri']=intUtil[_0x1d00('0x47')](_0x2f22fe['remoteUri']);if(_0x1aab88&&_0x1aab88[_0x1d00('0x59')]&&_0x1aab88[_0x1d00('0x59')]!==_0x1d00('0x5a')){logger['info'](_0x1d00('0x5b'),_0x1d00('0x4a'));_0x442db6[_0x1d00('0x4d')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f22fe[_0x1d00('0x46')],_0x442db6[_0x1d00('0x4c')],md5(_0x442db6[_0x1d00('0x4c')]));}return getConnection(_0x2f22fe)[_0x1d00('0x1c')](function(_0x31d955){_0x34050b=_0x31d955;return getUser(_0x2f22fe,_0xfadc02[_0x1d00('0x5c')],_0x34050b);})[_0x1d00('0x1c')](function(_0x5e38e4){_0x569270=_0x5e38e4;return getEndUser(_0x2f22fe,_0x51706e,_0x442db6[_0x1d00('0x5d')],_0x442db6[_0x1d00('0x5e')],_0x34050b);})['then'](function(_0xf53ee0){_0xddf263=_0xf53ee0;return getTicket(_0x2f22fe,_0x569270,_0xddf263,_0x51706e,_0x442db6,_0x51706e[_0x1d00('0x4e')],_0x34050b,_0x1d00('0x5f'));})['then'](function(_0x26ed1b){_0x15fa24=_0x26ed1b;logger[_0x1d00('0x1f')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x15fa24['id']);logger[_0x1d00('0x1f')](_0x1d00('0x60'),_0x15fa24['id'],_0xfadc02[_0x1d00('0x3e')],_0x2f22fe[_0x1d00('0x35')]);switch(_0x2f22fe['type']){case _0x1d00('0x50'):emit(util['format'](_0x1d00('0x51'),_0xfadc02[_0x1d00('0x3e')]),_0x1d00('0x52'),{'recordId':_0x15fa24['id']});break;case'newTab':emit(util[_0x1d00('0x2f')](_0x1d00('0x51'),_0xfadc02[_0x1d00('0x3e')]),_0x1d00('0x61'),{'uri':util[_0x1d00('0x2f')]('%s/%s/e',_0x34050b[_0x1d00('0x62')],_0x15fa24['id'])});break;default:logger[_0x1d00('0x57')](_0x1d00('0x5b'),_0x1d00('0x63'));}})[_0x1d00('0x56')](function(_0x4916c6){logger[_0x1d00('0x57')](_0x1d00('0x5b'),JSON[_0x1d00('0x58')](_0x4916c6));});};exports[_0x1d00('0x64')]=function(_0x20881d,_0x2c9f7f,_0x22c06a,_0x417730,_0x3d941d,_0x254442){var _0x106d98,_0x376998,_0x5ab3f4,_0x3a7866;_0x254442[_0x1d00('0x46')]=intUtil[_0x1d00('0x47')](_0x254442[_0x1d00('0x46')]);_0x254442[_0x1d00('0x42')]=intUtil['stripTrailingSlash'](_0x254442[_0x1d00('0x42')]);if(_0x3d941d&&_0x3d941d[_0x1d00('0x48')]){logger[_0x1d00('0x1f')]('[ABANDONED]',_0x1d00('0x4a'));_0x2c9f7f['recordingURL']=util[_0x1d00('0x2f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x254442[_0x1d00('0x46')],_0x2c9f7f[_0x1d00('0x4c')],md5(_0x2c9f7f[_0x1d00('0x4c')]));}else{_0x2c9f7f[_0x1d00('0x4d')]='';}return getConnection(_0x254442)[_0x1d00('0x1c')](function(_0x1d2df8){_0x3a7866=_0x1d2df8;if(!_['isNil'](_0x417730)){return getUser(_0x254442,_0x417730['name'],_0x3a7866);}else{return getUser(_0x254442,null,_0x3a7866);}})[_0x1d00('0x1c')](function(_0x39ae51){_0x106d98=_0x39ae51;return getEndUser(_0x254442,_0x22c06a,_0x2c9f7f[_0x1d00('0x65')],_0x2c9f7f[_0x1d00('0x66')],_0x3a7866);})['then'](function(_0x107750){_0x376998=_0x107750;return getTicket(_0x254442,_0x106d98,_0x376998,_0x22c06a,_0x2c9f7f,_0x22c06a[_0x1d00('0x4e')],_0x3a7866);})['then'](function(_0x3ca4b2){_0x5ab3f4=_0x3ca4b2;logger[_0x1d00('0x1f')](_0x1d00('0x67'),_0x5ab3f4['id']);logger['info'](_0x1d00('0x68'),_0x254442['type']);})['catch'](function(_0xd7ae28){logger[_0x1d00('0x57')](_0x1d00('0x69'),JSON[_0x1d00('0x58')](_0xd7ae28));});}; \ 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 83230ed..d8aff99 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(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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 45a899e..7980350 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 _0x827e=['resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','string','nameField','customField','toLowerCase','content','custom_fields','idField','type','variable','customVariable','Variable','POST','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','Calls','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','[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','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','catch','error','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','monitor_format','isNil','calleridnum','[ABANDONED]','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','localhost','socket.io-emitter','redis','emit','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','description','getString','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','length','forEach','variableName','push','set_entry','JSON','stringify','format','Basic\x20%s','apiKey','toString','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value'];(function(_0x1c06f4,_0x2feba6){var _0x1a727e=function(_0x2e83af){while(--_0x2e83af){_0x1c06f4['push'](_0x1c06f4['shift']());}};_0x1a727e(++_0x2feba6);}(_0x827e,0x1b6));var _0xe827=function(_0x216dfc,_0x17aff8){_0x216dfc=_0x216dfc-0x0;var _0x221a02=_0x827e[_0x216dfc];return _0x221a02;};'use strict';var _=require('lodash');var rp=require(_0xe827('0x0'));var BPromise=require('bluebird');var md5=require(_0xe827('0x1'));var util=require(_0xe827('0x2'));var Redis=require('ioredis');var intUtil=require(_0xe827('0x3'));var config=require(_0xe827('0x4'));var logger=require(_0xe827('0x5'))(_0xe827('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0xe827('0x7'),'port':0x18eb});var io=require(_0xe827('0x8'))(new Redis(config[_0xe827('0x9')]));var def={'method':'POST','json':!![]};function emit(_0x4ac9e6,_0x2d829b,_0x4b98ce){io['to'](_0x4ac9e6)[_0xe827('0xa')](_0x2d829b,_0x4b98ce);}function getTicket(_0x31af12,_0x42e03d,_0x12c0f5,_0x4b7bd5,_0x2d5586,_0x343293,_0x37d4ac,_0x466b1f){logger[_0xe827('0xb')](_0xe827('0xc'));var _0x472d29=new Date();var _0xbf8143=[{'name':_0xe827('0xd'),'value':intUtil['getString'](_0x4b7bd5[_0xe827('0xe')],_0x2d5586,'\x20')},{'name':_0xe827('0xf'),'value':_0x42e03d['id']},{'name':'created_by','value':_0x42e03d['id']},{'name':_0xe827('0x10'),'value':intUtil[_0xe827('0x11')](_0x4b7bd5['Descriptions'],_0x2d5586,'\x0a')},{'name':_0xe827('0x12'),'value':_0x472d29[_0xe827('0x13')]()[_0xe827('0x14')](0x0,0x13)[_0xe827('0x15')]('T','\x20')},{'name':_0xe827('0x16'),'value':'0'},{'name':_0xe827('0x17'),'value':'15'},{'name':_0xe827('0x18'),'value':_0x12c0f5['id']},{'name':_0xe827('0x19'),'value':'Contacts'},{'name':_0xe827('0x1a'),'value':_0x12c0f5[_0xe827('0xd')]},{'name':_0xe827('0x1b'),'value':_0x466b1f}];if(_0x343293[_0xe827('0x1c')]){_[_0xe827('0x1d')](_0x343293,function(_0x156d93){if(_0x2d5586[_0x156d93[_0xe827('0x1e')]]){_0xbf8143[_0xe827('0x1f')]({'name':_0x156d93['idField'],'value':_0x2d5586[_0x156d93['variableName']]});}});}return request({'form':{'method':_0xe827('0x20'),'input_type':_0xe827('0x21'),'response_type':'JSON','rest_data':JSON[_0xe827('0x22')]({'session':_0x37d4ac['id'],'module_name':'Calls','name_value_list':_0xbf8143})}});}function getAuth(_0x5b1257){return util[_0xe827('0x23')](_0xe827('0x24'),new Buffer(_0x5b1257[_0xe827('0x25')]+':X')[_0xe827('0x26')]('base64'));}function getServerInfo(_0x3e9a02){return request({'form':{'method':_0xe827('0x27'),'input_type':_0xe827('0x21'),'response_type':_0xe827('0x21'),'rest_data':JSON[_0xe827('0x22')]({'session':_0x3e9a02['id']})}});}function getUser(_0x57584b,_0x532c08,_0xaed1d5){if(!_['isNil'](_0x532c08)){logger[_0xe827('0xb')](_0xe827('0x28'),_0x532c08);return request({'form':{'method':_0xe827('0x29'),'input_type':_0xe827('0x21'),'response_type':_0xe827('0x21'),'rest_data':JSON[_0xe827('0x22')]({'session':_0xaed1d5['id'],'module_name':_0xe827('0x2a'),'query':util[_0xe827('0x23')](_0xe827('0x2b'),_0x532c08),'order_by':'','offset':'0','select_fields':['id',_0xe827('0xd'),_0xe827('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe827('0x2d')](function(_0x2342b4){if(_0x2342b4[_0xe827('0x2e')][_0xe827('0x1c')]){var _0x39aac7=_[_0xe827('0x2f')](_0x2342b4['entry_list'],function(_0x58e32a){return _0x58e32a[_0xe827('0x30')][_0xe827('0x2c')][_0xe827('0x31')]===_0x532c08;});if(_0x39aac7){logger['info']('Agent\x20found!');return BPromise[_0xe827('0x32')]({'id':_0x39aac7[_0xe827('0x30')]['id'][_0xe827('0x31')],'name':_0x39aac7['name_value_list'][_0xe827('0xd')][_0xe827('0x31')]});}}logger[_0xe827('0xb')](_0xe827('0x33'));return BPromise[_0xe827('0x32')]({'id':_0xaed1d5[_0xe827('0x30')]['user_id'][_0xe827('0x31')],'name':_0xaed1d5[_0xe827('0x30')][_0xe827('0x2c')][_0xe827('0x31')]});});}else{logger[_0xe827('0xb')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xe827('0x32')]({'id':_0xaed1d5[_0xe827('0x30')][_0xe827('0x34')]['value'],'name':_0xaed1d5[_0xe827('0x30')][_0xe827('0x2c')][_0xe827('0x31')]});}}function getEndUser(_0x20e02f,_0xcc4a79,_0x2ea6e4,_0x4b16d3){logger[_0xe827('0xb')](_0xe827('0x35'),_0x2ea6e4);return request({'form':{'method':'get_entry_list','input_type':_0xe827('0x21'),'response_type':_0xe827('0x21'),'rest_data':JSON['stringify']({'session':_0x4b16d3['id'],'module_name':_0xe827('0x36'),'query':util[_0xe827('0x23')](_0xe827('0x37'),_0x2ea6e4),'order_by':'','offset':'0','select_fields':['id',_0xe827('0xd'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe827('0x2d')](function(_0xcba9b0){if(_0xcba9b0[_0xe827('0x2e')]['length']){var _0x183a1e=_[_0xe827('0x2f')](_0xcba9b0['entry_list'],function(_0x1d81a6){return _0x1d81a6['name_value_list'][_0xe827('0x38')][_0xe827('0x31')]===_0x2ea6e4;});if(_0x183a1e){logger[_0xe827('0xb')](_0xe827('0x39'));return BPromise['resolve']({'id':_0x183a1e[_0xe827('0x30')]['id'][_0xe827('0x31')],'name':_0x183a1e[_0xe827('0x30')][_0xe827('0xd')][_0xe827('0x31')],'phone':_0x183a1e[_0xe827('0x30')]['phone_home'][_0xe827('0x31')]});}}else{logger[_0xe827('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xe827('0x20'),'input_type':_0xe827('0x21'),'response_type':_0xe827('0x21'),'rest_data':JSON[_0xe827('0x22')]({'session':_0x4b16d3['id'],'module_name':_0xe827('0x36'),'name_value_list':[{'name':_0xe827('0x3a'),'value':_0xcc4a79!==_0xe827('0x3b')?_0xcc4a79:util[_0xe827('0x23')](_0xe827('0x3c'),_0x2ea6e4)},{'name':_0xe827('0x38'),'value':_0x2ea6e4}]})}})[_0xe827('0x2d')](function(_0x39e2fb){logger[_0xe827('0xb')](_0xe827('0x3d'));return BPromise[_0xe827('0x32')]({'id':_0x39e2fb['id'],'name':_0x39e2fb[_0xe827('0x2e')][_0xe827('0x3a')][_0xe827('0x31')],'phone':_0x39e2fb[_0xe827('0x2e')][_0xe827('0x38')][_0xe827('0x31')]});});}});}function request(_0x352dce){logger[_0xe827('0x3e')](_0xe827('0x3f'),JSON[_0xe827('0x22')](_0x352dce));return rp(_[_0xe827('0x40')](def,_0x352dce));}function getTags(_0x201817,_0x622340){var _0x494122=[];if(_0x201817&&_0x201817[_0xe827('0x1c')]>0x0){_0x494122=_[_0xe827('0x41')](_0x201817,_0x622340);}return _0x494122;}function getCustomFields(_0x38e3c8,_0x131069){var _0x41f7a7=[];var _0x3525c3={'custom_fields':[]};if(_0x38e3c8['length']>0x0){_[_0xe827('0x1d')](_0x38e3c8,function(_0x47037d){if(_0x47037d['type']===_0xe827('0x42')&&_0x47037d[_0xe827('0x43')]&&!_0x47037d[_0xe827('0x44')]){_0x3525c3[_0x47037d[_0xe827('0x43')][_0xe827('0x45')]()]=_0x47037d[_0xe827('0x46')]['toString']();}else if(_0x47037d['type']===_0xe827('0x42')&&_0x47037d['idField']&&_0x47037d[_0xe827('0x44')]){_0x3525c3[_0xe827('0x47')][_0xe827('0x1f')]({'id':_0x47037d[_0xe827('0x48')],'value':_0x47037d[_0xe827('0x46')][_0xe827('0x26')]()});}else if(_0x47037d[_0xe827('0x49')]===_0xe827('0x4a')&&_0x47037d['variableName']&&_0x47037d[_0xe827('0x48')]&&_0x47037d[_0xe827('0x44')]){_0x131069[_0x47037d['variableName']]&&_0x3525c3[_0xe827('0x47')][_0xe827('0x1f')]({'id':_0x47037d[_0xe827('0x48')],'value':_0x131069[_0x47037d[_0xe827('0x1e')]]['toString']()});}else if(_0x47037d[_0xe827('0x49')]===_0xe827('0x4b')&&_0x47037d[_0xe827('0x4c')]&&_0x47037d[_0xe827('0x4c')][_0xe827('0xd')]&&_0x47037d[_0xe827('0x48')]&&_0x47037d['customField']){_0x131069[_0x47037d['Variable'][_0xe827('0xd')][_0xe827('0x45')]()]&&_0x3525c3['custom_fields'][_0xe827('0x1f')]({'id':_0x47037d[_0xe827('0x48')],'value':_0x131069[_0x47037d[_0xe827('0x4c')][_0xe827('0xd')]['toLowerCase']()]['toString']()});}});}return _0x3525c3;}function getConnection(_0x40e83d){return request({'method':_0xe827('0x4d'),'form':{'method':_0xe827('0x4e'),'input_type':_0xe827('0x21'),'response_type':_0xe827('0x21'),'rest_data':JSON[_0xe827('0x22')]({'user_auth':{'user_name':_0x40e83d[_0xe827('0x4f')],'password':_0x40e83d[_0xe827('0x50')],'encryption':_0xe827('0x51')},'application':_0xe827('0x52')})}})[_0xe827('0x2d')](function(_0x44d57e){var _0x3f6877=_0x44d57e;if(_0x3f6877['id']){def['sessionID']=_0x3f6877['id'];return BPromise[_0xe827('0x32')](_0x3f6877);}else{throw new Error(util[_0xe827('0x23')](_0xe827('0x53'),_0x40e83d['id']));}});}function setRelationship(_0x30c31d,_0x1c3140,_0x4fc081,_0x31a7fb){return request({'form':{'method':'set_relationship','input_type':_0xe827('0x21'),'response_type':_0xe827('0x21'),'rest_data':JSON[_0xe827('0x22')]({'session':_0x30c31d['id'],'module_name':_0xe827('0x54'),'module_id':_0x4fc081['id'],'link_field_name':_0x31a7fb,'related_ids':[_0x1c3140['id']]})}});}exports['queue']=function(_0x5805c4,_0x536a76,_0x25aaaa,_0x59a369,_0x4898a3,_0x584454){var _0x3baac7,_0x5f2629,_0x3743f4,_0x478a5c;_0x584454['remoteUri']=intUtil[_0xe827('0x55')](_0x584454[_0xe827('0x56')]);_0x584454[_0xe827('0x57')]=intUtil[_0xe827('0x55')](_0x584454[_0xe827('0x57')]);def[_0xe827('0x58')]=util[_0xe827('0x23')](_0xe827('0x59'),_0x584454[_0xe827('0x56')]);if(_0x4898a3&&_0x4898a3['monitor_format']){logger[_0xe827('0xb')](_0xe827('0x5a'),_0xe827('0x5b'));_0x536a76[_0xe827('0x5c')]=util[_0xe827('0x23')](_0xe827('0x5d'),_0x584454[_0xe827('0x57')],_0x536a76[_0xe827('0x5e')],md5(_0x536a76[_0xe827('0x5e')]));}else{_0x536a76[_0xe827('0x5c')]='';}return getConnection(_0x584454)[_0xe827('0x2d')](function(_0x25191b){_0x478a5c=_0x25191b;return getUser(_0x584454,_0x59a369['name'],_0x478a5c);})['then'](function(_0x2e4d24){_0x3baac7=_0x2e4d24;logger['info'](_0xe827('0x5f'),_0x3baac7['id']);return getEndUser(_0x584454,_0x536a76[_0xe827('0x60')],_0x536a76['calleridnum'],_0x478a5c);})[_0xe827('0x2d')](function(_0x2e4846){_0x5f2629=_0x2e4846;logger[_0xe827('0xb')](_0xe827('0x61'),_0x5f2629['id']);return getTicket(_0x584454,_0x3baac7,_0x5f2629,_0x25aaaa,_0x536a76,_0x25aaaa[_0xe827('0x62')],_0x478a5c,_0xe827('0x63'));})['then'](function(_0x208263){_0x3743f4=_0x208263;logger['info']('Ticket\x20created!');logger['info'](_0xe827('0x64'),_0x3743f4['id']);return setRelationship(_0x478a5c,_0x3baac7,_0x3743f4,_0xe827('0x65'));})[_0xe827('0x2d')](function(){return setRelationship(_0x478a5c,_0x5f2629,_0x3743f4,_0xe827('0x66'));})['then'](function(){return getServerInfo(_0x478a5c);})[_0xe827('0x2d')](function(_0xcc77ab){var _0x4497a5=parseInt(_0xcc77ab[_0xe827('0x67')][_0xe827('0x68')](0x0));var _0x37712f=util[_0xe827('0x23')](_0xe827('0x69'),_0x584454[_0xe827('0x56')],_0x3743f4['id']);if(_0x4497a5>0x6){_0x37712f=util[_0xe827('0x23')](_0xe827('0x6a'),_0x584454['remoteUri'],_0x3743f4['id']);}logger[_0xe827('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe827('0x23')](_0xe827('0x6b'),_0x59a369[_0xe827('0xd')]),'trigger:browser:url',{'uri':_0x37712f});})[_0xe827('0x6c')](function(_0x41aaff){logger[_0xe827('0x6d')]('[QUEUE]',JSON[_0xe827('0x22')](_0x41aaff));});};exports['outbound']=function(_0x6f155b,_0x5b9e72,_0x602f22,_0xc8c299,_0xa4bdf2,_0x2beddb,_0x1ac2a5){var _0x533681,_0xad528,_0x44a5b7,_0x442666;_0x2beddb[_0xe827('0x56')]=intUtil[_0xe827('0x55')](_0x2beddb['remoteUri']);_0x2beddb['serverUrl']=intUtil[_0xe827('0x55')](_0x2beddb['serverUrl']);def['uri']=util[_0xe827('0x23')](_0xe827('0x59'),_0x2beddb[_0xe827('0x56')]);if(_0x1ac2a5&&_0x1ac2a5[_0xe827('0x6e')]&&_0x1ac2a5['recordingFormat']!==_0xe827('0x6f')){logger[_0xe827('0xb')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x5b9e72[_0xe827('0x5c')]=util[_0xe827('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2beddb[_0xe827('0x57')],_0x5b9e72['uniqueid'],md5(_0x5b9e72[_0xe827('0x5e')]));}return getConnection(_0x2beddb)['then'](function(_0xae79de){_0x442666=_0xae79de;return getUser(_0x2beddb,_0xc8c299[_0xe827('0xd')],_0x442666);})[_0xe827('0x2d')](function(_0x474cf9){_0x533681=_0x474cf9;logger[_0xe827('0xb')]('The\x20User\x20ID\x20is:',_0x533681['id']);return getEndUser(_0x2beddb,_0x5b9e72[_0xe827('0x70')],_0x5b9e72[_0xe827('0x71')],_0x442666);})[_0xe827('0x2d')](function(_0x48ced3){_0xad528=_0x48ced3;logger[_0xe827('0xb')](_0xe827('0x61'),_0xad528['id']);return getTicket(_0x2beddb,_0x533681,_0xad528,_0x602f22,_0x5b9e72,_0x602f22['Fields'],_0x442666,_0xe827('0x72'));})[_0xe827('0x2d')](function(_0x5c4d0c){_0x44a5b7=_0x5c4d0c;logger[_0xe827('0xb')]('Ticket\x20created!');logger[_0xe827('0xb')](_0xe827('0x64'),_0x44a5b7['id']);return setRelationship(_0x442666,_0x533681,_0x44a5b7,_0xe827('0x65'));})[_0xe827('0x2d')](function(){return setRelationship(_0x442666,_0xad528,_0x44a5b7,_0xe827('0x66'));})[_0xe827('0x2d')](function(){return getServerInfo(_0x442666);})[_0xe827('0x2d')](function(_0xc93cea){var _0x209e11=parseInt(_0xc93cea[_0xe827('0x67')][_0xe827('0x68')](0x0));var _0x2f590e=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2beddb[_0xe827('0x56')],_0x44a5b7['id']);if(_0x209e11>0x6){_0x2f590e=util['format'](_0xe827('0x6a'),_0x2beddb[_0xe827('0x56')],_0x44a5b7['id']);}logger[_0xe827('0xb')](_0xe827('0x73'),_0xe827('0x74'));emit(util[_0xe827('0x23')](_0xe827('0x6b'),_0xc8c299[_0xe827('0xd')]),_0xe827('0x75'),{'uri':_0x2f590e});})['catch'](function(_0x8e5214){logger['error'](_0xe827('0x73'),JSON[_0xe827('0x22')](_0x8e5214));});};exports['abandoned']=function(_0x3443f4,_0x34cd06,_0x195140,_0x1bf790,_0x5ef583,_0x475bd0){var _0x178c65,_0x420c0e,_0x1c96dc,_0x17fbf7;_0x475bd0['remoteUri']=intUtil[_0xe827('0x55')](_0x475bd0['remoteUri']);_0x475bd0['serverUrl']=intUtil[_0xe827('0x55')](_0x475bd0['serverUrl']);def[_0xe827('0x58')]=util['format'](_0xe827('0x59'),_0x475bd0[_0xe827('0x56')]);if(_0x5ef583&&_0x5ef583[_0xe827('0x76')]){logger[_0xe827('0xb')]('[ABANDONED]',_0xe827('0x5b'));_0x34cd06[_0xe827('0x5c')]=util[_0xe827('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x475bd0[_0xe827('0x57')],_0x34cd06[_0xe827('0x5e')],md5(_0x34cd06['uniqueid']));}else{_0x34cd06['recordingURL']='';}return getConnection(_0x475bd0)[_0xe827('0x2d')](function(_0x4b55fe){_0x17fbf7=_0x4b55fe;if(!_[_0xe827('0x77')](_0x1bf790)){return getUser(_0x475bd0,_0x1bf790[_0xe827('0xd')],_0x17fbf7);}else{return getUser(_0x475bd0,null,_0x17fbf7);}})[_0xe827('0x2d')](function(_0x321cea){_0x178c65=_0x321cea;logger[_0xe827('0xb')](_0xe827('0x5f'),_0x178c65['id']);return getEndUser(_0x475bd0,_0x34cd06[_0xe827('0x60')],_0x34cd06[_0xe827('0x78')],_0x17fbf7);})[_0xe827('0x2d')](function(_0x48c83d){_0x420c0e=_0x48c83d;logger[_0xe827('0xb')](_0xe827('0x61'),_0x420c0e['id']);return getTicket(_0x475bd0,_0x178c65,_0x420c0e,_0x195140,_0x34cd06,_0x195140[_0xe827('0x62')],_0x17fbf7,_0xe827('0x63'));})['then'](function(_0x209a29){_0x1c96dc=_0x209a29;logger[_0xe827('0xb')]('Ticket\x20created!');logger['info'](_0xe827('0x64'),_0x1c96dc['id']);return setRelationship(_0x17fbf7,_0x178c65,_0x1c96dc,_0xe827('0x65'));})[_0xe827('0x2d')](function(){return setRelationship(_0x17fbf7,_0x420c0e,_0x1c96dc,_0xe827('0x66'));})['then'](function(){return getServerInfo(_0x17fbf7);})[_0xe827('0x6c')](function(_0xa55ca9){logger[_0xe827('0x6d')](_0xe827('0x79'),JSON['stringify'](_0xa55ca9));});}; \ No newline at end of file +var _0xa36a=['Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','find','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','nameField','toLowerCase','content','type','string','variable','custom_fields','customVariable','Variable','customField','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','uri','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','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','user:%s','trigger:browser:url','error','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','monitor_format','[ABANDONED]','The\x20User\x20ID\x20is:','request-promise','bluebird','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','redis','socket.io-emitter','POST','getString','assigned_user_id','created_by','description','Descriptions','toISOString','slice','duration_hours','duration_minutes','parent_type','Contacts','parent_name','name','length','forEach','push','idField','variableName','JSON','stringify','Basic\x20%s','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','name_value_list','value','info','Agent\x20found!','resolve'];(function(_0x4c1389,_0x2a830c){var _0xc3672e=function(_0xc2146){while(--_0xc2146){_0x4c1389['push'](_0x4c1389['shift']());}};_0xc3672e(++_0x2a830c);}(_0xa36a,0x19d));var _0xaa36=function(_0x3b9434,_0x5bc0b0){_0x3b9434=_0x3b9434-0x0;var _0x559cfe=_0xa36a[_0x3b9434];return _0x559cfe;};'use strict';var _=require('lodash');var rp=require(_0xaa36('0x0'));var BPromise=require(_0xaa36('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xaa36('0x2'));var config=require(_0xaa36('0x3'));var logger=require(_0xaa36('0x4'))(_0xaa36('0x5'));config['redis']=_[_0xaa36('0x6')](config[_0xaa36('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xaa36('0x8'))(new Redis(config['redis']));var def={'method':_0xaa36('0x9'),'json':!![]};function emit(_0xb7606a,_0x5b7e82,_0x1dc67f){io['to'](_0xb7606a)['emit'](_0x5b7e82,_0x1dc67f);}function getTicket(_0x26cde8,_0x2c61dc,_0x570dd8,_0x2978eb,_0x159ad9,_0x3df500,_0x38fc3f,_0x37da20){logger['info']('Creating\x20new\x20ticket...');var _0x56480a=new Date();var _0x1f4f4a=[{'name':'name','value':intUtil[_0xaa36('0xa')](_0x2978eb['Subjects'],_0x159ad9,'\x20')},{'name':_0xaa36('0xb'),'value':_0x2c61dc['id']},{'name':_0xaa36('0xc'),'value':_0x2c61dc['id']},{'name':_0xaa36('0xd'),'value':intUtil[_0xaa36('0xa')](_0x2978eb[_0xaa36('0xe')],_0x159ad9,'\x0a')},{'name':'date_start','value':_0x56480a[_0xaa36('0xf')]()[_0xaa36('0x10')](0x0,0x13)['replace']('T','\x20')},{'name':_0xaa36('0x11'),'value':'0'},{'name':_0xaa36('0x12'),'value':'15'},{'name':'parent_id','value':_0x570dd8['id']},{'name':_0xaa36('0x13'),'value':_0xaa36('0x14')},{'name':_0xaa36('0x15'),'value':_0x570dd8[_0xaa36('0x16')]},{'name':'direction','value':_0x37da20}];if(_0x3df500[_0xaa36('0x17')]){_[_0xaa36('0x18')](_0x3df500,function(_0x29b764){if(_0x159ad9[_0x29b764['variableName']]){_0x1f4f4a[_0xaa36('0x19')]({'name':_0x29b764[_0xaa36('0x1a')],'value':_0x159ad9[_0x29b764[_0xaa36('0x1b')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xaa36('0x1c'),'response_type':_0xaa36('0x1c'),'rest_data':JSON[_0xaa36('0x1d')]({'session':_0x38fc3f['id'],'module_name':'Calls','name_value_list':_0x1f4f4a})}});}function getAuth(_0x1b492d){return util['format'](_0xaa36('0x1e'),new Buffer(_0x1b492d['apiKey']+':X')['toString'](_0xaa36('0x1f')));}function getServerInfo(_0x306e58){return request({'form':{'method':_0xaa36('0x20'),'input_type':_0xaa36('0x1c'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x306e58['id']})}});}function getUser(_0x10b4a8,_0x437cb8,_0x406e12){if(!_[_0xaa36('0x21')](_0x437cb8)){logger['info'](_0xaa36('0x22'),_0x437cb8);return request({'form':{'method':_0xaa36('0x23'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xaa36('0x1d')]({'session':_0x406e12['id'],'module_name':_0xaa36('0x24'),'query':util[_0xaa36('0x25')](_0xaa36('0x26'),_0x437cb8),'order_by':'','offset':'0','select_fields':['id',_0xaa36('0x16'),_0xaa36('0x27')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xaa36('0x28')](function(_0x34d4d9){if(_0x34d4d9[_0xaa36('0x29')]['length']){var _0x3a65f0=_['find'](_0x34d4d9[_0xaa36('0x29')],function(_0x47b0fc){return _0x47b0fc[_0xaa36('0x2a')]['user_name'][_0xaa36('0x2b')]===_0x437cb8;});if(_0x3a65f0){logger[_0xaa36('0x2c')](_0xaa36('0x2d'));return BPromise[_0xaa36('0x2e')]({'id':_0x3a65f0[_0xaa36('0x2a')]['id'][_0xaa36('0x2b')],'name':_0x3a65f0['name_value_list']['name'][_0xaa36('0x2b')]});}}logger[_0xaa36('0x2c')](_0xaa36('0x2f'));return BPromise[_0xaa36('0x2e')]({'id':_0x406e12['name_value_list']['user_id'][_0xaa36('0x2b')],'name':_0x406e12[_0xaa36('0x2a')]['user_name'][_0xaa36('0x2b')]});});}else{logger[_0xaa36('0x2c')](_0xaa36('0x30'));return BPromise[_0xaa36('0x2e')]({'id':_0x406e12['name_value_list'][_0xaa36('0x31')][_0xaa36('0x2b')],'name':_0x406e12[_0xaa36('0x2a')][_0xaa36('0x27')]['value']});}}function getEndUser(_0x533df9,_0xfba828,_0x395b53,_0x25dc9f){logger[_0xaa36('0x2c')](_0xaa36('0x32'),_0x395b53);return request({'form':{'method':_0xaa36('0x23'),'input_type':'JSON','response_type':_0xaa36('0x1c'),'rest_data':JSON[_0xaa36('0x1d')]({'session':_0x25dc9f['id'],'module_name':_0xaa36('0x14'),'query':util[_0xaa36('0x25')](_0xaa36('0x33'),_0x395b53),'order_by':'','offset':'0','select_fields':['id',_0xaa36('0x16'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x1f63d8){if(_0x1f63d8[_0xaa36('0x29')][_0xaa36('0x17')]){var _0x38a0a4=_[_0xaa36('0x34')](_0x1f63d8['entry_list'],function(_0x48277b){return _0x48277b[_0xaa36('0x2a')][_0xaa36('0x35')][_0xaa36('0x2b')]===_0x395b53;});if(_0x38a0a4){logger['info']('Enduser\x20found!');return BPromise[_0xaa36('0x2e')]({'id':_0x38a0a4['name_value_list']['id'][_0xaa36('0x2b')],'name':_0x38a0a4[_0xaa36('0x2a')]['name'][_0xaa36('0x2b')],'phone':_0x38a0a4[_0xaa36('0x2a')]['phone_home'][_0xaa36('0x2b')]});}}else{logger['info'](_0xaa36('0x36'));return request({'form':{'method':'set_entry','input_type':_0xaa36('0x1c'),'response_type':_0xaa36('0x1c'),'rest_data':JSON['stringify']({'session':_0x25dc9f['id'],'module_name':_0xaa36('0x14'),'name_value_list':[{'name':_0xaa36('0x37'),'value':_0xfba828!==_0xaa36('0x38')?_0xfba828:util['format'](_0xaa36('0x39'),_0x395b53)},{'name':_0xaa36('0x35'),'value':_0x395b53}]})}})[_0xaa36('0x28')](function(_0x54d81a){logger[_0xaa36('0x2c')](_0xaa36('0x3a'));return BPromise[_0xaa36('0x2e')]({'id':_0x54d81a['id'],'name':_0x54d81a[_0xaa36('0x29')][_0xaa36('0x37')]['value'],'phone':_0x54d81a[_0xaa36('0x29')]['phone_home'][_0xaa36('0x2b')]});});}});}function request(_0x2e64f3){logger[_0xaa36('0x3b')]('[HTTP]',JSON[_0xaa36('0x1d')](_0x2e64f3));return rp(_[_0xaa36('0x3c')](def,_0x2e64f3));}function getTags(_0x248b34,_0x510d1e){var _0xb4ee4c=[];if(_0x248b34&&_0x248b34[_0xaa36('0x17')]>0x0){_0xb4ee4c=_[_0xaa36('0x3d')](_0x248b34,_0x510d1e);}return _0xb4ee4c;}function getCustomFields(_0x5b98da,_0x17d087){var _0x503814=[];var _0x400e66={'custom_fields':[]};if(_0x5b98da[_0xaa36('0x17')]>0x0){_[_0xaa36('0x18')](_0x5b98da,function(_0xb94c11){if(_0xb94c11['type']==='string'&&_0xb94c11[_0xaa36('0x3e')]&&!_0xb94c11['customField']){_0x400e66[_0xb94c11[_0xaa36('0x3e')][_0xaa36('0x3f')]()]=_0xb94c11[_0xaa36('0x40')]['toString']();}else if(_0xb94c11[_0xaa36('0x41')]===_0xaa36('0x42')&&_0xb94c11[_0xaa36('0x1a')]&&_0xb94c11['customField']){_0x400e66['custom_fields']['push']({'id':_0xb94c11['idField'],'value':_0xb94c11[_0xaa36('0x40')]['toString']()});}else if(_0xb94c11[_0xaa36('0x41')]===_0xaa36('0x43')&&_0xb94c11[_0xaa36('0x1b')]&&_0xb94c11[_0xaa36('0x1a')]&&_0xb94c11['customField']){_0x17d087[_0xb94c11[_0xaa36('0x1b')]]&&_0x400e66[_0xaa36('0x44')][_0xaa36('0x19')]({'id':_0xb94c11[_0xaa36('0x1a')],'value':_0x17d087[_0xb94c11[_0xaa36('0x1b')]]['toString']()});}else if(_0xb94c11[_0xaa36('0x41')]===_0xaa36('0x45')&&_0xb94c11[_0xaa36('0x46')]&&_0xb94c11[_0xaa36('0x46')][_0xaa36('0x16')]&&_0xb94c11[_0xaa36('0x1a')]&&_0xb94c11[_0xaa36('0x47')]){_0x17d087[_0xb94c11[_0xaa36('0x46')][_0xaa36('0x16')]['toLowerCase']()]&&_0x400e66[_0xaa36('0x44')][_0xaa36('0x19')]({'id':_0xb94c11[_0xaa36('0x1a')],'value':_0x17d087[_0xb94c11[_0xaa36('0x46')][_0xaa36('0x16')][_0xaa36('0x3f')]()]['toString']()});}});}return _0x400e66;}function getConnection(_0x3dd94f){return request({'method':'POST','form':{'method':_0xaa36('0x48'),'input_type':_0xaa36('0x1c'),'response_type':_0xaa36('0x1c'),'rest_data':JSON[_0xaa36('0x1d')]({'user_auth':{'user_name':_0x3dd94f['username'],'password':_0x3dd94f[_0xaa36('0x49')],'encryption':_0xaa36('0x4a')},'application':_0xaa36('0x4b')})}})[_0xaa36('0x28')](function(_0x155509){var _0x9c262c=_0x155509;if(_0x9c262c['id']){def[_0xaa36('0x4c')]=_0x9c262c['id'];return BPromise[_0xaa36('0x2e')](_0x9c262c);}else{throw new Error(util[_0xaa36('0x25')](_0xaa36('0x4d'),_0x3dd94f['id']));}});}function setRelationship(_0x5bb817,_0x313c2d,_0x44bbed,_0x28a878){return request({'form':{'method':_0xaa36('0x4e'),'input_type':_0xaa36('0x1c'),'response_type':_0xaa36('0x1c'),'rest_data':JSON[_0xaa36('0x1d')]({'session':_0x5bb817['id'],'module_name':'Calls','module_id':_0x44bbed['id'],'link_field_name':_0x28a878,'related_ids':[_0x313c2d['id']]})}});}exports[_0xaa36('0x4f')]=function(_0x5edf98,_0x3dd877,_0x411bda,_0x5628da,_0x260b2b,_0x1883f8){var _0x5e04ad,_0x5810c8,_0x1ceb4d,_0x2a0aea;_0x1883f8['remoteUri']=intUtil['stripTrailingSlash'](_0x1883f8[_0xaa36('0x50')]);_0x1883f8[_0xaa36('0x51')]=intUtil[_0xaa36('0x52')](_0x1883f8[_0xaa36('0x51')]);def[_0xaa36('0x53')]=util[_0xaa36('0x25')]('%s/service/v4_1/rest.php',_0x1883f8[_0xaa36('0x50')]);if(_0x260b2b&&_0x260b2b['monitor_format']){logger[_0xaa36('0x2c')](_0xaa36('0x54'),'Recording\x20is\x20enabled!');_0x3dd877[_0xaa36('0x55')]=util[_0xaa36('0x25')](_0xaa36('0x56'),_0x1883f8['serverUrl'],_0x3dd877[_0xaa36('0x57')],md5(_0x3dd877[_0xaa36('0x57')]));}else{_0x3dd877['recordingURL']='';}return getConnection(_0x1883f8)[_0xaa36('0x28')](function(_0x195a33){_0x2a0aea=_0x195a33;return getUser(_0x1883f8,_0x5628da[_0xaa36('0x16')],_0x2a0aea);})['then'](function(_0x26fdd3){_0x5e04ad=_0x26fdd3;logger['info']('The\x20User\x20ID\x20is:',_0x5e04ad['id']);return getEndUser(_0x1883f8,_0x3dd877[_0xaa36('0x58')],_0x3dd877[_0xaa36('0x59')],_0x2a0aea);})[_0xaa36('0x28')](function(_0x454404){_0x5810c8=_0x454404;logger['info'](_0xaa36('0x5a'),_0x5810c8['id']);return getTicket(_0x1883f8,_0x5e04ad,_0x5810c8,_0x411bda,_0x3dd877,_0x411bda[_0xaa36('0x5b')],_0x2a0aea,_0xaa36('0x5c'));})[_0xaa36('0x28')](function(_0x5a4ffe){_0x1ceb4d=_0x5a4ffe;logger[_0xaa36('0x2c')](_0xaa36('0x5d'));logger[_0xaa36('0x2c')]('The\x20Ticket\x20ID\x20is:',_0x1ceb4d['id']);return setRelationship(_0x2a0aea,_0x5e04ad,_0x1ceb4d,_0xaa36('0x5e'));})[_0xaa36('0x28')](function(){return setRelationship(_0x2a0aea,_0x5810c8,_0x1ceb4d,_0xaa36('0x5f'));})[_0xaa36('0x28')](function(){return getServerInfo(_0x2a0aea);})[_0xaa36('0x28')](function(_0x2eae2c){var _0x3dfb99=parseInt(_0x2eae2c[_0xaa36('0x60')][_0xaa36('0x61')](0x0));var _0x52813f=util[_0xaa36('0x25')](_0xaa36('0x62'),_0x1883f8[_0xaa36('0x50')],_0x1ceb4d['id']);if(_0x3dfb99>0x6){_0x52813f=util[_0xaa36('0x25')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x1883f8['remoteUri'],_0x1ceb4d['id']);}logger[_0xaa36('0x2c')](_0xaa36('0x54'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xaa36('0x25')](_0xaa36('0x63'),_0x5628da[_0xaa36('0x16')]),_0xaa36('0x64'),{'uri':_0x52813f});})['catch'](function(_0x247830){logger[_0xaa36('0x65')](_0xaa36('0x54'),JSON[_0xaa36('0x1d')](_0x247830));});};exports[_0xaa36('0x66')]=function(_0x2da7e7,_0x1f0a19,_0x3245b4,_0x35666f,_0x45993c,_0x4d3a6c,_0x829767){var _0x799419,_0x2a168c,_0x1e381c,_0x4b62b0;_0x4d3a6c[_0xaa36('0x50')]=intUtil['stripTrailingSlash'](_0x4d3a6c[_0xaa36('0x50')]);_0x4d3a6c[_0xaa36('0x51')]=intUtil[_0xaa36('0x52')](_0x4d3a6c['serverUrl']);def['uri']=util[_0xaa36('0x25')]('%s/service/v4_1/rest.php',_0x4d3a6c[_0xaa36('0x50')]);if(_0x829767&&_0x829767[_0xaa36('0x67')]&&_0x829767[_0xaa36('0x67')]!=='none'){logger[_0xaa36('0x2c')](_0xaa36('0x68'),_0xaa36('0x69'));_0x1f0a19['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d3a6c[_0xaa36('0x51')],_0x1f0a19[_0xaa36('0x57')],md5(_0x1f0a19[_0xaa36('0x57')]));}return getConnection(_0x4d3a6c)[_0xaa36('0x28')](function(_0x5f4438){_0x4b62b0=_0x5f4438;return getUser(_0x4d3a6c,_0x35666f[_0xaa36('0x16')],_0x4b62b0);})[_0xaa36('0x28')](function(_0x2770bf){_0x799419=_0x2770bf;logger[_0xaa36('0x2c')]('The\x20User\x20ID\x20is:',_0x799419['id']);return getEndUser(_0x4d3a6c,_0x1f0a19[_0xaa36('0x6a')],_0x1f0a19[_0xaa36('0x6b')],_0x4b62b0);})[_0xaa36('0x28')](function(_0x3e2fb1){_0x2a168c=_0x3e2fb1;logger[_0xaa36('0x2c')](_0xaa36('0x5a'),_0x2a168c['id']);return getTicket(_0x4d3a6c,_0x799419,_0x2a168c,_0x3245b4,_0x1f0a19,_0x3245b4[_0xaa36('0x5b')],_0x4b62b0,'Outbound');})[_0xaa36('0x28')](function(_0x27d061){_0x1e381c=_0x27d061;logger[_0xaa36('0x2c')](_0xaa36('0x5d'));logger[_0xaa36('0x2c')](_0xaa36('0x6c'),_0x1e381c['id']);return setRelationship(_0x4b62b0,_0x799419,_0x1e381c,_0xaa36('0x5e'));})['then'](function(){return setRelationship(_0x4b62b0,_0x2a168c,_0x1e381c,_0xaa36('0x5f'));})[_0xaa36('0x28')](function(){return getServerInfo(_0x4b62b0);})[_0xaa36('0x28')](function(_0x7072a1){var _0x3acbd8=parseInt(_0x7072a1['version'][_0xaa36('0x61')](0x0));var _0x43fd79=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x4d3a6c[_0xaa36('0x50')],_0x1e381c['id']);if(_0x3acbd8>0x6){_0x43fd79=util[_0xaa36('0x25')](_0xaa36('0x6d'),_0x4d3a6c[_0xaa36('0x50')],_0x1e381c['id']);}logger['info'](_0xaa36('0x68'),_0xaa36('0x6e'));emit(util[_0xaa36('0x25')](_0xaa36('0x63'),_0x35666f[_0xaa36('0x16')]),_0xaa36('0x64'),{'uri':_0x43fd79});})[_0xaa36('0x6f')](function(_0x465145){logger[_0xaa36('0x65')]('[OUTBOUND]',JSON[_0xaa36('0x1d')](_0x465145));});};exports['abandoned']=function(_0x41930e,_0x509e3c,_0x103adc,_0xe4ec0,_0x178002,_0xe52e39){var _0x28fa2c,_0x33b2ca,_0x5d993e,_0x786735;_0xe52e39[_0xaa36('0x50')]=intUtil[_0xaa36('0x52')](_0xe52e39[_0xaa36('0x50')]);_0xe52e39['serverUrl']=intUtil['stripTrailingSlash'](_0xe52e39[_0xaa36('0x51')]);def[_0xaa36('0x53')]=util[_0xaa36('0x25')]('%s/service/v4_1/rest.php',_0xe52e39['remoteUri']);if(_0x178002&&_0x178002[_0xaa36('0x70')]){logger[_0xaa36('0x2c')](_0xaa36('0x71'),_0xaa36('0x69'));_0x509e3c[_0xaa36('0x55')]=util[_0xaa36('0x25')](_0xaa36('0x56'),_0xe52e39[_0xaa36('0x51')],_0x509e3c['uniqueid'],md5(_0x509e3c[_0xaa36('0x57')]));}else{_0x509e3c[_0xaa36('0x55')]='';}return getConnection(_0xe52e39)['then'](function(_0xa3dda8){_0x786735=_0xa3dda8;if(!_[_0xaa36('0x21')](_0xe4ec0)){return getUser(_0xe52e39,_0xe4ec0[_0xaa36('0x16')],_0x786735);}else{return getUser(_0xe52e39,null,_0x786735);}})[_0xaa36('0x28')](function(_0x93b6fb){_0x28fa2c=_0x93b6fb;logger['info'](_0xaa36('0x72'),_0x28fa2c['id']);return getEndUser(_0xe52e39,_0x509e3c[_0xaa36('0x58')],_0x509e3c['calleridnum'],_0x786735);})[_0xaa36('0x28')](function(_0x3b265d){_0x33b2ca=_0x3b265d;logger[_0xaa36('0x2c')](_0xaa36('0x5a'),_0x33b2ca['id']);return getTicket(_0xe52e39,_0x28fa2c,_0x33b2ca,_0x103adc,_0x509e3c,_0x103adc[_0xaa36('0x5b')],_0x786735,'Inbound');})[_0xaa36('0x28')](function(_0x2c0f9f){_0x5d993e=_0x2c0f9f;logger[_0xaa36('0x2c')](_0xaa36('0x5d'));logger[_0xaa36('0x2c')](_0xaa36('0x6c'),_0x5d993e['id']);return setRelationship(_0x786735,_0x28fa2c,_0x5d993e,_0xaa36('0x5e'));})[_0xaa36('0x28')](function(){return setRelationship(_0x786735,_0x33b2ca,_0x5d993e,_0xaa36('0x5f'));})[_0xaa36('0x28')](function(){return getServerInfo(_0x786735);})['catch'](function(_0x1b3adb){logger[_0xaa36('0x65')](_0xaa36('0x71'),JSON[_0xaa36('0x1d')](_0x1b3adb));});}; \ 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 125790c..f148e53 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 _0x2009=['format','%s:\x20%s','keyContent','join','slice','substring','test','util','getString','sortBy','length','string','push','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key'];(function(_0x57c17a,_0x32e378){var _0x391b0b=function(_0x56f9d1){while(--_0x56f9d1){_0x57c17a['push'](_0x57c17a['shift']());}};_0x391b0b(++_0x32e378);}(_0x2009,0x101));var _0x9200=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2009[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9200('0x0'));exports[_0x9200('0x1')]=function(_0x2e0e59,_0x4dcd41,_0x1c3ae4){var _0x559187=[];if(_0x2e0e59['length']>0x0){var _0x1f664c=_[_0x9200('0x2')](_0x2e0e59,['id']);for(var _0x3eca6f=0x0;_0x3eca6f<_0x1f664c[_0x9200('0x3')];_0x3eca6f++){var _0x41b93a=_0x1f664c[_0x3eca6f];if(_0x41b93a['type']===_0x9200('0x4')){_0x559187[_0x9200('0x5')](_0x41b93a[_0x9200('0x6')]);}else if(_0x41b93a[_0x9200('0x7')]===_0x9200('0x8')&&_0x41b93a[_0x9200('0x9')]){_0x4dcd41[_0x41b93a[_0x9200('0x9')]]&&_0x559187[_0x9200('0x5')](_0x4dcd41[_0x41b93a['variableName']][_0x9200('0xa')]());}else if(_0x41b93a[_0x9200('0x7')]===_0x9200('0xb')&&_0x41b93a[_0x9200('0xc')]&&_0x41b93a['Variable'][_0x9200('0xd')]){_0x4dcd41[_0x41b93a[_0x9200('0xc')][_0x9200('0xd')][_0x9200('0xe')]()]&&_0x559187['push'](_0x4dcd41[_0x41b93a[_0x9200('0xc')][_0x9200('0xd')][_0x9200('0xe')]()][_0x9200('0xa')]());}else if(_0x41b93a[_0x9200('0x7')]===_0x9200('0xf')){if(_0x41b93a[_0x9200('0x10')]===_0x9200('0x4')&&_0x41b93a[_0x9200('0x11')]){_0x559187[_0x9200('0x5')](util[_0x9200('0x12')](_0x9200('0x13'),_0x41b93a[_0x9200('0x11')],_0x41b93a[_0x9200('0x14')]));}else if(_0x41b93a['keyType']===_0x9200('0x8')&&_0x41b93a[_0x9200('0x9')]&&_0x41b93a[_0x9200('0x11')]){_0x4dcd41[_0x41b93a['variableName']]&&_0x559187[_0x9200('0x5')](util[_0x9200('0x12')](_0x9200('0x13'),_0x41b93a['key'],_0x4dcd41[_0x41b93a[_0x9200('0x9')]]));}else if(_0x41b93a[_0x9200('0x10')]===_0x9200('0xb')&&_0x41b93a['Variable']&&_0x41b93a[_0x9200('0xc')][_0x9200('0xd')]&&_0x41b93a[_0x9200('0x11')]){_0x4dcd41[_0x41b93a['Variable'][_0x9200('0xd')][_0x9200('0xe')]()]&&_0x559187['push'](util['format'](_0x9200('0x13'),_0x41b93a[_0x9200('0x11')],_0x4dcd41[_0x41b93a[_0x9200('0xc')][_0x9200('0xd')][_0x9200('0xe')]()]));}}}}return _0x559187[_0x9200('0x15')](_0x1c3ae4);};exports['stripTrailingSlash']=function(_0xdd727){var _0x1181b4=_0xdd727[_0x9200('0x16')](-0x1);if(_0x1181b4==='/'){_0xdd727=_0xdd727[_0x9200('0x17')](0x0,_0xdd727['lastIndexOf'](_0x1181b4));}return _0xdd727;};exports['validateEmail']=function(_0x40a2cb){if(!_['isNil'](_0x40a2cb)&&_0x40a2cb!==''){var _0x46e9a6=/^(([^<>()\[\]\\.,;:\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 _0x46e9a6[_0x9200('0x18')](String(_0x40a2cb)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0x271a=['isNil','test','lodash','util','getString','length','string','push','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','format','%s:\x20%s','key','keyType','slice','substring','lastIndexOf','validateEmail'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x271a,0x160));var _0xa271=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x271a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa271('0x0'));var util=require(_0xa271('0x1'));exports[_0xa271('0x2')]=function(_0x3a5993,_0x292849,_0x410367){var _0xf069ac=[];if(_0x3a5993['length']>0x0){var _0x1ed354=_['sortBy'](_0x3a5993,['id']);for(var _0x5ff17f=0x0;_0x5ff17f<_0x1ed354[_0xa271('0x3')];_0x5ff17f++){var _0x3fba2c=_0x1ed354[_0x5ff17f];if(_0x3fba2c['type']===_0xa271('0x4')){_0xf069ac[_0xa271('0x5')](_0x3fba2c['content']);}else if(_0x3fba2c[_0xa271('0x6')]===_0xa271('0x7')&&_0x3fba2c['variableName']){_0x292849[_0x3fba2c[_0xa271('0x8')]]&&_0xf069ac[_0xa271('0x5')](_0x292849[_0x3fba2c[_0xa271('0x8')]][_0xa271('0x9')]());}else if(_0x3fba2c[_0xa271('0x6')]===_0xa271('0xa')&&_0x3fba2c[_0xa271('0xb')]&&_0x3fba2c[_0xa271('0xb')][_0xa271('0xc')]){_0x292849[_0x3fba2c[_0xa271('0xb')][_0xa271('0xc')][_0xa271('0xd')]()]&&_0xf069ac['push'](_0x292849[_0x3fba2c[_0xa271('0xb')]['name'][_0xa271('0xd')]()][_0xa271('0x9')]());}else if(_0x3fba2c[_0xa271('0x6')]===_0xa271('0xe')){if(_0x3fba2c['keyType']===_0xa271('0x4')&&_0x3fba2c['key']){_0xf069ac[_0xa271('0x5')](util[_0xa271('0xf')](_0xa271('0x10'),_0x3fba2c[_0xa271('0x11')],_0x3fba2c['keyContent']));}else if(_0x3fba2c[_0xa271('0x12')]===_0xa271('0x7')&&_0x3fba2c['variableName']&&_0x3fba2c['key']){_0x292849[_0x3fba2c[_0xa271('0x8')]]&&_0xf069ac[_0xa271('0x5')](util[_0xa271('0xf')]('%s:\x20%s',_0x3fba2c[_0xa271('0x11')],_0x292849[_0x3fba2c['variableName']]));}else if(_0x3fba2c[_0xa271('0x12')]===_0xa271('0xa')&&_0x3fba2c[_0xa271('0xb')]&&_0x3fba2c[_0xa271('0xb')]['name']&&_0x3fba2c[_0xa271('0x11')]){_0x292849[_0x3fba2c[_0xa271('0xb')][_0xa271('0xc')][_0xa271('0xd')]()]&&_0xf069ac['push'](util[_0xa271('0xf')](_0xa271('0x10'),_0x3fba2c['key'],_0x292849[_0x3fba2c[_0xa271('0xb')][_0xa271('0xc')][_0xa271('0xd')]()]));}}}}return _0xf069ac['join'](_0x410367);};exports['stripTrailingSlash']=function(_0x53e152){var _0x52cb34=_0x53e152[_0xa271('0x13')](-0x1);if(_0x52cb34==='/'){_0x53e152=_0x53e152[_0xa271('0x14')](0x0,_0x53e152[_0xa271('0x15')](_0x52cb34));}return _0x53e152;};exports[_0xa271('0x16')]=function(_0x465ee3){if(!_[_0xa271('0x17')](_0x465ee3)&&_0x465ee3!==''){var _0x466bac=/^(([^<>()\[\]\\.,;:\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 _0x466bac[_0xa271('0x18')](String(_0x465ee3)[_0xa271('0xd')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index aa0c4af..a09ec27 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(_0x5cff78,_0x38ef55){var _0x2de17b=function(_0xae8acd){while(--_0xae8acd){_0x5cff78['push'](_0x5cff78['shift']());}};_0x2de17b(++_0x38ef55);}(_0x3e74,0x175));var _0x43e7=function(_0x351f19,_0x347d87){_0x351f19=_0x351f19-0x0;var _0x3ed8ad=_0x3e74[_0x351f19];return _0x3ed8ad;};'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 _0x7217=['The\x20User\x20ID\x20is:','calleridname','calleridnum','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','outbound','serverUrl','recordingFormat','none','destcalleridname','destcalleridnum','Fields','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','abandoned','[ABANDONED]','Ticket\x20created!','lodash','bluebird','md5','util','ioredis','./util','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','type','string','idField','content','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','Descriptions','POST','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','then','Agent\x20found!','email1','first_name','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email'];(function(_0x1b6b9b,_0x14a9f8){var _0x2252a4=function(_0x20d2c9){while(--_0x20d2c9){_0x1b6b9b['push'](_0x1b6b9b['shift']());}};_0x2252a4(++_0x14a9f8);}(_0x7217,0x19e));var _0x7721=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x7217[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x7721('0x0'));var rp=require('request-promise');var BPromise=require(_0x7721('0x1'));var md5=require(_0x7721('0x2'));var util=require(_0x7721('0x3'));var Redis=require(_0x7721('0x4'));var intUtil=require(_0x7721('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x7721('0x6'));config[_0x7721('0x7')]=_[_0x7721('0x8')](config[_0x7721('0x7')],{'host':_0x7721('0x9'),'port':0x18eb});var io=require(_0x7721('0xa'))(new Redis(config[_0x7721('0x7')]));function emit(_0x21f680,_0x225610,_0x2f99ed){io['to'](_0x21f680)[_0x7721('0xb')](_0x225610,_0x2f99ed);}function getCustomFields(_0x2a66cb,_0xfa8835){var _0x138740={};if(_0x2a66cb[_0x7721('0xc')]>0x0){_['forEach'](_0x2a66cb,function(_0x461d1a){if(_0x461d1a[_0x7721('0xd')]===_0x7721('0xe')&&_0x461d1a[_0x7721('0xf')]){_0x138740[_0x461d1a[_0x7721('0xf')]]=_0x461d1a[_0x7721('0x10')][_0x7721('0x11')]();}else if(_0x461d1a[_0x7721('0xd')]==='variable'&&_0x461d1a[_0x7721('0x12')]&&_0x461d1a[_0x7721('0xf')]&&_0xfa8835[_0x461d1a['variableName']]){_0x138740[_0x461d1a[_0x7721('0xf')]]=_0xfa8835[_0x461d1a[_0x7721('0x12')]][_0x7721('0x11')]();}else if(_0x461d1a[_0x7721('0xd')]==='customVariable'&&_0x461d1a[_0x7721('0x13')]&&_0x461d1a[_0x7721('0x13')]['name']&&_0x461d1a['idField']&&_0xfa8835[_0x461d1a['Variable'][_0x7721('0x14')][_0x7721('0x15')]()]){_0x138740[_0x461d1a[_0x7721('0xf')]]=_0xfa8835[_0x461d1a[_0x7721('0x13')]['name'][_0x7721('0x15')]()]['toString']();}});}return _0x138740;}function createTicket(_0x3fc09e,_0x5cb0e6,_0xfec626,_0x4e96fb,_0x3ab5a5,_0x3e140d,_0x2286e5){logger[_0x7721('0x16')](_0x7721('0x17'));var _0x413263=_[_0x7721('0x18')]({'parent_id':'','assigned_user_id':_0x5cb0e6['id'],'ticketpriorities':_0x7721('0x19'),'ticketstatus':'Open','ticket_title':intUtil[_0x7721('0x1a')](_0x4e96fb[_0x7721('0x1b')],_0x3ab5a5,'\x20'),'description':intUtil[_0x7721('0x1a')](_0x4e96fb[_0x7721('0x1c')],_0x3ab5a5,'\x0a'),'contact_id':_0xfec626['id']},getCustomFields(_0x3e140d,_0x3ab5a5));var _0x57140c={'method':_0x7721('0x1d'),'uri':util['format'](_0x7721('0x1e'),_0x3fc09e[_0x7721('0x1f')]),'form':{'operation':_0x7721('0x20'),'username':_0x3fc09e[_0x7721('0x21')],'sessionName':_0x2286e5[_0x7721('0x22')],'elementType':_0x7721('0x23'),'element':JSON[_0x7721('0x24')](_0x413263)},'json':!![]};return request(_0x57140c)['then'](function(_0x216f20){if(_0x216f20[_0x7721('0x25')]){return BPromise[_0x7721('0x26')]({'id':_0x216f20[_0x7721('0x27')]['id']});}else{throw new Error(util[_0x7721('0x28')](_0x7721('0x29'),JSON[_0x7721('0x24')](_0x216f20[_0x7721('0x2a')])));}})[_0x7721('0x2b')](function(_0x52316e){var _0x258ddf=_0x52316e['statusCode']||0x1f4;logger['error'](_0x7721('0x2c'),_0x7721('0x2d'),_0x258ddf,JSON[_0x7721('0x24')](_0x52316e));});}function getUser(_0x158d98,_0x1ea4d,_0x37b9f0){if(intUtil[_0x7721('0x2e')](_0x1ea4d)){logger[_0x7721('0x16')]('Getting\x20agent\x20with\x20email',_0x1ea4d);return request({'method':_0x7721('0x2f'),'uri':util[_0x7721('0x28')]('%s/webservice.php',_0x158d98['remoteUri']),'qs':{'operation':_0x7721('0x30'),'username':_0x158d98[_0x7721('0x21')],'sessionName':_0x37b9f0['sessionName'],'query':util[_0x7721('0x28')](_0x7721('0x31'),_0x1ea4d)},'json':!![]})[_0x7721('0x32')](function(_0x58d54b){if(_0x58d54b[_0x7721('0x25')]&&_0x58d54b[_0x7721('0x27')][_0x7721('0xc')]){logger[_0x7721('0x16')](_0x7721('0x33'));return BPromise['resolve']({'id':_0x58d54b[_0x7721('0x27')][0x0]['id'],'email':_0x58d54b[_0x7721('0x27')][0x0][_0x7721('0x34')],'name':_0x58d54b['result'][0x0][_0x7721('0x35')]+'\x20'+_0x58d54b[_0x7721('0x27')]['last_name']});}else{logger[_0x7721('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x7721('0x26')]({'id':_0x37b9f0[_0x7721('0x36')],'email':_0x158d98[_0x7721('0x21')],'name':_0x7721('0x37')});}})[_0x7721('0x2b')](function(_0x13c635){var _0x2f1fe0=_0x13c635[_0x7721('0x38')]||0x1f4;logger[_0x7721('0x2a')](_0x7721('0x2c'),_0x7721('0x39'),_0x2f1fe0,JSON['stringify'](_0x13c635));});}else{logger[_0x7721('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x7721('0x26')]({'id':_0x37b9f0[_0x7721('0x36')],'email':_0x158d98[_0x7721('0x21')],'name':_0x7721('0x37')})[_0x7721('0x2b')](function(_0x378ba5){var _0x482b70=_0x378ba5['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0x7721('0x39'),_0x482b70,JSON[_0x7721('0x24')](_0x378ba5));});}}function getEndUser(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa){logger['info'](_0x7721('0x3a'),_0x4a90ce);return request({'method':_0x7721('0x2f'),'uri':util['format'](_0x7721('0x1e'),_0x1acc72[_0x7721('0x1f')]),'qs':{'operation':'query','username':_0x1acc72['username'],'sessionName':_0xa389fa[_0x7721('0x22')],'query':util[_0x7721('0x28')](_0x7721('0x3b'),_0x4a90ce,_0x4a90ce,_0x4a90ce,_0x4a90ce,_0x4a90ce)},'json':!![]})[_0x7721('0x32')](function(_0x577af9){if(_0x577af9[_0x7721('0x25')]&&_0x577af9[_0x7721('0x27')][_0x7721('0xc')]){logger[_0x7721('0x16')](_0x7721('0x3c'));return BPromise['resolve']({'id':_0x577af9[_0x7721('0x27')][0x0]['id'],'name':_0x577af9['result'][0x0][_0x7721('0x3d')]+'\x20'+_0x577af9['result'][0x0][_0x7721('0x3e')],'phone':_0x4a90ce});}else{logger[_0x7721('0x16')](_0x7721('0x3f'));return request({'method':'POST','uri':util[_0x7721('0x28')](_0x7721('0x1e'),_0x1acc72[_0x7721('0x1f')]),'form':{'operation':'create','sessionName':_0xa389fa[_0x7721('0x22')],'elementType':_0x7721('0x40'),'element':JSON[_0x7721('0x24')]({'lastname':_0x22ef35,'phone':_0x4a90ce,'assigned_user_id':'\x20'})},'json':!![]})[_0x7721('0x32')](function(_0x135dbc){logger[_0x7721('0x16')](_0x7721('0x41'));return BPromise['resolve']({'id':_0x135dbc['result']['id'],'name':_0x135dbc[_0x7721('0x27')][_0x7721('0x3e')],'phone':_0x135dbc[_0x7721('0x27')][_0x7721('0x42')]});})[_0x7721('0x2b')](function(_0x15181b){var _0x1d2ea5=_0x15181b[_0x7721('0x38')]||0x1f4;logger[_0x7721('0x2a')](_0x7721('0x2c'),'getEndUser',_0x1d2ea5,JSON['stringify'](_0x15181b));});}});}function getConnection(_0x5ed70d){var _0x6a4664=_0x5ed70d[_0x7721('0x21')];var _0x219c9f=_0x5ed70d['accessKey'];return request({'method':_0x7721('0x2f'),'uri':util[_0x7721('0x28')]('%s/webservice.php',_0x5ed70d[_0x7721('0x1f')]),'qs':{'operation':'getchallenge','username':_0x6a4664},'json':!![]})[_0x7721('0x32')](function(_0x5c6922){if(_0x5c6922[_0x7721('0x25')]){return request({'method':_0x7721('0x1d'),'uri':util[_0x7721('0x28')]('%s/webservice.php',_0x5ed70d[_0x7721('0x1f')]),'form':{'operation':_0x7721('0x43'),'username':_0x6a4664,'accessKey':md5(_0x5c6922['result'][_0x7721('0x44')]+_0x219c9f)},'json':!![]});}})[_0x7721('0x32')](function(_0xf88e8c){if(_0xf88e8c['success']){return BPromise[_0x7721('0x26')](_0xf88e8c['result']);}else{throw new Error(util[_0x7721('0x28')](_0x7721('0x45'),_0x5ed70d['id']));}})[_0x7721('0x2b')](function(_0x443503){var _0x1c95d8=_0x443503[_0x7721('0x38')]||0x1f4;logger[_0x7721('0x2a')](_0x7721('0x2c'),_0x7721('0x46'),_0x1c95d8,JSON[_0x7721('0x24')](_0x443503));});}function request(_0x31770e){logger[_0x7721('0x16')](_0x7721('0x47'),JSON[_0x7721('0x24')](_0x31770e));return rp(_0x31770e);}exports[_0x7721('0x48')]=function(_0x5b741d,_0x474f32,_0x2f6f30,_0x8e1214,_0x2c1119,_0x1f1ac7){var _0x315127,_0x267f5e,_0x57484c,_0x234bee;_0x1f1ac7[_0x7721('0x1f')]=intUtil[_0x7721('0x49')](_0x1f1ac7[_0x7721('0x1f')]);if(_0x2c1119&&_0x2c1119[_0x7721('0x4a')]){logger[_0x7721('0x16')](_0x7721('0x4b'),_0x7721('0x4c'));_0x474f32[_0x7721('0x4d')]=util[_0x7721('0x28')](_0x7721('0x4e'),_0x1f1ac7['serverUrl'],_0x474f32[_0x7721('0x4f')],md5(_0x474f32[_0x7721('0x4f')]));}else{_0x474f32[_0x7721('0x4d')]='';}return getConnection(_0x1f1ac7)[_0x7721('0x32')](function(_0x15ed3b){_0x234bee=_0x15ed3b;return getUser(_0x1f1ac7,_0x8e1214[_0x7721('0x50')],_0x234bee);})[_0x7721('0x32')](function(_0x36fe6f){_0x315127=_0x36fe6f;logger[_0x7721('0x16')](_0x7721('0x51'),_0x315127['id']);return getEndUser(_0x1f1ac7,_0x474f32[_0x7721('0x52')],_0x474f32[_0x7721('0x53')],_0x234bee);})[_0x7721('0x32')](function(_0x18f7f6){_0x267f5e=_0x18f7f6;logger[_0x7721('0x16')]('The\x20Enduser\x20ID\x20is:',_0x267f5e['id']);return createTicket(_0x1f1ac7,_0x315127,_0x267f5e,_0x2f6f30,_0x474f32,_0x2f6f30['Fields'],_0x234bee);})['then'](function(_0x885a3a){_0x57484c=_0x885a3a;logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x57484c['id']);var _0x47925a=util[_0x7721('0x28')](_0x7721('0x54'),_0x1f1ac7['remoteUri'],_[_0x7721('0x55')](_0x57484c['id'],'x')[0x1]);logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7721('0x28')]('user:%s',_0x8e1214['name']),'trigger:browser:url',{'uri':_0x47925a});})[_0x7721('0x2b')](function(_0x2e9155){logger[_0x7721('0x2a')]('[QUEUE]',JSON[_0x7721('0x24')](_0x2e9155));});};exports[_0x7721('0x56')]=function(_0x2c95d0,_0x168343,_0x6b7c1e,_0x16e80b,_0xad43ce,_0x3e3301,_0x127f46){var _0x197b73,_0x3b03cf,_0x10666e,_0x148562;_0x3e3301[_0x7721('0x1f')]=intUtil[_0x7721('0x49')](_0x3e3301['remoteUri']);_0x3e3301[_0x7721('0x57')]=intUtil[_0x7721('0x49')](_0x3e3301[_0x7721('0x57')]);if(_0x127f46&&_0x127f46[_0x7721('0x58')]&&_0x127f46['recordingFormat']!==_0x7721('0x59')){logger[_0x7721('0x16')]('[OUTBOUND]',_0x7721('0x4c'));_0x168343['recordingURL']=util[_0x7721('0x28')](_0x7721('0x4e'),_0x3e3301[_0x7721('0x57')],_0x168343[_0x7721('0x4f')],md5(_0x168343[_0x7721('0x4f')]));}return getConnection(_0x3e3301)[_0x7721('0x32')](function(_0x3121e0){_0x148562=_0x3121e0;return getUser(_0x3e3301,_0x16e80b[_0x7721('0x50')],_0x148562);})[_0x7721('0x32')](function(_0x57759a){_0x197b73=_0x57759a;logger[_0x7721('0x16')](_0x7721('0x51'),_0x197b73['id']);return getEndUser(_0x3e3301,_0x168343[_0x7721('0x5a')],_0x168343[_0x7721('0x5b')],_0x148562);})[_0x7721('0x32')](function(_0x3ed425){_0x3b03cf=_0x3ed425;logger[_0x7721('0x16')]('The\x20Enduser\x20ID\x20is:',_0x3b03cf['id']);return createTicket(_0x3e3301,_0x197b73,_0x3b03cf,_0x6b7c1e,_0x168343,_0x6b7c1e[_0x7721('0x5c')],_0x148562);})[_0x7721('0x32')](function(_0x53c918){_0x10666e=_0x53c918;logger[_0x7721('0x16')]('Ticket\x20created!');logger[_0x7721('0x16')](_0x7721('0x5d'),_0x10666e['id']);var _0x4282ba=util[_0x7721('0x28')](_0x7721('0x54'),_0x3e3301[_0x7721('0x1f')],_[_0x7721('0x55')](_0x10666e['id'],'x')[0x1]);logger['info'](_0x7721('0x5e'),_0x7721('0x5f'));emit(util[_0x7721('0x28')]('user:%s',_0x16e80b['name']),'trigger:browser:url',{'uri':_0x4282ba});})['catch'](function(_0x5e966f){logger[_0x7721('0x2a')](_0x7721('0x5e'),JSON['stringify'](_0x5e966f));});};exports[_0x7721('0x60')]=function(_0x42f6e9,_0xbbc86f,_0x4593e1,_0x53ebb1,_0x275b25,_0xfe9fb8){var _0x322afc,_0x1bea13,_0x3cf3fd,_0x53adb1;_0xfe9fb8[_0x7721('0x1f')]=intUtil[_0x7721('0x49')](_0xfe9fb8[_0x7721('0x1f')]);_0xfe9fb8['serverUrl']=intUtil['stripTrailingSlash'](_0xfe9fb8[_0x7721('0x57')]);if(_0x275b25&&_0x275b25[_0x7721('0x4a')]){logger[_0x7721('0x16')](_0x7721('0x61'),_0x7721('0x4c'));_0xbbc86f['recordingURL']=util['format'](_0x7721('0x4e'),_0xfe9fb8[_0x7721('0x57')],_0xbbc86f[_0x7721('0x4f')],md5(_0xbbc86f[_0x7721('0x4f')]));}else{_0xbbc86f[_0x7721('0x4d')]='';}return getConnection(_0xfe9fb8)[_0x7721('0x32')](function(_0x34187f){_0x53adb1=_0x34187f;return getUser(_0xfe9fb8,'',_0x53adb1);})['then'](function(_0xdfae41){_0x322afc=_0xdfae41;logger[_0x7721('0x16')](_0x7721('0x51'),_0x322afc['id']);return getEndUser(_0xfe9fb8,_0xbbc86f['calleridname'],_0xbbc86f[_0x7721('0x53')],_0x53adb1);})[_0x7721('0x32')](function(_0xdcd3e0){_0x1bea13=_0xdcd3e0;logger[_0x7721('0x16')]('The\x20Enduser\x20ID\x20is:',_0x1bea13['id']);return createTicket(_0xfe9fb8,_0x322afc,_0x1bea13,_0x4593e1,_0xbbc86f,_0x4593e1['Fields'],_0x53adb1);})[_0x7721('0x32')](function(_0x2cac50){_0x3cf3fd=_0x2cac50;logger[_0x7721('0x16')](_0x7721('0x62'));logger[_0x7721('0x16')](_0x7721('0x5d'),_0x3cf3fd['id']);})['catch'](function(_0x3855d5){logger[_0x7721('0x2a')](_0x7721('0x61'),JSON['stringify'](_0x3855d5));});}; \ 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 8351613..daf6d1b 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 _0xccdc=['lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','Ticket\x20created!','ticket','validateEmail','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','forEach','type','string','nameField','customField','toLowerCase','content','idField','push','variable','variableName','Variable','custom_fields','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:browser:url','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','recordingURL','destcalleridname','destcalleridnum','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration'];(function(_0x305cc7,_0x4c8edf){var _0x4c49eb=function(_0x3f764b){while(--_0x3f764b){_0x305cc7['push'](_0x305cc7['shift']());}};_0x4c49eb(++_0x4c8edf);}(_0xccdc,0x1c4));var _0xcccd=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xccdc[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0xcccd('0x0'));var rp=require(_0xcccd('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xcccd('0x2'));var intUtil=require(_0xcccd('0x3'));var config=require(_0xcccd('0x4'));var logger=require(_0xcccd('0x5'))(_0xcccd('0x6'));config[_0xcccd('0x7')]=_[_0xcccd('0x8')](config[_0xcccd('0x7')],{'host':_0xcccd('0x9'),'port':0x18eb});var io=require(_0xcccd('0xa'))(new Redis(config['redis']));function emit(_0x4cc734,_0x270368,_0x1b8c05){io['to'](_0x4cc734)[_0xcccd('0xb')](_0x270368,_0x1b8c05);}var headers={'Content-Type':_0xcccd('0xc'),'Accept':_0xcccd('0xc')};function getTicket(_0x1d921f,_0x21924b,_0x490551,_0x1413db,_0xe3a013){logger[_0xcccd('0xd')](_0xcccd('0xe'));return request({'uri':util[_0xcccd('0xf')](_0xcccd('0x10'),_0x1d921f[_0xcccd('0x11')]),'method':_0xcccd('0x12'),'body':{'ticket':_[_0xcccd('0x13')]({'requester_id':_0x490551['id'],'submitter_id':_0x21924b?_0x21924b['id']:undefined,'assignee_id':_0x21924b?_0x21924b['id']:undefined,'tags':getTags(_0x1413db[_0xcccd('0x14')],_0xcccd('0x15')),'subject':intUtil[_0xcccd('0x16')](_0x1413db[_0xcccd('0x17')],_0xe3a013,'\x20'),'description':intUtil[_0xcccd('0x16')](_0x1413db[_0xcccd('0x18')],_0xe3a013,'\x0a'),'comment':{'public':![],'body':intUtil[_0xcccd('0x16')](_0x1413db[_0xcccd('0x18')],_0xe3a013,'\x0a')}},getCustomFields(_0x1413db[_0xcccd('0x19')],_0xe3a013))}})['then'](function(_0x4aaf37){logger[_0xcccd('0xd')](_0xcccd('0x1a'));return _0x4aaf37[_0xcccd('0x1b')];});}function getUser(_0x530710,_0x4a878e){if(intUtil[_0xcccd('0x1c')](_0x4a878e)){logger[_0xcccd('0xd')]('Getting\x20agent\x20with\x20email',_0x4a878e);return request({'uri':util[_0xcccd('0xf')]('%s/search.json',_0x530710['remoteUri']),'qs':{'query':util[_0xcccd('0xf')](_0xcccd('0x1d'),_0x4a878e)}})[_0xcccd('0x1e')](function(_0xa5a57f){if(_0xa5a57f[_0xcccd('0x1f')]){logger[_0xcccd('0xd')](_0xcccd('0x20'));return _[_0xcccd('0x21')](_0xa5a57f[_0xcccd('0x22')],{'email':_0x4a878e,'role':_0xcccd('0x23')});}else{logger[_0xcccd('0xd')](_0xcccd('0x24'));return request({'uri':util[_0xcccd('0xf')](_0xcccd('0x25'),_0x530710['remoteUri'])})['then'](function(_0x5d9df1){logger[_0xcccd('0xd')](_0xcccd('0x26'));return _0x5d9df1[_0xcccd('0x27')];});}});}else{logger[_0xcccd('0xd')](_0xcccd('0x24'));return request({'uri':util[_0xcccd('0xf')]('%s/users/me.json',_0x530710[_0xcccd('0x11')])})[_0xcccd('0x1e')](function(_0x55cff5){logger['info'](_0xcccd('0x26'));return _0x55cff5[_0xcccd('0x27')];});}}function getEndUser(_0x21932e,_0x79a0dc,_0x2dbdc3){logger['info'](_0xcccd('0x28'),_0x2dbdc3);return request({'uri':util[_0xcccd('0xf')](_0xcccd('0x29'),_0x21932e['remoteUri']),'qs':{'query':util[_0xcccd('0xf')]('type:user\x20role:end-user\x20phone:%s',_0x2dbdc3)}})[_0xcccd('0x1e')](function(_0x536d7b){var _0x271c6b;if(_0x536d7b[_0xcccd('0x22')][_0xcccd('0x2a')]){_0x536d7b['results']=_[_0xcccd('0x2b')](_0x536d7b['results'],{'suspended':![],'role':_0xcccd('0x2c')});if(_0x536d7b['results']['length']){_0x271c6b=_[_0xcccd('0x2d')](_0x536d7b[_0xcccd('0x22')]);}}if(_0x271c6b){logger['info'](_0xcccd('0x2e'));return _0x271c6b;}else{logger['info'](_0xcccd('0x2f'));return request({'uri':util[_0xcccd('0xf')](_0xcccd('0x30'),_0x21932e[_0xcccd('0x11')]),'method':_0xcccd('0x12'),'body':{'user':{'role':_0xcccd('0x2c'),'name':util[_0xcccd('0xf')](_0xcccd('0x31'),_0x79a0dc||_0x2dbdc3),'phone':_0x2dbdc3}}})[_0xcccd('0x1e')](function(_0x129806){logger[_0xcccd('0xd')]('Enduser\x20created.');return _0x129806[_0xcccd('0x27')];});}});}function getAuth(_0x6515c4){var _0x5d8891;if(_0x6515c4[_0xcccd('0x32')]===_0xcccd('0x33')){_0x5d8891=util[_0xcccd('0xf')](_0xcccd('0x34'),_0x6515c4[_0xcccd('0x35')],_0x6515c4['password']);}else if(_0x6515c4[_0xcccd('0x32')]===_0xcccd('0x36')){_0x5d8891=util[_0xcccd('0xf')](_0xcccd('0x37'),_0x6515c4['username'],_0x6515c4['token']);}return util[_0xcccd('0xf')](_0xcccd('0x38'),new Buffer(_0x5d8891)[_0xcccd('0x39')](_0xcccd('0x3a')));}function request(_0x217463){logger['debug'](_0xcccd('0x3b'),JSON[_0xcccd('0x3c')](_0x217463));return rp(_['defaults'](_0x217463,{'method':_0xcccd('0x3d'),'headers':headers,'json':!![]}));}function getTags(_0x508fd6,_0x443f00){var _0x4e8439=[];if(_0x508fd6&&_0x508fd6['length']>0x0){_0x4e8439=_['map'](_0x508fd6,_0x443f00);}return _0x4e8439;}function getCustomFields(_0x2f4824,_0x15a170){var _0x6edda8=[];var _0x5da716={'custom_fields':[]};if(_0x2f4824[_0xcccd('0x2a')]>0x0){_[_0xcccd('0x3e')](_0x2f4824,function(_0x5b913e){if(_0x5b913e[_0xcccd('0x3f')]===_0xcccd('0x40')&&_0x5b913e[_0xcccd('0x41')]&&!_0x5b913e[_0xcccd('0x42')]){_0x5da716[_0x5b913e[_0xcccd('0x41')][_0xcccd('0x43')]()]=_0x5b913e[_0xcccd('0x44')][_0xcccd('0x39')]();}else if(_0x5b913e['type']==='string'&&_0x5b913e[_0xcccd('0x45')]&&_0x5b913e[_0xcccd('0x42')]){_0x5da716['custom_fields'][_0xcccd('0x46')]({'id':_0x5b913e[_0xcccd('0x45')],'value':_0x5b913e[_0xcccd('0x44')][_0xcccd('0x39')]()});}else if(_0x5b913e['type']===_0xcccd('0x47')&&_0x5b913e[_0xcccd('0x48')]&&_0x5b913e[_0xcccd('0x45')]&&_0x5b913e[_0xcccd('0x42')]){_0x15a170[_0x5b913e[_0xcccd('0x48')]]&&_0x5da716['custom_fields'][_0xcccd('0x46')]({'id':_0x5b913e[_0xcccd('0x45')],'value':_0x15a170[_0x5b913e[_0xcccd('0x48')]][_0xcccd('0x39')]()});}else if(_0x5b913e[_0xcccd('0x3f')]==='customVariable'&&_0x5b913e[_0xcccd('0x49')]&&_0x5b913e[_0xcccd('0x49')][_0xcccd('0x15')]&&_0x5b913e[_0xcccd('0x45')]&&_0x5b913e[_0xcccd('0x42')]){_0x15a170[_0x5b913e['Variable']['name'][_0xcccd('0x43')]()]&&_0x5da716[_0xcccd('0x4a')][_0xcccd('0x46')]({'id':_0x5b913e['idField'],'value':_0x15a170[_0x5b913e[_0xcccd('0x49')][_0xcccd('0x15')][_0xcccd('0x43')]()][_0xcccd('0x39')]()});}});}return _0x5da716;}exports[_0xcccd('0x4b')]=function(_0x49e474,_0x1dc15e,_0x405df0,_0x7e4fd9,_0x2aa4b0,_0x31e0b7){var _0x329b1f,_0xfec55;_0x31e0b7[_0xcccd('0x11')]=intUtil[_0xcccd('0x4c')](_0x31e0b7[_0xcccd('0x11')]);_0x31e0b7[_0xcccd('0x4d')]=intUtil[_0xcccd('0x4c')](_0x31e0b7[_0xcccd('0x4d')]);if(_0x2aa4b0&&_0x2aa4b0[_0xcccd('0x4e')]){logger[_0xcccd('0xd')](_0xcccd('0x4f'),_0xcccd('0x50'));_0x1dc15e['recordingURL']=util[_0xcccd('0xf')](_0xcccd('0x51'),_0x31e0b7[_0xcccd('0x4d')],_0x1dc15e[_0xcccd('0x52')],md5(_0x1dc15e['uniqueid']));}else{_0x1dc15e['recordingURL']='';}headers[_0xcccd('0x53')]=getAuth(_0x31e0b7);return getUser(_0x31e0b7,_0x7e4fd9[_0xcccd('0x54')])[_0xcccd('0x1e')](function(_0x3bcd6e){_0x329b1f=_0x3bcd6e;logger[_0xcccd('0xd')](_0xcccd('0x55'),_0x329b1f['id']);return getEndUser(_0x31e0b7,_0x1dc15e[_0xcccd('0x56')],_0x1dc15e[_0xcccd('0x57')]);})[_0xcccd('0x1e')](function(_0x27595d){_0xfec55=_0x27595d;logger[_0xcccd('0xd')](_0xcccd('0x58'),_0xfec55['id']);return getTicket(_0x31e0b7,_0x329b1f,_0xfec55,_0x405df0,_0x1dc15e);})[_0xcccd('0x1e')](function(_0x1119f8){if(_0x1119f8){logger[_0xcccd('0xd')](_0xcccd('0x59'),_0x1119f8['id']);switch(_0x31e0b7['type']){case _0xcccd('0x5a'):logger['info'](_0xcccd('0x4f'),_0xcccd('0x5b'));return request({'uri':util[_0xcccd('0xf')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x31e0b7[_0xcccd('0x11')],_0x329b1f['id'],_0x1119f8['id']),'method':'POST'});case'newTab':logger[_0xcccd('0xd')](_0xcccd('0x4f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xcccd('0xf')](_0xcccd('0x5c'),_0x7e4fd9[_0xcccd('0x15')]),_0xcccd('0x5d'),{'uri':util['format']('%s/agent/tickets/%s',_0x31e0b7[_0xcccd('0x11')],_0x1119f8['id'])});break;default:logger[_0xcccd('0x5e')]('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x2276b0){logger[_0xcccd('0x5e')](_0xcccd('0x5f'),util[_0xcccd('0x60')](_0x2276b0,{'showHidden':!![],'depth':null}));});};exports[_0xcccd('0x61')]=function(_0x2a1d6b,_0x1af88d,_0x1d7e8f,_0x1b6481,_0x42bf30,_0x1d4ca5,_0x879de){var _0x143529,_0x173660;_0x1d4ca5['remoteUri']=intUtil['stripTrailingSlash'](_0x1d4ca5[_0xcccd('0x11')]);_0x1d4ca5[_0xcccd('0x4d')]=intUtil[_0xcccd('0x4c')](_0x1d4ca5[_0xcccd('0x4d')]);if(_0x879de&&_0x879de[_0xcccd('0x62')]&&_0x879de['recordingFormat']!==_0xcccd('0x63')){logger[_0xcccd('0xd')]('[OUTBOUND]',_0xcccd('0x50'));_0x1af88d[_0xcccd('0x64')]=util[_0xcccd('0xf')](_0xcccd('0x51'),_0x1d4ca5[_0xcccd('0x4d')],_0x1af88d['uniqueid'],md5(_0x1af88d[_0xcccd('0x52')]));}headers['Authorization']=getAuth(_0x1d4ca5);return getUser(_0x1d4ca5,_0x1b6481['email'])[_0xcccd('0x1e')](function(_0x3338eb){_0x143529=_0x3338eb;logger[_0xcccd('0xd')](_0xcccd('0x55'),_0x143529['id']);return getEndUser(_0x1d4ca5,_0x1af88d[_0xcccd('0x65')],_0x1af88d[_0xcccd('0x66')]);})[_0xcccd('0x1e')](function(_0x36298d){_0x173660=_0x36298d;logger[_0xcccd('0xd')](_0xcccd('0x58'),_0x173660['id']);return getTicket(_0x1d4ca5,_0x143529,_0x173660,_0x1d7e8f,_0x1af88d);})[_0xcccd('0x1e')](function(_0x565879){if(_0x565879){logger[_0xcccd('0xd')]('The\x20Ticket\x20ID\x20is:',_0x565879['id']);switch(_0x1d4ca5[_0xcccd('0x3f')]){case'integrationTab':logger[_0xcccd('0xd')](_0xcccd('0x67'),_0xcccd('0x5b'));return request({'uri':util['format'](_0xcccd('0x68'),_0x1d4ca5[_0xcccd('0x11')],_0x143529['id'],_0x565879['id']),'method':_0xcccd('0x12')});case _0xcccd('0x69'):logger[_0xcccd('0xd')]('[OUTBOUND]',_0xcccd('0x6a'));emit(util['format']('user:%s',_0x1b6481[_0xcccd('0x15')]),_0xcccd('0x5d'),{'uri':util[_0xcccd('0xf')](_0xcccd('0x6b'),_0x1d4ca5[_0xcccd('0x11')],_0x565879['id'])});break;default:logger[_0xcccd('0x5e')](_0xcccd('0x67'),_0xcccd('0x6c'));}}})[_0xcccd('0x6d')](function(_0x263582){logger[_0xcccd('0x5e')](_0xcccd('0x6e'),util['inspect'](_0x263582,{'showHidden':!![],'depth':null}));});};exports[_0xcccd('0x6f')]=function(_0x1c763d,_0x53ef68,_0x53ccdc,_0x42021d,_0x3307fd,_0xcba45b){var _0x3d054c,_0x632e9c;_0xcba45b[_0xcccd('0x11')]=intUtil['stripTrailingSlash'](_0xcba45b['remoteUri']);_0xcba45b[_0xcccd('0x4d')]=intUtil[_0xcccd('0x4c')](_0xcba45b['serverUrl']);if(_0x3307fd&&_0x3307fd['monitor_format']){logger['info']('[ABANDONED]',_0xcccd('0x50'));_0x53ef68[_0xcccd('0x64')]=util['format'](_0xcccd('0x51'),_0xcba45b['serverUrl'],_0x53ef68[_0xcccd('0x52')],md5(_0x53ef68[_0xcccd('0x52')]));}else{_0x53ef68['recordingURL']='';}headers[_0xcccd('0x53')]=getAuth(_0xcba45b);return getUser(_0xcba45b)[_0xcccd('0x1e')](function(_0x2b58b6){_0x3d054c=_0x2b58b6;logger[_0xcccd('0xd')]('The\x20User\x20ID\x20is:',_0x3d054c['id']);return getEndUser(_0xcba45b,_0x53ef68[_0xcccd('0x56')],_0x53ef68['calleridnum']);})[_0xcccd('0x1e')](function(_0x1de176){_0x632e9c=_0x1de176;logger[_0xcccd('0xd')]('The\x20Enduser\x20ID\x20is:',_0x632e9c['id']);return getTicket(_0xcba45b,_0x3d054c,_0x632e9c,_0x53ccdc,_0x53ef68);})[_0xcccd('0x1e')](function(_0x179dae){if(_0x179dae){logger[_0xcccd('0xd')](_0xcccd('0x59'),_0x179dae['id']);}})[_0xcccd('0x6d')](function(_0x2a3cec){logger[_0xcccd('0x5e')](_0xcccd('0x70'),util[_0xcccd('0x60')](_0x2a3cec,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x181d=['user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','password','username','authType','token','Basic\x20%s','base64','debug','[HTTP]','stringify','GET','map','type','string','nameField','customField','toLowerCase','toString','custom_fields','push','idField','content','variable','variableName','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','application/json','format','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x181d,0x10f));var _0xd181=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x181d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xd181('0x0'));var util=require('util');var Redis=require(_0xd181('0x1'));var intUtil=require(_0xd181('0x2'));var config=require(_0xd181('0x3'));var logger=require(_0xd181('0x4'))('zendesk');config[_0xd181('0x5')]=_[_0xd181('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xd181('0x7'))(new Redis(config['redis']));function emit(_0x46150f,_0x1ae588,_0x24da16){io['to'](_0x46150f)['emit'](_0x1ae588,_0x24da16);}var headers={'Content-Type':_0xd181('0x8'),'Accept':_0xd181('0x8')};function getTicket(_0x2c28b7,_0x74ef22,_0x103eee,_0x589470,_0x51d3ce){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0xd181('0x9')]('%s/tickets.json',_0x2c28b7['remoteUri']),'method':_0xd181('0xa'),'body':{'ticket':_[_0xd181('0xb')]({'requester_id':_0x103eee['id'],'submitter_id':_0x74ef22?_0x74ef22['id']:undefined,'assignee_id':_0x74ef22?_0x74ef22['id']:undefined,'tags':getTags(_0x589470[_0xd181('0xc')],_0xd181('0xd')),'subject':intUtil[_0xd181('0xe')](_0x589470[_0xd181('0xf')],_0x51d3ce,'\x20'),'description':intUtil[_0xd181('0xe')](_0x589470[_0xd181('0x10')],_0x51d3ce,'\x0a'),'comment':{'public':![],'body':intUtil[_0xd181('0xe')](_0x589470[_0xd181('0x10')],_0x51d3ce,'\x0a')}},getCustomFields(_0x589470[_0xd181('0x11')],_0x51d3ce))}})[_0xd181('0x12')](function(_0xd21cff){logger[_0xd181('0x13')](_0xd181('0x14'));return _0xd21cff[_0xd181('0x15')];});}function getUser(_0x49d5ca,_0x28335f){if(intUtil[_0xd181('0x16')](_0x28335f)){logger[_0xd181('0x13')]('Getting\x20agent\x20with\x20email',_0x28335f);return request({'uri':util[_0xd181('0x9')](_0xd181('0x17'),_0x49d5ca[_0xd181('0x18')]),'qs':{'query':util[_0xd181('0x9')](_0xd181('0x19'),_0x28335f)}})[_0xd181('0x12')](function(_0x483615){if(_0x483615[_0xd181('0x1a')]){logger[_0xd181('0x13')]('Agent\x20found!');return _[_0xd181('0x1b')](_0x483615[_0xd181('0x1c')],{'email':_0x28335f,'role':_0xd181('0x1d')});}else{logger['info'](_0xd181('0x1e'));return request({'uri':util[_0xd181('0x9')]('%s/users/me.json',_0x49d5ca[_0xd181('0x18')])})[_0xd181('0x12')](function(_0x1c9531){logger[_0xd181('0x13')](_0xd181('0x1f'));return _0x1c9531[_0xd181('0x20')];});}});}else{logger[_0xd181('0x13')](_0xd181('0x1e'));return request({'uri':util[_0xd181('0x9')]('%s/users/me.json',_0x49d5ca[_0xd181('0x18')])})['then'](function(_0x5abc44){logger[_0xd181('0x13')](_0xd181('0x1f'));return _0x5abc44['user'];});}}function getEndUser(_0x1ecb08,_0xc385c0,_0x1fe568){logger[_0xd181('0x13')](_0xd181('0x21'),_0x1fe568);return request({'uri':util[_0xd181('0x9')](_0xd181('0x17'),_0x1ecb08[_0xd181('0x18')]),'qs':{'query':util[_0xd181('0x9')](_0xd181('0x22'),_0x1fe568)}})['then'](function(_0x133647){var _0x5891ac;if(_0x133647[_0xd181('0x1c')][_0xd181('0x23')]){_0x133647[_0xd181('0x1c')]=_[_0xd181('0x24')](_0x133647[_0xd181('0x1c')],{'suspended':![],'role':_0xd181('0x25')});if(_0x133647['results'][_0xd181('0x23')]){_0x5891ac=_[_0xd181('0x26')](_0x133647['results']);}}if(_0x5891ac){logger['info'](_0xd181('0x27'));return _0x5891ac;}else{logger['info'](_0xd181('0x28'));return request({'uri':util[_0xd181('0x9')](_0xd181('0x29'),_0x1ecb08['remoteUri']),'method':_0xd181('0xa'),'body':{'user':{'role':_0xd181('0x25'),'name':util[_0xd181('0x9')](_0xd181('0x2a'),_0xc385c0||_0x1fe568),'phone':_0x1fe568}}})[_0xd181('0x12')](function(_0x11f0a0){logger[_0xd181('0x13')]('Enduser\x20created.');return _0x11f0a0[_0xd181('0x20')];});}});}function getAuth(_0x37499a){var _0x392f60;if(_0x37499a['authType']===_0xd181('0x2b')){_0x392f60=util['format']('%s:%s',_0x37499a[_0xd181('0x2c')],_0x37499a[_0xd181('0x2b')]);}else if(_0x37499a[_0xd181('0x2d')]==='token'){_0x392f60=util[_0xd181('0x9')]('%s/token:%s',_0x37499a[_0xd181('0x2c')],_0x37499a[_0xd181('0x2e')]);}return util[_0xd181('0x9')](_0xd181('0x2f'),new Buffer(_0x392f60)['toString'](_0xd181('0x30')));}function request(_0x18bfbb){logger[_0xd181('0x31')](_0xd181('0x32'),JSON[_0xd181('0x33')](_0x18bfbb));return rp(_[_0xd181('0x6')](_0x18bfbb,{'method':_0xd181('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x30bffc,_0x267fb2){var _0x4d3eb5=[];if(_0x30bffc&&_0x30bffc[_0xd181('0x23')]>0x0){_0x4d3eb5=_[_0xd181('0x35')](_0x30bffc,_0x267fb2);}return _0x4d3eb5;}function getCustomFields(_0x3971fe,_0x1504a6){var _0x546b3e=[];var _0x220f64={'custom_fields':[]};if(_0x3971fe[_0xd181('0x23')]>0x0){_['forEach'](_0x3971fe,function(_0x530607){if(_0x530607[_0xd181('0x36')]===_0xd181('0x37')&&_0x530607[_0xd181('0x38')]&&!_0x530607[_0xd181('0x39')]){_0x220f64[_0x530607[_0xd181('0x38')][_0xd181('0x3a')]()]=_0x530607['content'][_0xd181('0x3b')]();}else if(_0x530607[_0xd181('0x36')]===_0xd181('0x37')&&_0x530607['idField']&&_0x530607['customField']){_0x220f64[_0xd181('0x3c')][_0xd181('0x3d')]({'id':_0x530607[_0xd181('0x3e')],'value':_0x530607[_0xd181('0x3f')][_0xd181('0x3b')]()});}else if(_0x530607[_0xd181('0x36')]===_0xd181('0x40')&&_0x530607[_0xd181('0x41')]&&_0x530607['idField']&&_0x530607[_0xd181('0x39')]){_0x1504a6[_0x530607[_0xd181('0x41')]]&&_0x220f64['custom_fields'][_0xd181('0x3d')]({'id':_0x530607[_0xd181('0x3e')],'value':_0x1504a6[_0x530607[_0xd181('0x41')]][_0xd181('0x3b')]()});}else if(_0x530607['type']==='customVariable'&&_0x530607['Variable']&&_0x530607['Variable'][_0xd181('0xd')]&&_0x530607['idField']&&_0x530607[_0xd181('0x39')]){_0x1504a6[_0x530607['Variable'][_0xd181('0xd')][_0xd181('0x3a')]()]&&_0x220f64[_0xd181('0x3c')][_0xd181('0x3d')]({'id':_0x530607[_0xd181('0x3e')],'value':_0x1504a6[_0x530607[_0xd181('0x42')]['name'][_0xd181('0x3a')]()]['toString']()});}});}return _0x220f64;}exports['queue']=function(_0x34a87f,_0x20765a,_0x365154,_0x3519cd,_0xcc01bd,_0x2c1bc0){var _0x36d285,_0x520572;_0x2c1bc0[_0xd181('0x18')]=intUtil[_0xd181('0x43')](_0x2c1bc0[_0xd181('0x18')]);_0x2c1bc0[_0xd181('0x44')]=intUtil[_0xd181('0x43')](_0x2c1bc0['serverUrl']);if(_0xcc01bd&&_0xcc01bd[_0xd181('0x45')]){logger[_0xd181('0x13')](_0xd181('0x46'),_0xd181('0x47'));_0x20765a[_0xd181('0x48')]=util[_0xd181('0x9')](_0xd181('0x49'),_0x2c1bc0['serverUrl'],_0x20765a[_0xd181('0x4a')],md5(_0x20765a['uniqueid']));}else{_0x20765a[_0xd181('0x48')]='';}headers[_0xd181('0x4b')]=getAuth(_0x2c1bc0);return getUser(_0x2c1bc0,_0x3519cd[_0xd181('0x4c')])[_0xd181('0x12')](function(_0x6aaff6){_0x36d285=_0x6aaff6;logger[_0xd181('0x13')](_0xd181('0x4d'),_0x36d285['id']);return getEndUser(_0x2c1bc0,_0x20765a['calleridname'],_0x20765a[_0xd181('0x4e')]);})['then'](function(_0x1a3b23){_0x520572=_0x1a3b23;logger[_0xd181('0x13')](_0xd181('0x4f'),_0x520572['id']);return getTicket(_0x2c1bc0,_0x36d285,_0x520572,_0x365154,_0x20765a);})[_0xd181('0x12')](function(_0x3fd12a){if(_0x3fd12a){logger[_0xd181('0x13')]('The\x20Ticket\x20ID\x20is:',_0x3fd12a['id']);switch(_0x2c1bc0[_0xd181('0x36')]){case _0xd181('0x50'):logger[_0xd181('0x13')](_0xd181('0x46'),_0xd181('0x51'));return request({'uri':util[_0xd181('0x9')](_0xd181('0x52'),_0x2c1bc0['remoteUri'],_0x36d285['id'],_0x3fd12a['id']),'method':_0xd181('0xa')});case _0xd181('0x53'):logger['info'](_0xd181('0x46'),_0xd181('0x54'));emit(util[_0xd181('0x9')](_0xd181('0x55'),_0x3519cd[_0xd181('0xd')]),_0xd181('0x56'),{'uri':util['format'](_0xd181('0x57'),_0x2c1bc0[_0xd181('0x18')],_0x3fd12a['id'])});break;default:logger[_0xd181('0x58')]('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xd181('0x59')](function(_0x232ead){logger[_0xd181('0x58')](_0xd181('0x5a'),util[_0xd181('0x5b')](_0x232ead,{'showHidden':!![],'depth':null}));});};exports[_0xd181('0x5c')]=function(_0xdbdb63,_0x5134b8,_0x54b994,_0x4efe94,_0x842c18,_0x193920,_0x403331){var _0x2d185a,_0x219279;_0x193920[_0xd181('0x18')]=intUtil[_0xd181('0x43')](_0x193920[_0xd181('0x18')]);_0x193920[_0xd181('0x44')]=intUtil['stripTrailingSlash'](_0x193920['serverUrl']);if(_0x403331&&_0x403331[_0xd181('0x5d')]&&_0x403331['recordingFormat']!==_0xd181('0x5e')){logger[_0xd181('0x13')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x5134b8[_0xd181('0x48')]=util[_0xd181('0x9')](_0xd181('0x49'),_0x193920[_0xd181('0x44')],_0x5134b8['uniqueid'],md5(_0x5134b8[_0xd181('0x4a')]));}headers[_0xd181('0x4b')]=getAuth(_0x193920);return getUser(_0x193920,_0x4efe94[_0xd181('0x4c')])[_0xd181('0x12')](function(_0x2e51f5){_0x2d185a=_0x2e51f5;logger[_0xd181('0x13')](_0xd181('0x4d'),_0x2d185a['id']);return getEndUser(_0x193920,_0x5134b8['destcalleridname'],_0x5134b8['destcalleridnum']);})[_0xd181('0x12')](function(_0x81f299){_0x219279=_0x81f299;logger['info'](_0xd181('0x4f'),_0x219279['id']);return getTicket(_0x193920,_0x2d185a,_0x219279,_0x54b994,_0x5134b8);})[_0xd181('0x12')](function(_0x1bf8f6){if(_0x1bf8f6){logger[_0xd181('0x13')](_0xd181('0x5f'),_0x1bf8f6['id']);switch(_0x193920[_0xd181('0x36')]){case _0xd181('0x50'):logger[_0xd181('0x13')](_0xd181('0x60'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xd181('0x9')](_0xd181('0x52'),_0x193920[_0xd181('0x18')],_0x2d185a['id'],_0x1bf8f6['id']),'method':_0xd181('0xa')});case _0xd181('0x53'):logger[_0xd181('0x13')]('[OUTBOUND]',_0xd181('0x54'));emit(util[_0xd181('0x9')](_0xd181('0x55'),_0x4efe94[_0xd181('0xd')]),_0xd181('0x56'),{'uri':util[_0xd181('0x9')](_0xd181('0x57'),_0x193920['remoteUri'],_0x1bf8f6['id'])});break;default:logger['error']('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xd181('0x59')](function(_0x2f6158){logger[_0xd181('0x58')](_0xd181('0x61'),util[_0xd181('0x5b')](_0x2f6158,{'showHidden':!![],'depth':null}));});};exports[_0xd181('0x62')]=function(_0x1d057e,_0x403fb5,_0x584692,_0x2687bf,_0x41ff80,_0x58bb15){var _0x4b0274,_0x5829a5;_0x58bb15[_0xd181('0x18')]=intUtil[_0xd181('0x43')](_0x58bb15[_0xd181('0x18')]);_0x58bb15[_0xd181('0x44')]=intUtil[_0xd181('0x43')](_0x58bb15[_0xd181('0x44')]);if(_0x41ff80&&_0x41ff80[_0xd181('0x45')]){logger[_0xd181('0x13')](_0xd181('0x63'),_0xd181('0x47'));_0x403fb5[_0xd181('0x48')]=util[_0xd181('0x9')](_0xd181('0x49'),_0x58bb15[_0xd181('0x44')],_0x403fb5['uniqueid'],md5(_0x403fb5['uniqueid']));}else{_0x403fb5[_0xd181('0x48')]='';}headers[_0xd181('0x4b')]=getAuth(_0x58bb15);return getUser(_0x58bb15)[_0xd181('0x12')](function(_0x4a4c77){_0x4b0274=_0x4a4c77;logger[_0xd181('0x13')](_0xd181('0x4d'),_0x4b0274['id']);return getEndUser(_0x58bb15,_0x403fb5['calleridname'],_0x403fb5[_0xd181('0x4e')]);})[_0xd181('0x12')](function(_0x45b25c){_0x5829a5=_0x45b25c;logger['info'](_0xd181('0x4f'),_0x5829a5['id']);return getTicket(_0x58bb15,_0x4b0274,_0x5829a5,_0x584692,_0x403fb5);})[_0xd181('0x12')](function(_0x6225c7){if(_0x6225c7){logger[_0xd181('0x13')](_0xd181('0x5f'),_0x6225c7['id']);}})[_0xd181('0x59')](function(_0x47d538){logger[_0xd181('0x58')](_0xd181('0x64'),util[_0xd181('0x5b')](_0x47d538,{'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 d06e2d7..a91d823 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 _0xc577=['idField','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','inspect','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Search\x20end\x20user','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','data','/crm/v2/Leads/search?criteria=((Phone:equals:','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','/crm/v2/Contacts','code','SUCCESS','details','Owner','role','first_name','last_name','Subject','getString','Subjects','Descriptions','WhoId','Full_Name','First_Name','Last_Name','utc','format','mm:ss','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','Answered','rejected','Rejected','abandoned','Abandoned','Call_Start_Time','Call_Type','Inbound','merge','Fields','Call\x20created!','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','[OUTBOUND]','/downloads?type=uniqueid&token=','zoho.eu','com','destcalleridname','destcalleridnum','Outbound','calleridnum','[ABANDONED]','lodash','request-promise','md5','util','./util','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','type','string'];(function(_0x2f3067,_0x3bd93d){var _0x63e41e=function(_0x474bba){while(--_0x474bba){_0x2f3067['push'](_0x2f3067['shift']());}};_0x63e41e(++_0x3bd93d);}(_0xc577,0x79));var _0x7c57=function(_0x3dc1c6,_0x8529a1){_0x3dc1c6=_0x3dc1c6-0x0;var _0x3c82ce=_0xc577[_0x3dc1c6];return _0x3c82ce;};'use strict';var _=require(_0x7c57('0x0'));var rp=require(_0x7c57('0x1'));var md5=require(_0x7c57('0x2'));var util=require(_0x7c57('0x3'));var intUtil=require(_0x7c57('0x4'));var moment=require('moment');var Redis=require(_0x7c57('0x5'));var config=require(_0x7c57('0x6'));var logger=require(_0x7c57('0x7'))(_0x7c57('0x8'));config[_0x7c57('0x9')]=_[_0x7c57('0xa')](config['redis'],{'host':_0x7c57('0xb'),'port':0x18eb});var io=require(_0x7c57('0xc'))(new Redis(config[_0x7c57('0x9')]));function emit(_0x50bf9b,_0x31ae2e,_0x2bd91a){io['to'](_0x50bf9b)[_0x7c57('0xd')](_0x31ae2e,_0x2bd91a);}function request(_0x23a07b){logger[_0x7c57('0xe')](_0x7c57('0xf'),JSON[_0x7c57('0x10')](_0x23a07b));return rp(_0x23a07b);}function getCustomFields(_0xabd3c4,_0x16491a){var _0xeb9383={};if(_0xabd3c4['length']>0x0){_['forEach'](_0xabd3c4,function(_0x26690f){if(_0x26690f[_0x7c57('0x11')]===_0x7c57('0x12')&&_0x26690f['idField']){_0xeb9383[_0x26690f[_0x7c57('0x13')]]=_0x26690f[_0x7c57('0x14')]['toString']();}else if(_0x26690f[_0x7c57('0x11')]===_0x7c57('0x15')&&_0x26690f[_0x7c57('0x16')]&&_0x26690f[_0x7c57('0x13')]&&_0x16491a[_0x26690f[_0x7c57('0x16')]]){_0xeb9383[_0x26690f[_0x7c57('0x13')]]=_0x16491a[_0x26690f[_0x7c57('0x16')]][_0x7c57('0x17')]();}else if(_0x26690f[_0x7c57('0x11')]===_0x7c57('0x18')&&_0x26690f[_0x7c57('0x19')]&&_0x26690f[_0x7c57('0x19')][_0x7c57('0x1a')]&&_0x26690f[_0x7c57('0x13')]&&_0x16491a[_0x26690f[_0x7c57('0x19')][_0x7c57('0x1a')][_0x7c57('0x1b')]()]){_0xeb9383[_0x26690f[_0x7c57('0x13')]]=_0x16491a[_0x26690f[_0x7c57('0x19')]['name'][_0x7c57('0x1b')]()][_0x7c57('0x17')]();}});}return _0xeb9383;}function getName(_0x131ad7){if(_0x131ad7[_0x7c57('0x1c')]('\x20')>0x0){var _0x41ee23=_0x131ad7[_0x7c57('0x1d')](/ (.+)/);if(_0x41ee23[0x1]){return _0x41ee23;}}return[_0x131ad7,_0x131ad7];}var accountsTokens={};function getAccessToken(_0x301e58){return new Promise(function(_0xde1a2f,_0x2b9983){if(!_[_0x7c57('0x1e')](accountsTokens[_0x301e58['id']])&&!_[_0x7c57('0x1e')](accountsTokens[_0x301e58['id']][_0x7c57('0x1f')])){if(moment()[_0x7c57('0x20')](accountsTokens[_0x301e58['id']][_0x7c57('0x21')])){_0xde1a2f(accountsTokens[_0x301e58['id']]['access_token']);}}var _0xde6554;switch(_0x301e58[_0x7c57('0x22')]){case'US':_0xde6554=_0x7c57('0x23');break;case'AU':_0xde6554=_0x7c57('0x24');break;case'EU':_0xde6554=_0x7c57('0x25');break;case'IN':_0xde6554='https://accounts.zoho.in';break;case'CN':_0xde6554='https://accounts.zoho.com.cn';break;default:_0xde6554=_0x7c57('0x25');break;}var _0x337d08={'method':_0x7c57('0x26'),'uri':_0xde6554+_0x7c57('0x27'),'qs':{'refresh_token':_0x301e58[_0x7c57('0x28')],'client_id':_0x301e58[_0x7c57('0x29')],'client_secret':_0x301e58[_0x7c57('0x2a')],'grant_type':_0x7c57('0x2b')},'json':!![]};return rp(_0x337d08)[_0x7c57('0x2c')](function(_0x4ec71a){accountsTokens[_0x301e58['id']]={'access_token':_0x4ec71a[_0x7c57('0x1f')],'expires_in':moment()[_0x7c57('0x2d')](_0x4ec71a['expires_in'],'seconds')};_0xde1a2f(_0x4ec71a[_0x7c57('0x1f')]);})[_0x7c57('0x2e')](function(_0xff5fc7){logger[_0x7c57('0x2f')](_0x7c57('0x30'),_0xff5fc7[_0x7c57('0x31')]);_0x2b9983(_0xff5fc7);});});}function getUser(_0xe0604e,_0x50932c,_0x32f739,_0x4d577d){logger[_0x7c57('0x32')]('Search\x20user');return request({'method':_0x7c57('0x33'),'uri':util['format'](_0x7c57('0x34'),_0x50932c),'qs':{'type':_0x7c57('0x35')},'headers':{'Authorization':_0x7c57('0x36')+_0xe0604e},'json':!![]})[_0x7c57('0x2c')](function(_0x11b890){if(_0x11b890[_0x7c57('0x37')]){var _0x58cd47;if(_[_0x7c57('0x38')](_0x11b890['users'])){if(!_['isNil'](_0x4d577d)){_0x58cd47=_[_0x7c57('0x39')](_0x11b890['users'],function(_0x4da46b){return _0x4da46b[_0x7c57('0x3a')]===_0x4d577d;});}if(_0x58cd47>=0x0){logger['info']('Agent\x20found!');}else{logger['info'](_0x7c57('0x3b'));_0x58cd47=_['findIndex'](_0x11b890[_0x7c57('0x37')],function(_0x25258e){return _0x25258e[_0x7c57('0x3c')][_0x7c57('0x1a')]===_0x7c57('0x3d');});}return _0x11b890[_0x7c57('0x37')][_0x58cd47];}else{if(_0x11b890['user'][_0x7c57('0x3c')][_0x7c57('0x1a')]===_0x7c57('0x3d')){logger['info']('Using\x20the\x20admin\x20account!');user=_0x11b890[_0x7c57('0x3e')];return user;}else{logger[_0x7c57('0x2f')](_0x7c57('0x3f'),util[_0x7c57('0x40')](_0x11b890,{'showHidden':![],'depth':null}));throw new Error(_0x7c57('0x41')+util[_0x7c57('0x40')](_0x11b890,{'showHidden':![],'depth':null}));}}}else{logger[_0x7c57('0x2f')](_0x7c57('0x3f'),util[_0x7c57('0x40')](_0x11b890,{'showHidden':![],'depth':null}));throw new Error(_0x7c57('0x41')+util['inspect'](_0x11b890,{'showHidden':![],'depth':null}));}});}function getEndUser(_0x151737,_0x566789,_0x152f9b,_0x23c47e,_0x44e6cc){logger['info'](_0x7c57('0x42'));return request({'method':_0x7c57('0x33'),'uri':_0x7c57('0x43')+_0x566789+_0x7c57('0x44')+_0x44e6cc+'))','headers':{'Authorization':_0x7c57('0x36')+_0x151737},'json':!![]})[_0x7c57('0x2c')](function(_0x390c66){if(_0x390c66){var _0x2b4a6c=_0x390c66[_0x7c57('0x45')][0x0];return _0x2b4a6c;}else{return request({'method':_0x7c57('0x33'),'uri':'https://www.zohoapis.'+_0x566789+_0x7c57('0x46')+_0x44e6cc+'))','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x151737},'json':!![]})[_0x7c57('0x2c')](function(_0x3c5373){if(_0x3c5373){var _0x17ad5a=_0x3c5373['data'][0x0];return _0x17ad5a;}else{logger[_0x7c57('0x32')](_0x7c57('0x47'));_0x23c47e=getName(_0x23c47e);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x566789+_0x7c57('0x48'),'body':{'data':[{'Last_Name':_0x23c47e[0x1],'First_Name':_0x23c47e[0x0],'Phone':_0x44e6cc}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x151737},'json':!![]})[_0x7c57('0x2c')](function(_0x2c0dca){if(_0x2c0dca&&_0x2c0dca[_0x7c57('0x45')][0x0][_0x7c57('0x49')]===_0x7c57('0x4a')){var _0x36655e=_0x2c0dca[_0x7c57('0x45')][0x0][_0x7c57('0x4b')];return _0x36655e;}logger[_0x7c57('0x2f')](_0x7c57('0x3f'),JSON[_0x7c57('0x10')](_0x2c0dca));throw new Error('Error\x20on\x20Lead\x20retrieve:\x20'+JSON[_0x7c57('0x10')](_0x2c0dca));});}});}});}function getCall(_0x2cfad8,_0x41bb7b,_0x24566d,_0x53aa07,_0xd28e32,_0x2adc8b,_0x50da65,_0x2faa76){logger[_0x7c57('0x32')]('Creating\x20new\x20call...');var _0x4fbefd={};_0x4fbefd[_0x7c57('0x4c')]={'name':!_[_0x7c57('0x1e')](_0x53aa07[_0x7c57('0x4d')][_0x7c57('0x1a')])?_0x53aa07[_0x7c57('0x4d')]['name']:!_[_0x7c57('0x1e')](_0x53aa07[_0x7c57('0x4e')])?_0x53aa07[_0x7c57('0x4e')]+'\x20'+_0x53aa07[_0x7c57('0x4f')]:_0x53aa07[_0x7c57('0x4f')],'id':_0x53aa07['id']};_0x4fbefd[_0x7c57('0x50')]=intUtil[_0x7c57('0x51')](_0x2adc8b[_0x7c57('0x52')],_0x50da65,'\x20');_0x4fbefd['Description']=intUtil[_0x7c57('0x51')](_0x2adc8b[_0x7c57('0x53')],_0x50da65,'\x0a');_0x4fbefd[_0x7c57('0x54')]={'name':_0xd28e32[_0x7c57('0x55')]!==undefined?_0xd28e32[_0x7c57('0x55')]:_0xd28e32[_0x7c57('0x56')]+'\x20'+_0xd28e32[_0x7c57('0x57')],'id':_0xd28e32['id']};if(_0x50da65['talktime']){_0x4fbefd['Call_Duration']=moment[_0x7c57('0x58')](parseInt(_0x50da65['talktime'])*0x3e8)[_0x7c57('0x59')](_0x7c57('0x5a'));}else if(_0x50da65['answertime']&&_0x50da65[_0x7c57('0x5b')]){_0x4fbefd[_0x7c57('0x5c')]=moment[_0x7c57('0x58')](moment(_0x50da65['endtime'],_0x7c57('0x5d'))[_0x7c57('0x5e')](moment(_0x50da65[_0x7c57('0x5f')],_0x7c57('0x5d'))))[_0x7c57('0x59')](_0x7c57('0x5a'));}switch(_0x50da65[_0x7c57('0x60')]){case _0x7c57('0x61'):_0x4fbefd[_0x7c57('0x62')]=_0x7c57('0x63');break;case'complete':case'connect':_0x4fbefd['Call_Result']=_0x7c57('0x64');break;case _0x7c57('0x65'):_0x4fbefd[_0x7c57('0x62')]=_0x7c57('0x66');break;case _0x7c57('0x67'):_0x4fbefd[_0x7c57('0x62')]=_0x7c57('0x68');break;default:}_0x4fbefd[_0x7c57('0x69')]=(_0x2faa76==='outbound'?moment(_0x50da65['starttime'])[_0x7c57('0x59')](_0x7c57('0x5d')):moment(_0x50da65['agentcalledAt'])[_0x7c57('0x59')](_0x7c57('0x5d')))||moment()[_0x7c57('0x59')]('YYYY-MM-DDTHH:mm:ss');_0x4fbefd[_0x7c57('0x6a')]=_0x2faa76||_0x7c57('0x6b');_0x4fbefd=_[_0x7c57('0x6c')](_0x4fbefd,getCustomFields(_0x2adc8b[_0x7c57('0x6d')],_0x50da65));return request({'method':_0x7c57('0x26'),'uri':_0x7c57('0x43')+_0x41bb7b+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2cfad8},'body':{'data':[_0x4fbefd]},'json':!![]})[_0x7c57('0x2c')](function(_0x5bbde7){if(_0x5bbde7&&_0x5bbde7[_0x7c57('0x45')][0x0][_0x7c57('0x49')]==='SUCCESS'){logger[_0x7c57('0x32')](_0x7c57('0x6e'));return{'id':_0x5bbde7[_0x7c57('0x45')][0x0]['details']['id']};}});}exports[_0x7c57('0x6f')]=function(_0x53564f,_0x3b7673,_0x3befc4,_0x5bd563,_0x4d078b,_0x2d93e3){var _0x388eb2,_0x124256,_0x16f2d1;_0x2d93e3[_0x7c57('0x70')]=intUtil[_0x7c57('0x71')](_0x2d93e3['host']);_0x2d93e3[_0x7c57('0x72')]=intUtil['stripTrailingSlash'](_0x2d93e3['serverUrl']);if(_0x4d078b&&_0x4d078b['monitor_format']){logger['info'](_0x7c57('0x73'),_0x7c57('0x74'));_0x3b7673[_0x7c57('0x75')]=_0x2d93e3[_0x7c57('0x72')]+_0x7c57('0x76')+_0x3b7673[_0x7c57('0x77')]+'/downloads?type=uniqueid&token='+md5(_0x3b7673[_0x7c57('0x77')]);}else{_0x3b7673[_0x7c57('0x75')]='';}var _0x4ed2fc=_0x2d93e3[_0x7c57('0x70')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x2d93e3)[_0x7c57('0x2c')](function(_0x17c865){_0x16f2d1=_0x17c865;return getUser(_0x16f2d1,_0x4ed2fc,_0x2d93e3,_0x5bd563['email']);})['then'](function(_0x78618f){_0x388eb2=_0x78618f;logger[_0x7c57('0x32')](_0x7c57('0x78'),_0x388eb2['id']);return getEndUser(_0x16f2d1,_0x4ed2fc,_0x2d93e3,_0x3b7673[_0x7c57('0x79')],_0x3b7673['calleridnum']);})['then'](function(_0x5a7123){_0x124256=_0x5a7123;logger[_0x7c57('0x32')](_0x7c57('0x7a'),_0x124256['id']);return getCall(_0x16f2d1,_0x4ed2fc,_0x2d93e3,_0x388eb2,_0x124256,_0x3befc4,_0x3b7673,_0x7c57('0x6b'));})[_0x7c57('0x2c')](function(_0x5b6ddb){if(_0x5b6ddb){logger['info'](_0x7c57('0x7b'),_0x5b6ddb['id']);logger['info']('[QUEUE]',_0x7c57('0x7c'));emit(util[_0x7c57('0x59')](_0x7c57('0x7d'),_0x5bd563['name']),_0x7c57('0x7e'),{'uri':_0x7c57('0x7f')+_0x2d93e3['host']+_0x7c57('0x80')+_0x5b6ddb['id']});}})[_0x7c57('0x2e')](function(_0xcf0602){logger[_0x7c57('0x2f')](_0x7c57('0x73'),JSON[_0x7c57('0x10')](_0xcf0602));});};exports[_0x7c57('0x81')]=function(_0x1d4324,_0x4800c1,_0x2e539b,_0x1fbb81,_0x1d39b9,_0x17f93a,_0x321840){var _0x5017f1,_0x59712a,_0x4580cc;_0x17f93a[_0x7c57('0x70')]=intUtil['stripTrailingSlash'](_0x17f93a[_0x7c57('0x70')]);_0x17f93a['serverUrl']=intUtil[_0x7c57('0x71')](_0x17f93a['serverUrl']);if(_0x321840&&_0x321840[_0x7c57('0x82')]&&_0x321840['recordingFormat']!=='none'){logger['info'](_0x7c57('0x83'),_0x7c57('0x74'));_0x4800c1[_0x7c57('0x75')]=_0x17f93a['serverUrl']+'/api/voice/recordings/'+_0x4800c1[_0x7c57('0x77')]+_0x7c57('0x84')+md5(_0x4800c1[_0x7c57('0x77')]);}var _0x333111=_0x17f93a[_0x7c57('0x70')]===_0x7c57('0x85')?'eu':_0x7c57('0x86');return getAccessToken(_0x17f93a)[_0x7c57('0x2c')](function(_0x11e234){_0x4580cc=_0x11e234;return getUser(_0x4580cc,_0x333111,_0x17f93a,_0x1fbb81[_0x7c57('0x3a')]);})[_0x7c57('0x2c')](function(_0x878dc8){_0x5017f1=_0x878dc8;logger[_0x7c57('0x32')](_0x7c57('0x78'),_0x5017f1['id']);return getEndUser(_0x4580cc,_0x333111,_0x17f93a,_0x4800c1[_0x7c57('0x87')],_0x4800c1[_0x7c57('0x88')]);})[_0x7c57('0x2c')](function(_0x6d3aa0){_0x59712a=_0x6d3aa0;logger[_0x7c57('0x32')]('The\x20Enduser\x20ID\x20is:',_0x59712a['id']);return getCall(_0x4580cc,_0x333111,_0x17f93a,_0x5017f1,_0x59712a,_0x2e539b,_0x4800c1,_0x7c57('0x89'));})[_0x7c57('0x2c')](function(_0x4b3705){if(_0x4b3705){logger[_0x7c57('0x32')](_0x7c57('0x7b'),_0x4b3705['id']);logger['info'](_0x7c57('0x83'),_0x7c57('0x7c'));emit(util[_0x7c57('0x59')](_0x7c57('0x7d'),_0x1fbb81['name']),_0x7c57('0x7e'),{'uri':_0x7c57('0x7f')+_0x17f93a['host']+_0x7c57('0x80')+_0x4b3705['id']});}})['catch'](function(_0x245405){logger[_0x7c57('0x2f')](_0x7c57('0x83'),JSON[_0x7c57('0x10')](_0x245405));});};exports[_0x7c57('0x67')]=function(_0x2444bd,_0x12b46e,_0x47ff70,_0x21e39a,_0x1f031a,_0x102751){var _0x25f899,_0x4577ad,_0x20ec3e;_0x102751['host']=intUtil[_0x7c57('0x71')](_0x102751[_0x7c57('0x70')]);_0x102751[_0x7c57('0x72')]=intUtil[_0x7c57('0x71')](_0x102751[_0x7c57('0x72')]);if(_0x1f031a&&_0x1f031a['monitor_format']){logger[_0x7c57('0x32')]('[ABANDONED]',_0x7c57('0x74'));_0x12b46e[_0x7c57('0x75')]=_0x102751['serverUrl']+_0x7c57('0x76')+_0x12b46e[_0x7c57('0x77')]+_0x7c57('0x84')+md5(_0x12b46e[_0x7c57('0x77')]);}else{_0x12b46e[_0x7c57('0x75')]='';}var _0x441fc8=_0x102751['host']===_0x7c57('0x85')?'eu':_0x7c57('0x86');return getAccessToken(_0x102751)['then'](function(_0x251aa5){_0x20ec3e=_0x251aa5;return getUser(_0x20ec3e,_0x441fc8,_0x102751);})[_0x7c57('0x2c')](function(_0xed0164){_0x25f899=_0xed0164;logger[_0x7c57('0x32')](_0x7c57('0x78'),_0x25f899['id']);return getEndUser(_0x20ec3e,_0x441fc8,_0x102751,_0x12b46e[_0x7c57('0x79')],_0x12b46e[_0x7c57('0x8a')]);})[_0x7c57('0x2c')](function(_0x455f07){_0x4577ad=_0x455f07;logger['info'](_0x7c57('0x7a'),_0x4577ad['id']);return getCall(_0x20ec3e,_0x441fc8,_0x102751,_0x25f899,_0x4577ad,_0x47ff70,_0x12b46e,'Inbound');})[_0x7c57('0x2c')](function(_0x10b29b){if(_0x10b29b){logger['info'](_0x7c57('0x7b'),_0x10b29b['id']);}})[_0x7c57('0x2e')](function(_0x46ec15){logger[_0x7c57('0x2f')](_0x7c57('0x8b'),JSON[_0x7c57('0x10')](_0x46ec15));});}; \ No newline at end of file +var _0x98a0=['expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','info','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','inspect','The\x20failing\x20result\x20is','Search\x20end\x20user','https://www.zohoapis.','data','GET','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','/crm/v2/Contacts','code','SUCCESS','Error\x20on\x20Lead\x20retrieve:\x20','Creating\x20new\x20call...','Owner','role','first_name','last_name','Subject','Subjects','getString','WhoId','Full_Name','Last_Name','Call_Duration','talktime','mm:ss','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Called','complete','connect','Call_Result','Answered','rejected','Rejected','Abandoned','Call_Start_Time','outbound','agentcalledAt','Inbound','merge','Fields','details','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Call\x20ID\x20is:','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','none','[OUTBOUND]','/downloads?type=uniqueid&token=','destcalleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','abandoned','[ABANDONED]','lodash','request-promise','util','../../../../config/environment','zoho','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','type','string','idField','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientSecret','then'];(function(_0x281ba7,_0x30e002){var _0x2501ce=function(_0x41575a){while(--_0x41575a){_0x281ba7['push'](_0x281ba7['shift']());}};_0x2501ce(++_0x30e002);}(_0x98a0,0x1e7));var _0x098a=function(_0x1441e8,_0x3dc234){_0x1441e8=_0x1441e8-0x0;var _0xe1207c=_0x98a0[_0x1441e8];return _0xe1207c;};'use strict';var _=require(_0x098a('0x0'));var rp=require(_0x098a('0x1'));var md5=require('md5');var util=require(_0x098a('0x2'));var intUtil=require('./util');var moment=require('moment');var Redis=require('ioredis');var config=require(_0x098a('0x3'));var logger=require('../../../../config/logger')(_0x098a('0x4'));config[_0x098a('0x5')]=_['defaults'](config[_0x098a('0x5')],{'host':_0x098a('0x6'),'port':0x18eb});var io=require(_0x098a('0x7'))(new Redis(config[_0x098a('0x5')]));function emit(_0x12cd23,_0x1b0bf1,_0x37d87f){io['to'](_0x12cd23)[_0x098a('0x8')](_0x1b0bf1,_0x37d87f);}function request(_0x34b894){logger[_0x098a('0x9')](_0x098a('0xa'),JSON[_0x098a('0xb')](_0x34b894));return rp(_0x34b894);}function getCustomFields(_0xf4f087,_0xcf7663){var _0x16271b={};if(_0xf4f087[_0x098a('0xc')]>0x0){_[_0x098a('0xd')](_0xf4f087,function(_0x16ab77){if(_0x16ab77[_0x098a('0xe')]===_0x098a('0xf')&&_0x16ab77[_0x098a('0x10')]){_0x16271b[_0x16ab77[_0x098a('0x10')]]=_0x16ab77[_0x098a('0x11')]['toString']();}else if(_0x16ab77[_0x098a('0xe')]===_0x098a('0x12')&&_0x16ab77[_0x098a('0x13')]&&_0x16ab77[_0x098a('0x10')]&&_0xcf7663[_0x16ab77[_0x098a('0x13')]]){_0x16271b[_0x16ab77['idField']]=_0xcf7663[_0x16ab77[_0x098a('0x13')]][_0x098a('0x14')]();}else if(_0x16ab77[_0x098a('0xe')]===_0x098a('0x15')&&_0x16ab77[_0x098a('0x16')]&&_0x16ab77[_0x098a('0x16')][_0x098a('0x17')]&&_0x16ab77[_0x098a('0x10')]&&_0xcf7663[_0x16ab77[_0x098a('0x16')]['name'][_0x098a('0x18')]()]){_0x16271b[_0x16ab77['idField']]=_0xcf7663[_0x16ab77[_0x098a('0x16')][_0x098a('0x17')][_0x098a('0x18')]()][_0x098a('0x14')]();}});}return _0x16271b;}function getName(_0x4597df){if(_0x4597df[_0x098a('0x19')]('\x20')>0x0){var _0x7630f0=_0x4597df[_0x098a('0x1a')](/ (.+)/);if(_0x7630f0[0x1]){return _0x7630f0;}}return[_0x4597df,_0x4597df];}var accountsTokens={};function getAccessToken(_0x5cc39a){return new Promise(function(_0x4375b4,_0x3a235e){if(!_[_0x098a('0x1b')](accountsTokens[_0x5cc39a['id']])&&!_[_0x098a('0x1b')](accountsTokens[_0x5cc39a['id']][_0x098a('0x1c')])){if(moment()[_0x098a('0x1d')](accountsTokens[_0x5cc39a['id']]['expires_in'])){_0x4375b4(accountsTokens[_0x5cc39a['id']][_0x098a('0x1c')]);}}var _0x66dfc2;switch(_0x5cc39a['zone']){case'US':_0x66dfc2=_0x098a('0x1e');break;case'AU':_0x66dfc2='https://accounts.zoho.com.au';break;case'EU':_0x66dfc2=_0x098a('0x1f');break;case'IN':_0x66dfc2='https://accounts.zoho.in';break;case'CN':_0x66dfc2=_0x098a('0x20');break;default:_0x66dfc2='https://accounts.zoho.eu';break;}var _0x508066={'method':_0x098a('0x21'),'uri':_0x66dfc2+_0x098a('0x22'),'qs':{'refresh_token':_0x5cc39a['refreshToken'],'client_id':_0x5cc39a['clientId'],'client_secret':_0x5cc39a[_0x098a('0x23')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x508066)[_0x098a('0x24')](function(_0x2e55bf){accountsTokens[_0x5cc39a['id']]={'access_token':_0x2e55bf['access_token'],'expires_in':moment()['add'](_0x2e55bf[_0x098a('0x25')],_0x098a('0x26'))};_0x4375b4(_0x2e55bf['access_token']);})[_0x098a('0x27')](function(_0x517eaa){logger[_0x098a('0x28')](_0x098a('0x29'),_0x517eaa['stack']);_0x3a235e(_0x517eaa);});});}function getUser(_0xa99e2d,_0x164474,_0x132ef2,_0x66f82e){logger[_0x098a('0x2a')]('Search\x20user');return request({'method':'GET','uri':util[_0x098a('0x2b')](_0x098a('0x2c'),_0x164474),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x098a('0x2d')+_0xa99e2d},'json':!![]})['then'](function(_0x446ec6){if(_0x446ec6[_0x098a('0x2e')]){var _0x4c1ae4;if(_[_0x098a('0x2f')](_0x446ec6['users'])){if(!_[_0x098a('0x1b')](_0x66f82e)){_0x4c1ae4=_[_0x098a('0x30')](_0x446ec6[_0x098a('0x2e')],function(_0x20ab61){return _0x20ab61[_0x098a('0x31')]===_0x66f82e;});}if(_0x4c1ae4>=0x0){logger[_0x098a('0x2a')](_0x098a('0x32'));}else{logger[_0x098a('0x2a')](_0x098a('0x33'));_0x4c1ae4=_[_0x098a('0x30')](_0x446ec6[_0x098a('0x2e')],function(_0x4ee9bd){return _0x4ee9bd[_0x098a('0x34')][_0x098a('0x17')]===_0x098a('0x35');});}return _0x446ec6['users'][_0x4c1ae4];}else{if(_0x446ec6['user'][_0x098a('0x34')][_0x098a('0x17')]===_0x098a('0x35')){logger[_0x098a('0x2a')](_0x098a('0x33'));user=_0x446ec6[_0x098a('0x36')];return user;}else{logger[_0x098a('0x28')]('The\x20failing\x20result\x20is',util['inspect'](_0x446ec6,{'showHidden':![],'depth':null}));throw new Error(_0x098a('0x37')+util[_0x098a('0x38')](_0x446ec6,{'showHidden':![],'depth':null}));}}}else{logger['error'](_0x098a('0x39'),util[_0x098a('0x38')](_0x446ec6,{'showHidden':![],'depth':null}));throw new Error(_0x098a('0x37')+util['inspect'](_0x446ec6,{'showHidden':![],'depth':null}));}});}function getEndUser(_0x18184d,_0x103f86,_0x5920fc,_0xcbb089,_0x4690ba){logger[_0x098a('0x2a')](_0x098a('0x3a'));return request({'method':'GET','uri':_0x098a('0x3b')+_0x103f86+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x4690ba+'))','headers':{'Authorization':_0x098a('0x2d')+_0x18184d},'json':!![]})[_0x098a('0x24')](function(_0x1a0a3a){if(_0x1a0a3a){var _0x5de333=_0x1a0a3a[_0x098a('0x3c')][0x0];return _0x5de333;}else{return request({'method':_0x098a('0x3d'),'uri':_0x098a('0x3b')+_0x103f86+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4690ba+'))','headers':{'Authorization':_0x098a('0x2d')+_0x18184d},'json':!![]})[_0x098a('0x24')](function(_0x31d1f5){if(_0x31d1f5){var _0x142a1d=_0x31d1f5[_0x098a('0x3c')][0x0];return _0x142a1d;}else{logger[_0x098a('0x2a')](_0x098a('0x3e'));_0xcbb089=getName(_0xcbb089);return request({'method':_0x098a('0x21'),'uri':'https://www.zohoapis.'+_0x103f86+_0x098a('0x3f'),'body':{'data':[{'Last_Name':_0xcbb089[0x1],'First_Name':_0xcbb089[0x0],'Phone':_0x4690ba}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x18184d},'json':!![]})[_0x098a('0x24')](function(_0x5e03ee){if(_0x5e03ee&&_0x5e03ee[_0x098a('0x3c')][0x0][_0x098a('0x40')]===_0x098a('0x41')){var _0x53fd00=_0x5e03ee[_0x098a('0x3c')][0x0]['details'];return _0x53fd00;}logger[_0x098a('0x28')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x5e03ee));throw new Error(_0x098a('0x42')+JSON[_0x098a('0xb')](_0x5e03ee));});}});}});}function getCall(_0x272600,_0x35c16c,_0x1283ef,_0x50f9ed,_0x5cfefa,_0x1f10ca,_0x1689e5,_0x1e71fc){logger[_0x098a('0x2a')](_0x098a('0x43'));var _0x1c781f={};_0x1c781f[_0x098a('0x44')]={'name':!_['isNil'](_0x50f9ed[_0x098a('0x45')][_0x098a('0x17')])?_0x50f9ed['role']['name']:!_[_0x098a('0x1b')](_0x50f9ed[_0x098a('0x46')])?_0x50f9ed[_0x098a('0x46')]+'\x20'+_0x50f9ed[_0x098a('0x47')]:_0x50f9ed[_0x098a('0x47')],'id':_0x50f9ed['id']};_0x1c781f[_0x098a('0x48')]=intUtil['getString'](_0x1f10ca[_0x098a('0x49')],_0x1689e5,'\x20');_0x1c781f['Description']=intUtil[_0x098a('0x4a')](_0x1f10ca['Descriptions'],_0x1689e5,'\x0a');_0x1c781f[_0x098a('0x4b')]={'name':_0x5cfefa[_0x098a('0x4c')]!==undefined?_0x5cfefa[_0x098a('0x4c')]:_0x5cfefa['First_Name']+'\x20'+_0x5cfefa[_0x098a('0x4d')],'id':_0x5cfefa['id']};if(_0x1689e5['talktime']){_0x1c781f[_0x098a('0x4e')]=moment['utc'](parseInt(_0x1689e5[_0x098a('0x4f')])*0x3e8)['format'](_0x098a('0x50'));}else if(_0x1689e5['answertime']&&_0x1689e5[_0x098a('0x51')]){_0x1c781f[_0x098a('0x4e')]=moment[_0x098a('0x52')](moment(_0x1689e5['endtime'],_0x098a('0x53'))[_0x098a('0x54')](moment(_0x1689e5[_0x098a('0x55')],'YYYY-MM-DDTHH:mm:ss')))[_0x098a('0x2b')]('mm:ss');}switch(_0x1689e5[_0x098a('0x56')]){case _0x098a('0x57'):_0x1c781f['Call_Result']=_0x098a('0x58');break;case _0x098a('0x59'):case _0x098a('0x5a'):_0x1c781f[_0x098a('0x5b')]=_0x098a('0x5c');break;case _0x098a('0x5d'):_0x1c781f[_0x098a('0x5b')]=_0x098a('0x5e');break;case'abandoned':_0x1c781f[_0x098a('0x5b')]=_0x098a('0x5f');break;default:}_0x1c781f[_0x098a('0x60')]=(_0x1e71fc===_0x098a('0x61')?moment(_0x1689e5[_0x098a('0x55')])[_0x098a('0x2b')](_0x098a('0x53')):moment(_0x1689e5[_0x098a('0x62')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x098a('0x2b')](_0x098a('0x53'));_0x1c781f['Call_Type']=_0x1e71fc||_0x098a('0x63');_0x1c781f=_[_0x098a('0x64')](_0x1c781f,getCustomFields(_0x1f10ca[_0x098a('0x65')],_0x1689e5));return request({'method':_0x098a('0x21'),'uri':_0x098a('0x3b')+_0x35c16c+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x272600},'body':{'data':[_0x1c781f]},'json':!![]})[_0x098a('0x24')](function(_0x4bdc8c){if(_0x4bdc8c&&_0x4bdc8c[_0x098a('0x3c')][0x0][_0x098a('0x40')]===_0x098a('0x41')){logger[_0x098a('0x2a')]('Call\x20created!');return{'id':_0x4bdc8c[_0x098a('0x3c')][0x0][_0x098a('0x66')]['id']};}});}exports[_0x098a('0x67')]=function(_0x1e2031,_0x436b74,_0x41cb22,_0x4766e1,_0x20bfd8,_0x49187){var _0x494b59,_0x3edd29,_0x5926c2;_0x49187[_0x098a('0x68')]=intUtil[_0x098a('0x69')](_0x49187[_0x098a('0x68')]);_0x49187[_0x098a('0x6a')]=intUtil['stripTrailingSlash'](_0x49187[_0x098a('0x6a')]);if(_0x20bfd8&&_0x20bfd8[_0x098a('0x6b')]){logger[_0x098a('0x2a')](_0x098a('0x6c'),_0x098a('0x6d'));_0x436b74[_0x098a('0x6e')]=_0x49187['serverUrl']+_0x098a('0x6f')+_0x436b74[_0x098a('0x70')]+'/downloads?type=uniqueid&token='+md5(_0x436b74[_0x098a('0x70')]);}else{_0x436b74[_0x098a('0x6e')]='';}var _0x200784=_0x49187[_0x098a('0x68')]===_0x098a('0x71')?'eu':_0x098a('0x72');return getAccessToken(_0x49187)[_0x098a('0x24')](function(_0x1dcab4){_0x5926c2=_0x1dcab4;return getUser(_0x5926c2,_0x200784,_0x49187,_0x4766e1[_0x098a('0x31')]);})[_0x098a('0x24')](function(_0x17a5ab){_0x494b59=_0x17a5ab;logger['info'](_0x098a('0x73'),_0x494b59['id']);return getEndUser(_0x5926c2,_0x200784,_0x49187,_0x436b74[_0x098a('0x74')],_0x436b74[_0x098a('0x75')]);})['then'](function(_0x1ece1d){_0x3edd29=_0x1ece1d;logger[_0x098a('0x2a')](_0x098a('0x76'),_0x3edd29['id']);return getCall(_0x5926c2,_0x200784,_0x49187,_0x494b59,_0x3edd29,_0x41cb22,_0x436b74,_0x098a('0x63'));})[_0x098a('0x24')](function(_0x3696fe){if(_0x3696fe){logger['info'](_0x098a('0x77'),_0x3696fe['id']);logger[_0x098a('0x2a')](_0x098a('0x6c'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x098a('0x2b')]('user:%s',_0x4766e1[_0x098a('0x17')]),_0x098a('0x78'),{'uri':_0x098a('0x79')+_0x49187[_0x098a('0x68')]+_0x098a('0x7a')+_0x3696fe['id']});}})[_0x098a('0x27')](function(_0x98976e){logger[_0x098a('0x28')](_0x098a('0x6c'),JSON[_0x098a('0xb')](_0x98976e));});};exports[_0x098a('0x61')]=function(_0x381d47,_0x226a73,_0x4adcc9,_0x398ca7,_0x2216b0,_0x4e794f,_0x15e408){var _0x314b55,_0x4bc31c,_0x4340fe;_0x4e794f['host']=intUtil[_0x098a('0x69')](_0x4e794f[_0x098a('0x68')]);_0x4e794f[_0x098a('0x6a')]=intUtil['stripTrailingSlash'](_0x4e794f[_0x098a('0x6a')]);if(_0x15e408&&_0x15e408['recordingFormat']&&_0x15e408['recordingFormat']!==_0x098a('0x7b')){logger[_0x098a('0x2a')](_0x098a('0x7c'),'Recording\x20is\x20enabled!');_0x226a73[_0x098a('0x6e')]=_0x4e794f['serverUrl']+_0x098a('0x6f')+_0x226a73['uniqueid']+_0x098a('0x7d')+md5(_0x226a73[_0x098a('0x70')]);}var _0x264e5=_0x4e794f['host']===_0x098a('0x71')?'eu':_0x098a('0x72');return getAccessToken(_0x4e794f)[_0x098a('0x24')](function(_0x2a69b9){_0x4340fe=_0x2a69b9;return getUser(_0x4340fe,_0x264e5,_0x4e794f,_0x398ca7['email']);})[_0x098a('0x24')](function(_0x1da78a){_0x314b55=_0x1da78a;logger[_0x098a('0x2a')]('The\x20User\x20ID\x20is:',_0x314b55['id']);return getEndUser(_0x4340fe,_0x264e5,_0x4e794f,_0x226a73['destcalleridname'],_0x226a73[_0x098a('0x7e')]);})[_0x098a('0x24')](function(_0xacf146){_0x4bc31c=_0xacf146;logger[_0x098a('0x2a')]('The\x20Enduser\x20ID\x20is:',_0x4bc31c['id']);return getCall(_0x4340fe,_0x264e5,_0x4e794f,_0x314b55,_0x4bc31c,_0x4adcc9,_0x226a73,'Outbound');})[_0x098a('0x24')](function(_0x44c8c5){if(_0x44c8c5){logger[_0x098a('0x2a')](_0x098a('0x77'),_0x44c8c5['id']);logger[_0x098a('0x2a')](_0x098a('0x7c'),_0x098a('0x7f'));emit(util[_0x098a('0x2b')](_0x098a('0x80'),_0x398ca7[_0x098a('0x17')]),_0x098a('0x78'),{'uri':_0x098a('0x79')+_0x4e794f[_0x098a('0x68')]+'/crm/EntityInfo.do?module=Calls&id='+_0x44c8c5['id']});}})[_0x098a('0x27')](function(_0x3c2e62){logger[_0x098a('0x28')](_0x098a('0x7c'),JSON['stringify'](_0x3c2e62));});};exports[_0x098a('0x81')]=function(_0xf79892,_0x4cc81a,_0x331c38,_0x168d95,_0x183c9e,_0x7c5828){var _0x57475a,_0x2c9df6,_0xa2210d;_0x7c5828[_0x098a('0x68')]=intUtil['stripTrailingSlash'](_0x7c5828[_0x098a('0x68')]);_0x7c5828['serverUrl']=intUtil['stripTrailingSlash'](_0x7c5828[_0x098a('0x6a')]);if(_0x183c9e&&_0x183c9e[_0x098a('0x6b')]){logger['info'](_0x098a('0x82'),_0x098a('0x6d'));_0x4cc81a[_0x098a('0x6e')]=_0x7c5828[_0x098a('0x6a')]+_0x098a('0x6f')+_0x4cc81a[_0x098a('0x70')]+_0x098a('0x7d')+md5(_0x4cc81a[_0x098a('0x70')]);}else{_0x4cc81a[_0x098a('0x6e')]='';}var _0x5d3108=_0x7c5828[_0x098a('0x68')]===_0x098a('0x71')?'eu':'com';return getAccessToken(_0x7c5828)[_0x098a('0x24')](function(_0xf060eb){_0xa2210d=_0xf060eb;return getUser(_0xa2210d,_0x5d3108,_0x7c5828);})[_0x098a('0x24')](function(_0x1b86c9){_0x57475a=_0x1b86c9;logger['info']('The\x20User\x20ID\x20is:',_0x57475a['id']);return getEndUser(_0xa2210d,_0x5d3108,_0x7c5828,_0x4cc81a[_0x098a('0x74')],_0x4cc81a[_0x098a('0x75')]);})[_0x098a('0x24')](function(_0x1e7d04){_0x2c9df6=_0x1e7d04;logger[_0x098a('0x2a')](_0x098a('0x76'),_0x2c9df6['id']);return getCall(_0xa2210d,_0x5d3108,_0x7c5828,_0x57475a,_0x2c9df6,_0x331c38,_0x4cc81a,_0x098a('0x63'));})['then'](function(_0x33f78b){if(_0x33f78b){logger['info']('The\x20Call\x20ID\x20is:',_0x33f78b['id']);}})[_0x098a('0x27')](function(_0xa05b2c){logger['error'](_0x098a('0x82'),JSON[_0x098a('0xb')](_0xa05b2c));});}; \ 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 a71f278..63cc484 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(_0x2f0b85,_0x17bfcf){var _0x315926=function(_0x18e929){while(--_0x18e929){_0x2f0b85['push'](_0x2f0b85['shift']());}};_0x315926(++_0x17bfcf);}(_0x7a54,0x106));var _0x47a5=function(_0x57eab0,_0xa36ba0){_0x57eab0=_0x57eab0-0x0;var _0x21d4ec=_0x7a54[_0x57eab0];return _0x21d4ec;};'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(_0x555b65,_0x131997){var _0x2c76d1=function(_0x414b97){while(--_0x414b97){_0x555b65['push'](_0x555b65['shift']());}};_0x2c76d1(++_0x131997);}(_0x7a54,0x106));var _0x47a5=function(_0x3b62ba,_0x4c5453){_0x3b62ba=_0x3b62ba-0x0;var _0x4fca4e=_0x7a54[_0x3b62ba];return _0x4fca4e;};'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 438cef6..2116cfd 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 _0xa770=['format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','lodash','mustache','../../../../config/logger','trigger','exec','toUpperCase','render','data2','headers','data6','parse','error','data1','GET','POST','data7','body','info'];(function(_0x4b9f35,_0x287585){var _0x200ea1=function(_0x9bf668){while(--_0x9bf668){_0x4b9f35['push'](_0x4b9f35['shift']());}};_0x200ea1(++_0x287585);}(_0xa770,0xc6));var _0x0a77=function(_0x3e3a6f,_0x5ce2ee){_0x3e3a6f=_0x3e3a6f-0x0;var _0x4ff185=_0xa770[_0x3e3a6f];return _0x4ff185;};'use strict';var rp=require(_0x0a77('0x0'));var util=require('util');var _=require(_0x0a77('0x1'));var Mustache=require(_0x0a77('0x2'));var logger=require(_0x0a77('0x3'))(_0x0a77('0x4'));exports[_0x0a77('0x5')]=function(_0x3e4f9f,_0x49ce5b){var _0x295fd5,_0x273e7f;var _0x2a0b5e={'method':_0x3e4f9f['data1'][_0x0a77('0x6')](),'uri':Mustache[_0x0a77('0x7')](_0x3e4f9f[_0x0a77('0x8')],_0x49ce5b),'json':!![],'resolveWithFullResponse':!![]};try{_0x2a0b5e[_0x0a77('0x9')]=_0x3e4f9f[_0x0a77('0xa')]?JSON[_0x0a77('0xb')](Mustache['render'](_0x3e4f9f[_0x0a77('0xa')],_0x49ce5b)):{};}catch(_0x2edc48){logger[_0x0a77('0xc')](_0x2edc48['stack']);}switch(_0x3e4f9f[_0x0a77('0xd')][_0x0a77('0x6')]()){case _0x0a77('0xe'):_0x2a0b5e['qs']=_0x49ce5b;break;case _0x0a77('0xf'):case'PUT':_0x295fd5={};if(_0x3e4f9f[_0x0a77('0x10')]){_0x295fd5=Mustache[_0x0a77('0x7')](_0x3e4f9f[_0x0a77('0x10')],_0x49ce5b);}else{_0x295fd5=_0x49ce5b;}_0x2a0b5e[_0x0a77('0x11')]=JSON[_0x0a77('0xb')](_0x295fd5);break;}logger[_0x0a77('0x12')](util[_0x0a77('0x13')](_0x0a77('0x14'),_0x3e4f9f[_0x0a77('0xd')],_0x3e4f9f[_0x0a77('0x8')],JSON[_0x0a77('0x15')](_0x2a0b5e)));rp(_0x2a0b5e)[_0x0a77('0x16')](function(_0x37ca79){_0x295fd5=!_[_0x0a77('0x17')](_0x295fd5)?_0x0a77('0x18')+_0x295fd5:'';_0x273e7f=typeof _0x37ca79[_0x0a77('0x11')]===_0x0a77('0x19')?JSON[_0x0a77('0x15')](_0x37ca79[_0x0a77('0x11')]):_0x37ca79[_0x0a77('0x11')];logger[_0x0a77('0x12')](util[_0x0a77('0x13')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x3e4f9f[_0x0a77('0xd')],_0x3e4f9f[_0x0a77('0x8')],_0x37ca79[_0x0a77('0x1a')],_0x273e7f));})[_0x0a77('0x1b')](function(_0x539921){logger[_0x0a77('0xc')](util['format'](_0x0a77('0x1c'),_0x3e4f9f[_0x0a77('0xd')],_0x3e4f9f[_0x0a77('0x8')],_0x539921[_0x0a77('0x1a')],_0x539921[_0x0a77('0x1d')],_0x539921[_0x0a77('0x1e')]));});}; \ No newline at end of file +var _0xb1dc=['render','data2','headers','parse','data6','error','stack','GET','POST','data7','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','body','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xb1dc,0xb7));var _0xcb1d=function(_0x102b0c,_0x33dee4){_0x102b0c=_0x102b0c-0x0;var _0x9b15ca=_0xb1dc[_0x102b0c];return _0x9b15ca;};'use strict';var rp=require(_0xcb1d('0x0'));var util=require(_0xcb1d('0x1'));var _=require(_0xcb1d('0x2'));var Mustache=require(_0xcb1d('0x3'));var logger=require(_0xcb1d('0x4'))(_0xcb1d('0x5'));exports[_0xcb1d('0x6')]=function(_0x17f14b,_0x54936b){var _0x37f222,_0x459801;var _0x88b451={'method':_0x17f14b[_0xcb1d('0x7')][_0xcb1d('0x8')](),'uri':Mustache[_0xcb1d('0x9')](_0x17f14b[_0xcb1d('0xa')],_0x54936b),'json':!![],'resolveWithFullResponse':!![]};try{_0x88b451[_0xcb1d('0xb')]=_0x17f14b['data6']?JSON[_0xcb1d('0xc')](Mustache[_0xcb1d('0x9')](_0x17f14b[_0xcb1d('0xd')],_0x54936b)):{};}catch(_0x255f40){logger[_0xcb1d('0xe')](_0x255f40[_0xcb1d('0xf')]);}switch(_0x17f14b['data1'][_0xcb1d('0x8')]()){case _0xcb1d('0x10'):_0x88b451['qs']=_0x54936b;break;case _0xcb1d('0x11'):case'PUT':_0x37f222={};if(_0x17f14b[_0xcb1d('0x12')]){_0x37f222=Mustache[_0xcb1d('0x9')](_0x17f14b['data7'],_0x54936b);}else{_0x37f222=_0x54936b;}_0x88b451['body']=JSON[_0xcb1d('0xc')](_0x37f222);break;}logger[_0xcb1d('0x13')](util[_0xcb1d('0x14')](_0xcb1d('0x15'),_0x17f14b[_0xcb1d('0x7')],_0x17f14b[_0xcb1d('0xa')],JSON[_0xcb1d('0x16')](_0x88b451)));rp(_0x88b451)[_0xcb1d('0x17')](function(_0xda21da){_0x37f222=!_[_0xcb1d('0x18')](_0x37f222)?_0xcb1d('0x19')+_0x37f222:'';_0x459801=typeof _0xda21da[_0xcb1d('0x1a')]==='object'?JSON[_0xcb1d('0x16')](_0xda21da['body']):_0xda21da[_0xcb1d('0x1a')];logger[_0xcb1d('0x13')](util[_0xcb1d('0x14')](_0xcb1d('0x1b'),_0x17f14b[_0xcb1d('0x7')],_0x17f14b[_0xcb1d('0xa')],_0xda21da[_0xcb1d('0x1c')],_0x459801));})[_0xcb1d('0x1d')](function(_0x5abf7d){logger[_0xcb1d('0xe')](util[_0xcb1d('0x14')](_0xcb1d('0x1e'),_0x17f14b[_0xcb1d('0x7')],_0x17f14b[_0xcb1d('0xa')],_0x5abf7d['statusCode'],_0x5abf7d['name'],_0x5abf7d[_0xcb1d('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index f641a4b..bfd8304 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 _0x1052=['debug','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request'];(function(_0x53a9b6,_0x12b2e5){var _0x3a7176=function(_0x58c183){while(--_0x58c183){_0x53a9b6['push'](_0x53a9b6['shift']());}};_0x3a7176(++_0x12b2e5);}(_0x1052,0xf4));var _0x2105=function(_0x12dfa1,_0x36ff32){_0x12dfa1=_0x12dfa1-0x0;var _0x5db581=_0x1052[_0x12dfa1];return _0x5db581;};'use strict';var jayson=require(_0x2105('0x0'));var BPromise=require(_0x2105('0x1'));var logger=require(_0x2105('0x2'))(_0x2105('0x3'));var client=jayson[_0x2105('0x4')][_0x2105('0x5')]({'port':0x2329});client[_0x2105('0x6')]=function(_0x119f3a,_0x1e106c){return new BPromise(function(_0x5c1e84,_0x5d6123){return client[_0x2105('0x7')](_0x119f3a,_0x1e106c)['then'](function(_0x126cd9){logger[_0x2105('0x8')]('rpc',_0x2105('0x3'),_0x119f3a,_0x1e106c,_0x126cd9);if(_0x126cd9[_0x2105('0x9')]){logger[_0x2105('0x9')]('rpc','routing',_0x119f3a,_0x126cd9[_0x2105('0x9')][_0x2105('0xa')],_0x1e106c);return _0x5d6123(_0x126cd9[_0x2105('0x9')]['message']);}else{return _0x5c1e84(_0x126cd9[_0x2105('0xb')]);}})[_0x2105('0xc')](function(_0x3d937d){logger[_0x2105('0x9')]('rpc','routing',_0x119f3a,_0x3d937d,_0x1e106c);return _0x5d6123(_0x3d937d);});});};module[_0x2105('0xd')]=client; \ No newline at end of file +var _0xcabc=['routing','client','http','request','then','debug','rpc','error','message','result','exports','bluebird','../../config/logger'];(function(_0x6c8da4,_0x541587){var _0x2ca1c4=function(_0x55c62c){while(--_0x55c62c){_0x6c8da4['push'](_0x6c8da4['shift']());}};_0x2ca1c4(++_0x541587);}(_0xcabc,0x16a));var _0xccab=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xcabc[_0x4a9fb1];return _0x348672;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xccab('0x0'));var logger=require(_0xccab('0x1'))(_0xccab('0x2'));var client=jayson[_0xccab('0x3')][_0xccab('0x4')]({'port':0x2329});client['Request']=function(_0x2b1e99,_0x38a3af){return new BPromise(function(_0x59a105,_0x391c81){return client[_0xccab('0x5')](_0x2b1e99,_0x38a3af)[_0xccab('0x6')](function(_0x492d75){logger[_0xccab('0x7')](_0xccab('0x8'),_0xccab('0x2'),_0x2b1e99,_0x38a3af,_0x492d75);if(_0x492d75['error']){logger[_0xccab('0x9')](_0xccab('0x8'),'routing',_0x2b1e99,_0x492d75[_0xccab('0x9')][_0xccab('0xa')],_0x38a3af);return _0x391c81(_0x492d75[_0xccab('0x9')][_0xccab('0xa')]);}else{return _0x59a105(_0x492d75[_0xccab('0xb')]);}})['catch'](function(_0x557654){logger[_0xccab('0x9')](_0xccab('0x8'),_0xccab('0x2'),_0x2b1e99,_0x557654,_0x38a3af);return _0x391c81(_0x557654);});});};module[_0xccab('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 5764ccc..566e98d 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 _0x2d5f=['then','initMailAccounts','refresh','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount'];(function(_0x48555c,_0x94a59f){var _0x30dc5f=function(_0xa3695b){while(--_0xa3695b){_0x48555c['push'](_0x48555c['shift']());}};_0x30dc5f(++_0x94a59f);}(_0x2d5f,0x8b));var _0xf2d5=function(_0x41a93b,_0x2fc19d){_0x41a93b=_0x41a93b-0x0;var _0x220a7e=_0x2d5f[_0x41a93b];return _0x220a7e;};'use strict';var BPromise=require(_0xf2d5('0x0'));var server=require(_0xf2d5('0x1'));var Realtime=require(_0xf2d5('0x2'));var EmailChannel=require(_0xf2d5('0x3'));var mailAccount=require(_0xf2d5('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0xf2d5('0x5')](mailAccount['getMailAccounts']())[_0xf2d5('0x5')](realtime[_0xf2d5('0x6')]())[_0xf2d5('0x5')](function(){email[_0xf2d5('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0xf2d5('0x5')](function(_0x382336){return initRealtime();})['then'](function(_0x522196){return setInterval(initRealtime,0x2710);})['catch'](function(_0x55b8d4){console[_0xf2d5('0x8')](_0x55b8d4);});}main(); \ No newline at end of file +var _0x8fab=['./realtime','./lib/email','./rpc/mailAccount','resolve','then','getMailAccounts','initMailAccounts','listen','catch','log','./server'];(function(_0x17c6aa,_0x3b3d23){var _0x392119=function(_0x403d77){while(--_0x403d77){_0x17c6aa['push'](_0x17c6aa['shift']());}};_0x392119(++_0x3b3d23);}(_0x8fab,0x149));var _0xb8fa=function(_0x5e440c,_0x1e104d){_0x5e440c=_0x5e440c-0x0;var _0x585c07=_0x8fab[_0x5e440c];return _0x585c07;};'use strict';var BPromise=require('bluebird');var server=require(_0xb8fa('0x0'));var Realtime=require(_0xb8fa('0x1'));var EmailChannel=require(_0xb8fa('0x2'));var mailAccount=require(_0xb8fa('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xb8fa('0x4')]()[_0xb8fa('0x5')](mailAccount[_0xb8fa('0x6')]())[_0xb8fa('0x5')](realtime[_0xb8fa('0x7')]())['then'](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xb8fa('0x8')](realtime,email)[_0xb8fa('0x5')](function(_0x405606){return initRealtime();})[_0xb8fa('0x5')](function(_0x30e9c2){return setInterval(initRealtime,0x2710);})[_0xb8fa('0x9')](function(_0x14c4f1){console[_0xb8fa('0xa')](_0x14c4f1);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 4e05052..21ec3d9 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 _0x4177=['lastSync','sendMail','smtp','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','../../../config/logger','email','redis','defaults','socket.io-emitter','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','imapAccounts','prototype','emit','mailAccounts','name','key','Imap','messageStatus','total','md5','mailAccount:update','refresh','hasOwnProperty','active','box','handleImapEmail','bind','handleImapEnd','error','handleImapError','isNil','status','disabled','handleImapBox','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x4177,0xb1));var _0x7417=function(_0x47ca66,_0x45c7f0){_0x47ca66=_0x47ca66-0x0;var _0x5c5843=_0x4177[_0x47ca66];return _0x5c5843;};'use strict';var _=require(_0x7417('0x0'));var moment=require(_0x7417('0x1'));var BPromise=require(_0x7417('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x7417('0x3'))(_0x7417('0x4'));config[_0x7417('0x5')]=_[_0x7417('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7417('0x7'))(new Redis(config[_0x7417('0x5')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x7417('0x8'));var mailAccount=require(_0x7417('0x9'));var md5Accounts={};function EmailChannel(_0x5e2612){logger[_0x7417('0xa')](_0x7417('0xb'));this['mailAccounts']=_0x5e2612['mailAccounts'];this[_0x7417('0xc')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x7417('0xd')][_0x7417('0xe')]=function(_0x681ff8){var _0x16e079=this[_0x7417('0xf')][_0x681ff8];var _0x37fcea={'id':_0x16e079['id'],'name':_0x16e079[_0x7417('0x10')],'key':_0x16e079[_0x7417('0x11')],'active':_0x16e079['active'],'Imap':{'status':_0x16e079[_0x7417('0x12')]['status'],'messageStatus':_0x16e079[_0x7417('0x12')][_0x7417('0x13')],'total':_0x16e079[_0x7417('0x12')][_0x7417('0x14')]}};if(_['isNil'](md5Accounts[_0x681ff8])){md5Accounts[_0x681ff8]={};}var _0x5753b2=md5(JSON['stringify'](_0x37fcea));if(md5Accounts[_0x681ff8][_0x7417('0x15')]!==_0x5753b2){md5Accounts[_0x681ff8]['md5']=_0x5753b2;io[_0x7417('0xe')](_0x7417('0x16'),_0x37fcea);}};EmailChannel[_0x7417('0xd')][_0x7417('0x17')]=function(_0x47b265){for(var _0x152171 in _0x47b265){if(_0x47b265[_0x7417('0x18')](_0x152171)){if(_0x47b265[_0x152171]['Imap']&&_0x47b265[_0x152171][_0x7417('0x19')]){var _0x4a6f8e=_0x47b265[_0x152171][_0x7417('0x12')];if(!this[_0x7417('0xc')][_0x7417('0x18')](_0x4a6f8e['id'])){this[_0x7417('0xc')][_0x4a6f8e['id']]=new EmailImap(_0x4a6f8e,_0x47b265[_0x152171][_0x7417('0x4')]);this[_0x7417('0xc')][_0x4a6f8e['id']]['on'](_0x7417('0x1a'),this['handleImapBox']['bind'](this,_0x152171));this[_0x7417('0xc')][_0x4a6f8e['id']]['on'](_0x7417('0x4'),this[_0x7417('0x1b')][_0x7417('0x1c')](this,_0x152171));this[_0x7417('0xc')][_0x4a6f8e['id']]['on']('end',this[_0x7417('0x1d')]['bind'](this,_0x152171));this[_0x7417('0xc')][_0x4a6f8e['id']]['on'](_0x7417('0x1e'),this[_0x7417('0x1f')][_0x7417('0x1c')](this,_0x152171));}}else{if(_[_0x7417('0x20')](this['mailAccounts'][_0x152171]['Imap'])){this['mailAccounts'][_0x152171]['Imap']={};}this[_0x7417('0xf')][_0x152171][_0x7417('0x12')][_0x7417('0x21')]=_0x7417('0x22');this[_0x7417('0xf')][_0x152171][_0x7417('0x12')]['messageStatus']='';this['emit'](_0x152171);}}}};EmailChannel['prototype'][_0x7417('0x23')]=function(_0x2ecd7e,_0x5404c4){if(this['mailAccounts'][_0x2ecd7e]){this['mailAccounts'][_0x2ecd7e]['Imap'][_0x7417('0x21')]=_0x7417('0x24');this[_0x7417('0xf')][_0x2ecd7e][_0x7417('0x12')][_0x7417('0x13')]=_0x5404c4[_0x7417('0x10')];if(_0x5404c4[_0x7417('0x25')]){this[_0x7417('0xf')][_0x2ecd7e][_0x7417('0x12')][_0x7417('0x14')]=_0x5404c4[_0x7417('0x25')][_0x7417('0x14')];}return this[_0x7417('0xe')](_0x2ecd7e);}};EmailChannel[_0x7417('0xd')]['handleImapEmail']=function(_0xd262d0,_0x41a6ed){logger[_0x7417('0xa')](_0x7417('0x26'),_0x41a6ed[_0x7417('0x27')],_0x41a6ed['lastName'],_0x41a6ed[_0x7417('0x28')],_0xd262d0);if(this[_0x7417('0xf')][_0xd262d0]){return mailAccount[_0x7417('0x29')](_0xd262d0,_0x41a6ed)[_0x7417('0x2a')](function(_0x19af3d){if(_0x19af3d){logger[_0x7417('0xa')](_0x7417('0x2b'));}})[_0x7417('0x2c')](function(_0x8825f1){logger['error'](_0x7417('0x2d'),JSON[_0x7417('0x2e')](_0x8825f1));});}};EmailChannel[_0x7417('0xd')][_0x7417('0x1d')]=function(_0xdd9b48){if(this['mailAccounts'][_0xdd9b48]&&this[_0x7417('0xf')][_0xdd9b48][_0x7417('0x12')]){if(this[_0x7417('0xc')][this[_0x7417('0xf')][_0xdd9b48][_0x7417('0x12')]['id']]){delete this[_0x7417('0xc')][this['mailAccounts'][_0xdd9b48][_0x7417('0x12')]['id']];}this[_0x7417('0xf')][_0xdd9b48]['Imap'][_0x7417('0x2f')]=moment();this['emit'](_0xdd9b48);}};EmailChannel['prototype'][_0x7417('0x1f')]=function(_0x13f7d1,_0x2a3b2e){if(this[_0x7417('0xf')][_0x13f7d1]){this[_0x7417('0xf')][_0x13f7d1]['Imap']['status']=_0x7417('0x1e');this[_0x7417('0xf')][_0x13f7d1][_0x7417('0x12')][_0x7417('0x13')]=_0x2a3b2e;return this[_0x7417('0xe')](_0x13f7d1);}};EmailChannel[_0x7417('0xd')][_0x7417('0x30')]=function(_0x104213,_0x58b894){return this[_0x7417('0x31')][_0x7417('0x32')](_0x104213,_0x58b894);};EmailChannel['prototype'][_0x7417('0x33')]=function(_0x207a26){var _0x5a3891=this;if(this[_0x7417('0xf')][_0x207a26['id']]){if(_['isNil'](this[_0x7417('0xf')][_0x207a26['id']][_0x7417('0x34')])){this[_0x7417('0xf')][_0x207a26['id']][_0x7417('0x34')]={};}this[_0x7417('0xf')][_0x207a26['id']]['Smtp'][_0x7417('0x2f')]=moment();return new BPromise(function(_0x43675e,_0x4bc5bd){return _0x5a3891[_0x7417('0x31')][_0x7417('0x35')](_0x207a26)[_0x7417('0x2a')](function(_0x5cd6e9){_0x5a3891[_0x7417('0xf')][_0x207a26['id']]['Smtp'][_0x7417('0x21')]=_0x7417('0x36');_0x5a3891[_0x7417('0xf')][_0x207a26['id']][_0x7417('0x34')][_0x7417('0x13')]='';_0x5a3891[_0x7417('0xe')](_0x207a26['id']);_0x43675e(_0x5cd6e9);})[_0x7417('0x2c')](function(_0x195935){_0x5a3891['mailAccounts'][_0x207a26['id']][_0x7417('0x34')][_0x7417('0x21')]='error';_0x5a3891[_0x7417('0xf')][_0x207a26['id']]['Smtp']['messageStatus']=_0x195935;_0x5a3891['emit'](_0x207a26['id']);_0x4bc5bd(_0x195935);});});}return this[_0x7417('0x31')][_0x7417('0x35')](_0x207a26);};module[_0x7417('0x37')]=EmailChannel; \ No newline at end of file +var _0x5175=['Imap','status','messageStatus','total','isNil','refresh','hasOwnProperty','box','handleImapBox','handleImapEmail','handleImapEnd','bind','error','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','handleImapError','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key','active'];(function(_0x1bf11e,_0x5aa388){var _0xe11cc8=function(_0x23994c){while(--_0x23994c){_0x1bf11e['push'](_0x1bf11e['shift']());}};_0xe11cc8(++_0x5aa388);}(_0x5175,0xbc));var _0x5517=function(_0x651bff,_0x55597d){_0x651bff=_0x651bff-0x0;var _0x43d450=_0x5175[_0x651bff];return _0x43d450;};'use strict';var _=require(_0x5517('0x0'));var moment=require(_0x5517('0x1'));var BPromise=require('bluebird');var md5=require(_0x5517('0x2'));var Redis=require(_0x5517('0x3'));var config=require(_0x5517('0x4'));var logger=require(_0x5517('0x5'))(_0x5517('0x6'));config['redis']=_['defaults'](config[_0x5517('0x7')],{'host':_0x5517('0x8'),'port':0x18eb});var io=require(_0x5517('0x9'))(new Redis(config['redis']));var EmailImap=require('./imap');var EmailSmtp=require(_0x5517('0xa'));var mailAccount=require(_0x5517('0xb'));var md5Accounts={};function EmailChannel(_0x5dab5b){logger['info'](_0x5517('0xc'));this[_0x5517('0xd')]=_0x5dab5b[_0x5517('0xd')];this[_0x5517('0xe')]={};this[_0x5517('0xf')]=new EmailSmtp();}EmailChannel[_0x5517('0x10')][_0x5517('0x11')]=function(_0x5e5e68){var _0x31886a=this[_0x5517('0xd')][_0x5e5e68];var _0xbce8ef={'id':_0x31886a['id'],'name':_0x31886a['name'],'key':_0x31886a[_0x5517('0x12')],'active':_0x31886a[_0x5517('0x13')],'Imap':{'status':_0x31886a[_0x5517('0x14')][_0x5517('0x15')],'messageStatus':_0x31886a[_0x5517('0x14')][_0x5517('0x16')],'total':_0x31886a['Imap'][_0x5517('0x17')]}};if(_[_0x5517('0x18')](md5Accounts[_0x5e5e68])){md5Accounts[_0x5e5e68]={};}var _0x2f349f=md5(JSON['stringify'](_0xbce8ef));if(md5Accounts[_0x5e5e68]['md5']!==_0x2f349f){md5Accounts[_0x5e5e68]['md5']=_0x2f349f;io[_0x5517('0x11')]('mailAccount:update',_0xbce8ef);}};EmailChannel[_0x5517('0x10')][_0x5517('0x19')]=function(_0x2b3e05){for(var _0x3751f5 in _0x2b3e05){if(_0x2b3e05[_0x5517('0x1a')](_0x3751f5)){if(_0x2b3e05[_0x3751f5][_0x5517('0x14')]&&_0x2b3e05[_0x3751f5][_0x5517('0x13')]){var _0xd43c2a=_0x2b3e05[_0x3751f5]['Imap'];if(!this[_0x5517('0xe')][_0x5517('0x1a')](_0xd43c2a['id'])){this[_0x5517('0xe')][_0xd43c2a['id']]=new EmailImap(_0xd43c2a,_0x2b3e05[_0x3751f5]['email']);this[_0x5517('0xe')][_0xd43c2a['id']]['on'](_0x5517('0x1b'),this[_0x5517('0x1c')]['bind'](this,_0x3751f5));this['imapAccounts'][_0xd43c2a['id']]['on'](_0x5517('0x6'),this[_0x5517('0x1d')]['bind'](this,_0x3751f5));this[_0x5517('0xe')][_0xd43c2a['id']]['on']('end',this[_0x5517('0x1e')][_0x5517('0x1f')](this,_0x3751f5));this[_0x5517('0xe')][_0xd43c2a['id']]['on'](_0x5517('0x20'),this['handleImapError'][_0x5517('0x1f')](this,_0x3751f5));}}else{if(_[_0x5517('0x18')](this[_0x5517('0xd')][_0x3751f5][_0x5517('0x14')])){this[_0x5517('0xd')][_0x3751f5][_0x5517('0x14')]={};}this[_0x5517('0xd')][_0x3751f5]['Imap']['status']='disabled';this[_0x5517('0xd')][_0x3751f5][_0x5517('0x14')][_0x5517('0x16')]='';this['emit'](_0x3751f5);}}}};EmailChannel[_0x5517('0x10')][_0x5517('0x1c')]=function(_0x28565f,_0x4d304f){if(this[_0x5517('0xd')][_0x28565f]){this[_0x5517('0xd')][_0x28565f]['Imap'][_0x5517('0x15')]='connected';this[_0x5517('0xd')][_0x28565f][_0x5517('0x14')][_0x5517('0x16')]=_0x4d304f['name'];if(_0x4d304f['messages']){this[_0x5517('0xd')][_0x28565f][_0x5517('0x14')][_0x5517('0x17')]=_0x4d304f[_0x5517('0x21')]['total'];}return this[_0x5517('0x11')](_0x28565f);}};EmailChannel['prototype'][_0x5517('0x1d')]=function(_0x1308e6,_0x3f7db3){logger[_0x5517('0x22')](_0x5517('0x23'),_0x3f7db3['firstName'],_0x3f7db3[_0x5517('0x24')],_0x3f7db3[_0x5517('0x25')],_0x1308e6);if(this[_0x5517('0xd')][_0x1308e6]){return mailAccount[_0x5517('0x26')](_0x1308e6,_0x3f7db3)[_0x5517('0x27')](function(_0x59aa42){if(_0x59aa42){logger[_0x5517('0x22')](_0x5517('0x28'));}})[_0x5517('0x29')](function(_0x4a2ce){logger[_0x5517('0x20')](_0x5517('0x2a'),JSON[_0x5517('0x2b')](_0x4a2ce));});}};EmailChannel[_0x5517('0x10')]['handleImapEnd']=function(_0x5ee3ef){if(this[_0x5517('0xd')][_0x5ee3ef]&&this[_0x5517('0xd')][_0x5ee3ef]['Imap']){if(this[_0x5517('0xe')][this[_0x5517('0xd')][_0x5ee3ef][_0x5517('0x14')]['id']]){delete this[_0x5517('0xe')][this[_0x5517('0xd')][_0x5ee3ef]['Imap']['id']];}this[_0x5517('0xd')][_0x5ee3ef]['Imap'][_0x5517('0x2c')]=moment();this['emit'](_0x5ee3ef);}};EmailChannel[_0x5517('0x10')][_0x5517('0x2d')]=function(_0xb0167b,_0x1dc7f8){if(this['mailAccounts'][_0xb0167b]){this[_0x5517('0xd')][_0xb0167b][_0x5517('0x14')][_0x5517('0x15')]=_0x5517('0x20');this['mailAccounts'][_0xb0167b]['Imap'][_0x5517('0x16')]=_0x1dc7f8;return this[_0x5517('0x11')](_0xb0167b);}};EmailChannel[_0x5517('0x10')]['sendMail']=function(_0xd0b232,_0x3b46f0){return this[_0x5517('0xf')][_0x5517('0x2e')](_0xd0b232,_0x3b46f0);};EmailChannel['prototype'][_0x5517('0x2f')]=function(_0x387ff2){var _0x959829=this;if(this[_0x5517('0xd')][_0x387ff2['id']]){if(_['isNil'](this[_0x5517('0xd')][_0x387ff2['id']][_0x5517('0x30')])){this[_0x5517('0xd')][_0x387ff2['id']]['Smtp']={};}this[_0x5517('0xd')][_0x387ff2['id']][_0x5517('0x30')][_0x5517('0x2c')]=moment();return new BPromise(function(_0x5d4a18,_0x18ebfe){return _0x959829[_0x5517('0xf')][_0x5517('0x31')](_0x387ff2)['then'](function(_0x1bded8){_0x959829[_0x5517('0xd')][_0x387ff2['id']]['Smtp'][_0x5517('0x15')]=_0x5517('0x32');_0x959829[_0x5517('0xd')][_0x387ff2['id']][_0x5517('0x30')][_0x5517('0x16')]='';_0x959829[_0x5517('0x11')](_0x387ff2['id']);_0x5d4a18(_0x1bded8);})[_0x5517('0x29')](function(_0x313011){_0x959829[_0x5517('0xd')][_0x387ff2['id']][_0x5517('0x30')][_0x5517('0x15')]=_0x5517('0x20');_0x959829[_0x5517('0xd')][_0x387ff2['id']][_0x5517('0x30')]['messageStatus']=_0x313011;_0x959829[_0x5517('0x11')](_0x387ff2['id']);_0x18ebfe(_0x313011);});});}return this[_0x5517('0xf')][_0x5517('0x31')](_0x387ff2);};module[_0x5517('0x33')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index f20d35e..d8aaf41 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 _0x878a=['textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','randomstring','Iconv','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','handleReady','bind','once','handleEnd','error','handleError','prototype','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','required','getHost','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify'];(function(_0x98e912,_0x554129){var _0x5d5647=function(_0x543ec6){while(--_0x543ec6){_0x98e912['push'](_0x98e912['shift']());}};_0x5d5647(++_0x554129);}(_0x878a,0x1dc));var _0xa878=function(_0x250591,_0x52a550){_0x250591=_0x250591-0x0;var _0x194083=_0x878a[_0x250591];return _0x194083;};'use strict';var fs=require('fs');var path=require(_0xa878('0x0'));var util=require(_0xa878('0x1'));var Imap=require(_0xa878('0x2'));var _=require(_0xa878('0x3'));var rs=require(_0xa878('0x4'));var simpleParser=require('mailparser')['simpleParser'];var Iconv=require('iconv')[_0xa878('0x5')];var EventEmitter=require('events')['EventEmitter'];var utils=require(_0xa878('0x6'));var logger=require(_0xa878('0x7'))(_0xa878('0x8'));function EmailImap(_0x449922,_0x585524){this[_0xa878('0x9')]=_0xa878('0xa');this[_0xa878('0xb')]=this[_0xa878('0xc')](_0x449922,_0x585524);this[_0xa878('0x2')]=new Imap(this[_0xa878('0xb')]);this[_0xa878('0x2')]['once']('ready',this[_0xa878('0xd')][_0xa878('0xe')](this));this['imap'][_0xa878('0xf')]('end',this[_0xa878('0x10')][_0xa878('0xe')](this));this[_0xa878('0x2')]['on'](_0xa878('0x11'),this[_0xa878('0x12')]['bind'](this));this[_0xa878('0x2')]['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xa878('0x13')][_0xa878('0xc')]=function(_0x41a93f,_0x110e12){var _0x5e064d={'connTimeout':_0x41a93f[_0xa878('0x14')]?_0x41a93f[_0xa878('0x14')]*0x3e8:0x2710,'authTimeout':_0x41a93f[_0xa878('0x15')]?_0x41a93f[_0xa878('0x15')]*0x3e8:0x1388};if(_[_0xa878('0x16')](_0x41a93f[_0xa878('0x17')])){if(_0x41a93f['authentication']){_0x5e064d[_0xa878('0x18')]=_0x41a93f['user'];_0x5e064d[_0xa878('0x19')]=_0x41a93f[_0xa878('0x19')];}_0x5e064d[_0xa878('0x1a')]=_0x41a93f[_0xa878('0x1a')];_0x5e064d[_0xa878('0x1b')]=_0x41a93f[_0xa878('0x1b')]||0x3e1;if(_0x41a93f[_0xa878('0x1c')]){_0x5e064d[_0xa878('0x1c')]=!![];}else{_0x5e064d[_0xa878('0x1c')]=![];_0x5e064d['autotls']=_0xa878('0x1d');}}else{_0x5e064d[_0xa878('0x18')]=_0x41a93f[_0xa878('0x18')];_0x5e064d[_0xa878('0x19')]=_0x41a93f[_0xa878('0x19')];_0x5e064d[_0xa878('0x1a')]=utils[_0xa878('0x1e')](_0x41a93f['service']);_0x5e064d[_0xa878('0x1b')]=0x3e1;_0x5e064d[_0xa878('0x1c')]=!![];}_0x5e064d[_0xa878('0x8')]=_0x110e12||_0x41a93f[_0xa878('0x18')]||'anonymous@xcally.com';return _0x5e064d;};EmailImap['prototype']['handleReady']=function(){this[_0xa878('0x2')][_0xa878('0x1f')](this[_0xa878('0x9')],![],this[_0xa878('0x20')][_0xa878('0xe')](this));};EmailImap['prototype'][_0xa878('0x20')]=function(_0x143b0b,_0x5d061c){if(_0x143b0b){this['handleError'](_0x143b0b,!![]);}else{this[_0xa878('0x21')]('box',_0x5d061c);this[_0xa878('0x22')]();}};EmailImap['prototype'][_0xa878('0x23')]=function(_0x308b6a){if(_0x308b6a){this['handleError'](_0x308b6a,!![]);}else{this[_0xa878('0x2')][_0xa878('0x24')]();}};EmailImap['prototype'][_0xa878('0x22')]=function(){this[_0xa878('0x2')][_0xa878('0x25')]([_0xa878('0x26')],this[_0xa878('0x27')][_0xa878('0xe')](this));};EmailImap['prototype'][_0xa878('0x27')]=function(_0x219f79,_0x40dcd9){if(_0x219f79){this[_0xa878('0x12')](_0x219f79,!![]);}else{if(_0x40dcd9[_0xa878('0x28')]){try{var _0x23b506=this[_0xa878('0x2')][_0xa878('0x29')](_0x40dcd9,{'bodies':'','markSeen':!![]});_0x23b506['on'](_0xa878('0x2a'),this[_0xa878('0x2b')][_0xa878('0xe')](this));_0x23b506[_0xa878('0xf')](_0xa878('0x11'),this[_0xa878('0x2c')][_0xa878('0xe')](this));_0x23b506[_0xa878('0xf')](_0xa878('0x24'),this[_0xa878('0x2d')][_0xa878('0xe')](this));}catch(_0x5ea2f3){logger[_0xa878('0x11')](_0x5ea2f3);}}else{this['imap'][_0xa878('0x2e')](!![],this['handleCloseBox'][_0xa878('0xe')](this));}}};EmailImap[_0xa878('0x13')]['handleFetchMessage']=function(_0x2d08ec,_0x298f82){_0x2d08ec['on'](_0xa878('0x2f'),this[_0xa878('0x30')]['bind'](this));_0x2d08ec[_0xa878('0xf')](_0xa878('0x31'),this[_0xa878('0x32')]['bind'](this));_0x2d08ec[_0xa878('0xf')](_0xa878('0x24'),this[_0xa878('0x33')][_0xa878('0xe')](this));};EmailImap[_0xa878('0x13')][_0xa878('0x30')]=function(_0x468f52,_0x5c9a25){simpleParser(_0x468f52,{'Iconv':Iconv},this[_0xa878('0x34')]['bind'](this));};EmailImap[_0xa878('0x13')][_0xa878('0x32')]=function(_0x243548){};EmailImap['prototype'][_0xa878('0x33')]=function(){};EmailImap[_0xa878('0x13')][_0xa878('0x34')]=function(_0x101978,_0x3fee57){if(_0x101978){logger[_0xa878('0x11')](_0x101978);}else{var _0xfe5be0=this;utils[_0xa878('0x35')](this['account'],_0x3fee57,function(_0x2a50ce){_0xfe5be0[_0xa878('0x21')](_0xa878('0x8'),_0x2a50ce);});}};EmailImap['prototype'][_0xa878('0x2d')]=function(){this[_0xa878('0x2')][_0xa878('0x2e')](!![],this[_0xa878('0x23')][_0xa878('0xe')](this));};EmailImap[_0xa878('0x13')][_0xa878('0x2c')]=function(_0x4e1372){this[_0xa878('0x12')](_0x4e1372);this[_0xa878('0x2')][_0xa878('0x2e')](!![],this['handleCloseBox'][_0xa878('0xe')](this));};EmailImap[_0xa878('0x13')]['handleEnd']=function(){this[_0xa878('0x21')](_0xa878('0x24'));};EmailImap['prototype'][_0xa878('0x12')]=function(_0x2134cb,_0x3d5d8c){logger[_0xa878('0x11')](_0xa878('0x12'),this[_0xa878('0xb')][_0xa878('0x8')],JSON[_0xa878('0x36')](_0x2134cb));var _0x2a8151='';if(_0x2134cb){if(_0x2134cb[_0xa878('0x37')]){_0x2a8151=_0x2134cb[_0xa878('0x37')];}else{for(var _0x486725 in _0x2134cb){if(_0x2134cb[_0xa878('0x38')](_0x486725)){_0x2a8151+=_[_0xa878('0x39')](_0x486725)+':\x20'+_0x2134cb[_0x486725]+'\x0a';}}}}if(_0x3d5d8c){this[_0xa878('0x2')][_0xa878('0x24')]();}else{this[_0xa878('0x21')](_0xa878('0x11'),_0x2a8151);this[_0xa878('0x21')](_0xa878('0x24'));}};module[_0xa878('0x3a')]=EmailImap; \ No newline at end of file +var _0xba3d=['fetch','message','handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','path','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','events','./utils','../../../config/logger','email','mailbox','account','getAccount','imap','once','handleReady','bind','end','handleEnd','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length'];(function(_0x188cb8,_0x3b12b3){var _0x25eb9b=function(_0x11770b){while(--_0x11770b){_0x188cb8['push'](_0x188cb8['shift']());}};_0x25eb9b(++_0x3b12b3);}(_0xba3d,0x19f));var _0xdba3=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xba3d[_0x59c301];return _0x3866b9;};'use strict';var fs=require('fs');var path=require(_0xdba3('0x0'));var util=require('util');var Imap=require('imap');var _=require(_0xdba3('0x1'));var rs=require(_0xdba3('0x2'));var simpleParser=require(_0xdba3('0x3'))[_0xdba3('0x4')];var Iconv=require(_0xdba3('0x5'))[_0xdba3('0x6')];var EventEmitter=require(_0xdba3('0x7'))['EventEmitter'];var utils=require(_0xdba3('0x8'));var logger=require(_0xdba3('0x9'))(_0xdba3('0xa'));function EmailImap(_0x42d849,_0x20a952){this[_0xdba3('0xb')]='INBOX';this[_0xdba3('0xc')]=this[_0xdba3('0xd')](_0x42d849,_0x20a952);this[_0xdba3('0xe')]=new Imap(this[_0xdba3('0xc')]);this[_0xdba3('0xe')][_0xdba3('0xf')]('ready',this[_0xdba3('0x10')][_0xdba3('0x11')](this));this[_0xdba3('0xe')]['once'](_0xdba3('0x12'),this[_0xdba3('0x13')][_0xdba3('0x11')](this));this[_0xdba3('0xe')]['on']('error',this['handleError'][_0xdba3('0x11')](this));this[_0xdba3('0xe')][_0xdba3('0x14')]();}util[_0xdba3('0x15')](EmailImap,EventEmitter);EmailImap[_0xdba3('0x16')]['getAccount']=function(_0x4fc97f,_0x2ba548){var _0x44d512={'connTimeout':_0x4fc97f['connTimeout']?_0x4fc97f[_0xdba3('0x17')]*0x3e8:0x2710,'authTimeout':_0x4fc97f[_0xdba3('0x18')]?_0x4fc97f['authTimeout']*0x3e8:0x1388};if(_[_0xdba3('0x19')](_0x4fc97f[_0xdba3('0x1a')])){if(_0x4fc97f[_0xdba3('0x1b')]){_0x44d512[_0xdba3('0x1c')]=_0x4fc97f[_0xdba3('0x1c')];_0x44d512[_0xdba3('0x1d')]=_0x4fc97f['password'];}_0x44d512[_0xdba3('0x1e')]=_0x4fc97f['host'];_0x44d512[_0xdba3('0x1f')]=_0x4fc97f[_0xdba3('0x1f')]||0x3e1;if(_0x4fc97f[_0xdba3('0x20')]){_0x44d512[_0xdba3('0x20')]=!![];}else{_0x44d512['tls']=![];_0x44d512[_0xdba3('0x21')]=_0xdba3('0x22');}}else{_0x44d512['user']=_0x4fc97f[_0xdba3('0x1c')];_0x44d512[_0xdba3('0x1d')]=_0x4fc97f['password'];_0x44d512[_0xdba3('0x1e')]=utils[_0xdba3('0x23')](_0x4fc97f[_0xdba3('0x1a')]);_0x44d512['port']=0x3e1;_0x44d512['tls']=!![];}_0x44d512['email']=_0x2ba548||_0x4fc97f[_0xdba3('0x1c')]||_0xdba3('0x24');return _0x44d512;};EmailImap['prototype'][_0xdba3('0x10')]=function(){this[_0xdba3('0xe')][_0xdba3('0x25')](this[_0xdba3('0xb')],![],this[_0xdba3('0x26')][_0xdba3('0x11')](this));};EmailImap['prototype'][_0xdba3('0x26')]=function(_0x2fc689,_0x6c0709){if(_0x2fc689){this[_0xdba3('0x27')](_0x2fc689,!![]);}else{this[_0xdba3('0x28')](_0xdba3('0x29'),_0x6c0709);this[_0xdba3('0x2a')]();}};EmailImap[_0xdba3('0x16')][_0xdba3('0x2b')]=function(_0x3e5a7a){if(_0x3e5a7a){this[_0xdba3('0x27')](_0x3e5a7a,!![]);}else{this['imap']['end']();}};EmailImap['prototype'][_0xdba3('0x2a')]=function(){this[_0xdba3('0xe')]['search']([_0xdba3('0x2c')],this[_0xdba3('0x2d')][_0xdba3('0x11')](this));};EmailImap[_0xdba3('0x16')]['handleReadUnseen']=function(_0xf4e0c6,_0x25e4cf){if(_0xf4e0c6){this['handleError'](_0xf4e0c6,!![]);}else{if(_0x25e4cf[_0xdba3('0x2e')]){try{var _0x250ac9=this[_0xdba3('0xe')][_0xdba3('0x2f')](_0x25e4cf,{'bodies':'','markSeen':!![]});_0x250ac9['on'](_0xdba3('0x30'),this[_0xdba3('0x31')][_0xdba3('0x11')](this));_0x250ac9[_0xdba3('0xf')](_0xdba3('0x32'),this[_0xdba3('0x33')][_0xdba3('0x11')](this));_0x250ac9['once'](_0xdba3('0x12'),this[_0xdba3('0x34')]['bind'](this));}catch(_0x96f1c2){logger['error'](_0x96f1c2);}}else{this[_0xdba3('0xe')][_0xdba3('0x35')](!![],this[_0xdba3('0x2b')][_0xdba3('0x11')](this));}}};EmailImap[_0xdba3('0x16')][_0xdba3('0x31')]=function(_0x4aa669,_0x44583d){_0x4aa669['on'](_0xdba3('0x36'),this[_0xdba3('0x37')][_0xdba3('0x11')](this));_0x4aa669[_0xdba3('0xf')](_0xdba3('0x38'),this[_0xdba3('0x39')][_0xdba3('0x11')](this));_0x4aa669[_0xdba3('0xf')](_0xdba3('0x12'),this[_0xdba3('0x3a')][_0xdba3('0x11')](this));};EmailImap[_0xdba3('0x16')][_0xdba3('0x37')]=function(_0x184b3d,_0x135167){simpleParser(_0x184b3d,{'Iconv':Iconv},this[_0xdba3('0x3b')]['bind'](this));};EmailImap[_0xdba3('0x16')][_0xdba3('0x39')]=function(_0x4b12c8){};EmailImap[_0xdba3('0x16')][_0xdba3('0x3a')]=function(){};EmailImap[_0xdba3('0x16')][_0xdba3('0x3b')]=function(_0x2c8db4,_0x5ed377){if(_0x2c8db4){logger[_0xdba3('0x32')](_0x2c8db4);}else{var _0x116ebb=this;utils[_0xdba3('0x3c')](this[_0xdba3('0xc')],_0x5ed377,function(_0x572f56){_0x116ebb[_0xdba3('0x28')](_0xdba3('0xa'),_0x572f56);});}};EmailImap[_0xdba3('0x16')][_0xdba3('0x34')]=function(){this[_0xdba3('0xe')]['closeBox'](!![],this[_0xdba3('0x2b')][_0xdba3('0x11')](this));};EmailImap['prototype'][_0xdba3('0x33')]=function(_0x31b7bc){this[_0xdba3('0x27')](_0x31b7bc);this['imap'][_0xdba3('0x35')](!![],this[_0xdba3('0x2b')][_0xdba3('0x11')](this));};EmailImap[_0xdba3('0x16')][_0xdba3('0x13')]=function(){this[_0xdba3('0x28')](_0xdba3('0x12'));};EmailImap['prototype'][_0xdba3('0x27')]=function(_0x4f02bc,_0x489180){logger[_0xdba3('0x32')](_0xdba3('0x27'),this['account'][_0xdba3('0xa')],JSON[_0xdba3('0x3d')](_0x4f02bc));var _0x2914f8='';if(_0x4f02bc){if(_0x4f02bc[_0xdba3('0x3e')]){_0x2914f8=_0x4f02bc[_0xdba3('0x3e')];}else{for(var _0x4e1b3b in _0x4f02bc){if(_0x4f02bc[_0xdba3('0x3f')](_0x4e1b3b)){_0x2914f8+=_[_0xdba3('0x40')](_0x4e1b3b)+':\x20'+_0x4f02bc[_0x4e1b3b]+'\x0a';}}}}if(_0x489180){this['imap'][_0xdba3('0x12')]();}else{this['emit'](_0xdba3('0x32'),_0x2914f8);this[_0xdba3('0x28')](_0xdba3('0x12'));}};module[_0xdba3('0x41')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 9b8c641..6de2d37 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 _0x38d0=['sendMail','verify','toString','Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use'];(function(_0x52096b,_0x20bab4){var _0x2b1cc7=function(_0x3f7021){while(--_0x3f7021){_0x52096b['push'](_0x52096b['shift']());}};_0x2b1cc7(++_0x20bab4);}(_0x38d0,0xe0));var _0x038d=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x38d0[_0x5d2803];return _0xdcad2c;};'use strict';var nodemailer=require(_0x038d('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x038d('0x1'));function EmailSmtp(){}EmailSmtp[_0x038d('0x2')][_0x038d('0x3')]=function(_0x9bfcc3,_0x26b59a){return new BPromise(function(_0x4653f5,_0x58a657){var _0x3d11d3=nodemailer[_0x038d('0x4')](_0x9bfcc3);_0x3d11d3[_0x038d('0x5')]('compile',inlineBase64());_0x3d11d3[_0x038d('0x6')](_0x26b59a,function(_0x36789f,_0x58afbf){if(_0x36789f){_0x58a657(_0x36789f['toString']());}else{_0x4653f5(_0x58afbf);}});});};EmailSmtp[_0x038d('0x2')][_0x038d('0x7')]=function(_0x9af618){return new BPromise(function(_0x36f03f,_0x56efef){var _0x4bbe82=nodemailer[_0x038d('0x4')](_0x9af618);_0x4bbe82[_0x038d('0x7')](function(_0x24d490,_0x5642dc){if(_0x24d490){_0x56efef(_0x24d490[_0x038d('0x8')]());}else{if(_0x5642dc){_0x36f03f(_0x5642dc);}else{_0x56efef(_0x038d('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0xed76=['exports','nodemailer','nodemailer-plugin-inline-base64','prototype','createTransport','use','compile','sendMail','verify','toString','Not\x20verifired'];(function(_0x47dcf6,_0x2bd422){var _0x2dfdc5=function(_0x5d0eb8){while(--_0x5d0eb8){_0x47dcf6['push'](_0x47dcf6['shift']());}};_0x2dfdc5(++_0x2bd422);}(_0xed76,0x1b9));var _0x6ed7=function(_0x1ee13a,_0x3a7ef0){_0x1ee13a=_0x1ee13a-0x0;var _0x839c63=_0xed76[_0x1ee13a];return _0x839c63;};'use strict';var nodemailer=require(_0x6ed7('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x6ed7('0x1'));function EmailSmtp(){}EmailSmtp[_0x6ed7('0x2')]['send']=function(_0x215811,_0x52d1ae){return new BPromise(function(_0x48fd18,_0x3983b0){var _0x1bee1e=nodemailer[_0x6ed7('0x3')](_0x215811);_0x1bee1e[_0x6ed7('0x4')](_0x6ed7('0x5'),inlineBase64());_0x1bee1e[_0x6ed7('0x6')](_0x52d1ae,function(_0x254562,_0x44280c){if(_0x254562){_0x3983b0(_0x254562['toString']());}else{_0x48fd18(_0x44280c);}});});};EmailSmtp[_0x6ed7('0x2')][_0x6ed7('0x7')]=function(_0x196cd0){return new BPromise(function(_0x33e521,_0x2bdc74){var _0x507fa2=nodemailer[_0x6ed7('0x3')](_0x196cd0);_0x507fa2[_0x6ed7('0x7')](function(_0x4cf776,_0x5386d4){if(_0x4cf776){_0x2bdc74(_0x4cf776[_0x6ed7('0x8')]());}else{if(_0x5386d4){_0x33e521(_0x5386d4);}else{_0x2bdc74(_0x6ed7('0x9'));}}});});};module[_0x6ed7('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 1b0e16c..3c1fe22 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 _0x626d=['

Empty\x20message

','Attachments','Title','Data','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','lodash','randomstring','util','email','../../../config/environment','value','address','anonymous','generate','@xcally.com','name','split','length','slice','join','Anonymous','pop','isEmpty','html','test','replace','body','message','originCc','includes','originTo','bcc','attachments','attach','attachment','filename','attachment-','format','now','server/files/attachments/','writeFileSync','push','from','subject','inReplyTo','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','content','BodyHTML'];(function(_0x2aa42d,_0x4fc198){var _0x213ddc=function(_0x2425eb){while(--_0x2425eb){_0x2aa42d['push'](_0x2aa42d['shift']());}};_0x213ddc(++_0x4fc198);}(_0x626d,0xbc));var _0xd626=function(_0x1a1793,_0x264537){_0x1a1793=_0x1a1793-0x0;var _0x4c9ba0=_0x626d[_0x1a1793];return _0x4c9ba0;};'use strict';var _=require(_0xd626('0x0'));var moment=require('moment');var random=require(_0xd626('0x1'));var fs=require('fs');var path=require('path');var util=require(_0xd626('0x2'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0xd626('0x3'));var config=require(_0xd626('0x4'));function getAddress(_0x21e045){var _0x48dc41=_['head'](_0x21e045[_0xd626('0x5')]);return _0x48dc41&&_0x48dc41['address']?_0x48dc41[_0xd626('0x6')]:_0xd626('0x7')+random[_0xd626('0x8')](0x6)+_0xd626('0x9');}function getFirstName(_0x4969c7){var _0x4f5731=_['head'](_0x4969c7[_0xd626('0x5')]);if(_0x4f5731&&_0x4f5731[_0xd626('0xa')]){var _0x2e1b48=_0x4f5731[_0xd626('0xa')][_0xd626('0xb')](/\s+/);return _0x2e1b48[_0xd626('0xc')]?_0x2e1b48[_0xd626('0xd')](0x0,-0x1)[_0xd626('0xe')]('\x20'):_0x4f5731['name'];}return _0xd626('0xf');}function getLastName(_0x2b803c){var _0x2cf14e=_['head'](_0x2b803c['value']);if(_0x2cf14e&&_0x2cf14e[_0xd626('0xa')]){var _0x59017b=_0x2cf14e[_0xd626('0xa')][_0xd626('0xb')](/\s+/);return _0x59017b['length']>0x1?_0x59017b[_0xd626('0x10')]():'';}return'';}function getMails(_0x48b68d,_0x45d647){var _0x51e60c='';for(var _0x5c1f2=0x0;_0x5c1f2<_0x45d647[_0xd626('0x5')]['length'];_0x5c1f2+=0x1){if(_0x45d647[_0xd626('0x5')][_0x5c1f2][_0xd626('0x6')]!==_0x48b68d){if(!_[_0xd626('0x11')](_0x51e60c)){_0x51e60c+=',';}_0x51e60c+=_0x45d647[_0xd626('0x5')][_0x5c1f2][_0xd626('0xa')]||_0x45d647[_0xd626('0x5')][_0x5c1f2]['address']||'';_0x51e60c+='\x20<';_0x51e60c+=_0x45d647['value'][_0x5c1f2][_0xd626('0x6')]?_0x45d647[_0xd626('0x5')][_0x5c1f2][_0xd626('0x6')]:_0xd626('0x7')+random['generate'](0x6)+_0xd626('0x9');_0x51e60c+='>';}}return _0x51e60c;}function parseEmail(_0x3cdbc0,_0x1954f7,_0xdd6809){if(_0x1954f7[_0xd626('0x12')]){var _0x5dbfad=/)<[^<]*)*<\/script>/gi;while(_0x5dbfad[_0xd626('0x13')](_0x1954f7[_0xd626('0x12')])){_0x1954f7['html']=_0x1954f7[_0xd626('0x12')][_0xd626('0x14')](_0x5dbfad,'');}_0xdd6809[_0xd626('0x15')]=_0x1954f7[_0xd626('0x12')];}else{_0xdd6809['body']=_0x1954f7['textAsHtml'];}if(_0xdd6809[_0xd626('0x15')]){_0xdd6809[_0xd626('0x15')]=_0xdd6809['body'][_0xd626('0x14')](/Empty\x20message

','Attachments','Title','Data','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','moment','randomstring','path','node-tnef'];(function(_0x486f1d,_0x90c2b5){var _0x5a2c2d=function(_0x1a5f79){while(--_0x1a5f79){_0x486f1d['push'](_0x486f1d['shift']());}};_0x5a2c2d(++_0x90c2b5);}(_0x7f16,0x10b));var _0x67f1=function(_0x1667e8,_0x369eaf){_0x1667e8=_0x1667e8-0x0;var _0x4be155=_0x7f16[_0x1667e8];return _0x4be155;};'use strict';var _=require(_0x67f1('0x0'));var moment=require(_0x67f1('0x1'));var random=require(_0x67f1('0x2'));var fs=require('fs');var path=require(_0x67f1('0x3'));var util=require('util');var tnef=require(_0x67f1('0x4'));var logger=require('../../../config/logger')(_0x67f1('0x5'));var config=require(_0x67f1('0x6'));function getAddress(_0x11d2c4){var _0x59118a=_[_0x67f1('0x7')](_0x11d2c4['value']);return _0x59118a&&_0x59118a[_0x67f1('0x8')]?_0x59118a[_0x67f1('0x8')]:_0x67f1('0x9')+random['generate'](0x6)+_0x67f1('0xa');}function getFirstName(_0x55b60e){var _0x2d4796=_['head'](_0x55b60e[_0x67f1('0xb')]);if(_0x2d4796&&_0x2d4796[_0x67f1('0xc')]){var _0x1ba065=_0x2d4796[_0x67f1('0xc')][_0x67f1('0xd')](/\s+/);return _0x1ba065[_0x67f1('0xe')]?_0x1ba065[_0x67f1('0xf')](0x0,-0x1)[_0x67f1('0x10')]('\x20'):_0x2d4796[_0x67f1('0xc')];}return _0x67f1('0x11');}function getLastName(_0xf44737){var _0x5d301d=_['head'](_0xf44737[_0x67f1('0xb')]);if(_0x5d301d&&_0x5d301d[_0x67f1('0xc')]){var _0x4807fe=_0x5d301d[_0x67f1('0xc')][_0x67f1('0xd')](/\s+/);return _0x4807fe[_0x67f1('0xe')]>0x1?_0x4807fe[_0x67f1('0x12')]():'';}return'';}function getMails(_0x3ca899,_0x3dcfb2){var _0x5778ec='';for(var _0x4a13fe=0x0;_0x4a13fe<_0x3dcfb2[_0x67f1('0xb')][_0x67f1('0xe')];_0x4a13fe+=0x1){if(_0x3dcfb2[_0x67f1('0xb')][_0x4a13fe][_0x67f1('0x8')]!==_0x3ca899){if(!_[_0x67f1('0x13')](_0x5778ec)){_0x5778ec+=',';}_0x5778ec+=_0x3dcfb2['value'][_0x4a13fe][_0x67f1('0xc')]||_0x3dcfb2[_0x67f1('0xb')][_0x4a13fe][_0x67f1('0x8')]||'';_0x5778ec+='\x20<';_0x5778ec+=_0x3dcfb2[_0x67f1('0xb')][_0x4a13fe][_0x67f1('0x8')]?_0x3dcfb2['value'][_0x4a13fe][_0x67f1('0x8')]:_0x67f1('0x9')+random[_0x67f1('0x14')](0x6)+_0x67f1('0xa');_0x5778ec+='>';}}return _0x5778ec;}function parseEmail(_0x2698b3,_0x36a46d,_0x155ea1){if(_0x36a46d[_0x67f1('0x15')]){var _0x1220b1=/)<[^<]*)*<\/script>/gi;while(_0x1220b1['test'](_0x36a46d[_0x67f1('0x15')])){_0x36a46d[_0x67f1('0x15')]=_0x36a46d[_0x67f1('0x15')][_0x67f1('0x16')](_0x1220b1,'');}_0x155ea1[_0x67f1('0x17')]=_0x36a46d[_0x67f1('0x15')];}else{_0x155ea1[_0x67f1('0x17')]=_0x36a46d[_0x67f1('0x18')];}if(_0x155ea1[_0x67f1('0x17')]){_0x155ea1['body']=_0x155ea1[_0x67f1('0x17')][_0x67f1('0x16')](/0x0){if(this[_0x653ef1+_0x4c87('0x24')]>0x0&&this[_0x653ef1+_0x4c87('0x23')]>=this[_0x653ef1+_0x4c87('0x24')]){return _0x4c87('0x25');}else{return'working';}}else{return _0x4c87('0x26');}};Agent[_0x4c87('0x21')]['updateRealtime']=function(){var _0x3ff588=[_0x4c87('0x27'),'chat',_0x4c87('0x28'),_0x4c87('0x29'),_0x4c87('0x2a')];for(var _0x3b4399=0x0;_0x3b4399<_0x3ff588['length'];_0x3b4399+=0x1){var _0x4735f2=this[_0x4c87('0x22')](_0x3ff588[_0x3b4399]);if(this[_0x3ff588[_0x3b4399]+_0x4c87('0x2b')]!==_0x4735f2){this[_0x3ff588[_0x3b4399]+_0x4c87('0x2c')]=_[_0x4c87('0x2d')](moment()[_0x4c87('0x2e')]('x'));}this[_0x3ff588[_0x3b4399]+_0x4c87('0x2b')]=_0x4735f2;}var _0x1c82d6={'id':this['id'],'name':this['name'],'online':this[_0x4c87('0x7')],'voicePause':this['voicePause'],'chatPause':this[_0x4c87('0x9')],'mailPause':this[_0x4c87('0xa')],'smsPause':this[_0x4c87('0xc')],'faxPause':this[_0x4c87('0xb')],'openchannelPause':this[_0x4c87('0xd')],'chatStatus':this[_0x4c87('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x4c87('0x10')],'chatCurrentCapacity':this[_0x4c87('0x11')],'mailStatus':this[_0x4c87('0x12')],'mailStatusTime':this[_0x4c87('0x2f')],'mailCapacity':this[_0x4c87('0x13')],'mailCurrentCapacity':this[_0x4c87('0x14')],'faxStatus':this[_0x4c87('0x15')],'faxStatusTime':this[_0x4c87('0x17')],'faxCapacity':this[_0x4c87('0x18')],'faxCurrentCapacity':this[_0x4c87('0x19')],'smsStatus':this[_0x4c87('0x30')],'smsStatusTime':this[_0x4c87('0x1a')],'smsCapacity':this[_0x4c87('0x31')],'smsCurrentCapacity':this[_0x4c87('0x1b')],'openchannelStatus':this[_0x4c87('0x1c')],'openchannelStatusTime':this[_0x4c87('0x32')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x4c87('0x1e')],'busy':this['busy'],'busyQueue':this[_0x4c87('0x20')]};var _0x57de17=md5(JSON[_0x4c87('0x33')](_0x1c82d6));if(this[_0x4c87('0x1')]!==_0x57de17){this[_0x4c87('0x1')]=_0x57de17;io[_0x4c87('0x34')]('user:save',_0x1c82d6);}};module[_0x4c87('0x35')]=Agent; \ No newline at end of file +var _0x4522=['chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','mail','chat','openchannel','fax','sms','length','Status','StatusTime','mailStatusTime','smsStatus','smsCurrentCapacity','openchannelStatusTime','busyQueue','stringify','emit','user:save','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','smsPause','openchannelPause','chatStatus','unknown'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4522,0x1a0));var _0x2452=function(_0x276005,_0x24347d){_0x276005=_0x276005-0x0;var _0x5d893f=_0x4522[_0x276005];return _0x5d893f;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0x2452('0x0'));var Redis=require(_0x2452('0x1'));var config=require(_0x2452('0x2'));config['redis']=_[_0x2452('0x3')](config[_0x2452('0x4')],{'host':_0x2452('0x5'),'port':0x18eb});var io=require(_0x2452('0x6'))(new Redis(config[_0x2452('0x4')]));function Agent(_0x243893){this['id']=_0x243893['id']||0x0;this[_0x2452('0x7')]=_0x243893[_0x2452('0x7')]||'';this[_0x2452('0x8')]=_0x243893[_0x2452('0x8')]||!![];this[_0x2452('0x9')]=_0x243893[_0x2452('0x9')]||![];this[_0x2452('0xa')]=_0x243893[_0x2452('0xa')]||![];this[_0x2452('0xb')]=_0x243893[_0x2452('0xb')]||![];this['faxPause']=_0x243893['faxPause']||![];this[_0x2452('0xc')]=_0x243893['smsPause']||![];this['openchannelPause']=_0x243893[_0x2452('0xd')]||![];this[_0x2452('0xe')]=_0x2452('0xf');this[_0x2452('0x10')]=0x0;this[_0x2452('0x11')]=_0x243893[_0x2452('0x11')]||0x0;this[_0x2452('0x12')]=0x0;this[_0x2452('0x13')]='unknown';this['mailStatusTime']=0x0;this['mailCapacity']=_0x243893[_0x2452('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x2452('0x15')]='unknown';this[_0x2452('0x16')]=0x0;this[_0x2452('0x17')]=_0x243893['faxCapacity']||0x0;this[_0x2452('0x18')]=0x0;this['smsStatus']=_0x2452('0xf');this[_0x2452('0x19')]=0x0;this[_0x2452('0x1a')]=_0x243893[_0x2452('0x1a')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x2452('0x1b')]=_0x2452('0xf');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x243893[_0x2452('0x1c')]||0x0;this[_0x2452('0x1d')]=0x0;this[_0x2452('0x1e')]=![];this['busyQueue']=undefined;this[_0x2452('0x0')]='';this[_0x2452('0x1f')]();}Agent[_0x2452('0x20')][_0x2452('0x21')]=function(_0x1931b0){if(this[_0x1931b0+_0x2452('0x22')]>0x0){if(this[_0x1931b0+_0x2452('0x23')]>0x0&&this[_0x1931b0+_0x2452('0x22')]>=this[_0x1931b0+'Capacity']){return'maxcapacity';}else{return _0x2452('0x24');}}else{return _0x2452('0x25');}};Agent['prototype'][_0x2452('0x1f')]=function(){var _0x395cf1=[_0x2452('0x26'),_0x2452('0x27'),_0x2452('0x28'),_0x2452('0x29'),_0x2452('0x2a')];for(var _0x543b06=0x0;_0x543b06<_0x395cf1[_0x2452('0x2b')];_0x543b06+=0x1){var _0x27d049=this[_0x2452('0x21')](_0x395cf1[_0x543b06]);if(this[_0x395cf1[_0x543b06]+_0x2452('0x2c')]!==_0x27d049){this[_0x395cf1[_0x543b06]+_0x2452('0x2d')]=_['toNumber'](moment()['format']('x'));}this[_0x395cf1[_0x543b06]+_0x2452('0x2c')]=_0x27d049;}var _0x159ba1={'id':this['id'],'name':this[_0x2452('0x7')],'online':this[_0x2452('0x8')],'voicePause':this[_0x2452('0x9')],'chatPause':this['chatPause'],'mailPause':this[_0x2452('0xb')],'smsPause':this[_0x2452('0xc')],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x2452('0xe')],'chatStatusTime':this[_0x2452('0x10')],'chatCapacity':this[_0x2452('0x11')],'chatCurrentCapacity':this[_0x2452('0x12')],'mailStatus':this[_0x2452('0x13')],'mailStatusTime':this[_0x2452('0x2e')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x2452('0x15')],'faxStatusTime':this[_0x2452('0x16')],'faxCapacity':this[_0x2452('0x17')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x2452('0x2f')],'smsStatusTime':this[_0x2452('0x19')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x2452('0x30')],'openchannelStatus':this[_0x2452('0x1b')],'openchannelStatusTime':this[_0x2452('0x31')],'openchannelCapacity':this[_0x2452('0x1c')],'openchannelCurrentCapacity':this[_0x2452('0x1d')],'busy':this[_0x2452('0x1e')],'busyQueue':this[_0x2452('0x32')]};var _0x115e09=md5(JSON[_0x2452('0x33')](_0x159ba1));if(this[_0x2452('0x0')]!==_0x115e09){this[_0x2452('0x0')]=_0x115e09;io[_0x2452('0x34')](_0x2452('0x35'),_0x159ba1);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 2e8cc71..cd6412b 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 _0x5ac9=['updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','available','format','chat:queue:%s','name','emit','chat_queue:save','lodash','md5','util','ioredis','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x5acaea,_0x442cb0){var _0x509dfa=function(_0x58a5d8){while(--_0x58a5d8){_0x5acaea['push'](_0x5acaea['shift']());}};_0x509dfa(++_0x442cb0);}(_0x5ac9,0xb7));var _0x95ac=function(_0x6feedc,_0x375a6c){_0x6feedc=_0x6feedc-0x0;var _0x55fb21=_0x5ac9[_0x6feedc];return _0x55fb21;};'use strict';var _=require(_0x95ac('0x0'));var md5=require(_0x95ac('0x1'));var util=require(_0x95ac('0x2'));var Redis=require(_0x95ac('0x3'));var config=require('../../../config/environment');config[_0x95ac('0x4')]=_[_0x95ac('0x5')](config[_0x95ac('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x95ac('0x6'))(new Redis(config[_0x95ac('0x4')]));function ChatQueue(_0x68f7da){this['id']=_0x68f7da['id']||0x0;this['name']=_0x68f7da['name']||'';this[_0x95ac('0x7')]=_0x68f7da['timeout']||0xa;this[_0x95ac('0x8')]=_0x68f7da[_0x95ac('0x8')]||_0x95ac('0x9');this[_0x95ac('0xa')]=_0x68f7da[_0x95ac('0xa')];this[_0x95ac('0xb')]={};this[_0x95ac('0xc')]=0x0;this[_0x95ac('0x1')]='';this[_0x95ac('0xd')]();this[_0x95ac('0xe')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x95390a=this[_0x95ac('0xb')][_0x95ac('0xf')];this[_0x95ac('0xb')]=_[_0x95ac('0x10')](this[_0x95ac('0xa')],'id');this[_0x95ac('0xb')][_0x95ac('0xf')]=_0x95390a;};ChatQueue[_0x95ac('0x11')]['updateRealtime']=function(){this[_0x95ac('0x12')]=0x0;this[_0x95ac('0x13')]=0x0;for(var _0x251c59=0x0;_0x251c59=0x0?this[_0x95ac('0x16')]:0x0;var _0x4f94df={'id':this['id'],'available':this[_0x95ac('0x16')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x95ac('0x13')],'waiting':this['waiting']};var _0x1b4b82=md5(JSON['stringify'](_0x4f94df));if(this[_0x95ac('0x1')]!==_0x1b4b82){this[_0x95ac('0x1')]=_0x1b4b82;io['to'](util[_0x95ac('0x17')](_0x95ac('0x18'),_0x4f94df[_0x95ac('0x19')]))[_0x95ac('0x1a')](_0x95ac('0x1b'),_0x4f94df);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xf0d1=['ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','Agents','waiting','updateRealtime','updateRouting','_rr','mapAgentsId','prototype','paused','length','online','loggedIn','chatPause','available','stringify','format','chat:queue:%s','exports','lodash','md5','util'];(function(_0x1eee96,_0x2e596d){var _0x2ab099=function(_0x5535ef){while(--_0x5535ef){_0x1eee96['push'](_0x1eee96['shift']());}};_0x2ab099(++_0x2e596d);}(_0xf0d1,0x10b));var _0x1f0d=function(_0x2360a3,_0xe03318){_0x2360a3=_0x2360a3-0x0;var _0x3dbeef=_0xf0d1[_0x2360a3];return _0x3dbeef;};'use strict';var _=require(_0x1f0d('0x0'));var md5=require(_0x1f0d('0x1'));var util=require(_0x1f0d('0x2'));var Redis=require(_0x1f0d('0x3'));var config=require(_0x1f0d('0x4'));config[_0x1f0d('0x5')]=_['defaults'](config['redis'],{'host':_0x1f0d('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0xdd2284){this['id']=_0xdd2284['id']||0x0;this[_0x1f0d('0x7')]=_0xdd2284[_0x1f0d('0x7')]||'';this[_0x1f0d('0x8')]=_0xdd2284[_0x1f0d('0x8')]||0xa;this[_0x1f0d('0x9')]=_0xdd2284['strategy']||'beepall';this[_0x1f0d('0xa')]=_0xdd2284[_0x1f0d('0xa')];this['mapAgentsId']={};this[_0x1f0d('0xb')]=0x0;this[_0x1f0d('0x1')]='';this['updateRouting']();this[_0x1f0d('0xc')]();}ChatQueue['prototype'][_0x1f0d('0xd')]=function(){var _0x2a24a2=this['mapAgentsId'][_0x1f0d('0xe')];this[_0x1f0d('0xf')]=_['map'](this[_0x1f0d('0xa')],'id');this[_0x1f0d('0xf')][_0x1f0d('0xe')]=_0x2a24a2;};ChatQueue[_0x1f0d('0x10')][_0x1f0d('0xc')]=function(){this['loggedIn']=0x0;this[_0x1f0d('0x11')]=0x0;for(var _0x283a00=0x0;_0x283a00=0x0?this[_0x1f0d('0x16')]:0x0;var _0x3c89db={'id':this['id'],'available':this[_0x1f0d('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x1f0d('0x7')],'paused':this[_0x1f0d('0x11')],'waiting':this[_0x1f0d('0xb')]};var _0x25cf66=md5(JSON[_0x1f0d('0x17')](_0x3c89db));if(this[_0x1f0d('0x1')]!==_0x25cf66){this[_0x1f0d('0x1')]=_0x25cf66;io['to'](util[_0x1f0d('0x18')](_0x1f0d('0x19'),_0x3c89db[_0x1f0d('0x7')]))['emit']('chat_queue:save',_0x3c89db);}};module[_0x1f0d('0x1a')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 5758042..b78f37b 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(_0x1f5b2d,_0x3186ea){var _0x290358=function(_0x50d765){while(--_0x50d765){_0x1f5b2d['push'](_0x1f5b2d['shift']());}};_0x290358(++_0x3186ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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(_0x2a1602,_0x122c28){var _0x104408=function(_0xf08a0d){while(--_0xf08a0d){_0x2a1602['push'](_0x2a1602['shift']());}};_0x104408(++_0x122c28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 de42366..bde04db 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 _0x3f1d=['exports','name','Intervals'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0x3f1d,0x64));var _0xd3f1=function(_0x4ecc48,_0x27ee61){_0x4ecc48=_0x4ecc48-0x0;var _0x3a5469=_0x3f1d[_0x4ecc48];return _0x3a5469;};'use strict';function Interval(_0x298037){this['id']=_0x298037['id']||0x0;this[_0xd3f1('0x0')]=_0x298037['name']||'';this['Intervals']=_0x298037[_0xd3f1('0x1')]||{};}module[_0xd3f1('0x2')]=Interval; \ No newline at end of file +var _0x0630=['name','Intervals','exports'];(function(_0xdaf61d,_0x784b9b){var _0x17a221=function(_0x46477d){while(--_0x46477d){_0xdaf61d['push'](_0xdaf61d['shift']());}};_0x17a221(++_0x784b9b);}(_0x0630,0x153));var _0x0063=function(_0x13ac61,_0x54e06b){_0x13ac61=_0x13ac61-0x0;var _0x2b6345=_0x0630[_0x13ac61];return _0x2b6345;};'use strict';function Interval(_0x5d476d){this['id']=_0x5d476d['id']||0x0;this['name']=_0x5d476d[_0x0063('0x0')]||'';this[_0x0063('0x1')]=_0x5d476d[_0x0063('0x1')]||{};}module[_0x0063('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 5a29bd2..605eeec 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 _0xd07e=['mapAgentsId','waiting','updateRealtime','prototype','updateRouting','map','_rr','loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents'];(function(_0x51bd5c,_0x292789){var _0x5dd8b8=function(_0x5536e1){while(--_0x5536e1){_0x51bd5c['push'](_0x51bd5c['shift']());}};_0x5dd8b8(++_0x292789);}(_0xd07e,0x8e));var _0xed07=function(_0x36f528,_0x36294c){_0x36f528=_0x36f528-0x0;var _0x54054c=_0xd07e[_0x36f528];return _0x54054c;};'use strict';var _=require(_0xed07('0x0'));var md5=require(_0xed07('0x1'));var util=require(_0xed07('0x2'));var Redis=require(_0xed07('0x3'));var config=require(_0xed07('0x4'));config['redis']=_[_0xed07('0x5')](config[_0xed07('0x6')],{'host':_0xed07('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xed07('0x6')]));function MailQueue(_0x1cee31){this['id']=_0x1cee31['id']||0x0;this['name']=_0x1cee31[_0xed07('0x8')]||'';this['timeout']=_0x1cee31[_0xed07('0x9')]||0xa;this[_0xed07('0xa')]=_0x1cee31[_0xed07('0xa')]||_0xed07('0xb');this[_0xed07('0xc')]=_0x1cee31[_0xed07('0xc')];this[_0xed07('0xd')]={};this[_0xed07('0xe')]=0x0;this['md5']='';this['updateRouting']();this[_0xed07('0xf')]();}MailQueue[_0xed07('0x10')][_0xed07('0x11')]=function(){var _0x32eb85=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0xed07('0x12')](this[_0xed07('0xc')],'id');this['mapAgentsId'][_0xed07('0x13')]=_0x32eb85;};MailQueue[_0xed07('0x10')][_0xed07('0xf')]=function(){this[_0xed07('0x14')]=0x0;this[_0xed07('0x15')]=0x0;for(var _0x2c9abc=0x0;_0x2c9abc=0x0?this[_0xed07('0x19')]:0x0;var _0x4d062d={'id':this['id'],'available':this[_0xed07('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xed07('0xe')]};var _0x4fdefd=md5(JSON[_0xed07('0x1a')](_0x4d062d));if(this['md5']!==_0x4fdefd){this[_0xed07('0x1')]=_0x4fdefd;io['to'](util[_0xed07('0x1b')](_0xed07('0x1c'),_0x4d062d[_0xed07('0x8')]))[_0xed07('0x1d')]('mail_queue:save',_0x4d062d);}};module[_0xed07('0x1e')]=MailQueue; \ No newline at end of file +var _0x281c=['updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','paused','length','mailPause','available','stringify','format','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting'];(function(_0xf6a31f,_0x59db49){var _0x46507d=function(_0x2270dc){while(--_0x2270dc){_0xf6a31f['push'](_0xf6a31f['shift']());}};_0x46507d(++_0x59db49);}(_0x281c,0x82));var _0xc281=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x281c[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xc281('0x0'));var md5=require(_0xc281('0x1'));var util=require(_0xc281('0x2'));var Redis=require(_0xc281('0x3'));var config=require(_0xc281('0x4'));config[_0xc281('0x5')]=_[_0xc281('0x6')](config[_0xc281('0x5')],{'host':_0xc281('0x7'),'port':0x18eb});var io=require(_0xc281('0x8'))(new Redis(config['redis']));function MailQueue(_0x54481f){this['id']=_0x54481f['id']||0x0;this[_0xc281('0x9')]=_0x54481f[_0xc281('0x9')]||'';this['timeout']=_0x54481f[_0xc281('0xa')]||0xa;this['strategy']=_0x54481f[_0xc281('0xb')]||_0xc281('0xc');this[_0xc281('0xd')]=_0x54481f[_0xc281('0xd')];this['mapAgentsId']={};this[_0xc281('0xe')]=0x0;this[_0xc281('0x1')]='';this[_0xc281('0xf')]();this[_0xc281('0x10')]();}MailQueue[_0xc281('0x11')][_0xc281('0xf')]=function(){var _0x599863=this[_0xc281('0x12')][_0xc281('0x13')];this['mapAgentsId']=_['map'](this[_0xc281('0xd')],'id');this['mapAgentsId']['_rr']=_0x599863;};MailQueue[_0xc281('0x11')][_0xc281('0x10')]=function(){this[_0xc281('0x14')]=0x0;this[_0xc281('0x15')]=0x0;for(var _0x4d2013=0x0;_0x4d2013=0x0?this['available']:0x0;var _0x5655f5={'id':this['id'],'available':this[_0xc281('0x18')],'loggedIn':this[_0xc281('0x14')],'name':this[_0xc281('0x9')],'paused':this[_0xc281('0x15')],'waiting':this[_0xc281('0xe')]};var _0x384878=md5(JSON[_0xc281('0x19')](_0x5655f5));if(this[_0xc281('0x1')]!==_0x384878){this[_0xc281('0x1')]=_0x384878;io['to'](util[_0xc281('0x1a')]('mail:queue:%s',_0x5655f5[_0xc281('0x9')]))['emit'](_0xc281('0x1b'),_0x5655f5);}};module[_0xc281('0x1c')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index a60c136..fa7aaa6 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 _0xdc87=['_rr','map','loggedIn','paused','openchannelPause','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','../../../config/environment','redis','socket.io-emitter','name','strategy','beepall','Agents','updateRealtime','prototype','mapAgentsId'];(function(_0x8980,_0x3e943b){var _0x3491a6=function(_0x1acbf3){while(--_0x1acbf3){_0x8980['push'](_0x8980['shift']());}};_0x3491a6(++_0x3e943b);}(_0xdc87,0xa2));var _0x7dc8=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xdc87[_0x31cb5f];return _0x586042;};'use strict';var _=require(_0x7dc8('0x0'));var md5=require(_0x7dc8('0x1'));var util=require(_0x7dc8('0x2'));var Redis=require('ioredis');var config=require(_0x7dc8('0x3'));config[_0x7dc8('0x4')]=_['defaults'](config[_0x7dc8('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x7dc8('0x5'))(new Redis(config[_0x7dc8('0x4')]));function OpenchannelQueue(_0x1bfebe){this['id']=_0x1bfebe['id']||0x0;this['name']=_0x1bfebe[_0x7dc8('0x6')]||'';this['timeout']=_0x1bfebe['timeout']||0xa;this['strategy']=_0x1bfebe[_0x7dc8('0x7')]||_0x7dc8('0x8');this[_0x7dc8('0x9')]=_0x1bfebe[_0x7dc8('0x9')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x7dc8('0x1')]='';this['updateRouting']();this[_0x7dc8('0xa')]();}OpenchannelQueue[_0x7dc8('0xb')]['updateRouting']=function(){var _0x34beda=this[_0x7dc8('0xc')][_0x7dc8('0xd')];this[_0x7dc8('0xc')]=_[_0x7dc8('0xe')](this[_0x7dc8('0x9')],'id');this[_0x7dc8('0xc')][_0x7dc8('0xd')]=_0x34beda;};OpenchannelQueue[_0x7dc8('0xb')][_0x7dc8('0xa')]=function(){this[_0x7dc8('0xf')]=0x0;this[_0x7dc8('0x10')]=0x0;for(var _0x2797f4=0x0;_0x2797f4=0x0?this[_0x7dc8('0x12')]:0x0;var _0x3c26a6={'id':this['id'],'available':this[_0x7dc8('0x12')],'loggedIn':this['loggedIn'],'name':this[_0x7dc8('0x6')],'paused':this[_0x7dc8('0x10')],'waiting':this[_0x7dc8('0x13')]};var _0x3bb425=md5(JSON[_0x7dc8('0x14')](_0x3c26a6));if(this[_0x7dc8('0x1')]!==_0x3bb425){this[_0x7dc8('0x1')]=_0x3bb425;io['to'](util[_0x7dc8('0x15')](_0x7dc8('0x16'),_0x3c26a6['name']))[_0x7dc8('0x17')](_0x7dc8('0x18'),_0x3c26a6);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0xd011=['defaults','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','Agents','length','online','openchannelPause','paused','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis'];(function(_0x19d873,_0x1b5249){var _0x26be90=function(_0x10fb7f){while(--_0x10fb7f){_0x19d873['push'](_0x19d873['shift']());}};_0x26be90(++_0x1b5249);}(_0xd011,0x16e));var _0x1d01=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd011[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1d01('0x0'));var md5=require(_0x1d01('0x1'));var util=require(_0x1d01('0x2'));var Redis=require(_0x1d01('0x3'));var config=require(_0x1d01('0x4'));config[_0x1d01('0x5')]=_[_0x1d01('0x6')](config[_0x1d01('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1d01('0x7'))(new Redis(config[_0x1d01('0x5')]));function OpenchannelQueue(_0x39220d){this['id']=_0x39220d['id']||0x0;this['name']=_0x39220d[_0x1d01('0x8')]||'';this[_0x1d01('0x9')]=_0x39220d[_0x1d01('0x9')]||0xa;this[_0x1d01('0xa')]=_0x39220d[_0x1d01('0xa')]||_0x1d01('0xb');this['Agents']=_0x39220d['Agents'];this[_0x1d01('0xc')]={};this['waiting']=0x0;this[_0x1d01('0x1')]='';this[_0x1d01('0xd')]();this[_0x1d01('0xe')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x31fa0d=this['mapAgentsId'][_0x1d01('0xf')];this[_0x1d01('0xc')]=_[_0x1d01('0x10')](this['Agents'],'id');this[_0x1d01('0xc')]['_rr']=_0x31fa0d;};OpenchannelQueue[_0x1d01('0x11')][_0x1d01('0xe')]=function(){this[_0x1d01('0x12')]=0x0;this['paused']=0x0;for(var _0x1a291d=0x0;_0x1a291d=0x0?this['available']:0x0;var _0x142dcf={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x1d01('0x8')],'paused':this[_0x1d01('0x17')],'waiting':this[_0x1d01('0x19')]};var _0x106a99=md5(JSON[_0x1d01('0x1a')](_0x142dcf));if(this[_0x1d01('0x1')]!==_0x106a99){this['md5']=_0x106a99;io['to'](util[_0x1d01('0x1b')](_0x1d01('0x1c'),_0x142dcf['name']))[_0x1d01('0x1d')](_0x1d01('0x1e'),_0x142dcf);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 4cce384..c1557a9 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 _0xe706=['prototype','_rr','map','online','loggedIn','smsPause','available','paused','stringify','format','sms:queue:%s','emit','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x3e73f6,_0x4f7f01){var _0x5af991=function(_0x186e5a){while(--_0x186e5a){_0x3e73f6['push'](_0x3e73f6['shift']());}};_0x5af991(++_0x4f7f01);}(_0xe706,0xa3));var _0x6e70=function(_0x5dee2a,_0x47d02a){_0x5dee2a=_0x5dee2a-0x0;var _0x31e98e=_0xe706[_0x5dee2a];return _0x31e98e;};'use strict';var _=require(_0x6e70('0x0'));var md5=require(_0x6e70('0x1'));var util=require(_0x6e70('0x2'));var Redis=require('ioredis');var config=require(_0x6e70('0x3'));config[_0x6e70('0x4')]=_[_0x6e70('0x5')](config[_0x6e70('0x4')],{'host':_0x6e70('0x6'),'port':0x18eb});var io=require(_0x6e70('0x7'))(new Redis(config[_0x6e70('0x4')]));function SmsQueue(_0x506db9){this['id']=_0x506db9['id']||0x0;this[_0x6e70('0x8')]=_0x506db9[_0x6e70('0x8')]||'';this[_0x6e70('0x9')]=_0x506db9[_0x6e70('0x9')]||0xa;this[_0x6e70('0xa')]=_0x506db9[_0x6e70('0xa')]||_0x6e70('0xb');this[_0x6e70('0xc')]=_0x506db9[_0x6e70('0xc')];this[_0x6e70('0xd')]={};this[_0x6e70('0xe')]=0x0;this[_0x6e70('0x1')]='';this[_0x6e70('0xf')]();this[_0x6e70('0x10')]();}SmsQueue[_0x6e70('0x11')][_0x6e70('0xf')]=function(){var _0x5b3d07=this['mapAgentsId'][_0x6e70('0x12')];this[_0x6e70('0xd')]=_[_0x6e70('0x13')](this[_0x6e70('0xc')],'id');this[_0x6e70('0xd')][_0x6e70('0x12')]=_0x5b3d07;};SmsQueue[_0x6e70('0x11')][_0x6e70('0x10')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x48bc72=0x0;_0x48bc72=0x0?this['available']:0x0;var _0x28a21f={'id':this['id'],'available':this[_0x6e70('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x6e70('0x18')],'waiting':this[_0x6e70('0xe')]};var _0x2368eb=md5(JSON[_0x6e70('0x19')](_0x28a21f));if(this[_0x6e70('0x1')]!==_0x2368eb){this[_0x6e70('0x1')]=_0x2368eb;io['to'](util[_0x6e70('0x1a')](_0x6e70('0x1b'),_0x28a21f[_0x6e70('0x8')]))[_0x6e70('0x1c')]('sms_queue:save',_0x28a21f);}};module[_0x6e70('0x1d')]=SmsQueue; \ No newline at end of file +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(_0xfd9b19,_0x21d75f){var _0x514918=function(_0x52e212){while(--_0x52e212){_0xfd9b19['push'](_0xfd9b19['shift']());}};_0x514918(++_0x21d75f);}(_0x757a,0xde));var _0xa757=function(_0xc9b20c,_0x545810){_0xc9b20c=_0xc9b20c-0x0;var _0x557a17=_0x757a[_0xc9b20c];return _0x557a17;};'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 diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 98d2377..bd0d468 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 _0x608b=['openchannelQueues','chatQueues','smsQueues','mailQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','prototype','mergeFromDatabase','hasOwnProperty','length','isUndefined','initIntervals','initOpenchannelQueues','updateRouting','updateRealtime','initChatQueues','initSmsQueues','initMailQueues','initFaxQueues','faxQueues','exports','bluebird','util','lodash','moment','../model/interval','../model/chatQueue','../model/mailQueue','../model/faxQueue','agents','intervals'];(function(_0x3fa04b,_0x35a423){var _0x8ad99b=function(_0x3ed0dc){while(--_0x3ed0dc){_0x3fa04b['push'](_0x3fa04b['shift']());}};_0x8ad99b(++_0x35a423);}(_0x608b,0x1b0));var _0xb608=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x608b[_0x9df060];return _0x338dfe;};'use strict';var BPromise=require(_0xb608('0x0'));var util=require(_0xb608('0x1'));var _=require(_0xb608('0x2'));var moment=require(_0xb608('0x3'));var Agent=require('../model/agent');var Interval=require(_0xb608('0x4'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0xb608('0x5'));var SmsQueue=require('../model/smsQueue');var MailQueue=require(_0xb608('0x6'));var FaxQueue=require(_0xb608('0x7'));var Realtime=function(){this[_0xb608('0x8')]={};this[_0xb608('0x9')]={};this[_0xb608('0xa')]={};this[_0xb608('0xb')]={};this[_0xb608('0xc')]={};this[_0xb608('0xd')]={};this['faxQueues']={};this[_0xb608('0xe')]={};this[_0xb608('0xf')]={};this[_0xb608('0x10')]={};this[_0xb608('0x11')]={};this['faxQueuesWaitingInteractions']={};};function freeIsNotKey(_0x122d14,_0x700695,_0x2cb20e){var _0x39542a=_[_0xb608('0x12')](_0x122d14,function(_0x3455f7,_0x25545f){return _0x3455f7[_0x2cb20e];});for(var _0x1ea581 in _0x700695){if(_0x700695['hasOwnProperty'](_0x1ea581)){if(!_0x39542a[_0x1ea581]){delete _0x700695[_0x1ea581];}}}}Realtime[_0xb608('0x13')][_0xb608('0x14')]=function(_0x386657,_0x4e8032){for(var _0x577e15 in _0x4e8032){if(_0x386657[_0xb608('0x15')](_0x577e15)){_0x386657[_0x577e15]=_0x4e8032[_0x577e15];}}};Realtime[_0xb608('0x13')]['initAgents']=function(){var _0x46fad7=this;return function(_0x3dbd24){if(_0x3dbd24){freeIsNotKey(_0x3dbd24,_0x46fad7[_0xb608('0x8')],'id');for(var _0x38bc69=0x0,_0x584278={},_0x1862a1={};_0x38bc69<_0x3dbd24[_0xb608('0x16')];_0x38bc69+=0x1){_0x584278=_0x3dbd24[_0x38bc69];if(_[_0xb608('0x17')](_0x46fad7[_0xb608('0x8')][_0x584278['id']])){_0x46fad7[_0xb608('0x8')][_0x584278['id']]=new Agent(_0x584278);}else{_0x46fad7[_0xb608('0x14')](_0x46fad7['agents'][_0x584278['id']],_0x584278);}}}return _0x46fad7[_0xb608('0x8')];};};Realtime['prototype'][_0xb608('0x18')]=function(){var _0x4ba5c2=this;return function(_0xf9e5d){if(_0xf9e5d){freeIsNotKey(_0xf9e5d,_0x4ba5c2[_0xb608('0x9')],'id');for(var _0x5534bc=0x0,_0x324046={},_0x36a1a0={};_0x5534bc<_0xf9e5d[_0xb608('0x16')];_0x5534bc+=0x1){_0x324046=_0xf9e5d[_0x5534bc];if(_[_0xb608('0x17')](_0x4ba5c2['intervals'][_0x324046['id']])){_0x4ba5c2[_0xb608('0x9')][_0x324046['id']]=new Interval(_0x324046);}else{_0x4ba5c2['mergeFromDatabase'](_0x4ba5c2['intervals'][_0x324046['id']],_0x324046);}}}return _0x4ba5c2[_0xb608('0x9')];};};Realtime['prototype'][_0xb608('0x19')]=function(){var _0x321cdf=this;return function(_0x337237){if(_0x337237){freeIsNotKey(_0x337237,_0x321cdf[_0xb608('0xa')],'id');for(var _0x4fa5cd=0x0,_0x33befb={},_0x6af040={};_0x4fa5cd<_0x337237[_0xb608('0x16')];_0x4fa5cd+=0x1){_0x33befb=_0x337237[_0x4fa5cd];if(_[_0xb608('0x17')](_0x321cdf['openchannelQueues'][_0x33befb['id']])){_0x321cdf[_0xb608('0xa')][_0x33befb['id']]=new OpenchannelQueue(_0x33befb);}else{_0x321cdf['mergeFromDatabase'](_0x321cdf[_0xb608('0xa')][_0x33befb['id']],_0x33befb);}_0x321cdf[_0xb608('0xa')][_0x33befb['id']][_0xb608('0x1a')]();_0x321cdf[_0xb608('0xa')][_0x33befb['id']][_0xb608('0x1b')]();}}return _0x321cdf['openchannelQueues'];};};Realtime[_0xb608('0x13')][_0xb608('0x1c')]=function(){var _0x290755=this;return function(_0x1e5813){if(_0x1e5813){freeIsNotKey(_0x1e5813,_0x290755[_0xb608('0xb')],'id');for(var _0x32d818=0x0,_0x3b0ece={},_0x587cf1={};_0x32d818<_0x1e5813[_0xb608('0x16')];_0x32d818+=0x1){_0x3b0ece=_0x1e5813[_0x32d818];if(_[_0xb608('0x17')](_0x290755[_0xb608('0xb')][_0x3b0ece['id']])){_0x290755[_0xb608('0xb')][_0x3b0ece['id']]=new ChatQueue(_0x3b0ece);}else{_0x290755['mergeFromDatabase'](_0x290755['chatQueues'][_0x3b0ece['id']],_0x3b0ece);}_0x290755['chatQueues'][_0x3b0ece['id']][_0xb608('0x1a')]();_0x290755['chatQueues'][_0x3b0ece['id']]['updateRealtime']();}}return _0x290755[_0xb608('0xb')];};};Realtime[_0xb608('0x13')][_0xb608('0x1d')]=function(){var _0x4d008f=this;return function(_0x21dd71){if(_0x21dd71){freeIsNotKey(_0x21dd71,_0x4d008f[_0xb608('0xc')],'id');for(var _0x5b28d7=0x0,_0x9a3c34={},_0x240ed6={};_0x5b28d7<_0x21dd71[_0xb608('0x16')];_0x5b28d7+=0x1){_0x9a3c34=_0x21dd71[_0x5b28d7];if(_['isUndefined'](_0x4d008f[_0xb608('0xc')][_0x9a3c34['id']])){_0x4d008f[_0xb608('0xc')][_0x9a3c34['id']]=new SmsQueue(_0x9a3c34);}else{_0x4d008f[_0xb608('0x14')](_0x4d008f['smsQueues'][_0x9a3c34['id']],_0x9a3c34);}_0x4d008f[_0xb608('0xc')][_0x9a3c34['id']][_0xb608('0x1a')]();_0x4d008f[_0xb608('0xc')][_0x9a3c34['id']]['updateRealtime']();}}return _0x4d008f[_0xb608('0xc')];};};Realtime[_0xb608('0x13')][_0xb608('0x1e')]=function(){var _0x52a7b6=this;return function(_0x15a062){if(_0x15a062){freeIsNotKey(_0x15a062,_0x52a7b6[_0xb608('0xd')],'id');for(var _0xa791ce=0x0,_0x50a5b9={},_0x1fcb2b={};_0xa791ce<_0x15a062[_0xb608('0x16')];_0xa791ce+=0x1){_0x50a5b9=_0x15a062[_0xa791ce];if(_[_0xb608('0x17')](_0x52a7b6[_0xb608('0xd')][_0x50a5b9['id']])){_0x52a7b6['mailQueues'][_0x50a5b9['id']]=new MailQueue(_0x50a5b9);}else{_0x52a7b6['mergeFromDatabase'](_0x52a7b6[_0xb608('0xd')][_0x50a5b9['id']],_0x50a5b9);}_0x52a7b6['mailQueues'][_0x50a5b9['id']][_0xb608('0x1a')]();_0x52a7b6[_0xb608('0xd')][_0x50a5b9['id']][_0xb608('0x1b')]();}}return _0x52a7b6[_0xb608('0xd')];};};Realtime[_0xb608('0x13')][_0xb608('0x1f')]=function(){var _0x47c796=this;return function(_0x44e21e){if(_0x44e21e){freeIsNotKey(_0x44e21e,_0x47c796[_0xb608('0x20')],'id');for(var _0x3daa89=0x0,_0x72bcbd={},_0x45b851={};_0x3daa89<_0x44e21e['length'];_0x3daa89+=0x1){_0x72bcbd=_0x44e21e[_0x3daa89];if(_[_0xb608('0x17')](_0x47c796[_0xb608('0x20')][_0x72bcbd['id']])){_0x47c796[_0xb608('0x20')][_0x72bcbd['id']]=new FaxQueue(_0x72bcbd);}else{_0x47c796['mergeFromDatabase'](_0x47c796['faxQueues'][_0x72bcbd['id']],_0x72bcbd);}_0x47c796[_0xb608('0x20')][_0x72bcbd['id']][_0xb608('0x1a')]();_0x47c796[_0xb608('0x20')][_0x72bcbd['id']][_0xb608('0x1b')]();}}return _0x47c796['faxQueues'];};};module[_0xb608('0x21')]=Realtime; \ No newline at end of file +var _0x7259=['length','initOpenchannelQueues','updateRealtime','updateRouting','initMailQueues','mailQueues','initFaxQueues','exports','util','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','intervals','openchannelQueues','chatQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','isUndefined'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x7259,0x1ba));var _0x9725=function(_0x2757f5,_0x428b01){_0x2757f5=_0x2757f5-0x0;var _0x11d2fa=_0x7259[_0x2757f5];return _0x11d2fa;};'use strict';var BPromise=require('bluebird');var util=require(_0x9725('0x0'));var _=require(_0x9725('0x1'));var moment=require(_0x9725('0x2'));var Agent=require(_0x9725('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0x9725('0x4'));var ChatQueue=require(_0x9725('0x5'));var SmsQueue=require(_0x9725('0x6'));var MailQueue=require(_0x9725('0x7'));var FaxQueue=require(_0x9725('0x8'));var Realtime=function(){this[_0x9725('0x9')]={};this[_0x9725('0xa')]={};this[_0x9725('0xb')]={};this[_0x9725('0xc')]={};this[_0x9725('0xd')]={};this['mailQueues']={};this[_0x9725('0xe')]={};this[_0x9725('0xf')]={};this[_0x9725('0x10')]={};this['openchannelQueuesWaitingInteractions']={};this['smsQueuesWaitingInteractions']={};this['faxQueuesWaitingInteractions']={};};function freeIsNotKey(_0x181abe,_0x131559,_0x413e49){var _0x14ff05=_[_0x9725('0x11')](_0x181abe,function(_0x3bf09c,_0x1a905f){return _0x3bf09c[_0x413e49];});for(var _0x4c382e in _0x131559){if(_0x131559[_0x9725('0x12')](_0x4c382e)){if(!_0x14ff05[_0x4c382e]){delete _0x131559[_0x4c382e];}}}}Realtime[_0x9725('0x13')][_0x9725('0x14')]=function(_0x1bc062,_0x270f8f){for(var _0x4dcd96 in _0x270f8f){if(_0x1bc062['hasOwnProperty'](_0x4dcd96)){_0x1bc062[_0x4dcd96]=_0x270f8f[_0x4dcd96];}}};Realtime[_0x9725('0x13')][_0x9725('0x15')]=function(){var _0x3a13c5=this;return function(_0x46a345){if(_0x46a345){freeIsNotKey(_0x46a345,_0x3a13c5[_0x9725('0x9')],'id');for(var _0x3da4a7=0x0,_0x41122b={},_0x589183={};_0x3da4a7<_0x46a345['length'];_0x3da4a7+=0x1){_0x41122b=_0x46a345[_0x3da4a7];if(_[_0x9725('0x16')](_0x3a13c5[_0x9725('0x9')][_0x41122b['id']])){_0x3a13c5['agents'][_0x41122b['id']]=new Agent(_0x41122b);}else{_0x3a13c5[_0x9725('0x14')](_0x3a13c5['agents'][_0x41122b['id']],_0x41122b);}}}return _0x3a13c5[_0x9725('0x9')];};};Realtime['prototype']['initIntervals']=function(){var _0x686837=this;return function(_0x10b2d7){if(_0x10b2d7){freeIsNotKey(_0x10b2d7,_0x686837[_0x9725('0xa')],'id');for(var _0x263586=0x0,_0x366091={},_0x5f0516={};_0x263586<_0x10b2d7[_0x9725('0x17')];_0x263586+=0x1){_0x366091=_0x10b2d7[_0x263586];if(_['isUndefined'](_0x686837[_0x9725('0xa')][_0x366091['id']])){_0x686837['intervals'][_0x366091['id']]=new Interval(_0x366091);}else{_0x686837[_0x9725('0x14')](_0x686837[_0x9725('0xa')][_0x366091['id']],_0x366091);}}}return _0x686837[_0x9725('0xa')];};};Realtime[_0x9725('0x13')][_0x9725('0x18')]=function(){var _0x3e8b7d=this;return function(_0x4f4ba9){if(_0x4f4ba9){freeIsNotKey(_0x4f4ba9,_0x3e8b7d[_0x9725('0xb')],'id');for(var _0x25b431=0x0,_0x30ce2c={},_0x3555b3={};_0x25b431<_0x4f4ba9[_0x9725('0x17')];_0x25b431+=0x1){_0x30ce2c=_0x4f4ba9[_0x25b431];if(_['isUndefined'](_0x3e8b7d[_0x9725('0xb')][_0x30ce2c['id']])){_0x3e8b7d[_0x9725('0xb')][_0x30ce2c['id']]=new OpenchannelQueue(_0x30ce2c);}else{_0x3e8b7d[_0x9725('0x14')](_0x3e8b7d[_0x9725('0xb')][_0x30ce2c['id']],_0x30ce2c);}_0x3e8b7d[_0x9725('0xb')][_0x30ce2c['id']]['updateRouting']();_0x3e8b7d[_0x9725('0xb')][_0x30ce2c['id']][_0x9725('0x19')]();}}return _0x3e8b7d['openchannelQueues'];};};Realtime[_0x9725('0x13')]['initChatQueues']=function(){var _0x373507=this;return function(_0x2d963f){if(_0x2d963f){freeIsNotKey(_0x2d963f,_0x373507[_0x9725('0xc')],'id');for(var _0xf7399=0x0,_0x543574={},_0x1545bc={};_0xf7399<_0x2d963f[_0x9725('0x17')];_0xf7399+=0x1){_0x543574=_0x2d963f[_0xf7399];if(_['isUndefined'](_0x373507[_0x9725('0xc')][_0x543574['id']])){_0x373507[_0x9725('0xc')][_0x543574['id']]=new ChatQueue(_0x543574);}else{_0x373507['mergeFromDatabase'](_0x373507['chatQueues'][_0x543574['id']],_0x543574);}_0x373507[_0x9725('0xc')][_0x543574['id']][_0x9725('0x1a')]();_0x373507[_0x9725('0xc')][_0x543574['id']][_0x9725('0x19')]();}}return _0x373507['chatQueues'];};};Realtime[_0x9725('0x13')]['initSmsQueues']=function(){var _0x11c4da=this;return function(_0x26d9f5){if(_0x26d9f5){freeIsNotKey(_0x26d9f5,_0x11c4da[_0x9725('0xd')],'id');for(var _0x58feda=0x0,_0x40be27={},_0x5076b5={};_0x58feda<_0x26d9f5[_0x9725('0x17')];_0x58feda+=0x1){_0x40be27=_0x26d9f5[_0x58feda];if(_[_0x9725('0x16')](_0x11c4da['smsQueues'][_0x40be27['id']])){_0x11c4da[_0x9725('0xd')][_0x40be27['id']]=new SmsQueue(_0x40be27);}else{_0x11c4da[_0x9725('0x14')](_0x11c4da['smsQueues'][_0x40be27['id']],_0x40be27);}_0x11c4da[_0x9725('0xd')][_0x40be27['id']][_0x9725('0x1a')]();_0x11c4da['smsQueues'][_0x40be27['id']][_0x9725('0x19')]();}}return _0x11c4da[_0x9725('0xd')];};};Realtime['prototype'][_0x9725('0x1b')]=function(){var _0x1663e3=this;return function(_0x28a298){if(_0x28a298){freeIsNotKey(_0x28a298,_0x1663e3[_0x9725('0x1c')],'id');for(var _0x7211e=0x0,_0x428c26={},_0x26e8dd={};_0x7211e<_0x28a298[_0x9725('0x17')];_0x7211e+=0x1){_0x428c26=_0x28a298[_0x7211e];if(_['isUndefined'](_0x1663e3[_0x9725('0x1c')][_0x428c26['id']])){_0x1663e3[_0x9725('0x1c')][_0x428c26['id']]=new MailQueue(_0x428c26);}else{_0x1663e3[_0x9725('0x14')](_0x1663e3['mailQueues'][_0x428c26['id']],_0x428c26);}_0x1663e3['mailQueues'][_0x428c26['id']][_0x9725('0x1a')]();_0x1663e3[_0x9725('0x1c')][_0x428c26['id']][_0x9725('0x19')]();}}return _0x1663e3['mailQueues'];};};Realtime[_0x9725('0x13')][_0x9725('0x1d')]=function(){var _0x5f03c5=this;return function(_0x252d9d){if(_0x252d9d){freeIsNotKey(_0x252d9d,_0x5f03c5[_0x9725('0xe')],'id');for(var _0x2a143b=0x0,_0x4a5fd8={},_0xabbe9a={};_0x2a143b<_0x252d9d[_0x9725('0x17')];_0x2a143b+=0x1){_0x4a5fd8=_0x252d9d[_0x2a143b];if(_[_0x9725('0x16')](_0x5f03c5[_0x9725('0xe')][_0x4a5fd8['id']])){_0x5f03c5[_0x9725('0xe')][_0x4a5fd8['id']]=new FaxQueue(_0x4a5fd8);}else{_0x5f03c5['mergeFromDatabase'](_0x5f03c5['faxQueues'][_0x4a5fd8['id']],_0x4a5fd8);}_0x5f03c5[_0x9725('0xe')][_0x4a5fd8['id']]['updateRouting']();_0x5f03c5[_0x9725('0xe')][_0x4a5fd8['id']][_0x9725('0x19')]();}}return _0x5f03c5[_0x9725('0xe')];};};module[_0x9725('0x1e')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 6fea684..712efaf 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 _0x1e38=['Request','UpdateChatInteraction','updateChatInteraction','addTags','addTagsToChatInteraction','../client','update'];(function(_0x38f737,_0x54f685){var _0x7afda3=function(_0x1ac1d7){while(--_0x1ac1d7){_0x38f737['push'](_0x38f737['shift']());}};_0x7afda3(++_0x54f685);}(_0x1e38,0x91));var _0x81e3=function(_0x48b5e0,_0xb3826){_0x48b5e0=_0x48b5e0-0x0;var _0x4287ea=_0x1e38[_0x48b5e0];return _0x4287ea;};'use strict';var client=require(_0x81e3('0x0'));exports[_0x81e3('0x1')]=function(_0x487f7a,_0x32a9a6){return client[_0x81e3('0x2')](_0x81e3('0x3'),{'body':_0x32a9a6,'options':{'where':{'id':_0x487f7a}},'log':_0x81e3('0x4')});};exports[_0x81e3('0x5')]=function(_0x3c0165,_0x41fb71){return client[_0x81e3('0x2')]('AddTagsToChatInteraction',{'body':_0x41fb71,'options':{'where':{'id':_0x3c0165}},'log':_0x81e3('0x6')});}; \ No newline at end of file +var _0xb153=['addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb153,0x91));var _0x3b15=function(_0x1547c9,_0x10c55b){_0x1547c9=_0x1547c9-0x0;var _0x2b1e49=_0xb153[_0x1547c9];return _0x2b1e49;};'use strict';var client=require(_0x3b15('0x0'));exports[_0x3b15('0x1')]=function(_0x3fc36c,_0x140292){return client[_0x3b15('0x2')](_0x3b15('0x3'),{'body':_0x140292,'options':{'where':{'id':_0x3fc36c}},'log':_0x3b15('0x4')});};exports[_0x3b15('0x5')]=function(_0x41f753,_0x218fba){return client['Request'](_0x3b15('0x6'),{'body':_0x218fba,'options':{'where':{'id':_0x41f753}},'log':_0x3b15('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 4716e3c..d7fefdd 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 _0xac2a=['../client','create','Request'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xac2a,0x1c5));var _0xaac2=function(_0x8957d7,_0x236b11){_0x8957d7=_0x8957d7-0x0;var _0x3c256a=_0xac2a[_0x8957d7];return _0x3c256a;};'use strict';var client=require(_0xaac2('0x0'));exports[_0xaac2('0x1')]=function(_0x495c42){return client[_0xaac2('0x2')]('CreateChatMessage',{'body':_0x495c42,'log':'createChatMessage'});}; \ No newline at end of file +var _0xfc2a=['Request','createChatMessage','../client'];(function(_0x3c336e,_0x5e4713){var _0xec5ad=function(_0x1fd793){while(--_0x1fd793){_0x3c336e['push'](_0x3c336e['shift']());}};_0xec5ad(++_0x5e4713);}(_0xfc2a,0xef));var _0xafc2=function(_0x1e2c34,_0xa3d34d){_0x1e2c34=_0x1e2c34-0x0;var _0x438ebf=_0xfc2a[_0x1e2c34];return _0x438ebf;};'use strict';var client=require(_0xafc2('0x0'));exports['create']=function(_0x4d565c){return client[_0xafc2('0x1')]('CreateChatMessage',{'body':_0x4d565c,'log':_0xafc2('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index e4d38f1..bfe0063 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 _0xcdc4=['strategy','User','Agents','online','chatPause','../client','getChatQueues','Request','name','timeout'];(function(_0x369534,_0x5557c4){var _0x524bf9=function(_0x24c6fb){while(--_0x24c6fb){_0x369534['push'](_0x369534['shift']());}};_0x524bf9(++_0x5557c4);}(_0xcdc4,0x109));var _0x4cdc=function(_0x27736d,_0x19cb1b){_0x27736d=_0x27736d-0x0;var _0xa32ede=_0xcdc4[_0x27736d];return _0xa32ede;};'use strict';var client=require(_0x4cdc('0x0'));exports[_0x4cdc('0x1')]=function(){return function(){return client[_0x4cdc('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x4cdc('0x3'),_0x4cdc('0x4'),_0x4cdc('0x5')],'include':[{'model':_0x4cdc('0x6'),'as':_0x4cdc('0x7'),'attributes':['id',_0x4cdc('0x3'),_0x4cdc('0x8'),_0x4cdc('0x9')]}]},'log':_0x4cdc('0x1')});};}; \ No newline at end of file +var _0x6aa5=['Agents','name','getChatQueues','../client','GetChatQueue','timeout','User'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6aa5,0x184));var _0x56aa=function(_0x3285f6,_0x4f66aa){_0x3285f6=_0x3285f6-0x0;var _0x4b0abf=_0x6aa5[_0x3285f6];return _0x4b0abf;};'use strict';var client=require(_0x56aa('0x0'));exports['getChatQueues']=function(){return function(){return client['Request'](_0x56aa('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x56aa('0x2'),'strategy'],'include':[{'model':_0x56aa('0x3'),'as':_0x56aa('0x4'),'attributes':['id',_0x56aa('0x5'),'online','chatPause']}]},'log':_0x56aa('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index da9a30f..1991ca2 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 _0x668b=['update','UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport'];(function(_0x4bc7a8,_0x501829){var _0x2bb25c=function(_0x3c6cd1){while(--_0x3c6cd1){_0x4bc7a8['push'](_0x4bc7a8['shift']());}};_0x2bb25c(++_0x501829);}(_0x668b,0x140));var _0xb668=function(_0x4d0662,_0x145963){_0x4d0662=_0x4d0662-0x0;var _0x6eea6d=_0x668b[_0x4d0662];return _0x6eea6d;};'use strict';var client=require(_0xb668('0x0'));exports[_0xb668('0x1')]=function(_0x51555f){return client[_0xb668('0x2')](_0xb668('0x3'),{'body':_0x51555f,'log':'CreateChatQueueReport'});};exports[_0xb668('0x4')]=function(_0x5e2e83,_0x2fab11){return client[_0xb668('0x2')](_0xb668('0x5'),{'body':_0x2fab11,'options':{'where':{'uniqueid':_0x5e2e83},'order':[['id','DESC']],'limit':0x1},'log':_0xb668('0x5')});}; \ No newline at end of file +var _0x98d5=['UpdateChatQueueReport','../client','Request','CreateChatQueueReport','update'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x98d5,0xfb));var _0x598d=function(_0x469ca5,_0x12d434){_0x469ca5=_0x469ca5-0x0;var _0x22de48=_0x98d5[_0x469ca5];return _0x22de48;};'use strict';var client=require(_0x598d('0x0'));exports['create']=function(_0x491dcb){return client[_0x598d('0x1')](_0x598d('0x2'),{'body':_0x491dcb,'log':_0x598d('0x2')});};exports[_0x598d('0x3')]=function(_0x418321,_0x3890f3){return client[_0x598d('0x1')](_0x598d('0x4'),{'body':_0x3890f3,'options':{'where':{'uniqueid':_0x418321},'order':[['id','DESC']],'limit':0x1},'log':_0x598d('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 23cba4c..4a719d4 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 _0x6803=['Request','UpdateFaxInteraction','updateFaxInteraction','addTags','AddTagsToFaxInteraction','addTagsToFaxInteraction'];(function(_0x52446d,_0x325b00){var _0x2001b1=function(_0x5401b5){while(--_0x5401b5){_0x52446d['push'](_0x52446d['shift']());}};_0x2001b1(++_0x325b00);}(_0x6803,0xb4));var _0x3680=function(_0x5d52f3,_0x3f6922){_0x5d52f3=_0x5d52f3-0x0;var _0x2ae110=_0x6803[_0x5d52f3];return _0x2ae110;};'use strict';var client=require('../client');exports['update']=function(_0x4d79ef,_0xc0b66b){return client[_0x3680('0x0')](_0x3680('0x1'),{'body':_0xc0b66b,'options':{'where':{'id':_0x4d79ef}},'log':_0x3680('0x2')});};exports[_0x3680('0x3')]=function(_0x49f96c,_0x151d20){return client[_0x3680('0x0')](_0x3680('0x4'),{'body':_0x151d20,'options':{'where':{'id':_0x49f96c}},'log':_0x3680('0x5')});}; \ No newline at end of file +var _0x9590=['UpdateFaxInteraction','updateFaxInteraction','addTags','Request','AddTagsToFaxInteraction','../client','update'];(function(_0x221c0e,_0x1cf4e5){var _0x1ffc3a=function(_0x5acf10){while(--_0x5acf10){_0x221c0e['push'](_0x221c0e['shift']());}};_0x1ffc3a(++_0x1cf4e5);}(_0x9590,0x1be));var _0x0959=function(_0x4b20c3,_0x594e54){_0x4b20c3=_0x4b20c3-0x0;var _0x5dcb26=_0x9590[_0x4b20c3];return _0x5dcb26;};'use strict';var client=require(_0x0959('0x0'));exports[_0x0959('0x1')]=function(_0x335431,_0x22c5fd){return client['Request'](_0x0959('0x2'),{'body':_0x22c5fd,'options':{'where':{'id':_0x335431}},'log':_0x0959('0x3')});};exports[_0x0959('0x4')]=function(_0x420dd8,_0x20daa5){return client[_0x0959('0x5')](_0x0959('0x6'),{'body':_0x20daa5,'options':{'where':{'id':_0x420dd8}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 31fb942..521b59c 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 _0xe5d0=['../client','create','CreateFaxMessage','createFaxMessage'];(function(_0x52d103,_0x36ce10){var _0x2a5c13=function(_0x24f6ee){while(--_0x24f6ee){_0x52d103['push'](_0x52d103['shift']());}};_0x2a5c13(++_0x36ce10);}(_0xe5d0,0x78));var _0x0e5d=function(_0x37b0b7,_0x2ace1e){_0x37b0b7=_0x37b0b7-0x0;var _0x3870b0=_0xe5d0[_0x37b0b7];return _0x3870b0;};'use strict';var client=require(_0x0e5d('0x0'));exports[_0x0e5d('0x1')]=function(_0x5eb574){return client['Request'](_0x0e5d('0x2'),{'body':_0x5eb574,'log':_0x0e5d('0x3')});}; \ No newline at end of file +var _0x4290=['Request','CreateFaxMessage','create'];(function(_0x11a55c,_0x4eced9){var _0x26c390=function(_0x5b0662){while(--_0x5b0662){_0x11a55c['push'](_0x11a55c['shift']());}};_0x26c390(++_0x4eced9);}(_0x4290,0x122));var _0x0429=function(_0x21ca75,_0xfc8555){_0x21ca75=_0x21ca75-0x0;var _0x36d028=_0x4290[_0x21ca75];return _0x36d028;};'use strict';var client=require('../client');exports[_0x0429('0x0')]=function(_0x439c5c){return client[_0x0429('0x1')](_0x0429('0x2'),{'body':_0x439c5c,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 3c91d6f..565840f 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 _0x0ce1=['name','online','faxPause','getFaxQueues','Request','timeout','strategy','User','Agents'];(function(_0xb3205f,_0x13694e){var _0x3eac2d=function(_0x55cf08){while(--_0x55cf08){_0xb3205f['push'](_0xb3205f['shift']());}};_0x3eac2d(++_0x13694e);}(_0x0ce1,0x81));var _0x10ce=function(_0x50faaa,_0x2f840a){_0x50faaa=_0x50faaa-0x0;var _0x1edd36=_0x0ce1[_0x50faaa];return _0x1edd36;};'use strict';var client=require('../client');exports[_0x10ce('0x0')]=function(){return function(){return client[_0x10ce('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0x10ce('0x2'),_0x10ce('0x3')],'include':[{'model':_0x10ce('0x4'),'as':_0x10ce('0x5'),'attributes':['id',_0x10ce('0x6'),_0x10ce('0x7'),_0x10ce('0x8')]}]},'log':_0x10ce('0x0')});};}; \ No newline at end of file +var _0xcf89=['name','timeout','strategy','User','Agents','getFaxQueues','GetFaxQueue'];(function(_0x5c532e,_0x41ead7){var _0x303835=function(_0x419030){while(--_0x419030){_0x5c532e['push'](_0x5c532e['shift']());}};_0x303835(++_0x41ead7);}(_0xcf89,0x1d3));var _0x9cf8=function(_0x283ad3,_0x2505fc){_0x283ad3=_0x283ad3-0x0;var _0x2c7764=_0xcf89[_0x283ad3];return _0x2c7764;};'use strict';var client=require('../client');exports[_0x9cf8('0x0')]=function(){return function(){return client['Request'](_0x9cf8('0x1'),{'options':{'raw':![],'attributes':['id',_0x9cf8('0x2'),_0x9cf8('0x3'),_0x9cf8('0x4')],'include':[{'model':_0x9cf8('0x5'),'as':_0x9cf8('0x6'),'attributes':['id',_0x9cf8('0x2'),'online','faxPause']}]},'log':_0x9cf8('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index d978643..ce4823b 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 _0x56eb=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC'];(function(_0x36bb77,_0x13f369){var _0x11acd1=function(_0x2ea23b){while(--_0x2ea23b){_0x36bb77['push'](_0x36bb77['shift']());}};_0x11acd1(++_0x13f369);}(_0x56eb,0x16e));var _0xb56e=function(_0x21cf41,_0x576de9){_0x21cf41=_0x21cf41-0x0;var _0x38b9da=_0x56eb[_0x21cf41];return _0x38b9da;};'use strict';var client=require('../client');exports[_0xb56e('0x0')]=function(_0x2e7c83){return client[_0xb56e('0x1')]('CreateFaxQueueReport',{'body':_0x2e7c83,'log':_0xb56e('0x2')});};exports[_0xb56e('0x3')]=function(_0x5145cb,_0x241adf){return client[_0xb56e('0x1')](_0xb56e('0x4'),{'body':_0x241adf,'options':{'where':{'uniqueid':_0x5145cb},'order':[['id',_0xb56e('0x5')]],'limit':0x1},'log':_0xb56e('0x4')});}; \ No newline at end of file +var _0x602c=['UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x602c,0x11a));var _0xc602=function(_0x4348cf,_0x3c5e31){_0x4348cf=_0x4348cf-0x0;var _0xa33ff3=_0x602c[_0x4348cf];return _0xa33ff3;};'use strict';var client=require(_0xc602('0x0'));exports[_0xc602('0x1')]=function(_0x273811){return client[_0xc602('0x2')](_0xc602('0x3'),{'body':_0x273811,'log':_0xc602('0x3')});};exports[_0xc602('0x4')]=function(_0x47aa72,_0x47a07a){return client[_0xc602('0x2')](_0xc602('0x5'),{'body':_0x47a07a,'options':{'where':{'uniqueid':_0x47aa72},'order':[['id',_0xc602('0x6')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index e7ef8e8..d388651 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 _0x1b0e=['Request','GetInterval','name','Interval','interval','../client','getIntervals'];(function(_0x1dd9d5,_0x3a31b8){var _0x161c5d=function(_0x74fc96){while(--_0x74fc96){_0x1dd9d5['push'](_0x1dd9d5['shift']());}};_0x161c5d(++_0x3a31b8);}(_0x1b0e,0x132));var _0xe1b0=function(_0x5ef504,_0x3087b6){_0x5ef504=_0x5ef504-0x0;var _0x3cc58=_0x1b0e[_0x5ef504];return _0x3cc58;};'use strict';var client=require(_0xe1b0('0x0'));exports[_0xe1b0('0x1')]=function(){return function(){return client[_0xe1b0('0x2')](_0xe1b0('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xe1b0('0x4')],'include':[{'model':_0xe1b0('0x5'),'as':'Intervals','attributes':['id','name',_0xe1b0('0x6')]}]},'log':_0xe1b0('0x1')});};}; \ No newline at end of file +var _0x6582=['Request','GetInterval','name','Intervals','interval','../client','getIntervals'];(function(_0x34606e,_0x507cac){var _0xde0bad=function(_0x2aaea7){while(--_0x2aaea7){_0x34606e['push'](_0x34606e['shift']());}};_0xde0bad(++_0x507cac);}(_0x6582,0x108));var _0x2658=function(_0x5d8d5f,_0x1adf93){_0x5d8d5f=_0x5d8d5f-0x0;var _0x10be5c=_0x6582[_0x5d8d5f];return _0x10be5c;};'use strict';var client=require(_0x2658('0x0'));exports[_0x2658('0x1')]=function(){return function(){return client[_0x2658('0x2')](_0x2658('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2658('0x4')],'include':[{'model':'Interval','as':_0x2658('0x5'),'attributes':['id',_0x2658('0x4'),_0x2658('0x6')]}]},'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 bff4609..2aa5da6 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 _0x0701=['Request','UpdateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update'];(function(_0x5f52a4,_0x5706d9){var _0xde1bce=function(_0x16ef65){while(--_0x16ef65){_0x5f52a4['push'](_0x5f52a4['shift']());}};_0xde1bce(++_0x5706d9);}(_0x0701,0x19b));var _0x1070=function(_0x4b666e,_0x4f15a7){_0x4b666e=_0x4b666e-0x0;var _0x16ddb7=_0x0701[_0x4b666e];return _0x16ddb7;};'use strict';var client=require(_0x1070('0x0'));exports[_0x1070('0x1')]=function(_0x1d4fba,_0x40a7d6){return client[_0x1070('0x2')](_0x1070('0x3'),{'body':_0x40a7d6,'options':{'where':{'id':_0x1d4fba}},'log':'updateMailInteraction'});};exports[_0x1070('0x4')]=function(_0x170bd0,_0x5efaa8){return client[_0x1070('0x2')](_0x1070('0x5'),{'body':_0x5efaa8,'options':{'where':{'id':_0x170bd0}},'log':_0x1070('0x6')});}; \ No newline at end of file +var _0xc7ba=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x4a4bbc,_0x55296f){var _0x51e76f=function(_0x30cbb4){while(--_0x30cbb4){_0x4a4bbc['push'](_0x4a4bbc['shift']());}};_0x51e76f(++_0x55296f);}(_0xc7ba,0xa2));var _0xac7b=function(_0x1339de,_0x29ed19){_0x1339de=_0x1339de-0x0;var _0xc82081=_0xc7ba[_0x1339de];return _0xc82081;};'use strict';var client=require(_0xac7b('0x0'));exports[_0xac7b('0x1')]=function(_0x33bd87,_0x31dc86){return client[_0xac7b('0x2')](_0xac7b('0x3'),{'body':_0x31dc86,'options':{'where':{'id':_0x33bd87}},'log':_0xac7b('0x4')});};exports[_0xac7b('0x5')]=function(_0x40b327,_0x45eeea){return client['Request'](_0xac7b('0x6'),{'body':_0x45eeea,'options':{'where':{'id':_0x40b327}},'log':_0xac7b('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 8fdcb8c..d0f71a7 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 _0x588a=['Request','../client','create'];(function(_0x15ef24,_0x439dc2){var _0x5d988d=function(_0xb7e85e){while(--_0xb7e85e){_0x15ef24['push'](_0x15ef24['shift']());}};_0x5d988d(++_0x439dc2);}(_0x588a,0x109));var _0xa588=function(_0x20b328,_0x11174d){_0x20b328=_0x20b328-0x0;var _0x3d0297=_0x588a[_0x20b328];return _0x3d0297;};'use strict';var client=require(_0xa588('0x0'));exports[_0xa588('0x1')]=function(_0x3c0969){return client[_0xa588('0x2')]('CreateMailMessage',{'body':_0x3c0969,'log':'createMailMessage'});}; \ No newline at end of file +var _0xc4cf=['create','Request','CreateMailMessage'];(function(_0x32385a,_0xfb0159){var _0x5434f3=function(_0x3d8872){while(--_0x3d8872){_0x32385a['push'](_0x32385a['shift']());}};_0x5434f3(++_0xfb0159);}(_0xc4cf,0x111));var _0xfc4c=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xc4cf[_0xe73080];return _0x12cbc4;};'use strict';var client=require('../client');exports[_0xfc4c('0x0')]=function(_0xf85c32){return client[_0xfc4c('0x1')](_0xfc4c('0x2'),{'body':_0xf85c32,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 0eea19d..f8721f5 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 _0x1fb0=['getMailQueues','Request','GetMailQueue','name','timeout','strategy','User','Agents','online','mailPause'];(function(_0x492d02,_0x49e61e){var _0x339033=function(_0x7a96e7){while(--_0x7a96e7){_0x492d02['push'](_0x492d02['shift']());}};_0x339033(++_0x49e61e);}(_0x1fb0,0xaa));var _0x01fb=function(_0x593f0e,_0x3555e7){_0x593f0e=_0x593f0e-0x0;var _0x116f30=_0x1fb0[_0x593f0e];return _0x116f30;};'use strict';var client=require('../client');exports[_0x01fb('0x0')]=function(){return function(){return client[_0x01fb('0x1')](_0x01fb('0x2'),{'options':{'raw':![],'attributes':['id',_0x01fb('0x3'),_0x01fb('0x4'),_0x01fb('0x5')],'include':[{'model':_0x01fb('0x6'),'as':_0x01fb('0x7'),'attributes':['id',_0x01fb('0x3'),_0x01fb('0x8'),_0x01fb('0x9')]}]},'log':_0x01fb('0x0')});};}; \ No newline at end of file +var _0x9743=['mailPause','Request','name','timeout','Agents','online'];(function(_0x13c1ec,_0x31fe45){var _0x3df630=function(_0x2ec0ee){while(--_0x2ec0ee){_0x13c1ec['push'](_0x13c1ec['shift']());}};_0x3df630(++_0x31fe45);}(_0x9743,0x139));var _0x3974=function(_0xfecebb,_0xbce982){_0xfecebb=_0xfecebb-0x0;var _0xc14ad4=_0x9743[_0xfecebb];return _0xc14ad4;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client[_0x3974('0x0')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x3974('0x1'),_0x3974('0x2'),'strategy'],'include':[{'model':'User','as':_0x3974('0x3'),'attributes':['id',_0x3974('0x1'),_0x3974('0x4'),_0x3974('0x5')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index d46d8b3..18e86b3 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 _0xa01b=['update','UpdateMailQueueReport','DESC','create','Request','CreateMailQueueReport'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xa01b,0x11d));var _0xba01=function(_0x1fc9e5,_0x338622){_0x1fc9e5=_0x1fc9e5-0x0;var _0x4836ad=_0xa01b[_0x1fc9e5];return _0x4836ad;};'use strict';var client=require('../client');exports[_0xba01('0x0')]=function(_0x2a81ca){return client[_0xba01('0x1')](_0xba01('0x2'),{'body':_0x2a81ca,'log':_0xba01('0x2')});};exports[_0xba01('0x3')]=function(_0x2e3451,_0x4e230b){return client['Request'](_0xba01('0x4'),{'body':_0x4e230b,'options':{'where':{'uniqueid':_0x2e3451},'order':[['id',_0xba01('0x5')]],'limit':0x1},'log':_0xba01('0x4')});}; \ No newline at end of file +var _0x4262=['CreateMailQueueReport','update','UpdateMailQueueReport','../client','create','Request'];(function(_0x1f4b96,_0x50f830){var _0x25cc4e=function(_0x34ab2d){while(--_0x34ab2d){_0x1f4b96['push'](_0x1f4b96['shift']());}};_0x25cc4e(++_0x50f830);}(_0x4262,0xe1));var _0x2426=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4262[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x2426('0x0'));exports[_0x2426('0x1')]=function(_0x539f2a){return client[_0x2426('0x2')](_0x2426('0x3'),{'body':_0x539f2a,'log':_0x2426('0x3')});};exports[_0x2426('0x4')]=function(_0xd9deea,_0xc4a2f4){return client[_0x2426('0x2')](_0x2426('0x5'),{'body':_0xc4a2f4,'options':{'where':{'uniqueid':_0xd9deea},'order':[['id','DESC']],'limit':0x1},'log':_0x2426('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index cbf5cdd..b2229f9 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 _0xa86b=['addTags','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction'];(function(_0x2d0a67,_0x784f53){var _0x4d2d5d=function(_0x3951b5){while(--_0x3951b5){_0x2d0a67['push'](_0x2d0a67['shift']());}};_0x4d2d5d(++_0x784f53);}(_0xa86b,0x1a6));var _0xba86=function(_0x4d2634,_0x3a7165){_0x4d2634=_0x4d2634-0x0;var _0x2c4bf3=_0xa86b[_0x4d2634];return _0x2c4bf3;};'use strict';var client=require(_0xba86('0x0'));exports[_0xba86('0x1')]=function(_0x198f1f,_0x429fb6){return client[_0xba86('0x2')](_0xba86('0x3'),{'body':_0x429fb6,'options':{'where':{'id':_0x198f1f}},'log':'updateOpenchannelInteraction'});};exports[_0xba86('0x4')]=function(_0x4701b4,_0x1c6aab){return client[_0xba86('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x1c6aab,'options':{'where':{'id':_0x4701b4}},'log':_0xba86('0x5')});}; \ No newline at end of file +var _0x1e06=['Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x9cc34b,_0x34d95d){var _0x42b03a=function(_0x18f4db){while(--_0x18f4db){_0x9cc34b['push'](_0x9cc34b['shift']());}};_0x42b03a(++_0x34d95d);}(_0x1e06,0x16a));var _0x61e0=function(_0x294afd,_0x14354e){_0x294afd=_0x294afd-0x0;var _0x96c76=_0x1e06[_0x294afd];return _0x96c76;};'use strict';var client=require(_0x61e0('0x0'));exports[_0x61e0('0x1')]=function(_0x1a5955,_0x5838f2){return client[_0x61e0('0x2')]('UpdateOpenchannelInteraction',{'body':_0x5838f2,'options':{'where':{'id':_0x1a5955}},'log':_0x61e0('0x3')});};exports[_0x61e0('0x4')]=function(_0x42a1f2,_0x2e49b6){return client[_0x61e0('0x2')](_0x61e0('0x5'),{'body':_0x2e49b6,'options':{'where':{'id':_0x42a1f2}},'log':_0x61e0('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index be66571..1e70868 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 _0x9c44=['createOpenchannelMessage','Request','CreateOpenchannelMessage'];(function(_0x8853c0,_0x372bfb){var _0x3943fd=function(_0x1ef08c){while(--_0x1ef08c){_0x8853c0['push'](_0x8853c0['shift']());}};_0x3943fd(++_0x372bfb);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x2')});}; \ No newline at end of file +var _0xe5b3=['Request','CreateOpenchannelMessage','createOpenchannelMessage','create'];(function(_0x1ac77b,_0x10ee7a){var _0x161584=function(_0x5a810d){while(--_0x5a810d){_0x1ac77b['push'](_0x1ac77b['shift']());}};_0x161584(++_0x10ee7a);}(_0xe5b3,0x133));var _0x3e5b=function(_0x310223,_0x1fd62d){_0x310223=_0x310223-0x0;var _0x4d2dc2=_0xe5b3[_0x310223];return _0x4d2dc2;};'use strict';var client=require('../client');exports[_0x3e5b('0x0')]=function(_0xba44a0){return client[_0x3e5b('0x1')](_0x3e5b('0x2'),{'body':_0xba44a0,'log':_0x3e5b('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 76c2d75..916eb26 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 _0x1390=['name','timeout','strategy','User','Agents','online','../client','Request','GetOpenchannelQueue'];(function(_0xd7ac90,_0x47ea55){var _0xace3f=function(_0x3dff08){while(--_0x3dff08){_0xd7ac90['push'](_0xd7ac90['shift']());}};_0xace3f(++_0x47ea55);}(_0x1390,0x12f));var _0x0139=function(_0x3efe74,_0x2cff6b){_0x3efe74=_0x3efe74-0x0;var _0x572629=_0x1390[_0x3efe74];return _0x572629;};'use strict';var client=require(_0x0139('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x0139('0x1')](_0x0139('0x2'),{'options':{'raw':![],'attributes':['id',_0x0139('0x3'),_0x0139('0x4'),_0x0139('0x5')],'include':[{'model':_0x0139('0x6'),'as':_0x0139('0x7'),'attributes':['id',_0x0139('0x3'),_0x0139('0x8'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x1b7b=['Agents','online','openchannelPause','../client','getOpenchannelQueues','Request','name','timeout','strategy'];(function(_0x194cc5,_0x2b9894){var _0x181bf8=function(_0x3b1df1){while(--_0x3b1df1){_0x194cc5['push'](_0x194cc5['shift']());}};_0x181bf8(++_0x2b9894);}(_0x1b7b,0x1ce));var _0xb1b7=function(_0x28036e,_0x50fb99){_0x28036e=_0x28036e-0x0;var _0x300e79=_0x1b7b[_0x28036e];return _0x300e79;};'use strict';var client=require(_0xb1b7('0x0'));exports[_0xb1b7('0x1')]=function(){return function(){return client[_0xb1b7('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xb1b7('0x3'),_0xb1b7('0x4'),_0xb1b7('0x5')],'include':[{'model':'User','as':_0xb1b7('0x6'),'attributes':['id',_0xb1b7('0x3'),_0xb1b7('0x7'),_0xb1b7('0x8')]}]},'log':_0xb1b7('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 9bb8785..927bc5a 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 _0x61cd=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','Request'];(function(_0xa665a5,_0x5b1627){var _0x103dee=function(_0x2c499e){while(--_0x2c499e){_0xa665a5['push'](_0xa665a5['shift']());}};_0x103dee(++_0x5b1627);}(_0x61cd,0x130));var _0xd61c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x61cd[_0x4565bf];return _0x5610ba;};'use strict';var client=require(_0xd61c('0x0'));exports['create']=function(_0x2d0e51){return client[_0xd61c('0x1')]('CreateOpenchannelQueueReport',{'body':_0x2d0e51,'log':_0xd61c('0x2')});};exports[_0xd61c('0x3')]=function(_0x127b20,_0x27eed5){return client[_0xd61c('0x1')](_0xd61c('0x4'),{'body':_0x27eed5,'options':{'where':{'uniqueid':_0x127b20},'order':[['id',_0xd61c('0x5')]],'limit':0x1},'log':_0xd61c('0x4')});}; \ No newline at end of file +var _0x533e=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','create','Request'];(function(_0x5a36e7,_0x5b8338){var _0x3adafa=function(_0x294c38){while(--_0x294c38){_0x5a36e7['push'](_0x5a36e7['shift']());}};_0x3adafa(++_0x5b8338);}(_0x533e,0x11e));var _0xe533=function(_0x532b27,_0x4262b9){_0x532b27=_0x532b27-0x0;var _0x30ce08=_0x533e[_0x532b27];return _0x30ce08;};'use strict';var client=require('../client');exports[_0xe533('0x0')]=function(_0x2c184f){return client[_0xe533('0x1')](_0xe533('0x2'),{'body':_0x2c184f,'log':'CreateOpenchannelQueueReport'});};exports[_0xe533('0x3')]=function(_0x323ea7,_0xa49c9b){return client[_0xe533('0x1')](_0xe533('0x4'),{'body':_0xa49c9b,'options':{'where':{'uniqueid':_0x323ea7},'order':[['id',_0xe533('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 24d623b..d91958e 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 _0x1b91=['updateSmsInteraction','Request','AddTagsToSmsInteraction','../client','update','UpdateSmsInteraction'];(function(_0x23bcd4,_0xd3deb0){var _0x4cb792=function(_0x48d4c8){while(--_0x48d4c8){_0x23bcd4['push'](_0x23bcd4['shift']());}};_0x4cb792(++_0xd3deb0);}(_0x1b91,0x171));var _0x11b9=function(_0x135fb3,_0x55880d){_0x135fb3=_0x135fb3-0x0;var _0x3ad741=_0x1b91[_0x135fb3];return _0x3ad741;};'use strict';var client=require(_0x11b9('0x0'));exports[_0x11b9('0x1')]=function(_0x93f2c8,_0x3e378){return client['Request'](_0x11b9('0x2'),{'body':_0x3e378,'options':{'where':{'id':_0x93f2c8}},'log':_0x11b9('0x3')});};exports['addTags']=function(_0x3a825b,_0x42db5c){return client[_0x11b9('0x4')](_0x11b9('0x5'),{'body':_0x42db5c,'options':{'where':{'id':_0x3a825b}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x9f53=['update','Request','UpdateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x9f53,0xfb));var _0x39f5=function(_0x22de20,_0x51bc91){_0x22de20=_0x22de20-0x0;var _0x4a0fc5=_0x9f53[_0x22de20];return _0x4a0fc5;};'use strict';var client=require(_0x39f5('0x0'));exports[_0x39f5('0x1')]=function(_0x290a73,_0x4f54a2){return client[_0x39f5('0x2')](_0x39f5('0x3'),{'body':_0x4f54a2,'options':{'where':{'id':_0x290a73}},'log':'updateSmsInteraction'});};exports[_0x39f5('0x4')]=function(_0x3e2258,_0xa78506){return client[_0x39f5('0x2')](_0x39f5('0x5'),{'body':_0xa78506,'options':{'where':{'id':_0x3e2258}},'log':_0x39f5('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index b0fef77..7ea3bce 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 _0xa162=['createSmsMessage','../client','Request','CreateSmsMessage'];(function(_0x237458,_0x1eea47){var _0x29630=function(_0x530c53){while(--_0x530c53){_0x237458['push'](_0x237458['shift']());}};_0x29630(++_0x1eea47);}(_0xa162,0x169));var _0x2a16=function(_0x411657,_0x52a030){_0x411657=_0x411657-0x0;var _0x121f00=_0xa162[_0x411657];return _0x121f00;};'use strict';var client=require(_0x2a16('0x0'));exports['create']=function(_0x56610a){return client[_0x2a16('0x1')](_0x2a16('0x2'),{'body':_0x56610a,'log':_0x2a16('0x3')});}; \ No newline at end of file +var _0xeb83=['createSmsMessage','create','CreateSmsMessage'];(function(_0x2e9736,_0x159e11){var _0x37bdc7=function(_0x5c02f6){while(--_0x5c02f6){_0x2e9736['push'](_0x2e9736['shift']());}};_0x37bdc7(++_0x159e11);}(_0xeb83,0x1c6));var _0x3eb8=function(_0x3ccb94,_0x39b95e){_0x3ccb94=_0x3ccb94-0x0;var _0x3ee1f3=_0xeb83[_0x3ccb94];return _0x3ee1f3;};'use strict';var client=require('../client');exports[_0x3eb8('0x0')]=function(_0x43ba4c){return client['Request'](_0x3eb8('0x1'),{'body':_0x43ba4c,'log':_0x3eb8('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 2660f95..d99eedc 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 _0x874d=['online','smsPause','getSmsQueues','Request','GetSmsQueue','timeout','strategy','User','Agents'];(function(_0x37674c,_0x2a6430){var _0x4a9ebf=function(_0x307fd5){while(--_0x307fd5){_0x37674c['push'](_0x37674c['shift']());}};_0x4a9ebf(++_0x2a6430);}(_0x874d,0x1e8));var _0xd874=function(_0x36940e,_0x11f338){_0x36940e=_0x36940e-0x0;var _0x3283f2=_0x874d[_0x36940e];return _0x3283f2;};'use strict';var client=require('../client');exports[_0xd874('0x0')]=function(){return function(){return client[_0xd874('0x1')](_0xd874('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xd874('0x3'),_0xd874('0x4')],'include':[{'model':_0xd874('0x5'),'as':_0xd874('0x6'),'attributes':['id','name',_0xd874('0x7'),_0xd874('0x8')]}]},'log':_0xd874('0x0')});};}; \ No newline at end of file +var _0x1228=['Request','name','timeout','strategy','Agents','smsPause','getSmsQueues','../client'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x1228,0x12f));var _0x8122=function(_0x1cc060,_0x1afbdc){_0x1cc060=_0x1cc060-0x0;var _0x5c7e10=_0x1228[_0x1cc060];return _0x5c7e10;};'use strict';var client=require(_0x8122('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x8122('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x8122('0x2'),_0x8122('0x3'),_0x8122('0x4')],'include':[{'model':'User','as':_0x8122('0x5'),'attributes':['id',_0x8122('0x2'),'online',_0x8122('0x6')]}]},'log':_0x8122('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index fcc64a9..0a63334 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 _0xe540=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x577f24,_0x415e8c){var _0x4b82f7=function(_0x5239f9){while(--_0x5239f9){_0x577f24['push'](_0x577f24['shift']());}};_0x4b82f7(++_0x415e8c);}(_0xe540,0xe6));var _0x0e54=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe540[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x0e54('0x0'));exports[_0x0e54('0x1')]=function(_0x50d3e7){return client[_0x0e54('0x2')](_0x0e54('0x3'),{'body':_0x50d3e7,'log':_0x0e54('0x3')});};exports[_0x0e54('0x4')]=function(_0x2b7103,_0x120102){return client[_0x0e54('0x2')](_0x0e54('0x5'),{'body':_0x120102,'options':{'where':{'uniqueid':_0x2b7103},'order':[['id',_0x0e54('0x6')]],'limit':0x1},'log':_0x0e54('0x5')});}; \ No newline at end of file +var _0x34b7=['DESC','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x30cba6,_0x57acab){var _0x53a3b5=function(_0x521a32){while(--_0x521a32){_0x30cba6['push'](_0x30cba6['shift']());}};_0x53a3b5(++_0x57acab);}(_0x34b7,0x196));var _0x734b=function(_0x4eb082,_0x5ee5de){_0x4eb082=_0x4eb082-0x0;var _0x2f17e0=_0x34b7[_0x4eb082];return _0x2f17e0;};'use strict';var client=require('../client');exports['create']=function(_0x43a5f1){return client[_0x734b('0x0')](_0x734b('0x1'),{'body':_0x43a5f1,'log':_0x734b('0x1')});};exports[_0x734b('0x2')]=function(_0x2993c6,_0x5de1ae){return client['Request'](_0x734b('0x3'),{'body':_0x5de1ae,'options':{'where':{'uniqueid':_0x2993c6},'order':[['id',_0x734b('0x4')]],'limit':0x1},'log':_0x734b('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index f806bf7..25346ec 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 _0x7cdf=['faxPause','smsPause','mailCapacity','smsCapacity','openchannelCapacity','../client','getAgents','agent','name','lastPauseAt','voicePause','mailPause'];(function(_0x5ded97,_0x2061a7){var _0x495a22=function(_0x4ae829){while(--_0x4ae829){_0x5ded97['push'](_0x5ded97['shift']());}};_0x495a22(++_0x2061a7);}(_0x7cdf,0xd1));var _0xf7cd=function(_0x6b3c09,_0x10b5a2){_0x6b3c09=_0x6b3c09-0x0;var _0x51ba53=_0x7cdf[_0x6b3c09];return _0x51ba53;};'use strict';var client=require(_0xf7cd('0x0'));exports[_0xf7cd('0x1')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0xf7cd('0x2')},'attributes':['id',_0xf7cd('0x3'),'online','pauseType',_0xf7cd('0x4'),_0xf7cd('0x5'),'chatPause',_0xf7cd('0x6'),_0xf7cd('0x7'),_0xf7cd('0x8'),'openchannelPause','chatCapacity',_0xf7cd('0x9'),'faxCapacity',_0xf7cd('0xa'),_0xf7cd('0xb')]},'log':_0xf7cd('0x1')});};}; \ No newline at end of file +var _0x8183=['faxCapacity','smsCapacity','openchannelCapacity','getAgents','Request','agent','name','online','pauseType','lastPauseAt','voicePause','mailPause','faxPause','chatCapacity','mailCapacity'];(function(_0x54799c,_0x462321){var _0x147c6e=function(_0x460af4){while(--_0x460af4){_0x54799c['push'](_0x54799c['shift']());}};_0x147c6e(++_0x462321);}(_0x8183,0x14e));var _0x3818=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x8183[_0x2aa0e7];return _0x1472c0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3818('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':_0x3818('0x1')},'attributes':['id',_0x3818('0x2'),_0x3818('0x3'),_0x3818('0x4'),_0x3818('0x5'),_0x3818('0x6'),'chatPause',_0x3818('0x7'),_0x3818('0x8'),'smsPause','openchannelPause',_0x3818('0x9'),_0x3818('0xa'),_0x3818('0xb'),_0x3818('0xc'),_0x3818('0xd')]},'log':_0x3818('0xe')});};}; \ 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 a2b0810..2380f07 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 _0xd85c=['length','error','[%s][AGENT]\x20%s','map','message','stop','find','agents','createQueue','atimeout','START:%s','rules','end','close','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','lodash','util','seq-queue','../../../../config/logger','routing','string','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate'];(function(_0x1dd1fd,_0x227a46){var _0x5eec01=function(_0x1a7332){while(--_0x1a7332){_0x1dd1fd['push'](_0x1dd1fd['shift']());}};_0x5eec01(++_0x227a46);}(_0xd85c,0xc4));var _0xcd85=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0xd85c[_0x1a7846];return _0x48049;};'use strict';var schema=require('validate');var _=require(_0xcd85('0x0'));var util=require(_0xcd85('0x1'));var seqqueue=require(_0xcd85('0x2'));var logger=require(_0xcd85('0x3'))(_0xcd85('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xcd85('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xcd85('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x16d726,_0x67b51c,_0x2f496b){return logger[_0xcd85('0x7')](util[_0xcd85('0x8')](_0xcd85('0x9'),_0x16d726,_0x67b51c[_0xcd85('0xa')],_0x2f496b));}function handleFindAgent(_0x3f69cf){return function(_0x1664f7){return _0x1664f7[_0xcd85('0xa')]['toLowerCase']()===_0x3f69cf[_0xcd85('0xb')]();};}exports[_0xcd85('0xc')]=function(_0x418816,_0xc475c2,_0x3f33d4,_0x448451){return function(_0x326a4f){try{var _0x5c1634={'name':_0xc475c2[0x0],'timeout':_0xc475c2[0x1]};var _0x1e73c5=queue[_0xcd85('0xd')](_0x5c1634,{'typecast':!![]});if(_0x1e73c5[_0xcd85('0xe')]){logger[_0xcd85('0xf')](_0xcd85('0x10'),_0x418816,_[_0xcd85('0x11')](_0x1e73c5,_0xcd85('0x12'))['join'](',\x20'));_0x326a4f[_0xcd85('0x13')]();}else{var _0x1c7e47=_[_0xcd85('0x14')](_0x3f33d4[_0xcd85('0x15')],handleFindAgent(_0x5c1634[_0xcd85('0xa')]));if(_0x1c7e47){var _0x566449=(_0x5c1634['timeout']||0xa)*0x3e8;var _0x43eb8e,_0x3ff126;var _0x64717a=seqqueue[_0xcd85('0x16')](_0x566449);_0x64717a['id']=_0x418816;_0x64717a[_0xcd85('0x17')]=_0x566449;_0x64717a['channel']=_0x448451['channel'];writeLog(_0x418816,_0x1c7e47,util[_0xcd85('0x8')](_0xcd85('0x18'),_0x566449));_0x3f33d4[_0xcd85('0x19')][_0x418816]['on'](_0xcd85('0x1a'),function(){_0x64717a[_0xcd85('0x1b')]();clearTimeout(_0x3ff126);_0x3ff126=undefined;if(_0x3f33d4[_0xcd85('0x19')][_0x418816]){delete _0x3f33d4[_0xcd85('0x19')][_0x418816];}logger['info'](_0xcd85('0x1c'),_0x418816);_0x326a4f[_0xcd85('0x13')]();});_0x3ff126=setTimeout(function(){clearTimeout(_0x3ff126);_0x64717a[_0xcd85('0x1b')]();logger[_0xcd85('0x7')](_0xcd85('0x1d'),_0x418816);_0x326a4f[_0xcd85('0x1e')]();},_0x566449);strategy[_0xcd85('0x1f')](_0x64717a,_0x1c7e47,_0x3f33d4,_0x448451);}else{logger[_0xcd85('0xf')](_0xcd85('0x20'),_0x418816,_0x5c1634['name']);_0x326a4f[_0xcd85('0x13')]();}}}catch(_0x197312){console[_0xcd85('0x21')](_0x197312);logger['error'](_0xcd85('0x22'),_0x418816,_0x197312['stack']);_0x326a4f[_0xcd85('0x13')]();}};}; \ No newline at end of file +var _0xd4f9=['length','[%s][AGENT]\x20%s','map','message','join','find','timeout','createQueue','atimeout','channel','START:%s','end','close','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','[%s][AGENT]\x20ROUTING\x20END','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate'];(function(_0x14e10d,_0x5e311c){var _0x34af1c=function(_0x2a8ac6){while(--_0x2a8ac6){_0x14e10d['push'](_0x14e10d['shift']());}};_0x34af1c(++_0x5e311c);}(_0xd4f9,0xd6));var _0x9d4f=function(_0x3cbc85,_0x207874){_0x3cbc85=_0x3cbc85-0x0;var _0x5448f5=_0xd4f9[_0x3cbc85];return _0x5448f5;};'use strict';var schema=require('validate');var _=require(_0x9d4f('0x0'));var util=require(_0x9d4f('0x1'));var seqqueue=require('seq-queue');var logger=require(_0x9d4f('0x2'))(_0x9d4f('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x9d4f('0x4'),'required':!![],'message':_0x9d4f('0x5')},'timeout':{'type':_0x9d4f('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x166577,_0x45b9e0,_0x41de9e){return logger[_0x9d4f('0x7')](util[_0x9d4f('0x8')](_0x9d4f('0x9'),_0x166577,_0x45b9e0[_0x9d4f('0xa')],_0x41de9e));}function handleFindAgent(_0x28406e){return function(_0x4fea65){return _0x4fea65['name'][_0x9d4f('0xb')]()===_0x28406e[_0x9d4f('0xb')]();};}exports[_0x9d4f('0xc')]=function(_0x4414d9,_0xbba98,_0x3abe5a,_0x14d4f1){return function(_0x44afd3){try{var _0x3a134a={'name':_0xbba98[0x0],'timeout':_0xbba98[0x1]};var _0x5ce1d7=queue[_0x9d4f('0xd')](_0x3a134a,{'typecast':!![]});if(_0x5ce1d7[_0x9d4f('0xe')]){logger['error'](_0x9d4f('0xf'),_0x4414d9,_[_0x9d4f('0x10')](_0x5ce1d7,_0x9d4f('0x11'))[_0x9d4f('0x12')](',\x20'));_0x44afd3['stop']();}else{var _0x436261=_[_0x9d4f('0x13')](_0x3abe5a['agents'],handleFindAgent(_0x3a134a[_0x9d4f('0xa')]));if(_0x436261){var _0x49fef8=(_0x3a134a[_0x9d4f('0x14')]||0xa)*0x3e8;var _0x4dac90,_0xdee536;var _0x584b82=seqqueue[_0x9d4f('0x15')](_0x49fef8);_0x584b82['id']=_0x4414d9;_0x584b82[_0x9d4f('0x16')]=_0x49fef8;_0x584b82[_0x9d4f('0x17')]=_0x14d4f1[_0x9d4f('0x17')];writeLog(_0x4414d9,_0x436261,util['format'](_0x9d4f('0x18'),_0x49fef8));_0x3abe5a['rules'][_0x4414d9]['on'](_0x9d4f('0x19'),function(){_0x584b82[_0x9d4f('0x1a')]();clearTimeout(_0xdee536);_0xdee536=undefined;if(_0x3abe5a['rules'][_0x4414d9]){delete _0x3abe5a[_0x9d4f('0x1b')][_0x4414d9];}logger[_0x9d4f('0x7')](_0x9d4f('0x1c'),_0x4414d9);_0x44afd3[_0x9d4f('0x1d')]();});_0xdee536=setTimeout(function(){clearTimeout(_0xdee536);_0x584b82[_0x9d4f('0x1a')]();logger[_0x9d4f('0x7')](_0x9d4f('0x1e'),_0x4414d9);_0x44afd3[_0x9d4f('0x1f')]();},_0x49fef8);strategy[_0x9d4f('0x20')](_0x584b82,_0x436261,_0x3abe5a,_0x14d4f1);}else{logger[_0x9d4f('0x21')](_0x9d4f('0x22'),_0x4414d9,_0x3a134a[_0x9d4f('0xa')]);_0x44afd3[_0x9d4f('0x1d')]();}}}catch(_0x12755c){console[_0x9d4f('0x23')](_0x12755c);logger[_0x9d4f('0x21')](_0x9d4f('0x24'),_0x4414d9,_0x12755c[_0x9d4f('0x25')]);_0x44afd3[_0x9d4f('0x1d')]();}};}; \ 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 5c22f8f..ea2456e 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 _0x3741=['then','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','$LATEST','message','toString','postText','next','amazonlex','create','lodash','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','contact','YYYY-MM-DD\x20HH:mm:ss','out','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','isEmpty','getMustacheRender','Message'];(function(_0x1c4409,_0x3b2e8f){var _0x356d8f=function(_0xae43bf){while(--_0xae43bf){_0x1c4409['push'](_0x1c4409['shift']());}};_0x356d8f(++_0x3b2e8f);}(_0x3741,0x181));var _0x1374=function(_0x18b344,_0x271f68){_0x18b344=_0x18b344-0x0;var _0x5ef6bb=_0x3741[_0x18b344];return _0x5ef6bb;};'use strict';var _=require(_0x1374('0x0'));var moment=require('moment');var AWS=require(_0x1374('0x1'));var utils=require('./utils');var logger=require(_0x1374('0x2'))(_0x1374('0x3'));var rpc={'chatMessage':require(_0x1374('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1374('0x5')),'smsMessage':require(_0x1374('0x6')),'faxMessage':require(_0x1374('0x7'))};exports['consequence']=function(_0x314ba5,_0x1ecbf1){return function(_0x2e08a6){try{if(!_[_0x1374('0x8')](this[_0x1374('0x9')][_0x1374('0xa')])){logger[_0x1374('0xb')](_0x1374('0xc'),_0x314ba5,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2e08a6['next']();}var _0x125531={'ContactId':this[_0x1374('0xd')]['id'],'sentAt':moment()['format'](_0x1374('0xe')),'direction':_0x1374('0xf')};var _0x395986=this['channel'];if(_0x395986===_0x1374('0x10')){_0x125531[_0x1374('0x11')]=this['account']['id'];}else{_0x125531[_[_0x1374('0x12')](_0x395986)+_0x1374('0x13')]=this[_0x1374('0x14')]['id'];}_0x125531[_[_0x1374('0x12')](_0x395986)+_0x1374('0x15')]=this[_0x1374('0x9')]['id'];if(this[_0x1374('0x9')]['created']){var _0x517d9d=_0x1ecbf1[0x4];if(!_[_0x1374('0x16')](_0x517d9d)){_0x125531['body']=utils[_0x1374('0x17')](_0x517d9d,this);return rpc[_0x395986+_0x1374('0x18')]['create'](_0x125531)[_0x1374('0x19')](function(_0x440a5){logger[_0x1374('0xb')](_0x1374('0xc'),_0x314ba5,_0x125531[_0x1374('0x1a')]);})[_0x1374('0x1b')](function(_0x5dfbd3){logger[_0x1374('0x1c')](_0x1374('0xc'),_0x314ba5,JSON[_0x1374('0x1d')](_0x5dfbd3));})[_0x1374('0x1e')](function(){logger[_0x1374('0xb')](_0x1374('0x1f'),_0x314ba5);_0x2e08a6['stop']();});}else{logger[_0x1374('0xb')](_0x1374('0x20'),_0x314ba5);_0x2e08a6[_0x1374('0x21')]();}}else{var _0x107b60=this;var _0x5cd7a2=new AWS['LexRuntime']({'accessKeyId':_0x1ecbf1[0x0],'secretAccessKey':_0x1ecbf1[0x1],'region':_0x1ecbf1[0x2]});var _0x24fa2c={'botAlias':_0x1374('0x22'),'botName':_0x1ecbf1[0x3],'inputText':this[_0x1374('0x23')][_0x1374('0x1a')],'userId':this['interaction']['id'][_0x1374('0x24')]()};_0x5cd7a2[_0x1374('0x25')](_0x24fa2c,function(_0x3d9d3c,_0x5ca01a){if(_0x3d9d3c){logger[_0x1374('0x1c')](_0x1374('0xc'),_0x314ba5,_0x3d9d3c[_0x1374('0x23')]);_0x2e08a6[_0x1374('0x26')]();}else if(_0x5ca01a&&_0x5ca01a[_0x1374('0x23')]){_0x107b60[_0x1374('0x1a')][_0x1374('0x27')]=_0x5ca01a;_0x125531[_0x1374('0x1a')]=_0x5ca01a[_0x1374('0x23')];return rpc[_0x395986+_0x1374('0x18')][_0x1374('0x28')](_0x125531)[_0x1374('0x19')](function(_0x3f9d5e){logger[_0x1374('0xb')](_0x1374('0xc'),_0x314ba5,_0x125531[_0x1374('0x1a')]);if(_0x5ca01a['dialogState']=='Failed'){_0x2e08a6[_0x1374('0x26')]();}else{_0x2e08a6[_0x1374('0x21')]();}})[_0x1374('0x1b')](function(_0x4b4393){logger[_0x1374('0x1c')](_0x1374('0xc'),_0x314ba5,JSON[_0x1374('0x1d')](_0x4b4393));_0x2e08a6[_0x1374('0x26')]();});}else{_0x2e08a6['next']();}});}}catch(_0x37517a){logger[_0x1374('0x1c')]('[%s][AMAZONLEX]\x20%s',_0x314ba5,JSON[_0x1374('0x1d')](_0x37517a));_0x2e08a6[_0x1374('0x21')]();}};}; \ No newline at end of file +var _0x6746=['chat','ChatWebsiteId','upperFirst','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','error','moment','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x6746,0x1c7));var _0x6674=function(_0x204047,_0x2df7af){_0x204047=_0x204047-0x0;var _0x5956d2=_0x6746[_0x204047];return _0x5956d2;};'use strict';var _=require('lodash');var moment=require(_0x6674('0x0'));var AWS=require('aws-sdk');var utils=require(_0x6674('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x6674('0x2')),'openchannelMessage':require(_0x6674('0x3')),'mailMessage':require(_0x6674('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x6674('0x5'))};exports[_0x6674('0x6')]=function(_0x3388ea,_0x5c2c0d){return function(_0xe54521){try{if(!_[_0x6674('0x7')](this[_0x6674('0x8')][_0x6674('0x9')])){logger[_0x6674('0xa')](_0x6674('0xb'),_0x3388ea,_0x6674('0xc'));return _0xe54521['next']();}var _0x2704cc={'ContactId':this[_0x6674('0xd')]['id'],'sentAt':moment()[_0x6674('0xe')](_0x6674('0xf')),'direction':_0x6674('0x10')};var _0x33e1b4=this[_0x6674('0x11')];if(_0x33e1b4===_0x6674('0x12')){_0x2704cc[_0x6674('0x13')]=this['account']['id'];}else{_0x2704cc[_[_0x6674('0x14')](_0x33e1b4)+'AccountId']=this[_0x6674('0x15')]['id'];}_0x2704cc[_[_0x6674('0x14')](_0x33e1b4)+_0x6674('0x16')]=this[_0x6674('0x8')]['id'];if(this[_0x6674('0x8')][_0x6674('0x17')]){var _0x35f607=_0x5c2c0d[0x4];if(!_[_0x6674('0x18')](_0x35f607)){_0x2704cc[_0x6674('0x19')]=utils[_0x6674('0x1a')](_0x35f607,this);return rpc[_0x33e1b4+_0x6674('0x1b')][_0x6674('0x1c')](_0x2704cc)[_0x6674('0x1d')](function(_0x373cfd){logger[_0x6674('0xa')](_0x6674('0xb'),_0x3388ea,_0x2704cc[_0x6674('0x19')]);})[_0x6674('0x1e')](function(_0x48eb68){logger['error']('[%s][AMAZONLEX]\x20%s',_0x3388ea,JSON[_0x6674('0x1f')](_0x48eb68));})[_0x6674('0x20')](function(){logger[_0x6674('0xa')](_0x6674('0x21'),_0x3388ea);_0xe54521[_0x6674('0x22')]();});}else{logger['info'](_0x6674('0x23'),_0x3388ea);_0xe54521[_0x6674('0x22')]();}}else{var _0x418ac9=this;var _0x334d19=new AWS[(_0x6674('0x24'))]({'accessKeyId':_0x5c2c0d[0x0],'secretAccessKey':_0x5c2c0d[0x1],'region':_0x5c2c0d[0x2]});var _0xf884be={'botAlias':_0x6674('0x25'),'botName':_0x5c2c0d[0x3],'inputText':this[_0x6674('0x26')]['body'],'userId':this['interaction']['id'][_0x6674('0x27')]()};_0x334d19[_0x6674('0x28')](_0xf884be,function(_0xbfd0eb,_0x36edc4){if(_0xbfd0eb){logger['error'](_0x6674('0xb'),_0x3388ea,_0xbfd0eb[_0x6674('0x26')]);_0xe54521['next']();}else if(_0x36edc4&&_0x36edc4[_0x6674('0x26')]){_0x418ac9[_0x6674('0x19')][_0x6674('0x29')]=_0x36edc4;_0x2704cc[_0x6674('0x19')]=_0x36edc4['message'];return rpc[_0x33e1b4+_0x6674('0x1b')][_0x6674('0x1c')](_0x2704cc)[_0x6674('0x1d')](function(_0x517481){logger['info'](_0x6674('0xb'),_0x3388ea,_0x2704cc['body']);if(_0x36edc4['dialogState']=='Failed'){_0xe54521['next']();}else{_0xe54521[_0x6674('0x22')]();}})['catch'](function(_0x456381){logger[_0x6674('0x2a')](_0x6674('0xb'),_0x3388ea,JSON['stringify'](_0x456381));_0xe54521['next']();});}else{_0xe54521['next']();}});}}catch(_0x40c921){logger[_0x6674('0x2a')](_0x6674('0xb'),_0x3388ea,JSON['stringify'](_0x40c921));_0xe54521['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 6028c64..fe871b2 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(_0x2029f7,_0x53b3f1){var _0x5c6c6f=function(_0x22836a){while(--_0x22836a){_0x2029f7['push'](_0x2029f7['shift']());}};_0x5c6c6f(++_0x53b3f1);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'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 _0xd8b0=['upperFirst','AccountId','InteractionId','Message','service','Smtp','host','port','secure','pass','html','replace','','messageId','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','lodash','moment','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','channel','contact','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','account'];(function(_0x1bf611,_0x5a169b){var _0x46c450=function(_0x3528e0){while(--_0x3528e0){_0x1bf611['push'](_0x1bf611['shift']());}};_0x46c450(++_0x5a169b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x0d8b('0x2')),'openchannelMessage':require(_0x0d8b('0x3')),'mailMessage':require(_0x0d8b('0x4')),'smsMessage':require(_0x0d8b('0x5')),'faxMessage':require(_0x0d8b('0x6'))};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x3f8b6f,_0x227c63){return function(_0x39f43a){try{if(_0x227c63[0x0]==='1'&&(_['isNil'](this[_0x0d8b('0x7')][_0x0d8b('0x8')])||!this['interaction'][_0x0d8b('0x8')])){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,_0x0d8b('0xb'));return _0x39f43a[_0x0d8b('0xc')]();}var _0x1cac62=this[_0x0d8b('0xd')];var _0x28f87c={'body':utils['getMustacheRender'](_0x227c63[0x1],this),'ContactId':this[_0x0d8b('0xe')]['id'],'sentAt':moment()['format'](_0x0d8b('0xf')),'direction':_0x0d8b('0x10')};if(this[_0x0d8b('0x11')]){_0x28f87c['to']=this[_0x0d8b('0x11')][_0x0d8b('0x12')]||'';_0x28f87c['cc']=this[_0x0d8b('0x11')]['cc']||'';_0x28f87c[_0x0d8b('0x12')]=this[_0x0d8b('0x11')]['to']||'';_0x28f87c[_0x0d8b('0x13')]=this[_0x0d8b('0x11')][_0x0d8b('0x13')]||'';_0x28f87c[_0x0d8b('0x14')]=!![];if(this[_0x0d8b('0x11')][_0x0d8b('0x15')]){_0x28f87c['subject']='';_0x28f87c[_0x0d8b('0x15')]+=_[_0x0d8b('0x16')](this[_0x0d8b('0x11')][_0x0d8b('0x15')],_0x0d8b('0x17'))?'':'Re:\x20';_0x28f87c[_0x0d8b('0x15')]+=this[_0x0d8b('0x11')][_0x0d8b('0x15')];}}if(this[_0x0d8b('0xd')]===_0x0d8b('0x18')){_0x28f87c[_0x0d8b('0x19')]=this[_0x0d8b('0x1a')]['id'];}else{_0x28f87c[_[_0x0d8b('0x1b')](this['channel'])+_0x0d8b('0x1c')]=this[_0x0d8b('0x1a')]['id'];}_0x28f87c[_[_0x0d8b('0x1b')](this[_0x0d8b('0xd')])+_0x0d8b('0x1d')]=this[_0x0d8b('0x7')]['id'];if(rpc[this[_0x0d8b('0xd')]+_0x0d8b('0x1e')]){if(this['channel']==='mail'){var _0x33fb87={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp']['service']){_0x33fb87[_0x0d8b('0x1f')]=this[_0x0d8b('0x1a')][_0x0d8b('0x20')][_0x0d8b('0x1f')];}else{_0x33fb87[_0x0d8b('0x21')]=this[_0x0d8b('0x1a')][_0x0d8b('0x20')][_0x0d8b('0x21')];_0x33fb87[_0x0d8b('0x22')]=this['account'][_0x0d8b('0x20')][_0x0d8b('0x22')];_0x33fb87['secure']=this[_0x0d8b('0x1a')]['Smtp'][_0x0d8b('0x23')];}if(this[_0x0d8b('0x1a')][_0x0d8b('0x20')]['authentication']){_0x33fb87['auth']={'user':this[_0x0d8b('0x1a')][_0x0d8b('0x20')]['user'],'pass':this[_0x0d8b('0x1a')]['Smtp'][_0x0d8b('0x24')]};}_0x28f87c['inReplyTo']=this[_0x0d8b('0x11')]['messageId'];_0x28f87c[_0x0d8b('0x25')]=''+_[_0x0d8b('0x26')](_0x28f87c['body'],_0x0d8b('0x27'),_0x0d8b('0x28'))+_0x0d8b('0x29');return mailRpc['sendMailMessage'](_0x33fb87,_0x28f87c)['then'](function(_0x51cf32){logger[_0x0d8b('0x9')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x3f8b6f);_0x28f87c[_0x0d8b('0x2a')]=_0x51cf32['message']['messageId'];return rpc[_0x1cac62+_0x0d8b('0x1e')][_0x0d8b('0x2b')](_0x28f87c);})[_0x0d8b('0x2c')](function(_0xdeee5d){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0xdeee5d));})[_0x0d8b('0x2e')](function(_0x553e03){logger[_0x0d8b('0x2f')](_0x0d8b('0x30'),_0x3f8b6f,JSON['stringify'](_0x553e03));})[_0x0d8b('0x31')](function(){_0x39f43a[_0x0d8b('0xc')]();});}else{return rpc[this[_0x0d8b('0xd')]+'Message'][_0x0d8b('0x2b')](_0x28f87c)[_0x0d8b('0x2c')](function(_0x206157){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,_0x28f87c['body']);})[_0x0d8b('0x2e')](function(_0x1649fc){logger['error'](_0x0d8b('0xa'),_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0x1649fc));})[_0x0d8b('0x31')](function(){_0x39f43a[_0x0d8b('0xc')]();});}}}catch(_0x373544){logger['error']('[%s][AUTOREPLY]\x20%s',_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0x373544));_0x39f43a['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index c42bc27..1d30ebc 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 _0xc23d=['channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','stop','stringify','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','info','YYYY-MM-DD\x20HH:mm:ss','system'];(function(_0x130d03,_0x3307a5){var _0x5f20e6=function(_0x257fb3){while(--_0x257fb3){_0x130d03['push'](_0x130d03['shift']());}};_0x5f20e6(++_0x3307a5);}(_0xc23d,0x7f));var _0xdc23=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0xc23d[_0x4cbf20];return _0x582ae4;};'use strict';var moment=require(_0xdc23('0x0'));var logger=require(_0xdc23('0x1'))(_0xdc23('0x2'));var rpc={'chatInteraction':require(_0xdc23('0x3')),'openchannelInteraction':require(_0xdc23('0x4')),'smsInteraction':require(_0xdc23('0x5')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xdc23('0x6'))};exports[_0xdc23('0x7')]=function(_0x38fc3c,_0xa69924,_0x2a93af,_0x5b6bec){return function(_0x4a153f){try{logger[_0xdc23('0x8')]('[%s][CLOSE]\x20reason\x20%s',_0x38fc3c,_0xa69924[0x0]);var _0x2a5303={'closed':0x1,'closedAt':moment()['format'](_0xdc23('0x9')),'closeReason':_0xdc23('0xa'),'disposition':_0xa69924[0x0]};if(rpc[_0x5b6bec[_0xdc23('0xb')]+_0xdc23('0xc')]){rpc[_0x5b6bec[_0xdc23('0xb')]+'Interaction'][_0xdc23('0xd')](_0x5b6bec[_0xdc23('0xe')]['id'],_0x2a5303)[_0xdc23('0xf')](function(_0x1324c1){logger[_0xdc23('0x8')](_0xdc23('0x10'),_0x38fc3c,_0x5b6bec['interaction']['id']);})[_0xdc23('0x11')](function(_0x2785d6){logger[_0xdc23('0x12')](_0xdc23('0x13'),_0x38fc3c,JSON['stringify'](_0x2785d6));})[_0xdc23('0x14')](function(){_0x4a153f[_0xdc23('0x15')]();});}}catch(_0x1a0ca1){logger[_0xdc23('0x12')](_0xdc23('0x13'),_0x38fc3c,JSON[_0xdc23('0x16')](_0x1a0ca1));_0x4a153f['stop']();}};}; \ No newline at end of file +var _0xe99c=['Interaction','update','then','interaction','error','finally','stop','stringify','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xe99c,0x197));var _0xce99=function(_0x2790f0,_0x4956cd){_0x2790f0=_0x2790f0-0x0;var _0x2f9f51=_0xe99c[_0x2790f0];return _0x2f9f51;};'use strict';var moment=require(_0xce99('0x0'));var logger=require('../../../../config/logger')(_0xce99('0x1'));var rpc={'chatInteraction':require(_0xce99('0x2')),'openchannelInteraction':require(_0xce99('0x3')),'smsInteraction':require(_0xce99('0x4')),'mailInteraction':require(_0xce99('0x5')),'faxInteraction':require(_0xce99('0x6'))};exports['consequence']=function(_0x58c455,_0x2e4043,_0x577adc,_0x32fc7e){return function(_0x58e2aa){try{logger[_0xce99('0x7')](_0xce99('0x8'),_0x58c455,_0x2e4043[0x0]);var _0x1e4c4e={'closed':0x1,'closedAt':moment()[_0xce99('0x9')](_0xce99('0xa')),'closeReason':_0xce99('0xb'),'disposition':_0x2e4043[0x0]};if(rpc[_0x32fc7e[_0xce99('0xc')]+_0xce99('0xd')]){rpc[_0x32fc7e['channel']+_0xce99('0xd')][_0xce99('0xe')](_0x32fc7e['interaction']['id'],_0x1e4c4e)[_0xce99('0xf')](function(_0x2acb12){logger[_0xce99('0x7')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x58c455,_0x32fc7e[_0xce99('0x10')]['id']);})['catch'](function(_0x1ad149){logger[_0xce99('0x11')]('[%s][CLOSE]\x20%s',_0x58c455,JSON['stringify'](_0x1ad149));})[_0xce99('0x12')](function(){_0x58e2aa[_0xce99('0x13')]();});}}catch(_0x34cdfe){logger['error']('[%s][CLOSE]\x20%s',_0x58c455,JSON[_0xce99('0x14')](_0x34cdfe));_0x58e2aa['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 d51ed9a..3c3d073 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 _0x27fc=['speech','then','metadata','endConversation','stringify','lodash','apiai-promise','md5','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','getMustacheRender','create','body','catch','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','dialogflow','result','fulfillment'];(function(_0x47d453,_0x13104b){var _0x2eb4fd=function(_0x2dde44){while(--_0x2dde44){_0x47d453['push'](_0x47d453['shift']());}};_0x2eb4fd(++_0x13104b);}(_0x27fc,0x119));var _0xc27f=function(_0x2aeffd,_0x5e0ce5){_0x2aeffd=_0x2aeffd-0x0;var _0x5ae8bb=_0x27fc[_0x2aeffd];return _0x5ae8bb;};'use strict';var _=require(_0xc27f('0x0'));var moment=require('moment');var apiai=require(_0xc27f('0x1'));var md5=require(_0xc27f('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xc27f('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xc27f('0x4')),'mailMessage':require(_0xc27f('0x5')),'smsMessage':require(_0xc27f('0x6')),'faxMessage':require(_0xc27f('0x7'))};exports[_0xc27f('0x8')]=function(_0x431f40,_0x422176){return function(_0x4381b1){try{if(!_[_0xc27f('0x9')](this[_0xc27f('0xa')][_0xc27f('0xb')])){logger[_0xc27f('0xc')](_0xc27f('0xd'),_0x431f40,_0xc27f('0xe'));return _0x4381b1[_0xc27f('0xf')]();}var _0x2a1cb2={'ContactId':this[_0xc27f('0x10')]['id'],'sentAt':moment()[_0xc27f('0x11')](_0xc27f('0x12')),'direction':'out'};var _0x3b0c47=this[_0xc27f('0x13')];if(_0x3b0c47===_0xc27f('0x14')){_0x2a1cb2[_0xc27f('0x15')]=this['account']['id'];}else{_0x2a1cb2[_[_0xc27f('0x16')](_0x3b0c47)+_0xc27f('0x17')]=this[_0xc27f('0x18')]['id'];}_0x2a1cb2[_[_0xc27f('0x16')](_0x3b0c47)+_0xc27f('0x19')]=this['interaction']['id'];if(this[_0xc27f('0xa')][_0xc27f('0x1a')]){var _0x33ed29=_0x422176[0x2];if(!_[_0xc27f('0x1b')](_0x33ed29)){_0x2a1cb2['body']=utils[_0xc27f('0x1c')](_0x33ed29,this);return rpc[_0x3b0c47+'Message'][_0xc27f('0x1d')](_0x2a1cb2)['then'](function(_0x1c0552){logger[_0xc27f('0xc')](_0xc27f('0xd'),_0x431f40,_0x2a1cb2[_0xc27f('0x1e')]);})[_0xc27f('0x1f')](function(_0x105b87){logger[_0xc27f('0x20')](_0xc27f('0xd'),_0x431f40,JSON['stringify'](_0x105b87));})[_0xc27f('0x21')](function(){logger['info'](_0xc27f('0x22'),_0x431f40);_0x4381b1[_0xc27f('0x23')]();});}else{logger[_0xc27f('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x431f40);_0x4381b1[_0xc27f('0x23')]();}}else{var _0x22be48=this;var _0xd05776=apiai(_0x422176[0x0],{'language':_0x422176[0x1]||'en'});return _0xd05776[_0xc27f('0x24')](this[_0xc27f('0x25')]['body'],{'sessionId':md5(this[_0xc27f('0xa')]['id'])})['then'](function(_0x259eb4){_0x22be48[_0xc27f('0x1e')][_0xc27f('0x26')]=_0x259eb4;_0x2a1cb2[_0xc27f('0x1e')]=_0x259eb4[_0xc27f('0x27')][_0xc27f('0x28')][_0xc27f('0x29')];return rpc[_0x3b0c47+'Message'][_0xc27f('0x1d')](_0x2a1cb2)[_0xc27f('0x2a')](function(_0x1804ea){logger['info'](_0xc27f('0xd'),_0x431f40,_0x2a1cb2[_0xc27f('0x1e')]);if(_0x259eb4[_0xc27f('0x27')][_0xc27f('0x2b')][_0xc27f('0x2c')]){_0x4381b1[_0xc27f('0xf')]();}else{_0x4381b1[_0xc27f('0x23')]();}})[_0xc27f('0x1f')](function(_0xe2c7cb){logger[_0xc27f('0x20')](_0xc27f('0xd'),_0x431f40,JSON[_0xc27f('0x2d')](_0xe2c7cb));_0x4381b1[_0xc27f('0xf')]();});})['catch'](function(_0x27c623){logger[_0xc27f('0x20')](_0xc27f('0xd'),_0x431f40,_0x27c623[_0xc27f('0x25')]);_0x4381b1[_0xc27f('0xf')]();});}}catch(_0x3ee937){logger[_0xc27f('0x20')](_0xc27f('0xd'),_0x431f40,JSON[_0xc27f('0x2d')](_0x3ee937));_0x4381b1['stop']();}};}; \ No newline at end of file +var _0xfddd=['Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','account','upperFirst','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','speech','metadata','endConversation','lodash','moment','apiai-promise','md5','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s'];(function(_0x1203fb,_0x5e6bef){var _0x1991bd=function(_0x4585a3){while(--_0x4585a3){_0x1203fb['push'](_0x1203fb['shift']());}};_0x1991bd(++_0x5e6bef);}(_0xfddd,0x119));var _0xdfdd=function(_0x2233a5,_0x5b2253){_0x2233a5=_0x2233a5-0x0;var _0x1635d9=_0xfddd[_0x2233a5];return _0x1635d9;};'use strict';var _=require(_0xdfdd('0x0'));var moment=require(_0xdfdd('0x1'));var apiai=require(_0xdfdd('0x2'));var md5=require(_0xdfdd('0x3'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xdfdd('0x4'));var rpc={'chatMessage':require(_0xdfdd('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xdfdd('0x6')),'smsMessage':require(_0xdfdd('0x7')),'faxMessage':require(_0xdfdd('0x8'))};exports['consequence']=function(_0x468d98,_0x4a4d6c){return function(_0x2fbabd){try{if(!_[_0xdfdd('0x9')](this[_0xdfdd('0xa')]['UserId'])){logger[_0xdfdd('0xb')](_0xdfdd('0xc'),_0x468d98,_0xdfdd('0xd'));return _0x2fbabd[_0xdfdd('0xe')]();}var _0x2bbe74={'ContactId':this[_0xdfdd('0xf')]['id'],'sentAt':moment()['format'](_0xdfdd('0x10')),'direction':_0xdfdd('0x11')};var _0x49296e=this[_0xdfdd('0x12')];if(_0x49296e===_0xdfdd('0x13')){_0x2bbe74['ChatWebsiteId']=this[_0xdfdd('0x14')]['id'];}else{_0x2bbe74[_[_0xdfdd('0x15')](_0x49296e)+'AccountId']=this['account']['id'];}_0x2bbe74[_[_0xdfdd('0x15')](_0x49296e)+'InteractionId']=this[_0xdfdd('0xa')]['id'];if(this['interaction'][_0xdfdd('0x16')]){var _0xcaab9e=_0x4a4d6c[0x2];if(!_[_0xdfdd('0x17')](_0xcaab9e)){_0x2bbe74[_0xdfdd('0x18')]=utils[_0xdfdd('0x19')](_0xcaab9e,this);return rpc[_0x49296e+_0xdfdd('0x1a')][_0xdfdd('0x1b')](_0x2bbe74)[_0xdfdd('0x1c')](function(_0x43a6f2){logger['info'](_0xdfdd('0xc'),_0x468d98,_0x2bbe74[_0xdfdd('0x18')]);})[_0xdfdd('0x1d')](function(_0x1e42ee){logger[_0xdfdd('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x468d98,JSON[_0xdfdd('0x1f')](_0x1e42ee));})[_0xdfdd('0x20')](function(){logger[_0xdfdd('0xb')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x468d98);_0x2fbabd[_0xdfdd('0x21')]();});}else{logger[_0xdfdd('0xb')](_0xdfdd('0x22'),_0x468d98);_0x2fbabd[_0xdfdd('0x21')]();}}else{var _0x1470fe=this;var _0x40cf99=apiai(_0x4a4d6c[0x0],{'language':_0x4a4d6c[0x1]||'en'});return _0x40cf99[_0xdfdd('0x23')](this[_0xdfdd('0x24')][_0xdfdd('0x18')],{'sessionId':md5(this[_0xdfdd('0xa')]['id'])})['then'](function(_0x2895b0){_0x1470fe['body'][_0xdfdd('0x25')]=_0x2895b0;_0x2bbe74['body']=_0x2895b0[_0xdfdd('0x26')]['fulfillment'][_0xdfdd('0x27')];return rpc[_0x49296e+_0xdfdd('0x1a')][_0xdfdd('0x1b')](_0x2bbe74)[_0xdfdd('0x1c')](function(_0x1d96a3){logger['info'](_0xdfdd('0xc'),_0x468d98,_0x2bbe74['body']);if(_0x2895b0[_0xdfdd('0x26')][_0xdfdd('0x28')][_0xdfdd('0x29')]){_0x2fbabd['next']();}else{_0x2fbabd[_0xdfdd('0x21')]();}})[_0xdfdd('0x1d')](function(_0x2fa1a3){logger[_0xdfdd('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x468d98,JSON[_0xdfdd('0x1f')](_0x2fa1a3));_0x2fbabd[_0xdfdd('0xe')]();});})['catch'](function(_0x3af829){logger[_0xdfdd('0x1e')](_0xdfdd('0xc'),_0x468d98,_0x3af829['message']);_0x2fbabd[_0xdfdd('0xe')]();});}}catch(_0x1f496c){logger[_0xdfdd('0x1e')](_0xdfdd('0xc'),_0x468d98,JSON[_0xdfdd('0x1f')](_0x1f496c));_0x2fbabd[_0xdfdd('0x21')]();}};}; \ 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 17a47c0..68542b6 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 _0x37f6=['validate','error','[%s][GOTOIF]\x20%s','message','join','condition','priorityFalse','next','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','lodash','html-to-text','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','consequence','fromString','getMustacheRender','replace'];(function(_0x28b0a4,_0x2ea758){var _0x105ce6=function(_0x6df20f){while(--_0x6df20f){_0x28b0a4['push'](_0x28b0a4['shift']());}};_0x105ce6(++_0x2ea758);}(_0x37f6,0x12d));var _0x637f=function(_0x118758,_0x58232a){_0x118758=_0x118758-0x0;var _0x429d4b=_0x37f6[_0x118758];return _0x429d4b;};'use strict';var schema=require('validate');var _=require(_0x637f('0x0'));var htmlToText=require(_0x637f('0x1'));var utils=require(_0x637f('0x2'));var logger=require(_0x637f('0x3'))(_0x637f('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x637f('0x5')},'priorityTrue':{'type':_0x637f('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x637f('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x637f('0x7')]=function(_0x422f7e,_0x26d43b){return function(_0x13403d){try{var _0x18128e={'condition':htmlToText[_0x637f('0x8')](utils[_0x637f('0x9')](_0x26d43b[0x0],this),{'wordwrap':![]})[_0x637f('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x26d43b[0x1],'priorityFalse':_0x26d43b[0x2]};var _0x1353bc=gotoif[_0x637f('0xb')](_0x18128e,{'typecast':!![]});if(_0x1353bc['length']){logger[_0x637f('0xc')](_0x637f('0xd'),_0x422f7e,_['map'](_0x1353bc,_0x637f('0xe'))[_0x637f('0xf')](',\x20'));_0x13403d['stop']();}else{try{var _0x3d22f6=eval('('+_0x18128e[_0x637f('0x10')]+')');var _0x56b330=_0x3d22f6?_0x18128e['priorityTrue']:_0x18128e[_0x637f('0x11')];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x422f7e,_0x18128e['condition'],_0x3d22f6,_0x56b330||_0x637f('0x12'));if(_0x56b330){var _0x239a52=_['findIndex'](_0x13403d[_0x637f('0x13')](),{'p':_0x56b330});if(_0x239a52>=0x0){logger[_0x637f('0x14')](_0x637f('0x15'),_0x422f7e,_0x56b330||_0x637f('0x12'),_0x239a52);_0x13403d[_0x637f('0x12')](_0x239a52);}else{logger[_0x637f('0x14')](_0x637f('0x16'),_0x422f7e,_0x56b330||_0x637f('0x12'));_0x13403d[_0x637f('0x17')]();}}else{_0x13403d[_0x637f('0x12')]();}}catch(_0xaafc0f){logger[_0x637f('0xc')](_0x637f('0x18'),_0x422f7e,_0xaafc0f[_0x637f('0xe')]);_0x13403d[_0x637f('0x17')]();}}}catch(_0x5dac26){logger[_0x637f('0xc')](_0x637f('0xd'),_0x422f7e,JSON[_0x637f('0x19')](_0x5dac26));_0x13403d[_0x637f('0x17')]();}};}; \ No newline at end of file +var _0x1bb4=['number','priority\x20false\x20is\x20a\x20number','getMustacheRender','length','error','[%s][GOTOIF]\x20%s','map','join','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash','html-to-text','priority\x20true\x20is\x20a\x20number'];(function(_0x3b26ea,_0x990c5c){var _0x578f8d=function(_0x439dc2){while(--_0x439dc2){_0x3b26ea['push'](_0x3b26ea['shift']());}};_0x578f8d(++_0x990c5c);}(_0x1bb4,0x127));var _0x41bb=function(_0x5d1480,_0x55489c){_0x5d1480=_0x5d1480-0x0;var _0x46ece9=_0x1bb4[_0x5d1480];return _0x46ece9;};'use strict';var schema=require(_0x41bb('0x0'));var _=require(_0x41bb('0x1'));var htmlToText=require(_0x41bb('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0x41bb('0x3')},'priorityFalse':{'type':_0x41bb('0x4'),'message':_0x41bb('0x5')}});exports['consequence']=function(_0x42fb59,_0x4294b3){return function(_0x129c8d){try{var _0x5a4909={'condition':htmlToText['fromString'](utils[_0x41bb('0x6')](_0x4294b3[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4294b3[0x1],'priorityFalse':_0x4294b3[0x2]};var _0x5981a5=gotoif[_0x41bb('0x0')](_0x5a4909,{'typecast':!![]});if(_0x5981a5[_0x41bb('0x7')]){logger[_0x41bb('0x8')](_0x41bb('0x9'),_0x42fb59,_[_0x41bb('0xa')](_0x5981a5,'message')[_0x41bb('0xb')](',\x20'));_0x129c8d['stop']();}else{try{var _0x3db975=eval('('+_0x5a4909[_0x41bb('0xc')]+')');var _0x57e59c=_0x3db975?_0x5a4909[_0x41bb('0xd')]:_0x5a4909[_0x41bb('0xe')];logger['info'](_0x41bb('0xf'),_0x42fb59,_0x5a4909[_0x41bb('0xc')],_0x3db975,_0x57e59c||'next');if(_0x57e59c){var _0x5ab2b0=_[_0x41bb('0x10')](_0x129c8d['rules'](),{'p':_0x57e59c});if(_0x5ab2b0>=0x0){logger[_0x41bb('0x11')](_0x41bb('0x12'),_0x42fb59,_0x57e59c||_0x41bb('0x13'),_0x5ab2b0);_0x129c8d[_0x41bb('0x13')](_0x5ab2b0);}else{logger[_0x41bb('0x11')](_0x41bb('0x14'),_0x42fb59,_0x57e59c||_0x41bb('0x13'));_0x129c8d[_0x41bb('0x15')]();}}else{_0x129c8d['next']();}}catch(_0x437a9b){logger[_0x41bb('0x8')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x42fb59,_0x437a9b['message']);_0x129c8d[_0x41bb('0x15')]();}}}catch(_0x441a12){logger[_0x41bb('0x8')](_0x41bb('0x9'),_0x42fb59,JSON[_0x41bb('0x16')](_0x441a12));_0x129c8d[_0x41bb('0x15')]();}};}; \ 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 8f32b69..9fb4f90 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 _0xc5ec=['priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','message','join','info','[%s][GOTOP]\x20priority\x20%s'];(function(_0x348860,_0x4531f6){var _0x2fc2ad=function(_0x3b449f){while(--_0x3b449f){_0x348860['push'](_0x348860['shift']());}};_0x2fc2ad(++_0x4531f6);}(_0xc5ec,0x15b));var _0xcc5e=function(_0x526cbd,_0x1313f4){_0x526cbd=_0x526cbd-0x0;var _0x199fc9=_0xc5ec[_0x526cbd];return _0x199fc9;};'use strict';var schema=require(_0xcc5e('0x0'));var _=require('lodash');var logger=require(_0xcc5e('0x1'))(_0xcc5e('0x2'));var gotop=schema({'priority':{'type':_0xcc5e('0x3'),'required':!![],'message':_0xcc5e('0x4')}});exports[_0xcc5e('0x5')]=function(_0x10465d,_0x4b9dad){return function(_0xa2ec71){try{var _0x4eafd5={'priority':_0x4b9dad[0x0]};var _0x37b88a=gotop[_0xcc5e('0x0')](_0x4eafd5,{'typecast':!![]});if(_0x37b88a[_0xcc5e('0x6')]){logger[_0xcc5e('0x7')](_0xcc5e('0x8'),_0x10465d,_['map'](_0x37b88a,_0xcc5e('0x9'))[_0xcc5e('0xa')](',\x20'));_0xa2ec71['stop']();}else{logger[_0xcc5e('0xb')](_0xcc5e('0xc'),_0x10465d,_0x4eafd5[_0xcc5e('0xd')]);if(_0x4eafd5['priority']){var _0x4f9c2e=_[_0xcc5e('0xe')](_0xa2ec71[_0xcc5e('0xf')](),{'p':_0x4eafd5[_0xcc5e('0xd')]});if(_0x4f9c2e>=0x0){logger[_0xcc5e('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x10465d,_0x4eafd5[_0xcc5e('0xd')]||_0xcc5e('0x10'),_0x4f9c2e);_0xa2ec71[_0xcc5e('0x10')](_0x4f9c2e);}else{logger['info'](_0xcc5e('0x11'),_0x10465d,_0x4eafd5['priority']||_0xcc5e('0x10'));_0xa2ec71[_0xcc5e('0x12')]();}}else{_0xa2ec71[_0xcc5e('0x10')]();}}}catch(_0x45959f){logger[_0xcc5e('0x7')](_0xcc5e('0x8'),_0x10465d,JSON[_0xcc5e('0x13')](_0x45959f));_0xa2ec71[_0xcc5e('0x12')]();}};}; \ No newline at end of file +var _0xd4f2=['lodash','../../../../config/logger','routing','number','consequence','length','[%s][GOTOP]\x20%s','map','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','error','stringify','validate'];(function(_0x4cea31,_0x54ef05){var _0x30bf16=function(_0x1530a7){while(--_0x1530a7){_0x4cea31['push'](_0x4cea31['shift']());}};_0x30bf16(++_0x54ef05);}(_0xd4f2,0x167));var _0x2d4f=function(_0x116f3f,_0x46b846){_0x116f3f=_0x116f3f-0x0;var _0x4e68ee=_0xd4f2[_0x116f3f];return _0x4e68ee;};'use strict';var schema=require(_0x2d4f('0x0'));var _=require(_0x2d4f('0x1'));var logger=require(_0x2d4f('0x2'))(_0x2d4f('0x3'));var gotop=schema({'priority':{'type':_0x2d4f('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x2d4f('0x5')]=function(_0x393039,_0x3ad483){return function(_0x16a645){try{var _0x33151f={'priority':_0x3ad483[0x0]};var _0x5b5b1a=gotop[_0x2d4f('0x0')](_0x33151f,{'typecast':!![]});if(_0x5b5b1a[_0x2d4f('0x6')]){logger['error'](_0x2d4f('0x7'),_0x393039,_[_0x2d4f('0x8')](_0x5b5b1a,_0x2d4f('0x9'))[_0x2d4f('0xa')](',\x20'));_0x16a645['stop']();}else{logger[_0x2d4f('0xb')](_0x2d4f('0xc'),_0x393039,_0x33151f['priority']);if(_0x33151f[_0x2d4f('0xd')]){var _0x476c3d=_['findIndex'](_0x16a645[_0x2d4f('0xe')](),{'p':_0x33151f[_0x2d4f('0xd')]});if(_0x476c3d>=0x0){logger[_0x2d4f('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x393039,_0x33151f['priority']||_0x2d4f('0xf'),_0x476c3d);_0x16a645['next'](_0x476c3d);}else{logger[_0x2d4f('0xb')](_0x2d4f('0x10'),_0x393039,_0x33151f['priority']||_0x2d4f('0xf'));_0x16a645[_0x2d4f('0x11')]();}}else{_0x16a645[_0x2d4f('0xf')]();}}}catch(_0x469b56){logger[_0x2d4f('0x12')](_0x2d4f('0x7'),_0x393039,JSON[_0x2d4f('0x13')](_0x469b56));_0x16a645[_0x2d4f('0x11')]();}};}; \ 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 e9270c7..01b24df 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 _0x8fad=['info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','Message','then'];(function(_0x1c8934,_0x21d9ca){var _0x1fe1e8=function(_0x3e55f9){while(--_0x3e55f9){_0x1c8934['push'](_0x1c8934['shift']());}};_0x1fe1e8(++_0x21d9ca);}(_0x8fad,0x11b));var _0xd8fa=function(_0x575a15,_0x2ac0a6){_0x575a15=_0x575a15-0x0;var _0x38e52d=_0x8fad[_0x575a15];return _0x38e52d;};'use strict';var _=require('lodash');var utils=require(_0xd8fa('0x0'));var logger=require(_0xd8fa('0x1'))(_0xd8fa('0x2'));var rpc={'chatMessage':require(_0xd8fa('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xd8fa('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xd8fa('0x5'))};exports[_0xd8fa('0x6')]=function(_0x4b1637,_0x389d53){return function(_0x482ddf){try{var _0x2bc067={'body':utils[_0xd8fa('0x7')](_0x389d53[0x0],this),'ContactId':this[_0xd8fa('0x8')]['id']};if(this[_0xd8fa('0x9')]===_0xd8fa('0xa')){_0x2bc067[_0xd8fa('0xb')]=this['account']['id'];}else{_0x2bc067[_[_0xd8fa('0xc')](this[_0xd8fa('0x9')])+_0xd8fa('0xd')]=this['account']['id'];}_0x2bc067[_[_0xd8fa('0xc')](this[_0xd8fa('0x9')])+_0xd8fa('0xe')]=this['interaction']['id'];if(rpc[this['channel']+_0xd8fa('0xf')]){return rpc[this[_0xd8fa('0x9')]+_0xd8fa('0xf')]['create'](_0x2bc067)[_0xd8fa('0x10')](function(_0x270de0){logger[_0xd8fa('0x11')](_0xd8fa('0x12'),_0x4b1637,_0x2bc067[_0xd8fa('0x13')]);_0x482ddf[_0xd8fa('0x14')]();})[_0xd8fa('0x15')](function(_0x45da04){logger[_0xd8fa('0x16')](_0xd8fa('0x12'),_0x4b1637,JSON[_0xd8fa('0x17')](_0x45da04));_0x482ddf[_0xd8fa('0x18')]();});}}catch(_0x1e47bc){logger[_0xd8fa('0x16')](_0xd8fa('0x12'),_0x4b1637,JSON[_0xd8fa('0x17')](_0x1e47bc));_0x482ddf[_0xd8fa('0x18')]();}};}; \ No newline at end of file +var _0x6c57=['interaction','Message','then','info','[%s][MESSAGE]\x20%s','body','catch','stringify','stop','error','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x6c57,0x76));var _0x76c5=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x6c57[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x76c5('0x0'));var utils=require(_0x76c5('0x1'));var logger=require(_0x76c5('0x2'))(_0x76c5('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x76c5('0x4')),'mailMessage':require(_0x76c5('0x5')),'smsMessage':require(_0x76c5('0x6')),'faxMessage':require(_0x76c5('0x7'))};exports[_0x76c5('0x8')]=function(_0x56d26b,_0x5b609a){return function(_0x7103a){try{var _0x37d3cc={'body':utils[_0x76c5('0x9')](_0x5b609a[0x0],this),'ContactId':this['contact']['id']};if(this[_0x76c5('0xa')]===_0x76c5('0xb')){_0x37d3cc[_0x76c5('0xc')]=this[_0x76c5('0xd')]['id'];}else{_0x37d3cc[_[_0x76c5('0xe')](this[_0x76c5('0xa')])+_0x76c5('0xf')]=this['account']['id'];}_0x37d3cc[_[_0x76c5('0xe')](this[_0x76c5('0xa')])+_0x76c5('0x10')]=this[_0x76c5('0x11')]['id'];if(rpc[this[_0x76c5('0xa')]+_0x76c5('0x12')]){return rpc[this['channel']+'Message']['create'](_0x37d3cc)[_0x76c5('0x13')](function(_0x52b749){logger[_0x76c5('0x14')](_0x76c5('0x15'),_0x56d26b,_0x37d3cc[_0x76c5('0x16')]);_0x7103a['next']();})[_0x76c5('0x17')](function(_0x4834c5){logger['error'](_0x76c5('0x15'),_0x56d26b,JSON[_0x76c5('0x18')](_0x4834c5));_0x7103a[_0x76c5('0x19')]();});}}catch(_0x1c100b){logger[_0x76c5('0x1a')](_0x76c5('0x15'),_0x56d26b,JSON[_0x76c5('0x18')](_0x1c100b));_0x7103a[_0x76c5('0x19')]();}};}; \ 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 08ee6b3..f033c1c 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 _0xf87d=['error','[%s][NOOP]\x20%s','stop','./utils','../../../../config/logger','getMustacheRender','next'];(function(_0x7e172,_0x58ee6e){var _0x23fc6d=function(_0x354ca8){while(--_0x354ca8){_0x7e172['push'](_0x7e172['shift']());}};_0x23fc6d(++_0x58ee6e);}(_0xf87d,0x8f));var _0xdf87=function(_0x3a001a,_0x31333b){_0x3a001a=_0x3a001a-0x0;var _0x501896=_0xf87d[_0x3a001a];return _0x501896;};'use strict';var utils=require(_0xdf87('0x0'));var logger=require(_0xdf87('0x1'))('routing');exports['consequence']=function(_0x3b71d6,_0x52ddc7){return function(_0x299091){try{logger['info']('[%s][NOOP]\x20%s',_0x3b71d6,utils[_0xdf87('0x2')](_0x52ddc7[0x0],this));_0x299091[_0xdf87('0x3')]();}catch(_0x135d8a){logger[_0xdf87('0x4')](_0xdf87('0x5'),_0x3b71d6,JSON['stringify'](_0x135d8a));_0x299091[_0xdf87('0x6')]();}};}; \ No newline at end of file +var _0x4ebd=['next','error','stop','./utils','../../../../config/logger','routing','info','[%s][NOOP]\x20%s'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4ebd,0x7b));var _0xd4eb=function(_0x15d6f5,_0x417e3e){_0x15d6f5=_0x15d6f5-0x0;var _0x1614d2=_0x4ebd[_0x15d6f5];return _0x1614d2;};'use strict';var utils=require(_0xd4eb('0x0'));var logger=require(_0xd4eb('0x1'))(_0xd4eb('0x2'));exports['consequence']=function(_0x4e52f8,_0x31b6a9){return function(_0x370a0e){try{logger[_0xd4eb('0x3')](_0xd4eb('0x4'),_0x4e52f8,utils['getMustacheRender'](_0x31b6a9[0x0],this));_0x370a0e[_0xd4eb('0x5')]();}catch(_0x42f10a){logger[_0xd4eb('0x6')](_0xd4eb('0x4'),_0x4e52f8,JSON['stringify'](_0x42f10a));_0x370a0e[_0xd4eb('0x7')]();}};}; \ 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 c814f05..c1c33f5 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 _0xabaf=['find','Queues','createQueue','atimeout','qtimeout','end','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','stop','validate','lodash','util','seq-queue','moment','ioredis','routing','redis','defaults','socket.io-emitter','queue_id','queue','from','joinAt','emit','account','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','catch','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join'];(function(_0x42db30,_0x328dee){var _0x4a92a5=function(_0x11fd65){while(--_0x11fd65){_0x42db30['push'](_0x42db30['shift']());}};_0x4a92a5(++_0x328dee);}(_0xabaf,0x149));var _0xfaba=function(_0x272118,_0x34089b){_0x272118=_0x272118-0x0;var _0x76f4e6=_0xabaf[_0x272118];return _0x76f4e6;};'use strict';var schema=require(_0xfaba('0x0'));var _=require(_0xfaba('0x1'));var util=require(_0xfaba('0x2'));var seqqueue=require(_0xfaba('0x3'));var moment=require(_0xfaba('0x4'));var Redis=require(_0xfaba('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xfaba('0x6'));var strategy=require('./strategy');config[_0xfaba('0x7')]=_[_0xfaba('0x8')](config[_0xfaba('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xfaba('0x9'))(new Redis(config['redis']));var attributes=['id',_0xfaba('0xa'),'account',_0xfaba('0xb'),_0xfaba('0xc'),_0xfaba('0xd')];function emit(_0xfa1c1c,_0x5ecd0b,_0x4cc8c8){io['to'](_0xfa1c1c)[_0xfaba('0xe')](_0x5ecd0b,_0x4cc8c8);}function emitChannelQueueInteraction(_0x38ea49,_0x2672f3,_0x5a4224,_0x52aa86,_0x4be8c8,_0x30ce35,_0x47c1ae,_0x5bab){_0x5a4224[_0xfaba('0xa')]=_0x5bab;_0x5a4224[_0xfaba('0xb')]=_0x2672f3;_0x5a4224[_0xfaba('0xf')]=_0x52aa86;_0x5a4224['id']=_0x4be8c8;if(_0x30ce35){_0x47c1ae[util[_0xfaba('0x10')]('%sQueuesWaitingInteractions',_0x38ea49)][_0x4be8c8]=_[_0xfaba('0x11')](_0x5a4224,attributes);}else{delete _0x47c1ae[util['format'](_0xfaba('0x12'),_0x38ea49)][_0x4be8c8];}emit(util[_0xfaba('0x10')](_0xfaba('0x13'),_0x38ea49,_0x2672f3),util[_0xfaba('0x10')]('%s_queue_waiting_interaction:%s',_0x38ea49,_0x30ce35?_0xfaba('0x14'):_0xfaba('0x15')),_['pick'](_0x5a4224,attributes));}var rpc={'openchannelQueueReport':require(_0xfaba('0x16')),'mailQueueReport':require(_0xfaba('0x17')),'chatQueueReport':require(_0xfaba('0x18')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport')};var queue=schema({'name':{'type':_0xfaba('0x19'),'required':!![],'message':_0xfaba('0x1a')},'timeout':{'type':_0xfaba('0x1b'),'message':_0xfaba('0x1c')}});function startRouting(_0x252ac6,_0x46b520,_0x153200,_0x1fa21c){if(_0x252ac6&&_0x46b520&&_0x153200){_0x46b520['waiting']+=0x1;var _0x52aca2={'uniqueid':_0x252ac6,'from':_0x153200[_0xfaba('0x1d')]?_0x153200[_0xfaba('0x1d')]['from']:'','joinAt':moment()['format'](_0xfaba('0x1e')),'ContactId':_0x153200[_0xfaba('0x1f')]?_0x153200[_0xfaba('0x1f')]['id']:null,'ListId':_0x153200[_0xfaba('0x20')]?_0x153200[_0xfaba('0x20')]['id']:null};_0x52aca2[_[_0xfaba('0x21')](_0x153200[_0xfaba('0x22')])+'QueueId']=_0x46b520['id']||null;_0x52aca2[_[_0xfaba('0x21')](_0x153200[_0xfaba('0x22')])+_0xfaba('0x23')]=_0x153200['interaction']?_0x153200[_0xfaba('0x24')]['id']:null;_0x52aca2[_[_0xfaba('0x21')](_0x153200[_0xfaba('0x22')])+_0xfaba('0x25')]=_0x153200[_0xfaba('0x26')]?_0x153200[_0xfaba('0x26')]['id']:null;_0x52aca2[_[_0xfaba('0x21')](_0x153200[_0xfaba('0x22')])+(_0x153200[_0xfaba('0x22')]!==_0xfaba('0x27')?_0xfaba('0x28'):_0xfaba('0x29'))]=_0x153200[_0xfaba('0xf')]?_0x153200[_0xfaba('0xf')]['id']:null;logger[_0xfaba('0x2a')](util[_0xfaba('0x10')](_0xfaba('0x2b'),_0x252ac6,_0x46b520[_0xfaba('0x2c')]));emitChannelQueueInteraction(_0x153200['channel'],_0x46b520[_0xfaba('0x2c')],_0x52aca2,_0x153200['account'][_0xfaba('0x2c')],_0x153200[_0xfaba('0x26')]['id'],!![],_0x1fa21c,_0x46b520['id']);if(rpc[_0x153200[_0xfaba('0x22')]+'QueueReport']){return rpc[_0x153200[_0xfaba('0x22')]+_0xfaba('0x2d')][_0xfaba('0x2e')](_0x52aca2)['catch'](function(_0x3578b2){logger[_0xfaba('0x2f')](_0xfaba('0x30'));});}}}function stopRouting(_0x33e72f,_0x138a23,_0x4f55a8,_0x175b48){if(_0x33e72f&&_0x138a23){_0x138a23[_0xfaba('0x31')]-=0x1;var _0x5cff0c={'leaveAt':moment()[_0xfaba('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xfaba('0x10')](_0xfaba('0x1e')),'reason':_0xfaba('0x32')};logger[_0xfaba('0x2a')](util[_0xfaba('0x10')](_0xfaba('0x33'),_0x33e72f,_0x138a23['name']));emitChannelQueueInteraction(_0x4f55a8[_0xfaba('0x22')],_0x138a23['name'],_0x4f55a8['body'],_0x4f55a8[_0xfaba('0xf')]['name'],_0x4f55a8[_0xfaba('0x26')]['id'],![],_0x175b48,_0x138a23['id']);if(rpc[_0x4f55a8[_0xfaba('0x22')]+'QueueReport']){return rpc[_0x4f55a8[_0xfaba('0x22')]+'QueueReport'][_0xfaba('0x34')](_0x33e72f,_0x5cff0c)['catch'](function(_0x9a86f){logger['error'](_0xfaba('0x35'));});}}}function endRouting(_0x11107b,_0x1217d1,_0x2d8868,_0xbb76f8){if(_0x11107b&&_0x1217d1){_0x1217d1[_0xfaba('0x31')]-=0x1;var _0x294eba={'leaveAt':moment()[_0xfaba('0x10')](_0xfaba('0x1e')),'exitAt':moment()['format'](_0xfaba('0x1e')),'reason':_0xfaba('0x36')};logger[_0xfaba('0x2a')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x11107b,_0x1217d1['name']));emitChannelQueueInteraction(_0x2d8868[_0xfaba('0x22')],_0x1217d1[_0xfaba('0x2c')],_0x2d8868[_0xfaba('0x1d')],_0x2d8868['account'][_0xfaba('0x2c')],_0x2d8868[_0xfaba('0x26')]['id'],![],_0xbb76f8);if(rpc[_0x2d8868[_0xfaba('0x22')]+_0xfaba('0x2d')]){return rpc[_0x2d8868[_0xfaba('0x22')]+_0xfaba('0x2d')][_0xfaba('0x34')](_0x11107b,_0x294eba)[_0xfaba('0x37')](function(_0x4e5c88){logger[_0xfaba('0x2f')](_0xfaba('0x35'));});}}}function handleFindQueue(_0x2934c5){return function(_0x277e94){return _0x277e94[_0xfaba('0x2c')][_0xfaba('0x38')]()===_0x2934c5[_0xfaba('0x38')]();};}exports[_0xfaba('0x39')]=function(_0x145131,_0x1032c8,_0x55c3f5,_0x364920){return function(_0x1c5723){try{var _0x313dd7={'name':_0x1032c8[0x0],'timeout':_0x1032c8[0x1]};var _0xe5da7d=queue[_0xfaba('0x0')](_0x313dd7,{'typecast':!![]});if(_0xe5da7d[_0xfaba('0x3a')]){logger[_0xfaba('0x2f')](_0xfaba('0x3b'),_0x145131,_['map'](_0xe5da7d,_0xfaba('0x26'))[_0xfaba('0x3c')](',\x20'));_0x1c5723['stop']();}else{var _0x301c16=_[_0xfaba('0x3d')](_0x55c3f5[_0x364920[_0xfaba('0x22')]+_0xfaba('0x3e')],handleFindQueue(_0x313dd7[_0xfaba('0x2c')]));if(_0x301c16){startRouting(_0x145131,_0x301c16,_0x364920,_0x55c3f5);var _0x586bc8=(_0x301c16[_0xfaba('0x36')]||0xa)*0x3e8;var _0x4018ab=(_0x313dd7[_0xfaba('0x36')]||0x14)*0x3e8;var _0x5b54cf,_0x41b696;if(_0x586bc8>_0x4018ab){_0x4018ab=_0x586bc8;}var _0x2dad16=seqqueue[_0xfaba('0x3f')](_0x586bc8);_0x2dad16['id']=_0x145131;_0x2dad16[_0xfaba('0x40')]=_0x586bc8;_0x2dad16[_0xfaba('0x41')]=_0x4018ab;_0x2dad16[_0xfaba('0x22')]=_0x364920[_0xfaba('0x22')];_0x55c3f5['rules'][_0x145131]['on'](_0xfaba('0x42'),function(){stopRouting(_0x145131,_0x301c16,_0x364920,_0x55c3f5);_0x2dad16['close'](!![]);clearTimeout(_0x5b54cf);_0x5b54cf=undefined;if(_0x55c3f5[_0xfaba('0x43')][_0x145131]){delete _0x55c3f5[_0xfaba('0x43')][_0x145131];}logger[_0xfaba('0x2a')](_0xfaba('0x44'),_0x145131);_0x1c5723['stop']();});_0x5b54cf=setTimeout(function(){endRouting(_0x145131,_0x301c16,_0x364920,_0x55c3f5);clearTimeout(_0x5b54cf);_0x2dad16[_0xfaba('0x45')](!![]);logger[_0xfaba('0x2a')]('[%s][QUEUE]\x20ROUTING\x20END',_0x145131);_0x1c5723[_0xfaba('0x46')]();},_0x4018ab);switch(_0x301c16[_0xfaba('0x47')]){case'rrmemory':strategy[_0xfaba('0x48')](_0x2dad16,_0x301c16,_0x55c3f5,_0x364920);break;default:strategy[_0xfaba('0x49')](_0x2dad16,_0x301c16,_0x55c3f5,_0x364920);}}else{logger['error'](_0xfaba('0x4a'),_0x145131,_0x313dd7[_0xfaba('0x2c')]);_0x1c5723['stop']();}}}catch(_0x50863a){console[_0xfaba('0x4b')](_0x50863a);logger[_0xfaba('0x2f')](_0xfaba('0x3b'),_0x145131,_0x50863a[_0xfaba('0x4c')]);_0x1c5723[_0xfaba('0x4d')]();}};}; \ No newline at end of file +var _0x1c28=['%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','upperFirst','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','error','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','timeout','createQueue','qtimeout','rules','close','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','beepall','log','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','account','from','joinAt','emit','queue_id','queue','format'];(function(_0x54d6a8,_0xc7baae){var _0x4ff991=function(_0x4713e7){while(--_0x4713e7){_0x54d6a8['push'](_0x54d6a8['shift']());}};_0x4ff991(++_0xc7baae);}(_0x1c28,0x168));var _0x81c2=function(_0x57d9b9,_0x365eb6){_0x57d9b9=_0x57d9b9-0x0;var _0x3e682f=_0x1c28[_0x57d9b9];return _0x3e682f;};'use strict';var schema=require(_0x81c2('0x0'));var _=require(_0x81c2('0x1'));var util=require(_0x81c2('0x2'));var seqqueue=require(_0x81c2('0x3'));var moment=require(_0x81c2('0x4'));var Redis=require(_0x81c2('0x5'));var config=require('../../../../config/environment');var logger=require(_0x81c2('0x6'))(_0x81c2('0x7'));var strategy=require(_0x81c2('0x8'));config[_0x81c2('0x9')]=_[_0x81c2('0xa')](config[_0x81c2('0x9')],{'host':_0x81c2('0xb'),'port':0x18eb});var io=require(_0x81c2('0xc'))(new Redis(config[_0x81c2('0x9')]));var attributes=['id','queue_id',_0x81c2('0xd'),'queue',_0x81c2('0xe'),_0x81c2('0xf')];function emit(_0x31ecff,_0xa31a11,_0x303f55){io['to'](_0x31ecff)[_0x81c2('0x10')](_0xa31a11,_0x303f55);}function emitChannelQueueInteraction(_0x4b9a93,_0x5ec375,_0x5cf1e1,_0x463100,_0x3c5dd1,_0x1fb421,_0x1a3922,_0x27ebd0){_0x5cf1e1[_0x81c2('0x11')]=_0x27ebd0;_0x5cf1e1[_0x81c2('0x12')]=_0x5ec375;_0x5cf1e1[_0x81c2('0xd')]=_0x463100;_0x5cf1e1['id']=_0x3c5dd1;if(_0x1fb421){_0x1a3922[util[_0x81c2('0x13')](_0x81c2('0x14'),_0x4b9a93)][_0x3c5dd1]=_[_0x81c2('0x15')](_0x5cf1e1,attributes);}else{delete _0x1a3922[util['format'](_0x81c2('0x14'),_0x4b9a93)][_0x3c5dd1];}emit(util[_0x81c2('0x13')](_0x81c2('0x16'),_0x4b9a93,_0x5ec375),util['format'](_0x81c2('0x17'),_0x4b9a93,_0x1fb421?'save':'remove'),_[_0x81c2('0x15')](_0x5cf1e1,attributes));}var rpc={'openchannelQueueReport':require(_0x81c2('0x18')),'mailQueueReport':require(_0x81c2('0x19')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x81c2('0x1a')),'faxQueueReport':require(_0x81c2('0x1b'))};var queue=schema({'name':{'type':_0x81c2('0x1c'),'required':!![],'message':_0x81c2('0x1d')},'timeout':{'type':_0x81c2('0x1e'),'message':_0x81c2('0x1f')}});function startRouting(_0x49a02c,_0x2a5dbc,_0x2f9222,_0x17b5b3){if(_0x49a02c&&_0x2a5dbc&&_0x2f9222){_0x2a5dbc['waiting']+=0x1;var _0x355a4c={'uniqueid':_0x49a02c,'from':_0x2f9222['body']?_0x2f9222[_0x81c2('0x20')]['from']:'','joinAt':moment()[_0x81c2('0x13')](_0x81c2('0x21')),'ContactId':_0x2f9222[_0x81c2('0x22')]?_0x2f9222['contact']['id']:null,'ListId':_0x2f9222[_0x81c2('0x23')]?_0x2f9222[_0x81c2('0x23')]['id']:null};_0x355a4c[_['upperFirst'](_0x2f9222[_0x81c2('0x24')])+'QueueId']=_0x2a5dbc['id']||null;_0x355a4c[_[_0x81c2('0x25')](_0x2f9222[_0x81c2('0x24')])+_0x81c2('0x26')]=_0x2f9222[_0x81c2('0x27')]?_0x2f9222[_0x81c2('0x27')]['id']:null;_0x355a4c[_[_0x81c2('0x25')](_0x2f9222[_0x81c2('0x24')])+_0x81c2('0x28')]=_0x2f9222[_0x81c2('0x29')]?_0x2f9222[_0x81c2('0x29')]['id']:null;_0x355a4c[_[_0x81c2('0x25')](_0x2f9222['channel'])+(_0x2f9222[_0x81c2('0x24')]!==_0x81c2('0x2a')?_0x81c2('0x2b'):_0x81c2('0x2c'))]=_0x2f9222[_0x81c2('0xd')]?_0x2f9222[_0x81c2('0xd')]['id']:null;logger[_0x81c2('0x2d')](util['format'](_0x81c2('0x2e'),_0x49a02c,_0x2a5dbc[_0x81c2('0x2f')]));emitChannelQueueInteraction(_0x2f9222[_0x81c2('0x24')],_0x2a5dbc[_0x81c2('0x2f')],_0x355a4c,_0x2f9222[_0x81c2('0xd')][_0x81c2('0x2f')],_0x2f9222[_0x81c2('0x29')]['id'],!![],_0x17b5b3,_0x2a5dbc['id']);if(rpc[_0x2f9222[_0x81c2('0x24')]+'QueueReport']){return rpc[_0x2f9222[_0x81c2('0x24')]+_0x81c2('0x30')]['create'](_0x355a4c)[_0x81c2('0x31')](function(_0xaa4b18){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0xaa5c77,_0x303e61,_0x39d586,_0x5481ef){if(_0xaa5c77&&_0x303e61){_0x303e61['waiting']-=0x1;var _0x5f4ece={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x81c2('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x81c2('0x32')};logger[_0x81c2('0x2d')](util[_0x81c2('0x13')](_0x81c2('0x33'),_0xaa5c77,_0x303e61['name']));emitChannelQueueInteraction(_0x39d586[_0x81c2('0x24')],_0x303e61['name'],_0x39d586['body'],_0x39d586[_0x81c2('0xd')]['name'],_0x39d586['message']['id'],![],_0x5481ef,_0x303e61['id']);if(rpc[_0x39d586[_0x81c2('0x24')]+_0x81c2('0x30')]){return rpc[_0x39d586[_0x81c2('0x24')]+_0x81c2('0x30')][_0x81c2('0x34')](_0xaa5c77,_0x5f4ece)['catch'](function(_0x4dff41){logger['error'](_0x81c2('0x35'));});}}}function endRouting(_0x1a9886,_0x30bb7c,_0x140c93,_0x3b2854){if(_0x1a9886&&_0x30bb7c){_0x30bb7c['waiting']-=0x1;var _0x17febe={'leaveAt':moment()[_0x81c2('0x13')](_0x81c2('0x21')),'exitAt':moment()[_0x81c2('0x13')](_0x81c2('0x21')),'reason':'timeout'};logger[_0x81c2('0x2d')](util[_0x81c2('0x13')](_0x81c2('0x36'),_0x1a9886,_0x30bb7c[_0x81c2('0x2f')]));emitChannelQueueInteraction(_0x140c93[_0x81c2('0x24')],_0x30bb7c[_0x81c2('0x2f')],_0x140c93[_0x81c2('0x20')],_0x140c93['account']['name'],_0x140c93[_0x81c2('0x29')]['id'],![],_0x3b2854);if(rpc[_0x140c93[_0x81c2('0x24')]+_0x81c2('0x30')]){return rpc[_0x140c93['channel']+_0x81c2('0x30')]['update'](_0x1a9886,_0x17febe)[_0x81c2('0x31')](function(_0x9a740f){logger['error'](_0x81c2('0x35'));});}}}function handleFindQueue(_0x5cfa0d){return function(_0x37b043){return _0x37b043[_0x81c2('0x2f')][_0x81c2('0x37')]()===_0x5cfa0d[_0x81c2('0x37')]();};}exports[_0x81c2('0x38')]=function(_0x1dd30e,_0x38d919,_0x142397,_0x2c82db){return function(_0x113cfb){try{var _0x198d2d={'name':_0x38d919[0x0],'timeout':_0x38d919[0x1]};var _0x17cdef=queue[_0x81c2('0x0')](_0x198d2d,{'typecast':!![]});if(_0x17cdef[_0x81c2('0x39')]){logger[_0x81c2('0x3a')](_0x81c2('0x3b'),_0x1dd30e,_[_0x81c2('0x3c')](_0x17cdef,_0x81c2('0x29'))[_0x81c2('0x3d')](',\x20'));_0x113cfb[_0x81c2('0x3e')]();}else{var _0x2e4a96=_[_0x81c2('0x3f')](_0x142397[_0x2c82db['channel']+_0x81c2('0x40')],handleFindQueue(_0x198d2d[_0x81c2('0x2f')]));if(_0x2e4a96){startRouting(_0x1dd30e,_0x2e4a96,_0x2c82db,_0x142397);var _0x55f3fd=(_0x2e4a96[_0x81c2('0x41')]||0xa)*0x3e8;var _0x166628=(_0x198d2d[_0x81c2('0x41')]||0x14)*0x3e8;var _0x4ca047,_0x35cbf;if(_0x55f3fd>_0x166628){_0x166628=_0x55f3fd;}var _0x2c6305=seqqueue[_0x81c2('0x42')](_0x55f3fd);_0x2c6305['id']=_0x1dd30e;_0x2c6305['atimeout']=_0x55f3fd;_0x2c6305[_0x81c2('0x43')]=_0x166628;_0x2c6305[_0x81c2('0x24')]=_0x2c82db[_0x81c2('0x24')];_0x142397[_0x81c2('0x44')][_0x1dd30e]['on']('end',function(){stopRouting(_0x1dd30e,_0x2e4a96,_0x2c82db,_0x142397);_0x2c6305[_0x81c2('0x45')](!![]);clearTimeout(_0x4ca047);_0x4ca047=undefined;if(_0x142397[_0x81c2('0x44')][_0x1dd30e]){delete _0x142397['rules'][_0x1dd30e];}logger[_0x81c2('0x2d')](_0x81c2('0x46'),_0x1dd30e);_0x113cfb[_0x81c2('0x3e')]();});_0x4ca047=setTimeout(function(){endRouting(_0x1dd30e,_0x2e4a96,_0x2c82db,_0x142397);clearTimeout(_0x4ca047);_0x2c6305[_0x81c2('0x45')](!![]);logger[_0x81c2('0x2d')](_0x81c2('0x47'),_0x1dd30e);_0x113cfb[_0x81c2('0x48')]();},_0x166628);switch(_0x2e4a96[_0x81c2('0x49')]){case'rrmemory':strategy['rrmemory'](_0x2c6305,_0x2e4a96,_0x142397,_0x2c82db);break;default:strategy[_0x81c2('0x4a')](_0x2c6305,_0x2e4a96,_0x142397,_0x2c82db);}}else{logger[_0x81c2('0x3a')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x1dd30e,_0x198d2d['name']);_0x113cfb['stop']();}}}catch(_0x54fe76){console[_0x81c2('0x4b')](_0x54fe76);logger[_0x81c2('0x3a')](_0x81c2('0x3b'),_0x1dd30e,_0x54fe76['stack']);_0x113cfb[_0x81c2('0x3e')]();}};}; \ 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 54bba5c..1750931 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 _0x1d12=['agent','realtime','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','RINGING','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue'];(function(_0x321df4,_0x3efec5){var _0x50d06c=function(_0x3ac0f4){while(--_0x3ac0f4){_0x321df4['push'](_0x321df4['shift']());}};_0x50d06c(++_0x3efec5);}(_0x1d12,0x79));var _0x21d1=function(_0x16533b,_0x3a7c98){_0x16533b=_0x16533b-0x0;var _0x5281fb=_0x1d12[_0x16533b];return _0x5281fb;};'use strict';var _=require(_0x21d1('0x0'));var uuid=require(_0x21d1('0x1'));var util=require(_0x21d1('0x2'));var logger=require(_0x21d1('0x3'))(_0x21d1('0x4'));var Agent=function(_0x5615cd,_0x39b7fb,_0x4f845b,_0x20184d){this[_0x21d1('0x5')]=uuid['v4']();this[_0x21d1('0x6')]=_0x5615cd;this[_0x21d1('0x7')]=_0x39b7fb;this[_0x21d1('0x8')]=_0x4f845b;this['routing']=_0x20184d;this[_0x21d1('0x6')][_0x21d1('0x9')](this[_0x21d1('0xa')][_0x21d1('0xb')](this),this[_0x21d1('0xc')]['bind'](this));this[_0x21d1('0x6')]['on']('timeout',this[_0x21d1('0xc')][_0x21d1('0xb')](this));this['squeue']['on'](_0x21d1('0xd'),this[_0x21d1('0xe')]['bind'](this));};Agent[_0x21d1('0xf')]['push']=function(){this[_0x21d1('0x6')][_0x21d1('0x9')](this[_0x21d1('0xa')][_0x21d1('0xb')](this),this[_0x21d1('0xc')][_0x21d1('0xb')](this));};Agent[_0x21d1('0xf')]['handleDrained']=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0x21d1('0xa')]=function(_0x58989a){logger[_0x21d1('0x10')](_0x21d1('0x11'),this[_0x21d1('0x6')]['id'],this[_0x21d1('0x7')]['id']);if(_[_0x21d1('0x12')](this[_0x21d1('0x8')][_0x21d1('0x13')][this['agent']['id']])){logger[_0x21d1('0x10')](_0x21d1('0x14'),this[_0x21d1('0x6')]['id'],this[_0x21d1('0x7')]['id']);setTimeout(this[_0x21d1('0x9')][_0x21d1('0xb')](this),0x3e8);}else{if(this[_0x21d1('0x4')][_0x21d1('0x15')]||util[_0x21d1('0x16')](this['squeue']['id'],this[_0x21d1('0x8')][_0x21d1('0x13')][this[_0x21d1('0x7')]['id']],this[_0x21d1('0x6')][_0x21d1('0x17')],![])){this[_0x21d1('0x8')][_0x21d1('0x13')][this[_0x21d1('0x7')]['id']][_0x21d1('0x18')]=!![];this['realtime'][_0x21d1('0x13')][this[_0x21d1('0x7')]['id']][_0x21d1('0x19')]=undefined;util[_0x21d1('0x1a')](this[_0x21d1('0x5')],this[_0x21d1('0x6')]['id'],this[_0x21d1('0x8')][_0x21d1('0x13')][this[_0x21d1('0x7')]['id']],null,this[_0x21d1('0x4')]);util['writeLog'](this[_0x21d1('0x6')]['id'],this[_0x21d1('0x8')][_0x21d1('0x13')][this['agent']['id']],_0x21d1('0x1b')+(this[_0x21d1('0x4')]['forcedOwnership']?':FORCED':''));}else{logger[_0x21d1('0x10')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x21d1('0x6')]['id'],this[_0x21d1('0x7')]['id']);setTimeout(this[_0x21d1('0x9')][_0x21d1('0xb')](this),0x3e8);}}};Agent[_0x21d1('0xf')][_0x21d1('0xc')]=function(_0x2cfd12){if(_[_0x21d1('0x12')](this[_0x21d1('0x8')][_0x21d1('0x13')][this[_0x21d1('0x7')]['id']])){return logger[_0x21d1('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x21d1('0x6')]['id'],this[_0x21d1('0x7')]['id']);}else{logger[_0x21d1('0x10')](_0x21d1('0x1c'),this['squeue']['id'],this[_0x21d1('0x7')]['id']);util[_0x21d1('0x1d')](this[_0x21d1('0x5')],this[_0x21d1('0x6')]['id'],this['realtime'][_0x21d1('0x13')][this[_0x21d1('0x7')]['id']],null,this['routing']);this[_0x21d1('0x8')][_0x21d1('0x13')][this[_0x21d1('0x7')]['id']][_0x21d1('0x18')]=![];this[_0x21d1('0x8')]['agents'][this[_0x21d1('0x7')]['id']]['busyQueue']=undefined;util['writeLog'](this[_0x21d1('0x6')]['id'],this[_0x21d1('0x8')][_0x21d1('0x13')][this[_0x21d1('0x7')]['id']],_0x2cfd12?'STOP':_0x21d1('0x1e'));}if(!_0x2cfd12){setTimeout(this[_0x21d1('0x9')][_0x21d1('0xb')](this),0x3e8);}};function agent(_0x569861,_0x87889b,_0x22d6e0,_0x410cec){return new Agent(_0x569861,_0x87889b,_0x22d6e0,_0x410cec);}module[_0x21d1('0x1f')]=agent; \ No newline at end of file +var _0xa080=['lodash','uuid','./util','squeue','agent','realtime','routing','push','handleRun','handleTimeout','bind','drained','handleDrained','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','busy','busyQueue','showNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','prototype','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa080,0x12c));var _0x0a08=function(_0x17854e,_0x4ecf36){_0x17854e=_0x17854e-0x0;var _0x23707d=_0xa080[_0x17854e];return _0x23707d;};'use strict';var _=require(_0x0a08('0x0'));var uuid=require(_0x0a08('0x1'));var util=require(_0x0a08('0x2'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x3e0b0a,_0x415355,_0x4e01a3,_0x40bd77){this['notificationId']=uuid['v4']();this[_0x0a08('0x3')]=_0x3e0b0a;this[_0x0a08('0x4')]=_0x415355;this[_0x0a08('0x5')]=_0x4e01a3;this[_0x0a08('0x6')]=_0x40bd77;this[_0x0a08('0x3')][_0x0a08('0x7')](this[_0x0a08('0x8')]['bind'](this),this[_0x0a08('0x9')][_0x0a08('0xa')](this));this['squeue']['on']('timeout',this[_0x0a08('0x9')][_0x0a08('0xa')](this));this[_0x0a08('0x3')]['on'](_0x0a08('0xb'),this[_0x0a08('0xc')][_0x0a08('0xa')](this));};Agent['prototype'][_0x0a08('0x7')]=function(){this[_0x0a08('0x3')][_0x0a08('0x7')](this[_0x0a08('0x8')]['bind'](this),this[_0x0a08('0x9')]['bind'](this));};Agent['prototype'][_0x0a08('0xc')]=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0x0a08('0x8')]=function(_0x76e5ee){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this['squeue']['id'],this[_0x0a08('0x4')]['id']);if(_[_0x0a08('0xd')](this[_0x0a08('0x5')][_0x0a08('0xe')][this[_0x0a08('0x4')]['id']])){logger[_0x0a08('0xf')](_0x0a08('0x10'),this['squeue']['id'],this[_0x0a08('0x4')]['id']);setTimeout(this[_0x0a08('0x7')][_0x0a08('0xa')](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util[_0x0a08('0x11')](this[_0x0a08('0x3')]['id'],this[_0x0a08('0x5')]['agents'][this[_0x0a08('0x4')]['id']],this[_0x0a08('0x3')]['channel'],![])){this[_0x0a08('0x5')][_0x0a08('0xe')][this[_0x0a08('0x4')]['id']][_0x0a08('0x12')]=!![];this[_0x0a08('0x5')][_0x0a08('0xe')][this[_0x0a08('0x4')]['id']][_0x0a08('0x13')]=undefined;util[_0x0a08('0x14')](this['notificationId'],this[_0x0a08('0x3')]['id'],this[_0x0a08('0x5')][_0x0a08('0xe')][this[_0x0a08('0x4')]['id']],null,this['routing']);util[_0x0a08('0x15')](this[_0x0a08('0x3')]['id'],this['realtime'][_0x0a08('0xe')][this[_0x0a08('0x4')]['id']],_0x0a08('0x16')+(this['routing']['forcedOwnership']?':FORCED':''));}else{logger[_0x0a08('0xf')](_0x0a08('0x17'),this[_0x0a08('0x3')]['id'],this[_0x0a08('0x4')]['id']);setTimeout(this[_0x0a08('0x7')][_0x0a08('0xa')](this),0x3e8);}}};Agent[_0x0a08('0x18')][_0x0a08('0x9')]=function(_0x57c75e){if(_[_0x0a08('0xd')](this[_0x0a08('0x5')]['agents'][this['agent']['id']])){return logger[_0x0a08('0xf')](_0x0a08('0x10'),this[_0x0a08('0x3')]['id'],this[_0x0a08('0x4')]['id']);}else{logger['info'](_0x0a08('0x19'),this['squeue']['id'],this['agent']['id']);util[_0x0a08('0x1a')](this['notificationId'],this[_0x0a08('0x3')]['id'],this[_0x0a08('0x5')]['agents'][this[_0x0a08('0x4')]['id']],null,this[_0x0a08('0x6')]);this[_0x0a08('0x5')]['agents'][this[_0x0a08('0x4')]['id']][_0x0a08('0x12')]=![];this['realtime']['agents'][this['agent']['id']][_0x0a08('0x13')]=undefined;util[_0x0a08('0x15')](this[_0x0a08('0x3')]['id'],this[_0x0a08('0x5')][_0x0a08('0xe')][this['agent']['id']],_0x57c75e?_0x0a08('0x1b'):_0x0a08('0x1c'));}if(!_0x57c75e){setTimeout(this[_0x0a08('0x7')][_0x0a08('0xa')](this),0x3e8);}};function agent(_0x3b5327,_0x4f1ecc,_0x2e688b,_0x2ac898){return new Agent(_0x3b5327,_0x4f1ecc,_0x2e688b,_0x2ac898);}module[_0x0a08('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 4deacc4..ffa8dbc 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 _0x5b61=['showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','TIMEOUT','busyQueue','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','queue','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','Agents','length','agents','info','isAgentAvailable','realtime','channel','writeLog','RINGING','busy','name'];(function(_0x1d8b12,_0x3b6c03){var _0xa4fd46=function(_0x25d1af){while(--_0x25d1af){_0x1d8b12['push'](_0x1d8b12['shift']());}};_0xa4fd46(++_0x3b6c03);}(_0x5b61,0x1b9));var _0x15b6=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x5b61[_0x1762b4];return _0x29beda;};'use strict';var _=require(_0x15b6('0x0'));var uuid=require(_0x15b6('0x1'));var util=require(_0x15b6('0x2'));var logger=require(_0x15b6('0x3'))('routing');var Beepall=function(_0x20913c,_0x10c517,_0x2716e5,_0x587ae8){this[_0x15b6('0x4')]=uuid['v4']();this[_0x15b6('0x5')]=_0x20913c;this[_0x15b6('0x6')]=_0x10c517;this['realtime']=_0x2716e5;this['routing']=_0x587ae8;this['squeue'][_0x15b6('0x7')](this[_0x15b6('0x8')][_0x15b6('0x9')](this),this[_0x15b6('0xa')][_0x15b6('0x9')](this));this[_0x15b6('0x5')]['on'](_0x15b6('0xb'),this['handleTimeout'][_0x15b6('0x9')](this));this[_0x15b6('0x5')]['on'](_0x15b6('0xc'),this[_0x15b6('0xd')][_0x15b6('0x9')](this));};Beepall[_0x15b6('0xe')][_0x15b6('0x7')]=function(){this[_0x15b6('0x5')][_0x15b6('0x7')](this[_0x15b6('0x8')][_0x15b6('0x9')](this),this[_0x15b6('0xa')][_0x15b6('0x9')](this));};Beepall[_0x15b6('0xe')][_0x15b6('0xd')]=function(_0xda021f){this[_0x15b6('0xa')](!![]);};Beepall['prototype'][_0x15b6('0x8')]=function(_0x25e542){var _0x2e4234=!![];if(!_[_0x15b6('0xf')](this[_0x15b6('0x6')])&&!_['isNil'](this[_0x15b6('0x6')][_0x15b6('0x10')])&&this['queue']['Agents'][_0x15b6('0x11')]>0x0){for(var _0x575eee=0x0,_0x40296f;_0x575eee0x0){for(var _0x32361f=0x0,_0x41fbaf;_0x32361f0x0&&_0x1669ba[_0xa68fdb+_0x4aed('0x23')]>=_0x1669ba[_0xa68fdb+_0x4aed('0x22')]){writeLog(_0x225e1b,_0x1669ba,_0xa68fdb['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x4aed('0x24')]=function(_0x137eab,_0x531c69,_0x2d6285,_0x1ac50a,_0x620f5f){return sendNotification(!![],_0x137eab,_0x531c69,_0x2d6285,_0x1ac50a,_0x620f5f);};exports[_0x4aed('0x25')]=function(_0x4ddb09,_0x565130,_0x552135,_0x26eaa7,_0x3cc911){return sendNotification(![],_0x4ddb09,_0x565130,_0x552135,_0x26eaa7,_0x3cc911);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x8581=['routing','redis','defaults','localhost','socket.io-emitter','user:%s','name','emit','user:save','split','\x20interaction','account','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','message','notification:%s','save','info','isAgentAvailable','busy','BUSY','online','OFFLINE','PAUSE','CurrentCapacity','Capacity','toUpperCase','hideNotification','writeLog','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger'];(function(_0x5cb413,_0x41173d){var _0x43e004=function(_0x4f8c2a){while(--_0x4f8c2a){_0x5cb413['push'](_0x5cb413['shift']());}};_0x43e004(++_0x41173d);}(_0x8581,0x163));var _0x1858=function(_0x3dd3bc,_0x32950b){_0x3dd3bc=_0x3dd3bc-0x0;var _0x172373=_0x8581[_0x3dd3bc];return _0x172373;};'use strict';var _=require('lodash');var util=require(_0x1858('0x0'));var utils=require(_0x1858('0x1'));var Mustache=require('mustache');var Redis=require(_0x1858('0x2'));var config=require(_0x1858('0x3'));var logger=require(_0x1858('0x4'))(_0x1858('0x5'));config[_0x1858('0x6')]=_[_0x1858('0x7')](config[_0x1858('0x6')],{'host':_0x1858('0x8'),'port':0x18eb});var io=require(_0x1858('0x9'))(new Redis(config[_0x1858('0x6')]));function emit(_0x3fcb0b,_0x1d4663,_0x3c0f4c){io['to'](_0x3fcb0b)['emit'](_0x1d4663,_0x3c0f4c);}function sendNotification(_0x39a962,_0x132865,_0x14a55a,_0x569366,_0x5e63a9,_0x42c6f4){io['to'](util['format'](_0x1858('0xa'),_0x569366[_0x1858('0xb')]))[_0x1858('0xc')](_0x1858('0xd'),_0x569366);var _0x54399a=_0x42c6f4||{};var _0x161799=_0x14a55a[_0x1858('0xe')]('.');var _0x1552af={'uniqueid':_0x132865,'channel':_0x161799[0x0],'id':_0x161799[0x1],'title':_0x161799[0x0]+_0x1858('0xf'),'interactionId':_0x161799[0x2],'queue':_0x5e63a9?_0x5e63a9[_0x1858('0xb')]:null,'sound':_0x54399a[_0x1858('0x10')]['notificationSound'],'shake':_0x54399a['account']['notificationShake']};try{if(!_0x54399a['body']){_0x54399a['body']={};}if(_0x5e63a9){_0x54399a['body'][_0x1858('0x11')]=_0x5e63a9;}else if(_0x54399a['body']['queue']){delete _0x54399a['body'][_0x1858('0x11')];}_0x1552af[_0x1858('0x12')]=utils[_0x1858('0x13')](_0x54399a[_0x1858('0x10')][_0x1858('0x14')],_0x54399a);}catch(_0x476a1f){_0x1552af['msg']=_0x1858('0x15');logger[_0x1858('0x16')](util[_0x1858('0x17')](_0x1858('0x18'),_0x132865,_0x476a1f[_0x1858('0x19')]));}io['to'](util[_0x1858('0x17')]('user:%s',_0x569366[_0x1858('0xb')]))[_0x1858('0xc')](util[_0x1858('0x17')](_0x1858('0x1a'),_0x39a962?_0x1858('0x1b'):'remove'),_0x1552af);}function writeLog(_0x4defea,_0x5281be,_0x233e97){return logger[_0x1858('0x1c')](util[_0x1858('0x17')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x4defea,_0x5281be[_0x1858('0xb')],_0x233e97));}exports[_0x1858('0x1d')]=function(_0x196536,_0x2f99f4,_0x388ffe,_0x5f25a8){if(_0x2f99f4[_0x1858('0x1e')]){writeLog(_0x196536,_0x2f99f4,_0x1858('0x1f'));return![];}if(!_0x2f99f4[_0x1858('0x20')]){writeLog(_0x196536,_0x2f99f4,_0x1858('0x21'));return![];}if(_0x2f99f4[_0x388ffe+'Pause']){writeLog(_0x196536,_0x2f99f4,_0x1858('0x22'));return![];}if(_0x5f25a8&&_0x2f99f4['hasOwnProperty'](_0x388ffe+'Capacity')&&_0x2f99f4['hasOwnProperty'](_0x388ffe+_0x1858('0x23'))){if(_0x2f99f4[_0x388ffe+_0x1858('0x24')]>0x0&&_0x2f99f4[_0x388ffe+_0x1858('0x23')]>=_0x2f99f4[_0x388ffe+_0x1858('0x24')]){writeLog(_0x196536,_0x2f99f4,_0x388ffe[_0x1858('0x25')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports['showNotification']=function(_0x5651cc,_0x39250d,_0x40216f,_0xe74b4c,_0xe80802){return sendNotification(!![],_0x5651cc,_0x39250d,_0x40216f,_0xe74b4c,_0xe80802);};exports[_0x1858('0x26')]=function(_0x5a5681,_0x331ba3,_0x265a0e,_0x34d5dd,_0x88307d){return sendNotification(![],_0x5a5681,_0x331ba3,_0x265a0e,_0x34d5dd,_0x88307d);};exports[_0x1858('0x27')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index b09340b..5ed87c1 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 _0xc4b2=['isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','error','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','lodash','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','[%s][SYSTEM]\x20%s','map','join','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil'];(function(_0x164c32,_0x5f3d65){var _0x2eff8c=function(_0x5a517c){while(--_0x5a517c){_0x164c32['push'](_0x164c32['shift']());}};_0x2eff8c(++_0x5f3d65);}(_0xc4b2,0x127));var _0x2c4b=function(_0x3ec751,_0x3009cd){_0x3ec751=_0x3ec751-0x0;var _0x252150=_0xc4b2[_0x3ec751];return _0x252150;};'use strict';var schema=require(_0x2c4b('0x0'));var sh=require('shelljs');var _=require(_0x2c4b('0x1'));var utils=require(_0x2c4b('0x2'));var logger=require(_0x2c4b('0x3'))('routing');var system=schema({'command':{'type':_0x2c4b('0x4'),'required':!![],'message':_0x2c4b('0x5')}});exports['consequence']=function(_0x162e8a,_0x1885fb){return function(_0x5b06ac){try{var _0x49d149={'command':_0x1885fb[0x0]};var _0x561afd=system[_0x2c4b('0x0')](_0x49d149,{'typecast':!![]});if(_0x561afd[_0x2c4b('0x6')]){logger['error'](_0x2c4b('0x7'),_0x162e8a,_[_0x2c4b('0x8')](_0x561afd,'message')[_0x2c4b('0x9')](',\x20'));logger[_0x2c4b('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x162e8a);_0x5b06ac['next']();}else{var _0x37bb89=this;var _0x2d206b=utils[_0x2c4b('0xb')](_0x1885fb[0x0],this);logger['info'](_0x2c4b('0xc'),_0x162e8a,_0x2d206b);sh[_0x2c4b('0xd')](_[_0x2c4b('0xe')](_0x2d206b),function(_0x5b32ed,_0x17a601){logger[_0x2c4b('0xa')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x162e8a,_0x5b32ed);if(_0x5b32ed==0x0){var _0x5b19c4=_0x17a601[_0x2c4b('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0x2c4b('0x10')](_0x1885fb[0x1])||_[_0x2c4b('0x11')](_0x1885fb[0x1])){logger['info'](_0x2c4b('0x12'),_0x162e8a);_0x37bb89[_0x2c4b('0x13')][_0x1885fb[0x1]]=_0x5b19c4;}else{logger[_0x2c4b('0xa')](_0x2c4b('0x14'),_0x162e8a,_0x1885fb[0x1],_0x5b19c4);_0x37bb89[_0x2c4b('0x13')][_0x1885fb[0x1]]=_0x5b19c4;}}_0x5b06ac[_0x2c4b('0x15')]();});}}catch(_0x451761){logger[_0x2c4b('0x16')](_0x2c4b('0x7'),_0x162e8a,_[_0x2c4b('0x17')](_0x451761)?JSON[_0x2c4b('0x18')](_0x451761):_0x451761);logger[_0x2c4b('0xa')](_0x2c4b('0x19'),_0x162e8a);_0x5b06ac[_0x2c4b('0x15')]();}};}; \ No newline at end of file +var _0x578d=['trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','validate','shelljs','./utils','../../../../config/logger','length','error','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','exec'];(function(_0x34c83f,_0x37d54b){var _0x35955f=function(_0x134821){while(--_0x134821){_0x34c83f['push'](_0x34c83f['shift']());}};_0x35955f(++_0x37d54b);}(_0x578d,0x126));var _0xd578=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x578d[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xd578('0x0'));var sh=require(_0xd578('0x1'));var _=require('lodash');var utils=require(_0xd578('0x2'));var logger=require(_0xd578('0x3'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x1e5efe,_0x1d8bd5){return function(_0x30781c){try{var _0x26ae47={'command':_0x1d8bd5[0x0]};var _0x505f2e=system[_0xd578('0x0')](_0x26ae47,{'typecast':!![]});if(_0x505f2e[_0xd578('0x4')]){logger[_0xd578('0x5')]('[%s][SYSTEM]\x20%s',_0x1e5efe,_[_0xd578('0x6')](_0x505f2e,_0xd578('0x7'))[_0xd578('0x8')](',\x20'));logger[_0xd578('0x9')](_0xd578('0xa'),_0x1e5efe);_0x30781c[_0xd578('0xb')]();}else{var _0x269323=this;var _0x186b2c=utils[_0xd578('0xc')](_0x1d8bd5[0x0],this);logger[_0xd578('0x9')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x1e5efe,_0x186b2c);sh[_0xd578('0xd')](_[_0xd578('0xe')](_0x186b2c),function(_0x1d1740,_0x4203ac){logger[_0xd578('0x9')](_0xd578('0xf'),_0x1e5efe,_0x1d1740);if(_0x1d1740==0x0){var _0x30ad90=_0x4203ac['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xd578('0x10')](_0x1d8bd5[0x1])||_[_0xd578('0x11')](_0x1d8bd5[0x1])){logger[_0xd578('0x9')]('[%s][SYSTEM]\x20no\x20variable',_0x1e5efe);_0x269323['body'][_0x1d8bd5[0x1]]=_0x30ad90;}else{logger[_0xd578('0x9')](_0xd578('0x12'),_0x1e5efe,_0x1d8bd5[0x1],_0x30ad90);_0x269323['body'][_0x1d8bd5[0x1]]=_0x30ad90;}}_0x30781c[_0xd578('0xb')]();});}}catch(_0x310486){logger['error'](_0xd578('0x13'),_0x1e5efe,_[_0xd578('0x14')](_0x310486)?JSON[_0xd578('0x15')](_0x310486):_0x310486);logger[_0xd578('0x9')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x1e5efe);_0x30781c[_0xd578('0xb')]();}};}; \ 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 9eec5f3..e1c411c 100644 --- a/server/services/routing/server/applications/tag.js +++ b/server/services/routing/server/applications/tag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x157084,_0x4b431c){var _0x1714a1=function(_0x2e55b0){while(--_0x2e55b0){_0x157084['push'](_0x157084['shift']());}};_0x1714a1(++_0x4b431c);}(_0x7a54,0x106));var _0x47a5=function(_0x1b2e87,_0x4916ae){_0x1b2e87=_0x1b2e87-0x0;var _0x45fca1=_0x7a54[_0x1b2e87];return _0x45fca1;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ No newline at end of file +var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x5c555f,_0x365438){var _0x53fd7c=function(_0x26c3f3){while(--_0x26c3f3){_0x5c555f['push'](_0x5c555f['shift']());}};_0x53fd7c(++_0x365438);}(_0x7a54,0x106));var _0x47a5=function(_0x4765f1,_0x551628){_0x4765f1=_0x4765f1-0x0;var _0x5163b1=_0x7a54[_0x4765f1];return _0x5163b1;};'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 7d5a6d1..ce7e550 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 _0x142c=['account','list','mustache','exports','merge','body'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x142c,0x86));var _0xc142=function(_0x6cfa99,_0x513821){_0x6cfa99=_0x6cfa99-0x0;var _0x3d3555=_0x142c[_0x6cfa99];return _0x3d3555;};'use strict';var Mustache=require(_0xc142('0x0'));var _=require('lodash');module[_0xc142('0x1')]={'getMustacheRender':function(_0x146a30,_0x10367){return Mustache['render'](_0x146a30,_[_0xc142('0x2')](_0x10367[_0xc142('0x3')],{'contact':_0x10367['contact'],'message':_0x10367['message'],'account':_0x10367[_0xc142('0x4')],'interaction':_0x10367['interaction'],'list':_0x10367[_0xc142('0x5')]}))||'';}}; \ No newline at end of file +var _0xccdc=['interaction','list','mustache','lodash','render','merge','body','contact','message','account'];(function(_0x4f7e4b,_0x5bbdb2){var _0x55a507=function(_0x3c96f0){while(--_0x3c96f0){_0x4f7e4b['push'](_0x4f7e4b['shift']());}};_0x55a507(++_0x5bbdb2);}(_0xccdc,0x1c4));var _0xcccd=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xccdc[_0x68c979];return _0x4f0001;};'use strict';var Mustache=require(_0xcccd('0x0'));var _=require(_0xcccd('0x1'));module['exports']={'getMustacheRender':function(_0x4a4fa5,_0x3d1898){return Mustache[_0xcccd('0x2')](_0x4a4fa5,_[_0xcccd('0x3')](_0x3d1898[_0xcccd('0x4')],{'contact':_0x3d1898[_0xcccd('0x5')],'message':_0x3d1898[_0xcccd('0x6')],'account':_0x3d1898[_0xcccd('0x7')],'interaction':_0x3d1898[_0xcccd('0x8')],'list':_0x3d1898[_0xcccd('0x9')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index da7aaba..96cb388 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 _0xbb88=['values','chatQueues','available','loggedIn','paused','mailQueues','name','openchannelQueues','smsQueues','waiting','faxQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','bluebird','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','applications','length','app','.js','toLowerCase','autoreply','appdata','split','push','slice','join','dialogflow','tag','TagId','%s:%s:%s','./interval','intervals','priority','info','on\x20interval','Please\x20create\x20a\x20new\x20file\x20under','rules','Applications\x20executed','stringify','matchPath','emit','end','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','QueueReport','update','catch','message\x20is\x20empty','agent','agents','hasOwnProperty','capacity','CurrentCapacity','updateRealtime'];(function(_0x3333bb,_0x1df222){var _0x273d39=function(_0x5c411b){while(--_0x5c411b){_0x3333bb['push'](_0x3333bb['shift']());}};_0x273d39(++_0x1df222);}(_0xbb88,0x10a));var _0x8bb8=function(_0x2757b1,_0x140009){_0x2757b1=_0x2757b1-0x0;var _0x1b252f=_0xbb88[_0x2757b1];return _0x1b252f;};'use strict';var _=require(_0x8bb8('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x8bb8('0x1'));var uuid=require('uuid');var config=require(_0x8bb8('0x2'));var logger=require(_0x8bb8('0x3'))(_0x8bb8('0x4'));var rpc={'openchannelQueueReport':require(_0x8bb8('0x5'))};var rpc={'openchannelQueueReport':require(_0x8bb8('0x5')),'mailQueueReport':require(_0x8bb8('0x6')),'chatQueueReport':require(_0x8bb8('0x7')),'smsQueueReport':require(_0x8bb8('0x8')),'faxQueueReport':require(_0x8bb8('0x9'))};var RuleEngine=require(_0x8bb8('0xa'));function getId(_0x2353ff,_0x11bd69,_0x17cbaf){return util[_0x8bb8('0xb')]('%s.%s.%s',_0x2353ff,_0x11bd69||0x0,_0x17cbaf||0x0);}function getIntervals(_0x55b314,_0x153631){var _0x541f13=[];if(!_[_0x8bb8('0xc')](_0x153631[_0x8bb8('0xd')])&&!_[_0x8bb8('0xc')](_0x55b314[_0x153631[_0x8bb8('0xd')]])&&!_['isNil'](_0x55b314[_0x153631[_0x8bb8('0xd')]][_0x8bb8('0xe')])){_0x541f13=_[_0x8bb8('0xf')](_0x55b314[_0x153631[_0x8bb8('0xd')]][_0x8bb8('0xe')],_0x8bb8('0x10'));}else if(!_[_0x8bb8('0xc')](_0x153631['interval'])){_0x541f13=[_0x153631['interval']];}return _0x541f13;}exports[_0x8bb8('0x11')]=function(_0x570e8a){_0x570e8a['rules']={};return new BPromise(function(_0x242d6b,_0x21cc4f){var _0x1eab56={'Start':function(_0x359e1d){var _0x473a95=this;return new Promise(function(_0x4555a9,_0x435001){if(_0x359e1d){try{var _0x58a8bf=[];var _0x3bec6f=getId(_0x359e1d[_0x8bb8('0x12')],_0x359e1d[_0x8bb8('0x13')]?_0x359e1d[_0x8bb8('0x13')]['id']:0x0,_0x359e1d[_0x8bb8('0x14')]?_0x359e1d[_0x8bb8('0x14')]['id']:0x0);if(_0x359e1d[_0x8bb8('0x15')]&&_['isArray'](_0x359e1d[_0x8bb8('0x15')])&&_0x359e1d[_0x8bb8('0x15')]['length']){for(var _0x1fa9f6=0x0;_0x1fa9f6<_0x359e1d[_0x8bb8('0x15')][_0x8bb8('0x16')];_0x1fa9f6+=0x1){var _0x547708=_0x359e1d[_0x8bb8('0x15')][_0x1fa9f6];if(fs['existsSync'](path['join'](__dirname,_0x8bb8('0x15'),_0x547708[_0x8bb8('0x17')]+_0x8bb8('0x18')))){var _0x29b99d=[];switch(_0x547708['app'][_0x8bb8('0x19')]()){case _0x8bb8('0x1a'):var _0x1e1d7c=_0x547708[_0x8bb8('0x1b')][_0x8bb8('0x1c')](',');_0x29b99d[_0x8bb8('0x1d')](_0x1e1d7c[0x0]);_0x29b99d[_0x8bb8('0x1d')](_0x1e1d7c[_0x8bb8('0x1e')](0x1,_0x1e1d7c[_0x8bb8('0x16')])[_0x8bb8('0x1f')](','));break;case _0x8bb8('0x20'):var _0x1e1d7c=_0x547708[_0x8bb8('0x1b')]['split'](',');_0x29b99d[_0x8bb8('0x1d')](_0x1e1d7c[0x0]);_0x29b99d['push'](_0x1e1d7c[0x1]);_0x29b99d[_0x8bb8('0x1d')](_0x1e1d7c[_0x8bb8('0x1e')](0x2,_0x1e1d7c['length'])[_0x8bb8('0x1f')](','));break;case'amazonlex':var _0x1e1d7c=_0x547708[_0x8bb8('0x1b')]['split'](',');_0x29b99d[_0x8bb8('0x1d')](_0x1e1d7c[0x0]);_0x29b99d['push'](_0x1e1d7c[0x1]);_0x29b99d[_0x8bb8('0x1d')](_0x1e1d7c[0x2]);_0x29b99d[_0x8bb8('0x1d')](_0x1e1d7c[0x3]);_0x29b99d[_0x8bb8('0x1d')](_0x1e1d7c[_0x8bb8('0x1e')](0x4,_0x1e1d7c[_0x8bb8('0x16')])[_0x8bb8('0x1f')](','));break;case'message':_0x29b99d['push'](_0x547708[_0x8bb8('0x1b')]);break;case _0x8bb8('0x21'):_0x29b99d[_0x8bb8('0x1d')](_0x547708[_0x8bb8('0x22')]);_0x29b99d[_0x8bb8('0x1d')](_0x547708[_0x8bb8('0x1b')]);break;default:_0x29b99d=_['isNil'](_0x547708[_0x8bb8('0x1b')])?[]:_0x547708['appdata'][_0x8bb8('0x1c')](',');}var _0x14e22d={'id':util[_0x8bb8('0xb')](_0x8bb8('0x23'),_0x3bec6f,_0x547708['id'],_0x547708['app']),'condition':require(_0x8bb8('0x24'))['condition'](_0x3bec6f,getIntervals(_0x570e8a[_0x8bb8('0x25')],_0x547708),_0x570e8a),'consequence':require('./applications/'+_0x547708['app'])['consequence'](_0x3bec6f,_0x29b99d,_0x570e8a,_0x359e1d),'p':_0x547708[_0x8bb8('0x26')]||0x0};logger[_0x8bb8('0x27')]('Push\x20new\x20rule',_0x14e22d['id'],_0x8bb8('0x28'),getIntervals(_0x570e8a[_0x8bb8('0x25')],_0x547708)[_0x8bb8('0x1f')]('\x20|\x20'));_0x58a8bf[_0x8bb8('0x1d')](_0x14e22d);}else{logger['error'](_0x8bb8('0x29'),path['join'](__dirname,'applications',_0x547708[_0x8bb8('0x17')]+'.js'));}}_0x570e8a[_0x8bb8('0x2a')][_0x3bec6f]=new RuleEngine(_0x58a8bf);_0x570e8a[_0x8bb8('0x2a')][_0x3bec6f]['execute'](_0x359e1d,function(_0x1f5c06){logger[_0x8bb8('0x27')](_0x8bb8('0x2b'),JSON[_0x8bb8('0x2c')](_0x1f5c06[_0x8bb8('0x2d')]));if(_0x570e8a[_0x8bb8('0x2a')][_0x3bec6f]){_0x570e8a[_0x8bb8('0x2a')][_0x3bec6f][_0x8bb8('0x2e')](_0x8bb8('0x2f'));}});return _0x4555a9({'code':0xc8,'message':_0x359e1d});}else{logger[_0x8bb8('0x27')](_0x8bb8('0x30'));return _0x4555a9({'code':0xc8,'message':_0x359e1d});}}catch(_0x4a028e){logger[_0x8bb8('0x31')](_0x4a028e[_0x8bb8('0x32')]);return _0x435001(_0x473a95['error'](0x1f4,_0x4a028e));}}return _0x435001(_0x8bb8('0x33'));});},'AcceptMessage':function(_0x44cbfd){var _0x41c02c=this;return new Promise(function(_0x3fd517,_0x3989b8){if(_0x44cbfd[_0x8bb8('0x13')]&&_0x44cbfd[_0x8bb8('0x13')]['id']){try{var _0x3a903d=getId(_0x44cbfd[_0x8bb8('0x12')],_0x44cbfd[_0x8bb8('0x13')]?_0x44cbfd[_0x8bb8('0x13')]['id']:0x0,_0x44cbfd[_0x8bb8('0x14')]?_0x44cbfd[_0x8bb8('0x14')]['id']:0x0);if(_0x570e8a['rules'][_0x3a903d]){_0x570e8a[_0x8bb8('0x2a')][_0x3a903d]['emit'](_0x8bb8('0x2f'));if(rpc[_0x44cbfd[_0x8bb8('0x12')]+'QueueReport']){rpc[_0x44cbfd[_0x8bb8('0x12')]+_0x8bb8('0x34')][_0x8bb8('0x35')](_0x3a903d,{'UserId':_0x44cbfd['message']['UserId']})[_0x8bb8('0x36')](function(_0x2e2316){logger['error']('error\x20update\x20queue\x20report');});}}return _0x3fd517({'code':0xc8,'message':_0x44cbfd});}catch(_0x3aa051){logger[_0x8bb8('0x31')](_0x3aa051[_0x8bb8('0x32')]);return _0x3989b8(_0x41c02c[_0x8bb8('0x31')](0x1f4,_0x3aa051));}}logger['error'](_0x8bb8('0x37'));return _0x3989b8(_0x41c02c[_0x8bb8('0x31')](0x1f4,_0x8bb8('0x37')));});},'RejectMessage':function(_0x33fbb9){var _0x2db44b=this;return new Promise(function(_0x1eb495,_0x448040){if(_0x33fbb9[_0x8bb8('0x38')]&&_0x33fbb9['agent']['id']){try{if(_0x570e8a[_0x8bb8('0x39')][_0x33fbb9[_0x8bb8('0x38')]['id']]){_0x570e8a[_0x8bb8('0x39')][_0x33fbb9[_0x8bb8('0x38')]['id']]['busy']=![];_0x570e8a[_0x8bb8('0x39')][_0x33fbb9['agent']['id']]['busyQueue']=undefined;}return _0x1eb495({'code':0xc8,'message':_0x33fbb9});}catch(_0x298a3a){logger[_0x8bb8('0x31')](_0x298a3a[_0x8bb8('0x32')]);return _0x448040(_0x2db44b['error'](0x1f4,_0x298a3a));}}logger[_0x8bb8('0x31')](_0x8bb8('0x37'));return _0x448040(_0x2db44b[_0x8bb8('0x31')](0x1f4,_0x8bb8('0x37')));});},'AbandonInteraction':function(_0x2732bb){var _0x18549b=this;return new Promise(function(_0x3301e0,_0x73f4ca){if(_0x2732bb[_0x8bb8('0x12')]&&_0x2732bb[_0x8bb8('0x14')]&&_0x2732bb['interaction']['id']){try{var _0x307a3c=getId(_0x2732bb[_0x8bb8('0x12')],_0x2732bb[_0x8bb8('0x13')]?_0x2732bb[_0x8bb8('0x13')]['id']:0x0,_0x2732bb[_0x8bb8('0x14')]?_0x2732bb[_0x8bb8('0x14')]['id']:0x0);if(_0x570e8a[_0x8bb8('0x2a')][_0x307a3c]){_0x570e8a[_0x8bb8('0x2a')][_0x307a3c][_0x8bb8('0x2e')](_0x8bb8('0x2f'));}return _0x3301e0({'code':0xc8,'message':_0x2732bb});}catch(_0x2e6acb){logger['error'](_0x2e6acb[_0x8bb8('0x32')]);return _0x73f4ca(_0x18549b['error'](0x1f4,_0x2e6acb));}}logger[_0x8bb8('0x31')](_0x8bb8('0x37'));return _0x73f4ca(_0x18549b[_0x8bb8('0x31')](0x1f4,_0x8bb8('0x37')));});},'AgentCapacity':function(_0x32ffa5){var _0x2838d6=this;return new Promise(function(_0x217699,_0x2b498c){if(_0x570e8a['agents'][_0x8bb8('0x3a')](_0x32ffa5['id'])){for(var _0x172062 in _0x32ffa5[_0x8bb8('0x3b')]){if(_0x32ffa5[_0x8bb8('0x3b')][_0x8bb8('0x3a')](_0x172062)){if(_0x570e8a[_0x8bb8('0x39')][_0x32ffa5['id']][_0x8bb8('0x3a')](_0x172062+_0x8bb8('0x3c'))){_0x570e8a[_0x8bb8('0x39')][_0x32ffa5['id']][_0x172062+_0x8bb8('0x3c')]=parseInt(_0x32ffa5[_0x8bb8('0x3b')][_0x172062],0xa);}}}_0x570e8a['agents'][_0x32ffa5['id']][_0x8bb8('0x3d')]();return _0x217699({'code':0xc8,'message':_0x570e8a[_0x8bb8('0x39')][_0x32ffa5['id']]});}else{return _0x2b498c(_0x2838d6['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x5511f0){return new Promise(function(_0x4227b3,_0x548db7){var _0x2ec052=_[_0x8bb8('0x3e')](_0x570e8a[_0x8bb8('0x39')]);_0x4227b3({'count':_0x2ec052[_0x8bb8('0x16')],'rows':_0x2ec052});});},'ChatQueues':function(_0x38202a){return new Promise(function(_0xbf01a7,_0x1426e){var _0xd90e85=[];for(var _0x343b3d in _0x570e8a[_0x8bb8('0x3f')]){if(_0x570e8a['chatQueues'][_0x8bb8('0x3a')](_0x343b3d)){var _0x457665=_0x570e8a[_0x8bb8('0x3f')][_0x343b3d];var _0x1ae450={'id':_0x457665['id'],'available':_0x457665[_0x8bb8('0x40')],'loggedIn':_0x457665[_0x8bb8('0x41')],'name':_0x457665['name'],'paused':_0x457665[_0x8bb8('0x42')],'waiting':_0x457665['waiting']};_0xd90e85[_0x8bb8('0x1d')](_0x1ae450);}}_0xbf01a7({'count':_0xd90e85[_0x8bb8('0x16')],'rows':_0xd90e85});});},'MailQueues':function(_0x54b8ee){return new Promise(function(_0x1b8b29,_0x396429){var _0x44de80=[];for(var _0x4df07e in _0x570e8a[_0x8bb8('0x43')]){if(_0x570e8a[_0x8bb8('0x43')]['hasOwnProperty'](_0x4df07e)){var _0x15a091=_0x570e8a[_0x8bb8('0x43')][_0x4df07e];var _0x2d1e08={'id':_0x15a091['id'],'available':_0x15a091[_0x8bb8('0x40')],'loggedIn':_0x15a091[_0x8bb8('0x41')],'name':_0x15a091[_0x8bb8('0x44')],'paused':_0x15a091['paused'],'waiting':_0x15a091['waiting']};_0x44de80[_0x8bb8('0x1d')](_0x2d1e08);}}_0x1b8b29({'count':_0x44de80[_0x8bb8('0x16')],'rows':_0x44de80});});},'OpenchannelQueues':function(_0x595b47){return new Promise(function(_0x34b14b,_0x1f3947){var _0x2ba790=[];for(var _0x58b4af in _0x570e8a[_0x8bb8('0x45')]){if(_0x570e8a[_0x8bb8('0x45')][_0x8bb8('0x3a')](_0x58b4af)){var _0x15c882=_0x570e8a[_0x8bb8('0x45')][_0x58b4af];var _0x539c11={'id':_0x15c882['id'],'available':_0x15c882[_0x8bb8('0x40')],'loggedIn':_0x15c882[_0x8bb8('0x41')],'name':_0x15c882['name'],'paused':_0x15c882[_0x8bb8('0x42')],'waiting':_0x15c882['waiting']};_0x2ba790[_0x8bb8('0x1d')](_0x539c11);}}_0x34b14b({'count':_0x2ba790[_0x8bb8('0x16')],'rows':_0x2ba790});});},'SmsQueues':function(_0x5b44f3){return new Promise(function(_0x1924b2,_0x16fd49){var _0x874bb1=[];for(var _0x141803 in _0x570e8a[_0x8bb8('0x46')]){if(_0x570e8a[_0x8bb8('0x46')]['hasOwnProperty'](_0x141803)){var _0x1fddfd=_0x570e8a[_0x8bb8('0x46')][_0x141803];var _0x55ef96={'id':_0x1fddfd['id'],'available':_0x1fddfd[_0x8bb8('0x40')],'loggedIn':_0x1fddfd[_0x8bb8('0x41')],'name':_0x1fddfd[_0x8bb8('0x44')],'paused':_0x1fddfd['paused'],'waiting':_0x1fddfd[_0x8bb8('0x47')]};_0x874bb1[_0x8bb8('0x1d')](_0x55ef96);}}_0x1924b2({'count':_0x874bb1['length'],'rows':_0x874bb1});});},'FaxQueues':function(_0x3e3d17){return new Promise(function(_0x42de1a,_0x140dcc){var _0x348329=[];for(var _0x5864c6 in _0x570e8a[_0x8bb8('0x48')]){if(_0x570e8a[_0x8bb8('0x48')][_0x8bb8('0x3a')](_0x5864c6)){var _0xfeb117=_0x570e8a[_0x8bb8('0x48')][_0x5864c6];var _0x5dc522={'id':_0xfeb117['id'],'available':_0xfeb117[_0x8bb8('0x40')],'loggedIn':_0xfeb117['loggedIn'],'name':_0xfeb117[_0x8bb8('0x44')],'paused':_0xfeb117[_0x8bb8('0x42')],'waiting':_0xfeb117['waiting']};_0x348329[_0x8bb8('0x1d')](_0x5dc522);}}_0x42de1a({'count':_0x348329[_0x8bb8('0x16')],'rows':_0x348329});});},'ChatQueuesWaitingInteractions':function(_0x5bbdd5){return new Promise(function(_0x1ac71b,_0x2935e4){var _0x48b7c4=_[_0x8bb8('0x3e')](_0x570e8a[_0x8bb8('0x49')]);_0x1ac71b({'count':_0x48b7c4[_0x8bb8('0x16')],'rows':_0x48b7c4});});},'MailQueuesWaitingInteractions':function(_0x4b5dc1){return new Promise(function(_0x4e2886,_0x39f845){var _0x175432=_[_0x8bb8('0x3e')](_0x570e8a['mailQueuesWaitingInteractions']);_0x4e2886({'count':_0x175432['length'],'rows':_0x175432});});},'OpenchannelQueuesWaitingInteractions':function(_0x983fc7){return new Promise(function(_0x1e9cf9,_0x58fae8){var _0x5a793e=_['values'](_0x570e8a[_0x8bb8('0x4a')]);_0x1e9cf9({'count':_0x5a793e[_0x8bb8('0x16')],'rows':_0x5a793e});});},'SmsQueuesWaitingInteractions':function(_0x34ea09){return new Promise(function(_0x14d9f2,_0x27c59e){var _0x1ba5d0=_[_0x8bb8('0x3e')](_0x570e8a[_0x8bb8('0x4b')]);_0x14d9f2({'count':_0x1ba5d0[_0x8bb8('0x16')],'rows':_0x1ba5d0});});},'FaxQueuesWaitingInteractions':function(_0x1130eb){return new Promise(function(_0x1e4b40,_0x3a0133){var _0x552bc6=_[_0x8bb8('0x3e')](_0x570e8a[_0x8bb8('0x4c')]);_0x1e4b40({'count':_0x552bc6[_0x8bb8('0x16')],'rows':_0x552bc6});});}};var _0x14cfb4=jayson[_0x8bb8('0x4d')](_0x1eab56)[_0x8bb8('0x4e')]();_0x14cfb4['on']('error',function(_0x5e5533){logger[_0x8bb8('0x31')](JSON[_0x8bb8('0x2c')](_0x5e5533));return _0x21cc4f(_0x5e5533);});_0x14cfb4[_0x8bb8('0x11')](0x232c,_0x8bb8('0x4f'),function(){console[_0x8bb8('0x50')](_0x8bb8('0x51'),0x232c);return _0x242d6b('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x5910=['faxQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','join','app','toLowerCase','autoreply','appdata','split','push','slice','amazonlex','tag','TagId','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','\x20|\x20','execute','Applications\x20executed','stringify','matchPath','No\x20applications\x20to\x20execute','stack','error','routing\x20is\x20empty','emit','end','QueueReport','update','UserId','catch','message\x20is\x20empty','agent','agents','busy','busyQueue','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','paused','waiting','mailQueues','loggedIn','name','openchannelQueues','smsQueues'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x5910,0x1bb));var _0x0591=function(_0x51a307,_0x59611c){_0x51a307=_0x51a307-0x0;var _0x203737=_0x5910[_0x51a307];return _0x203737;};'use strict';var _=require(_0x0591('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0x0591('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var config=require(_0x0591('0x2'));var logger=require(_0x0591('0x3'))('routing');var rpc={'openchannelQueueReport':require(_0x0591('0x4'))};var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x0591('0x5')),'chatQueueReport':require(_0x0591('0x6')),'smsQueueReport':require(_0x0591('0x7')),'faxQueueReport':require(_0x0591('0x8'))};var RuleEngine=require(_0x0591('0x9'));function getId(_0x36bfe8,_0x4be803,_0x4403f0){return util[_0x0591('0xa')](_0x0591('0xb'),_0x36bfe8,_0x4be803||0x0,_0x4403f0||0x0);}function getIntervals(_0x55c07e,_0x5dfb0c){var _0x5a2613=[];if(!_[_0x0591('0xc')](_0x5dfb0c[_0x0591('0xd')])&&!_[_0x0591('0xc')](_0x55c07e[_0x5dfb0c[_0x0591('0xd')]])&&!_[_0x0591('0xc')](_0x55c07e[_0x5dfb0c[_0x0591('0xd')]][_0x0591('0xe')])){_0x5a2613=_[_0x0591('0xf')](_0x55c07e[_0x5dfb0c['IntervalId']][_0x0591('0xe')],_0x0591('0x10'));}else if(!_[_0x0591('0xc')](_0x5dfb0c['interval'])){_0x5a2613=[_0x5dfb0c[_0x0591('0x10')]];}return _0x5a2613;}exports[_0x0591('0x11')]=function(_0x2850d5){_0x2850d5[_0x0591('0x12')]={};return new BPromise(function(_0x2cb40b,_0x58bb66){var _0x2995aa={'Start':function(_0x2cfcc7){var _0x4b3846=this;return new Promise(function(_0x28558c,_0x56fb02){if(_0x2cfcc7){try{var _0x31cf23=[];var _0x561df2=getId(_0x2cfcc7[_0x0591('0x13')],_0x2cfcc7['message']?_0x2cfcc7[_0x0591('0x14')]['id']:0x0,_0x2cfcc7['interaction']?_0x2cfcc7[_0x0591('0x15')]['id']:0x0);if(_0x2cfcc7[_0x0591('0x16')]&&_[_0x0591('0x17')](_0x2cfcc7[_0x0591('0x16')])&&_0x2cfcc7[_0x0591('0x16')][_0x0591('0x18')]){for(var _0x1b3760=0x0;_0x1b3760<_0x2cfcc7['applications']['length'];_0x1b3760+=0x1){var _0x1faeac=_0x2cfcc7[_0x0591('0x16')][_0x1b3760];if(fs['existsSync'](path[_0x0591('0x19')](__dirname,'applications',_0x1faeac[_0x0591('0x1a')]+'.js'))){var _0x4974f0=[];switch(_0x1faeac['app'][_0x0591('0x1b')]()){case _0x0591('0x1c'):var _0x5a17e6=_0x1faeac[_0x0591('0x1d')][_0x0591('0x1e')](',');_0x4974f0[_0x0591('0x1f')](_0x5a17e6[0x0]);_0x4974f0['push'](_0x5a17e6[_0x0591('0x20')](0x1,_0x5a17e6[_0x0591('0x18')])[_0x0591('0x19')](','));break;case'dialogflow':var _0x5a17e6=_0x1faeac[_0x0591('0x1d')][_0x0591('0x1e')](',');_0x4974f0[_0x0591('0x1f')](_0x5a17e6[0x0]);_0x4974f0['push'](_0x5a17e6[0x1]);_0x4974f0['push'](_0x5a17e6['slice'](0x2,_0x5a17e6[_0x0591('0x18')])[_0x0591('0x19')](','));break;case _0x0591('0x21'):var _0x5a17e6=_0x1faeac[_0x0591('0x1d')][_0x0591('0x1e')](',');_0x4974f0[_0x0591('0x1f')](_0x5a17e6[0x0]);_0x4974f0[_0x0591('0x1f')](_0x5a17e6[0x1]);_0x4974f0[_0x0591('0x1f')](_0x5a17e6[0x2]);_0x4974f0['push'](_0x5a17e6[0x3]);_0x4974f0['push'](_0x5a17e6[_0x0591('0x20')](0x4,_0x5a17e6[_0x0591('0x18')])['join'](','));break;case _0x0591('0x14'):_0x4974f0['push'](_0x1faeac[_0x0591('0x1d')]);break;case _0x0591('0x22'):_0x4974f0[_0x0591('0x1f')](_0x1faeac[_0x0591('0x23')]);_0x4974f0[_0x0591('0x1f')](_0x1faeac[_0x0591('0x1d')]);break;default:_0x4974f0=_[_0x0591('0xc')](_0x1faeac[_0x0591('0x1d')])?[]:_0x1faeac[_0x0591('0x1d')]['split'](',');}var _0x470366={'id':util[_0x0591('0xa')]('%s:%s:%s',_0x561df2,_0x1faeac['id'],_0x1faeac[_0x0591('0x1a')]),'condition':require(_0x0591('0x24'))[_0x0591('0x25')](_0x561df2,getIntervals(_0x2850d5[_0x0591('0x26')],_0x1faeac),_0x2850d5),'consequence':require(_0x0591('0x27')+_0x1faeac['app'])[_0x0591('0x28')](_0x561df2,_0x4974f0,_0x2850d5,_0x2cfcc7),'p':_0x1faeac[_0x0591('0x29')]||0x0};logger[_0x0591('0x2a')](_0x0591('0x2b'),_0x470366['id'],'on\x20interval',getIntervals(_0x2850d5['intervals'],_0x1faeac)[_0x0591('0x19')](_0x0591('0x2c')));_0x31cf23[_0x0591('0x1f')](_0x470366);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0x0591('0x19')](__dirname,_0x0591('0x16'),_0x1faeac[_0x0591('0x1a')]+'.js'));}}_0x2850d5[_0x0591('0x12')][_0x561df2]=new RuleEngine(_0x31cf23);_0x2850d5[_0x0591('0x12')][_0x561df2][_0x0591('0x2d')](_0x2cfcc7,function(_0x1e1a80){logger[_0x0591('0x2a')](_0x0591('0x2e'),JSON[_0x0591('0x2f')](_0x1e1a80[_0x0591('0x30')]));if(_0x2850d5['rules'][_0x561df2]){_0x2850d5[_0x0591('0x12')][_0x561df2]['emit']('end');}});return _0x28558c({'code':0xc8,'message':_0x2cfcc7});}else{logger[_0x0591('0x2a')](_0x0591('0x31'));return _0x28558c({'code':0xc8,'message':_0x2cfcc7});}}catch(_0x201964){logger['error'](_0x201964[_0x0591('0x32')]);return _0x56fb02(_0x4b3846[_0x0591('0x33')](0x1f4,_0x201964));}}return _0x56fb02(_0x0591('0x34'));});},'AcceptMessage':function(_0x12261a){var _0x1fb22f=this;return new Promise(function(_0x1efcb5,_0x4b7d8d){if(_0x12261a['message']&&_0x12261a[_0x0591('0x14')]['id']){try{var _0x128981=getId(_0x12261a['channel'],_0x12261a['message']?_0x12261a[_0x0591('0x14')]['id']:0x0,_0x12261a['interaction']?_0x12261a[_0x0591('0x15')]['id']:0x0);if(_0x2850d5['rules'][_0x128981]){_0x2850d5['rules'][_0x128981][_0x0591('0x35')](_0x0591('0x36'));if(rpc[_0x12261a[_0x0591('0x13')]+_0x0591('0x37')]){rpc[_0x12261a[_0x0591('0x13')]+_0x0591('0x37')][_0x0591('0x38')](_0x128981,{'UserId':_0x12261a[_0x0591('0x14')][_0x0591('0x39')]})[_0x0591('0x3a')](function(_0x5c2fbf){logger[_0x0591('0x33')]('error\x20update\x20queue\x20report');});}}return _0x1efcb5({'code':0xc8,'message':_0x12261a});}catch(_0x130e4c){logger[_0x0591('0x33')](_0x130e4c['stack']);return _0x4b7d8d(_0x1fb22f['error'](0x1f4,_0x130e4c));}}logger[_0x0591('0x33')](_0x0591('0x3b'));return _0x4b7d8d(_0x1fb22f[_0x0591('0x33')](0x1f4,_0x0591('0x3b')));});},'RejectMessage':function(_0x50b00d){var _0x617985=this;return new Promise(function(_0x16f3ad,_0x5be4a8){if(_0x50b00d['agent']&&_0x50b00d[_0x0591('0x3c')]['id']){try{if(_0x2850d5[_0x0591('0x3d')][_0x50b00d['agent']['id']]){_0x2850d5[_0x0591('0x3d')][_0x50b00d[_0x0591('0x3c')]['id']][_0x0591('0x3e')]=![];_0x2850d5[_0x0591('0x3d')][_0x50b00d[_0x0591('0x3c')]['id']][_0x0591('0x3f')]=undefined;}return _0x16f3ad({'code':0xc8,'message':_0x50b00d});}catch(_0x581645){logger[_0x0591('0x33')](_0x581645['stack']);return _0x5be4a8(_0x617985[_0x0591('0x33')](0x1f4,_0x581645));}}logger[_0x0591('0x33')]('message\x20is\x20empty');return _0x5be4a8(_0x617985[_0x0591('0x33')](0x1f4,_0x0591('0x3b')));});},'AbandonInteraction':function(_0x790779){var _0x448b7b=this;return new Promise(function(_0x5bcb25,_0x2779d9){if(_0x790779['channel']&&_0x790779[_0x0591('0x15')]&&_0x790779[_0x0591('0x15')]['id']){try{var _0x14730b=getId(_0x790779[_0x0591('0x13')],_0x790779[_0x0591('0x14')]?_0x790779[_0x0591('0x14')]['id']:0x0,_0x790779[_0x0591('0x15')]?_0x790779['interaction']['id']:0x0);if(_0x2850d5[_0x0591('0x12')][_0x14730b]){_0x2850d5[_0x0591('0x12')][_0x14730b][_0x0591('0x35')](_0x0591('0x36'));}return _0x5bcb25({'code':0xc8,'message':_0x790779});}catch(_0x4cb8f3){logger[_0x0591('0x33')](_0x4cb8f3['stack']);return _0x2779d9(_0x448b7b[_0x0591('0x33')](0x1f4,_0x4cb8f3));}}logger[_0x0591('0x33')](_0x0591('0x3b'));return _0x2779d9(_0x448b7b[_0x0591('0x33')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x507956){var _0x43fb6f=this;return new Promise(function(_0xb48a,_0x18c75f){if(_0x2850d5[_0x0591('0x3d')]['hasOwnProperty'](_0x507956['id'])){for(var _0xcf939f in _0x507956['capacity']){if(_0x507956[_0x0591('0x40')]['hasOwnProperty'](_0xcf939f)){if(_0x2850d5[_0x0591('0x3d')][_0x507956['id']][_0x0591('0x41')](_0xcf939f+_0x0591('0x42'))){_0x2850d5['agents'][_0x507956['id']][_0xcf939f+_0x0591('0x42')]=parseInt(_0x507956['capacity'][_0xcf939f],0xa);}}}_0x2850d5[_0x0591('0x3d')][_0x507956['id']][_0x0591('0x43')]();return _0xb48a({'code':0xc8,'message':_0x2850d5['agents'][_0x507956['id']]});}else{return _0x18c75f(_0x43fb6f['error'](0x1f4,_0x0591('0x44')));}});},'Agents':function(_0x9f4c9b){return new Promise(function(_0xa94568,_0xae8fd3){var _0xf780c=_[_0x0591('0x45')](_0x2850d5[_0x0591('0x3d')]);_0xa94568({'count':_0xf780c['length'],'rows':_0xf780c});});},'ChatQueues':function(_0x47b578){return new Promise(function(_0x10a911,_0x524f0a){var _0x32db4d=[];for(var _0x5b8452 in _0x2850d5[_0x0591('0x46')]){if(_0x2850d5[_0x0591('0x46')][_0x0591('0x41')](_0x5b8452)){var _0x22196e=_0x2850d5[_0x0591('0x46')][_0x5b8452];var _0x5959fe={'id':_0x22196e['id'],'available':_0x22196e[_0x0591('0x47')],'loggedIn':_0x22196e['loggedIn'],'name':_0x22196e['name'],'paused':_0x22196e[_0x0591('0x48')],'waiting':_0x22196e[_0x0591('0x49')]};_0x32db4d[_0x0591('0x1f')](_0x5959fe);}}_0x10a911({'count':_0x32db4d[_0x0591('0x18')],'rows':_0x32db4d});});},'MailQueues':function(_0x3d8375){return new Promise(function(_0x2943c7,_0x4be855){var _0x30b397=[];for(var _0x1f1ec1 in _0x2850d5[_0x0591('0x4a')]){if(_0x2850d5[_0x0591('0x4a')][_0x0591('0x41')](_0x1f1ec1)){var _0x640431=_0x2850d5['mailQueues'][_0x1f1ec1];var _0x1a98f3={'id':_0x640431['id'],'available':_0x640431['available'],'loggedIn':_0x640431[_0x0591('0x4b')],'name':_0x640431[_0x0591('0x4c')],'paused':_0x640431[_0x0591('0x48')],'waiting':_0x640431[_0x0591('0x49')]};_0x30b397[_0x0591('0x1f')](_0x1a98f3);}}_0x2943c7({'count':_0x30b397[_0x0591('0x18')],'rows':_0x30b397});});},'OpenchannelQueues':function(_0x2ce07d){return new Promise(function(_0x402c70,_0xe2b418){var _0x7d9748=[];for(var _0x366580 in _0x2850d5['openchannelQueues']){if(_0x2850d5['openchannelQueues'][_0x0591('0x41')](_0x366580)){var _0x25cb2b=_0x2850d5[_0x0591('0x4d')][_0x366580];var _0x53572a={'id':_0x25cb2b['id'],'available':_0x25cb2b['available'],'loggedIn':_0x25cb2b[_0x0591('0x4b')],'name':_0x25cb2b[_0x0591('0x4c')],'paused':_0x25cb2b[_0x0591('0x48')],'waiting':_0x25cb2b[_0x0591('0x49')]};_0x7d9748[_0x0591('0x1f')](_0x53572a);}}_0x402c70({'count':_0x7d9748[_0x0591('0x18')],'rows':_0x7d9748});});},'SmsQueues':function(_0x39ec62){return new Promise(function(_0x3d8dc1,_0x41839b){var _0x3f0287=[];for(var _0x214f35 in _0x2850d5[_0x0591('0x4e')]){if(_0x2850d5[_0x0591('0x4e')][_0x0591('0x41')](_0x214f35)){var _0x1c5576=_0x2850d5['smsQueues'][_0x214f35];var _0x48c118={'id':_0x1c5576['id'],'available':_0x1c5576[_0x0591('0x47')],'loggedIn':_0x1c5576[_0x0591('0x4b')],'name':_0x1c5576[_0x0591('0x4c')],'paused':_0x1c5576['paused'],'waiting':_0x1c5576[_0x0591('0x49')]};_0x3f0287[_0x0591('0x1f')](_0x48c118);}}_0x3d8dc1({'count':_0x3f0287[_0x0591('0x18')],'rows':_0x3f0287});});},'FaxQueues':function(_0x1da01f){return new Promise(function(_0x410207,_0x2a5cb0){var _0x54f3c2=[];for(var _0x1946e8 in _0x2850d5[_0x0591('0x4f')]){if(_0x2850d5[_0x0591('0x4f')][_0x0591('0x41')](_0x1946e8)){var _0x2ad13b=_0x2850d5[_0x0591('0x4f')][_0x1946e8];var _0x466472={'id':_0x2ad13b['id'],'available':_0x2ad13b[_0x0591('0x47')],'loggedIn':_0x2ad13b[_0x0591('0x4b')],'name':_0x2ad13b[_0x0591('0x4c')],'paused':_0x2ad13b[_0x0591('0x48')],'waiting':_0x2ad13b[_0x0591('0x49')]};_0x54f3c2[_0x0591('0x1f')](_0x466472);}}_0x410207({'count':_0x54f3c2['length'],'rows':_0x54f3c2});});},'ChatQueuesWaitingInteractions':function(_0x13c7e7){return new Promise(function(_0x342dcb,_0x1940a2){var _0x480ed0=_[_0x0591('0x45')](_0x2850d5[_0x0591('0x50')]);_0x342dcb({'count':_0x480ed0[_0x0591('0x18')],'rows':_0x480ed0});});},'MailQueuesWaitingInteractions':function(_0x3e3316){return new Promise(function(_0x404a16,_0x19e192){var _0x4fd5a2=_['values'](_0x2850d5['mailQueuesWaitingInteractions']);_0x404a16({'count':_0x4fd5a2[_0x0591('0x18')],'rows':_0x4fd5a2});});},'OpenchannelQueuesWaitingInteractions':function(_0x19811b){return new Promise(function(_0x41ae4a,_0x611364){var _0x3df0d3=_[_0x0591('0x45')](_0x2850d5['openchannelQueuesWaitingInteractions']);_0x41ae4a({'count':_0x3df0d3[_0x0591('0x18')],'rows':_0x3df0d3});});},'SmsQueuesWaitingInteractions':function(_0x250a75){return new Promise(function(_0x412286,_0x3b9337){var _0x40735c=_[_0x0591('0x45')](_0x2850d5[_0x0591('0x51')]);_0x412286({'count':_0x40735c[_0x0591('0x18')],'rows':_0x40735c});});},'FaxQueuesWaitingInteractions':function(_0x53987f){return new Promise(function(_0x52190d,_0x51db4e){var _0x284be3=_[_0x0591('0x45')](_0x2850d5['faxQueuesWaitingInteractions']);_0x52190d({'count':_0x284be3[_0x0591('0x18')],'rows':_0x284be3});});}};var _0x5115ca=jayson[_0x0591('0x52')](_0x2995aa)[_0x0591('0x53')]();_0x5115ca['on'](_0x0591('0x33'),function(_0x122d27){logger[_0x0591('0x33')](JSON[_0x0591('0x2f')](_0x122d27));return _0x58bb66(_0x122d27);});_0x5115ca[_0x0591('0x11')](0x232c,_0x0591('0x54'),function(){console[_0x0591('0x55')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x2cb40b(_0x0591('0x56')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index fe9ae02..123ad78 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 _0xc930=['error','message','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','Command','format','iftime\x20%s','then','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','client','http'];(function(_0xd57bf1,_0x1e33c5){var _0x23e146=function(_0x64313a){while(--_0x64313a){_0xd57bf1['push'](_0xd57bf1['shift']());}};_0x23e146(++_0x1e33c5);}(_0xc930,0x1b9));var _0x0c93=function(_0x319411,_0x343204){_0x319411=_0x319411-0x0;var _0x46e533=_0xc930[_0x319411];return _0x46e533;};'use strict';var util=require(_0x0c93('0x0'));var BPromise=require(_0x0c93('0x1'));var jayson=require(_0x0c93('0x2'));var _=require(_0x0c93('0x3'));var logger=require(_0x0c93('0x4'))('routing');var client=jayson[_0x0c93('0x5')][_0x0c93('0x6')]({'port':0x232a});function request(_0x5cd4d3,_0xe71711){return new BPromise(function(_0x54f09a,_0x2add0d){return client['request'](_0x5cd4d3,_0xe71711)['then'](function(_0x3312c7){if(_0x3312c7[_0x0c93('0x7')]){return _0x2add0d(_0x3312c7[_0x0c93('0x7')][_0x0c93('0x8')]);}else{return _0x54f09a(_0x3312c7[_0x0c93('0x9')]);}})[_0x0c93('0xa')](function(_0x1a479e){return _0x2add0d(_0x1a479e);});});}exports['condition']=function(_0x3e85f8,_0xf7d211,_0x46f838){return function(_0x5cd537){if(_0x46f838[_0x0c93('0xb')]&&!_0x46f838[_0x0c93('0xb')][_0x3e85f8]){logger[_0x0c93('0xc')](_0x0c93('0xd'),_0x3e85f8);return _0x5cd537[_0x0c93('0xe')]();}var _0x3f4f53=[];for(var _0x12ac81=0x0;_0x12ac81<_0xf7d211['length'];_0x12ac81+=0x1){_0x3f4f53['push'](request(_0x0c93('0xf'),{'command':util[_0x0c93('0x10')](_0x0c93('0x11'),_0xf7d211[_0x12ac81])})[_0x0c93('0x12')](function(_0x4a6819){return _0x4a6819&&_0x4a6819[_0x0c93('0x8')]&&_0x4a6819[_0x0c93('0x8')]['indexOf'](_0x0c93('0x13'))>=0x0?!![]:![];})[_0x0c93('0xa')](function(_0x42e42a){logger[_0x0c93('0x7')](_0x0c93('0x14'),_0x3e85f8,_0xf7d211[_0x12ac81]);}));}BPromise[_0x0c93('0x15')](_0x3f4f53)['then'](function(_0x931737){var _0x5b4d33=_[_0x0c93('0x16')](_0x931737);logger[_0x0c93('0xc')](_0x0c93('0x17'),_0x3e85f8,_0xf7d211[_0x0c93('0x18')](_0x0c93('0x19')),_0x5b4d33);_0x5cd537[_0x0c93('0x1a')](_0x5b4d33);})[_0x0c93('0xa')](function(_0x2ceb0f){console['log'](_0x2ceb0f);logger[_0x0c93('0x7')](_0x0c93('0x17'),_0x3e85f8,_0xf7d211[_0x0c93('0x18')](_0x0c93('0x19')),_0x2ceb0f[_0x0c93('0x1b')]);_0x5cd537[_0x0c93('0xe')]();});};}; \ No newline at end of file +var _0xdd54=['request','then','error','message','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','format','indexOf','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stop','util','bluebird','jayson/promise','lodash','routing','client'];(function(_0x9ea933,_0x565d76){var _0x4fdcd0=function(_0x1b1b59){while(--_0x1b1b59){_0x9ea933['push'](_0x9ea933['shift']());}};_0x4fdcd0(++_0x565d76);}(_0xdd54,0x159));var _0x4dd5=function(_0x503325,_0x24a407){_0x503325=_0x503325-0x0;var _0x452fff=_0xdd54[_0x503325];return _0x452fff;};'use strict';var util=require(_0x4dd5('0x0'));var BPromise=require(_0x4dd5('0x1'));var jayson=require(_0x4dd5('0x2'));var _=require(_0x4dd5('0x3'));var logger=require('../../../config/logger')(_0x4dd5('0x4'));var client=jayson[_0x4dd5('0x5')]['http']({'port':0x232a});function request(_0x5247df,_0x3de4b1){return new BPromise(function(_0x445aad,_0x4656e5){return client[_0x4dd5('0x6')](_0x5247df,_0x3de4b1)[_0x4dd5('0x7')](function(_0x447b6c){if(_0x447b6c[_0x4dd5('0x8')]){return _0x4656e5(_0x447b6c['error'][_0x4dd5('0x9')]);}else{return _0x445aad(_0x447b6c[_0x4dd5('0xa')]);}})[_0x4dd5('0xb')](function(_0x2dbfef){return _0x4656e5(_0x2dbfef);});});}exports[_0x4dd5('0xc')]=function(_0x5e1bbe,_0x2d913e,_0x1012af){return function(_0x14c2b2){if(_0x1012af[_0x4dd5('0xd')]&&!_0x1012af[_0x4dd5('0xd')][_0x5e1bbe]){logger['info'](_0x4dd5('0xe'),_0x5e1bbe);return _0x14c2b2['stop']();}var _0x3c9171=[];for(var _0x49b2ee=0x0;_0x49b2ee<_0x2d913e['length'];_0x49b2ee+=0x1){_0x3c9171['push'](request('Command',{'command':util[_0x4dd5('0xf')]('iftime\x20%s',_0x2d913e[_0x49b2ee])})[_0x4dd5('0x7')](function(_0x20ff61){return _0x20ff61&&_0x20ff61['message']&&_0x20ff61[_0x4dd5('0x9')][_0x4dd5('0x10')]('true')>=0x0?!![]:![];})['catch'](function(_0x528897){logger[_0x4dd5('0x8')](_0x4dd5('0x11'),_0x5e1bbe,_0x2d913e[_0x49b2ee]);}));}BPromise[_0x4dd5('0x12')](_0x3c9171)[_0x4dd5('0x7')](function(_0x5d41a4){var _0x21a339=_[_0x4dd5('0x13')](_0x5d41a4);logger[_0x4dd5('0x14')](_0x4dd5('0x15'),_0x5e1bbe,_0x2d913e[_0x4dd5('0x16')](_0x4dd5('0x17')),_0x21a339);_0x14c2b2[_0x4dd5('0x18')](_0x21a339);})[_0x4dd5('0xb')](function(_0x1d70c4){console[_0x4dd5('0x19')](_0x1d70c4);logger[_0x4dd5('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x5e1bbe,_0x2d913e[_0x4dd5('0x16')]('\x20|\x20'),_0x1d70c4['stack']);_0x14c2b2[_0x4dd5('0x1a')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 65573fa..4014195 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 _0x758a=['clone','hangup','diffTime','agent','lodash','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','interface','lastevent','getVoiceQueueByName','agentacw','agentcomplete','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalledAt','now','called','connectedlinenum','stack','agentringnoanswer','isNil','agentringnoanswerAt','rejected','holdtime','ringtime','talktime','error','queuecallerabandon','forIn','reason','abandoned','agentconnect','agentconnectAt','connectedlinename','connect','answered_elsewhere','answeredelsewheremembername','agentcompleteAt','complete','transfereruniqueid','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','calleridnum','calleridname','secondtransfererexten','transfertargetuniqueid'];(function(_0x510cbc,_0xf4a872){var _0x26d82a=function(_0x2ab95){while(--_0x2ab95){_0x510cbc['push'](_0x510cbc['shift']());}};_0x26d82a(++_0xf4a872);}(_0x758a,0x190));var _0xa758=function(_0x5598ee,_0xf2b65a){_0x5598ee=_0x5598ee-0x0;var _0x129518=_0x758a[_0x5598ee];return _0x129518;};'use strict';var _=require(_0xa758('0x0'));var util=require('util');var utils=require(_0xa758('0x1'));var agents={};var transfers={};function writeDB(_0x4ec8e2,_0xb26c6){utils[_0xa758('0x2')](util[_0xa758('0x3')](_0xa758('0x4'),_0x4ec8e2[_0xa758('0x5')],_0x4ec8e2[_0xa758('0x6')],_0x4ec8e2[_0xa758('0x7')],_0x4ec8e2[_0xa758('0x8')],_0x4ec8e2[_0xa758('0x9')],_0x4ec8e2['calleridnum'],_0x4ec8e2['connectedlinenum'],_0x4ec8e2[_0xa758('0xa')]));if(_0x4ec8e2[_0xa758('0x7')]){utils[_0xa758('0xb')](_0x4ec8e2[_0xa758('0x7')])['then'](function(_0x4ceb14){if(_0x4ceb14){_0x4ec8e2['type']=_0x4ceb14['type'];_0x4ec8e2[_0xa758('0xc')]=_0x4ec8e2[_0xa758('0xd')]?_0x4ceb14['acw']:![];_0x4ec8e2['acwtime']=_0x4ec8e2[_0xa758('0xc')]?_0x4ceb14[_0xa758('0xe')]:0x0;}utils['request']('CreateVoiceAgentReport',_0x4ec8e2);});}else{utils[_0xa758('0xf')](_0xa758('0x10'),_0x4ec8e2);}if(_0xb26c6){delete transfers[_0x4ec8e2[_0xa758('0x5')]];}else{delete agents[_0x4ec8e2[_0xa758('0x11')]];}}exports['agentcalled']=function(_0x1f6196){try{agents[_0x1f6196[_0xa758('0x11')]]=_0x1f6196;agents[_0x1f6196['destuniqueid']][_0xa758('0x12')]=utils[_0xa758('0x13')]();agents[_0x1f6196[_0xa758('0x11')]]['lastevent']=_0xa758('0x14');agents[_0x1f6196['destuniqueid']][_0xa758('0x15')]=null;agents[_0x1f6196['destuniqueid']]['connectedlinename']=null;}catch(_0x32f88b){utils['error'](_0x32f88b[_0xa758('0x16')]);}};exports[_0xa758('0x17')]=function(_0x41ea33){try{if(!_[_0xa758('0x18')](agents[_0x41ea33[_0xa758('0x11')]])){agents[_0x41ea33[_0xa758('0x11')]][_0xa758('0x17')]=!![];agents[_0x41ea33[_0xa758('0x11')]][_0xa758('0x19')]=utils[_0xa758('0x13')]();agents[_0x41ea33[_0xa758('0x11')]][_0xa758('0xa')]=_0xa758('0x1a');agents[_0x41ea33[_0xa758('0x11')]]['reason']=_0xa758('0x1a');agents[_0x41ea33['destuniqueid']][_0xa758('0x1b')]=_0x41ea33[_0xa758('0x1c')]?parseInt(_0x41ea33[_0xa758('0x1c')])/0x3e8:0x0;agents[_0x41ea33[_0xa758('0x11')]][_0xa758('0x1d')]=0x0;writeDB(agents[_0x41ea33[_0xa758('0x11')]]);}}catch(_0x3ca163){utils[_0xa758('0x1e')](_0x3ca163[_0xa758('0x16')]);}};exports[_0xa758('0x1f')]=function(_0x1c2a92){try{_[_0xa758('0x20')](agents,function(_0x2d0e00,_0x4c30d7){if(_0x2d0e00[_0xa758('0x5')]==_0x1c2a92['uniqueid']){_0x2d0e00[_0xa758('0x17')]=!![];_0x2d0e00[_0xa758('0x19')]=utils[_0xa758('0x13')]();_0x2d0e00[_0xa758('0xa')]='abandoned';_0x2d0e00[_0xa758('0x21')]=_0xa758('0x22');_0x2d0e00[_0xa758('0x1b')]=_0x1c2a92['holdtime'];_0x2d0e00[_0xa758('0x1d')]=0x0;writeDB(_0x2d0e00);}});}catch(_0x3acfbd){utils[_0xa758('0x1e')](_0x3acfbd['stack']);}};exports[_0xa758('0x23')]=function(_0x292403){try{if(agents[_0x292403[_0xa758('0x11')]]){agents[_0x292403['destuniqueid']][_0xa758('0x24')]=utils['now']();agents[_0x292403[_0xa758('0x11')]][_0xa758('0x15')]=_0x292403[_0xa758('0x15')];agents[_0x292403[_0xa758('0x11')]][_0xa758('0x25')]=_0x292403[_0xa758('0x25')];agents[_0x292403[_0xa758('0x11')]][_0xa758('0x1b')]=_0x292403[_0xa758('0x1c')];agents[_0x292403['destuniqueid']]['lastevent']=_0xa758('0x26');_[_0xa758('0x20')](agents,function(_0x4d8843,_0x235e88){if(_0x4d8843[_0xa758('0x11')]!=_0x292403[_0xa758('0x11')]&&_0x4d8843[_0xa758('0x5')]==_0x292403['uniqueid']){_0x4d8843[_0xa758('0x1d')]=0x0;_0x4d8843['holdtime']=_0x292403['ringtime'];_0x4d8843[_0xa758('0x17')]=!![];_0x4d8843[_0xa758('0x19')]=utils['now']();_0x4d8843[_0xa758('0xa')]=_0xa758('0x27');_0x4d8843[_0xa758('0x21')]='answered_elsewhere';_0x4d8843['answeredelsewheredestinationuniqueid']=_0x292403[_0xa758('0x11')];_0x4d8843[_0xa758('0x28')]=_0x292403[_0xa758('0x8')];writeDB(_0x4d8843);}});}}catch(_0x116be0){utils[_0xa758('0x1e')](_0x116be0[_0xa758('0x16')]);}};exports[_0xa758('0xd')]=function(_0x15471){try{if(!_['isNil'](agents[_0x15471[_0xa758('0x11')]])){agents[_0x15471[_0xa758('0x11')]]['agentcomplete']=!![];agents[_0x15471[_0xa758('0x11')]][_0xa758('0x29')]=utils[_0xa758('0x13')]();agents[_0x15471['destuniqueid']][_0xa758('0x1d')]=utils['diffTime'](agents[_0x15471['destuniqueid']]['agentcompleteAt'],agents[_0x15471[_0xa758('0x11')]][_0xa758('0x24')]);agents[_0x15471[_0xa758('0x11')]][_0xa758('0x21')]=_0x15471[_0xa758('0x21')];agents[_0x15471['destuniqueid']][_0xa758('0xa')]=_0xa758('0x2a');writeDB(agents[_0x15471[_0xa758('0x11')]]);}}catch(_0xe1be52){utils['error'](_0xe1be52[_0xa758('0x16')]);}};exports['blindtransfer']=function(_0x4f6e3d){try{if(!_['isNil'](agents[_0x4f6e3d[_0xa758('0x2b')]])){agents[_0x4f6e3d[_0xa758('0x2b')]]['transfer']=!![];agents[_0x4f6e3d[_0xa758('0x2b')]][_0xa758('0x2c')]=_0xa758('0x2d');agents[_0x4f6e3d[_0xa758('0x2b')]][_0xa758('0x2e')]=_0x4f6e3d[_0xa758('0x2f')];agents[_0x4f6e3d[_0xa758('0x2b')]][_0xa758('0x30')]=agents[_0x4f6e3d[_0xa758('0x2b')]]['uniqueid'];}}catch(_0x329d67){utils['error'](_0x329d67['stack']);}};exports[_0xa758('0x31')]=function(_0x3058a4){try{if(_0x3058a4[_0xa758('0x32')]==_0x3058a4[_0xa758('0x33')]){if(!_[_0xa758('0x18')](agents[_0x3058a4[_0xa758('0x34')]])){agents[_0x3058a4[_0xa758('0x34')]][_0xa758('0x35')]=!![];agents[_0x3058a4[_0xa758('0x34')]]['transfertype']=_0xa758('0x36');agents[_0x3058a4['secondtransfereruniqueid']][_0xa758('0x2e')]=_0x3058a4[_0xa758('0x37')];agents[_0x3058a4[_0xa758('0x34')]]['transferuniqueid']=_0x3058a4[_0xa758('0x32')];}if(_0x3058a4['transfereeuniqueid']&&agents[_0x3058a4[_0xa758('0x38')]]){agents[_0x3058a4[_0xa758('0x38')]][_0xa758('0x39')]=0x1;transfers[_0x3058a4['transfereeuniqueid']]=_['clone'](agents[_0x3058a4[_0xa758('0x38')]]);transfers[_0x3058a4[_0xa758('0x38')]][_0xa758('0x3a')]=agents[_0x3058a4['secondtransfereruniqueid']]['calleridnum'];transfers[_0x3058a4[_0xa758('0x38')]][_0xa758('0x3b')]=agents[_0x3058a4['secondtransfereruniqueid']][_0xa758('0x3b')];transfers[_0x3058a4['transfereeuniqueid']]['agentcalledAt']=utils[_0xa758('0x13')]();transfers[_0x3058a4['transfereeuniqueid']][_0xa758('0x24')]=utils['now']();transfers[_0x3058a4[_0xa758('0x38')]][_0xa758('0x1b')]=0x0;transfers[_0x3058a4['transfereeuniqueid']][_0xa758('0x39')]=0x2;}}else if(_0x3058a4[_0xa758('0x34')]==_0x3058a4['secondtransfererlinkedid']){if(!_[_0xa758('0x18')](agents[_0x3058a4[_0xa758('0x32')]])){agents[_0x3058a4[_0xa758('0x32')]][_0xa758('0x35')]=!![];agents[_0x3058a4[_0xa758('0x32')]][_0xa758('0x2c')]='ATTENDED';agents[_0x3058a4[_0xa758('0x32')]]['transferexten']=_0x3058a4[_0xa758('0x3c')];agents[_0x3058a4[_0xa758('0x32')]][_0xa758('0x30')]=_0x3058a4['secondtransfereruniqueid'];}if(_0x3058a4[_0xa758('0x3d')]&&agents[_0x3058a4[_0xa758('0x3d')]]){agents[_0x3058a4[_0xa758('0x3d')]]['agententerreason']=0x1;transfers[_0x3058a4['transfertargetuniqueid']]=_[_0xa758('0x3e')](agents[_0x3058a4[_0xa758('0x3d')]]);transfers[_0x3058a4[_0xa758('0x3d')]]['calleridnum']=agents[_0x3058a4[_0xa758('0x32')]][_0xa758('0x3a')];transfers[_0x3058a4[_0xa758('0x3d')]][_0xa758('0x3b')]=agents[_0x3058a4[_0xa758('0x32')]][_0xa758('0x3b')];transfers[_0x3058a4[_0xa758('0x3d')]]['agentcalledAt']=utils[_0xa758('0x13')]();transfers[_0x3058a4[_0xa758('0x3d')]]['agentconnectAt']=utils['now']();transfers[_0x3058a4[_0xa758('0x3d')]][_0xa758('0x1b')]=0x0;transfers[_0x3058a4[_0xa758('0x3d')]][_0xa758('0x39')]=0x2;}}}catch(_0x2876be){utils['error'](_0x2876be[_0xa758('0x16')]);}};exports[_0xa758('0x3f')]=function(_0x4b7f0c){try{if(transfers[_0x4b7f0c[_0xa758('0x5')]]){transfers[_0x4b7f0c[_0xa758('0x5')]][_0xa758('0xd')]=!![];transfers[_0x4b7f0c[_0xa758('0x5')]][_0xa758('0x29')]=utils[_0xa758('0x13')]();transfers[_0x4b7f0c[_0xa758('0x5')]][_0xa758('0x1d')]=utils[_0xa758('0x40')](transfers[_0x4b7f0c[_0xa758('0x5')]][_0xa758('0x29')],transfers[_0x4b7f0c[_0xa758('0x5')]][_0xa758('0x24')]);transfers[_0x4b7f0c[_0xa758('0x5')]]['reason']=_0xa758('0x41');transfers[_0x4b7f0c[_0xa758('0x5')]]['lastevent']=_0xa758('0x2a');writeDB(transfers[_0x4b7f0c['uniqueid']],!![]);}if(agents[_0x4b7f0c[_0xa758('0x5')]]&&agents[_0x4b7f0c[_0xa758('0x5')]][_0xa758('0x24')]){agents[_0x4b7f0c[_0xa758('0x5')]][_0xa758('0xd')]=!![];agents[_0x4b7f0c[_0xa758('0x5')]]['agentcompleteAt']=utils[_0xa758('0x13')]();agents[_0x4b7f0c[_0xa758('0x5')]][_0xa758('0x1d')]=utils[_0xa758('0x40')](agents[_0x4b7f0c[_0xa758('0x5')]][_0xa758('0x29')],agents[_0x4b7f0c['uniqueid']][_0xa758('0x24')]);agents[_0x4b7f0c['uniqueid']][_0xa758('0x21')]=agents[_0x4b7f0c['uniqueid']][_0xa758('0x35')]?_0xa758('0x35'):'agent';agents[_0x4b7f0c[_0xa758('0x5')]][_0xa758('0xa')]=_0xa758('0x2a');writeDB(agents[_0x4b7f0c[_0xa758('0x5')]]);}}catch(_0x3989f3){utils[_0xa758('0x1e')](_0x3989f3[_0xa758('0x16')]);}}; \ No newline at end of file +var _0x48fa=['membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwTimeout','request','CreateVoiceAgentReport','agentcalled','destuniqueid','now','connectedlinename','stack','agentringnoanswer','isNil','agentringnoanswerAt','rejected','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','abandoned','error','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcompleteAt','agentconnectAt','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','attendedtransfer','secondtransfereruniqueid','ATTENDED','origtransfererexten','origtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','transfertargetuniqueid','agentcalledAt','hangup','diffTime','agent','util','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel'];(function(_0x207d2f,_0x44400f){var _0x3c3498=function(_0x57fdfb){while(--_0x57fdfb){_0x207d2f['push'](_0x207d2f['shift']());}};_0x3c3498(++_0x44400f);}(_0x48fa,0x185));var _0xa48f=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x48fa[_0x486f4a];return _0x135d99;};'use strict';var _=require('lodash');var util=require(_0xa48f('0x0'));var utils=require(_0xa48f('0x1'));var agents={};var transfers={};function writeDB(_0xcac59a,_0xc3ce28){utils[_0xa48f('0x2')](util[_0xa48f('0x3')](_0xa48f('0x4'),_0xcac59a[_0xa48f('0x5')],_0xcac59a[_0xa48f('0x6')],_0xcac59a['queue'],_0xcac59a[_0xa48f('0x7')],_0xcac59a[_0xa48f('0x8')],_0xcac59a[_0xa48f('0x9')],_0xcac59a[_0xa48f('0xa')],_0xcac59a[_0xa48f('0xb')]));if(_0xcac59a['queue']){utils[_0xa48f('0xc')](_0xcac59a['queue'])[_0xa48f('0xd')](function(_0x29ae04){if(_0x29ae04){_0xcac59a[_0xa48f('0xe')]=_0x29ae04['type'];_0xcac59a[_0xa48f('0xf')]=_0xcac59a[_0xa48f('0x10')]?_0x29ae04['acw']:![];_0xcac59a['acwtime']=_0xcac59a[_0xa48f('0xf')]?_0x29ae04[_0xa48f('0x11')]:0x0;}utils[_0xa48f('0x12')](_0xa48f('0x13'),_0xcac59a);});}else{utils[_0xa48f('0x12')](_0xa48f('0x13'),_0xcac59a);}if(_0xc3ce28){delete transfers[_0xcac59a[_0xa48f('0x5')]];}else{delete agents[_0xcac59a['destuniqueid']];}}exports[_0xa48f('0x14')]=function(_0xeb8d92){try{agents[_0xeb8d92[_0xa48f('0x15')]]=_0xeb8d92;agents[_0xeb8d92['destuniqueid']]['agentcalledAt']=utils[_0xa48f('0x16')]();agents[_0xeb8d92[_0xa48f('0x15')]][_0xa48f('0xb')]='called';agents[_0xeb8d92[_0xa48f('0x15')]]['connectedlinenum']=null;agents[_0xeb8d92['destuniqueid']][_0xa48f('0x17')]=null;}catch(_0x259540){utils['error'](_0x259540[_0xa48f('0x18')]);}};exports[_0xa48f('0x19')]=function(_0x1c377c){try{if(!_[_0xa48f('0x1a')](agents[_0x1c377c[_0xa48f('0x15')]])){agents[_0x1c377c[_0xa48f('0x15')]][_0xa48f('0x19')]=!![];agents[_0x1c377c[_0xa48f('0x15')]][_0xa48f('0x1b')]=utils[_0xa48f('0x16')]();agents[_0x1c377c[_0xa48f('0x15')]]['lastevent']=_0xa48f('0x1c');agents[_0x1c377c['destuniqueid']][_0xa48f('0x1d')]=_0xa48f('0x1c');agents[_0x1c377c[_0xa48f('0x15')]][_0xa48f('0x1e')]=_0x1c377c[_0xa48f('0x1f')]?parseInt(_0x1c377c['ringtime'])/0x3e8:0x0;agents[_0x1c377c[_0xa48f('0x15')]][_0xa48f('0x20')]=0x0;writeDB(agents[_0x1c377c[_0xa48f('0x15')]]);}}catch(_0x39edc7){utils['error'](_0x39edc7[_0xa48f('0x18')]);}};exports[_0xa48f('0x21')]=function(_0x322542){try{_[_0xa48f('0x22')](agents,function(_0x50d245,_0x41d0fc){if(_0x50d245[_0xa48f('0x5')]==_0x322542[_0xa48f('0x5')]){_0x50d245[_0xa48f('0x19')]=!![];_0x50d245[_0xa48f('0x1b')]=utils[_0xa48f('0x16')]();_0x50d245[_0xa48f('0xb')]=_0xa48f('0x23');_0x50d245[_0xa48f('0x1d')]=_0xa48f('0x23');_0x50d245[_0xa48f('0x1e')]=_0x322542[_0xa48f('0x1e')];_0x50d245[_0xa48f('0x20')]=0x0;writeDB(_0x50d245);}});}catch(_0x354acc){utils[_0xa48f('0x24')](_0x354acc['stack']);}};exports['agentconnect']=function(_0x3084ed){try{if(agents[_0x3084ed[_0xa48f('0x15')]]){agents[_0x3084ed[_0xa48f('0x15')]]['agentconnectAt']=utils[_0xa48f('0x16')]();agents[_0x3084ed['destuniqueid']][_0xa48f('0xa')]=_0x3084ed[_0xa48f('0xa')];agents[_0x3084ed[_0xa48f('0x15')]][_0xa48f('0x17')]=_0x3084ed[_0xa48f('0x17')];agents[_0x3084ed[_0xa48f('0x15')]][_0xa48f('0x1e')]=_0x3084ed['ringtime'];agents[_0x3084ed[_0xa48f('0x15')]][_0xa48f('0xb')]=_0xa48f('0x25');_[_0xa48f('0x22')](agents,function(_0x1a87e3,_0x2dfda6){if(_0x1a87e3[_0xa48f('0x15')]!=_0x3084ed[_0xa48f('0x15')]&&_0x1a87e3[_0xa48f('0x5')]==_0x3084ed[_0xa48f('0x5')]){_0x1a87e3[_0xa48f('0x20')]=0x0;_0x1a87e3[_0xa48f('0x1e')]=_0x3084ed[_0xa48f('0x1f')];_0x1a87e3[_0xa48f('0x19')]=!![];_0x1a87e3[_0xa48f('0x1b')]=utils[_0xa48f('0x16')]();_0x1a87e3[_0xa48f('0xb')]=_0xa48f('0x26');_0x1a87e3[_0xa48f('0x1d')]=_0xa48f('0x26');_0x1a87e3[_0xa48f('0x27')]=_0x3084ed[_0xa48f('0x15')];_0x1a87e3[_0xa48f('0x28')]=_0x3084ed[_0xa48f('0x7')];writeDB(_0x1a87e3);}});}}catch(_0x17a945){utils['error'](_0x17a945[_0xa48f('0x18')]);}};exports['agentcomplete']=function(_0x78c29f){try{if(!_[_0xa48f('0x1a')](agents[_0x78c29f[_0xa48f('0x15')]])){agents[_0x78c29f[_0xa48f('0x15')]]['agentcomplete']=!![];agents[_0x78c29f[_0xa48f('0x15')]][_0xa48f('0x29')]=utils[_0xa48f('0x16')]();agents[_0x78c29f['destuniqueid']][_0xa48f('0x20')]=utils['diffTime'](agents[_0x78c29f['destuniqueid']]['agentcompleteAt'],agents[_0x78c29f['destuniqueid']][_0xa48f('0x2a')]);agents[_0x78c29f[_0xa48f('0x15')]]['reason']=_0x78c29f[_0xa48f('0x1d')];agents[_0x78c29f['destuniqueid']][_0xa48f('0xb')]=_0xa48f('0x2b');writeDB(agents[_0x78c29f['destuniqueid']]);}}catch(_0x459a51){utils[_0xa48f('0x24')](_0x459a51[_0xa48f('0x18')]);}};exports[_0xa48f('0x2c')]=function(_0x302b51){try{if(!_[_0xa48f('0x1a')](agents[_0x302b51[_0xa48f('0x2d')]])){agents[_0x302b51['transfereruniqueid']][_0xa48f('0x2e')]=!![];agents[_0x302b51[_0xa48f('0x2d')]][_0xa48f('0x2f')]=_0xa48f('0x30');agents[_0x302b51[_0xa48f('0x2d')]][_0xa48f('0x31')]=_0x302b51['extension'];agents[_0x302b51[_0xa48f('0x2d')]][_0xa48f('0x32')]=agents[_0x302b51[_0xa48f('0x2d')]]['uniqueid'];}}catch(_0x1527cc){utils[_0xa48f('0x24')](_0x1527cc[_0xa48f('0x18')]);}};exports[_0xa48f('0x33')]=function(_0x1d8dcf){try{if(_0x1d8dcf['origtransfereruniqueid']==_0x1d8dcf['origtransfererlinkedid']){if(!_[_0xa48f('0x1a')](agents[_0x1d8dcf[_0xa48f('0x34')]])){agents[_0x1d8dcf[_0xa48f('0x34')]]['transfer']=!![];agents[_0x1d8dcf[_0xa48f('0x34')]][_0xa48f('0x2f')]=_0xa48f('0x35');agents[_0x1d8dcf[_0xa48f('0x34')]]['transferexten']=_0x1d8dcf[_0xa48f('0x36')];agents[_0x1d8dcf['secondtransfereruniqueid']][_0xa48f('0x32')]=_0x1d8dcf[_0xa48f('0x37')];}if(_0x1d8dcf[_0xa48f('0x38')]&&agents[_0x1d8dcf[_0xa48f('0x38')]]){agents[_0x1d8dcf[_0xa48f('0x38')]][_0xa48f('0x39')]=0x1;transfers[_0x1d8dcf[_0xa48f('0x38')]]=_[_0xa48f('0x3a')](agents[_0x1d8dcf[_0xa48f('0x38')]]);transfers[_0x1d8dcf[_0xa48f('0x38')]][_0xa48f('0x9')]=agents[_0x1d8dcf[_0xa48f('0x34')]][_0xa48f('0x9')];transfers[_0x1d8dcf['transfereeuniqueid']][_0xa48f('0x3b')]=agents[_0x1d8dcf[_0xa48f('0x34')]][_0xa48f('0x3b')];transfers[_0x1d8dcf[_0xa48f('0x38')]]['agentcalledAt']=utils[_0xa48f('0x16')]();transfers[_0x1d8dcf['transfereeuniqueid']][_0xa48f('0x2a')]=utils[_0xa48f('0x16')]();transfers[_0x1d8dcf[_0xa48f('0x38')]]['holdtime']=0x0;transfers[_0x1d8dcf[_0xa48f('0x38')]][_0xa48f('0x39')]=0x2;}}else if(_0x1d8dcf[_0xa48f('0x34')]==_0x1d8dcf[_0xa48f('0x3c')]){if(!_[_0xa48f('0x1a')](agents[_0x1d8dcf[_0xa48f('0x37')]])){agents[_0x1d8dcf[_0xa48f('0x37')]][_0xa48f('0x2e')]=!![];agents[_0x1d8dcf[_0xa48f('0x37')]][_0xa48f('0x2f')]=_0xa48f('0x35');agents[_0x1d8dcf[_0xa48f('0x37')]][_0xa48f('0x31')]=_0x1d8dcf['secondtransfererexten'];agents[_0x1d8dcf[_0xa48f('0x37')]][_0xa48f('0x32')]=_0x1d8dcf[_0xa48f('0x34')];}if(_0x1d8dcf['transfertargetuniqueid']&&agents[_0x1d8dcf[_0xa48f('0x3d')]]){agents[_0x1d8dcf[_0xa48f('0x3d')]][_0xa48f('0x39')]=0x1;transfers[_0x1d8dcf[_0xa48f('0x3d')]]=_[_0xa48f('0x3a')](agents[_0x1d8dcf['transfertargetuniqueid']]);transfers[_0x1d8dcf[_0xa48f('0x3d')]][_0xa48f('0x9')]=agents[_0x1d8dcf[_0xa48f('0x37')]][_0xa48f('0x9')];transfers[_0x1d8dcf['transfertargetuniqueid']][_0xa48f('0x3b')]=agents[_0x1d8dcf['origtransfereruniqueid']][_0xa48f('0x3b')];transfers[_0x1d8dcf[_0xa48f('0x3d')]][_0xa48f('0x3e')]=utils[_0xa48f('0x16')]();transfers[_0x1d8dcf[_0xa48f('0x3d')]][_0xa48f('0x2a')]=utils['now']();transfers[_0x1d8dcf[_0xa48f('0x3d')]]['holdtime']=0x0;transfers[_0x1d8dcf[_0xa48f('0x3d')]][_0xa48f('0x39')]=0x2;}}}catch(_0x31565f){utils[_0xa48f('0x24')](_0x31565f[_0xa48f('0x18')]);}};exports[_0xa48f('0x3f')]=function(_0x619364){try{if(transfers[_0x619364['uniqueid']]){transfers[_0x619364[_0xa48f('0x5')]]['agentcomplete']=!![];transfers[_0x619364[_0xa48f('0x5')]][_0xa48f('0x29')]=utils[_0xa48f('0x16')]();transfers[_0x619364[_0xa48f('0x5')]]['talktime']=utils[_0xa48f('0x40')](transfers[_0x619364['uniqueid']]['agentcompleteAt'],transfers[_0x619364[_0xa48f('0x5')]]['agentconnectAt']);transfers[_0x619364[_0xa48f('0x5')]]['reason']='agent';transfers[_0x619364[_0xa48f('0x5')]][_0xa48f('0xb')]=_0xa48f('0x2b');writeDB(transfers[_0x619364[_0xa48f('0x5')]],!![]);}if(agents[_0x619364[_0xa48f('0x5')]]&&agents[_0x619364['uniqueid']][_0xa48f('0x2a')]){agents[_0x619364[_0xa48f('0x5')]][_0xa48f('0x10')]=!![];agents[_0x619364[_0xa48f('0x5')]]['agentcompleteAt']=utils['now']();agents[_0x619364[_0xa48f('0x5')]][_0xa48f('0x20')]=utils[_0xa48f('0x40')](agents[_0x619364[_0xa48f('0x5')]][_0xa48f('0x29')],agents[_0x619364['uniqueid']]['agentconnectAt']);agents[_0x619364['uniqueid']][_0xa48f('0x1d')]=agents[_0x619364['uniqueid']][_0xa48f('0x2e')]?_0xa48f('0x2e'):_0xa48f('0x41');agents[_0x619364[_0xa48f('0x5')]]['lastevent']=_0xa48f('0x2b');writeDB(agents[_0x619364[_0xa48f('0x5')]]);}}catch(_0x3d62ba){utils[_0xa48f('0x24')](_0x3d62ba['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index e219c4c..8793b08 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 _0xc392=['endtime','starttime','billableseconds','answertime','diffTime','attendedtransfer','localtwolinkedid','secondtransfererchannel','userfield','_attended','transfertargetchannel','destinationchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','mohtime','variable','xmd-originatecalleridnum','value','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','outboundrouteid','routeid','sipcallid','newexten','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','noop','gotoif','application','lodash','util','./utils','NO\x20ANSWER','FAILED','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','channel','type','accountcode','source','destination','disposition','getUserByInternal','UserId','request','CreateVoiceCallReport','uniqueid','newchannel','linkedid','calleridnum','exten','context','now','DOCUMENTATION','error','stack','newstate','isNil','channelstate','systemanswertime','transfer','ANSWERED','hangup','callerid','calleridname'];(function(_0x4e90c4,_0xc5566a){var _0x557591=function(_0x102a30){while(--_0x102a30){_0x4e90c4['push'](_0x4e90c4['shift']());}};_0x557591(++_0xc5566a);}(_0xc392,0x183));var _0x2c39=function(_0x4dc572,_0x9d2228){_0x4dc572=_0x4dc572-0x0;var _0x30b82a=_0xc392[_0x4dc572];return _0x30b82a;};'use strict';var _=require(_0x2c39('0x0'));var util=require(_0x2c39('0x1'));var utils=require(_0x2c39('0x2'));var dispositions=[_0x2c39('0x3'),'FAILED',_0x2c39('0x4'),_0x2c39('0x3'),_0x2c39('0x3'),_0x2c39('0x3'),'ANSWERED',_0x2c39('0x5'),_0x2c39('0x4'),_0x2c39('0x4'),_0x2c39('0x4')];var channels={};function writeDB(_0x50ce07){utils[_0x2c39('0x6')](util[_0x2c39('0x7')](_0x2c39('0x8'),_0x50ce07['uniqueid'],_0x50ce07[_0x2c39('0x9')],_0x50ce07[_0x2c39('0xa')],_0x50ce07[_0x2c39('0xb')],_0x50ce07[_0x2c39('0xc')],_0x50ce07[_0x2c39('0xd')],_0x50ce07['callerid'],_0x50ce07[_0x2c39('0xe')]));if(_0x50ce07['accountcode']){utils[_0x2c39('0xf')](_0x50ce07['accountcode'])['then'](function(_0x16ec46){if(_0x16ec46){_0x50ce07[_0x2c39('0x10')]=_0x16ec46['id'];}utils[_0x2c39('0x11')](_0x2c39('0x12'),_0x50ce07);});}else{utils[_0x2c39('0x11')](_0x2c39('0x12'),_0x50ce07);}if(channels[_0x50ce07['uniqueid']]){delete channels[_0x50ce07[_0x2c39('0x13')]];}}exports[_0x2c39('0x14')]=function(_0x1be754){try{if(_0x1be754[_0x2c39('0x13')]==_0x1be754[_0x2c39('0x15')]&&_0x1be754[_0x2c39('0x9')]!='OutgoingSpoolFailed'){channels[_0x1be754[_0x2c39('0x13')]]={'uniqueid':_0x1be754[_0x2c39('0x13')],'accountcode':_0x1be754[_0x2c39('0xb')],'source':_0x1be754[_0x2c39('0x16')],'destination':_0x1be754[_0x2c39('0x17')],'destinationcontext':_0x1be754[_0x2c39('0x18')],'channel':_0x1be754['channel'],'starttime':utils[_0x2c39('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x2c39('0x3'),'amaflags':_0x2c39('0x1a')};}}catch(_0x1c1c6c){utils[_0x2c39('0x1b')](_0x1c1c6c[_0x2c39('0x1c')]);}};exports[_0x2c39('0x1d')]=function(_0x256520){try{if(!_[_0x2c39('0x1e')](channels[_0x256520[_0x2c39('0x13')]])&&_0x256520[_0x2c39('0x1f')]==0x6){if(_[_0x2c39('0x1e')](channels[_0x256520[_0x2c39('0x13')]][_0x2c39('0x20')])){channels[_0x256520[_0x2c39('0x13')]][_0x2c39('0x20')]=utils[_0x2c39('0x19')]();}}else if(!_[_0x2c39('0x1e')](channels[_0x256520[_0x2c39('0x15')]])&&_0x256520[_0x2c39('0x1f')]==0x6&&_0x256520[_0x2c39('0x18')]!=_0x2c39('0x21')){channels[_0x256520['linkedid']][_0x2c39('0xb')]=_0x256520['accountcode'];channels[_0x256520['linkedid']]['destinationchannel']=_0x256520[_0x2c39('0x9')];if(_[_0x2c39('0x1e')](channels[_0x256520[_0x2c39('0x15')]]['answertime'])){channels[_0x256520[_0x2c39('0x15')]]['answertime']=utils['now']();}channels[_0x256520[_0x2c39('0x15')]]['disposition']=dispositions[_['toNumber'](_0x256520[_0x2c39('0x1f')])]||_0x2c39('0x22');}}catch(_0x12d7f4){utils[_0x2c39('0x1b')](_0x12d7f4['stack']);}};exports[_0x2c39('0x23')]=function(_0x1fd314){try{if(!_[_0x2c39('0x1e')](channels[_0x1fd314[_0x2c39('0x13')]])){if(_[_0x2c39('0x1e')](channels[_0x1fd314[_0x2c39('0x13')]][_0x2c39('0x24')])){channels[_0x1fd314[_0x2c39('0x13')]][_0x2c39('0x24')]=_0x1fd314[_0x2c39('0x25')]+'\x20<'+_0x1fd314[_0x2c39('0x16')]+'>';}channels[_0x1fd314[_0x2c39('0x13')]][_0x2c39('0x26')]=utils[_0x2c39('0x19')]();channels[_0x1fd314[_0x2c39('0x13')]]['duration']=utils['diffTime'](channels[_0x1fd314['uniqueid']][_0x2c39('0x26')],channels[_0x1fd314[_0x2c39('0x13')]][_0x2c39('0x27')]);channels[_0x1fd314[_0x2c39('0x13')]][_0x2c39('0x28')]=channels[_0x1fd314[_0x2c39('0x13')]][_0x2c39('0x29')]?utils[_0x2c39('0x2a')](channels[_0x1fd314[_0x2c39('0x13')]]['endtime'],channels[_0x1fd314['uniqueid']][_0x2c39('0x29')]):0x0;writeDB(channels[_0x1fd314[_0x2c39('0x13')]]);}}catch(_0x441d39){utils['error'](_0x441d39[_0x2c39('0x1c')]);}};exports[_0x2c39('0x2b')]=function(_0x3d89cf){try{if(!_[_0x2c39('0x1e')](channels[_0x3d89cf['localtwolinkedid']])){if(channels[_0x3d89cf[_0x2c39('0x2c')]][_0x2c39('0x9')]==_0x3d89cf['transfereechannel']){channels[_0x3d89cf['localtwolinkedid']]['destinationchannel']=_0x3d89cf[_0x2c39('0x2d')];channels[_0x3d89cf[_0x2c39('0x2c')]][_0x2c39('0x2e')]=_0x2c39('0x2f');}else if(channels[_0x3d89cf[_0x2c39('0x2c')]]['channel']=_0x3d89cf[_0x2c39('0x30')]){channels[_0x3d89cf[_0x2c39('0x2c')]][_0x2c39('0x31')]=_0x3d89cf[_0x2c39('0x32')];channels[_0x3d89cf[_0x2c39('0x2c')]][_0x2c39('0x2e')]=_0x2c39('0x2f');}}}catch(_0x1c44ae){utils['error'](_0x1c44ae[_0x2c39('0x1c')]);}};exports[_0x2c39('0x33')]=function(_0x419a0f){try{if(!_[_0x2c39('0x1e')](channels[_0x419a0f[_0x2c39('0x13')]])){channels[_0x419a0f[_0x2c39('0x13')]]['musiconholdstartAt']=utils[_0x2c39('0x19')]();}}catch(_0x34cc7b){utils['error'](_0x34cc7b[_0x2c39('0x1c')]);}};exports['musiconholdstop']=function(_0x2198fb){try{if(!_[_0x2c39('0x1e')](channels[_0x2198fb['uniqueid']])){if(!_['isNil'](channels[_0x2198fb[_0x2c39('0x13')]][_0x2c39('0x34')])){channels[_0x2198fb['uniqueid']][_0x2c39('0x35')]+=utils[_0x2c39('0x2a')](utils[_0x2c39('0x19')](),channels[_0x2198fb[_0x2c39('0x13')]][_0x2c39('0x34')]);delete channels[_0x2198fb[_0x2c39('0x13')]][_0x2c39('0x34')];}}}catch(_0x46f7dd){utils[_0x2c39('0x1b')](_0x46f7dd[_0x2c39('0x1c')]);}};exports['varset']=function(_0x5730d4){try{if(!_['isNil'](channels[_0x5730d4[_0x2c39('0x13')]])){if(!_[_0x2c39('0x1e')](_0x5730d4[_0x2c39('0x36')][_0x2c39('0x37')])){channels[_0x5730d4[_0x2c39('0x13')]][_0x2c39('0xc')]=_0x5730d4[_0x2c39('0x38')];}if(!_[_0x2c39('0x1e')](_0x5730d4[_0x2c39('0x36')][_0x2c39('0x39')])){channels[_0x5730d4[_0x2c39('0x13')]]['destination']=_0x5730d4[_0x2c39('0x38')];channels[_0x5730d4[_0x2c39('0x13')]][_0x2c39('0x24')]='\x22'+_0x5730d4[_0x2c39('0x38')]+_0x2c39('0x3a')+_0x5730d4['value']+'>';}if(!_[_0x2c39('0x1e')](_0x5730d4[_0x2c39('0x36')][_0x2c39('0x3b')])||!_[_0x2c39('0x1e')](_0x5730d4['variable'][_0x2c39('0x3c')])){channels[_0x5730d4[_0x2c39('0x13')]][_0x2c39('0x24')]=_0x5730d4['value'];}if(!_[_0x2c39('0x1e')](_0x5730d4[_0x2c39('0x36')][_0x2c39('0x3d')])||!_[_0x2c39('0x1e')](_0x5730d4[_0x2c39('0x36')][_0x2c39('0x3e')])){channels[_0x5730d4[_0x2c39('0x13')]][_0x2c39('0x3f')]='Queue';channels[_0x5730d4[_0x2c39('0x13')]][_0x2c39('0x40')]=_0x5730d4[_0x2c39('0x38')];channels[_0x5730d4[_0x2c39('0x13')]][_0x2c39('0x41')]=!![];}if(!_[_0x2c39('0x1e')](_0x5730d4[_0x2c39('0x36')][_0x2c39('0x42')])){channels[_0x5730d4[_0x2c39('0x13')]][_0x2c39('0x43')]=_0x5730d4[_0x2c39('0x38')];}if(!_[_0x2c39('0x1e')](_0x5730d4['variable'][_0x2c39('0x44')])){channels[_0x5730d4['uniqueid']][_0x2c39('0xa')]=_0x5730d4['value'];}if(!_['isNil'](_0x5730d4[_0x2c39('0x36')][_0x2c39('0x45')])){channels[_0x5730d4[_0x2c39('0x13')]][_0x2c39('0x46')]=_0x5730d4[_0x2c39('0x38')];}if(!_['isNil'](_0x5730d4[_0x2c39('0x36')][_0x2c39('0x47')])){channels[_0x5730d4[_0x2c39('0x13')]][_0x2c39('0x47')]=_0x5730d4[_0x2c39('0x38')];}}}catch(_0x16e4be){utils[_0x2c39('0x1b')](_0x16e4be['stack']);}};exports[_0x2c39('0x48')]=function(_0x57f9d6){try{if(!_[_0x2c39('0x1e')](channels[_0x57f9d6['uniqueid']])){if(_0x57f9d6['application'][_0x2c39('0x49')]()==_0x2c39('0x4a')&&_[_0x2c39('0x4b')](_0x57f9d6[_0x2c39('0x4c')][_0x2c39('0x49')](),_0x2c39('0x4d'))){var _0x460899=_0x57f9d6[_0x2c39('0x4c')][_0x2c39('0x4e')]('=');var _0x46c5e1=_0x460899[0x0][_0x2c39('0x4f')](_0x460899[0x0][_0x2c39('0x50')]('(')+0x1,_0x460899[0x0][_0x2c39('0x50')](')'));var _0x2c18cd=_0x460899[0x1];channels[_0x57f9d6[_0x2c39('0x13')]][_0x46c5e1]=_0x2c18cd;}if(!_[_0x2c39('0x51')]([_0x2c39('0x23'),_0x2c39('0x52'),'execif','set',_0x2c39('0x53')],_0x57f9d6[_0x2c39('0x54')]['toLowerCase']())){channels[_0x57f9d6[_0x2c39('0x13')]][_0x2c39('0x3f')]=_0x57f9d6[_0x2c39('0x54')];channels[_0x57f9d6[_0x2c39('0x13')]][_0x2c39('0x40')]=_0x57f9d6[_0x2c39('0x4c')];}}}catch(_0x246c21){utils[_0x2c39('0x1b')](_0x246c21['stack']);}}; \ No newline at end of file +var _0xb787=['noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','accountcode','source','destination','callerid','disposition','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','linkedid','calleridnum','exten','DOCUMENTATION','stack','systemanswertime','now','isNil','channelstate','context','answertime','toNumber','hangup','endtime','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','transfereechannel','destinationchannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','error','musiconholdstart','musiconholdstop','mohtime','musiconholdstartAt','varset','variable','xmd-originatecalleridnum','value','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','type','outboundrouteid','routeid','sipcallid','newexten','application','toLowerCase','set','startsWith','appdata','cdr','substring','lastIndexOf','includes'];(function(_0x122b05,_0x3768e8){var _0x40c4c9=function(_0x521ec3){while(--_0x521ec3){_0x122b05['push'](_0x122b05['shift']());}};_0x40c4c9(++_0x3768e8);}(_0xb787,0xa9));var _0x7b78=function(_0x4d6882,_0x2a18c6){_0x4d6882=_0x4d6882-0x0;var _0x1c2d45=_0xb787[_0x4d6882];return _0x1c2d45;};'use strict';var _=require(_0x7b78('0x0'));var util=require(_0x7b78('0x1'));var utils=require(_0x7b78('0x2'));var dispositions=[_0x7b78('0x3'),_0x7b78('0x4'),_0x7b78('0x4'),_0x7b78('0x3'),'NO\x20ANSWER',_0x7b78('0x3'),_0x7b78('0x5'),_0x7b78('0x6'),_0x7b78('0x4'),_0x7b78('0x4'),_0x7b78('0x4')];var channels={};function writeDB(_0x2503c8){utils[_0x7b78('0x7')](util['format'](_0x7b78('0x8'),_0x2503c8[_0x7b78('0x9')],_0x2503c8[_0x7b78('0xa')],_0x2503c8['type'],_0x2503c8[_0x7b78('0xb')],_0x2503c8[_0x7b78('0xc')],_0x2503c8[_0x7b78('0xd')],_0x2503c8[_0x7b78('0xe')],_0x2503c8[_0x7b78('0xf')]));if(_0x2503c8['accountcode']){utils[_0x7b78('0x10')](_0x2503c8[_0x7b78('0xb')])[_0x7b78('0x11')](function(_0x30a469){if(_0x30a469){_0x2503c8[_0x7b78('0x12')]=_0x30a469['id'];}utils[_0x7b78('0x13')](_0x7b78('0x14'),_0x2503c8);});}else{utils['request'](_0x7b78('0x14'),_0x2503c8);}if(channels[_0x2503c8['uniqueid']]){delete channels[_0x2503c8[_0x7b78('0x9')]];}}exports[_0x7b78('0x15')]=function(_0x3db68e){try{if(_0x3db68e[_0x7b78('0x9')]==_0x3db68e[_0x7b78('0x16')]&&_0x3db68e[_0x7b78('0xa')]!='OutgoingSpoolFailed'){channels[_0x3db68e[_0x7b78('0x9')]]={'uniqueid':_0x3db68e[_0x7b78('0x9')],'accountcode':_0x3db68e[_0x7b78('0xb')],'source':_0x3db68e[_0x7b78('0x17')],'destination':_0x3db68e[_0x7b78('0x18')],'destinationcontext':_0x3db68e['context'],'channel':_0x3db68e[_0x7b78('0xa')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x7b78('0x3'),'amaflags':_0x7b78('0x19')};}}catch(_0x108580){utils['error'](_0x108580[_0x7b78('0x1a')]);}};exports['newstate']=function(_0x5ed79d){try{if(!_['isNil'](channels[_0x5ed79d[_0x7b78('0x9')]])&&_0x5ed79d['channelstate']==0x6){if(_['isNil'](channels[_0x5ed79d['uniqueid']][_0x7b78('0x1b')])){channels[_0x5ed79d[_0x7b78('0x9')]][_0x7b78('0x1b')]=utils[_0x7b78('0x1c')]();}}else if(!_[_0x7b78('0x1d')](channels[_0x5ed79d['linkedid']])&&_0x5ed79d[_0x7b78('0x1e')]==0x6&&_0x5ed79d[_0x7b78('0x1f')]!='transfer'){channels[_0x5ed79d[_0x7b78('0x16')]][_0x7b78('0xb')]=_0x5ed79d[_0x7b78('0xb')];channels[_0x5ed79d[_0x7b78('0x16')]]['destinationchannel']=_0x5ed79d['channel'];if(_[_0x7b78('0x1d')](channels[_0x5ed79d[_0x7b78('0x16')]][_0x7b78('0x20')])){channels[_0x5ed79d['linkedid']][_0x7b78('0x20')]=utils[_0x7b78('0x1c')]();}channels[_0x5ed79d[_0x7b78('0x16')]][_0x7b78('0xf')]=dispositions[_[_0x7b78('0x21')](_0x5ed79d['channelstate'])]||'ANSWERED';}}catch(_0x225782){utils['error'](_0x225782[_0x7b78('0x1a')]);}};exports[_0x7b78('0x22')]=function(_0x281eed){try{if(!_['isNil'](channels[_0x281eed['uniqueid']])){if(_[_0x7b78('0x1d')](channels[_0x281eed[_0x7b78('0x9')]]['callerid'])){channels[_0x281eed[_0x7b78('0x9')]][_0x7b78('0xe')]=_0x281eed['calleridname']+'\x20<'+_0x281eed['calleridnum']+'>';}channels[_0x281eed['uniqueid']][_0x7b78('0x23')]=utils[_0x7b78('0x1c')]();channels[_0x281eed[_0x7b78('0x9')]]['duration']=utils[_0x7b78('0x24')](channels[_0x281eed['uniqueid']]['endtime'],channels[_0x281eed['uniqueid']][_0x7b78('0x25')]);channels[_0x281eed[_0x7b78('0x9')]][_0x7b78('0x26')]=channels[_0x281eed['uniqueid']][_0x7b78('0x20')]?utils[_0x7b78('0x24')](channels[_0x281eed[_0x7b78('0x9')]][_0x7b78('0x23')],channels[_0x281eed[_0x7b78('0x9')]]['answertime']):0x0;writeDB(channels[_0x281eed[_0x7b78('0x9')]]);}}catch(_0x5ee1ac){utils['error'](_0x5ee1ac[_0x7b78('0x1a')]);}};exports[_0x7b78('0x27')]=function(_0x1103fa){try{if(!_[_0x7b78('0x1d')](channels[_0x1103fa[_0x7b78('0x28')]])){if(channels[_0x1103fa[_0x7b78('0x28')]][_0x7b78('0xa')]==_0x1103fa[_0x7b78('0x29')]){channels[_0x1103fa[_0x7b78('0x28')]][_0x7b78('0x2a')]=_0x1103fa[_0x7b78('0x2b')];channels[_0x1103fa[_0x7b78('0x28')]][_0x7b78('0x2c')]=_0x7b78('0x2d');}else if(channels[_0x1103fa[_0x7b78('0x28')]][_0x7b78('0xa')]=_0x1103fa[_0x7b78('0x2e')]){channels[_0x1103fa[_0x7b78('0x28')]]['destinationchannel']=_0x1103fa['origtransfererchannel'];channels[_0x1103fa[_0x7b78('0x28')]][_0x7b78('0x2c')]='_attended';}}}catch(_0x30733a){utils[_0x7b78('0x2f')](_0x30733a[_0x7b78('0x1a')]);}};exports[_0x7b78('0x30')]=function(_0x115879){try{if(!_[_0x7b78('0x1d')](channels[_0x115879[_0x7b78('0x9')]])){channels[_0x115879[_0x7b78('0x9')]]['musiconholdstartAt']=utils[_0x7b78('0x1c')]();}}catch(_0x4d0071){utils[_0x7b78('0x2f')](_0x4d0071[_0x7b78('0x1a')]);}};exports[_0x7b78('0x31')]=function(_0x15460f){try{if(!_[_0x7b78('0x1d')](channels[_0x15460f['uniqueid']])){if(!_[_0x7b78('0x1d')](channels[_0x15460f['uniqueid']]['musiconholdstartAt'])){channels[_0x15460f[_0x7b78('0x9')]][_0x7b78('0x32')]+=utils[_0x7b78('0x24')](utils[_0x7b78('0x1c')](),channels[_0x15460f[_0x7b78('0x9')]][_0x7b78('0x33')]);delete channels[_0x15460f['uniqueid']][_0x7b78('0x33')];}}}catch(_0x33e09e){utils[_0x7b78('0x2f')](_0x33e09e[_0x7b78('0x1a')]);}};exports[_0x7b78('0x34')]=function(_0x36fe06){try{if(!_[_0x7b78('0x1d')](channels[_0x36fe06[_0x7b78('0x9')]])){if(!_[_0x7b78('0x1d')](_0x36fe06[_0x7b78('0x35')][_0x7b78('0x36')])){channels[_0x36fe06['uniqueid']][_0x7b78('0xc')]=_0x36fe06['value'];}if(!_[_0x7b78('0x1d')](_0x36fe06[_0x7b78('0x35')]['xmd-phone'])){channels[_0x36fe06['uniqueid']][_0x7b78('0xd')]=_0x36fe06[_0x7b78('0x37')];channels[_0x36fe06[_0x7b78('0x9')]][_0x7b78('0xe')]='\x22'+_0x36fe06[_0x7b78('0x37')]+'\x22\x20<'+_0x36fe06['value']+'>';}if(!_[_0x7b78('0x1d')](_0x36fe06['variable'][_0x7b78('0x38')])||!_[_0x7b78('0x1d')](_0x36fe06['variable'][_0x7b78('0x39')])){channels[_0x36fe06[_0x7b78('0x9')]][_0x7b78('0xe')]=_0x36fe06[_0x7b78('0x37')];}if(!_[_0x7b78('0x1d')](_0x36fe06['variable'][_0x7b78('0x3a')])||!_[_0x7b78('0x1d')](_0x36fe06[_0x7b78('0x35')][_0x7b78('0x3b')])){channels[_0x36fe06['uniqueid']][_0x7b78('0x3c')]=_0x7b78('0x3d');channels[_0x36fe06['uniqueid']][_0x7b78('0x3e')]=_0x36fe06['value'];channels[_0x36fe06[_0x7b78('0x9')]]['queue']=!![];}if(!_[_0x7b78('0x1d')](_0x36fe06[_0x7b78('0x35')][_0x7b78('0x3f')])){channels[_0x36fe06[_0x7b78('0x9')]][_0x7b78('0x40')]=_0x36fe06[_0x7b78('0x37')];}if(!_[_0x7b78('0x1d')](_0x36fe06['variable'][_0x7b78('0x41')])){channels[_0x36fe06[_0x7b78('0x9')]][_0x7b78('0x42')]=_0x36fe06[_0x7b78('0x37')];}if(!_[_0x7b78('0x1d')](_0x36fe06[_0x7b78('0x35')][_0x7b78('0x43')])){channels[_0x36fe06[_0x7b78('0x9')]][_0x7b78('0x44')]=_0x36fe06['value'];}if(!_[_0x7b78('0x1d')](_0x36fe06[_0x7b78('0x35')][_0x7b78('0x45')])){channels[_0x36fe06[_0x7b78('0x9')]][_0x7b78('0x45')]=_0x36fe06[_0x7b78('0x37')];}}}catch(_0x49d56c){utils[_0x7b78('0x2f')](_0x49d56c[_0x7b78('0x1a')]);}};exports[_0x7b78('0x46')]=function(_0x1cae25){try{if(!_[_0x7b78('0x1d')](channels[_0x1cae25[_0x7b78('0x9')]])){if(_0x1cae25[_0x7b78('0x47')][_0x7b78('0x48')]()==_0x7b78('0x49')&&_[_0x7b78('0x4a')](_0x1cae25[_0x7b78('0x4b')][_0x7b78('0x48')](),_0x7b78('0x4c'))){var _0x50e928=_0x1cae25[_0x7b78('0x4b')]['split']('=');var _0x5af9c6=_0x50e928[0x0][_0x7b78('0x4d')](_0x50e928[0x0][_0x7b78('0x4e')]('(')+0x1,_0x50e928[0x0][_0x7b78('0x4e')](')'));var _0x831595=_0x50e928[0x1];channels[_0x1cae25[_0x7b78('0x9')]][_0x5af9c6]=_0x831595;}if(!_[_0x7b78('0x4f')](['hangup',_0x7b78('0x50'),_0x7b78('0x51'),_0x7b78('0x49'),_0x7b78('0x52')],_0x1cae25['application'][_0x7b78('0x48')]())){channels[_0x1cae25[_0x7b78('0x9')]][_0x7b78('0x3c')]=_0x1cae25[_0x7b78('0x47')];channels[_0x1cae25[_0x7b78('0x9')]][_0x7b78('0x3e')]=_0x1cae25[_0x7b78('0x4b')];}}}catch(_0x51b23c){utils[_0x7b78('0x2f')](_0x51b23c[_0x7b78('0x1a')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 7fe2a16..1e66e4c 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 _0xc4aa=['lodash','connect','info','CONNECTED','shutdown','FULLYBOOTED','error','close','CLOSE','./utils'];(function(_0x666204,_0x6dbd92){var _0x371f5f=function(_0x57442b){while(--_0x57442b){_0x666204['push'](_0x666204['shift']());}};_0x371f5f(++_0x6dbd92);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xc4aa[_0x255d5b];return _0x3e141a;};'use strict';var utils=require(_0xac4a('0x0'));var _=require(_0xac4a('0x1'));exports[_0xac4a('0x2')]=function(){utils[_0xac4a('0x3')](_0xac4a('0x4'));};exports[_0xac4a('0x5')]=function(){utils['info']('SHUTDOWN');};exports['fullybooted']=function(){utils[_0xac4a('0x3')](_0xac4a('0x6'));};exports[_0xac4a('0x7')]=function(_0x215f39){utils[_0xac4a('0x7')](_0x215f39);};exports[_0xac4a('0x8')]=function(){utils[_0xac4a('0x3')](_0xac4a('0x9'));};exports['managerevent']=function(_0x5b8339){}; \ No newline at end of file +var _0xa46e=['info','CONNECTED','shutdown','SHUTDOWN','error','close','CLOSE','managerevent','./utils','lodash'];(function(_0x352e9f,_0x466bd0){var _0x1ced65=function(_0x76ba22){while(--_0x76ba22){_0x352e9f['push'](_0x352e9f['shift']());}};_0x1ced65(++_0x466bd0);}(_0xa46e,0x8a));var _0xea46=function(_0x72a33d,_0x5691da){_0x72a33d=_0x72a33d-0x0;var _0x2621d5=_0xa46e[_0x72a33d];return _0x2621d5;};'use strict';var utils=require(_0xea46('0x0'));var _=require(_0xea46('0x1'));exports['connect']=function(){utils[_0xea46('0x2')](_0xea46('0x3'));};exports[_0xea46('0x4')]=function(){utils['info'](_0xea46('0x5'));};exports['fullybooted']=function(){utils[_0xea46('0x2')]('FULLYBOOTED');};exports[_0xea46('0x6')]=function(_0x528404){utils[_0xea46('0x6')](_0x528404);};exports[_0xea46('0x7')]=function(){utils['info'](_0xea46('0x8'));};exports[_0xea46('0x9')]=function(_0xe7d428){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 6d0bce1..5fd07a8 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 _0x88b5=['duration','diffTime','starttime','answertime','endtime','lodash','util','./utils','info','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','dialstring','connectedlinenum','dialstatus','newexten','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','error','stack','varset','isNil','outboundrouteid','value','dialbegin','assign','now','lastevent','called','dialend','ANSWER','connect','hangup'];(function(_0x4b8fdb,_0x5d7f38){var _0x4e5601=function(_0x5cf9c4){while(--_0x5cf9c4){_0x4b8fdb['push'](_0x4b8fdb['shift']());}};_0x4e5601(++_0x5d7f38);}(_0x88b5,0x10f));var _0x588b=function(_0x5a2335,_0x4f58a7){_0x5a2335=_0x5a2335-0x0;var _0x8e52bd=_0x88b5[_0x5a2335];return _0x8e52bd;};'use strict';var _=require(_0x588b('0x0'));var util=require(_0x588b('0x1'));var utils=require(_0x588b('0x2'));var dials={};function writeDB(_0x52ff2d){utils[_0x588b('0x3')](util[_0x588b('0x4')](_0x588b('0x5'),_0x52ff2d[_0x588b('0x6')],_0x52ff2d[_0x588b('0x7')],_0x52ff2d[_0x588b('0x8')],_0x52ff2d['calleridnum'],_0x52ff2d[_0x588b('0x9')],_0x52ff2d[_0x588b('0xa')]));utils['request']('CreateVoiceDialReport',_0x52ff2d);delete dials[_0x52ff2d[_0x588b('0x6')]];}exports[_0x588b('0xb')]=function(_0x4d259f){try{if(_0x4d259f[_0x588b('0xc')][_0x588b('0xd')]()==_0x588b('0xe')&&_[_0x588b('0xf')](_0x4d259f[_0x588b('0x10')]['toLowerCase'](),_0x588b('0x11'))){var _0x537eca=_0x4d259f['appdata']['split']('=');dials[_0x4d259f[_0x588b('0x6')]]={'routeId':_0x537eca[0x1]};}}catch(_0x2d65f6){utils[_0x588b('0x12')](_0x2d65f6[_0x588b('0x13')]);}};exports[_0x588b('0x14')]=function(_0x22ee1a){try{if(!_[_0x588b('0x15')](_0x22ee1a['variable'][_0x588b('0x16')])){dials[_0x22ee1a[_0x588b('0x6')]]={'routeId':_0x22ee1a[_0x588b('0x17')]};}}catch(_0x2312e2){utils[_0x588b('0x12')](_0x2312e2[_0x588b('0x13')]);}};exports[_0x588b('0x18')]=function(_0x25d118){try{if(!_[_0x588b('0x15')](dials[_0x25d118[_0x588b('0x6')]])){dials[_0x25d118[_0x588b('0x6')]]=_[_0x588b('0x19')](dials[_0x25d118[_0x588b('0x6')]],_0x25d118);dials[_0x25d118['uniqueid']]['starttime']=utils[_0x588b('0x1a')]();dials[_0x25d118[_0x588b('0x6')]][_0x588b('0x1b')]=_0x588b('0x1c');}}catch(_0x221220){utils[_0x588b('0x12')](_0x221220['stack']);}};exports[_0x588b('0x1d')]=function(_0x2faa81){try{if(!_[_0x588b('0x15')](dials[_0x2faa81['uniqueid']])){dials[_0x2faa81[_0x588b('0x6')]][_0x588b('0xa')]=_0x2faa81[_0x588b('0xa')];if(_0x2faa81[_0x588b('0xa')]==_0x588b('0x1e')){dials[_0x2faa81[_0x588b('0x6')]]=_[_0x588b('0x19')](dials[_0x2faa81['uniqueid']],_0x2faa81);dials[_0x2faa81[_0x588b('0x6')]]['answertime']=utils[_0x588b('0x1a')]();dials[_0x2faa81[_0x588b('0x6')]][_0x588b('0x1b')]=_0x588b('0x1f');}}}catch(_0x341802){utils[_0x588b('0x12')](_0x341802[_0x588b('0x13')]);}};exports[_0x588b('0x20')]=function(_0x185df5){try{if(!_[_0x588b('0x15')](dials[_0x185df5[_0x588b('0x6')]])){dials[_0x185df5['uniqueid']]=_[_0x588b('0x19')](dials[_0x185df5['uniqueid']],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x185df5[_0x588b('0x6')]][_0x588b('0x21')]=utils[_0x588b('0x22')](dials[_0x185df5[_0x588b('0x6')]]['endtime'],dials[_0x185df5[_0x588b('0x6')]][_0x588b('0x23')]);dials[_0x185df5[_0x588b('0x6')]]['holdtime']=utils[_0x588b('0x22')](dials[_0x185df5[_0x588b('0x6')]][_0x588b('0x24')]||dials[_0x185df5[_0x588b('0x6')]][_0x588b('0x25')],dials[_0x185df5[_0x588b('0x6')]][_0x588b('0x23')]);dials[_0x185df5[_0x588b('0x6')]]['billableseconds']=dials[_0x185df5[_0x588b('0x6')]][_0x588b('0x24')]?utils[_0x588b('0x22')](dials[_0x185df5[_0x588b('0x6')]]['endtime'],dials[_0x185df5['uniqueid']][_0x588b('0x24')]):0x0;writeDB(dials[_0x185df5[_0x588b('0x6')]]);}}catch(_0x326bc4){utils[_0x588b('0x12')](_0x326bc4[_0x588b('0x13')]);}}; \ No newline at end of file +var _0x3773=['starttime','billableseconds','lodash','util','./utils','info','format','uniqueid','channel','dialstring','request','CreateVoiceDialReport','application','set','startsWith','appdata','toLowerCase','cdr(routeid)','split','stack','isNil','value','dialbegin','assign','now','called','error','dialend','dialstatus','ANSWER','answertime','connect','duration','diffTime','endtime','holdtime'];(function(_0x32a4b4,_0x233a38){var _0x3c7f32=function(_0x53d542){while(--_0x53d542){_0x32a4b4['push'](_0x32a4b4['shift']());}};_0x3c7f32(++_0x233a38);}(_0x3773,0x92));var _0x3377=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x3773[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x3377('0x0'));var util=require(_0x3377('0x1'));var utils=require(_0x3377('0x2'));var dials={};function writeDB(_0x55f79c){utils[_0x3377('0x3')](util[_0x3377('0x4')]('DIAL|%s|%s|%s|%s|%s|%s',_0x55f79c[_0x3377('0x5')],_0x55f79c[_0x3377('0x6')],_0x55f79c[_0x3377('0x7')],_0x55f79c['calleridnum'],_0x55f79c['connectedlinenum'],_0x55f79c['dialstatus']));utils[_0x3377('0x8')](_0x3377('0x9'),_0x55f79c);delete dials[_0x55f79c[_0x3377('0x5')]];}exports['newexten']=function(_0x215a50){try{if(_0x215a50[_0x3377('0xa')]['toLowerCase']()==_0x3377('0xb')&&_[_0x3377('0xc')](_0x215a50[_0x3377('0xd')][_0x3377('0xe')](),_0x3377('0xf'))){var _0x4613d3=_0x215a50[_0x3377('0xd')][_0x3377('0x10')]('=');dials[_0x215a50[_0x3377('0x5')]]={'routeId':_0x4613d3[0x1]};}}catch(_0x55f5ef){utils['error'](_0x55f5ef[_0x3377('0x11')]);}};exports['varset']=function(_0x2220cb){try{if(!_[_0x3377('0x12')](_0x2220cb['variable']['outboundrouteid'])){dials[_0x2220cb[_0x3377('0x5')]]={'routeId':_0x2220cb[_0x3377('0x13')]};}}catch(_0x170c45){utils['error'](_0x170c45[_0x3377('0x11')]);}};exports[_0x3377('0x14')]=function(_0x1a28b0){try{if(!_['isNil'](dials[_0x1a28b0['uniqueid']])){dials[_0x1a28b0['uniqueid']]=_[_0x3377('0x15')](dials[_0x1a28b0[_0x3377('0x5')]],_0x1a28b0);dials[_0x1a28b0['uniqueid']]['starttime']=utils[_0x3377('0x16')]();dials[_0x1a28b0[_0x3377('0x5')]]['lastevent']=_0x3377('0x17');}}catch(_0x58ee1f){utils[_0x3377('0x18')](_0x58ee1f[_0x3377('0x11')]);}};exports[_0x3377('0x19')]=function(_0x23a56c){try{if(!_[_0x3377('0x12')](dials[_0x23a56c[_0x3377('0x5')]])){dials[_0x23a56c[_0x3377('0x5')]][_0x3377('0x1a')]=_0x23a56c['dialstatus'];if(_0x23a56c[_0x3377('0x1a')]==_0x3377('0x1b')){dials[_0x23a56c['uniqueid']]=_[_0x3377('0x15')](dials[_0x23a56c[_0x3377('0x5')]],_0x23a56c);dials[_0x23a56c['uniqueid']][_0x3377('0x1c')]=utils[_0x3377('0x16')]();dials[_0x23a56c[_0x3377('0x5')]]['lastevent']=_0x3377('0x1d');}}}catch(_0x98ebf){utils['error'](_0x98ebf[_0x3377('0x11')]);}};exports['hangup']=function(_0x4bc61f){try{if(!_[_0x3377('0x12')](dials[_0x4bc61f[_0x3377('0x5')]])){dials[_0x4bc61f['uniqueid']]=_[_0x3377('0x15')](dials[_0x4bc61f[_0x3377('0x5')]],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x4bc61f[_0x3377('0x5')]][_0x3377('0x1e')]=utils[_0x3377('0x1f')](dials[_0x4bc61f[_0x3377('0x5')]][_0x3377('0x20')],dials[_0x4bc61f[_0x3377('0x5')]]['starttime']);dials[_0x4bc61f[_0x3377('0x5')]][_0x3377('0x21')]=utils[_0x3377('0x1f')](dials[_0x4bc61f[_0x3377('0x5')]][_0x3377('0x1c')]||dials[_0x4bc61f[_0x3377('0x5')]][_0x3377('0x20')],dials[_0x4bc61f[_0x3377('0x5')]][_0x3377('0x22')]);dials[_0x4bc61f[_0x3377('0x5')]][_0x3377('0x23')]=dials[_0x4bc61f[_0x3377('0x5')]][_0x3377('0x1c')]?utils['diffTime'](dials[_0x4bc61f['uniqueid']]['endtime'],dials[_0x4bc61f[_0x3377('0x5')]]['answertime']):0x0;writeDB(dials[_0x4bc61f[_0x3377('0x5')]]);}}catch(_0x3688ca){utils['error'](_0x3688ca[_0x3377('0x11')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index ab8caed..de13d08 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 _0xb6d4=['musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','asterisk','port','password','xdr','disabled','info','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','close','managerevent','devicestatechange','error','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xb6d4,0xaa));var _0x4b6d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb6d4[_0x3b380d];return _0x54502b;};var AsteriskManager=require(_0x4b6d('0x0'));var config=require(_0x4b6d('0x1'));var utils=require('./utils');var ami=new AsteriskManager(config[_0x4b6d('0x2')][_0x4b6d('0x3')],config[_0x4b6d('0x2')]['ip'],config[_0x4b6d('0x2')]['username'],config[_0x4b6d('0x2')][_0x4b6d('0x4')],!![]);ami['keepConnected']();if(config[_0x4b6d('0x5')]&&config[_0x4b6d('0x5')][_0x4b6d('0x6')]){utils[_0x4b6d('0x7')]('XDR\x20DISABLED');}else{var agents=require(_0x4b6d('0x8'));var calls=require(_0x4b6d('0x9'));var queues=require('./queues.controller');var recordings=require(_0x4b6d('0xa'));var members=require(_0x4b6d('0xb'));var dials=require(_0x4b6d('0xc'));var transfers=require(_0x4b6d('0xd'));var core=require(_0x4b6d('0xe'));ami['on'](_0x4b6d('0xf'),core[_0x4b6d('0xf')]);ami['on'](_0x4b6d('0x10'),core['shutdown']);ami['on'](_0x4b6d('0x11'),core[_0x4b6d('0x11')]);ami['on']('error',core['error']);ami['on'](_0x4b6d('0x12'),core[_0x4b6d('0x12')]);ami['on'](_0x4b6d('0x13'),core[_0x4b6d('0x13')]);ami['on'](_0x4b6d('0x14'),function(_0x561ea5){try{members[_0x4b6d('0x14')](_0x561ea5);}catch(_0x2f7c97){utils[_0x4b6d('0x15')](_0x2f7c97);}});ami['on'](_0x4b6d('0x16'),function(_0x1c9194){try{agents[_0x4b6d('0x16')](_0x1c9194);}catch(_0xe3579a){utils[_0x4b6d('0x15')](_0xe3579a);}});ami['on'](_0x4b6d('0x17'),function(_0x26d4bf){try{agents['agentringnoanswer'](_0x26d4bf);}catch(_0x4fffa6){utils[_0x4b6d('0x15')](_0x4fffa6);}});ami['on']('agentconnect',function(_0xfb7dc5){try{agents[_0x4b6d('0x18')](_0xfb7dc5);queues[_0x4b6d('0x18')](_0xfb7dc5);}catch(_0x5f2d13){utils[_0x4b6d('0x15')](_0x5f2d13);}});ami['on'](_0x4b6d('0x19'),function(_0x5449f8){try{agents[_0x4b6d('0x19')](_0x5449f8);queues[_0x4b6d('0x19')](_0x5449f8);members[_0x4b6d('0x19')](_0x5449f8);}catch(_0x417e9c){utils[_0x4b6d('0x15')](_0x417e9c);}});ami['on'](_0x4b6d('0x1a'),function(_0x30467c){try{agents['queuecallerabandon'](_0x30467c);queues[_0x4b6d('0x1a')](_0x30467c);}catch(_0x325f13){utils['error'](_0x325f13);}});ami['on']('queuecallerjoin',function(_0x2466b6){try{queues['queuecallerjoin'](_0x2466b6);recordings[_0x4b6d('0x1b')](_0x2466b6);}catch(_0x292ec0){utils[_0x4b6d('0x15')](_0x292ec0);}});ami['on'](_0x4b6d('0x1c'),function(_0x2db057){try{queues[_0x4b6d('0x1c')](_0x2db057);}catch(_0x53b410){utils[_0x4b6d('0x15')](_0x53b410);}});ami['on'](_0x4b6d('0x1d'),function(_0x33ff68){try{queues['musiconholdstart'](_0x33ff68);calls[_0x4b6d('0x1d')](_0x33ff68);}catch(_0xc96987){utils[_0x4b6d('0x15')](_0xc96987);}});ami['on'](_0x4b6d('0x1e'),function(_0x1667ef){try{queues[_0x4b6d('0x1e')](_0x1667ef);calls['musiconholdstop'](_0x1667ef);}catch(_0x2e7551){utils['error'](_0x2e7551);}});ami['on'](_0x4b6d('0x1f'),function(_0x1d0514){try{calls[_0x4b6d('0x1f')](_0x1d0514);recordings[_0x4b6d('0x1f')](_0x1d0514);}catch(_0x5380a3){utils[_0x4b6d('0x15')](_0x5380a3);}});ami['on'](_0x4b6d('0x20'),function(_0x4b6460){try{calls[_0x4b6d('0x20')](_0x4b6460);recordings[_0x4b6d('0x20')](_0x4b6460);dials[_0x4b6d('0x20')](_0x4b6460);agents[_0x4b6d('0x20')](_0x4b6460);queues[_0x4b6d('0x20')](_0x4b6460);}catch(_0x821e42){utils['error'](_0x821e42);}});ami['on'](_0x4b6d('0x21'),function(_0x45c55e){try{members[_0x4b6d('0x21')](_0x45c55e);}catch(_0x3537aa){utils['error'](_0x3537aa);}});ami['on'](_0x4b6d('0x22'),function(_0xe55ab0){try{queues['blindtransfer'](_0xe55ab0);agents['blindtransfer'](_0xe55ab0);transfers[_0x4b6d('0x22')](_0xe55ab0);}catch(_0x286163){utils[_0x4b6d('0x15')](_0x286163);}});ami['on'](_0x4b6d('0x23'),function(_0x41171a){try{queues['attendedtransfer'](_0x41171a);transfers['attendedtransfer'](_0x41171a);agents[_0x4b6d('0x23')](_0x41171a);calls[_0x4b6d('0x23')](_0x41171a);}catch(_0x225c69){utils[_0x4b6d('0x15')](_0x225c69);}});ami['on']('varset',function(_0xd2bff4){try{queues[_0x4b6d('0x24')](_0xd2bff4);recordings[_0x4b6d('0x24')](_0xd2bff4);calls[_0x4b6d('0x24')](_0xd2bff4);dials[_0x4b6d('0x24')](_0xd2bff4);}catch(_0x528fce){utils[_0x4b6d('0x15')](_0x528fce);}});ami['on']('newexten',function(_0x408d25){try{calls['newexten'](_0x408d25);recordings['newexten'](_0x408d25);dials['newexten'](_0x408d25);}catch(_0x17e409){utils[_0x4b6d('0x15')](_0x17e409);}});ami['on'](_0x4b6d('0x25'),function(_0xe75b54){try{calls[_0x4b6d('0x25')](_0xe75b54);recordings[_0x4b6d('0x25')](_0xe75b54);}catch(_0x4c02d6){utils['error'](_0x4c02d6);}});ami['on'](_0x4b6d('0x26'),function(_0x4fd0c9){try{dials[_0x4b6d('0x26')](_0x4fd0c9);}catch(_0x11802d){utils['error'](_0x11802d);}});ami['on'](_0x4b6d('0x27'),function(_0x2276a5){try{dials[_0x4b6d('0x27')](_0x2276a5);}catch(_0x16df9c){utils[_0x4b6d('0x15')](_0x16df9c);}});} \ No newline at end of file +var _0x9e1e=['asterisk','port','username','password','keepConnected','xdr','info','./agents.controller','./recordings.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','../../config/environment','./utils'];(function(_0x4e3cb6,_0x8da87){var _0x301dbc=function(_0x26fafa){while(--_0x26fafa){_0x4e3cb6['push'](_0x4e3cb6['shift']());}};_0x301dbc(++_0x8da87);}(_0x9e1e,0x1df));var _0xe9e1=function(_0x687575,_0x479ba0){_0x687575=_0x687575-0x0;var _0x333140=_0x9e1e[_0x687575];return _0x333140;};var AsteriskManager=require('asterisk-manager');var config=require(_0xe9e1('0x0'));var utils=require(_0xe9e1('0x1'));var ami=new AsteriskManager(config[_0xe9e1('0x2')][_0xe9e1('0x3')],config[_0xe9e1('0x2')]['ip'],config[_0xe9e1('0x2')][_0xe9e1('0x4')],config[_0xe9e1('0x2')][_0xe9e1('0x5')],!![]);ami[_0xe9e1('0x6')]();if(config[_0xe9e1('0x7')]&&config[_0xe9e1('0x7')]['disabled']){utils[_0xe9e1('0x8')]('XDR\x20DISABLED');}else{var agents=require(_0xe9e1('0x9'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0xe9e1('0xa'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require(_0xe9e1('0xb'));ami['on'](_0xe9e1('0xc'),core['connect']);ami['on'](_0xe9e1('0xd'),core[_0xe9e1('0xd')]);ami['on'](_0xe9e1('0xe'),core[_0xe9e1('0xe')]);ami['on'](_0xe9e1('0xf'),core[_0xe9e1('0xf')]);ami['on'](_0xe9e1('0x10'),core[_0xe9e1('0x10')]);ami['on'](_0xe9e1('0x11'),core[_0xe9e1('0x11')]);ami['on']('devicestatechange',function(_0x5ea8d8){try{members[_0xe9e1('0x12')](_0x5ea8d8);}catch(_0x2db5fc){utils['error'](_0x2db5fc);}});ami['on'](_0xe9e1('0x13'),function(_0x478a54){try{agents[_0xe9e1('0x13')](_0x478a54);}catch(_0x146b94){utils[_0xe9e1('0xf')](_0x146b94);}});ami['on'](_0xe9e1('0x14'),function(_0x3b856b){try{agents[_0xe9e1('0x14')](_0x3b856b);}catch(_0x4ce2a4){utils[_0xe9e1('0xf')](_0x4ce2a4);}});ami['on'](_0xe9e1('0x15'),function(_0x593d4b){try{agents['agentconnect'](_0x593d4b);queues[_0xe9e1('0x15')](_0x593d4b);}catch(_0x49523e){utils[_0xe9e1('0xf')](_0x49523e);}});ami['on']('agentcomplete',function(_0x1c51a3){try{agents['agentcomplete'](_0x1c51a3);queues[_0xe9e1('0x16')](_0x1c51a3);members[_0xe9e1('0x16')](_0x1c51a3);}catch(_0x4e62f3){utils[_0xe9e1('0xf')](_0x4e62f3);}});ami['on'](_0xe9e1('0x17'),function(_0x481840){try{agents[_0xe9e1('0x17')](_0x481840);queues['queuecallerabandon'](_0x481840);}catch(_0x3d2aea){utils[_0xe9e1('0xf')](_0x3d2aea);}});ami['on'](_0xe9e1('0x18'),function(_0x13f334){try{queues[_0xe9e1('0x18')](_0x13f334);recordings['queuecallerjoin'](_0x13f334);}catch(_0x1b9a0d){utils['error'](_0x1b9a0d);}});ami['on']('queuecallerleave',function(_0x7d4a69){try{queues['queuecallerleave'](_0x7d4a69);}catch(_0x40f3db){utils[_0xe9e1('0xf')](_0x40f3db);}});ami['on'](_0xe9e1('0x19'),function(_0x99e3c6){try{queues[_0xe9e1('0x19')](_0x99e3c6);calls[_0xe9e1('0x19')](_0x99e3c6);}catch(_0x45b145){utils[_0xe9e1('0xf')](_0x45b145);}});ami['on'](_0xe9e1('0x1a'),function(_0x110a84){try{queues['musiconholdstop'](_0x110a84);calls[_0xe9e1('0x1a')](_0x110a84);}catch(_0x5b8568){utils[_0xe9e1('0xf')](_0x5b8568);}});ami['on'](_0xe9e1('0x1b'),function(_0x613309){try{calls[_0xe9e1('0x1b')](_0x613309);recordings[_0xe9e1('0x1b')](_0x613309);}catch(_0x44cd29){utils[_0xe9e1('0xf')](_0x44cd29);}});ami['on'](_0xe9e1('0x1c'),function(_0x42f95d){try{calls['hangup'](_0x42f95d);recordings[_0xe9e1('0x1c')](_0x42f95d);dials[_0xe9e1('0x1c')](_0x42f95d);agents[_0xe9e1('0x1c')](_0x42f95d);queues['hangup'](_0x42f95d);}catch(_0x242ba0){utils['error'](_0x242ba0);}});ami['on']('cdr',function(_0x473e10){try{members[_0xe9e1('0x1d')](_0x473e10);}catch(_0x3da51e){utils[_0xe9e1('0xf')](_0x3da51e);}});ami['on']('blindtransfer',function(_0x2d0eed){try{queues['blindtransfer'](_0x2d0eed);agents[_0xe9e1('0x1e')](_0x2d0eed);transfers['blindtransfer'](_0x2d0eed);}catch(_0x471e26){utils[_0xe9e1('0xf')](_0x471e26);}});ami['on']('attendedtransfer',function(_0x16441d){try{queues[_0xe9e1('0x1f')](_0x16441d);transfers['attendedtransfer'](_0x16441d);agents[_0xe9e1('0x1f')](_0x16441d);calls[_0xe9e1('0x1f')](_0x16441d);}catch(_0x43e2d4){utils[_0xe9e1('0xf')](_0x43e2d4);}});ami['on'](_0xe9e1('0x20'),function(_0x16a94f){try{queues[_0xe9e1('0x20')](_0x16a94f);recordings[_0xe9e1('0x20')](_0x16a94f);calls[_0xe9e1('0x20')](_0x16a94f);dials[_0xe9e1('0x20')](_0x16a94f);}catch(_0x46923e){utils[_0xe9e1('0xf')](_0x46923e);}});ami['on'](_0xe9e1('0x21'),function(_0x58d68c){try{calls['newexten'](_0x58d68c);recordings[_0xe9e1('0x21')](_0x58d68c);dials[_0xe9e1('0x21')](_0x58d68c);}catch(_0x14c928){utils[_0xe9e1('0xf')](_0x14c928);}});ami['on'](_0xe9e1('0x22'),function(_0x16dc66){try{calls[_0xe9e1('0x22')](_0x16dc66);recordings[_0xe9e1('0x22')](_0x16dc66);}catch(_0x3837d4){utils[_0xe9e1('0xf')](_0x3837d4);}});ami['on'](_0xe9e1('0x23'),function(_0x543d51){try{dials[_0xe9e1('0x23')](_0x543d51);}catch(_0x3caaa0){utils[_0xe9e1('0xf')](_0x3caaa0);}});ami['on'](_0xe9e1('0x24'),function(_0x108d19){try{dials['dialend'](_0x108d19);}catch(_0x3ae952){utils[_0xe9e1('0xf')](_0x3ae952);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 4e05762..42c4e4c 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 _0x8504=['cdr','channel','assign','data2','data3','destination','destinationchannel','data1','source','lodash','util','./utils','Local/_attended@transfer','info','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','membername','type','getUserByInterface','name','internal','request','CreateMemberReport','split','then','catch','error','some','startsWith','state','INUSE','BUSY','device','voice','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','agentcomplete','queue'];(function(_0xa041de,_0x3600e2){var _0x1d654c=function(_0x295d70){while(--_0x295d70){_0xa041de['push'](_0xa041de['shift']());}};_0x1d654c(++_0x3600e2);}(_0x8504,0x10b));var _0x4850=function(_0x42eabb,_0x1c8ecb){_0x42eabb=_0x42eabb-0x0;var _0x2d4655=_0x8504[_0x42eabb];return _0x2d4655;};'use strict';var _=require(_0x4850('0x0'));var util=require(_0x4850('0x1'));var utils=require(_0x4850('0x2'));var members={};var exclude=[_0x4850('0x3'),'Queue:'];function writeDB(_0x401346){utils[_0x4850('0x4')](util['format'](_0x4850('0x5'),_0x401346[_0x4850('0x6')],_0x401346[_0x4850('0x7')],_0x401346['channel'],_0x401346['data2'],_0x401346[_0x4850('0x8')],_0x401346[_0x4850('0x9')]));if(_0x401346[_0x4850('0x7')]){utils[_0x4850('0xa')](_0x401346[_0x4850('0x7')])['then'](function(_0xfb047a){if(_0xfb047a){_0x401346[_0x4850('0x8')]=_0xfb047a[_0x4850('0xb')];_0x401346[_0x4850('0xc')]=_0xfb047a[_0x4850('0xc')];utils[_0x4850('0xd')](_0x4850('0xe'),_0x401346);}else{utils['getUserByName'](_0x401346[_0x4850('0x7')][_0x4850('0xf')]('/')[0x1])[_0x4850('0x10')](function(_0x270e10){if(_0x270e10){_0x401346['membername']=_0x270e10['name'];_0x401346[_0x4850('0xc')]=_0x270e10[_0x4850('0xc')];utils[_0x4850('0xd')](_0x4850('0xe'),_0x401346);}});}})[_0x4850('0x11')](function(_0x2307e5){utils[_0x4850('0x12')](_0x2307e5);});}delete members[_0x401346[_0x4850('0x7')]];}function startsWith(_0xb34cbf,_0x5b64d5){return _[_0x4850('0x13')](_0xb34cbf,function(_0x2f6cbc){return _[_0x4850('0x14')](_0x5b64d5,_0x2f6cbc);});}exports['devicestatechange']=function(_0x4104b3){switch(_0x4104b3[_0x4850('0x15')]){case _0x4850('0x16'):case _0x4850('0x17'):if(!startsWith(exclude,_0x4104b3[_0x4850('0x18')])){members[_0x4104b3[_0x4850('0x18')]]={'channel':_0x4850('0x19'),'interface':_0x4104b3['device'],'type':'TALKING','enterAt':utils['now'](),'role':_0x4850('0x1a')};}break;case _0x4850('0x1b'):if(!_[_0x4850('0x1c')](members[_0x4104b3['device']])){members[_0x4104b3[_0x4850('0x18')]][_0x4850('0x1d')]=utils['now']();members[_0x4104b3['device']][_0x4850('0x1e')]=utils[_0x4850('0x1f')](members[_0x4104b3['device']][_0x4850('0x1d')],members[_0x4104b3[_0x4850('0x18')]]['enterAt']);if(members[_0x4104b3[_0x4850('0x18')]][_0x4850('0x6')]){writeDB(members[_0x4104b3[_0x4850('0x18')]]);}}default:break;}};exports[_0x4850('0x20')]=function(_0x112b50){if(!_[_0x4850('0x1c')](members[_0x112b50[_0x4850('0x7')]])){members[_0x112b50[_0x4850('0x7')]]=_['assign'](members[_0x112b50['interface']],{'data4':_0x112b50[_0x4850('0x21')],'uniqueid':_0x112b50['uniqueid']});}};exports[_0x4850('0x22')]=function(_0x4654fc){if(_0x4654fc[_0x4850('0x23')]){var _0x11303b=_0x4654fc['channel'][_0x4850('0xf')]('-')[0x0];if(!_[_0x4850('0x1c')](members[_0x11303b])){members[_0x11303b]=_[_0x4850('0x24')](members[_0x11303b],{'data1':members[_0x11303b]['data1']||_0x4654fc[_0x4850('0x9')],'data2':members[_0x11303b][_0x4850('0x25')]||_0x4654fc['source'],'data3':members[_0x11303b][_0x4850('0x26')]||_0x4654fc[_0x4850('0x27')],'uniqueid':members[_0x11303b][_0x4850('0x6')]||_0x4654fc[_0x4850('0x6')]});if(members[_0x11303b][_0x4850('0x1d')]){writeDB(members[_0x11303b]);}}}if(_0x4654fc['destinationchannel']){var _0x10fd83=_0x4654fc[_0x4850('0x28')][_0x4850('0xf')]('-')[0x0];if(!_['isNil'](members[_0x10fd83])){members[_0x10fd83]=_[_0x4850('0x24')](members[_0x10fd83],{'data1':members[_0x10fd83][_0x4850('0x29')]||_0x4654fc[_0x4850('0x9')],'data2':members[_0x10fd83][_0x4850('0x25')]||_0x4654fc[_0x4850('0x2a')],'data3':members[_0x10fd83][_0x4850('0x26')]||_0x4654fc[_0x4850('0x27')],'uniqueid':members[_0x10fd83]['uniqueid']||_0x4654fc[_0x4850('0x6')]});if(members[_0x10fd83][_0x4850('0x1d')]){writeDB(members[_0x10fd83]);}}}}; \ No newline at end of file +var _0x4ec0=['then','membername','internal','request','getUserByName','split','name','CreateMemberReport','catch','error','startsWith','state','INUSE','BUSY','device','voice','TALKING','agent','NOT_INUSE','exitAt','now','duration','diffTime','agentcomplete','isNil','assign','queue','cdr','data1','type','source','data3','destination','destinationchannel','lodash','util','./utils','Queue:','info','format','uniqueid','interface','channel','data2','getUserByInterface'];(function(_0x3f5a09,_0x50072c){var _0x500d82=function(_0x39c49b){while(--_0x39c49b){_0x3f5a09['push'](_0x3f5a09['shift']());}};_0x500d82(++_0x50072c);}(_0x4ec0,0x1b7));var _0x04ec=function(_0x16940b,_0x5275ff){_0x16940b=_0x16940b-0x0;var _0x46fd6d=_0x4ec0[_0x16940b];return _0x46fd6d;};'use strict';var _=require(_0x04ec('0x0'));var util=require(_0x04ec('0x1'));var utils=require(_0x04ec('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x04ec('0x3')];function writeDB(_0x30b214){utils[_0x04ec('0x4')](util[_0x04ec('0x5')]('MEMBER|%s|%s|%s|%s|%s|%s',_0x30b214[_0x04ec('0x6')],_0x30b214[_0x04ec('0x7')],_0x30b214[_0x04ec('0x8')],_0x30b214[_0x04ec('0x9')],_0x30b214['membername'],_0x30b214['type']));if(_0x30b214[_0x04ec('0x7')]){utils[_0x04ec('0xa')](_0x30b214[_0x04ec('0x7')])[_0x04ec('0xb')](function(_0x3d9a86){if(_0x3d9a86){_0x30b214[_0x04ec('0xc')]=_0x3d9a86['name'];_0x30b214[_0x04ec('0xd')]=_0x3d9a86['internal'];utils[_0x04ec('0xe')]('CreateMemberReport',_0x30b214);}else{utils[_0x04ec('0xf')](_0x30b214[_0x04ec('0x7')][_0x04ec('0x10')]('/')[0x1])[_0x04ec('0xb')](function(_0x4fcd92){if(_0x4fcd92){_0x30b214['membername']=_0x4fcd92[_0x04ec('0x11')];_0x30b214[_0x04ec('0xd')]=_0x4fcd92['internal'];utils['request'](_0x04ec('0x12'),_0x30b214);}});}})[_0x04ec('0x13')](function(_0x11bd25){utils[_0x04ec('0x14')](_0x11bd25);});}delete members[_0x30b214['interface']];}function startsWith(_0x4bbac6,_0x4636b6){return _['some'](_0x4bbac6,function(_0x35d768){return _[_0x04ec('0x15')](_0x4636b6,_0x35d768);});}exports['devicestatechange']=function(_0x1c1455){switch(_0x1c1455[_0x04ec('0x16')]){case _0x04ec('0x17'):case _0x04ec('0x18'):if(!startsWith(exclude,_0x1c1455[_0x04ec('0x19')])){members[_0x1c1455[_0x04ec('0x19')]]={'channel':_0x04ec('0x1a'),'interface':_0x1c1455[_0x04ec('0x19')],'type':_0x04ec('0x1b'),'enterAt':utils['now'](),'role':_0x04ec('0x1c')};}break;case _0x04ec('0x1d'):if(!_['isNil'](members[_0x1c1455[_0x04ec('0x19')]])){members[_0x1c1455[_0x04ec('0x19')]][_0x04ec('0x1e')]=utils[_0x04ec('0x1f')]();members[_0x1c1455[_0x04ec('0x19')]][_0x04ec('0x20')]=utils[_0x04ec('0x21')](members[_0x1c1455[_0x04ec('0x19')]][_0x04ec('0x1e')],members[_0x1c1455[_0x04ec('0x19')]]['enterAt']);if(members[_0x1c1455[_0x04ec('0x19')]]['uniqueid']){writeDB(members[_0x1c1455[_0x04ec('0x19')]]);}}default:break;}};exports[_0x04ec('0x22')]=function(_0x5c0108){if(!_[_0x04ec('0x23')](members[_0x5c0108[_0x04ec('0x7')]])){members[_0x5c0108[_0x04ec('0x7')]]=_[_0x04ec('0x24')](members[_0x5c0108[_0x04ec('0x7')]],{'data4':_0x5c0108[_0x04ec('0x25')],'uniqueid':_0x5c0108['uniqueid']});}};exports[_0x04ec('0x26')]=function(_0x3be4a4){if(_0x3be4a4[_0x04ec('0x8')]){var _0x494d60=_0x3be4a4[_0x04ec('0x8')][_0x04ec('0x10')]('-')[0x0];if(!_[_0x04ec('0x23')](members[_0x494d60])){members[_0x494d60]=_[_0x04ec('0x24')](members[_0x494d60],{'data1':members[_0x494d60][_0x04ec('0x27')]||_0x3be4a4[_0x04ec('0x28')],'data2':members[_0x494d60][_0x04ec('0x9')]||_0x3be4a4[_0x04ec('0x29')],'data3':members[_0x494d60][_0x04ec('0x2a')]||_0x3be4a4[_0x04ec('0x2b')],'uniqueid':members[_0x494d60]['uniqueid']||_0x3be4a4['uniqueid']});if(members[_0x494d60][_0x04ec('0x1e')]){writeDB(members[_0x494d60]);}}}if(_0x3be4a4[_0x04ec('0x2c')]){var _0x1ff8f7=_0x3be4a4[_0x04ec('0x2c')][_0x04ec('0x10')]('-')[0x0];if(!_['isNil'](members[_0x1ff8f7])){members[_0x1ff8f7]=_[_0x04ec('0x24')](members[_0x1ff8f7],{'data1':members[_0x1ff8f7]['data1']||_0x3be4a4[_0x04ec('0x28')],'data2':members[_0x1ff8f7]['data2']||_0x3be4a4[_0x04ec('0x29')],'data3':members[_0x1ff8f7][_0x04ec('0x2a')]||_0x3be4a4[_0x04ec('0x2b')],'uniqueid':members[_0x1ff8f7][_0x04ec('0x6')]||_0x3be4a4['uniqueid']});if(members[_0x1ff8f7][_0x04ec('0x1e')]){writeDB(members[_0x1ff8f7]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index bf8b2a5..dc721db 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 _0x43f7=['transfereduniqueid','queuecallerjoin','assign','position','hangup','isNil','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','varset','variable','queuestatus','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','toUpperCase','EXITWITHKEY','ABANDONED','queuecallerleave','queuecallerjoinAt','count','connectedlinenum','connectedlinename','assigned','destaccountcode','membername','agentcomplete','TRANSFER','COMPLETEDBY','reason','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','holdtime','mohtime','secondtransfereruniqueid','transfer','secondtransfererexten','transfertargetlinkedid','error','stack','musiconholdstart','musiconholdstartAt','diffTime','lodash','util','./utils','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','queue','type','request','CreateVoiceQueueReport'];(function(_0x911353,_0x1648ed){var _0x2f05fa=function(_0x4a00a4){while(--_0x4a00a4){_0x911353['push'](_0x911353['shift']());}};_0x2f05fa(++_0x1648ed);}(_0x43f7,0x8e));var _0x743f=function(_0x30d7ae,_0x131ec5){_0x30d7ae=_0x30d7ae-0x0;var _0x19339c=_0x43f7[_0x30d7ae];return _0x19339c;};'use strict';var _=require(_0x743f('0x0'));var util=require(_0x743f('0x1'));var utils=require(_0x743f('0x2'));var queues={};function writeDB(_0x5e7f65){utils['info'](util['format'](_0x743f('0x3'),_0x5e7f65[_0x743f('0x4')],_0x5e7f65[_0x743f('0x5')],_0x5e7f65['queue'],_0x5e7f65['lastAssignedTo'],_0x5e7f65[_0x743f('0x6')],_0x5e7f65[_0x743f('0x7')],_0x5e7f65[_0x743f('0x8')]));if(_0x5e7f65['queue']){utils[_0x743f('0x9')](_0x5e7f65[_0x743f('0xa')])['then'](function(_0x192dbc){if(_0x192dbc){_0x5e7f65[_0x743f('0xb')]=_0x192dbc[_0x743f('0xb')];}utils[_0x743f('0xc')](_0x743f('0xd'),_0x5e7f65);});}else{utils['request'](_0x743f('0xd'),_0x5e7f65);}if(_0x5e7f65[_0x743f('0xe')]){delete queues[_0x5e7f65[_0x743f('0xe')]];}else{delete queues[_0x5e7f65['uniqueid']];}}exports[_0x743f('0xf')]=function(_0x6fb353){queues[_0x6fb353['uniqueid']]=_[_0x743f('0x10')](_0x6fb353,{'originalposition':_0x6fb353[_0x743f('0x11')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});};exports[_0x743f('0x12')]=function(_0x267092){if(!_[_0x743f('0x13')](queues[_0x267092[_0x743f('0x4')]])){if(queues[_0x267092[_0x743f('0x4')]][_0x743f('0x14')]){if(!queues[_0x267092[_0x743f('0x4')]]['queuecallerabandon']&&!queues[_0x267092[_0x743f('0x4')]][_0x743f('0x15')]){queues[_0x267092[_0x743f('0x4')]][_0x743f('0x16')]=!![];queues[_0x267092[_0x743f('0x4')]][_0x743f('0x17')]=utils[_0x743f('0x18')]();queues[_0x267092[_0x743f('0x4')]][_0x743f('0x8')]=_0x743f('0x19');}writeDB(queues[_0x267092['uniqueid']]);}else{if(queues[_0x267092['uniqueid']][_0x743f('0xe')]){queues[queues[_0x267092[_0x743f('0x4')]]['transfereduniqueid']]=queues[_0x267092['uniqueid']];queues[queues[_0x267092[_0x743f('0x4')]][_0x743f('0xe')]]['queuecallerenterreason']=0x2;delete queues[_0x267092['uniqueid']];}}}};exports[_0x743f('0x1a')]=function(_0x2064a2){if(!_[_0x743f('0x13')](_0x2064a2[_0x743f('0x1b')][_0x743f('0x1c')])){if(!_[_0x743f('0x13')](queues[_0x2064a2['uniqueid']])){queues[_0x2064a2[_0x743f('0x4')]][_0x743f('0x1d')]=![];queues[_0x2064a2['uniqueid']][_0x743f('0x1e')]=null;queues[_0x2064a2['uniqueid']][_0x743f('0x15')]=!![];queues[_0x2064a2[_0x743f('0x4')]][_0x743f('0x1f')]=utils['now']();queues[_0x2064a2[_0x743f('0x4')]]['queuecallerexitreason']=_0x2064a2['value'][_0x743f('0x20')]();writeDB(queues[_0x2064a2[_0x743f('0x4')]]);}}else if(!_[_0x743f('0x13')](_0x2064a2[_0x743f('0x1b')]['queueposition'])){if(!_[_0x743f('0x13')](queues[_0x2064a2[_0x743f('0x4')]])&&!queues[_0x2064a2[_0x743f('0x4')]][_0x743f('0x1d')]){queues[_0x2064a2['uniqueid']][_0x743f('0x1d')]=![];queues[_0x2064a2[_0x743f('0x4')]][_0x743f('0x1e')]=null;queues[_0x2064a2[_0x743f('0x4')]][_0x743f('0x15')]=!![];queues[_0x2064a2[_0x743f('0x4')]]['queuecallerexitAt']=utils['now']();queues[_0x2064a2['uniqueid']][_0x743f('0x8')]=_0x743f('0x21');}}};exports[_0x743f('0x1d')]=function(_0x4a3a8a){if(!_['isNil'](queues[_0x4a3a8a[_0x743f('0x4')]])){queues[_0x4a3a8a['uniqueid']]['queuecallerexit']=![];queues[_0x4a3a8a[_0x743f('0x4')]][_0x743f('0x1f')]=null;queues[_0x4a3a8a[_0x743f('0x4')]][_0x743f('0x1d')]=!![];queues[_0x4a3a8a[_0x743f('0x4')]]['queuecallerabandonAt']=utils['now']();queues[_0x4a3a8a['uniqueid']][_0x743f('0x8')]=_0x743f('0x22');}};exports[_0x743f('0x23')]=function(_0x52f323){if(!_[_0x743f('0x13')](queues[_0x52f323['uniqueid']])){queues[_0x52f323[_0x743f('0x4')]]['queuecallerleave']=!![];queues[_0x52f323[_0x743f('0x4')]]['queuecallerleaveAt']=utils[_0x743f('0x18')]();queues[_0x52f323[_0x743f('0x4')]]['holdtime']=utils['diffTime'](queues[_0x52f323[_0x743f('0x4')]][_0x743f('0x14')],queues[_0x52f323[_0x743f('0x4')]][_0x743f('0x24')]);queues[_0x52f323[_0x743f('0x4')]][_0x743f('0x11')]=_0x52f323[_0x743f('0x11')];queues[_0x52f323[_0x743f('0x4')]][_0x743f('0x25')]=_0x52f323[_0x743f('0x25')];queues[_0x52f323[_0x743f('0x4')]][_0x743f('0x26')]=_0x52f323[_0x743f('0x26')];queues[_0x52f323[_0x743f('0x4')]][_0x743f('0x27')]=_0x52f323['connectedlinename'];}};exports['agentconnect']=function(_0x692233){if(!_[_0x743f('0x13')](queues[_0x692233[_0x743f('0x4')]])){queues[_0x692233[_0x743f('0x4')]]['queuecallerabandon']=![];queues[_0x692233[_0x743f('0x4')]]['queuecallerabandon']=![];queues[_0x692233['uniqueid']]['queuecallerabandonAt']=null;queues[_0x692233[_0x743f('0x4')]][_0x743f('0x15')]=![];queues[_0x692233[_0x743f('0x4')]][_0x743f('0x1f')]=null;queues[_0x692233[_0x743f('0x4')]][_0x743f('0x28')]=!![];queues[_0x692233[_0x743f('0x4')]][_0x743f('0x7')]=_0x692233[_0x743f('0x29')];queues[_0x692233[_0x743f('0x4')]]['lastAssignedTo']=_0x692233[_0x743f('0x2a')];}};exports[_0x743f('0x2b')]=function(_0x5960ba){if(!_[_0x743f('0x13')](queues[_0x5960ba['uniqueid']])){if(queues[_0x5960ba['uniqueid']][_0x743f('0x14')]){queues[_0x5960ba['uniqueid']][_0x743f('0x1d')]=![];queues[_0x5960ba[_0x743f('0x4')]]['queuecallerabandon']=![];queues[_0x5960ba[_0x743f('0x4')]]['queuecallerabandonAt']=null;queues[_0x5960ba[_0x743f('0x4')]][_0x743f('0x15')]=![];queues[_0x5960ba[_0x743f('0x4')]]['queuecallerexitAt']=null;queues[_0x5960ba[_0x743f('0x4')]][_0x743f('0x28')]=!![];queues[_0x5960ba[_0x743f('0x4')]]['lastAssignedTo']=_0x5960ba[_0x743f('0x2a')];queues[_0x5960ba['uniqueid']][_0x743f('0x16')]=!![];queues[_0x5960ba[_0x743f('0x4')]]['queuecallercompleteAt']=utils[_0x743f('0x18')]();if(_0x5960ba['reason']=='transfer'){if(!queues[_0x5960ba[_0x743f('0x4')]]['transfer']){queues[_0x5960ba[_0x743f('0x4')]][_0x743f('0x8')]=_0x743f('0x2c');}}else{queues[_0x5960ba[_0x743f('0x4')]][_0x743f('0x8')]=_0x743f('0x2d')+_0x5960ba[_0x743f('0x2e')][_0x743f('0x20')]();}writeDB(queues[_0x5960ba['uniqueid']]);}}};exports[_0x743f('0x2f')]=function(_0xa425df){if(!_['isNil'](queues[_0xa425df[_0x743f('0x30')]])){queues[_0xa425df[_0x743f('0x30')]]['transfer']=!![];queues[_0xa425df['transfereeuniqueid']][_0x743f('0x31')]=_0x743f('0x32');queues[_0xa425df[_0x743f('0x30')]][_0x743f('0x33')]=_0xa425df[_0x743f('0x34')];queues[_0xa425df[_0x743f('0x30')]][_0x743f('0x35')]=_0xa425df[_0x743f('0x30')];queues[_0xa425df[_0x743f('0x30')]][_0x743f('0x8')]=_0x743f('0x36');}};exports[_0x743f('0x37')]=function(_0x50cd97){try{if(_0x50cd97[_0x743f('0x38')]==_0x50cd97[_0x743f('0x39')]){if(!_[_0x743f('0x13')](queues[_0x50cd97[_0x743f('0x3a')]])){queues[_0x50cd97[_0x743f('0x3a')]]['transfer']=!![];queues[_0x50cd97['secondtransfererlinkedid']][_0x743f('0x31')]=_0x743f('0x3b');queues[_0x50cd97['secondtransfererlinkedid']][_0x743f('0x33')]=_0x50cd97[_0x743f('0x3c')];queues[_0x50cd97[_0x743f('0x3a')]][_0x743f('0x35')]=_0x50cd97[_0x743f('0x38')];queues[_0x50cd97[_0x743f('0x3a')]][_0x743f('0x8')]=_0x743f('0x3d');}if(!_[_0x743f('0x13')](queues[_0x50cd97[_0x743f('0x39')]])){if(_0x50cd97['transfereelinkedid']&&queues[_0x50cd97[_0x743f('0x3e')]]){queues[_0x50cd97[_0x743f('0x3e')]][_0x743f('0x3f')]=0x1;queues[_0x50cd97[_0x743f('0x30')]]=_[_0x743f('0x40')](queues[_0x50cd97[_0x743f('0x3e')]]);queues[_0x50cd97[_0x743f('0x30')]][_0x743f('0xe')]=_0x50cd97[_0x743f('0x41')];queues[_0x50cd97[_0x743f('0x30')]][_0x743f('0x3f')]=0x2;queues[_0x50cd97[_0x743f('0x30')]][_0x743f('0x6')]=queues[_0x50cd97['secondtransfererlinkedid']]['calleridnum'];queues[_0x50cd97['transfereeuniqueid']][_0x743f('0x42')]=queues[_0x50cd97[_0x743f('0x3a')]][_0x743f('0x42')];queues[_0x50cd97[_0x743f('0x30')]][_0x743f('0x24')]=utils[_0x743f('0x18')]();queues[_0x50cd97[_0x743f('0x30')]][_0x743f('0x14')]=utils[_0x743f('0x18')]();queues[_0x50cd97[_0x743f('0x30')]][_0x743f('0x43')]=0x0;queues[_0x50cd97[_0x743f('0x30')]][_0x743f('0x44')]=0x0;}else{queues[_0x50cd97['origtransfererlinkedid']]['transfereduniqueid']=_0x50cd97[_0x743f('0x3a')];}}}else if(_0x50cd97[_0x743f('0x45')]==_0x50cd97[_0x743f('0x3a')]){if(!_[_0x743f('0x13')](queues[_0x50cd97[_0x743f('0x39')]])){queues[_0x50cd97[_0x743f('0x39')]][_0x743f('0x46')]=!![];queues[_0x50cd97['origtransfererlinkedid']]['transfertype']=_0x743f('0x3b');queues[_0x50cd97[_0x743f('0x39')]][_0x743f('0x33')]=_0x50cd97[_0x743f('0x47')];queues[_0x50cd97[_0x743f('0x39')]][_0x743f('0x35')]=_0x50cd97[_0x743f('0x45')];queues[_0x50cd97['origtransfererlinkedid']]['queuecallerexitreason']=_0x743f('0x3d');}if(!_[_0x743f('0x13')](queues[_0x50cd97['secondtransfererlinkedid']])){if(_0x50cd97['transfertargetlinkedid']&&queues[_0x50cd97[_0x743f('0x48')]]){queues[_0x50cd97[_0x743f('0x48')]][_0x743f('0x3f')]=0x1;queues[_0x50cd97[_0x743f('0x41')]]=_[_0x743f('0x40')](queues[_0x50cd97[_0x743f('0x48')]]);queues[_0x50cd97[_0x743f('0x41')]][_0x743f('0xe')]=_0x50cd97['transfertargetuniqueid'];queues[_0x50cd97[_0x743f('0x41')]][_0x743f('0x3f')]=0x2;queues[_0x50cd97[_0x743f('0x41')]][_0x743f('0x6')]=queues[_0x50cd97[_0x743f('0x39')]][_0x743f('0x6')];queues[_0x50cd97[_0x743f('0x41')]][_0x743f('0x42')]=queues[_0x50cd97['origtransfererlinkedid']][_0x743f('0x42')];queues[_0x50cd97[_0x743f('0x41')]]['queuecallerjoinAt']=utils[_0x743f('0x18')]();queues[_0x50cd97[_0x743f('0x41')]][_0x743f('0x14')]=utils[_0x743f('0x18')]();queues[_0x50cd97['transfertargetuniqueid']][_0x743f('0x43')]=0x0;queues[_0x50cd97[_0x743f('0x41')]][_0x743f('0x44')]=0x0;}else{queues[_0x50cd97[_0x743f('0x3a')]][_0x743f('0xe')]=_0x50cd97[_0x743f('0x39')];}}}}catch(_0x166f4a){utils[_0x743f('0x49')](_0x166f4a[_0x743f('0x4a')]);}};exports[_0x743f('0x4b')]=function(_0xf86f99){if(!_[_0x743f('0x13')](queues[_0xf86f99[_0x743f('0x4')]])){queues[_0xf86f99[_0x743f('0x4')]][_0x743f('0x4c')]=utils['now']();}};exports['musiconholdstop']=function(_0x5bf3be){if(!_['isNil'](queues[_0x5bf3be[_0x743f('0x4')]])){if(!_[_0x743f('0x13')](queues[_0x5bf3be[_0x743f('0x4')]][_0x743f('0x4c')])){queues[_0x5bf3be[_0x743f('0x4')]]['mohtime']+=utils[_0x743f('0x4d')](utils[_0x743f('0x18')](),queues[_0x5bf3be[_0x743f('0x4')]][_0x743f('0x4c')]);delete queues[_0x5bf3be[_0x743f('0x4')]][_0x743f('0x4c')];}}}; \ No newline at end of file +var _0x22d3=['transfertargetuniqueid','error','stack','musiconholdstart','musiconholdstartAt','lodash','util','./utils','info','format','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','assign','position','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','queuecallerenterreason','varset','variable','queuestatus','queuecallerabandonAt','queuecallerexitAt','value','toUpperCase','queueposition','EXITWITHKEY','ABANDONED','queuecallerleave','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','destaccountcode','membername','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','extension','BLINDTRANSFER','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','transferuniqueid','origtransfereruniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridnum','calleridname','holdtime','mohtime','transferexten','secondtransfererexten','secondtransfereruniqueid','transfertargetlinkedid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x22d3,0xf8));var _0x322d=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0x22d3[_0x4ca333];return _0x13b2e1;};'use strict';var _=require(_0x322d('0x0'));var util=require(_0x322d('0x1'));var utils=require(_0x322d('0x2'));var queues={};function writeDB(_0x2cbfe5){utils[_0x322d('0x3')](util[_0x322d('0x4')]('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x2cbfe5[_0x322d('0x5')],_0x2cbfe5[_0x322d('0x6')],_0x2cbfe5[_0x322d('0x7')],_0x2cbfe5[_0x322d('0x8')],_0x2cbfe5['calleridnum'],_0x2cbfe5[_0x322d('0x9')],_0x2cbfe5[_0x322d('0xa')]));if(_0x2cbfe5[_0x322d('0x7')]){utils[_0x322d('0xb')](_0x2cbfe5[_0x322d('0x7')])[_0x322d('0xc')](function(_0x2b3ac4){if(_0x2b3ac4){_0x2cbfe5[_0x322d('0xd')]=_0x2b3ac4[_0x322d('0xd')];}utils[_0x322d('0xe')](_0x322d('0xf'),_0x2cbfe5);});}else{utils['request'](_0x322d('0xf'),_0x2cbfe5);}if(_0x2cbfe5[_0x322d('0x10')]){delete queues[_0x2cbfe5['transfereduniqueid']];}else{delete queues[_0x2cbfe5[_0x322d('0x5')]];}}exports[_0x322d('0x11')]=function(_0xaa2579){queues[_0xaa2579[_0x322d('0x5')]]=_[_0x322d('0x12')](_0xaa2579,{'originalposition':_0xaa2579[_0x322d('0x13')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});};exports[_0x322d('0x14')]=function(_0x2780c8){if(!_[_0x322d('0x15')](queues[_0x2780c8[_0x322d('0x5')]])){if(queues[_0x2780c8['uniqueid']][_0x322d('0x16')]){if(!queues[_0x2780c8['uniqueid']][_0x322d('0x17')]&&!queues[_0x2780c8[_0x322d('0x5')]][_0x322d('0x18')]){queues[_0x2780c8[_0x322d('0x5')]][_0x322d('0x19')]=!![];queues[_0x2780c8[_0x322d('0x5')]][_0x322d('0x1a')]=utils[_0x322d('0x1b')]();queues[_0x2780c8[_0x322d('0x5')]][_0x322d('0xa')]='COMPLETEDBYAGENT';}writeDB(queues[_0x2780c8['uniqueid']]);}else{if(queues[_0x2780c8[_0x322d('0x5')]][_0x322d('0x10')]){queues[queues[_0x2780c8['uniqueid']]['transfereduniqueid']]=queues[_0x2780c8[_0x322d('0x5')]];queues[queues[_0x2780c8['uniqueid']][_0x322d('0x10')]][_0x322d('0x1c')]=0x2;delete queues[_0x2780c8[_0x322d('0x5')]];}}}};exports[_0x322d('0x1d')]=function(_0x218e9b){if(!_[_0x322d('0x15')](_0x218e9b[_0x322d('0x1e')][_0x322d('0x1f')])){if(!_[_0x322d('0x15')](queues[_0x218e9b[_0x322d('0x5')]])){queues[_0x218e9b[_0x322d('0x5')]]['queuecallerabandon']=![];queues[_0x218e9b[_0x322d('0x5')]][_0x322d('0x20')]=null;queues[_0x218e9b[_0x322d('0x5')]][_0x322d('0x18')]=!![];queues[_0x218e9b[_0x322d('0x5')]][_0x322d('0x21')]=utils[_0x322d('0x1b')]();queues[_0x218e9b[_0x322d('0x5')]][_0x322d('0xa')]=_0x218e9b[_0x322d('0x22')][_0x322d('0x23')]();writeDB(queues[_0x218e9b[_0x322d('0x5')]]);}}else if(!_['isNil'](_0x218e9b[_0x322d('0x1e')][_0x322d('0x24')])){if(!_['isNil'](queues[_0x218e9b['uniqueid']])&&!queues[_0x218e9b[_0x322d('0x5')]][_0x322d('0x17')]){queues[_0x218e9b[_0x322d('0x5')]]['queuecallerabandon']=![];queues[_0x218e9b[_0x322d('0x5')]][_0x322d('0x20')]=null;queues[_0x218e9b[_0x322d('0x5')]][_0x322d('0x18')]=!![];queues[_0x218e9b[_0x322d('0x5')]][_0x322d('0x21')]=utils['now']();queues[_0x218e9b[_0x322d('0x5')]][_0x322d('0xa')]=_0x322d('0x25');}}};exports[_0x322d('0x17')]=function(_0x2b8230){if(!_[_0x322d('0x15')](queues[_0x2b8230['uniqueid']])){queues[_0x2b8230[_0x322d('0x5')]][_0x322d('0x18')]=![];queues[_0x2b8230[_0x322d('0x5')]][_0x322d('0x21')]=null;queues[_0x2b8230[_0x322d('0x5')]][_0x322d('0x17')]=!![];queues[_0x2b8230['uniqueid']][_0x322d('0x20')]=utils['now']();queues[_0x2b8230[_0x322d('0x5')]]['queuecallerexitreason']=_0x322d('0x26');}};exports['queuecallerleave']=function(_0x530aa5){if(!_[_0x322d('0x15')](queues[_0x530aa5[_0x322d('0x5')]])){queues[_0x530aa5['uniqueid']][_0x322d('0x27')]=!![];queues[_0x530aa5['uniqueid']][_0x322d('0x16')]=utils['now']();queues[_0x530aa5[_0x322d('0x5')]]['holdtime']=utils[_0x322d('0x28')](queues[_0x530aa5[_0x322d('0x5')]][_0x322d('0x16')],queues[_0x530aa5['uniqueid']][_0x322d('0x29')]);queues[_0x530aa5[_0x322d('0x5')]]['position']=_0x530aa5['position'];queues[_0x530aa5[_0x322d('0x5')]][_0x322d('0x2a')]=_0x530aa5['count'];queues[_0x530aa5['uniqueid']]['connectedlinenum']=_0x530aa5[_0x322d('0x2b')];queues[_0x530aa5[_0x322d('0x5')]][_0x322d('0x2c')]=_0x530aa5[_0x322d('0x2c')];}};exports[_0x322d('0x2d')]=function(_0x3bbfe8){if(!_[_0x322d('0x15')](queues[_0x3bbfe8['uniqueid']])){queues[_0x3bbfe8[_0x322d('0x5')]][_0x322d('0x17')]=![];queues[_0x3bbfe8['uniqueid']][_0x322d('0x17')]=![];queues[_0x3bbfe8['uniqueid']][_0x322d('0x20')]=null;queues[_0x3bbfe8['uniqueid']][_0x322d('0x18')]=![];queues[_0x3bbfe8[_0x322d('0x5')]]['queuecallerexitAt']=null;queues[_0x3bbfe8[_0x322d('0x5')]]['assigned']=!![];queues[_0x3bbfe8[_0x322d('0x5')]][_0x322d('0x9')]=_0x3bbfe8[_0x322d('0x2e')];queues[_0x3bbfe8[_0x322d('0x5')]][_0x322d('0x8')]=_0x3bbfe8[_0x322d('0x2f')];}};exports[_0x322d('0x30')]=function(_0xfb5cfb){if(!_['isNil'](queues[_0xfb5cfb['uniqueid']])){if(queues[_0xfb5cfb[_0x322d('0x5')]][_0x322d('0x16')]){queues[_0xfb5cfb[_0x322d('0x5')]][_0x322d('0x17')]=![];queues[_0xfb5cfb[_0x322d('0x5')]][_0x322d('0x17')]=![];queues[_0xfb5cfb[_0x322d('0x5')]][_0x322d('0x20')]=null;queues[_0xfb5cfb['uniqueid']][_0x322d('0x18')]=![];queues[_0xfb5cfb[_0x322d('0x5')]]['queuecallerexitAt']=null;queues[_0xfb5cfb['uniqueid']]['assigned']=!![];queues[_0xfb5cfb[_0x322d('0x5')]]['lastAssignedTo']=_0xfb5cfb[_0x322d('0x2f')];queues[_0xfb5cfb['uniqueid']]['queuecallercomplete']=!![];queues[_0xfb5cfb[_0x322d('0x5')]][_0x322d('0x1a')]=utils[_0x322d('0x1b')]();if(_0xfb5cfb[_0x322d('0x31')]==_0x322d('0x32')){if(!queues[_0xfb5cfb[_0x322d('0x5')]][_0x322d('0x32')]){queues[_0xfb5cfb['uniqueid']][_0x322d('0xa')]=_0x322d('0x33');}}else{queues[_0xfb5cfb[_0x322d('0x5')]][_0x322d('0xa')]=_0x322d('0x34')+_0xfb5cfb[_0x322d('0x31')][_0x322d('0x23')]();}writeDB(queues[_0xfb5cfb[_0x322d('0x5')]]);}}};exports[_0x322d('0x35')]=function(_0x31cd04){if(!_[_0x322d('0x15')](queues[_0x31cd04['transfereeuniqueid']])){queues[_0x31cd04[_0x322d('0x36')]]['transfer']=!![];queues[_0x31cd04[_0x322d('0x36')]][_0x322d('0x37')]='BLIND';queues[_0x31cd04[_0x322d('0x36')]]['transferexten']=_0x31cd04[_0x322d('0x38')];queues[_0x31cd04[_0x322d('0x36')]]['transferuniqueid']=_0x31cd04[_0x322d('0x36')];queues[_0x31cd04[_0x322d('0x36')]]['queuecallerexitreason']=_0x322d('0x39');}};exports[_0x322d('0x3a')]=function(_0xe05f3e){try{if(_0xe05f3e['origtransfereruniqueid']==_0xe05f3e[_0x322d('0x3b')]){if(!_[_0x322d('0x15')](queues[_0xe05f3e[_0x322d('0x3c')]])){queues[_0xe05f3e[_0x322d('0x3c')]][_0x322d('0x32')]=!![];queues[_0xe05f3e['secondtransfererlinkedid']]['transfertype']=_0x322d('0x3d');queues[_0xe05f3e[_0x322d('0x3c')]]['transferexten']=_0xe05f3e[_0x322d('0x3e')];queues[_0xe05f3e[_0x322d('0x3c')]][_0x322d('0x3f')]=_0xe05f3e[_0x322d('0x40')];queues[_0xe05f3e[_0x322d('0x3c')]][_0x322d('0xa')]=_0x322d('0x41');}if(!_[_0x322d('0x15')](queues[_0xe05f3e[_0x322d('0x3b')]])){if(_0xe05f3e[_0x322d('0x42')]&&queues[_0xe05f3e[_0x322d('0x42')]]){queues[_0xe05f3e['transfereelinkedid']][_0x322d('0x1c')]=0x1;queues[_0xe05f3e['transfereeuniqueid']]=_[_0x322d('0x43')](queues[_0xe05f3e[_0x322d('0x42')]]);queues[_0xe05f3e[_0x322d('0x36')]][_0x322d('0x10')]=_0xe05f3e['transfertargetuniqueid'];queues[_0xe05f3e[_0x322d('0x36')]][_0x322d('0x1c')]=0x2;queues[_0xe05f3e[_0x322d('0x36')]]['calleridnum']=queues[_0xe05f3e[_0x322d('0x3c')]][_0x322d('0x44')];queues[_0xe05f3e[_0x322d('0x36')]]['calleridname']=queues[_0xe05f3e[_0x322d('0x3c')]][_0x322d('0x45')];queues[_0xe05f3e[_0x322d('0x36')]][_0x322d('0x29')]=utils[_0x322d('0x1b')]();queues[_0xe05f3e[_0x322d('0x36')]]['queuecallerleaveAt']=utils[_0x322d('0x1b')]();queues[_0xe05f3e[_0x322d('0x36')]][_0x322d('0x46')]=0x0;queues[_0xe05f3e['transfereeuniqueid']][_0x322d('0x47')]=0x0;}else{queues[_0xe05f3e[_0x322d('0x3b')]][_0x322d('0x10')]=_0xe05f3e[_0x322d('0x3c')];}}}else if(_0xe05f3e['secondtransfereruniqueid']==_0xe05f3e[_0x322d('0x3c')]){if(!_[_0x322d('0x15')](queues[_0xe05f3e['origtransfererlinkedid']])){queues[_0xe05f3e[_0x322d('0x3b')]][_0x322d('0x32')]=!![];queues[_0xe05f3e[_0x322d('0x3b')]][_0x322d('0x37')]='ATTENDED';queues[_0xe05f3e[_0x322d('0x3b')]][_0x322d('0x48')]=_0xe05f3e[_0x322d('0x49')];queues[_0xe05f3e[_0x322d('0x3b')]][_0x322d('0x3f')]=_0xe05f3e[_0x322d('0x4a')];queues[_0xe05f3e[_0x322d('0x3b')]][_0x322d('0xa')]='ATTENDEDTRANSFER';}if(!_[_0x322d('0x15')](queues[_0xe05f3e[_0x322d('0x3c')]])){if(_0xe05f3e[_0x322d('0x4b')]&&queues[_0xe05f3e[_0x322d('0x4b')]]){queues[_0xe05f3e[_0x322d('0x4b')]]['queuecallerenterreason']=0x1;queues[_0xe05f3e[_0x322d('0x4c')]]=_['clone'](queues[_0xe05f3e[_0x322d('0x4b')]]);queues[_0xe05f3e[_0x322d('0x4c')]]['transfereduniqueid']=_0xe05f3e[_0x322d('0x4c')];queues[_0xe05f3e['transfertargetuniqueid']][_0x322d('0x1c')]=0x2;queues[_0xe05f3e[_0x322d('0x4c')]][_0x322d('0x44')]=queues[_0xe05f3e[_0x322d('0x3b')]]['calleridnum'];queues[_0xe05f3e['transfertargetuniqueid']]['calleridname']=queues[_0xe05f3e['origtransfererlinkedid']][_0x322d('0x45')];queues[_0xe05f3e[_0x322d('0x4c')]][_0x322d('0x29')]=utils[_0x322d('0x1b')]();queues[_0xe05f3e[_0x322d('0x4c')]][_0x322d('0x16')]=utils['now']();queues[_0xe05f3e['transfertargetuniqueid']][_0x322d('0x46')]=0x0;queues[_0xe05f3e[_0x322d('0x4c')]][_0x322d('0x47')]=0x0;}else{queues[_0xe05f3e[_0x322d('0x3c')]][_0x322d('0x10')]=_0xe05f3e[_0x322d('0x3b')];}}}}catch(_0x2e4de9){utils[_0x322d('0x4d')](_0x2e4de9[_0x322d('0x4e')]);}};exports[_0x322d('0x4f')]=function(_0x4996da){if(!_[_0x322d('0x15')](queues[_0x4996da[_0x322d('0x5')]])){queues[_0x4996da[_0x322d('0x5')]][_0x322d('0x50')]=utils['now']();}};exports['musiconholdstop']=function(_0x5b3fd1){if(!_[_0x322d('0x15')](queues[_0x5b3fd1['uniqueid']])){if(!_[_0x322d('0x15')](queues[_0x5b3fd1[_0x322d('0x5')]][_0x322d('0x50')])){queues[_0x5b3fd1['uniqueid']][_0x322d('0x47')]+=utils[_0x322d('0x28')](utils['now'](),queues[_0x5b3fd1[_0x322d('0x5')]][_0x322d('0x50')]);delete queues[_0x5b3fd1[_0x322d('0x5')]]['musiconholdstartAt'];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 863d18d..aee64d8 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 _0xedd9=['UserId','request','CreateVoiceRecording','uniqueid','linkedid','context','channel','error','stack','isNil','channelstate','varset','variable','endsWith','value','.wav49','.WAV','find','monitors','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','application','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','./utils','debug','accountcode','getUserByInternal','then','name'];(function(_0x2684a1,_0x4d12a3){var _0x560dbb=function(_0x4ed0aa){while(--_0x4ed0aa){_0x2684a1['push'](_0x2684a1['shift']());}};_0x560dbb(++_0x4d12a3);}(_0xedd9,0xfc));var _0x9edd=function(_0x308817,_0x269bbb){_0x308817=_0x308817-0x0;var _0x2992b8=_0xedd9[_0x308817];return _0x2992b8;};'use strict';var _=require('lodash');var utils=require(_0x9edd('0x0'));var recordings={};function writeDB(_0x2d7989){utils[_0x9edd('0x1')](_0x2d7989);if(_0x2d7989[_0x9edd('0x2')]){utils[_0x9edd('0x3')](_0x2d7989[_0x9edd('0x2')])[_0x9edd('0x4')](function(_0x36b53f){if(_0x36b53f){_0x2d7989['membername']=_0x36b53f[_0x9edd('0x5')];_0x2d7989[_0x9edd('0x6')]=_0x36b53f['id'];}utils[_0x9edd('0x7')](_0x9edd('0x8'),_0x2d7989);});}else{utils['request'](_0x9edd('0x8'),_0x2d7989);}}exports['newchannel']=function(_0x172522){try{if(_0x172522[_0x9edd('0x9')]==_0x172522[_0x9edd('0xa')]){recordings[_0x172522[_0x9edd('0x9')]]={'uniqueid':_0x172522['uniqueid'],'accountcode':_0x172522[_0x9edd('0x2')],'exten':_0x172522['exten'],'context':_0x172522[_0x9edd('0xb')],'channel':_0x172522[_0x9edd('0xc')],'monitors':[]};}}catch(_0x523026){utils[_0x9edd('0xd')](_0x523026[_0x9edd('0xe')]);}};exports['newstate']=function(_0x30c0d7){try{if(!_[_0x9edd('0xf')](recordings[_0x30c0d7[_0x9edd('0x9')]])&&_0x30c0d7[_0x9edd('0x10')]==0x6){}else if(!_[_0x9edd('0xf')](recordings[_0x30c0d7[_0x9edd('0xa')]])&&_0x30c0d7[_0x9edd('0x10')]==0x6&&_0x30c0d7[_0x9edd('0xb')]!='transfer'){recordings[_0x30c0d7[_0x9edd('0xa')]][_0x9edd('0x2')]=_0x30c0d7[_0x9edd('0x2')];}}catch(_0x4d9a7){utils[_0x9edd('0xd')](_0x4d9a7[_0x9edd('0xe')]);}};exports[_0x9edd('0x11')]=function(_0x75a4ab){try{if(!_['isNil'](_0x75a4ab[_0x9edd('0x12')])&&!_[_0x9edd('0xf')](_0x75a4ab[_0x9edd('0x12')]['mixmonitor_filename'])){if(_[_0x9edd('0x13')](_0x75a4ab[_0x9edd('0x14')],_0x9edd('0x15'))){_0x75a4ab['value']=_0x75a4ab[_0x9edd('0x14')]['replace'](_0x9edd('0x15'),_0x9edd('0x16'));}if(recordings[_0x75a4ab['linkedid']]){var _0x498977=_[_0x9edd('0x17')](recordings[_0x75a4ab['linkedid']][_0x9edd('0x18')],{'value':_0x75a4ab['value']});if(_['isNil'](_0x498977)){recordings[_0x75a4ab[_0x9edd('0xa')]][_0x9edd('0x18')]['push']({'value':_0x75a4ab['value']});}}}}catch(_0x341d67){utils[_0x9edd('0xd')](_0x341d67[_0x9edd('0xe')]);}};exports['hangup']=function(_0x3741c8){try{if(!_[_0x9edd('0xf')](recordings[_0x3741c8[_0x9edd('0x9')]])){recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x19')]=_0x3741c8['calleridnum'];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1a')]=_0x3741c8[_0x9edd('0x1a')];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1b')]=_0x3741c8['connectedlinenum'];recordings[_0x3741c8['uniqueid']][_0x9edd('0x1c')]=_0x3741c8[_0x9edd('0x1c')];if(recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1d')]==_0x9edd('0x1e')&&recordings[_0x3741c8['uniqueid']]['accountcode']){recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1b')]=recordings[_0x3741c8[_0x9edd('0x9')]]['accountcode'];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1c')]='';}recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x18')]['forEach'](_0x2155a1=>{var _0x3fb556=_[_0x9edd('0x1f')](recordings[_0x3741c8[_0x9edd('0x9')]]);_0x3fb556[_0x9edd('0x14')]=_0x2155a1[_0x9edd('0x14')];writeDB(_0x3fb556);});delete recordings[_0x3741c8[_0x9edd('0x9')]];}}catch(_0x1fba7b){utils[_0x9edd('0xd')](_0x1fba7b[_0x9edd('0xe')]);}};exports[_0x9edd('0x20')]=function(_0x138002){try{if(!_[_0x9edd('0xf')](recordings[_0x138002[_0x9edd('0x9')]])){if(_0x138002[_0x9edd('0x21')]['toLowerCase']()==_0x9edd('0x22')&&_[_0x9edd('0x23')](_0x138002[_0x9edd('0x24')]['toLowerCase'](),_0x9edd('0x25'))){var _0x3990fb=_0x138002[_0x9edd('0x24')][_0x9edd('0x26')]('=');var _0x21bc30=_0x3990fb[0x0][_0x9edd('0x27')](_0x3990fb[0x0][_0x9edd('0x28')]('(')+0x1,_0x3990fb[0x0][_0x9edd('0x28')](')'));var _0xd0fd74=_0x3990fb[0x1];recordings[_0x138002[_0x9edd('0x9')]][_0x21bc30]=_0xd0fd74;}}}catch(_0x29e789){utils[_0x9edd('0xd')](_0x29e789[_0x9edd('0xe')]);}};exports[_0x9edd('0x29')]=function(_0x5757fc){try{if(!_[_0x9edd('0xf')](recordings[_0x5757fc['uniqueid']])){recordings[_0x5757fc[_0x9edd('0x9')]][_0x9edd('0x2a')]=_0x5757fc[_0x9edd('0x2a')];}}catch(_0x434d26){utils[_0x9edd('0xd')](_0x434d26['stack']);}}; \ No newline at end of file +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(_0x40b1d0,_0x100ce5){var _0x289531=function(_0x532897){while(--_0x532897){_0x40b1d0['push'](_0x40b1d0['shift']());}};_0x289531(++_0x100ce5);}(_0x70e0,0x17b));var _0x070e=function(_0x1f8f99,_0x4d24b3){_0x1f8f99=_0x1f8f99-0x0;var _0x53576f=_0x70e0[_0x1f8f99];return _0x53576f;};'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 diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index e37602f..33c61ed 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 _0x14ac=['error','stack','attendedtransfer','assign','origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransferercontext','origtransfererexten','attended','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','util','info','format','TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer','blind'];(function(_0x3741a8,_0x174143){var _0x27555a=function(_0x3621fd){while(--_0x3621fd){_0x3741a8['push'](_0x3741a8['shift']());}};_0x27555a(++_0x174143);}(_0x14ac,0x13b));var _0xc14a=function(_0x22f7aa,_0x5c01d8){_0x22f7aa=_0x22f7aa-0x0;var _0x9f6274=_0x14ac[_0x22f7aa];return _0x9f6274;};'use strict';var _=require('lodash');var util=require(_0xc14a('0x0'));var utils=require('./utils');function writeDB(_0x57e4a3){utils[_0xc14a('0x1')](util[_0xc14a('0x2')](_0xc14a('0x3'),_0x57e4a3[_0xc14a('0x4')]));utils[_0xc14a('0x5')](_0xc14a('0x6'),_0x57e4a3);}exports[_0xc14a('0x7')]=function(_0x577ec3){try{_0x577ec3[_0xc14a('0x4')]=_0xc14a('0x8');writeDB(_0x577ec3);}catch(_0x17a7d5){utils[_0xc14a('0x9')](_0x17a7d5[_0xc14a('0xa')]);}};exports[_0xc14a('0xb')]=function(_0x4b164e){try{_0x4b164e=_[_0xc14a('0xc')](_0x4b164e,{'transfererchannel':_0x4b164e['origtransfererchannel'],'transferercalleridnum':_0x4b164e[_0xc14a('0xd')],'transferercalleridname':_0x4b164e['origtransferercalleridname'],'transfererconnectedlinenum':_0x4b164e[_0xc14a('0xe')],'transfererconnectedlinename':_0x4b164e['secondtransfererconnectedlinename'],'transfereraccountcode':_0x4b164e[_0xc14a('0xf')],'transferercontext':_0x4b164e[_0xc14a('0x10')],'transfererexten':_0x4b164e['secondtransfererexten'],'transfererlinkedid':_0x4b164e['origtransfererlinkedid'],'context':_0x4b164e[_0xc14a('0x11')],'extension':_0x4b164e[_0xc14a('0x12')],'type':_0xc14a('0x13')});if(_['isNil'](_0x4b164e[_0xc14a('0x14')])){_0x4b164e=_[_0xc14a('0xc')](_0x4b164e,{'transfereechannel':_0x4b164e[_0xc14a('0x15')],'transfereecalleridnum':_0x4b164e[_0xc14a('0x16')],'transfereecalleridname':_0x4b164e[_0xc14a('0x17')],'transfereeconnectedlinenum':_0x4b164e['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4b164e[_0xc14a('0x18')],'transfereeaccountcode':_0x4b164e['transfertargetaccountcode'],'transfereecontext':_0x4b164e[_0xc14a('0x19')],'transfereeexten':_0x4b164e[_0xc14a('0x1a')],'transfereelinkedid':_0x4b164e['transfertargetlinkedid']});}writeDB(_0x4b164e);}catch(_0x5e836a){utils[_0xc14a('0x9')](_0x5e836a['stack']);}}; \ No newline at end of file +var _0x0d0b=['CreateVoiceTransferReport','blindtransfer','error','stack','attendedtransfer','origtransferercalleridnum','origtransferercalleridname','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','util','format','TRANSFER|%s','type','request'];(function(_0x75d058,_0x5b8b72){var _0x4a1b78=function(_0x2c90bc){while(--_0x2c90bc){_0x75d058['push'](_0x75d058['shift']());}};_0x4a1b78(++_0x5b8b72);}(_0x0d0b,0x1ef));var _0xb0d0=function(_0x4078ac,_0x1ebb43){_0x4078ac=_0x4078ac-0x0;var _0x34ddba=_0x0d0b[_0x4078ac];return _0x34ddba;};'use strict';var _=require('lodash');var util=require(_0xb0d0('0x0'));var utils=require('./utils');function writeDB(_0xc784a8){utils['info'](util[_0xb0d0('0x1')](_0xb0d0('0x2'),_0xc784a8[_0xb0d0('0x3')]));utils[_0xb0d0('0x4')](_0xb0d0('0x5'),_0xc784a8);}exports[_0xb0d0('0x6')]=function(_0x134cf1){try{_0x134cf1[_0xb0d0('0x3')]='blind';writeDB(_0x134cf1);}catch(_0x47506d){utils[_0xb0d0('0x7')](_0x47506d[_0xb0d0('0x8')]);}};exports[_0xb0d0('0x9')]=function(_0x3d6284){try{_0x3d6284=_['assign'](_0x3d6284,{'transfererchannel':_0x3d6284['origtransfererchannel'],'transferercalleridnum':_0x3d6284[_0xb0d0('0xa')],'transferercalleridname':_0x3d6284[_0xb0d0('0xb')],'transfererconnectedlinenum':_0x3d6284['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x3d6284['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3d6284[_0xb0d0('0xc')],'transferercontext':_0x3d6284[_0xb0d0('0xd')],'transfererexten':_0x3d6284[_0xb0d0('0xe')],'transfererlinkedid':_0x3d6284[_0xb0d0('0xf')],'context':_0x3d6284[_0xb0d0('0x10')],'extension':_0x3d6284[_0xb0d0('0x11')],'type':'attended'});if(_[_0xb0d0('0x12')](_0x3d6284[_0xb0d0('0x13')])){_0x3d6284=_['assign'](_0x3d6284,{'transfereechannel':_0x3d6284[_0xb0d0('0x14')],'transfereecalleridnum':_0x3d6284['transfertargetcalleridnum'],'transfereecalleridname':_0x3d6284[_0xb0d0('0x15')],'transfereeconnectedlinenum':_0x3d6284['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x3d6284[_0xb0d0('0x16')],'transfereeaccountcode':_0x3d6284['transfertargetaccountcode'],'transfereecontext':_0x3d6284[_0xb0d0('0x17')],'transfereeexten':_0x3d6284[_0xb0d0('0x18')],'transfereelinkedid':_0x3d6284['transfertargetlinkedid']});}writeDB(_0x3d6284);}catch(_0x20cc33){utils[_0xb0d0('0x7')](_0x20cc33['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 3dfbe7b..c3930cf 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 _0xceb0=['getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','bluebird','client','http','../../config/logger','xdr','info','debug','error','stack','request','stringify','catch','GetUser','internal','name','then','GETUSER|','FOUND','length','result','getUserByInternal','getUserByInterface'];(function(_0x3e0dc4,_0x13971b){var _0x586111=function(_0x123c53){while(--_0x123c53){_0x3e0dc4['push'](_0x3e0dc4['shift']());}};_0x586111(++_0x13971b);}(_0xceb0,0x140));var _0x0ceb=function(_0xe972d,_0x6d344){_0xe972d=_0xe972d-0x0;var _0x319fff=_0xceb0[_0xe972d];return _0x319fff;};'use strict';var jayson=require(_0x0ceb('0x0'));var moment=require(_0x0ceb('0x1'));var BPromise=require(_0x0ceb('0x2'));var client=jayson[_0x0ceb('0x3')][_0x0ceb('0x4')]({'port':0x2329});var logger=require(_0x0ceb('0x5'))(_0x0ceb('0x6'));exports[_0x0ceb('0x7')]=function(_0x41da11){logger['info'](_0x41da11);};exports[_0x0ceb('0x8')]=function(_0x1b5840){logger[_0x0ceb('0x8')](JSON['stringify'](_0x1b5840));};exports[_0x0ceb('0x9')]=function(_0x4ee9d3){logger[_0x0ceb('0x9')](_0x4ee9d3[_0x0ceb('0xa')]);};exports[_0x0ceb('0xb')]=function(_0x2b209a,_0x3511f9){return client[_0x0ceb('0xb')](_0x2b209a,{'body':_0x3511f9})['then'](function(_0x19c841){logger[_0x0ceb('0x8')](JSON[_0x0ceb('0xc')](_0x19c841));})[_0x0ceb('0xd')](function(_0x1962a5){logger['error'](_0x1962a5[_0x0ceb('0xa')]);});};function getUser(_0x303fff){return client[_0x0ceb('0xb')](_0x0ceb('0xe'),{'options':{'raw':!![],'attributes':['id',_0x0ceb('0xf'),_0x0ceb('0x10'),'interface'],'where':_0x303fff,'limit':0x1}})[_0x0ceb('0x11')](function(_0x5a567c){logger[_0x0ceb('0x7')](_0x0ceb('0x12')+JSON['stringify'](_0x303fff)+'|'+(_0x5a567c['result']['length']?_0x0ceb('0x13'):'NOTFOUND'));return _0x5a567c['result'][_0x0ceb('0x14')]?_0x5a567c[_0x0ceb('0x15')][0x0]:null;});}exports[_0x0ceb('0x16')]=function(_0x52e31e){return new BPromise(function(_0x541b57,_0x30e02f){if(_0x52e31e){return getUser({'internal':_0x52e31e})[_0x0ceb('0x11')](function(_0x104bcb){return _0x541b57(_0x104bcb);})[_0x0ceb('0xd')](function(_0x3cc679){logger[_0x0ceb('0x9')](_0x3cc679[_0x0ceb('0xa')]);return _0x541b57(null);});}else{return _0x541b57(null);}});};exports[_0x0ceb('0x17')]=function(_0x5ab754){return new BPromise(function(_0x584d31,_0x4043fd){if(_0x5ab754){return getUser({'interface':_0x5ab754})[_0x0ceb('0x11')](function(_0x40094e){return _0x584d31(_0x40094e);})[_0x0ceb('0xd')](function(_0x1b11a1){logger[_0x0ceb('0x9')](_0x1b11a1[_0x0ceb('0xa')]);return _0x584d31(null);});}else{return _0x584d31(null);}});};exports['getUserByName']=function(_0x2fe295){return new BPromise(function(_0xf17b18,_0x1bfe5f){if(_0x2fe295){return getUser({'name':_0x2fe295})[_0x0ceb('0x11')](function(_0x1abcbc){return _0xf17b18(_0x1abcbc);})[_0x0ceb('0xd')](function(_0xb2c0d5){logger[_0x0ceb('0x9')](_0xb2c0d5[_0x0ceb('0xa')]);return _0xf17b18(null);});}else{return _0xf17b18(null);}});};exports[_0x0ceb('0x18')]=function(_0x4dc5b6){return new BPromise(function(_0x1307b6,_0xcd0482){if(_0x4dc5b6){return client[_0x0ceb('0xb')](_0x0ceb('0x19'),{'options':{'raw':!![],'attributes':['id',_0x0ceb('0x10'),_0x0ceb('0x1a'),_0x0ceb('0x1b'),_0x0ceb('0x1c')],'where':{'name':_0x4dc5b6},'limit':0x1}})['then'](function(_0x1e4c33){logger[_0x0ceb('0x7')](_0x0ceb('0x1d')+_0x4dc5b6+'|'+(_0x1e4c33[_0x0ceb('0x15')][_0x0ceb('0x14')]?_0x0ceb('0x13'):'NOTFOUND'));return _0x1307b6(_0x1e4c33[_0x0ceb('0x15')]['length']?_0x1e4c33[_0x0ceb('0x15')][0x0]:null);})[_0x0ceb('0xd')](function(_0x225202){logger[_0x0ceb('0x9')](_0x225202[_0x0ceb('0xa')]);return _0x1307b6(null);});}else{return _0x1307b6(null);}});};exports[_0x0ceb('0x1e')]=function(_0x5ac2be,_0x3e0cfe){return moment(_0x5ac2be)[_0x0ceb('0x1f')](_0x3e0cfe,_0x0ceb('0x20'))[_0x0ceb('0x21')](_0x0ceb('0x22'));};exports[_0x0ceb('0x23')]=function(_0x51e9f7,_0x500ea5){return moment(_0x51e9f7)[_0x0ceb('0x24')](_0x500ea5,'seconds')['format'](_0x0ceb('0x22'));};exports[_0x0ceb('0x25')]=function(_0x2e9b97,_0x5e1ae6){return moment(_0x2e9b97)[_0x0ceb('0x26')](moment(_0x5e1ae6),_0x0ceb('0x20'));};exports[_0x0ceb('0x27')]=function(_0x113fff,_0x4d1736){return parseInt(_0x113fff,0xa)+parseInt(_0x4d1736,0xa);};exports[_0x0ceb('0x28')]=function(){return moment()[_0x0ceb('0x21')](_0x0ceb('0x22'));};exports[_0x0ceb('0x29')]=function(_0x896064,_0x13ee3a){if(_0x13ee3a){return moment(_0x896064)['isAfter'](_0x13ee3a);}else{return!![];}};exports[_0x0ceb('0x2a')]=function(_0x3bd053,_0x4e8e96){if(_0x4e8e96){return moment(_0x3bd053)[_0x0ceb('0x2a')](_0x4e8e96);}else if(_0x3bd053){return!![];}else{return![];}}; \ No newline at end of file +var _0x9201=['length','NOTFOUND','getUserByInternal','getUserByInterface','getVoiceQueueByName','GetVoiceQueue','type','addTime','add','format','seconds','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','moment','bluebird','client','http','../../config/logger','xdr','info','debug','stringify','error','stack','request','then','catch','name','interface','GETUSER|','result'];(function(_0x1e5725,_0x3f4e13){var _0x4b5cf8=function(_0x2e9a53){while(--_0x2e9a53){_0x1e5725['push'](_0x1e5725['shift']());}};_0x4b5cf8(++_0x3f4e13);}(_0x9201,0xa2));var _0x1920=function(_0x448c06,_0x363654){_0x448c06=_0x448c06-0x0;var _0x29f030=_0x9201[_0x448c06];return _0x29f030;};'use strict';var jayson=require('jayson/promise');var moment=require(_0x1920('0x0'));var BPromise=require(_0x1920('0x1'));var client=jayson[_0x1920('0x2')][_0x1920('0x3')]({'port':0x2329});var logger=require(_0x1920('0x4'))(_0x1920('0x5'));exports['info']=function(_0x4d083c){logger[_0x1920('0x6')](_0x4d083c);};exports[_0x1920('0x7')]=function(_0x361f0d){logger[_0x1920('0x7')](JSON[_0x1920('0x8')](_0x361f0d));};exports['error']=function(_0x34b87c){logger[_0x1920('0x9')](_0x34b87c[_0x1920('0xa')]);};exports[_0x1920('0xb')]=function(_0x2ea08a,_0x546c36){return client['request'](_0x2ea08a,{'body':_0x546c36})[_0x1920('0xc')](function(_0x4e9bc3){logger[_0x1920('0x7')](JSON['stringify'](_0x4e9bc3));})[_0x1920('0xd')](function(_0x2371aa){logger[_0x1920('0x9')](_0x2371aa[_0x1920('0xa')]);});};function getUser(_0x536c7b){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0x1920('0xe'),_0x1920('0xf')],'where':_0x536c7b,'limit':0x1}})[_0x1920('0xc')](function(_0x50d9b3){logger['info'](_0x1920('0x10')+JSON[_0x1920('0x8')](_0x536c7b)+'|'+(_0x50d9b3[_0x1920('0x11')][_0x1920('0x12')]?'FOUND':_0x1920('0x13')));return _0x50d9b3['result'][_0x1920('0x12')]?_0x50d9b3[_0x1920('0x11')][0x0]:null;});}exports[_0x1920('0x14')]=function(_0x58f641){return new BPromise(function(_0x4adecd,_0x2d2611){if(_0x58f641){return getUser({'internal':_0x58f641})[_0x1920('0xc')](function(_0x5765d8){return _0x4adecd(_0x5765d8);})[_0x1920('0xd')](function(_0x1b26b8){logger[_0x1920('0x9')](_0x1b26b8['stack']);return _0x4adecd(null);});}else{return _0x4adecd(null);}});};exports[_0x1920('0x15')]=function(_0x18b94e){return new BPromise(function(_0x3018cb,_0x4f422c){if(_0x18b94e){return getUser({'interface':_0x18b94e})[_0x1920('0xc')](function(_0x1d4991){return _0x3018cb(_0x1d4991);})[_0x1920('0xd')](function(_0x81e9b6){logger[_0x1920('0x9')](_0x81e9b6[_0x1920('0xa')]);return _0x3018cb(null);});}else{return _0x3018cb(null);}});};exports['getUserByName']=function(_0x2eb7bb){return new BPromise(function(_0x34689c,_0x1c2908){if(_0x2eb7bb){return getUser({'name':_0x2eb7bb})['then'](function(_0x353422){return _0x34689c(_0x353422);})[_0x1920('0xd')](function(_0x388b3d){logger['error'](_0x388b3d[_0x1920('0xa')]);return _0x34689c(null);});}else{return _0x34689c(null);}});};exports[_0x1920('0x16')]=function(_0x4353b9){return new BPromise(function(_0x1e962a,_0x58d820){if(_0x4353b9){return client[_0x1920('0xb')](_0x1920('0x17'),{'options':{'raw':!![],'attributes':['id',_0x1920('0xe'),_0x1920('0x18'),'acw','acwTimeout'],'where':{'name':_0x4353b9},'limit':0x1}})[_0x1920('0xc')](function(_0x3c172e){logger[_0x1920('0x6')]('GETVOICEQUEUEBYNAME|'+_0x4353b9+'|'+(_0x3c172e[_0x1920('0x11')][_0x1920('0x12')]?'FOUND':_0x1920('0x13')));return _0x1e962a(_0x3c172e[_0x1920('0x11')][_0x1920('0x12')]?_0x3c172e['result'][0x0]:null);})[_0x1920('0xd')](function(_0x1d096e){logger[_0x1920('0x9')](_0x1d096e['stack']);return _0x1e962a(null);});}else{return _0x1e962a(null);}});};exports[_0x1920('0x19')]=function(_0x100f12,_0x5f2dae){return moment(_0x100f12)[_0x1920('0x1a')](_0x5f2dae,'seconds')[_0x1920('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');};exports['subtractTime']=function(_0x4f7deb,_0x415758){return moment(_0x4f7deb)['subtract'](_0x415758,_0x1920('0x1c'))[_0x1920('0x1b')](_0x1920('0x1d'));};exports[_0x1920('0x1e')]=function(_0x396c38,_0x280c90){return moment(_0x396c38)[_0x1920('0x1f')](moment(_0x280c90),_0x1920('0x1c'));};exports[_0x1920('0x20')]=function(_0x343224,_0x193526){return parseInt(_0x343224,0xa)+parseInt(_0x193526,0xa);};exports[_0x1920('0x21')]=function(){return moment()['format'](_0x1920('0x1d'));};exports[_0x1920('0x22')]=function(_0x48cc76,_0x31aadb){if(_0x31aadb){return moment(_0x48cc76)[_0x1920('0x22')](_0x31aadb);}else{return!![];}};exports[_0x1920('0x23')]=function(_0xfe2c41,_0x35ac8b){if(_0x35ac8b){return moment(_0xfe2c41)[_0x1920('0x23')](_0x35ac8b);}else if(_0xfe2c41){return!![];}else{return![];}}; \ No newline at end of file diff --git a/snippet/1.0.14/styles/custom.css b/snippet/1.0.14/styles/custom.css deleted file mode 100644 index cc0c92d..0000000 --- a/snippet/1.0.14/styles/custom.css +++ /dev/null @@ -1,401 +0,0 @@ -.emojionearea{ - - width:100%; -} - -#id-row { - height: 87% !important; -} - -#chat-app { - height: 100% !important; - width: 295px; - background-color: transparent -} - -#chat-app .header-button { - padding: 0; - margin: 0; - font-size: 18px; - cursor: pointer -} - -#chat-app .chat-toolbar { - top: 0; - min-height: 50px; - width: 275px; - position: fixed; - cursor: pointer; - outline: 0 -} - -#chat-app .chat-content { - top: 56px; - bottom: 0; - height: 100% !important; - background: #fff; - border: 1px solid #d3d3d3; - -ms-overflow-style: none; - overflow: auto -} - - -#chat-app .chat-content .chat-messages { - height: 85% !important; - overflow: auto; - border-bottom: 1px solid #d3d3d3 -} - -#chat-app .chat-content .chat-online { - height: 392px; - padding: 20px -} - -#chat-app .chat-content .chat-unmanaged { - height: 392px; - padding: 20px -} - -#chat-app .avatar-wrapper { - position: relative; - bottom: -3px; - right: 5px -} - -#chat-app .chat-content .message-row .bubble { - word-wrap: break-word; - position: relative; - max-width: 268px; - padding: 6px 7px 8px 9px; - background-color: #fff; - /* box-shadow: 0 1px .5px rgba(0, 0, 0, .13); */ - border-radius: 6px -} - -#chat-app .chat-content .message-row .bubble .message { - white-space: pre-wrap -} - -#chat-app .chat-content .message-row .bubble .message-done { - color: #dcdcdc -} - -#chat-app .chat-content .message-row .bubble .message-done-all { - color: #00bfff -} - -#chat-app .chat-content .message-row .bubble:before { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAADGUExURQAAAP////b29vn5+f///wAAAP///wAAAAAAAP///9ra2v////j4+PHx8fv7++Hh4fHx8f////////////////39/QAAAP////////z8/P////39/f39/fz8/P////////////z8/P////////////z8/P////////////v7+/Hx8f///9bW1vz8/K2trf////39/f39/WJiYgAAAExMTFtbWwAAAN3d3cjIyPr6+vX19QAAAO7u7vz8/NTU1Ofn5zMzM////zGPlXsAAABBdFJOUwAcm/kREh4CCDWL1SneR6TfAQffhMYK/A5nRrLWfRc5DW2ih5f+19Kn+9v4g/1LCJuXHwQUKgahcXS6DNnlDMMKKzPoTgAAAKBJREFUKM+V08USwmAQA+C/0NIWd3d3d8/7vxTMcIPkQK7f7CG7s8bQAOY/SCuwFYQU1P+eiCqIK2gpWCmoCrAgoKQgJ8CHgIqAMjg0MxxSQ3DogEMWFBZtUPAHYGB1CyDQWE6AH7BrfXzlAxGAQhECTGAmwN1Okz0Gb/LW4fEItIfrOfNELMh3tck7u+PhcT2zQ7l77/K8iY8yJwV3BeYFqpc/uSyPGdAAAAAASUVORK5CYII=); - content: ''; - position: absolute; - left: -11px; - bottom: 3px; - width: 12px; - height: 19px; - background-position: 50% 50%; - background-repeat: no-repeat; - background-size: contain -} - -#chat-app .chat-content .message-row .bubble .time { - font-size: 10px; - text-align: right; - margin-bottom: 5px -} - -#chat-app .chat-content .message-row.out .avatar { - margin: 0 16px 0 0; - width: 40px; - min-width: 40px; - height: 40px; - line-height: 40px; - border-radius: 50%; - font-weight: 500; - text-align: center; - color: #fff -} - -#chat-app .chat-content .message-row.auto { - align-items: flex-end; - font-style: italic -} - -#chat-app .chat-content .message-row.auto .avatar { - margin: 0 16px 0 0; - width: 40px; - min-width: 40px; - height: 40px; - line-height: 40px; - border-radius: 50%; - font-size: 17px; - font-style: italic; - font-weight: 500; - text-align: center; - color: #fff -} - -#chat-app .chat-content .message-row.in { - align-items: flex-end -} - -#chat-app .chat-content .message-row.in2 { - align-items: flex-end -} - -#chat-app .chat-content .message-row.out { - align-items: flex-end -} - -#chat-app .chat-content .message-row.in2 .avatar { - margin: 0 16px 0 0; - width: 40px; - min-width: 40px; - height: 40px; - line-height: 40px; - border-radius: 50%; - font-weight: 500; - text-align: center; - color: #fff -} - -#chat-app .chat-content .message-row.in2 .bubble { - margin-right: auto; - background-color: #e8f5e9; - border: 1px solid #dfebe0; - order: 1 -} - -#chat-app .chat-content .message-row.in2 .bubble:before { - left: -11px; - right: auto; - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAD2UExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRsXAAAANzwzNPmxNrtyau5oIWRedDkwNntyczgwdfpyJ+/n97wzsLWtNjsytvwzczfvtPmxau6nNjqxtrtyio1KtzwzNjryAAAANzwzgAAANzwzK7Aor/Us9Lnw8vevAAAAMzevtbpxrvMrX+IdwAAAEROOi45Lr3MrZGjf9LoxX+MctnqydLkwhgYGMzfv9vuyQAAANzwzNvuy9zxy7vMu7XGqNvtzKKykwAAANruzKq6nLnMriQkGMXXuL3PsNjsySgzKAAAANLkw83fvd3vy9z4xtzwzRpFmIEAAABQdFJOUwAXChEGBAMBAgwhDvJ7k0YqMc0Zmwj6apf2kjU0+dkw/swh/CP9j2Wr2gndvaYeBRoxQg6gUPt/FaHJGdTj9A9k7XQLeE6iFcN12xkSt9r4NKizowAAAMFJREFUKM+V0sdywlAMBVDbMX7PQCihQ+iQ0HsJvfem/P/PwBIzugu0PXNnNNJVyPmhsIPhhoB2COwIGuLdhAcl3AhCBoBoHUC6BCBbA0C/EkBFB5D/FjxQwQYg1RI8UKINgDoSAPUlAPqUAMgfAEBfXsEDBV0+Hogi4Zhg4THj9YwHoqEBYOrgYTI3GVgMNn8r+Qq94k9yZNosW/3Hy9VuTjWfHkOX6367bGZUU7de66ieHZrO1OGg8Z1WTgYAFLgD5S1PCkzo1B0AAAAASUVORK5CYII=); - -webkit-transform: rotate(180deg); - transform: rotate(180deg) -} - -#chat-app .chat-content .message-row.in .avatar { - order: 2; - margin: 0 0 0 16px; - width: 40px; - min-width: 40px; - height: 40px; - line-height: 40px; - border-radius: 50%; - font-weight: 500; - text-align: center; - color: #fff -} - -#chat-app .chat-content .message-row.in .bubble { - margin-left: auto; - background-color: #e8f5e9; - border: 1px solid #dfebe0; - order: 1 -} - -#chat-app .chat-content .message-row.in .bubble:before { - right: -11px; - left: auto; - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAD2UExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRsXAAAANzwzNPmxNrtyau5oIWRedDkwNntyczgwdfpyJ+/n97wzsLWtNjsytvwzczfvtPmxau6nNjqxtrtyio1KtzwzNjryAAAANzwzgAAANzwzK7Aor/Us9Lnw8vevAAAAMzevtbpxrvMrX+IdwAAAEROOi45Lr3MrZGjf9LoxX+MctnqydLkwhgYGMzfv9vuyQAAANzwzNvuy9zxy7vMu7XGqNvtzKKykwAAANruzKq6nLnMriQkGMXXuL3PsNjsySgzKAAAANLkw83fvd3vy9z4xtzwzRpFmIEAAABQdFJOUwAXChEGBAMBAgwhDvJ7k0YqMc0Zmwj6apf2kjU0+dkw/swh/CP9j2Wr2gndvaYeBRoxQg6gUPt/FaHJGdTj9A9k7XQLeE6iFcN12xkSt9r4NKizowAAAMFJREFUKM+V0sdywlAMBVDbMX7PQCihQ+iQ0HsJvfem/P/PwBIzugu0PXNnNNJVyPmhsIPhhoB2COwIGuLdhAcl3AhCBoBoHUC6BCBbA0C/EkBFB5D/FjxQwQYg1RI8UKINgDoSAPUlAPqUAMgfAEBfXsEDBV0+Hogi4Zhg4THj9YwHoqEBYOrgYTI3GVgMNn8r+Qq94k9yZNosW/3Hy9VuTjWfHkOX6367bGZUU7de66ieHZrO1OGg8Z1WTgYAFLgD5S1PCkzo1B0AAAAASUVORK5CYII=) -} - -#chat-app .chat-footer { - width: 100%; - /* top: -100px !important; */ -} - -#waiting { - overflow: visible; - height: 392px; - background: #fff; - text-align: center; - flex: 1 0 auto; - padding: 32px -} - -#waiting .subtitle { - margin: 16px 0; - max-width: 300px; - color: rgba(0, 0, 0, .54) -} - -.sk-fading-circle { - width: 40px; - height: 40px; - position: relative -} - -.sk-fading-circle .sk-circle { - width: 100%; - height: 100%; - position: absolute; - left: 0; - top: 0 -} - -.sk-fading-circle .sk-circle:before { - content: ''; - display: block; - margin: 0 auto; - width: 15%; - height: 15%; - background-color: #333; - border-radius: 100%; - -webkit-animation: sk-circleFadeDelay 1.2s infinite ease-in-out both; - animation: sk-circleFadeDelay 1.2s infinite ease-in-out both -} - -.sk-fading-circle .sk-circle2 { - -webkit-transform: rotate(30deg); - -ms-transform: rotate(30deg); - transform: rotate(30deg) -} - -.sk-fading-circle .sk-circle3 { - -webkit-transform: rotate(60deg); - -ms-transform: rotate(60deg); - transform: rotate(60deg) -} - -.sk-fading-circle .sk-circle4 { - -webkit-transform: rotate(90deg); - -ms-transform: rotate(90deg); - transform: rotate(90deg) -} - -.sk-fading-circle .sk-circle5 { - -webkit-transform: rotate(120deg); - -ms-transform: rotate(120deg); - transform: rotate(120deg) -} - -.sk-fading-circle .sk-circle6 { - -webkit-transform: rotate(150deg); - -ms-transform: rotate(150deg); - transform: rotate(150deg) -} - -.sk-fading-circle .sk-circle7 { - -webkit-transform: rotate(180deg); - -ms-transform: rotate(180deg); - transform: rotate(180deg) -} - -.sk-fading-circle .sk-circle8 { - -webkit-transform: rotate(210deg); - -ms-transform: rotate(210deg); - transform: rotate(210deg) -} - -.sk-fading-circle .sk-circle9 { - -webkit-transform: rotate(240deg); - -ms-transform: rotate(240deg); - transform: rotate(240deg) -} - -.sk-fading-circle .sk-circle10 { - -webkit-transform: rotate(270deg); - -ms-transform: rotate(270deg); - transform: rotate(270deg) -} - -.sk-fading-circle .sk-circle11 { - -webkit-transform: rotate(300deg); - -ms-transform: rotate(300deg); - transform: rotate(300deg) -} - -.sk-fading-circle .sk-circle12 { - -webkit-transform: rotate(330deg); - -ms-transform: rotate(330deg); - transform: rotate(330deg) -} - -.sk-fading-circle .sk-circle2:before { - -webkit-animation-delay: -1.1s; - animation-delay: -1.1s -} - -.sk-fading-circle .sk-circle3:before { - -webkit-animation-delay: -1s; - animation-delay: -1s -} - -.sk-fading-circle .sk-circle4:before { - -webkit-animation-delay: -.9s; - animation-delay: -.9s -} - -.sk-fading-circle .sk-circle5:before { - -webkit-animation-delay: -.8s; - animation-delay: -.8s -} - -.sk-fading-circle .sk-circle6:before { - -webkit-animation-delay: -.7s; - animation-delay: -.7s -} - -.sk-fading-circle .sk-circle7:before { - -webkit-animation-delay: -.6s; - animation-delay: -.6s -} - -.sk-fading-circle .sk-circle8:before { - -webkit-animation-delay: -.5s; - animation-delay: -.5s -} - -.sk-fading-circle .sk-circle9:before { - -webkit-animation-delay: -.4s; - animation-delay: -.4s -} - -.sk-fading-circle .sk-circle10:before { - -webkit-animation-delay: -.3s; - animation-delay: -.3s -} - -.sk-fading-circle .sk-circle11:before { - -webkit-animation-delay: -.2s; - animation-delay: -.2s -} - -.sk-fading-circle .sk-circle12:before { - -webkit-animation-delay: -.1s; - animation-delay: -.1s -} - -@-webkit-keyframes sk-circleFadeDelay { - - 0%, - 100%, - 39% { - opacity: 0 - } - - 40% { - opacity: 1 - } -} - -@keyframes sk-circleFadeDelay { - - 0%, - 100%, - 39% { - opacity: 0 - } - - 40% { - opacity: 1 - } -} - -md-toast.md-success-toast .md-toast-content { - background-color: green -} - -md-toast.md-failure-toast .md-toast-content { - background-color: red -} \ No newline at end of file diff --git a/snippet/1.0.14/styles/mobile.css b/snippet/1.0.14/styles/mobile.css deleted file mode 100644 index cdc3042..0000000 --- a/snippet/1.0.14/styles/mobile.css +++ /dev/null @@ -1,161 +0,0 @@ -/* IFRAME GENERALE*/ -iframe[id='motion-chat-iframe'] { - /* Style attributes*/ - - position: fixed; - height: 450px; - border: 0; - /* box-shadow: 0px 0px 10px 2px #333333; */ - -webkit-transition: all 0.7s ease-out; - -moz-transition: all 0.7s ease-out; - -ms-transition: all 0.7s ease-out; - -o-transition: all 0.7s ease-out; - transition: all 0.7s ease-out; - z-index: 9999; - /* overflow: hidden; */ - -} - -/* IFRAME BASSO-DESTRA*/ -.motion-chat-iframe-bottom_right { - /* Style attributes*/ - - width: 295px; - bottom: -400px; - right: 0; - -} - -/* IFRAME DESTRA*/ -.motion-chat-iframe-right { - /* Style attributes*/ - - width: 295px; - right: -312px; - -} - -/* LINGUETTA DESTRA*/ -.motion-chat-div-right { - /* Style attributes*/ - - display: none; - right: 0px; - position: fixed; - cursor: pointer; - height: 100px; - width: 25px; - -webkit-transition: all 0.7s ease-out; - -moz-transition: all 0.7s ease-out; - -ms-transition: all 0.7s ease-out; - -o-transition: all 0.7s ease-out; - transition: all 0.7s ease-out; - z-index: 9999; - -} - -/* IFRAME SINISTRA*/ -.motion-chat-iframe-left { - /* Style attributes*/ - - width: 295px; - left: -297px; - -} - -/* LINGUETTA SINISTRA*/ -.motion-chat-div-left { - /* Style attributes*/ - - left: 0px; - display: none; - position: fixed; - cursor: pointer; - height: 100px; - width: 25px; - -webkit-transition: all 0.7s ease-out; - -moz-transition: all 0.7s ease-out; - -ms-transition: all 0.7s ease-out; - -o-transition: all 0.7s ease-out; - transition: all 0.7s ease-out; - z-index: 9999; - -} - -@media only screen and (max-width: 320px) { - - /* IFRAME BASSO-DESTRA*/ - .motion-chat-iframe-right { - /* Style attributes*/ - - width: 295px; - bottom: 0px; - right: 0; - - } - - /* IFRAME BASSO-DESTRA*/ - .motion-chat-iframe-left { - /* Style attributes*/ - - width: 295px; - bottom: 0px; - right: 0; - - } - -} - -@media only screen and (max-height: 450px) { - - /* IFRAME BASSO-DESTRA*/ - iframe[id='motion-chat-iframe'] { - /* Style attributes*/ - height: 100% !important; - - } - - .motion-chat-iframe-right { - /* Style attributes*/ - - top: 0px !important; - - } - - /* IFRAME BASSO-DESTRA*/ - .motion-chat-iframe-left { - /* Style attributes*/ - - top: 0px !important; - - } - - div[id='motion-chat-iframe-tab'] { - /* Style attributes*/ - - top: auto !important; - bottom: 0px !important; - - } -} - -#chat_tab_arrow { - font-family: Serif; - font-size: 25px; - padding-left: 5px; - padding-top: 0px; - width: auto !important; - margin-right: 1px !important; - margin-left: 1px !important; - margin-top: 1px !important; - font-weight: bolder !important; - line-height: 1 !important; -} - -#chat_tab_text { - font-family: Sans-Serif; - font-size: 17px; - margin-top: 12px !important; - margin-left: 5px !important; - line-height: 1 !important; -} \ No newline at end of file diff --git a/snippet/1.0.14/fonts/materialdesignicons-webfont.svg b/snippet/1.0.15/fonts/materialdesignicons-webfont.svg similarity index 100% rename from snippet/1.0.14/fonts/materialdesignicons-webfont.svg rename to snippet/1.0.15/fonts/materialdesignicons-webfont.svg diff --git a/snippet/1.0.14/index.html b/snippet/1.0.15/index.html similarity index 93% rename from snippet/1.0.14/index.html rename to snippet/1.0.15/index.html index ab83dd4..a16f821 100644 --- a/snippet/1.0.14/index.html +++ b/snippet/1.0.15/index.html @@ -8,9 +8,9 @@ document.write(""); - + - + @@ -58,9 +58,9 @@ - + - + diff --git a/snippet/1.0.14/scripts/app.js b/snippet/1.0.15/scripts/app.js similarity index 100% rename from snippet/1.0.14/scripts/app.js rename to snippet/1.0.15/scripts/app.js diff --git a/snippet/1.0.14/scripts/vendor.js b/snippet/1.0.15/scripts/vendor.js similarity index 100% rename from snippet/1.0.14/scripts/vendor.js rename to snippet/1.0.15/scripts/vendor.js diff --git a/snippet/1.0.14/styles/app.css b/snippet/1.0.15/styles/app.css similarity index 100% rename from snippet/1.0.14/styles/app.css rename to snippet/1.0.15/styles/app.css diff --git a/snippet/1.0.14/styles/vendor.css b/snippet/1.0.15/styles/vendor.css similarity index 100% rename from snippet/1.0.14/styles/vendor.css rename to snippet/1.0.15/styles/vendor.css